titaned-frontend-library 1.0.21 → 1.0.22
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/dist/components/AnnouncementBanner.scss +16 -32
- package/dist/index.cjs +6 -6
- package/dist/index.css +1 -1
- package/dist/index.js +188 -192
- package/dist/interfaces/components.d.ts +1 -0
- package/package.json +1 -1
- package/src/components/common/AnnouncementBanner/AnnouncementBanner.scss +16 -32
- package/src/components/common/AnnouncementBanner/AnnouncementBanner.tsx +14 -13
- package/src/interfaces/components.ts +1 -0
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as D from "react";
|
|
2
|
-
import ur, { createContext as dr, useState as R, useContext as fr, useRef as _e, useEffect as
|
|
2
|
+
import ur, { createContext as dr, useState as R, useContext as fr, useRef as _e, useEffect as re } from "react";
|
|
3
3
|
import { OverlayTrigger as Ir, Button as $e, Tooltip as Dr, DropdownButton as $r, Dropdown as ee, Avatar as Lr, Icon as U, IconButton as Re, Navbar as Ce, IconButtonWithTooltip as se, Nav as Ge, NavDropdown as Xe } from "@openedx/paragon";
|
|
4
4
|
var Oe = { exports: {} }, ve = {};
|
|
5
5
|
/*
|
|
@@ -17,19 +17,19 @@ function hr() {
|
|
|
17
17
|
throw new TypeError("Object.assign cannot be called with null or undefined");
|
|
18
18
|
return Object(h);
|
|
19
19
|
}
|
|
20
|
-
function
|
|
20
|
+
function v() {
|
|
21
21
|
try {
|
|
22
22
|
if (!Object.assign)
|
|
23
23
|
return !1;
|
|
24
24
|
var h = new String("abc");
|
|
25
25
|
if (h[5] = "de", Object.getOwnPropertyNames(h)[0] === "5")
|
|
26
26
|
return !1;
|
|
27
|
-
for (var w = {},
|
|
28
|
-
w["_" + String.fromCharCode(
|
|
29
|
-
var
|
|
27
|
+
for (var w = {}, p = 0; p < 10; p++)
|
|
28
|
+
w["_" + String.fromCharCode(p)] = p;
|
|
29
|
+
var g = Object.getOwnPropertyNames(w).map(function(c) {
|
|
30
30
|
return w[c];
|
|
31
31
|
});
|
|
32
|
-
if (
|
|
32
|
+
if (g.join("") !== "0123456789")
|
|
33
33
|
return !1;
|
|
34
34
|
var o = {};
|
|
35
35
|
return "abcdefghijklmnopqrst".split("").forEach(function(c) {
|
|
@@ -39,18 +39,18 @@ function hr() {
|
|
|
39
39
|
return !1;
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
|
-
return Me =
|
|
43
|
-
for (var
|
|
44
|
-
|
|
45
|
-
for (var d in
|
|
46
|
-
i.call(
|
|
42
|
+
return Me = v() ? Object.assign : function(h, w) {
|
|
43
|
+
for (var p, g = n(h), o, c = 1; c < arguments.length; c++) {
|
|
44
|
+
p = Object(arguments[c]);
|
|
45
|
+
for (var d in p)
|
|
46
|
+
i.call(p, d) && (g[d] = p[d]);
|
|
47
47
|
if (t) {
|
|
48
|
-
o = t(
|
|
49
|
-
for (var
|
|
50
|
-
s.call(
|
|
48
|
+
o = t(p);
|
|
49
|
+
for (var f = 0; f < o.length; f++)
|
|
50
|
+
s.call(p, o[f]) && (g[o[f]] = p[o[f]]);
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
|
-
return
|
|
53
|
+
return g;
|
|
54
54
|
}, Me;
|
|
55
55
|
}
|
|
56
56
|
/** @license React v17.0.2
|
|
@@ -70,13 +70,13 @@ function Hr() {
|
|
|
70
70
|
var s = Symbol.for;
|
|
71
71
|
i = s("react.element"), ve.Fragment = s("react.fragment");
|
|
72
72
|
}
|
|
73
|
-
var n = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,
|
|
74
|
-
function w(
|
|
75
|
-
var c, d = {},
|
|
76
|
-
o !== void 0 && (
|
|
77
|
-
for (c in
|
|
78
|
-
if (
|
|
79
|
-
return { $$typeof: i, type:
|
|
73
|
+
var n = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, v = Object.prototype.hasOwnProperty, h = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
74
|
+
function w(p, g, o) {
|
|
75
|
+
var c, d = {}, f = null, b = null;
|
|
76
|
+
o !== void 0 && (f = "" + o), g.key !== void 0 && (f = "" + g.key), g.ref !== void 0 && (b = g.ref);
|
|
77
|
+
for (c in g) v.call(g, c) && !h.hasOwnProperty(c) && (d[c] = g[c]);
|
|
78
|
+
if (p && p.defaultProps) for (c in g = p.defaultProps, g) d[c] === void 0 && (d[c] = g[c]);
|
|
79
|
+
return { $$typeof: i, type: p, key: f, ref: b, props: d, _owner: n.current };
|
|
80
80
|
}
|
|
81
81
|
return ve.jsx = w, ve.jsxs = w, ve;
|
|
82
82
|
}
|
|
@@ -93,12 +93,12 @@ var Be;
|
|
|
93
93
|
function Fr() {
|
|
94
94
|
return Be || (Be = 1, (function(t) {
|
|
95
95
|
process.env.NODE_ENV !== "production" && (function() {
|
|
96
|
-
var i = ur, s = hr(), n = 60103,
|
|
96
|
+
var i = ur, s = hr(), n = 60103, v = 60106;
|
|
97
97
|
t.Fragment = 60107;
|
|
98
|
-
var h = 60108, w = 60114,
|
|
98
|
+
var h = 60108, w = 60114, p = 60109, g = 60110, o = 60112, c = 60113, d = 60120, f = 60115, b = 60116, u = 60121, P = 60122, G = 60117, j = 60129, I = 60131;
|
|
99
99
|
if (typeof Symbol == "function" && Symbol.for) {
|
|
100
100
|
var S = Symbol.for;
|
|
101
|
-
n = S("react.element"),
|
|
101
|
+
n = S("react.element"), v = S("react.portal"), t.Fragment = S("react.fragment"), h = S("react.strict_mode"), w = S("react.profiler"), p = S("react.provider"), g = S("react.context"), o = S("react.forward_ref"), c = S("react.suspense"), d = S("react.suspense_list"), f = S("react.memo"), b = S("react.lazy"), u = S("react.block"), P = S("react.server.block"), G = S("react.fundamental"), S("react.scope"), S("react.opaque.id"), j = S("react.debug_trace_mode"), S("react.offscreen"), I = S("react.legacy_hidden");
|
|
102
102
|
}
|
|
103
103
|
var X = typeof Symbol == "function" && Symbol.iterator, $ = "@@iterator";
|
|
104
104
|
function Z(e) {
|
|
@@ -125,9 +125,9 @@ function Fr() {
|
|
|
125
125
|
O.unshift("Warning: " + a), Function.prototype.apply.call(console[e], console, O);
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
|
-
var
|
|
128
|
+
var te = !1;
|
|
129
129
|
function F(e) {
|
|
130
|
-
return !!(typeof e == "string" || typeof e == "function" || e === t.Fragment || e === w || e === j || e === h || e === c || e === d || e === I ||
|
|
130
|
+
return !!(typeof e == "string" || typeof e == "function" || e === t.Fragment || e === w || e === j || e === h || e === c || e === d || e === I || te || typeof e == "object" && e !== null && (e.$$typeof === b || e.$$typeof === f || e.$$typeof === p || e.$$typeof === g || e.$$typeof === o || e.$$typeof === G || e.$$typeof === u || e[0] === P));
|
|
131
131
|
}
|
|
132
132
|
function L(e, a, l) {
|
|
133
133
|
var x = a.displayName || a.name || "";
|
|
@@ -146,7 +146,7 @@ function Fr() {
|
|
|
146
146
|
switch (e) {
|
|
147
147
|
case t.Fragment:
|
|
148
148
|
return "Fragment";
|
|
149
|
-
case
|
|
149
|
+
case v:
|
|
150
150
|
return "Portal";
|
|
151
151
|
case w:
|
|
152
152
|
return "Profiler";
|
|
@@ -159,15 +159,15 @@ function Fr() {
|
|
|
159
159
|
}
|
|
160
160
|
if (typeof e == "object")
|
|
161
161
|
switch (e.$$typeof) {
|
|
162
|
-
case
|
|
162
|
+
case g:
|
|
163
163
|
var a = e;
|
|
164
164
|
return V(a) + ".Consumer";
|
|
165
|
-
case
|
|
165
|
+
case p:
|
|
166
166
|
var l = e;
|
|
167
167
|
return V(l._context) + ".Provider";
|
|
168
168
|
case o:
|
|
169
169
|
return L(e, e.render, "ForwardRef");
|
|
170
|
-
case
|
|
170
|
+
case f:
|
|
171
171
|
return M(e.type);
|
|
172
172
|
case u:
|
|
173
173
|
return M(e._render);
|
|
@@ -358,7 +358,7 @@ function Fr() {
|
|
|
358
358
|
switch (e.$$typeof) {
|
|
359
359
|
case o:
|
|
360
360
|
return we(e.render);
|
|
361
|
-
case
|
|
361
|
+
case f:
|
|
362
362
|
return le(e.type, a, l);
|
|
363
363
|
case u:
|
|
364
364
|
return we(e._render);
|
|
@@ -576,7 +576,7 @@ Check the top-level render call using <` + l + ">.");
|
|
|
576
576
|
l = a.propTypes;
|
|
577
577
|
else if (typeof a == "object" && (a.$$typeof === o || // Note: Memo only checks outer props here.
|
|
578
578
|
// Inner props are checked in the reconciler.
|
|
579
|
-
a.$$typeof ===
|
|
579
|
+
a.$$typeof === f))
|
|
580
580
|
l = a.propTypes;
|
|
581
581
|
else
|
|
582
582
|
return;
|
|
@@ -649,7 +649,7 @@ function zr() {
|
|
|
649
649
|
return er || (er = 1, process.env.NODE_ENV === "production" ? Oe.exports = Hr() : Oe.exports = Fr()), Oe.exports;
|
|
650
650
|
}
|
|
651
651
|
var r = zr();
|
|
652
|
-
const st = ({ contactInfo: t, quickLinks: i, exploreLinks: s, logoUrl: n, copyrights:
|
|
652
|
+
const st = ({ contactInfo: t, quickLinks: i, exploreLinks: s, logoUrl: n, copyrights: v }) => {
|
|
653
653
|
const h = (w) => w ?? "left";
|
|
654
654
|
return /* @__PURE__ */ r.jsxs("footer", { className: "footer", children: [
|
|
655
655
|
/* @__PURE__ */ r.jsxs("div", { className: "container", children: [
|
|
@@ -674,32 +674,32 @@ const st = ({ contactInfo: t, quickLinks: i, exploreLinks: s, logoUrl: n, copyri
|
|
|
674
674
|
] }),
|
|
675
675
|
/* @__PURE__ */ r.jsx("div", { className: `section ${h(i.align)}`, children: /* @__PURE__ */ r.jsxs("ul", { children: [
|
|
676
676
|
/* @__PURE__ */ r.jsx("h3", { children: "Quick Links" }),
|
|
677
|
-
i.content.map((w,
|
|
677
|
+
i.content.map((w, p) => /* @__PURE__ */ r.jsx("li", { children: /* @__PURE__ */ r.jsx("a", { href: w.link, children: w.label }) }, p))
|
|
678
678
|
] }) }),
|
|
679
679
|
/* @__PURE__ */ r.jsx("div", { className: `section ${h(s.align)}`, children: /* @__PURE__ */ r.jsxs("ul", { children: [
|
|
680
680
|
/* @__PURE__ */ r.jsx("h3", { children: "Explore" }),
|
|
681
|
-
s.content.map((w,
|
|
681
|
+
s.content.map((w, p) => /* @__PURE__ */ r.jsx("li", { children: /* @__PURE__ */ r.jsx("a", { href: w.link, children: w.label }) }, p))
|
|
682
682
|
] }) })
|
|
683
683
|
] }),
|
|
684
|
-
/* @__PURE__ */ r.jsx("div", { className: "copyright", children: /* @__PURE__ */ r.jsx("p", { children:
|
|
684
|
+
/* @__PURE__ */ r.jsx("div", { className: "copyright", children: /* @__PURE__ */ r.jsx("p", { children: v }) })
|
|
685
685
|
] });
|
|
686
686
|
}, pr = dr(void 0), at = ({ children: t }) => {
|
|
687
687
|
const [i, s] = R(!1), n = () => {
|
|
688
688
|
s((h) => !h);
|
|
689
|
-
},
|
|
689
|
+
}, v = (h) => {
|
|
690
690
|
s(h);
|
|
691
691
|
};
|
|
692
|
-
return /* @__PURE__ */ r.jsx(pr.Provider, { value: { isCollapsed: i, toggleSidebar: n, setSidebarCollapsed:
|
|
692
|
+
return /* @__PURE__ */ r.jsx(pr.Provider, { value: { isCollapsed: i, toggleSidebar: n, setSidebarCollapsed: v }, children: t });
|
|
693
693
|
}, mr = () => {
|
|
694
694
|
const t = fr(pr);
|
|
695
695
|
if (t === void 0)
|
|
696
696
|
throw new Error("useSidebar must be used within a SidebarProvider");
|
|
697
697
|
return t;
|
|
698
698
|
}, ot = ({ buttons: t, onNavigate: i, presentPath: s }) => {
|
|
699
|
-
const { isCollapsed: n, setSidebarCollapsed:
|
|
699
|
+
const { isCollapsed: n, setSidebarCollapsed: v } = mr(), [h, w] = R(!0), p = _e(null), [g, o] = R(
|
|
700
700
|
() => document.dir === "rtl" || document.documentElement.dir === "rtl"
|
|
701
701
|
);
|
|
702
|
-
return
|
|
702
|
+
return re(() => {
|
|
703
703
|
const c = () => {
|
|
704
704
|
o(document.dir === "rtl" || document.documentElement.dir === "rtl");
|
|
705
705
|
}, d = new MutationObserver(c);
|
|
@@ -707,28 +707,28 @@ const st = ({ contactInfo: t, quickLinks: i, exploreLinks: s, logoUrl: n, copyri
|
|
|
707
707
|
attributes: !0,
|
|
708
708
|
attributeFilter: ["dir"]
|
|
709
709
|
}), () => d.disconnect();
|
|
710
|
-
}, []),
|
|
710
|
+
}, []), re(() => {
|
|
711
711
|
const c = t.some((d) => d.path === s);
|
|
712
|
-
w(c), !c && !n && s.includes("/course/") && !s.includes("/learning/course/") &&
|
|
713
|
-
}, [s]),
|
|
712
|
+
w(c), !c && !n && s.includes("/course/") && !s.includes("/learning/course/") && v(!0);
|
|
713
|
+
}, [s]), re(() => {
|
|
714
714
|
const c = (d) => {
|
|
715
|
-
!h &&
|
|
715
|
+
!h && p.current && !p.current.contains(d.target) && s.includes("/course/") && !s.includes("/learning/course/") && (n || v(!0));
|
|
716
716
|
};
|
|
717
717
|
return document.addEventListener("mousedown", c), () => {
|
|
718
718
|
document.removeEventListener("mousedown", c);
|
|
719
719
|
};
|
|
720
|
-
}, [h, n,
|
|
720
|
+
}, [h, n, v]), /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
|
|
721
721
|
/* @__PURE__ */ r.jsx(
|
|
722
722
|
"div",
|
|
723
723
|
{
|
|
724
724
|
className: `sidebar ${n ? "collapsed" : ""}`,
|
|
725
|
-
ref:
|
|
725
|
+
ref: p,
|
|
726
726
|
children: /* @__PURE__ */ r.jsx("div", { className: "sidebar-buttons", children: t.map((c) => {
|
|
727
727
|
const d = c.path === s || (s.includes("/course/") || s.includes("/course_rerun/")) && c.path === "/my-courses" || s.includes("/library/") && c.path === "/libraries" || s.includes("/taxonomy/") && c.path === "/taxonomies";
|
|
728
728
|
return /* @__PURE__ */ r.jsx(
|
|
729
729
|
Ir,
|
|
730
730
|
{
|
|
731
|
-
placement:
|
|
731
|
+
placement: g ? "left" : "right",
|
|
732
732
|
overlay: /* @__PURE__ */ r.jsx(Dr, { id: `tooltip-${c.path}`, children: c.label }),
|
|
733
733
|
show: n ? void 0 : !1,
|
|
734
734
|
popperConfig: {
|
|
@@ -764,7 +764,7 @@ const st = ({ contactInfo: t, quickLinks: i, exploreLinks: s, logoUrl: n, copyri
|
|
|
764
764
|
] });
|
|
765
765
|
}, Vr = (t = 768) => {
|
|
766
766
|
const [i, s] = R(!1);
|
|
767
|
-
return
|
|
767
|
+
return re(() => {
|
|
768
768
|
const n = () => {
|
|
769
769
|
s(window.innerWidth <= t);
|
|
770
770
|
};
|
|
@@ -891,7 +891,7 @@ const st = ({ contactInfo: t, quickLinks: i, exploreLinks: s, logoUrl: n, copyri
|
|
|
891
891
|
// isAdmin,
|
|
892
892
|
menuItems: n
|
|
893
893
|
}) => {
|
|
894
|
-
const
|
|
894
|
+
const v = i ? /* @__PURE__ */ r.jsx(
|
|
895
895
|
"img",
|
|
896
896
|
{
|
|
897
897
|
className: "d-block w-100 h-100",
|
|
@@ -907,10 +907,10 @@ const st = ({ contactInfo: t, quickLinks: i, exploreLinks: s, logoUrl: n, copyri
|
|
|
907
907
|
alt: "avatar",
|
|
908
908
|
"data-testid": "avatar-icon"
|
|
909
909
|
}
|
|
910
|
-
), h = s ?
|
|
910
|
+
), h = s ? v : /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
|
|
911
911
|
t,
|
|
912
912
|
" ",
|
|
913
|
-
|
|
913
|
+
v
|
|
914
914
|
] });
|
|
915
915
|
return /* @__PURE__ */ r.jsx(
|
|
916
916
|
Ur,
|
|
@@ -925,60 +925,60 @@ var je = {}, ar;
|
|
|
925
925
|
function Gr() {
|
|
926
926
|
if (ar) return je;
|
|
927
927
|
ar = 1, Object.defineProperty(je, "__esModule", { value: !0 }), je.parse = w, je.serialize = o;
|
|
928
|
-
const t = /^[\u0021-\u003A\u003C\u003E-\u007E]+$/, i = /^[\u0021-\u003A\u003C-\u007E]*$/, s = /^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i, n = /^[\u0020-\u003A\u003D-\u007E]*$/,
|
|
929
|
-
const
|
|
928
|
+
const t = /^[\u0021-\u003A\u003C\u003E-\u007E]+$/, i = /^[\u0021-\u003A\u003C-\u007E]*$/, s = /^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i, n = /^[\u0020-\u003A\u003D-\u007E]*$/, v = Object.prototype.toString, h = /* @__PURE__ */ (() => {
|
|
929
|
+
const f = function() {
|
|
930
930
|
};
|
|
931
|
-
return
|
|
931
|
+
return f.prototype = /* @__PURE__ */ Object.create(null), f;
|
|
932
932
|
})();
|
|
933
|
-
function w(
|
|
934
|
-
const u = new h(), P =
|
|
933
|
+
function w(f, b) {
|
|
934
|
+
const u = new h(), P = f.length;
|
|
935
935
|
if (P < 2)
|
|
936
936
|
return u;
|
|
937
937
|
const G = (b == null ? void 0 : b.decode) || c;
|
|
938
938
|
let j = 0;
|
|
939
939
|
do {
|
|
940
|
-
const I =
|
|
940
|
+
const I = f.indexOf("=", j);
|
|
941
941
|
if (I === -1)
|
|
942
942
|
break;
|
|
943
|
-
const S =
|
|
943
|
+
const S = f.indexOf(";", j), X = S === -1 ? P : S;
|
|
944
944
|
if (I > X) {
|
|
945
|
-
j =
|
|
945
|
+
j = f.lastIndexOf(";", I - 1) + 1;
|
|
946
946
|
continue;
|
|
947
947
|
}
|
|
948
|
-
const $ = f
|
|
948
|
+
const $ = p(f, j, I), Z = g(f, I, $), H = f.slice($, Z);
|
|
949
949
|
if (u[H] === void 0) {
|
|
950
|
-
let C = f
|
|
951
|
-
const
|
|
952
|
-
u[H] =
|
|
950
|
+
let C = p(f, I + 1, X), Q = g(f, X, C);
|
|
951
|
+
const te = G(f.slice(C, Q));
|
|
952
|
+
u[H] = te;
|
|
953
953
|
}
|
|
954
954
|
j = X + 1;
|
|
955
955
|
} while (j < P);
|
|
956
956
|
return u;
|
|
957
957
|
}
|
|
958
|
-
function f
|
|
958
|
+
function p(f, b, u) {
|
|
959
959
|
do {
|
|
960
|
-
const P =
|
|
960
|
+
const P = f.charCodeAt(b);
|
|
961
961
|
if (P !== 32 && P !== 9)
|
|
962
962
|
return b;
|
|
963
963
|
} while (++b < u);
|
|
964
964
|
return u;
|
|
965
965
|
}
|
|
966
|
-
function
|
|
966
|
+
function g(f, b, u) {
|
|
967
967
|
for (; b > u; ) {
|
|
968
|
-
const P =
|
|
968
|
+
const P = f.charCodeAt(--b);
|
|
969
969
|
if (P !== 32 && P !== 9)
|
|
970
970
|
return b + 1;
|
|
971
971
|
}
|
|
972
972
|
return u;
|
|
973
973
|
}
|
|
974
|
-
function o(
|
|
974
|
+
function o(f, b, u) {
|
|
975
975
|
const P = (u == null ? void 0 : u.encode) || encodeURIComponent;
|
|
976
|
-
if (!t.test(
|
|
977
|
-
throw new TypeError(`argument name is invalid: ${
|
|
976
|
+
if (!t.test(f))
|
|
977
|
+
throw new TypeError(`argument name is invalid: ${f}`);
|
|
978
978
|
const G = P(b);
|
|
979
979
|
if (!i.test(G))
|
|
980
980
|
throw new TypeError(`argument val is invalid: ${b}`);
|
|
981
|
-
let j =
|
|
981
|
+
let j = f + "=" + G;
|
|
982
982
|
if (!u)
|
|
983
983
|
return j;
|
|
984
984
|
if (u.maxAge !== void 0) {
|
|
@@ -1032,17 +1032,17 @@ function Gr() {
|
|
|
1032
1032
|
}
|
|
1033
1033
|
return j;
|
|
1034
1034
|
}
|
|
1035
|
-
function c(
|
|
1036
|
-
if (
|
|
1037
|
-
return
|
|
1035
|
+
function c(f) {
|
|
1036
|
+
if (f.indexOf("%") === -1)
|
|
1037
|
+
return f;
|
|
1038
1038
|
try {
|
|
1039
|
-
return decodeURIComponent(
|
|
1039
|
+
return decodeURIComponent(f);
|
|
1040
1040
|
} catch {
|
|
1041
|
-
return
|
|
1041
|
+
return f;
|
|
1042
1042
|
}
|
|
1043
1043
|
}
|
|
1044
|
-
function d(
|
|
1045
|
-
return
|
|
1044
|
+
function d(f) {
|
|
1045
|
+
return v.call(f) === "[object Date]";
|
|
1046
1046
|
}
|
|
1047
1047
|
return je;
|
|
1048
1048
|
}
|
|
@@ -1071,8 +1071,8 @@ class Br {
|
|
|
1071
1071
|
this.changeListeners = [], this.HAS_DOCUMENT_COOKIE = !1, this.update = () => {
|
|
1072
1072
|
if (!this.HAS_DOCUMENT_COOKIE)
|
|
1073
1073
|
return;
|
|
1074
|
-
const
|
|
1075
|
-
this.cookies = ke.parse(document.cookie), this._checkChanges(
|
|
1074
|
+
const v = this.cookies;
|
|
1075
|
+
this.cookies = ke.parse(document.cookie), this._checkChanges(v);
|
|
1076
1076
|
};
|
|
1077
1077
|
const n = typeof document > "u" ? "" : document.cookie;
|
|
1078
1078
|
this.cookies = Zr(i || n), this.defaultSetOptions = s, this.HAS_DOCUMENT_COOKIE = Xr();
|
|
@@ -1107,8 +1107,8 @@ class Br {
|
|
|
1107
1107
|
}
|
|
1108
1108
|
set(i, s, n) {
|
|
1109
1109
|
n ? n = Object.assign(Object.assign({}, this.defaultSetOptions), n) : n = this.defaultSetOptions;
|
|
1110
|
-
const
|
|
1111
|
-
this.cookies = Object.assign(Object.assign({}, this.cookies), { [i]:
|
|
1110
|
+
const v = typeof s == "string" ? s : JSON.stringify(s);
|
|
1111
|
+
this.cookies = Object.assign(Object.assign({}, this.cookies), { [i]: v }), this.HAS_DOCUMENT_COOKIE && (document.cookie = ke.serialize(i, v, n)), this._emitChange({ name: i, value: s, options: n });
|
|
1112
1112
|
}
|
|
1113
1113
|
remove(i, s) {
|
|
1114
1114
|
const n = s = Object.assign(Object.assign(Object.assign({}, this.defaultSetOptions), s), { expires: new Date(1970, 1, 1, 0, 0, 1), maxAge: 0 });
|
|
@@ -1158,11 +1158,11 @@ class et {
|
|
|
1158
1158
|
async search(i, s = {}) {
|
|
1159
1159
|
const {
|
|
1160
1160
|
limit: n = 20,
|
|
1161
|
-
offset:
|
|
1161
|
+
offset: v = 0,
|
|
1162
1162
|
filter: h = ['type = "course_block"'],
|
|
1163
1163
|
attributesToHighlight: w = ["display_name", "description", "published"],
|
|
1164
|
-
attributesToCrop:
|
|
1165
|
-
sort:
|
|
1164
|
+
attributesToCrop: p = ["description", "published"],
|
|
1165
|
+
sort: g = []
|
|
1166
1166
|
} = s;
|
|
1167
1167
|
if (!this.config.indexName)
|
|
1168
1168
|
throw new Error("MeiliSearch indexName is required");
|
|
@@ -1175,9 +1175,9 @@ class et {
|
|
|
1175
1175
|
attributesToHighlight: w,
|
|
1176
1176
|
highlightPreTag: "__meili-highlight__",
|
|
1177
1177
|
highlightPostTag: "__/meili-highlight__",
|
|
1178
|
-
attributesToCrop:
|
|
1179
|
-
sort:
|
|
1180
|
-
offset:
|
|
1178
|
+
attributesToCrop: p,
|
|
1179
|
+
sort: g,
|
|
1180
|
+
offset: v,
|
|
1181
1181
|
limit: n
|
|
1182
1182
|
},
|
|
1183
1183
|
{
|
|
@@ -1196,7 +1196,7 @@ class et {
|
|
|
1196
1196
|
});
|
|
1197
1197
|
if (!d.ok)
|
|
1198
1198
|
throw new Error(`MeiliSearch API error: ${d.status} ${d.statusText}`);
|
|
1199
|
-
const
|
|
1199
|
+
const f = await d.json(), b = f.results[0], u = f.results[1];
|
|
1200
1200
|
return {
|
|
1201
1201
|
hits: b.hits || [],
|
|
1202
1202
|
totalHits: b.estimatedTotalHits || 0,
|
|
@@ -1213,11 +1213,11 @@ class et {
|
|
|
1213
1213
|
async simpleSearch(i, s = {}) {
|
|
1214
1214
|
const {
|
|
1215
1215
|
limit: n = 20,
|
|
1216
|
-
offset:
|
|
1216
|
+
offset: v = 0,
|
|
1217
1217
|
filter: h = ['type = "course_block"'],
|
|
1218
1218
|
attributesToHighlight: w = ["display_name", "description", "published"],
|
|
1219
|
-
attributesToCrop:
|
|
1220
|
-
sort:
|
|
1219
|
+
attributesToCrop: p = ["description", "published"],
|
|
1220
|
+
sort: g = []
|
|
1221
1221
|
} = s, o = {
|
|
1222
1222
|
queries: [
|
|
1223
1223
|
{
|
|
@@ -1227,9 +1227,9 @@ class et {
|
|
|
1227
1227
|
attributesToHighlight: w,
|
|
1228
1228
|
highlightPreTag: "__meili-highlight__",
|
|
1229
1229
|
highlightPostTag: "__/meili-highlight__",
|
|
1230
|
-
attributesToCrop:
|
|
1231
|
-
sort:
|
|
1232
|
-
offset:
|
|
1230
|
+
attributesToCrop: p,
|
|
1231
|
+
sort: g,
|
|
1232
|
+
offset: v,
|
|
1233
1233
|
limit: n
|
|
1234
1234
|
}
|
|
1235
1235
|
]
|
|
@@ -1283,23 +1283,23 @@ const or = ({
|
|
|
1283
1283
|
highlightTag: i = "__meili-highlight__"
|
|
1284
1284
|
}) => {
|
|
1285
1285
|
if (!t) return null;
|
|
1286
|
-
const s = "__/meili-highlight__", n = t.split(i),
|
|
1286
|
+
const s = "__/meili-highlight__", n = t.split(i), v = [];
|
|
1287
1287
|
return n.forEach((h, w) => {
|
|
1288
1288
|
if (w === 0)
|
|
1289
|
-
h &&
|
|
1289
|
+
h && v.push(h);
|
|
1290
1290
|
else {
|
|
1291
|
-
const
|
|
1292
|
-
if (
|
|
1293
|
-
const
|
|
1294
|
-
|
|
1295
|
-
/* @__PURE__ */ r.jsx("mark", { className: "search-highlight", children:
|
|
1296
|
-
), o &&
|
|
1291
|
+
const p = h.indexOf(s);
|
|
1292
|
+
if (p !== -1) {
|
|
1293
|
+
const g = h.substring(0, p), o = h.substring(p + s.length);
|
|
1294
|
+
g && v.push(
|
|
1295
|
+
/* @__PURE__ */ r.jsx("mark", { className: "search-highlight", children: g }, `highlight-${w}`)
|
|
1296
|
+
), o && v.push(o);
|
|
1297
1297
|
} else
|
|
1298
|
-
|
|
1298
|
+
v.push(
|
|
1299
1299
|
/* @__PURE__ */ r.jsx("mark", { className: "search-highlight", children: h }, `highlight-${w}`)
|
|
1300
1300
|
);
|
|
1301
1301
|
}
|
|
1302
|
-
}), /* @__PURE__ */ r.jsx(r.Fragment, { children:
|
|
1302
|
+
}), /* @__PURE__ */ r.jsx(r.Fragment, { children: v });
|
|
1303
1303
|
};
|
|
1304
1304
|
function tt(t) {
|
|
1305
1305
|
return {
|
|
@@ -1324,7 +1324,7 @@ const cr = ({
|
|
|
1324
1324
|
onNavigate: i,
|
|
1325
1325
|
baseUrl: s
|
|
1326
1326
|
}) => {
|
|
1327
|
-
var
|
|
1327
|
+
var g, o;
|
|
1328
1328
|
const n = (c) => {
|
|
1329
1329
|
var b;
|
|
1330
1330
|
c.preventDefault(), c.stopPropagation();
|
|
@@ -1345,7 +1345,7 @@ const cr = ({
|
|
|
1345
1345
|
return;
|
|
1346
1346
|
}
|
|
1347
1347
|
rt(d, s, i) === "#" && (i ? i(`/search-result/${t.id}`) : window.location.href = `/search-result/${t.id}`);
|
|
1348
|
-
},
|
|
1348
|
+
}, v = (c) => {
|
|
1349
1349
|
var b;
|
|
1350
1350
|
c.preventDefault(), c.stopPropagation();
|
|
1351
1351
|
const d = {
|
|
@@ -1357,9 +1357,9 @@ const cr = ({
|
|
|
1357
1357
|
displayName: u.display_name,
|
|
1358
1358
|
usageKey: u.usage_key
|
|
1359
1359
|
}))) || []
|
|
1360
|
-
},
|
|
1361
|
-
|
|
1362
|
-
}, h = ((
|
|
1360
|
+
}, f = vr(d, s);
|
|
1361
|
+
f && f !== "#" && window.open(f, "_blank");
|
|
1362
|
+
}, h = ((g = t._formatted) == null ? void 0 : g.display_name) || t.display_name, w = ((o = t._formatted) == null ? void 0 : o.description) || t.description, p = t.block_type || t.type;
|
|
1363
1363
|
return /* @__PURE__ */ r.jsx(
|
|
1364
1364
|
"div",
|
|
1365
1365
|
{
|
|
@@ -1371,7 +1371,7 @@ const cr = ({
|
|
|
1371
1371
|
(c.key === "Enter" || c.key === " ") && n(c);
|
|
1372
1372
|
},
|
|
1373
1373
|
children: /* @__PURE__ */ r.jsxs("div", { className: "search-result-content", children: [
|
|
1374
|
-
/* @__PURE__ */ r.jsx("div", { className: "search-result-icon", children: /* @__PURE__ */ r.jsx(U, { src: tt(
|
|
1374
|
+
/* @__PURE__ */ r.jsx("div", { className: "search-result-icon", children: /* @__PURE__ */ r.jsx(U, { src: tt(p) }) }),
|
|
1375
1375
|
/* @__PURE__ */ r.jsxs("div", { className: "search-result-text", children: [
|
|
1376
1376
|
/* @__PURE__ */ r.jsx("div", { className: "search-result-title", children: /* @__PURE__ */ r.jsx(or, { text: h }) }),
|
|
1377
1377
|
w && /* @__PURE__ */ r.jsx("div", { className: "search-result-description", children: /* @__PURE__ */ r.jsx(or, { text: w }) }),
|
|
@@ -1382,7 +1382,7 @@ const cr = ({
|
|
|
1382
1382
|
{
|
|
1383
1383
|
src: Yr,
|
|
1384
1384
|
iconAs: U,
|
|
1385
|
-
onClick:
|
|
1385
|
+
onClick: v,
|
|
1386
1386
|
alt: "Open in new window",
|
|
1387
1387
|
size: "sm"
|
|
1388
1388
|
}
|
|
@@ -1395,24 +1395,24 @@ const cr = ({
|
|
|
1395
1395
|
menuList: i,
|
|
1396
1396
|
loginSignupButtons: s,
|
|
1397
1397
|
authenticatedUser: n = null,
|
|
1398
|
-
userMenuItems:
|
|
1398
|
+
userMenuItems: v,
|
|
1399
1399
|
menuAlignment: h,
|
|
1400
1400
|
onLanguageChange: w,
|
|
1401
|
-
getBaseUrl:
|
|
1402
|
-
meiliSearchConfig:
|
|
1401
|
+
getBaseUrl: p,
|
|
1402
|
+
meiliSearchConfig: g,
|
|
1403
1403
|
headerButtons: o,
|
|
1404
1404
|
languageSelectorList: c
|
|
1405
1405
|
}) => {
|
|
1406
|
-
const d = Vr(), { toggleSidebar:
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
}, [
|
|
1406
|
+
const d = Vr(), { toggleSidebar: f, setSidebarCollapsed: b } = mr(), [u, P] = R(() => lr.get("openedx-language-preference") || "en"), [G, j] = R(!1), [I, S] = R(!1), [X, $] = R(!1), [Z, H] = R(""), [C, Q] = R([]), [te, F] = R(!1), [L, V] = R(null), [M, z] = R(0), [E, q] = R(!1), [K, B] = R(5), ue = _e(null), Y = _e(null), ae = _e(g ? gr(g) : null), de = _e(!1);
|
|
1407
|
+
re(() => {
|
|
1408
|
+
g != null && g.client && ae.current && ae.current.updateHeadersFromClient(g.client);
|
|
1409
|
+
}, [g == null ? void 0 : g.client]), re(() => () => {
|
|
1410
1410
|
Y.current && clearTimeout(Y.current);
|
|
1411
|
-
}, []),
|
|
1411
|
+
}, []), re(() => {
|
|
1412
1412
|
document.body.dir = u === "ar" ? "rtl" : "ltr";
|
|
1413
|
-
}, [u]),
|
|
1413
|
+
}, [u]), re(() => {
|
|
1414
1414
|
d && !de.current ? (b(!0), de.current = !0) : d || (de.current = !1);
|
|
1415
|
-
}, [d, b]),
|
|
1415
|
+
}, [d, b]), re(() => {
|
|
1416
1416
|
if (!I) return;
|
|
1417
1417
|
function m(N) {
|
|
1418
1418
|
ue.current && !ue.current.contains(N.target) && S(!1);
|
|
@@ -1423,7 +1423,7 @@ const cr = ({
|
|
|
1423
1423
|
}, [I]);
|
|
1424
1424
|
const fe = (m) => {
|
|
1425
1425
|
P(m), lr.set("openedx-language-preference", m, {
|
|
1426
|
-
path:
|
|
1426
|
+
path: p ? p() : "/"
|
|
1427
1427
|
// secure: process.env.NODE_ENV === 'production',
|
|
1428
1428
|
// sameSite: 'strict'
|
|
1429
1429
|
}), w && w();
|
|
@@ -1432,7 +1432,7 @@ const cr = ({
|
|
|
1432
1432
|
center: "justify-content-center",
|
|
1433
1433
|
right: "justify-content-end"
|
|
1434
1434
|
}[h.toLowerCase()] || "justify-content-start", he = async (m) => {
|
|
1435
|
-
if (!m.trim() || !
|
|
1435
|
+
if (!m.trim() || !g || !ae.current) {
|
|
1436
1436
|
Q([]), z(0), $(!1), q(!1);
|
|
1437
1437
|
return;
|
|
1438
1438
|
}
|
|
@@ -1487,7 +1487,7 @@ const cr = ({
|
|
|
1487
1487
|
src: Kr,
|
|
1488
1488
|
iconAs: U,
|
|
1489
1489
|
alt: "Toggle Sidebar",
|
|
1490
|
-
onClick:
|
|
1490
|
+
onClick: f,
|
|
1491
1491
|
className: "ms-2 ml-2",
|
|
1492
1492
|
onMouseDown: (m) => m.stopPropagation()
|
|
1493
1493
|
}
|
|
@@ -1501,7 +1501,7 @@ const cr = ({
|
|
|
1501
1501
|
) })
|
|
1502
1502
|
] }),
|
|
1503
1503
|
n !== null && /* @__PURE__ */ r.jsx(r.Fragment, { children: d ? /* @__PURE__ */ r.jsx("div", { className: "d-flex justify-content-between align-items-center ml-auto", children: /* @__PURE__ */ r.jsxs("div", { className: "d-flex align-items-center navbar-buttons", children: [
|
|
1504
|
-
|
|
1504
|
+
g && /* @__PURE__ */ r.jsx(
|
|
1505
1505
|
Re,
|
|
1506
1506
|
{
|
|
1507
1507
|
src: Jr,
|
|
@@ -1517,7 +1517,7 @@ const cr = ({
|
|
|
1517
1517
|
authenticatedUserAvatar: n == null ? void 0 : n.avatar,
|
|
1518
1518
|
isMobile: d,
|
|
1519
1519
|
isAdmin: n == null ? void 0 : n.administrator,
|
|
1520
|
-
menuItems:
|
|
1520
|
+
menuItems: v
|
|
1521
1521
|
}
|
|
1522
1522
|
) }),
|
|
1523
1523
|
le && /* @__PURE__ */ r.jsx(
|
|
@@ -1543,7 +1543,7 @@ const cr = ({
|
|
|
1543
1543
|
] })
|
|
1544
1544
|
] })
|
|
1545
1545
|
] }) }) : /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
|
|
1546
|
-
|
|
1546
|
+
g && /* @__PURE__ */ r.jsx("div", { className: "d-flex align-items-center justify-content-start flex-grow-1 ml-4", children: /* @__PURE__ */ r.jsxs("div", { style: { width: "30rem", position: "relative" }, children: [
|
|
1547
1547
|
/* @__PURE__ */ r.jsxs("div", { style: {
|
|
1548
1548
|
display: "flex",
|
|
1549
1549
|
alignItems: "center",
|
|
@@ -1594,11 +1594,11 @@ const cr = ({
|
|
|
1594
1594
|
}
|
|
1595
1595
|
)
|
|
1596
1596
|
] }),
|
|
1597
|
-
|
|
1597
|
+
te && /* @__PURE__ */ r.jsxs("div", { className: "search-loading-spinner-container", children: [
|
|
1598
1598
|
/* @__PURE__ */ r.jsx("div", { className: "search-loading-spinner" }),
|
|
1599
1599
|
/* @__PURE__ */ r.jsx("span", { children: "Searching..." })
|
|
1600
1600
|
] }),
|
|
1601
|
-
X && !
|
|
1601
|
+
X && !te && /* @__PURE__ */ r.jsx("div", { className: "no-results-message-desktop", children: /* @__PURE__ */ r.jsx("p", { children: "We didn't find anything matching your search" }) }),
|
|
1602
1602
|
L && /* @__PURE__ */ r.jsx("div", { className: "search-error-message-desktop", children: /* @__PURE__ */ r.jsxs("p", { children: [
|
|
1603
1603
|
"Search error: ",
|
|
1604
1604
|
L
|
|
@@ -1618,7 +1618,7 @@ const cr = ({
|
|
|
1618
1618
|
onNavigate: (J) => {
|
|
1619
1619
|
Ee(), window.location.href = J;
|
|
1620
1620
|
},
|
|
1621
|
-
baseUrl:
|
|
1621
|
+
baseUrl: p ? p() : void 0
|
|
1622
1622
|
},
|
|
1623
1623
|
m.id || N
|
|
1624
1624
|
)),
|
|
@@ -1662,7 +1662,7 @@ const cr = ({
|
|
|
1662
1662
|
authenticatedUserAvatar: n == null ? void 0 : n.avatar,
|
|
1663
1663
|
isMobile: d,
|
|
1664
1664
|
isAdmin: n == null ? void 0 : n.administrator,
|
|
1665
|
-
menuItems:
|
|
1665
|
+
menuItems: v
|
|
1666
1666
|
}
|
|
1667
1667
|
) })
|
|
1668
1668
|
] })
|
|
@@ -1675,7 +1675,7 @@ const cr = ({
|
|
|
1675
1675
|
] }) })
|
|
1676
1676
|
] }),
|
|
1677
1677
|
/* @__PURE__ */ r.jsx(Ce.Collapse, { id: "main-navbar-nav", className: "justify-content-between", children: /* @__PURE__ */ r.jsx(Ge, { className: `nav-gap gap-3 flex-grow-1 ${xe}`, children: n === null && i.map((m) => m.subMenu ? /* @__PURE__ */ r.jsx(Xe, { title: m.label, id: `nav-dropdown-${m.label}`, children: m.subMenu.map((N) => /* @__PURE__ */ r.jsx(Xe.Item, { onClick: () => console.log("Selected submenu:", N.label), children: N.label }, `sub-${N.label}`)) }, `menu-${m.label}`) : /* @__PURE__ */ r.jsx(Ge.Link, { as: "span", className: "text-uppercase fw-semibold", children: m.label }, `menu-${m.label}`)) }) }),
|
|
1678
|
-
|
|
1678
|
+
g && G && /* @__PURE__ */ r.jsxs("div", { className: "fixed-search-bar", children: [
|
|
1679
1679
|
/* @__PURE__ */ r.jsxs("div", { className: "fixed-search-bar-inner", children: [
|
|
1680
1680
|
/* @__PURE__ */ r.jsxs("div", { style: {
|
|
1681
1681
|
display: "flex",
|
|
@@ -1732,11 +1732,11 @@ const cr = ({
|
|
|
1732
1732
|
] }),
|
|
1733
1733
|
/* @__PURE__ */ r.jsx("button", { className: "close-search-bar", type: "button", onClick: () => j(!1), "aria-label": "Close Search", children: "×" })
|
|
1734
1734
|
] }),
|
|
1735
|
-
|
|
1735
|
+
te && /* @__PURE__ */ r.jsxs("div", { className: "search-loading-spinner-container", children: [
|
|
1736
1736
|
/* @__PURE__ */ r.jsx("div", { className: "search-loading-spinner" }),
|
|
1737
1737
|
/* @__PURE__ */ r.jsx("span", { children: "Searching..." })
|
|
1738
1738
|
] }),
|
|
1739
|
-
X && !
|
|
1739
|
+
X && !te && /* @__PURE__ */ r.jsx("div", { className: "no-results-message", children: /* @__PURE__ */ r.jsx("p", { children: "We didn't find anything matching your search" }) }),
|
|
1740
1740
|
L && /* @__PURE__ */ r.jsx("div", { className: "search-error-message", children: /* @__PURE__ */ r.jsxs("p", { children: [
|
|
1741
1741
|
"Search error: ",
|
|
1742
1742
|
L
|
|
@@ -1756,7 +1756,7 @@ const cr = ({
|
|
|
1756
1756
|
onNavigate: (J) => {
|
|
1757
1757
|
Ee(), window.location.href = J;
|
|
1758
1758
|
},
|
|
1759
|
-
baseUrl:
|
|
1759
|
+
baseUrl: p ? p() : void 0
|
|
1760
1760
|
},
|
|
1761
1761
|
m.id || N
|
|
1762
1762
|
)),
|
|
@@ -1786,7 +1786,7 @@ const cr = ({
|
|
|
1786
1786
|
] })
|
|
1787
1787
|
] });
|
|
1788
1788
|
}, xr = dr(void 0), lt = ({ children: t, meiliSearchConfig: i }) => {
|
|
1789
|
-
const [s, n] = R(""), [
|
|
1789
|
+
const [s, n] = R(""), [v, h] = R([]), [w, p] = R(0), [g, o] = R(!1), [c, d] = R(!1), [f, b] = R(null), [u, P] = R(0), [G, j] = R(!1), [I, S] = R(!1), [X, $] = R(null), Z = gr(i), H = async (F) => {
|
|
1790
1790
|
if (!F.trim()) {
|
|
1791
1791
|
Q();
|
|
1792
1792
|
return;
|
|
@@ -1809,9 +1809,9 @@ const cr = ({
|
|
|
1809
1809
|
_formatted: E._formatted
|
|
1810
1810
|
};
|
|
1811
1811
|
}), M = L.totalHits, z = V.length === 20 && M > V.length;
|
|
1812
|
-
h(V),
|
|
1812
|
+
h(V), p(M), j(z), $(L.facets || null);
|
|
1813
1813
|
} catch (L) {
|
|
1814
|
-
console.error("Search error:", L), d(!0), b(L instanceof Error ? L.message : "Search failed"), h([]),
|
|
1814
|
+
console.error("Search error:", L), d(!0), b(L instanceof Error ? L.message : "Search failed"), h([]), p(0), j(!1), $(null);
|
|
1815
1815
|
} finally {
|
|
1816
1816
|
o(!1);
|
|
1817
1817
|
}
|
|
@@ -1834,8 +1834,8 @@ const cr = ({
|
|
|
1834
1834
|
published: ((B = E._formatted) == null ? void 0 : B.published) || E.published,
|
|
1835
1835
|
_formatted: E._formatted
|
|
1836
1836
|
};
|
|
1837
|
-
}), M = L.totalHits, z = V.length === 20 && M >
|
|
1838
|
-
h((E) => [...E, ...V]),
|
|
1837
|
+
}), M = L.totalHits, z = V.length === 20 && M > v.length + V.length;
|
|
1838
|
+
h((E) => [...E, ...V]), p(M), j(z), P(F);
|
|
1839
1839
|
} catch (F) {
|
|
1840
1840
|
console.error("Error fetching next page:", F), d(!0), b(F instanceof Error ? F.message : "Failed to load more results");
|
|
1841
1841
|
} finally {
|
|
@@ -1843,15 +1843,15 @@ const cr = ({
|
|
|
1843
1843
|
}
|
|
1844
1844
|
}
|
|
1845
1845
|
}, Q = () => {
|
|
1846
|
-
n(""), h([]),
|
|
1847
|
-
},
|
|
1846
|
+
n(""), h([]), p(0), d(!1), b(null), P(0), j(!1), $(null);
|
|
1847
|
+
}, te = {
|
|
1848
1848
|
searchKeywords: s,
|
|
1849
1849
|
setSearchKeywords: n,
|
|
1850
|
-
searchResults:
|
|
1850
|
+
searchResults: v,
|
|
1851
1851
|
totalHits: w,
|
|
1852
|
-
isLoading:
|
|
1852
|
+
isLoading: g,
|
|
1853
1853
|
hasError: c,
|
|
1854
|
-
errorMessage:
|
|
1854
|
+
errorMessage: f,
|
|
1855
1855
|
facets: X,
|
|
1856
1856
|
performSearch: H,
|
|
1857
1857
|
clearSearch: Q,
|
|
@@ -1859,7 +1859,7 @@ const cr = ({
|
|
|
1859
1859
|
fetchNextPage: C,
|
|
1860
1860
|
isFetchingNextPage: I
|
|
1861
1861
|
};
|
|
1862
|
-
return /* @__PURE__ */ r.jsx(xr.Provider, { value:
|
|
1862
|
+
return /* @__PURE__ */ r.jsx(xr.Provider, { value: te, children: t });
|
|
1863
1863
|
}, ut = () => {
|
|
1864
1864
|
const t = fr(xr);
|
|
1865
1865
|
if (t === void 0)
|
|
@@ -1875,8 +1875,8 @@ const cr = ({
|
|
|
1875
1875
|
const s = document.documentElement;
|
|
1876
1876
|
for (const n in i)
|
|
1877
1877
|
if (Object.prototype.hasOwnProperty.call(i, n)) {
|
|
1878
|
-
const
|
|
1879
|
-
s.style.setProperty(`--${n.replace(/_/g, "-")}`,
|
|
1878
|
+
const v = i[n];
|
|
1879
|
+
s.style.setProperty(`--${n.replace(/_/g, "-")}`, v);
|
|
1880
1880
|
}
|
|
1881
1881
|
} catch (i) {
|
|
1882
1882
|
console.error("Error applying theme from API:", i.message);
|
|
@@ -1892,55 +1892,51 @@ const cr = ({
|
|
|
1892
1892
|
secondary_active: "#4A5BD1",
|
|
1893
1893
|
secondary_light: "#ECEEFF"
|
|
1894
1894
|
}, n = document.documentElement;
|
|
1895
|
-
for (const
|
|
1896
|
-
if (Object.prototype.hasOwnProperty.call(s,
|
|
1897
|
-
const h = s[
|
|
1898
|
-
n.style.setProperty(`--${
|
|
1895
|
+
for (const v in s)
|
|
1896
|
+
if (Object.prototype.hasOwnProperty.call(s, v)) {
|
|
1897
|
+
const h = s[v];
|
|
1898
|
+
n.style.setProperty(`--${v.replace(/_/g, "-")}`, h);
|
|
1899
1899
|
}
|
|
1900
1900
|
}
|
|
1901
1901
|
}, ft = ({
|
|
1902
1902
|
announcementType: t,
|
|
1903
|
-
data: i
|
|
1903
|
+
data: i,
|
|
1904
|
+
backgroundColor: s
|
|
1904
1905
|
}) => {
|
|
1905
|
-
const [
|
|
1906
|
-
const
|
|
1907
|
-
return
|
|
1908
|
-
}), [
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
},
|
|
1906
|
+
const [n, v] = R(() => {
|
|
1907
|
+
const g = localStorage.getItem(t);
|
|
1908
|
+
return g ? (Date.now() - parseInt(g, 10)) / 36e5 >= 24 : !0;
|
|
1909
|
+
}), [h, w] = R("showBanner"), p = () => {
|
|
1910
|
+
w("hideBanner"), setTimeout(() => {
|
|
1911
|
+
v(!1), localStorage.setItem(t, Date.now().toString());
|
|
1912
|
+
}, 800);
|
|
1912
1913
|
};
|
|
1913
|
-
return
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1914
|
+
return re(() => {
|
|
1915
|
+
n && w("showBanner");
|
|
1916
|
+
}, [n]), re(() => {
|
|
1917
|
+
const o = setInterval(() => {
|
|
1918
|
+
const c = localStorage.getItem(t);
|
|
1919
|
+
c && (Date.now() - parseInt(c, 10)) / 36e5 >= 24 && (localStorage.removeItem(t), v(!0));
|
|
1917
1920
|
}, 36e5);
|
|
1918
|
-
return () => clearInterval(
|
|
1919
|
-
}, [t]), !i || i.trim() === "" || !
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
onClick: w,
|
|
1938
|
-
"aria-label": "Close announcement banner"
|
|
1939
|
-
}
|
|
1940
|
-
)
|
|
1941
|
-
]
|
|
1942
|
-
}
|
|
1943
|
-
);
|
|
1921
|
+
return () => clearInterval(o);
|
|
1922
|
+
}, [t]), !i || i.trim() === "" || !n ? null : /* @__PURE__ */ r.jsxs("div", { className: `announcement-banner ${h}`, style: { backgroundColor: s || "var(--bg-body)" }, children: [
|
|
1923
|
+
/* @__PURE__ */ r.jsx(
|
|
1924
|
+
"div",
|
|
1925
|
+
{
|
|
1926
|
+
className: "announcement-content",
|
|
1927
|
+
dangerouslySetInnerHTML: { __html: i }
|
|
1928
|
+
}
|
|
1929
|
+
),
|
|
1930
|
+
/* @__PURE__ */ r.jsx(
|
|
1931
|
+
U,
|
|
1932
|
+
{
|
|
1933
|
+
src: qr,
|
|
1934
|
+
className: "close-icon",
|
|
1935
|
+
onClick: p,
|
|
1936
|
+
"aria-label": "Close announcement banner"
|
|
1937
|
+
}
|
|
1938
|
+
)
|
|
1939
|
+
] });
|
|
1944
1940
|
};
|
|
1945
1941
|
export {
|
|
1946
1942
|
ft as AnnouncementBanner,
|