react-ecosistema-unp 0.6.4 → 0.7.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.
@@ -0,0 +1,51 @@
1
+ class o extends Error {
2
+ }
3
+ o.prototype.name = "InvalidTokenError";
4
+ function i(t) {
5
+ return decodeURIComponent(atob(t).replace(/(.)/g, (e, r) => {
6
+ let n = r.charCodeAt(0).toString(16).toUpperCase();
7
+ return n.length < 2 && (n = "0" + n), "%" + n;
8
+ }));
9
+ }
10
+ function s(t) {
11
+ let e = t.replace(/-/g, "+").replace(/_/g, "/");
12
+ switch (e.length % 4) {
13
+ case 0:
14
+ break;
15
+ case 2:
16
+ e += "==";
17
+ break;
18
+ case 3:
19
+ e += "=";
20
+ break;
21
+ default:
22
+ throw new Error("base64 string is not of the correct length");
23
+ }
24
+ try {
25
+ return i(e);
26
+ } catch {
27
+ return atob(e);
28
+ }
29
+ }
30
+ function d(t, e) {
31
+ if (typeof t != "string")
32
+ throw new o("Invalid token specified: must be a string");
33
+ e || (e = {});
34
+ const r = e.header === !0 ? 0 : 1, n = t.split(".")[r];
35
+ if (typeof n != "string")
36
+ throw new o(`Invalid token specified: missing part #${r + 1}`);
37
+ let c;
38
+ try {
39
+ c = s(n);
40
+ } catch (a) {
41
+ throw new o(`Invalid token specified: invalid base64 for part #${r + 1} (${a.message})`);
42
+ }
43
+ try {
44
+ return JSON.parse(c);
45
+ } catch (a) {
46
+ throw new o(`Invalid token specified: invalid json for part #${r + 1} (${a.message})`);
47
+ }
48
+ }
49
+ export {
50
+ d as j
51
+ };
@@ -0,0 +1,3 @@
1
+ import { default as React } from 'react';
2
+ declare const ProtectedRoute: React.FC;
3
+ export { ProtectedRoute };
@@ -0,0 +1,3 @@
1
+ import { default as React } from 'react';
2
+ declare const UserRoute: React.FC;
3
+ export { UserRoute };
@@ -1 +1,3 @@
1
1
  export { AuthProvider } from './auth/contexts/AuthContex.js';
2
+ export { ProtectedRoute } from './utils/components/ProtectedRoute.js';
3
+ export { UserRoute } from './utils/components/UserRoute.js';
@@ -1,6 +1,6 @@
1
1
  import { jsxs as r, jsx as n } from "react/jsx-runtime";
2
2
  import s from "react";
3
- import { B as t } from "../../useFinalizarSesion-COlHmXt5.js";
3
+ import { B as t } from "../../chunk-IR6S3I6Y-Dvzk3EbC.js";
4
4
  import { MenuLateral as a } from "./MenuLateral.js";
