react-ecosistema-unp 1.5.1 → 1.5.2-pre.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,135 +1,25 @@
1
- import { useAuthId as O } from "./AuthHook.js";
2
- import { FinSesionService as C } from "../services/FinSesionService.js";
3
- import { isValidElement as S, useState as E, useEffect as L } from "react";
4
- import { j as U } from "../../index-CuHybtft.js";
5
- function D(t) {
6
- if (typeof document > "u") return;
7
- let o = document.head || document.getElementsByTagName("head")[0], a = document.createElement("style");
8
- a.type = "text/css", o.firstChild ? o.insertBefore(a, o.firstChild) : o.appendChild(a), a.styleSheet ? a.styleSheet.cssText = t : a.appendChild(document.createTextNode(t));
9
- }
10
- D(`:root{--toastify-color-light: #fff;--toastify-color-dark: #121212;--toastify-color-info: #3498db;--toastify-color-success: #07bc0c;--toastify-color-warning: #f1c40f;--toastify-color-error: hsl(6, 78%, 57%);--toastify-color-transparent: rgba(255, 255, 255, .7);--toastify-icon-color-info: var(--toastify-color-info);--toastify-icon-color-success: var(--toastify-color-success);--toastify-icon-color-warning: var(--toastify-color-warning);--toastify-icon-color-error: var(--toastify-color-error);--toastify-container-width: fit-content;--toastify-toast-width: 320px;--toastify-toast-offset: 16px;--toastify-toast-top: max(var(--toastify-toast-offset), env(safe-area-inset-top));--toastify-toast-right: max(var(--toastify-toast-offset), env(safe-area-inset-right));--toastify-toast-left: max(var(--toastify-toast-offset), env(safe-area-inset-left));--toastify-toast-bottom: max(var(--toastify-toast-offset), env(safe-area-inset-bottom));--toastify-toast-background: #fff;--toastify-toast-padding: 14px;--toastify-toast-min-height: 64px;--toastify-toast-max-height: 800px;--toastify-toast-bd-radius: 6px;--toastify-toast-shadow: 0px 4px 12px rgba(0, 0, 0, .1);--toastify-font-family: sans-serif;--toastify-z-index: 9999;--toastify-text-color-light: #757575;--toastify-text-color-dark: #fff;--toastify-text-color-info: #fff;--toastify-text-color-success: #fff;--toastify-text-color-warning: #fff;--toastify-text-color-error: #fff;--toastify-spinner-color: #616161;--toastify-spinner-color-empty-area: #e0e0e0;--toastify-color-progress-light: linear-gradient(to right, #4cd964, #5ac8fa, #007aff, #34aadc, #5856d6, #ff2d55);--toastify-color-progress-dark: #bb86fc;--toastify-color-progress-info: var(--toastify-color-info);--toastify-color-progress-success: var(--toastify-color-success);--toastify-color-progress-warning: var(--toastify-color-warning);--toastify-color-progress-error: var(--toastify-color-error);--toastify-color-progress-bgo: .2}.Toastify__toast-container{z-index:var(--toastify-z-index);-webkit-transform:translate3d(0,0,var(--toastify-z-index));position:fixed;width:var(--toastify-container-width);box-sizing:border-box;color:#fff;display:flex;flex-direction:column}.Toastify__toast-container--top-left{top:var(--toastify-toast-top);left:var(--toastify-toast-left)}.Toastify__toast-container--top-center{top:var(--toastify-toast-top);left:50%;transform:translate(-50%);align-items:center}.Toastify__toast-container--top-right{top:var(--toastify-toast-top);right:var(--toastify-toast-right);align-items:end}.Toastify__toast-container--bottom-left{bottom:var(--toastify-toast-bottom);left:var(--toastify-toast-left)}.Toastify__toast-container--bottom-center{bottom:var(--toastify-toast-bottom);left:50%;transform:translate(-50%);align-items:center}.Toastify__toast-container--bottom-right{bottom:var(--toastify-toast-bottom);right:var(--toastify-toast-right);align-items:end}.Toastify__toast{--y: 0;position:relative;touch-action:none;width:var(--toastify-toast-width);min-height:var(--toastify-toast-min-height);box-sizing:border-box;margin-bottom:1rem;padding:var(--toastify-toast-padding);border-radius:var(--toastify-toast-bd-radius);box-shadow:var(--toastify-toast-shadow);max-height:var(--toastify-toast-max-height);font-family:var(--toastify-font-family);z-index:0;display:flex;flex:1 auto;align-items:center;word-break:break-word}@media only screen and (max-width: 480px){.Toastify__toast-container{width:100vw;left:env(safe-area-inset-left);margin:0}.Toastify__toast-container--top-left,.Toastify__toast-container--top-center,.Toastify__toast-container--top-right{top:env(safe-area-inset-top);transform:translate(0)}.Toastify__toast-container--bottom-left,.Toastify__toast-container--bottom-center,.Toastify__toast-container--bottom-right{bottom:env(safe-area-inset-bottom);transform:translate(0)}.Toastify__toast-container--rtl{right:env(safe-area-inset-right);left:initial}.Toastify__toast{--toastify-toast-width: 100%;margin-bottom:0;border-radius:0}}.Toastify__toast-container[data-stacked=true]{width:var(--toastify-toast-width)}.Toastify__toast--stacked{position:absolute;width:100%;transform:translate3d(0,var(--y),0) scale(var(--s));transition:transform .3s}.Toastify__toast--stacked[data-collapsed] .Toastify__toast-body,.Toastify__toast--stacked[data-collapsed] .Toastify__close-button{transition:opacity .1s}.Toastify__toast--stacked[data-collapsed=false]{overflow:visible}.Toastify__toast--stacked[data-collapsed=true]:not(:last-child)>*{opacity:0}.Toastify__toast--stacked:after{content:"";position:absolute;left:0;right:0;height:calc(var(--g) * 1px);bottom:100%}.Toastify__toast--stacked[data-pos=top]{top:0}.Toastify__toast--stacked[data-pos=bot]{bottom:0}.Toastify__toast--stacked[data-pos=bot].Toastify__toast--stacked:before{transform-origin:top}.Toastify__toast--stacked[data-pos=top].Toastify__toast--stacked:before{transform-origin:bottom}.Toastify__toast--stacked:before{content:"";position:absolute;left:0;right:0;bottom:0;height:100%;transform:scaleY(3);z-index:-1}.Toastify__toast--rtl{direction:rtl}.Toastify__toast--close-on-click{cursor:pointer}.Toastify__toast-icon{margin-inline-end:10px;width:22px;flex-shrink:0;display:flex}.Toastify--animate{animation-fill-mode:both;animation-duration:.5s}.Toastify--animate-icon{animation-fill-mode:both;animation-duration:.3s}.Toastify__toast-theme--dark{background:var(--toastify-color-dark);color:var(--toastify-text-color-dark)}.Toastify__toast-theme--light,.Toastify__toast-theme--colored.Toastify__toast--default{background:var(--toastify-color-light);color:var(--toastify-text-color-light)}.Toastify__toast-theme--colored.Toastify__toast--info{color:var(--toastify-text-color-info);background:var(--toastify-color-info)}.Toastify__toast-theme--colored.Toastify__toast--success{color:var(--toastify-text-color-success);background:var(--toastify-color-success)}.Toastify__toast-theme--colored.Toastify__toast--warning{color:var(--toastify-text-color-warning);background:var(--toastify-color-warning)}.Toastify__toast-theme--colored.Toastify__toast--error{color:var(--toastify-text-color-error);background:var(--toastify-color-error)}.Toastify__progress-bar-theme--light{background:var(--toastify-color-progress-light)}.Toastify__progress-bar-theme--dark{background:var(--toastify-color-progress-dark)}.Toastify__progress-bar--info{background:var(--toastify-color-progress-info)}.Toastify__progress-bar--success{background:var(--toastify-color-progress-success)}.Toastify__progress-bar--warning{background:var(--toastify-color-progress-warning)}.Toastify__progress-bar--error{background:var(--toastify-color-progress-error)}.Toastify__progress-bar-theme--colored.Toastify__progress-bar--info,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--success,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--warning,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--error{background:var(--toastify-color-transparent)}.Toastify__close-button{color:#fff;position:absolute;top:6px;right:6px;background:transparent;outline:none;border:none;padding:0;cursor:pointer;opacity:.7;transition:.3s ease;z-index:1}.Toastify__toast--rtl .Toastify__close-button{left:6px;right:unset}.Toastify__close-button--light{color:#000;opacity:.3}.Toastify__close-button>svg{fill:currentColor;height:16px;width:14px}.Toastify__close-button:hover,.Toastify__close-button:focus{opacity:1}@keyframes Toastify__trackProgress{0%{transform:scaleX(1)}to{transform:scaleX(0)}}.Toastify__progress-bar{position:absolute;bottom:0;left:0;width:100%;height:100%;z-index:1;opacity:.7;transform-origin:left}.Toastify__progress-bar--animated{animation:Toastify__trackProgress linear 1 forwards}.Toastify__progress-bar--controlled{transition:transform .2s}.Toastify__progress-bar--rtl{right:0;left:initial;transform-origin:right;border-bottom-left-radius:initial}.Toastify__progress-bar--wrp{position:absolute;overflow:hidden;bottom:0;left:0;width:100%;height:5px;border-bottom-left-radius:var(--toastify-toast-bd-radius);border-bottom-right-radius:var(--toastify-toast-bd-radius)}.Toastify__progress-bar--wrp[data-hidden=true]{opacity:0}.Toastify__progress-bar--bg{opacity:var(--toastify-color-progress-bgo);width:100%;height:100%}.Toastify__spinner{width:20px;height:20px;box-sizing:border-box;border:2px solid;border-radius:100%;border-color:var(--toastify-spinner-color-empty-area);border-right-color:var(--toastify-spinner-color);animation:Toastify__spin .65s linear infinite}@keyframes Toastify__bounceInRight{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(3000px,0,0)}60%{opacity:1;transform:translate3d(-25px,0,0)}75%{transform:translate3d(10px,0,0)}90%{transform:translate3d(-5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutRight{20%{opacity:1;transform:translate3d(-20px,var(--y),0)}to{opacity:0;transform:translate3d(2000px,var(--y),0)}}@keyframes Toastify__bounceInLeft{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(-3000px,0,0)}60%{opacity:1;transform:translate3d(25px,0,0)}75%{transform:translate3d(-10px,0,0)}90%{transform:translate3d(5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutLeft{20%{opacity:1;transform:translate3d(20px,var(--y),0)}to{opacity:0;transform:translate3d(-2000px,var(--y),0)}}@keyframes Toastify__bounceInUp{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,3000px,0)}60%{opacity:1;transform:translate3d(0,-20px,0)}75%{transform:translate3d(0,10px,0)}90%{transform:translate3d(0,-5px,0)}to{transform:translateZ(0)}}@keyframes Toastify__bounceOutUp{20%{transform:translate3d(0,calc(var(--y) - 10px),0)}40%,45%{opacity:1;transform:translate3d(0,calc(var(--y) + 20px),0)}to{opacity:0;transform:translate3d(0,-2000px,0)}}@keyframes Toastify__bounceInDown{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,-3000px,0)}60%{opacity:1;transform:translate3d(0,25px,0)}75%{transform:translate3d(0,-10px,0)}90%{transform:translate3d(0,5px,0)}to{transform:none}}@keyframes Toastify__bounceOutDown{20%{transform:translate3d(0,calc(var(--y) - 10px),0)}40%,45%{opacity:1;transform:translate3d(0,calc(var(--y) + 20px),0)}to{opacity:0;transform:translate3d(0,2000px,0)}}.Toastify__bounce-enter--top-left,.Toastify__bounce-enter--bottom-left{animation-name:Toastify__bounceInLeft}.Toastify__bounce-enter--top-right,.Toastify__bounce-enter--bottom-right{animation-name:Toastify__bounceInRight}.Toastify__bounce-enter--top-center{animation-name:Toastify__bounceInDown}.Toastify__bounce-enter--bottom-center{animation-name:Toastify__bounceInUp}.Toastify__bounce-exit--top-left,.Toastify__bounce-exit--bottom-left{animation-name:Toastify__bounceOutLeft}.Toastify__bounce-exit--top-right,.Toastify__bounce-exit--bottom-right{animation-name:Toastify__bounceOutRight}.Toastify__bounce-exit--top-center{animation-name:Toastify__bounceOutUp}.Toastify__bounce-exit--bottom-center{animation-name:Toastify__bounceOutDown}@keyframes Toastify__zoomIn{0%{opacity:0;transform:scale3d(.3,.3,.3)}50%{opacity:1}}@keyframes Toastify__zoomOut{0%{opacity:1}50%{opacity:0;transform:translate3d(0,var(--y),0) scale3d(.3,.3,.3)}to{opacity:0}}.Toastify__zoom-enter{animation-name:Toastify__zoomIn}.Toastify__zoom-exit{animation-name:Toastify__zoomOut}@keyframes Toastify__flipIn{0%{transform:perspective(400px) rotateX(90deg);animation-timing-function:ease-in;opacity:0}40%{transform:perspective(400px) rotateX(-20deg);animation-timing-function:ease-in}60%{transform:perspective(400px) rotateX(10deg);opacity:1}80%{transform:perspective(400px) rotateX(-5deg)}to{transform:perspective(400px)}}@keyframes Toastify__flipOut{0%{transform:translate3d(0,var(--y),0) perspective(400px)}30%{transform:translate3d(0,var(--y),0) perspective(400px) rotateX(-20deg);opacity:1}to{transform:translate3d(0,var(--y),0) perspective(400px) rotateX(90deg);opacity:0}}.Toastify__flip-enter{animation-name:Toastify__flipIn}.Toastify__flip-exit{animation-name:Toastify__flipOut}@keyframes Toastify__slideInRight{0%{transform:translate3d(110%,0,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInLeft{0%{transform:translate3d(-110%,0,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInUp{0%{transform:translate3d(0,110%,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInDown{0%{transform:translate3d(0,-110%,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideOutRight{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(110%,var(--y),0)}}@keyframes Toastify__slideOutLeft{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(-110%,var(--y),0)}}@keyframes Toastify__slideOutDown{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(0,500px,0)}}@keyframes Toastify__slideOutUp{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(0,-500px,0)}}.Toastify__slide-enter--top-left,.Toastify__slide-enter--bottom-left{animation-name:Toastify__slideInLeft}.Toastify__slide-enter--top-right,.Toastify__slide-enter--bottom-right{animation-name:Toastify__slideInRight}.Toastify__slide-enter--top-center{animation-name:Toastify__slideInDown}.Toastify__slide-enter--bottom-center{animation-name:Toastify__slideInUp}.Toastify__slide-exit--top-left,.Toastify__slide-exit--bottom-left{animation-name:Toastify__slideOutLeft;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--top-right,.Toastify__slide-exit--bottom-right{animation-name:Toastify__slideOutRight;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--top-center{animation-name:Toastify__slideOutUp;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--bottom-center{animation-name:Toastify__slideOutDown;animation-timing-function:ease-in;animation-duration:.3s}@keyframes Toastify__spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}
11
- `);
12
- var T = (t) => typeof t == "number" && !isNaN(t), y = (t) => typeof t == "string", k = (t) => typeof t == "function", X = (t) => y(t) || T(t), R = (t) => S(t) || y(t) || k(t) || T(t), A = 1, w = () => `${A++}`, e = /* @__PURE__ */ new Map(), b = [], x = /* @__PURE__ */ new Set(), I = () => e.size > 0, F = (t, { containerId: o }) => {
13
- var a;
14
- return (a = e.get(o || 1)) == null ? void 0 : a.toasts.get(t);
15
- };
16
- function N(t, o) {
17
- var a;
18
- if (o) return !!((a = e.get(o)) != null && a.isToastActive(t));
19
- let n = !1;
20
- return e.forEach((r) => {
21
- r.isToastActive(t) && (n = !0);
22
- }), n;
23
- }
24
- function P(t) {
25
- if (!I()) {
26
- b = b.filter((o) => t != null && o.options.toastId !== t);
27
- return;
28
- }
29
- if (t == null || X(t)) e.forEach((o) => {
30
- o.removeToast(t);
31
- });
32
- else if (t && ("containerId" in t || "id" in t)) {
33
- let o = e.get(t.containerId);
34
- o ? o.removeToast(t.id) : e.forEach((a) => {
35
- a.removeToast(t.id);
36
- });
37
- }
38
- }
39
- var B = (t = {}) => {
40
- e.forEach((o) => {
41
- o.props.limit && (!t.containerId || o.id === t.containerId) && o.clearQueue();
42
- });
43
- };
44
- function Q(t, o) {
45
- R(t) && (I() || b.push({ content: t, options: o }), e.forEach((a) => {
46
- a.buildToast(t, o);
47
- }));
48
- }
49
- function z(t, o) {
50
- e.forEach((a) => {
51
- (o == null || !(o != null && o.containerId) || (o == null ? void 0 : o.containerId) === a.id) && a.toggle(t, o == null ? void 0 : o.id);
52
- });
53
- }
54
- function $(t) {
55
- return x.add(t), () => {
56
- x.delete(t);
57
- };
58
- }
59
- function j(t) {
60
- return t && (y(t.toastId) || T(t.toastId)) ? t.toastId : w();
61
- }
62
- function d(t, o) {
63
- return Q(t, o), o.toastId;
64
- }
65
- function p(t, o) {
66
- return { ...o, type: o && o.type || t, toastId: j(o) };
67
- }
68
- function u(t) {
69
- return (o, a) => d(o, p(t, a));
70
- }
71
- function s(t, o) {
72
- return d(t, p("default", o));
73
- }
74
- s.loading = (t, o) => d(t, p("default", { isLoading: !0, autoClose: !1, closeOnClick: !1, closeButton: !1, draggable: !1, ...o }));
75
- function M(t, { pending: o, error: a, success: n }, r) {
76
- let i;
77
- o && (i = y(o) ? s.loading(o, r) : s.loading(o.render, { ...r, ...o }));
78
- let f = { isLoading: null, autoClose: null, closeOnClick: null, closeButton: null, draggable: null }, l = (c, m, h) => {
79
- if (m == null) {
80
- s.dismiss(i);
81
- return;
82
- }
83
- let v = { type: c, ...f, ...r, data: h }, g = y(m) ? { render: m } : m;
84
- return i ? s.update(i, { ...v, ...g }) : s(g.render, { ...v, ...g }), h;
85
- }, _ = k(t) ? t() : t;
86
- return _.then((c) => l("success", n, c)).catch((c) => l("error", a, c)), _;
87
- }
88
- s.promise = M;
89
- s.success = u("success");
90
- s.info = u("info");
91
- s.error = u("error");
92
- s.warning = u("warning");
93
- s.warn = s.warning;
94
- s.dark = (t, o) => d(t, p("default", { theme: "dark", ...o }));
95
- function V(t) {
96
- P(t);
97
- }
98
- s.dismiss = V;
99
- s.clearWaitingQueue = B;
100
- s.isActive = N;
101
- s.update = (t, o = {}) => {
102
- let a = F(t, o);
103
- if (a) {
104
- let { props: n, content: r } = a, i = { delay: 100, ...n, ...o, toastId: o.toastId || t, updateId: w() };
105
- i.toastId !== t && (i.staleId = t);
106
- let f = i.render || r;
107
- delete i.render, d(f, i);
108
- }
109
- };
110
- s.done = (t) => {
111
- s.update(t, { progress: 1 });
112
- };
113
- s.onChange = $;
114
- s.play = (t) => z(!0, t);
115
- s.pause = (t) => z(!1, t);
116
- const Z = () => {
117
- const { setAuthToken: t, setUserToken: o } = O(), [a, n] = E(null), r = `${window.location.protocol}//${window.location.host}/`;
118
- return L(() => {
119
- const f = sessionStorage.getItem("user_token");
120
- if (f) {
121
- const l = U(f);
122
- n(l);
1
+ import { useAuthId as c } from "./AuthHook.js";
2
+ import { FinSesionService as u } from "../services/FinSesionService.js";
3
+ import { y as l } from "../../index-BUe3EJDH.js";
4
+ import { useState as m, useEffect as f } from "react";
5
+ import { j as d } from "../../index-CuHybtft.js";
6
+ const g = () => {
7
+ const { setAuthToken: t, setUserToken: r } = c(), [e, i] = m(null), n = `${window.location.protocol}//${window.location.host}/`;
8
+ return f(() => {
9
+ const o = sessionStorage.getItem("user_token");
10
+ if (o) {
11
+ const s = d(o);
12
+ i(s);
123
13
  }
124
14
  }, []), { FinSesion: () => {
125
- s.promise(
126
- new Promise(async (f, l) => {
15
+ l.promise(
16
+ new Promise(async (o, s) => {
127
17
  try {
128
- await C((a == null ? void 0 : a.datos_basicos.username) || "", r), sessionStorage.removeItem("user_token"), t(null), o(null), setTimeout(() => {
129
- f(!0), window.location.href = r;
18
+ await u((e == null ? void 0 : e.datos_basicos.username) || "", n), sessionStorage.removeItem("user_token"), t(null), r(null), setTimeout(() => {
19
+ o(!0), window.location.href = n;
130
20
  }, 1e3);
131
- } catch (_) {
132
- l(_);
21
+ } catch (a) {
22
+ s(a);
133
23
  }
134
24
  }),
135
25
  {
@@ -141,5 +31,5 @@ const Z = () => {
141
31
  } };
142
32
  };
143
33
  export {
144
- Z as useFinalizarSesion
34
+ g as useFinalizarSesion
145
35
  };
@@ -0,0 +1,60 @@
1
+ import { jsx as r, jsxs as e } from "react/jsx-runtime";
2
+ import "react";
3
+ 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';/* empty css */
4
+ /* empty css */
5
+ import "../../cards/tarjeta/seccion-tarjeta/SeccionTarjeta.js";
6
+ import { m as t } from "../../index-CZLknVmR.js";
7
+ /* empty css */
8
+ /* empty css */
9
+ /* empty css */
10
+ /* empty css */
11
+ import { TarjetaInfo as n } from "../../cards/tarjeta-info/TarjetaInfo.js";
12
+ import { T as c } from "../../Table-C5ydZooy.js";
13
+ const N = () => {
14
+ const i = () => /* @__PURE__ */ r("td", { className: "text-start", children: "      .      " });
15
+ return /* @__PURE__ */ r(n, { label: "Datos básicos", icon: t, children: /* @__PURE__ */ r(c, { responsive: !0, striped: !0, children: /* @__PURE__ */ e("tbody", { children: [
16
+ /* @__PURE__ */ e("tr", { children: [
17
+ /* @__PURE__ */ r("th", { className: "text-start", children: "Nombre completo" }),
18
+ i()
19
+ ] }),
20
+ /* @__PURE__ */ e("tr", { children: [
21
+ /* @__PURE__ */ r("th", { children: "Nombre identitario" }),
22
+ i()
23
+ ] }),
24
+ /* @__PURE__ */ e("tr", { children: [
25
+ /* @__PURE__ */ r("th", { children: "Género" }),
26
+ i()
27
+ ] }),
28
+ /* @__PURE__ */ e("tr", { children: [
29
+ /* @__PURE__ */ r("th", { children: "Tipo de identificación" }),
30
+ i()
31
+ ] }),
32
+ /* @__PURE__ */ e("tr", { children: [
33
+ /* @__PURE__ */ r("th", { children: "Número de identificación" }),
34
+ i()
35
+ ] }),
36
+ /* @__PURE__ */ e("tr", { children: [
37
+ /* @__PURE__ */ r("th", { children: "Fecha de expedición" }),
38
+ i()
39
+ ] }),
40
+ /* @__PURE__ */ e("tr", { children: [
41
+ /* @__PURE__ */ r("th", { children: "País de nacimiento" }),
42
+ i()
43
+ ] }),
44
+ /* @__PURE__ */ e("tr", { children: [
45
+ /* @__PURE__ */ r("th", { children: "Departamento de nacimiento" }),
46
+ i()
47
+ ] }),
48
+ /* @__PURE__ */ e("tr", { children: [
49
+ /* @__PURE__ */ r("th", { children: "Municipio de nacimiento" }),
50
+ i()
51
+ ] }),
52
+ /* @__PURE__ */ e("tr", { children: [
53
+ /* @__PURE__ */ r("th", { children: "Fecha de nacimiento" }),
54
+ i()
55
+ ] })
56
+ ] }) }) });
57
+ };
58
+ export {
59
+ N as TarjetaDatos
60
+ };
@@ -0,0 +1,115 @@
1
+ import { isValidElement as O } from "react";
2
+ function C(t) {
3
+ if (typeof document > "u") return;
4
+ let o = document.head || document.getElementsByTagName("head")[0], a = document.createElement("style");
5
+ a.type = "text/css", o.firstChild ? o.insertBefore(a, o.firstChild) : o.appendChild(a), a.styleSheet ? a.styleSheet.cssText = t : a.appendChild(document.createTextNode(t));
6
+ }
7
+ C(`:root{--toastify-color-light: #fff;--toastify-color-dark: #121212;--toastify-color-info: #3498db;--toastify-color-success: #07bc0c;--toastify-color-warning: #f1c40f;--toastify-color-error: hsl(6, 78%, 57%);--toastify-color-transparent: rgba(255, 255, 255, .7);--toastify-icon-color-info: var(--toastify-color-info);--toastify-icon-color-success: var(--toastify-color-success);--toastify-icon-color-warning: var(--toastify-color-warning);--toastify-icon-color-error: var(--toastify-color-error);--toastify-container-width: fit-content;--toastify-toast-width: 320px;--toastify-toast-offset: 16px;--toastify-toast-top: max(var(--toastify-toast-offset), env(safe-area-inset-top));--toastify-toast-right: max(var(--toastify-toast-offset), env(safe-area-inset-right));--toastify-toast-left: max(var(--toastify-toast-offset), env(safe-area-inset-left));--toastify-toast-bottom: max(var(--toastify-toast-offset), env(safe-area-inset-bottom));--toastify-toast-background: #fff;--toastify-toast-padding: 14px;--toastify-toast-min-height: 64px;--toastify-toast-max-height: 800px;--toastify-toast-bd-radius: 6px;--toastify-toast-shadow: 0px 4px 12px rgba(0, 0, 0, .1);--toastify-font-family: sans-serif;--toastify-z-index: 9999;--toastify-text-color-light: #757575;--toastify-text-color-dark: #fff;--toastify-text-color-info: #fff;--toastify-text-color-success: #fff;--toastify-text-color-warning: #fff;--toastify-text-color-error: #fff;--toastify-spinner-color: #616161;--toastify-spinner-color-empty-area: #e0e0e0;--toastify-color-progress-light: linear-gradient(to right, #4cd964, #5ac8fa, #007aff, #34aadc, #5856d6, #ff2d55);--toastify-color-progress-dark: #bb86fc;--toastify-color-progress-info: var(--toastify-color-info);--toastify-color-progress-success: var(--toastify-color-success);--toastify-color-progress-warning: var(--toastify-color-warning);--toastify-color-progress-error: var(--toastify-color-error);--toastify-color-progress-bgo: .2}.Toastify__toast-container{z-index:var(--toastify-z-index);-webkit-transform:translate3d(0,0,var(--toastify-z-index));position:fixed;width:var(--toastify-container-width);box-sizing:border-box;color:#fff;display:flex;flex-direction:column}.Toastify__toast-container--top-left{top:var(--toastify-toast-top);left:var(--toastify-toast-left)}.Toastify__toast-container--top-center{top:var(--toastify-toast-top);left:50%;transform:translate(-50%);align-items:center}.Toastify__toast-container--top-right{top:var(--toastify-toast-top);right:var(--toastify-toast-right);align-items:end}.Toastify__toast-container--bottom-left{bottom:var(--toastify-toast-bottom);left:var(--toastify-toast-left)}.Toastify__toast-container--bottom-center{bottom:var(--toastify-toast-bottom);left:50%;transform:translate(-50%);align-items:center}.Toastify__toast-container--bottom-right{bottom:var(--toastify-toast-bottom);right:var(--toastify-toast-right);align-items:end}.Toastify__toast{--y: 0;position:relative;touch-action:none;width:var(--toastify-toast-width);min-height:var(--toastify-toast-min-height);box-sizing:border-box;margin-bottom:1rem;padding:var(--toastify-toast-padding);border-radius:var(--toastify-toast-bd-radius);box-shadow:var(--toastify-toast-shadow);max-height:var(--toastify-toast-max-height);font-family:var(--toastify-font-family);z-index:0;display:flex;flex:1 auto;align-items:center;word-break:break-word}@media only screen and (max-width: 480px){.Toastify__toast-container{width:100vw;left:env(safe-area-inset-left);margin:0}.Toastify__toast-container--top-left,.Toastify__toast-container--top-center,.Toastify__toast-container--top-right{top:env(safe-area-inset-top);transform:translate(0)}.Toastify__toast-container--bottom-left,.Toastify__toast-container--bottom-center,.Toastify__toast-container--bottom-right{bottom:env(safe-area-inset-bottom);transform:translate(0)}.Toastify__toast-container--rtl{right:env(safe-area-inset-right);left:initial}.Toastify__toast{--toastify-toast-width: 100%;margin-bottom:0;border-radius:0}}.Toastify__toast-container[data-stacked=true]{width:var(--toastify-toast-width)}.Toastify__toast--stacked{position:absolute;width:100%;transform:translate3d(0,var(--y),0) scale(var(--s));transition:transform .3s}.Toastify__toast--stacked[data-collapsed] .Toastify__toast-body,.Toastify__toast--stacked[data-collapsed] .Toastify__close-button{transition:opacity .1s}.Toastify__toast--stacked[data-collapsed=false]{overflow:visible}.Toastify__toast--stacked[data-collapsed=true]:not(:last-child)>*{opacity:0}.Toastify__toast--stacked:after{content:"";position:absolute;left:0;right:0;height:calc(var(--g) * 1px);bottom:100%}.Toastify__toast--stacked[data-pos=top]{top:0}.Toastify__toast--stacked[data-pos=bot]{bottom:0}.Toastify__toast--stacked[data-pos=bot].Toastify__toast--stacked:before{transform-origin:top}.Toastify__toast--stacked[data-pos=top].Toastify__toast--stacked:before{transform-origin:bottom}.Toastify__toast--stacked:before{content:"";position:absolute;left:0;right:0;bottom:0;height:100%;transform:scaleY(3);z-index:-1}.Toastify__toast--rtl{direction:rtl}.Toastify__toast--close-on-click{cursor:pointer}.Toastify__toast-icon{margin-inline-end:10px;width:22px;flex-shrink:0;display:flex}.Toastify--animate{animation-fill-mode:both;animation-duration:.5s}.Toastify--animate-icon{animation-fill-mode:both;animation-duration:.3s}.Toastify__toast-theme--dark{background:var(--toastify-color-dark);color:var(--toastify-text-color-dark)}.Toastify__toast-theme--light,.Toastify__toast-theme--colored.Toastify__toast--default{background:var(--toastify-color-light);color:var(--toastify-text-color-light)}.Toastify__toast-theme--colored.Toastify__toast--info{color:var(--toastify-text-color-info);background:var(--toastify-color-info)}.Toastify__toast-theme--colored.Toastify__toast--success{color:var(--toastify-text-color-success);background:var(--toastify-color-success)}.Toastify__toast-theme--colored.Toastify__toast--warning{color:var(--toastify-text-color-warning);background:var(--toastify-color-warning)}.Toastify__toast-theme--colored.Toastify__toast--error{color:var(--toastify-text-color-error);background:var(--toastify-color-error)}.Toastify__progress-bar-theme--light{background:var(--toastify-color-progress-light)}.Toastify__progress-bar-theme--dark{background:var(--toastify-color-progress-dark)}.Toastify__progress-bar--info{background:var(--toastify-color-progress-info)}.Toastify__progress-bar--success{background:var(--toastify-color-progress-success)}.Toastify__progress-bar--warning{background:var(--toastify-color-progress-warning)}.Toastify__progress-bar--error{background:var(--toastify-color-progress-error)}.Toastify__progress-bar-theme--colored.Toastify__progress-bar--info,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--success,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--warning,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--error{background:var(--toastify-color-transparent)}.Toastify__close-button{color:#fff;position:absolute;top:6px;right:6px;background:transparent;outline:none;border:none;padding:0;cursor:pointer;opacity:.7;transition:.3s ease;z-index:1}.Toastify__toast--rtl .Toastify__close-button{left:6px;right:unset}.Toastify__close-button--light{color:#000;opacity:.3}.Toastify__close-button>svg{fill:currentColor;height:16px;width:14px}.Toastify__close-button:hover,.Toastify__close-button:focus{opacity:1}@keyframes Toastify__trackProgress{0%{transform:scaleX(1)}to{transform:scaleX(0)}}.Toastify__progress-bar{position:absolute;bottom:0;left:0;width:100%;height:100%;z-index:1;opacity:.7;transform-origin:left}.Toastify__progress-bar--animated{animation:Toastify__trackProgress linear 1 forwards}.Toastify__progress-bar--controlled{transition:transform .2s}.Toastify__progress-bar--rtl{right:0;left:initial;transform-origin:right;border-bottom-left-radius:initial}.Toastify__progress-bar--wrp{position:absolute;overflow:hidden;bottom:0;left:0;width:100%;height:5px;border-bottom-left-radius:var(--toastify-toast-bd-radius);border-bottom-right-radius:var(--toastify-toast-bd-radius)}.Toastify__progress-bar--wrp[data-hidden=true]{opacity:0}.Toastify__progress-bar--bg{opacity:var(--toastify-color-progress-bgo);width:100%;height:100%}.Toastify__spinner{width:20px;height:20px;box-sizing:border-box;border:2px solid;border-radius:100%;border-color:var(--toastify-spinner-color-empty-area);border-right-color:var(--toastify-spinner-color);animation:Toastify__spin .65s linear infinite}@keyframes Toastify__bounceInRight{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(3000px,0,0)}60%{opacity:1;transform:translate3d(-25px,0,0)}75%{transform:translate3d(10px,0,0)}90%{transform:translate3d(-5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutRight{20%{opacity:1;transform:translate3d(-20px,var(--y),0)}to{opacity:0;transform:translate3d(2000px,var(--y),0)}}@keyframes Toastify__bounceInLeft{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(-3000px,0,0)}60%{opacity:1;transform:translate3d(25px,0,0)}75%{transform:translate3d(-10px,0,0)}90%{transform:translate3d(5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutLeft{20%{opacity:1;transform:translate3d(20px,var(--y),0)}to{opacity:0;transform:translate3d(-2000px,var(--y),0)}}@keyframes Toastify__bounceInUp{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,3000px,0)}60%{opacity:1;transform:translate3d(0,-20px,0)}75%{transform:translate3d(0,10px,0)}90%{transform:translate3d(0,-5px,0)}to{transform:translateZ(0)}}@keyframes Toastify__bounceOutUp{20%{transform:translate3d(0,calc(var(--y) - 10px),0)}40%,45%{opacity:1;transform:translate3d(0,calc(var(--y) + 20px),0)}to{opacity:0;transform:translate3d(0,-2000px,0)}}@keyframes Toastify__bounceInDown{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,-3000px,0)}60%{opacity:1;transform:translate3d(0,25px,0)}75%{transform:translate3d(0,-10px,0)}90%{transform:translate3d(0,5px,0)}to{transform:none}}@keyframes Toastify__bounceOutDown{20%{transform:translate3d(0,calc(var(--y) - 10px),0)}40%,45%{opacity:1;transform:translate3d(0,calc(var(--y) + 20px),0)}to{opacity:0;transform:translate3d(0,2000px,0)}}.Toastify__bounce-enter--top-left,.Toastify__bounce-enter--bottom-left{animation-name:Toastify__bounceInLeft}.Toastify__bounce-enter--top-right,.Toastify__bounce-enter--bottom-right{animation-name:Toastify__bounceInRight}.Toastify__bounce-enter--top-center{animation-name:Toastify__bounceInDown}.Toastify__bounce-enter--bottom-center{animation-name:Toastify__bounceInUp}.Toastify__bounce-exit--top-left,.Toastify__bounce-exit--bottom-left{animation-name:Toastify__bounceOutLeft}.Toastify__bounce-exit--top-right,.Toastify__bounce-exit--bottom-right{animation-name:Toastify__bounceOutRight}.Toastify__bounce-exit--top-center{animation-name:Toastify__bounceOutUp}.Toastify__bounce-exit--bottom-center{animation-name:Toastify__bounceOutDown}@keyframes Toastify__zoomIn{0%{opacity:0;transform:scale3d(.3,.3,.3)}50%{opacity:1}}@keyframes Toastify__zoomOut{0%{opacity:1}50%{opacity:0;transform:translate3d(0,var(--y),0) scale3d(.3,.3,.3)}to{opacity:0}}.Toastify__zoom-enter{animation-name:Toastify__zoomIn}.Toastify__zoom-exit{animation-name:Toastify__zoomOut}@keyframes Toastify__flipIn{0%{transform:perspective(400px) rotateX(90deg);animation-timing-function:ease-in;opacity:0}40%{transform:perspective(400px) rotateX(-20deg);animation-timing-function:ease-in}60%{transform:perspective(400px) rotateX(10deg);opacity:1}80%{transform:perspective(400px) rotateX(-5deg)}to{transform:perspective(400px)}}@keyframes Toastify__flipOut{0%{transform:translate3d(0,var(--y),0) perspective(400px)}30%{transform:translate3d(0,var(--y),0) perspective(400px) rotateX(-20deg);opacity:1}to{transform:translate3d(0,var(--y),0) perspective(400px) rotateX(90deg);opacity:0}}.Toastify__flip-enter{animation-name:Toastify__flipIn}.Toastify__flip-exit{animation-name:Toastify__flipOut}@keyframes Toastify__slideInRight{0%{transform:translate3d(110%,0,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInLeft{0%{transform:translate3d(-110%,0,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInUp{0%{transform:translate3d(0,110%,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInDown{0%{transform:translate3d(0,-110%,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideOutRight{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(110%,var(--y),0)}}@keyframes Toastify__slideOutLeft{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(-110%,var(--y),0)}}@keyframes Toastify__slideOutDown{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(0,500px,0)}}@keyframes Toastify__slideOutUp{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(0,-500px,0)}}.Toastify__slide-enter--top-left,.Toastify__slide-enter--bottom-left{animation-name:Toastify__slideInLeft}.Toastify__slide-enter--top-right,.Toastify__slide-enter--bottom-right{animation-name:Toastify__slideInRight}.Toastify__slide-enter--top-center{animation-name:Toastify__slideInDown}.Toastify__slide-enter--bottom-center{animation-name:Toastify__slideInUp}.Toastify__slide-exit--top-left,.Toastify__slide-exit--bottom-left{animation-name:Toastify__slideOutLeft;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--top-right,.Toastify__slide-exit--bottom-right{animation-name:Toastify__slideOutRight;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--top-center{animation-name:Toastify__slideOutUp;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--bottom-center{animation-name:Toastify__slideOutDown;animation-timing-function:ease-in;animation-duration:.3s}@keyframes Toastify__spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}
8
+ `);
9
+ var g = (t) => typeof t == "number" && !isNaN(t), l = (t) => typeof t == "string", k = (t) => typeof t == "function", L = (t) => l(t) || g(t), X = (t) => O(t) || l(t) || k(t) || g(t), E = 1, w = () => `${E++}`, s = /* @__PURE__ */ new Map(), u = [], x = /* @__PURE__ */ new Set(), I = () => s.size > 0, U = (t, { containerId: o }) => {
10
+ var a;
11
+ return (a = s.get(o || 1)) == null ? void 0 : a.toasts.get(t);
12
+ };
13
+ function D(t, o) {
14
+ var a;
15
+ if (o) return !!((a = s.get(o)) != null && a.isToastActive(t));
16
+ let n = !1;
17
+ return s.forEach((e) => {
18
+ e.isToastActive(t) && (n = !0);
19
+ }), n;
20
+ }
21
+ function R(t) {
22
+ if (!I()) {
23
+ u = u.filter((o) => t != null && o.options.toastId !== t);
24
+ return;
25
+ }
26
+ if (t == null || L(t)) s.forEach((o) => {
27
+ o.removeToast(t);
28
+ });
29
+ else if (t && ("containerId" in t || "id" in t)) {
30
+ let o = s.get(t.containerId);
31
+ o ? o.removeToast(t.id) : s.forEach((a) => {
32
+ a.removeToast(t.id);
33
+ });
34
+ }
35
+ }
36
+ var N = (t = {}) => {
37
+ s.forEach((o) => {
38
+ o.props.limit && (!t.containerId || o.id === t.containerId) && o.clearQueue();
39
+ });
40
+ };
41
+ function B(t, o) {
42
+ X(t) && (I() || u.push({ content: t, options: o }), s.forEach((a) => {
43
+ a.buildToast(t, o);
44
+ }));
45
+ }
46
+ function z(t, o) {
47
+ s.forEach((a) => {
48
+ (o == null || !(o != null && o.containerId) || (o == null ? void 0 : o.containerId) === a.id) && a.toggle(t, o == null ? void 0 : o.id);
49
+ });
50
+ }
51
+ function P(t) {
52
+ return x.add(t), () => {
53
+ x.delete(t);
54
+ };
55
+ }
56
+ function A(t) {
57
+ return t && (l(t.toastId) || g(t.toastId)) ? t.toastId : w();
58
+ }
59
+ function c(t, o) {
60
+ return B(t, o), o.toastId;
61
+ }
62
+ function d(t, o) {
63
+ return { ...o, type: o && o.type || t, toastId: A(o) };
64
+ }
65
+ function _(t) {
66
+ return (o, a) => c(o, d(t, a));
67
+ }
68
+ function r(t, o) {
69
+ return c(t, d("default", o));
70
+ }
71
+ r.loading = (t, o) => c(t, d("default", { isLoading: !0, autoClose: !1, closeOnClick: !1, closeButton: !1, draggable: !1, ...o }));
72
+ function Q(t, { pending: o, error: a, success: n }, e) {
73
+ let i;
74
+ o && (i = l(o) ? r.loading(o, e) : r.loading(o.render, { ...e, ...o }));
75
+ let m = { isLoading: null, autoClose: null, closeOnClick: null, closeButton: null, draggable: null }, b = (f, y, h) => {
76
+ if (y == null) {
77
+ r.dismiss(i);
78
+ return;
79
+ }
80
+ let v = { type: f, ...m, ...e, data: h }, p = l(y) ? { render: y } : y;
81
+ return i ? r.update(i, { ...v, ...p }) : r(p.render, { ...v, ...p }), h;
82
+ }, T = k(t) ? t() : t;
83
+ return T.then((f) => b("success", n, f)).catch((f) => b("error", a, f)), T;
84
+ }
85
+ r.promise = Q;
86
+ r.success = _("success");
87
+ r.info = _("info");
88
+ r.error = _("error");
89
+ r.warning = _("warning");
90
+ r.warn = r.warning;
91
+ r.dark = (t, o) => c(t, d("default", { theme: "dark", ...o }));
92
+ function S(t) {
93
+ R(t);
94
+ }
95
+ r.dismiss = S;
96
+ r.clearWaitingQueue = N;
97
+ r.isActive = D;
98
+ r.update = (t, o = {}) => {
99
+ let a = U(t, o);
100
+ if (a) {
101
+ let { props: n, content: e } = a, i = { delay: 100, ...n, ...o, toastId: o.toastId || t, updateId: w() };
102
+ i.toastId !== t && (i.staleId = t);
103
+ let m = i.render || e;
104
+ delete i.render, c(m, i);
105
+ }
106
+ };
107
+ r.done = (t) => {
108
+ r.update(t, { progress: 1 });
109
+ };
110
+ r.onChange = P;
111
+ r.play = (t) => z(!0, t);
112
+ r.pause = (t) => z(!1, t);
113
+ export {
114
+ r as y
115
+ };
@@ -0,0 +1,9 @@
1
+ import { default as React } from 'react';
2
+ interface TarjetaDatosProps {
3
+ basicos: boolean;
4
+ contacto: boolean;
5
+ ubicacion: boolean;
6
+ complementarios: boolean;
7
+ }
8
+ declare const TarjetaDatos: React.FC<TarjetaDatosProps>;
9
+ export { TarjetaDatos };
@@ -0,0 +1,21 @@
1
+ interface UseFetchGenericoParams<T> {
2
+ endpoint: string;
3
+ localJsonPath?: string;
4
+ label?: string;
5
+ dependencia?: number | null;
6
+ queryParamKey?: string;
7
+ all?: boolean;
8
+ filtrarResultados?: (item: T) => boolean;
9
+ selectorDatos?: (json: any) => T[];
10
+ timeout?: boolean;
11
+ timeoutMs?: number;
12
+ id?: number | string | null;
13
+ transformarResultado?: (data: any) => T;
14
+ dataInResultsValue?: boolean;
15
+ }
16
+ export declare const useFetchData: <T>({ endpoint, localJsonPath, label, dependencia, queryParamKey, all, filtrarResultados, selectorDatos, timeout, timeoutMs, id, transformarResultado, dataInResultsValue, }: UseFetchGenericoParams<T>) => {
17
+ data: T[];
18
+ loading: boolean;
19
+ error: string | null;
20
+ };
21
+ export {};
@@ -3,4 +3,6 @@ export { ProtectedRoute } from './utils/components/ProtectedRoute.js';
3
3
  export { UserRoute } from './utils/components/UserRoute.js';
4
4
  export { UnpHistorico } from './utils/unp-historico/UnpHistorico.js';
5
5
  export { useFormValidation } from './utils/validations/useFormValidation.js';
6
+ export { IsInvalidStyles } from './utils/validations/useFormValidation.js';
6
7
  export { CaptchaEcosistema } from './utils/captcha/CaptchaEcosistema.js';
8
+ export { useFetchData } from './utils/fetch-data/useFetchData.js';
@@ -0,0 +1,97 @@
1
+ import { useState as g, useEffect as U } from "react";
2
+ import { y as p } from "../../index-BUe3EJDH.js";
3
+ const W = ({
4
+ endpoint: n,
5
+ localJsonPath: i,
6
+ label: j,
7
+ dependencia: l = null,
8
+ queryParamKey: u,
9
+ all: v = !1,
10
+ filtrarResultados: f,
11
+ selectorDatos: A,
12
+ timeout: x = !1,
13
+ timeoutMs: D = 25e3,
14
+ // 25 segundos por defecto.
15
+ id: w = null,
16
+ transformarResultado: d,
17
+ dataInResultsValue: T = !0
18
+ }) => {
19
+ const [I, c] = g([]), [k, E] = g(!0), [y, h] = g(null), t = j || n.replace(/\/$/, "").split("/").pop() || "datos";
20
+ return U(() => {
21
+ if (!v && l === null && u) {
22
+ c([]), E(!1);
23
+ return;
24
+ }
25
+ const H = async () => {
26
+ E(!0), h(null);
27
+ let e = n;
28
+ if (w != null)
29
+ e = `${n.replace(/\/$/, "")}/${w}/`;
30
+ else if (l != null && u) {
31
+ const r = n.includes("?") ? "&" : "?";
32
+ e = `${n}${r}${u}=${l}`;
33
+ }
34
+ let o = e, a = [];
35
+ try {
36
+ if (T)
37
+ for (; o; ) {
38
+ let r;
39
+ if (x ? r = await m(o, D) : r = await fetch(o), r.ok) {
40
+ const s = await r.json(), $ = A || ((L) => L.results || []), C = f ? $(s).filter(f) : $(s);
41
+ a = a.concat(C), o = s.next, c(a);
42
+ } else {
43
+ console.warn(`Error HTTP (${r.status}). Intentando cargar ${t} desde archivo local...`), await b();
44
+ return;
45
+ }
46
+ console.log(`Cargando ${t} desde API...`);
47
+ }
48
+ else {
49
+ const r = await m(e, 5e3);
50
+ if (r.ok) {
51
+ const s = await r.json(), $ = d ? d(s) : s;
52
+ c($);
53
+ } else
54
+ console.warn(`Error HTTP (${r.status}). Cargando ${t} desde archivo local...`), await b();
55
+ }
56
+ } catch {
57
+ console.warn(`Excepción al cargar desde API. Intentando cargar ${t} desde archivo local...`), await b();
58
+ } finally {
59
+ E(!1);
60
+ }
61
+ }, b = async () => {
62
+ if (i)
63
+ try {
64
+ if (T) {
65
+ const e = await fetch(i);
66
+ if (e.ok) {
67
+ const o = await e.json(), a = f ? o.results.filter(f) : o.results;
68
+ c(a);
69
+ } else
70
+ p.error(`Hubo un problema al obtener ${t} desde el archivo local.`), h(`Error al obtener ${t} desde el archivo local`);
71
+ } else {
72
+ const e = await fetch(i);
73
+ if (e.ok) {
74
+ const o = await e.json(), a = d ? d(o) : o;
75
+ c(a);
76
+ } else
77
+ p.error(`Error al cargar ${t} desde archivo local.`), h(`Error al obtener ${t} desde el archivo local.`);
78
+ }
79
+ } catch (e) {
80
+ p.error(`Hubo un problema al obtener ${t}.`), console.error(`Error al obtener ${t}:`, e), h(`Error al obtener ${t}`);
81
+ }
82
+ }, m = async (e, o) => {
83
+ const a = new AbortController(), r = setTimeout(() => a.abort(), o);
84
+ try {
85
+ return await fetch(e, { signal: a.signal });
86
+ } catch (s) {
87
+ throw s instanceof Error ? s.name === "AbortError" ? new Error("La solicitud a la API ha tardado demasiado y fue cancelada.") : s : new Error("Un error desconocido ocurrió.");
88
+ } finally {
89
+ clearTimeout(r);
90
+ }
91
+ };
92
+ H();
93
+ }, [n, w, i, l, u, v, j]), { data: I, loading: k, error: y };
94
+ };
95
+ export {
96
+ W as useFetchData
97
+ };
package/dist/utils.js CHANGED
@@ -1,14 +1,17 @@
1
1
  import { AuthProvider as t } from "./auth/contexts/AuthContex.js";
2
2
  import { ProtectedRoute as m } from "./utils/components/ProtectedRoute.js";
3
- import { UserRoute as f } from "./utils/components/UserRoute.js";
4
- import { UnpHistorico as x } from "./utils/unp-historico/UnpHistorico.js";
5
- import { useFormValidation as s } from "./utils/validations/useFormValidation.js";
6
- import { CaptchaEcosistema as u } from "./utils/captcha/CaptchaEcosistema.js";
3
+ import { UserRoute as a } from "./utils/components/UserRoute.js";
4
+ import { UnpHistorico as f } from "./utils/unp-historico/UnpHistorico.js";
5
+ import { IsInvalidStyles as x, useFormValidation as c } from "./utils/validations/useFormValidation.js";
6
+ import { CaptchaEcosistema as d } from "./utils/captcha/CaptchaEcosistema.js";
7
+ import { useFetchData as l } from "./utils/fetch-data/useFetchData.js";
7
8
  export {
8
9
  t as AuthProvider,
9
- u as CaptchaEcosistema,
10
+ d as CaptchaEcosistema,
11
+ x as IsInvalidStyles,
10
12
  m as ProtectedRoute,
11
- x as UnpHistorico,
12
- f as UserRoute,
13
- s as useFormValidation
13
+ f as UnpHistorico,
14
+ a as UserRoute,
15
+ l as useFetchData,
16
+ c as useFormValidation
14
17
  };
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": "1.5.1",
5
+ "version": "1.5.2-pre.1",
6
6
  "type": "module",
7
7
  "exports": {
8
8
  ".": {
@@ -67,6 +67,7 @@
67
67
  "lottie-react": "^2.4.1",
68
68
  "react-bootstrap": "^2.10.9",
69
69
  "react-icons": "^5.4.0",
70
+ "react-select": "^5.10.1",
70
71
  "react-toastify": "^11.0.3",
71
72
  "sweetalert2": "^11.16.1"
72
73
  },