@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.
@@ -1,12 +1,12 @@
1
- import De, { createContext as Ee, useContext as ae, useCallback as W, isValidElement as Z, cloneElement as Q, useState as X, useRef as U, useId as ce, useEffect as ke } from "react";
2
- function _e(n) {
3
- return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
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 Se(n) {
6
- if (Object.prototype.hasOwnProperty.call(n, "__esModule")) return n;
7
- var e = n.default;
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 t = function r() {
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
- t.prototype = e.prototype;
18
- } else t = {};
19
- return Object.defineProperty(t, "__esModule", { value: !0 }), Object.keys(n).forEach(function(r) {
20
- var o = Object.getOwnPropertyDescriptor(n, r);
21
- Object.defineProperty(t, r, o.get ? o : {
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 n[r];
24
+ return t[r];
25
25
  }
26
26
  });
27
- }), t;
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 je() {
40
+ function Ne() {
41
41
  if (fe) return V;
42
42
  fe = 1;
43
- var n = Symbol.for("react.transitional.element"), e = Symbol.for("react.fragment");
44
- function t(r, o, u) {
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: n,
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 = t, V.jsxs = t, V;
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 Ne() {
72
+ function Se() {
73
73
  return de || (de = 1, process.env.NODE_ENV !== "production" && function() {
74
- function n(a) {
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 g:
80
+ case w:
81
81
  return "Fragment";
82
- case P:
82
+ case R:
83
83
  return "Profiler";
84
- case C:
84
+ case A:
85
85
  return "StrictMode";
86
- case R:
86
+ case O:
87
87
  return "Suspense";
88
- case I:
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 k:
99
+ case g:
100
100
  return (a.displayName || "Context") + ".Provider";
101
- case v:
101
+ case b:
102
102
  return (a._context.displayName || "Context") + ".Consumer";
103
- case O:
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 L:
107
- return T = a.displayName || null, T !== null ? T : n(a.type) || "Memo";
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 n(a(T));
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 t(a) {
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, S = typeof Symbol == "function" && Symbol.toStringTag && a[Symbol.toStringTag] || a.constructor.name || "Object";
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
- S
133
+ j
134
134
  ), e(a);
135
135
  }
136
136
  }
137
137
  function r(a) {
138
- if (a === g) return "<>";
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 = n(a);
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 (b.call(a, "key")) {
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 = n(this.type);
176
- return N[a] || (N[a] = !0, console.error(
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, _, S, q, $, B, K) {
180
+ function y(a, T, _, j, q, $, B, K) {
181
181
  return _ = $.ref, a = {
182
- $$typeof: E,
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, _, S, q, $, B, K) {
213
- var j = T.children;
214
- if (j !== void 0)
215
- if (S)
216
- if (D(j)) {
217
- for (S = 0; S < j.length; S++)
218
- A(j[S]);
219
- Object.freeze && Object.freeze(j);
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 A(j);
225
- if (b.call(T, "key")) {
226
- j = n(a);
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
- S = 0 < Y.length ? "{key: someKey, " + Y.join(": ..., ") + ": ...}" : "{key: someKey}", ne[j + S] || (Y = 0 < Y.length ? "{" + Y.join(": ..., ") + ": ...}" : "{}", console.error(
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
- j
241
- ), ne[j + S] = !0);
240
+ S
241
+ ), ne[S + j] = !0);
242
242
  }
243
- if (j = null, _ !== void 0 && (t(_), j = "" + _), d(T) && (t(T.key), j = "" + T.key), "key" in T) {
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 j && f(
248
+ return S && f(
249
249
  _,
250
250
  typeof a == "function" ? a.displayName || a.name || "Unknown" : a
251
251
  ), y(
252
252
  a,
253
- j,
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 A(a) {
263
- typeof a == "object" && a !== null && a.$$typeof === E && a._store && (a._store.validated = 1);
262
+ function C(a) {
263
+ typeof a == "object" && a !== null && a.$$typeof === P && a._store && (a._store.validated = 1);
264
264
  }
265
- var w = De, E = Symbol.for("react.transitional.element"), h = Symbol.for("react.portal"), g = Symbol.for("react.fragment"), C = Symbol.for("react.strict_mode"), P = Symbol.for("react.profiler"), v = Symbol.for("react.consumer"), k = Symbol.for("react.context"), O = Symbol.for("react.forward_ref"), R = Symbol.for("react.suspense"), I = Symbol.for("react.suspense_list"), L = Symbol.for("react.memo"), i = Symbol.for("react.lazy"), l = Symbol.for("react.activity"), s = Symbol.for("react.client.reference"), c = w.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, b = Object.prototype.hasOwnProperty, D = Array.isArray, x = console.createTask ? console.createTask : function() {
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
- w = {
268
+ E = {
269
269
  react_stack_bottom_frame: function(a) {
270
270
  return a();
271
271
  }
272
272
  };
273
- var M, N = {}, H = w.react_stack_bottom_frame.bind(
274
- w,
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 = g, G.jsx = function(a, T, _, S, q) {
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
- S,
284
+ j,
285
285
  q,
286
- $ ? Error("react-stack-top-frame") : H,
286
+ $ ? Error("react-stack-top-frame") : U,
287
287
  $ ? x(r(a)) : J
288
288
  );
289
- }, G.jsxs = function(a, T, _, S, q) {
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
- S,
296
+ j,
297
297
  q,
298
- $ ? Error("react-stack-top-frame") : H,
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 = je() : re.exports = Ne()), re.exports;
306
+ return pe || (pe = 1, process.env.NODE_ENV === "production" ? re.exports = Ne() : re.exports = Se()), re.exports;
307
307
  }
308
- var F = Ie();
309
- const se = Ee(null), Fe = "https://api.kelet.ai/api", pt = () => {
310
- const n = ae(se);
311
- if (!n)
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 n;
313
+ return t;
314
314
  }, Pe = () => {
315
- const n = ae(se);
316
- return n ? n.feedback : async () => {
317
- };
318
- }, ht = ({ apiKey: n, project: e, children: t }) => {
319
- const r = ae(se), o = n || r?.api_key;
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__ */ F.jsx(se.Provider, { value: d, children: t });
349
- }, ee = (n, e) => {
350
- const t = { ...e };
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 = n[r], u = e[r];
353
- /^on[A-Z]/.test(r) ? o && u ? t[r] = (...f) => {
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 && (t[r] = o) : r === "style" ? t[r] = { ...o, ...u } : r === "className" ? t[r] = [o, u].filter(Boolean).join(" ") : t[r] = u !== void 0 ? u : 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 { ...n, ...t };
358
- }, xe = Ee(
359
+ return { ...t, ...n };
360
+ }, xe = ke(
359
361
  null
360
362
  ), te = () => {
361
- const n = ae(xe);
362
- if (!n)
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 n;
368
+ return t;
367
369
  }, Le = ({
368
- children: n,
370
+ children: t,
369
371
  onFeedback: e,
370
- defaultText: t = "",
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(t), [A, w] = X(!1), [E, h] = X(null), g = U(null), C = U(null), P = ce(), v = ce(), k = Pe(), O = e || k;
376
- ke(() => {
377
- p(!1), m(t), w(!1), h(null), setTimeout(() => C.current?.focus(), 0);
378
- }, [d, t]);
379
- const R = W(async () => {
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
- w(!0), await O(c);
390
+ E(!0), await k(c);
389
391
  } finally {
390
- w(!1);
392
+ E(!1);
391
393
  }
392
- }, [O, d, o, u]), I = W(async () => {
393
- if (h("downvote"), O) {
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
- w(!0), await O(c);
403
+ E(!0), await k(c);
402
404
  } finally {
403
- w(!1);
405
+ E(!1);
404
406
  }
405
407
  }
406
408
  p(!0), setTimeout(() => {
407
- g.current?.focus();
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
- }, [O, d, o, u]), L = W(
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 b = {
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
- w(!0), await O(b);
429
+ E(!0), await k(v);
428
430
  } finally {
429
- w(!1);
431
+ E(!1);
430
432
  }
431
433
  }
432
- if (p(!1), m(t), C.current?.focus(), c) {
433
- const b = document.createElement("div");
434
- b.setAttribute("aria-live", "polite"), b.className = "sr-only", b.textContent = "Feedback submitted successfully.", document.body.appendChild(b), setTimeout(() => document.body.removeChild(b), 1e3);
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
- }, [O, y, t, d, o, u]), l = W(
438
+ }, [k, y, n, d, o, u]), l = W(
437
439
  (c) => {
438
440
  if (c.key === "Escape")
439
- p(!1), m(t), C.current?.focus();
441
+ p(!1), m(n), A.current?.focus();
440
442
  else if ((c.metaKey || c.ctrlKey) && c.key === "Enter")
441
- c.preventDefault(), i().then((b) => {
443
+ c.preventDefault(), i().then((v) => {
442
444
  });
443
445
  else if (c.key === "Tab" && f) {
444
- const b = document.getElementById(P);
445
- if (b) {
446
- const D = b.querySelectorAll(
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, P, t]
455
+ [i, f, R, n]
454
456
  ), s = {
455
- onFeedback: O,
457
+ onFeedback: k,
456
458
  showPopover: f,
457
459
  setShowPopover: p,
458
460
  feedbackText: y,
459
461
  setFeedbackText: m,
460
- isSubmitting: A,
461
- setIsSubmitting: w,
462
- vote: E,
463
- handleUpvote: R,
464
- handleDownvote: I,
465
- handleTextareaChange: L,
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: g,
469
- triggerRef: C,
470
- popoverId: P,
471
- triggerId: v,
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__ */ F.jsx(xe.Provider, { value: s, children: n });
478
+ return /* @__PURE__ */ L.jsx(xe.Provider, { value: s, children: t });
477
479
  }, Me = ({
478
- asChild: n,
480
+ asChild: t,
479
481
  children: e,
480
- onClick: t,
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(), t?.(m);
487
+ o(), n?.(m);
486
488
  },
487
- [o, t]
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 (n) {
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__ */ F.jsx("button", { ...p, children: typeof e == "function" ? e({ isSelected: y }) : e });
505
+ return /* @__PURE__ */ L.jsx("button", { ...p, children: typeof e == "function" ? e({ isSelected: y }) : e });
504
506
  }, $e = ({
505
- asChild: n,
507
+ asChild: t,
506
508
  children: e,
507
- onClick: t,
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(), A = W(
520
+ } = te(), C = W(
519
521
  (h) => {
520
- o(), t?.(h);
522
+ o(), n?.(h);
521
523
  },
522
- [o, t]
523
- ), w = {
524
+ [o, n]
525
+ ), E = {
524
526
  ...r,
525
527
  ref: y,
526
- onClick: A,
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
- }, E = m === "downvote";
534
- if (n) {
535
- const h = typeof e == "function" ? e({ isSelected: E }) : e;
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(w, h.props));
539
+ return Q(h, ee(E, h.props));
538
540
  if (h)
539
541
  return h;
540
542
  }
541
- return /* @__PURE__ */ F.jsx("button", { ...w, children: typeof e == "function" ? e({ isSelected: E }) : e });
542
- }, qe = ({ asChild: n, children: e, ...t }) => {
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
- ...t,
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 n && Z(e) ? /* @__PURE__ */ F.jsxs(F.Fragment, { children: [
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__ */ F.jsx("div", { id: `${u}-description`, className: "sr-only", children: "Provide additional feedback for your downvote" })
562
- ] }) : /* @__PURE__ */ F.jsxs("div", { ...f, children: [
563
- /* @__PURE__ */ F.jsx("div", { id: `${u}-description`, className: "sr-only", children: "Provide additional feedback for your downvote" }),
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: n, value: e, onChange: t, ...r }) => {
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: t || u,
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 n && Z(r.children) ? Q(
586
+ return t && Z(r.children) ? Q(
585
587
  r.children,
586
588
  ee(y, r.children.props)
587
- ) : /* @__PURE__ */ F.jsx("textarea", { ...y });
589
+ ) : /* @__PURE__ */ L.jsx("textarea", { ...y });
588
590
  }, Ye = ({
589
- asChild: n,
591
+ asChild: t,
590
592
  children: e,
591
- onClick: t,
593
+ onClick: n,
592
594
  ...r
593
595
  }) => {
594
596
  const { handleSubmit: o, isSubmitting: u, feedbackText: d } = te(), f = W(
595
- (A) => {
596
- o(), t?.(A);
597
+ (C) => {
598
+ o(), n?.(C);
597
599
  },
598
- [o, t]
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 n && Z(e) ? /* @__PURE__ */ F.jsxs(F.Fragment, { children: [
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__ */ F.jsx("span", { id: "submit-help", className: "sr-only", children: "This will close the dialog without submitting feedback" })
613
- ] }) : /* @__PURE__ */ F.jsxs("button", { ...m, children: [
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__ */ F.jsx("span", { id: "submit-help", className: "sr-only", children: "This will close the dialog without submitting feedback" })
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 Ke() {
627
- return he || (he = 1, function(n, e) {
628
- (function(t, r) {
629
- var o = r(t);
630
- n.exports = o;
631
- })(ze, function(t) {
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 A(i) {
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 w(i) {
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 E(i) {
705
- var l = 0, s = A(i);
706
+ function P(i) {
707
+ var l = 0, s = C(i);
706
708
  if (s === "array") {
707
709
  i.forEach(function(M) {
708
- l += E(M);
710
+ l += P(M);
709
711
  });
710
712
  var c = "[type: array, hash: " + l + "]";
711
- return l + w(c);
713
+ return l + E(c);
712
714
  }
713
715
  if (s === "object") {
714
- for (var b in i)
715
- if (i.hasOwnProperty(b)) {
716
- var D = "[ type: object, key: " + b + ", value hash: " + E(i[b]) + "]";
717
- l += w(D);
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 + w(x);
724
+ return l + E(x);
723
725
  }
724
- function h(i, l, s, c, b, D, x, M) {
725
- s = s || [], b = b || [], x = x || [];
726
- var N = b.slice(0);
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(N, D))
731
+ if (typeof c == "function" && c(I, D))
730
732
  return;
731
733
  if (typeof c == "object") {
732
- if (c.prefilter && c.prefilter(N, D))
734
+ if (c.prefilter && c.prefilter(I, D))
733
735
  return;
734
736
  if (c.normalize) {
735
- var H = c.normalize(N, D, i, l);
736
- H && (i = H[0], l = H[1]);
737
+ var U = c.normalize(I, D, i, l);
738
+ U && (i = U[0], l = U[1]);
737
739
  }
738
740
  }
739
741
  }
740
- N.push(D);
742
+ I.push(D);
741
743
  }
742
- A(i) === "regexp" && A(l) === "regexp" && (i = i.toString(), l = l.toString());
743
- var J = typeof i, ne = typeof l, a, T, _, S, 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
+ 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(N, l));
747
+ s.push(new f(I, l));
746
748
  else if (!$ && q)
747
- s.push(new p(N, i));
748
- else if (A(i) !== A(l))
749
- s.push(new d(N, i, l));
750
- else if (A(i) === "date" && i - l !== 0)
751
- s.push(new d(N, i, l));
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
- S = !0;
757
+ j = !0;
756
758
  break;
757
759
  }
758
- if (S)
759
- i !== l && s.push(new d(N, i, l));
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(j, Y) {
763
- return E(j) - E(Y);
764
- }), l.sort(function(j, Y) {
765
- return E(j) - E(Y);
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(N, a, new f(void 0, l[a--])));
769
+ s.push(new y(I, a, new f(void 0, l[a--])));
768
770
  for (; T > a; )
769
- s.push(new y(N, T, new p(void 0, i[T--])));
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, N, a, x, M);
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], S = K.indexOf(_), S >= 0 ? (h(i[_], l[_], s, c, N, _, x, M), K[S] = null) : h(i[_], void 0, s, c, N, _, x, M);
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, N, _, x, M);
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(N, i, l)));
783
+ } else i !== l && (J === "number" && isNaN(i) && isNaN(l) || s.push(new d(I, i, l)));
782
784
  }
783
- function g(i, l, s, c, b) {
785
+ function w(i, l, s, c, v) {
784
786
  var D = [];
785
- if (h(i, l, D, c, null, null, null, b), s)
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 C(i, l, s, c, b, D, x) {
791
- return h(i, l, s, c, b, D, x, !0);
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 P(i, l, s, c) {
794
- var b = c ? function(x) {
795
+ function R(i, l, s, c) {
796
+ var v = c ? function(x) {
795
797
  x && c.push(x);
796
- } : void 0, D = g(i, l, b, s);
798
+ } : void 0, D = w(i, l, v, s);
797
799
  return c || (D.length ? D : void 0);
798
800
  }
799
- function v(i, l, s, c) {
800
- var b = c ? function(x) {
801
+ function b(i, l, s, c) {
802
+ var v = c ? function(x) {
801
803
  x && c.push(x);
802
- } : void 0, D = g(i, l, b, s, !0);
804
+ } : void 0, D = w(i, l, v, s, !0);
803
805
  return c || (D.length ? D : void 0);
804
806
  }
805
- function k(i, l, s) {
807
+ function g(i, l, s) {
806
808
  if (s.path && s.path.length) {
807
- var c = i[l], b, D = s.path.length - 1;
808
- for (b = 0; b < D; b++)
809
- c = c[s.path[b]];
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
- k(c[s.path[b]], s.index, s.item);
814
+ g(c[s.path[v]], s.index, s.item);
813
815
  break;
814
816
  case "D":
815
- delete c[s.path[b]];
817
+ delete c[s.path[v]];
816
818
  break;
817
819
  case "E":
818
820
  case "N":
819
- c[s.path[b]] = s.rhs;
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
- k(i[l], s.index, s.item);
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 O(i, l, s) {
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, b = -1, D = s.path ? s.path.length - 1 : 0; ++b < D; )
840
- typeof c[s.path[b]] > "u" && (c[s.path[b]] = typeof s.path[b + 1] < "u" && typeof s.path[b + 1] == "number" ? [] : {}), c = c[s.path[b]];
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[b]] > "u" && (c[s.path[b]] = []), k(s.path ? c[s.path[b]] : c, s.index, s.item);
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[b]];
848
+ delete c[s.path[v]];
847
849
  break;
848
850
  case "E":
849
851
  case "N":
850
- c[s.path[b]] = s.rhs;
852
+ c[s.path[v]] = s.rhs;
851
853
  break;
852
854
  }
853
855
  }
854
856
  }
855
- function R(i, l, s) {
857
+ function O(i, l, s) {
856
858
  if (s.path && s.path.length) {
857
- var c = i[l], b, D = s.path.length - 1;
858
- for (b = 0; b < D; b++)
859
- c = c[s.path[b]];
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
- R(c[s.path[b]], s.index, s.item);
864
+ O(c[s.path[v]], s.index, s.item);
863
865
  break;
864
866
  case "D":
865
- c[s.path[b]] = s.lhs;
867
+ c[s.path[v]] = s.lhs;
866
868
  break;
867
869
  case "E":
868
- c[s.path[b]] = s.lhs;
870
+ c[s.path[v]] = s.lhs;
869
871
  break;
870
872
  case "N":
871
- delete c[s.path[b]];
873
+ delete c[s.path[v]];
872
874
  break;
873
875
  }
874
876
  } else
875
877
  switch (s.kind) {
876
878
  case "A":
877
- R(i[l], s.index, s.item);
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 I(i, l, s) {
893
+ function N(i, l, s) {
892
894
  if (i && l && s && s.kind) {
893
- var c = i, b, D;
894
- for (D = s.path.length - 1, b = 0; b < D; b++)
895
- typeof c[s.path[b]] > "u" && (c[s.path[b]] = {}), c = c[s.path[b]];
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
- R(c[s.path[b]], s.index, s.item);
900
+ O(c[s.path[v]], s.index, s.item);
899
901
  break;
900
902
  case "D":
901
- c[s.path[b]] = s.lhs;
903
+ c[s.path[v]] = s.lhs;
902
904
  break;
903
905
  case "E":
904
- c[s.path[b]] = s.lhs;
906
+ c[s.path[v]] = s.lhs;
905
907
  break;
906
908
  case "N":
907
- delete c[s.path[b]];
909
+ delete c[s.path[v]];
908
910
  break;
909
911
  }
910
912
  }
911
913
  }
912
- function L(i, l, s) {
914
+ function F(i, l, s) {
913
915
  if (i && l) {
914
- var c = function(b) {
915
- (!s || s(i, l, b)) && O(i, l, b);
916
+ var c = function(v) {
917
+ (!s || s(i, l, v)) && k(i, l, v);
916
918
  };
917
- g(i, l, c);
919
+ w(i, l, c);
918
920
  }
919
921
  }
920
- return Object.defineProperties(P, {
922
+ return Object.defineProperties(R, {
921
923
  diff: {
922
- value: P,
924
+ value: R,
923
925
  enumerable: !0
924
926
  },
925
927
  orderIndependentDiff: {
926
- value: v,
928
+ value: b,
927
929
  enumerable: !0
928
930
  },
929
931
  observableDiff: {
930
- value: g,
932
+ value: w,
931
933
  enumerable: !0
932
934
  },
933
935
  orderIndependentObservableDiff: {
934
- value: C,
936
+ value: A,
935
937
  enumerable: !0
936
938
  },
937
939
  orderIndepHash: {
938
- value: E,
940
+ value: P,
939
941
  enumerable: !0
940
942
  },
941
943
  applyDiff: {
942
- value: L,
944
+ value: F,
943
945
  enumerable: !0
944
946
  },
945
947
  applyChange: {
946
- value: O,
948
+ value: k,
947
949
  enumerable: !0
948
950
  },
949
951
  revertChange: {
950
- value: I,
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
- }), P.DeepDiff = P, t && (t.DeepDiff = P), P;
961
+ }), R.DeepDiff = R, n && (n.DeepDiff = R), R;
960
962
  });
961
963
  }(ie)), ie.exports;
962
964
  }
963
- var Te = Ke(), oe = { exports: {} };
964
- const z = new Uint32Array(65536), Ue = (n, e) => {
965
- const t = n.length, r = e.length, o = 1 << t - 1;
966
- let u = -1, d = 0, f = t, p = t;
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
- z[n.charCodeAt(p)] |= 1 << p;
970
+ H[t.charCodeAt(p)] |= 1 << p;
969
971
  for (p = 0; p < r; p++) {
970
- let y = z[e.charCodeAt(p)];
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 = t; p--; )
975
- z[n.charCodeAt(p)] = 0;
976
+ for (p = n; p--; )
977
+ H[t.charCodeAt(p)] = 0;
976
978
  return f;
977
- }, He = (n, e) => {
978
- const t = e.length, r = n.length, o = [], u = [], d = Math.ceil(t / 32), f = Math.ceil(r / 32);
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, g = -1;
984
- const C = p * 32, P = Math.min(32, r) + C;
985
- for (let v = C; v < P; v++)
986
- z[n.charCodeAt(v)] |= 1 << v;
987
- for (let v = 0; v < t; v++) {
988
- const k = z[e.charCodeAt(v)], O = u[v / 32 | 0] >>> v & 1, R = o[v / 32 | 0] >>> v & 1, I = k | h, L = ((k | R) & g) + g ^ g | k | R;
989
- let i = h | ~(L | g), l = g & L;
990
- i >>> 31 ^ O && (u[v / 32 | 0] ^= 1 << v), l >>> 31 ^ R && (o[v / 32 | 0] ^= 1 << v), i = i << 1 | O, l = l << 1 | R, g = l | ~(I | i), h = i & I;
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 v = C; v < P; v++)
993
- z[n.charCodeAt(v)] = 0;
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 A = p * 32, w = Math.min(32, r - A) + A;
997
- for (let h = A; h < w; h++)
998
- z[n.charCodeAt(h)] |= 1 << h;
999
- let E = r;
1000
- for (let h = 0; h < t; h++) {
1001
- const g = z[e.charCodeAt(h)], C = u[h / 32 | 0] >>> h & 1, P = o[h / 32 | 0] >>> h & 1, v = g | y, k = ((g | P) & m) + m ^ m | g | P;
1002
- let O = y | ~(k | m), R = m & k;
1003
- E += O >>> r - 1 & 1, E -= R >>> r - 1 & 1, O >>> 31 ^ C && (u[h / 32 | 0] ^= 1 << h), R >>> 31 ^ P && (o[h / 32 | 0] ^= 1 << h), O = O << 1 | C, R = R << 1 | P, m = R | ~(v | O), y = O & v;
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 = A; h < w; h++)
1006
- z[n.charCodeAt(h)] = 0;
1007
- return E;
1008
- }, Ce = (n, e) => {
1009
- if (n.length < e.length) {
1010
- const t = e;
1011
- e = n, n = t;
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 ? n.length : n.length <= 32 ? Ue(n, e) : He(n, e);
1014
- }, Je = (n, e) => {
1015
- let t = 1 / 0, r = 0;
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(n, e[o]);
1018
- u < t && (t = u, r = o);
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__ */ Se(Be);
1027
+ }, Symbol.toStringTag, { value: "Module" })), Ve = /* @__PURE__ */ je(Be);
1026
1028
  var me;
1027
1029
  function Ge() {
1028
- return me || (me = 1, function(n, e) {
1030
+ return me || (me = 1, function(t, e) {
1029
1031
  (function() {
1030
- var t;
1032
+ var n;
1031
1033
  try {
1032
- t = typeof Intl < "u" && typeof Intl.Collator < "u" ? Intl.Collator("generic", { sensitivity: "base" }) : null;
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 && t && y.useCollator;
1049
+ var m = y && n && y.useCollator;
1048
1050
  if (m) {
1049
- var A = f.length, w = p.length;
1050
- if (A === 0) return w;
1051
- if (w === 0) return A;
1052
- var E, h, g, C, P;
1053
- for (g = 0; g < w; ++g)
1054
- o[g] = g, u[g] = p.charCodeAt(g);
1055
- o[w] = w;
1056
- var v;
1057
- for (g = 0; g < A; ++g) {
1058
- for (h = g + 1, C = 0; C < w; ++C)
1059
- E = h, v = t.compare(f.charAt(g), String.fromCharCode(u[C])) === 0, h = o[C] + (v ? 0 : 1), P = E + 1, h > P && (h = P), P = o[C + 1] + 1, h > P && (h = P), o[C] = E;
1060
- o[C] = h;
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
- n !== null && n.exports === e ? n.exports = d : typeof self < "u" && typeof self.postMessage == "function" && typeof self.importScripts == "function" ? self.Levenshtein = d : typeof window < "u" && window !== null && (window.Levenshtein = d);
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, t, r = {}) {
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(t, r), f = this.removeEmpty(this.tokenize(u, r)), p = this.removeEmpty(this.tokenize(d, r));
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, t, r, o) {
1082
+ diffWithOptionsObj(e, n, r, o) {
1081
1083
  var u;
1082
- const d = (v) => {
1083
- if (v = this.postProcess(v, r), o) {
1084
+ const d = (b) => {
1085
+ if (b = this.postProcess(b, r), o) {
1084
1086
  setTimeout(function() {
1085
- o(v);
1087
+ o(b);
1086
1088
  }, 0);
1087
1089
  return;
1088
1090
  } else
1089
- return v;
1090
- }, f = t.length, p = e.length;
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 A = (u = r.timeout) !== null && u !== void 0 ? u : 1 / 0, w = Date.now() + A, E = [{ oldPos: -1, lastComponent: void 0 }];
1094
- let h = this.extractCommon(E[0], t, e, 0, r);
1095
- if (E[0].oldPos + 1 >= p && h + 1 >= f)
1096
- return d(this.buildValues(E[0].lastComponent, t, e));
1097
- let g = -1 / 0, C = 1 / 0;
1098
- const P = () => {
1099
- for (let v = Math.max(g, -y); v <= Math.min(C, y); v += 2) {
1100
- let k;
1101
- const O = E[v - 1], R = E[v + 1];
1102
- O && (E[v - 1] = void 0);
1103
- let I = !1;
1104
- if (R) {
1105
- const i = R.oldPos - v;
1106
- I = R && 0 <= i && i < f;
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 L = O && O.oldPos + 1 < p;
1109
- if (!I && !L) {
1110
- E[v] = void 0;
1110
+ const F = k && k.oldPos + 1 < p;
1111
+ if (!N && !F) {
1112
+ P[b] = void 0;
1111
1113
  continue;
1112
1114
  }
1113
- if (!L || I && O.oldPos < R.oldPos ? k = this.addToPath(R, !0, !1, 0, r) : k = this.addToPath(O, !1, !0, 1, r), h = this.extractCommon(k, t, e, v, r), k.oldPos + 1 >= p && h + 1 >= f)
1114
- return d(this.buildValues(k.lastComponent, t, e)) || !0;
1115
- E[v] = k, k.oldPos + 1 >= p && (C = Math.min(C, v - 1)), h + 1 >= f && (g = Math.max(g, v + 1));
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 v() {
1122
+ (function b() {
1121
1123
  setTimeout(function() {
1122
- if (y > m || Date.now() > w)
1124
+ if (y > m || Date.now() > E)
1123
1125
  return o(void 0);
1124
- P() || v();
1126
+ R() || b();
1125
1127
  }, 0);
1126
1128
  })();
1127
1129
  else
1128
- for (; y <= m && Date.now() <= w; ) {
1129
- const v = P();
1130
- if (v)
1131
- return v;
1130
+ for (; y <= m && Date.now() <= E; ) {
1131
+ const b = R();
1132
+ if (b)
1133
+ return b;
1132
1134
  }
1133
1135
  }
1134
- addToPath(e, t, r, o, u) {
1136
+ addToPath(e, n, r, o, u) {
1135
1137
  const d = e.lastComponent;
1136
- return d && !u.oneChangePerToken && d.added === t && d.removed === r ? {
1138
+ return d && !u.oneChangePerToken && d.added === n && d.removed === r ? {
1137
1139
  oldPos: e.oldPos + o,
1138
- lastComponent: { count: d.count + 1, added: t, removed: r, previousComponent: d.previousComponent }
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: t, removed: r, previousComponent: d }
1143
+ lastComponent: { count: 1, added: n, removed: r, previousComponent: d }
1142
1144
  };
1143
1145
  }
1144
- extractCommon(e, t, r, o, u) {
1145
- const d = t.length, f = r.length;
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], t[y + 1], u); )
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, t, r) {
1152
- return r.comparator ? r.comparator(e, t) : e === t || !!r.ignoreCase && e.toLowerCase() === t.toLowerCase();
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 t = [];
1157
+ const n = [];
1156
1158
  for (let r = 0; r < e.length; r++)
1157
- e[r] && t.push(e[r]);
1158
- return t;
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, t) {
1163
+ castInput(e, n) {
1162
1164
  return e;
1163
1165
  }
1164
1166
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
1165
- tokenize(e, t) {
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, t) {
1173
+ postProcess(e, n) {
1172
1174
  return e;
1173
1175
  }
1174
1176
  get useLongestToken() {
1175
1177
  return !1;
1176
1178
  }
1177
- buildValues(e, t, r) {
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 A = t.slice(p, p + m.count);
1192
- A = A.map(function(w, E) {
1193
- const h = r[y + E];
1194
- return h.length > w.length ? h : w;
1195
- }), m.value = this.join(A);
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(t.slice(p, p + m.count));
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, t, r) {
1210
+ equals(e, n, r) {
1209
1211
  return r.ignoreWhitespace ? ((!r.newlineIsToken || !e.includes(`
1210
- `)) && (e = e.trim()), (!r.newlineIsToken || !t.includes(`
1211
- `)) && (t = t.trim())) : r.ignoreNewlineAtEof && !r.newlineIsToken && (e.endsWith(`
1212
- `) && (e = e.slice(0, -1)), t.endsWith(`
1213
- `) && (t = t.slice(0, -1))), super.equals(e, t, r);
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(n, e, t) {
1218
- return tt.diff(n, e, t);
1219
+ function ve(t, e, n) {
1220
+ return tt.diff(t, e, n);
1219
1221
  }
1220
- function nt(n, e) {
1221
- e.stripTrailingCr && (n = n.replace(/\r\n/g, `
1222
+ function nt(t, e) {
1223
+ e.stripTrailingCr && (t = t.replace(/\r\n/g, `
1222
1224
  `));
1223
- const t = [], r = n.split(/(\n|\r\n)/);
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 ? t[t.length - 1] += u : t.push(u);
1229
+ o % 2 && !e.newlineIsToken ? n[n.length - 1] += u : n.push(u);
1228
1230
  }
1229
- return t;
1231
+ return n;
1230
1232
  }
1231
- function be(n, e, t, r, o, u, d) {
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(t, r, Object.assign(Object.assign({}, f), { callback: (A) => {
1240
- const w = y(A);
1241
- m(w);
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(t, r, f));
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 A(v) {
1250
- return v.map(function(k) {
1251
- return " " + k;
1251
+ function C(b) {
1252
+ return b.map(function(g) {
1253
+ return " " + g;
1252
1254
  });
1253
1255
  }
1254
- const w = [];
1255
- let E = 0, h = 0, g = [], C = 1, P = 1;
1256
- for (let v = 0; v < m.length; v++) {
1257
- const k = m[v], O = k.lines || ot(k.value);
1258
- if (k.lines = O, k.added || k.removed) {
1259
- if (!E) {
1260
- const R = m[v - 1];
1261
- E = C, h = P, R && (g = p > 0 ? A(R.lines.slice(-p)) : [], E -= g.length, h -= g.length);
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 R of O)
1264
- g.push((k.added ? "+" : "-") + R);
1265
- k.added ? P += O.length : C += O.length;
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 (E)
1268
- if (O.length <= p * 2 && v < m.length - 2)
1269
- for (const R of A(O))
1270
- g.push(R);
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 R = Math.min(O.length, p);
1273
- for (const L of A(O.slice(0, R)))
1274
- g.push(L);
1275
- const I = {
1276
- oldStart: E,
1277
- oldLines: C - E + R,
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: P - h + R,
1280
- lines: g
1281
+ newLines: R - h + O,
1282
+ lines: w
1281
1283
  };
1282
- w.push(I), E = 0, h = 0, g = [];
1284
+ E.push(N), P = 0, h = 0, w = [];
1283
1285
  }
1284
- C += O.length, P += O.length;
1286
+ A += k.length, R += k.length;
1285
1287
  }
1286
1288
  }
1287
- for (const v of w)
1288
- for (let k = 0; k < v.lines.length; k++)
1289
- v.lines[k].endsWith(`
1290
- `) ? v.lines[k] = v.lines[k].slice(0, -1) : (v.lines.splice(k + 1, 0, "\"), k++);
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: n,
1294
+ oldFileName: t,
1293
1295
  newFileName: e,
1294
1296
  oldHeader: o,
1295
1297
  newHeader: u,
1296
- hunks: w
1298
+ hunks: E
1297
1299
  };
1298
1300
  }
1299
1301
  }
1300
- function ue(n) {
1301
- if (Array.isArray(n))
1302
- return n.map(ue).join(`
1302
+ function ue(t) {
1303
+ if (Array.isArray(t))
1304
+ return t.map(ue).join(`
1303
1305
  `);
1304
1306
  const e = [];
1305
- n.oldFileName == n.newFileName && e.push("Index: " + n.oldFileName), e.push("==================================================================="), e.push("--- " + n.oldFileName + (typeof n.oldHeader > "u" ? "" : " " + n.oldHeader)), e.push("+++ " + n.newFileName + (typeof n.newHeader > "u" ? "" : " " + n.newHeader));
1306
- for (let t = 0; t < n.hunks.length; t++) {
1307
- const r = n.hunks[t];
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(n, e, t, r, o, u, d) {
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(n, e, t, r, o, u, Object.assign(Object.assign({}, d), { callback: (p) => {
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(n, e, t, r, o, u, d);
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(n) {
1328
- const e = n.endsWith(`
1329
- `), t = n.split(`
1329
+ function ot(t) {
1330
+ const e = t.endsWith(`
1331
+ `), n = t.split(`
1330
1332
  `).map((r) => r + `
1331
1333
  `);
1332
- return e ? t.pop() : t.push(t.pop().slice(0, -1)), t;
1334
+ return e ? n.pop() : n.push(n.pop().slice(0, -1)), n;
1333
1335
  }
1334
- function it(n, e, t = "git", r = 3) {
1335
- switch (t) {
1336
+ function it(t, e, n = "git", r = 3) {
1337
+ switch (n) {
1336
1338
  case "git":
1337
- return ye(n, e, r);
1339
+ return ye(t, e, r);
1338
1340
  case "object":
1339
- return st(n, e);
1341
+ return st(t, e);
1340
1342
  case "json":
1341
- return at(n, e);
1343
+ return at(t, e);
1342
1344
  default:
1343
- return ye(n, e, r);
1345
+ return ye(t, e, r);
1344
1346
  }
1345
1347
  }
1346
- function ye(n, e, t = 3) {
1347
- const r = ge(n), o = ge(e);
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: t }
1361
+ { context: n }
1360
1362
  ).split(`
1361
1363
  `).slice(2).join(`
1362
1364
  `);
1363
1365
  }
1364
- function st(n, e) {
1365
- const t = Te.diff(n, e) || [];
1366
- return JSON.stringify(t, null, 2);
1366
+ function st(t, e) {
1367
+ const n = Te.diff(t, e) || [];
1368
+ return JSON.stringify(n, null, 2);
1367
1369
  }
1368
- function at(n, e) {
1370
+ function at(t, e) {
1369
1371
  return JSON.stringify(
1370
1372
  {
1371
- before: n,
1373
+ before: t,
1372
1374
  after: e
1373
1375
  },
1374
1376
  null,
1375
1377
  2
1376
1378
  );
1377
1379
  }
1378
- function lt(n, e) {
1379
- return typeof n == "string" && typeof e == "string" ? Oe(n, e) : typeof n == "number" && typeof e == "number" ? Re(n, e) : ut(n, e);
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(n, e) {
1382
- if (n === e) return 0;
1383
- if (n.length === 0 || e.length === 0) return 1;
1384
- const t = Ze.get(n, e), r = Math.max(n.length, e.length);
1385
- return t / r;
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(n, e) {
1388
- if (n === e) return 0;
1389
- if (n === 0) return 1;
1390
- const t = Math.abs(e - n), r = Math.max(Math.abs(n), Math.abs(e));
1391
- return Math.min(t / r, 1);
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(n, e) {
1394
- if (n === e) return 0;
1395
- const t = Te.diff(n, e) || [];
1396
- if (t.length === 0) return 0;
1397
- const r = we(n), o = we(e), u = Math.max(r, o);
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 t)
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(n) {
1431
- if (n == null) return 0;
1432
- if (typeof n != "object") return 1;
1433
- if (Array.isArray(n)) return n.length;
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 t in n)
1436
- Object.prototype.hasOwnProperty.call(n, t) && (e += 1);
1437
+ for (const n in t)
1438
+ Object.prototype.hasOwnProperty.call(t, n) && (e += 1);
1437
1439
  return e;
1438
1440
  }
1439
- function ge(n) {
1441
+ function ge(t) {
1440
1442
  try {
1441
1443
  return JSON.stringify(
1442
- n,
1443
- (e, t) => typeof t == "function" ? "[Function]" : t === void 0 ? "[undefined]" : t === 1 / 0 ? "[Infinity]" : Number.isNaN(t) ? "[NaN]" : t,
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(n);
1449
+ return String(t);
1448
1450
  }
1449
1451
  }
1450
- function ct(n, e, t) {
1451
- const r = Pe(), o = t?.onFeedback || r, u = t?.debounceMs ?? 1500, d = t?.diffType ?? "git", f = t?.compareWith, p = t?.default_trigger_name ?? "auto_state_change", y = U(n), m = U(n), A = U(!0), w = U(null), E = U(void 0), h = W(
1452
- (C, P, v) => {
1453
- const k = lt(C, P), O = it(C, P, d);
1454
- let R;
1455
- t?.vote ? typeof t.vote == "function" ? R = t.vote(C, P, k) : R = t.vote : R = k > 0.5 ? "downvote" : "upvote";
1456
- const I = typeof e == "function" ? e(P) : e;
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: I,
1459
- vote: R,
1460
- explanation: `State change with diff percentage: ${(k * 100).toFixed(1)}%`,
1461
- correction: O,
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: t?.metadata,
1464
- trigger_name: v
1468
+ extra_metadata: n?.metadata,
1469
+ trigger_name: O
1465
1470
  });
1466
1471
  },
1467
- [t, e, d, o]
1468
- ), g = W(
1469
- (C) => {
1470
- const P = C || p;
1471
- if (w.current && E.current && E.current !== P) {
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 v = m.current;
1474
- h(
1475
- v,
1476
- n,
1477
- E.current
1478
+ const O = C.current;
1479
+ R(
1480
+ O,
1481
+ t,
1482
+ A.current
1478
1483
  ), w.current = null;
1479
1484
  }
1480
- E.current = P;
1485
+ A.current = k;
1481
1486
  },
1482
- [n, p, h]
1487
+ [t, p, R]
1483
1488
  );
1484
- return ke(() => {
1485
- if (A.current) {
1486
- A.current = !1, y.current = n, m.current = n;
1489
+ return Ee(() => {
1490
+ if (E.current) {
1491
+ E.current = !1, m.current = t, C.current = t;
1487
1492
  return;
1488
1493
  }
1489
- const C = y.current;
1490
- return (f ? f(C, n) : JSON.stringify(C) === JSON.stringify(n)) || (w.current || (m.current = C), w.current && clearTimeout(w.current), y.current = n, w.current = setTimeout(() => {
1491
- const v = m.current, k = n;
1492
- h(
1493
- v,
1494
- k,
1495
- E.current || p
1496
- ), m.current = k, w.current = null;
1497
- }, u)), () => {
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
- h
1524
+ y,
1525
+ R
1510
1526
  ]), {
1511
- notifyChange: g
1527
+ notifyChange: b
1512
1528
  };
1513
1529
  }
1514
- function vt(n, e, t) {
1515
- const [r, o] = X(n), { notifyChange: u } = ct(r, e, t), d = W(
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: n, context: e } = ft();
1549
+ const { trace: t, context: e } = ft();
1534
1550
  try {
1535
- const t = n.getSpanContext(e.active());
1536
- if (t?.traceId)
1537
- return t.traceId;
1538
- const r = n.getSpan(e.active());
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 (t) {
1560
+ } catch (n) {
1545
1561
  throw new Error(
1546
- `Failed to extract OpenTelemetry trace ID: ${t instanceof Error ? t.message : "Unknown error"}`
1562
+ `Failed to extract OpenTelemetry trace ID: ${n instanceof Error ? n.message : "Unknown error"}`
1547
1563
  );
1548
1564
  }
1549
1565
  throw new Error(