@rededor/cura 1.0.0-alpha.1 → 1.0.0-alpha.2

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 (177) hide show
  1. package/dist/cjs/cura-accordion_9.cjs.entry.js +6 -6
  2. package/dist/cjs/cura-accordion_9.cjs.entry.js.map +1 -1
  3. package/dist/cjs/cura-button-outline.cjs.entry.js +2 -2
  4. package/dist/cjs/cura-button-outline.cjs.entry.js.map +1 -1
  5. package/dist/cjs/cura-button-select.cjs.entry.js +2 -2
  6. package/dist/cjs/cura-button-select.cjs.entry.js.map +1 -1
  7. package/dist/cjs/cura-button-transparent_2.cjs.entry.js +2 -2
  8. package/dist/cjs/cura-button-transparent_2.cjs.entry.js.map +1 -1
  9. package/dist/cjs/cura-checkbox.cjs.entry.js +1 -1
  10. package/dist/cjs/cura-display.cjs.entry.js +1 -1
  11. package/dist/cjs/cura-dropdown-search-option-title.cjs.entry.js +1 -1
  12. package/dist/cjs/cura-dropdown-search-option.cjs.entry.js +16 -8
  13. package/dist/cjs/cura-dropdown-search-option.cjs.entry.js.map +1 -1
  14. package/dist/cjs/cura-dropdown-search.cjs.entry.js +19 -11
  15. package/dist/cjs/cura-dropdown-search.cjs.entry.js.map +1 -1
  16. package/dist/cjs/cura-loader-bar.cjs.entry.js +46 -0
  17. package/dist/cjs/cura-loader-bar.cjs.entry.js.map +1 -0
  18. package/dist/cjs/cura-radio.cjs.entry.js +1 -1
  19. package/dist/cjs/cura-select_2.cjs.entry.js +4 -4
  20. package/dist/cjs/cura-switch.cjs.entry.js +1 -1
  21. package/dist/cjs/cura-toast.cjs.entry.js +106 -0
  22. package/dist/cjs/cura-toast.cjs.entry.js.map +1 -0
  23. package/dist/cjs/cura.cjs.js +1 -1
  24. package/dist/cjs/loader.cjs.js +1 -1
  25. package/dist/collection/collection-manifest.json +2 -0
  26. package/dist/collection/components/buttons/cura-button/cura-button.js +6 -6
  27. package/dist/collection/components/buttons/cura-button/cura-button.js.map +1 -1
  28. package/dist/collection/components/buttons/cura-button-outline/cura-button-outline.js +6 -6
  29. package/dist/collection/components/buttons/cura-button-outline/cura-button-outline.js.map +1 -1
  30. package/dist/collection/components/buttons/cura-button-select/cura-button-select.js +6 -6
  31. package/dist/collection/components/buttons/cura-button-select/cura-button-select.js.map +1 -1
  32. package/dist/collection/components/buttons/cura-button-transparent/cura-button-transparent.js +6 -6
  33. package/dist/collection/components/buttons/cura-button-transparent/cura-button-transparent.js.map +1 -1
  34. package/dist/collection/components/cura-toast/cura-toast.css +161 -0
  35. package/dist/collection/components/cura-toast/cura-toast.js +261 -0
  36. package/dist/collection/components/cura-toast/cura-toast.js.map +1 -0
  37. package/dist/collection/components/cura-toast/cura-toast.stories.js +149 -0
  38. package/dist/collection/components/cura-toast/cura-toast.stories.js.map +1 -0
  39. package/dist/collection/components/forms/cura-checkbox/cura-checkbox.js +1 -1
  40. package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.css +4 -1
  41. package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.js +33 -7
  42. package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.js.map +1 -1
  43. package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.stories.js +10 -1
  44. package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.stories.js.map +1 -1
  45. package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search-option-title/cura-dropdown-search-option-title.js +1 -1
  46. package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search.css +2 -2
  47. package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search.js +36 -10
  48. package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search.js.map +1 -1
  49. package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search.stories.js +15 -3
  50. package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search.stories.js.map +1 -1
  51. package/dist/collection/components/forms/cura-label/cura-label.js +1 -1
  52. package/dist/collection/components/forms/cura-radio/cura-radio.js +1 -1
  53. package/dist/collection/components/forms/cura-select/cura-select.js +3 -3
  54. package/dist/collection/components/forms/cura-select-options/cura-select-option.js +1 -1
  55. package/dist/collection/components/forms/cura-switch/cura-switch.js +1 -1
  56. package/dist/collection/components/loaders/cura-loader-bar/cura-loader-bar.css +21 -0
  57. package/dist/collection/components/loaders/cura-loader-bar/cura-loader-bar.js +95 -0
  58. package/dist/collection/components/loaders/cura-loader-bar/cura-loader-bar.js.map +1 -0
  59. package/dist/collection/components/loaders/cura-loader-bar/cura-loader-bar.stories.js +54 -0
  60. package/dist/collection/components/loaders/cura-loader-bar/cura-loader-bar.stories.js.map +1 -0
  61. package/dist/collection/components/loaders/cura-loader-circle/cura-loader-circle.js +1 -1
  62. package/dist/collection/components/text/cura-display/cura-display.js +1 -1
  63. package/dist/collection/components/text/cura-heading/cura-heading.js +1 -1
  64. package/dist/collection/components/text/cura-paragraph/cura-paragraph.js +1 -1
  65. package/dist/components/cura-button-outline.js +3 -3
  66. package/dist/components/cura-button-outline.js.map +1 -1
  67. package/dist/components/cura-button-select.js +3 -3
  68. package/dist/components/cura-button-select.js.map +1 -1
  69. package/dist/components/cura-button-transparent2.js +3 -3
  70. package/dist/components/cura-button-transparent2.js.map +1 -1
  71. package/dist/components/cura-button.js +3 -3
  72. package/dist/components/cura-button.js.map +1 -1
  73. package/dist/components/cura-checkbox.js +1 -1
  74. package/dist/components/cura-display.js +1 -1
  75. package/dist/components/cura-dropdown-search-option-title.js +1 -1
  76. package/dist/components/cura-dropdown-search-option.js +17 -8
  77. package/dist/components/cura-dropdown-search-option.js.map +1 -1
  78. package/dist/components/cura-dropdown-search.js +20 -11
  79. package/dist/components/cura-dropdown-search.js.map +1 -1
  80. package/dist/components/cura-heading2.js +1 -1
  81. package/dist/components/cura-label2.js +1 -1
  82. package/dist/components/cura-loader-bar.d.ts +11 -0
  83. package/dist/components/cura-loader-bar.js +8 -0
  84. package/dist/components/cura-loader-bar.js.map +1 -0
  85. package/dist/components/cura-loader-bar2.js +64 -0
  86. package/dist/components/cura-loader-bar2.js.map +1 -0
  87. package/dist/components/cura-loader-circle2.js +1 -1
  88. package/dist/components/cura-paragraph2.js +1 -1
  89. package/dist/components/cura-radio.js +1 -1
  90. package/dist/components/cura-select-option2.js +1 -1
  91. package/dist/components/cura-select2.js +3 -3
  92. package/dist/components/cura-switch.js +1 -1
  93. package/dist/components/cura-toast.d.ts +11 -0
  94. package/dist/components/cura-toast.js +157 -0
  95. package/dist/components/cura-toast.js.map +1 -0
  96. package/dist/components/index.js +4 -0
  97. package/dist/components/index.js.map +1 -1
  98. package/dist/cura/cura.esm.js +1 -1
  99. package/dist/cura/cura.esm.js.map +1 -1
  100. package/dist/cura/p-039b3701.entry.js +2 -0
  101. package/dist/cura/p-039b3701.entry.js.map +1 -0
  102. package/dist/cura/p-29790bb5.entry.js +2 -0
  103. package/dist/cura/p-29790bb5.entry.js.map +1 -0
  104. package/dist/cura/p-4eaeb590.entry.js +2 -0
  105. package/dist/cura/p-4eaeb590.entry.js.map +1 -0
  106. package/dist/cura/p-5e5f37c7.entry.js +2 -0
  107. package/dist/cura/p-5e5f37c7.entry.js.map +1 -0
  108. package/dist/cura/{p-ba2e7222.entry.js → p-5fcfbf32.entry.js} +2 -2
  109. package/dist/cura/{p-3c39a9d8.entry.js → p-67e34464.entry.js} +2 -2
  110. package/dist/cura/{p-5466758a.entry.js → p-8433fec9.entry.js} +2 -2
  111. package/dist/cura/{p-3b4bf71e.entry.js → p-86b6e638.entry.js} +2 -2
  112. package/dist/cura/p-86b6e638.entry.js.map +1 -0
  113. package/dist/cura/p-a5e53dd4.entry.js +2 -0
  114. package/dist/cura/{p-ced36448.entry.js.map → p-a5e53dd4.entry.js.map} +1 -1
  115. package/dist/cura/{p-578c74a4.entry.js → p-a9dad622.entry.js} +2 -2
  116. package/dist/cura/p-af2036a7.entry.js +2 -0
  117. package/dist/cura/p-b1148bb2.entry.js +2 -0
  118. package/dist/cura/p-b1148bb2.entry.js.map +1 -0
  119. package/dist/cura/p-e1253a09.entry.js +2 -0
  120. package/dist/cura/p-e1253a09.entry.js.map +1 -0
  121. package/dist/cura/{p-17a878d4.entry.js → p-e622006c.entry.js} +2 -2
  122. package/dist/cura/p-e622006c.entry.js.map +1 -0
  123. package/dist/esm/cura-accordion_9.entry.js +6 -6
  124. package/dist/esm/cura-accordion_9.entry.js.map +1 -1
  125. package/dist/esm/cura-button-outline.entry.js +2 -2
  126. package/dist/esm/cura-button-outline.entry.js.map +1 -1
  127. package/dist/esm/cura-button-select.entry.js +2 -2
  128. package/dist/esm/cura-button-select.entry.js.map +1 -1
  129. package/dist/esm/cura-button-transparent_2.entry.js +2 -2
  130. package/dist/esm/cura-button-transparent_2.entry.js.map +1 -1
  131. package/dist/esm/cura-checkbox.entry.js +1 -1
  132. package/dist/esm/cura-display.entry.js +1 -1
  133. package/dist/esm/cura-dropdown-search-option-title.entry.js +1 -1
  134. package/dist/esm/cura-dropdown-search-option.entry.js +16 -8
  135. package/dist/esm/cura-dropdown-search-option.entry.js.map +1 -1
  136. package/dist/esm/cura-dropdown-search.entry.js +19 -11
  137. package/dist/esm/cura-dropdown-search.entry.js.map +1 -1
  138. package/dist/esm/cura-loader-bar.entry.js +42 -0
  139. package/dist/esm/cura-loader-bar.entry.js.map +1 -0
  140. package/dist/esm/cura-radio.entry.js +1 -1
  141. package/dist/esm/cura-select_2.entry.js +4 -4
  142. package/dist/esm/cura-switch.entry.js +1 -1
  143. package/dist/esm/cura-toast.entry.js +102 -0
  144. package/dist/esm/cura-toast.entry.js.map +1 -0
  145. package/dist/esm/cura.js +1 -1
  146. package/dist/esm/loader.js +1 -1
  147. package/dist/types/components/buttons/cura-button/cura-button.d.ts +1 -1
  148. package/dist/types/components/buttons/cura-button-outline/cura-button-outline.d.ts +1 -1
  149. package/dist/types/components/buttons/cura-button-select/cura-button-select.d.ts +1 -1
  150. package/dist/types/components/buttons/cura-button-transparent/cura-button-transparent.d.ts +1 -1
  151. package/dist/types/components/cura-toast/cura-toast.d.ts +26 -0
  152. package/dist/types/components/cura-toast/cura-toast.stories.d.ts +119 -0
  153. package/dist/types/components/forms/cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.d.ts +4 -0
  154. package/dist/types/components/forms/cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.stories.d.ts +11 -0
  155. package/dist/types/components/forms/cura-dropdown-search/cura-dropdown-search.d.ts +8 -0
  156. package/dist/types/components/forms/cura-dropdown-search/cura-dropdown-search.stories.d.ts +21 -2
  157. package/dist/types/components/loaders/cura-loader-bar/cura-loader-bar.d.ts +12 -0
  158. package/dist/types/components/loaders/cura-loader-bar/cura-loader-bar.stories.d.ts +39 -0
  159. package/dist/types/components.d.ts +84 -8
  160. package/package.json +2 -2
  161. package/dist/cura/p-17a878d4.entry.js.map +0 -1
  162. package/dist/cura/p-251bd980.entry.js +0 -2
  163. package/dist/cura/p-251bd980.entry.js.map +0 -1
  164. package/dist/cura/p-31ae34e3.entry.js +0 -2
  165. package/dist/cura/p-31ae34e3.entry.js.map +0 -1
  166. package/dist/cura/p-3b4bf71e.entry.js.map +0 -1
  167. package/dist/cura/p-61d20270.entry.js +0 -2
  168. package/dist/cura/p-93389727.entry.js +0 -2
  169. package/dist/cura/p-93389727.entry.js.map +0 -1
  170. package/dist/cura/p-b3a50bcf.entry.js +0 -2
  171. package/dist/cura/p-b3a50bcf.entry.js.map +0 -1
  172. package/dist/cura/p-ced36448.entry.js +0 -2
  173. /package/dist/cura/{p-ba2e7222.entry.js.map → p-5fcfbf32.entry.js.map} +0 -0
  174. /package/dist/cura/{p-3c39a9d8.entry.js.map → p-67e34464.entry.js.map} +0 -0
  175. /package/dist/cura/{p-5466758a.entry.js.map → p-8433fec9.entry.js.map} +0 -0
  176. /package/dist/cura/{p-578c74a4.entry.js.map → p-a9dad622.entry.js.map} +0 -0
  177. /package/dist/cura/{p-61d20270.entry.js.map → p-af2036a7.entry.js.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"names":["curaSelectCss","CuraSelectStyle0","CuraSelect","this","styles","theme","window","CuraAPI","handleMutations","mutations","forEach","mutation","type","attributeName","updateSelectedOption","filterOptions","onOptiselected","event","selectedOption","target","clearSelectedAttributes","setAttribute","handleKeyDown","isOpen","key","preventDefault","updateActiveIndex","_a","options","activeIndex","click","handleInputChange","e","value","length","internals","setFormValue","handleClick","disabled","tagName","formAssociatedCallback","form","ariaLabel","label","formStateRestoreCallback","state","formResetCallback","setValidity","formDisabledCallback","componentWillLoad","initializeOptions","componentDidLoad","setupMutationObserver","connectedCallback","applyStyles","disconnectedCallback","mutationObserver","disconnect","host","querySelectorAll","option","size","fonts","colors","fontWeights","getWeights","Object","assign","medium","bold","regular","getColor","getFamily","getSize","colorKeys","MutationObserver","observe","attributes","subtree","attributeFilter","querySelector","selectedValue","textContent","selected","emit","removeAttribute","inputValue","toLowerCase","optionValue","isVisible","includes","style","display","direction","updateOptionHighlights","index","active","getClasses","wrapper","transparent","mode","status","item","isStatusDefault","isHoveredOrFocused","isFocused","isHovered","renderIcon","icon","success","error","h","class","name","iconset","color","render","Host","tabIndex","ref","el","selectRef","onMouseEnter","onMouseLeave","onKeyDown","onClick","weight","required","open","autocomplete","onFocus","onBlur","String","onInput","placeholder","menu","curaSelectOptionCss","CuraSelectOptionStyle0","CuraSelectOption","opacity","element","sizeMap","large","small","slot"],"sources":["src/components/forms/cura-select/cura-select.scss?tag=cura-select&encapsulation=shadow","src/components/forms/cura-select/cura-select.tsx","src/components/forms/cura-select-options/cura-select-option.scss?tag=cura-select-option&encapsulation=shadow","src/components/forms/cura-select-options/cura-select-option.tsx"],"sourcesContent":["@import \"../../../scss/mixins/forms.scss\";\n\n:host {\n display: block;\n position: relative;\n font-family: var(--font-family);\n}\n\n.wrapper {\n width: 100%;\n user-select: none;\n text-align: left !important;\n\n @include cura-label();\n @include helper-text();\n\n @include cura-input-field() {\n .up-down-icon {\n order: 3;\n padding-right: 12px;\n cursor: pointer;\n pointer-events: all;\n }\n\n input {\n padding: 0px 12px 0px 8px;\n }\n\n &.open {\n border-radius: 4px 4px 0 0 !important;\n }\n\n\n }\n\n @include cura-input-transparent();\n\n @include cura-forms-hover();\n @include cura-forms-focused();\n\n\n @include cura-forms-success();\n @include cura-forms-error();\n @include cura-forms-disabled();\n\n @include cura-forms-small() {\n &.label {.menu {top: 53px;} }\n .menu { top: 33px; }\n }\n\n @include cura-forms-medium() {\n &.label {.menu { top: 61px;} }\n .menu { top: 40px; }\n }\n\n @include cura-forms-large() {\n &.label {.menu { top: 69px } }\n .menu {top: 47px; }\n }\n}\n\n.required {\n color: red;\n}\n\n.menu {\n position: absolute;\n left: 0;\n right: -1px;\n background: #fff;\n border: 2px solid var(--neutral-light);\n border-radius: 4px;\n z-index: 1000;\n max-height: 285px;\n overflow: hidden;\n border-top: transparent;\n align-items: center;\n\n scrollbar-color: var(--neutral-medium) var(--neutral-black-20);\n overflow-y: scroll;\n box-shadow: 0px 4px 8px 0px rgba(38, 38, 38, 0.16);\n\n &.open {\n border-radius: 0 !important;\n }\n}\n\n","import { Component, Element, Host, Prop, State, h, Event, EventEmitter, AttachInternals } from '@stencil/core';\n\n@Component({\n tag: 'cura-select',\n styleUrl: 'cura-select.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class CuraSelect {\n /**\n * The label text for the select component.\n * Reflects as an attribute in the DOM.\n */\n @Prop({ reflect: true }) label: string = '';\n\n /**\n * Placeholder text for the input field.\n * Reflects as an attribute in the DOM.\n */\n @Prop({ reflect: true }) placeholder: string = '';\n\n /**\n * Current value of the select component.\n * Reflects as an attribute in the DOM and is mutable.\n */\n @Prop({ reflect: true, mutable: true }) value: string = '';\n\n /**\n * Display mode of the select component.\n * Can be 'default' or 'transparent'.\n */\n @Prop({ reflect: true }) mode: 'default' | 'transparent' = 'default';\n\n /**\n * Size of the select component.\n * Can be 'small', 'medium', or 'large'.\n */\n @Prop({ reflect: true }) size: 'small' | 'medium' | 'large' = 'medium';\n\n /**\n * Status of the select component.\n * Can be 'success', 'error', or 'default'.\n */\n @Prop({ reflect: true, mutable: true }) status: 'success' | 'error' | 'default' = 'default';\n\n /**\n * Whether the select component is disabled.\n * Reflects as an attribute in the DOM.\n */\n @Prop({ reflect: true }) disabled: boolean = false;\n\n /**\n * Whether the select component is required.\n * Reflects as an attribute in the DOM.\n */\n @Prop({ reflect: true }) required: boolean = false;\n\n /**\n * Internal state: Whether the input is hovered.\n * Default: false\n */\n @State() isHovered: boolean = false;\n\n /**\n * Internal state: Whether the input is focused.\n * Default: false\n */\n @State() isFocused: boolean = false;\n\n /**\n * Internal state: Whether the dropdown menu is open.\n * Default: false\n */\n @State() isOpen: boolean = false;\n\n /**\n * Internal state: Collection of options for the select component.\n */\n @State() options: NodeListOf<HTMLElement>;\n\n\n @State() activeIndex: number = -1\n\n /**\n * Reference to the host element of the component.\n */\n @Element() host: HTMLElement;\n\n /**\n * Event emitted when an option is selected.\n */\n @Event() selected: EventEmitter;\n\n /**\n * Reference to the select component element.\n */\n selectRef: HTMLElement;\n\n /**\n * MutationObserver to watch changes in the component.\n */\n mutationObserver: MutationObserver;\n\n /**\n * Styles to be applied to the component.\n */\n styles = {};\n\n /**\n * Theme object containing font and color information.\n */\n theme = window.CuraAPI.theme;\n\n @AttachInternals() internals: ElementInternals;\n\n /**\n * Callback for form association.\n */\n formAssociatedCallback(form: { ariaLabel: string; }) {\n form.ariaLabel = this.label;\n }\n\n /**\n * Callback to restore the switch state from the form.\n */\n formStateRestoreCallback(state: { value: string }) {\n this.value = state.value;\n this.updateSelectedOption();\n }\n\n /**\n * Callback to reset the switch state when the form is reset.\n */\n formResetCallback() {\n this.value = '';\n this.clearSelectedAttributes()\n this.internals.setFormValue(this.value);\n this.internals.setValidity({});\n }\n\n /**\n * Callback to update the switch's disabled state when the form's disabled state changes.\n */\n formDisabledCallback(disabled: boolean) {\n this.disabled = disabled;\n }\n\n /**\n * Lifecycle method called before the component is rendered.\n * Initializes the options for the select component.\n */\n componentWillLoad() {\n this.initializeOptions();\n }\n /**\n * Lifecycle method called after the component is rendered.\n * Initializes select-related functionality.\n */\n componentDidLoad() {\n this.setupMutationObserver();\n }\n /**\n * Lifecycle method called when the component is connected to the DOM.\n * Applies styles based on the theme.\n */\n connectedCallback() {\n this.applyStyles();\n }\n /**\n * Lifecycle method called when the component is disconnected from the DOM.\n * Disconnects the MutationObserver if it exists.\n */\n disconnectedCallback() {\n this.mutationObserver?.disconnect();\n }\n\n initializeOptions() {\n this.options = this.host.querySelectorAll('cura-select-option');\n this.options.forEach(option => {\n option.setAttribute('size', this.size);\n option.setAttribute('selected', 'false');\n });\n }\n /**\n * Applies styles to the component based on the theme.\n */\n applyStyles() {\n const { fonts, colors } = this.theme;\n const fontWeights = fonts.getWeights();\n\n this.styles = {\n ...this.styles,\n '--font-weight-medium': fontWeights.medium,\n '--font-weight-bold': fontWeights.bold,\n '--font-weight-regular': fontWeights.regular,\n '--font-color': fonts.getColor(),\n '--font-family': fonts.getFamily(),\n '--font-size': fonts.getSize(),\n };\n\n const colorKeys = [\n 'primary-base', 'neutral-purewhite', 'neutral-white', 'neutral-black', 'neutral-medium', 'neutral-light',\n 'neutral-base', 'neutral-dark', 'success-dark', 'success-darker', 'success-lighter',\n 'error-lighter', 'error-dark', 'error-darker', 'error-base', 'info-base'\n ];\n\n colorKeys.forEach(key => {\n this.styles[`--${key}`] = colors.getColor(key);\n });\n }\n /**\n * Sets up a MutationObserver to watch for changes in the component.\n */\n setupMutationObserver() {\n this.mutationObserver = new MutationObserver(this.handleMutations);\n this.mutationObserver.observe(this.host, { attributes: true, subtree: true, attributeFilter: ['selected', 'value'] });\n }\n /**\n * Handles mutations observed by the MutationObserver.\n * Updates the selected option or filters options based on the mutation type.\n */\n handleMutations = (mutations: MutationRecord[]) => {\n mutations.forEach(mutation => {\n if (mutation.type === 'attributes') {\n if (mutation.attributeName === 'selected') this.updateSelectedOption();\n if (mutation.attributeName === 'value') this.filterOptions();\n }\n });\n };\n /**\n * Handles the selection of an option.\n */\n onOptiselected = (event: Event) => {\n const selectedOption = event.target as HTMLElement;\n this.clearSelectedAttributes();\n selectedOption.setAttribute('selected', 'true');\n };\n\n updateSelectedOption() {\n const selectedOption = this.host.querySelector('cura-select-option[selected]');\n\n if (selectedOption) {\n const selectedValue = selectedOption.textContent;\n if (this.value !== selectedValue) {\n this.value = selectedValue ;\n this.isOpen = false;\n this.internals.setFormValue(this.value);\n this.selected.emit({ value: this.value, selected: true });\n }\n }\n }\n\n /**\n * Clears the 'selected' attribute from all options.\n */\n clearSelectedAttributes() {\n this.options.forEach(option => option.removeAttribute('selected'));\n }\n\n /**\n * Filters the options based on the current input value.\n */\n filterOptions() {\n const inputValue = this.value.toLowerCase();\n\n this.options.forEach(option => {\n const optionValue = option.textContent?.toLowerCase() || '';\n const isVisible = this.isOpen ? optionValue.includes(inputValue) : true;\n option.style.display = isVisible ? 'block' : 'none';\n });\n }\n\n handleKeyDown = (event: KeyboardEvent) => {\n if (!this.isOpen) return;\n const { key } = event\n\n if (key === 'ArrowDown') {\n event.preventDefault();\n this.updateActiveIndex(1);\n }\n\n if (key === 'ArrowUp') {\n event.preventDefault();\n this.updateActiveIndex(-1);\n }\n\n if (key === 'Enter') {\n this.options[this.activeIndex]?.click();\n }\n }\n\n updateActiveIndex(direction: number) {\n if (this.options.length === 0) return;\n this.activeIndex = (this.activeIndex + direction + this.options.length) % this.options.length;\n this.updateOptionHighlights()\n }\n\n updateOptionHighlights() {\n this.options.forEach((option, index) => (option as any).active = index === this.activeIndex);\n }\n\n\n handleInputChange = (e: Event) => {\n this.value = (e.target as HTMLInputElement).value;\n this.isOpen = !!this.value.length;\n this.internals.setFormValue(this.value);\n };\n\n\n getClasses() {\n return {\n wrapper: true,\n label: !!this.label,\n disabled: this.disabled,\n transparent: this.mode === 'transparent',\n [this.size.toLowerCase()]: true,\n [this.status.toLowerCase()]: true,\n };\n }\n\n /**\n * Determines the color based on the item type and component state.\n */\n getColor(item: 'label' | 'text' | 'icon') {\n if (this.disabled) return 'neutral-medium';\n\n const isStatusDefault = this.status === 'default';\n const isHoveredOrFocused = this.isFocused || this.isHovered;\n\n if (item === 'label') {\n if (!isStatusDefault || isHoveredOrFocused) return 'neutral-black';\n return 'neutral-dark';\n }\n\n if (isHoveredOrFocused && isStatusDefault) return 'neutral-black';\n if (this.status === 'success') return 'success-dark';\n if (this.status === 'error') return 'error-dark';\n\n return 'neutral-dark';\n }\n\n /**\n * Renders the icon based on the component's status.\n */\n renderIcon() {\n if (this.status === 'default') return null;\n const icon = { success: 'checkCircle', error: 'alertCircle' }[this.status];\n return (\n <cura-icon\n class='feedback-icon'\n name={icon}\n iconset='default'\n size={this.size === 'large' ? 20 : 16}\n color={this.getColor('icon')}\n style={this.styles}\n />\n );\n }\n\n handleClick = (event: MouseEvent) => {\n if (this.disabled) return event.preventDefault();\n const target = event.target as HTMLElement;\n\n if (target.tagName === 'CURA-SELECT-OPTION') return this.onOptiselected(event);\n this.isOpen = !this.isOpen;\n };\n\n\n render() {\n return (\n <Host style={this.styles}>\n <div\n class={this.getClasses()}\n tabIndex={0}\n ref={(el) => (this.selectRef = el as HTMLElement)}\n onMouseEnter={() => (this.isHovered = true)}\n onMouseLeave={() => (this.isHovered = false)}\n onKeyDown={this.handleKeyDown}\n onClick={this.handleClick}\n >\n {this.label && (\n <cura-label\n class='label'\n weight='bold'\n size={this.size === 'large' ? 'small' : 'xsmall'}\n color={this.getColor('label')}\n >\n {this.label} {this.required && <span class='required'>* </span>}\n </cura-label>\n )}\n\n <div class={{\n 'cura-input-field': true,\n 'open': this.isOpen\n }}>\n {this.renderIcon()}\n <input\n tabIndex={0}\n type=\"text\"\n autocomplete='off'\n onFocus={() => (this.isFocused = true)}\n onBlur={() => (this.isFocused = false)}\n aria-required={String(this.required)}\n aria-disabled={String(this.disabled)}\n aria-invalid={String(this.status === 'error')}\n onInput={this.handleInputChange}\n style={this.styles}\n placeholder={this.placeholder}\n disabled={this.disabled}\n required={this.required}\n value={this.value}\n />\n <cura-icon\n name={this.isOpen ? 'up' : 'down'}\n class=\"up-down-icon\"\n color={this.disabled ? 'neutral-dark' : 'primary-base'}\n size={16}\n iconset='default'\n />\n </div>\n <cura-label\n class=\"helper-text\"\n size='xsmall'\n color={this.getColor('text')}\n weight={this.mode === 'transparent' ? 'bold' : 'regular'} >\n <slot></slot>\n </cura-label>\n {this.isOpen && (\n <div class={{\n 'menu': true,\n 'open': this.isOpen\n }}>\n <slot name='option'></slot>\n </div>\n )}\n </div>\n </Host>\n );\n }\n}\n",":host {\n display: block;\n}\n\n.item {\n display: flex;\n padding: 12px 8px;\n cursor: pointer;\n justify-content: space-between;\n align-items: center;\n box-sizing: border-box;\n background: var(--neutral-purewhite);\n\n &.selected {\n background-color: var(--primary-lighter-50);\n border-bottom: 1px solid var(--primary-light);\n }\n\n &:hover:not(.selected) {\n background: var(--neutral-white);\n box-shadow: 0 2px 0 0 var(--neutral-light);\n }\n\n &.active {\n background: var(--neutral-white) !important;\n }\n\n &.selected.active {\n background-color: var(--primary-lighter-50) !important;\n box-shadow: none;\n }\n}\n","import { Component, h, Host, Prop, State, Element, Watch } from '@stencil/core';\n\n@Component({\n tag: 'cura-select-option',\n styleUrl: 'cura-select-option.scss',\n shadow: true,\n})\nexport class CuraSelectOption {\n @Prop({ reflect: true }) value: string;\n @Prop({ reflect: true }) selected: boolean = false;\n @Prop({ reflect: true }) active: boolean = false;\n @Prop() size: 'xsmall' | 'small' | 'medium' | 'large' = 'small'\n @State() styles = {};\n @Element() host: HTMLElement;\n\n theme = window.CuraAPI.theme;\n\n connectedCallback() {\n const colors = [\n { name: '--primary-lighter-50', theme: 'primary-lighter', opacity: 0.5 },\n { name: '--primary-light', theme: 'primary-light' },\n { name: '--neutral-light', theme: 'neutral-light' },\n { name: '--neutral-purewhite', theme: 'neutral-purewhite' },\n ];\n\n colors.forEach(color => this.styles = { ...this.styles, [color.name]: this.theme.colors.getColor(color.theme, color?.opacity) });\n }\n\n @Watch('size')\n getSize(element: string) {\n const sizeMap = {\n large: element === 'label' ? 'medium' : 20,\n medium: element === 'label' ? 'small' : 16,\n small: element === 'label' ? 'xsmall' : 'micro',\n };\n\n return sizeMap[this.size] || sizeMap['medium'];\n }\n\n getClasses() {\n return {\n 'item': true,\n 'selected': this.selected,\n 'active':this.active\n };\n }\n\n render() {\n return (\n <Host slot=\"option\">\n <div class={this.getClasses()} style={this.styles}>\n <cura-label color={`${this.selected ? 'primary-base' : 'neutral-black'}`} size={this.getSize('label')} margin-block=\"0\">\n <slot></slot>\n </cura-label>\n {this.selected && <cura-icon name='check' size={this.getSize('icon')} color=\"primary-base\"></cura-icon>}\n </div>\n </Host>\n );\n }\n}\n"],"mappings":"gEAAA,MAAMA,EAAgB,u+VACtB,MAAAC,EAAeD,E,MCOFE,EAAU,M,4NAkGrBC,KAAAC,OAAS,GAKTD,KAAAE,MAAQC,OAAOC,QAAQF,MA8GvBF,KAAAK,gBAAmBC,IACjBA,EAAUC,SAAQC,IAChB,GAAIA,EAASC,OAAS,aAAc,CAClC,GAAID,EAASE,gBAAkB,WAAYV,KAAKW,uBAChD,GAAIH,EAASE,gBAAkB,QAASV,KAAKY,e,IAE/C,EAKJZ,KAAAa,eAAkBC,IAChB,MAAMC,EAAiBD,EAAME,OAC7BhB,KAAKiB,0BACLF,EAAeG,aAAa,WAAY,OAAO,EAqCjDlB,KAAAmB,cAAiBL,I,MACf,IAAKd,KAAKoB,OAAQ,OAClB,MAAMC,IAAEA,GAAQP,EAEhB,GAAIO,IAAQ,YAAa,CACvBP,EAAMQ,iBACNtB,KAAKuB,kBAAkB,E,CAGzB,GAAIF,IAAQ,UAAW,CACrBP,EAAMQ,iBACNtB,KAAKuB,mBAAmB,E,CAG1B,GAAIF,IAAQ,QAAS,EACnBG,EAAAxB,KAAKyB,QAAQzB,KAAK0B,gBAAY,MAAAF,SAAA,SAAAA,EAAEG,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B,KAAM1D,KAAKsE,QAAQ,SAAQ,eAAe,KAClHsC,EAAA,QAAAvF,IAAA,8CAEDrB,KAAKgF,UAAY4B,EAAA,aAAAvF,IAAA,2CAAWyF,KAAK,QAAQpD,KAAM1D,KAAKsE,QAAQ,QAAS0C,MAAM,kB","ignoreList":[]}
