fansunited-frontend-components 0.0.38 → 0.0.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. package/ChanceGame.js +5 -5
  2. package/ClassicQuizPlay.js +19 -18
  3. package/CollectLead.js +4 -4
  4. package/Discussion.js +1562 -1343
  5. package/EventGamePlay.js +528 -581
  6. package/MatchQuizPlay.js +808 -860
  7. package/PersonalityQuizPlay.js +142 -112
  8. package/PickThePair.js +6 -6
  9. package/PollVote.js +59 -58
  10. package/README.md +231 -0
  11. package/chunks/{AlertMessage-DZAXIV4L.js → AlertMessage-C2aBXCrl.js} +69 -72
  12. package/chunks/{ChanceGameEmbedVariant-B5jX_jMO.js → ChanceGameEmbedVariant-BvIKBhq_.js} +5 -5
  13. package/chunks/{Select-DSxMtwH4.js → CheckCircle-D-GH16Lb.js} +321 -317
  14. package/chunks/{CollectLeadForm-D7pLjJkA.js → CollectLeadForm-o9NdYQgu.js} +5 -5
  15. package/chunks/{ConstantsProvider-YKCgQ1mh.js → ConstantsProvider-BPJJz9fq.js} +390 -360
  16. package/chunks/{Snackbar-DIH2D4Gx.js → Notification-Bwcoljir.js} +294 -238
  17. package/chunks/{OverlayLeadAfterCollection-9i_et1r0.js → OverlayLeadAfterCollection-B3D5ct0J.js} +4 -4
  18. package/chunks/{OverlayScoreStateSkeleton-BEe63pWp.js → OverlayScoreStateSkeleton-xvq9lQEi.js} +3 -3
  19. package/chunks/{PickOneOfX-UVJCgkSX.js → PickOneOfX-C2YpLk40.js} +1 -1
  20. package/chunks/{Portal-CfeOliT5.js → Portal-DWAr8MhA.js} +7 -7
  21. package/chunks/{Spinner-kT93nizf.js → Spinner-m59ZJZ35.js} +55 -55
  22. package/chunks/{Tabs-B6f7vU-w.js → Tabs-BGihvj9C.js} +44 -44
  23. package/chunks/{Textarea-EApa88SY.js → Textarea-Bzlb89Zp.js} +2 -2
  24. package/chunks/{TimerOutlined-CtKZ9Yp9.js → TimerOutlined-DiX8hCoC.js} +1 -1
  25. package/chunks/{Error-ZEDfLj_t.js → chevron-right-Dlc9ZKhv.js} +56 -59
  26. package/chunks/{useImageVariant-BB7FL7DQ.js → useImageVariant-Do8kOVs2.js} +1 -1
  27. package/chunks/{useInfoPage-Cjw5ykNz.js → useInfoPage-v91yL5SS.js} +37 -37
  28. package/package.json +1 -1
