@webority/ui-elements 0.150.0 → 0.153.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 (110) hide show
  1. package/dist/{WuiCommentThread-By-u3c5S.js → WuiCommentThread-BmRsl0K1.js} +1 -1
  2. package/dist/{WuiDataTable-D8UW2DMH.js → WuiDataTable-B4BYCd_s.js} +1 -1
  3. package/dist/WuiInlineEdit-BlBuWkHG.js +1 -0
  4. package/dist/{WuiLightbox-D7Nf1SbH.js → WuiLightbox-C2A14vHx.js} +1 -1
  5. package/dist/{WuiMarkdown-N96OX-To.js → WuiMarkdown-BXY0QKaO.js} +1 -1
  6. package/dist/{WuiMentionInput-BFB57FZI.js → WuiMentionInput-8Xjkzdqg.js} +1 -1
  7. package/dist/{WuiNotificationCenter-C6e13nCh.js → WuiNotificationCenter-ClkCTUnp.js} +1 -1
  8. package/dist/{WuiOverflow-CeLUmJR-.js → WuiOverflow-B0wA6aDe.js} +1 -1
  9. package/dist/{WuiPhone-rtex3VDC.js → WuiPhone-BVNVerap.js} +1 -1
  10. package/dist/{WuiRelativeTime-RdC80Zii.js → WuiRelativeTime-DyeUQOQ8.js} +1 -1
  11. package/dist/{WuiRollingNumber-YRMeRCGW.js → WuiRollingNumber-sfgNzaP0.js} +1 -1
  12. package/dist/WuiSavedViews-UaiP6YNG.js +1 -0
  13. package/dist/WuiSelect-DBPre2oe.js +9 -0
  14. package/dist/WuiTour-Cx61ijsm.js +1 -0
  15. package/dist/{WuiTree-ZD9GGmtg.js → WuiTree-0Yqu199O.js} +1 -1
  16. package/dist/{chips-2yXiMhK4.js → chips-Dony2fgq.js} +1 -1
  17. package/dist/{dataTable-D23oUOhU.js → dataTable-B-7oAeii.js} +1 -1
  18. package/dist/{drawerDiscard-CUN8L47U.js → drawerDiscard-C0yRSl1I.js} +1 -1
  19. package/dist/elements/comment-thread.js +1 -1
  20. package/dist/elements/data-table.js +1 -1
  21. package/dist/elements/inline-edit.js +1 -1
  22. package/dist/elements/kanban.js +1 -1
  23. package/dist/elements/lightbox.js +1 -1
  24. package/dist/elements/markdown.js +1 -1
  25. package/dist/elements/mention-input.js +1 -1
  26. package/dist/elements/notification-center.js +1 -1
  27. package/dist/elements/overflow.js +1 -1
  28. package/dist/elements/phone.js +1 -1
  29. package/dist/elements/relative-time.js +1 -1
  30. package/dist/elements/rolling-number.js +1 -1
  31. package/dist/elements/saved-views.js +1 -1
  32. package/dist/elements/select.js +1 -1
  33. package/dist/elements/tour.js +1 -1
  34. package/dist/elements/tree.js +1 -1
  35. package/dist/{fileViewerImage-tzF4DDq7.js → fileViewerImage-Bt1jeArm.js} +1 -1
  36. package/dist/{fileViewerPdf-BLMhF8NT.js → fileViewerPdf-CdaDuaRJ.js} +1 -1
  37. package/dist/formatters-ljfITOZ3.js +1 -0
  38. package/dist/helpers.js +1 -1
  39. package/dist/{inlineEditText-H7Pr8IU9.js → inlineEditText-CsLCQbcg.js} +1 -1
  40. package/dist/{kanban-CJ587-XT.js → kanban-Dz8m-17x.js} +1 -1
  41. package/dist/{kanbanModel-BdqSa1lJ.js → kanbanModel-C2IOPJ8L.js} +1 -1
  42. package/dist/{notificationDays-BKVW7xYD.js → notificationDays-BIWczft0.js} +1 -1
  43. package/dist/{relativeTime-YTAOONRy.js → relativeTime-BahImc8F.js} +1 -1
  44. package/dist/{search-BXcvm716.js → search-C8xIzt6h.js} +1 -1
  45. package/dist/server.js +1 -1
  46. package/dist/ui-calendar.global.js +1 -1
  47. package/dist/ui-calendar.js +1 -1
  48. package/dist/ui-chart.global.js +2 -2
  49. package/dist/ui-chart.js +2 -2
  50. package/dist/ui-elements/carousel.global.js +1 -1
  51. package/dist/ui-elements/code-block.global.js +1 -1
  52. package/dist/ui-elements/command-palette.global.js +1 -1
  53. package/dist/ui-elements/comment-thread.global.js +1 -1
  54. package/dist/ui-elements/consent-banner.global.js +1 -1
  55. package/dist/ui-elements/context-menu.global.js +1 -1
  56. package/dist/ui-elements/date-range.global.js +1 -1
  57. package/dist/ui-elements/drawer.global.js +1 -1
  58. package/dist/ui-elements/glyphs.global.js +1 -1
  59. package/dist/ui-elements/image-crop.global.js +1 -1
  60. package/dist/ui-elements/inline-edit.global.js +1 -1
  61. package/dist/ui-elements/kanban.global.js +1 -1
  62. package/dist/ui-elements/lead-popup.global.js +1 -1
  63. package/dist/ui-elements/lightbox.global.js +1 -1
  64. package/dist/ui-elements/markdown.global.js +2 -2
  65. package/dist/ui-elements/org-tree.global.js +1 -1
  66. package/dist/ui-elements/phone.global.js +2 -2
  67. package/dist/ui-elements/resizable.global.js +1 -1
  68. package/dist/ui-elements/saved-views.global.js +1 -1
  69. package/dist/ui-elements/select-chips.global.js +1 -1
  70. package/dist/ui-elements/select-recents.global.js +1 -1
  71. package/dist/ui-elements/select-search.global.js +1 -1
  72. package/dist/ui-elements/slider.global.js +1 -1
  73. package/dist/ui-elements/sortable.global.js +1 -1
  74. package/dist/ui-elements/status-icon.global.js +1 -1
  75. package/dist/ui-elements/timepicker.global.js +1 -1
  76. package/dist/ui-elements/tour.global.js +1 -1
  77. package/dist/ui-elements/tree.global.js +1 -1
  78. package/dist/ui-elements/wizard.global.js +1 -1
  79. package/dist/ui-elements.global.js +9 -9
  80. package/dist/ui-elements.js +1 -1
  81. package/dist/ui-file-viewer.global.js +1 -1
  82. package/dist/ui-file-viewer.js +1 -1
  83. package/dist/ui-tour.global.js +1 -1
  84. package/dist/{wuiHttp-523iN_RF.js → wuiHttp-DGbD7Fra.js} +1 -1
  85. package/package.json +4 -3
  86. package/types/WuiCommentThread.d.ts +2 -2
  87. package/types/WuiImageCrop.d.ts +4 -4
  88. package/types/WuiSelect.d.ts +9 -0
  89. package/types/WuiTour.d.ts +1 -1
  90. package/types/chartSpec.d.ts +20 -20
  91. package/types/fileValidation.d.ts +2 -2
  92. package/types/fileViewerPdf.d.ts +3 -3
  93. package/types/formatters.d.ts +19 -14
  94. package/types/inputMask.d.ts +3 -3
  95. package/types/kanban.d.ts +1 -1
  96. package/types/listQuery.d.ts +10 -10
  97. package/types/razor-js/modules/api.d.ts +3 -0
  98. package/types/razor-js/modules/buttons.d.ts +1 -0
  99. package/types/razor-js/modules/widgets.d.ts +1 -0
  100. package/types/razor-js/webority-ui.d.ts +3 -0
  101. package/types/select/list.d.ts +8 -8
  102. package/types/server/remoteModal.d.ts +12 -12
  103. package/types/server/wuiHttp.d.ts +5 -5
  104. package/types/stepperHeader.d.ts +2 -2
  105. package/types/themeTransition.d.ts +2 -2
  106. package/dist/WuiInlineEdit-r55qgh8A.js +0 -1
  107. package/dist/WuiSavedViews-DtyAoZKb.js +0 -1
  108. package/dist/WuiSelect-D9ABfsdZ.js +0 -9
  109. package/dist/WuiTour-CrIFLmSK.js +0 -1
  110. package/dist/formatters-C3V6M5zV.js +0 -1
@@ -16,40 +16,40 @@ export type FormatSpec = {
16
16
  /** `percent` takes a ratio, as Intl does: 0.125 shows as 12.5%. */
17
17
  style: FormatStyle;
18
18
  /** For currency and compact: an ISO 4217 code (three capital letters), INR when omitted. */
19
- currency?: string;
19
+ currency?: string | undefined;
20
20
  /** What the value counts: `rupees` (default) or `paise` for money, `ms`, `s` (default), `min` or `h` for a duration. */
21
- unit?: FormatUnit;
21
+ unit?: FormatUnit | undefined;
22
22
  /** Fraction digits: fixed for currency (default 0), a cap otherwise. */
23
- decimals?: number;
23
+ decimals?: number | undefined;
24
24
  /** For `date` (default `day`, 04-Oct-2026 in the time zone of the chart (IST by default)). */
25
- pattern?: DatePattern;
25
+ pattern?: DatePattern | undefined;
26
26
  };
27
27
  /** The x column: the column holding the x value (see the spec's description of each type). */
28
28
  export type XColumn = {
29
29
  key: string;
30
- kind?: XKind;
31
- format?: FormatSpec;
32
- label?: string;
33
- labelFit?: LabelFit;
30
+ kind?: XKind | undefined;
31
+ format?: FormatSpec | undefined;
32
+ label?: string | undefined;
33
+ labelFit?: LabelFit | undefined;
34
34
  };
35
35
  /** A value column, in the order it takes its colour. */
36
36
  export type SeriesColumn = {
37
37
  key: string;
38
38
  label: string;
39
- format?: FormatSpec;
39
+ format?: FormatSpec | undefined;
40
40
  };
41
41
  /** A column that names a second dimension (group, to, size). */
42
42
  export type KeyedColumn = {
43
43
  key: string;
44
- label?: string;
45
- format?: FormatSpec;
44
+ label?: string | undefined;
45
+ format?: FormatSpec | undefined;
46
46
  };
47
47
  /** The one value axis. */
48
48
  export type YAxis = {
49
- label?: string;
50
- format?: FormatSpec;
51
- min?: number;
52
- max?: number;
49
+ label?: string | undefined;
50
+ format?: FormatSpec | undefined;
51
+ min?: number | undefined;
52
+ max?: number | undefined;
53
53
  wholeNumbers?: boolean;
54
54
  };
55
55
  /** A gauge band: the stretch of the scale up to `upTo`. */
