@imj_media/tareas 0.1.21 → 0.1.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/tareas.es.js CHANGED
@@ -1,39 +1,39 @@
1
- import { jsx as e, jsxs as o, Fragment as q } from "react/jsx-runtime";
1
+ import { jsx as e, jsxs as o, Fragment as D } from "react/jsx-runtime";
2
2
  import "@imj_media/imj-ui/styles.css";
3
- import { useQueryClient as H, useQuery as ae, useMutation as Ke, useInfiniteQuery as ne, QueryClient as Ue, QueryClientProvider as Qe } from "@tanstack/react-query";
4
- import { useState as y, useEffect as _, useRef as L, createContext as V, useContext as G } from "react";
5
- import { Tooltip as K, Icons as C } from "@imj_media/tasks-modules";
6
- import X from "react-dom";
7
- import ve from "axios";
8
- import Ce from "qs";
9
- import { parseISO as He, formatDistanceToNow as Ve, format as _e } from "date-fns";
10
- import { es as re } from "date-fns/locale";
11
- import { Button as Fe, Avatar as J, AvatarImage as Z, AvatarFallback as k, Input as Ge, Label as Ye, Accordion as Xe, AccordionItem as Je, AccordionTrigger as Ze, AccordionContent as ke } from "@imj_media/imj-ui";
12
- import { useForm as et } from "react-hook-form";
13
- import { Paginator as tt } from "primereact/paginator";
14
- const at = ({ label: a, active: t, onClick: r, disabled: n }) => n ? /* @__PURE__ */ e(K, { dispatch: /* @__PURE__ */ o("button", { className: "text-texts-placeholder text-xs font-semibold cursor-help", children: [
3
+ import { useQueryClient as V, useQuery as se, useMutation as re, useInfiniteQuery as le, QueryClient as Ge, QueryClientProvider as Ye } from "@tanstack/react-query";
4
+ import { useState as N, useEffect as T, useRef as W, createContext as G, useContext as Y } from "react";
5
+ import { Tooltip as M, Icons as F } from "@imj_media/tasks-modules";
6
+ import ie from "react-dom";
7
+ import Pe from "axios";
8
+ import Se from "qs";
9
+ import { parseISO as Xe, formatDistanceToNow as Je, format as De } from "date-fns";
10
+ import { es as oe } from "date-fns/locale";
11
+ import { Button as je, Avatar as Z, AvatarImage as k, AvatarFallback as ee, Input as Ze, Label as ke, Accordion as et, AccordionItem as tt, AccordionTrigger as at, AccordionContent as rt } from "@imj_media/imj-ui";
12
+ import { useForm as nt } from "react-hook-form";
13
+ import { Paginator as st } from "primereact/paginator";
14
+ const lt = ({ label: r, active: t, onClick: s, disabled: a }) => a ? /* @__PURE__ */ e(M, { dispatch: /* @__PURE__ */ o("button", { className: "text-texts-placeholder text-xs font-semibold cursor-help", children: [
15
15
  " ",
16
- a,
16
+ r,
17
17
  " "
18
- ] }), children: /* @__PURE__ */ e("div", { className: "flex items-center justify-center px-3 py-2 bg-bg-card rounded-lg border border-border-card", children: /* @__PURE__ */ e("p", { className: "text-texts-placeholder text-xs font-semibold", children: "Espéralo muy pronto..." }) }) }) : /* @__PURE__ */ e("button", { disabled: n, onClick: r, className: `${t ? "text-texts-enfasis border-b-2 border-texts-enfasis" : ""} text-xs font-semibold ${n ? "cursor-not-allowed text-texts-placeholder" : "text-texts-subtext"} `, children: a }), nt = ({ tabs: a, renderItem: t, initialTab: r }) => {
19
- const [n, l] = y(r ?? a[0].toLowerCase());
20
- _(() => {
21
- r && l(r);
22
- }, [r]);
23
- const s = (i) => {
24
- l(i), t(i);
18
+ ] }), children: /* @__PURE__ */ e("div", { className: "flex items-center justify-center px-3 py-2 bg-bg-card rounded-lg border border-border-card", children: /* @__PURE__ */ e("p", { className: "text-texts-placeholder text-xs font-semibold", children: "Espéralo muy pronto..." }) }) }) : /* @__PURE__ */ e("button", { disabled: a, onClick: s, className: `${t ? "text-texts-enfasis border-b-2 border-texts-enfasis" : ""} text-xs font-semibold ${a ? "cursor-not-allowed text-texts-placeholder" : "text-texts-subtext"} `, children: r }), it = ({ tabs: r, renderItem: t, initialTab: s }) => {
19
+ const [a, n] = N(s ?? r[0].toLowerCase());
20
+ T(() => {
21
+ s && n(s);
22
+ }, [s]);
23
+ const l = (i) => {
24
+ n(i), t(i);
25
25
  };
26
- return /* @__PURE__ */ e("div", { className: "flex", children: a.map((i, u) => /* @__PURE__ */ e("div", { className: `${u === 0 ? "border-l-2" : ""} border-r-2 border-gray-200 px-m`, children: /* @__PURE__ */ e(
27
- at,
26
+ return /* @__PURE__ */ e("div", { className: "flex", children: r.map((i, d) => /* @__PURE__ */ e("div", { className: `${d === 0 ? "border-l-2" : ""} border-r-2 border-gray-200 px-m`, children: /* @__PURE__ */ e(
27
+ lt,
28
28
  {
29
- onClick: () => s(i.toLowerCase()),
29
+ onClick: () => l(i.toLowerCase()),
30
30
  label: i,
31
- active: i.toLowerCase() === n,
31
+ active: i.toLowerCase() === a,
32
32
  disabled: ["gantt"].includes(i.toLowerCase())
33
33
  },
34
- u
34
+ d
35
35
  ) })) });
36
- }, P = {
36
+ }, C = {
37
37
  bg: {
38
38
  DEFAULT: "#EFEFEF",
39
39
  content: "#FAFAFA",
@@ -65,7 +65,7 @@ const at = ({ label: a, active: t, onClick: r, disabled: n }) => n ? /* @__PURE_
65
65
  medium: "#EBDBD9",
66
66
  dark: "#8C352C",
67
67
  regular: "#C34335",
68
- pastel: "#C4335"
68
+ pastel: "#C43355"
69
69
  },
70
70
  warning: {
71
71
  light: "#F2ECE5",
@@ -95,195 +95,195 @@ const at = ({ label: a, active: t, onClick: r, disabled: n }) => n ? /* @__PURE_
95
95
  regular: "#0EA5E9",
96
96
  pastel: "#0EA5E9"
97
97
  }
98
- }, le = () => {
99
- const [a, t] = y(null);
98
+ }, ce = () => {
99
+ const [r, t] = N(null);
100
100
  return {
101
101
  //Properties
102
- position: a,
102
+ position: r,
103
103
  //Methods
104
- setElementPosition: (s) => {
105
- var p;
106
- let i = (p = s.current) == null ? void 0 : p.getBoundingClientRect(), u = (i == null ? void 0 : i.x) + ((i == null ? void 0 : i.width) ?? 0), c = (i == null ? void 0 : i.y) + (i == null ? void 0 : i.height);
107
- t(a ? null : { x: u ?? 0, y: c ?? 0 });
104
+ setElementPosition: (l) => {
105
+ var h;
106
+ let i = (h = l.current) == null ? void 0 : h.getBoundingClientRect(), d = (i == null ? void 0 : i.x) + ((i == null ? void 0 : i.width) ?? 0), c = (i == null ? void 0 : i.y) + (i == null ? void 0 : i.height);
107
+ t(r ? null : { x: d ?? 0, y: c ?? 0 });
108
108
  },
109
- getChildrenSize: (s) => {
109
+ getChildrenSize: (l) => {
110
110
  var i;
111
- return (i = s.current) == null ? void 0 : i.getBoundingClientRect();
111
+ return (i = l.current) == null ? void 0 : i.getBoundingClientRect();
112
112
  },
113
113
  clearPosition: () => {
114
114
  t(null);
115
115
  }
116
116
  };
117
- }, rt = ({ children: a, filterChildren: t }) => {
118
- const { position: r, setElementPosition: n } = le(), l = L(null), s = ({ children: i }) => {
119
- const [u, c] = y();
120
- return _(() => {
121
- var p, d;
122
- t.current && c(((r == null ? void 0 : r.x) ?? 0) - (((d = (p = t.current) == null ? void 0 : p.getBoundingClientRect()) == null ? void 0 : d.width) ?? 0));
123
- }, [t == null ? void 0 : t.current, r == null ? void 0 : r.x]), r && X.createPortal(
124
- /* @__PURE__ */ e("div", { className: `absolute w-fit h-fit ${u ? "block" : "hidden"}`, style: { top: `${r == null ? void 0 : r.y}px`, left: `${u}px`, zIndex: 1 }, children: i }),
117
+ }, ot = ({ children: r, filterChildren: t }) => {
118
+ const { position: s, setElementPosition: a } = ce(), n = W(null), l = ({ children: i }) => {
119
+ const [d, c] = N();
120
+ return T(() => {
121
+ var h, u;
122
+ t.current && c(((s == null ? void 0 : s.x) ?? 0) - (((u = (h = t.current) == null ? void 0 : h.getBoundingClientRect()) == null ? void 0 : u.width) ?? 0));
123
+ }, [t == null ? void 0 : t.current, s == null ? void 0 : s.x]), s && ie.createPortal(
124
+ /* @__PURE__ */ e("div", { className: `absolute w-fit h-fit ${d ? "block" : "hidden"}`, style: { top: `${s == null ? void 0 : s.y}px`, left: `${d}px`, zIndex: 1 }, children: i }),
125
125
  document.body
126
126
  );
127
127
  };
128
- return /* @__PURE__ */ o(q, { children: [
128
+ return /* @__PURE__ */ o(D, { children: [
129
129
  /* @__PURE__ */ o(
130
130
  "label",
131
131
  {
132
- ref: l,
132
+ ref: n,
133
133
  htmlFor: "filter-button",
134
134
  className: "flex cursor-pointer items-center gap-m p-s text-texts-enfasis fill-texts-enfasis bg-bg rounded-lg px-l h-[30px] shadow-button-primary hover:shadow-button-primary-hover ",
135
135
  children: [
136
- /* @__PURE__ */ e(C, { icon: "filter", size: "xs", strokeWidth: 5, color: P.primary.regular }),
136
+ /* @__PURE__ */ e(F, { icon: "filter", size: "xs", strokeWidth: 5, color: C.primary.regular }),
137
137
  "Filtrar"
138
138
  ]
139
139
  }
140
140
  ),
141
141
  /* @__PURE__ */ e("button", { className: "hidden", id: "filter-button", onClick: () => {
142
- n(l);
142
+ a(n);
143
143
  } }),
144
- /* @__PURE__ */ e(s, { children: a })
144
+ /* @__PURE__ */ e(l, { children: r })
145
145
  ] });
146
- }, ye = (a) => {
146
+ }, Fe = (r) => {
147
147
  let t = {};
148
- return Object.entries(a).forEach(([r, n]) => {
149
- if (r.includes(".")) {
150
- let [l, s] = r.split(".");
151
- t[l] = t[l] || {}, t[l][s] = n;
148
+ return Object.entries(r).forEach(([s, a]) => {
149
+ if (s.includes(".")) {
150
+ let [n, l] = s.split(".");
151
+ t[n] = t[n] || {}, t[n][l] = a;
152
152
  } else
153
- t[r] = n;
153
+ t[s] = a;
154
154
  }), t;
155
- }, Te = V({}), lt = ({ children: a }) => {
156
- const [t, r] = y({}), [n, l] = y({}), [s, i] = y([]), [u, c] = y(""), p = ({ name: m, value: x }) => {
157
- function w(v) {
158
- return !isNaN(v) && v !== null && v !== "" ? parseFloat(v) : null;
155
+ }, Me = G({}), ct = ({ children: r }) => {
156
+ const [t, s] = N({}), [a, n] = N({}), [l, i] = N([]), [d, c] = N(""), h = ({ name: m, value: x }) => {
157
+ function f(g) {
158
+ return !isNaN(g) && g !== null && g !== "" ? parseFloat(g) : null;
159
159
  }
160
- let f = w(x);
161
- l((v) => {
162
- let b = { ...v }, N = s == null ? void 0 : s.find((F) => F.label.toLowerCase().replace(/ /g, "_") === m);
163
- return N ? b[N.id] = f ?? x : b[m] = f ?? x, b;
160
+ let w = f(x);
161
+ n((g) => {
162
+ let v = { ...g }, y = l == null ? void 0 : l.find((_) => _.label.toLowerCase().replace(/ /g, "_") === m);
163
+ return y ? v[y.id] = w ?? x : v[m] = w ?? x, v;
164
164
  });
165
165
  };
166
- _(() => {
167
- let m = s.map((x) => x.id === "owner.config" ? [x.id, "yo_y_mis_equipos"] : x.id === "dependency" ? [x.id, "ambas"] : [x.id, null]);
168
- l(
166
+ T(() => {
167
+ let m = l.map((x) => x.id === "owner.config" ? [x.id, "yo_y_mis_equipos"] : x.id === "dependency" ? [x.id, "ambas"] : [x.id, null]);
168
+ n(
169
169
  Object.fromEntries(m)
170
170
  );
171
- }, [s]);
172
- const d = () => {
173
- let m = s.map((x) => x.id === "owner.config" ? [x.id, "yo_y_mis_equipos"] : x.id === "dependency" ? [x.id, "ambas"] : [x.id, null]);
174
- l(Object.fromEntries(m)), r(ye(Object.fromEntries(m)));
175
- }, g = () => {
176
- let m = ye(n);
177
- console.log({ filtersWithEstructure: m }), r(m);
171
+ }, [l]);
172
+ const u = () => {
173
+ let m = l.map((x) => x.id === "owner.config" ? [x.id, "yo_y_mis_equipos"] : x.id === "dependency" ? [x.id, "ambas"] : [x.id, null]);
174
+ n(Object.fromEntries(m)), s(Fe(Object.fromEntries(m)));
175
+ }, b = () => {
176
+ let m = Fe(a);
177
+ console.log({ filtersWithEstructure: m }), s(m);
178
178
  };
179
- return /* @__PURE__ */ e(Te.Provider, { value: {
179
+ return /* @__PURE__ */ e(Me.Provider, { value: {
180
180
  //properties
181
- fields: s,
181
+ fields: l,
182
182
  filters: t,
183
- path: u,
183
+ path: d,
184
184
  //methods
185
185
  defineFields: i,
186
- updateFilters: p,
187
- cleanFilters: d,
188
- applyFilters: g,
189
- initialFilters: n,
186
+ updateFilters: h,
187
+ cleanFilters: u,
188
+ applyFilters: b,
189
+ initialFilters: a,
190
190
  selectPath: c
191
- }, children: a });
192
- }, $ = () => G(Te);
193
- function Pe(a, t = 300, r = { leading: !1, trailing: !0 }) {
194
- let n, l = null;
195
- return function(...s) {
196
- const i = Date.now(), u = r.leading && !l;
197
- clearTimeout(n), u && a(...s), l = i, n = setTimeout(() => {
198
- r.trailing && (!r.leading || i - l >= t) && (a(...s), l = null);
191
+ }, children: r });
192
+ }, $ = () => Y(Me);
193
+ function $e(r, t = 300, s = { leading: !1, trailing: !0 }) {
194
+ let a, n = null;
195
+ return function(...l) {
196
+ const i = Date.now(), d = s.leading && !n;
197
+ clearTimeout(a), d && r(...l), n = i, a = setTimeout(() => {
198
+ s.trailing && (!s.leading || i - n >= t) && (r(...l), n = null);
199
199
  }, t);
200
200
  };
201
201
  }
202
- const st = () => {
202
+ const dt = () => {
203
203
  const {
204
- fields: a,
204
+ fields: r,
205
205
  updateFilters: t,
206
- cleanFilters: r,
207
- applyFilters: n,
208
- initialFilters: l
206
+ cleanFilters: s,
207
+ applyFilters: a,
208
+ initialFilters: n
209
209
  } = $();
210
210
  return /* @__PURE__ */ o("div", { className: "flex flex-col gap-l min-w-[250px] z-[100]", children: [
211
211
  /* @__PURE__ */ o("div", { className: "flex justify-between items-center", children: [
212
212
  /* @__PURE__ */ e("p", { className: "text-texts text-m", children: "Filtros" }),
213
- /* @__PURE__ */ e("button", { className: "text-xs font-semibold flex cursor-pointer items-center gap-m p-s text-texts-enfasis fill-texts-enfasis bg-bg rounded-lg px-l h-fit shadow-button-primary hover:shadow-button-primary-hover ", onClick: r, children: "Limpiar" })
213
+ /* @__PURE__ */ e("button", { className: "text-xs font-semibold flex cursor-pointer items-center gap-m p-s text-texts-enfasis fill-texts-enfasis bg-bg rounded-lg px-l h-fit shadow-button-primary hover:shadow-button-primary-hover ", onClick: s, children: "Limpiar" })
214
214
  ] }),
215
- /* @__PURE__ */ e("div", { className: "flex flex-col gap-m", children: a == null ? void 0 : a.map((s, i) => {
216
- var u;
215
+ /* @__PURE__ */ e("div", { className: "flex flex-col gap-m", children: r == null ? void 0 : r.map((l, i) => {
216
+ var d;
217
217
  return /* @__PURE__ */ o("div", { children: [
218
- /* @__PURE__ */ e("p", { className: "text-sm", children: s.label }),
219
- (s == null ? void 0 : s.type) === "select" ? /* @__PURE__ */ e(
218
+ /* @__PURE__ */ e("p", { className: "text-sm", children: l.label }),
219
+ (l == null ? void 0 : l.type) === "select" ? /* @__PURE__ */ e(
220
220
  "select",
221
221
  {
222
222
  onChange: (c) => {
223
- var p, d;
223
+ var h, u;
224
224
  t({
225
- name: (p = c == null ? void 0 : c.target) == null ? void 0 : p.name,
226
- value: (d = c == null ? void 0 : c.target) == null ? void 0 : d.value
225
+ name: (h = c == null ? void 0 : c.target) == null ? void 0 : h.name,
226
+ value: (u = c == null ? void 0 : c.target) == null ? void 0 : u.value
227
227
  });
228
228
  },
229
- value: l == null ? void 0 : l[s == null ? void 0 : s.id],
229
+ value: n == null ? void 0 : n[l == null ? void 0 : l.id],
230
230
  className: "w-full h-[30px] shadow-input rounded-lg p-s",
231
- name: s.id,
232
- id: s.id,
233
- children: (u = s == null ? void 0 : s.options) == null ? void 0 : u.map((c, p) => /* @__PURE__ */ e(
231
+ name: l.id,
232
+ id: l.id,
233
+ children: (d = l == null ? void 0 : l.options) == null ? void 0 : d.map((c, h) => /* @__PURE__ */ e(
234
234
  "option",
235
235
  {
236
236
  value: c.id,
237
237
  children: c.name
238
238
  },
239
- p
239
+ h
240
240
  ))
241
241
  }
242
242
  ) : /* @__PURE__ */ e(
243
243
  "input",
244
244
  {
245
245
  className: "w-full h-[30px] shadow-input rounded-lg p-s",
246
- type: s.type,
247
- value: l == null ? void 0 : l[s == null ? void 0 : s.id],
248
- name: s.label.toLowerCase().replace(/ /g, "_"),
249
- onChange: Pe((c) => {
250
- var p, d;
246
+ type: l.type,
247
+ value: n == null ? void 0 : n[l == null ? void 0 : l.id],
248
+ name: l.label.toLowerCase().replace(/ /g, "_"),
249
+ onChange: $e((c) => {
250
+ var h, u;
251
251
  return t({
252
- name: (p = c == null ? void 0 : c.target) == null ? void 0 : p.name,
253
- value: (d = c == null ? void 0 : c.target) == null ? void 0 : d.value
252
+ name: (h = c == null ? void 0 : c.target) == null ? void 0 : h.name,
253
+ value: (u = c == null ? void 0 : c.target) == null ? void 0 : u.value
254
254
  });
255
255
  }, 1e3)
256
256
  }
257
257
  )
258
258
  ] }, i);
259
259
  }) }),
260
- /* @__PURE__ */ e("button", { className: "btn-primary rounded-md py-s", onClick: n, children: "Filtrar" })
260
+ /* @__PURE__ */ e("button", { className: "btn-primary rounded-md py-s", onClick: a, children: "Filtrar" })
261
261
  ] });
262
- }, z = (a) => {
263
- const t = (n) => Object.prototype.toString.call(n) === "[object Object]", r = (n) => n.attributes ? {
264
- id: n.id,
265
- ...n.attributes
266
- } : n;
267
- if (Array.isArray(a))
268
- return a.map((n) => z(n));
269
- if (t(a)) {
270
- Array.isArray(a.data) ? a = [...a.data] : t(a.data) ? a = r({ ...a.data }) : a.data === null ? a = null : a = r(a);
271
- for (const n in a)
272
- a[n] = z(a[n]);
273
- return a;
262
+ }, Q = (r) => {
263
+ const t = (a) => Object.prototype.toString.call(a) === "[object Object]", s = (a) => a.attributes ? {
264
+ id: a.id,
265
+ ...a.attributes
266
+ } : a;
267
+ if (Array.isArray(r))
268
+ return r.map((a) => Q(a));
269
+ if (t(r)) {
270
+ Array.isArray(r.data) ? r = [...r.data] : t(r.data) ? r = s({ ...r.data }) : r.data === null ? r = null : r = s(r);
271
+ for (const a in r)
272
+ r[a] = Q(r[a]);
273
+ return r;
274
274
  }
275
- return a;
275
+ return r;
276
276
  };
277
- class it {
277
+ class ut {
278
278
  static toCampaignTasks(t) {
279
- var n, l, s, i, u, c, p, d, g, m, x, w;
280
- let r = [];
281
- return t != null && t.responsable && r.push({ id: t.responsable.id, name: t.responsable.nombre, image: (u = (i = (s = (l = (n = t.responsable) == null ? void 0 : n.userOBP) == null ? void 0 : l.imagen) == null ? void 0 : s.formats) == null ? void 0 : i.thumbnail) == null ? void 0 : u.url }), console.log("task", t), (c = t == null ? void 0 : t.equipo) != null && c.miembros && t.equipo.miembros.forEach((f) => {
282
- var v, b, N, F;
283
- r != null && r.find((T) => T.id === f.idUser.id) || f.idUser && r.push({ id: f.idUser.id, name: f.idUser.nombre, image: (F = (N = (b = (v = f == null ? void 0 : f.userOBP) == null ? void 0 : v.imagen) == null ? void 0 : b.formats) == null ? void 0 : N.thumbnail) == null ? void 0 : F.url });
279
+ var a, n, l, i, d, c, h, u, b, m, x, f;
280
+ let s = [];
281
+ return t != null && t.responsable && s.push({ id: t.responsable.id, name: t.responsable.nombre, image: (d = (i = (l = (n = (a = t.responsable) == null ? void 0 : a.userOBP) == null ? void 0 : n.imagen) == null ? void 0 : l.formats) == null ? void 0 : i.thumbnail) == null ? void 0 : d.url }), console.log("task", t), (c = t == null ? void 0 : t.equipo) != null && c.miembros && t.equipo.miembros.forEach((w) => {
282
+ var g, v, y, _;
283
+ s != null && s.find((q) => q.id === w.idUser.id) || w.idUser && s.push({ id: w.idUser.id, name: w.idUser.nombre, image: (_ = (y = (v = (g = w == null ? void 0 : w.userOBP) == null ? void 0 : g.imagen) == null ? void 0 : v.formats) == null ? void 0 : y.thumbnail) == null ? void 0 : _.url });
284
284
  }), {
285
285
  isPrincipalTask: (t == null ? void 0 : t.tarea_principal) ?? !1,
286
- projectName: ((p = t == null ? void 0 : t.proyecto) == null ? void 0 : p.nombre) ?? null,
286
+ projectName: ((h = t == null ? void 0 : t.proyecto) == null ? void 0 : h.nombre) ?? null,
287
287
  orden: (t == null ? void 0 : t.orden) ?? null,
288
288
  id: (t == null ? void 0 : t.id) ?? null,
289
289
  task: (t == null ? void 0 : t.texto_corto) ?? null,
@@ -293,130 +293,130 @@ class it {
293
293
  endDate: new Date((t == null ? void 0 : t.ffin) ?? null),
294
294
  startDate: new Date((t == null ? void 0 : t.finicio) ?? null),
295
295
  mediumName: (t == null ? void 0 : t.nombre_medio) ?? null,
296
- users: r,
296
+ users: s,
297
297
  repeatsToDo: (t == null ? void 0 : t.repeticiones) ?? null,
298
298
  repeats: (t == null ? void 0 : t.repeticiones_realizadas) ?? null,
299
- comments: ((d = t == null ? void 0 : t.comentarios) == null ? void 0 : d.length) ?? null,
299
+ comments: ((u = t == null ? void 0 : t.comentarios) == null ? void 0 : u.length) ?? null,
300
300
  willBePaused: t == null ? void 0 : t.es_pausable,
301
- statusRequiredTask: ((g = t == null ? void 0 : t.id_t_requerida) == null ? void 0 : g.estatus) ?? null,
301
+ statusRequiredTask: ((b = t == null ? void 0 : t.id_t_requerida) == null ? void 0 : b.estatus) ?? null,
302
302
  nameRequiredTask: ((m = t == null ? void 0 : t.id_t_requerida) == null ? void 0 : m.texto_corto) ?? null,
303
303
  responsible: ((x = t == null ? void 0 : t.responsable) == null ? void 0 : x.id) ?? null,
304
- tasks: ((w = t == null ? void 0 : t.tareas) == null ? void 0 : w.map((f) => ({ id: f.id, name: f.texto_corto, status: f.estatus }))) ?? null
304
+ tasks: ((f = t == null ? void 0 : t.tareas) == null ? void 0 : f.map((w) => ({ id: w.id, name: w.texto_corto, status: w.estatus }))) ?? null
305
305
  };
306
306
  }
307
307
  }
308
- const ot = async ({ filters: a, tasks_api: t, project: r }) => {
308
+ const mt = async ({ filters: r, tasks_api: t, project: s }) => {
309
309
  try {
310
- const n = await t.get("/api/listado_tareas", {
310
+ const a = await t.get("/api/listado_tareas_flujo", {
311
311
  params: {
312
- ...a,
312
+ ...r,
313
313
  project: {
314
- id: r
314
+ id: s
315
315
  },
316
316
  includeAllTasks: !0
317
317
  }
318
318
  });
319
- return z(n.data.tareas).map(it.toCampaignTasks);
320
- } catch (n) {
321
- console.log(n);
319
+ return Q(a.data.tareas).map(ut.toCampaignTasks);
320
+ } catch (a) {
321
+ console.log(a);
322
322
  }
323
- }, Ae = V({}), ct = ({ children: a, user: t, url: r }) => {
324
- const n = ve.create({
325
- baseURL: r,
323
+ }, Ee = G({}), pt = ({ children: r, user: t, url: s }) => {
324
+ const a = Pe.create({
325
+ baseURL: s,
326
326
  headers: {
327
327
  Authorization: `Bearer ${t.accessToken}`
328
328
  },
329
- paramsSerializer: (l) => Ce.stringify(l, { encodeValuesOnly: !0 })
329
+ paramsSerializer: (n) => Se.stringify(n, { encodeValuesOnly: !0 })
330
330
  });
331
331
  return /* @__PURE__ */ e(
332
- Ae.Provider,
332
+ Ee.Provider,
333
333
  {
334
334
  value: {
335
335
  //methods
336
- tasks_api: n
336
+ tasks_api: a
337
337
  },
338
- children: a
338
+ children: r
339
339
  }
340
340
  );
341
- }, E = () => G(Ae), Se = V({}), dt = ({ children: a, user: t, url: r }) => {
342
- const n = ve.create({
343
- baseURL: r,
341
+ }, E = () => Y(Ee), Le = G({}), ht = ({ children: r, user: t, url: s }) => {
342
+ const a = Pe.create({
343
+ baseURL: s,
344
344
  headers: {
345
345
  Authorization: `Bearer ${t.accessToken}`
346
346
  },
347
- paramsSerializer: (l) => Ce.stringify(l, { encodeValuesOnly: !0 })
347
+ paramsSerializer: (n) => Se.stringify(n, { encodeValuesOnly: !0 })
348
348
  });
349
349
  return /* @__PURE__ */ e(
350
- Se.Provider,
350
+ Le.Provider,
351
351
  {
352
352
  value: {
353
353
  //properties
354
354
  user: t,
355
355
  //methods
356
- tasks_api: n
356
+ tasks_api: a
357
357
  },
358
- children: a
358
+ children: r
359
359
  }
360
360
  );
361
- }, I = () => G(Se), qe = V({}), ut = ({ children: a, project: t }) => {
362
- var v;
363
- const r = H(), [n, l] = y([]), [s, i] = y([]), { tasks_api: u } = E(), { filters: c } = $(), { user: p } = I(), [d, g] = y({
361
+ }, O = () => Y(Le), ze = G({}), gt = ({ children: r, project: t }) => {
362
+ var g;
363
+ const s = V(), [a, n] = N([]), [l, i] = N([]), { tasks_api: d } = E(), { filters: c } = $(), { user: h } = O(), [u, b] = N({
364
364
  owner: {
365
- user: p.id,
366
- config: ((v = c == null ? void 0 : c.owner) == null ? void 0 : v.config) ?? "yo_y_mis_equipos"
365
+ user: h.id,
366
+ config: ((g = c == null ? void 0 : c.owner) == null ? void 0 : g.config) ?? "yo_y_mis_equipos"
367
367
  },
368
368
  project: {
369
369
  id: t
370
370
  }
371
- }), m = ae({
371
+ }), m = se({
372
372
  queryKey: ["tasksProject", c, t],
373
- queryFn: () => ot({
373
+ queryFn: () => mt({
374
374
  filters: {
375
- ...d
375
+ ...u
376
376
  },
377
377
  project: t,
378
- tasks_api: u
378
+ tasks_api: d
379
379
  })
380
380
  });
381
- _(() => {
382
- var b;
383
- Object.keys(c).length > 0 && g({
381
+ T(() => {
382
+ var v;
383
+ Object.keys(c).length > 0 && b({
384
384
  ...c,
385
385
  owner: {
386
- user: p.id,
387
- config: ((b = c == null ? void 0 : c.owner) == null ? void 0 : b.config) ?? "yo_y_mis_equipos"
386
+ user: h.id,
387
+ config: ((v = c == null ? void 0 : c.owner) == null ? void 0 : v.config) ?? "yo_y_mis_equipos"
388
388
  },
389
389
  project: {
390
390
  id: t
391
391
  }
392
392
  });
393
- }, [c]), _(() => {
394
- r.invalidateQueries({
393
+ }, [c]), T(() => {
394
+ s.invalidateQueries({
395
395
  queryKey: ["tasksProject", c, t]
396
396
  });
397
- }, [d]);
398
- const x = (b) => {
399
- l((N) => [...N, b]);
400
- }, w = (b) => {
401
- i((N) => N.includes(b) ? N.filter((F) => F !== b) : [...N, b]);
402
- }, f = t ?? null;
397
+ }, [u]);
398
+ const x = (v) => {
399
+ n((y) => [...y, v]);
400
+ }, f = (v) => {
401
+ i((y) => y.includes(v) ? y.filter((_) => _ !== v) : [...y, v]);
402
+ }, w = t ?? null;
403
403
  return /* @__PURE__ */ e(
404
- qe.Provider,
404
+ ze.Provider,
405
405
  {
406
406
  value: {
407
407
  //properties
408
408
  tasksProject: m,
409
- selectedTasks: n,
410
- projectID: f,
411
- openTasks: s,
409
+ selectedTasks: a,
410
+ projectID: w,
411
+ openTasks: l,
412
412
  //methods
413
413
  selectTask: x,
414
- openTask: w
414
+ openTask: f
415
415
  },
416
- children: a
416
+ children: r
417
417
  }
418
418
  );
419
- }, Y = () => G(qe), mt = [
419
+ }, X = () => Y(ze), xt = [
420
420
  {
421
421
  label: "Tipo de dependencia",
422
422
  type: "select",
@@ -467,69 +467,162 @@ const ot = async ({ filters: a, tasks_api: t, project: r }) => {
467
467
  name: "Muy dificil"
468
468
  }]
469
469
  }
470
- ], pt = ({ id: a }) => {
471
- const [t, r] = y(!1);
470
+ ], te = () => {
471
+ const { tasks_api: r } = E(), { user: t } = O(), { filters: s, path: a } = $(), n = V(), { projectID: l } = X(), i = async ({ id: g }) => (await r.put(`/api/tareas/${g}`, {
472
+ data: {
473
+ estatus: 1,
474
+ responsable: t == null ? void 0 : t.id,
475
+ updated_by: t == null ? void 0 : t.id
476
+ }
477
+ })).data, d = async ({ id: g }) => (await r.post("/api/terminarTarea", {
478
+ id_task: g,
479
+ ended_at: (/* @__PURE__ */ new Date()).toISOString(),
480
+ id_user: t == null ? void 0 : t.id
481
+ })).data, c = async ({ id: g, idNewResponsible: v, typeOfSelect: y }) => {
482
+ let _ = {
483
+ updated_by: t == null ? void 0 : t.id
484
+ };
485
+ return y === "responsible" && (_ = { ..._, responsable: v }), y === "team" && (_ = {
486
+ ..._,
487
+ responsable: null,
488
+ equipo: v
489
+ }), (await r.put(`/api/tareas/${g}`, {
490
+ data: _
491
+ })).data;
492
+ }, h = async ({ id: g, data: v, user: y }) => {
493
+ }, u = async ({ id: g }) => {
494
+ await b({ id: g });
495
+ }, { mutateAsync: b } = re({
496
+ mutationFn: i,
497
+ onSuccess: () => {
498
+ const g = {
499
+ "kanban-general": "to_do_tasks",
500
+ "kanban-campania": "tasksProject"
501
+ };
502
+ try {
503
+ a === "kanban-general" && (n.invalidateQueries({ queryKey: [g[a], s] }), n.invalidateQueries({ queryKey: ["working_tasks", s] }), n.invalidateQueries({ queryKey: ["all_tasks"] })), a === "kanban-campania" && (n.invalidateQueries({ queryKey: [g[a], s, l] }), n.invalidateQueries({ queryKey: ["working_tasks", l] }));
504
+ } catch (v) {
505
+ console.error("Error updating the element:", v);
506
+ }
507
+ },
508
+ onError: (g) => {
509
+ console.error("Failed to update the task.", g);
510
+ },
511
+ onMutate: async ({ id: g }) => {
512
+ await n.cancelQueries({ queryKey: ["working_tasks"] }), await n.cancelQueries({ queryKey: ["to_do_tasks"] });
513
+ }
514
+ }), { mutateAsync: m } = re({
515
+ mutationFn: d,
516
+ onSuccess: () => {
517
+ const g = {
518
+ "kanban-general": "to_do_tasks",
519
+ "kanban-campania": "tasksProject"
520
+ };
521
+ try {
522
+ a === "kanban-general" && (n.invalidateQueries({ queryKey: [g[a], s] }), n.invalidateQueries({ queryKey: ["done_tasks", s] }), n.invalidateQueries({ queryKey: ["working_tasks", s] }), n.invalidateQueries({ queryKey: ["all_tasks"] })), a === "kanban-campania" && (n.invalidateQueries({ queryKey: [g[a], s, l] }), n.invalidateQueries({ queryKey: ["done_tasks", l] }), n.invalidateQueries({ queryKey: ["working_tasks", l] }));
523
+ } catch (v) {
524
+ console.error("Error invalidating queries:", v);
525
+ }
526
+ },
527
+ onError: (g) => {
528
+ console.error("Failed to update the task.", g);
529
+ },
530
+ onMutate: async ({ id: g }) => {
531
+ await n.cancelQueries({ queryKey: ["working_tasks"] }), await n.cancelQueries({ queryKey: ["done_tasks"] }), await n.cancelQueries({ queryKey: ["to_do_tasks"] });
532
+ }
533
+ }), { mutateAsync: x } = re({
534
+ mutationFn: c,
535
+ onSuccess: () => {
536
+ const g = {
537
+ "kanban-general": "to_do_tasks",
538
+ "kanban-campania": "tasksProject"
539
+ };
540
+ a === "kanban-general" && (n.invalidateQueries({ queryKey: [g[a], s] }), n.invalidateQueries({ queryKey: ["done_tasks", s] })), a === "kanban-campania" && n.invalidateQueries({ queryKey: [g[a], s, l] });
541
+ }
542
+ });
543
+ return {
544
+ //* Methods
545
+ updateTask: h,
546
+ startWorking: u,
547
+ completeTask: async ({ id: g }) => {
548
+ await m({ id: g });
549
+ },
550
+ reasignResponsible: async ({ id: g, idNewResponsible: v, typeOfSelect: y }) => {
551
+ await x({ id: g, idNewResponsible: v, typeOfSelect: y });
552
+ }
553
+ };
554
+ }, ft = ({ id: r }) => {
555
+ const [t, s] = N(!1), { completeTask: a } = te();
472
556
  return { checked: t, checkTask: () => {
473
- r(!t), console.log("completar tarea", a);
557
+ s(!t), a({ id: r });
474
558
  } };
475
- }, De = ({ id: a, nameRequiredTask: t, statusRequiredTask: r, status: n }) => {
476
- const { checked: l, checkTask: s } = pt({ id: a });
559
+ }, Be = ({ id: r, nameRequiredTask: t, statusRequiredTask: s, status: a }) => {
560
+ const { checked: n, checkTask: l } = ft({ id: r });
477
561
  let i = Math.random().toString();
478
- return /* @__PURE__ */ o(q, { children: [
479
- n === 1 && (r < 2 && t !== "" ? /* @__PURE__ */ e(K, { dispatch: /* @__PURE__ */ e("label", { htmlFor: i, children: /* @__PURE__ */ e(C, { icon: "info_circle", color: P.warning.regular, strokeWidth: 4 }) }), children: /* @__PURE__ */ o("div", { className: "px-m py-s max-w-[200px] bg-warning-light rounded-lg border-l-[5px] border-warning-regular text-warning-dark text-xs", children: [
480
- /* @__PURE__ */ e("p", { className: "font-bold", children: "Requiere completar su tarea requerida:" }),
562
+ return /* @__PURE__ */ o(D, { children: [
563
+ a === 2 && /* @__PURE__ */ e("div", { className: "bg-success-regular rounded-full flex items-center justify-center mx-[2px] transition-all", children: /* @__PURE__ */ e(
564
+ F,
565
+ {
566
+ icon: "circle_checked",
567
+ color: "white",
568
+ strokeWidth: 4,
569
+ size: "xs"
570
+ }
571
+ ) }),
572
+ t !== "" && s === 2 || !t ? a === 1 ? /* @__PURE__ */ e("label", { htmlFor: i, className: n ? "bg-success-regular rounded-full w-[20px] h-[20px] flex items-center justify-center mx-[2px] transition-all" : " transition-colors", children: /* @__PURE__ */ e(
573
+ F,
574
+ {
575
+ icon: n ? "check_outline" : "circle_checked",
576
+ color: n ? "white" : C.texts.placeholder,
577
+ strokeWidth: 4,
578
+ size: n ? "xs" : "s"
579
+ }
580
+ ) }) : /* @__PURE__ */ e(D, { children: " " }) : /* @__PURE__ */ e(M, { dispatch: /* @__PURE__ */ e("label", { className: "cursor-help", children: /* @__PURE__ */ e(F, { icon: "info_circle", color: C.warning.regular, strokeWidth: 4 }) }), children: /* @__PURE__ */ o("div", { className: " p-l max-w-[400px] w-fit bg-warning-light rounded-lg border-l-[5px] border-warning-regular text-warning-dark text-xs flex flex-col gap-m", children: [
581
+ /* @__PURE__ */ e("p", { className: "font-bold", children: " Requiere completar su tarea requerida: " }),
481
582
  /* @__PURE__ */ o("p", { children: [
482
583
  " ",
483
584
  t,
484
585
  " "
485
586
  ] })
486
- ] }) }) : /* @__PURE__ */ e("label", { htmlFor: i, className: l ? "bg-success-regular rounded-full w-[20px] h-[20px] flex items-center justify-center mx-[2px] transition-all" : " transition-colors", children: /* @__PURE__ */ e(
487
- C,
488
- {
489
- icon: l ? "check_outline" : "circle_checked",
490
- color: l ? "white" : P.texts.placeholder,
491
- strokeWidth: 4,
492
- size: l ? "xs" : "s"
493
- }
494
- ) })),
495
- /* @__PURE__ */ e("input", { id: i, checked: l, onChange: s, type: "checkbox", className: "hidden" })
587
+ ] }) }),
588
+ /* @__PURE__ */ e("input", { id: i, checked: n, onChange: l, type: "checkbox", className: "hidden" })
496
589
  ] });
497
- }, O = ({ imageUrl: a = "https://www.uv.unach.mx/assets/img/prueba/directorio/userM.png", alt: t = "avatar" }) => /* @__PURE__ */ e(
590
+ }, U = ({ imageUrl: r = "https://www.uv.unach.mx/assets/img/prueba/directorio/userM.png", alt: t = "avatar" }) => /* @__PURE__ */ e(
498
591
  "img",
499
592
  {
500
- src: a === "" ? "https://www.uv.unach.mx/assets/img/prueba/directorio/userM.png" : a,
593
+ src: r === "" ? "https://www.uv.unach.mx/assets/img/prueba/directorio/userM.png" : r,
501
594
  alt: t ?? "avatar",
502
595
  className: "w-[28px] h-[28px] min-w-[28px] min-h-[28px] rounded-full bg-containers border-2 border-white"
503
596
  }
504
- ), we = ({ trigger: a, user: t, showUser: r = !0 }) => /* @__PURE__ */ e(K, { dispatch: a, children: r && /* @__PURE__ */ o("div", { className: "flex items-center gap-2 bg-containers w-fit h-fit p-2 rounded-lg border-containers", children: [
505
- /* @__PURE__ */ e(O, { imageUrl: t.image ?? "", alt: t.name }),
597
+ ), Te = ({ trigger: r, user: t, showUser: s = !0 }) => /* @__PURE__ */ e(M, { dispatch: r, children: s && /* @__PURE__ */ o("div", { className: "flex items-center gap-2 bg-containers w-fit h-fit p-2 rounded-lg border-containers", children: [
598
+ /* @__PURE__ */ e(U, { imageUrl: t.image ?? "", alt: t.name }),
506
599
  /* @__PURE__ */ e("p", { className: "text-xs font-bold content-text", children: t.name })
507
- ] }) }), ht = ({ options: a, onselect: t }) => {
508
- const [r, n] = y(null), l = Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15), s = [...a].filter((i) => i.name.toLowerCase().includes((r == null ? void 0 : r.toLowerCase()) ?? ""));
600
+ ] }) }), bt = ({ options: r, onselect: t }) => {
601
+ const [s, a] = N(null), n = Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15), l = [...r].filter((i) => i.name.toLowerCase().includes((s == null ? void 0 : s.toLowerCase()) ?? ""));
509
602
  return /* @__PURE__ */ o("div", { className: "h-fit w-full min-w-max", children: [
510
603
  /* @__PURE__ */ o("div", { className: "relative flex items-center", children: [
511
604
  /* @__PURE__ */ e(
512
605
  "input",
513
606
  {
514
- id: l,
515
- value: r ?? "",
516
- onChange: (i) => n(i.target.value),
607
+ id: n,
608
+ value: s ?? "",
609
+ onChange: (i) => a(i.target.value),
517
610
  type: "text",
518
611
  className: "w-full h-[32px] bg-bg-card border-cards rounded-lg p-2",
519
612
  placeholder: "Buscar"
520
613
  }
521
614
  ),
522
- /* @__PURE__ */ e("div", { className: "absolute right-[8px]", children: /* @__PURE__ */ e(C, { icon: "search", size: "xs", strokeWidth: 3 }) })
615
+ /* @__PURE__ */ e("div", { className: "absolute right-[8px]", children: /* @__PURE__ */ e(F, { icon: "search", size: "xs", strokeWidth: 3 }) })
523
616
  ] }),
524
- /* @__PURE__ */ e("div", { className: "bg-bg-card border-cards rounded-lg p-2 flex flex-col gap-s overflow-y-auto max-h-[120px] min-w-max", children: s.map((i) => /* @__PURE__ */ o("button", { onClick: () => {
617
+ /* @__PURE__ */ e("div", { className: "bg-bg-card border-cards rounded-lg p-2 flex flex-col gap-s overflow-y-auto max-h-[120px] min-w-max", children: l.map((i) => /* @__PURE__ */ o("button", { onClick: () => {
525
618
  t(i);
526
619
  }, className: "flex gap-s items-center max-w-[200px] min-w-full hover:bg-primary-light cursor-pointer", children: [
527
- /* @__PURE__ */ e(O, { imageUrl: i.image, alt: i.name }),
620
+ /* @__PURE__ */ e(U, { imageUrl: i.image, alt: i.name }),
528
621
  /* @__PURE__ */ e("p", { className: "text-xs font-bold content-text", children: i.name })
529
622
  ] })) })
530
623
  ] });
531
624
  };
532
- class xt {
625
+ class yt {
533
626
  static toDomain(t) {
534
627
  return {
535
628
  id: t.id,
@@ -538,141 +631,141 @@ class xt {
538
631
  };
539
632
  }
540
633
  }
541
- const gt = () => {
542
- const { tasks_api: a } = E();
543
- return { teams: ae({
634
+ const wt = () => {
635
+ const { tasks_api: r } = E();
636
+ return { teams: se({
544
637
  queryKey: ["teams", "all"],
545
638
  queryFn: async () => {
546
- const r = await a.get("/api/equipos");
547
- return z(r.data).map(xt.toDomain);
639
+ const s = await r.get("/api/equipos");
640
+ return Q(s.data).map(yt.toDomain);
548
641
  }
549
642
  }) };
550
643
  };
551
- class ft {
644
+ class vt {
552
645
  static toUsers(t) {
553
- var r, n, l;
646
+ var s, a, n;
554
647
  return {
555
648
  id: t.id,
556
649
  name: t.nombre,
557
- image: (l = (n = (r = t.imagen) == null ? void 0 : r.formats) == null ? void 0 : n.thumbnail) == null ? void 0 : l.url
650
+ image: (n = (a = (s = t.imagen) == null ? void 0 : s.formats) == null ? void 0 : a.thumbnail) == null ? void 0 : n.url
558
651
  };
559
652
  }
560
653
  }
561
- const bt = async ({
562
- tasks_api: a
654
+ const Nt = async ({
655
+ tasks_api: r
563
656
  }) => {
564
657
  try {
565
- const t = await a.get("/api/allOBPUsers");
566
- return z(t.data).map(ft.toUsers);
658
+ const t = await r.get("/api/allOBPUsers");
659
+ return Q(t.data).map(vt.toUsers);
567
660
  } catch (t) {
568
661
  throw console.log("Error al obtener los usuarios comerciales", t), `Error al obtener los usuarios comerciales: ${t}`;
569
662
  }
570
- }, yt = () => {
571
- const { tasks_api: a } = E();
663
+ }, Ct = () => {
664
+ const { tasks_api: r } = E();
572
665
  return {
573
- users: ae({
666
+ users: se({
574
667
  queryKey: ["users"],
575
- queryFn: () => bt({ tasks_api: a }),
668
+ queryFn: () => Nt({ tasks_api: r }),
576
669
  staleTime: 1e3 * 60 * 60 * 24
577
670
  })
578
671
  };
579
- }, je = (a) => new Intl.DateTimeFormat("es-MX", { month: "long" }).format(a);
580
- function wt(a) {
581
- const t = ["domingo", "lunes", "martes", "miércoles", "jueves", "viernes", "sábado"], r = new Date(a).getDay();
582
- return t[r];
672
+ }, de = (r) => new Intl.DateTimeFormat("es-MX", { month: "long" }).format(r);
673
+ function _t(r) {
674
+ const t = ["domingo", "lunes", "martes", "miércoles", "jueves", "viernes", "sábado"], s = new Date(r).getDay();
675
+ return t[s];
583
676
  }
584
- const Ne = (a) => {
585
- let t = a || /* @__PURE__ */ new Date(), r = t.getDate(), n = je(t.getMonth()).slice(0, 3), l = t.getFullYear().toString().slice(-2), s = wt(t).slice(0, 3);
586
- return `${s.charAt(0).toUpperCase() + s.slice(1)} ${r} ${n.charAt(0).toUpperCase() + n.slice(1)} ${l}`;
587
- }, se = (a) => ({
588
- ...a,
589
- image: a.image ? `https://devobp.imjmedia.com.mx${a.image}` : ""
590
- }), $e = ({
591
- users: a,
677
+ const qe = (r) => {
678
+ let t = r || /* @__PURE__ */ new Date(), s = t.getDate(), a = de(t.getMonth()).slice(0, 3), n = t.getFullYear().toString().slice(-2), l = _t(t).slice(0, 3);
679
+ return `${l.charAt(0).toUpperCase() + l.slice(1)} ${s} ${a.charAt(0).toUpperCase() + a.slice(1)} ${n}`;
680
+ }, ue = (r) => ({
681
+ ...r,
682
+ image: r.image ? `https://devobp.imjmedia.com.mx${r.image}` : ""
683
+ }), Re = ({
684
+ users: r,
592
685
  onClick: t,
593
- responsible: r
686
+ responsible: s
594
687
  }) => {
595
- let n = `button-assign-users-${Math.random().toString(36).substring(2, 15)}`;
596
- const { setElementPosition: l, position: s, clearPosition: i } = le(), u = L(null), c = () => r ? null : a.length > 3 && /* @__PURE__ */ e(
597
- K,
688
+ let a = `button-assign-users-${Math.random().toString(36).substring(2, 15)}`;
689
+ const { setElementPosition: n, position: l, clearPosition: i } = ce(), d = W(null), c = () => s ? null : r.length > 3 && /* @__PURE__ */ e(
690
+ M,
598
691
  {
599
- dispatch: /* @__PURE__ */ e("div", { className: "w-[28px] h-[28px] rounded-full btn-primary flex items-center justify-center border-2 border-white ml-[-8px]", children: /* @__PURE__ */ e("p", { className: "text-xs font-bold text-white ", children: `+${a.length - 3}` }) }),
600
- children: /* @__PURE__ */ e("div", { className: "bg-containers w-fit h-fit p-2 rounded-lg border-containers", children: a == null ? void 0 : a.slice(3).map((m, x) => /* @__PURE__ */ o("div", { className: "flex items-center gap-2 ", children: [
601
- /* @__PURE__ */ e(O, { imageUrl: m.image ?? "", alt: m.name }, x),
692
+ dispatch: /* @__PURE__ */ e("div", { className: "w-[28px] h-[28px] rounded-full btn-primary flex items-center justify-center border-2 border-white ml-[-8px]", children: /* @__PURE__ */ e("p", { className: "text-xs font-bold text-white ", children: `+${r.length - 3}` }) }),
693
+ children: /* @__PURE__ */ e("div", { className: "bg-containers w-fit h-fit p-2 rounded-lg border-containers", children: r == null ? void 0 : r.slice(3).map((m, x) => /* @__PURE__ */ o("div", { className: "flex items-center gap-2 ", children: [
694
+ /* @__PURE__ */ e(U, { imageUrl: m.image ?? "", alt: m.name }, x),
602
695
  /* @__PURE__ */ e("p", { className: "text-xs font-bold content-text", children: m.name })
603
696
  ] }, x)) })
604
697
  }
605
- ), p = () => {
606
- if (r) {
607
- let m = a.find(
608
- (x) => x.id === r
698
+ ), h = () => {
699
+ if (s) {
700
+ let m = r.find(
701
+ (x) => x.id === s
609
702
  );
610
703
  return /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
611
- we,
704
+ Te,
612
705
  {
613
706
  trigger: /* @__PURE__ */ e(
614
- O,
707
+ U,
615
708
  {
616
709
  imageUrl: m == null ? void 0 : m.image,
617
710
  alt: m == null ? void 0 : m.name
618
711
  },
619
- r
712
+ s
620
713
  ),
621
714
  user: m,
622
- showUser: !(s != null && s.x)
715
+ showUser: !(l != null && l.x)
623
716
  }
624
717
  ) });
625
718
  }
626
- return (a == null ? void 0 : a.length) > 0 && a.slice(0, 3).map((m, x) => /* @__PURE__ */ e("div", { className: `${x === 0 ? "" : "ml-[-8px]"}`, children: /* @__PURE__ */ e(
627
- we,
719
+ return (r == null ? void 0 : r.length) > 0 && r.slice(0, 3).map((m, x) => /* @__PURE__ */ e("div", { className: `${x === 0 ? "" : "ml-[-8px]"}`, children: /* @__PURE__ */ e(
720
+ Te,
628
721
  {
629
- trigger: /* @__PURE__ */ e(O, { imageUrl: m.image, alt: m.name }, x),
722
+ trigger: /* @__PURE__ */ e(U, { imageUrl: m.image, alt: m.name }, x),
630
723
  user: m,
631
- showUser: !(s != null && s.x)
724
+ showUser: !(l != null && l.x)
632
725
  }
633
726
  ) }));
634
- }, d = ({ children: m }) => /* @__PURE__ */ e("label", { ref: u, htmlFor: n, className: "cursor-pointer flex items-center", children: m });
635
- if (a.length === 0)
636
- return /* @__PURE__ */ e(d, { children: /* @__PURE__ */ e(C, { icon: "user", size: "xs", strokeWidth: 3 }) });
637
- const g = () => {
638
- var F;
639
- const [m, x] = y(), [w, f] = y("team"), { teams: v } = gt(), { users: b } = yt();
640
- _(() => {
641
- var T, A;
642
- u.current && x(((s == null ? void 0 : s.x) ?? 0) - (((A = (T = u.current) == null ? void 0 : T.getBoundingClientRect()) == null ? void 0 : A.width) ?? 0));
643
- }, [u == null ? void 0 : u.current, s == null ? void 0 : s.x]);
644
- const N = () => {
645
- const T = [
727
+ }, u = ({ children: m }) => /* @__PURE__ */ e("label", { ref: d, htmlFor: a, className: "cursor-pointer flex items-center", children: m });
728
+ if (r.length === 0)
729
+ return /* @__PURE__ */ e(u, { children: /* @__PURE__ */ e(F, { icon: "user", size: "xs", strokeWidth: 3 }) });
730
+ const b = () => {
731
+ var _;
732
+ const [m, x] = N(), [f, w] = N("team"), { teams: g } = wt(), { users: v } = Ct();
733
+ T(() => {
734
+ var q, S;
735
+ d.current && x(((l == null ? void 0 : l.x) ?? 0) - (((S = (q = d.current) == null ? void 0 : q.getBoundingClientRect()) == null ? void 0 : S.width) ?? 0));
736
+ }, [d == null ? void 0 : d.current, l == null ? void 0 : l.x]);
737
+ const y = () => {
738
+ const q = [
646
739
  { id: "team", label: "Equipo" },
647
740
  { id: "responsible", label: "Responsable" }
648
741
  ];
649
- return /* @__PURE__ */ e("div", { className: "w-full flex justify-center gap-l text-texts-placeholder font-bold", children: T.map((A, h) => /* @__PURE__ */ e(
742
+ return /* @__PURE__ */ e("div", { className: "w-full flex justify-center gap-l text-texts-placeholder font-bold", children: q.map((S, z) => /* @__PURE__ */ e(
650
743
  "button",
651
744
  {
652
- className: `w-full text-sm border-texts-placeholder text-center ${w === A.id ? "text-primary-pastel" : ""} ${h === T.length - 1 ? "border-r-0" : " border-r-2"}`,
653
- onClick: () => f(A.id),
654
- children: A.label
745
+ className: `w-full text-sm border-texts-placeholder text-center ${f === S.id ? "text-primary-pastel" : ""} ${z === q.length - 1 ? "border-r-0" : " border-r-2"}`,
746
+ onClick: () => w(S.id),
747
+ children: S.label
655
748
  }
656
749
  )) });
657
750
  };
658
- return (s == null ? void 0 : s.x) && X.createPortal(
751
+ return (l == null ? void 0 : l.x) && ie.createPortal(
659
752
  /* @__PURE__ */ e(
660
753
  "div",
661
754
  {
662
755
  className: `absolute w-[300px] h-fit ${m ? "block" : "hidden"}`,
663
- style: { top: `${s == null ? void 0 : s.y}px`, left: `${m}px`, zIndex: 1 },
756
+ style: { top: `${l == null ? void 0 : l.y}px`, left: `${m}px`, zIndex: 1 },
664
757
  children: /* @__PURE__ */ o("div", { className: "flex flex-col gap-m bg-bg-card border-cards rounded-lg p-2 max-h-[200px] overflow-y-hidden", children: [
665
- /* @__PURE__ */ e(N, {}),
758
+ /* @__PURE__ */ e(y, {}),
666
759
  /* @__PURE__ */ e(
667
- ht,
760
+ bt,
668
761
  {
669
- options: w === "team" ? v.data.map((T) => ({
670
- id: T.id,
671
- name: T.name,
762
+ options: f === "team" ? g.data.map((q) => ({
763
+ id: q.id,
764
+ name: q.name,
672
765
  image: ""
673
- })) : (F = b.data) == null ? void 0 : F.map(se),
674
- onselect: (T) => {
675
- i(), t && t(T);
766
+ })) : (_ = v.data) == null ? void 0 : _.map(ue),
767
+ onselect: (q) => {
768
+ i(), t && t(q, f);
676
769
  }
677
770
  }
678
771
  )
@@ -682,221 +775,138 @@ const Ne = (a) => {
682
775
  document.body
683
776
  );
684
777
  };
685
- return /* @__PURE__ */ o(q, { children: [
686
- /* @__PURE__ */ o(d, { children: [
687
- p(),
778
+ return /* @__PURE__ */ o(D, { children: [
779
+ /* @__PURE__ */ o(u, { children: [
780
+ h(),
688
781
  c()
689
782
  ] }),
690
783
  /* @__PURE__ */ e(
691
784
  "button",
692
785
  {
693
786
  className: "hidden",
694
- id: n,
695
- onClick: () => l(u)
696
- }
697
- ),
698
- /* @__PURE__ */ e(g, {})
699
- ] });
700
- }, Ee = () => {
701
- const { tasks_api: a } = E(), { user: t } = I(), { filters: r, path: n } = $(), l = H(), { projectID: s } = Y(), i = async ({ id: d }) => (await a.put(`/api/tareas/${d}`, {
702
- data: {
703
- estatus: 1,
704
- responsable: t == null ? void 0 : t.id,
705
- updated_by: t == null ? void 0 : t.id
706
- }
707
- })).data, u = async ({ id: d, data: g, user: m }) => {
708
- }, c = async ({ id: d }) => {
709
- await p({ id: d });
710
- }, { mutateAsync: p } = Ke({
711
- mutationFn: i,
712
- onSuccess: () => {
713
- const d = {
714
- "kanban-general": "to_do_tasks",
715
- "kanban-campania": "tasksProject"
716
- };
717
- try {
718
- n === "kanban-general" && (l.invalidateQueries({ queryKey: [d[n], r] }), l.invalidateQueries({ queryKey: ["working_tasks", r] })), n === "kanban-campania" && l.invalidateQueries({ queryKey: [d[n], r, s] });
719
- } catch (g) {
720
- console.error("Error updating the element:", g);
721
- }
722
- },
723
- onError: (d) => {
724
- console.error("Failed to update the task.", d);
725
- }
726
- });
727
- return {
728
- //* Methods
729
- updateTask: u,
730
- startWorking: c
731
- };
732
- }, Be = ({ priority: a, id: t }) => {
733
- const { updateTask: r } = Ee(), n = Math.random().toString(36), [l, s] = y(null), i = (c) => ({
734
- 0: P.primary.regular,
735
- 1: P.success.regular,
736
- 2: P.warning.regular,
737
- 3: P.danger.regular
738
- })[c], u = () => {
739
- if (!l) return null;
740
- const c = ({ priority: p, text: d }) => /* @__PURE__ */ o("button", { onClick: () => {
741
- r({ id: t, data: { prioridad: p }, user: 272 }), s(null);
742
- }, className: "flex gap-m items-center px-l py-s hover:bg-primary-light", children: [
743
- /* @__PURE__ */ e(C, { icon: "flag", size: "xs", strokeWidth: 3, color: i(p) }),
744
- /* @__PURE__ */ e("p", { className: "text-sm", style: { color: i(p) }, children: d })
745
- ] });
746
- return X.createPortal(
747
- /* @__PURE__ */ o("div", { onBlur: () => {
748
- s(null);
749
- }, id: `${n}-options`, style: { top: `${l.y + 5}px`, left: `${l.x + 5}px`, zIndex: 1 }, className: `absolute h-fit p-m flex flex-col gap-2 bg-bg-card rounded-xl shadow-lg
750
- w-max`, children: [
751
- /* @__PURE__ */ e(c, { priority: 0, text: "Baja" }),
752
- /* @__PURE__ */ e(c, { priority: 1, text: "Normal" }),
753
- /* @__PURE__ */ e(c, { priority: 2, text: "Media" }),
754
- /* @__PURE__ */ e(c, { priority: 3, text: "Alta" })
755
- ] }),
756
- document.body
757
- );
758
- };
759
- return /* @__PURE__ */ o("div", { className: "relative h-[22px]", children: [
760
- /* @__PURE__ */ e(
761
- "label",
762
- {
763
- onBlur: () => {
764
- s(null);
765
- },
766
- htmlFor: n,
767
- className: "flex items-center gap-2 cursor-pointer active:opacity-50",
768
- children: /* @__PURE__ */ e(C, { icon: "flag", size: "xs", strokeWidth: 3, color: i(a) })
769
- }
770
- ),
771
- /* @__PURE__ */ e(
772
- "button",
773
- {
774
- id: n,
775
- onClick: (c) => {
776
- s(l ? null : { x: c.clientX, y: c.clientY });
777
- },
778
- className: "hidden"
787
+ id: a,
788
+ onClick: () => n(d)
779
789
  }
780
790
  ),
781
- /* @__PURE__ */ e(u, {})
791
+ /* @__PURE__ */ e(b, {})
782
792
  ] });
783
793
  };
784
- function Nt({ items: a }) {
785
- var n;
786
- const [t, r] = y(1);
787
- return /* @__PURE__ */ o(q, { children: [
788
- /* @__PURE__ */ e("div", { className: "flex flex-row mb-2 border-b border-neutral-100 bg-white mt-4", children: a.map((l, s) => /* @__PURE__ */ e(
794
+ function Ft({ items: r }) {
795
+ var a;
796
+ const [t, s] = N(1);
797
+ return /* @__PURE__ */ o(D, { children: [
798
+ /* @__PURE__ */ e("div", { className: "flex flex-row mb-2 border-b border-neutral-100 bg-white mt-4", children: r.map((n, l) => /* @__PURE__ */ e(
789
799
  "div",
790
800
  {
791
- className: `border-r border-neutral-100 pr-3 py-1 ${s !== 0 ? "px-3" : ""}`,
801
+ className: `border-r border-neutral-100 pr-3 py-1 ${l !== 0 ? "px-3" : ""}`,
792
802
  children: /* @__PURE__ */ e(
793
- Fe,
803
+ je,
794
804
  {
795
805
  variant: "ghost",
796
- onClick: () => r(l.id),
797
- className: `text-sm font-normal rounded-none py-1 h-8 ${t === l.id ? "text-primary border-b border-primary" : "text-neutral-400 border-b-0"}`,
798
- children: l.label
806
+ onClick: () => s(n.id),
807
+ className: `text-sm font-normal rounded-none py-1 h-8 ${t === n.id ? "text-primary border-b border-primary" : "text-neutral-400 border-b-0"}`,
808
+ children: n.label
799
809
  },
800
- l.id
810
+ n.id
801
811
  )
802
812
  },
803
- l.id
813
+ n.id
804
814
  )) }),
805
- /* @__PURE__ */ e("div", { className: "pt-4 flex-1 overflow-y-auto bg-white", children: (n = a.find((l) => l.id === t)) == null ? void 0 : n.component })
815
+ /* @__PURE__ */ e("div", { className: "pt-4 flex-1 overflow-y-auto bg-white", children: (a = r.find((n) => n.id === t)) == null ? void 0 : a.component })
806
816
  ] });
807
817
  }
808
- const Le = "https://devobp.imjmedia.com.mx";
809
- function ie(a) {
810
- return a ? a.split(" ").map((n) => {
811
- var l;
812
- return (l = n[0]) == null ? void 0 : l.toUpperCase();
818
+ const Ke = "https://devobp.imjmedia.com.mx";
819
+ function me(r) {
820
+ return r ? r.split(" ").map((a) => {
821
+ var n;
822
+ return (n = a[0]) == null ? void 0 : n.toUpperCase();
813
823
  }).slice(0, 2).join("") : "";
814
824
  }
815
- const vt = "https://devobp.imjmedia.com.mx";
816
- function Ct({ comment: a }) {
817
- var r, n, l, s, i, u;
825
+ const Tt = "https://devobp.imjmedia.com.mx";
826
+ function qt({ comment: r }) {
827
+ var s, a, n, l, i, d;
818
828
  function t(c) {
819
- const p = He(c);
820
- return Ve(p, { locale: re, addSuffix: !0 });
829
+ const h = Xe(c);
830
+ return Je(h, { locale: oe, addSuffix: !0 });
821
831
  }
822
832
  return /* @__PURE__ */ e("div", { children: /* @__PURE__ */ o("div", { className: "flex flex-row gap-3 items-start", children: [
823
- /* @__PURE__ */ o(J, { className: "w-[28px] h-[28px]", children: [
833
+ /* @__PURE__ */ o(Z, { className: "w-[28px] h-[28px]", children: [
824
834
  /* @__PURE__ */ e(
825
- Z,
835
+ k,
826
836
  {
827
- src: `${vt}${(s = (l = (n = (r = a == null ? void 0 : a.autor) == null ? void 0 : r.imagen) == null ? void 0 : n.formats) == null ? void 0 : l.thumbnail) == null ? void 0 : s.url}`,
837
+ src: `${Tt}${(l = (n = (a = (s = r == null ? void 0 : r.autor) == null ? void 0 : s.imagen) == null ? void 0 : a.formats) == null ? void 0 : n.thumbnail) == null ? void 0 : l.url}`,
828
838
  alt: "@shadcn"
829
839
  }
830
840
  ),
831
- /* @__PURE__ */ e(k, { children: ie((i = a == null ? void 0 : a.autor) == null ? void 0 : i.nombre) })
841
+ /* @__PURE__ */ e(ee, { children: me((i = r == null ? void 0 : r.autor) == null ? void 0 : i.nombre) })
832
842
  ] }),
833
843
  /* @__PURE__ */ o("div", { className: "flex flex-col gap-1", children: [
834
844
  /* @__PURE__ */ o("div", { className: "flex flex-row gap-2", children: [
835
- /* @__PURE__ */ e("p", { className: "text-sm text-neutral-900 font-medium", children: (u = a == null ? void 0 : a.autor) == null ? void 0 : u.nombre }),
836
- /* @__PURE__ */ e("span", { className: "text-xs text-neutral-600 font-normal mt-[2px]", children: t(a == null ? void 0 : a.createdAt) })
845
+ /* @__PURE__ */ e("p", { className: "text-sm text-neutral-900 font-medium", children: (d = r == null ? void 0 : r.autor) == null ? void 0 : d.nombre }),
846
+ /* @__PURE__ */ e("span", { className: "text-xs text-neutral-600 font-normal mt-[2px]", children: t(r == null ? void 0 : r.createdAt) })
837
847
  ] }),
838
- /* @__PURE__ */ e("p", { className: "text-sm text-neutral-600 font-normal", children: a == null ? void 0 : a.comentario })
848
+ /* @__PURE__ */ e("p", { className: "text-sm text-neutral-600 font-normal", children: r == null ? void 0 : r.comentario })
839
849
  ] })
840
850
  ] }) });
841
851
  }
842
- function _t({ currentUser: a, data: t, taskId: r, onNewComment: n }) {
843
- var g, m, x;
844
- const { tasks_api: l } = E(), { register: s, handleSubmit: i, reset: u } = et(), [c, p] = y([]);
845
- return _(() => {
852
+ function At({ currentUser: r, data: t, taskId: s, onNewComment: a }) {
853
+ var b, m, x;
854
+ const { tasks_api: n } = E(), { register: l, handleSubmit: i, reset: d } = nt(), [c, h] = N([]);
855
+ return T(() => {
846
856
  if (t != null && t.comentarios) {
847
- const w = [...t.comentarios].sort(
848
- (f, v) => new Date(v.createdAt).getTime() - new Date(f.createdAt).getTime()
857
+ const f = [...t.comentarios].sort(
858
+ (w, g) => new Date(g.createdAt).getTime() - new Date(w.createdAt).getTime()
849
859
  );
850
- p(w);
860
+ h(f);
851
861
  }
852
862
  }, [t]), /* @__PURE__ */ o("div", { className: "flex flex-col h-full gap-4", children: [
853
- /* @__PURE__ */ o("form", { onSubmit: i(async (w) => {
863
+ /* @__PURE__ */ o("form", { onSubmit: i(async (f) => {
854
864
  try {
855
- const f = {
865
+ const w = {
856
866
  autor: {
857
- id: a == null ? void 0 : a.id,
858
- email: a == null ? void 0 : a.email,
859
- nombre: a == null ? void 0 : a.nombre,
860
- imagen: a == null ? void 0 : a.imagen
867
+ id: r == null ? void 0 : r.id,
868
+ email: r == null ? void 0 : r.email,
869
+ nombre: r == null ? void 0 : r.nombre,
870
+ imagen: r == null ? void 0 : r.imagen
861
871
  },
862
- comentario: w == null ? void 0 : w.comment,
872
+ comentario: f == null ? void 0 : f.comment,
863
873
  createdAt: (/* @__PURE__ */ new Date()).toISOString()
864
874
  };
865
- await l.post("/api/comentarios", {
875
+ await n.post("/api/comentarios", {
866
876
  data: {
867
- autor: a == null ? void 0 : a.id,
868
- comentario: w.comment,
869
- tarea: r
877
+ autor: r == null ? void 0 : r.id,
878
+ comentario: f.comment,
879
+ tarea: s
870
880
  }
871
- }), n(!0), p((v) => [f, ...v]), u();
872
- } catch (f) {
873
- console.error("Error al agregar comentario:", f);
881
+ }), a(!0), h((g) => [w, ...g]), d();
882
+ } catch (w) {
883
+ console.error("Error al agregar comentario:", w);
874
884
  }
875
885
  }), className: "flex flex-row items-center gap-3", children: [
876
- /* @__PURE__ */ o(J, { className: "w-[28px] h-[28px]", children: [
886
+ /* @__PURE__ */ o(Z, { className: "w-[28px] h-[28px]", children: [
877
887
  /* @__PURE__ */ e(
878
- Z,
888
+ k,
879
889
  {
880
- src: `${Le}${(x = (m = (g = a == null ? void 0 : a.imagen) == null ? void 0 : g.formats) == null ? void 0 : m.thumbnail) == null ? void 0 : x.url}`,
890
+ src: `${Ke}${(x = (m = (b = r == null ? void 0 : r.imagen) == null ? void 0 : b.formats) == null ? void 0 : m.thumbnail) == null ? void 0 : x.url}`,
881
891
  alt: "@shadcn"
882
892
  }
883
893
  ),
884
- /* @__PURE__ */ e(k, { className: "border border-x-primary-pastel", children: ie(a == null ? void 0 : a.nombre) })
894
+ /* @__PURE__ */ e(ee, { className: "border border-x-primary-pastel", children: me(r == null ? void 0 : r.nombre) })
885
895
  ] }),
886
896
  /* @__PURE__ */ e(
887
- Ge,
897
+ Ze,
888
898
  {
889
- ...s("comment", { required: !0 }),
899
+ ...l("comment", { required: !0 }),
890
900
  autoComplete: "off",
891
901
  placeholder: "Escribe un comentario",
892
902
  className: "w-full bg-white border border-neutral-200"
893
903
  }
894
904
  )
895
905
  ] }),
896
- c.map((w, f) => /* @__PURE__ */ e(Ct, { comment: w }, f))
906
+ c.map((f, w) => /* @__PURE__ */ e(qt, { comment: f }, w))
897
907
  ] });
898
908
  }
899
- function Ft({ data: a }) {
909
+ function Pt({ data: r }) {
900
910
  const t = {
901
911
  0: {
902
912
  color: "bg-gray-400",
@@ -914,59 +924,59 @@ function Ft({ data: a }) {
914
924
  color: "bg-success-regular",
915
925
  label: "Finalizada"
916
926
  }
917
- }, r = (n) => n ? _e(new Date(n), "d MMM", { locale: re }) : "";
927
+ }, s = (a) => a ? De(new Date(a), "d MMM", { locale: oe }) : "";
918
928
  return /* @__PURE__ */ o("div", { children: [
919
929
  /* @__PURE__ */ o("div", { className: "flex flex-row items-center gap-4", children: [
920
- /* @__PURE__ */ e(Ye, { className: "text-lg font-medium text-neutral-900", children: "Tareas dependientes" }),
921
- /* @__PURE__ */ e("span", { className: "text-sm font-normal text-neutral-600 bg-[#E1EBF9] w-6 h-6 rounded-full flex items-center justify-center text-primary", children: a == null ? void 0 : a.length })
930
+ /* @__PURE__ */ e(ke, { className: "text-lg font-medium text-neutral-900", children: "Tareas dependientes" }),
931
+ /* @__PURE__ */ e("span", { className: "text-sm font-normal text-neutral-600 bg-[#E1EBF9] w-6 h-6 rounded-full flex items-center justify-center text-primary", children: r == null ? void 0 : r.length })
922
932
  ] }),
923
- /* @__PURE__ */ e("div", { className: "flex flex-col gap-2 border border-neutral-200 rounded-lg mt-3", children: a == null ? void 0 : a.map((n) => {
924
- var l, s, i, u, c;
933
+ /* @__PURE__ */ e("div", { className: "flex flex-col gap-2 border border-neutral-200 rounded-lg mt-3", children: r == null ? void 0 : r.map((a) => {
934
+ var n, l, i, d, c;
925
935
  return /* @__PURE__ */ o(
926
936
  "div",
927
937
  {
928
938
  className: "flex flex-row w-full items-center justify-between gap-s border-b border-neutral-200 py-1 px-2",
929
939
  children: [
930
940
  /* @__PURE__ */ o("div", { className: "flex items-center gap-2", children: [
931
- /* @__PURE__ */ e(O, { imageUrl: (u = (i = (s = (l = n.responsable) == null ? void 0 : l.image) == null ? void 0 : s.formats) == null ? void 0 : i.thumbnail) == null ? void 0 : u.url }),
932
- /* @__PURE__ */ e("p", { className: "text-sm font-normal w-[400px] text-nowrap text-ellipsis overflow-hidden", children: n == null ? void 0 : n.texto_corto })
941
+ /* @__PURE__ */ e(U, { imageUrl: (d = (i = (l = (n = a.responsable) == null ? void 0 : n.image) == null ? void 0 : l.formats) == null ? void 0 : i.thumbnail) == null ? void 0 : d.url }),
942
+ /* @__PURE__ */ e("p", { className: "text-sm font-normal w-[400px] text-nowrap text-ellipsis overflow-hidden", children: a == null ? void 0 : a.texto_corto })
933
943
  ] }),
934
944
  /* @__PURE__ */ o("div", { className: "flex items-center gap-1", children: [
935
- /* @__PURE__ */ e("p", { className: "text-sm font-normal", children: r(n == null ? void 0 : n.createdAt) }),
945
+ /* @__PURE__ */ e("p", { className: "text-sm font-normal", children: s(a == null ? void 0 : a.createdAt) }),
936
946
  /* @__PURE__ */ e(
937
947
  "div",
938
948
  {
939
- className: `w-4 h-4 bg-gray-400 block rounded-full ${((c = t[n == null ? void 0 : n.estatus]) == null ? void 0 : c.color) ?? "bg-gray-400"}`
949
+ className: `w-4 h-4 bg-gray-400 block rounded-full ${((c = t[a == null ? void 0 : a.estatus]) == null ? void 0 : c.color) ?? "bg-gray-400"}`
940
950
  }
941
951
  )
942
952
  ] })
943
953
  ]
944
954
  },
945
- n.id
955
+ a.id
946
956
  );
947
957
  }) })
948
958
  ] });
949
959
  }
950
- const Tt = "https://devobp.imjmedia.com.mx";
951
- function Pt({ isOpen: a, setIsOpen: t, taskId: r }) {
952
- var w, f, v, b, N, F, T, A, h, S, D;
953
- const [n, l] = y(null), [s, i] = y(!1), [u, c] = y(null), { tasks_api: p } = E(), { user: d } = I();
954
- _(() => {
955
- if (a && r || s) {
956
- const j = async () => {
957
- const B = await p.get(`/api/detalleTarea/${r}`);
958
- l(B == null ? void 0 : B.data);
959
- }, M = async () => {
960
- var U, Q;
961
- const B = await p.get(`/api/users/${d.id}`), R = await p.post("/api/obtenerUsuarioOBP/", {
962
- emailList: [(U = B == null ? void 0 : B.data) == null ? void 0 : U.email]
960
+ const St = "https://devobp.imjmedia.com.mx";
961
+ function Dt({ isOpen: r, setIsOpen: t, taskId: s }) {
962
+ var f, w, g, v, y, _, q, S, z, B, R;
963
+ const [a, n] = N(null), [l, i] = N(!1), [d, c] = N(null), { tasks_api: h } = E(), { user: u } = O();
964
+ T(() => {
965
+ if (r && s || l) {
966
+ const p = async () => {
967
+ const P = await h.get(`/api/detalleTarea/${s}`);
968
+ n(P == null ? void 0 : P.data);
969
+ }, A = async () => {
970
+ var I, L;
971
+ const P = await h.get(`/api/users/${u.id}`), j = await h.post("/api/obtenerUsuarioOBP/", {
972
+ emailList: [(I = P == null ? void 0 : P.data) == null ? void 0 : I.email]
963
973
  });
964
- c((Q = R == null ? void 0 : R.data) == null ? void 0 : Q.data[0]);
974
+ c((L = j == null ? void 0 : j.data) == null ? void 0 : L.data[0]);
965
975
  };
966
- j(), M();
976
+ p(), A();
967
977
  }
968
- }, [a, r, s]);
969
- const g = {
978
+ }, [r, s, l]);
979
+ const b = {
970
980
  0: {
971
981
  label: "Sin prioridad",
972
982
  color: "text-primary-regular",
@@ -987,18 +997,18 @@ function Pt({ isOpen: a, setIsOpen: t, taskId: r }) {
987
997
  color: "text-danger-regular",
988
998
  iconColor: "#C34335"
989
999
  }
990
- }, m = (j) => j ? _e(j, "d MMM yyyy, h:mmaaa", {
991
- locale: re
1000
+ }, m = (p) => p ? De(p, "d MMM yyyy, h:mmaaa", {
1001
+ locale: oe
992
1002
  }) : "Fecha no disponible", x = [
993
1003
  {
994
1004
  id: 1,
995
1005
  label: "Todo",
996
1006
  component: /* @__PURE__ */ e(
997
- _t,
1007
+ At,
998
1008
  {
999
- taskId: r,
1000
- currentUser: u,
1001
- data: n,
1009
+ taskId: s,
1010
+ currentUser: d,
1011
+ data: a,
1002
1012
  onNewComment: i
1003
1013
  }
1004
1014
  )
@@ -1006,232 +1016,276 @@ function Pt({ isOpen: a, setIsOpen: t, taskId: r }) {
1006
1016
  {
1007
1017
  id: 2,
1008
1018
  label: "Dependencias",
1009
- component: /* @__PURE__ */ e(Ft, { data: n == null ? void 0 : n.ids_t_dependientes })
1019
+ component: /* @__PURE__ */ e(Pt, { data: a == null ? void 0 : a.ids_t_dependientes })
1010
1020
  }
1011
1021
  ];
1012
- return /* @__PURE__ */ e(q, { children: /* @__PURE__ */ o(q, { children: [
1022
+ return /* @__PURE__ */ e(D, { children: /* @__PURE__ */ o(D, { children: [
1013
1023
  /* @__PURE__ */ e(
1014
1024
  "div",
1015
1025
  {
1016
- className: `fixed inset-0 bg-transparent bg-opacity-50 flex justify-center items-center z-20 ${a ? "pointer-events-auto block" : "pointer-events-none hidden"}`,
1026
+ className: `fixed inset-0 bg-transparent bg-opacity-50 flex justify-center items-center z-20 ${r ? "pointer-events-auto block" : "pointer-events-none hidden"}`,
1017
1027
  onClick: () => t(!1)
1018
1028
  }
1019
1029
  ),
1020
1030
  /* @__PURE__ */ e(
1021
1031
  "section",
1022
1032
  {
1023
- className: `fixed top-0 bottom-0 bg-white bg-opacity-50 flex justify-center items-center w-[40rem] h-screen z-50 overflow-hidden transition-all ease-in-out duration-500 shadow-2xl ${a ? "right-0 pointer-events-auto block" : "right-[-100%] pointer-events-none hidden"}`,
1033
+ className: `fixed top-0 bottom-0 bg-white bg-opacity-50 flex justify-center items-center w-[40rem] h-screen z-50 overflow-hidden transition-all ease-in-out duration-500 shadow-2xl ${r ? "right-0 pointer-events-auto block" : "right-[-100%] pointer-events-none hidden"}`,
1024
1034
  children: /* @__PURE__ */ o("div", { className: "flex w-full h-full flex-col overflow-y-scroll bg-white border-none shadow-xl px-4 py-6", children: [
1025
1035
  /* @__PURE__ */ o("div", { className: "w-full flex flex-row justify-between pb-4 gap-10 border-none", children: [
1026
- /* @__PURE__ */ e("h3", { className: "text-lg font-semibold text-neutral-900", children: n == null ? void 0 : n.texto_corto }),
1036
+ /* @__PURE__ */ e("h3", { className: "text-lg font-semibold text-neutral-900", children: a == null ? void 0 : a.texto_corto }),
1027
1037
  /* @__PURE__ */ e(
1028
- Fe,
1038
+ je,
1029
1039
  {
1030
1040
  variant: "shadow",
1031
1041
  size: "sm",
1032
1042
  onClick: () => t(!1),
1033
1043
  className: "bg-neutral-100 w-10 h-10",
1034
- children: /* @__PURE__ */ e(C, { icon: "x_outline" })
1044
+ children: /* @__PURE__ */ e(F, { icon: "x_outline" })
1035
1045
  }
1036
1046
  )
1037
1047
  ] }),
1038
1048
  /* @__PURE__ */ e("div", { className: "w-full flex flex-row justify-between", children: /* @__PURE__ */ o("span", { className: "text-neutral-600 text-sm", children: [
1039
- n == null ? void 0 : n.campania,
1049
+ a == null ? void 0 : a.campania,
1040
1050
  " / ",
1041
- n == null ? void 0 : n.nombre_medio
1051
+ a == null ? void 0 : a.nombre_medio
1042
1052
  ] }) }),
1043
1053
  /* @__PURE__ */ o("div", { className: "w-full flex flex-col gap-3 mt-4", children: [
1044
1054
  /* @__PURE__ */ e("h6", { className: "text-neutral-900 font-semibold text-base", children: "Descripción" }),
1045
- /* @__PURE__ */ e("p", { className: "text-neutral-600 font-normal text-sm", children: (n == null ? void 0 : n.texto_largo) ?? "Sin descripción" })
1055
+ /* @__PURE__ */ e("p", { className: "text-neutral-600 font-normal text-sm", children: (a == null ? void 0 : a.texto_largo) ?? "Sin descripción" })
1046
1056
  ] }),
1047
1057
  /* @__PURE__ */ e(
1048
- Xe,
1058
+ et,
1049
1059
  {
1050
1060
  type: "single",
1051
1061
  collapsible: !0,
1052
1062
  defaultValue: "item-1",
1053
1063
  className: "w-full flex flex-col border border-neutral-200 rounded-xl mt-4",
1054
- children: /* @__PURE__ */ o(Je, { value: "item-1", className: "border-none", children: [
1055
- /* @__PURE__ */ e(Ze, { className: "text-neutral-900 font-medium text-sm w-full flex flex-row border-b border-neutral-200 p-4 ", children: "Detalles" }),
1056
- /* @__PURE__ */ e(ke, { className: "border-none", children: /* @__PURE__ */ o("div", { className: "w-full grid grid-cols-3 gap-4 p-4", children: [
1064
+ children: /* @__PURE__ */ o(tt, { value: "item-1", className: "border-none", children: [
1065
+ /* @__PURE__ */ e(at, { className: "text-neutral-900 font-medium text-sm w-full flex flex-row border-b border-neutral-200 p-4 ", children: "Detalles" }),
1066
+ /* @__PURE__ */ e(rt, { className: "border-none", children: /* @__PURE__ */ o("div", { className: "w-full grid grid-cols-3 gap-4 p-4", children: [
1057
1067
  /* @__PURE__ */ o("div", { className: "flex flex-col w-auto gap-2", children: [
1058
1068
  /* @__PURE__ */ e("span", { className: "text-sm text-neutral-900 font-medium", children: "Responsable" }),
1059
- (w = n == null ? void 0 : n.responsable) != null && w.nombre ? /* @__PURE__ */ o("div", { className: "flex flex-row gap-2 items-center", children: [
1060
- /* @__PURE__ */ o(J, { className: "w-[28px] h-[28px]", children: [
1069
+ (f = a == null ? void 0 : a.responsable) != null && f.nombre ? /* @__PURE__ */ o("div", { className: "flex flex-row gap-2 items-center", children: [
1070
+ /* @__PURE__ */ o(Z, { className: "w-[28px] h-[28px]", children: [
1061
1071
  /* @__PURE__ */ e(
1062
- Z,
1072
+ k,
1063
1073
  {
1064
- src: `${Tt}${(N = (b = (v = (f = n == null ? void 0 : n.responsable) == null ? void 0 : f.imagen) == null ? void 0 : v.formats) == null ? void 0 : b.thumbnail) == null ? void 0 : N.url}`,
1074
+ src: `${St}${(y = (v = (g = (w = a == null ? void 0 : a.responsable) == null ? void 0 : w.imagen) == null ? void 0 : g.formats) == null ? void 0 : v.thumbnail) == null ? void 0 : y.url}`,
1065
1075
  alt: "@shadcn"
1066
1076
  }
1067
1077
  ),
1068
- /* @__PURE__ */ e(k, { children: ie((F = n == null ? void 0 : n.responsable) == null ? void 0 : F.nombre) })
1078
+ /* @__PURE__ */ e(ee, { children: me((_ = a == null ? void 0 : a.responsable) == null ? void 0 : _.nombre) })
1069
1079
  ] }),
1070
- /* @__PURE__ */ e("span", { className: "text-xs text-neutral-600 font-normal", children: (T = n == null ? void 0 : n.responsable) == null ? void 0 : T.nombre })
1080
+ /* @__PURE__ */ e("span", { className: "text-xs text-neutral-600 font-normal", children: (q = a == null ? void 0 : a.responsable) == null ? void 0 : q.nombre })
1071
1081
  ] }) : /* @__PURE__ */ e("span", { className: "text-xs text-neutral-600 font-normal", children: "Sin responsable" })
1072
1082
  ] }),
1073
1083
  /* @__PURE__ */ o("div", { className: "flex flex-col w-auto gap-2", children: [
1074
1084
  /* @__PURE__ */ e("span", { className: "text-sm text-neutral-900 font-medium", children: "Equipo asignado" }),
1075
- /* @__PURE__ */ e("div", { className: "flex flex-row gap-2", children: /* @__PURE__ */ e("span", { className: "text-xs text-neutral-600 font-normal", children: ((A = n == null ? void 0 : n.equipo) == null ? void 0 : A.nombre) ?? "Sin equipo" }) })
1085
+ /* @__PURE__ */ e("div", { className: "flex flex-row gap-2", children: /* @__PURE__ */ e("span", { className: "text-xs text-neutral-600 font-normal", children: ((S = a == null ? void 0 : a.equipo) == null ? void 0 : S.nombre) ?? "Sin equipo" }) })
1076
1086
  ] }),
1077
1087
  /* @__PURE__ */ o("div", { className: "flex flex-col w-auto gap-2", children: [
1078
1088
  /* @__PURE__ */ e("span", { className: "text-sm text-neutral-900 font-medium", children: "Prioridad" }),
1079
1089
  /* @__PURE__ */ o("div", { className: "flex flex-row items-center gap-2", children: [
1080
1090
  /* @__PURE__ */ e(
1081
- C,
1091
+ F,
1082
1092
  {
1083
1093
  icon: "flag",
1084
1094
  size: "xs",
1085
1095
  strokeWidth: 5,
1086
- color: (h = g[n == null ? void 0 : n.prioridad]) == null ? void 0 : h.iconColor
1096
+ color: (z = b[a == null ? void 0 : a.prioridad]) == null ? void 0 : z.iconColor
1087
1097
  }
1088
1098
  ),
1089
1099
  /* @__PURE__ */ e(
1090
1100
  "span",
1091
1101
  {
1092
- className: `text-sm text-neutral-600 font-normal ${(S = g[n == null ? void 0 : n.prioridad]) == null ? void 0 : S.color}`,
1093
- children: ((D = g[n == null ? void 0 : n.prioridad]) == null ? void 0 : D.label) ?? "Sin prioridad"
1102
+ className: `text-sm text-neutral-600 font-normal ${(B = b[a == null ? void 0 : a.prioridad]) == null ? void 0 : B.color}`,
1103
+ children: ((R = b[a == null ? void 0 : a.prioridad]) == null ? void 0 : R.label) ?? "Sin prioridad"
1094
1104
  }
1095
1105
  )
1096
1106
  ] })
1097
1107
  ] }),
1098
1108
  /* @__PURE__ */ o("div", { className: "flex flex-col w-auto gap-2", children: [
1099
1109
  /* @__PURE__ */ e("span", { className: "text-sm text-neutral-900 font-medium", children: "Lista" }),
1100
- /* @__PURE__ */ e("div", { className: "flex flex-row gap-2", children: /* @__PURE__ */ e("span", { className: "text-xs text-neutral-600 font-normal", children: (n == null ? void 0 : n.lista) ?? "Sin lista" }) })
1110
+ /* @__PURE__ */ e("div", { className: "flex flex-row gap-2", children: /* @__PURE__ */ e("span", { className: "text-xs text-neutral-600 font-normal", children: (a == null ? void 0 : a.lista) ?? "Sin lista" }) })
1101
1111
  ] }),
1102
1112
  /* @__PURE__ */ o("div", { className: "flex flex-col w-auto gap-2", children: [
1103
1113
  /* @__PURE__ */ e("span", { className: "text-sm text-neutral-900 font-medium", children: "Fecha estimada de inicio" }),
1104
- /* @__PURE__ */ e("p", { className: "text-xs text-neutral-600 font-normal", children: m(n == null ? void 0 : n.f_inicio_estimada) })
1114
+ /* @__PURE__ */ e("p", { className: "text-xs text-neutral-600 font-normal", children: m(a == null ? void 0 : a.f_inicio_estimada) })
1105
1115
  ] }),
1106
1116
  /* @__PURE__ */ o("div", { className: "flex flex-col w-auto gap-2", children: [
1107
1117
  /* @__PURE__ */ e("span", { className: "text-sm text-neutral-900 font-medium", children: "Fecha estimada de fin" }),
1108
- /* @__PURE__ */ e("p", { className: "text-xs text-neutral-600 font-normal", children: m(n == null ? void 0 : n.f_fin_estimada) })
1118
+ /* @__PURE__ */ e("p", { className: "text-xs text-neutral-600 font-normal", children: m(a == null ? void 0 : a.f_fin_estimada) })
1109
1119
  ] }),
1110
1120
  /* @__PURE__ */ o("div", { className: "flex flex-col w-auto gap-2", children: [
1111
1121
  /* @__PURE__ */ e("span", { className: "text-sm text-neutral-900 font-medium", children: "Fecha de fin" }),
1112
- /* @__PURE__ */ e("p", { className: "text-xs text-neutral-600 font-normal", children: m(n == null ? void 0 : n.ffin) })
1122
+ /* @__PURE__ */ e("p", { className: "text-xs text-neutral-600 font-normal", children: m(a == null ? void 0 : a.ffin) })
1113
1123
  ] }),
1114
1124
  /* @__PURE__ */ o("div", { className: "flex flex-col w-auto gap-2", children: [
1115
1125
  /* @__PURE__ */ e("span", { className: "text-sm text-neutral-900 font-medium", children: "Creado" }),
1116
- /* @__PURE__ */ e("p", { className: "text-xs text-neutral-600 font-normal", children: m(n == null ? void 0 : n.createdAt) })
1126
+ /* @__PURE__ */ e("p", { className: "text-xs text-neutral-600 font-normal", children: m(a == null ? void 0 : a.createdAt) })
1117
1127
  ] }),
1118
1128
  /* @__PURE__ */ o("div", { className: "flex flex-col w-auto gap-2", children: [
1119
1129
  /* @__PURE__ */ e("span", { className: "text-sm text-neutral-900 font-medium", children: "Última modificación" }),
1120
- /* @__PURE__ */ e("p", { className: "text-xs text-neutral-600 font-normal", children: m(n == null ? void 0 : n.updatedAt) })
1130
+ /* @__PURE__ */ e("p", { className: "text-xs text-neutral-600 font-normal", children: m(a == null ? void 0 : a.updatedAt) })
1121
1131
  ] })
1122
1132
  ] }) })
1123
1133
  ] })
1124
1134
  }
1125
1135
  ),
1126
- /* @__PURE__ */ e(Nt, { items: x })
1136
+ /* @__PURE__ */ e(Ft, { items: x })
1127
1137
  ] })
1128
1138
  }
1129
1139
  )
1130
1140
  ] }) });
1131
1141
  }
1132
- const At = ({
1133
- id: a,
1134
- task: t,
1135
- endDate: r,
1136
- users: n,
1137
- willBePaused: l,
1138
- nameProject: s,
1139
- idProject: i,
1140
- comments: u,
1141
- priority: c,
1142
- responsible: p,
1143
- nameRequiredTask: d,
1144
- statusRequiredTask: g,
1145
- status: m
1142
+ const Ie = ({
1143
+ status: r,
1144
+ nameRequiredTask: t,
1145
+ statusRequiredTask: s,
1146
+ id: a
1146
1147
  }) => {
1147
- const x = L(null), [w, f] = y(!1), { setElementPosition: v, position: b } = le(), { startWorking: N } = Ee(), F = L(!1), T = ({ children: h }) => {
1148
- const [S, D] = y();
1149
- return _(() => {
1150
- var j, M;
1151
- x.current && D(
1152
- ((b == null ? void 0 : b.x) ?? 0) - (((M = (j = x.current) == null ? void 0 : j.getBoundingClientRect()) == null ? void 0 : M.width) ?? 0)
1148
+ const { setElementPosition: n, position: l } = ce(), { startWorking: i, completeTask: d } = te(), c = W(null), h = W(!1);
1149
+ console.log(
1150
+ {
1151
+ status: r,
1152
+ nameRequiredTask: t,
1153
+ statusRequiredTask: s,
1154
+ moreActionsRef: c,
1155
+ isLoading: h,
1156
+ position: l,
1157
+ id: a
1158
+ }
1159
+ );
1160
+ const u = ({ children: b }) => {
1161
+ const [m, x] = N();
1162
+ return T(() => {
1163
+ var f, w;
1164
+ c.current && x(
1165
+ ((l == null ? void 0 : l.x) ?? 0) - (((w = (f = c.current) == null ? void 0 : f.getBoundingClientRect()) == null ? void 0 : w.width) ?? 0)
1153
1166
  );
1154
- }, [x == null ? void 0 : x.current, b == null ? void 0 : b.x]), b && X.createPortal(
1167
+ }, [c == null ? void 0 : c.current, l == null ? void 0 : l.x]), l && ie.createPortal(
1155
1168
  /* @__PURE__ */ e(
1156
1169
  "div",
1157
1170
  {
1158
- className: `absolute w-fit h-fit ${S ? "block" : "hidden"}`,
1159
- style: { top: `${b == null ? void 0 : b.y}px`, left: `${S}px`, zIndex: 1 },
1160
- children: h
1171
+ className: `absolute w-fit h-fit ${m ? "block" : "hidden"}`,
1172
+ style: { top: `${l == null ? void 0 : l.y}px`, left: `${m}px`, zIndex: 1 },
1173
+ children: b
1161
1174
  }
1162
1175
  ),
1163
1176
  document.body
1164
1177
  );
1165
1178
  };
1166
- return /* @__PURE__ */ o(q, { children: [
1167
- /* @__PURE__ */ o("div", { className: "bg-bg-card border-cards max-w-[350px] rounded-lg relative h-fit p-[12px_12px] hover:border-active hover:bg-active cursor-pointer ", children: [
1168
- /* @__PURE__ */ e(() => /* @__PURE__ */ o("div", { className: "flex justify-between items-center w-full h-fit relative", children: [
1169
- /* @__PURE__ */ o("div", { className: "flex items-center gap-[8px] w-[calc(100%-32px)] ", children: [
1179
+ return /* @__PURE__ */ o(D, { children: [
1180
+ r < 2 && (t !== "" && s === 2 || !t) && /* @__PURE__ */ e(
1181
+ "button",
1182
+ {
1183
+ ref: c,
1184
+ onClick: () => {
1185
+ n(c);
1186
+ },
1187
+ className: "flex items-center justify-center text-sm font-extrabold bg-bg hover:filter-[drop-shadow(0_0_10px_#000000)] rounded-full w-[24px] h-[24px] m-block",
1188
+ children: /* @__PURE__ */ e("span", { className: "rotate-90", children: /* @__PURE__ */ e(F, { icon: "elipsis", size: "xs" }) })
1189
+ }
1190
+ ),
1191
+ /* @__PURE__ */ e(u, { children: h != null && h.current ? /* @__PURE__ */ e("div", { className: "w-max h-fit bg-bg-card rounded-lg p-l shadow-lg flex items-center gap-2 hover:bg-primary-light", children: /* @__PURE__ */ e("p", { className: "text-sm font-normal text-primary-pastel font-regular", children: "Moviendo..." }) }) : /* @__PURE__ */ o(
1192
+ "button",
1193
+ {
1194
+ className: "w-max h-fit bg-bg-card rounded-lg p-l shadow-lg flex items-center gap-2 hover:bg-primary-light",
1195
+ onClick: () => {
1196
+ h.current = !0, r === 0 ? i({ id: a }) : d({ id: a });
1197
+ },
1198
+ children: [
1199
+ /* @__PURE__ */ e("p", { className: "text-sm font-normal text-texts-placeholder font-regular", children: r === 0 ? "Mover a trabajando" : "Mover a completadas" }),
1170
1200
  /* @__PURE__ */ e(
1171
- De,
1201
+ F,
1172
1202
  {
1173
- id: a,
1174
- nameRequiredTask: d ?? "",
1175
- statusRequiredTask: g ?? 0,
1176
- status: m
1203
+ icon: "arrow_right",
1204
+ size: "xs",
1205
+ strokeWidth: 4,
1206
+ color: C.primary.regular
1177
1207
  }
1178
- ),
1179
- /* @__PURE__ */ e("p", { className: "title-text", onClick: () => f(!0), children: t })
1180
- ] }),
1181
- m < 2 && /* @__PURE__ */ e(
1182
- "button",
1183
- {
1184
- ref: x,
1185
- onClick: () => {
1186
- v(x);
1187
- },
1188
- className: "flex items-center justify-center text-sm font-extrabold bg-bg hover:filter-[drop-shadow(0_0_10px_#000000)] rounded-full w-[24px] h-[24px] m-block",
1189
- children: /* @__PURE__ */ e("span", { className: "rotate-90", children: /* @__PURE__ */ e(C, { icon: "elipsis", size: "xs" }) })
1190
- }
1191
- ),
1192
- /* @__PURE__ */ e(T, { children: F != null && F.current ? /* @__PURE__ */ e("div", { className: "w-max h-fit bg-bg-card rounded-lg p-l shadow-lg flex items-center gap-2 hover:bg-primary-light", children: /* @__PURE__ */ e("p", { className: "text-sm font-normal text-primary-pastel font-regular", children: "Moviendo..." }) }) : /* @__PURE__ */ o(
1193
- "button",
1194
- {
1195
- className: "w-max h-fit bg-bg-card rounded-lg p-l shadow-lg flex items-center gap-2 hover:bg-primary-light",
1196
- onClick: () => {
1197
- F.current = !0, m === 0 && N({ id: a });
1198
- },
1199
- children: [
1200
- /* @__PURE__ */ e("p", { className: "text-sm font-normal text-texts-placeholder font-regular", children: m === 0 ? "Mover a trabajando" : "Mover a completadas" }),
1201
- /* @__PURE__ */ e(
1202
- C,
1203
- {
1204
- icon: "arrow_right",
1205
- size: "xs",
1206
- strokeWidth: 4,
1207
- color: P.primary.regular
1208
- }
1209
- )
1210
- ]
1211
- }
1212
- ) })
1213
- ] }), {}),
1208
+ )
1209
+ ]
1210
+ }
1211
+ ) })
1212
+ ] });
1213
+ }, jt = ({
1214
+ id: r,
1215
+ task: t,
1216
+ endDate: s,
1217
+ users: a,
1218
+ willBePaused: n,
1219
+ nameProject: l,
1220
+ idProject: i,
1221
+ comments: d,
1222
+ priority: c,
1223
+ difficulty: h,
1224
+ responsible: u,
1225
+ nameRequiredTask: b,
1226
+ statusRequiredTask: m,
1227
+ status: x
1228
+ }) => {
1229
+ var q, S, z, B, R, p;
1230
+ const [f, w] = N(!1), { reasignResponsible: g } = te(), v = () => /* @__PURE__ */ o("div", { className: "flex justify-between items-center w-full h-fit relative", children: [
1231
+ /* @__PURE__ */ o("div", { className: "flex items-center gap-[8px] w-[calc(100%-32px)] ", children: [
1232
+ x < 2 && /* @__PURE__ */ e(
1233
+ Be,
1234
+ {
1235
+ id: r,
1236
+ nameRequiredTask: b ?? "",
1237
+ statusRequiredTask: m ?? 0,
1238
+ status: x
1239
+ }
1240
+ ),
1241
+ /* @__PURE__ */ e("p", { className: "title-text", onClick: () => w(!0), children: t })
1242
+ ] }),
1243
+ /* @__PURE__ */ e(
1244
+ Ie,
1245
+ {
1246
+ id: r,
1247
+ nameRequiredTask: b,
1248
+ status: x,
1249
+ statusRequiredTask: m
1250
+ }
1251
+ )
1252
+ ] }), y = {
1253
+ 0: { title: "N/A", color: C.texts.placeholder },
1254
+ 1: { title: "Baja", color: C.primary.regular },
1255
+ 2: { title: "Media", color: C.success.regular },
1256
+ 3: { title: "Alta", color: C.danger.regular }
1257
+ }, _ = {
1258
+ 0: { title: "Muy fácil", color: C.primary.regular },
1259
+ 1: { title: "Fácil", color: C.success.regular },
1260
+ 2: { title: "Media", color: C.warning.regular },
1261
+ 3: { title: "Difícil", color: C.danger.regular },
1262
+ 4: { title: "Muy difícil", color: C.danger.dark }
1263
+ };
1264
+ return /* @__PURE__ */ o(D, { children: [
1265
+ /* @__PURE__ */ o("div", { className: "bg-bg-card border-cards max-w-[350px] rounded-lg relative h-fit p-[12px_12px] hover:border-active hover:bg-active cursor-pointer ", children: [
1266
+ /* @__PURE__ */ e(v, {}),
1214
1267
  /* @__PURE__ */ o("div", { className: "flex flex-col gap-[4px] py-2", children: [
1215
- /* @__PURE__ */ e("p", { className: "subtitle-text", children: s }),
1268
+ /* @__PURE__ */ e("p", { className: "subtitle-text", children: l }),
1216
1269
  i && // TODO: Add nameMEDIUM
1217
1270
  /* @__PURE__ */ e("p", { className: "content-text", children: i })
1218
1271
  ] }),
1219
1272
  /* @__PURE__ */ o("div", { className: "flex justify-between items-center w-full h-fit relative pt-5 pb-1", children: [
1220
1273
  /* @__PURE__ */ o("div", { className: "flex items-center relative", children: [
1221
1274
  /* @__PURE__ */ e(
1222
- $e,
1275
+ Re,
1223
1276
  {
1224
- responsible: p,
1225
- users: n.filter((h) => p ? h.id === p : !0).map(se),
1226
- onClick: () => {
1277
+ responsible: u,
1278
+ users: a.filter((A) => u ? A.id === u : !0).map(ue),
1279
+ onClick: async (A, P) => {
1280
+ await g({ idNewResponsible: A == null ? void 0 : A.id, id: r, typeOfSelect: P });
1227
1281
  }
1228
1282
  }
1229
1283
  ),
1230
- l && /* @__PURE__ */ e(
1231
- K,
1284
+ n && /* @__PURE__ */ e(
1285
+ M,
1232
1286
  {
1233
1287
  dispatch: /* @__PURE__ */ o("button", { className: "text-sm font-regular text-gray-400 flex items-center gap-2", children: [
1234
- /* @__PURE__ */ e(C, { icon: "pause", size: "s", strokeWidth: 2 }),
1288
+ /* @__PURE__ */ e(F, { icon: "pause", size: "s", strokeWidth: 2 }),
1235
1289
  /* @__PURE__ */ e("span", { children: "Pause" })
1236
1290
  ] }),
1237
1291
  children: /* @__PURE__ */ e("p", { className: "text-sm font-regular text-white p-5", children: "Al pulsar el botón se solicitará razón del pausado" })
@@ -1239,28 +1293,70 @@ const At = ({
1239
1293
  )
1240
1294
  ] }),
1241
1295
  /* @__PURE__ */ o("div", { className: "flex items-center gap-2", children: [
1242
- /* @__PURE__ */ e(C, { icon: "difficulty", size: "xs" }),
1243
- /* @__PURE__ */ e(Be, { priority: c, id: a }),
1244
1296
  /* @__PURE__ */ e(
1245
- C,
1297
+ M,
1298
+ {
1299
+ dispatch: /* @__PURE__ */ e(
1300
+ F,
1301
+ {
1302
+ icon: "difficulty",
1303
+ size: "xs",
1304
+ color: (q = _[h ?? 0]) == null ? void 0 : q.color,
1305
+ strokeWidth: 4
1306
+ }
1307
+ ),
1308
+ children: /* @__PURE__ */ e(
1309
+ "p",
1310
+ {
1311
+ className: "text-sm font-regular p-5 bg-bg-card rounded-lg",
1312
+ style: { color: (S = _[h ?? 0]) == null ? void 0 : S.color },
1313
+ children: `Dificultad ${(z = _[h ?? 0]) == null ? void 0 : z.title}`
1314
+ }
1315
+ )
1316
+ }
1317
+ ),
1318
+ /* @__PURE__ */ e(
1319
+ M,
1320
+ {
1321
+ dispatch: /* @__PURE__ */ e(
1322
+ F,
1323
+ {
1324
+ icon: "flag",
1325
+ size: "xs",
1326
+ color: (B = y[c ?? 0]) == null ? void 0 : B.color,
1327
+ strokeWidth: 4
1328
+ }
1329
+ ),
1330
+ children: /* @__PURE__ */ e(
1331
+ "p",
1332
+ {
1333
+ className: "text-sm font-regular p-5 bg-bg-card rounded-lg",
1334
+ style: { color: (R = y[c ?? 0]) == null ? void 0 : R.color },
1335
+ children: `Prioridad: ${(p = y[c ?? 0]) == null ? void 0 : p.title}`
1336
+ }
1337
+ )
1338
+ }
1339
+ ),
1340
+ /* @__PURE__ */ e(
1341
+ F,
1246
1342
  {
1247
1343
  icon: "calendar",
1248
1344
  size: "xs",
1249
1345
  strokeWidth: 3,
1250
- color: P.texts.subtext
1346
+ color: C.texts.subtext
1251
1347
  }
1252
1348
  ),
1253
- /* @__PURE__ */ e("p", { className: "text-sm font-regular text-texts-subtext", children: `${r.getDate()} ${je(r.getMonth()).slice(0, 3)}` })
1349
+ /* @__PURE__ */ e("p", { className: "text-sm font-regular text-texts-subtext", children: `${s.getDate()} ${de(s.getMonth()).slice(0, 3)}` })
1254
1350
  ] })
1255
1351
  ] }),
1256
- u > 0 && /* @__PURE__ */ e("div", { className: "border-t border-gray-200 mt-4 pt-2", children: /* @__PURE__ */ o("button", { className: "flex items-center gap-2", children: [
1257
- /* @__PURE__ */ e(C, { icon: "comment", size: "xs", strokeWidth: 4 }),
1258
- /* @__PURE__ */ e("span", { className: "text-sm font-regular text-gray-400", children: u })
1352
+ d > 0 && /* @__PURE__ */ e("div", { className: "border-t border-gray-200 mt-4 pt-2", children: /* @__PURE__ */ o("button", { className: "flex items-center gap-2", children: [
1353
+ /* @__PURE__ */ e(F, { icon: "comment", size: "xs", strokeWidth: 4 }),
1354
+ /* @__PURE__ */ e("span", { className: "text-sm font-regular text-gray-400", children: d })
1259
1355
  ] }) })
1260
1356
  ] }),
1261
- /* @__PURE__ */ e(Pt, { taskId: a, isOpen: w, setIsOpen: f })
1357
+ /* @__PURE__ */ e(Dt, { taskId: r, isOpen: f, setIsOpen: w })
1262
1358
  ] });
1263
- }, St = () => /* @__PURE__ */ o("div", { className: "bg-gray-200 h-[150px] w-full animate-pulse rounded-md flex flex-col gap-[50px] p-4", children: [
1359
+ }, Mt = () => /* @__PURE__ */ o("div", { className: "bg-gray-200 h-[150px] w-full animate-pulse rounded-md flex flex-col gap-[50px] p-4", children: [
1264
1360
  /* @__PURE__ */ o("div", { className: "flex h-[30px] gap-3", children: [
1265
1361
  /* @__PURE__ */ e("div", { className: "w-[30px] min-w-[30px] h-full bg-gray-300 rounded-full" }),
1266
1362
  /* @__PURE__ */ e("div", { className: "w-full h-full bg-gray-300" }),
@@ -1270,42 +1366,42 @@ const At = ({
1270
1366
  /* @__PURE__ */ e("div", { className: "w-full h-[30px] bg-gray-300" }),
1271
1367
  /* @__PURE__ */ e("div", { className: "w-full h-[30px] bg-gray-300" })
1272
1368
  ] })
1273
- ] }), ee = ({ title: a, tasks: t, loadNextPage: r, isFetching: n, total: l }) => {
1274
- const s = L(null), i = L(null), u = L(!1);
1275
- _(() => {
1276
- var d;
1277
- s != null && s.current && (i != null && i.current) && (i.current.style.minHeight = `${((d = s == null ? void 0 : s.current) == null ? void 0 : d.clientHeight) - 50}px`);
1278
- }, [s == null ? void 0 : s.current]);
1279
- const c = (d) => {
1280
- if (u.current) return;
1281
- const { scrollTop: g, clientHeight: m, scrollHeight: x } = d == null ? void 0 : d.target, w = g / (x - m) * 100;
1282
- w <= 95 || w >= 95 && (u.current = !0, r && r(), setTimeout(() => {
1283
- u.current = !1;
1369
+ ] }), ae = ({ title: r, tasks: t, loadNextPage: s, isFetching: a, total: n }) => {
1370
+ const l = W(null), i = W(null), d = W(!1);
1371
+ T(() => {
1372
+ var u;
1373
+ l != null && l.current && (i != null && i.current) && (i.current.style.minHeight = `${((u = l == null ? void 0 : l.current) == null ? void 0 : u.clientHeight) - 50}px`);
1374
+ }, [l == null ? void 0 : l.current]);
1375
+ const c = (u) => {
1376
+ if (d.current) return;
1377
+ const { scrollTop: b, clientHeight: m, scrollHeight: x } = u == null ? void 0 : u.target, f = b / (x - m) * 100;
1378
+ f <= 95 || f >= 95 && (d.current = !0, s && s(), setTimeout(() => {
1379
+ d.current = !1;
1284
1380
  }, 200));
1285
1381
  };
1286
1382
  return /* @__PURE__ */ o(
1287
1383
  "div",
1288
1384
  {
1289
- ref: s,
1385
+ ref: l,
1290
1386
  className: ` flex flex-col bg-containers w-fit max-w-[400px] min-w-[400px] h-full min-h-[100%] pb-[200px] relative p-[16px] rounded-lg overflow-hidden border-t-4 ${{
1291
1387
  "Por hacer": "border-texts-placeholder",
1292
1388
  Trabajando: "border-primary-regular",
1293
1389
  Completadas: "border-success-regular"
1294
- }[a]}`,
1390
+ }[r]}`,
1295
1391
  children: [
1296
1392
  /* @__PURE__ */ o("div", { className: "flex justify-between items-center", children: [
1297
- /* @__PURE__ */ e("div", { className: "flex items-center gap-[8px]", children: /* @__PURE__ */ e("p", { className: "text-base", children: a }) }),
1393
+ /* @__PURE__ */ e("div", { className: "flex items-center gap-[8px]", children: /* @__PURE__ */ e("p", { className: "text-base", children: r }) }),
1298
1394
  /* @__PURE__ */ e("div", { className: "flex items-center gap-[8px]", children: /* @__PURE__ */ o("div", { className: "flex items-center gap-[4px]", children: [
1299
1395
  /* @__PURE__ */ e(
1300
- C,
1396
+ F,
1301
1397
  {
1302
1398
  icon: "group_files",
1303
1399
  size: "xs",
1304
1400
  strokeWidth: 5,
1305
- color: P.texts.placeholder
1401
+ color: C.texts.placeholder
1306
1402
  }
1307
1403
  ),
1308
- /* @__PURE__ */ e("p", { className: "text-md text-texts-placeholder", children: l ?? 0 })
1404
+ /* @__PURE__ */ e("p", { className: "text-md text-texts-placeholder", children: n ?? 0 })
1309
1405
  ] }) })
1310
1406
  ] }),
1311
1407
  /* @__PURE__ */ o(
@@ -1315,52 +1411,52 @@ const At = ({
1315
1411
  className: "flex flex-col gap-[12px] overflow-y-auto scrollbar-none py-4",
1316
1412
  onScroll: c,
1317
1413
  children: [
1318
- t == null ? void 0 : t.map((d) => /* @__PURE__ */ e(At, { ...d }, d.id)),
1319
- n ? /* @__PURE__ */ e(St, {}) : /* @__PURE__ */ e("p", { className: "text-center text-gray-500", children: "No hay más tareas por mostrar..." })
1414
+ t == null ? void 0 : t.map((u) => /* @__PURE__ */ e(jt, { ...u }, u.id)),
1415
+ a ? /* @__PURE__ */ e(Mt, {}) : /* @__PURE__ */ e("p", { className: "text-center text-gray-500", children: "No hay más tareas por mostrar..." })
1320
1416
  ]
1321
1417
  }
1322
1418
  )
1323
1419
  ]
1324
1420
  }
1325
1421
  );
1326
- }, qt = () => {
1327
- var l;
1328
- const { defineFields: a } = $(), { tasksProject: t } = Y();
1329
- _(() => {
1422
+ }, $t = () => {
1423
+ var n;
1424
+ const { defineFields: r } = $(), { tasksProject: t } = X();
1425
+ T(() => {
1330
1426
  (async () => {
1331
- let i = [...mt];
1332
- a(i);
1427
+ let i = [...xt];
1428
+ r(i);
1333
1429
  })();
1334
1430
  }, []);
1335
- let r = (l = t == null ? void 0 : t.data) == null ? void 0 : l.filter((s) => {
1431
+ let s = (n = t == null ? void 0 : t.data) == null ? void 0 : n.filter((l) => {
1336
1432
  var i;
1337
- return ((i = s == null ? void 0 : s.tasks) == null ? void 0 : i.length) === 0;
1338
- }).reduce((s, i) => (s[i.status] = s[i.status] || [], s[i.status].push(i), s), {});
1339
- return /* @__PURE__ */ e("div", { className: "flex gap-4 w-full h-full min-h-[100%] relative ", children: ["Por hacer", "Trabajando", "Completadas"].map((s, i) => {
1340
- var u;
1433
+ return ((i = l == null ? void 0 : l.tasks) == null ? void 0 : i.length) === 0;
1434
+ }).reduce((l, i) => (l[i.status] = l[i.status] || [], l[i.status].push(i), l), {});
1435
+ return /* @__PURE__ */ e("div", { className: "flex gap-4 w-full h-full min-h-[100%] relative ", children: ["Por hacer", "Trabajando", "Completadas"].map((l, i) => {
1436
+ var d;
1341
1437
  return /* @__PURE__ */ e(
1342
- ee,
1438
+ ae,
1343
1439
  {
1344
- total: ((u = r == null ? void 0 : r[i]) == null ? void 0 : u.length) ?? 0,
1345
- title: s,
1346
- tasks: (r == null ? void 0 : r[i]) ?? [],
1440
+ total: ((d = s == null ? void 0 : s[i]) == null ? void 0 : d.length) ?? 0,
1441
+ title: l,
1442
+ tasks: (s == null ? void 0 : s[i]) ?? [],
1347
1443
  isFetching: t == null ? void 0 : t.isFetching,
1348
1444
  isLoadingData: t == null ? void 0 : t.isLoading
1349
1445
  }
1350
1446
  );
1351
1447
  }) });
1352
1448
  };
1353
- class Dt {
1449
+ class Et {
1354
1450
  static toKanbanTasks(t) {
1355
- var n, l, s, i, u, c, p, d, g, m, x;
1356
- let r = [];
1357
- return t != null && t.responsable && r.push({ id: t.responsable.id, name: t.responsable.nombre, image: (u = (i = (s = (l = (n = t.responsable) == null ? void 0 : n.userOBP) == null ? void 0 : l.imagen) == null ? void 0 : s.formats) == null ? void 0 : i.thumbnail) == null ? void 0 : u.url }), (c = t == null ? void 0 : t.equipo) != null && c.miembros && t.equipo.miembros.forEach((w) => {
1358
- var f, v, b, N;
1359
- r != null && r.find((F) => F.id === w.idUser.id) || w.idUser && r.push({ id: w.idUser.id, name: w.idUser.nombre, image: (N = (b = (v = (f = w == null ? void 0 : w.userOBP) == null ? void 0 : f.imagen) == null ? void 0 : v.formats) == null ? void 0 : b.thumbnail) == null ? void 0 : N.url });
1451
+ var a, n, l, i, d, c, h, u, b, m, x;
1452
+ let s = [];
1453
+ return t != null && t.responsable && s.push({ id: t.responsable.id, name: t.responsable.nombre, image: (d = (i = (l = (n = (a = t.responsable) == null ? void 0 : a.userOBP) == null ? void 0 : n.imagen) == null ? void 0 : l.formats) == null ? void 0 : i.thumbnail) == null ? void 0 : d.url }), (c = t == null ? void 0 : t.equipo) != null && c.miembros && t.equipo.miembros.forEach((f) => {
1454
+ var w, g, v, y;
1455
+ s != null && s.find((_) => _.id === f.idUser.id) || f.idUser && s.push({ id: f.idUser.id, name: f.idUser.nombre, image: (y = (v = (g = (w = f == null ? void 0 : f.userOBP) == null ? void 0 : w.imagen) == null ? void 0 : g.formats) == null ? void 0 : v.thumbnail) == null ? void 0 : y.url });
1360
1456
  }), {
1361
1457
  comments: 0,
1362
- nameProject: (p = t == null ? void 0 : t.proyecto) == null ? void 0 : p.nombre,
1363
- idProject: (d = t == null ? void 0 : t.proyecto) == null ? void 0 : d.id,
1458
+ nameProject: (h = t == null ? void 0 : t.proyecto) == null ? void 0 : h.nombre,
1459
+ idProject: (u = t == null ? void 0 : t.proyecto) == null ? void 0 : u.id,
1364
1460
  willBePaused: t.es_pausable,
1365
1461
  difficulty: t.nivel_dificultad,
1366
1462
  endDate: new Date(t.ffin),
@@ -1368,231 +1464,231 @@ class Dt {
1368
1464
  priority: t.prioridad ?? 0,
1369
1465
  status: t.estatus,
1370
1466
  task: t.texto_corto,
1371
- users: r,
1372
- responsible: ((g = t == null ? void 0 : t.responsable) == null ? void 0 : g.id) ?? null,
1467
+ users: s,
1468
+ responsible: ((b = t == null ? void 0 : t.responsable) == null ? void 0 : b.id) ?? null,
1373
1469
  statusRequiredTask: ((m = t.id_t_requerida) == null ? void 0 : m.estatus) ?? null,
1374
1470
  nameRequiredTask: ((x = t.id_t_requerida) == null ? void 0 : x.texto_corto) ?? null
1375
1471
  };
1376
1472
  }
1377
1473
  }
1378
- const oe = async ({ filters: a, tasks_api: t }) => {
1474
+ const pe = async ({ filters: r, tasks_api: t }) => {
1379
1475
  try {
1380
- return (await t.get("/api/listado_tareas", { params: a })).data.tareas.map(z).map(Dt.toKanbanTasks);
1381
- } catch (r) {
1382
- throw console.log({ error: r }), `Error al obtener las tareas: ${r}`;
1476
+ return (await t.get("/api/listado_tareas", { params: r })).data.tareas.map(Q).map(Et.toKanbanTasks);
1477
+ } catch (s) {
1478
+ throw console.log({ error: s }), `Error al obtener las tareas: ${s}`;
1383
1479
  }
1384
- }, ce = (a) => {
1480
+ }, he = (r) => {
1385
1481
  var t;
1386
- if (a != null && a.hasNextPage) {
1387
- const r = (t = a == null ? void 0 : a.data) == null ? void 0 : t.pages[a.data.pages.length - 1];
1388
- (r == null ? void 0 : r.length) === 30 && (a == null || a.fetchNextPage());
1482
+ if (r != null && r.hasNextPage) {
1483
+ const s = (t = r == null ? void 0 : r.data) == null ? void 0 : t.pages[r.data.pages.length - 1];
1484
+ (s == null ? void 0 : s.length) === 30 && (r == null || r.fetchNextPage());
1389
1485
  }
1390
- }, W = (a) => ({
1486
+ }, H = (r) => ({
1391
1487
  pagination: {
1392
- page: a,
1488
+ page: r,
1393
1489
  pageSize: 30,
1394
1490
  withCount: !0
1395
1491
  }
1396
- }), jt = () => {
1397
- var p;
1398
- const a = H(), { tasks_api: t } = E(), { user: r } = I(), { filters: n } = $(), [l, s] = y(0), [i, u] = y({
1492
+ }), Lt = () => {
1493
+ var h;
1494
+ const r = V(), { tasks_api: t } = E(), { user: s } = O(), { filters: a } = $(), [n, l] = N(0), [i, d] = N({
1399
1495
  owner: {
1400
- user: r.id,
1401
- config: ((p = n == null ? void 0 : n.owner) == null ? void 0 : p.config) ?? "yo_y_mis_equipos"
1496
+ user: s.id,
1497
+ config: ((h = a == null ? void 0 : a.owner) == null ? void 0 : h.config) ?? "yo_y_mis_equipos"
1402
1498
  },
1403
1499
  status: "por_hacer"
1404
- }), c = ne({
1500
+ }), c = le({
1405
1501
  initialPageParam: 1,
1406
1502
  queryKey: ["to_do_tasks", i],
1407
- queryFn: ({ pageParam: d }) => oe({
1503
+ queryFn: ({ pageParam: u }) => pe({
1408
1504
  filters: {
1409
1505
  ...i,
1410
1506
  status: "por_hacer",
1411
- ...W(d)
1507
+ ...H(u)
1412
1508
  },
1413
1509
  tasks_api: t,
1414
- page: d
1510
+ page: u
1415
1511
  }),
1416
1512
  staleTime: 1e3 * 60 * 60 * 24,
1417
1513
  // mantains the data for 24 hours
1418
- getNextPageParam: (d, g) => g.length + 1
1514
+ getNextPageParam: (u, b) => b.length + 1
1419
1515
  });
1420
- return _(() => {
1421
- var d;
1422
- Object.keys(n).length > 0 && u({
1423
- ...n,
1516
+ return T(() => {
1517
+ var u;
1518
+ Object.keys(a).length > 0 && d({
1519
+ ...a,
1424
1520
  owner: {
1425
- user: r.id,
1426
- config: ((d = n == null ? void 0 : n.owner) == null ? void 0 : d.config) ?? "yo_y_mis_equipos"
1521
+ user: s.id,
1522
+ config: ((u = a == null ? void 0 : a.owner) == null ? void 0 : u.config) ?? "yo_y_mis_equipos"
1427
1523
  },
1428
1524
  status: "por_hacer"
1429
1525
  });
1430
- }, [n]), _(() => {
1431
- a.invalidateQueries({
1526
+ }, [a]), T(() => {
1527
+ r.invalidateQueries({
1432
1528
  queryKey: ["to_do_tasks", i]
1433
1529
  });
1434
- }, [i]), _(() => {
1530
+ }, [i]), T(() => {
1435
1531
  (async () => {
1436
- const g = await t.get("/api/listado_tareas", {
1532
+ const b = await t.get("/api/listado_tareas", {
1437
1533
  params: {
1438
1534
  ...i,
1439
1535
  status: "por_hacer",
1440
- ...W(1),
1536
+ ...H(1),
1441
1537
  tasks_api: t,
1442
1538
  justCount: !0
1443
1539
  }
1444
1540
  });
1445
- s(g.data.total);
1541
+ l(b.data.total);
1446
1542
  })();
1447
1543
  }, [i, c == null ? void 0 : c.data]), {
1448
1544
  //Properties
1449
1545
  toDoTasks: c,
1450
- total: l
1546
+ total: n
1451
1547
  };
1452
- }, $t = () => {
1453
- var n, l;
1454
- const { toDoTasks: a, total: t } = jt(), r = [...((l = (n = a == null ? void 0 : a.data) == null ? void 0 : n.pages) == null ? void 0 : l.flat()) ?? []];
1455
- return /* @__PURE__ */ e(ee, { total: t, title: "Por hacer", tasks: r, loadNextPage: () => ce(a), isFetching: a == null ? void 0 : a.isFetching, isLoadingData: a == null ? void 0 : a.isLoading });
1456
- }, Et = () => {
1457
- var p;
1458
- const a = H(), { tasks_api: t } = E(), { user: r } = I(), { filters: n } = $(), [l, s] = y(0), [i, u] = y({
1548
+ }, zt = () => {
1549
+ var a, n;
1550
+ const { toDoTasks: r, total: t } = Lt(), s = [...((n = (a = r == null ? void 0 : r.data) == null ? void 0 : a.pages) == null ? void 0 : n.flat()) ?? []];
1551
+ return /* @__PURE__ */ e(ae, { total: t, title: "Por hacer", tasks: s, loadNextPage: () => he(r), isFetching: r == null ? void 0 : r.isFetching, isLoadingData: r == null ? void 0 : r.isLoading });
1552
+ }, Bt = () => {
1553
+ var h;
1554
+ const r = V(), { tasks_api: t } = E(), { user: s } = O(), { filters: a } = $(), [n, l] = N(0), [i, d] = N({
1459
1555
  owner: {
1460
- user: r.id,
1461
- config: ((p = n == null ? void 0 : n.owner) == null ? void 0 : p.config) ?? "yo_y_mis_equipos"
1556
+ user: s.id,
1557
+ config: ((h = a == null ? void 0 : a.owner) == null ? void 0 : h.config) ?? "yo_y_mis_equipos"
1462
1558
  },
1463
1559
  status: "trabajando"
1464
- }), c = ne({
1560
+ }), c = le({
1465
1561
  initialPageParam: 1,
1466
- queryKey: ["working_tasks", n],
1467
- queryFn: ({ pageParam: d }) => oe({
1562
+ queryKey: ["working_tasks", a],
1563
+ queryFn: ({ pageParam: u }) => pe({
1468
1564
  filters: {
1469
1565
  ...i,
1470
1566
  status: "trabajando",
1471
- ...W(d)
1567
+ ...H(u)
1472
1568
  },
1473
1569
  tasks_api: t,
1474
- page: d
1570
+ page: u
1475
1571
  }),
1476
1572
  staleTime: 1e3 * 60 * 60 * 24,
1477
1573
  // mantains the data for 24 hours
1478
- getNextPageParam: (d, g) => g.length + 1
1574
+ getNextPageParam: (u, b) => b.length + 1
1479
1575
  });
1480
- return _(() => {
1481
- var d;
1482
- Object.keys(n).length > 0 && u({
1483
- ...n,
1576
+ return T(() => {
1577
+ var u;
1578
+ Object.keys(a).length > 0 && d({
1579
+ ...a,
1484
1580
  owner: {
1485
- user: r.id,
1486
- config: ((d = n == null ? void 0 : n.owner) == null ? void 0 : d.config) ?? "yo_y_mis_equipos"
1581
+ user: s.id,
1582
+ config: ((u = a == null ? void 0 : a.owner) == null ? void 0 : u.config) ?? "yo_y_mis_equipos"
1487
1583
  },
1488
1584
  status: "trabajando"
1489
1585
  });
1490
- }, [n]), _(() => {
1491
- a.invalidateQueries({
1492
- queryKey: ["working_tasks", n]
1586
+ }, [a]), T(() => {
1587
+ r.invalidateQueries({
1588
+ queryKey: ["working_tasks", a]
1493
1589
  });
1494
- }, [i]), _(() => {
1590
+ }, [i]), T(() => {
1495
1591
  (async () => {
1496
- const g = await t.get("/api/listado_tareas", {
1592
+ const b = await t.get("/api/listado_tareas", {
1497
1593
  params: {
1498
1594
  ...i,
1499
1595
  status: "trabajando",
1500
- ...W(1),
1596
+ ...H(1),
1501
1597
  tasks_api: t,
1502
1598
  justCount: !0
1503
1599
  }
1504
1600
  });
1505
- s(g.data.total);
1601
+ l(b.data.total);
1506
1602
  })();
1507
1603
  }, [i, c == null ? void 0 : c.data]), {
1508
1604
  //Properties
1509
1605
  workingTasks: c,
1510
- total: l
1606
+ total: n
1511
1607
  };
1512
- }, Bt = () => {
1513
- var n, l;
1514
- const { workingTasks: a, total: t } = Et(), r = [...((l = (n = a == null ? void 0 : a.data) == null ? void 0 : n.pages) == null ? void 0 : l.flat()) ?? []];
1608
+ }, Rt = () => {
1609
+ var a, n;
1610
+ const { workingTasks: r, total: t } = Bt(), s = [...((n = (a = r == null ? void 0 : r.data) == null ? void 0 : a.pages) == null ? void 0 : n.flat()) ?? []];
1515
1611
  return /* @__PURE__ */ e(
1516
- ee,
1612
+ ae,
1517
1613
  {
1518
1614
  total: t,
1519
1615
  title: "Trabajando",
1520
- tasks: r,
1521
- loadNextPage: () => ce(a),
1522
- isFetching: a == null ? void 0 : a.isFetching
1616
+ tasks: s,
1617
+ loadNextPage: () => he(r),
1618
+ isFetching: r == null ? void 0 : r.isFetching
1523
1619
  }
1524
1620
  );
1525
- }, Lt = () => {
1526
- var p;
1527
- const a = H(), { user: t } = I(), { tasks_api: r } = E(), { filters: n } = $(), [l, s] = y(0), [i, u] = y({
1621
+ }, Kt = () => {
1622
+ var h;
1623
+ const r = V(), { user: t } = O(), { tasks_api: s } = E(), { filters: a } = $(), [n, l] = N(0), [i, d] = N({
1528
1624
  owner: {
1529
1625
  user: t.id,
1530
- config: ((p = n == null ? void 0 : n.owner) == null ? void 0 : p.config) ?? "yo_y_mis_equipos"
1626
+ config: ((h = a == null ? void 0 : a.owner) == null ? void 0 : h.config) ?? "yo_y_mis_equipos"
1531
1627
  },
1532
1628
  status: "completadas"
1533
- }), c = ne({
1629
+ }), c = le({
1534
1630
  initialPageParam: 1,
1535
1631
  queryKey: ["done_tasks", i],
1536
- queryFn: ({ pageParam: d }) => oe({
1632
+ queryFn: ({ pageParam: u }) => pe({
1537
1633
  filters: {
1538
1634
  ...i,
1539
1635
  status: "completadas",
1540
- ...W(d)
1636
+ ...H(u)
1541
1637
  },
1542
- tasks_api: r,
1543
- page: d
1638
+ tasks_api: s,
1639
+ page: u
1544
1640
  }),
1545
1641
  staleTime: 1e3 * 60 * 60 * 24,
1546
1642
  // mantains the data for 24 hours
1547
- getNextPageParam: (d, g) => g.length + 1
1643
+ getNextPageParam: (u, b) => b.length + 1
1548
1644
  });
1549
- return _(() => {
1550
- var d;
1551
- Object.keys(n).length > 0 && u({
1552
- ...n,
1645
+ return T(() => {
1646
+ var u;
1647
+ Object.keys(a).length > 0 && d({
1648
+ ...a,
1553
1649
  owner: {
1554
1650
  user: t.id,
1555
- config: ((d = n == null ? void 0 : n.owner) == null ? void 0 : d.config) ?? "yo_y_mis_equipos"
1651
+ config: ((u = a == null ? void 0 : a.owner) == null ? void 0 : u.config) ?? "yo_y_mis_equipos"
1556
1652
  },
1557
1653
  status: "completadas"
1558
1654
  });
1559
- }, [n]), _(() => {
1560
- a.invalidateQueries({
1655
+ }, [a]), T(() => {
1656
+ r.invalidateQueries({
1561
1657
  queryKey: ["done_tasks", i]
1562
1658
  });
1563
- }, [i]), _(() => {
1659
+ }, [i]), T(() => {
1564
1660
  (async () => {
1565
- const g = await r.get("/api/listado_tareas", {
1661
+ const b = await s.get("/api/listado_tareas", {
1566
1662
  params: {
1567
1663
  ...i,
1568
1664
  status: "completadas",
1569
- ...W(1),
1665
+ ...H(1),
1570
1666
  justCount: !0,
1571
- tasks_api: r
1667
+ tasks_api: s
1572
1668
  }
1573
1669
  });
1574
- s(g.data.total);
1670
+ l(b.data.total);
1575
1671
  })();
1576
1672
  }, [c == null ? void 0 : c.data, i]), {
1577
1673
  // Properties
1578
1674
  doneTasks: c,
1579
- total: l
1675
+ total: n
1580
1676
  };
1581
- }, Mt = () => {
1582
- var n, l;
1583
- const { doneTasks: a, total: t } = Lt(), r = [...((l = (n = a == null ? void 0 : a.data) == null ? void 0 : n.pages) == null ? void 0 : l.flat()) ?? []];
1677
+ }, It = () => {
1678
+ var a, n;
1679
+ const { doneTasks: r, total: t } = Kt(), s = [...((n = (a = r == null ? void 0 : r.data) == null ? void 0 : a.pages) == null ? void 0 : n.flat()) ?? []];
1584
1680
  return /* @__PURE__ */ e(
1585
- ee,
1681
+ ae,
1586
1682
  {
1587
1683
  title: "Completadas",
1588
- tasks: r,
1589
- loadNextPage: () => ce(a),
1590
- isFetching: a == null ? void 0 : a.isFetching,
1684
+ tasks: s,
1685
+ loadNextPage: () => he(r),
1686
+ isFetching: r == null ? void 0 : r.isFetching,
1591
1687
  total: t
1592
1688
  }
1593
1689
  );
1594
1690
  };
1595
- class te {
1691
+ class ne {
1596
1692
  static toSalesmanUsers(t) {
1597
1693
  return {
1598
1694
  id: t.id,
@@ -1600,8 +1696,8 @@ class te {
1600
1696
  };
1601
1697
  }
1602
1698
  }
1603
- const zt = () => {
1604
- const { tasks_api: a } = E(), { filters: t } = $(), { user: r } = I();
1699
+ const Wt = () => {
1700
+ const { tasks_api: r } = E(), { filters: t } = $(), { user: s } = O();
1605
1701
  return {
1606
1702
  //methods
1607
1703
  getSalesmanAndProjects: async () => {
@@ -1609,7 +1705,7 @@ const zt = () => {
1609
1705
  i
1610
1706
  /* , projects */
1611
1707
  ] = await Promise.all([
1612
- a.get("/api/obtener-comerciales")
1708
+ r.get("/api/obtener-comerciales")
1613
1709
  /* tasks_api.get('/api/listado_tareas', {
1614
1710
  params: {
1615
1711
  // ...filters,
@@ -1622,26 +1718,26 @@ const zt = () => {
1622
1718
  }), */
1623
1719
  ]);
1624
1720
  return {
1625
- salesmanUsers: i.data.map(te.toSalesmanUsers)
1721
+ salesmanUsers: i.data.map(ne.toSalesmanUsers)
1626
1722
  // projects: projects.data.map(SalesmanUsersMapper.toSalesmanUsers),
1627
1723
  };
1628
1724
  },
1629
1725
  getProjects: async () => {
1630
- var u;
1631
- return (await a.get("/api/listado_tareas", {
1726
+ var d;
1727
+ return (await r.get("/api/listado_tareas", {
1632
1728
  params: {
1633
1729
  ...t,
1634
1730
  owner: {
1635
- user: r.id,
1636
- config: ((u = t == null ? void 0 : t.owner) == null ? void 0 : u.config) ?? "yo_y_mis_equipos"
1731
+ user: s.id,
1732
+ config: ((d = t == null ? void 0 : t.owner) == null ? void 0 : d.config) ?? "yo_y_mis_equipos"
1637
1733
  },
1638
1734
  justProjects: !0
1639
1735
  }
1640
- })).data.map(te.toSalesmanUsers);
1736
+ })).data.map(ne.toSalesmanUsers);
1641
1737
  },
1642
- getSalesmans: async () => (await a.get("/api/obtener-comerciales")).data.map(te.toSalesmanUsers)
1738
+ getSalesmans: async () => (await r.get("/api/obtener-comerciales")).data.map(ne.toSalesmanUsers)
1643
1739
  };
1644
- }, It = [
1740
+ }, Ot = [
1645
1741
  {
1646
1742
  label: "Tipo de dependencia",
1647
1743
  type: "select",
@@ -1687,54 +1783,77 @@ const zt = () => {
1687
1783
  label: "Por dificultad",
1688
1784
  type: "select",
1689
1785
  id: "difficulty",
1690
- options: [{
1691
- id: 0,
1692
- name: "Muy facil"
1693
- }, {
1694
- id: 1,
1695
- name: "Facil"
1696
- }, {
1697
- id: 2,
1698
- name: "Media"
1699
- }, {
1700
- id: 3,
1701
- name: "Dificil"
1702
- }, {
1703
- id: 4,
1704
- name: "Muy dificil"
1705
- }]
1786
+ options: [
1787
+ {
1788
+ id: 0,
1789
+ name: "Muy facil"
1790
+ },
1791
+ {
1792
+ id: 1,
1793
+ name: "Facil"
1794
+ },
1795
+ {
1796
+ id: 2,
1797
+ name: "Media"
1798
+ },
1799
+ {
1800
+ id: 3,
1801
+ name: "Dificil"
1802
+ },
1803
+ {
1804
+ id: 4,
1805
+ name: "Muy dificil"
1806
+ }
1807
+ ]
1706
1808
  }
1707
- ], Rt = () => {
1708
- const { defineFields: a } = $(), { getSalesmanAndProjects: t } = zt();
1709
- return _(() => {
1809
+ ], Ae = [
1810
+ {
1811
+ label: "Responsable",
1812
+ type: "select",
1813
+ id: "responsable.responsableType",
1814
+ options: [
1815
+ { id: "yo_y_mis_equipos", name: "Yo y mis equipos" },
1816
+ { id: "mis_equipos", name: "Mis equipos" },
1817
+ { id: "yo", name: "Yo" }
1818
+ ]
1819
+ },
1820
+ {
1821
+ label: "Por Ejecutivo",
1822
+ type: "select",
1823
+ id: "ejecutivo",
1824
+ options: []
1825
+ }
1826
+ ], Qt = () => {
1827
+ const { defineFields: r } = $(), { getSalesmanAndProjects: t } = Wt();
1828
+ return T(() => {
1710
1829
  (async () => {
1711
- let n = [...It], {
1712
- salesmanUsers: l
1830
+ let a = [...Ot], {
1831
+ salesmanUsers: n
1713
1832
  /* , projects */
1714
1833
  } = await t();
1715
- a(n.map((s) => (s.id === "salesman.name" && (s.options = l), s)));
1834
+ r(a.map((l) => (l.id === "salesman.name" && (l.options = n), l)));
1716
1835
  })();
1717
1836
  }, []), /* @__PURE__ */ o("div", { className: "flex gap-4 w-full h-full min-h-[100%] relative ", children: [
1718
- /* @__PURE__ */ e($t, {}),
1719
- /* @__PURE__ */ e(Bt, {}),
1720
- /* @__PURE__ */ e(Mt, {})
1837
+ /* @__PURE__ */ e(zt, {}),
1838
+ /* @__PURE__ */ e(Rt, {}),
1839
+ /* @__PURE__ */ e(It, {})
1721
1840
  ] });
1722
- }, Me = V({}), Ot = ({ children: a }) => {
1723
- const [t, r] = y([]);
1724
- _(() => {
1841
+ }, We = G({}), Ut = ({ children: r }) => {
1842
+ const [t, s] = N([]);
1843
+ T(() => {
1725
1844
  console.log({ selectedTasks: t });
1726
1845
  }, [t]);
1727
- const n = (l) => {
1728
- r((s) => s.includes(l) ? s.filter((i) => i !== l) : [...s, l]);
1846
+ const a = (n) => {
1847
+ s((l) => l.includes(n) ? l.filter((i) => i !== n) : [...l, n]);
1729
1848
  };
1730
- return /* @__PURE__ */ e(Me.Provider, { value: {
1849
+ return /* @__PURE__ */ e(We.Provider, { value: {
1731
1850
  //properties
1732
1851
  selectedTasks: t,
1733
1852
  //methods
1734
- selectTask: n
1735
- }, children: a });
1736
- }, Wt = () => G(Me), ze = () => {
1737
- const a = () => /* @__PURE__ */ o("div", { className: "w-full flex gap-m", children: [
1853
+ selectTask: a
1854
+ }, children: r });
1855
+ }, Ht = () => Y(We), Oe = () => {
1856
+ const r = () => /* @__PURE__ */ o("div", { className: "w-full flex gap-m", children: [
1738
1857
  /* @__PURE__ */ e("div", { className: "w-[30px] h-[30px] min-w-[30px] min-h-[30px] bg-gray-200 rounded-full animate-pulse" }),
1739
1858
  /* @__PURE__ */ e("div", { className: "w-[30%] h-[30px] bg-gray-200 rounded-md animate-pulse" }),
1740
1859
  /* @__PURE__ */ e("div", { className: "w-[30px] h-[30px] min-w-[30px] min-h-[30px] bg-gray-200 rounded-lg animate-pulse" }),
@@ -1747,163 +1866,203 @@ const zt = () => {
1747
1866
  /* @__PURE__ */ e("div", { className: "w-[30px] h-[30px] min-w-[30px] min-h-[30px] bg-gray-200 rounded-lg animate-pulse" })
1748
1867
  ] });
1749
1868
  return /* @__PURE__ */ o("div", { className: "flex flex-col gap-m", children: [
1750
- /* @__PURE__ */ e(a, {}),
1869
+ /* @__PURE__ */ e(r, {}),
1751
1870
  /* @__PURE__ */ o("div", { className: "pl-5 flex flex-col gap-m", children: [
1752
- /* @__PURE__ */ e(a, {}),
1753
- /* @__PURE__ */ e("div", { className: "pl-5", children: /* @__PURE__ */ e(a, {}) })
1871
+ /* @__PURE__ */ e(r, {}),
1872
+ /* @__PURE__ */ e("div", { className: "pl-5", children: /* @__PURE__ */ e(r, {}) })
1754
1873
  ] }),
1755
- /* @__PURE__ */ e(a, {}),
1874
+ /* @__PURE__ */ e(r, {}),
1756
1875
  /* @__PURE__ */ o("div", { className: "pl-5 flex flex-col gap-m", children: [
1757
- /* @__PURE__ */ e(a, {}),
1758
- /* @__PURE__ */ e("div", { className: "pl-5", children: /* @__PURE__ */ e(a, {}) })
1876
+ /* @__PURE__ */ e(r, {}),
1877
+ /* @__PURE__ */ e("div", { className: "pl-5", children: /* @__PURE__ */ e(r, {}) })
1759
1878
  ] })
1760
1879
  ] });
1761
- }, Ie = ({
1762
- startDate: a,
1880
+ }, Qe = ({
1881
+ startDate: r,
1763
1882
  endDate: t
1764
- }) => /* @__PURE__ */ o(q, { children: [
1883
+ }) => /* @__PURE__ */ o(D, { children: [
1765
1884
  /* @__PURE__ */ o("div", { className: "gap-s bg-gray-100 rounded-md h-[30px] w-fit flex justify-center items-center px-xxxl", children: [
1766
- /* @__PURE__ */ e(C, { icon: "calendar", size: "xs", strokeWidth: 4, color: P.texts.subtext }),
1885
+ /* @__PURE__ */ e(F, { icon: "calendar", size: "xs", strokeWidth: 4, color: C.texts.subtext }),
1767
1886
  /* @__PURE__ */ o("p", { className: "text-sm", children: [
1768
1887
  " ",
1769
- Ne(a)
1888
+ qe(r)
1770
1889
  ] })
1771
1890
  ] }),
1772
- /* @__PURE__ */ e(C, { icon: "arrow_right", size: "xs", strokeWidth: 4, color: P.texts.DEFAULT }),
1891
+ /* @__PURE__ */ e(F, { icon: "arrow_right", size: "xs", strokeWidth: 4, color: C.texts.DEFAULT }),
1773
1892
  /* @__PURE__ */ o("div", { className: "gap-s bg-gray-100 rounded-md h-[30px] w-fit flex justify-center items-center px-xxxl", children: [
1774
- /* @__PURE__ */ e(C, { icon: "calendar", size: "xs", strokeWidth: 4, color: P.texts.subtext }),
1893
+ /* @__PURE__ */ e(F, { icon: "calendar", size: "xs", strokeWidth: 4, color: C.texts.subtext }),
1775
1894
  /* @__PURE__ */ o("p", { className: "text-sm", children: [
1776
1895
  " ",
1777
- Ne(t)
1896
+ qe(t)
1778
1897
  ] })
1779
1898
  ] })
1780
- ] }), Kt = ({ id: a }) => /* @__PURE__ */ e(q, { children: /* @__PURE__ */ e("button", { onClick: () => alert("pausar tarea " + a), children: /* @__PURE__ */ e(C, { icon: "pause", size: "xs", strokeWidth: 4, color: P.texts.subtext }) }) }), Re = ({ id: a, priority: t }) => /* @__PURE__ */ o(q, { children: [
1781
- /* @__PURE__ */ e("button", { className: "gap-s bg-gray-100 rounded-md h-[30px] w-[30px] flex justify-center items-center hover:bg-gray-200", children: /* @__PURE__ */ e(C, { icon: "align_center", size: "xs", strokeWidth: 4, color: P.texts.subtext }) }),
1782
- /* @__PURE__ */ e("div", { className: "gap-s bg-success-medium border border-success-pastel rounded-md h-[30px] w-[30px] flex justify-center items-center", children: /* @__PURE__ */ e(Be, { id: a, priority: t }) }),
1783
- /* @__PURE__ */ e("button", { className: "gap-s bg-danger-light border border-danger-regular rounded-md h-[30px] w-[30px] flex justify-center items-center", children: /* @__PURE__ */ e(C, { icon: "difficulty", size: "xs", strokeWidth: 4, color: P.danger.regular }) })
1784
- ] }), Ut = ({ id: a }) => {
1785
- const { selectedTasks: t, selectTask: r } = Wt();
1786
- return /* @__PURE__ */ o(q, { children: [
1787
- /* @__PURE__ */ e("label", { className: "cursor-pointer w-[20px] h-[20px] border-2 border-gray-200 rounded-md flex justify-center items-center", htmlFor: a.toString(), children: /* @__PURE__ */ e("span", { className: `${t.includes(a) ? "opacity-100" : "opacity-0"} transition-opacity duration-500`, children: /* @__PURE__ */ e(C, { icon: "check_outline", size: "xs", color: P.primary.regular, strokeWidth: 6 }) }) }),
1788
- /* @__PURE__ */ e("input", { className: "hidden", id: a.toString(), type: "checkbox", onChange: () => r(a) })
1899
+ ] }), Vt = ({ id: r }) => /* @__PURE__ */ e(D, { children: /* @__PURE__ */ e("button", { onClick: () => alert("pausar tarea " + r), children: /* @__PURE__ */ e(F, { icon: "pause", size: "xs", strokeWidth: 4, color: C.texts.subtext }) }) }), Ue = ({ id: r, priority: t, difficulty: s, endDate: a }) => {
1900
+ var i, d;
1901
+ const n = {
1902
+ 0: { title: "N/A", color: C.success.regular, bg: "bg-texts-placeholder border-texts-placeholder" },
1903
+ 1: { title: "Baja", color: C.success.regular, bg: "bg-success-medium border-success-pastel" },
1904
+ 2: { title: "Media", color: C.warning.regular, bg: "bg-warning-light border-warning-regular" },
1905
+ 3: { title: "Alta", color: C.danger.regular, bg: "bg-danger-light border-danger-regular" }
1906
+ }, l = {
1907
+ 0: { title: "Muy fácil", color: C.success.dark, bg: "bg-success-medium border-success-regular" },
1908
+ 1: { title: "Fácil", color: C.success.regular, bg: "bg-success-medium border-success-pastel" },
1909
+ 2: { title: "Media", color: C.warning.regular, bg: "bg-warning-light border-warning-regular" },
1910
+ 3: { title: "Difícil", color: C.danger.regular, bg: "bg-danger-light border-danger-regular" },
1911
+ 4: { title: "Muy difícil", color: C.danger.dark, bg: "bg-danger-light border-danger-regular" }
1912
+ };
1913
+ return /* @__PURE__ */ o(D, { children: [
1914
+ /* @__PURE__ */ e("button", { className: "gap-s bg-gray-100 rounded-md h-[30px] w-[30px] flex justify-center items-center hover:bg-gray-200", children: /* @__PURE__ */ e(M, { dispatch: /* @__PURE__ */ e(F, { icon: "align_center", size: "xs", strokeWidth: 4, color: C.texts.subtext }), children: /* @__PURE__ */ e("p", { className: "text-sm font-regular py-2 px-4 bg-bg-card rounded-lg", style: { color: "gray" }, children: "Espéralo muy pronto..." }) }) }),
1915
+ /* @__PURE__ */ o("div", { className: "flex items-center gap-2", children: [
1916
+ /* @__PURE__ */ e("div", { className: `gap-s ${((i = l[s ?? 0]) == null ? void 0 : i.bg) ?? "bg-gray-100"} border rounded-md h-[30px] w-[30px] flex justify-center items-center`, children: /* @__PURE__ */ e(M, { dispatch: /* @__PURE__ */ e(F, { icon: "difficulty", size: "xs", color: l[s ?? 0].color, strokeWidth: 4 }), children: /* @__PURE__ */ e("p", { className: "text-sm font-regular p-5 bg-bg-card rounded-lg", style: { color: l[s ?? 0].color }, children: l[s ?? 0].title }) }) }),
1917
+ /* @__PURE__ */ e("div", { className: `gap-s ${((d = n[t ?? 0]) == null ? void 0 : d.bg) ?? "bg-gray-100"} border rounded-md h-[30px] w-[30px] flex justify-center items-center`, children: /* @__PURE__ */ e(M, { dispatch: /* @__PURE__ */ e(F, { icon: "flag", size: "xs", color: n[t ?? 0].color, strokeWidth: 4 }), children: /* @__PURE__ */ e("p", { className: "text-sm font-regular p-5 bg-bg-card rounded-lg", style: { color: n[t ?? 0].color }, children: n[t ?? 0].title }) }) }),
1918
+ /* @__PURE__ */ e(
1919
+ F,
1920
+ {
1921
+ icon: "calendar",
1922
+ size: "xs",
1923
+ strokeWidth: 3,
1924
+ color: C.texts.subtext
1925
+ }
1926
+ ),
1927
+ /* @__PURE__ */ e("p", { className: "text-sm font-regular text-texts-subtext", children: `${a.getDate()} ${de(a.getMonth()).slice(0, 3)}` })
1928
+ ] })
1929
+ ] });
1930
+ }, Gt = ({ id: r }) => {
1931
+ const { selectedTasks: t, selectTask: s } = Ht();
1932
+ return /* @__PURE__ */ o(D, { children: [
1933
+ /* @__PURE__ */ e("label", { className: "cursor-pointer w-[20px] h-[20px] border-2 border-gray-200 rounded-md flex justify-center items-center", htmlFor: r.toString(), children: /* @__PURE__ */ e("span", { className: `${t.includes(r) ? "opacity-100" : "opacity-0"} transition-opacity duration-500`, children: /* @__PURE__ */ e(F, { icon: "check_outline", size: "xs", color: C.primary.regular, strokeWidth: 6 }) }) }),
1934
+ /* @__PURE__ */ e("input", { className: "hidden", id: r.toString(), type: "checkbox", onChange: () => s(r) })
1789
1935
  ] });
1790
- }, Oe = ({ task: a }) => /* @__PURE__ */ e(
1791
- K,
1936
+ }, He = ({ task: r }) => /* @__PURE__ */ e(
1937
+ M,
1792
1938
  {
1793
- dispatch: /* @__PURE__ */ e("p", { className: "text-sm text-texts-subtext max-w-[400px] truncate", children: a }),
1794
- children: /* @__PURE__ */ e("p", { className: "text-sm text-texts-subtext p-2 max-w-[400px]", children: a })
1939
+ dispatch: /* @__PURE__ */ e("p", { className: "text-sm text-texts-subtext max-w-[400px] truncate", children: r }),
1940
+ children: /* @__PURE__ */ e("p", { className: "text-sm text-texts-subtext p-2 max-w-[400px]", children: r })
1795
1941
  }
1796
- ), Qt = ({ id: a }) => {
1942
+ ), Yt = ({ id: r }) => {
1797
1943
  var n, l;
1798
- const { tasksProject: t } = Y(), r = (n = t == null ? void 0 : t.data) == null ? void 0 : n.find((s) => s.id === a);
1799
- return /* @__PURE__ */ o("div", { className: "ml-[30px] mb-3 mt-1 flex flex-wrap items-center gap-xl", children: [
1800
- !(r != null && r.nameRequiredTask) || (r == null ? void 0 : r.nameRequiredTask) !== "" && (r == null ? void 0 : r.statusRequiredTask) === 2 && /* @__PURE__ */ e(Ut, { id: a }),
1801
- /* @__PURE__ */ e(De, { id: a, nameRequiredTask: (r == null ? void 0 : r.nameRequiredTask) ?? "", status: r == null ? void 0 : r.status, statusRequiredTask: (r == null ? void 0 : r.statusRequiredTask) ?? 0 }, a),
1802
- (r == null ? void 0 : r.willBePaused) && /* @__PURE__ */ e(Kt, { id: a }),
1944
+ const { tasksProject: t } = X(), { reasignResponsible: s } = te(), a = (n = t == null ? void 0 : t.data) == null ? void 0 : n.find((i) => i.id === r);
1945
+ return /* @__PURE__ */ e("div", { className: "border-b border-gray-200 pb-3", children: /* @__PURE__ */ o("div", { className: "ml-[30px] mb-3 mt-1 p-2 flex flex-wrap items-center gap-xl rounded-md hover:bg-gray-100", children: [
1946
+ !(a != null && a.nameRequiredTask) || (a == null ? void 0 : a.nameRequiredTask) !== "" && (a == null ? void 0 : a.statusRequiredTask) === 2 && /* @__PURE__ */ e(Gt, { id: r }),
1947
+ /* @__PURE__ */ e(Be, { id: r, nameRequiredTask: (a == null ? void 0 : a.nameRequiredTask) ?? "", status: a == null ? void 0 : a.status, statusRequiredTask: (a == null ? void 0 : a.statusRequiredTask) ?? 0 }, r),
1948
+ (a == null ? void 0 : a.willBePaused) && /* @__PURE__ */ e(Vt, { id: r }),
1803
1949
  /* @__PURE__ */ e(
1804
- $e,
1950
+ Re,
1805
1951
  {
1806
- onClick: () => {
1952
+ onClick: async (i, d) => {
1953
+ await s({ idNewResponsible: i == null ? void 0 : i.id, id: r, typeOfSelect: d });
1807
1954
  },
1808
- responsible: r == null ? void 0 : r.responsible,
1809
- users: ((l = r == null ? void 0 : r.users) == null ? void 0 : l.map(se)) ?? []
1955
+ responsible: a == null ? void 0 : a.responsible,
1956
+ users: ((l = a == null ? void 0 : a.users) == null ? void 0 : l.map(ue)) ?? []
1810
1957
  }
1811
1958
  ),
1812
- /* @__PURE__ */ e(Oe, { task: (r == null ? void 0 : r.task) ?? "" }),
1813
- /* @__PURE__ */ e(Re, { id: a, priority: r == null ? void 0 : r.priority }),
1814
- /* @__PURE__ */ e(Ie, { startDate: r == null ? void 0 : r.startDate, endDate: r == null ? void 0 : r.endDate })
1815
- ] });
1816
- }, We = ({ id: a }) => {
1817
- var s, i, u, c, p, d, g;
1818
- const { tasksProject: t, openTasks: r, openTask: n } = Y(), l = (s = t == null ? void 0 : t.data) == null ? void 0 : s.find((m) => m.id === a);
1819
- return l ? (console.log({ task: l }), /* @__PURE__ */ o("div", { className: "flex flex-col gap-m mb-2 ", children: [
1820
- /* @__PURE__ */ o("div", { className: "flex items-center gap-m flex-wrap hover:bg-gray-100", children: [
1821
- /* @__PURE__ */ e("button", { className: `${r.includes(a) ? "" : "-rotate-90"} transition-all duration-300`, onClick: () => n(a), children: /* @__PURE__ */ e(C, { icon: "angle_down_outline", color: P.texts.subtext }) }),
1822
- /* @__PURE__ */ e("div", { className: "flex items-center justify-center min-w-[20px] min-h-[20px] w-fit h-[20px] mx-1 bg-primary-medium rounded-full", children: /* @__PURE__ */ e("p", { className: "text-sm text-primary", children: ((i = l == null ? void 0 : l.tasks) == null ? void 0 : i.length) === 0 ? 1 : (u = l == null ? void 0 : l.tasks) == null ? void 0 : u.length }) }),
1823
- /* @__PURE__ */ e(Oe, { task: (l == null ? void 0 : l.task) ?? "" }),
1824
- /* @__PURE__ */ e(Re, { id: a, priority: l == null ? void 0 : l.priority }),
1825
- /* @__PURE__ */ e(Ie, { startDate: l == null ? void 0 : l.startDate, endDate: l == null ? void 0 : l.endDate }),
1959
+ /* @__PURE__ */ e(He, { task: (a == null ? void 0 : a.task) ?? "" }),
1960
+ /* @__PURE__ */ e(Ue, { id: r, priority: a == null ? void 0 : a.priority, difficulty: a.difficulty, endDate: a == null ? void 0 : a.endDate }),
1961
+ /* @__PURE__ */ e(Qe, { startDate: a == null ? void 0 : a.startDate, endDate: a == null ? void 0 : a.endDate }),
1962
+ /* @__PURE__ */ e(
1963
+ Ie,
1964
+ {
1965
+ id: r,
1966
+ nameRequiredTask: a.nameRequiredTask,
1967
+ status: a.status,
1968
+ statusRequiredTask: a.statusRequiredTask
1969
+ }
1970
+ )
1971
+ ] }) });
1972
+ }, Ve = ({ id: r }) => {
1973
+ var l, i, d, c, h, u, b;
1974
+ const { tasksProject: t, openTasks: s, openTask: a } = X(), n = (l = t == null ? void 0 : t.data) == null ? void 0 : l.find((m) => m.id === r);
1975
+ return n ? /* @__PURE__ */ o("div", { className: "flex flex-col gap-m mb-2 ", children: [
1976
+ /* @__PURE__ */ o("div", { className: "flex items-center gap-m flex-wrap hover:bg-gray-100 p-2 rounded-md", children: [
1977
+ /* @__PURE__ */ e("button", { className: `${s.includes(r) ? "" : "-rotate-90"} transition-all duration-300`, onClick: () => a(r), children: /* @__PURE__ */ e(F, { icon: "angle_down_outline", color: C.texts.subtext }) }),
1978
+ /* @__PURE__ */ e("div", { className: "flex items-center justify-center min-w-[20px] min-h-[20px] w-fit h-[20px] mx-1 bg-primary-medium rounded-full", children: /* @__PURE__ */ e("p", { className: "text-sm text-primary", children: ((i = n == null ? void 0 : n.tasks) == null ? void 0 : i.length) === 0 ? 1 : (d = n == null ? void 0 : n.tasks) == null ? void 0 : d.length }) }),
1979
+ /* @__PURE__ */ e(He, { task: (n == null ? void 0 : n.task) ?? "" }),
1980
+ /* @__PURE__ */ e(Ue, { id: r, priority: n == null ? void 0 : n.priority, difficulty: n.difficulty, endDate: n == null ? void 0 : n.endDate }),
1981
+ /* @__PURE__ */ e(Qe, { startDate: n == null ? void 0 : n.startDate, endDate: n == null ? void 0 : n.endDate }),
1826
1982
  /* @__PURE__ */ o("button", { className: "gap-s bg-gray-100 rounded-md h-[30px] flex justify-center items-center w-fit px-m hover:bg-gray-200", children: [
1827
- /* @__PURE__ */ e(C, { icon: "subtasks", size: "xs", strokeWidth: 5, color: P.texts.subtext }),
1828
- /* @__PURE__ */ e("p", { children: ((c = l == null ? void 0 : l.tasks) == null ? void 0 : c.length) === 0 ? 1 : (p = l == null ? void 0 : l.tasks) == null ? void 0 : p.length })
1983
+ /* @__PURE__ */ e(F, { icon: "subtasks", size: "xs", strokeWidth: 5, color: C.texts.subtext }),
1984
+ /* @__PURE__ */ e("p", { children: ((c = n == null ? void 0 : n.tasks) == null ? void 0 : c.length) === 0 ? 1 : (h = n == null ? void 0 : n.tasks) == null ? void 0 : h.length })
1829
1985
  ] })
1830
1986
  ] }),
1831
- r.includes(a) && /* @__PURE__ */ e("div", { className: "ml-[30px]", children: ((d = l == null ? void 0 : l.tasks) == null ? void 0 : d.length) > 0 ? (g = l == null ? void 0 : l.tasks) == null ? void 0 : g.map((m) => /* @__PURE__ */ e(We, { id: m == null ? void 0 : m.id })) : /* @__PURE__ */ e(Qt, { id: l == null ? void 0 : l.id }) })
1832
- ] })) : null;
1833
- }, Ht = () => {
1834
- var n;
1835
- const { tasksProject: a, projectID: t } = Y();
1836
- if (a != null && a.isFetching || a != null && a.isLoading) return /* @__PURE__ */ e(ze, {});
1837
- let r = [...(n = a == null ? void 0 : a.data) == null ? void 0 : n.filter((l) => l.isPrincipalTask)];
1838
- return /* @__PURE__ */ e("div", { className: "flex flex-col gap-m", children: /* @__PURE__ */ e(Ot, { project: t, children: r == null ? void 0 : r.sort((l, s) => l.orden - s.orden).map((l) => /* @__PURE__ */ e("div", { className: "flex flex-col gap-m border-b border-gray-200 pb-m", children: /* @__PURE__ */ e(We, { id: l.id }) })) }) });
1839
- }, Vt = ({
1840
- setPath: a,
1987
+ s.includes(r) && /* @__PURE__ */ e("div", { className: "ml-[30px]", children: ((u = n == null ? void 0 : n.tasks) == null ? void 0 : u.length) > 0 ? (b = n == null ? void 0 : n.tasks) == null ? void 0 : b.map((m) => /* @__PURE__ */ e(Ve, { id: m == null ? void 0 : m.id })) : /* @__PURE__ */ e(Yt, { id: n == null ? void 0 : n.id }) })
1988
+ ] }) : null;
1989
+ }, Xt = () => {
1990
+ var a;
1991
+ const { tasksProject: r, projectID: t } = X();
1992
+ if (r != null && r.isFetching || r != null && r.isLoading) return /* @__PURE__ */ e(Oe, {});
1993
+ let s = [...(a = r == null ? void 0 : r.data) == null ? void 0 : a.filter((n) => n.isPrincipalTask)];
1994
+ return /* @__PURE__ */ e("div", { className: "flex flex-col gap-m h-full overflow-y-auto pb-3", children: /* @__PURE__ */ e(Ut, { project: t, children: s == null ? void 0 : s.sort((n, l) => n.orden - l.orden).map((n) => /* @__PURE__ */ e("div", { className: "flex flex-col gap-m border-b border-gray-200 pb-m h-full", children: /* @__PURE__ */ e(Ve, { id: n.id }) })) }) });
1995
+ }, Jt = ({
1996
+ setPath: r,
1841
1997
  setProject: t
1842
1998
  }) => {
1843
- const [r, n] = y([]), [l, s] = y(!0), [i, u] = y(0), [c, p] = y(10), [d, g] = y(0), [m, x] = y("nombre"), { defineFields: w } = $(), { tasks_api: f } = E(), v = async (h, S) => {
1999
+ const [s, a] = N([]), [n, l] = N(!0), [i, d] = N(0), [c, h] = N(10), [u, b] = N(0), [m, x] = N("nombre"), { filters: f, defineFields: w } = $(), { tasks_api: g } = E(), { user: v } = O(), y = async (p, A) => {
2000
+ var P, j, I;
1844
2001
  try {
1845
- s(!0);
1846
- const D = await f.get("/api/listado_campanias", {
2002
+ l(!0);
2003
+ const L = {
2004
+ filters: {
2005
+ search: (f == null ? void 0 : f.taskName) ?? "",
2006
+ responsable: {
2007
+ idUser: v.id,
2008
+ responsableType: (P = f == null ? void 0 : f.responsable) == null ? void 0 : P.responsableType
2009
+ },
2010
+ ejecutivo: (f == null ? void 0 : f.ejecutivo) ?? ""
2011
+ }
2012
+ };
2013
+ console.log("FiltrosPARAMS: ", L);
2014
+ const K = await g.get("/api/listado_campanias", {
1847
2015
  params: {
1848
2016
  pagination: {
1849
- page: h,
1850
- pageSize: S
2017
+ page: p,
2018
+ pageSize: A
1851
2019
  },
1852
- orderBy: m
1853
- // Agregar orderBy a los parámetros
1854
- //agrega consulta de filtros
2020
+ orderBy: m,
2021
+ ...L
1855
2022
  }
1856
- }), j = z(D.data);
1857
- n(j), g(D.data.meta.total);
1858
- } catch (D) {
1859
- console.error("Error fetching data en Lista Campaña:", D);
2023
+ }), J = Q(K == null ? void 0 : K.data);
2024
+ a(J), b((I = (j = K == null ? void 0 : K.data) == null ? void 0 : j.meta) == null ? void 0 : I.total);
2025
+ } catch (L) {
2026
+ console.error("Error fetching data en Lista Campaña:", L);
1860
2027
  } finally {
1861
- s(!1);
2028
+ l(!1);
2029
+ }
2030
+ }, _ = async () => {
2031
+ try {
2032
+ const p = await g.get("/api/obtener-comerciales");
2033
+ return [...Ae].map((P) => (P.id === "ejecutivo" && (P.options = p.data.map((j) => ({
2034
+ id: j.nombre,
2035
+ name: j.nombre
2036
+ }))), P));
2037
+ } catch (p) {
2038
+ return console.error("Error fetching salesman data:", p), [...Ae];
1862
2039
  }
1863
2040
  };
1864
- _(() => {
1865
- w([
1866
- {
1867
- label: "Búsqueda",
1868
- type: "text",
1869
- id: "search"
1870
- },
1871
- {
1872
- label: "Responsable",
1873
- type: "select",
1874
- id: "responsable.responsableType",
1875
- options: [
1876
- { id: "yo_y_mis_equipos", name: "Yo y mis equipos" },
1877
- { id: "mis_equipos", name: "Mis equipos" },
1878
- { id: "yo", name: "Yo" }
1879
- ]
1880
- },
1881
- {
1882
- label: "Ejecutivo",
1883
- type: "text",
1884
- id: "ejecutivo"
1885
- }
1886
- ]);
1887
- }, []), _(() => {
1888
- const h = Math.floor(i / c) + 1;
1889
- v(h, c);
1890
- }, [i, c, m]);
1891
- const b = (h) => {
1892
- u(h.first), p(h.rows);
1893
- }, N = [
2041
+ T(() => {
2042
+ (async () => {
2043
+ const A = await _();
2044
+ w(A);
2045
+ })();
2046
+ }, []), T(() => {
2047
+ const p = Math.floor(i / c) + 1;
2048
+ y(p, c);
2049
+ }, [i, c, m, f]);
2050
+ const q = (p) => {
2051
+ d(p.first), h(p.rows);
2052
+ }, S = [
1894
2053
  { label: "5 filas", value: 5 },
1895
2054
  { label: "10 filas", value: 10 },
1896
2055
  { label: "15 filas", value: 15 },
1897
2056
  { label: "20 filas", value: 20 },
1898
2057
  { label: "25 filas", value: 25 },
1899
2058
  { label: "50 filas", value: 50 }
1900
- ], F = (h) => {
1901
- const S = parseInt(h.target.value, 10);
1902
- p(S), b({ first: 0, rows: S });
1903
- }, T = (h) => {
1904
- x((S) => S === h ? `${h}:desc` : h);
1905
- }, A = (h) => m === h ? "↑↓" : m === `${h}:desc` ? "↓↑" : "↑↓";
1906
- return /* @__PURE__ */ e("div", { className: "table-container", children: l ? /* @__PURE__ */ e("div", { style: { width: "100%" }, children: /* @__PURE__ */ e(ze, {}) }) : /* @__PURE__ */ o(q, { children: [
2059
+ ], z = (p) => {
2060
+ const A = parseInt(p.target.value, 10);
2061
+ h(A), q({ first: 0, rows: A });
2062
+ }, B = (p) => {
2063
+ x((A) => A === p ? `${p}:desc` : p);
2064
+ }, R = (p) => m === p ? "↑↓" : m === `${p}:desc` ? "↓↑" : "↑↓";
2065
+ return /* @__PURE__ */ e("div", { className: "table-container", children: n ? /* @__PURE__ */ e("div", { style: { width: "100%" }, children: /* @__PURE__ */ e(Oe, {}) }) : /* @__PURE__ */ o(D, { children: [
1907
2066
  /* @__PURE__ */ o(
1908
2067
  "table",
1909
2068
  {
@@ -1914,15 +2073,15 @@ const zt = () => {
1914
2073
  borderSpacing: "0"
1915
2074
  },
1916
2075
  children: [
1917
- /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ o("tr", { children: [
1918
- /* @__PURE__ */ o("th", { onClick: () => T("nombre"), children: [
1919
- /* @__PURE__ */ e("label", { style: { color: "#C4C4C4", fontSize: "10px" }, children: A("nombre") }),
2076
+ /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ o("tr", { style: { color: "#F5F5F5" }, children: [
2077
+ /* @__PURE__ */ o("th", { onClick: () => B("nombre"), children: [
2078
+ /* @__PURE__ */ e("label", { style: { color: "#C4C4C4", fontSize: "10px" }, children: R("nombre") }),
1920
2079
  "Campaña"
1921
2080
  ] }),
1922
2081
  /* @__PURE__ */ e(
1923
2082
  "th",
1924
2083
  {
1925
- onClick: () => T("inicia"),
2084
+ onClick: () => B("inicia"),
1926
2085
  style: { textAlign: "center", whiteSpace: "nowrap" },
1927
2086
  children: /* @__PURE__ */ o(
1928
2087
  "div",
@@ -1933,10 +2092,10 @@ const zt = () => {
1933
2092
  width: "fit-content"
1934
2093
  },
1935
2094
  children: [
1936
- /* @__PURE__ */ e("label", { style: { color: "#C4C4C4", fontSize: "10px" }, children: A("inicia") }),
2095
+ /* @__PURE__ */ e("label", { style: { color: "#C4C4C4", fontSize: "10px" }, children: R("inicia") }),
1937
2096
  " ",
1938
2097
  /* @__PURE__ */ e(
1939
- C,
2098
+ F,
1940
2099
  {
1941
2100
  icon: "calendar",
1942
2101
  size: "xs",
@@ -1953,7 +2112,7 @@ const zt = () => {
1953
2112
  /* @__PURE__ */ e(
1954
2113
  "th",
1955
2114
  {
1956
- onClick: () => T("termina"),
2115
+ onClick: () => B("termina"),
1957
2116
  style: { whiteSpace: "nowrap", textAlign: "center" },
1958
2117
  children: /* @__PURE__ */ o(
1959
2118
  "div",
@@ -1971,11 +2130,11 @@ const zt = () => {
1971
2130
  color: "#C4C4C4",
1972
2131
  fontSize: "10px"
1973
2132
  },
1974
- children: A("termina")
2133
+ children: R("termina")
1975
2134
  }
1976
2135
  ),
1977
2136
  /* @__PURE__ */ e(
1978
- C,
2137
+ F,
1979
2138
  {
1980
2139
  icon: "calendar",
1981
2140
  size: "xs",
@@ -1992,98 +2151,111 @@ const zt = () => {
1992
2151
  /* @__PURE__ */ e("th", { children: "Status" }),
1993
2152
  /* @__PURE__ */ e("th", { children: "Responsable" })
1994
2153
  ] }) }),
1995
- /* @__PURE__ */ e("tbody", { children: r == null ? void 0 : r.map((h, S) => {
1996
- var D, j, M, B, R, U, Q, de, ue, me, pe, he, xe, ge, fe, be;
1997
- return /* @__PURE__ */ o("tr", { className: "table-row", children: [
1998
- /* @__PURE__ */ e("td", { children: (D = h == null ? void 0 : h.campania) == null ? void 0 : D.nombre }),
1999
- /* @__PURE__ */ o("td", { children: [
2000
- " ",
2001
- (j = h == null ? void 0 : h.campania) == null ? void 0 : j.inicia
2002
- ] }),
2003
- /* @__PURE__ */ e("td", { children: (M = h == null ? void 0 : h.campania) == null ? void 0 : M.termina }),
2004
- /* @__PURE__ */ e("td", { children: /* @__PURE__ */ o(
2005
- "div",
2006
- {
2007
- style: {
2008
- display: "flex",
2009
- alignItems: "center",
2010
- gap: "15px",
2011
- padding: "none",
2012
- fontSize: "10px",
2013
- width: "auto",
2014
- minWidth: "170px"
2015
- },
2016
- children: [
2017
- /* @__PURE__ */ o(
2018
- "label",
2019
- {
2020
- style: {
2021
- width: "50px",
2022
- minWidth: "50px",
2023
- textAlign: "right",
2024
- color: "#000"
2025
- },
2026
- children: [
2027
- h == null ? void 0 : h.progreso,
2028
- "%"
2029
- ]
2030
- }
2031
- ),
2032
- /* @__PURE__ */ e(
2033
- "div",
2034
- {
2035
- style: {
2036
- position: "relative",
2037
- height: "10px",
2038
- flex: 1,
2039
- backgroundColor: "#C4C4C4",
2040
- borderRadius: "10px",
2041
- overflow: "hidden"
2042
- },
2043
- children: /* @__PURE__ */ e(
2154
+ /* @__PURE__ */ e("tbody", { children: s == null ? void 0 : s.map((p, A) => {
2155
+ var P, j, I, L, K, J, ge, xe, fe, be, ye, we, ve, Ne, Ce, _e;
2156
+ return /* @__PURE__ */ o(
2157
+ "tr",
2158
+ {
2159
+ className: "table-row",
2160
+ onClick: () => {
2161
+ t({
2162
+ id: p == null ? void 0 : p.id,
2163
+ project: p == null ? void 0 : p.nombre
2164
+ }), r("kanban-campania");
2165
+ },
2166
+ children: [
2167
+ /* @__PURE__ */ e("td", { children: (P = p == null ? void 0 : p.campania) == null ? void 0 : P.nombre }),
2168
+ /* @__PURE__ */ o("td", { children: [
2169
+ " ",
2170
+ (j = p == null ? void 0 : p.campania) == null ? void 0 : j.inicia
2171
+ ] }),
2172
+ /* @__PURE__ */ e("td", { children: (I = p == null ? void 0 : p.campania) == null ? void 0 : I.termina }),
2173
+ /* @__PURE__ */ e("td", { children: /* @__PURE__ */ o(
2174
+ "div",
2175
+ {
2176
+ style: {
2177
+ display: "flex",
2178
+ alignItems: "center",
2179
+ gap: "15px",
2180
+ padding: "none",
2181
+ fontSize: "10px",
2182
+ width: "auto",
2183
+ minWidth: "170px"
2184
+ },
2185
+ children: [
2186
+ /* @__PURE__ */ o(
2187
+ "label",
2188
+ {
2189
+ style: {
2190
+ width: "50px",
2191
+ minWidth: "50px",
2192
+ textAlign: "right",
2193
+ color: "#000"
2194
+ },
2195
+ children: [
2196
+ p == null ? void 0 : p.progreso,
2197
+ "%"
2198
+ ]
2199
+ }
2200
+ ),
2201
+ /* @__PURE__ */ e(
2044
2202
  "div",
2045
2203
  {
2046
2204
  style: {
2047
- position: "absolute",
2048
- top: 0,
2049
- left: 0,
2050
- height: "100%",
2051
- width: `${h.progreso}%`,
2052
- backgroundColor: h.progreso === 100 ? "#039B59" : h.progreso > 50 ? "#3658C1" : h.progreso > 0 ? "#DC8921" : "#C4C4C4",
2205
+ position: "relative",
2206
+ height: "10px",
2207
+ flex: 1,
2208
+ backgroundColor: "#C4C4C4",
2053
2209
  borderRadius: "10px",
2054
- transition: "width 0.3s ease-in-out"
2055
- }
2210
+ overflow: "hidden"
2211
+ },
2212
+ children: /* @__PURE__ */ e(
2213
+ "div",
2214
+ {
2215
+ style: {
2216
+ position: "absolute",
2217
+ top: 0,
2218
+ left: 0,
2219
+ height: "100%",
2220
+ width: `${p.progreso}%`,
2221
+ backgroundColor: p.progreso === 100 ? "#039B59" : p.progreso > 50 ? "#3658C1" : p.progreso > 0 ? "#DC8921" : "#C4C4C4",
2222
+ borderRadius: "10px",
2223
+ transition: "width 0.3s ease-in-out"
2224
+ }
2225
+ }
2226
+ )
2056
2227
  }
2057
2228
  )
2058
- }
2059
- )
2060
- ]
2061
- }
2062
- ) }),
2063
- /* @__PURE__ */ e("td", { children: /* @__PURE__ */ o("div", { className: "avatar-container", children: [
2064
- /* @__PURE__ */ o(J, { className: "w-[28px] h-[28px]", children: [
2065
- /* @__PURE__ */ e(
2066
- Z,
2067
- {
2068
- src: `${Le}${(de = (Q = (U = (R = (B = h == null ? void 0 : h.campania) == null ? void 0 : B.responsable) == null ? void 0 : R.imagen) == null ? void 0 : U.formats) == null ? void 0 : Q.thumbnail) == null ? void 0 : de.url}`,
2069
- alt: (pe = (me = (ue = h == null ? void 0 : h.campania) == null ? void 0 : ue.responsable) == null ? void 0 : me.nombre) == null ? void 0 : pe.charAt(
2070
- 0
2071
- )
2229
+ ]
2072
2230
  }
2073
- ),
2074
- /* @__PURE__ */ e(
2075
- k,
2076
- {
2077
- style: {
2078
- boxShadow: "10px 5px 10px rgba(0, 0, 0, 0.5)"
2079
- },
2080
- children: (ge = (xe = (he = h == null ? void 0 : h.campania) == null ? void 0 : he.responsable) == null ? void 0 : xe.nombre) == null ? void 0 : ge.charAt(0)
2081
- }
2082
- )
2083
- ] }),
2084
- /* @__PURE__ */ e("span", { style: { marginLeft: "8px", fontSize: "10px" }, children: (be = (fe = h == null ? void 0 : h.campania) == null ? void 0 : fe.responsable) == null ? void 0 : be.nombre })
2085
- ] }) })
2086
- ] }, S);
2231
+ ) }),
2232
+ /* @__PURE__ */ e("td", { children: /* @__PURE__ */ o("div", { className: "avatar-container", children: [
2233
+ /* @__PURE__ */ o(Z, { className: "avatar w-[28px] h-[28px]", children: [
2234
+ /* @__PURE__ */ e(
2235
+ k,
2236
+ {
2237
+ src: `${Ke}${(xe = (ge = (J = (K = (L = p == null ? void 0 : p.campania) == null ? void 0 : L.responsable) == null ? void 0 : K.imagen) == null ? void 0 : J.formats) == null ? void 0 : ge.thumbnail) == null ? void 0 : xe.url}`,
2238
+ alt: (ye = (be = (fe = p == null ? void 0 : p.campania) == null ? void 0 : fe.responsable) == null ? void 0 : be.nombre) == null ? void 0 : ye.charAt(
2239
+ 0
2240
+ )
2241
+ }
2242
+ ),
2243
+ /* @__PURE__ */ e(
2244
+ ee,
2245
+ {
2246
+ style: {
2247
+ boxShadow: "10px 5px 10px rgba(0, 0, 0, 0.5)"
2248
+ },
2249
+ children: (Ne = (ve = (we = p == null ? void 0 : p.campania) == null ? void 0 : we.responsable) == null ? void 0 : ve.nombre) == null ? void 0 : Ne.charAt(0)
2250
+ }
2251
+ )
2252
+ ] }),
2253
+ /* @__PURE__ */ e("span", { style: { marginLeft: "8px", fontSize: "10px" }, children: (_e = (Ce = p == null ? void 0 : p.campania) == null ? void 0 : Ce.responsable) == null ? void 0 : _e.nombre })
2254
+ ] }) })
2255
+ ]
2256
+ },
2257
+ A
2258
+ );
2087
2259
  }) })
2088
2260
  ]
2089
2261
  }
@@ -2107,24 +2279,23 @@ const zt = () => {
2107
2279
  textAlign: "left",
2108
2280
  width: "auto",
2109
2281
  height: "auto",
2110
- padding: "12px",
2111
2282
  whiteSpace: "nowrap"
2112
2283
  },
2113
2284
  children: [
2114
- r.length,
2285
+ s.length,
2115
2286
  " elementos de ",
2116
- d
2287
+ u
2117
2288
  ]
2118
2289
  }
2119
2290
  ),
2120
2291
  /* @__PURE__ */ e(
2121
- tt,
2292
+ st,
2122
2293
  {
2123
2294
  first: i,
2124
2295
  rows: c,
2125
- totalRecords: d,
2296
+ totalRecords: u,
2126
2297
  rowsPerPageOptions: [5, 10, 20, 50],
2127
- onPageChange: b,
2298
+ onPageChange: q,
2128
2299
  className: "pagination",
2129
2300
  template: "FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink"
2130
2301
  }
@@ -2144,16 +2315,16 @@ const zt = () => {
2144
2315
  {
2145
2316
  className: "select",
2146
2317
  value: c,
2147
- onChange: (h) => F(h),
2148
- children: N.map((h) => /* @__PURE__ */ e(
2318
+ onChange: (p) => z(p),
2319
+ children: S.map((p) => /* @__PURE__ */ e(
2149
2320
  "option",
2150
2321
  {
2151
2322
  className: "option-select",
2152
- value: h.value,
2323
+ value: p.value,
2153
2324
  style: { background: "#F5F5F5" },
2154
- children: h.label
2325
+ children: p.label
2155
2326
  },
2156
- h.value
2327
+ p.value
2157
2328
  ))
2158
2329
  }
2159
2330
  )
@@ -2164,54 +2335,55 @@ const zt = () => {
2164
2335
  }
2165
2336
  )
2166
2337
  ] }) });
2167
- }, Gt = ({ path: a, tab: t, setPath: r, project: n, setProject: l }) => {
2168
- const s = {
2169
- "kanban-general": { kanban: /* @__PURE__ */ e(Rt, {}) },
2338
+ }, Zt = ({ path: r, tab: t, setPath: s, project: a, setProject: n }) => {
2339
+ const l = {
2340
+ "kanban-general": { kanban: /* @__PURE__ */ e(Qt, {}) },
2170
2341
  "lista-campanias": {
2171
- lista: /* @__PURE__ */ e(Vt, { setPath: r, setProject: l }),
2342
+ lista: /* @__PURE__ */ e(Jt, { setPath: s, setProject: n }),
2172
2343
  gantt: /* @__PURE__ */ e("div", { children: "gantt-campanias" })
2173
2344
  },
2174
2345
  "kanban-campania": {
2175
- kanban: /* @__PURE__ */ e(qt, {}),
2176
- lista: /* @__PURE__ */ e(Ht, {}),
2346
+ kanban: /* @__PURE__ */ e($t, {}),
2347
+ lista: /* @__PURE__ */ e(Xt, {}),
2177
2348
  gantt: /* @__PURE__ */ e("div", { children: "kanban-campania-gantt" })
2178
2349
  }
2179
2350
  };
2180
- return a === "kanban-campania" ? /* @__PURE__ */ e(ut, { project: n == null ? void 0 : n.id, children: s[a][t] }) : s[a][t];
2181
- }, Yt = ({ path: a }) => /* @__PURE__ */ e(lt, { children: /* @__PURE__ */ e(() => {
2182
- const { selectPath: r, updateFilters: n, applyFilters: l } = $(), [s, i] = y("kanban"), [u, c] = y(a), [p, d] = y({
2351
+ return r === "kanban-campania" ? /* @__PURE__ */ e(gt, { project: a == null ? void 0 : a.id, children: l[r][t] }) : l[r][t];
2352
+ }, kt = ({ path: r }) => /* @__PURE__ */ e(ct, { children: /* @__PURE__ */ e(() => {
2353
+ const { selectPath: s, updateFilters: a, applyFilters: n } = $(), [l, i] = N("kanban"), [d, c] = N(r), [h, u] = N({
2183
2354
  id: 1839,
2184
2355
  project: "Kanban de Campania"
2185
- }), [g, m] = y(""), x = L(null);
2186
- _(() => {
2187
- i("kanban"), r(u);
2188
- }, [a]), _(() => {
2189
- (g == null ? void 0 : g.trim()) === "" && n({
2356
+ }), [b, m] = N(""), x = W(null);
2357
+ T(() => {
2358
+ i(d === "lista-campanias" ? "lista" : "kanban"), s(d);
2359
+ }, [r, d]), T(() => {
2360
+ (b == null ? void 0 : b.trim()) === "" && a({
2190
2361
  name: "taskName",
2191
2362
  value: null
2192
- }), l();
2193
- }, [g]);
2194
- const w = (N) => ({
2363
+ }), n();
2364
+ }, [b]);
2365
+ const f = (y) => ({
2195
2366
  "kanban-general": "Kanban General",
2196
2367
  "lista-campanias": "Campanias",
2197
- "kanban-campania": `Kanban de ${p.project}`
2198
- })[N], f = (N) => {
2199
- c(N);
2200
- }, v = ["lista-campanias", "kanban-campania"], b = {
2368
+ "kanban-campania": `Kanban de ${h.project}`
2369
+ })[y], w = (y) => {
2370
+ c(y);
2371
+ }, g = ["lista-campanias", "kanban-campania"], v = {
2201
2372
  "lista-campanias": ["lista", "gantt"],
2202
2373
  "kanban-campania": ["kanban", "lista", "gantt"]
2203
2374
  };
2204
2375
  return /* @__PURE__ */ o("div", { className: "bg-bg-card p-m rounded-lg border border-gray-200 flex flex-col gap-m w-full h-full min-h-[100%] relative overflow-hidden", children: [
2205
2376
  /* @__PURE__ */ o("div", { className: "w-full justify-between flex items-end border-b border-gray-200 pb-m px-l flex-wrap gap-l", children: [
2206
2377
  /* @__PURE__ */ o("div", { className: "flex gap-xl", children: [
2207
- /* @__PURE__ */ e("h2", { className: "text-texts font-medium", children: w(u) }),
2208
- v.includes(u) && /* @__PURE__ */ e(
2209
- nt,
2378
+ /* @__PURE__ */ e("h2", { className: "text-texts font-medium", children: f(d) }),
2379
+ g.includes(d) && /* @__PURE__ */ e(
2380
+ it,
2210
2381
  {
2211
- tabs: b[u],
2212
- renderItem: (N) => {
2213
- i(N);
2214
- }
2382
+ tabs: v[d],
2383
+ renderItem: (y) => {
2384
+ i(y);
2385
+ },
2386
+ initialTab: l
2215
2387
  }
2216
2388
  )
2217
2389
  ] }),
@@ -2219,13 +2391,13 @@ const zt = () => {
2219
2391
  /* @__PURE__ */ e(
2220
2392
  "input",
2221
2393
  {
2222
- onChange: Pe(
2223
- (N) => {
2224
- var F, T, A;
2225
- n({
2394
+ onChange: $e(
2395
+ (y) => {
2396
+ var _, q, S;
2397
+ a({
2226
2398
  name: "taskName",
2227
- value: (T = (F = N == null ? void 0 : N.target) == null ? void 0 : F.value) == null ? void 0 : T.trim()
2228
- }), m((A = N == null ? void 0 : N.target) == null ? void 0 : A.value);
2399
+ value: (q = (_ = y == null ? void 0 : y.target) == null ? void 0 : _.value) == null ? void 0 : q.trim()
2400
+ }), m((S = y == null ? void 0 : y.target) == null ? void 0 : S.value);
2229
2401
  },
2230
2402
  1e3
2231
2403
  ),
@@ -2235,7 +2407,7 @@ const zt = () => {
2235
2407
  }
2236
2408
  ),
2237
2409
  /* @__PURE__ */ e(
2238
- rt,
2410
+ ot,
2239
2411
  {
2240
2412
  filterChildren: x,
2241
2413
  children: /* @__PURE__ */ e(
@@ -2243,42 +2415,42 @@ const zt = () => {
2243
2415
  {
2244
2416
  ref: x,
2245
2417
  className: "w-max max-w-[400px] h-fit bg-bg-card shadow-lg rounded-lg p-l",
2246
- children: /* @__PURE__ */ e(st, {})
2418
+ children: /* @__PURE__ */ e(dt, {})
2247
2419
  }
2248
2420
  )
2249
2421
  }
2250
2422
  )
2251
2423
  ] })
2252
2424
  ] }),
2253
- /* @__PURE__ */ e("div", { className: "overflow-auto scrollbar-none", children: /* @__PURE__ */ e(
2254
- Gt,
2425
+ /* @__PURE__ */ e("div", { className: "overflow-hidden scrollbar-none", children: /* @__PURE__ */ e(
2426
+ Zt,
2255
2427
  {
2256
- path: u,
2257
- tab: s,
2258
- setPath: f,
2259
- project: p,
2260
- setProject: d
2428
+ path: d,
2429
+ tab: l,
2430
+ setPath: w,
2431
+ project: h,
2432
+ setProject: u
2261
2433
  }
2262
2434
  ) })
2263
2435
  ] });
2264
- }, {}) }), Xt = () => /* @__PURE__ */ e("div", { className: "w-full h-full min-h-[100%] relative", children: /* @__PURE__ */ e("div", { className: "flex justify-center items-center h-full", children: /* @__PURE__ */ o("div", { className: "text-2xl font-bold flex flex-col items-center", children: [
2436
+ }, {}) }), ea = () => /* @__PURE__ */ e("div", { className: "w-full h-full min-h-[100%] relative", children: /* @__PURE__ */ e("div", { className: "flex justify-center items-center h-full", children: /* @__PURE__ */ o("div", { className: "text-2xl font-bold flex flex-col items-center", children: [
2265
2437
  /* @__PURE__ */ e("div", { className: "w-10 h-10 bg-primary-regular rounded-full animate-pulse" }),
2266
2438
  /* @__PURE__ */ e("p", { className: "text-l text-texts-enfasis", children: "un momento..." }),
2267
2439
  /* @__PURE__ */ e("p", { className: "text-sm text-texts-placeholder", children: "estamos buscando tu usuario" })
2268
- ] }) }) }), Jt = () => /* @__PURE__ */ e("div", { className: "w-full h-full min-h-[100%] relative", children: /* @__PURE__ */ e("div", { className: "flex justify-center items-center h-full", children: /* @__PURE__ */ o("div", { className: "text-2xl font-bold flex flex-col items-center", children: [
2440
+ ] }) }) }), ta = () => /* @__PURE__ */ e("div", { className: "w-full h-full min-h-[100%] relative", children: /* @__PURE__ */ e("div", { className: "flex justify-center items-center h-full", children: /* @__PURE__ */ o("div", { className: "text-2xl font-bold flex flex-col items-center", children: [
2269
2441
  /* @__PURE__ */ e("div", { className: "w-10 h-10 bg-primary-regular rounded-full animate-pulse" }),
2270
2442
  /* @__PURE__ */ e("p", { className: "text-l text-texts-enfasis", children: "No encontramos tu acceso" }),
2271
2443
  /* @__PURE__ */ e("p", { className: "text-sm text-texts-placeholder", children: "por favor, contacta al administrador" })
2272
- ] }) }) }), ua = ({ path: a, user: t, url: r }) => {
2273
- const n = new Ue();
2274
- if (!t) return /* @__PURE__ */ e(Xt, {});
2275
- if (!t.accessToken) return /* @__PURE__ */ e(Jt, {});
2276
- let l = { user: t, url: r };
2277
- return /* @__PURE__ */ e(q, { children: /* @__PURE__ */ e(dt, { ...l, children: /* @__PURE__ */ e(ct, { ...l, children: /* @__PURE__ */ e("div", { className: "w-full h-full min-h-[100%] relative", children: /* @__PURE__ */ o(Qe, { client: n, children: [
2278
- /* @__PURE__ */ e(Yt, { path: a }),
2444
+ ] }) }) }), ga = ({ path: r, user: t, url: s }) => {
2445
+ const a = new Ge();
2446
+ if (!t) return /* @__PURE__ */ e(ea, {});
2447
+ if (!t.accessToken) return /* @__PURE__ */ e(ta, {});
2448
+ let n = { user: t, url: s };
2449
+ return /* @__PURE__ */ e(D, { children: /* @__PURE__ */ e(ht, { ...n, children: /* @__PURE__ */ e(pt, { ...n, children: /* @__PURE__ */ e("div", { className: "w-full h-full min-h-[100%] relative", children: /* @__PURE__ */ o(Ye, { client: a, children: [
2450
+ /* @__PURE__ */ e(kt, { path: r }),
2279
2451
  " "
2280
2452
  ] }) }) }) }) });
2281
2453
  };
2282
2454
  export {
2283
- ua as AppTasks
2455
+ ga as AppTasks
2284
2456
  };