@variamosple/variamos-components 0.0.23 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/dist/Components/AuthWrapper/index.js +18 -38
  2. package/dist/Components/ConfirmationModal/index.d.ts +1 -1
  3. package/dist/Components/ConfirmationModal/index.js +19 -280
  4. package/dist/Components/Footer/index.js +6 -6
  5. package/dist/Components/Header/BugFormModal.d.ts +14 -0
  6. package/dist/Components/Header/BugFormModal.js +100 -0
  7. package/dist/Components/Header/HeaderOptions.js +85 -31
  8. package/dist/Components/Header/MenuItem.js +19 -20
  9. package/dist/Components/Header/SubHeader.js +35 -9
  10. package/dist/Components/Header/index.js +24 -25
  11. package/dist/Components/NotAuthorized/index.js +10 -11
  12. package/dist/Components/Paginator/index.js +56 -128
  13. package/dist/Components/ProtectedRoute/index.js +10 -10
  14. package/dist/Context/AnalyticsContext.js +7 -7
  15. package/dist/Context/MenuContext.js +16 -16
  16. package/dist/Context/SessionContext.js +35 -35
  17. package/dist/HOC/WithPageVisit.d.ts +1 -1
  18. package/dist/HOC/WithPageVisit.js +6 -6
  19. package/dist/assets/index.css +1 -1
  20. package/package.json +10 -7
  21. package/dist/AbstractModalHeader-UzCRSxIO.js +0 -1690
  22. package/dist/Anchor-DJG5WYYF.js +0 -40
  23. package/dist/Button-DWo2Fl71.js +0 -78
  24. package/dist/Button-GQJKgb76.js +0 -33
  25. package/dist/Container-BLjzOisH.js +0 -22
  26. package/dist/Nav-CdxSljzW.js +0 -144
  27. package/dist/NavDropdown-AuV3RgfC.js +0 -1764
  28. package/dist/NavLink-ebvp1HCw.js +0 -173
  29. package/dist/SubHeader-gTVD9DIX.js +0 -481
  30. package/dist/ThemeProvider-Q3gZ4GF2.js +0 -72
  31. package/dist/jsx-runtime-Drh4NO5G.js +0 -633
  32. package/dist/useEventCallback-Bfo0-hwZ.js +0 -16
  33. package/dist/useMergedRefs-BpAaCckn.js +0 -16
  34. package/dist/useWindow-rGE2GXIv.js +0 -118
@@ -1,40 +1,39 @@
1
- import { j as n } from "../../jsx-runtime-Drh4NO5G.js";
2
- import { useMemo as N } from "react";
1
+ import { jsx as s } from "react/jsx-runtime";
2
+ import { useMemo as h } from "react";
3
+ import { Nav as v, NavDropdown as d } from "react-bootstrap";
3
4
  import "../../Context/AnalyticsContext.js";
4
5
  import "../../Context/MenuContext.js";
5
- import { useRouter as R } from "../../Context/RouterContext.js";
6
- import { useSession as k } from "../../Context/SessionContext.js";
6
+ import { useRouter as C } from "../../Context/RouterContext.js";
7
+ import { useSession as N } from "../../Context/SessionContext.js";
7
8
  import { mapToWebTarget as m } from "../../Model/Router.js";
