@apolitical/component-library 1.18.0 → 1.18.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.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import { useIntl as A, IntlProvider as Ha, createIntl as Ua, FormattedMessage as
|
|
|
5
5
|
import Ne from "truncate";
|
|
6
6
|
import { QueryClient as za, QueryClientProvider as Wa, useMutation as fe, useQueryClient as Kt, useInfiniteQuery as Rn, useQuery as Va } from "@tanstack/react-query";
|
|
7
7
|
import { ReactQueryDevtools as Ya } from "@tanstack/react-query-devtools";
|
|
8
|
-
import
|
|
8
|
+
import at from "posthog-js";
|
|
9
9
|
import { CookiesProvider as Ga, useCookies as Ka } from "react-cookie";
|
|
10
10
|
import pt from "markdown-to-jsx";
|
|
11
11
|
import { ReactMultiEmail as Qa } from "react-multi-email";
|
|
@@ -343,7 +343,7 @@ function ir() {
|
|
|
343
343
|
var x = u.prototype;
|
|
344
344
|
return !!(x && x.isReactComponent);
|
|
345
345
|
}
|
|
346
|
-
function
|
|
346
|
+
function We(u, x, T) {
|
|
347
347
|
if (u == null)
|
|
348
348
|
return "";
|
|
349
349
|
if (typeof u == "function")
|
|
@@ -361,28 +361,28 @@ function ir() {
|
|
|
361
361
|
case m:
|
|
362
362
|
return _a(u.render);
|
|
363
363
|
case d:
|
|
364
|
-
return
|
|
364
|
+
return We(u.type, x, T);
|
|
365
365
|
case p: {
|
|
366
366
|
var P = u, O = P._payload, V = P._init;
|
|
367
367
|
try {
|
|
368
|
-
return
|
|
368
|
+
return We(V(O), x, T);
|
|
369
369
|
} catch {
|
|
370
370
|
}
|
|
371
371
|
}
|
|
372
372
|
}
|
|
373
373
|
return "";
|
|
374
374
|
}
|
|
375
|
-
var
|
|
376
|
-
function
|
|
375
|
+
var Ve = Object.prototype.hasOwnProperty, rn = {}, sn = y.ReactDebugCurrentFrame;
|
|
376
|
+
function Ye(u) {
|
|
377
377
|
if (u) {
|
|
378
|
-
var x = u._owner, T =
|
|
378
|
+
var x = u._owner, T = We(u.type, u._source, x ? x.type : null);
|
|
379
379
|
sn.setExtraStackFrame(T);
|
|
380
380
|
} else
|
|
381
381
|
sn.setExtraStackFrame(null);
|
|
382
382
|
}
|
|
383
383
|
function ya(u, x, T, P, O) {
|
|
384
384
|
{
|
|
385
|
-
var V = Function.call.bind(
|
|
385
|
+
var V = Function.call.bind(Ve);
|
|
386
386
|
for (var I in u)
|
|
387
387
|
if (V(u, I)) {
|
|
388
388
|
var R = void 0;
|
|
@@ -395,7 +395,7 @@ function ir() {
|
|
|
395
395
|
} catch (X) {
|
|
396
396
|
R = X;
|
|
397
397
|
}
|
|
398
|
-
R && !(R instanceof Error) && (
|
|
398
|
+
R && !(R instanceof Error) && (Ye(O), _("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", P || "React class", T, I, typeof R), Ye(null)), R instanceof Error && !(R.message in rn) && (rn[R.message] = !0, Ye(O), _("Failed %s type: %s", T, R.message), Ye(null));
|
|
399
399
|
}
|
|
400
400
|
}
|
|
401
401
|
}
|
|
@@ -431,7 +431,7 @@ function ir() {
|
|
|
431
431
|
}, ln, dn, wt;
|
|
432
432
|
wt = {};
|
|
433
433
|
function wa(u) {
|
|
434
|
-
if (
|
|
434
|
+
if (Ve.call(u, "ref")) {
|
|
435
435
|
var x = Object.getOwnPropertyDescriptor(u, "ref").get;
|
|
436
436
|
if (x && x.isReactWarning)
|
|
437
437
|
return !1;
|
|
@@ -439,7 +439,7 @@ function ir() {
|
|
|
439
439
|
return u.ref !== void 0;
|
|
440
440
|
}
|
|
441
441
|
function Ta(u) {
|
|
442
|
-
if (
|
|
442
|
+
if (Ve.call(u, "key")) {
|
|
443
443
|
var x = Object.getOwnPropertyDescriptor(u, "key").get;
|
|
444
444
|
if (x && x.isReactWarning)
|
|
445
445
|
return !1;
|
|
@@ -508,7 +508,7 @@ function ir() {
|
|
|
508
508
|
var V, I = {}, R = null, oe = null;
|
|
509
509
|
T !== void 0 && (cn(T), R = "" + T), Ta(x) && (cn(x.key), R = "" + x.key), wa(x) && (oe = x.ref, $a(x, O));
|
|
510
510
|
for (V in x)
|
|
511
|
-
|
|
511
|
+
Ve.call(x, V) && !ja.hasOwnProperty(V) && (I[V] = x[V]);
|
|
512
512
|
if (u && u.defaultProps) {
|
|
513
513
|
var X = u.defaultProps;
|
|
514
514
|
for (V in X)
|
|
@@ -524,7 +524,7 @@ function ir() {
|
|
|
524
524
|
var Tt = y.ReactCurrentOwner, un = y.ReactDebugCurrentFrame;
|
|
525
525
|
function Ce(u) {
|
|
526
526
|
if (u) {
|
|
527
|
-
var x = u._owner, T =
|
|
527
|
+
var x = u._owner, T = We(u.type, u._source, x ? x.type : null);
|
|
528
528
|
un.setExtraStackFrame(T);
|
|
529
529
|
} else
|
|
530
530
|
un.setExtraStackFrame(null);
|
|
@@ -756,7 +756,7 @@ function Zn(e, t, n) {
|
|
|
756
756
|
return cr(e, t, { maxWait: t, leading: s === void 0 || s, trailing: i === void 0 || i });
|
|
757
757
|
}
|
|
758
758
|
let Ct;
|
|
759
|
-
const
|
|
759
|
+
const Ue = (e = !0, t = !1, n = "window") => {
|
|
760
760
|
if (!e)
|
|
761
761
|
return;
|
|
762
762
|
const [r, s] = F.useState(0) || [!1, () => {
|
|
@@ -1227,7 +1227,7 @@ Thank you for helping to protect the Apolitical community from abusive content.`
|
|
|
1227
1227
|
return t.forEach(({ type: r, value: s }) => {
|
|
1228
1228
|
qa(n, r, s);
|
|
1229
1229
|
}), n;
|
|
1230
|
-
}, xr = (e) => new Promise((t) => setTimeout(t, e)),
|
|
1230
|
+
}, xr = (e) => new Promise((t) => setTimeout(t, e)), rt = (e, t) => F.Children.map(e, (n) => F.cloneElement(n, {
|
|
1231
1231
|
...t
|
|
1232
1232
|
})), B = ({
|
|
1233
1233
|
variant: e = "primary",
|
|
@@ -1243,7 +1243,7 @@ Thank you for helping to protect the Apolitical community from abusive content.`
|
|
|
1243
1243
|
children: f = !1,
|
|
1244
1244
|
...d
|
|
1245
1245
|
}) => {
|
|
1246
|
-
const h =
|
|
1246
|
+
const h = Ue(typeof t == "object");
|
|
1247
1247
|
if (typeof t == "object" && typeof h == "number") {
|
|
1248
1248
|
const k = Object.assign({}, t), y = qn(Object.keys(k));
|
|
1249
1249
|
t = Hn(h, y, k);
|
|
@@ -1668,10 +1668,10 @@ const Si = ({
|
|
|
1668
1668
|
e && /* @__PURE__ */ a.jsx(Ya, { initialIsOpen: !1 })
|
|
1669
1669
|
] });
|
|
1670
1670
|
};
|
|
1671
|
-
var Cr = Gt({ client:
|
|
1671
|
+
var Cr = Gt({ client: at });
|
|
1672
1672
|
function Sr(e) {
|
|
1673
1673
|
var t = e.children, n = e.client, r = e.apiKey, s = e.options, i = ft(function() {
|
|
1674
|
-
return n && r && console.warn("[PostHog.js] You have provided both a client and an apiKey to PostHogProvider. The apiKey will be ignored in favour of the client."), n && s && console.warn("[PostHog.js] You have provided both a client and options to PostHogProvider. The options will be ignored in favour of the client."), n || (r && (
|
|
1674
|
+
return n && r && console.warn("[PostHog.js] You have provided both a client and an apiKey to PostHogProvider. The apiKey will be ignored in favour of the client."), n && s && console.warn("[PostHog.js] You have provided both a client and options to PostHogProvider. The options will be ignored in favour of the client."), n || (r && (at.__loaded && console.warn("[PostHog.js] was already loaded elsewhere. This may cause issues."), at.init(r, s)), at);
|
|
1675
1675
|
}, [n, r]);
|
|
1676
1676
|
return F.createElement(Cr.Provider, { value: { client: i } }, t);
|
|
1677
1677
|
}
|
|
@@ -1711,7 +1711,7 @@ const Pr = ({ children: e, user: t }) => /* @__PURE__ */ a.jsx(ke.Provider, { va
|
|
|
1711
1711
|
s({ ...i, isLoading: !1 }), br(5e3);
|
|
1712
1712
|
}).catch(() => s({ isLoading: !1 }));
|
|
1713
1713
|
}, []), /* @__PURE__ */ a.jsx(Nr, { locale: n == null ? void 0 : n.locale, messages: n == null ? void 0 : n.messages, children: /* @__PURE__ */ a.jsx(Ga, { children: /* @__PURE__ */ a.jsx(Pr, { user: r, children: /* @__PURE__ */ a.jsx(Er, { children: /* @__PURE__ */ a.jsx(Mr, { user: r, children: t }) }) }) }) });
|
|
1714
|
-
},
|
|
1714
|
+
}, He = "https://storage.googleapis.com/apolitical-assets/", Be = {
|
|
1715
1715
|
general: "hello@apolitical.co",
|
|
1716
1716
|
support: "concierge@apolitical.co",
|
|
1717
1717
|
"data-protection": {
|
|
@@ -1726,7 +1726,26 @@ const Vn = ({ label: e = !1, className: t = "", children: n }) => {
|
|
|
1726
1726
|
/* @__PURE__ */ a.jsx("div", { className: "content", children: n })
|
|
1727
1727
|
] });
|
|
1728
1728
|
};
|
|
1729
|
-
const we = ({
|
|
1729
|
+
const we = ({
|
|
1730
|
+
variant: e = "primary",
|
|
1731
|
+
icon: t,
|
|
1732
|
+
className: n = "",
|
|
1733
|
+
children: r,
|
|
1734
|
+
...s
|
|
1735
|
+
}) => {
|
|
1736
|
+
const i = t ? { "--icon": `url(${He}icons/${t}.svg)` } : {};
|
|
1737
|
+
return /* @__PURE__ */ a.jsx(
|
|
1738
|
+
"div",
|
|
1739
|
+
{
|
|
1740
|
+
className: w("highlighted-text-box", e, n, {
|
|
1741
|
+
"has-icon": t
|
|
1742
|
+
}),
|
|
1743
|
+
style: i,
|
|
1744
|
+
...s,
|
|
1745
|
+
children: r
|
|
1746
|
+
}
|
|
1747
|
+
);
|
|
1748
|
+
};
|
|
1730
1749
|
const bt = ({
|
|
1731
1750
|
variant: e = "empty",
|
|
1732
1751
|
text: t = !1,
|
|
@@ -1734,7 +1753,7 @@ const bt = ({
|
|
|
1734
1753
|
className: r = ""
|
|
1735
1754
|
}) => {
|
|
1736
1755
|
let s = n && !!Object.keys(n).length;
|
|
1737
|
-
const i = typeof n == "object" && "breakpoints" in n, o =
|
|
1756
|
+
const i = typeof n == "object" && "breakpoints" in n, o = Ue(i);
|
|
1738
1757
|
if (i && typeof n == "object" && typeof o == "number") {
|
|
1739
1758
|
const d = Object.assign({}, n.breakpoints), p = qn(Object.keys(d));
|
|
1740
1759
|
s = Hn(o, p, d);
|
|
@@ -1962,7 +1981,7 @@ const Mt = "loadingBlock_", zr = ({ progress: e = 0, steps: t = !1, className: n
|
|
|
1962
1981
|
const i = Object.keys(t);
|
|
1963
1982
|
for (let c = 0; c < i.length && !(e < parseInt(i[c])); c++)
|
|
1964
1983
|
s = i[c];
|
|
1965
|
-
const o = s && t[s].icon ? { "--icon": `url(${
|
|
1984
|
+
const o = s && t[s].icon ? { "--icon": `url(${He}icons/${t[s].icon}.svg)` } : {};
|
|
1966
1985
|
return /* @__PURE__ */ a.jsxs(
|
|
1967
1986
|
we,
|
|
1968
1987
|
{
|
|
@@ -1997,16 +2016,16 @@ const Yt = {
|
|
|
1997
2016
|
}, Gn = (e, t) => e in Yt ? /* @__PURE__ */ a.jsx("div", { className: e, children: Yt[e].map((n, r) => Gn(n, r)) }, t) : /* @__PURE__ */ a.jsx(_e, { className: e }, t), Kn = ({ layout: e = "overview-page", ...t }) => /* @__PURE__ */ a.jsx("div", { className: w("loading-state", e), ...t, children: Yt[e].map((n, r) => Gn(n, r)) }), Qn = (e) => {
|
|
1998
2017
|
const t = e && e.toUpperCase().split(" ");
|
|
1999
2018
|
return Array.isArray(t) && t.length > 1 && t[0] !== "" ? t[1] === "" ? t[0][0] : t[0][0] + t[t.length - 1][0] : e ? e.substr(0, 1) : "";
|
|
2000
|
-
},
|
|
2001
|
-
const t = Math.ceil(26 /
|
|
2019
|
+
}, Ge = ["#5AB6A3", "#A2D7AF", "#806056", "#3962B3"], Wr = (e) => {
|
|
2020
|
+
const t = Math.ceil(26 / Ge.length), n = Qn(e).toLowerCase();
|
|
2002
2021
|
if (n === "")
|
|
2003
|
-
return
|
|
2022
|
+
return Ge[0];
|
|
2004
2023
|
const r = n.charCodeAt(0) - 96;
|
|
2005
|
-
for (let s = 0; s <
|
|
2024
|
+
for (let s = 0; s < Ge.length; s++)
|
|
2006
2025
|
if (r <= t * (s + 1))
|
|
2007
|
-
return
|
|
2026
|
+
return Ge[s];
|
|
2008
2027
|
};
|
|
2009
|
-
const wn = 256,
|
|
2028
|
+
const wn = 256, ze = ({
|
|
2010
2029
|
className: e = "",
|
|
2011
2030
|
src: t = "",
|
|
2012
2031
|
name: n,
|
|
@@ -2047,9 +2066,9 @@ const wn = 256, Ue = ({
|
|
|
2047
2066
|
}
|
|
2048
2067
|
);
|
|
2049
2068
|
}, Jn = (e) => e === "apolitical" ? {
|
|
2050
|
-
image: `${
|
|
2069
|
+
image: `${He}logos/member_apolitical.svg`
|
|
2051
2070
|
} : e === "community" || typeof e == "object" && !e.name ? {
|
|
2052
|
-
image: `${
|
|
2071
|
+
image: `${He}logos/member_community.svg`
|
|
2053
2072
|
} : {
|
|
2054
2073
|
name: e.name,
|
|
2055
2074
|
role: e.jobTitle || "",
|
|
@@ -2093,7 +2112,7 @@ const Xt = ({
|
|
|
2093
2112
|
g == null || g.stopPropagation();
|
|
2094
2113
|
},
|
|
2095
2114
|
children: [
|
|
2096
|
-
/* @__PURE__ */ a.jsx(
|
|
2115
|
+
/* @__PURE__ */ a.jsx(ze, { name: m, src: f }),
|
|
2097
2116
|
/* @__PURE__ */ a.jsxs("p", { className: "details", children: [
|
|
2098
2117
|
/* @__PURE__ */ a.jsx("strong", { children: m }),
|
|
2099
2118
|
n && /* @__PURE__ */ a.jsxs("span", { className: "additional-content", children: [
|
|
@@ -2135,7 +2154,7 @@ const Tn = {
|
|
|
2135
2154
|
if (o)
|
|
2136
2155
|
return /* @__PURE__ */ a.jsx(_e, { element: "li", className: "contributor" }, p);
|
|
2137
2156
|
h = /* @__PURE__ */ a.jsx(
|
|
2138
|
-
|
|
2157
|
+
ze,
|
|
2139
2158
|
{
|
|
2140
2159
|
name: b,
|
|
2141
2160
|
src: k,
|
|
@@ -2351,7 +2370,7 @@ const Tn = {
|
|
|
2351
2370
|
star: "star_empty_thin"
|
|
2352
2371
|
}, Kr = (e) => {
|
|
2353
2372
|
let t = e;
|
|
2354
|
-
return Object.keys($n).includes(e) && (t = $n[e]), `url(${
|
|
2373
|
+
return Object.keys($n).includes(e) && (t = $n[e]), `url(${He}icons/${t}.svg)`;
|
|
2355
2374
|
};
|
|
2356
2375
|
const Qr = {
|
|
2357
2376
|
title: 66,
|
|
@@ -2432,7 +2451,7 @@ const Qr = {
|
|
|
2432
2451
|
d.registered && /* @__PURE__ */ a.jsx(st, { size: "small", variant: "registered", children: o.formatMessage({ id: "card_registered" }) }),
|
|
2433
2452
|
/* @__PURE__ */ a.jsx(Wn, { image: d.banner })
|
|
2434
2453
|
] }) : k === "people" ? /* @__PURE__ */ a.jsx(
|
|
2435
|
-
|
|
2454
|
+
ze,
|
|
2436
2455
|
{
|
|
2437
2456
|
name: d.title || "",
|
|
2438
2457
|
src: d.profile,
|
|
@@ -2510,7 +2529,7 @@ const Nt = {
|
|
|
2510
2529
|
threeCards: 769,
|
|
2511
2530
|
twoCards: 480
|
|
2512
2531
|
};
|
|
2513
|
-
let
|
|
2532
|
+
let Ke = null;
|
|
2514
2533
|
const ts = ({
|
|
2515
2534
|
id: e,
|
|
2516
2535
|
cards: t,
|
|
@@ -2527,7 +2546,7 @@ const ts = ({
|
|
|
2527
2546
|
}), { cardsPerPage: f, isLoading: d } = m, [p, h] = D({
|
|
2528
2547
|
currentPage: 0,
|
|
2529
2548
|
loadedPages: [0]
|
|
2530
|
-
}), { currentPage: g, loadedPages: b } = p, k = t.length, y = Math.ceil(k / f), _ = ne(null), v =
|
|
2549
|
+
}), { currentPage: g, loadedPages: b } = p, k = t.length, y = Math.ceil(k / f), _ = ne(null), v = Ue(!0, !0, _ == null ? void 0 : _.current);
|
|
2531
2550
|
G(() => {
|
|
2532
2551
|
let S = 1;
|
|
2533
2552
|
v && (v >= Nt.fourCards ? S = 4 : v >= Nt.threeCards ? S = 3 : v >= Nt.twoCards && (S = 2), S > k && (S = k)), l((M) => ({
|
|
@@ -2556,12 +2575,12 @@ const ts = ({
|
|
|
2556
2575
|
loadedPages: [.../* @__PURE__ */ new Set([...b, M])]
|
|
2557
2576
|
}));
|
|
2558
2577
|
}, $ = (S) => {
|
|
2559
|
-
|
|
2578
|
+
Ke = S.touches[0].clientX;
|
|
2560
2579
|
}, C = (S) => {
|
|
2561
|
-
if (
|
|
2580
|
+
if (Ke === null)
|
|
2562
2581
|
return;
|
|
2563
|
-
const M = S.touches[0].clientX, E =
|
|
2564
|
-
E > 5 ? j("next") : E < -5 && j("previous"),
|
|
2582
|
+
const M = S.touches[0].clientX, E = Ke - M;
|
|
2583
|
+
E > 5 ? j("next") : E < -5 && j("previous"), Ke = null;
|
|
2565
2584
|
}, Z = {
|
|
2566
2585
|
"--width": `${((L = _ == null ? void 0 : _.current) == null ? void 0 : L.offsetWidth) || 0}px`,
|
|
2567
2586
|
"--total-cards": k,
|
|
@@ -2809,7 +2828,7 @@ const Ri = ({
|
|
|
2809
2828
|
i === "before-lang" ? r += `/${s}` : (r.includes(`/${n}/`) || (r += `/${n}`), r += `/${s}`);
|
|
2810
2829
|
}), r.includes(`/${n}/`) || (r += `/${n}`), r;
|
|
2811
2830
|
};
|
|
2812
|
-
const Ft = { en: "English", es: "Español", fr: "Français", pt: "Português" },
|
|
2831
|
+
const Ft = { en: "English", es: "Español", fr: "Français", pt: "Português" }, Qe = "languageSwitcher_", Ii = ({
|
|
2813
2832
|
currentLanguage: e,
|
|
2814
2833
|
isOriginalLanguage: t = !1,
|
|
2815
2834
|
isHumanTranslation: n = !1,
|
|
@@ -2829,12 +2848,12 @@ const Ft = { en: "English", es: "Español", fr: "Français", pt: "Português" },
|
|
|
2829
2848
|
const h = Object.keys(r), g = f !== e;
|
|
2830
2849
|
return /* @__PURE__ */ a.jsxs("div", { className: w("language-switcher text-small", o, m), children: [
|
|
2831
2850
|
/* @__PURE__ */ a.jsxs("nav", { children: [
|
|
2832
|
-
o !== "short" && /* @__PURE__ */ a.jsx("p", { children: c || l.formatMessage({ id: `${
|
|
2851
|
+
o !== "short" && /* @__PURE__ */ a.jsx("p", { children: c || l.formatMessage({ id: `${Qe}label` }) }),
|
|
2833
2852
|
/* @__PURE__ */ a.jsx("ul", { children: h.map((b) => {
|
|
2834
2853
|
if (!Ft[b])
|
|
2835
2854
|
return null;
|
|
2836
2855
|
let k = { className: b };
|
|
2837
|
-
return f === b ? k["aria-label"] = l.formatMessage({ id: `${
|
|
2856
|
+
return f === b ? k["aria-label"] = l.formatMessage({ id: `${Qe}selected` }, { language: Ft[b] }) : k = {
|
|
2838
2857
|
...k,
|
|
2839
2858
|
href: ns(b, i),
|
|
2840
2859
|
onClick: (y) => {
|
|
@@ -2842,13 +2861,13 @@ const Ft = { en: "English", es: "Español", fr: "Français", pt: "Português" },
|
|
|
2842
2861
|
}
|
|
2843
2862
|
}, /* @__PURE__ */ a.jsx("li", { children: /* @__PURE__ */ a.jsx(gt, { ...k, fallbackElement: "span", children: Ft[b] }) }, b);
|
|
2844
2863
|
}) }),
|
|
2845
|
-
o !== "short" && !g && /* @__PURE__ */ a.jsx("p", { children: l.formatMessage({ id: `${
|
|
2864
|
+
o !== "short" && !g && /* @__PURE__ */ a.jsx("p", { children: l.formatMessage({ id: `${Qe}translation_${t ? "original" : n ? "human" : "machine"}` }) })
|
|
2846
2865
|
] }),
|
|
2847
2866
|
o !== "short" && !g && !t && !n && /* @__PURE__ */ a.jsx("small", {
|
|
2848
2867
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
2849
2868
|
// @ts-ignore
|
|
2850
2869
|
// `values` are throwing a type error: https://github.com/formatjs/formatjs/issues/3633
|
|
2851
|
-
children: l.formatMessage({ id: `${
|
|
2870
|
+
children: l.formatMessage({ id: `${Qe}disclaimer` }, {
|
|
2852
2871
|
email: Be.support,
|
|
2853
2872
|
link: (b) => {
|
|
2854
2873
|
const k = `mailto:${b}`;
|
|
@@ -2893,7 +2912,7 @@ const Dt = Ua({ locale: "en", messages: Qt }), yt = ({
|
|
|
2893
2912
|
) : r.endOfFeed && (!o || o != null && o.includes("Cannot read items")) ? /* @__PURE__ */ a.jsx("p", { children: r.endOfFeed }) : o && /* @__PURE__ */ a.jsx("p", { className: "error", children: r.error }) });
|
|
2894
2913
|
};
|
|
2895
2914
|
const na = ({ variant: e = "default", version: t = "default", className: n = "", ...r }) => /* @__PURE__ */ a.jsx("p", { className: "logo-wrapper", children: /* @__PURE__ */ a.jsx("a", { href: "/home/", className: w("logo", e, t, n), ...r, children: /* @__PURE__ */ a.jsx(ae, { children: /* @__PURE__ */ a.jsx(je, { id: "apolitical" }) }) }) });
|
|
2896
|
-
let
|
|
2915
|
+
let Je = !1;
|
|
2897
2916
|
const as = ({ element: e = "div", id: t = "more-menu", options: n, className: r = "" }) => {
|
|
2898
2917
|
const s = A(), i = ne(null), [o, c] = D(!1), m = (l) => {
|
|
2899
2918
|
i.current && l.target instanceof HTMLElement && !i.current.contains(l.target) && c(!1);
|
|
@@ -2924,10 +2943,10 @@ const as = ({ element: e = "div", id: t = "more-menu", options: n, className: r
|
|
|
2924
2943
|
c(!1), typeof f == "function" && f(k);
|
|
2925
2944
|
},
|
|
2926
2945
|
onFocus: () => {
|
|
2927
|
-
|
|
2946
|
+
Je && (clearTimeout(Je), Je = !1);
|
|
2928
2947
|
},
|
|
2929
2948
|
onBlur: () => {
|
|
2930
|
-
|
|
2949
|
+
Je = setTimeout(() => {
|
|
2931
2950
|
c(!1);
|
|
2932
2951
|
}, 100);
|
|
2933
2952
|
}
|
|
@@ -2992,7 +3011,7 @@ const ss = [
|
|
|
2992
3011
|
className: "gtm-trackable",
|
|
2993
3012
|
children: [
|
|
2994
3013
|
/* @__PURE__ */ a.jsx(
|
|
2995
|
-
|
|
3014
|
+
ze,
|
|
2996
3015
|
{
|
|
2997
3016
|
name: (n == null ? void 0 : n.name) || "",
|
|
2998
3017
|
src: n != null && n.image ? n.image.thumbnail : ""
|
|
@@ -3145,7 +3164,7 @@ const ls = {
|
|
|
3145
3164
|
className: n = "",
|
|
3146
3165
|
children: r
|
|
3147
3166
|
}) => {
|
|
3148
|
-
const s =
|
|
3167
|
+
const s = Ue(!0);
|
|
3149
3168
|
let i = r;
|
|
3150
3169
|
return F.Children.count(r) === 1 && (i = F.Children.toArray(r)[0], i.props && (i = i.props.children)), /* @__PURE__ */ a.jsx("section", { className: w("columns", `layout-${e}`, n), children: F.Children.map(i, (o, c) => t !== !1 && c === t && s && s < ls[e] ? null : o) });
|
|
3151
3170
|
}, Zi = ({ activeLink: e, ...t }) => /* @__PURE__ */ a.jsx(_t, { children: /* @__PURE__ */ a.jsx(ds, { layout: "1-3", children: /* @__PURE__ */ a.jsxs(a.Fragment, { children: [
|
|
@@ -3365,13 +3384,13 @@ const Me = "footer_", ot = "SiteFooter", En = ({ group: e }) => {
|
|
|
3365
3384
|
/* @__PURE__ */ a.jsx("small", { children: /* @__PURE__ */ a.jsx(je, { id: `${Me}copyright`, values: { currentYear: (/* @__PURE__ */ new Date()).getFullYear() } }) })
|
|
3366
3385
|
] })
|
|
3367
3386
|
] }) });
|
|
3368
|
-
const
|
|
3369
|
-
const s = A(), [i, o] = D({ path: `${
|
|
3387
|
+
const Xe = "emailHelperTextBox_", qi = ({ type: e, email: t, redirectPath: n, resendVerificationCode: r }) => {
|
|
3388
|
+
const s = A(), [i, o] = D({ path: `${Xe}default`, type: "default", link: {}, mail: {}, error: "" }), [c, m] = D(!1), l = Ln(
|
|
3370
3389
|
(h) => {
|
|
3371
3390
|
h.preventDefault(), h.stopPropagation();
|
|
3372
3391
|
const g = (b) => {
|
|
3373
3392
|
o({
|
|
3374
|
-
path: `${
|
|
3393
|
+
path: `${Xe}error_verificationFailedToSend`,
|
|
3375
3394
|
type: "error",
|
|
3376
3395
|
link: {
|
|
3377
3396
|
"data-gtm-event-context": "VerifyEmailBox",
|
|
@@ -3391,7 +3410,7 @@ const Je = "emailHelperTextBox_", qi = ({ type: e, email: t, redirectPath: n, re
|
|
|
3391
3410
|
});
|
|
3392
3411
|
};
|
|
3393
3412
|
if (typeof r != "function") {
|
|
3394
|
-
g(s.formatMessage({ id: `${
|
|
3413
|
+
g(s.formatMessage({ id: `${Xe}error_noFunction` }));
|
|
3395
3414
|
return;
|
|
3396
3415
|
}
|
|
3397
3416
|
m(!0), r(t).then(() => {
|
|
@@ -3407,7 +3426,7 @@ const Je = "emailHelperTextBox_", qi = ({ type: e, email: t, redirectPath: n, re
|
|
|
3407
3426
|
);
|
|
3408
3427
|
G(
|
|
3409
3428
|
() => {
|
|
3410
|
-
let h =
|
|
3429
|
+
let h = Xe, g = "default", b = {}, k = {};
|
|
3411
3430
|
switch (e) {
|
|
3412
3431
|
case "gov":
|
|
3413
3432
|
h += "autoApproved", g = "success";
|
|
@@ -3487,24 +3506,24 @@ const Je = "emailHelperTextBox_", qi = ({ type: e, email: t, redirectPath: n, re
|
|
|
3487
3506
|
)
|
|
3488
3507
|
) });
|
|
3489
3508
|
};
|
|
3490
|
-
const
|
|
3509
|
+
const et = "passwordRules_", ra = "isMoreThanEightCharacters", sa = "includesNumberAndSymbol", ia = "includesLowerAndUppercase", ms = {
|
|
3491
3510
|
[ra]: "8Characters",
|
|
3492
3511
|
[sa]: "numberSymbol",
|
|
3493
3512
|
[ia]: "lowercaseUppercase"
|
|
3494
3513
|
}, fs = ({ matchingRules: e = { isMoreThanEightCharacters: !1, includesNumberAndSymbol: !1, includesLowerAndUppercase: !1 }, className: t = "" }) => {
|
|
3495
3514
|
const n = A();
|
|
3496
3515
|
return /* @__PURE__ */ a.jsxs("aside", { className: w("password-rules", t), children: [
|
|
3497
|
-
/* @__PURE__ */ a.jsx("small", { children: n.formatMessage({ id: `${
|
|
3516
|
+
/* @__PURE__ */ a.jsx("small", { children: n.formatMessage({ id: `${et}intro` }) }),
|
|
3498
3517
|
/* @__PURE__ */ a.jsx("ul", { children: [ra, sa, ia].map((r) => /* @__PURE__ */ a.jsxs("li", { className: w({ matches: e[r] }), children: [
|
|
3499
3518
|
/* @__PURE__ */ a.jsxs(ae, { children: [
|
|
3500
|
-
n.formatMessage({ id: `${
|
|
3519
|
+
n.formatMessage({ id: `${et}rule_label` }),
|
|
3501
3520
|
" "
|
|
3502
3521
|
] }),
|
|
3503
|
-
/* @__PURE__ */ a.jsx("span", { children: n.formatMessage({ id: `${
|
|
3522
|
+
/* @__PURE__ */ a.jsx("span", { children: n.formatMessage({ id: `${et}rule_${ms[r]}` }) }),
|
|
3504
3523
|
!e[r] && /* @__PURE__ */ a.jsxs(ae, { element: "strong", children: [
|
|
3505
3524
|
" ",
|
|
3506
3525
|
" ",
|
|
3507
|
-
n.formatMessage({ id: `${
|
|
3526
|
+
n.formatMessage({ id: `${et}notMet` })
|
|
3508
3527
|
] })
|
|
3509
3528
|
] }, `rule-${r}`)) })
|
|
3510
3529
|
] });
|
|
@@ -3971,7 +3990,7 @@ const hs = ({
|
|
|
3971
3990
|
] }, e);
|
|
3972
3991
|
};
|
|
3973
3992
|
const gs = { height: 67, height_desktop: 83 }, oa = ({ showNavigation: e = !0 }) => {
|
|
3974
|
-
const t = A(), n = ge(ke), r =
|
|
3993
|
+
const t = A(), n = ge(ke), r = Ue(!0, !0), s = n && typeof n.id == "string", i = ft(
|
|
3975
3994
|
() => U.getIsDesktopVersion(s, r),
|
|
3976
3995
|
[s, r]
|
|
3977
3996
|
), [o, c] = Oa(vr, {
|
|
@@ -4122,7 +4141,7 @@ const gs = { height: 67, height_desktop: 83 }, oa = ({ showNavigation: e = !0 })
|
|
|
4122
4141
|
id: `header_account_${l.account ? "hide" : "show"}`
|
|
4123
4142
|
}) }),
|
|
4124
4143
|
/* @__PURE__ */ a.jsx(
|
|
4125
|
-
|
|
4144
|
+
ze,
|
|
4126
4145
|
{
|
|
4127
4146
|
name: n && n.name || "",
|
|
4128
4147
|
src: n && n.image && n.image.thumbnail || ""
|
|
@@ -4275,9 +4294,9 @@ const bs = () => {
|
|
|
4275
4294
|
G(() => {
|
|
4276
4295
|
window.scrollTo(0, 0);
|
|
4277
4296
|
}, [h]);
|
|
4278
|
-
const g =
|
|
4297
|
+
const g = rt(e, { locale: c }), b = rt(t, {
|
|
4279
4298
|
locale: c
|
|
4280
|
-
}), k =
|
|
4299
|
+
}), k = rt(n, {
|
|
4281
4300
|
locale: c
|
|
4282
4301
|
}), y = {};
|
|
4283
4302
|
return f !== "default" && (y[f] = !0), d !== "default" && (y[d] = !0), p !== "default" && (y[p] = !0), /* @__PURE__ */ a.jsx(Ja, { onError: r, fallback: /* @__PURE__ */ a.jsx(bs, {}), children: /* @__PURE__ */ a.jsx(Ba, { fallback: null, children: /* @__PURE__ */ a.jsxs(
|
|
@@ -4393,7 +4412,7 @@ const Vi = ({
|
|
|
4393
4412
|
)
|
|
4394
4413
|
] });
|
|
4395
4414
|
};
|
|
4396
|
-
let
|
|
4415
|
+
let tt = null;
|
|
4397
4416
|
const le = "discussion_form_", en = ({
|
|
4398
4417
|
content: e = { type: "response", slugs: {} },
|
|
4399
4418
|
userHasPermissions: t = !0,
|
|
@@ -4462,7 +4481,7 @@ const le = "discussion_form_", en = ({
|
|
|
4462
4481
|
var H;
|
|
4463
4482
|
if (N.preventDefault(), N.stopPropagation(), !f || !f.id || !t || C)
|
|
4464
4483
|
return;
|
|
4465
|
-
|
|
4484
|
+
tt && clearTimeout(tt), k("submitting");
|
|
4466
4485
|
const q = window.location.pathname;
|
|
4467
4486
|
try {
|
|
4468
4487
|
let Y;
|
|
@@ -4492,7 +4511,7 @@ const le = "discussion_form_", en = ({
|
|
|
4492
4511
|
default:
|
|
4493
4512
|
break;
|
|
4494
4513
|
}
|
|
4495
|
-
await xr(1e3), c.callback && await c.callback(Y),
|
|
4514
|
+
await xr(1e3), c.callback && await c.callback(Y), tt = setTimeout(() => {
|
|
4496
4515
|
p(""), k("submitted"), $();
|
|
4497
4516
|
}, 500);
|
|
4498
4517
|
} catch (Y) {
|
|
@@ -4511,7 +4530,7 @@ const le = "discussion_form_", en = ({
|
|
|
4511
4530
|
) : Q.message.includes("400") && (z = `${le}error`), g(z), $();
|
|
4512
4531
|
}
|
|
4513
4532
|
}, $ = () => {
|
|
4514
|
-
|
|
4533
|
+
tt = setTimeout(() => {
|
|
4515
4534
|
g(!1), k(!1);
|
|
4516
4535
|
}, 5e3);
|
|
4517
4536
|
}, C = !d || !yr(d), Z = b === "submitting", L = [];
|
|
@@ -5102,7 +5121,7 @@ const Es = ({ count: e = "", showRepliesButton: t = !0, children: n }) => {
|
|
|
5102
5121
|
"opening",
|
|
5103
5122
|
"open"
|
|
5104
5123
|
/* Open */
|
|
5105
|
-
].includes(o), f =
|
|
5124
|
+
].includes(o), f = rt(n, {
|
|
5106
5125
|
element: "li"
|
|
5107
5126
|
});
|
|
5108
5127
|
return /* @__PURE__ */ a.jsxs("div", { className: "thread-wrapper", children: [
|
|
@@ -6961,10 +6980,10 @@ const Qi = ({
|
|
|
6961
6980
|
contributors: ["community"]
|
|
6962
6981
|
}
|
|
6963
6982
|
];
|
|
6964
|
-
const
|
|
6983
|
+
const nt = "notFoundError_", Xi = () => {
|
|
6965
6984
|
const e = A(), t = [];
|
|
6966
6985
|
return Dn.forEach((n, r) => {
|
|
6967
|
-
n.title = e.formatMessage({ id: `${
|
|
6986
|
+
n.title = e.formatMessage({ id: `${nt}post_${r + 1}` }), t.push("solutionArticle");
|
|
6968
6987
|
}), /* @__PURE__ */ a.jsxs(
|
|
6969
6988
|
ys,
|
|
6970
6989
|
{
|
|
@@ -6981,21 +7000,21 @@ const tt = "notFoundError_", Xi = () => {
|
|
|
6981
7000
|
})
|
|
6982
7001
|
}
|
|
6983
7002
|
),
|
|
6984
|
-
/* @__PURE__ */ a.jsx(B, { href: "/solution-articles/", children: e.formatMessage({ id: `${
|
|
7003
|
+
/* @__PURE__ */ a.jsx(B, { href: "/solution-articles/", children: e.formatMessage({ id: `${nt}cta` }) })
|
|
6985
7004
|
] })
|
|
6986
7005
|
},
|
|
6987
7006
|
reportError: () => {
|
|
6988
7007
|
},
|
|
6989
7008
|
className: "not-found-error",
|
|
6990
7009
|
children: [
|
|
6991
|
-
/* @__PURE__ */ a.jsx("h1", { children: e.formatMessage({ id: `${
|
|
6992
|
-
/* @__PURE__ */ a.jsx("p", { children: e.formatMessage({ id: `${
|
|
7010
|
+
/* @__PURE__ */ a.jsx("h1", { children: e.formatMessage({ id: `${nt}title` }) }),
|
|
7011
|
+
/* @__PURE__ */ a.jsx("p", { children: e.formatMessage({ id: `${nt}text` }) })
|
|
6993
7012
|
]
|
|
6994
7013
|
}
|
|
6995
7014
|
);
|
|
6996
7015
|
};
|
|
6997
7016
|
export {
|
|
6998
|
-
|
|
7017
|
+
He as ASSETS_BUCKET,
|
|
6999
7018
|
Gi as ActivitiesFeed,
|
|
7000
7019
|
Qi as ActivitySection,
|
|
7001
7020
|
da as AddPost,
|
|
@@ -7059,7 +7078,7 @@ export {
|
|
|
7059
7078
|
ys as PageLayout,
|
|
7060
7079
|
Hi as PasswordRules,
|
|
7061
7080
|
st as Pill,
|
|
7062
|
-
|
|
7081
|
+
ze as ProfilePicture,
|
|
7063
7082
|
Ur as ProgressBar,
|
|
7064
7083
|
Ui as Rating,
|
|
7065
7084
|
si as RepliesFeed,
|
|
@@ -7084,7 +7103,7 @@ export {
|
|
|
7084
7103
|
Ki as repliesFeedMock,
|
|
7085
7104
|
or as useCurrentPath,
|
|
7086
7105
|
Pe as useEffectAfterMount,
|
|
7087
|
-
|
|
7106
|
+
Ue as useElementWidth,
|
|
7088
7107
|
lr as useScrollListener,
|
|
7089
7108
|
dr as useScrollToHash,
|
|
7090
7109
|
Jt as useUser
|