@kelet-ai/feedback-ui 0.5.1 → 0.7.0
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 +15 -8
- package/dist/feedback-ui.es.js +21 -0
- package/dist/feedback-ui.es.js.map +1 -1
- package/dist/feedback-ui.es.min.js +559 -543
- package/dist/feedback-ui.es.min.js.map +1 -1
- package/dist/feedback-ui.umd.js +21 -0
- package/dist/feedback-ui.umd.js.map +1 -1
- package/dist/feedback-ui.umd.min.js +15 -15
- package/dist/feedback-ui.umd.min.js.map +1 -1
- package/dist/hooks/feedback-state/types.d.ts +6 -0
- package/package.json +22 -22
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import De, { createContext as
|
|
2
|
-
function _e(
|
|
3
|
-
return
|
|
1
|
+
import De, { createContext as ke, useContext as ae, useCallback as W, isValidElement as Z, cloneElement as Q, useState as X, useRef as z, useId as ce, useEffect as Ee } from "react";
|
|
2
|
+
function _e(t) {
|
|
3
|
+
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
4
4
|
}
|
|
5
|
-
function
|
|
6
|
-
if (Object.prototype.hasOwnProperty.call(
|
|
7
|
-
var e =
|
|
5
|
+
function je(t) {
|
|
6
|
+
if (Object.prototype.hasOwnProperty.call(t, "__esModule")) return t;
|
|
7
|
+
var e = t.default;
|
|
8
8
|
if (typeof e == "function") {
|
|
9
|
-
var
|
|
9
|
+
var n = function r() {
|
|
10
10
|
var o = !1;
|
|
11
11
|
try {
|
|
12
12
|
o = this instanceof r;
|
|
@@ -14,17 +14,17 @@ function Se(n) {
|
|
|
14
14
|
}
|
|
15
15
|
return o ? Reflect.construct(e, arguments, this.constructor) : e.apply(this, arguments);
|
|
16
16
|
};
|
|
17
|
-
|
|
18
|
-
} else
|
|
19
|
-
return Object.defineProperty(
|
|
20
|
-
var o = Object.getOwnPropertyDescriptor(
|
|
21
|
-
Object.defineProperty(
|
|
17
|
+
n.prototype = e.prototype;
|
|
18
|
+
} else n = {};
|
|
19
|
+
return Object.defineProperty(n, "__esModule", { value: !0 }), Object.keys(t).forEach(function(r) {
|
|
20
|
+
var o = Object.getOwnPropertyDescriptor(t, r);
|
|
21
|
+
Object.defineProperty(n, r, o.get ? o : {
|
|
22
22
|
enumerable: !0,
|
|
23
23
|
get: function() {
|
|
24
|
-
return
|
|
24
|
+
return t[r];
|
|
25
25
|
}
|
|
26
26
|
});
|
|
27
|
-
}),
|
|
27
|
+
}), n;
|
|
28
28
|
}
|
|
29
29
|
var re = { exports: {} }, V = {};
|
|
30
30
|
/**
|
|
@@ -37,11 +37,11 @@ var re = { exports: {} }, V = {};
|
|
|
37
37
|
* LICENSE file in the root directory of this source tree.
|
|
38
38
|
*/
|
|
39
39
|
var fe;
|
|
40
|
-
function
|
|
40
|
+
function Ne() {
|
|
41
41
|
if (fe) return V;
|
|
42
42
|
fe = 1;
|
|
43
|
-
var
|
|
44
|
-
function
|
|
43
|
+
var t = Symbol.for("react.transitional.element"), e = Symbol.for("react.fragment");
|
|
44
|
+
function n(r, o, u) {
|
|
45
45
|
var d = null;
|
|
46
46
|
if (u !== void 0 && (d = "" + u), o.key !== void 0 && (d = "" + o.key), "key" in o) {
|
|
47
47
|
u = {};
|
|
@@ -49,14 +49,14 @@ function je() {
|
|
|
49
49
|
f !== "key" && (u[f] = o[f]);
|
|
50
50
|
} else u = o;
|
|
51
51
|
return o = u.ref, {
|
|
52
|
-
$$typeof:
|
|
52
|
+
$$typeof: t,
|
|
53
53
|
type: r,
|
|
54
54
|
key: d,
|
|
55
55
|
ref: o !== void 0 ? o : null,
|
|
56
56
|
props: u
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
|
-
return V.Fragment = e, V.jsx =
|
|
59
|
+
return V.Fragment = e, V.jsx = n, V.jsxs = n, V;
|
|
60
60
|
}
|
|
61
61
|
var G = {};
|
|
62
62
|
/**
|
|
@@ -69,23 +69,23 @@ var G = {};
|
|
|
69
69
|
* LICENSE file in the root directory of this source tree.
|
|
70
70
|
*/
|
|
71
71
|
var de;
|
|
72
|
-
function
|
|
72
|
+
function Se() {
|
|
73
73
|
return de || (de = 1, process.env.NODE_ENV !== "production" && function() {
|
|
74
|
-
function
|
|
74
|
+
function t(a) {
|
|
75
75
|
if (a == null) return null;
|
|
76
76
|
if (typeof a == "function")
|
|
77
77
|
return a.$$typeof === s ? null : a.displayName || a.name || null;
|
|
78
78
|
if (typeof a == "string") return a;
|
|
79
79
|
switch (a) {
|
|
80
|
-
case
|
|
80
|
+
case w:
|
|
81
81
|
return "Fragment";
|
|
82
|
-
case
|
|
82
|
+
case R:
|
|
83
83
|
return "Profiler";
|
|
84
|
-
case
|
|
84
|
+
case A:
|
|
85
85
|
return "StrictMode";
|
|
86
|
-
case
|
|
86
|
+
case O:
|
|
87
87
|
return "Suspense";
|
|
88
|
-
case
|
|
88
|
+
case N:
|
|
89
89
|
return "SuspenseList";
|
|
90
90
|
case l:
|
|
91
91
|
return "Activity";
|
|
@@ -96,19 +96,19 @@ function Ne() {
|
|
|
96
96
|
), a.$$typeof) {
|
|
97
97
|
case h:
|
|
98
98
|
return "Portal";
|
|
99
|
-
case
|
|
99
|
+
case g:
|
|
100
100
|
return (a.displayName || "Context") + ".Provider";
|
|
101
|
-
case
|
|
101
|
+
case b:
|
|
102
102
|
return (a._context.displayName || "Context") + ".Consumer";
|
|
103
|
-
case
|
|
103
|
+
case k:
|
|
104
104
|
var T = a.render;
|
|
105
105
|
return a = a.displayName, a || (a = T.displayName || T.name || "", a = a !== "" ? "ForwardRef(" + a + ")" : "ForwardRef"), a;
|
|
106
|
-
case
|
|
107
|
-
return T = a.displayName || null, T !== null ? T :
|
|
106
|
+
case F:
|
|
107
|
+
return T = a.displayName || null, T !== null ? T : t(a.type) || "Memo";
|
|
108
108
|
case i:
|
|
109
109
|
T = a._payload, a = a._init;
|
|
110
110
|
try {
|
|
111
|
-
return
|
|
111
|
+
return t(a(T));
|
|
112
112
|
} catch {
|
|
113
113
|
}
|
|
114
114
|
}
|
|
@@ -117,7 +117,7 @@ function Ne() {
|
|
|
117
117
|
function e(a) {
|
|
118
118
|
return "" + a;
|
|
119
119
|
}
|
|
120
|
-
function
|
|
120
|
+
function n(a) {
|
|
121
121
|
try {
|
|
122
122
|
e(a);
|
|
123
123
|
var T = !1;
|
|
@@ -126,20 +126,20 @@ function Ne() {
|
|
|
126
126
|
}
|
|
127
127
|
if (T) {
|
|
128
128
|
T = console;
|
|
129
|
-
var _ = T.error,
|
|
129
|
+
var _ = T.error, j = typeof Symbol == "function" && Symbol.toStringTag && a[Symbol.toStringTag] || a.constructor.name || "Object";
|
|
130
130
|
return _.call(
|
|
131
131
|
T,
|
|
132
132
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
133
|
-
|
|
133
|
+
j
|
|
134
134
|
), e(a);
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
137
|
function r(a) {
|
|
138
|
-
if (a ===
|
|
138
|
+
if (a === w) return "<>";
|
|
139
139
|
if (typeof a == "object" && a !== null && a.$$typeof === i)
|
|
140
140
|
return "<...>";
|
|
141
141
|
try {
|
|
142
|
-
var T =
|
|
142
|
+
var T = t(a);
|
|
143
143
|
return T ? "<" + T + ">" : "<...>";
|
|
144
144
|
} catch {
|
|
145
145
|
return "<...>";
|
|
@@ -153,7 +153,7 @@ function Ne() {
|
|
|
153
153
|
return Error("react-stack-top-frame");
|
|
154
154
|
}
|
|
155
155
|
function d(a) {
|
|
156
|
-
if (
|
|
156
|
+
if (v.call(a, "key")) {
|
|
157
157
|
var T = Object.getOwnPropertyDescriptor(a, "key").get;
|
|
158
158
|
if (T && T.isReactWarning) return !1;
|
|
159
159
|
}
|
|
@@ -172,14 +172,14 @@ function Ne() {
|
|
|
172
172
|
});
|
|
173
173
|
}
|
|
174
174
|
function p() {
|
|
175
|
-
var a =
|
|
176
|
-
return
|
|
175
|
+
var a = t(this.type);
|
|
176
|
+
return I[a] || (I[a] = !0, console.error(
|
|
177
177
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
178
178
|
)), a = this.props.ref, a !== void 0 ? a : null;
|
|
179
179
|
}
|
|
180
|
-
function y(a, T, _,
|
|
180
|
+
function y(a, T, _, j, q, $, B, K) {
|
|
181
181
|
return _ = $.ref, a = {
|
|
182
|
-
$$typeof:
|
|
182
|
+
$$typeof: P,
|
|
183
183
|
type: a,
|
|
184
184
|
key: T,
|
|
185
185
|
props: $,
|
|
@@ -209,48 +209,48 @@ function Ne() {
|
|
|
209
209
|
value: K
|
|
210
210
|
}), Object.freeze && (Object.freeze(a.props), Object.freeze(a)), a;
|
|
211
211
|
}
|
|
212
|
-
function m(a, T, _,
|
|
213
|
-
var
|
|
214
|
-
if (
|
|
215
|
-
if (
|
|
216
|
-
if (D(
|
|
217
|
-
for (
|
|
218
|
-
|
|
219
|
-
Object.freeze && Object.freeze(
|
|
212
|
+
function m(a, T, _, j, q, $, B, K) {
|
|
213
|
+
var S = T.children;
|
|
214
|
+
if (S !== void 0)
|
|
215
|
+
if (j)
|
|
216
|
+
if (D(S)) {
|
|
217
|
+
for (j = 0; j < S.length; j++)
|
|
218
|
+
C(S[j]);
|
|
219
|
+
Object.freeze && Object.freeze(S);
|
|
220
220
|
} else
|
|
221
221
|
console.error(
|
|
222
222
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
223
223
|
);
|
|
224
|
-
else
|
|
225
|
-
if (
|
|
226
|
-
|
|
224
|
+
else C(S);
|
|
225
|
+
if (v.call(T, "key")) {
|
|
226
|
+
S = t(a);
|
|
227
227
|
var Y = Object.keys(T).filter(function(Ae) {
|
|
228
228
|
return Ae !== "key";
|
|
229
229
|
});
|
|
230
|
-
|
|
230
|
+
j = 0 < Y.length ? "{key: someKey, " + Y.join(": ..., ") + ": ...}" : "{key: someKey}", ne[S + j] || (Y = 0 < Y.length ? "{" + Y.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
231
231
|
`A props object containing a "key" prop is being spread into JSX:
|
|
232
232
|
let props = %s;
|
|
233
233
|
<%s {...props} />
|
|
234
234
|
React keys must be passed directly to JSX without using spread:
|
|
235
235
|
let props = %s;
|
|
236
236
|
<%s key={someKey} {...props} />`,
|
|
237
|
-
S,
|
|
238
237
|
j,
|
|
238
|
+
S,
|
|
239
239
|
Y,
|
|
240
|
-
|
|
241
|
-
), ne[
|
|
240
|
+
S
|
|
241
|
+
), ne[S + j] = !0);
|
|
242
242
|
}
|
|
243
|
-
if (
|
|
243
|
+
if (S = null, _ !== void 0 && (n(_), S = "" + _), d(T) && (n(T.key), S = "" + T.key), "key" in T) {
|
|
244
244
|
_ = {};
|
|
245
245
|
for (var le in T)
|
|
246
246
|
le !== "key" && (_[le] = T[le]);
|
|
247
247
|
} else _ = T;
|
|
248
|
-
return
|
|
248
|
+
return S && f(
|
|
249
249
|
_,
|
|
250
250
|
typeof a == "function" ? a.displayName || a.name || "Unknown" : a
|
|
251
251
|
), y(
|
|
252
252
|
a,
|
|
253
|
-
|
|
253
|
+
S,
|
|
254
254
|
$,
|
|
255
255
|
q,
|
|
256
256
|
o(),
|
|
@@ -259,43 +259,43 @@ React keys must be passed directly to JSX without using spread:
|
|
|
259
259
|
K
|
|
260
260
|
);
|
|
261
261
|
}
|
|
262
|
-
function
|
|
263
|
-
typeof a == "object" && a !== null && a.$$typeof ===
|
|
262
|
+
function C(a) {
|
|
263
|
+
typeof a == "object" && a !== null && a.$$typeof === P && a._store && (a._store.validated = 1);
|
|
264
264
|
}
|
|
265
|
-
var
|
|
265
|
+
var E = De, P = Symbol.for("react.transitional.element"), h = Symbol.for("react.portal"), w = Symbol.for("react.fragment"), A = Symbol.for("react.strict_mode"), R = Symbol.for("react.profiler"), b = Symbol.for("react.consumer"), g = Symbol.for("react.context"), k = Symbol.for("react.forward_ref"), O = Symbol.for("react.suspense"), N = Symbol.for("react.suspense_list"), F = Symbol.for("react.memo"), i = Symbol.for("react.lazy"), l = Symbol.for("react.activity"), s = Symbol.for("react.client.reference"), c = E.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, v = Object.prototype.hasOwnProperty, D = Array.isArray, x = console.createTask ? console.createTask : function() {
|
|
266
266
|
return null;
|
|
267
267
|
};
|
|
268
|
-
|
|
268
|
+
E = {
|
|
269
269
|
react_stack_bottom_frame: function(a) {
|
|
270
270
|
return a();
|
|
271
271
|
}
|
|
272
272
|
};
|
|
273
|
-
var M,
|
|
274
|
-
|
|
273
|
+
var M, I = {}, U = E.react_stack_bottom_frame.bind(
|
|
274
|
+
E,
|
|
275
275
|
u
|
|
276
276
|
)(), J = x(r(u)), ne = {};
|
|
277
|
-
G.Fragment =
|
|
277
|
+
G.Fragment = w, G.jsx = function(a, T, _, j, q) {
|
|
278
278
|
var $ = 1e4 > c.recentlyCreatedOwnerStacks++;
|
|
279
279
|
return m(
|
|
280
280
|
a,
|
|
281
281
|
T,
|
|
282
282
|
_,
|
|
283
283
|
!1,
|
|
284
|
-
|
|
284
|
+
j,
|
|
285
285
|
q,
|
|
286
|
-
$ ? Error("react-stack-top-frame") :
|
|
286
|
+
$ ? Error("react-stack-top-frame") : U,
|
|
287
287
|
$ ? x(r(a)) : J
|
|
288
288
|
);
|
|
289
|
-
}, G.jsxs = function(a, T, _,
|
|
289
|
+
}, G.jsxs = function(a, T, _, j, q) {
|
|
290
290
|
var $ = 1e4 > c.recentlyCreatedOwnerStacks++;
|
|
291
291
|
return m(
|
|
292
292
|
a,
|
|
293
293
|
T,
|
|
294
294
|
_,
|
|
295
295
|
!0,
|
|
296
|
-
|
|
296
|
+
j,
|
|
297
297
|
q,
|
|
298
|
-
$ ? Error("react-stack-top-frame") :
|
|
298
|
+
$ ? Error("react-stack-top-frame") : U,
|
|
299
299
|
$ ? x(r(a)) : J
|
|
300
300
|
);
|
|
301
301
|
};
|
|
@@ -303,20 +303,22 @@ React keys must be passed directly to JSX without using spread:
|
|
|
303
303
|
}
|
|
304
304
|
var pe;
|
|
305
305
|
function Ie() {
|
|
306
|
-
return pe || (pe = 1, process.env.NODE_ENV === "production" ? re.exports =
|
|
306
|
+
return pe || (pe = 1, process.env.NODE_ENV === "production" ? re.exports = Ne() : re.exports = Se()), re.exports;
|
|
307
307
|
}
|
|
308
|
-
var
|
|
309
|
-
const se =
|
|
310
|
-
const
|
|
311
|
-
if (!
|
|
308
|
+
var L = Ie();
|
|
309
|
+
const se = ke(null), Fe = "https://api.kelet.ai/api", pt = () => {
|
|
310
|
+
const t = ae(se);
|
|
311
|
+
if (!t)
|
|
312
312
|
throw new Error("useKelet must be used within a KeletProvider");
|
|
313
|
-
return
|
|
313
|
+
return t;
|
|
314
314
|
}, Pe = () => {
|
|
315
|
-
const
|
|
316
|
-
return
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
315
|
+
const t = ae(se);
|
|
316
|
+
return t ? t.feedback : (console.warn(
|
|
317
|
+
"No FeedbackHandler found: defaultFeedbackHandler is not possible since there's no KeletProvider wrapping this call, and handler not provided"
|
|
318
|
+
), async () => {
|
|
319
|
+
});
|
|
320
|
+
}, ht = ({ apiKey: t, project: e, children: n }) => {
|
|
321
|
+
const r = ae(se), o = t || r?.api_key;
|
|
320
322
|
if (!o)
|
|
321
323
|
throw new Error(
|
|
322
324
|
"apiKey is required either directly or from a parent KeletProvider"
|
|
@@ -345,38 +347,38 @@ const se = Ee(null), Fe = "https://api.kelet.ai/api", pt = () => {
|
|
|
345
347
|
throw new Error(`Failed to submit feedback: ${m.statusText}`);
|
|
346
348
|
}
|
|
347
349
|
};
|
|
348
|
-
return /* @__PURE__ */
|
|
349
|
-
}, ee = (
|
|
350
|
-
const
|
|
350
|
+
return /* @__PURE__ */ L.jsx(se.Provider, { value: d, children: n });
|
|
351
|
+
}, ee = (t, e) => {
|
|
352
|
+
const n = { ...e };
|
|
351
353
|
for (const r in e) {
|
|
352
|
-
const o =
|
|
353
|
-
/^on[A-Z]/.test(r) ? o && u ?
|
|
354
|
+
const o = t[r], u = e[r];
|
|
355
|
+
/^on[A-Z]/.test(r) ? o && u ? n[r] = (...f) => {
|
|
354
356
|
u(...f), o(...f);
|
|
355
|
-
} : o && (
|
|
357
|
+
} : o && (n[r] = o) : r === "style" ? n[r] = { ...o, ...u } : r === "className" ? n[r] = [o, u].filter(Boolean).join(" ") : n[r] = u !== void 0 ? u : o;
|
|
356
358
|
}
|
|
357
|
-
return { ...
|
|
358
|
-
}, xe =
|
|
359
|
+
return { ...t, ...n };
|
|
360
|
+
}, xe = ke(
|
|
359
361
|
null
|
|
360
362
|
), te = () => {
|
|
361
|
-
const
|
|
362
|
-
if (!
|
|
363
|
+
const t = ae(xe);
|
|
364
|
+
if (!t)
|
|
363
365
|
throw new Error(
|
|
364
366
|
"VoteFeedback components must be used within VoteFeedback.Root"
|
|
365
367
|
);
|
|
366
|
-
return
|
|
368
|
+
return t;
|
|
367
369
|
}, Le = ({
|
|
368
|
-
children:
|
|
370
|
+
children: t,
|
|
369
371
|
onFeedback: e,
|
|
370
|
-
defaultText:
|
|
372
|
+
defaultText: n = "",
|
|
371
373
|
tx_id: r,
|
|
372
374
|
extra_metadata: o,
|
|
373
375
|
trigger_name: u
|
|
374
376
|
}) => {
|
|
375
|
-
const d = typeof r == "function" ? r() : r, [f, p] = X(!1), [y, m] = X(
|
|
376
|
-
|
|
377
|
-
p(!1), m(
|
|
378
|
-
}, [d,
|
|
379
|
-
const
|
|
377
|
+
const d = typeof r == "function" ? r() : r, [f, p] = X(!1), [y, m] = X(n), [C, E] = X(!1), [P, h] = X(null), w = z(null), A = z(null), R = ce(), b = ce(), g = Pe(), k = e || g;
|
|
378
|
+
Ee(() => {
|
|
379
|
+
p(!1), m(n), E(!1), h(null), setTimeout(() => A.current?.focus(), 0);
|
|
380
|
+
}, [d, n]);
|
|
381
|
+
const O = W(async () => {
|
|
380
382
|
h("upvote");
|
|
381
383
|
const c = {
|
|
382
384
|
tx_id: d,
|
|
@@ -385,12 +387,12 @@ const se = Ee(null), Fe = "https://api.kelet.ai/api", pt = () => {
|
|
|
385
387
|
...u && { trigger_name: u }
|
|
386
388
|
};
|
|
387
389
|
try {
|
|
388
|
-
|
|
390
|
+
E(!0), await k(c);
|
|
389
391
|
} finally {
|
|
390
|
-
|
|
392
|
+
E(!1);
|
|
391
393
|
}
|
|
392
|
-
}, [
|
|
393
|
-
if (h("downvote"),
|
|
394
|
+
}, [k, d, o, u]), N = W(async () => {
|
|
395
|
+
if (h("downvote"), k) {
|
|
394
396
|
const c = {
|
|
395
397
|
tx_id: d,
|
|
396
398
|
vote: "downvote",
|
|
@@ -398,17 +400,17 @@ const se = Ee(null), Fe = "https://api.kelet.ai/api", pt = () => {
|
|
|
398
400
|
...u && { trigger_name: u }
|
|
399
401
|
};
|
|
400
402
|
try {
|
|
401
|
-
|
|
403
|
+
E(!0), await k(c);
|
|
402
404
|
} finally {
|
|
403
|
-
|
|
405
|
+
E(!1);
|
|
404
406
|
}
|
|
405
407
|
}
|
|
406
408
|
p(!0), setTimeout(() => {
|
|
407
|
-
|
|
409
|
+
w.current?.focus();
|
|
408
410
|
const c = document.createElement("div");
|
|
409
411
|
c.setAttribute("aria-live", "polite"), c.setAttribute("aria-atomic", "true"), c.className = "sr-only", c.textContent = "Feedback dialog opened. You can provide additional details about your downvote.", document.body.appendChild(c), setTimeout(() => document.body.removeChild(c), 1e3);
|
|
410
412
|
}, 0);
|
|
411
|
-
}, [
|
|
413
|
+
}, [k, d, o, u]), F = W(
|
|
412
414
|
(c) => {
|
|
413
415
|
m(c.target.value);
|
|
414
416
|
},
|
|
@@ -416,7 +418,7 @@ const se = Ee(null), Fe = "https://api.kelet.ai/api", pt = () => {
|
|
|
416
418
|
), i = W(async () => {
|
|
417
419
|
const c = y.trim().length > 0;
|
|
418
420
|
if (c) {
|
|
419
|
-
const
|
|
421
|
+
const v = {
|
|
420
422
|
tx_id: d,
|
|
421
423
|
vote: "downvote",
|
|
422
424
|
explanation: y,
|
|
@@ -424,67 +426,67 @@ const se = Ee(null), Fe = "https://api.kelet.ai/api", pt = () => {
|
|
|
424
426
|
...u && { trigger_name: u }
|
|
425
427
|
};
|
|
426
428
|
try {
|
|
427
|
-
|
|
429
|
+
E(!0), await k(v);
|
|
428
430
|
} finally {
|
|
429
|
-
|
|
431
|
+
E(!1);
|
|
430
432
|
}
|
|
431
433
|
}
|
|
432
|
-
if (p(!1), m(
|
|
433
|
-
const
|
|
434
|
-
|
|
434
|
+
if (p(!1), m(n), A.current?.focus(), c) {
|
|
435
|
+
const v = document.createElement("div");
|
|
436
|
+
v.setAttribute("aria-live", "polite"), v.className = "sr-only", v.textContent = "Feedback submitted successfully.", document.body.appendChild(v), setTimeout(() => document.body.removeChild(v), 1e3);
|
|
435
437
|
}
|
|
436
|
-
}, [
|
|
438
|
+
}, [k, y, n, d, o, u]), l = W(
|
|
437
439
|
(c) => {
|
|
438
440
|
if (c.key === "Escape")
|
|
439
|
-
p(!1), m(
|
|
441
|
+
p(!1), m(n), A.current?.focus();
|
|
440
442
|
else if ((c.metaKey || c.ctrlKey) && c.key === "Enter")
|
|
441
|
-
c.preventDefault(), i().then((
|
|
443
|
+
c.preventDefault(), i().then((v) => {
|
|
442
444
|
});
|
|
443
445
|
else if (c.key === "Tab" && f) {
|
|
444
|
-
const
|
|
445
|
-
if (
|
|
446
|
-
const D =
|
|
446
|
+
const v = document.getElementById(R);
|
|
447
|
+
if (v) {
|
|
448
|
+
const D = v.querySelectorAll(
|
|
447
449
|
'button, textarea, input, select, a[href], [tabindex]:not([tabindex="-1"])'
|
|
448
450
|
), x = D[0], M = D[D.length - 1];
|
|
449
451
|
c.shiftKey && document.activeElement === x ? (c.preventDefault(), M?.focus()) : !c.shiftKey && document.activeElement === M && (c.preventDefault(), x?.focus());
|
|
450
452
|
}
|
|
451
453
|
}
|
|
452
454
|
},
|
|
453
|
-
[i, f,
|
|
455
|
+
[i, f, R, n]
|
|
454
456
|
), s = {
|
|
455
|
-
onFeedback:
|
|
457
|
+
onFeedback: k,
|
|
456
458
|
showPopover: f,
|
|
457
459
|
setShowPopover: p,
|
|
458
460
|
feedbackText: y,
|
|
459
461
|
setFeedbackText: m,
|
|
460
|
-
isSubmitting:
|
|
461
|
-
setIsSubmitting:
|
|
462
|
-
vote:
|
|
463
|
-
handleUpvote:
|
|
464
|
-
handleDownvote:
|
|
465
|
-
handleTextareaChange:
|
|
462
|
+
isSubmitting: C,
|
|
463
|
+
setIsSubmitting: E,
|
|
464
|
+
vote: P,
|
|
465
|
+
handleUpvote: O,
|
|
466
|
+
handleDownvote: N,
|
|
467
|
+
handleTextareaChange: F,
|
|
466
468
|
handleSubmit: i,
|
|
467
469
|
handleKeyDown: l,
|
|
468
|
-
textareaRef:
|
|
469
|
-
triggerRef:
|
|
470
|
-
popoverId:
|
|
471
|
-
triggerId:
|
|
470
|
+
textareaRef: w,
|
|
471
|
+
triggerRef: A,
|
|
472
|
+
popoverId: R,
|
|
473
|
+
triggerId: b,
|
|
472
474
|
tx_id: d,
|
|
473
475
|
extra_metadata: o,
|
|
474
476
|
trigger_name: u
|
|
475
477
|
};
|
|
476
|
-
return /* @__PURE__ */
|
|
478
|
+
return /* @__PURE__ */ L.jsx(xe.Provider, { value: s, children: t });
|
|
477
479
|
}, Me = ({
|
|
478
|
-
asChild:
|
|
480
|
+
asChild: t,
|
|
479
481
|
children: e,
|
|
480
|
-
onClick:
|
|
482
|
+
onClick: n,
|
|
481
483
|
...r
|
|
482
484
|
}) => {
|
|
483
485
|
const { handleUpvote: o, isSubmitting: u, vote: d } = te(), f = W(
|
|
484
486
|
(m) => {
|
|
485
|
-
o(),
|
|
487
|
+
o(), n?.(m);
|
|
486
488
|
},
|
|
487
|
-
[o,
|
|
489
|
+
[o, n]
|
|
488
490
|
), p = {
|
|
489
491
|
...r,
|
|
490
492
|
onClick: f,
|
|
@@ -492,7 +494,7 @@ const se = Ee(null), Fe = "https://api.kelet.ai/api", pt = () => {
|
|
|
492
494
|
"aria-label": r["aria-label"] || "Upvote feedback",
|
|
493
495
|
type: "button"
|
|
494
496
|
}, y = d === "upvote";
|
|
495
|
-
if (
|
|
497
|
+
if (t) {
|
|
496
498
|
const m = typeof e == "function" ? e({ isSelected: y }) : e;
|
|
497
499
|
if (Z(m))
|
|
498
500
|
return Q(
|
|
@@ -500,11 +502,11 @@ const se = Ee(null), Fe = "https://api.kelet.ai/api", pt = () => {
|
|
|
500
502
|
ee(p, m.props)
|
|
501
503
|
);
|
|
502
504
|
}
|
|
503
|
-
return /* @__PURE__ */
|
|
505
|
+
return /* @__PURE__ */ L.jsx("button", { ...p, children: typeof e == "function" ? e({ isSelected: y }) : e });
|
|
504
506
|
}, $e = ({
|
|
505
|
-
asChild:
|
|
507
|
+
asChild: t,
|
|
506
508
|
children: e,
|
|
507
|
-
onClick:
|
|
509
|
+
onClick: n,
|
|
508
510
|
...r
|
|
509
511
|
}) => {
|
|
510
512
|
const {
|
|
@@ -515,36 +517,36 @@ const se = Ee(null), Fe = "https://api.kelet.ai/api", pt = () => {
|
|
|
515
517
|
triggerId: p,
|
|
516
518
|
triggerRef: y,
|
|
517
519
|
vote: m
|
|
518
|
-
} = te(),
|
|
520
|
+
} = te(), C = W(
|
|
519
521
|
(h) => {
|
|
520
|
-
o(),
|
|
522
|
+
o(), n?.(h);
|
|
521
523
|
},
|
|
522
|
-
[o,
|
|
523
|
-
),
|
|
524
|
+
[o, n]
|
|
525
|
+
), E = {
|
|
524
526
|
...r,
|
|
525
527
|
ref: y,
|
|
526
|
-
onClick:
|
|
528
|
+
onClick: C,
|
|
527
529
|
disabled: d || r.disabled,
|
|
528
530
|
"aria-label": r["aria-label"] || "Downvote feedback",
|
|
529
531
|
"aria-expanded": u,
|
|
530
532
|
"aria-controls": f,
|
|
531
533
|
id: p,
|
|
532
534
|
type: "button"
|
|
533
|
-
},
|
|
534
|
-
if (
|
|
535
|
-
const h = typeof e == "function" ? e({ isSelected:
|
|
535
|
+
}, P = m === "downvote";
|
|
536
|
+
if (t) {
|
|
537
|
+
const h = typeof e == "function" ? e({ isSelected: P }) : e;
|
|
536
538
|
if (Z(h))
|
|
537
|
-
return Q(h, ee(
|
|
539
|
+
return Q(h, ee(E, h.props));
|
|
538
540
|
if (h)
|
|
539
541
|
return h;
|
|
540
542
|
}
|
|
541
|
-
return /* @__PURE__ */
|
|
542
|
-
}, qe = ({ asChild:
|
|
543
|
+
return /* @__PURE__ */ L.jsx("button", { ...E, children: typeof e == "function" ? e({ isSelected: P }) : e });
|
|
544
|
+
}, qe = ({ asChild: t, children: e, ...n }) => {
|
|
543
545
|
const { showPopover: r, handleKeyDown: o, popoverId: u, triggerId: d } = te();
|
|
544
546
|
if (!r)
|
|
545
547
|
return null;
|
|
546
548
|
const f = {
|
|
547
|
-
...
|
|
549
|
+
...n,
|
|
548
550
|
role: "dialog",
|
|
549
551
|
"aria-labelledby": d,
|
|
550
552
|
"aria-modal": !0,
|
|
@@ -553,17 +555,17 @@ const se = Ee(null), Fe = "https://api.kelet.ai/api", pt = () => {
|
|
|
553
555
|
onKeyDown: o,
|
|
554
556
|
tabIndex: -1
|
|
555
557
|
};
|
|
556
|
-
return
|
|
558
|
+
return t && Z(e) ? /* @__PURE__ */ L.jsxs(L.Fragment, { children: [
|
|
557
559
|
Q(
|
|
558
560
|
e,
|
|
559
561
|
ee(f, e.props)
|
|
560
562
|
),
|
|
561
|
-
/* @__PURE__ */
|
|
562
|
-
] }) : /* @__PURE__ */
|
|
563
|
-
/* @__PURE__ */
|
|
563
|
+
/* @__PURE__ */ L.jsx("div", { id: `${u}-description`, className: "sr-only", children: "Provide additional feedback for your downvote" })
|
|
564
|
+
] }) : /* @__PURE__ */ L.jsxs("div", { ...f, children: [
|
|
565
|
+
/* @__PURE__ */ L.jsx("div", { id: `${u}-description`, className: "sr-only", children: "Provide additional feedback for your downvote" }),
|
|
564
566
|
e
|
|
565
567
|
] });
|
|
566
|
-
}, We = ({ asChild:
|
|
568
|
+
}, We = ({ asChild: t, value: e, onChange: n, ...r }) => {
|
|
567
569
|
const {
|
|
568
570
|
feedbackText: o,
|
|
569
571
|
handleTextareaChange: u,
|
|
@@ -574,28 +576,28 @@ const se = Ee(null), Fe = "https://api.kelet.ai/api", pt = () => {
|
|
|
574
576
|
...r,
|
|
575
577
|
ref: d,
|
|
576
578
|
value: e !== void 0 ? e : o,
|
|
577
|
-
onChange:
|
|
579
|
+
onChange: n || u,
|
|
578
580
|
onKeyDown: f,
|
|
579
581
|
placeholder: r.placeholder || "What did we miss?",
|
|
580
582
|
"aria-label": r["aria-label"] || "Additional feedback",
|
|
581
583
|
"aria-describedby": `${p}-help`,
|
|
582
584
|
rows: r.rows || 3
|
|
583
585
|
};
|
|
584
|
-
return
|
|
586
|
+
return t && Z(r.children) ? Q(
|
|
585
587
|
r.children,
|
|
586
588
|
ee(y, r.children.props)
|
|
587
|
-
) : /* @__PURE__ */
|
|
589
|
+
) : /* @__PURE__ */ L.jsx("textarea", { ...y });
|
|
588
590
|
}, Ye = ({
|
|
589
|
-
asChild:
|
|
591
|
+
asChild: t,
|
|
590
592
|
children: e,
|
|
591
|
-
onClick:
|
|
593
|
+
onClick: n,
|
|
592
594
|
...r
|
|
593
595
|
}) => {
|
|
594
596
|
const { handleSubmit: o, isSubmitting: u, feedbackText: d } = te(), f = W(
|
|
595
|
-
(
|
|
596
|
-
o(),
|
|
597
|
+
(C) => {
|
|
598
|
+
o(), n?.(C);
|
|
597
599
|
},
|
|
598
|
-
[o,
|
|
600
|
+
[o, n]
|
|
599
601
|
), p = d.trim().length > 0, y = p ? "Submit feedback" : "Close without feedback", m = {
|
|
600
602
|
...r,
|
|
601
603
|
onClick: f,
|
|
@@ -604,15 +606,15 @@ const se = Ee(null), Fe = "https://api.kelet.ai/api", pt = () => {
|
|
|
604
606
|
"aria-label": r["aria-label"] || y,
|
|
605
607
|
"aria-describedby": p ? void 0 : "submit-help"
|
|
606
608
|
};
|
|
607
|
-
return
|
|
609
|
+
return t && Z(e) ? /* @__PURE__ */ L.jsxs(L.Fragment, { children: [
|
|
608
610
|
Q(
|
|
609
611
|
e,
|
|
610
612
|
ee(m, e.props)
|
|
611
613
|
),
|
|
612
|
-
!p && /* @__PURE__ */
|
|
613
|
-
] }) : /* @__PURE__ */
|
|
614
|
+
!p && /* @__PURE__ */ L.jsx("span", { id: "submit-help", className: "sr-only", children: "This will close the dialog without submitting feedback" })
|
|
615
|
+
] }) : /* @__PURE__ */ L.jsxs("button", { ...m, children: [
|
|
614
616
|
e,
|
|
615
|
-
!p && /* @__PURE__ */
|
|
617
|
+
!p && /* @__PURE__ */ L.jsx("span", { id: "submit-help", className: "sr-only", children: "This will close the dialog without submitting feedback" })
|
|
616
618
|
] });
|
|
617
619
|
}, mt = {
|
|
618
620
|
Root: Le,
|
|
@@ -623,12 +625,12 @@ const se = Ee(null), Fe = "https://api.kelet.ai/api", pt = () => {
|
|
|
623
625
|
SubmitButton: Ye
|
|
624
626
|
};
|
|
625
627
|
var ie = { exports: {} }, ze = ie.exports, he;
|
|
626
|
-
function
|
|
627
|
-
return he || (he = 1, function(
|
|
628
|
-
(function(
|
|
629
|
-
var o = r(
|
|
630
|
-
|
|
631
|
-
})(ze, function(
|
|
628
|
+
function He() {
|
|
629
|
+
return he || (he = 1, function(t, e) {
|
|
630
|
+
(function(n, r) {
|
|
631
|
+
var o = r(n);
|
|
632
|
+
t.exports = o;
|
|
633
|
+
})(ze, function(n) {
|
|
632
634
|
var r = ["N", "E", "A", "D"];
|
|
633
635
|
function o(i, l) {
|
|
634
636
|
i.super_ = l, i.prototype = Object.create(l.prototype, {
|
|
@@ -687,11 +689,11 @@ function Ke() {
|
|
|
687
689
|
var c = i.slice(l + 1 || i.length);
|
|
688
690
|
return i.length = l < 0 ? i.length + l : l, i.push.apply(i, c), i;
|
|
689
691
|
}
|
|
690
|
-
function
|
|
692
|
+
function C(i) {
|
|
691
693
|
var l = typeof i;
|
|
692
694
|
return l !== "object" ? l : i === Math ? "math" : i === null ? "null" : Array.isArray(i) ? "array" : Object.prototype.toString.call(i) === "[object Date]" ? "date" : typeof i.toString == "function" && /^\/.*\//.test(i.toString()) ? "regexp" : "object";
|
|
693
695
|
}
|
|
694
|
-
function
|
|
696
|
+
function E(i) {
|
|
695
697
|
var l = 0;
|
|
696
698
|
if (i.length === 0)
|
|
697
699
|
return l;
|
|
@@ -701,128 +703,128 @@ function Ke() {
|
|
|
701
703
|
}
|
|
702
704
|
return l;
|
|
703
705
|
}
|
|
704
|
-
function
|
|
705
|
-
var l = 0, s =
|
|
706
|
+
function P(i) {
|
|
707
|
+
var l = 0, s = C(i);
|
|
706
708
|
if (s === "array") {
|
|
707
709
|
i.forEach(function(M) {
|
|
708
|
-
l +=
|
|
710
|
+
l += P(M);
|
|
709
711
|
});
|
|
710
712
|
var c = "[type: array, hash: " + l + "]";
|
|
711
|
-
return l +
|
|
713
|
+
return l + E(c);
|
|
712
714
|
}
|
|
713
715
|
if (s === "object") {
|
|
714
|
-
for (var
|
|
715
|
-
if (i.hasOwnProperty(
|
|
716
|
-
var D = "[ type: object, key: " +
|
|
717
|
-
l +=
|
|
716
|
+
for (var v in i)
|
|
717
|
+
if (i.hasOwnProperty(v)) {
|
|
718
|
+
var D = "[ type: object, key: " + v + ", value hash: " + P(i[v]) + "]";
|
|
719
|
+
l += E(D);
|
|
718
720
|
}
|
|
719
721
|
return l;
|
|
720
722
|
}
|
|
721
723
|
var x = "[ type: " + s + " ; value: " + i + "]";
|
|
722
|
-
return l +
|
|
724
|
+
return l + E(x);
|
|
723
725
|
}
|
|
724
|
-
function h(i, l, s, c,
|
|
725
|
-
s = s || [],
|
|
726
|
-
var
|
|
726
|
+
function h(i, l, s, c, v, D, x, M) {
|
|
727
|
+
s = s || [], v = v || [], x = x || [];
|
|
728
|
+
var I = v.slice(0);
|
|
727
729
|
if (typeof D < "u" && D !== null) {
|
|
728
730
|
if (c) {
|
|
729
|
-
if (typeof c == "function" && c(
|
|
731
|
+
if (typeof c == "function" && c(I, D))
|
|
730
732
|
return;
|
|
731
733
|
if (typeof c == "object") {
|
|
732
|
-
if (c.prefilter && c.prefilter(
|
|
734
|
+
if (c.prefilter && c.prefilter(I, D))
|
|
733
735
|
return;
|
|
734
736
|
if (c.normalize) {
|
|
735
|
-
var
|
|
736
|
-
|
|
737
|
+
var U = c.normalize(I, D, i, l);
|
|
738
|
+
U && (i = U[0], l = U[1]);
|
|
737
739
|
}
|
|
738
740
|
}
|
|
739
741
|
}
|
|
740
|
-
|
|
742
|
+
I.push(D);
|
|
741
743
|
}
|
|
742
|
-
|
|
743
|
-
var J = typeof i, ne = typeof l, a, T, _,
|
|
744
|
+
C(i) === "regexp" && C(l) === "regexp" && (i = i.toString(), l = l.toString());
|
|
745
|
+
var J = typeof i, ne = typeof l, a, T, _, j, q = J !== "undefined" || x && x.length > 0 && x[x.length - 1].lhs && Object.getOwnPropertyDescriptor(x[x.length - 1].lhs, D), $ = ne !== "undefined" || x && x.length > 0 && x[x.length - 1].rhs && Object.getOwnPropertyDescriptor(x[x.length - 1].rhs, D);
|
|
744
746
|
if (!q && $)
|
|
745
|
-
s.push(new f(
|
|
747
|
+
s.push(new f(I, l));
|
|
746
748
|
else if (!$ && q)
|
|
747
|
-
s.push(new p(
|
|
748
|
-
else if (
|
|
749
|
-
s.push(new d(
|
|
750
|
-
else if (
|
|
751
|
-
s.push(new d(
|
|
749
|
+
s.push(new p(I, i));
|
|
750
|
+
else if (C(i) !== C(l))
|
|
751
|
+
s.push(new d(I, i, l));
|
|
752
|
+
else if (C(i) === "date" && i - l !== 0)
|
|
753
|
+
s.push(new d(I, i, l));
|
|
752
754
|
else if (J === "object" && i !== null && l !== null) {
|
|
753
755
|
for (a = x.length - 1; a > -1; --a)
|
|
754
756
|
if (x[a].lhs === i) {
|
|
755
|
-
|
|
757
|
+
j = !0;
|
|
756
758
|
break;
|
|
757
759
|
}
|
|
758
|
-
if (
|
|
759
|
-
i !== l && s.push(new d(
|
|
760
|
+
if (j)
|
|
761
|
+
i !== l && s.push(new d(I, i, l));
|
|
760
762
|
else {
|
|
761
763
|
if (x.push({ lhs: i, rhs: l }), Array.isArray(i)) {
|
|
762
|
-
for (M && (i.sort(function(
|
|
763
|
-
return
|
|
764
|
-
}), l.sort(function(
|
|
765
|
-
return
|
|
764
|
+
for (M && (i.sort(function(S, Y) {
|
|
765
|
+
return P(S) - P(Y);
|
|
766
|
+
}), l.sort(function(S, Y) {
|
|
767
|
+
return P(S) - P(Y);
|
|
766
768
|
})), a = l.length - 1, T = i.length - 1; a > T; )
|
|
767
|
-
s.push(new y(
|
|
769
|
+
s.push(new y(I, a, new f(void 0, l[a--])));
|
|
768
770
|
for (; T > a; )
|
|
769
|
-
s.push(new y(
|
|
771
|
+
s.push(new y(I, T, new p(void 0, i[T--])));
|
|
770
772
|
for (; a >= 0; --a)
|
|
771
|
-
h(i[a], l[a], s, c,
|
|
773
|
+
h(i[a], l[a], s, c, I, a, x, M);
|
|
772
774
|
} else {
|
|
773
775
|
var B = Object.keys(i), K = Object.keys(l);
|
|
774
776
|
for (a = 0; a < B.length; ++a)
|
|
775
|
-
_ = B[a],
|
|
777
|
+
_ = B[a], j = K.indexOf(_), j >= 0 ? (h(i[_], l[_], s, c, I, _, x, M), K[j] = null) : h(i[_], void 0, s, c, I, _, x, M);
|
|
776
778
|
for (a = 0; a < K.length; ++a)
|
|
777
|
-
_ = K[a], _ && h(void 0, l[_], s, c,
|
|
779
|
+
_ = K[a], _ && h(void 0, l[_], s, c, I, _, x, M);
|
|
778
780
|
}
|
|
779
781
|
x.length = x.length - 1;
|
|
780
782
|
}
|
|
781
|
-
} else i !== l && (J === "number" && isNaN(i) && isNaN(l) || s.push(new d(
|
|
783
|
+
} else i !== l && (J === "number" && isNaN(i) && isNaN(l) || s.push(new d(I, i, l)));
|
|
782
784
|
}
|
|
783
|
-
function
|
|
785
|
+
function w(i, l, s, c, v) {
|
|
784
786
|
var D = [];
|
|
785
|
-
if (h(i, l, D, c, null, null, null,
|
|
787
|
+
if (h(i, l, D, c, null, null, null, v), s)
|
|
786
788
|
for (var x = 0; x < D.length; ++x)
|
|
787
789
|
s(D[x]);
|
|
788
790
|
return D;
|
|
789
791
|
}
|
|
790
|
-
function
|
|
791
|
-
return h(i, l, s, c,
|
|
792
|
+
function A(i, l, s, c, v, D, x) {
|
|
793
|
+
return h(i, l, s, c, v, D, x, !0);
|
|
792
794
|
}
|
|
793
|
-
function
|
|
794
|
-
var
|
|
795
|
+
function R(i, l, s, c) {
|
|
796
|
+
var v = c ? function(x) {
|
|
795
797
|
x && c.push(x);
|
|
796
|
-
} : void 0, D =
|
|
798
|
+
} : void 0, D = w(i, l, v, s);
|
|
797
799
|
return c || (D.length ? D : void 0);
|
|
798
800
|
}
|
|
799
|
-
function
|
|
800
|
-
var
|
|
801
|
+
function b(i, l, s, c) {
|
|
802
|
+
var v = c ? function(x) {
|
|
801
803
|
x && c.push(x);
|
|
802
|
-
} : void 0, D =
|
|
804
|
+
} : void 0, D = w(i, l, v, s, !0);
|
|
803
805
|
return c || (D.length ? D : void 0);
|
|
804
806
|
}
|
|
805
|
-
function
|
|
807
|
+
function g(i, l, s) {
|
|
806
808
|
if (s.path && s.path.length) {
|
|
807
|
-
var c = i[l],
|
|
808
|
-
for (
|
|
809
|
-
c = c[s.path[
|
|
809
|
+
var c = i[l], v, D = s.path.length - 1;
|
|
810
|
+
for (v = 0; v < D; v++)
|
|
811
|
+
c = c[s.path[v]];
|
|
810
812
|
switch (s.kind) {
|
|
811
813
|
case "A":
|
|
812
|
-
|
|
814
|
+
g(c[s.path[v]], s.index, s.item);
|
|
813
815
|
break;
|
|
814
816
|
case "D":
|
|
815
|
-
delete c[s.path[
|
|
817
|
+
delete c[s.path[v]];
|
|
816
818
|
break;
|
|
817
819
|
case "E":
|
|
818
820
|
case "N":
|
|
819
|
-
c[s.path[
|
|
821
|
+
c[s.path[v]] = s.rhs;
|
|
820
822
|
break;
|
|
821
823
|
}
|
|
822
824
|
} else
|
|
823
825
|
switch (s.kind) {
|
|
824
826
|
case "A":
|
|
825
|
-
|
|
827
|
+
g(i[l], s.index, s.item);
|
|
826
828
|
break;
|
|
827
829
|
case "D":
|
|
828
830
|
i = m(i, l);
|
|
@@ -834,47 +836,47 @@ function Ke() {
|
|
|
834
836
|
}
|
|
835
837
|
return i;
|
|
836
838
|
}
|
|
837
|
-
function
|
|
839
|
+
function k(i, l, s) {
|
|
838
840
|
if (typeof s > "u" && l && ~r.indexOf(l.kind) && (s = l), i && s && s.kind) {
|
|
839
|
-
for (var c = i,
|
|
840
|
-
typeof c[s.path[
|
|
841
|
+
for (var c = i, v = -1, D = s.path ? s.path.length - 1 : 0; ++v < D; )
|
|
842
|
+
typeof c[s.path[v]] > "u" && (c[s.path[v]] = typeof s.path[v + 1] < "u" && typeof s.path[v + 1] == "number" ? [] : {}), c = c[s.path[v]];
|
|
841
843
|
switch (s.kind) {
|
|
842
844
|
case "A":
|
|
843
|
-
s.path && typeof c[s.path[
|
|
845
|
+
s.path && typeof c[s.path[v]] > "u" && (c[s.path[v]] = []), g(s.path ? c[s.path[v]] : c, s.index, s.item);
|
|
844
846
|
break;
|
|
845
847
|
case "D":
|
|
846
|
-
delete c[s.path[
|
|
848
|
+
delete c[s.path[v]];
|
|
847
849
|
break;
|
|
848
850
|
case "E":
|
|
849
851
|
case "N":
|
|
850
|
-
c[s.path[
|
|
852
|
+
c[s.path[v]] = s.rhs;
|
|
851
853
|
break;
|
|
852
854
|
}
|
|
853
855
|
}
|
|
854
856
|
}
|
|
855
|
-
function
|
|
857
|
+
function O(i, l, s) {
|
|
856
858
|
if (s.path && s.path.length) {
|
|
857
|
-
var c = i[l],
|
|
858
|
-
for (
|
|
859
|
-
c = c[s.path[
|
|
859
|
+
var c = i[l], v, D = s.path.length - 1;
|
|
860
|
+
for (v = 0; v < D; v++)
|
|
861
|
+
c = c[s.path[v]];
|
|
860
862
|
switch (s.kind) {
|
|
861
863
|
case "A":
|
|
862
|
-
|
|
864
|
+
O(c[s.path[v]], s.index, s.item);
|
|
863
865
|
break;
|
|
864
866
|
case "D":
|
|
865
|
-
c[s.path[
|
|
867
|
+
c[s.path[v]] = s.lhs;
|
|
866
868
|
break;
|
|
867
869
|
case "E":
|
|
868
|
-
c[s.path[
|
|
870
|
+
c[s.path[v]] = s.lhs;
|
|
869
871
|
break;
|
|
870
872
|
case "N":
|
|
871
|
-
delete c[s.path[
|
|
873
|
+
delete c[s.path[v]];
|
|
872
874
|
break;
|
|
873
875
|
}
|
|
874
876
|
} else
|
|
875
877
|
switch (s.kind) {
|
|
876
878
|
case "A":
|
|
877
|
-
|
|
879
|
+
O(i[l], s.index, s.item);
|
|
878
880
|
break;
|
|
879
881
|
case "D":
|
|
880
882
|
i[l] = s.lhs;
|
|
@@ -888,66 +890,66 @@ function Ke() {
|
|
|
888
890
|
}
|
|
889
891
|
return i;
|
|
890
892
|
}
|
|
891
|
-
function
|
|
893
|
+
function N(i, l, s) {
|
|
892
894
|
if (i && l && s && s.kind) {
|
|
893
|
-
var c = i,
|
|
894
|
-
for (D = s.path.length - 1,
|
|
895
|
-
typeof c[s.path[
|
|
895
|
+
var c = i, v, D;
|
|
896
|
+
for (D = s.path.length - 1, v = 0; v < D; v++)
|
|
897
|
+
typeof c[s.path[v]] > "u" && (c[s.path[v]] = {}), c = c[s.path[v]];
|
|
896
898
|
switch (s.kind) {
|
|
897
899
|
case "A":
|
|
898
|
-
|
|
900
|
+
O(c[s.path[v]], s.index, s.item);
|
|
899
901
|
break;
|
|
900
902
|
case "D":
|
|
901
|
-
c[s.path[
|
|
903
|
+
c[s.path[v]] = s.lhs;
|
|
902
904
|
break;
|
|
903
905
|
case "E":
|
|
904
|
-
c[s.path[
|
|
906
|
+
c[s.path[v]] = s.lhs;
|
|
905
907
|
break;
|
|
906
908
|
case "N":
|
|
907
|
-
delete c[s.path[
|
|
909
|
+
delete c[s.path[v]];
|
|
908
910
|
break;
|
|
909
911
|
}
|
|
910
912
|
}
|
|
911
913
|
}
|
|
912
|
-
function
|
|
914
|
+
function F(i, l, s) {
|
|
913
915
|
if (i && l) {
|
|
914
|
-
var c = function(
|
|
915
|
-
(!s || s(i, l,
|
|
916
|
+
var c = function(v) {
|
|
917
|
+
(!s || s(i, l, v)) && k(i, l, v);
|
|
916
918
|
};
|
|
917
|
-
|
|
919
|
+
w(i, l, c);
|
|
918
920
|
}
|
|
919
921
|
}
|
|
920
|
-
return Object.defineProperties(
|
|
922
|
+
return Object.defineProperties(R, {
|
|
921
923
|
diff: {
|
|
922
|
-
value:
|
|
924
|
+
value: R,
|
|
923
925
|
enumerable: !0
|
|
924
926
|
},
|
|
925
927
|
orderIndependentDiff: {
|
|
926
|
-
value:
|
|
928
|
+
value: b,
|
|
927
929
|
enumerable: !0
|
|
928
930
|
},
|
|
929
931
|
observableDiff: {
|
|
930
|
-
value:
|
|
932
|
+
value: w,
|
|
931
933
|
enumerable: !0
|
|
932
934
|
},
|
|
933
935
|
orderIndependentObservableDiff: {
|
|
934
|
-
value:
|
|
936
|
+
value: A,
|
|
935
937
|
enumerable: !0
|
|
936
938
|
},
|
|
937
939
|
orderIndepHash: {
|
|
938
|
-
value:
|
|
940
|
+
value: P,
|
|
939
941
|
enumerable: !0
|
|
940
942
|
},
|
|
941
943
|
applyDiff: {
|
|
942
|
-
value:
|
|
944
|
+
value: F,
|
|
943
945
|
enumerable: !0
|
|
944
946
|
},
|
|
945
947
|
applyChange: {
|
|
946
|
-
value:
|
|
948
|
+
value: k,
|
|
947
949
|
enumerable: !0
|
|
948
950
|
},
|
|
949
951
|
revertChange: {
|
|
950
|
-
value:
|
|
952
|
+
value: N,
|
|
951
953
|
enumerable: !0
|
|
952
954
|
},
|
|
953
955
|
isConflict: {
|
|
@@ -956,80 +958,80 @@ function Ke() {
|
|
|
956
958
|
},
|
|
957
959
|
enumerable: !0
|
|
958
960
|
}
|
|
959
|
-
}),
|
|
961
|
+
}), R.DeepDiff = R, n && (n.DeepDiff = R), R;
|
|
960
962
|
});
|
|
961
963
|
}(ie)), ie.exports;
|
|
962
964
|
}
|
|
963
|
-
var Te =
|
|
964
|
-
const
|
|
965
|
-
const
|
|
966
|
-
let u = -1, d = 0, f =
|
|
965
|
+
var Te = He(), oe = { exports: {} };
|
|
966
|
+
const H = new Uint32Array(65536), Ke = (t, e) => {
|
|
967
|
+
const n = t.length, r = e.length, o = 1 << n - 1;
|
|
968
|
+
let u = -1, d = 0, f = n, p = n;
|
|
967
969
|
for (; p--; )
|
|
968
|
-
|
|
970
|
+
H[t.charCodeAt(p)] |= 1 << p;
|
|
969
971
|
for (p = 0; p < r; p++) {
|
|
970
|
-
let y =
|
|
972
|
+
let y = H[e.charCodeAt(p)];
|
|
971
973
|
const m = y | d;
|
|
972
974
|
y |= (y & u) + u ^ u, d |= ~(y | u), u &= y, d & o && f++, u & o && f--, d = d << 1 | 1, u = u << 1 | ~(m | d), d &= m;
|
|
973
975
|
}
|
|
974
|
-
for (p =
|
|
975
|
-
|
|
976
|
+
for (p = n; p--; )
|
|
977
|
+
H[t.charCodeAt(p)] = 0;
|
|
976
978
|
return f;
|
|
977
|
-
},
|
|
978
|
-
const
|
|
979
|
+
}, Ue = (t, e) => {
|
|
980
|
+
const n = e.length, r = t.length, o = [], u = [], d = Math.ceil(n / 32), f = Math.ceil(r / 32);
|
|
979
981
|
for (let h = 0; h < d; h++)
|
|
980
982
|
u[h] = -1, o[h] = 0;
|
|
981
983
|
let p = 0;
|
|
982
984
|
for (; p < f - 1; p++) {
|
|
983
|
-
let h = 0,
|
|
984
|
-
const
|
|
985
|
-
for (let
|
|
986
|
-
|
|
987
|
-
for (let
|
|
988
|
-
const
|
|
989
|
-
let i = h | ~(
|
|
990
|
-
i >>> 31 ^
|
|
985
|
+
let h = 0, w = -1;
|
|
986
|
+
const A = p * 32, R = Math.min(32, r) + A;
|
|
987
|
+
for (let b = A; b < R; b++)
|
|
988
|
+
H[t.charCodeAt(b)] |= 1 << b;
|
|
989
|
+
for (let b = 0; b < n; b++) {
|
|
990
|
+
const g = H[e.charCodeAt(b)], k = u[b / 32 | 0] >>> b & 1, O = o[b / 32 | 0] >>> b & 1, N = g | h, F = ((g | O) & w) + w ^ w | g | O;
|
|
991
|
+
let i = h | ~(F | w), l = w & F;
|
|
992
|
+
i >>> 31 ^ k && (u[b / 32 | 0] ^= 1 << b), l >>> 31 ^ O && (o[b / 32 | 0] ^= 1 << b), i = i << 1 | k, l = l << 1 | O, w = l | ~(N | i), h = i & N;
|
|
991
993
|
}
|
|
992
|
-
for (let
|
|
993
|
-
|
|
994
|
+
for (let b = A; b < R; b++)
|
|
995
|
+
H[t.charCodeAt(b)] = 0;
|
|
994
996
|
}
|
|
995
997
|
let y = 0, m = -1;
|
|
996
|
-
const
|
|
997
|
-
for (let h =
|
|
998
|
-
|
|
999
|
-
let
|
|
1000
|
-
for (let h = 0; h <
|
|
1001
|
-
const
|
|
1002
|
-
let
|
|
1003
|
-
|
|
998
|
+
const C = p * 32, E = Math.min(32, r - C) + C;
|
|
999
|
+
for (let h = C; h < E; h++)
|
|
1000
|
+
H[t.charCodeAt(h)] |= 1 << h;
|
|
1001
|
+
let P = r;
|
|
1002
|
+
for (let h = 0; h < n; h++) {
|
|
1003
|
+
const w = H[e.charCodeAt(h)], A = u[h / 32 | 0] >>> h & 1, R = o[h / 32 | 0] >>> h & 1, b = w | y, g = ((w | R) & m) + m ^ m | w | R;
|
|
1004
|
+
let k = y | ~(g | m), O = m & g;
|
|
1005
|
+
P += k >>> r - 1 & 1, P -= O >>> r - 1 & 1, k >>> 31 ^ A && (u[h / 32 | 0] ^= 1 << h), O >>> 31 ^ R && (o[h / 32 | 0] ^= 1 << h), k = k << 1 | A, O = O << 1 | R, m = O | ~(b | k), y = k & b;
|
|
1004
1006
|
}
|
|
1005
|
-
for (let h =
|
|
1006
|
-
|
|
1007
|
-
return
|
|
1008
|
-
}, Ce = (
|
|
1009
|
-
if (
|
|
1010
|
-
const
|
|
1011
|
-
e =
|
|
1007
|
+
for (let h = C; h < E; h++)
|
|
1008
|
+
H[t.charCodeAt(h)] = 0;
|
|
1009
|
+
return P;
|
|
1010
|
+
}, Ce = (t, e) => {
|
|
1011
|
+
if (t.length < e.length) {
|
|
1012
|
+
const n = e;
|
|
1013
|
+
e = t, t = n;
|
|
1012
1014
|
}
|
|
1013
|
-
return e.length === 0 ?
|
|
1014
|
-
}, Je = (
|
|
1015
|
-
let
|
|
1015
|
+
return e.length === 0 ? t.length : t.length <= 32 ? Ke(t, e) : Ue(t, e);
|
|
1016
|
+
}, Je = (t, e) => {
|
|
1017
|
+
let n = 1 / 0, r = 0;
|
|
1016
1018
|
for (let o = 0; o < e.length; o++) {
|
|
1017
|
-
const u = Ce(
|
|
1018
|
-
u <
|
|
1019
|
+
const u = Ce(t, e[o]);
|
|
1020
|
+
u < n && (n = u, r = o);
|
|
1019
1021
|
}
|
|
1020
1022
|
return e[r];
|
|
1021
1023
|
}, Be = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1022
1024
|
__proto__: null,
|
|
1023
1025
|
closest: Je,
|
|
1024
1026
|
distance: Ce
|
|
1025
|
-
}, Symbol.toStringTag, { value: "Module" })), Ve = /* @__PURE__ */
|
|
1027
|
+
}, Symbol.toStringTag, { value: "Module" })), Ve = /* @__PURE__ */ je(Be);
|
|
1026
1028
|
var me;
|
|
1027
1029
|
function Ge() {
|
|
1028
|
-
return me || (me = 1, function(
|
|
1030
|
+
return me || (me = 1, function(t, e) {
|
|
1029
1031
|
(function() {
|
|
1030
|
-
var
|
|
1032
|
+
var n;
|
|
1031
1033
|
try {
|
|
1032
|
-
|
|
1034
|
+
n = typeof Intl < "u" && typeof Intl.Collator < "u" ? Intl.Collator("generic", { sensitivity: "base" }) : null;
|
|
1033
1035
|
} catch {
|
|
1034
1036
|
console.log("Collator could not be initialized and wouldn't be used");
|
|
1035
1037
|
}
|
|
@@ -1044,137 +1046,137 @@ function Ge() {
|
|
|
1044
1046
|
* @return Integer the levenshtein distance (0 and above).
|
|
1045
1047
|
*/
|
|
1046
1048
|
get: function(f, p, y) {
|
|
1047
|
-
var m = y &&
|
|
1049
|
+
var m = y && n && y.useCollator;
|
|
1048
1050
|
if (m) {
|
|
1049
|
-
var
|
|
1050
|
-
if (
|
|
1051
|
-
if (
|
|
1052
|
-
var
|
|
1053
|
-
for (
|
|
1054
|
-
o[
|
|
1055
|
-
o[
|
|
1056
|
-
var
|
|
1057
|
-
for (
|
|
1058
|
-
for (h =
|
|
1059
|
-
|
|
1060
|
-
o[
|
|
1051
|
+
var C = f.length, E = p.length;
|
|
1052
|
+
if (C === 0) return E;
|
|
1053
|
+
if (E === 0) return C;
|
|
1054
|
+
var P, h, w, A, R;
|
|
1055
|
+
for (w = 0; w < E; ++w)
|
|
1056
|
+
o[w] = w, u[w] = p.charCodeAt(w);
|
|
1057
|
+
o[E] = E;
|
|
1058
|
+
var b;
|
|
1059
|
+
for (w = 0; w < C; ++w) {
|
|
1060
|
+
for (h = w + 1, A = 0; A < E; ++A)
|
|
1061
|
+
P = h, b = n.compare(f.charAt(w), String.fromCharCode(u[A])) === 0, h = o[A] + (b ? 0 : 1), R = P + 1, h > R && (h = R), R = o[A + 1] + 1, h > R && (h = R), o[A] = P;
|
|
1062
|
+
o[A] = h;
|
|
1061
1063
|
}
|
|
1062
1064
|
return h;
|
|
1063
1065
|
}
|
|
1064
1066
|
return r.distance(f, p);
|
|
1065
1067
|
}
|
|
1066
1068
|
};
|
|
1067
|
-
|
|
1069
|
+
t !== null && t.exports === e ? t.exports = d : typeof self < "u" && typeof self.postMessage == "function" && typeof self.importScripts == "function" ? self.Levenshtein = d : typeof window < "u" && window !== null && (window.Levenshtein = d);
|
|
1068
1070
|
})();
|
|
1069
1071
|
}(oe, oe.exports)), oe.exports;
|
|
1070
1072
|
}
|
|
1071
1073
|
var Xe = Ge();
|
|
1072
1074
|
const Ze = /* @__PURE__ */ _e(Xe);
|
|
1073
1075
|
class Qe {
|
|
1074
|
-
diff(e,
|
|
1076
|
+
diff(e, n, r = {}) {
|
|
1075
1077
|
let o;
|
|
1076
1078
|
typeof r == "function" ? (o = r, r = {}) : "callback" in r && (o = r.callback);
|
|
1077
|
-
const u = this.castInput(e, r), d = this.castInput(
|
|
1079
|
+
const u = this.castInput(e, r), d = this.castInput(n, r), f = this.removeEmpty(this.tokenize(u, r)), p = this.removeEmpty(this.tokenize(d, r));
|
|
1078
1080
|
return this.diffWithOptionsObj(f, p, r, o);
|
|
1079
1081
|
}
|
|
1080
|
-
diffWithOptionsObj(e,
|
|
1082
|
+
diffWithOptionsObj(e, n, r, o) {
|
|
1081
1083
|
var u;
|
|
1082
|
-
const d = (
|
|
1083
|
-
if (
|
|
1084
|
+
const d = (b) => {
|
|
1085
|
+
if (b = this.postProcess(b, r), o) {
|
|
1084
1086
|
setTimeout(function() {
|
|
1085
|
-
o(
|
|
1087
|
+
o(b);
|
|
1086
1088
|
}, 0);
|
|
1087
1089
|
return;
|
|
1088
1090
|
} else
|
|
1089
|
-
return
|
|
1090
|
-
}, f =
|
|
1091
|
+
return b;
|
|
1092
|
+
}, f = n.length, p = e.length;
|
|
1091
1093
|
let y = 1, m = f + p;
|
|
1092
1094
|
r.maxEditLength != null && (m = Math.min(m, r.maxEditLength));
|
|
1093
|
-
const
|
|
1094
|
-
let h = this.extractCommon(
|
|
1095
|
-
if (
|
|
1096
|
-
return d(this.buildValues(
|
|
1097
|
-
let
|
|
1098
|
-
const
|
|
1099
|
-
for (let
|
|
1100
|
-
let
|
|
1101
|
-
const
|
|
1102
|
-
|
|
1103
|
-
let
|
|
1104
|
-
if (
|
|
1105
|
-
const i =
|
|
1106
|
-
|
|
1095
|
+
const C = (u = r.timeout) !== null && u !== void 0 ? u : 1 / 0, E = Date.now() + C, P = [{ oldPos: -1, lastComponent: void 0 }];
|
|
1096
|
+
let h = this.extractCommon(P[0], n, e, 0, r);
|
|
1097
|
+
if (P[0].oldPos + 1 >= p && h + 1 >= f)
|
|
1098
|
+
return d(this.buildValues(P[0].lastComponent, n, e));
|
|
1099
|
+
let w = -1 / 0, A = 1 / 0;
|
|
1100
|
+
const R = () => {
|
|
1101
|
+
for (let b = Math.max(w, -y); b <= Math.min(A, y); b += 2) {
|
|
1102
|
+
let g;
|
|
1103
|
+
const k = P[b - 1], O = P[b + 1];
|
|
1104
|
+
k && (P[b - 1] = void 0);
|
|
1105
|
+
let N = !1;
|
|
1106
|
+
if (O) {
|
|
1107
|
+
const i = O.oldPos - b;
|
|
1108
|
+
N = O && 0 <= i && i < f;
|
|
1107
1109
|
}
|
|
1108
|
-
const
|
|
1109
|
-
if (!
|
|
1110
|
-
|
|
1110
|
+
const F = k && k.oldPos + 1 < p;
|
|
1111
|
+
if (!N && !F) {
|
|
1112
|
+
P[b] = void 0;
|
|
1111
1113
|
continue;
|
|
1112
1114
|
}
|
|
1113
|
-
if (!
|
|
1114
|
-
return d(this.buildValues(
|
|
1115
|
-
|
|
1115
|
+
if (!F || N && k.oldPos < O.oldPos ? g = this.addToPath(O, !0, !1, 0, r) : g = this.addToPath(k, !1, !0, 1, r), h = this.extractCommon(g, n, e, b, r), g.oldPos + 1 >= p && h + 1 >= f)
|
|
1116
|
+
return d(this.buildValues(g.lastComponent, n, e)) || !0;
|
|
1117
|
+
P[b] = g, g.oldPos + 1 >= p && (A = Math.min(A, b - 1)), h + 1 >= f && (w = Math.max(w, b + 1));
|
|
1116
1118
|
}
|
|
1117
1119
|
y++;
|
|
1118
1120
|
};
|
|
1119
1121
|
if (o)
|
|
1120
|
-
(function
|
|
1122
|
+
(function b() {
|
|
1121
1123
|
setTimeout(function() {
|
|
1122
|
-
if (y > m || Date.now() >
|
|
1124
|
+
if (y > m || Date.now() > E)
|
|
1123
1125
|
return o(void 0);
|
|
1124
|
-
|
|
1126
|
+
R() || b();
|
|
1125
1127
|
}, 0);
|
|
1126
1128
|
})();
|
|
1127
1129
|
else
|
|
1128
|
-
for (; y <= m && Date.now() <=
|
|
1129
|
-
const
|
|
1130
|
-
if (
|
|
1131
|
-
return
|
|
1130
|
+
for (; y <= m && Date.now() <= E; ) {
|
|
1131
|
+
const b = R();
|
|
1132
|
+
if (b)
|
|
1133
|
+
return b;
|
|
1132
1134
|
}
|
|
1133
1135
|
}
|
|
1134
|
-
addToPath(e,
|
|
1136
|
+
addToPath(e, n, r, o, u) {
|
|
1135
1137
|
const d = e.lastComponent;
|
|
1136
|
-
return d && !u.oneChangePerToken && d.added ===
|
|
1138
|
+
return d && !u.oneChangePerToken && d.added === n && d.removed === r ? {
|
|
1137
1139
|
oldPos: e.oldPos + o,
|
|
1138
|
-
lastComponent: { count: d.count + 1, added:
|
|
1140
|
+
lastComponent: { count: d.count + 1, added: n, removed: r, previousComponent: d.previousComponent }
|
|
1139
1141
|
} : {
|
|
1140
1142
|
oldPos: e.oldPos + o,
|
|
1141
|
-
lastComponent: { count: 1, added:
|
|
1143
|
+
lastComponent: { count: 1, added: n, removed: r, previousComponent: d }
|
|
1142
1144
|
};
|
|
1143
1145
|
}
|
|
1144
|
-
extractCommon(e,
|
|
1145
|
-
const d =
|
|
1146
|
+
extractCommon(e, n, r, o, u) {
|
|
1147
|
+
const d = n.length, f = r.length;
|
|
1146
1148
|
let p = e.oldPos, y = p - o, m = 0;
|
|
1147
|
-
for (; y + 1 < d && p + 1 < f && this.equals(r[p + 1],
|
|
1149
|
+
for (; y + 1 < d && p + 1 < f && this.equals(r[p + 1], n[y + 1], u); )
|
|
1148
1150
|
y++, p++, m++, u.oneChangePerToken && (e.lastComponent = { count: 1, previousComponent: e.lastComponent, added: !1, removed: !1 });
|
|
1149
1151
|
return m && !u.oneChangePerToken && (e.lastComponent = { count: m, previousComponent: e.lastComponent, added: !1, removed: !1 }), e.oldPos = p, y;
|
|
1150
1152
|
}
|
|
1151
|
-
equals(e,
|
|
1152
|
-
return r.comparator ? r.comparator(e,
|
|
1153
|
+
equals(e, n, r) {
|
|
1154
|
+
return r.comparator ? r.comparator(e, n) : e === n || !!r.ignoreCase && e.toLowerCase() === n.toLowerCase();
|
|
1153
1155
|
}
|
|
1154
1156
|
removeEmpty(e) {
|
|
1155
|
-
const
|
|
1157
|
+
const n = [];
|
|
1156
1158
|
for (let r = 0; r < e.length; r++)
|
|
1157
|
-
e[r] &&
|
|
1158
|
-
return
|
|
1159
|
+
e[r] && n.push(e[r]);
|
|
1160
|
+
return n;
|
|
1159
1161
|
}
|
|
1160
1162
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1161
|
-
castInput(e,
|
|
1163
|
+
castInput(e, n) {
|
|
1162
1164
|
return e;
|
|
1163
1165
|
}
|
|
1164
1166
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1165
|
-
tokenize(e,
|
|
1167
|
+
tokenize(e, n) {
|
|
1166
1168
|
return Array.from(e);
|
|
1167
1169
|
}
|
|
1168
1170
|
join(e) {
|
|
1169
1171
|
return e.join("");
|
|
1170
1172
|
}
|
|
1171
|
-
postProcess(e,
|
|
1173
|
+
postProcess(e, n) {
|
|
1172
1174
|
return e;
|
|
1173
1175
|
}
|
|
1174
1176
|
get useLongestToken() {
|
|
1175
1177
|
return !1;
|
|
1176
1178
|
}
|
|
1177
|
-
buildValues(e,
|
|
1179
|
+
buildValues(e, n, r) {
|
|
1178
1180
|
const o = [];
|
|
1179
1181
|
let u;
|
|
1180
1182
|
for (; e; )
|
|
@@ -1188,13 +1190,13 @@ class Qe {
|
|
|
1188
1190
|
m.value = this.join(r.slice(y, y + m.count)), y += m.count;
|
|
1189
1191
|
else {
|
|
1190
1192
|
if (!m.added && this.useLongestToken) {
|
|
1191
|
-
let
|
|
1192
|
-
|
|
1193
|
-
const h = r[y +
|
|
1194
|
-
return h.length >
|
|
1195
|
-
}), m.value = this.join(
|
|
1193
|
+
let C = n.slice(p, p + m.count);
|
|
1194
|
+
C = C.map(function(E, P) {
|
|
1195
|
+
const h = r[y + P];
|
|
1196
|
+
return h.length > E.length ? h : E;
|
|
1197
|
+
}), m.value = this.join(C);
|
|
1196
1198
|
} else
|
|
1197
|
-
m.value = this.join(
|
|
1199
|
+
m.value = this.join(n.slice(p, p + m.count));
|
|
1198
1200
|
p += m.count, m.added || (y += m.count);
|
|
1199
1201
|
}
|
|
1200
1202
|
}
|
|
@@ -1205,30 +1207,30 @@ class et extends Qe {
|
|
|
1205
1207
|
constructor() {
|
|
1206
1208
|
super(...arguments), this.tokenize = nt;
|
|
1207
1209
|
}
|
|
1208
|
-
equals(e,
|
|
1210
|
+
equals(e, n, r) {
|
|
1209
1211
|
return r.ignoreWhitespace ? ((!r.newlineIsToken || !e.includes(`
|
|
1210
|
-
`)) && (e = e.trim()), (!r.newlineIsToken || !
|
|
1211
|
-
`)) && (
|
|
1212
|
-
`) && (e = e.slice(0, -1)),
|
|
1213
|
-
`) && (
|
|
1212
|
+
`)) && (e = e.trim()), (!r.newlineIsToken || !n.includes(`
|
|
1213
|
+
`)) && (n = n.trim())) : r.ignoreNewlineAtEof && !r.newlineIsToken && (e.endsWith(`
|
|
1214
|
+
`) && (e = e.slice(0, -1)), n.endsWith(`
|
|
1215
|
+
`) && (n = n.slice(0, -1))), super.equals(e, n, r);
|
|
1214
1216
|
}
|
|
1215
1217
|
}
|
|
1216
1218
|
const tt = new et();
|
|
1217
|
-
function ve(
|
|
1218
|
-
return tt.diff(
|
|
1219
|
+
function ve(t, e, n) {
|
|
1220
|
+
return tt.diff(t, e, n);
|
|
1219
1221
|
}
|
|
1220
|
-
function nt(
|
|
1221
|
-
e.stripTrailingCr && (
|
|
1222
|
+
function nt(t, e) {
|
|
1223
|
+
e.stripTrailingCr && (t = t.replace(/\r\n/g, `
|
|
1222
1224
|
`));
|
|
1223
|
-
const
|
|
1225
|
+
const n = [], r = t.split(/(\n|\r\n)/);
|
|
1224
1226
|
r[r.length - 1] || r.pop();
|
|
1225
1227
|
for (let o = 0; o < r.length; o++) {
|
|
1226
1228
|
const u = r[o];
|
|
1227
|
-
o % 2 && !e.newlineIsToken ?
|
|
1229
|
+
o % 2 && !e.newlineIsToken ? n[n.length - 1] += u : n.push(u);
|
|
1228
1230
|
}
|
|
1229
|
-
return
|
|
1231
|
+
return n;
|
|
1230
1232
|
}
|
|
1231
|
-
function be(
|
|
1233
|
+
function be(t, e, n, r, o, u, d) {
|
|
1232
1234
|
let f;
|
|
1233
1235
|
d ? typeof d == "function" ? f = { callback: d } : f = d : f = {}, typeof f.context > "u" && (f.context = 4);
|
|
1234
1236
|
const p = f.context;
|
|
@@ -1236,75 +1238,75 @@ function be(n, e, t, r, o, u, d) {
|
|
|
1236
1238
|
throw new Error("newlineIsToken may not be used with patch-generation functions, only with diffing functions");
|
|
1237
1239
|
if (f.callback) {
|
|
1238
1240
|
const { callback: m } = f;
|
|
1239
|
-
ve(
|
|
1240
|
-
const
|
|
1241
|
-
m(
|
|
1241
|
+
ve(n, r, Object.assign(Object.assign({}, f), { callback: (C) => {
|
|
1242
|
+
const E = y(C);
|
|
1243
|
+
m(E);
|
|
1242
1244
|
} }));
|
|
1243
1245
|
} else
|
|
1244
|
-
return y(ve(
|
|
1246
|
+
return y(ve(n, r, f));
|
|
1245
1247
|
function y(m) {
|
|
1246
1248
|
if (!m)
|
|
1247
1249
|
return;
|
|
1248
1250
|
m.push({ value: "", lines: [] });
|
|
1249
|
-
function
|
|
1250
|
-
return
|
|
1251
|
-
return " " +
|
|
1251
|
+
function C(b) {
|
|
1252
|
+
return b.map(function(g) {
|
|
1253
|
+
return " " + g;
|
|
1252
1254
|
});
|
|
1253
1255
|
}
|
|
1254
|
-
const
|
|
1255
|
-
let
|
|
1256
|
-
for (let
|
|
1257
|
-
const
|
|
1258
|
-
if (
|
|
1259
|
-
if (!
|
|
1260
|
-
const
|
|
1261
|
-
|
|
1256
|
+
const E = [];
|
|
1257
|
+
let P = 0, h = 0, w = [], A = 1, R = 1;
|
|
1258
|
+
for (let b = 0; b < m.length; b++) {
|
|
1259
|
+
const g = m[b], k = g.lines || ot(g.value);
|
|
1260
|
+
if (g.lines = k, g.added || g.removed) {
|
|
1261
|
+
if (!P) {
|
|
1262
|
+
const O = m[b - 1];
|
|
1263
|
+
P = A, h = R, O && (w = p > 0 ? C(O.lines.slice(-p)) : [], P -= w.length, h -= w.length);
|
|
1262
1264
|
}
|
|
1263
|
-
for (const
|
|
1264
|
-
|
|
1265
|
-
|
|
1265
|
+
for (const O of k)
|
|
1266
|
+
w.push((g.added ? "+" : "-") + O);
|
|
1267
|
+
g.added ? R += k.length : A += k.length;
|
|
1266
1268
|
} else {
|
|
1267
|
-
if (
|
|
1268
|
-
if (
|
|
1269
|
-
for (const
|
|
1270
|
-
|
|
1269
|
+
if (P)
|
|
1270
|
+
if (k.length <= p * 2 && b < m.length - 2)
|
|
1271
|
+
for (const O of C(k))
|
|
1272
|
+
w.push(O);
|
|
1271
1273
|
else {
|
|
1272
|
-
const
|
|
1273
|
-
for (const
|
|
1274
|
-
|
|
1275
|
-
const
|
|
1276
|
-
oldStart:
|
|
1277
|
-
oldLines:
|
|
1274
|
+
const O = Math.min(k.length, p);
|
|
1275
|
+
for (const F of C(k.slice(0, O)))
|
|
1276
|
+
w.push(F);
|
|
1277
|
+
const N = {
|
|
1278
|
+
oldStart: P,
|
|
1279
|
+
oldLines: A - P + O,
|
|
1278
1280
|
newStart: h,
|
|
1279
|
-
newLines:
|
|
1280
|
-
lines:
|
|
1281
|
+
newLines: R - h + O,
|
|
1282
|
+
lines: w
|
|
1281
1283
|
};
|
|
1282
|
-
|
|
1284
|
+
E.push(N), P = 0, h = 0, w = [];
|
|
1283
1285
|
}
|
|
1284
|
-
|
|
1286
|
+
A += k.length, R += k.length;
|
|
1285
1287
|
}
|
|
1286
1288
|
}
|
|
1287
|
-
for (const
|
|
1288
|
-
for (let
|
|
1289
|
-
|
|
1290
|
-
`) ?
|
|
1289
|
+
for (const b of E)
|
|
1290
|
+
for (let g = 0; g < b.lines.length; g++)
|
|
1291
|
+
b.lines[g].endsWith(`
|
|
1292
|
+
`) ? b.lines[g] = b.lines[g].slice(0, -1) : (b.lines.splice(g + 1, 0, "\"), g++);
|
|
1291
1293
|
return {
|
|
1292
|
-
oldFileName:
|
|
1294
|
+
oldFileName: t,
|
|
1293
1295
|
newFileName: e,
|
|
1294
1296
|
oldHeader: o,
|
|
1295
1297
|
newHeader: u,
|
|
1296
|
-
hunks:
|
|
1298
|
+
hunks: E
|
|
1297
1299
|
};
|
|
1298
1300
|
}
|
|
1299
1301
|
}
|
|
1300
|
-
function ue(
|
|
1301
|
-
if (Array.isArray(
|
|
1302
|
-
return
|
|
1302
|
+
function ue(t) {
|
|
1303
|
+
if (Array.isArray(t))
|
|
1304
|
+
return t.map(ue).join(`
|
|
1303
1305
|
`);
|
|
1304
1306
|
const e = [];
|
|
1305
|
-
|
|
1306
|
-
for (let
|
|
1307
|
-
const r =
|
|
1307
|
+
t.oldFileName == t.newFileName && e.push("Index: " + t.oldFileName), e.push("==================================================================="), e.push("--- " + t.oldFileName + (typeof t.oldHeader > "u" ? "" : " " + t.oldHeader)), e.push("+++ " + t.newFileName + (typeof t.newHeader > "u" ? "" : " " + t.newHeader));
|
|
1308
|
+
for (let n = 0; n < t.hunks.length; n++) {
|
|
1309
|
+
const r = t.hunks[n];
|
|
1308
1310
|
r.oldLines === 0 && (r.oldStart -= 1), r.newLines === 0 && (r.newStart -= 1), e.push("@@ -" + r.oldStart + "," + r.oldLines + " +" + r.newStart + "," + r.newLines + " @@");
|
|
1309
1311
|
for (const o of r.lines)
|
|
1310
1312
|
e.push(o);
|
|
@@ -1313,38 +1315,38 @@ function ue(n) {
|
|
|
1313
1315
|
`) + `
|
|
1314
1316
|
`;
|
|
1315
1317
|
}
|
|
1316
|
-
function rt(
|
|
1318
|
+
function rt(t, e, n, r, o, u, d) {
|
|
1317
1319
|
if (typeof d == "function" && (d = { callback: d }), d?.callback) {
|
|
1318
1320
|
const { callback: f } = d;
|
|
1319
|
-
be(
|
|
1321
|
+
be(t, e, n, r, o, u, Object.assign(Object.assign({}, d), { callback: (p) => {
|
|
1320
1322
|
f(p ? ue(p) : void 0);
|
|
1321
1323
|
} }));
|
|
1322
1324
|
} else {
|
|
1323
|
-
const f = be(
|
|
1325
|
+
const f = be(t, e, n, r, o, u, d);
|
|
1324
1326
|
return f ? ue(f) : void 0;
|
|
1325
1327
|
}
|
|
1326
1328
|
}
|
|
1327
|
-
function ot(
|
|
1328
|
-
const e =
|
|
1329
|
-
`),
|
|
1329
|
+
function ot(t) {
|
|
1330
|
+
const e = t.endsWith(`
|
|
1331
|
+
`), n = t.split(`
|
|
1330
1332
|
`).map((r) => r + `
|
|
1331
1333
|
`);
|
|
1332
|
-
return e ?
|
|
1334
|
+
return e ? n.pop() : n.push(n.pop().slice(0, -1)), n;
|
|
1333
1335
|
}
|
|
1334
|
-
function it(
|
|
1335
|
-
switch (
|
|
1336
|
+
function it(t, e, n = "git", r = 3) {
|
|
1337
|
+
switch (n) {
|
|
1336
1338
|
case "git":
|
|
1337
|
-
return ye(
|
|
1339
|
+
return ye(t, e, r);
|
|
1338
1340
|
case "object":
|
|
1339
|
-
return st(
|
|
1341
|
+
return st(t, e);
|
|
1340
1342
|
case "json":
|
|
1341
|
-
return at(
|
|
1343
|
+
return at(t, e);
|
|
1342
1344
|
default:
|
|
1343
|
-
return ye(
|
|
1345
|
+
return ye(t, e, r);
|
|
1344
1346
|
}
|
|
1345
1347
|
}
|
|
1346
|
-
function ye(
|
|
1347
|
-
const r = ge(
|
|
1348
|
+
function ye(t, e, n = 3) {
|
|
1349
|
+
const r = ge(t), o = ge(e);
|
|
1348
1350
|
return rt(
|
|
1349
1351
|
/* oldFilename */
|
|
1350
1352
|
"",
|
|
@@ -1356,48 +1358,48 @@ function ye(n, e, t = 3) {
|
|
|
1356
1358
|
"",
|
|
1357
1359
|
/* newHeader */
|
|
1358
1360
|
"",
|
|
1359
|
-
{ context:
|
|
1361
|
+
{ context: n }
|
|
1360
1362
|
).split(`
|
|
1361
1363
|
`).slice(2).join(`
|
|
1362
1364
|
`);
|
|
1363
1365
|
}
|
|
1364
|
-
function st(
|
|
1365
|
-
const
|
|
1366
|
-
return JSON.stringify(
|
|
1366
|
+
function st(t, e) {
|
|
1367
|
+
const n = Te.diff(t, e) || [];
|
|
1368
|
+
return JSON.stringify(n, null, 2);
|
|
1367
1369
|
}
|
|
1368
|
-
function at(
|
|
1370
|
+
function at(t, e) {
|
|
1369
1371
|
return JSON.stringify(
|
|
1370
1372
|
{
|
|
1371
|
-
before:
|
|
1373
|
+
before: t,
|
|
1372
1374
|
after: e
|
|
1373
1375
|
},
|
|
1374
1376
|
null,
|
|
1375
1377
|
2
|
|
1376
1378
|
);
|
|
1377
1379
|
}
|
|
1378
|
-
function lt(
|
|
1379
|
-
return typeof
|
|
1380
|
+
function lt(t, e) {
|
|
1381
|
+
return typeof t == "string" && typeof e == "string" ? Oe(t, e) : typeof t == "number" && typeof e == "number" ? Re(t, e) : ut(t, e);
|
|
1380
1382
|
}
|
|
1381
|
-
function Oe(
|
|
1382
|
-
if (
|
|
1383
|
-
if (
|
|
1384
|
-
const
|
|
1385
|
-
return
|
|
1383
|
+
function Oe(t, e) {
|
|
1384
|
+
if (t === e) return 0;
|
|
1385
|
+
if (t.length === 0 || e.length === 0) return 1;
|
|
1386
|
+
const n = Ze.get(t, e), r = Math.max(t.length, e.length);
|
|
1387
|
+
return n / r;
|
|
1386
1388
|
}
|
|
1387
|
-
function Re(
|
|
1388
|
-
if (
|
|
1389
|
-
if (
|
|
1390
|
-
const
|
|
1391
|
-
return Math.min(
|
|
1389
|
+
function Re(t, e) {
|
|
1390
|
+
if (t === e) return 0;
|
|
1391
|
+
if (t === 0) return 1;
|
|
1392
|
+
const n = Math.abs(e - t), r = Math.max(Math.abs(t), Math.abs(e));
|
|
1393
|
+
return Math.min(n / r, 1);
|
|
1392
1394
|
}
|
|
1393
|
-
function ut(
|
|
1394
|
-
if (
|
|
1395
|
-
const
|
|
1396
|
-
if (
|
|
1397
|
-
const r = we(
|
|
1395
|
+
function ut(t, e) {
|
|
1396
|
+
if (t === e) return 0;
|
|
1397
|
+
const n = Te.diff(t, e) || [];
|
|
1398
|
+
if (n.length === 0) return 0;
|
|
1399
|
+
const r = we(t), o = we(e), u = Math.max(r, o);
|
|
1398
1400
|
if (u === 0) return 0;
|
|
1399
1401
|
let d = 0;
|
|
1400
|
-
for (const f of
|
|
1402
|
+
for (const f of n)
|
|
1401
1403
|
switch (f.kind) {
|
|
1402
1404
|
case "N":
|
|
1403
1405
|
d += 1;
|
|
@@ -1427,92 +1429,106 @@ function ut(n, e) {
|
|
|
1427
1429
|
}
|
|
1428
1430
|
return Math.min(d / u, 1);
|
|
1429
1431
|
}
|
|
1430
|
-
function we(
|
|
1431
|
-
if (
|
|
1432
|
-
if (typeof
|
|
1433
|
-
if (Array.isArray(
|
|
1432
|
+
function we(t) {
|
|
1433
|
+
if (t == null) return 0;
|
|
1434
|
+
if (typeof t != "object") return 1;
|
|
1435
|
+
if (Array.isArray(t)) return t.length;
|
|
1434
1436
|
let e = 0;
|
|
1435
|
-
for (const
|
|
1436
|
-
Object.prototype.hasOwnProperty.call(
|
|
1437
|
+
for (const n in t)
|
|
1438
|
+
Object.prototype.hasOwnProperty.call(t, n) && (e += 1);
|
|
1437
1439
|
return e;
|
|
1438
1440
|
}
|
|
1439
|
-
function ge(
|
|
1441
|
+
function ge(t) {
|
|
1440
1442
|
try {
|
|
1441
1443
|
return JSON.stringify(
|
|
1442
|
-
|
|
1443
|
-
(e,
|
|
1444
|
+
t,
|
|
1445
|
+
(e, n) => typeof n == "function" ? "[Function]" : n === void 0 ? "[undefined]" : n === 1 / 0 ? "[Infinity]" : Number.isNaN(n) ? "[NaN]" : n,
|
|
1444
1446
|
2
|
|
1445
1447
|
);
|
|
1446
1448
|
} catch {
|
|
1447
|
-
return String(
|
|
1449
|
+
return String(t);
|
|
1448
1450
|
}
|
|
1449
1451
|
}
|
|
1450
|
-
function ct(
|
|
1451
|
-
const r = Pe(), o =
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
const
|
|
1452
|
+
function ct(t, e, n) {
|
|
1453
|
+
const r = Pe(), o = n?.onFeedback || r, u = n?.debounceMs ?? 1500, d = n?.diffType ?? "git", f = n?.compareWith, p = n?.default_trigger_name ?? "auto_state_change", y = n?.ignoreInitialNullish ?? !0, m = z(t), C = z(t), E = z(!0), P = z(t), h = z(
|
|
1454
|
+
t != null
|
|
1455
|
+
// != null catches both null and undefined
|
|
1456
|
+
), w = z(null), A = z(void 0), R = W(
|
|
1457
|
+
(g, k, O) => {
|
|
1458
|
+
const N = lt(g, k), F = it(g, k, d);
|
|
1459
|
+
let i;
|
|
1460
|
+
n?.vote ? typeof n.vote == "function" ? i = n.vote(g, k, N) : i = n.vote : i = N > 0.5 ? "downvote" : "upvote";
|
|
1461
|
+
const l = typeof e == "function" ? e(k) : e;
|
|
1457
1462
|
o({
|
|
1458
|
-
tx_id:
|
|
1459
|
-
vote:
|
|
1460
|
-
explanation: `State change with diff percentage: ${(
|
|
1461
|
-
correction:
|
|
1463
|
+
tx_id: l,
|
|
1464
|
+
vote: i,
|
|
1465
|
+
explanation: `State change with diff percentage: ${(N * 100).toFixed(1)}%`,
|
|
1466
|
+
correction: F,
|
|
1462
1467
|
source: "IMPLICIT",
|
|
1463
|
-
extra_metadata:
|
|
1464
|
-
trigger_name:
|
|
1468
|
+
extra_metadata: n?.metadata,
|
|
1469
|
+
trigger_name: O
|
|
1465
1470
|
});
|
|
1466
1471
|
},
|
|
1467
|
-
[
|
|
1468
|
-
),
|
|
1469
|
-
(
|
|
1470
|
-
const
|
|
1471
|
-
if (w.current &&
|
|
1472
|
+
[n, e, d, o]
|
|
1473
|
+
), b = W(
|
|
1474
|
+
(g) => {
|
|
1475
|
+
const k = g || p;
|
|
1476
|
+
if (w.current && A.current && A.current !== k) {
|
|
1472
1477
|
clearTimeout(w.current);
|
|
1473
|
-
const
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
+
const O = C.current;
|
|
1479
|
+
R(
|
|
1480
|
+
O,
|
|
1481
|
+
t,
|
|
1482
|
+
A.current
|
|
1478
1483
|
), w.current = null;
|
|
1479
1484
|
}
|
|
1480
|
-
|
|
1485
|
+
A.current = k;
|
|
1481
1486
|
},
|
|
1482
|
-
[
|
|
1487
|
+
[t, p, R]
|
|
1483
1488
|
);
|
|
1484
|
-
return
|
|
1485
|
-
if (
|
|
1486
|
-
|
|
1489
|
+
return Ee(() => {
|
|
1490
|
+
if (E.current) {
|
|
1491
|
+
E.current = !1, m.current = t, C.current = t;
|
|
1487
1492
|
return;
|
|
1488
1493
|
}
|
|
1489
|
-
const
|
|
1490
|
-
|
|
1491
|
-
const
|
|
1492
|
-
h
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1494
|
+
const g = m.current;
|
|
1495
|
+
if (!(f ? f(g, t) : JSON.stringify(g) === JSON.stringify(t))) {
|
|
1496
|
+
const O = y && P.current == null && // Initial state was nullish
|
|
1497
|
+
!h.current && // We haven't had non-nullish state before
|
|
1498
|
+
t != null;
|
|
1499
|
+
if (t != null && (h.current = !0), O) {
|
|
1500
|
+
m.current = t, C.current = t;
|
|
1501
|
+
return;
|
|
1502
|
+
}
|
|
1503
|
+
w.current || (C.current = g), w.current && clearTimeout(w.current), m.current = t, w.current = setTimeout(() => {
|
|
1504
|
+
const N = C.current, F = t;
|
|
1505
|
+
R(
|
|
1506
|
+
N,
|
|
1507
|
+
F,
|
|
1508
|
+
A.current || p
|
|
1509
|
+
), C.current = F, w.current = null;
|
|
1510
|
+
}, u);
|
|
1511
|
+
}
|
|
1512
|
+
return () => {
|
|
1498
1513
|
w.current && clearTimeout(w.current);
|
|
1499
1514
|
};
|
|
1500
1515
|
}, [
|
|
1501
|
-
n,
|
|
1502
|
-
e,
|
|
1503
1516
|
t,
|
|
1517
|
+
e,
|
|
1518
|
+
n,
|
|
1504
1519
|
o,
|
|
1505
1520
|
d,
|
|
1506
1521
|
u,
|
|
1507
1522
|
f,
|
|
1508
1523
|
p,
|
|
1509
|
-
|
|
1524
|
+
y,
|
|
1525
|
+
R
|
|
1510
1526
|
]), {
|
|
1511
|
-
notifyChange:
|
|
1527
|
+
notifyChange: b
|
|
1512
1528
|
};
|
|
1513
1529
|
}
|
|
1514
|
-
function vt(
|
|
1515
|
-
const [r, o] = X(
|
|
1530
|
+
function vt(t, e, n) {
|
|
1531
|
+
const [r, o] = X(t), { notifyChange: u } = ct(r, e, n), d = W(
|
|
1516
1532
|
(f, p) => {
|
|
1517
1533
|
u(p), o((y) => typeof f == "function" ? f(y) : f);
|
|
1518
1534
|
},
|
|
@@ -1530,20 +1546,20 @@ let ft = () => {
|
|
|
1530
1546
|
}
|
|
1531
1547
|
};
|
|
1532
1548
|
function bt() {
|
|
1533
|
-
const { trace:
|
|
1549
|
+
const { trace: t, context: e } = ft();
|
|
1534
1550
|
try {
|
|
1535
|
-
const
|
|
1536
|
-
if (
|
|
1537
|
-
return
|
|
1538
|
-
const r =
|
|
1551
|
+
const n = t.getSpanContext(e.active());
|
|
1552
|
+
if (n?.traceId)
|
|
1553
|
+
return n.traceId;
|
|
1554
|
+
const r = t.getSpan(e.active());
|
|
1539
1555
|
if (r) {
|
|
1540
1556
|
const o = r.spanContext();
|
|
1541
1557
|
if (o.traceId)
|
|
1542
1558
|
return o.traceId;
|
|
1543
1559
|
}
|
|
1544
|
-
} catch (
|
|
1560
|
+
} catch (n) {
|
|
1545
1561
|
throw new Error(
|
|
1546
|
-
`Failed to extract OpenTelemetry trace ID: ${
|
|
1562
|
+
`Failed to extract OpenTelemetry trace ID: ${n instanceof Error ? n.message : "Unknown error"}`
|
|
1547
1563
|
);
|
|
1548
1564
|
}
|
|
1549
1565
|
throw new Error(
|