rich-react-component 0.1.0 → 0.3.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.
package/dist/index.js CHANGED
@@ -1,234 +1,234 @@
1
- import { jsxs as p, jsx as a, Fragment as X } from "react/jsx-runtime";
2
- import { useRef as M, useState as T, useCallback as R, useId as P, useEffect as B, createContext as ce, useMemo as W, useContext as de } from "react";
3
- function f(...e) {
1
+ import { jsxs as y, jsx as o, Fragment as Q } from "react/jsx-runtime";
2
+ import { useRef as L, useState as M, useCallback as F, useId as W, useEffect as U, createContext as Ve, useMemo as J, useContext as we, useLayoutEffect as _r } from "react";
3
+ function h(...e) {
4
4
  return e.filter(Boolean).join(" ");
5
5
  }
6
- function ke({ htmlFor: e, required: n, className: t, children: r }) {
7
- return /* @__PURE__ */ p("label", { htmlFor: e, className: f("form-label", t), children: [
8
- r,
9
- n && /* @__PURE__ */ a("span", { className: "text-danger", children: " *" })
6
+ function xr({ htmlFor: e, required: r, className: n, children: t }) {
7
+ return /* @__PURE__ */ y("label", { htmlFor: e, className: h("form-label", "rrc-label", n), children: [
8
+ t,
9
+ r && /* @__PURE__ */ o("span", { className: "text-danger", children: " *" })
10
10
  ] });
11
11
  }
12
- function ue({ error: e, helpText: n, className: t }) {
13
- return e ? /* @__PURE__ */ a("div", { className: f("invalid-feedback d-block", t), children: e }) : n ? /* @__PURE__ */ a("div", { className: f("form-text", t), children: n }) : null;
12
+ function er({ error: e, helpText: r, className: n }) {
13
+ return e ? /* @__PURE__ */ o("div", { className: h("invalid-feedback d-block", "rrc-field__error", n), children: e }) : r ? /* @__PURE__ */ o("div", { className: h("form-text", "rrc-field__help", n), children: r }) : null;
14
14
  }
15
- function K({ id: e, label: n, required: t, error: r, helpText: l, className: s, children: c }) {
16
- return /* @__PURE__ */ p("div", { className: f("mb-3", s), children: [
17
- n && /* @__PURE__ */ a(ke, { htmlFor: e, required: t, children: n }),
18
- c,
19
- /* @__PURE__ */ a(ue, { error: r, helpText: l })
15
+ function Y({ id: e, label: r, required: n, error: t, helpText: a, className: i, children: l }) {
16
+ return /* @__PURE__ */ y("div", { className: h("mb-3", "rrc-field", i), children: [
17
+ r && /* @__PURE__ */ o(xr, { htmlFor: e, required: n, children: r }),
18
+ l,
19
+ /* @__PURE__ */ o(er, { error: t, helpText: a })
20
20
  ] });
21
21
  }
22
- function V({
22
+ function T({
23
23
  value: e,
24
- defaultValue: n,
25
- onChange: t
24
+ defaultValue: r,
25
+ onChange: n
26
26
  }) {
27
- const r = e !== void 0, l = M(r);
28
- process.env.NODE_ENV !== "production" && l.current !== r && console.error(
27
+ const t = e !== void 0, a = L(t);
28
+ process.env.NODE_ENV !== "production" && a.current !== t && console.error(
29
29
  "[react-components] A component switched between controlled and uncontrolled `value`. Decide between passing `value` (controlled) or `defaultValue` (uncontrolled) for the lifetime of the component, per the library's controlled/uncontrolled policy."
30
30
  );
31
- const [s, c] = T(n), o = r ? e : s, i = R(
31
+ const [i, l] = M(r), c = t ? e : i, s = F(
32
32
  (d) => {
33
- r || c(d), t == null || t(d);
33
+ t || l(d), n == null || n(d);
34
34
  },
35
- [r, t]
35
+ [t, n]
36
36
  );
37
- return [o, i];
37
+ return [c, s];
38
38
  }
39
- function Y(e) {
39
+ function de(e) {
40
40
  const {
41
- id: n,
42
- name: t,
43
- disabled: r,
44
- readOnly: l,
45
- required: s,
46
- className: c,
47
- label: o,
48
- placeholder: i,
41
+ id: r,
42
+ name: n,
43
+ disabled: t,
44
+ readOnly: a,
45
+ required: i,
46
+ className: l,
47
+ label: c,
48
+ placeholder: s,
49
49
  helpText: d,
50
50
  error: u,
51
- value: h,
51
+ value: f,
52
52
  defaultValue: m,
53
- onChange: b,
54
- onBlur: v,
55
- type: x = "text",
56
- maxLength: N,
57
- autoFocus: g,
58
- inputProps: w,
59
- endAdornment: y
60
- } = e, [S, k] = V({
61
- value: h,
53
+ onChange: p,
54
+ onBlur: k,
55
+ type: S = "text",
56
+ maxLength: x,
57
+ autoFocus: _,
58
+ inputProps: C,
59
+ endAdornment: v
60
+ } = e, [N, b] = T({
61
+ value: f,
62
62
  defaultValue: m ?? "",
63
- onChange: b
64
- }), C = P(), D = n ?? C, $ = /* @__PURE__ */ a(
63
+ onChange: p
64
+ }), w = W(), g = r ?? w, I = /* @__PURE__ */ o(
65
65
  "input",
66
66
  {
67
- id: D,
68
- name: t,
69
- className: f("form-control", u && "is-invalid"),
70
- disabled: r,
71
- readOnly: l,
72
- required: s,
73
- placeholder: i,
74
- maxLength: N,
75
- autoFocus: g,
76
- value: S,
77
- onChange: (L) => k(L.target.value),
78
- onBlur: v,
79
- type: x,
80
- ...w
67
+ id: g,
68
+ name: n,
69
+ className: h("form-control", "rrc-input", u && "is-invalid"),
70
+ disabled: t,
71
+ readOnly: a,
72
+ required: i,
73
+ placeholder: s,
74
+ maxLength: x,
75
+ autoFocus: _,
76
+ value: N,
77
+ onChange: (D) => b(D.target.value),
78
+ onBlur: k,
79
+ type: S,
80
+ ...C
81
81
  }
82
82
  );
83
- return /* @__PURE__ */ a(K, { id: D, label: o, required: s, error: u, helpText: d, className: c, children: y ? /* @__PURE__ */ p("div", { className: "input-group", children: [
84
- $,
85
- y
86
- ] }) : $ });
83
+ return /* @__PURE__ */ o(Y, { id: g, label: c, required: i, error: u, helpText: d, className: l, children: v ? /* @__PURE__ */ y("div", { className: "input-group rrc-input-group", children: [
84
+ I,
85
+ v
86
+ ] }) : I });
87
87
  }
88
- function bn(e) {
88
+ function nt(e) {
89
89
  const {
90
- id: n,
91
- name: t,
92
- disabled: r,
93
- readOnly: l,
94
- required: s,
95
- className: c,
96
- label: o,
97
- placeholder: i,
90
+ id: r,
91
+ name: n,
92
+ disabled: t,
93
+ readOnly: a,
94
+ required: i,
95
+ className: l,
96
+ label: c,
97
+ placeholder: s,
98
98
  helpText: d,
99
99
  error: u,
100
- value: h,
100
+ value: f,
101
101
  defaultValue: m,
102
- onChange: b,
103
- onBlur: v,
104
- rows: x = 3,
105
- maxLength: N
106
- } = e, [g, w] = V({
107
- value: h,
102
+ onChange: p,
103
+ onBlur: k,
104
+ rows: S = 3,
105
+ maxLength: x
106
+ } = e, [_, C] = T({
107
+ value: f,
108
108
  defaultValue: m ?? "",
109
- onChange: b
110
- }), y = P(), S = n ?? y;
111
- return /* @__PURE__ */ a(K, { id: S, label: o, required: s, error: u, helpText: d, className: c, children: /* @__PURE__ */ a(
109
+ onChange: p
110
+ }), v = W(), N = r ?? v;
111
+ return /* @__PURE__ */ o(Y, { id: N, label: c, required: i, error: u, helpText: d, className: l, children: /* @__PURE__ */ o(
112
112
  "textarea",
113
113
  {
114
- id: S,
115
- name: t,
116
- className: f("form-control", u && "is-invalid"),
117
- disabled: r,
118
- readOnly: l,
119
- required: s,
120
- placeholder: i,
121
- rows: x,
122
- maxLength: N,
123
- value: g,
124
- onChange: (k) => w(k.target.value),
125
- onBlur: v
114
+ id: N,
115
+ name: n,
116
+ className: h("form-control", "rrc-input", u && "is-invalid"),
117
+ disabled: t,
118
+ readOnly: a,
119
+ required: i,
120
+ placeholder: s,
121
+ rows: S,
122
+ maxLength: x,
123
+ value: _,
124
+ onChange: (b) => C(b.target.value),
125
+ onBlur: k
126
126
  }
127
127
  ) });
128
128
  }
129
- function vn({ value: e, defaultValue: n, onChange: t, min: r, max: l, step: s, ...c }) {
130
- const [o, i] = V({
129
+ function tt({ value: e, defaultValue: r, onChange: n, min: t, max: a, step: i, ...l }) {
130
+ const [c, s] = T({
131
131
  value: e,
132
- defaultValue: n ?? null,
133
- onChange: t
132
+ defaultValue: r ?? null,
133
+ onChange: n
134
134
  });
135
- return /* @__PURE__ */ a(
136
- Y,
135
+ return /* @__PURE__ */ o(
136
+ de,
137
137
  {
138
- ...c,
139
- value: o === null ? "" : String(o),
138
+ ...l,
139
+ value: c === null ? "" : String(c),
140
140
  onChange: (d) => {
141
141
  if (d.trim() === "") {
142
- i(null);
142
+ s(null);
143
143
  return;
144
144
  }
145
145
  const u = Number(d);
146
- Number.isNaN(u) || i(u);
146
+ Number.isNaN(u) || s(u);
147
147
  },
148
- inputProps: { inputMode: "decimal", min: r, max: l, step: s }
148
+ inputProps: { inputMode: "decimal", min: t, max: a, step: i }
149
149
  }
150
150
  );
151
151
  }
152
- function pn(e) {
153
- const [n, t] = T(!1);
154
- return /* @__PURE__ */ a(
155
- Y,
152
+ function at(e) {
153
+ const [r, n] = M(!1);
154
+ return /* @__PURE__ */ o(
155
+ de,
156
156
  {
157
157
  ...e,
158
- inputProps: { type: n ? "text" : "password", autoComplete: "current-password" },
159
- endAdornment: /* @__PURE__ */ a(
158
+ inputProps: { type: r ? "text" : "password", autoComplete: "current-password" },
159
+ endAdornment: /* @__PURE__ */ o(
160
160
  "button",
161
161
  {
162
162
  type: "button",
163
- className: "btn btn-outline-secondary",
164
- "aria-label": n ? "Hide password" : "Show password",
165
- "aria-pressed": n,
166
- onClick: () => t((r) => !r),
167
- children: n ? "Hide" : "Show"
163
+ className: "btn btn-outline-secondary rrc-btn rrc-input-group__action",
164
+ "aria-label": r ? "Hide password" : "Show password",
165
+ "aria-pressed": r,
166
+ onClick: () => n((t) => !t),
167
+ children: r ? "Hide" : "Show"
168
168
  }
169
169
  )
170
170
  }
171
171
  );
172
172
  }
173
- function gn({ id: e, name: n, disabled: t, required: r, className: l, label: s, helpText: c, error: o, accept: i, multiple: d, onChange: u }) {
174
- const h = P(), m = e ?? h;
175
- return /* @__PURE__ */ a(K, { id: m, label: s, required: r, error: o, helpText: c, className: l, children: /* @__PURE__ */ a(
173
+ function ot({ id: e, name: r, disabled: n, required: t, className: a, label: i, helpText: l, error: c, accept: s, multiple: d, onChange: u }) {
174
+ const f = W(), m = e ?? f;
175
+ return /* @__PURE__ */ o(Y, { id: m, label: i, required: t, error: c, helpText: l, className: a, children: /* @__PURE__ */ o(
176
176
  "input",
177
177
  {
178
178
  id: m,
179
- name: n,
179
+ name: r,
180
180
  type: "file",
181
- className: f("form-control", o && "is-invalid"),
182
- disabled: t,
183
- required: r,
184
- accept: i,
181
+ className: h("form-control", "rrc-input", c && "is-invalid"),
182
+ disabled: n,
183
+ required: t,
184
+ accept: s,
185
185
  multiple: d,
186
- onChange: (b) => u == null ? void 0 : u(b.target.files)
186
+ onChange: (p) => u == null ? void 0 : u(p.target.files)
187
187
  }
188
188
  ) });
189
189
  }
190
- function fe({
190
+ function rr({
191
191
  id: e,
192
- name: n,
193
- disabled: t,
194
- required: r,
195
- wrapperClassName: l,
196
- role: s,
197
- label: c,
198
- helpText: o,
199
- error: i,
192
+ name: r,
193
+ disabled: n,
194
+ required: t,
195
+ wrapperClassName: a,
196
+ role: i,
197
+ label: l,
198
+ helpText: c,
199
+ error: s,
200
200
  checked: d,
201
201
  onChange: u,
202
- className: h
202
+ className: f
203
203
  }) {
204
- const m = P(), b = e ?? m;
205
- return /* @__PURE__ */ p("div", { className: f(l, h), children: [
206
- /* @__PURE__ */ a(
204
+ const m = W(), p = e ?? m;
205
+ return /* @__PURE__ */ y("div", { className: h(a, f), children: [
206
+ /* @__PURE__ */ o(
207
207
  "input",
208
208
  {
209
- id: b,
210
- name: n,
209
+ id: p,
210
+ name: r,
211
211
  type: "checkbox",
212
- role: s,
213
- className: f("form-check-input", i && "is-invalid"),
214
- disabled: t,
215
- required: r,
212
+ role: i,
213
+ className: h("form-check-input", "rrc-check", s && "is-invalid"),
214
+ disabled: n,
215
+ required: t,
216
216
  checked: d,
217
- onChange: (v) => u(v.target.checked)
217
+ onChange: (k) => u(k.target.checked)
218
218
  }
219
219
  ),
220
- c && /* @__PURE__ */ a("label", { htmlFor: b, className: "form-check-label", children: c }),
221
- /* @__PURE__ */ a(ue, { error: i, helpText: o })
220
+ l && /* @__PURE__ */ o("label", { htmlFor: p, className: "form-check-label rrc-check__label", children: l }),
221
+ /* @__PURE__ */ o(er, { error: s, helpText: c })
222
222
  ] });
223
223
  }
224
- function yn(e) {
225
- const [n, t] = V({
224
+ function it(e) {
225
+ const [r, n] = T({
226
226
  value: e.checked,
227
227
  defaultValue: e.defaultChecked ?? !1,
228
228
  onChange: e.onChange
229
229
  });
230
- return /* @__PURE__ */ a(
231
- fe,
230
+ return /* @__PURE__ */ o(
231
+ rr,
232
232
  {
233
233
  id: e.id,
234
234
  name: e.name,
@@ -239,19 +239,19 @@ function yn(e) {
239
239
  label: e.label,
240
240
  helpText: e.helpText,
241
241
  error: e.error,
242
- checked: n,
243
- onChange: t
242
+ checked: r,
243
+ onChange: n
244
244
  }
245
245
  );
246
246
  }
247
- function Nn(e) {
248
- const [n, t] = V({
247
+ function lt(e) {
248
+ const [r, n] = T({
249
249
  value: e.checked,
250
250
  defaultValue: e.defaultChecked ?? !1,
251
251
  onChange: e.onChange
252
252
  });
253
- return /* @__PURE__ */ a(
254
- fe,
253
+ return /* @__PURE__ */ o(
254
+ rr,
255
255
  {
256
256
  id: e.id,
257
257
  name: e.name,
@@ -263,1015 +263,1228 @@ function Nn(e) {
263
263
  label: e.label,
264
264
  helpText: e.helpText,
265
265
  error: e.error,
266
- checked: n,
267
- onChange: t
266
+ checked: r,
267
+ onChange: n
268
268
  }
269
269
  );
270
270
  }
271
- function Se({
271
+ function Sr({
272
272
  id: e,
273
- name: n,
274
- value: t,
275
- label: r,
276
- checked: l,
277
- disabled: s,
278
- className: c,
279
- onChange: o
273
+ name: r,
274
+ value: n,
275
+ label: t,
276
+ checked: a,
277
+ disabled: i,
278
+ className: l,
279
+ onChange: c
280
280
  }) {
281
- const i = P(), d = e ?? i;
282
- return /* @__PURE__ */ p("div", { className: f("form-check", c), children: [
283
- /* @__PURE__ */ a(
281
+ const s = W(), d = e ?? s;
282
+ return /* @__PURE__ */ y("div", { className: h("form-check", "rrc-check-row", l), children: [
283
+ /* @__PURE__ */ o(
284
284
  "input",
285
285
  {
286
286
  id: d,
287
- name: n,
287
+ name: r,
288
288
  type: "radio",
289
- className: "form-check-input",
290
- value: String(t),
291
- checked: l,
292
- disabled: s,
293
- onChange: () => o == null ? void 0 : o(t)
289
+ className: "form-check-input rrc-check",
290
+ value: String(n),
291
+ checked: a,
292
+ disabled: i,
293
+ onChange: () => c == null ? void 0 : c(n)
294
294
  }
295
295
  ),
296
- r && /* @__PURE__ */ a("label", { htmlFor: d, className: "form-check-label", children: r })
296
+ t && /* @__PURE__ */ o("label", { htmlFor: d, className: "form-check-label rrc-check__label", children: t })
297
297
  ] });
298
298
  }
299
- function wn({
299
+ function st({
300
300
  options: e,
301
- value: n,
302
- defaultValue: t,
303
- onChange: r,
304
- inline: l,
305
- id: s,
306
- name: c,
307
- disabled: o,
308
- required: i,
301
+ value: r,
302
+ defaultValue: n,
303
+ onChange: t,
304
+ inline: a,
305
+ id: i,
306
+ name: l,
307
+ disabled: c,
308
+ required: s,
309
309
  className: d,
310
310
  label: u,
311
- helpText: h,
311
+ helpText: f,
312
312
  error: m
313
313
  }) {
314
- const [b, v] = V({
315
- value: n,
316
- defaultValue: t ?? null,
317
- onChange: (g) => {
318
- g !== null && (r == null || r(g));
314
+ const [p, k] = T({
315
+ value: r,
316
+ defaultValue: n ?? null,
317
+ onChange: (_) => {
318
+ _ !== null && (t == null || t(_));
319
319
  }
320
- }), x = P(), N = c ?? s ?? x;
321
- return /* @__PURE__ */ a(K, { label: u, required: i, error: m, helpText: h, className: d, children: /* @__PURE__ */ a("div", { role: "radiogroup", "aria-label": u, "aria-required": i, className: f(l && "d-flex gap-3"), children: e.map((g) => /* @__PURE__ */ a(
322
- Se,
320
+ }), S = W(), x = l ?? i ?? S;
321
+ return /* @__PURE__ */ o(Y, { label: u, required: s, error: m, helpText: f, className: d, children: /* @__PURE__ */ o("div", { role: "radiogroup", "aria-label": u, "aria-required": s, className: h("rrc-radio-group", a && "d-flex gap-3 rrc-radio-group--inline"), children: e.map((_) => /* @__PURE__ */ o(
322
+ Sr,
323
323
  {
324
- name: N,
325
- value: g.value,
326
- label: g.label,
327
- checked: g.value === b,
328
- disabled: o || g.disabled,
329
- onChange: (w) => v(w)
324
+ name: x,
325
+ value: _.value,
326
+ label: _.label,
327
+ checked: _.value === p,
328
+ disabled: c || _.disabled,
329
+ onChange: (C) => k(C)
330
330
  },
331
- String(g.value)
331
+ String(_.value)
332
332
  )) }) });
333
333
  }
334
- function Ce({
334
+ function Cr({
335
335
  options: e,
336
- value: n,
337
- defaultValue: t,
338
- onChange: r,
339
- placeholder: l,
340
- loading: s,
341
- id: c,
342
- name: o,
343
- disabled: i,
336
+ value: r,
337
+ defaultValue: n,
338
+ onChange: t,
339
+ placeholder: a,
340
+ loading: i,
341
+ id: l,
342
+ name: c,
343
+ disabled: s,
344
344
  readOnly: d,
345
345
  required: u,
346
- className: h,
346
+ className: f,
347
347
  label: m,
348
- helpText: b,
349
- error: v
348
+ helpText: p,
349
+ error: k
350
350
  }) {
351
- const [x, N] = V({
352
- value: n,
353
- defaultValue: t ?? null,
354
- onChange: r
355
- }), g = P(), w = c ?? g;
356
- return /* @__PURE__ */ a(K, { id: w, label: m, required: u, error: v, helpText: b, className: h, children: /* @__PURE__ */ p(
351
+ const [S, x] = T({
352
+ value: r,
353
+ defaultValue: n ?? null,
354
+ onChange: t
355
+ }), _ = W(), C = l ?? _;
356
+ return /* @__PURE__ */ o(Y, { id: C, label: m, required: u, error: k, helpText: p, className: f, children: /* @__PURE__ */ y(
357
357
  "select",
358
358
  {
359
- id: w,
360
- name: o,
361
- className: f("form-select", v && "is-invalid"),
362
- disabled: i || d || s,
359
+ id: C,
360
+ name: c,
361
+ className: h("form-select", "rrc-select", k && "is-invalid"),
362
+ disabled: s || d || i,
363
363
  required: u,
364
- value: x === null ? "" : String(x),
365
- onChange: (y) => {
366
- const S = y.target.value;
367
- if (S === "") {
368
- N(null);
364
+ value: S === null ? "" : String(S),
365
+ onChange: (v) => {
366
+ const N = v.target.value;
367
+ if (N === "") {
368
+ x(null);
369
369
  return;
370
370
  }
371
- const k = e.find((C) => String(C.value) === S);
372
- N(k ? k.value : null);
371
+ const b = e.find((w) => String(w.value) === N);
372
+ x(b ? b.value : null);
373
373
  },
374
374
  children: [
375
- s && /* @__PURE__ */ a("option", { value: "", children: "Loading…" }),
376
- !s && l && /* @__PURE__ */ a("option", { value: "", children: l }),
377
- e.map((y) => /* @__PURE__ */ a("option", { value: String(y.value), disabled: y.disabled, children: y.label }, String(y.value)))
375
+ i && /* @__PURE__ */ o("option", { value: "", children: "Loading…" }),
376
+ !i && a && /* @__PURE__ */ o("option", { value: "", children: a }),
377
+ e.map((v) => /* @__PURE__ */ o("option", { value: String(v.value), disabled: v.disabled, children: v.label }, String(v.value)))
378
378
  ]
379
379
  }
380
380
  ) });
381
381
  }
382
- function le(e, n) {
383
- B(() => {
382
+ function _e(e, r) {
383
+ U(() => {
384
384
  if (!e)
385
385
  return;
386
- function t(r) {
387
- r.key === "Escape" && n();
386
+ function n(t) {
387
+ t.key === "Escape" && r();
388
388
  }
389
- return document.addEventListener("keydown", t), () => document.removeEventListener("keydown", t);
390
- }, [e, n]);
389
+ return document.addEventListener("keydown", n), () => document.removeEventListener("keydown", n);
390
+ }, [e, r]);
391
391
  }
392
- function G({ open: e, onClose: n, anchorRef: t, className: r, role: l, children: s }) {
393
- const c = M(null);
394
- return le(e, n), B(() => {
392
+ function oe({ open: e, onClose: r, anchorRef: n, className: t, role: a, children: i }) {
393
+ const l = L(null);
394
+ return _e(e, r), U(() => {
395
395
  if (!e)
396
396
  return;
397
- function o(i) {
398
- var u, h;
399
- const d = i.target;
400
- (u = c.current) != null && u.contains(d) || (h = t.current) != null && h.contains(d) || n();
397
+ function c(s) {
398
+ var u, f;
399
+ const d = s.target;
400
+ (u = l.current) != null && u.contains(d) || (f = n.current) != null && f.contains(d) || r();
401
401
  }
402
- return document.addEventListener("mousedown", o), () => document.removeEventListener("mousedown", o);
403
- }, [e, n, t]), e ? /* @__PURE__ */ a("div", { ref: c, className: f("show", r), role: l, children: s }) : null;
402
+ return document.addEventListener("mousedown", c), () => document.removeEventListener("mousedown", c);
403
+ }, [e, r, n]), e ? /* @__PURE__ */ o("div", { ref: l, className: h("show", "rrc-popup", t), role: a, children: i }) : null;
404
404
  }
405
- function ee({
405
+ function xe({
406
406
  itemCount: e,
407
- isOpen: n,
408
- onSelect: t,
409
- onClose: r
407
+ isOpen: r,
408
+ onSelect: n,
409
+ onClose: t
410
410
  }) {
411
- const [l, s] = T(-1);
412
- B(() => {
413
- n || s(-1);
414
- }, [n]), le(n, r);
415
- const c = R(
416
- (o) => {
417
- if (!n) {
418
- (o.key === "ArrowDown" || o.key === "Enter") && o.preventDefault();
411
+ const [a, i] = M(-1);
412
+ U(() => {
413
+ r || i(-1);
414
+ }, [r]), _e(r, t);
415
+ const l = F(
416
+ (c) => {
417
+ if (!r) {
418
+ (c.key === "ArrowDown" || c.key === "Enter") && c.preventDefault();
419
419
  return;
420
420
  }
421
- switch (o.key) {
421
+ switch (c.key) {
422
422
  case "ArrowDown":
423
- o.preventDefault(), s((i) => e === 0 ? -1 : (i + 1) % e);
423
+ c.preventDefault(), i((s) => e === 0 ? -1 : (s + 1) % e);
424
424
  break;
425
425
  case "ArrowUp":
426
- o.preventDefault(), s((i) => e === 0 ? -1 : (i - 1 + e) % e);
426
+ c.preventDefault(), i((s) => e === 0 ? -1 : (s - 1 + e) % e);
427
427
  break;
428
428
  case "Home":
429
- o.preventDefault(), s(e === 0 ? -1 : 0);
429
+ c.preventDefault(), i(e === 0 ? -1 : 0);
430
430
  break;
431
431
  case "End":
432
- o.preventDefault(), s(e === 0 ? -1 : e - 1);
432
+ c.preventDefault(), i(e === 0 ? -1 : e - 1);
433
433
  break;
434
434
  case "Enter":
435
- l >= 0 && (o.preventDefault(), t(l));
435
+ a >= 0 && (c.preventDefault(), n(a));
436
436
  break;
437
437
  }
438
438
  },
439
- [n, e, l, t]
439
+ [r, e, a, n]
440
440
  );
441
- return { activeIndex: l, setActiveIndex: s, handleKeyDown: c };
441
+ return { activeIndex: a, setActiveIndex: i, handleKeyDown: l };
442
442
  }
443
- function Ie({
443
+ function Ir({
444
444
  options: e,
445
- values: n,
446
- defaultValues: t,
447
- onChange: r,
448
- loading: l,
449
- emptyText: s = "No options",
450
- id: c,
451
- name: o,
452
- disabled: i,
445
+ values: r,
446
+ defaultValues: n,
447
+ onChange: t,
448
+ loading: a,
449
+ emptyText: i = "No options",
450
+ id: l,
451
+ name: c,
452
+ disabled: s,
453
453
  readOnly: d,
454
454
  required: u,
455
- className: h,
455
+ className: f,
456
456
  label: m,
457
- placeholder: b = "Select...",
458
- helpText: v,
459
- error: x
457
+ placeholder: p = "Select...",
458
+ helpText: k,
459
+ error: S
460
460
  }) {
461
- const [N, g] = V({
462
- value: n,
463
- defaultValue: t ?? [],
464
- onChange: r
465
- }), [w, y] = T(!1), S = M(null), k = P(), C = c ?? k, D = new Set(N), $ = R(() => y(!1), []), L = R(
466
- (I) => {
467
- const F = e[I];
468
- if (!F || F.disabled)
461
+ const [x, _] = T({
462
+ value: r,
463
+ defaultValue: n ?? [],
464
+ onChange: t
465
+ }), [C, v] = M(!1), N = L(null), b = W(), w = l ?? b, g = new Set(x), I = F(() => v(!1), []), D = F(
466
+ (A) => {
467
+ const H = e[A];
468
+ if (!H || H.disabled)
469
469
  return;
470
- const J = D.has(F.value) ? N.filter((te) => te !== F.value) : [...N, F.value];
471
- g(J);
470
+ const R = g.has(H.value) ? x.filter((Z) => Z !== H.value) : [...x, H.value];
471
+ _(R);
472
472
  },
473
- [e, N, D, g]
474
- ), { activeIndex: q, setActiveIndex: _, handleKeyDown: U } = ee({
473
+ [e, x, g, _]
474
+ ), { activeIndex: O, setActiveIndex: q, handleKeyDown: G } = xe({
475
475
  itemCount: e.length,
476
- isOpen: w,
477
- onSelect: L,
478
- onClose: $
479
- }), E = e.filter((I) => D.has(I.value)).map((I) => I.label).join(", ");
480
- return /* @__PURE__ */ a(K, { id: C, label: m, required: u, error: x, helpText: v, className: h, children: /* @__PURE__ */ p("div", { className: "position-relative", children: [
481
- /* @__PURE__ */ a(
476
+ isOpen: C,
477
+ onSelect: D,
478
+ onClose: I
479
+ }), V = e.filter((A) => g.has(A.value)).map((A) => A.label).join(", ");
480
+ return /* @__PURE__ */ o(Y, { id: w, label: m, required: u, error: S, helpText: k, className: f, children: /* @__PURE__ */ y("div", { className: "position-relative", children: [
481
+ /* @__PURE__ */ o(
482
482
  "button",
483
483
  {
484
- ref: S,
485
- id: C,
484
+ ref: N,
485
+ id: w,
486
486
  type: "button",
487
- name: o,
488
- className: f("form-select text-start", x && "is-invalid"),
489
- disabled: i || d,
487
+ name: c,
488
+ className: h("form-select text-start", "rrc-select", "rrc-select__trigger", S && "is-invalid"),
489
+ disabled: s || d,
490
490
  "aria-haspopup": "listbox",
491
- "aria-expanded": w,
492
- onClick: () => y((I) => !I),
493
- onKeyDown: U,
494
- children: E || /* @__PURE__ */ a("span", { className: "text-body-secondary", children: b })
491
+ "aria-expanded": C,
492
+ onClick: () => v((A) => !A),
493
+ onKeyDown: G,
494
+ children: V || /* @__PURE__ */ o("span", { className: "text-body-secondary", children: p })
495
495
  }
496
496
  ),
497
- /* @__PURE__ */ a(G, { open: w, onClose: $, anchorRef: S, className: "dropdown-menu w-100", role: "listbox", children: l ? /* @__PURE__ */ a("div", { className: "px-3 py-2 text-body-secondary", children: "Loading…" }) : e.length === 0 ? /* @__PURE__ */ a("div", { className: "px-3 py-2 text-body-secondary", children: s }) : e.map((I, F) => /* @__PURE__ */ p(
497
+ /* @__PURE__ */ o(oe, { open: C, onClose: I, anchorRef: N, className: "dropdown-menu w-100 rrc-menu rrc-select__menu", role: "listbox", children: a ? /* @__PURE__ */ o("div", { className: "px-3 py-2 text-body-secondary", children: "Loading…" }) : e.length === 0 ? /* @__PURE__ */ o("div", { className: "px-3 py-2 text-body-secondary", children: i }) : e.map((A, H) => /* @__PURE__ */ y(
498
498
  "div",
499
499
  {
500
500
  role: "option",
501
- "aria-selected": D.has(I.value),
502
- className: f(
501
+ "aria-selected": g.has(A.value),
502
+ className: h(
503
503
  "dropdown-item d-flex align-items-center gap-2",
504
- F === q && "active",
505
- I.disabled && "disabled"
504
+ H === O && "active",
505
+ A.disabled && "disabled"
506
506
  ),
507
- onMouseEnter: () => _(F),
508
- onMouseDown: (J) => {
509
- J.preventDefault(), I.disabled || L(F);
507
+ onMouseEnter: () => q(H),
508
+ onMouseDown: (R) => {
509
+ R.preventDefault(), A.disabled || D(H);
510
510
  },
511
511
  children: [
512
- /* @__PURE__ */ a("input", { type: "checkbox", className: "form-check-input m-0", checked: D.has(I.value), readOnly: !0, tabIndex: -1 }),
513
- I.label
512
+ /* @__PURE__ */ o("input", { type: "checkbox", className: "form-check-input m-0", checked: g.has(A.value), readOnly: !0, tabIndex: -1 }),
513
+ A.label
514
514
  ]
515
515
  },
516
- String(I.value)
516
+ String(A.value)
517
517
  )) })
518
518
  ] }) });
519
519
  }
520
- function H(e) {
520
+ function ae(e) {
521
521
  if (!e)
522
522
  return "";
523
- const n = e.getFullYear(), t = String(e.getMonth() + 1).padStart(2, "0"), r = String(e.getDate()).padStart(2, "0");
524
- return `${n}-${t}-${r}`;
523
+ const r = e.getFullYear(), n = String(e.getMonth() + 1).padStart(2, "0"), t = String(e.getDate()).padStart(2, "0");
524
+ return `${r}-${n}-${t}`;
525
525
  }
526
- function me(e) {
526
+ function nr(e) {
527
527
  if (!e)
528
528
  return null;
529
- const n = e.split("-").map(Number), [t, r, l] = n;
530
- return !t || !r || !l ? null : new Date(t, r - 1, l);
529
+ const r = e.split("-").map(Number), [n, t, a] = r;
530
+ return !n || !t || !a ? null : new Date(n, t - 1, a);
531
531
  }
532
- function De({ value: e, defaultValue: n, onChange: t, min: r, max: l, ...s }) {
533
- const [c, o] = V({
532
+ function Er({ value: e, defaultValue: r, onChange: n, min: t, max: a, ...i }) {
533
+ const [l, c] = T({
534
534
  value: e,
535
- defaultValue: n ?? null,
536
- onChange: t
535
+ defaultValue: r ?? null,
536
+ onChange: n
537
537
  });
538
- return /* @__PURE__ */ a(
539
- Y,
538
+ return /* @__PURE__ */ o(
539
+ de,
540
540
  {
541
- ...s,
542
- value: H(c),
543
- onChange: (i) => o(me(i)),
541
+ ...i,
542
+ value: ae(l),
543
+ onChange: (s) => c(nr(s)),
544
544
  inputProps: {
545
545
  type: "date",
546
- min: r ? H(r) : void 0,
547
- max: l ? H(l) : void 0
546
+ min: t ? ae(t) : void 0,
547
+ max: a ? ae(a) : void 0
548
548
  }
549
549
  }
550
550
  );
551
551
  }
552
- function he(e) {
552
+ function tr(e) {
553
553
  if (!e)
554
554
  return "";
555
- const n = String(e.getHours()).padStart(2, "0"), t = String(e.getMinutes()).padStart(2, "0");
556
- return `${n}:${t}`;
555
+ const r = String(e.getHours()).padStart(2, "0"), n = String(e.getMinutes()).padStart(2, "0");
556
+ return `${r}:${n}`;
557
557
  }
558
- function be(e) {
558
+ function ar(e) {
559
559
  if (!e)
560
560
  return null;
561
- const [n, t] = e.split(":").map(Number);
562
- return n === void 0 || t === void 0 || Number.isNaN(n) || Number.isNaN(t) ? null : new Date(1970, 0, 1, n, t, 0, 0);
561
+ const [r, n] = e.split(":").map(Number);
562
+ return r === void 0 || n === void 0 || Number.isNaN(r) || Number.isNaN(n) ? null : new Date(1970, 0, 1, r, n, 0, 0);
563
563
  }
564
- function xn({ value: e, defaultValue: n, onChange: t, step: r, ...l }) {
565
- const [s, c] = V({
564
+ function ct({ value: e, defaultValue: r, onChange: n, step: t, ...a }) {
565
+ const [i, l] = T({
566
566
  value: e,
567
- defaultValue: n ?? null,
568
- onChange: t
567
+ defaultValue: r ?? null,
568
+ onChange: n
569
569
  });
570
- return /* @__PURE__ */ a(
571
- Y,
570
+ return /* @__PURE__ */ o(
571
+ de,
572
572
  {
573
- ...l,
574
- value: he(s),
575
- onChange: (o) => c(be(o)),
576
- inputProps: { type: "time", step: r }
573
+ ...a,
574
+ value: tr(i),
575
+ onChange: (c) => l(ar(c)),
576
+ inputProps: { type: "time", step: t }
577
577
  }
578
578
  );
579
579
  }
580
- function ae(e, n) {
581
- const t = me(e);
582
- if (!t)
580
+ function We(e, r) {
581
+ const n = nr(e);
582
+ if (!n)
583
583
  return null;
584
- const r = be(n || "00:00");
585
- return r && t.setHours(r.getHours(), r.getMinutes(), 0, 0), t;
584
+ const t = ar(r || "00:00");
585
+ return t && n.setHours(t.getHours(), t.getMinutes(), 0, 0), n;
586
586
  }
587
- function kn({
587
+ function dt({
588
588
  value: e,
589
- defaultValue: n,
590
- onChange: t,
591
- min: r,
592
- max: l,
593
- id: s,
594
- name: c,
595
- disabled: o,
596
- readOnly: i,
589
+ defaultValue: r,
590
+ onChange: n,
591
+ min: t,
592
+ max: a,
593
+ id: i,
594
+ name: l,
595
+ disabled: c,
596
+ readOnly: s,
597
597
  required: d,
598
598
  className: u,
599
- label: h,
599
+ label: f,
600
600
  helpText: m,
601
- error: b
601
+ error: p
602
602
  }) {
603
- const [v, x] = V({
603
+ const [k, S] = T({
604
604
  value: e,
605
- defaultValue: n ?? null,
606
- onChange: t
607
- }), N = P(), g = s ?? N, w = H(v), y = he(v);
608
- return /* @__PURE__ */ a(K, { id: g, label: h, required: d, error: b, helpText: m, className: u, children: /* @__PURE__ */ p("div", { className: "d-flex gap-2", children: [
609
- /* @__PURE__ */ a(
605
+ defaultValue: r ?? null,
606
+ onChange: n
607
+ }), x = W(), _ = i ?? x, C = ae(k), v = tr(k);
608
+ return /* @__PURE__ */ o(Y, { id: _, label: f, required: d, error: p, helpText: m, className: u, children: /* @__PURE__ */ y("div", { className: "d-flex gap-2", children: [
609
+ /* @__PURE__ */ o(
610
610
  "input",
611
611
  {
612
- id: g,
613
- name: c ? `${c}-date` : void 0,
612
+ id: _,
613
+ name: l ? `${l}-date` : void 0,
614
614
  type: "date",
615
- className: f("form-control", b && "is-invalid"),
616
- disabled: o,
617
- readOnly: i,
615
+ className: h("form-control", "rrc-input", p && "is-invalid"),
616
+ disabled: c,
617
+ readOnly: s,
618
618
  required: d,
619
- min: r ? H(r) : void 0,
620
- max: l ? H(l) : void 0,
621
- value: w,
622
- onChange: (S) => x(ae(S.target.value, y))
619
+ min: t ? ae(t) : void 0,
620
+ max: a ? ae(a) : void 0,
621
+ value: C,
622
+ onChange: (N) => S(We(N.target.value, v))
623
623
  }
624
624
  ),
625
- /* @__PURE__ */ a(
625
+ /* @__PURE__ */ o(
626
626
  "input",
627
627
  {
628
- name: c ? `${c}-time` : void 0,
628
+ name: l ? `${l}-time` : void 0,
629
629
  type: "time",
630
- className: f("form-control", b && "is-invalid"),
631
- disabled: o,
632
- readOnly: i,
630
+ className: h("form-control", "rrc-input", p && "is-invalid"),
631
+ disabled: c,
632
+ readOnly: s,
633
633
  required: d,
634
- value: y,
635
- onChange: (S) => x(ae(w || H(/* @__PURE__ */ new Date()), S.target.value))
634
+ value: v,
635
+ onChange: (N) => S(We(C || ae(/* @__PURE__ */ new Date()), N.target.value))
636
636
  }
637
637
  )
638
638
  ] }) });
639
639
  }
640
- function Ve({
640
+ function Ar({
641
641
  options: e,
642
- value: n,
643
- defaultValue: t,
644
- onChange: r,
645
- loading: l,
646
- emptyText: s = "No options",
647
- id: c,
648
- name: o,
649
- disabled: i,
642
+ value: r,
643
+ defaultValue: n,
644
+ onChange: t,
645
+ loading: a,
646
+ emptyText: i = "No options",
647
+ id: l,
648
+ name: c,
649
+ disabled: s,
650
650
  readOnly: d,
651
651
  required: u,
652
- className: h,
652
+ className: f,
653
653
  label: m,
654
- placeholder: b = "Select...",
655
- helpText: v,
656
- error: x
654
+ placeholder: p = "Select...",
655
+ helpText: k,
656
+ error: S
657
657
  }) {
658
- const [N, g] = V({
659
- value: n,
660
- defaultValue: t ?? null,
661
- onChange: r
662
- }), [w, y] = T(!1), S = M(null), k = P(), C = c ?? k, D = e.find((O) => O.value === N) ?? null, $ = R(() => y(!1), []), L = R(
663
- (O) => {
664
- const E = e[O];
665
- !E || E.disabled || (g(E.value), $());
658
+ const [x, _] = T({
659
+ value: r,
660
+ defaultValue: n ?? null,
661
+ onChange: t
662
+ }), [C, v] = M(!1), N = L(null), b = W(), w = l ?? b, g = e.find((P) => P.value === x) ?? null, I = F(() => v(!1), []), D = F(
663
+ (P) => {
664
+ const V = e[P];
665
+ !V || V.disabled || (_(V.value), I());
666
666
  },
667
- [e, g, $]
668
- ), { activeIndex: q, setActiveIndex: _, handleKeyDown: U } = ee({
667
+ [e, _, I]
668
+ ), { activeIndex: O, setActiveIndex: q, handleKeyDown: G } = xe({
669
669
  itemCount: e.length,
670
- isOpen: w,
671
- onSelect: L,
672
- onClose: $
670
+ isOpen: C,
671
+ onSelect: D,
672
+ onClose: I
673
673
  });
674
- return /* @__PURE__ */ a(K, { id: C, label: m, required: u, error: x, helpText: v, className: h, children: /* @__PURE__ */ p("div", { className: "position-relative", children: [
675
- /* @__PURE__ */ a(
674
+ return /* @__PURE__ */ o(Y, { id: w, label: m, required: u, error: S, helpText: k, className: f, children: /* @__PURE__ */ y("div", { className: "position-relative", children: [
675
+ /* @__PURE__ */ o(
676
676
  "button",
677
677
  {
678
- ref: S,
679
- id: C,
678
+ ref: N,
679
+ id: w,
680
680
  type: "button",
681
- name: o,
682
- className: f("form-select text-start", x && "is-invalid"),
683
- disabled: i || d,
681
+ name: c,
682
+ className: h("form-select text-start", "rrc-select", "rrc-select__trigger", S && "is-invalid"),
683
+ disabled: s || d,
684
684
  "aria-haspopup": "listbox",
685
- "aria-expanded": w,
686
- onClick: () => y((O) => !O),
687
- onKeyDown: U,
688
- children: D ? D.label : /* @__PURE__ */ a("span", { className: "text-body-secondary", children: b })
685
+ "aria-expanded": C,
686
+ onClick: () => v((P) => !P),
687
+ onKeyDown: G,
688
+ children: g ? g.label : /* @__PURE__ */ o("span", { className: "text-body-secondary", children: p })
689
689
  }
690
690
  ),
691
- /* @__PURE__ */ a(G, { open: w, onClose: $, anchorRef: S, className: "dropdown-menu w-100", role: "listbox", children: l ? /* @__PURE__ */ a("div", { className: "px-3 py-2 text-body-secondary", children: "Loading…" }) : e.length === 0 ? /* @__PURE__ */ a("div", { className: "px-3 py-2 text-body-secondary", children: s }) : e.map((O, E) => /* @__PURE__ */ a(
691
+ /* @__PURE__ */ o(oe, { open: C, onClose: I, anchorRef: N, className: "dropdown-menu w-100 rrc-menu rrc-select__menu", role: "listbox", children: a ? /* @__PURE__ */ o("div", { className: "px-3 py-2 text-body-secondary", children: "Loading…" }) : e.length === 0 ? /* @__PURE__ */ o("div", { className: "px-3 py-2 text-body-secondary", children: i }) : e.map((P, V) => /* @__PURE__ */ o(
692
692
  "div",
693
693
  {
694
694
  role: "option",
695
- "aria-selected": O.value === N,
696
- className: f("dropdown-item", E === q && "active", O.disabled && "disabled"),
697
- onMouseEnter: () => _(E),
698
- onMouseDown: (I) => {
699
- I.preventDefault(), O.disabled || L(E);
695
+ "aria-selected": P.value === x,
696
+ className: h("dropdown-item", "rrc-menu__item", V === O && "active", P.disabled && "disabled"),
697
+ onMouseEnter: () => q(V),
698
+ onMouseDown: (A) => {
699
+ A.preventDefault(), P.disabled || D(V);
700
700
  },
701
- children: O.label
701
+ children: P.label
702
702
  },
703
- String(O.value)
703
+ String(P.value)
704
704
  )) })
705
705
  ] }) });
706
706
  }
707
- function Te(e, n) {
708
- return n ? e.label.toLowerCase().includes(n.toLowerCase()) : !0;
707
+ function Dr(e, r) {
708
+ return r ? e.label.toLowerCase().includes(r.toLowerCase()) : !0;
709
709
  }
710
- function Me({
710
+ function Tr({
711
711
  options: e,
712
- value: n,
713
- defaultValue: t,
714
- onChange: r,
715
- inputValue: l,
716
- onInputValueChange: s,
717
- loading: c,
718
- emptyText: o = "No results",
719
- filter: i,
712
+ value: r,
713
+ defaultValue: n,
714
+ onChange: t,
715
+ inputValue: a,
716
+ onInputValueChange: i,
717
+ loading: l,
718
+ emptyText: c = "No results",
719
+ filter: s,
720
720
  id: d,
721
721
  name: u,
722
- disabled: h,
722
+ disabled: f,
723
723
  readOnly: m,
724
- required: b,
725
- className: v,
726
- label: x,
727
- placeholder: N,
728
- helpText: g,
729
- error: w
724
+ required: p,
725
+ className: k,
726
+ label: S,
727
+ placeholder: x,
728
+ helpText: _,
729
+ error: C
730
730
  }) {
731
- const [y, S] = V({
732
- value: n,
733
- defaultValue: t ?? null,
734
- onChange: r
735
- }), k = e.find((A) => A.value === y) ?? null, [C, D] = V({
736
- value: l,
737
- defaultValue: (k == null ? void 0 : k.label) ?? "",
738
- onChange: s
739
- }), [$, L] = T(!1), q = M(null), _ = P(), U = d ?? _, O = i ?? Te, E = e.filter((A) => O(A, C)), I = R(() => L(!1), []), F = R(
740
- (A) => {
741
- const j = E[A];
742
- !j || j.disabled || (S(j.value), D(j.label), I());
731
+ const [v, N] = T({
732
+ value: r,
733
+ defaultValue: n ?? null,
734
+ onChange: t
735
+ }), b = e.find((K) => K.value === v) ?? null, [w, g] = T({
736
+ value: a,
737
+ defaultValue: (b == null ? void 0 : b.label) ?? "",
738
+ onChange: i
739
+ }), [I, D] = M(!1), O = L(null), q = W(), G = d ?? q, P = s ?? Dr, V = e.filter((K) => P(K, w)), A = F(() => D(!1), []), H = F(
740
+ (K) => {
741
+ const j = V[K];
742
+ !j || j.disabled || (N(j.value), g(j.label), A());
743
743
  },
744
- [E, S, D, I]
745
- ), { activeIndex: J, setActiveIndex: te, handleKeyDown: we } = ee({
746
- itemCount: E.length,
747
- isOpen: $,
748
- onSelect: F,
749
- onClose: I
744
+ [V, N, g, A]
745
+ ), { activeIndex: R, setActiveIndex: Z, handleKeyDown: X } = xe({
746
+ itemCount: V.length,
747
+ isOpen: I,
748
+ onSelect: H,
749
+ onClose: A
750
750
  });
751
- return /* @__PURE__ */ a(K, { id: U, label: x, required: b, error: w, helpText: g, className: v, children: /* @__PURE__ */ p("div", { className: "position-relative", children: [
752
- /* @__PURE__ */ a(
751
+ return /* @__PURE__ */ o(Y, { id: G, label: S, required: p, error: C, helpText: _, className: k, children: /* @__PURE__ */ y("div", { className: "position-relative", children: [
752
+ /* @__PURE__ */ o(
753
753
  "input",
754
754
  {
755
- ref: q,
756
- id: U,
755
+ ref: O,
756
+ id: G,
757
757
  name: u,
758
758
  type: "text",
759
- className: f("form-control", w && "is-invalid"),
760
- disabled: h,
759
+ className: h("form-control", "rrc-input", C && "is-invalid"),
760
+ disabled: f,
761
761
  readOnly: m,
762
- required: b,
763
- placeholder: N,
762
+ required: p,
763
+ placeholder: x,
764
764
  autoComplete: "off",
765
765
  role: "combobox",
766
- "aria-expanded": $,
766
+ "aria-expanded": I,
767
767
  "aria-haspopup": "listbox",
768
- value: C,
769
- onFocus: () => L(!0),
770
- onChange: (A) => {
771
- const j = A.target.value;
772
- D(j), L(!0), y !== null && S(null);
768
+ value: w,
769
+ onFocus: () => D(!0),
770
+ onChange: (K) => {
771
+ const j = K.target.value;
772
+ g(j), D(!0), v !== null && N(null);
773
773
  },
774
- onKeyDown: we
774
+ onKeyDown: X
775
775
  }
776
776
  ),
777
- /* @__PURE__ */ a(G, { open: $, onClose: I, anchorRef: q, className: "dropdown-menu w-100", role: "listbox", children: c ? /* @__PURE__ */ a("div", { className: "px-3 py-2 text-body-secondary", children: "Loading…" }) : E.length === 0 ? /* @__PURE__ */ a("div", { className: "px-3 py-2 text-body-secondary", children: o }) : E.map((A, j) => /* @__PURE__ */ a(
777
+ /* @__PURE__ */ o(oe, { open: I, onClose: A, anchorRef: O, className: "dropdown-menu w-100 rrc-menu rrc-select__menu", role: "listbox", children: l ? /* @__PURE__ */ o("div", { className: "px-3 py-2 text-body-secondary", children: "Loading…" }) : V.length === 0 ? /* @__PURE__ */ o("div", { className: "px-3 py-2 text-body-secondary", children: c }) : V.map((K, j) => /* @__PURE__ */ o(
778
778
  "div",
779
779
  {
780
780
  role: "option",
781
- "aria-selected": A.value === y,
782
- className: f("dropdown-item", j === J && "active", A.disabled && "disabled"),
783
- onMouseEnter: () => te(j),
784
- onMouseDown: (xe) => {
785
- xe.preventDefault(), A.disabled || F(j);
781
+ "aria-selected": K.value === v,
782
+ className: h("dropdown-item", "rrc-menu__item", j === R && "active", K.disabled && "disabled"),
783
+ onMouseEnter: () => Z(j),
784
+ onMouseDown: (E) => {
785
+ E.preventDefault(), K.disabled || H(j);
786
786
  },
787
- children: A.label
787
+ children: K.label
788
788
  },
789
- String(A.value)
789
+ String(K.value)
790
790
  )) })
791
791
  ] }) });
792
792
  }
793
- function Sn(e) {
794
- return /* @__PURE__ */ a(K, { ...e });
793
+ function ut(e) {
794
+ return /* @__PURE__ */ o(Y, { ...e });
795
795
  }
796
- function Ee({ open: e, onClose: n, title: t, children: r, footer: l, className: s }) {
797
- return le(e, n), e ? /* @__PURE__ */ p(X, { children: [
798
- /* @__PURE__ */ a("div", { className: "modal d-block", tabIndex: -1, role: "dialog", "aria-modal": "true", children: /* @__PURE__ */ a("div", { className: f("modal-dialog", s), role: "document", children: /* @__PURE__ */ p("div", { className: "modal-content", children: [
799
- /* @__PURE__ */ p("div", { className: "modal-header", children: [
800
- t && /* @__PURE__ */ a("h5", { className: "modal-title", children: t }),
801
- /* @__PURE__ */ a("button", { type: "button", className: "btn-close", "aria-label": "Close", onClick: n })
796
+ function Vr({ open: e, onClose: r, title: n, children: t, footer: a, className: i }) {
797
+ return _e(e, r), e ? /* @__PURE__ */ y(Q, { children: [
798
+ /* @__PURE__ */ o("div", { className: "modal d-block rrc-modal", tabIndex: -1, role: "dialog", "aria-modal": "true", children: /* @__PURE__ */ o("div", { className: h("modal-dialog", "rrc-modal__dialog", i), role: "document", children: /* @__PURE__ */ y("div", { className: "modal-content rrc-modal__content", children: [
799
+ /* @__PURE__ */ y("div", { className: "modal-header rrc-modal__header", children: [
800
+ n && /* @__PURE__ */ o("h5", { className: "modal-title", children: n }),
801
+ /* @__PURE__ */ o("button", { type: "button", className: "btn-close", "aria-label": "Close", onClick: r })
802
802
  ] }),
803
- /* @__PURE__ */ a("div", { className: "modal-body", children: r }),
804
- l && /* @__PURE__ */ a("div", { className: "modal-footer", children: l })
803
+ /* @__PURE__ */ o("div", { className: "modal-body rrc-modal__body", children: t }),
804
+ a && /* @__PURE__ */ o("div", { className: "modal-footer rrc-modal__footer", children: a })
805
805
  ] }) }) }),
806
- /* @__PURE__ */ a("div", { className: "modal-backdrop show", onClick: n })
806
+ /* @__PURE__ */ o("div", { className: "modal-backdrop show rrc-modal__backdrop", onClick: r })
807
807
  ] }) : null;
808
808
  }
809
- function Re(e, n, t) {
810
- const r = [], l = Math.max(1, e - t), s = Math.min(n, e + t);
811
- l > 1 && (r.push(1), l > 2 && r.push("ellipsis"));
812
- for (let c = l; c <= s; c++)
813
- r.push(c);
814
- return s < n && (s < n - 1 && r.push("ellipsis"), r.push(n)), r;
815
- }
816
- function $e({ currentPage: e, pageSize: n, totalItems: t, onPageChange: r, siblingCount: l = 1, className: s }) {
817
- const c = Math.max(1, Math.ceil(t / n)), o = Re(e, c, l);
818
- return /* @__PURE__ */ a("nav", { "aria-label": "Pagination", className: s, children: /* @__PURE__ */ p("ul", { className: "pagination mb-0", children: [
819
- /* @__PURE__ */ a("li", { className: f("page-item", e <= 1 && "disabled"), children: /* @__PURE__ */ a(
809
+ function Lr(e, r, n) {
810
+ const t = [], a = Math.max(1, e - n), i = Math.min(r, e + n);
811
+ a > 1 && (t.push(1), a > 2 && t.push("ellipsis"));
812
+ for (let l = a; l <= i; l++)
813
+ t.push(l);
814
+ return i < r && (i < r - 1 && t.push("ellipsis"), t.push(r)), t;
815
+ }
816
+ function Rr({ currentPage: e, pageSize: r, totalItems: n, onPageChange: t, siblingCount: a = 1, className: i }) {
817
+ const l = Math.max(1, Math.ceil(n / r)), c = Lr(e, l, a);
818
+ return /* @__PURE__ */ o("nav", { "aria-label": "Pagination", className: i, children: /* @__PURE__ */ y("ul", { className: "pagination mb-0 rrc-pagination", children: [
819
+ /* @__PURE__ */ o("li", { className: h("page-item", e <= 1 && "disabled"), children: /* @__PURE__ */ o(
820
820
  "button",
821
821
  {
822
822
  type: "button",
823
823
  className: "page-link",
824
824
  disabled: e <= 1,
825
- onClick: () => r(e - 1),
825
+ onClick: () => t(e - 1),
826
826
  children: "Previous"
827
827
  }
828
828
  ) }),
829
- o.map(
830
- (i, d) => i === "ellipsis" ? /* @__PURE__ */ a("li", { className: "page-item disabled", children: /* @__PURE__ */ a("span", { className: "page-link", children: "…" }) }, `ellipsis-${d}`) : /* @__PURE__ */ a("li", { className: f("page-item", i === e && "active"), children: /* @__PURE__ */ a(
829
+ c.map(
830
+ (s, d) => s === "ellipsis" ? /* @__PURE__ */ o("li", { className: "page-item disabled", children: /* @__PURE__ */ o("span", { className: "page-link", children: "…" }) }, `ellipsis-${d}`) : /* @__PURE__ */ o("li", { className: h("page-item", s === e && "active"), children: /* @__PURE__ */ o(
831
831
  "button",
832
832
  {
833
833
  type: "button",
834
834
  className: "page-link",
835
- "aria-current": i === e ? "page" : void 0,
836
- onClick: () => r(i),
837
- children: i
835
+ "aria-current": s === e ? "page" : void 0,
836
+ onClick: () => t(s),
837
+ children: s
838
838
  }
839
- ) }, i)
839
+ ) }, s)
840
840
  ),
841
- /* @__PURE__ */ a("li", { className: f("page-item", e >= c && "disabled"), children: /* @__PURE__ */ a(
841
+ /* @__PURE__ */ o("li", { className: h("page-item", e >= l && "disabled"), children: /* @__PURE__ */ o(
842
842
  "button",
843
843
  {
844
844
  type: "button",
845
845
  className: "page-link",
846
- disabled: e >= c,
847
- onClick: () => r(e + 1),
846
+ disabled: e >= l,
847
+ onClick: () => t(e + 1),
848
848
  children: "Next"
849
849
  }
850
850
  ) })
851
851
  ] }) });
852
852
  }
853
- function Oe(e, n) {
854
- return !e || e.key !== n ? { key: n, direction: "asc" } : e.direction === "asc" ? { key: n, direction: "desc" } : null;
853
+ const $r = {
854
+ text: (e) => e == null ? "" : String(e),
855
+ boolean: (e) => e ? "Yes" : "No",
856
+ date: (e) => {
857
+ if (e == null || e === "")
858
+ return "";
859
+ const r = e instanceof Date ? e : new Date(String(e));
860
+ return Number.isNaN(r.getTime()) ? String(e) : r.toLocaleDateString();
861
+ },
862
+ currency: (e) => {
863
+ const r = Number(e);
864
+ return Number.isFinite(r) ? r.toLocaleString(void 0, { style: "currency", currency: "USD" }) : String(e ?? "");
865
+ }
866
+ };
867
+ function Or(e, r) {
868
+ return !e || e.key !== r ? { key: r, direction: "asc" } : e.direction === "asc" ? { key: r, direction: "desc" } : null;
855
869
  }
856
- function Ae({
870
+ function Ge(e) {
871
+ return e.key ?? e.field ?? e.header;
872
+ }
873
+ function Mr(e, r) {
874
+ const n = e.field ?? e.key;
875
+ return n ? r[n] : void 0;
876
+ }
877
+ function Pr(e, r) {
878
+ if (e.render)
879
+ return e.render(r);
880
+ const n = Mr(e, r);
881
+ return e.formatter ? e.formatter(n, r) : e.format ? $r[e.format](n) : n == null ? "" : String(n);
882
+ }
883
+ function Je(e) {
884
+ return e && `text-${e}`;
885
+ }
886
+ function Kr({
857
887
  columns: e,
858
- rows: n,
859
- rowKey: t,
860
- loading: r,
861
- error: l,
862
- emptyText: s = "No data",
863
- className: c,
864
- selectedRowKeys: o,
865
- onSelectionChange: i,
888
+ rows: r,
889
+ rowKey: n,
890
+ loading: t,
891
+ error: a,
892
+ emptyText: i = "No data",
893
+ className: l,
894
+ selectedRowKeys: c,
895
+ onSelectionChange: s,
866
896
  sort: d,
867
897
  onSortChange: u,
868
- page: h,
898
+ page: f,
869
899
  pageSize: m,
870
- totalCount: b,
871
- onPageChange: v
900
+ totalCount: p,
901
+ onPageChange: k
872
902
  }) {
873
- const x = !!i, N = new Set(o ?? []), g = h !== void 0 && m !== void 0 && b !== void 0, w = g ? Math.max(1, Math.ceil(b / m)) : 1;
874
- function y() {
875
- i && (N.size === n.length ? i([]) : i(n.map(t)));
903
+ const S = !!s, x = new Set(c ?? []), _ = f !== void 0 && m !== void 0 && p !== void 0, C = _ ? Math.max(1, Math.ceil(p / m)) : 1;
904
+ function v() {
905
+ s && (x.size === r.length ? s([]) : s(r.map(n)));
876
906
  }
877
- function S(k) {
878
- if (!i)
907
+ function N(b) {
908
+ if (!s)
879
909
  return;
880
- const C = new Set(N);
881
- C.has(k) ? C.delete(k) : C.add(k), i(Array.from(C));
910
+ const w = new Set(x);
911
+ w.has(b) ? w.delete(b) : w.add(b), s(Array.from(w));
882
912
  }
883
- return /* @__PURE__ */ p("div", { className: f("table-responsive", c), children: [
884
- /* @__PURE__ */ p("table", { className: "table table-hover align-middle", children: [
885
- /* @__PURE__ */ a("thead", { children: /* @__PURE__ */ p("tr", { children: [
886
- x && /* @__PURE__ */ a("th", { style: { width: "2.5rem" }, children: /* @__PURE__ */ a(
913
+ return /* @__PURE__ */ y("div", { className: h("table-responsive", "rrc-data-grid", l), children: [
914
+ /* @__PURE__ */ y("table", { className: "table table-hover align-middle rrc-data-grid__table", children: [
915
+ /* @__PURE__ */ o("thead", { children: /* @__PURE__ */ y("tr", { children: [
916
+ S && /* @__PURE__ */ o("th", { style: { width: "2.5rem" }, children: /* @__PURE__ */ o(
887
917
  "input",
888
918
  {
889
919
  type: "checkbox",
890
920
  className: "form-check-input",
891
- checked: n.length > 0 && N.size === n.length,
892
- onChange: y,
921
+ checked: r.length > 0 && x.size === r.length,
922
+ onChange: v,
893
923
  "aria-label": "Select all rows"
894
924
  }
895
925
  ) }),
896
- e.map((k) => /* @__PURE__ */ p(
897
- "th",
898
- {
899
- style: { width: k.width },
900
- role: k.sortable ? "button" : void 0,
901
- onClick: k.sortable && u ? () => u(Oe(d, k.key)) : void 0,
902
- children: [
903
- k.header,
904
- k.sortable && (d == null ? void 0 : d.key) === k.key && /* @__PURE__ */ p("span", { "aria-hidden": "true", children: [
905
- " ",
906
- d.direction === "asc" ? "▲" : "▼"
907
- ] })
908
- ]
909
- },
910
- k.key
911
- ))
926
+ e.map((b) => {
927
+ const w = Ge(b);
928
+ return /* @__PURE__ */ y(
929
+ "th",
930
+ {
931
+ className: Je(b.headerAlign ?? b.align),
932
+ style: { width: b.width, minWidth: b.minWidth, maxWidth: b.maxWidth },
933
+ role: b.sortable ? "button" : void 0,
934
+ onClick: b.sortable && u ? () => u(Or(d, w)) : void 0,
935
+ children: [
936
+ b.header,
937
+ b.sortable && (d == null ? void 0 : d.key) === w && /* @__PURE__ */ y("span", { "aria-hidden": "true", children: [
938
+ " ",
939
+ d.direction === "asc" ? "▲" : "▼"
940
+ ] })
941
+ ]
942
+ },
943
+ w
944
+ );
945
+ })
912
946
  ] }) }),
913
- /* @__PURE__ */ a("tbody", { children: r ? /* @__PURE__ */ a("tr", { children: /* @__PURE__ */ a("td", { colSpan: e.length + (x ? 1 : 0), className: "text-center text-body-secondary py-4", children: "Loading…" }) }) : l ? /* @__PURE__ */ a("tr", { children: /* @__PURE__ */ a("td", { colSpan: e.length + (x ? 1 : 0), className: "text-center text-danger py-4", children: l }) }) : n.length === 0 ? /* @__PURE__ */ a("tr", { children: /* @__PURE__ */ a("td", { colSpan: e.length + (x ? 1 : 0), className: "text-center text-body-secondary py-4", children: s }) }) : n.map((k) => {
914
- const C = t(k);
915
- return /* @__PURE__ */ p("tr", { children: [
916
- x && /* @__PURE__ */ a("td", { children: /* @__PURE__ */ a(
947
+ /* @__PURE__ */ o("tbody", { children: t ? /* @__PURE__ */ o("tr", { children: /* @__PURE__ */ o("td", { colSpan: e.length + (S ? 1 : 0), className: "text-center text-body-secondary py-4", children: "Loading…" }) }) : a ? /* @__PURE__ */ o("tr", { children: /* @__PURE__ */ o("td", { colSpan: e.length + (S ? 1 : 0), className: "text-center text-danger py-4", children: a }) }) : r.length === 0 ? /* @__PURE__ */ o("tr", { children: /* @__PURE__ */ o("td", { colSpan: e.length + (S ? 1 : 0), className: "text-center text-body-secondary py-4", children: i }) }) : r.map((b) => {
948
+ const w = n(b);
949
+ return /* @__PURE__ */ y("tr", { children: [
950
+ S && /* @__PURE__ */ o("td", { children: /* @__PURE__ */ o(
917
951
  "input",
918
952
  {
919
953
  type: "checkbox",
920
954
  className: "form-check-input",
921
- checked: N.has(C),
922
- onChange: () => S(C),
955
+ checked: x.has(w),
956
+ onChange: () => N(w),
923
957
  "aria-label": "Select row"
924
958
  }
925
959
  ) }),
926
- e.map((D) => /* @__PURE__ */ a("td", { children: D.render ? D.render(k) : String(k[D.key] ?? "") }, D.key))
927
- ] }, C);
960
+ e.map((g) => /* @__PURE__ */ o("td", { className: Je(g.align), children: Pr(g, b) }, Ge(g)))
961
+ ] }, w);
928
962
  }) })
929
963
  ] }),
930
- g && /* @__PURE__ */ p("div", { className: "d-flex justify-content-between align-items-center mt-2", children: [
931
- /* @__PURE__ */ p("span", { className: "text-body-secondary small", children: [
964
+ _ && /* @__PURE__ */ y("div", { className: "d-flex justify-content-between align-items-center mt-2 rrc-data-grid__footer", children: [
965
+ /* @__PURE__ */ y("span", { className: "text-body-secondary small", children: [
932
966
  "Page ",
933
- h,
967
+ f,
934
968
  " of ",
935
- w,
969
+ C,
936
970
  " (",
937
- b,
971
+ p,
938
972
  " rows)"
939
973
  ] }),
940
- /* @__PURE__ */ a($e, { currentPage: h, pageSize: m, totalItems: b, onPageChange: v })
974
+ /* @__PURE__ */ o(Rr, { currentPage: f, pageSize: m, totalItems: p, onPageChange: k })
941
975
  ] })
942
976
  ] });
943
977
  }
944
- function Pe({ size: e = "md", variant: n, className: t, label: r = "Loading..." }) {
945
- return /* @__PURE__ */ a(
978
+ function Br({ size: e = "md", variant: r, className: n, label: t = "Loading..." }) {
979
+ return /* @__PURE__ */ o(
946
980
  "span",
947
981
  {
948
- className: f("spinner-border", e === "sm" && "spinner-border-sm", n && `text-${n}`, t),
982
+ className: h("spinner-border", "rrc-spinner", e === "sm" && "spinner-border-sm", r && `text-${r}`, n),
949
983
  role: "status",
950
- children: /* @__PURE__ */ a("span", { className: "visually-hidden", children: r })
984
+ children: /* @__PURE__ */ o("span", { className: "visually-hidden", children: t })
951
985
  }
952
986
  );
953
987
  }
954
- function re({
988
+ function ke({
955
989
  variant: e = "primary",
956
- size: n,
957
- disabled: t,
958
- loading: r,
959
- type: l = "button",
960
- className: s,
961
- children: c,
962
- onClick: o,
963
- ...i
990
+ size: r,
991
+ disabled: n,
992
+ loading: t,
993
+ type: a = "button",
994
+ className: i,
995
+ children: l,
996
+ onClick: c,
997
+ ...s
964
998
  }) {
965
- const d = t || r;
966
- return /* @__PURE__ */ p(
999
+ const d = n || t;
1000
+ return /* @__PURE__ */ y(
967
1001
  "button",
968
1002
  {
969
- type: l,
970
- className: f("btn", `btn-${e}`, n && `btn-${n}`, s),
1003
+ type: a,
1004
+ className: h("btn", `btn-${e}`, r && `btn-${r}`, "rrc-btn", `rrc-btn--${e}`, i),
971
1005
  disabled: d,
972
- "aria-busy": r || void 0,
973
- onClick: d ? void 0 : o,
974
- ...i,
1006
+ "aria-busy": t || void 0,
1007
+ onClick: d ? void 0 : c,
1008
+ ...s,
975
1009
  children: [
976
- r && /* @__PURE__ */ a(Pe, { size: "sm", className: "me-2", label: "" }),
977
- c
1010
+ t && /* @__PURE__ */ o(Br, { size: "sm", className: "me-2", label: "" }),
1011
+ l
978
1012
  ]
979
1013
  }
980
1014
  );
981
1015
  }
982
- function ve({ variant: e = "info", dismissible: n, onDismiss: t, className: r, children: l }) {
983
- return /* @__PURE__ */ p("div", { className: f("alert", `alert-${e}`, n && "alert-dismissible", r), role: "alert", children: [
984
- l,
985
- n && /* @__PURE__ */ a("button", { type: "button", className: "btn-close", "aria-label": "Close", onClick: t })
1016
+ function or({ variant: e = "info", dismissible: r, onDismiss: n, className: t, children: a }) {
1017
+ return /* @__PURE__ */ y("div", { className: h("alert", `alert-${e}`, r && "alert-dismissible", "rrc-alert", `rrc-alert--${e}`, t), role: "alert", children: [
1018
+ a,
1019
+ r && /* @__PURE__ */ o("button", { type: "button", className: "btn-close", "aria-label": "Close", onClick: n })
986
1020
  ] });
987
1021
  }
988
- const pe = ce(null), Fe = 4e3;
989
- function Cn({ children: e }) {
990
- const [n, t] = T([]), r = M(0), l = M(/* @__PURE__ */ new Map());
991
- B(() => {
992
- const i = l.current;
1022
+ const ir = Ve(null), Fr = 4e3;
1023
+ function mt({ children: e }) {
1024
+ const [r, n] = M([]), t = L(0), a = L(/* @__PURE__ */ new Map());
1025
+ U(() => {
1026
+ const s = a.current;
993
1027
  return () => {
994
- i.forEach(clearTimeout), i.clear();
1028
+ s.forEach(clearTimeout), s.clear();
995
1029
  };
996
1030
  }, []);
997
- const s = R((i) => {
998
- const d = l.current.get(i);
999
- d && (clearTimeout(d), l.current.delete(i)), t((u) => u.filter((h) => h.id !== i));
1000
- }, []), c = R(
1001
- (i, d) => {
1002
- const u = r.current++, h = (d == null ? void 0 : d.variant) ?? "info", m = (d == null ? void 0 : d.duration) ?? Fe;
1003
- return t((b) => [...b, { id: u, message: i, variant: h }]), m > 0 && l.current.set(
1031
+ const i = F((s) => {
1032
+ const d = a.current.get(s);
1033
+ d && (clearTimeout(d), a.current.delete(s)), n((u) => u.filter((f) => f.id !== s));
1034
+ }, []), l = F(
1035
+ (s, d) => {
1036
+ const u = t.current++, f = (d == null ? void 0 : d.variant) ?? "info", m = (d == null ? void 0 : d.duration) ?? Fr;
1037
+ return n((p) => [...p, { id: u, message: s, variant: f }]), m > 0 && a.current.set(
1004
1038
  u,
1005
- setTimeout(() => s(u), m)
1039
+ setTimeout(() => i(u), m)
1006
1040
  ), u;
1007
1041
  },
1008
- [s]
1009
- ), o = W(
1042
+ [i]
1043
+ ), c = J(
1010
1044
  () => ({
1011
- show: c,
1012
- dismiss: s,
1013
- success: (i, d) => c(i, { ...d, variant: "success" }),
1014
- error: (i, d) => c(i, { ...d, variant: "danger" }),
1015
- info: (i, d) => c(i, { ...d, variant: "info" }),
1016
- warning: (i, d) => c(i, { ...d, variant: "warning" })
1045
+ show: l,
1046
+ dismiss: i,
1047
+ success: (s, d) => l(s, { ...d, variant: "success" }),
1048
+ error: (s, d) => l(s, { ...d, variant: "danger" }),
1049
+ info: (s, d) => l(s, { ...d, variant: "info" }),
1050
+ warning: (s, d) => l(s, { ...d, variant: "warning" })
1017
1051
  }),
1018
- [c, s]
1052
+ [l, i]
1019
1053
  );
1020
- return /* @__PURE__ */ p(pe.Provider, { value: o, children: [
1054
+ return /* @__PURE__ */ y(ir.Provider, { value: c, children: [
1021
1055
  e,
1022
- /* @__PURE__ */ a("div", { className: "toast-container position-fixed bottom-0 end-0 p-3", style: { zIndex: 1090 }, children: n.map((i) => /* @__PURE__ */ a(ve, { variant: i.variant, dismissible: !0, onDismiss: () => s(i.id), className: "shadow-sm", children: i.message }, i.id)) })
1056
+ /* @__PURE__ */ o("div", { className: "toast-container position-fixed bottom-0 end-0 p-3 rrc-toast-container", style: { zIndex: 1090 }, children: r.map((s) => /* @__PURE__ */ o(or, { variant: s.variant, dismissible: !0, onDismiss: () => i(s.id), className: "shadow-sm", children: s.message }, s.id)) })
1023
1057
  ] });
1024
1058
  }
1025
- function In() {
1026
- const e = de(pe);
1059
+ function ft() {
1060
+ const e = we(ir);
1027
1061
  if (!e)
1028
1062
  throw new Error("useToast must be used within a ToastProvider");
1029
1063
  return e;
1030
1064
  }
1031
- const ge = ce(null);
1032
- function Dn({ children: e }) {
1033
- const [n, t] = T(null), r = R((s) => new Promise((c) => {
1034
- t({ ...s, resolve: c });
1035
- }), []), l = R(
1036
- (s) => {
1037
- n == null || n.resolve(s), t(null);
1065
+ const lr = Ve(null);
1066
+ function ht({ children: e }) {
1067
+ const [r, n] = M(null), t = F((i) => new Promise((l) => {
1068
+ n({ ...i, resolve: l });
1069
+ }), []), a = F(
1070
+ (i) => {
1071
+ r == null || r.resolve(i), n(null);
1038
1072
  },
1039
- [n]
1073
+ [r]
1040
1074
  );
1041
- return /* @__PURE__ */ p(ge.Provider, { value: r, children: [
1075
+ return /* @__PURE__ */ y(lr.Provider, { value: t, children: [
1042
1076
  e,
1043
- /* @__PURE__ */ a(
1044
- Ee,
1077
+ /* @__PURE__ */ o(
1078
+ Vr,
1045
1079
  {
1046
- open: n !== null,
1047
- onClose: () => l(!1),
1048
- title: (n == null ? void 0 : n.title) ?? "Confirm",
1049
- footer: /* @__PURE__ */ p(X, { children: [
1050
- /* @__PURE__ */ a(re, { variant: "outline-secondary", onClick: () => l(!1), children: (n == null ? void 0 : n.cancelLabel) ?? "Cancel" }),
1051
- /* @__PURE__ */ a(re, { variant: (n == null ? void 0 : n.confirmVariant) ?? "danger", onClick: () => l(!0), children: (n == null ? void 0 : n.confirmLabel) ?? "Confirm" })
1080
+ open: r !== null,
1081
+ onClose: () => a(!1),
1082
+ title: (r == null ? void 0 : r.title) ?? "Confirm",
1083
+ footer: /* @__PURE__ */ y(Q, { children: [
1084
+ /* @__PURE__ */ o(ke, { variant: "outline-secondary", onClick: () => a(!1), children: (r == null ? void 0 : r.cancelLabel) ?? "Cancel" }),
1085
+ /* @__PURE__ */ o(ke, { variant: (r == null ? void 0 : r.confirmVariant) ?? "danger", onClick: () => a(!0), children: (r == null ? void 0 : r.confirmLabel) ?? "Confirm" })
1052
1086
  ] }),
1053
- children: n == null ? void 0 : n.message
1087
+ children: r == null ? void 0 : r.message
1054
1088
  }
1055
1089
  )
1056
1090
  ] });
1057
1091
  }
1058
- function Vn() {
1059
- const e = de(ge);
1092
+ function pt() {
1093
+ const e = we(lr);
1060
1094
  if (!e)
1061
1095
  throw new Error("useConfirm must be used within a ConfirmProvider");
1062
1096
  return e;
1063
1097
  }
1064
- function Tn({ variant: e = "primary", pill: n, className: t, children: r }) {
1065
- return /* @__PURE__ */ a("span", { className: f("badge", `bg-${e}`, n && "rounded-pill", t), children: r });
1098
+ function Hr({ variant: e = "primary", appearance: r = "solid", pill: n, className: t, children: a }) {
1099
+ return /* @__PURE__ */ o(
1100
+ "span",
1101
+ {
1102
+ className: h(
1103
+ "badge",
1104
+ // Bootstrap's own solid fill is only correct for the solid appearance;
1105
+ // the tinted forms are painted by this library's stylesheet instead.
1106
+ r === "solid" && `bg-${e}`,
1107
+ n && "rounded-pill",
1108
+ "rrc-badge",
1109
+ `rrc-badge--${e}`,
1110
+ `rrc-badge--${r}`,
1111
+ t
1112
+ ),
1113
+ children: a
1114
+ }
1115
+ );
1066
1116
  }
1067
- function Mn({ items: e, activeKey: n, defaultActiveKey: t, onChange: r, className: l }) {
1068
- var i;
1069
- const [s, c] = V({
1070
- value: n,
1071
- defaultValue: t ?? ((i = e[0]) == null ? void 0 : i.key) ?? "",
1072
- onChange: r
1073
- }), o = e.find((d) => d.key === s);
1074
- return /* @__PURE__ */ p("div", { className: l, children: [
1075
- /* @__PURE__ */ a("ul", { className: "nav nav-tabs", role: "tablist", children: e.map((d) => /* @__PURE__ */ a("li", { className: "nav-item", role: "presentation", children: /* @__PURE__ */ a(
1076
- "button",
1077
- {
1078
- type: "button",
1079
- className: f("nav-link", d.key === s && "active"),
1080
- role: "tab",
1081
- "aria-selected": d.key === s,
1082
- disabled: d.disabled,
1083
- onClick: () => c(d.key),
1084
- children: d.label
1085
- }
1086
- ) }, d.key)) }),
1087
- /* @__PURE__ */ a("div", { className: "tab-content pt-3", role: "tabpanel", children: o == null ? void 0 : o.content })
1117
+ const jr = {
1118
+ sm: "0.875em",
1119
+ lg: "1.5em",
1120
+ xl: "2em"
1121
+ };
1122
+ function Le({ name: e, size: r, className: n, label: t }) {
1123
+ return /* @__PURE__ */ o(
1124
+ "i",
1125
+ {
1126
+ className: h(e, "rrc-icon", n),
1127
+ style: r ? { fontSize: jr[r] } : void 0,
1128
+ role: t ? "img" : void 0,
1129
+ "aria-label": t,
1130
+ "aria-hidden": t ? void 0 : !0
1131
+ }
1132
+ );
1133
+ }
1134
+ function Ur(e) {
1135
+ switch (e) {
1136
+ case "pill":
1137
+ return "nav-pills";
1138
+ case "underline":
1139
+ return "nav-underline";
1140
+ case "card":
1141
+ return "nav-tabs card-header-tabs";
1142
+ default:
1143
+ return "nav-tabs";
1144
+ }
1145
+ }
1146
+ const qr = {
1147
+ sm: "small",
1148
+ lg: "fs-5"
1149
+ };
1150
+ function bt({ items: e, activeKey: r, defaultActiveKey: n, onChange: t, variant: a = "default", orientation: i = "horizontal", size: l, stretch: c, className: s }) {
1151
+ var N;
1152
+ const [d, u] = T({
1153
+ value: r,
1154
+ defaultValue: n ?? ((N = e[0]) == null ? void 0 : N.key) ?? "",
1155
+ onChange: t
1156
+ }), f = e.find((b) => b.key === d), m = a === "button", p = i === "vertical", k = L([]);
1157
+ function S(b, w) {
1158
+ var I;
1159
+ const g = e[b];
1160
+ g && (u(g.key), w && ((I = k.current[b]) == null || I.focus()));
1161
+ }
1162
+ function x(b, w) {
1163
+ var I;
1164
+ if (e.length === 0)
1165
+ return b;
1166
+ let g = b;
1167
+ for (let D = 0; D < e.length; D++)
1168
+ if (g = (g + w + e.length) % e.length, !((I = e[g]) != null && I.disabled))
1169
+ return g;
1170
+ return b;
1171
+ }
1172
+ function _(b) {
1173
+ var D;
1174
+ const w = e.findIndex((O) => O.key === d), g = p ? "ArrowDown" : "ArrowRight", I = p ? "ArrowUp" : "ArrowLeft";
1175
+ if (b.key === g)
1176
+ b.preventDefault(), S(x(w, 1), !0);
1177
+ else if (b.key === I)
1178
+ b.preventDefault(), S(x(w, -1), !0);
1179
+ else if (b.key === "Home") {
1180
+ b.preventDefault();
1181
+ const O = e.findIndex((q) => !q.disabled);
1182
+ O >= 0 && S(O, !0);
1183
+ } else if (b.key === "End") {
1184
+ b.preventDefault();
1185
+ for (let O = e.length - 1; O >= 0; O--)
1186
+ if (!((D = e[O]) != null && D.disabled)) {
1187
+ S(O, !0);
1188
+ break;
1189
+ }
1190
+ }
1191
+ }
1192
+ const C = /* @__PURE__ */ o(
1193
+ "div",
1194
+ {
1195
+ className: h(
1196
+ m ? "btn-group" : "nav",
1197
+ "rrc-tabs__list",
1198
+ `rrc-tabs__list--${a}`,
1199
+ !m && Ur(a),
1200
+ !m && p && "flex-column",
1201
+ !m && c && "nav-fill",
1202
+ !m && l && qr[l]
1203
+ ),
1204
+ role: "tablist",
1205
+ "aria-orientation": i,
1206
+ onKeyDown: _,
1207
+ children: e.map((b, w) => {
1208
+ const g = b.key === d, I = /* @__PURE__ */ y(Q, { children: [
1209
+ b.icon && /* @__PURE__ */ o(Le, { name: b.icon, size: "sm", className: "me-1" }),
1210
+ b.label,
1211
+ b.badge != null && /* @__PURE__ */ o(Hr, { variant: g && !m ? "primary" : "secondary", appearance: "light", pill: !0, className: "ms-2", children: b.badge })
1212
+ ] }), D = /* @__PURE__ */ o(
1213
+ "button",
1214
+ {
1215
+ ref: (O) => {
1216
+ k.current[w] = O;
1217
+ },
1218
+ type: "button",
1219
+ id: `tab-${b.key}`,
1220
+ className: h(m ? h("btn", l ? `btn-${l}` : "btn-sm", g ? "btn-primary" : "btn-outline-primary") : h("nav-link", "rrc-tabs__link", g && "active")),
1221
+ role: "tab",
1222
+ "aria-selected": g,
1223
+ "aria-controls": `tabpanel-${b.key}`,
1224
+ tabIndex: g ? 0 : -1,
1225
+ disabled: b.disabled,
1226
+ onClick: () => S(w, !1),
1227
+ children: I
1228
+ },
1229
+ b.key
1230
+ );
1231
+ return m ? D : /* @__PURE__ */ o("div", { className: "nav-item", role: "presentation", children: D }, b.key);
1232
+ })
1233
+ }
1234
+ ), v = (f == null ? void 0 : f.content) != null && /* @__PURE__ */ o("div", { id: `tabpanel-${f.key}`, className: h("tab-content", "rrc-tabs__panel", !p && "pt-3"), role: "tabpanel", "aria-labelledby": `tab-${f.key}`, children: f.content });
1235
+ return p ? /* @__PURE__ */ y("div", { className: h("d-flex align-items-start gap-3", "rrc-tabs", "rrc-tabs--vertical", s), children: [
1236
+ C,
1237
+ v && /* @__PURE__ */ o("div", { className: "flex-grow-1", children: v })
1238
+ ] }) : /* @__PURE__ */ y("div", { className: h("rrc-tabs", s), children: [
1239
+ C,
1240
+ v
1088
1241
  ] });
1089
1242
  }
1090
- function Le({ items: e, multiple: n = !1, openKeys: t, defaultOpenKeys: r, onChange: l, className: s }) {
1091
- const [c, o] = V({
1092
- value: t,
1093
- defaultValue: r ?? [],
1094
- onChange: l
1095
- }), i = new Set(c);
1243
+ function vt({ items: e, multiple: r = !1, openKeys: n, defaultOpenKeys: t, onChange: a, className: i }) {
1244
+ const [l, c] = T({
1245
+ value: n,
1246
+ defaultValue: t ?? [],
1247
+ onChange: a
1248
+ }), s = new Set(l);
1096
1249
  function d(u) {
1097
- i.has(u) ? o(c.filter((h) => h !== u)) : o(n ? [...c, u] : [u]);
1250
+ s.has(u) ? c(l.filter((f) => f !== u)) : c(r ? [...l, u] : [u]);
1098
1251
  }
1099
- return /* @__PURE__ */ a("div", { className: f("accordion", s), children: e.map((u) => {
1100
- const h = i.has(u.key);
1101
- return /* @__PURE__ */ p("div", { className: "accordion-item", children: [
1102
- /* @__PURE__ */ a("h2", { className: "accordion-header", children: /* @__PURE__ */ a(
1252
+ return /* @__PURE__ */ o("div", { className: h("accordion", "rrc-accordion", i), children: e.map((u) => {
1253
+ const f = s.has(u.key);
1254
+ return /* @__PURE__ */ y("div", { className: "accordion-item rrc-accordion__item", children: [
1255
+ /* @__PURE__ */ o("h2", { className: "accordion-header", children: /* @__PURE__ */ o(
1103
1256
  "button",
1104
1257
  {
1105
1258
  type: "button",
1106
- className: f("accordion-button", !h && "collapsed"),
1107
- "aria-expanded": h,
1259
+ className: h("accordion-button", "rrc-accordion__button", !f && "collapsed"),
1260
+ "aria-expanded": f,
1108
1261
  disabled: u.disabled,
1109
1262
  onClick: () => d(u.key),
1110
1263
  children: u.header
1111
1264
  }
1112
1265
  ) }),
1113
- h && /* @__PURE__ */ a("div", { className: "accordion-collapse", children: /* @__PURE__ */ a("div", { className: "accordion-body", children: u.content }) })
1266
+ f && /* @__PURE__ */ o("div", { className: "accordion-collapse", children: /* @__PURE__ */ o("div", { className: "accordion-body rrc-accordion__body", children: u.content }) })
1114
1267
  ] }, u.key);
1115
1268
  }) });
1116
1269
  }
1117
- function En({ content: e, children: n, placement: t = "top", className: r }) {
1118
- const [l, s] = T(!1), c = M(null), o = P();
1119
- return /* @__PURE__ */ p(
1270
+ function sr({ content: e, children: r, placement: n = "top", className: t, wrapperClassName: a }) {
1271
+ const [i, l] = M(!1), c = L(null), s = W();
1272
+ return /* @__PURE__ */ y(
1120
1273
  "span",
1121
1274
  {
1122
1275
  ref: c,
1123
- className: "position-relative d-inline-block",
1124
- onMouseEnter: () => s(!0),
1125
- onMouseLeave: () => s(!1),
1126
- onFocus: () => s(!0),
1127
- onBlur: () => s(!1),
1128
- "aria-describedby": l ? o : void 0,
1276
+ className: h("position-relative", a ?? "d-inline-block"),
1277
+ onMouseEnter: () => l(!0),
1278
+ onMouseLeave: () => l(!1),
1279
+ onFocus: () => l(!0),
1280
+ onBlur: () => l(!1),
1281
+ "aria-describedby": i ? s : void 0,
1129
1282
  children: [
1130
- n,
1131
- /* @__PURE__ */ a(
1132
- G,
1283
+ r,
1284
+ /* @__PURE__ */ o(
1285
+ oe,
1133
1286
  {
1134
- open: l,
1135
- onClose: () => s(!1),
1287
+ open: i,
1288
+ onClose: () => l(!1),
1136
1289
  anchorRef: c,
1137
- className: f("tooltip show", `bs-tooltip-${t}`, "position-absolute", "w-auto", r),
1138
- children: /* @__PURE__ */ a("span", { id: o, role: "tooltip", className: "tooltip-inner", children: e })
1290
+ className: h("tooltip show", `bs-tooltip-${n}`, "position-absolute", "w-auto", "rrc-tooltip", t),
1291
+ children: /* @__PURE__ */ o("span", { id: s, role: "tooltip", className: "tooltip-inner", children: e })
1139
1292
  }
1140
1293
  )
1141
1294
  ]
1142
1295
  }
1143
1296
  );
1144
1297
  }
1145
- function Rn({ title: e, content: n, children: t, placement: r = "bottom", className: l }) {
1146
- const [s, c] = T(!1), o = M(null);
1147
- return /* @__PURE__ */ p("span", { ref: o, className: "position-relative d-inline-block", onClick: () => c((i) => !i), children: [
1148
- t,
1149
- /* @__PURE__ */ p(
1150
- G,
1298
+ function gt({ title: e, content: r, children: n, placement: t = "bottom", className: a }) {
1299
+ const [i, l] = M(!1), c = L(null);
1300
+ return /* @__PURE__ */ y("span", { ref: c, className: "position-relative d-inline-block", onClick: () => l((s) => !s), children: [
1301
+ n,
1302
+ /* @__PURE__ */ y(
1303
+ oe,
1151
1304
  {
1152
- open: s,
1153
- onClose: () => c(!1),
1154
- anchorRef: o,
1155
- className: f("popover show", `bs-popover-${r}`, "position-absolute", "w-auto", l),
1305
+ open: i,
1306
+ onClose: () => l(!1),
1307
+ anchorRef: c,
1308
+ className: h("popover show", `bs-popover-${t}`, "position-absolute", "w-auto", "rrc-popover", a),
1156
1309
  children: [
1157
- e && /* @__PURE__ */ a("h3", { className: "popover-header", children: e }),
1158
- /* @__PURE__ */ a("div", { className: "popover-body", children: n })
1310
+ e && /* @__PURE__ */ o("h3", { className: "popover-header rrc-popover__header", children: e }),
1311
+ /* @__PURE__ */ o("div", { className: "popover-body rrc-popover__body", children: r })
1159
1312
  ]
1160
1313
  }
1161
1314
  )
1162
1315
  ] });
1163
1316
  }
1164
- function $n({ header: e, footer: n, className: t, children: r }) {
1165
- return /* @__PURE__ */ p("div", { className: f("card", t), children: [
1166
- e && /* @__PURE__ */ a("div", { className: "card-header", children: e }),
1167
- /* @__PURE__ */ a("div", { className: "card-body", children: r }),
1168
- n && /* @__PURE__ */ a("div", { className: "card-footer", children: n })
1169
- ] });
1317
+ function ye({ width: e = "100%", height: r = "1rem", circle: n, className: t }) {
1318
+ return /* @__PURE__ */ o("span", { className: h("placeholder-glow d-inline-block", "rrc-skeleton", t), style: { width: e, height: r }, "aria-hidden": "true", children: /* @__PURE__ */ o("span", { className: h("placeholder w-100 h-100 d-block", n && "rounded-circle") }) });
1170
1319
  }
1171
- function On({ className: e, vertical: n, label: t }) {
1172
- return n ? /* @__PURE__ */ a("div", { className: f("vr", e), role: "separator", "aria-orientation": "vertical" }) : t ? /* @__PURE__ */ p("div", { className: f("d-flex align-items-center gap-2 my-3", e), role: "separator", children: [
1173
- /* @__PURE__ */ a("hr", { className: "flex-grow-1 m-0" }),
1174
- /* @__PURE__ */ a("span", { className: "text-body-secondary small", children: t }),
1175
- /* @__PURE__ */ a("hr", { className: "flex-grow-1 m-0" })
1176
- ] }) : /* @__PURE__ */ a("hr", { className: f("my-3", e), role: "separator" });
1177
- }
1178
- function An({ direction: e = "column", gap: n = 2, align: t, justify: r, wrap: l, className: s, children: c }) {
1179
- return /* @__PURE__ */ a(
1320
+ function cr({ direction: e = "column", gap: r = 2, align: n, justify: t, wrap: a, className: i, children: l }) {
1321
+ return /* @__PURE__ */ o(
1180
1322
  "div",
1181
1323
  {
1182
- className: f(
1324
+ className: h(
1183
1325
  "d-flex",
1326
+ "rrc-stack",
1184
1327
  e === "row" ? "flex-row" : "flex-column",
1185
- `gap-${n}`,
1186
- t && `align-items-${t}`,
1187
- r && `justify-content-${r}`,
1188
- l && "flex-wrap",
1189
- s
1328
+ `gap-${r}`,
1329
+ n && `align-items-${n}`,
1330
+ t && `justify-content-${t}`,
1331
+ a && "flex-wrap",
1332
+ i
1190
1333
  ),
1191
- children: c
1334
+ children: l
1192
1335
  }
1193
1336
  );
1194
1337
  }
1195
- function Pn({ fluid: e, className: n, children: t }) {
1196
- return /* @__PURE__ */ a("div", { className: f(e ? "container-fluid" : "container", n), children: t });
1338
+ const zr = {
1339
+ xs: "0.75rem",
1340
+ sm: "0.875rem",
1341
+ md: "1rem",
1342
+ lg: "1.25rem",
1343
+ xl: "1.5rem"
1344
+ }, Wr = {
1345
+ normal: "fw-normal",
1346
+ medium: "fw-medium",
1347
+ semibold: "fw-semibold",
1348
+ bold: "fw-bold"
1349
+ }, Gr = {
1350
+ default: void 0,
1351
+ muted: "text-body-secondary",
1352
+ primary: "text-primary",
1353
+ success: "text-success",
1354
+ danger: "text-danger",
1355
+ warning: "text-warning",
1356
+ info: "text-info"
1357
+ };
1358
+ function te({ as: e, size: r = "md", weight: n, tone: t = "default", align: a, truncate: i, wrap: l = !0, className: c, children: s }) {
1359
+ return /* @__PURE__ */ o(
1360
+ e ?? "span",
1361
+ {
1362
+ className: h(
1363
+ "rrc-text",
1364
+ n && Wr[n],
1365
+ Gr[t],
1366
+ a && `text-${a}`,
1367
+ i && "text-truncate",
1368
+ !l && !i && "text-nowrap",
1369
+ c
1370
+ ),
1371
+ style: { fontSize: zr[r] },
1372
+ children: s
1373
+ }
1374
+ );
1375
+ }
1376
+ function Jr({ title: e, subtitle: r, icon: n, avatar: t, actions: a }) {
1377
+ return /* @__PURE__ */ y("div", { className: "d-flex align-items-center justify-content-between gap-3 rrc-card__header-row", children: [
1378
+ /* @__PURE__ */ y("div", { className: "d-flex align-items-center gap-3", style: { minWidth: 0 }, children: [
1379
+ t || n && /* @__PURE__ */ o("span", { className: "fs-2 lh-1", children: n }),
1380
+ (e || r) && /* @__PURE__ */ y("div", { style: { minWidth: 0 }, children: [
1381
+ e && /* @__PURE__ */ o(te, { as: "div", size: "lg", weight: "semibold", truncate: !0, children: e }),
1382
+ r && /* @__PURE__ */ o(te, { as: "div", size: "sm", tone: "muted", truncate: !0, children: r })
1383
+ ] })
1384
+ ] }),
1385
+ a && /* @__PURE__ */ o("div", { className: "d-flex align-items-center gap-2 flex-shrink-0", children: a })
1386
+ ] });
1387
+ }
1388
+ function yt({ title: e, subtitle: r, icon: n, avatar: t, actions: a, header: i, footer: l, loading: c, className: s, children: d }) {
1389
+ const f = i ?? (!!(e || r || n || t || a) ? /* @__PURE__ */ o(Jr, { title: e, subtitle: r, icon: n, avatar: t, actions: a }) : void 0);
1390
+ return /* @__PURE__ */ y("div", { className: h("card", "rrc-card", s), children: [
1391
+ f && /* @__PURE__ */ o("div", { className: "card-header rrc-card__header", children: f }),
1392
+ /* @__PURE__ */ o("div", { className: "card-body rrc-card__body", children: c ? /* @__PURE__ */ y(cr, { gap: 2, children: [
1393
+ /* @__PURE__ */ o(ye, { height: "1rem", width: "60%" }),
1394
+ /* @__PURE__ */ o(ye, { height: "1rem" }),
1395
+ /* @__PURE__ */ o(ye, { height: "1rem", width: "80%" })
1396
+ ] }) : d }),
1397
+ l && /* @__PURE__ */ o("div", { className: "card-footer rrc-card__footer", children: l })
1398
+ ] });
1197
1399
  }
1198
- function Fn({ className: e, children: n }) {
1199
- return /* @__PURE__ */ a("div", { className: f("row", e), children: n });
1400
+ function Zr({ className: e, vertical: r, label: n }) {
1401
+ return r ? /* @__PURE__ */ o("div", { className: h("vr", "rrc-divider", e), role: "separator", "aria-orientation": "vertical" }) : n ? /* @__PURE__ */ y("div", { className: h("d-flex align-items-center gap-2 my-3", "rrc-divider", "rrc-divider--labelled", e), role: "separator", children: [
1402
+ /* @__PURE__ */ o("hr", { className: "flex-grow-1 m-0" }),
1403
+ /* @__PURE__ */ o("span", { className: "text-body-secondary small", children: n }),
1404
+ /* @__PURE__ */ o("hr", { className: "flex-grow-1 m-0" })
1405
+ ] }) : /* @__PURE__ */ o("hr", { className: h("my-3", "rrc-divider", e), role: "separator" });
1200
1406
  }
1201
- function Ln({ span: e, sm: n, md: t, lg: r, xl: l, className: s, children: c }) {
1202
- return /* @__PURE__ */ a(
1407
+ function Nt({ fluid: e, className: r, children: n }) {
1408
+ return /* @__PURE__ */ o("div", { className: h(e ? "container-fluid" : "container", "rrc-container", r), children: n });
1409
+ }
1410
+ function kt({ className: e, children: r }) {
1411
+ return /* @__PURE__ */ o("div", { className: h("row", "rrc-row", e), children: r });
1412
+ }
1413
+ function wt({ span: e, sm: r, md: n, lg: t, xl: a, className: i, children: l }) {
1414
+ return /* @__PURE__ */ o(
1203
1415
  "div",
1204
1416
  {
1205
- className: f(
1417
+ className: h(
1206
1418
  e ? `col-${e}` : "col",
1207
- n ? `col-sm-${n}` : void 0,
1208
- t ? `col-md-${t}` : void 0,
1209
- r ? `col-lg-${r}` : void 0,
1210
- l ? `col-xl-${l}` : void 0,
1211
- s
1419
+ "rrc-col",
1420
+ r ? `col-sm-${r}` : void 0,
1421
+ n ? `col-md-${n}` : void 0,
1422
+ t ? `col-lg-${t}` : void 0,
1423
+ a ? `col-xl-${a}` : void 0,
1424
+ i
1212
1425
  ),
1213
- children: c
1426
+ children: l
1214
1427
  }
1215
1428
  );
1216
1429
  }
1217
- function Ke({ items: e, className: n }) {
1218
- return /* @__PURE__ */ a("nav", { "aria-label": "breadcrumb", className: n, children: /* @__PURE__ */ a("ol", { className: "breadcrumb mb-0", children: e.map((t, r) => {
1219
- const l = r === e.length - 1, s = !l && (t.href || t.onClick);
1220
- return /* @__PURE__ */ a("li", { className: f("breadcrumb-item", l && "active"), "aria-current": l ? "page" : void 0, children: s ? /* @__PURE__ */ a(
1430
+ function Yr({ items: e, className: r }) {
1431
+ return /* @__PURE__ */ o("nav", { "aria-label": "breadcrumb", className: h("rrc-breadcrumb", r), children: /* @__PURE__ */ o("ol", { className: "breadcrumb mb-0 rrc-breadcrumb__list", children: e.map((n, t) => {
1432
+ const a = t === e.length - 1, i = !a && (n.href || n.onClick);
1433
+ return /* @__PURE__ */ o("li", { className: h("breadcrumb-item", a && "active"), "aria-current": a ? "page" : void 0, children: i ? /* @__PURE__ */ o(
1221
1434
  "a",
1222
1435
  {
1223
- href: t.href ?? "#",
1224
- onClick: (c) => {
1225
- var o;
1226
- t.href || c.preventDefault(), (o = t.onClick) == null || o.call(t);
1436
+ href: n.href ?? "#",
1437
+ onClick: (l) => {
1438
+ var c;
1439
+ n.href || l.preventDefault(), (c = n.onClick) == null || c.call(n);
1227
1440
  },
1228
- children: t.label
1441
+ children: n.label
1229
1442
  }
1230
- ) : t.label }, r);
1443
+ ) : n.label }, t);
1231
1444
  }) }) });
1232
1445
  }
1233
- function Kn({ items: e, children: n, placement: t = "start", className: r }) {
1234
- const [l, s] = T(!1), c = M(null), o = R(() => s(!1), []), i = R(
1446
+ function _t({ items: e, children: r, placement: n = "start", className: t }) {
1447
+ const [a, i] = M(!1), l = L(null), c = F(() => i(!1), []), s = F(
1235
1448
  (m) => {
1236
- var v;
1237
- const b = e[m];
1238
- !b || b.disabled || ((v = b.onSelect) == null || v.call(b), o());
1449
+ var k;
1450
+ const p = e[m];
1451
+ !p || p.disabled || ((k = p.onSelect) == null || k.call(p), c());
1239
1452
  },
1240
- [e, o]
1241
- ), { activeIndex: d, setActiveIndex: u, handleKeyDown: h } = ee({
1453
+ [e, c]
1454
+ ), { activeIndex: d, setActiveIndex: u, handleKeyDown: f } = xe({
1242
1455
  itemCount: e.length,
1243
- isOpen: l,
1244
- onSelect: i,
1245
- onClose: o
1456
+ isOpen: a,
1457
+ onSelect: s,
1458
+ onClose: c
1246
1459
  });
1247
- return /* @__PURE__ */ p(
1460
+ return /* @__PURE__ */ y(
1248
1461
  "span",
1249
1462
  {
1250
- ref: c,
1463
+ ref: l,
1251
1464
  className: "position-relative d-inline-block",
1252
- onClick: () => s((m) => !m),
1253
- onKeyDown: h,
1465
+ onClick: () => i((m) => !m),
1466
+ onKeyDown: f,
1254
1467
  children: [
1255
- n,
1256
- /* @__PURE__ */ a(
1257
- G,
1468
+ r,
1469
+ /* @__PURE__ */ o(
1470
+ oe,
1258
1471
  {
1259
- open: l,
1260
- onClose: o,
1261
- anchorRef: c,
1472
+ open: a,
1473
+ onClose: c,
1474
+ anchorRef: l,
1262
1475
  role: "menu",
1263
- className: f("dropdown-menu show", t === "end" && "dropdown-menu-end", r),
1264
- children: e.map((m, b) => /* @__PURE__ */ a(
1476
+ className: h("dropdown-menu show", n === "end" && "dropdown-menu-end", "rrc-menu", t),
1477
+ children: e.map((m, p) => /* @__PURE__ */ o(
1265
1478
  "button",
1266
1479
  {
1267
1480
  type: "button",
1268
1481
  role: "menuitem",
1269
- className: f("dropdown-item", b === d && "active", m.disabled && "disabled", m.danger && "text-danger"),
1482
+ className: h("dropdown-item", "rrc-menu__item", p === d && "active", m.disabled && "disabled", m.danger && "text-danger"),
1270
1483
  disabled: m.disabled,
1271
- onMouseEnter: () => u(b),
1272
- onMouseDown: (v) => v.preventDefault(),
1273
- onClick: (v) => {
1274
- v.stopPropagation(), i(b);
1484
+ onMouseEnter: () => u(p),
1485
+ onMouseDown: (k) => k.preventDefault(),
1486
+ onClick: (k) => {
1487
+ k.stopPropagation(), s(p);
1275
1488
  },
1276
1489
  children: m.label
1277
1490
  },
@@ -1283,67 +1496,67 @@ function Kn({ items: e, children: n, placement: t = "start", className: r }) {
1283
1496
  }
1284
1497
  );
1285
1498
  }
1286
- function jn({ steps: e, currentStep: n, className: t }) {
1287
- return /* @__PURE__ */ a("ol", { className: f("d-flex list-unstyled align-items-center", t), children: e.map((r, l) => {
1288
- const s = l < n ? "complete" : l === n ? "active" : "upcoming", c = l === e.length - 1;
1289
- return /* @__PURE__ */ p("li", { className: f("d-flex align-items-center", !c && "flex-grow-1"), children: [
1290
- /* @__PURE__ */ p("div", { className: "d-flex align-items-center gap-2", children: [
1291
- /* @__PURE__ */ a(
1499
+ function xt({ steps: e, currentStep: r, className: n }) {
1500
+ return /* @__PURE__ */ o("ol", { className: h("d-flex list-unstyled align-items-center", "rrc-stepper", n), children: e.map((t, a) => {
1501
+ const i = a < r ? "complete" : a === r ? "active" : "upcoming", l = a === e.length - 1;
1502
+ return /* @__PURE__ */ y("li", { className: h("d-flex align-items-center", !l && "flex-grow-1"), children: [
1503
+ /* @__PURE__ */ y("div", { className: "d-flex align-items-center gap-2", children: [
1504
+ /* @__PURE__ */ o(
1292
1505
  "span",
1293
1506
  {
1294
- className: f(
1507
+ className: h(
1295
1508
  "d-flex align-items-center justify-content-center rounded-circle flex-shrink-0",
1296
- s === "complete" ? "bg-primary text-white" : s === "active" ? "border border-primary text-primary" : "border text-body-secondary"
1509
+ i === "complete" ? "bg-primary text-white" : i === "active" ? "border border-primary text-primary" : "border text-body-secondary"
1297
1510
  ),
1298
1511
  style: { width: "2rem", height: "2rem" },
1299
- "aria-current": s === "active" ? "step" : void 0,
1300
- children: s === "complete" ? "✓" : l + 1
1512
+ "aria-current": i === "active" ? "step" : void 0,
1513
+ children: i === "complete" ? "✓" : a + 1
1301
1514
  }
1302
1515
  ),
1303
- /* @__PURE__ */ p("div", { children: [
1304
- /* @__PURE__ */ a("div", { className: f("small fw-semibold", s === "upcoming" && "text-body-secondary"), children: r.label }),
1305
- r.description && /* @__PURE__ */ a("div", { className: "small text-body-secondary", children: r.description })
1516
+ /* @__PURE__ */ y("div", { children: [
1517
+ /* @__PURE__ */ o("div", { className: h("small fw-semibold", i === "upcoming" && "text-body-secondary"), children: t.label }),
1518
+ t.description && /* @__PURE__ */ o("div", { className: "small text-body-secondary", children: t.description })
1306
1519
  ] })
1307
1520
  ] }),
1308
- !c && /* @__PURE__ */ a("hr", { className: "flex-grow-1 mx-2" })
1309
- ] }, r.key);
1521
+ !l && /* @__PURE__ */ o("hr", { className: "flex-grow-1 mx-2" })
1522
+ ] }, t.key);
1310
1523
  }) });
1311
1524
  }
1312
- function je(e) {
1313
- var l, s;
1314
- const n = e.trim().split(/\s+/), t = ((l = n[0]) == null ? void 0 : l[0]) ?? "", r = n.length > 1 ? ((s = n[n.length - 1]) == null ? void 0 : s[0]) ?? "" : "";
1315
- return (t + r).toUpperCase();
1525
+ function Qr(e) {
1526
+ var a, i;
1527
+ const r = e.trim().split(/\s+/), n = ((a = r[0]) == null ? void 0 : a[0]) ?? "", t = r.length > 1 ? ((i = r[r.length - 1]) == null ? void 0 : i[0]) ?? "" : "";
1528
+ return (n + t).toUpperCase();
1316
1529
  }
1317
- const Be = {
1530
+ const Xr = {
1318
1531
  sm: "1.75rem",
1319
1532
  md: "2.5rem",
1320
1533
  lg: "3.5rem"
1321
1534
  };
1322
- function Bn({ src: e, name: n, size: t = "md", className: r }) {
1323
- const l = Be[t];
1324
- return e ? /* @__PURE__ */ a(
1535
+ function St({ src: e, name: r, size: n = "md", className: t }) {
1536
+ const a = Xr[n];
1537
+ return e ? /* @__PURE__ */ o(
1325
1538
  "img",
1326
1539
  {
1327
1540
  src: e,
1328
- alt: n ?? "",
1329
- className: f("rounded-circle", r),
1330
- style: { width: l, height: l, objectFit: "cover" }
1541
+ alt: r ?? "",
1542
+ className: h("rounded-circle", "rrc-avatar", t),
1543
+ style: { width: a, height: a, objectFit: "cover" }
1331
1544
  }
1332
- ) : /* @__PURE__ */ a(
1545
+ ) : /* @__PURE__ */ o(
1333
1546
  "span",
1334
1547
  {
1335
- className: f("d-inline-flex align-items-center justify-content-center rounded-circle bg-secondary text-white", r),
1336
- style: { width: l, height: l, fontSize: `calc(${l} * 0.4)` },
1337
- role: n ? "img" : void 0,
1338
- "aria-label": n,
1339
- children: n ? je(n) : null
1548
+ className: h("d-inline-flex align-items-center justify-content-center rounded-circle bg-secondary text-white", "rrc-avatar", "rrc-avatar--initials", t),
1549
+ style: { width: a, height: a, fontSize: `calc(${a} * 0.4)` },
1550
+ role: r ? "img" : void 0,
1551
+ "aria-label": r,
1552
+ children: r ? Qr(r) : null
1340
1553
  }
1341
1554
  );
1342
1555
  }
1343
- function Hn({ variant: e = "secondary", onRemove: n, className: t, children: r }) {
1344
- return /* @__PURE__ */ p("span", { className: f("badge d-inline-flex align-items-center gap-1", `bg-${e}`, t), children: [
1345
- r,
1346
- n && /* @__PURE__ */ a(
1556
+ function Ct({ variant: e = "secondary", appearance: r = "solid", onRemove: n, className: t, children: a }) {
1557
+ return /* @__PURE__ */ y("span", { className: h("badge d-inline-flex align-items-center gap-1", r === "solid" && `bg-${e}`, "rrc-tag", `rrc-tag--${e}`, `rrc-tag--${r}`, t), children: [
1558
+ a,
1559
+ n && /* @__PURE__ */ o(
1347
1560
  "button",
1348
1561
  {
1349
1562
  type: "button",
@@ -1355,234 +1568,1169 @@ function Hn({ variant: e = "secondary", onRemove: n, className: t, children: r }
1355
1568
  )
1356
1569
  ] });
1357
1570
  }
1358
- function qn({ width: e = "100%", height: n = "1rem", circle: t, className: r }) {
1359
- return /* @__PURE__ */ a("span", { className: f("placeholder-glow d-inline-block", r), style: { width: e, height: n }, "aria-hidden": "true", children: /* @__PURE__ */ a("span", { className: f("placeholder w-100 h-100 d-block", t && "rounded-circle") }) });
1360
- }
1361
- function Un({
1571
+ function It({
1362
1572
  value: e,
1363
- defaultValue: n,
1364
- onChange: t,
1365
- min: r = 0,
1366
- max: l = 100,
1367
- step: s = 1,
1368
- id: c,
1369
- name: o,
1370
- disabled: i,
1573
+ defaultValue: r,
1574
+ onChange: n,
1575
+ min: t = 0,
1576
+ max: a = 100,
1577
+ step: i = 1,
1578
+ id: l,
1579
+ name: c,
1580
+ disabled: s,
1371
1581
  required: d,
1372
1582
  className: u,
1373
- label: h,
1583
+ label: f,
1374
1584
  helpText: m,
1375
- error: b
1585
+ error: p
1376
1586
  }) {
1377
- const [v, x] = V({
1587
+ const [k, S] = T({
1378
1588
  value: e,
1379
- defaultValue: n ?? r,
1380
- onChange: t
1381
- }), N = P(), g = c ?? N;
1382
- return /* @__PURE__ */ p(K, { id: g, label: h, required: d, error: b, helpText: m, className: u, children: [
1383
- /* @__PURE__ */ a(
1589
+ defaultValue: r ?? t,
1590
+ onChange: n
1591
+ }), x = W(), _ = l ?? x;
1592
+ return /* @__PURE__ */ y(Y, { id: _, label: f, required: d, error: p, helpText: m, className: u, children: [
1593
+ /* @__PURE__ */ o(
1384
1594
  "input",
1385
1595
  {
1386
- id: g,
1387
- name: o,
1596
+ id: _,
1597
+ name: c,
1388
1598
  type: "range",
1389
- className: "form-range",
1390
- disabled: i,
1599
+ className: "form-range rrc-range",
1600
+ disabled: s,
1391
1601
  required: d,
1392
- min: r,
1393
- max: l,
1394
- step: s,
1395
- value: v,
1396
- onChange: (w) => x(Number(w.target.value))
1602
+ min: t,
1603
+ max: a,
1604
+ step: i,
1605
+ value: k,
1606
+ onChange: (C) => S(Number(C.target.value))
1397
1607
  }
1398
1608
  ),
1399
- /* @__PURE__ */ a("div", { className: "small text-body-secondary", children: v })
1609
+ /* @__PURE__ */ o("div", { className: "small text-body-secondary", children: k })
1400
1610
  ] });
1401
1611
  }
1402
- function Gn({ value: e, defaultValue: n, onChange: t, max: r = 5, disabled: l, className: s }) {
1403
- const [c, o] = V({
1612
+ function Et({ value: e, defaultValue: r, onChange: n, max: t = 5, disabled: a, className: i }) {
1613
+ const [l, c] = T({
1404
1614
  value: e,
1405
- defaultValue: n ?? 0,
1406
- onChange: t
1615
+ defaultValue: r ?? 0,
1616
+ onChange: n
1407
1617
  });
1408
- return /* @__PURE__ */ a("div", { className: f("d-inline-flex gap-1", s), role: "radiogroup", "aria-label": "Rating", children: Array.from({ length: r }, (i, d) => d + 1).map((i) => /* @__PURE__ */ a(
1618
+ return /* @__PURE__ */ o("div", { className: h("d-inline-flex gap-1", "rrc-rating", i), role: "radiogroup", "aria-label": "Rating", children: Array.from({ length: t }, (s, d) => d + 1).map((s) => /* @__PURE__ */ o(
1409
1619
  "button",
1410
1620
  {
1411
1621
  type: "button",
1412
- className: "btn btn-link p-0 border-0",
1413
- disabled: l,
1622
+ className: "btn btn-link p-0 border-0 rrc-rating__star",
1623
+ disabled: a,
1414
1624
  role: "radio",
1415
- "aria-checked": i === c,
1416
- "aria-label": `${i} star${i > 1 ? "s" : ""}`,
1417
- onClick: () => o(i),
1418
- children: /* @__PURE__ */ a("span", { "aria-hidden": "true", style: { fontSize: "1.25rem", color: i <= c ? "#f5b301" : "#ced4da" }, children: "★" })
1625
+ "aria-checked": s === l,
1626
+ "aria-label": `${s} star${s > 1 ? "s" : ""}`,
1627
+ onClick: () => c(s),
1628
+ children: /* @__PURE__ */ o("span", { "aria-hidden": "true", style: { fontSize: "1.25rem", color: s <= l ? "#f5b301" : "#ced4da" }, children: "★" })
1419
1629
  },
1420
- i
1630
+ s
1421
1631
  )) });
1422
1632
  }
1423
- function _n({ value: e, variant: n = "primary", label: t, className: r }) {
1424
- const l = Math.max(0, Math.min(100, e));
1425
- return /* @__PURE__ */ a("div", { className: f("progress", r), role: "progressbar", "aria-valuenow": l, "aria-valuemin": 0, "aria-valuemax": 100, children: /* @__PURE__ */ a("div", { className: f("progress-bar", `bg-${n}`), style: { width: `${l}%` }, children: t ? `${Math.round(l)}%` : null }) });
1426
- }
1427
- const He = {
1428
- sm: "0.875em",
1429
- lg: "1.5em",
1430
- xl: "2em"
1431
- };
1432
- function Jn({ name: e, size: n, className: t, label: r }) {
1433
- return /* @__PURE__ */ a(
1434
- "i",
1435
- {
1436
- className: f(e, t),
1437
- style: n ? { fontSize: He[n] } : void 0,
1438
- role: r ? "img" : void 0,
1439
- "aria-label": r,
1440
- "aria-hidden": r ? void 0 : !0
1441
- }
1442
- );
1633
+ function At({ value: e, variant: r = "primary", label: n, className: t }) {
1634
+ const a = Math.max(0, Math.min(100, e));
1635
+ return /* @__PURE__ */ o("div", { className: h("progress", "rrc-progress", t), role: "progressbar", "aria-valuenow": a, "aria-valuemin": 0, "aria-valuemax": 100, children: /* @__PURE__ */ o("div", { className: h("progress-bar", "rrc-progress__bar", `bg-${r}`), style: { width: `${a}%` }, children: n ? `${Math.round(a)}%` : null }) });
1443
1636
  }
1444
- function Yn({ brand: e, start: n, end: t, variant: r = "light", className: l }) {
1445
- return /* @__PURE__ */ a(
1637
+ function Dt({ brand: e, start: r, end: n, variant: t = "light", className: a }) {
1638
+ return /* @__PURE__ */ o(
1446
1639
  "nav",
1447
1640
  {
1448
- className: f(
1641
+ className: h(
1449
1642
  "navbar navbar-expand-lg border-bottom",
1450
- r === "dark" ? "navbar-dark bg-dark" : "navbar-light bg-light",
1451
- l
1643
+ "rrc-navbar",
1644
+ t === "dark" ? "navbar-dark bg-dark" : "navbar-light bg-light",
1645
+ a
1452
1646
  ),
1453
- children: /* @__PURE__ */ p("div", { className: "container-fluid", children: [
1454
- e && /* @__PURE__ */ a("span", { className: "navbar-brand mb-0", children: e }),
1455
- n && /* @__PURE__ */ a("div", { className: "d-flex align-items-center gap-3", children: n }),
1456
- t && /* @__PURE__ */ a("div", { className: "d-flex align-items-center gap-3 ms-auto", children: t })
1647
+ children: /* @__PURE__ */ y("div", { className: "container-fluid", children: [
1648
+ e && /* @__PURE__ */ o("span", { className: "navbar-brand mb-0", children: e }),
1649
+ r && /* @__PURE__ */ o("div", { className: "d-flex align-items-center gap-3", children: r }),
1650
+ n && /* @__PURE__ */ o("div", { className: "d-flex align-items-center gap-3 ms-auto", children: n })
1457
1651
  ] })
1458
1652
  }
1459
1653
  );
1460
1654
  }
1461
- function qe(e) {
1655
+ const dr = [
1656
+ "primary",
1657
+ "primaryActive",
1658
+ "primaryLight",
1659
+ "primaryInverse",
1660
+ "primaryRgb",
1661
+ "componentActiveColor",
1662
+ "componentActiveBg",
1663
+ "componentHoverColor",
1664
+ "componentHoverBg",
1665
+ "componentCheckedColor",
1666
+ "componentCheckedBg",
1667
+ "menuLinkColorHover",
1668
+ "menuLinkColorShow",
1669
+ "menuLinkColorHere",
1670
+ "menuLinkColorActive"
1671
+ ];
1672
+ function en(e) {
1673
+ if (typeof e != "object" || e === null)
1674
+ return !1;
1675
+ const r = e;
1676
+ if (typeof r.id != "string" || r.id.length === 0 || typeof r.tokens != "object" || r.tokens === null)
1677
+ return !1;
1678
+ const n = r.tokens;
1679
+ return dr.every((t) => typeof n[t] == "string" && n[t].length > 0);
1680
+ }
1681
+ function ve(e) {
1682
+ const { id: r, primary: n, primaryActive: t, primaryLight: a, primaryInverse: i, primaryRgb: l, swatch: c } = e;
1683
+ return {
1684
+ id: r,
1685
+ ...c !== void 0 ? { swatch: c } : {},
1686
+ tokens: {
1687
+ primary: n,
1688
+ primaryActive: t,
1689
+ primaryLight: a,
1690
+ primaryInverse: i,
1691
+ primaryRgb: l,
1692
+ componentActiveColor: i,
1693
+ componentActiveBg: n,
1694
+ componentHoverColor: t,
1695
+ componentHoverBg: a,
1696
+ componentCheckedColor: i,
1697
+ componentCheckedBg: n,
1698
+ menuLinkColorHover: t,
1699
+ menuLinkColorShow: t,
1700
+ menuLinkColorHere: t,
1701
+ menuLinkColorActive: n
1702
+ }
1703
+ };
1704
+ }
1705
+ const rn = [
1706
+ ve({
1707
+ id: "blue",
1708
+ primary: "#0d6efd",
1709
+ primaryActive: "#0a58ca",
1710
+ primaryLight: "#cfe2ff",
1711
+ primaryInverse: "#ffffff",
1712
+ primaryRgb: "13, 110, 253"
1713
+ }),
1714
+ ve({
1715
+ id: "indigo",
1716
+ primary: "#6610f2",
1717
+ primaryActive: "#520dc2",
1718
+ primaryLight: "#e0cffc",
1719
+ primaryInverse: "#ffffff",
1720
+ primaryRgb: "102, 16, 242"
1721
+ }),
1722
+ // Deliberately taken from the deeper end of Bootstrap's teal ramp: a scheme
1723
+ // must carry usable contrast values, and `--bs-teal` (#20c997) is a surface
1724
+ // color that measures ~2:1 as text on white.
1725
+ ve({
1726
+ id: "teal",
1727
+ primary: "#13795b",
1728
+ primaryActive: "#0d503c",
1729
+ primaryLight: "#d2f4ea",
1730
+ primaryInverse: "#ffffff",
1731
+ primaryRgb: "19, 121, 91",
1732
+ swatch: "#20c997"
1733
+ }),
1734
+ ve({
1735
+ id: "green",
1736
+ primary: "#198754",
1737
+ primaryActive: "#146c43",
1738
+ primaryLight: "#d1e7dd",
1739
+ primaryInverse: "#ffffff",
1740
+ primaryRgb: "25, 135, 84"
1741
+ })
1742
+ ], Re = "blue", ce = new Map(rn.map((e) => [e.id, e]));
1743
+ function Tt(e) {
1744
+ if (!en(e))
1745
+ throw new Error(
1746
+ "[react-components] registerColorScheme() requires a complete token family: " + dr.join(", ") + "."
1747
+ );
1748
+ ce.set(e.id, e);
1749
+ }
1750
+ function nn(e) {
1751
+ return ce.get(e);
1752
+ }
1753
+ function tn() {
1754
+ return [...ce.values()];
1755
+ }
1756
+ function an(e) {
1757
+ const r = e !== void 0 ? ce.get(e) : void 0;
1758
+ return r || ce.get(Re);
1759
+ }
1760
+ function on(e) {
1761
+ const r = e.tokens;
1762
+ return {
1763
+ "--bs-primary": r.primary,
1764
+ "--bs-primary-rgb": r.primaryRgb,
1765
+ "--bs-primary-active": r.primaryActive,
1766
+ "--bs-primary-light": r.primaryLight,
1767
+ "--bs-primary-inverse": r.primaryInverse,
1768
+ "--bs-component-active-color": r.componentActiveColor,
1769
+ "--bs-component-active-bg": r.componentActiveBg,
1770
+ "--bs-component-hover-color": r.componentHoverColor,
1771
+ "--bs-component-hover-bg": r.componentHoverBg,
1772
+ "--bs-component-checked-color": r.componentCheckedColor,
1773
+ "--bs-component-checked-bg": r.componentCheckedBg,
1774
+ "--bs-menu-link-color-hover": r.menuLinkColorHover,
1775
+ "--bs-menu-link-color-show": r.menuLinkColorShow,
1776
+ "--bs-menu-link-color-here": r.menuLinkColorHere,
1777
+ "--bs-menu-link-color-active": r.menuLinkColorActive,
1778
+ // This repository's own tokens. Only the theme-independent ones are
1779
+ // published here: these are applied as an inline style on the root, which
1780
+ // outranks every stylesheet rule, so a token whose value depends on the
1781
+ // light/dark theme must not be set from a scheme. The stylesheet resolves
1782
+ // those from the `--bs-*` names above in light mode and derives its own
1783
+ // values under `[data-bs-theme="dark"]`; publishing a light-mode shade here
1784
+ // pinned the dark sidebar's menu links to ~2:1.
1785
+ "--rrc-primary": r.primary,
1786
+ "--rrc-primary-rgb": r.primaryRgb,
1787
+ "--rrc-primary-active": r.primaryActive,
1788
+ "--rrc-primary-inverse": r.primaryInverse,
1789
+ "--rrc-component-active-color": r.componentActiveColor,
1790
+ "--rrc-component-active-bg": r.componentActiveBg,
1791
+ "--rrc-component-hover-bg": r.componentHoverBg,
1792
+ "--rrc-component-checked-color": r.componentCheckedColor,
1793
+ "--rrc-component-checked-bg": r.componentCheckedBg
1794
+ };
1795
+ }
1796
+ const ur = ["light", "dark", "system"], mr = ["compact", "grouped"], fr = ["light", "dark", "auto"], $e = Ve(void 0);
1797
+ function ln(e) {
1798
+ return typeof e == "string" && ur.includes(e);
1799
+ }
1800
+ function sn(e) {
1801
+ return typeof e == "string" && mr.includes(e);
1802
+ }
1803
+ function cn(e) {
1804
+ return typeof e == "string" && fr.includes(e);
1805
+ }
1806
+ function dn(e, r) {
1807
+ let n;
1808
+ try {
1809
+ n = e.getItem(r);
1810
+ } catch {
1811
+ return {};
1812
+ }
1813
+ if (!n)
1814
+ return {};
1815
+ let t;
1816
+ try {
1817
+ t = JSON.parse(n);
1818
+ } catch {
1819
+ return {};
1820
+ }
1821
+ if (typeof t != "object" || t === null)
1822
+ return {};
1823
+ const a = t, i = {};
1824
+ return ln(a.mode) && (i.mode = a.mode), sn(a.sidebarPresentation) && (i.sidebarPresentation = a.sidebarPresentation), cn(a.sidebarTone) && (i.sidebarTone = a.sidebarTone), typeof a.colorSchemeId == "string" && nn(a.colorSchemeId) && (i.colorSchemeId = a.colorSchemeId), i;
1825
+ }
1826
+ function Vt({
1827
+ children: e,
1828
+ mode: r,
1829
+ defaultMode: n,
1830
+ onModeChange: t,
1831
+ sidebarPresentation: a,
1832
+ defaultSidebarPresentation: i,
1833
+ onSidebarPresentationChange: l,
1834
+ sidebarTone: c,
1835
+ defaultSidebarTone: s,
1836
+ onSidebarToneChange: d,
1837
+ colorSchemeId: u,
1838
+ defaultColorSchemeId: f,
1839
+ onColorSchemeIdChange: m,
1840
+ storage: p,
1841
+ storageKey: k,
1842
+ applyTo: S = "none",
1843
+ themeAttribute: x = "data-bs-theme"
1844
+ }) {
1845
+ const [_, C] = T({
1846
+ value: r,
1847
+ defaultValue: n ?? "system",
1848
+ onChange: t
1849
+ }), [v, N] = T({
1850
+ value: a,
1851
+ defaultValue: i ?? "grouped",
1852
+ onChange: l
1853
+ }), [b, w] = T({
1854
+ value: c,
1855
+ defaultValue: s ?? "auto",
1856
+ onChange: d
1857
+ }), [g, I] = T({
1858
+ value: u,
1859
+ defaultValue: f ?? Re,
1860
+ onChange: m
1861
+ }), [D, O] = M("light");
1862
+ U(() => {
1863
+ if (typeof window > "u" || typeof window.matchMedia != "function")
1864
+ return;
1865
+ const E = window.matchMedia("(prefers-color-scheme: dark)");
1866
+ O(E.matches ? "dark" : "light");
1867
+ const B = (z) => O(z.matches ? "dark" : "light");
1868
+ if (typeof E.addEventListener == "function")
1869
+ return E.addEventListener("change", B), () => E.removeEventListener("change", B);
1870
+ if (typeof E.addListener == "function")
1871
+ return E.addListener(B), () => E.removeListener(B);
1872
+ }, []);
1873
+ const q = p !== void 0 && k !== void 0, [G, P] = M(!1), V = {
1874
+ mode: r !== void 0,
1875
+ sidebarPresentation: a !== void 0,
1876
+ sidebarTone: c !== void 0,
1877
+ colorSchemeId: u !== void 0
1878
+ }, A = L(V);
1879
+ A.current = V;
1880
+ const H = L({ setMode: C, setSidebarPresentation: N, setSidebarTone: w, setColorSchemeId: I });
1881
+ H.current = { setMode: C, setSidebarPresentation: N, setSidebarTone: w, setColorSchemeId: I }, U(() => {
1882
+ if (!q)
1883
+ return;
1884
+ const E = dn(p, k), B = A.current, z = H.current;
1885
+ E.mode !== void 0 && !B.mode && z.setMode(E.mode), E.sidebarPresentation !== void 0 && !B.sidebarPresentation && z.setSidebarPresentation(E.sidebarPresentation), E.sidebarTone !== void 0 && !B.sidebarTone && z.setSidebarTone(E.sidebarTone), E.colorSchemeId !== void 0 && !B.colorSchemeId && z.setColorSchemeId(E.colorSchemeId), P(!0);
1886
+ }, [q, p, k]), U(() => {
1887
+ if (!(!q || !G))
1888
+ try {
1889
+ p.setItem(
1890
+ k,
1891
+ JSON.stringify({
1892
+ mode: _,
1893
+ sidebarPresentation: v,
1894
+ sidebarTone: b,
1895
+ colorSchemeId: g
1896
+ })
1897
+ );
1898
+ } catch {
1899
+ }
1900
+ }, [q, G, p, k, _, v, b, g]);
1901
+ const R = _ === "system" ? D : _, Z = an(g), X = J(() => on(Z), [Z]);
1902
+ U(() => {
1903
+ if (S === "none" || typeof document > "u")
1904
+ return;
1905
+ const E = S === "body" ? document.body : document.documentElement;
1906
+ if (!E)
1907
+ return;
1908
+ const B = E.getAttribute(x);
1909
+ E.setAttribute(x, R);
1910
+ for (const [z, ie] of Object.entries(X))
1911
+ E.style.setProperty(z, ie);
1912
+ return () => {
1913
+ B === null ? E.removeAttribute(x) : E.setAttribute(x, B);
1914
+ for (const z of Object.keys(X))
1915
+ E.style.removeProperty(z);
1916
+ };
1917
+ }, [S, x, R, X]);
1918
+ const K = J(
1919
+ () => ({ "data-bs-theme": R, style: X }),
1920
+ [R, X]
1921
+ ), j = J(
1922
+ () => ({
1923
+ mode: _,
1924
+ sidebarPresentation: v,
1925
+ sidebarTone: b,
1926
+ colorSchemeId: g,
1927
+ resolvedTheme: R,
1928
+ systemTheme: D,
1929
+ colorScheme: Z,
1930
+ setMode: C,
1931
+ setSidebarPresentation: N,
1932
+ setSidebarTone: w,
1933
+ setColorSchemeId: I,
1934
+ appearanceProps: K
1935
+ }),
1936
+ [
1937
+ _,
1938
+ v,
1939
+ b,
1940
+ g,
1941
+ R,
1942
+ D,
1943
+ Z,
1944
+ C,
1945
+ N,
1946
+ w,
1947
+ I,
1948
+ K
1949
+ ]
1950
+ );
1951
+ return /* @__PURE__ */ o($e.Provider, { value: j, children: e });
1952
+ }
1953
+ function Lt() {
1954
+ const e = we($e);
1955
+ if (!e)
1956
+ throw new Error("[react-components] useAppearance() must be used inside an <AppearanceProvider>.");
1957
+ return e;
1958
+ }
1959
+ function hr() {
1960
+ return we($e);
1961
+ }
1962
+ function Rt({
1963
+ storageKey: e,
1964
+ themeAttribute: r = "data-bs-theme",
1965
+ target: n = "documentElement",
1966
+ defaultMode: t = "system"
1967
+ }) {
1968
+ const a = (d) => JSON.stringify(d).replace(/</g, "\\u003C"), i = a(e), l = a(r), c = a(t), s = n === "body" ? "document.body" : "document.documentElement";
1969
+ return "(function(){try{var raw=window.localStorage.getItem(" + i + ");var mode=" + c + ";if(raw){var parsed=JSON.parse(raw);if(parsed&&typeof parsed.mode==='string'){mode=parsed.mode;}}var dark=mode==='dark'||(mode==='system'&&window.matchMedia('(prefers-color-scheme: dark)').matches);" + s + ".setAttribute(" + l + ",dark?'dark':'light');}catch(e){}})();";
1970
+ }
1971
+ function un(e) {
1972
+ return e.type === "collapsible" || e.type === "group";
1973
+ }
1974
+ function pr(e) {
1975
+ return e.type === "collapsible" || e.type === "group" && e.collapsible === !0;
1976
+ }
1977
+ function Oe(e) {
1462
1978
  return "items" in e;
1463
1979
  }
1464
- function se({ item: e }) {
1465
- return /* @__PURE__ */ p(
1466
- "a",
1980
+ function mn(e) {
1981
+ return e.map((r) => Oe(r) ? fn(r) : br(r));
1982
+ }
1983
+ function fn(e) {
1984
+ return {
1985
+ type: "group",
1986
+ key: e.key,
1987
+ label: e.label,
1988
+ collapsible: !0,
1989
+ children: e.items.map(br)
1990
+ };
1991
+ }
1992
+ function br(e) {
1993
+ const r = {
1994
+ key: e.key,
1995
+ label: e.label,
1996
+ ...e.icon !== void 0 ? { icon: e.icon } : {},
1997
+ ...e.disabled !== void 0 ? { disabled: e.disabled } : {}
1998
+ }, n = e.onClick ? () => {
1999
+ var t;
2000
+ return (t = e.onClick) == null ? void 0 : t.call(e);
2001
+ } : void 0;
2002
+ return e.href !== void 0 ? { ...r, type: "link", href: e.href, ...n ? { onSelect: n } : {} } : { ...r, type: "action", ...n ? { onSelect: n } : {} };
2003
+ }
2004
+ function hn(e) {
2005
+ return e.filter(Oe).filter((r) => r.defaultOpen).map((r) => r.key);
2006
+ }
2007
+ function pn(e) {
2008
+ for (const r of e)
2009
+ if (Oe(r)) {
2010
+ const n = r.items.find((t) => t.active);
2011
+ if (n)
2012
+ return n.key;
2013
+ } else if (r.active)
2014
+ return r.key;
2015
+ }
2016
+ function bn(e) {
2017
+ const r = /* @__PURE__ */ new Map(), n = [], t = [];
2018
+ function a(l, c, s) {
2019
+ const d = [];
2020
+ for (const u of l) {
2021
+ const f = { item: u, key: u.key, depth: c, ancestors: s, children: [] };
2022
+ r.has(u.key) ? t.push(u.key) : (r.set(u.key, f), n.push(u.key)), un(u) && (f.children = a(u.children, c + 1, [...s, u.key])), d.push(f);
2023
+ }
2024
+ return d;
2025
+ }
2026
+ return { roots: a(e, 0, []), byKey: r, order: n, duplicateKeys: t };
2027
+ }
2028
+ function le(e, r) {
2029
+ const n = new Set(r), t = e.filter((i) => n.has(i)), a = new Set(t);
2030
+ for (const i of n)
2031
+ a.has(i) || t.push(i);
2032
+ return t;
2033
+ }
2034
+ function vn(e, r, n, t) {
2035
+ const a = e.byKey.get(n), i = new Set(r);
2036
+ if (i.has(n)) {
2037
+ if (i.delete(n), a)
2038
+ for (const l of vr(a))
2039
+ i.delete(l);
2040
+ return le(e.order, i);
2041
+ }
2042
+ if (t === "single") {
2043
+ const l = new Set(a ? a.ancestors : []);
2044
+ return l.add(n), le(e.order, l);
2045
+ }
2046
+ if (i.add(n), a)
2047
+ for (const l of a.ancestors)
2048
+ i.add(l);
2049
+ return le(e.order, i);
2050
+ }
2051
+ function Ze(e, r, n, t) {
2052
+ if (n.length === 0)
2053
+ return le(e.order, new Set(r));
2054
+ if (t === "single")
2055
+ return le(e.order, new Set(n));
2056
+ const a = new Set(r);
2057
+ for (const i of n)
2058
+ a.add(i);
2059
+ return le(e.order, a);
2060
+ }
2061
+ function gn(e, r) {
2062
+ return e.length === r.length && e.every((n, t) => n === r[t]);
2063
+ }
2064
+ function vr(e) {
2065
+ const r = [];
2066
+ for (const n of e.children)
2067
+ r.push(n.key), r.push(...vr(n));
2068
+ return r;
2069
+ }
2070
+ function gr(e, r) {
2071
+ var n;
2072
+ return r === void 0 ? [] : ((n = e.byKey.get(r)) == null ? void 0 : n.ancestors) ?? [];
2073
+ }
2074
+ function Ye(e, r) {
2075
+ return gr(e, r).filter((n) => {
2076
+ const t = e.byKey.get(n);
2077
+ return t !== void 0 && pr(t.item);
2078
+ });
2079
+ }
2080
+ const yn = typeof document < "u" ? _r : U, Nn = Symbol("unresolved-active-key");
2081
+ function kn(e) {
2082
+ if (e.type !== "divider")
2083
+ return e.ariaLabel !== void 0 ? e.ariaLabel : typeof e.label == "string" ? e.label : void 0;
2084
+ }
2085
+ function wn(e, r) {
2086
+ return `${e}-${r.replace(/[^A-Za-z0-9_-]/g, "_")}`;
2087
+ }
2088
+ function Ae({ node: e, expandable: r }) {
2089
+ const n = e.item;
2090
+ return n.type === "divider" ? null : /* @__PURE__ */ y(Q, { children: [
2091
+ n.icon !== void 0 && /* @__PURE__ */ o("span", { className: "rrc-sidebar__icon", "aria-hidden": "true", children: n.icon }),
2092
+ /* @__PURE__ */ o("span", { className: "rrc-sidebar__label", children: n.label }),
2093
+ n.badge !== void 0 && /* @__PURE__ */ o("span", { className: "rrc-sidebar__badge", children: n.badge }),
2094
+ r && /* @__PURE__ */ o("span", { className: "rrc-sidebar__arrow", "aria-hidden": "true" })
2095
+ ] });
2096
+ }
2097
+ function De({ name: e, children: r }) {
2098
+ return e === void 0 ? /* @__PURE__ */ o(Q, { children: r }) : /* @__PURE__ */ o(sr, { content: e, placement: "bottom", wrapperClassName: "rrc-sidebar__tooltip", children: r });
2099
+ }
2100
+ function _n(e) {
2101
+ if (!e)
2102
+ return;
2103
+ const r = e.getBoundingClientRect(), n = (e.closest(".rrc-sidebar") ?? e).getBoundingClientRect(), t = getComputedStyle(e).direction === "rtl", a = document.documentElement.clientWidth;
2104
+ e.style.setProperty("--rrc-rail-tip-block-start", `${Math.round(r.top + r.height / 2)}px`), e.style.setProperty("--rrc-rail-tip-inline-start", `${Math.round(t ? a - n.left : n.right)}px`);
2105
+ }
2106
+ function Te(e) {
2107
+ if (!e)
2108
+ return {};
2109
+ const r = (n) => _n(n.currentTarget);
2110
+ return { onPointerEnter: r, onFocusCapture: r };
2111
+ }
2112
+ function Ne({ node: e, ctx: r }) {
2113
+ const n = e.item, t = L(null), [a, i] = M(!1), l = F(() => i(!1), []);
2114
+ if (yn(() => {
2115
+ const v = t.current;
2116
+ if (!a || !v)
2117
+ return;
2118
+ const N = () => {
2119
+ const b = v.getBoundingClientRect(), w = (v.closest(".rrc-sidebar") ?? v).getBoundingClientRect(), g = getComputedStyle(v).direction === "rtl", I = document.documentElement.clientWidth;
2120
+ v.style.setProperty("--rrc-flyout-block-start", `${Math.round(b.top)}px`), v.style.setProperty("--rrc-flyout-inline-start", `${Math.round(g ? I - w.left : w.right)}px`);
2121
+ };
2122
+ return N(), window.addEventListener("scroll", N, !0), window.addEventListener("resize", N), () => {
2123
+ window.removeEventListener("scroll", N, !0), window.removeEventListener("resize", N);
2124
+ };
2125
+ }, [a]), n.type === "divider")
2126
+ return /* @__PURE__ */ o("li", { role: "none", className: h("rrc-sidebar__divider", n.className), children: /* @__PURE__ */ o(Zr, { className: "my-1" }) });
2127
+ const c = { "--rrc-sidebar-depth": String(Math.max(0, e.depth - r.depthOffset)) }, s = kn(n), d = r.activeKey === n.key, u = r.activeAncestors.has(n.key), f = pr(n), m = f && r.expanded.has(n.key), p = wn(r.idPrefix, n.key), k = h(
2128
+ "rrc-sidebar__row",
2129
+ d && "rrc-sidebar__row--active",
2130
+ u && "rrc-sidebar__row--active-ancestor",
2131
+ n.disabled && "rrc-sidebar__row--disabled",
2132
+ n.className
2133
+ );
2134
+ if (n.type === "link") {
2135
+ const v = (w) => {
2136
+ if (n.disabled) {
2137
+ w.preventDefault();
2138
+ return;
2139
+ }
2140
+ r.select(n, w);
2141
+ }, N = {
2142
+ item: n,
2143
+ href: n.href,
2144
+ className: h(k, "rrc-sidebar__row--link"),
2145
+ style: c,
2146
+ children: /* @__PURE__ */ o(Ae, { node: e, expandable: !1 }),
2147
+ onClick: v,
2148
+ "aria-current": d ? "page" : void 0,
2149
+ "aria-disabled": n.disabled ? !0 : void 0,
2150
+ "aria-label": r.collapsed ? s : void 0,
2151
+ "data-active-ancestor": u ? "true" : void 0,
2152
+ target: n.target,
2153
+ rel: n.rel
2154
+ }, b = r.renderLink ? r.renderLink(N) : /* @__PURE__ */ o(
2155
+ "a",
2156
+ {
2157
+ href: N.href,
2158
+ className: N.className,
2159
+ style: N.style,
2160
+ onClick: N.onClick,
2161
+ "aria-current": N["aria-current"],
2162
+ "aria-disabled": N["aria-disabled"],
2163
+ "aria-label": N["aria-label"],
2164
+ "data-active-ancestor": N["data-active-ancestor"],
2165
+ target: N.target,
2166
+ rel: N.rel,
2167
+ children: N.children
2168
+ }
2169
+ );
2170
+ return /* @__PURE__ */ o("li", { className: "rrc-sidebar__item", ...Te(r.collapsed), children: r.collapsed ? /* @__PURE__ */ o(De, { name: s, children: b }) : b });
2171
+ }
2172
+ if (n.type === "action") {
2173
+ const v = /* @__PURE__ */ o(
2174
+ "button",
2175
+ {
2176
+ type: "button",
2177
+ className: h(k, "rrc-sidebar__row--action"),
2178
+ style: c,
2179
+ disabled: n.disabled,
2180
+ "aria-label": r.collapsed ? s : void 0,
2181
+ "data-active-ancestor": u ? "true" : void 0,
2182
+ "data-active": d ? "true" : void 0,
2183
+ onClick: (N) => r.select(n, N),
2184
+ children: /* @__PURE__ */ o(Ae, { node: e, expandable: !1 })
2185
+ }
2186
+ );
2187
+ return /* @__PURE__ */ o("li", { className: "rrc-sidebar__item", ...Te(r.collapsed), children: r.collapsed ? /* @__PURE__ */ o(De, { name: s, children: v }) : v });
2188
+ }
2189
+ if (!f) {
2190
+ const v = `${p}-title`;
2191
+ return /* @__PURE__ */ y("li", { className: h("rrc-sidebar__item", "rrc-sidebar__group", n.className), children: [
2192
+ /* @__PURE__ */ y("div", { className: "rrc-sidebar__group-title", id: v, style: c, children: [
2193
+ n.icon !== void 0 && /* @__PURE__ */ o("span", { className: "rrc-sidebar__icon", "aria-hidden": "true", children: n.icon }),
2194
+ /* @__PURE__ */ o("span", { className: "rrc-sidebar__label", children: n.label }),
2195
+ n.badge !== void 0 && /* @__PURE__ */ o("span", { className: "rrc-sidebar__badge", children: n.badge })
2196
+ ] }),
2197
+ /* @__PURE__ */ o("ul", { className: "rrc-sidebar__menu rrc-sidebar__submenu", "aria-labelledby": v, children: e.children.map((N) => /* @__PURE__ */ o(Ne, { node: N, ctx: { ...r, depthOffset: r.depthOffset + 1 } }, N.key)) })
2198
+ ] });
2199
+ }
2200
+ const S = /* @__PURE__ */ o("ul", { className: "rrc-sidebar__menu rrc-sidebar__submenu", id: p, children: e.children.map((v) => /* @__PURE__ */ o(Ne, { node: v, ctx: r }, v.key)) }), x = r.collapsed, _ = () => {
2201
+ n.disabled || (x ? i((v) => !v) : r.toggle(n.key));
2202
+ }, C = /* @__PURE__ */ o(
2203
+ "button",
1467
2204
  {
1468
- href: e.href ?? "#",
1469
- className: f("nav-link d-flex align-items-center gap-2", e.active && "active", e.disabled && "disabled"),
1470
- "aria-current": e.active ? "page" : void 0,
1471
- "aria-disabled": e.disabled,
1472
- onClick: (n) => {
1473
- var t;
1474
- e.href || n.preventDefault(), !e.disabled && ((t = e.onClick) == null || t.call(e));
1475
- },
2205
+ type: "button",
2206
+ className: h(k, "rrc-sidebar__row--toggle", n.type === "group" && "rrc-sidebar__row--group-toggle"),
2207
+ style: c,
2208
+ disabled: n.disabled,
2209
+ "aria-expanded": x ? a : m,
2210
+ "aria-controls": p,
2211
+ "aria-label": r.collapsed ? s : void 0,
2212
+ "data-active-ancestor": u ? "true" : void 0,
2213
+ onClick: _,
2214
+ children: /* @__PURE__ */ o(Ae, { node: e, expandable: !0 })
2215
+ }
2216
+ );
2217
+ return /* @__PURE__ */ y(
2218
+ "li",
2219
+ {
2220
+ ref: t,
2221
+ className: h("rrc-sidebar__item", x && "rrc-sidebar__item--flyout-anchor"),
2222
+ ...Te(r.collapsed),
2223
+ children: [
2224
+ x ? /* @__PURE__ */ o(De, { name: s, children: C }) : C,
2225
+ x ? /* @__PURE__ */ o(oe, { open: a, onClose: l, anchorRef: t, className: "rrc-sidebar__flyout", children: /* @__PURE__ */ o("ul", { className: "rrc-sidebar__menu rrc-sidebar__submenu", id: p, children: e.children.map((v) => (
2226
+ // Inside the panel the branch is fully expanded again, and its
2227
+ // rows start flush rather than inheriting the aside's indentation.
2228
+ /* @__PURE__ */ o(Ne, { node: v, ctx: { ...r, collapsed: !1, depthOffset: e.depth + 1 } }, v.key)
2229
+ )) }) }) : m && S
2230
+ ]
2231
+ }
2232
+ );
2233
+ }
2234
+ function xn({ collapsed: e, toggle: r, label: n }) {
2235
+ return /* @__PURE__ */ o("button", { type: "button", className: "rrc-sidebar__collapse-btn", "aria-label": n, onClick: r, children: /* @__PURE__ */ o(
2236
+ "svg",
2237
+ {
2238
+ className: h("rrc-sidebar__collapse-icon", e && "rrc-sidebar__collapse-icon--collapsed"),
2239
+ viewBox: "0 0 24 24",
2240
+ fill: "none",
2241
+ stroke: "currentColor",
2242
+ strokeWidth: "2",
2243
+ strokeLinecap: "round",
2244
+ strokeLinejoin: "round",
2245
+ "aria-hidden": "true",
2246
+ focusable: "false",
2247
+ children: /* @__PURE__ */ o("path", { d: "M14.5 6.5 9 12l5.5 5.5" })
2248
+ }
2249
+ ) });
2250
+ }
2251
+ function $t({
2252
+ items: e,
2253
+ sections: r,
2254
+ variant: n,
2255
+ tone: t,
2256
+ activeKey: a,
2257
+ expandActivePath: i = !1,
2258
+ activePathExpansion: l,
2259
+ expandedKeys: c,
2260
+ defaultExpandedKeys: s,
2261
+ onExpandedKeysChange: d,
2262
+ expandMode: u = "multiple",
2263
+ collapsed: f,
2264
+ defaultCollapsed: m,
2265
+ onCollapsedChange: p,
2266
+ collapsible: k = !1,
2267
+ renderCollapseControl: S,
2268
+ collapseLabel: x = "Collapse sidebar",
2269
+ expandLabel: _ = "Expand sidebar",
2270
+ mobileOpen: C,
2271
+ defaultMobileOpen: v,
2272
+ onMobileOpenChange: N,
2273
+ mobileLabel: b,
2274
+ closeMobileOnSelect: w = !0,
2275
+ header: g,
2276
+ footer: I,
2277
+ collapsedFooter: D,
2278
+ className: O,
2279
+ navLabel: q,
2280
+ onSelect: G,
2281
+ renderLink: P
2282
+ }) {
2283
+ const V = hr(), A = r ?? [], H = J(
2284
+ () => e !== void 0 ? e : mn(A),
2285
+ // `legacySections` is a fresh array only when `sections` changes.
2286
+ [e, r]
2287
+ // eslint-disable-line react-hooks/exhaustive-deps
2288
+ ), R = J(() => bn(H), [H]), Z = R.duplicateKeys.join(", ");
2289
+ U(() => {
2290
+ process.env.NODE_ENV !== "production" && Z.length > 0 && console.error(
2291
+ "[react-components] Sidebar received duplicate item keys: " + Z + ". Keys must be unique and stable: expansion and active state are keyed by them, so every duplicate shares one identity and the first occurrence in tree order defines it."
2292
+ );
2293
+ }, [Z]);
2294
+ const X = J(() => hn(A), [r]), K = a ?? (e === void 0 ? pn(A) : void 0), j = l ?? (i ? "on-active-change" : "never"), E = L(null);
2295
+ if (E.current === null) {
2296
+ const $ = s ?? X;
2297
+ E.current = j === "never" ? $ : Ze(R, $, Ye(R, K), u);
2298
+ }
2299
+ const [B, z] = T({
2300
+ value: c,
2301
+ defaultValue: E.current,
2302
+ onChange: d
2303
+ }), [ie, kr] = T({
2304
+ value: f,
2305
+ defaultValue: m ?? !1,
2306
+ onChange: p
2307
+ }), [ee, he] = T({
2308
+ value: C,
2309
+ defaultValue: v ?? !1,
2310
+ onChange: N
2311
+ }), re = K, pe = J(
2312
+ () => new Set(gr(R, re)),
2313
+ [R, re]
2314
+ ), Me = J(() => {
2315
+ const $ = new Set(B);
2316
+ if (j === "always")
2317
+ for (const ne of pe)
2318
+ $.add(ne);
2319
+ return $;
2320
+ }, [B, j, pe]), Ce = L(B);
2321
+ Ce.current = B;
2322
+ const Ie = L(Nn);
2323
+ U(() => {
2324
+ if (j !== "on-active-change") {
2325
+ Ie.current = re;
2326
+ return;
2327
+ }
2328
+ if (Ie.current === re)
2329
+ return;
2330
+ Ie.current = re;
2331
+ const $ = Ye(R, re);
2332
+ if ($.length === 0)
2333
+ return;
2334
+ const ne = Ze(R, Ce.current, $, u);
2335
+ gn(ne, Ce.current) || z(ne);
2336
+ }, [j, re, R, u, z]);
2337
+ const Pe = F(
2338
+ ($) => z(vn(R, B, $, u)),
2339
+ [R, B, u, z]
2340
+ ), Ke = F(() => he(!1), [he]);
2341
+ _e(ee, Ke);
2342
+ const Ee = L(null);
2343
+ U(() => {
2344
+ if (typeof document > "u")
2345
+ return;
2346
+ if (ee) {
2347
+ Ee.current = document.activeElement;
2348
+ return;
2349
+ }
2350
+ const $ = Ee.current;
2351
+ Ee.current = null, $ instanceof HTMLElement && $.isConnected && $.focus();
2352
+ }, [ee]);
2353
+ const Be = F(
2354
+ ($, ne) => {
2355
+ var ze;
2356
+ $.disabled || ((ze = $.onSelect) == null || ze.call($, $, ne), G == null || G($, ne), w && ee && he(!1));
2357
+ },
2358
+ [G, w, ee, he]
2359
+ ), Fe = W(), be = n ?? (V == null ? void 0 : V.sidebarPresentation) ?? "grouped", He = t ?? (V == null ? void 0 : V.sidebarTone) ?? "auto", se = ie && !ee, wr = J(
2360
+ () => ({
2361
+ variant: be,
2362
+ collapsed: se,
2363
+ expanded: Me,
2364
+ activeKey: re,
2365
+ activeAncestors: pe,
2366
+ toggle: Pe,
2367
+ select: Be,
2368
+ renderLink: P,
2369
+ idPrefix: Fe,
2370
+ depthOffset: 0
2371
+ }),
2372
+ [be, se, Me, re, pe, Pe, Be, P, Fe]
2373
+ ), je = {
2374
+ collapsed: ie,
2375
+ toggle: () => kr(!ie),
2376
+ label: ie ? _ : x
2377
+ }, Ue = se ? D : I, qe = /* @__PURE__ */ y(
2378
+ "aside",
2379
+ {
2380
+ className: h(
2381
+ "rrc-sidebar",
2382
+ `rrc-sidebar--${be}`,
2383
+ se ? "rrc-sidebar--collapsed" : "rrc-sidebar--expanded",
2384
+ ee && "rrc-sidebar--mobile-open",
2385
+ O
2386
+ ),
2387
+ "data-variant": be,
2388
+ "data-collapsed": se ? "true" : "false",
2389
+ "data-bs-theme": He === "auto" ? void 0 : He,
2390
+ ...ee ? { role: "dialog", "aria-modal": !0, "aria-label": b ?? q } : {},
1476
2391
  children: [
1477
- e.icon,
1478
- e.label
2392
+ /* @__PURE__ */ y("div", { className: "rrc-sidebar__panel", children: [
2393
+ (g !== void 0 || k) && /* @__PURE__ */ o("div", { className: "rrc-sidebar__header", children: g !== void 0 && /* @__PURE__ */ o("div", { className: "rrc-sidebar__brand", children: g }) }),
2394
+ /* @__PURE__ */ o("nav", { className: "rrc-sidebar__body", "aria-label": q, children: /* @__PURE__ */ o("ul", { className: "rrc-sidebar__menu rrc-sidebar__menu--root", children: R.roots.map(($) => /* @__PURE__ */ o(Ne, { node: $, ctx: wr }, $.key)) }) }),
2395
+ Ue !== void 0 && /* @__PURE__ */ o("div", { className: "rrc-sidebar__footer", children: Ue })
2396
+ ] }),
2397
+ k && /* @__PURE__ */ o("div", { className: "rrc-sidebar__collapse", children: S ? S(je) : /* @__PURE__ */ o(xn, { ...je }) })
1479
2398
  ]
1480
2399
  }
1481
2400
  );
2401
+ return ee ? /* @__PURE__ */ y("div", { className: "rrc-sidebar-drawer", children: [
2402
+ /* @__PURE__ */ o("div", { className: "rrc-sidebar-drawer__backdrop", onClick: Ke, "data-testid": "rrc-sidebar-backdrop" }),
2403
+ qe
2404
+ ] }) : qe;
2405
+ }
2406
+ function Ot({ title: e, description: r, breadcrumbItems: n, actions: t, className: a }) {
2407
+ return /* @__PURE__ */ y("div", { className: h("mb-4", "rrc-page-header", a), children: [
2408
+ n && n.length > 0 && /* @__PURE__ */ o(Yr, { items: n, className: "mb-2 rrc-page-header__breadcrumb" }),
2409
+ /* @__PURE__ */ y("div", { className: "d-flex align-items-start justify-content-between gap-3 flex-wrap rrc-page-header__row", children: [
2410
+ /* @__PURE__ */ y("div", { children: [
2411
+ /* @__PURE__ */ o("h1", { className: "h3 mb-1 rrc-page-header__title", children: e }),
2412
+ r && /* @__PURE__ */ o("p", { className: "text-body-secondary mb-0 rrc-page-header__description", children: r })
2413
+ ] }),
2414
+ t && /* @__PURE__ */ o("div", { className: "d-flex align-items-center gap-2 rrc-page-header__actions", children: t })
2415
+ ] })
2416
+ ] });
2417
+ }
2418
+ const Sn = {
2419
+ xs: 1,
2420
+ sm: 2,
2421
+ md: 3,
2422
+ lg: 4,
2423
+ xl: 5
2424
+ };
2425
+ function Cn(e) {
2426
+ return typeof e == "number" ? e : Sn[e];
2427
+ }
2428
+ function Mt({ direction: e = "row", gap: r = "sm", grow: n, shrink: t, fullWidth: a, className: i, ...l }) {
2429
+ return /* @__PURE__ */ o(
2430
+ cr,
2431
+ {
2432
+ direction: e,
2433
+ gap: Cn(r),
2434
+ className: h("rrc-flex", n && "flex-grow-1", t && "flex-shrink-0", a && "w-100", i),
2435
+ ...l
2436
+ }
2437
+ );
2438
+ }
2439
+ function Pt({ icon: e, "aria-label": r, iconSize: n, tooltip: t, variant: a = "light", loading: i, className: l, ...c }) {
2440
+ const s = /* @__PURE__ */ o(ke, { variant: a, loading: i, className: h("btn-icon", "rrc-btn-icon", l), "aria-label": r, ...c, children: !i && /* @__PURE__ */ o(Le, { name: e, size: n }) });
2441
+ return t ? /* @__PURE__ */ o(sr, { content: t, children: s }) : s;
2442
+ }
2443
+ function Kt({ leading: e, title: r, description: n, trailing: t, onClick: a, disabled: i, dense: l, className: c }) {
2444
+ const s = /* @__PURE__ */ y(Q, { children: [
2445
+ e && /* @__PURE__ */ o("span", { className: "flex-shrink-0 d-inline-flex align-items-center rrc-list-item__leading", children: e }),
2446
+ /* @__PURE__ */ y("span", { className: "flex-grow-1", style: { minWidth: 0 }, children: [
2447
+ /* @__PURE__ */ o("span", { className: "d-block text-truncate rrc-list-item__title", children: r }),
2448
+ n && /* @__PURE__ */ o("span", { className: "d-block text-truncate small text-body-secondary rrc-list-item__description", children: n })
2449
+ ] }),
2450
+ t && /* @__PURE__ */ o("span", { className: "flex-shrink-0 d-inline-flex align-items-center rrc-list-item__trailing", children: t })
2451
+ ] }), d = h(
2452
+ "d-flex align-items-center text-start",
2453
+ "rrc-list-item",
2454
+ a && "rrc-list-item--interactive",
2455
+ l ? "gap-2 py-1" : "gap-3 py-2",
2456
+ a && "w-100 border-0 bg-transparent",
2457
+ i && "opacity-50",
2458
+ c
2459
+ );
2460
+ return a ? /* @__PURE__ */ o("button", { type: "button", className: d, onClick: a, disabled: i, children: s }) : /* @__PURE__ */ o("div", { className: d, "aria-disabled": i || void 0, children: s });
2461
+ }
2462
+ function In(e, r, n, t) {
2463
+ if (e.length === 0)
2464
+ return [];
2465
+ const a = Math.min(...e), l = Math.max(...e) - a || 1, c = r - t * 2, s = n - t * 2, d = e.length > 1 ? c / (e.length - 1) : 0;
2466
+ return e.map((u, f) => {
2467
+ const m = t + d * f, p = t + s - (u - a) / l * s;
2468
+ return [m, p];
2469
+ });
2470
+ }
2471
+ function En({ type: e, data: r, width: n, height: t, strokeWidth: a }) {
2472
+ const i = a, l = In(r, n, t, i);
2473
+ if (l.length === 0)
2474
+ return null;
2475
+ const c = l.map(([s, d]) => `${s},${d}`).join(" ");
2476
+ return /* @__PURE__ */ y(Q, { children: [
2477
+ e === "area" && /* @__PURE__ */ o(
2478
+ "polygon",
2479
+ {
2480
+ points: `${i},${t - i} ${c} ${n - i},${t - i}`,
2481
+ fill: "currentColor",
2482
+ opacity: 0.2,
2483
+ stroke: "none"
2484
+ }
2485
+ ),
2486
+ /* @__PURE__ */ o("polyline", { points: c, fill: "none", stroke: "currentColor", strokeWidth: a, strokeLinecap: "round", strokeLinejoin: "round" })
2487
+ ] });
2488
+ }
2489
+ function An({ data: e, width: r, height: n }) {
2490
+ if (e.length === 0)
2491
+ return null;
2492
+ const t = Math.min(0, ...e), i = Math.max(0, ...e) - t || 1, l = 2, c = Math.max((r - l * (e.length - 1)) / e.length, 1);
2493
+ return /* @__PURE__ */ o(Q, { children: e.map((s, d) => {
2494
+ const u = Math.max((s - t) / i * n, 1), f = d * (c + l), m = n - u;
2495
+ return /* @__PURE__ */ o("rect", { x: f, y: m, width: c, height: u, rx: 1, fill: "currentColor" }, d);
2496
+ }) });
2497
+ }
2498
+ function Bt({ type: e = "line", data: r, tone: n = "primary", width: t = 80, height: a = 28, strokeWidth: i = 2, className: l, label: c }) {
2499
+ return /* @__PURE__ */ o(
2500
+ "svg",
2501
+ {
2502
+ width: t,
2503
+ height: a,
2504
+ viewBox: `0 0 ${t} ${a}`,
2505
+ className: h(`text-${n}`, "rrc-sparkline", l),
2506
+ role: c ? "img" : void 0,
2507
+ "aria-label": c,
2508
+ "aria-hidden": c ? void 0 : !0,
2509
+ children: e === "bar" ? /* @__PURE__ */ o(An, { data: r, width: t, height: a }) : /* @__PURE__ */ o(En, { type: e, data: r, width: t, height: a, strokeWidth: i })
2510
+ }
2511
+ );
2512
+ }
2513
+ const Dn = {
2514
+ up: "success",
2515
+ down: "danger",
2516
+ neutral: "muted"
2517
+ }, Tn = {
2518
+ up: "bi bi-arrow-up-short",
2519
+ down: "bi bi-arrow-down-short",
2520
+ neutral: "bi bi-dash"
2521
+ };
2522
+ function Vn(e, r) {
2523
+ return typeof e == "number" && r != null ? e.toFixed(r) : String(e);
2524
+ }
2525
+ function Ft({ label: e, value: r, prefix: n, suffix: t, precision: a, trend: i, delta: l, loading: c, className: s }) {
2526
+ return /* @__PURE__ */ y("div", { className: h("d-flex flex-column gap-1", "rrc-statistic", s), children: [
2527
+ /* @__PURE__ */ o(te, { size: "sm", tone: "muted", children: e }),
2528
+ c ? /* @__PURE__ */ o(ye, { height: "1.75rem", width: "60%" }) : /* @__PURE__ */ y("div", { className: "d-flex align-items-baseline gap-1", children: [
2529
+ n && /* @__PURE__ */ o(te, { size: "lg", weight: "semibold", children: n }),
2530
+ /* @__PURE__ */ o(te, { size: "xl", weight: "bold", children: Vn(r, a) }),
2531
+ t && /* @__PURE__ */ o(te, { size: "lg", weight: "semibold", children: t })
2532
+ ] }),
2533
+ !c && (i || l != null) && /* @__PURE__ */ y(te, { size: "sm", tone: i ? Dn[i] : "muted", className: "d-inline-flex align-items-center gap-1", children: [
2534
+ i && /* @__PURE__ */ o(Le, { name: Tn[i], size: "sm" }),
2535
+ l
2536
+ ] })
2537
+ ] });
1482
2538
  }
1483
- function zn({ sections: e, header: n, footer: t, className: r }) {
1484
- return /* @__PURE__ */ p("div", { className: f("d-flex flex-column h-100", r), children: [
1485
- n && /* @__PURE__ */ a("div", { className: "p-3 border-bottom", children: n }),
1486
- /* @__PURE__ */ a("nav", { className: "nav flex-column flex-grow-1 p-2 gap-1", children: e.map(
1487
- (l) => qe(l) ? /* @__PURE__ */ a(
1488
- Le,
2539
+ function ge({
2540
+ title: e,
2541
+ options: r,
2542
+ value: n,
2543
+ onChange: t,
2544
+ className: a
2545
+ }) {
2546
+ const i = W(), l = L([]);
2547
+ function c(d, u) {
2548
+ var p;
2549
+ if (r.length === 0)
2550
+ return;
2551
+ const f = (d + u + r.length) % r.length, m = r[f];
2552
+ m && (t(m.value), (p = l.current[f]) == null || p.focus());
2553
+ }
2554
+ function s(d) {
2555
+ const u = r.findIndex((f) => f.value === n);
2556
+ d.key === "ArrowDown" || d.key === "ArrowRight" ? (d.preventDefault(), c(u, 1)) : (d.key === "ArrowUp" || d.key === "ArrowLeft") && (d.preventDefault(), c(u, -1));
2557
+ }
2558
+ return /* @__PURE__ */ y("div", { className: h("rrc-appearance__section", a), children: [
2559
+ /* @__PURE__ */ o("div", { className: "rrc-appearance__title", id: i, children: e }),
2560
+ /* @__PURE__ */ o("div", { className: "rrc-appearance__options", role: "radiogroup", "aria-labelledby": i, onKeyDown: s, children: r.map((d, u) => {
2561
+ const f = d.value === n;
2562
+ return /* @__PURE__ */ y(
2563
+ "button",
1489
2564
  {
1490
- className: "border-0",
1491
- defaultOpenKeys: l.defaultOpen ? [l.key] : [],
1492
- items: [
1493
- {
1494
- key: l.key,
1495
- header: l.label,
1496
- content: /* @__PURE__ */ a("div", { className: "nav flex-column ps-2 gap-1", children: l.items.map((s) => /* @__PURE__ */ a(se, { item: s }, s.key)) })
1497
- }
2565
+ ref: (m) => {
2566
+ l.current[u] = m;
2567
+ },
2568
+ type: "button",
2569
+ role: "radio",
2570
+ "aria-checked": f,
2571
+ tabIndex: f ? 0 : -1,
2572
+ className: h("rrc-appearance__option", f && "rrc-appearance__option--selected"),
2573
+ onClick: () => t(d.value),
2574
+ children: [
2575
+ d.adornment,
2576
+ /* @__PURE__ */ o("span", { className: "rrc-appearance__option-label", children: d.label }),
2577
+ /* @__PURE__ */ o("span", { className: "rrc-appearance__check", "aria-hidden": "true" })
1498
2578
  ]
1499
2579
  },
1500
- l.key
1501
- ) : /* @__PURE__ */ a(se, { item: l }, l.key)
1502
- ) }),
1503
- t && /* @__PURE__ */ a("div", { className: "p-3 border-top", children: t })
2580
+ d.value
2581
+ );
2582
+ }) })
1504
2583
  ] });
1505
2584
  }
1506
- function Zn({ title: e, description: n, breadcrumbItems: t, actions: r, className: l }) {
1507
- return /* @__PURE__ */ p("div", { className: f("mb-4", l), children: [
1508
- t && t.length > 0 && /* @__PURE__ */ a(Ke, { items: t, className: "mb-2" }),
1509
- /* @__PURE__ */ p("div", { className: "d-flex align-items-start justify-content-between gap-3 flex-wrap", children: [
1510
- /* @__PURE__ */ p("div", { children: [
1511
- /* @__PURE__ */ a("h1", { className: "h3 mb-1", children: e }),
1512
- n && /* @__PURE__ */ a("p", { className: "text-body-secondary mb-0", children: n })
1513
- ] }),
1514
- r && /* @__PURE__ */ a("div", { className: "d-flex align-items-center gap-2", children: r })
1515
- ] })
2585
+ function Ht({
2586
+ labels: e,
2587
+ sections: r,
2588
+ className: n,
2589
+ mode: t,
2590
+ onModeChange: a,
2591
+ sidebarPresentation: i,
2592
+ onSidebarPresentationChange: l,
2593
+ sidebarTone: c,
2594
+ onSidebarToneChange: s,
2595
+ colorSchemeId: d,
2596
+ onColorSchemeIdChange: u,
2597
+ colorSchemes: f
2598
+ }) {
2599
+ const m = hr(), p = {
2600
+ presentation: (r == null ? void 0 : r.presentation) ?? !0,
2601
+ mode: (r == null ? void 0 : r.mode) ?? !0,
2602
+ tone: (r == null ? void 0 : r.tone) ?? !0,
2603
+ colorScheme: (r == null ? void 0 : r.colorScheme) ?? !0
2604
+ }, k = t ?? (m == null ? void 0 : m.mode) ?? "system", S = i ?? (m == null ? void 0 : m.sidebarPresentation) ?? "grouped", x = c ?? (m == null ? void 0 : m.sidebarTone) ?? "auto", _ = d ?? (m == null ? void 0 : m.colorSchemeId) ?? Re, C = (g) => {
2605
+ a == null || a(g), t === void 0 && (m == null || m.setMode(g));
2606
+ }, v = (g) => {
2607
+ l == null || l(g), i === void 0 && (m == null || m.setSidebarPresentation(g));
2608
+ }, N = (g) => {
2609
+ s == null || s(g), c === void 0 && (m == null || m.setSidebarTone(g));
2610
+ }, b = (g) => {
2611
+ u == null || u(g), d === void 0 && (m == null || m.setColorSchemeId(g));
2612
+ }, w = f ?? tn();
2613
+ return /* @__PURE__ */ y("div", { className: h("rrc-appearance", n), children: [
2614
+ p.presentation && /* @__PURE__ */ o(
2615
+ ge,
2616
+ {
2617
+ title: e.presentation.title,
2618
+ value: S,
2619
+ onChange: v,
2620
+ options: mr.map((g) => ({ value: g, label: e.presentation[g] }))
2621
+ }
2622
+ ),
2623
+ p.mode && /* @__PURE__ */ o(
2624
+ ge,
2625
+ {
2626
+ title: e.mode.title,
2627
+ value: k,
2628
+ onChange: C,
2629
+ options: ur.map((g) => ({ value: g, label: e.mode[g] }))
2630
+ }
2631
+ ),
2632
+ p.tone && /* @__PURE__ */ o(
2633
+ ge,
2634
+ {
2635
+ title: e.tone.title,
2636
+ value: x,
2637
+ onChange: N,
2638
+ options: fr.map((g) => ({ value: g, label: e.tone[g] }))
2639
+ }
2640
+ ),
2641
+ p.colorScheme && /* @__PURE__ */ o(
2642
+ ge,
2643
+ {
2644
+ title: e.colorScheme.title,
2645
+ value: _,
2646
+ onChange: b,
2647
+ className: "rrc-appearance__section--schemes",
2648
+ options: w.map((g) => ({
2649
+ value: g.id,
2650
+ // Falls back to the registered identifier rather than to invented
2651
+ // English copy, so a swatch always has a real accessible name.
2652
+ label: e.colorScheme.options[g.id] ?? g.id,
2653
+ adornment: /* @__PURE__ */ o(
2654
+ "span",
2655
+ {
2656
+ className: "rrc-appearance__swatch",
2657
+ style: { backgroundColor: g.swatch ?? g.tokens.primary },
2658
+ "aria-hidden": "true"
2659
+ }
2660
+ )
2661
+ }))
2662
+ }
2663
+ )
1516
2664
  ] });
1517
2665
  }
1518
- class Ue extends Error {
1519
- constructor(n, t, r) {
1520
- super(`HTTP ${n} ${t} for ${r}`), this.name = "HttpError", this.status = n, this.statusText = t, this.url = r;
2666
+ class Ln extends Error {
2667
+ constructor(r, n, t) {
2668
+ super(`HTTP ${r} ${n} for ${t}`), this.name = "HttpError", this.status = r, this.statusText = n, this.url = t;
1521
2669
  }
1522
2670
  }
1523
- function Ge(e) {
2671
+ function Rn(e) {
1524
2672
  if (!e)
1525
2673
  return "";
1526
- const n = new URLSearchParams();
1527
- for (const [r, l] of Object.entries(e))
1528
- l != null && n.set(r, String(l));
1529
- const t = n.toString();
1530
- return t ? `?${t}` : "";
1531
- }
1532
- function _e(e = {}) {
1533
- const { baseUrl: n = "", fetcher: t = fetch, buildRequestInit: r } = e;
2674
+ const r = new URLSearchParams();
2675
+ for (const [t, a] of Object.entries(e))
2676
+ a != null && r.set(t, String(a));
2677
+ const n = r.toString();
2678
+ return n ? `?${n}` : "";
2679
+ }
2680
+ function $n(e = {}) {
2681
+ const { baseUrl: r = "", fetcher: n = fetch, buildRequestInit: t } = e;
1534
2682
  return {
1535
- async get(l, s = {}) {
1536
- const c = `${n}${l}${Ge(s.params)}`;
1537
- let o = { method: "GET", signal: s.signal };
1538
- r && (o = r(c, o));
1539
- const i = await t(c, o);
1540
- if (!i.ok)
1541
- throw new Ue(i.status, i.statusText, c);
1542
- return await i.json();
2683
+ async get(a, i = {}) {
2684
+ const l = `${r}${a}${Rn(i.params)}`;
2685
+ let c = { method: "GET", signal: i.signal };
2686
+ t && (c = t(l, c));
2687
+ const s = await n(l, c);
2688
+ if (!s.ok)
2689
+ throw new Ln(s.status, s.statusText, l);
2690
+ return await s.json();
1543
2691
  }
1544
2692
  };
1545
2693
  }
1546
- const Je = _e();
1547
- function Ye(e) {
1548
- return Object.keys(e).sort().reduce((n, t) => (n[t] = e[t], n), {});
2694
+ const On = $n();
2695
+ function Mn(e) {
2696
+ return Object.keys(e).sort().reduce((r, n) => (r[n] = e[n], r), {});
1549
2697
  }
1550
- function z({
1551
- client: e = Je,
1552
- url: n,
1553
- params: t,
1554
- mapResponse: r,
1555
- enabled: l = !0
2698
+ function ue({
2699
+ client: e = On,
2700
+ url: r,
2701
+ params: n,
2702
+ mapResponse: t,
2703
+ enabled: a = !0
1556
2704
  }) {
1557
- const [s, c] = T("idle"), [o, i] = T([]), [d, u] = T(null), [h, m] = T(0), b = W(() => t ? JSON.stringify(Ye(t)) : "", [t]), v = M(0), x = M(r);
1558
- x.current = r, B(() => {
1559
- if (!l || !n) {
1560
- c("idle"), i([]), u(null);
2705
+ const [i, l] = M("idle"), [c, s] = M([]), [d, u] = M(null), [f, m] = M(0), p = J(() => n ? JSON.stringify(Mn(n)) : "", [n]), k = L(0), S = L(t);
2706
+ S.current = t, U(() => {
2707
+ if (!a || !r) {
2708
+ l("idle"), s([]), u(null);
1561
2709
  return;
1562
2710
  }
1563
- const g = ++v.current, w = new AbortController();
1564
- return c("loading"), u(null), e.get(n, { params: t, signal: w.signal }).then((y) => {
1565
- if (g !== v.current)
2711
+ const _ = ++k.current, C = new AbortController();
2712
+ return l("loading"), u(null), e.get(r, { params: n, signal: C.signal }).then((v) => {
2713
+ if (_ !== k.current)
1566
2714
  return;
1567
- const S = x.current(y);
1568
- i(S), c(S.length === 0 ? "empty" : "success");
1569
- }).catch((y) => {
1570
- g === v.current && (y instanceof DOMException && y.name === "AbortError" || (u(y instanceof Error ? y : new Error(String(y))), c("error")));
2715
+ const N = S.current(v);
2716
+ s(N), l(N.length === 0 ? "empty" : "success");
2717
+ }).catch((v) => {
2718
+ _ === k.current && (v instanceof DOMException && v.name === "AbortError" || (u(v instanceof Error ? v : new Error(String(v))), l("error")));
1571
2719
  }), () => {
1572
- w.abort();
2720
+ C.abort();
1573
2721
  };
1574
- }, [e, n, b, l, h]);
1575
- const N = R(() => m((g) => g + 1), []);
1576
- return { state: s, items: o, error: d, reload: N };
1577
- }
1578
- function ze(e, n) {
1579
- const [t, r] = T(e);
1580
- return B(() => {
1581
- const l = setTimeout(() => r(e), n);
1582
- return () => clearTimeout(l);
1583
- }, [e, n]), t;
1584
- }
1585
- function Z(e) {
2722
+ }, [e, r, p, a, f]);
2723
+ const x = F(() => m((_) => _ + 1), []);
2724
+ return { state: i, items: c, error: d, reload: x };
2725
+ }
2726
+ function Pn(e, r) {
2727
+ const [n, t] = M(e);
2728
+ return U(() => {
2729
+ const a = setTimeout(() => t(e), r);
2730
+ return () => clearTimeout(a);
2731
+ }, [e, r]), n;
2732
+ }
2733
+ function me(e) {
1586
2734
  if (Array.isArray(e))
1587
2735
  return e;
1588
2736
  if (e && typeof e == "object" && Array.isArray(e.items))
@@ -1591,502 +2739,518 @@ function Z(e) {
1591
2739
  "Unable to normalize remote response into an array. Provide an explicit `mapResponse` for this endpoint's response shape."
1592
2740
  );
1593
2741
  }
1594
- function ne(e, n, t) {
2742
+ function Se(e, r, n) {
1595
2743
  if (e === null || typeof e != "object")
1596
2744
  throw new Error("Remote item is not an object; cannot read valueMember/displayMember from it.");
1597
- const r = e;
2745
+ const t = e;
1598
2746
  return {
1599
- value: r[n],
1600
- label: String(r[t] ?? "")
2747
+ value: t[r],
2748
+ label: String(t[n] ?? "")
1601
2749
  };
1602
2750
  }
1603
- function Ze({
2751
+ function Kn({
1604
2752
  url: e,
1605
- params: n,
1606
- valueMember: t,
1607
- displayMember: r,
1608
- mapResponse: l,
1609
- client: s,
1610
- enabled: c,
1611
- ...o
2753
+ params: r,
2754
+ valueMember: n,
2755
+ displayMember: t,
2756
+ mapResponse: a,
2757
+ client: i,
2758
+ enabled: l,
2759
+ ...c
1612
2760
  }) {
1613
- const { state: i, items: d, error: u } = z({
1614
- client: s,
2761
+ const { state: s, items: d, error: u } = ue({
2762
+ client: i,
1615
2763
  url: e,
1616
- params: n,
1617
- enabled: c,
1618
- mapResponse: (m) => (l ? l(m) : Z(m)).map((v) => ne(v, t, r))
1619
- }), h = o.error ?? (i === "error" ? (u == null ? void 0 : u.message) ?? "Failed to load options" : void 0);
1620
- return /* @__PURE__ */ a(Ve, { ...o, options: d, loading: i === "loading", error: h });
2764
+ params: r,
2765
+ enabled: l,
2766
+ mapResponse: (m) => (a ? a(m) : me(m)).map((k) => Se(k, n, t))
2767
+ }), f = c.error ?? (s === "error" ? (u == null ? void 0 : u.message) ?? "Failed to load options" : void 0);
2768
+ return /* @__PURE__ */ o(Ar, { ...c, options: d, loading: s === "loading", error: f });
1621
2769
  }
1622
- function Qn({
2770
+ function jt({
1623
2771
  url: e,
1624
- params: n,
1625
- searchParam: t,
1626
- valueMember: r,
1627
- displayMember: l,
1628
- mapResponse: s,
1629
- minSearchLength: c = 1,
1630
- debounceMs: o = 300,
1631
- client: i,
2772
+ params: r,
2773
+ searchParam: n,
2774
+ valueMember: t,
2775
+ displayMember: a,
2776
+ mapResponse: i,
2777
+ minSearchLength: l = 1,
2778
+ debounceMs: c = 300,
2779
+ client: s,
1632
2780
  inputValue: d,
1633
2781
  onInputValueChange: u,
1634
- ...h
2782
+ ...f
1635
2783
  }) {
1636
- const [m, b] = V({
2784
+ const [m, p] = T({
1637
2785
  value: d,
1638
2786
  defaultValue: "",
1639
2787
  onChange: u
1640
- }), v = ze(m, o), x = v.length >= c, { state: N, items: g, error: w } = z({
1641
- client: i,
2788
+ }), k = Pn(m, c), S = k.length >= l, { state: x, items: _, error: C } = ue({
2789
+ client: s,
1642
2790
  url: e,
1643
- enabled: x,
1644
- params: { ...n, [t]: v },
1645
- mapResponse: (S) => (s ? s(S) : Z(S)).map((C) => ne(C, r, l))
1646
- }), y = h.error ?? (N === "error" ? (w == null ? void 0 : w.message) ?? "Failed to load suggestions" : void 0);
1647
- return /* @__PURE__ */ a(
1648
- Me,
2791
+ enabled: S,
2792
+ params: { ...r, [n]: k },
2793
+ mapResponse: (N) => (i ? i(N) : me(N)).map((w) => Se(w, t, a))
2794
+ }), v = f.error ?? (x === "error" ? (C == null ? void 0 : C.message) ?? "Failed to load suggestions" : void 0);
2795
+ return /* @__PURE__ */ o(
2796
+ Tr,
1649
2797
  {
1650
- ...h,
1651
- options: g,
1652
- loading: N === "loading",
1653
- error: y,
2798
+ ...f,
2799
+ options: _,
2800
+ loading: x === "loading",
2801
+ error: v,
1654
2802
  inputValue: m,
1655
- onInputValueChange: b,
2803
+ onInputValueChange: p,
1656
2804
  filter: () => !0
1657
2805
  }
1658
2806
  );
1659
2807
  }
1660
- function Qe({
2808
+ function Bn({
1661
2809
  url: e,
1662
- params: n,
1663
- mapResponse: t,
1664
- getTotalCount: r,
1665
- pageSize: l = 20,
1666
- client: s,
1667
- ...c
2810
+ params: r,
2811
+ mapResponse: n,
2812
+ getTotalCount: t,
2813
+ pageSize: a = 20,
2814
+ client: i,
2815
+ ...l
1668
2816
  }) {
1669
- const [o, i] = T(1), [d, u] = T(null), h = W(() => JSON.stringify(n ?? {}), [n]), m = M(!0);
1670
- B(() => {
2817
+ const [c, s] = M(1), [d, u] = M(null), f = J(() => JSON.stringify(r ?? {}), [r]), m = L(!0);
2818
+ U(() => {
1671
2819
  if (m.current) {
1672
2820
  m.current = !1;
1673
2821
  return;
1674
2822
  }
1675
- i(1);
1676
- }, [h]);
1677
- const b = W(
2823
+ s(1);
2824
+ }, [f]);
2825
+ const p = J(
1678
2826
  () => ({
1679
- ...n,
1680
- page: o,
1681
- pageSize: l,
2827
+ ...r,
2828
+ page: c,
2829
+ pageSize: a,
1682
2830
  ...d ? { sortKey: d.key, sortDirection: d.direction } : {}
1683
2831
  }),
1684
- [n, o, l, d]
1685
- ), v = M(void 0), { state: x, items: N, error: g } = z({
1686
- client: s,
2832
+ [r, c, a, d]
2833
+ ), k = L(void 0), { state: S, items: x, error: _ } = ue({
2834
+ client: i,
1687
2835
  url: e,
1688
- params: b,
1689
- mapResponse: (C) => (v.current = C, t ? t(C) : Z(C))
1690
- }), w = v.current !== void 0 ? r == null ? void 0 : r(v.current) : void 0, S = N.length >= l && l > 0 ? o * l + 1 : (o - 1) * l + N.length, k = w ?? S;
1691
- return /* @__PURE__ */ a(
1692
- Ae,
2836
+ params: p,
2837
+ mapResponse: (w) => (k.current = w, n ? n(w) : me(w))
2838
+ }), C = k.current !== void 0 ? t == null ? void 0 : t(k.current) : void 0, N = x.length >= a && a > 0 ? c * a + 1 : (c - 1) * a + x.length, b = C ?? N;
2839
+ return /* @__PURE__ */ o(
2840
+ Kr,
1693
2841
  {
1694
- ...c,
1695
- rows: N,
1696
- loading: x === "loading",
1697
- error: g == null ? void 0 : g.message,
1698
- page: o,
1699
- pageSize: l,
1700
- totalCount: k,
1701
- onPageChange: i,
2842
+ ...l,
2843
+ rows: x,
2844
+ loading: S === "loading",
2845
+ error: _ == null ? void 0 : _.message,
2846
+ page: c,
2847
+ pageSize: a,
2848
+ totalCount: b,
2849
+ onPageChange: s,
1702
2850
  sort: d,
1703
- onSortChange: (C) => {
1704
- u(C), i(1);
2851
+ onSortChange: (w) => {
2852
+ u(w), s(1);
1705
2853
  }
1706
2854
  }
1707
2855
  );
1708
2856
  }
1709
- function Wn({
2857
+ function Ut({
1710
2858
  url: e,
1711
- params: n,
1712
- valueMember: t,
1713
- displayMember: r,
1714
- mapResponse: l,
1715
- client: s,
1716
- enabled: c,
1717
- ...o
2859
+ params: r,
2860
+ valueMember: n,
2861
+ displayMember: t,
2862
+ mapResponse: a,
2863
+ client: i,
2864
+ enabled: l,
2865
+ ...c
1718
2866
  }) {
1719
- const { state: i, items: d, error: u } = z({
1720
- client: s,
2867
+ const { state: s, items: d, error: u } = ue({
2868
+ client: i,
1721
2869
  url: e,
1722
- params: n,
1723
- enabled: c,
1724
- mapResponse: (m) => (l ? l(m) : Z(m)).map((v) => ne(v, t, r))
1725
- }), h = o.error ?? (i === "error" ? (u == null ? void 0 : u.message) ?? "Failed to load options" : void 0);
1726
- return /* @__PURE__ */ a(Ce, { ...o, options: d, loading: i === "loading", error: h });
2870
+ params: r,
2871
+ enabled: l,
2872
+ mapResponse: (m) => (a ? a(m) : me(m)).map((k) => Se(k, n, t))
2873
+ }), f = c.error ?? (s === "error" ? (u == null ? void 0 : u.message) ?? "Failed to load options" : void 0);
2874
+ return /* @__PURE__ */ o(Cr, { ...c, options: d, loading: s === "loading", error: f });
1727
2875
  }
1728
- function Xn({
2876
+ function qt({
1729
2877
  url: e,
1730
- params: n,
1731
- valueMember: t,
1732
- displayMember: r,
1733
- mapResponse: l,
1734
- client: s,
1735
- enabled: c,
1736
- ...o
2878
+ params: r,
2879
+ valueMember: n,
2880
+ displayMember: t,
2881
+ mapResponse: a,
2882
+ client: i,
2883
+ enabled: l,
2884
+ ...c
1737
2885
  }) {
1738
- const { state: i, items: d, error: u } = z({
1739
- client: s,
2886
+ const { state: s, items: d, error: u } = ue({
2887
+ client: i,
1740
2888
  url: e,
1741
- params: n,
1742
- enabled: c,
1743
- mapResponse: (m) => (l ? l(m) : Z(m)).map((v) => ne(v, t, r))
1744
- }), h = o.error ?? (i === "error" ? (u == null ? void 0 : u.message) ?? "Failed to load options" : void 0);
1745
- return /* @__PURE__ */ a(Ie, { ...o, options: d, loading: i === "loading", error: h });
1746
- }
1747
- function et() {
1748
- const e = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Set();
2889
+ params: r,
2890
+ enabled: l,
2891
+ mapResponse: (m) => (a ? a(m) : me(m)).map((k) => Se(k, n, t))
2892
+ }), f = c.error ?? (s === "error" ? (u == null ? void 0 : u.message) ?? "Failed to load options" : void 0);
2893
+ return /* @__PURE__ */ o(Ir, { ...c, options: d, loading: s === "loading", error: f });
2894
+ }
2895
+ function zt() {
2896
+ const e = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Set();
1749
2897
  return {
1750
- register(t, r) {
1751
- e.set(t, r);
2898
+ register(n, t) {
2899
+ e.set(n, t);
1752
2900
  },
1753
- resolve(t, r) {
1754
- const l = e.get(t.component);
1755
- return l ? l(t, r) : (n.has(t.component) || (n.add(t.component), console.warn(
1756
- `Smart: no resolver registered for component "${t.component}" (field "${t.name}"). Skipping.`
2901
+ resolve(n, t) {
2902
+ const a = e.get(n.component);
2903
+ return a ? a(n, t) : (r.has(n.component) || (r.add(n.component), console.warn(
2904
+ `Smart: no resolver registered for component "${n.component}" (field "${n.name}"). Skipping.`
1757
2905
  )), null);
1758
2906
  },
1759
- has(t) {
1760
- return e.has(t);
2907
+ has(n) {
2908
+ return e.has(n);
1761
2909
  }
1762
2910
  };
1763
2911
  }
1764
- function nt(e) {
1765
- const n = new Map(Object.entries(e ?? {}));
2912
+ function Wt(e) {
2913
+ const r = new Map(Object.entries(e ?? {}));
1766
2914
  return {
1767
- register(t, r) {
1768
- n.set(t, r);
2915
+ register(n, t) {
2916
+ r.set(n, t);
1769
2917
  },
1770
- resolve(t) {
1771
- return n.get(t);
2918
+ resolve(n) {
2919
+ return r.get(n);
1772
2920
  }
1773
2921
  };
1774
2922
  }
1775
- function tt() {
2923
+ function Gt() {
1776
2924
  const e = /* @__PURE__ */ new Map();
1777
2925
  return {
1778
- register(n, t) {
1779
- e.set(n, t);
2926
+ register(r, n) {
2927
+ e.set(r, n);
1780
2928
  },
1781
- resolve(n) {
1782
- return e.get(n);
2929
+ resolve(r) {
2930
+ return e.get(r);
1783
2931
  }
1784
2932
  };
1785
2933
  }
1786
- function We(e) {
2934
+ function Fn(e) {
1787
2935
  return "dataSource" in e;
1788
2936
  }
1789
- function Xe(e, n) {
2937
+ function Hn(e, r) {
1790
2938
  if (!e)
1791
2939
  return;
1792
- const t = {};
1793
- for (const [r, l] of Object.entries(e))
1794
- t[r] = l.kind === "static" ? l.value : n[l.field];
1795
- return t;
2940
+ const n = {};
2941
+ for (const [t, a] of Object.entries(e))
2942
+ n[t] = a.kind === "static" ? a.value : r[a.field];
2943
+ return n;
1796
2944
  }
1797
- function ie(e, n, t) {
1798
- return n && t ? t(n) : e;
2945
+ function Qe(e, r, n) {
2946
+ return r && n ? n(r) : e;
1799
2947
  }
1800
- function Q(e, n) {
1801
- const { values: t, translate: r } = n;
2948
+ function fe(e, r) {
2949
+ const { values: n, translate: t } = r;
1802
2950
  return {
1803
2951
  metadata: e,
1804
2952
  visible: e.visible ?? !0,
1805
2953
  readOnly: e.readOnly ?? !1,
1806
2954
  disabled: e.disabled ?? !1,
1807
2955
  required: e.required ?? !1,
1808
- label: ie(e.label, e.labelKey, r),
2956
+ label: Qe(e.label, e.labelKey, t),
1809
2957
  placeholder: e.placeholder,
1810
2958
  helpText: e.helpText,
1811
- validationMessage: ie(e.validationMessage, e.validationMessageKey, r),
1812
- params: We(e) ? Xe(e.dataSource.params, t) : void 0
2959
+ validationMessage: Qe(e.validationMessage, e.validationMessageKey, t),
2960
+ params: Fn(e) ? Hn(e.dataSource.params, n) : void 0
1813
2961
  };
1814
2962
  }
1815
- function rt(e, n, t) {
1816
- const r = n == null ? void 0 : n.fields.find((l) => l.name === e);
1817
- if (r)
1818
- return Q(r, t);
1819
- }
1820
- const en = [];
1821
- function nn(e, n) {
1822
- const t = {};
1823
- for (const r of n)
1824
- t[r] = e[r];
1825
- return t;
1826
- }
1827
- function tn(e, n, t) {
1828
- const r = e ?? en, l = nn(n, r), s = r.length === 0 ? "" : JSON.stringify(l), c = M(null), o = M(t);
1829
- o.current = t, B(() => {
2963
+ function Jt(e, r, n) {
2964
+ const t = r == null ? void 0 : r.fields.find((a) => a.name === e);
2965
+ if (t)
2966
+ return fe(t, n);
2967
+ }
2968
+ const jn = [];
2969
+ function Un(e, r) {
2970
+ const n = {};
2971
+ for (const t of r)
2972
+ n[t] = e[t];
2973
+ return n;
2974
+ }
2975
+ function qn(e, r, n) {
2976
+ const t = e ?? jn, a = Un(r, t), i = t.length === 0 ? "" : JSON.stringify(a), l = L(null), c = L(n);
2977
+ c.current = n, U(() => {
1830
2978
  var d;
1831
- if (r.length === 0)
2979
+ if (t.length === 0)
1832
2980
  return;
1833
- const i = c.current;
1834
- if (i && i.key !== s)
1835
- for (const u of r)
1836
- Object.is(i.snapshot[u], l[u]) || (d = o.current) == null || d.call(o, u);
1837
- c.current = { key: s, snapshot: l };
1838
- }, [s]);
1839
- }
1840
- function ye(e, n) {
1841
- const { actions: t, translate: r } = n, l = t.resolve(e.id);
2981
+ const s = l.current;
2982
+ if (s && s.key !== i)
2983
+ for (const u of t)
2984
+ Object.is(s.snapshot[u], a[u]) || (d = c.current) == null || d.call(c, u);
2985
+ l.current = { key: i, snapshot: a };
2986
+ }, [i]);
2987
+ }
2988
+ function yr(e, r) {
2989
+ const { actions: n, translate: t } = r, a = n.resolve(e.id);
1842
2990
  return {
1843
2991
  metadata: e,
1844
2992
  visible: e.visible ?? !0,
1845
- enabled: (e.enabled ?? !0) && !!l,
1846
- label: e.labelKey && r ? r(e.labelKey) : e.label,
1847
- handler: l
2993
+ enabled: (e.enabled ?? !0) && !!a,
2994
+ label: e.labelKey && t ? t(e.labelKey) : e.label,
2995
+ handler: a
1848
2996
  };
1849
2997
  }
1850
- function lt(e, n, t) {
1851
- var l;
1852
- const r = (l = n == null ? void 0 : n.actions) == null ? void 0 : l.find((s) => s.id === e);
1853
- if (r)
1854
- return ye(r, t);
2998
+ function Zt(e, r, n) {
2999
+ var a;
3000
+ const t = (a = r == null ? void 0 : r.actions) == null ? void 0 : a.find((i) => i.id === e);
3001
+ if (t)
3002
+ return yr(t, n);
1855
3003
  }
1856
- const rn = (e, n) => {
1857
- const t = Q(e, { values: n.values, translate: n.translate });
1858
- if (!t.visible)
3004
+ const zn = (e, r) => {
3005
+ const n = fe(e, { values: r.values, translate: r.translate });
3006
+ if (!n.visible)
1859
3007
  return null;
1860
- const r = n.dataSources.resolve(e.dataSource.id);
1861
- return r ? /* @__PURE__ */ a(
1862
- Ze,
3008
+ const t = r.dataSources.resolve(e.dataSource.id);
3009
+ return t ? /* @__PURE__ */ o(
3010
+ Kn,
1863
3011
  {
1864
- label: t.label,
1865
- url: r.url,
1866
- client: r.client,
1867
- params: t.params,
3012
+ label: n.label,
3013
+ url: t.url,
3014
+ client: t.client,
3015
+ params: n.params,
1868
3016
  valueMember: e.valueMember,
1869
3017
  displayMember: e.displayMember,
1870
- required: t.required,
1871
- readOnly: t.readOnly,
1872
- disabled: t.disabled,
1873
- helpText: t.helpText,
1874
- error: t.validationMessage,
1875
- value: n.values[e.name] ?? null,
1876
- onChange: (l) => n.onFieldChange(e.name, l)
3018
+ required: n.required,
3019
+ readOnly: n.readOnly,
3020
+ disabled: n.disabled,
3021
+ helpText: n.helpText,
3022
+ error: n.validationMessage,
3023
+ value: r.values[e.name] ?? null,
3024
+ onChange: (a) => r.onFieldChange(e.name, a)
1877
3025
  }
1878
3026
  ) : (console.warn(`Smart: no data source registered for id "${e.dataSource.id}" (field "${e.name}"). Skipping.`), null);
1879
- }, ln = {
1880
- text: (e) => e == null ? "" : String(e),
1881
- boolean: (e, n) => n ? n(e ? "smart.boolean.true" : "smart.boolean.false") : e ? "Yes" : "No",
1882
- date: (e) => {
1883
- if (e == null || e === "")
1884
- return "";
1885
- const n = e instanceof Date ? e : new Date(String(e));
1886
- return Number.isNaN(n.getTime()) ? String(e) : n.toLocaleDateString();
1887
- },
1888
- currency: (e) => {
1889
- const n = Number(e);
1890
- return Number.isFinite(n) ? n.toLocaleString(void 0, { style: "currency", currency: "USD" }) : String(e ?? "");
1891
- }
1892
3027
  };
1893
- function an(e, n) {
3028
+ function Wn(e, r) {
1894
3029
  if (e.visible === !1)
1895
3030
  return null;
1896
- const t = e.headerKey && n ? n(e.headerKey) : e.header ?? e.key, r = e.format ? ln[e.format] : void 0;
3031
+ const n = e.headerKey && r ? r(e.headerKey) : e.header ?? e.key, t = e.format === "boolean" && !!r;
1897
3032
  return {
1898
3033
  key: e.key,
1899
- header: t,
3034
+ header: n,
1900
3035
  sortable: e.sortable,
1901
- render: r ? (l) => r(l[e.key], n) : void 0
3036
+ format: t ? void 0 : e.format,
3037
+ formatter: t ? (a) => r(a ? "smart.boolean.true" : "smart.boolean.false") : void 0
1902
3038
  };
1903
3039
  }
1904
- const sn = (e, n) => {
1905
- const t = Q(e, { values: n.values, translate: n.translate });
1906
- if (!t.visible)
3040
+ const Gn = (e, r) => {
3041
+ const n = fe(e, { values: r.values, translate: r.translate });
3042
+ if (!n.visible)
1907
3043
  return null;
1908
- const r = n.dataSources.resolve(e.dataSource.id);
1909
- if (!r)
3044
+ const t = r.dataSources.resolve(e.dataSource.id);
3045
+ if (!t)
1910
3046
  return console.warn(`Smart: no data source registered for id "${e.dataSource.id}" (field "${e.name}"). Skipping.`), null;
1911
- const l = e.columns.map((o) => an(o, n.translate)).filter((o) => o !== null), s = e.totalCountField, c = s ? (o) => {
1912
- const i = o == null ? void 0 : o[s];
1913
- return typeof i == "number" ? i : void 0;
3047
+ const a = e.columns.map((c) => Wn(c, r.translate)).filter((c) => c !== null), i = e.totalCountField, l = i ? (c) => {
3048
+ const s = c == null ? void 0 : c[i];
3049
+ return typeof s == "number" ? s : void 0;
1914
3050
  } : void 0;
1915
- return /* @__PURE__ */ a(
1916
- Qe,
3051
+ return /* @__PURE__ */ o(
3052
+ Bn,
1917
3053
  {
1918
- url: r.url,
1919
- client: r.client,
1920
- params: t.params,
1921
- columns: l,
1922
- rowKey: (o) => o[e.rowKey],
1923
- getTotalCount: c
3054
+ url: t.url,
3055
+ client: t.client,
3056
+ params: n.params,
3057
+ columns: a,
3058
+ rowKey: (c) => c[e.rowKey],
3059
+ getTotalCount: l
1924
3060
  }
1925
3061
  );
1926
3062
  };
1927
- function oe(e) {
3063
+ function Xe(e) {
1928
3064
  if (!e)
1929
3065
  return;
1930
- const n = new Date(e);
1931
- return Number.isNaN(n.getTime()) ? void 0 : n;
3066
+ const r = new Date(e);
3067
+ return Number.isNaN(r.getTime()) ? void 0 : r;
1932
3068
  }
1933
- const on = (e, n) => {
1934
- const t = Q(e, { values: n.values, translate: n.translate });
1935
- return t.visible ? /* @__PURE__ */ a(
1936
- De,
3069
+ const Jn = (e, r) => {
3070
+ const n = fe(e, { values: r.values, translate: r.translate });
3071
+ return n.visible ? /* @__PURE__ */ o(
3072
+ Er,
1937
3073
  {
1938
- label: t.label,
1939
- required: t.required,
1940
- readOnly: t.readOnly,
1941
- disabled: t.disabled,
1942
- helpText: t.helpText,
1943
- error: t.validationMessage,
1944
- min: oe(e.minDate),
1945
- max: oe(e.maxDate),
1946
- value: n.values[e.name] ?? null,
1947
- onChange: (r) => n.onFieldChange(e.name, r)
3074
+ label: n.label,
3075
+ required: n.required,
3076
+ readOnly: n.readOnly,
3077
+ disabled: n.disabled,
3078
+ helpText: n.helpText,
3079
+ error: n.validationMessage,
3080
+ min: Xe(e.minDate),
3081
+ max: Xe(e.maxDate),
3082
+ value: r.values[e.name] ?? null,
3083
+ onChange: (t) => r.onFieldChange(e.name, t)
1948
3084
  }
1949
3085
  ) : null;
1950
- }, cn = (e, n) => {
1951
- const t = Q(e, { values: n.values, translate: n.translate });
1952
- return t.visible ? /* @__PURE__ */ a(
1953
- Y,
3086
+ }, Zn = (e, r) => {
3087
+ const n = fe(e, { values: r.values, translate: r.translate });
3088
+ return n.visible ? /* @__PURE__ */ o(
3089
+ de,
1954
3090
  {
1955
- label: t.label,
1956
- required: t.required,
1957
- readOnly: t.readOnly,
1958
- disabled: t.disabled,
1959
- helpText: t.helpText,
1960
- placeholder: t.placeholder,
1961
- error: t.validationMessage,
3091
+ label: n.label,
3092
+ required: n.required,
3093
+ readOnly: n.readOnly,
3094
+ disabled: n.disabled,
3095
+ helpText: n.helpText,
3096
+ placeholder: n.placeholder,
3097
+ error: n.validationMessage,
1962
3098
  maxLength: e.maxLength,
1963
- value: n.values[e.name] ?? "",
1964
- onChange: (r) => n.onFieldChange(e.name, r)
3099
+ value: r.values[e.name] ?? "",
3100
+ onChange: (t) => r.onFieldChange(e.name, t)
1965
3101
  }
1966
3102
  ) : null;
1967
3103
  };
1968
- function at(e) {
1969
- e.register("Input", cn), e.register("ComboBox", rn), e.register("DatePicker", on), e.register("DataGrid", sn);
3104
+ function Yt(e) {
3105
+ e.register("Input", Zn), e.register("ComboBox", zn), e.register("DatePicker", Jn), e.register("DataGrid", Gn);
1970
3106
  }
1971
- function dn({ metadata: e, ctx: n }) {
1972
- const t = n.onMetadataRefreshNeeded;
1973
- return tn(
3107
+ function Yn({ metadata: e, ctx: r }) {
3108
+ const n = r.onMetadataRefreshNeeded;
3109
+ return qn(
1974
3110
  e.dependsOn,
1975
- n.values,
1976
- t ? (r) => t(e.name, r) : void 0
1977
- ), e.visible === !1 ? null : n.registry.resolve(e, n);
3111
+ r.values,
3112
+ n ? (t) => n(e.name, t) : void 0
3113
+ ), e.visible === !1 ? null : r.registry.resolve(e, r);
1978
3114
  }
1979
- const Ne = 1;
1980
- function un(e) {
1981
- const n = Number(e.split(".")[0]);
1982
- return Number.isFinite(n) && n === Ne;
3115
+ const Nr = 1;
3116
+ function Qn(e) {
3117
+ const r = Number(e.split(".")[0]);
3118
+ return Number.isFinite(r) && r === Nr;
1983
3119
  }
1984
- function st({ metadata: e, ctx: n }) {
1985
- return un(e.schemaVersion) ? /* @__PURE__ */ a(X, { children: e.fields.map((t) => /* @__PURE__ */ a(dn, { metadata: t, ctx: n }, t.name)) }) : /* @__PURE__ */ p(ve, { variant: "danger", children: [
3120
+ function Qt({ metadata: e, ctx: r }) {
3121
+ return Qn(e.schemaVersion) ? /* @__PURE__ */ o(Q, { children: e.fields.map((n) => /* @__PURE__ */ o(Yn, { metadata: n, ctx: r }, n.name)) }) : /* @__PURE__ */ y(or, { variant: "danger", children: [
1986
3122
  'Unsupported form schema version "',
1987
3123
  e.schemaVersion,
1988
3124
  '" — this app understands schema version ',
1989
- Ne,
3125
+ Nr,
1990
3126
  ".x."
1991
3127
  ] });
1992
3128
  }
1993
- function fn({ metadata: e, ctx: n }) {
1994
- const t = ye(e, n);
1995
- return t.visible ? /* @__PURE__ */ a(re, { disabled: !t.enabled, onClick: () => {
1996
- var r;
1997
- return (r = t.handler) == null ? void 0 : r.call(t);
1998
- }, children: t.label ?? e.id }) : null;
3129
+ function Xn({ metadata: e, ctx: r }) {
3130
+ const n = yr(e, r);
3131
+ return n.visible ? /* @__PURE__ */ o(ke, { disabled: !n.enabled, onClick: () => {
3132
+ var t;
3133
+ return (t = n.handler) == null ? void 0 : t.call(n);
3134
+ }, children: n.label ?? e.id }) : null;
1999
3135
  }
2000
- function it({ metadata: e, ctx: n }) {
2001
- return !e.actions || e.actions.length === 0 ? null : /* @__PURE__ */ a(X, { children: e.actions.map((t) => /* @__PURE__ */ a(fn, { metadata: t, ctx: n }, t.id)) });
3136
+ function Xt({ metadata: e, ctx: r }) {
3137
+ return !e.actions || e.actions.length === 0 ? null : /* @__PURE__ */ o(Q, { children: e.actions.map((n) => /* @__PURE__ */ o(Xn, { metadata: n, ctx: r }, n.id)) });
2002
3138
  }
2003
3139
  export {
2004
- Le as Accordion,
2005
- ve as Alert,
2006
- Me as AutoComplete,
2007
- Bn as Avatar,
2008
- Tn as Badge,
2009
- Ke as Breadcrumb,
2010
- re as Button,
2011
- $n as Card,
2012
- yn as CheckBox,
2013
- Ln as Col,
2014
- Ve as ComboBox,
2015
- Dn as ConfirmProvider,
2016
- Pn as Container,
2017
- Ae as DataGrid,
2018
- De as DatePicker,
2019
- kn as DateTimePicker,
2020
- On as Divider,
2021
- gn as FileInput,
2022
- Sn as FormField,
2023
- Ue as HttpError,
2024
- Jn as Icon,
2025
- Y as Input,
2026
- ke as Label,
2027
- Kn as Menu,
2028
- Ee as Modal,
2029
- Ie as MultiSelect,
2030
- Yn as Navbar,
2031
- vn as NumberInput,
2032
- Zn as PageHeader,
2033
- $e as Pagination,
2034
- pn as PasswordInput,
2035
- Rn as Popover,
2036
- G as Popup,
2037
- _n as ProgressBar,
2038
- Se as RadioButton,
2039
- wn as RadioGroup,
2040
- Gn as Rating,
2041
- Qn as RemoteAutoComplete,
2042
- Ze as RemoteComboBox,
2043
- Qe as RemoteDataGrid,
2044
- Xn as RemoteMultiSelect,
2045
- Wn as RemoteSelect,
2046
- Fn as Row,
2047
- Ce as Select,
2048
- zn as Sidebar,
2049
- qn as Skeleton,
2050
- Un as Slider,
2051
- fn as SmartAction,
2052
- it as SmartActions,
2053
- dn as SmartField,
2054
- st as SmartForm,
2055
- Pe as Spinner,
2056
- An as Stack,
2057
- jn as Stepper,
2058
- Nn as Switch,
2059
- Mn as Tabs,
2060
- Hn as Tag,
2061
- bn as TextArea,
2062
- xn as TimePicker,
2063
- Cn as ToastProvider,
2064
- En as Tooltip,
2065
- ue as ValidationMessage,
2066
- rn as comboBoxResolver,
2067
- _e as createHttpClient,
2068
- tt as createSmartActionRegistry,
2069
- et as createSmartComponentRegistry,
2070
- nt as createSmartDataSourceRegistry,
2071
- sn as dataGridResolver,
2072
- on as datePickerResolver,
2073
- Z as defaultArrayNormalization,
2074
- Je as defaultHttpClient,
2075
- me as fromDateInputValue,
2076
- be as fromTimeInputValue,
2077
- cn as inputResolver,
2078
- at as registerBuiltInResolvers,
2079
- ye as resolveSmartActionMetadata,
2080
- Q as resolveSmartFieldMetadata,
2081
- H as toDateInputValue,
2082
- ne as toSelectOption,
2083
- he as toTimeInputValue,
2084
- Vn as useConfirm,
2085
- ze as useDebouncedValue,
2086
- z as useRemoteData,
2087
- lt as useSmartAction,
2088
- tn as useSmartDependencies,
2089
- rt as useSmartField,
2090
- In as useToast
3140
+ vt as Accordion,
3141
+ or as Alert,
3142
+ Ht as AppearanceMenu,
3143
+ Vt as AppearanceProvider,
3144
+ Tr as AutoComplete,
3145
+ St as Avatar,
3146
+ Hr as Badge,
3147
+ Yr as Breadcrumb,
3148
+ ke as Button,
3149
+ dr as COLOR_SCHEME_TOKEN_KEYS,
3150
+ yt as Card,
3151
+ it as CheckBox,
3152
+ wt as Col,
3153
+ Ar as ComboBox,
3154
+ ht as ConfirmProvider,
3155
+ Nt as Container,
3156
+ Re as DEFAULT_COLOR_SCHEME_ID,
3157
+ Kr as DataGrid,
3158
+ Er as DatePicker,
3159
+ dt as DateTimePicker,
3160
+ Zr as Divider,
3161
+ ot as FileInput,
3162
+ Mt as Flex,
3163
+ ut as FormField,
3164
+ Ln as HttpError,
3165
+ Le as Icon,
3166
+ Pt as IconButton,
3167
+ de as Input,
3168
+ xr as Label,
3169
+ Kt as ListItem,
3170
+ _t as Menu,
3171
+ Vr as Modal,
3172
+ Ir as MultiSelect,
3173
+ Dt as Navbar,
3174
+ tt as NumberInput,
3175
+ Ot as PageHeader,
3176
+ Rr as Pagination,
3177
+ at as PasswordInput,
3178
+ gt as Popover,
3179
+ oe as Popup,
3180
+ At as ProgressBar,
3181
+ Sr as RadioButton,
3182
+ st as RadioGroup,
3183
+ Et as Rating,
3184
+ jt as RemoteAutoComplete,
3185
+ Kn as RemoteComboBox,
3186
+ Bn as RemoteDataGrid,
3187
+ qt as RemoteMultiSelect,
3188
+ Ut as RemoteSelect,
3189
+ kt as Row,
3190
+ mr as SIDEBAR_PRESENTATIONS,
3191
+ fr as SIDEBAR_TONES,
3192
+ Cr as Select,
3193
+ $t as Sidebar,
3194
+ ye as Skeleton,
3195
+ It as Slider,
3196
+ Xn as SmartAction,
3197
+ Xt as SmartActions,
3198
+ Yn as SmartField,
3199
+ Qt as SmartForm,
3200
+ Bt as Sparkline,
3201
+ Br as Spinner,
3202
+ cr as Stack,
3203
+ Ft as Statistic,
3204
+ xt as Stepper,
3205
+ lt as Switch,
3206
+ ur as THEME_MODES,
3207
+ bt as Tabs,
3208
+ Ct as Tag,
3209
+ te as Text,
3210
+ nt as TextArea,
3211
+ ct as TimePicker,
3212
+ mt as ToastProvider,
3213
+ sr as Tooltip,
3214
+ er as ValidationMessage,
3215
+ on as colorSchemeCssVariables,
3216
+ zn as comboBoxResolver,
3217
+ Rt as createAppearanceInitScript,
3218
+ ve as createColorScheme,
3219
+ $n as createHttpClient,
3220
+ Gt as createSmartActionRegistry,
3221
+ zt as createSmartComponentRegistry,
3222
+ Wt as createSmartDataSourceRegistry,
3223
+ $r as dataGridFormatters,
3224
+ Gn as dataGridResolver,
3225
+ Jn as datePickerResolver,
3226
+ me as defaultArrayNormalization,
3227
+ On as defaultHttpClient,
3228
+ nr as fromDateInputValue,
3229
+ ar as fromTimeInputValue,
3230
+ nn as getColorScheme,
3231
+ Zn as inputResolver,
3232
+ pr as isSidebarExpandable,
3233
+ un as isSidebarParent,
3234
+ en as isValidColorScheme,
3235
+ pn as legacyActiveKey,
3236
+ hn as legacyDefaultExpandedKeys,
3237
+ tn as listColorSchemes,
3238
+ Yt as registerBuiltInResolvers,
3239
+ Tt as registerColorScheme,
3240
+ an as resolveColorScheme,
3241
+ yr as resolveSmartActionMetadata,
3242
+ fe as resolveSmartFieldMetadata,
3243
+ ae as toDateInputValue,
3244
+ Se as toSelectOption,
3245
+ mn as toSidebarItems,
3246
+ tr as toTimeInputValue,
3247
+ Lt as useAppearance,
3248
+ pt as useConfirm,
3249
+ Pn as useDebouncedValue,
3250
+ ue as useRemoteData,
3251
+ Zt as useSmartAction,
3252
+ qn as useSmartDependencies,
3253
+ Jt as useSmartField,
3254
+ ft as useToast
2091
3255
  };
2092
3256
  //# sourceMappingURL=index.js.map