@nice2dev/ui 1.3.9 → 1.3.10

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 (59) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/dist/NiceColorPicker-BLwYNSXJ.cjs +1 -0
  3. package/dist/NiceColorPicker-DS59tNkP.js +552 -0
  4. package/dist/NiceDataGrid-CL2_7fS7.cjs +10 -0
  5. package/dist/NiceDataGrid-CpJrRN_H.js +2269 -0
  6. package/dist/NiceForm-BQj-K7p7.cjs +1 -0
  7. package/dist/NiceForm-HQ4h7hX_.js +5023 -0
  8. package/dist/NiceGantt-BygumlaY.cjs +1 -0
  9. package/dist/NiceGantt-DTC7OH-v.js +334 -0
  10. package/dist/NiceHtmlEditor-BtpuaLln.js +901 -0
  11. package/dist/NiceHtmlEditor-C1OVtLQ6.cjs +10 -0
  12. package/dist/NiceMention-CVxxCVtQ.js +11668 -0
  13. package/dist/NiceMention-Te66Oid1.cjs +430 -0
  14. package/dist/NiceModuleLifecyclePanel-DCrFyUH8.cjs +1 -0
  15. package/dist/NiceModuleLifecyclePanel-Mt80MdET.js +7441 -0
  16. package/dist/NicePagination-CKsAP38Q.cjs +1 -0
  17. package/dist/NicePagination-zOed5QxG.js +202 -0
  18. package/dist/NicePivotGrid-Clue9FM5.js +1184 -0
  19. package/dist/NicePivotGrid-Cnkr9WkC.cjs +152 -0
  20. package/dist/NiceSavedQueryPanel-NgG58w6i.js +6226 -0
  21. package/dist/NiceSavedQueryPanel-lTWY2plm.cjs +587 -0
  22. package/dist/NiceScheduler-BWwqFKEc.js +1712 -0
  23. package/dist/NiceScheduler-DqWEJU7g.cjs +5 -0
  24. package/dist/NiceSelect-BNPXs6FQ.cjs +1 -0
  25. package/dist/NiceSelect-DEruWHan.js +495 -0
  26. package/dist/NiceWindow-D3V7A69Q.js +2247 -0
  27. package/dist/NiceWindow-pgR4c-kQ.cjs +1 -0
  28. package/dist/core-lazy-Bjdu111n.js +351 -0
  29. package/dist/core-lazy-Bx_8BOlG.cjs +1 -0
  30. package/dist/data.cjs +1 -1
  31. package/dist/data.d.ts +46 -5
  32. package/dist/data.mjs +3 -3
  33. package/dist/devops-CqhA0rjL.js +9130 -0
  34. package/dist/devops-cgRBnZVX.cjs +18 -0
  35. package/dist/devops.cjs +1 -1
  36. package/dist/devops.mjs +1 -1
  37. package/dist/editors.cjs +1 -1
  38. package/dist/editors.mjs +7 -7
  39. package/dist/feedback.cjs +1 -1
  40. package/dist/feedback.mjs +1 -1
  41. package/dist/index.cjs +108 -108
  42. package/dist/index.css +1 -1
  43. package/dist/index.d.ts +51 -8
  44. package/dist/index.mjs +13739 -13579
  45. package/dist/lazy.cjs +1 -1
  46. package/dist/lazy.mjs +15 -15
  47. package/dist/navigation.cjs +1 -1
  48. package/dist/navigation.d.ts +2 -0
  49. package/dist/navigation.mjs +3 -3
  50. package/dist/no-code-BQqK8mvU.cjs +331 -0
  51. package/dist/no-code-Cppb-xz3.js +8320 -0
  52. package/dist/no-code.cjs +1 -1
  53. package/dist/no-code.mjs +1 -1
  54. package/dist/overlays.cjs +1 -1
  55. package/dist/overlays.mjs +1 -1
  56. package/dist/pickerCommons-BA3-D5RC.js +663 -0
  57. package/dist/pickerCommons-KrBqCBDn.cjs +1 -0
  58. package/dist/style.css +1 -1
  59. package/package.json +4 -4