1
+ {"version":3,"names":["curaSelectCss","CuraSelectStyle0","CuraSelect","this","styles","theme","window","CuraAPI","handleMutations","mutations","forEach","mutation","type","attributeName","updateSelectedOption","filterOptions","onOptiselected","event","selectedOption","target","clearSelectedAttributes","setAttribute","handleKeyDown","isOpen","key","preventDefault","updateActiveIndex","_a","options","activeIndex","click","handleInputChange","e","value","length","internals","setFormValue","handleClick","disabled","tagName","formAssociatedCallback","form","ariaLabel","label","formStateRestoreCallback","state","formResetCallback","setValidity","formDisabledCallback","componentWillLoad","initializeOptions","componentDidLoad","setupMutationObserver","connectedCallback","applyStyles","disconnectedCallback","mutationObserver","disconnect","host","querySelectorAll","option","size","fonts","colors","fontWeights","getWeights","Object","assign","medium","bold","regular","getColor","getFamily","getSize","colorKeys","MutationObserver","observe","attributes","subtree","attributeFilter","querySelector","selectedValue","textContent","selected","emit","removeAttribute","inputValue","toLowerCase","optionValue","isVisible","includes","style","display","direction","updateOptionHighlights","index","active","getClasses","wrapper","transparent","mode","status","item","isStatusDefault","isHoveredOrFocused","isFocused","isHovered","renderIcon","icon","success","error","h","class","name","iconset","color","render","Host","tabIndex","ref","el","selectRef","onMouseEnter","onMouseLeave","onKeyDown","onClick","weight","required","open","autocomplete","onFocus","onBlur","String","onInput","placeholder","menu","curaSelectOptionCss","CuraSelectOptionStyle0","CuraSelectOption","opacity","element","sizeMap","large","small","slot"],"sources":["src/components/forms/cura-select/cura-select.scss?tag=cura-select&encapsulation=shadow","src/components/forms/cura-select/cura-select.tsx","src/components/forms/cura-select-options/cura-select-option.scss?tag=cura-select-option&encapsulation=shadow","src/components/forms/cura-select-options/cura-select-option.tsx"],"sourcesContent":["@import \"../../../scss/mixins/forms.scss\";\n\n:host {\n display: block;\n position: relative;\n font-family: var(--font-family);\n}\n\n.wrapper {\n width: 100%;\n user-select: none;\n text-align: left !important;\n\n @include cura-label();\n @include helper-text();\n\n @include cura-input-field() {\n .up-down-icon {\n order: 3;\n padding-right: 12px;\n cursor: pointer;\n pointer-events: all;\n }\n\n input {\n padding: 0px 12px 0px 8px;\n }\n\n &.open {\n border-radius: 4px 4px 0 0 !important;\n }\n\n\n }\n\n @include cura-input-transparent();\n\n @include cura-forms-hover();\n @include cura-forms-focused();\n\n\n @include cura-forms-success();\n @include cura-forms-error();\n @include cura-forms-disabled();\n\n @include cura-forms-small() {\n &.label {.menu {top: 53px;} }\n .menu { top: 33px; }\n }\n\n @include cura-forms-medium() {\n &.label {.menu { top: 61px;} }\n .menu { top: 40px; }\n }\n\n @include cura-forms-large() {\n &.label {.menu { top: 69px } }\n .menu {top: 47px; }\n }\n}\n\n.required {\n color: red;\n}\n\n.menu {\n position: absolute;\n left: 0;\n right: -1px;\n background: #fff;\n border: 2px solid var(--neutral-light);\n border-radius: 4px;\n z-index: 1000;\n max-height: 285px;\n overflow: hidden;\n border-top: transparent;\n align-items: center;\n\n scrollbar-color: var(--neutral-medium) var(--neutral-black-20);\n overflow-y: scroll;\n box-shadow: 0px 4px 8px 0px rgba(38, 38, 38, 0.16);\n\n &.open {\n border-radius: 0 !important;\n }\n}\n\n","import { Component, Element, Host, Prop, State, h, Event, EventEmitter, AttachInternals } from '@stencil/core';\n\n@Component({\n tag: 'cura-select',\n styleUrl: 'cura-select.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class CuraSelect {\n /**\n * The label text for the select component.\n * Reflects as an attribute in the DOM.\n */\n @Prop({ reflect: true }) label: string = '';\n\n /**\n * Placeholder text for the input field.\n * Reflects as an attribute in the DOM.\n */\n @Prop({ reflect: true }) placeholder: string = '';\n\n /**\n * Current value of the select component.\n * Reflects as an attribute in the DOM and is mutable.\n */\n @Prop({ reflect: true, mutable: true }) value: string = '';\n\n /**\n * Display mode of the select component.\n * Can be 'default' or 'transparent'.\n */\n @Prop({ reflect: true }) mode: 'default' | 'transparent' = 'default';\n\n /**\n * Size of the select component.\n * Can be 'small', 'medium', or 'large'.\n */\n @Prop({ reflect: true }) size: 'small' | 'medium' | 'large' = 'medium';\n\n /**\n * Status of the select component.\n * Can be 'success', 'error', or 'default'.\n */\n @Prop({ reflect: true, mutable: true }) status: 'success' | 'error' | 'default' = 'default';\n\n /**\n * Whether the select component is disabled.\n * Reflects as an attribute in the DOM.\n */\n @Prop({ reflect: true }) disabled: boolean = false;\n\n /**\n * Whether the select component is required.\n * Reflects as an attribute in the DOM.\n */\n @Prop({ reflect: true }) required: boolean = false;\n\n /**\n * Internal state: Whether the input is hovered.\n * Default: false\n */\n @State() isHovered: boolean = false;\n\n /**\n * Internal state: Whether the input is focused.\n * Default: false\n */\n @State() isFocused: boolean = false;\n\n /**\n * Internal state: Whether the dropdown menu is open.\n * Default: false\n */\n @State() isOpen: boolean = false;\n\n /**\n * Internal state: Collection of options for the select component.\n */\n @State() options: NodeListOf<HTMLElement>;\n\n\n @State() activeIndex: number = -1\n\n /**\n * Reference to the host element of the component.\n */\n @Element() host: HTMLElement;\n\n /**\n * Event emitted when an option is selected.\n */\n @Event() selected: EventEmitter;\n\n /**\n * Reference to the select component element.\n */\n selectRef: HTMLElement;\n\n /**\n * MutationObserver to watch changes in the component.\n */\n mutationObserver: MutationObserver;\n\n /**\n * Styles to be applied to the component.\n */\n styles = {};\n\n /**\n * Theme object containing font and color information.\n */\n theme = window.CuraAPI.theme;\n\n @AttachInternals() internals: ElementInternals;\n\n /**\n * Callback for form association.\n */\n formAssociatedCallback(form: { ariaLabel: string; }) {\n form.ariaLabel = this.label;\n }\n\n /**\n * Callback to restore the switch state from the form.\n */\n formStateRestoreCallback(state: { value: string }) {\n this.value = state.value;\n this.updateSelectedOption();\n }\n\n /**\n * Callback to reset the switch state when the form is reset.\n */\n formResetCallback() {\n this.value = '';\n this.clearSelectedAttributes()\n this.internals.setFormValue(this.value);\n this.internals.setValidity({});\n }\n\n /**\n * Callback to update the switch's disabled state when the form's disabled state changes.\n */\n formDisabledCallback(disabled: boolean) {\n this.disabled = disabled;\n }\n\n /**\n * Lifecycle method called before the component is rendered.\n * Initializes the options for the select component.\n */\n componentWillLoad() {\n this.initializeOptions();\n }\n /**\n * Lifecycle method called after the component is rendered.\n * Initializes select-related functionality.\n */\n componentDidLoad() {\n this.setupMutationObserver();\n }\n /**\n * Lifecycle method called when the component is connected to the DOM.\n * Applies styles based on the theme.\n */\n connectedCallback() {\n this.applyStyles();\n }\n /**\n * Lifecycle method called when the component is disconnected from the DOM.\n * Disconnects the MutationObserver if it exists.\n */\n disconnectedCallback() {\n this.mutationObserver?.disconnect();\n }\n\n initializeOptions() {\n this.options = this.host.querySelectorAll('cura-select-option');\n this.options.forEach(option => {\n option.setAttribute('size', this.size);\n option.setAttribute('selected', 'false');\n });\n }\n /**\n * Applies styles to the component based on the theme.\n */\n applyStyles() {\n const { fonts, colors } = this.theme;\n const fontWeights = fonts.getWeights();\n\n this.styles = {\n ...this.styles,\n '--font-weight-medium': fontWeights.medium,\n '--font-weight-bold': fontWeights.bold,\n '--font-weight-regular': fontWeights.regular,\n '--font-color': fonts.getColor(),\n '--font-family': fonts.getFamily(),\n '--font-size': fonts.getSize(),\n };\n\n const colorKeys = [\n 'primary-base', 'neutral-purewhite', 'neutral-white', 'neutral-black', 'neutral-medium', 'neutral-light',\n 'neutral-base', 'neutral-dark', 'success-dark', 'success-darker', 'success-lighter',\n 'error-lighter', 'error-dark', 'error-darker', 'error-base', 'info-base'\n ];\n\n colorKeys.forEach(key => {\n this.styles[`--${key}`] = colors.getColor(key);\n });\n }\n /**\n * Sets up a MutationObserver to watch for changes in the component.\n */\n setupMutationObserver() {\n this.mutationObserver = new MutationObserver(this.handleMutations);\n this.mutationObserver.observe(this.host, { attributes: true, subtree: true, attributeFilter: ['selected', 'value'] });\n }\n /**\n * Handles mutations observed by the MutationObserver.\n * Updates the selected option or filters options based on the mutation type.\n */\n handleMutations = (mutations: MutationRecord[]) => {\n mutations.forEach(mutation => {\n if (mutation.type === 'attributes') {\n if (mutation.attributeName === 'selected') this.updateSelectedOption();\n if (mutation.attributeName === 'value') this.filterOptions();\n }\n });\n };\n /**\n * Handles the selection of an option.\n */\n onOptiselected = (event: Event) => {\n const selectedOption = event.target as HTMLElement;\n this.clearSelectedAttributes();\n selectedOption.setAttribute('selected', 'true');\n };\n\n updateSelectedOption() {\n const selectedOption = this.host.querySelector('cura-select-option[selected]');\n\n if (selectedOption) {\n const selectedValue = selectedOption.textContent;\n if (this.value !== selectedValue) {\n this.value = selectedValue ;\n this.isOpen = false;\n this.internals.setFormValue(this.value);\n this.selected.emit({ value: this.value, selected: true });\n }\n }\n }\n\n /**\n * Clears the 'selected' attribute from all options.\n */\n clearSelectedAttributes() {\n this.options.forEach(option => option.removeAttribute('selected'));\n }\n\n /**\n * Filters the options based on the current input value.\n */\n filterOptions() {\n const inputValue = this.value.toLowerCase();\n\n this.options.forEach(option => {\n const optionValue = option.textContent?.toLowerCase() || '';\n const isVisible = this.isOpen ? optionValue.includes(inputValue) : true;\n option.style.display = isVisible ? 'block' : 'none';\n });\n }\n\n handleKeyDown = (event: KeyboardEvent) => {\n if (!this.isOpen) return;\n const { key } = event\n\n if (key === 'ArrowDown') {\n event.preventDefault();\n this.updateActiveIndex(1);\n }\n\n if (key === 'ArrowUp') {\n event.preventDefault();\n this.updateActiveIndex(-1);\n }\n\n if (key === 'Enter') {\n this.options[this.activeIndex]?.click();\n }\n }\n\n updateActiveIndex(direction: number) {\n if (this.options.length === 0) return;\n this.activeIndex = (this.activeIndex + direction + this.options.length) % this.options.length;\n this.updateOptionHighlights()\n }\n\n updateOptionHighlights() {\n this.options.forEach((option, index) => (option as any).active = index === this.activeIndex);\n }\n\n\n handleInputChange = (e: Event) => {\n this.value = (e.target as HTMLInputElement).value;\n this.isOpen = !!this.value.length;\n this.internals.setFormValue(this.value);\n };\n\n\n getClasses() {\n return {\n wrapper: true,\n label: !!this.label,\n disabled: this.disabled,\n transparent: this.mode === 'transparent',\n [this.size.toLowerCase()]: true,\n [this.status.toLowerCase()]: true,\n };\n }\n\n /**\n * Determines the color based on the item type and component state.\n */\n getColor(item: 'label' | 'text' | 'icon') {\n if (this.disabled) return 'neutral-medium';\n\n const isStatusDefault = this.status === 'default';\n const isHoveredOrFocused = this.isFocused || this.isHovered;\n\n if (item === 'label') {\n if (!isStatusDefault || isHoveredOrFocused) return 'neutral-black';\n return 'neutral-dark';\n }\n\n if (isHoveredOrFocused && isStatusDefault) return 'neutral-black';\n if (this.status === 'success') return 'success-dark';\n if (this.status === 'error') return 'error-dark';\n\n return 'neutral-dark';\n }\n\n /**\n * Renders the icon based on the component's status.\n */\n renderIcon() {\n if (this.status === 'default') return null;\n const icon = { success: 'checkCircle', error: 'alertCircle' }[this.status];\n return (\n <cura-icon\n class='feedback-icon'\n name={icon}\n iconset='default'\n size={this.size === 'large' ? 20 : 16}\n color={this.getColor('icon')}\n style={this.styles}\n />\n );\n }\n\n handleClick = (event: MouseEvent) => {\n if (this.disabled) return event.preventDefault();\n const target = event.target as HTMLElement;\n\n if (target.tagName === 'CURA-SELECT-OPTION') return this.onOptiselected(event);\n this.isOpen = !this.isOpen;\n };\n\n\n render() {\n return (\n <Host style={this.styles}>\n <div\n class={this.getClasses()}\n tabIndex={0}\n ref={(el) => (this.selectRef = el as HTMLElement)}\n onMouseEnter={() => (this.isHovered = true)}\n onMouseLeave={() => (this.isHovered = false)}\n onKeyDown={this.handleKeyDown}\n onClick={this.handleClick}\n >\n {this.label && (\n <cura-label\n class='label'\n weight='bold'\n size={this.size === 'large' ? 'small' : 'xsmall'}\n color={this.getColor('label')}\n >\n {this.label} {this.required && <span class='required'>* </span>}\n </cura-label>\n )}\n\n <div class={{\n 'cura-input-field': true,\n 'open': this.isOpen\n }}>\n {this.renderIcon()}\n <input\n tabIndex={0}\n type=\"text\"\n autocomplete='off'\n onFocus={() => (this.isFocused = true)}\n onBlur={() => (this.isFocused = false)}\n aria-required={String(this.required)}\n aria-disabled={String(this.disabled)}\n aria-invalid={String(this.status === 'error')}\n onInput={this.handleInputChange}\n style={this.styles}\n placeholder={this.placeholder}\n disabled={this.disabled}\n required={this.required}\n value={this.value}\n />\n <cura-icon\n name={this.isOpen ? 'up' : 'down'}\n class=\"up-down-icon\"\n color={this.disabled ? 'neutral-dark' : 'primary-base'}\n size={16}\n iconset='default'\n />\n </div>\n <cura-label\n class=\"helper-text\"\n size='xsmall'\n color={this.getColor('text')}\n weight={this.mode === 'transparent' ? 'bold' : 'regular'} >\n <slot></slot>\n </cura-label>\n {this.isOpen && (\n <div class={{\n 'menu': true,\n 'open': this.isOpen\n }}>\n <slot name='option'></slot>\n </div>\n )}\n </div>\n </Host>\n );\n }\n}\n",":host {\n display: block;\n}\n\n.item {\n display: flex;\n padding: 12px 8px;\n cursor: pointer;\n justify-content: space-between;\n align-items: center;\n box-sizing: border-box;\n background: var(--neutral-purewhite);\n\n &.selected {\n background-color: var(--primary-lighter-50);\n border-bottom: 1px solid var(--primary-light);\n }\n\n &:hover:not(.selected) {\n background: var(--neutral-white);\n box-shadow: 0 2px 0 0 var(--neutral-light);\n }\n\n &.active {\n background: var(--neutral-white) !important;\n }\n\n &.selected.active {\n background-color: var(--primary-lighter-50) !important;\n box-shadow: none;\n }\n}\n","import { Component, h, Host, Prop, State, Element, Watch } from '@stencil/core';\n\n@Component({\n tag: 'cura-select-option',\n styleUrl: 'cura-select-option.scss',\n shadow: true,\n})\nexport class CuraSelectOption {\n @Prop({ reflect: true }) value: string;\n @Prop({ reflect: true }) selected: boolean = false;\n @Prop({ reflect: true }) active: boolean = false;\n @Prop() size: 'xsmall' | 'small' | 'medium' | 'large' = 'small'\n @State() styles = {};\n @Element() host: HTMLElement;\n\n theme = window.CuraAPI.theme;\n\n connectedCallback() {\n const colors = [\n { name: '--primary-lighter-50', theme: 'primary-lighter', opacity: 0.5 },\n { name: '--primary-light', theme: 'primary-light' },\n { name: '--neutral-light', theme: 'neutral-light' },\n { name: '--neutral-purewhite', theme: 'neutral-purewhite' },\n ];\n\n colors.forEach(color => this.styles = { ...this.styles, [color.name]: this.theme.colors.getColor(color.theme, color?.opacity) });\n }\n\n @Watch('size')\n getSize(element: string) {\n const sizeMap = {\n large: element === 'label' ? 'medium' : 20,\n medium: element === 'label' ? 'small' : 16,\n small: element === 'label' ? 'xsmall' : 'micro',\n };\n\n return sizeMap[this.size] || sizeMap['medium'];\n }\n\n getClasses() {\n return {\n 'item': true,\n 'selected': this.selected,\n 'active':this.active\n };\n }\n\n render() {\n return (\n <Host slot=\"option\">\n <div class={this.getClasses()} style={this.styles}>\n <cura-label color={`${this.selected ? 'primary-base' : 'neutral-black'}`} size={this.getSize('label')} margin-block=\"0\">\n <slot></slot>\n </cura-label>\n {this.selected && <cura-icon name='check' size={this.getSize('icon')} color=\"primary-base\"></cura-icon>}\n </div>\n </Host>\n );\n }\n}\n"],"mappings":"2DAAA,MAAMA,EAAgB,u+VACtB,MAAAC,EAAeD,E,MCOFE,EAAU,M,4NAkGrBC,KAAAC,OAAS,GAKTD,KAAAE,MAAQC,OAAOC,QAAQF,MA8GvBF,KAAAK,gBAAmBC,IACjBA,EAAUC,SAAQC,IAChB,GAAIA,EAASC,OAAS,aAAc,CAClC,GAAID,EAASE,gBAAkB,WAAYV,KAAKW,uBAChD,GAAIH,EAASE,gBAAkB,QAASV,KAAKY,e,IAE/C,EAKJZ,KAAAa,eAAkBC,IAChB,MAAMC,EAAiBD,EAAME,OAC7BhB,KAAKiB,0BACLF,EAAeG,aAAa,WAAY,OAAO,EAqCjDlB,KAAAmB,cAAiBL,I,MACf,IAAKd,KAAKoB,OAAQ,OAClB,MAAMC,IAAEA,GAAQP,EAEhB,GAAIO,IAAQ,YAAa,CACvBP,EAAMQ,iBACNtB,KAAKuB,kBAAkB,E,CAGzB,GAAIF,IAAQ,UAAW,CACrBP,EAAMQ,iBACNtB,KAAKuB,mBAAm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F,aAAcN,MAAOxF,KAAKC,QACzC2G,EAAA,cAAAvF,IAAA,2CAAY2F,MAAO,GAAGhH,KAAKgF,SAAW,eAAiB,kBAAmBtB,KAAM1D,KAAKsE,QAAQ,SAAQ,eAAe,KAClHsC,EAAA,QAAAvF,IAAA,8CAEDrB,KAAKgF,UAAY4B,EAAA,aAAAvF,IAAA,2CAAWyF,KAAK,QAAQpD,KAAM1D,KAAKsE,QAAQ,QAAS0C,MAAM,kB","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- import{r as e,c as a,h as t,H as r}from"./p-312791fb.js";import{f as i}from"./p-f9b8f665.js";const s='@charset "UTF-8";:host{display:block;width:fit-content;box-sizing:border-box}.container{display:flex;align-items:center;flex-direction:row-reverse;gap:var(--gap);text-align:left}.position{flex-direction:row}.label,.message{text-align:left}.control{width:fit-content}.track{background:var(--neutral-dark-base);border-radius:16px;transition:background-color 0.3s;align-items:flex-start;flex-shrink:0;box-sizing:border-box;width:var(--size-track);height:var(--size);position:relative}.thumb{background:var(--neutral-purewhite);border:2px solid var(--neutral-darker-medium);border-radius:50%;position:absolute;transition:transform 0.3s, outline 0.3s;display:inline-block;cursor:pointer;user-select:none;box-sizing:border-box;width:var(--size);height:var(--size);top:50%;transform:translateY(-50%)}.checked .thumb{border-color:var(--color-dark);box-shadow:0px 4px 8px 0px var(--neutral-black-shadow, rgba(38, 38, 38, 0.16));background:var(--neutral-purewhite);transform:translateX(var(--size)) translateY(-50%)}.checked .thumb:hover{background:var(--neutral-pale) !important;border-color:var(--neutral-darker-medium) !important}.checked .thumb:active{border-color:var(--color-dark);background:var(--neutral-pale)}.checked .track{background:var(--color-base-light)}.disabled .track{background:var(--neutral-black-neutral-pale)}.disabled .thumb{background:var(--neutral-black-neutral-base) !important;border-color:var(--neutral-black-neutral-pale) !important;cursor:not-allowed}.disabled.checked .track{background:var(--neutral-black-neutral-pale)}.container.disabled .thumb:focus{outline:none !important;border-color:var(--neutral-black-neutral-pale) !important}:not(.disabled):not(.checked) .thumb:hover{border-color:var(--color-dark);background:var(--neutral-pale)}:not(.disabled):not(.checked) .thumb:active{border-color:var(--color-dark);background:var(--neutral-pale)}:not(.disabled) .thumb:focus{outline:2px solid var(--info-base) !important;border:2px solid var(--neutral-darker-medium);z-index:1}:not(.disabled) .checked .thumb:focus{outline:2px solid var(--info-base) !important;border-color:var(--color-dark)}';const l=s;const o=class{constructor(t){e(this,t);this.onchange=a(this,"onchange",7);if(t.$hostElement$["s-ei"]){this.internals=t.$hostElement$["s-ei"]}else{this.internals=t.$hostElement$.attachInternals();t.$hostElement$["s-ei"]=this.internals}this.sizes={large:{size:64},medium:{size:48},small:{size:40}};this.isDarkbackground=()=>this.background==="dark";this.toggleSwitch=()=>{if(this.disabled)return null;this.checked=!this.checked;this.internals.setFormValue(this.checked.toString());this.onchange.emit({checked:this.checked})};this.checked=false;this.disabled=false;this.label="";this.ontabindex=0;this.position="left";this.size="medium";this.background="light";this.color="accent";this.styles={}}sizeHandler(){this.styles=Object.assign(Object.assign({},this.styles),{"--size-track":`${this.sizes[this.size].size}px`,"--size":`${i[this.size].size}px`,"--gap":`${i[this.size].gap}px`})}setColors(){const e=[{name:"--info-base",background:"info-base"},{name:"--neutral-black-shadow",background:"neutral-black",opacity:.16},{name:"--neutral-purewhite",background:"neutral-purewhite"},{name:"--neutral-medium",background:"neutral-medium"},{name:"--neutral-pale",background:"neutral-pale"},{name:"--neutral-dark-base",background:`neutral-${this.isDarkbackground()?"dark":"base"}`},{name:"--neutral-darker-medium",background:`neutral-${this.isDarkbackground()?"darker":"medium"}`},{name:"--neutral-black-neutral-pale",background:`${this.isDarkbackground()?"neutral-black":"neutral-pale"}`},{name:"--neutral-black-neutral-base",background:`${this.isDarkbackground()?"neutral-dark":"neutral-base"}`},{name:"--color-base-light",background:`${this.color}-light`},{name:"--color-dark",background:`${this.color}-dark`}];e.forEach((e=>{this.styles[e.name]=window.CuraAPI.theme.colors.getColor(e.background,e===null||e===void 0?void 0:e.opacity)}));this.styles=Object.assign({},this.styles)}connectedCallback(){this.sizeHandler();this.setColors()}formAssociatedCallback(e){e.ariaLabel=this.label}formStateRestoreCallback(e){this.checked=e.value==="true";this.internals.setFormValue(this.checked.toString())}formResetCallback(){this.checked=false;this.internals.setValidity({});this.internals.setFormValue(this.checked.toString())}formDisabledCallback(e){this.disabled=e}assignColor(e,a){if(this.disabled)return this.isDarkbackground()?"neutral-dark":"neutral-dark";return this.isDarkbackground()?e:a}getClasses(){const e={};e["container"]=true;e["checked"]=this.checked;e["disabled"]=this.disabled;e["position"]=this.position==="right";return e}render(){return t(r,{key:"e0040434db080b1ccdb12a1389ca028f5c02f66a"},t("div",{key:"6008f7aef47e0519e965c2be573dc1eacc001b6c",class:this.getClasses(),style:this.styles},t("div",{key:"a954404dce1c7eafd79cb3236e8761a3dc29f86e",class:"info"},t("cura-label",{key:"6ff5cc1f26abad0f173c4e1330aaae43357b7737",style:{textAlign:this.position==="right"?"right":"left"},class:"label",weight:"bold",size:this.size==="large"?"medium":"xsmall",lineHeight:"125%",color:this.assignColor("neutral-white","neutral-black")},this.label),t("cura-label",{key:"b82e4cb25ef94481642e1d5a2180eb4e12b8eff8",style:{textAlign:this.position==="right"?"right":"left"},color:this.assignColor("primary-lighter","neutral-dark"),size:"xsmall",class:"message"},t("slot",{key:"243e906253614d9ce837e0c598b259ad7c87afb4"}))),t("div",{key:"36d0165722a6fae98ca829a5a2e89edef3694ff2",onClick:this.toggleSwitch,class:"control"},t("div",{key:"f9c0c7cbc84b655e37e7e8df1c2293c1260445ca",class:`track ${this.size.toLowerCase()}`},t("div",{key:"e5ca4006ad41a6cbf8d62ca612b52ef26fb7255f",class:`thumb ${this.size.toLowerCase()}`,tabIndex:this.ontabindex})))))}static get formAssociated(){return true}static get watchers(){return{size:["sizeHandler"],color:["setColors"],background:["setColors"]}}};o.style=l;export{o as cura_switch};
2
- //# sourceMappingURL=p-578c74a4.entry.js.map
1
+ import{r as a,c as e,h as t,H as r}from"./p-312791fb.js";import{f as i}from"./p-f9b8f665.js";const s='@charset "UTF-8";:host{display:block;width:fit-content;box-sizing:border-box}.container{display:flex;align-items:center;flex-direction:row-reverse;gap:var(--gap);text-align:left}.position{flex-direction:row}.label,.message{text-align:left}.control{width:fit-content}.track{background:var(--neutral-dark-base);border-radius:16px;transition:background-color 0.3s;align-items:flex-start;flex-shrink:0;box-sizing:border-box;width:var(--size-track);height:var(--size);position:relative}.thumb{background:var(--neutral-purewhite);border:2px solid var(--neutral-darker-medium);border-radius:50%;position:absolute;transition:transform 0.3s, outline 0.3s;display:inline-block;cursor:pointer;user-select:none;box-sizing:border-box;width:var(--size);height:var(--size);top:50%;transform:translateY(-50%)}.checked .thumb{border-color:var(--color-dark);box-shadow:0px 4px 8px 0px var(--neutral-black-shadow, rgba(38, 38, 38, 0.16));background:var(--neutral-purewhite);transform:translateX(var(--size)) translateY(-50%)}.checked .thumb:hover{background:var(--neutral-pale) !important;border-color:var(--neutral-darker-medium) !important}.checked .thumb:active{border-color:var(--color-dark);background:var(--neutral-pale)}.checked .track{background:var(--color-base-light)}.disabled .track{background:var(--neutral-black-neutral-pale)}.disabled .thumb{background:var(--neutral-black-neutral-base) !important;border-color:var(--neutral-black-neutral-pale) !important;cursor:not-allowed}.disabled.checked .track{background:var(--neutral-black-neutral-pale)}.container.disabled .thumb:focus{outline:none !important;border-color:var(--neutral-black-neutral-pale) !important}:not(.disabled):not(.checked) .thumb:hover{border-color:var(--color-dark);background:var(--neutral-pale)}:not(.disabled):not(.checked) .thumb:active{border-color:var(--color-dark);background:var(--neutral-pale)}:not(.disabled) .thumb:focus{outline:2px solid var(--info-base) !important;border:2px solid var(--neutral-darker-medium);z-index:1}:not(.disabled) .checked .thumb:focus{outline:2px solid var(--info-base) !important;border-color:var(--color-dark)}';const l=s;const o=class{constructor(t){a(this,t);this.onchange=e(this,"onchange",7);if(t.$hostElement$["s-ei"]){this.internals=t.$hostElement$["s-ei"]}else{this.internals=t.$hostElement$.attachInternals();t.$hostElement$["s-ei"]=this.internals}this.sizes={large:{size:64},medium:{size:48},small:{size:40}};this.isDarkbackground=()=>this.background==="dark";this.toggleSwitch=()=>{if(this.disabled)return null;this.checked=!this.checked;this.internals.setFormValue(this.checked.toString());this.onchange.emit({checked:this.checked})};this.checked=false;this.disabled=false;this.label="";this.ontabindex=0;this.position="left";this.size="medium";this.background="light";this.color="accent";this.styles={}}sizeHandler(){this.styles=Object.assign(Object.assign({},this.styles),{"--size-track":`${this.sizes[this.size].size}px`,"--size":`${i[this.size].size}px`,"--gap":`${i[this.size].gap}px`})}setColors(){const a=[{name:"--info-base",background:"info-base"},{name:"--neutral-black-shadow",background:"neutral-black",opacity:.16},{name:"--neutral-purewhite",background:"neutral-purewhite"},{name:"--neutral-medium",background:"neutral-medium"},{name:"--neutral-pale",background:"neutral-pale"},{name:"--neutral-dark-base",background:`neutral-${this.isDarkbackground()?"dark":"base"}`},{name:"--neutral-darker-medium",background:`neutral-${this.isDarkbackground()?"darker":"medium"}`},{name:"--neutral-black-neutral-pale",background:`${this.isDarkbackground()?"neutral-black":"neutral-pale"}`},{name:"--neutral-black-neutral-base",background:`${this.isDarkbackground()?"neutral-dark":"neutral-base"}`},{name:"--color-base-light",background:`${this.color}-light`},{name:"--color-dark",background:`${this.color}-dark`}];a.forEach((a=>{this.styles[a.name]=window.CuraAPI.theme.colors.getColor(a.background,a===null||a===void 0?void 0:a.opacity)}));this.styles=Object.assign({},this.styles)}connectedCallback(){this.sizeHandler();this.setColors()}formAssociatedCallback(a){a.ariaLabel=this.label}formStateRestoreCallback(a){this.checked=a.value==="true";this.internals.setFormValue(this.checked.toString())}formResetCallback(){this.checked=false;this.internals.setValidity({});this.internals.setFormValue(this.checked.toString())}formDisabledCallback(a){this.disabled=a}assignColor(a,e){if(this.disabled)return this.isDarkbackground()?"neutral-dark":"neutral-dark";return this.isDarkbackground()?a:e}getClasses(){const a={};a["container"]=true;a["checked"]=this.checked;a["disabled"]=this.disabled;a["position"]=this.position==="right";return a}render(){return t(r,{key:"2ccbfc3c5aae5ec8be3f879541b7cbcf203b62a9"},t("div",{key:"2acacb0bab31f8736155dc764a6e3d57508f7a48",class:this.getClasses(),style:this.styles},t("div",{key:"16c7cfedbd029d4e481cb2c3268690d594962ff3",class:"info"},t("cura-label",{key:"24ed0fd9a9c0ebacc52407319b16a202f2defc96",style:{textAlign:this.position==="right"?"right":"left"},class:"label",weight:"bold",size:this.size==="large"?"medium":"xsmall",lineHeight:"125%",color:this.assignColor("neutral-white","neutral-black")},this.label),t("cura-label",{key:"4a84fb18a2fd43c623cb9aa9e9573482a22f6372",style:{textAlign:this.position==="right"?"right":"left"},color:this.assignColor("primary-lighter","neutral-dark"),size:"xsmall",class:"message"},t("slot",{key:"0ec0427dee691d224daa58db943c07d906d08dd0"}))),t("div",{key:"5b4a04200b4880474b693e605ba3e8671a3bd980",onClick:this.toggleSwitch,class:"control"},t("div",{key:"2e3e764a87d57edc520f9d56b980d80d455d8d74",class:`track ${this.size.toLowerCase()}`},t("div",{key:"36b9da57ea3b95e419d7bb0b5ad4f24d7acd1b63",class:`thumb ${this.size.toLowerCase()}`,tabIndex:this.ontabindex})))))}static get formAssociated(){return true}static get watchers(){return{size:["sizeHandler"],color:["setColors"],background:["setColors"]}}};o.style=l;export{o as cura_switch};
2
+ //# sourceMappingURL=p-a9dad622.entry.js.map
@@ -0,0 +1,2 @@
1
+ import{r as o,h as a,H as r}from"./p-312791fb.js";const c=":host{display:block;box-sizing:border-box;width:100%}cura-label{padding:12px 0px;border-bottom:1px solid var(--neutral-light)}";const e=c;const t=class{constructor(a){o(this,a)}render(){return a(r,{key:"d27a47a6d61497f488c449188b2c6036529350cc",slot:"dropdown-search-option"},a("cura-label",{key:"ba63e9fce7392087551ccc7fb46a83cffa6785c9",color:"neutral-dark",size:"xsmall",lineHeight:"16px",marginBlock:"0"},a("slot",{key:"f14d41a3ed995f6f9a946e7d96e5c0b0208310ad"})))}};t.style=e;export{t as cura_dropdown_search_option_title};
2
+ //# sourceMappingURL=p-af2036a7.entry.js.map
@@ -0,0 +1,2 @@
1
+ import{r as t,c as i,h as e,H as o,g as s}from"./p-312791fb.js";const r=":host{display:block;width:100%;box-sizing:border-box}.dropdown{display:flex;position:relative;flex-direction:column;width:inherit}.dropdown-input-search{width:100%;display:flex;justify-content:center;align-items:center;background:transparent}.dropdown-input-search.dropdown-open ::part(cura-input-field){border-radius:4px 4px 0px 0px}.dropdown-input-search.dropdown-open ::slotted([slot=helperText]){display:none}.dropdown-input-search.dropdown-open cura-input-text ::slotted([slot=helperText]){display:none}.dropdown-search-list{position:absolute;top:calc(100% - 8px);width:100%;max-height:var(--dropdown-max-height);padding:12px 12px;margin:0;box-sizing:border-box;box-shadow:0px 4px 8px 0px var(--neutral-black-shadow, rgba(38, 38, 38, 0.16));border-radius:0px 0px 4px 4px;border-top:0 var(--neutral-light);border-right:2px solid var(--neutral-light);border-bottom:2px solid var(--neutral-light);border-left:2px solid var(--neutral-light);background-color:var(--neutral-purewhite);list-style:none;overflow-y:auto;display:none}.dropdown-search-list.visible{display:block}.dropdown-search-list-input-search{width:inherit;display:flex;justify-content:center;align-items:center;padding:16px 8px;border-bottom:2px solid var(--info-base);background-color:var(--neutral-purewhite)}.dropdown-search-list-input-search cura-input-text{width:inherit}.dropdown-search-list-input-search.error{background-color:var(--error-lighter);border-bottom:2px solid var(--error-dark)}.dropdown-mobile{position:fixed;top:0;left:0;right:0;width:100%;z-index:10000}.dropdown-mobile .dropdown-input-search{display:flex;gap:4px;padding:12px 8px;background-color:var(--neutral-purewhite);border-bottom:2px solid var(--info-base);z-index:10000}.dropdown-mobile .dropdown-input-search cura-button-transparent{display:flex}.dropdown-mobile .dropdown-input-search.error{background-color:var(--error-lighter);border-bottom:2px solid var(--error-dark)}.dropdown-mobile .dropdown-input-search.dropdown-open{display:flex}.dropdown-mobile .dropdown-input-search.dropdown-open ::slotted([slot=helperText]){display:block}.dropdown-mobile .dropdown-search-list{position:static;width:100%;height:100%;max-height:none;padding:12px 12px;margin:0;box-sizing:border-box;box-shadow:none;border:none;background-color:var(--neutral-purewhite);list-style:none;overflow-y:auto;z-index:10000}";const n=r;const d=class{constructor(e){t(this,e);this.valueChanged=i(this,"valueChanged",7);this.onselect=i(this,"onselect",7);this.overlayElement=null;this.handleSlotChange=()=>{this.options=Array.from(this.host.querySelectorAll("cura-dropdown-search-option"));this.addClickListenersToOptions();this.updateHoveredIndex()};this.handleInputChange=t=>{const i=t.target;this.value=i.value;this.onValueChange(this.value)};this.handleKeyDown=t=>{if(t.key==="ArrowDown"){t.preventDefault();this.moveHighlight(1)}else if(t.key==="ArrowUp"){t.preventDefault();this.moveHighlight(-1)}else if(t.key==="Enter"){t.preventDefault();if(this.hoveredIndex>-1){this.handleOnBlur();this.onSelectedOption(this.hoveredIndex)}}};this.handleResize=()=>{this.isMobile=window.innerWidth<768;if(this.isDropdownOpen){if(this.isMobile){this.showOverlay()}else{this.removeOverlay()}}};this.status="default";this.name=undefined;this.required=false;this.selected=false;this.value="";this.placeholder="";this.label="";this.iconName="search";this.dropdownMaxHeight="630px";this.overlayVisible=false;this.isDropdownOpen=false;this.styles={};this.isMobile=window.innerWidth<768;this.mode="default";this.inputTextRef=undefined;this.isOnBlurInput=true;this.hoveredIndex=-1;this.options=[]}connectedCallback(){this.weights=window.CuraAPI.theme.fonts.getWeights();this.styles["--info-base"]=window.CuraAPI.theme.colors.getColor("info-base");this.styles["--neutral-purewhite"]=window.CuraAPI.theme.colors.getColor("neutral-purewhite");this.styles["--neutral-light"]=window.CuraAPI.theme.colors.getColor("neutral-light");this.styles["--neutral-dark"]=window.CuraAPI.theme.colors.getColor("neutral-dark");this.styles["--neutral-black-shadow"]=window.CuraAPI.theme.colors.getColor(`neutral-black`,.16);this.styles["--error-dark"]=window.CuraAPI.theme.colors.getColor("error-dark");this.styles["--error-lighter"]=window.CuraAPI.theme.colors.getColor("error-lighter");this.styles["--breakpoints"]=window.CuraAPI.theme.breakpoints.get();this.styles["--font-size"]=window.CuraAPI.theme.fonts.getSize();this.styles["--font-family"]=window.CuraAPI.theme.fonts.getFamily();this.styles["--font-weight-medium"]=this.weights.medium}onValueChange(t){this.updateSelectedOption(t);this.valueChanged.emit(this.value)}componentWillLoad(){this.updateSelectedOption(this.value)}componentDidRender(){if(this.isDropdownOpen&&this.isMobile){this.showOverlay()}else{this.removeOverlay()}}componentDidLoad(){window.addEventListener("resize",this.handleResize)}disconnectedCallback(){window.removeEventListener("resize",this.handleResize)}showOverlay(){if(!this.overlayElement){this.overlayElement=document.createElement("div");this.overlayElement.className="dropdown-overlay";this.overlayElement.style.position="fixed";this.overlayElement.style.top="0";this.overlayElement.style.left="0";this.overlayElement.style.width="100%";this.overlayElement.style.height="100%";this.overlayElement.style.zIndex="9999";this.overlayElement.style.backgroundColor="white";document.body.appendChild(this.overlayElement)}}removeOverlay(){if(this.overlayElement&&this.overlayElement.parentNode===document.body){document.body.removeChild(this.overlayElement);this.overlayElement=null}}addClickListenersToOptions(){this.options.forEach(((t,i)=>{t.addEventListener("click",(()=>this.onSelectedOption(i)))}))}updateSelectedOption(t){const i=this.options.findIndex((i=>i.getAttribute("value")===t));this.hoveredIndex=i;this.updateOptionAttribute("hovered",this.hoveredIndex);this.updateOptionAttribute("selected",this.hoveredIndex);this.scrollIntoView()}onSelectedOption(t){const i=this.options[t];if(i.selectable){const t=i.getAttribute("value")||i.textContent;this.value=t||"";this.updateSelectedOption(this.value);this.isDropdownOpen=false;this.isOnBlurInput=true;this.removeOverlay()}}moveHighlight(t){const i=this.options;const e=(this.hoveredIndex+t+i.length)%i.length;this.hoveredIndex=e;this.updateOptionAttribute("hovered",this.hoveredIndex);this.scrollIntoView()}updateOptionAttribute(t,i){this.options.forEach(((e,o)=>{e[t]=o===i}))}updateHoveredIndex(){const t=this.options;const i=this.value;this.hoveredIndex=t.findIndex((t=>t.getAttribute("value")===i))}scrollIntoView(){var t;const i=(t=this.host.shadowRoot)===null||t===void 0?void 0:t.querySelector(".dropdown-search-list");const e=this.options[this.hoveredIndex];if(i&&e){const t=e.getBoundingClientRect();const o=i.getBoundingClientRect();if(t.bottom>o.bottom){i.scrollTop+=t.bottom-o.bottom}if(t.top<o.top){i.scrollTop-=o.top-t.top}}}handleOnBlur(){if(this.isOnBlurInput===true){setTimeout((()=>{this.isDropdownOpen=false;this.removeOverlay()}),200)}}getClasses(){return{"dropdown-input-search":true,"dropdown-open":this.isDropdownOpen,[this.status]:true}}getDropdownClasses(){return{"dropdown-search-list":true,visible:this.options.length&&this.isDropdownOpen?true:false}}hostCSSProperties(){return{"--dropdown-max-height":this.dropdownMaxHeight}}render(){const t=this.isMobile&&this.isDropdownOpen;return e(o,{key:"993da099b8256bfb9ee7b3ebabd4860e9019d097",style:this.hostCSSProperties(),class:"dropdown-overlay"},e("div",{key:"883246cc7a1020ba83a4eda4fb1f6483519314cf",class:`dropdown ${t?"dropdown-mobile":""}`,style:this.styles},e("div",{key:"5189508f35c5fc62883820a8c378bce8a3e67b7d",class:this.getClasses()},this.isMobile&&this.isDropdownOpen&&e("cura-button-transparent",{key:"cbedd224556935a715380168c1be22d3127e920c",fontColor:"dark",onClick:()=>this.isMobile=false,iconName:"arrowLeft",size:"medium",iconOnly:true,color:"primary"}),e("cura-input-text",{key:"a8dd2fe42d5bc64683ba56e7bad6b6d08ce92fca",label:this.label,part:"cura-input-field",mode:t?"transparent":"default",required:this.required,hideErrorIcon:this.status==="error",iconName:this.iconName||"search",value:this.value,status:this.status,onValueChange:t=>this.onValueChange(t.target.value),onInput:t=>this.handleInputChange(t),onFocus:()=>this.isDropdownOpen=true,onClick:()=>window.innerWidth<768?this.isMobile=true:null,onBlur:()=>{this.handleOnBlur()},placeholder:this.placeholder,size:"large",onKeyDown:this.handleKeyDown},e("slot",{key:"9991e5cfd78b73b9b2da92ae217fad3ae109a2c9",name:"helperText"}))),e("div",{key:"664abccc90e95b83aa3192282453d199ae2a0c5f",id:"dropdown-search-list",class:this.getDropdownClasses()},e("slot",{key:"2eca99c0ec684020000edc46ebbc5f8097e78200",name:"dropdown-search-option",onSlotchange:this.handleSlotChange}))))}get host(){return s(this)}static get watchers(){return{value:["onValueChange"]}}};d.style=n;export{d as cura_dropdown_search};
2
+ //# sourceMappingURL=p-b1148bb2.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["curaDropdownSearchCss","CuraDropdownSearchStyle0","CuraDropdownSearch","this","overlayElement","handleSlotChange","options","Array","from","host","querySelectorAll","addClickListenersToOptions","updateHoveredIndex","handleInputChange","event","input","target","value","onValueChange","handleKeyDown","key","preventDefault","moveHighlight","hoveredIndex","handleOnBlur","onSelectedOption","handleResize","isMobile","window","innerWidth","isDropdownOpen","showOverlay","removeOverlay","connectedCallback","weights","CuraAPI","theme","fonts","getWeights","styles","colors","getColor","breakpoints","get","getSize","getFamily","medium","newValue","updateSelectedOption","valueChanged","emit","componentWillLoad","componentDidRender","componentDidLoad","addEventListener","disconnectedCallback","removeEventListener","document","createElement","className","style","position","top","left","width","height","zIndex","backgroundColor","body","appendChild","parentNode","removeChild","forEach","option","index","selectedOptionIndex","findIndex","getAttribute","updateOptionAttribute","scrollIntoView","selectedOption","selectable","selectedValue","textContent","isOnBlurInput","direction","visibleOptions","newIndex","length","attribute","indexToUpdate","currentValue","container","_a","shadowRoot","querySelector","hoveredOption","optionRect","getBoundingClientRect","containerRect","bottom","scrollTop","setTimeout","getClasses","status","getDropdownClasses","visible","hostCSSProperties","dropdownMaxHeight","render","isMobileDropdown","h","Host","class","fontColor","onClick","iconName","size","iconOnly","color","label","part","mode","required","hideErrorIcon","e","onInput","onFocus","onBlur","placeholder","onKeyDown","name","id","onSlotchange"],"sources":["src/components/forms/cura-dropdown-search/cura-dropdown-search.scss?tag=cura-dropdown-search&encapsulation=shadow","src/components/forms/cura-dropdown-search/cura-dropdown-search.tsx"],"sourcesContent":["@import '../../../scss/mixins/shadows.scss';\n\n:host {\n display: block;\n width: 100%;\n box-sizing: border-box;\n}\n\n.dropdown {\n display: flex;\n position: relative;\n\n flex-direction: column;\n width: inherit;\n\n &-input-search {\n width: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n background: transparent;\n\n\n &.dropdown-open {\n ::part(cura-input-field) {\n border-radius: 4px 4px 0px 0px;\n }\n ::slotted([slot='helperText']) {\n display: none;\n }\n\n cura-input-text {\n ::slotted([slot='helperText']) {\n display: none;\n }\n }\n }\n }\n\n &-search-list {\n position: absolute;\n top: calc(100% - 8px);\n width: 100%;\n max-height: var(--dropdown-max-height);\n padding: 12px 12px;\n margin: 0;\n box-sizing: border-box;\n @include shadow-level3(--neutral-black-shadow);\n border-radius: 0px 0px 4px 4px;\n border-top: 0 var(--neutral-light);\n border-right: 2px solid var(--neutral-light);\n border-bottom: 2px solid var(--neutral-light);\n border-left: 2px solid var(--neutral-light);\n background-color: var(--neutral-purewhite);\n list-style: none;\n overflow-y: auto;\n display: none;\n\n &.visible {\n display: block;\n }\n\n &-input-search {\n width: inherit;\n\n display: flex;\n justify-content: center;\n align-items: center;\n padding: 16px 8px;\n border-bottom: 2px solid var(--info-base);\n background-color: var(--neutral-purewhite);\n\n cura-input-text {\n width: inherit;\n }\n\n &.error {\n background-color: var(--error-lighter);\n border-bottom: 2px solid var(--error-dark);\n }\n }\n }\n\n &-mobile {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n width: 100%;\n\n z-index: 10000;\n .dropdown-input-search {\n display: flex;\n gap: 4px;\n padding: 12px 8px;\n background-color: var(--neutral-purewhite);\n border-bottom: 2px solid var(--info-base);\n z-index: 10000;\n cura-button-transparent {\n display: flex;\n }\n &.error {\n background-color: var(--error-lighter);\n border-bottom: 2px solid var(--error-dark);\n }\n &.dropdown-open {\n display: flex;\n\n ::slotted([slot='helperText']) {\n display: block;\n }\n }\n }\n .dropdown-search-list {\n position: static;\n width: 100%;\n height: 100%;\n max-height: none;\n padding: 12px 12px;\n margin: 0;\n box-sizing: border-box;\n box-shadow: none;\n border: none;\n background-color: var(--neutral-purewhite);\n list-style: none;\n overflow-y: auto;\n z-index: 10000;\n }\n }\n}\n","import { Component, Host, Prop, State, Event, EventEmitter, Element, Watch, h } from '@stencil/core';\n\n@Component({\n tag: 'cura-dropdown-search',\n styleUrl: 'cura-dropdown-search.scss',\n shadow: true,\n})\nexport class CuraDropdownSearch {\n /**\n * Define the status of the dropdown search.\n */\n @Prop({ reflect: true }) status: 'error' | 'default' = 'default';\n\n /**\n * The name of the dropdown search component.\n */\n @Prop({ reflect: true }) name: string;\n\n /**\n * Indicates if the dropdown search is required.\n */\n @Prop({ reflect: true, mutable: true }) required: boolean = false;\n\n /**\n * Indicates if the dropdown search is selected.\n */\n @Prop({ reflect: true, mutable: true }) selected: boolean = false;\n\n /**\n * The value of the dropdown search.\n */\n @Prop({ reflect: true, mutable: true }) value: string = '';\n\n /**\n * The placeholder text for the dropdown search.\n */\n @Prop({ reflect: true, mutable: true }) placeholder: string = '';\n\n /**\n * The label for the dropdown search.\n */\n @Prop({ reflect: true, mutable: true }) label: string = '';\n\n /**\n * Custom icon name. Default: search.\n */\n @Prop({reflect: true}) iconName = 'search';\n\n /**\n * CSS max-height property for dropdown item.\n * Default to 630px\n */\n @Prop({reflect: true}) dropdownMaxHeight = '630px';\n\n /**\n * Reference to the host element.\n */\n @Element() host: HTMLElement;\n\n /**\n * Indicates if the overlay is visible.\n */\n @State() overlayVisible: boolean = false;\n\n /**\n * Event emitted when the value changes.\n */\n @Event() valueChanged: EventEmitter<string>;\n\n /**\n * Indicates if the dropdown is open.\n */\n @State() isDropdownOpen: boolean = false;\n\n /**\n * Styles for the component.\n\n */\n @State() styles = {};\n\n /**\n * Indicates if the component is being viewed on a mobile device.\n */\n @State() isMobile: boolean = window.innerWidth < 768;\n\n /**\n * The mode of the dropdown search.\n */\n @State() mode: 'default' | 'transparent' = 'default';\n\n @Event() onselect: EventEmitter;\n\n @State() inputTextRef!: HTMLCuraInputTextElement;\n\n /**\n * Indicates if the input is on blur.\n */\n @State() isOnBlurInput: boolean = true;\n\n /**\n * The index of the currently hovered option.\n */\n @State() hoveredIndex: number = -1;\n\n /**\n * The options for the dropdown search.\n * @type {HTMLCuraDropdownSearchOptionElement[]}\n */\n\n weights;\n\n private overlayElement: HTMLDivElement | null = null;\n\n @State() options: HTMLCuraDropdownSearchOptionElement[] = [];\n\n connectedCallback() {\n this.weights = window.CuraAPI.theme.fonts.getWeights();\n this.styles['--info-base'] = window.CuraAPI.theme.colors.getColor('info-base');\n this.styles['--neutral-purewhite'] = window.CuraAPI.theme.colors.getColor('neutral-purewhite');\n this.styles['--neutral-light'] = window.CuraAPI.theme.colors.getColor('neutral-light');\n this.styles['--neutral-dark'] = window.CuraAPI.theme.colors.getColor('neutral-dark');\n this.styles['--neutral-black-shadow'] = window.CuraAPI.theme.colors.getColor(`neutral-black`, 0.16);\n this.styles['--error-dark'] = window.CuraAPI.theme.colors.getColor('error-dark');\n this.styles['--error-lighter'] = window.CuraAPI.theme.colors.getColor('error-lighter');\n this.styles['--breakpoints'] = window.CuraAPI.theme.breakpoints.get();\n this.styles['--font-size'] = window.CuraAPI.theme.fonts.getSize();\n this.styles['--font-family'] = window.CuraAPI.theme.fonts.getFamily();\n this.styles['--font-weight-medium'] = this.weights.medium;\n }\n\n @Watch('value')\n onValueChange(newValue: string) {\n this.updateSelectedOption(newValue);\n this.valueChanged.emit(this.value);\n }\n\n componentWillLoad() {\n this.updateSelectedOption(this.value);\n }\n\n componentDidRender() {\n if (this.isDropdownOpen && this.isMobile) {\n this.showOverlay();\n } else {\n this.removeOverlay();\n }\n }\n componentDidLoad() {\n window.addEventListener('resize', this.handleResize);\n }\n\n disconnectedCallback() {\n window.removeEventListener('resize', this.handleResize);\n }\n\n private showOverlay() {\n if (!this.overlayElement) {\n this.overlayElement = document.createElement('div');\n this.overlayElement.className = 'dropdown-overlay';\n this.overlayElement.style.position = 'fixed';\n this.overlayElement.style.top = '0';\n this.overlayElement.style.left = '0';\n this.overlayElement.style.width = '100%';\n this.overlayElement.style.height = '100%';\n this.overlayElement.style.zIndex = '9999';\n this.overlayElement.style.backgroundColor = 'white';\n document.body.appendChild(this.overlayElement);\n }\n }\n\n private removeOverlay() {\n if (this.overlayElement && this.overlayElement.parentNode === document.body) {\n document.body.removeChild(this.overlayElement);\n this.overlayElement = null;\n }\n }\n\n private handleSlotChange = () => {\n this.options = Array.from(this.host.querySelectorAll('cura-dropdown-search-option'));\n this.addClickListenersToOptions();\n this.updateHoveredIndex();\n };\n\n private addClickListenersToOptions() {\n this.options.forEach((option, index) => {\n option.addEventListener('click', () => this.onSelectedOption(index));\n });\n }\n\n private updateSelectedOption(value: string) {\n const selectedOptionIndex = this.options.findIndex(option => option.getAttribute('value') === value);\n this.hoveredIndex = selectedOptionIndex;\n this.updateOptionAttribute('hovered', this.hoveredIndex);\n this.updateOptionAttribute('selected', this.hoveredIndex);\n\n this.scrollIntoView();\n }\n\n private handleInputChange = (event: Event) => {\n const input = event.target as HTMLInputElement;\n this.value = input.value;\n this.onValueChange(this.value);\n // this.valueChanged.emit(this.value);\n };\n\n private onSelectedOption(index: number) {\n const selectedOption = this.options[index];\n if(selectedOption.selectable) {\n const selectedValue = selectedOption.getAttribute('value') || selectedOption.textContent;\n\n this.value = selectedValue || '';\n this.updateSelectedOption(this.value);\n\n this.isDropdownOpen = false;\n this.isOnBlurInput = true;\n this.removeOverlay();\n }\n }\n\n private handleKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'ArrowDown') {\n event.preventDefault();\n this.moveHighlight(1);\n } else if (event.key === 'ArrowUp') {\n event.preventDefault();\n this.moveHighlight(-1);\n } else if (event.key === 'Enter') {\n event.preventDefault();\n if (this.hoveredIndex > -1) {\n this.handleOnBlur();\n this.onSelectedOption(this.hoveredIndex);\n }\n }\n };\n\n private moveHighlight(direction: number) {\n const visibleOptions = this.options;\n const newIndex = (this.hoveredIndex + direction + visibleOptions.length) % visibleOptions.length;\n this.hoveredIndex = newIndex;\n this.updateOptionAttribute('hovered', this.hoveredIndex);\n this.scrollIntoView();\n }\n\n private updateOptionAttribute(attribute: string, indexToUpdate: number) {\n this.options.forEach((option, index) => {\n (option as any)[attribute] = index === indexToUpdate;\n });\n }\n\n private updateHoveredIndex() {\n const visibleOptions = this.options;\n const currentValue = this.value;\n this.hoveredIndex = visibleOptions.findIndex(option => option.getAttribute('value') === currentValue);\n }\n\n private scrollIntoView() {\n const container = this.host.shadowRoot?.querySelector('.dropdown-search-list');\n const hoveredOption = this.options[this.hoveredIndex];\n\n if (container && hoveredOption) {\n const optionRect = hoveredOption.getBoundingClientRect();\n const containerRect = container.getBoundingClientRect();\n\n if (optionRect.bottom > containerRect.bottom) {\n container.scrollTop += optionRect.bottom - containerRect.bottom;\n }\n\n if (optionRect.top < containerRect.top) {\n container.scrollTop -= containerRect.top - optionRect.top;\n }\n }\n }\n\n private handleResize = () => {\n this.isMobile = window.innerWidth < 768;\n if (this.isDropdownOpen) {\n if (this.isMobile) {\n this.showOverlay();\n } else {\n this.removeOverlay();\n }\n }\n };\n\n handleOnBlur() {\n if (this.isOnBlurInput === true) {\n setTimeout(() => {\n this.isDropdownOpen = false;\n this.removeOverlay();\n }, 200);\n }\n }\n getClasses() {\n return {\n 'dropdown-input-search': true,\n 'dropdown-open': this.isDropdownOpen,\n [this.status]: true,\n };\n }\n\n getDropdownClasses() {\n return {\n 'dropdown-search-list': true,\n 'visible': this.options.length && this.isDropdownOpen ? true : false\n };\n }\n\n hostCSSProperties() {\n return {\n '--dropdown-max-height': this.dropdownMaxHeight,\n };\n }\n\n render() {\n const isMobileDropdown = this.isMobile && this.isDropdownOpen;\n return (\n <Host style={this.hostCSSProperties()} class=\"dropdown-overlay\">\n <div class={`dropdown ${isMobileDropdown ? 'dropdown-mobile' : ''}`} style={this.styles}>\n <div class={this.getClasses()}>\n {this.isMobile && this.isDropdownOpen && (\n <cura-button-transparent\n fontColor=\"dark\"\n onClick={() => (this.isMobile = false)}\n iconName=\"arrowLeft\"\n size=\"medium\"\n iconOnly\n color=\"primary\"\n ></cura-button-transparent>\n )}\n <cura-input-text\n label={this.label}\n part=\"cura-input-field\"\n mode={isMobileDropdown ? 'transparent' : 'default'}\n required={this.required}\n hideErrorIcon={this.status === 'error'}\n iconName={this.iconName || 'search'}\n value={this.value}\n status={this.status}\n onValueChange={e => this.onValueChange(e.target.value as string)}\n onInput={e => this.handleInputChange(e)}\n onFocus={() => (this.isDropdownOpen = true)}\n onClick={() => (window.innerWidth < 768 ? (this.isMobile = true) : null)}\n onBlur={() => {\n this.handleOnBlur();\n }}\n placeholder={this.placeholder}\n size=\"large\"\n onKeyDown={this.handleKeyDown}\n >\n <slot name=\"helperText\"></slot>\n </cura-input-text>\n </div>\n <div id=\"dropdown-search-list\" class={this.getDropdownClasses()}>\n <slot name=\"dropdown-search-option\" onSlotchange={this.handleSlotChange}></slot>\n </div>\n </div>\n </Host>\n );\n }\n}\n"],"mappings":"gEAAA,MAAMA,EAAwB,yyEAC9B,MAAAC,EAAeD,E,MCMFE,EAAkB,M,uGAwGrBC,KAAAC,eAAwC,KAkExCD,KAAAE,iBAAmB,KACzBF,KAAKG,QAAUC,MAAMC,KAAKL,KAAKM,KAAKC,iBAAiB,gCACrDP,KAAKQ,6BACLR,KAAKS,oBAAoB,EAkBnBT,KAAAU,kBAAqBC,IAC3B,MAAMC,EAAQD,EAAME,OACpBb,KAAKc,MAAQF,EAAME,MACnBd,KAAKe,cAAcf,KAAKc,MAAM,EAkBxBd,KAAAgB,cAAiBL,IACvB,GAAIA,EAAMM,MAAQ,YAAa,CAC7BN,EAAMO,iBACNlB,KAAKmB,cAAc,E,MACd,GAAIR,EAAMM,MAAQ,UAAW,CAClCN,EAAMO,iBACNlB,KAAKmB,eAAe,E,MACf,GAAIR,EAAMM,MAAQ,QAAS,CAChCN,EAAMO,iBACN,GAAIlB,KAAKoB,cAAgB,EAAG,CAC1BpB,KAAKqB,eACLrB,KAAKsB,iBAAiBtB,KAAKoB,a,IA2CzBpB,KAAAuB,aAAe,KACrBvB,KAAKwB,SAAWC,OAAOC,WAAa,IACpC,GAAI1B,KAAK2B,eAAgB,CACvB,GAAI3B,K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B,MAAO9G,KAAKsG,sBACzCM,EAAA,QAAA3F,IAAA,2CAAM+G,KAAK,yBAAyBE,aAAclI,KAAKE,qB","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ import{r as t,h as i,H as r,c as e}from"./p-312791fb.js";const s=':host{--border-radius:4px;display:inline-block;vertical-align:middle;position:relative}:host button,:host a{outline:none;box-shadow:none;box-sizing:border-box;display:flex;width:100%;align-items:center;justify-content:center;text-decoration:none !important;font-size:var(--font-size);cursor:pointer;transition:background-color 0.07s linear, box-shadow 0.07s linear, border-color 0.07s linear;border-radius:var(--border-radius);position:relative;background-color:transparent;border-width:0px;border:2px solid transparent}:host button:focus,:host a:focus{outline:2px solid #6EA8FF}:host button.large,:host a.large{padding:calc(var(--base-spacing) * 6.12px) calc(var(--base-spacing) * 9.96px);min-height:calc(var(--base-spacing) * 13px);min-width:calc(var(--base-spacing) * 33.7px)}:host button.medium,:host a.medium{padding:calc(var(--base-spacing) * 3.44px) calc(var(--base-spacing) * 9.96px);min-height:calc(var(--base-spacing) * 11px);min-width:calc(var(--base-spacing) * 29.95px)}:host button.small,:host a.small{padding:calc(var(--base-spacing) * 3.24px) calc(var(--base-spacing) * 7.44px);min-height:calc(var(--base-spacing) * 8px);min-width:calc(var(--base-spacing) * 21.67px)}:host button:not(.isLoading).large,:host a:not(.isLoading).large{padding:calc(var(--base-spacing) * 3.5px) calc(var(--base-spacing) * 4px);min-height:calc(var(--base-spacing) * 13px);min-width:calc(var(--base-spacing) * 13px)}:host button:not(.isLoading).medium,:host a:not(.isLoading).medium{padding:calc(var(--base-spacing) * 2.75px) calc(var(--base-spacing) * 4px);min-height:calc(var(--base-spacing) * 11px);min-width:calc(var(--base-spacing) * 11px)}:host button:not(.isLoading).small,:host a:not(.isLoading).small{padding:calc(var(--base-spacing) * 1.5px) calc(var(--base-spacing) * 3px);min-height:calc(var(--base-spacing) * 8px);min-width:calc(var(--base-spacing) * 8px)}:host button .button-container,:host a .button-container{display:flex;align-items:center;opacity:1;transition:opacity 0.2s linear;position:relative}:host button.icon-right .button-container,:host a.icon-right .button-container{flex-direction:row-reverse}:host button cura-label,:host a cura-label{flex:1;font-family:var(--font-family);font-weight:var(--font-weight-medium);font-size:1.43em;line-height:1.2em;text-align:var(--text-align, "left")}:host button.medium cura-label,:host a.medium cura-label{font-size:1.14em}:host button.small cura-label,:host a.small cura-label{font-size:1em}:host button.icon-left cura-icon,:host a.icon-left cura-icon{margin-right:calc(var(--base-spacing) * 3px)}:host button.icon-right cura-icon,:host a.icon-right cura-icon{margin-left:calc(var(--base-spacing) * 3px)}:host button.medium.icon-left cura-icon,:host a.medium.icon-left cura-icon{margin-right:calc(var(--base-spacing) * 2.7px)}:host button.medium.icon-right cura-icon,:host a.medium.icon-right cura-icon{margin-left:calc(var(--base-spacing) * 2.7px)}:host button.small.icon-left cura-icon,:host a.small.icon-left cura-icon{margin-right:calc(var(--base-spacing) * 2.5px)}:host button.small.icon-right cura-icon,:host a.small.icon-right cura-icon{margin-left:calc(var(--base-spacing) * 2.5px)}:host button.disabled,:host a.disabled{cursor:not-allowed}:host button.icon-only,:host a.icon-only{padding:calc(var(--base-spacing) * 3.5px)}:host button.icon-only cura-label,:host a.icon-only cura-label{display:none}:host button.icon-only cura-icon,:host a.icon-only cura-icon{margin-left:0 !important;margin-right:0 !important}:host button.icon-only.medium,:host a.icon-only.medium{padding:calc(var(--base-spacing) * 2.75px)}:host button.icon-only.small,:host a.icon-only.small{padding:calc(var(--base-spacing) * 1.5px)}:host button cura-loader-circle,:host a cura-loader-circle{position:absolute;display:none}:host button.isLoading,:host a.isLoading{cursor:wait}:host button.isLoading .button-container,:host a.isLoading .button-container{opacity:0.3}:host button.isLoading.icon-only .button-container,:host a.isLoading.icon-only .button-container{opacity:0}:host button.isLoading cura-loader-circle,:host a.isLoading cura-loader-circle{display:block}:host button.isLoading cura-label,:host a.isLoading cura-label{display:none}';const n=s;const u=class{constructor(i){t(this,i);if(i.$hostElement$["s-ei"]){this.internals=i.$hostElement$["s-ei"]}else{this.internals=i.$hostElement$.attachInternals();i.$hostElement$["s-ei"]=this.internals}this.type="button";this.size="large";this.disabled="false";this.isLoading=false;this.iconName=undefined;this.iconset="default";this.iconPosition="left";this.iconOnly=false;this.href=undefined;this.target="_self";this.color="primary";this.fontColor="light";this.textAlign="left";this.hovered=false;this.styles={}}connectedCallback(){this.weights=window.CuraAPI.theme.fonts.getWeights();this.styles["--base-spacing"]=window.CuraAPI.theme.spacing.getSpacing();this.styles["--neutral-white"]=window.CuraAPI.theme.colors.getColor(`neutral-white`);this.styles["--neutral-base"]=window.CuraAPI.theme.colors.getColor(`neutral-base`);this.styles["--neutral-dark"]=window.CuraAPI.theme.colors.getColor(`neutral-dark`);this.styles["--font-size"]=window.CuraAPI.theme.fonts.getSize();this.styles["--font-family"]=window.CuraAPI.theme.fonts.getFamily();this.styles["--font-weight-medium"]=this.weights.medium;this.styles["--text-align"]=this.textAlign}getClasses(){const t={};t[`${this.size.toLowerCase()}`]=true;t[`icon-${this.iconPosition.toLowerCase()}`]=true;t[`icon-only`]=this.iconOnly;t["disabled"]=this.disabled;t["isLoading"]=this.isLoading;return t}getIcon(){if(!this.iconName||this.isLoading)return null;const t=this.size==="small"?16:this.size==="medium"?20:24;return i("cura-icon",{name:this.iconName,iconset:this.iconset,size:t,color:this.getSymbolColor()})}handleMouseEnter(){if(this.disabled)return;this.hovered=true}handleMouseLeave(){this.hovered=false}getSymbolColor(){if(this.disabled)return"neutral-dark";if(this.hovered)return this.fontColor==="light"?`${this.color}-darker`:`${this.color}-lighter`;return this.fontColor==="light"?"neutral-purewhite":`${this.color}-dark`}handleClick(t){if(this.disabled||this.isLoading){t.preventDefault();return}if(!this.href){if(this.type==="submit"&&this.internals.form)this.internals.form.submit();if(this.type==="reset"&&this.internals.form)this.internals.form.reset()}}render(){return i(r,{key:"aa51dc3bd4dcf3487b253048e7580e89aef6ed81"},this.href?i("a",{href:this.disabled?"":this.href,target:this.target,class:this.getClasses(),style:this.styles,onClick:t=>this.handleClick(t),onMouseEnter:()=>this.handleMouseEnter(),onMouseLeave:()=>this.handleMouseLeave()},i("span",{class:"button-container"},this.getIcon(),i("cura-label",{lineHeight:"0%",color:this.getSymbolColor()},i("slot",null))),i("cura-loader-circle",{size:this.size,color:this.fontColor==="light"?`${this.color}-dark`:"neutral-purewhite"})):i("button",{class:this.getClasses(),style:this.styles,disabled:this.disabled==="true"?true:null,onClick:t=>this.handleClick(t),onMouseEnter:()=>this.handleMouseEnter(),onMouseLeave:()=>this.handleMouseLeave(),type:this.type},i("span",{class:"button-container"},this.getIcon(),i("cura-label",{lineHeight:"0%",color:this.getSymbolColor()},i("slot",null))),i("cura-loader-circle",{size:this.size,color:this.fontColor==="light"?`${this.color}-dark`:"neutral-purewhite"})))}static get formAssociated(){return true}static get watchers(){return{fontColor:["getSymbolColor"],color:["getSymbolColor"]}}};u.style=n;function a(t){return typeof t==="string"||t instanceof String}function o(t){var i;return typeof t==="object"&&t!=null&&(t==null||(i=t.constructor)==null?void 0:i.name)==="Object"}function h(t,i){if(Array.isArray(i))return h(t,((t,r)=>i.includes(r)));return Object.entries(t).reduce(((t,r)=>{let[e,s]=r;if(i(s,e))t[e]=s;return t}),{})}const l={NONE:"NONE",LEFT:"LEFT",FORCE_LEFT:"FORCE_LEFT",RIGHT:"RIGHT",FORCE_RIGHT:"FORCE_RIGHT"};function p(t){switch(t){case l.LEFT:return l.FORCE_LEFT;case l.RIGHT:return l.FORCE_RIGHT;default:return t}}function c(t){return t.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")}function d(t,i){if(i===t)return true;const r=Array.isArray(i),e=Array.isArray(t);let s;if(r&&e){if(i.length!=t.length)return false;for(s=0;s<i.length;s++)if(!d(i[s],t[s]))return false;return true}if(r!=e)return false;if(i&&t&&typeof i==="object"&&typeof t==="object"){const r=i instanceof Date,e=t instanceof Date;if(r&&e)return i.getTime()==t.getTime();if(r!=e)return false;const n=i instanceof RegExp,u=t instanceof RegExp;if(n&&u)return i.toString()==t.toString();if(n!=u)return false;const a=Object.keys(i);for(s=0;s<a.length;s++)if(!Object.prototype.hasOwnProperty.call(t,a[s]))return false;for(s=0;s<a.length;s++)if(!d(t[a[s]],i[a[s]]))return false;return true}else if(i&&t&&typeof i==="function"&&typeof t==="function"){return i.toString()===t.toString()}return false}class f{constructor(t){Object.assign(this,t);while(this.value.slice(0,this.startChangePos)!==this.oldValue.slice(0,this.startChangePos)){--this.oldSelection.start}if(this.insertedCount){while(this.value.slice(this.cursorPos)!==this.oldValue.slice(this.oldSelection.end)){if(this.value.length-this.cursorPos<this.oldValue.length-this.oldSelection.end)++this.oldSelection.end;else++this.cursorPos}}}get startChangePos(){return Math.min(this.cursorPos,this.oldSelection.start)}get insertedCount(){return this.cursorPos-this.startChangePos}get inserted(){return this.value.substr(this.startChangePos,this.insertedCount)}get removedCount(){return Math.max(this.oldSelection.end-this.startChangePos||this.oldValue.length-this.value.length,0)}get removed(){return this.oldValue.substr(this.startChangePos,this.removedCount)}get head(){return this.value.substring(0,this.startChangePos)}get tail(){return this.value.substring(this.startChangePos+this.insertedCount)}get removeDirection(){if(!this.removedCount||this.insertedCount)return l.NONE;return(this.oldSelection.end===this.cursorPos||this.oldSelection.start===this.cursorPos)&&this.oldSelection.end===this.oldSelection.start?l.RIGHT:l.LEFT}}function g(t,i){return new g.InputMask(t,i)}function b(t){if(t==null)throw new Error("mask property should be defined");if(t instanceof RegExp)return g.MaskedRegExp;if(a(t))return g.MaskedPattern;if(t===Date)return g.MaskedDate;if(t===Number)return g.MaskedNumber;if(Array.isArray(t)||t===Array)return g.MaskedDynamic;if(g.Masked&&t.prototype instanceof g.Masked)return t;if(g.Masked&&t instanceof g.Masked)return t.constructor;if(t instanceof Function)return g.MaskedFunction;console.warn("Mask not found for mask",t);return g.Masked}function m(t){if(!t)throw new Error("Options in not defined");if(g.Masked){if(t.prototype instanceof g.Masked)return{mask:t};const{mask:i=undefined,...r}=t instanceof g.Masked?{mask:t}:o(t)&&t.mask instanceof g.Masked?t:{};if(i){const t=i.mask;return{...h(i,((t,i)=>!i.startsWith("_"))),mask:i.constructor,_mask:t,...r}}}if(!o(t))return{mask:t};return{...t}}function x(t){if(g.Masked&&t instanceof g.Masked)return t;const i=m(t);const r=b(i.mask);if(!r)throw new Error("Masked class is not found for provided mask "+i.mask+", appropriate module needs to be imported manually before creating mask.");if(i.mask===r)delete i.mask;if(i._mask){i.mask=i._mask;delete i._mask}return new r(i)}g.createMask=x;class v{get selectionStart(){let t;try{t=this._unsafeSelectionStart}catch{}return t!=null?t:this.value.length}get selectionEnd(){let t;try{t=this._unsafeSelectionEnd}catch{}return t!=null?t:this.value.length}select(t,i){if(t==null||i==null||t===this.selectionStart&&i===this.selectionEnd)return;try{this._unsafeSelect(t,i)}catch{}}get isActive(){return false}}g.MaskElement=v;const w=90;const k=89;class A extends v{constructor(t){super();this.input=t;this._onKeydown=this._onKeydown.bind(this);this._onInput=this._onInput.bind(this);this._onBeforeinput=this._onBeforeinput.bind(this);this._onCompositionEnd=this._onCompositionEnd.bind(this)}get rootElement(){var t,i,r;return(t=(i=(r=this.input).getRootNode)==null?void 0:i.call(r))!=null?t:document}get isActive(){return this.input===this.rootElement.activeElement}bindEvents(t){this.input.addEventListener("keydown",this._onKeydown);this.input.addEventListener("input",this._onInput);this.input.addEventListener("beforeinput",this._onBeforeinput);this.input.addEventListener("compositionend",this._onCompositionEnd);this.input.addEventListener("drop",t.drop);this.input.addEventListener("click",t.click);this.input.addEventListener("focus",t.focus);this.input.addEventListener("blur",t.commit);this._handlers=t}_onKeydown(t){if(this._handlers.redo&&(t.keyCode===w&&t.shiftKey&&(t.metaKey||t.ctrlKey)||t.keyCode===k&&t.ctrlKey)){t.preventDefault();return this._handlers.redo(t)}if(this._handlers.undo&&t.keyCode===w&&(t.metaKey||t.ctrlKey)){t.preventDefault();return this._handlers.undo(t)}if(!t.isComposing)this._handlers.selectionChange(t)}_onBeforeinput(t){if(t.inputType==="historyUndo"&&this._handlers.undo){t.preventDefault();return this._handlers.undo(t)}if(t.inputType==="historyRedo"&&this._handlers.redo){t.preventDefault();return this._handlers.redo(t)}}_onCompositionEnd(t){this._handlers.input(t)}_onInput(t){if(!t.isComposing)this._handlers.input(t)}unbindEvents(){this.input.removeEventListener("keydown",this._onKeydown);this.input.removeEventListener("input",this._onInput);this.input.removeEventListener("beforeinput",this._onBeforeinput);this.input.removeEventListener("compositionend",this._onCompositionEnd);this.input.removeEventListener("drop",this._handlers.drop);this.input.removeEventListener("click",this._handlers.click);this.input.removeEventListener("focus",this._handlers.focus);this.input.removeEventListener("blur",this._handlers.commit);this._handlers={}}}g.HTMLMaskElement=A;class y extends A{constructor(t){super(t);this.input=t}get _unsafeSelectionStart(){return this.input.selectionStart!=null?this.input.selectionStart:this.value.length}get _unsafeSelectionEnd(){return this.input.selectionEnd}_unsafeSelect(t,i){this.input.setSelectionRange(t,i)}get value(){return this.input.value}set value(t){this.input.value=t}}g.HTMLMaskElement=A;class C extends A{get _unsafeSelectionStart(){const t=this.rootElement;const i=t.getSelection&&t.getSelection();const r=i&&i.anchorOffset;const e=i&&i.focusOffset;if(e==null||r==null||r<e){return r}return e}get _unsafeSelectionEnd(){const t=this.rootElement;const i=t.getSelection&&t.getSelection();const r=i&&i.anchorOffset;const e=i&&i.focusOffset;if(e==null||r==null||r>e){return r}return e}_unsafeSelect(t,i){if(!this.rootElement.createRange)return;const r=this.rootElement.createRange();r.setStart(this.input.firstChild||this.input,t);r.setEnd(this.input.lastChild||this.input,i);const e=this.rootElement;const s=e.getSelection&&e.getSelection();if(s){s.removeAllRanges();s.addRange(r)}}get value(){return this.input.textContent||""}set value(t){this.input.textContent=t}}g.HTMLContenteditableMaskElement=C;class F{constructor(){this.states=[];this.currentIndex=0}get currentState(){return this.states[this.currentIndex]}get isEmpty(){return this.states.length===0}push(t){if(this.currentIndex<this.states.length-1)this.states.length=this.currentIndex+1;this.states.push(t);if(this.states.length>F.MAX_LENGTH)this.states.shift();this.currentIndex=this.states.length-1}go(t){this.currentIndex=Math.min(Math.max(this.currentIndex+t,0),this.states.length-1);return this.currentState}undo(){return this.go(-1)}redo(){return this.go(+1)}clear(){this.states.length=0;this.currentIndex=0}}F.MAX_LENGTH=100;class B{constructor(t,i){this.el=t instanceof v?t:t.isContentEditable&&t.tagName!=="INPUT"&&t.tagName!=="TEXTAREA"?new C(t):new y(t);this.masked=x(i);this._listeners={};this._value="";this._unmaskedValue="";this._rawInputValue="";this.history=new F;this._saveSelection=this._saveSelection.bind(this);this._onInput=this._onInput.bind(this);this._onChange=this._onChange.bind(this);this._onDrop=this._onDrop.bind(this);this._onFocus=this._onFocus.bind(this);this._onClick=this._onClick.bind(this);this._onUndo=this._onUndo.bind(this);this._onRedo=this._onRedo.bind(this);this.alignCursor=this.alignCursor.bind(this);this.alignCursorFriendly=this.alignCursorFriendly.bind(this);this._bindEvents();this.updateValue();this._onChange()}maskEquals(t){var i;return t==null||((i=this.masked)==null?void 0:i.maskEquals(t))}get mask(){return this.masked.mask}set mask(t){if(this.maskEquals(t))return;if(!(t instanceof g.Masked)&&this.masked.constructor===b(t)){this.masked.updateOptions({mask:t});return}const i=t instanceof g.Masked?t:x({mask:t});i.unmaskedValue=this.masked.unmaskedValue;this.masked=i}get value(){return this._value}set value(t){if(this.value===t)return;this.masked.value=t;this.updateControl("auto")}get unmaskedValue(){return this._unmaskedValue}set unmaskedValue(t){if(this.unmaskedValue===t)return;this.masked.unmaskedValue=t;this.updateControl("auto")}get rawInputValue(){return this._rawInputValue}set rawInputValue(t){if(this.rawInputValue===t)return;this.masked.rawInputValue=t;this.updateControl();this.alignCursor()}get typedValue(){return this.masked.typedValue}set typedValue(t){if(this.masked.typedValueEquals(t))return;this.masked.typedValue=t;this.updateControl("auto")}get displayValue(){return this.masked.displayValue}_bindEvents(){this.el.bindEvents({selectionChange:this._saveSelection,input:this._onInput,drop:this._onDrop,click:this._onClick,focus:this._onFocus,commit:this._onChange,undo:this._onUndo,redo:this._onRedo})}_unbindEvents(){if(this.el)this.el.unbindEvents()}_fireEvent(t,i){const r=this._listeners[t];if(!r)return;r.forEach((t=>t(i)))}get selectionStart(){return this._cursorChanging?this._changingCursorPos:this.el.selectionStart}get cursorPos(){return this._cursorChanging?this._changingCursorPos:this.el.selectionEnd}set cursorPos(t){if(!this.el||!this.el.isActive)return;this.el.select(t,t);this._saveSelection()}_saveSelection(){if(this.displayValue!==this.el.value){console.warn("Element value was changed outside of mask. Syncronize mask using `mask.updateValue()` to work properly.")}this._selection={start:this.selectionStart,end:this.cursorPos}}updateValue(){this.masked.value=this.el.value;this._value=this.masked.value;this._unmaskedValue=this.masked.unmaskedValue;this._rawInputValue=this.masked.rawInputValue}updateControl(t){const i=this.masked.unmaskedValue;const r=this.masked.value;const e=this.masked.rawInputValue;const s=this.displayValue;const n=this.unmaskedValue!==i||this.value!==r||this._rawInputValue!==e;this._unmaskedValue=i;this._value=r;this._rawInputValue=e;if(this.el.value!==s)this.el.value=s;if(t==="auto")this.alignCursor();else if(t!=null)this.cursorPos=t;if(n)this._fireChangeEvents();if(!this._historyChanging&&(n||this.history.isEmpty))this.history.push({unmaskedValue:i,selection:{start:this.selectionStart,end:this.cursorPos}})}updateOptions(t){const{mask:i,...r}=t;const e=!this.maskEquals(i);const s=this.masked.optionsIsChanged(r);if(e)this.mask=i;if(s)this.masked.updateOptions(r);if(e||s)this.updateControl()}updateCursor(t){if(t==null)return;this.cursorPos=t;this._delayUpdateCursor(t)}_delayUpdateCursor(t){this._abortUpdateCursor();this._changingCursorPos=t;this._cursorChanging=setTimeout((()=>{if(!this.el)return;this.cursorPos=this._changingCursorPos;this._abortUpdateCursor()}),10)}_fireChangeEvents(){this._fireEvent("accept",this._inputEvent);if(this.masked.isComplete)this._fireEvent("complete",this._inputEvent)}_abortUpdateCursor(){if(this._cursorChanging){clearTimeout(this._cursorChanging);delete this._cursorChanging}}alignCursor(){this.cursorPos=this.masked.nearestInputPos(this.masked.nearestInputPos(this.cursorPos,l.LEFT))}alignCursorFriendly(){if(this.selectionStart!==this.cursorPos)return;this.alignCursor()}on(t,i){if(!this._listeners[t])this._listeners[t]=[];this._listeners[t].push(i);return this}off(t,i){if(!this._listeners[t])return this;if(!i){delete this._listeners[t];return this}const r=this._listeners[t].indexOf(i);if(r>=0)this._listeners[t].splice(r,1);return this}_onInput(t){this._inputEvent=t;this._abortUpdateCursor();const i=new f({value:this.el.value,cursorPos:this.cursorPos,oldValue:this.displayValue,oldSelection:this._selection});const r=this.masked.rawInputValue;const e=this.masked.splice(i.startChangePos,i.removed.length,i.inserted,i.removeDirection,{input:true,raw:true}).offset;const s=r===this.masked.rawInputValue?i.removeDirection:l.NONE;let n=this.masked.nearestInputPos(i.startChangePos+e,s);if(s!==l.NONE)n=this.masked.nearestInputPos(n,l.NONE);this.updateControl(n);delete this._inputEvent}_onChange(){if(this.displayValue!==this.el.value)this.updateValue();this.masked.doCommit();this.updateControl();this._saveSelection()}_onDrop(t){t.preventDefault();t.stopPropagation()}_onFocus(t){this.alignCursorFriendly()}_onClick(t){this.alignCursorFriendly()}_onUndo(){this._applyHistoryState(this.history.undo())}_onRedo(){this._applyHistoryState(this.history.redo())}_applyHistoryState(t){if(!t)return;this._historyChanging=true;this.unmaskedValue=t.unmaskedValue;this.el.select(t.selection.start,t.selection.end);this._saveSelection();this._historyChanging=false}destroy(){this._unbindEvents();this._listeners.length=0;delete this.el}}g.InputMask=B;class E{static normalize(t){return Array.isArray(t)?t:[t,new E]}constructor(t){Object.assign(this,{inserted:"",rawInserted:"",tailShift:0,skip:false},t)}aggregate(t){this.inserted+=t.inserted;this.rawInserted+=t.rawInserted;this.tailShift+=t.tailShift;this.skip=this.skip||t.skip;return this}get offset(){return this.tailShift+this.inserted.length}get consumed(){return Boolean(this.rawInserted)||this.skip}equals(t){return this.inserted===t.inserted&&this.tailShift===t.tailShift&&this.rawInserted===t.rawInserted&&this.skip===t.skip}}g.ChangeDetails=E;class D{constructor(t,i,r){if(t===void 0){t=""}if(i===void 0){i=0}this.value=t;this.from=i;this.stop=r}toString(){return this.value}extend(t){this.value+=String(t)}appendTo(t){return t.append(this.toString(),{tail:true}).aggregate(t._appendPlaceholder())}get state(){return{value:this.value,from:this.from,stop:this.stop}}set state(t){Object.assign(this,t)}unshift(t){if(!this.value.length||t!=null&&this.from>=t)return"";const i=this.value[0];this.value=this.value.slice(1);return i}shift(){if(!this.value.length)return"";const t=this.value[this.value.length-1];this.value=this.value.slice(0,-1);return t}}class _{constructor(t){this._value="";this._update({..._.DEFAULTS,...t});this._initialized=true}updateOptions(t){if(!this.optionsIsChanged(t))return;this.withValueRefresh(this._update.bind(this,t))}_update(t){Object.assign(this,t)}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue}}set state(t){this._value=t._value}reset(){this._value=""}get value(){return this._value}set value(t){this.resolve(t,{input:true})}resolve(t,i){if(i===void 0){i={input:true}}this.reset();this.append(t,i,"");this.doCommit()}get unmaskedValue(){return this.value}set unmaskedValue(t){this.resolve(t,{})}get typedValue(){return this.parse?this.parse(this.value,this):this.unmaskedValue}set typedValue(t){if(this.format){this.value=this.format(t,this)}else{this.unmaskedValue=String(t)}}get rawInputValue(){return this.extractInput(0,this.displayValue.length,{raw:true})}set rawInputValue(t){this.resolve(t,{raw:true})}get displayValue(){return this.value}get isComplete(){return true}get isFilled(){return this.isComplete}nearestInputPos(t,i){return t}totalInputPositions(t,i){if(t===void 0){t=0}if(i===void 0){i=this.displayValue.length}return Math.min(this.displayValue.length,i-t)}extractInput(t,i,r){if(t===void 0){t=0}if(i===void 0){i=this.displayValue.length}return this.displayValue.slice(t,i)}extractTail(t,i){if(t===void 0){t=0}if(i===void 0){i=this.displayValue.length}return new D(this.extractInput(t,i),t)}appendTail(t){if(a(t))t=new D(String(t));return t.appendTo(this)}_appendCharRaw(t,i){if(!t)return new E;this._value+=t;return new E({inserted:t,rawInserted:t})}_appendChar(t,i,r){if(i===void 0){i={}}const e=this.state;let s;[t,s]=this.doPrepareChar(t,i);if(t){s=s.aggregate(this._appendCharRaw(t,i));if(!s.rawInserted&&this.autofix==="pad"){const r=this.state;this.state=e;let n=this.pad(i);const u=this._appendCharRaw(t,i);n=n.aggregate(u);if(u.rawInserted||n.equals(s)){s=n}else{this.state=r}}}if(s.inserted){let t;let n=this.doValidate(i)!==false;if(n&&r!=null){const i=this.state;if(this.overwrite===true){t=r.state;for(let t=0;t<s.rawInserted.length;++t){r.unshift(this.displayValue.length-s.tailShift)}}let e=this.appendTail(r);n=e.rawInserted.length===r.toString().length;if(!(n&&e.inserted)&&this.overwrite==="shift"){this.state=i;t=r.state;for(let t=0;t<s.rawInserted.length;++t){r.shift()}e=this.appendTail(r);n=e.rawInserted.length===r.toString().length}if(n&&e.inserted)this.state=i}if(!n){s=new E;this.state=e;if(r&&t)r.state=t}}return s}_appendPlaceholder(){return new E}_appendEager(){return new E}append(t,i,r){if(!a(t))throw new Error("value should be string");const e=a(r)?new D(String(r)):r;if(i!=null&&i.tail)i._beforeTailState=this.state;let s;[t,s]=this.doPrepare(t,i);for(let r=0;r<t.length;++r){const n=this._appendChar(t[r],i,e);if(!n.rawInserted&&!this.doSkipInvalid(t[r],i,e))break;s.aggregate(n)}if((this.eager===true||this.eager==="append")&&i!=null&&i.input&&t){s.aggregate(this._appendEager())}if(e!=null){s.tailShift+=this.appendTail(e).tailShift}return s}remove(t,i){if(t===void 0){t=0}if(i===void 0){i=this.displayValue.length}this._value=this.displayValue.slice(0,t)+this.displayValue.slice(i);return new E}withValueRefresh(t){if(this._refreshing||!this._initialized)return t();this._refreshing=true;const i=this.rawInputValue;const r=this.value;const e=t();this.rawInputValue=i;if(this.value&&this.value!==r&&r.indexOf(this.value)===0){this.append(r.slice(this.displayValue.length),{},"");this.doCommit()}delete this._refreshing;return e}runIsolated(t){if(this._isolated||!this._initialized)return t(this);this._isolated=true;const i=this.state;const r=t(this);this.state=i;delete this._isolated;return r}doSkipInvalid(t,i,r){return Boolean(this.skipInvalid)}doPrepare(t,i){if(i===void 0){i={}}return E.normalize(this.prepare?this.prepare(t,this,i):t)}doPrepareChar(t,i){if(i===void 0){i={}}return E.normalize(this.prepareChar?this.prepareChar(t,this,i):t)}doValidate(t){return(!this.validate||this.validate(this.value,this,t))&&(!this.parent||this.parent.doValidate(t))}doCommit(){if(this.commit)this.commit(this.value,this)}splice(t,i,r,e,s){if(r===void 0){r=""}if(e===void 0){e=l.NONE}if(s===void 0){s={input:true}}const n=t+i;const u=this.extractTail(n);const a=this.eager===true||this.eager==="remove";let o;if(a){e=p(e);o=this.extractInput(0,n,{raw:true})}let h=t;const c=new E;if(e!==l.NONE){h=this.nearestInputPos(t,i>1&&t!==0&&!a?l.NONE:e);c.tailShift=h-t}c.aggregate(this.remove(h));if(a&&e!==l.NONE&&o===this.rawInputValue){if(e===l.FORCE_LEFT){let t;while(o===this.rawInputValue&&(t=this.displayValue.length)){c.aggregate(new E({tailShift:-1})).aggregate(this.remove(t-1))}}else if(e===l.FORCE_RIGHT){u.unshift()}}return c.aggregate(this.append(r,s,u))}maskEquals(t){return this.mask===t}optionsIsChanged(t){return!d(this,t)}typedValueEquals(t){const i=this.typedValue;return t===i||_.EMPTY_VALUES.includes(t)&&_.EMPTY_VALUES.includes(i)||(this.format?this.format(t,this)===this.format(this.typedValue,this):false)}pad(t){return new E}}_.DEFAULTS={skipInvalid:true};_.EMPTY_VALUES=[undefined,null,""];g.Masked=_;class z{constructor(t,i){if(t===void 0){t=[]}if(i===void 0){i=0}this.chunks=t;this.from=i}toString(){return this.chunks.map(String).join("")}extend(t){if(!String(t))return;t=a(t)?new D(String(t)):t;const i=this.chunks[this.chunks.length-1];const r=i&&(i.stop===t.stop||t.stop==null)&&t.from===i.from+i.toString().length;if(t instanceof D){if(r){i.extend(t.toString())}else{this.chunks.push(t)}}else if(t instanceof z){if(t.stop==null){let i;while(t.chunks.length&&t.chunks[0].stop==null){i=t.chunks.shift();i.from+=t.from;this.extend(i)}}if(t.toString()){t.stop=t.blockIndex;this.chunks.push(t)}}}appendTo(t){if(!(t instanceof g.MaskedPattern)){const i=new D(this.toString());return i.appendTo(t)}const i=new E;for(let r=0;r<this.chunks.length;++r){const e=this.chunks[r];const s=t._mapPosToBlock(t.displayValue.length);const n=e.stop;let u;if(n!=null&&(!s||s.index<=n)){if(e instanceof z||t._stops.indexOf(n)>=0){i.aggregate(t._appendPlaceholder(n))}u=e instanceof z&&t._blocks[n]}if(u){const r=u.appendTail(e);i.aggregate(r);const s=e.toString().slice(r.rawInserted.length);if(s)i.aggregate(t.append(s,{tail:true}))}else{i.aggregate(t.append(e.toString(),{tail:true}))}}return i}get state(){return{chunks:this.chunks.map((t=>t.state)),from:this.from,stop:this.stop,blockIndex:this.blockIndex}}set state(t){const{chunks:i,...r}=t;Object.assign(this,r);this.chunks=i.map((t=>{const i="chunks"in t?new z:new D;i.state=t;return i}))}unshift(t){if(!this.chunks.length||t!=null&&this.from>=t)return"";const i=t!=null?t-this.from:t;let r=0;while(r<this.chunks.length){const t=this.chunks[r];const e=t.unshift(i);if(t.toString()){if(!e)break;++r}else{this.chunks.splice(r,1)}if(e)return e}return""}shift(){if(!this.chunks.length)return"";let t=this.chunks.length-1;while(0<=t){const i=this.chunks[t];const r=i.shift();if(i.toString()){if(!r)break;--t}else{this.chunks.splice(t,1)}if(r)return r}return""}}class I{constructor(t,i){this.masked=t;this._log=[];const{offset:r,index:e}=t._mapPosToBlock(i)||(i<0?{index:0,offset:0}:{index:this.masked._blocks.length,offset:0});this.offset=r;this.index=e;this.ok=false}get block(){return this.masked._blocks[this.index]}get pos(){return this.masked._blockStartPos(this.index)+this.offset}get state(){return{index:this.index,offset:this.offset,ok:this.ok}}set state(t){Object.assign(this,t)}pushState(){this._log.push(this.state)}popState(){const t=this._log.pop();if(t)this.state=t;return t}bindBlock(){if(this.block)return;if(this.index<0){this.index=0;this.offset=0}if(this.index>=this.masked._blocks.length){this.index=this.masked._blocks.length-1;this.offset=this.block.displayValue.length}}_pushLeft(t){this.pushState();for(this.bindBlock();0<=this.index;--this.index,this.offset=((i=this.block)==null?void 0:i.displayValue.length)||0){var i;if(t())return this.ok=true}return this.ok=false}_pushRight(t){this.pushState();for(this.bindBlock();this.index<this.masked._blocks.length;++this.index,this.offset=0){if(t())return this.ok=true}return this.ok=false}pushLeftBeforeFilled(){return this._pushLeft((()=>{if(this.block.isFixed||!this.block.value)return;this.offset=this.block.nearestInputPos(this.offset,l.FORCE_LEFT);if(this.offset!==0)return true}))}pushLeftBeforeInput(){return this._pushLeft((()=>{if(this.block.isFixed)return;this.offset=this.block.nearestInputPos(this.offset,l.LEFT);return true}))}pushLeftBeforeRequired(){return this._pushLeft((()=>{if(this.block.isFixed||this.block.isOptional&&!this.block.value)return;this.offset=this.block.nearestInputPos(this.offset,l.LEFT);return true}))}pushRightBeforeFilled(){return this._pushRight((()=>{if(this.block.isFixed||!this.block.value)return;this.offset=this.block.nearestInputPos(this.offset,l.FORCE_RIGHT);if(this.offset!==this.block.value.length)return true}))}pushRightBeforeInput(){return this._pushRight((()=>{if(this.block.isFixed)return;this.offset=this.block.nearestInputPos(this.offset,l.NONE);return true}))}pushRightBeforeRequired(){return this._pushRight((()=>{if(this.block.isFixed||this.block.isOptional&&!this.block.value)return;this.offset=this.block.nearestInputPos(this.offset,l.NONE);return true}))}}class S{constructor(t){Object.assign(this,t);this._value="";this.isFixed=true}get value(){return this._value}get unmaskedValue(){return this.isUnmasking?this.value:""}get rawInputValue(){return this._isRawInput?this.value:""}get displayValue(){return this.value}reset(){this._isRawInput=false;this._value=""}remove(t,i){if(t===void 0){t=0}if(i===void 0){i=this._value.length}this._value=this._value.slice(0,t)+this._value.slice(i);if(!this._value)this._isRawInput=false;return new E}nearestInputPos(t,i){if(i===void 0){i=l.NONE}const r=0;const e=this._value.length;switch(i){case l.LEFT:case l.FORCE_LEFT:return r;case l.NONE:case l.RIGHT:case l.FORCE_RIGHT:default:return e}}totalInputPositions(t,i){if(t===void 0){t=0}if(i===void 0){i=this._value.length}return this._isRawInput?i-t:0}extractInput(t,i,r){if(t===void 0){t=0}if(i===void 0){i=this._value.length}if(r===void 0){r={}}return r.raw&&this._isRawInput&&this._value.slice(t,i)||""}get isComplete(){return true}get isFilled(){return Boolean(this._value)}_appendChar(t,i){if(i===void 0){i={}}if(this.isFilled)return new E;const r=this.eager===true||this.eager==="append";const e=this.char===t;const s=e&&(this.isUnmasking||i.input||i.raw)&&(!i.raw||!r)&&!i.tail;const n=new E({inserted:this.char,rawInserted:s?this.char:""});this._value=this.char;this._isRawInput=s&&(i.raw||i.input);return n}_appendEager(){return this._appendChar(this.char,{tail:true})}_appendPlaceholder(){const t=new E;if(this.isFilled)return t;this._value=t.inserted=this.char;return t}extractTail(){return new D("")}appendTail(t){if(a(t))t=new D(String(t));return t.appendTo(this)}append(t,i,r){const e=this._appendChar(t[0],i);if(r!=null){e.tailShift+=this.appendTail(r).tailShift}return e}doCommit(){}get state(){return{_value:this._value,_rawInputValue:this.rawInputValue}}set state(t){this._value=t._value;this._isRawInput=Boolean(t._rawInputValue)}pad(t){return this._appendPlaceholder()}}class V{constructor(t){const{parent:i,isOptional:r,placeholderChar:e,displayChar:s,lazy:n,eager:u,...a}=t;this.masked=x(a);Object.assign(this,{parent:i,isOptional:r,placeholderChar:e,displayChar:s,lazy:n,eager:u})}reset(){this.isFilled=false;this.masked.reset()}remove(t,i){if(t===void 0){t=0}if(i===void 0){i=this.value.length}if(t===0&&i>=1){this.isFilled=false;return this.masked.remove(t,i)}return new E}get value(){return this.masked.value||(this.isFilled&&!this.isOptional?this.placeholderChar:"")}get unmaskedValue(){return this.masked.unmaskedValue}get rawInputValue(){return this.masked.rawInputValue}get displayValue(){return this.masked.value&&this.displayChar||this.value}get isComplete(){return Boolean(this.masked.value)||this.isOptional}_appendChar(t,i){if(i===void 0){i={}}if(this.isFilled)return new E;const r=this.masked.state;let e=this.masked._appendChar(t,this.currentMaskFlags(i));if(e.inserted&&this.doValidate(i)===false){e=new E;this.masked.state=r}if(!e.inserted&&!this.isOptional&&!this.lazy&&!i.input){e.inserted=this.placeholderChar}e.skip=!e.inserted&&!this.isOptional;this.isFilled=Boolean(e.inserted);return e}append(t,i,r){return this.masked.append(t,this.currentMaskFlags(i),r)}_appendPlaceholder(){if(this.isFilled||this.isOptional)return new E;this.isFilled=true;return new E({inserted:this.placeholderChar})}_appendEager(){return new E}extractTail(t,i){return this.masked.extractTail(t,i)}appendTail(t){return this.masked.appendTail(t)}extractInput(t,i,r){if(t===void 0){t=0}if(i===void 0){i=this.value.length}return this.masked.extractInput(t,i,r)}nearestInputPos(t,i){if(i===void 0){i=l.NONE}const r=0;const e=this.value.length;const s=Math.min(Math.max(t,r),e);switch(i){case l.LEFT:case l.FORCE_LEFT:return this.isComplete?s:r;case l.RIGHT:case l.FORCE_RIGHT:return this.isComplete?s:e;case l.NONE:default:return s}}totalInputPositions(t,i){if(t===void 0){t=0}if(i===void 0){i=this.value.length}return this.value.slice(t,i).length}doValidate(t){return this.masked.doValidate(this.currentMaskFlags(t))&&(!this.parent||this.parent.doValidate(this.currentMaskFlags(t)))}doCommit(){this.masked.doCommit()}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue,masked:this.masked.state,isFilled:this.isFilled}}set state(t){this.masked.state=t.masked;this.isFilled=t.isFilled}currentMaskFlags(t){var i;return{...t,_beforeTailState:(t==null||(i=t._beforeTailState)==null?void 0:i.masked)||(t==null?void 0:t._beforeTailState)}}pad(t){return new E}}V.DEFAULT_DEFINITIONS={0:/\d/,a:/[\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,"*":/./};class M extends _{updateOptions(t){super.updateOptions(t)}_update(t){const i=t.mask;if(i)t.validate=t=>t.search(i)>=0;super._update(t)}}g.MaskedRegExp=M;class L extends _{constructor(t){super({...L.DEFAULTS,...t,definitions:Object.assign({},V.DEFAULT_DEFINITIONS,t==null?void 0:t.definitions)})}updateOptions(t){super.updateOptions(t)}_update(t){t.definitions=Object.assign({},this.definitions,t.definitions);super._update(t);this._rebuildMask()}_rebuildMask(){const t=this.definitions;this._blocks=[];this.exposeBlock=undefined;this._stops=[];this._maskedBlocks={};const i=this.mask;if(!i||!t)return;let r=false;let e=false;for(let s=0;s<i.length;++s){if(this.blocks){const t=i.slice(s);const r=Object.keys(this.blocks).filter((i=>t.indexOf(i)===0));r.sort(((t,i)=>i.length-t.length));const e=r[0];if(e){const{expose:t,repeat:i,...r}=m(this.blocks[e]);const n={lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,overwrite:this.overwrite,autofix:this.autofix,...r,repeat:i,parent:this};const u=i!=null?new g.RepeatBlock(n):x(n);if(u){this._blocks.push(u);if(t)this.exposeBlock=u;if(!this._maskedBlocks[e])this._maskedBlocks[e]=[];this._maskedBlocks[e].push(this._blocks.length-1)}s+=e.length-1;continue}}let n=i[s];let u=n in t;if(n===L.STOP_CHAR){this._stops.push(this._blocks.length);continue}if(n==="{"||n==="}"){r=!r;continue}if(n==="["||n==="]"){e=!e;continue}if(n===L.ESCAPE_CHAR){++s;n=i[s];if(!n)break;u=false}const a=u?new V({isOptional:e,lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,...m(t[n]),parent:this}):new S({char:n,eager:this.eager,isUnmasking:r});this._blocks.push(a)}}get state(){return{...super.state,_blocks:this._blocks.map((t=>t.state))}}set state(t){if(!t){this.reset();return}const{_blocks:i,...r}=t;this._blocks.forEach(((t,r)=>t.state=i[r]));super.state=r}reset(){super.reset();this._blocks.forEach((t=>t.reset()))}get isComplete(){return this.exposeBlock?this.exposeBlock.isComplete:this._blocks.every((t=>t.isComplete))}get isFilled(){return this._blocks.every((t=>t.isFilled))}get isFixed(){return this._blocks.every((t=>t.isFixed))}get isOptional(){return this._blocks.every((t=>t.isOptional))}doCommit(){this._blocks.forEach((t=>t.doCommit()));super.doCommit()}get unmaskedValue(){return this.exposeBlock?this.exposeBlock.unmaskedValue:this._blocks.reduce(((t,i)=>t+=i.unmaskedValue),"")}set unmaskedValue(t){if(this.exposeBlock){const i=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.unmaskedValue=t;this.appendTail(i);this.doCommit()}else super.unmaskedValue=t}get value(){return this.exposeBlock?this.exposeBlock.value:this._blocks.reduce(((t,i)=>t+=i.value),"")}set value(t){if(this.exposeBlock){const i=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.value=t;this.appendTail(i);this.doCommit()}else super.value=t}get typedValue(){return this.exposeBlock?this.exposeBlock.typedValue:super.typedValue}set typedValue(t){if(this.exposeBlock){const i=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.typedValue=t;this.appendTail(i);this.doCommit()}else super.typedValue=t}get displayValue(){return this._blocks.reduce(((t,i)=>t+=i.displayValue),"")}appendTail(t){return super.appendTail(t).aggregate(this._appendPlaceholder())}_appendEager(){var t;const i=new E;let r=(t=this._mapPosToBlock(this.displayValue.length))==null?void 0:t.index;if(r==null)return i;if(this._blocks[r].isFilled)++r;for(let t=r;t<this._blocks.length;++t){const r=this._blocks[t]._appendEager();if(!r.inserted)break;i.aggregate(r)}return i}_appendCharRaw(t,i){if(i===void 0){i={}}const r=this._mapPosToBlock(this.displayValue.length);const e=new E;if(!r)return e;for(let n=r.index,u;u=this._blocks[n];++n){var s;const r=u._appendChar(t,{...i,_beforeTailState:(s=i._beforeTailState)==null||(s=s._blocks)==null?void 0:s[n]});e.aggregate(r);if(r.consumed)break}return e}extractTail(t,i){if(t===void 0){t=0}if(i===void 0){i=this.displayValue.length}const r=new z;if(t===i)return r;this._forEachBlocksInRange(t,i,((t,i,e,s)=>{const n=t.extractTail(e,s);n.stop=this._findStopBefore(i);n.from=this._blockStartPos(i);if(n instanceof z)n.blockIndex=i;r.extend(n)}));return r}extractInput(t,i,r){if(t===void 0){t=0}if(i===void 0){i=this.displayValue.length}if(r===void 0){r={}}if(t===i)return"";let e="";this._forEachBlocksInRange(t,i,((t,i,s,n)=>{e+=t.extractInput(s,n,r)}));return e}_findStopBefore(t){let i;for(let r=0;r<this._stops.length;++r){const e=this._stops[r];if(e<=t)i=e;else break}return i}_appendPlaceholder(t){const i=new E;if(this.lazy&&t==null)return i;const r=this._mapPosToBlock(this.displayValue.length);if(!r)return i;const e=r.index;const s=t!=null?t:this._blocks.length;this._blocks.slice(e,s).forEach((r=>{if(!r.lazy||t!=null){var e;i.aggregate(r._appendPlaceholder((e=r._blocks)==null?void 0:e.length))}}));return i}_mapPosToBlock(t){let i="";for(let r=0;r<this._blocks.length;++r){const e=this._blocks[r];const s=i.length;i+=e.displayValue;if(t<=i.length){return{index:r,offset:t-s}}}}_blockStartPos(t){return this._blocks.slice(0,t).reduce(((t,i)=>t+=i.displayValue.length),0)}_forEachBlocksInRange(t,i,r){if(i===void 0){i=this.displayValue.length}const e=this._mapPosToBlock(t);if(e){const t=this._mapPosToBlock(i);const s=t&&e.index===t.index;const n=e.offset;const u=t&&s?t.offset:this._blocks[e.index].displayValue.length;r(this._blocks[e.index],e.index,n,u);if(t&&!s){for(let i=e.index+1;i<t.index;++i){r(this._blocks[i],i,0,this._blocks[i].displayValue.length)}r(this._blocks[t.index],t.index,0,t.offset)}}}remove(t,i){if(t===void 0){t=0}if(i===void 0){i=this.displayValue.length}const r=super.remove(t,i);this._forEachBlocksInRange(t,i,((t,i,e,s)=>{r.aggregate(t.remove(e,s))}));return r}nearestInputPos(t,i){if(i===void 0){i=l.NONE}if(!this._blocks.length)return 0;const r=new I(this,t);if(i===l.NONE){if(r.pushRightBeforeInput())return r.pos;r.popState();if(r.pushLeftBeforeInput())return r.pos;return this.displayValue.length}if(i===l.LEFT||i===l.FORCE_LEFT){if(i===l.LEFT){r.pushRightBeforeFilled();if(r.ok&&r.pos===t)return t;r.popState()}r.pushLeftBeforeInput();r.pushLeftBeforeRequired();r.pushLeftBeforeFilled();if(i===l.LEFT){r.pushRightBeforeInput();r.pushRightBeforeRequired();if(r.ok&&r.pos<=t)return r.pos;r.popState();if(r.ok&&r.pos<=t)return r.pos;r.popState()}if(r.ok)return r.pos;if(i===l.FORCE_LEFT)return 0;r.popState();if(r.ok)return r.pos;r.popState();if(r.ok)return r.pos;return 0}if(i===l.RIGHT||i===l.FORCE_RIGHT){r.pushRightBeforeInput();r.pushRightBeforeRequired();if(r.pushRightBeforeFilled())return r.pos;if(i===l.FORCE_RIGHT)return this.displayValue.length;r.popState();if(r.ok)return r.pos;r.popState();if(r.ok)return r.pos;return this.nearestInputPos(t,l.LEFT)}return t}totalInputPositions(t,i){if(t===void 0){t=0}if(i===void 0){i=this.displayValue.length}let r=0;this._forEachBlocksInRange(t,i,((t,i,e,s)=>{r+=t.totalInputPositions(e,s)}));return r}maskedBlock(t){return this.maskedBlocks(t)[0]}maskedBlocks(t){const i=this._maskedBlocks[t];if(!i)return[];return i.map((t=>this._blocks[t]))}pad(t){const i=new E;this._forEachBlocksInRange(0,this.displayValue.length,(r=>i.aggregate(r.pad(t))));return i}}L.DEFAULTS={..._.DEFAULTS,lazy:true,placeholderChar:"_"};L.STOP_CHAR="`";L.ESCAPE_CHAR="\\";L.InputDefinition=V;L.FixedDefinition=S;g.MaskedPattern=L;class O extends L{get _matchFrom(){return this.maxLength-String(this.from).length}constructor(t){super(t)}updateOptions(t){super.updateOptions(t)}_update(t){const{to:i=this.to||0,from:r=this.from||0,maxLength:e=this.maxLength||0,autofix:s=this.autofix,...n}=t;this.to=i;this.from=r;this.maxLength=Math.max(String(i).length,e);this.autofix=s;const u=String(this.from).padStart(this.maxLength,"0");const a=String(this.to).padStart(this.maxLength,"0");let o=0;while(o<a.length&&a[o]===u[o])++o;n.mask=a.slice(0,o).replace(/0/g,"\\0")+"0".repeat(this.maxLength-o);super._update(n)}get isComplete(){return super.isComplete&&Boolean(this.value)}boundaries(t){let i="";let r="";const[,e,s]=t.match(/^(\D*)(\d*)(\D*)/)||[];if(s){i="0".repeat(e.length)+s;r="9".repeat(e.length)+s}i=i.padEnd(this.maxLength,"0");r=r.padEnd(this.maxLength,"9");return[i,r]}doPrepareChar(t,i){if(i===void 0){i={}}let r;[t,r]=super.doPrepareChar(t.replace(/\D/g,""),i);if(!t)r.skip=!this.isComplete;return[t,r]}_appendCharRaw(t,i){if(i===void 0){i={}}if(!this.autofix||this.value.length+1>this.maxLength)return super._appendCharRaw(t,i);const r=String(this.from).padStart(this.maxLength,"0");const e=String(this.to).padStart(this.maxLength,"0");const[s,n]=this.boundaries(this.value+t);if(Number(n)<this.from)return super._appendCharRaw(r[this.value.length],i);if(Number(s)>this.to){if(!i.tail&&this.autofix==="pad"&&this.value.length+1<this.maxLength){return super._appendCharRaw(r[this.value.length],i).aggregate(this._appendCharRaw(t,i))}return super._appendCharRaw(e[this.value.length],i)}return super._appendCharRaw(t,i)}doValidate(t){const i=this.value;const r=i.search(/[^0]/);if(r===-1&&i.length<=this._matchFrom)return true;const[e,s]=this.boundaries(i);return this.from<=Number(s)&&Number(e)<=this.to&&super.doValidate(t)}pad(t){const i=new E;if(this.value.length===this.maxLength)return i;const r=this.value;const e=this.maxLength-this.value.length;if(e){this.reset();for(let r=0;r<e;++r){i.aggregate(super._appendCharRaw("0",t))}r.split("").forEach((t=>this._appendCharRaw(t)))}return i}}g.MaskedRange=O;const R="d{.}`m{.}`Y";class T extends L{static extractPatternOptions(t){const{mask:i,pattern:r,...e}=t;return{...e,mask:a(i)?i:r}}constructor(t){super(T.extractPatternOptions({...T.DEFAULTS,...t}))}updateOptions(t){super.updateOptions(t)}_update(t){const{mask:i,pattern:r,blocks:e,...s}={...T.DEFAULTS,...t};const n=Object.assign({},T.GET_DEFAULT_BLOCKS());if(t.min)n.Y.from=t.min.getFullYear();if(t.max)n.Y.to=t.max.getFullYear();if(t.min&&t.max&&n.Y.from===n.Y.to){n.m.from=t.min.getMonth()+1;n.m.to=t.max.getMonth()+1;if(n.m.from===n.m.to){n.d.from=t.min.getDate();n.d.to=t.max.getDate()}}Object.assign(n,this.blocks,e);super._update({...s,mask:a(i)?i:r,blocks:n})}doValidate(t){const i=this.date;return super.doValidate(t)&&(!this.isComplete||this.isDateExist(this.value)&&i!=null&&(this.min==null||this.min<=i)&&(this.max==null||i<=this.max))}isDateExist(t){return this.format(this.parse(t,this),this).indexOf(t)>=0}get date(){return this.typedValue}set date(t){this.typedValue=t}get typedValue(){return this.isComplete?super.typedValue:null}set typedValue(t){super.typedValue=t}maskEquals(t){return t===Date||super.maskEquals(t)}optionsIsChanged(t){return super.optionsIsChanged(T.extractPatternOptions(t))}}T.GET_DEFAULT_BLOCKS=()=>({d:{mask:O,from:1,to:31,maxLength:2},m:{mask:O,from:1,to:12,maxLength:2},Y:{mask:O,from:1900,to:9999}});T.DEFAULTS={...L.DEFAULTS,mask:Date,pattern:R,format:(t,i)=>{if(!t)return"";const r=String(t.getDate()).padStart(2,"0");const e=String(t.getMonth()+1).padStart(2,"0");const s=t.getFullYear();return[r,e,s].join(".")},parse:(t,i)=>{const[r,e,s]=t.split(".").map(Number);return new Date(s,e-1,r)}};g.MaskedDate=T;class P extends _{constructor(t){super({...P.DEFAULTS,...t});this.currentMask=undefined}updateOptions(t){super.updateOptions(t)}_update(t){super._update(t);if("mask"in t){this.exposeMask=undefined;this.compiledMasks=Array.isArray(t.mask)?t.mask.map((t=>{const{expose:i,...r}=m(t);const e=x({overwrite:this._overwrite,eager:this._eager,skipInvalid:this._skipInvalid,...r});if(i)this.exposeMask=e;return e})):[]}}_appendCharRaw(t,i){if(i===void 0){i={}}const r=this._applyDispatch(t,i);if(this.currentMask){r.aggregate(this.currentMask._appendChar(t,this.currentMaskFlags(i)))}return r}_applyDispatch(t,i,r){if(t===void 0){t=""}if(i===void 0){i={}}if(r===void 0){r=""}const e=i.tail&&i._beforeTailState!=null?i._beforeTailState._value:this.value;const s=this.rawInputValue;const n=i.tail&&i._beforeTailState!=null?i._beforeTailState._rawInputValue:s;const u=s.slice(n.length);const a=this.currentMask;const o=new E;const h=a==null?void 0:a.state;this.currentMask=this.doDispatch(t,{...i},r);if(this.currentMask){if(this.currentMask!==a){this.currentMask.reset();if(n){this.currentMask.append(n,{raw:true});o.tailShift=this.currentMask.value.length-e.length}if(u){o.tailShift+=this.currentMask.append(u,{raw:true,tail:true}).tailShift}}else if(h){this.currentMask.state=h}}return o}_appendPlaceholder(){const t=this._applyDispatch();if(this.currentMask){t.aggregate(this.currentMask._appendPlaceholder())}return t}_appendEager(){const t=this._applyDispatch();if(this.currentMask){t.aggregate(this.currentMask._appendEager())}return t}appendTail(t){const i=new E;if(t)i.aggregate(this._applyDispatch("",{},t));return i.aggregate(this.currentMask?this.currentMask.appendTail(t):super.appendTail(t))}currentMaskFlags(t){var i,r;return{...t,_beforeTailState:((i=t._beforeTailState)==null?void 0:i.currentMaskRef)===this.currentMask&&((r=t._beforeTailState)==null?void 0:r.currentMask)||t._beforeTailState}}doDispatch(t,i,r){if(i===void 0){i={}}if(r===void 0){r=""}return this.dispatch(t,this,i,r)}doValidate(t){return super.doValidate(t)&&(!this.currentMask||this.currentMask.doValidate(this.currentMaskFlags(t)))}doPrepare(t,i){if(i===void 0){i={}}let[r,e]=super.doPrepare(t,i);if(this.currentMask){let t;[r,t]=super.doPrepare(r,this.currentMaskFlags(i));e=e.aggregate(t)}return[r,e]}doPrepareChar(t,i){if(i===void 0){i={}}let[r,e]=super.doPrepareChar(t,i);if(this.currentMask){let t;[r,t]=super.doPrepareChar(r,this.currentMaskFlags(i));e=e.aggregate(t)}return[r,e]}reset(){var t;(t=this.currentMask)==null||t.reset();this.compiledMasks.forEach((t=>t.reset()))}get value(){return this.exposeMask?this.exposeMask.value:this.currentMask?this.currentMask.value:""}set value(t){if(this.exposeMask){this.exposeMask.value=t;this.currentMask=this.exposeMask;this._applyDispatch()}else super.value=t}get unmaskedValue(){return this.exposeMask?this.exposeMask.unmaskedValue:this.currentMask?this.currentMask.unmaskedValue:""}set unmaskedValue(t){if(this.exposeMask){this.exposeMask.unmaskedValue=t;this.currentMask=this.exposeMask;this._applyDispatch()}else super.unmaskedValue=t}get typedValue(){return this.exposeMask?this.exposeMask.typedValue:this.currentMask?this.currentMask.typedValue:""}set typedValue(t){if(this.exposeMask){this.exposeMask.typedValue=t;this.currentMask=this.exposeMask;this._applyDispatch();return}let i=String(t);if(this.currentMask){this.currentMask.typedValue=t;i=this.currentMask.unmaskedValue}this.unmaskedValue=i}get displayValue(){return this.currentMask?this.currentMask.displayValue:""}get isComplete(){var t;return Boolean((t=this.currentMask)==null?void 0:t.isComplete)}get isFilled(){var t;return Boolean((t=this.currentMask)==null?void 0:t.isFilled)}remove(t,i){const r=new E;if(this.currentMask){r.aggregate(this.currentMask.remove(t,i)).aggregate(this._applyDispatch())}return r}get state(){var t;return{...super.state,_rawInputValue:this.rawInputValue,compiledMasks:this.compiledMasks.map((t=>t.state)),currentMaskRef:this.currentMask,currentMask:(t=this.currentMask)==null?void 0:t.state}}set state(t){const{compiledMasks:i,currentMaskRef:r,currentMask:e,...s}=t;if(i)this.compiledMasks.forEach(((t,r)=>t.state=i[r]));if(r!=null){this.currentMask=r;this.currentMask.state=e}super.state=s}extractInput(t,i,r){return this.currentMask?this.currentMask.extractInput(t,i,r):""}extractTail(t,i){return this.currentMask?this.currentMask.extractTail(t,i):super.extractTail(t,i)}doCommit(){if(this.currentMask)this.currentMask.doCommit();super.doCommit()}nearestInputPos(t,i){return this.currentMask?this.currentMask.nearestInputPos(t,i):super.nearestInputPos(t,i)}get overwrite(){return this.currentMask?this.currentMask.overwrite:this._overwrite}set overwrite(t){this._overwrite=t}get eager(){return this.currentMask?this.currentMask.eager:this._eager}set eager(t){this._eager=t}get skipInvalid(){return this.currentMask?this.currentMask.skipInvalid:this._skipInvalid}set skipInvalid(t){this._skipInvalid=t}get autofix(){return this.currentMask?this.currentMask.autofix:this._autofix}set autofix(t){this._autofix=t}maskEquals(t){return Array.isArray(t)?this.compiledMasks.every(((i,r)=>{if(!t[r])return;const{mask:e,...s}=t[r];return d(i,s)&&i.maskEquals(e)})):super.maskEquals(t)}typedValueEquals(t){var i;return Boolean((i=this.currentMask)==null?void 0:i.typedValueEquals(t))}}P.DEFAULTS={..._.DEFAULTS,dispatch:(t,i,r,e)=>{if(!i.compiledMasks.length)return;const s=i.rawInputValue;const n=i.compiledMasks.map(((n,u)=>{const a=i.currentMask===n;const o=a?n.displayValue.length:n.nearestInputPos(n.displayValue.length,l.FORCE_LEFT);if(n.rawInputValue!==s){n.reset();n.append(s,{raw:true})}else if(!a){n.remove(o)}n.append(t,i.currentMaskFlags(r));n.appendTail(e);return{index:u,weight:n.rawInputValue.length,totalInputPositions:n.totalInputPositions(0,Math.max(o,n.nearestInputPos(n.displayValue.length,l.FORCE_LEFT)))}}));n.sort(((t,i)=>i.weight-t.weight||i.totalInputPositions-t.totalInputPositions));return i.compiledMasks[n[0].index]}};g.MaskedDynamic=P;class j extends L{constructor(t){super({...j.DEFAULTS,...t})}updateOptions(t){super.updateOptions(t)}_update(t){const{enum:i,...r}=t;if(i){const t=i.map((t=>t.length));const e=Math.min(...t);const s=Math.max(...t)-e;r.mask="*".repeat(e);if(s)r.mask+="["+"*".repeat(s)+"]";this.enum=i}super._update(r)}_appendCharRaw(t,i){if(i===void 0){i={}}const r=Math.min(this.nearestInputPos(0,l.FORCE_RIGHT),this.value.length);const e=this.enum.filter((i=>this.matchValue(i,this.unmaskedValue+t,r)));if(e.length){if(e.length===1){this._forEachBlocksInRange(0,this.value.length,((t,r)=>{const s=e[0][r];if(r>=this.value.length||s===t.value)return;t.reset();t._appendChar(s,i)}))}const t=super._appendCharRaw(e[0][this.value.length],i);if(e.length===1){e[0].slice(this.unmaskedValue.length).split("").forEach((i=>t.aggregate(super._appendCharRaw(i))))}return t}return new E({skip:!this.isComplete})}extractTail(t,i){if(t===void 0){t=0}return new D("",t)}remove(t,i){if(t===void 0){t=0}if(i===void 0){i=this.displayValue.length}if(t===i)return new E;const r=Math.min(super.nearestInputPos(0,l.FORCE_RIGHT),this.value.length);let e;for(e=t;e>=0;--e){const t=this.enum.filter((t=>this.matchValue(t,this.value.slice(r,e),r)));if(t.length>1)break}const s=super.remove(e,i);s.tailShift+=e-t;return s}get isComplete(){return this.enum.indexOf(this.value)>=0}}j.DEFAULTS={...L.DEFAULTS,matchValue:(t,i,r)=>t.indexOf(i,r)===r};g.MaskedEnum=j;class N extends _{updateOptions(t){super.updateOptions(t)}_update(t){super._update({...t,validate:t.mask})}}g.MaskedFunction=N;var $;class q extends _{constructor(t){super({...q.DEFAULTS,...t})}updateOptions(t){super.updateOptions(t)}_update(t){super._update(t);this._updateRegExps()}_updateRegExps(){const t="^"+(this.allowNegative?"[+|\\-]?":"");const i="\\d*";const r=(this.scale?"("+c(this.radix)+"\\d{0,"+this.scale+"})?":"")+"$";this._numberRegExp=new RegExp(t+i+r);this._mapToRadixRegExp=new RegExp("["+this.mapToRadix.map(c).join("")+"]","g");this._thousandsSeparatorRegExp=new RegExp(c(this.thousandsSeparator),"g")}_removeThousandsSeparators(t){return t.replace(this._thousandsSeparatorRegExp,"")}_insertThousandsSeparators(t){const i=t.split(this.radix);i[0]=i[0].replace(/\B(?=(\d{3})+(?!\d))/g,this.thousandsSeparator);return i.join(this.radix)}doPrepareChar(t,i){if(i===void 0){i={}}const[r,e]=super.doPrepareChar(this._removeThousandsSeparators(this.scale&&this.mapToRadix.length&&(i.input&&i.raw||!i.input&&!i.raw)?t.replace(this._mapToRadixRegExp,this.radix):t),i);if(t&&!r)e.skip=true;if(r&&!this.allowPositive&&!this.value&&r!=="-")e.aggregate(this._appendChar("-"));return[r,e]}_separatorsCount(t,i){if(i===void 0){i=false}let r=0;for(let e=0;e<t;++e){if(this._value.indexOf(this.thousandsSeparator,e)===e){++r;if(i)t+=this.thousandsSeparator.length}}return r}_separatorsCountFromSlice(t){if(t===void 0){t=this._value}return this._separatorsCount(this._removeThousandsSeparators(t).length,true)}extractInput(t,i,r){if(t===void 0){t=0}if(i===void 0){i=this.displayValue.length}[t,i]=this._adjustRangeWithSeparators(t,i);return this._removeThousandsSeparators(super.extractInput(t,i,r))}_appendCharRaw(t,i){if(i===void 0){i={}}const r=i.tail&&i._beforeTailState?i._beforeTailState._value:this._value;const e=this._separatorsCountFromSlice(r);this._value=this._removeThousandsSeparators(this.value);const s=this._value;this._value+=t;const n=this.number;let u=!isNaN(n);let a=false;if(u){let t;if(this.min!=null&&this.min<0&&this.number<this.min)t=this.min;if(this.max!=null&&this.max>0&&this.number>this.max)t=this.max;if(t!=null){if(this.autofix){this._value=this.format(t,this).replace(q.UNMASKED_RADIX,this.radix);a||(a=s===this._value&&!i.tail)}else{u=false}}u&&(u=Boolean(this._value.match(this._numberRegExp)))}let o;if(!u){this._value=s;o=new E}else{o=new E({inserted:this._value.slice(s.length),rawInserted:a?"":t,skip:a})}this._value=this._insertThousandsSeparators(this._value);const h=i.tail&&i._beforeTailState?i._beforeTailState._value:this._value;const l=this._separatorsCountFromSlice(h);o.tailShift+=(l-e)*this.thousandsSeparator.length;return o}_findSeparatorAround(t){if(this.thousandsSeparator){const i=t-this.thousandsSeparator.length+1;const r=this.value.indexOf(this.thousandsSeparator,i);if(r<=t)return r}return-1}_adjustRangeWithSeparators(t,i){const r=this._findSeparatorAround(t);if(r>=0)t=r;const e=this._findSeparatorAround(i);if(e>=0)i=e+this.thousandsSeparator.length;return[t,i]}remove(t,i){if(t===void 0){t=0}if(i===void 0){i=this.displayValue.length}[t,i]=this._adjustRangeWithSeparators(t,i);const r=this.value.slice(0,t);const e=this.value.slice(i);const s=this._separatorsCount(r.length);this._value=this._insertThousandsSeparators(this._removeThousandsSeparators(r+e));const n=this._separatorsCountFromSlice(r);return new E({tailShift:(n-s)*this.thousandsSeparator.length})}nearestInputPos(t,i){if(!this.thousandsSeparator)return t;switch(i){case l.NONE:case l.LEFT:case l.FORCE_LEFT:{const r=this._findSeparatorAround(t-1);if(r>=0){const e=r+this.thousandsSeparator.length;if(t<e||this.value.length<=e||i===l.FORCE_LEFT){return r}}break}case l.RIGHT:case l.FORCE_RIGHT:{const i=this._findSeparatorAround(t);if(i>=0){return i+this.thousandsSeparator.length}}}return t}doCommit(){if(this.value){const t=this.number;let i=t;if(this.min!=null)i=Math.max(i,this.min);if(this.max!=null)i=Math.min(i,this.max);if(i!==t)this.unmaskedValue=this.format(i,this);let r=this.value;if(this.normalizeZeros)r=this._normalizeZeros(r);if(this.padFractionalZeros&&this.scale>0)r=this._padFractionalZeros(r);this._value=r}super.doCommit()}_normalizeZeros(t){const i=this._removeThousandsSeparators(t).split(this.radix);i[0]=i[0].replace(/^(\D*)(0*)(\d*)/,((t,i,r,e)=>i+e));if(t.length&&!/\d$/.test(i[0]))i[0]=i[0]+"0";if(i.length>1){i[1]=i[1].replace(/0*$/,"");if(!i[1].length)i.length=1}return this._insertThousandsSeparators(i.join(this.radix))}_padFractionalZeros(t){if(!t)return t;const i=t.split(this.radix);if(i.length<2)i.push("");i[1]=i[1].padEnd(this.scale,"0");return i.join(this.radix)}doSkipInvalid(t,i,r){if(i===void 0){i={}}const e=this.scale===0&&t!==this.thousandsSeparator&&(t===this.radix||t===q.UNMASKED_RADIX||this.mapToRadix.includes(t));return super.doSkipInvalid(t,i,r)&&!e}get unmaskedValue(){return this._removeThousandsSeparators(this._normalizeZeros(this.value)).replace(this.radix,q.UNMASKED_RADIX)}set unmaskedValue(t){super.unmaskedValue=t}get typedValue(){return this.parse(this.unmaskedValue,this)}set typedValue(t){this.rawInputValue=this.format(t,this).replace(q.UNMASKED_RADIX,this.radix)}get number(){return this.typedValue}set number(t){this.typedValue=t}get allowNegative(){return this.min!=null&&this.min<0||this.max!=null&&this.max<0}get allowPositive(){return this.min!=null&&this.min>0||this.max!=null&&this.max>0}typedValueEquals(t){return(super.typedValueEquals(t)||q.EMPTY_VALUES.includes(t)&&q.EMPTY_VALUES.includes(this.typedValue))&&!(t===0&&this.value==="")}}$=q;q.UNMASKED_RADIX=".";q.EMPTY_VALUES=[..._.EMPTY_VALUES,0];q.DEFAULTS={..._.DEFAULTS,mask:Number,radix:",",thousandsSeparator:"",mapToRadix:[$.UNMASKED_RADIX],min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,scale:2,normalizeZeros:true,padFractionalZeros:false,parse:Number,format:t=>t.toLocaleString("en-US",{useGrouping:false,maximumFractionDigits:20})};g.MaskedNumber=q;const H={MASKED:"value",UNMASKED:"unmaskedValue",TYPED:"typedValue"};function U(t,i,r){if(i===void 0){i=H.MASKED}if(r===void 0){r=H.MASKED}const e=x(t);return t=>e.runIsolated((e=>{e[i]=t;return e[r]}))}function G(t,i,r,e){return U(i,r,e)(t)}g.PIPE_TYPE=H;g.createPipe=U;g.pipe=G;class K extends L{get repeatFrom(){var t;return(t=Array.isArray(this.repeat)?this.repeat[0]:this.repeat===Infinity?0:this.repeat)!=null?t:0}get repeatTo(){var t;return(t=Array.isArray(this.repeat)?this.repeat[1]:this.repeat)!=null?t:Infinity}constructor(t){super(t)}updateOptions(t){super.updateOptions(t)}_update(t){var i,r,e;const{repeat:s,...n}=m(t);this._blockOpts=Object.assign({},this._blockOpts,n);const u=x(this._blockOpts);this.repeat=(i=(r=s!=null?s:u.repeat)!=null?r:this.repeat)!=null?i:Infinity;super._update({mask:"m".repeat(Math.max(this.repeatTo===Infinity&&((e=this._blocks)==null?void 0:e.length)||0,this.repeatFrom)),blocks:{m:u},eager:u.eager,overwrite:u.overwrite,skipInvalid:u.skipInvalid,lazy:u.lazy,placeholderChar:u.placeholderChar,displayChar:u.displayChar})}_allocateBlock(t){if(t<this._blocks.length)return this._blocks[t];if(this.repeatTo===Infinity||this._blocks.length<this.repeatTo){this._blocks.push(x(this._blockOpts));this.mask+="m";return this._blocks[this._blocks.length-1]}}_appendCharRaw(t,i){if(i===void 0){i={}}const r=new E;for(let a=(e=(s=this._mapPosToBlock(this.displayValue.length))==null?void 0:s.index)!=null?e:Math.max(this._blocks.length-1,0),o,h;o=(n=this._blocks[a])!=null?n:h=!h&&this._allocateBlock(a);++a){var e,s,n,u;const l=o._appendChar(t,{...i,_beforeTailState:(u=i._beforeTailState)==null||(u=u._blocks)==null?void 0:u[a]});if(l.skip&&h){this._blocks.pop();this.mask=this.mask.slice(1);break}r.aggregate(l);if(l.consumed)break}return r}_trimEmptyTail(t,i){var r,e;if(t===void 0){t=0}const s=Math.max(((r=this._mapPosToBlock(t))==null?void 0:r.index)||0,this.repeatFrom,0);let n;if(i!=null)n=(e=this._mapPosToBlock(i))==null?void 0:e.index;if(n==null)n=this._blocks.length-1;let u=0;for(let t=n;s<=t;--t,++u){if(this._blocks[t].unmaskedValue)break}if(u){this._blocks.splice(n-u+1,u);this.mask=this.mask.slice(u)}}reset(){super.reset();this._trimEmptyTail()}remove(t,i){if(t===void 0){t=0}if(i===void 0){i=this.displayValue.length}const r=super.remove(t,i);this._trimEmptyTail(t,i);return r}totalInputPositions(t,i){if(t===void 0){t=0}if(i==null&&this.repeatTo===Infinity)return Infinity;return super.totalInputPositions(t,i)}get state(){return super.state}set state(t){this._blocks.length=t._blocks.length;this.mask=this.mask.slice(0,this._blocks.length);super.state=t}}g.RepeatBlock=K;try{globalThis.IMask=g}catch{}const Z={cpf_cnpj:{mask:[{mask:"000.000.000-00"},{mask:"00.000.000/0000-00"}],placeholderChar:"_"},cpf:{mask:"000.000.000-00",placeholderChar:"_"},cnpj:{mask:"00.000.000/0000-00",placeholderChar:"_"},phone:{mask:"(00) 00000-0000",blocks:{"(00)":{mask:"(00)",maxLength:2,placeholderChar:""},"00000":{mask:"00000",maxLength:5,placeholderChar:"_"},"-":{mask:"-"},"0000":{mask:"0000",maxLength:4,placeholderChar:"_"}},placeholderChar:"_"},date:{mask:Date,min:new Date(1900,0,1),max:new Date(2099,11,31),lazy:false,placeholderChar:"_"}};const Y=":host{display:block;box-sizing:border-box;width:100%}.required{color:var(--error-base)}.cura-input-group{width:100%;font-family:var(--font-family);text-align:left !important}.cura-input-group .helper-text{margin-top:8px;color:var(--neutral-dark)}.cura-input-group cura-label{margin-bottom:8px}.cura-input-group .cura-input-field{width:100%;height:40px;display:flex;flex-direction:row;align-items:center;background-color:var(--neutral-purewhite);border:2px solid var(--neutral-medium);border-radius:4px;color:var(--primary-base);letter-spacing:0.32px;line-height:20px;overflow:hidden;box-sizing:border-box}.cura-input-group .cura-input-field input{flex:1;width:100%;height:100%;background:transparent;border:none;outline:none;color:var(--neutral-dark);font-family:var(--font-family);font-weight:var(--font-weight-medium);font-size:14px;box-sizing:border-box;padding:0px 12px 0px 8px}.cura-input-group .cura-input-field input::placeholder{color:var(--neutral-dark)}.cura-input-group .cura-input-field .feedback-icon{padding-left:12px}.cura-input-group .cura-input-field cura-loader-circle{margin:0px 12px}.cura-input-group .cura-input-field .feedback-icon{padding-left:12px;padding-top:6px}.cura-input-group .cura-input-field .clear-button{padding-right:12px;cursor:pointer}.cura-input-group .helper-text{margin-top:8px;color:var(--neutral-dark)}.cura-input-group.success .cura-input-field{width:100%;height:40px;display:flex;flex-direction:row;align-items:center;background-color:var(--neutral-purewhite);border:2px solid var(--neutral-medium);border-radius:4px;color:var(--primary-base);letter-spacing:0.32px;line-height:20px;overflow:hidden;box-sizing:border-box}.cura-input-group.success .cura-input-field input{flex:1;width:100%;height:100%;background:transparent;border:none;outline:none;color:var(--neutral-dark);font-family:var(--font-family);font-weight:var(--font-weight-medium);font-size:14px;box-sizing:border-box;padding:0px 12px 0px 8px}.cura-input-group.success .cura-input-field input::placeholder{color:var(--neutral-dark)}.cura-input-group.success .cura-input-field .feedback-icon{padding-left:12px}.cura-input-group.success .cura-input-field input{color:var(--success-darker) !important}.cura-input-group.success .cura-input-field input::placeholder{color:var(--success-darker) !important}.cura-input-group.success:not(.transparent) .cura-input-field{width:100%;height:40px;display:flex;flex-direction:row;align-items:center;background-color:var(--neutral-purewhite);border:2px solid var(--neutral-medium);border-radius:4px;color:var(--primary-base);letter-spacing:0.32px;line-height:20px;overflow:hidden;box-sizing:border-box;border:2px solid var(--success-dark) !important;background-color:var(--success-lighter) !important}.cura-input-group.success:not(.transparent) .cura-input-field input{flex:1;width:100%;height:100%;background:transparent;border:none;outline:none;color:var(--neutral-dark);font-family:var(--font-family);font-weight:var(--font-weight-medium);font-size:14px;box-sizing:border-box;padding:0px 12px 0px 8px}.cura-input-group.success:not(.transparent) .cura-input-field input::placeholder{color:var(--neutral-dark)}.cura-input-group.success:not(.transparent) .cura-input-field .feedback-icon{padding-left:12px}.cura-input-group.error .cura-input-field{width:100%;height:40px;display:flex;flex-direction:row;align-items:center;background-color:var(--neutral-purewhite);border:2px solid var(--neutral-medium);border-radius:4px;color:var(--primary-base);letter-spacing:0.32px;line-height:20px;overflow:hidden;box-sizing:border-box}.cura-input-group.error .cura-input-field input{flex:1;width:100%;height:100%;background:transparent;border:none;outline:none;color:var(--neutral-dark);font-family:var(--font-family);font-weight:var(--font-weight-medium);font-size:14px;box-sizing:border-box;padding:0px 12px 0px 8px}.cura-input-group.error .cura-input-field input::placeholder{color:var(--neutral-dark)}.cura-input-group.error .cura-input-field .feedback-icon{padding-left:12px}.cura-input-group.error .cura-input-field input{color:var(--error-darker) !important}.cura-input-group.error .cura-input-field input::placeholder{color:var(--error-darker) !important}.cura-input-group.error:not(.transparent) .cura-input-field{width:100%;height:40px;display:flex;flex-direction:row;align-items:center;background-color:var(--neutral-purewhite);border:2px solid var(--neutral-medium);border-radius:4px;color:var(--primary-base);letter-spacing:0.32px;line-height:20px;overflow:hidden;box-sizing:border-box;border:2px solid var(--error-dark) !important;background-color:var(--error-lighter) !important}.cura-input-group.error:not(.transparent) .cura-input-field input{flex:1;width:100%;height:100%;background:transparent;border:none;outline:none;color:var(--neutral-dark);font-family:var(--font-family);font-weight:var(--font-weight-medium);font-size:14px;box-sizing:border-box;padding:0px 12px 0px 8px}.cura-input-group.error:not(.transparent) .cura-input-field input::placeholder{color:var(--neutral-dark)}.cura-input-group.error:not(.transparent) .cura-input-field .feedback-icon{padding-left:12px}.cura-input-group:hover:not(.disabled):not(.isLoading):not(.success):not(.error):not(.isFocused):not(.readOnly):not(.transparent) .cura-input-field{border-color:var(--neutral-dark)}.cura-input-group:hover:not(.disabled):not(.isLoading):not(.success):not(.error):not(.isFocused):not(.readOnly):not(.transparent) .cura-input-field input{color:var(--neutral-dark)}.cura-input-group:hover:not(.disabled):not(.isLoading):not(.success):not(.error):not(.isFocused):not(.readOnly):not(.transparent) .cura-input-field input::placeholder{color:var(--neutral-dark)}.cura-input-group:focus-within .cura-input-field{border:2px solid var(--info-base) !important;background-color:var(--neutral-purewhite);outline:none}.cura-input-group:focus-within .cura-input-field input{color:var(--neutral-black) !important}.cura-input-group.isLoading{cursor:wait}.cura-input-group.isLoading .cura-input-field{width:100%;height:40px;display:flex;flex-direction:row;align-items:center;background-color:var(--neutral-purewhite);border:2px solid var(--neutral-medium);border-radius:4px;color:var(--primary-base);letter-spacing:0.32px;line-height:20px;overflow:hidden;box-sizing:border-box;background-color:var(--neutral-white) !important;border:2px solid var(--primary-base) !important}.cura-input-group.isLoading .cura-input-field input{flex:1;width:100%;height:100%;background:transparent;border:none;outline:none;color:var(--neutral-dark);font-family:var(--font-family);font-weight:var(--font-weight-medium);font-size:14px;box-sizing:border-box;padding:0px 12px 0px 8px}.cura-input-group.isLoading .cura-input-field input::placeholder{color:var(--neutral-dark)}.cura-input-group.isLoading .cura-input-field .feedback-icon{padding-left:12px}.cura-input-group.isLoading .cura-input-field input{cursor:wait;color:var(--primary-base) !important}.cura-input-group.isLoading .cura-input-field input::placeholder{color:var(--primary-base) !important}.cura-input-group.disabled .cura-input-field{width:100%;height:40px;display:flex;flex-direction:row;align-items:center;background-color:var(--neutral-purewhite);border:2px solid var(--neutral-medium);border-radius:4px;color:var(--primary-base);letter-spacing:0.32px;line-height:20px;overflow:hidden;box-sizing:border-box;background-color:var(--neutral-white);border:2px solid var(--neutral-base)}.cura-input-group.disabled .cura-input-field input{flex:1;width:100%;height:100%;background:transparent;border:none;outline:none;color:var(--neutral-dark);font-family:var(--font-family);font-weight:var(--font-weight-medium);font-size:14px;box-sizing:border-box;padding:0px 12px 0px 8px}.cura-input-group.disabled .cura-input-field input::placeholder{color:var(--neutral-dark)}.cura-input-group.disabled .cura-input-field .feedback-icon{padding-left:12px}.cura-input-group.disabled .cura-input-field input{color:var(--neutral-medium)}.cura-input-group.disabled .cura-input-field input::placeholder{color:var(--neutral-medium)}.cura-input-group.readOnly[read-only] .cura-input-field{cursor:default}.cura-input-group.readOnly[read-only] .cura-input-field input{cursor:default}.cura-input-group.small .cura-input-field{width:100%;height:32px;display:flex;flex-direction:row;align-items:center;background-color:var(--neutral-purewhite);border:2px solid var(--neutral-medium);border-radius:4px;color:var(--primary-base);letter-spacing:0.32px;line-height:20px;overflow:hidden;box-sizing:border-box}.cura-input-group.small .cura-input-field input{flex:1;width:100%;height:100%;background:transparent;border:none;outline:none;color:var(--neutral-dark);font-family:var(--font-family);font-weight:var(--font-weight-medium);font-size:12px;box-sizing:border-box;padding:0px 12px 0px 8px}.cura-input-group.small .cura-input-field input::placeholder{color:var(--neutral-dark)}.cura-input-group.small .cura-input-field .feedback-icon{padding-left:12px}.cura-input-group.small .cura-input-field input{line-height:13px;letter-spacing:0.72px}.cura-input-group.small .helper-text{margin-top:8px;color:var(--neutral-dark);font-weight:var(--font-weight-regular)}.cura-input-group.medium .cura-input-field{width:100%;height:40px;display:flex;flex-direction:row;align-items:center;background-color:var(--neutral-purewhite);border:2px solid var(--neutral-medium);border-radius:4px;color:var(--primary-base);letter-spacing:0.32px;line-height:20px;overflow:hidden;box-sizing:border-box}.cura-input-group.medium .cura-input-field input{flex:1;width:100%;height:100%;background:transparent;border:none;outline:none;color:var(--neutral-dark);font-family:var(--font-family);font-weight:var(--font-weight-medium);font-size:14px;box-sizing:border-box;padding:0px 12px 0px 8px}.cura-input-group.medium .cura-input-field input::placeholder{color:var(--neutral-dark)}.cura-input-group.medium .cura-input-field .feedback-icon{padding-left:12px}.cura-input-group.medium .cura-input-field input{line-height:16px;letter-spacing:0.56px}.cura-input-group.medium .helper-text{margin-top:8px;color:var(--neutral-dark);font-weight:var(--font-weight-regular)}.cura-input-group.large .cura-input-field{width:100%;height:44px;display:flex;flex-direction:row;align-items:center;background-color:var(--neutral-purewhite);border:2px solid var(--neutral-medium);border-radius:4px;color:var(--primary-base);letter-spacing:0.32px;line-height:20px;overflow:hidden;box-sizing:border-box}.cura-input-group.large .cura-input-field input{flex:1;width:100%;height:100%;background:transparent;border:none;outline:none;color:var(--neutral-dark);font-family:var(--font-family);font-weight:var(--font-weight-medium);font-size:16px;box-sizing:border-box;padding:0px 12px 0px 8px}.cura-input-group.large .cura-input-field input::placeholder{color:var(--neutral-dark)}.cura-input-group.large .cura-input-field .feedback-icon{padding-left:12px}.cura-input-group.large .helper-text{margin-top:8px;color:var(--neutral-dark);font-weight:var(--font-weight-bold)}.cura-input-group.transparent{background-color:transparent;padding:0px;max-height:80px}.cura-input-group.transparent .cura-input-field{width:100%;height:40px;display:flex;flex-direction:row;align-items:center;background-color:var(--neutral-purewhite);border:2px solid var(--neutral-medium);border-radius:4px;color:var(--primary-base);letter-spacing:0.32px;line-height:20px;overflow:hidden;box-sizing:border-box;background-color:transparent !important;border:none !important;border-radius:0;height:27px}.cura-input-group.transparent .cura-input-field input{flex:1;width:100%;height:100%;background:transparent;border:none;outline:none;color:var(--neutral-dark);font-family:var(--font-family);font-weight:var(--font-weight-medium);font-size:14px;box-sizing:border-box;padding:0px 12px 0px 8px}.cura-input-group.transparent .cura-input-field input::placeholder{color:var(--neutral-dark)}.cura-input-group.transparent .cura-input-field .feedback-icon{padding-left:12px}.cura-input-group.transparent .cura-input-field input{color:var(--neutral-black) !important;font-size:16px;font-weight:var(--font-weight-bold) !important;padding:0}.cura-input-group.transparent .cura-input-field input::placeholder{color:var(--neutral-black)}.cura-input-group.transparent .cura-input-field .feedback-icon{order:3;margin:0 20px 0 0}.cura-input-group.transparent:focus-within .cura-input-field{border:none !important;background-color:transparent !important}.cura-input-group.transparent:focus-within .cura-input-field input{border:none !important;outline:none}.cura-input-group.transparent .helper-text{margin-top:0px}.cura-input-group.transparent.transparent{display:flex;background-color:transparent;padding:0px;justify-content:start;align-items:center;max-height:80px;gap:4px}.cura-input-group.transparent.transparent .input-wrapper{display:flex;width:100%;flex-direction:column;justify-content:start}.cura-input-group.transparent.transparent cura-label{margin-bottom:4px}.cura-input-group.transparent.transparent .cura-input-field{width:100%;height:40px;display:flex;flex-direction:row;align-items:center;background-color:var(--neutral-purewhite);border:2px solid var(--neutral-medium);border-radius:4px;color:var(--primary-base);letter-spacing:0.32px;line-height:20px;overflow:hidden;box-sizing:border-box;background-color:transparent !important;border:none !important;border-radius:0;height:27px;overflow:hidden}.cura-input-group.transparent.transparent .cura-input-field input{flex:1;width:100%;height:100%;background:transparent;border:none;outline:none;color:var(--neutral-dark);font-family:var(--font-family);font-weight:var(--font-weight-medium);font-size:14px;box-sizing:border-box;padding:0px 12px 0px 8px}.cura-input-group.transparent.transparent .cura-input-field input::placeholder{color:var(--neutral-dark)}.cura-input-group.transparent.transparent .cura-input-field .feedback-icon{padding-left:12px}.cura-input-group.transparent.transparent .cura-input-field input{order:1;color:var(--neutral-black) !important;font-size:16px;font-weight:var(--font-weight-bold) !important;padding:0}.cura-input-group.transparent.transparent .cura-input-field input::placeholder{color:var(--neutral-black)}.cura-input-group.transparent.transparent .cura-input-field .clear-button{order:2;cursor:pointer;margin:0 20px 0 0;padding:0}.cura-input-group.transparent.transparent .cura-input-field .feedback-icon{padding:6px 0 0 0}.cura-input-group.transparent.transparent .cura-input-field cura-loader-circle{order:2;margin:0 20px 0 0}.cura-input-group.error .cura-input-field{width:100%;height:40px;display:flex;flex-direction:row;align-items:center;background-color:var(--neutral-purewhite);border:2px solid var(--neutral-medium);border-radius:4px;color:var(--primary-base);letter-spacing:0.32px;line-height:20px;overflow:hidden;box-sizing:border-box}.cura-input-group.error .cura-input-field input{flex:1;width:100%;height:100%;background:transparent;border:none;outline:none;color:var(--neutral-dark);font-family:var(--font-family);font-weight:var(--font-weight-medium);font-size:14px;box-sizing:border-box;padding:0px 12px 0px 8px}.cura-input-group.error .cura-input-field input::placeholder{color:var(--neutral-dark)}.cura-input-group.error .cura-input-field .feedback-icon{padding-left:12px}.cura-input-group.error .cura-input-field input{color:var(--error-darker) !important}.cura-input-group.error .cura-input-field input::placeholder{color:var(--error-darker) !important}.cura-input-group.error.small .cura-input-field{width:100%;height:32px;display:flex;flex-direction:row;align-items:center;background-color:var(--neutral-purewhite);border:2px solid var(--neutral-medium);border-radius:4px;color:var(--primary-base);letter-spacing:0.32px;line-height:20px;overflow:hidden;box-sizing:border-box}.cura-input-group.error.small .cura-input-field input{flex:1;width:100%;height:100%;background:transparent;border:none;outline:none;color:var(--neutral-dark);font-family:var(--font-family);font-weight:var(--font-weight-medium);font-size:12px;box-sizing:border-box;padding:0px 12px 0px 8px}.cura-input-group.error.small .cura-input-field input::placeholder{color:var(--neutral-dark)}.cura-input-group.error.small .cura-input-field .feedback-icon{padding-left:12px}.cura-input-group.error.small .cura-input-field input{line-height:13px;letter-spacing:0.72px}.cura-input-group.error.small .helper-text{margin-top:8px;color:var(--neutral-dark);font-weight:var(--font-weight-regular)}.cura-input-group.error.medium .cura-input-field{width:100%;height:40px;display:flex;flex-direction:row;align-items:center;background-color:var(--neutral-purewhite);border:2px solid var(--neutral-medium);border-radius:4px;color:var(--primary-base);letter-spacing:0.32px;line-height:20px;overflow:hidden;box-sizing:border-box}.cura-input-group.error.medium .cura-input-field input{flex:1;width:100%;height:100%;background:transparent;border:none;outline:none;color:var(--neutral-dark);font-family:var(--font-family);font-weight:var(--font-weight-medium);font-size:14px;box-sizing:border-box;padding:0px 12px 0px 8px}.cura-input-group.error.medium .cura-input-field input::placeholder{color:var(--neutral-dark)}.cura-input-group.error.medium .cura-input-field .feedback-icon{padding-left:12px}.cura-input-group.error.medium .cura-input-field input{line-height:16px;letter-spacing:0.56px}.cura-input-group.error.medium .helper-text{margin-top:8px;color:var(--neutral-dark);font-weight:var(--font-weight-regular)}.cura-input-group.error.large .cura-input-field{width:100%;height:44px;display:flex;flex-direction:row;align-items:center;background-color:var(--neutral-purewhite);border:2px solid var(--neutral-medium);border-radius:4px;color:var(--primary-base);letter-spacing:0.32px;line-height:20px;overflow:hidden;box-sizing:border-box}.cura-input-group.error.large .cura-input-field input{flex:1;width:100%;height:100%;background:transparent;border:none;outline:none;color:var(--neutral-dark);font-family:var(--font-family);font-weight:var(--font-weight-medium);font-size:16px;box-sizing:border-box;padding:0px 12px 0px 8px}.cura-input-group.error.large .cura-input-field input::placeholder{color:var(--neutral-dark)}.cura-input-group.error.large .cura-input-field .feedback-icon{padding-left:12px}.cura-input-group.error.large .helper-text{margin-top:8px;color:var(--neutral-dark);font-weight:var(--font-weight-bold)}.cura-input-group.error:not(.transparent).large .cura-input-field{width:100%;height:44px;display:flex;flex-direction:row;align-items:center;background-color:var(--neutral-purewhite);border:2px solid var(--neutral-medium);border-radius:4px;color:var(--primary-base);letter-spacing:0.32px;line-height:20px;overflow:hidden;box-sizing:border-box;border:2px solid var(--error-dark) !important;background-color:var(--error-lighter) !important}.cura-input-group.error:not(.transparent).large .cura-input-field input{flex:1;width:100%;height:100%;background:transparent;border:none;outline:none;color:var(--neutral-dark);font-family:var(--font-family);font-weight:var(--font-weight-medium);font-size:16px;box-sizing:border-box;padding:0px 12px 0px 8px}.cura-input-group.error:not(.transparent).large .cura-input-field input::placeholder{color:var(--neutral-dark)}.cura-input-group.error:not(.transparent).large .cura-input-field .feedback-icon{padding-left:12px}.cura-input-group.success .cura-input-field{width:100%;height:40px;display:flex;flex-direction:row;align-items:center;background-color:var(--neutral-purewhite);border:2px solid var(--neutral-medium);border-radius:4px;color:var(--primary-base);letter-spacing:0.32px;line-height:20px;overflow:hidden;box-sizing:border-box}.cura-input-group.success .cura-input-field input{flex:1;width:100%;height:100%;background:transparent;border:none;outline:none;color:var(--neutral-dark);font-family:var(--font-family);font-weight:var(--font-weight-medium);font-size:14px;box-sizing:border-box;padding:0px 12px 0px 8px}.cura-input-group.success .cura-input-field input::placeholder{color:var(--neutral-dark)}.cura-input-group.success .cura-input-field .feedback-icon{padding-left:12px}.cura-input-group.success .cura-input-field input{color:var(--success-darker) !important}.cura-input-group.success .cura-input-field input::placeholder{color:var(--success-darker) !important}.cura-input-group.success.small .cura-input-field{width:100%;height:32px;display:flex;flex-direction:row;align-items:center;background-color:var(--neutral-purewhite);border:2px solid var(--neutral-medium);border-radius:4px;color:var(--primary-base);letter-spacing:0.32px;line-height:20px;overflow:hidden;box-sizing:border-box}.cura-input-group.success.small .cura-input-field input{flex:1;width:100%;height:100%;background:transparent;border:none;outline:none;color:var(--neutral-dark);font-family:var(--font-family);font-weight:var(--font-weight-medium);font-size:12px;box-sizing:border-box;padding:0px 12px 0px 8px}.cura-input-group.success.small .cura-input-field input::placeholder{color:var(--neutral-dark)}.cura-input-group.success.small .cura-input-field .feedback-icon{padding-left:12px}.cura-input-group.success.small .cura-input-field input{line-height:13px;letter-spacing:0.72px}.cura-input-group.success.small .helper-text{margin-top:8px;color:var(--neutral-dark);font-weight:var(--font-weight-regular)}.cura-input-group.success.medium .cura-input-field{width:100%;height:40px;display:flex;flex-direction:row;align-items:center;background-color:var(--neutral-purewhite);border:2px solid var(--neutral-medium);border-radius:4px;color:var(--primary-base);letter-spacing:0.32px;line-height:20px;overflow:hidden;box-sizing:border-box}.cura-input-group.success.medium .cura-input-field input{flex:1;width:100%;height:100%;background:transparent;border:none;outline:none;color:var(--neutral-dark);font-family:var(--font-family);font-weight:var(--font-weight-medium);font-size:14px;box-sizing:border-box;padding:0px 12px 0px 8px}.cura-input-group.success.medium .cura-input-field input::placeholder{color:var(--neutral-dark)}.cura-input-group.success.medium .cura-input-field .feedback-icon{padding-left:12px}.cura-input-group.success.medium .cura-input-field input{line-height:16px;letter-spacing:0.56px}.cura-input-group.success.medium .helper-text{margin-top:8px;color:var(--neutral-dark);font-weight:var(--font-weight-regular)}.cura-input-group.success.large .cura-input-field{width:100%;height:44px;display:flex;flex-direction:row;align-items:center;background-color:var(--neutral-purewhite);border:2px solid var(--neutral-medium);border-radius:4px;color:var(--primary-base);letter-spacing:0.32px;line-height:20px;overflow:hidden;box-sizing:border-box}.cura-input-group.success.large .cura-input-field input{flex:1;width:100%;height:100%;background:transparent;border:none;outline:none;color:var(--neutral-dark);font-family:var(--font-family);font-weight:var(--font-weight-medium);font-size:16px;box-sizing:border-box;padding:0px 12px 0px 8px}.cura-input-group.success.large .cura-input-field input::placeholder{color:var(--neutral-dark)}.cura-input-group.success.large .cura-input-field .feedback-icon{padding-left:12px}.cura-input-group.success.large .helper-text{margin-top:8px;color:var(--neutral-dark);font-weight:var(--font-weight-bold)}.cura-input-group.success:not(.transparent).large .cura-input-field{width:100%;height:44px;display:flex;flex-direction:row;align-items:center;background-color:var(--neutral-purewhite);border:2px solid var(--neutral-medium);border-radius:4px;color:var(--primary-base);letter-spacing:0.32px;line-height:20px;overflow:hidden;box-sizing:border-box;border:2px solid var(--success-dark) !important;background-color:var(--success-lighter) !important}.cura-input-group.success:not(.transparent).large .cura-input-field input{flex:1;width:100%;height:100%;background:transparent;border:none;outline:none;color:var(--neutral-dark);font-family:var(--font-family);font-weight:var(--font-weight-medium);font-size:16px;box-sizing:border-box;padding:0px 12px 0px 8px}.cura-input-group.success:not(.transparent).large .cura-input-field input::placeholder{color:var(--neutral-dark)}.cura-input-group.success:not(.transparent).large .cura-input-field .feedback-icon{padding-left:12px}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}";const J=Y;const W=class{constructor(i){t(this,i);this.valueChange=e(this,"valueChange",7);if(i.$hostElement$["s-ei"]){this.internals=i.$hostElement$["s-ei"]}else{this.internals=i.$hostElement$.attachInternals();i.$hostElement$["s-ei"]=this.internals}this.mode="default";this.status="default";this.size="medium";this.type="text";this.inputMode="text";this.label="";this.name="";this.placeholder=null;this.value="";this.iconName="";this.helperText=undefined;this.disabled=false;this.required=false;this.maskPreset=undefined;this.maskRegex=undefined;this.maskAdvanced=undefined;this.maxlength=undefined;this.readOnly=false;this.isLoading=false;this.isHovered=false;this.isFocused=false;this.styles={};this.clearIcon=true;this.hideErrorIcon=false}formStateRestoreCallback(t){this.value=t.value;this.applyValueToMask();this.internals.setFormValue(this.value)}formAssociatedCallback(t){t.ariaLabel=this.label}formResetCallback(){this.handleClearInput();this.internals.setValidity({});this.internals.setFormValue("")}formDisabledCallback(t){this.disabled=t}connectedCallback(){this.styles["--primary-base"]=window.CuraAPI.theme.colors.getColor(`primary-base`);this.styles["--neutral-purewhite"]=window.CuraAPI.theme.colors.getColor(`neutral-purewhite`);this.styles["--neutral-white"]=window.CuraAPI.theme.colors.getColor(`neutral-white`);this.styles["--neutral-black"]=window.CuraAPI.theme.colors.getColor(`neutral-black`);this.styles["--neutral-medium"]=window.CuraAPI.theme.colors.getColor(`neutral-medium`);this.styles["--neutral-base"]=window.CuraAPI.theme.colors.getColor(`neutral-base`);this.styles["--neutral-dark"]=window.CuraAPI.theme.colors.getColor(`neutral-dark`);this.styles["--success-dark"]=window.CuraAPI.theme.colors.getColor(`success-dark`);this.styles["--success-darker"]=window.CuraAPI.theme.colors.getColor(`success-darker`);this.styles["--success-lighter"]=window.CuraAPI.theme.colors.getColor(`success-lighter`);this.styles["--error-lighter"]=window.CuraAPI.theme.colors.getColor(`error-lighter`);this.styles["--error-dark"]=window.CuraAPI.theme.colors.getColor(`error-dark`);this.styles["--error-darker"]=window.CuraAPI.theme.colors.getColor(`error-darker`);this.styles["--error-base"]=window.CuraAPI.theme.colors.getColor(`error-base`);this.styles["--info-base"]=window.CuraAPI.theme.colors.getColor(`info-base`);this.styles["--font-family"]=window.CuraAPI.theme.fonts.getFamily();this.styles["--font-size"]=window.CuraAPI.theme.fonts.getSize();this.styles["--font-color"]=window.CuraAPI.theme.fonts.getColor();this.weights=window.CuraAPI.theme.fonts.getWeights();this.styles["--font-weight-medium"]=this.weights.medium;this.styles["--font-weight-bold"]=this.weights.bold;this.styles["--font-weight-regular"]=this.weights.regular}getClasses(){return{[this.size.toLowerCase()]:this.mode==="default",disabled:this.disabled,isLoading:this.isLoading,isFocused:this.isFocused&&!this.disabled&&!this.readOnly&&!this.isLoading,isHovered:this.isHovered,[this.status]:true,transparent:this.mode==="transparent"}}getLabelColor(){if(!!this.disabled){return"neutral-medium"}else if(this.isLoading&&this.mode==="transparent"&&!this.isHovered){return"neutral-dark"}else if((this.isFocused||this.isHovered||this.status==="success"||this.status==="error")&&!this.readOnly||this.isHovered){return"neutral-black"}else{return"neutral-dark"}}renderIcon(){if(this.iconName===""&&this.status==="default"||this.mode==="transparent"&&this.isLoading||this.mode==="transparent"&&this.status==="default"){return}if(this.status==="error"&&this.hideErrorIcon){return}const t=this.size==="large"?20:16;const r=this.mode==="transparent"?20:t;const e={loading:{name:this.iconName,color:"primary-base"},success:{name:"checkCircle",color:"success-dark"},error:{name:"alertCircle",color:"error-dark"},default:{name:this.iconName,color:"neutral-dark"}};const s=e[this.isLoading?"loading":this.status||"default"];return i("div",{class:"feedback-icon",style:this.styles},i("cura-icon",{name:s.name,iconset:"default",size:r,color:s.color}))}renderHelperText(){const t=this.status==="error";const r=this.status==="success";const e=this.status==="default";const s=this.size==="large"?"small":"xsmall";const n=this.mode==="transparent"?"bold":"regular";const u=(()=>{if(this.disabled)return"neutral-medium";if(this.isLoading)return"primary-base";if(this.isFocused||this.isHovered)return"neutral-black";return"neutral-dark"})();return i("div",{style:this.styles,class:"helper-text"},e&&i("cura-label",{size:s,lineHeight:"xsmall",color:u,weight:n},i("slot",null)),t&&i("cura-label",{size:s,lineHeight:"xsmall",color:"error-dark",weight:n},i("slot",null)),r&&i("cura-label",{size:s,lineHeight:"xsmall",color:"success-dark",weight:n},i("slot",null)))}handleMouseEnter(){this.isHovered=true}handleMouseLeave(){this.isHovered=false}componentDidLoad(){this.initializeMask()}disconnectedCallback(){this.destroyMask()}handleMaskUpdate(){if(this.maskedInput){this.maskedInput.updateValue()}}handleClearInput(){this.handleMaskUpdate();this.value="";this.inputRef.value="";this.valueChange.emit(this.value);this.handleMaskUpdate()}handleInputFocus(){this.handleMaskUpdate();this.isFocused=true}handleInputBlur(){this.handleMaskUpdate();setTimeout((()=>{this.isFocused=false}),150)}shouldDisplayMask(){return this.maskPreset||this.maskRegex||this.maskAdvanced}initializeMask(){if(this.shouldDisplayMask()){if(this.maskedInput){this.destroyMask()}if(this.maskPreset){this.initializePresetMask()}else if(this.maskRegex){this.initializeRegexMask()}else if(this.maskAdvanced){this.initializeAdvancedMask()}this.applyValueToMask()}else{this.clearMaskValue()}}initializeRegexMask(){const t=this.maskRegex.replace(/^\/|\/[gimsuy]*$/g,"");const i=(this.maskRegex.match(/\/[gimsuy]*$/g)||[""])[0].slice(1);this.maskedInput=g(this.inputRef,{mask:new RegExp(t,i)})}initializePresetMask(){const t=Z[this.maskPreset];if(t){this.maskedInput=g(this.inputRef,t)}else{console.error(`Mask preset "${this.maskPreset}" not found.`)}}initializeAdvancedMask(){try{const t=typeof this.maskAdvanced==="string"?JSON.parse(this.maskAdvanced):this.maskAdvanced;this.maskedInput=g(this.inputRef,t)}catch(t){console.error("Error defining maskAdvanced:",t)}}applyValueToMask(){if(this.maskedInput){if(this.maskedInput.mask===Date||this.maskedInput.mask===Number){this.maskedInput.typedValue=this.value}else{this.value=this.maskedInput.value}this.handleMaskUpdate()}}clearMaskValue(){this.inputRef.value=this.value}destroyMask(){if(this.maskedInput){this.maskedInput.destroy();this.maskedInput=undefined}}handleInputChange(t){const i=t.target.value;if(this.type==="number"){this.handleNumberInputChange(i)}else{this.handleTextInputChange(i)}this.internals.setFormValue(this.value)}handleNumberInputChange(t){const i=parseFloat(t);if(!isNaN(i)){this.value=i}else{console.error("Invalid numeric input:",t)}}handleTextInputChange(t){if(this.maskedInput){if(this.maskedInput.mask instanceof Date||this.maskedInput.mask===Number){this.maskedInput.typedValue=t;this.value=this.maskedInput.typedValue}this.value=this.maskedInput.value}else{this.value=t}}handleKeyDown(t){if(this.type==="number"){this.handleBlockInvalidNumber(t)}}handleBlockInvalidNumber(t){if(["e","E","+","-"].includes(t.key))t.preventDefault()}render(){return i(r,{key:"958e9c9ce207852a9a89bcbf6b2300a020e57e21"},i("div",{key:"a0b0a2dc0cef39d82f922f19a68adc2fea19ada4",style:this.styles,onMouseEnter:()=>this.handleMouseEnter(),onMouseLeave:()=>this.handleMouseLeave(),class:Object.assign({"cura-input-group":true},this.getClasses())},i("div",{key:"600ac418f5e11b145546efd999e46f6dc439dbe2",class:"input-wrapper"},this.label&&i("cura-label",{key:"b7d8c89801d73f6b304b15cb3a1fb053be6c10a3",class:"label",weight:"bold",size:this.size==="large"?"small":"xsmall",color:this.getLabelColor()},this.label," ",this.required&&i("span",{key:"fbfc7e95fae3d2f695af8e966d50c36eaddf83ff",class:"required"},"* ")),i("div",{key:"50b2e6a4edb17507bcbed66ddb262b5816eeea98",class:"cura-input-field",part:"cura-input-field",style:this.styles},this.renderIcon(),i("input",{key:"e0fb2fe18ca4555b15396bc794dc553273f06921",name:this.name?this.name:"",type:this.type,onKeyDown:t=>this.handleKeyDown(t),onBlur:this.handleInputBlur.bind(this),onFocus:this.handleInputFocus.bind(this),onInput:t=>this.handleInputChange(t),class:this.getClasses(),style:this.styles,placeholder:this.placeholder,disabled:this.disabled||this.isLoading,required:this.required,readonly:this.readOnly,maxlength:this.maxlength,value:this.value!==undefined&&this.value!==null?this.value:"",inputmode:this.maskPreset?"tel":this.inputMode,ref:t=>this.inputRef=t}),!!this.clearIcon&&!this.readOnly&&!this.isLoading&&!this.disabled&&this.value&&this.isFocused&&i("cura-icon",{key:"dde6d704a5fa3aac4bfa2428b636fc7e19301ace",size:this.size==="large"||this.mode==="transparent"?20:16,color:"primary-base",name:"closeCircle",iconset:"default",class:"clear-button",onClick:()=>this.handleClearInput()}),this.isLoading&&i("cura-loader-circle",{key:"9322c8e784058c1e0880b3d248c5f1272a1518c4",size:this.size==="large"?"medium":"small",color:"primary-base"})),this.renderHelperText())))}static get formAssociated(){return true}static get watchers(){return{styles:["connectedCallback"],size:["getClasses"],status:["renderIcon"],mode:["renderIcon"],maskPreset:["initializeMask"],maskRegex:["initializeMask"],maskAdvanced:["initializeMask"]}}};W.style=J;export{u as cura_button_transparent,W as cura_input_text};
2
+ //# sourceMappingURL=p-e1253a09.entry.js.map