react-ecosistema-unp 1.8.0-pre.9 → 1.9.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.
@@ -1,7 +1,35 @@
1
- import "../services/FinSesionService.js";
2
- import "../../index-BUe3EJDH.js";
3
- import "react";
4
- import { u as t } from "../../useFinalizarSesion-DXrrb8G5.js";
1
+ import { FinSesionService as i } from "../services/FinSesionService.js";
2
+ import { y as a } from "../../index-BUe3EJDH.js";
3
+ import { useState as c, useEffect as l } from "react";
4
+ const p = () => {
5
+ const [o, r] = c(null), n = `${window.location.protocol}//${window.location.host}/`;
6
+ return l(() => {
7
+ const e = localStorage.getItem("auth_state");
8
+ if (e) {
9
+ const t = JSON.parse(e);
10
+ r(t);
11
+ }
12
+ }, []), { FinSesion: () => {
13
+ a.promise(
14
+ new Promise(async (e, t) => {
15
+ try {
16
+ await i((o == null ? void 0 : o.user.username) || "", n), e(!0);
17
+ } catch (s) {
18
+ t(s);
19
+ } finally {
20
+ sessionStorage.removeItem("user_token"), localStorage.removeItem("auth_state"), localStorage.removeItem("access_token"), setTimeout(() => {
21
+ window.location.href = n;
22
+ }, 1e3);
23
+ }
24
+ }),
25
+ {
26
+ pending: "Finalizando sesión...",
27
+ success: "Sesión finalizada con éxito",
28
+ error: "Error al finalizar la sesión"
29
+ }
30
+ );
31
+ } };
32
+ };
5
33
  export {
6
- t as useFinalizarSesion
34
+ p as useFinalizarSesion
7
35
  };
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Servicio para gestionar la generación del fingerprint del navegador.
3
+ * El fingerprint se usa para vincular tokens a dispositivos específicos.
4
+ */
5
+ declare class FingerprintService {
6
+ private fpPromise;
7
+ private fingerprint;
8
+ /**
9
+ * Inicializa el agente de FingerprintJS y genera el fingerprint.
10
+ * @returns El identificador único del dispositivo (visitorId)
11
+ */
12
+ initialize(): Promise<string>;
13
+ /**
14
+ * Obtiene el fingerprint previamente generado.
15
+ * Si no existe, lo genera automáticamente.
16
+ * @returns El fingerprint del dispositivo
17
+ */
18
+ getFingerprint(): Promise<string>;
19
+ /**
20
+ * Obtiene el fingerprint de forma síncrona si ya fue generado.
21
+ * Útil cuando ya se ha llamado a initialize() previamente.
22
+ * @returns El fingerprint o null si no ha sido generado
23
+ */
24
+ getFingerprintSync(): string | null;
25
+ }
26
+ declare const _default: FingerprintService;
27
+ export default _default;
@@ -1,10 +1,10 @@
1
1
  import { jsx as r } from "react/jsx-runtime";
2
- import { u as t } from "../../../useFinalizarSesion-DXrrb8G5.js";
2
+ import { useFinalizarSesion as t } from "../../../auth/hooks/useFinalizarSesion.js";
3
3
  import { y as i } from "../../../index-DDjnZyBf.js";