8
- import { N as h } from "../../Nav-CdxSljzW.js";
9
- import { N as d } from "../../NavDropdown-AuV3RgfC.js";
10
9
  const y = ({
11
10
  title: e,
12
11
  type: w,
13
12
  location: g,
14
- target: x,
15
- children: l
13
+ target: k,
14
+ children: t
16
15
  }) => {
17
- const { user: r } = k(), { navigate: p } = R(), s = N(() => {
18
- const i = (r == null ? void 0 : r.permissions) || [], j = (r == null ? void 0 : r.roles) || [];
19
- return l ? l.filter((o) => {
16
+ const { user: r } = N(), { navigate: p } = C(), a = h(() => {
17
+ const i = (r == null ? void 0 : r.permissions) || [], R = (r == null ? void 0 : r.roles) || [];
18
+ return t ? t.filter((o) => {
20
19
  var c, f;
21
20
  if (!((c = o == null ? void 0 : o.allowedPermissions) != null && c.length) && !((f = o == null ? void 0 : o.allowedRoles) != null && f.length))
22
21
  return !0;
23
- let t = !0;
24
- return o.allowedRoles && (t = t && o.allowedRoles.some((a) => j.includes(a))), o.allowedPermissions && (t = t && o.allowedPermissions.some(
25
- (a) => i.includes(a)
26
- )), t;
22
+ let l = !0;
23
+ return o.allowedRoles && (l = l && o.allowedRoles.some((n) => R.includes(n))), o.allowedPermissions && (l = l && o.allowedPermissions.some(
24
+ (n) => i.includes(n)
25
+ )), l;
27
26
  }) : [];
28
- }, [l, r]);
29
- return w === "location" ? /* @__PURE__ */ n.jsx(
30
- h.Link,
27
+ }, [t, r]);
28
+ return w === "location" ? /* @__PURE__ */ s(
29
+ v.Link,
31
30
  {
32
31
  as: "button",
33
32
  className: "btn btn-link",
34
- onClick: () => p(g, { target: m(x) }),
33
+ onClick: () => p(g, { target: m(k) }),
35
34
  children: e
36
35
  }
37
- ) : /* @__PURE__ */ n.jsx(d, { title: e, children: s == null ? void 0 : s.map((i) => /* @__PURE__ */ n.jsx(
36
+ ) : /* @__PURE__ */ s(d, { title: e, children: a == null ? void 0 : a.map((i) => /* @__PURE__ */ s(
38
37
  d.Item,
39
38
  {
40
39
  as: "button",
@@ -1,12 +1,38 @@
1
- import "../../jsx-runtime-Drh4NO5G.js";
2
- import "react";
1
+ import { jsx as s } from "react/jsx-runtime";
2
+ import { useMemo as w } from "react";
3
+ import { Navbar as h, Container as g, Nav as d } from "react-bootstrap";
3
4
  import "../../Context/AnalyticsContext.js";
4
- import "../../Context/MenuContext.js";
5
- import "../../Context/RouterContext.js";
6
- import "../../Context/SessionContext.js";
7
- import { S as d } from "../../SubHeader-gTVD9DIX.js";
8
- import "../../Container-BLjzOisH.js";
9
- import "../../Nav-CdxSljzW.js";
5
+ import { useMenu as N } from "../../Context/MenuContext.js";
6
+ import { useRouter as v } from "../../Context/RouterContext.js";
7
+ import { useSession as R } from "../../Context/SessionContext.js";
8
+ const H = () => {
9
+ const { navigate: f } = v(), { subMenu: n } = N(), { user: r } = R(), t = w(() => {
10
+ const l = (r == null ? void 0 : r.roles) || [], m = (r == null ? void 0 : r.permissions) || [];
11
+ return n ? n.filter((o) => {
12
+ var a, c;
13
+ if (!((a = o == null ? void 0 : o.allowedRoles) != null && a.length) && !((c = o == null ? void 0 : o.allowedPermissions) != null && c.length))
14
+ return !0;
15
+ let i = !0;
16
+ return o.allowedRoles && (i = i && o.allowedRoles.some(
17
+ (e) => l.includes(e)
18
+ )), o.allowedPermissions && (i = i && o.allowedPermissions.some(
19
+ (e) => m.includes(e)
20
+ )), i;
21
+ }) : [];
22
+ }, [n, r]), p = (l) => () => {
23
+ f(l);
24
+ };
25
+ return t.length ? /* @__PURE__ */ s(h, { className: "py-1 shadow-sm bg-white", children: /* @__PURE__ */ s(g, { children: /* @__PURE__ */ s(d, { className: "d-flex justify-content-center w-100 gap-3", children: t.map((l) => /* @__PURE__ */ s(
26
+ d.Link,
27
+ {
28
+ as: "button",
29
+ className: "btn btn-link p-0",
30
+ onClick: p(l.location),
31
+ children: l.title
32
+ },
33
+ l.location
34
+ )) }) }) }) : null;
35
+ };
10
36
  export {
11
- d as SubHeader
37
+ H as SubHeader
12
38
  };
@@ -1,44 +1,43 @@
1
- import { j as s } from "../../jsx-runtime-Drh4NO5G.js";
1
+ import { jsxs as o, jsx as e } from "react/jsx-runtime";
2
+ import { Navbar as t, Container as u, Nav as i } from "react-bootstrap";
2
3
  import "../../Context/AnalyticsContext.js";
3
- import { useMenu as d } from "../../Context/MenuContext.js";
4
- import { useRouter as x } from "../../Context/RouterContext.js";
5
- import { useSession as j } from "../../Context/SessionContext.js";
6
- import { HeaderOptions as u } from "./HeaderOptions.js";
7
- import { MenuItemComponent as o } from "./MenuItem.js";
8
- import { N as r, S as f } from "../../SubHeader-gTVD9DIX.js";
9
- import { C as h } from "../../Container-BLjzOisH.js";
10
- import { N as t } from "../../Nav-CdxSljzW.js";
4
+ import { useMenu as h } from "../../Context/MenuContext.js";
5
+ import { useRouter as f } from "../../Context/RouterContext.js";
6
+ import { useSession as g } from "../../Context/SessionContext.js";
7
+ import { HeaderOptions as N } from "./HeaderOptions.js";
8
+ import { MenuItemComponent as n } from "./MenuItem.js";
9
+ import { SubHeader as k } from "./SubHeader.js";
11
10
  const I = ({
12
- logoUrl: i,
13
- logoAlt: a = "App logo",
14
- signInUrl: n
11
+ logoUrl: a,
12
+ logoAlt: m = "App logo",
13
+ signInUrl: s
15
14
  }) => {
16
- const { items: m } = d(), { navigate: c } = x(), { isAuthenticated: l, isLoading: p } = j();
17
- return /* @__PURE__ */ s.jsxs("header", { className: "sticky-top", children: [
18
- /* @__PURE__ */ s.jsx(r, { bg: "dark", variant: "dark", children: /* @__PURE__ */ s.jsxs(h, { fluid: !0, children: [
19
- /* @__PURE__ */ s.jsx(r.Brand, { onClick: () => c("/"), children: /* @__PURE__ */ s.jsx(
15
+ const { items: c } = h(), { navigate: l } = f(), { isAuthenticated: p, isLoading: d } = g();
16
+ return /* @__PURE__ */ o("header", { className: "sticky-top", children: [
17
+ /* @__PURE__ */ e(t, { bg: "dark", variant: "dark", children: /* @__PURE__ */ o(u, { fluid: !0, children: [
18
+ /* @__PURE__ */ e(t.Brand, { onClick: () => l("/"), children: /* @__PURE__ */ e(
20
19
  "img",
21
20
  {
22
- src: i,
21
+ src: a,
23
22
  height: "30",
24
23
  className: "d-inline-block align-top",
25
- alt: a
24
+ alt: m
26
25
  }
27
26
  ) }),
28
- /* @__PURE__ */ s.jsx(t, { className: "me-auto", children: m.map((e) => /* @__PURE__ */ s.jsx(o, { ...e }, e.title)) }),
29
- /* @__PURE__ */ s.jsxs(t, { className: "me-5 pe-5", children: [
30
- /* @__PURE__ */ s.jsx(u, {}),
31
- !p && !l && /* @__PURE__ */ s.jsx(
32
- o,
27
+ /* @__PURE__ */ e(i, { className: "me-auto", children: c.map((r) => /* @__PURE__ */ e(n, { ...r }, r.title)) }),
28
+ /* @__PURE__ */ o(i, { className: "me-5 pe-5", children: [
29
+ /* @__PURE__ */ e(N, {}),
30
+ !d && !p && /* @__PURE__ */ e(
31
+ n,
33
32
  {
34
33
  title: "Sign In",
35
34
  type: "location",
36
- location: n
35
+ location: s
37
36
  }
38
37
  )
39
38
  ] })
40
39
  ] }) }),
41
- /* @__PURE__ */ s.jsx(f, {})
40
+ /* @__PURE__ */ e(k, {})
42
41
  ] });
43
42
  };
44
43
  export {
@@ -1,18 +1,17 @@
1
- import { j as t } from "../../jsx-runtime-Drh4NO5G.js";
1
+ import { jsxs as o, jsx as t } from "react/jsx-runtime";
2
+ import { Container as i, Button as n } from "react-bootstrap";
2
3
  import "../../Context/AnalyticsContext.js";
3
4
  import "../../Context/MenuContext.js";
4
- import { useRouter as o } from "../../Context/RouterContext.js";
5
+ import { useRouter as a } from "../../Context/RouterContext.js";
5
6
  import "../../Context/SessionContext.js";
6
- import { C as s } from "../../Container-BLjzOisH.js";
7
- import { B as i } from "../../Button-GQJKgb76.js";
8
- const d = ({ homePath: e }) => {
9
- const { navigate: r } = o();
10
- return /* @__PURE__ */ t.jsxs(s, { className: "d-flex flex-column justify-content-center align-items-center vh-100 text-center", children: [
11
- /* @__PURE__ */ t.jsx("h1", { className: "display-1 fw-bold text-danger", children: "403" }),
12
- /* @__PURE__ */ t.jsx("p", { className: "fs-4 text-muted", children: "You are not authorized to access this page." }),
13
- /* @__PURE__ */ t.jsx(i, { variant: "primary", onClick: () => r(e), children: "Go Home" })
7
+ const u = ({ homePath: e }) => {
8
+ const { navigate: r } = a();
9
+ return /* @__PURE__ */ o(i, { className: "d-flex flex-column justify-content-center align-items-center vh-100 text-center", children: [
10
+ /* @__PURE__ */ t("h1", { className: "display-1 fw-bold text-danger", children: "403" }),
11
+ /* @__PURE__ */ t("p", { className: "fs-4 text-muted", children: "You are not authorized to access this page." }),
12
+ /* @__PURE__ */ t(n, { variant: "primary", onClick: () => r(e), children: "Go Home" })
14
13
  ] });
15
14
  };
16
15
  export {
17
- d as NotAuthorized
16
+ u as NotAuthorized
18
17
  };
@@ -1,156 +1,84 @@
1
- import { j as l } from "../../jsx-runtime-Drh4NO5G.js";
2
- import * as p from "react";
3
- import { useMemo as y } from "react";
4
- import { c as x, u as I } from "../../ThemeProvider-Q3gZ4GF2.js";
5
- import { A as v } from "../../Anchor-DJG5WYYF.js";
6
- const j = /* @__PURE__ */ p.forwardRef(({
7
- active: i = !1,
8
- disabled: s = !1,
9
- className: r,
10
- style: e,
11
- activeLabel: n = "(current)",
12
- children: o,
13
- linkStyle: d,
14
- linkClassName: N,
15
- as: u = v,
16
- ...a
17
- }, M) => {
18
- const k = i || s ? "span" : u;
19
- return /* @__PURE__ */ l.jsx("li", {
20
- ref: M,
21
- style: e,
22
- className: x(r, "page-item", {
23
- active: i,
24
- disabled: s
25
- }),
26
- children: /* @__PURE__ */ l.jsxs(k, {
27
- className: x("page-link", N),
28
- style: d,
29
- ...a,
30
- children: [o, i && n && /* @__PURE__ */ l.jsx("span", {
31
- className: "visually-hidden",
32
- children: n
33
- })]
34
- })
35
- });
36
- });
37
- j.displayName = "PageItem";
38
- function t(i, s, r = i) {
39
- const e = /* @__PURE__ */ p.forwardRef(({
40
- children: n,
41
- ...o
42
- }, d) => /* @__PURE__ */ l.jsxs(j, {
43
- ...o,
44
- ref: d,
45
- children: [/* @__PURE__ */ l.jsx("span", {
46
- "aria-hidden": "true",
47
- children: n || s
48
- }), /* @__PURE__ */ l.jsx("span", {
49
- className: "visually-hidden",
50
- children: r
51
- })]
52
- }));
53
- return e.displayName = i, e;
54
- }
55
- const E = t("First", "«"), R = t("Prev", "‹", "Previous"), B = t("Ellipsis", "…", "More"), b = t("Next", "›"), w = t("Last", "»"), h = /* @__PURE__ */ p.forwardRef(({
56
- bsPrefix: i,
57
- className: s,
58
- size: r,
59
- ...e
60
- }, n) => {
61
- const o = I(i, "pagination");
62
- return /* @__PURE__ */ l.jsx("ul", {
63
- ref: n,
64
- ...e,
65
- className: x(s, o, r && `${o}-${r}`)
66
- });
67
- });
68
- h.displayName = "Pagination";
69
- const c = Object.assign(h, {
70
- First: E,
71
- Prev: R,
72
- Ellipsis: B,
73
- Item: j,
74
- Next: b,
75
- Last: w
76
- }), f = (i, s) => {
77
- const r = [];
78
- for (let e = i; e <= s; e++)
79
- r.push(e);
80
- return r;
81
- }, m = 5, L = ({
82
- currentPage: i,
83
- totalPages: s,
84
- onPageChange: r
1
+ import { jsxs as k, jsx as s } from "react/jsx-runtime";
2
+ import { useMemo as p } from "react";
3
+ import { Pagination as f } from "react-bootstrap";
4
+ const n = (m, i) => {
5
+ const l = [];
6
+ for (let c = m; c <= i; c++)
7
+ l.push(c);
8
+ return l;
9
+ }, M = 5, v = ({
10
+ currentPage: m,
11
+ totalPages: i,
12
+ onPageChange: l
85
13
  }) => {
86
- const e = y(() => {
87
- if (i === 1 && s === 1)
14
+ const c = p(() => {
15
+ if (m === 1 && i === 1)
88
16
  return [];
89
- if (i === 1)
90
- return f(2, Math.min(s - 1, m + 1));
91
- if (s - m <= 0)
92
- return f(2, s - 1);
93
- let n, o;
94
- return i <= Math.ceil(m / 2) ? (n = 2, o = Math.min(m + 1, s - 1)) : i + Math.floor(m / 2) >= s ? (n = Math.max(s - m, 2), o = s - 1) : (n = i - Math.floor(m / 2), o = i + Math.floor(m / 2)), o = Math.min(o, s - 1), n = Math.max(n, 2), f(n, o);
95
- }, [i, s]);
96
- return /* @__PURE__ */ l.jsxs(c, { className: "d-flex justify-content-end", children: [
97
- /* @__PURE__ */ l.jsx(
98
- c.First,
17
+ if (m === 1)
18
+ return n(2, Math.min(i - 1, M + 1));
19
+ if (i - M <= 0)
20
+ return n(2, i - 1);
21
+ let d, h;
22
+ return m <= Math.ceil(M / 2) ? (d = 2, h = Math.min(M + 1, i - 1)) : m + Math.floor(M / 2) >= i ? (d = Math.max(i - M, 2), h = i - 1) : (d = m - Math.floor(M / 2), h = m + Math.floor(M / 2)), h = Math.min(h, i - 1), d = Math.max(d, 2), n(d, h);
23
+ }, [m, i]);
24
+ return /* @__PURE__ */ k(f, { className: "d-flex justify-content-end", children: [
25
+ /* @__PURE__ */ s(
26
+ f.First,
99
27
  {
100
- onClick: () => r(1),
101
- disabled: i === 1
28
+ onClick: () => l(1),
29
+ disabled: m === 1
102
30
  }
103
31
  ),
104
- /* @__PURE__ */ l.jsx(
105
- c.Prev,
32
+ /* @__PURE__ */ s(
33
+ f.Prev,
106
34
  {
107
- onClick: () => r(i - 1),
108
- disabled: i === 1
35
+ onClick: () => l(m - 1),
36
+ disabled: m === 1
109
37
  }
110
38
  ),
111
- /* @__PURE__ */ l.jsx(
112
- c.Item,
39
+ /* @__PURE__ */ s(
40
+ f.Item,
113
41
  {
114
- active: i === 1,
115
- onClick: () => r(1),
42
+ active: m === 1,
43
+ onClick: () => l(1),
116
44
  children: "1"
117
45
  }
118
46
  ),
119
- s > 2 && !e.includes(2) && /* @__PURE__ */ l.jsx(c.Ellipsis, {}),
120
- e.map((n) => /* @__PURE__ */ l.jsx(
121
- c.Item,
47
+ i > 2 && !c.includes(2) && /* @__PURE__ */ s(f.Ellipsis, {}),
48
+ c.map((d) => /* @__PURE__ */ s(
49
+ f.Item,
122
50
  {
123
- active: i === n,
124
- onClick: () => r(n),
125
- children: n
51
+ active: m === d,
52
+ onClick: () => l(d),
53
+ children: d
126
54
  },
127
- n
55
+ d
128
56
  )),
129
- s > m && !e.includes(s - 1) && /* @__PURE__ */ l.jsx(c.Ellipsis, {}),
130
- s > 1 && /* @__PURE__ */ l.jsx(
131
- c.Item,
57
+ i > M && !c.includes(i - 1) && /* @__PURE__ */ s(f.Ellipsis, {}),
58
+ i > 1 && /* @__PURE__ */ s(
59
+ f.Item,
132
60
  {
133
- active: i === s,
134
- onClick: () => r(s),
135
- children: s
61
+ active: m === i,
62
+ onClick: () => l(i),
63
+ children: i
136
64
  }
137
65
  ),
138
- /* @__PURE__ */ l.jsx(
139
- c.Next,
66
+ /* @__PURE__ */ s(
67
+ f.Next,
140
68
  {
141
- onClick: () => r(i + 1),
142
- disabled: i === s
69
+ onClick: () => l(m + 1),
70
+ disabled: m === i
143
71
  }
144
72
  ),
145
- /* @__PURE__ */ l.jsx(
146
- c.Last,
73
+ /* @__PURE__ */ s(
74
+ f.Last,
147
75
  {
148
- onClick: () => r(s),
149
- disabled: i === s
76
+ onClick: () => l(i),
77
+ disabled: m === i
150
78
  }
151
79
  )
152
80
  ] });
153
81
  };
154
82
  export {
155
- L as Paginator
83
+ v as Paginator
156
84
  };
@@ -1,20 +1,20 @@
1
- import { j as p } from "../../jsx-runtime-Drh4NO5G.js";
2
- import { useEffect as f } from "react";
1
+ import { jsx as f, Fragment as u } from "react/jsx-runtime";
2
+ import { useEffect as g } from "react";
3
3
  import "../../Context/AnalyticsContext.js";
4
4
  import "../../Context/MenuContext.js";
5
- import { useRouter as g } from "../../Context/RouterContext.js";
6
- import { useSession as x } from "../../Context/SessionContext.js";
7
- const v = ({
5
+ import { useRouter as h } from "../../Context/RouterContext.js";
6
+ import { useSession as d } from "../../Context/SessionContext.js";
7
+ const F = ({
8
8
  notAuthorizedPath: e,
9
9
  allowedPermissions: i = [],
10
10
  children: c
11
11
  }) => {
12
12
  var m;
13
- const { isAuthenticated: n, isLoading: r, user: t } = x(), { navigate: s } = g();
14
- return f(() => {
13
+ const { isAuthenticated: n, isLoading: r, user: t } = d(), { navigate: s } = h();
14
+ return g(() => {
15
15
  if (!r && n) {
16
16
  const o = (t == null ? void 0 : t.permissions) || [];
17
- !i.length || o.some((u) => i.includes(u)) || s(e);
17
+ !i.length || o.some((p) => i.includes(p)) || s(e);
18
18
  }
19
19
  }, [
20
20
  r,
@@ -25,8 +25,8 @@ const v = ({
25
25
  i
26
26
  ]), i.length > 0 && !((m = t == null ? void 0 : t.permissions) != null && m.some(
27
27
  (o) => i.includes(o)
28
- )) ? null : /* @__PURE__ */ p.jsx(p.Fragment, { children: c });
28
+ )) ? null : /* @__PURE__ */ f(u, { children: c });
29
29
  };
30
30
  export {
31
- v as ProtectedRoute
31
+ F as ProtectedRoute
32
32
  };
@@ -1,23 +1,23 @@
1
- import { j as n } from "../jsx-runtime-Drh4NO5G.js";
2
- import { createContext as a, useEffect as r } from "react";
3
- import { Events as c } from "../Common/Events.js";
1
+ import { jsx as n } from "react/jsx-runtime";
2
+ import { createContext as c, useEffect as r } from "react";
3
+ import { Events as a } from "../Common/Events.js";
4
4
  import { useDebouncedValue as m } from "../Hooks/useDebouncedValue.js";
5
- const u = a({}), p = "page-visit", E = ({
5
+ const u = c({}), d = "page-visit", E = ({
6
6
  onVisit: t,
7
7
  children: s
8
8
  }) => {
9
9
  const [e, o] = m(null, 1e4);
10
10
  return r(() => {
11
- c.subscribe(p, (i) => {
11
+ a.subscribe(d, (i) => {
12
12
  o(i.detail.id);
13
13
  });
14
14
  }, [o]), r(() => {
15
15
  e && t(e).then(() => {
16
16
  });
17
- }, [e, t]), /* @__PURE__ */ n.jsx(u.Provider, { value: {}, children: s });
17
+ }, [e, t]), /* @__PURE__ */ n(u.Provider, { value: {}, children: s });
18
18
  };
19
19
  export {
20
20
  u as AnalyticsContext,
21
21
  E as AnalyticsProvider,
22
- p as PAGE_VISIT_EVENT
22
+ d as PAGE_VISIT_EVENT
23
23
  };
@@ -1,55 +1,55 @@
1
- import { j as F } from "../jsx-runtime-Drh4NO5G.js";
2
- import { createContext as j, useMemo as d, useEffect as E, useContext as L } from "react";
3
- import { useQuery as S } from "../Hooks/useQuery.js";
4
- import { useRouter as y } from "./RouterContext.js";
5
- import { useSession as m } from "./SessionContext.js";
6
- const P = j({
1
+ import { jsx as R } from "react/jsx-runtime";
2
+ import { createContext as L, useMemo as d, useEffect as S, useContext as y } from "react";
3
+ import { useQuery as E } from "../Hooks/useQuery.js";
4
+ import { useRouter as j } from "./RouterContext.js";
5
+ import { useSession as q } from "./SessionContext.js";
6
+ const P = L({
7
7
  items: [],
8
8
  isLoading: !0
9
9
  }), A = ({
10
10
  requestMenu: e,
11
11
  children: h
12
12
  }) => {
13
- const { user: r } = m(), { basePath: l } = y(), {
13
+ const { user: r } = q(), { basePath: l } = j(), {
14
14
  data: o,
15
15
  loadData: f,
16
16
  isLoading: n,
17
17
  isLoaded: p
18
- } = S({
18
+ } = E({
19
19
  queryFunction: e
20
20
  }), g = d(() => {
21
21
  var w;
22
22
  const i = (r == null ? void 0 : r.permissions) || [], c = (r == null ? void 0 : r.roles) || [];
23
23
  return (w = o == null ? void 0 : o.items) != null && w.length ? o.items.filter((s) => {
24
- var x, v;
25
- if (!((x = s == null ? void 0 : s.allowedPermissions) != null && x.length) && !((v = s == null ? void 0 : s.allowedRoles) != null && v.length))
24
+ var v, x;
25
+ if (!((v = s == null ? void 0 : s.allowedPermissions) != null && v.length) && !((x = s == null ? void 0 : s.allowedRoles) != null && x.length))
26
26
  return !0;
27
27
  let t = !0;
28
28
  return s.allowedRoles && (t = t && s.allowedRoles.some((a) => c.includes(a))), s.allowedPermissions && (t = t && s.allowedPermissions.some(
29
29
  (a) => i.includes(a)
30
30
  )), t;
31
31
  }) : [];
32
- }, [o == null ? void 0 : o.items, r]), R = d(() => {
32
+ }, [o == null ? void 0 : o.items, r]), C = d(() => {
33
33
  if (!(o != null && o.subMenu))
34
34
  return;
35
35
  const i = o == null ? void 0 : o.subMenu.find(
36
36
  (c) => l === c.accessibleFrom
37
37
  );
38
38
  return (i == null ? void 0 : i.items) || void 0;
39
- }, [o == null ? void 0 : o.subMenu, l]), C = d(() => o != null && o.options ? o == null ? void 0 : o.options.filter(
39
+ }, [o == null ? void 0 : o.subMenu, l]), F = d(() => o != null && o.options ? o == null ? void 0 : o.options.filter(
40
40
  (i) => !i.accessibleFrom || l === i.accessibleFrom
41
41
  ) : [], [o == null ? void 0 : o.options, l]);
42
- return E(() => {
42
+ return S(() => {
43
43
  !n && !p && f({});
44
- }, [n, p, f]), /* @__PURE__ */ F.jsx(
44
+ }, [n, p, f]), /* @__PURE__ */ R(
45
45
  P.Provider,
46
46
  {
47
- value: { items: g, subMenu: R, options: C, isLoading: n },
47
+ value: { items: g, subMenu: C, options: F, isLoading: n },
48
48
  children: h
49
49
  }
50
50
  );
51
51
  }, B = () => {
52
- const e = L(P);
52
+ const e = y(P);
53
53
  if (e === void 0)
54
54
  throw new Error("useSession must be used within a SessionProvider");
55
55
  return e;