@govtechsg/sgds-web-component 3.12.0-rc.0 → 3.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/Masthead/index.js +1 -1
  2. package/base/card.js +1 -1
  3. package/base/dropdown-list-element.d.ts +5 -1
  4. package/base/dropdown-list-element.js +2 -2
  5. package/base/dropdown-list-element.js.map +1 -1
  6. package/components/Breadcrumb/index.umd.min.js +20 -20
  7. package/components/Breadcrumb/index.umd.min.js.map +1 -1
  8. package/components/Card/index.umd.min.js +1 -1
  9. package/components/Card/index.umd.min.js.map +1 -1
  10. package/components/Checkbox/index.umd.min.js +6 -6
  11. package/components/Checkbox/index.umd.min.js.map +1 -1
  12. package/components/Checkbox/sgds-checkbox.d.ts +3 -0
  13. package/components/Checkbox/sgds-checkbox.js +17 -0
  14. package/components/Checkbox/sgds-checkbox.js.map +1 -1
  15. package/components/ComboBox/index.umd.min.js +2 -2
  16. package/components/ComboBox/index.umd.min.js.map +1 -1
  17. package/components/Dropdown/dropdown-item.js +1 -1
  18. package/components/Dropdown/index.umd.min.js +2 -2
  19. package/components/Dropdown/index.umd.min.js.map +1 -1
  20. package/components/Dropdown/sgds-dropdown-item.js +0 -3
  21. package/components/Dropdown/sgds-dropdown-item.js.map +1 -1
  22. package/components/IconCard/icon-card.js +1 -1
  23. package/components/IconCard/index.umd.min.js +1 -1
  24. package/components/IconCard/index.umd.min.js.map +1 -1
  25. package/components/ImageCard/image-card.js +1 -1
  26. package/components/ImageCard/index.umd.min.js +1 -1
  27. package/components/ImageCard/index.umd.min.js.map +1 -1
  28. package/components/Mainnav/index.umd.min.js +2 -2
  29. package/components/Mainnav/index.umd.min.js.map +1 -1
  30. package/components/Masthead/index.umd.min.js +1 -1
  31. package/components/Masthead/index.umd.min.js.map +1 -1
  32. package/components/Masthead/masthead.js +1 -1
  33. package/components/OverflowMenu/index.umd.min.js +2 -2
  34. package/components/OverflowMenu/index.umd.min.js.map +1 -1
  35. package/components/Select/index.umd.min.js +1 -1
  36. package/components/Select/index.umd.min.js.map +1 -1
  37. package/components/SystemBanner/index.umd.min.js +10 -9
  38. package/components/SystemBanner/index.umd.min.js.map +1 -1
  39. package/components/SystemBanner/sgds-system-banner-item.d.ts +2 -1
  40. package/components/SystemBanner/sgds-system-banner-item.js +7 -2
  41. package/components/SystemBanner/sgds-system-banner-item.js.map +1 -1
  42. package/components/SystemBanner/system-banner-item.js +1 -1
  43. package/components/SystemBanner/system-banner.js +1 -1
  44. package/components/ThumbnailCard/index.umd.min.js +1 -1
  45. package/components/ThumbnailCard/index.umd.min.js.map +1 -1
  46. package/components/ThumbnailCard/thumbnail-card.js +1 -1
  47. package/components/index.umd.min.js +9 -9
  48. package/components/index.umd.min.js.map +1 -1
  49. package/css/utility.css +23 -3
  50. package/index.umd.min.js +11 -10
  51. package/index.umd.min.js.map +1 -1
  52. package/package.json +1 -1
  53. package/react/base/card.cjs.js +1 -1
  54. package/react/base/card.js +1 -1
  55. package/react/base/dropdown-list-element.cjs.js +2 -2
  56. package/react/base/dropdown-list-element.cjs.js.map +1 -1
  57. package/react/base/dropdown-list-element.js +2 -2
  58. package/react/base/dropdown-list-element.js.map +1 -1
  59. package/react/components/Checkbox/sgds-checkbox.cjs.js +17 -0
  60. package/react/components/Checkbox/sgds-checkbox.cjs.js.map +1 -1
  61. package/react/components/Checkbox/sgds-checkbox.js +17 -0
  62. package/react/components/Checkbox/sgds-checkbox.js.map +1 -1
  63. package/react/components/Dropdown/dropdown-item.cjs.js +1 -1
  64. package/react/components/Dropdown/dropdown-item.js +1 -1
  65. package/react/components/Dropdown/sgds-dropdown-item.cjs.js +0 -3
  66. package/react/components/Dropdown/sgds-dropdown-item.cjs.js.map +1 -1
  67. package/react/components/Dropdown/sgds-dropdown-item.js +0 -3
  68. package/react/components/Dropdown/sgds-dropdown-item.js.map +1 -1
  69. package/react/components/IconCard/icon-card.cjs.js +1 -1
  70. package/react/components/IconCard/icon-card.js +1 -1
  71. package/react/components/ImageCard/image-card.cjs.js +1 -1
  72. package/react/components/ImageCard/image-card.js +1 -1
  73. package/react/components/Masthead/masthead.cjs.js +1 -1
  74. package/react/components/Masthead/masthead.js +1 -1
  75. package/react/components/SystemBanner/sgds-system-banner-item.cjs.js +7 -2
  76. package/react/components/SystemBanner/sgds-system-banner-item.cjs.js.map +1 -1
  77. package/react/components/SystemBanner/sgds-system-banner-item.js +7 -2
  78. package/react/components/SystemBanner/sgds-system-banner-item.js.map +1 -1
  79. package/react/components/SystemBanner/system-banner-item.cjs.js +1 -1
  80. package/react/components/SystemBanner/system-banner-item.js +1 -1
  81. package/react/components/SystemBanner/system-banner.cjs.js +1 -1
  82. package/react/components/SystemBanner/system-banner.js +1 -1
  83. package/react/components/ThumbnailCard/thumbnail-card.cjs.js +1 -1
  84. package/react/components/ThumbnailCard/thumbnail-card.js +1 -1
  85. package/themes/day.css +1 -3
  86. package/themes/night.css +2 -2
@@ -62,6 +62,9 @@ export declare class SgdsCheckbox extends SgdsCheckbox_base implements SgdsFormC
62
62
  */
63
63
  get validationMessage(): string;
64
64
  firstUpdated(_changedProperties: any): void;
65
+ connectedCallback(): void;
66
+ disconnectedCallback(): void;
67
+ private _handleHostClick;
65
68
  render(): import("lit").TemplateResult<1>;
66
69
  }
67
70
  export default SgdsCheckbox;
@@ -36,6 +36,15 @@ class SgdsCheckbox extends SgdsFormValidatorMixin(FormControlElement) {
36
36
  /**Feedback text for error state when validated */
37
37
  this.invalidFeedback = "";
38
38
  this._isTouched = false;
39
+ // Delegates host-targeted clicks to the internal input so that clicking anywhere
40
+ // on the sgds-checkbox element (e.g. expanded padding inside sgds-dropdown-item) toggles
41
+ // the checkbox. Clicks already originating from inside the shadow DOM are left alone.
42
+ this._handleHostClick = (e) => {
43
+ if (e.composedPath()[0] === this) {
44
+ e.stopPropagation();
45
+ this.input.click();
46
+ }
47
+ };
39
48
  }
40
49
  /** Simulates a click on the checkbox. */
