@bitux/review-layer-react 0.1.6 → 0.1.8

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 lr, { memo as Re, useState as F, useEffect as A, useCallback as j, useRef as me, useMemo as Ne, createContext as Mr, useContext as Wr } from "react";
2
- import { createPortal as sr } from "react-dom";
3
- var Ae = { exports: {} }, le = {};
1
+ import fr, { memo as ke, useState as W, useEffect as L, useCallback as D, useRef as ne, useMemo as Be, createContext as Hr, useContext as Gr } from "react";
2
+ import { createPortal as vr } from "react-dom";
3
+ var Me = { exports: {} }, ge = {};
4
4
  /**
5
5
  * @license React
6
6
  * react-jsx-runtime.production.min.js
@@ -10,21 +10,21 @@ var Ae = { exports: {} }, le = {};
10
10
  * This source code is licensed under the MIT license found in the
11
11
  * LICENSE file in the root directory of this source tree.
12
12
  */
13
- var rr;
14
- function Br() {
15
- if (rr) return le;
16
- rr = 1;
17
- var r = lr, t = Symbol.for("react.element"), o = Symbol.for("react.fragment"), i = Object.prototype.hasOwnProperty, a = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, s = { key: !0, ref: !0, __self: !0, __source: !0 };
18
- function p(g, d, w) {
19
- var h, y = {}, P = null, k = null;
20
- w !== void 0 && (P = "" + w), d.key !== void 0 && (P = "" + d.key), d.ref !== void 0 && (k = d.ref);
21
- for (h in d) i.call(d, h) && !s.hasOwnProperty(h) && (y[h] = d[h]);
22
- if (g && g.defaultProps) for (h in d = g.defaultProps, d) y[h] === void 0 && (y[h] = d[h]);
23
- return { $$typeof: t, type: g, key: P, ref: k, props: y, _owner: a.current };
13
+ var ir;
14
+ function Xr() {
15
+ if (ir) return ge;
16
+ ir = 1;
17
+ var r = fr, n = Symbol.for("react.element"), t = Symbol.for("react.fragment"), o = Object.prototype.hasOwnProperty, s = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, i = { key: !0, ref: !0, __self: !0, __source: !0 };
18
+ function u(d, f, g) {
19
+ var y, S = {}, m = null, A = null;
20
+ g !== void 0 && (m = "" + g), f.key !== void 0 && (m = "" + f.key), f.ref !== void 0 && (A = f.ref);
21
+ for (y in f) o.call(f, y) && !i.hasOwnProperty(y) && (S[y] = f[y]);
22
+ if (d && d.defaultProps) for (y in f = d.defaultProps, f) S[y] === void 0 && (S[y] = f[y]);
23
+ return { $$typeof: n, type: d, key: m, ref: A, props: S, _owner: s.current };
24
24
  }
25
- return le.Fragment = o, le.jsx = p, le.jsxs = p, le;
25
+ return ge.Fragment = t, ge.jsx = u, ge.jsxs = u, ge;
26
26
  }
27
- var se = {};
27
+ var he = {};
28
28
  /**
29
29
  * @license React
30
30
  * react-jsx-runtime.development.js
@@ -34,91 +34,91 @@ var se = {};
34
34
  * This source code is licensed under the MIT license found in the
35
35
  * LICENSE file in the root directory of this source tree.
36
36
  */
37
- var or;
38
- function Yr() {
39
- return or || (or = 1, process.env.NODE_ENV !== "production" && function() {
40
- var r = lr, t = Symbol.for("react.element"), o = Symbol.for("react.portal"), i = Symbol.for("react.fragment"), a = Symbol.for("react.strict_mode"), s = Symbol.for("react.profiler"), p = Symbol.for("react.provider"), g = Symbol.for("react.context"), d = Symbol.for("react.forward_ref"), w = Symbol.for("react.suspense"), h = Symbol.for("react.suspense_list"), y = Symbol.for("react.memo"), P = Symbol.for("react.lazy"), k = Symbol.for("react.offscreen"), V = Symbol.iterator, $ = "@@iterator";
41
- function z(e) {
37
+ var ar;
38
+ function qr() {
39
+ return ar || (ar = 1, process.env.NODE_ENV !== "production" && function() {
40
+ var r = fr, n = Symbol.for("react.element"), t = Symbol.for("react.portal"), o = Symbol.for("react.fragment"), s = Symbol.for("react.strict_mode"), i = Symbol.for("react.profiler"), u = Symbol.for("react.provider"), d = Symbol.for("react.context"), f = Symbol.for("react.forward_ref"), g = Symbol.for("react.suspense"), y = Symbol.for("react.suspense_list"), S = Symbol.for("react.memo"), m = Symbol.for("react.lazy"), A = Symbol.for("react.offscreen"), z = Symbol.iterator, M = "@@iterator";
41
+ function P(e) {
42
42
  if (e === null || typeof e != "object")
43
43
  return null;
44
- var n = V && e[V] || e[$];
45
- return typeof n == "function" ? n : null;
44
+ var a = z && e[z] || e[M];
45
+ return typeof a == "function" ? a : null;
46
46
  }
47
- var c = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
48
- function f(e) {
47
+ var $ = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
48
+ function v(e) {
49
49
  {
50
- for (var n = arguments.length, u = new Array(n > 1 ? n - 1 : 0), v = 1; v < n; v++)
51
- u[v - 1] = arguments[v];
52
- I("error", e, u);
50
+ for (var a = arguments.length, l = new Array(a > 1 ? a - 1 : 0), p = 1; p < a; p++)
51
+ l[p - 1] = arguments[p];
52
+ k("error", e, l);
53
53
  }
54
54
  }
55
- function I(e, n, u) {
55
+ function k(e, a, l) {
56
56
  {
57
- var v = c.ReactDebugCurrentFrame, E = v.getStackAddendum();
58
- E !== "" && (n += "%s", u = u.concat([E]));
59
- var S = u.map(function(x) {
60
- return String(x);
57
+ var p = $.ReactDebugCurrentFrame, C = p.getStackAddendum();
58
+ C !== "" && (a += "%s", l = l.concat([C]));
59
+ var T = l.map(function(_) {
60
+ return String(_);
61
61
  });
62
- S.unshift("Warning: " + n), Function.prototype.apply.call(console[e], console, S);
62
+ T.unshift("Warning: " + a), Function.prototype.apply.call(console[e], console, T);
63
63
  }
64
64
  }
65
- var N = !1, H = !1, re = !1, oe = !1, te = !1, X;
66
- X = Symbol.for("react.module.reference");
67
- function m(e) {
68
- return !!(typeof e == "string" || typeof e == "function" || e === i || e === s || te || e === a || e === w || e === h || oe || e === k || N || H || re || typeof e == "object" && e !== null && (e.$$typeof === P || e.$$typeof === y || e.$$typeof === p || e.$$typeof === g || e.$$typeof === d || // This needs to include all possible module reference object
65
+ var Y = !1, E = !1, R = !1, V = !1, q = !1, H;
66
+ H = Symbol.for("react.module.reference");
67
+ function Q(e) {
68
+ return !!(typeof e == "string" || typeof e == "function" || e === o || e === i || q || e === s || e === g || e === y || V || e === A || Y || E || R || typeof e == "object" && e !== null && (e.$$typeof === m || e.$$typeof === S || e.$$typeof === u || e.$$typeof === d || e.$$typeof === f || // This needs to include all possible module reference object
69
69
  // types supported by any Flight configuration anywhere since
70
70
  // we don't know which Flight build this will end up being used
71
71
  // with.
72
- e.$$typeof === X || e.getModuleId !== void 0));
72
+ e.$$typeof === H || e.getModuleId !== void 0));
73
73
  }
74
- function R(e, n, u) {
75
- var v = e.displayName;
76
- if (v)
77
- return v;
78
- var E = n.displayName || n.name || "";
79
- return E !== "" ? u + "(" + E + ")" : u;
74
+ function ie(e, a, l) {
75
+ var p = e.displayName;
76
+ if (p)
77
+ return p;
78
+ var C = a.displayName || a.name || "";
79
+ return C !== "" ? l + "(" + C + ")" : l;
80
80
  }
81
- function O(e) {
81
+ function h(e) {
82
82
  return e.displayName || "Context";
83
83
  }
84
- function T(e) {
84
+ function b(e) {
85
85
  if (e == null)
86
86
  return null;
87
- if (typeof e.tag == "number" && f("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
87
+ if (typeof e.tag == "number" && v("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
88
88
  return e.displayName || e.name || null;
89
89
  if (typeof e == "string")
90
90
  return e;
91
91
  switch (e) {
92
- case i:
93
- return "Fragment";
94
92
  case o:
93
+ return "Fragment";
94
+ case t:
95
95
  return "Portal";
96
- case s:
96
+ case i:
97
97
  return "Profiler";
98
- case a:
98
+ case s:
99
99
  return "StrictMode";
100
- case w:
100
+ case g:
101
101
  return "Suspense";
102
- case h:
102
+ case y:
103
103
  return "SuspenseList";
104
104
  }
105
105
  if (typeof e == "object")
106
106
  switch (e.$$typeof) {
107
- case g:
108
- var n = e;
109
- return O(n) + ".Consumer";
110
- case p:
111
- var u = e;
112
- return O(u._context) + ".Provider";
113
107
  case d:
114
- return R(e, e.render, "ForwardRef");
115
- case y:
116
- var v = e.displayName || null;
117
- return v !== null ? v : T(e.type) || "Memo";
118
- case P: {
119
- var E = e, S = E._payload, x = E._init;
108
+ var a = e;
109
+ return h(a) + ".Consumer";
110
+ case u:
111
+ var l = e;
112
+ return h(l._context) + ".Provider";
113
+ case f:
114
+ return ie(e, e.render, "ForwardRef");
115
+ case S:
116
+ var p = e.displayName || null;
117
+ return p !== null ? p : b(e.type) || "Memo";
118
+ case m: {
119
+ var C = e, T = C._payload, _ = C._init;
120
120
  try {
121
- return T(x(S));
121
+ return b(_(T));
122
122
  } catch {
123
123
  return null;
124
124
  }
@@ -126,18 +126,18 @@ function Yr() {
126
126
  }
127
127
  return null;
128
128
  }
129
- var G = Object.assign, Y = 0, J, de, fe, ne, ie, _, q;
130
- function ae() {
129
+ var O = Object.assign, I = 0, re, ae, se, fe, ve, w, ee;
130
+ function te() {
131
131
  }
132
- ae.__reactDisabledLog = !0;
133
- function ve() {
132
+ te.__reactDisabledLog = !0;
133
+ function K() {
134
134
  {
135
- if (Y === 0) {
136
- J = console.log, de = console.info, fe = console.warn, ne = console.error, ie = console.group, _ = console.groupCollapsed, q = console.groupEnd;
135
+ if (I === 0) {
136
+ re = console.log, ae = console.info, se = console.warn, fe = console.error, ve = console.group, w = console.groupCollapsed, ee = console.groupEnd;
137
137
  var e = {
138
138
  configurable: !0,
139
139
  enumerable: !0,
140
- value: ae,
140
+ value: te,
141
141
  writable: !0
142
142
  };
143
143
  Object.defineProperties(console, {
@@ -150,332 +150,332 @@ function Yr() {
150
150
  groupEnd: e
151
151
  });
152
152
  }
153
- Y++;
153
+ I++;
154
154
  }
155
155
  }
156
- function pe() {
156
+ function xe() {
157
157
  {
158
- if (Y--, Y === 0) {
158
+ if (I--, I === 0) {
159
159
  var e = {
160
160
  configurable: !0,
161
161
  enumerable: !0,
162
162
  writable: !0
163
163
  };
164
164
  Object.defineProperties(console, {
165
- log: G({}, e, {
166
- value: J
165
+ log: O({}, e, {
166
+ value: re
167
167
  }),
168
- info: G({}, e, {
169
- value: de
168
+ info: O({}, e, {
169
+ value: ae
170
170
  }),
171
- warn: G({}, e, {
172
- value: fe
171
+ warn: O({}, e, {
172
+ value: se
173
173
  }),
174
- error: G({}, e, {
175
- value: ne
174
+ error: O({}, e, {
175
+ value: fe
176
176
  }),
177
- group: G({}, e, {
178
- value: ie
177
+ group: O({}, e, {
178
+ value: ve
179
179
  }),
180
- groupCollapsed: G({}, e, {
181
- value: _
180
+ groupCollapsed: O({}, e, {
181
+ value: w
182
182
  }),
183
- groupEnd: G({}, e, {
184
- value: q
183
+ groupEnd: O({}, e, {
184
+ value: ee
185
185
  })
186
186
  });
187
187
  }
188
- Y < 0 && f("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
188
+ I < 0 && v("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
189
189
  }
190
190
  }
191
- var ke = c.ReactCurrentDispatcher, Ce;
192
- function ge(e, n, u) {
191
+ var Pe = $.ReactCurrentDispatcher, je;
192
+ function ye(e, a, l) {
193
193
  {
194
- if (Ce === void 0)
194
+ if (je === void 0)
195
195
  try {
196
196
  throw Error();
197
- } catch (E) {
198
- var v = E.stack.trim().match(/\n( *(at )?)/);
199
- Ce = v && v[1] || "";
197
+ } catch (C) {
198
+ var p = C.stack.trim().match(/\n( *(at )?)/);
199
+ je = p && p[1] || "";
200
200
  }
201
201
  return `
202
- ` + Ce + e;
202
+ ` + je + e;
203
203
  }
204
204
  }
205
- var Pe = !1, be;
205
+ var Ve = !1, me;
206
206
  {
207
- var br = typeof WeakMap == "function" ? WeakMap : Map;
208
- be = new br();
207
+ var wr = typeof WeakMap == "function" ? WeakMap : Map;
208
+ me = new wr();
209
209
  }
210
- function $e(e, n) {
211
- if (!e || Pe)
210
+ function Ue(e, a) {
211
+ if (!e || Ve)
212
212
  return "";
213
213
  {
214
- var u = be.get(e);
215
- if (u !== void 0)
216
- return u;
214
+ var l = me.get(e);
215
+ if (l !== void 0)
216
+ return l;
217
217
  }
218
- var v;
219
- Pe = !0;
220
- var E = Error.prepareStackTrace;
218
+ var p;
219
+ Ve = !0;
220
+ var C = Error.prepareStackTrace;
221
221
  Error.prepareStackTrace = void 0;
222
- var S;
223
- S = ke.current, ke.current = null, ve();
222
+ var T;
223
+ T = Pe.current, Pe.current = null, K();
224
224
  try {
225
- if (n) {
226
- var x = function() {
225
+ if (a) {
226
+ var _ = function() {
227
227
  throw Error();
228
228
  };
229
- if (Object.defineProperty(x.prototype, "props", {
229
+ if (Object.defineProperty(_.prototype, "props", {
230
230
  set: function() {
231
231
  throw Error();
232
232
  }
233
233
  }), typeof Reflect == "object" && Reflect.construct) {
234
234
  try {
235
- Reflect.construct(x, []);
236
- } catch (W) {
237
- v = W;
235
+ Reflect.construct(_, []);
236
+ } catch (G) {
237
+ p = G;
238
238
  }
239
- Reflect.construct(e, [], x);
239
+ Reflect.construct(e, [], _);
240
240
  } else {
241
241
  try {
242
- x.call();
243
- } catch (W) {
244
- v = W;
242
+ _.call();
243
+ } catch (G) {
244
+ p = G;
245
245
  }
246
- e.call(x.prototype);
246
+ e.call(_.prototype);
247
247
  }
248
248
  } else {
249
249
  try {
250
250
  throw Error();
251
- } catch (W) {
252
- v = W;
251
+ } catch (G) {
252
+ p = G;
253
253
  }
254
254
  e();
255
255
  }
256
- } catch (W) {
257
- if (W && v && typeof W.stack == "string") {
258
- for (var b = W.stack.split(`
259
- `), M = v.stack.split(`
260
- `), D = b.length - 1, L = M.length - 1; D >= 1 && L >= 0 && b[D] !== M[L]; )
261
- L--;
262
- for (; D >= 1 && L >= 0; D--, L--)
263
- if (b[D] !== M[L]) {
264
- if (D !== 1 || L !== 1)
256
+ } catch (G) {
257
+ if (G && p && typeof G.stack == "string") {
258
+ for (var x = G.stack.split(`
259
+ `), B = p.stack.split(`
260
+ `), F = x.length - 1, N = B.length - 1; F >= 1 && N >= 0 && x[F] !== B[N]; )
261
+ N--;
262
+ for (; F >= 1 && N >= 0; F--, N--)
263
+ if (x[F] !== B[N]) {
264
+ if (F !== 1 || N !== 1)
265
265
  do
266
- if (D--, L--, L < 0 || b[D] !== M[L]) {
267
- var U = `
268
- ` + b[D].replace(" at new ", " at ");
269
- return e.displayName && U.includes("<anonymous>") && (U = U.replace("<anonymous>", e.displayName)), typeof e == "function" && be.set(e, U), U;
266
+ if (F--, N--, N < 0 || x[F] !== B[N]) {
267
+ var J = `
268
+ ` + x[F].replace(" at new ", " at ");
269
+ return e.displayName && J.includes("<anonymous>") && (J = J.replace("<anonymous>", e.displayName)), typeof e == "function" && me.set(e, J), J;
270
270
  }
271
- while (D >= 1 && L >= 0);
271
+ while (F >= 1 && N >= 0);
272
272
  break;
273
273
  }
274
274
  }
275
275
  } finally {
276
- Pe = !1, ke.current = S, pe(), Error.prepareStackTrace = E;
276
+ Ve = !1, Pe.current = T, xe(), Error.prepareStackTrace = C;
277
277
  }
278
- var K = e ? e.displayName || e.name : "", Z = K ? ge(K) : "";
279
- return typeof e == "function" && be.set(e, Z), Z;
278
+ var ue = e ? e.displayName || e.name : "", oe = ue ? ye(ue) : "";
279
+ return typeof e == "function" && me.set(e, oe), oe;
280
280
  }
281
- function hr(e, n, u) {
282
- return $e(e, !1);
281
+ function _r(e, a, l) {
282
+ return Ue(e, !1);
283
283
  }
284
- function xr(e) {
285
- var n = e.prototype;
286
- return !!(n && n.isReactComponent);
284
+ function Er(e) {
285
+ var a = e.prototype;
286
+ return !!(a && a.isReactComponent);
287
287
  }
288
- function he(e, n, u) {
288
+ function we(e, a, l) {
289
289
  if (e == null)
290
290
  return "";
291
291
  if (typeof e == "function")
292
- return $e(e, xr(e));
292
+ return Ue(e, Er(e));
293
293
  if (typeof e == "string")
294
- return ge(e);
294
+ return ye(e);
295
295
  switch (e) {
296
- case w:
297
- return ge("Suspense");
298
- case h:
299
- return ge("SuspenseList");
296
+ case g:
297
+ return ye("Suspense");
298
+ case y:
299
+ return ye("SuspenseList");
300
300
  }
301
301
  if (typeof e == "object")
302
302
  switch (e.$$typeof) {
303
- case d:
304
- return hr(e.render);
305
- case y:
306
- return he(e.type, n, u);
307
- case P: {
308
- var v = e, E = v._payload, S = v._init;
303
+ case f:
304
+ return _r(e.render);
305
+ case S:
306
+ return we(e.type, a, l);
307
+ case m: {
308
+ var p = e, C = p._payload, T = p._init;
309
309
  try {
310
- return he(S(E), n, u);
310
+ return we(T(C), a, l);
311
311
  } catch {
312
312
  }
313
313
  }
314
314
  }
315
315
  return "";
316
316
  }
317
- var ue = Object.prototype.hasOwnProperty, Me = {}, We = c.ReactDebugCurrentFrame;
318
- function xe(e) {
317
+ var pe = Object.prototype.hasOwnProperty, Ye = {}, He = $.ReactDebugCurrentFrame;
318
+ function _e(e) {
319
319
  if (e) {
320
- var n = e._owner, u = he(e.type, e._source, n ? n.type : null);
321
- We.setExtraStackFrame(u);
320
+ var a = e._owner, l = we(e.type, e._source, a ? a.type : null);
321
+ He.setExtraStackFrame(l);
322
322
  } else
323
- We.setExtraStackFrame(null);
323
+ He.setExtraStackFrame(null);
324
324
  }
325
- function yr(e, n, u, v, E) {
325
+ function Rr(e, a, l, p, C) {
326
326
  {
327
- var S = Function.call.bind(ue);
328
- for (var x in e)
329
- if (S(e, x)) {
330
- var b = void 0;
327
+ var T = Function.call.bind(pe);
328
+ for (var _ in e)
329
+ if (T(e, _)) {
330
+ var x = void 0;
331
331
  try {
332
- if (typeof e[x] != "function") {
333
- var M = Error((v || "React class") + ": " + u + " type `" + x + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[x] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
334
- throw M.name = "Invariant Violation", M;
332
+ if (typeof e[_] != "function") {
333
+ var B = Error((p || "React class") + ": " + l + " type `" + _ + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[_] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
334
+ throw B.name = "Invariant Violation", B;
335
335
  }
336
- b = e[x](n, x, v, u, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
337
- } catch (D) {
338
- b = D;
336
+ x = e[_](a, _, p, l, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
337
+ } catch (F) {
338
+ x = F;
339
339
  }
340
- b && !(b instanceof Error) && (xe(E), f("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", v || "React class", u, x, typeof b), xe(null)), b instanceof Error && !(b.message in Me) && (Me[b.message] = !0, xe(E), f("Failed %s type: %s", u, b.message), xe(null));
340
+ x && !(x instanceof Error) && (_e(C), v("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", p || "React class", l, _, typeof x), _e(null)), x instanceof Error && !(x.message in Ye) && (Ye[x.message] = !0, _e(C), v("Failed %s type: %s", l, x.message), _e(null));
341
341
  }
342
342
  }
343
343
  }
344
- var mr = Array.isArray;
345
- function je(e) {
346
- return mr(e);
344
+ var Sr = Array.isArray;
345
+ function Ie(e) {
346
+ return Sr(e);
347
347
  }
348
- function wr(e) {
348
+ function Cr(e) {
349
349
  {
350
- var n = typeof Symbol == "function" && Symbol.toStringTag, u = n && e[Symbol.toStringTag] || e.constructor.name || "Object";
351
- return u;
350
+ var a = typeof Symbol == "function" && Symbol.toStringTag, l = a && e[Symbol.toStringTag] || e.constructor.name || "Object";
351
+ return l;
352
352
  }
353
353
  }
354
- function _r(e) {
354
+ function kr(e) {
355
355
  try {
356
- return Be(e), !1;
356
+ return Ge(e), !1;
357
357
  } catch {
358
358
  return !0;
359
359
  }
360
360
  }
361
- function Be(e) {
361
+ function Ge(e) {
362
362
  return "" + e;
363
363
  }
364
- function Ye(e) {
365
- if (_r(e))
366
- return f("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", wr(e)), Be(e);
364
+ function Xe(e) {
365
+ if (kr(e))
366
+ return v("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Cr(e)), Ge(e);
367
367
  }
368
- var Ue = c.ReactCurrentOwner, Er = {
368
+ var qe = $.ReactCurrentOwner, Tr = {
369
369
  key: !0,
370
370
  ref: !0,
371
371
  __self: !0,
372
372
  __source: !0
373
- }, Ge, He;
374
- function Rr(e) {
375
- if (ue.call(e, "ref")) {
376
- var n = Object.getOwnPropertyDescriptor(e, "ref").get;
377
- if (n && n.isReactWarning)
373
+ }, Je, Ze;
374
+ function Pr(e) {
375
+ if (pe.call(e, "ref")) {
376
+ var a = Object.getOwnPropertyDescriptor(e, "ref").get;
377
+ if (a && a.isReactWarning)
378
378
  return !1;
379
379
  }
380
380
  return e.ref !== void 0;
381
381
  }
382
- function Sr(e) {
383
- if (ue.call(e, "key")) {
384
- var n = Object.getOwnPropertyDescriptor(e, "key").get;
385
- if (n && n.isReactWarning)
382
+ function jr(e) {
383
+ if (pe.call(e, "key")) {
384
+ var a = Object.getOwnPropertyDescriptor(e, "key").get;
385
+ if (a && a.isReactWarning)
386
386
  return !1;
387
387
  }
388
388
  return e.key !== void 0;
389
389
  }
390
- function kr(e, n) {
391
- typeof e.ref == "string" && Ue.current;
390
+ function Vr(e, a) {
391
+ typeof e.ref == "string" && qe.current;
392
392
  }
393
- function Cr(e, n) {
393
+ function Ir(e, a) {
394
394
  {
395
- var u = function() {
396
- Ge || (Ge = !0, f("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", n));
395
+ var l = function() {
396
+ Je || (Je = !0, v("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", a));
397
397
  };
398
- u.isReactWarning = !0, Object.defineProperty(e, "key", {
399
- get: u,
398
+ l.isReactWarning = !0, Object.defineProperty(e, "key", {
399
+ get: l,
400
400
  configurable: !0
401
401
  });
402
402
  }
403
403
  }
404
- function Pr(e, n) {
404
+ function Dr(e, a) {
405
405
  {
406
- var u = function() {
407
- He || (He = !0, f("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", n));
406
+ var l = function() {
407
+ Ze || (Ze = !0, v("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", a));
408
408
  };
409
- u.isReactWarning = !0, Object.defineProperty(e, "ref", {
410
- get: u,
409
+ l.isReactWarning = !0, Object.defineProperty(e, "ref", {
410
+ get: l,
411
411
  configurable: !0
412
412
  });
413
413
  }
414
414
  }
415
- var jr = function(e, n, u, v, E, S, x) {
416
- var b = {
415
+ var Or = function(e, a, l, p, C, T, _) {
416
+ var x = {
417
417
  // This tag allows us to uniquely identify this as a React Element
418
- $$typeof: t,
418
+ $$typeof: n,
419
419
  // Built-in properties that belong on the element
420
420
  type: e,
421
- key: n,
422
- ref: u,
423
- props: x,
421
+ key: a,
422
+ ref: l,
423
+ props: _,
424
424
  // Record the component responsible for creating this element.
425
- _owner: S
425
+ _owner: T
426
426
  };
427
- return b._store = {}, Object.defineProperty(b._store, "validated", {
427
+ return x._store = {}, Object.defineProperty(x._store, "validated", {
428
428
  configurable: !1,
429
429
  enumerable: !1,
430
430
  writable: !0,
431
431
  value: !1
432
- }), Object.defineProperty(b, "_self", {
432
+ }), Object.defineProperty(x, "_self", {
433
433
  configurable: !1,
434
434
  enumerable: !1,
435
435
  writable: !1,
436
- value: v
437
- }), Object.defineProperty(b, "_source", {
436
+ value: p
437
+ }), Object.defineProperty(x, "_source", {
438
438
  configurable: !1,
439
439
  enumerable: !1,
440
440
  writable: !1,
441
- value: E
442
- }), Object.freeze && (Object.freeze(b.props), Object.freeze(b)), b;
441
+ value: C
442
+ }), Object.freeze && (Object.freeze(x.props), Object.freeze(x)), x;
443
443
  };
444
- function Vr(e, n, u, v, E) {
444
+ function Lr(e, a, l, p, C) {
445
445
  {
446
- var S, x = {}, b = null, M = null;
447
- u !== void 0 && (Ye(u), b = "" + u), Sr(n) && (Ye(n.key), b = "" + n.key), Rr(n) && (M = n.ref, kr(n, E));
448
- for (S in n)
449
- ue.call(n, S) && !Er.hasOwnProperty(S) && (x[S] = n[S]);
446
+ var T, _ = {}, x = null, B = null;
447
+ l !== void 0 && (Xe(l), x = "" + l), jr(a) && (Xe(a.key), x = "" + a.key), Pr(a) && (B = a.ref, Vr(a, C));
448
+ for (T in a)
449
+ pe.call(a, T) && !Tr.hasOwnProperty(T) && (_[T] = a[T]);
450
450
  if (e && e.defaultProps) {
451
- var D = e.defaultProps;
452
- for (S in D)
453
- x[S] === void 0 && (x[S] = D[S]);
451
+ var F = e.defaultProps;
452
+ for (T in F)
453
+ _[T] === void 0 && (_[T] = F[T]);
454
454
  }
455
- if (b || M) {
456
- var L = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
457
- b && Cr(x, L), M && Pr(x, L);
455
+ if (x || B) {
456
+ var N = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
457
+ x && Ir(_, N), B && Dr(_, N);
458
458
  }
459
- return jr(e, b, M, E, v, Ue.current, x);
459
+ return Or(e, x, B, C, p, qe.current, _);
460
460
  }
461
461
  }
462
- var Ve = c.ReactCurrentOwner, Xe = c.ReactDebugCurrentFrame;
463
- function Q(e) {
462
+ var De = $.ReactCurrentOwner, Qe = $.ReactDebugCurrentFrame;
463
+ function le(e) {
464
464
  if (e) {
465
- var n = e._owner, u = he(e.type, e._source, n ? n.type : null);
466
- Xe.setExtraStackFrame(u);
465
+ var a = e._owner, l = we(e.type, e._source, a ? a.type : null);
466
+ Qe.setExtraStackFrame(l);
467
467
  } else
468
- Xe.setExtraStackFrame(null);
468
+ Qe.setExtraStackFrame(null);
469
469
  }
470
- var Te;
471
- Te = !1;
472
- function De(e) {
473
- return typeof e == "object" && e !== null && e.$$typeof === t;
470
+ var Oe;
471
+ Oe = !1;
472
+ function Le(e) {
473
+ return typeof e == "object" && e !== null && e.$$typeof === n;
474
474
  }
475
- function Je() {
475
+ function Ke() {
476
476
  {
477
- if (Ve.current) {
478
- var e = T(Ve.current.type);
477
+ if (De.current) {
478
+ var e = b(De.current.type);
479
479
  if (e)
480
480
  return `
481
481
 
@@ -484,304 +484,411 @@ Check the render method of \`` + e + "`.";
484
484
  return "";
485
485
  }
486
486
  }
487
- function Tr(e) {
487
+ function Ar(e) {
488
488
  return "";
489
489
  }
490
- var qe = {};
491
- function Dr(e) {
490
+ var er = {};
491
+ function zr(e) {
492
492
  {
493
- var n = Je();
494
- if (!n) {
495
- var u = typeof e == "string" ? e : e.displayName || e.name;
496
- u && (n = `
493
+ var a = Ke();
494
+ if (!a) {
495
+ var l = typeof e == "string" ? e : e.displayName || e.name;
496
+ l && (a = `
497
497
 
498
- Check the top-level render call using <` + u + ">.");
498
+ Check the top-level render call using <` + l + ">.");
499
499
  }
500
- return n;
500
+ return a;
501
501
  }
502
502
  }
503
- function Ze(e, n) {
503
+ function rr(e, a) {
504
504
  {
505
505
  if (!e._store || e._store.validated || e.key != null)
506
506
  return;
507
507
  e._store.validated = !0;
508
- var u = Dr(n);
509
- if (qe[u])
508
+ var l = zr(a);
509
+ if (er[l])
510
510
  return;
511
- qe[u] = !0;
512
- var v = "";
513
- e && e._owner && e._owner !== Ve.current && (v = " It was passed a child from " + T(e._owner.type) + "."), Q(e), f('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', u, v), Q(null);
511
+ er[l] = !0;
512
+ var p = "";
513
+ e && e._owner && e._owner !== De.current && (p = " It was passed a child from " + b(e._owner.type) + "."), le(e), v('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', l, p), le(null);
514
514
  }
515
515
  }
516
- function Qe(e, n) {
516
+ function tr(e, a) {
517
517
  {
518
518
  if (typeof e != "object")
519
519
  return;
520
- if (je(e))
521
- for (var u = 0; u < e.length; u++) {
522
- var v = e[u];
523
- De(v) && Ze(v, n);
520
+ if (Ie(e))
521
+ for (var l = 0; l < e.length; l++) {
522
+ var p = e[l];
523
+ Le(p) && rr(p, a);
524
524
  }
525
- else if (De(e))
525
+ else if (Le(e))
526
526
  e._store && (e._store.validated = !0);
527
527
  else if (e) {
528
- var E = z(e);
529
- if (typeof E == "function" && E !== e.entries)
530
- for (var S = E.call(e), x; !(x = S.next()).done; )
531
- De(x.value) && Ze(x.value, n);
528
+ var C = P(e);
529
+ if (typeof C == "function" && C !== e.entries)
530
+ for (var T = C.call(e), _; !(_ = T.next()).done; )
531
+ Le(_.value) && rr(_.value, a);
532
532
  }
533
533
  }
534
534
  }
535
- function Ir(e) {
535
+ function Fr(e) {
536
536
  {
537
- var n = e.type;
538
- if (n == null || typeof n == "string")
537
+ var a = e.type;
538
+ if (a == null || typeof a == "string")
539
539
  return;
540
- var u;
541
- if (typeof n == "function")
542
- u = n.propTypes;
543
- else if (typeof n == "object" && (n.$$typeof === d || // Note: Memo only checks outer props here.
540
+ var l;
541
+ if (typeof a == "function")
542
+ l = a.propTypes;
543
+ else if (typeof a == "object" && (a.$$typeof === f || // Note: Memo only checks outer props here.
544
544
  // Inner props are checked in the reconciler.
545
- n.$$typeof === y))
546
- u = n.propTypes;
545
+ a.$$typeof === S))
546
+ l = a.propTypes;
547
547
  else
548
548
  return;
549
- if (u) {
550
- var v = T(n);
551
- yr(u, e.props, "prop", v, e);
552
- } else if (n.PropTypes !== void 0 && !Te) {
553
- Te = !0;
554
- var E = T(n);
555
- f("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", E || "Unknown");
549
+ if (l) {
550
+ var p = b(a);
551
+ Rr(l, e.props, "prop", p, e);
552
+ } else if (a.PropTypes !== void 0 && !Oe) {
553
+ Oe = !0;
554
+ var C = b(a);
555
+ v("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", C || "Unknown");
556
556
  }
557
- typeof n.getDefaultProps == "function" && !n.getDefaultProps.isReactClassApproved && f("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
557
+ typeof a.getDefaultProps == "function" && !a.getDefaultProps.isReactClassApproved && v("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
558
558
  }
559
559
  }
560
- function Or(e) {
560
+ function Nr(e) {
561
561
  {
562
- for (var n = Object.keys(e.props), u = 0; u < n.length; u++) {
563
- var v = n[u];
564
- if (v !== "children" && v !== "key") {
565
- Q(e), f("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", v), Q(null);
562
+ for (var a = Object.keys(e.props), l = 0; l < a.length; l++) {
563
+ var p = a[l];
564
+ if (p !== "children" && p !== "key") {
565
+ le(e), v("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", p), le(null);
566
566
  break;
567
567
  }
568
568
  }
569
- e.ref !== null && (Q(e), f("Invalid attribute `ref` supplied to `React.Fragment`."), Q(null));
569
+ e.ref !== null && (le(e), v("Invalid attribute `ref` supplied to `React.Fragment`."), le(null));
570
570
  }
571
571
  }
572
- var Ke = {};
573
- function er(e, n, u, v, E, S) {
572
+ var or = {};
573
+ function nr(e, a, l, p, C, T) {
574
574
  {
575
- var x = m(e);
576
- if (!x) {
577
- var b = "";
578
- (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (b += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
579
- var M = Tr();
580
- M ? b += M : b += Je();
581
- var D;
582
- e === null ? D = "null" : je(e) ? D = "array" : e !== void 0 && e.$$typeof === t ? (D = "<" + (T(e.type) || "Unknown") + " />", b = " Did you accidentally export a JSX literal instead of a component?") : D = typeof e, f("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", D, b);
575
+ var _ = Q(e);
576
+ if (!_) {
577
+ var x = "";
578
+ (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (x += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
579
+ var B = Ar();
580
+ B ? x += B : x += Ke();
581
+ var F;
582
+ e === null ? F = "null" : Ie(e) ? F = "array" : e !== void 0 && e.$$typeof === n ? (F = "<" + (b(e.type) || "Unknown") + " />", x = " Did you accidentally export a JSX literal instead of a component?") : F = typeof e, v("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", F, x);
583
583
  }
584
- var L = Vr(e, n, u, E, S);
585
- if (L == null)
586
- return L;
587
- if (x) {
588
- var U = n.children;
589
- if (U !== void 0)
590
- if (v)
591
- if (je(U)) {
592
- for (var K = 0; K < U.length; K++)
593
- Qe(U[K], e);
594
- Object.freeze && Object.freeze(U);
584
+ var N = Lr(e, a, l, C, T);
585
+ if (N == null)
586
+ return N;
587
+ if (_) {
588
+ var J = a.children;
589
+ if (J !== void 0)
590
+ if (p)
591
+ if (Ie(J)) {
592
+ for (var ue = 0; ue < J.length; ue++)
593
+ tr(J[ue], e);
594
+ Object.freeze && Object.freeze(J);
595
595
  } else
596
- f("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
596
+ v("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
597
597
  else
598
- Qe(U, e);
598
+ tr(J, e);
599
599
  }
600
- if (ue.call(n, "key")) {
601
- var Z = T(e), W = Object.keys(n).filter(function($r) {
602
- return $r !== "key";
603
- }), Ie = W.length > 0 ? "{key: someKey, " + W.join(": ..., ") + ": ...}" : "{key: someKey}";
604
- if (!Ke[Z + Ie]) {
605
- var Nr = W.length > 0 ? "{" + W.join(": ..., ") + ": ...}" : "{}";
606
- f(`A props object containing a "key" prop is being spread into JSX:
600
+ if (pe.call(a, "key")) {
601
+ var oe = b(e), G = Object.keys(a).filter(function(Yr) {
602
+ return Yr !== "key";
603
+ }), Ae = G.length > 0 ? "{key: someKey, " + G.join(": ..., ") + ": ...}" : "{key: someKey}";
604
+ if (!or[oe + Ae]) {
605
+ var Ur = G.length > 0 ? "{" + G.join(": ..., ") + ": ...}" : "{}";
606
+ v(`A props object containing a "key" prop is being spread into JSX:
607
607
  let props = %s;
608
608
  <%s {...props} />
609
609
  React keys must be passed directly to JSX without using spread:
610
610
  let props = %s;
611
- <%s key={someKey} {...props} />`, Ie, Z, Nr, Z), Ke[Z + Ie] = !0;
611
+ <%s key={someKey} {...props} />`, Ae, oe, Ur, oe), or[oe + Ae] = !0;
612
612
  }
613
613
  }
614
- return e === i ? Or(L) : Ir(L), L;
614
+ return e === o ? Nr(N) : Fr(N), N;
615
615
  }
616
616
  }
617
- function Lr(e, n, u) {
618
- return er(e, n, u, !0);
617
+ function $r(e, a, l) {
618
+ return nr(e, a, l, !0);
619
619
  }
620
- function zr(e, n, u) {
621
- return er(e, n, u, !1);
620
+ function Mr(e, a, l) {
621
+ return nr(e, a, l, !1);
622
622
  }
623
- var Ar = zr, Fr = Lr;
624
- se.Fragment = i, se.jsx = Ar, se.jsxs = Fr;
625
- }()), se;
623
+ var Wr = Mr, Br = $r;
624
+ he.Fragment = o, he.jsx = Wr, he.jsxs = Br;
625
+ }()), he;
626
626
  }
627
- process.env.NODE_ENV === "production" ? Ae.exports = Br() : Ae.exports = Yr();
628
- var l = Ae.exports;
629
- function Ur(r) {
627
+ process.env.NODE_ENV === "production" ? Me.exports = Xr() : Me.exports = qr();
628
+ var c = Me.exports;
629
+ function Jr(r) {
630
630
  if (r.id && /^[a-zA-Z][\w-]*$/.test(r.id))
631
631
  return `#${r.id}`;
632
- const t = [];
633
- let o = r;
634
- for (; o && o.nodeType === Node.ELEMENT_NODE; ) {
635
- let i = o.nodeName.toLowerCase();
636
- if (o.id && /^[a-zA-Z][\w-]*$/.test(o.id)) {
637
- t.unshift(`#${o.id}`);
632
+ const n = [];
633
+ let t = r;
634
+ for (; t && t.nodeType === Node.ELEMENT_NODE; ) {
635
+ let o = t.nodeName.toLowerCase();
636
+ if (t.id && /^[a-zA-Z][\w-]*$/.test(t.id)) {
637
+ n.unshift(`#${t.id}`);
638
638
  break;
639
639
  }
640
- if (o.className && typeof o.className == "string") {
641
- const a = o.className.trim().split(/\s+/).filter(Boolean);
642
- if (a.length > 0) {
643
- const s = a.filter((p) => /^[a-zA-Z][\w-]*$/.test(p)).slice(0, 2).map((p) => `.${p}`).join("");
644
- s && (i += s);
640
+ if (t.className && typeof t.className == "string") {
641
+ const s = t.className.trim().split(/\s+/).filter(Boolean);
642
+ if (s.length > 0) {
643
+ const i = s.filter((u) => /^[a-zA-Z][\w-]*$/.test(u)).slice(0, 2).map((u) => `.${u}`).join("");
644
+ i && (o += i);
645
645
  }
646
646
  }
647
- if (t.length > 0) {
648
- const a = o.parentElement;
649
- if (a) {
650
- const s = Array.from(a.children).filter(
651
- (p) => p.nodeName === o.nodeName
647
+ if (n.length > 0) {
648
+ const s = t.parentElement;
649
+ if (s) {
650
+ const i = Array.from(s.children).filter(
651
+ (u) => u.nodeName === t.nodeName
652
652
  );
653
- if (s.length > 1) {
654
- const p = s.indexOf(o) + 1;
655
- i += `:nth-child(${p})`;
653
+ if (i.length > 1) {
654
+ const u = i.indexOf(t) + 1;
655
+ o += `:nth-child(${u})`;
656
656
  }
657
657
  }
658
658
  }
659
- t.unshift(i), o = o.parentElement;
659
+ n.unshift(o), t = t.parentElement;
660
660
  }
661
- return t.join(" > ");
661
+ return n.join(" > ");
662
662
  }
663
- const Gr = "[data-review-layer-root]", Hr = 16;
664
- function Fe(r, t, o = Hr) {
665
- if (typeof window > "u") return { x: r, y: t };
666
- const i = o, a = o, s = window.innerWidth - o, p = window.innerHeight - o;
663
+ const Zr = "[data-review-layer-root]", Qr = 16;
664
+ function We(r, n, t = Qr) {
665
+ if (typeof window > "u") return { x: r, y: n };
666
+ const o = t, s = t, i = window.innerWidth - t, u = window.innerHeight - t;
667
667
  return {
668
- x: Math.max(i, Math.min(s, r)),
669
- y: Math.max(a, Math.min(p, t))
668
+ x: Math.max(o, Math.min(i, r)),
669
+ y: Math.max(s, Math.min(u, n))
670
670
  };
671
671
  }
672
- function cr(r) {
673
- var t;
672
+ function pr(r) {
673
+ if (typeof document > "u" || !r) return [];
674
+ const n = [];
675
+ let t = r.parentElement;
676
+ for (; t && t !== document.body; ) {
677
+ const o = getComputedStyle(t), s = o.overflowX, i = o.overflowY;
678
+ (s === "scroll" || s === "auto" || s === "overlay" || i === "scroll" || i === "auto" || i === "overlay") && (t.scrollHeight > t.clientHeight || t.scrollWidth > t.clientWidth) && n.push(t), t = t.parentElement;
679
+ }
680
+ return n;
681
+ }
682
+ function gr(r) {
683
+ var n;
674
684
  if (typeof document > "u" || !(r != null && r.trim())) return null;
675
685
  try {
676
- const o = document.querySelector(r);
677
- return !o || (t = o.closest) != null && t.call(o, Gr) ? null : o.getBoundingClientRect();
686
+ const t = document.querySelector(r);
687
+ return !t || (n = t.closest) != null && n.call(t, Zr) ? null : t.getBoundingClientRect();
678
688
  } catch {
679
689
  return null;
680
690
  }
681
691
  }
682
- function Xr(r) {
692
+ function Kr(r) {
683
693
  if (typeof window > "u")
684
694
  return { relativeX: 0, relativeY: 0 };
685
- const t = window.innerWidth, o = window.innerHeight;
695
+ const n = window.innerWidth, t = window.innerHeight;
686
696
  return {
687
- relativeX: t > 0 ? r.left / t : 0,
688
- relativeY: o > 0 ? r.top / o : 0
697
+ relativeX: n > 0 ? r.left / n : 0,
698
+ relativeY: t > 0 ? r.top / t : 0
689
699
  };
690
700
  }
691
- function dr(r) {
701
+ function hr(r) {
692
702
  if (typeof window > "u")
693
703
  return {
694
704
  x: r.x ?? 0,
695
705
  y: r.y ?? 0
696
706
  };
697
- const t = r.relativeX ?? r.relative_x ?? null, o = r.relativeY ?? r.relative_y ?? null;
698
- return t != null && o != null ? {
699
- x: t * window.innerWidth,
700
- y: o * window.innerHeight
707
+ const n = r.relativeX ?? r.relative_x ?? null, t = r.relativeY ?? r.relative_y ?? null;
708
+ return n != null && t != null ? {
709
+ x: n * window.innerWidth,
710
+ y: t * window.innerHeight
701
711
  } : {
702
712
  x: r.x ?? 0,
703
713
  y: r.y ?? 0
704
714
  };
705
715
  }
706
- function Jr(r) {
707
- const { x: t, y: o } = dr(r), i = r.width ?? 100, a = r.height ?? 40;
708
- return new DOMRect(t, o, i, a);
716
+ function et(r) {
717
+ const { x: n, y: t } = hr(r), o = r.width ?? 100, s = r.height ?? 40;
718
+ return new DOMRect(n, t, o, s);
709
719
  }
710
- function we(r) {
720
+ function Re(r) {
711
721
  if (r.selector) {
712
- const t = cr(r.selector);
713
- if (t != null)
714
- return { x: t.left, y: t.top };
722
+ const n = gr(r.selector);
723
+ if (n != null)
724
+ return { x: n.left, y: n.top };
725
+ }
726
+ return hr(r);
727
+ }
728
+ const rt = ["path"];
729
+ function tt(r) {
730
+ return r.trim().startsWith("/") ? r.trim() : `/${r.trim()}`;
731
+ }
732
+ function br() {
733
+ if (typeof window > "u") return "/";
734
+ try {
735
+ const r = new URLSearchParams(window.location.search);
736
+ for (const [, t] of r) {
737
+ const o = t == null ? void 0 : t.trim();
738
+ if (o !== "" && o.startsWith("/"))
739
+ return o;
740
+ }
741
+ for (const t of rt) {
742
+ const o = r.get(t);
743
+ if (o != null && o.trim() !== "")
744
+ return tt(o);
745
+ }
746
+ const n = window.location.pathname || "/";
747
+ if (n === "/iframe.html" || n.endsWith("/iframe.html")) {
748
+ const t = r.get("id");
749
+ if (t != null && t.trim() !== "")
750
+ return `/story/${t.trim()}`;
751
+ }
752
+ } catch {
715
753
  }
716
- return dr(r);
754
+ return window.location.pathname || "/";
717
755
  }
718
- const C = {
756
+ const j = {
719
757
  PENDING: "pending",
720
758
  DEV_FIXED: "dev_fixed",
721
759
  VALIDATED: "validated"
722
- };
723
- function ce(r) {
760
+ }, sr = "[review-layer API]";
761
+ function Z(r, n, t) {
762
+ if ("status" in t) {
763
+ const { status: d, statusText: f, body: g = "" } = t;
764
+ let y;
765
+ d === 401 ? y = "No autorizado (401). Revisa que apiKey sea correcta y esté aceptada por la API." : d === 403 ? y = "Acceso denegado (403). Revisa apiKey o permisos del proyecto." : d === 404 ? y = "Recurso no encontrado (404). Revisa apiUrl y que la ruta exista en el backend." : d >= 500 ? y = "Error del servidor (5xx). El backend puede estar caído o sobrecargado." : y = `Respuesta HTTP ${d} ${f}. Revisa la API.`, console.error(sr, r, {
766
+ motivo: y,
767
+ url: n,
768
+ status: d,
769
+ statusText: f,
770
+ body: g.slice(0, 300)
771
+ });
772
+ return;
773
+ }
774
+ const o = t.networkError, s = o instanceof Error ? o.message : String(o), u = o instanceof TypeError || /failed to fetch|networkerror|load failed|network request failed/i.test(s) ? "Posible CORS o error de red (servidor inalcanzable, bloqueo CORS o certificado). Revisa que apiUrl sea accesible desde este origen y que el backend permita CORS." : `Error inesperado: ${s}`;
775
+ console.error(sr, r, { motivo: u, url: n, error: o });
776
+ }
777
+ function be(r) {
724
778
  return {
725
779
  "Content-Type": "application/json",
726
780
  "x-review-key": r
727
781
  };
728
782
  }
729
- async function qr(r, t, o) {
730
- const i = await fetch(`${r}/reviewers`, {
731
- headers: ce(t),
732
- signal: o == null ? void 0 : o.signal
733
- });
734
- if (!i.ok) throw new Error("Failed to fetch reviewers");
735
- return (await i.json()).data ?? [];
736
- }
737
- async function Zr(r, t, o) {
738
- const i = await fetch(`${r}/comments`, {
739
- method: "POST",
740
- headers: ce(t),
741
- body: JSON.stringify(o)
742
- });
743
- if (!i.ok) {
744
- const s = await i.json().catch(() => ({}));
745
- throw new Error(s.message || "Failed to create comment");
783
+ async function ot(r, n, t) {
784
+ const o = `${r}/reviewers`;
785
+ let s;
786
+ try {
787
+ s = await fetch(o, {
788
+ headers: be(n),
789
+ signal: t == null ? void 0 : t.signal
790
+ });
791
+ } catch (u) {
792
+ throw Z("fetchReviewers (red/CORS)", o, { networkError: u }), u;
793
+ }
794
+ if (!s.ok) {
795
+ const u = await s.text();
796
+ throw Z("fetchReviewers", o, { status: s.status, statusText: s.statusText, body: u }), new Error("Failed to fetch reviewers");
746
797
  }
747
- return (await i.json()).data;
748
- }
749
- async function Qr(r, t, o, i) {
750
- const a = new URLSearchParams({ url: o }), s = await fetch(`${r}/comments?${a}`, {
751
- headers: ce(t),
752
- signal: i == null ? void 0 : i.signal
753
- });
754
- if (!s.ok) throw new Error("Failed to fetch comments");
755
798
  return (await s.json()).data ?? [];
756
799
  }
757
- async function Kr(r, t, o, i) {
758
- const a = await fetch(`${r}/comments/${o}/status`, {
759
- method: "PATCH",
760
- headers: ce(t),
761
- body: JSON.stringify({ status: i })
762
- });
763
- if (!a.ok) {
764
- const p = await a.json().catch(() => ({}));
765
- throw new Error(p.message || "Failed to update comment status");
800
+ async function nt(r, n, t) {
801
+ const o = `${r}/comments`;
802
+ let s;
803
+ try {
804
+ s = await fetch(o, {
805
+ method: "POST",
806
+ headers: be(n),
807
+ body: JSON.stringify(t)
808
+ });
809
+ } catch (u) {
810
+ throw Z("createComment (red/CORS)", o, { networkError: u }), u;
766
811
  }
767
- return (await a.json()).data;
812
+ if (!s.ok) {
813
+ const u = await s.text();
814
+ let d = "Failed to create comment";
815
+ try {
816
+ d = JSON.parse(u).message ?? d;
817
+ } catch {
818
+ }
819
+ throw Z("createComment", o, { status: s.status, statusText: s.statusText, body: u }), new Error(d);
820
+ }
821
+ return (await s.json()).data;
822
+ }
823
+ async function it(r, n, t, o) {
824
+ const s = new URLSearchParams({ url: t }), i = `${r}/comments?${s}`;
825
+ let u;
826
+ try {
827
+ u = await fetch(i, {
828
+ headers: be(n),
829
+ signal: o == null ? void 0 : o.signal
830
+ });
831
+ } catch (f) {
832
+ throw Z("fetchComments (red/CORS)", i, { networkError: f }), f;
833
+ }
834
+ if (!u.ok) {
835
+ const f = await u.text();
836
+ throw Z("fetchComments", i, { status: u.status, statusText: u.statusText, body: f }), new Error("Failed to fetch comments");
837
+ }
838
+ return (await u.json()).data ?? [];
768
839
  }
769
- async function eo(r, t, o) {
770
- const i = await fetch(`${r}/comments/${o}`, {
771
- method: "DELETE",
772
- headers: ce(t)
773
- });
840
+ async function at(r, n, t, o) {
841
+ const s = `${r}/comments/${t}/status`;
842
+ let i;
843
+ try {
844
+ i = await fetch(s, {
845
+ method: "PATCH",
846
+ headers: be(n),
847
+ body: JSON.stringify({ status: o })
848
+ });
849
+ } catch (d) {
850
+ throw Z("updateCommentStatus (red/CORS)", s, { networkError: d }), d;
851
+ }
774
852
  if (!i.ok) {
775
- const a = await i.json().catch(() => ({}));
776
- throw new Error(a.message || "Failed to delete comment");
853
+ const d = await i.text();
854
+ Z("updateCommentStatus", s, { status: i.status, statusText: i.statusText, body: d });
855
+ let f = "Failed to update comment status";
856
+ try {
857
+ f = JSON.parse(d).message ?? f;
858
+ } catch {
859
+ }
860
+ throw new Error(f);
861
+ }
862
+ return (await i.json()).data;
863
+ }
864
+ async function st(r, n, t) {
865
+ const o = `${r}/comments/${t}`;
866
+ let s;
867
+ try {
868
+ s = await fetch(o, {
869
+ method: "DELETE",
870
+ headers: be(n)
871
+ });
872
+ } catch (i) {
873
+ throw Z("deleteComment (red/CORS)", o, { networkError: i }), i;
874
+ }
875
+ if (!s.ok) {
876
+ const i = await s.text();
877
+ Z("deleteComment", o, { status: s.status, statusText: s.statusText, body: i });
878
+ let u = "Failed to delete comment";
879
+ try {
880
+ u = JSON.parse(i).message ?? u;
881
+ } catch {
882
+ }
883
+ throw new Error(u);
777
884
  }
778
885
  }
779
- const ro = {
886
+ const lt = {
780
887
  position: "fixed",
781
888
  inset: 0,
782
889
  zIndex: 999997,
783
890
  backgroundColor: "transparent"
784
- }, oo = {
891
+ }, ut = {
785
892
  position: "fixed",
786
893
  minWidth: 320,
787
894
  maxWidth: 400,
@@ -791,7 +898,7 @@ const ro = {
791
898
  borderRadius: "var(--ui-radius_8, 8px)",
792
899
  boxShadow: "0 8px 24px var(--ui-color-black-alpha-20, rgba(0,0,0,0.15))",
793
900
  zIndex: 999998
794
- }, to = {
901
+ }, ct = {
795
902
  width: "100%",
796
903
  minHeight: 80,
797
904
  padding: "var(--ui-positive-Value_200, 8px) var(--ui-positive-Value_300, 12px)",
@@ -802,14 +909,14 @@ const ro = {
802
909
  fontFamily: "var(--ui-font-family-ui, 'Inter', sans-serif)",
803
910
  resize: "vertical",
804
911
  boxSizing: "border-box"
805
- }, no = {
912
+ }, dt = {
806
913
  width: "100%",
807
914
  padding: "var(--ui-positive-Value_200, 8px) var(--ui-positive-Value_300, 12px)",
808
915
  marginBottom: "var(--ui-positive-Value_300, 12px)",
809
916
  border: "1px solid var(--ui-color-border-default, #d9d9d9)",
810
917
  borderRadius: "var(--ui-radius_6, 6px)",
811
918
  fontSize: "var(--ui-font-size-sm, 14px)"
812
- }, tr = {
919
+ }, lr = {
813
920
  padding: "var(--ui-positive-Value_200, 8px) var(--ui-positive-Value_400, 16px)",
814
921
  backgroundColor: "var(--ui-color-bg-fill-danger-default, #ff4d4f)",
815
922
  color: "var(--ui-color-text-on-color, #fff)",
@@ -819,132 +926,151 @@ const ro = {
819
926
  cursor: "pointer",
820
927
  fontWeight: "var(--ui-font-weight-medium, 500)"
821
928
  };
822
- function io({
929
+ function ft({
823
930
  apiUrl: r,
824
- apiKey: t,
825
- reviewers: o,
826
- position: i,
827
- payload: a,
828
- onClose: s,
829
- onSuccess: p
931
+ apiKey: n,
932
+ reviewers: t,
933
+ position: o,
934
+ payload: s,
935
+ onClose: i,
936
+ onSuccess: u
830
937
  }) {
831
- var z;
832
- const [g, d] = F(""), [w, h] = F(
833
- ((z = o[0]) == null ? void 0 : z.id) ?? 0
834
- ), [y, P] = F(!1), [k, V] = F(null);
835
- A(() => {
836
- o.length > 0 && !w && h(o[0].id);
837
- }, [o, w]);
838
- const $ = j(
839
- async (c) => {
840
- if (c.preventDefault(), !(!g.trim() || !w)) {
841
- P(!0), V(null);
938
+ var $;
939
+ const [d, f] = W(""), [g, y] = W(
940
+ (($ = t[0]) == null ? void 0 : $.id) ?? 0
941
+ ), [S, m] = W(!1), [A, z] = W(null);
942
+ L(() => {
943
+ t.length > 0 && !g && y(t[0].id);
944
+ }, [t, g]);
945
+ const M = D(
946
+ async (v) => {
947
+ if (v.preventDefault(), !(!d.trim() || !g)) {
948
+ m(!0), z(null);
842
949
  try {
843
- await Zr(r, t, {
844
- ...a,
845
- message: g.trim(),
846
- reviewerId: w
847
- }), p(), s();
848
- } catch (f) {
849
- V(f instanceof Error ? f.message : "Failed to send comment");
950
+ await nt(r, n, {
951
+ ...s,
952
+ message: d.trim(),
953
+ reviewerId: g
954
+ }), u(), i();
955
+ } catch (k) {
956
+ z(k instanceof Error ? k.message : "Failed to send comment");
850
957
  } finally {
851
- P(!1);
958
+ m(!1);
852
959
  }
853
960
  }
854
961
  },
855
- [r, t, a, g, w, p, s]
856
- );
857
- return A(() => {
858
- const c = (f) => {
859
- f.key === "Escape" && (f.preventDefault(), s());
962
+ [r, n, s, d, g, u, i]
963
+ ), P = ne(null);
964
+ return L(() => {
965
+ const v = (k) => {
966
+ k.key === "Escape" && (k.preventDefault(), i());
860
967
  };
861
- return document.addEventListener("keydown", c, !0), () => document.removeEventListener("keydown", c, !0);
862
- }, [s]), /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
863
- /* @__PURE__ */ l.jsx(
864
- "div",
865
- {
866
- role: "presentation",
867
- style: ro,
868
- onClick: s
869
- }
870
- ),
871
- /* @__PURE__ */ l.jsx(
872
- "div",
873
- {
874
- style: {
875
- ...oo,
876
- left: Math.min(i.x, typeof window < "u" ? window.innerWidth - 420 : i.x),
877
- top: i.y + 12
878
- },
879
- onClick: (c) => c.stopPropagation(),
880
- children: /* @__PURE__ */ l.jsxs("form", { onSubmit: $, children: [
881
- /* @__PURE__ */ l.jsx(
882
- "textarea",
883
- {
884
- placeholder: "Escribe tu comentario...",
885
- value: g,
886
- onChange: (c) => d(c.target.value),
887
- style: to,
888
- required: !0,
889
- autoFocus: !0
890
- }
891
- ),
892
- /* @__PURE__ */ l.jsxs(
893
- "select",
894
- {
895
- value: w,
896
- onChange: (c) => h(Number(c.target.value)),
897
- style: no,
898
- required: !0,
899
- disabled: o.length === 0,
900
- children: [
901
- /* @__PURE__ */ l.jsx("option", { value: "", children: o.length === 0 ? "No hay revisores (ejecuta php artisan db:seed en la API)" : "Selecciona revisor" }),
902
- o.map((c) => /* @__PURE__ */ l.jsx("option", { value: c.id, children: c.name }, c.id))
903
- ]
904
- }
905
- ),
906
- k && /* @__PURE__ */ l.jsx(
907
- "div",
908
- {
909
- style: {
910
- color: "var(--ui-color-text-danger-default, #ff4d4f)",
911
- fontSize: "var(--ui-font-size-xs, 12px)",
912
- marginBottom: "var(--ui-positive-Value_200, 8px)"
913
- },
914
- children: k
915
- }
916
- ),
917
- /* @__PURE__ */ l.jsxs("div", { style: { display: "flex", justifyContent: "flex-end", gap: "var(--ui-positive-Value_200, 8px)" }, children: [
918
- /* @__PURE__ */ l.jsx(
919
- "button",
920
- {
921
- type: "button",
922
- onClick: s,
923
- style: {
924
- ...tr,
925
- backgroundColor: "var(--ui-color-bg-fill-secondary-default, #f0f0f0)",
926
- color: "var(--ui-color-text-primary, #333)"
927
- },
928
- children: "Cancelar"
929
- }
930
- ),
931
- /* @__PURE__ */ l.jsx(
932
- "button",
933
- {
934
- type: "submit",
935
- style: tr,
936
- disabled: y || o.length === 0,
937
- children: y ? "Enviando..." : "Enviar comentario"
938
- }
939
- )
940
- ] })
941
- ] })
942
- }
943
- )
944
- ] });
968
+ return document.addEventListener("keydown", v, !0), () => document.removeEventListener("keydown", v, !0);
969
+ }, [i]), L(() => {
970
+ const v = (k) => {
971
+ const Y = k.target;
972
+ P.current && !P.current.contains(Y) && (k.preventDefault(), k.stopPropagation(), i());
973
+ };
974
+ return document.addEventListener("mousedown", v, !0), () => document.removeEventListener("mousedown", v, !0);
975
+ }, [i]), L(() => {
976
+ var v;
977
+ (v = P.current) == null || v.focus();
978
+ }, []), /* @__PURE__ */ c.jsxs(
979
+ "div",
980
+ {
981
+ ref: P,
982
+ role: "dialog",
983
+ "aria-modal": "true",
984
+ tabIndex: -1,
985
+ style: { position: "fixed", inset: 0, zIndex: 999997, outline: "none" },
986
+ children: [
987
+ /* @__PURE__ */ c.jsx(
988
+ "div",
989
+ {
990
+ role: "presentation",
991
+ style: lt,
992
+ onClick: i
993
+ }
994
+ ),
995
+ /* @__PURE__ */ c.jsx(
996
+ "div",
997
+ {
998
+ style: {
999
+ ...ut,
1000
+ left: Math.min(o.x, typeof window < "u" ? window.innerWidth - 420 : o.x),
1001
+ top: o.y + 12
1002
+ },
1003
+ onClick: (v) => v.stopPropagation(),
1004
+ children: /* @__PURE__ */ c.jsxs("form", { onSubmit: M, children: [
1005
+ /* @__PURE__ */ c.jsx(
1006
+ "textarea",
1007
+ {
1008
+ placeholder: "Escribe tu comentario...",
1009
+ value: d,
1010
+ onChange: (v) => f(v.target.value),
1011
+ style: ct,
1012
+ required: !0,
1013
+ autoFocus: !0
1014
+ }
1015
+ ),
1016
+ /* @__PURE__ */ c.jsxs(
1017
+ "select",
1018
+ {
1019
+ value: g,
1020
+ onChange: (v) => y(Number(v.target.value)),
1021
+ style: dt,
1022
+ required: !0,
1023
+ disabled: t.length === 0,
1024
+ children: [
1025
+ /* @__PURE__ */ c.jsx("option", { value: "", children: t.length === 0 ? "No hay revisores (ejecuta php artisan db:seed en la API)" : "Selecciona revisor" }),
1026
+ t.map((v) => /* @__PURE__ */ c.jsx("option", { value: v.id, children: v.name }, v.id))
1027
+ ]
1028
+ }
1029
+ ),
1030
+ A && /* @__PURE__ */ c.jsx(
1031
+ "div",
1032
+ {
1033
+ style: {
1034
+ color: "var(--ui-color-text-danger-default, #ff4d4f)",
1035
+ fontSize: "var(--ui-font-size-xs, 12px)",
1036
+ marginBottom: "var(--ui-positive-Value_200, 8px)"
1037
+ },
1038
+ children: A
1039
+ }
1040
+ ),
1041
+ /* @__PURE__ */ c.jsxs("div", { style: { display: "flex", justifyContent: "flex-end", gap: "var(--ui-positive-Value_200, 8px)" }, children: [
1042
+ /* @__PURE__ */ c.jsx(
1043
+ "button",
1044
+ {
1045
+ type: "button",
1046
+ onClick: i,
1047
+ style: {
1048
+ ...lr,
1049
+ backgroundColor: "var(--ui-color-bg-fill-secondary-default, #f0f0f0)",
1050
+ color: "var(--ui-color-text-primary, #333)"
1051
+ },
1052
+ children: "Cancelar"
1053
+ }
1054
+ ),
1055
+ /* @__PURE__ */ c.jsx(
1056
+ "button",
1057
+ {
1058
+ type: "submit",
1059
+ style: lr,
1060
+ disabled: S || t.length === 0,
1061
+ children: S ? "Enviando..." : "Enviar comentario"
1062
+ }
1063
+ )
1064
+ ] })
1065
+ ] })
1066
+ }
1067
+ )
1068
+ ]
1069
+ }
1070
+ );
945
1071
  }
946
- const ao = Re(io), uo = "var(--ui-color-red-500, #ef4444)";
947
- function lo(r) {
1072
+ const vt = ke(ft), pt = "var(--ui-color-red-500, #ef4444)";
1073
+ function gt(r) {
948
1074
  return {
949
1075
  position: "fixed",
950
1076
  outline: `2px solid ${r}`,
@@ -954,82 +1080,82 @@ function lo(r) {
954
1080
  boxSizing: "border-box"
955
1081
  };
956
1082
  }
957
- const so = Re(function({
958
- selector: t,
959
- active: o,
960
- fallbackComment: i,
961
- outlineColor: a = uo
1083
+ const ht = ke(function({
1084
+ selector: n,
1085
+ active: t,
1086
+ fallbackComment: o,
1087
+ outlineColor: s = pt
962
1088
  }) {
963
- const [s, p] = F(null), g = j(() => {
964
- if (!o) {
965
- p(null);
1089
+ const [i, u] = W(null), d = D(() => {
1090
+ if (!t) {
1091
+ u(null);
966
1092
  return;
967
1093
  }
968
- const d = t != null && t.trim() ? cr(t) : null;
969
- if (d) {
970
- p(d);
1094
+ const f = n != null && n.trim() ? gr(n) : null;
1095
+ if (f) {
1096
+ u(f);
971
1097
  return;
972
1098
  }
973
- if (i) {
974
- p(Jr(i));
1099
+ if (o) {
1100
+ u(et(o));
975
1101
  return;
976
1102
  }
977
- p(null);
978
- }, [t, o, i]);
979
- return A(() => {
980
- g();
981
- }, [g]), A(() => {
982
- if (o)
983
- return window.addEventListener("scroll", g, !0), window.addEventListener("resize", g), () => {
984
- window.removeEventListener("scroll", g, !0), window.removeEventListener("resize", g);
1103
+ u(null);
1104
+ }, [n, t, o]);
1105
+ return L(() => {
1106
+ d();
1107
+ }, [d]), L(() => {
1108
+ if (t)
1109
+ return window.addEventListener("scroll", d, !0), window.addEventListener("resize", d), () => {
1110
+ window.removeEventListener("scroll", d, !0), window.removeEventListener("resize", d);
985
1111
  };
986
- }, [o, g]), !o || s == null ? null : /* @__PURE__ */ l.jsx(
1112
+ }, [t, d]), !t || i == null ? null : /* @__PURE__ */ c.jsx(
987
1113
  "div",
988
1114
  {
989
1115
  "aria-hidden": !0,
990
1116
  style: {
991
- ...lo(a),
992
- left: s.left,
993
- top: s.top,
994
- width: s.width,
995
- height: s.height
1117
+ ...gt(s),
1118
+ left: i.left,
1119
+ top: i.top,
1120
+ width: i.width,
1121
+ height: i.height
996
1122
  }
997
1123
  }
998
1124
  );
999
- }), _e = 32, nr = 150, Oe = 250, B = {
1125
+ }), Se = 32, ur = 150, ze = 250, X = {
1000
1126
  cardBg: "var(--ui-color-bg-surface-default, #ffffff)",
1001
1127
  cardFooterBg: "var(--ui-color-bg-surface-secondary-default, #f8fafc)",
1002
1128
  textDark: "var(--ui-color-text-primary, #333333)",
1003
1129
  textMuted: "var(--ui-color-text-secondary, #888888)",
1004
1130
  border: "var(--ui-color-border-default, #cccccc)",
1005
1131
  shadow: "var(--ui-shadow-card, 0 4px 16px rgba(0, 0, 0, 0.12))"
1006
- }, co = {
1007
- [C.PENDING]: "Pendiente",
1008
- [C.DEV_FIXED]: "Corregido",
1009
- [C.VALIDATED]: "Validado"
1010
- }, fo = {
1011
- [C.PENDING]: "PENDIENTE",
1012
- [C.DEV_FIXED]: "CORREGIDO",
1013
- [C.VALIDATED]: "VALIDADO"
1014
- }, ee = {
1015
- [C.PENDING]: "var(--ui-color-red-500, rgb(240, 69, 69))",
1016
- [C.DEV_FIXED]: "var(--ui-color-yellow-500, rgb(235, 179, 8))",
1017
- [C.VALIDATED]: "var(--ui-color-green-500, rgb(33, 196, 94))"
1018
- }, ir = {
1019
- [C.PENDING]: "var(--ui-color-bg-surface-danger-default, #fef2f2)",
1020
- [C.DEV_FIXED]: "var(--ui-color-bg-surface-warning-default, #fffbeb)",
1021
- [C.VALIDATED]: "var(--ui-color-bg-surface-success-default, #f0fdf4)"
1022
- }, Ee = {
1023
- [C.PENDING]: "var(--ui-color-red-500, #ef4444)",
1024
- [C.DEV_FIXED]: "var(--ui-color-orange-500, #f59e0b)",
1025
- [C.VALIDATED]: "var(--ui-color-green-500, #22c55e)"
1132
+ }, bt = {
1133
+ [j.PENDING]: "Pendiente",
1134
+ [j.DEV_FIXED]: "Corregido",
1135
+ [j.VALIDATED]: "Validado"
1136
+ }, xt = {
1137
+ [j.PENDING]: "PENDIENTE",
1138
+ [j.DEV_FIXED]: "CORREGIDO",
1139
+ [j.VALIDATED]: "VALIDADO"
1140
+ }, ce = {
1141
+ [j.PENDING]: "var(--ui-color-red-500, rgb(240, 69, 69))",
1142
+ [j.DEV_FIXED]: "var(--ui-color-yellow-500, rgb(235, 179, 8))",
1143
+ [j.VALIDATED]: "var(--ui-color-green-500, rgb(33, 196, 94))"
1144
+ }, cr = {
1145
+ [j.PENDING]: "var(--ui-color-bg-surface-danger-default, #fef2f2)",
1146
+ [j.DEV_FIXED]: "var(--ui-color-bg-surface-warning-default, #fffbeb)",
1147
+ [j.VALIDATED]: "var(--ui-color-bg-surface-success-default, #f0fdf4)"
1148
+ }, Ce = {
1149
+ [j.PENDING]: "var(--ui-color-red-500, #ef4444)",
1150
+ [j.DEV_FIXED]: "var(--ui-color-orange-500, #f59e0b)",
1151
+ [j.VALIDATED]: "var(--ui-color-green-500, #22c55e)"
1026
1152
  };
1027
- function vo(r) {
1028
- const t = r.trim().split(/\s+/);
1029
- return t.length >= 2 ? (t[0][0] + t[t.length - 1][0]).toUpperCase() : r.slice(0, 2).toUpperCase() || "?";
1153
+ function yt(r) {
1154
+ const n = r.trim().split(/\s+/);
1155
+ return n.length >= 2 ? (n[0][0] + n[n.length - 1][0]).toUpperCase() : r.slice(0, 2).toUpperCase() || "?";
1030
1156
  }
1031
- const po = () => /* @__PURE__ */ l.jsx("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", style: { marginRight: 4, flexShrink: 0 }, children: /* @__PURE__ */ l.jsx("path", { d: "M10 3L4.5 8.5L2 6", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }), go = ({ color: r }) => /* @__PURE__ */ l.jsxs("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", style: { flexShrink: 0 }, children: [
1032
- /* @__PURE__ */ l.jsx(
1157
+ const mt = () => /* @__PURE__ */ c.jsx("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", style: { marginRight: 4, flexShrink: 0 }, children: /* @__PURE__ */ c.jsx("path", { d: "M10 3L4.5 8.5L2 6", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }), wt = ({ color: r }) => /* @__PURE__ */ c.jsxs("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", style: { flexShrink: 0 }, children: [
1158
+ /* @__PURE__ */ c.jsx(
1033
1159
  "path",
1034
1160
  {
1035
1161
  d: "M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z",
@@ -1040,7 +1166,7 @@ const po = () => /* @__PURE__ */ l.jsx("svg", { width: "12", height: "12", viewB
1040
1166
  fill: "none"
1041
1167
  }
1042
1168
  ),
1043
- /* @__PURE__ */ l.jsx(
1169
+ /* @__PURE__ */ c.jsx(
1044
1170
  "path",
1045
1171
  {
1046
1172
  d: "M8 10h.01M12 10h.01M16 10h.01",
@@ -1049,12 +1175,12 @@ const po = () => /* @__PURE__ */ l.jsx("svg", { width: "12", height: "12", viewB
1049
1175
  strokeLinecap: "round"
1050
1176
  }
1051
1177
  )
1052
- ] }), bo = (r) => ({
1178
+ ] }), _t = (r) => ({
1053
1179
  position: "fixed",
1054
- width: _e,
1055
- height: _e,
1180
+ width: Se,
1181
+ height: Se,
1056
1182
  borderRadius: "50%",
1057
- backgroundColor: ee[r] ?? ee[C.PENDING],
1183
+ backgroundColor: ce[r] ?? ce[j.PENDING],
1058
1184
  color: "var(--ui-color-text-on-color, #fff)",
1059
1185
  display: "flex",
1060
1186
  alignItems: "center",
@@ -1064,31 +1190,31 @@ const po = () => /* @__PURE__ */ l.jsx("svg", { width: "12", height: "12", viewB
1064
1190
  boxShadow: "0 2px 8px var(--ui-color-black-alpha-20, rgba(0,0,0,0.2))",
1065
1191
  zIndex: 999998,
1066
1192
  border: "2px solid var(--ui-color-white, #fff)"
1067
- }), ho = {
1193
+ }), Et = {
1068
1194
  position: "fixed",
1069
- width: Oe,
1070
- minWidth: Oe,
1071
- maxWidth: Oe,
1195
+ width: ze,
1196
+ minWidth: ze,
1197
+ maxWidth: ze,
1072
1198
  boxSizing: "border-box",
1073
- backgroundColor: B.cardBg,
1199
+ backgroundColor: X.cardBg,
1074
1200
  borderRadius: "var(--ui-radius_12, 12px)",
1075
- boxShadow: B.shadow,
1201
+ boxShadow: X.shadow,
1076
1202
  fontSize: "var(--ui-font-size-sm, 14px)",
1077
1203
  fontFamily: "var(--ui-font-family-ui, 'Inter', sans-serif)",
1078
1204
  zIndex: 999999,
1079
1205
  pointerEvents: "auto"
1080
- }, xo = {
1206
+ }, Rt = {
1081
1207
  display: "flex",
1082
1208
  alignItems: "center",
1083
1209
  justifyContent: "space-between",
1084
1210
  gap: "var(--ui-positive-Value_250, 10px)",
1085
- borderBottom: `1px solid ${B.border}`,
1211
+ borderBottom: `1px solid ${X.border}`,
1086
1212
  padding: "var(--ui-positive-Value_300, 12px)"
1087
- }, yo = (r) => ({
1213
+ }, St = (r) => ({
1088
1214
  width: 40,
1089
1215
  height: 40,
1090
1216
  borderRadius: "50%",
1091
- backgroundColor: ee[r] ?? ee[C.PENDING],
1217
+ backgroundColor: ce[r] ?? ce[j.PENDING],
1092
1218
  color: "var(--ui-color-text-on-color, #fff)",
1093
1219
  border: "2px solid var(--ui-color-white, #fff)",
1094
1220
  display: "flex",
@@ -1098,18 +1224,18 @@ const po = () => /* @__PURE__ */ l.jsx("svg", { width: "12", height: "12", viewB
1098
1224
  fontWeight: "var(--ui-font-weight-bold, 700)",
1099
1225
  flexShrink: 0,
1100
1226
  overflow: "hidden"
1101
- }), mo = Re(function({
1102
- reviewer: t,
1103
- status: o
1227
+ }), Ct = ke(function({
1228
+ reviewer: n,
1229
+ status: t
1104
1230
  }) {
1105
- const i = t == null ? void 0 : t.image_url, a = (t == null ? void 0 : t.name) ?? "Revisor", s = yo(o);
1106
- if (i && i.trim()) {
1107
- const p = ee[o] ?? ee[C.PENDING];
1108
- return /* @__PURE__ */ l.jsx("div", { style: { ...s, border: `2px solid ${p}` }, children: /* @__PURE__ */ l.jsx(
1231
+ const o = n == null ? void 0 : n.image_url, s = (n == null ? void 0 : n.name) ?? "Revisor", i = St(t);
1232
+ if (o && o.trim()) {
1233
+ const u = ce[t] ?? ce[j.PENDING];
1234
+ return /* @__PURE__ */ c.jsx("div", { style: { ...i, border: `2px solid ${u}` }, children: /* @__PURE__ */ c.jsx(
1109
1235
  "img",
1110
1236
  {
1111
- src: i,
1112
- alt: a,
1237
+ src: o,
1238
+ alt: s,
1113
1239
  style: {
1114
1240
  width: "100%",
1115
1241
  height: "100%",
@@ -1119,8 +1245,8 @@ const po = () => /* @__PURE__ */ l.jsx("svg", { width: "12", height: "12", viewB
1119
1245
  }
1120
1246
  ) });
1121
1247
  }
1122
- return /* @__PURE__ */ l.jsx("div", { style: s, children: vo(a) });
1123
- }), wo = {
1248
+ return /* @__PURE__ */ c.jsx("div", { style: i, children: yt(s) });
1249
+ }), kt = {
1124
1250
  flexShrink: 0,
1125
1251
  width: "var(--ui-positive-Value_600, 24px)",
1126
1252
  height: "var(--ui-positive-Value_600, 24px)",
@@ -1128,15 +1254,15 @@ const po = () => /* @__PURE__ */ l.jsx("svg", { width: "12", height: "12", viewB
1128
1254
  border: "none",
1129
1255
  borderRadius: "var(--ui-radius_6, 6px)",
1130
1256
  backgroundColor: "transparent",
1131
- color: B.textDark,
1257
+ color: X.textDark,
1132
1258
  cursor: "pointer",
1133
1259
  fontSize: "var(--ui-positive-Value_450, 18px)",
1134
1260
  lineHeight: 1,
1135
1261
  display: "flex",
1136
1262
  alignItems: "center",
1137
1263
  justifyContent: "center"
1138
- }, _o = (r) => {
1139
- const t = Ee[r] ?? Ee[C.PENDING];
1264
+ }, Tt = (r) => {
1265
+ const n = Ce[r] ?? Ce[j.PENDING];
1140
1266
  return {
1141
1267
  display: "inline-flex",
1142
1268
  alignItems: "center",
@@ -1147,42 +1273,42 @@ const po = () => /* @__PURE__ */ l.jsx("svg", { width: "12", height: "12", viewB
1147
1273
  fontFamily: "var(--ui-font-family-ui, 'Inter', sans-serif)",
1148
1274
  textTransform: "uppercase",
1149
1275
  letterSpacing: "0.02em",
1150
- backgroundColor: ir[r] ?? ir[C.PENDING],
1151
- color: t,
1152
- border: `1px solid ${t}`
1276
+ backgroundColor: cr[r] ?? cr[j.PENDING],
1277
+ color: n,
1278
+ border: `1px solid ${n}`
1153
1279
  };
1154
- }, Eo = {
1280
+ }, Pt = {
1155
1281
  display: "block",
1156
1282
  fontSize: "var(--ui-font-size-2xs, 10px)",
1157
1283
  fontWeight: "var(--ui-font-weight-semibold, 600)",
1158
1284
  fontFamily: "var(--ui-font-family-ui, 'Inter', sans-serif)",
1159
- color: B.textMuted,
1285
+ color: X.textMuted,
1160
1286
  textTransform: "uppercase",
1161
1287
  letterSpacing: "0.04em"
1162
- }, Ro = {
1288
+ }, jt = {
1163
1289
  width: "100%",
1164
1290
  padding: "var(--ui-positive-Value_200, 8px) var(--ui-positive-Value_300, 12px)",
1165
1291
  paddingRight: "var(--ui-positive-Value_800, 32px)",
1166
1292
  fontSize: "var(--ui-font-size-xs, 13px)",
1167
1293
  fontFamily: "var(--ui-font-family-ui, 'Inter', sans-serif)",
1168
1294
  borderRadius: "var(--ui-radius_8, 8px)",
1169
- border: `1px solid ${B.border}`,
1170
- backgroundColor: B.cardBg,
1171
- color: B.textDark,
1295
+ border: `1px solid ${X.border}`,
1296
+ backgroundColor: X.cardBg,
1297
+ color: X.textDark,
1172
1298
  cursor: "pointer",
1173
1299
  appearance: "none",
1174
1300
  backgroundImage: `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 8L2 4h8z'/%3E%3C/svg%3E")`,
1175
1301
  backgroundRepeat: "no-repeat",
1176
1302
  backgroundPosition: "right var(--ui-positive-Value_250, 10px) center"
1177
- }, So = {
1303
+ }, Vt = {
1178
1304
  display: "flex",
1179
1305
  alignItems: "center",
1180
1306
  justifyContent: "flex-end",
1181
1307
  gap: "var(--ui-positive-Value_200, 8px)",
1182
1308
  padding: "var(--ui-positive-Value_300, 12px)",
1183
- borderTop: `1px solid ${B.border}`,
1184
- backgroundColor: B.cardFooterBg
1185
- }, fr = {
1309
+ borderTop: `1px solid ${X.border}`,
1310
+ backgroundColor: X.cardFooterBg
1311
+ }, xr = {
1186
1312
  minWidth: 100,
1187
1313
  padding: "var(--ui-positive-Value_200, 8px) var(--ui-positive-Value_350, 14px)",
1188
1314
  fontSize: "var(--ui-font-size-xs, 13px)",
@@ -1191,223 +1317,229 @@ const po = () => /* @__PURE__ */ l.jsx("svg", { width: "12", height: "12", viewB
1191
1317
  borderRadius: "var(--ui-radius_8, 8px)",
1192
1318
  cursor: "pointer",
1193
1319
  border: "none"
1194
- }, ko = {
1195
- ...fr,
1320
+ }, It = {
1321
+ ...xr,
1196
1322
  backgroundColor: "transparent",
1197
- color: B.textDark
1198
- }, ye = "review-layer-resolve-btn", Co = [
1323
+ color: X.textDark
1324
+ }, Ee = "review-layer-resolve-btn", Dt = [
1199
1325
  "pending",
1200
1326
  "dev_fixed",
1201
1327
  "validated"
1202
- ], Po = {
1203
- ...fr,
1328
+ ], Ot = {
1329
+ ...xr,
1204
1330
  backgroundColor: "var(--ui-color-bg-fill-success-default, #22c55e)",
1205
1331
  color: "var(--ui-color-text-on-color, #fff)"
1206
1332
  };
1207
- function jo({
1333
+ function Lt({
1208
1334
  comment: r,
1209
- offset: t = { dx: 0, dy: 0 },
1210
- apiUrl: o,
1211
- apiKey: i,
1212
- onStatusChange: a,
1213
- reviewMode: s = !1
1335
+ offset: n = { dx: 0, dy: 0 },
1336
+ apiUrl: t,
1337
+ apiKey: o,
1338
+ onStatusChange: s,
1339
+ reviewMode: i = !1
1214
1340
  }) {
1215
- var ne, ie;
1216
- const [p, g] = F(!1), [d, w] = F(!1), [h, y] = F(() => we(r)), [P, k] = F(!1), [V, $] = F(null), z = me(null), c = me(null), f = me(null), I = j(() => {
1217
- y(we(r));
1341
+ var fe, ve;
1342
+ const [u, d] = W(!1), [f, g] = W(!1), [y, S] = W(() => Re(r)), [m, A] = W(!1), [z, M] = W(null), P = ne(null), $ = ne(null), v = ne(null), k = D(() => {
1343
+ S(Re(r));
1218
1344
  }, [r]);
1219
- A(() => {
1220
- I();
1221
- }, [I]), A(() => {
1345
+ L(() => {
1346
+ k();
1347
+ }, [k]), L(() => {
1222
1348
  if (!(typeof window > "u"))
1223
- return window.addEventListener("scroll", I, !0), window.addEventListener("resize", I), () => {
1224
- window.removeEventListener("scroll", I, !0), window.removeEventListener("resize", I);
1349
+ return window.addEventListener("scroll", k, !0), window.addEventListener("resize", k), () => {
1350
+ window.removeEventListener("scroll", k, !0), window.removeEventListener("resize", k);
1225
1351
  };
1226
- }, [I]);
1227
- const N = j(() => {
1228
- z.current !== null && (clearTimeout(z.current), z.current = null);
1229
- }, []), H = j(() => {
1230
- s || (N(), g(!0));
1231
- }, [s, N]), re = j(() => {
1232
- d || (z.current = setTimeout(() => {
1233
- z.current = null, g(!1);
1234
- }, nr));
1235
- }, [d]), oe = j(() => {
1236
- N(), g(!0);
1237
- }, [N]), te = j(() => {
1238
- d || (z.current = setTimeout(() => {
1239
- z.current = null, g(!1);
1240
- }, nr));
1241
- }, [d]), X = j(() => {
1242
- if (s) {
1243
- d && (w(!1), g(!1));
1352
+ }, [k]), L(() => {
1353
+ if (!r.selector || typeof document > "u") return;
1354
+ const w = document.querySelector(r.selector);
1355
+ if (!w) return;
1356
+ const te = pr(w).map((K) => (K.addEventListener("scroll", k, !0), () => K.removeEventListener("scroll", k, !0)));
1357
+ return () => te.forEach((K) => K());
1358
+ }, [r.selector, k]);
1359
+ const Y = D(() => {
1360
+ P.current !== null && (clearTimeout(P.current), P.current = null);
1361
+ }, []), E = D(() => {
1362
+ i || (Y(), d(!0));
1363
+ }, [i, Y]), R = D(() => {
1364
+ f || (P.current = setTimeout(() => {
1365
+ P.current = null, d(!1);
1366
+ }, ur));
1367
+ }, [f]), V = D(() => {
1368
+ Y(), d(!0);
1369
+ }, [Y]), q = D(() => {
1370
+ f || (P.current = setTimeout(() => {
1371
+ P.current = null, d(!1);
1372
+ }, ur));
1373
+ }, [f]), H = D(() => {
1374
+ if (i) {
1375
+ f && (g(!1), d(!1));
1244
1376
  return;
1245
1377
  }
1246
- d ? (w(!1), g(!1)) : (w(!0), g(!0));
1247
- }, [s, d]);
1248
- A(() => {
1249
- if (!d) return;
1250
- const _ = (q) => {
1251
- var ve, pe;
1252
- const ae = q.target;
1253
- (ve = c.current) != null && ve.contains(ae) || (pe = f.current) != null && pe.contains(ae) || (w(!1), g(!1));
1378
+ f ? (g(!1), d(!1)) : (g(!0), d(!0));
1379
+ }, [i, f]);
1380
+ L(() => {
1381
+ if (!f) return;
1382
+ const w = (ee) => {
1383
+ var K, xe;
1384
+ const te = ee.target;
1385
+ (K = $.current) != null && K.contains(te) || (xe = v.current) != null && xe.contains(te) || (g(!1), d(!1));
1254
1386
  };
1255
- return document.addEventListener("mousedown", _, !0), () => document.removeEventListener("mousedown", _, !0);
1256
- }, [d]), A(() => () => N(), [N]), A(() => {
1257
- s && (w(!1), g(!1));
1258
- }, [s]);
1259
- const m = h.x + t.dx, R = h.y + t.dy, { x: O, y: T } = Fe(m, R, _e / 2), G = p && !d, Y = j(() => {
1260
- w(!1), g(!1);
1261
- }, []), J = j(
1262
- async (_) => {
1263
- if (_ !== r.status) {
1264
- $(null), k(!0);
1387
+ return document.addEventListener("mousedown", w, !0), () => document.removeEventListener("mousedown", w, !0);
1388
+ }, [f]), L(() => () => Y(), [Y]), L(() => {
1389
+ i && (g(!1), d(!1));
1390
+ }, [i]);
1391
+ const Q = y.x + n.dx, ie = y.y + n.dy, { x: h, y: b } = We(Q, ie, Se / 2), O = u && !f, I = D(() => {
1392
+ g(!1), d(!1);
1393
+ }, []), re = D(
1394
+ async (w) => {
1395
+ if (w !== r.status) {
1396
+ M(null), A(!0);
1265
1397
  try {
1266
- await Kr(o, i, r.id, _), a();
1267
- } catch (q) {
1268
- $(q instanceof Error ? q.message : "Error al actualizar");
1398
+ await at(t, o, r.id, w), s();
1399
+ } catch (ee) {
1400
+ M(ee instanceof Error ? ee.message : "Error al actualizar");
1269
1401
  } finally {
1270
- k(!1);
1402
+ A(!1);
1271
1403
  }
1272
1404
  }
1273
1405
  },
1274
- [o, i, r.id, r.status, a]
1275
- ), de = j(async () => {
1276
- $(null), k(!0);
1406
+ [t, o, r.id, r.status, s]
1407
+ ), ae = D(async () => {
1408
+ M(null), A(!0);
1277
1409
  try {
1278
- await eo(o, i, r.id), a(), Y();
1279
- } catch (_) {
1280
- $(_ instanceof Error ? _.message : "Error al eliminar");
1410
+ await st(t, o, r.id), s(), I();
1411
+ } catch (w) {
1412
+ M(w instanceof Error ? w.message : "Error al eliminar");
1281
1413
  } finally {
1282
- k(!1);
1414
+ A(!1);
1283
1415
  }
1284
- }, [o, i, r.id, a, Y]), fe = Ne(
1285
- () => ({ ...bo(r.status), left: O, top: T, transform: "translate(-50%, -50%)" }),
1286
- [r.status, O, T]
1416
+ }, [t, o, r.id, s, I]), se = Be(
1417
+ () => ({ ..._t(r.status), left: h, top: b, transform: "translate(-50%, -50%)" }),
1418
+ [r.status, h, b]
1287
1419
  );
1288
- return /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
1289
- /* @__PURE__ */ l.jsx(
1290
- so,
1420
+ return /* @__PURE__ */ c.jsxs(c.Fragment, { children: [
1421
+ /* @__PURE__ */ c.jsx(
1422
+ ht,
1291
1423
  {
1292
1424
  selector: r.selector,
1293
- active: G,
1425
+ active: O,
1294
1426
  fallbackComment: r,
1295
- outlineColor: Ee[r.status] ?? Ee[C.PENDING]
1427
+ outlineColor: Ce[r.status] ?? Ce[j.PENDING]
1296
1428
  }
1297
1429
  ),
1298
- /* @__PURE__ */ l.jsx(
1430
+ /* @__PURE__ */ c.jsx(
1299
1431
  "div",
1300
1432
  {
1301
- ref: c,
1433
+ ref: $,
1302
1434
  role: "button",
1303
1435
  tabIndex: 0,
1304
1436
  "aria-label": `Comentario: ${r.message.slice(0, 30)}...`,
1305
- "aria-expanded": p,
1306
- style: fe,
1307
- onMouseEnter: H,
1308
- onMouseLeave: re,
1309
- onClick: X,
1310
- children: /* @__PURE__ */ l.jsx(go, { color: "var(--ui-color-white, #fff)" })
1437
+ "aria-expanded": u,
1438
+ style: se,
1439
+ onMouseEnter: E,
1440
+ onMouseLeave: R,
1441
+ onClick: H,
1442
+ children: /* @__PURE__ */ c.jsx(wt, { color: "var(--ui-color-white, #fff)" })
1311
1443
  }
1312
1444
  ),
1313
- p && /* @__PURE__ */ l.jsxs(
1445
+ u && /* @__PURE__ */ c.jsxs(
1314
1446
  "div",
1315
1447
  {
1316
- ref: f,
1448
+ ref: v,
1317
1449
  role: "dialog",
1318
1450
  "aria-label": "Detalle del comentario",
1319
1451
  style: {
1320
- ...ho,
1321
- left: O + _e / 2 + 6,
1322
- top: T
1452
+ ...Et,
1453
+ left: h + Se / 2 + 6,
1454
+ top: b
1323
1455
  },
1324
- onMouseEnter: oe,
1325
- onMouseLeave: te,
1456
+ onMouseEnter: V,
1457
+ onMouseLeave: q,
1326
1458
  children: [
1327
- /* @__PURE__ */ l.jsxs("div", { style: xo, children: [
1328
- /* @__PURE__ */ l.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 10, flex: 1, minWidth: 0 }, children: [
1329
- /* @__PURE__ */ l.jsx(mo, { reviewer: r.reviewer, status: r.status }),
1330
- /* @__PURE__ */ l.jsxs("div", { children: [
1331
- /* @__PURE__ */ l.jsx("div", { style: { fontWeight: 700, fontSize: 14, color: B.textDark }, children: ((ne = r.reviewer) == null ? void 0 : ne.name) ?? "Revisor" }),
1332
- /* @__PURE__ */ l.jsx("div", { style: { fontSize: 12, color: B.textMuted }, children: ((ie = r.reviewer) == null ? void 0 : ie.job_title) ?? "Revisor" })
1459
+ /* @__PURE__ */ c.jsxs("div", { style: Rt, children: [
1460
+ /* @__PURE__ */ c.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 10, flex: 1, minWidth: 0 }, children: [
1461
+ /* @__PURE__ */ c.jsx(Ct, { reviewer: r.reviewer, status: r.status }),
1462
+ /* @__PURE__ */ c.jsxs("div", { children: [
1463
+ /* @__PURE__ */ c.jsx("div", { style: { fontWeight: 700, fontSize: 14, color: X.textDark }, children: ((fe = r.reviewer) == null ? void 0 : fe.name) ?? "Revisor" }),
1464
+ /* @__PURE__ */ c.jsx("div", { style: { fontSize: 12, color: X.textMuted }, children: ((ve = r.reviewer) == null ? void 0 : ve.job_title) ?? "Revisor" })
1333
1465
  ] })
1334
1466
  ] }),
1335
- /* @__PURE__ */ l.jsx(
1467
+ /* @__PURE__ */ c.jsx(
1336
1468
  "button",
1337
1469
  {
1338
1470
  type: "button",
1339
- "aria-label": r.status === C.VALIDATED ? "Eliminar comentario" : "Cerrar",
1340
- style: wo,
1341
- disabled: P,
1342
- onClick: (_) => {
1343
- _.stopPropagation(), r.status === C.VALIDATED ? de() : Y();
1471
+ "aria-label": r.status === j.VALIDATED ? "Eliminar comentario" : "Cerrar",
1472
+ style: kt,
1473
+ disabled: m,
1474
+ onClick: (w) => {
1475
+ w.stopPropagation(), r.status === j.VALIDATED ? ae() : I();
1344
1476
  },
1345
- onMouseDown: (_) => _.stopPropagation(),
1477
+ onMouseDown: (w) => w.stopPropagation(),
1346
1478
  children: "✕"
1347
1479
  }
1348
1480
  )
1349
1481
  ] }),
1350
- /* @__PURE__ */ l.jsxs("div", { style: { padding: 12, display: "flex", alignItems: "flex-start", flexDirection: "column", gap: 4 }, children: [
1351
- /* @__PURE__ */ l.jsxs("div", { style: _o(r.status), children: [
1352
- r.status === C.VALIDATED && /* @__PURE__ */ l.jsx(po, {}),
1353
- fo[r.status] ?? r.status
1482
+ /* @__PURE__ */ c.jsxs("div", { style: { padding: 12, display: "flex", alignItems: "flex-start", flexDirection: "column", gap: 4 }, children: [
1483
+ /* @__PURE__ */ c.jsxs("div", { style: Tt(r.status), children: [
1484
+ r.status === j.VALIDATED && /* @__PURE__ */ c.jsx(mt, {}),
1485
+ xt[r.status] ?? r.status
1354
1486
  ] }),
1355
- /* @__PURE__ */ l.jsx("div", { style: { color: B.textDark, lineHeight: 1.5, marginBottom: 12, marginTop: 12 }, children: r.message }),
1356
- /* @__PURE__ */ l.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 4, width: "100%" }, children: [
1357
- /* @__PURE__ */ l.jsx("label", { style: Eo, htmlFor: `comment-status-${r.id}`, children: "Cambiar estado" }),
1358
- /* @__PURE__ */ l.jsx(
1487
+ /* @__PURE__ */ c.jsx("div", { style: { color: X.textDark, lineHeight: 1.5, marginBottom: 12, marginTop: 12 }, children: r.message }),
1488
+ /* @__PURE__ */ c.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 4, width: "100%" }, children: [
1489
+ /* @__PURE__ */ c.jsx("label", { style: Pt, htmlFor: `comment-status-${r.id}`, children: "Cambiar estado" }),
1490
+ /* @__PURE__ */ c.jsx(
1359
1491
  "select",
1360
1492
  {
1361
1493
  id: `comment-status-${r.id}`,
1362
- style: Ro,
1494
+ style: jt,
1363
1495
  value: r.status,
1364
- disabled: P,
1365
- onChange: (_) => J(_.target.value),
1366
- onMouseDown: (_) => _.stopPropagation(),
1496
+ disabled: m,
1497
+ onChange: (w) => re(w.target.value),
1498
+ onMouseDown: (w) => w.stopPropagation(),
1367
1499
  "aria-label": "Cambiar estado del comentario",
1368
- children: Co.map((_) => /* @__PURE__ */ l.jsx("option", { value: _, children: co[_] }, _))
1500
+ children: Dt.map((w) => /* @__PURE__ */ c.jsx("option", { value: w, children: bt[w] }, w))
1369
1501
  }
1370
1502
  ),
1371
- V && /* @__PURE__ */ l.jsx("div", { style: { marginTop: 8, fontSize: 11, color: "var(--ui-color-text-danger-default, rgb(240, 69, 69))" }, children: V })
1503
+ z && /* @__PURE__ */ c.jsx("div", { style: { marginTop: 8, fontSize: 11, color: "var(--ui-color-text-danger-default, rgb(240, 69, 69))" }, children: z })
1372
1504
  ] })
1373
1505
  ] }),
1374
- /* @__PURE__ */ l.jsxs("div", { style: So, children: [
1375
- /* @__PURE__ */ l.jsx(
1506
+ /* @__PURE__ */ c.jsxs("div", { style: Vt, children: [
1507
+ /* @__PURE__ */ c.jsx(
1376
1508
  "button",
1377
1509
  {
1378
1510
  type: "button",
1379
- style: ko,
1380
- onMouseDown: (_) => _.stopPropagation(),
1381
- onClick: (_) => {
1382
- _.stopPropagation(), Y();
1511
+ style: It,
1512
+ onMouseDown: (w) => w.stopPropagation(),
1513
+ onClick: (w) => {
1514
+ w.stopPropagation(), I();
1383
1515
  },
1384
1516
  children: "Cerrar"
1385
1517
  }
1386
1518
  ),
1387
- r.status !== C.VALIDATED && /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
1388
- /* @__PURE__ */ l.jsx("style", { children: `
1389
- .${ye}:hover:not(:disabled) {
1519
+ r.status !== j.VALIDATED && /* @__PURE__ */ c.jsxs(c.Fragment, { children: [
1520
+ /* @__PURE__ */ c.jsx("style", { children: `
1521
+ .${Ee}:hover:not(:disabled) {
1390
1522
  background-color: var(--ui-color-bg-fill-success-hover, #16a34a) !important;
1391
1523
  }
1392
- .${ye}:active:not(:disabled) {
1524
+ .${Ee}:active:not(:disabled) {
1393
1525
  background-color: var(--ui-color-bg-fill-success-pressed, #15803d) !important;
1394
1526
  }
1395
- .${ye}:disabled {
1527
+ .${Ee}:disabled {
1396
1528
  background-color: var(--ui-color-bg-fill-success-default, #22c55e) !important;
1397
1529
  opacity: 0.7;
1398
1530
  cursor: not-allowed;
1399
1531
  }
1400
1532
  ` }),
1401
- /* @__PURE__ */ l.jsx(
1533
+ /* @__PURE__ */ c.jsx(
1402
1534
  "button",
1403
1535
  {
1404
1536
  type: "button",
1405
- className: ye,
1406
- style: Po,
1407
- disabled: P,
1408
- onMouseDown: (_) => _.stopPropagation(),
1409
- onClick: (_) => {
1410
- _.stopPropagation(), J("validated");
1537
+ className: Ee,
1538
+ style: Ot,
1539
+ disabled: m,
1540
+ onMouseDown: (w) => w.stopPropagation(),
1541
+ onClick: (w) => {
1542
+ w.stopPropagation(), re("validated");
1411
1543
  },
1412
1544
  children: "Validar"
1413
1545
  }
@@ -1419,130 +1551,134 @@ function jo({
1419
1551
  )
1420
1552
  ] });
1421
1553
  }
1422
- const Vo = Re(jo), To = 25, Do = 36;
1423
- function Io(r) {
1424
- const t = /* @__PURE__ */ new Map();
1425
- for (let o = 0; o < r.length; o++) {
1426
- const i = r[o], { x: a, y: s } = we(i), { x: p, y: g } = Fe(a, s);
1427
- let d = 0;
1428
- for (let w = 0; w < o; w++) {
1429
- const { x: h, y } = we(r[w]), { x: P, y: k } = Fe(h, y);
1430
- Math.hypot(p - P, g - k) < To && d++;
1431
- }
1432
- t.set(i.id, { dx: d * Do, dy: 0 });
1554
+ const At = ke(Lt), zt = 25, Ft = 36;
1555
+ function Nt(r) {
1556
+ const n = /* @__PURE__ */ new Map();
1557
+ for (let t = 0; t < r.length; t++) {
1558
+ const o = r[t], { x: s, y: i } = Re(o), { x: u, y: d } = We(s, i);
1559
+ let f = 0;
1560
+ for (let g = 0; g < t; g++) {
1561
+ const { x: y, y: S } = Re(r[g]), { x: m, y: A } = We(y, S);
1562
+ Math.hypot(u - m, d - A) < zt && f++;
1563
+ }
1564
+ n.set(o.id, { dx: f * Ft, dy: 0 });
1433
1565
  }
1434
- return t;
1566
+ return n;
1435
1567
  }
1436
- function Oo() {
1568
+ function $t() {
1437
1569
  return typeof window > "u" ? "" : `${window.innerWidth}x${window.innerHeight}`;
1438
1570
  }
1439
- function Lo({
1571
+ function Mt({
1440
1572
  apiUrl: r,
1441
- apiKey: t,
1573
+ apiKey: n,
1574
+ getPageUrl: t,
1442
1575
  reviewMode: o,
1443
- setReviewMode: i,
1444
- reviewers: a,
1445
- comments: s,
1446
- loadComments: p,
1447
- commentsLoadFailed: g = !1
1576
+ setReviewMode: s,
1577
+ reviewers: i,
1578
+ comments: u,
1579
+ loadComments: d,
1580
+ commentsLoadFailed: f = !1
1448
1581
  }) {
1449
- const [d, w] = F(null), h = me(null), [y, P] = F(null), k = j(() => {
1450
- d && (d.style.outline = "", d.style.outlineOffset = "", w(null));
1451
- }, [d]), V = j(() => {
1452
- h.current && (h.current.style.outline = "", h.current.style.outlineOffset = "", h.current = null);
1582
+ const [g, y] = W(null), S = ne(null), [m, A] = W(null), z = D(() => {
1583
+ g && (g.style.outline = "", g.style.outlineOffset = "", y(null));
1584
+ }, [g]), M = D(() => {
1585
+ S.current && (S.current.style.outline = "", S.current.style.outlineOffset = "", S.current = null);
1453
1586
  }, []);
1454
- A(() => {
1455
- o || (k(), V());
1456
- }, [o, k, V]), A(() => {
1587
+ L(() => {
1588
+ o || (z(), M());
1589
+ }, [o, z, M]), L(() => {
1457
1590
  if (typeof document > "u") return;
1458
- const m = document.body.style.cursor;
1459
- return y ? document.body.style.cursor = "default" : o && (document.body.style.cursor = "crosshair"), () => {
1460
- document.body.style.cursor = m;
1591
+ const h = document.body.style.cursor;
1592
+ return m ? document.body.style.cursor = "default" : o && (document.body.style.cursor = "crosshair"), () => {
1593
+ document.body.style.cursor = h;
1461
1594
  };
1462
- }, [o, y]);
1463
- const $ = j((m) => {
1595
+ }, [o, m]);
1596
+ const P = D((h) => {
1464
1597
  var O;
1465
- if (!m || typeof document > "u" || m === document.body || m === document.documentElement) return !0;
1466
- const R = (O = m.tagName) == null ? void 0 : O.toUpperCase();
1467
- return R === "BODY" || R === "HTML" ? !0 : m.parentElement !== document.body ? !1 : m.id === "root" || m.getAttribute("data-review-layer-host") != null || document.body.children.length === 1;
1468
- }, []), z = j(
1469
- (m) => {
1470
- if (!o || y) return;
1471
- const R = m.target.nodeType === Node.ELEMENT_NODE ? m.target : m.target.parentElement;
1472
- !R || $(R) || (k(), w(R), R.style.outline = "2px solid var(--ui-color-bg-fill-danger-default, #ff4d4f)", R.style.outlineOffset = "2px");
1598
+ if (!h || typeof document > "u" || h === document.body || h === document.documentElement) return !0;
1599
+ const b = (O = h.tagName) == null ? void 0 : O.toUpperCase();
1600
+ return b === "BODY" || b === "HTML" ? !0 : h.parentElement !== document.body ? !1 : h.id === "root" || h.getAttribute("data-review-layer-host") != null || document.body.children.length === 1;
1601
+ }, []), $ = D(
1602
+ (h) => {
1603
+ if (!o || m) return;
1604
+ const b = h.target.nodeType === Node.ELEMENT_NODE ? h.target : h.target.parentElement;
1605
+ !b || P(b) || (z(), y(b), b.style.outline = "2px solid var(--ui-color-bg-fill-danger-default, #ff4d4f)", b.style.outlineOffset = "2px");
1473
1606
  },
1474
- [o, y, k, $]
1475
- ), c = j(
1476
- (m) => {
1607
+ [o, m, z, P]
1608
+ ), v = D(
1609
+ (h) => {
1477
1610
  var O;
1478
- if (y) return;
1479
- const R = m.relatedTarget;
1480
- d && (!R || !d.contains(R)) && !(R && ((O = d.contains) != null && O.call(d, R))) && k();
1611
+ if (m) return;
1612
+ const b = h.relatedTarget;
1613
+ g && (!b || !g.contains(b)) && !(b && ((O = g.contains) != null && O.call(g, b))) && z();
1481
1614
  },
1482
- [d, y, k]
1483
- ), f = j(
1484
- (m) => {
1485
- if (!o || y) return;
1486
- const R = m.target;
1487
- if (!R || $(R) || R.closest("[data-review-layer-root]")) return;
1488
- m.preventDefault(), m.stopPropagation(), k();
1489
- const O = R;
1490
- h.current = O, O.style.outline = "2px solid var(--ui-color-bg-fill-danger-default, #ff4d4f)", O.style.outlineOffset = "2px";
1491
- const T = O.getBoundingClientRect(), G = Ur(R), { relativeX: Y, relativeY: J } = Xr(T);
1492
- P({
1493
- position: { x: T.left + T.width / 2, y: T.bottom },
1615
+ [g, m, z]
1616
+ ), k = D(
1617
+ (h) => {
1618
+ if (!o || m) return;
1619
+ const b = h.target;
1620
+ if (!b || P(b) || b.closest("[data-review-layer-root]")) return;
1621
+ h.preventDefault(), h.stopPropagation(), z();
1622
+ const O = b;
1623
+ S.current = O, O.style.outline = "2px solid var(--ui-color-bg-fill-danger-default, #ff4d4f)", O.style.outlineOffset = "2px";
1624
+ const I = O.getBoundingClientRect(), re = Jr(b), { relativeX: ae, relativeY: se } = Kr(I);
1625
+ A({
1626
+ position: { x: I.left + I.width / 2, y: I.bottom },
1494
1627
  payload: {
1495
- selector: G,
1496
- x: Math.round(T.left),
1497
- y: Math.round(T.top),
1498
- relativeX: Y,
1499
- relativeY: J,
1500
- width: Math.round(T.width),
1501
- height: Math.round(T.height),
1502
- url: typeof window < "u" && window.location.pathname || "/",
1503
- viewport: Oo(),
1628
+ selector: re,
1629
+ x: Math.round(I.left),
1630
+ y: Math.round(I.top),
1631
+ relativeX: ae,
1632
+ relativeY: se,
1633
+ width: Math.round(I.width),
1634
+ height: Math.round(I.height),
1635
+ url: typeof window < "u" ? (t == null ? void 0 : t()) ?? br() : "/",
1636
+ viewport: $t(),
1504
1637
  userAgent: typeof navigator < "u" ? navigator.userAgent : "",
1505
1638
  pageTitle: typeof document < "u" ? document.title : ""
1506
1639
  }
1507
1640
  });
1508
1641
  },
1509
- [o, y, k, $]
1642
+ [o, m, z, P]
1510
1643
  );
1511
- A(() => {
1644
+ L(() => {
1512
1645
  if (o)
1513
- return document.addEventListener("mouseover", z, !0), document.addEventListener("mouseout", c, !0), document.addEventListener("click", f, !0), () => {
1514
- document.removeEventListener("mouseover", z, !0), document.removeEventListener("mouseout", c, !0), document.removeEventListener("click", f, !0);
1646
+ return document.addEventListener("mouseover", $, !0), document.addEventListener("mouseout", v, !0), document.addEventListener("click", k, !0), () => {
1647
+ document.removeEventListener("mouseover", $, !0), document.removeEventListener("mouseout", v, !0), document.removeEventListener("click", k, !0);
1515
1648
  };
1516
- }, [o, z, c, f]);
1517
- const [I, N] = F(0);
1518
- A(() => {
1519
- if (typeof window > "u") return;
1520
- const m = () => {
1521
- if (N((R) => R + 1), h.current) {
1522
- const R = h.current.getBoundingClientRect();
1523
- P(
1524
- (O) => O ? { ...O, position: { x: R.left + R.width / 2, y: R.bottom } } : null
1525
- );
1526
- }
1527
- };
1528
- return window.addEventListener("resize", m), window.addEventListener("scroll", m, !0), () => {
1529
- window.removeEventListener("resize", m), window.removeEventListener("scroll", m, !0);
1530
- };
1649
+ }, [o, $, v, k]);
1650
+ const [Y, E] = W(0), R = D(() => {
1651
+ if (E((h) => h + 1), S.current) {
1652
+ const h = S.current.getBoundingClientRect();
1653
+ A(
1654
+ (b) => b ? { ...b, position: { x: h.left + h.width / 2, y: h.bottom } } : null
1655
+ );
1656
+ }
1531
1657
  }, []);
1532
- const H = Ne(
1533
- () => Io(s),
1534
- [s, I]
1535
- ), re = j(() => {
1536
- V(), P(null);
1537
- }, [V]), oe = {
1658
+ L(() => {
1659
+ if (!(typeof window > "u"))
1660
+ return window.addEventListener("resize", R), window.addEventListener("scroll", R, !0), () => {
1661
+ window.removeEventListener("resize", R), window.removeEventListener("scroll", R, !0);
1662
+ };
1663
+ }, [R]), L(() => {
1664
+ if (!m || !S.current) return;
1665
+ const h = S.current, O = pr(h).map((I) => (I.addEventListener("scroll", R, !0), () => I.removeEventListener("scroll", R, !0)));
1666
+ return () => O.forEach((I) => I());
1667
+ }, [m, R]);
1668
+ const V = Be(
1669
+ () => Nt(u),
1670
+ [u, Y]
1671
+ ), q = D(() => {
1672
+ M(), A(null);
1673
+ }, [M]), H = {
1538
1674
  position: "fixed",
1539
1675
  inset: 0,
1540
1676
  zIndex: 999999,
1541
1677
  pointerEvents: "none",
1542
1678
  cursor: o ? "crosshair" : void 0
1543
- }, te = /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
1544
- /* @__PURE__ */ l.jsx("div", { style: oe, "aria-hidden": !0, "data-review-layer-root": !0 }),
1545
- o && /* @__PURE__ */ l.jsxs(
1679
+ }, Q = /* @__PURE__ */ c.jsxs(c.Fragment, { children: [
1680
+ /* @__PURE__ */ c.jsx("div", { style: H, "aria-hidden": !0, "data-review-layer-root": !0 }),
1681
+ o && /* @__PURE__ */ c.jsxs(
1546
1682
  "div",
1547
1683
  {
1548
1684
  "data-review-layer-root": !0,
@@ -1563,12 +1699,12 @@ function Lo({
1563
1699
  pointerEvents: "auto"
1564
1700
  },
1565
1701
  children: [
1566
- /* @__PURE__ */ l.jsx("span", { children: "Modo revisión (Shift+R para salir)" }),
1567
- /* @__PURE__ */ l.jsx(
1702
+ /* @__PURE__ */ c.jsx("span", { children: "Modo revisión (Shift+R para salir)" }),
1703
+ /* @__PURE__ */ c.jsx(
1568
1704
  "button",
1569
1705
  {
1570
1706
  type: "button",
1571
- onClick: () => i(!1),
1707
+ onClick: () => s(!1),
1572
1708
  "aria-label": "Salir del modo revisión",
1573
1709
  style: {
1574
1710
  padding: 0,
@@ -1592,7 +1728,7 @@ function Lo({
1592
1728
  ]
1593
1729
  }
1594
1730
  ),
1595
- g && /* @__PURE__ */ l.jsxs(
1731
+ f && /* @__PURE__ */ c.jsxs(
1596
1732
  "div",
1597
1733
  {
1598
1734
  style: {
@@ -1614,12 +1750,12 @@ function Lo({
1614
1750
  pointerEvents: "auto"
1615
1751
  },
1616
1752
  children: [
1617
- /* @__PURE__ */ l.jsx("span", { children: "No se pudo conectar. Mostrando últimos datos guardados. Reintentar no garantiza respuesta hasta que el servicio esté activo." }),
1618
- /* @__PURE__ */ l.jsx(
1753
+ /* @__PURE__ */ c.jsx("span", { children: "No se pudo conectar. Mostrando últimos datos guardados. Reintentar no garantiza respuesta hasta que el servicio esté activo." }),
1754
+ /* @__PURE__ */ c.jsx(
1619
1755
  "button",
1620
1756
  {
1621
1757
  type: "button",
1622
- onClick: () => p(),
1758
+ onClick: () => d(),
1623
1759
  style: {
1624
1760
  padding: "var(--ui-positive-Value_100, 4px) var(--ui-positive-Value_250, 10px)",
1625
1761
  fontSize: "var(--ui-font-size-xs, 12px)",
@@ -1636,33 +1772,33 @@ function Lo({
1636
1772
  ]
1637
1773
  }
1638
1774
  ),
1639
- s.map((m) => /* @__PURE__ */ l.jsx("div", { "data-review-layer-pin": !0, style: { pointerEvents: "auto" }, children: /* @__PURE__ */ l.jsx(
1640
- Vo,
1775
+ u.map((h) => /* @__PURE__ */ c.jsx("div", { "data-review-layer-pin": !0, style: { pointerEvents: "auto" }, children: /* @__PURE__ */ c.jsx(
1776
+ At,
1641
1777
  {
1642
- comment: m,
1643
- offset: H.get(m.id),
1778
+ comment: h,
1779
+ offset: V.get(h.id),
1644
1780
  apiUrl: r,
1645
- apiKey: t,
1646
- onStatusChange: p,
1781
+ apiKey: n,
1782
+ onStatusChange: d,
1647
1783
  reviewMode: o
1648
1784
  }
1649
- ) }, m.id)),
1650
- y && /* @__PURE__ */ l.jsx("div", { "data-review-layer-modal": !0, style: { pointerEvents: "auto" }, children: /* @__PURE__ */ l.jsx(
1651
- ao,
1785
+ ) }, h.id)),
1786
+ m && /* @__PURE__ */ c.jsx("div", { "data-review-layer-modal": !0, style: { pointerEvents: "auto" }, children: /* @__PURE__ */ c.jsx(
1787
+ vt,
1652
1788
  {
1653
1789
  apiUrl: r,
1654
- apiKey: t,
1655
- reviewers: a,
1656
- position: y.position,
1657
- payload: y.payload,
1658
- onClose: re,
1659
- onSuccess: p
1790
+ apiKey: n,
1791
+ reviewers: i,
1792
+ position: m.position,
1793
+ payload: m.payload,
1794
+ onClose: q,
1795
+ onSuccess: d
1660
1796
  }
1661
1797
  ) })
1662
- ] }), X = typeof document < "u" ? document.body : null;
1663
- return X ? sr(te, X) : null;
1798
+ ] }), ie = typeof document < "u" ? document.body : null;
1799
+ return ie ? vr(Q, ie) : null;
1664
1800
  }
1665
- const zo = `/**
1801
+ const Wt = `/**
1666
1802
  * Tokens de diseño UI para review-layer-react.
1667
1803
  * Las variables se inyectan en :root al montar ReviewProvider.
1668
1804
  * Puedes sobrescribirlas en tu app para adaptar el tema.
@@ -1988,176 +2124,227 @@ const zo = `/**
1988
2124
  --ui-shadow-modal: 0 var(--ui-shadow-04-y) var(--ui-shadow-04-blur) var(--ui-shadow-04-Color);
1989
2125
  }
1990
2126
  `;
1991
- function Ao(r, t, o) {
1992
- const i = j(() => {
1993
- r && o((a) => !a);
1994
- }, [r, o]);
1995
- A(() => {
2127
+ function Bt(r, n, t) {
2128
+ const o = D(() => {
2129
+ r && t((s) => !s);
2130
+ }, [r, t]);
2131
+ L(() => {
1996
2132
  if (!r) return;
1997
- const a = (s) => {
1998
- (s.key === "r" || s.key === "R" || s.code === "KeyR") && s.shiftKey && !s.ctrlKey && !s.metaKey && (s.preventDefault(), i());
2133
+ const s = (i) => {
2134
+ (i.key === "r" || i.key === "R" || i.code === "KeyR") && i.shiftKey && !i.ctrlKey && !i.metaKey && (i.preventDefault(), o());
1999
2135
  };
2000
- return window.addEventListener("keydown", a), () => window.removeEventListener("keydown", a);
2001
- }, [r, i]);
2136
+ return window.addEventListener("keydown", s), () => window.removeEventListener("keydown", s);
2137
+ }, [r, o]);
2002
2138
  }
2003
- const Fo = "review_layer:v1:";
2004
- function No(r, t) {
2005
- if (r == null) return t;
2139
+ const Ut = "review_layer:v1:";
2140
+ function Yt(r, n) {
2141
+ if (r == null) return n;
2006
2142
  try {
2007
- return JSON.parse(r) ?? t;
2143
+ return JSON.parse(r) ?? n;
2008
2144
  } catch {
2009
- return t;
2145
+ return n;
2010
2146
  }
2011
2147
  }
2012
- function Se(r, t, o, i) {
2013
- const a = `${Fo}${$o(r)}:${o}`;
2014
- return i != null ? `${a}:${i}` : a;
2148
+ function de(r, n, t, o) {
2149
+ const s = `${Ut}${Ht(r)}:${t}`;
2150
+ return o != null ? `${s}:${o}` : s;
2015
2151
  }
2016
- function $o(r) {
2152
+ function Ht(r) {
2017
2153
  return r.replace(/\/+$/, "") || "/";
2018
2154
  }
2019
- function vr(r) {
2155
+ function Te(r) {
2020
2156
  if (typeof localStorage > "u") return null;
2021
- const t = localStorage.getItem(r);
2022
- return No(t, null);
2157
+ const n = localStorage.getItem(r);
2158
+ return Yt(n, null);
2023
2159
  }
2024
- function pr(r, t) {
2160
+ function yr(r, n) {
2025
2161
  if (!(typeof localStorage > "u"))
2026
2162
  try {
2027
- localStorage.setItem(r, JSON.stringify({ data: t, at: Date.now() }));
2163
+ localStorage.setItem(r, JSON.stringify({ data: n, at: Date.now() }));
2028
2164
  } catch {
2029
2165
  }
2030
2166
  }
2031
- function Le(r, t, o) {
2032
- const i = vr(Se(r, t, "comments", o));
2033
- return (i == null ? void 0 : i.data) ?? null;
2167
+ function Fe(r, n, t) {
2168
+ const o = Te(de(r, n, "comments", t));
2169
+ return (o == null ? void 0 : o.data) ?? null;
2034
2170
  }
2035
- function Mo(r, t, o, i) {
2036
- pr(Se(r, t, "comments", o), i);
2171
+ function Gt(r, n, t, o) {
2172
+ yr(de(r, n, "comments", t), o);
2037
2173
  }
2038
- function ar(r, t) {
2039
- const o = vr(Se(r, t, "reviewers"));
2040
- return (o == null ? void 0 : o.data) ?? null;
2174
+ function Ne(r, n) {
2175
+ const t = Te(de(r, n, "reviewers"));
2176
+ return (t == null ? void 0 : t.data) ?? null;
2041
2177
  }
2042
- function Wo(r, t, o) {
2043
- pr(Se(r, t, "reviewers"), o);
2178
+ function Xt(r, n, t) {
2179
+ yr(de(r, n, "reviewers"), t);
2044
2180
  }
2045
- const Bo = "https://review-layer-api.onrender.com/api";
2046
- function ur() {
2047
- return typeof window > "u" ? "/" : window.location.pathname || "/";
2181
+ function qt(r, n, t) {
2182
+ const o = Te(de(r, n, "comments", t));
2183
+ return (o == null ? void 0 : o.at) ?? null;
2048
2184
  }
2049
- const gr = Mr(null);
2050
- let ze = null;
2051
- function Go() {
2052
- const r = Wr(gr);
2185
+ function Jt(r, n) {
2186
+ const t = Te(de(r, n, "reviewers"));
2187
+ return (t == null ? void 0 : t.at) ?? null;
2188
+ }
2189
+ const Zt = "https://review-layer-api.onrender.com/api", mr = Hr(null);
2190
+ let $e = null;
2191
+ function eo() {
2192
+ const r = Gr(mr);
2053
2193
  if (!r)
2054
2194
  throw new Error("useReview must be used within ReviewProvider");
2055
2195
  return r;
2056
2196
  }
2057
- function Ho({
2197
+ const U = "[review-layer]", dr = 2500;
2198
+ function ro({
2058
2199
  children: r,
2059
- enabled: t = !0,
2060
- apiUrl: o,
2061
- apiKey: i
2200
+ enabled: n = !0,
2201
+ apiUrl: t,
2202
+ apiKey: o,
2203
+ getPageUrl: s
2062
2204
  }) {
2063
- const a = (o == null ? void 0 : o.trim()) || Bo, [s, p] = F(!1), [g, d] = F([]), [w, h] = F([]), [y, P] = F(!1);
2064
- Ao(t, s, p);
2065
- const k = j(
2066
- async (c) => {
2067
- if (!(!t || !a || !i))
2205
+ const i = (t == null ? void 0 : t.trim()) || Zt, [u, d] = W(!1), [f, g] = W([]), [y, S] = W([]), [m, A] = W(!1), z = ne(!1), M = ne(null), P = D(
2206
+ () => (s == null ? void 0 : s()) ?? br(),
2207
+ [s]
2208
+ );
2209
+ Bt(n, u, d);
2210
+ const $ = D(
2211
+ async (E) => {
2212
+ if (!n || !i || !o) {
2213
+ console.warn(U, "loadReviewers omitido: faltan enabled, apiUrl o apiKey", {
2214
+ enabled: n,
2215
+ apiUrl: i,
2216
+ hasApiKey: !!o
2217
+ });
2218
+ return;
2219
+ }
2220
+ const R = Jt(i, o);
2221
+ if (R != null && Date.now() - R < dr) {
2222
+ const V = Ne(i, o);
2223
+ if (V != null) {
2224
+ g(V);
2225
+ return;
2226
+ }
2227
+ }
2228
+ if (!z.current) {
2229
+ z.current = !0, console.log(U, "Cargando revisores...", { apiUrl: i });
2068
2230
  try {
2069
- const f = await qr(a, i, { signal: c });
2070
- c != null && c.aborted || (d(f), Wo(a, i, f));
2071
- } catch (f) {
2072
- if (f instanceof Error && f.name === "AbortError") return;
2073
- if (!(c != null && c.aborted)) {
2074
- const I = ar(a, i);
2075
- I != null && d(I);
2231
+ const V = await ot(i, o, { signal: E });
2232
+ E != null && E.aborted || (g(V), Xt(i, o, V), console.log(U, "Revisores cargados:", V.length));
2233
+ } catch (V) {
2234
+ if (V instanceof Error && V.name === "AbortError") return;
2235
+ if (!(E != null && E.aborted)) {
2236
+ console.error(U, "Error al cargar revisores:", V);
2237
+ const q = Ne(i, o);
2238
+ q != null && (g(q), console.log(U, "Usando revisores en caché:", q.length));
2076
2239
  }
2240
+ } finally {
2241
+ z.current = !1;
2077
2242
  }
2243
+ }
2078
2244
  },
2079
- [t, a, i]
2080
- ), V = j(
2081
- async (c) => {
2082
- if (!t || !a || !i) return;
2083
- const f = ur(), I = Le(a, i, f);
2084
- I != null && h(I);
2085
- try {
2086
- P(!1);
2087
- const N = await Qr(a, i, f, { signal: c });
2088
- c != null && c.aborted || (h(N), Mo(a, i, f, N));
2089
- } catch (N) {
2090
- if (N instanceof Error && N.name === "AbortError") return;
2091
- if (!(c != null && c.aborted)) {
2092
- P(!0);
2093
- const H = Le(a, i, f);
2094
- H != null && h(H);
2245
+ [n, i, o]
2246
+ ), v = D(
2247
+ async (E) => {
2248
+ if (!n || !i || !o) {
2249
+ console.warn(U, "loadComments omitido: faltan enabled, apiUrl o apiKey", {
2250
+ enabled: n,
2251
+ apiUrl: i,
2252
+ hasApiKey: !!o
2253
+ });
2254
+ return;
2255
+ }
2256
+ const R = P(), V = Fe(i, o, R);
2257
+ V != null && S(V);
2258
+ const q = qt(i, o, R);
2259
+ if (!(q != null && Date.now() - q < dr && V != null) && M.current !== R) {
2260
+ M.current = R, console.log(U, "Cargando comentarios...", { apiUrl: i, url: R });
2261
+ try {
2262
+ A(!1);
2263
+ const H = await it(i, o, R, { signal: E });
2264
+ E != null && E.aborted || (S(H), Gt(i, o, R, H), console.log(U, "Comentarios cargados:", H.length));
2265
+ } catch (H) {
2266
+ if (H instanceof Error && H.name === "AbortError") return;
2267
+ if (!(E != null && E.aborted)) {
2268
+ A(!0), console.error(U, "Error al cargar comentarios:", H);
2269
+ const Q = Fe(i, o, R);
2270
+ Q != null ? (S(Q), console.log(U, "Usando comentarios en caché:", Q.length)) : console.warn(U, "Sin caché de comentarios; la lista quedará vacía hasta que la API responda.");
2271
+ }
2272
+ } finally {
2273
+ M.current = null;
2095
2274
  }
2096
2275
  }
2097
2276
  },
2098
- [t, a, i]
2277
+ [n, i, o, P]
2099
2278
  );
2100
- A(() => {
2101
- if (!t || !a || !i) return;
2102
- const c = ur(), f = ar(a, i), I = Le(a, i, c);
2103
- f != null && d(f), I != null && h(I);
2104
- }, [t, a, i]), A(() => {
2279
+ L(() => {
2280
+ if (!n || !i || !o) {
2281
+ console.warn(U, "Provider activo pero sin carga: enabled, apiUrl y apiKey son requeridos.", {
2282
+ enabled: n,
2283
+ apiUrl: i,
2284
+ hasApiKey: !!o
2285
+ });
2286
+ return;
2287
+ }
2288
+ const E = P(), R = Ne(i, o), V = Fe(i, o, E);
2289
+ R != null && (g(R), console.log(U, "Revisores desde caché (inicial):", R.length)), V != null && (S(V), console.log(U, "Comentarios desde caché (inicial):", V.length, { url: E }));
2290
+ }, [n, i, o, P]), L(() => {
2105
2291
  if (typeof document > "u") return;
2106
- const c = "review-layer-ui-variables";
2107
- if (!document.getElementById(c)) {
2108
- const f = document.createElement("style");
2109
- f.id = c, f.textContent = zo, document.head.appendChild(f);
2110
- }
2111
- }, []), A(() => {
2112
- if (!t || !a || !i) return;
2113
- const c = `${a}:${i}`;
2114
- if (ze !== c)
2115
- return ze = c, k(), V(), () => {
2292
+ const E = "review-layer-ui-variables";
2293
+ if (!document.getElementById(E)) {
2294
+ const R = document.createElement("style");
2295
+ R.id = E, R.textContent = Wt, document.head.appendChild(R);
2296
+ }
2297
+ }, []), L(() => {
2298
+ if (!n || !i || !o) return;
2299
+ const E = `${i}:${o}`;
2300
+ if ($e !== E)
2301
+ return $e = E, console.log(U, "Inicio de carga (revisores + comentarios)", { apiUrl: i, apiKey: o ? "***" : "(vacío)" }), $(), v(), () => {
2116
2302
  setTimeout(() => {
2117
- ze = null;
2303
+ $e = null;
2118
2304
  }, 0);
2119
2305
  };
2120
- }, [t, a, i, k, V]), A(() => {
2121
- if (!t) return;
2122
- const c = () => V();
2123
- return window.addEventListener("popstate", c), () => window.removeEventListener("popstate", c);
2124
- }, [t, V]);
2125
- const $ = Ne(
2306
+ }, [n, i, o, $, v]), L(() => {
2307
+ if (!n) return;
2308
+ const E = () => v();
2309
+ return window.addEventListener("popstate", E), () => window.removeEventListener("popstate", E);
2310
+ }, [n, v]);
2311
+ const k = Be(
2126
2312
  () => ({
2127
- apiUrl: a,
2128
- apiKey: i,
2129
- reviewMode: s,
2130
- setReviewMode: p,
2131
- reviewers: g,
2132
- comments: w,
2133
- loadComments: V,
2134
- commentsLoadFailed: y
2313
+ apiUrl: i,
2314
+ apiKey: o,
2315
+ reviewMode: u,
2316
+ setReviewMode: d,
2317
+ reviewers: f,
2318
+ comments: y,
2319
+ loadComments: v,
2320
+ commentsLoadFailed: m
2135
2321
  }),
2136
- [a, i, s, p, g, w, V, y]
2137
- ), z = t && typeof document < "u" ? sr(
2138
- /* @__PURE__ */ l.jsx(
2139
- Lo,
2322
+ [i, o, u, d, f, y, v, m]
2323
+ ), Y = n && typeof document < "u" ? vr(
2324
+ /* @__PURE__ */ c.jsx(
2325
+ Mt,
2140
2326
  {
2141
- apiUrl: a,
2142
- apiKey: i,
2143
- reviewMode: s,
2144
- setReviewMode: p,
2145
- reviewers: g,
2146
- comments: w,
2147
- loadComments: V,
2148
- commentsLoadFailed: y
2327
+ apiUrl: i,
2328
+ apiKey: o,
2329
+ getPageUrl: P,
2330
+ reviewMode: u,
2331
+ setReviewMode: d,
2332
+ reviewers: f,
2333
+ comments: y,
2334
+ loadComments: v,
2335
+ commentsLoadFailed: m
2149
2336
  }
2150
2337
  ),
2151
2338
  document.body
2152
2339
  ) : null;
2153
- return /* @__PURE__ */ l.jsxs(gr.Provider, { value: $, children: [
2340
+ return /* @__PURE__ */ c.jsxs(mr.Provider, { value: k, children: [
2154
2341
  r,
2155
- z
2342
+ Y
2156
2343
  ] });
2157
2344
  }
2158
2345
  export {
2159
- Bo as DEFAULT_API_URL,
2160
- Ho as ReviewProvider,
2161
- Go as useReview
2346
+ Zt as DEFAULT_API_URL,
2347
+ ro as ReviewProvider,
2348
+ eo as useReview
2162
2349
  };
2163
2350
  //# sourceMappingURL=review-layer-react.js.map