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