@bitux/review-layer-react 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -21
- package/dist/ReviewProvider.d.ts +5 -2
- package/dist/index.d.ts +1 -1
- package/dist/review-layer-react.js +567 -565
- package/dist/review-layer-react.js.map +1 -1
- package/dist/review-layer-react.umd.cjs +10 -10
- package/dist/review-layer-react.umd.cjs.map +1 -1
- package/package.json +5 -6
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import Qe, { useState as
|
|
1
|
+
import Qe, { useState as A, useEffect as $, useCallback as L, useRef as ge, useMemo as Ot, createContext as It, useContext as Lt } from "react";
|
|
2
2
|
import { createPortal as Ke } from "react-dom";
|
|
3
|
-
var
|
|
3
|
+
var Pe = { exports: {} }, ue = {};
|
|
4
4
|
/**
|
|
5
5
|
* @license React
|
|
6
6
|
* react-jsx-runtime.production.min.js
|
|
@@ -10,19 +10,19 @@ var Te = { exports: {} }, ue = {};
|
|
|
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
|
|
13
|
+
var Xe;
|
|
14
14
|
function At() {
|
|
15
|
-
if (
|
|
16
|
-
|
|
17
|
-
var t = Qe, o = Symbol.for("react.element"),
|
|
18
|
-
function
|
|
19
|
-
var
|
|
20
|
-
|
|
21
|
-
for (
|
|
22
|
-
if (
|
|
23
|
-
return { $$typeof: o, type:
|
|
15
|
+
if (Xe) return ue;
|
|
16
|
+
Xe = 1;
|
|
17
|
+
var t = Qe, o = Symbol.for("react.element"), n = Symbol.for("react.fragment"), i = Object.prototype.hasOwnProperty, a = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, d = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
18
|
+
function g(p, m, R) {
|
|
19
|
+
var h, C = {}, w = null, O = null;
|
|
20
|
+
R !== void 0 && (w = "" + R), m.key !== void 0 && (w = "" + m.key), m.ref !== void 0 && (O = m.ref);
|
|
21
|
+
for (h in m) i.call(m, h) && !d.hasOwnProperty(h) && (C[h] = m[h]);
|
|
22
|
+
if (p && p.defaultProps) for (h in m = p.defaultProps, m) C[h] === void 0 && (C[h] = m[h]);
|
|
23
|
+
return { $$typeof: o, type: p, key: w, ref: O, props: C, _owner: a.current };
|
|
24
24
|
}
|
|
25
|
-
return ue.Fragment =
|
|
25
|
+
return ue.Fragment = n, ue.jsx = g, ue.jsxs = g, ue;
|
|
26
26
|
}
|
|
27
27
|
var ce = {};
|
|
28
28
|
/**
|
|
@@ -34,49 +34,49 @@ var ce = {};
|
|
|
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
|
|
37
|
+
var Ge;
|
|
38
38
|
function Ft() {
|
|
39
|
-
return
|
|
40
|
-
var t = Qe, o = Symbol.for("react.element"),
|
|
41
|
-
function
|
|
39
|
+
return Ge || (Ge = 1, process.env.NODE_ENV !== "production" && function() {
|
|
40
|
+
var t = Qe, o = Symbol.for("react.element"), n = Symbol.for("react.portal"), i = Symbol.for("react.fragment"), a = Symbol.for("react.strict_mode"), d = Symbol.for("react.profiler"), g = Symbol.for("react.provider"), p = Symbol.for("react.context"), m = Symbol.for("react.forward_ref"), R = Symbol.for("react.suspense"), h = Symbol.for("react.suspense_list"), C = Symbol.for("react.memo"), w = Symbol.for("react.lazy"), O = Symbol.for("react.offscreen"), _ = Symbol.iterator, I = "@@iterator";
|
|
41
|
+
function z(e) {
|
|
42
42
|
if (e === null || typeof e != "object")
|
|
43
43
|
return null;
|
|
44
|
-
var
|
|
45
|
-
return typeof
|
|
44
|
+
var r = _ && e[_] || e[I];
|
|
45
|
+
return typeof r == "function" ? r : null;
|
|
46
46
|
}
|
|
47
|
-
var
|
|
48
|
-
function
|
|
47
|
+
var u = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
48
|
+
function f(e) {
|
|
49
49
|
{
|
|
50
|
-
for (var
|
|
51
|
-
|
|
52
|
-
|
|
50
|
+
for (var r = arguments.length, s = new Array(r > 1 ? r - 1 : 0), c = 1; c < r; c++)
|
|
51
|
+
s[c - 1] = arguments[c];
|
|
52
|
+
k("error", e, s);
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
|
-
function
|
|
55
|
+
function k(e, r, s) {
|
|
56
56
|
{
|
|
57
|
-
var
|
|
58
|
-
|
|
59
|
-
var
|
|
60
|
-
return String(
|
|
57
|
+
var c = u.ReactDebugCurrentFrame, E = c.getStackAddendum();
|
|
58
|
+
E !== "" && (r += "%s", s = s.concat([E]));
|
|
59
|
+
var b = s.map(function(y) {
|
|
60
|
+
return String(y);
|
|
61
61
|
});
|
|
62
|
-
|
|
62
|
+
b.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, b);
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
|
-
var
|
|
65
|
+
var U = !1, X = !1, K = !1, S = !1, j = !1, M;
|
|
66
66
|
M = Symbol.for("react.module.reference");
|
|
67
67
|
function W(e) {
|
|
68
|
-
return !!(typeof e == "string" || typeof e == "function" || e === i || e ===
|
|
68
|
+
return !!(typeof e == "string" || typeof e == "function" || e === i || e === d || j || e === a || e === R || e === h || S || e === O || U || X || K || typeof e == "object" && e !== null && (e.$$typeof === w || e.$$typeof === C || e.$$typeof === g || e.$$typeof === p || e.$$typeof === m || // 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
72
|
e.$$typeof === M || e.getModuleId !== void 0));
|
|
73
73
|
}
|
|
74
|
-
function re(e,
|
|
75
|
-
var
|
|
76
|
-
if (
|
|
77
|
-
return
|
|
78
|
-
var
|
|
79
|
-
return
|
|
74
|
+
function re(e, r, s) {
|
|
75
|
+
var c = e.displayName;
|
|
76
|
+
if (c)
|
|
77
|
+
return c;
|
|
78
|
+
var E = r.displayName || r.name || "";
|
|
79
|
+
return E !== "" ? s + "(" + E + ")" : s;
|
|
80
80
|
}
|
|
81
81
|
function G(e) {
|
|
82
82
|
return e.displayName || "Context";
|
|
@@ -84,41 +84,41 @@ function Ft() {
|
|
|
84
84
|
function V(e) {
|
|
85
85
|
if (e == null)
|
|
86
86
|
return null;
|
|
87
|
-
if (typeof e.tag == "number" &&
|
|
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")
|
|
88
88
|
return e.displayName || e.name || null;
|
|
89
89
|
if (typeof e == "string")
|
|
90
90
|
return e;
|
|
91
91
|
switch (e) {
|
|
92
92
|
case i:
|
|
93
93
|
return "Fragment";
|
|
94
|
-
case
|
|
94
|
+
case n:
|
|
95
95
|
return "Portal";
|
|
96
|
-
case
|
|
96
|
+
case d:
|
|
97
97
|
return "Profiler";
|
|
98
|
-
case
|
|
98
|
+
case a:
|
|
99
99
|
return "StrictMode";
|
|
100
|
-
case
|
|
100
|
+
case R:
|
|
101
101
|
return "Suspense";
|
|
102
|
-
case
|
|
102
|
+
case h:
|
|
103
103
|
return "SuspenseList";
|
|
104
104
|
}
|
|
105
105
|
if (typeof e == "object")
|
|
106
106
|
switch (e.$$typeof) {
|
|
107
|
-
case
|
|
108
|
-
var
|
|
109
|
-
return G(
|
|
110
|
-
case
|
|
111
|
-
var
|
|
112
|
-
return G(
|
|
113
|
-
case
|
|
107
|
+
case p:
|
|
108
|
+
var r = e;
|
|
109
|
+
return G(r) + ".Consumer";
|
|
110
|
+
case g:
|
|
111
|
+
var s = e;
|
|
112
|
+
return G(s._context) + ".Provider";
|
|
113
|
+
case m:
|
|
114
114
|
return re(e, e.render, "ForwardRef");
|
|
115
|
-
case
|
|
116
|
-
var
|
|
117
|
-
return
|
|
118
|
-
case
|
|
119
|
-
var
|
|
115
|
+
case C:
|
|
116
|
+
var c = e.displayName || null;
|
|
117
|
+
return c !== null ? c : V(e.type) || "Memo";
|
|
118
|
+
case w: {
|
|
119
|
+
var E = e, b = E._payload, y = E._init;
|
|
120
120
|
try {
|
|
121
|
-
return V(
|
|
121
|
+
return V(y(b));
|
|
122
122
|
} catch {
|
|
123
123
|
return null;
|
|
124
124
|
}
|
|
@@ -185,18 +185,18 @@ function Ft() {
|
|
|
185
185
|
})
|
|
186
186
|
});
|
|
187
187
|
}
|
|
188
|
-
J < 0 &&
|
|
188
|
+
J < 0 && f("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
189
189
|
}
|
|
190
190
|
}
|
|
191
|
-
var xe =
|
|
192
|
-
function fe(e,
|
|
191
|
+
var xe = u.ReactCurrentDispatcher, Ee;
|
|
192
|
+
function fe(e, r, s) {
|
|
193
193
|
{
|
|
194
194
|
if (Ee === void 0)
|
|
195
195
|
try {
|
|
196
196
|
throw Error();
|
|
197
|
-
} catch (
|
|
198
|
-
var
|
|
199
|
-
Ee =
|
|
197
|
+
} catch (E) {
|
|
198
|
+
var c = E.stack.trim().match(/\n( *(at )?)/);
|
|
199
|
+
Ee = c && c[1] || "";
|
|
200
200
|
}
|
|
201
201
|
return `
|
|
202
202
|
` + Ee + e;
|
|
@@ -207,85 +207,85 @@ function Ft() {
|
|
|
207
207
|
var st = typeof WeakMap == "function" ? WeakMap : Map;
|
|
208
208
|
pe = new st();
|
|
209
209
|
}
|
|
210
|
-
function Oe(e,
|
|
210
|
+
function Oe(e, r) {
|
|
211
211
|
if (!e || we)
|
|
212
212
|
return "";
|
|
213
213
|
{
|
|
214
|
-
var
|
|
215
|
-
if (
|
|
216
|
-
return
|
|
214
|
+
var s = pe.get(e);
|
|
215
|
+
if (s !== void 0)
|
|
216
|
+
return s;
|
|
217
217
|
}
|
|
218
|
-
var
|
|
218
|
+
var c;
|
|
219
219
|
we = !0;
|
|
220
|
-
var
|
|
220
|
+
var E = Error.prepareStackTrace;
|
|
221
221
|
Error.prepareStackTrace = void 0;
|
|
222
|
-
var
|
|
223
|
-
|
|
222
|
+
var b;
|
|
223
|
+
b = xe.current, xe.current = null, it();
|
|
224
224
|
try {
|
|
225
|
-
if (
|
|
226
|
-
var
|
|
225
|
+
if (r) {
|
|
226
|
+
var y = function() {
|
|
227
227
|
throw Error();
|
|
228
228
|
};
|
|
229
|
-
if (Object.defineProperty(
|
|
229
|
+
if (Object.defineProperty(y.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(
|
|
236
|
-
} catch (
|
|
237
|
-
|
|
235
|
+
Reflect.construct(y, []);
|
|
236
|
+
} catch (N) {
|
|
237
|
+
c = N;
|
|
238
238
|
}
|
|
239
|
-
Reflect.construct(e, [],
|
|
239
|
+
Reflect.construct(e, [], y);
|
|
240
240
|
} else {
|
|
241
241
|
try {
|
|
242
|
-
|
|
243
|
-
} catch (
|
|
244
|
-
|
|
242
|
+
y.call();
|
|
243
|
+
} catch (N) {
|
|
244
|
+
c = N;
|
|
245
245
|
}
|
|
246
|
-
e.call(
|
|
246
|
+
e.call(y.prototype);
|
|
247
247
|
}
|
|
248
248
|
} else {
|
|
249
249
|
try {
|
|
250
250
|
throw Error();
|
|
251
|
-
} catch (
|
|
252
|
-
|
|
251
|
+
} catch (N) {
|
|
252
|
+
c = N;
|
|
253
253
|
}
|
|
254
254
|
e();
|
|
255
255
|
}
|
|
256
|
-
} catch (
|
|
257
|
-
if (
|
|
258
|
-
for (var
|
|
259
|
-
`),
|
|
260
|
-
`), T =
|
|
261
|
-
|
|
262
|
-
for (; T >= 1 &&
|
|
263
|
-
if (
|
|
264
|
-
if (T !== 1 ||
|
|
256
|
+
} catch (N) {
|
|
257
|
+
if (N && c && typeof N.stack == "string") {
|
|
258
|
+
for (var v = N.stack.split(`
|
|
259
|
+
`), F = c.stack.split(`
|
|
260
|
+
`), T = v.length - 1, P = F.length - 1; T >= 1 && P >= 0 && v[T] !== F[P]; )
|
|
261
|
+
P--;
|
|
262
|
+
for (; T >= 1 && P >= 0; T--, P--)
|
|
263
|
+
if (v[T] !== F[P]) {
|
|
264
|
+
if (T !== 1 || P !== 1)
|
|
265
265
|
do
|
|
266
|
-
if (T--,
|
|
266
|
+
if (T--, P--, P < 0 || v[T] !== F[P]) {
|
|
267
267
|
var Y = `
|
|
268
|
-
` +
|
|
268
|
+
` + v[T].replace(" at new ", " at ");
|
|
269
269
|
return e.displayName && Y.includes("<anonymous>") && (Y = Y.replace("<anonymous>", e.displayName)), typeof e == "function" && pe.set(e, Y), Y;
|
|
270
270
|
}
|
|
271
|
-
while (T >= 1 &&
|
|
271
|
+
while (T >= 1 && P >= 0);
|
|
272
272
|
break;
|
|
273
273
|
}
|
|
274
274
|
}
|
|
275
275
|
} finally {
|
|
276
|
-
we = !1, xe.current =
|
|
276
|
+
we = !1, xe.current = b, at(), Error.prepareStackTrace = E;
|
|
277
277
|
}
|
|
278
|
-
var
|
|
279
|
-
return typeof e == "function" && pe.set(e,
|
|
278
|
+
var te = e ? e.displayName || e.name : "", Z = te ? fe(te) : "";
|
|
279
|
+
return typeof e == "function" && pe.set(e, Z), Z;
|
|
280
280
|
}
|
|
281
|
-
function lt(e,
|
|
281
|
+
function lt(e, r, s) {
|
|
282
282
|
return Oe(e, !1);
|
|
283
283
|
}
|
|
284
284
|
function ut(e) {
|
|
285
|
-
var
|
|
286
|
-
return !!(
|
|
285
|
+
var r = e.prototype;
|
|
286
|
+
return !!(r && r.isReactComponent);
|
|
287
287
|
}
|
|
288
|
-
function he(e,
|
|
288
|
+
function he(e, r, s) {
|
|
289
289
|
if (e == null)
|
|
290
290
|
return "";
|
|
291
291
|
if (typeof e == "function")
|
|
@@ -293,51 +293,51 @@ function Ft() {
|
|
|
293
293
|
if (typeof e == "string")
|
|
294
294
|
return fe(e);
|
|
295
295
|
switch (e) {
|
|
296
|
-
case
|
|
296
|
+
case R:
|
|
297
297
|
return fe("Suspense");
|
|
298
|
-
case
|
|
298
|
+
case h:
|
|
299
299
|
return fe("SuspenseList");
|
|
300
300
|
}
|
|
301
301
|
if (typeof e == "object")
|
|
302
302
|
switch (e.$$typeof) {
|
|
303
|
-
case
|
|
303
|
+
case m:
|
|
304
304
|
return lt(e.render);
|
|
305
|
-
case
|
|
306
|
-
return he(e.type,
|
|
307
|
-
case
|
|
308
|
-
var
|
|
305
|
+
case C:
|
|
306
|
+
return he(e.type, r, s);
|
|
307
|
+
case w: {
|
|
308
|
+
var c = e, E = c._payload, b = c._init;
|
|
309
309
|
try {
|
|
310
|
-
return he(
|
|
310
|
+
return he(b(E), r, s);
|
|
311
311
|
} catch {
|
|
312
312
|
}
|
|
313
313
|
}
|
|
314
314
|
}
|
|
315
315
|
return "";
|
|
316
316
|
}
|
|
317
|
-
var le = Object.prototype.hasOwnProperty, Ie = {}, Le =
|
|
317
|
+
var le = Object.prototype.hasOwnProperty, Ie = {}, Le = u.ReactDebugCurrentFrame;
|
|
318
318
|
function ve(e) {
|
|
319
319
|
if (e) {
|
|
320
|
-
var
|
|
321
|
-
Le.setExtraStackFrame(
|
|
320
|
+
var r = e._owner, s = he(e.type, e._source, r ? r.type : null);
|
|
321
|
+
Le.setExtraStackFrame(s);
|
|
322
322
|
} else
|
|
323
323
|
Le.setExtraStackFrame(null);
|
|
324
324
|
}
|
|
325
|
-
function ct(e,
|
|
325
|
+
function ct(e, r, s, c, E) {
|
|
326
326
|
{
|
|
327
|
-
var
|
|
328
|
-
for (var
|
|
329
|
-
if (
|
|
330
|
-
var
|
|
327
|
+
var b = Function.call.bind(le);
|
|
328
|
+
for (var y in e)
|
|
329
|
+
if (b(e, y)) {
|
|
330
|
+
var v = void 0;
|
|
331
331
|
try {
|
|
332
|
-
if (typeof e[
|
|
333
|
-
var
|
|
334
|
-
throw
|
|
332
|
+
if (typeof e[y] != "function") {
|
|
333
|
+
var F = Error((c || "React class") + ": " + s + " type `" + y + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[y] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
334
|
+
throw F.name = "Invariant Violation", F;
|
|
335
335
|
}
|
|
336
|
-
|
|
336
|
+
v = e[y](r, y, c, s, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
337
337
|
} catch (T) {
|
|
338
|
-
|
|
338
|
+
v = T;
|
|
339
339
|
}
|
|
340
|
-
|
|
340
|
+
v && !(v instanceof Error) && (ve(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).", c || "React class", s, y, typeof v), ve(null)), v instanceof Error && !(v.message in Ie) && (Ie[v.message] = !0, ve(E), f("Failed %s type: %s", s, v.message), ve(null));
|
|
341
341
|
}
|
|
342
342
|
}
|
|
343
343
|
}
|
|
@@ -347,8 +347,8 @@ function Ft() {
|
|
|
347
347
|
}
|
|
348
348
|
function ft(e) {
|
|
349
349
|
{
|
|
350
|
-
var
|
|
351
|
-
return
|
|
350
|
+
var r = typeof Symbol == "function" && Symbol.toStringTag, s = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
351
|
+
return s;
|
|
352
352
|
}
|
|
353
353
|
}
|
|
354
354
|
function pt(e) {
|
|
@@ -363,9 +363,9 @@ function Ft() {
|
|
|
363
363
|
}
|
|
364
364
|
function Fe(e) {
|
|
365
365
|
if (pt(e))
|
|
366
|
-
return
|
|
366
|
+
return f("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", ft(e)), Ae(e);
|
|
367
367
|
}
|
|
368
|
-
var $e =
|
|
368
|
+
var $e = u.ReactCurrentOwner, ht = {
|
|
369
369
|
key: !0,
|
|
370
370
|
ref: !0,
|
|
371
371
|
__self: !0,
|
|
@@ -373,97 +373,97 @@ function Ft() {
|
|
|
373
373
|
}, Ne, ze;
|
|
374
374
|
function vt(e) {
|
|
375
375
|
if (le.call(e, "ref")) {
|
|
376
|
-
var
|
|
377
|
-
if (
|
|
376
|
+
var r = Object.getOwnPropertyDescriptor(e, "ref").get;
|
|
377
|
+
if (r && r.isReactWarning)
|
|
378
378
|
return !1;
|
|
379
379
|
}
|
|
380
380
|
return e.ref !== void 0;
|
|
381
381
|
}
|
|
382
382
|
function gt(e) {
|
|
383
383
|
if (le.call(e, "key")) {
|
|
384
|
-
var
|
|
385
|
-
if (
|
|
384
|
+
var r = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
385
|
+
if (r && r.isReactWarning)
|
|
386
386
|
return !1;
|
|
387
387
|
}
|
|
388
388
|
return e.key !== void 0;
|
|
389
389
|
}
|
|
390
|
-
function yt(e,
|
|
390
|
+
function yt(e, r) {
|
|
391
391
|
typeof e.ref == "string" && $e.current;
|
|
392
392
|
}
|
|
393
|
-
function mt(e,
|
|
393
|
+
function mt(e, r) {
|
|
394
394
|
{
|
|
395
|
-
var
|
|
396
|
-
Ne || (Ne = !0,
|
|
395
|
+
var s = function() {
|
|
396
|
+
Ne || (Ne = !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)", r));
|
|
397
397
|
};
|
|
398
|
-
|
|
399
|
-
get:
|
|
398
|
+
s.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
399
|
+
get: s,
|
|
400
400
|
configurable: !0
|
|
401
401
|
});
|
|
402
402
|
}
|
|
403
403
|
}
|
|
404
|
-
function xt(e,
|
|
404
|
+
function xt(e, r) {
|
|
405
405
|
{
|
|
406
|
-
var
|
|
407
|
-
ze || (ze = !0,
|
|
406
|
+
var s = function() {
|
|
407
|
+
ze || (ze = !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)", r));
|
|
408
408
|
};
|
|
409
|
-
|
|
410
|
-
get:
|
|
409
|
+
s.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
410
|
+
get: s,
|
|
411
411
|
configurable: !0
|
|
412
412
|
});
|
|
413
413
|
}
|
|
414
414
|
}
|
|
415
|
-
var Et = function(e,
|
|
416
|
-
var
|
|
415
|
+
var Et = function(e, r, s, c, E, b, y) {
|
|
416
|
+
var v = {
|
|
417
417
|
// This tag allows us to uniquely identify this as a React Element
|
|
418
418
|
$$typeof: o,
|
|
419
419
|
// Built-in properties that belong on the element
|
|
420
420
|
type: e,
|
|
421
|
-
key:
|
|
422
|
-
ref:
|
|
423
|
-
props:
|
|
421
|
+
key: r,
|
|
422
|
+
ref: s,
|
|
423
|
+
props: y,
|
|
424
424
|
// Record the component responsible for creating this element.
|
|
425
|
-
_owner:
|
|
425
|
+
_owner: b
|
|
426
426
|
};
|
|
427
|
-
return
|
|
427
|
+
return v._store = {}, Object.defineProperty(v._store, "validated", {
|
|
428
428
|
configurable: !1,
|
|
429
429
|
enumerable: !1,
|
|
430
430
|
writable: !0,
|
|
431
431
|
value: !1
|
|
432
|
-
}), Object.defineProperty(
|
|
432
|
+
}), Object.defineProperty(v, "_self", {
|
|
433
433
|
configurable: !1,
|
|
434
434
|
enumerable: !1,
|
|
435
435
|
writable: !1,
|
|
436
|
-
value:
|
|
437
|
-
}), Object.defineProperty(
|
|
436
|
+
value: c
|
|
437
|
+
}), Object.defineProperty(v, "_source", {
|
|
438
438
|
configurable: !1,
|
|
439
439
|
enumerable: !1,
|
|
440
440
|
writable: !1,
|
|
441
|
-
value:
|
|
442
|
-
}), Object.freeze && (Object.freeze(
|
|
441
|
+
value: E
|
|
442
|
+
}), Object.freeze && (Object.freeze(v.props), Object.freeze(v)), v;
|
|
443
443
|
};
|
|
444
|
-
function wt(e,
|
|
444
|
+
function wt(e, r, s, c, E) {
|
|
445
445
|
{
|
|
446
|
-
var
|
|
447
|
-
|
|
448
|
-
for (
|
|
449
|
-
le.call(
|
|
446
|
+
var b, y = {}, v = null, F = null;
|
|
447
|
+
s !== void 0 && (Fe(s), v = "" + s), gt(r) && (Fe(r.key), v = "" + r.key), vt(r) && (F = r.ref, yt(r, E));
|
|
448
|
+
for (b in r)
|
|
449
|
+
le.call(r, b) && !ht.hasOwnProperty(b) && (y[b] = r[b]);
|
|
450
450
|
if (e && e.defaultProps) {
|
|
451
451
|
var T = e.defaultProps;
|
|
452
|
-
for (
|
|
453
|
-
|
|
452
|
+
for (b in T)
|
|
453
|
+
y[b] === void 0 && (y[b] = T[b]);
|
|
454
454
|
}
|
|
455
|
-
if (
|
|
456
|
-
var
|
|
457
|
-
|
|
455
|
+
if (v || F) {
|
|
456
|
+
var P = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
457
|
+
v && mt(y, P), F && xt(y, P);
|
|
458
458
|
}
|
|
459
|
-
return Et(e,
|
|
459
|
+
return Et(e, v, F, E, c, $e.current, y);
|
|
460
460
|
}
|
|
461
461
|
}
|
|
462
|
-
var Re =
|
|
463
|
-
function
|
|
462
|
+
var Re = u.ReactCurrentOwner, Me = u.ReactDebugCurrentFrame;
|
|
463
|
+
function ee(e) {
|
|
464
464
|
if (e) {
|
|
465
|
-
var
|
|
466
|
-
Me.setExtraStackFrame(
|
|
465
|
+
var r = e._owner, s = he(e.type, e._source, r ? r.type : null);
|
|
466
|
+
Me.setExtraStackFrame(s);
|
|
467
467
|
} else
|
|
468
468
|
Me.setExtraStackFrame(null);
|
|
469
469
|
}
|
|
@@ -490,173 +490,173 @@ Check the render method of \`` + e + "`.";
|
|
|
490
490
|
var Ve = {};
|
|
491
491
|
function Rt(e) {
|
|
492
492
|
{
|
|
493
|
-
var
|
|
494
|
-
if (!
|
|
495
|
-
var
|
|
496
|
-
|
|
493
|
+
var r = We();
|
|
494
|
+
if (!r) {
|
|
495
|
+
var s = typeof e == "string" ? e : e.displayName || e.name;
|
|
496
|
+
s && (r = `
|
|
497
497
|
|
|
498
|
-
Check the top-level render call using <` +
|
|
498
|
+
Check the top-level render call using <` + s + ">.");
|
|
499
499
|
}
|
|
500
|
-
return
|
|
500
|
+
return r;
|
|
501
501
|
}
|
|
502
502
|
}
|
|
503
|
-
function Be(e,
|
|
503
|
+
function Be(e, r) {
|
|
504
504
|
{
|
|
505
505
|
if (!e._store || e._store.validated || e.key != null)
|
|
506
506
|
return;
|
|
507
507
|
e._store.validated = !0;
|
|
508
|
-
var
|
|
509
|
-
if (Ve[
|
|
508
|
+
var s = Rt(r);
|
|
509
|
+
if (Ve[s])
|
|
510
510
|
return;
|
|
511
|
-
Ve[
|
|
512
|
-
var
|
|
513
|
-
e && e._owner && e._owner !== Re.current && (
|
|
511
|
+
Ve[s] = !0;
|
|
512
|
+
var c = "";
|
|
513
|
+
e && e._owner && e._owner !== Re.current && (c = " It was passed a child from " + V(e._owner.type) + "."), ee(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.', s, c), ee(null);
|
|
514
514
|
}
|
|
515
515
|
}
|
|
516
|
-
function Ye(e,
|
|
516
|
+
function Ye(e, r) {
|
|
517
517
|
{
|
|
518
518
|
if (typeof e != "object")
|
|
519
519
|
return;
|
|
520
520
|
if (be(e))
|
|
521
|
-
for (var
|
|
522
|
-
var
|
|
523
|
-
Ce(
|
|
521
|
+
for (var s = 0; s < e.length; s++) {
|
|
522
|
+
var c = e[s];
|
|
523
|
+
Ce(c) && Be(c, r);
|
|
524
524
|
}
|
|
525
525
|
else if (Ce(e))
|
|
526
526
|
e._store && (e._store.validated = !0);
|
|
527
527
|
else if (e) {
|
|
528
|
-
var
|
|
529
|
-
if (typeof
|
|
530
|
-
for (var
|
|
531
|
-
Ce(
|
|
528
|
+
var E = z(e);
|
|
529
|
+
if (typeof E == "function" && E !== e.entries)
|
|
530
|
+
for (var b = E.call(e), y; !(y = b.next()).done; )
|
|
531
|
+
Ce(y.value) && Be(y.value, r);
|
|
532
532
|
}
|
|
533
533
|
}
|
|
534
534
|
}
|
|
535
535
|
function St(e) {
|
|
536
536
|
{
|
|
537
|
-
var
|
|
538
|
-
if (
|
|
537
|
+
var r = e.type;
|
|
538
|
+
if (r == null || typeof r == "string")
|
|
539
539
|
return;
|
|
540
|
-
var
|
|
541
|
-
if (typeof
|
|
542
|
-
|
|
543
|
-
else if (typeof
|
|
540
|
+
var s;
|
|
541
|
+
if (typeof r == "function")
|
|
542
|
+
s = r.propTypes;
|
|
543
|
+
else if (typeof r == "object" && (r.$$typeof === m || // Note: Memo only checks outer props here.
|
|
544
544
|
// Inner props are checked in the reconciler.
|
|
545
|
-
|
|
546
|
-
|
|
545
|
+
r.$$typeof === C))
|
|
546
|
+
s = r.propTypes;
|
|
547
547
|
else
|
|
548
548
|
return;
|
|
549
|
-
if (
|
|
550
|
-
var
|
|
551
|
-
ct(
|
|
552
|
-
} else if (
|
|
549
|
+
if (s) {
|
|
550
|
+
var c = V(r);
|
|
551
|
+
ct(s, e.props, "prop", c, e);
|
|
552
|
+
} else if (r.PropTypes !== void 0 && !Se) {
|
|
553
553
|
Se = !0;
|
|
554
|
-
var
|
|
555
|
-
|
|
554
|
+
var E = V(r);
|
|
555
|
+
f("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", E || "Unknown");
|
|
556
556
|
}
|
|
557
|
-
typeof
|
|
557
|
+
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && f("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
558
558
|
}
|
|
559
559
|
}
|
|
560
560
|
function Ct(e) {
|
|
561
561
|
{
|
|
562
|
-
for (var
|
|
563
|
-
var
|
|
564
|
-
if (
|
|
565
|
-
|
|
562
|
+
for (var r = Object.keys(e.props), s = 0; s < r.length; s++) {
|
|
563
|
+
var c = r[s];
|
|
564
|
+
if (c !== "children" && c !== "key") {
|
|
565
|
+
ee(e), f("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", c), ee(null);
|
|
566
566
|
break;
|
|
567
567
|
}
|
|
568
568
|
}
|
|
569
|
-
e.ref !== null && (
|
|
569
|
+
e.ref !== null && (ee(e), f("Invalid attribute `ref` supplied to `React.Fragment`."), ee(null));
|
|
570
570
|
}
|
|
571
571
|
}
|
|
572
|
-
var
|
|
573
|
-
function
|
|
572
|
+
var Ue = {};
|
|
573
|
+
function He(e, r, s, c, E, b) {
|
|
574
574
|
{
|
|
575
|
-
var
|
|
576
|
-
if (!
|
|
577
|
-
var
|
|
578
|
-
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (
|
|
579
|
-
var
|
|
580
|
-
|
|
575
|
+
var y = W(e);
|
|
576
|
+
if (!y) {
|
|
577
|
+
var v = "";
|
|
578
|
+
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (v += " 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 F = bt();
|
|
580
|
+
F ? v += F : v += We();
|
|
581
581
|
var T;
|
|
582
|
-
e === null ? T = "null" : be(e) ? T = "array" : e !== void 0 && e.$$typeof === o ? (T = "<" + (V(e.type) || "Unknown") + " />",
|
|
582
|
+
e === null ? T = "null" : be(e) ? T = "array" : e !== void 0 && e.$$typeof === o ? (T = "<" + (V(e.type) || "Unknown") + " />", v = " Did you accidentally export a JSX literal instead of a component?") : T = 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", T, v);
|
|
583
583
|
}
|
|
584
|
-
var
|
|
585
|
-
if (
|
|
586
|
-
return
|
|
587
|
-
if (
|
|
588
|
-
var Y =
|
|
584
|
+
var P = wt(e, r, s, E, b);
|
|
585
|
+
if (P == null)
|
|
586
|
+
return P;
|
|
587
|
+
if (y) {
|
|
588
|
+
var Y = r.children;
|
|
589
589
|
if (Y !== void 0)
|
|
590
|
-
if (
|
|
590
|
+
if (c)
|
|
591
591
|
if (be(Y)) {
|
|
592
|
-
for (var
|
|
593
|
-
Ye(Y[
|
|
592
|
+
for (var te = 0; te < Y.length; te++)
|
|
593
|
+
Ye(Y[te], e);
|
|
594
594
|
Object.freeze && Object.freeze(Y);
|
|
595
595
|
} else
|
|
596
|
-
|
|
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.");
|
|
597
597
|
else
|
|
598
598
|
Ye(Y, e);
|
|
599
599
|
}
|
|
600
|
-
if (le.call(
|
|
601
|
-
var
|
|
600
|
+
if (le.call(r, "key")) {
|
|
601
|
+
var Z = V(e), N = Object.keys(r).filter(function(Dt) {
|
|
602
602
|
return Dt !== "key";
|
|
603
|
-
}),
|
|
604
|
-
if (!
|
|
605
|
-
var kt =
|
|
606
|
-
|
|
603
|
+
}), _e = N.length > 0 ? "{key: someKey, " + N.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
604
|
+
if (!Ue[Z + _e]) {
|
|
605
|
+
var kt = N.length > 0 ? "{" + N.join(": ..., ") + ": ...}" : "{}";
|
|
606
|
+
f(`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} />`,
|
|
611
|
+
<%s key={someKey} {...props} />`, _e, Z, kt, Z), Ue[Z + _e] = !0;
|
|
612
612
|
}
|
|
613
613
|
}
|
|
614
|
-
return e === i ? Ct(
|
|
614
|
+
return e === i ? Ct(P) : St(P), P;
|
|
615
615
|
}
|
|
616
616
|
}
|
|
617
|
-
function
|
|
618
|
-
return
|
|
617
|
+
function _t(e, r, s) {
|
|
618
|
+
return He(e, r, s, !0);
|
|
619
619
|
}
|
|
620
|
-
function
|
|
621
|
-
return
|
|
620
|
+
function jt(e, r, s) {
|
|
621
|
+
return He(e, r, s, !1);
|
|
622
622
|
}
|
|
623
|
-
var
|
|
624
|
-
ce.Fragment = i, ce.jsx =
|
|
623
|
+
var Tt = jt, Pt = _t;
|
|
624
|
+
ce.Fragment = i, ce.jsx = Tt, ce.jsxs = Pt;
|
|
625
625
|
}()), ce;
|
|
626
626
|
}
|
|
627
|
-
process.env.NODE_ENV === "production" ?
|
|
628
|
-
var l =
|
|
627
|
+
process.env.NODE_ENV === "production" ? Pe.exports = At() : Pe.exports = Ft();
|
|
628
|
+
var l = Pe.exports;
|
|
629
629
|
function $t(t) {
|
|
630
630
|
if (t.id && /^[a-zA-Z][\w-]*$/.test(t.id))
|
|
631
631
|
return `#${t.id}`;
|
|
632
632
|
const o = [];
|
|
633
|
-
let
|
|
634
|
-
for (;
|
|
635
|
-
let i =
|
|
636
|
-
if (
|
|
637
|
-
o.unshift(`#${
|
|
633
|
+
let n = t;
|
|
634
|
+
for (; n && n.nodeType === Node.ELEMENT_NODE; ) {
|
|
635
|
+
let i = n.nodeName.toLowerCase();
|
|
636
|
+
if (n.id && /^[a-zA-Z][\w-]*$/.test(n.id)) {
|
|
637
|
+
o.unshift(`#${n.id}`);
|
|
638
638
|
break;
|
|
639
639
|
}
|
|
640
|
-
if (
|
|
641
|
-
const
|
|
642
|
-
if (
|
|
643
|
-
const
|
|
644
|
-
|
|
640
|
+
if (n.className && typeof n.className == "string") {
|
|
641
|
+
const a = n.className.trim().split(/\s+/).filter(Boolean);
|
|
642
|
+
if (a.length > 0) {
|
|
643
|
+
const d = a.filter((g) => /^[a-zA-Z][\w-]*$/.test(g)).slice(0, 2).map((g) => `.${g}`).join("");
|
|
644
|
+
d && (i += d);
|
|
645
645
|
}
|
|
646
646
|
}
|
|
647
647
|
if (o.length > 0) {
|
|
648
|
-
const
|
|
649
|
-
if (
|
|
650
|
-
const
|
|
651
|
-
(
|
|
648
|
+
const a = n.parentElement;
|
|
649
|
+
if (a) {
|
|
650
|
+
const d = Array.from(a.children).filter(
|
|
651
|
+
(g) => g.nodeName === n.nodeName
|
|
652
652
|
);
|
|
653
|
-
if (
|
|
654
|
-
const
|
|
655
|
-
i += `:nth-child(${
|
|
653
|
+
if (d.length > 1) {
|
|
654
|
+
const g = d.indexOf(n) + 1;
|
|
655
|
+
i += `:nth-child(${g})`;
|
|
656
656
|
}
|
|
657
657
|
}
|
|
658
658
|
}
|
|
659
|
-
o.unshift(i),
|
|
659
|
+
o.unshift(i), n = n.parentElement;
|
|
660
660
|
}
|
|
661
661
|
return o.join(" > ");
|
|
662
662
|
}
|
|
@@ -672,10 +672,10 @@ function et(t) {
|
|
|
672
672
|
function Nt(t) {
|
|
673
673
|
if (typeof window > "u")
|
|
674
674
|
return { relativeX: 0, relativeY: 0 };
|
|
675
|
-
const o = window.innerWidth,
|
|
675
|
+
const o = window.innerWidth, n = window.innerHeight;
|
|
676
676
|
return {
|
|
677
677
|
relativeX: o > 0 ? t.left / o : 0,
|
|
678
|
-
relativeY:
|
|
678
|
+
relativeY: n > 0 ? t.top / n : 0
|
|
679
679
|
};
|
|
680
680
|
}
|
|
681
681
|
function zt(t) {
|
|
@@ -684,10 +684,10 @@ function zt(t) {
|
|
|
684
684
|
x: t.x ?? 0,
|
|
685
685
|
y: t.y ?? 0
|
|
686
686
|
};
|
|
687
|
-
const o = t.relativeX ?? null,
|
|
688
|
-
return o != null &&
|
|
687
|
+
const o = t.relativeX ?? null, n = t.relativeY ?? null;
|
|
688
|
+
return o != null && n != null ? {
|
|
689
689
|
x: o * window.innerWidth,
|
|
690
|
-
y:
|
|
690
|
+
y: n * window.innerHeight
|
|
691
691
|
} : {
|
|
692
692
|
x: t.x ?? 0,
|
|
693
693
|
y: t.y ?? 0
|
|
@@ -712,62 +712,62 @@ function de(t) {
|
|
|
712
712
|
"x-review-key": t
|
|
713
713
|
};
|
|
714
714
|
}
|
|
715
|
-
async function Mt(t, o,
|
|
715
|
+
async function Mt(t, o, n) {
|
|
716
716
|
const i = await fetch(`${t}/reviewers`, {
|
|
717
717
|
headers: de(o),
|
|
718
|
-
signal:
|
|
718
|
+
signal: n == null ? void 0 : n.signal
|
|
719
719
|
});
|
|
720
720
|
if (!i.ok) throw new Error("Failed to fetch reviewers");
|
|
721
721
|
return (await i.json()).data ?? [];
|
|
722
722
|
}
|
|
723
|
-
async function Wt(t, o,
|
|
723
|
+
async function Wt(t, o, n) {
|
|
724
724
|
const i = await fetch(`${t}/comments`, {
|
|
725
725
|
method: "POST",
|
|
726
726
|
headers: de(o),
|
|
727
|
-
body: JSON.stringify(
|
|
727
|
+
body: JSON.stringify(n)
|
|
728
728
|
});
|
|
729
729
|
if (!i.ok) {
|
|
730
|
-
const
|
|
731
|
-
throw new Error(
|
|
730
|
+
const d = await i.json().catch(() => ({}));
|
|
731
|
+
throw new Error(d.message || "Failed to create comment");
|
|
732
732
|
}
|
|
733
733
|
return (await i.json()).data;
|
|
734
734
|
}
|
|
735
|
-
async function Vt(t, o,
|
|
736
|
-
const
|
|
735
|
+
async function Vt(t, o, n, i) {
|
|
736
|
+
const a = new URLSearchParams({ url: n }), d = await fetch(`${t}/comments?${a}`, {
|
|
737
737
|
headers: de(o),
|
|
738
738
|
signal: i == null ? void 0 : i.signal
|
|
739
739
|
});
|
|
740
|
-
if (!
|
|
741
|
-
return (await
|
|
740
|
+
if (!d.ok) throw new Error("Failed to fetch comments");
|
|
741
|
+
return (await d.json()).data ?? [];
|
|
742
742
|
}
|
|
743
|
-
async function Bt(t, o,
|
|
744
|
-
const
|
|
743
|
+
async function Bt(t, o, n, i) {
|
|
744
|
+
const a = await fetch(`${t}/comments/${n}/status`, {
|
|
745
745
|
method: "PATCH",
|
|
746
746
|
headers: de(o),
|
|
747
747
|
body: JSON.stringify({ status: i })
|
|
748
748
|
});
|
|
749
|
-
if (!
|
|
750
|
-
const
|
|
751
|
-
throw new Error(
|
|
749
|
+
if (!a.ok) {
|
|
750
|
+
const g = await a.json().catch(() => ({}));
|
|
751
|
+
throw new Error(g.message || "Failed to update comment status");
|
|
752
752
|
}
|
|
753
|
-
return (await
|
|
753
|
+
return (await a.json()).data;
|
|
754
754
|
}
|
|
755
|
-
async function Yt(t, o,
|
|
756
|
-
const i = await fetch(`${t}/comments/${
|
|
755
|
+
async function Yt(t, o, n) {
|
|
756
|
+
const i = await fetch(`${t}/comments/${n}`, {
|
|
757
757
|
method: "DELETE",
|
|
758
758
|
headers: de(o)
|
|
759
759
|
});
|
|
760
760
|
if (!i.ok) {
|
|
761
|
-
const
|
|
762
|
-
throw new Error(
|
|
761
|
+
const a = await i.json().catch(() => ({}));
|
|
762
|
+
throw new Error(a.message || "Failed to delete comment");
|
|
763
763
|
}
|
|
764
764
|
}
|
|
765
|
-
const
|
|
765
|
+
const Ut = {
|
|
766
766
|
position: "fixed",
|
|
767
767
|
inset: 0,
|
|
768
768
|
zIndex: 999997,
|
|
769
769
|
backgroundColor: "transparent"
|
|
770
|
-
},
|
|
770
|
+
}, Ht = {
|
|
771
771
|
position: "fixed",
|
|
772
772
|
minWidth: 320,
|
|
773
773
|
maxWidth: 400,
|
|
@@ -777,7 +777,7 @@ const Ht = {
|
|
|
777
777
|
borderRadius: 8,
|
|
778
778
|
boxShadow: "0 8px 24px rgba(0,0,0,0.15)",
|
|
779
779
|
zIndex: 999998
|
|
780
|
-
},
|
|
780
|
+
}, Xt = {
|
|
781
781
|
width: "100%",
|
|
782
782
|
minHeight: 80,
|
|
783
783
|
padding: "8px 12px",
|
|
@@ -787,14 +787,14 @@ const Ht = {
|
|
|
787
787
|
fontSize: 14,
|
|
788
788
|
resize: "vertical",
|
|
789
789
|
boxSizing: "border-box"
|
|
790
|
-
},
|
|
790
|
+
}, Gt = {
|
|
791
791
|
width: "100%",
|
|
792
792
|
padding: "8px 12px",
|
|
793
793
|
marginBottom: 12,
|
|
794
794
|
border: "1px solid #d9d9d9",
|
|
795
795
|
borderRadius: 6,
|
|
796
796
|
fontSize: 14
|
|
797
|
-
},
|
|
797
|
+
}, Jt = {
|
|
798
798
|
padding: "8px 16px",
|
|
799
799
|
backgroundColor: "#ff4d4f",
|
|
800
800
|
color: "#fff",
|
|
@@ -804,35 +804,35 @@ const Ht = {
|
|
|
804
804
|
cursor: "pointer",
|
|
805
805
|
fontWeight: 500
|
|
806
806
|
};
|
|
807
|
-
function
|
|
807
|
+
function qt({
|
|
808
808
|
apiUrl: t,
|
|
809
809
|
apiKey: o,
|
|
810
|
-
reviewers:
|
|
810
|
+
reviewers: n,
|
|
811
811
|
position: i,
|
|
812
|
-
payload:
|
|
813
|
-
onClose:
|
|
814
|
-
onSuccess:
|
|
812
|
+
payload: a,
|
|
813
|
+
onClose: d,
|
|
814
|
+
onSuccess: g
|
|
815
815
|
}) {
|
|
816
|
-
var
|
|
817
|
-
const [
|
|
818
|
-
((
|
|
819
|
-
), [
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
}, [
|
|
823
|
-
const
|
|
824
|
-
if (
|
|
825
|
-
|
|
816
|
+
var z;
|
|
817
|
+
const [p, m] = A(""), [R, h] = A(
|
|
818
|
+
((z = n[0]) == null ? void 0 : z.id) ?? 0
|
|
819
|
+
), [C, w] = A(!1), [O, _] = A(null);
|
|
820
|
+
$(() => {
|
|
821
|
+
n.length > 0 && !R && h(n[0].id);
|
|
822
|
+
}, [n, R]);
|
|
823
|
+
const I = async (u) => {
|
|
824
|
+
if (u.preventDefault(), !(!p.trim() || !R)) {
|
|
825
|
+
w(!0), _(null);
|
|
826
826
|
try {
|
|
827
827
|
await Wt(t, o, {
|
|
828
|
-
...
|
|
829
|
-
message:
|
|
830
|
-
reviewerId:
|
|
831
|
-
}),
|
|
832
|
-
} catch (
|
|
833
|
-
|
|
828
|
+
...a,
|
|
829
|
+
message: p.trim(),
|
|
830
|
+
reviewerId: R
|
|
831
|
+
}), g(), d();
|
|
832
|
+
} catch (f) {
|
|
833
|
+
_(f instanceof Error ? f.message : "Failed to send comment");
|
|
834
834
|
} finally {
|
|
835
|
-
|
|
835
|
+
w(!1);
|
|
836
836
|
}
|
|
837
837
|
}
|
|
838
838
|
};
|
|
@@ -841,28 +841,28 @@ function Ut({
|
|
|
841
841
|
"div",
|
|
842
842
|
{
|
|
843
843
|
role: "presentation",
|
|
844
|
-
style:
|
|
845
|
-
onClick:
|
|
846
|
-
onKeyDown: (
|
|
844
|
+
style: Ut,
|
|
845
|
+
onClick: d,
|
|
846
|
+
onKeyDown: (u) => u.key === "Escape" && d()
|
|
847
847
|
}
|
|
848
848
|
),
|
|
849
849
|
/* @__PURE__ */ l.jsx(
|
|
850
850
|
"div",
|
|
851
851
|
{
|
|
852
852
|
style: {
|
|
853
|
-
...
|
|
853
|
+
...Ht,
|
|
854
854
|
left: Math.min(i.x, typeof window < "u" ? window.innerWidth - 420 : i.x),
|
|
855
855
|
top: i.y + 12
|
|
856
856
|
},
|
|
857
|
-
onClick: (
|
|
858
|
-
children: /* @__PURE__ */ l.jsxs("form", { onSubmit:
|
|
857
|
+
onClick: (u) => u.stopPropagation(),
|
|
858
|
+
children: /* @__PURE__ */ l.jsxs("form", { onSubmit: I, children: [
|
|
859
859
|
/* @__PURE__ */ l.jsx(
|
|
860
860
|
"textarea",
|
|
861
861
|
{
|
|
862
862
|
placeholder: "Escribe tu comentario...",
|
|
863
|
-
value:
|
|
864
|
-
onChange: (
|
|
865
|
-
style:
|
|
863
|
+
value: p,
|
|
864
|
+
onChange: (u) => m(u.target.value),
|
|
865
|
+
style: Xt,
|
|
866
866
|
required: !0,
|
|
867
867
|
autoFocus: !0
|
|
868
868
|
}
|
|
@@ -870,18 +870,18 @@ function Ut({
|
|
|
870
870
|
/* @__PURE__ */ l.jsxs(
|
|
871
871
|
"select",
|
|
872
872
|
{
|
|
873
|
-
value:
|
|
874
|
-
onChange: (
|
|
875
|
-
style:
|
|
873
|
+
value: R,
|
|
874
|
+
onChange: (u) => h(Number(u.target.value)),
|
|
875
|
+
style: Gt,
|
|
876
876
|
required: !0,
|
|
877
|
-
disabled:
|
|
877
|
+
disabled: n.length === 0,
|
|
878
878
|
children: [
|
|
879
|
-
/* @__PURE__ */ l.jsx("option", { value: "", children:
|
|
880
|
-
|
|
879
|
+
/* @__PURE__ */ l.jsx("option", { value: "", children: n.length === 0 ? "No hay revisores (ejecuta php artisan db:seed en la API)" : "Selecciona revisor" }),
|
|
880
|
+
n.map((u) => /* @__PURE__ */ l.jsx("option", { value: u.id, children: u.name }, u.id))
|
|
881
881
|
]
|
|
882
882
|
}
|
|
883
883
|
),
|
|
884
|
-
|
|
884
|
+
O && /* @__PURE__ */ l.jsx(
|
|
885
885
|
"div",
|
|
886
886
|
{
|
|
887
887
|
style: {
|
|
@@ -889,16 +889,16 @@ function Ut({
|
|
|
889
889
|
fontSize: 12,
|
|
890
890
|
marginBottom: 8
|
|
891
891
|
},
|
|
892
|
-
children:
|
|
892
|
+
children: O
|
|
893
893
|
}
|
|
894
894
|
),
|
|
895
895
|
/* @__PURE__ */ l.jsx(
|
|
896
896
|
"button",
|
|
897
897
|
{
|
|
898
898
|
type: "submit",
|
|
899
|
-
style:
|
|
900
|
-
disabled:
|
|
901
|
-
children:
|
|
899
|
+
style: Jt,
|
|
900
|
+
disabled: C || n.length === 0,
|
|
901
|
+
children: C ? "Enviando..." : "Enviar comentario"
|
|
902
902
|
}
|
|
903
903
|
)
|
|
904
904
|
] })
|
|
@@ -915,36 +915,36 @@ const Zt = {
|
|
|
915
915
|
boxSizing: "border-box"
|
|
916
916
|
};
|
|
917
917
|
function Qt({ selector: t, active: o }) {
|
|
918
|
-
const [
|
|
918
|
+
const [n, i] = A(null), a = L(() => {
|
|
919
919
|
if (!o || !(t != null && t.trim())) {
|
|
920
920
|
i(null);
|
|
921
921
|
return;
|
|
922
922
|
}
|
|
923
|
-
const
|
|
924
|
-
i(
|
|
923
|
+
const d = et(t);
|
|
924
|
+
i(d);
|
|
925
925
|
}, [t, o]);
|
|
926
|
-
return
|
|
927
|
-
|
|
928
|
-
}, [
|
|
926
|
+
return $(() => {
|
|
927
|
+
a();
|
|
928
|
+
}, [a]), $(() => {
|
|
929
929
|
if (!(!o || !(t != null && t.trim())))
|
|
930
|
-
return window.addEventListener("scroll",
|
|
931
|
-
window.removeEventListener("scroll",
|
|
930
|
+
return window.addEventListener("scroll", a, !0), window.addEventListener("resize", a), () => {
|
|
931
|
+
window.removeEventListener("scroll", a, !0), window.removeEventListener("resize", a);
|
|
932
932
|
};
|
|
933
|
-
}, [o, t,
|
|
933
|
+
}, [o, t, a]), !o || n == null ? null : /* @__PURE__ */ l.jsx(
|
|
934
934
|
"div",
|
|
935
935
|
{
|
|
936
936
|
"aria-hidden": !0,
|
|
937
937
|
style: {
|
|
938
938
|
...Zt,
|
|
939
|
-
left:
|
|
940
|
-
top:
|
|
941
|
-
width:
|
|
942
|
-
height:
|
|
939
|
+
left: n.left,
|
|
940
|
+
top: n.top,
|
|
941
|
+
width: n.width,
|
|
942
|
+
height: n.height
|
|
943
943
|
}
|
|
944
944
|
}
|
|
945
945
|
);
|
|
946
946
|
}
|
|
947
|
-
const ke = 32,
|
|
947
|
+
const ke = 32, Je = 5e6, B = {
|
|
948
948
|
cardBg: "#ffffff",
|
|
949
949
|
textDark: "#333333",
|
|
950
950
|
textMuted: "#888888",
|
|
@@ -958,7 +958,7 @@ const ke = 32, qe = 5e6, B = {
|
|
|
958
958
|
[D.PENDING]: "PENDIENTE",
|
|
959
959
|
[D.DEV_FIXED]: "CORREGIDO DESARROLLO",
|
|
960
960
|
[D.VALIDATED]: "VALIDADO"
|
|
961
|
-
},
|
|
961
|
+
}, Q = {
|
|
962
962
|
[D.PENDING]: "rgb(240, 69, 69)",
|
|
963
963
|
[D.DEV_FIXED]: "rgb(235, 179, 8)",
|
|
964
964
|
[D.VALIDATED]: "rgb(33, 196, 94)"
|
|
@@ -993,7 +993,7 @@ const rr = () => /* @__PURE__ */ l.jsx("svg", { width: "12", height: "12", viewB
|
|
|
993
993
|
width: ke,
|
|
994
994
|
height: ke,
|
|
995
995
|
borderRadius: "50%",
|
|
996
|
-
backgroundColor:
|
|
996
|
+
backgroundColor: Q[t] ?? Q[D.PENDING],
|
|
997
997
|
color: "#fff",
|
|
998
998
|
display: "flex",
|
|
999
999
|
alignItems: "center",
|
|
@@ -1024,7 +1024,7 @@ const rr = () => /* @__PURE__ */ l.jsx("svg", { width: "12", height: "12", viewB
|
|
|
1024
1024
|
width: 40,
|
|
1025
1025
|
height: 40,
|
|
1026
1026
|
borderRadius: "50%",
|
|
1027
|
-
backgroundColor:
|
|
1027
|
+
backgroundColor: Q[t] ?? Q[D.PENDING],
|
|
1028
1028
|
color: "#fff",
|
|
1029
1029
|
border: "2px solid #fff",
|
|
1030
1030
|
display: "flex",
|
|
@@ -1061,7 +1061,7 @@ const rr = () => /* @__PURE__ */ l.jsx("svg", { width: "12", height: "12", viewB
|
|
|
1061
1061
|
fontFamily: "'Inter', sans-serif",
|
|
1062
1062
|
textTransform: "uppercase",
|
|
1063
1063
|
letterSpacing: "0.02em",
|
|
1064
|
-
backgroundColor:
|
|
1064
|
+
backgroundColor: Q[t] ?? Q[D.PENDING],
|
|
1065
1065
|
color: o ? B.textDark : "#fff"
|
|
1066
1066
|
};
|
|
1067
1067
|
}, cr = {
|
|
@@ -1112,75 +1112,75 @@ const rr = () => /* @__PURE__ */ l.jsx("svg", { width: "12", height: "12", viewB
|
|
|
1112
1112
|
color: B.textDark
|
|
1113
1113
|
}, hr = {
|
|
1114
1114
|
...tt,
|
|
1115
|
-
backgroundColor:
|
|
1115
|
+
backgroundColor: Q[D.VALIDATED],
|
|
1116
1116
|
color: "#fff"
|
|
1117
1117
|
};
|
|
1118
1118
|
function vr({
|
|
1119
1119
|
comment: t,
|
|
1120
1120
|
offset: o = { dx: 0, dy: 0 },
|
|
1121
|
-
apiUrl:
|
|
1121
|
+
apiUrl: n,
|
|
1122
1122
|
apiKey: i,
|
|
1123
|
-
onStatusChange:
|
|
1123
|
+
onStatusChange: a
|
|
1124
1124
|
}) {
|
|
1125
1125
|
var ne, oe;
|
|
1126
|
-
const [
|
|
1127
|
-
|
|
1126
|
+
const [d, g] = A(!1), [p, m] = A(!1), [R, h] = A(() => ye(t)), [C, w] = A(!1), [O, _] = A(null), I = ge(null), z = ge(null), u = ge(null), f = L(() => {
|
|
1127
|
+
h(ye(t));
|
|
1128
1128
|
}, [t]);
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
}, [
|
|
1129
|
+
$(() => {
|
|
1130
|
+
f();
|
|
1131
|
+
}, [f]), $(() => {
|
|
1132
1132
|
if (!(typeof window > "u"))
|
|
1133
|
-
return window.addEventListener("scroll",
|
|
1134
|
-
window.removeEventListener("scroll",
|
|
1133
|
+
return window.addEventListener("scroll", f, !0), window.addEventListener("resize", f), () => {
|
|
1134
|
+
window.removeEventListener("scroll", f, !0), window.removeEventListener("resize", f);
|
|
1135
1135
|
};
|
|
1136
|
+
}, [f]);
|
|
1137
|
+
const k = L(() => {
|
|
1138
|
+
I.current !== null && (clearTimeout(I.current), I.current = null);
|
|
1139
|
+
}, []), U = L(() => {
|
|
1140
|
+
k(), g(!0);
|
|
1141
|
+
}, [k]), X = L(() => {
|
|
1142
|
+
p || (I.current = setTimeout(() => {
|
|
1143
|
+
I.current = null, g(!1);
|
|
1144
|
+
}, Je));
|
|
1145
|
+
}, [p]), K = L(() => {
|
|
1146
|
+
k(), g(!0);
|
|
1147
|
+
}, [k]), S = L(() => {
|
|
1148
|
+
p || (I.current = setTimeout(() => {
|
|
1149
|
+
I.current = null, g(!1);
|
|
1150
|
+
}, Je));
|
|
1151
|
+
}, [p]), j = L(() => {
|
|
1152
|
+
p ? (m(!1), g(!1)) : (m(!0), g(!0));
|
|
1136
1153
|
}, [p]);
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
}, []), X = I(() => {
|
|
1140
|
-
F(), v(!0);
|
|
1141
|
-
}, [F]), te = I(() => {
|
|
1142
|
-
d || (O.current = setTimeout(() => {
|
|
1143
|
-
O.current = null, v(!1);
|
|
1144
|
-
}, qe));
|
|
1145
|
-
}, [d]), Q = I(() => {
|
|
1146
|
-
F(), v(!0);
|
|
1147
|
-
}, [F]), C = I(() => {
|
|
1148
|
-
d || (O.current = setTimeout(() => {
|
|
1149
|
-
O.current = null, v(!1);
|
|
1150
|
-
}, qe));
|
|
1151
|
-
}, [d]), P = I(() => {
|
|
1152
|
-
d ? (E(!1), v(!1)) : (E(!0), v(!0));
|
|
1153
|
-
}, [d]);
|
|
1154
|
-
N(() => {
|
|
1155
|
-
if (!d) return;
|
|
1154
|
+
$(() => {
|
|
1155
|
+
if (!p) return;
|
|
1156
1156
|
const x = (q) => {
|
|
1157
1157
|
var ae, se;
|
|
1158
1158
|
const ie = q.target;
|
|
1159
|
-
(ae =
|
|
1159
|
+
(ae = z.current) != null && ae.contains(ie) || (se = u.current) != null && se.contains(ie) || (m(!1), g(!1));
|
|
1160
1160
|
};
|
|
1161
1161
|
return document.addEventListener("mousedown", x, !0), () => document.removeEventListener("mousedown", x, !0);
|
|
1162
|
-
}, [
|
|
1163
|
-
const M =
|
|
1164
|
-
|
|
1162
|
+
}, [p]), $(() => () => k(), [k]);
|
|
1163
|
+
const M = R.x + o.dx, W = R.y + o.dy, re = d, G = L(() => {
|
|
1164
|
+
m(!1), g(!1);
|
|
1165
1165
|
}, []), V = async (x) => {
|
|
1166
1166
|
if (x !== t.status) {
|
|
1167
|
-
|
|
1167
|
+
_(null), w(!0);
|
|
1168
1168
|
try {
|
|
1169
|
-
await Bt(
|
|
1169
|
+
await Bt(n, i, t.id, x), a();
|
|
1170
1170
|
} catch (q) {
|
|
1171
|
-
|
|
1171
|
+
_(q instanceof Error ? q.message : "Error al actualizar");
|
|
1172
1172
|
} finally {
|
|
1173
|
-
|
|
1173
|
+
w(!1);
|
|
1174
1174
|
}
|
|
1175
1175
|
}
|
|
1176
1176
|
}, H = async () => {
|
|
1177
|
-
|
|
1177
|
+
_(null), w(!0);
|
|
1178
1178
|
try {
|
|
1179
|
-
await Yt(
|
|
1179
|
+
await Yt(n, i, t.id), a(), G();
|
|
1180
1180
|
} catch (x) {
|
|
1181
|
-
|
|
1181
|
+
_(x instanceof Error ? x.message : "Error al eliminar");
|
|
1182
1182
|
} finally {
|
|
1183
|
-
|
|
1183
|
+
w(!1);
|
|
1184
1184
|
}
|
|
1185
1185
|
}, J = [
|
|
1186
1186
|
"pending",
|
|
@@ -1192,27 +1192,27 @@ function vr({
|
|
|
1192
1192
|
/* @__PURE__ */ l.jsx(
|
|
1193
1193
|
"div",
|
|
1194
1194
|
{
|
|
1195
|
-
ref:
|
|
1195
|
+
ref: z,
|
|
1196
1196
|
role: "button",
|
|
1197
1197
|
tabIndex: 0,
|
|
1198
1198
|
"aria-label": `Comentario: ${t.message.slice(0, 30)}...`,
|
|
1199
|
-
"aria-expanded":
|
|
1199
|
+
"aria-expanded": d,
|
|
1200
1200
|
style: {
|
|
1201
1201
|
...or(t.status),
|
|
1202
1202
|
left: M,
|
|
1203
1203
|
top: W,
|
|
1204
1204
|
transform: "translate(-50%, -50%)"
|
|
1205
1205
|
},
|
|
1206
|
-
onMouseEnter:
|
|
1207
|
-
onMouseLeave:
|
|
1208
|
-
onClick:
|
|
1206
|
+
onMouseEnter: U,
|
|
1207
|
+
onMouseLeave: X,
|
|
1208
|
+
onClick: j,
|
|
1209
1209
|
children: /* @__PURE__ */ l.jsx(nr, { color: "#fff" })
|
|
1210
1210
|
}
|
|
1211
1211
|
),
|
|
1212
|
-
|
|
1212
|
+
d && /* @__PURE__ */ l.jsxs(
|
|
1213
1213
|
"div",
|
|
1214
1214
|
{
|
|
1215
|
-
ref:
|
|
1215
|
+
ref: u,
|
|
1216
1216
|
role: "dialog",
|
|
1217
1217
|
"aria-label": "Detalle del comentario",
|
|
1218
1218
|
style: {
|
|
@@ -1220,8 +1220,8 @@ function vr({
|
|
|
1220
1220
|
left: M + ke / 2 + 6,
|
|
1221
1221
|
top: W
|
|
1222
1222
|
},
|
|
1223
|
-
onMouseEnter:
|
|
1224
|
-
onMouseLeave:
|
|
1223
|
+
onMouseEnter: K,
|
|
1224
|
+
onMouseLeave: S,
|
|
1225
1225
|
children: [
|
|
1226
1226
|
/* @__PURE__ */ l.jsxs("div", { style: ar, children: [
|
|
1227
1227
|
/* @__PURE__ */ l.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 10, flex: 1, minWidth: 0 }, children: [
|
|
@@ -1237,7 +1237,7 @@ function vr({
|
|
|
1237
1237
|
type: "button",
|
|
1238
1238
|
"aria-label": t.status === D.VALIDATED ? "Eliminar comentario" : "Cerrar",
|
|
1239
1239
|
style: lr,
|
|
1240
|
-
disabled:
|
|
1240
|
+
disabled: C,
|
|
1241
1241
|
onClick: (x) => {
|
|
1242
1242
|
x.stopPropagation(), t.status === D.VALIDATED ? H() : G();
|
|
1243
1243
|
},
|
|
@@ -1258,14 +1258,14 @@ function vr({
|
|
|
1258
1258
|
id: `comment-status-${t.id}`,
|
|
1259
1259
|
style: dr,
|
|
1260
1260
|
value: t.status,
|
|
1261
|
-
disabled:
|
|
1261
|
+
disabled: C,
|
|
1262
1262
|
onChange: (x) => V(x.target.value),
|
|
1263
1263
|
onMouseDown: (x) => x.stopPropagation(),
|
|
1264
1264
|
"aria-label": "Cambiar estado del comentario",
|
|
1265
1265
|
children: J.map((x) => /* @__PURE__ */ l.jsx("option", { value: x, children: Kt[x] }, x))
|
|
1266
1266
|
}
|
|
1267
1267
|
),
|
|
1268
|
-
|
|
1268
|
+
O && /* @__PURE__ */ l.jsx("div", { style: { marginTop: 8, fontSize: 11, color: "rgb(240, 69, 69)" }, children: O }),
|
|
1269
1269
|
/* @__PURE__ */ l.jsxs("div", { style: fr, children: [
|
|
1270
1270
|
/* @__PURE__ */ l.jsx(
|
|
1271
1271
|
"button",
|
|
@@ -1284,7 +1284,7 @@ function vr({
|
|
|
1284
1284
|
{
|
|
1285
1285
|
type: "button",
|
|
1286
1286
|
style: hr,
|
|
1287
|
-
disabled:
|
|
1287
|
+
disabled: C,
|
|
1288
1288
|
onMouseDown: (x) => x.stopPropagation(),
|
|
1289
1289
|
onClick: (x) => {
|
|
1290
1290
|
x.stopPropagation(), V("validated");
|
|
@@ -1301,14 +1301,14 @@ function vr({
|
|
|
1301
1301
|
const gr = 25, yr = 36;
|
|
1302
1302
|
function mr(t) {
|
|
1303
1303
|
const o = /* @__PURE__ */ new Map();
|
|
1304
|
-
for (let
|
|
1305
|
-
const i = t[
|
|
1306
|
-
let
|
|
1307
|
-
for (let
|
|
1308
|
-
const
|
|
1309
|
-
Math.hypot(
|
|
1304
|
+
for (let n = 0; n < t.length; n++) {
|
|
1305
|
+
const i = t[n], { x: a, y: d } = ye(i);
|
|
1306
|
+
let g = 0;
|
|
1307
|
+
for (let p = 0; p < n; p++) {
|
|
1308
|
+
const m = t[p], { x: R, y: h } = ye(m);
|
|
1309
|
+
Math.hypot(a - R, d - h) < gr && g++;
|
|
1310
1310
|
}
|
|
1311
|
-
o.set(i.id, { dx:
|
|
1311
|
+
o.set(i.id, { dx: g * yr, dy: 0 });
|
|
1312
1312
|
}
|
|
1313
1313
|
return o;
|
|
1314
1314
|
}
|
|
@@ -1318,52 +1318,52 @@ function xr() {
|
|
|
1318
1318
|
function Er({
|
|
1319
1319
|
apiUrl: t,
|
|
1320
1320
|
apiKey: o,
|
|
1321
|
-
reviewMode:
|
|
1321
|
+
reviewMode: n,
|
|
1322
1322
|
reviewers: i,
|
|
1323
|
-
comments:
|
|
1324
|
-
loadComments:
|
|
1325
|
-
commentsLoadFailed:
|
|
1323
|
+
comments: a,
|
|
1324
|
+
loadComments: d,
|
|
1325
|
+
commentsLoadFailed: g = !1
|
|
1326
1326
|
}) {
|
|
1327
|
-
const [
|
|
1328
|
-
|
|
1329
|
-
}, [
|
|
1330
|
-
|
|
1327
|
+
const [p, m] = A(null), R = ge(null), [h, C] = A(null), w = L(() => {
|
|
1328
|
+
p && (p.style.outline = "", p.style.outlineOffset = "", m(null));
|
|
1329
|
+
}, [p]), O = L(() => {
|
|
1330
|
+
R.current && (R.current.style.outline = "", R.current.style.outlineOffset = "", R.current = null);
|
|
1331
1331
|
}, []);
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
}, [
|
|
1332
|
+
$(() => {
|
|
1333
|
+
n || (w(), O());
|
|
1334
|
+
}, [n, w, O]), $(() => {
|
|
1335
1335
|
if (typeof document > "u") return;
|
|
1336
|
-
const
|
|
1337
|
-
return
|
|
1338
|
-
document.body.style.cursor =
|
|
1336
|
+
const S = document.body.style.cursor;
|
|
1337
|
+
return h ? document.body.style.cursor = "default" : n && (document.body.style.cursor = "crosshair"), () => {
|
|
1338
|
+
document.body.style.cursor = S;
|
|
1339
1339
|
};
|
|
1340
|
-
}, [
|
|
1341
|
-
const
|
|
1342
|
-
(
|
|
1343
|
-
if (!
|
|
1344
|
-
const
|
|
1345
|
-
|
|
1340
|
+
}, [n, h]);
|
|
1341
|
+
const _ = L(
|
|
1342
|
+
(S) => {
|
|
1343
|
+
if (!n || h) return;
|
|
1344
|
+
const j = S.target.nodeType === Node.ELEMENT_NODE ? S.target : S.target.parentElement;
|
|
1345
|
+
j && (w(), m(j), j.style.outline = "2px solid #ff4d4f", j.style.outlineOffset = "2px");
|
|
1346
1346
|
},
|
|
1347
|
-
[
|
|
1348
|
-
),
|
|
1349
|
-
(
|
|
1347
|
+
[n, h, w]
|
|
1348
|
+
), I = L(
|
|
1349
|
+
(S) => {
|
|
1350
1350
|
var M;
|
|
1351
|
-
if (
|
|
1352
|
-
const
|
|
1353
|
-
|
|
1351
|
+
if (h) return;
|
|
1352
|
+
const j = S.relatedTarget;
|
|
1353
|
+
p && (!j || !p.contains(j)) && !(j && ((M = p.contains) != null && M.call(p, j))) && w();
|
|
1354
1354
|
},
|
|
1355
|
-
[
|
|
1356
|
-
),
|
|
1357
|
-
(
|
|
1358
|
-
if (!
|
|
1359
|
-
|
|
1360
|
-
const
|
|
1361
|
-
if (!
|
|
1362
|
-
|
|
1363
|
-
const M =
|
|
1364
|
-
|
|
1365
|
-
const W = M.getBoundingClientRect(), re = $t(
|
|
1366
|
-
|
|
1355
|
+
[p, h, w]
|
|
1356
|
+
), z = L(
|
|
1357
|
+
(S) => {
|
|
1358
|
+
if (!n || h) return;
|
|
1359
|
+
S.preventDefault(), S.stopPropagation();
|
|
1360
|
+
const j = S.target;
|
|
1361
|
+
if (!j || j.closest("[data-review-layer-pin]") || j.closest("[data-review-layer-modal]")) return;
|
|
1362
|
+
w();
|
|
1363
|
+
const M = j;
|
|
1364
|
+
R.current = M, M.style.outline = "2px solid #ff4d4f", M.style.outlineOffset = "2px";
|
|
1365
|
+
const W = M.getBoundingClientRect(), re = $t(j), { relativeX: G, relativeY: V } = Nt(W);
|
|
1366
|
+
C({
|
|
1367
1367
|
position: { x: W.left + W.width / 2, y: W.bottom },
|
|
1368
1368
|
payload: {
|
|
1369
1369
|
selector: re,
|
|
@@ -1380,33 +1380,33 @@ function Er({
|
|
|
1380
1380
|
}
|
|
1381
1381
|
});
|
|
1382
1382
|
},
|
|
1383
|
-
[
|
|
1383
|
+
[n, h, w]
|
|
1384
1384
|
);
|
|
1385
|
-
|
|
1386
|
-
if (
|
|
1387
|
-
return document.addEventListener("mouseover",
|
|
1388
|
-
document.removeEventListener("mouseover",
|
|
1385
|
+
$(() => {
|
|
1386
|
+
if (n)
|
|
1387
|
+
return document.addEventListener("mouseover", _, !0), document.addEventListener("mouseout", I, !0), document.addEventListener("click", z, !0), () => {
|
|
1388
|
+
document.removeEventListener("mouseover", _, !0), document.removeEventListener("mouseout", I, !0), document.removeEventListener("click", z, !0);
|
|
1389
1389
|
};
|
|
1390
|
-
}, [
|
|
1391
|
-
const [
|
|
1392
|
-
|
|
1390
|
+
}, [n, _, I, z]);
|
|
1391
|
+
const [u, f] = A(0);
|
|
1392
|
+
$(() => {
|
|
1393
1393
|
if (typeof window > "u") return;
|
|
1394
|
-
const
|
|
1395
|
-
return window.addEventListener("resize",
|
|
1396
|
-
window.removeEventListener("resize",
|
|
1394
|
+
const S = () => f((j) => j + 1);
|
|
1395
|
+
return window.addEventListener("resize", S), window.addEventListener("scroll", S, !0), () => {
|
|
1396
|
+
window.removeEventListener("resize", S), window.removeEventListener("scroll", S, !0);
|
|
1397
1397
|
};
|
|
1398
1398
|
}, []);
|
|
1399
|
-
const
|
|
1400
|
-
() => mr(
|
|
1401
|
-
[
|
|
1402
|
-
),
|
|
1399
|
+
const k = Ot(
|
|
1400
|
+
() => mr(a),
|
|
1401
|
+
[a, u]
|
|
1402
|
+
), U = {
|
|
1403
1403
|
position: "fixed",
|
|
1404
1404
|
inset: 0,
|
|
1405
1405
|
zIndex: 999999,
|
|
1406
1406
|
pointerEvents: "none",
|
|
1407
|
-
cursor:
|
|
1408
|
-
},
|
|
1409
|
-
|
|
1407
|
+
cursor: n ? "crosshair" : void 0
|
|
1408
|
+
}, X = /* @__PURE__ */ l.jsxs("div", { style: U, "aria-hidden": !0, children: [
|
|
1409
|
+
n && /* @__PURE__ */ l.jsx(
|
|
1410
1410
|
"div",
|
|
1411
1411
|
{
|
|
1412
1412
|
style: {
|
|
@@ -1425,7 +1425,7 @@ function Er({
|
|
|
1425
1425
|
children: "Modo revisión (Shift+R para salir)"
|
|
1426
1426
|
}
|
|
1427
1427
|
),
|
|
1428
|
-
|
|
1428
|
+
g && /* @__PURE__ */ l.jsxs(
|
|
1429
1429
|
"div",
|
|
1430
1430
|
{
|
|
1431
1431
|
style: {
|
|
@@ -1452,7 +1452,7 @@ function Er({
|
|
|
1452
1452
|
"button",
|
|
1453
1453
|
{
|
|
1454
1454
|
type: "button",
|
|
1455
|
-
onClick: () =>
|
|
1455
|
+
onClick: () => d(),
|
|
1456
1456
|
style: {
|
|
1457
1457
|
padding: "4px 10px",
|
|
1458
1458
|
fontSize: 12,
|
|
@@ -1469,43 +1469,43 @@ function Er({
|
|
|
1469
1469
|
]
|
|
1470
1470
|
}
|
|
1471
1471
|
),
|
|
1472
|
-
|
|
1472
|
+
a.map((S) => /* @__PURE__ */ l.jsx("div", { "data-review-layer-pin": !0, style: { pointerEvents: "auto" }, children: /* @__PURE__ */ l.jsx(
|
|
1473
1473
|
vr,
|
|
1474
1474
|
{
|
|
1475
|
-
comment:
|
|
1476
|
-
offset:
|
|
1475
|
+
comment: S,
|
|
1476
|
+
offset: k.get(S.id),
|
|
1477
1477
|
apiUrl: t,
|
|
1478
1478
|
apiKey: o,
|
|
1479
|
-
onStatusChange:
|
|
1479
|
+
onStatusChange: d
|
|
1480
1480
|
}
|
|
1481
|
-
) },
|
|
1482
|
-
|
|
1483
|
-
|
|
1481
|
+
) }, S.id)),
|
|
1482
|
+
h && /* @__PURE__ */ l.jsx("div", { "data-review-layer-modal": !0, style: { pointerEvents: "auto" }, children: /* @__PURE__ */ l.jsx(
|
|
1483
|
+
qt,
|
|
1484
1484
|
{
|
|
1485
1485
|
apiUrl: t,
|
|
1486
1486
|
apiKey: o,
|
|
1487
1487
|
reviewers: i,
|
|
1488
|
-
position:
|
|
1489
|
-
payload:
|
|
1488
|
+
position: h.position,
|
|
1489
|
+
payload: h.payload,
|
|
1490
1490
|
onClose: () => {
|
|
1491
|
-
|
|
1491
|
+
O(), C(null);
|
|
1492
1492
|
},
|
|
1493
|
-
onSuccess:
|
|
1493
|
+
onSuccess: d
|
|
1494
1494
|
}
|
|
1495
1495
|
) })
|
|
1496
|
-
] }),
|
|
1497
|
-
return
|
|
1496
|
+
] }), K = typeof document < "u" ? document.body : null;
|
|
1497
|
+
return K ? Ke(X, K) : null;
|
|
1498
1498
|
}
|
|
1499
|
-
function wr(t, o,
|
|
1500
|
-
const i =
|
|
1501
|
-
t &&
|
|
1502
|
-
}, [t,
|
|
1503
|
-
|
|
1499
|
+
function wr(t, o, n) {
|
|
1500
|
+
const i = L(() => {
|
|
1501
|
+
t && n((a) => !a);
|
|
1502
|
+
}, [t, n]);
|
|
1503
|
+
$(() => {
|
|
1504
1504
|
if (!t) return;
|
|
1505
|
-
const
|
|
1506
|
-
(
|
|
1505
|
+
const a = (d) => {
|
|
1506
|
+
(d.key === "r" || d.key === "R" || d.code === "KeyR") && d.shiftKey && (d.preventDefault(), i());
|
|
1507
1507
|
};
|
|
1508
|
-
return window.addEventListener("keydown",
|
|
1508
|
+
return window.addEventListener("keydown", a), () => window.removeEventListener("keydown", a);
|
|
1509
1509
|
}, [t, i]);
|
|
1510
1510
|
}
|
|
1511
1511
|
const br = "review_layer:v1:";
|
|
@@ -1517,9 +1517,9 @@ function Rr(t, o) {
|
|
|
1517
1517
|
return o;
|
|
1518
1518
|
}
|
|
1519
1519
|
}
|
|
1520
|
-
function me(t, o,
|
|
1521
|
-
const
|
|
1522
|
-
return i != null ? `${
|
|
1520
|
+
function me(t, o, n, i) {
|
|
1521
|
+
const a = `${br}${Sr(t)}:${n}`;
|
|
1522
|
+
return i != null ? `${a}:${i}` : a;
|
|
1523
1523
|
}
|
|
1524
1524
|
function Sr(t) {
|
|
1525
1525
|
return t.replace(/\/+$/, "") || "/";
|
|
@@ -1536,123 +1536,125 @@ function nt(t, o) {
|
|
|
1536
1536
|
} catch {
|
|
1537
1537
|
}
|
|
1538
1538
|
}
|
|
1539
|
-
function
|
|
1540
|
-
const i = rt(me(t, o, "comments",
|
|
1539
|
+
function je(t, o, n) {
|
|
1540
|
+
const i = rt(me(t, o, "comments", n));
|
|
1541
1541
|
return (i == null ? void 0 : i.data) ?? null;
|
|
1542
1542
|
}
|
|
1543
|
-
function Cr(t, o,
|
|
1544
|
-
nt(me(t, o, "comments",
|
|
1543
|
+
function Cr(t, o, n, i) {
|
|
1544
|
+
nt(me(t, o, "comments", n), i);
|
|
1545
1545
|
}
|
|
1546
|
-
function
|
|
1547
|
-
const
|
|
1548
|
-
return (
|
|
1546
|
+
function qe(t, o) {
|
|
1547
|
+
const n = rt(me(t, o, "reviewers"));
|
|
1548
|
+
return (n == null ? void 0 : n.data) ?? null;
|
|
1549
1549
|
}
|
|
1550
|
-
function
|
|
1551
|
-
nt(me(t, o, "reviewers"),
|
|
1550
|
+
function _r(t, o, n) {
|
|
1551
|
+
nt(me(t, o, "reviewers"), n);
|
|
1552
1552
|
}
|
|
1553
|
+
const jr = "https://review-layer-api.onrender.com/api";
|
|
1553
1554
|
function Ze() {
|
|
1554
1555
|
return typeof window > "u" ? "/" : window.location.pathname || "/";
|
|
1555
1556
|
}
|
|
1556
1557
|
const ot = It(null);
|
|
1557
|
-
let
|
|
1558
|
-
function
|
|
1558
|
+
let Te = null;
|
|
1559
|
+
function kr() {
|
|
1559
1560
|
const t = Lt(ot);
|
|
1560
1561
|
if (!t)
|
|
1561
1562
|
throw new Error("useReview must be used within ReviewProvider");
|
|
1562
1563
|
return t;
|
|
1563
1564
|
}
|
|
1564
|
-
function
|
|
1565
|
+
function Dr({
|
|
1565
1566
|
children: t,
|
|
1566
1567
|
enabled: o = !0,
|
|
1567
|
-
apiUrl:
|
|
1568
|
+
apiUrl: n,
|
|
1568
1569
|
apiKey: i
|
|
1569
1570
|
}) {
|
|
1570
|
-
const [
|
|
1571
|
-
wr(o,
|
|
1572
|
-
const
|
|
1573
|
-
async (
|
|
1574
|
-
if (!(!o || !
|
|
1571
|
+
const a = (n == null ? void 0 : n.trim()) || jr, [d, g] = A(!1), [p, m] = A([]), [R, h] = A([]), [C, w] = A(!1);
|
|
1572
|
+
wr(o, d, g);
|
|
1573
|
+
const O = L(
|
|
1574
|
+
async (u) => {
|
|
1575
|
+
if (!(!o || !a || !i))
|
|
1575
1576
|
try {
|
|
1576
|
-
const f = await Mt(
|
|
1577
|
-
|
|
1577
|
+
const f = await Mt(a, i, { signal: u });
|
|
1578
|
+
u != null && u.aborted || (m(f), _r(a, i, f));
|
|
1578
1579
|
} catch (f) {
|
|
1579
1580
|
if (f instanceof Error && f.name === "AbortError") return;
|
|
1580
|
-
if (!(
|
|
1581
|
-
const
|
|
1582
|
-
|
|
1581
|
+
if (!(u != null && u.aborted)) {
|
|
1582
|
+
const k = qe(a, i);
|
|
1583
|
+
k != null && m(k);
|
|
1583
1584
|
}
|
|
1584
1585
|
}
|
|
1585
1586
|
},
|
|
1586
|
-
[o,
|
|
1587
|
-
), _ =
|
|
1588
|
-
async (
|
|
1589
|
-
if (!o || !
|
|
1590
|
-
const f = Ze(),
|
|
1591
|
-
|
|
1587
|
+
[o, a, i]
|
|
1588
|
+
), _ = L(
|
|
1589
|
+
async (u) => {
|
|
1590
|
+
if (!o || !a || !i) return;
|
|
1591
|
+
const f = Ze(), k = je(a, i, f);
|
|
1592
|
+
k != null && h(k);
|
|
1592
1593
|
try {
|
|
1593
|
-
|
|
1594
|
-
const
|
|
1595
|
-
|
|
1596
|
-
} catch (
|
|
1597
|
-
if (
|
|
1598
|
-
if (!(
|
|
1599
|
-
|
|
1600
|
-
const X =
|
|
1601
|
-
X != null &&
|
|
1594
|
+
w(!1);
|
|
1595
|
+
const U = await Vt(a, i, f, { signal: u });
|
|
1596
|
+
u != null && u.aborted || (h(U), Cr(a, i, f, U));
|
|
1597
|
+
} catch (U) {
|
|
1598
|
+
if (U instanceof Error && U.name === "AbortError") return;
|
|
1599
|
+
if (!(u != null && u.aborted)) {
|
|
1600
|
+
w(!0);
|
|
1601
|
+
const X = je(a, i, f);
|
|
1602
|
+
X != null && h(X);
|
|
1602
1603
|
}
|
|
1603
1604
|
}
|
|
1604
1605
|
},
|
|
1605
|
-
[o,
|
|
1606
|
+
[o, a, i]
|
|
1606
1607
|
);
|
|
1607
|
-
|
|
1608
|
-
if (!o || !
|
|
1609
|
-
const
|
|
1610
|
-
f != null &&
|
|
1611
|
-
}, [o,
|
|
1612
|
-
if (!o || !
|
|
1613
|
-
const
|
|
1614
|
-
if (
|
|
1615
|
-
return
|
|
1608
|
+
$(() => {
|
|
1609
|
+
if (!o || !a || !i) return;
|
|
1610
|
+
const u = Ze(), f = qe(a, i), k = je(a, i, u);
|
|
1611
|
+
f != null && m(f), k != null && h(k);
|
|
1612
|
+
}, [o, a, i]), $(() => {
|
|
1613
|
+
if (!o || !a || !i) return;
|
|
1614
|
+
const u = `${a}:${i}`;
|
|
1615
|
+
if (Te !== u)
|
|
1616
|
+
return Te = u, O(), _(), () => {
|
|
1616
1617
|
setTimeout(() => {
|
|
1617
|
-
|
|
1618
|
+
Te = null;
|
|
1618
1619
|
}, 0);
|
|
1619
1620
|
};
|
|
1620
|
-
}, [o,
|
|
1621
|
+
}, [o, a, i, O, _]), $(() => {
|
|
1621
1622
|
if (!o) return;
|
|
1622
|
-
const
|
|
1623
|
-
return window.addEventListener("popstate",
|
|
1623
|
+
const u = () => _();
|
|
1624
|
+
return window.addEventListener("popstate", u), () => window.removeEventListener("popstate", u);
|
|
1624
1625
|
}, [o, _]);
|
|
1625
|
-
const
|
|
1626
|
-
apiUrl:
|
|
1626
|
+
const I = {
|
|
1627
|
+
apiUrl: a,
|
|
1627
1628
|
apiKey: i,
|
|
1628
|
-
reviewMode:
|
|
1629
|
-
setReviewMode:
|
|
1630
|
-
reviewers:
|
|
1631
|
-
comments:
|
|
1629
|
+
reviewMode: d,
|
|
1630
|
+
setReviewMode: g,
|
|
1631
|
+
reviewers: p,
|
|
1632
|
+
comments: R,
|
|
1632
1633
|
loadComments: _,
|
|
1633
|
-
commentsLoadFailed:
|
|
1634
|
-
},
|
|
1634
|
+
commentsLoadFailed: C
|
|
1635
|
+
}, z = o && typeof document < "u" ? Ke(
|
|
1635
1636
|
/* @__PURE__ */ l.jsx(
|
|
1636
1637
|
Er,
|
|
1637
1638
|
{
|
|
1638
|
-
apiUrl:
|
|
1639
|
+
apiUrl: a,
|
|
1639
1640
|
apiKey: i,
|
|
1640
|
-
reviewMode:
|
|
1641
|
-
reviewers:
|
|
1642
|
-
comments:
|
|
1641
|
+
reviewMode: d,
|
|
1642
|
+
reviewers: p,
|
|
1643
|
+
comments: R,
|
|
1643
1644
|
loadComments: _,
|
|
1644
|
-
commentsLoadFailed:
|
|
1645
|
+
commentsLoadFailed: C
|
|
1645
1646
|
}
|
|
1646
1647
|
),
|
|
1647
1648
|
document.body
|
|
1648
1649
|
) : null;
|
|
1649
|
-
return /* @__PURE__ */ l.jsxs(ot.Provider, { value:
|
|
1650
|
+
return /* @__PURE__ */ l.jsxs(ot.Provider, { value: I, children: [
|
|
1650
1651
|
t,
|
|
1651
|
-
|
|
1652
|
+
z
|
|
1652
1653
|
] });
|
|
1653
1654
|
}
|
|
1654
1655
|
export {
|
|
1655
|
-
|
|
1656
|
-
|
|
1656
|
+
jr as DEFAULT_API_URL,
|
|
1657
|
+
Dr as ReviewProvider,
|
|
1658
|
+
kr as useReview
|
|
1657
1659
|
};
|
|
1658
1660
|
//# sourceMappingURL=review-layer-react.js.map
|