@@ -0,0 +1,663 @@
1
+ import { jsxs as x, jsx as c } from "react/jsx-runtime";
2
+ import { useNiceTranslation as E, useControlId as F, useComponentDisplayStyle as Z, useComponentDisplayClass as V, useInputPreferences as W, useHintsVisible as z, useRovingFocus as Q, useIntent as Y, useInputHints as q, NiceButtonPrompt as P, useNiceAccessMode as X, NiceKeyboardHint as ff } from "@nice2dev/ui-core";
3
+ import { useState as B, useRef as U, useCallback as D, useEffect as O, forwardRef as ef, useMemo as tf } from "react";
4
+ import { F as cf } from "./vendor-BPVpdtPp.js";
5
+ const nf = [], pf = ({
6
+ tabs: f = nf,
7
+ activeTab: i,
8
+ onChange: s,
9
+ variant: l = "default",
10
+ vertical: d,
11
+ size: n = "md",
12
+ iconOnly: t = !1,
13
+ centered: r = "auto",
14
+ countLocation: o = "right",
15
+ showHints: p,
16
+ id: h,
17
+ className: v,
18
+ "data-testid": e,
19
+ style: g,
20
+ displayStyle: b
21
+ }) => {
22
+ const { t: u } = E(), m = F(h), k = r === "auto" ? t : r, y = Z("tab", b), A = V("tab", b), [T, I] = B(i || f[0]?.id), M = i ?? T, w = U(null), S = U(null), [L] = W(), _ = z(), $ = D(
23
+ (a) => {
24
+ I(a), s?.(a);
25
+ },
26
+ [s]
27
+ );
28
+ Q(S, {
29
+ orientation: d ? "vertical" : "horizontal",
30
+ wrap: !0,
31
+ onMove: (a) => {
32
+ const N = a.getAttribute("data-tab-id");
33
+ N && $(N);
34
+ }
35
+ }), Y(
36
+ ["sectionPrev", "sectionNext"],
37
+ (a) => {
38
+ const N = f.filter((C) => !C.disabled);
39
+ if (N.length < 2)
40
+ return !1;
41
+ const J = N.findIndex((C) => C.id === M), j = a.intent === "sectionNext" ? 1 : -1, H = N[(J + j + N.length) % N.length];
42
+ return $(H.id), [...S.current?.querySelectorAll("[data-tab-id]") ?? []].find((C) => C.getAttribute("data-tab-id") === H.id)?.focus(), !0;
43
+ },
44
+ { ref: w }
45
+ ), q(
46
+ w,
47
+ f.length > 1 ? [
48
+ { intent: "sectionPrev", label: u("input.intent.sectionPrev", "Previous section") },
49
+ { intent: "sectionNext", label: u("input.intent.sectionNext", "Next section") }
50
+ ] : []
51
+ );
52
+ const R = f.length > 1 && _ && (p ?? L.hintDensity === "bar-and-controls"), G = f.find((a) => a.id === M)?.content;
53
+ return /* @__PURE__ */ x(
54
+ "div",
55
+ {
56
+ ref: w,
57
+ className: `nice-tabs nice-tabs--${n} ${d ? "nice-tabs--vertical" : ""} ${t ? "nice-tabs--icon-only" : ""} nice-tabs--ds-${A} ${v || ""}`,
58
+ style: { ...y, ...g },
59
+ "data-testid": e,
60
+ children: [
61
+ /* @__PURE__ */ x(
62
+ "div",
63
+ {
64
+ ref: S,
65
+ className: `nice-tabs__list ${l !== "default" ? `nice-tabs__list--${l}` : ""} ${d ? "nice-tabs__list--vertical" : ""} ${k ? "nice-tabs__list--centered" : ""}`,
66
+ role: "tablist",
67
+ "aria-orientation": d ? "vertical" : "horizontal",
68
+ children: [
69
+ R && /* @__PURE__ */ c("span", { className: "nice-tabs__hint", "aria-hidden": "true", children: /* @__PURE__ */ c(P, { intent: "sectionPrev", size: "sm" }) }),
70
+ f.map((a) => /* @__PURE__ */ x(
71
+ "button",
72
+ {
73
+ type: "button",
74
+ role: "tab",
75
+ id: `${m}-tab-${a.id}`,
76
+ "data-tab-id": a.id,
77
+ "aria-selected": M === a.id,
78
+ "aria-controls": `${m}-panel`,
79
+ "aria-label": t ? a.label : void 0,
80
+ title: t ? a.label : void 0,
81
+ className: `nice-tabs__tab ${M === a.id ? "nice-tabs__tab--active" : ""} ${a.disabled ? "nice-tabs__tab--disabled" : ""} ${o === "bottom" ? "nice-tabs__tab--count-bottom" : ""}`,
82
+ disabled: a.disabled,
83
+ onClick: () => $(a.id),
84
+ children: [
85
+ a.icon,
86
+ !t && /* @__PURE__ */ c("span", { children: a.label }),
87
+ a.badge !== void 0 && /* @__PURE__ */ c(
88
+ "span",
89
+ {
90
+ className: `nice-tabs__badge${o === "bottom" ? " nice-tabs__badge--pill" : ""}`,
91
+ children: a.badge
92
+ }
93
+ )
94
+ ]
95
+ },
96
+ a.id
97
+ )),
98
+ R && /* @__PURE__ */ c("span", { className: "nice-tabs__hint", "aria-hidden": "true", children: /* @__PURE__ */ c(P, { intent: "sectionNext", size: "sm" }) })
99
+ ]
100
+ }
101
+ ),
102
+ /* @__PURE__ */ c(
103
+ "div",
104
+ {
105
+ className: "nice-tabs__panel",
106
+ role: "tabpanel",
107
+ id: `${m}-panel`,
108
+ "aria-labelledby": M ? `${m}-tab-${M}` : void 0,
109
+ children: G
110
+ }
111
+ )
112
+ ]
113
+ }
114
+ );
115
+ };
116
+ function gf(f, {
117
+ open: i,
118
+ onSelect: s,
119
+ onClose: l,
120
+ onOpen: d,
121
+ loop: n = !1,
122
+ pageSize: t = 10,
123
+ intentRef: r
124
+ }) {
125
+ const [o, p] = B(0);
126
+ O(() => {
127
+ p((e) => f.length === 0 ? 0 : Math.min(Math.max(e, 0), f.length - 1));
128
+ }, [f.length]);
129
+ const h = D(
130
+ (e, g) => p((b) => {
131
+ const u = f.length;
132
+ if (u === 0)
133
+ return 0;
134
+ const m = e(b);
135
+ return g ? (m % u + u) % u : Math.min(Math.max(m, 0), u - 1);
136
+ }),
137
+ [f.length]
138
+ ), v = D(
139
+ (e) => {
140
+ if (!i) {
141
+ (e.key === "ArrowDown" || e.key === "ArrowUp") && (e.preventDefault(), d?.());
142
+ return;
143
+ }
144
+ const g = e.target instanceof HTMLTextAreaElement || e.target instanceof HTMLInputElement && e.target.type !== "checkbox";
145
+ if (e.key === "ArrowDown")
146
+ e.preventDefault(), h((b) => b + 1, n);
147
+ else if (e.key === "ArrowUp")
148
+ e.preventDefault(), h((b) => b - 1, n);
149
+ else if (e.key === "PageDown")
150
+ e.preventDefault(), h((b) => b + t, !1);
151
+ else if (e.key === "PageUp")
152
+ e.preventDefault(), h((b) => b - t, !1);
153
+ else if (!g && (e.key === "Home" || e.key === "End"))
154
+ e.preventDefault(), h(() => e.key === "Home" ? 0 : f.length - 1, !1);
155
+ else if (e.key === "Enter") {
156
+ const b = f[o];
157
+ b !== void 0 && (e.preventDefault(), s(b, o));
158
+ } else e.key === "Escape" && l?.();
159
+ },
160
+ [i, f, o, n, t, h, s, l, d]
161
+ );
162
+ return Y(
163
+ ["navigate", "activate"],
164
+ (e) => {
165
+ if (e.source === "keyboard")
166
+ return !1;
167
+ if (e.intent === "activate") {
168
+ const g = f[o];
169
+ if (g === void 0)
170
+ return !1;
171
+ s(g, o);
172
+ return;
173
+ }
174
+ if (e.direction !== "up" && e.direction !== "down")
175
+ return !1;
176
+ h((g) => g + (e.direction === "down" ? 1 : -1), n);
177
+ },
178
+ { ref: r, enabled: i && !!r }
179
+ ), { activeIndex: o, setActiveIndex: p, handleKeyDown: v };
180
+ }
181
+ const mf = /* @__PURE__ */ Object.assign(
182
+ /* @__PURE__ */ ef(
183
+ ({
184
+ label: f,
185
+ checked: i = !1,
186
+ onChange: s,
187
+ disabled: l,
188
+ readOnly: d,
189
+ loading: n,
190
+ required: t,
191
+ size: r = "md",
192
+ name: o,
193
+ id: p,
194
+ className: h,
195
+ style: v,
196
+ accessMode: e,
197
+ displayStyle: g,
198
+ showKeyboardHints: b,
199
+ error: u,
200
+ helperText: m,
201
+ labelPlacement: k,
202
+ errorPlacement: y,
203
+ labelWidth: A,
204
+ controlWidth: T,
205
+ "data-testid": I
206
+ }, M) => {
207
+ const w = X(e, p), S = w === "hidden";
208
+ (w === "disabled" || w === "readOnly") && (l = !0);
209
+ const { t: L } = E(), _ = F(p);
210
+ Z("toggle", g);
211
+ const $ = V("toggle", g), R = tf(
212
+ () => [{ key: "Space", description: L("shortcuts.toggle", "Toggle on/off") }],
213
+ [L]
214
+ );
215
+ return S ? null : /* @__PURE__ */ x(
216
+ "div",
217
+ {
218
+ className: `nice-field nice-field--inline nice-field--${r} ${k === "left" ? "nice-field--label-left" : ""} ${n ? "nice-field--loading" : ""} ${h || ""}`,
219
+ style: {
220
+ ...v,
221
+ ...A != null && {
222
+ "--nice-field-label-width": typeof A == "number" ? `${A}px` : A
223
+ },
224
+ ...T != null && {
225
+ "--nice-field-control-width": typeof T == "number" ? `${T}px` : T
226
+ }
227
+ },
228
+ "data-testid": I,
229
+ "aria-busy": n || void 0,
230
+ children: [
231
+ k === "left" && f && /* @__PURE__ */ c("span", { className: `nice-field__label ${t ? "nice-field__label--required" : ""}`, children: f }),
232
+ /* @__PURE__ */ x("div", { className: "nice-field__control", children: [
233
+ /* @__PURE__ */ x(
234
+ "label",
235
+ {
236
+ className: `nice-toggle nice-toggle--ds-${$} ${r !== "md" ? `nice-toggle--${r}` : ""} ${l || n ? "nice-toggle--disabled" : ""}`,
237
+ htmlFor: _,
238
+ children: [
239
+ /* @__PURE__ */ c(
240
+ "input",
241
+ {
242
+ ref: M,
243
+ id: _,
244
+ type: "checkbox",
245
+ className: "nice-toggle__input",
246
+ name: o,
247
+ checked: i,
248
+ disabled: l || n,
249
+ readOnly: d,
250
+ role: "switch",
251
+ "aria-checked": i,
252
+ "aria-invalid": !!u,
253
+ onChange: (G) => {
254
+ d || n || s?.(G.target.checked);
255
+ }
256
+ }
257
+ ),
258
+ /* @__PURE__ */ c("span", { className: "nice-toggle__track", children: /* @__PURE__ */ c("span", { className: "nice-toggle__thumb" }) }),
259
+ k !== "left" && f && /* @__PURE__ */ c("span", { children: f }),
260
+ b && /* @__PURE__ */ c(ff, { shortcuts: R, size: "sm" })
261
+ ]
262
+ }
263
+ ),
264
+ n && /* @__PURE__ */ c("span", { className: "nice-field__spinner", children: /* @__PURE__ */ c("span", { className: "nice-spinner nice-spinner--sm" }) }),
265
+ y === "right" && u && /* @__PURE__ */ c("div", { id: `${_}-error`, className: "nice-field__error", role: "alert", children: u }),
266
+ y === "right" && !u && m && /* @__PURE__ */ c("div", { id: `${_}-helper`, className: "nice-field__helper", children: m })
267
+ ] }),
268
+ y !== "right" && u && /* @__PURE__ */ c("div", { id: `${_}-error`, className: "nice-field__error", role: "alert", children: u }),
269
+ y !== "right" && !u && m && /* @__PURE__ */ c("div", { id: `${_}-helper`, className: "nice-field__helper", children: m })
270
+ ]
271
+ }
272
+ );
273
+ }
274
+ ),
275
+ { displayName: "NiceToggle" }
276
+ ), af = /* @__PURE__ */ Object.freeze({
277
+ AR: ["#74acdf", "#ffffff", "#74acdf"],
278
+ AT: ["#ed2939", "#ffffff", "#ed2939"],
279
+ AU: ["#012169", "#ffffff", "#e4002b"],
280
+ BE: ["#000000", "#fae042", "#ed2939"],
281
+ BR: ["#009c3b", "#ffdf00", "#002776"],
282
+ CA: ["#ff0000", "#ffffff", "#ff0000"],
283
+ CH: ["#d52b1e", "#ffffff", "#d52b1e"],
284
+ CN: ["#de2910", "#ffde00", "#de2910"],
285
+ CZ: ["#11457e", "#ffffff", "#d7141a"],
286
+ DE: ["#000000", "#dd0000", "#ffce00"],
287
+ DK: ["#c8102e", "#ffffff", "#c8102e"],
288
+ EE: ["#0072ce", "#000000", "#ffffff"],
289
+ EG: ["#ce1126", "#ffffff", "#000000"],
290
+ ES: ["#aa151b", "#f1bf00", "#aa151b"],
291
+ FI: ["#ffffff", "#003580", "#ffffff"],
292
+ FR: ["#0055a4", "#ffffff", "#ef4135"],
293
+ GB: ["#012169", "#ffffff", "#c8102e"],
294
+ GR: ["#0d5eaf", "#ffffff", "#0d5eaf"],
295
+ HR: ["#171796", "#ffffff", "#ff0000"],
296
+ HU: ["#ce2939", "#ffffff", "#477050"],
297
+ IE: ["#169b62", "#ffffff", "#ff883e"],
298
+ IL: ["#ffffff", "#0038b8", "#ffffff"],
299
+ IN: ["#ff9933", "#ffffff", "#138808"],
300
+ IS: ["#02529c", "#ffffff", "#dc1e35"],
301
+ IT: ["#009246", "#ffffff", "#ce2b37"],
302
+ JP: ["#ffffff", "#bc002d", "#ffffff"],
303
+ KR: ["#ffffff", "#cd2e3a", "#0047a0"],
304
+ LT: ["#fdb913", "#006a44", "#c1272d"],
305
+ LU: ["#ed2939", "#ffffff", "#00a1de"],
306
+ LV: ["#9e3039", "#ffffff", "#9e3039"],
307
+ MX: ["#006847", "#ffffff", "#ce1126"],
308
+ NL: ["#ae1c28", "#ffffff", "#21468b"],
309
+ NO: ["#ef2b2d", "#ffffff", "#002868"],
310
+ NZ: ["#012169", "#ffffff", "#cc142b"],
311
+ PL: ["#ffffff", "#dc143c"],
312
+ PT: ["#006600", "#ff0000"],
313
+ RO: ["#002b7f", "#fcd116", "#ce1126"],
314
+ RU: ["#ffffff", "#0039a6", "#d52b1e"],
315
+ SE: ["#006aa7", "#fecc00", "#006aa7"],
316
+ SK: ["#ffffff", "#0b4ea2", "#ee1c25"],
317
+ TR: ["#e30a17", "#ffffff", "#e30a17"],
318
+ UA: ["#005bbb", "#ffd500"],
319
+ US: ["#b22234", "#ffffff", "#3c3b6e"],
320
+ VN: ["#da251d", "#ffff00", "#da251d"],
321
+ ZA: ["#007a4d", "#ffffff", "#de3831"],
322
+ // ── Round 22 expansion: cover the full COUNTRIES catalogue ─────
323
+ AD: ["#10069f", "#fedf00", "#d50032"],
324
+ AE: ["#00732f", "#ffffff", "#000000"],
325
+ AF: ["#000000", "#d32011", "#007a36"],
326
+ AG: ["#ce1126", "#fcd116", "#000000"],
327
+ AL: ["#e41e20", "#000000", "#e41e20"],
328
+ AM: ["#d90012", "#0033a0", "#f2a800"],
329
+ AO: ["#ce1126", "#000000", "#ffc500"],
330
+ AZ: ["#0092bc", "#ed2939", "#509e2f"],
331
+ BA: ["#002395", "#fecb00", "#ffffff"],
332
+ BB: ["#00267f", "#ffc726", "#00267f"],
333
+ BD: ["#006a4e", "#f42a41", "#006a4e"],
334
+ BF: ["#ef2b2d", "#009e49", "#fcd116"],
335
+ BG: ["#ffffff", "#00966e", "#d62612"],
336
+ BH: ["#ffffff", "#ce1126", "#ce1126"],
337
+ BI: ["#1eb53a", "#ffffff", "#ce1126"],
338
+ BJ: ["#008751", "#fcd116", "#e8112d"],
339
+ BN: ["#f7e017", "#ffffff", "#000000"],
340
+ BO: ["#d52b1e", "#f9e300", "#007934"],
341
+ BS: ["#00778b", "#ffc72c", "#000000"],
342
+ BT: ["#ffcc33", "#ff4e12", "#ffcc33"],
343
+ BW: ["#75aadb", "#ffffff", "#000000"],
344
+ BY: ["#c8313e", "#007c30", "#ffffff"],
345
+ BZ: ["#003f87", "#ce1126", "#003f87"],
346
+ CD: ["#007fff", "#f7d618", "#ce1021"],
347
+ CF: ["#003082", "#ffffff", "#289728"],
348
+ CG: ["#009543", "#fbde4a", "#dc241f"],
349
+ CI: ["#f77f00", "#ffffff", "#009e60"],
350
+ CM: ["#007a5e", "#ce1126", "#fcd116"],
351
+ CO: ["#fcd116", "#003893", "#ce1126"],
352
+ CR: ["#002b7f", "#ffffff", "#ce1126"],
353
+ CU: ["#002590", "#ffffff", "#cf142b"],
354
+ CV: ["#003893", "#ffffff", "#cf2027"],
355
+ CY: ["#ffffff", "#d57800", "#ffffff"],
356
+ DJ: ["#6ab2e7", "#ffffff", "#12ad2b"],
357
+ DM: ["#006b3f", "#ffffff", "#000000"],
358
+ DO: ["#002d62", "#ffffff", "#ce1126"],
359
+ DZ: ["#006233", "#ffffff", "#d21034"],
360
+ EC: ["#ffd100", "#034ea2", "#ed1c24"],
361
+ ER: ["#ea0437", "#0084c9", "#418fde"],
362
+ ET: ["#078930", "#fcdd09", "#da121a"],
363
+ FJ: ["#68bfe5", "#cc0000", "#ffffff"],
364
+ GA: ["#3a75c4", "#ffe700", "#009e60"],
365
+ GD: ["#ce1126", "#fcd116", "#007a5e"],
366
+ GE: ["#ffffff", "#ff0000", "#ffffff"],
367
+ GH: ["#ce1126", "#fcd116", "#006b3f"],
368
+ GM: ["#ce1126", "#ffffff", "#0c1c8c"],
369
+ GN: ["#ce1126", "#fcd116", "#009460"],
370
+ GQ: ["#3e9a00", "#ffffff", "#e32118"],
371
+ GT: ["#4997d0", "#ffffff", "#4997d0"],
372
+ GW: ["#ce1126", "#fcd116", "#009e49"],
373
+ GY: ["#009e49", "#ffffff", "#fcd116"],
374
+ HK: ["#de2910", "#ffffff", "#de2910"],
375
+ HN: ["#0073cf", "#ffffff", "#0073cf"],
376
+ HT: ["#00209f", "#d21034", "#00209f"],
377
+ ID: ["#ff0000", "#ffffff", "#ff0000"],
378
+ IQ: ["#ce1126", "#ffffff", "#000000"],
379
+ IR: ["#239f40", "#ffffff", "#da0000"],
380
+ JM: ["#000000", "#fed100", "#009b3a"],
381
+ JO: ["#000000", "#ffffff", "#007a3d"],
382
+ KE: ["#000000", "#bb0000", "#006600"],
383
+ KG: ["#ff0000", "#fcd116", "#ff0000"],
384
+ KH: ["#032ea1", "#e00025", "#032ea1"],
385
+ KM: ["#fcd116", "#ffffff", "#ce1126"],
386
+ KP: ["#024fa2", "#ed1c27", "#024fa2"],
387
+ KW: ["#007a3d", "#ffffff", "#ce1126"],
388
+ KZ: ["#00afca", "#fec50c", "#00afca"],
389
+ LA: ["#ce1126", "#002868", "#ce1126"],
390
+ LB: ["#ed1c24", "#ffffff", "#ed1c24"],
391
+ LI: ["#002780", "#ce1126", "#002780"],
392
+ LK: ["#ffbe29", "#8d153a", "#00534e"],
393
+ LR: ["#bf0a30", "#ffffff", "#002868"],
394
+ LS: ["#00209f", "#ffffff", "#009543"],
395
+ LY: ["#e70013", "#000000", "#239e46"],
396
+ MA: ["#c1272d", "#006233", "#c1272d"],
397
+ MD: ["#0046ae", "#ffd200", "#cc092f"],
398
+ ME: ["#d4af37", "#cc0033", "#d4af37"],
399
+ MG: ["#ffffff", "#fc3d32", "#007e3a"],
400
+ MH: ["#003893", "#dd7500", "#ffffff"],
401
+ MK: ["#d20000", "#ffe600", "#d20000"],
402
+ ML: ["#14b53a", "#fcd116", "#ce1126"],
403
+ MM: ["#fecb00", "#34b233", "#ea2839"],
404
+ MN: ["#c4272f", "#015197", "#c4272f"],
405
+ MO: ["#00785a", "#ffd700", "#ffffff"],
406
+ MR: ["#006233", "#ffc400", "#d01c1f"],
407
+ MT: ["#ffffff", "#cf142b", "#ffffff"],
408
+ MU: ["#ea2839", "#1a206d", "#00a04d"],
409
+ MV: ["#d21034", "#007e3a", "#ffffff"],
410
+ MW: ["#000000", "#ce1126", "#339e35"],
411
+ MY: ["#cc0000", "#ffffff", "#010066"],
412
+ MZ: ["#009a44", "#ffffff", "#000000"],
413
+ NA: ["#003580", "#ffffff", "#009543"],
414
+ NE: ["#ff8000", "#ffffff", "#0db02b"],
415
+ NG: ["#008753", "#ffffff", "#008753"],
416
+ NI: ["#0067c6", "#ffffff", "#0067c6"],
417
+ NP: ["#dc143c", "#003893", "#dc143c"],
418
+ OM: ["#dc241f", "#ffffff", "#008000"],
419
+ PA: ["#ffffff", "#cc0033", "#005aa7"],
420
+ PE: ["#d91023", "#ffffff", "#d91023"],
421
+ PG: ["#ce1126", "#000000", "#fcd116"],
422
+ PH: ["#0038a8", "#ffffff", "#ce1126"],
423
+ PK: ["#ffffff", "#01411c", "#01411c"],
424
+ PS: ["#000000", "#ffffff", "#007a3d"],
425
+ PY: ["#d52b1e", "#ffffff", "#0038a8"],
426
+ QA: ["#ffffff", "#8a1538", "#8a1538"],
427
+ RS: ["#c6363c", "#0c4076", "#ffffff"],
428
+ RW: ["#00a1de", "#fad201", "#00a651"],
429
+ SA: ["#006c35", "#ffffff", "#006c35"],
430
+ SB: ["#0051ba", "#fcd116", "#215b33"],
431
+ SC: ["#003f87", "#fcd116", "#d62828"],
432
+ SD: ["#d21034", "#ffffff", "#000000"],
433
+ SG: ["#ed2939", "#ffffff", "#ed2939"],
434
+ SI: ["#ffffff", "#0000ff", "#ff0000"],
435
+ SL: ["#1eb53a", "#ffffff", "#0072c6"],
436
+ SM: ["#ffffff", "#5eb6e4", "#ffffff"],
437
+ SN: ["#00853f", "#fdef42", "#e31b23"],
438
+ SO: ["#4189dd", "#ffffff", "#4189dd"],
439
+ SR: ["#377e3f", "#ffffff", "#b40a2d"],
440
+ SS: ["#000000", "#ce1126", "#078930"],
441
+ ST: ["#12ad2b", "#ffce00", "#d21034"],
442
+ SV: ["#0047ab", "#ffffff", "#0047ab"],
443
+ SY: ["#ce1126", "#ffffff", "#000000"],
444
+ SZ: ["#3e5eb9", "#ffd900", "#b10c0c"],
445
+ TD: ["#002664", "#fecb00", "#c60c30"],
446
+ TG: ["#006a4e", "#fcd116", "#d21034"],
447
+ TH: ["#ed1c24", "#ffffff", "#241d4f"],
448
+ TJ: ["#cc0000", "#ffffff", "#006600"],
449
+ TL: ["#dc241f", "#ffc726", "#000000"],
450
+ TM: ["#00853e", "#ffffff", "#cc0000"],
451
+ TN: ["#e70013", "#ffffff", "#e70013"],
452
+ TO: ["#ffffff", "#c10000", "#c10000"],
453
+ TT: ["#ce1126", "#ffffff", "#000000"],
454
+ TW: ["#fe0000", "#000095", "#fe0000"],
455
+ TZ: ["#1eb53a", "#fcd116", "#00a3dd"],
456
+ UG: ["#000000", "#fcdc04", "#d90000"],
457
+ UY: ["#ffffff", "#0038a8", "#ffffff"],
458
+ UZ: ["#1eb53a", "#ffffff", "#0099b5"],
459
+ VA: ["#ffe000", "#ffffff", "#ffe000"],
460
+ VE: ["#fcd116", "#00247d", "#cf142b"],
461
+ VU: ["#000000", "#ce1126", "#009543"],
462
+ WS: ["#002b7f", "#ffffff", "#cc0033"],
463
+ YE: ["#ce1126", "#ffffff", "#000000"],
464
+ ZM: ["#198a00", "#de2010", "#ef7d00"],
465
+ ZW: ["#078930", "#fcd116", "#cf2027"]
466
+ }), K = ["#cbd5e1", "#94a3b8", "#cbd5e1"];
467
+ function df(f) {
468
+ return f ? af[f.toUpperCase()] ?? K : K;
469
+ }
470
+ const sf = cf, vf = ({
471
+ code: f,
472
+ size: i = 22,
473
+ className: s
474
+ }) => {
475
+ const { t: l } = E(), d = f?.toUpperCase(), n = d ? sf[d] : void 0, t = i, r = Math.round(i * 2 / 3);
476
+ return n ? /* @__PURE__ */ c(
477
+ "span",
478
+ {
479
+ className: s,
480
+ role: "img",
481
+ "aria-label": l("pickerCommons.flag", "{upper} flag").replace("{upper}", String(d)),
482
+ style: {
483
+ display: "inline-block",
484
+ width: t,
485
+ height: r,
486
+ boxSizing: "content-box",
487
+ border: "1px solid var(--nice-overlay-15, rgba(0, 0, 0, 0.15))",
488
+ borderRadius: 2,
489
+ overflow: "hidden",
490
+ flexShrink: 0,
491
+ verticalAlign: "middle",
492
+ lineHeight: 0
493
+ },
494
+ dangerouslySetInnerHTML: {
495
+ __html: n.replace(
496
+ "<svg ",
497
+ `<svg width="${t}" height="${r}" preserveAspectRatio="xMidYMid slice" `
498
+ )
499
+ }
500
+ }
501
+ ) : /* @__PURE__ */ c(rf, { code: f, size: i, className: s });
502
+ }, rf = ({
503
+ code: f,
504
+ size: i = 18,
505
+ className: s
506
+ }) => {
507
+ const { t: l } = E(), d = df(f);
508
+ return /* @__PURE__ */ c(
509
+ "span",
510
+ {
511
+ className: s,
512
+ role: "img",
513
+ "aria-label": l("pickerCommons.flag2", "{code} flag").replace("{code}", String(f)),
514
+ style: {
515
+ display: "inline-flex",
516
+ width: i,
517
+ height: Math.round(i * 0.7),
518
+ boxSizing: "content-box",
519
+ border: "1px solid var(--nice-overlay-15, rgba(0, 0, 0, 0.15))",
520
+ borderRadius: 2,
521
+ overflow: "hidden",
522
+ flexShrink: 0,
523
+ verticalAlign: "middle"
524
+ },
525
+ children: d.map((n, t) => /* @__PURE__ */ c("span", { style: { flex: 1, background: n } }, t))
526
+ }
527
+ );
528
+ };
529
+ function Mf(f, i, s, l = 280) {
530
+ const [d, n] = B(s === "left" ? "left" : "right"), t = D(() => {
531
+ if (s !== "auto") {
532
+ n(s);
533
+ return;
534
+ }
535
+ const r = i.current;
536
+ if (!r || typeof window > "u")
537
+ return;
538
+ const o = r.getBoundingClientRect(), h = window.innerWidth - o.left, v = o.right;
539
+ h >= l && h > v ? n("left") : n("right");
540
+ }, [s, i, l]);
541
+ return O(() => {
542
+ if (f)
543
+ return t(), window.addEventListener("resize", t), window.addEventListener("scroll", t, !0), () => {
544
+ window.removeEventListener("resize", t), window.removeEventListener("scroll", t, !0);
545
+ };
546
+ }, [f, t]), d;
547
+ }
548
+ const _f = ({ colors: f, size: i = 28, shape: s = "page", className: l }) => {
549
+ const { t: d } = E(), n = i, t = Math.round(i * 0.75), r = f.border ?? "color-mix(in srgb, currentColor 30%, transparent)";
550
+ if (s === "swatch") {
551
+ const b = [
552
+ f.primary,
553
+ f.background,
554
+ f.backgroundSecondary ?? f.background,
555
+ f.textColor
556
+ ];
557
+ return /* @__PURE__ */ c(
558
+ "span",
559
+ {
560
+ className: l,
561
+ role: "img",
562
+ "aria-label": d("pickerCommons.themePreview", "Theme preview"),
563
+ style: {
564
+ display: "inline-flex",
565
+ width: n,
566
+ height: t,
567
+ border: `1px solid ${r}`,
568
+ borderRadius: 2,
569
+ overflow: "hidden",
570
+ flexShrink: 0,
571
+ verticalAlign: "middle"
572
+ },
573
+ children: b.map((u, m) => /* @__PURE__ */ c("span", { style: { flex: 1, background: u } }, m))
574
+ }
575
+ );
576
+ }
577
+ const o = Math.max(2, Math.round(t * 0.17)), p = Math.max(2, Math.round(n * 0.14)), h = n - p * 2, v = Math.max(2, Math.round(h * 0.16)), e = Math.max(1, Math.round(t * 0.07)), g = t - o;
578
+ return /* @__PURE__ */ x(
579
+ "span",
580
+ {
581
+ className: l,
582
+ role: "img",
583
+ "aria-label": d("pickerCommons.themePreview", "Theme preview"),
584
+ style: {
585
+ position: "relative",
586
+ display: "inline-block",
587
+ width: n,
588
+ height: t,
589
+ boxSizing: "content-box",
590
+ background: f.backgroundSecondary ?? f.background,
591
+ border: `1px solid ${r}`,
592
+ borderRadius: 2,
593
+ overflow: "hidden",
594
+ flexShrink: 0,
595
+ verticalAlign: "middle"
596
+ },
597
+ children: [
598
+ /* @__PURE__ */ c(
599
+ "span",
600
+ {
601
+ style: {
602
+ position: "absolute",
603
+ top: 0,
604
+ left: 0,
605
+ right: 0,
606
+ height: o,
607
+ background: f.primary
608
+ }
609
+ }
610
+ ),
611
+ /* @__PURE__ */ c(
612
+ "span",
613
+ {
614
+ style: {
615
+ position: "absolute",
616
+ top: o,
617
+ bottom: 0,
618
+ left: p,
619
+ right: p,
620
+ background: f.background,
621
+ borderLeft: `1px solid ${r}`,
622
+ borderRight: `1px solid ${r}`
623
+ }
624
+ }
625
+ ),
626
+ /* @__PURE__ */ c(
627
+ "span",
628
+ {
629
+ style: {
630
+ position: "absolute",
631
+ top: o + Math.round(g * 0.28),
632
+ left: p + v,
633
+ right: p + v,
634
+ height: e,
635
+ background: f.textColor
636
+ }
637
+ }
638
+ ),
639
+ /* @__PURE__ */ c(
640
+ "span",
641
+ {
642
+ style: {
643
+ position: "absolute",
644
+ top: o + Math.round(g * 0.55),
645
+ left: p + v,
646
+ width: Math.max(3, Math.round((h - v * 2) * 0.6)),
647
+ height: e,
648
+ background: f.textColor
649
+ }
650
+ }
651
+ )
652
+ ]
653
+ }
654
+ );
655
+ };
656
+ export {
657
+ vf as F,
658
+ mf as N,
659
+ _f as T,
660
+ pf as a,
661
+ Mf as b,
662
+ gf as u
663
+ };