fansunited-frontend-components 0.0.99 → 1.0.1

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 (62) hide show
  1. package/Betslip.js +2 -2
  2. package/ChanceGame.js +496 -505
  3. package/ClassicQuizPlay.js +2 -2
  4. package/CollectLead.js +405 -1163
  5. package/CompetitionStatistics.js +2 -2
  6. package/CompetitorCard.js +445 -425
  7. package/Discussion.js +2 -2
  8. package/EitherOrPlay.js +2 -2
  9. package/EventCard.js +648 -593
  10. package/EventGamePlay.js +2 -2
  11. package/Leaderboard.js +142 -132
  12. package/List.js +675 -713
  13. package/MatchQuizPlay.js +2 -2
  14. package/Odds.js +1 -1
  15. package/PersonalityQuizPlay.js +2 -2
  16. package/PickThePair.js +925 -1824
  17. package/PlayerOfTheMatch.js +2106 -2223
  18. package/PollVote.js +2 -2
  19. package/Predictor.js +4209 -18629
  20. package/Standings.js +497 -486
  21. package/TopX.js +3223 -16958
  22. package/chunks/{ChanceGameEmbedVariant-DM9eLG5s.js → ChanceGameEmbedVariant-z8XYzgDW.js} +1 -1
  23. package/chunks/PickOneOfX-IvE4OvyT.js +3146 -0
  24. package/chunks/index-BNl8scz6.js +4 -0
  25. package/chunks/index-CSa2JU4m.js +4 -0
  26. package/chunks/index-Cd1dg0KI.js +4 -0
  27. package/chunks/index-Cei2fzi7.js +4 -0
  28. package/chunks/index-Cxb4wEJU.js +4 -0
  29. package/chunks/index-DqQtGqBF.js +4 -0
  30. package/chunks/index-w1LGN5dz.js +4 -0
  31. package/chunks/main-07vzblS8.js +2091 -0
  32. package/chunks/main-C7X4dM_P.js +4827 -0
  33. package/chunks/main-D_QDfmAw.js +6417 -0
  34. package/chunks/{main-CzfWaEQP.js → main-DdL0UekL.js} +1931 -2025
  35. package/chunks/main-DmBfwyb4.js +2992 -0
  36. package/chunks/main-LEE8n2cG.js +3117 -0
  37. package/chunks/{main-DxvBjXsd.js → main-P2WNvBZE.js} +473 -444
  38. package/chunks/{main-DiBlJBNb.js → main-WkCv5Rjl.js} +668 -694
  39. package/chunks/predictionsHelpers-D8j0Y78z.js +10065 -0
  40. package/chunks/{withVersionStamp-BsLyhvNA.js → withVersionStamp-BPvy9XSs.js} +1 -1
  41. package/package.json +2 -6
  42. package/withVersionStamp.d.ts.map +1 -1
  43. package/chunks/CheckCircle-I1FktW5Y.js +0 -13
  44. package/chunks/Person-CXRqyF4E.js +0 -11
  45. package/chunks/PickOneOfX-DET4ZhjV.js +0 -3117
  46. package/chunks/Search-CIXthh0D.js +0 -17
  47. package/chunks/TimerOutlined-D-WA_vpE.js +0 -8
  48. package/chunks/WorkspacePremiumOutlined-DUXVgJlF.js +0 -136
  49. package/chunks/chevrons-right-HWKW2c4I.js +0 -45
  50. package/chunks/createLucideIcon-YBRjY5Kl.js +0 -79
  51. package/chunks/index-BENM3N_w.js +0 -4
  52. package/chunks/index-BRxAV693.js +0 -4
  53. package/chunks/index-BXYTsvIX.js +0 -4
  54. package/chunks/index-C0ilols1.js +0 -4
  55. package/chunks/index-D7VhczXH.js +0 -4
  56. package/chunks/index-DKwvdw9t.js +0 -4
  57. package/chunks/index-DZN-AITW.js +0 -4
  58. package/chunks/main-B2sDRFF4.js +0 -2184
  59. package/chunks/main-DFNl3g_U.js +0 -4910
  60. package/chunks/main-DLwnvntz.js +0 -4020
  61. package/chunks/main-S8_NDSiY.js +0 -3209
  62. package/chunks/main-lBgr8Liq.js +0 -6571
@@ -1,86 +1,87 @@
1
- import { jsxs as S, jsx as n, Fragment as Re } from "@emotion/react/jsx-runtime";
2
- import { InlineSpinner as vt, Modal as ut, Avatar as St, Notification as pt, useSelect as wt, Spinner as We, WidgetPortal as Ct } from "fansunited-frontend-core/ui/emotion";
3
- import Ie, { useState as D, useEffect as he, useRef as W, useCallback as Se, useLayoutEffect as Ne, useId as kt } from "react";
4
- import { useDisableCache as Rt, useColors as It, useIsRtl as Et, useConstantContext as je, ConstantsContext as Ve, toIntlLocale as ft } from "fansunited-frontend-core";
1
+ import { jsxs as y, jsx as n, Fragment as Re } from "@emotion/react/jsx-runtime";
2
+ import { InlineSpinner as bt, useTextareaAutosize as xt, autosizeShadowStyle as vt, Modal as lt, Avatar as St, Notification as dt, useSelect as wt, Spinner as Oe, WidgetPortal as Ct } from "fansunited-frontend-core/ui/emotion";
3
+ import Ie, { useState as B, useEffect as he, useRef as V, useCallback as Ce, useLayoutEffect as kt, useId as Rt } from "react";
4
+ import { useDisableCache as It, useColors as Et, bidiIsolateAuto as Dt, useIsRtl as Bt, useConstantContext as Ke, ConstantsContext as Ue, toIntlLocale as ut } from "fansunited-frontend-core";
5
5
  import { css as o } from "@emotion/react";
6
- import { useTranslation as ye } from "react-i18next";
7
- import { ThumbUpIcon as Dt, ThumbDownIcon as Bt, FavoriteIcon as Tt, SentimentSatisfiedIcon as Pt, FavoriteBorderIcon as Mt, EmojiEmotionsIcon as At, SentimentVeryDissatisfiedIcon as Lt, MoodBadIcon as zt, ReplyIcon as $t, MoreVertIcon as Ft, DeleteIcon as Ht, FlagIcon as Xt, CloseIcon as Ot, PersonIcon as Wt, RemoveCircleOutlineIcon as Nt, BlockIcon as Kt, KeyboardArrowDownIcon as Ut, UnfoldIcon as jt } from "fansunited-frontend-core/ui/icons";
8
- import { createPortal as Vt } from "react-dom";
9
- const _t = (t, r) => {
10
- const [i, s] = D(null), [p, a] = D(!0), [m, d] = D(null), [l, c] = D(!1);
6
+ import { useTranslation as be } from "react-i18next";
7
+ import { ThumbUpIcon as Pt, ThumbDownIcon as Tt, FavoriteIcon as At, SentimentSatisfiedIcon as Mt, FavoriteBorderIcon as Lt, EmojiEmotionsIcon as zt, SentimentVeryDissatisfiedIcon as $t, MoodBadIcon as Ft, ReplyIcon as Xt, MoreVertIcon as Ht, DeleteIcon as Ot, FlagIcon as Nt, CloseIcon as Wt, PersonIcon as Kt, RemoveCircleOutlineIcon as Ut, BlockIcon as Vt, KeyboardArrowDownIcon as _t, UnfoldIcon as jt } from "fansunited-frontend-core/ui/icons";
8
+ import { createPortal as Yt } from "react-dom";
9
+ const Gt = (t, r) => {
10
+ const [i, s] = B(null), [u, a] = B(!0), [f, d] = B(null), [l, c] = B(!1);
11
11
  return he(() => {
12
12
  r && (async () => {
13
13
  try {
14
14
  a(!0);
15
- const u = await t.discussions.getById(r);
16
- s(u), d(null), c(!1);
17
- } catch (u) {
18
- (t.helpers.getSDKConfiguration().errorHandlingMode === "standard" ? u.error.code === 404 : u.data.error.code === 404) ? (c(!0), d(null), s(null)) : (d(m), s(null), c(!1));
15
+ const g = await t.discussions.getById(r);
16
+ s(g), d(null), c(!1);
17
+ } catch (g) {
18
+ (t.helpers.getSDKConfiguration().errorHandlingMode === "standard" ? g.error.code === 404 : g.data.error.code === 404) ? (c(!0), d(null), s(null)) : (d(f), s(null), c(!1));
19
19
  } finally {
20
20
  a(!1);
21
21
  }
22
22
  })();
23
- }, [t, r]), { discussion: i, setDiscussion: s, isLoading: p, error: m, isNotFound: l };
24
- }, Yt = 5e3, Gt = 5, Jt = (t, r, i = null, s = "", p = "LATEST", a = 20, m, d = !1, l = 0) => {
25
- const c = a <= 0, [h, u] = D([]), [y, b] = D(!c), [g, k] = D(!1), [I, v] = D(null), [f, B] = D(p), [A, E] = D(
23
+ }, [t, r]), { discussion: i, setDiscussion: s, isLoading: u, error: f, isNotFound: l };
24
+ }, Jt = 5e3, qt = 5, Qt = (t, r, i = null, s = "", u = "LATEST", a = 20, f, d = !1, l = 0) => {
25
+ const c = a <= 0, [b, g] = B([]), [C, v] = B(!c), [m, E] = B(!1), [I, x] = B(null), [p, R] = B(u), [M, D] = B(
26
26
  null
27
- ), [$, J] = D(!1), [U, V] = D(() => /* @__PURE__ */ new Set()), q = W(0), T = Se(
28
- async (R, w, C = !1) => {
29
- var M, N;
30
- C || (q.current += 1, V(/* @__PURE__ */ new Set()));
27
+ ), [$, J] = B(!1), [K, _] = B(() => /* @__PURE__ */ new Set()), q = V(0), P = Ce(
28
+ async (k, S, w = !1) => {
29
+ var A, N;
30
+ w || (q.current += 1, _(/* @__PURE__ */ new Set()));
31
31
  try {
32
- b(!0);
33
- const X = await t.discussions.getPosts(r, {
34
- sort: R,
32
+ v(!0);
33
+ const H = await t.discussions.getPosts(r, {
34
+ sort: k,
35
35
  limit: a,
36
- startAfter: w,
36
+ startAfter: S,
37
37
  skipDeleted: !0,
38
38
  skipModerated: !d
39
- }), ae = X.data;
40
- u(C ? (F) => [...F, ...ae] : ae);
41
- const x = !!((M = X.meta.pagination) != null && M.nextPageStartsAfter) && ae.length === a;
42
- E(
43
- ((N = X.meta.pagination) == null ? void 0 : N.nextPageStartsAfter) || null
44
- ), J(x), v(null);
45
- } catch (X) {
46
- (t.helpers.getSDKConfiguration().errorHandlingMode === "standard" ? X.error.code === 404 : X.data.error.code === 404) ? (u([]), J(!1), E(null), v(null)) : v(I);
39
+ }), ae = H.data;
40
+ g(w ? (F) => [...F, ...ae] : ae);
41
+ const h = !!((A = H.meta.pagination) != null && A.nextPageStartsAfter) && ae.length === a;
42
+ D(
43
+ ((N = H.meta.pagination) == null ? void 0 : N.nextPageStartsAfter) || null
44
+ ), J(h), x(null);
45
+ } catch (H) {
46
+ (t.helpers.getSDKConfiguration().errorHandlingMode === "standard" ? H.error.code === 404 : H.data.error.code === 404) ? (g([]), J(!1), D(null), x(null)) : x(I);
47
47
  } finally {
48
- b(!1);
48
+ v(!1);
49
49
  }
50
50
  },
51
+ // eslint-disable-next-line react-hooks/exhaustive-deps -- keyed on the query inputs; the setError(error) no-op is deliberate
51
52
  [t, r, a, d]
52
53
  );
53
54
  he(() => {
54
55
  if (c) {
55
- u([]), J(!1), b(!1);
56
+ g([]), J(!1), v(!1);
56
57
  return;
57
58
  }
58
- r && T(f);
59
- }, [r, f, T, c]);
60
- const _ = (R) => {
61
- B(R), E(null);
62
- }, oe = W(y);
63
- oe.current = y;
64
- const ne = W(A);
65
- ne.current = A;
66
- const pe = Se(() => {
67
- ne.current && !oe.current && T(f, ne.current, !0);
68
- }, [T, f]), Z = W(h);
69
- Z.current = h;
70
- const de = W($);
59
+ r && P(p);
60
+ }, [r, p, P, c]);
61
+ const j = (k) => {
62
+ R(k), D(null);
63
+ }, oe = V(C);
64
+ oe.current = C;
65
+ const ne = V(M);
66
+ ne.current = M;
67
+ const pe = Ce(() => {
68
+ ne.current && !oe.current && P(p, ne.current, !0);
69
+ }, [P, p]), Q = V(b);
70
+ Q.current = b;
71
+ const de = V($);
71
72
  de.current = $;
