sass-template-common 0.1.33 → 0.1.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
- import { jsx as a, jsxs as m, Fragment as $ } from "react/jsx-runtime";
1
+ import { jsx as a, jsxs as m, Fragment as K } from "react/jsx-runtime";
2
2
  import * as ka from "react";
3
- import Ee, { useState as Y, useRef as Br, useCallback as he, useEffect as De, createElement as ot, forwardRef as Or, Fragment as gn, useMemo as jo, Component as Qo } from "react";
3
+ import Ee, { useState as $, useRef as Br, useCallback as he, useEffect as De, createElement as ot, forwardRef as Or, Fragment as gn, useMemo as jo, Component as Qo } from "react";
4
4
  let ea = {
5
5
  PUBLIC_API_HOST: "https://dev-saas.cms-medios.com",
6
6
  PUBLIC_API_FRONT: "https://dev-lahora.cms-medios.com",
@@ -83,7 +83,7 @@ const Go = () => {
83
83
  o[s] = s;
84
84
  }), o;
85
85
  }, [t]), { ANALYTICS_ga4: r } = X();
86
- return r && /* @__PURE__ */ m($, { children: [
86
+ return r && /* @__PURE__ */ m(K, { children: [
87
87
  /* @__PURE__ */ a("script", { defer: !0, src: "https://www.googletagmanager.com/gtag/js?" + e }),
88
88
  /* @__PURE__ */ a(
89
89
  "script",
@@ -106,7 +106,7 @@ const Go = () => {
106
106
  ] });
107
107
  }, Vo = () => {
108
108
  const { ANALYTICS_gtm: e } = X();
109
- return e && /* @__PURE__ */ m($, { children: [
109
+ return e && /* @__PURE__ */ m(K, { children: [
110
110
  /* @__PURE__ */ a(
111
111
  "script",
112
112
  {
@@ -174,7 +174,7 @@ function Pr() {
174
174
  return M === void 0;
175
175
  } }, v = "en", B = {};
176
176
  B[v] = S;
177
- var L = "$isDayjsObject", K = function(M) {
177
+ var L = "$isDayjsObject", Y = function(M) {
178
178
  return M instanceof ee || !(!M || !M[L]);
179
179
  }, te = function M(U, E, D) {
180
180
  var T;
@@ -190,11 +190,11 @@ function Pr() {
190
190
  }
191
191
  return !D && T && (v = T), T || !D && v;
192
192
  }, Q = function(M, U) {
193
- if (K(M)) return M.clone();
193
+ if (Y(M)) return M.clone();
194
194
  var E = typeof U == "object" ? U : {};
195
195
  return E.date = M, E.args = arguments, new ee(E);
196
196
  }, P = x;
197
- P.l = te, P.i = K, P.w = function(M, U) {
197
+ P.l = te, P.i = Y, P.w = function(M, U) {
198
198
  return Q(M, { locale: U.$L, utc: U.$u, x: U.$x, $offset: U.$offset });
199
199
  };
200
200
  var ee = (function() {
@@ -419,7 +419,7 @@ function Pr() {
419
419
  };
420
420
  })), Q.extend = function(M, U) {
421
421
  return M.$i || (M(U, ee, Q), M.$i = !0), Q;
422
- }, Q.locale = te, Q.isDayjs = K, Q.unix = function(M) {
422
+ }, Q.locale = te, Q.isDayjs = Y, Q.unix = function(M) {
423
423
  return Q(1e3 * M);
424
424
  }, Q.en = B[v], Q.Ls = B, Q.p = {}, Q;
425
425
  }));
@@ -452,8 +452,8 @@ function Ko() {
452
452
  }
453
453
  }
454
454
  if (u) return p;
455
- var K = w ? _.future : _.past;
456
- return typeof K == "function" ? K(p) : K.replace("%s", p);
455
+ var Y = w ? _.future : _.past;
456
+ return typeof Y == "function" ? Y(p) : Y.replace("%s", p);
457
457
  }, s.to = function(l, u) {
458
458
  return c(l, u, this, !0);
459
459
  }, s.from = function(l, u) {
@@ -527,8 +527,8 @@ function ns() {
527
527
  v === void 0 && (v = "");
528
528
  var B = v.match(r);
529
529
  if (!B) return null;
530
- var L = ("" + B[0]).match(o) || ["-", 0, 0], K = L[0], te = 60 * +L[1] + +L[2];
531
- return te === 0 ? 0 : K === "+" ? te : -te;
530
+ var L = ("" + B[0]).match(o) || ["-", 0, 0], Y = L[0], te = 60 * +L[1] + +L[2];
531
+ return te === 0 ? 0 : Y === "+" ? te : -te;
532
532
  })(p), p === null)) return this;
533
533
  var S = Math.abs(p) <= 16 ? 60 * p : p;
534
534
  if (S === 0) return this.utc(w);
@@ -588,8 +588,8 @@ function ss() {
588
588
  var _ = g[w], S = _.type, N = _.value, x = n[S];
589
589
  x >= 0 && (p[x] = parseInt(N, 10));
590
590
  }
591
- var v = p[3], B = v === 24 ? 0 : v, L = p[0] + "-" + p[1] + "-" + p[2] + " " + B + ":" + p[4] + ":" + p[5] + ":000", K = +f;
592
- return (i.utc(L).valueOf() - (K -= K % 1e3)) / 6e4;
591
+ var v = p[3], B = v === 24 ? 0 : v, L = p[0] + "-" + p[1] + "-" + p[2] + " " + B + ":" + p[4] + ":" + p[5] + ":000", Y = +f;
592
+ return (i.utc(L).valueOf() - (Y -= Y % 1e3)) / 6e4;
593
593
  }, u = s.prototype;
594
594
  u.tz = function(f, y) {
595
595
  f === void 0 && (f = c);
@@ -614,10 +614,10 @@ function ss() {
614
614
  }, i.tz = function(f, y, g) {
615
615
  var p = g && y, w = g || y || c, _ = l(+i(), w);
616
616
  if (typeof f != "string") return i(f).tz(w);
617
- var S = (function(B, L, K) {
618
- var te = B - 60 * L * 1e3, Q = l(te, K);
617
+ var S = (function(B, L, Y) {
618
+ var te = B - 60 * L * 1e3, Q = l(te, Y);
619
619
  if (L === Q) return [te, L];
620
- var P = l(te -= 60 * (Q - L) * 1e3, K);
620
+ var P = l(te -= 60 * (Q - L) * 1e3, Y);
621
621
  return Q === P ? [te, Q] : [B - 60 * Math.min(Q, P) * 1e3, Math.max(Q, P)];
622
622
  })(i.utc(f, p).valueOf(), _, w), N = S[0], x = S[1], v = i(N).utcOffset(x);
623
623
  return v.$x.$timezone = w, v;
@@ -901,7 +901,7 @@ const pn = () => {
901
901
  const t = e.banners.find((s) => s.key === e.name);
902
902
  if (!t || !t.show) return null;
903
903
  const n = fa(t.value || "", e.replaces), r = /<script([^>]*)>([\s\S]*?)<\/script\s*>/gi, o = [...n.matchAll(r)];
904
- return /* @__PURE__ */ a($, { children: o.map((s, i) => {
904
+ return /* @__PURE__ */ a(K, { children: o.map((s, i) => {
905
905
  const c = s[1] || "", d = s[2]?.trim() || "", l = c.match(/src=["']([^"']+)["']/i);
906
906
  if (l) {
907
907
  const u = l[1];
@@ -920,7 +920,7 @@ const pn = () => {
920
920
  const t = e.banners.find((o) => o.key === e.name);
921
921
  if (!t || !t.show) return null;
922
922
  const r = fa(t.value || "", e.replaces).split(/(<script[\s\S]*?<\/script\s*>)/gi);
923
- return /* @__PURE__ */ a($, { children: r.map((o, s) => {
923
+ return /* @__PURE__ */ a(K, { children: r.map((o, s) => {
924
924
  const i = o.match(
925
925
  /<script([^>]*)>([\s\S]*?)<\/script\s*>/i
926
926
  );
@@ -960,7 +960,7 @@ function y3(e) {
960
960
  const ys = () => {
961
961
  const { PUBLIC_ASSETS_URL: e } = X();
962
962
  return e && e !== "false" && /* @__PURE__ */ a("link", { rel: "preconnect", href: e, crossOrigin: "anonymous" });
963
- }, { PUBLIC_ASSETS_URL: Rn } = X(), vs = Rn && Rn !== "false" ? Rn : "", Pa = ({ images: e }) => /* @__PURE__ */ a($, { children: e.map(
963
+ }, { PUBLIC_ASSETS_URL: Rn } = X(), vs = Rn && Rn !== "false" ? Rn : "", Pa = ({ images: e }) => /* @__PURE__ */ a(K, { children: e.map(
964
964
  (t, n) => t.href !== "" && /* @__PURE__ */ a(
965
965
  "link",
966
966
  {
@@ -1224,7 +1224,7 @@ const Ts = async ({
1224
1224
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
1225
1225
  }
1226
1226
  `;
1227
- return /* @__PURE__ */ a($, { children: e.useS3Font ? /* @__PURE__ */ m($, { children: [
1227
+ return /* @__PURE__ */ a(K, { children: e.useS3Font ? /* @__PURE__ */ m(K, { children: [
1228
1228
  /* @__PURE__ */ a(
1229
1229
  "link",
1230
1230
  {
@@ -2710,7 +2710,7 @@ const co = (e) => {
2710
2710
  onDownloadProgress: v,
2711
2711
  onUploadProgress: B,
2712
2712
  responseType: L,
2713
- headers: K,
2713
+ headers: Y,
2714
2714
  withCredentials: te = "same-origin",
2715
2715
  fetchOptions: Q
2716
2716
  } = co(g), P = t || fetch;
@@ -2721,13 +2721,13 @@ const co = (e) => {
2721
2721
  });
2722
2722
  let U;
2723
2723
  try {
2724
- if (B && l && w !== "get" && w !== "head" && (U = await y(K, _)) !== 0) {
2724
+ if (B && l && w !== "get" && w !== "head" && (U = await y(Y, _)) !== 0) {
2725
2725
  let C = new n(p, {
2726
2726
  method: "POST",
2727
2727
  body: _,
2728
2728
  duplex: "half"
2729
2729
  }), k;
2730
- if (b.isFormData(_) && (k = C.headers.get("content-type")) && K.setContentType(k), C.body) {
2730
+ if (b.isFormData(_) && (k = C.headers.get("content-type")) && Y.setContentType(k), C.body) {
2731
2731
  const [j, q] = Ha(
2732
2732
  U,
2733
2733
  An(za(B))
@@ -2740,7 +2740,7 @@ const co = (e) => {
2740
2740
  ...Q,
2741
2741
  signal: ee,
2742
2742
  method: w.toUpperCase(),
2743
- headers: K.normalize().toJSON(),
2743
+ headers: Y.normalize().toJSON(),
2744
2744
  body: _,
2745
2745
  duplex: "half",
2746
2746
  credentials: E ? te : void 0
@@ -3801,7 +3801,7 @@ async function F3({
3801
3801
  currentNew: l,
3802
3802
  internalPath: h
3803
3803
  });
3804
- return /* @__PURE__ */ m($, { children: [
3804
+ return /* @__PURE__ */ m(K, { children: [
3805
3805
  /* @__PURE__ */ a("meta", { charSet: "utf-8" }),
3806
3806
  /* @__PURE__ */ a("meta", { name: "viewport", content: "width=device-width" }),
3807
3807
  v,
@@ -3891,7 +3891,7 @@ const W3 = ({
3891
3891
  currentNew: c,
3892
3892
  internalPath: i
3893
3893
  }), y = l.before.active, g = l.after.active, p = y ? l.before.customData ? l.before.customData : f : void 0, w = g ? l.after.customData ? l.after.customData : f : void 0;
3894
- return /* @__PURE__ */ m($, { children: [
3894
+ return /* @__PURE__ */ m(K, { children: [
3895
3895
  /* @__PURE__ */ a(jr, { name: "bodybefore", banners: n, replaces: p }),
3896
3896
  e,
3897
3897
  /* @__PURE__ */ a(Fo, {}),
@@ -3942,7 +3942,7 @@ function yc({
3942
3942
  enableDrag: s,
3943
3943
  onIndexChange: i
3944
3944
  }) {
3945
- const [c, d] = Y(!1), [l, u] = Y(0), [h, f] = Y(0), [y, g] = Y(0), [p, w] = Y(0), [_, S] = Y(null), N = Br(null), [x, v] = Y(1), B = he(() => {
3945
+ const [c, d] = $(!1), [l, u] = $(0), [h, f] = $(0), [y, g] = $(0), [p, w] = $(0), [_, S] = $(null), N = Br(null), [x, v] = $(1), B = he(() => {
3946
3946
  if (o) return 1;
3947
3947
  const A = N.current?.offsetWidth || window.innerWidth, C = n + r, k = Math.floor(A / C);
3948
3948
  return Math.max(1, k);
@@ -3954,7 +3954,7 @@ function yc({
3954
3954
  };
3955
3955
  return A(), window.addEventListener("resize", A), () => window.removeEventListener("resize", A);
3956
3956
  }, [B]);
3957
- const K = he(() => {
3957
+ const Y = he(() => {
3958
3958
  const A = B();
3959
3959
  return Math.max(0, t - A);
3960
3960
  }, [t, B])(), te = he(() => {
@@ -3988,10 +3988,10 @@ function yc({
3988
3988
  ), ce = he(
3989
3989
  (A) => {
3990
3990
  if (!c || !s) return;
3991
- const C = A - l, k = (n + r) * 1.2, j = e === 0 && C > 0, q = e === K && C < 0, G = j || q ? Math.sign(C) * Math.min(Math.abs(C), k) : C;
3991
+ const C = A - l, k = (n + r) * 1.2, j = e === 0 && C > 0, q = e === Y && C < 0, G = j || q ? Math.sign(C) * Math.min(Math.abs(C), k) : C;
3992
3992
  f(A), g(G);
3993
3993
  },
3994
- [c, l, s, e, K, n, r]
3994
+ [c, l, s, e, Y, n, r]
3995
3995
  ), M = he(
3996
3996
  (A) => {
3997
3997
  ce(A.clientX);
@@ -4006,7 +4006,7 @@ function yc({
4006
4006
  const V = Math.max(0, e - z);
4007
4007
  i(V);
4008
4008
  } else {
4009
- const V = Math.min(K, e + z);
4009
+ const V = Math.min(Y, e + z);
4010
4010
  i(V);
4011
4011
  }
4012
4012
  d(!1), g(0), document.body.classList.remove("dragging"), document.removeEventListener("mousemove", M), document.removeEventListener("mouseup", U), A.clientX === l && _?.dispatchEvent(new PointerEvent("click"));
@@ -4017,7 +4017,7 @@ function yc({
4017
4017
  l,
4018
4018
  p,
4019
4019
  e,
4020
- K,
4020
+ Y,
4021
4021
  s,
4022
4022
  i,
4023
4023
  P,
@@ -4057,7 +4057,7 @@ function yc({
4057
4057
  isDragging: c,
4058
4058
  translateOffset: y,
4059
4059
  carrouselRef: N,
4060
- maxIndex: K,
4060
+ maxIndex: Y,
4061
4061
  getTranslateValue: Q,
4062
4062
  actualVisibleItems: x,
4063
4063
  dragHandlers: {
@@ -4079,7 +4079,7 @@ function Y3(e) {
4079
4079
  fullPageWidth: i = !1,
4080
4080
  pagination: c = !1,
4081
4081
  enableDrag: d = !0
4082
- } = e, l = Array.isArray(t) ? t : t?.props?.value?.split('<div style="display:none;">SPLITING</div>'), [u, h] = Y(0), [f, y] = Y(!1);
4082
+ } = e, l = Array.isArray(t) ? t : t?.props?.value?.split('<div style="display:none;">SPLITING</div>'), [u, h] = $(0), [f, y] = $(!1);
4083
4083
  De(() => {
4084
4084
  y(!0);
4085
4085
  const Q = document.getElementById("ssr-dummy_" + n);
@@ -4113,7 +4113,7 @@ function Y3(e) {
4113
4113
  v(u + 1);
4114
4114
  }, [u, v]);
4115
4115
  if (!f) return;
4116
- const K = S(u, p), te = i ? `translateX(${K}%)` : `translateX(${K}px)`;
4116
+ const Y = S(u, p), te = i ? `translateX(${Y}%)` : `translateX(${Y}px)`;
4117
4117
  return /* @__PURE__ */ m("div", { className: `${n}- carrousel-container`, children: [
4118
4118
  u > 0 && /* @__PURE__ */ a(
4119
4119
  "button",
@@ -4577,7 +4577,7 @@ const Et = (e) => {
4577
4577
  ) : e.main?.title?.section
4578
4578
  ),
4579
4579
  e.config?.showsubtitle && /* @__PURE__ */ a(o, {}),
4580
- (e?.config?.showtime || e.config?.showauthor) && /* @__PURE__ */ a($, { children: e.authors[0]?.internaluser ? /* @__PURE__ */ a("h3", { children: /* @__PURE__ */ a(
4580
+ (e?.config?.showtime || e.config?.showauthor) && /* @__PURE__ */ a(K, { children: e.authors[0]?.internaluser ? /* @__PURE__ */ a("h3", { children: /* @__PURE__ */ a(
4581
4581
  O,
4582
4582
  {
4583
4583
  "aria-label": r(),
@@ -4636,7 +4636,7 @@ const Et = (e) => {
4636
4636
  src: o[0]?.url ? o[0]?.url : void 0
4637
4637
  }
4638
4638
  ),
4639
- t && /* @__PURE__ */ m($, { children: [
4639
+ t && /* @__PURE__ */ m(K, { children: [
4640
4640
  /* @__PURE__ */ a(
4641
4641
  "div",
4642
4642
  {
@@ -4694,7 +4694,7 @@ const Et = (e) => {
4694
4694
  src: o[0]?.url ? o[0]?.url : ""
4695
4695
  }
4696
4696
  ),
4697
- t && /* @__PURE__ */ m($, { children: [
4697
+ t && /* @__PURE__ */ m(K, { children: [
4698
4698
  /* @__PURE__ */ a(
4699
4699
  "div",
4700
4700
  {
@@ -4741,7 +4741,7 @@ const Et = (e) => {
4741
4741
  isVideo: n = !1,
4742
4742
  hasShadow: r = !1,
4743
4743
  priorityHigh: o = !1
4744
- } = e, [s, i] = Y(void 0), c = t?.sizes;
4744
+ } = e, [s, i] = $(void 0), c = t?.sizes;
4745
4745
  return De(() => {
4746
4746
  (async () => {
4747
4747
  const { PUBLIC_IS_OFFLINE: l } = X();
@@ -6261,7 +6261,7 @@ const Et = (e) => {
6261
6261
  i
6262
6262
  )) })
6263
6263
  ] }),
6264
- o && /* @__PURE__ */ a($, { children: o }),
6264
+ o && /* @__PURE__ */ a(K, { children: o }),
6265
6265
  /* @__PURE__ */ m("section", { className: we.copyrigth, children: [
6266
6266
  /* @__PURE__ */ a("p", { className: we.copyrigthText, children: e.copyrigth }),
6267
6267
  /* @__PURE__ */ a(
@@ -6605,7 +6605,7 @@ const Md = "_content_xlsy2_1", jd = "_videoContent_xlsy2_39", Qd = "_articleSect
6605
6605
  children: e.children
6606
6606
  }
6607
6607
  ),
6608
- /* @__PURE__ */ a($, { children: e.paginatorComponent })
6608
+ /* @__PURE__ */ a(K, { children: e.paginatorComponent })
6609
6609
  ] });
6610
6610
  }, Xd = "_content_3pssn_1", e1 = "_newsDescription_3pssn_29", t1 = "_image_3pssn_81", Pt = {
6611
6611
  content: Xd,
@@ -6802,7 +6802,7 @@ const Md = "_content_xlsy2_1", jd = "_videoContent_xlsy2_39", Qd = "_articleSect
6802
6802
  /* @__PURE__ */ a(Ue, { preview: e.preview, isLarge: !0, priorityHigh: !0 }),
6803
6803
  t && /* @__PURE__ */ a("div", { className: vn.description, children: t })
6804
6804
  ] });
6805
- }, M1 = (e) => /* @__PURE__ */ a($, { children: /* @__PURE__ */ m("div", { className: et.boxInformation, children: [
6805
+ }, M1 = (e) => /* @__PURE__ */ a(K, { children: /* @__PURE__ */ m("div", { className: et.boxInformation, children: [
6806
6806
  /* @__PURE__ */ a(yo, { preview: e.preview }),
6807
6807
  /* @__PURE__ */ m("div", { className: et.textBox, children: [
6808
6808
  /* @__PURE__ */ m("div", { className: et.contentBox, children: [
@@ -7392,7 +7392,7 @@ const Md = "_content_xlsy2_1", jd = "_videoContent_xlsy2_39", Qd = "_articleSect
7392
7392
  children: t?.data[0]?.main?.title.home ?? ""
7393
7393
  }
7394
7394
  );
7395
- return /* @__PURE__ */ m($, { children: [
7395
+ return /* @__PURE__ */ m(K, { children: [
7396
7396
  /* @__PURE__ */ a(
7397
7397
  "input",
7398
7398
  {
@@ -7729,7 +7729,7 @@ const Md = "_content_xlsy2_1", jd = "_videoContent_xlsy2_39", Qd = "_articleSect
7729
7729
  op2: rm
7730
7730
  }, r9 = (e) => {
7731
7731
  const { alertZone: t, children: n, sidebar: r } = e;
7732
- return /* @__PURE__ */ m($, { children: [
7732
+ return /* @__PURE__ */ m(K, { children: [
7733
7733
  /* @__PURE__ */ a(kh, { ...e }),
7734
7734
  !e.showOnlyStickyHeader && /* @__PURE__ */ a(tm, { ...e }),
7735
7735
  /* @__PURE__ */ m(
@@ -8116,7 +8116,7 @@ const Md = "_content_xlsy2_1", jd = "_videoContent_xlsy2_39", Qd = "_articleSect
8116
8116
  }
8117
8117
  }
8118
8118
  ),
8119
- e?.config?.showtime && e.config?.showauthor && /* @__PURE__ */ a($, { children: e.authors[0]?.internaluser ? /* @__PURE__ */ a(
8119
+ e?.config?.showtime && e.config?.showauthor && /* @__PURE__ */ a(K, { children: e.authors[0]?.internaluser ? /* @__PURE__ */ a(
8120
8120
  O,
8121
8121
  {
8122
8122
  href: `/${e.paths?.autor ?? "autor"}/${e?.authors[0]?.name}`,
@@ -8519,7 +8519,7 @@ const o9 = (e) => {
8519
8519
  ] }),
8520
8520
  /* @__PURE__ */ a("div", { className: At.bannerContent, children: e.halfPageBanner })
8521
8521
  ] });
8522
- }, c9 = (e) => /* @__PURE__ */ m($, { children: [
8522
+ }, c9 = (e) => /* @__PURE__ */ m(K, { children: [
8523
8523
  /* @__PURE__ */ a(pl, { className: "display-on-lower-900px", ...e }),
8524
8524
  /* @__PURE__ */ a(Il, { ...e })
8525
8525
  ] }), C2 = "_newsContent_smaec_1", _2 = "_newsContentWithLines_smaec_15", N2 = "_newsContentWithoutLines_smaec_25", S2 = "_contentSeparator_smaec_35", Xt = {
@@ -9041,7 +9041,7 @@ const o9 = (e) => {
9041
9041
  }
9042
9042
  );
9043
9043
  case "op2":
9044
- return /* @__PURE__ */ a($, { children: t.length > 0 ? /* @__PURE__ */ a(
9044
+ return /* @__PURE__ */ a(K, { children: t.length > 0 ? /* @__PURE__ */ a(
9045
9045
  oa,
9046
9046
  {
9047
9047
  className: "padding-0",
@@ -9102,7 +9102,7 @@ const o9 = (e) => {
9102
9102
  }
9103
9103
  ) });
9104
9104
  default:
9105
- return /* @__PURE__ */ a($, {});
9105
+ return /* @__PURE__ */ a(K, {});
9106
9106
  }
9107
9107
  }, uf = "_content_1oabr_1", hf = "_contactInfoContent_1oabr_13", hr = {
9108
9108
  content: uf,
@@ -10167,7 +10167,7 @@ const Ar = {
10167
10167
  data: s.slice(0, d),
10168
10168
  paths: n.paths
10169
10169
  });
10170
- return /* @__PURE__ */ m($, { children: [
10170
+ return /* @__PURE__ */ m(K, { children: [
10171
10171
  /* @__PURE__ */ a(
10172
10172
  Vn,
10173
10173
  {
@@ -10216,7 +10216,7 @@ const Ar = {
10216
10216
  getVideos: l
10217
10217
  } = e, u = e.slug === "liveblogs";
10218
10218
  if (!(!s || !s[0]))
10219
- return /* @__PURE__ */ a($, { children: /* @__PURE__ */ m(wf, { className: ca.contentLayout2, children: [
10219
+ return /* @__PURE__ */ a(K, { children: /* @__PURE__ */ m(wf, { className: ca.contentLayout2, children: [
10220
10220
  /* @__PURE__ */ a(
10221
10221
  Sf,
10222
10222
  {
@@ -10454,7 +10454,7 @@ const Ar = {
10454
10454
  }
10455
10455
  );
10456
10456
  default:
10457
- return /* @__PURE__ */ a($, {});
10457
+ return /* @__PURE__ */ a(K, {});
10458
10458
  }
10459
10459
  }, z0 = "_content_yu4fr_1", V0 = "_buttonStyled_yu4fr_17", F0 = "_searchStyled_yu4fr_41", W0 = "_inputStyled_yu4fr_63", $0 = "_inputStyledTest_yu4fr_101", Bt = {
10460
10460
  content: z0,
@@ -10524,7 +10524,7 @@ const Ar = {
10524
10524
  };
10525
10525
  switch (n) {
10526
10526
  case "op1":
10527
- return /* @__PURE__ */ a($, { children: /* @__PURE__ */ m(or, { children: [
10527
+ return /* @__PURE__ */ a(K, { children: /* @__PURE__ */ m(or, { children: [
10528
10528
  /* @__PURE__ */ a(eu, { autor: r[0], autorIcon: e.autorIcon }),
10529
10529
  /* @__PURE__ */ a(
10530
10530
  vo,
@@ -10606,9 +10606,9 @@ const Ar = {
10606
10606
  )
10607
10607
  ] }) });
10608
10608
  case "op2":
10609
- return /* @__PURE__ */ a($, { children: /* @__PURE__ */ m(or, { children: [
10609
+ return /* @__PURE__ */ a(K, { children: /* @__PURE__ */ m(or, { children: [
10610
10610
  /* @__PURE__ */ a(uu, { autor: r[0], autorIcon: e.autorIcon }),
10611
- Array.isArray(t) ? /* @__PURE__ */ m($, { children: [
10611
+ Array.isArray(t) ? /* @__PURE__ */ m(K, { children: [
10612
10612
  /* @__PURE__ */ a(
10613
10613
  No,
10614
10614
  {
@@ -10659,7 +10659,7 @@ const Ar = {
10659
10659
  )
10660
10660
  ] }) });
10661
10661
  default:
10662
- return /* @__PURE__ */ a($, {});
10662
+ return /* @__PURE__ */ a(K, {});
10663
10663
  }
10664
10664
  }, X0 = "_content_ghncj_1", eg = "_videoContent_ghncj_17", wr = {
10665
10665
  content: X0,
@@ -10782,7 +10782,7 @@ const Ar = {
10782
10782
  case "op2":
10783
10783
  return /* @__PURE__ */ a(Ng, { video: e.data[0] });
10784
10784
  default:
10785
- return /* @__PURE__ */ a($, {});
10785
+ return /* @__PURE__ */ a(K, {});
10786
10786
  }
10787
10787
  };
10788
10788
  function y9({ containerId: e, containerId2: t }) {
@@ -10860,7 +10860,7 @@ const Sg = (e) => {
10860
10860
  }
10861
10861
  }
10862
10862
  ),
10863
- t && /* @__PURE__ */ m($, { children: [
10863
+ t && /* @__PURE__ */ m(K, { children: [
10864
10864
  /* @__PURE__ */ a(
10865
10865
  "div",
10866
10866
  {
@@ -10964,7 +10964,7 @@ const Sg = (e) => {
10964
10964
  isVisible: r = !1,
10965
10965
  stylesConfig: o
10966
10966
  }) => {
10967
- const [s, i] = Y({ data: Array.from({ length: br }, () => xg) }), [c, d] = Y(!1), l = he(async () => {
10967
+ const [s, i] = $({ data: Array.from({ length: br }, () => xg) }), [c, d] = $(!1), l = he(async () => {
10968
10968
  if (!(c || !t?.info?.link?.internal)) {
10969
10969
  d(!0);
10970
10970
  try {
@@ -11113,7 +11113,7 @@ const Sg = (e) => {
11113
11113
  children: n ? je(e.main.subtitle.striped) : e.main.subtitle.striped
11114
11114
  }
11115
11115
  ),
11116
- (e?.config?.showtime || e.config?.showauthor) && o && /* @__PURE__ */ a($, { children: e.authors?.[0]?.internaluser ? /* @__PURE__ */ a(
11116
+ (e?.config?.showtime || e.config?.showauthor) && o && /* @__PURE__ */ a(K, { children: e.authors?.[0]?.internaluser ? /* @__PURE__ */ a(
11117
11117
  O,
11118
11118
  {
11119
11119
  className: re.correspondentLink,
@@ -11423,7 +11423,7 @@ function ep() {
11423
11423
  }
11424
11424
  }
11425
11425
  }
11426
- var v = d, B = l, L = c, K = i, te = t, Q = u, P = r, ee = g, ce = y, M = n, U = s, E = o, D = h, T = !1;
11426
+ var v = d, B = l, L = c, Y = i, te = t, Q = u, P = r, ee = g, ce = y, M = n, U = s, E = o, D = h, T = !1;
11427
11427
  function H(R) {
11428
11428
  return T || (T = !0, console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")), A(R) || x(R) === d;
11429
11429
  }
@@ -11463,7 +11463,7 @@ function ep() {
11463
11463
  function ie(R) {
11464
11464
  return x(R) === h;
11465
11465
  }
11466
- ae.AsyncMode = v, ae.ConcurrentMode = B, ae.ContextConsumer = L, ae.ContextProvider = K, ae.Element = te, ae.ForwardRef = Q, ae.Fragment = P, ae.Lazy = ee, ae.Memo = ce, ae.Portal = M, ae.Profiler = U, ae.StrictMode = E, ae.Suspense = D, ae.isAsyncMode = H, ae.isConcurrentMode = A, ae.isContextConsumer = C, ae.isContextProvider = k, ae.isElement = j, ae.isForwardRef = q, ae.isFragment = G, ae.isLazy = z, ae.isMemo = V, ae.isPortal = J, ae.isProfiler = Z, ae.isStrictMode = F, ae.isSuspense = ie, ae.isValidElementType = N, ae.typeOf = x;
11466
+ ae.AsyncMode = v, ae.ConcurrentMode = B, ae.ContextConsumer = L, ae.ContextProvider = Y, ae.Element = te, ae.ForwardRef = Q, ae.Fragment = P, ae.Lazy = ee, ae.Memo = ce, ae.Portal = M, ae.Profiler = U, ae.StrictMode = E, ae.Suspense = D, ae.isAsyncMode = H, ae.isConcurrentMode = A, ae.isContextConsumer = C, ae.isContextProvider = k, ae.isElement = j, ae.isForwardRef = q, ae.isFragment = G, ae.isLazy = z, ae.isMemo = V, ae.isPortal = J, ae.isProfiler = Z, ae.isStrictMode = F, ae.isSuspense = ie, ae.isValidElementType = N, ae.typeOf = x;
11467
11467
  })()), ae;
11468
11468
  }
11469
11469
  var Nr;
@@ -11615,7 +11615,7 @@ function ap() {
11615
11615
  elementType: v(),
11616
11616
  instanceOf: B,
11617
11617
  node: Q(),
11618
- objectOf: K,
11618
+ objectOf: Y,
11619
11619
  oneOf: L,
11620
11620
  oneOfType: te,
11621
11621
  shape: ee,
@@ -11735,7 +11735,7 @@ function ap() {
11735
11735
  }
11736
11736
  return w(C);
11737
11737
  }
11738
- function K(A) {
11738
+ function Y(A) {
11739
11739
  function C(k, j, q, G, z) {
11740
11740
  if (typeof A != "function")
11741
11741
  return new p("Property `" + z + "` of component `" + q + "` has invalid PropType notation inside objectOf.");
@@ -12226,24 +12226,24 @@ function pp(e, t) {
12226
12226
  for (var v in t.attributes)
12227
12227
  x.setAttribute(v, t.attributes[v]);
12228
12228
  _ && (x.id = _);
12229
- var B = function(K) {
12229
+ var B = function(Y) {
12230
12230
  if (Le[f]) {
12231
12231
  var te = Le[f], Q = te.observers;
12232
12232
  for (var P in Q)
12233
- K(Q[P]) && delete Q[P];
12233
+ Y(Q[P]) && delete Q[P];
12234
12234
  }
12235
12235
  };
12236
12236
  w && typeof window < "u" && (window[w] = function() {
12237
12237
  return h.asyncScriptLoaderTriggerOnScriptLoaded();
12238
12238
  }), x.onload = function() {
12239
12239
  var L = Le[f];
12240
- L && (L.loaded = !0, B(function(K) {
12241
- return w ? !1 : (K(L), !0);
12240
+ L && (L.loaded = !0, B(function(Y) {
12241
+ return w ? !1 : (Y(L), !0);
12242
12242
  }));
12243
12243
  }, x.onerror = function() {
12244
12244
  var L = Le[f];
12245
- L && (L.errored = !0, B(function(K) {
12246
- return K(L), !0;
12245
+ L && (L.errored = !0, B(function(Y) {
12246
+ return Y(L), !0;
12247
12247
  }));
12248
12248
  }, document.body.appendChild(x);
12249
12249
  }, l.componentWillUnmount = function() {
@@ -12329,9 +12329,9 @@ const ko = pp(wp, {
12329
12329
  publication: r,
12330
12330
  username: o
12331
12331
  }) => {
12332
- const [s, i] = Y("form"), [c, d] = Y(
12332
+ const [s, i] = $("form"), [c, d] = $(
12333
12333
  ""
12334
- ), [l, u] = Y(""), [h, f] = Y(""), y = [
12334
+ ), [l, u] = $(""), [h, f] = $(""), y = [
12335
12335
  { id: "spam", label: Ye.spam },
12336
12336
  {
12337
12337
  id: "inappropriate",
@@ -12387,7 +12387,7 @@ const ko = pp(wp, {
12387
12387
  /* @__PURE__ */ a("button", { className: "close-reply-form", onClick: p, children: /* @__PURE__ */ a(xt, {}) }),
12388
12388
  /* @__PURE__ */ a("h2", { className: ue.title, children: "Reportar Abuso" }),
12389
12389
  s === "loading" && /* @__PURE__ */ a("div", { className: ue.loadingContainer, children: /* @__PURE__ */ a(Ze, {}) }),
12390
- s === "form" || s === "loading" ? /* @__PURE__ */ m($, { children: [
12390
+ s === "form" || s === "loading" ? /* @__PURE__ */ m(K, { children: [
12391
12391
  /* @__PURE__ */ a("div", { className: ue.optionsContainer, children: y.map((w) => /* @__PURE__ */ m("label", { className: ue.option, children: [
12392
12392
  /* @__PURE__ */ a(
12393
12393
  "input",
@@ -12426,7 +12426,7 @@ const ko = pp(wp, {
12426
12426
  }
12427
12427
  )
12428
12428
  ] })
12429
- ] }) : /* @__PURE__ */ m($, { children: [
12429
+ ] }) : /* @__PURE__ */ m(K, { children: [
12430
12430
  /* @__PURE__ */ m("div", { className: ue.successContainer, children: [
12431
12431
  /* @__PURE__ */ a("div", { className: ue.thumbsUp, children: /* @__PURE__ */ a(
12432
12432
  "svg",
@@ -12538,7 +12538,7 @@ async function Fp({
12538
12538
  }
12539
12539
  }
12540
12540
  const { PUBLIC_PUBLICATION_ID: Wp } = X(), $p = Wp, Yp = (e) => {
12541
- const [t, n] = Y(void 0);
12541
+ const [t, n] = $(void 0);
12542
12542
  return De(() => {
12543
12543
  if (t) return;
12544
12544
  (async () => {
@@ -12761,7 +12761,7 @@ const { PUBLIC_PUBLICATION_ID: Wp } = X(), $p = Wp, Yp = (e) => {
12761
12761
  addReply: o,
12762
12762
  closeForm: s
12763
12763
  }) => {
12764
- const [i, c] = Y(!0), [d, l] = Y(""), u = () => {
12764
+ const [i, c] = $(!0), [d, l] = $(""), u = () => {
12765
12765
  t.current?.parentElement && (t.current.parentElement.dataset.text = `0/${ht}`), c(!0), s();
12766
12766
  };
12767
12767
  return /* @__PURE__ */ m("div", { className: "comment-form reply-form", children: [
@@ -12821,7 +12821,7 @@ const { PUBLIC_PUBLICATION_ID: Wp } = X(), $p = Wp, Yp = (e) => {
12821
12821
  ] })
12822
12822
  ] }) });
12823
12823
  }, e3 = ({ comment: e, replyingTo: t, path: n, user: r, handleReplyingTo: o, onFlag: s }) => {
12824
- const i = { morereply: e.morereply ?? !1, reply: e.reply ? e.reply : [] }, [c, d] = Y(i), [l, u] = Ee.useState(!1), h = process.env.PUBLIC_PUBLICATION_ID ?? "", f = e.text, y = Ee.useRef(null);
12824
+ const i = { morereply: e.morereply ?? !1, reply: e.reply ? e.reply : [] }, [c, d] = $(i), [l, u] = Ee.useState(!1), h = process.env.PUBLIC_PUBLICATION_ID ?? "", f = e.text, y = Ee.useRef(null);
12825
12825
  let g = `${Je.firstname} ${Je.lastname}`, p = Je.username;
12826
12826
  e.user && (g = `${e.user.firstname} ${e.user.lastname}`, p = e.user.username);
12827
12827
  const w = (_) => {
@@ -12904,7 +12904,7 @@ const { PUBLIC_PUBLICATION_ID: Wp } = X(), $p = Wp, Yp = (e) => {
12904
12904
  path: n,
12905
12905
  addComment: r
12906
12906
  }) => {
12907
- const [o, s] = Y(!0), [i, c] = Y("");
12907
+ const [o, s] = $(!0), [i, c] = $("");
12908
12908
  return /* @__PURE__ */ m("div", { className: "comment-form", children: [
12909
12909
  /* @__PURE__ */ a(
12910
12910
  Bo,
@@ -12949,9 +12949,9 @@ const { PUBLIC_PUBLICATION_ID: Wp } = X(), $p = Wp, Yp = (e) => {
12949
12949
  user: n,
12950
12950
  handleLogout: r
12951
12951
  }) => {
12952
- const o = t.replaceAll("/", "|"), [s, i] = Y(
12952
+ const o = t.replaceAll("/", "|"), [s, i] = $(
12953
12953
  void 0
12954
- ), [c, d] = Y(""), { comments: l, setComments: u } = Yp(o), [h, f] = Ee.useState(!1), y = Ee.useRef(null), g = (v) => {
12954
+ ), [c, d] = $(""), { comments: l, setComments: u } = Yp(o), [h, f] = Ee.useState(!1), y = Ee.useRef(null), g = (v) => {
12955
12955
  d(c === v ? "" : v);
12956
12956
  }, p = (v) => {
12957
12957
  u(
@@ -12987,9 +12987,9 @@ const { PUBLIC_PUBLICATION_ID: Wp } = X(), $p = Wp, Yp = (e) => {
12987
12987
  throw f(!1), new Error(`Error al obtener comentarios: ${L}`);
12988
12988
  }
12989
12989
  }, S = l?.comments && l.comments.length > 0, N = S ? "Comparte tu opinión de este artículo." : "Se el primero en compartir tu opinión de este artículo.", x = /* @__PURE__ */ a("div", { style: { display: "flex", width: "100%", justifyContent: "center" }, children: /* @__PURE__ */ a(Ze, {}) });
12990
- return /* @__PURE__ */ m($, { children: [
12991
- /* @__PURE__ */ a("div", { className: "comments-container", children: /* @__PURE__ */ a(me, { title: S || e ? "COMENTARIOS" : !1, children: /* @__PURE__ */ m($, { children: [
12992
- /* @__PURE__ */ a("div", { className: "comments-header", children: e && n && /* @__PURE__ */ m($, { children: [
12990
+ return /* @__PURE__ */ m(K, { children: [
12991
+ /* @__PURE__ */ a("div", { className: "comments-container", children: /* @__PURE__ */ a(me, { title: S || e ? "COMENTARIOS" : !1, children: /* @__PURE__ */ m(K, { children: [
12992
+ e && n && /* @__PURE__ */ m("div", { className: "comments-header", children: [
12993
12993
  /* @__PURE__ */ a(
12994
12994
  kg,
12995
12995
  {
@@ -13007,13 +13007,13 @@ const { PUBLIC_PUBLICATION_ID: Wp } = X(), $p = Wp, Yp = (e) => {
13007
13007
  path: o
13008
13008
  }
13009
13009
  )
13010
- ] }) }),
13011
- /* @__PURE__ */ a(
13010
+ ] }),
13011
+ l ? l.comments && l.comments.length > 0 ? /* @__PURE__ */ m(
13012
13012
  "div",
13013
13013
  {
13014
13014
  className: "comments-list",
13015
13015
  "data-isauthenticated": `${e}`,
13016
- children: l ? l.comments && l.comments.length > 0 ? /* @__PURE__ */ m($, { children: [
13016
+ children: [
13017
13017
  l.comments.map((v) => /* @__PURE__ */ a(
13018
13018
  e3,
13019
13019
  {
@@ -13027,9 +13027,9 @@ const { PUBLIC_PUBLICATION_ID: Wp } = X(), $p = Wp, Yp = (e) => {
13027
13027
  v.id
13028
13028
  )),
13029
13029
  h && x
13030
- ] }) : null : x
13030
+ ]
13031
13031
  }
13032
- ),
13032
+ ) : null : x,
13033
13033
  l?.morecomment && !h && /* @__PURE__ */ a(
13034
13034
  "button",
13035
13035
  {
@@ -13098,7 +13098,7 @@ const { PUBLIC_PUBLICATION_ID: Wp } = X(), $p = Wp, Yp = (e) => {
13098
13098
  }
13099
13099
  ];
13100
13100
  function o3({ goToLogin: e, handleGoogleLogin: t }) {
13101
- const [n, r] = Y({}), [o, s] = Y(!1), [i, c] = Y(!1), [d, l] = Y(null), [u, h] = Y(
13101
+ const [n, r] = $({}), [o, s] = $(!1), [i, c] = $(!1), [d, l] = $(null), [u, h] = $(
13102
13102
  "register"
13103
13103
  ), f = (w, _) => {
13104
13104
  r((S) => ({ ...S, [w]: _ }));
@@ -13182,8 +13182,8 @@ function o3({ goToLogin: e, handleGoogleLogin: t }) {
13182
13182
  c(!1);
13183
13183
  }
13184
13184
  }, p = n.password || "";
13185
- return /* @__PURE__ */ m($, { children: [
13186
- u === "register" && /* @__PURE__ */ m($, { children: [
13185
+ return /* @__PURE__ */ m(K, { children: [
13186
+ u === "register" && /* @__PURE__ */ m(K, { children: [
13187
13187
  /* @__PURE__ */ m("button", { onClick: t, className: I.google, children: [
13188
13188
  /* @__PURE__ */ a(
13189
13189
  "img",
@@ -13328,8 +13328,8 @@ function s3({
13328
13328
  goToRegister: n,
13329
13329
  handleGoogleLogin: r
13330
13330
  }) {
13331
- const [o, s] = Y("login"), [i, c] = Y(""), [d, l] = Y(""), [u, h] = Y(""), [f, y] = Y(""), [g, p] = Y(""), [w, _] = Y(!1), [S, N] = Y(!1), [x, v] = Y(null), { CAPTCHA_KEY: B } = X();
13332
- return /* @__PURE__ */ m($, { children: [
13331
+ const [o, s] = $("login"), [i, c] = $(""), [d, l] = $(""), [u, h] = $(""), [f, y] = $(""), [g, p] = $(""), [w, _] = $(!1), [S, N] = $(!1), [x, v] = $(null), { CAPTCHA_KEY: B } = X();
13332
+ return /* @__PURE__ */ m(K, { children: [
13333
13333
  o === "login" && /* @__PURE__ */ a(
13334
13334
  i3,
13335
13335
  {
@@ -13478,7 +13478,7 @@ function i3({
13478
13478
  onRegister: u,
13479
13479
  handleGoogleLogin: h
13480
13480
  }) {
13481
- return /* @__PURE__ */ m($, { children: [
13481
+ return /* @__PURE__ */ m(K, { children: [
13482
13482
  /* @__PURE__ */ m("button", { onClick: h, className: I.google, children: [
13483
13483
  /* @__PURE__ */ a(
13484
13484
  "img",
@@ -13716,7 +13716,7 @@ function u3({
13716
13716
  checkAuth: n,
13717
13717
  icon: r
13718
13718
  }) {
13719
- const [o, s] = Y("login"), i = async () => {
13719
+ const [o, s] = $("login"), i = async () => {
13720
13720
  {
13721
13721
  await fetch("/api/auth/debug-login", { method: "GET", credentials: "include" }), localStorage.setItem("cognito-login", "success:" + Date.now()), t(), n();
13722
13722
  return;
@@ -13776,7 +13776,7 @@ function h3({
13776
13776
  icon: i
13777
13777
  }) {
13778
13778
  const [c, d] = Ee.useState(!1);
13779
- return /* @__PURE__ */ m($, { children: [
13779
+ return /* @__PURE__ */ m(K, { children: [
13780
13780
  c && /* @__PURE__ */ a(
13781
13781
  u3,
13782
13782
  {
@@ -13823,7 +13823,7 @@ function m3({
13823
13823
  path: t,
13824
13824
  icon: n
13825
13825
  }) {
13826
- const [r, o] = Y(null), [s, i] = Y(null), { COGNITO_AUTH_PREFIX: c } = X(), d = he(async () => {
13826
+ const [r, o] = $(null), [s, i] = $(null), { COGNITO_AUTH_PREFIX: c } = X(), d = he(async () => {
13827
13827
  if (e) {
13828
13828
  if (document.cookie.search(c + "IS_AUTH=true") === -1) {
13829
13829
  o(!1), i(null), console.log("user not logged");
@@ -115,4 +115,4 @@ j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
115
115
  <figcaption>${u.data.data[0].main.description||""}</figcaption>
116
116
  </figure>
117
117
  `}r+=y,s=h}return r+=e.slice(s),r}async function id(e){const{news:t,banners:a,newsRelatedResponses:o,slug:r,itemList:s,socials:i,getVideos:c}=e;let d=t?.body?.rendered??"";d=d.replace(/&nbsp;/g,""),d=ad(d,a),d=od(d),d=await Wr(d),d=await rd(d,e.texts,o),d=await sd(d,c),d=td(d),d=nd(d);const l=t.main.sources??[];return n.jsxs("div",{className:Sn.content,children:[r!=="liveblogs"&&e.showHeaderImage?t.hascontent?.hasgalleryimages?n.jsx(pa,{newsformated:t,internal:t.info.link.internal}):n.jsx(wr,{preview:t.preview}):null,n.jsx(fe,{banners:a,name:"block_1"}),n.jsx("div",{className:Sn.journalistArticleContent,children:n.jsx(Jl,{autorIcon:e.autorIcon,socials:i,news:t,texts:e.texts,noteShare:e.noteShare,paths:e.paths})}),n.jsx(Xl,{summary:t.main.summary}),n.jsx("div",{className:Sn.contentNews,suppressHydrationWarning:!0,id:"content-news-section",dangerouslySetInnerHTML:{__html:d}}),n.jsx(Wl,{texts:e.texts,itemList:s,banners:a,slug:r}),l.length>0&&n.jsxs("div",{className:Sn.noteSource,children:[n.jsx(ed,{}),n.jsx("p",{children:e.texts.noteSource+(l.length===1?"":"s")+": "+l.map(h=>h.name).join(", ")})]})]})}const Yr={content:"_content_1kodm_1",title:"_title_1kodm_35"},cd=async({newsformated:e,internal:t})=>{if(!t)return;const o=await new Se().getNewsMultimedia({path:t,imagesizes:e.preview.sizes[0]?.scale});if(!o)return;const r=o.data.data[0]?.videos.filter(s=>s.type==="video-embedded")[0];return n.jsxs("div",{className:Yr.content,children:[n.jsx("div",{dangerouslySetInnerHTML:{__html:r?.code??""}}),n.jsx("p",{className:Yr.title,children:r?.title})]})},Aa={content:"_content_1kodm_1",title:"_title_1kodm_35"},ld=async({newsformated:e,internal:t})=>{if(!t)return;const o=await new Se().getNewsMultimedia({path:t,imagesizes:e.preview.sizes[0]?.scale});if(!o)return;const r=o.data.data[0]?.videos.filter(s=>s.type==="video-youtube")[0];return n.jsxs("div",{className:Aa.content,children:[n.jsx("iframe",{className:Aa.iframeStyled,src:`https://www.youtube.com/embed/${r?.code??""}`,frameBorder:"0",allowFullScreen:!0}),n.jsx("p",{className:Aa.title,children:r?.title})]})},dd={content:"_content_g44cu_1"},hd=async({newsformated:e,internal:t})=>{if(!t)return;const o=await new Se().getNews({path:t,imagesizes:e.preview.sizes[0]?.scale});if(!o)return;const r=o.data.data[0]?.external?.iframe;return n.jsx("div",{className:dd.content,dangerouslySetInnerHTML:{__html:r??""}})},Kr={content:"_content_15e7w_1"},tt={imagen:"imagen",videoEmbedded:"videoEmbedded",videoYouTube:"videoYouTube",iframe:"iframe"},ud={[tt.videoEmbedded]:cd,[tt.videoYouTube]:ld,[tt.iframe]:hd},fd=({news:e})=>{const{config:t,hascontent:a,info:o}=e,r=t.articlepreview,s=o.link.internal,i=a?.hasgalleryimages;if(r===tt.imagen&&i)return n.jsx("div",{className:Kr.content,children:n.jsx(pa,{newsformated:e,internal:s})});const c=r?ud[r]:null;return c?n.jsx("div",{className:Kr.content,children:n.jsx(c,{newsformated:e,internal:s})}):null},md=e=>{const{content:t,title:a,slot_id:o}=e,r=e.slot_id&&e.slot_id!=="Nota_1";return t&&t.length!==0&&n.jsx(he,{title:a,titleUrl:e.titleUrl,children:n.jsx(rt,{slot_id:o,cardWidth:200,children:t.map((s,i)=>{const c={...s,main:{...s.main,title:{...s.main.title,section:r?s.main.title.home:s.main.title.section}}};return n.jsx(Dt,{...c,titleGradient:!0,paths:e.paths},i)})})})},gd=e=>{const{content:t,title:a,slot_id:o}=e,r=e.slot_id&&e.slot_id!=="Nota_1";return t&&t.length!==0&&n.jsx(he,{title:a,titleUrl:e.titleUrl,children:n.jsx(rt,{slot_id:o,cardWidth:343,cardGap:32,visibleItems:3,children:t.map((s,i)=>{const c={...s,main:{...s.main,title:{...s.main.title,section:r?s.main.title.home:s.main.title.section}}};return n.jsx(Dt,{...c,titleGradient:!0,paths:e.paths},i)})})})},pd=e=>{const{content:t,title:a,slot_id:o}=e,r=e.slot_id&&e.slot_id!=="Nota_1";return t&&t.length!==0&&n.jsx(he,{title:a,titleUrl:e.titleUrl,children:n.jsx(rt,{slot_id:o,fullPageWidth:!0,visibleItems:1,pagination:!0,cardGap:0,children:t.map((s,i)=>{const c={...s,main:{...s.main,title:{...s.main.title,section:r?s.main.title.home:s.main.title.section}}};return N.createElement(Dt,{...c,key:i,titleGradient:!0,paths:e.paths})})})})},Nn=e=>{const t={};for(const a in e)a.startsWith("--")&&(t[a]=e[a]);return t},st={headerSection:"_headerSection_nhjex_1",title:"_title_nhjex_21",subtitle:"_subtitle_nhjex_45",newsContent:"_newsContent_nhjex_71",containerCards:"_containerCards_nhjex_87",image:"_image_nhjex_99",blockHeadContainer:"_blockHeadContainer_nhjex_111"},Ad=e=>{const{content:t,title:a,isVideo:o}=e;if(!t||t.length===0)return;const r=t[0],s=t.slice(1),i=e.slot_id&&e.slot_id!=="Nota_1";return r&&s&&n.jsxs(he,{title:a,titleUrl:e.titleUrl,children:[n.jsx("div",{className:st.headerSection,children:n.jsxs("a",{style:{"--heightImageOverwriteMobile":"200%"},className:st.image,href:r?.info?.link?.url,target:r?.info?.link?.target,children:[n.jsxs("div",{className:st.blockHeadContainer,children:[n.jsx("p",{className:st.title,children:r?.main?.title.home}),r?.main?.subtitle?.rendered&&n.jsx("p",{className:st.subtitle,children:r?.main?.subtitle?.striped})]}),n.jsx(Ne,{preview:r.preview})]})}),n.jsxs("div",{className:st.containerCards,children:[n.jsx("div",{className:"banner-context",style:{order:1},children:e.banner}),n.jsx("div",{className:st.newsContent,children:Array.isArray(s)&&s.map((c,d)=>{const l={...c,main:{...c.main,title:{...c.main.title,section:i?c.main.title.home:c.main.title.section}}};return n.jsx("div",{style:{order:d},children:n.jsx(Pe,{...l,isVideo:o,paths:e.paths})},d)})})]})]})},Jr={banner:e=>n.jsx(fe,{...e,name:e.slot_id.replace("Home","block")}),readest:e=>n.jsx(un,{...e}),"Modulo 1x3":e=>n.jsx(ha,{...e}),"Modulo 1x4":e=>n.jsx(Dr,{...e}),"Modulo 1x5":e=>n.jsx(Mr,{...e}),"Destacado noticias":e=>n.jsx(qr,{...e}),"Destacado full width":e=>n.jsx(Ad,{...e}),"Destacado videos":e=>n.jsx(jr,{...e}),"Carrusel card":e=>n.jsx($r,{...e}),"Carrusel story":e=>n.jsx(md,{...e}),"Carrusel owl":e=>n.jsx(gd,{...e}),"Modulo fotogaleria":e=>n.jsx(pd,{...e}),"Carrusel opinion":e=>n.jsx(Hr,{...e}),"Modulo 1x3 card":e=>n.jsx(Gr,{...e})};function ya({component:e,slot_id:t,data:a,banners:o}){if(o)return Jr[e]&&n.jsx("div",{className:"home-slot",style:Nn(a),children:Jr[e]({...a,banners:o,slot_id:t})})}function yd({children:e,stylesConfigEntry:t}){return n.jsx("div",{className:"home-slot",style:Nn(t),children:e})}const Zr={Diario:e=>{if(!e?.data||e.data.length===0)return;const t=e.data.slice(1);return n.jsx(xr,{...e.data[0],itemReverseOrder:!0,isLarge:!0,block:t,banners:e.banners,showSuper:e.showSuper,rightOnlyBanner:e.rightOnlyBanner,customSectionCardStyles:e.customSectionCardStyles,customNewsDescriptionStyles:e.customNewsDescriptionStyles,paths:e.paths})},"Diario con imagen":e=>{if(!e?.data||e.data.length===0)return;const t=e.data.slice(1);return n.jsx(xr,{...e.data[0],itemReverseOrder:!0,isLarge:!0,showSuper:e.showSuper,block:t,banners:e.banners,customSectionCardStyles:e.customSectionCardStyles,customNewsDescriptionStyles:e.customNewsDescriptionStyles,paths:e.paths})},Super:e=>n.jsx(vt,{...e.data[0],paths:e.paths}),"3 notas verticales":e=>n.jsx(Il,{content:e.data,customLargeSection:e.customLargeSection,customSlimSection:e.customSlimSection,paths:e.paths}),"3 notas horizontales":e=>n.jsx(Tl,{content:e.data,customLargeSection:e.customLargeSection,customSmallSection:e.customSmallSection,paths:e.paths})},En=({component:e,data:t,banners:a,rightOnlyBanner:o})=>n.jsx("div",{style:Nn(t),children:Zr[e]&&Zr[e]({...t,rightOnlyBanner:o,banners:a})}),wd=({slots:e,DYNAMIC_SLOT_SUBINDEXES:t,stylesConfig:a,AutorIcon:o,config:r,banners:s})=>{const i=[],d=t,l=Object.keys(e).length/d;for(let h=1;h<=l;h++)for(let u=1;u<=d;u++){const f="Home_"+h+"_"+u;!e[f]||!e[f].blockSass||!e[f].blockSass[0]||!e[f].blockSass[0].value||!e[f].blockSass[0].block||e[f].blockSass[0].block==="No Mostrar"||i.push(n.jsxs(rr,{show:!!e[f].content?.data,order:(h-1)*d+(u-1),children:[n.jsx(ya,{component:e[f].blockSass[0].block,banners:s,slot_id:f,data:{...e[f].blockSass[0].block?a[e[f].blockSass[0].block]:[],content:e[f].content?.data??[],title:e[f].blockSass[0].title??void 0,titleUrl:e[f].blockSass[0].link??void 0,autorIcon:n.jsx(o,{}),paths:r.paths}}),n.jsx(Ze,{children:n.jsx(je,{banners:s,index:"dynamic_"+h+"_"+u})})]},h+"_"+u))}return i},bd=({mainBlock:e,StylesConfigMain:t,config:a,banners:o})=>{const{PUBLIC_ENV:r}=Z();if(r!=="local")return null;const s=e?.news?.data||[],i=(c,d)=>({...e?.news,...t[c],data:s.slice(0,d),paths:a.paths});return n.jsxs(n.Fragment,{children:[n.jsx(En,{component:"Super",data:i("Super",1),banners:o}),n.jsx(Ze,{children:n.jsx(je,{banners:o,index:1})}),n.jsx(En,{component:"3 notas verticales",data:i("3 notas verticales",3),banners:o}),n.jsx(Ze,{children:n.jsx(je,{banners:o,index:1})}),n.jsx(En,{component:"3 notas horizontales",data:i("3 notas horizontales",3),banners:o}),n.jsx(Ze,{children:n.jsx(je,{banners:o,index:1})})]})},vd=e=>{const{config:t,hascontent:a}=e,o=t.articlepreview,r=[tt.videoEmbedded,tt.videoYouTube,tt.iframe];return!!(o===tt.imagen&&a?.hasgalleryimages||r.includes(o))},Cd=async e=>{const{custom_complement:t,ranking:a=[],banners:o,autor:r=[],news:s=[],newsRelatedResponses:i=[],itemList:c=[],socials:d,getVideos:l}=e,h=e.slug==="liveblogs";if(!(!s||!s[0]))return n.jsx(n.Fragment,{children:n.jsxs(jl,{className:ga.contentLayout2,children:[n.jsx(Gl,{option:e.slug,news:s,paths:e.paths}),n.jsx(je,{banners:o,index:1}),!h&&n.jsx(fd,{news:s[0]}),n.jsx(Ql,{texts:e.texts,paths:e.paths,slug:e.slug,itemList:c,ranking:a,bannerTop:n.jsx(fe,{banners:o??[],name:"right_1"}),banner:n.jsx(fe,{banners:o??[],name:"right_2"}),complement:t?t():n.jsxs("div",{id:"comentarios",suppressHydrationWarning:!0,children:[r.length>0&&n.jsx(Ir,{texts:e.texts,autorIcon:e.autorIcon,autor:r[0],paths:e.paths}),s[0].authors.length>1&&n.jsx(kr,{news:s[0],autorIcon:e.autorIcon,paths:e.paths,texts:e.texts}),n.jsx("div",{className:ga.tagContent,children:n.jsx(Tr,{tags:s[0]?.keywords?.tags,paths:e.paths})}),n.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"2rem"},suppressHydrationWarning:!0,children:[e.showComments&&n.jsx("div",{suppressHydrationWarning:!0,"data-hydrate":"LazyLoader","data-props":encodeURIComponent(JSON.stringify({render:"comment",internalPath:e.internalPath}))}),n.jsx(Ze,{children:n.jsx(je,{banners:o,index:2})}),n.jsx(ya,{component:"Carrusel card",banners:[],slot_id:"Nota_1",data:{...e.stylesConfig["Carrusel card"],content:e.relatedNewsList??[],title:e.texts.relatedNewsTitle,titleUrl:void 0}}),n.jsx(Ze,{children:n.jsx(je,{banners:o,index:3})}),n.jsx(he,{title:e.texts.moreNewsTitle,children:n.jsx("div",{suppressHydrationWarning:!0,"data-hydrate":"LazyLoader","data-props":encodeURIComponent(JSON.stringify({render:"more",stylesConfig:e.stylesConfig,section:s[0].info.section?.slug??"",currentNews:s[0]}))})}),n.jsx(Ze,{children:n.jsx(je,{banners:o,index:4})})]})]}),children:n.jsxs("section",{style:{"--avatar-content-align-items-desk":e.slug==="liveblogs"?"flex-start":"center"},children:[n.jsx(id,{texts:e.texts,autorIcon:e.autorIcon,socials:d,news:s[0],banners:o,newsRelatedResponses:i,itemList:c,slug:e.slug,getVideos:l,noteShare:e.noteShare,paths:e.paths,showHeaderImage:!vd(s[0])}),n.jsx(fe,{banners:o??[],name:"block_3"})]})})]})})},St={content:"_content_1mczt_1",contentInfo:"_contentInfo_1mczt_47",imageStyled:"_imageStyled_1mczt_81",name:"_name_1mczt_91",description:"_description_1mczt_101",contentInfoWithoutImg:"_contentInfoWithoutImg_1mczt_207"},_d=async e=>{const t=e.img?await ue(e.img):"";return n.jsx("section",{className:St.content,children:n.jsxs("div",{className:`${St.contentInfo} ${t?"":St.contentInfoWithoutImg}`,children:[e.img&&n.jsx("img",{fetchPriority:"low",loading:"lazy",className:St.imageStyled,src:t}),n.jsx("h1",{className:St.name,children:e.tag}),e.description&&n.jsx("div",{className:St.description,dangerouslySetInnerHTML:{__html:e.description}})]})})},Tn={content:"_content_1dk1v_1",contentInfo:"_contentInfo_1dk1v_45",name:"_name_1dk1v_67",description:"_description_1dk1v_85"},Sd=e=>n.jsx("section",{className:Tn.content,style:{color:e.textColor,"--backDropHeigth":e.backDropHeigth?e.backDropHeigth:"100%",padding:e.sectionPadding??"","--backgroundColor":e.backgroundColor},children:n.jsxs("div",{className:Tn.contentInfo,children:[n.jsx("h1",{className:Tn.name,style:{color:e.textColor},children:e.tag}),e.description&&n.jsx("div",{style:{color:e.textColor},className:Tn.description,dangerouslySetInnerHTML:{__html:e.description}})]})}),Nd=e=>{const{option:t,entity:a}=e;switch(t){case"op1":return n.jsx(_d,{tag:a?.name??"",img:a?.image?.url??"",description:a?.description?a?.description:""});case"op2":return n.jsx(Sd,{tag:a?.name??"",description:a?.description?a?.description:"",backDropHeigth:e.backDropHeigth,backgroundColor:e.backgroundColor,sectionPadding:e.sectionPadding,textColor:e.textColor});default:return n.jsx(n.Fragment,{})}},Ft={content:"_content_yu4fr_1",buttonStyled:"_buttonStyled_yu4fr_17",searchStyled:"_searchStyled_yu4fr_41",inputStyled:"_inputStyled_yu4fr_63",inputStyledTest:"_inputStyledTest_yu4fr_101"},Ed=e=>n.jsx("svg",{width:"68",height:"68",viewBox:"0 0 68 68",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:n.jsx("g",{opacity:"0.8",children:n.jsx("path",{d:"M47.8043 46.6003L47.6635 46.7758L47.8232 46.9342L56.4762 55.5171C56.4768 55.5177 56.4774 55.5184 56.478 55.519C56.8524 55.9072 57.0616 56.4256 57.0616 56.965C57.0616 57.5048 56.8521 58.0234 56.4774 58.4117C56.2839 58.6065 56.0539 58.7611 55.8005 58.8667C55.5466 58.9724 55.2743 59.0269 54.9993 59.0269C54.7243 59.0269 54.452 58.9724 54.1981 58.8667C53.9442 58.7609 53.7138 58.6059 53.5201 58.4106L53.5194 58.4099L44.9327 49.8232L44.7743 49.6648L44.5995 49.805C40.4597 53.1252 35.2051 54.7331 29.9162 54.2981C24.6272 53.863 19.706 51.4181 16.1643 47.4661C12.6227 43.514 10.7298 38.3552 10.875 33.0503C11.0201 27.7455 13.1923 22.6979 16.9447 18.9455C20.6972 15.193 25.7448 13.0209 31.0496 12.8757C36.3544 12.7305 41.5133 14.6234 45.4653 18.165C49.4174 21.7067 51.8623 26.6279 52.2974 31.9169C52.7324 37.2058 51.1245 42.4604 47.8043 46.6003ZM22.4528 47.4552C25.1799 49.2774 28.3861 50.25 31.666 50.25C36.0641 50.25 40.2822 48.5029 43.3921 45.3929C46.5021 42.2829 48.2493 38.0649 48.2493 33.6667C48.2493 30.3868 47.2767 27.1806 45.4545 24.4535C43.6323 21.7264 41.0423 19.6008 38.0121 18.3457C34.9819 17.0905 31.6476 16.7621 28.4307 17.402C25.2139 18.0419 22.259 19.6213 19.9398 21.9405C17.6205 24.2597 16.0411 27.2146 15.4013 30.4314C14.7614 33.6483 15.0898 36.9827 16.345 40.0129C17.6001 43.0431 19.7256 45.633 22.4528 47.4552Z",fill:"white",stroke:"white",strokeWidth:"0.5"})})}),Td=e=>n.jsx("form",{className:Ft.content,style:{height:e.hasContent?"218px":"50vh"},children:n.jsxs("div",{className:Ft.inputStyled,children:[n.jsx("input",{className:Ft.inputStyledTest,defaultValue:e.query,name:"query",placeholder:e.texts.searchKeyWord+"..."}),n.jsx("button",{className:Ft.buttonStyled,type:"submit",children:n.jsx(Ed,{className:Ft.searchStyled})})]})}),wa={content:"_content_27x8l_1",newsContentSection:"_newsContentSection_27x8l_9",itemContent:"_itemContent_27x8l_19"},Id=e=>{const{data:t,option:a,autor:o,page:r,banners:s,pathname:i,ranking:c,currentPage:d,slug:l,texts:h={}}=e,u=[5,10,15],f={5:1,10:2,15:3};switch(a){case"op1":return n.jsx(n.Fragment,{children:n.jsxs(aa,{children:[n.jsx(Cr,{autor:o[0],autorIcon:e.autorIcon}),n.jsx(ra,{paths:e.paths,ranking:c,readestTitle:h.readestTitle??"",bannerTop:n.jsx(fe,{banners:s??[],name:"right_1"}),banner:n.jsx(fe,{banners:s??[],name:"right_2"}),children:n.jsx("section",{className:wa.content,children:t.length>0?n.jsx(An,{className:[wa.newsContentSection,"padding-0"].join(" "),paginatorComponent:n.jsx(Ot,{texts:h,pathname:i,query:"",currentPage:d,maxPages:e.paginationLimit,showNext:!(t.length<e.newsListLimit)}),children:Array.isArray(t)&&t?.map((y,m)=>n.jsxs(N.Fragment,{children:[u.includes(m+1)&&n.jsx("div",{className:wa.itemContent+" banner-context",children:n.jsx(fe,{banners:s??[],name:`block_2_${f[m+1]}`})}),n.jsx(_n,{autorIcon:e.autorIcon,item:y,option:l,paths:e.paths},m)]},m))}):n.jsx("div",{style:{width:"100%",display:"flex",flexDirection:"column",justifyContent:"center",gap:"2rem"},children:n.jsx("p",{style:{fontWeight:"var(--fw)",width:"100%",fontSize:"18px",lineHeight:"26px",textAlign:"center"},children:h.autorNotResultMessage})})})})]})});case"op2":return n.jsx(n.Fragment,{children:n.jsxs(aa,{children:[n.jsx(_r,{autor:o[0],autorIcon:e.autorIcon}),Array.isArray(t)?n.jsxs(n.Fragment,{children:[n.jsx(ha,{content:t,title:"",hasLines:!0,banners:e.banners,bannerPositionIndex:[1,6,12],paths:e.paths,slot_id:"block_2"}),n.jsx(Ot,{texts:h,query:"",pathname:i,maxPages:Number(e.paginationLimit),currentPage:Number(r),showNext:!((t.length??0)<Number(e.newsListLimit))})]}):n.jsx("div",{style:{width:"100%",display:"flex",flexDirection:"column",justifyContent:"center",gap:"2rem"},children:n.jsx("p",{style:{fontWeight:"var(--fw)",width:"100%",fontSize:"18px",lineHeight:"26px",textAlign:"center"},children:h.autorNotResultMessage})})]})});default:return n.jsx(n.Fragment,{})}},Xr={content:"_content_ghncj_1",videoContent:"_videoContent_ghncj_17"},zt={container:"_container_1wcps_1",playStyled:"_playStyled_1wcps_11",imageStyled:"_imageStyled_1wcps_25",longer:"_longer_1wcps_51",contentNews:"_contentNews_1wcps_61",tagContent:"_tagContent_1wcps_101",tag:"_tag_1wcps_101",titular:"_titular_1wcps_135",small:"_small_1wcps_161",figure:"_figure_1wcps_173",backDrop:"_backDrop_1wcps_183",backDropAux:"_backDropAux_1wcps_199"},Rr=async e=>{const{size:t="longer",video:a}=e,o=a.main.image.sizes[0]?.url??"";return n.jsx("figure",{className:zt.figure,children:n.jsxs("span",{className:zt.backdrop,children:[n.jsx("span",{className:zt.backDropAux}),n.jsx(D,{href:a.info.link.url,target:a.info.link.target,children:n.jsxs("div",{children:[a.main.image.sizes.map(async(r,s)=>r.width>=580?n.jsx("source",{media:"(width >=900px)",srcSet:await ue(r.url)},s):n.jsx("source",{media:"(width <900px)",srcSet:await ue(r.url)},s)),n.jsx("img",{fetchPriority:"low",loading:"lazy",className:[zt.imageStyled,zt[t]].join(" "),alt:"",src:o?await ue(o):""})]})})]})})},kd=e=>{const{videos:t}=e;return n.jsx("div",{className:Xr.content,children:n.jsx(mt,{children:n.jsx(he,{title:"Videos",isTitle:!0,children:n.jsxs("div",{className:Xr.videoContent,children:[n.jsx(Rr,{video:t[0]}),n.jsx("div",{style:{display:"flex",flexDirection:"column"},children:t.slice(1).map((a,o)=>n.jsx(Rr,{size:"small",video:a},`video-small-${o}`))})]})})})})},it={content:"_content_quk50_1",videoContent:"_videoContent_quk50_17",articleSection:"_articleSection_quk50_41",contentLatout:"_contentLatout_quk50_61",title:"_title_quk50_71",article:"_article_quk50_41",correspondent:"_correspondent_quk50_127"},es={container:"_container_17w1m_1",playStyled:"_playStyled_17w1m_17"},xd=e=>{const{video:t}=e;return n.jsx(D,{href:t.info.link.url?t.info.link.url:void 0,target:t.info.link.target,children:n.jsxs("section",{className:es.container,children:[n.jsx(Ne,{isLarge:!0,preview:{sizes:t.main.image.sizes,description:t.main.description}}),n.jsx(pt,{className:es.playStyled})]})})},Ud=e=>{const t=()=>e?.video.main.author?`${e?.video.main.author} - ${ke(e.video.info.date.created)}`:e?.video.main.author;return n.jsx("div",{className:it.content,children:n.jsx(mt,{className:it.contentLatout,children:n.jsx(he,{title:"Videos",isTitle:!0,children:n.jsxs("div",{className:it.videoContent,children:[n.jsx(xd,{video:e.video}),n.jsxs("div",{className:it.articleSection,children:[n.jsx(D,{className:it.title,href:e.video.info.link.url,target:e.video.info.link.target,children:e.video.main.title}),n.jsx("p",{className:it.article,children:xe(e.video.main.description)}),n.jsx("p",{className:it.correspondent,children:t()})]})]})})})})},Ld=e=>{switch(e.option){case"op1":return n.jsx(kd,{videos:e.data});case"op2":return n.jsx(Ud,{video:e.data[0]});default:return n.jsx(n.Fragment,{})}};function qd({containerId:e,containerId2:t}){return N.useEffect(()=>{try{let a=function(){const h=window.twttr;h?.widgets?h.widgets.load(o):l<10?(l++,requestAnimationFrame(a)):console.warn("No se pudo cargar widgets de Twitter")};const o=document.getElementById(e),r=document.getElementById(t);if(!o&&!r)return;const s=o?.querySelectorAll("script[src]")??[],i=r?.querySelectorAll("script[src]")??[];[...s,...i].forEach(h=>{const u=document.createElement("script");Array.from(h.attributes).forEach(f=>{u.setAttribute(f.name,f.value)}),h.replaceWith(u)});const d=document.querySelectorAll('script[src*="platform.twitter.com/widgets.js"]');if(d)for(let h=0;h<d.length;h++)d[h]?.remove();let l=0;if(document.querySelector('script[src*="platform.twitter.com/widgets.js"]'))a();else{const h=document.createElement("script");h.src="https://platform.twitter.com/widgets.js",h.async=!0,h.onload=a,document.body.appendChild(h)}}catch(a){console.warn("Error al procesar embeds de Twitter",a)}},[e]),null}const Bd=e=>{const{isVideo:t=!1,isLarge:a=!1,hasShadow:o=!1,BackDropAuxHeigthMobile:r}=e,s=N.useMemo(()=>e?.preview?.sizes||[],[e?.preview?.sizes]);if(!s.length||!s[0]?.url||s[0]?.url==="")return n.jsx("div",{className:re.imagePlaceholder});const{PUBLIC_API_HOST:i,PUBLIC_ENV:c}=Z();return n.jsx("figure",{className:re.figure,children:n.jsxs("span",{className:re.backdrop,children:[n.jsx("span",{className:re.backdropAux,style:{height:r||"56.25%"}}),n.jsxs("picture",{children:[n.jsx("img",{fetchPriority:"low",loading:"lazy",className:re.imageStyled,alt:e.preview?.description||"",src:(c==="local"?i:"")+s[0]?.url,style:{boxShadow:o?"0px 4px 8px 0px #00000033":"0px"}}),t&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:re.boxPlayIcon,style:{height:a?"40%":"72px"}}),n.jsx(pt,{className:re.playStyled,style:{width:a?"3rem":"27px",height:a?"3rem":"27px",marginBottom:a?"18px":".5rem",marginLeft:a?"30px":".5rem"}})]})]})]})})},Od=e=>n.jsx("svg",{width:"41",height:"33",viewBox:"0 0 41 33",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:n.jsx("path",{d:"M17.9576 21.2985C16.8233 21.2985 15.9277 22.194 15.9277 23.3283C15.9277 24.4627 16.8233 25.3582 17.9576 25.3582C19.0919 25.3582 19.9874 24.4627 19.9874 23.3283C19.9874 22.194 19.0919 21.2985 17.9576 21.2985ZM17.9576 19.2686C19.0919 19.2686 19.9874 18.3731 19.9874 17.2388C19.9874 16.1045 19.0919 15.2089 17.9576 15.2089C16.8233 15.2089 15.9277 16.1045 15.9277 17.2388C15.9277 18.3731 16.8233 19.2686 17.9576 19.2686ZM17.9576 13.1791C19.0919 13.1791 19.9874 12.2836 19.9874 11.1492C19.9874 10.0149 19.0919 9.11938 17.9576 9.11938C16.8233 9.11938 15.9277 10.0149 15.9277 11.1492C15.9277 12.2836 16.8233 13.1791 17.9576 13.1791Z",fill:"#7B888A"})}),ts={info:{section:{name:"",slug:"",url:""},link:{url:"/",target:"",canonical:!1,internal:""},date:{date:"",created:0,modified:0,firstpublish:0,lastpublish:0}},config:{zonehome:void 0,priorityhome:"",zonesection:"",prioritysection:"",homepreview:"",showcomments:!0,showtime:!0,showauthor:!0,showuppertitle:!0,showsubtitle:!0,showads:!0},main:{title:{home:"",section:"",article:""},subtitle:{rendered:"",striped:""},tags:[]},authors:[{firstname:"",lastname:"",fullname:"",image:void 0,name:"",internaluser:!1}],preview:void 0},ns=6,Pd=({section:e,currentNews:t,banner:a,isVisible:o=!1,stylesConfig:r})=>{const[s,i]=N.useState({data:Array.from({length:ns},()=>ts)}),[c,d]=N.useState(!1),l=N.useCallback(async()=>{if(!(c||!t?.info?.link?.internal)){d(!0);try{const h=new URLSearchParams({section:e,currentNewsLink:t.info.link.internal}),u=await fetch(`/api/get-more-news?${h}`);if(!u.ok)throw i(void 0),new Error(`HTTP error! status: ${u.status}`);const f=await u.json();i({...f,data:f.data.slice(0,ns)})}catch(h){console.error("[/api/get-more-news] Error:",h.message),i(void 0)}}},[e,t.info.link.internal,c]);return N.useEffect(()=>{o&&l()},[o,s,l]),!s?.data||s.data.length===0?null:n.jsx(Dd,{news:s.data,title:"Más Noticias",...r["Modulo 1x3 Client"]??r["Modulo 1x3"],hasLines:!0,showSubtitle:!0,rounded:!0,banner:a,isVisible:o})},Dd=e=>{const{news:t,hasLines:a=!1}=e,o=r=>a&&(r+1)%3!==0?ma.contentSeparator:"";return n.jsx("div",{className:ma.newsContent,style:{gap:a?"30px":"20px","--gridTemplateModlule":a?"repeat(auto-fit, 343px);":"repeat(auto-fit, 380px);"},children:t.map((r,s)=>{const{main:i,authors:c,info:d,preview:l,isVideo:h=!1,config:u,overImage:f="default",isTitle:y=!1,isLarge:m=!1}=r;return n.jsx("div",{className:o(s),style:{order:s},children:n.jsxs("section",{className:Pt.content,children:[n.jsx(D,{title:i?.title?.section,href:d?.link?.url??"invalidUrl","aria-label":i?.title?.section??"nota",target:d?.link?.target,children:n.jsx(Bd,{isVisible:e.isVisible,preview:l,rounded:e.rounded,isVideo:h,isLarge:m,getImageUrl:e.getImageUrl})}),n.jsx("div",{className:Pt.newsDescription,children:n.jsx(Md,{main:i,authors:c,info:d,preview:l,share:e.share,config:u,overImage:f,isTitle:y,paths:r.paths,isVisible:e.isVisible})})]})},s)})})},Md=e=>{const{share:t=!1,cutSubtitle:a=!0}=e,r=(()=>{if(!e?.authors||e.authors.length===0)return"";const s=e.authors[0],i=ke(e.info?.date?.modified);return s&&e?.config?.showtime&&e.config?.showauthor?`${s.fullname} - ${i}`:s&&e.config?.showauthor?s.fullname:e?.config?.showtime?i:""})();return n.jsxs("div",{className:ae.boxInformation,children:[t&&n.jsx(Od,{className:ae.dotStyles}),e?.info?.section?.url&&n.jsxs("div",{className:ae.sectionDescriptionContainer,children:[n.jsx(D,{className:ae.sectionDescription,href:e.info.section.url??"invalidUrl",children:e.info.section.name}),e?.main?.uppertitle&&n.jsx("p",{className:ae.uppertitle,children:e.main.uppertitle})]}),n.jsx("h2",{className:ae.articule,children:n.jsx(D,{className:ae.linkStyled,style:{"--isLink":e?.info?.link?.url?"underline":"none"},"aria-label":e.main?.title?.section??"nota",href:e?.info?.link?.url,target:e?.info?.link?.target,children:e.main?.title?.section})}),e.config?.showsubtitle&&e.main?.subtitle?.striped&&n.jsx("p",{className:ae.description,style:{"--fontSizeSubTitle":e.fontSizeSubTitle,"--lineHeightSubTitle":e.lineHeightSubTitle,"--colorSubTitle":e.colorSubTitle},children:a?xe(e.main.subtitle.striped):e.main.subtitle.striped}),(e?.config?.showtime||e.config?.showauthor)&&r&&n.jsx(n.Fragment,{children:e.authors?.[0]?.internaluser?n.jsx(D,{className:ae.correspondentLink,href:`/autor/${e.authors[0].name}`,children:r}):n.jsx("div",{className:ae.correspondent,children:r})})]})},jd=({user:e,handleLogout:t,message:a})=>{const o=()=>{const s=document.querySelector(".user-actions-options");s&&s.classList.toggle("show")},r=e.firstname??"Usuario";return n.jsx("div",{className:"comment-item",children:n.jsxs("div",{style:{display:"flex",gap:"14px"},children:[e&&e.picture&&e.picture!==""?n.jsx("img",{className:"comment-avatar-img",src:e.picture,alt:e.username}):n.jsx("div",{className:"comment-avatar",children:r.charAt(0).toUpperCase()}),n.jsxs("div",{style:{flex:1},children:[n.jsxs("div",{className:"comment-header",children:[n.jsxs("span",{className:"comment-username user-welcome",children:["Hola ",r,"!"]}),n.jsx("div",{className:"user-actions-options",children:n.jsx("button",{onClick:()=>{t()},children:"Cerrar Sesion"})}),n.jsx("button",{className:"user-actions-span",onClick:o,children:n.jsx(bn,{width:13,height:13,fill:"black"})})]}),n.jsx("p",{className:"comment-text",children:a})]})]})})},de={overlay:"_overlay_1ng7z_5",popup:"_popup_1ng7z_33",title:"_title_1ng7z_79",optionsContainer:"_optionsContainer_1ng7z_103",option:"_option_1ng7z_103",radioInput:"_radioInput_1ng7z_131",radioCustom:"_radioCustom_1ng7z_139",optionLabel:"_optionLabel_1ng7z_193",buttons:"_buttons_1ng7z_219",cancelButton:"_cancelButton_1ng7z_233",closeButton:"_closeButton_1ng7z_235",buttonAlone:"_buttonAlone_1ng7z_273",reportButton:"_reportButton_1ng7z_285",successContainer:"_successContainer_1ng7z_325",thumbsUp:"_thumbsUp_1ng7z_341",successMessage:"_successMessage_1ng7z_353",errorMessage:"_errorMessage_1ng7z_435",loadingContainer:"_loadingContainer_1ng7z_461"},as=async e=>{const{PUBLIC_ENV:t}=Z();if(t==="local")return!0;if(!e)return!1;const{CAPTCHA_PROJECT:a,CAPTCHA_KEY_V2:o,COMMENTS_CAPTCHA_API_KEY:r}=Z();try{const s=a,i=o,l=await(await fetch(`https://recaptchaenterprise.googleapis.com/v1/projects/${s}/assessments?key=${r}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({event:{token:e,siteKey:i}})})).json();return console.log("reCAPTCHA Enterprise verification result:",l),l.tokenProperties?.valid===!0}catch(s){return console.error("Error verificando reCAPTCHA Enterprise:",s),!1}};async function Qd({publication:e,username:t,id:a,type:o,baseUrl:r,captchaToken:s,apiToken:i}){if(!e||!t||!a||!o||!s)throw new Error("Faltan parámetros requeridos: publication, username, id, type, captchaToken");if(typeof e!="string"||typeof t!="string"||typeof a!="string"||typeof o!="string"||typeof s!="string")throw new Error("Todos los parámetros deben ser strings");if(!await as(s))throw new Error("Token de captcha inválido");if(!i)throw new Error("Falta el token de API del CMS");const c=`${r}/system/modules/com.tfsla.diario.base/templates/hit/5.0/1/newcomments/report`,d=encodeURIComponent(o),l=new URLSearchParams({publication:e,username:t,id:a,type:d}),h=`${c}?${l.toString()}`;try{console.log("Reporting comment:",{publication:e,username:t,id:a,type:o,encodedType:d,url:h});const u=await oe.post(h,null,{headers:{"User-Agent":"Bluestack","x-api-token":i,"Content-Type":"application/json"}});if(console.log("Report response:",u.data),u.status===200||u.status===201)return{type:"success",message:"Comentario reportado exitosamente",status:u.status,data:u.data};throw new Error(`Respuesta inesperada del servidor: ${u.status}`)}catch(u){if(console.error("Error reporting comment:",u),oe.isAxiosError(u)){const f=u.response?.status,y=u.response?.data;throw f===400?new Error("Datos inválidos para el reporte"):f===401?new Error("Token de API inválido"):f===403?new Error("Acceso denegado para reportar comentario"):f===404?new Error("Comentario no encontrado"):f===409?new Error("El comentario ya fue reportado por este usuario"):f===500?new Error("Error interno del servidor CMS"):new Error(y?.error||y?.message||`Error HTTP ${f}: No se pudo reportar el comentario`)}throw u}}const Me={spam:"Es spam o contenido comercial no deseado",inappropriate:"Lenguaje inadecuado",hate:"Discurso o símbolos de odio",misinformation:"Información falsa o fraude",terrorism:"Promueve el terrorismo",intellectual:"Violación de propiedad intelectual",bullying:"Bullying o acoso"};function Gd(e){return Me[e]}const ct=300,Ke={username:"anonimo",firstname:"Usuario",lastname:"Anonimo"};function $d(e){const t=e.split(" ");if(t.length!==3)return e;const[a,o,r]=t,s=o.charAt(0).toUpperCase()+o.slice(1).toLowerCase();return`${a} ${s} ${r}`}const ba=(e,t)=>{if(!e||!e.current)return{boolean:!1,text:""};const a=e.current?.value||"",o=a.length>ct,{PUBLIC_ENV:r}=Z(),s=r==="local",i=a.trim()!==""&&(s||t!=="")&&!o,c=o?`No debes exceder el limite de ${ct} caracteres.`:"Debes completar todos los campos para comentar.";return{boolean:i,text:c}},os=e=>{const t=e.cookie.split("; ").find(a=>a.startsWith("reported="));if(!t)return[];try{return JSON.parse(decodeURIComponent(t.split("=")[1]??""))}catch{return[]}},Hd=(e,t)=>{const a=os(e);a.includes(t)||(a.push(t),e.cookie=`reported=${encodeURIComponent(JSON.stringify(a))}; path=/; max-age=${3600*24*1}`)};function Fd(e){const[t,a]=e.split("@");if(!t||!a)return e;let o="";t.length<=2?o=t[0]+"*":o=t[0]+"*".repeat(t.length-2)+t[t.length-1];const r=a.lastIndexOf(".");if(r===-1)return`${o}@${a}`;const s=a.slice(0,r),i=a.slice(r);let c="";return s.length<=2?c=s[0]+"*":c=s[0]+"*".repeat(s.length-2)+s[s.length-1],`${o}@${c}${i}`}var In={exports:{}},kn={exports:{}},te={};var rs;function zd(){if(rs)return te;rs=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,a=e?Symbol.for("react.portal"):60106,o=e?Symbol.for("react.fragment"):60107,r=e?Symbol.for("react.strict_mode"):60108,s=e?Symbol.for("react.profiler"):60114,i=e?Symbol.for("react.provider"):60109,c=e?Symbol.for("react.context"):60110,d=e?Symbol.for("react.async_mode"):60111,l=e?Symbol.for("react.concurrent_mode"):60111,h=e?Symbol.for("react.forward_ref"):60112,u=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,y=e?Symbol.for("react.memo"):60115,m=e?Symbol.for("react.lazy"):60116,g=e?Symbol.for("react.block"):60121,A=e?Symbol.for("react.fundamental"):60117,_=e?Symbol.for("react.responder"):60118,E=e?Symbol.for("react.scope"):60119;function S(w){if(typeof w=="object"&&w!==null){var P=w.$$typeof;switch(P){case t:switch(w=w.type,w){case d:case l:case o:case s:case r:case u:return w;default:switch(w=w&&w.$$typeof,w){case c:case h:case m:case y:case i:return w;default:return P}}case a:return P}}}function I(w){return S(w)===l}return te.AsyncMode=d,te.ConcurrentMode=l,te.ContextConsumer=c,te.ContextProvider=i,te.Element=t,te.ForwardRef=h,te.Fragment=o,te.Lazy=m,te.Memo=y,te.Portal=a,te.Profiler=s,te.StrictMode=r,te.Suspense=u,te.isAsyncMode=function(w){return I(w)||S(w)===d},te.isConcurrentMode=I,te.isContextConsumer=function(w){return S(w)===c},te.isContextProvider=function(w){return S(w)===i},te.isElement=function(w){return typeof w=="object"&&w!==null&&w.$$typeof===t},te.isForwardRef=function(w){return S(w)===h},te.isFragment=function(w){return S(w)===o},te.isLazy=function(w){return S(w)===m},te.isMemo=function(w){return S(w)===y},te.isPortal=function(w){return S(w)===a},te.isProfiler=function(w){return S(w)===s},te.isStrictMode=function(w){return S(w)===r},te.isSuspense=function(w){return S(w)===u},te.isValidElementType=function(w){return typeof w=="string"||typeof w=="function"||w===o||w===l||w===s||w===r||w===u||w===f||typeof w=="object"&&w!==null&&(w.$$typeof===m||w.$$typeof===y||w.$$typeof===i||w.$$typeof===c||w.$$typeof===h||w.$$typeof===A||w.$$typeof===_||w.$$typeof===E||w.$$typeof===g)},te.typeOf=S,te}var ne={};var ss;function Vd(){return ss||(ss=1,process.env.NODE_ENV!=="production"&&(function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,a=e?Symbol.for("react.portal"):60106,o=e?Symbol.for("react.fragment"):60107,r=e?Symbol.for("react.strict_mode"):60108,s=e?Symbol.for("react.profiler"):60114,i=e?Symbol.for("react.provider"):60109,c=e?Symbol.for("react.context"):60110,d=e?Symbol.for("react.async_mode"):60111,l=e?Symbol.for("react.concurrent_mode"):60111,h=e?Symbol.for("react.forward_ref"):60112,u=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,y=e?Symbol.for("react.memo"):60115,m=e?Symbol.for("react.lazy"):60116,g=e?Symbol.for("react.block"):60121,A=e?Symbol.for("react.fundamental"):60117,_=e?Symbol.for("react.responder"):60118,E=e?Symbol.for("react.scope"):60119;function S(q){return typeof q=="string"||typeof q=="function"||q===o||q===l||q===s||q===r||q===u||q===f||typeof q=="object"&&q!==null&&(q.$$typeof===m||q.$$typeof===y||q.$$typeof===i||q.$$typeof===c||q.$$typeof===h||q.$$typeof===A||q.$$typeof===_||q.$$typeof===E||q.$$typeof===g)}function I(q){if(typeof q=="object"&&q!==null){var Ae=q.$$typeof;switch(Ae){case t:var Bn=q.type;switch(Bn){case d:case l:case o:case s:case r:case u:return Bn;default:var Is=Bn&&Bn.$$typeof;switch(Is){case c:case h:case m:case y:case i:return Is;default:return Ae}}case a:return Ae}}}var w=d,P=l,B=c,K=i,ee=t,$=h,M=o,R=m,ie=y,Q=a,U=s,T=r,j=u,x=!1;function F(q){return x||(x=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),p(q)||I(q)===d}function p(q){return I(q)===l}function C(q){return I(q)===c}function L(q){return I(q)===i}function G(q){return typeof q=="object"&&q!==null&&q.$$typeof===t}function O(q){return I(q)===h}function H(q){return I(q)===o}function z(q){return I(q)===m}function V(q){return I(q)===y}function J(q){return I(q)===a}function X(q){return I(q)===s}function W(q){return I(q)===r}function se(q){return I(q)===u}ne.AsyncMode=w,ne.ConcurrentMode=P,ne.ContextConsumer=B,ne.ContextProvider=K,ne.Element=ee,ne.ForwardRef=$,ne.Fragment=M,ne.Lazy=R,ne.Memo=ie,ne.Portal=Q,ne.Profiler=U,ne.StrictMode=T,ne.Suspense=j,ne.isAsyncMode=F,ne.isConcurrentMode=p,ne.isContextConsumer=C,ne.isContextProvider=L,ne.isElement=G,ne.isForwardRef=O,ne.isFragment=H,ne.isLazy=z,ne.isMemo=V,ne.isPortal=J,ne.isProfiler=X,ne.isStrictMode=W,ne.isSuspense=se,ne.isValidElementType=S,ne.typeOf=I})()),ne}var is;function va(){return is||(is=1,process.env.NODE_ENV==="production"?kn.exports=zd():kn.exports=Vd()),kn.exports}var Ca,cs;function Wd(){if(cs)return Ca;cs=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;function o(s){if(s==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(s)}function r(){try{if(!Object.assign)return!1;var s=new String("abc");if(s[5]="de",Object.getOwnPropertyNames(s)[0]==="5")return!1;for(var i={},c=0;c<10;c++)i["_"+String.fromCharCode(c)]=c;var d=Object.getOwnPropertyNames(i).map(function(h){return i[h]});if(d.join("")!=="0123456789")return!1;var l={};return"abcdefghijklmnopqrst".split("").forEach(function(h){l[h]=h}),Object.keys(Object.assign({},l)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return Ca=r()?Object.assign:function(s,i){for(var c,d=o(s),l,h=1;h<arguments.length;h++){c=Object(arguments[h]);for(var u in c)t.call(c,u)&&(d[u]=c[u]);if(e){l=e(c);for(var f=0;f<l.length;f++)a.call(c,l[f])&&(d[l[f]]=c[l[f]])}}return d},Ca}var _a,ls;function Sa(){if(ls)return _a;ls=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return _a=e,_a}var Na,ds;function hs(){return ds||(ds=1,Na=Function.call.bind(Object.prototype.hasOwnProperty)),Na}var Ea,us;function Yd(){if(us)return Ea;us=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=Sa(),a={},o=hs();e=function(s){var i="Warning: "+s;typeof console<"u"&&console.error(i);try{throw new Error(i)}catch{}}}function r(s,i,c,d,l){if(process.env.NODE_ENV!=="production"){for(var h in s)if(o(s,h)){var u;try{if(typeof s[h]!="function"){var f=Error((d||"React class")+": "+c+" type `"+h+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof s[h]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw f.name="Invariant Violation",f}u=s[h](i,h,d,c,null,t)}catch(m){u=m}if(u&&!(u instanceof Error)&&e((d||"React class")+": type specification of "+c+" `"+h+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof u+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),u instanceof Error&&!(u.message in a)){a[u.message]=!0;var y=l?l():"";e("Failed "+c+" type: "+u.message+(y??""))}}}}return r.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(a={})},Ea=r,Ea}var Ta,fs;function Kd(){if(fs)return Ta;fs=1;var e=va(),t=Wd(),a=Sa(),o=hs(),r=Yd(),s=function(){};process.env.NODE_ENV!=="production"&&(s=function(c){var d="Warning: "+c;typeof console<"u"&&console.error(d);try{throw new Error(d)}catch{}});function i(){return null}return Ta=function(c,d){var l=typeof Symbol=="function"&&Symbol.iterator,h="@@iterator";function u(p){var C=p&&(l&&p[l]||p[h]);if(typeof C=="function")return C}var f="<<anonymous>>",y={array:_("array"),bigint:_("bigint"),bool:_("boolean"),func:_("function"),number:_("number"),object:_("object"),string:_("string"),symbol:_("symbol"),any:E(),arrayOf:S,element:I(),elementType:w(),instanceOf:P,node:$(),objectOf:K,oneOf:B,oneOfType:ee,shape:R,exact:ie};function m(p,C){return p===C?p!==0||1/p===1/C:p!==p&&C!==C}function g(p,C){this.message=p,this.data=C&&typeof C=="object"?C:{},this.stack=""}g.prototype=Error.prototype;function A(p){if(process.env.NODE_ENV!=="production")var C={},L=0;function G(H,z,V,J,X,W,se){if(J=J||f,W=W||V,se!==a){if(d){var q=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw q.name="Invariant Violation",q}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var Ae=J+":"+V;!C[Ae]&&L<3&&(s("You are manually calling a React.PropTypes validation function for the `"+W+"` prop on `"+J+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),C[Ae]=!0,L++)}}return z[V]==null?H?z[V]===null?new g("The "+X+" `"+W+"` is marked as required "+("in `"+J+"`, but its value is `null`.")):new g("The "+X+" `"+W+"` is marked as required in "+("`"+J+"`, but its value is `undefined`.")):null:p(z,V,J,X,W)}var O=G.bind(null,!1);return O.isRequired=G.bind(null,!0),O}function _(p){function C(L,G,O,H,z,V){var J=L[G],X=T(J);if(X!==p){var W=j(J);return new g("Invalid "+H+" `"+z+"` of type "+("`"+W+"` supplied to `"+O+"`, expected ")+("`"+p+"`."),{expectedType:p})}return null}return A(C)}function E(){return A(i)}function S(p){function C(L,G,O,H,z){if(typeof p!="function")return new g("Property `"+z+"` of component `"+O+"` has invalid PropType notation inside arrayOf.");var V=L[G];if(!Array.isArray(V)){var J=T(V);return new g("Invalid "+H+" `"+z+"` of type "+("`"+J+"` supplied to `"+O+"`, expected an array."))}for(var X=0;X<V.length;X++){var W=p(V,X,O,H,z+"["+X+"]",a);if(W instanceof Error)return W}return null}return A(C)}function I(){function p(C,L,G,O,H){var z=C[L];if(!c(z)){var V=T(z);return new g("Invalid "+O+" `"+H+"` of type "+("`"+V+"` supplied to `"+G+"`, expected a single ReactElement."))}return null}return A(p)}function w(){function p(C,L,G,O,H){var z=C[L];if(!e.isValidElementType(z)){var V=T(z);return new g("Invalid "+O+" `"+H+"` of type "+("`"+V+"` supplied to `"+G+"`, expected a single ReactElement type."))}return null}return A(p)}function P(p){function C(L,G,O,H,z){if(!(L[G]instanceof p)){var V=p.name||f,J=F(L[G]);return new g("Invalid "+H+" `"+z+"` of type "+("`"+J+"` supplied to `"+O+"`, expected ")+("instance of `"+V+"`."))}return null}return A(C)}function B(p){if(!Array.isArray(p))return process.env.NODE_ENV!=="production"&&(arguments.length>1?s("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):s("Invalid argument supplied to oneOf, expected an array.")),i;function C(L,G,O,H,z){for(var V=L[G],J=0;J<p.length;J++)if(m(V,p[J]))return null;var X=JSON.stringify(p,function(se,q){var Ae=j(q);return Ae==="symbol"?String(q):q});return new g("Invalid "+H+" `"+z+"` of value `"+String(V)+"` "+("supplied to `"+O+"`, expected one of "+X+"."))}return A(C)}function K(p){function C(L,G,O,H,z){if(typeof p!="function")return new g("Property `"+z+"` of component `"+O+"` has invalid PropType notation inside objectOf.");var V=L[G],J=T(V);if(J!=="object")return new g("Invalid "+H+" `"+z+"` of type "+("`"+J+"` supplied to `"+O+"`, expected an object."));for(var X in V)if(o(V,X)){var W=p(V,X,O,H,z+"."+X,a);if(W instanceof Error)return W}return null}return A(C)}function ee(p){if(!Array.isArray(p))return process.env.NODE_ENV!=="production"&&s("Invalid argument supplied to oneOfType, expected an instance of array."),i;for(var C=0;C<p.length;C++){var L=p[C];if(typeof L!="function")return s("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+x(L)+" at index "+C+"."),i}function G(O,H,z,V,J){for(var X=[],W=0;W<p.length;W++){var se=p[W],q=se(O,H,z,V,J,a);if(q==null)return null;q.data&&o(q.data,"expectedType")&&X.push(q.data.expectedType)}var Ae=X.length>0?", expected one of type ["+X.join(", ")+"]":"";return new g("Invalid "+V+" `"+J+"` supplied to "+("`"+z+"`"+Ae+"."))}return A(G)}function $(){function p(C,L,G,O,H){return Q(C[L])?null:new g("Invalid "+O+" `"+H+"` supplied to "+("`"+G+"`, expected a ReactNode."))}return A(p)}function M(p,C,L,G,O){return new g((p||"React class")+": "+C+" type `"+L+"."+G+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+O+"`.")}function R(p){function C(L,G,O,H,z){var V=L[G],J=T(V);if(J!=="object")return new g("Invalid "+H+" `"+z+"` of type `"+J+"` "+("supplied to `"+O+"`, expected `object`."));for(var X in p){var W=p[X];if(typeof W!="function")return M(O,H,z,X,j(W));var se=W(V,X,O,H,z+"."+X,a);if(se)return se}return null}return A(C)}function ie(p){function C(L,G,O,H,z){var V=L[G],J=T(V);if(J!=="object")return new g("Invalid "+H+" `"+z+"` of type `"+J+"` "+("supplied to `"+O+"`, expected `object`."));var X=t({},L[G],p);for(var W in X){var se=p[W];if(o(p,W)&&typeof se!="function")return M(O,H,z,W,j(se));if(!se)return new g("Invalid "+H+" `"+z+"` key `"+W+"` supplied to `"+O+"`.\nBad object: "+JSON.stringify(L[G],null," ")+`
118
- Valid keys: `+JSON.stringify(Object.keys(p),null," "));var q=se(V,W,O,H,z+"."+W,a);if(q)return q}return null}return A(C)}function Q(p){switch(typeof p){case"number":case"string":case"undefined":return!0;case"boolean":return!p;case"object":if(Array.isArray(p))return p.every(Q);if(p===null||c(p))return!0;var C=u(p);if(C){var L=C.call(p),G;if(C!==p.entries){for(;!(G=L.next()).done;)if(!Q(G.value))return!1}else for(;!(G=L.next()).done;){var O=G.value;if(O&&!Q(O[1]))return!1}}else return!1;return!0;default:return!1}}function U(p,C){return p==="symbol"?!0:C?C["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&C instanceof Symbol:!1}function T(p){var C=typeof p;return Array.isArray(p)?"array":p instanceof RegExp?"object":U(C,p)?"symbol":C}function j(p){if(typeof p>"u"||p===null)return""+p;var C=T(p);if(C==="object"){if(p instanceof Date)return"date";if(p instanceof RegExp)return"regexp"}return C}function x(p){var C=j(p);switch(C){case"array":case"object":return"an "+C;case"boolean":case"date":case"regexp":return"a "+C;default:return C}}function F(p){return!p.constructor||!p.constructor.name?f:p.constructor.name}return y.checkPropTypes=r,y.resetWarningCache=r.resetWarningCache,y.PropTypes=y,y},Ta}var Ia,ms;function Jd(){if(ms)return Ia;ms=1;var e=Sa();function t(){}function a(){}return a.resetWarningCache=t,Ia=function(){function o(i,c,d,l,h,u){if(u!==e){var f=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw f.name="Invariant Violation",f}}o.isRequired=o;function r(){return o}var s={array:o,bigint:o,bool:o,func:o,number:o,object:o,string:o,symbol:o,any:o,arrayOf:r,element:o,elementType:o,instanceOf:r,node:o,objectOf:r,oneOf:r,oneOfType:r,shape:r,exact:r,checkPropTypes:a,resetWarningCache:t};return s.PropTypes=s,s},Ia}var gs;function Zd(){if(gs)return In.exports;if(gs=1,process.env.NODE_ENV!=="production"){var e=va(),t=!0;In.exports=Kd()(e.isElement,t)}else In.exports=Jd()();return In.exports}var Xd=Zd();const ve=lt(Xd);var Rd=["sitekey","onChange","theme","type","tabindex","onExpired","onErrored","size","stoken","grecaptcha","badge","hl","isolated"];function ka(){return ka=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(e[o]=a[o])}return e},ka.apply(this,arguments)}function e1(e,t){if(e==null)return{};var a={},o=Object.keys(e),r,s;for(s=0;s<o.length;s++)r=o[s],!(t.indexOf(r)>=0)&&(a[r]=e[r]);return a}function xn(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function t1(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,xa(e,t)}function xa(e,t){return xa=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,r){return o.__proto__=r,o},xa(e,t)}var Un=(function(e){t1(t,e);function t(){var o;return o=e.call(this)||this,o.handleExpired=o.handleExpired.bind(xn(o)),o.handleErrored=o.handleErrored.bind(xn(o)),o.handleChange=o.handleChange.bind(xn(o)),o.handleRecaptchaRef=o.handleRecaptchaRef.bind(xn(o)),o}var a=t.prototype;return a.getCaptchaFunction=function(r){return this.props.grecaptcha?this.props.grecaptcha.enterprise?this.props.grecaptcha.enterprise[r]:this.props.grecaptcha[r]:null},a.getValue=function(){var r=this.getCaptchaFunction("getResponse");return r&&this._widgetId!==void 0?r(this._widgetId):null},a.getWidgetId=function(){return this.props.grecaptcha&&this._widgetId!==void 0?this._widgetId:null},a.execute=function(){var r=this.getCaptchaFunction("execute");if(r&&this._widgetId!==void 0)return r(this._widgetId);this._executeRequested=!0},a.executeAsync=function(){var r=this;return new Promise(function(s,i){r.executionResolve=s,r.executionReject=i,r.execute()})},a.reset=function(){var r=this.getCaptchaFunction("reset");r&&this._widgetId!==void 0&&r(this._widgetId)},a.forceReset=function(){var r=this.getCaptchaFunction("reset");r&&r()},a.handleExpired=function(){this.props.onExpired?this.props.onExpired():this.handleChange(null)},a.handleErrored=function(){this.props.onErrored&&this.props.onErrored(),this.executionReject&&(this.executionReject(),delete this.executionResolve,delete this.executionReject)},a.handleChange=function(r){this.props.onChange&&this.props.onChange(r),this.executionResolve&&(this.executionResolve(r),delete this.executionReject,delete this.executionResolve)},a.explicitRender=function(){var r=this.getCaptchaFunction("render");if(r&&this._widgetId===void 0){var s=document.createElement("div");this._widgetId=r(s,{sitekey:this.props.sitekey,callback:this.handleChange,theme:this.props.theme,type:this.props.type,tabindex:this.props.tabindex,"expired-callback":this.handleExpired,"error-callback":this.handleErrored,size:this.props.size,stoken:this.props.stoken,hl:this.props.hl,badge:this.props.badge,isolated:this.props.isolated}),this.captcha.appendChild(s)}this._executeRequested&&this.props.grecaptcha&&this._widgetId!==void 0&&(this._executeRequested=!1,this.execute())},a.componentDidMount=function(){this.explicitRender()},a.componentDidUpdate=function(){this.explicitRender()},a.handleRecaptchaRef=function(r){this.captcha=r},a.render=function(){var r=this.props;r.sitekey,r.onChange,r.theme,r.type,r.tabindex,r.onExpired,r.onErrored,r.size,r.stoken,r.grecaptcha,r.badge,r.hl,r.isolated;var s=e1(r,Rd);return Pa.createElement("div",ka({},s,{ref:this.handleRecaptchaRef}))},t})(Pa.Component);Un.displayName="ReCAPTCHA",Un.propTypes={sitekey:ve.string.isRequired,onChange:ve.func,grecaptcha:ve.object,theme:ve.oneOf(["dark","light"]),type:ve.oneOf(["image","audio"]),tabindex:ve.number,onExpired:ve.func,onErrored:ve.func,size:ve.oneOf(["compact","normal","invisible"]),stoken:ve.string,hl:ve.string,badge:ve.oneOf(["bottomright","bottomleft","inline"]),isolated:ve.bool},Un.defaultProps={onChange:function(){},theme:"light",type:"image",tabindex:0,size:"normal",badge:"bottomright"};var Ua,ps;function n1(){if(ps)return Ua;ps=1;var e=va(),t={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},a={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},o={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},r={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};s[e.ForwardRef]=o,s[e.Memo]=r;function i(m){return e.isMemo(m)?r:s[m.$$typeof]||t}var c=Object.defineProperty,d=Object.getOwnPropertyNames,l=Object.getOwnPropertySymbols,h=Object.getOwnPropertyDescriptor,u=Object.getPrototypeOf,f=Object.prototype;function y(m,g,A){if(typeof g!="string"){if(f){var _=u(g);_&&_!==f&&y(m,_,A)}var E=d(g);l&&(E=E.concat(l(g)));for(var S=i(m),I=i(g),w=0;w<E.length;++w){var P=E[w];if(!a[P]&&!(A&&A[P])&&!(I&&I[P])&&!(S&&S[P])){var B=h(g,P);try{c(m,P,B)}catch{}}}}return m}return Ua=y,Ua}var a1=n1();const o1=lt(a1);function La(){return La=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(e[o]=a[o])}return e},La.apply(this,arguments)}function r1(e,t){if(e==null)return{};var a={},o=Object.keys(e),r,s;for(s=0;s<o.length;s++)r=o[s],!(t.indexOf(r)>=0)&&(a[r]=e[r]);return a}function s1(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var Be={},i1=0;function c1(e,t){return t=t||{},function(o){var r=o.displayName||o.name||"Component",s=(function(c){s1(d,c);function d(h,u){var f;return f=c.call(this,h,u)||this,f.state={},f.__scriptURL="",f}var l=d.prototype;return l.asyncScriptLoaderGetScriptLoaderID=function(){return this.__scriptLoaderID||(this.__scriptLoaderID="async-script-loader-"+i1++),this.__scriptLoaderID},l.setupScriptURL=function(){return this.__scriptURL=typeof e=="function"?e():e,this.__scriptURL},l.asyncScriptLoaderHandleLoad=function(u){var f=this;this.setState(u,function(){return f.props.asyncScriptOnLoad&&f.props.asyncScriptOnLoad(f.state)})},l.asyncScriptLoaderTriggerOnScriptLoaded=function(){var u=Be[this.__scriptURL];if(!u||!u.loaded)throw new Error("Script is not loaded.");for(var f in u.observers)u.observers[f](u);delete window[t.callbackName]},l.componentDidMount=function(){var u=this,f=this.setupScriptURL(),y=this.asyncScriptLoaderGetScriptLoaderID(),m=t,g=m.globalName,A=m.callbackName,_=m.scriptId;if(g&&typeof window[g]<"u"&&(Be[f]={loaded:!0,observers:{}}),Be[f]){var E=Be[f];if(E&&(E.loaded||E.errored)){this.asyncScriptLoaderHandleLoad(E);return}E.observers[y]=function(B){return u.asyncScriptLoaderHandleLoad(B)};return}var S={};S[y]=function(B){return u.asyncScriptLoaderHandleLoad(B)},Be[f]={loaded:!1,observers:S};var I=document.createElement("script");I.src=f,I.async=!0;for(var w in t.attributes)I.setAttribute(w,t.attributes[w]);_&&(I.id=_);var P=function(K){if(Be[f]){var ee=Be[f],$=ee.observers;for(var M in $)K($[M])&&delete $[M]}};A&&typeof window<"u"&&(window[A]=function(){return u.asyncScriptLoaderTriggerOnScriptLoaded()}),I.onload=function(){var B=Be[f];B&&(B.loaded=!0,P(function(K){return A?!1:(K(B),!0)}))},I.onerror=function(){var B=Be[f];B&&(B.errored=!0,P(function(K){return K(B),!0}))},document.body.appendChild(I)},l.componentWillUnmount=function(){var u=this.__scriptURL;if(t.removeOnUnmount===!0)for(var f=document.getElementsByTagName("script"),y=0;y<f.length;y+=1)f[y].src.indexOf(u)>-1&&f[y].parentNode&&f[y].parentNode.removeChild(f[y]);var m=Be[u];m&&(delete m.observers[this.asyncScriptLoaderGetScriptLoaderID()],t.removeOnUnmount===!0&&delete Be[u])},l.render=function(){var u=t.globalName,f=this.props;f.asyncScriptOnLoad;var y=f.forwardedRef,m=r1(f,["asyncScriptOnLoad","forwardedRef"]);return u&&typeof window<"u"&&(m[u]=typeof window[u]<"u"?window[u]:void 0),m.ref=y,N.createElement(o,m)},d})(N.Component),i=N.forwardRef(function(c,d){return N.createElement(s,La({},c,{forwardedRef:d}))});return i.displayName="AsyncScriptLoader("+r+")",i.propTypes={asyncScriptOnLoad:ve.func},o1(i,o)}}var qa="onloadcallback",l1="grecaptcha";function Ba(){return typeof window<"u"&&window.recaptchaOptions||{}}function d1(){var e=Ba(),t=e.useRecaptchaNet?"recaptcha.net":"www.google.com";return e.enterprise?"https://"+t+"/recaptcha/enterprise.js?onload="+qa+"&render=explicit":"https://"+t+"/recaptcha/api.js?onload="+qa+"&render=explicit"}const As=c1(d1,{callbackName:qa,globalName:l1,attributes:Ba().nonce?{nonce:Ba().nonce}:{}})(Un),k={overlay:"_overlay_1je20_1",header:"_header_1je20_35",logo:"_logo_1je20_49",card:"_card_1je20_63",close:"_close_1je20_93",form:"_form_1je20_141",formUl:"_formUl_1je20_159",field:"_field_1je20_183",label:"_label_1je20_197",input:"_input_1je20_215",error:"_error_1je20_251",primary:"_primary_1je20_263",divider:"_divider_1je20_333",google:"_google_1je20_385",googleIcon:"_googleIcon_1je20_445",spin:"_spin_1je20_511",checkboxRow:"_checkboxRow_1je20_555",switch:"_switch_1je20_613",terms:"_terms_1je20_629",message:"_message_1je20_691",passwordChecker:"_passwordChecker_1je20_701",valid:"_valid_1je20_739",invalid:"_invalid_1je20_747",forgotPassword:"_forgotPassword_1je20_755",successContainer:"_successContainer_1je20_793",thumbsUp:"_thumbsUp_1je20_809",successMessage:"_successMessage_1je20_821"},Je=()=>n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",width:"24",height:"24",viewBox:"0 0 32 32",className:k.spin,children:n.jsx("path",{d:"M18,4.181v2.021c4.559,0.929,8,4.97,8,9.798c0,5.514-4.486,10-10,10S6,21.514,6,16c0-4.829,3.441-8.869,8-9.798V4.181 C8.334,5.137,4,10.066,4,16c0,6.617,5.383,12,12,12s12-5.383,12-12C28,10.066,23.666,5.137,18,4.181z"})}),h1=({isOpen:e,onClose:t,commentId:a,publication:o,username:r})=>{const[s,i]=N.useState("form"),[c,d]=N.useState(""),[l,h]=N.useState(""),[u,f]=N.useState(""),y=[{id:"spam",label:Me.spam},{id:"inappropriate",label:Me.inappropriate},{id:"hate",label:Me.hate},{id:"misinformation",label:Me.misinformation},{id:"terrorism",label:Me.terrorism},{id:"intellectual",label:Me.intellectual},{id:"bullying",label:Me.bullying}],m=async()=>{if(!(!c||!a)){if(os(document).includes(a)){h("Ya has reportado este comentario.");return}i("loading"),h("");try{const _=await(await fetch("/api/comments-report",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({publication:o,username:r,id:a,captchaToken:u,type:Me[c]})})).json();if(_.type==="success")Hd(document,a),i("success"),setTimeout(()=>{g()},3e3);else throw new Error(_.message||"Error al reportar comentario")}catch(A){console.error("Error reporting comment:",A),h(A.message||"Error al reportar comentario"),i("form")}}},g=()=>{i("form"),d(""),h(""),t()};return!e||!a||!r?null:n.jsx("div",{className:de.overlay,children:n.jsxs("div",{className:de.popup,children:[n.jsx("button",{className:"close-reply-form",onClick:g,children:n.jsx(At,{})}),n.jsx("h2",{className:de.title,children:"Reportar Abuso"}),s==="loading"&&n.jsx("div",{className:de.loadingContainer,children:n.jsx(Je,{})}),s==="form"||s==="loading"?n.jsxs(n.Fragment,{children:[n.jsx("div",{className:de.optionsContainer,children:y.map(A=>n.jsxs("label",{className:de.option,children:[n.jsx("input",{type:"radio",name:"reportReason",value:A.id,checked:c===A.id,onChange:_=>d(_.target.value),className:de.radioInput}),n.jsx("span",{className:de.radioCustom}),n.jsx("span",{className:de.optionLabel,children:A.label})]},A.id))}),l&&n.jsx("div",{className:de.errorMessage,children:l}),n.jsx(As,{sitekey:"",theme:"light",size:"normal",onChange:A=>f(A??""),onExpired:()=>f("")}),n.jsxs("div",{className:de.buttons,children:[n.jsx("button",{onClick:g,className:de.cancelButton,children:"Cancelar"}),n.jsx("button",{onClick:m,disabled:!c,className:de.reportButton,children:"Reportar"})]})]}):n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:de.successContainer,children:[n.jsx("div",{className:de.thumbsUp,children:n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:132,height:120,fill:"none",children:n.jsx("path",{fill:"#0073BE",d:"M119.249 42.357H81.915l5.621-27.039.177-1.893a8.906 8.906 0 0 0-2.603-6.272L78.838.941 39.907 39.93c-2.19 2.13-3.491 5.089-3.491 8.343v59.167c0 6.508 5.325 11.833 11.833 11.833h53.25c4.911 0 9.112-2.958 10.887-7.218l17.868-41.713c.533-1.36.829-2.78.829-4.32V54.192c0-6.509-5.325-11.834-11.834-11.834Zm0 23.667-17.75 41.417h-53.25V48.274l25.679-25.678L67.36 54.19h51.889v11.833ZM.916 48.274h23.667v71H.916v-71Z"})})}),n.jsx("p",{className:de.successMessage,children:"¡Gracias por reportar!"})]}),n.jsx("div",{className:de.buttons,children:n.jsx("button",{onClick:g,className:[de.closeButton,de.buttonAlone].join(" "),children:"Cerrar"})})]})]})})};async function Ln({publication:e,path:t,size:a=5,sizereply:o=2,id:r,lastid:s,state:i="5,6",apiToken:c}){const{PUBLIC_ENV:d}=Z();if(d==="prod")return(await ys({publication:e,path:t,size:a,sizereply:o,id:r,lastid:s,state:i,apiToken:c}))[0];{const l=await fetch(`/api/comments-get?publication=${e}&path=${t}&size=${a}&sizereply=${o}&lastid=${s}`);if(!l.ok)throw new Error(`Error al obtener comentarios: ${l.status}`);return(await l.json()).data[0]}}async function ys({publication:e,path:t,size:a=5,sizereply:o=2,id:r,lastid:s,state:i="5,6",apiToken:c}){if(!e||!t)throw new Error("Missing required parameters: publication and path");if(typeof e!="string"||typeof t!="string")throw new Error("Invalid input types for publication or path");if(!c)throw new Error("Missing CMS API token");const{PUBLIC_ENV:d,PUBLIC_API_HOST:l,PUBLIC_API_PATH:h,PUBLIC_API_PATH_VERSION:u}=Z(),f=parseInt(String(a),10),y=parseInt(String(o),10);if(isNaN(f)||f<=0)throw new Error("Invalid size parameter");if(isNaN(y)||y<0)throw new Error("Invalid sizereply parameter");const m=d!=="prod"?`${l}${h}`:Ja(),g=new URLSearchParams({publication:e,path:t,size:f.toString(),sizereply:y.toString(),state:i});r&&g.append("id",r),s&&g.append("lastid",s);const A=`${m}${u}/newcomments/get?${g.toString()}`;try{console.log("Fetching comments from:",A);const{data:_}=await oe.get(A,{headers:{"x-api-token":c,"Cache-Control":"max-age=0, no-cache, no-store, must-revalidate",Pragma:"no-cache",Expires:"0"}});if(!_)throw new Error("No comments data received");return _.data||_||[]}catch(_){if(console.error("Error fetching comments:",_),oe.isAxiosError(_)){const E=_.response?.status,S=_.response?.data;throw E===404?new Error("Comments not found"):E===403?new Error("Access forbidden - check API token"):E===401?new Error("Unauthorized - invalid API token"):E===500?new Error("Internal server error from CMS"):new Error(S?.error||S?.message||`HTTP ${E}: Failed to fetch comments`)}throw _}}const{PUBLIC_PUBLICATION_ID:u1}=Z(),f1=u1,m1=e=>{const[t,a]=N.useState(void 0);return N.useEffect(()=>{if(t)return;(async()=>{const{PUBLIC_X_SECURITY_TOKEN:r}=Z();try{const s=await Ln({publication:f1,path:e??"",size:5,sizereply:2,id:void 0,lastid:void 0,state:"5,6",apiToken:r});a(s??[])}catch(s){console.error(s),a({comments:[],morecomment:!1})}})()},[t]),{comments:t,setComments:a}},ws=({username:e,date:t})=>n.jsxs("div",{className:"comment-header",children:[n.jsx("span",{className:"comment-username",children:e}),n.jsx("span",{className:"comment-header-dot",children:"•"}),n.jsx("span",{className:"comment-date",children:$d(ke(Number(t)))})]}),bs=({user:e})=>n.jsx("div",{className:"comment-avatar",children:e.picture?n.jsx("img",{className:"comment-avatar-img",src:e.picture,alt:e.username}):e.firstname.charAt(0).toUpperCase()}),vs=({isReply:e=!1,onReply:t,onFlag:a})=>n.jsxs("div",{className:"comment-actions",children:[!e&&t&&n.jsx("button",{onClick:t,className:"comment-action-btn",children:n.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",children:[n.jsx("g",{clipPath:"url(#a)",children:n.jsx("path",{fill:"#4D4E4E",d:"M9.976 9V5l-6.983 7 6.983 7v-4.1c4.988 0 8.48 1.6 10.973 5.1-.997-5-3.99-10-10.973-11Z"})}),n.jsx("defs",{children:n.jsx("clipPath",{id:"a",children:n.jsx("path",{fill:"#fff",d:"M0 0h23.942v24H0z"})})})]})}),n.jsx("button",{onClick:a,className:"comment-action-btn",children:n.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:25,height:24,fill:"none",children:[n.jsx("g",{clipPath:"url(#a)",children:n.jsx("path",{fill:"#4D4E4E",d:"M20.133 2h-16c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2Zm0 14H5.303l-1.17 1.17V4h16v12Zm-9-11h2v6h-2V5Zm0 8h2v2h-2v-2Z"})}),n.jsx("defs",{children:n.jsx("clipPath",{id:"a",children:n.jsx("path",{fill:"#fff",d:"M.133 0h24v24h-24z"})})})]})})]}),Cs=({commentRef:e,captchaToken:t="",setIsDisabled:a})=>(N.useEffect(()=>{const o=e.current;if(!o)return;const r=()=>{const i=o.value.length;o.parentElement&&(o.parentElement.dataset.text=`${i}/${ct}`),o.classList.toggle("over-limit",i>ct),a(!ba(e,t).boolean)};return o.addEventListener("input",r),r(),()=>o.removeEventListener("input",r)},[e,t,a]),n.jsxs("div",{children:[n.jsx("label",{className:"comment-input-label",children:"Comentario"}),n.jsx("textarea",{ref:e,name:"comment",placeholder:"Ingresa un comentario",rows:2})]})),_s=({commentRef:e,captchaToken:t="",setCaptchaToken:a,children:o})=>{const r=ba(e,t);return n.jsxs("div",{className:"form-actions",children:[n.jsx(As,{sitekey:"",theme:"light",size:"normal",onChange:s=>a(s??""),onExpired:()=>a("")}),n.jsxs("div",{className:"submit-zone",children:[o,!r.boolean&&n.jsx("p",{className:"submit-warning",children:r.text})]})]})},Ss=({onClick:e,isDisabled:t})=>{const[a,o]=N.useState(!1);return N.useEffect(()=>{let r=null;return a&&(r=setTimeout(()=>{o(!1)},2400)),()=>{r&&clearTimeout(r)}},[a]),a?n.jsx("div",{className:"success-gif-container",children:n.jsx("img",{className:"success-gif",src:"/Success.gif"})}):n.jsxs("button",{type:"button",onClick:async r=>{await e(r)&&o(!0)},id:"comment-button",className:`submit-btn ${t?"disabled":"active"}`,children:["Enviar Comentario",n.jsx("svg",{style:{minWidth:16},width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:n.jsx("path",{d:"M1.39258 8.99997H12.5626L7.68258 13.88C7.29258 14.27 7.29258 14.91 7.68258 15.3C8.07258 15.69 8.70258 15.69 9.09258 15.3L15.6826 8.70997C16.0726 8.31997 16.0726 7.68997 15.6826 7.29997L9.10258 0.699971C8.71258 0.309971 8.08258 0.309971 7.69258 0.699971C7.30258 1.08997 7.30258 1.71997 7.69258 2.10997L12.5626 6.99997H1.39258C0.842578 6.99997 0.392578 7.44997 0.392578 7.99997C0.392578 8.54997 0.842578 8.99997 1.39258 8.99997Z",fill:"currentColor"})})]})},{PUBLIC_PUBLICATION_ID:g1}=Z(),p1=g1,Ns=async({path:e,ref:t,captchaToken:a,button:o,user:r,id:s,addComment:i})=>{const c=t.current?.value||"";if(!ba(t,a).boolean||!r){const d=o.nextElementSibling;return d&&(d.style.display="block"),!1}try{const d=Date.now(),l=await fetch("/api/comments-add",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({publication:p1,path:e,id:s,username:r.username,comment:c,recaptchaResponse:a})});let h=null;try{h=await l.json()}catch(m){console.error("Error parsing JSON response:",m)}if(!l.ok)throw new Error(`Error al enviar comentario: ${h?.message} status: ${l.status}`);const u=Date.now(),f=Math.max(0,2400+Math.abs(u-d)),y={username:r.username,firstname:r.firstname,...r.lastname&&{lastname:r.lastname},...r.picture&&{picture:r.picture}};return i({id:u.toString(),text:c,user:y,date:{time:Date.now()},reply:[]}),t.current&&(t.current.value=""),f}catch(d){return console.error("Error enviando comentario:",d),alert(d.message||"Error al enviar el comentario."),!1}},A1=({replyingTo:e,commentRef:t,user:a,path:o,addReply:r,closeForm:s})=>{const[i,c]=N.useState(!0),[d,l]=N.useState(""),h=()=>{t.current?.parentElement&&(t.current.parentElement.dataset.text=`0/${ct}`),c(!0),s()};return n.jsxs("div",{className:"comment-form reply-form",children:[n.jsx("button",{className:"close-reply-form",onClick:h,children:n.jsx(At,{})}),n.jsx(Cs,{commentRef:t,captchaToken:d,setIsDisabled:c}),n.jsx(_s,{commentRef:t,captchaToken:d,setCaptchaToken:l,children:n.jsx(Ss,{onClick:async u=>{if(i)return;const f=await Ns({path:o,ref:t,captchaToken:d,button:u.currentTarget,user:a,id:e,addComment:r});return f&&typeof f=="number"?(setTimeout(()=>{h()},f),!0):!1},isDisabled:i})})]})},y1=({reply:e,replyingTo:t,user:a,onFlag:o})=>{const r=e.text;let s=`${Ke.firstname} ${Ke.lastname}`,i=Ke.username;return e.user&&(s=`${e.user.firstname} ${e.user.lastname}`,i=e.user.username),n.jsx("div",{className:"comment-item reply",children:n.jsxs("div",{className:"comment-header-container",children:[n.jsx(bs,{user:e.user?e.user:Ke}),n.jsxs("div",{style:{flex:1},children:[n.jsx(ws,{username:s,date:e.date.time}),n.jsxs("div",{className:"comment-reply-to",children:["Respondiendo a ",n.jsx("strong",{children:t})]}),n.jsx("p",{className:"comment-text",children:r}),a?.username.toLowerCase()!==i.toLowerCase()&&n.jsx(vs,{isReply:!0,onFlag:()=>o(e.id)})]})]})})},w1=({comment:e,replyingTo:t,path:a,user:o,handleReplyingTo:r,onFlag:s})=>{const i={morereply:e.morereply??!1,reply:e.reply?e.reply:[]},[c,d]=N.useState(i),[l,h]=N.useState(!1),u=process.env.PUBLIC_PUBLICATION_ID??"",f=e.text,y=N.useRef(null);let m=`${Ke.firstname} ${Ke.lastname}`,g=Ke.username;e.user&&(m=`${e.user.firstname} ${e.user.lastname}`,g=e.user.username);const A=_=>{d({morereply:c.morereply,reply:[_,...c.reply]})};return n.jsx("div",{className:"comment-item",children:n.jsxs("div",{className:"comment-header-container","data-hasreplies":c.reply.length>0?"true":"false",children:[n.jsx(bs,{user:e.user?e.user:Ke}),n.jsxs("div",{style:{flex:1},children:[n.jsx(ws,{username:m,date:e.date.time}),n.jsx("p",{className:"comment-text",children:f}),o?.username.toLowerCase()!==g.toLowerCase()&&n.jsx(vs,{onReply:()=>r(e.id),onFlag:()=>s(e.id)}),t===e.id&&o&&n.jsx(A1,{replyingTo:t,commentRef:y,addReply:A,user:o,path:a,closeForm:()=>r("")}),c.reply.length>0&&n.jsxs("div",{className:"comment-replies",children:[c.reply.map(_=>n.jsx(y1,{user:o,reply:_,replyingTo:m,onFlag:s},_.id)),l?n.jsx("div",{style:{marginLeft:"4rem",position:"relative"},children:n.jsx(Je,{})}):c.morereply&&n.jsx("button",{className:"comment-replies-button reply-button",onClick:async()=>{const _=c.reply[c.reply.length-1]?.id;h(!0);try{const S=await Ln({publication:u,path:a??"",size:2,sizereply:2,id:e.id,lastid:_,state:"5,6",apiToken:process.env.PUBLIC_X_SECURITY_TOKEN});h(!1),d({morereply:S.morecomment,reply:[...c.reply,...S.comments]})}catch(E){throw h(!1),new Error(`Error al obtener comentarios: ${E}`)}},children:"Más Respuestas"})]})]})]})})},b1=({commentRef:e,user:t,path:a,addComment:o})=>{const[r,s]=N.useState(!0),[i,c]=N.useState("");return n.jsxs("div",{className:"comment-form",children:[n.jsx(Cs,{commentRef:e,captchaToken:i,setIsDisabled:s}),n.jsx(_s,{commentRef:e,captchaToken:i,setCaptchaToken:c,children:n.jsx(Ss,{onClick:async d=>{if(r)return;const l=await Ns({path:a,ref:e,captchaToken:i,button:d.currentTarget,user:t,addComment:o});return l&&typeof l=="number"?(e.current?.parentElement&&(e.current.parentElement.dataset.text=`0/${ct}`),s(!0),setTimeout(()=>{e.current?.parentElement&&(e.current.parentElement.dataset.text=`0/${ct}`),s(!0)},l),!0):!1},isDisabled:r})})]})},{PUBLIC_PUBLICATION_ID:v1,PUBLIC_X_SECURITY_TOKEN:C1}=Z(),Es=v1??"",_1=({isAuthenticated:e,path:t,user:a,handleLogout:o})=>{const r=t.replaceAll("/","|"),[s,i]=N.useState(void 0),[c,d]=N.useState(""),{comments:l,setComments:h}=m1(r),[u,f]=N.useState(!1),y=N.useRef(null),m=w=>{d(c===w?"":w)},g=w=>{h(l?{...l,comments:[w,...l.comments??[]]}:void 0)},A=w=>{i(w)},_=async()=>{if(!l||!l.morecomment||l.comments.length===0)return;const w=l.comments[l.comments.length-1];if(!w)return;f(!0);const P=w.id;try{const B=await Ln({publication:Es,path:r??"",size:5,sizereply:2,id:void 0,lastid:P,state:"5,6",apiToken:C1});h({morecomment:B.morecomment??!1,comments:[...l.comments,...B.comments]}),f(!1)}catch(B){throw f(!1),new Error(`Error al obtener comentarios: ${B}`)}},E=l?.comments&&l.comments.length>0,S=E?"Comparte tu opinión de este artículo.":"Se el primero en compartir tu opinión de este artículo.",I=n.jsx("div",{style:{display:"flex",width:"100%",justifyContent:"center"},children:n.jsx(Je,{})});return n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"comments-container",children:n.jsx(he,{title:E||e?"COMENTARIOS":!1,children:n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"comments-header",children:e&&a&&n.jsxs(n.Fragment,{children:[n.jsx(jd,{user:a,handleLogout:o,message:S}),n.jsx(b1,{commentRef:y,user:a,addComment:g,path:r})]})}),n.jsx("div",{className:"comments-list","data-isauthenticated":`${e}`,children:l?l.comments&&l.comments.length>0?n.jsxs(n.Fragment,{children:[l.comments.map(w=>n.jsx(w1,{comment:w,replyingTo:c,handleReplyingTo:m,onFlag:A,user:a??Ke,path:r},w.id)),u&&I]}):null:I}),l?.morecomment&&!u&&n.jsx("button",{className:"comment-replies-button",onClick:_,children:"Más"})]})})}),n.jsx(h1,{username:a?.username??void 0,publication:Es,commentId:s,isOpen:s!==void 0,onClose:()=>i(void 0)})]})},Oa=async(e,t)=>{if(!e)throw new Error("No action provided");if(!t)throw new Error("No site key provided");const a=window.grecaptcha;if(!a?.enterprise)throw new Error("grecaptcha not loaded");return new Promise((o,r)=>{a.enterprise.ready(async()=>{try{const s=await a.enterprise.execute(t,{action:e});if(!s)throw new Error("Captcha token no generado");o(s)}catch(s){r(s)}})})},Ts={email:{label:"Email",required:!0},given_name:{label:"Nombre",required:!0},family_name:{label:"Apellido",required:!0},password:{label:"Contraseña",required:!0},confirmPassword:{label:"Confirmar contraseña",required:!0}},qn=[{label:"La contraseña debe tener al menos 8 caracteres",test:e=>e.length>=8},{label:"Usa un número",test:e=>/\d/.test(e)},{label:"Usa una letra minúscula",test:e=>/[a-z]/.test(e)},{label:"Usa una letra mayúscula",test:e=>/[A-Z]/.test(e)},{label:"Usa un símbolo",test:e=>/[^A-Za-z0-9]/.test(e)}];function S1({goToLogin:e,handleGoogleLogin:t}){const[a,o]=N.useState({}),[r,s]=N.useState(!1),[i,c]=N.useState(!1),[d,l]=N.useState(null),[h,u]=N.useState("register"),f=(A,_)=>{o(E=>({...E,[A]:_}))},y=async A=>{A.preventDefault(),l(null),c(!0);try{const _=Object.keys(Ts).filter(B=>!["username","password","confirmPassword"].includes(B)).map(B=>({Name:B,Value:a[B]}));if(_.some(B=>{if(!B.Value||B.Value.trim()==="")return!0}))return c(!1),l("Complete todos los campos");if(a.password!==a.confirmPassword){l("Las contraseñas no coinciden");return}const E=a.password||"";if(qn.some(B=>!B.test(E))){l("La contraseña no es válida");return}const I=Math.floor(Date.now()/1e3);_.push({Name:"updated_at",Value:String(I)});const w=await Oa("comment_register","");if(!w)throw new Error("Captcha token no generado");const P=await fetch("/api/auth/create-user",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:a.email,password:a.password,userAttributes:_,token:w})});if(!P.ok){const B=await P.json().catch(()=>({}));if(B.code==="UsernameExistsException"){await fetch("/api/auth/resend-code",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:a.email})}),u("confirm");return}throw new Error(B?.error||"Error al crear usuario")}u("confirm")}catch(_){console.log(_),l(_?.message||_?.error||"Error inesperado")}finally{c(!1)}},m=async A=>{if(A.preventDefault(),!a.confirmationCode){l("Debes ingresar el código de verificación");return}l(null),c(!0);try{const _=await fetch("/api/auth/confirm-user",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:a.email,code:a.confirmationCode})});if(!_.ok){const E=await _.json().catch(()=>({}));throw new Error(E?.error||"Error al confirmar usuario")}u("success")}catch(_){l(_?.message||"Error inesperado")}finally{c(!1)}},g=a.password||"";return n.jsxs(n.Fragment,{children:[h==="register"&&n.jsxs(n.Fragment,{children:[n.jsxs("button",{onClick:t,className:k.google,children:[n.jsx("img",{src:"https://www.gstatic.com/firebasejs/ui/2.0.0/images/auth/google.svg",alt:"",className:k.googleIcon}),n.jsx("span",{children:"Continuar con Google"})]}),n.jsx("div",{className:k.divider,children:n.jsx("span",{children:"o"})}),n.jsxs("form",{onSubmit:y,className:k.form,"data-error":d?"true":"false",children:[n.jsx("ul",{className:k.formUl,children:Object.entries(Ts).map(([A,{label:_}])=>n.jsxs("div",{className:k.field,children:[n.jsx("label",{className:k.label,children:_}),n.jsx("input",{type:A.toLowerCase().includes("password")?r?"text":"password":A==="birthdate"?"date":A==="email"?"email":A==="phone_number"?"tel":"text",name:A,value:a[A]||"",onChange:E=>f(A,E.target.value),className:k.input,placeholder:""}),A==="password"&&n.jsx("div",{className:k.passwordChecker,children:qn.map((E,S)=>{const I=E.test(g);return n.jsxs("div",{className:I?k.valid:k.invalid,children:[n.jsx("div",{children:I?"✔":"○"}),n.jsx("div",{children:E.label})]},S)})}),A==="confirmPassword"&&n.jsxs("div",{className:k.checkboxRow,children:[n.jsx("input",{id:"showPasswordRegister",type:"checkbox",checked:r,onChange:E=>s(E.target.checked)}),n.jsx("label",{htmlFor:"showPasswordRegister",className:k.checkboxLabel,children:"Mostrar contraseñas"})]})]},A))}),d&&n.jsx("p",{className:k.error,children:d}),n.jsxs("p",{className:k.terms,children:["Al continuar, confirmo que he leído y aceptado los",n.jsx("a",{href:"/pages/politicas-de-privacidad.html",target:"_blank",children:"Términos y Condiciones"}),"de nuestra comunidad"]}),n.jsx("button",{type:"submit",className:k.primary,disabled:i,children:i?n.jsx(Je,{}):"Crear cuenta"})]})]}),h==="confirm"&&n.jsxs("form",{onSubmit:m,className:k.form,"data-error":d?"true":"false",children:[n.jsxs("div",{className:k.field,children:[n.jsx("label",{className:k.label,children:"Código de verificación"}),n.jsx("input",{type:"text",name:"confirmationCode",value:a.confirmationCode||"",onChange:A=>f("confirmationCode",A.target.value),className:k.input,required:!0})]}),d&&n.jsx("p",{className:k.error,children:d}),n.jsx("button",{type:"submit",className:k.primary,disabled:i,children:i?n.jsx(Je,{}):"Confirmar cuenta"}),n.jsxs("p",{className:k.switch,children:["¿Ya confirmaste antes?",n.jsx("button",{type:"button",onClick:e,children:"Iniciar sesión"})]})]}),h==="success"&&n.jsxs("form",{className:k.form,children:[n.jsxs("div",{className:k.successContainer,children:[n.jsx("div",{className:k.thumbsUp,children:n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:132,height:120,fill:"none",children:n.jsx("path",{fill:"#0073BE",d:"M119.249 42.357H81.915l5.621-27.039.177-1.893a8.906 8.906 0 0 0-2.603-6.272L78.838.941 39.907 39.93c-2.19 2.13-3.491 5.089-3.491 8.343v59.167c0 6.508 5.325 11.833 11.833 11.833h53.25c4.911 0 9.112-2.958 10.887-7.218l17.868-41.713c.533-1.36.829-2.78.829-4.32V54.192c0-6.509-5.325-11.834-11.834-11.834Zm0 23.667-17.75 41.417h-53.25V48.274l25.679-25.678L67.36 54.19h51.889v11.833ZM.916 48.274h23.667v71H.916v-71Z"})})}),n.jsxs("div",{className:k.successMessage,children:[n.jsx("p",{children:"Confirmación completa."}),n.jsx("p",{children:"Ya eres parte de la comunidad!"})]})]}),n.jsx("button",{onClick:e,className:k.primary,children:"Iniciar sesión"})]}),h==="register"&&n.jsxs("p",{className:k.switch,children:["¿Ya tenés cuenta?",n.jsx("button",{type:"button",onClick:e,children:"Iniciar sesión"})]})]})}function N1({onClose:e,checkAuth:t,goToRegister:a,handleGoogleLogin:o}){const[r,s]=N.useState("login"),[i,c]=N.useState(""),[d,l]=N.useState(""),[h,u]=N.useState(""),[f,y]=N.useState(""),[m,g]=N.useState(""),[A,_]=N.useState(!1),[E,S]=N.useState(!1),[I,w]=N.useState(null),{CAPTCHA_KEY:P}=Z(),B=async $=>{if(!E){$.preventDefault(),w(null),S(!0);try{const M=await Oa("comment_login",P||"");if(!M)throw new Error("Captcha token no generado");const R=await fetch("/api/auth/login-password",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({email:i,password:d,token:M})});if(!R.ok){const ie=await R.json().catch(()=>({}));throw new Error(ie?.error||"Ha ocurrido un error")}e(),await t()}catch(M){w(M?.message||"Error inesperado")}finally{S(!1)}}},K=async $=>{if(!E){$.preventDefault(),w(null),S(!0);try{const M=await fetch("/api/auth/forgot-password",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:i})});if(!M.ok){const R=await M.json().catch(()=>({}));throw new Error(R?.error||"Error al enviar código")}l(""),s("changePassword")}catch(M){w(M?.message||"Error inesperado")}finally{S(!1)}}},ee=async $=>{if(E)return;if($.preventDefault(),f!==m){w("Las contraseñas no coinciden");return}if(qn.some(R=>!R.test(f))){w("La contraseña no cumple con los requisitos");return}w(null),S(!0);try{const R=await fetch("/api/auth/confirm-forgot-password",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:i,code:h,newPassword:f})});if(!R.ok){const ie=await R.json().catch(()=>({}));throw new Error(ie?.error||"Error al cambiar contraseña")}s("feedback")}catch(R){w(R?.message||"Error inesperado")}finally{S(!1)}};return n.jsxs(n.Fragment,{children:[r==="login"&&n.jsx(E1,{email:i,password:d,showPassword:A,loading:E,error:I,setEmail:c,setPassword:l,setShowPassword:_,onSubmit:B,onForgot:()=>{w(null),s("forgot")},onRegister:a,handleGoogleLogin:o}),r==="forgot"&&n.jsx(T1,{email:i,setEmail:c,loading:E,error:I,onSubmit:K,onBack:()=>{w(null),s("login")}}),r==="changePassword"&&n.jsx(I1,{email:i,confirmationCode:h,newPassword:f,confirmNewPassword:m,showPassword:A,loading:E,error:I,setConfirmationCode:u,setNewPassword:y,setConfirmNewPassword:g,setShowPassword:_,onSubmit:ee,onBack:()=>{w(null),s("forgot")}}),r==="feedback"&&n.jsx(k1,{onBackToLogin:()=>{w(null),s("login")}})]})}function E1({email:e,password:t,showPassword:a,loading:o,error:r,setEmail:s,setPassword:i,setShowPassword:c,onSubmit:d,onForgot:l,onRegister:h,handleGoogleLogin:u}){return n.jsxs(n.Fragment,{children:[n.jsxs("button",{onClick:u,className:k.google,children:[n.jsx("img",{src:"https://www.gstatic.com/firebasejs/ui/2.0.0/images/auth/google.svg",alt:"",className:k.googleIcon}),n.jsx("span",{children:"Continuar con Google"})]}),n.jsx("div",{className:k.divider,children:n.jsx("span",{children:"o"})}),n.jsxs("form",{onSubmit:d,className:k.form,"data-error":r?"true":"false",children:[n.jsxs("div",{className:k.field,children:[n.jsx("label",{className:k.label,children:"Email"}),n.jsx("input",{type:"email",value:e,onChange:f=>s(f.target.value),className:k.input,placeholder:""})]}),n.jsxs("div",{className:k.field,children:[n.jsx("label",{className:k.label,children:"Contraseña"}),n.jsx("input",{type:a?"text":"password",value:t,onChange:f=>i(f.target.value),className:k.input,placeholder:""}),n.jsxs("div",{className:k.checkboxRow,children:[n.jsx("input",{id:"showPasswordLogin",type:"checkbox",checked:a,onChange:f=>c(f.target.checked)}),n.jsx("label",{htmlFor:"showPasswordLogin",className:k.checkboxLabel,children:"Mostrar contraseña"})]})]}),r&&n.jsx("p",{className:k.error,children:r}),n.jsx("button",{type:"submit",className:k.primary,disabled:o,children:o?n.jsx(Je,{}):"Iniciar Sesión"})]}),n.jsxs("p",{className:k.switch,children:["¿No tenés cuenta?",n.jsx("button",{type:"button",onClick:h,children:"Registrate"})]}),n.jsx("button",{type:"button",className:k.forgotPassword,onClick:l,children:"Olvidé mi contraseña"})]})}function T1({email:e,setEmail:t,loading:a,error:o,onSubmit:r,onBack:s}){return n.jsxs("form",{onSubmit:r,className:k.form,"data-error":o?"true":"false",children:[n.jsx("p",{className:k.message,children:"Ingrese su dirección de correo electrónico. Le enviaremos un mensaje con un código para restablecer la contraseña."}),n.jsxs("div",{className:k.field,children:[n.jsx("label",{className:k.label,children:"Email"}),n.jsx("input",{type:"email",value:e,name:"email",onChange:i=>t(i.target.value),className:k.input,placeholder:""})]}),o&&n.jsx("p",{className:k.error,children:o}),n.jsx("button",{type:"submit",className:k.primary,disabled:a,children:a?n.jsx(Je,{}):"Enviar código"}),n.jsx("p",{className:k.switch,children:n.jsx("button",{type:"button",onClick:s,children:"Volver"})})]})}function I1({email:e,confirmationCode:t,newPassword:a,confirmNewPassword:o,showPassword:r,loading:s,error:i,setConfirmationCode:c,setNewPassword:d,setConfirmNewPassword:l,setShowPassword:h,onSubmit:u,onBack:f}){return n.jsxs("form",{onSubmit:u,className:k.form,"data-error":i?"true":"false",children:[n.jsxs("p",{className:k.message,children:["Hemos enviado un código de restablecimiento de contraseña en un mensaje de Correo electrónico a ",Fd(e),". Ingrese el código y la contraseña nueva."]}),n.jsxs("ul",{className:k.formUl,children:[n.jsxs("div",{className:k.field,children:[n.jsx("label",{className:k.label,children:"Código de verificación"}),n.jsx("input",{type:"text",value:t,onChange:y=>c(y.target.value),className:k.input,placeholder:""})]}),n.jsxs("div",{className:k.field,children:[n.jsx("label",{className:k.label,children:"Nueva contraseña"}),n.jsx("input",{type:r?"text":"password",value:a,onChange:y=>d(y.target.value),className:k.input,placeholder:"",name:"password"}),n.jsx("div",{className:k.passwordChecker,children:qn.map((y,m)=>{const g=y.test(a);return n.jsxs("div",{className:g?k.valid:k.invalid,children:[n.jsx("div",{children:g?"✔":"○"}),n.jsx("div",{children:y.label})]},m)})})]}),n.jsxs("div",{className:k.field,children:[n.jsx("label",{className:k.label,children:"Confirmar contraseña"}),n.jsx("input",{type:r?"text":"password",value:o,onChange:y=>l(y.target.value),className:k.input,placeholder:""}),n.jsxs("div",{className:k.checkboxRow,children:[n.jsx("input",{id:"showPasswordForgot",type:"checkbox",checked:r,onChange:y=>h(y.target.checked)}),n.jsx("label",{htmlFor:"showPasswordForgot",className:k.checkboxLabel,children:"Mostrar contraseñas"})]})]})]}),i&&n.jsx("p",{className:k.error,children:i}),n.jsx("button",{type:"submit",className:k.primary,style:{maxWidth:s?"revert-layer":"fit-content"},disabled:s,children:s?n.jsx(Je,{}):"Cambiar contraseña"}),n.jsx("p",{className:k.switch,children:n.jsx("button",{type:"button",onClick:f,children:"Volver"})})]})}function k1({onBackToLogin:e}){return n.jsxs("div",{className:k.form,children:[n.jsx("p",{className:k.success,children:"La contraseña fue cambiada con éxito"}),n.jsx("button",{type:"button",className:k.primary,onClick:e,children:"Iniciar Sesión"})]})}function x1({loginUrl:e,onClose:t,checkAuth:a,icon:o}){const[r,s]=N.useState("login"),i=async()=>{{await fetch("/api/auth/debug-login",{method:"GET",credentials:"include"}),localStorage.setItem("cognito-login","success:"+Date.now()),t(),a();return}};return n.jsx("div",{className:k.overlay,role:"dialog","aria-modal":"true",id:"pop-overlay",onClick:c=>{const d=c.target;d&&d.id==="pop-overlay"&&t()},children:n.jsxs("div",{className:k.card,children:[n.jsxs("header",{className:k.header,children:[n.jsx("div",{className:k.logo,children:o?o():null}),n.jsx("button",{onClick:t,className:k.close,"aria-label":"Cerrar",children:n.jsx(At,{})})]}),r==="login"&&n.jsx(N1,{onClose:t,checkAuth:a,handleGoogleLogin:i,goToRegister:()=>s("register")}),r==="register"&&n.jsx(S1,{handleGoogleLogin:i,goToLogin:()=>s("login")})]})})}function U1({isAuthenticated:e,setIsAuthenticated:t,loginUrl:a,user:o,path:r,checkAuth:s,icon:i}){const[c,d]=N.useState(!1),l=async()=>{await fetch("/api/auth/logout",{method:"GET",credentials:"include"}),t(!1)},h=async u=>{u.preventDefault(),a&&d(!0)};return n.jsxs(n.Fragment,{children:[c&&n.jsx(x1,{loginUrl:a,icon:i,checkAuth:s,onClose:()=>{d(!1)}}),!e&&n.jsxs("div",{className:"auth-container",children:[n.jsx("p",{children:"Sumate a la comunidad para dejar tu comentario"}),n.jsx("a",{href:a,onClick:h,className:"login-button",children:"Iniciar Sesión"})]}),n.jsx(_1,{isAuthenticated:e,handleLogout:l,path:r,user:e?o:void 0})]})}function L1({isVisible:e,path:t,icon:a}){const[o,r]=N.useState(null),[s,i]=N.useState(null),{COGNITO_AUTH_PREFIX:c}=Z(),d=N.useCallback(async()=>{if(e){if(document.cookie.search(c+"IS_AUTH=true")===-1){r(!1),i(null),console.log("user not logged");return}try{const f=await(await fetch("/api/auth/user",{credentials:"include"})).json();r(f.isAuthenticated??!1),i(f.user??null)}catch(u){console.error("Error checking auth:",u),r(!1),i(null)}}},[e,c]);N.useEffect(()=>{d()},[d,e]),N.useEffect(()=>{if(!s||!e||typeof window>"u")return;const u=window;if(typeof u!="function"){console.warn("gtag no está disponible todavía");return}u.gtag("set",{user_id:s.username}),console.log("username setted successfully")},[s,e]);const l="/api/auth/login",h=n.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:310,position:"relative"},children:n.jsx(Je,{})});return o===null?h:e?n.jsx(U1,{icon:a,isAuthenticated:o,setIsAuthenticated:r,loginUrl:l,user:s??void 0,checkAuth:d,path:t}):h}const q1=({render:e,internalPath:t,section:a,currentNews:o,stylesConfig:r,icon:s,isVisibleDefault:i=!1})=>{const c=N.useRef(null),[d,l]=N.useState(i);N.useEffect(()=>{if(i||d)return;const u=new IntersectionObserver(([f])=>{f?.isIntersecting&&(l(!0),u.disconnect())},{rootMargin:"0px",threshold:.1});return c.current&&u.observe(c.current),()=>u.disconnect()},[]);const h={comment:n.jsx(L1,{path:t,icon:s,isVisible:d}),more:n.jsx(Pd,{section:a,currentNews:o,stylesConfig:r,isVisible:d})};return n.jsx("div",{ref:c,suppressHydrationWarning:!0,style:{...r?r["Modulo 1x3 Client"]?r["Modulo 1x3 Client"]:r["Modulo 1x3"]:{}},children:h[e]})};async function B1({publication:e,path:t,username:a,comment:o,id:r,recaptchaResponse:s,baseUrl:i,apiToken:c,securityToken:d}){if(console.log("Adding comment with data:",{publication:e,path:t,username:a,comment:o,id:r,recaptchaResponse:s}),!e||!t||!o||!a)return{type:"error",message:"Faltan campos obligatorios. Por favor, completa todos los campos.",status:400};if([e,t,o,a].some(y=>typeof y!="string"))return{type:"error",message:"Datos inválidos. Intenta de nuevo.",status:400};if(!a.trim())return{type:"error",message:"El nombre no puede estar vacío.",status:400};if(!o.trim())return{type:"error",message:"El comentario no puede estar vacío.",status:400};const l=await as(s);if(console.log("Verifying captcha token...",l),!l)return{type:"error",message:"Captcha inválido. Intenta nuevamente.",status:403};const h=`${i}/system/modules/com.tfsla.diario.base/templates/hit/5.0/1/newcomments/add`,u={publication:e,path:t.replace(/\|/gi,"/"),username:a??!1,text:o.trim()};r&&(u.id=r);const f=new URLSearchParams(u);try{const{data:y}=await oe.get(`${h}?${f.toString()}`,{headers:{"Content-Type":"application/json","x-security-token":d,"x-api-token":c,"User-Agent":"amplifyapp-comments-saas"}});return!y||y.error?(console.error("CMS error response:",y),{type:"error",message:"No se pudo guardar el comentario. Intenta nuevamente en unos minutos.",status:502}):(console.log("Comentario enviado con éxito",y),{type:"success",message:"Comentario enviado con éxito.",status:200})}catch(y){if(console.error("Error enviando comentario:",y),oe.isAxiosError(y)){const m=y.response?.status??500,g=y.response?.data;return m===400?{type:"error",message:g?.message||"Solicitud inválida. Verifica que los campos sean correctos.",status:400}:m===403?{type:"error",message:"Captcha inválido o acceso prohibido.",status:403}:m===500?{type:"error",message:"Error interno del servidor del CMS.",status:500}:{type:"error",message:g?.message||"No se pudo enviar el comentario.",status:m}}return{type:"error",message:"Error inesperado. Intenta nuevamente.",status:500}}}const O1=async({token:e,projectId:t,captchaKey:a,apiKey:o,captchaAction:r})=>{if(!e)throw new Error("No token provided");if(!t||!a||!o)throw new Error("Missing project ID or site key");if(!r)throw new Error("No action provided");try{const i=await(await fetch(`https://recaptchaenterprise.googleapis.com/v1/projects/${t}/assessments?key=${o}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({event:{token:e,siteKey:a,expectedAction:r}})})).json();if(!i?.tokenProperties?.valid)throw new Error(`The token was: ${i?.tokenProperties?.invalidReason}`);if(i.tokenProperties.action!==r)throw new Error("The action attribute in your reCAPTCHA tag does not match the action you are expecting to score");return i?.riskAnalysis?.score??0}catch(s){throw console.error("Recaptcha verification failed",s),new Error(String(s))}};b.AssetsPreconnect=no,b.AutorComponent=Id,b.AutorHeader1=Cr,b.AutorHeader2=_r,b.BannerAdvertising=fe,b.BannerAdvertisingMiddle=je,b.CarrouselCSR=Qc,b.CarrouselIRS=rt,b.CarruselCard=$r,b.CarruselOpinion=Hr,b.CommonServices=Se,b.Comscore=Da,b.ContactInfoServer=Dl,b.ContactInput=pl,b.ContactSelect=Al,b.ContactTextarea=yl,b.ContentLayout1=mt,b.ContentLayoutTema=aa,b.DEBUG_MainSlots=bd,b.DestacadoNoticias=qr,b.DestacadoVideos=jr,b.DynamicBlockServices=nr,b.DynamicComponents=wd,b.DynamicMainSlot=En,b.DynamicSlot=ya,b.EditorialBlock=Ul,b.ErrorComponent=gl,b.Font=mo,b.Footer=il,b.FormatAfterScripts=to,b.FormatScripts=Mn,b.GA4=Ma,b.GTM=ja,b.GalleryHeader=pa,b.GenerateBody=Oc,b.GenerateHead=Bc,b.Header=El,b.ImageOffline=dr,b.IssuuServices=xc,b.ItemListSchema=io,b.JournalistArticule2=Ir,b.JournalistGroup=kr,b.LayoutNewsComponent=ra,b.LazyLoader=q1,b.LiveBlogHeader=br,b.Location=Mc,b.MainComponentServices=si,b.Marfeel=Qa,b.MiddleSection=Ze,b.Modulo1x3=ha,b.Modulo1x3Card=Gr,b.Modulo1x4=Dr,b.Modulo1x5=Mr,b.Modulo2Columnas=Ll,b.Modulo3Columnas=Or,b.ModuloNewsletter=ql,b.ModuloOpinion=xl,b.NewListResponseDataPH=ts,b.NewsArticle=lo,b.NewsComponent=Cd,b.NewsContent=An,b.NextPrev=Ot,b.OrgList=ho,b.PreloadImages=Qn,b.REPORT_REASONS=Me,b.Readest=un,b.ScriptHydrator=qd,b.SearchSection=Td,b.Section=he,b.SectionCard=Pe,b.SectionCard2=Dt,b.SectionCardServerComponent=_n,b.SectionServerComponent=Pl,b.ShowSection=rr,b.SocialNetworks=Vr,b.SpeculationRules=so,b.StaticSlotWrapper=yd,b.SubscribeColumn=mr,b.SubscribeRow=gr,b.SubscribeWhatsAppColumn=Rc,b.TagComponent=Nd,b.TagSection=Tr,b.TimeLine=vr,b.TrimPathname=Xs,b.VideoBlock3=ml,b.VideoBlock4=bl,b.VideoSection=Ld,b.VideosSchemas=fo,b.WebsiteList=uo,b.addComment=B1,b.bannersReplace=Xt,b.becomeVideoObject=dt,b.buildTagUrl=Gn,b.coloringByStrokeSVGs=pr,b.compileStyleProps=Nn,b.cutString=xe,b.extractRealtedNews=Js,b.formatDate=ke,b.formatDateEdiciones=Ks,b.formatDateJournalistArticule=Pn,b.formatDateTimeline=Wa,b.formatNewsMeta=Za,b.formatVideoData=ao,b.generalGetData=qc,b.getCaptchaToken=Oa,b.getComments=ys,b.getConfig=Z,b.getDynamicSlots=Uc,b.getEnvironmentUrl=Nt,b.getEnvironmentUrlFront=Ja,b.getHydratorPath=ni,b.getImageUrl=ue,b.getNextMeta=Et,b.getPage=It,b.getPreloadImages=ri,b.getPrevMeta=Tt,b.getReportReasonLabel=Gd,b.getResponse=Ya,b.getResponsePromise=Ka,b.getSchemas=Rt,b.getScriptReplaces=$n,b.getSlugs=po,b.getTypeOfNews=ei,b.getVideoRealPath=ti,b.handleGetComments=Ln,b.initLibrary=Us,b.metadataToJSX=eo,b.metadata_defaults=ar,b.parseTags=Dn,b.pathnameSplit=Xa,b.removePages=go,b.reportComment=Qd,b.shareButtons=Ar,b.socialIcons=mn,b.speculationRules=ro,b.speculationRulesHome=oo,b.urlReplaces=Ra,b.verifyCaptchaTokenEnterprise=O1,Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})}));
118
+ Valid keys: `+JSON.stringify(Object.keys(p),null," "));var q=se(V,W,O,H,z+"."+W,a);if(q)return q}return null}return A(C)}function Q(p){switch(typeof p){case"number":case"string":case"undefined":return!0;case"boolean":return!p;case"object":if(Array.isArray(p))return p.every(Q);if(p===null||c(p))return!0;var C=u(p);if(C){var L=C.call(p),G;if(C!==p.entries){for(;!(G=L.next()).done;)if(!Q(G.value))return!1}else for(;!(G=L.next()).done;){var O=G.value;if(O&&!Q(O[1]))return!1}}else return!1;return!0;default:return!1}}function U(p,C){return p==="symbol"?!0:C?C["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&C instanceof Symbol:!1}function T(p){var C=typeof p;return Array.isArray(p)?"array":p instanceof RegExp?"object":U(C,p)?"symbol":C}function j(p){if(typeof p>"u"||p===null)return""+p;var C=T(p);if(C==="object"){if(p instanceof Date)return"date";if(p instanceof RegExp)return"regexp"}return C}function x(p){var C=j(p);switch(C){case"array":case"object":return"an "+C;case"boolean":case"date":case"regexp":return"a "+C;default:return C}}function F(p){return!p.constructor||!p.constructor.name?f:p.constructor.name}return y.checkPropTypes=r,y.resetWarningCache=r.resetWarningCache,y.PropTypes=y,y},Ta}var Ia,ms;function Jd(){if(ms)return Ia;ms=1;var e=Sa();function t(){}function a(){}return a.resetWarningCache=t,Ia=function(){function o(i,c,d,l,h,u){if(u!==e){var f=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw f.name="Invariant Violation",f}}o.isRequired=o;function r(){return o}var s={array:o,bigint:o,bool:o,func:o,number:o,object:o,string:o,symbol:o,any:o,arrayOf:r,element:o,elementType:o,instanceOf:r,node:o,objectOf:r,oneOf:r,oneOfType:r,shape:r,exact:r,checkPropTypes:a,resetWarningCache:t};return s.PropTypes=s,s},Ia}var gs;function Zd(){if(gs)return In.exports;if(gs=1,process.env.NODE_ENV!=="production"){var e=va(),t=!0;In.exports=Kd()(e.isElement,t)}else In.exports=Jd()();return In.exports}var Xd=Zd();const ve=lt(Xd);var Rd=["sitekey","onChange","theme","type","tabindex","onExpired","onErrored","size","stoken","grecaptcha","badge","hl","isolated"];function ka(){return ka=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(e[o]=a[o])}return e},ka.apply(this,arguments)}function e1(e,t){if(e==null)return{};var a={},o=Object.keys(e),r,s;for(s=0;s<o.length;s++)r=o[s],!(t.indexOf(r)>=0)&&(a[r]=e[r]);return a}function xn(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function t1(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,xa(e,t)}function xa(e,t){return xa=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,r){return o.__proto__=r,o},xa(e,t)}var Un=(function(e){t1(t,e);function t(){var o;return o=e.call(this)||this,o.handleExpired=o.handleExpired.bind(xn(o)),o.handleErrored=o.handleErrored.bind(xn(o)),o.handleChange=o.handleChange.bind(xn(o)),o.handleRecaptchaRef=o.handleRecaptchaRef.bind(xn(o)),o}var a=t.prototype;return a.getCaptchaFunction=function(r){return this.props.grecaptcha?this.props.grecaptcha.enterprise?this.props.grecaptcha.enterprise[r]:this.props.grecaptcha[r]:null},a.getValue=function(){var r=this.getCaptchaFunction("getResponse");return r&&this._widgetId!==void 0?r(this._widgetId):null},a.getWidgetId=function(){return this.props.grecaptcha&&this._widgetId!==void 0?this._widgetId:null},a.execute=function(){var r=this.getCaptchaFunction("execute");if(r&&this._widgetId!==void 0)return r(this._widgetId);this._executeRequested=!0},a.executeAsync=function(){var r=this;return new Promise(function(s,i){r.executionResolve=s,r.executionReject=i,r.execute()})},a.reset=function(){var r=this.getCaptchaFunction("reset");r&&this._widgetId!==void 0&&r(this._widgetId)},a.forceReset=function(){var r=this.getCaptchaFunction("reset");r&&r()},a.handleExpired=function(){this.props.onExpired?this.props.onExpired():this.handleChange(null)},a.handleErrored=function(){this.props.onErrored&&this.props.onErrored(),this.executionReject&&(this.executionReject(),delete this.executionResolve,delete this.executionReject)},a.handleChange=function(r){this.props.onChange&&this.props.onChange(r),this.executionResolve&&(this.executionResolve(r),delete this.executionReject,delete this.executionResolve)},a.explicitRender=function(){var r=this.getCaptchaFunction("render");if(r&&this._widgetId===void 0){var s=document.createElement("div");this._widgetId=r(s,{sitekey:this.props.sitekey,callback:this.handleChange,theme:this.props.theme,type:this.props.type,tabindex:this.props.tabindex,"expired-callback":this.handleExpired,"error-callback":this.handleErrored,size:this.props.size,stoken:this.props.stoken,hl:this.props.hl,badge:this.props.badge,isolated:this.props.isolated}),this.captcha.appendChild(s)}this._executeRequested&&this.props.grecaptcha&&this._widgetId!==void 0&&(this._executeRequested=!1,this.execute())},a.componentDidMount=function(){this.explicitRender()},a.componentDidUpdate=function(){this.explicitRender()},a.handleRecaptchaRef=function(r){this.captcha=r},a.render=function(){var r=this.props;r.sitekey,r.onChange,r.theme,r.type,r.tabindex,r.onExpired,r.onErrored,r.size,r.stoken,r.grecaptcha,r.badge,r.hl,r.isolated;var s=e1(r,Rd);return Pa.createElement("div",ka({},s,{ref:this.handleRecaptchaRef}))},t})(Pa.Component);Un.displayName="ReCAPTCHA",Un.propTypes={sitekey:ve.string.isRequired,onChange:ve.func,grecaptcha:ve.object,theme:ve.oneOf(["dark","light"]),type:ve.oneOf(["image","audio"]),tabindex:ve.number,onExpired:ve.func,onErrored:ve.func,size:ve.oneOf(["compact","normal","invisible"]),stoken:ve.string,hl:ve.string,badge:ve.oneOf(["bottomright","bottomleft","inline"]),isolated:ve.bool},Un.defaultProps={onChange:function(){},theme:"light",type:"image",tabindex:0,size:"normal",badge:"bottomright"};var Ua,ps;function n1(){if(ps)return Ua;ps=1;var e=va(),t={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},a={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},o={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},r={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};s[e.ForwardRef]=o,s[e.Memo]=r;function i(m){return e.isMemo(m)?r:s[m.$$typeof]||t}var c=Object.defineProperty,d=Object.getOwnPropertyNames,l=Object.getOwnPropertySymbols,h=Object.getOwnPropertyDescriptor,u=Object.getPrototypeOf,f=Object.prototype;function y(m,g,A){if(typeof g!="string"){if(f){var _=u(g);_&&_!==f&&y(m,_,A)}var E=d(g);l&&(E=E.concat(l(g)));for(var S=i(m),I=i(g),w=0;w<E.length;++w){var P=E[w];if(!a[P]&&!(A&&A[P])&&!(I&&I[P])&&!(S&&S[P])){var B=h(g,P);try{c(m,P,B)}catch{}}}}return m}return Ua=y,Ua}var a1=n1();const o1=lt(a1);function La(){return La=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(e[o]=a[o])}return e},La.apply(this,arguments)}function r1(e,t){if(e==null)return{};var a={},o=Object.keys(e),r,s;for(s=0;s<o.length;s++)r=o[s],!(t.indexOf(r)>=0)&&(a[r]=e[r]);return a}function s1(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var Be={},i1=0;function c1(e,t){return t=t||{},function(o){var r=o.displayName||o.name||"Component",s=(function(c){s1(d,c);function d(h,u){var f;return f=c.call(this,h,u)||this,f.state={},f.__scriptURL="",f}var l=d.prototype;return l.asyncScriptLoaderGetScriptLoaderID=function(){return this.__scriptLoaderID||(this.__scriptLoaderID="async-script-loader-"+i1++),this.__scriptLoaderID},l.setupScriptURL=function(){return this.__scriptURL=typeof e=="function"?e():e,this.__scriptURL},l.asyncScriptLoaderHandleLoad=function(u){var f=this;this.setState(u,function(){return f.props.asyncScriptOnLoad&&f.props.asyncScriptOnLoad(f.state)})},l.asyncScriptLoaderTriggerOnScriptLoaded=function(){var u=Be[this.__scriptURL];if(!u||!u.loaded)throw new Error("Script is not loaded.");for(var f in u.observers)u.observers[f](u);delete window[t.callbackName]},l.componentDidMount=function(){var u=this,f=this.setupScriptURL(),y=this.asyncScriptLoaderGetScriptLoaderID(),m=t,g=m.globalName,A=m.callbackName,_=m.scriptId;if(g&&typeof window[g]<"u"&&(Be[f]={loaded:!0,observers:{}}),Be[f]){var E=Be[f];if(E&&(E.loaded||E.errored)){this.asyncScriptLoaderHandleLoad(E);return}E.observers[y]=function(B){return u.asyncScriptLoaderHandleLoad(B)};return}var S={};S[y]=function(B){return u.asyncScriptLoaderHandleLoad(B)},Be[f]={loaded:!1,observers:S};var I=document.createElement("script");I.src=f,I.async=!0;for(var w in t.attributes)I.setAttribute(w,t.attributes[w]);_&&(I.id=_);var P=function(K){if(Be[f]){var ee=Be[f],$=ee.observers;for(var M in $)K($[M])&&delete $[M]}};A&&typeof window<"u"&&(window[A]=function(){return u.asyncScriptLoaderTriggerOnScriptLoaded()}),I.onload=function(){var B=Be[f];B&&(B.loaded=!0,P(function(K){return A?!1:(K(B),!0)}))},I.onerror=function(){var B=Be[f];B&&(B.errored=!0,P(function(K){return K(B),!0}))},document.body.appendChild(I)},l.componentWillUnmount=function(){var u=this.__scriptURL;if(t.removeOnUnmount===!0)for(var f=document.getElementsByTagName("script"),y=0;y<f.length;y+=1)f[y].src.indexOf(u)>-1&&f[y].parentNode&&f[y].parentNode.removeChild(f[y]);var m=Be[u];m&&(delete m.observers[this.asyncScriptLoaderGetScriptLoaderID()],t.removeOnUnmount===!0&&delete Be[u])},l.render=function(){var u=t.globalName,f=this.props;f.asyncScriptOnLoad;var y=f.forwardedRef,m=r1(f,["asyncScriptOnLoad","forwardedRef"]);return u&&typeof window<"u"&&(m[u]=typeof window[u]<"u"?window[u]:void 0),m.ref=y,N.createElement(o,m)},d})(N.Component),i=N.forwardRef(function(c,d){return N.createElement(s,La({},c,{forwardedRef:d}))});return i.displayName="AsyncScriptLoader("+r+")",i.propTypes={asyncScriptOnLoad:ve.func},o1(i,o)}}var qa="onloadcallback",l1="grecaptcha";function Ba(){return typeof window<"u"&&window.recaptchaOptions||{}}function d1(){var e=Ba(),t=e.useRecaptchaNet?"recaptcha.net":"www.google.com";return e.enterprise?"https://"+t+"/recaptcha/enterprise.js?onload="+qa+"&render=explicit":"https://"+t+"/recaptcha/api.js?onload="+qa+"&render=explicit"}const As=c1(d1,{callbackName:qa,globalName:l1,attributes:Ba().nonce?{nonce:Ba().nonce}:{}})(Un),k={overlay:"_overlay_1je20_1",header:"_header_1je20_35",logo:"_logo_1je20_49",card:"_card_1je20_63",close:"_close_1je20_93",form:"_form_1je20_141",formUl:"_formUl_1je20_159",field:"_field_1je20_183",label:"_label_1je20_197",input:"_input_1je20_215",error:"_error_1je20_251",primary:"_primary_1je20_263",divider:"_divider_1je20_333",google:"_google_1je20_385",googleIcon:"_googleIcon_1je20_445",spin:"_spin_1je20_511",checkboxRow:"_checkboxRow_1je20_555",switch:"_switch_1je20_613",terms:"_terms_1je20_629",message:"_message_1je20_691",passwordChecker:"_passwordChecker_1je20_701",valid:"_valid_1je20_739",invalid:"_invalid_1je20_747",forgotPassword:"_forgotPassword_1je20_755",successContainer:"_successContainer_1je20_793",thumbsUp:"_thumbsUp_1je20_809",successMessage:"_successMessage_1je20_821"},Je=()=>n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",width:"24",height:"24",viewBox:"0 0 32 32",className:k.spin,children:n.jsx("path",{d:"M18,4.181v2.021c4.559,0.929,8,4.97,8,9.798c0,5.514-4.486,10-10,10S6,21.514,6,16c0-4.829,3.441-8.869,8-9.798V4.181 C8.334,5.137,4,10.066,4,16c0,6.617,5.383,12,12,12s12-5.383,12-12C28,10.066,23.666,5.137,18,4.181z"})}),h1=({isOpen:e,onClose:t,commentId:a,publication:o,username:r})=>{const[s,i]=N.useState("form"),[c,d]=N.useState(""),[l,h]=N.useState(""),[u,f]=N.useState(""),y=[{id:"spam",label:Me.spam},{id:"inappropriate",label:Me.inappropriate},{id:"hate",label:Me.hate},{id:"misinformation",label:Me.misinformation},{id:"terrorism",label:Me.terrorism},{id:"intellectual",label:Me.intellectual},{id:"bullying",label:Me.bullying}],m=async()=>{if(!(!c||!a)){if(os(document).includes(a)){h("Ya has reportado este comentario.");return}i("loading"),h("");try{const _=await(await fetch("/api/comments-report",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({publication:o,username:r,id:a,captchaToken:u,type:Me[c]})})).json();if(_.type==="success")Hd(document,a),i("success"),setTimeout(()=>{g()},3e3);else throw new Error(_.message||"Error al reportar comentario")}catch(A){console.error("Error reporting comment:",A),h(A.message||"Error al reportar comentario"),i("form")}}},g=()=>{i("form"),d(""),h(""),t()};return!e||!a||!r?null:n.jsx("div",{className:de.overlay,children:n.jsxs("div",{className:de.popup,children:[n.jsx("button",{className:"close-reply-form",onClick:g,children:n.jsx(At,{})}),n.jsx("h2",{className:de.title,children:"Reportar Abuso"}),s==="loading"&&n.jsx("div",{className:de.loadingContainer,children:n.jsx(Je,{})}),s==="form"||s==="loading"?n.jsxs(n.Fragment,{children:[n.jsx("div",{className:de.optionsContainer,children:y.map(A=>n.jsxs("label",{className:de.option,children:[n.jsx("input",{type:"radio",name:"reportReason",value:A.id,checked:c===A.id,onChange:_=>d(_.target.value),className:de.radioInput}),n.jsx("span",{className:de.radioCustom}),n.jsx("span",{className:de.optionLabel,children:A.label})]},A.id))}),l&&n.jsx("div",{className:de.errorMessage,children:l}),n.jsx(As,{sitekey:"",theme:"light",size:"normal",onChange:A=>f(A??""),onExpired:()=>f("")}),n.jsxs("div",{className:de.buttons,children:[n.jsx("button",{onClick:g,className:de.cancelButton,children:"Cancelar"}),n.jsx("button",{onClick:m,disabled:!c,className:de.reportButton,children:"Reportar"})]})]}):n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:de.successContainer,children:[n.jsx("div",{className:de.thumbsUp,children:n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:132,height:120,fill:"none",children:n.jsx("path",{fill:"#0073BE",d:"M119.249 42.357H81.915l5.621-27.039.177-1.893a8.906 8.906 0 0 0-2.603-6.272L78.838.941 39.907 39.93c-2.19 2.13-3.491 5.089-3.491 8.343v59.167c0 6.508 5.325 11.833 11.833 11.833h53.25c4.911 0 9.112-2.958 10.887-7.218l17.868-41.713c.533-1.36.829-2.78.829-4.32V54.192c0-6.509-5.325-11.834-11.834-11.834Zm0 23.667-17.75 41.417h-53.25V48.274l25.679-25.678L67.36 54.19h51.889v11.833ZM.916 48.274h23.667v71H.916v-71Z"})})}),n.jsx("p",{className:de.successMessage,children:"¡Gracias por reportar!"})]}),n.jsx("div",{className:de.buttons,children:n.jsx("button",{onClick:g,className:[de.closeButton,de.buttonAlone].join(" "),children:"Cerrar"})})]})]})})};async function Ln({publication:e,path:t,size:a=5,sizereply:o=2,id:r,lastid:s,state:i="5,6",apiToken:c}){const{PUBLIC_ENV:d}=Z();if(d==="prod")return(await ys({publication:e,path:t,size:a,sizereply:o,id:r,lastid:s,state:i,apiToken:c}))[0];{const l=await fetch(`/api/comments-get?publication=${e}&path=${t}&size=${a}&sizereply=${o}&lastid=${s}`);if(!l.ok)throw new Error(`Error al obtener comentarios: ${l.status}`);return(await l.json()).data[0]}}async function ys({publication:e,path:t,size:a=5,sizereply:o=2,id:r,lastid:s,state:i="5,6",apiToken:c}){if(!e||!t)throw new Error("Missing required parameters: publication and path");if(typeof e!="string"||typeof t!="string")throw new Error("Invalid input types for publication or path");if(!c)throw new Error("Missing CMS API token");const{PUBLIC_ENV:d,PUBLIC_API_HOST:l,PUBLIC_API_PATH:h,PUBLIC_API_PATH_VERSION:u}=Z(),f=parseInt(String(a),10),y=parseInt(String(o),10);if(isNaN(f)||f<=0)throw new Error("Invalid size parameter");if(isNaN(y)||y<0)throw new Error("Invalid sizereply parameter");const m=d!=="prod"?`${l}${h}`:Ja(),g=new URLSearchParams({publication:e,path:t,size:f.toString(),sizereply:y.toString(),state:i});r&&g.append("id",r),s&&g.append("lastid",s);const A=`${m}${u}/newcomments/get?${g.toString()}`;try{console.log("Fetching comments from:",A);const{data:_}=await oe.get(A,{headers:{"x-api-token":c,"Cache-Control":"max-age=0, no-cache, no-store, must-revalidate",Pragma:"no-cache",Expires:"0"}});if(!_)throw new Error("No comments data received");return _.data||_||[]}catch(_){if(console.error("Error fetching comments:",_),oe.isAxiosError(_)){const E=_.response?.status,S=_.response?.data;throw E===404?new Error("Comments not found"):E===403?new Error("Access forbidden - check API token"):E===401?new Error("Unauthorized - invalid API token"):E===500?new Error("Internal server error from CMS"):new Error(S?.error||S?.message||`HTTP ${E}: Failed to fetch comments`)}throw _}}const{PUBLIC_PUBLICATION_ID:u1}=Z(),f1=u1,m1=e=>{const[t,a]=N.useState(void 0);return N.useEffect(()=>{if(t)return;(async()=>{const{PUBLIC_X_SECURITY_TOKEN:r}=Z();try{const s=await Ln({publication:f1,path:e??"",size:5,sizereply:2,id:void 0,lastid:void 0,state:"5,6",apiToken:r});a(s??[])}catch(s){console.error(s),a({comments:[],morecomment:!1})}})()},[t]),{comments:t,setComments:a}},ws=({username:e,date:t})=>n.jsxs("div",{className:"comment-header",children:[n.jsx("span",{className:"comment-username",children:e}),n.jsx("span",{className:"comment-header-dot",children:"•"}),n.jsx("span",{className:"comment-date",children:$d(ke(Number(t)))})]}),bs=({user:e})=>n.jsx("div",{className:"comment-avatar",children:e.picture?n.jsx("img",{className:"comment-avatar-img",src:e.picture,alt:e.username}):e.firstname.charAt(0).toUpperCase()}),vs=({isReply:e=!1,onReply:t,onFlag:a})=>n.jsxs("div",{className:"comment-actions",children:[!e&&t&&n.jsx("button",{onClick:t,className:"comment-action-btn",children:n.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",children:[n.jsx("g",{clipPath:"url(#a)",children:n.jsx("path",{fill:"#4D4E4E",d:"M9.976 9V5l-6.983 7 6.983 7v-4.1c4.988 0 8.48 1.6 10.973 5.1-.997-5-3.99-10-10.973-11Z"})}),n.jsx("defs",{children:n.jsx("clipPath",{id:"a",children:n.jsx("path",{fill:"#fff",d:"M0 0h23.942v24H0z"})})})]})}),n.jsx("button",{onClick:a,className:"comment-action-btn",children:n.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:25,height:24,fill:"none",children:[n.jsx("g",{clipPath:"url(#a)",children:n.jsx("path",{fill:"#4D4E4E",d:"M20.133 2h-16c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2Zm0 14H5.303l-1.17 1.17V4h16v12Zm-9-11h2v6h-2V5Zm0 8h2v2h-2v-2Z"})}),n.jsx("defs",{children:n.jsx("clipPath",{id:"a",children:n.jsx("path",{fill:"#fff",d:"M.133 0h24v24h-24z"})})})]})})]}),Cs=({commentRef:e,captchaToken:t="",setIsDisabled:a})=>(N.useEffect(()=>{const o=e.current;if(!o)return;const r=()=>{const i=o.value.length;o.parentElement&&(o.parentElement.dataset.text=`${i}/${ct}`),o.classList.toggle("over-limit",i>ct),a(!ba(e,t).boolean)};return o.addEventListener("input",r),r(),()=>o.removeEventListener("input",r)},[e,t,a]),n.jsxs("div",{children:[n.jsx("label",{className:"comment-input-label",children:"Comentario"}),n.jsx("textarea",{ref:e,name:"comment",placeholder:"Ingresa un comentario",rows:2})]})),_s=({commentRef:e,captchaToken:t="",setCaptchaToken:a,children:o})=>{const r=ba(e,t);return n.jsxs("div",{className:"form-actions",children:[n.jsx(As,{sitekey:"",theme:"light",size:"normal",onChange:s=>a(s??""),onExpired:()=>a("")}),n.jsxs("div",{className:"submit-zone",children:[o,!r.boolean&&n.jsx("p",{className:"submit-warning",children:r.text})]})]})},Ss=({onClick:e,isDisabled:t})=>{const[a,o]=N.useState(!1);return N.useEffect(()=>{let r=null;return a&&(r=setTimeout(()=>{o(!1)},2400)),()=>{r&&clearTimeout(r)}},[a]),a?n.jsx("div",{className:"success-gif-container",children:n.jsx("img",{className:"success-gif",src:"/Success.gif"})}):n.jsxs("button",{type:"button",onClick:async r=>{await e(r)&&o(!0)},id:"comment-button",className:`submit-btn ${t?"disabled":"active"}`,children:["Enviar Comentario",n.jsx("svg",{style:{minWidth:16},width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:n.jsx("path",{d:"M1.39258 8.99997H12.5626L7.68258 13.88C7.29258 14.27 7.29258 14.91 7.68258 15.3C8.07258 15.69 8.70258 15.69 9.09258 15.3L15.6826 8.70997C16.0726 8.31997 16.0726 7.68997 15.6826 7.29997L9.10258 0.699971C8.71258 0.309971 8.08258 0.309971 7.69258 0.699971C7.30258 1.08997 7.30258 1.71997 7.69258 2.10997L12.5626 6.99997H1.39258C0.842578 6.99997 0.392578 7.44997 0.392578 7.99997C0.392578 8.54997 0.842578 8.99997 1.39258 8.99997Z",fill:"currentColor"})})]})},{PUBLIC_PUBLICATION_ID:g1}=Z(),p1=g1,Ns=async({path:e,ref:t,captchaToken:a,button:o,user:r,id:s,addComment:i})=>{const c=t.current?.value||"";if(!ba(t,a).boolean||!r){const d=o.nextElementSibling;return d&&(d.style.display="block"),!1}try{const d=Date.now(),l=await fetch("/api/comments-add",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({publication:p1,path:e,id:s,username:r.username,comment:c,recaptchaResponse:a})});let h=null;try{h=await l.json()}catch(m){console.error("Error parsing JSON response:",m)}if(!l.ok)throw new Error(`Error al enviar comentario: ${h?.message} status: ${l.status}`);const u=Date.now(),f=Math.max(0,2400+Math.abs(u-d)),y={username:r.username,firstname:r.firstname,...r.lastname&&{lastname:r.lastname},...r.picture&&{picture:r.picture}};return i({id:u.toString(),text:c,user:y,date:{time:Date.now()},reply:[]}),t.current&&(t.current.value=""),f}catch(d){return console.error("Error enviando comentario:",d),alert(d.message||"Error al enviar el comentario."),!1}},A1=({replyingTo:e,commentRef:t,user:a,path:o,addReply:r,closeForm:s})=>{const[i,c]=N.useState(!0),[d,l]=N.useState(""),h=()=>{t.current?.parentElement&&(t.current.parentElement.dataset.text=`0/${ct}`),c(!0),s()};return n.jsxs("div",{className:"comment-form reply-form",children:[n.jsx("button",{className:"close-reply-form",onClick:h,children:n.jsx(At,{})}),n.jsx(Cs,{commentRef:t,captchaToken:d,setIsDisabled:c}),n.jsx(_s,{commentRef:t,captchaToken:d,setCaptchaToken:l,children:n.jsx(Ss,{onClick:async u=>{if(i)return;const f=await Ns({path:o,ref:t,captchaToken:d,button:u.currentTarget,user:a,id:e,addComment:r});return f&&typeof f=="number"?(setTimeout(()=>{h()},f),!0):!1},isDisabled:i})})]})},y1=({reply:e,replyingTo:t,user:a,onFlag:o})=>{const r=e.text;let s=`${Ke.firstname} ${Ke.lastname}`,i=Ke.username;return e.user&&(s=`${e.user.firstname} ${e.user.lastname}`,i=e.user.username),n.jsx("div",{className:"comment-item reply",children:n.jsxs("div",{className:"comment-header-container",children:[n.jsx(bs,{user:e.user?e.user:Ke}),n.jsxs("div",{style:{flex:1},children:[n.jsx(ws,{username:s,date:e.date.time}),n.jsxs("div",{className:"comment-reply-to",children:["Respondiendo a ",n.jsx("strong",{children:t})]}),n.jsx("p",{className:"comment-text",children:r}),a?.username.toLowerCase()!==i.toLowerCase()&&n.jsx(vs,{isReply:!0,onFlag:()=>o(e.id)})]})]})})},w1=({comment:e,replyingTo:t,path:a,user:o,handleReplyingTo:r,onFlag:s})=>{const i={morereply:e.morereply??!1,reply:e.reply?e.reply:[]},[c,d]=N.useState(i),[l,h]=N.useState(!1),u=process.env.PUBLIC_PUBLICATION_ID??"",f=e.text,y=N.useRef(null);let m=`${Ke.firstname} ${Ke.lastname}`,g=Ke.username;e.user&&(m=`${e.user.firstname} ${e.user.lastname}`,g=e.user.username);const A=_=>{d({morereply:c.morereply,reply:[_,...c.reply]})};return n.jsx("div",{className:"comment-item",children:n.jsxs("div",{className:"comment-header-container","data-hasreplies":c.reply.length>0?"true":"false",children:[n.jsx(bs,{user:e.user?e.user:Ke}),n.jsxs("div",{style:{flex:1},children:[n.jsx(ws,{username:m,date:e.date.time}),n.jsx("p",{className:"comment-text",children:f}),o?.username.toLowerCase()!==g.toLowerCase()&&n.jsx(vs,{onReply:()=>r(e.id),onFlag:()=>s(e.id)}),t===e.id&&o&&n.jsx(A1,{replyingTo:t,commentRef:y,addReply:A,user:o,path:a,closeForm:()=>r("")}),c.reply.length>0&&n.jsxs("div",{className:"comment-replies",children:[c.reply.map(_=>n.jsx(y1,{user:o,reply:_,replyingTo:m,onFlag:s},_.id)),l?n.jsx("div",{style:{marginLeft:"4rem",position:"relative"},children:n.jsx(Je,{})}):c.morereply&&n.jsx("button",{className:"comment-replies-button reply-button",onClick:async()=>{const _=c.reply[c.reply.length-1]?.id;h(!0);try{const S=await Ln({publication:u,path:a??"",size:2,sizereply:2,id:e.id,lastid:_,state:"5,6",apiToken:process.env.PUBLIC_X_SECURITY_TOKEN});h(!1),d({morereply:S.morecomment,reply:[...c.reply,...S.comments]})}catch(E){throw h(!1),new Error(`Error al obtener comentarios: ${E}`)}},children:"Más Respuestas"})]})]})]})})},b1=({commentRef:e,user:t,path:a,addComment:o})=>{const[r,s]=N.useState(!0),[i,c]=N.useState("");return n.jsxs("div",{className:"comment-form",children:[n.jsx(Cs,{commentRef:e,captchaToken:i,setIsDisabled:s}),n.jsx(_s,{commentRef:e,captchaToken:i,setCaptchaToken:c,children:n.jsx(Ss,{onClick:async d=>{if(r)return;const l=await Ns({path:a,ref:e,captchaToken:i,button:d.currentTarget,user:t,addComment:o});return l&&typeof l=="number"?(e.current?.parentElement&&(e.current.parentElement.dataset.text=`0/${ct}`),s(!0),setTimeout(()=>{e.current?.parentElement&&(e.current.parentElement.dataset.text=`0/${ct}`),s(!0)},l),!0):!1},isDisabled:r})})]})},{PUBLIC_PUBLICATION_ID:v1,PUBLIC_X_SECURITY_TOKEN:C1}=Z(),Es=v1??"",_1=({isAuthenticated:e,path:t,user:a,handleLogout:o})=>{const r=t.replaceAll("/","|"),[s,i]=N.useState(void 0),[c,d]=N.useState(""),{comments:l,setComments:h}=m1(r),[u,f]=N.useState(!1),y=N.useRef(null),m=w=>{d(c===w?"":w)},g=w=>{h(l?{...l,comments:[w,...l.comments??[]]}:void 0)},A=w=>{i(w)},_=async()=>{if(!l||!l.morecomment||l.comments.length===0)return;const w=l.comments[l.comments.length-1];if(!w)return;f(!0);const P=w.id;try{const B=await Ln({publication:Es,path:r??"",size:5,sizereply:2,id:void 0,lastid:P,state:"5,6",apiToken:C1});h({morecomment:B.morecomment??!1,comments:[...l.comments,...B.comments]}),f(!1)}catch(B){throw f(!1),new Error(`Error al obtener comentarios: ${B}`)}},E=l?.comments&&l.comments.length>0,S=E?"Comparte tu opinión de este artículo.":"Se el primero en compartir tu opinión de este artículo.",I=n.jsx("div",{style:{display:"flex",width:"100%",justifyContent:"center"},children:n.jsx(Je,{})});return n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"comments-container",children:n.jsx(he,{title:E||e?"COMENTARIOS":!1,children:n.jsxs(n.Fragment,{children:[e&&a&&n.jsxs("div",{className:"comments-header",children:[n.jsx(jd,{user:a,handleLogout:o,message:S}),n.jsx(b1,{commentRef:y,user:a,addComment:g,path:r})]}),l?l.comments&&l.comments.length>0?n.jsxs("div",{className:"comments-list","data-isauthenticated":`${e}`,children:[l.comments.map(w=>n.jsx(w1,{comment:w,replyingTo:c,handleReplyingTo:m,onFlag:A,user:a??Ke,path:r},w.id)),u&&I]}):null:I,l?.morecomment&&!u&&n.jsx("button",{className:"comment-replies-button",onClick:_,children:"Más"})]})})}),n.jsx(h1,{username:a?.username??void 0,publication:Es,commentId:s,isOpen:s!==void 0,onClose:()=>i(void 0)})]})},Oa=async(e,t)=>{if(!e)throw new Error("No action provided");if(!t)throw new Error("No site key provided");const a=window.grecaptcha;if(!a?.enterprise)throw new Error("grecaptcha not loaded");return new Promise((o,r)=>{a.enterprise.ready(async()=>{try{const s=await a.enterprise.execute(t,{action:e});if(!s)throw new Error("Captcha token no generado");o(s)}catch(s){r(s)}})})},Ts={email:{label:"Email",required:!0},given_name:{label:"Nombre",required:!0},family_name:{label:"Apellido",required:!0},password:{label:"Contraseña",required:!0},confirmPassword:{label:"Confirmar contraseña",required:!0}},qn=[{label:"La contraseña debe tener al menos 8 caracteres",test:e=>e.length>=8},{label:"Usa un número",test:e=>/\d/.test(e)},{label:"Usa una letra minúscula",test:e=>/[a-z]/.test(e)},{label:"Usa una letra mayúscula",test:e=>/[A-Z]/.test(e)},{label:"Usa un símbolo",test:e=>/[^A-Za-z0-9]/.test(e)}];function S1({goToLogin:e,handleGoogleLogin:t}){const[a,o]=N.useState({}),[r,s]=N.useState(!1),[i,c]=N.useState(!1),[d,l]=N.useState(null),[h,u]=N.useState("register"),f=(A,_)=>{o(E=>({...E,[A]:_}))},y=async A=>{A.preventDefault(),l(null),c(!0);try{const _=Object.keys(Ts).filter(B=>!["username","password","confirmPassword"].includes(B)).map(B=>({Name:B,Value:a[B]}));if(_.some(B=>{if(!B.Value||B.Value.trim()==="")return!0}))return c(!1),l("Complete todos los campos");if(a.password!==a.confirmPassword){l("Las contraseñas no coinciden");return}const E=a.password||"";if(qn.some(B=>!B.test(E))){l("La contraseña no es válida");return}const I=Math.floor(Date.now()/1e3);_.push({Name:"updated_at",Value:String(I)});const w=await Oa("comment_register","");if(!w)throw new Error("Captcha token no generado");const P=await fetch("/api/auth/create-user",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:a.email,password:a.password,userAttributes:_,token:w})});if(!P.ok){const B=await P.json().catch(()=>({}));if(B.code==="UsernameExistsException"){await fetch("/api/auth/resend-code",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:a.email})}),u("confirm");return}throw new Error(B?.error||"Error al crear usuario")}u("confirm")}catch(_){console.log(_),l(_?.message||_?.error||"Error inesperado")}finally{c(!1)}},m=async A=>{if(A.preventDefault(),!a.confirmationCode){l("Debes ingresar el código de verificación");return}l(null),c(!0);try{const _=await fetch("/api/auth/confirm-user",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:a.email,code:a.confirmationCode})});if(!_.ok){const E=await _.json().catch(()=>({}));throw new Error(E?.error||"Error al confirmar usuario")}u("success")}catch(_){l(_?.message||"Error inesperado")}finally{c(!1)}},g=a.password||"";return n.jsxs(n.Fragment,{children:[h==="register"&&n.jsxs(n.Fragment,{children:[n.jsxs("button",{onClick:t,className:k.google,children:[n.jsx("img",{src:"https://www.gstatic.com/firebasejs/ui/2.0.0/images/auth/google.svg",alt:"",className:k.googleIcon}),n.jsx("span",{children:"Continuar con Google"})]}),n.jsx("div",{className:k.divider,children:n.jsx("span",{children:"o"})}),n.jsxs("form",{onSubmit:y,className:k.form,"data-error":d?"true":"false",children:[n.jsx("ul",{className:k.formUl,children:Object.entries(Ts).map(([A,{label:_}])=>n.jsxs("div",{className:k.field,children:[n.jsx("label",{className:k.label,children:_}),n.jsx("input",{type:A.toLowerCase().includes("password")?r?"text":"password":A==="birthdate"?"date":A==="email"?"email":A==="phone_number"?"tel":"text",name:A,value:a[A]||"",onChange:E=>f(A,E.target.value),className:k.input,placeholder:""}),A==="password"&&n.jsx("div",{className:k.passwordChecker,children:qn.map((E,S)=>{const I=E.test(g);return n.jsxs("div",{className:I?k.valid:k.invalid,children:[n.jsx("div",{children:I?"✔":"○"}),n.jsx("div",{children:E.label})]},S)})}),A==="confirmPassword"&&n.jsxs("div",{className:k.checkboxRow,children:[n.jsx("input",{id:"showPasswordRegister",type:"checkbox",checked:r,onChange:E=>s(E.target.checked)}),n.jsx("label",{htmlFor:"showPasswordRegister",className:k.checkboxLabel,children:"Mostrar contraseñas"})]})]},A))}),d&&n.jsx("p",{className:k.error,children:d}),n.jsxs("p",{className:k.terms,children:["Al continuar, confirmo que he leído y aceptado los",n.jsx("a",{href:"/pages/politicas-de-privacidad.html",target:"_blank",children:"Términos y Condiciones"}),"de nuestra comunidad"]}),n.jsx("button",{type:"submit",className:k.primary,disabled:i,children:i?n.jsx(Je,{}):"Crear cuenta"})]})]}),h==="confirm"&&n.jsxs("form",{onSubmit:m,className:k.form,"data-error":d?"true":"false",children:[n.jsxs("div",{className:k.field,children:[n.jsx("label",{className:k.label,children:"Código de verificación"}),n.jsx("input",{type:"text",name:"confirmationCode",value:a.confirmationCode||"",onChange:A=>f("confirmationCode",A.target.value),className:k.input,required:!0})]}),d&&n.jsx("p",{className:k.error,children:d}),n.jsx("button",{type:"submit",className:k.primary,disabled:i,children:i?n.jsx(Je,{}):"Confirmar cuenta"}),n.jsxs("p",{className:k.switch,children:["¿Ya confirmaste antes?",n.jsx("button",{type:"button",onClick:e,children:"Iniciar sesión"})]})]}),h==="success"&&n.jsxs("form",{className:k.form,children:[n.jsxs("div",{className:k.successContainer,children:[n.jsx("div",{className:k.thumbsUp,children:n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:132,height:120,fill:"none",children:n.jsx("path",{fill:"#0073BE",d:"M119.249 42.357H81.915l5.621-27.039.177-1.893a8.906 8.906 0 0 0-2.603-6.272L78.838.941 39.907 39.93c-2.19 2.13-3.491 5.089-3.491 8.343v59.167c0 6.508 5.325 11.833 11.833 11.833h53.25c4.911 0 9.112-2.958 10.887-7.218l17.868-41.713c.533-1.36.829-2.78.829-4.32V54.192c0-6.509-5.325-11.834-11.834-11.834Zm0 23.667-17.75 41.417h-53.25V48.274l25.679-25.678L67.36 54.19h51.889v11.833ZM.916 48.274h23.667v71H.916v-71Z"})})}),n.jsxs("div",{className:k.successMessage,children:[n.jsx("p",{children:"Confirmación completa."}),n.jsx("p",{children:"Ya eres parte de la comunidad!"})]})]}),n.jsx("button",{onClick:e,className:k.primary,children:"Iniciar sesión"})]}),h==="register"&&n.jsxs("p",{className:k.switch,children:["¿Ya tenés cuenta?",n.jsx("button",{type:"button",onClick:e,children:"Iniciar sesión"})]})]})}function N1({onClose:e,checkAuth:t,goToRegister:a,handleGoogleLogin:o}){const[r,s]=N.useState("login"),[i,c]=N.useState(""),[d,l]=N.useState(""),[h,u]=N.useState(""),[f,y]=N.useState(""),[m,g]=N.useState(""),[A,_]=N.useState(!1),[E,S]=N.useState(!1),[I,w]=N.useState(null),{CAPTCHA_KEY:P}=Z(),B=async $=>{if(!E){$.preventDefault(),w(null),S(!0);try{const M=await Oa("comment_login",P||"");if(!M)throw new Error("Captcha token no generado");const R=await fetch("/api/auth/login-password",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({email:i,password:d,token:M})});if(!R.ok){const ie=await R.json().catch(()=>({}));throw new Error(ie?.error||"Ha ocurrido un error")}e(),await t()}catch(M){w(M?.message||"Error inesperado")}finally{S(!1)}}},K=async $=>{if(!E){$.preventDefault(),w(null),S(!0);try{const M=await fetch("/api/auth/forgot-password",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:i})});if(!M.ok){const R=await M.json().catch(()=>({}));throw new Error(R?.error||"Error al enviar código")}l(""),s("changePassword")}catch(M){w(M?.message||"Error inesperado")}finally{S(!1)}}},ee=async $=>{if(E)return;if($.preventDefault(),f!==m){w("Las contraseñas no coinciden");return}if(qn.some(R=>!R.test(f))){w("La contraseña no cumple con los requisitos");return}w(null),S(!0);try{const R=await fetch("/api/auth/confirm-forgot-password",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:i,code:h,newPassword:f})});if(!R.ok){const ie=await R.json().catch(()=>({}));throw new Error(ie?.error||"Error al cambiar contraseña")}s("feedback")}catch(R){w(R?.message||"Error inesperado")}finally{S(!1)}};return n.jsxs(n.Fragment,{children:[r==="login"&&n.jsx(E1,{email:i,password:d,showPassword:A,loading:E,error:I,setEmail:c,setPassword:l,setShowPassword:_,onSubmit:B,onForgot:()=>{w(null),s("forgot")},onRegister:a,handleGoogleLogin:o}),r==="forgot"&&n.jsx(T1,{email:i,setEmail:c,loading:E,error:I,onSubmit:K,onBack:()=>{w(null),s("login")}}),r==="changePassword"&&n.jsx(I1,{email:i,confirmationCode:h,newPassword:f,confirmNewPassword:m,showPassword:A,loading:E,error:I,setConfirmationCode:u,setNewPassword:y,setConfirmNewPassword:g,setShowPassword:_,onSubmit:ee,onBack:()=>{w(null),s("forgot")}}),r==="feedback"&&n.jsx(k1,{onBackToLogin:()=>{w(null),s("login")}})]})}function E1({email:e,password:t,showPassword:a,loading:o,error:r,setEmail:s,setPassword:i,setShowPassword:c,onSubmit:d,onForgot:l,onRegister:h,handleGoogleLogin:u}){return n.jsxs(n.Fragment,{children:[n.jsxs("button",{onClick:u,className:k.google,children:[n.jsx("img",{src:"https://www.gstatic.com/firebasejs/ui/2.0.0/images/auth/google.svg",alt:"",className:k.googleIcon}),n.jsx("span",{children:"Continuar con Google"})]}),n.jsx("div",{className:k.divider,children:n.jsx("span",{children:"o"})}),n.jsxs("form",{onSubmit:d,className:k.form,"data-error":r?"true":"false",children:[n.jsxs("div",{className:k.field,children:[n.jsx("label",{className:k.label,children:"Email"}),n.jsx("input",{type:"email",value:e,onChange:f=>s(f.target.value),className:k.input,placeholder:""})]}),n.jsxs("div",{className:k.field,children:[n.jsx("label",{className:k.label,children:"Contraseña"}),n.jsx("input",{type:a?"text":"password",value:t,onChange:f=>i(f.target.value),className:k.input,placeholder:""}),n.jsxs("div",{className:k.checkboxRow,children:[n.jsx("input",{id:"showPasswordLogin",type:"checkbox",checked:a,onChange:f=>c(f.target.checked)}),n.jsx("label",{htmlFor:"showPasswordLogin",className:k.checkboxLabel,children:"Mostrar contraseña"})]})]}),r&&n.jsx("p",{className:k.error,children:r}),n.jsx("button",{type:"submit",className:k.primary,disabled:o,children:o?n.jsx(Je,{}):"Iniciar Sesión"})]}),n.jsxs("p",{className:k.switch,children:["¿No tenés cuenta?",n.jsx("button",{type:"button",onClick:h,children:"Registrate"})]}),n.jsx("button",{type:"button",className:k.forgotPassword,onClick:l,children:"Olvidé mi contraseña"})]})}function T1({email:e,setEmail:t,loading:a,error:o,onSubmit:r,onBack:s}){return n.jsxs("form",{onSubmit:r,className:k.form,"data-error":o?"true":"false",children:[n.jsx("p",{className:k.message,children:"Ingrese su dirección de correo electrónico. Le enviaremos un mensaje con un código para restablecer la contraseña."}),n.jsxs("div",{className:k.field,children:[n.jsx("label",{className:k.label,children:"Email"}),n.jsx("input",{type:"email",value:e,name:"email",onChange:i=>t(i.target.value),className:k.input,placeholder:""})]}),o&&n.jsx("p",{className:k.error,children:o}),n.jsx("button",{type:"submit",className:k.primary,disabled:a,children:a?n.jsx(Je,{}):"Enviar código"}),n.jsx("p",{className:k.switch,children:n.jsx("button",{type:"button",onClick:s,children:"Volver"})})]})}function I1({email:e,confirmationCode:t,newPassword:a,confirmNewPassword:o,showPassword:r,loading:s,error:i,setConfirmationCode:c,setNewPassword:d,setConfirmNewPassword:l,setShowPassword:h,onSubmit:u,onBack:f}){return n.jsxs("form",{onSubmit:u,className:k.form,"data-error":i?"true":"false",children:[n.jsxs("p",{className:k.message,children:["Hemos enviado un código de restablecimiento de contraseña en un mensaje de Correo electrónico a ",Fd(e),". Ingrese el código y la contraseña nueva."]}),n.jsxs("ul",{className:k.formUl,children:[n.jsxs("div",{className:k.field,children:[n.jsx("label",{className:k.label,children:"Código de verificación"}),n.jsx("input",{type:"text",value:t,onChange:y=>c(y.target.value),className:k.input,placeholder:""})]}),n.jsxs("div",{className:k.field,children:[n.jsx("label",{className:k.label,children:"Nueva contraseña"}),n.jsx("input",{type:r?"text":"password",value:a,onChange:y=>d(y.target.value),className:k.input,placeholder:"",name:"password"}),n.jsx("div",{className:k.passwordChecker,children:qn.map((y,m)=>{const g=y.test(a);return n.jsxs("div",{className:g?k.valid:k.invalid,children:[n.jsx("div",{children:g?"✔":"○"}),n.jsx("div",{children:y.label})]},m)})})]}),n.jsxs("div",{className:k.field,children:[n.jsx("label",{className:k.label,children:"Confirmar contraseña"}),n.jsx("input",{type:r?"text":"password",value:o,onChange:y=>l(y.target.value),className:k.input,placeholder:""}),n.jsxs("div",{className:k.checkboxRow,children:[n.jsx("input",{id:"showPasswordForgot",type:"checkbox",checked:r,onChange:y=>h(y.target.checked)}),n.jsx("label",{htmlFor:"showPasswordForgot",className:k.checkboxLabel,children:"Mostrar contraseñas"})]})]})]}),i&&n.jsx("p",{className:k.error,children:i}),n.jsx("button",{type:"submit",className:k.primary,style:{maxWidth:s?"revert-layer":"fit-content"},disabled:s,children:s?n.jsx(Je,{}):"Cambiar contraseña"}),n.jsx("p",{className:k.switch,children:n.jsx("button",{type:"button",onClick:f,children:"Volver"})})]})}function k1({onBackToLogin:e}){return n.jsxs("div",{className:k.form,children:[n.jsx("p",{className:k.success,children:"La contraseña fue cambiada con éxito"}),n.jsx("button",{type:"button",className:k.primary,onClick:e,children:"Iniciar Sesión"})]})}function x1({loginUrl:e,onClose:t,checkAuth:a,icon:o}){const[r,s]=N.useState("login"),i=async()=>{{await fetch("/api/auth/debug-login",{method:"GET",credentials:"include"}),localStorage.setItem("cognito-login","success:"+Date.now()),t(),a();return}};return n.jsx("div",{className:k.overlay,role:"dialog","aria-modal":"true",id:"pop-overlay",onClick:c=>{const d=c.target;d&&d.id==="pop-overlay"&&t()},children:n.jsxs("div",{className:k.card,children:[n.jsxs("header",{className:k.header,children:[n.jsx("div",{className:k.logo,children:o?o():null}),n.jsx("button",{onClick:t,className:k.close,"aria-label":"Cerrar",children:n.jsx(At,{})})]}),r==="login"&&n.jsx(N1,{onClose:t,checkAuth:a,handleGoogleLogin:i,goToRegister:()=>s("register")}),r==="register"&&n.jsx(S1,{handleGoogleLogin:i,goToLogin:()=>s("login")})]})})}function U1({isAuthenticated:e,setIsAuthenticated:t,loginUrl:a,user:o,path:r,checkAuth:s,icon:i}){const[c,d]=N.useState(!1),l=async()=>{await fetch("/api/auth/logout",{method:"GET",credentials:"include"}),t(!1)},h=async u=>{u.preventDefault(),a&&d(!0)};return n.jsxs(n.Fragment,{children:[c&&n.jsx(x1,{loginUrl:a,icon:i,checkAuth:s,onClose:()=>{d(!1)}}),!e&&n.jsxs("div",{className:"auth-container",children:[n.jsx("p",{children:"Sumate a la comunidad para dejar tu comentario"}),n.jsx("a",{href:a,onClick:h,className:"login-button",children:"Iniciar Sesión"})]}),n.jsx(_1,{isAuthenticated:e,handleLogout:l,path:r,user:e?o:void 0})]})}function L1({isVisible:e,path:t,icon:a}){const[o,r]=N.useState(null),[s,i]=N.useState(null),{COGNITO_AUTH_PREFIX:c}=Z(),d=N.useCallback(async()=>{if(e){if(document.cookie.search(c+"IS_AUTH=true")===-1){r(!1),i(null),console.log("user not logged");return}try{const f=await(await fetch("/api/auth/user",{credentials:"include"})).json();r(f.isAuthenticated??!1),i(f.user??null)}catch(u){console.error("Error checking auth:",u),r(!1),i(null)}}},[e,c]);N.useEffect(()=>{d()},[d,e]),N.useEffect(()=>{if(!s||!e||typeof window>"u")return;const u=window;if(typeof u!="function"){console.warn("gtag no está disponible todavía");return}u.gtag("set",{user_id:s.username}),console.log("username setted successfully")},[s,e]);const l="/api/auth/login",h=n.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:310,position:"relative"},children:n.jsx(Je,{})});return o===null?h:e?n.jsx(U1,{icon:a,isAuthenticated:o,setIsAuthenticated:r,loginUrl:l,user:s??void 0,checkAuth:d,path:t}):h}const q1=({render:e,internalPath:t,section:a,currentNews:o,stylesConfig:r,icon:s,isVisibleDefault:i=!1})=>{const c=N.useRef(null),[d,l]=N.useState(i);N.useEffect(()=>{if(i||d)return;const u=new IntersectionObserver(([f])=>{f?.isIntersecting&&(l(!0),u.disconnect())},{rootMargin:"0px",threshold:.1});return c.current&&u.observe(c.current),()=>u.disconnect()},[]);const h={comment:n.jsx(L1,{path:t,icon:s,isVisible:d}),more:n.jsx(Pd,{section:a,currentNews:o,stylesConfig:r,isVisible:d})};return n.jsx("div",{ref:c,suppressHydrationWarning:!0,style:{...r?r["Modulo 1x3 Client"]?r["Modulo 1x3 Client"]:r["Modulo 1x3"]:{}},children:h[e]})};async function B1({publication:e,path:t,username:a,comment:o,id:r,recaptchaResponse:s,baseUrl:i,apiToken:c,securityToken:d}){if(console.log("Adding comment with data:",{publication:e,path:t,username:a,comment:o,id:r,recaptchaResponse:s}),!e||!t||!o||!a)return{type:"error",message:"Faltan campos obligatorios. Por favor, completa todos los campos.",status:400};if([e,t,o,a].some(y=>typeof y!="string"))return{type:"error",message:"Datos inválidos. Intenta de nuevo.",status:400};if(!a.trim())return{type:"error",message:"El nombre no puede estar vacío.",status:400};if(!o.trim())return{type:"error",message:"El comentario no puede estar vacío.",status:400};const l=await as(s);if(console.log("Verifying captcha token...",l),!l)return{type:"error",message:"Captcha inválido. Intenta nuevamente.",status:403};const h=`${i}/system/modules/com.tfsla.diario.base/templates/hit/5.0/1/newcomments/add`,u={publication:e,path:t.replace(/\|/gi,"/"),username:a??!1,text:o.trim()};r&&(u.id=r);const f=new URLSearchParams(u);try{const{data:y}=await oe.get(`${h}?${f.toString()}`,{headers:{"Content-Type":"application/json","x-security-token":d,"x-api-token":c,"User-Agent":"amplifyapp-comments-saas"}});return!y||y.error?(console.error("CMS error response:",y),{type:"error",message:"No se pudo guardar el comentario. Intenta nuevamente en unos minutos.",status:502}):(console.log("Comentario enviado con éxito",y),{type:"success",message:"Comentario enviado con éxito.",status:200})}catch(y){if(console.error("Error enviando comentario:",y),oe.isAxiosError(y)){const m=y.response?.status??500,g=y.response?.data;return m===400?{type:"error",message:g?.message||"Solicitud inválida. Verifica que los campos sean correctos.",status:400}:m===403?{type:"error",message:"Captcha inválido o acceso prohibido.",status:403}:m===500?{type:"error",message:"Error interno del servidor del CMS.",status:500}:{type:"error",message:g?.message||"No se pudo enviar el comentario.",status:m}}return{type:"error",message:"Error inesperado. Intenta nuevamente.",status:500}}}const O1=async({token:e,projectId:t,captchaKey:a,apiKey:o,captchaAction:r})=>{if(!e)throw new Error("No token provided");if(!t||!a||!o)throw new Error("Missing project ID or site key");if(!r)throw new Error("No action provided");try{const i=await(await fetch(`https://recaptchaenterprise.googleapis.com/v1/projects/${t}/assessments?key=${o}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({event:{token:e,siteKey:a,expectedAction:r}})})).json();if(!i?.tokenProperties?.valid)throw new Error(`The token was: ${i?.tokenProperties?.invalidReason}`);if(i.tokenProperties.action!==r)throw new Error("The action attribute in your reCAPTCHA tag does not match the action you are expecting to score");return i?.riskAnalysis?.score??0}catch(s){throw console.error("Recaptcha verification failed",s),new Error(String(s))}};b.AssetsPreconnect=no,b.AutorComponent=Id,b.AutorHeader1=Cr,b.AutorHeader2=_r,b.BannerAdvertising=fe,b.BannerAdvertisingMiddle=je,b.CarrouselCSR=Qc,b.CarrouselIRS=rt,b.CarruselCard=$r,b.CarruselOpinion=Hr,b.CommonServices=Se,b.Comscore=Da,b.ContactInfoServer=Dl,b.ContactInput=pl,b.ContactSelect=Al,b.ContactTextarea=yl,b.ContentLayout1=mt,b.ContentLayoutTema=aa,b.DEBUG_MainSlots=bd,b.DestacadoNoticias=qr,b.DestacadoVideos=jr,b.DynamicBlockServices=nr,b.DynamicComponents=wd,b.DynamicMainSlot=En,b.DynamicSlot=ya,b.EditorialBlock=Ul,b.ErrorComponent=gl,b.Font=mo,b.Footer=il,b.FormatAfterScripts=to,b.FormatScripts=Mn,b.GA4=Ma,b.GTM=ja,b.GalleryHeader=pa,b.GenerateBody=Oc,b.GenerateHead=Bc,b.Header=El,b.ImageOffline=dr,b.IssuuServices=xc,b.ItemListSchema=io,b.JournalistArticule2=Ir,b.JournalistGroup=kr,b.LayoutNewsComponent=ra,b.LazyLoader=q1,b.LiveBlogHeader=br,b.Location=Mc,b.MainComponentServices=si,b.Marfeel=Qa,b.MiddleSection=Ze,b.Modulo1x3=ha,b.Modulo1x3Card=Gr,b.Modulo1x4=Dr,b.Modulo1x5=Mr,b.Modulo2Columnas=Ll,b.Modulo3Columnas=Or,b.ModuloNewsletter=ql,b.ModuloOpinion=xl,b.NewListResponseDataPH=ts,b.NewsArticle=lo,b.NewsComponent=Cd,b.NewsContent=An,b.NextPrev=Ot,b.OrgList=ho,b.PreloadImages=Qn,b.REPORT_REASONS=Me,b.Readest=un,b.ScriptHydrator=qd,b.SearchSection=Td,b.Section=he,b.SectionCard=Pe,b.SectionCard2=Dt,b.SectionCardServerComponent=_n,b.SectionServerComponent=Pl,b.ShowSection=rr,b.SocialNetworks=Vr,b.SpeculationRules=so,b.StaticSlotWrapper=yd,b.SubscribeColumn=mr,b.SubscribeRow=gr,b.SubscribeWhatsAppColumn=Rc,b.TagComponent=Nd,b.TagSection=Tr,b.TimeLine=vr,b.TrimPathname=Xs,b.VideoBlock3=ml,b.VideoBlock4=bl,b.VideoSection=Ld,b.VideosSchemas=fo,b.WebsiteList=uo,b.addComment=B1,b.bannersReplace=Xt,b.becomeVideoObject=dt,b.buildTagUrl=Gn,b.coloringByStrokeSVGs=pr,b.compileStyleProps=Nn,b.cutString=xe,b.extractRealtedNews=Js,b.formatDate=ke,b.formatDateEdiciones=Ks,b.formatDateJournalistArticule=Pn,b.formatDateTimeline=Wa,b.formatNewsMeta=Za,b.formatVideoData=ao,b.generalGetData=qc,b.getCaptchaToken=Oa,b.getComments=ys,b.getConfig=Z,b.getDynamicSlots=Uc,b.getEnvironmentUrl=Nt,b.getEnvironmentUrlFront=Ja,b.getHydratorPath=ni,b.getImageUrl=ue,b.getNextMeta=Et,b.getPage=It,b.getPreloadImages=ri,b.getPrevMeta=Tt,b.getReportReasonLabel=Gd,b.getResponse=Ya,b.getResponsePromise=Ka,b.getSchemas=Rt,b.getScriptReplaces=$n,b.getSlugs=po,b.getTypeOfNews=ei,b.getVideoRealPath=ti,b.handleGetComments=Ln,b.initLibrary=Us,b.metadataToJSX=eo,b.metadata_defaults=ar,b.parseTags=Dn,b.pathnameSplit=Xa,b.removePages=go,b.reportComment=Qd,b.shareButtons=Ar,b.socialIcons=mn,b.speculationRules=ro,b.speculationRulesHome=oo,b.urlReplaces=Ra,b.verifyCaptchaTokenEnterprise=O1,Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sass-template-common",
3
- "version": "0.1.33",
3
+ "version": "0.1.34",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"