5
5
  const c = () => {
6
6
  const [e, o] = s.useState(!1);
@@ -1,122 +1,76 @@
1
1
  import { jsx as a, Fragment as x, jsxs as t } from "react/jsx-runtime";
2
- import { useState as m, useEffect as p } from "react";
3
- import { u as z, a as k } from "../../useFinalizarSesion-COlHmXt5.js";
4
- import { urlBase as M, urlCertificadoLaboral as w } from "../../utils/Url.js";
5
- import { G as c } from "../../iconBase-LROS5hdG.js";
6
- import '../../assets/MenuLateral.css';class o extends Error {
2
+ import { useState as o, useEffect as h } from "react";
3
+ import { a as z } from "../../chunk-IR6S3I6Y-Dvzk3EbC.js";
4
+ import { j as d } from "../../index-CuHybtft.js";
5
+ import { useFinalizarSesion as b } from "../../auth/hooks/useFinalizarSesion.js";
6
+ import { urlBase as M, urlCertificadoLaboral as k } from "../../utils/Url.js";
7
+ import { G as i } from "../../iconBase-LROS5hdG.js";
8
+ import '../../assets/MenuLateral.css';function B(e) {
9
+ return i({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M2 12h2a7.986 7.986 0 0 1 2.337-5.663 7.91 7.91 0 0 1 2.542-1.71 8.12 8.12 0 0 1 6.13-.041A2.488 2.488 0 0 0 17.5 7C18.886 7 20 5.886 20 4.5S18.886 2 17.5 2c-.689 0-1.312.276-1.763.725-2.431-.973-5.223-.958-7.635.059a9.928 9.928 0 0 0-3.18 2.139 9.92 9.92 0 0 0-2.14 3.179A10.005 10.005 0 0 0 2 12zm17.373 3.122c-.401.952-.977 1.808-1.71 2.541s-1.589 1.309-2.542 1.71a8.12 8.12 0 0 1-6.13.041A2.488 2.488 0 0 0 6.5 17C5.114 17 4 18.114 4 19.5S5.114 22 6.5 22c.689 0 1.312-.276 1.763-.725A9.965 9.965 0 0 0 12 22a9.983 9.983 0 0 0 9.217-6.102A9.992 9.992 0 0 0 22 12h-2a7.993 7.993 0 0 1-.627 3.122z" }, child: [] }, { tag: "path", attr: { d: "M12 7.462c-2.502 0-4.538 2.036-4.538 4.538S9.498 16.538 12 16.538s4.538-2.036 4.538-4.538S14.502 7.462 12 7.462zm0 7.076c-1.399 0-2.538-1.139-2.538-2.538S10.601 9.462 12 9.462s2.538 1.139 2.538 2.538-1.139 2.538-2.538 2.538z" }, child: [] }] })(e);
7
10
  }
8
- o.prototype.name = "InvalidTokenError";
9
- function B(e) {
10
- return decodeURIComponent(atob(e).replace(/(.)/g, (i, l) => {
11
- let n = l.charCodeAt(0).toString(16).toUpperCase();
12
- return n.length < 2 && (n = "0" + n), "%" + n;
13
- }));
11
+ function H(e) {
12
+ return i({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M19 2H6c-1.206 0-3 .799-3 3v14c0 2.201 1.794 3 3 3h15v-2H6.012C5.55 19.988 5 19.806 5 19s.55-.988 1.012-1H21V4c0-1.103-.897-2-2-2zm0 14H5V5c0-.806.55-.988 1-1h13v12z" }, child: [] }] })(e);
14
13
  }
15
14
  function C(e) {
16
- let i = e.replace(/-/g, "+").replace(/_/g, "/");
17
- switch (i.length % 4) {
18
- case 0:
19
- break;
20
- case 2:
21
- i += "==";
22
- break;
23
- case 3:
24
- i += "=";
25
- break;
26
- default:
27
- throw new Error("base64 string is not of the correct length");
28
- }
29
- try {
30
- return B(i);
31
- } catch {
32
- return atob(i);
33
- }
34
- }
35
- function g(e, i) {
36
- if (typeof e != "string")
37
- throw new o("Invalid token specified: must be a string");
38
- i || (i = {});
39
- const l = i.header === !0 ? 0 : 1, n = e.split(".")[l];
40
- if (typeof n != "string")
41
- throw new o(`Invalid token specified: missing part #${l + 1}`);
42
- let r;
43
- try {
44
- r = C(n);
45
- } catch (s) {
46
- throw new o(`Invalid token specified: invalid base64 for part #${l + 1} (${s.message})`);
47
- }
48
- try {
49
- return JSON.parse(r);
50
- } catch (s) {
51
- throw new o(`Invalid token specified: invalid json for part #${l + 1} (${s.message})`);
52
- }
53
- }
54
- function H(e) {
55
- return c({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M2 12h2a7.986 7.986 0 0 1 2.337-5.663 7.91 7.91 0 0 1 2.542-1.71 8.12 8.12 0 0 1 6.13-.041A2.488 2.488 0 0 0 17.5 7C18.886 7 20 5.886 20 4.5S18.886 2 17.5 2c-.689 0-1.312.276-1.763.725-2.431-.973-5.223-.958-7.635.059a9.928 9.928 0 0 0-3.18 2.139 9.92 9.92 0 0 0-2.14 3.179A10.005 10.005 0 0 0 2 12zm17.373 3.122c-.401.952-.977 1.808-1.71 2.541s-1.589 1.309-2.542 1.71a8.12 8.12 0 0 1-6.13.041A2.488 2.488 0 0 0 6.5 17C5.114 17 4 18.114 4 19.5S5.114 22 6.5 22c.689 0 1.312-.276 1.763-.725A9.965 9.965 0 0 0 12 22a9.983 9.983 0 0 0 9.217-6.102A9.992 9.992 0 0 0 22 12h-2a7.993 7.993 0 0 1-.627 3.122z" }, child: [] }, { tag: "path", attr: { d: "M12 7.462c-2.502 0-4.538 2.036-4.538 4.538S9.498 16.538 12 16.538s4.538-2.036 4.538-4.538S14.502 7.462 12 7.462zm0 7.076c-1.399 0-2.538-1.139-2.538-2.538S10.601 9.462 12 9.462s2.538 1.139 2.538 2.538-1.139 2.538-2.538 2.538z" }, child: [] }] })(e);
15
+ return i({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M20 4H4c-1.103 0-2 .897-2 2v12c0 1.103.897 2 2 2h16c1.103 0 2-.897 2-2V6c0-1.103-.897-2-2-2zm0 2v.511l-8 6.223-8-6.222V6h16zM4 18V9.044l7.386 5.745a.994.994 0 0 0 1.228 0L20 9.044 20.002 18H4z" }, child: [] }] })(e);
56
16
  }
57
17
  function _(e) {
58
- return c({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M19 2H6c-1.206 0-3 .799-3 3v14c0 2.201 1.794 3 3 3h15v-2H6.012C5.55 19.988 5 19.806 5 19s.55-.988 1.012-1H21V4c0-1.103-.897-2-2-2zm0 14H5V5c0-.806.55-.988 1-1h13v12z" }, child: [] }] })(e);
18
+ return i({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M11.953 2C6.465 2 2 6.486 2 12s4.486 10 10 10 10-4.486 10-10S17.493 2 11.953 2zM12 20c-4.411 0-8-3.589-8-8s3.567-8 7.953-8C16.391 4 20 7.589 20 12s-3.589 8-8 8z" }, child: [] }, { tag: "path", attr: { d: "M11 7h2v7h-2zm0 8h2v2h-2z" }, child: [] }] })(e);
59
19
  }
60
- function S(e) {
61
- return c({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M20 4H4c-1.103 0-2 .897-2 2v12c0 1.103.897 2 2 2h16c1.103 0 2-.897 2-2V6c0-1.103-.897-2-2-2zm0 2v.511l-8 6.223-8-6.222V6h16zM4 18V9.044l7.386 5.745a.994.994 0 0 0 1.228 0L20 9.044 20.002 18H4z" }, child: [] }] })(e);
20
+ function w(e) {
21
+ return i({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M19.903 8.586a.997.997 0 0 0-.196-.293l-6-6a.997.997 0 0 0-.293-.196c-.03-.014-.062-.022-.094-.033a.991.991 0 0 0-.259-.051C13.04 2.011 13.021 2 13 2H6c-1.103 0-2 .897-2 2v16c0 1.103.897 2 2 2h12c1.103 0 2-.897 2-2V9c0-.021-.011-.04-.013-.062a.952.952 0 0 0-.051-.259c-.01-.032-.019-.063-.033-.093zM16.586 8H14V5.414L16.586 8zM6 20V4h6v5a1 1 0 0 0 1 1h5l.002 10H6z" }, child: [] }, { tag: "path", attr: { d: "M8 12h8v2H8zm0 4h8v2H8zm0-8h2v2H8z" }, child: [] }] })(e);
62
22
  }
63
23
  function A(e) {
64
- return c({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M11.953 2C6.465 2 2 6.486 2 12s4.486 10 10 10 10-4.486 10-10S17.493 2 11.953 2zM12 20c-4.411 0-8-3.589-8-8s3.567-8 7.953-8C16.391 4 20 7.589 20 12s-3.589 8-8 8z" }, child: [] }, { tag: "path", attr: { d: "M11 7h2v7h-2zm0 8h2v2h-2z" }, child: [] }] })(e);
24
+ return i({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M3 13h1v7c0 1.103.897 2 2 2h12c1.103 0 2-.897 2-2v-7h1a1 1 0 0 0 .707-1.707l-9-9a.999.999 0 0 0-1.414 0l-9 9A1 1 0 0 0 3 13zm7 7v-5h4v5h-4zm2-15.586 6 6V15l.001 5H16v-5c0-1.103-.897-2-2-2h-4c-1.103 0-2 .897-2 2v5H6v-9.586l6-6z" }, child: [] }] })(e);
65
25
  }
66
- function I(e) {
67
- return c({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M19.903 8.586a.997.997 0 0 0-.196-.293l-6-6a.997.997 0 0 0-.293-.196c-.03-.014-.062-.022-.094-.033a.991.991 0 0 0-.259-.051C13.04 2.011 13.021 2 13 2H6c-1.103 0-2 .897-2 2v16c0 1.103.897 2 2 2h12c1.103 0 2-.897 2-2V9c0-.021-.011-.04-.013-.062a.952.952 0 0 0-.051-.259c-.01-.032-.019-.063-.033-.093zM16.586 8H14V5.414L16.586 8zM6 20V4h6v5a1 1 0 0 0 1 1h5l.002 10H6z" }, child: [] }, { tag: "path", attr: { d: "M8 12h8v2H8zm0 4h8v2H8zm0-8h2v2H8z" }, child: [] }] })(e);
26
+ function S(e) {
27
+ return i({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M4.222 19.778a4.983 4.983 0 0 0 3.535 1.462 4.986 4.986 0 0 0 3.536-1.462l2.828-2.829-1.414-1.414-2.828 2.829a3.007 3.007 0 0 1-4.243 0 3.005 3.005 0 0 1 0-4.243l2.829-2.828-1.414-1.414-2.829 2.828a5.006 5.006 0 0 0 0 7.071zm15.556-8.485a5.008 5.008 0 0 0 0-7.071 5.006 5.006 0 0 0-7.071 0L9.879 7.051l1.414 1.414 2.828-2.829a3.007 3.007 0 0 1 4.243 0 3.005 3.005 0 0 1 0 4.243l-2.829 2.828 1.414 1.414 2.829-2.828z" }, child: [] }, { tag: "path", attr: { d: "m8.464 16.95-1.415-1.414 8.487-8.486 1.414 1.415z" }, child: [] }] })(e);
68
28
  }
69
29
  function V(e) {
70
- return c({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M3 13h1v7c0 1.103.897 2 2 2h12c1.103 0 2-.897 2-2v-7h1a1 1 0 0 0 .707-1.707l-9-9a.999.999 0 0 0-1.414 0l-9 9A1 1 0 0 0 3 13zm7 7v-5h4v5h-4zm2-15.586 6 6V15l.001 5H16v-5c0-1.103-.897-2-2-2h-4c-1.103 0-2 .897-2 2v5H6v-9.586l6-6z" }, child: [] }] })(e);
30
+ return i({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M16 13v-2H7V8l-5 4 5 4v-3z" }, child: [] }, { tag: "path", attr: { d: "M20 3h-9c-1.103 0-2 .897-2 2v4h2V5h9v14h-9v-4H9v4c0 1.103.897 2 2 2h9c1.103 0 2-.897 2-2V5c0-1.103-.897-2-2-2z" }, child: [] }] })(e);
71
31
  }
72
32
  function L(e) {
73
- return c({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M4.222 19.778a4.983 4.983 0 0 0 3.535 1.462 4.986 4.986 0 0 0 3.536-1.462l2.828-2.829-1.414-1.414-2.828 2.829a3.007 3.007 0 0 1-4.243 0 3.005 3.005 0 0 1 0-4.243l2.829-2.828-1.414-1.414-2.829 2.828a5.006 5.006 0 0 0 0 7.071zm15.556-8.485a5.008 5.008 0 0 0 0-7.071 5.006 5.006 0 0 0-7.071 0L9.879 7.051l1.414 1.414 2.828-2.829a3.007 3.007 0 0 1 4.243 0 3.005 3.005 0 0 1 0 4.243l-2.829 2.828 1.414 1.414 2.829-2.828z" }, child: [] }, { tag: "path", attr: { d: "m8.464 16.95-1.415-1.414 8.487-8.486 1.414 1.415z" }, child: [] }] })(e);
74
- }
75
- function y(e) {
76
- return c({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M16 13v-2H7V8l-5 4 5 4v-3z" }, child: [] }, { tag: "path", attr: { d: "M20 3h-9c-1.103 0-2 .897-2 2v4h2V5h9v14h-9v-4H9v4c0 1.103.897 2 2 2h9c1.103 0 2-.897 2-2V5c0-1.103-.897-2-2-2z" }, child: [] }] })(e);
77
- }
78
- function T(e) {
79
- return c({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "m12 17 1-2V9.858c1.721-.447 3-2 3-3.858 0-2.206-1.794-4-4-4S8 3.794 8 6c0 1.858 1.279 3.411 3 3.858V15l1 2zM10 6c0-1.103.897-2 2-2s2 .897 2 2-.897 2-2 2-2-.897-2-2z" }, child: [] }, { tag: "path", attr: { d: "m16.267 10.563-.533 1.928C18.325 13.207 20 14.584 20 16c0 1.892-3.285 4-8 4s-8-2.108-8-4c0-1.416 1.675-2.793 4.267-3.51l-.533-1.928C4.197 11.54 2 13.623 2 16c0 3.364 4.393 6 10 6s10-2.636 10-6c0-2.377-2.197-4.46-5.733-5.437z" }, child: [] }] })(e);
33
+ return i({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "m12 17 1-2V9.858c1.721-.447 3-2 3-3.858 0-2.206-1.794-4-4-4S8 3.794 8 6c0 1.858 1.279 3.411 3 3.858V15l1 2zM10 6c0-1.103.897-2 2-2s2 .897 2 2-.897 2-2 2-2-.897-2-2z" }, child: [] }, { tag: "path", attr: { d: "m16.267 10.563-.533 1.928C18.325 13.207 20 14.584 20 16c0 1.892-3.285 4-8 4s-8-2.108-8-4c0-1.416 1.675-2.793 4.267-3.51l-.533-1.928C4.197 11.54 2 13.623 2 16c0 3.364 4.393 6 10 6s10-2.636 10-6c0-2.377-2.197-4.46-5.733-5.437z" }, child: [] }] })(e);
80
34
  }
81
35
  function P(e) {
82
- return c({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M4 6h16v2H4zm4 5h12v2H8zm5 5h7v2h-7z" }, child: [] }] })(e);
36
+ return i({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M4 6h16v2H4zm4 5h12v2H8zm5 5h7v2h-7z" }, child: [] }] })(e);
83
37
  }
84
- function E(e) {
85
- return c({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M4 6h16v2H4zm0 5h16v2H4zm0 5h16v2H4z" }, child: [] }] })(e);
38
+ function T(e) {
39
+ return i({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M4 6h16v2H4zm0 5h16v2H4zm0 5h16v2H4z" }, child: [] }] })(e);
86
40
  }
87
- function U(e) {
88
- return c({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M11.63 21.91A.9.9 0 0 0 12 22a1 1 0 0 0 .41-.09C22 17.67 21 7 21 6.9a1 1 0 0 0-.55-.79l-8-4a1 1 0 0 0-.9 0l-8 4A1 1 0 0 0 3 6.9c0 .1-.92 10.77 8.63 15.01zM5 7.63l7-3.51 7 3.51c.05 2-.27 9-7 12.27C5.26 16.63 4.94 9.64 5 7.63z" }, child: [] }, { tag: "path", attr: { d: "M11.06 16h2v-3h3.01v-2h-3.01V8h-2v3h-3v2h3v3z" }, child: [] }] })(e);
41
+ function I(e) {
42
+ return i({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M11.63 21.91A.9.9 0 0 0 12 22a1 1 0 0 0 .41-.09C22 17.67 21 7 21 6.9a1 1 0 0 0-.55-.79l-8-4a1 1 0 0 0-.9 0l-8 4A1 1 0 0 0 3 6.9c0 .1-.92 10.77 8.63 15.01zM5 7.63l7-3.51 7 3.51c.05 2-.27 9-7 12.27C5.26 16.63 4.94 9.64 5 7.63z" }, child: [] }, { tag: "path", attr: { d: "M11.06 16h2v-3h3.01v-2h-3.01V8h-2v3h-3v2h3v3z" }, child: [] }] })(e);
89
43
  }
90
- function $(e) {
91
- return c({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M3.414 13.778 2 15.192l4.949 2.121 2.122 4.95 1.414-1.414-.707-3.536L13.091 14l3.61 7.704 1.339-1.339-1.19-10.123 2.828-2.829a2 2 0 1 0-2.828-2.828l-2.903 2.903L3.824 6.297 2.559 7.563l7.644 3.67-3.253 3.253-3.536-.708z" }, child: [] }] })(e);
44
+ function y(e) {
45
+ return i({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M3.414 13.778 2 15.192l4.949 2.121 2.122 4.95 1.414-1.414-.707-3.536L13.091 14l3.61 7.704 1.339-1.339-1.19-10.123 2.828-2.829a2 2 0 1 0-2.828-2.828l-2.903 2.903L3.824 6.297 2.559 7.563l7.644 3.67-3.253 3.253-3.536-.708z" }, child: [] }] })(e);
92
46
  }
93
47
  function j(e) {
94
- return c({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M15.661 15.549a1.315 1.315 0 0 0 1.185-1.386 1.363 1.363 0 0 0-1.35-1.302h-.048a1.352 1.352 0 0 0-1.303 1.397c.024.379.179.687.391.911-.827 1.609-2.07 2.794-3.954 3.788-1.266.663-2.604.912-3.905.734-1.089-.153-1.94-.64-2.463-1.421-.78-1.185-.852-2.462-.201-3.74a5.597 5.597 0 0 1 1.658-1.931 7.88 7.88 0 0 1-.331-1.218c-3.506 2.51-3.148 5.942-2.084 7.564.794 1.184 2.415 1.941 4.19 1.941.474 0 .972-.035 1.457-.154 3.077-.592 5.409-2.438 6.747-5.16l.011-.023z" }, child: [] }, { tag: "path", attr: { d: "M19.887 12.589c-1.834-2.154-4.533-3.337-7.611-3.337h-.403c-.2-.438-.661-.711-1.183-.711h-.036c-.744 0-1.325.64-1.301 1.385.023.71.627 1.302 1.35 1.302h.059a1.332 1.332 0 0 0 1.183-.828h.439c1.824 0 3.551.532 5.126 1.574 1.206.792 2.072 1.834 2.557 3.077.425 1.019.402 2.013-.035 2.843-.675 1.302-1.812 1.988-3.314 1.988-.947 0-1.871-.296-2.345-.509-.283.235-.758.626-1.102.863 1.042.473 2.096.746 3.113.746 2.309 0 4.023-1.302 4.676-2.557.709-1.422.651-3.813-1.161-5.859l-.012.023z" }, child: [] }, { tag: "path", attr: { d: "M7.647 15.975c.023.71.626 1.302 1.35 1.302h.048a1.334 1.334 0 0 0 1.302-1.397c0-.71-.616-1.301-1.338-1.301h-.048c-.048 0-.118 0-.178.022-.982-1.657-1.397-3.434-1.242-5.349.094-1.445.567-2.7 1.42-3.742.71-.888 2.048-1.326 2.96-1.35 2.556-.048 3.622 3.138 3.704 4.404l1.184.354C16.536 5.036 14.122 3 11.813 3 9.647 3 7.647 4.574 6.842 6.884c-1.102 3.077-.379 6.036.971 8.404-.118.154-.189.426-.166.687z" }, child: [] }] })(e);
95
- }
96
- const J = ({ onToggle: e, isOpen: i }) => {
97
- const [l, n] = m(!0), [r, s] = m(null), v = i ? "sidebar-bar-panel open" : "sidebar-bar-panel", u = z(), { FinSesion: f } = k();
98
- if (p(() => {
99
- const d = localStorage.getItem("user_token");
100
- if (d) {
101
- const h = g(d);
102
- s(h);
48
+ return i({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M15.661 15.549a1.315 1.315 0 0 0 1.185-1.386 1.363 1.363 0 0 0-1.35-1.302h-.048a1.352 1.352 0 0 0-1.303 1.397c.024.379.179.687.391.911-.827 1.609-2.07 2.794-3.954 3.788-1.266.663-2.604.912-3.905.734-1.089-.153-1.94-.64-2.463-1.421-.78-1.185-.852-2.462-.201-3.74a5.597 5.597 0 0 1 1.658-1.931 7.88 7.88 0 0 1-.331-1.218c-3.506 2.51-3.148 5.942-2.084 7.564.794 1.184 2.415 1.941 4.19 1.941.474 0 .972-.035 1.457-.154 3.077-.592 5.409-2.438 6.747-5.16l.011-.023z" }, child: [] }, { tag: "path", attr: { d: "M19.887 12.589c-1.834-2.154-4.533-3.337-7.611-3.337h-.403c-.2-.438-.661-.711-1.183-.711h-.036c-.744 0-1.325.64-1.301 1.385.023.71.627 1.302 1.35 1.302h.059a1.332 1.332 0 0 0 1.183-.828h.439c1.824 0 3.551.532 5.126 1.574 1.206.792 2.072 1.834 2.557 3.077.425 1.019.402 2.013-.035 2.843-.675 1.302-1.812 1.988-3.314 1.988-.947 0-1.871-.296-2.345-.509-.283.235-.758.626-1.102.863 1.042.473 2.096.746 3.113.746 2.309 0 4.023-1.302 4.676-2.557.709-1.422.651-3.813-1.161-5.859l-.012.023z" }, child: [] }, { tag: "path", attr: { d: "M7.647 15.975c.023.71.626 1.302 1.35 1.302h.048a1.334 1.334 0 0 0 1.302-1.397c0-.71-.616-1.301-1.338-1.301h-.048c-.048 0-.118 0-.178.022-.982-1.657-1.397-3.434-1.242-5.349.094-1.445.567-2.7 1.42-3.742.71-.888 2.048-1.326 2.96-1.35 2.556-.048 3.622 3.138 3.704 4.404l1.184.354C16.536 5.036 14.122 3 11.813 3 9.647 3 7.647 4.574 6.842 6.884c-1.102 3.077-.379 6.036.971 8.404-.118.154-.189.426-.166.687z" }, child: [] }] })(e);
49
+ }
50
+ const O = ({ onToggle: e, isOpen: n }) => {
51
+ const [m, p] = o(!0), [r, s] = o(null), v = n ? "sidebar-bar-panel open" : "sidebar-bar-panel", g = z(), { FinSesion: u } = b();
52
+ if (h(() => {
53
+ const l = localStorage.getItem("user_token");
54
+ if (l) {
55
+ const c = d(l);
56
+ s(c);
103
57
  }
104
- n(!1);
105
- }, []), p(() => {
106
- const d = setTimeout(() => {
107
- const h = localStorage.getItem("user_token");
108
- if (h) {
109
- const b = g(h);
110
- s(b);
58
+ p(!1);
59
+ }, []), h(() => {
60
+ const l = setTimeout(() => {
61
+ const c = localStorage.getItem("user_token");
62
+ if (c) {
63
+ const f = d(c);
64
+ s(f);
111
65
  }
112
66
  }, 2e3);
113
- return () => clearTimeout(d);
114
- }, []), l)
67
+ return () => clearTimeout(l);
68
+ }, []), m)
115
69
  return /* @__PURE__ */ a(x, {});
116
70
  const N = () => {
117
- u("/sistema/usuario");
71
+ g("/sistema/usuario");
118
72
  };
119
- return /* @__PURE__ */ a("div", { className: `container-fluid ${i ? "menu-open" : ""}`, children: /* @__PURE__ */ t("div", { className: v, children: [
73
+ return /* @__PURE__ */ a("div", { className: `container-fluid ${n ? "menu-open" : ""}`, children: /* @__PURE__ */ t("div", { className: v, children: [
120
74
  /* @__PURE__ */ t("div", { className: "logo_details", children: [
121
75
  /* @__PURE__ */ a(
122
76
  "img",
@@ -127,33 +81,33 @@ const J = ({ onToggle: e, isOpen: i }) => {
127
81
  }
128
82
  ),
129
83
  /* @__PURE__ */ a("div", { className: "logo-name", children: "EI - UNP" }),
130
- i ? /* @__PURE__ */ a(
84
+ n ? /* @__PURE__ */ a(
131
85
  P,
132
86
  {
133
87
  className: "bx bx-menu i",
134
88
  id: "btn",
135
89
  onClick: e
136
90
  }
137
- ) : /* @__PURE__ */ a(E, { className: "bx bx-menu i", id: "btn", onClick: e })
91
+ ) : /* @__PURE__ */ a(T, { className: "bx bx-menu i", id: "btn", onClick: e })
138
92
  ] }),
139
93
  /* @__PURE__ */ t("ul", { className: "nav-list-panel", children: [
140
94
  /* @__PURE__ */ t("li", { children: [
141
95
  /* @__PURE__ */ t("a", { href: "", children: [
142
- /* @__PURE__ */ a(V, { className: "bx bx-home i2" }),
96
+ /* @__PURE__ */ a(A, { className: "bx bx-home i2" }),
143
97
  /* @__PURE__ */ a("span", { className: "link_name", children: "Inicio" })
144
98
  ] }),
145
99
  /* @__PURE__ */ a("span", { className: "tooltip", children: "Inicio" })
146
100
  ] }),
147
101
  /* @__PURE__ */ t("li", { children: [
148
102
  /* @__PURE__ */ t("a", { href: "", children: [
149
- /* @__PURE__ */ a(T, { className: "bx bx-map-pin i2" }),
103
+ /* @__PURE__ */ a(L, { className: "bx bx-map-pin i2" }),
150
104
  /* @__PURE__ */ a("span", { className: "link_name", children: "Mapa del proceso" })
151
105
  ] }),
152
106
  /* @__PURE__ */ a("span", { className: "tooltip", children: "Mapa del proceso" })
153
107
  ] }),
154
108
  /* @__PURE__ */ t("li", { children: [
155
109
  /* @__PURE__ */ t("a", { href: "", children: [
156
- /* @__PURE__ */ a(_, { className: "bx bx-book-alt i2" }),
110
+ /* @__PURE__ */ a(H, { className: "bx bx-book-alt i2" }),
157
111
  /* @__PURE__ */ a("span", { className: "link_name", children: "Manuales de usuario" })
158
112
  ] }),
159
113
  /* @__PURE__ */ a("span", { className: "tooltip", children: "Manual de usuario" })
@@ -161,7 +115,7 @@ const J = ({ onToggle: e, isOpen: i }) => {
161
115
  /* @__PURE__ */ a("div", { style: { paddingLeft: "15px", paddingRight: "15px" }, children: /* @__PURE__ */ a("hr", { style: { borderTop: "1px solid white" } }) }),
162
116
  /* @__PURE__ */ t("li", { children: [
163
117
  /* @__PURE__ */ t("a", { href: "https://www.unp.gov.co/", target: "_blank", children: [
164
- /* @__PURE__ */ a(L, { className: "bx bx-link-alt i2" }),
118
+ /* @__PURE__ */ a(S, { className: "bx bx-link-alt i2" }),
165
119
  /* @__PURE__ */ a("span", { className: "link_name", children: "Portal UNP" })
166
120
  ] }),
167
121
  /* @__PURE__ */ a("span", { className: "tooltip", children: "Portal UNP" })
@@ -173,7 +127,7 @@ const J = ({ onToggle: e, isOpen: i }) => {
173
127
  href: "https://login.microsoftonline.com/common/oauth2/authorize?client_id=00000002-0000-0ff1-ce00-000000000000",
174
128
  target: "_blank",
175
129
  children: [
176
- /* @__PURE__ */ a(S, { className: "bx bx-envelope i2" }),
130
+ /* @__PURE__ */ a(C, { className: "bx bx-envelope i2" }),
177
131
  /* @__PURE__ */ a("span", { className: "link_name", children: "Correo institucional" })
178
132
  ]
179
133
  }
@@ -189,7 +143,7 @@ const J = ({ onToggle: e, isOpen: i }) => {
189
143
  ] }),
190
144
  /* @__PURE__ */ t("li", { children: [
191
145
  /* @__PURE__ */ t("a", { href: "https://mesadeservicios.unp.gov.co/HEAT/", target: "_blank", children: [
192
- /* @__PURE__ */ a(A, { className: "bx bx-error-circle i2" }),
146
+ /* @__PURE__ */ a(_, { className: "bx bx-error-circle i2" }),
193
147
  /* @__PURE__ */ a("span", { className: "link_name", children: "Mesa de servicios" })
194
148
  ] }),
195
149
  /* @__PURE__ */ a("span", { className: "tooltip", children: "Mesa de servicios" })
@@ -197,28 +151,28 @@ const J = ({ onToggle: e, isOpen: i }) => {
197
151
  /* @__PURE__ */ a("div", { style: { paddingLeft: "15px", paddingRight: "15px" }, children: /* @__PURE__ */ a("hr", { style: { borderTop: "1px solid white" } }) }),
198
152
  /* @__PURE__ */ t("li", { children: [
199
153
  /* @__PURE__ */ t("a", { href: "", children: [
200
- /* @__PURE__ */ a(U, { className: "bx i2" }),
154
+ /* @__PURE__ */ a(I, { className: "bx i2" }),
201
155
  /* @__PURE__ */ a("span", { className: "link_name", children: "Medida de emergencia" })
202
156
  ] }),
203
157
  /* @__PURE__ */ a("span", { className: "tooltip", children: "Medida de emergencia" })
204
158
  ] }),
205
159
  /* @__PURE__ */ t("li", { children: [
206
160
  /* @__PURE__ */ t("a", { href: "", children: [
207
- /* @__PURE__ */ a(H, { className: "bx i2" }),
161
+ /* @__PURE__ */ a(B, { className: "bx i2" }),
208
162
  /* @__PURE__ */ a("span", { className: "link_name", children: "Acta de reunión" })
209
163
  ] }),
210
164
  /* @__PURE__ */ a("span", { className: "tooltip", children: "Acta de reunión" })
211
165
  ] }),
212
166
  /* @__PURE__ */ t("li", { children: [
213
167
  /* @__PURE__ */ t("a", { href: "", children: [
214
- /* @__PURE__ */ a($, { className: "bx i2" }),
168
+ /* @__PURE__ */ a(y, { className: "bx i2" }),
215
169
  /* @__PURE__ */ a("span", { className: "link_name", children: "Solicitud de viáticos" })
216
170
  ] }),
217
171
  /* @__PURE__ */ a("span", { className: "tooltip", children: "Solicitud de viáticos" })
218
172
  ] }),
219
173
  /* @__PURE__ */ t("li", { children: [
220
- /* @__PURE__ */ t("a", { href: `${M}${w}`, target: "_blank", children: [
221
- /* @__PURE__ */ a(I, { className: "bx i2" }),
174
+ /* @__PURE__ */ t("a", { href: `${M}${k}`, target: "_blank", children: [
175
+ /* @__PURE__ */ a(w, { className: "bx i2" }),
222
176
  /* @__PURE__ */ a("span", { className: "link_name", children: "Certificados laborales (OPS)" })
223
177
  ] }),
224
178
  /* @__PURE__ */ a("span", { className: "tooltip", children: "Certificados laborales (OPS)" })
@@ -237,10 +191,10 @@ const J = ({ onToggle: e, isOpen: i }) => {
237
191
  ] })
238
192
  }
239
193
  ),
240
- /* @__PURE__ */ a(y, { className: "icon", onClick: f })
194
+ /* @__PURE__ */ a(V, { className: "icon", onClick: u })
241
195
  ] }) })
242
196
  ] }) });
243
197
  };
244
198
  export {
245
- J as MenuLateral
199
+ O as MenuLateral
246
200
  };
@@ -1,6 +1,6 @@
1
1
  import { jsxs as r, jsx as n } from "react/jsx-runtime";
2
2
  import s from "react";
3
- import { B as a } from "../../useFinalizarSesion-COlHmXt5.js";
3
+ import { B as a } from "../../chunk-IR6S3I6Y-Dvzk3EbC.js";
4
4
  import { MenuLateral as m } from "./MenuLateral.js";
5
5
  const u = ({ children: o }) => {
6
6
  const [e, t] = s.useState(!1);
@@ -1,7 +1,7 @@
1
1
  import { jsx as r, jsxs as j } from "react/jsx-runtime";
2
2
  import * as b from "react";
3
3
  import T, { useRef as O, useContext as E, useEffect as M } from "react";
4
- import { B as H } from "../../useFinalizarSesion-COlHmXt5.js";
4
+ import { B as H } from "../../chunk-IR6S3I6Y-Dvzk3EbC.js";
5
5
  import { MenuLateral as F } from "./MenuLateral.js";
6
6
  import { N as W, u as Y, a as z, d as G, b as J, q as Q, c as B, e as D, f as X, g as Z } from "../../NotificacionUsuario-kzdhBqMF.js";
7
7
  import { u as ee, T as te, g as ne, a as ae, b as re } from "../../Bootstrap-B6mAgGTS.js";
@@ -0,0 +1,22 @@
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import { u as d, N as r, O as p } from "../../chunk-IR6S3I6Y-Dvzk3EbC.js";
3
+ import { useAuthId as f } from "../../auth/hooks/AuthHook.js";
4
+ import { j as h } from "../../index-CuHybtft.js";
5
+ const T = () => {
6
+ const { authToken: c, userToken: n } = f(), i = d(), a = n || localStorage.getItem("user_token");
7
+ if (!(c || localStorage.getItem("access_token")) || !a)
8
+ return /* @__PURE__ */ e(r, { to: "/", replace: !0 });
9
+ let s;
10
+ try {
11
+ s = h(a);
12
+ } catch (t) {
13
+ return console.error("Error decoding token:", t), /* @__PURE__ */ e(r, { to: "/", replace: !0 });
14
+ }
15
+ const u = s.access_url, o = i.pathname, l = u.map(
16
+ (t) => t.startsWith("/") ? t : `/${t}`
17
+ ), m = o.startsWith("/") ? o : `/${o}`;
18
+ return l.includes(m) ? /* @__PURE__ */ e(p, {}) : /* @__PURE__ */ e(r, { to: "/sistema/pagina-no-permitida", replace: !0 });
19
+ };
20
+ export {
21
+ T as ProtectedRoute
22
+ };
@@ -0,0 +1,10 @@
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import { N as a, O as s } from "../../chunk-IR6S3I6Y-Dvzk3EbC.js";
3
+ import { useAuthId as n } from "../../auth/hooks/AuthHook.js";
4
+ const p = () => {
5
+ const { authToken: e, userToken: o } = n(), r = o || localStorage.getItem("user_token");
6
+ return !(e || localStorage.getItem("access_token")) || !r ? /* @__PURE__ */ t(a, { to: "/sistema/pagina-no-permitida", replace: !0 }) : /* @__PURE__ */ t(s, {});
7
+ };
8
+ export {
9
+ p as UserRoute
10
+ };
package/dist/utils.js CHANGED
@@ -1,4 +1,8 @@
1
1
  import { AuthProvider as e } from "./auth/contexts/AuthContex.js";
2
+ import { ProtectedRoute as f } from "./utils/components/ProtectedRoute.js";
3
+ import { UserRoute as p } from "./utils/components/UserRoute.js";
2
4
  export {
3
- e as AuthProvider
5
+ e as AuthProvider,
6
+ f as ProtectedRoute,
7
+ p as UserRoute
4
8
  };
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "react-ecosistema-unp",
3
3
  "author": "Ecosistema de Información - Unidad Nacional de Protección",
4
4
  "private": false,
5
- "version": "0.6.4",
5
+ "version": "0.7.0",
6
6
  "type": "module",
7
7
  "exports": {
8
8
  ".": {