72
- const re = W(m);
73
- re.current = m;
74
- const ie = W(!1), Q = Se(async () => {
75
- var X, ae;
73
+ const re = V(f);
74
+ re.current = f;
75
+ const ie = V(!1), Z = Ce(async () => {
76
+ var H, ae;
76
77
  if (oe.current || ie.current) return;
77
- const R = f === "LATEST" || !de.current;
78
+ const k = p === "LATEST" || !de.current;
78
79
  ie.current = !0;
79
- const w = q.current, C = Z.current, M = new Map(C.map((x) => [x.id, x])), N = (x) => !M.has(x.id);
80
+ const S = q.current, w = Q.current, A = new Map(w.map((h) => [h.id, h])), N = (h) => !A.has(h.id);
80
81
  try {
81
- const x = [], F = /* @__PURE__ */ new Map();
82
+ const h = [], F = /* @__PURE__ */ new Map();
82
83
  let ee;
83
- for (let K = 0; K < Gt; K++) {
84
+ for (let W = 0; W < qt; W++) {
84
85
  const Y = await t.discussions.getPosts(r, {
85
86
  sort: "LATEST",
86
87
  limit: a,
@@ -90,14 +91,14 @@ const _t = (t, r) => {
90
91
  skipModerated: !1
91
92
  }), G = Y.data;
92
93
  G.forEach((me) => {
93
- const Ge = M.get(me.id);
94
- Ge ? me.moderated && !Ge.moderated && F.set(me.id, me) : (d || !me.moderated) && x.push(me);
95
- }), ee = ((X = Y.meta.pagination) == null ? void 0 : X.nextPageStartsAfter) || void 0;
94
+ const je = A.get(me.id);
95
+ je ? me.moderated && !je.moderated && F.set(me.id, me) : (d || !me.moderated) && h.push(me);
96
+ }), ee = ((H = Y.meta.pagination) == null ? void 0 : H.nextPageStartsAfter) || void 0;
96
97
  const xe = G.length === a && G.every(N);
97
- if (!R || !C.length || !xe || !ee) break;
98
+ if (!k || !w.length || !xe || !ee) break;
98
99
  }
99
- if (w !== q.current || (F.size && u(
100
- (K) => d ? K.map((Y) => {
100
+ if (S !== q.current || (F.size && g(
101
+ (W) => d ? W.map((Y) => {
101
102
  const G = F.get(Y.id);
102
103
  return G ? {
103
104
  ...Y,
@@ -106,17 +107,17 @@ const _t = (t, r) => {
106
107
  moderatedBy: G.moderatedBy,
107
108
  moderatedReason: G.moderatedReason
108
109
  } : Y;
109
- }) : K.filter((Y) => !F.has(Y.id))
110
- ), !R)) return;
111
- const ke = new Set(Z.current.map((K) => K.id)), ce = x.filter((K) => !ke.has(K.id));
110
+ }) : W.filter((Y) => !F.has(Y.id))
111
+ ), !k)) return;
112
+ const ke = new Set(Q.current.map((W) => W.id)), ce = h.filter((W) => !ke.has(W.id));
112
113
  if (!ce.length) return;
113
- C.length ? u((K) => {
114
- const Y = new Set(K.map((xe) => xe.id)), G = ce.filter((xe) => !Y.has(xe.id));
115
- return f === "LATEST" ? [...G, ...K].sort(
114
+ w.length ? g((W) => {
115
+ const Y = new Set(W.map((xe) => xe.id)), G = ce.filter((xe) => !Y.has(xe.id));
116
+ return p === "LATEST" ? [...G, ...W].sort(
116
117
  (xe, me) => Date.parse(me.createdAt) - Date.parse(xe.createdAt)
117
- ) : [...K, ...G.reverse()];
118
- }) : await T(f), V((K) => {
119
- const Y = new Set(K);
118
+ ) : [...W, ...G.reverse()];
119
+ }) : await P(p), _((W) => {
120
+ const Y = new Set(W);
120
121
  return ce.forEach((G) => Y.add(G.id)), Y;
121
122
  }), (ae = re.current) == null || ae.call(re, ce.length);
122
123
  } catch {
@@ -128,45 +129,45 @@ const _t = (t, r) => {
128
129
  r,
129
130
  a,
130
131
  d,
131
- f,
132
- T
133
- ]), se = l > 0 ? Math.max(l, Yt) : 0;
132
+ p,
133
+ P
134
+ ]), se = l > 0 ? Math.max(l, Jt) : 0;
134
135
  he(() => {
135
136
  if (!se || c || !r) return;
136
- const R = () => {
137
- document.visibilityState !== "hidden" && Q();
138
- }, w = () => {
139
- document.visibilityState === "visible" && Q();
140
- }, C = setInterval(R, se);
141
- return document.addEventListener("visibilitychange", w), () => {
142
- clearInterval(C), document.removeEventListener("visibilitychange", w);
137
+ const k = () => {
138
+ document.visibilityState !== "hidden" && Z();
139
+ }, S = () => {
140
+ document.visibilityState === "visible" && Z();
141
+ }, w = setInterval(k, se);
142
+ return document.addEventListener("visibilitychange", S), () => {
143
+ clearInterval(w), document.removeEventListener("visibilitychange", S);
143
144
  };
144
- }, [se, c, r, Q]);
145
- const P = Se((R) => {
146
- V((w) => {
147
- if (!w.has(R)) return w;
148
- const C = new Set(w);
149
- return C.delete(R), C;
145
+ }, [se, c, r, Z]);
146
+ const T = Ce((k) => {
147
+ _((S) => {
148
+ if (!S.has(k)) return S;
149
+ const w = new Set(S);
150
+ return w.delete(k), w;
150
151
  });
151
152
  }, []);
152
153
  return {
153
- posts: h,
154
+ posts: b,
154
155
  postsHidden: c,
155
- isLoading: y,
156
- isSubmitting: g,
156
+ isLoading: C,
157
+ isSubmitting: m,
157
158
  error: I,
158
- currentSort: f,
159
+ currentSort: p,
159
160
  hasMore: $,
160
- newPostIds: U,
161
- markPostSeen: P,
162
- handleSortChange: _,
161
+ newPostIds: K,
162
+ markPostSeen: T,
163
+ handleSortChange: j,
163
164
  handleLoadMore: pe,
164
- handleCreatePost: async (R, w) => {
165
+ handleCreatePost: async (k, S) => {
165
166
  try {
166
- k(!0);
167
- let M = await t.discussions.createPost(r, {
168
- content: R,
169
- replyId: w || null,
167
+ E(!0);
168
+ let A = await t.discussions.createPost(r, {
169
+ content: k,
170
+ replyId: S || null,
170
171
  userNickname: null,
171
172
  discussionLabel: i,
172
173
  discussionUrl: s,
@@ -178,79 +179,79 @@ const _t = (t, r) => {
178
179
  });
179
180
  try {
180
181
  const N = await t.profile.getOwn().getInfo();
181
- M = { ...M, userModel: N };
182
+ A = { ...A, userModel: N };
182
183
  } catch {
183
184
  }
184
- w ? u(
185
+ S ? g(
185
186
  (N) => N.map(
186
- (X) => X.id === w ? { ...X, repliesCount: (X.repliesCount || 0) + 1 } : X
187
+ (H) => H.id === S ? { ...H, repliesCount: (H.repliesCount || 0) + 1 } : H
187
188
  )
188
- ) : c || u((N) => [M, ...N]), m == null || m(1), v(null);
189
- } catch (C) {
190
- throw v(
191
- C
192
- ), C;
189
+ ) : c || g((N) => [A, ...N]), f == null || f(1), x(null);
190
+ } catch (w) {
191
+ throw x(
192
+ w
193
+ ), w;
193
194
  } finally {
194
- k(!1);
195
+ E(!1);
195
196
  }
196
197
  },
197
- handleReact: async (R, w) => {
198
+ handleReact: async (k, S) => {
198
199
  try {
199
- const C = await t.discussions.react(R, w);
200
- return u(
201
- (M) => M.map((N) => N.id === R ? C : N)
202
- ), v(null), C;
203
- } catch (C) {
204
- throw console.error("Error reacting to post:", C), v(
205
- C
206
- ), C;
200
+ const w = await t.discussions.react(k, S);
201
+ return g(
202
+ (A) => A.map((N) => N.id === k ? w : N)
203
+ ), x(null), w;
204
+ } catch (w) {
205
+ throw console.error("Error reacting to post:", w), x(
206
+ w
207
+ ), w;
207
208
  }
208
209
  },
209
- handleDeletePost: async (R, w) => {
210
+ handleDeletePost: async (k, S) => {
210
211
  try {
211
- await t.discussions.deletePost(R), u((C) => C.filter((M) => M.id !== R)), w && u(
212
- (C) => C.map(
213
- (M) => M.id === w ? { ...M, repliesCount: Math.max(0, (M.repliesCount || 0) - 1) } : M
212
+ await t.discussions.deletePost(k), g((w) => w.filter((A) => A.id !== k)), S && g(
213
+ (w) => w.map(
214
+ (A) => A.id === S ? { ...A, repliesCount: Math.max(0, (A.repliesCount || 0) - 1) } : A
214
215
  )
215
- ), m == null || m(-1), v(null);
216
- } catch (C) {
217
- throw v(
218
- C
219
- ), C;
216
+ ), f == null || f(-1), x(null);
217
+ } catch (w) {
218
+ throw x(
219
+ w
220
+ ), w;
220
221
  }
221
222
  },
222
- handleReportPost: async (R, w, C) => {
223
+ handleReportPost: async (k, S, w) => {
223
224
  try {
224
- await t.discussions.reportPost(R, w, C), v(null);
225
- } catch (M) {
226
- throw v(
227
- M
228
- ), M;
225
+ await t.discussions.reportPost(k, S, w), x(null);
226
+ } catch (A) {
227
+ throw x(
228
+ A
229
+ ), A;
229
230
  }
230
231
  }
231
232
  };
232
- }, qt = async (t) => {
233
+ }, Zt = async (t) => {
233
234
  var r;
234
235
  try {
235
- const s = (r = t.helpers.getSDKConfiguration().authProvider) == null ? void 0 : r.getIdToken(), p = s == null ? void 0 : s.split(".")[1];
236
- if (!p) return null;
236
+ const s = (r = t.helpers.getSDKConfiguration().authProvider) == null ? void 0 : r.getIdToken(), u = s == null ? void 0 : s.split(".")[1];
237
+ if (!u) return null;
237
238
  const { sub: a } = JSON.parse(
238
- atob(p.replace(/-/g, "+").replace(/_/g, "/"))
239
+ atob(u.replace(/-/g, "+").replace(/_/g, "/"))
239
240
  );
240
241
  return typeof a == "string" && a ? a : null;
241
242
  } catch {
242
243
  return null;
243
244
  }
244
- }, Zt = (t, r) => {
245
+ }, eo = (t, r) => {
245
246
  var d;
246
- const [i, s] = D(null), p = Rt(), a = Se(
247
+ const [i, s] = B(null), u = It(), a = Ce(
247
248
  async (l) => {
248
249
  if (!r) {
249
250
  s(null);
250
251
  return;
251
252
  }
252
253
  try {
253
- const c = await qt(t);
254
+ const c = await Zt(t);
254
255
  if (!c) return;
255
256
  s(await t.discussions.getUserBan(c, l));
256
257
  } catch (c) {
@@ -260,11 +261,11 @@ const _t = (t, r) => {
260
261
  [t, r]
261
262
  );
262
263
  he(() => {
263
- a(p);
264
- }, [a, p]);
265
- const m = Se(() => a(!0), [a]);
266
- return { ban: i, isBanned: !!((d = i == null ? void 0 : i.activeBan) != null && d.banned), refresh: m };
267
- }, mt = (t) => {
264
+ a(u);
265
+ }, [a, u]);
266
+ const f = Ce(() => a(!0), [a]);
267
+ return { ban: i, isBanned: !!((d = i == null ? void 0 : i.activeBan) != null && d.banned), refresh: f };
268
+ }, pt = (t) => {
268
269
  var r, i, s;
269
270
  return (((r = t == null ? void 0 : t.error) == null ? void 0 : r.status) ?? ((s = (i = t == null ? void 0 : t.data) == null ? void 0 : i.error) == null ? void 0 : s.status)) === "ban";
270
271
  }, e = {
@@ -279,8 +280,8 @@ const _t = (t, r) => {
279
280
  danger: "var(--fu-ucrc-danger-plain-color)",
280
281
  dangerSoft: "var(--fu-ucrc-danger-soft-bg)",
281
282
  // Joy's own defaults, where a Joy component painted something the client theme doesn't set.
282
- joyText: "var(--fu-ucrc-joy-text-primary)",
283
- icon: "var(--fu-ucrc-joy-text-icon)",
283
+ paletteTextPrimary: "var(--fu-ucrc-palette-text-primary)",
284
+ icon: "var(--fu-ucrc-palette-text-icon)",
284
285
  focus: "var(--fu-ucrc-focus-visible)",
285
286
  fontPrimary: "var(--fu-ucrc-font-primary)",
286
287
  fontBody: "var(--fu-ucrc-font-body)",
@@ -301,8 +302,8 @@ const _t = (t, r) => {
301
302
  text14: "var(--fu-ucrc-dsc-text-14)",
302
303
  danger1f: "var(--fu-ucrc-dsc-danger-1f)",
303
304
  danger33: "var(--fu-ucrc-dsc-danger-33)"
304
- }, _e = () => {
305
- const t = It(), r = t.palette.primary.plainColor, i = t.palette.danger.plainColor, s = t.textPrimary;
305
+ }, Ve = () => {
306
+ const t = Et(), r = t.palette.primary.plainColor, i = t.palette.danger.plainColor, s = t.textPrimary;
306
307
  return Ie.useMemo(
307
308
  () => ({
308
309
  "--fu-ucrc-dsc-primary-14": `${r}14`,
@@ -315,14 +316,14 @@ const _t = (t, r) => {
315
316
  [r, i, s]
316
317
  );
317
318
  }, ve = (t, r, i) => o({ margin: 0, fontFamily: e.fontBody, fontSize: t, fontWeight: r, lineHeight: i }), z = {
318
- h3: o(ve("1.5em", 600, 1.33334), { letterSpacing: "-0.025em", color: e.joyText }),
319
- titleLg: o(ve("1.25em", 600, 1.33334), { color: e.joyText }),
320
- titleMd: o(ve("1em", 500, 1.5), { color: e.joyText }),
319
+ h3: o(ve("1.5em", 600, 1.33334), { letterSpacing: "-0.025em", color: e.paletteTextPrimary }),
320
+ titleLg: o(ve("1.25em", 600, 1.33334), { color: e.paletteTextPrimary }),
321
+ titleMd: o(ve("1em", 500, 1.5), { color: e.paletteTextPrimary }),
321
322
  titleSm: ve("0.875em", 500, 1.42858),
322
323
  bodyMd: ve("1em", 400, 1.5),
323
324
  bodySm: ve("0.875em", 400, 1.5),
324
325
  bodyXs: ve("0.75em", 500, 1.5)
325
- }, Ye = o({
326
+ }, _e = o({
326
327
  boxSizing: "border-box",
327
328
  position: "relative",
328
329
  display: "inline-flex",
@@ -341,32 +342,32 @@ const _t = (t, r) => {
341
342
  userSelect: "none",
342
343
  "&:focus-visible": { outline: `2px solid ${e.focus}`, outlineOffset: "2px" },
343
344
  "&:disabled": { pointerEvents: "none", cursor: "default" }
344
- }), Qt = o(Ye, {
345
+ }), to = o(_e, {
345
346
  fontFamily: e.fontPrimary,
346
347
  color: e.onPrimary,
347
348
  backgroundColor: e.primary,
348
349
  "&:active": { backgroundColor: "var(--fu-ucrc-primary-solid-active-bg)" },
349
350
  "&:hover": { backgroundColor: e.primary, opacity: 0.9 },
350
351
  "&:disabled": { opacity: 0.4 }
351
- }), Je = o(Ye, {
352
+ }), Ye = o(_e, {
352
353
  fontFamily: e.fontPrimary,
353
354
  color: e.text,
354
355
  "&:active": { backgroundColor: "var(--fu-ucrc-primary-plain-active-bg)" },
355
356
  "&:hover": { backgroundColor: e.text14 },
356
357
  "&:disabled": { color: "var(--fu-ucrc-neutral-plain-disabled-color)" }
357
- }), qe = o(Ye, {
358
+ }), Ge = o(_e, {
358
359
  border: `1px solid ${e.primary}`,
359
360
  color: e.primary,
360
361
  "&:active": { backgroundColor: "var(--fu-ucrc-primary-outlined-active-bg)" },
361
362
  "&:hover": { backgroundColor: e.primary14, borderColor: e.primary },
362
363
  "&:disabled": { opacity: 0.4 }
363
364
  }), Pe = {
364
- solid: Qt,
365
- plain: Je,
366
- outlined: qe,
367
- signIn: o(qe, { width: "100%", paddingBlock: e.spaceSm, fontFamily: e.fontPrimary }),
365
+ solid: to,
366
+ plain: Ye,
367
+ outlined: Ge,
368
+ signIn: o(Ge, { width: "100%", paddingBlock: e.spaceSm, fontFamily: e.fontPrimary }),
368
369
  // Joy's small plain button, as the post's Reply action.
369
- reply: o(Je, {
370
+ reply: o(Ye, {
370
371
  minHeight: "auto",
371
372
  marginInlineStart: e.spaceXs,
372
373
  paddingBlock: e.space2xs,
@@ -376,11 +377,11 @@ const _t = (t, r) => {
376
377
  }),
377
378
  decorator: o({ display: "inherit", marginInlineEnd: "calc(0.375em / 0.8125)" }),
378
379
  loading: o({ display: "flex", position: "absolute", left: "50%", transform: "translateX(-50%)" })
379
- }, ue = ({ look: t, loading: r, startDecorator: i, disabled: s, children: p, ...a }) => /* @__PURE__ */ S("button", { type: "button", css: Pe[t], disabled: s || r, ...a, children: [
380
+ }, ue = ({ look: t, loading: r, startDecorator: i, disabled: s, children: u, ...a }) => /* @__PURE__ */ y("button", { type: "button", css: Pe[t], disabled: s || r, ...a, children: [
380
381
  i && /* @__PURE__ */ n("span", { css: Pe.decorator, children: i }),
381
- p,
382
- r && /* @__PURE__ */ n("span", { css: Pe.loading, children: /* @__PURE__ */ n(vt, { size: 20, color: "var(--fu-ucrc-primary-solid-bg)" }) })
383
- ] }), Me = {
382
+ u,
383
+ r && /* @__PURE__ */ n("span", { css: Pe.loading, children: /* @__PURE__ */ n(bt, { size: 20, color: "var(--fu-ucrc-primary-solid-bg)" }) })
384
+ ] }), Te = {
384
385
  // Joy's outlined Textarea with the widget's overrides.
385
386
  root: o({
386
387
  boxSizing: "border-box",
@@ -423,122 +424,92 @@ const _t = (t, r) => {
423
424
  font: "inherit",
424
425
  "&::placeholder": { color: "inherit", opacity: 0.64 }
425
426
  })
426
- }, eo = {
427
- visibility: "hidden",
428
- position: "absolute",
429
- overflow: "hidden",
430
- height: 0,
431
- top: 0,
432
- left: 0,
433
- transform: "translateZ(0)",
434
- paddingTop: 0,
435
- paddingBottom: 0
436
- }, De = (t) => parseInt(t, 10) || 0, gt = ({
427
+ }, ft = ({
437
428
  value: t,
438
429
  onChange: r,
439
430
  placeholder: i,
440
431
  minRows: s,
441
- maxRows: p,
432
+ maxRows: u,
442
433
  disabled: a,
443
- marginBottom: m
434
+ marginBottom: f
444
435
  }) => {
445
- const d = W(null), l = W(null), c = W(null), h = Se(() => {
446
- const u = d.current, y = l.current;
447
- if (!u || !y) return;
448
- const b = getComputedStyle(u);
449
- if (b.width === "0px") return;
450
- y.style.width = b.width, y.value = u.value || i || "x", y.value.slice(-1) === `
451
- ` && (y.value += " ");
452
- const g = y.scrollHeight;
453
- y.value = "x";
454
- const k = y.scrollHeight, I = Math.max(Math.min(Math.max(s * k, g), p * k), k), v = I + (b.boxSizing === "border-box" ? De(b.paddingTop) + De(b.paddingBottom) + De(b.borderTopWidth) + De(b.borderBottomWidth) : 0);
455
- v !== 0 && (c.current !== v && (c.current = v, u.style.height = `${v}px`), u.style.overflow = Math.abs(I - g) <= 1 ? "hidden" : "");
456
- }, [s, p, i]);
457
- return Ne(() => {
458
- h();
459
- }), Ne(() => {
460
- const u = d.current;
461
- if (!u) return;
462
- const y = new ResizeObserver(() => h());
463
- return y.observe(u), window.addEventListener("resize", h), () => {
464
- y.disconnect(), window.removeEventListener("resize", h);
465
- };
466
- }, [h]), /* @__PURE__ */ S("div", { css: Me.root, "data-disabled": a || void 0, style: { marginBottom: m }, children: [
436
+ const { inputRef: d, shadowRef: l } = xt(s, u, i);
437
+ return /* @__PURE__ */ y("div", { css: Te.root, "data-disabled": a || void 0, style: { marginBottom: f }, children: [
467
438
  /* @__PURE__ */ n(
468
439
  "textarea",
469
440
  {
470
441
  ref: d,
471
- css: Me.textarea,
442
+ css: Te.textarea,
472
443
  rows: s,
473
444
  value: t,
474
445
  placeholder: i,
475
446
  disabled: a,
476
- onChange: (u) => r(u.target.value)
447
+ onChange: (c) => r(c.target.value)
477
448
  }
478
449
  ),
479
- /* @__PURE__ */ n("textarea", { ref: l, css: Me.textarea, "aria-hidden": !0, readOnly: !0, tabIndex: -1, style: eo })
450
+ /* @__PURE__ */ n("textarea", { ref: l, css: Te.textarea, "aria-hidden": !0, readOnly: !0, tabIndex: -1, style: vt })
480
451
  ] });
481
- }, Be = {
452
+ }, De = {
482
453
  form: o({ marginBottom: e.spaceLg }),
483
454
  replyingTo: o(z.bodySm, { marginBottom: e.spaceXs, color: e.textSecondary }),
484
455
  actions: o({ display: "flex", gap: e.spaceXs, justifyContent: "flex-end" })
485
- }, ht = ({
456
+ }, mt = ({
486
457
  onSubmit: t,
487
458
  userIsLoggedIn: r,
488
459
  onSignInClick: i,
489
460
  placeholder: s,
490
- isSubmitting: p,
461
+ isSubmitting: u,
491
462
  replyTo: a,
492
- onCancel: m,
463
+ onCancel: f,
493
464
  disabled: d = !1
494
465
  }) => {
495
- const { t: l } = ye(), [c, h] = D(""), u = async (y) => {
496
- if (y.preventDefault(), !(!c.trim() || d))
466
+ const { t: l } = be(), [c, b] = B(""), g = async (C) => {
467
+ if (C.preventDefault(), !(!c.trim() || d))
497
468
  try {
498
- await t(c), h("");
499
- } catch (b) {
500
- console.error("Failed to submit comment:", b);
469
+ await t(c), b("");
470
+ } catch (v) {
471
+ console.error("Failed to submit comment:", v);
501
472
  }
502
473
  };
503
- return r ? /* @__PURE__ */ S("form", { onSubmit: u, css: Be.form, children: [
504
- a && /* @__PURE__ */ n("p", { css: Be.replyingTo, children: l("discussion.replyingTo", "Replying to {{name}}", {
505
- name: a
474
+ return r ? /* @__PURE__ */ y("form", { onSubmit: g, css: De.form, children: [
475
+ a && /* @__PURE__ */ n("p", { css: De.replyingTo, children: l("discussion.replyingTo", "Replying to {{name}}", {
476
+ name: Dt(a)
506
477
  }) }),
507
478
  /* @__PURE__ */ n(
508
- gt,
479
+ ft,
509
480
  {
510
481
  placeholder: s || l("discussion.writeComment", "Write a comment..."),
511
482
  value: c,
512
- onChange: h,
483
+ onChange: b,
513
484
  minRows: 3,
514
485
  maxRows: 8,
515
- disabled: p || d,
486
+ disabled: u || d,
516
487
  marginBottom: e.spaceSm
517
488
  }
518
489
  ),
519
- /* @__PURE__ */ S("div", { css: Be.actions, children: [
520
- m && /* @__PURE__ */ n(ue, { look: "plain", onClick: m, disabled: p, children: l("common.cancel", "Cancel") }),
490
+ /* @__PURE__ */ y("div", { css: De.actions, children: [
491
+ f && /* @__PURE__ */ n(ue, { look: "plain", onClick: f, disabled: u, children: l("common.cancel", "Cancel") }),
521
492
  /* @__PURE__ */ n(
522
493
  ue,
523
494
  {
524
495
  look: "solid",
525
496
  type: "submit",
526
- disabled: !c.trim() || p || d,
527
- loading: p,
497
+ disabled: !c.trim() || u || d,
498
+ loading: u,
528
499
  children: a ? l("discussion.reply", "Reply") : l("discussion.post", "Post")
529
500
  }
530
501
  )
531
502
  ] })
532
- ] }) : /* @__PURE__ */ n("div", { css: Be.form, children: /* @__PURE__ */ n(ue, { look: "signIn", onClick: i, children: l("discussion.signInToPost", "Sign in to post") }) });
533
- }, ge = { size: "1em", color: e.icon }, to = {
534
- LIKE: /* @__PURE__ */ n(Dt, { ...ge }),
535
- DISLIKE: /* @__PURE__ */ n(Bt, { ...ge }),
536
- LOVE: /* @__PURE__ */ n(Tt, { ...ge }),
537
- LAUGH: /* @__PURE__ */ n(Pt, { ...ge }),
538
- CARE: /* @__PURE__ */ n(Mt, { ...ge }),
539
- WOW: /* @__PURE__ */ n(At, { ...ge }),
540
- SAD: /* @__PURE__ */ n(Lt, { ...ge }),
541
- ANGRY: /* @__PURE__ */ n(zt, { ...ge })
503
+ ] }) : /* @__PURE__ */ n("div", { css: De.form, children: /* @__PURE__ */ n(ue, { look: "signIn", onClick: i, children: l("discussion.signInToPost", "Sign in to post") }) });
504
+ }, ge = { size: "1em", color: e.icon }, oo = {
505
+ LIKE: /* @__PURE__ */ n(Pt, { ...ge }),
506
+ DISLIKE: /* @__PURE__ */ n(Tt, { ...ge }),
507
+ LOVE: /* @__PURE__ */ n(At, { ...ge }),
508
+ LAUGH: /* @__PURE__ */ n(Mt, { ...ge }),
509
+ CARE: /* @__PURE__ */ n(Lt, { ...ge }),
510
+ WOW: /* @__PURE__ */ n(zt, { ...ge }),
511
+ SAD: /* @__PURE__ */ n($t, { ...ge }),
512
+ ANGRY: /* @__PURE__ */ n(Ft, { ...ge })
542
513
  }, Ae = o({
543
514
  display: "inline-flex",
544
515
  alignItems: "center",
@@ -548,49 +519,49 @@ const _t = (t, r) => {
548
519
  borderRadius: "18px",
549
520
  backgroundColor: "transparent",
550
521
  color: e.textSecondary
551
- }), Le = o(z.bodySm, { fontWeight: 500, color: e.text }), we = {
522
+ }), Me = o(z.bodySm, { fontWeight: 500, color: e.text }), Se = {
552
523
  idle: Ae,
553
524
  primary: o(Ae, { backgroundColor: "var(--fu-ucrc-neutral-soft-bg)", color: e.primary }),
554
525
  danger: o(Ae, { backgroundColor: "var(--fu-ucrc-neutral-soft-bg)", color: e.danger })
555
- }, ze = {
526
+ }, Le = {
556
527
  cursor: "pointer",
557
528
  "&:hover": { backgroundColor: "var(--fu-ucrc-neutral-soft-hover-bg)" }
558
- }, $e = { opacity: 0.5 }, Fe = {
529
+ }, ze = { opacity: 0.5 }, $e = {
559
530
  pill: {
560
531
  enabled: {
561
- idle: o(we.idle, ze),
562
- primary: o(we.primary, ze),
563
- danger: o(we.danger, ze)
532
+ idle: o(Se.idle, Le),
533
+ primary: o(Se.primary, Le),
534
+ danger: o(Se.danger, Le)
564
535
  },
565
536
  disabled: {
566
- idle: o(we.idle, $e),
567
- primary: o(we.primary, $e),
568
- danger: o(we.danger, $e)
537
+ idle: o(Se.idle, ze),
538
+ primary: o(Se.primary, ze),
539
+ danger: o(Se.danger, ze)
569
540
  }
570
541
  },
571
542
  icon: o({ display: "flex", alignItems: "center", fontSize: "1.25em", color: "inherit" }),
572
- count: { idle: Le, primary: o(Le, { color: e.primary }), danger: o(Le, { color: e.danger }) }
573
- }, Ze = ({
543
+ count: { idle: Me, primary: o(Me, { color: e.primary }), danger: o(Me, { color: e.danger }) }
544
+ }, Je = ({
574
545
  reaction: t,
575
546
  count: r,
576
547
  isActive: i,
577
548
  onClick: s,
578
- disabled: p
549
+ disabled: u
579
550
  }) => {
580
- const a = (d) => d >= 1e6 ? (d / 1e6).toFixed(1).replace(/\.0$/, "") + "M" : d >= 1e3 ? (d / 1e3).toFixed(1).replace(/\.0$/, "") + "K" : d.toString(), m = i ? t === "LOVE" || t === "ANGRY" ? "danger" : "primary" : "idle";
581
- return /* @__PURE__ */ S(
551
+ const a = (d) => d >= 1e6 ? (d / 1e6).toFixed(1).replace(/\.0$/, "") + "M" : d >= 1e3 ? (d / 1e3).toFixed(1).replace(/\.0$/, "") + "K" : d.toString(), f = i ? t === "LOVE" || t === "ANGRY" ? "danger" : "primary" : "idle";
552
+ return /* @__PURE__ */ y(
582
553
  "div",
583
554
  {
584
- css: Fe.pill[p ? "disabled" : "enabled"][m],
585
- onClick: p ? void 0 : s,
555
+ css: $e.pill[u ? "disabled" : "enabled"][f],
556
+ onClick: u ? void 0 : s,
586
557
  children: [
587
- /* @__PURE__ */ n("div", { css: Fe.icon, children: to[t] }),
588
- r > 0 && /* @__PURE__ */ n("p", { css: Fe.count[m], children: a(r) })
558
+ /* @__PURE__ */ n("div", { css: $e.icon, children: oo[t] }),
559
+ r > 0 && /* @__PURE__ */ n("p", { css: $e.count[f], children: a(r) })
589
560
  ]
590
561
  }
591
562
  );
592
- }, bt = (t, r) => {
593
- const [i, s] = D(null);
563
+ }, gt = (t, r) => {
564
+ const [i, s] = B(null);
594
565
  return he(() => {
595
566
  (async () => {
596
567
  if (r)
@@ -602,7 +573,7 @@ const _t = (t, r) => {
602
573
  }
603
574
  })();
604
575
  }, [r, t]), i;
605
- }, Qe = {
576
+ }, qe = {
606
577
  row: o({
607
578
  display: "flex",
608
579
  gap: e.spaceXs,
@@ -612,93 +583,95 @@ const _t = (t, r) => {
612
583
  }),
613
584
  // Joy set --Icon-color to the text colour on this button; disabled, it follows the label.
614
585
  replyIcon: o({ color: e.text, "button:disabled &": { color: "currentColor" } })
615
- }, oo = ({
586
+ }, no = ({
616
587
  post: t,
617
588
  sdk: r,
618
589
  userIsLoggedIn: i,
619
590
  onSignInClick: s,
620
- onReact: p,
591
+ onReact: u,
621
592
  showReactions: a = !0,
622
- showReplyButton: m = !0,
593
+ showReplyButton: f = !0,
623
594
  onReplyClick: d,
624
595
  isBanned: l = !1
625
596
  }) => {
626
- var g, k, I, v;
627
- const { t: c } = ye(), h = bt(r, i), y = (() => {
628
- if (!h || !t.reactions)
597
+ var m, E, I, x;
598
+ const { t: c } = be(), b = gt(r, i), C = (() => {
599
+ if (!b || !t.reactions)
629
600
  return null;
630
- for (const f of t.reactions)
631
- if (f.userIds.includes(h))
632
- return f.type;
601
+ for (const p of t.reactions)
602
+ if (p.userIds.includes(b))
603
+ return p.type;
633
604
  return null;
634
- })(), b = (f) => {
605
+ })(), v = (p) => {
635
606
  if (!i) {
636
607
  s == null || s();
637
608
  return;
638
609
  }
639
- p(t.id, f).catch(() => {
610
+ u(t.id, p).catch(() => {
640
611
  });
641
612
  };
642
- return /* @__PURE__ */ S("div", { css: Qe.row, children: [
643
- a && /* @__PURE__ */ S(Re, { children: [
613
+ return /* @__PURE__ */ y("div", { css: qe.row, children: [
614
+ a && /* @__PURE__ */ y(Re, { children: [
644
615
  /* @__PURE__ */ n(
645
- Ze,
616
+ Je,
646
617
  {
647
618
  reaction: "LIKE",
648
- count: ((k = (g = t.reactions) == null ? void 0 : g.find((f) => f.type === "LIKE")) == null ? void 0 : k.reactionCount) || 0,
649
- isActive: y === "LIKE",
650
- onClick: () => b("LIKE"),
619
+ count: ((E = (m = t.reactions) == null ? void 0 : m.find((p) => p.type === "LIKE")) == null ? void 0 : E.reactionCount) || 0,
620
+ isActive: C === "LIKE",
621
+ onClick: () => v("LIKE"),
651
622
  disabled: !i || l
652
623
  }
653
624
  ),
654
625
  /* @__PURE__ */ n(
655
- Ze,
626
+ Je,
656
627
  {
657
628
  reaction: "DISLIKE",
658
- count: ((v = (I = t.reactions) == null ? void 0 : I.find((f) => f.type === "DISLIKE")) == null ? void 0 : v.reactionCount) || 0,
659
- isActive: y === "DISLIKE",
660
- onClick: () => b("DISLIKE"),
629
+ count: ((x = (I = t.reactions) == null ? void 0 : I.find((p) => p.type === "DISLIKE")) == null ? void 0 : x.reactionCount) || 0,
630
+ isActive: C === "DISLIKE",
631
+ onClick: () => v("DISLIKE"),
661
632
  disabled: !i || l
662
633
  }
663
634
  )
664
635
  ] }),
665
- m && /* @__PURE__ */ n(
636
+ f && /* @__PURE__ */ n(
666
637
  ue,
667
638
  {
668
639
  look: "reply",
669
640
  onClick: d,
670
641
  disabled: l,
671
- startDecorator: /* @__PURE__ */ n($t, { size: "1em", css: Qe.replyIcon, style: { marginLeft: "calc(0.375em / -1.625)" } }),
642
+ startDecorator: /* @__PURE__ */ n(Xt, { size: "1em", css: qe.replyIcon, style: { marginLeft: "calc(0.375em / -1.625)" } }),
672
643
  children: c("discussion.reply", "Reply")
673
644
  }
674
645
  )
675
646
  ] });
676
- }, He = 4, et = { visibility: "hidden" }, yt = (t, r, i, s) => {
677
- const p = Et(), [a, m] = D(et);
678
- return Ne(() => {
647
+ }, Fe = 4, Qe = { visibility: "hidden" }, ht = (t, r, i, s) => {
648
+ const u = Bt(), [a, f] = B(Qe);
649
+ return kt(() => {
679
650
  if (!t) {
680
- m(et);
651
+ f(Qe);
681
652
  return;
682
653
  }
683
654
  const d = () => {
684
- var k;
685
- const l = (k = r.current) == null ? void 0 : k.getBoundingClientRect(), c = i.current;
655
+ var R;
656
+ const l = (R = r.current) == null ? void 0 : R.getBoundingClientRect(), c = i.current;
686
657
  if (!l || !c) return;
687
- s === "start" && (c.style.width = `${l.width}px`);
688
- const { width: h, height: u } = c.getBoundingClientRect(), y = document.documentElement;
689
- let b = s === "center" ? l.left + l.width / 2 - h / 2 : p ? l.right - h : l.left;
690
- b = Math.max(0, Math.min(b, y.clientWidth - h));
691
- let g = l.bottom + He;
692
- g + u > y.clientHeight && l.top - He - u >= 0 && (g = l.top - He - u), m({
693
- left: Math.round(b),
694
- top: Math.round(g),
658
+ s === "start" && (c.style.width = `${l.width}px`), c.style.left = "0px", c.style.top = "0px";
659
+ const { left: b, top: g, width: C, height: v } = c.getBoundingClientRect(), m = document.documentElement;
660
+ let E = s === "center" ? l.left + l.width / 2 - C / 2 : u ? l.right - C : l.left;
661
+ E = Math.max(0, Math.min(E, m.clientWidth - C));
662
+ let I = l.bottom + Fe;
663
+ I + v > m.clientHeight && l.top - Fe - v >= 0 && (I = l.top - Fe - v);
664
+ const x = Math.round(E - b), p = Math.round(I - g);
665
+ c.style.left = `${x}px`, c.style.top = `${p}px`, f({
666
+ left: x,
667
+ top: p,
695
668
  width: s === "start" ? l.width : void 0
696
669
  });
697
670
  };
698
671
  return d(), window.addEventListener("resize", d), window.addEventListener("scroll", d, { capture: !0, passive: !0 }), () => {
699
672
  window.removeEventListener("resize", d), window.removeEventListener("scroll", d, { capture: !0 });
700
673
  };
701
- }, [t, s, p, r, i]), a;
674
+ }, [t, s, u, r, i]), a;
702
675
  }, Xe = {
703
676
  // Joy's small plain IconButton; its radius variable never resolved, so it's square.
704
677
  trigger: o({
@@ -766,93 +739,93 @@ const _t = (t, r) => {
766
739
  "&:hover, &:focus-visible": { backgroundColor: e.surfaceVariant },
767
740
  "&[aria-disabled='true']": { pointerEvents: "none", cursor: "default" }
768
741
  })
769
- }, tt = { marginInlineEnd: e.spaceXs }, no = ({
742
+ }, Ze = { marginInlineEnd: e.spaceXs }, ro = ({
770
743
  isOwnPost: t,
771
744
  canReport: r,
772
745
  onDelete: i,
773
746
  onReport: s,
774
- disabled: p = !1
747
+ disabled: u = !1
775
748
  }) => {
776
- const { t: a } = ye(), { shadowRootElement: m } = je(Ve), d = kt(), [l, c] = Ie.useState(!1), h = W(null), u = W(null), y = yt(l, h, u, "center");
749
+ const { t: a } = be(), { shadowRootElement: f } = Ke(Ue), d = Rt(), [l, c] = Ie.useState(!1), b = V(null), g = V(null), C = ht(l, b, g, "center");
777
750
  if (Ie.useEffect(() => {
778
751
  if (!l) return;
779
- const f = (A) => {
780
- const E = A.composedPath();
781
- h.current && E.includes(h.current) || u.current && E.includes(u.current) || c(!1);
782
- }, B = setTimeout(() => {
783
- document.addEventListener("click", f, !0);
752
+ const p = (M) => {
753
+ const D = M.composedPath();
754
+ b.current && D.includes(b.current) || g.current && D.includes(g.current) || c(!1);
755
+ }, R = setTimeout(() => {
756
+ document.addEventListener("click", p, !0);
784
757
  }, 0);
785
758
  return () => {
786
- clearTimeout(B), document.removeEventListener("click", f, !0);
759
+ clearTimeout(R), document.removeEventListener("click", p, !0);
787
760
  };
788
761
  }, [l]), !t && !r) return null;
789
- const b = () => {
790
- var f;
791
- return [...((f = u.current) == null ? void 0 : f.querySelectorAll('[role="menuitem"]')) ?? []];
792
- }, g = () => {
793
- var f;
794
- c(!1), (f = h.current) == null || f.focus();
795
- }, k = (f) => {
796
- var B;
797
- c(!1), (B = h.current) == null || B.focus(), f();
798
- }, I = (f) => {
799
- const B = b(), A = B.indexOf(f.target), E = (J) => {
800
- var U;
801
- return (U = B[(J + B.length) % B.length]) == null ? void 0 : U.focus();
762
+ const v = () => {
763
+ var p;
764
+ return [...((p = g.current) == null ? void 0 : p.querySelectorAll('[role="menuitem"]')) ?? []];
765
+ }, m = () => {
766
+ var p;
767
+ c(!1), (p = b.current) == null || p.focus();
768
+ }, E = (p) => {
769
+ var R;
770
+ c(!1), (R = b.current) == null || R.focus(), p();
771
+ }, I = (p) => {
772
+ const R = v(), M = R.indexOf(p.target), D = (J) => {
773
+ var K;
774
+ return (K = R[(J + R.length) % R.length]) == null ? void 0 : K.focus();
802
775
  }, $ = {
803
- ArrowDown: () => E(A + 1),
804
- ArrowUp: () => E(A - 1),
805
- Home: () => E(0),
806
- End: () => E(B.length - 1),
807
- Escape: g
776
+ ArrowDown: () => D(M + 1),
777
+ ArrowUp: () => D(M - 1),
778
+ Home: () => D(0),
779
+ End: () => D(R.length - 1),
780
+ Escape: m
808
781
  };
809
- $[f.key] ? (f.preventDefault(), $[f.key]()) : f.key === "Tab" && c(!1);
810
- }, v = (f, B, A, E) => /* @__PURE__ */ S(
782
+ $[p.key] ? (p.preventDefault(), $[p.key]()) : p.key === "Tab" && c(!1);
783
+ }, x = (p, R, M, D) => /* @__PURE__ */ y(
811
784
  "li",
812
785
  {
813
786
  role: "menuitem",
814
787
  tabIndex: -1,
815
- "aria-disabled": p,
788
+ "aria-disabled": u,
816
789
  css: Xe.item,
817
- onClick: () => k(E),
790
+ onClick: () => E(D),
818
791
  onKeyDown: ($) => {
819
- $.key !== "Enter" && $.key !== " " || ($.preventDefault(), p || k(E));
792
+ $.key !== "Enter" && $.key !== " " || ($.preventDefault(), u || E(D));
820
793
  },
821
794
  children: [
822
- B,
823
- A
795
+ R,
796
+ M
824
797
  ]
825
798
  },
826
- f
799
+ p
827
800
  );
828
- return /* @__PURE__ */ S(Re, { children: [
801
+ return /* @__PURE__ */ y(Re, { children: [
829
802
  /* @__PURE__ */ n(
830
803
  "button",
831
804
  {
832
- ref: h,
805
+ ref: b,
833
806
  type: "button",
834
807
  "aria-haspopup": "menu",
835
808
  "aria-expanded": l,
836
809
  "aria-controls": l ? d : void 0,
837
810
  css: Xe.trigger,
838
- onClick: (f) => {
839
- c(!l), !l && f.detail === 0 && requestAnimationFrame(() => {
840
- var B;
841
- return (B = b()[0]) == null ? void 0 : B.focus();
811
+ onClick: (p) => {
812
+ c(!l), !l && p.detail === 0 && requestAnimationFrame(() => {
813
+ var R;
814
+ return (R = v()[0]) == null ? void 0 : R.focus();
842
815
  });
843
816
  },
844
- children: /* @__PURE__ */ n(Ft, { size: "1.25em" })
817
+ children: /* @__PURE__ */ n(Ht, { size: "1.25em" })
845
818
  }
846
819
  ),
847
- l && m && Vt(
848
- /* @__PURE__ */ S("ul", { ref: u, id: d, role: "menu", css: Xe.menu, style: y, onKeyDown: I, children: [
849
- t && v("delete", /* @__PURE__ */ n(Ht, { size: "1em", color: e.icon, style: tt }), a("discussion.delete.action", "Delete"), i),
850
- r && v("report", /* @__PURE__ */ n(Xt, { size: "1em", color: e.icon, style: tt }), a("discussion.report.action", "Report"), s)
820
+ l && f && Yt(
821
+ /* @__PURE__ */ y("ul", { ref: g, id: d, role: "menu", css: Xe.menu, style: C, onKeyDown: I, children: [
822
+ t && x("delete", /* @__PURE__ */ n(Ot, { size: "1em", color: e.icon, style: Ze }), a("discussion.delete.action", "Delete"), i),
823
+ r && x("report", /* @__PURE__ */ n(Nt, { size: "1em", color: e.icon, style: Ze }), a("discussion.report.action", "Report"), s)
851
824
  ] }),
852
- m
825
+ f
853
826
  )
854
827
  ] });
855
- }, ot = "rgba(var(--fu-ucrc-shadow-channel) / var(--fu-ucrc-shadow-opacity))", nt = o({
828
+ }, et = "rgba(var(--fu-ucrc-shadow-channel) / var(--fu-ucrc-shadow-opacity))", tt = o({
856
829
  position: "absolute",
857
830
  top: "50%",
858
831
  left: "50%",
@@ -867,35 +840,35 @@ const _t = (t, r) => {
867
840
  border: "1px solid var(--fu-ucrc-neutral-outlined-border)",
868
841
  borderRadius: e.radiusMd,
869
842
  outline: 0,
870
- boxShadow: `var(--fu-ucrc-shadow-ring), 0px 2px 8px -2px ${ot}, 0px 6px 12px -2px ${ot}`,
843
+ boxShadow: `var(--fu-ucrc-shadow-ring), 0px 2px 8px -2px ${et}, 0px 6px 12px -2px ${et}`,
871
844
  backgroundColor: e.surface,
872
845
  color: e.text,
873
846
  fontFamily: e.fontBody,
874
847
  fontSize: "1em",
875
848
  fontWeight: 400,
876
849
  lineHeight: 1.5
877
- }), be = {
878
- delete: o(nt, { maxWidth: "400px" }),
879
- report: o(nt, { maxWidth: "440px" }),
850
+ }), ye = {
851
+ delete: o(tt, { maxWidth: "400px" }),
852
+ report: o(tt, { maxWidth: "440px" }),
880
853
  title: o(z.titleLg, { fontFamily: e.fontPrimary }),
881
854
  description: o(z.bodySm, { color: e.textSecondary }),
882
855
  actions: o({ display: "flex", gap: e.spaceXs, justifyContent: "flex-end" })
883
- }, rt = {
884
- title: o(be.title, { marginBottom: e.spaceXs }),
885
- description: o(be.description, { marginBottom: e.spaceLg })
886
- }, ro = ({
856
+ }, ot = {
857
+ title: o(ye.title, { marginBottom: e.spaceXs }),
858
+ description: o(ye.description, { marginBottom: e.spaceLg })
859
+ }, io = ({
887
860
  open: t,
888
861
  onClose: r,
889
862
  onConfirm: i,
890
863
  onError: s
891
864
  }) => {
892
- const { t: p } = ye(), a = _e(), m = Ie.useId(), [d, l] = D(!1), c = async () => {
865
+ const { t: u } = be(), a = Ve(), f = Ie.useId(), [d, l] = B(!1), c = async () => {
893
866
  l(!0);
894
867
  try {
895
868
  await i(), r();
896
869
  } catch {
897
870
  s(
898
- p(
871
+ u(
899
872
  "discussion.delete.error",
900
873
  "Failed to delete comment. Please try again."
901
874
  )
@@ -904,18 +877,18 @@ const _t = (t, r) => {
904
877
  l(!1);
905
878
  }
906
879
  };
907
- return /* @__PURE__ */ n(ut, { open: t, onClose: r, children: /* @__PURE__ */ S("div", { role: "dialog", "aria-modal": "true", "aria-labelledby": m, tabIndex: -1, css: be.delete, style: a, children: [
908
- /* @__PURE__ */ n("p", { id: m, css: rt.title, children: p("discussion.delete.title", "Delete comment") }),
909
- /* @__PURE__ */ n("p", { css: rt.description, children: p(
880
+ return /* @__PURE__ */ n(lt, { open: t, onClose: r, children: /* @__PURE__ */ y("div", { role: "dialog", "aria-modal": "true", "aria-labelledby": f, tabIndex: -1, css: ye.delete, style: a, children: [
881
+ /* @__PURE__ */ n("p", { id: f, css: ot.title, children: u("discussion.delete.title", "Delete comment") }),
882
+ /* @__PURE__ */ n("p", { css: ot.description, children: u(
910
883
  "discussion.delete.description",
911
884
  "Are you sure you want to delete this comment? This action cannot be undone."
912
885
  ) }),
913
- /* @__PURE__ */ S("div", { css: be.actions, children: [
914
- /* @__PURE__ */ n(ue, { look: "plain", onClick: r, children: p("common.cancel", "Cancel") }),
915
- /* @__PURE__ */ n(ue, { look: "solid", loading: d, onClick: c, children: p("discussion.delete.action", "Delete") })
886
+ /* @__PURE__ */ y("div", { css: ye.actions, children: [
887
+ /* @__PURE__ */ n(ue, { look: "plain", onClick: r, children: u("common.cancel", "Cancel") }),
888
+ /* @__PURE__ */ n(ue, { look: "solid", loading: d, onClick: c, children: u("discussion.delete.action", "Delete") })
916
889
  ] })
917
890
  ] }) });
918
- }, it = o({
891
+ }, nt = o({
919
892
  boxSizing: "border-box",
920
893
  display: "inline-flex",
921
894
  justifyContent: "center",
@@ -930,7 +903,7 @@ const _t = (t, r) => {
930
903
  color: "var(--fu-ucrc-neutral-outlined-color)",
931
904
  "&:active": { backgroundColor: "var(--fu-ucrc-neutral-outlined-active-bg)" },
932
905
  "&:hover": { backgroundColor: e.surface, borderColor: e.border }
933
- }), st = o({
906
+ }), rt = o({
934
907
  width: "0.625em",
935
908
  height: "0.625em",
936
909
  borderRadius: "inherit",
@@ -938,8 +911,8 @@ const _t = (t, r) => {
938
911
  backgroundColor: "currentColor",
939
912
  transform: "scale(0)"
940
913
  }), le = {
941
- title: o(be.title, { marginBottom: e.spaceMd }),
942
- description: o(be.description, { marginBottom: e.spaceMd }),
914
+ title: o(ye.title, { marginBottom: e.spaceMd }),
915
+ description: o(ye.description, { marginBottom: e.spaceMd }),
943
916
  // Joy's ModalClose: an 8px inset, 2rem square.
944
917
  close: o({
945
918
  position: "absolute",
@@ -988,14 +961,14 @@ const _t = (t, r) => {
988
961
  "& + &": { marginBlockStart: "0.875em" }
989
962
  }),
990
963
  circle: {
991
- unchecked: it,
992
- checked: o(it, {
964
+ unchecked: nt,
965
+ checked: o(nt, {
993
966
  color: "var(--fu-ucrc-primary-outlined-color)",
994
967
  "&:active": { backgroundColor: "var(--fu-ucrc-primary-outlined-active-bg)" },
995
968
  "&:hover": { backgroundColor: e.surface, borderColor: e.border }
996
969
  })
997
970
  },
998
- dot: { unchecked: st, checked: o(st, { transform: "none" }) },
971
+ dot: { unchecked: rt, checked: o(rt, { transform: "none" }) },
999
972
  action: o({
1000
973
  position: "absolute",
1001
974
  inset: "-1px",
@@ -1012,7 +985,7 @@ const _t = (t, r) => {
1012
985
  cursor: "pointer"
1013
986
  }),
1014
987
  label: o({ flex: 1, minWidth: 0 })
1015
- }, io = [
988
+ }, so = [
1016
989
  { value: "SPAM", labelKey: "discussion.report.spam", fallback: "Spam" },
1017
990
  {
1018
991
  value: "NOT_ON_THE_SUBJECT",
@@ -1037,50 +1010,50 @@ const _t = (t, r) => {
1037
1010
  },
1038
1011
  { value: "INSULT", labelKey: "discussion.report.insult", fallback: "Insult" },
1039
1012
  { value: "OTHER", labelKey: "discussion.report.other", fallback: "Other" }
1040
- ], so = ({
1013
+ ], ao = ({
1041
1014
  open: t,
1042
1015
  onClose: r,
1043
1016
  onSubmit: i,
1044
1017
  onSuccess: s,
1045
- onError: p
1018
+ onError: u
1046
1019
  }) => {
1047
- const { t: a } = ye(), m = _e(), d = Ie.useId(), [l, c] = D(""), [h, u] = D(""), [y, b] = D(!1), g = () => {
1048
- r(), c(""), u("");
1049
- }, k = async () => {
1050
- b(!0);
1020
+ const { t: a } = be(), f = Ve(), d = Ie.useId(), [l, c] = B(""), [b, g] = B(""), [C, v] = B(!1), m = () => {
1021
+ r(), c(""), g("");
1022
+ }, E = async () => {
1023
+ v(!0);
1051
1024
  try {
1052
1025
  await i(
1053
1026
  l,
1054
- l === "OTHER" ? h : void 0
1027
+ l === "OTHER" ? b : void 0
1055
1028
  ), s(
1056
1029
  a(
1057
1030
  "discussion.report.success",
1058
1031
  "Post reported successfully. Thank you."
1059
1032
  )
1060
- ), g();
1033
+ ), m();
1061
1034
  } catch {
1062
- p(
1035
+ u(
1063
1036
  a(
1064
1037
  "discussion.report.error",
1065
1038
  "Failed to report post. Please try again."
1066
1039
  )
1067
1040
  );
1068
1041
  } finally {
1069
- b(!1);
1042
+ v(!1);
1070
1043
  }
1071
1044
  };
1072
- return /* @__PURE__ */ n(ut, { open: t, onClose: g, children: /* @__PURE__ */ S("div", { role: "dialog", "aria-modal": "true", "aria-labelledby": `${d}title`, tabIndex: -1, css: be.report, style: m, children: [
1073
- /* @__PURE__ */ n("button", { type: "button", "aria-label": a("common.rules.close", "Close"), css: le.close, onClick: g, children: /* @__PURE__ */ n(Ot, { size: "calc(2em / 1.5)" }) }),
1045
+ return /* @__PURE__ */ n(lt, { open: t, onClose: m, children: /* @__PURE__ */ y("div", { role: "dialog", "aria-modal": "true", "aria-labelledby": `${d}title`, tabIndex: -1, css: ye.report, style: f, children: [
1046
+ /* @__PURE__ */ n("button", { type: "button", "aria-label": a("common.rules.close", "Close"), css: le.close, onClick: m, children: /* @__PURE__ */ n(Wt, { size: "calc(2em / 1.5)" }) }),
1074
1047
  /* @__PURE__ */ n("p", { id: `${d}title`, css: le.title, children: a("discussion.report.title", "Report post") }),
1075
1048
  /* @__PURE__ */ n("p", { css: le.description, children: a(
1076
1049
  "discussion.report.description",
1077
1050
  "Why are you reporting this post?"
1078
1051
  ) }),
1079
- /* @__PURE__ */ n("div", { role: "radiogroup", css: le.group, children: io.map((I) => {
1080
- const v = l === I.value, f = v ? "checked" : "unchecked";
1081
- return /* @__PURE__ */ S("span", { css: le.radio, children: [
1082
- /* @__PURE__ */ S("span", { css: le.circle[f], children: [
1083
- /* @__PURE__ */ n("span", { css: le.dot[f] }),
1052
+ /* @__PURE__ */ n("div", { role: "radiogroup", css: le.group, children: so.map((I) => {
1053
+ const x = l === I.value, p = x ? "checked" : "unchecked";
1054
+ return /* @__PURE__ */ y("span", { css: le.radio, children: [
1055
+ /* @__PURE__ */ y("span", { css: le.circle[p], children: [
1056
+ /* @__PURE__ */ n("span", { css: le.dot[p] }),
1084
1057
  /* @__PURE__ */ n("span", { css: le.action, children: /* @__PURE__ */ n(
1085
1058
  "input",
1086
1059
  {
@@ -1088,8 +1061,8 @@ const _t = (t, r) => {
1088
1061
  type: "radio",
1089
1062
  name: `${d}reason`,
1090
1063
  value: I.value,
1091
- checked: v,
1092
- onChange: (B) => c(B.target.value),
1064
+ checked: x,
1065
+ onChange: (R) => c(R.target.value),
1093
1066
  css: le.input
1094
1067
  }
1095
1068
  ) })
@@ -1098,47 +1071,47 @@ const _t = (t, r) => {
1098
1071
  ] }, I.value);
1099
1072
  }) }),
1100
1073
  l === "OTHER" && /* @__PURE__ */ n(
1101
- gt,
1074
+ ft,
1102
1075
  {
1103
1076
  placeholder: a(
1104
1077
  "discussion.report.detailsPlaceholder",
1105
1078
  "Please provide more details..."
1106
1079
  ),
1107
- value: h,
1108
- onChange: u,
1080
+ value: b,
1081
+ onChange: g,
1109
1082
  minRows: 2,
1110
1083
  maxRows: 4,
1111
1084
  marginBottom: e.spaceMd
1112
1085
  }
1113
1086
  ),
1114
- /* @__PURE__ */ S("div", { css: be.actions, children: [
1115
- /* @__PURE__ */ n(ue, { look: "plain", onClick: g, children: a("common.cancel", "Cancel") }),
1087
+ /* @__PURE__ */ y("div", { css: ye.actions, children: [
1088
+ /* @__PURE__ */ n(ue, { look: "plain", onClick: m, children: a("common.cancel", "Cancel") }),
1116
1089
  /* @__PURE__ */ n(
1117
1090
  ue,
1118
1091
  {
1119
1092
  look: "solid",
1120
1093
  disabled: !l,
1121
- loading: y,
1122
- onClick: k,
1094
+ loading: C,
1095
+ onClick: E,
1123
1096
  children: a("discussion.report.action", "Report")
1124
1097
  }
1125
1098
  )
1126
1099
  ] })
1127
1100
  ] }) });
1128
- }, ao = (t, r, i) => {
1129
- const s = new Date(t), a = (/* @__PURE__ */ new Date()).getTime() - s.getTime(), m = Math.floor(a / 6e4), d = Math.floor(a / 36e5), l = Math.floor(a / 864e5);
1130
- return m < 1 ? r("discussion.justNow", "Just now") : m < 60 ? r("discussion.minutesAgo", "{{count}}m ago", { count: m }) : d < 24 ? r("discussion.hoursAgo", "{{count}}h ago", { count: d }) : l < 7 ? r("discussion.daysAgo", "{{count}}d ago", { count: l }) : s.toLocaleDateString(ft(i));
1131
- }, Ke = o({ marginBottom: e.spaceMd }), Ue = o(Ke, {
1101
+ }, co = (t, r, i) => {
1102
+ const s = new Date(t), a = (/* @__PURE__ */ new Date()).getTime() - s.getTime(), f = Math.floor(a / 6e4), d = Math.floor(a / 36e5), l = Math.floor(a / 864e5);
1103
+ return f < 1 ? r("discussion.justNow", "Just now") : f < 60 ? r("discussion.minutesAgo", "{{count}}m ago", { count: f }) : d < 24 ? r("discussion.hoursAgo", "{{count}}h ago", { count: d }) : l < 7 ? r("discussion.daysAgo", "{{count}}d ago", { count: l }) : s.toLocaleDateString(ut(i));
1104
+ }, Ne = o({ marginBottom: e.spaceMd }), We = o(Ne, {
1132
1105
  paddingInline: e.spaceSm,
1133
1106
  paddingBlock: e.spaceXs,
1134
1107
  borderInlineStart: "3px solid transparent",
1135
1108
  borderRadius: e.radiusXs,
1136
1109
  backgroundColor: "transparent",
1137
1110
  transition: "background-color 0.6s ease, border-color 0.6s ease"
1138
- }), at = o(Ue, { borderInlineStartColor: e.primary, backgroundColor: e.primary1a }), co = { width: "64%", height: "64%" }, lo = { marginTop: "2px" }, O = {
1139
- post: { top: Ke, reply: o(Ke, { marginLeft: e.spaceXl }) },
1140
- highlightable: { top: Ue, reply: o(Ue, { marginLeft: e.spaceXl }) },
1141
- highlighted: { top: at, reply: o(at, { marginLeft: e.spaceXl }) },
1111
+ }), it = o(We, { borderInlineStartColor: e.primary, backgroundColor: e.primary1a }), lo = { width: "64%", height: "64%" }, uo = { marginTop: "2px" }, O = {
1112
+ post: { top: Ne, reply: o(Ne, { marginLeft: e.spaceXl }) },
1113
+ highlightable: { top: We, reply: o(We, { marginLeft: e.spaceXl }) },
1114
+ highlighted: { top: it, reply: o(it, { marginLeft: e.spaceXl }) },
1142
1115
  row: o({ display: "flex", gap: e.spaceSm }),
1143
1116
  // Joy's small soft Avatar: 2rem square, in its own 0.875em font.
1144
1117
  avatar: o({
@@ -1154,7 +1127,7 @@ const _t = (t, r) => {
1154
1127
  }),
1155
1128
  body: o({ flex: 1, minWidth: 0 }),
1156
1129
  header: o({ display: "flex", alignItems: "center", gap: e.spaceXs, marginBottom: e.space2xs }),
1157
- name: o(z.titleSm, { color: e.text }),
1130
+ name: o(z.titleSm, { color: e.text, unicodeBidi: "plaintext" }),
1158
1131
  time: o(z.bodyXs, { color: e.textSecondary }),
1159
1132
  badge: o(z.bodyXs, {
1160
1133
  fontWeight: 600,
@@ -1175,8 +1148,9 @@ const _t = (t, r) => {
1175
1148
  borderLeft: `3px solid ${e.border}`,
1176
1149
  backgroundColor: e.surfaceVariant
1177
1150
  }),
1178
- moderatedText: o(z.bodySm, { fontStyle: "italic", color: e.textSecondary }),
1179
- content: o(z.bodySm, { marginBottom: e.spaceXs, whiteSpace: "pre-wrap", color: e.textBody }),
1151
+ moderatedText: o(z.bodySm, { fontStyle: "italic", color: e.textSecondary, unicodeBidi: "plaintext" }),
1152
+ // User text: each line takes its own direction.
1153
+ content: o(z.bodySm, { marginBottom: e.spaceXs, whiteSpace: "pre-wrap", color: e.textBody, unicodeBidi: "plaintext" }),
1180
1154
  repliesRow: o({ marginBottom: e.spaceXs }),
1181
1155
  repliesToggle: o(z.bodySm, {
1182
1156
  display: "flex",
@@ -1188,202 +1162,202 @@ const _t = (t, r) => {
1188
1162
  "&:hover": { textDecoration: "underline", textUnderlineOffset: "2px" }
1189
1163
  }),
1190
1164
  nested: o({ marginTop: e.spaceMd })
1191
- }, uo = 8e3, xt = ({
1165
+ }, po = 8e3, yt = ({
1192
1166
  post: t,
1193
1167
  sdk: r,
1194
1168
  userIsLoggedIn: i,
1195
1169
  onSignInClick: s,
1196
- showReactions: p = !0,
1170
+ showReactions: u = !0,
1197
1171
  showReplies: a = !0,
1198
- showReportPost: m = !0,
1172
+ showReportPost: f = !0,
1199
1173
  onReply: d,
1200
1174
  onReact: l,
1201
1175
  onDelete: c,
1202
- onReport: h,
1203
- isSubmitting: u,
1204
- showModeratedPosts: y = !1,
1205
- isBanned: b = !1,
1206
- highlightable: g = !1,
1207
- isNew: k = !1,
1176
+ onReport: b,
1177
+ isSubmitting: g,
1178
+ showModeratedPosts: C = !1,
1179
+ isBanned: v = !1,
1180
+ highlightable: m = !1,
1181
+ isNew: E = !1,
1208
1182
  onNewSeen: I,
1209
- depth: v = 0,
1210
- parentPostId: f,
1211
- onReplyCreated: B,
1212
- onDeleteSuccess: A
1183
+ depth: x = 0,
1184
+ parentPostId: p,
1185
+ onReplyCreated: R,
1186
+ onDeleteSuccess: M
1213
1187
  }) => {
1214
- var M, N, X, ae;
1215
- const { t: E } = ye(), { language: $ } = je(Ve), J = bt(r, i), [U, V] = D(!1), [q, T] = D([]), [_, oe] = D(!1), [ne, pe] = D(!1), [Z, de] = D(!1), [re, ie] = D({ open: !1, variant: "success", title: "", message: "" }), Q = W(null);
1188
+ var A, N, H, ae;
1189
+ const { t: D } = be(), { language: $ } = Ke(Ue), J = gt(r, i), [K, _] = B(!1), [q, P] = B([]), [j, oe] = B(!1), [ne, pe] = B(!1), [Q, de] = B(!1), [re, ie] = B({ open: !1, variant: "success", title: "", message: "" }), Z = V(null);
1216
1190
  he(() => {
1217
- if (!k || !I || !Q.current) return;
1218
- let x;
1191
+ if (!E || !I || !Z.current) return;
1192
+ let h;
1219
1193
  const F = new IntersectionObserver(
1220
1194
  ([ee]) => {
1221
- ee.isIntersecting && (F.disconnect(), x = setTimeout(() => I(t.id), uo));
1195
+ ee.isIntersecting && (F.disconnect(), h = setTimeout(() => I(t.id), po));
1222
1196
  },
1223
1197
  { threshold: 0.5 }
1224
1198
  );
1225
- return F.observe(Q.current), () => {
1226
- F.disconnect(), clearTimeout(x);
1199
+ return F.observe(Z.current), () => {
1200
+ F.disconnect(), clearTimeout(h);
1227
1201
  };
1228
- }, [k, I, t.id]);
1229
- const se = !!(i && J && t.userId === J), P = !!t.moderated, j = async (x) => {
1202
+ }, [E, I, t.id]);
1203
+ const se = !!(i && J && t.userId === J), T = !!t.moderated, U = async (h) => {
1230
1204
  var ce;
1231
- const F = v === 1 && f || t.id, ee = ((ce = t.userModel) == null ? void 0 : ce.name) || t.anonymousNickname || E("discussion.anonymous", "Anonymous"), ke = v === 1 ? `@${ee} ${x}` : x;
1232
- await d(F, ke), V(!1), v === 1 && B ? B() : v === 0 && (oe(!0), H());
1233
- }, H = async () => {
1234
- if (!(!a || v >= 2))
1205
+ const F = x === 1 && p || t.id, ee = ((ce = t.userModel) == null ? void 0 : ce.name) || t.anonymousNickname || D("discussion.anonymous", "Anonymous"), ke = x === 1 ? `@${ee} ${h}` : h;
1206
+ await d(F, ke), _(!1), x === 1 && R ? R() : x === 0 && (oe(!0), X());
1207
+ }, X = async () => {
1208
+ if (!(!a || x >= 2))
1235
1209
  try {
1236
- const x = await r.discussions.getPostReplies(t.id, {
1210
+ const h = await r.discussions.getPostReplies(t.id, {
1237
1211
  limit: 25,
1238
1212
  skipDeleted: !0,
1239
- skipModerated: !y
1213
+ skipModerated: !C
1240
1214
  });
1241
- T(x.data);
1242
- } catch (x) {
1243
- console.error("Failed to load replies:", x);
1215
+ P(h.data);
1216
+ } catch (h) {
1217
+ console.error("Failed to load replies:", h);
1244
1218
  }
1245
1219
  };
1246
1220
  he(() => {
1247
- _ && q.length === 0 && H();
1248
- }, [_]);
1249
- const Ee = async (x) => {
1250
- await c(x, t.id), T((F) => F.filter((ee) => ee.id !== x));
1251
- }, fe = async (x, F) => {
1252
- const ee = await l(x, F);
1253
- ee && q.length > 0 && T(
1254
- (ke) => ke.map((ce) => ce.id === x ? ee : ce)
1221
+ j && q.length === 0 && X();
1222
+ }, [j]);
1223
+ const Ee = async (h) => {
1224
+ await c(h, t.id), P((F) => F.filter((ee) => ee.id !== h));
1225
+ }, fe = async (h, F) => {
1226
+ const ee = await l(h, F);
1227
+ ee && q.length > 0 && P(
1228
+ (ke) => ke.map((ce) => ce.id === h ? ee : ce)
1255
1229
  );
1256
- }, R = (x, F) => {
1257
- ie({ open: !0, variant: F, title: "", message: x });
1258
- }, w = v > 0 ? "reply" : "top", C = ((M = t.userModel) == null ? void 0 : M.name) || t.anonymousNickname || "User";
1259
- return /* @__PURE__ */ S(
1230
+ }, k = (h, F) => {
1231
+ ie({ open: !0, variant: F, title: "", message: h });
1232
+ }, S = x > 0 ? "reply" : "top", w = ((A = t.userModel) == null ? void 0 : A.name) || t.anonymousNickname || "User";
1233
+ return /* @__PURE__ */ y(
1260
1234
  "div",
1261
1235
  {
1262
- css: g ? k ? O.highlighted[w] : O.highlightable[w] : O.post[w],
1236
+ css: m ? E ? O.highlighted[S] : O.highlightable[S] : O.post[S],
1263
1237
  children: [
1264
- /* @__PURE__ */ S("div", { css: O.row, children: [
1265
- /* @__PURE__ */ n(St, { src: (N = t.userModel) == null ? void 0 : N.avatar, alt: C, css: O.avatar, children: /* @__PURE__ */ n(Wt, { color: e.icon, style: co }) }),
1266
- /* @__PURE__ */ S("div", { css: O.body, children: [
1267
- /* @__PURE__ */ S("div", { ref: Q, css: O.header, children: [
1268
- /* @__PURE__ */ n("p", { css: O.name, children: ((X = t.userModel) == null ? void 0 : X.name) || t.anonymousNickname || E("discussion.anonymous", "Anonymous") }),
1269
- /* @__PURE__ */ n("span", { css: O.time, children: ao(t.createdAt, E, $) }),
1270
- k && /* @__PURE__ */ n("span", { css: O.badge, children: E("discussion.newPost", "New") }),
1238
+ /* @__PURE__ */ y("div", { css: O.row, children: [
1239
+ /* @__PURE__ */ n(St, { src: (N = t.userModel) == null ? void 0 : N.avatar, alt: w, css: O.avatar, children: /* @__PURE__ */ n(Kt, { color: e.icon, style: lo }) }),
1240
+ /* @__PURE__ */ y("div", { css: O.body, children: [
1241
+ /* @__PURE__ */ y("div", { ref: Z, css: O.header, children: [
1242
+ /* @__PURE__ */ n("p", { css: O.name, children: ((H = t.userModel) == null ? void 0 : H.name) || t.anonymousNickname || D("discussion.anonymous", "Anonymous") }),
1243
+ /* @__PURE__ */ n("span", { css: O.time, children: co(t.createdAt, D, $) }),
1244
+ E && /* @__PURE__ */ n("span", { css: O.badge, children: D("discussion.newPost", "New") }),
1271
1245
  /* @__PURE__ */ n(
1272
- no,
1246
+ ro,
1273
1247
  {
1274
1248
  isOwnPost: se,
1275
- canReport: !!(m && i && !se) && !P,
1249
+ canReport: !!(f && i && !se) && !T,
1276
1250
  onDelete: () => pe(!0),
1277
1251
  onReport: () => de(!0),
1278
- disabled: b
1252
+ disabled: v
1279
1253
  }
1280
1254
  )
1281
1255
  ] }),
1282
- P && y ? /* @__PURE__ */ S("div", { css: O.moderated, children: [
1283
- /* @__PURE__ */ n(Nt, { size: "0.9375em", color: e.textSecondary, style: lo }),
1284
- /* @__PURE__ */ n("p", { css: O.moderatedText, children: t.moderatedReason || E(
1256
+ T && C ? /* @__PURE__ */ y("div", { css: O.moderated, children: [
1257
+ /* @__PURE__ */ n(Ut, { size: "0.9375em", color: e.textSecondary, style: uo }),
1258
+ /* @__PURE__ */ n("p", { css: O.moderatedText, children: t.moderatedReason || D(
1285
1259
  "discussion.moderatedPost",
1286
1260
  "This comment has been moderated"
1287
1261
  ) })
1288
1262
  ] }) : /* @__PURE__ */ n("p", { css: O.content, children: t.content }),
1289
- !P && /* @__PURE__ */ n(
1290
- oo,
1263
+ !T && /* @__PURE__ */ n(
1264
+ no,
1291
1265
  {
1292
1266
  post: t,
1293
1267
  sdk: r,
1294
1268
  userIsLoggedIn: i,
1295
1269
  onSignInClick: s,
1296
1270
  onReact: l,
1297
- showReactions: p,
1298
- showReplyButton: a && v < 2,
1299
- onReplyClick: () => V(!U),
1300
- isBanned: b
1271
+ showReactions: u,
1272
+ showReplyButton: a && x < 2,
1273
+ onReplyClick: () => _(!K),
1274
+ isBanned: v
1301
1275
  }
1302
1276
  ),
1303
- a && t.repliesCount > 0 && /* @__PURE__ */ n("div", { css: O.repliesRow, children: /* @__PURE__ */ S(
1277
+ a && t.repliesCount > 0 && /* @__PURE__ */ n("div", { css: O.repliesRow, children: /* @__PURE__ */ y(
1304
1278
  "p",
1305
1279
  {
1306
1280
  css: O.repliesToggle,
1307
- onClick: () => oe(!_),
1281
+ onClick: () => oe(!j),
1308
1282
  children: [
1309
- _ ? E("discussion.hideReplies", "Hide replies") : E("discussion.repliesCount", "{{count}} replies", {
1283
+ j ? D("discussion.hideReplies", "Hide replies") : D("discussion.repliesCount", "{{count}} replies", {
1310
1284
  count: t.repliesCount
1311
1285
  }),
1312
- !_ && " ▼"
1286
+ !j && " ▼"
1313
1287
  ]
1314
1288
  }
1315
1289
  ) }),
1316
- U && !P && /* @__PURE__ */ n("div", { css: O.nested, children: /* @__PURE__ */ n(
1317
- ht,
1290
+ K && !T && /* @__PURE__ */ n("div", { css: O.nested, children: /* @__PURE__ */ n(
1291
+ mt,
1318
1292
  {
1319
- onSubmit: j,
1293
+ onSubmit: U,
1320
1294
  userIsLoggedIn: i,
1321
1295
  onSignInClick: s,
1322
- placeholder: E("discussion.writeReply", "Write a reply..."),
1323
- isSubmitting: u,
1296
+ placeholder: D("discussion.writeReply", "Write a reply..."),
1297
+ isSubmitting: g,
1324
1298
  replyTo: ((ae = t.userModel) == null ? void 0 : ae.name) || t.anonymousNickname,
1325
- onCancel: () => V(!1),
1326
- disabled: b
1299
+ onCancel: () => _(!1),
1300
+ disabled: v
1327
1301
  }
1328
1302
  ) }),
1329
- _ && q.length > 0 && /* @__PURE__ */ n("div", { css: O.nested, children: q.map((x) => /* @__PURE__ */ n(
1330
- xt,
1303
+ j && q.length > 0 && /* @__PURE__ */ n("div", { css: O.nested, children: q.map((h) => /* @__PURE__ */ n(
1304
+ yt,
1331
1305
  {
1332
- post: x,
1306
+ post: h,
1333
1307
  sdk: r,
1334
1308
  userIsLoggedIn: i,
1335
1309
  onSignInClick: s,
1336
- showReactions: p,
1310
+ showReactions: u,
1337
1311
  showReplies: a,
1338
- showReportPost: m,
1312
+ showReportPost: f,
1339
1313
  onReply: d,
1340
1314
  onReact: fe,
1341
1315
  onDelete: Ee,
1342
- onReport: h,
1343
- isSubmitting: u,
1344
- showModeratedPosts: y,
1345
- isBanned: b,
1346
- depth: v + 1,
1347
- parentPostId: v === 0 ? t.id : f,
1348
- onReplyCreated: v === 0 ? H : void 0,
1349
- onDeleteSuccess: A
1316
+ onReport: b,
1317
+ isSubmitting: g,
1318
+ showModeratedPosts: C,
1319
+ isBanned: v,
1320
+ depth: x + 1,
1321
+ parentPostId: x === 0 ? t.id : p,
1322
+ onReplyCreated: x === 0 ? X : void 0,
1323
+ onDeleteSuccess: M
1350
1324
  },
1351
- x.id
1325
+ h.id
1352
1326
  )) })
1353
1327
  ] })
1354
1328
  ] }),
1355
1329
  /* @__PURE__ */ n(
1356
- ro,
1330
+ io,
1357
1331
  {
1358
1332
  open: ne,
1359
1333
  onClose: () => pe(!1),
1360
1334
  onConfirm: async () => {
1361
- await c(t.id), A == null || A();
1335
+ await c(t.id), M == null || M();
1362
1336
  },
1363
- onError: (x) => R(x, "error")
1337
+ onError: (h) => k(h, "error")
1364
1338
  }
1365
1339
  ),
1366
1340
  /* @__PURE__ */ n(
1367
- so,
1341
+ ao,
1368
1342
  {
1369
- open: Z,
1343
+ open: Q,
1370
1344
  onClose: () => de(!1),
1371
- onSubmit: (x, F) => h(t.id, x, F),
1372
- onSuccess: (x) => R(x, "success"),
1373
- onError: (x) => R(x, "error")
1345
+ onSubmit: (h, F) => b(t.id, h, F),
1346
+ onSuccess: (h) => k(h, "success"),
1347
+ onError: (h) => k(h, "error")
1374
1348
  }
1375
1349
  ),
1376
1350
  /* @__PURE__ */ n(
1377
- pt,
1351
+ dt,
1378
1352
  {
1379
1353
  notification: re,
1380
- onClose: () => ie((x) => ({ ...x, open: !1 }))
1354
+ onClose: () => ie((h) => ({ ...h, open: !1 }))
1381
1355
  }
1382
1356
  )
1383
1357
  ]
1384
1358
  }
1385
1359
  );
1386
- }, Oe = 864e5, ct = -1, Te = o(z.bodyMd, { fontSize: "0.8125em", color: e.textSecondary }), lt = o({ transition: "transform 0.2s" }), L = {
1360
+ }, He = 864e5, st = -1, Be = o(z.bodyMd, { fontSize: "0.8125em", color: e.textSecondary }), at = o({ transition: "transform 0.2s" }), L = {
1387
1361
  root: o({
1388
1362
  fontSize: "1em",
1389
1363
  marginBottom: e.spaceSm,
@@ -1417,7 +1391,7 @@ const _t = (t, r) => {
1417
1391
  paddingInline: e.spaceXs,
1418
1392
  paddingBlock: "0.125em"
1419
1393
  }),
1420
- meta: Te,
1394
+ meta: Be,
1421
1395
  reasonBox: o({
1422
1396
  marginTop: e.spaceSm,
1423
1397
  paddingInline: e.spaceSm,
@@ -1443,111 +1417,111 @@ const _t = (t, r) => {
1443
1417
  backgroundColor: "transparent",
1444
1418
  cursor: "pointer"
1445
1419
  }),
1446
- chevron: { closed: lt, open: o(lt, { transform: "rotate(180deg)" }) },
1420
+ chevron: { closed: at, open: o(at, { transform: "rotate(180deg)" }) },
1447
1421
  list: o({ listStyle: "none", margin: 0, padding: 0, marginTop: e.spaceXs }),
1448
1422
  entry: o({ paddingBlock: e.spaceXs, borderTop: `1px solid ${e.danger33}` }),
1449
- entryDates: o(Te, { fontWeight: 600, color: e.text }),
1450
- entryReason: o(Te, { unicodeBidi: "plaintext" }),
1451
- entryLifted: o(Te, { fontStyle: "italic" }),
1423
+ entryDates: o(Be, { fontWeight: 600, color: e.text }),
1424
+ entryReason: o(Be, { unicodeBidi: "plaintext" }),
1425
+ entryLifted: o(Be, { fontStyle: "italic" }),
1452
1426
  isolate: o({ unicodeBidi: "isolate" })
1453
- }, po = ({
1427
+ }, fo = ({
1454
1428
  ban: t,
1455
1429
  showBanHistory: r = !1
1456
1430
  }) => {
1457
- const { t: i } = ye(), { language: s } = je(Ve), [p, a] = D(!1), m = ft(s), d = (g) => new Date(g).toLocaleDateString(m, { dateStyle: "medium" }), l = (g) => new Date(g).toLocaleString(m, {
1431
+ const { t: i } = be(), { language: s } = Ke(Ue), [u, a] = B(!1), f = ut(s), d = (m) => new Date(m).toLocaleDateString(f, { dateStyle: "medium" }), l = (m) => new Date(m).toLocaleString(f, {
1458
1432
  dateStyle: "medium",
1459
1433
  timeStyle: "short"
1460
- }), { activeBan: c } = t, h = c.bannedPeriodInDays === ct, u = new Date(
1461
- new Date(c.bannedAt).getTime() + c.bannedPeriodInDays * Oe
1462
- ), y = Math.max(
1434
+ }), { activeBan: c } = t, b = c.bannedPeriodInDays === st, g = new Date(
1435
+ new Date(c.bannedAt).getTime() + c.bannedPeriodInDays * He
1436
+ ), C = Math.max(
1463
1437
  1,
1464
- Math.ceil((u.getTime() - Date.now()) / Oe)
1465
- ), b = (t.history || []).filter(
1466
- (g) => g.bannedAt !== c.bannedAt
1438
+ Math.ceil((g.getTime() - Date.now()) / He)
1439
+ ), v = (t.history || []).filter(
1440
+ (m) => m.bannedAt !== c.bannedAt
1467
1441
  );
1468
- return /* @__PURE__ */ n("div", { role: "status", css: L.root, children: /* @__PURE__ */ S("div", { css: L.row, children: [
1469
- /* @__PURE__ */ n("div", { css: L.badge, children: /* @__PURE__ */ n(Kt, { size: "1.25em", color: e.icon }) }),
1470
- /* @__PURE__ */ S("div", { css: L.body, children: [
1442
+ return /* @__PURE__ */ n("div", { role: "status", css: L.root, children: /* @__PURE__ */ y("div", { css: L.row, children: [
1443
+ /* @__PURE__ */ n("div", { css: L.badge, children: /* @__PURE__ */ n(Vt, { size: "1.25em", color: e.icon }) }),
1444
+ /* @__PURE__ */ y("div", { css: L.body, children: [
1471
1445
  /* @__PURE__ */ n("p", { css: L.title, children: i("discussion.ban.title", "You've been banned from commenting") }),
1472
- /* @__PURE__ */ n("p", { css: L.description, children: h ? i(
1446
+ /* @__PURE__ */ n("p", { css: L.description, children: b ? i(
1473
1447
  "discussion.ban.descriptionPermanent",
1474
1448
  "You can still read the discussion, but you can no longer post, reply or react."
1475
1449
  ) : i(
1476
1450
  "discussion.ban.description",
1477
1451
  "You can still read the discussion, but you can't post, reply or react until the ban ends."
1478
1452
  ) }),
1479
- /* @__PURE__ */ S("div", { css: L.pills, children: [
1480
- /* @__PURE__ */ n("span", { css: L.pill, children: h ? i("discussion.ban.permanent", "Permanent ban") : i("discussion.ban.daysLeft", "{{count}} days left", {
1481
- count: y
1453
+ /* @__PURE__ */ y("div", { css: L.pills, children: [
1454
+ /* @__PURE__ */ n("span", { css: L.pill, children: b ? i("discussion.ban.permanent", "Permanent ban") : i("discussion.ban.daysLeft", "{{count}} days left", {
1455
+ count: C
1482
1456
  }) }),
1483
1457
  /* @__PURE__ */ n("span", { css: L.meta, children: i("discussion.ban.since", "Since {{date}}", {
1484
1458
  date: d(c.bannedAt)
1485
1459
  }) }),
1486
- !h && /* @__PURE__ */ S("span", { css: L.meta, children: [
1460
+ !b && /* @__PURE__ */ y("span", { css: L.meta, children: [
1487
1461
  "·",
1488
1462
  " ",
1489
1463
  i("discussion.ban.until", "Until {{date}}", {
1490
- date: l(u)
1464
+ date: l(g)
1491
1465
  })
1492
1466
  ] })
1493
1467
  ] }),
1494
- c.bannedReason && /* @__PURE__ */ S("div", { css: L.reasonBox, children: [
1468
+ c.bannedReason && /* @__PURE__ */ y("div", { css: L.reasonBox, children: [
1495
1469
  /* @__PURE__ */ n("span", { css: L.reasonLabel, children: i("discussion.ban.reason", "Reason") }),
1496
1470
  /* @__PURE__ */ n("p", { css: L.reason, children: c.bannedReason })
1497
1471
  ] }),
1498
- r && b.length > 0 && /* @__PURE__ */ S("div", { css: L.history, children: [
1499
- /* @__PURE__ */ S(
1472
+ r && v.length > 0 && /* @__PURE__ */ y("div", { css: L.history, children: [
1473
+ /* @__PURE__ */ y(
1500
1474
  "button",
1501
1475
  {
1502
1476
  type: "button",
1503
- "aria-expanded": p,
1504
- onClick: () => a((g) => !g),
1477
+ "aria-expanded": u,
1478
+ onClick: () => a((m) => !m),
1505
1479
  css: L.toggle,
1506
1480
  children: [
1507
1481
  i("discussion.ban.previousBans", "Previous bans ({{count}})", {
1508
- count: b.length
1482
+ count: v.length
1509
1483
  }),
1510
1484
  /* @__PURE__ */ n(
1511
- Ut,
1485
+ _t,
1512
1486
  {
1513
1487
  size: "1.25em",
1514
1488
  color: e.icon,
1515
- css: p ? L.chevron.open : L.chevron.closed
1489
+ css: u ? L.chevron.open : L.chevron.closed
1516
1490
  }
1517
1491
  )
1518
1492
  ]
1519
1493
  }
1520
1494
  ),
1521
- p && /* @__PURE__ */ n("ul", { css: L.list, children: b.map((g) => {
1522
- const k = g.unbannedAt ?? (g.bannedPeriodInDays > 0 ? new Date(
1523
- new Date(g.bannedAt).getTime() + g.bannedPeriodInDays * Oe
1495
+ u && /* @__PURE__ */ n("ul", { css: L.list, children: v.map((m) => {
1496
+ const E = m.unbannedAt ?? (m.bannedPeriodInDays > 0 ? new Date(
1497
+ new Date(m.bannedAt).getTime() + m.bannedPeriodInDays * He
1524
1498
  ) : null);
1525
- return /* @__PURE__ */ S("li", { css: L.entry, children: [
1526
- /* @__PURE__ */ S("p", { css: L.entryDates, children: [
1527
- d(g.bannedAt),
1528
- k && ` – ${d(k)}`,
1529
- g.bannedPeriodInDays === ct && ` · ${i("discussion.ban.permanent", "Permanent ban")}`,
1530
- g.bannedPeriodInDays > 0 && ` · ${i("discussion.ban.days", "{{count}} days", { count: g.bannedPeriodInDays })}`
1499
+ return /* @__PURE__ */ y("li", { css: L.entry, children: [
1500
+ /* @__PURE__ */ y("p", { css: L.entryDates, children: [
1501
+ d(m.bannedAt),
1502
+ E && ` – ${d(E)}`,
1503
+ m.bannedPeriodInDays === st && ` · ${i("discussion.ban.permanent", "Permanent ban")}`,
1504
+ m.bannedPeriodInDays > 0 && ` · ${i("discussion.ban.days", "{{count}} days", { count: m.bannedPeriodInDays })}`
1531
1505
  ] }),
1532
- g.bannedReason && /* @__PURE__ */ n("p", { css: L.entryReason, children: g.bannedReason }),
1533
- g.unbannedAt && /* @__PURE__ */ S("p", { css: L.entryLifted, children: [
1506
+ m.bannedReason && /* @__PURE__ */ n("p", { css: L.entryReason, children: m.bannedReason }),
1507
+ m.unbannedAt && /* @__PURE__ */ y("p", { css: L.entryLifted, children: [
1534
1508
  i("discussion.ban.lifted", "Lifted on {{date}}", {
1535
- date: d(g.unbannedAt)
1509
+ date: d(m.unbannedAt)
1536
1510
  }),
1537
- g.unbannedReason && /* @__PURE__ */ S(Re, { children: [
1511
+ m.unbannedReason && /* @__PURE__ */ y(Re, { children: [
1538
1512
  ": ",
1539
- /* @__PURE__ */ n("span", { css: L.isolate, children: g.unbannedReason })
1513
+ /* @__PURE__ */ n("span", { css: L.isolate, children: m.unbannedReason })
1540
1514
  ] })
1541
1515
  ] })
1542
- ] }, g.bannedAt);
1516
+ ] }, m.bannedAt);
1543
1517
  }) })
1544
1518
  ] })
1545
1519
  ] })
1546
1520
  ] }) });
1547
- }, fo = (t) => {
1521
+ }, mo = (t) => {
1548
1522
  var r, i, s;
1549
1523
  return (((r = t == null ? void 0 : t.error) == null ? void 0 : r.code) ?? ((s = (i = t == null ? void 0 : t.data) == null ? void 0 : i.error) == null ? void 0 : s.code) ?? (t == null ? void 0 : t.status)) === 429;
1550
- }, dt = { display: "flex", alignItems: "center", marginInlineStart: "0.5em", marginInlineEnd: "-2px" }, Ce = {
1524
+ }, ct = { display: "flex", alignItems: "center", marginInlineStart: "0.5em", marginInlineEnd: "-2px" }, we = {
1551
1525
  root: o({
1552
1526
  boxSizing: "border-box",
1553
1527
  position: "relative",
@@ -1596,8 +1570,8 @@ const _t = (t, r) => {
1596
1570
  cursor: "pointer"
1597
1571
  }),
1598
1572
  // Joy's icon grey on the svg only; open, it takes the field's colour.
1599
- indicatorClosed: o({ ...dt, "& svg": { color: e.icon } }),
1600
- indicatorOpen: o(dt),
1573
+ indicatorClosed: o({ ...ct, "& svg": { color: e.icon } }),
1574
+ indicatorOpen: o(ct),
1601
1575
  list: o({
1602
1576
  position: "fixed",
1603
1577
  zIndex: 1300,
@@ -1637,26 +1611,26 @@ const _t = (t, r) => {
1637
1611
  cursor: "pointer",
1638
1612
  "&:hover, &[aria-selected='true']": { backgroundColor: e.surfaceVariant }
1639
1613
  })
1640
- }, mo = ({ value: t, options: r, onChange: i }) => {
1614
+ }, go = ({ value: t, options: r, onChange: i }) => {
1641
1615
  var l;
1642
1616
  const s = wt(
1643
1617
  r.map((c) => c.value),
1644
1618
  t,
1645
1619
  (c) => i(c)
1646
- ), p = W(null), a = W(null), m = yt(s.open, s.rootRef, a, "start"), d = (c) => {
1647
- var u, y, b;
1648
- const h = c.target;
1649
- (u = p.current) != null && u.contains(h) || (y = a.current) != null && y.contains(h) || ((b = p.current) == null || b.focus(), s.triggerProps.onClick());
1620
+ ), u = V(null), a = V(null), f = ht(s.open, s.rootRef, a, "start"), d = (c) => {
1621
+ var g, C, v;
1622
+ const b = c.target;
1623
+ (g = u.current) != null && g.contains(b) || (C = a.current) != null && C.contains(b) || ((v = u.current) == null || v.focus(), s.triggerProps.onClick());
1650
1624
  };
1651
- return /* @__PURE__ */ S("div", { ref: s.rootRef, css: Ce.root, onClick: d, children: [
1652
- /* @__PURE__ */ n("button", { ref: p, ...s.triggerProps, css: Ce.button, children: (l = r.find((c) => c.value === t)) == null ? void 0 : l.label }),
1653
- /* @__PURE__ */ n("span", { css: s.open ? Ce.indicatorOpen : Ce.indicatorClosed, children: /* @__PURE__ */ n(jt, {}) }),
1654
- s.open && /* @__PURE__ */ n("ul", { ref: a, ...s.listboxProps, css: Ce.list, style: m, children: r.map((c, h) => /* @__PURE__ */ n("li", { ...s.optionProps(h), css: Ce.option, children: c.label }, c.value)) })
1625
+ return /* @__PURE__ */ y("div", { ref: s.rootRef, css: we.root, onClick: d, children: [
1626
+ /* @__PURE__ */ n("button", { ref: u, ...s.triggerProps, css: we.button, children: (l = r.find((c) => c.value === t)) == null ? void 0 : l.label }),
1627
+ /* @__PURE__ */ n("span", { css: s.open ? we.indicatorOpen : we.indicatorClosed, children: /* @__PURE__ */ n(jt, {}) }),
1628
+ s.open && /* @__PURE__ */ n("ul", { ref: a, ...s.listboxProps, css: we.list, style: f, children: r.map((c, b) => /* @__PURE__ */ n("li", { ...s.optionProps(b), css: we.option, children: c.label }, c.value)) })
1655
1629
  ] });
1656
1630
  }, te = {
1657
1631
  root: o({ marginInline: "auto", maxHeight: "100%", overflowY: "auto", backgroundColor: e.surface }),
1658
1632
  header: o({ marginBottom: e.spaceLg }),
1659
- title: o(z.h3, { marginBottom: e.spaceXs }),
1633
+ title: o(z.h3, { marginBottom: e.spaceXs, unicodeBidi: "plaintext" }),
1660
1634
  count: o(z.bodySm, { color: e.textSecondary }),
1661
1635
  divider: o({
1662
1636
  position: "relative",
@@ -1680,267 +1654,267 @@ const _t = (t, r) => {
1680
1654
  sentinel: o({ height: "1px" }),
1681
1655
  moreSpinner: o({ paddingBlock: e.spaceMd }),
1682
1656
  loadMore: o({ display: "flex", justifyContent: "center", marginTop: e.spaceLg })
1683
- }, go = ({
1657
+ }, ho = ({
1684
1658
  discussion: t,
1685
1659
  posts: r,
1686
1660
  postsHidden: i = !1,
1687
1661
  sdk: s,
1688
- userIsLoggedIn: p,
1662
+ userIsLoggedIn: u,
1689
1663
  onSignInClick: a,
1690
- showReactions: m,
1664
+ showReactions: f,
1691
1665
  showReplies: d,
1692
1666
  showReportPost: l,
1693
1667
  currentSort: c,
1694
- onSortChange: h,
1695
- onCreatePost: u,
1696
- onReact: y,
1697
- onDeletePost: b,
1698
- onReportPost: g,
1699
- onLoadMore: k,
1668
+ onSortChange: b,
1669
+ onCreatePost: g,
1670
+ onReact: C,
1671
+ onDeletePost: v,
1672
+ onReportPost: m,
1673
+ onLoadMore: E,
1700
1674
  hasMore: I,
1701
- liveRefresh: v = !1,
1702
- newPostIds: f,
1703
- onNewPostSeen: B,
1704
- isLoading: A,
1705
- isSubmitting: E,
1675
+ liveRefresh: x = !1,
1676
+ newPostIds: p,
1677
+ onNewPostSeen: R,
1678
+ isLoading: M,
1679
+ isSubmitting: D,
1706
1680
  infiniteScroll: $ = !1,
1707
1681
  showModeratedPosts: J = !1,
1708
- ban: U,
1709
- isBanned: V = !1,
1682
+ ban: K,
1683
+ isBanned: _ = !1,
1710
1684
  showBanHistory: q = !1
1711
1685
  }) => {
1712
- const { t: T } = ye(), _ = _e(), oe = W(null), ne = W(null);
1686
+ const { t: P } = be(), j = Ve(), oe = V(null), ne = V(null);
1713
1687
  he(() => {
1714
1688
  if (!$ || !ne.current) return;
1715
- const P = new IntersectionObserver(
1716
- (j) => {
1717
- j[0].isIntersecting && I && !A && k();
1689
+ const T = new IntersectionObserver(
1690
+ (U) => {
1691
+ U[0].isIntersecting && I && !M && E();
1718
1692
  },
1719
1693
  { root: oe.current, threshold: 0.1 }
1720
1694
  );
1721
- return P.observe(ne.current), () => P.disconnect();
1722
- }, [$, I, A, k]);
1723
- const [pe, Z] = D({ open: !1, variant: "success", title: "", message: "" }), de = () => {
1724
- Z({
1695
+ return T.observe(ne.current), () => T.disconnect();
1696
+ }, [$, I, M, E]);
1697
+ const [pe, Q] = B({ open: !1, variant: "success", title: "", message: "" }), de = () => {
1698
+ Q({
1725
1699
  open: !0,
1726
1700
  variant: "success",
1727
1701
  title: "",
1728
- message: T("discussion.delete.success", "Comment deleted successfully.")
1702
+ message: P("discussion.delete.success", "Comment deleted successfully.")
1729
1703
  });
1730
- }, re = (P, j) => {
1731
- mt(P) || Z({
1704
+ }, re = (T, U) => {
1705
+ pt(T) || Q({
1732
1706
  open: !0,
1733
1707
  variant: "error",
1734
1708
  title: "",
1735
- message: fo(P) ? T(
1709
+ message: mo(T) ? P(
1736
1710
  "discussion.rateLimited",
1737
1711
  "You're doing that too often. Please wait a moment and try again."
1738
- ) : j
1712
+ ) : U
1739
1713
  });
1740
- }, ie = async (P, j) => {
1714
+ }, ie = async (T, U) => {
1741
1715
  try {
1742
- return await y(P, j);
1743
- } catch (H) {
1716
+ return await C(T, U);
1717
+ } catch (X) {
1744
1718
  throw re(
1745
- H,
1746
- T("discussion.reactError", "Failed to add reaction. Please try again.")
1747
- ), H;
1719
+ X,
1720
+ P("discussion.reactError", "Failed to add reaction. Please try again.")
1721
+ ), X;
1748
1722
  }
1749
- }, Q = async (P, j) => {
1723
+ }, Z = async (T, U) => {
1750
1724
  try {
1751
- await u(P, j);
1752
- } catch (H) {
1725
+ await g(T, U);
1726
+ } catch (X) {
1753
1727
  throw re(
1754
- H,
1755
- T("discussion.postError", "Failed to post comment. Please try again.")
1756
- ), H;
1728
+ X,
1729
+ P("discussion.postError", "Failed to post comment. Please try again.")
1730
+ ), X;
1757
1731
  }
1758
- Z({
1732
+ Q({
1759
1733
  open: !0,
1760
1734
  variant: "success",
1761
1735
  title: "",
1762
- message: T("discussion.postSuccess", "Comment posted successfully.")
1736
+ message: P("discussion.postSuccess", "Comment posted successfully.")
1763
1737
  });
1764
1738
  }, se = [
1765
- { value: "LATEST", label: T("discussion.sort.latest", "Latest") },
1766
- { value: "OLDEST", label: T("discussion.sort.oldest", "Oldest") },
1767
- { value: "POPULAR", label: T("discussion.sort.popular", "Popular") },
1739
+ { value: "LATEST", label: P("discussion.sort.latest", "Latest") },
1740
+ { value: "OLDEST", label: P("discussion.sort.oldest", "Oldest") },
1741
+ { value: "POPULAR", label: P("discussion.sort.popular", "Popular") },
1768
1742
  {
1769
1743
  value: "INTERACTED",
1770
- label: T("discussion.sort.interacted", "Most Interacted")
1744
+ label: P("discussion.sort.interacted", "Most Interacted")
1771
1745
  }
1772
1746
  ];
1773
- return /* @__PURE__ */ S("div", { ref: oe, css: te.root, style: _, children: [
1774
- /* @__PURE__ */ S("div", { css: te.header, children: [
1775
- /* @__PURE__ */ n("h3", { css: te.title, children: t.label || T("discussion.title", "Discussion") }),
1776
- !i && /* @__PURE__ */ n("p", { css: te.count, children: T("discussion.postsCount", "{{count}} posts", {
1747
+ return /* @__PURE__ */ y("div", { ref: oe, css: te.root, style: j, children: [
1748
+ /* @__PURE__ */ y("div", { css: te.header, children: [
1749
+ /* @__PURE__ */ n("h3", { css: te.title, children: t.label || P("discussion.title", "Discussion") }),
1750
+ !i && /* @__PURE__ */ n("p", { css: te.count, children: P("discussion.postsCount", "{{count}} posts", {
1777
1751
  count: t.postsCount || 0
1778
1752
  }) })
1779
1753
  ] }),
1780
- V && U && /* @__PURE__ */ n(po, { ban: U, showBanHistory: q }),
1754
+ _ && K && /* @__PURE__ */ n(fo, { ban: K, showBanHistory: q }),
1781
1755
  /* @__PURE__ */ n(
1782
- ht,
1756
+ mt,
1783
1757
  {
1784
- onSubmit: (P) => Q(P),
1785
- userIsLoggedIn: p,
1758
+ onSubmit: (T) => Z(T),
1759
+ userIsLoggedIn: u,
1786
1760
  onSignInClick: a,
1787
- isSubmitting: E,
1788
- disabled: V
1761
+ isSubmitting: D,
1762
+ disabled: _
1789
1763
  }
1790
1764
  ),
1791
- !i && /* @__PURE__ */ S(Re, { children: [
1765
+ !i && /* @__PURE__ */ y(Re, { children: [
1792
1766
  /* @__PURE__ */ n("hr", { css: te.divider }),
1793
- /* @__PURE__ */ S("div", { css: te.sortRow, children: [
1794
- /* @__PURE__ */ n("p", { css: z.titleMd, children: T("discussion.comments", "Comments") }),
1795
- /* @__PURE__ */ n(mo, { value: c, options: se, onChange: h })
1767
+ /* @__PURE__ */ y("div", { css: te.sortRow, children: [
1768
+ /* @__PURE__ */ n("p", { css: z.titleMd, children: P("discussion.comments", "Comments") }),
1769
+ /* @__PURE__ */ n(go, { value: c, options: se, onChange: b })
1796
1770
  ] }),
1797
- A && r.length === 0 ? /* @__PURE__ */ n("div", { css: te.listSpinner, children: /* @__PURE__ */ n(We, { marginBlock: "32px" }) }) : r.length === 0 ? /* @__PURE__ */ n("div", { css: te.empty, children: /* @__PURE__ */ n("p", { css: te.emptyText, children: T(
1771
+ M && r.length === 0 ? /* @__PURE__ */ n("div", { css: te.listSpinner, children: /* @__PURE__ */ n(Oe, { marginBlock: "32px" }) }) : r.length === 0 ? /* @__PURE__ */ n("div", { css: te.empty, children: /* @__PURE__ */ n("p", { css: te.emptyText, children: P(
1798
1772
  "discussion.noPosts",
1799
1773
  "No comments yet. Be the first to comment!"
1800
- ) }) }) : /* @__PURE__ */ S(Re, { children: [
1801
- /* @__PURE__ */ n("div", { children: r.map((P) => /* @__PURE__ */ n(
1802
- xt,
1774
+ ) }) }) : /* @__PURE__ */ y(Re, { children: [
1775
+ /* @__PURE__ */ n("div", { children: r.map((T) => /* @__PURE__ */ n(
1776
+ yt,
1803
1777
  {
1804
- post: P,
1778
+ post: T,
1805
1779
  sdk: s,
1806
- userIsLoggedIn: p,
1780
+ userIsLoggedIn: u,
1807
1781
  onSignInClick: a,
1808
- showReactions: m,
1782
+ showReactions: f,
1809
1783
  showReplies: d,
1810
1784
  showReportPost: l,
1811
- onReply: (j, H) => Q(H, j),
1785
+ onReply: (U, X) => Z(X, U),
1812
1786
  onReact: ie,
1813
- onDelete: b,
1814
- onReport: g,
1815
- isSubmitting: E,
1787
+ onDelete: v,
1788
+ onReport: m,
1789
+ isSubmitting: D,
1816
1790
  showModeratedPosts: J,
1817
- isBanned: V,
1818
- highlightable: v,
1819
- isNew: f == null ? void 0 : f.has(P.id),
1820
- onNewSeen: B,
1791
+ isBanned: _,
1792
+ highlightable: x,
1793
+ isNew: p == null ? void 0 : p.has(T.id),
1794
+ onNewSeen: R,
1821
1795
  onDeleteSuccess: de
1822
1796
  },
1823
- P.id
1797
+ T.id
1824
1798
  )) }),
1825
1799
  $ && /* @__PURE__ */ n("div", { ref: ne, css: te.sentinel })
1826
1800
  ] }),
1827
- $ && A && r.length > 0 && /* @__PURE__ */ n("div", { css: te.moreSpinner, children: /* @__PURE__ */ n(We, { marginBlock: "16px" }) }),
1828
- !$ && I && /* @__PURE__ */ n("div", { css: te.loadMore, children: /* @__PURE__ */ n(ue, { look: "outlined", onClick: k, loading: A, children: T("discussion.loadMore", "Load More") }) })
1801
+ $ && M && r.length > 0 && /* @__PURE__ */ n("div", { css: te.moreSpinner, children: /* @__PURE__ */ n(Oe, { marginBlock: "16px" }) }),
1802
+ !$ && I && /* @__PURE__ */ n("div", { css: te.loadMore, children: /* @__PURE__ */ n(ue, { look: "outlined", onClick: E, loading: M, children: P("discussion.loadMore", "Load More") }) })
1829
1803
  ] }),
1830
1804
  /* @__PURE__ */ n(
1831
- pt,
1805
+ dt,
1832
1806
  {
1833
1807
  notification: pe,
1834
- onClose: () => Z((P) => ({ ...P, open: !1 }))
1808
+ onClose: () => Q((T) => ({ ...T, open: !1 }))
1835
1809
  }
1836
1810
  )
1837
1811
  ] });
1838
- }, ho = (t) => {
1812
+ }, yo = (t) => {
1839
1813
  const {
1840
1814
  entityId: r,
1841
1815
  sdk: i,
1842
1816
  discussionLabel: s,
1843
- discussionUrl: p = "",
1817
+ discussionUrl: u = "",
1844
1818
  defaultSort: a = "LATEST",
1845
- postsPerPage: m = 20,
1819
+ postsPerPage: f = 20,
1846
1820
  showReactions: d = !0,
1847
1821
  showReplies: l = !0,
1848
1822
  showReportPost: c = !0,
1849
- infiniteScroll: h = !1,
1850
- showModeratedPosts: u = !1,
1851
- userIsLoggedIn: y = !1,
1852
- showBanHistory: b = !1,
1853
- refreshInterval: g = 0,
1854
- onSignInClick: k
1855
- } = t, { ban: I, isBanned: v, refresh: f } = Zt(i, y), {
1856
- discussion: B,
1857
- setDiscussion: A,
1858
- isLoading: E,
1823
+ infiniteScroll: b = !1,
1824
+ showModeratedPosts: g = !1,
1825
+ userIsLoggedIn: C = !1,
1826
+ showBanHistory: v = !1,
1827
+ refreshInterval: m = 0,
1828
+ onSignInClick: E
1829
+ } = t, { ban: I, isBanned: x, refresh: p } = eo(i, C), {
1830
+ discussion: R,
1831
+ setDiscussion: M,
1832
+ isLoading: D,
1859
1833
  error: $,
1860
1834
  isNotFound: J
1861
- } = _t(i, r), U = () => ({
1835
+ } = Gt(i, r), K = () => ({
1862
1836
  id: r,
1863
1837
  label: "",
1864
1838
  postsCount: 0,
1865
1839
  createdAt: (/* @__PURE__ */ new Date()).toISOString(),
1866
1840
  updatedAt: (/* @__PURE__ */ new Date()).toISOString()
1867
- }), V = (fe) => {
1868
- A((R) => {
1869
- const w = R ?? U();
1870
- return { ...w, postsCount: Math.max(0, w.postsCount + fe) };
1841
+ }), _ = (fe) => {
1842
+ M((k) => {
1843
+ const S = k ?? K();
1844
+ return { ...S, postsCount: Math.max(0, S.postsCount + fe) };
1871
1845
  });
1872
1846
  }, {
1873
1847
  posts: q,
1874
- postsHidden: T,
1875
- isLoading: _,
1848
+ postsHidden: P,
1849
+ isLoading: j,
1876
1850
  isSubmitting: oe,
1877
1851
  currentSort: ne,
1878
1852
  hasMore: pe,
1879
- newPostIds: Z,
1853
+ newPostIds: Q,
1880
1854
  markPostSeen: de,
1881
1855
  handleSortChange: re,
1882
1856
  handleLoadMore: ie,
1883
- handleCreatePost: Q,
1857
+ handleCreatePost: Z,
1884
1858
  handleReact: se,
1885
- handleDeletePost: P,
1886
- handleReportPost: j
1887
- } = Jt(
1859
+ handleDeletePost: T,
1860
+ handleReportPost: U
1861
+ } = Qt(
1888
1862
  i,
1889
1863
  r,
1890
1864
  s || null,
1891
- p,
1892
- a,
1893
- m,
1894
- V,
1895
1865
  u,
1896
- g
1897
- ), H = (fe) => async (...R) => {
1866
+ a,
1867
+ f,
1868
+ _,
1869
+ g,
1870
+ m
1871
+ ), X = (fe) => async (...k) => {
1898
1872
  try {
1899
- return await fe(...R);
1900
- } catch (w) {
1901
- throw mt(w) && f(), w;
1873
+ return await fe(...k);
1874
+ } catch (S) {
1875
+ throw pt(S) && p(), S;
1902
1876
  }
1903
1877
  };
1904
- if (E || !B && !J && _)
1905
- return /* @__PURE__ */ n(We, { marginBlock: "160px" });
1878
+ if (D || !R && !J && j)
1879
+ return /* @__PURE__ */ n(Oe, { marginBlock: "160px" });
1906
1880
  if ($)
1907
1881
  return /* @__PURE__ */ n("div", { style: { padding: "20px", textAlign: "center" }, children: /* @__PURE__ */ n("p", { children: "Failed to load discussion. Please try again later." }) });
1908
- const Ee = async (fe, R) => {
1909
- await Q(fe, R), s && A((w) => ({ ...w ?? U(), label: s }));
1882
+ const Ee = async (fe, k) => {
1883
+ await Z(fe, k), s && M((S) => ({ ...S ?? K(), label: s }));
1910
1884
  };
1911
1885
  return /* @__PURE__ */ n(
1912
- go,
1886
+ ho,
1913
1887
  {
1914
- discussion: B ?? U(),
1888
+ discussion: R ?? K(),
1915
1889
  posts: q,
1916
- postsHidden: T,
1890
+ postsHidden: P,
1917
1891
  sdk: i,
1918
- userIsLoggedIn: y,
1919
- onSignInClick: k,
1892
+ userIsLoggedIn: C,
1893
+ onSignInClick: E,
1920
1894
  showReactions: d,
1921
1895
  showReplies: l,
1922
1896
  showReportPost: c,
1923
1897
  currentSort: ne,
1924
1898
  onSortChange: re,
1925
- onCreatePost: H(Ee),
1926
- onReact: H(se),
1927
- onDeletePost: H(P),
1928
- onReportPost: H(j),
1899
+ onCreatePost: X(Ee),
1900
+ onReact: X(se),
1901
+ onDeletePost: X(T),
1902
+ onReportPost: X(U),
1929
1903
  onLoadMore: ie,
1930
1904
  hasMore: pe,
1931
- liveRefresh: g > 0,
1932
- newPostIds: Z,
1905
+ liveRefresh: m > 0,
1906
+ newPostIds: Q,
1933
1907
  onNewPostSeen: de,
1934
- isLoading: _,
1908
+ isLoading: j,
1935
1909
  isSubmitting: oe,
1936
- infiniteScroll: h,
1937
- showModeratedPosts: u,
1910
+ infiniteScroll: b,
1911
+ showModeratedPosts: g,
1938
1912
  ban: I,
1939
- isBanned: v,
1940
- showBanHistory: b
1913
+ isBanned: x,
1914
+ showBanHistory: v
1941
1915
  }
1942
1916
  );
1943
- }, Ro = (t) => /* @__PURE__ */ n(
1917
+ }, Io = (t) => /* @__PURE__ */ n(
1944
1918
  Ct,
1945
1919
  {
1946
1920
  packageName: "discussion",
@@ -1948,9 +1922,9 @@ const _t = (t, r) => {
1948
1922
  themeOptions: t.themeOptions,
1949
1923
  disableCache: t.disableCache,
1950
1924
  fillHeight: !0,
1951
- children: /* @__PURE__ */ n(ho, { ...t })
1925
+ children: /* @__PURE__ */ n(yo, { ...t })
1952
1926
  }
1953
1927
  );
1954
1928
  export {
1955
- Ro as M
1929
+ Io as M
1956
1930
  };