@apolitical/component-library 6.4.0-SW.0 → 6.4.0-SW.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +49 -49
- package/index.mjs +380 -374
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import te, { memo as nn, useState as ue, useEffect as ce, useRef as Be, useMemo as Jt, forwardRef as ro, Children as _s, createContext as Ft, useContext as $e, useCallback as Me, lazy as mr, useReducer as pr, Suspense as Uc, Fragment as Ur, useLayoutEffect as Ah, Component as Bh } from "react";
|
|
2
|
-
import { useIntl as le, FormattedMessage as
|
|
2
|
+
import { useIntl as le, FormattedMessage as dt, IntlProvider as Th, createIntl as Sh } from "react-intl";
|
|
3
3
|
import Wt from "lodash.clonedeep";
|
|
4
4
|
import jh from "lodash.set";
|
|
5
5
|
import Wc from "react-dom";
|
|
6
6
|
import Xt from "markdown-to-jsx";
|
|
7
7
|
import or from "truncate";
|
|
8
|
-
import { QueryClient as Oh, QueryClientProvider as Ph, useMutation as
|
|
8
|
+
import { QueryClient as Oh, QueryClientProvider as Ph, useMutation as at, useQueryClient as io, useInfiniteQuery as ao, useQuery as Nh } from "@tanstack/react-query";
|
|
9
9
|
import { ReactQueryDevtools as Mh } from "@tanstack/react-query-devtools";
|
|
10
10
|
import Ti from "posthog-js";
|
|
11
11
|
import { CookiesProvider as Rh, useCookies as Vc } from "react-cookie";
|
|
@@ -350,19 +350,19 @@ function Wh() {
|
|
|
350
350
|
} catch (rn) {
|
|
351
351
|
if (rn && Ee && typeof rn.stack == "string") {
|
|
352
352
|
for (var Oe = rn.stack.split(`
|
|
353
|
-
`),
|
|
354
|
-
`), et = Oe.length - 1,
|
|
355
|
-
|
|
356
|
-
for (; et >= 1 &&
|
|
357
|
-
if (Oe[et] !==
|
|
358
|
-
if (et !== 1 ||
|
|
353
|
+
`), pt = Ee.stack.split(`
|
|
354
|
+
`), et = Oe.length - 1, it = pt.length - 1; et >= 1 && it >= 0 && Oe[et] !== pt[it]; )
|
|
355
|
+
it--;
|
|
356
|
+
for (; et >= 1 && it >= 0; et--, it--)
|
|
357
|
+
if (Oe[et] !== pt[it]) {
|
|
358
|
+
if (et !== 1 || it !== 1)
|
|
359
359
|
do
|
|
360
|
-
if (et--,
|
|
360
|
+
if (et--, it--, it < 0 || Oe[et] !== pt[it]) {
|
|
361
361
|
var Nt = `
|
|
362
362
|
` + Oe[et].replace(" at new ", " at ");
|
|
363
363
|
return N.displayName && Nt.includes("<anonymous>") && (Nt = Nt.replace("<anonymous>", N.displayName)), typeof N == "function" && J.set(N, Nt), Nt;
|
|
364
364
|
}
|
|
365
|
-
while (et >= 1 &&
|
|
365
|
+
while (et >= 1 && it >= 0);
|
|
366
366
|
break;
|
|
367
367
|
}
|
|
368
368
|
}
|
|
@@ -424,8 +424,8 @@ function Wh() {
|
|
|
424
424
|
var Oe = void 0;
|
|
425
425
|
try {
|
|
426
426
|
if (typeof N[Ne] != "function") {
|
|
427
|
-
var
|
|
428
|
-
throw
|
|
427
|
+
var pt = Error((Ee || "React class") + ": " + fe + " type `" + Ne + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof N[Ne] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
428
|
+
throw pt.name = "Invariant Violation", pt;
|
|
429
429
|
}
|
|
430
430
|
Oe = N[Ne](se, Ne, Ee, fe, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
431
431
|
} catch (et) {
|
|
@@ -435,9 +435,9 @@ function Wh() {
|
|
|
435
435
|
}
|
|
436
436
|
}
|
|
437
437
|
}
|
|
438
|
-
var
|
|
438
|
+
var nt = Array.isArray;
|
|
439
439
|
function Pe(N) {
|
|
440
|
-
return
|
|
440
|
+
return nt(N);
|
|
441
441
|
}
|
|
442
442
|
function Ke(N) {
|
|
443
443
|
{
|
|
@@ -474,7 +474,7 @@ function Wh() {
|
|
|
474
474
|
}
|
|
475
475
|
return N.ref !== void 0;
|
|
476
476
|
}
|
|
477
|
-
function
|
|
477
|
+
function st(N) {
|
|
478
478
|
if (we.call(N, "key")) {
|
|
479
479
|
var se = Object.getOwnPropertyDescriptor(N, "key").get;
|
|
480
480
|
if (se && se.isReactWarning)
|
|
@@ -482,13 +482,13 @@ function Wh() {
|
|
|
482
482
|
}
|
|
483
483
|
return N.key !== void 0;
|
|
484
484
|
}
|
|
485
|
-
function
|
|
485
|
+
function wt(N, se) {
|
|
486
486
|
if (typeof N.ref == "string" && ge.current && se && ge.current.stateNode !== se) {
|
|
487
487
|
var fe = k(ge.current.type);
|
|
488
488
|
Fe[fe] || (w('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', k(ge.current.type), N.ref), Fe[fe] = !0);
|
|
489
489
|
}
|
|
490
490
|
}
|
|
491
|
-
function
|
|
491
|
+
function rt(N, se) {
|
|
492
492
|
{
|
|
493
493
|
var fe = function() {
|
|
494
494
|
Ae || (Ae = !0, w("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", se));
|
|
@@ -541,8 +541,8 @@ function Wh() {
|
|
|
541
541
|
};
|
|
542
542
|
function Da(N, se, fe, Ee, Le) {
|
|
543
543
|
{
|
|
544
|
-
var Ze, Ne = {}, Oe = null,
|
|
545
|
-
fe !== void 0 && (re(fe), Oe = "" + fe),
|
|
544
|
+
var Ze, Ne = {}, Oe = null, pt = null;
|
|
545
|
+
fe !== void 0 && (re(fe), Oe = "" + fe), st(se) && (re(se.key), Oe = "" + se.key), Xe(se) && (pt = se.ref, wt(se, Le));
|
|
546
546
|
for (Ze in se)
|
|
547
547
|
we.call(se, Ze) && !ye.hasOwnProperty(Ze) && (Ne[Ze] = se[Ze]);
|
|
548
548
|
if (N && N.defaultProps) {
|
|
@@ -550,11 +550,11 @@ function Wh() {
|
|
|
550
550
|
for (Ze in et)
|
|
551
551
|
Ne[Ze] === void 0 && (Ne[Ze] = et[Ze]);
|
|
552
552
|
}
|
|
553
|
-
if (Oe ||
|
|
554
|
-
var
|
|
555
|
-
Oe &&
|
|
553
|
+
if (Oe || pt) {
|
|
554
|
+
var it = typeof N == "function" ? N.displayName || N.name || "Unknown" : N;
|
|
555
|
+
Oe && rt(Ne, it), pt && Bt(Ne, it);
|
|
556
556
|
}
|
|
557
|
-
return Tt(N, Oe,
|
|
557
|
+
return Tt(N, Oe, pt, Le, Ee, ge.current, Ne);
|
|
558
558
|
}
|
|
559
559
|
}
|
|
560
560
|
var wr = g.ReactCurrentOwner, ai = g.ReactDebugCurrentFrame;
|
|
@@ -681,14 +681,14 @@ Check the top-level render call using <` + fe + ">.");
|
|
|
681
681
|
if (!Ne) {
|
|
682
682
|
var Oe = "";
|
|
683
683
|
(N === void 0 || typeof N == "object" && N !== null && Object.keys(N).length === 0) && (Oe += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
684
|
-
var
|
|
685
|
-
|
|
684
|
+
var pt = xh(Le);
|
|
685
|
+
pt ? Oe += pt : Oe += Qo();
|
|
686
686
|
var et;
|
|
687
687
|
N === null ? et = "null" : Pe(N) ? et = "array" : N !== void 0 && N.$$typeof === t ? (et = "<" + (k(N.type) || "Unknown") + " />", Oe = " Did you accidentally export a JSX literal instead of a component?") : et = typeof N, w("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", et, Oe);
|
|
688
688
|
}
|
|
689
|
-
var
|
|
690
|
-
if (
|
|
691
|
-
return
|
|
689
|
+
var it = Da(N, se, fe, Le, Ze);
|
|
690
|
+
if (it == null)
|
|
691
|
+
return it;
|
|
692
692
|
if (Ne) {
|
|
693
693
|
var Nt = se.children;
|
|
694
694
|
if (Nt !== void 0)
|
|
@@ -702,7 +702,7 @@ Check the top-level render call using <` + fe + ">.");
|
|
|
702
702
|
else
|
|
703
703
|
eu(Nt, N);
|
|
704
704
|
}
|
|
705
|
-
return N === r ? Ch(
|
|
705
|
+
return N === r ? Ch(it) : Dh(it), it;
|
|
706
706
|
}
|
|
707
707
|
}
|
|
708
708
|
function Eh(N, se, fe) {
|
|
@@ -2012,7 +2012,7 @@ const Ek = ({
|
|
|
2012
2012
|
steps: t = 1
|
|
2013
2013
|
}) => /* @__PURE__ */ c.jsxs(c.Fragment, { children: [
|
|
2014
2014
|
/* @__PURE__ */ c.jsx(Ie, { children: /* @__PURE__ */ c.jsx(
|
|
2015
|
-
|
|
2015
|
+
dt,
|
|
2016
2016
|
{
|
|
2017
2017
|
id: "progressTracker",
|
|
2018
2018
|
values: { current: e, total: t }
|
|
@@ -2357,7 +2357,7 @@ const Fk = ({
|
|
|
2357
2357
|
] }, `dl-${u}`) : /* @__PURE__ */ c.jsx("li", { style: h, children: typeof l.text == "string" ? /* @__PURE__ */ c.jsx(Xt, { options: d, children: l.text }) : l.text }, u);
|
|
2358
2358
|
})
|
|
2359
2359
|
});
|
|
2360
|
-
},
|
|
2360
|
+
}, ht = () => te.Fragment, xm = ({ children: e }) => /* @__PURE__ */ c.jsx(It, { variant: "secondary", children: e }), wm = ({ children: e }) => typeof e == "object" && Object.keys(e || {}).length === 1 ? /* @__PURE__ */ c.jsx("p", { className: "center", children: e }) : /* @__PURE__ */ c.jsx("div", { className: "center", children: e }), Dm = ["span", "strong", "h1", "h2", "h3", "h4", "h5", "h6", "p"], Cm = ({ children: e }) => {
|
|
2361
2361
|
const t = le();
|
|
2362
2362
|
if (!e)
|
|
2363
2363
|
return null;
|
|
@@ -2479,28 +2479,28 @@ const Fm = {
|
|
|
2479
2479
|
CaseStudy: xm,
|
|
2480
2480
|
// Override embedded HTML
|
|
2481
2481
|
// Our content team previously used real HTML, which we need to tear out and replace with React components
|
|
2482
|
-
style:
|
|
2482
|
+
style: ht,
|
|
2483
2483
|
details: Cm,
|
|
2484
2484
|
div: Em,
|
|
2485
2485
|
iframe: _m,
|
|
2486
2486
|
center: wm
|
|
2487
2487
|
},
|
|
2488
2488
|
"text-only": {
|
|
2489
|
-
h1:
|
|
2490
|
-
h2:
|
|
2491
|
-
h3:
|
|
2492
|
-
h4:
|
|
2493
|
-
h5:
|
|
2494
|
-
h6:
|
|
2495
|
-
style:
|
|
2496
|
-
details:
|
|
2497
|
-
div:
|
|
2498
|
-
TextBox:
|
|
2499
|
-
CollapsibleSection:
|
|
2500
|
-
CaseStudy:
|
|
2501
|
-
blockquote:
|
|
2502
|
-
iframe:
|
|
2503
|
-
button:
|
|
2489
|
+
h1: ht,
|
|
2490
|
+
h2: ht,
|
|
2491
|
+
h3: ht,
|
|
2492
|
+
h4: ht,
|
|
2493
|
+
h5: ht,
|
|
2494
|
+
h6: ht,
|
|
2495
|
+
style: ht,
|
|
2496
|
+
details: ht,
|
|
2497
|
+
div: ht,
|
|
2498
|
+
TextBox: ht,
|
|
2499
|
+
CollapsibleSection: ht,
|
|
2500
|
+
CaseStudy: ht,
|
|
2501
|
+
blockquote: ht,
|
|
2502
|
+
iframe: ht,
|
|
2503
|
+
button: ht
|
|
2504
2504
|
}
|
|
2505
2505
|
}, ur = ({
|
|
2506
2506
|
element: e = "div",
|
|
@@ -2655,11 +2655,11 @@ const Mm = ({ children: e, locale: t, messages: n }) => {
|
|
|
2655
2655
|
es: "Español",
|
|
2656
2656
|
fr: "Français",
|
|
2657
2657
|
pt: "Português"
|
|
2658
|
-
},
|
|
2658
|
+
}, ft = Ft({ isLoading: !0 });
|
|
2659
2659
|
function co() {
|
|
2660
|
-
return $e(
|
|
2660
|
+
return $e(ft);
|
|
2661
2661
|
}
|
|
2662
|
-
const Rm = ({ children: e, user: t, updateDetails: n }) => /* @__PURE__ */ c.jsx(
|
|
2662
|
+
const Rm = ({ children: e, user: t, updateDetails: n }) => /* @__PURE__ */ c.jsx(ft.Provider, { value: { ...t, updateDetails: n }, children: e }), od = Ft({
|
|
2663
2663
|
registerOverlay: () => {
|
|
2664
2664
|
},
|
|
2665
2665
|
unregisterOverlay: () => {
|
|
@@ -2716,7 +2716,7 @@ const zm = ({ slug: e }) => {
|
|
|
2716
2716
|
}
|
|
2717
2717
|
);
|
|
2718
2718
|
};
|
|
2719
|
-
var
|
|
2719
|
+
var yt = /* @__PURE__ */ ((e) => (e.Communities = "communities", e.Platform = "platform", e))(yt || {});
|
|
2720
2720
|
const qm = ({ element: e = "ul", userBadges: t, badgeOptions: n }) => {
|
|
2721
2721
|
if (Object.keys(t).length !== 0)
|
|
2722
2722
|
return te.createElement(e, {
|
|
@@ -2901,7 +2901,7 @@ const pu = 256, _n = ({
|
|
|
2901
2901
|
}
|
|
2902
2902
|
);
|
|
2903
2903
|
};
|
|
2904
|
-
var
|
|
2904
|
+
var ut = /* @__PURE__ */ ((e) => (e.DISCUSSION_FORM_SUBMITTED = "discussionFormSubmitted", e.DISCUSSION_POST_ADDED = "discussionPostAdded", e.DISCUSSION_POST_CLICKED = "discussionPostClicked", e.MEMBER_CLICKED = "memberClicked", e))(ut || {});
|
|
2905
2905
|
const ho = (e) => e === "apolitical" ? {
|
|
2906
2906
|
image: `${cn}logos/member_apolitical.svg`
|
|
2907
2907
|
} : e === "community" || e === "deleted" || typeof e == "object" && !e.name ? {
|
|
@@ -2951,7 +2951,7 @@ const Cn = ({
|
|
|
2951
2951
|
variant: f = "inline",
|
|
2952
2952
|
isCondensed: b = !0,
|
|
2953
2953
|
additionalContentNewLine: g = !1
|
|
2954
|
-
} = i, w = $e(
|
|
2954
|
+
} = i, w = $e(ft), C = p && w && typeof w.id == "string", [A, D] = ue(!1), _ = ho(t);
|
|
2955
2955
|
_.name || (_.name = h.formatMessage({
|
|
2956
2956
|
id: `member_${typeof t == "string" ? t : "community"}`
|
|
2957
2957
|
}));
|
|
@@ -2978,7 +2978,7 @@ const Cn = ({
|
|
|
2978
2978
|
li && clearTimeout(li), li = setTimeout(() => {
|
|
2979
2979
|
window.location.href = O;
|
|
2980
2980
|
}, 150);
|
|
2981
|
-
const ae = new CustomEvent(
|
|
2981
|
+
const ae = new CustomEvent(ut.MEMBER_CLICKED, {
|
|
2982
2982
|
detail: { link: O, timeout: li }
|
|
2983
2983
|
});
|
|
2984
2984
|
document.dispatchEvent(ae);
|
|
@@ -4903,7 +4903,7 @@ const kr = "joinCommunityButton", Ed = ({
|
|
|
4903
4903
|
}, leave: () => {
|
|
4904
4904
|
} }
|
|
4905
4905
|
}) => {
|
|
4906
|
-
const s = le(), o = $e(
|
|
4906
|
+
const s = le(), o = $e(ft), l = o && typeof o.id == "string", u = r || !l, [d, h] = ue(e), [p, m] = ue(e ? "joined" : "notJoined");
|
|
4907
4907
|
ce(() => {
|
|
4908
4908
|
p === "joining" ? m("joined") : p === "leaving" && m("notJoined");
|
|
4909
4909
|
}, [d]);
|
|
@@ -4954,7 +4954,7 @@ const Na = "communityDetails_", Bk = ({
|
|
|
4954
4954
|
members: { number: i = 0, data: a = [] } = { number: 0, data: [] },
|
|
4955
4955
|
functions: { invite: s, ...o }
|
|
4956
4956
|
}) => {
|
|
4957
|
-
const l = le(), { id: u } = $e(
|
|
4957
|
+
const l = le(), { id: u } = $e(ft), d = u, h = 5, p = i || a.length, m = a.length ? a : Array(h).fill({}), v = `/communities/${r}/members` === window.location.pathname, f = t || n, b = !n && !t;
|
|
4958
4958
|
return /* @__PURE__ */ c.jsxs("div", { className: H("community-details", e), children: [
|
|
4959
4959
|
f ? /* @__PURE__ */ c.jsxs("div", { className: "member-details", children: [
|
|
4960
4960
|
/* @__PURE__ */ c.jsxs("div", { className: "top", children: [
|
|
@@ -5476,47 +5476,47 @@ function bo(e) {
|
|
|
5476
5476
|
)) || [];
|
|
5477
5477
|
}
|
|
5478
5478
|
var yo = /* @__PURE__ */ ((e) => (e.Post = "post", e.Poll = "poll", e))(yo || {});
|
|
5479
|
-
const
|
|
5480
|
-
var
|
|
5481
|
-
|
|
5482
|
-
|
|
5483
|
-
|
|
5484
|
-
var l, u, d, h, p;
|
|
5485
|
-
const s = ((l = a == null ? void 0 : a.own_children) == null ? void 0 : l["poll-vote"]) || [], o = (u = a.data) == null ? void 0 : u.description;
|
|
5479
|
+
const Ct = "poll-vote", cg = (e, t = "en") => {
|
|
5480
|
+
var r;
|
|
5481
|
+
return e.verb !== yo.Poll ? [] : (((r = e == null ? void 0 : e.latest_reactions) == null ? void 0 : r["poll-option"]) || []).map((i) => {
|
|
5482
|
+
var o, l, u, d, h;
|
|
5483
|
+
const a = ((o = i == null ? void 0 : i.own_children) == null ? void 0 : o["poll-vote"]) || [], s = (l = i.data) == null ? void 0 : l.description;
|
|
5486
5484
|
return {
|
|
5487
|
-
id:
|
|
5488
|
-
label:
|
|
5489
|
-
numVotes: ((
|
|
5490
|
-
hasUserVoted:
|
|
5491
|
-
userVote: { id: (
|
|
5492
|
-
position: ((
|
|
5485
|
+
id: i.id,
|
|
5486
|
+
label: s[t],
|
|
5487
|
+
numVotes: ((u = i == null ? void 0 : i.children_counts) == null ? void 0 : u["poll-vote"]) || 0,
|
|
5488
|
+
hasUserVoted: a.length > 0,
|
|
5489
|
+
userVote: { id: (d = a[0]) == null ? void 0 : d.id },
|
|
5490
|
+
position: ((h = i.data) == null ? void 0 : h.position) || 0
|
|
5493
5491
|
};
|
|
5494
|
-
});
|
|
5495
|
-
return r.sort((a, s) => a.position - s.position), r;
|
|
5492
|
+
}).sort((i, a) => i.position - a.position);
|
|
5496
5493
|
};
|
|
5497
5494
|
function dg({ activity: e, reactionId: t, user: n }) {
|
|
5498
|
-
var
|
|
5499
|
-
|
|
5500
|
-
|
|
5501
|
-
|
|
5502
|
-
|
|
5503
|
-
|
|
5504
|
-
|
|
5505
|
-
|
|
5506
|
-
|
|
5507
|
-
|
|
5508
|
-
|
|
5509
|
-
|
|
5510
|
-
|
|
5511
|
-
|
|
5512
|
-
|
|
5513
|
-
|
|
5514
|
-
|
|
5515
|
-
|
|
5516
|
-
|
|
5517
|
-
|
|
5518
|
-
|
|
5519
|
-
|
|
5495
|
+
var a;
|
|
5496
|
+
const r = n == null ? void 0 : n.id;
|
|
5497
|
+
if (!r)
|
|
5498
|
+
return;
|
|
5499
|
+
const i = (a = e.latest_reactions) == null ? void 0 : a["poll-option"];
|
|
5500
|
+
if (i) {
|
|
5501
|
+
for (const s of i)
|
|
5502
|
+
if (s.id === t) {
|
|
5503
|
+
const o = {
|
|
5504
|
+
id: Hr,
|
|
5505
|
+
activity_id: e.id,
|
|
5506
|
+
kind: Ct,
|
|
5507
|
+
data: {},
|
|
5508
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
5509
|
+
updated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
5510
|
+
user_id: r,
|
|
5511
|
+
parent: s.id,
|
|
5512
|
+
latest_children: {},
|
|
5513
|
+
own_children: {},
|
|
5514
|
+
children_counts: {}
|
|
5515
|
+
};
|
|
5516
|
+
s.latest_children = s.latest_children || {}, s.latest_children[Ct] = s.latest_children[Ct] || [], s.latest_children[Ct].push(o), s.own_children = s.own_children || {}, s.own_children[Ct] = s.own_children[Ct] || [], s.own_children[Ct].push(o), s.children_counts = s.children_counts || {}, s.children_counts[Ct] = (s.children_counts[Ct] || 0) + 1;
|
|
5517
|
+
break;
|
|
5518
|
+
}
|
|
5519
|
+
}
|
|
5520
5520
|
}
|
|
5521
5521
|
function fg({
|
|
5522
5522
|
activity: e,
|
|
@@ -5527,29 +5527,35 @@ function fg({
|
|
|
5527
5527
|
var i;
|
|
5528
5528
|
(i = e.latest_reactions) == null || i["poll-option"].forEach((a) => {
|
|
5529
5529
|
var s;
|
|
5530
|
-
a.id === t && (a.latest_children[
|
|
5530
|
+
a.id === t && (a.latest_children[Ct].forEach((o) => {
|
|
5531
5531
|
o.id === Hr && o.user_id === (r == null ? void 0 : r.id) && (o.id = n);
|
|
5532
|
-
}), (s = a.own_children) == null || s[
|
|
5532
|
+
}), (s = a.own_children) == null || s[Ct].forEach((o) => {
|
|
5533
5533
|
o.id === Hr && o.user_id === (r == null ? void 0 : r.id) && (o.id = n);
|
|
5534
5534
|
}));
|
|
5535
5535
|
});
|
|
5536
5536
|
}
|
|
5537
5537
|
function hg({ cache: e, activityId: t, reactionId: n }) {
|
|
5538
|
-
|
|
5539
|
-
|
|
5540
|
-
|
|
5541
|
-
|
|
5542
|
-
|
|
5543
|
-
if (
|
|
5544
|
-
const
|
|
5545
|
-
|
|
5546
|
-
|
|
5547
|
-
|
|
5548
|
-
|
|
5549
|
-
|
|
5550
|
-
|
|
5551
|
-
|
|
5552
|
-
|
|
5538
|
+
var r, i, a;
|
|
5539
|
+
for (const { results: s } of e.pages)
|
|
5540
|
+
for (const o of s)
|
|
5541
|
+
if (o.id === t) {
|
|
5542
|
+
const l = (r = o.latest_reactions) == null ? void 0 : r["poll-option"];
|
|
5543
|
+
if (l)
|
|
5544
|
+
for (const u of l) {
|
|
5545
|
+
const d = (i = u.own_children) == null ? void 0 : i[Ct], h = (a = u.latest_children) == null ? void 0 : a[Ct];
|
|
5546
|
+
if (h) {
|
|
5547
|
+
const p = h.findIndex(
|
|
5548
|
+
(m) => m.id === n
|
|
5549
|
+
);
|
|
5550
|
+
p !== -1 && (h.splice(p, 1), u.children_counts[Ct]--);
|
|
5551
|
+
}
|
|
5552
|
+
if (d) {
|
|
5553
|
+
const p = d.findIndex((m) => m.id === n);
|
|
5554
|
+
p !== -1 && d.splice(p, 1);
|
|
5555
|
+
}
|
|
5556
|
+
}
|
|
5557
|
+
return e;
|
|
5558
|
+
}
|
|
5553
5559
|
return e;
|
|
5554
5560
|
}
|
|
5555
5561
|
function mg({ activityId: e, replyId: t, content: n }) {
|
|
@@ -5599,7 +5605,7 @@ function pg({ reply: e, user: t }) {
|
|
|
5599
5605
|
});
|
|
5600
5606
|
}
|
|
5601
5607
|
const Bd = (e, t) => {
|
|
5602
|
-
const n = new CustomEvent(
|
|
5608
|
+
const n = new CustomEvent(ut.DISCUSSION_POST_ADDED, {
|
|
5603
5609
|
detail: { id: e, type: t }
|
|
5604
5610
|
});
|
|
5605
5611
|
document.dispatchEvent(n);
|
|
@@ -5607,11 +5613,11 @@ const Bd = (e, t) => {
|
|
|
5607
5613
|
let Ru, $a = 0;
|
|
5608
5614
|
const Td = () => {
|
|
5609
5615
|
ce(() => (document.addEventListener(
|
|
5610
|
-
|
|
5616
|
+
ut.DISCUSSION_POST_ADDED,
|
|
5611
5617
|
e
|
|
5612
5618
|
), () => {
|
|
5613
5619
|
document.removeEventListener(
|
|
5614
|
-
|
|
5620
|
+
ut.DISCUSSION_POST_ADDED,
|
|
5615
5621
|
e
|
|
5616
5622
|
);
|
|
5617
5623
|
}), []);
|
|
@@ -5815,7 +5821,7 @@ function yg({
|
|
|
5815
5821
|
queryKey: i,
|
|
5816
5822
|
user: a
|
|
5817
5823
|
}) {
|
|
5818
|
-
const { mutate: s } =
|
|
5824
|
+
const { mutate: s } = at({
|
|
5819
5825
|
mutationFn: e,
|
|
5820
5826
|
onMutate: (o) => t((l) => {
|
|
5821
5827
|
const u = Pu({ activity: sg(o), user: a });
|
|
@@ -5841,7 +5847,7 @@ function xg({
|
|
|
5841
5847
|
queryKey: i,
|
|
5842
5848
|
user: a
|
|
5843
5849
|
}) {
|
|
5844
|
-
const { mutate: s } =
|
|
5850
|
+
const { mutate: s } = at({
|
|
5845
5851
|
mutationFn: e,
|
|
5846
5852
|
onMutate: ({ activityId: o, reactionId: l }) => t((u) => {
|
|
5847
5853
|
const d = jt(o, u);
|
|
@@ -5865,7 +5871,7 @@ function wg({
|
|
|
5865
5871
|
mutationFn: e,
|
|
5866
5872
|
mutationHandlers: { mutate: t, error: n }
|
|
5867
5873
|
}) {
|
|
5868
|
-
const { mutate: r } =
|
|
5874
|
+
const { mutate: r } = at({
|
|
5869
5875
|
mutationFn: e,
|
|
5870
5876
|
onMutate: ({ activityId: i, content: a }) => t((s) => {
|
|
5871
5877
|
const o = jt(i, s);
|
|
@@ -5933,7 +5939,7 @@ function Cg({
|
|
|
5933
5939
|
queryClient: r,
|
|
5934
5940
|
queryKey: i
|
|
5935
5941
|
}) {
|
|
5936
|
-
const { mutate: a } =
|
|
5942
|
+
const { mutate: a } = at({
|
|
5937
5943
|
mutationFn: e,
|
|
5938
5944
|
onMutate: ({ activityId: s }) => t((o) => {
|
|
5939
5945
|
const l = jt(s, o);
|
|
@@ -5972,7 +5978,7 @@ function _g({
|
|
|
5972
5978
|
queryClient: r,
|
|
5973
5979
|
queryKey: i
|
|
5974
5980
|
}) {
|
|
5975
|
-
const { mutate: a } =
|
|
5981
|
+
const { mutate: a } = at({
|
|
5976
5982
|
mutationFn: e,
|
|
5977
5983
|
onMutate: ({ activityId: s }) => t((o) => {
|
|
5978
5984
|
const l = jt(s, o);
|
|
@@ -5990,7 +5996,7 @@ function kg({
|
|
|
5990
5996
|
mutationFn: e,
|
|
5991
5997
|
mutationHandlers: { mutate: t, error: n }
|
|
5992
5998
|
}) {
|
|
5993
|
-
const { mutate: r } =
|
|
5999
|
+
const { mutate: r } = at({
|
|
5994
6000
|
mutationFn: e,
|
|
5995
6001
|
onMutate: ({ activityId: i }) => t((a) => Ad(i, a)),
|
|
5996
6002
|
onError: n
|
|
@@ -6002,7 +6008,7 @@ function Fg({
|
|
|
6002
6008
|
mutationHandlers: { mutate: t, error: n },
|
|
6003
6009
|
user: r
|
|
6004
6010
|
}) {
|
|
6005
|
-
const { mutate: i } =
|
|
6011
|
+
const { mutate: i } = at({
|
|
6006
6012
|
mutationFn: e,
|
|
6007
6013
|
onMutate: ({ activityId: a, reactionId: s }) => t((o) => hg({ cache: o, activityId: a, reactionId: s })),
|
|
6008
6014
|
onError: n
|
|
@@ -6014,7 +6020,7 @@ function Ag({
|
|
|
6014
6020
|
mutationHandlers: { mutate: t, error: n },
|
|
6015
6021
|
user: r
|
|
6016
6022
|
}) {
|
|
6017
|
-
const { mutate: i } =
|
|
6023
|
+
const { mutate: i } = at({
|
|
6018
6024
|
mutationFn: e,
|
|
6019
6025
|
onMutate: ({ activityId: a }) => t((s) => {
|
|
6020
6026
|
const o = jt(a, s);
|
|
@@ -6029,7 +6035,7 @@ function Bg({
|
|
|
6029
6035
|
mutationHandlers: { mutate: t, error: n },
|
|
6030
6036
|
user: r
|
|
6031
6037
|
}) {
|
|
6032
|
-
const { mutate: i } =
|
|
6038
|
+
const { mutate: i } = at({
|
|
6033
6039
|
mutationFn: e,
|
|
6034
6040
|
onMutate: ({ activityId: a }) => t((s) => {
|
|
6035
6041
|
const o = jt(a, s);
|
|
@@ -6294,11 +6300,11 @@ const Tg = 280, Sd = async (e, t, n, r = () => Promise.resolve([])) => {
|
|
|
6294
6300
|
showBadges: !0,
|
|
6295
6301
|
scopes: [
|
|
6296
6302
|
{
|
|
6297
|
-
scope:
|
|
6303
|
+
scope: yt.Communities,
|
|
6298
6304
|
area: t || ""
|
|
6299
6305
|
},
|
|
6300
6306
|
{
|
|
6301
|
-
scope:
|
|
6307
|
+
scope: yt.Platform,
|
|
6302
6308
|
area: "all"
|
|
6303
6309
|
}
|
|
6304
6310
|
]
|
|
@@ -6945,7 +6951,7 @@ function Ng({
|
|
|
6945
6951
|
queryKey: i,
|
|
6946
6952
|
user: a
|
|
6947
6953
|
}) {
|
|
6948
|
-
const { mutate: s } =
|
|
6954
|
+
const { mutate: s } = at({
|
|
6949
6955
|
mutationFn: e,
|
|
6950
6956
|
onMutate: (o) => t((l) => {
|
|
6951
6957
|
const u = Nu({ reply: mg(o), user: a });
|
|
@@ -6971,7 +6977,7 @@ function Mg({
|
|
|
6971
6977
|
mutationFn: e,
|
|
6972
6978
|
mutationHandlers: { mutate: t, error: n }
|
|
6973
6979
|
}) {
|
|
6974
|
-
const { mutate: r } =
|
|
6980
|
+
const { mutate: r } = at({
|
|
6975
6981
|
mutationFn: e,
|
|
6976
6982
|
onMutate: ({ replyId: i, content: a }) => t((s) => {
|
|
6977
6983
|
const o = jt(i, s);
|
|
@@ -7067,7 +7073,7 @@ function Lg({
|
|
|
7067
7073
|
queryClient: r,
|
|
7068
7074
|
queryKey: i
|
|
7069
7075
|
}) {
|
|
7070
|
-
const { mutate: a } =
|
|
7076
|
+
const { mutate: a } = at({
|
|
7071
7077
|
mutationFn: e,
|
|
7072
7078
|
onMutate: ({ replyId: s }) => t((o) => {
|
|
7073
7079
|
const l = jt(s, o);
|
|
@@ -7100,7 +7106,7 @@ function qg({
|
|
|
7100
7106
|
mutationFn: e,
|
|
7101
7107
|
mutationHandlers: { mutate: t, error: n }
|
|
7102
7108
|
}) {
|
|
7103
|
-
const { mutate: r } =
|
|
7109
|
+
const { mutate: r } = at({
|
|
7104
7110
|
mutationFn: e,
|
|
7105
7111
|
onMutate: ({ replyId: i }) => t((a) => Ad(i, a)),
|
|
7106
7112
|
onError: n
|
|
@@ -7112,7 +7118,7 @@ function Ug({
|
|
|
7112
7118
|
mutationHandlers: { mutate: t, error: n },
|
|
7113
7119
|
user: r
|
|
7114
7120
|
}) {
|
|
7115
|
-
const { mutate: i } =
|
|
7121
|
+
const { mutate: i } = at({
|
|
7116
7122
|
mutationFn: e,
|
|
7117
7123
|
onMutate: ({ replyId: a }) => t((s) => {
|
|
7118
7124
|
const o = jt(a, s);
|
|
@@ -7248,11 +7254,11 @@ const Wg = ({
|
|
|
7248
7254
|
showBadges: !0,
|
|
7249
7255
|
scopes: [
|
|
7250
7256
|
{
|
|
7251
|
-
scope:
|
|
7257
|
+
scope: yt.Communities,
|
|
7252
7258
|
area: r || ""
|
|
7253
7259
|
},
|
|
7254
7260
|
{
|
|
7255
|
-
scope:
|
|
7261
|
+
scope: yt.Platform,
|
|
7256
7262
|
area: "all"
|
|
7257
7263
|
}
|
|
7258
7264
|
]
|
|
@@ -7328,11 +7334,11 @@ function Vg({
|
|
|
7328
7334
|
showBadges: !0,
|
|
7329
7335
|
scopes: [
|
|
7330
7336
|
{
|
|
7331
|
-
scope:
|
|
7337
|
+
scope: yt.Communities,
|
|
7332
7338
|
area: a || ""
|
|
7333
7339
|
},
|
|
7334
7340
|
{
|
|
7335
|
-
scope:
|
|
7341
|
+
scope: yt.Platform,
|
|
7336
7342
|
area: "all"
|
|
7337
7343
|
}
|
|
7338
7344
|
]
|
|
@@ -7431,7 +7437,7 @@ const Hg = ({
|
|
|
7431
7437
|
totalReplies: f.length
|
|
7432
7438
|
}
|
|
7433
7439
|
)
|
|
7434
|
-
] }) : /* @__PURE__ */ c.jsx(It, { children: /* @__PURE__ */ c.jsx(
|
|
7440
|
+
] }) : /* @__PURE__ */ c.jsx(It, { children: /* @__PURE__ */ c.jsx(dt, { id: "replies_feed_missing_polls_vote_message" }) }),
|
|
7435
7441
|
/* @__PURE__ */ c.jsx(bh, { form: d })
|
|
7436
7442
|
] });
|
|
7437
7443
|
};
|
|
@@ -7999,7 +8005,7 @@ const Nd = ({
|
|
|
7999
8005
|
href: "/home/",
|
|
8000
8006
|
className: H("logo", e, t, n),
|
|
8001
8007
|
...r,
|
|
8002
|
-
children: /* @__PURE__ */ c.jsx(Ie, { children: /* @__PURE__ */ c.jsx(
|
|
8008
|
+
children: /* @__PURE__ */ c.jsx(Ie, { children: /* @__PURE__ */ c.jsx(dt, { id: "apolitical" }) })
|
|
8003
8009
|
}
|
|
8004
8010
|
) });
|
|
8005
8011
|
let mi = !1;
|
|
@@ -8086,7 +8092,7 @@ const av = mr(() => Promise.resolve().then(() => Gm)), sv = [
|
|
|
8086
8092
|
href: "/communities/"
|
|
8087
8093
|
}
|
|
8088
8094
|
], ov = ({ activeLink: e, profile: t }) => {
|
|
8089
|
-
const n = le(), r = $e(
|
|
8095
|
+
const n = le(), r = $e(ft), i = r && typeof r.id == "string";
|
|
8090
8096
|
return /* @__PURE__ */ c.jsxs("ul", { id: "navigation-menu", className: "text-medium", children: [
|
|
8091
8097
|
sv.map(({ key: a, href: s }) => {
|
|
8092
8098
|
const o = iv(s, e), l = {};
|
|
@@ -9809,7 +9815,7 @@ const _v = ({
|
|
|
9809
9815
|
const i = r;
|
|
9810
9816
|
return i != null && i.name && i.name === Li ? /* @__PURE__ */ c.jsxs("span", { ...e, className: "mention deleted-user", children: [
|
|
9811
9817
|
"@",
|
|
9812
|
-
/* @__PURE__ */ c.jsx(
|
|
9818
|
+
/* @__PURE__ */ c.jsx(dt, { id: "member_deleted" }),
|
|
9813
9819
|
t
|
|
9814
9820
|
] }) : /* @__PURE__ */ c.jsxs("a", { ...e, className: "mention", children: [
|
|
9815
9821
|
"@",
|
|
@@ -10049,7 +10055,7 @@ function $b(e, t) {
|
|
|
10049
10055
|
function Zu(e) {
|
|
10050
10056
|
return Object.prototype.toString.call(e) === "[object Object]";
|
|
10051
10057
|
}
|
|
10052
|
-
function
|
|
10058
|
+
function ct(e) {
|
|
10053
10059
|
var t, n;
|
|
10054
10060
|
return Zu(e) === !1 ? !1 : (t = e.constructor, t === void 0 ? !0 : (n = t.prototype, !(Zu(n) === !1 || n.hasOwnProperty("isPrototypeOf") === !1)));
|
|
10055
10061
|
}
|
|
@@ -10759,7 +10765,7 @@ function e0(e) {
|
|
|
10759
10765
|
var t = Xb(e, "string");
|
|
10760
10766
|
return Yr(t) === "symbol" ? t : String(t);
|
|
10761
10767
|
}
|
|
10762
|
-
function
|
|
10768
|
+
function xt(e, t, n) {
|
|
10763
10769
|
return t = e0(t), t in e ? Object.defineProperty(e, t, {
|
|
10764
10770
|
value: n,
|
|
10765
10771
|
enumerable: !0,
|
|
@@ -10781,7 +10787,7 @@ function Br(e) {
|
|
|
10781
10787
|
for (var t = 1; t < arguments.length; t++) {
|
|
10782
10788
|
var n = arguments[t] != null ? arguments[t] : {};
|
|
10783
10789
|
t % 2 ? al(Object(n), !0).forEach(function(r) {
|
|
10784
|
-
|
|
10790
|
+
xt(e, r, n[r]);
|
|
10785
10791
|
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : al(Object(n)).forEach(function(r) {
|
|
10786
10792
|
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r));
|
|
10787
10793
|
});
|
|
@@ -10825,7 +10831,7 @@ var t0 = (e, t, n) => {
|
|
|
10825
10831
|
else if (!pe.isText(w) && !pe.isText(A))
|
|
10826
10832
|
A.children.push(...w.children);
|
|
10827
10833
|
else
|
|
10828
|
-
throw new Error('Cannot apply a "merge_node" operation at path ['.concat(g, "] to nodes of different interfaces: ").concat(
|
|
10834
|
+
throw new Error('Cannot apply a "merge_node" operation at path ['.concat(g, "] to nodes of different interfaces: ").concat(ot.stringify(w), " ").concat(ot.stringify(A)));
|
|
10829
10835
|
if (D.children.splice(_, 1), t)
|
|
10830
10836
|
for (var [B, $] of Z.points(t))
|
|
10831
10837
|
t[$] = je.transform(B, n);
|
|
@@ -10892,15 +10898,15 @@ var t0 = (e, t, n) => {
|
|
|
10892
10898
|
} = n;
|
|
10893
10899
|
if (Ve.length === 0)
|
|
10894
10900
|
throw new Error("Cannot set properties on the root node!");
|
|
10895
|
-
var
|
|
10901
|
+
var nt = oe.get(e, Ve);
|
|
10896
10902
|
for (var Pe in He) {
|
|
10897
10903
|
if (Pe === "children" || Pe === "text")
|
|
10898
10904
|
throw new Error('Cannot set the "'.concat(Pe, '" property of nodes!'));
|
|
10899
10905
|
var Ke = He[Pe];
|
|
10900
|
-
Ke == null ? delete
|
|
10906
|
+
Ke == null ? delete nt[Pe] : nt[Pe] = Ke;
|
|
10901
10907
|
}
|
|
10902
10908
|
for (var De in Re)
|
|
10903
|
-
He.hasOwnProperty(De) || delete
|
|
10909
|
+
He.hasOwnProperty(De) || delete nt[De];
|
|
10904
10910
|
break;
|
|
10905
10911
|
}
|
|
10906
10912
|
case "set_selection": {
|
|
@@ -10912,7 +10918,7 @@ var t0 = (e, t, n) => {
|
|
|
10912
10918
|
else {
|
|
10913
10919
|
if (t == null) {
|
|
10914
10920
|
if (!Z.isRange(W))
|
|
10915
|
-
throw new Error('Cannot apply an incomplete "set_selection" operation properties '.concat(
|
|
10921
|
+
throw new Error('Cannot apply an incomplete "set_selection" operation properties '.concat(ot.stringify(W), " when there is no current selection."));
|
|
10916
10922
|
t = Br({}, W);
|
|
10917
10923
|
}
|
|
10918
10924
|
for (var re in W) {
|
|
@@ -10935,19 +10941,19 @@ var t0 = (e, t, n) => {
|
|
|
10935
10941
|
} = n;
|
|
10936
10942
|
if (ye.length === 0)
|
|
10937
10943
|
throw new Error('Cannot apply a "split_node" operation at path ['.concat(ye, "] because the root node cannot be split."));
|
|
10938
|
-
var Fe = oe.get(e, ye), Xe = oe.parent(e, ye),
|
|
10944
|
+
var Fe = oe.get(e, ye), Xe = oe.parent(e, ye), st = ye[ye.length - 1], wt;
|
|
10939
10945
|
if (pe.isText(Fe)) {
|
|
10940
|
-
var
|
|
10941
|
-
Fe.text =
|
|
10946
|
+
var rt = Fe.text.slice(0, Ae), Bt = Fe.text.slice(Ae);
|
|
10947
|
+
Fe.text = rt, wt = Br(Br({}, be), {}, {
|
|
10942
10948
|
text: Bt
|
|
10943
10949
|
});
|
|
10944
10950
|
} else {
|
|
10945
10951
|
var Tt = Fe.children.slice(0, Ae), Da = Fe.children.slice(Ae);
|
|
10946
|
-
Fe.children = Tt,
|
|
10952
|
+
Fe.children = Tt, wt = Br(Br({}, be), {}, {
|
|
10947
10953
|
children: Da
|
|
10948
10954
|
});
|
|
10949
10955
|
}
|
|
10950
|
-
if (Xe.children.splice(
|
|
10956
|
+
if (Xe.children.splice(st + 1, 0, wt), t)
|
|
10951
10957
|
for (var [wr, ai] of Z.points(t))
|
|
10952
10958
|
t[ai] = je.transform(wr, n);
|
|
10953
10959
|
break;
|
|
@@ -11017,7 +11023,7 @@ var t0 = (e, t, n) => {
|
|
|
11017
11023
|
}, nf = (e, t) => {
|
|
11018
11024
|
for (var n in e) {
|
|
11019
11025
|
var r = e[n], i = t[n];
|
|
11020
|
-
if (
|
|
11026
|
+
if (ct(r) && ct(i)) {
|
|
11021
11027
|
if (!nf(r, i))
|
|
11022
11028
|
return !1;
|
|
11023
11029
|
} else if (Array.isArray(r) && Array.isArray(i)) {
|
|
@@ -11068,7 +11074,7 @@ function o0(e) {
|
|
|
11068
11074
|
for (var t = 1; t < arguments.length; t++) {
|
|
11069
11075
|
var n = arguments[t] != null ? arguments[t] : {};
|
|
11070
11076
|
t % 2 ? sl(Object(n), !0).forEach(function(r) {
|
|
11071
|
-
|
|
11077
|
+
xt(e, r, n[r]);
|
|
11072
11078
|
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : sl(Object(n)).forEach(function(r) {
|
|
11073
11079
|
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r));
|
|
11074
11080
|
});
|
|
@@ -11130,7 +11136,7 @@ var Z = {
|
|
|
11130
11136
|
return !Z.isBackward(e);
|
|
11131
11137
|
},
|
|
11132
11138
|
isRange(e) {
|
|
11133
|
-
return
|
|
11139
|
+
return ct(e) && je.isPoint(e.anchor) && je.isPoint(e.focus);
|
|
11134
11140
|
},
|
|
11135
11141
|
*points(e) {
|
|
11136
11142
|
yield [e.anchor, "anchor"], yield [e.focus, "focus"];
|
|
@@ -11162,9 +11168,9 @@ var Z = {
|
|
|
11162
11168
|
r.anchor = l, r.focus = u;
|
|
11163
11169
|
});
|
|
11164
11170
|
}
|
|
11165
|
-
}, ol = (e) =>
|
|
11171
|
+
}, ol = (e) => ct(e) && oe.isNodeList(e.children) && !y.isEditor(e), he = {
|
|
11166
11172
|
isAncestor(e) {
|
|
11167
|
-
return
|
|
11173
|
+
return ct(e) && oe.isNodeList(e.children);
|
|
11168
11174
|
},
|
|
11169
11175
|
isElement: ol,
|
|
11170
11176
|
isElementList(e) {
|
|
@@ -11187,7 +11193,7 @@ var Z = {
|
|
|
11187
11193
|
ancestor(e, t) {
|
|
11188
11194
|
var n = oe.get(e, t);
|
|
11189
11195
|
if (pe.isText(n))
|
|
11190
|
-
throw new Error("Cannot get the ancestor node at path [".concat(t, "] because it refers to a text node instead: ").concat(
|
|
11196
|
+
throw new Error("Cannot get the ancestor node at path [".concat(t, "] because it refers to a text node instead: ").concat(ot.stringify(n)));
|
|
11191
11197
|
return n;
|
|
11192
11198
|
},
|
|
11193
11199
|
ancestors(e, t) {
|
|
@@ -11201,10 +11207,10 @@ var Z = {
|
|
|
11201
11207
|
},
|
|
11202
11208
|
child(e, t) {
|
|
11203
11209
|
if (pe.isText(e))
|
|
11204
|
-
throw new Error("Cannot get the child of a text node: ".concat(
|
|
11210
|
+
throw new Error("Cannot get the child of a text node: ".concat(ot.stringify(e)));
|
|
11205
11211
|
var n = e.children[t];
|
|
11206
11212
|
if (n == null)
|
|
11207
|
-
throw new Error("Cannot get child at index `".concat(t, "` in node: ").concat(
|
|
11213
|
+
throw new Error("Cannot get child at index `".concat(t, "` in node: ").concat(ot.stringify(e)));
|
|
11208
11214
|
return n;
|
|
11209
11215
|
},
|
|
11210
11216
|
children(e, t) {
|
|
@@ -11227,7 +11233,7 @@ var Z = {
|
|
|
11227
11233
|
descendant(e, t) {
|
|
11228
11234
|
var n = oe.get(e, t);
|
|
11229
11235
|
if (y.isEditor(n))
|
|
11230
|
-
throw new Error("Cannot get the descendant node at path [".concat(t, "] because it refers to the root editor node instead: ").concat(
|
|
11236
|
+
throw new Error("Cannot get the descendant node at path [".concat(t, "] because it refers to the root editor node instead: ").concat(ot.stringify(n)));
|
|
11231
11237
|
return n;
|
|
11232
11238
|
},
|
|
11233
11239
|
descendants(e) {
|
|
@@ -11260,7 +11266,7 @@ var Z = {
|
|
|
11260
11266
|
},
|
|
11261
11267
|
fragment(e, t) {
|
|
11262
11268
|
if (pe.isText(e))
|
|
11263
|
-
throw new Error("Cannot get a fragment starting from a root text node: ".concat(
|
|
11269
|
+
throw new Error("Cannot get a fragment starting from a root text node: ".concat(ot.stringify(e)));
|
|
11264
11270
|
var n = _o({
|
|
11265
11271
|
children: e.children
|
|
11266
11272
|
}, (r) => {
|
|
@@ -11293,7 +11299,7 @@ var Z = {
|
|
|
11293
11299
|
for (var n = e, r = 0; r < t.length; r++) {
|
|
11294
11300
|
var i = t[r];
|
|
11295
11301
|
if (pe.isText(n) || !n.children[i])
|
|
11296
|
-
throw new Error("Cannot find a descendant at path [".concat(t, "] in node: ").concat(
|
|
11302
|
+
throw new Error("Cannot find a descendant at path [".concat(t, "] in node: ").concat(ot.stringify(e)));
|
|
11297
11303
|
n = n.children[i];
|
|
11298
11304
|
}
|
|
11299
11305
|
return n;
|
|
@@ -11329,7 +11335,7 @@ var Z = {
|
|
|
11329
11335
|
leaf(e, t) {
|
|
11330
11336
|
var n = oe.get(e, t);
|
|
11331
11337
|
if (!pe.isText(n))
|
|
11332
|
-
throw new Error("Cannot get the leaf node at path [".concat(t, "] because it refers to a non-leaf node: ").concat(
|
|
11338
|
+
throw new Error("Cannot get the leaf node at path [".concat(t, "] because it refers to a non-leaf node: ").concat(ot.stringify(n)));
|
|
11333
11339
|
return n;
|
|
11334
11340
|
},
|
|
11335
11341
|
levels(e, t) {
|
|
@@ -11409,7 +11415,7 @@ function Ge(e) {
|
|
|
11409
11415
|
for (var t = 1; t < arguments.length; t++) {
|
|
11410
11416
|
var n = arguments[t] != null ? arguments[t] : {};
|
|
11411
11417
|
t % 2 ? ll(Object(n), !0).forEach(function(r) {
|
|
11412
|
-
|
|
11418
|
+
xt(e, r, n[r]);
|
|
11413
11419
|
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : ll(Object(n)).forEach(function(r) {
|
|
11414
11420
|
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r));
|
|
11415
11421
|
});
|
|
@@ -11421,7 +11427,7 @@ var wn = {
|
|
|
11421
11427
|
return wn.isOperation(e) && e.type.endsWith("_node");
|
|
11422
11428
|
},
|
|
11423
11429
|
isOperation(e) {
|
|
11424
|
-
if (!
|
|
11430
|
+
if (!ct(e))
|
|
11425
11431
|
return !1;
|
|
11426
11432
|
switch (e.type) {
|
|
11427
11433
|
case "insert_node":
|
|
@@ -11429,7 +11435,7 @@ var wn = {
|
|
|
11429
11435
|
case "insert_text":
|
|
11430
11436
|
return typeof e.offset == "number" && typeof e.text == "string" && M.isPath(e.path);
|
|
11431
11437
|
case "merge_node":
|
|
11432
|
-
return typeof e.position == "number" && M.isPath(e.path) &&
|
|
11438
|
+
return typeof e.position == "number" && M.isPath(e.path) && ct(e.properties);
|
|
11433
11439
|
case "move_node":
|
|
11434
11440
|
return M.isPath(e.path) && M.isPath(e.newPath);
|
|
11435
11441
|
case "remove_node":
|
|
@@ -11437,11 +11443,11 @@ var wn = {
|
|
|
11437
11443
|
case "remove_text":
|
|
11438
11444
|
return typeof e.offset == "number" && typeof e.text == "string" && M.isPath(e.path);
|
|
11439
11445
|
case "set_node":
|
|
11440
|
-
return M.isPath(e.path) &&
|
|
11446
|
+
return M.isPath(e.path) && ct(e.properties) && ct(e.newProperties);
|
|
11441
11447
|
case "set_selection":
|
|
11442
|
-
return e.properties === null && Z.isRange(e.newProperties) || e.newProperties === null && Z.isRange(e.properties) ||
|
|
11448
|
+
return e.properties === null && Z.isRange(e.newProperties) || e.newProperties === null && Z.isRange(e.properties) || ct(e.properties) && ct(e.newProperties);
|
|
11443
11449
|
case "split_node":
|
|
11444
|
-
return M.isPath(e.path) && typeof e.position == "number" &&
|
|
11450
|
+
return M.isPath(e.path) && typeof e.position == "number" && ct(e.properties);
|
|
11445
11451
|
default:
|
|
11446
11452
|
return !1;
|
|
11447
11453
|
}
|
|
@@ -11533,9 +11539,9 @@ var wn = {
|
|
|
11533
11539
|
var t = cl.get(e);
|
|
11534
11540
|
if (t !== void 0)
|
|
11535
11541
|
return t;
|
|
11536
|
-
if (!
|
|
11542
|
+
if (!ct(e))
|
|
11537
11543
|
return !1;
|
|
11538
|
-
var n = typeof e.addMark == "function" && typeof e.apply == "function" && typeof e.deleteFragment == "function" && typeof e.insertBreak == "function" && typeof e.insertSoftBreak == "function" && typeof e.insertFragment == "function" && typeof e.insertNode == "function" && typeof e.insertText == "function" && typeof e.isElementReadOnly == "function" && typeof e.isInline == "function" && typeof e.isSelectable == "function" && typeof e.isVoid == "function" && typeof e.normalizeNode == "function" && typeof e.onChange == "function" && typeof e.removeMark == "function" && typeof e.getDirtyPaths == "function" && (e.marks === null ||
|
|
11544
|
+
var n = typeof e.addMark == "function" && typeof e.apply == "function" && typeof e.deleteFragment == "function" && typeof e.insertBreak == "function" && typeof e.insertSoftBreak == "function" && typeof e.insertFragment == "function" && typeof e.insertNode == "function" && typeof e.insertText == "function" && typeof e.isElementReadOnly == "function" && typeof e.isInline == "function" && typeof e.isSelectable == "function" && typeof e.isVoid == "function" && typeof e.normalizeNode == "function" && typeof e.onChange == "function" && typeof e.removeMark == "function" && typeof e.getDirtyPaths == "function" && (e.marks === null || ct(e.marks)) && (e.selection === null || Z.isRange(e.selection)) && oe.isNodeList(e.children) && wn.isOperationList(e.operations);
|
|
11539
11545
|
return cl.set(e, n), n;
|
|
11540
11546
|
}, y = {
|
|
11541
11547
|
above(e, t) {
|
|
@@ -11741,7 +11747,7 @@ function fl(e) {
|
|
|
11741
11747
|
for (var t = 1; t < arguments.length; t++) {
|
|
11742
11748
|
var n = arguments[t] != null ? arguments[t] : {};
|
|
11743
11749
|
t % 2 ? dl(Object(n), !0).forEach(function(r) {
|
|
11744
|
-
|
|
11750
|
+
xt(e, r, n[r]);
|
|
11745
11751
|
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : dl(Object(n)).forEach(function(r) {
|
|
11746
11752
|
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r));
|
|
11747
11753
|
});
|
|
@@ -11763,7 +11769,7 @@ var je = {
|
|
|
11763
11769
|
return e.offset === t.offset && M.equals(e.path, t.path);
|
|
11764
11770
|
},
|
|
11765
11771
|
isPoint(e) {
|
|
11766
|
-
return
|
|
11772
|
+
return ct(e) && typeof e.offset == "number" && M.isPath(e.path);
|
|
11767
11773
|
},
|
|
11768
11774
|
transform(e, t) {
|
|
11769
11775
|
var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
@@ -11814,7 +11820,7 @@ var je = {
|
|
|
11814
11820
|
}
|
|
11815
11821
|
});
|
|
11816
11822
|
}
|
|
11817
|
-
}, hl = void 0,
|
|
11823
|
+
}, hl = void 0, ot = {
|
|
11818
11824
|
setScrubber(e) {
|
|
11819
11825
|
hl = e;
|
|
11820
11826
|
},
|
|
@@ -11836,7 +11842,7 @@ function an(e) {
|
|
|
11836
11842
|
for (var t = 1; t < arguments.length; t++) {
|
|
11837
11843
|
var n = arguments[t] != null ? arguments[t] : {};
|
|
11838
11844
|
t % 2 ? ml(Object(n), !0).forEach(function(r) {
|
|
11839
|
-
|
|
11845
|
+
xt(e, r, n[r]);
|
|
11840
11846
|
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : ml(Object(n)).forEach(function(r) {
|
|
11841
11847
|
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r));
|
|
11842
11848
|
});
|
|
@@ -11855,7 +11861,7 @@ var pe = {
|
|
|
11855
11861
|
return nf(r ? i(e) : e, r ? i(t) : t);
|
|
11856
11862
|
},
|
|
11857
11863
|
isText(e) {
|
|
11858
|
-
return
|
|
11864
|
+
return ct(e) && typeof e.text == "string";
|
|
11859
11865
|
},
|
|
11860
11866
|
isTextList(e) {
|
|
11861
11867
|
return Array.isArray(e) && e.every((t) => pe.isText(t));
|
|
@@ -12069,7 +12075,7 @@ function bi(e) {
|
|
|
12069
12075
|
for (var t = 1; t < arguments.length; t++) {
|
|
12070
12076
|
var n = arguments[t] != null ? arguments[t] : {};
|
|
12071
12077
|
t % 2 ? gl(Object(n), !0).forEach(function(r) {
|
|
12072
|
-
|
|
12078
|
+
xt(e, r, n[r]);
|
|
12073
12079
|
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : gl(Object(n)).forEach(function(r) {
|
|
12074
12080
|
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r));
|
|
12075
12081
|
});
|
|
@@ -12291,7 +12297,7 @@ function bl(e) {
|
|
|
12291
12297
|
for (var t = 1; t < arguments.length; t++) {
|
|
12292
12298
|
var n = arguments[t] != null ? arguments[t] : {};
|
|
12293
12299
|
t % 2 ? vl(Object(n), !0).forEach(function(r) {
|
|
12294
|
-
|
|
12300
|
+
xt(e, r, n[r]);
|
|
12295
12301
|
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : vl(Object(n)).forEach(function(r) {
|
|
12296
12302
|
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r));
|
|
12297
12303
|
});
|
|
@@ -12346,7 +12352,7 @@ function xl(e) {
|
|
|
12346
12352
|
for (var t = 1; t < arguments.length; t++) {
|
|
12347
12353
|
var n = arguments[t] != null ? arguments[t] : {};
|
|
12348
12354
|
t % 2 ? yl(Object(n), !0).forEach(function(r) {
|
|
12349
|
-
|
|
12355
|
+
xt(e, r, n[r]);
|
|
12350
12356
|
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : yl(Object(n)).forEach(function(r) {
|
|
12351
12357
|
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r));
|
|
12352
12358
|
});
|
|
@@ -12385,7 +12391,7 @@ function Dl(e) {
|
|
|
12385
12391
|
for (var t = 1; t < arguments.length; t++) {
|
|
12386
12392
|
var n = arguments[t] != null ? arguments[t] : {};
|
|
12387
12393
|
t % 2 ? wl(Object(n), !0).forEach(function(r) {
|
|
12388
|
-
|
|
12394
|
+
xt(e, r, n[r]);
|
|
12389
12395
|
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : wl(Object(n)).forEach(function(r) {
|
|
12390
12396
|
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r));
|
|
12391
12397
|
});
|
|
@@ -12449,7 +12455,7 @@ function El(e) {
|
|
|
12449
12455
|
for (var t = 1; t < arguments.length; t++) {
|
|
12450
12456
|
var n = arguments[t] != null ? arguments[t] : {};
|
|
12451
12457
|
t % 2 ? Cl(Object(n), !0).forEach(function(r) {
|
|
12452
|
-
|
|
12458
|
+
xt(e, r, n[r]);
|
|
12453
12459
|
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : Cl(Object(n)).forEach(function(r) {
|
|
12454
12460
|
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r));
|
|
12455
12461
|
});
|
|
@@ -12486,7 +12492,7 @@ function kl(e) {
|
|
|
12486
12492
|
for (var t = 1; t < arguments.length; t++) {
|
|
12487
12493
|
var n = arguments[t] != null ? arguments[t] : {};
|
|
12488
12494
|
t % 2 ? _l(Object(n), !0).forEach(function(r) {
|
|
12489
|
-
|
|
12495
|
+
xt(e, r, n[r]);
|
|
12490
12496
|
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : _l(Object(n)).forEach(function(r) {
|
|
12491
12497
|
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r));
|
|
12492
12498
|
});
|
|
@@ -12523,7 +12529,7 @@ function dy(e) {
|
|
|
12523
12529
|
for (var t = 1; t < arguments.length; t++) {
|
|
12524
12530
|
var n = arguments[t] != null ? arguments[t] : {};
|
|
12525
12531
|
t % 2 ? Fl(Object(n), !0).forEach(function(r) {
|
|
12526
|
-
|
|
12532
|
+
xt(e, r, n[r]);
|
|
12527
12533
|
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : Fl(Object(n)).forEach(function(r) {
|
|
12528
12534
|
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r));
|
|
12529
12535
|
});
|
|
@@ -12993,7 +12999,7 @@ function zy(e) {
|
|
|
12993
12999
|
for (var t = 1; t < arguments.length; t++) {
|
|
12994
13000
|
var n = arguments[t] != null ? arguments[t] : {};
|
|
12995
13001
|
t % 2 ? Al(Object(n), !0).forEach(function(r) {
|
|
12996
|
-
|
|
13002
|
+
xt(e, r, n[r]);
|
|
12997
13003
|
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : Al(Object(n)).forEach(function(r) {
|
|
12998
13004
|
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r));
|
|
12999
13005
|
});
|
|
@@ -13399,7 +13405,7 @@ var qy = (e, t) => {
|
|
|
13399
13405
|
return;
|
|
13400
13406
|
}
|
|
13401
13407
|
if (!Z.isRange(t))
|
|
13402
|
-
throw new Error("When setting the selection and the current selection is `null` you must provide at least an `anchor` and `focus`, but you passed: ".concat(
|
|
13408
|
+
throw new Error("When setting the selection and the current selection is `null` you must provide at least an `anchor` and `focus`, but you passed: ".concat(ot.stringify(t)));
|
|
13403
13409
|
e.apply({
|
|
13404
13410
|
type: "set_selection",
|
|
13405
13411
|
properties: n,
|
|
@@ -13420,7 +13426,7 @@ function Tl(e) {
|
|
|
13420
13426
|
for (var t = 1; t < arguments.length; t++) {
|
|
13421
13427
|
var n = arguments[t] != null ? arguments[t] : {};
|
|
13422
13428
|
t % 2 ? Bl(Object(n), !0).forEach(function(r) {
|
|
13423
|
-
|
|
13429
|
+
xt(e, r, n[r]);
|
|
13424
13430
|
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : Bl(Object(n)).forEach(function(r) {
|
|
13425
13431
|
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r));
|
|
13426
13432
|
});
|
|
@@ -13680,7 +13686,7 @@ var e1 = function(t, n) {
|
|
|
13680
13686
|
var O = dn(m, a1);
|
|
13681
13687
|
$ = f.children.length, B = O;
|
|
13682
13688
|
} else
|
|
13683
|
-
throw new Error("Cannot merge the node at path [".concat(v, "] with the previous sibling because it is not the same kind: ").concat(
|
|
13689
|
+
throw new Error("Cannot merge the node at path [".concat(v, "] with the previous sibling because it is not the same kind: ").concat(ot.stringify(m), " ").concat(ot.stringify(f)));
|
|
13684
13690
|
C || Q.moveNodes(t, {
|
|
13685
13691
|
at: v,
|
|
13686
13692
|
to: g,
|
|
@@ -13984,7 +13990,7 @@ function jl(e) {
|
|
|
13984
13990
|
for (var t = 1; t < arguments.length; t++) {
|
|
13985
13991
|
var n = arguments[t] != null ? arguments[t] : {};
|
|
13986
13992
|
t % 2 ? Sl(Object(n), !0).forEach(function(r) {
|
|
13987
|
-
|
|
13993
|
+
xt(e, r, n[r]);
|
|
13988
13994
|
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : Sl(Object(n)).forEach(function(r) {
|
|
13989
13995
|
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r));
|
|
13990
13996
|
});
|
|
@@ -14927,7 +14933,7 @@ var jo = /* @__PURE__ */ Ft(null), Fn = () => {
|
|
|
14927
14933
|
if (!e)
|
|
14928
14934
|
throw new Error("The `useSlateStatic` hook must be used inside the <Slate> component's context.");
|
|
14929
14935
|
return e;
|
|
14930
|
-
}, gf = parseInt(te.version.split(".")[0], 10), W1 = typeof navigator < "u" && typeof window < "u" && /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream, ql = typeof navigator < "u" && /Mac OS X/.test(navigator.userAgent),
|
|
14936
|
+
}, gf = parseInt(te.version.split(".")[0], 10), W1 = typeof navigator < "u" && typeof window < "u" && /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream, ql = typeof navigator < "u" && /Mac OS X/.test(navigator.userAgent), bt = typeof navigator < "u" && /Android/.test(navigator.userAgent), tr = typeof navigator < "u" && /^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent), Pr = typeof navigator < "u" && /AppleWebKit(?!.*Chrome)/i.test(navigator.userAgent), V1 = typeof navigator < "u" && /Edge?\/(?:[0-6][0-9]|[0-7][0-8])(?:\.)/i.test(navigator.userAgent), vf = typeof navigator < "u" && /Chrome/i.test(navigator.userAgent), H1 = typeof navigator < "u" && /Chrome?\/(?:[0-7][0-5]|[0-6][0-9])(?:\.)/i.test(navigator.userAgent), K1 = bt && typeof navigator < "u" && /Chrome?\/(?:[0-5]?\d)(?:\.)/i.test(navigator.userAgent), Z1 = typeof navigator < "u" && /^(?!.*Seamonkey)(?=.*Firefox\/(?:[0-7][0-9]|[0-8][0-6])(?:\.)).*/i.test(navigator.userAgent), Y1 = typeof navigator < "u" && /.*UCBrowser/.test(navigator.userAgent), G1 = typeof navigator < "u" && /.*Wechat/.test(navigator.userAgent) && !/.*MacWechat/.test(navigator.userAgent), Ni = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u", gn = (!H1 || !K1) && !V1 && // globalThis is undefined in older browsers
|
|
14931
14937
|
typeof globalThis < "u" && globalThis.InputEvent && // @ts-ignore The `getTargetRanges` property isn't recognized.
|
|
14932
14938
|
typeof globalThis.InputEvent.prototype.getTargetRanges == "function", Oo = /* @__PURE__ */ new WeakMap(), Po = /* @__PURE__ */ new WeakMap(), bf = /* @__PURE__ */ new WeakMap(), Mi = /* @__PURE__ */ new WeakMap(), Ls = /* @__PURE__ */ new WeakMap(), Jr = /* @__PURE__ */ new WeakMap(), Nn = /* @__PURE__ */ new WeakMap(), ia = /* @__PURE__ */ new WeakMap(), ba = /* @__PURE__ */ new WeakMap(), zs = /* @__PURE__ */ new WeakMap(), Dn = /* @__PURE__ */ new WeakMap(), jn = /* @__PURE__ */ new WeakMap(), Ir = /* @__PURE__ */ new WeakMap(), qs = /* @__PURE__ */ new WeakMap(), No = /* @__PURE__ */ new WeakMap(), Vt = /* @__PURE__ */ new WeakMap(), un = /* @__PURE__ */ new WeakMap(), Et = /* @__PURE__ */ new WeakMap(), bn = /* @__PURE__ */ new WeakMap(), yn = /* @__PURE__ */ new WeakMap(), yf = /* @__PURE__ */ new WeakMap(), hr = Symbol("placeholder"), xf = Symbol("mark-placeholder"), Q1 = globalThis.Text, Mo = (e) => e && e.ownerDocument && e.ownerDocument.defaultView || null, J1 = (e) => En(e) && e.nodeType === 8, $t = (e) => En(e) && e.nodeType === 1, En = (e) => {
|
|
14933
14939
|
var t = Mo(e);
|
|
@@ -15091,7 +15097,7 @@ var X = {
|
|
|
15091
15097
|
break;
|
|
15092
15098
|
n.unshift(a), r = i;
|
|
15093
15099
|
}
|
|
15094
|
-
throw new Error("Unable to find the path for Slate node: ".concat(
|
|
15100
|
+
throw new Error("Unable to find the path for Slate node: ".concat(ot.stringify(t)));
|
|
15095
15101
|
},
|
|
15096
15102
|
focus: function(t) {
|
|
15097
15103
|
var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
|
|
@@ -15170,7 +15176,7 @@ var X = {
|
|
|
15170
15176
|
toDOMNode: (e, t) => {
|
|
15171
15177
|
var n = ba.get(e), r = y.isEditor(t) ? Mi.get(e) : n == null ? void 0 : n.get(X.findKey(e, t));
|
|
15172
15178
|
if (!r)
|
|
15173
|
-
throw new Error("Cannot resolve a DOM node from Slate node: ".concat(
|
|
15179
|
+
throw new Error("Cannot resolve a DOM node from Slate node: ".concat(ot.stringify(t)));
|
|
15174
15180
|
return r;
|
|
15175
15181
|
},
|
|
15176
15182
|
toDOMPoint: (e, t) => {
|
|
@@ -15209,7 +15215,7 @@ var X = {
|
|
|
15209
15215
|
}
|
|
15210
15216
|
}
|
|
15211
15217
|
if (!i)
|
|
15212
|
-
throw new Error("Cannot resolve a DOM point from Slate point: ".concat(
|
|
15218
|
+
throw new Error("Cannot resolve a DOM point from Slate point: ".concat(ot.stringify(t)));
|
|
15213
15219
|
return i;
|
|
15214
15220
|
},
|
|
15215
15221
|
toDOMRange: (e, t) => {
|
|
@@ -15240,7 +15246,7 @@ var X = {
|
|
|
15240
15246
|
w.setStart(l, 0), w.setEnd(a, s);
|
|
15241
15247
|
var C = w.cloneContents(), A = [...Array.prototype.slice.call(C.querySelectorAll("[data-slate-zero-width]")), ...Array.prototype.slice.call(C.querySelectorAll("[contenteditable=false]"))];
|
|
15242
15248
|
A.forEach((j) => {
|
|
15243
|
-
if (
|
|
15249
|
+
if (bt && !r && j.hasAttribute("data-slate-zero-width") && j.textContent.length > 0 && j.textContext !== "\uFEFF") {
|
|
15244
15250
|
j.textContent.startsWith("\uFEFF") && (j.textContent = j.textContent.slice(1));
|
|
15245
15251
|
return;
|
|
15246
15252
|
}
|
|
@@ -15261,7 +15267,7 @@ var X = {
|
|
|
15261
15267
|
}
|
|
15262
15268
|
b && u === b.textContent.length && // COMPAT: Android IMEs might remove the zero width space while composing,
|
|
15263
15269
|
// and we don't add it for line-breaks.
|
|
15264
|
-
|
|
15270
|
+
bt && b.getAttribute("data-slate-zero-width") === "z" && (d = b.textContent) !== null && d !== void 0 && d.startsWith("\uFEFF") && // COMPAT: If the parent node is a Slate zero-width space, editor is
|
|
15265
15271
|
// because the text node should have no characters. However, during IME
|
|
15266
15272
|
// composition the ASCII characters will be prepended to the zero-width
|
|
15267
15273
|
// space, so subtract 1 from the offset to account for the zero-width
|
|
@@ -15273,7 +15279,7 @@ var X = {
|
|
|
15273
15279
|
|
|
15274
15280
|
`)) && u--;
|
|
15275
15281
|
}
|
|
15276
|
-
if (
|
|
15282
|
+
if (bt && !l && !r) {
|
|
15277
15283
|
var $ = o.hasAttribute("data-slate-node") ? o : o.closest("[data-slate-node]");
|
|
15278
15284
|
if ($ && X.hasDOMNode(e, $, {
|
|
15279
15285
|
editable: !0
|
|
@@ -15818,8 +15824,8 @@ function vx(e) {
|
|
|
15818
15824
|
case "deleteContentBackward": {
|
|
15819
15825
|
var Re, {
|
|
15820
15826
|
anchor: He
|
|
15821
|
-
} = P,
|
|
15822
|
-
return x &&
|
|
15827
|
+
} = P, nt = Us(U) ? U.isCollapsed : !!((Re = U) !== null && Re !== void 0 && Re.collapsed);
|
|
15828
|
+
return x && nt && Z.isCollapsed(P) && He.offset > 0 ? b(He.path, {
|
|
15823
15829
|
text: "",
|
|
15824
15830
|
start: He.offset - 1,
|
|
15825
15831
|
end: He.offset
|
|
@@ -16012,11 +16018,11 @@ var Dx = {
|
|
|
16012
16018
|
subtree: !0,
|
|
16013
16019
|
childList: !0,
|
|
16014
16020
|
characterData: !0
|
|
16015
|
-
}, Cx =
|
|
16021
|
+
}, Cx = bt ? (e) => {
|
|
16016
16022
|
var {
|
|
16017
16023
|
node: t
|
|
16018
16024
|
} = e, n = fr(e, xx);
|
|
16019
|
-
if (!
|
|
16025
|
+
if (!bt)
|
|
16020
16026
|
return null;
|
|
16021
16027
|
var r = Fn(), i = bx(), [a] = ue(() => vx(wx({
|
|
16022
16028
|
editor: r
|
|
@@ -16110,7 +16116,7 @@ var Tx = (e) => {
|
|
|
16110
16116
|
"data-slate-zero-width": n ? "n" : "z",
|
|
16111
16117
|
"data-slate-length": t
|
|
16112
16118
|
};
|
|
16113
|
-
return r && (i["data-slate-mark-placeholder"] = !0), /* @__PURE__ */ te.createElement("span", Bx({}, i), !
|
|
16119
|
+
return r && (i["data-slate-mark-placeholder"] = !0), /* @__PURE__ */ te.createElement("span", Bx({}, i), !bt || !n ? "\uFEFF" : null, n ? /* @__PURE__ */ te.createElement("br", null) : null);
|
|
16114
16120
|
};
|
|
16115
16121
|
function Yl(e, t) {
|
|
16116
16122
|
var n = Object.keys(e);
|
|
@@ -16133,7 +16139,7 @@ function Ff(e) {
|
|
|
16133
16139
|
}
|
|
16134
16140
|
return e;
|
|
16135
16141
|
}
|
|
16136
|
-
var jx =
|
|
16142
|
+
var jx = bt ? 300 : 0;
|
|
16137
16143
|
function Ox(e, t) {
|
|
16138
16144
|
e.current && (e.current.disconnect(), t && (e.current = null));
|
|
16139
16145
|
}
|
|
@@ -16510,7 +16516,7 @@ class Of extends Bh {
|
|
|
16510
16516
|
}
|
|
16511
16517
|
}
|
|
16512
16518
|
Lt(Of, "contextType", jo);
|
|
16513
|
-
var Qx =
|
|
16519
|
+
var Qx = bt ? Of : (e) => {
|
|
16514
16520
|
var {
|
|
16515
16521
|
children: t
|
|
16516
16522
|
} = e;
|
|
@@ -16567,7 +16573,7 @@ var ew = (e) => /* @__PURE__ */ te.createElement(te.Fragment, null, Tf(e)), tw =
|
|
|
16567
16573
|
}, [n]);
|
|
16568
16574
|
var L = Be(), R = Jt(() => Nb(() => {
|
|
16569
16575
|
var T = L.current;
|
|
16570
|
-
if ((
|
|
16576
|
+
if ((bt || !X.isComposing(f)) && (!O.isUpdatingSelection || T != null && T.isFlushing()) && !O.isDraggingInternally) {
|
|
16571
16577
|
var z = X.findDocumentOrShadowRoot(f), {
|
|
16572
16578
|
activeElement: S
|
|
16573
16579
|
} = z, I = X.toDOMNode(f, f), G = z.getSelection();
|
|
@@ -16607,8 +16613,8 @@ var ew = (e) => /* @__PURE__ */ te.createElement(te.Fragment, null, Tf(e)), tw =
|
|
|
16607
16613
|
Ve.startContainer === we ? ke = Re.endContainer : ke = Ve.startContainer;
|
|
16608
16614
|
} else
|
|
16609
16615
|
ke = K.anchorNode;
|
|
16610
|
-
var He = Mi.get(f),
|
|
16611
|
-
if (He.contains(ke) && He.contains(we) && (
|
|
16616
|
+
var He = Mi.get(f), nt = !1;
|
|
16617
|
+
if (He.contains(ke) && He.contains(we) && (nt = !0), Se && nt && I && !me) {
|
|
16612
16618
|
var Pe = X.toSlateRange(f, K, {
|
|
16613
16619
|
exactMatch: !0,
|
|
16614
16620
|
// domSelection is not necessarily a valid Slate range
|
|
@@ -16630,12 +16636,12 @@ var ew = (e) => /* @__PURE__ */ te.createElement(te.Fragment, null, Tf(e)), tw =
|
|
|
16630
16636
|
}
|
|
16631
16637
|
O.isUpdatingSelection = !0;
|
|
16632
16638
|
var De = I && X.toDOMRange(f, I);
|
|
16633
|
-
return De ? (X.isComposing(f) && !
|
|
16639
|
+
return De ? (X.isComposing(f) && !bt ? K.collapseToEnd() : Z.isBackward(I) ? K.setBaseAndExtent(De.endContainer, De.endOffset, De.startContainer, De.startOffset) : K.setBaseAndExtent(De.startContainer, De.startOffset, De.endContainer, De.endOffset), d(f, De)) : K.removeAllRanges(), De;
|
|
16634
16640
|
}
|
|
16635
16641
|
};
|
|
16636
16642
|
K.rangeCount <= 1 && J();
|
|
16637
16643
|
var de = ((z = L.current) === null || z === void 0 ? void 0 : z.isFlushing()) === "action";
|
|
16638
|
-
if (!
|
|
16644
|
+
if (!bt || !de) {
|
|
16639
16645
|
setTimeout(() => {
|
|
16640
16646
|
O.isUpdatingSelection = !1;
|
|
16641
16647
|
});
|
|
@@ -16699,9 +16705,9 @@ var ew = (e) => /* @__PURE__ */ te.createElement(te.Fragment, null, Tf(e)), tw =
|
|
|
16699
16705
|
}
|
|
16700
16706
|
}
|
|
16701
16707
|
if (!I.startsWith("delete") || I.startsWith("deleteBy")) {
|
|
16702
|
-
var [
|
|
16703
|
-
if (
|
|
16704
|
-
var Pe = X.toSlateRange(f,
|
|
16708
|
+
var [nt] = T.getTargetRanges();
|
|
16709
|
+
if (nt) {
|
|
16710
|
+
var Pe = X.toSlateRange(f, nt, {
|
|
16705
16711
|
exactMatch: !1,
|
|
16706
16712
|
suppressThrow: !1
|
|
16707
16713
|
});
|
|
@@ -16905,13 +16911,13 @@ var ew = (e) => /* @__PURE__ */ te.createElement(te.Fragment, null, Tf(e)), tw =
|
|
|
16905
16911
|
minHeight: A
|
|
16906
16912
|
} : {})), h),
|
|
16907
16913
|
onBeforeInput: Me((T) => {
|
|
16908
|
-
if (!gn && !s && !
|
|
16914
|
+
if (!gn && !s && !gt(T, v.onBeforeInput) && X.hasSelectableTarget(f, T.target) && (T.preventDefault(), !X.isComposing(f))) {
|
|
16909
16915
|
var z = T.data;
|
|
16910
16916
|
y.insertText(f, z);
|
|
16911
16917
|
}
|
|
16912
16918
|
}, [v.onBeforeInput, f, s]),
|
|
16913
16919
|
onInput: Me((T) => {
|
|
16914
|
-
if (!
|
|
16920
|
+
if (!gt(T, v.onInput)) {
|
|
16915
16921
|
if (L.current) {
|
|
16916
16922
|
L.current.handleInput();
|
|
16917
16923
|
return;
|
|
@@ -16922,7 +16928,7 @@ var ew = (e) => /* @__PURE__ */ te.createElement(te.Fragment, null, Tf(e)), tw =
|
|
|
16922
16928
|
}
|
|
16923
16929
|
}, [v.onInput]),
|
|
16924
16930
|
onBlur: Me((T) => {
|
|
16925
|
-
if (!(s || O.isUpdatingSelection || !X.hasSelectableTarget(f, T.target) ||
|
|
16931
|
+
if (!(s || O.isUpdatingSelection || !X.hasSelectableTarget(f, T.target) || gt(T, v.onBlur))) {
|
|
16926
16932
|
var z = X.findDocumentOrShadowRoot(f);
|
|
16927
16933
|
if (O.latestElement !== z.activeElement) {
|
|
16928
16934
|
var {
|
|
@@ -16944,7 +16950,7 @@ var ew = (e) => /* @__PURE__ */ te.createElement(te.Fragment, null, Tf(e)), tw =
|
|
|
16944
16950
|
}
|
|
16945
16951
|
}, [s, O.isUpdatingSelection, O.latestElement, f, v.onBlur]),
|
|
16946
16952
|
onClick: Me((T) => {
|
|
16947
|
-
if (X.hasTarget(f, T.target) && !
|
|
16953
|
+
if (X.hasTarget(f, T.target) && !gt(T, v.onClick) && En(T.target)) {
|
|
16948
16954
|
var z = X.toSlateNode(f, T.target), S = X.findPath(f, z);
|
|
16949
16955
|
if (!y.hasPath(f, S) || oe.get(f, S) !== z)
|
|
16950
16956
|
return;
|
|
@@ -16979,7 +16985,7 @@ var ew = (e) => /* @__PURE__ */ te.createElement(te.Fragment, null, Tf(e)), tw =
|
|
|
16979
16985
|
var z;
|
|
16980
16986
|
if (X.isComposing(f) && Promise.resolve().then(() => {
|
|
16981
16987
|
g(!1), jn.set(f, !1);
|
|
16982
|
-
}), (z = L.current) === null || z === void 0 || z.handleCompositionEnd(T),
|
|
16988
|
+
}), (z = L.current) === null || z === void 0 || z.handleCompositionEnd(T), gt(T, v.onCompositionEnd) || bt)
|
|
16983
16989
|
return;
|
|
16984
16990
|
if (!Pr && !Z1 && !W1 && !G1 && !Y1 && T.data) {
|
|
16985
16991
|
var S = Vt.get(f);
|
|
@@ -16990,12 +16996,12 @@ var ew = (e) => /* @__PURE__ */ te.createElement(te.Fragment, null, Tf(e)), tw =
|
|
|
16990
16996
|
}
|
|
16991
16997
|
}, [v.onCompositionEnd, f]),
|
|
16992
16998
|
onCompositionUpdate: Me((T) => {
|
|
16993
|
-
X.hasSelectableTarget(f, T.target) && !
|
|
16999
|
+
X.hasSelectableTarget(f, T.target) && !gt(T, v.onCompositionUpdate) && (X.isComposing(f) || (g(!0), jn.set(f, !0)));
|
|
16994
17000
|
}, [v.onCompositionUpdate, f]),
|
|
16995
17001
|
onCompositionStart: Me((T) => {
|
|
16996
17002
|
if (X.hasSelectableTarget(f, T.target)) {
|
|
16997
17003
|
var z;
|
|
16998
|
-
if ((z = L.current) === null || z === void 0 || z.handleCompositionStart(T),
|
|
17004
|
+
if ((z = L.current) === null || z === void 0 || z.handleCompositionStart(T), gt(T, v.onCompositionStart) || bt)
|
|
16999
17005
|
return;
|
|
17000
17006
|
g(!0);
|
|
17001
17007
|
var {
|
|
@@ -17008,10 +17014,10 @@ var ew = (e) => /* @__PURE__ */ te.createElement(te.Fragment, null, Tf(e)), tw =
|
|
|
17008
17014
|
}
|
|
17009
17015
|
}, [v.onCompositionStart, f]),
|
|
17010
17016
|
onCopy: Me((T) => {
|
|
17011
|
-
X.hasSelectableTarget(f, T.target) && !
|
|
17017
|
+
X.hasSelectableTarget(f, T.target) && !gt(T, v.onCopy) && !Xl(T) && (T.preventDefault(), X.setFragmentData(f, T.clipboardData, "copy"));
|
|
17012
17018
|
}, [v.onCopy, f]),
|
|
17013
17019
|
onCut: Me((T) => {
|
|
17014
|
-
if (!s && X.hasSelectableTarget(f, T.target) && !
|
|
17020
|
+
if (!s && X.hasSelectableTarget(f, T.target) && !gt(T, v.onCut) && !Xl(T)) {
|
|
17015
17021
|
T.preventDefault(), X.setFragmentData(f, T.clipboardData, "cut");
|
|
17016
17022
|
var {
|
|
17017
17023
|
selection: z
|
|
@@ -17026,13 +17032,13 @@ var ew = (e) => /* @__PURE__ */ te.createElement(te.Fragment, null, Tf(e)), tw =
|
|
|
17026
17032
|
}
|
|
17027
17033
|
}, [s, f, v.onCut]),
|
|
17028
17034
|
onDragOver: Me((T) => {
|
|
17029
|
-
if (X.hasTarget(f, T.target) && !
|
|
17035
|
+
if (X.hasTarget(f, T.target) && !gt(T, v.onDragOver)) {
|
|
17030
17036
|
var z = X.toSlateNode(f, T.target);
|
|
17031
17037
|
he.isElement(z) && y.isVoid(f, z) && T.preventDefault();
|
|
17032
17038
|
}
|
|
17033
17039
|
}, [v.onDragOver, f]),
|
|
17034
17040
|
onDragStart: Me((T) => {
|
|
17035
|
-
if (!s && X.hasTarget(f, T.target) && !
|
|
17041
|
+
if (!s && X.hasTarget(f, T.target) && !gt(T, v.onDragStart)) {
|
|
17036
17042
|
var z = X.toSlateNode(f, T.target), S = X.findPath(f, z), I = he.isElement(z) && y.isVoid(f, z) || y.void(f, {
|
|
17037
17043
|
at: S,
|
|
17038
17044
|
voids: !0
|
|
@@ -17045,7 +17051,7 @@ var ew = (e) => /* @__PURE__ */ te.createElement(te.Fragment, null, Tf(e)), tw =
|
|
|
17045
17051
|
}
|
|
17046
17052
|
}, [s, f, v.onDragStart, O]),
|
|
17047
17053
|
onDrop: Me((T) => {
|
|
17048
|
-
if (!s && X.hasTarget(f, T.target) && !
|
|
17054
|
+
if (!s && X.hasTarget(f, T.target) && !gt(T, v.onDrop)) {
|
|
17049
17055
|
T.preventDefault();
|
|
17050
17056
|
var z = f.selection, S = X.findEventRange(f, T), I = T.dataTransfer;
|
|
17051
17057
|
Q.select(f, S), O.isDraggingInternally && z && !Z.equals(z, S) && !y.void(f, {
|
|
@@ -17061,7 +17067,7 @@ var ew = (e) => /* @__PURE__ */ te.createElement(te.Fragment, null, Tf(e)), tw =
|
|
|
17061
17067
|
!s && O.isDraggingInternally && v.onDragEnd && X.hasTarget(f, T.target) && v.onDragEnd(T), O.isDraggingInternally = !1;
|
|
17062
17068
|
}, [s, O, v, f]),
|
|
17063
17069
|
onFocus: Me((T) => {
|
|
17064
|
-
if (!s && !O.isUpdatingSelection && X.hasEditableTarget(f, T.target) && !
|
|
17070
|
+
if (!s && !O.isUpdatingSelection && X.hasEditableTarget(f, T.target) && !gt(T, v.onFocus)) {
|
|
17065
17071
|
var z = X.toDOMNode(f, f), S = X.findDocumentOrShadowRoot(f);
|
|
17066
17072
|
if (O.latestElement = S.activeElement, tr && T.target !== z) {
|
|
17067
17073
|
z.focus();
|
|
@@ -17077,7 +17083,7 @@ var ew = (e) => /* @__PURE__ */ te.createElement(te.Fragment, null, Tf(e)), tw =
|
|
|
17077
17083
|
var {
|
|
17078
17084
|
nativeEvent: S
|
|
17079
17085
|
} = T;
|
|
17080
|
-
if (X.isComposing(f) && S.isComposing === !1 && (jn.set(f, !1), g(!1)),
|
|
17086
|
+
if (X.isComposing(f) && S.isComposing === !1 && (jn.set(f, !1), g(!1)), gt(T, v.onKeyDown) || X.isComposing(f))
|
|
17081
17087
|
return;
|
|
17082
17088
|
var {
|
|
17083
17089
|
selection: I
|
|
@@ -17227,7 +17233,7 @@ var ew = (e) => /* @__PURE__ */ te.createElement(te.Fragment, null, Tf(e)), tw =
|
|
|
17227
17233
|
}
|
|
17228
17234
|
}, [s, f, v.onKeyDown]),
|
|
17229
17235
|
onPaste: Me((T) => {
|
|
17230
|
-
!s && X.hasEditableTarget(f, T.target) && !
|
|
17236
|
+
!s && X.hasEditableTarget(f, T.target) && !gt(T, v.onPaste) && (!gn || X1(T.nativeEvent) || Pr) && (T.preventDefault(), X.insertData(f, T.clipboardData));
|
|
17231
17237
|
}, [s, f, v.onPaste])
|
|
17232
17238
|
}), /* @__PURE__ */ te.createElement(ew, {
|
|
17233
17239
|
decorations: P,
|
|
@@ -17245,7 +17251,7 @@ var ew = (e) => /* @__PURE__ */ te.createElement(te.Fragment, null, Tf(e)), tw =
|
|
|
17245
17251
|
return (
|
|
17246
17252
|
// COMPAT: Artificially add a line-break to the end on the placeholder element
|
|
17247
17253
|
// to prevent Android IMEs to pick up its content in autocorrect and to auto-capitalize the first letter
|
|
17248
|
-
/* @__PURE__ */ te.createElement("span", Yt({}, t), n,
|
|
17254
|
+
/* @__PURE__ */ te.createElement("span", Yt({}, t), n, bt && /* @__PURE__ */ te.createElement("br", null))
|
|
17249
17255
|
);
|
|
17250
17256
|
}, rw = () => [], iw = (e, t) => {
|
|
17251
17257
|
if (t.getBoundingClientRect && (!e.selection || e.selection && Z.isCollapsed(e.selection))) {
|
|
@@ -17254,7 +17260,7 @@ var ew = (e) => /* @__PURE__ */ te.createElement(te.Fragment, null, Tf(e)), tw =
|
|
|
17254
17260
|
scrollMode: "if-needed"
|
|
17255
17261
|
}), delete n.getBoundingClientRect;
|
|
17256
17262
|
}
|
|
17257
|
-
},
|
|
17263
|
+
}, gt = (e, t) => {
|
|
17258
17264
|
if (!t)
|
|
17259
17265
|
return !1;
|
|
17260
17266
|
var n = t(e);
|
|
@@ -17291,9 +17297,9 @@ var lw = ["editor", "children", "onChange", "onSelectionChange", "onValueChange"
|
|
|
17291
17297
|
initialValue: s
|
|
17292
17298
|
} = e, o = fr(e, lw), [l, u] = te.useState(() => {
|
|
17293
17299
|
if (!oe.isNodeList(s))
|
|
17294
|
-
throw new Error("[Slate] initialValue is invalid! Expected a list of elements but got: ".concat(
|
|
17300
|
+
throw new Error("[Slate] initialValue is invalid! Expected a list of elements but got: ".concat(ot.stringify(s)));
|
|
17295
17301
|
if (!y.isEditor(t))
|
|
17296
|
-
throw new Error("[Slate] editor is invalid! You passed: ".concat(
|
|
17302
|
+
throw new Error("[Slate] editor is invalid! You passed: ".concat(ot.stringify(t)));
|
|
17297
17303
|
return t.children = s, Object.assign(t, o), {
|
|
17298
17304
|
v: 0,
|
|
17299
17305
|
editor: t
|
|
@@ -17596,7 +17602,7 @@ const Ks = "MENTION: ", Pf = {
|
|
|
17596
17602
|
n(null);
|
|
17597
17603
|
}, [e, e.selection]), t;
|
|
17598
17604
|
};
|
|
17599
|
-
var
|
|
17605
|
+
var vt = /* @__PURE__ */ ((e) => (e.paragraph = "paragraph", e.heading = "heading", e.list = "list", e.listItem = "listItem", e.link = "link", e.mention = "mention", e.image = "image", e.blockquote = "blockquote", e.code = "code", e.html = "html", e.emphasis = "emphasis", e.strong = "strong", e.delete = "delete", e.inlineCode = "inlineCode", e.thematicBreak = "thematicBreak", e.text = "text", e.h3 = "heading_three", e))(vt || {});
|
|
17600
17606
|
const nr = {
|
|
17601
17607
|
[V.paragraph]: V.paragraph,
|
|
17602
17608
|
[V.blockquote]: V.blockquote,
|
|
@@ -20552,7 +20558,7 @@ function nC(e, t, n) {
|
|
|
20552
20558
|
return u === i ? (e.consume(u), r++, l) : (e.exit("thematicBreakSequence"), ze(u) ? Ye(e, o, "whitespace")(u) : o(u));
|
|
20553
20559
|
}
|
|
20554
20560
|
}
|
|
20555
|
-
const
|
|
20561
|
+
const Dt = {
|
|
20556
20562
|
name: "list",
|
|
20557
20563
|
tokenize: aC,
|
|
20558
20564
|
continuation: {
|
|
@@ -20613,7 +20619,7 @@ function sC(e, t, n) {
|
|
|
20613
20619
|
return r.containerState.furtherBlankLines || !ze(o) ? (r.containerState.furtherBlankLines = void 0, r.containerState.initialBlankLine = void 0, s(o)) : (r.containerState.furtherBlankLines = void 0, r.containerState.initialBlankLine = void 0, e.attempt(iC, t, s)(o));
|
|
20614
20620
|
}
|
|
20615
20621
|
function s(o) {
|
|
20616
|
-
return r.containerState._closeFlow = !0, r.interrupt = void 0, Ye(e, e.attempt(
|
|
20622
|
+
return r.containerState._closeFlow = !0, r.interrupt = void 0, Ye(e, e.attempt(Dt, t, n), "linePrefix", r.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(o);
|
|
20617
20623
|
}
|
|
20618
20624
|
}
|
|
20619
20625
|
function oC(e, t, n) {
|
|
@@ -21028,19 +21034,19 @@ function xC(e, t) {
|
|
|
21028
21034
|
return r.join("");
|
|
21029
21035
|
}
|
|
21030
21036
|
const wC = {
|
|
21031
|
-
42:
|
|
21032
|
-
43:
|
|
21033
|
-
45:
|
|
21034
|
-
48:
|
|
21035
|
-
49:
|
|
21036
|
-
50:
|
|
21037
|
-
51:
|
|
21038
|
-
52:
|
|
21039
|
-
53:
|
|
21040
|
-
54:
|
|
21041
|
-
55:
|
|
21042
|
-
56:
|
|
21043
|
-
57:
|
|
21037
|
+
42: Dt,
|
|
21038
|
+
43: Dt,
|
|
21039
|
+
45: Dt,
|
|
21040
|
+
48: Dt,
|
|
21041
|
+
49: Dt,
|
|
21042
|
+
50: Dt,
|
|
21043
|
+
51: Dt,
|
|
21044
|
+
52: Dt,
|
|
21045
|
+
53: Dt,
|
|
21046
|
+
54: Dt,
|
|
21047
|
+
55: Dt,
|
|
21048
|
+
56: Dt,
|
|
21049
|
+
57: Dt,
|
|
21044
21050
|
62: If
|
|
21045
21051
|
}, DC = {
|
|
21046
21052
|
91: CD
|
|
@@ -21214,7 +21220,7 @@ function $C(e) {
|
|
|
21214
21220
|
listItemValue: p,
|
|
21215
21221
|
listOrdered: a(Re, h),
|
|
21216
21222
|
listUnordered: a(Re),
|
|
21217
|
-
paragraph: a(
|
|
21223
|
+
paragraph: a(nt),
|
|
21218
21224
|
reference: E,
|
|
21219
21225
|
referenceString: s,
|
|
21220
21226
|
resourceDestinationString: s,
|
|
@@ -21337,18 +21343,18 @@ function $C(e) {
|
|
|
21337
21343
|
return re;
|
|
21338
21344
|
}
|
|
21339
21345
|
function i(W, re, ge) {
|
|
21340
|
-
let ye = re - 1, Ae = -1, be = !1, Fe, Xe,
|
|
21346
|
+
let ye = re - 1, Ae = -1, be = !1, Fe, Xe, st, wt;
|
|
21341
21347
|
for (; ++ye <= ge; ) {
|
|
21342
|
-
const
|
|
21343
|
-
switch (
|
|
21348
|
+
const rt = W[ye];
|
|
21349
|
+
switch (rt[1].type) {
|
|
21344
21350
|
case "listUnordered":
|
|
21345
21351
|
case "listOrdered":
|
|
21346
21352
|
case "blockQuote": {
|
|
21347
|
-
|
|
21353
|
+
rt[0] === "enter" ? Ae++ : Ae--, wt = void 0;
|
|
21348
21354
|
break;
|
|
21349
21355
|
}
|
|
21350
21356
|
case "lineEndingBlank": {
|
|
21351
|
-
|
|
21357
|
+
rt[0] === "enter" && (Fe && !wt && !Ae && !st && (st = ye), wt = void 0);
|
|
21352
21358
|
break;
|
|
21353
21359
|
}
|
|
21354
21360
|
case "linePrefix":
|
|
@@ -21358,9 +21364,9 @@ function $C(e) {
|
|
|
21358
21364
|
case "listItemPrefixWhitespace":
|
|
21359
21365
|
break;
|
|
21360
21366
|
default:
|
|
21361
|
-
|
|
21367
|
+
wt = void 0;
|
|
21362
21368
|
}
|
|
21363
|
-
if (!Ae &&
|
|
21369
|
+
if (!Ae && rt[0] === "enter" && rt[1].type === "listItemPrefix" || Ae === -1 && rt[0] === "exit" && (rt[1].type === "listUnordered" || rt[1].type === "listOrdered")) {
|
|
21364
21370
|
if (Fe) {
|
|
21365
21371
|
let Bt = ye;
|
|
21366
21372
|
for (Xe = void 0; Bt--; ) {
|
|
@@ -21372,20 +21378,20 @@ function $C(e) {
|
|
|
21372
21378
|
} else if (!(Tt[1].type === "linePrefix" || Tt[1].type === "blockQuotePrefix" || Tt[1].type === "blockQuotePrefixWhitespace" || Tt[1].type === "blockQuoteMarker" || Tt[1].type === "listItemIndent"))
|
|
21373
21379
|
break;
|
|
21374
21380
|
}
|
|
21375
|
-
|
|
21381
|
+
st && (!Xe || st < Xe) && (Fe._spread = !0), Fe.end = Object.assign(
|
|
21376
21382
|
{},
|
|
21377
|
-
Xe ? W[Xe][1].start :
|
|
21378
|
-
), W.splice(Xe || ye, 0, ["exit", Fe,
|
|
21383
|
+
Xe ? W[Xe][1].start : rt[1].end
|
|
21384
|
+
), W.splice(Xe || ye, 0, ["exit", Fe, rt[2]]), ye++, ge++;
|
|
21379
21385
|
}
|
|
21380
|
-
if (
|
|
21386
|
+
if (rt[1].type === "listItemPrefix") {
|
|
21381
21387
|
const Bt = {
|
|
21382
21388
|
type: "listItem",
|
|
21383
21389
|
_spread: !1,
|
|
21384
|
-
start: Object.assign({},
|
|
21390
|
+
start: Object.assign({}, rt[1].start),
|
|
21385
21391
|
// @ts-expect-error: we’ll add `end` in a second.
|
|
21386
21392
|
end: void 0
|
|
21387
21393
|
};
|
|
21388
|
-
Fe = Bt, W.splice(ye, 0, ["enter", Bt,
|
|
21394
|
+
Fe = Bt, W.splice(ye, 0, ["enter", Bt, rt[2]]), ye++, ge++, st = void 0, wt = !0;
|
|
21389
21395
|
}
|
|
21390
21396
|
}
|
|
21391
21397
|
}
|
|
@@ -21688,7 +21694,7 @@ function $C(e) {
|
|
|
21688
21694
|
children: []
|
|
21689
21695
|
};
|
|
21690
21696
|
}
|
|
21691
|
-
function
|
|
21697
|
+
function nt() {
|
|
21692
21698
|
return {
|
|
21693
21699
|
type: "paragraph",
|
|
21694
21700
|
children: []
|
|
@@ -21801,7 +21807,7 @@ function Gf(e, t) {
|
|
|
21801
21807
|
t
|
|
21802
21808
|
)
|
|
21803
21809
|
)), e.type) {
|
|
21804
|
-
case
|
|
21810
|
+
case vt.heading:
|
|
21805
21811
|
return {
|
|
21806
21812
|
type: n[V.heading][e.depth || 1],
|
|
21807
21813
|
// we need to flag the type of heading in the children to ensure it renders as the correct heading type
|
|
@@ -21810,67 +21816,67 @@ function Gf(e, t) {
|
|
|
21810
21816
|
[n[V.heading][e.depth || 1]]: !0
|
|
21811
21817
|
}))
|
|
21812
21818
|
};
|
|
21813
|
-
case
|
|
21819
|
+
case vt.list:
|
|
21814
21820
|
return {
|
|
21815
21821
|
type: e.ordered ? n[V.ol] : n[V.ul],
|
|
21816
21822
|
children: s
|
|
21817
21823
|
};
|
|
21818
|
-
case
|
|
21824
|
+
case vt.listItem:
|
|
21819
21825
|
return { type: n[V.li], children: s };
|
|
21820
|
-
case
|
|
21826
|
+
case vt.paragraph:
|
|
21821
21827
|
return { type: n[V.paragraph], children: s };
|
|
21822
|
-
case
|
|
21828
|
+
case vt.link:
|
|
21823
21829
|
return {
|
|
21824
21830
|
type: n[V.link],
|
|
21825
21831
|
[r]: e.url,
|
|
21826
21832
|
children: s
|
|
21827
21833
|
};
|
|
21828
|
-
case
|
|
21834
|
+
case vt.image:
|
|
21829
21835
|
return {
|
|
21830
21836
|
type: n[V.image],
|
|
21831
21837
|
children: [{ text: "" }],
|
|
21832
21838
|
[i]: e.url,
|
|
21833
21839
|
[a]: e.alt
|
|
21834
21840
|
};
|
|
21835
|
-
case
|
|
21841
|
+
case vt.blockquote:
|
|
21836
21842
|
return { type: n[V.blockquote], children: s };
|
|
21837
|
-
case
|
|
21843
|
+
case vt.code:
|
|
21838
21844
|
return {
|
|
21839
21845
|
type: n[V.codeblock],
|
|
21840
21846
|
language: e.lang,
|
|
21841
21847
|
children: [{ text: e.value }]
|
|
21842
21848
|
};
|
|
21843
|
-
case
|
|
21849
|
+
case vt.html:
|
|
21844
21850
|
return (u = e.value) != null && u.includes("<br>") ? {
|
|
21845
21851
|
break: !0,
|
|
21846
21852
|
type: n[V.paragraph],
|
|
21847
21853
|
children: [{ text: ((d = e.value) == null ? void 0 : d.replace(/<br>/g, "")) || "" }]
|
|
21848
21854
|
} : { type: V.paragraph, children: [{ text: e.value || "" }] };
|
|
21849
|
-
case
|
|
21855
|
+
case vt.emphasis:
|
|
21850
21856
|
return {
|
|
21851
21857
|
[n[on.emphasis]]: !0,
|
|
21852
21858
|
...ss(s),
|
|
21853
21859
|
..._i(s)
|
|
21854
21860
|
};
|
|
21855
|
-
case
|
|
21861
|
+
case vt.strong:
|
|
21856
21862
|
return {
|
|
21857
21863
|
[n[on.strong]]: !0,
|
|
21858
21864
|
...ss(s),
|
|
21859
21865
|
..._i(s)
|
|
21860
21866
|
};
|
|
21861
|
-
case
|
|
21867
|
+
case vt.delete:
|
|
21862
21868
|
return {
|
|
21863
21869
|
[n[on.delete]]: !0,
|
|
21864
21870
|
...ss(s),
|
|
21865
21871
|
..._i(s)
|
|
21866
21872
|
};
|
|
21867
|
-
case
|
|
21873
|
+
case vt.inlineCode:
|
|
21868
21874
|
return {
|
|
21869
21875
|
[n[on.code]]: !0,
|
|
21870
21876
|
text: e.value,
|
|
21871
21877
|
..._i(s)
|
|
21872
21878
|
};
|
|
21873
|
-
case
|
|
21879
|
+
case vt.thematicBreak:
|
|
21874
21880
|
return {
|
|
21875
21881
|
type: n[V.hr],
|
|
21876
21882
|
children: [{ text: "" }]
|
|
@@ -22828,8 +22834,8 @@ function lh(e, t) {
|
|
|
22828
22834
|
return e.getElementsByTagName(n).length;
|
|
22829
22835
|
});
|
|
22830
22836
|
}
|
|
22831
|
-
var
|
|
22832
|
-
|
|
22837
|
+
var mt = {};
|
|
22838
|
+
mt.paragraph = {
|
|
22833
22839
|
filter: "p",
|
|
22834
22840
|
replacement: function(e) {
|
|
22835
22841
|
return `
|
|
@@ -22839,14 +22845,14 @@ pt.paragraph = {
|
|
|
22839
22845
|
`;
|
|
22840
22846
|
}
|
|
22841
22847
|
};
|
|
22842
|
-
|
|
22848
|
+
mt.lineBreak = {
|
|
22843
22849
|
filter: "br",
|
|
22844
22850
|
replacement: function(e, t, n) {
|
|
22845
22851
|
return n.br + `
|
|
22846
22852
|
`;
|
|
22847
22853
|
}
|
|
22848
22854
|
};
|
|
22849
|
-
|
|
22855
|
+
mt.heading = {
|
|
22850
22856
|
filter: ["h1", "h2", "h3", "h4", "h5", "h6"],
|
|
22851
22857
|
replacement: function(e, t, n) {
|
|
22852
22858
|
var r = Number(t.nodeName.charAt(1));
|
|
@@ -22866,7 +22872,7 @@ pt.heading = {
|
|
|
22866
22872
|
`;
|
|
22867
22873
|
}
|
|
22868
22874
|
};
|
|
22869
|
-
|
|
22875
|
+
mt.blockquote = {
|
|
22870
22876
|
filter: "blockquote",
|
|
22871
22877
|
replacement: function(e) {
|
|
22872
22878
|
return e = e.replace(/^\n+|\n+$/g, ""), e = e.replace(/^/gm, "> "), `
|
|
@@ -22876,7 +22882,7 @@ pt.blockquote = {
|
|
|
22876
22882
|
`;
|
|
22877
22883
|
}
|
|
22878
22884
|
};
|
|
22879
|
-
|
|
22885
|
+
mt.list = {
|
|
22880
22886
|
filter: ["ul", "ol"],
|
|
22881
22887
|
replacement: function(e, t) {
|
|
22882
22888
|
var n = t.parentNode;
|
|
@@ -22888,7 +22894,7 @@ pt.list = {
|
|
|
22888
22894
|
`;
|
|
22889
22895
|
}
|
|
22890
22896
|
};
|
|
22891
|
-
|
|
22897
|
+
mt.listItem = {
|
|
22892
22898
|
filter: "li",
|
|
22893
22899
|
replacement: function(e, t, n) {
|
|
22894
22900
|
e = e.replace(/^\n+/, "").replace(/\n+$/, `
|
|
@@ -22903,7 +22909,7 @@ pt.listItem = {
|
|
|
22903
22909
|
` : "");
|
|
22904
22910
|
}
|
|
22905
22911
|
};
|
|
22906
|
-
|
|
22912
|
+
mt.indentedCodeBlock = {
|
|
22907
22913
|
filter: function(e, t) {
|
|
22908
22914
|
return t.codeBlockStyle === "indented" && e.nodeName === "PRE" && e.firstChild && e.firstChild.nodeName === "CODE";
|
|
22909
22915
|
},
|
|
@@ -22916,7 +22922,7 @@ pt.indentedCodeBlock = {
|
|
|
22916
22922
|
`;
|
|
22917
22923
|
}
|
|
22918
22924
|
};
|
|
22919
|
-
|
|
22925
|
+
mt.fencedCodeBlock = {
|
|
22920
22926
|
filter: function(e, t) {
|
|
22921
22927
|
return t.codeBlockStyle === "fenced" && e.nodeName === "PRE" && e.firstChild && e.firstChild.nodeName === "CODE";
|
|
22922
22928
|
},
|
|
@@ -22933,7 +22939,7 @@ pt.fencedCodeBlock = {
|
|
|
22933
22939
|
`;
|
|
22934
22940
|
}
|
|
22935
22941
|
};
|
|
22936
|
-
|
|
22942
|
+
mt.horizontalRule = {
|
|
22937
22943
|
filter: "hr",
|
|
22938
22944
|
replacement: function(e, t, n) {
|
|
22939
22945
|
return `
|
|
@@ -22943,7 +22949,7 @@ pt.horizontalRule = {
|
|
|
22943
22949
|
`;
|
|
22944
22950
|
}
|
|
22945
22951
|
};
|
|
22946
|
-
|
|
22952
|
+
mt.inlineLink = {
|
|
22947
22953
|
filter: function(e, t) {
|
|
22948
22954
|
return t.linkStyle === "inlined" && e.nodeName === "A" && e.getAttribute("href");
|
|
22949
22955
|
},
|
|
@@ -22952,7 +22958,7 @@ pt.inlineLink = {
|
|
|
22952
22958
|
return r && (r = ' "' + r + '"'), "[" + e + "](" + n + r + ")";
|
|
22953
22959
|
}
|
|
22954
22960
|
};
|
|
22955
|
-
|
|
22961
|
+
mt.referenceLink = {
|
|
22956
22962
|
filter: function(e, t) {
|
|
22957
22963
|
return t.linkStyle === "referenced" && e.nodeName === "A" && e.getAttribute("href");
|
|
22958
22964
|
},
|
|
@@ -22984,19 +22990,19 @@ pt.referenceLink = {
|
|
|
22984
22990
|
`, this.references = []), t;
|
|
22985
22991
|
}
|
|
22986
22992
|
};
|
|
22987
|
-
|
|
22993
|
+
mt.emphasis = {
|
|
22988
22994
|
filter: ["em", "i"],
|
|
22989
22995
|
replacement: function(e, t, n) {
|
|
22990
22996
|
return e.trim() ? n.emDelimiter + e + n.emDelimiter : "";
|
|
22991
22997
|
}
|
|
22992
22998
|
};
|
|
22993
|
-
|
|
22999
|
+
mt.strong = {
|
|
22994
23000
|
filter: ["strong", "b"],
|
|
22995
23001
|
replacement: function(e, t, n) {
|
|
22996
23002
|
return e.trim() ? n.strongDelimiter + e + n.strongDelimiter : "";
|
|
22997
23003
|
}
|
|
22998
23004
|
};
|
|
22999
|
-
|
|
23005
|
+
mt.code = {
|
|
23000
23006
|
filter: function(e) {
|
|
23001
23007
|
var t = e.previousSibling || e.nextSibling, n = e.parentNode.nodeName === "PRE" && !t;
|
|
23002
23008
|
return e.nodeName === "CODE" && !n;
|
|
@@ -23010,7 +23016,7 @@ pt.code = {
|
|
|
23010
23016
|
return n + t + e + t + n;
|
|
23011
23017
|
}
|
|
23012
23018
|
};
|
|
23013
|
-
|
|
23019
|
+
mt.image = {
|
|
23014
23020
|
filter: "img",
|
|
23015
23021
|
replacement: function(e, t) {
|
|
23016
23022
|
var n = sa(t.getAttribute("alt")), r = t.getAttribute("src") || "", i = sa(t.getAttribute("title")), a = i ? ' "' + i + '"' : "";
|
|
@@ -23217,7 +23223,7 @@ function ei(e) {
|
|
|
23217
23223
|
if (!(this instanceof ei))
|
|
23218
23224
|
return new ei(e);
|
|
23219
23225
|
var t = {
|
|
23220
|
-
rules:
|
|
23226
|
+
rules: mt,
|
|
23221
23227
|
headingStyle: "setext",
|
|
23222
23228
|
hr: "* * *",
|
|
23223
23229
|
bulletListMarker: "*",
|
|
@@ -23362,7 +23368,7 @@ var SE = {
|
|
|
23362
23368
|
* Check if a value is a `History` object.
|
|
23363
23369
|
*/
|
|
23364
23370
|
isHistory(e) {
|
|
23365
|
-
return
|
|
23371
|
+
return ct(e) && Array.isArray(e.redos) && Array.isArray(e.undos) && (e.redos.length === 0 || wn.isOperationList(e.redos[0].operations)) && (e.undos.length === 0 || wn.isOperationList(e.undos[0].operations));
|
|
23366
23372
|
}
|
|
23367
23373
|
}, ds = /* @__PURE__ */ new WeakMap(), fs = /* @__PURE__ */ new WeakMap(), rr = {
|
|
23368
23374
|
/**
|
|
@@ -24284,7 +24290,7 @@ const YE = ({
|
|
|
24284
24290
|
...a
|
|
24285
24291
|
}) => {
|
|
24286
24292
|
var $;
|
|
24287
|
-
const s = le(), o = "profileForm_", l = $e(
|
|
24293
|
+
const s = le(), o = "profileForm_", l = $e(ft), [u, d] = ue(l.image), [h, p] = ue(!1), {
|
|
24288
24294
|
uploadImage: m = () => {
|
|
24289
24295
|
},
|
|
24290
24296
|
onSuccess: v = async (O) => {
|
|
@@ -24442,41 +24448,41 @@ const YE = ({
|
|
|
24442
24448
|
);
|
|
24443
24449
|
};
|
|
24444
24450
|
let ms = null;
|
|
24445
|
-
const
|
|
24451
|
+
const lt = "publishArticleForm_", Rc = {}, $c = 10, Lk = ({
|
|
24446
24452
|
id: e = "publish-article-form",
|
|
24447
24453
|
values: t = Rc,
|
|
24448
24454
|
functions: n,
|
|
24449
24455
|
meta: r,
|
|
24450
24456
|
gtm: i
|
|
24451
24457
|
}) => {
|
|
24452
|
-
const a = le(), s = $e(
|
|
24458
|
+
const a = le(), s = $e(ft), { create: o, onSuccess: l = () => {
|
|
24453
24459
|
}, onFailure: u = () => {
|
|
24454
24460
|
} } = n || {}, { isInOverlay: d = !1 } = r || {}, [h, p] = ue(!1), [m, v] = ue(t.body || ""), [f, b] = ue(!1), [g, w] = ue("");
|
|
24455
24461
|
ce(() => {
|
|
24456
24462
|
Ii(t, Rc) || Ui(t.body) && t.body !== m && t.body !== void 0 && v(t.body);
|
|
24457
24463
|
}, [t.body]);
|
|
24458
24464
|
const C = () => {
|
|
24459
|
-
!s || !s.id ? b(a.formatMessage({ id: `${
|
|
24465
|
+
!s || !s.id ? b(a.formatMessage({ id: `${lt}error_loggedOut` })) : f && b(!1);
|
|
24460
24466
|
}, A = ($) => ({
|
|
24461
24467
|
condition: (O) => {
|
|
24462
24468
|
const L = O[$];
|
|
24463
24469
|
return !L || typeof L != "string" ? !0 : L.length < $c;
|
|
24464
24470
|
},
|
|
24465
24471
|
error: a.formatMessage(
|
|
24466
|
-
{ id: `${
|
|
24472
|
+
{ id: `${lt}error_underMinLength` },
|
|
24467
24473
|
{ length: $c }
|
|
24468
24474
|
)
|
|
24469
24475
|
}), D = !!m && Ui(m), _ = () => /* @__PURE__ */ c.jsxs(c.Fragment, { children: [
|
|
24470
24476
|
/* @__PURE__ */ c.jsx(en, {}),
|
|
24471
|
-
/* @__PURE__ */ c.jsx("p", { className: "text-medium", children: a.formatMessage({ id: `${
|
|
24477
|
+
/* @__PURE__ */ c.jsx("p", { className: "text-medium", children: a.formatMessage({ id: `${lt}disclaimer` }) })
|
|
24472
24478
|
] }), B = [
|
|
24473
24479
|
{
|
|
24474
24480
|
id: "title",
|
|
24475
24481
|
type: "text",
|
|
24476
24482
|
value: t.title || "",
|
|
24477
24483
|
limit: 65,
|
|
24478
|
-
label: a.formatMessage({ id: `${
|
|
24479
|
-
placeholder: a.formatMessage({ id: `${
|
|
24484
|
+
label: a.formatMessage({ id: `${lt}title_label` }),
|
|
24485
|
+
placeholder: a.formatMessage({ id: `${lt}title_placeholder` }),
|
|
24480
24486
|
functions: {
|
|
24481
24487
|
onChange: C
|
|
24482
24488
|
},
|
|
@@ -24487,7 +24493,7 @@ const ct = "publishArticleForm_", Rc = {}, $c = 10, Lk = ({
|
|
|
24487
24493
|
// We do a check for the rich text editor value here as well, to make sure we can't
|
|
24488
24494
|
// submit an article without a body
|
|
24489
24495
|
condition: () => !D,
|
|
24490
|
-
error: a.formatMessage({ id: `${
|
|
24496
|
+
error: a.formatMessage({ id: `${lt}title_error` })
|
|
24491
24497
|
}
|
|
24492
24498
|
]
|
|
24493
24499
|
},
|
|
@@ -24496,8 +24502,8 @@ const ct = "publishArticleForm_", Rc = {}, $c = 10, Lk = ({
|
|
|
24496
24502
|
type: "text",
|
|
24497
24503
|
value: t.subtitle,
|
|
24498
24504
|
limit: 115,
|
|
24499
|
-
label: a.formatMessage({ id: `${
|
|
24500
|
-
placeholder: a.formatMessage({ id: `${
|
|
24505
|
+
label: a.formatMessage({ id: `${lt}subtitle_label` }),
|
|
24506
|
+
placeholder: a.formatMessage({ id: `${lt}subtitle_placeholder` }),
|
|
24501
24507
|
functions: {
|
|
24502
24508
|
onChange: C
|
|
24503
24509
|
},
|
|
@@ -24508,7 +24514,7 @@ const ct = "publishArticleForm_", Rc = {}, $c = 10, Lk = ({
|
|
|
24508
24514
|
props: {
|
|
24509
24515
|
formID: e,
|
|
24510
24516
|
label: {
|
|
24511
|
-
visible: a.formatMessage({ id: `${
|
|
24517
|
+
visible: a.formatMessage({ id: `${lt}body_label` })
|
|
24512
24518
|
},
|
|
24513
24519
|
showLabel: !0
|
|
24514
24520
|
}
|
|
@@ -24518,7 +24524,7 @@ const ct = "publishArticleForm_", Rc = {}, $c = 10, Lk = ({
|
|
|
24518
24524
|
props: {
|
|
24519
24525
|
id: `${e}-input`,
|
|
24520
24526
|
value: m,
|
|
24521
|
-
placeholder: a.formatMessage({ id: `${
|
|
24527
|
+
placeholder: a.formatMessage({ id: `${lt}body_placeholder` }),
|
|
24522
24528
|
meta: { isInOverlay: d },
|
|
24523
24529
|
autoFocus: !1,
|
|
24524
24530
|
functions: {
|
|
@@ -24554,16 +24560,16 @@ const ct = "publishArticleForm_", Rc = {}, $c = 10, Lk = ({
|
|
|
24554
24560
|
const O = { ...$, body: m };
|
|
24555
24561
|
try {
|
|
24556
24562
|
o && await o(O), ms = setTimeout(() => {
|
|
24557
|
-
w(a.formatMessage({ id: `${
|
|
24563
|
+
w(a.formatMessage({ id: `${lt}aria_success` })), l(O);
|
|
24558
24564
|
}, 500);
|
|
24559
24565
|
} catch {
|
|
24560
|
-
b(a.formatMessage({ id: `${
|
|
24566
|
+
b(a.formatMessage({ id: `${lt}error` })), w(""), u();
|
|
24561
24567
|
}
|
|
24562
24568
|
},
|
|
24563
24569
|
onFailure: u
|
|
24564
24570
|
},
|
|
24565
24571
|
fields: B,
|
|
24566
|
-
intlPath:
|
|
24572
|
+
intlPath: lt,
|
|
24567
24573
|
button: {
|
|
24568
24574
|
variant: "primary",
|
|
24569
24575
|
size: { mobile: "small", 600: "medium" },
|
|
@@ -24571,12 +24577,12 @@ const ct = "publishArticleForm_", Rc = {}, $c = 10, Lk = ({
|
|
|
24571
24577
|
"data-gtm-event-type": "publish-article-click",
|
|
24572
24578
|
disabled: !s || !s.id || !D,
|
|
24573
24579
|
text: {
|
|
24574
|
-
default: a.formatMessage({ id: `${
|
|
24580
|
+
default: a.formatMessage({ id: `${lt}cta_submit` }),
|
|
24575
24581
|
submitting: a.formatMessage({
|
|
24576
|
-
id: `${
|
|
24582
|
+
id: `${lt}cta_submitting`
|
|
24577
24583
|
}),
|
|
24578
24584
|
submitted: a.formatMessage({
|
|
24579
|
-
id: `${
|
|
24585
|
+
id: `${lt}cta_submitted`
|
|
24580
24586
|
})
|
|
24581
24587
|
},
|
|
24582
24588
|
customOnSubmit: f ? /* @__PURE__ */ c.jsx(c.Fragment, {}) : /* @__PURE__ */ c.jsx(GE, {})
|
|
@@ -24584,7 +24590,7 @@ const ct = "publishArticleForm_", Rc = {}, $c = 10, Lk = ({
|
|
|
24584
24590
|
gtm: i
|
|
24585
24591
|
}
|
|
24586
24592
|
),
|
|
24587
|
-
f && /* @__PURE__ */ c.jsx(Vr, { id: "error-message", className: "error", children: typeof f == "string" && f.includes(" ") ? f : a.formatMessage({ id: `${
|
|
24593
|
+
f && /* @__PURE__ */ c.jsx(Vr, { id: "error-message", className: "error", children: typeof f == "string" && f.includes(" ") ? f : a.formatMessage({ id: `${lt}error` }) }),
|
|
24588
24594
|
g && /* @__PURE__ */ c.jsx(Ie, { "aria-live": "polite", showOnFocus: !1, children: g })
|
|
24589
24595
|
] });
|
|
24590
24596
|
};
|
|
@@ -24893,9 +24899,9 @@ const t_ = ({ className: e = "" }) => /* @__PURE__ */ c.jsxs(
|
|
|
24893
24899
|
className: H("success-message", e),
|
|
24894
24900
|
"data-testid": "success-message",
|
|
24895
24901
|
children: [
|
|
24896
|
-
/* @__PURE__ */ c.jsx("p", { className: "success-title", children: /* @__PURE__ */ c.jsx(
|
|
24902
|
+
/* @__PURE__ */ c.jsx("p", { className: "success-title", children: /* @__PURE__ */ c.jsx(dt, { id: "signup_success_title" }) }),
|
|
24897
24903
|
/* @__PURE__ */ c.jsx(
|
|
24898
|
-
|
|
24904
|
+
dt,
|
|
24899
24905
|
{
|
|
24900
24906
|
id: "signup_success_text",
|
|
24901
24907
|
values: {
|
|
@@ -24993,7 +24999,7 @@ const n_ = {
|
|
|
24993
24999
|
className: H("signup-form-fieldset", e),
|
|
24994
25000
|
"data-testid": "signup-form",
|
|
24995
25001
|
children: [
|
|
24996
|
-
v.title && /* @__PURE__ */ c.jsx("p", { className: "signup-title", children: /* @__PURE__ */ c.jsx(
|
|
25002
|
+
v.title && /* @__PURE__ */ c.jsx("p", { className: "signup-title", children: /* @__PURE__ */ c.jsx(dt, { id: "signup_title" }) }),
|
|
24997
25003
|
_ && /* @__PURE__ */ c.jsx(
|
|
24998
25004
|
qn,
|
|
24999
25005
|
{
|
|
@@ -25296,7 +25302,7 @@ const gs = "contactFooter_", Vk = ({ onSuccess: e = async () => {
|
|
|
25296
25302
|
return ce(() => (o(), window.addEventListener("resize", l), () => {
|
|
25297
25303
|
clearTimeout(ps), window.removeEventListener("resize", l);
|
|
25298
25304
|
}), []), /* @__PURE__ */ c.jsx(Wn, { id: "contactForm", className: "contact-footer", children: /* @__PURE__ */ c.jsxs("div", { className: "inner-wrapper", children: [
|
|
25299
|
-
/* @__PURE__ */ c.jsx("h2", { children: /* @__PURE__ */ c.jsx(
|
|
25305
|
+
/* @__PURE__ */ c.jsx("h2", { children: /* @__PURE__ */ c.jsx(dt, { id: `${gs}title` }) }),
|
|
25300
25306
|
/* @__PURE__ */ c.jsxs(
|
|
25301
25307
|
"div",
|
|
25302
25308
|
{
|
|
@@ -25306,8 +25312,8 @@ const gs = "contactFooter_", Vk = ({ onSuccess: e = async () => {
|
|
|
25306
25312
|
style: a ? {} : { minHeight: r },
|
|
25307
25313
|
children: [
|
|
25308
25314
|
/* @__PURE__ */ c.jsxs("aside", { children: [
|
|
25309
|
-
/* @__PURE__ */ c.jsx("p", { children: /* @__PURE__ */ c.jsx(
|
|
25310
|
-
/* @__PURE__ */ c.jsx(zn, { className: "mailto-link", href: "mailto:hello@apolitical.co", children: /* @__PURE__ */ c.jsx(
|
|
25315
|
+
/* @__PURE__ */ c.jsx("p", { children: /* @__PURE__ */ c.jsx(dt, { id: `${gs}text` }) }),
|
|
25316
|
+
/* @__PURE__ */ c.jsx(zn, { className: "mailto-link", href: "mailto:hello@apolitical.co", children: /* @__PURE__ */ c.jsx(dt, { id: `${gs}email` }) })
|
|
25311
25317
|
] }),
|
|
25312
25318
|
/* @__PURE__ */ c.jsx(
|
|
25313
25319
|
HE,
|
|
@@ -25486,7 +25492,7 @@ const ir = "footer_", oa = "SiteFooter", Lc = ({ group: e }) => {
|
|
|
25486
25492
|
const t = sn[e].order || [];
|
|
25487
25493
|
let n = !1;
|
|
25488
25494
|
return "text" in sn[e] && (n = sn[e].text), /* @__PURE__ */ c.jsxs(Ur, { children: [
|
|
25489
|
-
/* @__PURE__ */ c.jsx("p", { className: "pre-title", children: /* @__PURE__ */ c.jsx(
|
|
25495
|
+
/* @__PURE__ */ c.jsx("p", { className: "pre-title", children: /* @__PURE__ */ c.jsx(dt, { id: `${ir}${e}` }) }),
|
|
25490
25496
|
Array.isArray(t) && t.length > 0 && /* @__PURE__ */ c.jsx("ul", { className: "text-medium", children: t.map((r) => {
|
|
25491
25497
|
if (["order", "child", "text"].includes(r))
|
|
25492
25498
|
return null;
|
|
@@ -25499,15 +25505,15 @@ const ir = "footer_", oa = "SiteFooter", Lc = ({ group: e }) => {
|
|
|
25499
25505
|
"data-gtm-event-context": oa,
|
|
25500
25506
|
"data-gtm-event-type": a,
|
|
25501
25507
|
...s,
|
|
25502
|
-
children: /* @__PURE__ */ c.jsx(
|
|
25508
|
+
children: /* @__PURE__ */ c.jsx(dt, { id: `${ir}${e}_${r}` })
|
|
25503
25509
|
}
|
|
25504
25510
|
) }, `${e}_${r}`);
|
|
25505
25511
|
}) }),
|
|
25506
25512
|
typeof n != "boolean" && "order" in n && Array.isArray(n.order) && /* @__PURE__ */ c.jsx("dl", { className: "text-medium", children: n.order.map((r) => /* @__PURE__ */ c.jsxs(Ur, { children: [
|
|
25507
|
-
/* @__PURE__ */ c.jsx("dt", { children: /* @__PURE__ */ c.jsx(
|
|
25513
|
+
/* @__PURE__ */ c.jsx("dt", { children: /* @__PURE__ */ c.jsx(dt, { id: `${ir}${e}_${r}` }) }),
|
|
25508
25514
|
/* @__PURE__ */ c.jsxs("dd", { children: [
|
|
25509
25515
|
typeof n != "boolean" && n[r].address && /* @__PURE__ */ c.jsx("address", { children: /* @__PURE__ */ c.jsx(
|
|
25510
|
-
|
|
25516
|
+
dt,
|
|
25511
25517
|
{
|
|
25512
25518
|
id: `${ir}${e}_${r}_address`,
|
|
25513
25519
|
values: { br: /* @__PURE__ */ c.jsx("br", {}) }
|
|
@@ -25555,12 +25561,12 @@ const ir = "footer_", oa = "SiteFooter", Lc = ({ group: e }) => {
|
|
|
25555
25561
|
className: "gtm-trackable",
|
|
25556
25562
|
"data-gtm-event-context": oa,
|
|
25557
25563
|
"data-gtm-event-type": "social-click",
|
|
25558
|
-
children: /* @__PURE__ */ c.jsx("span", { className: "hidden", children: /* @__PURE__ */ c.jsx(
|
|
25564
|
+
children: /* @__PURE__ */ c.jsx("span", { className: "hidden", children: /* @__PURE__ */ c.jsx(dt, { id: `${ir}social_${e}` }) })
|
|
25559
25565
|
}
|
|
25560
25566
|
) }, e);
|
|
25561
25567
|
}) }),
|
|
25562
25568
|
/* @__PURE__ */ c.jsx("small", { children: /* @__PURE__ */ c.jsx(
|
|
25563
|
-
|
|
25569
|
+
dt,
|
|
25564
25570
|
{
|
|
25565
25571
|
id: `${ir}copyright`,
|
|
25566
25572
|
values: { currentYear: (/* @__PURE__ */ new Date()).getFullYear() }
|
|
@@ -25905,7 +25911,7 @@ const ir = "footer_", oa = "SiteFooter", Lc = ({ group: e }) => {
|
|
|
25905
25911
|
const a_ = { height: 67, height_desktop: 83 };
|
|
25906
25912
|
var St = /* @__PURE__ */ ((e) => (e.NAVIGATION = "navigation", e.SEARCH = "search", e.ACCOUNT = "account-navigation", e.SITE = "site-navigation", e))(St || {});
|
|
25907
25913
|
const gh = ({ showNavigation: e = !0 }) => {
|
|
25908
|
-
const t = le(), n = $e(
|
|
25914
|
+
const t = le(), n = $e(ft), r = gr(!0, !0), i = n && typeof n.id == "string", a = Jt(
|
|
25909
25915
|
() => We.getIsDesktopVersion(i, r),
|
|
25910
25916
|
[i, r]
|
|
25911
25917
|
), [s, o] = pr(da, {
|
|
@@ -26347,7 +26353,7 @@ const l_ = 25, c_ = ({
|
|
|
26347
26353
|
showPlaceholders: d = !1,
|
|
26348
26354
|
className: h = ""
|
|
26349
26355
|
}) => {
|
|
26350
|
-
const p = le(), m = "membersList", v = $e(
|
|
26356
|
+
const p = le(), m = "membersList", v = $e(ft), [f, b] = ue(!1);
|
|
26351
26357
|
return e.length === 0 && !d ? null : /* @__PURE__ */ c.jsxs("div", { className: H("members-list", h), children: [
|
|
26352
26358
|
u ? /* @__PURE__ */ c.jsxs("h1", { children: [
|
|
26353
26359
|
p.formatMessage({ id: m }),
|
|
@@ -26365,11 +26371,11 @@ const l_ = 25, c_ = ({
|
|
|
26365
26371
|
showBadges: !0,
|
|
26366
26372
|
scopes: [
|
|
26367
26373
|
{
|
|
26368
|
-
scope:
|
|
26374
|
+
scope: yt.Communities,
|
|
26369
26375
|
area: n || ""
|
|
26370
26376
|
},
|
|
26371
26377
|
{
|
|
26372
|
-
scope:
|
|
26378
|
+
scope: yt.Platform,
|
|
26373
26379
|
area: "all"
|
|
26374
26380
|
}
|
|
26375
26381
|
]
|
|
@@ -26399,11 +26405,11 @@ const l_ = 25, c_ = ({
|
|
|
26399
26405
|
showBadges: !0,
|
|
26400
26406
|
scopes: [
|
|
26401
26407
|
{
|
|
26402
|
-
scope:
|
|
26408
|
+
scope: yt.Communities,
|
|
26403
26409
|
area: n || ""
|
|
26404
26410
|
},
|
|
26405
26411
|
{
|
|
26406
|
-
scope:
|
|
26412
|
+
scope: yt.Platform,
|
|
26407
26413
|
area: "all"
|
|
26408
26414
|
}
|
|
26409
26415
|
]
|
|
@@ -26490,8 +26496,8 @@ const tt = "discussion_form_", xa = ({
|
|
|
26490
26496
|
data: h = {},
|
|
26491
26497
|
gtmContext: p = "DiscussionForm"
|
|
26492
26498
|
}) => {
|
|
26493
|
-
var
|
|
26494
|
-
const m = le(), v = $e(
|
|
26499
|
+
var nt, Pe, Ke;
|
|
26500
|
+
const m = le(), v = $e(ft), [f, b] = ue(""), {
|
|
26495
26501
|
isLoading: g = !1,
|
|
26496
26502
|
isInWrapper: w = !1,
|
|
26497
26503
|
isInOverlay: C = !1,
|
|
@@ -26558,7 +26564,7 @@ const tt = "discussion_form_", xa = ({
|
|
|
26558
26564
|
};
|
|
26559
26565
|
let de = `${n.type}-form`;
|
|
26560
26566
|
if (n.type === "response" || n.type === "reply") {
|
|
26561
|
-
const De = ((
|
|
26567
|
+
const De = ((nt = n.slugs) == null ? void 0 : nt.reply) || ((Pe = n.slugs) == null ? void 0 : Pe.answer) || ((Ke = n.slugs) == null ? void 0 : Ke.question) || "";
|
|
26562
26568
|
De && (de = `${de}-${De.slice(-15)}`);
|
|
26563
26569
|
}
|
|
26564
26570
|
e && (de = `${e}-${de}`);
|
|
@@ -26615,7 +26621,7 @@ const tt = "discussion_form_", xa = ({
|
|
|
26615
26621
|
z({ title: "", body: "", categories: "", data: {} }), K("submitted"), b(
|
|
26616
26622
|
Ut(m.formatMessage, `${tt}success`, n.type, "action")
|
|
26617
26623
|
);
|
|
26618
|
-
const re = new Event(
|
|
26624
|
+
const re = new Event(ut.DISCUSSION_FORM_SUBMITTED);
|
|
26619
26625
|
document.dispatchEvent(re), ve();
|
|
26620
26626
|
}, 500);
|
|
26621
26627
|
} catch (W) {
|
|
@@ -26793,11 +26799,11 @@ const tt = "discussion_form_", xa = ({
|
|
|
26793
26799
|
showBadges: !0,
|
|
26794
26800
|
scopes: [
|
|
26795
26801
|
{
|
|
26796
|
-
scope:
|
|
26802
|
+
scope: yt.Communities,
|
|
26797
26803
|
area: t || ""
|
|
26798
26804
|
},
|
|
26799
26805
|
{
|
|
26800
|
-
scope:
|
|
26806
|
+
scope: yt.Platform,
|
|
26801
26807
|
area: "all"
|
|
26802
26808
|
}
|
|
26803
26809
|
]
|
|
@@ -26990,7 +26996,7 @@ const w_ = ({
|
|
|
26990
26996
|
);
|
|
26991
26997
|
};
|
|
26992
26998
|
const D_ = ({ title: e, options: t, settings: n, functions: r }) => {
|
|
26993
|
-
const i = "poll_", a = le(), s = $e(
|
|
26999
|
+
const i = "poll_", a = le(), s = $e(ft), {
|
|
26994
27000
|
show_remove_vote: o = !0,
|
|
26995
27001
|
allow_multiple_votes: l = !1,
|
|
26996
27002
|
results_visibility: u = no.AfterVoting
|
|
@@ -27137,7 +27143,7 @@ const wa = ({
|
|
|
27137
27143
|
locale: w = "en"
|
|
27138
27144
|
}) => {
|
|
27139
27145
|
var De, W, re, ge, ye, Ae;
|
|
27140
|
-
const C = le(), A = $e(Zo), D = $e(
|
|
27146
|
+
const C = le(), A = $e(Zo), D = $e(ft), {
|
|
27141
27147
|
createContent: _ = async () => {
|
|
27142
27148
|
},
|
|
27143
27149
|
deleteContent: B = async () => {
|
|
@@ -27177,9 +27183,9 @@ const wa = ({
|
|
|
27177
27183
|
ce(() => {
|
|
27178
27184
|
const be = K.current;
|
|
27179
27185
|
if (!(!be || me === "default"))
|
|
27180
|
-
return document.addEventListener(
|
|
27186
|
+
return document.addEventListener(ut.DISCUSSION_FORM_SUBMITTED, Ve), be.addEventListener("transitionend", Re), () => {
|
|
27181
27187
|
document.removeEventListener(
|
|
27182
|
-
|
|
27188
|
+
ut.DISCUSSION_FORM_SUBMITTED,
|
|
27183
27189
|
Ve
|
|
27184
27190
|
), be.removeEventListener("transitionend", Re);
|
|
27185
27191
|
};
|
|
@@ -27211,7 +27217,7 @@ const wa = ({
|
|
|
27211
27217
|
}, 1e3);
|
|
27212
27218
|
}, Re = ({ propertyName: be }) => {
|
|
27213
27219
|
be === "background-color" && Se((Fe) => (Fe === "default" && (document.removeEventListener(
|
|
27214
|
-
|
|
27220
|
+
ut.DISCUSSION_FORM_SUBMITTED,
|
|
27215
27221
|
Ve
|
|
27216
27222
|
), K.current && K.current.removeEventListener("transitionend", Re)), Fe === "fading" ? "default" : Fe));
|
|
27217
27223
|
};
|
|
@@ -27225,29 +27231,29 @@ const wa = ({
|
|
|
27225
27231
|
be || (be = ""), Fe || (Fe = ""), ke("");
|
|
27226
27232
|
try {
|
|
27227
27233
|
if (!Ii(be, J.title) || !Ii(Fe, J.body)) {
|
|
27228
|
-
const
|
|
27229
|
-
await $(Ou(t.slugs),
|
|
27234
|
+
const st = t.type === "question" ? { title: Fe } : { title: be, body: Fe, data: Xe };
|
|
27235
|
+
await $(Ou(t.slugs), st);
|
|
27230
27236
|
}
|
|
27231
|
-
de((
|
|
27232
|
-
...
|
|
27237
|
+
de((st) => ({
|
|
27238
|
+
...st,
|
|
27233
27239
|
title: be || "",
|
|
27234
27240
|
body: Fe || "",
|
|
27235
|
-
data: { ...
|
|
27241
|
+
data: { ...st.data, ...Xe },
|
|
27236
27242
|
isEditing: !1,
|
|
27237
27243
|
didEdit: !0
|
|
27238
27244
|
}));
|
|
27239
27245
|
} catch {
|
|
27240
27246
|
ke(`${qt}form_error`);
|
|
27241
27247
|
}
|
|
27242
|
-
},
|
|
27248
|
+
}, nt = () => {
|
|
27243
27249
|
if (A && A.updateConversation) {
|
|
27244
27250
|
const be = { showForm: !0 }, Fe = t.author;
|
|
27245
27251
|
Fe && Fe.id && (v && (be.prepopulateForm = `@{{${Fe.id}}}`), be.mentionData = { id: Fe.id, name: Fe.name }), A.updateConversation(be);
|
|
27246
27252
|
}
|
|
27247
27253
|
setTimeout(() => {
|
|
27248
|
-
var
|
|
27249
|
-
const Fe = `reply-form-${(t.type === "answer" ? t.slug : ((
|
|
27250
|
-
|
|
27254
|
+
var wt, rt, Bt;
|
|
27255
|
+
const Fe = `reply-form-${(t.type === "answer" ? t.slug : ((wt = t.slugs) == null ? void 0 : wt.reply) || ((rt = t.slugs) == null ? void 0 : rt.answer) || ((Bt = t.slugs) == null ? void 0 : Bt.question) || "").toLowerCase().slice(-15)}`, Xe = document.getElementById(Fe), st = document.getElementById(`${Fe}-input`);
|
|
27256
|
+
st && st.focus(), Xe && Xe.scrollIntoView({ behavior: "smooth" });
|
|
27251
27257
|
}, 0);
|
|
27252
27258
|
}, Pe = async () => {
|
|
27253
27259
|
ve(!1);
|
|
@@ -27299,7 +27305,7 @@ const wa = ({
|
|
|
27299
27305
|
be.preventDefault(), be.stopPropagation(), Fi && clearTimeout(Fi), Fi = setTimeout(() => {
|
|
27300
27306
|
window.location.href = l.post;
|
|
27301
27307
|
}, 150);
|
|
27302
|
-
const Fe = new CustomEvent(
|
|
27308
|
+
const Fe = new CustomEvent(ut.DISCUSSION_POST_CLICKED, {
|
|
27303
27309
|
detail: { link: l.post, timeout: Fi }
|
|
27304
27310
|
});
|
|
27305
27311
|
document.dispatchEvent(Fe);
|
|
@@ -27418,7 +27424,7 @@ const wa = ({
|
|
|
27418
27424
|
}
|
|
27419
27425
|
} : !1,
|
|
27420
27426
|
replies: t.type === "answer" || t.type === "reply" ? {
|
|
27421
|
-
functions: { onClick:
|
|
27427
|
+
functions: { onClick: nt }
|
|
27422
27428
|
} : !1,
|
|
27423
27429
|
shareLink: {
|
|
27424
27430
|
url: `${window.location.origin}${(re = t.slugs) == null ? void 0 : re.question}/${(ge = t.slugs) == null ? void 0 : ge.answer}${(ye = t.slugs) != null && ye.reply ? `#${(Ae = t.slugs) == null ? void 0 : Ae.reply}` : ""}`
|
|
@@ -27472,7 +27478,7 @@ const wa = ({
|
|
|
27472
27478
|
],
|
|
27473
27479
|
gtmContext: `${t.type.charAt(0).toUpperCase()}${t.type.slice(1)}:${t.slug}`,
|
|
27474
27480
|
children: /* @__PURE__ */ c.jsx(
|
|
27475
|
-
|
|
27481
|
+
dt,
|
|
27476
27482
|
{
|
|
27477
27483
|
id: "discussion_delete_text",
|
|
27478
27484
|
values: {
|
|
@@ -27491,7 +27497,7 @@ const wa = ({
|
|
|
27491
27497
|
const k_ = mr(
|
|
27492
27498
|
() => Promise.resolve().then(() => z_)
|
|
27493
27499
|
), F_ = 65, A_ = ({ forceShow: e, form: t, className: n }) => {
|
|
27494
|
-
const r = le(), i = "discussionFormCard_", a = "DiscardDraftModal", o = $e(
|
|
27500
|
+
const r = le(), i = "discussionFormCard_", a = "DiscardDraftModal", o = $e(ft) || "community", l = ho(o);
|
|
27495
27501
|
l.name || (l.name = r.formatMessage({
|
|
27496
27502
|
id: `member_${typeof o == "string" ? o : "community"}`
|
|
27497
27503
|
}));
|
|
@@ -27528,26 +27534,26 @@ const k_ = mr(
|
|
|
27528
27534
|
ce(() => {
|
|
27529
27535
|
if (!p.showCachedText) {
|
|
27530
27536
|
document.removeEventListener(
|
|
27531
|
-
|
|
27537
|
+
ut.DISCUSSION_POST_CLICKED,
|
|
27532
27538
|
v
|
|
27533
27539
|
), document.removeEventListener(
|
|
27534
|
-
|
|
27540
|
+
ut.MEMBER_CLICKED,
|
|
27535
27541
|
v
|
|
27536
27542
|
), document.removeEventListener("click", v);
|
|
27537
27543
|
return;
|
|
27538
27544
|
}
|
|
27539
27545
|
return document.addEventListener(
|
|
27540
|
-
|
|
27546
|
+
ut.DISCUSSION_POST_CLICKED,
|
|
27541
27547
|
v
|
|
27542
27548
|
), document.addEventListener(
|
|
27543
|
-
|
|
27549
|
+
ut.MEMBER_CLICKED,
|
|
27544
27550
|
v
|
|
27545
27551
|
), document.addEventListener("click", v), () => {
|
|
27546
27552
|
document.removeEventListener(
|
|
27547
|
-
|
|
27553
|
+
ut.DISCUSSION_POST_CLICKED,
|
|
27548
27554
|
v
|
|
27549
27555
|
), document.removeEventListener(
|
|
27550
|
-
|
|
27556
|
+
ut.MEMBER_CLICKED,
|
|
27551
27557
|
v
|
|
27552
27558
|
), document.removeEventListener("click", v);
|
|
27553
27559
|
};
|
|
@@ -27696,11 +27702,11 @@ const k_ = mr(
|
|
|
27696
27702
|
};
|
|
27697
27703
|
return e ? /* @__PURE__ */ c.jsx(A_, { form: m }) : /* @__PURE__ */ c.jsx(B_, { ...m });
|
|
27698
27704
|
}, bh = ({ form: e }) => {
|
|
27699
|
-
const t = $e(
|
|
27705
|
+
const t = $e(ft), n = le(), [r, i] = ue(!1), a = () => {
|
|
27700
27706
|
lm(t) || i(!0);
|
|
27701
27707
|
};
|
|
27702
|
-
ce(() => (document.addEventListener(
|
|
27703
|
-
document.removeEventListener(
|
|
27708
|
+
ce(() => (document.addEventListener(ut.DISCUSSION_POST_ADDED, a), () => {
|
|
27709
|
+
document.removeEventListener(ut.DISCUSSION_POST_ADDED, a);
|
|
27704
27710
|
}));
|
|
27705
27711
|
const s = {};
|
|
27706
27712
|
return ["successMessage", "title", "text"].forEach((o) => {
|
|
@@ -27799,7 +27805,7 @@ function O_({
|
|
|
27799
27805
|
mutationFn: e,
|
|
27800
27806
|
mutationHandlers: { mutate: t, error: n }
|
|
27801
27807
|
}) {
|
|
27802
|
-
const { mutate: r } =
|
|
27808
|
+
const { mutate: r } = at({
|
|
27803
27809
|
mutationFn: e,
|
|
27804
27810
|
onMutate: ({ content: i, title: a }) => t((s) => (s && (i != null && (s.content = i), a != null && (s.title = a)), s)),
|
|
27805
27811
|
onError: n
|
|
@@ -27857,7 +27863,7 @@ function M_({
|
|
|
27857
27863
|
queryClient: r,
|
|
27858
27864
|
queryKey: i
|
|
27859
27865
|
}) {
|
|
27860
|
-
const { mutate: a } =
|
|
27866
|
+
const { mutate: a } = at({
|
|
27861
27867
|
mutationFn: e,
|
|
27862
27868
|
onMutate: (s) => t((o) => (o && Gi({ activity: o }), o)),
|
|
27863
27869
|
onError: n,
|
|
@@ -27875,7 +27881,7 @@ function R_({
|
|
|
27875
27881
|
},
|
|
27876
27882
|
user: r
|
|
27877
27883
|
}) {
|
|
27878
|
-
const { mutate: i } =
|
|
27884
|
+
const { mutate: i } = at({
|
|
27879
27885
|
mutationFn: e,
|
|
27880
27886
|
onMutate: (a) => t((s) => (s && kd({ activity: s, user: r }), s)),
|
|
27881
27887
|
onError: n
|
|
@@ -27888,7 +27894,7 @@ function $_({
|
|
|
27888
27894
|
queryClient: r,
|
|
27889
27895
|
queryKey: i
|
|
27890
27896
|
}) {
|
|
27891
|
-
const { mutate: a } =
|
|
27897
|
+
const { mutate: a } = at({
|
|
27892
27898
|
mutationFn: e,
|
|
27893
27899
|
onMutate: (s) => t((o) => (o && Qi({ activity: o }), o)),
|
|
27894
27900
|
onError: n,
|
|
@@ -27903,7 +27909,7 @@ function I_({
|
|
|
27903
27909
|
mutationHandlers: { mutate: t, error: n },
|
|
27904
27910
|
user: r
|
|
27905
27911
|
}) {
|
|
27906
|
-
const { mutate: i } =
|
|
27912
|
+
const { mutate: i } = at({
|
|
27907
27913
|
mutationFn: e,
|
|
27908
27914
|
onMutate: (a) => (console.log("unpin"), t((s) => (s && Fd({ activity: s, user: r }), s))),
|
|
27909
27915
|
onError: n
|
|
@@ -28027,11 +28033,11 @@ const Zk = ({
|
|
|
28027
28033
|
showBadges: !0,
|
|
28028
28034
|
scopes: [
|
|
28029
28035
|
{
|
|
28030
|
-
scope:
|
|
28036
|
+
scope: yt.Communities,
|
|
28031
28037
|
area: t || ""
|
|
28032
28038
|
},
|
|
28033
28039
|
{
|
|
28034
|
-
scope:
|
|
28040
|
+
scope: yt.Platform,
|
|
28035
28041
|
area: "all"
|
|
28036
28042
|
}
|
|
28037
28043
|
]
|
|
@@ -28790,7 +28796,7 @@ const rF = ({
|
|
|
28790
28796
|
return null;
|
|
28791
28797
|
};
|
|
28792
28798
|
function Q_({ buildMemberData: e, communitySlug: t }) {
|
|
28793
|
-
const n = le(), r = $e(
|
|
28799
|
+
const n = le(), r = $e(ft), [i, a] = ue({
|
|
28794
28800
|
count: "...",
|
|
28795
28801
|
isMember: !1,
|
|
28796
28802
|
memberType: ""
|
|
@@ -28832,7 +28838,7 @@ const yh = ({
|
|
|
28832
28838
|
meta: l
|
|
28833
28839
|
}) => {
|
|
28834
28840
|
var k, j;
|
|
28835
|
-
const u = le(), d = $e(
|
|
28841
|
+
const u = le(), d = $e(ft), h = !!(d != null && d.id), { isTabbable: p = !0, setFocus: m = !1 } = l || {}, v = te.useRef(null), [f, b] = ue({
|
|
28836
28842
|
data: null,
|
|
28837
28843
|
isLoading: !0
|
|
28838
28844
|
});
|
|
@@ -29587,7 +29593,7 @@ export {
|
|
|
29587
29593
|
yo as ActivityType,
|
|
29588
29594
|
vh as AddPost,
|
|
29589
29595
|
zm as Badge,
|
|
29590
|
-
|
|
29596
|
+
yt as BadgeScope,
|
|
29591
29597
|
qm as Badges,
|
|
29592
29598
|
ad as BadgesContext,
|
|
29593
29599
|
Tm as BadgesProvider,
|
|
@@ -29615,7 +29621,7 @@ export {
|
|
|
29615
29621
|
sF as CourseProgression,
|
|
29616
29622
|
oF as CourseStructure,
|
|
29617
29623
|
tF as CustomContentBanner,
|
|
29618
|
-
|
|
29624
|
+
ut as CustomEvents,
|
|
29619
29625
|
Li as DELETED_USER_ID,
|
|
29620
29626
|
Gk as Directory,
|
|
29621
29627
|
g_ as DiscussionConversation,
|
|
@@ -29725,7 +29731,7 @@ export {
|
|
|
29725
29731
|
vr as Tooltip,
|
|
29726
29732
|
Hk as TopLevelPage,
|
|
29727
29733
|
zi as UUID_V4_REGEX,
|
|
29728
|
-
|
|
29734
|
+
ft as UserContext,
|
|
29729
29735
|
Rm as UserProvider,
|
|
29730
29736
|
Ie as VisuallyHidden,
|
|
29731
29737
|
Zp as addAriaProps,
|