4
- import '../../../assets/LogoutButton.css';const m = () => {
4
+ import '../../../assets/LogoutButton.css';const a = () => {
5
5
  const { FinSesion: o } = t();
6
6
  return /* @__PURE__ */ r(i, { className: "icono-logout", onClick: o });
7
7
  };
8
8
  export {
9
- m as LogoutButton
9
+ a as LogoutButton
10
10
  };
@@ -1,8 +1,8 @@
1
1
  import { jsx as a, Fragment as g, jsxs as e } from "react/jsx-runtime";
2
2
  import { useState as o, useEffect as d } from "react";
3
- import { useNavigate as H } from "react-router-dom";
4
- import { u as C, j as u } from "../../useFinalizarSesion-DXrrb8G5.js";
5
- import { urlBase as L, urlCertificadoLaboral as S } from "../../utils/Url.js";
3
+ import { useNavigate as _ } from "react-router-dom";
4
+ import { useFinalizarSesion as H } from "../../auth/hooks/useFinalizarSesion.js";
5
+ import { urlBase as C, urlCertificadoLaboral as L } from "../../utils/Url.js";
6
6
  import "../../auth/contexts/AuthContex.js";
7
7
  import '../../assets/EcoModalStyles.css';import '../../assets/Modal.css';import '../../assets/ContenedorVentana.css';import '../../assets/IconoTooltip.css';import '../../assets/ItemsModal.css';import '../../assets/Paginador.css';import '../../assets/ContenidoModal.css';import '../../assets/Encabezado.css';import '../../assets/SeccionTarjetaLectura.css';import '../../assets/Logo.css';import '../../assets/TarjetaLectura.css';import '../../assets/ContenedorTarjeta.css';import '../../assets/Bootstrap.css';import '../../assets/Tarjeta.css';import '../../assets/UnpHistorico.css';import '../../assets/MenuLateral.css';/* empty css */
8
8
  /* empty css */
@@ -10,7 +10,7 @@ import '../../assets/EcoModalStyles.css';import '../../assets/Modal.css';import
10
10
  import "../../cards/tarjeta/seccion-tarjeta/SeccionTarjeta.js";
11
11
  /* empty css */
12
12
  /* empty css */
13
- import { l as V } from "../../logo_escudo_blanco-DaOI8SGq.js";
13
+ import { l as S } from "../../logo_escudo_blanco-DaOI8SGq.js";
14
14
  /* empty css */
15
15
  /* empty css */
16
16
  /* empty css */
@@ -26,91 +26,91 @@ import "../../index-BrykDZgK.js";
26
26
  /* empty css */
27
27
  import "../../Animacion-ThNL9iiY.js";
28
28
  import "../../index-BUe3EJDH.js";
29
- import { useWebSocketConnection as A } from "../../utils/websocket-manager/WebSocketContext.js";
29
+ import { useWebSocketConnection as V } from "../../utils/websocket-manager/WebSocketContext.js";
30
30
  import { G as i } from "../../iconBase-LROS5hdG.js";
31
- function y(t) {
31
+ function A(t) {
32
32
  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: [] }] })(t);
33
33
  }
34
- function E(t) {
34
+ function y(t) {
35
35
  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: [] }] })(t);
36
36
  }
37
- function T(t) {
37
+ function E(t) {
38
38
  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: [] }] })(t);
39
39
  }
40
- function I(t) {
40
+ function T(t) {
41
41
  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: [] }] })(t);
42
42
  }
43
- function j(t) {
43
+ function I(t) {
44
44
  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: [] }] })(t);
45
45
  }
46
46
  function P(t) {
47
47
  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: [] }] })(t);
48
48
  }
49
- function U(t) {
49
+ function j(t) {
50
50
  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: [] }] })(t);
51
51
  }
52
- function F(t) {
52
+ function U(t) {
53
53
  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: [] }] })(t);
54
54
  }
55
- function R(t) {
55
+ function F(t) {
56
56
  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: [] }] })(t);
57
57
  }