@@ -151,7 +151,7 @@ export type NormalizedSpec = {
151
151
  x: {
152
152
  key: string;
153
153
  kind: XKind;
154
- format?: FormatSpec;
154
+ format?: FormatSpec | undefined;
155
155
  label: string;
156
156
  labelFit: LabelFit;
157
157
  };
@@ -165,9 +165,9 @@ export type NormalizedSpec = {
165
165
  stack: StackMode;
166
166
  y: {
167
167
  label: string;
168
- format?: FormatSpec;
169
- min?: number;
170
- max?: number;
168
+ format?: FormatSpec | undefined;
169
+ min?: number | undefined;
170
+ max?: number | undefined;
171
171
  wholeNumbers: boolean;
172
172
  };
173
173
  target: {
@@ -193,7 +193,7 @@ export type NormalizeResult = {
193
193
  problem: string;
194
194
  };
195
195
  export type TooltipRow = {
196
- color?: string;
196
+ color?: string | undefined;
197
197
  line?: boolean;
198
198
  label: string;
199
199
  value: string;
@@ -42,6 +42,6 @@ export declare function matchesAccept(file: FileLike, accept: string | null | un
42
42
  export declare function validateFile(file: (FileLike & {
43
43
  size: number;
44
44
  }) | null | undefined, opts?: {
45
- accept?: string;
46
- maxSizeMb?: number | null;
45
+ accept?: string | undefined;
46
+ maxSizeMb?: number | null | undefined;
47
47
  }): string | null;
@@ -5,9 +5,9 @@ export type PdfFirstPageSource = Blob | {
5
5
  url: string;
6
6
  };
7
7
  export interface PdfFirstPageOptions {
8
- workerSrc?: string;
9
- assetBase?: string;
10
- width?: number;
8
+ workerSrc?: string | undefined;
9
+ assetBase?: string | undefined;
10
+ width?: number | undefined;
11
11
  }
12
12
  export declare function renderFirstPage(source: PdfFirstPageSource, { workerSrc, assetBase, width }?: PdfFirstPageOptions): Promise<Blob>;
13
13
  interface Size {
@@ -15,6 +15,11 @@ export declare function isMoneyUnit(value: string): value is MoneyUnit;
15
15
  export declare const EMPTY_VALUE: string;
16
16
  /** The most fraction digits a format may ask for; Intl.NumberFormat throws past its own limit. */
17
17
  export declare const MAX_DECIMALS: number;
18
+ /**
19
+ * A whole paise amount as rupee text, by moving the decimal point on its digits: 12345 is "123.45".
20
+ * No floating-point division, so a large amount stays exact. A fraction of a paisa throws.
21
+ */
22
+ export declare function paiseToRupeeText(paise: number): string;
18
23
  /** A plain number with Indian grouping: 12,34,567.5. `decimals` caps the fraction (default 2). */
19
24
  export declare function formatNumber(value: unknown, { decimals }?: {
20
25
  decimals?: unknown;
@@ -22,13 +27,13 @@ export declare function formatNumber(value: unknown, { decimals }?: {
22
27
  /**
23
28
  * Money: rupees get Indian grouping (₹12,34,567), any other currency three-digit grouping ($1,234,567).
24
29
  * The symbol is the currency's (₹, $, €, £); any other ISO code prints as "AED 1,234". `unit: "paise"`
25
- * takes the value in paise and divides once, here, for any currency. `decimals` (default 0) is fixed,
30
+ * takes the value in whole paise (a fraction throws) and shifts the decimal point once, here, for any currency. `decimals` (default 0) is fixed,
26
31
  * so a column of amounts lines up: pass 2 where paise matter, as on an invoice.
27
32
  */
28
- export declare function formatCurrency(value: unknown, { unit, decimals, currency }?: {
29
- unit?: string;
33
+ export declare function formatCurrency(value: unknown, { unit, decimals, currency, }?: {
34
+ unit?: string | undefined;
30
35
  decimals?: unknown;
31
- currency?: string;
36
+ currency?: string | undefined;
32
37
  }): string;
33
38
  /**
34
39
  * The short form. For rupees, in lakh and crore: 81.2 K, 19.8 L, ₹3.8 Cr. For any other currency, in K,
@@ -37,8 +42,8 @@ export declare function formatCurrency(value: unknown, { unit, decimals, currenc
37
42
  * "1 L", never "100 K"). Below a thousand it is the plain number.
38
43
  */
39
44
  export declare function formatCompact(value: unknown, { currency, unit }?: {
40
- currency?: string;
41
- unit?: string;
45
+ currency?: string | undefined;
46
+ unit?: string | undefined;
42
47
  }): string;
43
48
  /** A percentage given as a ratio, as Intl takes it: 0.125 is "12.5%". `decimals` caps the fraction (default 1). */
44
49
  export declare function formatPercent(value: unknown, { decimals }?: {
@@ -49,7 +54,7 @@ export declare function formatPercent(value: unknown, { decimals }?: {
49
54
  * "320 ms". `unit` says what the value counts (default seconds).
50
55
  */
51
56
  export declare function formatDuration(value: unknown, { unit }?: {
52
- unit?: string;
57
+ unit?: string | undefined;
53
58
  }): string;
54
59
  /**
55
60
  * The instant a date value stands for, in epoch ms, or NaN. A number is epoch ms, a Date is
@@ -70,20 +75,20 @@ export declare function istParts(instant: number, timeZone?: string): {
70
75
  * `month` Oct-2026, `year` 2026, `datetime` 04-Oct-2026 14:05, `time` 14:05.
71
76
  */
72
77
  export declare function formatDate(value: unknown, { pattern, timeZone }?: {
73
- pattern?: string;
74
- timeZone?: string;
78
+ pattern?: string | undefined;
79
+ timeZone?: string | undefined;
75
80
  }): string;
76
81
  /** A short day for a crowded axis: 04-Oct. */
77
82
  export declare function formatDayShort(value: unknown, { timeZone }?: {
78
83
  timeZone?: string;
79
84
  }): string;
80
85
  interface FormatOptions {
81
- style?: string;
82
- currency?: string;
83
- unit?: string;
86
+ style?: string | undefined;
87
+ currency?: string | undefined;
88
+ unit?: string | undefined;
84
89
  decimals?: unknown;
85
- pattern?: string;
86
- timeZone?: string;
90
+ pattern?: string | undefined;
91
+ timeZone?: string | undefined;
87
92
  }
88
93
  /**
89
94
  * Format a value by a format description, the one call the chart makes everywhere:
@@ -4,7 +4,7 @@ declare global {
4
4
  validator?: {
5
5
  prototype: ValidatorPrototype;
6
6
  };
7
- };
7
+ } | undefined;
8
8
  }
9
9
  }
10
10
  interface ValidatorPrototype {
@@ -13,7 +13,7 @@ interface ValidatorPrototype {
13
13
  }
14
14
  interface MaskSpec {
15
15
  inputMode: string;
16
- normalize?: (text: string) => string;
16
+ normalize?: ((text: string) => string) | undefined;
17
17
  post: (raw: string, formatted: string) => string;
18
18
  message: string;
19
19
  extract(text: string): string;
@@ -46,7 +46,7 @@ export declare function formatMasked(mask: unknown, value: unknown): string;
46
46
  /** The value `el` posts under its mask, or undefined when `el` carries none (or posts it formatted). */
47
47
  export declare const maskedPostValue: (el: HTMLElement) => string | undefined;
48
48
  interface AttachOptions {
49
- mask?: string;
49
+ mask?: string | undefined;
50
50
  postFormatted?: boolean;
51
51
  onChange?: (raw: string, formatted: string) => void;
52
52
  onInvalidChange?: (message: string) => void;
package/types/kanban.d.ts CHANGED
@@ -44,7 +44,7 @@ interface KeyboardLift {
44
44
  verdicts: Map<string | null, Verdict>;
45
45
  }
46
46
  export declare class WuiKanban extends ElementBase {
47
- accept?: (card: HTMLElement, from: string | null, to: string | null) => boolean | string | undefined;
47
+ accept?: ((card: HTMLElement, from: string | null, to: string | null) => boolean | string | undefined) | undefined;
48
48
  _wired: boolean;
49
49
  _filter: ((card: HTMLElement) => boolean) | null;
50
50
  _expanded: Set<string | null>;
@@ -10,19 +10,19 @@ export type FacetValue = FilterScalar | FilterScalar[] | {
10
10
  to?: FilterScalar;
11
11
  };
12
12
  export interface BuildListQueryOptions {
13
- page?: number;
14
- pageSize?: number;
15
- sortBy?: string;
13
+ page?: number | undefined;
14
+ pageSize?: number | undefined;
15
+ sortBy?: string | undefined;
16
16
  sortOrder?: unknown;
17
- search?: string;
18
- filters?: Record<string, FacetValue>;
17
+ search?: string | undefined;
18
+ filters?: Record<string, FacetValue> | undefined;
19
19
  }
20
20
  export interface ListQueryDefaults {
21
- page?: number;
22
- pageSize?: number;
23
- sortBy?: string;
24
- sortOrder?: SortOrder;
25
- filters?: Record<string, FacetValue>;
21
+ page?: number | undefined;
22
+ pageSize?: number | undefined;
23
+ sortBy?: string | undefined;
24
+ sortOrder?: SortOrder | undefined;
25
+ filters?: Record<string, FacetValue> | undefined;
26
26
  }
27
27
  export interface ParseListQueryOptions {
28
28
  facets?: ListFacet[];
@@ -28,6 +28,9 @@ export declare const shell: {
28
28
  export declare const filePicker: {
29
29
  setLoading: (target: string | Element, on: boolean) => void;
30
30
  };
31
+ export declare const button: {
32
+ setLoading: (target: HTMLElement | string, isLoading: boolean) => void;
33
+ };
31
34
  export declare const unsaved: {
32
35
  reset: (target: string | Element) => void;
33
36
  };
@@ -0,0 +1 @@
1
+ export declare const setButtonLoading: (target: HTMLElement | string, isLoading: boolean) => void;
@@ -2,6 +2,7 @@ export declare const initChipRemove: (root?: ParentNode) => void;
2
2
  export declare const initActionIconFiles: () => void;
3
3
  export declare const initRepeaterSubmit: () => void;
4
4
  export declare const initWorkspaceSwitchers: (root?: ParentNode) => void;
5
+ export declare const initDropdownSearch: (root?: ParentNode) => void;
5
6
  export declare const initBannerDismiss: (root?: ParentNode) => void;
6
7
  export declare const initCardClose: (root?: ParentNode) => void;
7
8
  export declare const initAccordions: (root?: ParentNode) => void;
@@ -28,6 +28,9 @@ declare const wui: {
28
28
  filePicker: {
29
29
  setLoading: (target: string | Element, on: boolean) => void;
30
30
  };
31
+ button: {
32
+ setLoading: (target: HTMLElement | string, isLoading: boolean) => void;
33
+ };
31
34
  unsaved: {
32
35
  reset: (target: string | Element) => void;
33
36
  };
@@ -20,13 +20,13 @@ export declare function filterOptions(options: SelectOption[], query: string): S
20
20
  * @param listEl the listbox (.wui-select-options); its id prefixes each row id
21
21
  */
22
22
  export declare function renderOptions(listEl: HTMLElement, options: SelectOption[], view?: {
23
- selected?: string[];
24
- query?: string;
25
- status?: "idle" | "loading" | "empty" | "hint";
26
- emptyText?: string;
27
- searchingText?: string;
28
- hintText?: string;
29
- actionRow?: ActionRow[];
30
- recents?: Recents;
23
+ selected?: string[] | undefined;
24
+ query?: string | undefined;
25
+ status?: "idle" | "loading" | "empty" | "hint" | undefined;
26
+ emptyText?: string | undefined;
27
+ searchingText?: string | undefined;
28
+ hintText?: string | undefined;
29
+ actionRow?: ActionRow[] | undefined;
30
+ recents?: Recents | undefined;
31
31
  }): void;
32
32
  export {};
@@ -21,18 +21,18 @@ export interface ModalHandle {
21
21
  closed: Promise<SessionClose>;
22
22
  }
23
23
  export interface RemoteOptions {
24
- size?: string | number;
25
- title?: string;
26
- staticBackdrop?: boolean;
27
- placement?: string;
28
- container?: Container;
29
- trigger?: HTMLElement | null;
30
- target?: Element | string | null;
31
- method?: string;
32
- body?: BodyInit;
33
- signal?: AbortSignal;
34
- onSuccess?: (detail: Detail, handle: ModalHandle) => void;
35
- navigate?: (url: string) => void;
24
+ size?: string | number | undefined;
25
+ title?: string | undefined;
26
+ staticBackdrop?: boolean | undefined;
27
+ placement?: string | undefined;
28
+ container?: Container | undefined;
29
+ trigger?: HTMLElement | null | undefined;
30
+ target?: Element | string | null | undefined;
31
+ method?: string | undefined;
32
+ body?: BodyInit | undefined;
33
+ signal?: AbortSignal | undefined;
34
+ onSuccess?: ((detail: Detail, handle: ModalHandle) => void) | undefined;
35
+ navigate?: ((url: string) => void) | undefined;
36
36
  }
37
37
  /** Id of the shared dialog `load()` creates on first use. */
38
38
  export declare const REMOTE_SHELL_ID: string;
@@ -40,12 +40,12 @@ export interface WuiToastAction {
40
40
  method: string;
41
41
  }
42
42
  export interface WuiFetchOptions {
43
- method?: string;
44
- body?: BodyInit;
45
- headers?: Record<string, string>;
46
- signal?: AbortSignal;
43
+ method?: string | undefined;
44
+ body?: BodyInit | undefined;
45
+ headers?: Record<string, string> | undefined;
46
+ signal?: AbortSignal | undefined;
47
47
  /** Replaces the session-expiry navigation (tests, or a host that wants to show a "signed out" notice first). */
48
- navigate?: (url: string) => void;
48
+ navigate?: ((url: string) => void) | undefined;
49
49
  }
50
50
  export interface WuiResult {
51
51
  kind: HttpKind;
@@ -22,8 +22,8 @@ export declare function deriveStepStatus(index: number, active: number | null |
22
22
  */
23
23
  export declare function stepperHeaderItems(steps: {
24
24
  label: string;
25
- status?: StepStatus;
26
- icon?: string;
25
+ status?: StepStatus | undefined;
26
+ icon?: string | undefined;
27
27
  }[], options: {
28
28
  statusOf: (index: number) => StepStatus;
29
29
  journey: boolean;
@@ -8,8 +8,8 @@ type Point = {
8
8
  type KeyframeBox = {
9
9
  width: number;
10
10
  height: number;
11
- to?: ResolvedTheme;
12
- origin?: Point;
11
+ to?: ResolvedTheme | undefined;
12
+ origin?: Point | undefined;
13
13
  };
14
14
  type ThemeKeyframe = {
15
15
  clipPath: string;
@@ -1 +0,0 @@
1
- import{o as e}from"./calendarMath-D6UUgYTD.js";import{t}from"./elementBase-Cxeyx0tU.js";import"./formatters-C3V6M5zV.js";import{n,r,t as i}from"./inlineEditText-H7Pr8IU9.js";import{l as a}from"./wuiHttp-523iN_RF.js";var o=e=>r.some(t=>t===e),s=`[data-wui-display]`,c=`[data-wui-value]`,l=`[data-wui-editor]`,u=`[data-wui-control]`,d=`[data-wui-error]`,f=`[data-wui-live]`,p=`[aria-expanded="true"]`,m=/* @__PURE__ */ new Set([`select`,`date`]),h=e=>{let t=(typeof e==`object`||typeof e==`function`)&&e!==null&&`message`in e?e.message:void 0;return typeof t==`string`&&t?t:n.failed.server},g=e=>e instanceof HTMLElement&&typeof Reflect.get(e,`value`)==`string`,_=(e,t)=>{let n=e?.querySelector(t)??null;return n instanceof HTMLElement?n:null},v=class extends t{_wired;_editing;_busy;_draft;_pressed;_popupOpen;_savedTimer;static get observedAttributes(){return[`disabled`]}constructor(){super(),this._wired=!1,this._editing=!1,this._busy=!1,this._draft=null,this._pressed=!1,this._popupOpen=!1,this._savedTimer=null,this._onClick=this._onClick.bind(this),this._onKeyCapture=this._onKeyCapture.bind(this),this._onKeyDown=this._onKeyDown.bind(this),this._onFocusOut=this._onFocusOut.bind(this),this._onPointerDown=this._onPointerDown.bind(this),this._onPointerUp=this._onPointerUp.bind(this),this._onChange=this._onChange.bind(this)}connectedCallback(){this._wired||(this._wired=!0,this.addEventListener(`click`,this._onClick),this.addEventListener(`auxclick`,this._onClick),this.addEventListener(`keydown`,this._onKeyCapture,!0),this.addEventListener(`keydown`,this._onKeyDown),this.addEventListener(`focusout`,this._onFocusOut),this.addEventListener(`pointerdown`,this._onPointerDown),this.addEventListener(`change`,this._onChange))}disconnectedCallback(){clearTimeout(this._savedTimer??void 0),this._savedTimer=null,this._releasePress()}attributeChangedCallback(e){e===`disabled`&&this.hasAttribute(`disabled`)&&this.cancel()}edit(){if(this._editing||this._busy||this.hasAttribute(`disabled`))return;let e=_(this,s),t=_(this,l),n=this._control();e&&t&&n&&(this._editing=!0,this._setState(null),n.value=this._draft??this._value(),t.hidden=!1,this.setAttribute(`data-wui-editing`,``),this._focusControl(n),e.hidden=!0)}cancel(){this._editing&&(this._draft=null,this._setError(null),this.getAttribute(`data-wui-state`)===`error`&&this._setState(null),this._close())}_onClick(e){e.stopPropagation();let t=e.target instanceof Node?e.target:null;e.type===`click`&&!this._editing&&this.querySelector(s)?.contains(t)&&this.edit()}_onKeyCapture(){this._popupOpen=!!(this._editing&&this.querySelector(l)?.querySelector(p))}_onKeyDown(e){if(!this._editing){(e.key===`Enter`||e.key===` `)&&e.stopPropagation();return}if(e.stopPropagation(),this._popupOpen)return;if(e.key===`Escape`){e.preventDefault(),this.cancel();return}let t=this._type();e.key!==`Enter`||m.has(t)||(t!==`textarea`||e.ctrlKey||e.metaKey)&&(e.preventDefault(),this._commit(this._control()?.value??``))}_onFocusOut(e){if(!this._editing||this._pressed)return;let t=e.relatedTarget instanceof Node?e.relatedTarget:null;t&&this.contains(t)||document.hasFocus()&&this._commit(this._control()?.value??``)}_onPointerDown(){this._editing&&(this._pressed=!0,document.addEventListener(`pointerup`,this._onPointerUp,!0),document.addEventListener(`pointercancel`,this._onPointerUp,!0))}_onPointerUp(){this._releasePress(),setTimeout(()=>{this._pressed=!1,this._editing&&!this.contains(document.activeElement)&&document.hasFocus()&&this._commit(this._control()?.value??``)},0)}_releasePress(){document.removeEventListener(`pointerup`,this._onPointerUp,!0),document.removeEventListener(`pointercancel`,this._onPointerUp,!0)}_onChange(e){if(!this._editing||!m.has(this._type()))return;let t=this._control();t&&e.target===t&&queueMicrotask(()=>this._commit(t.value))}async _commit(e){if(!this._editing||this._busy)return;let t=this._value();if(e===t){this.cancel();return}let r=typeof this.validate==`function`?this.validate(e):null;if(r){this._setError(r),this._announce(r);return}let a=this.hasAttribute(`controlled`);this._draft=null,this._setError(null),this._busy=!0,this._setState(`saving`),this.setAttribute(`aria-busy`,`true`);let o=a?null:this._readShown();a||this._showValue(e),this._close();let s=await this._persist(e,a);this._busy=!1,this.removeAttribute(`aria-busy`);let c=this.getAttribute(`label`)||``;s.ok?(this.setAttribute(`value`,e),!a&&s.text&&this._showText(s.text,!1),this._setState(`saved`),this._savedTimer=setTimeout(()=>this._setState(null),i),this._announce(n.saved(c)),this._fire(`wui:inline-edit:saved`,{value:e,previous:t})):(o&&this._restoreShown(o),s.kind===`session`||s.kind===`aborted`?this._setState(null):(this._draft=e,this._setState(`error`),this._setError(s.message),this._announce(n.notSaved(c,s.message)),this._fire(`wui:inline-edit:failed`,{value:e,previous:t,kind:s.kind,message:s.message})))}async _persist(e,t){if(t){if(typeof this.save!=`function`)return{ok:!0};try{return await this.save(e),{ok:!0}}catch(e){return{ok:!1,kind:`server`,message:h(e)}}}let r=this.getAttribute(`action`);if(!r)return{ok:!0};let i=new URLSearchParams({[this.getAttribute(`name`)||`value`]:e}),o=await a(r,{method:`POST`,body:i});if(o.ok)return{ok:!0,text:o.html.trim()};let s=n.failed;return{ok:!1,kind:o.kind,message:o.message||s[o.kind]||n.failed.server}}_close(){let e=_(this,s),t=_(this,l),n=this.contains(document.activeElement);this._editing=!1,this.removeAttribute(`data-wui-editing`),t&&(t.hidden=!0),e&&(e.hidden=!1),_(t,p)?.click(),n&&e?.focus()}_focusControl(e){if(!m.has(this._type())){e.focus(),e.select?.();return}let t=_(e,`button`);t&&(t.focus(),t.getAttribute(`aria-expanded`)!==`true`&&t.click())}_showValue(t){if(t===``){this._showText(this.getAttribute(`placeholder`)||`-`,!0);return}let n=this._type(),r=t;if(n===`date`)r=e(t)||t;else if(n===`select`){let e=[...this._control()?.querySelectorAll(`[data-value]`)??[]].find(e=>e.getAttribute(`data-value`)===t);e&&(r=(e.textContent??``).trim())}this._showText(r,!1)}_readShown(){let e=this.querySelector(c);return e?{html:e.innerHTML,empty:e.hasAttribute(`data-wui-empty`)}:null}_restoreShown(e){let t=this.querySelector(c);t&&(t.innerHTML=e.html,t.toggleAttribute(`data-wui-empty`,e.empty))}_showText(e,t){let n=this.querySelector(c);n&&(n.textContent=e,n.toggleAttribute(`data-wui-empty`,t))}_setError(e){let t=_(this,d),n=this._control();t&&(t.textContent=e||``,t.hidden=!e),e?n?.setAttribute(`aria-invalid`,`true`):n?.removeAttribute(`aria-invalid`)}_setState(e){clearTimeout(this._savedTimer??void 0),this._savedTimer=null,e?this.setAttribute(`data-wui-state`,e):this.removeAttribute(`data-wui-state`)}_announce(e){let t=this.querySelector(f);t&&e&&(t.textContent=``,t.textContent=e)}_fire(e,t){this.dispatchEvent(new CustomEvent(e,{bubbles:!0,detail:t}))}_control(){let e=this.querySelector(u);return g(e)?e:null}_value(){return this.getAttribute(`value`)??``}_type(){let e=this.getAttribute(`type`);return o(e)?e:`text`}};export{v as t};
@@ -1 +0,0 @@
1
- import{n as e,t}from"./buttonClass-GtEi8hAY.js";import{t as n}from"./elementBase-Cxeyx0tU.js";import{l as r}from"./wuiHttp-523iN_RF.js";var i=`wui-saved-views:`,a=20,o=0,s=e=>typeof e==`object`&&!!e&&`name`in e&&typeof e.name==`string`&&`query`in e&&typeof e.query==`string`,c=class extends n{static get observedAttributes(){return[`key`,`mode`,`action`,`can-share`]}_doc=null;_dom=null;_views;_open;_busy;_error;_trigger;_onTriggerClick;_onKeyDown;_onPointerDown;_onSubmit;constructor(){super(),this._views=[],this._open=!1,this._busy=!1,this._error=null,this._onTriggerClick=()=>this._setOpen(!this._open),this._onKeyDown=e=>{this._open&&e.target instanceof Node&&this.contains(e.target)&&(e.key===`Escape`?(e.stopPropagation(),this._setOpen(!1),this._trigger?.focus()):(e.key===`ArrowDown`||e.key===`ArrowUp`)&&this._ui.menu.contains(e.target)&&!(e.target instanceof Element&&/input|textarea/i.test(e.target.tagName))&&(e.preventDefault(),e.stopPropagation()))},this._onPointerDown=e=>{this._open&&!e.composedPath().includes(this)&&this._setOpen(!1)},this._onSubmit=async e=>{e.preventDefault();let t=this._ui.input.value.trim();if(!t)return;if(this._server()){if(this._busy)return;let e={name:t,query:this._ownerDoc.location.search};this._canShare()&&(e.shared=String(this._ui.share.checked)),await this._request(`save`,e)&&(this._ui.input.value=``,this._ui.share.checked=!1);return}let n=this._ownerDoc.location.search;this._commit([{name:t,query:n},...this._views.filter(e=>e.name!==t)].slice(0,a)),this._ui.input.value=``}}get _ownerDoc(){if(!this._doc)throw Error(`wui-saved-views is not connected`);return this._doc}get _ui(){if(!this._dom)throw Error(`wui-saved-views is not built`);return this._dom}connectedCallback(){this._doc=this.ownerDocument,this._trigger||this._build(),window.addEventListener(`keydown`,this._onKeyDown,!0),this._reload()}disconnectedCallback(){this._setOpen(!1),window.removeEventListener(`keydown`,this._onKeyDown,!0),this._doc=null}attributeChangedCallback(){this._doc&&this._trigger&&this._reload()}_reload(){this._server()?(this._views=[],this._render(),this._request(`list`)):(this._views=this._load(),this._render())}_server(){return this.getAttribute(`mode`)===`server`&&!!this.getAttribute(`action`)&&!!this.getAttribute(`key`)}_canShare(){return this._server()&&this.getAttribute(`can-share`)===`true`}async _request(e,t={}){let n=this.getAttribute(`action`)??``,i=this.getAttribute(`key`)??``,o=n,c;e===`list`?o+=(n.includes(`?`)?`&`:`?`)+new URLSearchParams({intent:`list`,key:i}):c={method:`POST`,body:new URLSearchParams({intent:e,key:i,...t})},this._busy=!0,this._render();let l=await r(o,c);if(this._busy=!1,this._doc===null)return!1;if(l.ok){let e=new DOMParser().parseFromString(l.html,`text/html`);return this._views=[...e.querySelectorAll(`[data-wui-saved-views-items] > li`)].filter(e=>e instanceof HTMLLIElement).map(e=>({name:e.dataset.name,query:e.dataset.query,shared:e.dataset.shared===`true`})).filter(s).slice(0,a),this._error=null,this._render(),!0}return this._error=l.message||`The views could not be updated. Try again.`,this._render(),!1}_build(){let n=this._ownerDoc;this.classList.add(`dropdown`),this._trigger=n.createElement(`button`),this._trigger.type=`button`,this._trigger.className=e(`neutral`,`outline`,`sm`),this._trigger.dataset.wui=t,this._trigger.textContent=`Views`,this._trigger.setAttribute(`aria-haspopup`,`true`),this._trigger.setAttribute(`aria-expanded`,`false`),this._trigger.addEventListener(`click`,this._onTriggerClick);let r=n.createElement(`div`);r.className=`dropdown-menu`;let i=n.createElement(`div`);i.className=`dropdown-divider`;let a=n.createElement(`input`);a.type=`text`,a.className=`form-control form-control-sm`,a.setAttribute(`aria-label`,`View name`),a.placeholder=`Name this view`;let s=n.createElement(`button`);s.type=`submit`,s.className=e(`primary`,`solid`,`sm`),s.dataset.wui=t,s.textContent=`Save this view`;let c=n.createElement(`form`);c.className=`d-flex gap-2 px-3 py-2`,c.append(a,s),c.addEventListener(`submit`,this._onSubmit);let l=n.createElement(`input`);l.type=`checkbox`,l.className=`form-check-input`,l.setAttribute(`role`,`switch`),l.id=`wui-saved-views-share-${o++}`;let u=n.createElement(`label`);u.className=`form-check-label`,u.htmlFor=l.id,u.textContent=`Share with the team`;let d=n.createElement(`div`);d.className=`form-check form-switch mb-0`,d.append(l,u);let f=n.createElement(`div`);f.className=`px-3 pb-2`,f.hidden=!0,f.append(d),this._dom={menu:r,divider:i,form:c,input:a,save:s,shareRow:f,share:l},this.append(this._trigger,r)}_render(){let e=this._ownerDoc,t=this._ui,n=[];for(let t of this._views){let r=e.createElement(`a`);if(r.className=`dropdown-item`,r.setAttribute(`href`,e.location.pathname+t.query),r.textContent=t.name,t.shared){let t=e.createElement(`span`);t.className=`badge text-bg-secondary ms-2`,t.textContent=`Shared`,r.append(t)}let i=e.createElement(`button`);i.type=`button`,i.className=`btn btn-link btn-sm`,i.textContent=`Delete`,i.setAttribute(`aria-label`,`Delete ${t.name}`),i.disabled=this._busy,i.addEventListener(`click`,()=>this._server()?this._request(`delete`,{name:t.name}):this._commit(this._views.filter(e=>e.name!==t.name))),n.push(r,i)}if(this._error){let t=e.createElement(`div`);t.className=`dropdown-item-text text-danger small`,t.setAttribute(`role`,`alert`),t.textContent=this._error,n.push(t)}t.save.disabled=this._busy,t.share.disabled=this._busy,t.shareRow.hidden=!this._canShare(),t.menu.replaceChildren(...n,t.divider,t.form,t.shareRow)}_commit(e){this._views=e,this._write(e),this._render()}_setOpen(e){e!==this._open&&(this._open=e,this._ui.menu.classList.toggle(`show`,e),this._trigger?.setAttribute(`aria-expanded`,String(e)),e?this._ownerDoc.addEventListener(`pointerdown`,this._onPointerDown,!0):this._ownerDoc.removeEventListener(`pointerdown`,this._onPointerDown,!0))}_storage(){let e=this.getAttribute(`key`);if(!e)return null;try{let t=this._ownerDoc.defaultView;return t?{store:t.localStorage,key:i+e}:null}catch{return null}}_load(){let e=this._storage();if(!e)return[];try{let t=JSON.parse(e.store.getItem(e.key)??`[]`);return Array.isArray(t)?t.filter(s).slice(0,a):[]}catch{return[]}}_write(e){let t=this._storage();if(t)try{t.store.setItem(t.key,JSON.stringify(e))}catch{}}};export{c as t};
@@ -1,9 +0,0 @@
1
- import{n as e,r as t,t as n}from"./anchorOverlay-CXnWfezA.js";import{i as r,n as i,r as a,t as o}from"./optionLabel-4xjXWy74.js";import{n as s}from"./devWarn-DXdRWZs3.js";import{r as c}from"./dom-Do1pAA12.js";import{t as l}from"./elementBase-Cxeyx0tU.js";import{r as u,t as d}from"./fieldState-D-zQcXUS.js";import{n as f,t as p}from"./formMirror-9IpSgeZb.js";import{n as m}from"./loader-ByHAB1wi.js";import{t as h}from"./iconGlyphs.g-DPqoOoXy.js";import{n as g,t as _}from"./listboxKeyNav-4LeEjKq6.js";var v=e=>{let t=String(e??``).trim();return/^(https?:)?\/\//i.test(t)||/^\/(?!\/)/.test(t)||/^data:image\/(png|jpe?g|gif|webp|avif);/i.test(t)?t:``},y=(e,t=`wui-opt-avatar`)=>{let n=v(e.avatar);return!n&&!e.initials?``:`<span class="avatar ${t}" aria-hidden="true"><span class="avatar-face">${i(e.initials??``)}</span>${n?`<img class="avatar-img" src="${b(n)}" alt="" />`:``}</span>`},b=e=>String(e??``).replace(/&/g,`&amp;`).replace(/"/g,`&quot;`).replace(/</g,`&lt;`);function x(e,t){let n=String(t??``).trim().toLowerCase();return n?e.filter(e=>[r(e),e.description,e.meta].some(e=>String(e??``).toLowerCase().includes(n))):e}var S=/* @__PURE__ */ new WeakMap;function C(e,t,n={}){let{selected:r=[],query:a=``,status:o=`idle`,emptyText:s=`No matches`,searchingText:c=`Searching…`,hintText:l=`Type to search…`,actionRow:u=[],recents:d=null}=n,f=new Set(r.map(String)),p=x(t,a),m=e.id,h=0,g=()=>`${m}-opt-${h++}`,_=e=>`<button type="button" role="option" id="${i(g())}" class="wui-select-option wui-select-add" data-value="${i(e.value)}" data-custom="true" aria-selected="false">${i(e.label)}</button>`,v=u.filter(e=>e.position===`top`).map(_).join(``),y=d?.options.length?`<div class="wui-select-group">${i(d.label)}</div>${d.options.map(e=>w(e,g(),f.has(String(e.value)))).join(``)}<div class="wui-select-sep" aria-hidden="true"></div>`:``,b=``,C=``;for(let e of p)e.group&&e.group!==b&&(C+=`<div class="wui-select-group">${i(e.group)}</div>`),b=e.group??``,C+=w(e,g(),f.has(String(e.value)));let T=u.filter(e=>e.position===`bottom`).map(_).join(``),E=``;o===`loading`?E=`<div class="wui-select-loading"><span class="wui-select-spinner spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>${i(c)}</div>`:o===`hint`?E=`<div class="wui-select-hint">${i(l)}</div>`:(o===`empty`||p.length===0&&u.length===0)&&(E=`<div class="wui-select-empty">${i(s)}</div>`);let D=v+y+C+T+E;S.get(e)!==D&&(S.set(e,D),e.innerHTML=D)}function w(e,t,n){let r=!!e.disabled,o=r&&e.disabledHint?` title="${i(e.disabledHint)}"`:``,s=`id="${i(t)}" role="option" data-value="${i(e.value)}" aria-selected="${n}"${r?` aria-disabled="true"`:``}${o}`,c=`<span class="wui-select-check" aria-hidden="true">${h(`check`)}</span>`;if(!e.description&&!e.meta)return`<button type="button" class="wui-select-option${n?` selected`:``}" ${s}>${y(e)}<span class="wui-select-opt-name">${a(e)}</span>${c}</button>`;let l=e.description?`<span class="wui-select-opt-desc">${i(e.description)}</span>`:``,u=e.meta?`<span class="wui-select-opt-meta">${i(e.meta)}</span>`:``;return`<div class="wui-select-option wui-select-option-rich${n?` selected`:``}" ${s}>${y(e)}<span class="wui-select-option-text"><span class="wui-opt-label">${a(e)}</span>${l}</span>${u}${c}</div>`}var T=Object.freeze([`single`,`multiple`,`search`,`tag`,`country`]),E=e=>e===`multiple`||e===`tag`,D={recents:()=>import(`./recents-CmLLdV8O.js`),chips:()=>import(`./chips-2yXiMhK4.js`),search:()=>import(`./search-BXcvm716.js`),country:()=>import(`./country-x5lqC5Xu.js`)};function O(e){let t=Object.hasOwn(D,e)?D[e]:void 0;return t?t():Promise.reject(/* @__PURE__ */ Error(`Unknown <wui-select> part: ${e}.`))}var k=e=>typeof e.loadOptions==`function`||!!e.getAttribute(`source`)||e.hasAttribute(`remote`),A=class extends l{static formAssociated=!0;_internals;_value;_optionsProp;_partOptions;_known;_loadOptionsFn;_validateFn;_declared;_query;_ownsFilter;_active;_status;_error;_nav;_parts;_partSig;_partsMounted;_partToken;_rendered;_defaultValue;_warnedMode;_warnedDensity;_reposition;_onDocClick;_bindGlobal=()=>{throw Error(`The select is not wired.`)};_reanchor;_reanchorScroll;static get observedAttributes(){return/* @__PURE__ */ `mode.value.placeholder.search-placeholder.empty-text.searchable.clearable.disabled.readonly.loading.required.size.density.icon.prefix.open.aria-label.aria-describedby.aria-invalid.min-chars.debounce.source.remote.allow-custom.add-label.searching-text.hint-text.value-label.value-avatar.value-initials.max-tags.allow-duplicates.separators.pattern.invalid-message.create-label.collapse-chips.selected-text.clear-all-label.countries.suggested.suggested-label.all-countries-label.recents-key.recents-limit.recents-label`.split(`.`)}constructor(){super();try{this._internals=this.attachInternals()}catch{this._internals=null}this._value=``,this._optionsProp=null,this._partOptions=null,this._known=/* @__PURE__ */ new Map,this._loadOptionsFn=null,this._validateFn=null,this._declared=void 0,this._query=``,this._ownsFilter=!1,this._active=-1,this._status=`idle`,this._error=``,this._nav=null,this._parts=null,this._partSig=``,this._partsMounted=!1,this._partToken=0,this._rendered=!1,this._defaultValue=void 0,this._warnedMode=null,this._reposition=()=>{this._menuOpen()&&this._place()}}connectedCallback(){this._rendered?this._bindGlobal():this.render(),this._ensureParts(),this._mountParts()}disconnectedCallback(){this._teardown(),this._teardownParts()}attributeChangedCallback(e,t,n){e===`value`?(this._value=R(n,E(this.mode)),this._applyValue()):e===`aria-invalid`?this._syncInvalid():e===`open`?this._rendered&&(this.hasAttribute(`open`)?this._open({focus:!1}):this._close({force:!0})):(e===`mode`&&(this._value=R(this._value,E(this.mode)),this._partOptions=null,this._known.clear(),this._ensureParts()),(e===`source`||e===`remote`||e===`recents-key`)&&this._ensureParts(),I.has(e)?this._rendered&&(this._drawValue(),this.renderList()):F.has(e)?this._remountParts():this._rendered&&this.render())}formResetCallback(){if(this.value=this._defaultValue??``,!this._rendered)return;let e=this._refs();e.input&&(e.input.value=``,e.input.removeAttribute(`aria-invalid`)),e.search&&(e.search.value=``),this.setError(``),this._query!==``&&this._onQueryChange(``)}get mode(){let e=this.getAttribute(`mode`);return e===null?`single`:M(e)?e:(e!==this._warnedMode&&(this._warnedMode=e,s(`<wui-select> mode "${e}" is not one of ${T.join(`, `)}; it is treated as "single".`)),`single`)}_checkDensity(){let e=this.getAttribute(`density`);e===null||N.includes(e)||e===this._warnedDensity||(this._warnedDensity=e,s(`<wui-select> density "${e}" is not one of ${N.join(`, `)}; it is treated as "comfortable".`))}set mode(e){this.setAttribute(`mode`,String(e))}get value(){return Array.isArray(this._value)?this._value.slice():this._value}set value(e){this._value=R(e,E(this.mode)),this._applyValue()}get options(){return this._readOptions()}set options(e){this._optionsProp=Array.isArray(e)?e:null,this.mode!==`country`&&(this._partOptions=null);for(let e of this._activePartsList())e.onOptions?.();this._rendered&&(this._drawValue(),this.renderList())}get loadOptions(){return this._loadOptionsFn}set loadOptions(e){this._loadOptionsFn=typeof e==`function`?e:null,this._ensureParts()}get validate(){return this._validateFn}set validate(e){this._validateFn=typeof e==`function`?e:null}commit(e,t={}){this.value=e,this.dispatchEvent(new CustomEvent(`change`,{bubbles:!0,detail:{isCustom:!!t.isCustom}}))}setPartOptions(e){this._partOptions=Array.isArray(e)?e:null,this._drawValue(),this.renderList()}setStatus(e){this._status=e,this.renderList()}setError(e){this._error=e?String(e):``,this._syncError()}openMenu(){d(this)||this._open({focus:!1})}closeMenu({focusControl:e=!1}={}){this._close(),e&&this._refs().control?.focus()}renderList(){let e=this._refs();e.list&&(C(e.list,this._listOptions(),{selected:this._selectedValues(),query:this._ownsFilter?``:this._query,status:this._status,emptyText:this.getAttribute(`empty-text`)||`No matches`,searchingText:this.getAttribute(`searching-text`)||`Searching…`,hintText:this.getAttribute(`hint-text`)||void 0,actionRow:this._actionRows(),recents:this._recents()}),this._active>=this._visible().length&&(this._active=-1),this._active>=0&&this._setActive(this._active,{reveal:!1}),this._menuOpen()&&this._place())}render(){let e=this._carry();this._teardownParts(),this._snapshotDeclared();let t=this.mode;this._checkDensity();let n=E(t),r=t===`tag`,a=n&&(r||this.hasAttribute(`allow-custom`));this._value=R(this._value,n),this._defaultValue===void 0&&n&&this._value.length===0&&(this._value=this._declaredSelected()),n||this._preselect(),this._defaultValue===void 0&&(this._defaultValue=R(this._value,n));let o=this.getAttribute(`size`),s=o===`sm`?` wui-select-sm`:o===`lg`?` wui-select-lg`:``,c=this.getAttribute(`icon`),l=this.getAttribute(`prefix`),d=this.hasAttribute(`clearable`),f=this.hasAttribute(`disabled`);this.id||=`wui-select-${Math.random().toString(36).slice(2,9)}`;let p=`${this.id}-listbox`,m=`${this.id}-entry-error`,g=this.getAttribute(`aria-describedby`)?.trim(),_=g?`${g} ${m}`:m,v=this.hasAttribute(`aria-invalid`)||this._error?` aria-invalid="true"`:``,y=this.hasAttribute(`required`)&&!a?` aria-required="true"`:``,b=` aria-label="${i(this._accessibleName())}" aria-describedby="${i(_)}"${v}${y}`,x=a?``:` role="combobox" aria-haspopup="listbox" aria-expanded="false" aria-controls="${i(p)}"`,S=n?`<div class="input wui-select-control wui-select-multi"${x}${b}${f?` aria-disabled="true"`:r?``:` tabindex="0"`}>`:`<button type="button" class="input wui-select-control"${x}${b}${f?` disabled`:``}>`,C=`${c?h(c,{className:`wui-select-icon`}):``}${l?`<span class="wui-select-prefix">${i(l)}</span>`:``}<span class="wui-select-value" data-label></span>${d?`<span class="wui-select-reset" role="button" aria-label="Clear selection" hidden>${h(`x`)}</span>`:``}${h(`chevron-down`,{className:`wui-select-caret`})}`,w=this.getAttribute(`searchable`),T=t===`search`||(w===null?t===`multiple`||t===`country`:w!==`false`)&&!a,D=this.getAttribute(`search-placeholder`)||(t===`country`?`Search countries…`:`Search…`),O=T?`<div class="wui-select-search">${h(`search`)}<input class="wui-select-input" placeholder="${i(D)}" aria-label="${i(D)}" aria-autocomplete="list" /><button type="button" class="wui-select-clear" aria-label="Clear search" hidden>${h(`x`)}</button></div>`:``;this.innerHTML=`
2
- <div class="wui-select${s}">
3
- ${S}${C}${n?`</div>`:`</button>`}
4
- <div class="wui-select-menu wui-select-menu-fixed" hidden>
5
- ${O}
6
- <div class="wui-select-options" role="listbox" id="${i(p)}" tabindex="-1"${n?` aria-multiselectable="true"`:``}></div>
7
- </div>
8
- </div>
9
- <div class="field-error wui-select-error" id="${i(m)}" aria-live="polite"${this._error?``:` hidden`}>${i(this._error)}</div>`,this._rendered=!0,this._syncMirror(),this._syncValidity(),this._drawValue(),this._syncReset(),this.renderList(),this._wire(),u(this,this.querySelector(`.wui-select-control`)),this._mountParts(e)}_accessibleName(){return this.getAttribute(`aria-label`)||this.getAttribute(`placeholder`)||`Select`}_snapshotDeclared(){if(this._declared)return;let e=[...this.querySelectorAll(`:scope > wui-option`)];e.length&&(this._declared=e.map(e=>{let t={value:e.getAttribute(`value`)??K(e).trim(),label:e.innerHTML,[o]:!0,selected:e.hasAttribute(`selected`)};for(let[n,r]of L){let i=e.getAttribute(n);i&&(t[r]=i)}return e.hasAttribute(`disabled`)&&(t.disabled=!0),t}))}_readOptions(){return this.mode===`country`?this._partOptions||[]:this._partOptions?this._partOptions:this._optionsProp?this._optionsProp:(this._snapshotDeclared(),this._declared||[])}_listOptions(){let e=this._readOptions(),t=this.getAttribute(`value-label`);if(this.mode!==`search`||!t||this._value===``)return e;let n=String(this._value);return e.some(e=>String(e.value)===n)?e:[...e,{value:n,label:t}]}_declaredSelected(){return this._optionsProp?[]:(this._declared??[]).filter(e=>e.selected).map(e=>String(e.value))}_preselect(){let e=this._readOptions(),t=this._value!==``&&e.find(e=>String(e.value)===this._value)||e.find(e=>`selected`in e&&!!e.selected);t&&(this._value=String(t.value))}_optionFor(e){if(e===``)return;let t=String(e),n=this._readOptions().find(e=>String(e.value)===t);return n?(this._known.set(t,n),n):this._known.get(t)}_placeholder(){return this.getAttribute(`placeholder`)||P[this.mode]}_hasValue(){return Array.isArray(this._value)?this._value.length>0:this._value!==``}_selectedValues(){return Array.isArray(this._value)?this._value:this._hasValue()?[this._value]:[]}_applyValue(){this._syncMirror(),this._syncValidity(),this._rendered&&(this._drawValue(),this._syncReset(),this.renderList())}_syncMirror(){E(this.mode)?f(this,this._selectedValues()):p(this,this._value)}_drawValue(){let e=this._refs();if(!e.value)return;let t=E(this.mode),n=t?void 0:this._optionFor(this._value);this._syncTitle(n),this._syncValueAvatar(),this._activePartsList().some(e=>e.renderValue?.()===!0)||(t?(e.value.classList.remove(`wui-select-placeholder`),e.value.textContent=``):(e.value.classList.toggle(`wui-select-placeholder`,!n),e.value.innerHTML=n?a(n):i(this._placeholder())))}_syncTitle(e){let t=this.querySelector(`.wui-select-control`);if(!t)return;let n=e&&!this.hasAttribute(`title`)?r(e).trim():``;n?t.setAttribute(`title`,n):t.removeAttribute(`title`)}_syncValueAvatar(){let e=this.querySelector(`.wui-select-control`);if(!e)return;e.querySelector(`:scope > .wui-select-value-avatar`)?.remove();let t=!E(this.mode)&&this._hasValue()?y({avatar:this.getAttribute(`value-avatar`),initials:this.getAttribute(`value-initials`)},`avatar-xs`):``;e.classList.toggle(`wui-has-value-avatar`,!!t),t&&e.insertAdjacentHTML(`afterbegin`,`<span class="wui-select-value-avatar" aria-hidden="true">${t}</span>`)}_syncValidity(){let e=this._internals;if(typeof e?.setValidity==`function`){if(this.hasAttribute(`required`)&&!this._hasValue()){let t=this.querySelector(`.wui-select-control`);e.setValidity({valueMissing:!0},`Please fill in this field.`,t instanceof HTMLElement?t:void 0)}else e.setValidity({})}}_syncReset(){let e=W(this,`.wui-select-reset`,HTMLElement);e&&(e.hidden=!(this.hasAttribute(`clearable`)&&this._hasValue()&&!d(this)))}_syncInvalid(){let e=this.querySelector(`.wui-select-control`);e&&(this.hasAttribute(`aria-invalid`)||this._error?e.setAttribute(`aria-invalid`,`true`):e.removeAttribute(`aria-invalid`))}_syncError(){let e=W(this,`.wui-select-error`,HTMLElement);e&&(e.textContent=this._error,e.hidden=!this._error),this._syncInvalid()}_refs(){return{control:W(this,`.wui-select-control`,HTMLElement),value:W(this,`.wui-select-value`,HTMLElement),menu:W(this,`.wui-select-menu`,HTMLElement),list:W(this,`.wui-select-options`,HTMLElement),search:W(this,`.wui-select-search input`,HTMLInputElement),input:W(this,`.wui-select-draft`,HTMLInputElement)}}_menuOpen(){let e=W(this,`.wui-select-menu`,HTMLElement);return e!==null&&!e.hidden}_visible(){let e=this._refs();return e.list?G(e.list,`.wui-select-option`):[]}_setActive(e,{reveal:t=!0}={}){let n=this._refs();if(!n.list||!n.control)return;let r=this._visible();this._active=e;let i=e>=0?r[e]??null:null;g(n.list,i),i?(t&&i.scrollIntoView({block:`nearest`}),n.control.setAttribute(`aria-activedescendant`,i.id)):n.control.removeAttribute(`aria-activedescendant`)}_actionRows(){let e=[];for(let t of this._activePartsList()){let n=t.actionRow?.(this._query);n&&e.push(n)}return e}_recents(){if(this._query.trim()!==``)return null;for(let e of this._activePartsList()){let t=e.recents?.(this._listOptions());if(t)return t}return null}_place(){let e=this._refs();if(!e.control||!e.menu)return;let t=this.hasAttribute(`open`)?{below:!0}:{};if(this.getAttribute(`density`)===`compact`){let r=e.control.getBoundingClientRect();e.menu.style.width=`max-content`,e.menu.style.minWidth=`${r.width}px`,e.menu.style.maxWidth=`280px`,n(e.control,e.menu,t)}else n(e.control,e.menu,{matchWidth:!0,...t})}_open({focus:t=!0}={}){let n=this._refs();if(!n.menu||!n.control)return;let r=!n.menu.hidden;n.menu.hidden=!1,n.control.setAttribute(`aria-expanded`,`true`),n.control.classList.add(`open`),this._query=n.input?n.input.value:``,this._ownsFilter=this._ownsFilter&&this._query!==``;let i=W(this,`.wui-select-search .wui-select-clear`,HTMLElement);if(i&&(i.hidden=!0),n.search&&(n.search.value=``),this.renderList(),e(this,this._reposition),t&&(n.search?.focus(),this._setActive(this._visible().findIndex(e=>e.classList.contains(`selected`)))),!r){this.dispatchEvent(new CustomEvent(`wui-select:open`,{bubbles:!0}));for(let e of this._activePartsList())e.onOpen?.()}}_close({force:e=!1}={}){if(!e&&this.hasAttribute(`open`))return;let n=this._refs();if(!n.menu||!n.control)return;let r=!n.menu.hidden;n.menu.hidden=!0,n.control.setAttribute(`aria-expanded`,`false`),n.control.classList.remove(`open`),this._setActive(-1),this._nav?.clearTypeahead(),t(this),r&&this.dispatchEvent(new CustomEvent(`wui-select:close`,{bubbles:!0}))}_onQueryChange(e){this._query=e,this._setActive(-1);let t=W(this,`.wui-select-search .wui-select-clear`,HTMLElement);t&&(t.hidden=!e);let n=!1;for(let t of this._activePartsList())t.onQuery?.(e)===!0&&(n=!0);this._ownsFilter=n,this.renderList()}_pick(e){if(e.getAttribute(`aria-disabled`)===`true`)return;let t=e.dataset.custom===`true`,n=e.dataset.value??``,r=t?{value:n,label:K(e).trim()}:this._listOptions().find(e=>String(e.value)===n)??{value:n,label:n},i=this._activePartsList().some(e=>e.onPick?.(r,{isCustom:t})===!0);E(this.mode)||(i||this.commit(n,{isCustom:t}),this._close(),this._refs().control?.focus())}_draftOpens(){return this.mode===`multiple`?this.hasAttribute(`allow-custom`):this.mode===`tag`&&k(this)}_onKeyDown(e){if(!d(this)){for(let t of this._activePartsList())if(t.onKey?.(e)===!0)return;if(!this._menuOpen()){if(e.target instanceof HTMLInputElement){if(e.key!==`ArrowDown`||!this._draftOpens())return;this._open({focus:!1})}else{(e.key===`ArrowDown`||e.key===`Enter`||e.key===` `)&&(e.preventDefault(),this._open({focus:!0}));return}}e.key===`Escape`&&(e.preventDefault(),e.stopPropagation()),c(this._nav,`Listbox keys are not wired.`).handler(e)}}_wire(){this._teardown();let t=this._refs(),n=t.control,r=t.list;if(!n||!t.menu||!r)return;let i=c(W(this,`.wui-select`,HTMLElement),`The select wrapper is missing.`),a=W(this,`.wui-select-search .wui-select-clear`,HTMLElement),o=W(this,`.wui-select-reset`,HTMLElement);this._nav=_({getVisibleOptions:()=>this._visible(),getActive:()=>this._active,setActive:e=>this._setActive(e),onEnter:(e,t)=>{if(e)this._pick(e);else if(this._query.trim()!==``){let e=t.find(e=>e.dataset.custom===`true`);if(e)this._pick(e);else if(t.length===1){let e=t[0];e&&this._pick(e)}}},onEscape:()=>{this._nav?.clearTypeahead(),this._close(),n.focus()}}),i.addEventListener(`keydown`,e=>this._onKeyDown(e)),i.addEventListener(`input`,e=>{let t=e.target;if(!(t instanceof HTMLInputElement)||!t.matches(`.wui-select-input, .wui-select-draft`))return;this._onQueryChange(t.value);let n=t.matches(`.wui-select-draft`),r=this._visible().length>0||this._actionRows().length>0;n&&r&&!this._menuOpen()&&!d(this)&&this._draftOpens()&&this._open({focus:!1})}),i.addEventListener(`focusout`,e=>{let t=e.relatedTarget;t instanceof Node&&this.contains(t)||!this._activePartsList().some(e=>e.onBlur?.()===!0)&&t&&this._close()}),a?.addEventListener(`click`,()=>{let e=c(t.search,`The search input is missing.`);e.value=``,this._onQueryChange(``),e.focus()}),n.addEventListener(`click`,e=>{if(!(e.target instanceof Element&&e.target.closest(`[data-remove]`))){if(this.mode===`tag`){if(d(this))return;this._refs().input?.focus(),!this._menuOpen()&&this._draftOpens()&&this._open({focus:!1})}else e.target instanceof HTMLInputElement?!this._menuOpen()&&!d(this)&&this._open({focus:!1}):this._menuOpen()?this._close():d(this)||this._open({focus:!0})}}),o?.addEventListener(`click`,e=>{e.stopPropagation(),this.commit(E(this.mode)?[]:``),this._close(),n.focus()}),r.addEventListener(`click`,e=>{let r=U(e).closest(`.wui-select-option`);if(r instanceof HTMLElement&&(this._pick(r),E(this.mode))){let e=this.querySelector(`.wui-select-draft`);(t.search??(e instanceof HTMLElement?e:n)).focus()}}),r.addEventListener(`mousedown`,e=>{E(this.mode)&&e.target instanceof Element&&e.target.closest(`.wui-select-option`)&&e.preventDefault()}),r.addEventListener(`mousemove`,e=>{let t=U(e).closest(`.wui-select-option`);t instanceof HTMLElement&&!t.classList.contains(`is-active`)&&this._setActive(this._visible().indexOf(t),{reveal:!1})}),r.addEventListener(`mouseleave`,()=>this._setActive(-1)),r.addEventListener(`error`,e=>{let t=e.target;t instanceof Element&&t.classList.contains(`avatar-img`)&&t.remove()},!0),this._bindGlobal=()=>{this._teardown(),this._onDocClick=e=>{this._menuOpen()&&!e.composedPath().includes(this)&&this._close()},document.addEventListener(`click`,this._onDocClick),this._menuOpen()&&e(this,this._reposition)},this.hasAttribute(`open`)&&this._open({focus:!1}),this._bindGlobal()}_teardown(){this._onDocClick&&=(document.removeEventListener(`click`,this._onDocClick),null),t(this),this._nav?.teardown()}_activePartsList(){return this._partsMounted?c(this._parts,`The mounted parts are missing.`):[]}_ensureParts(){if(!this.isConnected)return;let e=B(this,this.mode),t=e.join(`,`);if(t===this._partSig)return;this._teardownParts(),this._parts=null,this._partSig=t;let n=++this._partToken;Promise.all(e.map(e=>q(this,e))).then(e=>{n===this._partToken&&(this._parts=e.filter(e=>e!==null),this._mountParts())})}_mountParts(e={draft:``,query:``}){if(!this._parts||this._partsMounted||!this._rendered||!this.isConnected)return;this._partsMounted=!0;let t=j(this._refs());for(let n of this._parts)n.mount(this,t,{carry:e});this._drawValue(),this.renderList()}_teardownParts(){let e=this._activePartsList();this._partsMounted=!1;for(let t of e)t.teardown()}_remountParts(){if(!this._partsMounted)return;let e=this._carry();this._teardownParts(),this._mountParts(e)}_carry(){let e=this._refs();return{draft:e.input?.value??``,query:e.search?.value??``}}},j=e=>{let{control:t,value:n,menu:r,list:i}=e;return{control:c(t,`control missing`),value:c(n,`value missing`),menu:c(r,`menu missing`),list:c(i,`list missing`),search:e.search,input:e.input}},M=e=>T.includes(e),N=[`comfortable`,`compact`],P={single:`Select…`,search:`Select…`,multiple:`Select…`,tag:`Add…`,country:`Select country`},F=/* @__PURE__ */ new Set([`countries`,`suggested`,`suggested-label`,`all-countries-label`,`max-tags`,`pattern`,`collapse-chips`,`source`,`remote`,`min-chars`]),I=/* @__PURE__ */ new Set([`separators`,`allow-duplicates`,`invalid-message`,`create-label`,`add-label`,`selected-text`,`clear-all-label`,`value-label`,`value-avatar`,`value-initials`,`hint-text`,`recents-key`,`recents-limit`,`recents-label`]),L=[[`icon`,`icon`],[`description`,`description`],[`meta`,`meta`],[`group`,`group`],[`avatar`,`avatar`],[`initials`,`initials`],[`disabled-hint`,`disabledHint`]],R=(e,t)=>t?Array.isArray(e)?e.map(String):e==null||e===``?[]:String(e).split(`,`).map(e=>e.trim()).filter(Boolean):Array.isArray(e)?e.length?String(e[0]):``:e==null?``:String(e),z=(e,t)=>t===`multiple`?[`chips`]:t===`search`?[`search`]:t===`country`?[`country`]:t===`tag`?k(e)?[`chips`,`search`]:[`chips`]:[],B=(e,t)=>e.hasAttribute(`recents-key`)?[`recents`,...z(e,t)]:z(e,t),V=`This control could not load. Reload the page.`,H=e=>typeof e==`object`&&!!e&&`default`in e&&typeof e.default==`function`,U=e=>{if(e.target instanceof Element)return e.target;throw Error(`The event target is not an element.`)},W=(e,t,n)=>{let r=e.querySelector(t);return r instanceof n?r:null},G=(e,t)=>[...e.querySelectorAll(t)].filter(e=>e instanceof HTMLElement),K=e=>{let t=e.textContent;if(t===null)throw Error(`The element has no text.`);return t},q=(e,t)=>O(t).then(e=>{if(!H(e))throw Error(`The part ${t} has no default export.`);return e.default()}).catch(()=>(document.dispatchEvent(new CustomEvent(m,{bubbles:!0,composed:!0,detail:{chunk:t}})),e.setError(V),null));export{k as n,x as r,A as t};
@@ -1 +0,0 @@
1
- import{n as e,r as t}from"./anchorOverlay-CXnWfezA.js";import{n,t as r}from"./buttonClass-GtEi8hAY.js";import{t as i}from"./elementBase-Cxeyx0tU.js";import{t as a}from"./tourOpenMark-nPeAJFSo.js";import{t as o}from"./tourSeenStore-z0Y_Znzx.js";var s=`data-advance`,c=`wui-tour-hint`,l=`wui-tour-pointer`,u=`Click {actionName} to continue.`,d=`a[href], button, input, select, textarea, summary, [tabindex], [contenteditable]`,f=(e,t)=>e?.advanceOn===`click`&&!!t,p=e=>(e??``).replace(/\s+/g,` `).trim(),m=e=>e instanceof HTMLButtonElement||e instanceof HTMLInputElement||e instanceof HTMLMeterElement||e instanceof HTMLOutputElement||e instanceof HTMLProgressElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement?e.labels:null,h=e=>e instanceof HTMLButtonElement||e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement||e instanceof HTMLFieldSetElement||e instanceof HTMLOptGroupElement||e instanceof HTMLOptionElement?e.disabled:!1;function g(e){let t=e.ownerDocument,n=(e.getAttribute(`aria-labelledby`)||``).split(/\s+/).filter(Boolean),r=e instanceof HTMLInputElement&&/^(button|submit|reset)$/.test(e.type)?e.value:``,i=[n.map(e=>t.getElementById(e)?.textContent??``).join(` `),e.getAttribute(`aria-label`),Array.from(m(e)??[],e=>e.textContent).join(` `),e.getAttribute(`alt`),r,e.textContent,e.getAttribute(`title`)];for(let e of i){let t=p(e);if(t)return t}return``}function _(e){for(let t of[e,...e.querySelectorAll(d)])if((t instanceof HTMLElement||t instanceof SVGElement)&&t.tabIndex>=0&&!h(t))return t;return null}function v(e,t,n){let r=(e.getAttribute(`aria-describedby`)||``).split(/\s+/).filter(e=>e&&e!==t);n&&r.push(t),r.length>0?e.setAttribute(`aria-describedby`,r.join(` `)):e.removeAttribute(`aria-describedby`)}function ee(e,t){let n=e.querySelector(`.${c}`),r=e.querySelector(`.wui-tour-text`)?.id,i=r?`${r.replace(/-text$/,``)}-hint`:``;if(!t)n?.remove(),i&&v(e,i,!1);else{if(!n){n=e.ownerDocument.createElement(`p`),n.className=c,i&&(n.id=i);let t=e.querySelector(`.wui-tour-actions`);if(!t)throw Error(`Tour card has no actions row.`);t.before(n)}n.textContent=t,i&&v(e,i,!0)}}function te(e,t){let n=e.querySelector(`.${l}`);if(!t){n?.remove();return}if(n)return;let r=e.ownerDocument.createElement(`span`);r.className=l,r.setAttribute(`aria-hidden`,`true`),e.append(r)}var ne=e=>getComputedStyle(e).animationName;function y(e,{layer:t,spot:n,card:r},i,a){let o=f(i,a);t.toggleAttribute(s,o&&!(t.getRootNode()instanceof ShadowRoot)),n.hasAttribute(s)&&(n.removeAttribute(s),o&&ne(n)),o&&n.setAttribute(s,``),te(n,o);let c=r.querySelector(`.wui-tour-next`);if(!(c instanceof HTMLElement))throw Error(`Tour card has no next button.`);c.classList.toggle(`btn-primary`,!o),c.classList.toggle(`btn-link`,o);let l=o?p(i?.actionLabel)||g(a):``,d=e.getAttribute(`advance-label`)||u,m=l?d.replace(/\{actionName\}/g,()=>l):``;return ee(r,m),m}function b(e,t,n){if(!f(e,t))return()=>{};let r,i=()=>{r??=setTimeout(n,0)};return t.addEventListener(`click`,i),()=>{t.removeEventListener(`click`,i),clearTimeout(r)}}function x(e,t,n,r){return e.contains(r)||f(t,n)&&n.contains(r)}function re(e,{card:t,active:n,step:r,target:i}){let a=Array.from(t.querySelectorAll(`button`)).filter(e=>!e.hidden),o=f(r,i)?_(i):null;o&&a.push(o);let s=a.findIndex(e=>e===n||e===o&&i?.contains(n));e.preventDefault();let c=a[s===-1?e.shiftKey?a.length-1:0:(s+(e.shiftKey?-1:1)+a.length)%a.length];if(!c)throw Error(`Tour card has no focus stop.`);c.focus()}var ie=2/3,ae=1e3,oe=/* @__PURE__ */ new Set([`top`,`left`,`width`,`height`]),S=/* @__PURE__ */ new WeakMap,C=(e,t)=>typeof e.getAnimations==`function`?e.getAnimations().filter(t):[],w=e=>`transitionProperty`in e&&e.transitionProperty===`opacity`,se=e=>`transitionProperty`in e&&typeof e.transitionProperty==`string`&&oe.has(e.transitionProperty),ce=e=>`animationName`in e&&typeof e.animationName==`string`&&e.animationName.startsWith(`wui-tour-`);function T(e){return e.length===0?null:new Promise(t=>{let n=setTimeout(t,ae);Promise.allSettled(e.map(e=>e.finished)).then(()=>{clearTimeout(n),t()})})}function le(e){let t=e.parentElement?.querySelector(`:scope > .wui-tour-spot`),n=0;for(let e of t?C(t,se):[]){let t=e.effect?.getComputedTiming?.();if(typeof t?.duration!=`number`)continue;let r=typeof e.currentTime==`number`?e.currentTime:0;n=Math.max(n,(t.delay??0)+t.duration*ie-r)}return n}function E(e){let t=le(e);t>0?e.style.setProperty(`--wui-tour-card-delay`,`${Math.round(t)}ms`):e.style.removeProperty(`--wui-tour-card-delay`),e.dataset.state=`entering`;let n={};S.set(e,n);let r=()=>{S.get(e)===n&&e.dataset.state===`entering`&&(e.dataset.state=`shown`)},i=C(e,ce);i.length===0?r():Promise.allSettled(i.map(e=>e.finished)).then(r)}function D(e){return e.dataset.state=`leaving`,T(C(e,w))}function ue(e){let t=e.shadowRoot?.querySelector(`.wui-tour-layer`),n=e.classList.contains(`wui-tour-layer`)?e:t instanceof HTMLElement?t:null;n&&(n.dataset.state=`leaving`);let r=n?T(C(n,w)):null;r?(e.setAttribute(`inert`,``),r.then(()=>e.remove())):e.remove()}var O=2,k=12,A=8,j=4,M=20,de=`(max-width: 575.98px)`,fe=[`bottom`,`top`,`right`,`left`],N=[`top-left`,`top-right`,`bottom-right`,`bottom-left`],P,F=(e,t,n)=>Math.max(t,Math.min(e,n)),I=(e,t,n,r)=>(Math.max(e,n)+Math.min(t,r))/2;function L(e,t){if(!t?.scrollIntoView)return;e.style.maxHeight=``;let n=H(e),r=e.offsetHeight+k;if(t.getBoundingClientRect().height+4+r*2<=n.bottom-n.top){t.scrollIntoView({block:`center`,inline:`nearest`});return}let i=t.style.scrollMarginTop;t.style.scrollMarginTop=`${n.top+r+O}px`,t.scrollIntoView({block:`start`,inline:`nearest`}),t.style.scrollMarginTop=i}function R(e,t,n){let r=e.style,i=t.style,a=me(t);if(!n){r.top=`50%`,r.left=`50%`,r.width=`0px`,r.height=`0px`,r.boxShadow=`0 0 0 100vmax var(--color-scrim-strong)`;for(let e of N)r.removeProperty(`border-${e}-radius`),r.removeProperty(`corner-${e}-shape`);t.dataset.placement=`center`,a.hidden=!0,i.position=`fixed`,i.top=`50%`,i.left=`50%`,i.transform=`translate(-50%, -50%)`,i.maxHeight=`calc(100vh - 16px)`;return}r.boxShadow=``,i.transform=``,i.position=`fixed`;let o=n.getBoundingClientRect();r.top=`${o.top}px`,r.left=`${o.left}px`,r.width=`${o.width}px`,r.height=`${o.height}px`,z(r,n);let s=t.scrollTop;i.maxHeight=``;let c={width:t.offsetWidth,height:t.offsetHeight},l=H(t),u=l.bottom-l.top,d={bottom:l.bottom-o.bottom-k,top:o.top-k-l.top,right:l.right-o.right-k,left:o.left-k-l.left},f=window.matchMedia(de).matches,p=fe.find(e=>e===`top`||e===`bottom`?c.height<=d[e]+1:!f&&c.width<=d[e]+1&&c.height<=u+1),m=Math.min(o.bottom,l.bottom+A)-Math.max(o.top,l.top-A);p?B(t,a,p,o,l,c):m>=Math.min(c.height,u)+8?V(t,a,o,l,c):pe(t,a,d.bottom>=d.top?`bottom`:`top`,o,l,c,d),t.scrollTop=s}function z(e,t){P??=CSS.supports(`corner-top-left-shape`,`squircle`);let n=getComputedStyle(t);for(let t of N)e.setProperty(`border-${t}-radius`,n.getPropertyValue(`border-${t}-radius`)),P&&e.setProperty(`corner-${t}-shape`,n.getPropertyValue(`corner-${t}-shape`))}function B(e,t,n,r,i,a){let o=n===`top`||n===`bottom`,s,c,l;if(o){let e=I(r.left,r.right,i.left,i.right);s=F(e-a.width/2,i.left,i.right-a.width),c=n===`bottom`?r.bottom+k:r.top-k-a.height,l=F(e-s,M,a.width-M)}else{let e=I(r.top,r.bottom,i.top,i.bottom);c=F(e-a.height/2,i.top,i.bottom-a.height),s=n===`right`?r.right+k:r.left-k-a.width,l=F(e-c,M,a.height-M)}e.dataset.placement=n,e.style.top=`${c}px`,e.style.left=`${s}px`,t.hidden=!1,t.style.left=o?`${l-e.clientLeft-t.offsetWidth/2}px`:``,t.style.top=o?``:`${l-e.clientTop-t.offsetHeight/2}px`}function V(e,t,n,r,i){let a=r.bottom-r.top;e.dataset.placement=`overlap`,t.hidden=!0,e.style.maxHeight=i.height>a?`${Math.max(a,0)}px`:``;let o=Math.min(n.bottom,r.bottom)-j;e.style.top=`${Math.max(r.top,o-Math.min(i.height,a))}px`,e.style.left=`${F(n.left+j,r.left,r.right-i.width)}px`}function pe(e,t,n,r,i,a,o){let s=Math.max(o[n],0),c=Math.min(a.height,s);e.dataset.placement=n,t.hidden=!0,e.style.maxHeight=a.height>s?`${s}px`:``,e.style.top=`${n===`bottom`?r.bottom+k:r.top-k-c}px`;let l=I(r.left,r.right,i.left,i.right);e.style.left=`${F(l-a.width/2,i.left,i.right-a.width)}px`}function H(e){let t=e.parentElement,n=t?getComputedStyle(t):null,r=e=>Number.parseFloat(n?.[e]??``)||0;return{top:r(`paddingTop`)+A,bottom:window.innerHeight-r(`paddingBottom`)-A,left:r(`paddingLeft`)+A,right:window.innerWidth-r(`paddingRight`)-A}}function me(e){let t=e.querySelector(`:scope > .wui-tour-arrow`);if(t instanceof HTMLElement)return t;let n=document.createElement(`span`);return n.className=`wui-tour-arrow`,n.setAttribute(`aria-hidden`,`true`),n.hidden=!0,e.append(n),n}var he=0,ge=`btn btn-sm btn-link`;function U(e,t,n){let r=e.querySelector(t);if(!(r instanceof n))throw Error(`Expected "${t}" to match a ${n.name}.`);return r}function _e(e,t,i){let a=`wui-tour-end-${++he}`,o=!!(t.nextLabel&&t.nextHref),s=e.createElement(`div`);s.className=`wui-tour-card wui-tour-end`,s.dataset.layout=`center`,o&&(s.dataset.next=``),s.setAttribute(`role`,`dialog`),i&&s.setAttribute(`aria-modal`,`true`),s.tabIndex=-1,s.setAttribute(`aria-labelledby`,`${a}-title`),s.setAttribute(`aria-describedby`,`${a}-message`),s.innerHTML=` <div class="wui-tour-end-mark" aria-hidden="true"><svg viewBox="0 0 24 24" focusable="false"><path d="M5 12.5l4.5 4.5L19 7.5"/></svg></div> <h2 class="wui-tour-title wui-tour-end-title" id="${a}-title"></h2> <p class="wui-tour-text wui-tour-end-message" id="${a}-message"></p> <div class="wui-tour-actions">${o?`<a class="${n(`primary`,`solid`,`sm`)} wui-tour-end-next" data-wui="${r}"></a>`:``}<button type="button" class="${o?ge:n(`primary`,`solid`,`sm`)} wui-tour-end-button" data-wui="${r}"></button></div>`,U(s,`.wui-tour-end-title`,HTMLElement).textContent=t.title,U(s,`.wui-tour-end-message`,HTMLElement).textContent=t.message,U(s,`.wui-tour-end-button`,HTMLButtonElement).textContent=t.button;let{nextLabel:c,nextHref:l}=t;if(o&&c&&l){let e=U(s,`.wui-tour-end-next`,HTMLAnchorElement);e.textContent=c,e.setAttribute(`href`,l)}return s}var ve=e=>e.button===0&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey;function ye(e,t,n){let r=e.ownerDocument,i=e.getRootNode()===r,a=_e(r,t,i),o=U(a,`.wui-tour-end-button`,HTMLButtonElement),s=a.querySelector(`.wui-tour-end-next`);if(s!==null&&!(s instanceof HTMLAnchorElement))throw Error(`The end dialog's next link is not a link.`);let c=s,l=c?[c,o]:[o],u=c??o,d=new AbortController;return new Promise(s=>{let f=e=>{d.abort(),s(e)};if(n?.aborted){f(`done`);return}let p=U(e,`.wui-tour-card:not(.wui-tour-end)`,HTMLElement),m=U(e,`.wui-tour-spot`,HTMLElement),h=U(e,`[role=status]`,HTMLElement),g={signal:d.signal};n?.addEventListener(`abort`,()=>f(`done`),g),o.addEventListener(`click`,()=>f(`done`),g),c&&c.addEventListener(`click`,e=>{ve(e)&&(e.preventDefault(),f(`next`))},g),r.addEventListener(`keydown`,e=>{if(!(e.altKey||e.ctrlKey||e.metaKey)){if(e.key===`Escape`)e.preventDefault(),e.stopPropagation(),f(`done`);else if(e.key===`Enter`&&c&&!e.shiftKey&&(e.composedPath?.()[0]??e.target)===c)e.preventDefault(),f(`next`);else if(e.key===`Tab`&&i){e.preventDefault();let t=r.activeElement,n=t instanceof HTMLElement?l.indexOf(t):-1,i=n===-1?e.shiftKey?l.length-1:0:(n+(e.shiftKey?-1:1)+l.length)%l.length,a=l[i];if(!a)throw Error(`The end dialog has no focus stop.`);a.focus()}}},{capture:!0,signal:d.signal}),i&&r.addEventListener(`focusin`,e=>{let t=e.target;if(t!==null&&!(t instanceof Node))throw Error(`Focus moved to a target that is not a node.`);a.contains(t)||u.focus()},g);let _=()=>{d.signal.aborted||(p.hidden=!0,R(m,p,null),e.append(a),E(a),h.textContent=[t.title,t.message].filter(Boolean).join(`. `),u.focus())},v=D(p);v?v.then(_):_()})}var be=` :host { all: initial; ${Object.entries({"--wui-z-tour":`1550`,"--wui-radius-sm":`8px`,"--wui-radius-lg":`14px`,"--wui-shadow-popover":`0px 8px 28px -6px rgba(7, 20, 55, 0.14)`,"--wui-ease-out":`cubic-bezier(0.22, 1, 0.36, 1)`,"--wui-tour-motion-duration":`200ms`,"--wui-tour-motion-ease":`cubic-bezier(0.22, 1, 0.36, 1)`,"--wui-tour-spot-duration":`240ms`,"--wui-tour-spot-ease":`cubic-bezier(0.32, 0.72, 0, 1)`,"--color-primary":`#4F46E5`,"--color-primary-hover":`#4338CA`,"--color-primary-text":`#4F46E5`,"--color-focus-ring":`#4F46E5`,"--wui-focus-ring-width":`2px`,"--wui-focus-ring-offset":`2px`,"--color-on-primary":`#FFFFFF`,"--color-success-soft":`#E8FAEE`,"--color-success-text":`#0e7531`,"--color-on-scrim":`#FFFFFF`,"--color-scrim-strong":`color-mix(in srgb, #071437 62%, transparent)`,"--color-surface":`#FFFFFF`,"--color-text":`#071437`,"--color-text-muted":`#4B5675`,"--color-border":`#EBEDF3`,"--color-bg-muted":`#F5F6FA`}).map(([e,t])=>` ${e}: ${t};`).join(` `)} } *, *::before, *::after { box-sizing: border-box; } [hidden] { display: none !important; } .visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; } .btn { display: inline-block; margin: 0; padding: 0.25rem 0.5rem; border: 1px solid transparent; border-radius: 0.375rem; background: transparent; font: inherit; font-size: 0.875rem; font-weight: 500; line-height: 1.5; text-align: center; text-decoration: none; white-space: nowrap; cursor: pointer; } .btn:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; } .btn-primary { background: var(--color-primary); border-color: var(--color-primary); color: var(--color-on-primary); } .btn-primary:hover { background: var(--color-primary-hover); border-color: var(--color-primary-hover); } .btn-outline-neutral { border-color: var(--color-text-muted); color: var(--color-text-muted); } .btn-outline-neutral:hover { background: var(--color-bg-muted); color: var(--color-text); } .btn-link { font-weight: 400; color: var(--color-primary-text); text-decoration: underline; } .btn-link:hover { color: var(--color-primary-hover); } .wui-tour-layer { pointer-events: none; font-family: "Webority Sans", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; font-size: 16px; font-weight: 400; line-height: 1.5; color: var(--color-text); text-align: start; } .wui-tour-card { pointer-events: auto; } .wui-tour-layer { position: fixed; inset: 0; z-index: var(--wui-z-tour); } .wui-tour-spot { position: fixed; box-shadow: 0 0 0 2px var(--color-primary), 0 0 4px 2px color-mix(in srgb, var(--color-primary) 30%, transparent), 0 0 0 100vmax var(--color-scrim-strong); pointer-events: none; } .wui-tour-card { display: flex; flex-direction: column; gap: 8px; width: min(360px, 100vw - 16px); padding: 16px; overflow-y: auto; background: var(--color-surface); color: var(--color-text); border: 1px solid var(--color-border); border-radius: var(--wui-radius-lg); corner-shape: squircle; box-shadow: var(--wui-shadow-popover); } .wui-tour-card:focus { outline: none; } .wui-tour-card:focus-visible { outline: var(--wui-focus-ring-width) solid var(--color-focus-ring); outline-offset: var(--wui-focus-ring-offset); } .wui-tour-title { margin: 0; font-size: 16px; font-weight: 600; } .wui-tour-text { margin: 0; font-size: 14px; color: var(--color-text-muted); } .wui-tour-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; } .wui-tour-nav { display: flex; gap: 8px; } .wui-tour-skip { color: var(--color-text-muted); } .wui-tour-back, .wui-tour-next { min-width: 64px; } @keyframes wui-tour-fade-in { from { opacity: 0; } to { opacity: 1; } } @keyframes wui-tour-card-enter { from { opacity: 0; scale: 0.96; translate: var(--wui-tour-card-lift, 0 6px); } to { opacity: 1; scale: 1; translate: 0 0; } } .wui-tour-layer[data-state=leaving], .wui-tour-card[data-state=leaving] { opacity: 0; } .wui-tour-layer[data-state=leaving], .wui-tour-layer[data-state=leaving] * { pointer-events: none; } @media (prefers-reduced-motion: no-preference) { .wui-tour-layer { animation: wui-tour-fade-in var(--wui-tour-motion-duration) var(--wui-tour-motion-ease); } .wui-tour-layer[data-state=leaving] { transition: opacity var(--wui-tour-motion-duration) var(--wui-tour-motion-ease); } .wui-tour-spot { transition: top var(--wui-tour-spot-duration) var(--wui-tour-spot-ease), left var(--wui-tour-spot-duration) var(--wui-tour-spot-ease), width var(--wui-tour-spot-duration) var(--wui-tour-spot-ease), height var(--wui-tour-spot-duration) var(--wui-tour-spot-ease), border-radius var(--wui-tour-spot-duration) var(--wui-tour-spot-ease); } .wui-tour-spot[data-tracking] { transition: none; } .wui-tour-card { --wui-tour-card-lift: 0 6px; transform-origin: top center; } .wui-tour-card[data-placement=top] { --wui-tour-card-lift: 0 -6px; transform-origin: bottom center; } .wui-tour-card[data-placement=bottom] { --wui-tour-card-lift: 0 6px; transform-origin: top center; } .wui-tour-card[data-placement=left] { --wui-tour-card-lift: -6px 0; transform-origin: right center; } .wui-tour-card[data-placement=right] { --wui-tour-card-lift: 6px 0; transform-origin: left center; } .wui-tour-card[data-placement=overlap], .wui-tour-card[data-placement=center] { --wui-tour-card-lift: 0 0; transform-origin: center; } .wui-tour-card[data-state=entering] { animation: wui-tour-card-enter var(--wui-tour-motion-duration) var(--wui-tour-motion-ease) var(--wui-tour-card-delay, 0ms) both; } .wui-tour-card[data-state=leaving] { transition: opacity calc(var(--wui-tour-motion-duration) / 2) var(--wui-tour-motion-ease); } } @media (prefers-reduced-motion: reduce) { .wui-tour-layer { animation: wui-tour-fade-in 120ms linear; } .wui-tour-layer[data-state=leaving] { transition: opacity 120ms linear; } .wui-tour-card[data-state=entering] { animation: wui-tour-fade-in 120ms linear both; } } .wui-tour-progress-bar { display: flex; gap: 4px; } .wui-tour-progress-segment { flex: 1 1 0; height: 4px; border-radius: 999px; background: var(--color-border); } .wui-tour-progress-segment[data-filled] { background: var(--color-primary); } .wui-tour-position { margin: 0; font-size: 12px; color: var(--color-text-muted); } .wui-tour-layer { padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); } .wui-tour-card:has(.wui-tour-arrow:not([hidden])) { overflow: visible; } .wui-tour-arrow { position: absolute; width: 8px; height: 8px; background: var(--color-surface); border: 1px solid var(--color-border); rotate: 45deg; pointer-events: none; } .wui-tour-card[data-placement=bottom] .wui-tour-arrow { top: -5px; border-right-color: rgba(0, 0, 0, 0); border-bottom-color: rgba(0, 0, 0, 0); } .wui-tour-card[data-placement=top] .wui-tour-arrow { bottom: -5px; border-top-color: rgba(0, 0, 0, 0); border-left-color: rgba(0, 0, 0, 0); } .wui-tour-card[data-placement=right] .wui-tour-arrow { left: -5px; border-top-color: rgba(0, 0, 0, 0); border-right-color: rgba(0, 0, 0, 0); } .wui-tour-card[data-placement=left] .wui-tour-arrow { right: -5px; border-bottom-color: rgba(0, 0, 0, 0); border-left-color: rgba(0, 0, 0, 0); } @media (max-width: 575.98px) { .wui-tour-card { width: calc(100vw - 16px); } .wui-tour-actions .btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; } } .wui-tour-media { position: relative; order: -1; flex: none; aspect-ratio: 16/9; margin: -16px -16px 4px; overflow: hidden; background: var(--color-border); } .wui-tour-media>img, .wui-tour-media>video { display: block; width: 100%; height: 100%; object-fit: cover; } .wui-tour-card[data-welcome] { width: min(420px, 100vw - 16px); } .wui-tour-media-toggle { position: absolute; inset-block-end: 8px; inset-inline-end: 8px; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: var(--color-scrim-strong); color: var(--color-on-scrim); cursor: pointer; } .wui-tour-media-toggle>svg { width: 20px; height: 20px; fill: currentColor; } .wui-tour-media-toggle:focus-visible { outline: 2px solid var(--color-on-scrim); outline-offset: 2px; } .wui-tour-layer[data-advance] { pointer-events: none; } .wui-tour-layer[data-advance]:not([data-state=leaving]) .wui-tour-card { pointer-events: auto; } .wui-tour-layer[data-advance]:not([data-state=leaving]) .wui-tour-spot::before { content: ""; position: absolute; inset: -100vmax; pointer-events: auto; clip-path: polygon(evenodd, 0 0, 100% 0, 100% 100%, 0 100%, 0 0, 100vmax 100vmax, calc(100% - 100vmax) 100vmax, calc(100% - 100vmax) calc(100% - 100vmax), 100vmax calc(100% - 100vmax), 100vmax 100vmax); } .wui-tour-hint { margin: 0; font-size: 14px; font-weight: 600; color: var(--color-text); } .wui-tour-pointer { position: absolute; top: 50%; left: 50%; width: 18px; height: 24px; pointer-events: none; } .wui-tour-pointer::before { content: ""; position: absolute; inset: 0; background: var(--color-primary); clip-path: polygon(0 0, 0 75%, 28% 58%, 46% 100%, 62% 92%, 45% 52%, 85% 52%); filter: drop-shadow(1px 0 0 var(--color-surface)) drop-shadow(-1px 0 0 var(--color-surface)) drop-shadow(0 1px 0 var(--color-surface)) drop-shadow(0 -1px 0 var(--color-surface)); } .wui-tour-pointer::after { content: ""; position: absolute; top: -16px; left: -16px; width: 32px; height: 32px; border-radius: 50%; background: var(--color-primary); opacity: 0; display: none; } @media (max-width: 575.98px) { .wui-tour-pointer { width: 24px; height: 24px; translate: -50% -50%; } .wui-tour-pointer::before { clip-path: none; border-radius: 50%; box-shadow: 0 0 0 2px var(--color-surface); filter: none; } .wui-tour-pointer::after { top: -4px; left: -4px; } } @keyframes wui-tour-tap { 0% { opacity: 0; transform: translate(56px, 44px) scale(1); } 10% { opacity: 1; transform: translate(56px, 44px) scale(1); } 45% { transform: translate(0, 0) scale(1); } 52% { transform: translate(0, 0) scale(0.86); } 60% { transform: translate(0, 0) scale(1); } 85% { opacity: 1; transform: translate(0, 0) scale(1); } 100% { opacity: 0; transform: translate(0, 0) scale(1); } } @keyframes wui-tour-ripple { 0%, 50% { opacity: 0; transform: scale(0.2); } 52% { opacity: 0.35; transform: scale(0.2); } 80%, 100% { opacity: 0; transform: scale(1); } } @media (prefers-reduced-motion: no-preference) { .wui-tour-pointer { opacity: 0; animation: wui-tour-tap calc(var(--wui-duration-slow) * 6) var(--wui-ease-out) var(--wui-tour-spot-duration) infinite; } .wui-tour-pointer::after { display: block; animation: wui-tour-ripple calc(var(--wui-duration-slow) * 6) var(--wui-ease-out) var(--wui-tour-spot-duration) infinite; } } @keyframes wui-tour-check { from { stroke-dashoffset: 24; } to { stroke-dashoffset: 0; } } .wui-tour-end[data-layout=center] { --wui-tour-card-lift: 0 0; position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); transform-origin: center; align-items: center; gap: 8px; width: min(420px, 100vw - 16px); max-height: calc(100vh - 16px); padding: 24px; text-align: center; } .wui-tour-end[data-layout=center] .wui-tour-actions { justify-content: center; margin-top: 8px; } .wui-tour-end[data-layout=center][data-next] .wui-tour-actions { flex-direction: column; align-items: stretch; width: 100%; gap: var(--wui-space-xs); } .wui-tour-end-mark { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 50%; background: var(--color-success-soft); color: var(--color-success-text); } .wui-tour-end-mark>svg { width: 26px; height: 26px; } .wui-tour-end-mark path { fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 24; } .wui-tour-end-title { font-size: 18px; } .wui-tour-end-message { text-wrap: balance; } .wui-tour-end-next { text-wrap: balance; } .wui-tour-end-button { min-width: 120px; } @media (prefers-reduced-motion: no-preference) { .wui-tour-end-mark path { animation: wui-tour-check 300ms var(--wui-ease-out) calc(var(--wui-tour-card-delay, 0ms) + 120ms) both; } } `,W=`wui-tour-media`,xe=`wui-tour-media-toggle`,G=`http://www.w3.org/2000/svg`,Se=`M6 5h4v14H6zM14 5h4v14h-4z`,Ce=`M8 5v14l11-7z`,we={pause:`Pause animation`,play:`Play animation`},Te=()=>globalThis.matchMedia?.(`(prefers-reduced-motion: reduce)`)?.matches===!0;function Ee(e){let t=document.createElementNS(G,`svg`);t.setAttribute(`viewBox`,`0 0 24 24`),t.setAttribute(`aria-hidden`,`true`),t.setAttribute(`focusable`,`false`);let n=document.createElementNS(G,`path`);return n.setAttribute(`d`,e),t.appendChild(n),t}function De(e){let t=document.createElement(`img`);return t.setAttribute(`alt`,e.mediaAlt??``),t.setAttribute(`width`,`1280`),t.setAttribute(`height`,`720`),t.setAttribute(`loading`,`lazy`),t.setAttribute(`decoding`,`async`),t.setAttribute(`src`,e.media??``),t}function Oe(e,t){let n=document.createElement(`video`);return n.muted=!0,n.setAttribute(`muted`,``),n.loop=!0,n.setAttribute(`playsinline`,``),t&&n.setAttribute(`autoplay`,``),n.setAttribute(`preload`,t?`auto`:`metadata`),e.mediaAlt&&n.setAttribute(`aria-label`,e.mediaAlt),e.mediaPoster&&n.setAttribute(`poster`,e.mediaPoster),n.setAttribute(`src`,e.media??``),n}function ke(e,t){let n=document.createElement(`button`);n.type=`button`,n.className=xe;let r=(r=!e.paused)=>{n.setAttribute(`aria-label`,r?t.pause:t.play),n.replaceChildren(Ee(r?Se:Ce))};return e.addEventListener(`play`,()=>r()),e.addEventListener(`pause`,()=>r()),n.addEventListener(`click`,()=>{e.paused?e.play()?.catch(()=>r()):e.pause()}),r(e.hasAttribute(`autoplay`)),n}function Ae(e){let t=e.querySelector(`:scope > .${W}`);if(!t)return;let n=t.querySelector(`video`);n&&(n.pause(),n.removeAttribute(`src`),n.load()),t.remove()}function je(e,t,n=we){if(Ae(e),!t.media){e.removeAttribute(`data-media`);return}let r=document.createElement(`div`);if(r.className=W,t.mediaType===`video`){let e=Oe(t,!Te());r.append(e,ke(e,n))}else r.appendChild(De(t));e.prepend(r),e.setAttribute(`data-media`,t.target?`step`:`welcome`)}var Me=`Step {current} of {total}`;function K(e){let t=/* @__PURE__ */ new Set;return{drop:e=>{t.add(e)},position:e=>{t.delete(e);let n=0;for(let r of t)r<e&&n++;return e+1-n},total:()=>e-t.size}}function Ne(e,t,n){return(e.getAttribute(`progress-label`)||Me).replace(/\{(current|total)\}/g,(e,r)=>String(r===`current`?t:n))}function Pe(e,{text:t,position:n,total:r}){let i=e.querySelector(`.wui-tour-position`);if(!(i instanceof HTMLElement))throw Error(`tour position label missing`);i.textContent=t;let a=e.querySelector(`.wui-tour-progress-bar`);if(!a){let t=e.ownerDocument,n=t.createElement(`div`);n.className=`wui-tour-progress`,n.setAttribute(`aria-hidden`,`true`),a=t.createElement(`div`),a.className=`wui-tour-progress-bar`,n.append(a),i.before(n)}let o=a.children;for(;o.length<r;){let t=e.ownerDocument.createElement(`span`);t.className=`wui-tour-progress-segment`,a.append(t)}for(;o.length>r;){let e=a.lastElementChild;if(!e)throw Error(`progress bar segment missing`);e.remove()}for(let e=0;e<o.length;e++){let t=o[e];if(!t)throw Error(`progress bar segment missing`);t.toggleAttribute(`data-filled`,e<n)}}var Fe=`wui-tour-step`,Ie=`wui-tour-host`,q=`data-tracking`,Le={back:`Back`,next:`Next`,skip:`Skip`,done:`Done`,mediaPause:`Pause animation`,mediaPlay:`Play animation`,endTitle:`You're all set`,endMessage:`You know your way around now. Enjoy exploring.`,endButton:`Done`},Re={back:`back-label`,next:`next-label`,skip:`skip-label`,done:`done-label`,mediaPause:`media-pause-label`,mediaPlay:`media-play-label`,endTitle:`end-title`,endMessage:`end-message`,endButton:`end-button`},ze=[[`media`,`media`],[`mediaAlt`,`media-alt`],[`mediaPoster`,`media-poster`],[`mediaType`,`media-type`],[`advanceOn`,`advance-on`],[`actionLabel`,`action-label`]],J={index:null,position:null,total:null},Be=0,Y=e=>!e?.isConnected||getComputedStyle(e).visibility===`hidden`?!1:e.getClientRects().length>0,X=e=>e instanceof HTMLElement&&(e.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(e.tagName));function Z(e,t,n){let r=e.querySelector(t);if(!(r instanceof n))throw Error(`<wui-tour> layer has no ${t}`);return r}var Q=()=>{let e=document.activeElement;for(;e?.shadowRoot?.activeElement;)e=e.shadowRoot.activeElement;return e},$=null;function Ve(e){$||($=new CSSStyleSheet,$.replaceSync(be)),e.adoptedStyleSheets=[$]}var He=class extends i{seenStore;onBeforeStep;_run;_running;_layer;_outer;_shadow;_unbindAdvance;_ending;_seenMark;_steps=[];_progress=K(0);_firstIndex=0;_returnFocus=null;_current=null;_moving=!1;_card=null;_spot=null;_live=null;_onKey=null;_onFocusIn=null;static get observedAttributes(){return[`open`]}constructor(){super(),this.seenStore=null,this.onBeforeStep=null,this._run=0,this._running=!1,this._layer=null,this._outer=null,this._shadow=null,this._unbindAdvance=null,this._ending=null,this._seenMark=null}connectedCallback(){this.hasAttribute(`open`)&&this.start()}disconnectedCallback(){this.stop()}attributeChangedCallback(e,t,n){e===`open`&&this.isConnected&&(n===null?this.stop():this.start())}get tourId(){return this.getAttribute(`tour-id`)||``}set tourId(e){e==null||e===``?this.removeAttribute(`tour-id`):this.setAttribute(`tour-id`,String(e))}get isolated(){return this.hasAttribute(`isolated`)}set isolated(e){this.toggleAttribute(`isolated`,e===!0||e===``||e===`true`)}_stepList(){return Array.from(this.querySelectorAll(`:scope > ${Fe}`),e=>{let t={target:e.getAttribute(`target`)||``,title:e.getAttribute(`title`)||void 0,description:(e.textContent??``).trim()};for(let[n,r]of ze)e.hasAttribute(r)&&(t[n]=e.getAttribute(r)??void 0);return t})}_stepAt(e){let t=this._steps[e];if(!t)throw RangeError(`<wui-tour> has no step ${e}; it has ${this._steps.length}.`);return t}_store(){return this.seenStore?this.seenStore:this.getAttribute(`seen-store`)===`local`?o():globalThis.window?.WUI?.tour?.seenStore||null}_label(e){return this.getAttribute(Re[e])||Le[e]}_endDialogText(){if(this.getAttribute(`end-dialog`)===`false`)return null;let e=(this.getAttribute(`end-next-label`)??``).trim(),t=(this.getAttribute(`end-next-href`)??``).trim();return{title:this._label(`endTitle`),message:this._label(`endMessage`),button:this._label(`endButton`),nextLabel:e,nextHref:t}}_markSeen(e){let t=this._store();return t?t.markSeen(this.tourId,e):null}async start(){if(this._running)return;this._running=!0;let e=++this._run;this.hasAttribute(`open`)||this.setAttribute(`open`,``);try{await this._start(e)}catch(t){throw e===this._run&&(this._running=!1),t}}async _start(e){this._steps=this._stepList(),this._progress=K(this._steps.length);let t=this._store();if(t&&!this.tourId)throw Error(`<wui-tour> needs a tour-id to use a seen store.`);if(t&&await t.isSeen(this.tourId)){e===this._run&&this._finish(`alreadySeen`);return}for(let[e,t]of this._steps.entries())t.target&&!Y(document.querySelector(t.target))&&this._progress.drop(e);this._returnFocus=document.activeElement;let n=await this._locate(0,1,e);e===this._run&&(n?(this._firstIndex=n.index,this.dispatchEvent(new CustomEvent(`wui-tour:start`,{bubbles:!0,detail:{total:this._progress.total()}})),e===this._run&&(this._build(),this._show(n))):this._finish(`noTargets`))}next(){return this._move(1)}back(){return!this._current||this._current.index<=this._firstIndex?Promise.resolve():this._move(-1)}async goTo(e){if(this._current){if(!Number.isInteger(e)||e<0||e>=this._steps.length)throw RangeError(`<wui-tour> has no step ${e}; it has ${this._steps.length}.`);await this._go(e,1)}}stop(){this._running&&(this._run++,this._teardown(),this._running=!1,this.hasAttribute(`open`)&&this.removeAttribute(`open`))}async _locate(e,t,n){let r=this._steps;for(let i=e;i>=0&&i<r.length;i+=t){let e=r[i];if(!e)break;if(await this._beforeStep(e,i),n!==this._run)return null;if(!e.target)return{index:i,target:null};let t=document.querySelector(e.target),a=t instanceof HTMLElement||t instanceof SVGElement?t:null;if(Y(a))return this._progress.position(i),{index:i,target:a};this._progress.drop(i)}return null}async _beforeStep(e,t){let n=[];this.dispatchEvent(new CustomEvent(`wui-tour:beforestep`,{bubbles:!0,detail:{step:e,index:t,wait:e=>n.push(e)}})),await Promise.all(n),typeof this.onBeforeStep==`function`&&await this.onBeforeStep(e,t)}_build(){let t=`wui-tour-${++Be}`,i=document.createElement(`div`);i.className=`wui-tour-layer`,i.innerHTML=` <div class="wui-tour-spot" aria-hidden="true"></div> <div class="wui-tour-card" role="dialog" aria-modal="true" tabindex="-1" aria-labelledby="${t}-title" aria-describedby="${t}-text"> <p class="wui-tour-position"></p> <h2 class="wui-tour-title" id="${t}-title"></h2> <p class="wui-tour-text" id="${t}-text"></p> <div class="wui-tour-actions"> <button type="button" class="btn btn-sm btn-link wui-tour-skip"></button> <div class="wui-tour-nav"> <button type="button" class="${n(`neutral`,`outline`,`sm`)} wui-tour-back" data-wui="${r}"></button> <button type="button" class="${n(`primary`,`solid`,`sm`)} wui-tour-next" data-wui="${r}"></button> </div> </div> </div> <div class="visually-hidden" role="status" aria-live="polite"></div>`;let o=i;this._shadow=null,this.isolated&&(o=document.createElement(Ie),this._shadow=o.attachShadow({mode:`open`}),Ve(this._shadow),this._shadow.appendChild(i)),document.body.appendChild(o),document.documentElement.setAttribute(a,``),this._outer=o,this._layer=i;let s=Z(i,`.wui-tour-spot`,HTMLDivElement),c=Z(i,`.wui-tour-card`,HTMLDivElement),l=Z(i,`[role=status]`,HTMLElement);this._spot=s,this._card=c,this._live=l,Z(c,`.wui-tour-skip`,HTMLElement).addEventListener(`click`,()=>this._close(`skipped`,`button`)),Z(c,`.wui-tour-back`,HTMLElement).addEventListener(`click`,()=>this._move(-1)),Z(c,`.wui-tour-next`,HTMLElement).addEventListener(`click`,()=>this._move(1)),this._shadow&&c.removeAttribute(`aria-modal`);let u=e=>this._key(e);this._onKey=u;let d=e=>{let t=this._layer;if(!t||this._ending)return;let n=this._current,r=n?this._stepAt(n.index):null;if(!(e.target instanceof Node))throw Error(`<wui-tour> saw a focus change from a non-node target`);x(t,r,n?.target??null,e.target)||c.focus()};this._onFocusIn=d,document.addEventListener(`keydown`,u,!0),this._shadow||document.addEventListener(`focusin`,d),e(o,()=>this._follow())}_active(){return this._shadow?this._shadow.activeElement:document.activeElement}_show(e){this._current=e;let{index:t,target:n}=e,r=this._stepAt(t),i=this._layer,a=this._spot,o=this._card,s=this._live;if(!i||!a||!o||!s)throw Error(`<wui-tour> shows a step before its layer is built`);let c=this._progress.position(t),l=this._progress.total(),u=c===l&&!this._endDialogText(),d=Ne(this,c,l);Pe(o,{text:d,position:c,total:l}),je(o,r,{pause:this._label(`mediaPause`),play:this._label(`mediaPlay`)}),o.toggleAttribute(`data-welcome`,!n);let f=y(this,{layer:i,spot:a,card:o},r,n),p=Z(o,`.wui-tour-title`,HTMLElement);p.textContent=r.title||``,p.hidden=!r.title,Z(o,`.wui-tour-text`,HTMLElement).textContent=r.description||``,Z(o,`.wui-tour-skip`,HTMLElement).textContent=this._label(`skip`);let m=Z(o,`.wui-tour-back`,HTMLElement);m.textContent=this._label(`back`),m.hidden=t<=this._firstIndex,Z(o,`.wui-tour-next`,HTMLElement).textContent=this._label(u?`done`:`next`);let h=[d,r.title,r.description].filter(Boolean).join(`. `);s.textContent=f?[h,f].join(/[.!?]$/.test(h)?` `:`. `):h,L(o,n),a.removeAttribute(q),this._place(),E(o),this._unbindAdvance?.(),this._unbindAdvance=b(r,n,()=>this._move(1));let g=this._active();(g!==null&&o.contains(g)?!(g instanceof HTMLElement&&g.hidden):this._shadow!==null&&X(Q()))||o.focus(),this.dispatchEvent(new CustomEvent(`wui-tour:step`,{bubbles:!0,detail:{step:r,index:t,position:c,total:l}}))}_place(){if(!this._current||!this._layer)return;let e=this._spot,t=this._card;if(!e||!t)throw Error(`<wui-tour> places a step before its layer is built`);R(e,t,this._current.target)}_follow(){if(!this._current||!this._layer||this._ending)return;let e=this._spot;if(!e)throw Error(`<wui-tour> follows a step before its spot is built`);let t=e.style.cssText;this._place(),e.style.cssText!==t&&e.setAttribute(q,``)}async _move(e){this._current&&await this._go(this._current.index+e,e)}async _go(e,t){if(!this._current||this._moving)return;this._moving=!0;let n=this._run;try{let r=await this._locate(e,t,n);if(n!==this._run)return;if(r){let e=this._card;if(!e)throw Error(`<wui-tour> moved with no card showing`);let t=D(e);if(t&&await t,n!==this._run)return;this._show(r)}else if(t>0){let e=this._endDialogText(),t=e?await this._showEnd(e):`done`;if(n!==this._run)return;let r=await this._close(t===`next`?`next`:`finished`);if(t===`next`&&r&&e){let t=this.ownerDocument.defaultView;if(!t)throw Error(`<wui-tour> has no window to follow its next link in`);t.location.assign(e.nextHref)}}}finally{this._moving=!1}}_showEnd(e){this._unbindAdvance?.(),this._unbindAdvance=null;let t=this._layer,n=this._spot,r=this._card;if(!t||!n||!r)throw Error(`<wui-tour> ends a tour before its layer is built`);return y(this,{layer:t,spot:n,card:r},null,null),n.removeAttribute(q),this._ending=new AbortController,this._seenMark=this._markSeen(`finished`),ye(t,e,this._ending.signal)}_key(e){if(!(!this._layer||this._ending||e.altKey||e.ctrlKey||e.metaKey)){if(e.key===`Escape`)e.preventDefault(),e.stopPropagation(),this._close(`skipped`,`escape`);else if(e.key===`ArrowRight`||e.key===`ArrowLeft`){if(X(e.composedPath?.()[0]??e.target))return;if(e.preventDefault(),e.key===`ArrowRight`)this._move(1);else{let e=this._current;if(!e)throw Error(`<wui-tour> moved back with no step showing`);e.index>this._firstIndex&&this._move(-1)}}else if(e.key===`Tab`&&!this._shadow){let t=this._current,n=this._card;if(!t||!n)throw Error(`<wui-tour> cycled focus with no step showing`);re(e,{card:n,active:this._active(),step:this._stepAt(t.index),target:t.target})}}}_teardown(){if(!this._layer)return;this._onKey&&document.removeEventListener(`keydown`,this._onKey,!0),this._onFocusIn&&document.removeEventListener(`focusin`,this._onFocusIn);let e=!this._shadow||this._shadow.activeElement!==null||!document.activeElement||document.activeElement===document.body;this._unbindAdvance?.(),this._unbindAdvance=null,this._ending?.abort(),this._ending=null,this._seenMark=null;let n=this._outer;if(t(n),!n)throw Error(`<wui-tour> has a layer with no host to remove`);ue(n),document.documentElement.removeAttribute(a),this._outer=null,this._shadow=null,this._layer=null,this._current=null;let r=this._returnFocus;this._returnFocus=null,e&&r?.isConnected&&(r instanceof HTMLElement||r instanceof SVGElement)&&r.focus()}async _close(e,t=null){let n=this._run,r=this._current,i=r?{index:r.index,position:this._progress.position(r.index),total:this._progress.total()}:J,a=this._seenMark;this._teardown();let o=e===`next`?`finished`:e,s=!1;try{n===this._run&&await(a??this._markSeen(o)),s=n===this._run}finally{this._finish(e,i,t)}return s}_finish(e,t=J,n=null){this._run++,this._running=!1,this.hasAttribute(`open`)&&this.removeAttribute(`open`),this.dispatchEvent(new CustomEvent(`wui-tour:close`,{bubbles:!0,detail:{reason:e,...t,via:n}}))}};export{He as t};
@@ -1 +0,0 @@
1
- import{r as e}from"./dom-Do1pAA12.js";import{a as t,s as n,t as r}from"./zone-BR02ZkHF.js";var i=`INR`,a=Object.freeze({INR:`₹`,USD:`$`,EUR:`€`,GBP:`£`}),o=e=>typeof e==`string`&&/^[A-Z]{3}$/.test(e),s=(e=`INR`)=>a[e]??`${e} `,c=[`number`,`currency`,`percent`,`compact`,`duration`,`date`],l=[`INR`,`USD`,`EUR`,`GBP`],u=[`rupees`,`paise`],d=[`ms`,`s`,`min`,`h`],f=[`day`,`month`,`year`,`datetime`,`time`];function p(e){return u.some(t=>t===e)}var m=`-`,h=`−`,g=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],_=(t,n)=>e(t[n],`no compact unit at index ${n}`),v=[[1e7,`Cr`],[1e5,`L`],[1e3,`K`]],y=[[1e9,`B`],[1e6,`M`],[1e3,`K`]],b=e=>!e||e===`INR`?`en-IN`:`en-US`,x=(e,t)=>typeof e==`number`&&Number.isInteger(e)&&e>=0&&e<=20?e:t,S=/* @__PURE__ */ new Map,C=(e,t=`en-IN`)=>{let n=`${t}:${e}`,r=S.get(n);return r||(r=new Intl.NumberFormat(t,{minimumFractionDigits:0,maximumFractionDigits:e}),S.set(n,r)),r},w=/* @__PURE__ */ new Map,T=(e,t=`en-IN`)=>{let n=`${t}:${e}`,r=w.get(n);return r||(r=new Intl.NumberFormat(t,{minimumFractionDigits:e,maximumFractionDigits:e}),w.set(n,r)),r},E=e=>typeof e==`number`&&Number.isFinite(e),D=e=>e<0&&!Object.is(Math.abs(e),0)?h:``,O=(e,t)=>t===`paise`?e/100:e;function k(e,{decimals:t}={}){if(!E(e))return`-`;let n=C(x(t,2)).format(Math.abs(e));return n===`0`?`0`:D(e)+n}function A(e,{unit:t=`rupees`,decimals:n,currency:r=`INR`}={}){if(!E(e))return`-`;let i=O(e,t),a=T(x(n,0),b(r)).format(Math.abs(i));return(Number(a.replace(/,/g,``))===0?``:D(i))+s(r)+a}var j=e=>e>0&&e<.1?Math.min(20,1-Math.floor(Math.log10(e))):2;function M(e,{currency:t,unit:n=`rupees`}={}){if(!E(e))return`-`;let r=t?O(e,n):e,i=t?s(t):``,a=t?b(t):`en-IN`,o=a===`en-IN`?v:y,c=Math.abs(r),l=o.findIndex(([e])=>c>=e);if(l===-1){let e=C(j(c),a).format(c);if(e!==`1,000`)return(e===`0`?``:D(r))+i+e;l=o.length-1}let[u,d]=_(o,l),f=c/u,p=f>=100?0:f>=10?1:2,m=Number(f.toFixed(p));return m>=100&&l>0&&(--l,[u,d]=_(o,l),f=c/u,p=f>=100?0:f>=10?1:2,m=Number(f.toFixed(p))),`${D(r)}${i}${C(p,a).format(m)} ${d}`}function N(e,{decimals:t}={}){return E(e)?`${k(e*100,{decimals:x(t,1)})}%`:`-`}var P={ms:1,s:1e3,min:6e4,h:36e5};function F(e,{unit:t=`s`}={}){if(!E(e))return`-`;let n=P[t]??1e3,r=Math.abs(e*n),i=D(e);if(Math.round(r)<1e3)return`${i}${C(0).format(r)} ms`;let a=r/1e3;if(a<10)return`${i}${C(1).format(a)}s`;let o=Math.round(a);if(o<60)return`${i}${o}s`;let s=e=>String(e).padStart(2,`0`),c=Math.floor(o/60);if(c<60)return`${i}${c}m ${s(o%60)}s`;let l=Math.floor(c/60);return`${i}${C(0).format(l)}h ${s(c%60)}m`}function I(e,n=r){if(e instanceof Date)return e.getTime();if(E(e))return e;if(typeof e!=`string`)return NaN;let i=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e.trim());if(i){let[e,r,a]=[Number(i[1]),Number(i[2]),Number(i[3])],o=new Date(Date.UTC(2e3,r-1,a));return o.setUTCFullYear(e),o.getUTCFullYear()===e&&o.getUTCMonth()===r-1&&o.getUTCDate()===a?t(o.getTime(),n):NaN}return Date.parse(e)}function L(e,t=r){let{year:i,month:a,day:o,hour:s,minute:c}=n(e,t);return{year:i,month:a,day:o,hour:s,minute:c}}function R(e,{pattern:t=`day`,timeZone:n=r}={}){let i=I(e,n);if(!Number.isFinite(i))return`-`;let a=L(i,n),o=e=>String(e).padStart(2,`0`),s=`${o(a.day)}-${g[a.month]}-${a.year}`,c=`${o(a.hour)}:${o(a.minute)}`;switch(t){case`month`:return`${g[a.month]}-${a.year}`;case`year`:return String(a.year);case`datetime`:return`${s} ${c}`;case`time`:return c;default:return s}}function z(e,t){if(e==null||e===``)return`-`;let n=t?.style;if(n===`date`)return R(e,t);if(typeof e!=`number`)return String(e);switch(n){case`currency`:return A(e,t);case`percent`:return N(e,t);case`compact`:return M(e,t);case`duration`:return F(e,t);default:return k(e,t)}}function B(e,{timeZone:t=r}={}){let n=I(e);if(!Number.isFinite(n))return`-`;let i=Object.fromEntries(H(t).formatToParts(n).map(e=>[e.type,e.value])),a=i.dayPeriod;if(a===void 0)throw Error(`Intl returned no day period for a 12-hour clock`);return`${i.day}-${g[Number(i.month)-1]}-${i.year}, ${i.hour}:${i.minute} ${a.toUpperCase()}`}var V=/* @__PURE__ */ new Map;function H(e){let t=V.get(e);return t||(t=new Intl.DateTimeFormat(`en-IN`,{day:`2-digit`,month:`numeric`,year:`numeric`,hour:`numeric`,minute:`2-digit`,hour12:!0,timeZone:e}),V.set(e,t)),t}function U(e=r){return new Intl.DateTimeFormat(`en-IN`,{timeZone:e,timeZoneName:`short`}).formatToParts(/* @__PURE__ */ new Date).find(e=>e.type===`timeZoneName`)?.value??e}export{I as _,c as a,s as b,A as c,F as d,k as f,U as g,p as h,m as i,R as l,z as m,f as n,u as o,N as p,d as r,M as s,l as t,B as u,a as v,o as x,i as y};