41
50
  click() {
@@ -122,6 +131,14 @@ class SgdsCheckbox extends SgdsFormValidatorMixin(FormControlElement) {
122
131
  super.firstUpdated(_changedProperties);
123
132
  this.checked && this.emit("sgds-check", { detail: { value: this.value } });
124
133
  }
134
+ connectedCallback() {
135
+ super.connectedCallback();
136
+ this.addEventListener("click", this._handleHostClick);
137
+ }
138
+ disconnectedCallback() {
139
+ super.disconnectedCallback();
140
+ this.removeEventListener("click", this._handleHostClick);
141
+ }
125
142
  render() {
126
143
  const displayFeedbackStyle = this.hasFeedback === "both" || this.hasFeedback === "style";
127
144
  const displayFeedbackText = this.hasFeedback === "both" || this.hasFeedback === "text";
@@ -1 +1 @@
1
- {"version":3,"file":"sgds-checkbox.js","sources":["../../../src/components/Checkbox/sgds-checkbox.ts"],"sourcesContent":["import { html, nothing } from \"lit\";\nimport { property, state } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\nimport { live } from \"lit/directives/live.js\";\nimport FormControlElement from \"../../base/form-control-element\";\nimport { defaultValue } from \"../../utils/defaultvalue\";\nimport { SgdsFormControl } from \"../../utils/formSubmitController\";\nimport { SgdsFormValidatorMixin } from \"../../utils/validatorMixin\";\nimport { watch } from \"../../utils/watch\";\nimport checkboxStyle from \"./checkbox.css\";\nimport formCheckStyles from \"../../styles/form-check.css\";\n\n/**\n * @summary Checkbox component is used when you require users to select multiple items from a list.\n *\n * @slot default - The label of checkbox.\n *\n * @event sgds-change - Emitted when the checked state changes.\n * @event sgds-blur - Emitted when input is not in focus.\n * @event sgds-focus - Emitted when input is in focus.\n * @event sgds-check - Emitted when checkbox is checked\n * @event sgds-uncheck - Emitted when checkbox is unchecked\n */\nexport class SgdsCheckbox extends SgdsFormValidatorMixin(FormControlElement) implements SgdsFormControl {\n static styles = [...FormControlElement.styles, formCheckStyles, checkboxStyle];\n\n /** Value of the HTML form control. Primarily used to differentiate a list of related checkboxes that have the same name. */\n @property({ type: String, reflect: true }) value: string;\n\n /** Draws the checkbox in a checked state. */\n @property({ type: Boolean, reflect: true }) checked = false;\n\n /** Allows invalidFeedback, invalid and valid styles to be visible with the input */\n @property({ type: String, reflect: true }) hasFeedback: \"style\" | \"text\" | \"both\";\n\n /** Gets or sets the default value used to reset this element. The initial value corresponds to the one originally specified in the HTML that created this element. */\n @defaultValue(\"checked\")\n defaultChecked = false;\n\n /** Marks the checkbox input as indeterminate , with indeterminate logo */\n @property({ type: Boolean, reflect: true }) indeterminate = false;\n\n /** Makes the checkbox a required field. */\n @property({ type: Boolean, reflect: true }) required = false;\n\n /**Feedback text for error state when validated */\n @property({ type: String, reflect: true }) invalidFeedback = \"\";\n\n @state() private _isTouched = false;\n\n /** Simulates a click on the checkbox. */\n public click() {\n this.input.click();\n }\n /** Sets focus on the checkbox. */\n public focus(options?: FocusOptions) {\n this.input.focus(options);\n }\n\n /** Removes focus from the checkbox. */\n public blur() {\n this.input.blur();\n }\n\n private _handleChange(e: Event) {\n if (this.indeterminate) {\n this.indeterminate = !this.indeterminate;\n }\n\n this.checked = !this.checked;\n super._mixinHandleChange(e);\n this.emit(\"sgds-change\", { detail: { checked: this.checked, value: this.value } });\n\n this.checked\n ? this.emit(\"sgds-check\", { detail: { value: this.value } })\n : this.emit(\"sgds-uncheck\", { detail: { value: this.value } });\n }\n\n private _handleKeyDown(event: KeyboardEvent) {\n const hasModifier = event.metaKey || event.ctrlKey || event.shiftKey || event.altKey;\n if (event.key === \"Enter\" && !hasModifier) {\n this.click();\n }\n }\n\n private _handleBlur() {\n this._isTouched = true;\n this.emit(\"sgds-blur\");\n }\n\n private _handleFocus() {\n this.emit(\"sgds-focus\");\n }\n\n private _handleInvalid(e: Event) {\n e.preventDefault();\n this.invalid = true;\n }\n\n /** @internal */\n @watch(\"disabled\", { waitUntilFirstUpdate: true })\n _handleDisabledChange() {\n // Disabled form controls are always valid, so we need to recheck validity when the state changes\n this.setInvalid(false);\n }\n\n @watch(\"_isTouched\", { waitUntilFirstUpdate: true })\n _handleIsTouched() {\n if (this._isTouched) {\n this.invalid = !this.input.checkValidity();\n }\n }\n\n private _mixinResetFormControl() {\n this._isTouched = false;\n this.checked = this.input.checked = this.defaultChecked;\n this.input.dispatchEvent(new InputEvent(\"reset\"));\n this._mixinResetValidity(this.input);\n }\n /**\n * Checks for validity. Under the hood, HTMLFormElement's reportValidity method calls this method to check for component's validity state\n * Note that the native error popup is prevented for SGDS form components by default. Instead the validation message shows up in the feedback container of SgdsInput\n */\n public reportValidity(): boolean {\n return this._mixinReportValidity();\n }\n /**\n * Checks for validity without any native error popup message\n */\n public checkValidity(): boolean {\n return this._mixinCheckValidity();\n }\n /**\n * Returns the ValidityState object\n */\n public get validity(): ValidityState {\n return this._mixinGetValidity();\n }\n /**\n * Returns the validation message based on the ValidityState\n */\n public get validationMessage() {\n return this._mixinGetValidationMessage();\n }\n\n firstUpdated(_changedProperties) {\n super.firstUpdated(_changedProperties);\n this.checked && this.emit(\"sgds-check\", { detail: { value: this.value } });\n }\n render() {\n const displayFeedbackStyle = this.hasFeedback === \"both\" || this.hasFeedback === \"style\";\n const displayFeedbackText = this.hasFeedback === \"both\" || this.hasFeedback === \"text\";\n\n return html`\n <div class=\"form-check\">\n <input\n class=${classMap({\n \"form-check-input\": true,\n \"is-invalid\": displayFeedbackStyle && this.invalid\n })}\n type=\"checkbox\"\n id=${this._controlId}\n aria-invalid=${this.invalid ? \"true\" : \"false\"}\n name=${ifDefined(this.name)}\n ?indeterminate=${this.indeterminate}\n ?required=${this.required}\n aria-disabled=${this.disabled ? \"true\" : \"false\"}\n aria-checked=${this.checked ? \"true\" : \"false\"}\n @change=${(e: Event) => this._handleChange(e)}\n @keydown=${this._handleKeyDown}\n @invalid=${(e: Event) => this._handleInvalid(e)}\n ?checked=${live(this.checked)}\n .disabled=${this.disabled}\n .required=${this.required}\n @blur=${this._handleBlur}\n @focus=${this._handleFocus}\n />\n <label for=\"${this._controlId}\" class=\"form-check-label\" id=\"${this._labelId}\"><slot></slot></label>\n </div>\n ${displayFeedbackText && this.invalid\n ? html`\n <div class=\"invalid-feedback-container\">\n <slot name=\"invalidIcon\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\">\n <path\n d=\"M17.5 10C17.5 14.1421 14.1421 17.5 10 17.5C5.85786 17.5 2.5 14.1421 2.5 10C2.5 5.85786 5.85786 2.5 10 2.5C14.1421 2.5 17.5 5.85786 17.5 10ZM10 6.25C9.49805 6.25 9.10584 6.68339 9.15578 7.18285L9.48461 10.4711C9.51109 10.7359 9.7339 10.9375 10 10.9375C10.2661 10.9375 10.4889 10.7359 10.5154 10.4711L10.8442 7.18285C10.8942 6.68339 10.5019 6.25 10 6.25ZM10.0014 11.875C9.48368 11.875 9.06394 12.2947 9.06394 12.8125C9.06394 13.3303 9.48368 13.75 10.0014 13.75C10.5192 13.75 10.9389 13.3303 10.9389 12.8125C10.9389 12.2947 10.5192 11.875 10.0014 11.875Z\"\n fill=\"currentColor\"\n />\n </svg>\n </slot>\n <div id=\"checkbox-feedback\" tabindex=\"0\" class=\"invalid-feedback\">\n ${this.invalidFeedback ? this.invalidFeedback : this.input.validationMessage}\n </div>\n </div>\n `\n : nothing}\n `;\n }\n}\n\nexport default SgdsCheckbox;\n"],"names":["formCheckStyles","checkboxStyle"],"mappings":";;;;;;;;;;;;;AAaA;;;;;;;;;;AAUG;MACU,YAAa,SAAQ,sBAAsB,CAAC,kBAAkB,CAAC,CAAA;AAA5E,IAAA,WAAA,GAAA;;;QAO8C,IAAO,CAAA,OAAA,GAAG,KAAK,CAAC;;QAO5D,IAAc,CAAA,cAAA,GAAG,KAAK,CAAC;;QAGqB,IAAa,CAAA,aAAA,GAAG,KAAK,CAAC;;QAGtB,IAAQ,CAAA,QAAA,GAAG,KAAK,CAAC;;QAGlB,IAAe,CAAA,eAAA,GAAG,EAAE,CAAC;QAE/C,IAAU,CAAA,UAAA,GAAG,KAAK,CAAC;KAsJrC;;IAnJQ,KAAK,GAAA;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Y,CAAC,SAAS,CAAC;AACD,CAAA,EAAA,YAAA,CAAA,SAAA,EAAA,gBAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAGqB,UAAA,CAAA;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AAAuB,CAAA,EAAA,YAAA,CAAA,SAAA,EAAA,eAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAGtB,UAAA,CAAA;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AAAkB,CAAA,EAAA,YAAA,CAAA,SAAA,EAAA,UAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAGlB,UAAA,CAAA;IAA1C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AAAsB,CAAA,EAAA,YAAA,CAAA,SAAA,EAAA,iBAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAE/C,UAAA,CAAA;AAAhB,IAAA,KAAK,EAAE;AAA4B,CAAA,EAAA,YAAA,CAAA,SAAA,EAAA,YAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAqDpC,UAAA,CAAA;IADC,KAAK,CAAC,UAAU,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;AAIjD,CAAA,EAAA,YAAA,CAAA,SAAA,EAAA,uBAAA,EAAA,IAAA,CAAA,CAAA;AAGD,UAAA,CAAA;IADC,KAAK,CAAC,YAAY,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;AAKnD,CAAA,EAAA,YAAA,CAAA,SAAA,EAAA,kBAAA,EAAA,IAAA,CAAA;;;;"}
1
+ {"version":3,"file":"sgds-checkbox.js","sources":["../../../src/components/Checkbox/sgds-checkbox.ts"],"sourcesContent":["import { html, nothing } from \"lit\";\nimport { property, state } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\nimport { live } from \"lit/directives/live.js\";\nimport FormControlElement from \"../../base/form-control-element\";\nimport { defaultValue } from \"../../utils/defaultvalue\";\nimport { SgdsFormControl } from \"../../utils/formSubmitController\";\nimport { SgdsFormValidatorMixin } from \"../../utils/validatorMixin\";\nimport { watch } from \"../../utils/watch\";\nimport checkboxStyle from \"./checkbox.css\";\nimport formCheckStyles from \"../../styles/form-check.css\";\n\n/**\n * @summary Checkbox component is used when you require users to select multiple items from a list.\n *\n * @slot default - The label of checkbox.\n *\n * @event sgds-change - Emitted when the checked state changes.\n * @event sgds-blur - Emitted when input is not in focus.\n * @event sgds-focus - Emitted when input is in focus.\n * @event sgds-check - Emitted when checkbox is checked\n * @event sgds-uncheck - Emitted when checkbox is unchecked\n */\nexport class SgdsCheckbox extends SgdsFormValidatorMixin(FormControlElement) implements SgdsFormControl {\n static styles = [...FormControlElement.styles, formCheckStyles, checkboxStyle];\n\n /** Value of the HTML form control. Primarily used to differentiate a list of related checkboxes that have the same name. */\n @property({ type: String, reflect: true }) value: string;\n\n /** Draws the checkbox in a checked state. */\n @property({ type: Boolean, reflect: true }) checked = false;\n\n /** Allows invalidFeedback, invalid and valid styles to be visible with the input */\n @property({ type: String, reflect: true }) hasFeedback: \"style\" | \"text\" | \"both\";\n\n /** Gets or sets the default value used to reset this element. The initial value corresponds to the one originally specified in the HTML that created this element. */\n @defaultValue(\"checked\")\n defaultChecked = false;\n\n /** Marks the checkbox input as indeterminate , with indeterminate logo */\n @property({ type: Boolean, reflect: true }) indeterminate = false;\n\n /** Makes the checkbox a required field. */\n @property({ type: Boolean, reflect: true }) required = false;\n\n /**Feedback text for error state when validated */\n @property({ type: String, reflect: true }) invalidFeedback = \"\";\n\n @state() private _isTouched = false;\n\n /** Simulates a click on the checkbox. */\n public click() {\n this.input.click();\n }\n /** Sets focus on the checkbox. */\n public focus(options?: FocusOptions) {\n this.input.focus(options);\n }\n\n /** Removes focus from the checkbox. */\n public blur() {\n this.input.blur();\n }\n\n private _handleChange(e: Event) {\n if (this.indeterminate) {\n this.indeterminate = !this.indeterminate;\n }\n\n this.checked = !this.checked;\n super._mixinHandleChange(e);\n this.emit(\"sgds-change\", { detail: { checked: this.checked, value: this.value } });\n\n this.checked\n ? this.emit(\"sgds-check\", { detail: { value: this.value } })\n : this.emit(\"sgds-uncheck\", { detail: { value: this.value } });\n }\n\n private _handleKeyDown(event: KeyboardEvent) {\n const hasModifier = event.metaKey || event.ctrlKey || event.shiftKey || event.altKey;\n if (event.key === \"Enter\" && !hasModifier) {\n this.click();\n }\n }\n\n private _handleBlur() {\n this._isTouched = true;\n this.emit(\"sgds-blur\");\n }\n\n private _handleFocus() {\n this.emit(\"sgds-focus\");\n }\n\n private _handleInvalid(e: Event) {\n e.preventDefault();\n this.invalid = true;\n }\n\n /** @internal */\n @watch(\"disabled\", { waitUntilFirstUpdate: true })\n _handleDisabledChange() {\n // Disabled form controls are always valid, so we need to recheck validity when the state changes\n this.setInvalid(false);\n }\n\n @watch(\"_isTouched\", { waitUntilFirstUpdate: true })\n _handleIsTouched() {\n if (this._isTouched) {\n this.invalid = !this.input.checkValidity();\n }\n }\n\n private _mixinResetFormControl() {\n this._isTouched = false;\n this.checked = this.input.checked = this.defaultChecked;\n this.input.dispatchEvent(new InputEvent(\"reset\"));\n this._mixinResetValidity(this.input);\n }\n /**\n * Checks for validity. Under the hood, HTMLFormElement's reportValidity method calls this method to check for component's validity state\n * Note that the native error popup is prevented for SGDS form components by default. Instead the validation message shows up in the feedback container of SgdsInput\n */\n public reportValidity(): boolean {\n return this._mixinReportValidity();\n }\n /**\n * Checks for validity without any native error popup message\n */\n public checkValidity(): boolean {\n return this._mixinCheckValidity();\n }\n /**\n * Returns the ValidityState object\n */\n public get validity(): ValidityState {\n return this._mixinGetValidity();\n }\n /**\n * Returns the validation message based on the ValidityState\n */\n public get validationMessage() {\n return this._mixinGetValidationMessage();\n }\n\n firstUpdated(_changedProperties) {\n super.firstUpdated(_changedProperties);\n this.checked && this.emit(\"sgds-check\", { detail: { value: this.value } });\n }\n\n connectedCallback(): void {\n super.connectedCallback();\n this.addEventListener(\"click\", this._handleHostClick);\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n this.removeEventListener(\"click\", this._handleHostClick);\n }\n\n // Delegates host-targeted clicks to the internal input so that clicking anywhere\n // on the sgds-checkbox element (e.g. expanded padding inside sgds-dropdown-item) toggles\n // the checkbox. Clicks already originating from inside the shadow DOM are left alone.\n private _handleHostClick = (e: Event) => {\n if (e.composedPath()[0] === this) {\n e.stopPropagation();\n this.input.click();\n }\n };\n render() {\n const displayFeedbackStyle = this.hasFeedback === \"both\" || this.hasFeedback === \"style\";\n const displayFeedbackText = this.hasFeedback === \"both\" || this.hasFeedback === \"text\";\n\n return html`\n <div class=\"form-check\">\n <input\n class=${classMap({\n \"form-check-input\": true,\n \"is-invalid\": displayFeedbackStyle && this.invalid\n })}\n type=\"checkbox\"\n id=${this._controlId}\n aria-invalid=${this.invalid ? \"true\" : \"false\"}\n name=${ifDefined(this.name)}\n ?indeterminate=${this.indeterminate}\n ?required=${this.required}\n aria-disabled=${this.disabled ? \"true\" : \"false\"}\n aria-checked=${this.checked ? \"true\" : \"false\"}\n @change=${(e: Event) => this._handleChange(e)}\n @keydown=${this._handleKeyDown}\n @invalid=${(e: Event) => this._handleInvalid(e)}\n ?checked=${live(this.checked)}\n .disabled=${this.disabled}\n .required=${this.required}\n @blur=${this._handleBlur}\n @focus=${this._handleFocus}\n />\n <label for=\"${this._controlId}\" class=\"form-check-label\" id=\"${this._labelId}\"><slot></slot></label>\n </div>\n ${displayFeedbackText && this.invalid\n ? html`\n <div class=\"invalid-feedback-container\">\n <slot name=\"invalidIcon\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\">\n <path\n d=\"M17.5 10C17.5 14.1421 14.1421 17.5 10 17.5C5.85786 17.5 2.5 14.1421 2.5 10C2.5 5.85786 5.85786 2.5 10 2.5C14.1421 2.5 17.5 5.85786 17.5 10ZM10 6.25C9.49805 6.25 9.10584 6.68339 9.15578 7.18285L9.48461 10.4711C9.51109 10.7359 9.7339 10.9375 10 10.9375C10.2661 10.9375 10.4889 10.7359 10.5154 10.4711L10.8442 7.18285C10.8942 6.68339 10.5019 6.25 10 6.25ZM10.0014 11.875C9.48368 11.875 9.06394 12.2947 9.06394 12.8125C9.06394 13.3303 9.48368 13.75 10.0014 13.75C10.5192 13.75 10.9389 13.3303 10.9389 12.8125C10.9389 12.2947 10.5192 11.875 10.0014 11.875Z\"\n fill=\"currentColor\"\n />\n </svg>\n </slot>\n <div id=\"checkbox-feedback\" tabindex=\"0\" class=\"invalid-feedback\">\n ${this.invalidFeedback ? this.invalidFeedback : this.input.validationMessage}\n </div>\n </div>\n `\n : nothing}\n `;\n }\n}\n\nexport default SgdsCheckbox;\n"],"names":["formCheckStyles","checkboxStyle"],"mappings":";;;;;;;;;;;;;AAaA;;;;;;;;;;AAUG;MACU,YAAa,SAAQ,sBAAsB,CAAC,kBAAkB,CAAC,CAAA;AAA5E,IAAA,WAAA,GAAA;;;QAO8C,IAAO,CAAA,OAAA,GAAG,KAAK,CAAC;;QAO5D,IAAc,CAAA,cAAA,GAAG,KAAK,CAAC;;QAGqB,IAAa,CAAA,aAAA,GAAG,KAAK,CAAC;;QAGtB,IAAQ,CAAA,QAAA,GAAG,KAAK,CAAC;;QAGlB,IAAe,CAAA,eAAA,GAAG,EAAE,CAAC;QAE/C,IAAU,CAAA,UAAA,GAAG,KAAK,CAAC;;;;AAmH5B,QAAA,IAAA,CAAA,gBAAgB,GAAG,CAAC,CAAQ,KAAI;YACtC,IAAI,CAAC,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE;gBAChC,CAAC,CAAC,eAAe,EAAE,CAAC;AACpB,gBAAA,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;aACpB;AACH,SAAC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,CAAA,CAAA;AAGD,UAAA,CAAA;IADC,KAAK,CAAC,YAAY,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;AAKnD,CAAA,EAAA,YAAA,CAAA,SAAA,EAAA,kBAAA,EAAA,IAAA,CAAA;;;;"}
@@ -78,7 +78,7 @@ function Ge(e){return(t,i)=>je(t,i,{async get(){return await this.updateComplete
78
78
  * @license
79
79
  * Copyright 2020 Google LLC
80
80
  * SPDX-License-Identifier: BSD-3-Clause
81
- */const st=()=>new nt;class nt{}const rt=new WeakMap;const ct=te(class extends ot{render(e){return A}update(e,[t]){const i=t!==this._ref;return i&&void 0!==this._ref&&this._updateRefValue(void 0),(i||this._lastElementForRef!==this._element)&&(this._ref=t,this._context=e.options?.host,this._updateRefValue(this._element=e.element)),A}_updateRefValue(e){if(this.isConnected||(e=void 0),"function"==typeof this._ref){const t=this._context??globalThis;let i=rt.get(t);void 0===i&&(i=new WeakMap,rt.set(t,i)),void 0!==i.get(this._ref)&&this._ref.call(this._context,void 0),i.set(this._ref,e),void 0!==e&&this._ref.call(this._context,e)}else this._ref.value=e}get _lastElementForRef(){return"function"==typeof this._ref?rt.get(this._context??globalThis)?.get(this._ref):this._ref?.value}disconnected(){this._lastElementForRef===this._element&&this._updateRefValue(void 0)}reconnected(){this._updateRefValue(this._element)}}),dt=["top","right","bottom","left"],ht=Math.min,vt=Math.max,ut=Math.round,pt=Math.floor,gt=e=>({x:e,y:e}),ft={left:"right",right:"left",bottom:"top",top:"bottom"},mt={start:"end",end:"start"};function wt(e,t,i){return vt(e,ht(t,i))}function bt(e,t){return"function"==typeof e?e(t):e}function xt(e){return e.split("-")[0]}function yt(e){return e.split("-")[1]}function Ct(e){return"x"===e?"y":"x"}function Zt(e){return"y"===e?"height":"width"}const _t=new Set(["top","bottom"]);function Mt(e){return _t.has(xt(e))?"y":"x"}function Vt(e){return Ct(Mt(e))}function kt(e,t,i){void 0===i&&(i=!1);const l=yt(e),a=Vt(e),o=Zt(a);let s="x"===a?l===(i?"end":"start")?"right":"left":"start"===l?"bottom":"top";return t.reference[o]>t.floating[o]&&(s=Et(s)),[s,Et(s)]}function Ht(e){return e.replace(/start|end/g,e=>mt[e])}const $t=["left","right"],St=["right","left"],Bt=["top","bottom"],Lt=["bottom","top"];function At(e,t,i,l){const a=yt(e);let o=function(e,t,i){switch(e){case"top":case"bottom":return i?t?St:$t:t?$t:St;case"left":case"right":return t?Bt:Lt;default:return[]}}(xt(e),"start"===i,l);return a&&(o=o.map(e=>e+"-"+a),t&&(o=o.concat(o.map(Ht)))),o}function Et(e){return e.replace(/left|right|bottom|top/g,e=>ft[e])}function It(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function Tt(e){const{x:t,y:i,width:l,height:a}=e;return{width:l,height:a,top:i,left:t,right:t+l,bottom:i+a,x:t,y:i}}function Pt(e,t,i){let{reference:l,floating:a}=e;const o=Mt(t),s=Vt(t),n=Zt(s),r=xt(t),c="y"===o,d=l.x+l.width/2-a.width/2,h=l.y+l.height/2-a.height/2,v=l[n]/2-a[n]/2;let u;switch(r){case"top":u={x:d,y:l.y-a.height};break;case"bottom":u={x:d,y:l.y+l.height};break;case"right":u={x:l.x+l.width,y:h};break;case"left":u={x:l.x-a.width,y:h};break;default:u={x:l.x,y:l.y}}switch(yt(t)){case"start":u[s]-=v*(i&&c?-1:1);break;case"end":u[s]+=v*(i&&c?-1:1)}return u}async function Rt(e,t){var i;void 0===t&&(t={});const{x:l,y:a,platform:o,rects:s,elements:n,strategy:r}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:h="floating",altBoundary:v=!1,padding:u=0}=bt(t,e),p=It(u),g=n[v?"floating"===h?"reference":"floating":h],f=Tt(await o.getClippingRect({element:null==(i=await(null==o.isElement?void 0:o.isElement(g)))||i?g:g.contextElement||await(null==o.getDocumentElement?void 0:o.getDocumentElement(n.floating)),boundary:c,rootBoundary:d,strategy:r})),m="floating"===h?{x:l,y:a,width:s.floating.width,height:s.floating.height}:s.reference,w=await(null==o.getOffsetParent?void 0:o.getOffsetParent(n.floating)),b=await(null==o.isElement?void 0:o.isElement(w))&&await(null==o.getScale?void 0:o.getScale(w))||{x:1,y:1},x=Tt(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:n,rect:m,offsetParent:w,strategy:r}):m);return{top:(f.top-x.top+p.top)/b.y,bottom:(x.bottom-f.bottom+p.bottom)/b.y,left:(f.left-x.left+p.left)/b.x,right:(x.right-f.right+p.right)/b.x}}function Ot(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function zt(e){return dt.some(t=>e[t]>=0)}const Dt=new Set(["left","top"]);function Ut(){return"undefined"!=typeof window}function Ft(e){return qt(e)?(e.nodeName||"").toLowerCase():"#document"}function Nt(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Wt(e){var t;return null==(t=(qt(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function qt(e){return!!Ut()&&(e instanceof Node||e instanceof Nt(e).Node)}function jt(e){return!!Ut()&&(e instanceof Element||e instanceof Nt(e).Element)}function Kt(e){return!!Ut()&&(e instanceof HTMLElement||e instanceof Nt(e).HTMLElement)}function Gt(e){return!(!Ut()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof Nt(e).ShadowRoot)}const Jt=new Set(["inline","contents"]);function Xt(e){const{overflow:t,overflowX:i,overflowY:l,display:a}=ci(e);return/auto|scroll|overlay|hidden|clip/.test(t+l+i)&&!Jt.has(a)}const Yt=new Set(["table","td","th"]);function Qt(e){return Yt.has(Ft(e))}const ei=[":popover-open",":modal"];function ti(e){return ei.some(t=>{try{return e.matches(t)}catch(e){return!1}})}const ii=["transform","translate","scale","rotate","perspective"],li=["transform","translate","scale","rotate","perspective","filter"],ai=["paint","layout","strict","content"];function oi(e){const t=si(),i=jt(e)?ci(e):e;return ii.some(e=>!!i[e]&&"none"!==i[e])||!!i.containerType&&"normal"!==i.containerType||!t&&!!i.backdropFilter&&"none"!==i.backdropFilter||!t&&!!i.filter&&"none"!==i.filter||li.some(e=>(i.willChange||"").includes(e))||ai.some(e=>(i.contain||"").includes(e))}function si(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const ni=new Set(["html","body","#document"]);function ri(e){return ni.has(Ft(e))}function ci(e){return Nt(e).getComputedStyle(e)}function di(e){return jt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function hi(e){if("html"===Ft(e))return e;const t=e.assignedSlot||e.parentNode||Gt(e)&&e.host||Wt(e);return Gt(t)?t.host:t}function vi(e){const t=hi(e);return ri(t)?e.ownerDocument?e.ownerDocument.body:e.body:Kt(t)&&Xt(t)?t:vi(t)}function ui(e,t,i){var l;void 0===t&&(t=[]),void 0===i&&(i=!0);const a=vi(e),o=a===(null==(l=e.ownerDocument)?void 0:l.body),s=Nt(a);if(o){const e=pi(s);return t.concat(s,s.visualViewport||[],Xt(a)?a:[],e&&i?ui(e):[])}return t.concat(a,ui(a,[],i))}function pi(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function gi(e){const t=ci(e);let i=parseFloat(t.width)||0,l=parseFloat(t.height)||0;const a=Kt(e),o=a?e.offsetWidth:i,s=a?e.offsetHeight:l,n=ut(i)!==o||ut(l)!==s;return n&&(i=o,l=s),{width:i,height:l,$:n}}function fi(e){return jt(e)?e:e.contextElement}function mi(e){const t=fi(e);if(!Kt(t))return gt(1);const i=t.getBoundingClientRect(),{width:l,height:a,$:o}=gi(t);let s=(o?ut(i.width):i.width)/l,n=(o?ut(i.height):i.height)/a;return s&&Number.isFinite(s)||(s=1),n&&Number.isFinite(n)||(n=1),{x:s,y:n}}const wi=gt(0);function bi(e){const t=Nt(e);return si()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:wi}function xi(e,t,i,l){void 0===t&&(t=!1),void 0===i&&(i=!1);const a=e.getBoundingClientRect(),o=fi(e);let s=gt(1);t&&(l?jt(l)&&(s=mi(l)):s=mi(e));const n=function(e,t,i){return void 0===t&&(t=!1),!(!i||t&&i!==Nt(e))&&t}(o,i,l)?bi(o):gt(0);let r=(a.left+n.x)/s.x,c=(a.top+n.y)/s.y,d=a.width/s.x,h=a.height/s.y;if(o){const e=Nt(o),t=l&&jt(l)?Nt(l):l;let i=e,a=pi(i);for(;a&&l&&t!==i;){const e=mi(a),t=a.getBoundingClientRect(),l=ci(a),o=t.left+(a.clientLeft+parseFloat(l.paddingLeft))*e.x,s=t.top+(a.clientTop+parseFloat(l.paddingTop))*e.y;r*=e.x,c*=e.y,d*=e.x,h*=e.y,r+=o,c+=s,i=Nt(a),a=pi(i)}}return Tt({width:d,height:h,x:r,y:c})}function yi(e,t){const i=di(e).scrollLeft;return t?t.left+i:xi(Wt(e)).left+i}function Ci(e,t){const i=e.getBoundingClientRect();return{x:i.left+t.scrollLeft-yi(e,i),y:i.top+t.scrollTop}}const Zi=new Set(["absolute","fixed"]);function _i(e,t,i){let l;if("viewport"===t)l=function(e,t){const i=Nt(e),l=Wt(e),a=i.visualViewport;let o=l.clientWidth,s=l.clientHeight,n=0,r=0;if(a){o=a.width,s=a.height;const e=si();(!e||e&&"fixed"===t)&&(n=a.offsetLeft,r=a.offsetTop)}const c=yi(l);if(c<=0){const e=l.ownerDocument,t=e.body,i=getComputedStyle(t),a="CSS1Compat"===e.compatMode&&parseFloat(i.marginLeft)+parseFloat(i.marginRight)||0,s=Math.abs(l.clientWidth-t.clientWidth-a);s<=25&&(o-=s)}else c<=25&&(o+=c);return{width:o,height:s,x:n,y:r}}(e,i);else if("document"===t)l=function(e){const t=Wt(e),i=di(e),l=e.ownerDocument.body,a=vt(t.scrollWidth,t.clientWidth,l.scrollWidth,l.clientWidth),o=vt(t.scrollHeight,t.clientHeight,l.scrollHeight,l.clientHeight);let s=-i.scrollLeft+yi(e);const n=-i.scrollTop;return"rtl"===ci(l).direction&&(s+=vt(t.clientWidth,l.clientWidth)-a),{width:a,height:o,x:s,y:n}}(Wt(e));else if(jt(t))l=function(e,t){const i=xi(e,!0,"fixed"===t),l=i.top+e.clientTop,a=i.left+e.clientLeft,o=Kt(e)?mi(e):gt(1);return{width:e.clientWidth*o.x,height:e.clientHeight*o.y,x:a*o.x,y:l*o.y}}(t,i);else{const i=bi(e);l={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Tt(l)}function Mi(e,t){const i=hi(e);return!(i===t||!jt(i)||ri(i))&&("fixed"===ci(i).position||Mi(i,t))}function Vi(e,t,i){const l=Kt(t),a=Wt(t),o="fixed"===i,s=xi(e,!0,o,t);let n={scrollLeft:0,scrollTop:0};const r=gt(0);function c(){r.x=yi(a)}if(l||!l&&!o)if(("body"!==Ft(t)||Xt(a))&&(n=di(t)),l){const e=xi(t,!0,o,t);r.x=e.x+t.clientLeft,r.y=e.y+t.clientTop}else a&&c();o&&!l&&a&&c();const d=!a||l||o?gt(0):Ci(a,n);return{x:s.left+n.scrollLeft-r.x-d.x,y:s.top+n.scrollTop-r.y-d.y,width:s.width,height:s.height}}function ki(e){return"static"===ci(e).position}function Hi(e,t){if(!Kt(e)||"fixed"===ci(e).position)return null;if(t)return t(e);let i=e.offsetParent;return Wt(e)===i&&(i=i.ownerDocument.body),i}function $i(e,t){const i=Nt(e);if(ti(e))return i;if(!Kt(e)){let t=hi(e);for(;t&&!ri(t);){if(jt(t)&&!ki(t))return t;t=hi(t)}return i}let l=Hi(e,t);for(;l&&Qt(l)&&ki(l);)l=Hi(l,t);return l&&ri(l)&&ki(l)&&!oi(l)?i:l||function(e){let t=hi(e);for(;Kt(t)&&!ri(t);){if(oi(t))return t;if(ti(t))return null;t=hi(t)}return null}(e)||i}const Si={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:i,offsetParent:l,strategy:a}=e;const o="fixed"===a,s=Wt(l),n=!!t&&ti(t.floating);if(l===s||n&&o)return i;let r={scrollLeft:0,scrollTop:0},c=gt(1);const d=gt(0),h=Kt(l);if((h||!h&&!o)&&(("body"!==Ft(l)||Xt(s))&&(r=di(l)),Kt(l))){const e=xi(l);c=mi(l),d.x=e.x+l.clientLeft,d.y=e.y+l.clientTop}const v=!s||h||o?gt(0):Ci(s,r);return{width:i.width*c.x,height:i.height*c.y,x:i.x*c.x-r.scrollLeft*c.x+d.x+v.x,y:i.y*c.y-r.scrollTop*c.y+d.y+v.y}},getDocumentElement:Wt,getClippingRect:function(e){let{element:t,boundary:i,rootBoundary:l,strategy:a}=e;const o=[..."clippingAncestors"===i?ti(t)?[]:function(e,t){const i=t.get(e);if(i)return i;let l=ui(e,[],!1).filter(e=>jt(e)&&"body"!==Ft(e)),a=null;const o="fixed"===ci(e).position;let s=o?hi(e):e;for(;jt(s)&&!ri(s);){const t=ci(s),i=oi(s);i||"fixed"!==t.position||(a=null),(o?!i&&!a:!i&&"static"===t.position&&a&&Zi.has(a.position)||Xt(s)&&!i&&Mi(e,s))?l=l.filter(e=>e!==s):a=t,s=hi(s)}return t.set(e,l),l}(t,this._c):[].concat(i),l],s=o[0],n=o.reduce((e,i)=>{const l=_i(t,i,a);return e.top=vt(l.top,e.top),e.right=ht(l.right,e.right),e.bottom=ht(l.bottom,e.bottom),e.left=vt(l.left,e.left),e},_i(t,s,a));return{width:n.right-n.left,height:n.bottom-n.top,x:n.left,y:n.top}},getOffsetParent:$i,getElementRects:async function(e){const t=this.getOffsetParent||$i,i=this.getDimensions,l=await i(e.floating);return{reference:Vi(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:l.width,height:l.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:i}=gi(e);return{width:t,height:i}},getScale:mi,isElement:jt,isRTL:function(e){return"rtl"===ci(e).direction}};function Bi(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Li(e,t,i,l){void 0===l&&(l={});const{ancestorScroll:a=!0,ancestorResize:o=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:n="function"==typeof IntersectionObserver,animationFrame:r=!1}=l,c=fi(e),d=a||o?[...c?ui(c):[],...ui(t)]:[];d.forEach(e=>{a&&e.addEventListener("scroll",i,{passive:!0}),o&&e.addEventListener("resize",i)});const h=c&&n?function(e,t){let i,l=null;const a=Wt(e);function o(){var e;clearTimeout(i),null==(e=l)||e.disconnect(),l=null}return function s(n,r){void 0===n&&(n=!1),void 0===r&&(r=1),o();const c=e.getBoundingClientRect(),{left:d,top:h,width:v,height:u}=c;if(n||t(),!v||!u)return;const p={rootMargin:-pt(h)+"px "+-pt(a.clientWidth-(d+v))+"px "+-pt(a.clientHeight-(h+u))+"px "+-pt(d)+"px",threshold:vt(0,ht(1,r))||1};let g=!0;function f(t){const l=t[0].intersectionRatio;if(l!==r){if(!g)return s();l?s(!1,l):i=setTimeout(()=>{s(!1,1e-7)},1e3)}1!==l||Bi(c,e.getBoundingClientRect())||s(),g=!1}try{l=new IntersectionObserver(f,{...p,root:a.ownerDocument})}catch(e){l=new IntersectionObserver(f,p)}l.observe(e)}(!0),o}(c,i):null;let v,u=-1,p=null;s&&(p=new ResizeObserver(e=>{let[l]=e;l&&l.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(u),u=requestAnimationFrame(()=>{var e;null==(e=p)||e.observe(t)})),i()}),c&&!r&&p.observe(c),p.observe(t));let g=r?xi(e):null;return r&&function t(){const l=xi(e);g&&!Bi(g,l)&&i();g=l,v=requestAnimationFrame(t)}(),i(),()=>{var e;d.forEach(e=>{a&&e.removeEventListener("scroll",i),o&&e.removeEventListener("resize",i)}),null==h||h(),null==(e=p)||e.disconnect(),p=null,r&&cancelAnimationFrame(v)}}const Ai=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var i,l;const{x:a,y:o,placement:s,middlewareData:n}=t,r=await async function(e,t){const{placement:i,platform:l,elements:a}=e,o=await(null==l.isRTL?void 0:l.isRTL(a.floating)),s=xt(i),n=yt(i),r="y"===Mt(i),c=Dt.has(s)?-1:1,d=o&&r?-1:1,h=bt(t,e);let{mainAxis:v,crossAxis:u,alignmentAxis:p}="number"==typeof h?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return n&&"number"==typeof p&&(u="end"===n?-1*p:p),r?{x:u*d,y:v*c}:{x:v*c,y:u*d}}(t,e);return s===(null==(i=n.offset)?void 0:i.placement)&&null!=(l=n.arrow)&&l.alignmentOffset?{}:{x:a+r.x,y:o+r.y,data:{...r,placement:s}}}}},Ei=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:i,y:l,placement:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:n={fn:e=>{let{x:t,y:i}=e;return{x:t,y:i}}},...r}=bt(e,t),c={x:i,y:l},d=await Rt(t,r),h=Mt(xt(a)),v=Ct(h);let u=c[v],p=c[h];if(o){const e="y"===v?"bottom":"right";u=wt(u+d["y"===v?"top":"left"],u,u-d[e])}if(s){const e="y"===h?"bottom":"right";p=wt(p+d["y"===h?"top":"left"],p,p-d[e])}const g=n.fn({...t,[v]:u,[h]:p});return{...g,data:{x:g.x-i,y:g.y-l,enabled:{[v]:o,[h]:s}}}}}},Ii=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var i,l;const{placement:a,middlewareData:o,rects:s,initialPlacement:n,platform:r,elements:c}=t,{mainAxis:d=!0,crossAxis:h=!0,fallbackPlacements:v,fallbackStrategy:u="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:g=!0,...f}=bt(e,t);if(null!=(i=o.arrow)&&i.alignmentOffset)return{};const m=xt(a),w=Mt(n),b=xt(n)===n,x=await(null==r.isRTL?void 0:r.isRTL(c.floating)),y=v||(b||!g?[Et(n)]:function(e){const t=Et(e);return[Ht(e),t,Ht(t)]}(n)),C="none"!==p;!v&&C&&y.push(...At(n,g,p,x));const Z=[n,...y],_=await Rt(t,f),M=[];let V=(null==(l=o.flip)?void 0:l.overflows)||[];if(d&&M.push(_[m]),h){const e=kt(a,s,x);M.push(_[e[0]],_[e[1]])}if(V=[...V,{placement:a,overflows:M}],!M.every(e=>e<=0)){var k,H;const e=((null==(k=o.flip)?void 0:k.index)||0)+1,t=Z[e];if(t){if(!("alignment"===h&&w!==Mt(t))||V.every(e=>Mt(e.placement)!==w||e.overflows[0]>0))return{data:{index:e,overflows:V},reset:{placement:t}}}let i=null==(H=V.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:H.placement;if(!i)switch(u){case"bestFit":{var $;const e=null==($=V.filter(e=>{if(C){const t=Mt(e.placement);return t===w||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:$[0];e&&(i=e);break}case"initialPlacement":i=n}if(a!==i)return{reset:{placement:i}}}return{}}}},Ti=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var i,l;const{placement:a,rects:o,platform:s,elements:n}=t,{apply:r=()=>{},...c}=bt(e,t),d=await Rt(t,c),h=xt(a),v=yt(a),u="y"===Mt(a),{width:p,height:g}=o.floating;let f,m;"top"===h||"bottom"===h?(f=h,m=v===(await(null==s.isRTL?void 0:s.isRTL(n.floating))?"start":"end")?"left":"right"):(m=h,f="end"===v?"top":"bottom");const w=g-d.top-d.bottom,b=p-d.left-d.right,x=ht(g-d[f],w),y=ht(p-d[m],b),C=!t.middlewareData.shift;let Z=x,_=y;if(null!=(i=t.middlewareData.shift)&&i.enabled.x&&(_=b),null!=(l=t.middlewareData.shift)&&l.enabled.y&&(Z=w),C&&!v){const e=vt(d.left,0),t=vt(d.right,0),i=vt(d.top,0),l=vt(d.bottom,0);u?_=p-2*(0!==e||0!==t?e+t:vt(d.left,d.right)):Z=g-2*(0!==i||0!==l?i+l:vt(d.top,d.bottom))}await r({...t,availableWidth:_,availableHeight:Z});const M=await s.getDimensions(n.floating);return p!==M.width||g!==M.height?{reset:{rects:!0}}:{}}}},Pi=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:i}=t,{strategy:l="referenceHidden",...a}=bt(e,t);switch(l){case"referenceHidden":{const e=Ot(await Rt(t,{...a,elementContext:"reference"}),i.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:zt(e)}}}case"escaped":{const e=Ot(await Rt(t,{...a,altBoundary:!0}),i.floating);return{data:{escapedOffsets:e,escaped:zt(e)}}}default:return{}}}}},Ri=(e,t,i)=>{const l=new Map,a={platform:Si,...i},o={...a.platform,_c:l};return(async(e,t,i)=>{const{placement:l="bottom",strategy:a="absolute",middleware:o=[],platform:s}=i,n=o.filter(Boolean),r=await(null==s.isRTL?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:a}),{x:d,y:h}=Pt(c,l,r),v=l,u={},p=0;for(let i=0;i<n.length;i++){const{name:o,fn:g}=n[i],{x:f,y:m,data:w,reset:b}=await g({x:d,y:h,initialPlacement:l,placement:v,strategy:a,middlewareData:u,rects:c,platform:s,elements:{reference:e,floating:t}});d=null!=f?f:d,h=null!=m?m:h,u={...u,[o]:{...u[o],...w}},b&&p<=50&&(p++,"object"==typeof b&&(b.placement&&(v=b.placement),b.rects&&(c=!0===b.rects?await s.getElementRects({reference:e,floating:t,strategy:a}):b.rects),({x:d,y:h}=Pt(c,v,r))),i=-1)}return{x:d,y:h,placement:v,strategy:a,middlewareData:u}})(e,t,{...a,platform:o})};var Oi=we`:host([menuisopen]) .dropdown-menu{display:block}.dropdown-menu{background-clip:padding-box;background-color:var(--sgds-surface-default);border-radius:var(--sgds-border-radius-md);box-shadow:0 0 1px 0 hsla(0,0%,5%,.12),0 4px 8px 0 hsla(0,0%,5%,.12);color:var(--sgds-color-default);display:none;list-style:none;margin:0;max-height:var(--sgds-dimension-480);min-width:var(--sgds-dimension-280);overflow-y:auto;padding:var(--sgds-padding-xs) 0;position:absolute;text-align:left;z-index:1050}.nav-tabs .dropdown-menu{border-top-left-radius:0;border-top-right-radius:0;margin-top:calc(var(--sgds-nav-tabs-border-width)*-1)}@media (min-width:512px){.navbar-expand-sm .navbar-nav .dropdown-menu{position:absolute}}@media (min-width:768px){.navbar-expand-md .navbar-nav .dropdown-menu{position:absolute}}@media (min-width:1024px){.navbar-expand-lg .navbar-nav .dropdown-menu{position:absolute}}@media (min-width:1280px){.navbar-expand-xl .navbar-nav .dropdown-menu{position:absolute}}@media (min-width:1440px){.navbar-expand-xxl .navbar-nav .dropdown-menu{position:absolute}}.navbar-expand .navbar-nav .dropdown-menu{position:absolute}.sgds.navbar .dropdown-menu.megamenu{left:0;right:0;width:100%}.sgds.combobox>.dropdown-menu{min-width:100%}`,zi=we`.invalid-feedback-container{display:flex;gap:var(--sgds-form-gap-sm)}.invalid-feedback,.invalid-feedback-container{color:var(--sgds-form-danger-color-default);line-height:var(--sgds-line-height-20)}.invalid-feedback{font-size:var(--sgds-font-size-14);font-weight:var(--sgds-font-weight-regular)}.valid-icon{color:var(--sgds-form-success-color-default)}`,Di=we`.form-text{color:var(--sgds-form-color-subtle);font-size:var(--sgds-font-size-14);line-height:var(--sgds-line-height-20)}.form-text.disabled{opacity:var(--sgds-opacity-50)}`,Ui=we`.form-control-container{display:flex;flex-direction:column;gap:var(--sgds-form-gap-md)}.form-control-group{align-items:center;background-color:var(--sgds-form-surface-default);border:var(--sgds-form-border-width-default) solid var(--sgds-border-color-default);border-radius:var(--input-border-radius,var(--sgds-form-border-radius-md));display:flex;gap:var(--sgds-form-gap-md);height:var(--sgds-dimension-48);justify-content:center;min-width:var(--sgds-dimension-256);padding:0 var(--sgds-form-padding-x);transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out;width:-webkit-fill-available;width:-moz-available}.form-control{appearance:none;background-clip:padding-box;background:none;border:none;color:var(--sgds-form-color-default);display:block;flex-grow:1;font-size:var(--sgds-font-size-16);line-height:var(--sgds-line-height-24);outline:none;padding:0}.form-clearable{color:var(--sgds-color-subtle);cursor:pointer}@media (prefers-reduced-motion:reduce){.form-control-group{transition:none}}.form-control-group:not(.disabled):not(.is-invalid):not(.readonly):not(:focus-within):hover{outline:var(--sgds-form-border-width-thick) solid var(--sgds-border-color-emphasis);outline-offset:var(--sgds-form-outline-offset-focus)}.form-control-group:not(.disabled):not(.is-invalid):focus-within{outline:var(--sgds-form-outline-focus);outline-offset:var(--sgds-form-outline-offset-focus)}.form-control-container.disabled{opacity:var(--sgds-opacity-50)}.form-control-group.disabled{background-color:var(--sgds-form-surface-muted);cursor:not-allowed}.form-control-group.readonly{background-color:var(--sgds-form-surface-raised)}.form-control-group.is-invalid:not(.disabled){border:var(--sgds-form-border-width-default) solid var(--sgds-form-danger-border-color-default)}.form-control-group:not(.disabled).is-invalid:focus-within{outline:var(--sgds-border-width-2) solid var(--sgds-form-danger-color-default);outline-offset:var(--sgds-form-outline-offset-focus)}`;const Fi=(e="value")=>(t,i)=>{const l=t.constructor,a=l.prototype.attributeChangedCallback;l.prototype.attributeChangedCallback=function(t,o,s){var n;const r=l.getPropertyOptions(e);if(t===("string"==typeof r.attribute?r.attribute:e).toLowerCase()){const t=r.converter||Ae,l=("function"==typeof t?t:null!==(n=null==t?void 0:t.fromAttribute)&&void 0!==n?n:Ae.fromAttribute)(s,r.type);this[e]!==l&&(this[i]=l)}a.call(this,t,o,s)}};function Ni(e="",t=""){return`id-${Math.random().toString().substring(2,6)}-sgds-${e}-${t}`}class Wi{constructor(e,t){(this.host=e).addController(this),this._internals=e._internals||this.host.attachInternals(),this.options=Object.assign({setInvalid:(e,t)=>{e.invalid=t},value:e=>e.value,input:e=>e.input},t)}hostConnected(){this.host.addEventListener("invalid",e=>this.handleInvalid(e))}hostDisconnected(){this.host.removeEventListener("invalid",e=>this.handleInvalid(e))}handleInvalid(e){e.preventDefault(),this.options.setInvalid(this.host,!0)}handleInput(e){const t=e.target;this.options.setInvalid(this.host,!1),this.validateInput(t)}handleChange(e){const t=e.target;this.validateInput(t),this.options.setInvalid(this.host,!this.checkValidity())}get form(){return this._internals.form}get validity(){return this._internals.validity}get validationMessage(){return this._internals.validationMessage}get willValidate(){return this._internals.willValidate}updateInvalidState(){this.options.setInvalid(this.host,!this.checkValidity())}resetValidity(){return this._internals.setValidity({})}checkValidity(){return this._internals.checkValidity()}reportValidity(){return this._internals.reportValidity()}setValidity(e,t,i){return this._internals.setValidity(e,t,i)}setFormValue(){const e=this.options.value(this.host);this._internals.setFormValue(e)}validateInput(e){if(this.options.input(this.host).disabled)return this._internals.setValidity({});const t=e.validity;if(t.valid)this._internals.setValidity({});else for(const i in t)t[i]&&(this.validationError=i.toString(),this._internals.setValidity({[this.validationError]:!0},e.validationMessage,e))}}const qi=t=>{class i extends t{constructor(...e){super(...e),this._isTouched=!1,this._internals=this.attachInternals()}connectedCallback(){var e;super.connectedCallback(),this._mixinShouldSkipSgdsValidation()||null!==(e=this.inputValidationController)&&void 0!==e||(this.inputValidationController=new Wi(this))}async firstUpdated(e){super.firstUpdated(e),this.input=this.shadowRoot.querySelector("input")||await this.sgdsInput||this.shadowRoot.querySelector("textarea")||await this.sgdsDatepickerInput,this._mixinSetFormValue(),this._mixinShouldSkipSgdsValidation()||this._mixinValidate(this.input)}formResetCallback(){this._mixinResetFormControl?this._mixinResetFormControl():(this.value=this.defaultValue,this._mixinResetValidity(this.input)),this._mixinSetFormValue()}_mixinHandleChange(e){this._mixinSetFormValue(),this._mixinShouldSkipSgdsValidation()||this.inputValidationController.handleChange(e)}_mixinHandleInputChange(e){this._mixinSetFormValue(),this._mixinShouldSkipSgdsValidation()||this.inputValidationController.handleInput(e)}_mixinResetValidity(e){this._mixinShouldSkipSgdsValidation()||(this.inputValidationController.resetValidity(),this.inputValidationController.updateInvalidState(),this.inputValidationController.validateInput(e),this._isTouched&&(this._isTouched=!1))}_mixinValidate(e){this._mixinShouldSkipSgdsValidation()||this.inputValidationController.validateInput(e)}_mixinSetFormValue(){const e=this.value;this._internals.setFormValue(e)}_mixinCheckValidity(){return!!this._mixinShouldSkipSgdsValidation()||this.inputValidationController.checkValidity()}_mixinReportValidity(){return!!this._mixinShouldSkipSgdsValidation()||this.inputValidationController.reportValidity()}_mixinGetValidity(){return this._internals.validity}_mixinGetValidationMessage(){return this._internals.validationMessage}_mixinSetValidity(e,t,i){if(!this._mixinShouldSkipSgdsValidation())return this.inputValidationController.setValidity(e,t,i)}_mixinShouldSkipSgdsValidation(){const e=this.closest("form");return(null==e?void 0:e.noValidate)||this.noValidate}}return i.formAssociated=!0,e([Ge("sgds-input")],i.prototype,"sgdsInput",void 0),e([Ge("sgds-datepicker-input")],i.prototype,"sgdsDatepickerInput",void 0),i};var ji=we`:host{-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0);color:var(--sgds-body-color-default);font-family:var(--sgds-font-family-brand);font-size:var(--sgds-font-size-16);font-weight:var(--sgds-font-weight-regular);line-height:var(--sgds-line-height-24);margin:0;*,:after,:before{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}:disabled{cursor:not-allowed}@media (prefers-reduced-motion:no-preference){:root{scroll-behavior:smooth}}::slotted(a[target=_blank]):after,a[target=_blank]:after{background-color:currentColor;content:"/";display:inline-block;height:1em;-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M9.774 4.4H9.8a.6.6 0 1 1 0 1.2c-.85 0-1.451 0-1.922.039-.463.038-.745.11-.968.223A2.4 2.4 0 0 0 5.861 6.91c-.113.223-.184.505-.222.968-.039.47-.04 1.072-.04 1.922v4.4c0 .85.001 1.451.04 1.922.038.463.11.745.222.968a2.4 2.4 0 0 0 1.05 1.048c.222.114.504.185.967.223.47.038 1.072.039 1.922.039h4.4c.85 0 1.451 0 1.921-.039.464-.038.746-.11.969-.223a2.4 2.4 0 0 0 1.048-1.048c.113-.223.185-.505.223-.968.038-.47.039-1.072.039-1.922a.6.6 0 1 1 1.2 0v.026c0 .818 0 1.468-.043 1.993-.044.538-.136.996-.35 1.415a3.6 3.6 0 0 1-1.573 1.574c-.42.213-.878.305-1.415.35-.525.042-1.175.042-1.993.042H9.774c-.818 0-1.469 0-1.993-.043-.538-.044-.996-.136-1.415-.35a3.6 3.6 0 0 1-1.574-1.573c-.213-.42-.305-.877-.35-1.415-.042-.525-.042-1.175-.042-1.993V9.774c0-.818 0-1.468.043-1.993.044-.538.136-.996.35-1.415a3.6 3.6 0 0 1 1.573-1.574c.42-.213.877-.305 1.415-.35C8.305 4.4 8.956 4.4 9.774 4.4ZM12.4 5a.6.6 0 0 1 .6-.6h6a.6.6 0 0 1 .6.6v6a.6.6 0 1 1-1.2 0V6.449l-5.976 5.975a.6.6 0 0 1-.848-.848L17.55 5.6H13a.6.6 0 0 1-.6-.6Z' fill='%230E0E0E'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M9.774 4.4H9.8a.6.6 0 1 1 0 1.2c-.85 0-1.451 0-1.922.039-.463.038-.745.11-.968.223A2.4 2.4 0 0 0 5.861 6.91c-.113.223-.184.505-.222.968-.039.47-.04 1.072-.04 1.922v4.4c0 .85.001 1.451.04 1.922.038.463.11.745.222.968a2.4 2.4 0 0 0 1.05 1.048c.222.114.504.185.967.223.47.038 1.072.039 1.922.039h4.4c.85 0 1.451 0 1.921-.039.464-.038.746-.11.969-.223a2.4 2.4 0 0 0 1.048-1.048c.113-.223.185-.505.223-.968.038-.47.039-1.072.039-1.922a.6.6 0 1 1 1.2 0v.026c0 .818 0 1.468-.043 1.993-.044.538-.136.996-.35 1.415a3.6 3.6 0 0 1-1.573 1.574c-.42.213-.878.305-1.415.35-.525.042-1.175.042-1.993.042H9.774c-.818 0-1.469 0-1.993-.043-.538-.044-.996-.136-1.415-.35a3.6 3.6 0 0 1-1.574-1.573c-.213-.42-.305-.877-.35-1.415-.042-.525-.042-1.175-.042-1.993V9.774c0-.818 0-1.468.043-1.993.044-.538.136-.996.35-1.415a3.6 3.6 0 0 1 1.573-1.574c.42-.213.877-.305 1.415-.35C8.305 4.4 8.956 4.4 9.774 4.4ZM12.4 5a.6.6 0 0 1 .6-.6h6a.6.6 0 0 1 .6.6v6a.6.6 0 1 1-1.2 0V6.449l-5.976 5.975a.6.6 0 0 1-.848-.848L17.55 5.6H13a.6.6 0 0 1-.6-.6Z' fill='%230E0E0E'/%3E%3C/svg%3E");-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;vertical-align:top;width:1em}::slotted(svg){vertical-align:middle}}`;class Ki extends Oe{emit(e,t){const i=new CustomEvent(e,Object.assign({bubbles:!0,cancelable:!1,composed:!0,detail:{}},t));return this.dispatchEvent(i),i}static define(e,t=this,i={}){if(customElements.get(e));else try{customElements.define(e,t,i)}catch(l){customElements.define(e,class extends t{},i)}}constructor(){super(),this.ssr=Boolean(this.shadowRoot),Object.entries(this.constructor.dependencies).forEach(([e,t])=>{this.constructor.define(e,t)})}firstUpdated(e){var t;super.firstUpdated(e),this.ssr&&(null===(t=this.shadowRoot)||void 0===t||t.querySelectorAll("slot").forEach(e=>{e.dispatchEvent(new Event("slotchange",{bubbles:!0,composed:!1,cancelable:!1}))}))}}Ki.styles=[ji],Ki.dependencies={},e([We({type:Boolean,reflect:!0})],Ki.prototype,"ssr",void 0);class Gi extends Ki{constructor(){super(...arguments),this.myDropdown=st(),this.dropdownMenuId=Ni("dropdown-menu","div"),this.noFlip=!1,this.menuAlignRight=!1,this.drop="down",this.floatingOpts={},this.menuIsOpen=!1,this.close="default",this.disabled=!1,this.readonly=!1,this.menuRef=st(),this._handleClickOutOfElement=e=>{this.menuIsOpen&&(e.composedPath().includes(this)||this.hideMenu(!0))}}connectedCallback(){super.connectedCallback(),"inside"!==this.close&&document.addEventListener("click",this._handleClickOutOfElement),this.addEventListener("keydown",this._handleKeyboardMenuEvent)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this._handleClickOutOfElement),this.removeEventListener("keydown",this._handleKeyboardMenuEvent),this._cleanupAutoUpdate&&(this._cleanupAutoUpdate(),this._cleanupAutoUpdate=void 0)}firstUpdated(e){super.firstUpdated(e),this.menuIsOpen&&this.updateFloatingPosition()}async showMenu(){this.disabled||this.menuIsOpen||(this.menuIsOpen=!0,this.emit("sgds-show"),await this.updateFloatingPosition(),this.emit("sgds-after-show"),this.myDropdown.value&&this.menuRef.value&&(this._cleanupAutoUpdate=Li(this.myDropdown.value,this.menuRef.value,()=>this.updateFloatingPosition())))}hideMenu(e){this.menuIsOpen&&(this.emit("sgds-hide",{detail:{isOutside:e}}),this.menuIsOpen=!1,setTimeout(()=>this.emit("sgds-after-hide"),0),this._cleanupAutoUpdate&&(this._cleanupAutoUpdate(),this._cleanupAutoUpdate=void 0))}toggleMenu(){this.menuIsOpen?this.hideMenu():this.showMenu()}_handleKeyboardMenuEvent(e){if(!this.readonly)switch(e.key){case"ArrowDown":case"ArrowUp":e.preventDefault(),this.menuIsOpen||this.showMenu();break;case"Escape":this.hideMenu()}}mergeMiddleware(e,t){const i=e=>{var t;return(null==e?void 0:e.name)||(null===(t=null==e?void 0:e.constructor)||void 0===t?void 0:t.name)},l=t.map(i),a=e.map(e=>{const a=i(e),o=l.indexOf(a);return-1!==o?t[o]:e}).concat(t.filter(t=>!e.some(e=>i(e)===i(t))));return a}async updateFloatingPosition(){if(!this.myDropdown.value||!this.menuRef.value)return;let e="bottom-start";switch(this.drop){case"up":e=this.menuAlignRight?"top-end":"top-start";break;case"right":e="right-start";break;case"left":e="left-start";break;case"down":e=this.menuAlignRight?"bottom-end":"bottom-start";break;default:e="bottom-start"}const t=[Ai(8),this.noFlip?void 0:Ii(),Ei()].filter(Boolean);let i=t;Array.isArray(this.floatingOpts.middleware)&&this.floatingOpts.middleware.length>0&&(i=this.mergeMiddleware(t,this.floatingOpts.middleware.filter(Boolean)));const l=Object.assign(Object.assign({strategy:"fixed",placement:e},this.floatingOpts),{middleware:i}),{x:a,y:o,strategy:s,placement:n}=await Ri(this.myDropdown.value,this.menuRef.value,l);this.menuRef.value.setAttribute("data-placement",n),Object.assign(this.menuRef.value.style,{position:s,left:`${a}px`,top:`${o}px`})}}e([We({type:Boolean,state:!0})],Gi.prototype,"noFlip",void 0),e([We({type:Boolean,reflect:!0,state:!0})],Gi.prototype,"menuAlignRight",void 0),e([We({type:String,reflect:!0,state:!0})],Gi.prototype,"drop",void 0),e([We({type:Object})],Gi.prototype,"floatingOpts",void 0),e([We({type:Boolean,reflect:!0})],Gi.prototype,"menuIsOpen",void 0),e([We({type:Boolean,reflect:!0})],Gi.prototype,"disabled",void 0),e([We({type:Boolean,reflect:!0})],Gi.prototype,"readonly",void 0);class Ji extends Gi{constructor(){super(...arguments),this.nextDropdownItemNo=0,this.prevDropdownItemNo=-1,this.hidden=!1}connectedCallback(){super.connectedCallback(),this.addEventListener("sgds-hide",this._resetMenu)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("sgds-hide",this._resetMenu)}firstUpdated(e){super.firstUpdated(e),this.addEventListener("keydown",this._handleKeyboardMenuItemsEvent)}handleSelectSlot(e){const t=this._getActiveMenuItems(),i=t.indexOf(e.target);this.nextDropdownItemNo=i+1,this.prevDropdownItemNo=i<=0?t.length-1:i-1;e.target.disabled||(this.emit("sgds-select"),"outside"!==this.close&&this.hideMenu())}_resetMenu(){this.nextDropdownItemNo=0,this.prevDropdownItemNo=-1;this._getMenuItems().forEach(e=>{var t;const i=null===(t=null==e?void 0:e.shadowRoot)||void 0===t?void 0:t.querySelector(".dropdown-item");i&&i.removeAttribute("tabindex")})}_handleKeyboardMenuItemsEvent(e){if(this.readonly)return;const t=this._getActiveMenuItems();if(0!==t.length)switch(e.key){case"ArrowDown":e.preventDefault(),this._setMenuItem(this.nextDropdownItemNo);break;case"ArrowUp":e.preventDefault(),this._setMenuItem(this.prevDropdownItemNo);break;case"Tab":if(!this.menuIsOpen)return;e.preventDefault(),e.shiftKey?this._setMenuItem(this.prevDropdownItemNo):this._setMenuItem(this.nextDropdownItemNo);break;case"Enter":t.includes(e.target)&&this.handleSelectSlot(e)}}_getMenuItems(){var e,t;if(this.shadowRoot.querySelector("slot#default")){return null===(e=this.shadowRoot.querySelector("slot#default"))||void 0===e?void 0:e.assignedElements({flatten:!0}).filter(e=>!e.classList.contains("empty-menu")&&!e.hasAttribute("hidden"))}if(null===(t=this.menu)||void 0===t?void 0:t.hasChildNodes()){return[...Array.from(this.menu.children)]}return[]}_getActiveMenuItems(){return this._getMenuItems().filter(e=>!e.disabled&&!e.hidden)}_setMenuItem(e){const t=this._getActiveMenuItems();if(0===t.length)return;const i=(e%t.length+t.length)%t.length,l=t[i];this.emit("i-sgds-option-focus",{detail:{option:l}}),this.nextDropdownItemNo=(i+1)%t.length,this.prevDropdownItemNo=(i-1+t.length)%t.length,t.forEach(e=>{const t=e.shadowRoot.querySelector(".dropdown-item");t.setAttribute("tabindex",e===l?"0":"-1"),e===l&&t.focus()})}}var Xi,Yi;Ji.styles=Gi.styles,e([(Xi="ul.dropdown-menu",(e,t,i)=>{const l=e=>{const i=e.renderRoot?.querySelector(Xi)??null;if(null===i&&Yi&&!e.hasUpdated){const e="object"==typeof t?t.name:t;Ke("",`@query'd field ${JSON.stringify(String(e))} with the 'cache' flag set for selector '${Xi}' has been accessed before the first update and returned null. This is expected if the renderRoot tree has not been provided beforehand (e.g. via Declarative Shadow DOM). Therefore the value hasn't been cached.`)}return i};if(Yi){const{get:a,set:o}="object"==typeof t?e:i??(()=>{const e=Symbol(`${String(t)} (@query() cache)`);return{get(){return this[e]},set(t){this[e]=t}}})();return je(e,t,{get(){let e=a.call(this);return void 0===e&&(e=l(this),(null!==e||this.hasUpdated)&&o.call(this,e)),e}})}return je(e,t,{get(){return l(this)}})})],Ji.prototype,"menu",void 0),e([qe()],Ji.prototype,"nextDropdownItemNo",void 0),e([qe()],Ji.prototype,"prevDropdownItemNo",void 0),e([We({type:Boolean,reflect:!0})],Ji.prototype,"hidden",void 0);var Qi=we`.empty-menu,.loading-menu{padding:var(--sgds-padding-sm) var(--sgds-padding-lg,20px);pointer-events:none}.loading-menu{align-items:center;display:flex;gap:var(--sgds-gap-xs)}`;class el extends(qi(Ji)){constructor(){super(),this.label="",this.hintText="",this.autofocus=!1,this.disabled=!1,this.required=!1,this.loading=!1,this.value="",this.displayValue="",this.defaultValue="",this.hasFeedback=!1,this.invalidFeedback="",this.invalid=!1,this.menuList=[],this.selectedItems=[],this.filteredList=[],this._isTouched=!1,this._controlId=Ni("input"),this._labelId=Ni("label"),this.floatingOpts={middleware:[Ti({apply({rects:e,elements:t}){t.floating.style.width=`${e.reference.width}px`}})]}}connectedCallback(){super.connectedCallback(),this.addEventListener("blur",async e=>{var t;const i=this.constructor.childName,l=(null===(t=e.relatedTarget)||void 0===t?void 0:t.tagName.toLowerCase())===i;this.invalid=!l&&!this._mixinReportValidity()})}reportValidity(){return this._mixinReportValidity()}checkValidity(){return this._mixinCheckValidity()}get validity(){return this._mixinGetValidity()}get validationMessage(){return this._mixinGetValidationMessage()}_renderFeedback(){return this.invalid&&this.hasFeedback?S` <div class="invalid-feedback-container">
81
+ */const st=()=>new nt;class nt{}const rt=new WeakMap;const ct=te(class extends ot{render(e){return A}update(e,[t]){const i=t!==this._ref;return i&&void 0!==this._ref&&this._updateRefValue(void 0),(i||this._lastElementForRef!==this._element)&&(this._ref=t,this._context=e.options?.host,this._updateRefValue(this._element=e.element)),A}_updateRefValue(e){if(this.isConnected||(e=void 0),"function"==typeof this._ref){const t=this._context??globalThis;let i=rt.get(t);void 0===i&&(i=new WeakMap,rt.set(t,i)),void 0!==i.get(this._ref)&&this._ref.call(this._context,void 0),i.set(this._ref,e),void 0!==e&&this._ref.call(this._context,e)}else this._ref.value=e}get _lastElementForRef(){return"function"==typeof this._ref?rt.get(this._context??globalThis)?.get(this._ref):this._ref?.value}disconnected(){this._lastElementForRef===this._element&&this._updateRefValue(void 0)}reconnected(){this._updateRefValue(this._element)}}),dt=["top","right","bottom","left"],ht=Math.min,vt=Math.max,ut=Math.round,pt=Math.floor,gt=e=>({x:e,y:e}),ft={left:"right",right:"left",bottom:"top",top:"bottom"},mt={start:"end",end:"start"};function wt(e,t,i){return vt(e,ht(t,i))}function bt(e,t){return"function"==typeof e?e(t):e}function xt(e){return e.split("-")[0]}function yt(e){return e.split("-")[1]}function Ct(e){return"x"===e?"y":"x"}function Zt(e){return"y"===e?"height":"width"}const _t=new Set(["top","bottom"]);function Mt(e){return _t.has(xt(e))?"y":"x"}function Vt(e){return Ct(Mt(e))}function kt(e,t,i){void 0===i&&(i=!1);const l=yt(e),a=Vt(e),o=Zt(a);let s="x"===a?l===(i?"end":"start")?"right":"left":"start"===l?"bottom":"top";return t.reference[o]>t.floating[o]&&(s=Et(s)),[s,Et(s)]}function Ht(e){return e.replace(/start|end/g,e=>mt[e])}const $t=["left","right"],St=["right","left"],Bt=["top","bottom"],Lt=["bottom","top"];function At(e,t,i,l){const a=yt(e);let o=function(e,t,i){switch(e){case"top":case"bottom":return i?t?St:$t:t?$t:St;case"left":case"right":return t?Bt:Lt;default:return[]}}(xt(e),"start"===i,l);return a&&(o=o.map(e=>e+"-"+a),t&&(o=o.concat(o.map(Ht)))),o}function Et(e){return e.replace(/left|right|bottom|top/g,e=>ft[e])}function It(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function Tt(e){const{x:t,y:i,width:l,height:a}=e;return{width:l,height:a,top:i,left:t,right:t+l,bottom:i+a,x:t,y:i}}function Pt(e,t,i){let{reference:l,floating:a}=e;const o=Mt(t),s=Vt(t),n=Zt(s),r=xt(t),c="y"===o,d=l.x+l.width/2-a.width/2,h=l.y+l.height/2-a.height/2,v=l[n]/2-a[n]/2;let u;switch(r){case"top":u={x:d,y:l.y-a.height};break;case"bottom":u={x:d,y:l.y+l.height};break;case"right":u={x:l.x+l.width,y:h};break;case"left":u={x:l.x-a.width,y:h};break;default:u={x:l.x,y:l.y}}switch(yt(t)){case"start":u[s]-=v*(i&&c?-1:1);break;case"end":u[s]+=v*(i&&c?-1:1)}return u}async function Rt(e,t){var i;void 0===t&&(t={});const{x:l,y:a,platform:o,rects:s,elements:n,strategy:r}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:h="floating",altBoundary:v=!1,padding:u=0}=bt(t,e),p=It(u),g=n[v?"floating"===h?"reference":"floating":h],f=Tt(await o.getClippingRect({element:null==(i=await(null==o.isElement?void 0:o.isElement(g)))||i?g:g.contextElement||await(null==o.getDocumentElement?void 0:o.getDocumentElement(n.floating)),boundary:c,rootBoundary:d,strategy:r})),m="floating"===h?{x:l,y:a,width:s.floating.width,height:s.floating.height}:s.reference,w=await(null==o.getOffsetParent?void 0:o.getOffsetParent(n.floating)),b=await(null==o.isElement?void 0:o.isElement(w))&&await(null==o.getScale?void 0:o.getScale(w))||{x:1,y:1},x=Tt(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:n,rect:m,offsetParent:w,strategy:r}):m);return{top:(f.top-x.top+p.top)/b.y,bottom:(x.bottom-f.bottom+p.bottom)/b.y,left:(f.left-x.left+p.left)/b.x,right:(x.right-f.right+p.right)/b.x}}function Ot(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function zt(e){return dt.some(t=>e[t]>=0)}const Dt=new Set(["left","top"]);function Ut(){return"undefined"!=typeof window}function Ft(e){return qt(e)?(e.nodeName||"").toLowerCase():"#document"}function Nt(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Wt(e){var t;return null==(t=(qt(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function qt(e){return!!Ut()&&(e instanceof Node||e instanceof Nt(e).Node)}function jt(e){return!!Ut()&&(e instanceof Element||e instanceof Nt(e).Element)}function Kt(e){return!!Ut()&&(e instanceof HTMLElement||e instanceof Nt(e).HTMLElement)}function Gt(e){return!(!Ut()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof Nt(e).ShadowRoot)}const Jt=new Set(["inline","contents"]);function Xt(e){const{overflow:t,overflowX:i,overflowY:l,display:a}=ci(e);return/auto|scroll|overlay|hidden|clip/.test(t+l+i)&&!Jt.has(a)}const Yt=new Set(["table","td","th"]);function Qt(e){return Yt.has(Ft(e))}const ei=[":popover-open",":modal"];function ti(e){return ei.some(t=>{try{return e.matches(t)}catch(e){return!1}})}const ii=["transform","translate","scale","rotate","perspective"],li=["transform","translate","scale","rotate","perspective","filter"],ai=["paint","layout","strict","content"];function oi(e){const t=si(),i=jt(e)?ci(e):e;return ii.some(e=>!!i[e]&&"none"!==i[e])||!!i.containerType&&"normal"!==i.containerType||!t&&!!i.backdropFilter&&"none"!==i.backdropFilter||!t&&!!i.filter&&"none"!==i.filter||li.some(e=>(i.willChange||"").includes(e))||ai.some(e=>(i.contain||"").includes(e))}function si(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const ni=new Set(["html","body","#document"]);function ri(e){return ni.has(Ft(e))}function ci(e){return Nt(e).getComputedStyle(e)}function di(e){return jt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function hi(e){if("html"===Ft(e))return e;const t=e.assignedSlot||e.parentNode||Gt(e)&&e.host||Wt(e);return Gt(t)?t.host:t}function vi(e){const t=hi(e);return ri(t)?e.ownerDocument?e.ownerDocument.body:e.body:Kt(t)&&Xt(t)?t:vi(t)}function ui(e,t,i){var l;void 0===t&&(t=[]),void 0===i&&(i=!0);const a=vi(e),o=a===(null==(l=e.ownerDocument)?void 0:l.body),s=Nt(a);if(o){const e=pi(s);return t.concat(s,s.visualViewport||[],Xt(a)?a:[],e&&i?ui(e):[])}return t.concat(a,ui(a,[],i))}function pi(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function gi(e){const t=ci(e);let i=parseFloat(t.width)||0,l=parseFloat(t.height)||0;const a=Kt(e),o=a?e.offsetWidth:i,s=a?e.offsetHeight:l,n=ut(i)!==o||ut(l)!==s;return n&&(i=o,l=s),{width:i,height:l,$:n}}function fi(e){return jt(e)?e:e.contextElement}function mi(e){const t=fi(e);if(!Kt(t))return gt(1);const i=t.getBoundingClientRect(),{width:l,height:a,$:o}=gi(t);let s=(o?ut(i.width):i.width)/l,n=(o?ut(i.height):i.height)/a;return s&&Number.isFinite(s)||(s=1),n&&Number.isFinite(n)||(n=1),{x:s,y:n}}const wi=gt(0);function bi(e){const t=Nt(e);return si()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:wi}function xi(e,t,i,l){void 0===t&&(t=!1),void 0===i&&(i=!1);const a=e.getBoundingClientRect(),o=fi(e);let s=gt(1);t&&(l?jt(l)&&(s=mi(l)):s=mi(e));const n=function(e,t,i){return void 0===t&&(t=!1),!(!i||t&&i!==Nt(e))&&t}(o,i,l)?bi(o):gt(0);let r=(a.left+n.x)/s.x,c=(a.top+n.y)/s.y,d=a.width/s.x,h=a.height/s.y;if(o){const e=Nt(o),t=l&&jt(l)?Nt(l):l;let i=e,a=pi(i);for(;a&&l&&t!==i;){const e=mi(a),t=a.getBoundingClientRect(),l=ci(a),o=t.left+(a.clientLeft+parseFloat(l.paddingLeft))*e.x,s=t.top+(a.clientTop+parseFloat(l.paddingTop))*e.y;r*=e.x,c*=e.y,d*=e.x,h*=e.y,r+=o,c+=s,i=Nt(a),a=pi(i)}}return Tt({width:d,height:h,x:r,y:c})}function yi(e,t){const i=di(e).scrollLeft;return t?t.left+i:xi(Wt(e)).left+i}function Ci(e,t){const i=e.getBoundingClientRect();return{x:i.left+t.scrollLeft-yi(e,i),y:i.top+t.scrollTop}}const Zi=new Set(["absolute","fixed"]);function _i(e,t,i){let l;if("viewport"===t)l=function(e,t){const i=Nt(e),l=Wt(e),a=i.visualViewport;let o=l.clientWidth,s=l.clientHeight,n=0,r=0;if(a){o=a.width,s=a.height;const e=si();(!e||e&&"fixed"===t)&&(n=a.offsetLeft,r=a.offsetTop)}const c=yi(l);if(c<=0){const e=l.ownerDocument,t=e.body,i=getComputedStyle(t),a="CSS1Compat"===e.compatMode&&parseFloat(i.marginLeft)+parseFloat(i.marginRight)||0,s=Math.abs(l.clientWidth-t.clientWidth-a);s<=25&&(o-=s)}else c<=25&&(o+=c);return{width:o,height:s,x:n,y:r}}(e,i);else if("document"===t)l=function(e){const t=Wt(e),i=di(e),l=e.ownerDocument.body,a=vt(t.scrollWidth,t.clientWidth,l.scrollWidth,l.clientWidth),o=vt(t.scrollHeight,t.clientHeight,l.scrollHeight,l.clientHeight);let s=-i.scrollLeft+yi(e);const n=-i.scrollTop;return"rtl"===ci(l).direction&&(s+=vt(t.clientWidth,l.clientWidth)-a),{width:a,height:o,x:s,y:n}}(Wt(e));else if(jt(t))l=function(e,t){const i=xi(e,!0,"fixed"===t),l=i.top+e.clientTop,a=i.left+e.clientLeft,o=Kt(e)?mi(e):gt(1);return{width:e.clientWidth*o.x,height:e.clientHeight*o.y,x:a*o.x,y:l*o.y}}(t,i);else{const i=bi(e);l={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Tt(l)}function Mi(e,t){const i=hi(e);return!(i===t||!jt(i)||ri(i))&&("fixed"===ci(i).position||Mi(i,t))}function Vi(e,t,i){const l=Kt(t),a=Wt(t),o="fixed"===i,s=xi(e,!0,o,t);let n={scrollLeft:0,scrollTop:0};const r=gt(0);function c(){r.x=yi(a)}if(l||!l&&!o)if(("body"!==Ft(t)||Xt(a))&&(n=di(t)),l){const e=xi(t,!0,o,t);r.x=e.x+t.clientLeft,r.y=e.y+t.clientTop}else a&&c();o&&!l&&a&&c();const d=!a||l||o?gt(0):Ci(a,n);return{x:s.left+n.scrollLeft-r.x-d.x,y:s.top+n.scrollTop-r.y-d.y,width:s.width,height:s.height}}function ki(e){return"static"===ci(e).position}function Hi(e,t){if(!Kt(e)||"fixed"===ci(e).position)return null;if(t)return t(e);let i=e.offsetParent;return Wt(e)===i&&(i=i.ownerDocument.body),i}function $i(e,t){const i=Nt(e);if(ti(e))return i;if(!Kt(e)){let t=hi(e);for(;t&&!ri(t);){if(jt(t)&&!ki(t))return t;t=hi(t)}return i}let l=Hi(e,t);for(;l&&Qt(l)&&ki(l);)l=Hi(l,t);return l&&ri(l)&&ki(l)&&!oi(l)?i:l||function(e){let t=hi(e);for(;Kt(t)&&!ri(t);){if(oi(t))return t;if(ti(t))return null;t=hi(t)}return null}(e)||i}const Si={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:i,offsetParent:l,strategy:a}=e;const o="fixed"===a,s=Wt(l),n=!!t&&ti(t.floating);if(l===s||n&&o)return i;let r={scrollLeft:0,scrollTop:0},c=gt(1);const d=gt(0),h=Kt(l);if((h||!h&&!o)&&(("body"!==Ft(l)||Xt(s))&&(r=di(l)),Kt(l))){const e=xi(l);c=mi(l),d.x=e.x+l.clientLeft,d.y=e.y+l.clientTop}const v=!s||h||o?gt(0):Ci(s,r);return{width:i.width*c.x,height:i.height*c.y,x:i.x*c.x-r.scrollLeft*c.x+d.x+v.x,y:i.y*c.y-r.scrollTop*c.y+d.y+v.y}},getDocumentElement:Wt,getClippingRect:function(e){let{element:t,boundary:i,rootBoundary:l,strategy:a}=e;const o=[..."clippingAncestors"===i?ti(t)?[]:function(e,t){const i=t.get(e);if(i)return i;let l=ui(e,[],!1).filter(e=>jt(e)&&"body"!==Ft(e)),a=null;const o="fixed"===ci(e).position;let s=o?hi(e):e;for(;jt(s)&&!ri(s);){const t=ci(s),i=oi(s);i||"fixed"!==t.position||(a=null),(o?!i&&!a:!i&&"static"===t.position&&a&&Zi.has(a.position)||Xt(s)&&!i&&Mi(e,s))?l=l.filter(e=>e!==s):a=t,s=hi(s)}return t.set(e,l),l}(t,this._c):[].concat(i),l],s=o[0],n=o.reduce((e,i)=>{const l=_i(t,i,a);return e.top=vt(l.top,e.top),e.right=ht(l.right,e.right),e.bottom=ht(l.bottom,e.bottom),e.left=vt(l.left,e.left),e},_i(t,s,a));return{width:n.right-n.left,height:n.bottom-n.top,x:n.left,y:n.top}},getOffsetParent:$i,getElementRects:async function(e){const t=this.getOffsetParent||$i,i=this.getDimensions,l=await i(e.floating);return{reference:Vi(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:l.width,height:l.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:i}=gi(e);return{width:t,height:i}},getScale:mi,isElement:jt,isRTL:function(e){return"rtl"===ci(e).direction}};function Bi(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Li(e,t,i,l){void 0===l&&(l={});const{ancestorScroll:a=!0,ancestorResize:o=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:n="function"==typeof IntersectionObserver,animationFrame:r=!1}=l,c=fi(e),d=a||o?[...c?ui(c):[],...ui(t)]:[];d.forEach(e=>{a&&e.addEventListener("scroll",i,{passive:!0}),o&&e.addEventListener("resize",i)});const h=c&&n?function(e,t){let i,l=null;const a=Wt(e);function o(){var e;clearTimeout(i),null==(e=l)||e.disconnect(),l=null}return function s(n,r){void 0===n&&(n=!1),void 0===r&&(r=1),o();const c=e.getBoundingClientRect(),{left:d,top:h,width:v,height:u}=c;if(n||t(),!v||!u)return;const p={rootMargin:-pt(h)+"px "+-pt(a.clientWidth-(d+v))+"px "+-pt(a.clientHeight-(h+u))+"px "+-pt(d)+"px",threshold:vt(0,ht(1,r))||1};let g=!0;function f(t){const l=t[0].intersectionRatio;if(l!==r){if(!g)return s();l?s(!1,l):i=setTimeout(()=>{s(!1,1e-7)},1e3)}1!==l||Bi(c,e.getBoundingClientRect())||s(),g=!1}try{l=new IntersectionObserver(f,{...p,root:a.ownerDocument})}catch(e){l=new IntersectionObserver(f,p)}l.observe(e)}(!0),o}(c,i):null;let v,u=-1,p=null;s&&(p=new ResizeObserver(e=>{let[l]=e;l&&l.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(u),u=requestAnimationFrame(()=>{var e;null==(e=p)||e.observe(t)})),i()}),c&&!r&&p.observe(c),p.observe(t));let g=r?xi(e):null;return r&&function t(){const l=xi(e);g&&!Bi(g,l)&&i();g=l,v=requestAnimationFrame(t)}(),i(),()=>{var e;d.forEach(e=>{a&&e.removeEventListener("scroll",i),o&&e.removeEventListener("resize",i)}),null==h||h(),null==(e=p)||e.disconnect(),p=null,r&&cancelAnimationFrame(v)}}const Ai=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var i,l;const{x:a,y:o,placement:s,middlewareData:n}=t,r=await async function(e,t){const{placement:i,platform:l,elements:a}=e,o=await(null==l.isRTL?void 0:l.isRTL(a.floating)),s=xt(i),n=yt(i),r="y"===Mt(i),c=Dt.has(s)?-1:1,d=o&&r?-1:1,h=bt(t,e);let{mainAxis:v,crossAxis:u,alignmentAxis:p}="number"==typeof h?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return n&&"number"==typeof p&&(u="end"===n?-1*p:p),r?{x:u*d,y:v*c}:{x:v*c,y:u*d}}(t,e);return s===(null==(i=n.offset)?void 0:i.placement)&&null!=(l=n.arrow)&&l.alignmentOffset?{}:{x:a+r.x,y:o+r.y,data:{...r,placement:s}}}}},Ei=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:i,y:l,placement:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:n={fn:e=>{let{x:t,y:i}=e;return{x:t,y:i}}},...r}=bt(e,t),c={x:i,y:l},d=await Rt(t,r),h=Mt(xt(a)),v=Ct(h);let u=c[v],p=c[h];if(o){const e="y"===v?"bottom":"right";u=wt(u+d["y"===v?"top":"left"],u,u-d[e])}if(s){const e="y"===h?"bottom":"right";p=wt(p+d["y"===h?"top":"left"],p,p-d[e])}const g=n.fn({...t,[v]:u,[h]:p});return{...g,data:{x:g.x-i,y:g.y-l,enabled:{[v]:o,[h]:s}}}}}},Ii=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var i,l;const{placement:a,middlewareData:o,rects:s,initialPlacement:n,platform:r,elements:c}=t,{mainAxis:d=!0,crossAxis:h=!0,fallbackPlacements:v,fallbackStrategy:u="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:g=!0,...f}=bt(e,t);if(null!=(i=o.arrow)&&i.alignmentOffset)return{};const m=xt(a),w=Mt(n),b=xt(n)===n,x=await(null==r.isRTL?void 0:r.isRTL(c.floating)),y=v||(b||!g?[Et(n)]:function(e){const t=Et(e);return[Ht(e),t,Ht(t)]}(n)),C="none"!==p;!v&&C&&y.push(...At(n,g,p,x));const Z=[n,...y],_=await Rt(t,f),M=[];let V=(null==(l=o.flip)?void 0:l.overflows)||[];if(d&&M.push(_[m]),h){const e=kt(a,s,x);M.push(_[e[0]],_[e[1]])}if(V=[...V,{placement:a,overflows:M}],!M.every(e=>e<=0)){var k,H;const e=((null==(k=o.flip)?void 0:k.index)||0)+1,t=Z[e];if(t){if(!("alignment"===h&&w!==Mt(t))||V.every(e=>Mt(e.placement)!==w||e.overflows[0]>0))return{data:{index:e,overflows:V},reset:{placement:t}}}let i=null==(H=V.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:H.placement;if(!i)switch(u){case"bestFit":{var $;const e=null==($=V.filter(e=>{if(C){const t=Mt(e.placement);return t===w||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:$[0];e&&(i=e);break}case"initialPlacement":i=n}if(a!==i)return{reset:{placement:i}}}return{}}}},Ti=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var i,l;const{placement:a,rects:o,platform:s,elements:n}=t,{apply:r=()=>{},...c}=bt(e,t),d=await Rt(t,c),h=xt(a),v=yt(a),u="y"===Mt(a),{width:p,height:g}=o.floating;let f,m;"top"===h||"bottom"===h?(f=h,m=v===(await(null==s.isRTL?void 0:s.isRTL(n.floating))?"start":"end")?"left":"right"):(m=h,f="end"===v?"top":"bottom");const w=g-d.top-d.bottom,b=p-d.left-d.right,x=ht(g-d[f],w),y=ht(p-d[m],b),C=!t.middlewareData.shift;let Z=x,_=y;if(null!=(i=t.middlewareData.shift)&&i.enabled.x&&(_=b),null!=(l=t.middlewareData.shift)&&l.enabled.y&&(Z=w),C&&!v){const e=vt(d.left,0),t=vt(d.right,0),i=vt(d.top,0),l=vt(d.bottom,0);u?_=p-2*(0!==e||0!==t?e+t:vt(d.left,d.right)):Z=g-2*(0!==i||0!==l?i+l:vt(d.top,d.bottom))}await r({...t,availableWidth:_,availableHeight:Z});const M=await s.getDimensions(n.floating);return p!==M.width||g!==M.height?{reset:{rects:!0}}:{}}}},Pi=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:i}=t,{strategy:l="referenceHidden",...a}=bt(e,t);switch(l){case"referenceHidden":{const e=Ot(await Rt(t,{...a,elementContext:"reference"}),i.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:zt(e)}}}case"escaped":{const e=Ot(await Rt(t,{...a,altBoundary:!0}),i.floating);return{data:{escapedOffsets:e,escaped:zt(e)}}}default:return{}}}}},Ri=(e,t,i)=>{const l=new Map,a={platform:Si,...i},o={...a.platform,_c:l};return(async(e,t,i)=>{const{placement:l="bottom",strategy:a="absolute",middleware:o=[],platform:s}=i,n=o.filter(Boolean),r=await(null==s.isRTL?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:a}),{x:d,y:h}=Pt(c,l,r),v=l,u={},p=0;for(let i=0;i<n.length;i++){const{name:o,fn:g}=n[i],{x:f,y:m,data:w,reset:b}=await g({x:d,y:h,initialPlacement:l,placement:v,strategy:a,middlewareData:u,rects:c,platform:s,elements:{reference:e,floating:t}});d=null!=f?f:d,h=null!=m?m:h,u={...u,[o]:{...u[o],...w}},b&&p<=50&&(p++,"object"==typeof b&&(b.placement&&(v=b.placement),b.rects&&(c=!0===b.rects?await s.getElementRects({reference:e,floating:t,strategy:a}):b.rects),({x:d,y:h}=Pt(c,v,r))),i=-1)}return{x:d,y:h,placement:v,strategy:a,middlewareData:u}})(e,t,{...a,platform:o})};var Oi=we`:host([menuisopen]) .dropdown-menu{display:block}.dropdown-menu{background-clip:padding-box;background-color:var(--sgds-surface-default);border-radius:var(--sgds-border-radius-md);box-shadow:0 0 1px 0 hsla(0,0%,5%,.12),0 4px 8px 0 hsla(0,0%,5%,.12);color:var(--sgds-color-default);display:none;list-style:none;margin:0;max-height:var(--sgds-dimension-480);min-width:var(--sgds-dimension-280);overflow-y:auto;padding:var(--sgds-padding-xs) 0;position:absolute;text-align:left;z-index:1050}.nav-tabs .dropdown-menu{border-top-left-radius:0;border-top-right-radius:0;margin-top:calc(var(--sgds-nav-tabs-border-width)*-1)}@media (min-width:512px){.navbar-expand-sm .navbar-nav .dropdown-menu{position:absolute}}@media (min-width:768px){.navbar-expand-md .navbar-nav .dropdown-menu{position:absolute}}@media (min-width:1024px){.navbar-expand-lg .navbar-nav .dropdown-menu{position:absolute}}@media (min-width:1280px){.navbar-expand-xl .navbar-nav .dropdown-menu{position:absolute}}@media (min-width:1440px){.navbar-expand-xxl .navbar-nav .dropdown-menu{position:absolute}}.navbar-expand .navbar-nav .dropdown-menu{position:absolute}.sgds.navbar .dropdown-menu.megamenu{left:0;right:0;width:100%}.sgds.combobox>.dropdown-menu{min-width:100%}`,zi=we`.invalid-feedback-container{display:flex;gap:var(--sgds-form-gap-sm)}.invalid-feedback,.invalid-feedback-container{color:var(--sgds-form-danger-color-default);line-height:var(--sgds-line-height-20)}.invalid-feedback{font-size:var(--sgds-font-size-14);font-weight:var(--sgds-font-weight-regular)}.valid-icon{color:var(--sgds-form-success-color-default)}`,Di=we`.form-text{color:var(--sgds-form-color-subtle);font-size:var(--sgds-font-size-14);line-height:var(--sgds-line-height-20)}.form-text.disabled{opacity:var(--sgds-opacity-50)}`,Ui=we`.form-control-container{display:flex;flex-direction:column;gap:var(--sgds-form-gap-md)}.form-control-group{align-items:center;background-color:var(--sgds-form-surface-default);border:var(--sgds-form-border-width-default) solid var(--sgds-border-color-default);border-radius:var(--input-border-radius,var(--sgds-form-border-radius-md));display:flex;gap:var(--sgds-form-gap-md);height:var(--sgds-dimension-48);justify-content:center;min-width:var(--sgds-dimension-256);padding:0 var(--sgds-form-padding-x);transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out;width:-webkit-fill-available;width:-moz-available}.form-control{appearance:none;background-clip:padding-box;background:none;border:none;color:var(--sgds-form-color-default);display:block;flex-grow:1;font-size:var(--sgds-font-size-16);line-height:var(--sgds-line-height-24);outline:none;padding:0}.form-clearable{color:var(--sgds-color-subtle);cursor:pointer}@media (prefers-reduced-motion:reduce){.form-control-group{transition:none}}.form-control-group:not(.disabled):not(.is-invalid):not(.readonly):not(:focus-within):hover{outline:var(--sgds-form-border-width-thick) solid var(--sgds-border-color-emphasis);outline-offset:var(--sgds-form-outline-offset-focus)}.form-control-group:not(.disabled):not(.is-invalid):focus-within{outline:var(--sgds-form-outline-focus);outline-offset:var(--sgds-form-outline-offset-focus)}.form-control-container.disabled{opacity:var(--sgds-opacity-50)}.form-control-group.disabled{background-color:var(--sgds-form-surface-muted);cursor:not-allowed}.form-control-group.readonly{background-color:var(--sgds-form-surface-raised)}.form-control-group.is-invalid:not(.disabled){border:var(--sgds-form-border-width-default) solid var(--sgds-form-danger-border-color-default)}.form-control-group:not(.disabled).is-invalid:focus-within{outline:var(--sgds-border-width-2) solid var(--sgds-form-danger-color-default);outline-offset:var(--sgds-form-outline-offset-focus)}`;const Fi=(e="value")=>(t,i)=>{const l=t.constructor,a=l.prototype.attributeChangedCallback;l.prototype.attributeChangedCallback=function(t,o,s){var n;const r=l.getPropertyOptions(e);if(t===("string"==typeof r.attribute?r.attribute:e).toLowerCase()){const t=r.converter||Ae,l=("function"==typeof t?t:null!==(n=null==t?void 0:t.fromAttribute)&&void 0!==n?n:Ae.fromAttribute)(s,r.type);this[e]!==l&&(this[i]=l)}a.call(this,t,o,s)}};function Ni(e="",t=""){return`id-${Math.random().toString().substring(2,6)}-sgds-${e}-${t}`}class Wi{constructor(e,t){(this.host=e).addController(this),this._internals=e._internals||this.host.attachInternals(),this.options=Object.assign({setInvalid:(e,t)=>{e.invalid=t},value:e=>e.value,input:e=>e.input},t)}hostConnected(){this.host.addEventListener("invalid",e=>this.handleInvalid(e))}hostDisconnected(){this.host.removeEventListener("invalid",e=>this.handleInvalid(e))}handleInvalid(e){e.preventDefault(),this.options.setInvalid(this.host,!0)}handleInput(e){const t=e.target;this.options.setInvalid(this.host,!1),this.validateInput(t)}handleChange(e){const t=e.target;this.validateInput(t),this.options.setInvalid(this.host,!this.checkValidity())}get form(){return this._internals.form}get validity(){return this._internals.validity}get validationMessage(){return this._internals.validationMessage}get willValidate(){return this._internals.willValidate}updateInvalidState(){this.options.setInvalid(this.host,!this.checkValidity())}resetValidity(){return this._internals.setValidity({})}checkValidity(){return this._internals.checkValidity()}reportValidity(){return this._internals.reportValidity()}setValidity(e,t,i){return this._internals.setValidity(e,t,i)}setFormValue(){const e=this.options.value(this.host);this._internals.setFormValue(e)}validateInput(e){if(this.options.input(this.host).disabled)return this._internals.setValidity({});const t=e.validity;if(t.valid)this._internals.setValidity({});else for(const i in t)t[i]&&(this.validationError=i.toString(),this._internals.setValidity({[this.validationError]:!0},e.validationMessage,e))}}const qi=t=>{class i extends t{constructor(...e){super(...e),this._isTouched=!1,this._internals=this.attachInternals()}connectedCallback(){var e;super.connectedCallback(),this._mixinShouldSkipSgdsValidation()||null!==(e=this.inputValidationController)&&void 0!==e||(this.inputValidationController=new Wi(this))}async firstUpdated(e){super.firstUpdated(e),this.input=this.shadowRoot.querySelector("input")||await this.sgdsInput||this.shadowRoot.querySelector("textarea")||await this.sgdsDatepickerInput,this._mixinSetFormValue(),this._mixinShouldSkipSgdsValidation()||this._mixinValidate(this.input)}formResetCallback(){this._mixinResetFormControl?this._mixinResetFormControl():(this.value=this.defaultValue,this._mixinResetValidity(this.input)),this._mixinSetFormValue()}_mixinHandleChange(e){this._mixinSetFormValue(),this._mixinShouldSkipSgdsValidation()||this.inputValidationController.handleChange(e)}_mixinHandleInputChange(e){this._mixinSetFormValue(),this._mixinShouldSkipSgdsValidation()||this.inputValidationController.handleInput(e)}_mixinResetValidity(e){this._mixinShouldSkipSgdsValidation()||(this.inputValidationController.resetValidity(),this.inputValidationController.updateInvalidState(),this.inputValidationController.validateInput(e),this._isTouched&&(this._isTouched=!1))}_mixinValidate(e){this._mixinShouldSkipSgdsValidation()||this.inputValidationController.validateInput(e)}_mixinSetFormValue(){const e=this.value;this._internals.setFormValue(e)}_mixinCheckValidity(){return!!this._mixinShouldSkipSgdsValidation()||this.inputValidationController.checkValidity()}_mixinReportValidity(){return!!this._mixinShouldSkipSgdsValidation()||this.inputValidationController.reportValidity()}_mixinGetValidity(){return this._internals.validity}_mixinGetValidationMessage(){return this._internals.validationMessage}_mixinSetValidity(e,t,i){if(!this._mixinShouldSkipSgdsValidation())return this.inputValidationController.setValidity(e,t,i)}_mixinShouldSkipSgdsValidation(){const e=this.closest("form");return(null==e?void 0:e.noValidate)||this.noValidate}}return i.formAssociated=!0,e([Ge("sgds-input")],i.prototype,"sgdsInput",void 0),e([Ge("sgds-datepicker-input")],i.prototype,"sgdsDatepickerInput",void 0),i};var ji=we`:host{-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0);color:var(--sgds-body-color-default);font-family:var(--sgds-font-family-brand);font-size:var(--sgds-font-size-16);font-weight:var(--sgds-font-weight-regular);line-height:var(--sgds-line-height-24);margin:0;*,:after,:before{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}:disabled{cursor:not-allowed}@media (prefers-reduced-motion:no-preference){:root{scroll-behavior:smooth}}::slotted(a[target=_blank]):after,a[target=_blank]:after{background-color:currentColor;content:"/";display:inline-block;height:1em;-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M9.774 4.4H9.8a.6.6 0 1 1 0 1.2c-.85 0-1.451 0-1.922.039-.463.038-.745.11-.968.223A2.4 2.4 0 0 0 5.861 6.91c-.113.223-.184.505-.222.968-.039.47-.04 1.072-.04 1.922v4.4c0 .85.001 1.451.04 1.922.038.463.11.745.222.968a2.4 2.4 0 0 0 1.05 1.048c.222.114.504.185.967.223.47.038 1.072.039 1.922.039h4.4c.85 0 1.451 0 1.921-.039.464-.038.746-.11.969-.223a2.4 2.4 0 0 0 1.048-1.048c.113-.223.185-.505.223-.968.038-.47.039-1.072.039-1.922a.6.6 0 1 1 1.2 0v.026c0 .818 0 1.468-.043 1.993-.044.538-.136.996-.35 1.415a3.6 3.6 0 0 1-1.573 1.574c-.42.213-.878.305-1.415.35-.525.042-1.175.042-1.993.042H9.774c-.818 0-1.469 0-1.993-.043-.538-.044-.996-.136-1.415-.35a3.6 3.6 0 0 1-1.574-1.573c-.213-.42-.305-.877-.35-1.415-.042-.525-.042-1.175-.042-1.993V9.774c0-.818 0-1.468.043-1.993.044-.538.136-.996.35-1.415a3.6 3.6 0 0 1 1.573-1.574c.42-.213.877-.305 1.415-.35C8.305 4.4 8.956 4.4 9.774 4.4ZM12.4 5a.6.6 0 0 1 .6-.6h6a.6.6 0 0 1 .6.6v6a.6.6 0 1 1-1.2 0V6.449l-5.976 5.975a.6.6 0 0 1-.848-.848L17.55 5.6H13a.6.6 0 0 1-.6-.6Z' fill='%230E0E0E'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M9.774 4.4H9.8a.6.6 0 1 1 0 1.2c-.85 0-1.451 0-1.922.039-.463.038-.745.11-.968.223A2.4 2.4 0 0 0 5.861 6.91c-.113.223-.184.505-.222.968-.039.47-.04 1.072-.04 1.922v4.4c0 .85.001 1.451.04 1.922.038.463.11.745.222.968a2.4 2.4 0 0 0 1.05 1.048c.222.114.504.185.967.223.47.038 1.072.039 1.922.039h4.4c.85 0 1.451 0 1.921-.039.464-.038.746-.11.969-.223a2.4 2.4 0 0 0 1.048-1.048c.113-.223.185-.505.223-.968.038-.47.039-1.072.039-1.922a.6.6 0 1 1 1.2 0v.026c0 .818 0 1.468-.043 1.993-.044.538-.136.996-.35 1.415a3.6 3.6 0 0 1-1.573 1.574c-.42.213-.878.305-1.415.35-.525.042-1.175.042-1.993.042H9.774c-.818 0-1.469 0-1.993-.043-.538-.044-.996-.136-1.415-.35a3.6 3.6 0 0 1-1.574-1.573c-.213-.42-.305-.877-.35-1.415-.042-.525-.042-1.175-.042-1.993V9.774c0-.818 0-1.468.043-1.993.044-.538.136-.996.35-1.415a3.6 3.6 0 0 1 1.573-1.574c.42-.213.877-.305 1.415-.35C8.305 4.4 8.956 4.4 9.774 4.4ZM12.4 5a.6.6 0 0 1 .6-.6h6a.6.6 0 0 1 .6.6v6a.6.6 0 1 1-1.2 0V6.449l-5.976 5.975a.6.6 0 0 1-.848-.848L17.55 5.6H13a.6.6 0 0 1-.6-.6Z' fill='%230E0E0E'/%3E%3C/svg%3E");-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;vertical-align:top;width:1em}::slotted(svg){vertical-align:middle}}`;class Ki extends Oe{emit(e,t){const i=new CustomEvent(e,Object.assign({bubbles:!0,cancelable:!1,composed:!0,detail:{}},t));return this.dispatchEvent(i),i}static define(e,t=this,i={}){if(customElements.get(e));else try{customElements.define(e,t,i)}catch(l){customElements.define(e,class extends t{},i)}}constructor(){super(),this.ssr=Boolean(this.shadowRoot),Object.entries(this.constructor.dependencies).forEach(([e,t])=>{this.constructor.define(e,t)})}firstUpdated(e){var t;super.firstUpdated(e),this.ssr&&(null===(t=this.shadowRoot)||void 0===t||t.querySelectorAll("slot").forEach(e=>{e.dispatchEvent(new Event("slotchange",{bubbles:!0,composed:!1,cancelable:!1}))}))}}Ki.styles=[ji],Ki.dependencies={},e([We({type:Boolean,reflect:!0})],Ki.prototype,"ssr",void 0);class Gi extends Ki{constructor(){super(...arguments),this.myDropdown=st(),this.dropdownMenuId=Ni("dropdown-menu","div"),this.noFlip=!1,this.menuAlignRight=!1,this.drop="down",this.floatingOpts={},this.menuIsOpen=!1,this.close="default",this.disabled=!1,this.readonly=!1,this.menuRef=st(),this._handleClickOutOfElement=e=>{this.menuIsOpen&&(e.composedPath().includes(this)||this.hideMenu(!0))}}connectedCallback(){super.connectedCallback(),"inside"!==this.close&&document.addEventListener("click",this._handleClickOutOfElement),this.addEventListener("keydown",this._handleKeyboardMenuEvent)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this._handleClickOutOfElement),this.removeEventListener("keydown",this._handleKeyboardMenuEvent),this._cleanupAutoUpdate&&(this._cleanupAutoUpdate(),this._cleanupAutoUpdate=void 0)}firstUpdated(e){super.firstUpdated(e),this.menuIsOpen&&this.updateFloatingPosition()}async showMenu(){this.disabled||this.menuIsOpen||(this.menuIsOpen=!0,this.emit("sgds-show"),await this.updateFloatingPosition(),this.emit("sgds-after-show"),this.myDropdown.value&&this.menuRef.value&&(this._cleanupAutoUpdate=Li(this.myDropdown.value,this.menuRef.value,()=>this.updateFloatingPosition())))}hideMenu(e){this.menuIsOpen&&(this.emit("sgds-hide",{detail:{isOutside:e}}),this.menuIsOpen=!1,setTimeout(()=>this.emit("sgds-after-hide"),0),this._cleanupAutoUpdate&&(this._cleanupAutoUpdate(),this._cleanupAutoUpdate=void 0))}toggleMenu(){this.menuIsOpen?this.hideMenu():this.showMenu()}_handleKeyboardMenuEvent(e){if(!this.readonly)switch(e.key){case"ArrowDown":case"ArrowUp":e.preventDefault(),this.menuIsOpen||this.showMenu();break;case"Escape":this.hideMenu()}}mergeMiddleware(e,t){const i=e=>{var t;return(null==e?void 0:e.name)||(null===(t=null==e?void 0:e.constructor)||void 0===t?void 0:t.name)},l=t.map(i),a=e.map(e=>{const a=i(e),o=l.indexOf(a);return-1!==o?t[o]:e}).concat(t.filter(t=>!e.some(e=>i(e)===i(t))));return a}async updateFloatingPosition(){if(!this.myDropdown.value||!this.menuRef.value)return;let e="bottom-start";switch(this.drop){case"up":e=this.menuAlignRight?"top-end":"top-start";break;case"right":e="right-start";break;case"left":e="left-start";break;case"down":e=this.menuAlignRight?"bottom-end":"bottom-start";break;default:e="bottom-start"}const t=[Ai(8),this.noFlip?void 0:Ii(),Ei()].filter(Boolean);let i=t;Array.isArray(this.floatingOpts.middleware)&&this.floatingOpts.middleware.length>0&&(i=this.mergeMiddleware(t,this.floatingOpts.middleware.filter(Boolean)));const l=Object.assign(Object.assign({strategy:"fixed",placement:e},this.floatingOpts),{middleware:i}),{x:a,y:o,strategy:s,placement:n}=await Ri(this.myDropdown.value,this.menuRef.value,l);this.menuRef.value.setAttribute("data-placement",n),Object.assign(this.menuRef.value.style,{position:s,left:`${a}px`,top:`${o}px`})}}e([We({type:Boolean,state:!0})],Gi.prototype,"noFlip",void 0),e([We({type:Boolean,reflect:!0,state:!0})],Gi.prototype,"menuAlignRight",void 0),e([We({type:String,reflect:!0,state:!0})],Gi.prototype,"drop",void 0),e([We({type:Object})],Gi.prototype,"floatingOpts",void 0),e([We({type:Boolean,reflect:!0})],Gi.prototype,"menuIsOpen",void 0),e([We({type:Boolean,reflect:!0})],Gi.prototype,"disabled",void 0),e([We({type:Boolean,reflect:!0})],Gi.prototype,"readonly",void 0);class Ji extends Gi{constructor(){super(...arguments),this.nextDropdownItemNo=0,this.prevDropdownItemNo=-1,this.hidden=!1}connectedCallback(){super.connectedCallback(),this.addEventListener("sgds-hide",this._resetMenu)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("sgds-hide",this._resetMenu)}firstUpdated(e){super.firstUpdated(e),this.addEventListener("keydown",this._handleKeyboardMenuItemsEvent)}handleSelectSlot(e){const t=this._getActiveMenuItems(),i=t.indexOf(e.target);this.nextDropdownItemNo=i+1,this.prevDropdownItemNo=i<=0?t.length-1:i-1;const l=e.target;l.disabled||(this.emit("sgds-select",{detail:{item:l}}),"outside"!==this.close&&this.hideMenu())}_resetMenu(){this.nextDropdownItemNo=0,this.prevDropdownItemNo=-1;this._getMenuItems().forEach(e=>{var t;const i=null===(t=null==e?void 0:e.shadowRoot)||void 0===t?void 0:t.querySelector(".dropdown-item");i&&i.removeAttribute("tabindex")})}_handleKeyboardMenuItemsEvent(e){if(this.readonly)return;const t=this._getActiveMenuItems();if(0!==t.length)switch(e.key){case"ArrowDown":e.preventDefault(),this._setMenuItem(this.nextDropdownItemNo);break;case"ArrowUp":e.preventDefault(),this._setMenuItem(this.prevDropdownItemNo);break;case"Tab":if(!this.menuIsOpen)return;e.preventDefault(),e.shiftKey?this._setMenuItem(this.prevDropdownItemNo):this._setMenuItem(this.nextDropdownItemNo);break;case"Enter":t.includes(e.target)&&this.handleSelectSlot(e)}}_getMenuItems(){var e,t;if(this.shadowRoot.querySelector("slot#default")){return null===(e=this.shadowRoot.querySelector("slot#default"))||void 0===e?void 0:e.assignedElements({flatten:!0}).filter(e=>!e.classList.contains("empty-menu")&&!e.hasAttribute("hidden"))}if(null===(t=this.menu)||void 0===t?void 0:t.hasChildNodes()){return[...Array.from(this.menu.children)]}return[]}_getActiveMenuItems(){return this._getMenuItems().filter(e=>!e.disabled&&!e.hidden)}_setMenuItem(e){const t=this._getActiveMenuItems();if(0===t.length)return;const i=(e%t.length+t.length)%t.length,l=t[i];this.emit("i-sgds-option-focus",{detail:{option:l}}),this.nextDropdownItemNo=(i+1)%t.length,this.prevDropdownItemNo=(i-1+t.length)%t.length,t.forEach(e=>{const t=e.shadowRoot.querySelector(".dropdown-item");t.setAttribute("tabindex",e===l?"0":"-1"),e===l&&t.focus()})}}var Xi,Yi;Ji.styles=Gi.styles,e([(Xi="ul.dropdown-menu",(e,t,i)=>{const l=e=>{const i=e.renderRoot?.querySelector(Xi)??null;if(null===i&&Yi&&!e.hasUpdated){const e="object"==typeof t?t.name:t;Ke("",`@query'd field ${JSON.stringify(String(e))} with the 'cache' flag set for selector '${Xi}' has been accessed before the first update and returned null. This is expected if the renderRoot tree has not been provided beforehand (e.g. via Declarative Shadow DOM). Therefore the value hasn't been cached.`)}return i};if(Yi){const{get:a,set:o}="object"==typeof t?e:i??(()=>{const e=Symbol(`${String(t)} (@query() cache)`);return{get(){return this[e]},set(t){this[e]=t}}})();return je(e,t,{get(){let e=a.call(this);return void 0===e&&(e=l(this),(null!==e||this.hasUpdated)&&o.call(this,e)),e}})}return je(e,t,{get(){return l(this)}})})],Ji.prototype,"menu",void 0),e([qe()],Ji.prototype,"nextDropdownItemNo",void 0),e([qe()],Ji.prototype,"prevDropdownItemNo",void 0),e([We({type:Boolean,reflect:!0})],Ji.prototype,"hidden",void 0);var Qi=we`.empty-menu,.loading-menu{padding:var(--sgds-padding-sm) var(--sgds-padding-lg,20px);pointer-events:none}.loading-menu{align-items:center;display:flex;gap:var(--sgds-gap-xs)}`;class el extends(qi(Ji)){constructor(){super(),this.label="",this.hintText="",this.autofocus=!1,this.disabled=!1,this.required=!1,this.loading=!1,this.value="",this.displayValue="",this.defaultValue="",this.hasFeedback=!1,this.invalidFeedback="",this.invalid=!1,this.menuList=[],this.selectedItems=[],this.filteredList=[],this._isTouched=!1,this._controlId=Ni("input"),this._labelId=Ni("label"),this.floatingOpts={middleware:[Ti({apply({rects:e,elements:t}){t.floating.style.width=`${e.reference.width}px`}})]}}connectedCallback(){super.connectedCallback(),this.addEventListener("blur",async e=>{var t;const i=this.constructor.childName,l=(null===(t=e.relatedTarget)||void 0===t?void 0:t.tagName.toLowerCase())===i;this.invalid=!l&&!this._mixinReportValidity()})}reportValidity(){return this._mixinReportValidity()}checkValidity(){return this._mixinCheckValidity()}get validity(){return this._mixinGetValidity()}get validationMessage(){return this._mixinGetValidationMessage()}_renderFeedback(){return this.invalid&&this.hasFeedback?S` <div class="invalid-feedback-container">
82
82
  <slot name="invalidIcon">
83
83
  <sgds-icon name="exclamation-circle-fill" size="md"></sgds-icon>
84
84
  </slot>
@@ -2340,7 +2340,7 @@ function Ge(e){return(t,i)=>je(t,i,{async get(){return await this.updateComplete
2340
2340
  <div class="dropdown-item ${Xe(e)}" tabindex=${this.disabled?"-1":"0"}>
2341
2341
  ${this._renderItemContent()}
2342
2342
  </div>
2343
- `}}Sl.styles=[$l],e([We({type:Boolean,reflect:!0})],Sl.prototype,"active",void 0),e([We({type:Boolean,reflect:!0})],Sl.prototype,"disabled",void 0),e([We({type:String,reflect:!0})],Sl.prototype,"value",void 0);var Bl=we`.form-label{color:var(--sgds-form-color-default);margin-bottom:0}.form-label.disabled{opacity:var(--sgds-opacity-50)}.form-check-label{color:var(--sgds-form-color-default)}.form-check-input:disabled~.form-check-label,.form-check-input[disabled]~.form-check-label{cursor:not-allowed}`,Ll=we`.form-control::placeholder{color:var(--sgds-form-color-subtle);font-family:var(--sgds-font-family-brand);font-weight:var(--sgds-font-weight-light);line-height:var(--sgds-line-height-24)}`;class Al extends Ki{constructor(){super(...arguments),this.label="",this.hintText="",this.disabled=!1,this.invalid=!1,this._controlId=Ni("input"),this._labelId=Ni("label")}setInvalid(e){this.invalid=e,e?this.emit("sgds-invalid"):this.emit("sgds-valid")}}Al.styles=[...Ki.styles,zi,Di,Bl,Ll],e([We({reflect:!0})],Al.prototype,"label",void 0),e([We({reflect:!0})],Al.prototype,"hintText",void 0),e([We({reflect:!0})],Al.prototype,"name",void 0),e([We({type:Boolean,reflect:!0})],Al.prototype,"disabled",void 0),e([We({type:Boolean,reflect:!0})],Al.prototype,"invalid",void 0);var El=we`.form-check-input[type=checkbox]{border-radius:var(--sgds-form-border-radius-md)}.form-check-input[checked]{--sgds-radio-bg-image:url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="17" height="16" fill="none"><path d="M14.347 3.979a.522.522 0 0 1 0 .739L7.043 12.02a.521.521 0 0 1-.738 0L2.653 8.369a.522.522 0 1 1 .739-.738l3.282 3.283 6.934-6.935a.52.52 0 0 1 .739 0Z" fill="%23fff"/></svg>')}.form-check-input:indeterminate,.form-check-input[indeterminate]{--sgds-radio-bg-image:url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="17" height="16" fill="none"><path fill-rule="evenodd" clip-rule="evenodd" d="M2.5 8a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5Z" fill="%23fff"/></svg>');background-color:var(--sgds-form-primary-surface-default);border:var(--sgds-form-border-width-default) solid var(--sgds-border-color-transparent)}.form-check-input:indeterminate:focus,.form-check-input:indeterminate:hover,.form-check-input[indeterminate]:focus-visible,.form-check-input[indeterminate]:hover{background-color:var(--sgds-form-primary-surface-emphasis)}.form-check-input:indeterminate.is-invalid,.form-check-input[checked].is-invalid,.form-check-input[indeterminate].is-invalid{background-color:var(--sgds-form-danger-surface-default)}.form-check-label{flex:1}.form-check{margin:var(--sgds-form-padding-inline-sm) 0;padding:0}`,Il=we`input{margin:0}.form-check{display:flex;gap:var(--sgds-form-gap-md);padding:var(--sgds-form-padding-inline-sm) 0}.form-check-input{appearance:none;background-color:var(--sgds-form-surface-default);background-image:var(--sgds-radio-bg-image);background-position:50%;background-repeat:no-repeat;background-size:auto;border:var(--sgds-form-border-width-default) solid var(--sgds-border-color-default);height:var(--sgds-form-height-sm);width:var(--sgds-form-width-xs)}.form-check-input[checked]{background-color:var(--sgds-form-primary-surface-default);border:var(--sgds-form-border-width-default) solid var(--sgds-border-color-transparent)}.form-check-input:focus-visible{outline:var(--sgds-form-outline-focus);outline-offset:var(--sgds-form-outline-offset-focus)}.form-check-input:not([disabled]):not(.is-invalid):not([aria-checked=true]):not(:focus-visible):hover{outline:var(--sgds-form-border-width-thick) solid var(--sgds-border-color-emphasis);outline-offset:var(--sgds-form-outline-offset-focus)}.form-check-input:not([disabled]):not(.is-invalid)[checked]:focus-visible,.form-check-input:not([disabled]):not(.is-invalid)[checked]:hover{background-color:var(--sgds-form-primary-surface-emphasis)}:host([disabled]) .form-check{cursor:not-allowed;opacity:var(--sgds-opacity-50)}.form-check-input:not([disabled]).is-invalid{border:var(--sgds-form-border-width-default) solid var(--sgds-form-danger-border-color-default)}.form-check-input:not([disabled]).is-invalid:focus-visible{outline:var(--sgds-border-width-2) solid var(--sgds-form-danger-color-default);outline-offset:var(--sgds-form-outline-offset-focus)}`;class Tl extends(qi(Al)){constructor(){super(...arguments),this.checked=!1,this.defaultChecked=!1,this.indeterminate=!1,this.required=!1,this.invalidFeedback="",this._isTouched=!1}click(){this.input.click()}focus(e){this.input.focus(e)}blur(){this.input.blur()}_handleChange(e){this.indeterminate&&(this.indeterminate=!this.indeterminate),this.checked=!this.checked,super._mixinHandleChange(e),this.emit("sgds-change",{detail:{checked:this.checked,value:this.value}}),this.checked?this.emit("sgds-check",{detail:{value:this.value}}):this.emit("sgds-uncheck",{detail:{value:this.value}})}_handleKeyDown(e){const t=e.metaKey||e.ctrlKey||e.shiftKey||e.altKey;"Enter"!==e.key||t||this.click()}_handleBlur(){this._isTouched=!0,this.emit("sgds-blur")}_handleFocus(){this.emit("sgds-focus")}_handleInvalid(e){e.preventDefault(),this.invalid=!0}_handleDisabledChange(){this.setInvalid(!1)}_handleIsTouched(){this._isTouched&&(this.invalid=!this.input.checkValidity())}_mixinResetFormControl(){this._isTouched=!1,this.checked=this.input.checked=this.defaultChecked,this.input.dispatchEvent(new InputEvent("reset")),this._mixinResetValidity(this.input)}reportValidity(){return this._mixinReportValidity()}checkValidity(){return this._mixinCheckValidity()}get validity(){return this._mixinGetValidity()}get validationMessage(){return this._mixinGetValidationMessage()}firstUpdated(e){super.firstUpdated(e),this.checked&&this.emit("sgds-check",{detail:{value:this.value}})}render(){const e="both"===this.hasFeedback||"style"===this.hasFeedback,t="both"===this.hasFeedback||"text"===this.hasFeedback;return S`
2343
+ `}}Sl.styles=[$l],e([We({type:Boolean,reflect:!0})],Sl.prototype,"active",void 0),e([We({type:Boolean,reflect:!0})],Sl.prototype,"disabled",void 0),e([We({type:String,reflect:!0})],Sl.prototype,"value",void 0);var Bl=we`.form-label{color:var(--sgds-form-color-default);margin-bottom:0}.form-label.disabled{opacity:var(--sgds-opacity-50)}.form-check-label{color:var(--sgds-form-color-default)}.form-check-input:disabled~.form-check-label,.form-check-input[disabled]~.form-check-label{cursor:not-allowed}`,Ll=we`.form-control::placeholder{color:var(--sgds-form-color-subtle);font-family:var(--sgds-font-family-brand);font-weight:var(--sgds-font-weight-light);line-height:var(--sgds-line-height-24)}`;class Al extends Ki{constructor(){super(...arguments),this.label="",this.hintText="",this.disabled=!1,this.invalid=!1,this._controlId=Ni("input"),this._labelId=Ni("label")}setInvalid(e){this.invalid=e,e?this.emit("sgds-invalid"):this.emit("sgds-valid")}}Al.styles=[...Ki.styles,zi,Di,Bl,Ll],e([We({reflect:!0})],Al.prototype,"label",void 0),e([We({reflect:!0})],Al.prototype,"hintText",void 0),e([We({reflect:!0})],Al.prototype,"name",void 0),e([We({type:Boolean,reflect:!0})],Al.prototype,"disabled",void 0),e([We({type:Boolean,reflect:!0})],Al.prototype,"invalid",void 0);var El=we`.form-check-input[type=checkbox]{border-radius:var(--sgds-form-border-radius-md)}.form-check-input[checked]{--sgds-radio-bg-image:url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="17" height="16" fill="none"><path d="M14.347 3.979a.522.522 0 0 1 0 .739L7.043 12.02a.521.521 0 0 1-.738 0L2.653 8.369a.522.522 0 1 1 .739-.738l3.282 3.283 6.934-6.935a.52.52 0 0 1 .739 0Z" fill="%23fff"/></svg>')}.form-check-input:indeterminate,.form-check-input[indeterminate]{--sgds-radio-bg-image:url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="17" height="16" fill="none"><path fill-rule="evenodd" clip-rule="evenodd" d="M2.5 8a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5Z" fill="%23fff"/></svg>');background-color:var(--sgds-form-primary-surface-default);border:var(--sgds-form-border-width-default) solid var(--sgds-border-color-transparent)}.form-check-input:indeterminate:focus,.form-check-input:indeterminate:hover,.form-check-input[indeterminate]:focus-visible,.form-check-input[indeterminate]:hover{background-color:var(--sgds-form-primary-surface-emphasis)}.form-check-input:indeterminate.is-invalid,.form-check-input[checked].is-invalid,.form-check-input[indeterminate].is-invalid{background-color:var(--sgds-form-danger-surface-default)}.form-check-label{flex:1}.form-check{margin:var(--sgds-form-padding-inline-sm) 0;padding:0}`,Il=we`input{margin:0}.form-check{display:flex;gap:var(--sgds-form-gap-md);padding:var(--sgds-form-padding-inline-sm) 0}.form-check-input{appearance:none;background-color:var(--sgds-form-surface-default);background-image:var(--sgds-radio-bg-image);background-position:50%;background-repeat:no-repeat;background-size:auto;border:var(--sgds-form-border-width-default) solid var(--sgds-border-color-default);height:var(--sgds-form-height-sm);width:var(--sgds-form-width-xs)}.form-check-input[checked]{background-color:var(--sgds-form-primary-surface-default);border:var(--sgds-form-border-width-default) solid var(--sgds-border-color-transparent)}.form-check-input:focus-visible{outline:var(--sgds-form-outline-focus);outline-offset:var(--sgds-form-outline-offset-focus)}.form-check-input:not([disabled]):not(.is-invalid):not([aria-checked=true]):not(:focus-visible):hover{outline:var(--sgds-form-border-width-thick) solid var(--sgds-border-color-emphasis);outline-offset:var(--sgds-form-outline-offset-focus)}.form-check-input:not([disabled]):not(.is-invalid)[checked]:focus-visible,.form-check-input:not([disabled]):not(.is-invalid)[checked]:hover{background-color:var(--sgds-form-primary-surface-emphasis)}:host([disabled]) .form-check{cursor:not-allowed;opacity:var(--sgds-opacity-50)}.form-check-input:not([disabled]).is-invalid{border:var(--sgds-form-border-width-default) solid var(--sgds-form-danger-border-color-default)}.form-check-input:not([disabled]).is-invalid:focus-visible{outline:var(--sgds-border-width-2) solid var(--sgds-form-danger-color-default);outline-offset:var(--sgds-form-outline-offset-focus)}`;class Tl extends(qi(Al)){constructor(){super(...arguments),this.checked=!1,this.defaultChecked=!1,this.indeterminate=!1,this.required=!1,this.invalidFeedback="",this._isTouched=!1,this._handleHostClick=e=>{e.composedPath()[0]===this&&(e.stopPropagation(),this.input.click())}}click(){this.input.click()}focus(e){this.input.focus(e)}blur(){this.input.blur()}_handleChange(e){this.indeterminate&&(this.indeterminate=!this.indeterminate),this.checked=!this.checked,super._mixinHandleChange(e),this.emit("sgds-change",{detail:{checked:this.checked,value:this.value}}),this.checked?this.emit("sgds-check",{detail:{value:this.value}}):this.emit("sgds-uncheck",{detail:{value:this.value}})}_handleKeyDown(e){const t=e.metaKey||e.ctrlKey||e.shiftKey||e.altKey;"Enter"!==e.key||t||this.click()}_handleBlur(){this._isTouched=!0,this.emit("sgds-blur")}_handleFocus(){this.emit("sgds-focus")}_handleInvalid(e){e.preventDefault(),this.invalid=!0}_handleDisabledChange(){this.setInvalid(!1)}_handleIsTouched(){this._isTouched&&(this.invalid=!this.input.checkValidity())}_mixinResetFormControl(){this._isTouched=!1,this.checked=this.input.checked=this.defaultChecked,this.input.dispatchEvent(new InputEvent("reset")),this._mixinResetValidity(this.input)}reportValidity(){return this._mixinReportValidity()}checkValidity(){return this._mixinCheckValidity()}get validity(){return this._mixinGetValidity()}get validationMessage(){return this._mixinGetValidationMessage()}firstUpdated(e){super.firstUpdated(e),this.checked&&this.emit("sgds-check",{detail:{value:this.value}})}connectedCallback(){super.connectedCallback(),this.addEventListener("click",this._handleHostClick)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",this._handleHostClick)}render(){const e="both"===this.hasFeedback||"style"===this.hasFeedback,t="both"===this.hasFeedback||"text"===this.hasFeedback;return S`
2344
2344
  <div class="form-check">
2345
2345
  <input
2346
2346
  class=${Xe({"form-check-input":!0,"is-invalid":e&&this.invalid})}