package/Discussion.js CHANGED
@@ -1,42 +1,41 @@
1
- import { jsx as r, jsxs as L, Fragment as De } from "react/jsx-runtime";
2
- import * as y from "react";
3
- import ho, { useState as w, useEffect as Ce, useCallback as go } from "react";
4
- import { _ as x, j as _e, ad as fe, l as $e, G as Le, af as we, s as J, p as ie, k as ae, q as Y, H as Ae, P as o, r as U, t as ce, n as ve, m as he, K as yo, L as bo, av as xo, ah as Co, aw as Ro, as as Po, at as So, g as Mo, a0 as ne, x as Z, w as de, v as ue, B as A, a5 as Q, T as K, c as G, au as Be, a1 as ze, aj as Te, ak as Io, ae as Do } from "./chunks/ConstantsProvider-YKCgQ1mh.js";
5
- import { P as zo } from "./chunks/Portal-CfeOliT5.js";
6
- import { C as To, M as ko, d as Eo, a as He, b as je, S as Oo } from "./chunks/Spinner-kT93nizf.js";
7
- import "react-dom";
8
- import { C as $o, u as Vo, T as Ue } from "./chunks/Textarea-EApa88SY.js";
9
- import { L as pe, l as Fo, a as No, d as _o, g as Pe, C as Lo, e as ke, f as wo, b as Ao, i as Bo, s as Ho, V as jo, G as Uo, j as Ko, S as Wo, R as Go, p as Jo, h as qo, F as Se, x as Ke, v as Xo, w as Yo } from "./chunks/Select-DSxMtwH4.js";
10
- import { g as Qo, A as Zo, S as et } from "./chunks/Snackbar-DIH2D4Gx.js";
11
- const Ee = /* @__PURE__ */ y.createContext(null);
12
- process.env.NODE_ENV !== "production" && (Ee.displayName = "DropdownContext");
13
- const Me = {
1
+ import { jsx as r, jsxs as F, Fragment as Me } from "react/jsx-runtime";
2
+ import * as I from "react";
3
+ import q, { useState as H, useEffect as be, useCallback as Ae, useRef as Ie } from "react";
4
+ import { _ as M, j as Ke, ad as xe, l as Be, Z as We, af as Ge, s as Q, p as ue, k as pe, q as Z, K as Je, P as t, r as G, t as me, n as Ce, m as Re, Q as Co, R as Ro, av as Po, ak as So, aw as Io, as as Mo, at as Do, g as zo, a0 as le, x as te, w as ae, v as De, f as re, B as L, a5 as oe, T as W, d as J, a1 as we, am as Ne, an as To, i as Eo, c as Oo, C as $o, a as ko, E as Vo, b as wo } from "./chunks/ConstantsProvider-BPJJz9fq.js";
5
+ import { C as No, M as _o, d as Lo, a as qe, b as Xe, S as Ee } from "./chunks/Spinner-m59ZJZ35.js";
6
+ import { createPortal as Fo } from "react-dom";
7
+ import { C as Ao, u as Bo, T as Ye } from "./chunks/Textarea-Bzlb89Zp.js";
8
+ import { L as ye, l as Ho, a as jo, e as Uo, h as Oe, b as Ko, f as _e, g as Wo, d as Go, j as Jo, s as qo, V as Xo, G as Yo, k as Qo, S as Zo, R as et, q as ot, i as tt, F as $e, y as Qe, w as rt, x as nt } from "./chunks/CheckCircle-D-GH16Lb.js";
9
+ import { g as st, A as it, N as Ze } from "./chunks/Notification-Bwcoljir.js";
10
+ const Le = /* @__PURE__ */ I.createContext(null);
11
+ process.env.NODE_ENV !== "production" && (Le.displayName = "DropdownContext");
12
+ const ke = {
14
13
  blur: "dropdown:blur",
15
14
  escapeKeyDown: "dropdown:escapeKeyDown",
16
15
  toggle: "dropdown:toggle",
17
16
  open: "dropdown:open",
18
17
  close: "dropdown:close"
19
18
  };
20
- function ot(t, e) {
21
- if (e.type === pe.itemHover)
22
- return x({}, t, {
19
+ function lt(o, e) {
20
+ if (e.type === ye.itemHover)
21
+ return M({}, o, {
23
22
  highlightedValue: e.item
24
23
  });
25
- const n = Fo(t, e);
24
+ const n = Ho(o, e);
26
25
  if (n.highlightedValue === null && e.context.items.length > 0)
27
- return x({}, n, {
26
+ return M({}, n, {
28
27
  highlightedValue: e.context.items[0]
29
28
  });
30
- if (e.type === pe.keyDown && e.event.key === "Escape")
31
- return x({}, n, {
29
+ if (e.type === ye.keyDown && e.event.key === "Escape")
30
+ return M({}, n, {
32
31
  open: !1
33
32
  });
34
- if (e.type === pe.blur) {
33
+ if (e.type === ye.blur) {
35
34
  var a;
36
35
  if (!((a = e.context.listboxRef.current) != null && a.contains(e.event.relatedTarget))) {
37
- var l, s;
38
- const c = (l = e.context.listboxRef.current) == null ? void 0 : l.getAttribute("id"), i = (s = e.event.relatedTarget) == null ? void 0 : s.getAttribute("aria-controls");
39
- return c && i && c === i ? n : x({}, n, {
36
+ var l, i;
37
+ const c = (l = e.context.listboxRef.current) == null ? void 0 : l.getAttribute("id"), s = (i = e.event.relatedTarget) == null ? void 0 : i.getAttribute("aria-controls");
38
+ return c && s && c === s ? n : M({}, n, {
40
39
  open: !1,
41
40
  highlightedValue: e.context.items[0]
42
41
  });
@@ -44,7 +43,7 @@ function ot(t, e) {
44
43
  }
45
44
  return n;
46
45
  }
47
- const tt = {
46
+ const at = {
48
47
  dispatch: () => {
49
48
  },
50
49
  popupId: "",
@@ -58,151 +57,151 @@ const tt = {
58
57
  },
59
58
  triggerElement: null
60
59
  };
61
- function nt(t = {}) {
60
+ function ct(o = {}) {
62
61
  var e, n;
63
62
  const {
64
63
  listboxRef: a,
65
64
  onItemsChange: l,
66
- id: s,
65
+ id: i,
67
66
  disabledItemsFocusable: c = !0,
68
- disableListWrap: i = !1,
69
- autoFocus: d = !0,
70
- componentName: p = "useMenu"
71
- } = t, f = y.useRef(null), g = _e(f, a), m = (e = fe(s)) != null ? e : "", {
67
+ disableListWrap: s = !1,
68
+ autoFocus: u = !0,
69
+ componentName: d = "useMenu"
70
+ } = o, p = I.useRef(null), g = Ke(p, a), x = (e = xe(i)) != null ? e : "", {
72
71
  state: {
73
- open: v,
74
- changeReason: C
72
+ open: f,
73
+ changeReason: b
75
74
  },
76
- dispatch: S,
77
- triggerElement: P,
78
- registerPopup: b
79
- } = (n = y.useContext(Ee)) != null ? n : tt, M = y.useRef(v), {
80
- subitems: u,
81
- contextValue: E
82
- } = No(), F = y.useMemo(() => Array.from(u.keys()), [u]), I = y.useCallback((h) => {
83
- var O, k;
84
- return h == null ? null : (O = (k = u.get(h)) == null ? void 0 : k.ref.current) != null ? O : null;
85
- }, [u]), D = y.useCallback((h) => {
86
- var O;
87
- return (u == null || (O = u.get(h)) == null ? void 0 : O.disabled) || !1;
88
- }, [u]), z = y.useCallback((h) => {
89
- var O, k;
90
- return ((O = u.get(h)) == null ? void 0 : O.label) || ((k = u.get(h)) == null || (k = k.ref.current) == null ? void 0 : k.innerText);
91
- }, [u]), B = y.useMemo(() => ({
92
- listboxRef: f
93
- }), [f]), {
94
- dispatch: H,
95
- getRootProps: $,
96
- contextValue: T,
75
+ dispatch: C,
76
+ triggerElement: R,
77
+ registerPopup: S
78
+ } = (n = I.useContext(Le)) != null ? n : at, T = I.useRef(f), {
79
+ subitems: y,
80
+ contextValue: $
81
+ } = jo(), v = I.useMemo(() => Array.from(y.keys()), [y]), E = I.useCallback((m) => {
82
+ var D, z;
83
+ return m == null ? null : (D = (z = y.get(m)) == null ? void 0 : z.ref.current) != null ? D : null;
84
+ }, [y]), h = I.useCallback((m) => {
85
+ var D;
86
+ return (y == null || (D = y.get(m)) == null ? void 0 : D.disabled) || !1;
87
+ }, [y]), O = I.useCallback((m) => {
88
+ var D, z;
89
+ return ((D = y.get(m)) == null ? void 0 : D.label) || ((z = y.get(m)) == null || (z = z.ref.current) == null ? void 0 : z.innerText);
90
+ }, [y]), N = I.useMemo(() => ({
91
+ listboxRef: p
92
+ }), [p]), {
93
+ dispatch: A,
94
+ getRootProps: j,
95
+ contextValue: U,
97
96
  state: {
98
- highlightedValue: R
97
+ highlightedValue: B
99
98
  },
100
- rootRef: V
101
- } = _o({
99
+ rootRef: K
100
+ } = Uo({
102
101
  disabledItemsFocusable: c,
103
- disableListWrap: i,
102
+ disableListWrap: s,
104
103
  focusManagement: "DOM",
105
- getItemDomElement: I,
104
+ getItemDomElement: E,
106
105
  getInitialState: () => ({
107
106
  selectedValues: [],
108
107
  highlightedValue: null
109
108
  }),
110
- isItemDisabled: D,
111
- items: F,
112
- getItemAsString: z,
109
+ isItemDisabled: h,
110
+ items: v,
111
+ getItemAsString: O,
113
112
  rootRef: g,
114
113
  onItemsChange: l,
115
- reducerActionContext: B,
114
+ reducerActionContext: N,
116
115
  selectionMode: "none",
117
- stateReducer: ot,
118
- componentName: p
116
+ stateReducer: lt,
117
+ componentName: d
119
118
  });
120
- $e(() => {
121
- b(m);
122
- }, [m, b]), $e(() => {
123
- v && (C == null ? void 0 : C.type) === "keydown" && C.key === "ArrowUp" && H({
124
- type: pe.highlightLast,
125
- event: C
119
+ Be(() => {
120
+ S(x);
121
+ }, [x, S]), Be(() => {
122
+ f && (b == null ? void 0 : b.type) === "keydown" && b.key === "ArrowUp" && A({
123
+ type: ye.highlightLast,
124
+ event: b
126
125
  });
127
- }, [v, C, H]), y.useEffect(() => {
128
- if (v && d && R && !M.current) {
129
- var h;
130
- (h = u.get(R)) == null || (h = h.ref) == null || (h = h.current) == null || h.focus();
126
+ }, [f, b, A]), I.useEffect(() => {
127
+ if (f && u && B && !T.current) {
128
+ var m;
129
+ (m = y.get(B)) == null || (m = m.ref) == null || (m = m.current) == null || m.focus();
131
130
  }
132
- }, [v, d, R, u, F]), y.useEffect(() => {
133
- var h;
134
- if ((h = f.current) != null && h.contains(document.activeElement) && R !== null) {
135
- var O;
136
- u == null || (O = u.get(R)) == null || (O = O.ref.current) == null || O.focus();
131
+ }, [f, u, B, y, v]), I.useEffect(() => {
132
+ var m;
133
+ if ((m = p.current) != null && m.contains(document.activeElement) && B !== null) {
134
+ var D;
135
+ y == null || (D = y.get(B)) == null || (D = D.ref.current) == null || D.focus();
137
136
  }
138
- }, [R, u]);
139
- const N = (h) => (O) => {
140
- var k, ee;
141
- (k = h.onBlur) == null || k.call(h, O), !O.defaultMuiPrevented && ((ee = f.current) != null && ee.contains(O.relatedTarget) || O.relatedTarget === P || S({
142
- type: Me.blur,
143
- event: O
137
+ }, [B, y]);
138
+ const k = (m) => (D) => {
139
+ var z, ee;
140
+ (z = m.onBlur) == null || z.call(m, D), !D.defaultMuiPrevented && ((ee = p.current) != null && ee.contains(D.relatedTarget) || D.relatedTarget === R || C({
141
+ type: ke.blur,
142
+ event: D
144
143
  }));
145
- }, j = (h) => (O) => {
146
- var k;
147
- (k = h.onKeyDown) == null || k.call(h, O), !O.defaultMuiPrevented && O.key === "Escape" && S({
148
- type: Me.escapeKeyDown,
149
- event: O
144
+ }, _ = (m) => (D) => {
145
+ var z;
146
+ (z = m.onKeyDown) == null || z.call(m, D), !D.defaultMuiPrevented && D.key === "Escape" && C({
147
+ type: ke.escapeKeyDown,
148
+ event: D
150
149
  });
151
- }, q = (h = {}) => ({
152
- onBlur: N(h),
153
- onKeyDown: j(h)
154
- }), X = (h = {}) => {
155
- const O = Pe(q, $), k = Le(h);
156
- return x({}, h, k, O(k), {
157
- id: m,
150
+ }, P = (m = {}) => ({
151
+ onBlur: k(m),
152
+ onKeyDown: _(m)
153
+ }), V = (m = {}) => {
154
+ const D = Oe(P, j), z = We(m);
155
+ return M({}, m, z, D(z), {
156
+ id: x,
158
157
  role: "menu"
159
158
  });
160
159
  };
161
- return y.useDebugValue({
162
- subitems: u,
163
- highlightedValue: R
160
+ return I.useDebugValue({
161
+ subitems: y,
162
+ highlightedValue: B
164
163
  }), {
165
- contextValue: x({}, E, T),
166
- dispatch: H,
167
- getListboxProps: X,
168
- highlightedValue: R,
169
- listboxRef: V,
170
- menuItems: u,
171
- open: v,
172
- triggerElement: P
164
+ contextValue: M({}, $, U),
165
+ dispatch: A,
166
+ getListboxProps: V,
167
+ highlightedValue: B,
168
+ listboxRef: K,
169
+ menuItems: y,
170
+ open: f,
171
+ triggerElement: R
173
172
  };
174
173
  }
175
- function rt(t) {
174
+ function dt(o) {
176
175
  const {
177
176
  value: e,
178
177
  children: n
179
- } = t, {
178
+ } = o, {
180
179
  dispatch: a,
181
180
  getItemIndex: l,
182
- getItemState: s,
181
+ getItemState: i,
183
182
  registerItem: c,
184
- totalSubitemCount: i
185
- } = e, d = y.useMemo(() => ({
183
+ totalSubitemCount: s
184
+ } = e, u = I.useMemo(() => ({
186
185
  dispatch: a,
187
- getItemState: s,
186
+ getItemState: i,
188
187
  getItemIndex: l
189
- }), [a, l, s]), p = y.useMemo(() => ({
188
+ }), [a, l, i]), d = I.useMemo(() => ({
190
189
  getItemIndex: l,
191
190
  registerItem: c,
192
- totalSubitemCount: i
193
- }), [c, l, i]);
194
- return /* @__PURE__ */ r(Lo.Provider, {
195
- value: p,
196
- children: /* @__PURE__ */ r(ke.Provider, {
197
- value: d,
191
+ totalSubitemCount: s
192
+ }), [c, l, s]);
193
+ return /* @__PURE__ */ r(Ko.Provider, {
194
+ value: d,
195
+ children: /* @__PURE__ */ r(_e.Provider, {
196
+ value: u,
198
197
  children: n
199
198
  })
200
199
  });
201
200
  }
202
- function st(t) {
203
- return `menu-item-${t.size}`;
201
+ function ut(o) {
202
+ return `menu-item-${o.size}`;
204
203
  }
205
- const lt = {
204
+ const pt = {
206
205
  dispatch: () => {
207
206
  },
208
207
  popupId: "",
@@ -216,132 +215,132 @@ const lt = {
216
215
  },
217
216
  triggerElement: null
218
217
  };
219
- function it(t) {
218
+ function mt(o) {
220
219
  var e;
221
220
  const {
222
221
  disabled: n = !1,
223
222
  id: a,
224
223
  rootRef: l,
225
- label: s,
224
+ label: i,
226
225
  disableFocusOnHover: c = !1
227
- } = t, i = fe(a), d = y.useRef(null), p = y.useMemo(() => ({
226
+ } = o, s = xe(a), u = I.useRef(null), d = I.useMemo(() => ({
228
227
  disabled: n,
229
- id: i ?? "",
230
- label: s,
231
- ref: d
232
- }), [n, i, s]), {
233
- dispatch: f
234
- } = (e = y.useContext(Ee)) != null ? e : lt, {
228
+ id: s ?? "",
229
+ label: i,
230
+ ref: u
231
+ }), [n, s, i]), {
232
+ dispatch: p
233
+ } = (e = I.useContext(Le)) != null ? e : pt, {
235
234
  getRootProps: g,
236
- highlighted: m
237
- } = wo({
238
- item: i,
235
+ highlighted: x
236
+ } = Wo({
237
+ item: s,
239
238
  handlePointerOverEvents: !c
240
239
  }), {
241
- index: v,
242
- totalItemCount: C
243
- } = Ao(i ?? st, p), {
244
- getRootProps: S,
245
- focusVisible: P,
246
- rootRef: b
247
- } = we({
240
+ index: f,
241
+ totalItemCount: b
242
+ } = Go(s ?? ut, d), {
243
+ getRootProps: C,
244
+ focusVisible: R,
245
+ rootRef: S
246
+ } = Ge({
248
247
  disabled: n,
249
248
  focusableWhenDisabled: !0
250
- }), M = _e(b, l, d);
251
- y.useDebugValue({
252
- id: i,
253
- highlighted: m,
249
+ }), T = Ke(S, l, u);
250
+ I.useDebugValue({
251
+ id: s,
252
+ highlighted: x,
254
253
  disabled: n,
255
- label: s
254
+ label: i
256
255
  });
257
- const u = (I) => (D) => {
258
- var z;
259
- (z = I.onClick) == null || z.call(I, D), !D.defaultMuiPrevented && f({
260
- type: Me.close,
261
- event: D
256
+ const y = (E) => (h) => {
257
+ var O;
258
+ (O = E.onClick) == null || O.call(E, h), !h.defaultMuiPrevented && p({
259
+ type: ke.close,
260
+ event: h
262
261
  });
263
- }, E = (I = {}) => x({}, I, {
264
- onClick: u(I)
262
+ }, $ = (E = {}) => M({}, E, {
263
+ onClick: y(E)
265
264
  });
266
- function F(I = {}) {
267
- const D = Le(I), z = Pe(E, Pe(S, g));
268
- return x({}, I, D, z(D), {
269
- id: i,
270
- ref: M,
265
+ function v(E = {}) {
266
+ const h = We(E), O = Oe($, Oe(C, g));
267
+ return M({}, E, h, O(h), {
268
+ id: s,
269
+ ref: T,
271
270
  role: "menuitem"
272
271
  });
273
272
  }
274
- return i === void 0 ? {
275
- getRootProps: F,
273
+ return s === void 0 ? {
274
+ getRootProps: v,
276
275
  disabled: !1,
277
- focusVisible: P,
276
+ focusVisible: R,
278
277
  highlighted: !1,
279
278
  index: -1,
280
279
  totalItemCount: 0,
281
- rootRef: M
280
+ rootRef: T
282
281
  } : {
283
- getRootProps: F,
282
+ getRootProps: v,
284
283
  disabled: n,
285
- focusVisible: P,
286
- highlighted: m,
287
- index: v,
288
- totalItemCount: C,
289
- rootRef: M
284
+ focusVisible: R,
285
+ highlighted: x,
286
+ index: f,
287
+ totalItemCount: b,
288
+ rootRef: T
290
289
  };
291
290
  }
292
- function at(t) {
293
- const e = y.useContext(ke);
291
+ function ft(o) {
292
+ const e = I.useContext(_e);
294
293
  if (!e)
295
294
  throw new Error("MenuItem: ListContext was not found.");
296
- const n = fe(t), {
295
+ const n = xe(o), {
297
296
  getItemState: a,
298
297
  dispatch: l
299
298
  } = e;
300
- let s;
301
- n != null ? s = a(n) : s = {
299
+ let i;
300
+ n != null ? i = a(n) : i = {
302
301
  focusable: !0,
303
302
  highlighted: !1,
304
303
  selected: !1
305
304
  };
306
305
  const {
307
306
  highlighted: c,
308
- selected: i,
309
- focusable: d
310
- } = s, p = y.useCallback((g) => {
307
+ selected: s,
308
+ focusable: u
309
+ } = i, d = I.useCallback((g) => {
311
310
  if (g !== n)
312
311
  throw new Error(["Base UI MenuItem: Tried to access the state of another MenuItem.", `itemValue: ${g} | id: ${n}`, "This is unsupported when the MenuItem uses the MenuItemContextStabilizer as a performance optimization."].join("/n"));
313
312
  return {
314
313
  highlighted: c,
315
- selected: i,
316
- focusable: d
314
+ selected: s,
315
+ focusable: u
317
316
  };
318
- }, [c, i, d, n]);
317
+ }, [c, s, u, n]);
319
318
  return {
320
- contextValue: y.useMemo(() => ({
319
+ contextValue: I.useMemo(() => ({
321
320
  dispatch: l,
322
- getItemState: p
323
- }), [l, p]),
321
+ getItemState: d
322
+ }), [l, d]),
324
323
  id: n
325
324
  };
326
325
  }
327
- const ct = ["className", "children", "component", "inset", "orientation", "role", "slots", "slotProps"], dt = (t) => {
326
+ const vt = ["className", "children", "component", "inset", "orientation", "role", "slots", "slotProps"], ht = (o) => {
328
327
  const {
329
328
  orientation: e,
330
329
  inset: n
331
- } = t, a = {
332
- root: ["root", e, n && `inset${U(n)}`]
330
+ } = o, a = {
331
+ root: ["root", e, n && `inset${G(n)}`]
333
332
  };
334
- return ce(a, Qo, {});
335
- }, ut = J("hr", {
333
+ return me(a, st, {});
334
+ }, yt = Q("hr", {
336
335
  name: "JoyDivider",
337
336
  slot: "Root",
338
- overridesResolver: (t, e) => e.root
337
+ overridesResolver: (o, e) => e.root
339
338
  })(({
340
- theme: t,
339
+ theme: o,
341
340
  ownerState: e
342
- }) => x({
341
+ }) => M({
343
342
  "--Divider-thickness": "1px",
344
- "--Divider-lineColor": t.vars.palette.divider
343
+ "--Divider-lineColor": o.vars.palette.divider
345
344
  }, e.inset === "none" && {
346
345
  "--_Divider-inset": "0px"
347
346
  }, e.inset === "context" && {
@@ -354,8 +353,8 @@ const ct = ["className", "children", "component", "inset", "orientation", "role"
354
353
  position: "relative",
355
354
  alignSelf: "stretch",
356
355
  flexShrink: 0
357
- }, e.children ? x({
358
- "--Divider-gap": t.spacing(1),
356
+ }, e.children ? M({
357
+ "--Divider-gap": o.spacing(1),
359
358
  "--Divider-childPosition": "50%",
360
359
  display: "flex",
361
360
  flexDirection: e.orientation === "vertical" ? "column" : "row",
@@ -363,7 +362,7 @@ const ct = ["className", "children", "component", "inset", "orientation", "role"
363
362
  whiteSpace: "nowrap",
364
363
  textAlign: "center",
365
364
  border: 0
366
- }, t.typography["body-sm"], {
365
+ }, o.typography["body-sm"], {
367
366
  "&::before, &::after": {
368
367
  position: "relative",
369
368
  inlineSize: e.orientation === "vertical" ? "var(--Divider-thickness)" : "initial",
@@ -390,48 +389,48 @@ const ct = ["className", "children", "component", "inset", "orientation", "role"
390
389
  // use logical size + background is better than border because they work with gradient.
391
390
  inlineSize: e.orientation === "vertical" ? "var(--Divider-thickness)" : "initial",
392
391
  blockSize: e.orientation === "vertical" ? "initial" : "var(--Divider-thickness)"
393
- })), Oe = /* @__PURE__ */ y.forwardRef(function(e, n) {
394
- const a = ie({
392
+ })), Fe = /* @__PURE__ */ I.forwardRef(function(e, n) {
393
+ const a = ue({
395
394
  props: e,
396
395
  name: "JoyDivider"
397
396
  }), {
398
397
  className: l,
399
- children: s,
400
- component: c = s != null ? "div" : "hr",
401
- inset: i,
402
- orientation: d = "horizontal",
403
- role: p = c !== "hr" ? "separator" : void 0,
404
- slots: f = {},
398
+ children: i,
399
+ component: c = i != null ? "div" : "hr",
400
+ inset: s,
401
+ orientation: u = "horizontal",
402
+ role: d = c !== "hr" ? "separator" : void 0,
403
+ slots: p = {},
405
404
  slotProps: g = {}
406
- } = a, m = ae(a, ct), v = x({}, a, {
407
- inset: i,
408
- role: p,
409
- orientation: d,
405
+ } = a, x = pe(a, vt), f = M({}, a, {
406
+ inset: s,
407
+ role: d,
408
+ orientation: u,
410
409
  component: c
411
- }), C = dt(v), S = x({}, m, {
410
+ }), b = ht(f), C = M({}, x, {
412
411
  component: c,
413
- slots: f,
412
+ slots: p,
414
413
  slotProps: g
415
- }), [P, b] = Y("root", {
414
+ }), [R, S] = Z("root", {
416
415
  ref: n,
417
- className: Ae(C.root, l),
418
- elementType: ut,
419
- externalForwardedProps: S,
420
- ownerState: v,
421
- additionalProps: x({
416
+ className: Je(b.root, l),
417
+ elementType: yt,
418
+ externalForwardedProps: C,
419
+ ownerState: f,
420
+ additionalProps: M({
422
421
  as: c,
423
- role: p
424
- }, p === "separator" && d === "vertical" && {
422
+ role: d
423
+ }, d === "separator" && u === "vertical" && {
425
424
  // The implicit aria-orientation of separator is 'horizontal'
426
425
  // https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/separator_role
427
426
  "aria-orientation": "vertical"
428
427
  })
429
428
  });
430
- return /* @__PURE__ */ r(P, x({}, b, {
431
- children: s
429
+ return /* @__PURE__ */ r(R, M({}, S, {
430
+ children: i
432
431
  }));
433
432
  });
434
- process.env.NODE_ENV !== "production" && (Oe.propTypes = {
433
+ process.env.NODE_ENV !== "production" && (Fe.propTypes = {
435
434
  // ┌────────────────────────────── Warning ──────────────────────────────┐
436
435
  // │ These PropTypes are generated from the TypeScript type definitions. │
437
436
  // │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
@@ -439,173 +438,173 @@ process.env.NODE_ENV !== "production" && (Oe.propTypes = {
439
438
  /**
440
439
  * The content of the component.
441
440
  */
442
- children: o.node,
441
+ children: t.node,
443
442
  /**
444
443
  * @ignore
445
444
  */
446
- className: o.string,
445
+ className: t.string,
447
446
  /**
448
447
  * The component used for the root node.
449
448
  * Either a string to use a HTML element or a component.
450
449
  */
451
- component: o.elementType,
450
+ component: t.elementType,
452
451
  /**
453
452
  * Class name applied to the divider to shrink or stretch the line based on the orientation.
454
453
  */
455
- inset: o.oneOfType([o.oneOf(["none", "context"]), o.string]),
454
+ inset: t.oneOfType([t.oneOf(["none", "context"]), t.string]),
456
455
  /**
457
456
  * The component orientation.
458
457
  * @default 'horizontal'
459
458
  */
460
- orientation: o.oneOf(["horizontal", "vertical"]),
459
+ orientation: t.oneOf(["horizontal", "vertical"]),
461
460
  /**
462
461
  * @ignore
463
462
  */
464
- role: o.string,
463
+ role: t.string,
465
464
  /**
466
465
  * The props used for each slot inside.
467
466
  * @default {}
468
467
  */
469
- slotProps: o.shape({
470
- root: o.oneOfType([o.func, o.object])
468
+ slotProps: t.shape({
469
+ root: t.oneOfType([t.func, t.object])
471
470
  }),
472
471
  /**
473
472
  * The components used for each slot inside.
474
473
  * @default {}
475
474
  */
476
- slots: o.shape({
477
- root: o.elementType
475
+ slots: t.shape({
476
+ root: t.elementType
478
477
  }),
479
478
  /**
480
479
  * The system prop that allows defining system overrides as well as additional CSS styles.
481
480
  */
482
- sx: o.oneOfType([o.arrayOf(o.oneOfType([o.func, o.object, o.bool])), o.func, o.object])
481
+ sx: t.oneOfType([t.arrayOf(t.oneOfType([t.func, t.object, t.bool])), t.func, t.object])
483
482
  });
484
- Oe.muiName = "Divider";
485
- function pt(t) {
486
- return ve("MuiMenu", t);
483
+ Fe.muiName = "Divider";
484
+ function gt(o) {
485
+ return Ce("MuiMenu", o);
487
486
  }
488
- he("MuiMenu", ["root", "listbox", "expanded", "colorPrimary", "colorNeutral", "colorDanger", "colorSuccess", "colorWarning", "colorContext", "variantPlain", "variantOutlined", "variantSoft", "variantSolid", "sizeSm", "sizeMd", "sizeLg"]);
489
- const mt = ["actions", "children", "color", "component", "disablePortal", "keepMounted", "id", "invertedColors", "onItemsChange", "modifiers", "variant", "size", "slots", "slotProps"], ft = (t) => {
487
+ Re("MuiMenu", ["root", "listbox", "expanded", "colorPrimary", "colorNeutral", "colorDanger", "colorSuccess", "colorWarning", "colorContext", "variantPlain", "variantOutlined", "variantSoft", "variantSolid", "sizeSm", "sizeMd", "sizeLg"]);
488
+ const bt = ["actions", "children", "color", "component", "disablePortal", "keepMounted", "id", "invertedColors", "onItemsChange", "modifiers", "variant", "size", "slots", "slotProps"], xt = (o) => {
490
489
  const {
491
490
  open: e,
492
491
  variant: n,
493
492
  color: a,
494
493
  size: l
495
- } = t, s = {
496
- root: ["root", e && "expanded", n && `variant${U(n)}`, a && `color${U(a)}`, l && `size${U(l)}`],
494
+ } = o, i = {
495
+ root: ["root", e && "expanded", n && `variant${G(n)}`, a && `color${G(a)}`, l && `size${G(l)}`],
497
496
  listbox: ["listbox"]
498
497
  };
499
- return ce(s, pt, {});
500
- }, Ve = J(Bo, {
498
+ return me(i, gt, {});
499
+ }, He = Q(Jo, {
501
500
  name: "JoyMenu",
502
501
  slot: "Root",
503
- overridesResolver: (t, e) => e.root
502
+ overridesResolver: (o, e) => e.root
504
503
  })(({
505
- theme: t,
504
+ theme: o,
506
505
  ownerState: e
507
506
  }) => {
508
507
  var n, a;
509
- const l = (n = t.variants[e.variant]) == null ? void 0 : n[e.color];
510
- return [x({
511
- "--focus-outline-offset": `calc(${t.vars.focus.thickness} * -1)`,
508
+ const l = (n = o.variants[e.variant]) == null ? void 0 : n[e.color];
509
+ return [M({
510
+ "--focus-outline-offset": `calc(${o.vars.focus.thickness} * -1)`,
512
511
  // to prevent the focus outline from being cut by overflow
513
- "--ListItem-stickyBackground": (l == null ? void 0 : l.backgroundColor) || (l == null ? void 0 : l.background) || t.vars.palette.background.popup,
512
+ "--ListItem-stickyBackground": (l == null ? void 0 : l.backgroundColor) || (l == null ? void 0 : l.background) || o.vars.palette.background.popup,
514
513
  "--ListItem-stickyTop": "calc(var(--List-padding, var(--ListDivider-gap)) * -1)"
515
- }, Ho, {
516
- borderRadius: `var(--List-radius, ${t.vars.radius.sm})`,
517
- boxShadow: t.shadow.md,
514
+ }, qo, {
515
+ borderRadius: `var(--List-radius, ${o.vars.radius.sm})`,
516
+ boxShadow: o.shadow.md,
518
517
  overflow: "auto",
519
518
  // `unstable_popup-zIndex` is a private variable that lets other component, for example Modal, to override the z-index so that the listbox can be displayed above the Modal.
520
- zIndex: `var(--unstable_popup-zIndex, ${t.vars.zIndex.popup})`
519
+ zIndex: `var(--unstable_popup-zIndex, ${o.vars.zIndex.popup})`
521
520
  }, !(l != null && l.backgroundColor) && {
522
- backgroundColor: t.vars.palette.background.popup
523
- }, e.variant === "solid" && e.color && e.invertedColors && yo(e.color)(t), e.variant === "soft" && e.color && e.invertedColors && bo(e.color)(t), (a = t.variants[e.variant]) == null ? void 0 : a[e.color])];
524
- }), We = /* @__PURE__ */ y.forwardRef(function(e, n) {
521
+ backgroundColor: o.vars.palette.background.popup
522
+ }, e.variant === "solid" && e.color && e.invertedColors && Co(e.color)(o), e.variant === "soft" && e.color && e.invertedColors && Ro(e.color)(o), (a = o.variants[e.variant]) == null ? void 0 : a[e.color])];
523
+ }), eo = /* @__PURE__ */ I.forwardRef(function(e, n) {
525
524
  var a;
526
- const l = ie({
525
+ const l = ue({
527
526
  props: e,
528
527
  name: "JoyMenu"
529
528
  }), {
530
- actions: s,
529
+ actions: i,
531
530
  children: c,
532
- color: i = "neutral",
533
- component: d,
534
- disablePortal: p = !1,
535
- keepMounted: f = !1,
531
+ color: s = "neutral",
532
+ component: u,
533
+ disablePortal: d = !1,
534
+ keepMounted: p = !1,
536
535
  id: g,
537
- invertedColors: m = !1,
538
- onItemsChange: v,
539
- modifiers: C,
540
- variant: S = "outlined",
541
- size: P = "md",
542
- slots: b = {},
543
- slotProps: M = {}
544
- } = l, u = ae(l, mt), {
545
- contextValue: E,
546
- getListboxProps: F,
547
- dispatch: I,
548
- open: D,
549
- triggerElement: z
550
- } = nt({
551
- onItemsChange: v,
536
+ invertedColors: x = !1,
537
+ onItemsChange: f,
538
+ modifiers: b,
539
+ variant: C = "outlined",
540
+ size: R = "md",
541
+ slots: S = {},
542
+ slotProps: T = {}
543
+ } = l, y = pe(l, bt), {
544
+ contextValue: $,
545
+ getListboxProps: v,
546
+ dispatch: E,
547
+ open: h,
548
+ triggerElement: O
549
+ } = ct({
550
+ onItemsChange: f,
552
551
  id: g,
553
552
  listboxRef: n
554
553
  });
555
- y.useImperativeHandle(s, () => ({
556
- dispatch: I,
557
- resetHighlight: () => I({
558
- type: pe.resetHighlight,
554
+ I.useImperativeHandle(i, () => ({
555
+ dispatch: E,
556
+ resetHighlight: () => E({
557
+ type: ye.resetHighlight,
559
558
  event: null
560
559
  })
561
- }), [I]);
562
- const B = x({}, l, {
563
- disablePortal: p,
564
- invertedColors: m,
565
- color: i,
566
- variant: S,
567
- size: P,
568
- open: D,
560
+ }), [E]);
561
+ const N = M({}, l, {
562
+ disablePortal: d,
563
+ invertedColors: x,
564
+ color: s,
565
+ variant: C,
566
+ size: R,
567
+ open: h,
569
568
  nesting: !1,
570
569
  row: !1
571
- }), H = ft(B), $ = x({}, u, {
572
- component: d,
573
- slots: b,
574
- slotProps: M
575
- }), T = y.useMemo(() => [{
570
+ }), A = xt(N), j = M({}, y, {
571
+ component: u,
572
+ slots: S,
573
+ slotProps: T
574
+ }), U = I.useMemo(() => [{
576
575
  name: "offset",
577
576
  options: {
578
577
  offset: [0, 4]
579
578
  }
580
- }, ...C || []], [C]), R = xo({
581
- elementType: Ve,
582
- getSlotProps: F,
583
- externalForwardedProps: $,
579
+ }, ...b || []], [b]), B = Po({
580
+ elementType: He,
581
+ getSlotProps: v,
582
+ externalForwardedProps: j,
584
583
  externalSlotProps: {},
585
- ownerState: B,
584
+ ownerState: N,
586
585
  additionalProps: {
587
- anchorEl: z,
588
- open: D && z !== null,
589
- disablePortal: p,
590
- keepMounted: f,
591
- modifiers: T
586
+ anchorEl: O,
587
+ open: h && O !== null,
588
+ disablePortal: d,
589
+ keepMounted: p,
590
+ modifiers: U
592
591
  },
593
- className: H.root
592
+ className: A.root
594
593
  });
595
- return /* @__PURE__ */ r(Ve, x({}, R, !((a = l.slots) != null && a.root) && {
596
- as: Co,
594
+ return /* @__PURE__ */ r(He, M({}, B, !((a = l.slots) != null && a.root) && {
595
+ as: So,
597
596
  slots: {
598
- root: d || "ul"
597
+ root: u || "ul"
599
598
  }
600
599
  }, {
601
- children: /* @__PURE__ */ r(rt, {
602
- value: E,
603
- children: /* @__PURE__ */ r(jo, {
604
- variant: m ? void 0 : S,
605
- color: i,
606
- children: /* @__PURE__ */ r(Uo.Provider, {
600
+ children: /* @__PURE__ */ r(dt, {
601
+ value: $,
602
+ children: /* @__PURE__ */ r(Xo, {
603
+ variant: x ? void 0 : C,
604
+ color: s,
605
+ children: /* @__PURE__ */ r(Yo.Provider, {
607
606
  value: "menu",
608
- children: /* @__PURE__ */ r(Ko, {
607
+ children: /* @__PURE__ */ r(Qo, {
609
608
  nested: !0,
610
609
  children: c
611
610
  })
@@ -614,7 +613,7 @@ const mt = ["actions", "children", "color", "component", "disablePortal", "keepM
614
613
  })
615
614
  }));
616
615
  });
617
- process.env.NODE_ENV !== "production" && (We.propTypes = {
616
+ process.env.NODE_ENV !== "production" && (eo.propTypes = {
618
617
  // ┌────────────────────────────── Warning ──────────────────────────────┐
619
618
  // │ These PropTypes are generated from the TypeScript type definitions. │
620
619
  // │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
@@ -623,42 +622,42 @@ process.env.NODE_ENV !== "production" && (We.propTypes = {
623
622
  * A ref with imperative actions.
624
623
  * It allows to select the first or last menu item.
625
624
  */
626
- actions: Ro,
625
+ actions: Io,
627
626
  /**
628
627
  * @ignore
629
628
  */
630
- children: o.node,
629
+ children: t.node,
631
630
  /**
632
631
  * The color of the component. It supports those theme colors that make sense for this component.
633
632
  * @default 'neutral'
634
633
  */
635
- color: o.oneOf(["danger", "neutral", "primary", "success", "warning"]),
634
+ color: t.oneOf(["danger", "neutral", "primary", "success", "warning"]),
636
635
  /**
637
636
  * The component used for the root node.
638
637
  * Either a string to use a HTML element or a component.
639
638
  */
640
- component: o.elementType,
639
+ component: t.elementType,
641
640
  /**
642
641
  * The `children` will be under the DOM hierarchy of the parent component.
643
642
  * @default false
644
643
  */
645
- disablePortal: o.bool,
644
+ disablePortal: t.bool,
646
645
  /**
647
646
  * @ignore
648
647
  */
649
- id: o.string,
648
+ id: t.string,
650
649
  /**
651
650
  * If `true`, the children with an implicit color prop invert their colors to match the component's variant and color.
652
651
  * @default false
653
652
  */
654
- invertedColors: o.bool,
653
+ invertedColors: t.bool,
655
654
  /**
656
655
  * Always keep the children in the DOM.
657
656
  * This prop can be useful in SEO situation or
658
657
  * when you want to maximize the responsiveness of the Popper.
659
658
  * @default false
660
659
  */
661
- keepMounted: o.bool,
660
+ keepMounted: t.bool,
662
661
  /**
663
662
  * Popper.js is based on a "plugin-like" architecture,
664
663
  * most of its features are fully encapsulated "modifiers".
@@ -668,145 +667,145 @@ process.env.NODE_ENV !== "production" && (We.propTypes = {
668
667
  * For this reason, modifiers should be very performant to avoid bottlenecks.
669
668
  * To learn how to create a modifier, [read the modifiers documentation](https://popper.js.org/docs/v2/modifiers/).
670
669
  */
671
- modifiers: o.arrayOf(o.shape({
672
- data: o.object,
673
- effect: o.func,
674
- enabled: o.bool,
675
- fn: o.func,
676
- name: o.any,
677
- options: o.object,
678
- phase: o.oneOf(["afterMain", "afterRead", "afterWrite", "beforeMain", "beforeRead", "beforeWrite", "main", "read", "write"]),
679
- requires: o.arrayOf(o.string),
680
- requiresIfExists: o.arrayOf(o.string)
670
+ modifiers: t.arrayOf(t.shape({
671
+ data: t.object,
672
+ effect: t.func,
673
+ enabled: t.bool,
674
+ fn: t.func,
675
+ name: t.any,
676
+ options: t.object,
677
+ phase: t.oneOf(["afterMain", "afterRead", "afterWrite", "beforeMain", "beforeRead", "beforeWrite", "main", "read", "write"]),
678
+ requires: t.arrayOf(t.string),
679
+ requiresIfExists: t.arrayOf(t.string)
681
680
  })),
682
681
  /**
683
682
  * Triggered when focus leaves the menu and the menu should close.
684
683
  */
685
- onClose: o.func,
684
+ onClose: t.func,
686
685
  /**
687
686
  * Function called when the items displayed in the menu change.
688
687
  */
689
- onItemsChange: o.func,
688
+ onItemsChange: t.func,
690
689
  /**
691
690
  * Controls whether the menu is displayed.
692
691
  * @default false
693
692
  */
694
- open: o.bool,
693
+ open: t.bool,
695
694
  /**
696
695
  * The size of the component (affect other nested list* components because the `Menu` inherits `List`).
697
696
  * @default 'md'
698
697
  */
699
- size: o.oneOfType([o.oneOf(["sm", "md", "lg"]), o.string]),
698
+ size: t.oneOfType([t.oneOf(["sm", "md", "lg"]), t.string]),
700
699
  /**
701
700
  * The props used for each slot inside.
702
701
  * @default {}
703
702
  */
704
- slotProps: o.shape({
705
- root: o.oneOfType([o.func, o.object])
703
+ slotProps: t.shape({
704
+ root: t.oneOfType([t.func, t.object])
706
705
  }),
707
706
  /**
708
707
  * The components used for each slot inside.
709
708
  * @default {}
710
709
  */
711
- slots: o.shape({
712
- root: o.elementType
710
+ slots: t.shape({
711
+ root: t.elementType
713
712
  }),
714
713
  /**
715
714
  * The system prop that allows defining system overrides as well as additional CSS styles.
716
715
  */
717
- sx: o.oneOfType([o.arrayOf(o.oneOfType([o.func, o.object, o.bool])), o.func, o.object]),
716
+ sx: t.oneOfType([t.arrayOf(t.oneOfType([t.func, t.object, t.bool])), t.func, t.object]),
718
717
  /**
719
718
  * The [global variant](https://mui.com/joy-ui/main-features/global-variants/) to use.
720
719
  * @default 'outlined'
721
720
  */
722
- variant: o.oneOfType([o.oneOf(["outlined", "plain", "soft", "solid"]), o.string])
721
+ variant: t.oneOfType([t.oneOf(["outlined", "plain", "soft", "solid"]), t.string])
723
722
  });
724
- function vt(t) {
725
- return ve("MuiMenuItem", t);
723
+ function Ct(o) {
724
+ return Ce("MuiMenuItem", o);
726
725
  }
727
- he("MuiMenuItem", ["root", "focusVisible", "disabled", "selected", "colorPrimary", "colorNeutral", "colorDanger", "colorSuccess", "colorWarning", "colorContext", "variantPlain", "variantSoft", "variantOutlined", "variantSolid"]);
728
- const ht = ["children", "disabled", "component", "selected", "color", "orientation", "variant", "slots", "slotProps", "id"], gt = (t) => {
726
+ Re("MuiMenuItem", ["root", "focusVisible", "disabled", "selected", "colorPrimary", "colorNeutral", "colorDanger", "colorSuccess", "colorWarning", "colorContext", "variantPlain", "variantSoft", "variantOutlined", "variantSolid"]);
727
+ const Rt = ["children", "disabled", "component", "selected", "color", "orientation", "variant", "slots", "slotProps", "id"], Pt = (o) => {
729
728
  const {
730
729
  focusVisible: e,
731
730
  disabled: n,
732
731
  selected: a,
733
732
  color: l,
734
- variant: s
735
- } = t, c = {
736
- root: ["root", e && "focusVisible", n && "disabled", a && "selected", l && `color${U(l)}`, s && `variant${U(s)}`]
733
+ variant: i
734
+ } = o, c = {
735
+ root: ["root", e && "focusVisible", n && "disabled", a && "selected", l && `color${G(l)}`, i && `variant${G(i)}`]
737
736
  };
738
- return ce(c, vt, {});
739
- }, yt = J(Wo, {
737
+ return me(c, Ct, {});
738
+ }, St = Q(Zo, {
740
739
  name: "JoyMenuItem",
741
740
  slot: "Root",
742
- overridesResolver: (t, e) => e.root
743
- })({}), bt = /* @__PURE__ */ y.memo(/* @__PURE__ */ y.forwardRef(function(e, n) {
744
- const a = ie({
741
+ overridesResolver: (o, e) => e.root
742
+ })({}), It = /* @__PURE__ */ I.memo(/* @__PURE__ */ I.forwardRef(function(e, n) {
743
+ const a = ue({
745
744
  props: e,
746
745
  name: "JoyMenuItem"
747
- }), l = y.useContext(Go), {
748
- children: s,
746
+ }), l = I.useContext(et), {
747
+ children: i,
749
748
  disabled: c = !1,
750
- component: i = "li",
751
- selected: d = !1,
752
- color: p = "neutral",
753
- orientation: f = "horizontal",
749
+ component: s = "li",
750
+ selected: u = !1,
751
+ color: d = "neutral",
752
+ orientation: p = "horizontal",
754
753
  variant: g = "plain",
755
- slots: m = {},
756
- slotProps: v = {},
757
- id: C
758
- } = a, S = ae(a, ht), {
759
- variant: P = g,
760
- color: b = p
761
- } = Jo(e.variant, e.color), {
762
- getRootProps: M,
763
- disabled: u,
764
- focusVisible: E
765
- } = it({
766
- id: C,
754
+ slots: x = {},
755
+ slotProps: f = {},
756
+ id: b
757
+ } = a, C = pe(a, Rt), {
758
+ variant: R = g,
759
+ color: S = d
760
+ } = ot(e.variant, e.color), {
761
+ getRootProps: T,
762
+ disabled: y,
763
+ focusVisible: $
764
+ } = mt({
765
+ id: b,
767
766
  disabled: c,
768
767
  rootRef: n
769
- }), F = x({}, a, {
770
- component: i,
771
- color: b,
772
- disabled: u,
773
- focusVisible: E,
774
- orientation: f,
775
- selected: d,
768
+ }), v = M({}, a, {
769
+ component: s,
770
+ color: S,
771
+ disabled: y,
772
+ focusVisible: $,
773
+ orientation: p,
774
+ selected: u,
776
775
  row: l,
777
- variant: P
778
- }), I = gt(F), D = x({}, S, {
779
- component: i,
780
- slots: m,
781
- slotProps: v
782
- }), [z, B] = Y("root", {
776
+ variant: R
777
+ }), E = Pt(v), h = M({}, C, {
778
+ component: s,
779
+ slots: x,
780
+ slotProps: f
781
+ }), [O, N] = Z("root", {
783
782
  ref: n,
784
- elementType: yt,
785
- getSlotProps: M,
786
- externalForwardedProps: D,
787
- className: I.root,
788
- ownerState: F
783
+ elementType: St,
784
+ getSlotProps: T,
785
+ externalForwardedProps: h,
786
+ className: E.root,
787
+ ownerState: v
789
788
  });
790
- return /* @__PURE__ */ r(qo.Provider, {
791
- value: f,
792
- children: /* @__PURE__ */ r(z, x({}, B, {
793
- children: s
789
+ return /* @__PURE__ */ r(tt.Provider, {
790
+ value: p,
791
+ children: /* @__PURE__ */ r(O, M({}, N, {
792
+ children: i
794
793
  }))
795
794
  });
796
- })), Ie = /* @__PURE__ */ y.forwardRef(function(e, n) {
795
+ })), Ve = /* @__PURE__ */ I.forwardRef(function(e, n) {
797
796
  const {
798
797
  contextValue: a,
799
798
  id: l
800
- } = at(e.id);
801
- return /* @__PURE__ */ r(ke.Provider, {
799
+ } = ft(e.id);
800
+ return /* @__PURE__ */ r(_e.Provider, {
802
801
  value: a,
803
- children: /* @__PURE__ */ r(bt, x({}, e, {
802
+ children: /* @__PURE__ */ r(It, M({}, e, {
804
803
  id: l,
805
804
  ref: n
806
805
  }))
807
806
  });
808
807
  });
809
- process.env.NODE_ENV !== "production" && (Ie.propTypes = {
808
+ process.env.NODE_ENV !== "production" && (Ve.propTypes = {
810
809
  // ┌────────────────────────────── Warning ──────────────────────────────┐
811
810
  // │ These PropTypes are generated from the TypeScript type definitions. │
812
811
  // │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
@@ -814,39 +813,39 @@ process.env.NODE_ENV !== "production" && (Ie.propTypes = {
814
813
  /**
815
814
  * The content of the component.
816
815
  */
817
- children: o.node,
818
- id: o.string
816
+ children: t.node,
817
+ id: t.string
819
818
  });
820
- function xt(t) {
821
- return ve("MuiModalClose", t);
819
+ function Mt(o) {
820
+ return Ce("MuiModalClose", o);
822
821
  }
823
- he("MuiModalClose", ["root", "colorPrimary", "colorNeutral", "colorDanger", "colorSuccess", "colorWarning", "colorContext", "variantPlain", "variantOutlined", "variantSoft", "variantSolid", "sizeSm", "sizeMd", "sizeLg"]);
824
- var Fe;
825
- const Ct = ["component", "color", "variant", "size", "onClick", "slots", "slotProps"], Rt = (t) => {
822
+ Re("MuiModalClose", ["root", "colorPrimary", "colorNeutral", "colorDanger", "colorSuccess", "colorWarning", "colorContext", "variantPlain", "variantOutlined", "variantSoft", "variantSolid", "sizeSm", "sizeMd", "sizeLg"]);
823
+ var je;
824
+ const Dt = ["component", "color", "variant", "size", "onClick", "slots", "slotProps"], zt = (o) => {
826
825
  const {
827
826
  variant: e,
828
827
  color: n,
829
828
  disabled: a,
830
829
  focusVisible: l,
831
- size: s
832
- } = t, c = {
833
- root: ["root", a && "disabled", l && "focusVisible", e && `variant${U(e)}`, n && `color${U(n)}`, s && `size${U(s)}`]
830
+ size: i
831
+ } = o, c = {
832
+ root: ["root", a && "disabled", l && "focusVisible", e && `variant${G(e)}`, n && `color${G(n)}`, i && `size${G(i)}`]
834
833
  };
835
- return ce(c, xt, {});
836
- }, Pt = J(Po, {
834
+ return me(c, Mt, {});
835
+ }, Tt = Q(Mo, {
837
836
  name: "JoyModalClose",
838
837
  slot: "Root",
839
- overridesResolver: (t, e) => e.root
838
+ overridesResolver: (o, e) => e.root
840
839
  })(({
841
- ownerState: t,
840
+ ownerState: o,
842
841
  theme: e
843
842
  }) => {
844
843
  var n;
845
- return x({}, t.size === "sm" && {
844
+ return M({}, o.size === "sm" && {
846
845
  "--IconButton-size": "1.75rem"
847
- }, t.size === "md" && {
846
+ }, o.size === "md" && {
848
847
  "--IconButton-size": "2rem"
849
- }, t.size === "lg" && {
848
+ }, o.size === "lg" && {
850
849
  "--IconButton-size": "2.25rem"
851
850
  }, {
852
851
  position: "absolute",
@@ -855,59 +854,59 @@ const Ct = ["component", "color", "variant", "size", "onClick", "slots", "slotPr
855
854
  top: "var(--ModalClose-inset, 0.625rem)",
856
855
  right: "var(--ModalClose-inset, 0.625rem)",
857
856
  borderRadius: `var(--ModalClose-radius, ${e.vars.radius.sm})`
858
- }, !((n = e.variants[t.variant]) != null && (n = n[t.color]) != null && n.backgroundColor) && {
857
+ }, !((n = e.variants[o.variant]) != null && (n = n[o.color]) != null && n.backgroundColor) && {
859
858
  color: e.vars.palette.text.secondary
860
859
  });
861
- }), St = {
860
+ }), Et = {
862
861
  plain: "plain",
863
862
  outlined: "plain",
864
863
  soft: "soft",
865
864
  solid: "solid"
866
- }, Ge = /* @__PURE__ */ y.forwardRef(function(e, n) {
867
- var a, l, s, c, i, d;
868
- const p = ie({
865
+ }, oo = /* @__PURE__ */ I.forwardRef(function(e, n) {
866
+ var a, l, i, c, s, u;
867
+ const d = ue({
869
868
  props: e,
870
869
  name: "JoyModalClose"
871
870
  }), {
872
- component: f = "button",
871
+ component: p = "button",
873
872
  color: g = "neutral",
874
- variant: m = "plain",
875
- size: v = "md",
876
- onClick: C,
877
- slots: S = {},
878
- slotProps: P = {}
879
- } = p, b = ae(p, Ct), M = y.useContext(To), u = y.useContext(ko), E = (a = (l = e.variant) != null ? l : St[u == null ? void 0 : u.variant]) != null ? a : m, F = (s = (c = e.color) != null ? c : u == null ? void 0 : u.color) != null ? s : g, I = y.useContext(Eo), D = (i = (d = e.size) != null ? d : I) != null ? i : v, {
880
- focusVisible: z,
881
- getRootProps: B
882
- } = we(x({}, p, {
873
+ variant: x = "plain",
874
+ size: f = "md",
875
+ onClick: b,
876
+ slots: C = {},
877
+ slotProps: R = {}
878
+ } = d, S = pe(d, Dt), T = I.useContext(No), y = I.useContext(_o), $ = (a = (l = e.variant) != null ? l : Et[y == null ? void 0 : y.variant]) != null ? a : x, v = (i = (c = e.color) != null ? c : y == null ? void 0 : y.color) != null ? i : g, E = I.useContext(Lo), h = (s = (u = e.size) != null ? u : E) != null ? s : f, {
879
+ focusVisible: O,
880
+ getRootProps: N
881
+ } = Ge(M({}, d, {
883
882
  rootRef: n
884
- })), H = x({}, p, {
885
- color: F,
886
- component: f,
887
- variant: E,
888
- size: D,
889
- focusVisible: z
890
- }), $ = Rt(H), [T, R] = Y("root", {
883
+ })), A = M({}, d, {
884
+ color: v,
885
+ component: p,
886
+ variant: $,
887
+ size: h,
888
+ focusVisible: O
889
+ }), j = zt(A), [U, B] = Z("root", {
891
890
  ref: n,
892
- elementType: Pt,
893
- getSlotProps: B,
894
- externalForwardedProps: x({
895
- onClick: (V) => {
896
- M == null || M(V, "closeClick"), C == null || C(V);
891
+ elementType: Tt,
892
+ getSlotProps: N,
893
+ externalForwardedProps: M({
894
+ onClick: (K) => {
895
+ T == null || T(K, "closeClick"), b == null || b(K);
897
896
  }
898
- }, b, {
899
- component: f,
900
- slots: S,
901
- slotProps: P
897
+ }, S, {
898
+ component: p,
899
+ slots: C,
900
+ slotProps: R
902
901
  }),
903
- className: $.root,
904
- ownerState: H
902
+ className: j.root,
903
+ ownerState: A
905
904
  });
906
- return /* @__PURE__ */ r(T, x({}, R, {
907
- children: Fe || (Fe = /* @__PURE__ */ r($o, {}))
905
+ return /* @__PURE__ */ r(U, M({}, B, {
906
+ children: je || (je = /* @__PURE__ */ r(Ao, {}))
908
907
  }));
909
908
  });
910
- process.env.NODE_ENV !== "production" && (Ge.propTypes = {
909
+ process.env.NODE_ENV !== "production" && (oo.propTypes = {
911
910
  // ┌────────────────────────────── Warning ──────────────────────────────┐
912
911
  // │ These PropTypes are generated from the TypeScript type definitions. │
913
912
  // │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
@@ -915,64 +914,64 @@ process.env.NODE_ENV !== "production" && (Ge.propTypes = {
915
914
  /**
916
915
  * @ignore
917
916
  */
918
- children: o.node,
917
+ children: t.node,
919
918
  /**
920
919
  * The color of the component. It supports those theme colors that make sense for this component.
921
920
  * @default 'neutral'
922
921
  */
923
- color: o.oneOfType([o.oneOf(["danger", "neutral", "primary", "success", "warning"]), o.string]),
922
+ color: t.oneOfType([t.oneOf(["danger", "neutral", "primary", "success", "warning"]), t.string]),
924
923
  /**
925
924
  * The component used for the root node.
926
925
  * Either a string to use a HTML element or a component.
927
926
  */
928
- component: o.elementType,
927
+ component: t.elementType,
929
928
  /**
930
929
  * @ignore
931
930
  */
932
- onClick: o.func,
931
+ onClick: t.func,
933
932
  /**
934
933
  * The size of the component.
935
934
  * @default 'md'
936
935
  */
937
- size: o.oneOfType([o.oneOf(["sm", "md", "lg"]), o.string]),
936
+ size: t.oneOfType([t.oneOf(["sm", "md", "lg"]), t.string]),
938
937
  /**
939
938
  * The props used for each slot inside.
940
939
  * @default {}
941
940
  */
942
- slotProps: o.shape({
943
- root: o.oneOfType([o.func, o.object])
941
+ slotProps: t.shape({
942
+ root: t.oneOfType([t.func, t.object])
944
943
  }),
945
944
  /**
946
945
  * The components used for each slot inside.
947
946
  * @default {}
948
947
  */
949
- slots: o.shape({
950
- root: o.elementType
948
+ slots: t.shape({
949
+ root: t.elementType
951
950
  }),
952
951
  /**
953
952
  * The system prop that allows defining system overrides as well as additional CSS styles.
954
953
  */
955
- sx: o.oneOfType([o.arrayOf(o.oneOfType([o.func, o.object, o.bool])), o.func, o.object]),
954
+ sx: t.oneOfType([t.arrayOf(t.oneOfType([t.func, t.object, t.bool])), t.func, t.object]),
956
955
  /**
957
956
  * The [global variant](https://mui.com/joy-ui/main-features/global-variants/) to use.
958
957
  * @default 'plain'
959
958
  */
960
- variant: o.oneOfType([o.oneOf(["outlined", "plain", "soft", "solid"]), o.string])
959
+ variant: t.oneOfType([t.oneOf(["outlined", "plain", "soft", "solid"]), t.string])
961
960
  });
962
- function Mt(t) {
963
- return ve("MuiRadio", t);
961
+ function Ot(o) {
962
+ return Ce("MuiRadio", o);
964
963
  }
965
- const me = he("MuiRadio", ["root", "radio", "icon", "action", "input", "label", "checked", "disabled", "focusVisible", "colorPrimary", "colorDanger", "colorNeutral", "colorSuccess", "colorWarning", "colorContext", "sizeSm", "sizeMd", "sizeLg", "variantOutlined", "variantSoft", "variantSolid"]), It = ["checked", "checkedIcon", "defaultChecked", "disabled", "disableIcon", "overlay", "label", "id", "name", "onBlur", "onChange", "onFocus", "onFocusVisible", "readOnly", "required", "color", "variant", "size", "uncheckedIcon", "value", "component", "slots", "slotProps"], Dt = (t) => {
964
+ const ge = Re("MuiRadio", ["root", "radio", "icon", "action", "input", "label", "checked", "disabled", "focusVisible", "colorPrimary", "colorDanger", "colorNeutral", "colorSuccess", "colorWarning", "colorContext", "sizeSm", "sizeMd", "sizeLg", "variantOutlined", "variantSoft", "variantSolid"]), $t = ["checked", "checkedIcon", "defaultChecked", "disabled", "disableIcon", "overlay", "label", "id", "name", "onBlur", "onChange", "onFocus", "onFocusVisible", "readOnly", "required", "color", "variant", "size", "uncheckedIcon", "value", "component", "slots", "slotProps"], kt = (o) => {
966
965
  const {
967
966
  checked: e,
968
967
  disabled: n,
969
968
  disableIcon: a,
970
969
  focusVisible: l,
971
- color: s,
970
+ color: i,
972
971
  variant: c,
973
- size: i
974
- } = t, d = {
975
- root: ["root", e && "checked", n && "disabled", l && "focusVisible", c && `variant${U(c)}`, s && `color${U(s)}`, i && `size${U(i)}`],
972
+ size: s
973
+ } = o, u = {
974
+ root: ["root", e && "checked", n && "disabled", l && "focusVisible", c && `variant${G(c)}`, i && `color${G(i)}`, s && `size${G(s)}`],
976
975
  radio: ["radio", e && "checked", n && "disabled"],
977
976
  // disabled class is necessary for displaying global variant
978
977
  icon: ["icon"],
@@ -986,24 +985,24 @@ const me = he("MuiRadio", ["root", "radio", "icon", "action", "input", "label",
986
985
  input: ["input"],
987
986
  label: ["label"]
988
987
  };
989
- return ce(d, Mt, {});
988
+ return me(u, Ot, {});
990
989
  };
991
- function zt(t, e) {
992
- return typeof e == "object" && e !== null ? t === e : String(t) === String(e);
990
+ function Vt(o, e) {
991
+ return typeof e == "object" && e !== null ? o === e : String(o) === String(e);
993
992
  }
994
- const Tt = J("span", {
993
+ const wt = Q("span", {
995
994
  name: "JoyRadio",
996
995
  slot: "Root",
997
- overridesResolver: (t, e) => e.root
996
+ overridesResolver: (o, e) => e.root
998
997
  })(({
999
- ownerState: t,
998
+ ownerState: o,
1000
999
  theme: e
1001
1000
  }) => {
1002
1001
  var n, a, l;
1003
- return [x({
1002
+ return [M({
1004
1003
  "--Icon-fontSize": "var(--Radio-size)",
1005
1004
  "--Icon-color": "currentColor"
1006
- }, t.size === "sm" && {
1005
+ }, o.size === "sm" && {
1007
1006
  "--Radio-size": "1rem",
1008
1007
  // --FormHelperText-margin is equal to --Radio-size + --Radio-gap but we can't use calc() with CSS variables because the FormHelperText is a sibling element
1009
1008
  "& ~ *": {
@@ -1011,14 +1010,14 @@ const Tt = J("span", {
1011
1010
  },
1012
1011
  fontSize: e.vars.fontSize.sm,
1013
1012
  gap: "var(--Radio-gap, 0.5rem)"
1014
- }, t.size === "md" && {
1013
+ }, o.size === "md" && {
1015
1014
  "--Radio-size": "1.25rem",
1016
1015
  "& ~ *": {
1017
1016
  "--FormHelperText-margin": "0.25rem 0 0 1.875rem"
1018
1017
  },
1019
1018
  fontSize: e.vars.fontSize.md,
1020
1019
  gap: "var(--Radio-gap, 0.625rem)"
1021
- }, t.size === "lg" && {
1020
+ }, o.size === "lg" && {
1022
1021
  "--Radio-size": "1.5rem",
1023
1022
  "& ~ *": {
1024
1023
  "--FormHelperText-margin": "0.375rem 0 0 2.25rem"
@@ -1026,7 +1025,7 @@ const Tt = J("span", {
1026
1025
  fontSize: e.vars.fontSize.lg,
1027
1026
  gap: "var(--Radio-gap, 0.75rem)"
1028
1027
  }, {
1029
- position: t.overlay ? "initial" : "relative",
1028
+ position: o.overlay ? "initial" : "relative",
1030
1029
  display: "inline-flex",
1031
1030
  boxSizing: "border-box",
1032
1031
  minWidth: 0,
@@ -1034,30 +1033,30 @@ const Tt = J("span", {
1034
1033
  lineHeight: "var(--Radio-size)",
1035
1034
  // prevent label from having larger height than the checkbox
1036
1035
  color: e.vars.palette.text.primary,
1037
- [`&.${me.disabled}`]: {
1038
- color: (n = e.variants.plainDisabled) == null || (n = n[t.color]) == null ? void 0 : n.color
1036
+ [`&.${ge.disabled}`]: {
1037
+ color: (n = e.variants.plainDisabled) == null || (n = n[o.color]) == null ? void 0 : n.color
1039
1038
  }
1040
- }, t.disableIcon && {
1041
- color: (a = e.variants[t.variant]) == null || (a = a[t.color]) == null ? void 0 : a.color,
1042
- [`&.${me.disabled}`]: {
1043
- color: (l = e.variants[`${t.variant}Disabled`]) == null || (l = l[t.color]) == null ? void 0 : l.color
1039
+ }, o.disableIcon && {
1040
+ color: (a = e.variants[o.variant]) == null || (a = a[o.color]) == null ? void 0 : a.color,
1041
+ [`&.${ge.disabled}`]: {
1042
+ color: (l = e.variants[`${o.variant}Disabled`]) == null || (l = l[o.color]) == null ? void 0 : l.color
1044
1043
  }
1045
- }, t["data-parent"] === "RadioGroup" && t["data-first-child"] === void 0 && {
1046
- marginInlineStart: t.orientation === "horizontal" ? "var(--RadioGroup-gap)" : void 0,
1047
- marginBlockStart: t.orientation === "horizontal" ? void 0 : "var(--RadioGroup-gap)"
1044
+ }, o["data-parent"] === "RadioGroup" && o["data-first-child"] === void 0 && {
1045
+ marginInlineStart: o.orientation === "horizontal" ? "var(--RadioGroup-gap)" : void 0,
1046
+ marginBlockStart: o.orientation === "horizontal" ? void 0 : "var(--RadioGroup-gap)"
1048
1047
  })];
1049
- }), kt = J("span", {
1048
+ }), Nt = Q("span", {
1050
1049
  name: "JoyRadio",
1051
1050
  slot: "Radio",
1052
- overridesResolver: (t, e) => e.radio
1051
+ overridesResolver: (o, e) => e.radio
1053
1052
  })(({
1054
- ownerState: t,
1053
+ ownerState: o,
1055
1054
  theme: e
1056
1055
  }) => {
1057
- var n, a, l, s, c;
1058
- const i = (n = e.variants[`${t.variant}`]) == null ? void 0 : n[t.color];
1059
- return [x({
1060
- "--Icon-color": t.color !== "neutral" || t.variant === "solid" ? "currentColor" : e.vars.palette.text.icon,
1056
+ var n, a, l, i, c;
1057
+ const s = (n = e.variants[`${o.variant}`]) == null ? void 0 : n[o.color];
1058
+ return [M({
1059
+ "--Icon-color": o.color !== "neutral" || o.variant === "solid" ? "currentColor" : e.vars.palette.text.icon,
1061
1060
  margin: 0,
1062
1061
  boxSizing: "border-box",
1063
1062
  width: "var(--Radio-size)",
@@ -1067,32 +1066,32 @@ const Tt = J("span", {
1067
1066
  justifyContent: "center",
1068
1067
  alignItems: "center",
1069
1068
  flexShrink: 0
1070
- }, t.disableIcon && {
1069
+ }, o.disableIcon && {
1071
1070
  display: "contents"
1072
1071
  }, {
1073
- [`&.${me.checked}`]: {
1072
+ [`&.${ge.checked}`]: {
1074
1073
  "--Icon-color": "currentColor"
1075
1074
  }
1076
- }), ...t.disableIcon ? [] : [x({}, i, {
1077
- backgroundColor: (a = i == null ? void 0 : i.backgroundColor) != null ? a : e.vars.palette.background.surface
1075
+ }), ...o.disableIcon ? [] : [M({}, s, {
1076
+ backgroundColor: (a = s == null ? void 0 : s.backgroundColor) != null ? a : e.vars.palette.background.surface
1078
1077
  }), {
1079
1078
  "&:hover": {
1080
- "@media (hover: hover)": (l = e.variants[`${t.variant}Hover`]) == null ? void 0 : l[t.color]
1079
+ "@media (hover: hover)": (l = e.variants[`${o.variant}Hover`]) == null ? void 0 : l[o.color]
1081
1080
  }
1082
1081
  }, {
1083
- "&:active": (s = e.variants[`${t.variant}Active`]) == null ? void 0 : s[t.color]
1082
+ "&:active": (i = e.variants[`${o.variant}Active`]) == null ? void 0 : i[o.color]
1084
1083
  }, {
1085
- [`&.${me.disabled}`]: (c = e.variants[`${t.variant}Disabled`]) == null ? void 0 : c[t.color]
1084
+ [`&.${ge.disabled}`]: (c = e.variants[`${o.variant}Disabled`]) == null ? void 0 : c[o.color]
1086
1085
  }]];
1087
- }), Et = J("span", {
1086
+ }), _t = Q("span", {
1088
1087
  name: "JoyRadio",
1089
1088
  slot: "Action",
1090
- overridesResolver: (t, e) => e.action
1089
+ overridesResolver: (o, e) => e.action
1091
1090
  })(({
1092
- theme: t,
1091
+ theme: o,
1093
1092
  ownerState: e
1094
1093
  }) => {
1095
- var n, a, l, s;
1094
+ var n, a, l, i;
1096
1095
  return [{
1097
1096
  position: "absolute",
1098
1097
  textAlign: "left",
@@ -1106,20 +1105,20 @@ const Tt = J("span", {
1106
1105
  right: "calc(-1 * var(--variant-borderWidth, 0px))",
1107
1106
  zIndex: 1,
1108
1107
  // The action element usually cover the area of nearest positioned parent
1109
- [t.focus.selector]: t.focus.default
1110
- }, ...e.disableIcon ? [(n = t.variants[e.variant]) == null ? void 0 : n[e.color], {
1108
+ [o.focus.selector]: o.focus.default
1109
+ }, ...e.disableIcon ? [(n = o.variants[e.variant]) == null ? void 0 : n[e.color], {
1111
1110
  "&:hover": {
1112
- "@media (hover: hover)": (a = t.variants[`${e.variant}Hover`]) == null ? void 0 : a[e.color]
1111
+ "@media (hover: hover)": (a = o.variants[`${e.variant}Hover`]) == null ? void 0 : a[e.color]
1113
1112
  }
1114
1113
  }, {
1115
- "&:active": (l = t.variants[`${e.variant}Active`]) == null ? void 0 : l[e.color]
1114
+ "&:active": (l = o.variants[`${e.variant}Active`]) == null ? void 0 : l[e.color]
1116
1115
  }, {
1117
- [`&.${me.disabled}`]: (s = t.variants[`${e.variant}Disabled`]) == null ? void 0 : s[e.color]
1116
+ [`&.${ge.disabled}`]: (i = o.variants[`${e.variant}Disabled`]) == null ? void 0 : i[e.color]
1118
1117
  }] : []];
1119
- }), Ot = J("input", {
1118
+ }), Lt = Q("input", {
1120
1119
  name: "JoyRadio",
1121
1120
  slot: "Input",
1122
- overridesResolver: (t, e) => e.input
1121
+ overridesResolver: (o, e) => e.input
1123
1122
  })(() => ({
1124
1123
  margin: 0,
1125
1124
  opacity: 0,
@@ -1127,159 +1126,159 @@ const Tt = J("span", {
1127
1126
  height: "100%",
1128
1127
  width: "100%",
1129
1128
  cursor: "pointer"
1130
- })), $t = J("label", {
1129
+ })), Ft = Q("label", {
1131
1130
  name: "JoyRadio",
1132
1131
  slot: "Label",
1133
- overridesResolver: (t, e) => e.label
1132
+ overridesResolver: (o, e) => e.label
1134
1133
  })(({
1135
- ownerState: t
1136
- }) => x({
1134
+ ownerState: o
1135
+ }) => M({
1137
1136
  flex: 1,
1138
1137
  minWidth: 0
1139
- }, t.disableIcon && {
1138
+ }, o.disableIcon && {
1140
1139
  zIndex: 1,
1141
1140
  // label should stay on top of the action.
1142
1141
  pointerEvents: "none"
1143
1142
  // makes hover ineffect.
1144
- })), Vt = J("span", {
1143
+ })), At = Q("span", {
1145
1144
  name: "JoyRadio",
1146
1145
  slot: "Icon",
1147
- overridesResolver: (t, e) => e.icon
1146
+ overridesResolver: (o, e) => e.icon
1148
1147
  })(({
1149
- ownerState: t
1148
+ ownerState: o
1150
1149
  }) => ({
1151
1150
  width: "calc(var(--Radio-size) / 2)",
1152
1151
  height: "calc(var(--Radio-size) / 2)",
1153
1152
  borderRadius: "inherit",
1154
1153
  color: "inherit",
1155
1154
  backgroundColor: "currentColor",
1156
- transform: t.checked ? "scale(1)" : "scale(0)"
1157
- })), Je = /* @__PURE__ */ y.forwardRef(function(e, n) {
1158
- var a, l, s, c, i, d, p;
1159
- const f = ie({
1155
+ transform: o.checked ? "scale(1)" : "scale(0)"
1156
+ })), to = /* @__PURE__ */ I.forwardRef(function(e, n) {
1157
+ var a, l, i, c, s, u, d;
1158
+ const p = ue({
1160
1159
  props: e,
1161
1160
  name: "JoyRadio"
1162
1161
  }), {
1163
1162
  checked: g,
1164
- checkedIcon: m,
1165
- defaultChecked: v,
1166
- disabled: C,
1167
- disableIcon: S = !1,
1168
- overlay: P = !1,
1169
- label: b,
1170
- id: M,
1171
- name: u,
1172
- onBlur: E,
1173
- onChange: F,
1174
- onFocus: I,
1175
- onFocusVisible: D,
1176
- readOnly: z,
1177
- required: B,
1178
- color: H,
1179
- variant: $ = "outlined",
1180
- size: T = "md",
1181
- uncheckedIcon: R,
1182
- value: V,
1183
- component: N,
1184
- slots: j = {},
1185
- slotProps: q = {}
1186
- } = f, X = ae(f, It), h = y.useContext(Se);
1163
+ checkedIcon: x,
1164
+ defaultChecked: f,
1165
+ disabled: b,
1166
+ disableIcon: C = !1,
1167
+ overlay: R = !1,
1168
+ label: S,
1169
+ id: T,
1170
+ name: y,
1171
+ onBlur: $,
1172
+ onChange: v,
1173
+ onFocus: E,
1174
+ onFocusVisible: h,
1175
+ readOnly: O,
1176
+ required: N,
1177
+ color: A,
1178
+ variant: j = "outlined",
1179
+ size: U = "md",
1180
+ uncheckedIcon: B,
1181
+ value: K,
1182
+ component: k,
1183
+ slots: _ = {},
1184
+ slotProps: P = {}
1185
+ } = p, V = pe(p, $t), m = I.useContext($e);
1187
1186
  if (process.env.NODE_ENV !== "production") {
1188
- const Re = h == null ? void 0 : h.registerEffect;
1189
- y.useEffect(() => {
1190
- if (Re)
1191
- return Re();
1192
- }, [Re]);
1187
+ const Te = m == null ? void 0 : m.registerEffect;
1188
+ I.useEffect(() => {
1189
+ if (Te)
1190
+ return Te();
1191
+ }, [Te]);
1193
1192
  }
1194
- const O = fe(M ?? (h == null ? void 0 : h.htmlFor)), k = y.useContext(Ke), ee = h != null && h.error ? "danger" : (a = (l = (s = e.color) != null ? s : h == null ? void 0 : h.color) != null ? l : H) != null ? a : "primary", ge = h != null && h.error ? "danger" : (c = (i = (d = e.color) != null ? d : h == null ? void 0 : h.color) != null ? i : H) != null ? c : "neutral", ye = e.size || (h == null ? void 0 : h.size) || (k == null ? void 0 : k.size) || T, _ = e.name || (k == null ? void 0 : k.name) || u, W = e.disableIcon || (k == null ? void 0 : k.disableIcon) || S, re = e.overlay || (k == null ? void 0 : k.overlay) || P, oe = {
1195
- checked: typeof g > "u" && V != null ? zt(k == null ? void 0 : k.value, V) : g,
1196
- defaultChecked: v,
1197
- disabled: e.disabled || (h == null ? void 0 : h.disabled) || C,
1198
- onBlur: E,
1199
- onChange: F,
1200
- onFocus: I,
1201
- onFocusVisible: D
1193
+ const D = xe(T ?? (m == null ? void 0 : m.htmlFor)), z = I.useContext(Qe), ee = m != null && m.error ? "danger" : (a = (l = (i = e.color) != null ? i : m == null ? void 0 : m.color) != null ? l : A) != null ? a : "primary", fe = m != null && m.error ? "danger" : (c = (s = (u = e.color) != null ? u : m == null ? void 0 : m.color) != null ? s : A) != null ? c : "neutral", ve = e.size || (m == null ? void 0 : m.size) || (z == null ? void 0 : z.size) || U, Pe = e.name || (z == null ? void 0 : z.name) || y, ne = e.disableIcon || (z == null ? void 0 : z.disableIcon) || C, Se = e.overlay || (z == null ? void 0 : z.overlay) || R, w = {
1194
+ checked: typeof g > "u" && K != null ? Vt(z == null ? void 0 : z.value, K) : g,
1195
+ defaultChecked: f,
1196
+ disabled: e.disabled || (m == null ? void 0 : m.disabled) || b,
1197
+ onBlur: $,
1198
+ onChange: v,
1199
+ onFocus: E,
1200
+ onFocusVisible: h
1202
1201
  }, {
1203
- getInputProps: Ze,
1204
- checked: xe,
1205
- disabled: eo,
1206
- focusVisible: oo
1207
- } = Vo(oe), to = (p = e.color) != null ? p : xe ? ee : ge, te = x({}, f, {
1208
- checked: xe,
1209
- disabled: eo,
1210
- focusVisible: oo,
1211
- color: to,
1212
- variant: $,
1213
- size: ye,
1214
- disableIcon: W,
1215
- overlay: re,
1216
- orientation: k == null ? void 0 : k.orientation
1217
- }), se = Dt(te), le = x({}, X, {
1218
- component: N,
1219
- slots: j,
1220
- slotProps: q
1221
- }), [no, ro] = Y("root", {
1202
+ getInputProps: X,
1203
+ checked: Y,
1204
+ disabled: he,
1205
+ focusVisible: se
1206
+ } = Bo(w), lo = (d = e.color) != null ? d : Y ? ee : fe, ie = M({}, p, {
1207
+ checked: Y,
1208
+ disabled: he,
1209
+ focusVisible: se,
1210
+ color: lo,
1211
+ variant: j,
1212
+ size: ve,
1213
+ disableIcon: ne,
1214
+ overlay: Se,
1215
+ orientation: z == null ? void 0 : z.orientation
1216
+ }), ce = kt(ie), de = M({}, V, {
1217
+ component: k,
1218
+ slots: _,
1219
+ slotProps: P
1220
+ }), [ao, co] = Z("root", {
1222
1221
  ref: n,
1223
- className: se.root,
1224
- elementType: Tt,
1225
- externalForwardedProps: le,
1226
- ownerState: te
1227
- }), [so, lo] = Y("radio", {
1228
- className: se.radio,
1229
- elementType: kt,
1230
- externalForwardedProps: le,
1231
- ownerState: te
1232
- }), [io, ao] = Y("icon", {
1233
- className: se.icon,
1234
- elementType: Vt,
1235
- externalForwardedProps: le,
1236
- ownerState: te
1237
- }), [co, uo] = Y("action", {
1238
- className: se.action,
1239
- elementType: Et,
1240
- externalForwardedProps: le,
1241
- ownerState: te
1242
- }), [po, mo] = Y("input", {
1222
+ className: ce.root,
1223
+ elementType: wt,
1224
+ externalForwardedProps: de,
1225
+ ownerState: ie
1226
+ }), [uo, po] = Z("radio", {
1227
+ className: ce.radio,
1228
+ elementType: Nt,
1229
+ externalForwardedProps: de,
1230
+ ownerState: ie
1231
+ }), [mo, fo] = Z("icon", {
1232
+ className: ce.icon,
1233
+ elementType: At,
1234
+ externalForwardedProps: de,
1235
+ ownerState: ie
1236
+ }), [vo, ho] = Z("action", {
1237
+ className: ce.action,
1238
+ elementType: _t,
1239
+ externalForwardedProps: de,
1240
+ ownerState: ie
1241
+ }), [yo, go] = Z("input", {
1243
1242
  additionalProps: {
1244
1243
  type: "radio",
1245
1244
  role: void 0,
1246
- id: O,
1247
- name: _,
1248
- readOnly: z,
1249
- required: B ?? (h == null ? void 0 : h.required),
1250
- value: String(V),
1251
- "aria-describedby": h == null ? void 0 : h["aria-describedby"]
1245
+ id: D,
1246
+ name: Pe,
1247
+ readOnly: O,
1248
+ required: N ?? (m == null ? void 0 : m.required),
1249
+ value: String(K),
1250
+ "aria-describedby": m == null ? void 0 : m["aria-describedby"]
1252
1251
  },
1253
- className: se.input,
1254
- elementType: Ot,
1255
- externalForwardedProps: le,
1256
- getSlotProps: () => Ze({
1257
- onChange: k == null ? void 0 : k.onChange
1252
+ className: ce.input,
1253
+ elementType: Lt,
1254
+ externalForwardedProps: de,
1255
+ getSlotProps: () => X({
1256
+ onChange: z == null ? void 0 : z.onChange
1258
1257
  }),
1259
- ownerState: te
1260
- }), [fo, vo] = Y("label", {
1258
+ ownerState: ie
1259
+ }), [bo, xo] = Z("label", {
1261
1260
  additionalProps: {
1262
- htmlFor: O
1261
+ htmlFor: D
1263
1262
  },
1264
- className: se.label,
1265
- elementType: $t,
1266
- externalForwardedProps: le,
1267
- ownerState: te
1263
+ className: ce.label,
1264
+ elementType: Ft,
1265
+ externalForwardedProps: de,
1266
+ ownerState: ie
1268
1267
  });
1269
- return /* @__PURE__ */ L(no, x({}, ro, {
1270
- children: [/* @__PURE__ */ L(so, x({}, lo, {
1271
- children: [xe && !W && m, !xe && !W && R, !m && !R && !W && /* @__PURE__ */ r(io, x({}, ao)), /* @__PURE__ */ r(co, x({}, uo, {
1272
- children: /* @__PURE__ */ r(po, x({}, mo))
1268
+ return /* @__PURE__ */ F(ao, M({}, co, {
1269
+ children: [/* @__PURE__ */ F(uo, M({}, po, {
1270
+ children: [Y && !ne && x, !Y && !ne && B, !x && !B && !ne && /* @__PURE__ */ r(mo, M({}, fo)), /* @__PURE__ */ r(vo, M({}, ho, {
1271
+ children: /* @__PURE__ */ r(yo, M({}, go))
1273
1272
  }))]
1274
- })), b && /* @__PURE__ */ r(fo, x({}, vo, {
1275
- children: /* @__PURE__ */ r(So.Provider, {
1273
+ })), S && /* @__PURE__ */ r(bo, M({}, xo, {
1274
+ children: /* @__PURE__ */ r(Do.Provider, {
1276
1275
  value: !0,
1277
- children: b
1276
+ children: S
1278
1277
  })
1279
1278
  }))]
1280
1279
  }));
1281
1280
  });
1282
- process.env.NODE_ENV !== "production" && (Je.propTypes = {
1281
+ process.env.NODE_ENV !== "production" && (to.propTypes = {
1283
1282
  // ┌────────────────────────────── Warning ──────────────────────────────┐
1284
1283
  // │ These PropTypes are generated from the TypeScript type definitions. │
1285
1284
  // │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
@@ -1287,58 +1286,58 @@ process.env.NODE_ENV !== "production" && (Je.propTypes = {
1287
1286
  /**
1288
1287
  * If `true`, the component is checked.
1289
1288
  */
1290
- checked: o.bool,
1289
+ checked: t.bool,
1291
1290
  /**
1292
1291
  * The icon to display when the component is checked.
1293
1292
  */
1294
- checkedIcon: o.node,
1293
+ checkedIcon: t.node,
1295
1294
  /**
1296
1295
  * @ignore
1297
1296
  */
1298
- children: o.node,
1297
+ children: t.node,
1299
1298
  /**
1300
1299
  * Class name applied to the root element.
1301
1300
  */
1302
- className: o.string,
1301
+ className: t.string,
1303
1302
  /**
1304
1303
  * The color of the component. It supports those theme colors that make sense for this component.
1305
1304
  * @default 'neutral'
1306
1305
  */
1307
- color: o.oneOfType([o.oneOf(["danger", "primary", "success", "warning"]), o.string]),
1306
+ color: t.oneOfType([t.oneOf(["danger", "primary", "success", "warning"]), t.string]),
1308
1307
  /**
1309
1308
  * The component used for the root node.
1310
1309
  * Either a string to use a HTML element or a component.
1311
1310
  */
1312
- component: o.elementType,
1311
+ component: t.elementType,
1313
1312
  /**
1314
1313
  * The default checked state. Use when the component is not controlled.
1315
1314
  */
1316
- defaultChecked: o.bool,
1315
+ defaultChecked: t.bool,
1317
1316
  /**
1318
1317
  * If `true`, the component is disabled.
1319
1318
  */
1320
- disabled: o.bool,
1319
+ disabled: t.bool,
1321
1320
  /**
1322
1321
  * If `true`, the checked icon is removed and the selected variant is applied on the `action` element instead.
1323
1322
  * @default false
1324
1323
  */
1325
- disableIcon: o.bool,
1324
+ disableIcon: t.bool,
1326
1325
  /**
1327
1326
  * @ignore
1328
1327
  */
1329
- id: o.string,
1328
+ id: t.string,
1330
1329
  /**
1331
1330
  * The label element at the end the radio.
1332
1331
  */
1333
- label: o.node,
1332
+ label: t.node,
1334
1333
  /**
1335
1334
  * The `name` attribute of the input.
1336
1335
  */
1337
- name: o.string,
1336
+ name: t.string,
1338
1337
  /**
1339
1338
  * @ignore
1340
1339
  */
1341
- onBlur: o.func,
1340
+ onBlur: t.func,
1342
1341
  /**
1343
1342
  * Callback fired when the state is changed.
1344
1343
  *
@@ -1346,198 +1345,198 @@ process.env.NODE_ENV !== "production" && (Je.propTypes = {
1346
1345
  * You can pull out the new value by accessing `event.target.value` (string).
1347
1346
  * You can pull out the new checked state by accessing `event.target.checked` (boolean).
1348
1347
  */
1349
- onChange: o.func,
1348
+ onChange: t.func,
1350
1349
  /**
1351
1350
  * @ignore
1352
1351
  */
1353
- onFocus: o.func,
1352
+ onFocus: t.func,
1354
1353
  /**
1355
1354
  * @ignore
1356
1355
  */
1357
- onFocusVisible: o.func,
1356
+ onFocusVisible: t.func,
1358
1357
  /**
1359
1358
  * If `true`, the root element's position is set to initial which allows the action area to fill the nearest positioned parent.
1360
1359
  * This prop is useful for composing Radio with ListItem component.
1361
1360
  * @default false
1362
1361
  */
1363
- overlay: o.bool,
1362
+ overlay: t.bool,
1364
1363
  /**
1365
1364
  * If `true`, the component is read only.
1366
1365
  */
1367
- readOnly: o.bool,
1366
+ readOnly: t.bool,
1368
1367
  /**
1369
1368
  * If `true`, the `input` element is required.
1370
1369
  */
1371
- required: o.bool,
1370
+ required: t.bool,
1372
1371
  /**
1373
1372
  * The size of the component.
1374
1373
  * @default 'md'
1375
1374
  */
1376
- size: o.oneOfType([o.oneOf(["sm", "md", "lg"]), o.string]),
1375
+ size: t.oneOfType([t.oneOf(["sm", "md", "lg"]), t.string]),
1377
1376
  /**
1378
1377
  * The props used for each slot inside.
1379
1378
  * @default {}
1380
1379
  */
1381
- slotProps: o.shape({
1382
- action: o.oneOfType([o.func, o.object]),
1383
- icon: o.oneOfType([o.func, o.object]),
1384
- input: o.oneOfType([o.func, o.object]),
1385
- label: o.oneOfType([o.func, o.object]),
1386
- radio: o.oneOfType([o.func, o.object]),
1387
- root: o.oneOfType([o.func, o.object])
1380
+ slotProps: t.shape({
1381
+ action: t.oneOfType([t.func, t.object]),
1382
+ icon: t.oneOfType([t.func, t.object]),
1383
+ input: t.oneOfType([t.func, t.object]),
1384
+ label: t.oneOfType([t.func, t.object]),
1385
+ radio: t.oneOfType([t.func, t.object]),
1386
+ root: t.oneOfType([t.func, t.object])
1388
1387
  }),
1389
1388
  /**
1390
1389
  * The components used for each slot inside.
1391
1390
  * @default {}
1392
1391
  */
1393
- slots: o.shape({
1394
- action: o.elementType,
1395
- icon: o.elementType,
1396
- input: o.elementType,
1397
- label: o.elementType,
1398
- radio: o.elementType,
1399
- root: o.elementType
1392
+ slots: t.shape({
1393
+ action: t.elementType,
1394
+ icon: t.elementType,
1395
+ input: t.elementType,
1396
+ label: t.elementType,
1397
+ radio: t.elementType,
1398
+ root: t.elementType
1400
1399
  }),
1401
1400
  /**
1402
1401
  * The system prop that allows defining system overrides as well as additional CSS styles.
1403
1402
  */
1404
- sx: o.oneOfType([o.arrayOf(o.oneOfType([o.func, o.object, o.bool])), o.func, o.object]),
1403
+ sx: t.oneOfType([t.arrayOf(t.oneOfType([t.func, t.object, t.bool])), t.func, t.object]),
1405
1404
  /**
1406
1405
  * The icon to display when the component is not checked.
1407
1406
  */
1408
- uncheckedIcon: o.node,
1407
+ uncheckedIcon: t.node,
1409
1408
  /**
1410
1409
  * The value of the component. The DOM API casts this to a string.
1411
1410
  */
1412
- value: o.any,
1411
+ value: t.any,
1413
1412
  /**
1414
1413
  * The [global variant](https://mui.com/joy-ui/main-features/global-variants/) to use.
1415
1414
  * @default 'outlined'
1416
1415
  */
1417
- variant: o.oneOfType([o.oneOf(["outlined", "plain", "soft", "solid"]), o.string])
1416
+ variant: t.oneOfType([t.oneOf(["outlined", "plain", "soft", "solid"]), t.string])
1418
1417
  });
1419
- function Ft(t) {
1420
- return ve("MuiRadioGroup", t);
1418
+ function Bt(o) {
1419
+ return Ce("MuiRadioGroup", o);
1421
1420
  }
1422
- he("MuiRadioGroup", ["root", "colorPrimary", "colorNeutral", "colorDanger", "colorSuccess", "colorWarning", "variantPlain", "variantOutlined", "variantSoft", "variantSolid", "sizeSm", "sizeMd", "sizeLg", "horizontal", "vertical"]);
1423
- const Nt = ["className", "component", "children", "name", "defaultValue", "disableIcon", "overlay", "value", "onChange", "color", "variant", "size", "orientation", "role", "slots", "slotProps"], _t = (t) => {
1421
+ Re("MuiRadioGroup", ["root", "colorPrimary", "colorNeutral", "colorDanger", "colorSuccess", "colorWarning", "variantPlain", "variantOutlined", "variantSoft", "variantSolid", "sizeSm", "sizeMd", "sizeLg", "horizontal", "vertical"]);
1422
+ const Ht = ["className", "component", "children", "name", "defaultValue", "disableIcon", "overlay", "value", "onChange", "color", "variant", "size", "orientation", "role", "slots", "slotProps"], jt = (o) => {
1424
1423
  const {
1425
1424
  orientation: e,
1426
1425
  size: n,
1427
1426
  variant: a,
1428
1427
  color: l
1429
- } = t, s = {
1430
- root: ["root", e, a && `variant${U(a)}`, l && `color${U(l)}`, n && `size${U(n)}`]
1428
+ } = o, i = {
1429
+ root: ["root", e, a && `variant${G(a)}`, l && `color${G(l)}`, n && `size${G(n)}`]
1431
1430
  };
1432
- return ce(s, Ft, {});
1433
- }, Lt = J("div", {
1431
+ return me(i, Bt, {});
1432
+ }, Ut = Q("div", {
1434
1433
  name: "JoyRadioGroup",
1435
1434
  slot: "Root",
1436
- overridesResolver: (t, e) => e.root
1435
+ overridesResolver: (o, e) => e.root
1437
1436
  })(({
1438
- ownerState: t,
1437
+ ownerState: o,
1439
1438
  theme: e
1440
1439
  }) => {
1441
1440
  var n;
1442
- return x({}, t.size === "sm" && {
1441
+ return M({}, o.size === "sm" && {
1443
1442
  "--RadioGroup-gap": "0.625rem"
1444
- }, t.size === "md" && {
1443
+ }, o.size === "md" && {
1445
1444
  "--RadioGroup-gap": "0.875rem"
1446
- }, t.size === "lg" && {
1445
+ }, o.size === "lg" && {
1447
1446
  "--RadioGroup-gap": "1.25rem"
1448
1447
  }, {
1449
1448
  display: "flex",
1450
1449
  margin: "var(--unstable_RadioGroup-margin)",
1451
- flexDirection: t.orientation === "horizontal" ? "row" : "column",
1450
+ flexDirection: o.orientation === "horizontal" ? "row" : "column",
1452
1451
  borderRadius: e.vars.radius.sm
1453
- }, (n = e.variants[t.variant]) == null ? void 0 : n[t.color]);
1454
- }), qe = /* @__PURE__ */ y.forwardRef(function(e, n) {
1455
- const a = ie({
1452
+ }, (n = e.variants[o.variant]) == null ? void 0 : n[o.color]);
1453
+ }), ro = /* @__PURE__ */ I.forwardRef(function(e, n) {
1454
+ const a = ue({
1456
1455
  props: e,
1457
1456
  name: "JoyRadioGroup"
1458
1457
  }), {
1459
1458
  className: l,
1460
- component: s,
1459
+ component: i,
1461
1460
  children: c,
1462
- name: i,
1463
- defaultValue: d,
1464
- disableIcon: p = !1,
1465
- overlay: f,
1461
+ name: s,
1462
+ defaultValue: u,
1463
+ disableIcon: d = !1,
1464
+ overlay: p,
1466
1465
  value: g,
1467
- onChange: m,
1468
- color: v = "neutral",
1469
- variant: C = "plain",
1470
- size: S = "md",
1471
- orientation: P = "vertical",
1472
- role: b = "radiogroup",
1473
- slots: M = {},
1474
- slotProps: u = {}
1475
- } = a, E = ae(a, Nt), [F, I] = Mo({
1466
+ onChange: x,
1467
+ color: f = "neutral",
1468
+ variant: b = "plain",
1469
+ size: C = "md",
1470
+ orientation: R = "vertical",
1471
+ role: S = "radiogroup",
1472
+ slots: T = {},
1473
+ slotProps: y = {}
1474
+ } = a, $ = pe(a, Ht), [v, E] = zo({
1476
1475
  controlled: g,
1477
- default: d,
1476
+ default: u,
1478
1477
  name: "RadioGroup"
1479
- }), D = y.useContext(Se), z = e.size || (D == null ? void 0 : D.size) || S, B = x({
1480
- orientation: P,
1481
- size: z,
1482
- variant: C,
1483
- color: v,
1484
- role: b
1485
- }, a), H = _t(B), $ = fe(i);
1478
+ }), h = I.useContext($e), O = e.size || (h == null ? void 0 : h.size) || C, N = M({
1479
+ orientation: R,
1480
+ size: O,
1481
+ variant: b,
1482
+ color: f,
1483
+ role: S
1484
+ }, a), A = jt(N), j = xe(s);
1486
1485
  if (process.env.NODE_ENV !== "production") {
1487
- const N = D == null ? void 0 : D.registerEffect;
1488
- y.useEffect(() => {
1489
- if (N)
1490
- return N();
1491
- }, [N]);
1486
+ const k = h == null ? void 0 : h.registerEffect;
1487
+ I.useEffect(() => {
1488
+ if (k)
1489
+ return k();
1490
+ }, [k]);
1492
1491
  }
1493
- const T = y.useMemo(() => ({
1494
- disableIcon: p,
1495
- overlay: f,
1496
- orientation: P,
1497
- size: z,
1498
- name: $,
1499
- value: F,
1500
- onChange: (N) => {
1501
- I(N.target.value), m && m(N);
1492
+ const U = I.useMemo(() => ({
1493
+ disableIcon: d,
1494
+ overlay: p,
1495
+ orientation: R,
1496
+ size: O,
1497
+ name: j,
1498
+ value: v,
1499
+ onChange: (k) => {
1500
+ E(k.target.value), x && x(k);
1502
1501
  }
1503
- }), [p, $, m, f, P, I, z, F]), [R, V] = Y("root", {
1502
+ }), [d, j, x, p, R, E, O, v]), [B, K] = Z("root", {
1504
1503
  ref: n,
1505
- className: Ae(H.root, l),
1506
- elementType: Lt,
1507
- externalForwardedProps: x({}, E, {
1508
- component: s,
1509
- slots: M,
1510
- slotProps: u
1504
+ className: Je(A.root, l),
1505
+ elementType: Ut,
1506
+ externalForwardedProps: M({}, $, {
1507
+ component: i,
1508
+ slots: T,
1509
+ slotProps: y
1511
1510
  }),
1512
- ownerState: B,
1511
+ ownerState: N,
1513
1512
  additionalProps: {
1514
- as: s,
1515
- role: b,
1513
+ as: i,
1514
+ role: S,
1516
1515
  // The `id` is just for the completeness, it does not have any effect because RadioGroup (div) is non-labelable element
1517
1516
  // MDN: "If it is not a labelable element, then the for attribute has no effect"
1518
1517
  // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/label#attr-for
1519
- id: D == null ? void 0 : D.htmlFor,
1520
- "aria-labelledby": D == null ? void 0 : D.labelId,
1521
- "aria-describedby": D == null ? void 0 : D["aria-describedby"]
1518
+ id: h == null ? void 0 : h.htmlFor,
1519
+ "aria-labelledby": h == null ? void 0 : h.labelId,
1520
+ "aria-describedby": h == null ? void 0 : h["aria-describedby"]
1522
1521
  }
1523
1522
  });
1524
- return /* @__PURE__ */ r(Ke.Provider, {
1525
- value: T,
1526
- children: /* @__PURE__ */ r(R, x({}, V, {
1527
- children: /* @__PURE__ */ r(Se.Provider, {
1523
+ return /* @__PURE__ */ r(Qe.Provider, {
1524
+ value: U,
1525
+ children: /* @__PURE__ */ r(B, M({}, K, {
1526
+ children: /* @__PURE__ */ r($e.Provider, {
1528
1527
  value: void 0,
1529
- children: y.Children.map(c, (N, j) => /* @__PURE__ */ y.isValidElement(N) ? /* @__PURE__ */ y.cloneElement(N, x({}, j === 0 && {
1528
+ children: I.Children.map(c, (k, _) => /* @__PURE__ */ I.isValidElement(k) ? /* @__PURE__ */ I.cloneElement(k, M({}, _ === 0 && {
1530
1529
  "data-first-child": ""
1531
- }, j === y.Children.count(c) - 1 && {
1530
+ }, _ === I.Children.count(c) - 1 && {
1532
1531
  "data-last-child": ""
1533
1532
  }, {
1534
1533
  "data-parent": "RadioGroup"
1535
- })) : N)
1534
+ })) : k)
1536
1535
  })
1537
1536
  }))
1538
1537
  });
1539
1538
  });
1540
- process.env.NODE_ENV !== "production" && (qe.propTypes = {
1539
+ process.env.NODE_ENV !== "production" && (ro.propTypes = {
1541
1540
  // ┌────────────────────────────── Warning ──────────────────────────────┐
1542
1541
  // │ These PropTypes are generated from the TypeScript type definitions. │
1543
1542
  // │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
@@ -1545,153 +1544,159 @@ process.env.NODE_ENV !== "production" && (qe.propTypes = {
1545
1544
  /**
1546
1545
  * @ignore
1547
1546
  */
1548
- children: o.node,
1547
+ children: t.node,
1549
1548
  /**
1550
1549
  * Class name applied to the root element.
1551
1550
  */
1552
- className: o.string,
1551
+ className: t.string,
1553
1552
  /**
1554
1553
  * The color of the component. It supports those theme colors that make sense for this component.
1555
1554
  * @default 'neutral'
1556
1555
  */
1557
- color: o.oneOfType([o.oneOf(["danger", "primary", "success", "warning"]), o.string]),
1556
+ color: t.oneOfType([t.oneOf(["danger", "primary", "success", "warning"]), t.string]),
1558
1557
  /**
1559
1558
  * The component used for the root node.
1560
1559
  * Either a string to use a HTML element or a component.
1561
1560
  */
1562
- component: o.elementType,
1561
+ component: t.elementType,
1563
1562
  /**
1564
1563
  * The default value. Use when the component is not controlled.
1565
1564
  */
1566
- defaultValue: o.any,
1565
+ defaultValue: t.any,
1567
1566
  /**
1568
1567
  * The radio's `disabledIcon` prop. If specified, the value is passed down to every radios under this element.
1569
1568
  * @default false
1570
1569
  */
1571
- disableIcon: o.bool,
1570
+ disableIcon: t.bool,
1572
1571
  /**
1573
1572
  * The name used to reference the value of the control.
1574
1573
  * If you don't provide this prop, it falls back to a randomly generated name.
1575
1574
  */
1576
- name: o.string,
1575
+ name: t.string,
1577
1576
  /**
1578
1577
  * Callback fired when a radio button is selected.
1579
1578
  *
1580
1579
  * @param {React.ChangeEvent<HTMLInputElement>} event The event source of the callback.
1581
1580
  * You can pull out the new value by accessing `event.target.value` (string).
1582
1581
  */
1583
- onChange: o.func,
1582
+ onChange: t.func,
1584
1583
  /**
1585
1584
  * The component orientation.
1586
1585
  * @default 'vertical'
1587
1586
  */
1588
- orientation: o.oneOf(["horizontal", "vertical"]),
1587
+ orientation: t.oneOf(["horizontal", "vertical"]),
1589
1588
  /**
1590
1589
  * The radio's `overlay` prop. If specified, the value is passed down to every radios under this element.
1591
1590
  * @default false
1592
1591
  */
1593
- overlay: o.bool,
1592
+ overlay: t.bool,
1594
1593
  /**
1595
1594
  * @ignore
1596
1595
  */
1597
- role: o.string,
1596
+ role: t.string,
1598
1597
  /**
1599
1598
  * The size of the component.
1600
1599
  * @default 'md'
1601
1600
  */
1602
- size: o.oneOfType([o.oneOf(["sm", "md", "lg"]), o.string]),
1601
+ size: t.oneOfType([t.oneOf(["sm", "md", "lg"]), t.string]),
1603
1602
  /**
1604
1603
  * The props used for each slot inside.
1605
1604
  * @default {}
1606
1605
  */
1607
- slotProps: o.shape({
1608
- root: o.oneOfType([o.func, o.object])
1606
+ slotProps: t.shape({
1607
+ root: t.oneOfType([t.func, t.object])
1609
1608
  }),
1610
1609
  /**
1611
1610
  * The components used for each slot inside.
1612
1611
  * @default {}
1613
1612
  */
1614
- slots: o.shape({
1615
- root: o.elementType
1613
+ slots: t.shape({
1614
+ root: t.elementType
1616
1615
  }),
1617
1616
  /**
1618
1617
  * The system prop that allows defining system overrides as well as additional CSS styles.
1619
1618
  */
1620
- sx: o.oneOfType([o.arrayOf(o.oneOfType([o.func, o.object, o.bool])), o.func, o.object]),
1619
+ sx: t.oneOfType([t.arrayOf(t.oneOfType([t.func, t.object, t.bool])), t.func, t.object]),
1621
1620
  /**
1622
1621
  * Value of the selected radio button. The DOM API casts this to a string.
1623
1622
  */
1624
- value: o.any,
1623
+ value: t.any,
1625
1624
  /**
1626
1625
  * The [global variant](https://mui.com/joy-ui/main-features/global-variants/) to use.
1627
1626
  * @default 'plain'
1628
1627
  */
1629
- variant: o.oneOfType([o.oneOf(["outlined", "plain", "soft", "solid"]), o.string])
1628
+ variant: t.oneOfType([t.oneOf(["outlined", "plain", "soft", "solid"]), t.string])
1630
1629
  });
1631
- const wt = (t, e) => {
1632
- const [n, a] = w(null), [l, s] = w(!0), [c, i] = w(null), [d, p] = w(!1);
1633
- return Ce(() => {
1630
+ const Kt = (o, e) => {
1631
+ const [n, a] = H(null), [l, i] = H(!0), [c, s] = H(null), [u, d] = H(!1);
1632
+ return be(() => {
1634
1633
  e && (async () => {
1635
1634
  try {
1636
- s(!0);
1637
- const g = await t.discussions.getById(e);
1638
- a(g), i(null), p(!1);
1635
+ i(!0);
1636
+ const g = await o.discussions.getById(e);
1637
+ a(g), s(null), d(!1);
1639
1638
  } catch (g) {
1640
- (t.helpers.getSDKConfiguration().errorHandlingMode === "standard" ? g.error.code === 404 : g.data.error.code === 404) ? (p(!0), i(null), a(null)) : (i(c), a(null), p(!1));
1639
+ (o.helpers.getSDKConfiguration().errorHandlingMode === "standard" ? g.error.code === 404 : g.data.error.code === 404) ? (d(!0), s(null), a(null)) : (s(c), a(null), d(!1));
1641
1640
  } finally {
1642
- s(!1);
1641
+ i(!1);
1643
1642
  }
1644
1643
  })();
1645
- }, [t, e]), { discussion: n, isLoading: l, error: c, isNotFound: d };
1646
- }, At = (t, e, n, a = "", l = "LATEST", s = 20) => {
1647
- const [c, i] = w([]), [d, p] = w(!0), [f, g] = w(!1), [m, v] = w(null), [C, S] = w(l), [P, b] = w(
1644
+ }, [o, e]), { discussion: n, setDiscussion: a, isLoading: l, error: c, isNotFound: u };
1645
+ }, Wt = (o, e, n = null, a = "", l = "LATEST", i = 20, c, s = !1) => {
1646
+ const [u, d] = H([]), [p, g] = H(!0), [x, f] = H(!1), [b, C] = H(null), [R, S] = H(l), [T, y] = H(
1648
1647
  null
1649
- ), [M, u] = w(!1), E = go(
1650
- async ($, T, R = !1) => {
1651
- var V, N;
1648
+ ), [$, v] = H(!1), E = Ae(
1649
+ async (k, _, P = !1) => {
1650
+ var V, m;
1652
1651
  try {
1653
- p(!0);
1654
- const j = await t.discussions.getPosts(e, {
1655
- sort: $,
1656
- limit: s,
1657
- startAfter: T,
1652
+ g(!0);
1653
+ const D = await o.discussions.getPosts(e, {
1654
+ sort: k,
1655
+ limit: i,
1656
+ startAfter: _,
1658
1657
  skipDeleted: !0,
1659
- skipModerated: !0
1660
- }), q = j.data;
1661
- i(R ? (h) => [...h, ...q] : q);
1662
- const X = !!((V = j.meta.pagination) != null && V.nextPageStartsAfter) && q.length === s;
1663
- b(
1664
- ((N = j.meta.pagination) == null ? void 0 : N.nextPageStartsAfter) || null
1665
- ), u(X), v(null);
1666
- } catch (j) {
1667
- (t.helpers.getSDKConfiguration().errorHandlingMode === "standard" ? j.error.code === 404 : j.data.error.code === 404) ? (i([]), u(!1), b(null), v(null)) : v(m);
1658
+ skipModerated: !s
1659
+ }), z = D.data;
1660
+ d(P ? (fe) => [...fe, ...z] : z);
1661
+ const ee = !!((V = D.meta.pagination) != null && V.nextPageStartsAfter) && z.length === i;
1662
+ y(
1663
+ ((m = D.meta.pagination) == null ? void 0 : m.nextPageStartsAfter) || null
1664
+ ), v(ee), C(null);
1665
+ } catch (D) {
1666
+ (o.helpers.getSDKConfiguration().errorHandlingMode === "standard" ? D.error.code === 404 : D.data.error.code === 404) ? (d([]), v(!1), y(null), C(null)) : C(b);
1668
1667
  } finally {
1669
- p(!1);
1668
+ g(!1);
1670
1669
  }
1671
1670
  },
1672
- [t, e, s]
1671
+ [o, e, i, s]
1673
1672
  );
1674
- return Ce(() => {
1675
- e && E(C);
1676
- }, [e, C, E]), {
1677
- posts: c,
1678
- isLoading: d,
1679
- isSubmitting: f,
1680
- error: m,
1681
- currentSort: C,
1682
- hasMore: M,
1683
- handleSortChange: ($) => {
1684
- S($), b(null);
1685
- },
1686
- handleLoadMore: () => {
1687
- P && !d && E(C, P, !0);
1688
- },
1689
- handleCreatePost: async ($, T) => {
1673
+ be(() => {
1674
+ e && E(R);
1675
+ }, [e, R, E]);
1676
+ const h = (k) => {
1677
+ S(k), y(null);
1678
+ }, O = Ie(p);
1679
+ O.current = p;
1680
+ const N = Ie(T);
1681
+ N.current = T;
1682
+ const A = Ae(() => {
1683
+ N.current && !O.current && E(R, N.current, !0);
1684
+ }, [E, R]);
1685
+ return {
1686
+ posts: u,
1687
+ isLoading: p,
1688
+ isSubmitting: x,
1689
+ error: b,
1690
+ currentSort: R,
1691
+ hasMore: $,
1692
+ handleSortChange: h,
1693
+ handleLoadMore: A,
1694
+ handleCreatePost: async (k, _) => {
1690
1695
  try {
1691
- g(!0);
1692
- let V = await t.discussions.createPost(e, {
1693
- content: $,
1694
- replyId: T || null,
1696
+ f(!0);
1697
+ let V = await o.discussions.createPost(e, {
1698
+ content: k,
1699
+ replyId: _ || null,
1695
1700
  userNickname: null,
1696
1701
  discussionLabel: n,
1697
1702
  discussionUrl: a,
@@ -1702,164 +1707,188 @@ const wt = (t, e) => {
1702
1707
  }
1703
1708
  });
1704
1709
  try {
1705
- const N = await t.profile.getOwn().getInfo();
1706
- V = { ...V, userModel: N };
1710
+ const m = await o.profile.getOwn().getInfo();
1711
+ V = { ...V, userModel: m };
1707
1712
  } catch {
1708
1713
  }
1709
- T || i((N) => [V, ...N]), v(null);
1710
- } catch (R) {
1711
- throw v(
1712
- R
1713
- ), R;
1714
+ d(
1715
+ _ ? (m) => m.map(
1716
+ (D) => D.id === _ ? { ...D, repliesCount: (D.repliesCount || 0) + 1 } : D
1717
+ ) : (m) => [V, ...m]
1718
+ ), c == null || c(1), C(null);
1719
+ } catch (P) {
1720
+ throw C(
1721
+ P
1722
+ ), P;
1714
1723
  } finally {
1715
- g(!1);
1724
+ f(!1);
1716
1725
  }
1717
1726
  },
1718
- handleReact: async ($, T) => {
1727
+ handleReact: async (k, _) => {
1719
1728
  try {
1720
- const R = await t.discussions.react($, T);
1721
- return i(
1722
- (V) => V.map((N) => N.id === $ ? R : N)
1723
- ), v(null), R;
1724
- } catch (R) {
1725
- throw console.error("Error reacting to post:", R), v(
1726
- R
1727
- ), R;
1729
+ const P = await o.discussions.react(k, _);
1730
+ return d(
1731
+ (V) => V.map((m) => m.id === k ? P : m)
1732
+ ), C(null), P;
1733
+ } catch (P) {
1734
+ throw console.error("Error reacting to post:", P), C(
1735
+ P
1736
+ ), P;
1728
1737
  }
1729
1738
  },
1730
- handleDeletePost: async ($) => {
1739
+ handleDeletePost: async (k, _) => {
1731
1740
  try {
1732
- await t.discussions.deletePost($), i((T) => T.filter((R) => R.id !== $)), v(null);
1733
- } catch (T) {
1734
- throw v(
1735
- T
1736
- ), T;
1741
+ await o.discussions.deletePost(k), d((P) => P.filter((V) => V.id !== k)), _ && d(
1742
+ (P) => P.map(
1743
+ (V) => V.id === _ ? { ...V, repliesCount: Math.max(0, (V.repliesCount || 0) - 1) } : V
1744
+ )
1745
+ ), c == null || c(-1), C(null);
1746
+ } catch (P) {
1747
+ throw C(
1748
+ P
1749
+ ), P;
1737
1750
  }
1738
1751
  },
1739
- handleReportPost: async ($, T, R) => {
1752
+ handleReportPost: async (k, _, P) => {
1740
1753
  try {
1741
- await t.discussions.reportPost($, T, R), v(null);
1754
+ await o.discussions.reportPost(k, _, P), C(null);
1742
1755
  } catch (V) {
1743
- throw v(
1756
+ throw C(
1744
1757
  V
1745
1758
  ), V;
1746
1759
  }
1747
1760
  }
1748
1761
  };
1749
- }, Xe = ({
1750
- onSubmit: t,
1762
+ }, no = ({
1763
+ onSubmit: o,
1751
1764
  userIsLoggedIn: e,
1752
1765
  onSignInClick: n,
1753
1766
  placeholder: a,
1754
1767
  isSubmitting: l,
1755
- replyTo: s,
1768
+ replyTo: i,
1756
1769
  onCancel: c
1757
1770
  }) => {
1758
- const { t: i } = ne(), [d, p] = w(""), f = Z(), g = de(), m = ue(), v = f.palette.primary.plainColor, C = f.palette.primary.onPrimary, S = async (P) => {
1759
- if (P.preventDefault(), !!d.trim())
1771
+ const { t: s } = le(), [u, d] = H(""), p = te(), g = ae(), x = De(), f = re(), b = p.palette.primary.plainColor, C = p.palette.primary.onPrimary, R = async (S) => {
1772
+ if (S.preventDefault(), !!u.trim())
1760
1773
  try {
1761
- await t(d), p("");
1762
- } catch (b) {
1763
- console.error("Failed to submit comment:", b);
1774
+ await o(u), d("");
1775
+ } catch (T) {
1776
+ console.error("Failed to submit comment:", T);
1764
1777
  }
1765
1778
  };
1766
- return e ? /* @__PURE__ */ L(A, { component: "form", onSubmit: S, sx: { mb: 3 }, children: [
1767
- s && /* @__PURE__ */ r(K, { level: "body-sm", sx: { mb: 1, color: f.textSecondary }, children: i("discussion.replyingTo", "Replying to {{name}}", {
1768
- name: s
1779
+ return e ? /* @__PURE__ */ F(L, { component: "form", onSubmit: R, sx: { mb: f.lg }, children: [
1780
+ i && /* @__PURE__ */ r(W, { level: "body-sm", sx: { mb: f.xs, color: p.textSecondary }, children: s("discussion.replyingTo", "Replying to {{name}}", {
1781
+ name: i
1769
1782
  }) }),
1770
1783
  /* @__PURE__ */ r(
1771
- Ue,
1784
+ Ye,
1772
1785
  {
1773
- placeholder: a || i("discussion.writeComment", "Write a comment..."),
1774
- value: d,
1775
- onChange: (P) => p(P.target.value),
1786
+ placeholder: a || s("discussion.writeComment", "Write a comment..."),
1787
+ value: u,
1788
+ onChange: (S) => d(S.target.value),
1776
1789
  minRows: 3,
1777
1790
  maxRows: 8,
1778
1791
  disabled: l,
1779
- sx: { mb: 1.5 }
1792
+ sx: {
1793
+ mb: f.sm,
1794
+ bgcolor: p.surfaceVariant,
1795
+ color: p.textPrimary,
1796
+ border: `1px solid ${p.outlineEnabledBorder}`,
1797
+ borderRadius: g.sm,
1798
+ boxShadow: "none",
1799
+ "&::before": { display: "none" },
1800
+ "&::placeholder": { color: p.textSecondary, opacity: 0.6 },
1801
+ "&:focus-within": {
1802
+ border: `1px solid ${b}`,
1803
+ boxShadow: "none",
1804
+ outline: "none"
1805
+ }
1806
+ }
1780
1807
  }
1781
1808
  ),
1782
- /* @__PURE__ */ L(A, { sx: { display: "flex", gap: 1, justifyContent: "flex-end" }, children: [
1809
+ /* @__PURE__ */ F(L, { sx: { display: "flex", gap: f.xs, justifyContent: "flex-end" }, children: [
1783
1810
  c && /* @__PURE__ */ r(
1784
- Q,
1811
+ oe,
1785
1812
  {
1786
1813
  variant: "plain",
1787
1814
  onClick: c,
1788
1815
  disabled: l,
1789
1816
  sx: {
1790
- fontFamily: m.primary,
1791
- color: f.textPrimary,
1817
+ fontFamily: x.primary,
1818
+ color: p.textPrimary,
1792
1819
  borderRadius: g.sm,
1793
1820
  "&:hover": {
1794
- bgcolor: `${f.textPrimary}14`
1821
+ bgcolor: `${p.textPrimary}14`
1795
1822
  }
1796
1823
  },
1797
- children: i("common.cancel", "Cancel")
1824
+ children: s("common.cancel", "Cancel")
1798
1825
  }
1799
1826
  ),
1800
1827
  /* @__PURE__ */ r(
1801
- Q,
1828
+ oe,
1802
1829
  {
1803
1830
  type: "submit",
1804
1831
  variant: "solid",
1805
- disabled: !d.trim() || l,
1832
+ disabled: !u.trim() || l,
1806
1833
  loading: l,
1807
1834
  sx: {
1808
- fontFamily: m.primary,
1809
- bgcolor: v,
1835
+ fontFamily: x.primary,
1836
+ bgcolor: b,
1810
1837
  color: C,
1811
1838
  borderRadius: g.sm,
1812
1839
  "&:hover": {
1813
- bgcolor: v,
1840
+ bgcolor: b,
1814
1841
  opacity: 0.9
1815
1842
  },
1816
1843
  "&:disabled": {
1817
- bgcolor: v,
1844
+ bgcolor: b,
1818
1845
  color: C,
1819
1846
  opacity: 0.4
1820
1847
  }
1821
1848
  },
1822
- children: s ? i("discussion.reply", "Reply") : i("discussion.post", "Post")
1849
+ children: i ? s("discussion.reply", "Reply") : s("discussion.post", "Post")
1823
1850
  }
1824
1851
  )
1825
1852
  ] })
1826
- ] }) : /* @__PURE__ */ r(A, { sx: { mb: 3 }, children: /* @__PURE__ */ r(
1827
- Q,
1853
+ ] }) : /* @__PURE__ */ r(L, { sx: { mb: f.lg }, children: /* @__PURE__ */ r(
1854
+ oe,
1828
1855
  {
1829
1856
  fullWidth: !0,
1830
1857
  variant: "outlined",
1831
1858
  onClick: n,
1832
1859
  sx: {
1833
- py: 1.5,
1834
- fontFamily: m.primary,
1835
- borderColor: v,
1836
- color: v,
1860
+ py: f.sm,
1861
+ fontFamily: x.primary,
1862
+ borderColor: b,
1863
+ color: b,
1837
1864
  borderRadius: g.sm,
1838
1865
  "&:hover": {
1839
- bgcolor: `${v}14`,
1840
- borderColor: v
1866
+ bgcolor: `${b}14`,
1867
+ borderColor: b
1841
1868
  }
1842
1869
  },
1843
- children: i("discussion.signInToPost", "Sign in to post")
1870
+ children: s("discussion.signInToPost", "Sign in to post")
1844
1871
  }
1845
1872
  ) });
1846
- }, Bt = G(/* @__PURE__ */ r("path", {
1873
+ }, Gt = J(/* @__PURE__ */ r("path", {
1847
1874
  d: "M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM19 4h-3.5l-1-1h-5l-1 1H5v2h14z"
1848
- }), "Delete"), Ht = G(/* @__PURE__ */ r("path", {
1875
+ }), "Delete"), Jt = J(/* @__PURE__ */ r("path", {
1849
1876
  d: "M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M8.5 8c.83 0 1.5.67 1.5 1.5S9.33 11 8.5 11 7 10.33 7 9.5 7.67 8 8.5 8M12 18c-2.28 0-4.22-1.66-5-4h10c-.78 2.34-2.72 4-5 4m3.5-7c-.83 0-1.5-.67-1.5-1.5S14.67 8 15.5 8s1.5.67 1.5 1.5-.67 1.5-1.5 1.5"
1850
- }), "EmojiEmotions"), jt = G(/* @__PURE__ */ r("path", {
1877
+ }), "EmojiEmotions"), qt = J(/* @__PURE__ */ r("path", {
1851
1878
  d: "m12 21.35-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54z"
1852
- }), "Favorite"), Ut = G(/* @__PURE__ */ r("path", {
1879
+ }), "Favorite"), Xt = J(/* @__PURE__ */ r("path", {
1853
1880
  d: "M16.5 3c-1.74 0-3.41.81-4.5 2.09C10.91 3.81 9.24 3 7.5 3 4.42 3 2 5.42 2 8.5c0 3.78 3.4 6.86 8.55 11.54L12 21.35l1.45-1.32C18.6 15.36 22 12.28 22 8.5 22 5.42 19.58 3 16.5 3m-4.4 15.55-.1.1-.1-.1C7.14 14.24 4 11.39 4 8.5 4 6.5 5.5 5 7.5 5c1.54 0 3.04.99 3.57 2.36h1.87C13.46 5.99 14.96 5 16.5 5c2 0 3.5 1.5 3.5 3.5 0 2.89-3.14 5.74-7.9 10.05"
1854
- }), "FavoriteBorder"), Kt = G(/* @__PURE__ */ r("path", {
1881
+ }), "FavoriteBorder"), Yt = J(/* @__PURE__ */ r("path", {
1855
1882
  d: "M14.4 6 14 4H5v17h2v-7h5.6l.4 2h7V6z"
1856
- }), "Flag"), Wt = G(/* @__PURE__ */ r("path", {
1883
+ }), "Flag"), Qt = J(/* @__PURE__ */ r("path", {
1857
1884
  d: "M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8m3.5-9c.83 0 1.5-.67 1.5-1.5S16.33 8 15.5 8 14 8.67 14 9.5s.67 1.5 1.5 1.5m-7 0c.83 0 1.5-.67 1.5-1.5S9.33 8 8.5 8 7 8.67 7 9.5 7.67 11 8.5 11m3.5 3c-2.33 0-4.31 1.46-5.11 3.5h10.22c-.8-2.04-2.78-3.5-5.11-3.5"
1858
- }), "MoodBad"), Gt = G(/* @__PURE__ */ r("path", {
1885
+ }), "MoodBad"), Zt = J(/* @__PURE__ */ r("path", {
1859
1886
  d: "M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"
1860
- }), "MoreVert"), Jt = G(/* @__PURE__ */ r("path", {
1887
+ }), "MoreVert"), er = J(/* @__PURE__ */ r("path", {
1888
+ d: "M7 11v2h10v-2zm5-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"
1889
+ }), "RemoveCircleOutline"), or = J(/* @__PURE__ */ r("path", {
1861
1890
  d: "M10 9V5l-7 7 7 7v-4.1c5 0 8.5 1.6 11 5.1-1-5-4-10-11-11"
1862
- }), "Reply"), qt = G([/* @__PURE__ */ r("circle", {
1891
+ }), "Reply"), tr = J([/* @__PURE__ */ r("circle", {
1863
1892
  cx: "15.5",
1864
1893
  cy: "9.5",
1865
1894
  r: "1.5"
@@ -1869,7 +1898,7 @@ const wt = (t, e) => {
1869
1898
  r: "1.5"
1870
1899
  }, "1"), /* @__PURE__ */ r("path", {
1871
1900
  d: "M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8m0-4c-.73 0-1.38-.18-1.96-.52-.12.14-.86.98-1.01 1.15.86.55 1.87.87 2.97.87 1.11 0 2.12-.33 2.98-.88-.97-1.09-.01-.02-1.01-1.15-.59.35-1.24.53-1.97.53"
1872
- }, "2")], "SentimentSatisfied"), Xt = G([/* @__PURE__ */ r("circle", {
1901
+ }, "2")], "SentimentSatisfied"), rr = J([/* @__PURE__ */ r("circle", {
1873
1902
  cx: "15.5",
1874
1903
  cy: "9.5",
1875
1904
  r: "1.5"
@@ -1879,55 +1908,55 @@ const wt = (t, e) => {
1879
1908
  r: "1.5"
1880
1909
  }, "1"), /* @__PURE__ */ r("path", {
1881
1910
  d: "M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8m0-6c-2.33 0-4.32 1.45-5.12 3.5h1.67c.69-1.19 1.97-2 3.45-2s2.75.81 3.45 2h1.67c-.8-2.05-2.79-3.5-5.12-3.5"
1882
- }, "2")], "SentimentVeryDissatisfied"), Yt = G(/* @__PURE__ */ r("path", {
1911
+ }, "2")], "SentimentVeryDissatisfied"), nr = J(/* @__PURE__ */ r("path", {
1883
1912
  d: "M15 3H6c-.83 0-1.54.5-1.84 1.22l-3.02 7.05c-.09.23-.14.47-.14.73v2c0 1.1.9 2 2 2h6.31l-.95 4.57-.03.32c0 .41.17.79.44 1.06L9.83 23l6.59-6.59c.36-.36.58-.86.58-1.41V5c0-1.1-.9-2-2-2m4 0v12h4V3z"
1884
- }), "ThumbDown"), Qt = G(/* @__PURE__ */ r("path", {
1913
+ }), "ThumbDown"), sr = J(/* @__PURE__ */ r("path", {
1885
1914
  d: "M1 21h4V9H1zm22-11c0-1.1-.9-2-2-2h-6.31l.95-4.57.03-.32c0-.41-.17-.79-.44-1.06L14.17 1 7.59 7.59C7.22 7.95 7 8.45 7 9v10c0 1.1.9 2 2 2h9c.83 0 1.54-.5 1.84-1.22l3.02-7.05c.09-.23.14-.47.14-.73z"
1886
- }), "ThumbUp"), Zt = {
1887
- LIKE: /* @__PURE__ */ r(Qt, { fontSize: "small" }),
1888
- DISLIKE: /* @__PURE__ */ r(Yt, { fontSize: "small" }),
1889
- LOVE: /* @__PURE__ */ r(jt, { fontSize: "small" }),
1890
- LAUGH: /* @__PURE__ */ r(qt, { fontSize: "small" }),
1891
- CARE: /* @__PURE__ */ r(Ut, { fontSize: "small" }),
1892
- WOW: /* @__PURE__ */ r(Ht, { fontSize: "small" }),
1893
- SAD: /* @__PURE__ */ r(Xt, { fontSize: "small" }),
1894
- ANGRY: /* @__PURE__ */ r(Wt, { fontSize: "small" })
1895
- }, Ne = ({
1896
- reaction: t,
1915
+ }), "ThumbUp"), ir = {
1916
+ LIKE: /* @__PURE__ */ r(sr, { fontSize: "small" }),
1917
+ DISLIKE: /* @__PURE__ */ r(nr, { fontSize: "small" }),
1918
+ LOVE: /* @__PURE__ */ r(qt, { fontSize: "small" }),
1919
+ LAUGH: /* @__PURE__ */ r(tr, { fontSize: "small" }),
1920
+ CARE: /* @__PURE__ */ r(Xt, { fontSize: "small" }),
1921
+ WOW: /* @__PURE__ */ r(Jt, { fontSize: "small" }),
1922
+ SAD: /* @__PURE__ */ r(rr, { fontSize: "small" }),
1923
+ ANGRY: /* @__PURE__ */ r(Qt, { fontSize: "small" })
1924
+ }, Ue = ({
1925
+ reaction: o,
1897
1926
  count: e,
1898
1927
  isActive: n,
1899
1928
  onClick: a,
1900
1929
  disabled: l
1901
1930
  }) => {
1902
- const s = Z(), c = (d) => d >= 1e6 ? (d / 1e6).toFixed(1).replace(/\.0$/, "") + "M" : d >= 1e3 ? (d / 1e3).toFixed(1).replace(/\.0$/, "") + "K" : d.toString(), i = () => {
1903
- if (!n) return s.textSecondary;
1904
- switch (t) {
1931
+ const i = te(), c = re(), s = (d) => d >= 1e6 ? (d / 1e6).toFixed(1).replace(/\.0$/, "") + "M" : d >= 1e3 ? (d / 1e3).toFixed(1).replace(/\.0$/, "") + "K" : d.toString(), u = () => {
1932
+ if (!n) return i.textSecondary;
1933
+ switch (o) {
1905
1934
  case "LIKE":
1906
- return s.palette.primary.plainColor;
1935
+ return i.palette.primary.plainColor;
1907
1936
  case "DISLIKE":
1908
- return s.palette.primary.plainColor;
1937
+ return i.palette.primary.plainColor;
1909
1938
  case "LOVE":
1910
- return s.palette.danger.plainColor;
1939
+ return i.palette.danger.plainColor;
1911
1940
  case "ANGRY":
1912
- return s.palette.danger.plainColor;
1941
+ return i.palette.danger.plainColor;
1913
1942
  default:
1914
- return s.palette.primary.plainColor;
1943
+ return i.palette.primary.plainColor;
1915
1944
  }
1916
1945
  };
1917
- return /* @__PURE__ */ L(
1918
- A,
1946
+ return /* @__PURE__ */ F(
1947
+ L,
1919
1948
  {
1920
1949
  sx: {
1921
1950
  display: "inline-flex",
1922
1951
  alignItems: "center",
1923
- gap: 0.5,
1924
- px: 1.5,
1925
- py: 0.5,
1952
+ gap: c["2xs"],
1953
+ px: c.sm,
1954
+ py: c["2xs"],
1926
1955
  borderRadius: "18px",
1927
- backgroundColor: n ? `${s.palette.neutral.softBg}` : "transparent",
1928
- color: i(),
1956
+ backgroundColor: n ? `${i.palette.neutral.softBg}` : "transparent",
1957
+ color: u(),
1929
1958
  "&:hover": {
1930
- backgroundColor: `${s.palette.neutral.softHoverBg}`
1959
+ backgroundColor: `${i.palette.neutral.softHoverBg}`
1931
1960
  },
1932
1961
  cursor: l ? "not-allowed" : "pointer",
1933
1962
  opacity: l ? 0.5 : 1
@@ -1935,7 +1964,7 @@ const wt = (t, e) => {
1935
1964
  onClick: l ? void 0 : a,
1936
1965
  children: [
1937
1966
  /* @__PURE__ */ r(
1938
- A,
1967
+ L,
1939
1968
  {
1940
1969
  sx: {
1941
1970
  display: "flex",
@@ -1943,192 +1972,204 @@ const wt = (t, e) => {
1943
1972
  fontSize: "1.25rem",
1944
1973
  color: "inherit"
1945
1974
  },
1946
- children: Zt[t]
1975
+ children: ir[o]
1947
1976
  }
1948
1977
  ),
1949
1978
  e > 0 && /* @__PURE__ */ r(
1950
- K,
1979
+ W,
1951
1980
  {
1952
1981
  level: "body-sm",
1953
1982
  sx: {
1954
- color: n ? i() : s.textPrimary,
1983
+ color: n ? u() : i.textPrimary,
1955
1984
  fontWeight: 500
1956
1985
  },
1957
- children: c(e)
1986
+ children: s(e)
1958
1987
  }
1959
1988
  )
1960
1989
  ]
1961
1990
  }
1962
1991
  );
1963
- }, Ye = (t, e) => {
1964
- const [n, a] = w(null);
1965
- return Ce(() => {
1992
+ }, so = (o, e) => {
1993
+ const [n, a] = H(null);
1994
+ return be(() => {
1966
1995
  (async () => {
1967
1996
  if (e)
1968
1997
  try {
1969
- const s = await t.profile.getOwn().getInfo();
1970
- a(s.id);
1971
- } catch (s) {
1972
- console.error("Failed to get current user ID:", s);
1998
+ const i = await o.profile.getOwn().getInfo();
1999
+ a(i.id);
2000
+ } catch (i) {
2001
+ console.error("Failed to get current user ID:", i);
1973
2002
  }
1974
2003
  })();
1975
- }, [e, t]), n;
1976
- }, en = ({
1977
- post: t,
2004
+ }, [e, o]), n;
2005
+ }, lr = ({
2006
+ post: o,
1978
2007
  sdk: e,
1979
2008
  userIsLoggedIn: n,
1980
2009
  onSignInClick: a,
1981
2010
  onReact: l,
1982
- showReactions: s = !0,
2011
+ showReactions: i = !0,
1983
2012
  showReplyButton: c = !0,
1984
- onReplyClick: i
2013
+ onReplyClick: s
1985
2014
  }) => {
1986
- var P, b, M, u;
1987
- const { t: d } = ne(), p = Z(), f = de(), g = ue(), m = Ye(e, n), C = (() => {
1988
- if (!m || !t.reactions)
2015
+ var S, T, y, $;
2016
+ const { t: u } = le(), d = te(), p = ae(), g = De(), x = re(), f = so(e, n), C = (() => {
2017
+ if (!f || !o.reactions)
1989
2018
  return null;
1990
- for (const E of t.reactions)
1991
- if (E.userIds.includes(m))
1992
- return E.type;
2019
+ for (const v of o.reactions)
2020
+ if (v.userIds.includes(f))
2021
+ return v.type;
1993
2022
  return null;
1994
- })(), S = (E) => {
2023
+ })(), R = (v) => {
1995
2024
  if (!n) {
1996
2025
  a == null || a();
1997
2026
  return;
1998
2027
  }
1999
- l(t.id, E);
2028
+ l(o.id, v);
2000
2029
  };
2001
- return /* @__PURE__ */ L(
2002
- A,
2030
+ return /* @__PURE__ */ F(
2031
+ L,
2003
2032
  {
2004
2033
  sx: {
2005
2034
  display: "flex",
2006
- gap: 1,
2035
+ gap: x.xs,
2007
2036
  alignItems: "center",
2008
2037
  flexWrap: "wrap",
2009
- mb: 1
2038
+ mb: x.xs
2010
2039
  },
2011
2040
  children: [
2012
- s && /* @__PURE__ */ L(De, { children: [
2041
+ i && /* @__PURE__ */ F(Me, { children: [
2013
2042
  /* @__PURE__ */ r(
2014
- Ne,
2043
+ Ue,
2015
2044
  {
2016
2045
  reaction: "LIKE",
2017
- count: ((b = (P = t.reactions) == null ? void 0 : P.find((E) => E.type === "LIKE")) == null ? void 0 : b.reactionCount) || 0,
2046
+ count: ((T = (S = o.reactions) == null ? void 0 : S.find((v) => v.type === "LIKE")) == null ? void 0 : T.reactionCount) || 0,
2018
2047
  isActive: C === "LIKE",
2019
- onClick: () => S("LIKE"),
2048
+ onClick: () => R("LIKE"),
2020
2049
  disabled: !n
2021
2050
  }
2022
2051
  ),
2023
2052
  /* @__PURE__ */ r(
2024
- Ne,
2053
+ Ue,
2025
2054
  {
2026
2055
  reaction: "DISLIKE",
2027
- count: ((u = (M = t.reactions) == null ? void 0 : M.find((E) => E.type === "DISLIKE")) == null ? void 0 : u.reactionCount) || 0,
2056
+ count: (($ = (y = o.reactions) == null ? void 0 : y.find((v) => v.type === "DISLIKE")) == null ? void 0 : $.reactionCount) || 0,
2028
2057
  isActive: C === "DISLIKE",
2029
- onClick: () => S("DISLIKE"),
2058
+ onClick: () => R("DISLIKE"),
2030
2059
  disabled: !n
2031
2060
  }
2032
2061
  )
2033
2062
  ] }),
2034
2063
  c && /* @__PURE__ */ r(
2035
- Q,
2064
+ oe,
2036
2065
  {
2037
2066
  size: "sm",
2038
2067
  variant: "plain",
2039
- onClick: i,
2040
- startDecorator: /* @__PURE__ */ r(Jt, { fontSize: "small" }),
2068
+ onClick: s,
2069
+ startDecorator: /* @__PURE__ */ r(or, { fontSize: "small" }),
2041
2070
  sx: {
2042
- ml: 1,
2071
+ ml: x.xs,
2043
2072
  fontFamily: g.primary,
2044
- color: p.textPrimary,
2073
+ color: d.textPrimary,
2045
2074
  fontWeight: 600,
2046
2075
  fontSize: "0.8125rem",
2047
- borderRadius: f.sm,
2048
- px: 1,
2049
- py: 0.5,
2076
+ borderRadius: p.sm,
2077
+ px: x.xs,
2078
+ py: x["2xs"],
2050
2079
  minHeight: "unset",
2051
- "--Icon-color": p.textPrimary,
2080
+ "--Icon-color": d.textPrimary,
2052
2081
  "&:hover": {
2053
- bgcolor: `${p.textPrimary}14`
2082
+ bgcolor: `${d.textPrimary}14`
2054
2083
  }
2055
2084
  },
2056
- children: d("discussion.reply", "Reply")
2085
+ children: u("discussion.reply", "Reply")
2057
2086
  }
2058
2087
  )
2059
2088
  ]
2060
2089
  }
2061
2090
  );
2062
- }, on = ({
2063
- isOwnPost: t,
2091
+ }, ar = ({
2092
+ isOwnPost: o,
2064
2093
  canReport: e,
2065
2094
  onDelete: n,
2066
2095
  onReport: a
2067
2096
  }) => {
2068
- const { t: l } = ne(), s = Be(), { shadowRootElement: c } = ze(Te), i = de(), d = Z(), [p, f] = ho.useState(null);
2069
- if (!t && !e) return null;
2070
- const g = {
2097
+ const { t: l } = le(), { shadowRootElement: i } = we(Ne), c = ae(), s = te(), u = re(), [d, p] = q.useState(null), g = q.useRef(null);
2098
+ if (q.useEffect(() => {
2099
+ if (!d) return;
2100
+ const b = (R) => {
2101
+ const S = R.composedPath();
2102
+ d && S.includes(d) || g.current && S.includes(g.current) || p(null);
2103
+ }, C = setTimeout(() => {
2104
+ document.addEventListener("click", b, !0);
2105
+ }, 0);
2106
+ return () => {
2107
+ clearTimeout(C), document.removeEventListener("click", b, !0);
2108
+ };
2109
+ }, [d]), !o && !e) return null;
2110
+ const x = {
2071
2111
  zIndex: 1300,
2072
- bgcolor: s.colorSchemes.light.palette.background.popup,
2073
- border: `1px solid ${s.colorSchemes.light.palette.neutral.outlinedBorder}`,
2074
- borderRadius: i.sm,
2075
- boxShadow: "0 4px 6px -1px rgb(0 0 0 / 0.1)"
2076
- }, m = {
2077
- color: `${s.colorSchemes.light.palette.neutral.outlinedColor} !important`,
2078
- bgcolor: `${s.colorSchemes.light.palette.background.popup} !important`,
2112
+ bgcolor: s.surface,
2113
+ border: `1px solid ${s.outlineEnabledBorder}`,
2114
+ borderRadius: c.sm,
2115
+ boxShadow: "none"
2116
+ }, f = {
2117
+ color: `${s.textPrimary} !important`,
2118
+ bgcolor: `${s.surface} !important`,
2079
2119
  "&:hover": {
2080
- bgcolor: `${s.colorSchemes.light.palette.neutral.outlinedHoverBg} !important`,
2081
- color: `${s.colorSchemes.light.palette.neutral.outlinedColor} !important`
2120
+ bgcolor: `${s.surfaceVariant} !important`,
2121
+ color: `${s.textPrimary} !important`
2082
2122
  }
2083
2123
  };
2084
- return /* @__PURE__ */ L(De, { children: [
2124
+ return /* @__PURE__ */ F(Me, { children: [
2085
2125
  /* @__PURE__ */ r(
2086
- Io,
2126
+ To,
2087
2127
  {
2088
2128
  size: "sm",
2089
2129
  variant: "plain",
2090
- onClick: (v) => f(v.currentTarget),
2130
+ onClick: (b) => p(d ? null : b.currentTarget),
2091
2131
  sx: {
2092
2132
  ml: "auto",
2093
- color: d.textPrimary,
2133
+ color: s.textPrimary,
2094
2134
  "&:hover": {
2095
- bgcolor: `${d.textPrimary}14`
2135
+ bgcolor: `${s.textPrimary}14`
2096
2136
  }
2097
2137
  },
2098
- children: /* @__PURE__ */ r(Gt, { fontSize: "small" })
2138
+ children: /* @__PURE__ */ r(Zt, { fontSize: "small" })
2099
2139
  }
2100
2140
  ),
2101
- /* @__PURE__ */ L(
2102
- We,
2141
+ /* @__PURE__ */ F(
2142
+ eo,
2103
2143
  {
2104
- anchorEl: p,
2105
- open: !!p,
2106
- onClose: () => f(null),
2107
- container: c,
2108
- sx: g,
2144
+ ref: g,
2145
+ anchorEl: d,
2146
+ open: !!d,
2147
+ onClose: () => p(null),
2148
+ container: i,
2149
+ sx: x,
2109
2150
  children: [
2110
- t && /* @__PURE__ */ L(
2111
- Ie,
2151
+ o && /* @__PURE__ */ F(
2152
+ Ve,
2112
2153
  {
2113
2154
  onClick: () => {
2114
- f(null), n();
2155
+ p(null), n();
2115
2156
  },
2116
- sx: m,
2157
+ sx: f,
2117
2158
  children: [
2118
- /* @__PURE__ */ r(Bt, { fontSize: "small", sx: { mr: 1 } }),
2159
+ /* @__PURE__ */ r(Gt, { fontSize: "small", sx: { mr: u.xs } }),
2119
2160
  l("discussion.delete.action", "Delete")
2120
2161
  ]
2121
2162
  }
2122
2163
  ),
2123
- e && /* @__PURE__ */ L(
2124
- Ie,
2164
+ e && /* @__PURE__ */ F(
2165
+ Ve,
2125
2166
  {
2126
2167
  onClick: () => {
2127
- f(null), a();
2168
+ p(null), a();
2128
2169
  },
2129
- sx: m,
2170
+ sx: f,
2130
2171
  children: [
2131
- /* @__PURE__ */ r(Kt, { fontSize: "small", sx: { mr: 1 } }),
2172
+ /* @__PURE__ */ r(Yt, { fontSize: "small", sx: { mr: u.xs } }),
2132
2173
  l("discussion.report.action", "Report")
2133
2174
  ]
2134
2175
  }
@@ -2137,127 +2178,143 @@ const wt = (t, e) => {
2137
2178
  }
2138
2179
  )
2139
2180
  ] });
2140
- }, tn = ({
2141
- open: t,
2181
+ }, cr = ({
2182
+ open: o,
2142
2183
  onClose: e,
2143
2184
  onConfirm: n,
2144
2185
  onError: a,
2145
2186
  container: l
2146
2187
  }) => {
2147
- const { t: s } = ne(), c = Z(), i = de(), d = ue(), p = c.palette.primary.onPrimary, [f, g] = w(!1), m = async () => {
2148
- g(!0);
2188
+ const { t: i } = le(), c = te(), s = ae(), u = De(), d = re(), p = c.palette.primary.plainColor, g = c.palette.primary.onPrimary, [x, f] = H(!1), b = async () => {
2189
+ f(!0);
2149
2190
  try {
2150
2191
  await n(), e();
2151
2192
  } catch {
2152
2193
  a(
2153
- s(
2194
+ i(
2154
2195
  "discussion.delete.error",
2155
2196
  "Failed to delete comment. Please try again."
2156
2197
  )
2157
2198
  );
2158
2199
  } finally {
2159
- g(!1);
2200
+ f(!1);
2160
2201
  }
2161
2202
  };
2162
- return /* @__PURE__ */ r(He, { open: t, onClose: e, container: l, children: /* @__PURE__ */ L(
2163
- je,
2203
+ return /* @__PURE__ */ r(qe, { open: o, onClose: e, container: l, children: /* @__PURE__ */ F(
2204
+ Xe,
2164
2205
  {
2165
2206
  sx: {
2166
2207
  bgcolor: c.surface,
2167
2208
  color: c.textPrimary,
2168
- borderRadius: i.md,
2169
- p: 3,
2209
+ borderRadius: s.md,
2210
+ p: d.lg,
2170
2211
  minWidth: 320,
2171
2212
  maxWidth: 400
2172
2213
  },
2173
2214
  children: [
2174
2215
  /* @__PURE__ */ r(
2175
- K,
2216
+ W,
2176
2217
  {
2177
2218
  level: "title-lg",
2178
- sx: { mb: 1, fontFamily: d.primary },
2179
- children: s("discussion.delete.title", "Delete comment")
2219
+ sx: { mb: d.xs, fontFamily: u.primary },
2220
+ children: i("discussion.delete.title", "Delete comment")
2180
2221
  }
2181
2222
  ),
2182
- /* @__PURE__ */ r(K, { level: "body-sm", sx: { mb: 3, color: c.textSecondary }, children: s(
2223
+ /* @__PURE__ */ r(W, { level: "body-sm", sx: { mb: d.lg, color: c.textSecondary }, children: i(
2183
2224
  "discussion.delete.description",
2184
2225
  "Are you sure you want to delete this comment? This action cannot be undone."
2185
2226
  ) }),
2186
- /* @__PURE__ */ L(A, { sx: { display: "flex", gap: 1, justifyContent: "flex-end" }, children: [
2227
+ /* @__PURE__ */ F(L, { sx: { display: "flex", gap: d.xs, justifyContent: "flex-end" }, children: [
2187
2228
  /* @__PURE__ */ r(
2188
- Q,
2229
+ oe,
2189
2230
  {
2190
2231
  variant: "plain",
2191
2232
  onClick: e,
2192
2233
  sx: {
2193
- fontFamily: d.primary,
2234
+ fontFamily: u.primary,
2194
2235
  color: c.textPrimary,
2195
- borderRadius: i.sm,
2236
+ borderRadius: s.sm,
2196
2237
  "&:hover": { bgcolor: `${c.textPrimary}14` }
2197
2238
  },
2198
- children: s("common.cancel", "Cancel")
2239
+ children: i("common.cancel", "Cancel")
2199
2240
  }
2200
2241
  ),
2201
2242
  /* @__PURE__ */ r(
2202
- Q,
2243
+ oe,
2203
2244
  {
2204
2245
  variant: "solid",
2205
- loading: f,
2206
- disabled: f,
2207
- onClick: m,
2246
+ loading: x,
2247
+ disabled: x,
2248
+ onClick: b,
2208
2249
  sx: {
2209
- fontFamily: d.primary,
2210
- bgcolor: c.palette.danger.plainColor,
2211
- color: p,
2212
- borderRadius: i.sm,
2250
+ fontFamily: u.primary,
2251
+ bgcolor: p,
2252
+ color: g,
2253
+ borderRadius: s.sm,
2213
2254
  "&:hover": {
2214
- bgcolor: c.palette.danger.plainColor,
2255
+ bgcolor: p,
2215
2256
  opacity: 0.9
2216
2257
  },
2217
2258
  "&:disabled": {
2218
- bgcolor: c.palette.danger.plainColor,
2219
- color: p,
2259
+ bgcolor: p,
2260
+ color: g,
2220
2261
  opacity: 0.4
2221
2262
  }
2222
2263
  },
2223
- children: s("discussion.delete.action", "Delete")
2264
+ children: i("discussion.delete.action", "Delete")
2224
2265
  }
2225
2266
  )
2226
2267
  ] })
2227
2268
  ]
2228
2269
  }
2229
2270
  ) });
2230
- }, nn = [
2271
+ }, dr = [
2231
2272
  { value: "SPAM", labelKey: "discussion.report.spam", fallback: "Spam" },
2232
- { value: "NOT_ON_THE_SUBJECT", labelKey: "discussion.report.offTopic", fallback: "Off topic" },
2273
+ {
2274
+ value: "NOT_ON_THE_SUBJECT",
2275
+ labelKey: "discussion.report.offTopic",
2276
+ fallback: "Off topic"
2277
+ },
2233
2278
  { value: "AD", labelKey: "discussion.report.ad", fallback: "Advertisement" },
2234
- { value: "COPYRIGHT", labelKey: "discussion.report.copyright", fallback: "Copyright violation" },
2235
- { value: "EXPLICIT_SEXUAL_CONTENT", labelKey: "discussion.report.explicit", fallback: "Explicit sexual content" },
2236
- { value: "HATEFUL_SPEECH", labelKey: "discussion.report.hateful", fallback: "Hateful speech" },
2279
+ {
2280
+ value: "COPYRIGHT",
2281
+ labelKey: "discussion.report.copyright",
2282
+ fallback: "Copyright violation"
2283
+ },
2284
+ {
2285
+ value: "EXPLICIT_SEXUAL_CONTENT",
2286
+ labelKey: "discussion.report.explicit",
2287
+ fallback: "Explicit sexual content"
2288
+ },
2289
+ {
2290
+ value: "HATEFUL_SPEECH",
2291
+ labelKey: "discussion.report.hateful",
2292
+ fallback: "Hateful speech"
2293
+ },
2237
2294
  { value: "INSULT", labelKey: "discussion.report.insult", fallback: "Insult" },
2238
2295
  { value: "OTHER", labelKey: "discussion.report.other", fallback: "Other" }
2239
- ], rn = ({
2240
- open: t,
2296
+ ], ur = ({
2297
+ open: o,
2241
2298
  onClose: e,
2242
2299
  onSubmit: n,
2243
2300
  onSuccess: a,
2244
2301
  onError: l,
2245
- container: s
2302
+ container: i
2246
2303
  }) => {
2247
- const { t: c } = ne(), i = Z(), d = de(), p = ue(), f = i.palette.primary.onPrimary, [g, m] = w(""), [v, C] = w(""), [S, P] = w(!1), b = () => {
2248
- e(), m(""), C("");
2249
- }, M = async () => {
2250
- P(!0);
2304
+ const { t: c } = le(), s = te(), u = ae(), d = De(), p = re(), g = s.palette.primary.plainColor, x = s.palette.primary.onPrimary, [f, b] = H(""), [C, R] = H(""), [S, T] = H(!1), y = () => {
2305
+ e(), b(""), R("");
2306
+ }, $ = async () => {
2307
+ T(!0);
2251
2308
  try {
2252
2309
  await n(
2253
- g,
2254
- g === "OTHER" ? v : void 0
2310
+ f,
2311
+ f === "OTHER" ? C : void 0
2255
2312
  ), a(
2256
2313
  c(
2257
2314
  "discussion.report.success",
2258
2315
  "Post reported successfully. Thank you."
2259
2316
  )
2260
- ), b();
2317
+ ), y();
2261
2318
  } catch {
2262
2319
  l(
2263
2320
  c(
@@ -2266,117 +2323,134 @@ const wt = (t, e) => {
2266
2323
  )
2267
2324
  );
2268
2325
  } finally {
2269
- P(!1);
2326
+ T(!1);
2270
2327
  }
2271
2328
  };
2272
- return /* @__PURE__ */ r(He, { open: t, onClose: b, container: s, children: /* @__PURE__ */ L(
2273
- je,
2329
+ return /* @__PURE__ */ r(qe, { open: o, onClose: y, container: i, children: /* @__PURE__ */ F(
2330
+ Xe,
2274
2331
  {
2275
2332
  sx: {
2276
- bgcolor: i.surface,
2277
- color: i.textPrimary,
2278
- borderRadius: d.md,
2279
- p: 3,
2333
+ bgcolor: s.surface,
2334
+ color: s.textPrimary,
2335
+ borderRadius: u.md,
2336
+ p: p.lg,
2280
2337
  minWidth: 320,
2281
2338
  maxWidth: 440
2282
2339
  },
2283
2340
  children: [
2284
2341
  /* @__PURE__ */ r(
2285
- Ge,
2342
+ oo,
2286
2343
  {
2287
2344
  sx: {
2288
- color: i.textPrimary,
2289
- "&:hover": { bgcolor: `${i.textPrimary}14` }
2345
+ color: s.textPrimary,
2346
+ "&:hover": { bgcolor: `${s.textPrimary}14` }
2290
2347
  }
2291
2348
  }
2292
2349
  ),
2293
2350
  /* @__PURE__ */ r(
2294
- K,
2351
+ W,
2295
2352
  {
2296
2353
  level: "title-lg",
2297
- sx: { mb: 2, fontFamily: p.primary },
2354
+ sx: { mb: p.md, fontFamily: d.primary },
2298
2355
  children: c("discussion.report.title", "Report post")
2299
2356
  }
2300
2357
  ),
2358
+ /* @__PURE__ */ r(W, { level: "body-sm", sx: { mb: p.md, color: s.textSecondary }, children: c(
2359
+ "discussion.report.description",
2360
+ "Why are you reporting this post?"
2361
+ ) }),
2301
2362
  /* @__PURE__ */ r(
2302
- K,
2303
- {
2304
- level: "body-sm",
2305
- sx: { mb: 2, color: i.textSecondary },
2306
- children: c(
2307
- "discussion.report.description",
2308
- "Why are you reporting this post?"
2309
- )
2310
- }
2311
- ),
2312
- /* @__PURE__ */ r(
2313
- qe,
2363
+ ro,
2314
2364
  {
2315
- value: g,
2316
- onChange: (u) => m(u.target.value),
2317
- sx: { gap: 1, mb: 2 },
2318
- children: nn.map((u) => /* @__PURE__ */ r(
2319
- Je,
2365
+ value: f,
2366
+ onChange: (v) => b(v.target.value),
2367
+ sx: { gap: p.xs, mb: p.md },
2368
+ children: dr.map((v) => /* @__PURE__ */ r(
2369
+ to,
2320
2370
  {
2321
- value: u.value,
2322
- label: c(u.labelKey, u.fallback),
2371
+ value: v.value,
2372
+ label: c(v.labelKey, v.fallback),
2373
+ slotProps: {
2374
+ radio: {
2375
+ sx: {
2376
+ bgcolor: s.surfaceVariant,
2377
+ borderColor: s.outlineEnabledBorder,
2378
+ "&:hover": {
2379
+ bgcolor: s.surface,
2380
+ borderColor: s.outlineEnabledBorder
2381
+ }
2382
+ }
2383
+ }
2384
+ },
2323
2385
  sx: {
2324
- fontFamily: p.primary,
2325
- color: i.textPrimary
2386
+ fontFamily: d.primary,
2387
+ color: s.textPrimary
2326
2388
  }
2327
2389
  },
2328
- u.value
2390
+ v.value
2329
2391
  ))
2330
2392
  }
2331
2393
  ),
2332
- g === "OTHER" && /* @__PURE__ */ r(
2333
- Ue,
2394
+ f === "OTHER" && /* @__PURE__ */ r(
2395
+ Ye,
2334
2396
  {
2335
2397
  placeholder: c(
2336
2398
  "discussion.report.detailsPlaceholder",
2337
2399
  "Please provide more details..."
2338
2400
  ),
2339
- value: v,
2340
- onChange: (u) => C(u.target.value),
2401
+ value: C,
2402
+ onChange: (v) => R(v.target.value),
2341
2403
  minRows: 2,
2342
2404
  maxRows: 4,
2343
- sx: { mb: 2 }
2405
+ sx: {
2406
+ mb: p.md,
2407
+ bgcolor: s.surfaceVariant,
2408
+ color: s.textPrimary,
2409
+ border: `1px solid ${s.outlineEnabledBorder}`,
2410
+ borderRadius: u.sm,
2411
+ boxShadow: "none",
2412
+ "&::before": { display: "none" },
2413
+ "&:focus-within": {
2414
+ border: `1px solid ${g}`,
2415
+ boxShadow: "none"
2416
+ }
2417
+ }
2344
2418
  }
2345
2419
  ),
2346
- /* @__PURE__ */ L(A, { sx: { display: "flex", gap: 1, justifyContent: "flex-end" }, children: [
2420
+ /* @__PURE__ */ F(L, { sx: { display: "flex", gap: p.xs, justifyContent: "flex-end" }, children: [
2347
2421
  /* @__PURE__ */ r(
2348
- Q,
2422
+ oe,
2349
2423
  {
2350
2424
  variant: "plain",
2351
- onClick: b,
2425
+ onClick: y,
2352
2426
  sx: {
2353
- fontFamily: p.primary,
2354
- color: i.textPrimary,
2355
- borderRadius: d.sm,
2356
- "&:hover": { bgcolor: `${i.textPrimary}14` }
2427
+ fontFamily: d.primary,
2428
+ color: s.textPrimary,
2429
+ borderRadius: u.sm,
2430
+ "&:hover": { bgcolor: `${s.textPrimary}14` }
2357
2431
  },
2358
2432
  children: c("common.cancel", "Cancel")
2359
2433
  }
2360
2434
  ),
2361
2435
  /* @__PURE__ */ r(
2362
- Q,
2436
+ oe,
2363
2437
  {
2364
2438
  variant: "solid",
2365
- disabled: !g || S,
2439
+ disabled: !f || S,
2366
2440
  loading: S,
2367
- onClick: M,
2441
+ onClick: $,
2368
2442
  sx: {
2369
- fontFamily: p.primary,
2370
- bgcolor: i.palette.danger.plainColor,
2371
- color: f,
2372
- borderRadius: d.sm,
2443
+ fontFamily: d.primary,
2444
+ bgcolor: g,
2445
+ color: x,
2446
+ borderRadius: u.sm,
2373
2447
  "&:hover": {
2374
- bgcolor: i.palette.danger.plainColor,
2448
+ bgcolor: g,
2375
2449
  opacity: 0.9
2376
2450
  },
2377
2451
  "&:disabled": {
2378
- bgcolor: i.palette.danger.plainColor,
2379
- color: f,
2452
+ bgcolor: g,
2453
+ color: x,
2380
2454
  opacity: 0.4
2381
2455
  }
2382
2456
  },
@@ -2387,387 +2461,487 @@ const wt = (t, e) => {
2387
2461
  ]
2388
2462
  }
2389
2463
  ) });
2390
- }, sn = (t, e) => {
2391
- const n = new Date(t), l = (/* @__PURE__ */ new Date()).getTime() - n.getTime(), s = Math.floor(l / 6e4), c = Math.floor(l / 36e5), i = Math.floor(l / 864e5);
2392
- return s < 1 ? e("discussion.justNow", "Just now") : s < 60 ? e("discussion.minutesAgo", "{{count}}m ago", { count: s }) : c < 24 ? e("discussion.hoursAgo", "{{count}}h ago", { count: c }) : i < 7 ? e("discussion.daysAgo", "{{count}}d ago", { count: i }) : n.toLocaleDateString();
2393
- }, Qe = ({
2394
- post: t,
2464
+ }, pr = (o, e) => {
2465
+ const n = new Date(o), l = (/* @__PURE__ */ new Date()).getTime() - n.getTime(), i = Math.floor(l / 6e4), c = Math.floor(l / 36e5), s = Math.floor(l / 864e5);
2466
+ return i < 1 ? e("discussion.justNow", "Just now") : i < 60 ? e("discussion.minutesAgo", "{{count}}m ago", { count: i }) : c < 24 ? e("discussion.hoursAgo", "{{count}}h ago", { count: c }) : s < 7 ? e("discussion.daysAgo", "{{count}}d ago", { count: s }) : n.toLocaleDateString();
2467
+ }, io = ({
2468
+ post: o,
2395
2469
  sdk: e,
2396
2470
  userIsLoggedIn: n,
2397
2471
  onSignInClick: a,
2398
2472
  showReactions: l = !0,
2399
- showReplies: s = !0,
2473
+ showReplies: i = !0,
2400
2474
  showReportPost: c = !0,
2401
- onReply: i,
2402
- onReact: d,
2403
- onDelete: p,
2404
- onReport: f,
2475
+ onReply: s,
2476
+ onReact: u,
2477
+ onDelete: d,
2478
+ onReport: p,
2405
2479
  isSubmitting: g,
2406
- depth: m = 0,
2407
- parentPostId: v,
2408
- onReplyCreated: C
2480
+ showModeratedPosts: x = !1,
2481
+ depth: f = 0,
2482
+ parentPostId: b,
2483
+ onReplyCreated: C,
2484
+ onDeleteSuccess: R
2409
2485
  }) => {
2410
- var k, ee, ge, ye;
2411
- const { t: S } = ne(), { shadowRootElement: P } = ze(Te), b = Z(), M = ue(), u = Ye(e, n), [E, F] = w(!1), [I, D] = w([]), [z, B] = w(!1), [H, $] = w(!1), [T, R] = w(!1), [V, N] = w({ open: !1, message: "", color: "success" }), j = !!(n && u && t.userId === u), q = async (_) => {
2412
- var oe;
2413
- const W = m === 1 && v || t.id, re = ((oe = t.userModel) == null ? void 0 : oe.name) || t.anonymousNickname || S("discussion.anonymous", "Anonymous"), be = m === 1 ? `@${re} ${_}` : _;
2414
- await i(W, be), F(!1), m === 1 && C ? C() : m === 0 && X();
2415
- }, X = async () => {
2416
- if (!(!s || m >= 2))
2486
+ var Pe, ne, Se, ze;
2487
+ const { t: S } = le(), { shadowRootElement: T } = we(Ne), y = te(), $ = ae(), v = re(), E = so(e, n), [h, O] = H(!1), [N, A] = H([]), [j, U] = H(!1), [B, K] = H(!1), [k, _] = H(!1), [P, V] = H({ open: !1, variant: "success", title: "", message: "" }), m = !!(n && E && o.userId === E), D = async (w) => {
2488
+ var se;
2489
+ const X = f === 1 && b || o.id, Y = ((se = o.userModel) == null ? void 0 : se.name) || o.anonymousNickname || S("discussion.anonymous", "Anonymous"), he = f === 1 ? `@${Y} ${w}` : w;
2490
+ await s(X, he), O(!1), f === 1 && C ? C() : f === 0 && (U(!0), z());
2491
+ }, z = async () => {
2492
+ if (!(!i || f >= 2))
2417
2493
  try {
2418
- const _ = await e.discussions.getPostReplies(t.id, {
2494
+ const w = await e.discussions.getPostReplies(o.id, {
2419
2495
  limit: 25,
2420
2496
  skipDeleted: !0,
2421
- skipModerated: !0
2497
+ skipModerated: !x
2422
2498
  });
2423
- D(_.data);
2424
- } catch (_) {
2425
- console.error("Failed to load replies:", _);
2499
+ A(w.data);
2500
+ } catch (w) {
2501
+ console.error("Failed to load replies:", w);
2426
2502
  }
2427
2503
  };
2428
- Ce(() => {
2429
- z && I.length === 0 && X();
2430
- }, [z]);
2431
- const h = async (_, W) => {
2432
- const re = await d(_, W);
2433
- re && I.length > 0 && D(
2434
- (be) => be.map((oe) => oe.id === _ ? re : oe)
2504
+ be(() => {
2505
+ j && N.length === 0 && z();
2506
+ }, [j]);
2507
+ const ee = async (w) => {
2508
+ await d(w, o.id), A((X) => X.filter((Y) => Y.id !== w));
2509
+ }, fe = async (w, X) => {
2510
+ const Y = await u(w, X);
2511
+ Y && N.length > 0 && A(
2512
+ (he) => he.map((se) => se.id === w ? Y : se)
2435
2513
  );
2436
- }, O = (_, W) => {
2437
- N({ open: !0, message: _, color: W });
2514
+ }, ve = (w, X) => {
2515
+ V({ open: !0, variant: X, title: "", message: w });
2438
2516
  };
2439
- return /* @__PURE__ */ L(A, { sx: { mb: 2, ml: m > 0 ? 4 : 0 }, children: [
2440
- /* @__PURE__ */ L(A, { sx: { display: "flex", gap: 1.5 }, children: [
2517
+ return /* @__PURE__ */ F(L, { sx: { mb: v.md, ml: f > 0 ? v.xl : 0 }, children: [
2518
+ /* @__PURE__ */ F(L, { sx: { display: "flex", gap: v.sm }, children: [
2441
2519
  /* @__PURE__ */ r(
2442
- Zo,
2520
+ it,
2443
2521
  {
2444
- src: (k = t.userModel) == null ? void 0 : k.avatar,
2445
- alt: ((ee = t.userModel) == null ? void 0 : ee.name) || t.anonymousNickname || "User",
2446
- size: "sm"
2522
+ src: (Pe = o.userModel) == null ? void 0 : Pe.avatar,
2523
+ alt: ((ne = o.userModel) == null ? void 0 : ne.name) || o.anonymousNickname || "User",
2524
+ size: "sm",
2525
+ sx: { bgcolor: y.surfaceVariant, color: y.textPrimary }
2447
2526
  }
2448
2527
  ),
2449
- /* @__PURE__ */ L(A, { sx: { flex: 1, minWidth: 0 }, children: [
2450
- /* @__PURE__ */ L(A, { sx: { display: "flex", alignItems: "center", gap: 1, mb: 0.5 }, children: [
2451
- /* @__PURE__ */ r(K, { level: "title-sm", children: ((ge = t.userModel) == null ? void 0 : ge.name) || t.anonymousNickname || S("discussion.anonymous", "Anonymous") }),
2452
- /* @__PURE__ */ r(K, { level: "body-xs", sx: { color: b.textSecondary }, children: sn(t.createdAt, S) }),
2528
+ /* @__PURE__ */ F(L, { sx: { flex: 1, minWidth: 0 }, children: [
2529
+ /* @__PURE__ */ F(L, { sx: { display: "flex", alignItems: "center", gap: v.xs, mb: v["2xs"] }, children: [
2530
+ /* @__PURE__ */ r(W, { level: "title-sm", sx: { color: y.textPrimary }, children: ((Se = o.userModel) == null ? void 0 : Se.name) || o.anonymousNickname || S("discussion.anonymous", "Anonymous") }),
2531
+ /* @__PURE__ */ r(W, { level: "body-xs", sx: { color: y.textSecondary }, children: pr(o.createdAt, S) }),
2453
2532
  /* @__PURE__ */ r(
2454
- on,
2533
+ ar,
2455
2534
  {
2456
- isOwnPost: j,
2457
- canReport: !!(c && n && !j),
2458
- onDelete: () => $(!0),
2459
- onReport: () => R(!0)
2535
+ isOwnPost: m,
2536
+ canReport: !!(c && n && !m),
2537
+ onDelete: () => K(!0),
2538
+ onReport: () => _(!0)
2460
2539
  }
2461
2540
  )
2462
2541
  ] }),
2463
- /* @__PURE__ */ r(K, { level: "body-sm", sx: { mb: 1, whiteSpace: "pre-wrap" }, children: t.content }),
2542
+ o.moderated && x ? /* @__PURE__ */ F(
2543
+ L,
2544
+ {
2545
+ sx: {
2546
+ mb: v.xs,
2547
+ mr: v.md,
2548
+ px: v.sm,
2549
+ py: v.xs,
2550
+ borderRadius: $.xs,
2551
+ borderLeft: `3px solid ${y.outlineEnabledBorder}`,
2552
+ bgcolor: y.surfaceVariant,
2553
+ display: "flex",
2554
+ alignItems: "flex-start",
2555
+ gap: v.xs
2556
+ },
2557
+ children: [
2558
+ /* @__PURE__ */ r(
2559
+ er,
2560
+ {
2561
+ sx: {
2562
+ fontSize: 15,
2563
+ color: y.textSecondary,
2564
+ mt: "2px",
2565
+ flexShrink: 0
2566
+ }
2567
+ }
2568
+ ),
2569
+ /* @__PURE__ */ r(
2570
+ W,
2571
+ {
2572
+ level: "body-sm",
2573
+ sx: { fontStyle: "italic", color: y.textSecondary, lineHeight: 1.5 },
2574
+ children: o.moderatedReason || S(
2575
+ "discussion.moderatedPost",
2576
+ "This comment has been moderated"
2577
+ )
2578
+ }
2579
+ )
2580
+ ]
2581
+ }
2582
+ ) : /* @__PURE__ */ r(
2583
+ W,
2584
+ {
2585
+ level: "body-sm",
2586
+ sx: { mb: v.xs, whiteSpace: "pre-wrap", color: y.textBody },
2587
+ children: o.content
2588
+ }
2589
+ ),
2464
2590
  /* @__PURE__ */ r(
2465
- en,
2591
+ lr,
2466
2592
  {
2467
- post: t,
2593
+ post: o,
2468
2594
  sdk: e,
2469
2595
  userIsLoggedIn: n,
2470
2596
  onSignInClick: a,
2471
- onReact: d,
2597
+ onReact: u,
2472
2598
  showReactions: l,
2473
- showReplyButton: s && m < 2,
2474
- onReplyClick: () => F(!E)
2599
+ showReplyButton: i && f < 2,
2600
+ onReplyClick: () => O(!h)
2475
2601
  }
2476
2602
  ),
2477
- s && t.repliesCount > 0 && /* @__PURE__ */ r(A, { sx: { mb: 1 }, children: /* @__PURE__ */ L(
2478
- K,
2603
+ i && o.repliesCount > 0 && /* @__PURE__ */ r(L, { sx: { mb: v.xs }, children: /* @__PURE__ */ F(
2604
+ W,
2479
2605
  {
2480
2606
  level: "body-sm",
2481
2607
  sx: {
2482
- color: b.palette.primary.plainColor,
2608
+ color: y.palette.primary.plainColor,
2483
2609
  cursor: "pointer",
2484
2610
  fontWeight: 600,
2485
2611
  display: "flex",
2486
2612
  alignItems: "center",
2487
- gap: 0.5
2613
+ gap: v["2xs"]
2488
2614
  },
2489
- onClick: () => B(!z),
2615
+ onClick: () => U(!j),
2490
2616
  children: [
2491
- z ? S("discussion.hideReplies", "Hide replies") : S("discussion.repliesCount", "{{count}} replies", {
2492
- count: t.repliesCount
2617
+ j ? S("discussion.hideReplies", "Hide replies") : S("discussion.repliesCount", "{{count}} replies", {
2618
+ count: o.repliesCount
2493
2619
  }),
2494
- !z && " ▼"
2620
+ !j && " ▼"
2495
2621
  ]
2496
2622
  }
2497
2623
  ) }),
2498
- E && /* @__PURE__ */ r(A, { sx: { mt: 2 }, children: /* @__PURE__ */ r(
2499
- Xe,
2624
+ h && /* @__PURE__ */ r(L, { sx: { mt: v.md }, children: /* @__PURE__ */ r(
2625
+ no,
2500
2626
  {
2501
- onSubmit: q,
2627
+ onSubmit: D,
2502
2628
  userIsLoggedIn: n,
2503
2629
  onSignInClick: a,
2504
2630
  placeholder: S("discussion.writeReply", "Write a reply..."),
2505
2631
  isSubmitting: g,
2506
- replyTo: ((ye = t.userModel) == null ? void 0 : ye.name) || t.anonymousNickname,
2507
- onCancel: () => F(!1)
2632
+ replyTo: ((ze = o.userModel) == null ? void 0 : ze.name) || o.anonymousNickname,
2633
+ onCancel: () => O(!1)
2508
2634
  }
2509
2635
  ) }),
2510
- z && I.length > 0 && /* @__PURE__ */ r(A, { sx: { mt: 2 }, children: I.map((_) => /* @__PURE__ */ r(
2511
- Qe,
2636
+ j && N.length > 0 && /* @__PURE__ */ r(L, { sx: { mt: v.md }, children: N.map((w) => /* @__PURE__ */ r(
2637
+ io,
2512
2638
  {
2513
- post: _,
2639
+ post: w,
2514
2640
  sdk: e,
2515
2641
  userIsLoggedIn: n,
2516
2642
  onSignInClick: a,
2517
2643
  showReactions: l,
2518
- showReplies: s,
2644
+ showReplies: i,
2519
2645
  showReportPost: c,
2520
- onReply: i,
2521
- onReact: h,
2522
- onDelete: p,
2523
- onReport: f,
2646
+ onReply: s,
2647
+ onReact: fe,
2648
+ onDelete: ee,
2649
+ onReport: p,
2524
2650
  isSubmitting: g,
2525
- depth: m + 1,
2526
- parentPostId: m === 0 ? t.id : v,
2527
- onReplyCreated: m === 0 ? X : void 0
2651
+ showModeratedPosts: x,
2652
+ depth: f + 1,
2653
+ parentPostId: f === 0 ? o.id : b,
2654
+ onReplyCreated: f === 0 ? z : void 0,
2655
+ onDeleteSuccess: R
2528
2656
  },
2529
- _.id
2657
+ w.id
2530
2658
  )) })
2531
2659
  ] })
2532
2660
  ] }),
2533
2661
  /* @__PURE__ */ r(
2534
- tn,
2662
+ cr,
2535
2663
  {
2536
- open: H,
2537
- onClose: () => $(!1),
2538
- onConfirm: () => p(t.id),
2539
- onError: (_) => O(_, "danger"),
2540
- container: P
2664
+ open: B,
2665
+ onClose: () => K(!1),
2666
+ onConfirm: async () => {
2667
+ await d(o.id), R == null || R();
2668
+ },
2669
+ onError: (w) => ve(w, "error"),
2670
+ container: T
2541
2671
  }
2542
2672
  ),
2543
2673
  /* @__PURE__ */ r(
2544
- rn,
2674
+ ur,
2545
2675
  {
2546
- open: T,
2547
- onClose: () => R(!1),
2548
- onSubmit: (_, W) => f(t.id, _, W),
2549
- onSuccess: (_) => O(_, "success"),
2550
- onError: (_) => O(_, "danger"),
2551
- container: P
2676
+ open: k,
2677
+ onClose: () => _(!1),
2678
+ onSubmit: (w, X) => p(o.id, w, X),
2679
+ onSuccess: (w) => ve(w, "success"),
2680
+ onError: (w) => ve(w, "error"),
2681
+ container: T
2552
2682
  }
2553
2683
  ),
2554
2684
  /* @__PURE__ */ r(
2555
- et,
2685
+ Ze,
2556
2686
  {
2557
- open: V.open,
2558
- autoHideDuration: 4e3,
2559
- onClose: () => N((_) => ({ ..._, open: !1 })),
2560
- color: V.color,
2561
- variant: "soft",
2562
- sx: {
2563
- fontFamily: M.primary,
2564
- bgcolor: V.color === "success" ? b.palette.success.softBg : b.palette.danger.softBg,
2565
- color: V.color === "success" ? b.palette.success.plainColor : b.palette.danger.plainColor
2566
- },
2567
- children: V.message
2687
+ notification: P,
2688
+ onClose: () => V((w) => ({ ...w, open: !1 }))
2568
2689
  }
2569
2690
  )
2570
2691
  ] });
2571
- }, ln = ({
2572
- discussion: t,
2692
+ }, mr = ({
2693
+ discussion: o,
2573
2694
  posts: e,
2574
2695
  sdk: n,
2575
2696
  userIsLoggedIn: a,
2576
2697
  onSignInClick: l,
2577
- showReactions: s,
2698
+ showReactions: i,
2578
2699
  showReplies: c,
2579
- showReportPost: i,
2580
- currentSort: d,
2581
- onSortChange: p,
2582
- onCreatePost: f,
2700
+ showReportPost: s,
2701
+ currentSort: u,
2702
+ onSortChange: d,
2703
+ onCreatePost: p,
2583
2704
  onReact: g,
2584
- onDeletePost: m,
2585
- onReportPost: v,
2586
- onLoadMore: C,
2587
- hasMore: S,
2588
- isLoading: P,
2589
- isSubmitting: b
2705
+ onDeletePost: x,
2706
+ onReportPost: f,
2707
+ onLoadMore: b,
2708
+ hasMore: C,
2709
+ isLoading: R,
2710
+ isSubmitting: S,
2711
+ infiniteScroll: T = !1,
2712
+ showModeratedPosts: y = !1
2590
2713
  }) => {
2591
- const { t: M } = ne(), u = Be(), { shadowRootElement: E } = ze(Te), F = de(), I = Z(), D = ue(), z = I.palette.primary.plainColor, B = [
2592
- { value: "LATEST", label: M("discussion.sort.latest", "Latest") },
2593
- { value: "OLDEST", label: M("discussion.sort.oldest", "Oldest") },
2594
- { value: "POPULAR", label: M("discussion.sort.popular", "Popular") },
2714
+ const { t: $ } = le(), { shadowRootElement: v } = we(Ne), E = ae(), h = te(), O = re(), N = Ie(null), A = Ie(null);
2715
+ be(() => {
2716
+ if (!T || !A.current) return;
2717
+ const P = new IntersectionObserver(
2718
+ (V) => {
2719
+ V[0].isIntersecting && C && !R && b();
2720
+ },
2721
+ { root: N.current, threshold: 0.1 }
2722
+ );
2723
+ return P.observe(A.current), () => P.disconnect();
2724
+ }, [T, C, R, b]);
2725
+ const [j, U] = H({ open: !1, variant: "success", title: "", message: "" }), B = () => {
2726
+ U({
2727
+ open: !0,
2728
+ variant: "success",
2729
+ title: "",
2730
+ message: $("discussion.delete.success", "Comment deleted successfully.")
2731
+ });
2732
+ }, K = [
2733
+ { value: "LATEST", label: $("discussion.sort.latest", "Latest") },
2734
+ { value: "OLDEST", label: $("discussion.sort.oldest", "Oldest") },
2735
+ { value: "POPULAR", label: $("discussion.sort.popular", "Popular") },
2595
2736
  {
2596
2737
  value: "INTERACTED",
2597
- label: M("discussion.sort.interacted", "Most Interacted")
2738
+ label: $("discussion.sort.interacted", "Most Interacted")
2598
2739
  }
2599
- ], H = {
2740
+ ], k = {
2600
2741
  listbox: {
2601
- container: E,
2742
+ container: v,
2602
2743
  sx: {
2603
2744
  zIndex: 1300,
2604
- bgcolor: u.colorSchemes.light.palette.background.popup,
2605
- border: `1px solid ${u.colorSchemes.light.palette.neutral.outlinedBorder}`,
2606
- borderRadius: F.sm,
2745
+ bgcolor: h.surface,
2746
+ border: `1px solid ${h.outlineEnabledBorder}`,
2747
+ borderRadius: E.sm,
2607
2748
  boxShadow: "0 4px 6px -1px rgb(0 0 0 / 0.1)"
2608
2749
  }
2609
2750
  }
2610
- }, $ = {
2611
- color: `${u.colorSchemes.light.palette.neutral.outlinedColor} !important`,
2612
- bgcolor: `${u.colorSchemes.light.palette.background.popup} !important`,
2751
+ }, _ = {
2752
+ color: `${h.textPrimary} !important`,
2753
+ bgcolor: `${h.surface} !important`,
2613
2754
  "&:hover": {
2614
- bgcolor: `${u.colorSchemes.light.palette.neutral.outlinedHoverBg} !important`,
2615
- color: `${u.colorSchemes.light.palette.neutral.outlinedColor} !important`
2755
+ bgcolor: `${h.surfaceVariant} !important`,
2756
+ color: `${h.textPrimary} !important`
2616
2757
  },
2617
2758
  "&.Mui-selected": {
2618
- bgcolor: `${u.colorSchemes.light.palette.neutral.plainActiveBg} !important`,
2619
- color: `${u.colorSchemes.light.palette.neutral.outlinedColor} !important`
2759
+ bgcolor: `${h.surfaceVariant} !important`,
2760
+ color: `${h.textPrimary} !important`
2620
2761
  },
2621
2762
  "&.Mui-selected:hover": {
2622
- bgcolor: `${u.colorSchemes.light.palette.neutral.outlinedHoverBg} !important`,
2623
- color: `${u.colorSchemes.light.palette.neutral.outlinedColor} !important`
2763
+ bgcolor: `${h.surfaceVariant} !important`,
2764
+ color: `${h.textPrimary} !important`
2624
2765
  }
2625
2766
  };
2626
- return /* @__PURE__ */ L(
2627
- A,
2767
+ return /* @__PURE__ */ F(
2768
+ L,
2628
2769
  {
2770
+ ref: N,
2629
2771
  sx: {
2630
2772
  mx: "auto",
2631
- bgcolor: I.surface,
2773
+ maxHeight: "100%",
2774
+ overflowY: "auto",
2775
+ bgcolor: h.surface,
2632
2776
  borderRadius: "md",
2633
2777
  boxShadow: "sm"
2634
2778
  },
2635
2779
  children: [
2636
- /* @__PURE__ */ L(A, { sx: { mb: 3 }, children: [
2637
- /* @__PURE__ */ r(K, { level: "h3", sx: { mb: 1 }, children: t.label || M("discussion.title", "Discussion") }),
2638
- /* @__PURE__ */ r(K, { level: "body-sm", sx: { color: I.textSecondary }, children: M("discussion.postsCount", "{{count}} posts", {
2639
- count: t.postsCount || 0
2780
+ /* @__PURE__ */ F(L, { sx: { mb: O.lg }, children: [
2781
+ /* @__PURE__ */ r(W, { level: "h3", sx: { mb: O.xs }, children: o.label || $("discussion.title", "Discussion") }),
2782
+ /* @__PURE__ */ r(W, { level: "body-sm", sx: { color: h.textSecondary }, children: $("discussion.postsCount", "{{count}} posts", {
2783
+ count: o.postsCount || 0
2640
2784
  }) })
2641
2785
  ] }),
2642
2786
  /* @__PURE__ */ r(
2643
- Xe,
2787
+ no,
2644
2788
  {
2645
- onSubmit: (T) => f(T),
2789
+ onSubmit: (P) => p(P),
2646
2790
  userIsLoggedIn: a,
2647
2791
  onSignInClick: l,
2648
- isSubmitting: b
2792
+ isSubmitting: S
2649
2793
  }
2650
2794
  ),
2651
- /* @__PURE__ */ r(Oe, { sx: { my: 3 } }),
2652
- /* @__PURE__ */ L(
2653
- A,
2795
+ /* @__PURE__ */ r(Fe, { sx: { my: O.lg } }),
2796
+ /* @__PURE__ */ F(
2797
+ L,
2654
2798
  {
2655
2799
  sx: {
2656
- mb: 3,
2800
+ mb: O.lg,
2657
2801
  display: "flex",
2658
2802
  justifyContent: "space-between",
2659
2803
  alignItems: "center"
2660
2804
  },
2661
2805
  children: [
2662
- /* @__PURE__ */ r(K, { level: "title-md", children: M("discussion.comments", "Comments") }),
2806
+ /* @__PURE__ */ r(W, { level: "title-md", children: $("discussion.comments", "Comments") }),
2663
2807
  /* @__PURE__ */ r(
2664
- Xo,
2808
+ rt,
2665
2809
  {
2666
- value: d,
2667
- onChange: (T, R) => R && p(R),
2810
+ value: u,
2811
+ onChange: (P, V) => V && d(V),
2668
2812
  size: "sm",
2669
- sx: { minWidth: 150 },
2670
- slotProps: H,
2671
- children: B.map((T) => /* @__PURE__ */ r(Yo, { value: T.value, sx: $, children: T.label }, T.value))
2813
+ sx: {
2814
+ minWidth: 150,
2815
+ bgcolor: h.surfaceVariant,
2816
+ color: h.textPrimary,
2817
+ border: `1px solid ${h.outlineEnabledBorder}`,
2818
+ borderRadius: E.sm,
2819
+ boxShadow: "none",
2820
+ "&:hover": {
2821
+ bgcolor: h.surfaceVariant,
2822
+ boxShadow: "none"
2823
+ }
2824
+ },
2825
+ slotProps: k,
2826
+ children: K.map((P) => /* @__PURE__ */ r(nt, { value: P.value, sx: _, children: P.label }, P.value))
2672
2827
  }
2673
2828
  )
2674
2829
  ]
2675
2830
  }
2676
2831
  ),
2677
- P && e.length === 0 ? /* @__PURE__ */ r(A, { sx: { display: "flex", justifyContent: "center", py: 4 }, children: /* @__PURE__ */ r(Do, {}) }) : e.length === 0 ? /* @__PURE__ */ r(A, { sx: { textAlign: "center", py: 4 }, children: /* @__PURE__ */ r(K, { level: "body-md", sx: { color: I.textSecondary }, children: M(
2832
+ R && e.length === 0 ? /* @__PURE__ */ r(L, { sx: { py: O.xl }, children: /* @__PURE__ */ r(Ee, { my: 4 }) }) : e.length === 0 ? /* @__PURE__ */ r(L, { sx: { textAlign: "center", py: O.xl }, children: /* @__PURE__ */ r(W, { level: "body-md", sx: { color: h.textSecondary }, children: $(
2678
2833
  "discussion.noPosts",
2679
2834
  "No comments yet. Be the first to comment!"
2680
- ) }) }) : /* @__PURE__ */ L(De, { children: [
2681
- /* @__PURE__ */ r(A, { children: e.map((T) => /* @__PURE__ */ r(
2682
- Qe,
2835
+ ) }) }) : /* @__PURE__ */ F(Me, { children: [
2836
+ /* @__PURE__ */ r(L, { children: e.map((P) => /* @__PURE__ */ r(
2837
+ io,
2683
2838
  {
2684
- post: T,
2839
+ post: P,
2685
2840
  sdk: n,
2686
2841
  userIsLoggedIn: a,
2687
2842
  onSignInClick: l,
2688
- showReactions: s,
2843
+ showReactions: i,
2689
2844
  showReplies: c,
2690
- showReportPost: i,
2691
- onReply: (R, V) => f(V, R),
2845
+ showReportPost: s,
2846
+ onReply: (V, m) => p(m, V),
2692
2847
  onReact: g,
2693
- onDelete: m,
2694
- onReport: v,
2695
- isSubmitting: b
2848
+ onDelete: x,
2849
+ onReport: f,
2850
+ isSubmitting: S,
2851
+ showModeratedPosts: y,
2852
+ onDeleteSuccess: B
2696
2853
  },
2697
- T.id
2854
+ P.id
2698
2855
  )) }),
2699
- S && /* @__PURE__ */ r(A, { sx: { display: "flex", justifyContent: "center", mt: 3 }, children: /* @__PURE__ */ r(
2700
- Q,
2701
- {
2702
- variant: "outlined",
2703
- onClick: C,
2704
- loading: P,
2705
- disabled: P,
2706
- sx: {
2707
- fontFamily: D.primary,
2708
- borderColor: z,
2709
- color: z,
2710
- borderRadius: F.sm,
2711
- "&:hover": {
2712
- bgcolor: `${z}14`,
2713
- borderColor: z
2714
- },
2715
- "&:disabled": {
2716
- borderColor: z,
2717
- color: z,
2718
- opacity: 0.4
2719
- }
2856
+ T && /* @__PURE__ */ r(L, { ref: A, sx: { height: 1 } })
2857
+ ] }),
2858
+ T && R && e.length > 0 && /* @__PURE__ */ r(L, { sx: { py: O.md }, children: /* @__PURE__ */ r(Ee, { my: 2 }) }),
2859
+ !T && C && /* @__PURE__ */ r(L, { sx: { display: "flex", justifyContent: "center", mt: O.lg }, children: /* @__PURE__ */ r(
2860
+ oe,
2861
+ {
2862
+ variant: "outlined",
2863
+ onClick: b,
2864
+ loading: R,
2865
+ disabled: R,
2866
+ sx: {
2867
+ borderColor: h.palette.primary.plainColor,
2868
+ color: h.palette.primary.plainColor,
2869
+ borderRadius: E.sm,
2870
+ "&:hover": {
2871
+ bgcolor: `${h.palette.primary.plainColor}14`,
2872
+ borderColor: h.palette.primary.plainColor
2720
2873
  },
2721
- children: M("discussion.loadMore", "Load More")
2722
- }
2723
- ) })
2724
- ] })
2874
+ "&:disabled": {
2875
+ borderColor: h.palette.primary.plainColor,
2876
+ color: h.palette.primary.plainColor,
2877
+ opacity: 0.4
2878
+ }
2879
+ },
2880
+ children: $("discussion.loadMore", "Load More")
2881
+ }
2882
+ ) }),
2883
+ /* @__PURE__ */ r(
2884
+ Ze,
2885
+ {
2886
+ notification: j,
2887
+ onClose: () => U((P) => ({ ...P, open: !1 }))
2888
+ }
2889
+ )
2725
2890
  ]
2726
2891
  }
2727
2892
  );
2728
- }, an = (t) => {
2893
+ }, fr = (o) => {
2729
2894
  const {
2730
2895
  entityId: e,
2731
2896
  sdk: n,
2732
2897
  discussionLabel: a,
2733
2898
  discussionUrl: l = "",
2734
- defaultSort: s = "LATEST",
2899
+ defaultSort: i = "LATEST",
2735
2900
  postsPerPage: c = 20,
2736
- showReactions: i = !0,
2737
- showReplies: d = !0,
2738
- showReportPost: p = !0,
2739
- userIsLoggedIn: f = !1,
2740
- onSignInClick: g
2741
- } = t, {
2742
- discussion: m,
2901
+ showReactions: s = !0,
2902
+ showReplies: u = !0,
2903
+ showReportPost: d = !0,
2904
+ infiniteScroll: p = !1,
2905
+ showModeratedPosts: g = !1,
2906
+ userIsLoggedIn: x = !1,
2907
+ onSignInClick: f
2908
+ } = o, {
2909
+ discussion: b,
2910
+ setDiscussion: C,
2911
+ isLoading: R,
2912
+ error: S,
2913
+ isNotFound: T
2914
+ } = Kt(n, e), y = (_) => {
2915
+ C(
2916
+ (P) => P && { ...P, postsCount: Math.max(0, P.postsCount + _) }
2917
+ );
2918
+ }, {
2919
+ posts: $,
2743
2920
  isLoading: v,
2744
- error: C,
2745
- isNotFound: S
2746
- } = wt(n, e), {
2747
- posts: P,
2748
- isLoading: b,
2749
- isSubmitting: M,
2750
- currentSort: u,
2751
- hasMore: E,
2752
- handleSortChange: F,
2753
- handleLoadMore: I,
2754
- handleCreatePost: D,
2755
- handleReact: z,
2921
+ isSubmitting: E,
2922
+ currentSort: h,
2923
+ hasMore: O,
2924
+ handleSortChange: N,
2925
+ handleLoadMore: A,
2926
+ handleCreatePost: j,
2927
+ handleReact: U,
2756
2928
  handleDeletePost: B,
2757
- handleReportPost: H
2758
- } = At(
2929
+ handleReportPost: K
2930
+ } = Wt(
2759
2931
  n,
2760
2932
  e,
2761
- a,
2933
+ a ?? null,
2762
2934
  l,
2763
- s,
2764
- c
2935
+ i,
2936
+ c,
2937
+ y,
2938
+ g
2765
2939
  );
2766
- if (v || !m && !S && b)
2767
- return /* @__PURE__ */ r(Oo, { my: 20 });
2768
- if (C)
2940
+ if (R || !b && !T && v)
2941
+ return /* @__PURE__ */ r(Ee, { my: 20 });
2942
+ if (S)
2769
2943
  return /* @__PURE__ */ r("div", { style: { padding: "20px", textAlign: "center" }, children: /* @__PURE__ */ r("p", { children: "Failed to load discussion. Please try again later." }) });
2770
- const $ = m || {
2944
+ const k = b || {
2771
2945
  id: e,
2772
2946
  title: "",
2773
2947
  description: "",
@@ -2776,29 +2950,74 @@ const wt = (t, e) => {
2776
2950
  updatedAt: (/* @__PURE__ */ new Date()).toISOString()
2777
2951
  };
2778
2952
  return /* @__PURE__ */ r(
2779
- ln,
2953
+ mr,
2780
2954
  {
2781
- discussion: $,
2782
- posts: P,
2955
+ discussion: k,
2956
+ posts: $,
2783
2957
  sdk: n,
2784
- userIsLoggedIn: f,
2785
- onSignInClick: g,
2786
- showReactions: i,
2787
- showReplies: d,
2788
- showReportPost: p,
2789
- currentSort: u,
2790
- onSortChange: F,
2791
- onCreatePost: D,
2792
- onReact: z,
2958
+ userIsLoggedIn: x,
2959
+ onSignInClick: f,
2960
+ showReactions: s,
2961
+ showReplies: u,
2962
+ showReportPost: d,
2963
+ currentSort: h,
2964
+ onSortChange: N,
2965
+ onCreatePost: j,
2966
+ onReact: U,
2793
2967
  onDeletePost: B,
2794
- onReportPost: H,
2795
- onLoadMore: I,
2796
- hasMore: E,
2797
- isLoading: b,
2798
- isSubmitting: M
2968
+ onReportPost: K,
2969
+ onLoadMore: A,
2970
+ hasMore: O,
2971
+ isLoading: v,
2972
+ isSubmitting: E,
2973
+ infiniteScroll: p,
2974
+ showModeratedPosts: g
2799
2975
  }
2800
2976
  );
2801
- }, cn = (t) => /* @__PURE__ */ r(zo, { packageName: "discussion", ...t, children: /* @__PURE__ */ r(an, { ...t }) }), bn = cn;
2977
+ }, vr = (o) => {
2978
+ const [e, n] = q.useState(!1), [a, l] = q.useState(!1), i = q.useRef(
2979
+ `$discussion-shadow-root-${Math.random().toString(36).substring(2, 11)}`
2980
+ ), c = q.useRef(null), s = q.useRef(null), u = q.useRef(null), d = q.useRef(null);
2981
+ q.useEffect(() => {
2982
+ Eo(o.language || "en").finally(() => l(!0));
2983
+ }, [o.language]), q.useEffect(() => {
2984
+ if (c.current)
2985
+ return c.current.shadowRoot ? (s.current = c.current.shadowRoot, u.current = s.current.getElementById(
2986
+ i.current
2987
+ ), u.current || (u.current = document.createElement("div"), u.current.id = i.current, u.current.style.height = "100%", s.current.appendChild(u.current))) : (s.current = c.current.attachShadow({ mode: "open" }), u.current = document.createElement("div"), u.current.id = i.current, u.current.style.height = "100%", s.current.appendChild(u.current)), d.current || (d.current = Oo({
2988
+ key: "discussion-css",
2989
+ prepend: !0,
2990
+ container: s.current
2991
+ })), n(!0), () => {
2992
+ n(!1);
2993
+ };
2994
+ }, []);
2995
+ const p = o.themeOptions, g = /* @__PURE__ */ r(L, { ref: c, sx: { height: "100%", display: "block" } }), x = e && a && u.current && d.current ? Fo(
2996
+ /* @__PURE__ */ r($o, { value: d.current, children: /* @__PURE__ */ r(ko, { containerRef: c, children: /* @__PURE__ */ r(
2997
+ Vo,
2998
+ {
2999
+ customTheme: p,
3000
+ mode: p == null ? void 0 : p.mode,
3001
+ shadowRootElement: u.current,
3002
+ children: /* @__PURE__ */ r(
3003
+ wo,
3004
+ {
3005
+ shadowRootElement: u.current,
3006
+ leadPhoneCountryCode: null,
3007
+ language: o.language,
3008
+ optionsLayout: null,
3009
+ children: o.children
3010
+ }
3011
+ )
3012
+ }
3013
+ ) }) }),
3014
+ u.current
3015
+ ) : null;
3016
+ return /* @__PURE__ */ F(Me, { children: [
3017
+ g,
3018
+ x
3019
+ ] });
3020
+ }, hr = (o) => /* @__PURE__ */ r(vr, { ...o, children: /* @__PURE__ */ r(fr, { ...o }) }), Ir = hr;
2802
3021
  export {
2803
- bn as Discussion
3022
+ Ir as Discussion
2804
3023
  };