58
- function $(t) {
58
+ function R(t) {
59
59
  return i({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M4 6h16v2H4zm4 5h12v2H8zm5 5h7v2h-7z" }, child: [] }] })(t);
60
60
  }
61
- function D(t) {
61
+ function $(t) {
62
62
  return i({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M4 6h16v2H4zm0 5h16v2H4zm0 5h16v2H4z" }, child: [] }] })(t);
63
63
  }
64
- function G(t) {
64
+ function D(t) {
65
65
  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: [] }] })(t);
66
66
  }
67
- function W(t) {
67
+ function G(t) {
68
68
  return i({ tag: "svg", attr: { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { d: "M17.8 19.2 16 11l3.5-3.5C21 6 21.5 4 21 3c-1-.5-3 0-4.5 1.5L13 8 4.8 6.2c-.5-.1-.9.1-1.1.5l-.3.5c-.2.5-.1 1 .3 1.3L9 12l-2 3H4l-1 1 3 2 2 3 1-1v-3l3-2 3.5 5.3c.3.4.8.5 1.3.3l.5-.2c.4-.3.6-.7.5-1.2z" }, child: [] }] })(t);
69
69
  }
70
- const b1 = ({ onToggle: t, isOpen: l, showConnectionStatus: x }) => {
71
- const [N, f] = o(!0), [m, p] = o(null), k = l ? "sidebar-bar-panel open" : "sidebar-bar-panel", w = H(), { FinSesion: b } = C(), { connectionStatus: v } = A(), [z, c] = o(!1), [M, n] = o(""), h = `${window.location.host}`;
70
+ const b1 = ({ onToggle: t, isOpen: l, showConnectionStatus: u }) => {
71
+ const [x, N] = o(!0), [m, p] = o(null), f = l ? "sidebar-bar-panel open" : "sidebar-bar-panel", k = _(), { FinSesion: b } = H(), { connectionStatus: v } = V(), [w, c] = o(!1), [z, n] = o(""), h = `${window.location.host}`;
72
72
  if (d(() => {
73
- const r = localStorage.getItem("access_token");
73
+ const r = localStorage.getItem("auth_state");
74
74
  if (r) {
75
- const s = u(r);
75
+ const s = JSON.parse(r);
76
76
  p(s);
77
77
  }
78
- f(!1);
78
+ N(!1);
79
79
  }, []), d(() => {
80
80
  const r = setTimeout(() => {
81
81
  const s = localStorage.getItem("auth_state");
82
82
  if (s) {
83
- const _ = u(s);
84
- p(_);
83
+ const B = JSON.parse(s);
84
+ p(B);
85
85
  }
86
86
  }, 2e3);
87
87
  return () => clearTimeout(r);
88
88
  }, []), d(() => {
89
89
  h.includes("localhost") ? (c(!0), n("Entorno local")) : h.includes("ecosistemadesarrollo") ? (c(!0), n("Entorno de desarrollo")) : h.includes("ecosistemapruebas") ? (c(!0), n("Entorno de pruebas")) : (c(!1), n(""));
90
- }, []), N)
90
+ }, []), x)
91
91
  return /* @__PURE__ */ a(g, {});
92
- const B = () => {
93
- w("/unp/ecosistema/usuario");
92
+ const M = () => {
93
+ k("/unp/ecosistema/usuario");
94
94
  };
95
- return /* @__PURE__ */ a("div", { className: `container-fluid ${l ? "menu-open" : ""}`, children: /* @__PURE__ */ e("div", { className: k, children: [
95
+ return /* @__PURE__ */ a("div", { className: `container-fluid ${l ? "menu-open" : ""}`, children: /* @__PURE__ */ e("div", { className: f, children: [
96
96
  /* @__PURE__ */ e("div", { className: "logo_details", children: [
97
97
  /* @__PURE__ */ a(
98
98
  "img",
99
99
  {
100
- src: V,
100
+ src: S,
101
101
  alt: "Logo",
102
102
  className: "icon logo-image"
103
103
  }
104
104
  ),
105
105
  /* @__PURE__ */ a("div", { className: "logo-name", children: "EI - UNP" }),
106
106
  l ? /* @__PURE__ */ a(
107
- $,
107
+ R,
108
108
  {
109
109
  className: "bx bx-menu i",
110
110
  id: "btn",
111
111
  onClick: t
112
112
  }
113
- ) : /* @__PURE__ */ a(D, { className: "bx bx-menu i", id: "btn", onClick: t })
113
+ ) : /* @__PURE__ */ a($, { className: "bx bx-menu i", id: "btn", onClick: t })
114
114
  ] }),
115
115
  /* @__PURE__ */ e("ul", { className: "nav-list-panel", children: [
116
116
  /* @__PURE__ */ e("li", { children: [
@@ -122,14 +122,14 @@ const b1 = ({ onToggle: t, isOpen: l, showConnectionStatus: x }) => {
122
122
  ] }),
123
123
  /* @__PURE__ */ e("li", { children: [
124
124
  /* @__PURE__ */ e("a", { href: "", children: [
125
- /* @__PURE__ */ a(R, { className: "bx bx-map-pin i2" }),
125
+ /* @__PURE__ */ a(F, { className: "bx bx-map-pin i2" }),
126
126
  /* @__PURE__ */ a("span", { className: "link_name", children: "Mapa del proceso" })
127
127
  ] }),
128
128
  /* @__PURE__ */ a("span", { className: "tooltip", children: "Mapa del proceso" })
129
129
  ] }),
130
130
  /* @__PURE__ */ e("li", { children: [
131
131
  /* @__PURE__ */ e("a", { href: "", children: [
132
- /* @__PURE__ */ a(E, { className: "bx bx-book-alt i2" }),
132
+ /* @__PURE__ */ a(y, { className: "bx bx-book-alt i2" }),
133
133
  /* @__PURE__ */ a("span", { className: "link_name", children: "Manuales de usuario" })
134
134
  ] }),
135
135
  /* @__PURE__ */ a("span", { className: "tooltip", children: "Manual de usuario" })
@@ -137,7 +137,7 @@ const b1 = ({ onToggle: t, isOpen: l, showConnectionStatus: x }) => {
137
137
  /* @__PURE__ */ a("div", { style: { paddingLeft: "15px", paddingRight: "15px" }, children: /* @__PURE__ */ a("hr", { style: { borderTop: "1px solid white" } }) }),
138
138
  /* @__PURE__ */ e("li", { children: [
139
139
  /* @__PURE__ */ e("a", { href: "https://www.unp.gov.co/", target: "_blank", children: [
140
- /* @__PURE__ */ a(U, { className: "bx bx-link-alt i2" }),
140
+ /* @__PURE__ */ a(j, { className: "bx bx-link-alt i2" }),
141
141
  /* @__PURE__ */ a("span", { className: "link_name", children: "Portal UNP" })
142
142
  ] }),
143
143
  /* @__PURE__ */ a("span", { className: "tooltip", children: "Portal UNP" })
@@ -149,7 +149,7 @@ const b1 = ({ onToggle: t, isOpen: l, showConnectionStatus: x }) => {
149
149
  href: "https://login.microsoftonline.com/common/oauth2/authorize?client_id=00000002-0000-0ff1-ce00-000000000000",
150
150
  target: "_blank",
151
151
  children: [
152
- /* @__PURE__ */ a(T, { className: "bx bx-envelope i2" }),
152
+ /* @__PURE__ */ a(E, { className: "bx bx-envelope i2" }),
153
153
  /* @__PURE__ */ a("span", { className: "link_name", children: "Correo institucional" })
154
154
  ]
155
155
  }
@@ -158,14 +158,14 @@ const b1 = ({ onToggle: t, isOpen: l, showConnectionStatus: x }) => {
158
158
  ] }),
159
159
  /* @__PURE__ */ e("li", { children: [
160
160
  /* @__PURE__ */ e("a", { href: "http://intranet.unp.gov.co/", target: "_blank", children: [
161
- /* @__PURE__ */ a(G, { className: "bx bxl-redux i2" }),
161
+ /* @__PURE__ */ a(D, { className: "bx bxl-redux i2" }),
162
162
  /* @__PURE__ */ a("span", { className: "link_name", children: "Acceso directo a Intranet" })
163
163
  ] }),
164
164
  /* @__PURE__ */ a("span", { className: "tooltip", children: "Acceso directo a Intranet" })
165
165
  ] }),
166
166
  /* @__PURE__ */ e("li", { children: [
167
167
  /* @__PURE__ */ e("a", { href: "https://mesadeservicios.unp.gov.co/HEAT/", target: "_blank", children: [
168
- /* @__PURE__ */ a(I, { className: "bx bx-error-circle i2" }),
168
+ /* @__PURE__ */ a(T, { className: "bx bx-error-circle i2" }),
169
169
  /* @__PURE__ */ a("span", { className: "link_name", children: "Mesa de servicios" })
170
170
  ] }),
171
171
  /* @__PURE__ */ a("span", { className: "tooltip", children: "Mesa de servicios" })
@@ -173,28 +173,28 @@ const b1 = ({ onToggle: t, isOpen: l, showConnectionStatus: x }) => {
173
173
  /* @__PURE__ */ a("div", { style: { paddingLeft: "15px", paddingRight: "15px" }, children: /* @__PURE__ */ a("hr", { style: { borderTop: "1px solid white" } }) }),
174
174
  /* @__PURE__ */ e("li", { children: [
175
175
  /* @__PURE__ */ e("a", { href: "", children: [
176
- /* @__PURE__ */ a(y, { className: "bx i2" }),
176
+ /* @__PURE__ */ a(A, { className: "bx i2" }),
177
177
  /* @__PURE__ */ a("span", { className: "link_name", children: "Acta de reunión" })
178
178
  ] }),
179
179
  /* @__PURE__ */ a("span", { className: "tooltip", children: "Acta de reunión" })
180
180
  ] }),
181
181
  /* @__PURE__ */ e("li", { children: [
182
182
  /* @__PURE__ */ e("a", { href: "", children: [
183
- /* @__PURE__ */ a(W, { className: "bx i2" }),
183
+ /* @__PURE__ */ a(G, { className: "bx i2" }),
184
184
  /* @__PURE__ */ a("span", { className: "link_name", children: "Solicitud de viáticos" })
185
185
  ] }),
186
186
  /* @__PURE__ */ a("span", { className: "tooltip", children: "Solicitud de viáticos" })
187
187
  ] }),
188
188
  /* @__PURE__ */ e("li", { children: [
189
- /* @__PURE__ */ e("a", { href: `${L}${S}`, target: "_blank", children: [
190
- /* @__PURE__ */ a(j, { className: "bx i2" }),
189
+ /* @__PURE__ */ e("a", { href: `${C}${L}`, target: "_blank", children: [
190
+ /* @__PURE__ */ a(I, { className: "bx i2" }),
191
191
  /* @__PURE__ */ a("span", { className: "link_name", children: "Certificados contratistas" })
192
192
  ] }),
193
193
  /* @__PURE__ */ a("span", { className: "tooltip", children: "Certificados contratistas" })
194
194
  ] })
195
195
  ] }),
196
196
  /* @__PURE__ */ e("div", { className: "profile-content", children: [
197
- !l && x && /* @__PURE__ */ a(g, { children: v === "connected" ? /* @__PURE__ */ e("div", { className: "gear-tooltip-container", children: [
197
+ !l && u && /* @__PURE__ */ a(g, { children: v === "connected" ? /* @__PURE__ */ e("div", { className: "gear-tooltip-container", children: [
198
198
  /* @__PURE__ */ e(
199
199
  "svg",
200
200
  {
@@ -256,7 +256,7 @@ const b1 = ({ onToggle: t, isOpen: l, showConnectionStatus: x }) => {
256
256
  ]
257
257
  }
258
258
  ) }),
259
- !l && z && /* @__PURE__ */ e("div", { className: "gear-tooltip-container", children: [
259
+ !l && w && /* @__PURE__ */ e("div", { className: "gear-tooltip-container", children: [
260
260
  /* @__PURE__ */ a(
261
261
  "svg",
262
262
  {
@@ -283,14 +283,14 @@ const b1 = ({ onToggle: t, isOpen: l, showConnectionStatus: x }) => {
283
283
  )
284
284
  }
285
285
  ),
286
- /* @__PURE__ */ a("span", { className: "gear-tooltip-text", children: M })
286
+ /* @__PURE__ */ a("span", { className: "gear-tooltip-text", children: z })
287
287
  ] }),
288
288
  /* @__PURE__ */ e("div", { className: "profile", children: [
289
289
  /* @__PURE__ */ a(
290
290
  "div",
291
291
  {
292
292
  className: "profile-detail",
293
- onClick: B,
293
+ onClick: M,
294
294
  style: { cursor: "pointer" },
295
295
  children: m && /* @__PURE__ */ e("div", { className: "name-job", style: { marginTop: "3px" }, children: [
296
296
  /* @__PURE__ */ a("div", { className: "name text-truncate", style: { width: "200px" }, children: m.user.nombres }),
@@ -298,7 +298,7 @@ const b1 = ({ onToggle: t, isOpen: l, showConnectionStatus: x }) => {
298
298
  ] })
299
299
  }
300
300
  ),
301
- /* @__PURE__ */ a(F, { className: "icon", onClick: b })
301
+ /* @__PURE__ */ a(U, { className: "icon", onClick: b })
302
302
  ] })
303
303
  ] })
304
304
  ] }) });
@@ -1,61 +1,66 @@
1
- import { jsx as g } from "react/jsx-runtime";
2
- import { useState as S, useEffect as v } from "react";
3
- import { useLocation as p, Outlet as I } from "react-router-dom";
4
- const T = () => {
5
- const [k, o] = S(!1), h = p(), s = `${window.location.protocol}//${window.location.host}/`, c = `${window.location.host}`, w = async () => {
6
- const l = await fetch(`${s}api-auth/auth/refresh_token/`, {
1
+ import { jsx as w } from "react/jsx-runtime";
2
+ import { useState as S, useEffect as p } from "react";
3
+ import { useLocation as _, Outlet as v } from "react-router-dom";
4
+ import I from "../fingerprint/fingerprintService.js";
5
+ const E = () => {
6
+ const [k, o] = S(!1), d = _(), a = `${window.location.protocol}//${window.location.host}/`, l = `${window.location.host}`, g = async () => {
7
+ const m = await I.getFingerprint(), h = localStorage.getItem("refresh_token"), s = await fetch(`${a}api-auth/auth/refresh_token/`, {
7
8
  method: "POST",
8
9
  headers: {
9
10
  "Content-Type": "application/json",
10
- Authorization: `Bearer ${localStorage.getItem("access_token")}`
11
+ Authorization: `Bearer ${localStorage.getItem("access_token")}`,
12
+ "X-Fingerprint": m
11
13
  },
12
- credentials: "include"
14
+ credentials: "include",
15
+ body: JSON.stringify({
16
+ refresh: h
17
+ })
13
18
  });
14
- if (l.ok) {
15
- const r = (await l.json()).token;
16
- return localStorage.setItem("access_token", r), !0;
19
+ if (s.ok) {
20
+ const n = await s.json(), i = n.access_token, r = n.refresh_token;
21
+ return localStorage.setItem("access_token", i), localStorage.setItem("refresh_token", r), !0;
17
22
  } else
18
23
  throw new Error("Error al refrescar token de Microsoft");
19
24
  };
20
- return v(() => {
21
- const l = async () => {
25
+ return p(() => {
26
+ const m = async () => {
22
27
  try {
23
28
  if (localStorage.getItem("access_token")) {
24
- const r = localStorage.getItem("auth_state");
25
- if (r) {
26
- const f = JSON.parse(r).user.servicios.map((e) => e.url).filter((e) => !!e), a = h.pathname, n = f.map(
29
+ const s = localStorage.getItem("auth_state");
30
+ if (s) {
31
+ const i = JSON.parse(s).user.servicios.map((e) => e.url).filter((e) => !!e), r = d.pathname, c = i.map(
27
32
  (e) => e.startsWith("/") ? e : `/${e}`
28
- ), m = a.startsWith("/") ? a : `/${a}`;
29
- n.some(
30
- (e) => m.startsWith(e)
31
- ) ? o(!0) : (console.warn("No hay match con los roles del usuario"), o(!1), sessionStorage.removeItem("user_token"), localStorage.removeItem("auth_state"), localStorage.removeItem("access_token"), window.location.href = s);
33
+ ), f = r.startsWith("/") ? r : `/${r}`;
34
+ c.some(
35
+ (e) => f.startsWith(e)
36
+ ) ? o(!0) : (console.warn("No hay match con los roles del usuario"), o(!1), sessionStorage.removeItem("user_token"), localStorage.removeItem("auth_state"), localStorage.removeItem("access_token"), window.location.href = a);
32
37
  } else
33
- o(!1), sessionStorage.removeItem("user_token"), localStorage.removeItem("auth_state"), localStorage.removeItem("access_token"), window.location.href = s;
38
+ o(!1), sessionStorage.removeItem("user_token"), localStorage.removeItem("auth_state"), localStorage.removeItem("access_token"), window.location.href = a;
34
39
  } else
35
40
  throw new Error("Token inválido");
36
41
  } catch {
37
42
  try {
38
- if (await w()) {
39
- const i = localStorage.getItem("auth_state");
40
- if (i) {
41
- const a = JSON.parse(i).user.servicios.map((t) => t.url).filter((t) => !!t), n = h.pathname, m = a.map(
43
+ if (await g()) {
44
+ const n = localStorage.getItem("auth_state");
45
+ if (n) {
46
+ const r = JSON.parse(n).user.servicios.map((t) => t.url).filter((t) => !!t), c = d.pathname, f = r.map(
42
47
  (t) => t.startsWith("/") ? t : `/${t}`
43
- ), u = n.startsWith("/") ? n : `/${n}`;
44
- m.some(
48
+ ), u = c.startsWith("/") ? c : `/${c}`;
49
+ f.some(
45
50
  (t) => u.startsWith(t)
46
- ) ? o(!0) : (o(!1), sessionStorage.removeItem("user_token"), localStorage.removeItem("auth_state"), localStorage.removeItem("access_token"), window.location.href = s);
51
+ ) ? o(!0) : (o(!1), sessionStorage.removeItem("user_token"), localStorage.removeItem("auth_state"), localStorage.removeItem("access_token"), window.location.href = a);
47
52
  } else
48
- o(!1), sessionStorage.removeItem("user_token"), localStorage.removeItem("auth_state"), localStorage.removeItem("access_token"), window.location.href = s;
53
+ o(!1), sessionStorage.removeItem("user_token"), localStorage.removeItem("auth_state"), localStorage.removeItem("access_token"), window.location.href = a;
49
54
  } else
50
55
  throw new Error("No se pudo refrescar el token.");
51
56
  } catch {
52
- sessionStorage.removeItem("user_token"), localStorage.removeItem("auth_state"), localStorage.removeItem("access_token"), window.location.href = s, o(!1);
57
+ sessionStorage.removeItem("user_token"), localStorage.removeItem("auth_state"), localStorage.removeItem("access_token"), window.location.href = a, o(!1);
53
58
  }
54
59
  }
55
60
  };
56
- c.includes("ecosistemadesarrollo") || c.includes("ecosistemapruebas") || c.includes("ecosistemaprov") || c.includes("ecosistema") ? l() : (console.warn("ProtectedRoute is disabled in the local development environment."), o(!0));
57
- }, []), k ? /* @__PURE__ */ g(I, {}) : null;
61
+ l.includes("ecosistemadesarrollo") || l.includes("ecosistemapruebas") || l.includes("ecosistemaprov") || l.includes("ecosistema") ? m() : (console.warn("ProtectedRoute is disabled in the local development environment."), o(!0));
62
+ }, []), k ? /* @__PURE__ */ w(v, {}) : null;
58
63
  };
59
64
  export {
60
- T as ProtectedRoute
65
+ E as ProtectedRoute
61
66
  };
@@ -1,35 +1,37 @@
1
- import { jsx as c } from "react/jsx-runtime";
2
- import { useState as d, useEffect as h } from "react";
3
- import { useNavigate as u, Outlet as m } from "react-router-dom";
4
- const k = () => {
5
- const [a, e] = d(!1), s = u(), t = `${window.location.protocol}//${window.location.host}/`, o = `${window.location.host}`;
6
- if (o.includes("localhost"))
1
+ import { jsx as m } from "react/jsx-runtime";
2
+ import { useState as d, useEffect as u } from "react";
3
+ import { useNavigate as w, Outlet as k } from "react-router-dom";
4
+ import p from "../fingerprint/fingerprintService.js";
5
+ const I = () => {
6
+ const [c, e] = d(!1), i = w(), t = `${window.location.protocol}//${window.location.host}/`, a = `${window.location.host}`;
7
+ if (a.includes("localhost"))
7
8
  return console.warn("ProtectedRoute is disabled in the local development environment."), null;
8
- const n = async () => {
9
- if ((await fetch(`${t}api-auth/auth/refresh_token/`, {
9
+ const l = async () => {
10
+ const r = await p.getFingerprint(), n = localStorage.getItem("refresh_token"), o = await fetch(`${t}api-auth/auth/refresh_token/`, {
10
11
  method: "POST",
11
12
  headers: {
12
- "Content-Type": "application/json"
13
+ "Content-Type": "application/json",
14
+ "X-Fingerprint": r
13
15
  },
14
- credentials: "include"
15
- })).ok)
16
- return !0;
17
- throw new Error("Error al refrescar token de Microsoft");
16
+ credentials: "include",
17
+ body: JSON.stringify({
18
+ refresh: n
19
+ })
20
+ });
21
+ if (o.ok) {
22
+ const s = await o.json(), f = s.access_token, h = s.refresh_token;
23
+ return localStorage.setItem("access_token", f), localStorage.setItem("refresh_token", h), !0;
24
+ } else
25
+ throw new Error("Error al refrescar token de Microsoft");
18
26
  };
19
- return h(() => {
27
+ return u(() => {
20
28
  const r = async () => {
21
29
  try {
22
- if ((await fetch(`${t}api-auth/auth/validate_jwt/`, {
23
- method: "POST",
24
- headers: {
25
- "Content-Type": "application/json"
26
- },
27
- credentials: "include"
28
- })).ok)
30
+ if (localStorage.getItem("access_token"))
29
31
  e(!0);
30
32
  else
31
33
  try {
32
- if (await n())
34
+ if (await l())
33
35
  (await fetch(
34
36
  `${t}api-auth/auth/validate_jwt/`,
35
37
  {
@@ -49,9 +51,9 @@ const k = () => {
49
51
  sessionStorage.removeItem("user_token"), localStorage.removeItem("auth_state"), localStorage.removeItem("access_token"), window.location.href = t, e(!1);
50
52
  }
51
53
  };
52
- o.includes("localhost") ? (console.warn("ProtectedRoute is disabled in the local development environment."), e(!0)) : r();
53
- }, [s]), a ? /* @__PURE__ */ c(m, {}) : null;
54
+ a.includes("localhost") ? (console.warn("ProtectedRoute is disabled in the local development environment."), e(!0)) : r();
55
+ }, [i]), c ? /* @__PURE__ */ m(k, {}) : null;
54
56
  };
55
57
  export {
56
- k as UserRoute
58
+ I as UserRoute
57
59
  };