@arcteninc/core 0.0.42 → 0.0.43
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/dist/index.mjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsx as f, jsxs as C, Fragment as ee } from "react/jsx-runtime";
|
|
2
2
|
import * as yt from "react";
|
|
3
|
-
import { useImperativeHandle as ka, createContext as Zt, useRef as ot, useLayoutEffect as
|
|
4
|
-
import { Check as wo, X as
|
|
3
|
+
import { useImperativeHandle as ka, createContext as Zt, useRef as ot, useLayoutEffect as Ra, useEffect as B, useId as is, useContext as nt, useInsertionEffect as vo, useMemo as Z, useCallback as xo, Children as Na, isValidElement as Ia, useState as I, Fragment as bo, createElement as La, forwardRef as Oa, Component as Fa, memo as Oe, Suspense as ja, lazy as Ba } from "react";
|
|
4
|
+
import { Check as wo, X as nn, ChevronDown as $a, ChevronRight as za, Zap as Ua, BrainIcon as Wa, ChevronDownIcon as _a, Plus as Ka, Dock as Ha, PictureInPicture2 as Xa, Maximize2 as Ga, Minimize2 as Ya, Square as qa, ArrowRight as Za, BotMessageSquare as Ja } from "lucide-react";
|
|
5
5
|
import { useChat as To } from "@ai-sdk/react";
|
|
6
6
|
import { lastAssistantMessageIsCompleteWithToolCalls as So, DefaultChatTransport as Ao } from "ai";
|
|
7
7
|
import { Slot as Po } from "@radix-ui/react-slot";
|
|
8
8
|
import { cva as Co } from "class-variance-authority";
|
|
9
9
|
import { clsx as Qa } from "clsx";
|
|
10
10
|
import { twMerge as tl } from "tailwind-merge";
|
|
11
|
-
import * as
|
|
11
|
+
import * as ce from "@radix-ui/react-tooltip";
|
|
12
12
|
import { useControllableState as ti } from "@radix-ui/react-use-controllable-state";
|
|
13
13
|
import * as os from "@radix-ui/react-collapsible";
|
|
14
14
|
import { verifyToken as vf } from "./server.mjs";
|
|
@@ -41,7 +41,7 @@ const Kt = Co(
|
|
|
41
41
|
size: "default"
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
-
),
|
|
44
|
+
), sn = yt.forwardRef(({ className: t, variant: e, size: n, asChild: s = !1, ...i }, r) => /* @__PURE__ */ f(
|
|
45
45
|
s ? Po : "button",
|
|
46
46
|
{
|
|
47
47
|
ref: r,
|
|
@@ -50,7 +50,7 @@ const Kt = Co(
|
|
|
50
50
|
...i
|
|
51
51
|
}
|
|
52
52
|
));
|
|
53
|
-
|
|
53
|
+
sn.displayName = "Button";
|
|
54
54
|
const el = Co(
|
|
55
55
|
"inline-flex items-center justify-center rounded-full border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",
|
|
56
56
|
{
|
|
@@ -142,7 +142,7 @@ function sl({
|
|
|
142
142
|
...e
|
|
143
143
|
}) {
|
|
144
144
|
return /* @__PURE__ */ f(
|
|
145
|
-
|
|
145
|
+
ce.Provider,
|
|
146
146
|
{
|
|
147
147
|
"data-slot": "tooltip-provider",
|
|
148
148
|
delayDuration: t,
|
|
@@ -153,12 +153,12 @@ function sl({
|
|
|
153
153
|
function zt({
|
|
154
154
|
...t
|
|
155
155
|
}) {
|
|
156
|
-
return /* @__PURE__ */ f(sl, { children: /* @__PURE__ */ f(
|
|
156
|
+
return /* @__PURE__ */ f(sl, { children: /* @__PURE__ */ f(ce.Root, { "data-slot": "tooltip", ...t }) });
|
|
157
157
|
}
|
|
158
158
|
function Ut({
|
|
159
159
|
...t
|
|
160
160
|
}) {
|
|
161
|
-
return /* @__PURE__ */ f(
|
|
161
|
+
return /* @__PURE__ */ f(ce.Trigger, { "data-slot": "tooltip-trigger", ...t });
|
|
162
162
|
}
|
|
163
163
|
function Wt({
|
|
164
164
|
className: t,
|
|
@@ -166,8 +166,8 @@ function Wt({
|
|
|
166
166
|
children: n,
|
|
167
167
|
...s
|
|
168
168
|
}) {
|
|
169
|
-
return /* @__PURE__ */ f(
|
|
170
|
-
|
|
169
|
+
return /* @__PURE__ */ f(ce.Portal, { children: /* @__PURE__ */ C(
|
|
170
|
+
ce.Content,
|
|
171
171
|
{
|
|
172
172
|
"data-slot": "tooltip-content",
|
|
173
173
|
sideOffset: e,
|
|
@@ -178,7 +178,7 @@ function Wt({
|
|
|
178
178
|
...s,
|
|
179
179
|
children: [
|
|
180
180
|
n,
|
|
181
|
-
/* @__PURE__ */ f(
|
|
181
|
+
/* @__PURE__ */ f(ce.Arrow, { className: "bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]" })
|
|
182
182
|
]
|
|
183
183
|
}
|
|
184
184
|
) });
|
|
@@ -203,7 +203,7 @@ function as(t) {
|
|
|
203
203
|
const e = ot(null);
|
|
204
204
|
return e.current === null && (e.current = t()), e.current;
|
|
205
205
|
}
|
|
206
|
-
const ls = typeof window < "u", Vo = ls ?
|
|
206
|
+
const ls = typeof window < "u", Vo = ls ? Ra : B, un = /* @__PURE__ */ Zt(null);
|
|
207
207
|
function cs(t, e) {
|
|
208
208
|
t.indexOf(e) === -1 && t.push(e);
|
|
209
209
|
}
|
|
@@ -215,10 +215,10 @@ const Ct = (t, e, n) => n > e ? e : n < t ? t : n;
|
|
|
215
215
|
function Ln(t, e) {
|
|
216
216
|
return e ? `${t}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${e}` : t;
|
|
217
217
|
}
|
|
218
|
-
let
|
|
218
|
+
let fe = () => {
|
|
219
219
|
}, Mt = () => {
|
|
220
220
|
};
|
|
221
|
-
process.env.NODE_ENV !== "production" && (
|
|
221
|
+
process.env.NODE_ENV !== "production" && (fe = (t, e, n) => {
|
|
222
222
|
!t && typeof console < "u" && console.warn(Ln(e, n));
|
|
223
223
|
}, Mt = (t, e, n) => {
|
|
224
224
|
if (!t)
|
|
@@ -234,7 +234,7 @@ function ds(t) {
|
|
|
234
234
|
let e;
|
|
235
235
|
return () => (e === void 0 && (e = t()), e);
|
|
236
236
|
}
|
|
237
|
-
const mt = /* @__NO_SIDE_EFFECTS__ */ (t) => t, il = (t, e) => (n) => e(t(n)),
|
|
237
|
+
const mt = /* @__NO_SIDE_EFFECTS__ */ (t) => t, il = (t, e) => (n) => e(t(n)), Fe = (...t) => t.reduce(il), Ee = /* @__NO_SIDE_EFFECTS__ */ (t, e, n) => {
|
|
238
238
|
const s = e - t;
|
|
239
239
|
return s === 0 ? 1 : (n - t) / s;
|
|
240
240
|
};
|
|
@@ -264,28 +264,28 @@ class hs {
|
|
|
264
264
|
}
|
|
265
265
|
}
|
|
266
266
|
const vt = /* @__NO_SIDE_EFFECTS__ */ (t) => t * 1e3, ft = /* @__NO_SIDE_EFFECTS__ */ (t) => t / 1e3;
|
|
267
|
-
function
|
|
267
|
+
function Ro(t, e) {
|
|
268
268
|
return e ? t * (1e3 / e) : 0;
|
|
269
269
|
}
|
|
270
270
|
const ni = /* @__PURE__ */ new Set();
|
|
271
271
|
function fs(t, e, n) {
|
|
272
272
|
t || ni.has(e) || (console.warn(Ln(e, n)), ni.add(e));
|
|
273
273
|
}
|
|
274
|
-
const
|
|
274
|
+
const No = (t, e, n) => (((1 - 3 * n + 3 * e) * t + (3 * n - 6 * e)) * t + 3 * e) * t, ol = 1e-7, rl = 12;
|
|
275
275
|
function al(t, e, n, s, i) {
|
|
276
276
|
let r, o, a = 0;
|
|
277
277
|
do
|
|
278
|
-
o = e + (n - e) / 2, r =
|
|
278
|
+
o = e + (n - e) / 2, r = No(o, s, i) - t, r > 0 ? n = o : e = o;
|
|
279
279
|
while (Math.abs(r) > ol && ++a < rl);
|
|
280
280
|
return o;
|
|
281
281
|
}
|
|
282
|
-
function
|
|
282
|
+
function je(t, e, n, s) {
|
|
283
283
|
if (t === e && n === s)
|
|
284
284
|
return mt;
|
|
285
285
|
const i = (r) => al(r, 0, 1, t, n);
|
|
286
|
-
return (r) => r === 0 || r === 1 ? r :
|
|
286
|
+
return (r) => r === 0 || r === 1 ? r : No(i(r), e, s);
|
|
287
287
|
}
|
|
288
|
-
const Io = (t) => (e) => e <= 0.5 ? t(2 * e) / 2 : (2 - t(2 * (1 - e))) / 2, Lo = (t) => (e) => 1 - t(1 - e), Oo = /* @__PURE__ */
|
|
288
|
+
const Io = (t) => (e) => e <= 0.5 ? t(2 * e) / 2 : (2 - t(2 * (1 - e))) / 2, Lo = (t) => (e) => 1 - t(1 - e), Oo = /* @__PURE__ */ je(0.33, 1.53, 0.69, 0.99), ms = /* @__PURE__ */ Lo(Oo), Fo = /* @__PURE__ */ Io(ms), jo = (t) => (t *= 2) < 1 ? 0.5 * ms(t) : 0.5 * (2 - Math.pow(2, -10 * (t - 1))), ps = (t) => 1 - Math.sin(Math.acos(t)), Bo = Lo(ps), $o = Io(ps), ll = /* @__PURE__ */ je(0.42, 0, 1, 1), cl = /* @__PURE__ */ je(0, 0, 0.58, 1), zo = /* @__PURE__ */ je(0.42, 0, 0.58, 1), ul = (t) => Array.isArray(t) && typeof t[0] != "number", Uo = (t) => Array.isArray(t) && typeof t[0] == "number", si = {
|
|
289
289
|
linear: mt,
|
|
290
290
|
easeIn: ll,
|
|
291
291
|
easeInOut: zo,
|
|
@@ -301,11 +301,11 @@ const Io = (t) => (e) => e <= 0.5 ? t(2 * e) / 2 : (2 - t(2 * (1 - e))) / 2, Lo
|
|
|
301
301
|
if (Uo(t)) {
|
|
302
302
|
Mt(t.length === 4, "Cubic bezier arrays must contain four numerical values.", "cubic-bezier-length");
|
|
303
303
|
const [e, n, s, i] = t;
|
|
304
|
-
return
|
|
304
|
+
return je(e, n, s, i);
|
|
305
305
|
} else if (dl(t))
|
|
306
306
|
return Mt(si[t] !== void 0, `Invalid easing type '${t}'`, "invalid-easing-type"), si[t];
|
|
307
307
|
return t;
|
|
308
|
-
},
|
|
308
|
+
}, He = [
|
|
309
309
|
"setup",
|
|
310
310
|
// Compute
|
|
311
311
|
"read",
|
|
@@ -368,41 +368,41 @@ function Wo(t, e) {
|
|
|
368
368
|
delta: 0,
|
|
369
369
|
timestamp: 0,
|
|
370
370
|
isProcessing: !1
|
|
371
|
-
}, r = () => n = !0, o =
|
|
371
|
+
}, r = () => n = !0, o = He.reduce((x, R) => (x[R] = hl(r), x), {}), { setup: a, read: l, resolveKeyframes: u, preUpdate: c, update: d, preRender: h, render: p, postRender: g } = o, v = () => {
|
|
372
372
|
const x = Vt.useManualTiming ? i.timestamp : performance.now();
|
|
373
373
|
n = !1, Vt.useManualTiming || (i.delta = s ? 1e3 / 60 : Math.max(Math.min(x - i.timestamp, fl), 1)), i.timestamp = x, i.isProcessing = !0, a.process(i), l.process(i), u.process(i), c.process(i), d.process(i), h.process(i), p.process(i), g.process(i), i.isProcessing = !1, n && e && (s = !1, t(v));
|
|
374
374
|
}, b = () => {
|
|
375
375
|
n = !0, s = !0, i.isProcessing || t(v);
|
|
376
376
|
};
|
|
377
|
-
return { schedule:
|
|
378
|
-
const A = o[
|
|
379
|
-
return x[
|
|
377
|
+
return { schedule: He.reduce((x, R) => {
|
|
378
|
+
const A = o[R];
|
|
379
|
+
return x[R] = (E, N = !1, P = !1) => (n || b(), A.schedule(E, N, P)), x;
|
|
380
380
|
}, {}), cancel: (x) => {
|
|
381
|
-
for (let
|
|
382
|
-
o[
|
|
381
|
+
for (let R = 0; R < He.length; R++)
|
|
382
|
+
o[He[R]].cancel(x);
|
|
383
383
|
}, state: i, steps: o };
|
|
384
384
|
}
|
|
385
|
-
const { schedule: $, cancel:
|
|
386
|
-
let
|
|
385
|
+
const { schedule: $, cancel: Nt, state: tt, steps: bn } = /* @__PURE__ */ Wo(typeof requestAnimationFrame < "u" ? requestAnimationFrame : mt, !0);
|
|
386
|
+
let Ze;
|
|
387
387
|
function ml() {
|
|
388
|
-
|
|
388
|
+
Ze = void 0;
|
|
389
389
|
}
|
|
390
390
|
const lt = {
|
|
391
|
-
now: () => (
|
|
391
|
+
now: () => (Ze === void 0 && lt.set(tt.isProcessing || Vt.useManualTiming ? tt.timestamp : performance.now()), Ze),
|
|
392
392
|
set: (t) => {
|
|
393
|
-
|
|
393
|
+
Ze = t, queueMicrotask(ml);
|
|
394
394
|
}
|
|
395
|
-
}, _o = (t) => (e) => typeof e == "string" && e.startsWith(t), gs = /* @__PURE__ */ _o("--"), pl = /* @__PURE__ */ _o("var(--"), ys = (t) => pl(t) ? gl.test(t.split("/*")[0].trim()) : !1, gl = /var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,
|
|
395
|
+
}, _o = (t) => (e) => typeof e == "string" && e.startsWith(t), gs = /* @__PURE__ */ _o("--"), pl = /* @__PURE__ */ _o("var(--"), ys = (t) => pl(t) ? gl.test(t.split("/*")[0].trim()) : !1, gl = /var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu, me = {
|
|
396
396
|
test: (t) => typeof t == "number",
|
|
397
397
|
parse: parseFloat,
|
|
398
398
|
transform: (t) => t
|
|
399
|
-
},
|
|
400
|
-
...
|
|
399
|
+
}, ke = {
|
|
400
|
+
...me,
|
|
401
401
|
transform: (t) => Ct(0, 1, t)
|
|
402
|
-
},
|
|
403
|
-
...
|
|
402
|
+
}, Xe = {
|
|
403
|
+
...me,
|
|
404
404
|
default: 1
|
|
405
|
-
},
|
|
405
|
+
}, Ce = (t) => Math.round(t * 1e5) / 1e5, vs = /-?(?:\d+(?:\.\d+)?|\.\d+)/gu;
|
|
406
406
|
function yl(t) {
|
|
407
407
|
return t == null;
|
|
408
408
|
}
|
|
@@ -417,12 +417,12 @@ const vl = /^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s
|
|
|
417
417
|
alpha: a !== void 0 ? parseFloat(a) : 1
|
|
418
418
|
};
|
|
419
419
|
}, xl = (t) => Ct(0, 255, t), wn = {
|
|
420
|
-
...
|
|
420
|
+
...me,
|
|
421
421
|
transform: (t) => Math.round(xl(t))
|
|
422
422
|
}, Xt = {
|
|
423
423
|
test: /* @__PURE__ */ xs("rgb", "red"),
|
|
424
424
|
parse: /* @__PURE__ */ Ko("red", "green", "blue"),
|
|
425
|
-
transform: ({ red: t, green: e, blue: n, alpha: s = 1 }) => "rgba(" + wn.transform(t) + ", " + wn.transform(e) + ", " + wn.transform(n) + ", " +
|
|
425
|
+
transform: ({ red: t, green: e, blue: n, alpha: s = 1 }) => "rgba(" + wn.transform(t) + ", " + wn.transform(e) + ", " + wn.transform(n) + ", " + Ce(ke.transform(s)) + ")"
|
|
426
426
|
};
|
|
427
427
|
function bl(t) {
|
|
428
428
|
let e = "", n = "", s = "", i = "";
|
|
@@ -437,18 +437,18 @@ const On = {
|
|
|
437
437
|
test: /* @__PURE__ */ xs("#"),
|
|
438
438
|
parse: bl,
|
|
439
439
|
transform: Xt.transform
|
|
440
|
-
},
|
|
440
|
+
}, Be = /* @__NO_SIDE_EFFECTS__ */ (t) => ({
|
|
441
441
|
test: (e) => typeof e == "string" && e.endsWith(t) && e.split(" ").length === 1,
|
|
442
442
|
parse: parseFloat,
|
|
443
443
|
transform: (e) => `${e}${t}`
|
|
444
|
-
}),
|
|
444
|
+
}), Rt = /* @__PURE__ */ Be("deg"), At = /* @__PURE__ */ Be("%"), D = /* @__PURE__ */ Be("px"), wl = /* @__PURE__ */ Be("vh"), Tl = /* @__PURE__ */ Be("vw"), oi = {
|
|
445
445
|
...At,
|
|
446
446
|
parse: (t) => At.parse(t) / 100,
|
|
447
447
|
transform: (t) => At.transform(t * 100)
|
|
448
448
|
}, ne = {
|
|
449
449
|
test: /* @__PURE__ */ xs("hsl", "hue"),
|
|
450
450
|
parse: /* @__PURE__ */ Ko("hue", "saturation", "lightness"),
|
|
451
|
-
transform: ({ hue: t, saturation: e, lightness: n, alpha: s = 1 }) => "hsla(" + Math.round(t) + ", " + At.transform(
|
|
451
|
+
transform: ({ hue: t, saturation: e, lightness: n, alpha: s = 1 }) => "hsla(" + Math.round(t) + ", " + At.transform(Ce(e)) + ", " + At.transform(Ce(n)) + ", " + Ce(ke.transform(s)) + ")"
|
|
452
452
|
}, q = {
|
|
453
453
|
test: (t) => Xt.test(t) || On.test(t) || ne.test(t),
|
|
454
454
|
parse: (t) => Xt.test(t) ? Xt.parse(t) : ne.test(t) ? ne.parse(t) : On.parse(t),
|
|
@@ -462,7 +462,7 @@ function Al(t) {
|
|
|
462
462
|
return isNaN(t) && typeof t == "string" && (t.match(vs)?.length || 0) + (t.match(Sl)?.length || 0) > 0;
|
|
463
463
|
}
|
|
464
464
|
const Ho = "number", Xo = "color", Pl = "var", Cl = "var(", ri = "${}", Ml = /var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;
|
|
465
|
-
function
|
|
465
|
+
function Re(t) {
|
|
466
466
|
const e = t.toString(), n = [], s = {
|
|
467
467
|
color: [],
|
|
468
468
|
number: [],
|
|
@@ -473,16 +473,16 @@ function ke(t) {
|
|
|
473
473
|
return { values: n, split: a, indexes: s, types: i };
|
|
474
474
|
}
|
|
475
475
|
function Go(t) {
|
|
476
|
-
return
|
|
476
|
+
return Re(t).values;
|
|
477
477
|
}
|
|
478
478
|
function Yo(t) {
|
|
479
|
-
const { split: e, types: n } =
|
|
479
|
+
const { split: e, types: n } = Re(t), s = e.length;
|
|
480
480
|
return (i) => {
|
|
481
481
|
let r = "";
|
|
482
482
|
for (let o = 0; o < s; o++)
|
|
483
483
|
if (r += e[o], i[o] !== void 0) {
|
|
484
484
|
const a = n[o];
|
|
485
|
-
a === Ho ? r +=
|
|
485
|
+
a === Ho ? r += Ce(i[o]) : a === Xo ? r += q.transform(i[o]) : r += i[o];
|
|
486
486
|
}
|
|
487
487
|
return r;
|
|
488
488
|
};
|
|
@@ -517,16 +517,16 @@ function El({ hue: t, saturation: e, lightness: n, alpha: s }) {
|
|
|
517
517
|
alpha: s
|
|
518
518
|
};
|
|
519
519
|
}
|
|
520
|
-
function
|
|
520
|
+
function on(t, e) {
|
|
521
521
|
return (n) => n > 0 ? e : t;
|
|
522
522
|
}
|
|
523
523
|
const W = (t, e, n) => t + (e - t) * n, Sn = (t, e, n) => {
|
|
524
524
|
const s = t * t, i = n * (e * e - s) + s;
|
|
525
525
|
return i < 0 ? 0 : Math.sqrt(i);
|
|
526
|
-
}, kl = [On, Xt, ne],
|
|
526
|
+
}, kl = [On, Xt, ne], Rl = (t) => kl.find((e) => e.test(t));
|
|
527
527
|
function ai(t) {
|
|
528
|
-
const e =
|
|
529
|
-
if (
|
|
528
|
+
const e = Rl(t);
|
|
529
|
+
if (fe(!!e, `'${t}' is not an animatable color. Use the equivalent color code instead.`, "color-not-animatable"), !e)
|
|
530
530
|
return !1;
|
|
531
531
|
let n = e.parse(t);
|
|
532
532
|
return e === ne && (n = El(n)), n;
|
|
@@ -534,18 +534,18 @@ function ai(t) {
|
|
|
534
534
|
const li = (t, e) => {
|
|
535
535
|
const n = ai(t), s = ai(e);
|
|
536
536
|
if (!n || !s)
|
|
537
|
-
return
|
|
537
|
+
return on(t, e);
|
|
538
538
|
const i = { ...n };
|
|
539
539
|
return (r) => (i.red = Sn(n.red, s.red, r), i.green = Sn(n.green, s.green, r), i.blue = Sn(n.blue, s.blue, r), i.alpha = W(n.alpha, s.alpha, r), Xt.transform(i));
|
|
540
540
|
}, Fn = /* @__PURE__ */ new Set(["none", "hidden"]);
|
|
541
|
-
function
|
|
541
|
+
function Nl(t, e) {
|
|
542
542
|
return Fn.has(t) ? (n) => n <= 0 ? t : e : (n) => n >= 1 ? e : t;
|
|
543
543
|
}
|
|
544
544
|
function Il(t, e) {
|
|
545
545
|
return (n) => W(t, e, n);
|
|
546
546
|
}
|
|
547
547
|
function bs(t) {
|
|
548
|
-
return typeof t == "number" ? Il : typeof t == "string" ? ys(t) ?
|
|
548
|
+
return typeof t == "number" ? Il : typeof t == "string" ? ys(t) ? on : q.test(t) ? li : Fl : Array.isArray(t) ? qo : typeof t == "object" ? q.test(t) ? li : Ll : on;
|
|
549
549
|
}
|
|
550
550
|
function qo(t, e) {
|
|
551
551
|
const n = [...t], s = n.length, i = t.map((r, o) => bs(r)(r, e[o]));
|
|
@@ -574,8 +574,8 @@ function Ol(t, e) {
|
|
|
574
574
|
return n;
|
|
575
575
|
}
|
|
576
576
|
const Fl = (t, e) => {
|
|
577
|
-
const n = It.createTransformer(e), s =
|
|
578
|
-
return s.indexes.var.length === i.indexes.var.length && s.indexes.color.length === i.indexes.color.length && s.indexes.number.length >= i.indexes.number.length ? Fn.has(t) && !i.values.length || Fn.has(e) && !s.values.length ?
|
|
577
|
+
const n = It.createTransformer(e), s = Re(t), i = Re(e);
|
|
578
|
+
return s.indexes.var.length === i.indexes.var.length && s.indexes.color.length === i.indexes.color.length && s.indexes.number.length >= i.indexes.number.length ? Fn.has(t) && !i.values.length || Fn.has(e) && !s.values.length ? Nl(t, e) : Fe(qo(Ol(s, i), i.values), n) : (fe(!0, `Complex values '${t}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`, "complex-values-different"), on(t, e));
|
|
579
579
|
};
|
|
580
580
|
function Zo(t, e, n) {
|
|
581
581
|
return typeof t == "number" && typeof e == "number" && typeof n == "number" ? W(t, e, n) : bs(t)(t, e);
|
|
@@ -584,7 +584,7 @@ const jl = (t) => {
|
|
|
584
584
|
const e = ({ timestamp: n }) => t(n);
|
|
585
585
|
return {
|
|
586
586
|
start: (n = !0) => $.update(e, n),
|
|
587
|
-
stop: () =>
|
|
587
|
+
stop: () => Nt(e),
|
|
588
588
|
/**
|
|
589
589
|
* If we're processing this frame we can use the
|
|
590
590
|
* framelocked timestamp to keep things in sync.
|
|
@@ -597,17 +597,17 @@ const jl = (t) => {
|
|
|
597
597
|
for (let r = 0; r < i; r++)
|
|
598
598
|
s += Math.round(t(r / (i - 1)) * 1e4) / 1e4 + ", ";
|
|
599
599
|
return `linear(${s.substring(0, s.length - 2)})`;
|
|
600
|
-
},
|
|
600
|
+
}, rn = 2e4;
|
|
601
601
|
function ws(t) {
|
|
602
602
|
let e = 0;
|
|
603
603
|
const n = 50;
|
|
604
604
|
let s = t.next(e);
|
|
605
|
-
for (; !s.done && e <
|
|
605
|
+
for (; !s.done && e < rn; )
|
|
606
606
|
e += n, s = t.next(e);
|
|
607
|
-
return e >=
|
|
607
|
+
return e >= rn ? 1 / 0 : e;
|
|
608
608
|
}
|
|
609
609
|
function Bl(t, e = 100, n) {
|
|
610
|
-
const s = n({ ...t, keyframes: [0, e] }), i = Math.min(ws(s),
|
|
610
|
+
const s = n({ ...t, keyframes: [0, e] }), i = Math.min(ws(s), rn);
|
|
611
611
|
return {
|
|
612
612
|
type: "keyframes",
|
|
613
613
|
ease: (r) => s.next(i * r).value / e,
|
|
@@ -617,7 +617,7 @@ function Bl(t, e = 100, n) {
|
|
|
617
617
|
const $l = 5;
|
|
618
618
|
function Qo(t, e, n) {
|
|
619
619
|
const s = Math.max(e - $l, 0);
|
|
620
|
-
return
|
|
620
|
+
return Ro(n - t(s), e - s);
|
|
621
621
|
}
|
|
622
622
|
const U = {
|
|
623
623
|
// Default spring physics
|
|
@@ -650,7 +650,7 @@ const U = {
|
|
|
650
650
|
}, An = 1e-3;
|
|
651
651
|
function zl({ duration: t = U.duration, bounce: e = U.bounce, velocity: n = U.velocity, mass: s = U.mass }) {
|
|
652
652
|
let i, r;
|
|
653
|
-
|
|
653
|
+
fe(t <= /* @__PURE__ */ vt(U.maxDuration), "Spring duration must be 10 seconds or less", "spring-duration-limit");
|
|
654
654
|
let o = 1 - e;
|
|
655
655
|
o = Ct(U.minDamping, U.maxDamping, o), t = Ct(U.minDuration, U.maxDuration, /* @__PURE__ */ ft(t)), o < 1 ? (i = (u) => {
|
|
656
656
|
const c = u * o, d = c * t, h = c - n, p = jn(u, o), g = Math.exp(-d);
|
|
@@ -723,7 +723,7 @@ function Hl(t) {
|
|
|
723
723
|
}
|
|
724
724
|
return e;
|
|
725
725
|
}
|
|
726
|
-
function
|
|
726
|
+
function an(t = U.visualDuration, e = U.bounce) {
|
|
727
727
|
const n = typeof t != "object" ? {
|
|
728
728
|
visualDuration: t,
|
|
729
729
|
keyframes: [0, 1],
|
|
@@ -739,43 +739,43 @@ function rn(t = U.visualDuration, e = U.bounce) {
|
|
|
739
739
|
if (v < 1) {
|
|
740
740
|
const A = jn(y, v);
|
|
741
741
|
x = (E) => {
|
|
742
|
-
const
|
|
743
|
-
return o -
|
|
742
|
+
const N = Math.exp(-v * y * E);
|
|
743
|
+
return o - N * ((g + v * y * b) / A * Math.sin(A * E) + b * Math.cos(A * E));
|
|
744
744
|
};
|
|
745
745
|
} else if (v === 1)
|
|
746
746
|
x = (A) => o - Math.exp(-y * A) * (b + (g + y * b) * A);
|
|
747
747
|
else {
|
|
748
748
|
const A = y * Math.sqrt(v * v - 1);
|
|
749
749
|
x = (E) => {
|
|
750
|
-
const
|
|
751
|
-
return o -
|
|
750
|
+
const N = Math.exp(-v * y * E), P = Math.min(A * E, 300);
|
|
751
|
+
return o - N * ((g + v * y * b) * Math.sinh(P) + A * b * Math.cosh(P)) / A;
|
|
752
752
|
};
|
|
753
753
|
}
|
|
754
|
-
const
|
|
754
|
+
const R = {
|
|
755
755
|
calculatedDuration: p && d || null,
|
|
756
756
|
next: (A) => {
|
|
757
757
|
const E = x(A);
|
|
758
758
|
if (p)
|
|
759
759
|
a.done = A >= d;
|
|
760
760
|
else {
|
|
761
|
-
let
|
|
762
|
-
v < 1 && (
|
|
763
|
-
const P = Math.abs(
|
|
761
|
+
let N = A === 0 ? g : 0;
|
|
762
|
+
v < 1 && (N = A === 0 ? /* @__PURE__ */ vt(g) : Qo(x, A, E));
|
|
763
|
+
const P = Math.abs(N) <= s, L = Math.abs(o - E) <= i;
|
|
764
764
|
a.done = P && L;
|
|
765
765
|
}
|
|
766
766
|
return a.value = a.done ? o : E, a;
|
|
767
767
|
},
|
|
768
768
|
toString: () => {
|
|
769
|
-
const A = Math.min(ws(
|
|
769
|
+
const A = Math.min(ws(R), rn), E = Jo((N) => R.next(A * N).value, A, 30);
|
|
770
770
|
return A + "ms " + E;
|
|
771
771
|
},
|
|
772
772
|
toTransition: () => {
|
|
773
773
|
}
|
|
774
774
|
};
|
|
775
|
-
return
|
|
775
|
+
return R;
|
|
776
776
|
}
|
|
777
|
-
|
|
778
|
-
const e = Bl(t, 100,
|
|
777
|
+
an.applyToOptions = (t) => {
|
|
778
|
+
const e = Bl(t, 100, an);
|
|
779
779
|
return t.ease = e.ease, t.duration = /* @__PURE__ */ vt(e.duration), t.type = "keyframes", t;
|
|
780
780
|
};
|
|
781
781
|
function Bn({ keyframes: t, velocity: e = 0, power: n = 0.8, timeConstant: s = 325, bounceDamping: i = 10, bounceStiffness: r = 500, modifyTarget: o, min: a, max: l, restDelta: u = 0.5, restSpeed: c }) {
|
|
@@ -786,13 +786,13 @@ function Bn({ keyframes: t, velocity: e = 0, power: n = 0.8, timeConstant: s = 3
|
|
|
786
786
|
let v = n * e;
|
|
787
787
|
const b = d + v, y = o === void 0 ? b : o(b);
|
|
788
788
|
y !== b && (v = y - d);
|
|
789
|
-
const T = (P) => -v * Math.exp(-P / s), x = (P) => y + T(P),
|
|
790
|
-
const L = T(P),
|
|
791
|
-
h.done = Math.abs(L) <= u, h.value = h.done ? y :
|
|
789
|
+
const T = (P) => -v * Math.exp(-P / s), x = (P) => y + T(P), R = (P) => {
|
|
790
|
+
const L = T(P), X = x(P);
|
|
791
|
+
h.done = Math.abs(L) <= u, h.value = h.done ? y : X;
|
|
792
792
|
};
|
|
793
793
|
let A, E;
|
|
794
|
-
const
|
|
795
|
-
p(h.value) && (A = P, E =
|
|
794
|
+
const N = (P) => {
|
|
795
|
+
p(h.value) && (A = P, E = an({
|
|
796
796
|
keyframes: [h.value, g(h.value)],
|
|
797
797
|
velocity: Qo(x, P, h.value),
|
|
798
798
|
// TODO: This should be passing * 1000
|
|
@@ -802,11 +802,11 @@ function Bn({ keyframes: t, velocity: e = 0, power: n = 0.8, timeConstant: s = 3
|
|
|
802
802
|
restSpeed: c
|
|
803
803
|
}));
|
|
804
804
|
};
|
|
805
|
-
return
|
|
805
|
+
return N(0), {
|
|
806
806
|
calculatedDuration: null,
|
|
807
807
|
next: (P) => {
|
|
808
808
|
let L = !1;
|
|
809
|
-
return !E && A === void 0 && (L = !0,
|
|
809
|
+
return !E && A === void 0 && (L = !0, R(P), N(P)), A !== void 0 && P >= A ? E.next(P - A) : (!L && R(P), h);
|
|
810
810
|
}
|
|
811
811
|
};
|
|
812
812
|
}
|
|
@@ -816,7 +816,7 @@ function Xl(t, e, n) {
|
|
|
816
816
|
let a = i(t[o], t[o + 1]);
|
|
817
817
|
if (e) {
|
|
818
818
|
const l = Array.isArray(e) ? e[o] || mt : e;
|
|
819
|
-
a =
|
|
819
|
+
a = Fe(l, a);
|
|
820
820
|
}
|
|
821
821
|
s.push(a);
|
|
822
822
|
}
|
|
@@ -837,7 +837,7 @@ function Gl(t, e, { clamp: n = !0, ease: s, mixer: i } = {}) {
|
|
|
837
837
|
if (l > 1)
|
|
838
838
|
for (; d < t.length - 2 && !(c < t[d + 1]); d++)
|
|
839
839
|
;
|
|
840
|
-
const h = /* @__PURE__ */
|
|
840
|
+
const h = /* @__PURE__ */ Ee(t[d], t[d + 1], c);
|
|
841
841
|
return a[d](h);
|
|
842
842
|
};
|
|
843
843
|
return n ? (c) => u(Ct(t[0], t[r - 1], c)) : u;
|
|
@@ -845,7 +845,7 @@ function Gl(t, e, { clamp: n = !0, ease: s, mixer: i } = {}) {
|
|
|
845
845
|
function Yl(t, e) {
|
|
846
846
|
const n = t[t.length - 1];
|
|
847
847
|
for (let s = 1; s <= e; s++) {
|
|
848
|
-
const i = /* @__PURE__ */
|
|
848
|
+
const i = /* @__PURE__ */ Ee(0, e, s);
|
|
849
849
|
t.push(W(n, 1, i));
|
|
850
850
|
}
|
|
851
851
|
}
|
|
@@ -886,7 +886,7 @@ const tc = {
|
|
|
886
886
|
inertia: Bn,
|
|
887
887
|
tween: se,
|
|
888
888
|
keyframes: se,
|
|
889
|
-
spring:
|
|
889
|
+
spring: an
|
|
890
890
|
};
|
|
891
891
|
function tr(t) {
|
|
892
892
|
typeof t.type == "string" && (t.type = tc[t.type]);
|
|
@@ -929,7 +929,7 @@ class As extends Ss {
|
|
|
929
929
|
const { type: n = se, repeat: s = 0, repeatDelay: i = 0, repeatType: r, velocity: o = 0 } = e;
|
|
930
930
|
let { keyframes: a } = e;
|
|
931
931
|
const l = n || se;
|
|
932
|
-
process.env.NODE_ENV !== "production" && l !== se && Mt(a.length <= 2, `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${a}`, "spring-two-frames"), l !== se && typeof a[0] != "number" && (this.mixKeyframes =
|
|
932
|
+
process.env.NODE_ENV !== "production" && l !== se && Mt(a.length <= 2, `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${a}`, "spring-two-frames"), l !== se && typeof a[0] != "number" && (this.mixKeyframes = Fe(ec, Zo(a[0], a[1])), a = [0, 100]);
|
|
933
933
|
const u = l({ ...e, keyframes: a });
|
|
934
934
|
r === "mirror" && (this.mirroredGenerator = l({
|
|
935
935
|
...e,
|
|
@@ -951,18 +951,18 @@ class As extends Ss {
|
|
|
951
951
|
this.speed > 0 ? this.startTime = Math.min(this.startTime, e) : this.speed < 0 && (this.startTime = Math.min(e - i / this.speed, this.startTime)), n ? this.currentTime = e : this.updateTime(e);
|
|
952
952
|
const y = this.currentTime - u * (this.playbackSpeed >= 0 ? 1 : -1), T = this.playbackSpeed >= 0 ? y < 0 : y > i;
|
|
953
953
|
this.currentTime = Math.max(y, 0), this.state === "finished" && this.holdTime === null && (this.currentTime = i);
|
|
954
|
-
let x = this.currentTime,
|
|
954
|
+
let x = this.currentTime, R = s;
|
|
955
955
|
if (d) {
|
|
956
956
|
const P = Math.min(this.currentTime, i) / a;
|
|
957
|
-
let L = Math.floor(P),
|
|
958
|
-
!
|
|
957
|
+
let L = Math.floor(P), X = P % 1;
|
|
958
|
+
!X && P >= 1 && (X = 1), X === 1 && L--, L = Math.min(L, d + 1), !!(L % 2) && (h === "reverse" ? (X = 1 - X, p && (X -= p / a)) : h === "mirror" && (R = o)), x = Ct(0, 1, X) * a;
|
|
959
959
|
}
|
|
960
|
-
const A = T ? { done: !1, value: c[0] } :
|
|
960
|
+
const A = T ? { done: !1, value: c[0] } : R.next(x);
|
|
961
961
|
r && (A.value = r(A.value));
|
|
962
962
|
let { done: E } = A;
|
|
963
963
|
!T && l !== null && (E = this.playbackSpeed >= 0 ? this.currentTime >= i : this.currentTime <= 0);
|
|
964
|
-
const
|
|
965
|
-
return
|
|
964
|
+
const N = this.holdTime === null && (this.state === "finished" || this.state === "running" && E);
|
|
965
|
+
return N && g !== Bn && (A.value = Ts(c, this.options, b, this.speed)), v && v(A.value), N && this.finish(), A;
|
|
966
966
|
}
|
|
967
967
|
/**
|
|
968
968
|
* Allows the returned animation to be awaited or promise-chained. Currently
|
|
@@ -1090,7 +1090,7 @@ const oc = (t, e) => {
|
|
|
1090
1090
|
function rc(t) {
|
|
1091
1091
|
return parseFloat(t.trim());
|
|
1092
1092
|
}
|
|
1093
|
-
const
|
|
1093
|
+
const pe = [
|
|
1094
1094
|
"transformPerspective",
|
|
1095
1095
|
"x",
|
|
1096
1096
|
"y",
|
|
@@ -1108,7 +1108,7 @@ const me = [
|
|
|
1108
1108
|
"skew",
|
|
1109
1109
|
"skewX",
|
|
1110
1110
|
"skewY"
|
|
1111
|
-
],
|
|
1111
|
+
], ge = new Set(pe), fi = (t) => t === me || t === D, ac = /* @__PURE__ */ new Set(["x", "y", "z"]), lc = pe.filter((t) => !ac.has(t));
|
|
1112
1112
|
function cc(t) {
|
|
1113
1113
|
const e = [];
|
|
1114
1114
|
return lc.forEach((n) => {
|
|
@@ -1213,20 +1213,20 @@ const sr = /* @__PURE__ */ pc(() => {
|
|
|
1213
1213
|
return !1;
|
|
1214
1214
|
}
|
|
1215
1215
|
return !0;
|
|
1216
|
-
}, "linearEasing"),
|
|
1216
|
+
}, "linearEasing"), Pe = ([t, e, n, s]) => `cubic-bezier(${t}, ${e}, ${n}, ${s})`, mi = {
|
|
1217
1217
|
linear: "linear",
|
|
1218
1218
|
ease: "ease",
|
|
1219
1219
|
easeIn: "ease-in",
|
|
1220
1220
|
easeOut: "ease-out",
|
|
1221
1221
|
easeInOut: "ease-in-out",
|
|
1222
|
-
circIn: /* @__PURE__ */
|
|
1223
|
-
circOut: /* @__PURE__ */
|
|
1224
|
-
backIn: /* @__PURE__ */
|
|
1225
|
-
backOut: /* @__PURE__ */
|
|
1222
|
+
circIn: /* @__PURE__ */ Pe([0, 0.65, 0.55, 1]),
|
|
1223
|
+
circOut: /* @__PURE__ */ Pe([0.55, 0, 1, 0.45]),
|
|
1224
|
+
backIn: /* @__PURE__ */ Pe([0.31, 0.01, 0.66, -0.59]),
|
|
1225
|
+
backOut: /* @__PURE__ */ Pe([0.33, 1.53, 0.69, 0.99])
|
|
1226
1226
|
};
|
|
1227
1227
|
function ir(t, e) {
|
|
1228
1228
|
if (t)
|
|
1229
|
-
return typeof t == "function" ? sr() ? Jo(t, e) : "ease-out" : Uo(t) ?
|
|
1229
|
+
return typeof t == "function" ? sr() ? Jo(t, e) : "ease-out" : Uo(t) ? Pe(t) : Array.isArray(t) ? t.map((n) => ir(n, e) || mi.easeOut) : mi[t];
|
|
1230
1230
|
}
|
|
1231
1231
|
function gc(t, e, n, { delay: s = 0, duration: i = 300, repeat: r = 0, repeatType: o = "loop", ease: a = "easeOut", times: l } = {}, u = void 0) {
|
|
1232
1232
|
const c = {
|
|
@@ -1400,7 +1400,7 @@ function Sc(t, e, n, s) {
|
|
|
1400
1400
|
if (e === "display" || e === "visibility")
|
|
1401
1401
|
return !0;
|
|
1402
1402
|
const r = t[t.length - 1], o = gi(i, e), a = gi(r, e);
|
|
1403
|
-
return
|
|
1403
|
+
return fe(o === a, `You are trying to animate ${e} from "${i}" to "${r}". "${o ? r : i}" is not an animatable value.`, "value-not-animatable"), !o || !a ? !1 : Tc(t) || (n === "spring" || or(n)) && s;
|
|
1404
1404
|
}
|
|
1405
1405
|
function Xn(t) {
|
|
1406
1406
|
t.duration = 0, t.type = "keyframes";
|
|
@@ -1543,12 +1543,12 @@ const lr = /* @__PURE__ */ new Set([
|
|
|
1543
1543
|
"left",
|
|
1544
1544
|
"right",
|
|
1545
1545
|
"bottom",
|
|
1546
|
-
...
|
|
1547
|
-
]),
|
|
1546
|
+
...pe
|
|
1547
|
+
]), Rc = {
|
|
1548
1548
|
test: (t) => t === "auto",
|
|
1549
1549
|
parse: (t) => t
|
|
1550
|
-
}, cr = (t) => (e) => e.test(t), ur = [
|
|
1551
|
-
function
|
|
1550
|
+
}, cr = (t) => (e) => e.test(t), ur = [me, D, At, Rt, Tl, wl, Rc], yi = (t) => ur.find(cr(t));
|
|
1551
|
+
function Nc(t) {
|
|
1552
1552
|
return typeof t == "number" ? t === 0 : t !== null ? t === "none" || t === "0" || ko(t) : !0;
|
|
1553
1553
|
}
|
|
1554
1554
|
const Ic = /* @__PURE__ */ new Set(["brightness", "contrast", "saturate", "opacity"]);
|
|
@@ -1570,20 +1570,20 @@ const Oc = /\b([a-z-]*)\(.*?\)/gu, Gn = {
|
|
|
1570
1570
|
return e ? e.map(Lc).join(" ") : t;
|
|
1571
1571
|
}
|
|
1572
1572
|
}, vi = {
|
|
1573
|
-
...
|
|
1573
|
+
...me,
|
|
1574
1574
|
transform: Math.round
|
|
1575
1575
|
}, Fc = {
|
|
1576
|
-
rotate:
|
|
1577
|
-
rotateX:
|
|
1578
|
-
rotateY:
|
|
1579
|
-
rotateZ:
|
|
1580
|
-
scale:
|
|
1581
|
-
scaleX:
|
|
1582
|
-
scaleY:
|
|
1583
|
-
scaleZ:
|
|
1584
|
-
skew:
|
|
1585
|
-
skewX:
|
|
1586
|
-
skewY:
|
|
1576
|
+
rotate: Rt,
|
|
1577
|
+
rotateX: Rt,
|
|
1578
|
+
rotateY: Rt,
|
|
1579
|
+
rotateZ: Rt,
|
|
1580
|
+
scale: Xe,
|
|
1581
|
+
scaleX: Xe,
|
|
1582
|
+
scaleY: Xe,
|
|
1583
|
+
scaleZ: Xe,
|
|
1584
|
+
skew: Rt,
|
|
1585
|
+
skewX: Rt,
|
|
1586
|
+
skewY: Rt,
|
|
1587
1587
|
distance: D,
|
|
1588
1588
|
translateX: D,
|
|
1589
1589
|
translateY: D,
|
|
@@ -1593,7 +1593,7 @@ const Oc = /\b([a-z-]*)\(.*?\)/gu, Gn = {
|
|
|
1593
1593
|
z: D,
|
|
1594
1594
|
perspective: D,
|
|
1595
1595
|
transformPerspective: D,
|
|
1596
|
-
opacity:
|
|
1596
|
+
opacity: ke,
|
|
1597
1597
|
originX: oi,
|
|
1598
1598
|
originY: oi,
|
|
1599
1599
|
originZ: D
|
|
@@ -1636,8 +1636,8 @@ const Oc = /\b([a-z-]*)\(.*?\)/gu, Gn = {
|
|
|
1636
1636
|
...Fc,
|
|
1637
1637
|
zIndex: vi,
|
|
1638
1638
|
// SVG
|
|
1639
|
-
fillOpacity:
|
|
1640
|
-
strokeOpacity:
|
|
1639
|
+
fillOpacity: ke,
|
|
1640
|
+
strokeOpacity: ke,
|
|
1641
1641
|
numOctaves: vi
|
|
1642
1642
|
}, jc = {
|
|
1643
1643
|
...Ms,
|
|
@@ -1665,7 +1665,7 @@ function $c(t, e, n) {
|
|
|
1665
1665
|
let s = 0, i;
|
|
1666
1666
|
for (; s < t.length && !i; ) {
|
|
1667
1667
|
const r = t[s];
|
|
1668
|
-
typeof r == "string" && !Bc.has(r) &&
|
|
1668
|
+
typeof r == "string" && !Bc.has(r) && Re(r).values.length && (i = t[s]), s++;
|
|
1669
1669
|
}
|
|
1670
1670
|
if (i && n)
|
|
1671
1671
|
for (const r of e)
|
|
@@ -1701,7 +1701,7 @@ class zc extends Ps {
|
|
|
1701
1701
|
resolveNoneKeyframes() {
|
|
1702
1702
|
const { unresolvedKeyframes: e, name: n } = this, s = [];
|
|
1703
1703
|
for (let i = 0; i < e.length; i++)
|
|
1704
|
-
(e[i] === null ||
|
|
1704
|
+
(e[i] === null || Nc(e[i])) && s.push(i);
|
|
1705
1705
|
s.length && $c(e, s, n);
|
|
1706
1706
|
}
|
|
1707
1707
|
measureInitialState() {
|
|
@@ -1887,7 +1887,7 @@ class _c {
|
|
|
1887
1887
|
if (!this.canTrackVelocity || this.prevFrameValue === void 0 || e - this.updatedAt > xi)
|
|
1888
1888
|
return 0;
|
|
1889
1889
|
const n = Math.min(this.updatedAt - this.prevUpdatedAt, xi);
|
|
1890
|
-
return
|
|
1890
|
+
return Ro(parseFloat(this.current) - parseFloat(this.prevFrameValue), n);
|
|
1891
1891
|
}
|
|
1892
1892
|
/**
|
|
1893
1893
|
* Registers a new animation to control this `MotionValue`. Only one
|
|
@@ -1938,7 +1938,7 @@ class _c {
|
|
|
1938
1938
|
this.dependents?.clear(), this.events.destroy?.notify(), this.clearListeners(), this.stop(), this.stopPassiveEffect && this.stopPassiveEffect();
|
|
1939
1939
|
}
|
|
1940
1940
|
}
|
|
1941
|
-
function
|
|
1941
|
+
function de(t, e) {
|
|
1942
1942
|
return new _c(t, e);
|
|
1943
1943
|
}
|
|
1944
1944
|
const { schedule: Vs } = /* @__PURE__ */ Wo(queueMicrotask, !1), gt = {
|
|
@@ -1992,7 +1992,7 @@ const yr = (t, e) => e ? t === e ? !0 : yr(t, e.parentElement) : !1, Ds = (t) =>
|
|
|
1992
1992
|
function Gc(t) {
|
|
1993
1993
|
return Xc.has(t.tagName) || t.tabIndex !== -1;
|
|
1994
1994
|
}
|
|
1995
|
-
const
|
|
1995
|
+
const Je = /* @__PURE__ */ new WeakSet();
|
|
1996
1996
|
function wi(t) {
|
|
1997
1997
|
return (e) => {
|
|
1998
1998
|
e.key === "Enter" && t(e);
|
|
@@ -2006,7 +2006,7 @@ const Yc = (t, e) => {
|
|
|
2006
2006
|
if (!n)
|
|
2007
2007
|
return;
|
|
2008
2008
|
const s = wi(() => {
|
|
2009
|
-
if (
|
|
2009
|
+
if (Je.has(n))
|
|
2010
2010
|
return;
|
|
2011
2011
|
Pn(n, "down");
|
|
2012
2012
|
const i = wi(() => {
|
|
@@ -2024,9 +2024,9 @@ function qc(t, e, n = {}) {
|
|
|
2024
2024
|
const l = a.currentTarget;
|
|
2025
2025
|
if (!Ti(a))
|
|
2026
2026
|
return;
|
|
2027
|
-
|
|
2027
|
+
Je.add(l);
|
|
2028
2028
|
const u = e(l, a), c = (p, g) => {
|
|
2029
|
-
window.removeEventListener("pointerup", d), window.removeEventListener("pointercancel", h),
|
|
2029
|
+
window.removeEventListener("pointerup", d), window.removeEventListener("pointercancel", h), Je.has(l) && Je.delete(l), Ti(p) && typeof u == "function" && u(p, { success: g });
|
|
2030
2030
|
}, d = (p) => {
|
|
2031
2031
|
c(p, l === window || l === document || n.useGlobalTarget || yr(l, p.target));
|
|
2032
2032
|
}, h = (p) => {
|
|
@@ -2158,45 +2158,45 @@ function xr(t = !0) {
|
|
|
2158
2158
|
const o = xo(() => t && s && s(r), [r, s, t]);
|
|
2159
2159
|
return !n && s ? [!1, o] : [!0];
|
|
2160
2160
|
}
|
|
2161
|
-
const
|
|
2161
|
+
const Ge = (t) => t.key || "";
|
|
2162
2162
|
function Ai(t) {
|
|
2163
2163
|
const e = [];
|
|
2164
|
-
return
|
|
2164
|
+
return Na.forEach(t, (n) => {
|
|
2165
2165
|
Ia(n) && e.push(n);
|
|
2166
2166
|
}), e;
|
|
2167
2167
|
}
|
|
2168
2168
|
const ru = ({ children: t, custom: e, initial: n = !0, onExitComplete: s, presenceAffectsLayout: i = !0, mode: r = "sync", propagate: o = !1, anchorX: a = "left", root: l }) => {
|
|
2169
|
-
const [u, c] = xr(o), d = Z(() => Ai(t), [t]), h = o && !u ? [] : d.map(
|
|
2169
|
+
const [u, c] = xr(o), d = Z(() => Ai(t), [t]), h = o && !u ? [] : d.map(Ge), p = ot(!0), g = ot(d), v = as(() => /* @__PURE__ */ new Map()), [b, y] = I(d), [T, x] = I(d);
|
|
2170
2170
|
Vo(() => {
|
|
2171
2171
|
p.current = !1, g.current = d;
|
|
2172
2172
|
for (let E = 0; E < T.length; E++) {
|
|
2173
|
-
const
|
|
2174
|
-
h.includes(
|
|
2173
|
+
const N = Ge(T[E]);
|
|
2174
|
+
h.includes(N) ? v.delete(N) : v.get(N) !== !0 && v.set(N, !1);
|
|
2175
2175
|
}
|
|
2176
2176
|
}, [T, h.length, h.join("-")]);
|
|
2177
|
-
const
|
|
2177
|
+
const R = [];
|
|
2178
2178
|
if (d !== b) {
|
|
2179
2179
|
let E = [...d];
|
|
2180
|
-
for (let
|
|
2181
|
-
const P = T[
|
|
2182
|
-
h.includes(L) || (E.splice(
|
|
2180
|
+
for (let N = 0; N < T.length; N++) {
|
|
2181
|
+
const P = T[N], L = Ge(P);
|
|
2182
|
+
h.includes(L) || (E.splice(N, 0, P), R.push(P));
|
|
2183
2183
|
}
|
|
2184
|
-
return r === "wait" &&
|
|
2184
|
+
return r === "wait" && R.length && (E = R), x(Ai(E)), y(d), null;
|
|
2185
2185
|
}
|
|
2186
2186
|
process.env.NODE_ENV !== "production" && r === "wait" && T.length > 1 && console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);
|
|
2187
2187
|
const { forceRender: A } = nt(rs);
|
|
2188
2188
|
return f(ee, { children: T.map((E) => {
|
|
2189
|
-
const
|
|
2190
|
-
if (v.has(
|
|
2191
|
-
v.set(
|
|
2189
|
+
const N = Ge(E), P = o && !u ? !1 : d === T || h.includes(N), L = () => {
|
|
2190
|
+
if (v.has(N))
|
|
2191
|
+
v.set(N, !0);
|
|
2192
2192
|
else
|
|
2193
2193
|
return;
|
|
2194
|
-
let
|
|
2194
|
+
let X = !0;
|
|
2195
2195
|
v.forEach((_) => {
|
|
2196
|
-
_ || (
|
|
2197
|
-
}),
|
|
2196
|
+
_ || (X = !1);
|
|
2197
|
+
}), X && (A?.(), x(g.current), o && c?.(), s && s());
|
|
2198
2198
|
};
|
|
2199
|
-
return f(iu, { isPresent: P, initial: !p.current || n ? void 0 : !1, custom: e, presenceAffectsLayout: i, mode: r, root: l, onExitComplete: P ? void 0 : L, anchorX: a, children: E },
|
|
2199
|
+
return f(iu, { isPresent: P, initial: !p.current || n ? void 0 : !1, custom: e, presenceAffectsLayout: i, mode: r, root: l, onExitComplete: P ? void 0 : L, anchorX: a, children: E }, N);
|
|
2200
2200
|
}) });
|
|
2201
2201
|
}, ks = Zt({ strict: !1 }), Pi = {
|
|
2202
2202
|
animation: [
|
|
@@ -2217,15 +2217,15 @@ const ru = ({ children: t, custom: e, initial: n = !0, onExitComplete: s, presen
|
|
|
2217
2217
|
pan: ["onPan", "onPanStart", "onPanSessionStart", "onPanEnd"],
|
|
2218
2218
|
inView: ["whileInView", "onViewportEnter", "onViewportLeave"],
|
|
2219
2219
|
layout: ["layout", "layoutId"]
|
|
2220
|
-
},
|
|
2220
|
+
}, he = {};
|
|
2221
2221
|
for (const t in Pi)
|
|
2222
|
-
|
|
2222
|
+
he[t] = {
|
|
2223
2223
|
isEnabled: (e) => Pi[t].some((n) => !!e[n])
|
|
2224
2224
|
};
|
|
2225
2225
|
function Yn(t) {
|
|
2226
2226
|
for (const e in t)
|
|
2227
|
-
|
|
2228
|
-
...
|
|
2227
|
+
he[e] = {
|
|
2228
|
+
...he[e],
|
|
2229
2229
|
...t[e]
|
|
2230
2230
|
};
|
|
2231
2231
|
}
|
|
@@ -2276,12 +2276,12 @@ const lu = /* @__PURE__ */ new Set([
|
|
|
2276
2276
|
"ignoreStrict",
|
|
2277
2277
|
"viewport"
|
|
2278
2278
|
]);
|
|
2279
|
-
function
|
|
2279
|
+
function ln(t) {
|
|
2280
2280
|
return t.startsWith("while") || t.startsWith("drag") && t !== "draggable" || t.startsWith("layout") || t.startsWith("onTap") || t.startsWith("onPan") || t.startsWith("onLayout") || lu.has(t);
|
|
2281
2281
|
}
|
|
2282
|
-
let br = (t) => !
|
|
2282
|
+
let br = (t) => !ln(t);
|
|
2283
2283
|
function cu(t) {
|
|
2284
|
-
typeof t == "function" && (br = (e) => e.startsWith("on") ? !
|
|
2284
|
+
typeof t == "function" && (br = (e) => e.startsWith("on") ? !ln(e) : t(e));
|
|
2285
2285
|
}
|
|
2286
2286
|
try {
|
|
2287
2287
|
cu(require("@emotion/is-prop-valid").default);
|
|
@@ -2290,7 +2290,7 @@ try {
|
|
|
2290
2290
|
function uu(t, e, n) {
|
|
2291
2291
|
const s = {};
|
|
2292
2292
|
for (const i in t)
|
|
2293
|
-
i === "values" && typeof t.values == "object" || (br(i) || n === !0 &&
|
|
2293
|
+
i === "values" && typeof t.values == "object" || (br(i) || n === !0 && ln(i) || !e && !ln(i) || // If trying to use native HTML drag events, forward drag listeners
|
|
2294
2294
|
t.draggable && i.startsWith("onDrag")) && (s[i] = t[i]);
|
|
2295
2295
|
return s;
|
|
2296
2296
|
}
|
|
@@ -2301,7 +2301,7 @@ function hn(t) {
|
|
|
2301
2301
|
function Ne(t) {
|
|
2302
2302
|
return typeof t == "string" || Array.isArray(t);
|
|
2303
2303
|
}
|
|
2304
|
-
const
|
|
2304
|
+
const Rs = [
|
|
2305
2305
|
"animate",
|
|
2306
2306
|
"whileInView",
|
|
2307
2307
|
"whileFocus",
|
|
@@ -2309,9 +2309,9 @@ const Ns = [
|
|
|
2309
2309
|
"whileTap",
|
|
2310
2310
|
"whileDrag",
|
|
2311
2311
|
"exit"
|
|
2312
|
-
],
|
|
2312
|
+
], Ns = ["initial", ...Rs];
|
|
2313
2313
|
function fn(t) {
|
|
2314
|
-
return hn(t.animate) ||
|
|
2314
|
+
return hn(t.animate) || Ns.some((e) => Ne(t[e]));
|
|
2315
2315
|
}
|
|
2316
2316
|
function wr(t) {
|
|
2317
2317
|
return !!(fn(t) || t.variants);
|
|
@@ -2333,24 +2333,24 @@ function hu(t) {
|
|
|
2333
2333
|
function Ci(t) {
|
|
2334
2334
|
return Array.isArray(t) ? t.join(" ") : t;
|
|
2335
2335
|
}
|
|
2336
|
-
const
|
|
2336
|
+
const Ie = {};
|
|
2337
2337
|
function fu(t) {
|
|
2338
2338
|
for (const e in t)
|
|
2339
|
-
|
|
2339
|
+
Ie[e] = t[e], gs(e) && (Ie[e].isCSSVariable = !0);
|
|
2340
2340
|
}
|
|
2341
2341
|
function Tr(t, { layout: e, layoutId: n }) {
|
|
2342
|
-
return
|
|
2342
|
+
return ge.has(t) || t.startsWith("origin") || (e || n !== void 0) && (!!Ie[t] || t === "opacity");
|
|
2343
2343
|
}
|
|
2344
2344
|
const mu = {
|
|
2345
2345
|
x: "translateX",
|
|
2346
2346
|
y: "translateY",
|
|
2347
2347
|
z: "translateZ",
|
|
2348
2348
|
transformPerspective: "perspective"
|
|
2349
|
-
}, pu =
|
|
2349
|
+
}, pu = pe.length;
|
|
2350
2350
|
function gu(t, e, n) {
|
|
2351
2351
|
let s = "", i = !0;
|
|
2352
2352
|
for (let r = 0; r < pu; r++) {
|
|
2353
|
-
const o =
|
|
2353
|
+
const o = pe[r], a = t[o];
|
|
2354
2354
|
if (a === void 0)
|
|
2355
2355
|
continue;
|
|
2356
2356
|
let l = !0;
|
|
@@ -2371,7 +2371,7 @@ function Is(t, e, n) {
|
|
|
2371
2371
|
let o = !1, a = !1;
|
|
2372
2372
|
for (const l in e) {
|
|
2373
2373
|
const u = e[l];
|
|
2374
|
-
if (
|
|
2374
|
+
if (ge.has(l)) {
|
|
2375
2375
|
o = !0;
|
|
2376
2376
|
continue;
|
|
2377
2377
|
} else if (gs(l)) {
|
|
@@ -2532,7 +2532,7 @@ function Fs(t, e, n, s) {
|
|
|
2532
2532
|
}
|
|
2533
2533
|
return e;
|
|
2534
2534
|
}
|
|
2535
|
-
function
|
|
2535
|
+
function Qe(t) {
|
|
2536
2536
|
return it(t) ? t.get() : t;
|
|
2537
2537
|
}
|
|
2538
2538
|
function Cu({ scrapeMotionValuesFromProps: t, createRenderState: e }, n, s, i) {
|
|
@@ -2544,7 +2544,7 @@ function Cu({ scrapeMotionValuesFromProps: t, createRenderState: e }, n, s, i) {
|
|
|
2544
2544
|
function Mu(t, e, n, s) {
|
|
2545
2545
|
const i = {}, r = s(t, {});
|
|
2546
2546
|
for (const h in r)
|
|
2547
|
-
i[h] =
|
|
2547
|
+
i[h] = Qe(r[h]);
|
|
2548
2548
|
let { initial: o, animate: a } = t;
|
|
2549
2549
|
const l = fn(t), u = wr(t);
|
|
2550
2550
|
e && u && !l && t.inherit !== !1 && (o === void 0 && (o = e.initial), a === void 0 && (a = e.animate));
|
|
@@ -2560,8 +2560,8 @@ function Mu(t, e, n, s) {
|
|
|
2560
2560
|
for (const T in y) {
|
|
2561
2561
|
let x = y[T];
|
|
2562
2562
|
if (Array.isArray(x)) {
|
|
2563
|
-
const
|
|
2564
|
-
x = x[
|
|
2563
|
+
const R = c ? x.length - 1 : 0;
|
|
2564
|
+
x = x[R];
|
|
2565
2565
|
}
|
|
2566
2566
|
x !== null && (i[T] = x);
|
|
2567
2567
|
}
|
|
@@ -2590,7 +2590,7 @@ function Vr(t, e, n) {
|
|
|
2590
2590
|
const s = js(t, e, n);
|
|
2591
2591
|
for (const i in t)
|
|
2592
2592
|
if (it(t[i]) || it(e[i])) {
|
|
2593
|
-
const r =
|
|
2593
|
+
const r = pe.indexOf(i) !== -1 ? "attr" + i.charAt(0).toUpperCase() + i.substring(1) : i;
|
|
2594
2594
|
s[r] = t[i];
|
|
2595
2595
|
}
|
|
2596
2596
|
return s;
|
|
@@ -2614,8 +2614,8 @@ function ku(t, e, n) {
|
|
|
2614
2614
|
[e]
|
|
2615
2615
|
);
|
|
2616
2616
|
}
|
|
2617
|
-
const Bs = (t) => t.replace(/([a-z])([A-Z])/gu, "$1-$2").toLowerCase(),
|
|
2618
|
-
function
|
|
2617
|
+
const Bs = (t) => t.replace(/([a-z])([A-Z])/gu, "$1-$2").toLowerCase(), Ru = "framerAppearId", Dr = "data-" + Bs(Ru), Er = Zt({});
|
|
2618
|
+
function Nu(t, e, n, s, i) {
|
|
2619
2619
|
const { visualElement: r } = nt(dn), o = nt(ks), a = nt(un), l = nt(Es).reducedMotion, u = ot(null);
|
|
2620
2620
|
s = s || o.renderer, !u.current && s && (u.current = s(t, {
|
|
2621
2621
|
visualState: e,
|
|
@@ -2665,7 +2665,7 @@ function kr(t) {
|
|
|
2665
2665
|
if (t)
|
|
2666
2666
|
return t.options.allowProjection !== !1 ? t.projection : kr(t.parent);
|
|
2667
2667
|
}
|
|
2668
|
-
function
|
|
2668
|
+
function tn(t, { forwardMotionProps: e = !1 } = {}, n, s) {
|
|
2669
2669
|
n && Yn(n);
|
|
2670
2670
|
const i = Os(t) ? Du : Vu;
|
|
2671
2671
|
function r(a, l) {
|
|
@@ -2678,7 +2678,7 @@ function Qe(t, { forwardMotionProps: e = !1 } = {}, n, s) {
|
|
|
2678
2678
|
if (!d && ls) {
|
|
2679
2679
|
Ou(c, n);
|
|
2680
2680
|
const g = Fu(c);
|
|
2681
|
-
u = g.MeasureLayout, h.visualElement =
|
|
2681
|
+
u = g.MeasureLayout, h.visualElement = Nu(t, p, c, s, g.ProjectionNode);
|
|
2682
2682
|
}
|
|
2683
2683
|
return C(dn.Provider, { value: h, children: [u && h.visualElement ? f(u, { visualElement: h.visualElement, ...c }) : null, Pu(t, a, ku(p, h.visualElement, l), p, d, e)] });
|
|
2684
2684
|
}
|
|
@@ -2694,11 +2694,11 @@ function Ou(t, e) {
|
|
|
2694
2694
|
const n = nt(ks).strict;
|
|
2695
2695
|
if (process.env.NODE_ENV !== "production" && e && n) {
|
|
2696
2696
|
const s = "You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";
|
|
2697
|
-
t.ignoreStrict ?
|
|
2697
|
+
t.ignoreStrict ? fe(!1, s, "lazy-strict-mode") : Mt(!1, s, "lazy-strict-mode");
|
|
2698
2698
|
}
|
|
2699
2699
|
}
|
|
2700
2700
|
function Fu(t) {
|
|
2701
|
-
const { drag: e, layout: n } =
|
|
2701
|
+
const { drag: e, layout: n } = he;
|
|
2702
2702
|
if (!e && !n)
|
|
2703
2703
|
return {};
|
|
2704
2704
|
const s = { ...e, ...n };
|
|
@@ -2709,18 +2709,18 @@ function Fu(t) {
|
|
|
2709
2709
|
}
|
|
2710
2710
|
function ju(t, e) {
|
|
2711
2711
|
if (typeof Proxy > "u")
|
|
2712
|
-
return
|
|
2713
|
-
const n = /* @__PURE__ */ new Map(), s = (r, o) =>
|
|
2712
|
+
return tn;
|
|
2713
|
+
const n = /* @__PURE__ */ new Map(), s = (r, o) => tn(r, o, t, e), i = (r, o) => (process.env.NODE_ENV !== "production" && fs(!1, "motion() is deprecated. Use motion.create() instead."), s(r, o));
|
|
2714
2714
|
return new Proxy(i, {
|
|
2715
2715
|
/**
|
|
2716
2716
|
* Called when `motion` is referenced with a prop: `motion.div`, `motion.input` etc.
|
|
2717
2717
|
* The prop name is passed through as `key` and we can use that to generate a `motion`
|
|
2718
2718
|
* DOM component with that name.
|
|
2719
2719
|
*/
|
|
2720
|
-
get: (r, o) => o === "create" ? s : (n.has(o) || n.set(o,
|
|
2720
|
+
get: (r, o) => o === "create" ? s : (n.has(o) || n.set(o, tn(o, void 0, t, e)), n.get(o))
|
|
2721
2721
|
});
|
|
2722
2722
|
}
|
|
2723
|
-
function
|
|
2723
|
+
function Rr({ top: t, left: e, right: n, bottom: s }) {
|
|
2724
2724
|
return {
|
|
2725
2725
|
x: { min: e, max: n },
|
|
2726
2726
|
y: { min: t, max: s }
|
|
@@ -2747,20 +2747,20 @@ function qn({ scale: t, scaleX: e, scaleY: n }) {
|
|
|
2747
2747
|
return !Mn(t) || !Mn(e) || !Mn(n);
|
|
2748
2748
|
}
|
|
2749
2749
|
function Ht(t) {
|
|
2750
|
-
return qn(t) ||
|
|
2750
|
+
return qn(t) || Nr(t) || t.z || t.rotate || t.rotateX || t.rotateY || t.skewX || t.skewY;
|
|
2751
2751
|
}
|
|
2752
|
-
function
|
|
2752
|
+
function Nr(t) {
|
|
2753
2753
|
return Vi(t.x) || Vi(t.y);
|
|
2754
2754
|
}
|
|
2755
2755
|
function Vi(t) {
|
|
2756
2756
|
return t && t !== "0%";
|
|
2757
2757
|
}
|
|
2758
|
-
function
|
|
2758
|
+
function cn(t, e, n) {
|
|
2759
2759
|
const s = t - n, i = e * s;
|
|
2760
2760
|
return n + i;
|
|
2761
2761
|
}
|
|
2762
2762
|
function Di(t, e, n, s, i) {
|
|
2763
|
-
return i !== void 0 && (t =
|
|
2763
|
+
return i !== void 0 && (t = cn(t, i, s)), cn(t, n, s) + e;
|
|
2764
2764
|
}
|
|
2765
2765
|
function Zn(t, e = 0, n = 1, s, i) {
|
|
2766
2766
|
t.min = Di(t.min, e, n, s, i), t.max = Di(t.max, e, n, s, i);
|
|
@@ -2788,28 +2788,28 @@ function zu(t, e, n, s = !1) {
|
|
|
2788
2788
|
function oe(t, e) {
|
|
2789
2789
|
t.min = t.min + e, t.max = t.max + e;
|
|
2790
2790
|
}
|
|
2791
|
-
function
|
|
2791
|
+
function Ri(t, e, n, s, i = 0.5) {
|
|
2792
2792
|
const r = W(t.min, t.max, i);
|
|
2793
2793
|
Zn(t, e, n, r, s);
|
|
2794
2794
|
}
|
|
2795
2795
|
function re(t, e) {
|
|
2796
|
-
|
|
2796
|
+
Ri(t.x, e.x, e.scaleX, e.scale, e.originX), Ri(t.y, e.y, e.scaleY, e.scale, e.originY);
|
|
2797
2797
|
}
|
|
2798
2798
|
function Lr(t, e) {
|
|
2799
|
-
return
|
|
2799
|
+
return Rr($u(t.getBoundingClientRect(), e));
|
|
2800
2800
|
}
|
|
2801
2801
|
function Uu(t, e, n) {
|
|
2802
2802
|
const s = Lr(t, n), { scroll: i } = e;
|
|
2803
2803
|
return i && (oe(s.x, i.offset.x), oe(s.y, i.offset.y)), s;
|
|
2804
2804
|
}
|
|
2805
|
-
const
|
|
2805
|
+
const Ni = () => ({
|
|
2806
2806
|
translate: 0,
|
|
2807
2807
|
scale: 1,
|
|
2808
2808
|
origin: 0,
|
|
2809
2809
|
originPoint: 0
|
|
2810
2810
|
}), ae = () => ({
|
|
2811
|
-
x:
|
|
2812
|
-
y:
|
|
2811
|
+
x: Ni(),
|
|
2812
|
+
y: Ni()
|
|
2813
2813
|
}), Ii = () => ({ min: 0, max: 0 }), G = () => ({
|
|
2814
2814
|
x: Ii(),
|
|
2815
2815
|
y: Ii()
|
|
@@ -2829,14 +2829,14 @@ function Ku(t, e, n) {
|
|
|
2829
2829
|
if (it(i))
|
|
2830
2830
|
t.addValue(s, i);
|
|
2831
2831
|
else if (it(r))
|
|
2832
|
-
t.addValue(s,
|
|
2832
|
+
t.addValue(s, de(i, { owner: t }));
|
|
2833
2833
|
else if (r !== i)
|
|
2834
2834
|
if (t.hasValue(s)) {
|
|
2835
2835
|
const o = t.getValue(s);
|
|
2836
2836
|
o.liveStyle === !0 ? o.jump(i) : o.hasAnimated || o.set(i);
|
|
2837
2837
|
} else {
|
|
2838
2838
|
const o = t.getStaticValue(s);
|
|
2839
|
-
t.addValue(s,
|
|
2839
|
+
t.addValue(s, de(o !== void 0 ? o : i, { owner: t }));
|
|
2840
2840
|
}
|
|
2841
2841
|
}
|
|
2842
2842
|
for (const s in n)
|
|
@@ -2882,7 +2882,7 @@ class Hu {
|
|
|
2882
2882
|
this.current = e, _u.set(e, this), this.projection && !this.projection.instance && this.projection.mount(e), this.parent && this.isVariantNode && !this.isControllingVariants && (this.removeFromVariantTree = this.parent.addVariantChild(this)), this.values.forEach((n, s) => this.bindToMotionValue(s, n)), Or.current || Wu(), this.shouldReduceMotion = this.reducedMotionConfig === "never" ? !1 : this.reducedMotionConfig === "always" ? !0 : Jn.current, process.env.NODE_ENV !== "production" && fs(this.shouldReduceMotion !== !0, "You have Reduced Motion enabled on your device. Animations may not appear as expected.", "reduced-motion-disabled"), this.parent?.addChild(this), this.update(this.props, this.presenceContext);
|
|
2883
2883
|
}
|
|
2884
2884
|
unmount() {
|
|
2885
|
-
this.projection && this.projection.unmount(),
|
|
2885
|
+
this.projection && this.projection.unmount(), Nt(this.notifyUpdate), Nt(this.render), this.valueSubscriptions.forEach((e) => e()), this.valueSubscriptions.clear(), this.removeFromVariantTree && this.removeFromVariantTree(), this.parent?.removeChild(this);
|
|
2886
2886
|
for (const e in this.events)
|
|
2887
2887
|
this.events[e].clear();
|
|
2888
2888
|
for (const e in this.features) {
|
|
@@ -2899,7 +2899,7 @@ class Hu {
|
|
|
2899
2899
|
}
|
|
2900
2900
|
bindToMotionValue(e, n) {
|
|
2901
2901
|
this.valueSubscriptions.has(e) && this.valueSubscriptions.get(e)();
|
|
2902
|
-
const s =
|
|
2902
|
+
const s = ge.has(e);
|
|
2903
2903
|
s && this.onBindTransform && this.onBindTransform();
|
|
2904
2904
|
const i = n.on("change", (o) => {
|
|
2905
2905
|
this.latestValues[e] = o, this.props.onUpdate && $.preRender(this.notifyUpdate), s && this.projection && (this.projection.isTransformDirty = !0), this.scheduleRender();
|
|
@@ -2914,8 +2914,8 @@ class Hu {
|
|
|
2914
2914
|
}
|
|
2915
2915
|
updateFeatures() {
|
|
2916
2916
|
let e = "animation";
|
|
2917
|
-
for (e in
|
|
2918
|
-
const n =
|
|
2917
|
+
for (e in he) {
|
|
2918
|
+
const n = he[e];
|
|
2919
2919
|
if (!n)
|
|
2920
2920
|
continue;
|
|
2921
2921
|
const { isEnabled: s, Feature: i } = n;
|
|
@@ -3010,7 +3010,7 @@ class Hu {
|
|
|
3010
3010
|
if (this.props.values && this.props.values[e])
|
|
3011
3011
|
return this.props.values[e];
|
|
3012
3012
|
let s = this.values.get(e);
|
|
3013
|
-
return s === void 0 && n !== void 0 && (s =
|
|
3013
|
+
return s === void 0 && n !== void 0 && (s = de(n === null ? void 0 : n, { owner: this }), this.addValue(e, s)), s;
|
|
3014
3014
|
}
|
|
3015
3015
|
/**
|
|
3016
3016
|
* If we're trying to animate to a previously unencountered value,
|
|
@@ -3092,7 +3092,7 @@ class Gu extends Fr {
|
|
|
3092
3092
|
super(...arguments), this.type = "html", this.renderInstance = jr;
|
|
3093
3093
|
}
|
|
3094
3094
|
readValueFromInstance(e, n) {
|
|
3095
|
-
if (
|
|
3095
|
+
if (ge.has(n))
|
|
3096
3096
|
return this.projection?.isProjecting ? Un(n) : oc(e, n);
|
|
3097
3097
|
{
|
|
3098
3098
|
const s = Xu(e), i = (gs(n) ? s.getPropertyValue(n) : s[n]) || 0;
|
|
@@ -3147,7 +3147,7 @@ class qu extends Fr {
|
|
|
3147
3147
|
return e[n];
|
|
3148
3148
|
}
|
|
3149
3149
|
readValueFromInstance(e, n) {
|
|
3150
|
-
if (
|
|
3150
|
+
if (ge.has(n)) {
|
|
3151
3151
|
const s = dr(n);
|
|
3152
3152
|
return s && s.default || 0;
|
|
3153
3153
|
}
|
|
@@ -3169,19 +3169,19 @@ class qu extends Fr {
|
|
|
3169
3169
|
const $r = (t, e) => Os(t) ? new qu(e) : new Gu(e, {
|
|
3170
3170
|
allowProjection: t !== bo
|
|
3171
3171
|
});
|
|
3172
|
-
function
|
|
3172
|
+
function ue(t, e, n) {
|
|
3173
3173
|
const s = t.getProps();
|
|
3174
3174
|
return Fs(s, e, n !== void 0 ? n : s.custom, t);
|
|
3175
3175
|
}
|
|
3176
3176
|
const Qn = (t) => Array.isArray(t);
|
|
3177
3177
|
function Zu(t, e, n) {
|
|
3178
|
-
t.hasValue(e) ? t.getValue(e).set(n) : t.addValue(e,
|
|
3178
|
+
t.hasValue(e) ? t.getValue(e).set(n) : t.addValue(e, de(n));
|
|
3179
3179
|
}
|
|
3180
3180
|
function Ju(t) {
|
|
3181
3181
|
return Qn(t) ? t[t.length - 1] || 0 : t;
|
|
3182
3182
|
}
|
|
3183
3183
|
function Qu(t, e) {
|
|
3184
|
-
const n =
|
|
3184
|
+
const n = ue(t, e);
|
|
3185
3185
|
let { transitionEnd: s = {}, transition: i = {}, ...r } = n || {};
|
|
3186
3186
|
r = { ...r, ...s };
|
|
3187
3187
|
for (const o in r) {
|
|
@@ -3226,7 +3226,7 @@ const sd = {
|
|
|
3226
3226
|
type: "keyframes",
|
|
3227
3227
|
ease: [0.25, 0.1, 0.35, 1],
|
|
3228
3228
|
duration: 0.3
|
|
3229
|
-
}, ad = (t, { keyframes: e }) => e.length > 2 ? od :
|
|
3229
|
+
}, ad = (t, { keyframes: e }) => e.length > 2 ? od : ge.has(t) ? t.startsWith("scale") ? id(e[1]) : sd : rd;
|
|
3230
3230
|
function ld({ when: t, delay: e, delayChildren: n, staggerChildren: s, staggerDirection: i, repeat: r, repeatType: o, repeatDelay: a, from: l, elapsed: u, ...c }) {
|
|
3231
3231
|
return !!Object.keys(c).length;
|
|
3232
3232
|
}
|
|
@@ -3304,7 +3304,7 @@ function Wr(t, e, n, s = 0, i = 1) {
|
|
|
3304
3304
|
return typeof n == "function" ? n(r, o) : i === 1 ? r * s : a - r * s;
|
|
3305
3305
|
}
|
|
3306
3306
|
function es(t, e, n = {}) {
|
|
3307
|
-
const s =
|
|
3307
|
+
const s = ue(t, e, n.type === "exit" ? t.presenceContext?.custom : void 0);
|
|
3308
3308
|
let { transition: i = t.getDefaultTransition() || {} } = s || {};
|
|
3309
3309
|
n.transitionOverride && (i = n.transitionOverride);
|
|
3310
3310
|
const r = s ? () => Promise.all(Ur(t, s, n)) : () => Promise.resolve(), o = t.variantChildren && t.variantChildren.size ? (l = 0) => {
|
|
@@ -3335,7 +3335,7 @@ function dd(t, e, n = {}) {
|
|
|
3335
3335
|
} else if (typeof e == "string")
|
|
3336
3336
|
s = es(t, e, n);
|
|
3337
3337
|
else {
|
|
3338
|
-
const i = typeof e == "function" ?
|
|
3338
|
+
const i = typeof e == "function" ? ue(t, e, n.custom) : e;
|
|
3339
3339
|
s = Promise.all(Ur(t, i, n));
|
|
3340
3340
|
}
|
|
3341
3341
|
return s.then(() => {
|
|
@@ -3353,7 +3353,7 @@ function _r(t, e) {
|
|
|
3353
3353
|
return !1;
|
|
3354
3354
|
return !0;
|
|
3355
3355
|
}
|
|
3356
|
-
const hd =
|
|
3356
|
+
const hd = Ns.length;
|
|
3357
3357
|
function Kr(t) {
|
|
3358
3358
|
if (!t)
|
|
3359
3359
|
return;
|
|
@@ -3363,19 +3363,19 @@ function Kr(t) {
|
|
|
3363
3363
|
}
|
|
3364
3364
|
const e = {};
|
|
3365
3365
|
for (let n = 0; n < hd; n++) {
|
|
3366
|
-
const s =
|
|
3366
|
+
const s = Ns[n], i = t.props[s];
|
|
3367
3367
|
(Ne(i) || i === !1) && (e[s] = i);
|
|
3368
3368
|
}
|
|
3369
3369
|
return e;
|
|
3370
3370
|
}
|
|
3371
|
-
const fd = [...
|
|
3371
|
+
const fd = [...Rs].reverse(), md = Rs.length;
|
|
3372
3372
|
function pd(t) {
|
|
3373
3373
|
return (e) => Promise.all(e.map(({ animation: n, options: s }) => dd(t, n, s)));
|
|
3374
3374
|
}
|
|
3375
3375
|
function gd(t) {
|
|
3376
3376
|
let e = pd(t), n = Oi(), s = !0;
|
|
3377
3377
|
const i = (l) => (u, c) => {
|
|
3378
|
-
const d =
|
|
3378
|
+
const d = ue(t, c, l === "exit" ? t.presenceContext?.custom : void 0);
|
|
3379
3379
|
if (d) {
|
|
3380
3380
|
const { transition: h, transitionEnd: p, ...g } = d;
|
|
3381
3381
|
u = { ...u, ...g, ...p };
|
|
@@ -3389,20 +3389,20 @@ function gd(t) {
|
|
|
3389
3389
|
const { props: u } = t, c = Kr(t.parent) || {}, d = [], h = /* @__PURE__ */ new Set();
|
|
3390
3390
|
let p = {}, g = 1 / 0;
|
|
3391
3391
|
for (let b = 0; b < md; b++) {
|
|
3392
|
-
const y = fd[b], T = n[y], x = u[y] !== void 0 ? u[y] : c[y],
|
|
3392
|
+
const y = fd[b], T = n[y], x = u[y] !== void 0 ? u[y] : c[y], R = Ne(x), A = y === l ? T.isActive : null;
|
|
3393
3393
|
A === !1 && (g = b);
|
|
3394
|
-
let E = x === c[y] && x !== u[y] &&
|
|
3394
|
+
let E = x === c[y] && x !== u[y] && R;
|
|
3395
3395
|
if (E && s && t.manuallyAnimateOnMount && (E = !1), T.protectedKeys = { ...p }, // If it isn't active and hasn't *just* been set as inactive
|
|
3396
3396
|
!T.isActive && A === null || // If we didn't and don't have any defined prop for this animation type
|
|
3397
3397
|
!x && !T.prevProp || // Or if the prop doesn't define an animation
|
|
3398
3398
|
hn(x) || typeof x == "boolean")
|
|
3399
3399
|
continue;
|
|
3400
|
-
const
|
|
3401
|
-
let P =
|
|
3402
|
-
y === l && T.isActive && !E &&
|
|
3403
|
-
b > g &&
|
|
3404
|
-
const
|
|
3405
|
-
let _ =
|
|
3400
|
+
const N = yd(T.prevProp, x);
|
|
3401
|
+
let P = N || // If we're making this variant active, we want to always make it active
|
|
3402
|
+
y === l && T.isActive && !E && R || // If we removed a higher-priority variant (i is in reverse order)
|
|
3403
|
+
b > g && R, L = !1;
|
|
3404
|
+
const X = Array.isArray(x) ? x : [x];
|
|
3405
|
+
let _ = X.reduce(i(y), {});
|
|
3406
3406
|
A === !1 && (_ = {});
|
|
3407
3407
|
const { prevResolvedValues: Pt = {} } = T, Dt = {
|
|
3408
3408
|
...Pt,
|
|
@@ -3420,11 +3420,11 @@ function gd(t) {
|
|
|
3420
3420
|
Qn(J) && Qn(Y) ? ct = !_r(J, Y) : ct = J !== Y, ct ? J != null ? pt(k) : h.add(k) : J !== void 0 && h.has(k) ? pt(k) : T.protectedKeys[k] = !0;
|
|
3421
3421
|
}
|
|
3422
3422
|
T.prevProp = x, T.prevResolvedValues = _, T.isActive && (p = { ...p, ..._ }), s && t.blockInitialAnimation && (P = !1);
|
|
3423
|
-
const at = E &&
|
|
3424
|
-
P && (!at || L) && d.push(...
|
|
3423
|
+
const at = E && N;
|
|
3424
|
+
P && (!at || L) && d.push(...X.map((k) => {
|
|
3425
3425
|
const J = { type: y };
|
|
3426
3426
|
if (typeof k == "string" && s && !at && t.manuallyAnimateOnMount && t.parent) {
|
|
3427
|
-
const { parent: Y } = t, ct =
|
|
3427
|
+
const { parent: Y } = t, ct = ue(Y, k);
|
|
3428
3428
|
if (Y.enteringChildren && ct) {
|
|
3429
3429
|
const { delayChildren: K } = ct.transition || {};
|
|
3430
3430
|
J.delay = Wr(Y.enteringChildren, t, K);
|
|
@@ -3439,7 +3439,7 @@ function gd(t) {
|
|
|
3439
3439
|
if (h.size) {
|
|
3440
3440
|
const b = {};
|
|
3441
3441
|
if (typeof u.initial != "boolean") {
|
|
3442
|
-
const y =
|
|
3442
|
+
const y = ue(t, Array.isArray(u.initial) ? u.initial[0] : u.initial);
|
|
3443
3443
|
y && y.transition && (b.transition = y.transition);
|
|
3444
3444
|
}
|
|
3445
3445
|
h.forEach((y) => {
|
|
@@ -3556,10 +3556,10 @@ const Hr = {
|
|
|
3556
3556
|
Feature: bd
|
|
3557
3557
|
}
|
|
3558
3558
|
};
|
|
3559
|
-
function
|
|
3559
|
+
function Le(t, e, n, s = { passive: !0 }) {
|
|
3560
3560
|
return t.addEventListener(e, n, s), () => t.removeEventListener(e, n);
|
|
3561
3561
|
}
|
|
3562
|
-
function
|
|
3562
|
+
function $e(t) {
|
|
3563
3563
|
return {
|
|
3564
3564
|
point: {
|
|
3565
3565
|
x: t.pageX,
|
|
@@ -3567,9 +3567,9 @@ function Be(t) {
|
|
|
3567
3567
|
}
|
|
3568
3568
|
};
|
|
3569
3569
|
}
|
|
3570
|
-
const wd = (t) => (e) => Ds(e) && t(e,
|
|
3571
|
-
function
|
|
3572
|
-
return
|
|
3570
|
+
const wd = (t) => (e) => Ds(e) && t(e, $e(e));
|
|
3571
|
+
function Me(t, e, n, s) {
|
|
3572
|
+
return Le(t, e, wd(n), s);
|
|
3573
3573
|
}
|
|
3574
3574
|
const Xr = 1e-4, Td = 1 - Xr, Sd = 1 + Xr, Gr = 0.01, Ad = 0 - Gr, Pd = 0 + Gr;
|
|
3575
3575
|
function rt(t) {
|
|
@@ -3581,7 +3581,7 @@ function Cd(t, e, n) {
|
|
|
3581
3581
|
function Fi(t, e, n, s = 0.5) {
|
|
3582
3582
|
t.origin = s, t.originPoint = W(e.min, e.max, t.origin), t.scale = rt(n) / rt(e), t.translate = W(n.min, n.max, t.origin) - t.originPoint, (t.scale >= Td && t.scale <= Sd || isNaN(t.scale)) && (t.scale = 1), (t.translate >= Ad && t.translate <= Pd || isNaN(t.translate)) && (t.translate = 0);
|
|
3583
3583
|
}
|
|
3584
|
-
function
|
|
3584
|
+
function Ve(t, e, n, s) {
|
|
3585
3585
|
Fi(t.x, e.x, n.x, s ? s.originX : void 0), Fi(t.y, e.y, n.y, s ? s.originY : void 0);
|
|
3586
3586
|
}
|
|
3587
3587
|
function ji(t, e, n) {
|
|
@@ -3593,7 +3593,7 @@ function Md(t, e, n) {
|
|
|
3593
3593
|
function Bi(t, e, n) {
|
|
3594
3594
|
t.min = e.min - n.min, t.max = t.min + rt(e);
|
|
3595
3595
|
}
|
|
3596
|
-
function
|
|
3596
|
+
function De(t, e, n) {
|
|
3597
3597
|
Bi(t.x, e.x, n.x), Bi(t.y, e.y, n.y);
|
|
3598
3598
|
}
|
|
3599
3599
|
function ht(t) {
|
|
@@ -3628,16 +3628,16 @@ class qr {
|
|
|
3628
3628
|
}, !Ds(e))
|
|
3629
3629
|
return;
|
|
3630
3630
|
this.dragSnapToOrigin = r, this.handlers = n, this.transformPagePoint = s, this.distanceThreshold = o, this.contextWindow = i || window;
|
|
3631
|
-
const a =
|
|
3631
|
+
const a = $e(e), l = Vn(a, this.transformPagePoint), { point: u } = l, { timestamp: c } = tt;
|
|
3632
3632
|
this.history = [{ ...u, timestamp: c }];
|
|
3633
3633
|
const { onSessionStart: d } = n;
|
|
3634
|
-
d && d(e, Dn(l, this.history)), this.removeListeners =
|
|
3634
|
+
d && d(e, Dn(l, this.history)), this.removeListeners = Fe(Me(this.contextWindow, "pointermove", this.handlePointerMove), Me(this.contextWindow, "pointerup", this.handlePointerUp), Me(this.contextWindow, "pointercancel", this.handlePointerUp));
|
|
3635
3635
|
}
|
|
3636
3636
|
updateHandlers(e) {
|
|
3637
3637
|
this.handlers = e;
|
|
3638
3638
|
}
|
|
3639
3639
|
end() {
|
|
3640
|
-
this.removeListeners && this.removeListeners(),
|
|
3640
|
+
this.removeListeners && this.removeListeners(), Nt(this.updatePoint);
|
|
3641
3641
|
}
|
|
3642
3642
|
}
|
|
3643
3643
|
function Vn(t, e) {
|
|
@@ -3687,7 +3687,7 @@ function Ui(t, e, n) {
|
|
|
3687
3687
|
max: n !== void 0 ? t.max + n - (t.max - t.min) : void 0
|
|
3688
3688
|
};
|
|
3689
3689
|
}
|
|
3690
|
-
function
|
|
3690
|
+
function Rd(t, { top: e, left: n, bottom: s, right: i }) {
|
|
3691
3691
|
return {
|
|
3692
3692
|
x: Ui(t.x, n, i),
|
|
3693
3693
|
y: Ui(t.y, e, s)
|
|
@@ -3697,7 +3697,7 @@ function Wi(t, e) {
|
|
|
3697
3697
|
let n = e.min - t.min, s = e.max - t.max;
|
|
3698
3698
|
return e.max - e.min < t.max - t.min && ([n, s] = [s, n]), { min: n, max: s };
|
|
3699
3699
|
}
|
|
3700
|
-
function
|
|
3700
|
+
function Nd(t, e) {
|
|
3701
3701
|
return {
|
|
3702
3702
|
x: Wi(t.x, e.x),
|
|
3703
3703
|
y: Wi(t.y, e.y)
|
|
@@ -3706,7 +3706,7 @@ function Rd(t, e) {
|
|
|
3706
3706
|
function Id(t, e) {
|
|
3707
3707
|
let n = 0.5;
|
|
3708
3708
|
const s = rt(t), i = rt(e);
|
|
3709
|
-
return i > s ? n = /* @__PURE__ */
|
|
3709
|
+
return i > s ? n = /* @__PURE__ */ Ee(e.min, e.max - s, t.min) : s > i && (n = /* @__PURE__ */ Ee(t.min, t.max - i, e.min)), Ct(0, 1, n);
|
|
3710
3710
|
}
|
|
3711
3711
|
function Ld(t, e) {
|
|
3712
3712
|
const n = {};
|
|
@@ -3739,7 +3739,7 @@ class jd {
|
|
|
3739
3739
|
return;
|
|
3740
3740
|
const r = (d) => {
|
|
3741
3741
|
const { dragSnapToOrigin: h } = this.getProps();
|
|
3742
|
-
h ? this.pauseAnimation() : this.stopAnimation(), n && this.snapToCursor(
|
|
3742
|
+
h ? this.pauseAnimation() : this.stopAnimation(), n && this.snapToCursor($e(d).point);
|
|
3743
3743
|
}, o = (d, h) => {
|
|
3744
3744
|
const { drag: p, dragPropagation: g, onDragStart: v } = this.getProps();
|
|
3745
3745
|
if (p && !g && (this.openDragLock && this.openDragLock(), this.openDragLock = Kc(p), !this.openDragLock))
|
|
@@ -3749,8 +3749,8 @@ class jd {
|
|
|
3749
3749
|
if (At.test(T)) {
|
|
3750
3750
|
const { projection: x } = this.visualElement;
|
|
3751
3751
|
if (x && x.layout) {
|
|
3752
|
-
const
|
|
3753
|
-
|
|
3752
|
+
const R = x.layout.layoutBox[y];
|
|
3753
|
+
R && (T = rt(R) * (parseFloat(T) / 100));
|
|
3754
3754
|
}
|
|
3755
3755
|
}
|
|
3756
3756
|
this.originPoint[y] = T;
|
|
@@ -3808,7 +3808,7 @@ class jd {
|
|
|
3808
3808
|
}
|
|
3809
3809
|
updateAxis(e, n, s) {
|
|
3810
3810
|
const { drag: i } = this.getProps();
|
|
3811
|
-
if (!s || !
|
|
3811
|
+
if (!s || !Ye(e, i, this.currentDirection))
|
|
3812
3812
|
return;
|
|
3813
3813
|
const r = this.getAxisMotionValue(e);
|
|
3814
3814
|
let o = this.originPoint[e] + s[e];
|
|
@@ -3816,7 +3816,7 @@ class jd {
|
|
|
3816
3816
|
}
|
|
3817
3817
|
resolveConstraints() {
|
|
3818
3818
|
const { dragConstraints: e, dragElastic: n } = this.getProps(), s = this.visualElement.projection && !this.visualElement.projection.layout ? this.visualElement.projection.measure(!1) : this.visualElement.projection?.layout, i = this.constraints;
|
|
3819
|
-
e && ie(e) ? this.constraints || (this.constraints = this.resolveRefConstraints()) : e && s ? this.constraints =
|
|
3819
|
+
e && ie(e) ? this.constraints || (this.constraints = this.resolveRefConstraints()) : e && s ? this.constraints = Rd(s.layoutBox, e) : this.constraints = !1, this.elastic = Od(n), i !== this.constraints && s && this.constraints && !this.hasMutatedConstraints && ht((r) => {
|
|
3820
3820
|
this.constraints !== !1 && this.getAxisMotionValue(r) && (this.constraints[r] = Ld(s.layoutBox[r], this.constraints[r]));
|
|
3821
3821
|
});
|
|
3822
3822
|
}
|
|
@@ -3830,16 +3830,16 @@ class jd {
|
|
|
3830
3830
|
if (!i || !i.layout)
|
|
3831
3831
|
return !1;
|
|
3832
3832
|
const r = Uu(s, i.root, this.visualElement.getTransformPagePoint());
|
|
3833
|
-
let o =
|
|
3833
|
+
let o = Nd(i.layout.layoutBox, r);
|
|
3834
3834
|
if (n) {
|
|
3835
3835
|
const a = n(Bu(o));
|
|
3836
|
-
this.hasMutatedConstraints = !!a, a && (o =
|
|
3836
|
+
this.hasMutatedConstraints = !!a, a && (o = Rr(a));
|
|
3837
3837
|
}
|
|
3838
3838
|
return o;
|
|
3839
3839
|
}
|
|
3840
3840
|
startAnimation(e) {
|
|
3841
3841
|
const { drag: n, dragMomentum: s, dragElastic: i, dragTransition: r, dragSnapToOrigin: o, onDragTransitionEnd: a } = this.getProps(), l = this.constraints || {}, u = ht((c) => {
|
|
3842
|
-
if (!
|
|
3842
|
+
if (!Ye(c, n, this.currentDirection))
|
|
3843
3843
|
return;
|
|
3844
3844
|
let d = l && l[c] || {};
|
|
3845
3845
|
o && (d = { min: 0, max: 0 });
|
|
@@ -3884,7 +3884,7 @@ class jd {
|
|
|
3884
3884
|
snapToCursor(e) {
|
|
3885
3885
|
ht((n) => {
|
|
3886
3886
|
const { drag: s } = this.getProps();
|
|
3887
|
-
if (!
|
|
3887
|
+
if (!Ye(n, s, this.currentDirection))
|
|
3888
3888
|
return;
|
|
3889
3889
|
const { projection: i } = this.visualElement, r = this.getAxisMotionValue(n);
|
|
3890
3890
|
if (i && i.layout) {
|
|
@@ -3915,7 +3915,7 @@ class jd {
|
|
|
3915
3915
|
});
|
|
3916
3916
|
const { transformTemplate: r } = this.visualElement.getProps();
|
|
3917
3917
|
this.visualElement.current.style.transform = r ? r({}, "") : "none", s.root && s.root.updateScroll(), s.updateLayout(), this.resolveConstraints(), ht((o) => {
|
|
3918
|
-
if (!
|
|
3918
|
+
if (!Ye(o, e, null))
|
|
3919
3919
|
return;
|
|
3920
3920
|
const a = this.getAxisMotionValue(o), { min: l, max: u } = this.constraints[o];
|
|
3921
3921
|
a.set(W(l, u, i[o]));
|
|
@@ -3925,7 +3925,7 @@ class jd {
|
|
|
3925
3925
|
if (!this.visualElement.current)
|
|
3926
3926
|
return;
|
|
3927
3927
|
Fd.set(this.visualElement, this);
|
|
3928
|
-
const e = this.visualElement.current, n =
|
|
3928
|
+
const e = this.visualElement.current, n = Me(e, "pointerdown", (l) => {
|
|
3929
3929
|
const { drag: u, dragListener: c = !0 } = this.getProps();
|
|
3930
3930
|
u && c && this.start(l);
|
|
3931
3931
|
}), s = () => {
|
|
@@ -3933,7 +3933,7 @@ class jd {
|
|
|
3933
3933
|
ie(l) && l.current && (this.constraints = this.resolveRefConstraints());
|
|
3934
3934
|
}, { projection: i } = this.visualElement, r = i.addEventListener("measure", s);
|
|
3935
3935
|
i && !i.layout && (i.root && i.root.updateScroll(), i.updateLayout()), $.read(s);
|
|
3936
|
-
const o =
|
|
3936
|
+
const o = Le(window, "resize", () => this.scalePositionWithinConstraints()), a = i.addEventListener("didUpdate", ({ delta: l, hasLayoutChanged: u }) => {
|
|
3937
3937
|
this.isDragging && u && (ht((c) => {
|
|
3938
3938
|
const d = this.getAxisMotionValue(c);
|
|
3939
3939
|
d && (this.originPoint[c] += l[c].translate, d.set(d.get() + l[c].translate));
|
|
@@ -3956,7 +3956,7 @@ class jd {
|
|
|
3956
3956
|
};
|
|
3957
3957
|
}
|
|
3958
3958
|
}
|
|
3959
|
-
function
|
|
3959
|
+
function Ye(t, e, n) {
|
|
3960
3960
|
return (e === !0 || e === t) && (n === null || n === t);
|
|
3961
3961
|
}
|
|
3962
3962
|
function Bd(t, e = 10) {
|
|
@@ -4000,7 +4000,7 @@ class zd extends Lt {
|
|
|
4000
4000
|
};
|
|
4001
4001
|
}
|
|
4002
4002
|
mount() {
|
|
4003
|
-
this.removePointerDownListener =
|
|
4003
|
+
this.removePointerDownListener = Me(this.node.current, "pointerdown", (e) => this.onPointerDown(e));
|
|
4004
4004
|
}
|
|
4005
4005
|
update() {
|
|
4006
4006
|
this.session && this.session.updateHandlers(this.createPanHandlers());
|
|
@@ -4009,7 +4009,7 @@ class zd extends Lt {
|
|
|
4009
4009
|
this.removePointerDownListener(), this.session && this.session.end();
|
|
4010
4010
|
}
|
|
4011
4011
|
}
|
|
4012
|
-
const
|
|
4012
|
+
const en = {
|
|
4013
4013
|
/**
|
|
4014
4014
|
* Global flag as to whether the tree has animated since the last time
|
|
4015
4015
|
* we resized the window
|
|
@@ -4024,7 +4024,7 @@ const tn = {
|
|
|
4024
4024
|
function Xi(t, e) {
|
|
4025
4025
|
return e.max === e.min ? 0 : t / (e.max - e.min) * 100;
|
|
4026
4026
|
}
|
|
4027
|
-
const
|
|
4027
|
+
const Ae = {
|
|
4028
4028
|
correct: (t, e) => {
|
|
4029
4029
|
if (!e.target)
|
|
4030
4030
|
return t;
|
|
@@ -4061,7 +4061,7 @@ class Wd extends Fa {
|
|
|
4061
4061
|
}), r.setOptions({
|
|
4062
4062
|
...r.options,
|
|
4063
4063
|
onExitComplete: () => this.safeToRemove()
|
|
4064
|
-
})),
|
|
4064
|
+
})), en.hasEverUpdated = !0;
|
|
4065
4065
|
}
|
|
4066
4066
|
getSnapshotBeforeUpdate(e) {
|
|
4067
4067
|
const { layoutDependency: n, visualElement: s, drag: i, isPresent: r } = this.props, { projection: o } = s;
|
|
@@ -4094,7 +4094,7 @@ function Jr(t) {
|
|
|
4094
4094
|
}
|
|
4095
4095
|
const _d = {
|
|
4096
4096
|
borderRadius: {
|
|
4097
|
-
...
|
|
4097
|
+
...Ae,
|
|
4098
4098
|
applyTo: [
|
|
4099
4099
|
"borderTopLeftRadius",
|
|
4100
4100
|
"borderTopRightRadius",
|
|
@@ -4102,14 +4102,14 @@ const _d = {
|
|
|
4102
4102
|
"borderBottomRightRadius"
|
|
4103
4103
|
]
|
|
4104
4104
|
},
|
|
4105
|
-
borderTopLeftRadius:
|
|
4106
|
-
borderTopRightRadius:
|
|
4107
|
-
borderBottomLeftRadius:
|
|
4108
|
-
borderBottomRightRadius:
|
|
4105
|
+
borderTopLeftRadius: Ae,
|
|
4106
|
+
borderTopRightRadius: Ae,
|
|
4107
|
+
borderBottomLeftRadius: Ae,
|
|
4108
|
+
borderBottomRightRadius: Ae,
|
|
4109
4109
|
boxShadow: Ud
|
|
4110
4110
|
};
|
|
4111
4111
|
function Kd(t, e, n) {
|
|
4112
|
-
const s = it(t) ? t :
|
|
4112
|
+
const s = it(t) ? t : de(t);
|
|
4113
4113
|
return s.start($s("", s, e, n)), s.animation;
|
|
4114
4114
|
}
|
|
4115
4115
|
const Hd = (t, e) => t.depth - e.depth;
|
|
@@ -4130,9 +4130,9 @@ class Xd {
|
|
|
4130
4130
|
function Gd(t, e) {
|
|
4131
4131
|
const n = lt.now(), s = ({ timestamp: i }) => {
|
|
4132
4132
|
const r = i - n;
|
|
4133
|
-
r >= e && (
|
|
4133
|
+
r >= e && (Nt(s), t(r - e));
|
|
4134
4134
|
};
|
|
4135
|
-
return $.setup(s, !0), () =>
|
|
4135
|
+
return $.setup(s, !0), () => Nt(s);
|
|
4136
4136
|
}
|
|
4137
4137
|
const Qr = ["TopLeft", "TopRight", "BottomLeft", "BottomRight"], Yd = Qr.length, Gi = (t) => typeof t == "string" ? parseFloat(t) : t, Yi = (t) => typeof t == "number" || D.test(t);
|
|
4138
4138
|
function qd(t, e, n, s, i, r) {
|
|
@@ -4151,7 +4151,7 @@ function qi(t, e) {
|
|
|
4151
4151
|
}
|
|
4152
4152
|
const Zd = /* @__PURE__ */ ta(0, 0.5, Bo), Jd = /* @__PURE__ */ ta(0.5, 0.95, mt);
|
|
4153
4153
|
function ta(t, e, n) {
|
|
4154
|
-
return (s) => s < t ? 0 : s > e ? 1 : n(/* @__PURE__ */
|
|
4154
|
+
return (s) => s < t ? 0 : s > e ? 1 : n(/* @__PURE__ */ Ee(t, e, s));
|
|
4155
4155
|
}
|
|
4156
4156
|
function Zi(t, e) {
|
|
4157
4157
|
t.min = e.min, t.max = e.max;
|
|
@@ -4163,7 +4163,7 @@ function Ji(t, e) {
|
|
|
4163
4163
|
t.translate = e.translate, t.scale = e.scale, t.originPoint = e.originPoint, t.origin = e.origin;
|
|
4164
4164
|
}
|
|
4165
4165
|
function Qi(t, e, n, s, i) {
|
|
4166
|
-
return t -= e, t =
|
|
4166
|
+
return t -= e, t = cn(t, 1 / n, s), i !== void 0 && (t = cn(t, 1 / i, s)), t;
|
|
4167
4167
|
}
|
|
4168
4168
|
function Qd(t, e = 0, n = 1, s = 0.5, i, r = t, o = t) {
|
|
4169
4169
|
if (At.test(e) && (e = parseFloat(e), e = W(o.min, o.max, e / 100) - o.min), typeof e != "number")
|
|
@@ -4268,7 +4268,7 @@ function ih(t, e, n) {
|
|
|
4268
4268
|
}
|
|
4269
4269
|
const kn = ["", "X", "Y", "Z"], oh = 1e3;
|
|
4270
4270
|
let rh = 0;
|
|
4271
|
-
function
|
|
4271
|
+
function Rn(t, e, n, s) {
|
|
4272
4272
|
const { latestValues: i } = e;
|
|
4273
4273
|
i[t] && (n[t] = i[t], e.setStaticValue(t, 0), s && (s[t] = 0));
|
|
4274
4274
|
}
|
|
@@ -4323,7 +4323,7 @@ function ia({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
4323
4323
|
d = window.innerWidth;
|
|
4324
4324
|
}), t(o, () => {
|
|
4325
4325
|
const p = window.innerWidth;
|
|
4326
|
-
p !== d && (d = p, this.root.updateBlockedByResize = !0, c && c(), c = Gd(h, 250),
|
|
4326
|
+
p !== d && (d = p, this.root.updateBlockedByResize = !0, c && c(), c = Gd(h, 250), en.hasAnimatedSinceResize && (en.hasAnimatedSinceResize = !1, this.nodes.forEach(co)));
|
|
4327
4327
|
});
|
|
4328
4328
|
}
|
|
4329
4329
|
a && this.root.registerSharedNode(a, this), this.options.animate !== !1 && u && (a || l) && this.addEventListener("didUpdate", ({ delta: c, hasLayoutChanged: d, hasRelativeLayoutChanged: h, layout: p }) => {
|
|
@@ -4348,7 +4348,7 @@ function ia({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
4348
4348
|
unmount() {
|
|
4349
4349
|
this.options.layoutId && this.willUpdate(), this.root.nodes.remove(this);
|
|
4350
4350
|
const o = this.getStack();
|
|
4351
|
-
o && o.remove(this), this.parent && this.parent.children.delete(this), this.instance = void 0, this.eventHandlers.clear(),
|
|
4351
|
+
o && o.remove(this), this.parent && this.parent.children.delete(this), this.instance = void 0, this.eventHandlers.clear(), Nt(this.updateProjection);
|
|
4352
4352
|
}
|
|
4353
4353
|
// only on the root
|
|
4354
4354
|
blockUpdate() {
|
|
@@ -4535,17 +4535,17 @@ function ia({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
4535
4535
|
if (!(!this.layout || !(c || d))) {
|
|
4536
4536
|
if (this.resolvedRelativeTargetAt = tt.timestamp, !this.targetDelta && !this.relativeTarget) {
|
|
4537
4537
|
const h = this.getClosestProjectingParent();
|
|
4538
|
-
h && h.layout && this.animationProgress !== 1 ? (this.relativeParent = h, this.forceRelativeParentToResolveTarget(), this.relativeTarget = G(), this.relativeTargetOrigin = G(),
|
|
4538
|
+
h && h.layout && this.animationProgress !== 1 ? (this.relativeParent = h, this.forceRelativeParentToResolveTarget(), this.relativeTarget = G(), this.relativeTargetOrigin = G(), De(this.relativeTargetOrigin, this.layout.layoutBox, h.layout.layoutBox), dt(this.relativeTarget, this.relativeTargetOrigin)) : this.relativeParent = this.relativeTarget = void 0;
|
|
4539
4539
|
}
|
|
4540
4540
|
if (!(!this.relativeTarget && !this.targetDelta) && (this.target || (this.target = G(), this.targetWithTransforms = G()), this.relativeTarget && this.relativeTargetOrigin && this.relativeParent && this.relativeParent.target ? (this.forceRelativeParentToResolveTarget(), Md(this.target, this.relativeTarget, this.relativeParent.target)) : this.targetDelta ? (this.resumingFrom ? this.target = this.applyTransform(this.layout.layoutBox) : dt(this.target, this.layout.layoutBox), Ir(this.target, this.targetDelta)) : dt(this.target, this.layout.layoutBox), this.attemptToResolveRelativeTarget)) {
|
|
4541
4541
|
this.attemptToResolveRelativeTarget = !1;
|
|
4542
4542
|
const h = this.getClosestProjectingParent();
|
|
4543
|
-
h && !!h.resumingFrom == !!this.resumingFrom && !h.options.layoutScroll && h.target && this.animationProgress !== 1 ? (this.relativeParent = h, this.forceRelativeParentToResolveTarget(), this.relativeTarget = G(), this.relativeTargetOrigin = G(),
|
|
4543
|
+
h && !!h.resumingFrom == !!this.resumingFrom && !h.options.layoutScroll && h.target && this.animationProgress !== 1 ? (this.relativeParent = h, this.forceRelativeParentToResolveTarget(), this.relativeTarget = G(), this.relativeTargetOrigin = G(), De(this.relativeTargetOrigin, this.target, h.target), dt(this.relativeTarget, this.relativeTargetOrigin)) : this.relativeParent = this.relativeTarget = void 0;
|
|
4544
4544
|
}
|
|
4545
4545
|
}
|
|
4546
4546
|
}
|
|
4547
4547
|
getClosestProjectingParent() {
|
|
4548
|
-
if (!(!this.parent || qn(this.parent.latestValues) ||
|
|
4548
|
+
if (!(!this.parent || qn(this.parent.latestValues) || Nr(this.parent.latestValues)))
|
|
4549
4549
|
return this.parent.isProjecting() ? this.parent : this.parent.getClosestProjectingParent();
|
|
4550
4550
|
}
|
|
4551
4551
|
isProjecting() {
|
|
@@ -4567,7 +4567,7 @@ function ia({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
4567
4567
|
this.prevProjectionDelta && (this.createProjectionDeltas(), this.scheduleRender());
|
|
4568
4568
|
return;
|
|
4569
4569
|
}
|
|
4570
|
-
!this.projectionDelta || !this.prevProjectionDelta ? this.createProjectionDeltas() : (Ji(this.prevProjectionDelta.x, this.projectionDelta.x), Ji(this.prevProjectionDelta.y, this.projectionDelta.y)),
|
|
4570
|
+
!this.projectionDelta || !this.prevProjectionDelta ? this.createProjectionDeltas() : (Ji(this.prevProjectionDelta.x, this.projectionDelta.x), Ji(this.prevProjectionDelta.y, this.projectionDelta.y)), Ve(this.projectionDelta, this.layoutCorrected, p, this.latestValues), (this.treeScale.x !== d || this.treeScale.y !== h || !ro(this.projectionDelta.x, this.prevProjectionDelta.x) || !ro(this.projectionDelta.y, this.prevProjectionDelta.y)) && (this.hasProjected = !0, this.scheduleRender(), this.notifyListeners("projectionUpdate", p));
|
|
4571
4571
|
}
|
|
4572
4572
|
hide() {
|
|
4573
4573
|
this.isVisible = !1;
|
|
@@ -4591,14 +4591,14 @@ function ia({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
4591
4591
|
const h = G(), p = l ? l.source : void 0, g = this.layout ? this.layout.source : void 0, v = p !== g, b = this.getStack(), y = !b || b.members.length <= 1, T = !!(v && !y && this.options.crossfade === !0 && !this.path.some(vh));
|
|
4592
4592
|
this.animationProgress = 0;
|
|
4593
4593
|
let x;
|
|
4594
|
-
this.mixTargetDelta = (
|
|
4595
|
-
const A =
|
|
4596
|
-
uo(d.x, o.x, A), uo(d.y, o.y, A), this.setTargetDelta(d), this.relativeTarget && this.relativeTargetOrigin && this.layout && this.relativeParent && this.relativeParent.layout && (
|
|
4594
|
+
this.mixTargetDelta = (R) => {
|
|
4595
|
+
const A = R / 1e3;
|
|
4596
|
+
uo(d.x, o.x, A), uo(d.y, o.y, A), this.setTargetDelta(d), this.relativeTarget && this.relativeTargetOrigin && this.layout && this.relativeParent && this.relativeParent.layout && (De(h, this.layout.layoutBox, this.relativeParent.layout.layoutBox), yh(this.relativeTarget, this.relativeTargetOrigin, h, A), x && nh(this.relativeTarget, x) && (this.isProjectionDirty = !1), x || (x = G()), dt(x, this.relativeTarget)), v && (this.animationValues = c, qd(c, u, this.latestValues, A, T, y)), this.root.scheduleUpdateProjection(), this.scheduleRender(), this.animationProgress = A;
|
|
4597
4597
|
}, this.mixTargetDelta(this.options.layoutRoot ? 1e3 : 0);
|
|
4598
4598
|
}
|
|
4599
4599
|
startAnimation(o) {
|
|
4600
|
-
this.notifyListeners("animationStart"), this.currentAnimation?.stop(), this.resumingFrom?.currentAnimation?.stop(), this.pendingAnimation && (
|
|
4601
|
-
|
|
4600
|
+
this.notifyListeners("animationStart"), this.currentAnimation?.stop(), this.resumingFrom?.currentAnimation?.stop(), this.pendingAnimation && (Nt(this.pendingAnimation), this.pendingAnimation = void 0), this.pendingAnimation = $.update(() => {
|
|
4601
|
+
en.hasAnimatedSinceResize = !0, this.motionValue || (this.motionValue = de(0)), this.currentAnimation = Kd(this.motionValue, [0, 1e3], {
|
|
4602
4602
|
...o,
|
|
4603
4603
|
velocity: 0,
|
|
4604
4604
|
isSync: !0,
|
|
@@ -4632,7 +4632,7 @@ function ia({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
4632
4632
|
const h = rt(this.layout.layoutBox.y);
|
|
4633
4633
|
l.y.min = o.target.y.min, l.y.max = l.y.min + h;
|
|
4634
4634
|
}
|
|
4635
|
-
dt(a, l), re(a, c),
|
|
4635
|
+
dt(a, l), re(a, c), Ve(this.projectionDeltaWithTransform, this.layoutCorrected, a, c);
|
|
4636
4636
|
}
|
|
4637
4637
|
}
|
|
4638
4638
|
registerSharedNode(o, a) {
|
|
@@ -4677,9 +4677,9 @@ function ia({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
4677
4677
|
if ((l.z || l.rotate || l.rotateX || l.rotateY || l.rotateZ || l.skewX || l.skewY) && (a = !0), !a)
|
|
4678
4678
|
return;
|
|
4679
4679
|
const u = {};
|
|
4680
|
-
l.z &&
|
|
4680
|
+
l.z && Rn("z", o, u, this.animationValues);
|
|
4681
4681
|
for (let c = 0; c < kn.length; c++)
|
|
4682
|
-
|
|
4682
|
+
Rn(`rotate${kn[c]}`, o, u, this.animationValues), Rn(`skew${kn[c]}`, o, u, this.animationValues);
|
|
4683
4683
|
o.render();
|
|
4684
4684
|
for (const c in u)
|
|
4685
4685
|
o.setStaticValue(c, u[c]), this.animationValues && (this.animationValues[c] = u[c]);
|
|
@@ -4694,12 +4694,12 @@ function ia({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
4694
4694
|
}
|
|
4695
4695
|
const l = this.getTransformTemplate();
|
|
4696
4696
|
if (this.needsReset) {
|
|
4697
|
-
this.needsReset = !1, o.visibility = "", o.opacity = "", o.pointerEvents =
|
|
4697
|
+
this.needsReset = !1, o.visibility = "", o.opacity = "", o.pointerEvents = Qe(a?.pointerEvents) || "", o.transform = l ? l(this.latestValues, "") : "none";
|
|
4698
4698
|
return;
|
|
4699
4699
|
}
|
|
4700
4700
|
const u = this.getLead();
|
|
4701
4701
|
if (!this.projectionDelta || !this.layout || !u.target) {
|
|
4702
|
-
this.options.layoutId && (o.opacity = this.latestValues.opacity !== void 0 ? this.latestValues.opacity : 1, o.pointerEvents =
|
|
4702
|
+
this.options.layoutId && (o.opacity = this.latestValues.opacity !== void 0 ? this.latestValues.opacity : 1, o.pointerEvents = Qe(a?.pointerEvents) || ""), this.hasProjected && !Ht(this.latestValues) && (o.transform = l ? l({}, "") : "none", this.hasProjected = !1);
|
|
4703
4703
|
return;
|
|
4704
4704
|
}
|
|
4705
4705
|
o.visibility = "";
|
|
@@ -4709,18 +4709,18 @@ function ia({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
4709
4709
|
l && (d = l(c, d)), o.transform = d;
|
|
4710
4710
|
const { x: h, y: p } = this.projectionDelta;
|
|
4711
4711
|
o.transformOrigin = `${h.origin * 100}% ${p.origin * 100}% 0`, u.animationValues ? o.opacity = u === this ? c.opacity ?? this.latestValues.opacity ?? 1 : this.preserveOpacity ? this.latestValues.opacity : c.opacityExit : o.opacity = u === this ? c.opacity !== void 0 ? c.opacity : "" : c.opacityExit !== void 0 ? c.opacityExit : 0;
|
|
4712
|
-
for (const g in
|
|
4712
|
+
for (const g in Ie) {
|
|
4713
4713
|
if (c[g] === void 0)
|
|
4714
4714
|
continue;
|
|
4715
|
-
const { correct: v, applyTo: b, isCSSVariable: y } =
|
|
4715
|
+
const { correct: v, applyTo: b, isCSSVariable: y } = Ie[g], T = d === "none" ? c[g] : v(c[g], u);
|
|
4716
4716
|
if (b) {
|
|
4717
4717
|
const x = b.length;
|
|
4718
|
-
for (let
|
|
4719
|
-
o[b[
|
|
4718
|
+
for (let R = 0; R < x; R++)
|
|
4719
|
+
o[b[R]] = T;
|
|
4720
4720
|
} else
|
|
4721
4721
|
y ? this.options.visualElement.renderState.vars[g] = T : o[g] = T;
|
|
4722
4722
|
}
|
|
4723
|
-
this.options.layoutId && (o.pointerEvents = u === this ?
|
|
4723
|
+
this.options.layoutId && (o.pointerEvents = u === this ? Qe(a?.pointerEvents) || "" : "none");
|
|
4724
4724
|
}
|
|
4725
4725
|
clearSnapshot() {
|
|
4726
4726
|
this.resumeFrom = this.snapshot = void 0;
|
|
@@ -4746,9 +4746,9 @@ function lh(t) {
|
|
|
4746
4746
|
d.max = d.min + h, t.relativeTarget && !t.currentAnimation && (t.isProjectionDirty = !0, t.relativeTarget[c].max = t.relativeTarget[c].min + h);
|
|
4747
4747
|
});
|
|
4748
4748
|
const o = ae();
|
|
4749
|
-
|
|
4749
|
+
Ve(o, n, e.layoutBox);
|
|
4750
4750
|
const a = ae();
|
|
4751
|
-
r ?
|
|
4751
|
+
r ? Ve(a, t.applyTransform(s, !0), e.measuredBox) : Ve(a, n, e.layoutBox);
|
|
4752
4752
|
const l = !ea(o);
|
|
4753
4753
|
let u = !1;
|
|
4754
4754
|
if (!t.resumeFrom) {
|
|
@@ -4757,9 +4757,9 @@ function lh(t) {
|
|
|
4757
4757
|
const { snapshot: d, layout: h } = c;
|
|
4758
4758
|
if (d && h) {
|
|
4759
4759
|
const p = G();
|
|
4760
|
-
|
|
4760
|
+
De(p, e.layoutBox, d.layoutBox);
|
|
4761
4761
|
const g = G();
|
|
4762
|
-
|
|
4762
|
+
De(g, n, h.layoutBox), na(p, g) || (u = !0), c.options.layoutRoot && (t.relativeTarget = g, t.relativeTargetOrigin = p, t.relativeParent = c);
|
|
4763
4763
|
}
|
|
4764
4764
|
}
|
|
4765
4765
|
}
|
|
@@ -4840,13 +4840,13 @@ function wh(t) {
|
|
|
4840
4840
|
return t !== t.root && t.scroll?.wasRoot;
|
|
4841
4841
|
}
|
|
4842
4842
|
const Th = ia({
|
|
4843
|
-
attachResizeListener: (t, e) =>
|
|
4843
|
+
attachResizeListener: (t, e) => Le(t, "resize", e),
|
|
4844
4844
|
measureScroll: () => ({
|
|
4845
4845
|
x: document.documentElement.scrollLeft || document.body.scrollLeft,
|
|
4846
4846
|
y: document.documentElement.scrollTop || document.body.scrollTop
|
|
4847
4847
|
}),
|
|
4848
4848
|
checkIsScrollRoot: () => !0
|
|
4849
|
-
}),
|
|
4849
|
+
}), Nn = {
|
|
4850
4850
|
current: void 0
|
|
4851
4851
|
}, ra = ia({
|
|
4852
4852
|
measureScroll: (t) => ({
|
|
@@ -4854,11 +4854,11 @@ const Th = ia({
|
|
|
4854
4854
|
y: t.scrollTop
|
|
4855
4855
|
}),
|
|
4856
4856
|
defaultParent: () => {
|
|
4857
|
-
if (!
|
|
4857
|
+
if (!Nn.current) {
|
|
4858
4858
|
const t = new Th({});
|
|
4859
|
-
t.mount(window), t.setOptions({ layoutScroll: !0 }),
|
|
4859
|
+
t.mount(window), t.setOptions({ layoutScroll: !0 }), Nn.current = t;
|
|
4860
4860
|
}
|
|
4861
|
-
return
|
|
4861
|
+
return Nn.current;
|
|
4862
4862
|
},
|
|
4863
4863
|
resetTransform: (t, e) => {
|
|
4864
4864
|
t.style.transform = e !== void 0 ? e : "none";
|
|
@@ -4878,7 +4878,7 @@ function go(t, e, n) {
|
|
|
4878
4878
|
const { props: s } = t;
|
|
4879
4879
|
t.animationState && s.whileHover && t.animationState.setActive("whileHover", n === "Start");
|
|
4880
4880
|
const i = "onHover" + n, r = s[i];
|
|
4881
|
-
r && $.postRender(() => r(e,
|
|
4881
|
+
r && $.postRender(() => r(e, $e(e)));
|
|
4882
4882
|
}
|
|
4883
4883
|
class Ah extends Lt {
|
|
4884
4884
|
mount() {
|
|
@@ -4905,7 +4905,7 @@ class Ph extends Lt {
|
|
|
4905
4905
|
!this.isActive || !this.node.animationState || (this.node.animationState.setActive("whileFocus", !1), this.isActive = !1);
|
|
4906
4906
|
}
|
|
4907
4907
|
mount() {
|
|
4908
|
-
this.unmount =
|
|
4908
|
+
this.unmount = Fe(Le(this.node.current, "focus", () => this.onFocus()), Le(this.node.current, "blur", () => this.onBlur()));
|
|
4909
4909
|
}
|
|
4910
4910
|
unmount() {
|
|
4911
4911
|
}
|
|
@@ -4916,7 +4916,7 @@ function yo(t, e, n) {
|
|
|
4916
4916
|
return;
|
|
4917
4917
|
t.animationState && s.whileTap && t.animationState.setActive("whileTap", n === "Start");
|
|
4918
4918
|
const i = "onTap" + (n === "End" ? "" : n), r = s[i];
|
|
4919
|
-
r && $.postRender(() => r(e,
|
|
4919
|
+
r && $.postRender(() => r(e, $e(e)));
|
|
4920
4920
|
}
|
|
4921
4921
|
class Ch extends Lt {
|
|
4922
4922
|
mount() {
|
|
@@ -4948,7 +4948,7 @@ const kh = {
|
|
|
4948
4948
|
some: 0,
|
|
4949
4949
|
all: 1
|
|
4950
4950
|
};
|
|
4951
|
-
class
|
|
4951
|
+
class Rh extends Lt {
|
|
4952
4952
|
constructor() {
|
|
4953
4953
|
super(...arguments), this.hasEnteredView = !1, this.isInView = !1;
|
|
4954
4954
|
}
|
|
@@ -4975,17 +4975,17 @@ class Nh extends Lt {
|
|
|
4975
4975
|
if (typeof IntersectionObserver > "u")
|
|
4976
4976
|
return;
|
|
4977
4977
|
const { props: e, prevProps: n } = this.node;
|
|
4978
|
-
["amount", "margin", "root"].some(
|
|
4978
|
+
["amount", "margin", "root"].some(Nh(e, n)) && this.startObserver();
|
|
4979
4979
|
}
|
|
4980
4980
|
unmount() {
|
|
4981
4981
|
}
|
|
4982
4982
|
}
|
|
4983
|
-
function
|
|
4983
|
+
function Nh({ viewport: t = {} }, { viewport: e = {} } = {}) {
|
|
4984
4984
|
return (n) => t[n] !== e[n];
|
|
4985
4985
|
}
|
|
4986
4986
|
const aa = {
|
|
4987
4987
|
inView: {
|
|
4988
|
-
Feature:
|
|
4988
|
+
Feature: Rh
|
|
4989
4989
|
},
|
|
4990
4990
|
tap: {
|
|
4991
4991
|
Feature: Ch
|
|
@@ -5012,22 +5012,34 @@ const aa = {
|
|
|
5012
5012
|
...aa
|
|
5013
5013
|
};
|
|
5014
5014
|
function la(t, e) {
|
|
5015
|
-
return
|
|
5015
|
+
return tn(t, e);
|
|
5016
5016
|
}
|
|
5017
|
-
const
|
|
5017
|
+
const qe = /* @__PURE__ */ la("div"), jh = /* @__PURE__ */ la("p"), le = Symbol.for("@arcteninc/core:originalName");
|
|
5018
5018
|
function ff(t, e) {
|
|
5019
|
-
return t[
|
|
5020
|
-
}
|
|
5021
|
-
function Bh(t, e) {
|
|
5022
|
-
|
|
5023
|
-
|
|
5024
|
-
|
|
5025
|
-
const
|
|
5026
|
-
|
|
5027
|
-
|
|
5028
|
-
}
|
|
5019
|
+
return t[le] = e, t;
|
|
5020
|
+
}
|
|
5021
|
+
function Bh(t, e, n, s) {
|
|
5022
|
+
if (typeof t != "function") return null;
|
|
5023
|
+
const i = t[le];
|
|
5024
|
+
if (i) {
|
|
5025
|
+
const a = e[i];
|
|
5026
|
+
if (a && !n.has(a.name))
|
|
5027
|
+
return { fn: t, meta: a };
|
|
5028
|
+
}
|
|
5029
|
+
const r = t.name;
|
|
5030
|
+
let o;
|
|
5031
|
+
if (r && (o = e[r], o && !n.has(o.name)))
|
|
5032
|
+
return t[le] = o.name, { fn: t, meta: o };
|
|
5033
|
+
if (s && s.length > 0) {
|
|
5034
|
+
for (const a of s)
|
|
5035
|
+
if (!n.has(a) && (o = e[a], o))
|
|
5036
|
+
return t[le] = o.name, { fn: t, meta: o };
|
|
5037
|
+
} else if (o = Object.values(e).find((l) => !n.has(l.name)), o)
|
|
5038
|
+
return t[le] = o.name, { fn: t, meta: o };
|
|
5039
|
+
return null;
|
|
5029
5040
|
}
|
|
5030
5041
|
function ca(t, e) {
|
|
5042
|
+
let n, s;
|
|
5031
5043
|
if (!e)
|
|
5032
5044
|
throw new Error(
|
|
5033
5045
|
`❌ toolMetadata is required!
|
|
@@ -5037,35 +5049,32 @@ Please:
|
|
|
5037
5049
|
2. Import the generated metadata:
|
|
5038
5050
|
import { toolMetadata } from './.arcten/tool-metadata';
|
|
5039
5051
|
3. Pass it to useAgent/ArctenAgent:
|
|
5040
|
-
useAgent({ tools: [...], toolMetadata: toolMetadata
|
|
5052
|
+
useAgent({ tools: [...], toolMetadata: toolMetadata })
|
|
5053
|
+
(Pass the full object for better minification support, or toolMetadata.functions for backward compatibility)
|
|
5041
5054
|
`
|
|
5042
5055
|
);
|
|
5043
|
-
|
|
5044
|
-
|
|
5045
|
-
|
|
5046
|
-
|
|
5047
|
-
|
|
5048
|
-
|
|
5049
|
-
|
|
5050
|
-
|
|
5051
|
-
|
|
5052
|
-
|
|
5053
|
-
|
|
5054
|
-
|
|
5055
|
-
console.warn(
|
|
5056
|
-
`⚠️ [@arcteninc/core] No metadata found for tool "${u}". This tool will be excluded.
|
|
5056
|
+
if ("functions" in e && typeof e.functions == "object") {
|
|
5057
|
+
const r = e;
|
|
5058
|
+
n = r.functions, s = r.toolOrder;
|
|
5059
|
+
} else
|
|
5060
|
+
n = e, s = void 0;
|
|
5061
|
+
const i = /* @__PURE__ */ new Set();
|
|
5062
|
+
return t.map((r) => {
|
|
5063
|
+
const o = Bh(r, n, i, s);
|
|
5064
|
+
if (!o) {
|
|
5065
|
+
const a = r.name, u = r[le] || a || "unnamed";
|
|
5066
|
+
return typeof process < "u" && (process.env.NODE_ENV === "development" || process.env.NODE_ENV !== "production") && typeof console < "u" && console.warn && console.warn(
|
|
5067
|
+
`⚠️ [@arcteninc/core] No metadata found for tool "${u}". This tool will be excluded.
|
|
5057
5068
|
To fix: Run "arcten-extract-types ." and ensure "${u}" is used in ArctenAgent/useAgent.`
|
|
5058
|
-
|
|
5059
|
-
}
|
|
5060
|
-
return null;
|
|
5069
|
+
), null;
|
|
5061
5070
|
}
|
|
5062
|
-
return {
|
|
5063
|
-
name:
|
|
5071
|
+
return i.add(o.meta.name), {
|
|
5072
|
+
name: o.meta.name,
|
|
5064
5073
|
// Use original name from metadata, not minified fn.name
|
|
5065
|
-
description:
|
|
5066
|
-
jsonSchema:
|
|
5074
|
+
description: o.meta.description,
|
|
5075
|
+
jsonSchema: o.meta.parameters
|
|
5067
5076
|
};
|
|
5068
|
-
}).filter((
|
|
5077
|
+
}).filter((r) => r !== null);
|
|
5069
5078
|
}
|
|
5070
5079
|
function $h({
|
|
5071
5080
|
toolName: t,
|
|
@@ -5088,7 +5097,7 @@ function $h({
|
|
|
5088
5097
|
] }),
|
|
5089
5098
|
/* @__PURE__ */ C("div", { className: "flex items-center gap-1 flex-shrink-0", children: [
|
|
5090
5099
|
/* @__PURE__ */ C(
|
|
5091
|
-
|
|
5100
|
+
sn,
|
|
5092
5101
|
{
|
|
5093
5102
|
size: "sm",
|
|
5094
5103
|
variant: "ghost",
|
|
@@ -5101,13 +5110,13 @@ function $h({
|
|
|
5101
5110
|
}
|
|
5102
5111
|
),
|
|
5103
5112
|
/* @__PURE__ */ f(
|
|
5104
|
-
|
|
5113
|
+
sn,
|
|
5105
5114
|
{
|
|
5106
5115
|
size: "sm",
|
|
5107
5116
|
variant: "ghost",
|
|
5108
5117
|
className: "h-6 px-2 text-xs text-muted-foreground",
|
|
5109
5118
|
onClick: i,
|
|
5110
|
-
children: /* @__PURE__ */ f(
|
|
5119
|
+
children: /* @__PURE__ */ f(nn, { className: "h-3 w-3" })
|
|
5111
5120
|
}
|
|
5112
5121
|
)
|
|
5113
5122
|
] })
|
|
@@ -5135,7 +5144,7 @@ function zh({
|
|
|
5135
5144
|
className: `inline-flex items-center gap-1.5 text-xs rounded-md px-2 py-1 transition-colors ${n ? "bg-red-100 dark:bg-red-950/30 text-red-700 dark:text-red-400" : "bg-green-100 dark:bg-green-950/30 text-green-700 dark:text-green-400"} ${l ? "cursor-pointer hover:bg-opacity-80" : ""}`,
|
|
5136
5145
|
children: [
|
|
5137
5146
|
l && /* @__PURE__ */ f("span", { className: "transition-transform duration-200", children: i ? /* @__PURE__ */ f($a, { className: "h-3 w-3" }) : /* @__PURE__ */ f(za, { className: "h-3 w-3" }) }),
|
|
5138
|
-
n ? /* @__PURE__ */ f(
|
|
5147
|
+
n ? /* @__PURE__ */ f(nn, { className: "h-3 w-3" }) : s ? /* @__PURE__ */ f(Ua, { className: "h-3 w-3" }) : /* @__PURE__ */ f(wo, { className: "h-3 w-3" }),
|
|
5139
5148
|
/* @__PURE__ */ C("span", { className: "font-medium", children: [
|
|
5140
5149
|
n ? "Denied" : s ? "Auto-executed" : "Executed",
|
|
5141
5150
|
" ",
|
|
@@ -5182,7 +5191,7 @@ function _h({
|
|
|
5182
5191
|
}
|
|
5183
5192
|
const Kh = Ba(
|
|
5184
5193
|
() => import("streamdown").then((t) => ({ default: t.Streamdown }))
|
|
5185
|
-
), zs =
|
|
5194
|
+
), zs = Oe(
|
|
5186
5195
|
({ className: t, ...e }) => typeof window > "u" ? null : /* @__PURE__ */ f(ja, { fallback: null, children: /* @__PURE__ */ f(
|
|
5187
5196
|
Kh,
|
|
5188
5197
|
{
|
|
@@ -5234,12 +5243,12 @@ const Hh = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
5234
5243
|
children: t
|
|
5235
5244
|
}
|
|
5236
5245
|
);
|
|
5237
|
-
}, Gh =
|
|
5246
|
+
}, Gh = Oe(Xh), ua = Zt(null), Yh = () => {
|
|
5238
5247
|
const t = nt(ua);
|
|
5239
5248
|
if (!t)
|
|
5240
5249
|
throw new Error("Reasoning components must be used within Reasoning");
|
|
5241
5250
|
return t;
|
|
5242
|
-
}, qh = 1e3, Zh = 1e3, da =
|
|
5251
|
+
}, qh = 1e3, Zh = 1e3, da = Oe(
|
|
5243
5252
|
({
|
|
5244
5253
|
className: t,
|
|
5245
5254
|
isStreaming: e = !1,
|
|
@@ -5292,7 +5301,7 @@ const Hh = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
5292
5301
|
"Thought for ",
|
|
5293
5302
|
e,
|
|
5294
5303
|
" seconds"
|
|
5295
|
-
] }), ha =
|
|
5304
|
+
] }), ha = Oe(
|
|
5296
5305
|
({ className: t, children: e, ...n }) => {
|
|
5297
5306
|
const { isStreaming: s, isOpen: i, duration: r } = Yh();
|
|
5298
5307
|
return /* @__PURE__ */ f(
|
|
@@ -5319,7 +5328,7 @@ const Hh = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
5319
5328
|
}
|
|
5320
5329
|
);
|
|
5321
5330
|
}
|
|
5322
|
-
), fa =
|
|
5331
|
+
), fa = Oe(
|
|
5323
5332
|
({ className: t, children: e, ...n }) => /* @__PURE__ */ f(
|
|
5324
5333
|
_h,
|
|
5325
5334
|
{
|
|
@@ -5355,7 +5364,7 @@ function mf({
|
|
|
5355
5364
|
apiBaseUrl: v = "https://api.arcten.com",
|
|
5356
5365
|
user: b
|
|
5357
5366
|
}) {
|
|
5358
|
-
const [y, T] = I(null), x = ot(null), [
|
|
5367
|
+
const [y, T] = I(null), x = ot(null), [R, A] = I(null), [E, N] = I(null), P = ot(null), [L, X] = I(u), [_, Pt] = I(o), [Dt, pt] = I(600), [at, xt] = I(!1), [k, J] = I(!1), [Y, ct] = I(!1), [K, ye] = I({ x: 100, y: 100 }), [Jt, Ot] = I(!1), [ve, Ft] = I({ x: 0, y: 0 }), [xe, mn] = I(!1), be = ot(null), Qt = ot(null), [jt, we] = I(""), [V, M] = I(null), [F, Q] = I("Thinking..."), [H, ut] = I(/* @__PURE__ */ new Set()), [ma, pa] = I(""), [Bt, ga] = I([]), [pn, Us] = I(!1), [gn, Ws] = I([]), [_s, yn] = I(() => typeof window < "u" ? crypto.randomUUID() : null), [te, ze] = I(!1), [Qh, Ue] = I(!1), [tf, We] = I([]), bt = Z(() => [...c, ...d], [c, d]), Ks = Z(() => ca(bt, h), [bt, h]), Hs = Z(() => new Set(bt.map((m) => m.name)), [bt]), vn = Z(() => Ks.filter((m) => Hs.has(m.name)), [Ks, Hs]), Xs = Z(() => {
|
|
5359
5368
|
const m = /* @__PURE__ */ new Map();
|
|
5360
5369
|
return bt.forEach((w) => m.set(w.name, w)), m;
|
|
5361
5370
|
}, [bt]), Gs = Z(() => new Set(d.map((m) => m.name)), [d]), Ys = [
|
|
@@ -5425,7 +5434,7 @@ function mf({
|
|
|
5425
5434
|
B(() => {
|
|
5426
5435
|
if (typeof window < "u") {
|
|
5427
5436
|
const m = localStorage.getItem("arcten-sidebar-expanded");
|
|
5428
|
-
m &&
|
|
5437
|
+
m && X(JSON.parse(m));
|
|
5429
5438
|
const w = localStorage.getItem("arcten-sidebar-width");
|
|
5430
5439
|
w && Pt(parseInt(w));
|
|
5431
5440
|
const O = localStorage.getItem("arcten-sidebar-height");
|
|
@@ -5441,7 +5450,7 @@ function mf({
|
|
|
5441
5450
|
0,
|
|
5442
5451
|
Math.min(Et.y, window.innerHeight - Tt)
|
|
5443
5452
|
);
|
|
5444
|
-
|
|
5453
|
+
ye({ x: kt, y: st });
|
|
5445
5454
|
}
|
|
5446
5455
|
const j = localStorage.getItem("arcten-sidebar-minimized");
|
|
5447
5456
|
j && ct(JSON.parse(j)), mn(!0);
|
|
@@ -5461,7 +5470,7 @@ function mf({
|
|
|
5461
5470
|
if (!w.ok)
|
|
5462
5471
|
throw new Error("Failed to fetch token");
|
|
5463
5472
|
const O = await w.json();
|
|
5464
|
-
T(O.clientToken), x.current = O.clientToken,
|
|
5473
|
+
T(O.clientToken), x.current = O.clientToken, N(O.expiresAt), A(null);
|
|
5465
5474
|
} catch (w) {
|
|
5466
5475
|
A(w instanceof Error ? w.message : "Failed to fetch token");
|
|
5467
5476
|
}
|
|
@@ -5486,7 +5495,7 @@ function mf({
|
|
|
5486
5495
|
if (!z.ok)
|
|
5487
5496
|
throw new Error("Failed to refresh token");
|
|
5488
5497
|
const j = await z.json();
|
|
5489
|
-
T(j.clientToken), x.current = j.clientToken,
|
|
5498
|
+
T(j.clientToken), x.current = j.clientToken, N(j.expiresAt), A(null), console.log("Token refreshed successfully");
|
|
5490
5499
|
} catch (z) {
|
|
5491
5500
|
console.error("Token refresh failed:", z), A(z instanceof Error ? z.message : "Failed to refresh token");
|
|
5492
5501
|
}
|
|
@@ -5529,7 +5538,7 @@ function mf({
|
|
|
5529
5538
|
}, []);
|
|
5530
5539
|
async function qs() {
|
|
5531
5540
|
if (!(!b?.id || !y)) {
|
|
5532
|
-
|
|
5541
|
+
Ue(!0);
|
|
5533
5542
|
try {
|
|
5534
5543
|
const w = await (await fetch(`${v}/conversations`, {
|
|
5535
5544
|
headers: {
|
|
@@ -5540,7 +5549,7 @@ function mf({
|
|
|
5540
5549
|
} catch (m) {
|
|
5541
5550
|
console.error("Failed to fetch conversations:", m);
|
|
5542
5551
|
} finally {
|
|
5543
|
-
|
|
5552
|
+
Ue(!1);
|
|
5544
5553
|
}
|
|
5545
5554
|
}
|
|
5546
5555
|
}
|
|
@@ -5553,7 +5562,7 @@ function mf({
|
|
|
5553
5562
|
}
|
|
5554
5563
|
function va() {
|
|
5555
5564
|
const m = crypto.randomUUID();
|
|
5556
|
-
yn(m),
|
|
5565
|
+
yn(m), Ke([]), We([]), ze(!1);
|
|
5557
5566
|
}
|
|
5558
5567
|
async function xa(m) {
|
|
5559
5568
|
if (y)
|
|
@@ -5569,7 +5578,7 @@ function mf({
|
|
|
5569
5578
|
}
|
|
5570
5579
|
}
|
|
5571
5580
|
async function ba(m) {
|
|
5572
|
-
yn(m.chatId),
|
|
5581
|
+
yn(m.chatId), ze(!1), Ue(!0);
|
|
5573
5582
|
try {
|
|
5574
5583
|
const w = await fetch(`${v}/conversations/${m.chatId}/messages`, {
|
|
5575
5584
|
headers: {
|
|
@@ -5579,13 +5588,13 @@ function mf({
|
|
|
5579
5588
|
if (!w.ok)
|
|
5580
5589
|
throw new Error(`Failed to fetch messages: ${w.statusText}`);
|
|
5581
5590
|
const S = (await w.json()).messages || [];
|
|
5582
|
-
|
|
5591
|
+
Ke(S), We(S);
|
|
5583
5592
|
} catch (w) {
|
|
5584
5593
|
console.error("Failed to load conversation messages:", w);
|
|
5585
5594
|
const O = m.messages || [];
|
|
5586
|
-
|
|
5595
|
+
Ke(O), We(O);
|
|
5587
5596
|
} finally {
|
|
5588
|
-
|
|
5597
|
+
Ue(!1);
|
|
5589
5598
|
}
|
|
5590
5599
|
}
|
|
5591
5600
|
const wa = async (m, w = {}) => {
|
|
@@ -5594,7 +5603,7 @@ function mf({
|
|
|
5594
5603
|
...w,
|
|
5595
5604
|
headers: O
|
|
5596
5605
|
});
|
|
5597
|
-
}, { messages:
|
|
5606
|
+
}, { messages: Te, sendMessage: Ta, status: wt, error: Zs, stop: _e, addToolResult: Se, setMessages: Ke } = To({
|
|
5598
5607
|
id: _s || void 0,
|
|
5599
5608
|
// Pass AI SDK chat ID
|
|
5600
5609
|
transport: new Ao({
|
|
@@ -5631,35 +5640,35 @@ function mf({
|
|
|
5631
5640
|
});
|
|
5632
5641
|
B(() => {
|
|
5633
5642
|
L && Qt.current && Qt.current.focus();
|
|
5634
|
-
}, [L,
|
|
5643
|
+
}, [L, Te]);
|
|
5635
5644
|
function Sa() {
|
|
5636
|
-
|
|
5645
|
+
X(!0), localStorage.setItem("arcten-sidebar-expanded", "true");
|
|
5637
5646
|
}
|
|
5638
5647
|
function Aa() {
|
|
5639
|
-
|
|
5648
|
+
X(!1), localStorage.setItem("arcten-sidebar-expanded", "false");
|
|
5640
5649
|
}
|
|
5641
5650
|
B(() => {
|
|
5642
5651
|
}, [L]), B(() => {
|
|
5643
|
-
|
|
5644
|
-
}, [
|
|
5652
|
+
be.current && be.current.scrollIntoView({ behavior: "smooth" });
|
|
5653
|
+
}, [Te]), B(() => {
|
|
5645
5654
|
function m(w) {
|
|
5646
|
-
w.key === "Escape" && (wt === "streaming" || wt === "submitted") && (w.preventDefault(),
|
|
5655
|
+
w.key === "Escape" && (wt === "streaming" || wt === "submitted") && (w.preventDefault(), _e());
|
|
5647
5656
|
}
|
|
5648
5657
|
return window.addEventListener("keydown", m), () => window.removeEventListener("keydown", m);
|
|
5649
|
-
}, [wt,
|
|
5658
|
+
}, [wt, _e]);
|
|
5650
5659
|
function Pa() {
|
|
5651
5660
|
const m = crypto.randomUUID();
|
|
5652
|
-
yn(m),
|
|
5661
|
+
yn(m), Ke([]), We([]), ze(!1);
|
|
5653
5662
|
}
|
|
5654
5663
|
function Js(m) {
|
|
5655
5664
|
if (m.preventDefault(), !jt.trim()) return;
|
|
5656
|
-
(wt === "streaming" || wt === "submitted") &&
|
|
5665
|
+
(wt === "streaming" || wt === "submitted") && _e();
|
|
5657
5666
|
const w = Ys[Math.floor(Math.random() * Ys.length)] || "Thinking...";
|
|
5658
|
-
Q(w), Ta({ text: jt }),
|
|
5667
|
+
Q(w), Ta({ text: jt }), we("");
|
|
5659
5668
|
}
|
|
5660
5669
|
function Ca(m) {
|
|
5661
5670
|
const w = m.target.value;
|
|
5662
|
-
|
|
5671
|
+
we(w);
|
|
5663
5672
|
}
|
|
5664
5673
|
B(() => {
|
|
5665
5674
|
if (!at) return;
|
|
@@ -5700,7 +5709,7 @@ function mf({
|
|
|
5700
5709
|
return B(() => {
|
|
5701
5710
|
if (!k) return;
|
|
5702
5711
|
function m() {
|
|
5703
|
-
|
|
5712
|
+
ye((w) => {
|
|
5704
5713
|
const S = window.innerWidth - 50, z = window.innerHeight - 50, j = 50 - _, Et = 0, Tt = Math.max(j, Math.min(w.x, S)), kt = Math.max(Et, Math.min(w.y, z));
|
|
5705
5714
|
if (Tt !== w.x || kt !== w.y) {
|
|
5706
5715
|
const st = { x: Tt, y: kt };
|
|
@@ -5713,8 +5722,8 @@ function mf({
|
|
|
5713
5722
|
}, [k, _]), B(() => {
|
|
5714
5723
|
if (!Jt) return;
|
|
5715
5724
|
function m(O) {
|
|
5716
|
-
const S = O.clientX -
|
|
5717
|
-
|
|
5725
|
+
const S = O.clientX - ve.x, z = O.clientY - ve.y, j = 50, Et = window.innerWidth - j, Tt = window.innerHeight - j, kt = j - _, st = 0, St = Math.max(kt, Math.min(S, Et)), $t = Math.max(st, Math.min(z, Tt));
|
|
5726
|
+
ye({ x: St, y: $t });
|
|
5718
5727
|
}
|
|
5719
5728
|
function w() {
|
|
5720
5729
|
Ot(!1), localStorage.setItem("arcten-sidebar-position", JSON.stringify(K));
|
|
@@ -5722,11 +5731,11 @@ function mf({
|
|
|
5722
5731
|
return window.addEventListener("mousemove", m), window.addEventListener("mouseup", w), () => {
|
|
5723
5732
|
window.removeEventListener("mousemove", m), window.removeEventListener("mouseup", w);
|
|
5724
5733
|
};
|
|
5725
|
-
}, [Jt,
|
|
5734
|
+
}, [Jt, ve, K, _]), xe ? R ? /* @__PURE__ */ f("div", { className: "fixed right-0 top-0 h-screen w-96 flex items-center justify-center p-4 bg-stone-50 dark:bg-stone-900 border-l border-border", children: /* @__PURE__ */ C("div", { className: "p-4 bg-destructive/10 text-destructive text-sm rounded-lg", children: [
|
|
5726
5735
|
"Authentication error: ",
|
|
5727
|
-
|
|
5736
|
+
R
|
|
5728
5737
|
] }) }) : y ? /* @__PURE__ */ f(au, { features: Fh, children: /* @__PURE__ */ f(
|
|
5729
|
-
|
|
5738
|
+
qe,
|
|
5730
5739
|
{
|
|
5731
5740
|
id: "arcten-sidebar",
|
|
5732
5741
|
"data-theme": t,
|
|
@@ -5842,7 +5851,7 @@ function mf({
|
|
|
5842
5851
|
className: et(Kt({ variant: "ghost", size: "icon" }), "h-8 w-8"),
|
|
5843
5852
|
onClick: k ? Qs : Aa,
|
|
5844
5853
|
"aria-label": k ? Y ? "Maximize" : "Minimize" : "Close sidebar",
|
|
5845
|
-
children: k ? Y ? /* @__PURE__ */ f(Ga, { className: "h-4 w-4" }) : /* @__PURE__ */ f(Ya, { className: "h-4 w-4" }) : /* @__PURE__ */ f(
|
|
5854
|
+
children: k ? Y ? /* @__PURE__ */ f(Ga, { className: "h-4 w-4" }) : /* @__PURE__ */ f(Ya, { className: "h-4 w-4" }) : /* @__PURE__ */ f(nn, { className: "h-4 w-4" })
|
|
5846
5855
|
}
|
|
5847
5856
|
) }),
|
|
5848
5857
|
/* @__PURE__ */ f(Wt, { children: k ? Y ? "Maximize window" : "Minimize to header" : "Close the chat" })
|
|
@@ -5856,12 +5865,12 @@ function mf({
|
|
|
5856
5865
|
/* @__PURE__ */ C("div", { className: "flex items-center justify-between px-3 py-1", children: [
|
|
5857
5866
|
/* @__PURE__ */ f("h3", { className: "text-xs font-semibold text-muted-foreground", children: "Recent chats" }),
|
|
5858
5867
|
/* @__PURE__ */ f(
|
|
5859
|
-
|
|
5868
|
+
sn,
|
|
5860
5869
|
{
|
|
5861
5870
|
variant: "ghost",
|
|
5862
5871
|
className: "h-auto px-2 py-1 text-xs text-muted-foreground hover:text-foreground",
|
|
5863
5872
|
onClick: () => {
|
|
5864
|
-
te || qs(),
|
|
5873
|
+
te || qs(), ze(!te);
|
|
5865
5874
|
},
|
|
5866
5875
|
children: te ? "Show less" : "View all"
|
|
5867
5876
|
}
|
|
@@ -5889,13 +5898,13 @@ function mf({
|
|
|
5889
5898
|
w.stopPropagation(), xa(m._id);
|
|
5890
5899
|
},
|
|
5891
5900
|
"aria-label": "Delete conversation",
|
|
5892
|
-
children: /* @__PURE__ */ f(
|
|
5901
|
+
children: /* @__PURE__ */ f(nn, { className: "h-3 w-3" })
|
|
5893
5902
|
}
|
|
5894
5903
|
)
|
|
5895
5904
|
] }, m._id)) })
|
|
5896
5905
|
] }),
|
|
5897
5906
|
/* @__PURE__ */ C("div", { className: "flex-1 flex flex-col overflow-hidden relative", children: [
|
|
5898
|
-
/* @__PURE__ */ f("div", { className: "flex-1 overflow-y-auto p-4 space-y-4 scroll-smooth", children:
|
|
5907
|
+
/* @__PURE__ */ f("div", { className: "flex-1 overflow-y-auto p-4 space-y-4 scroll-smooth", children: Te.length === 0 ? /* @__PURE__ */ C("div", { className: "flex flex-col items-center justify-center h-full", children: [
|
|
5899
5908
|
r && /* @__PURE__ */ f("div", { className: "mb-6", children: r }),
|
|
5900
5909
|
/* @__PURE__ */ f("h3", { className: "text-lg font-semibold text-center mb-2", children: "How can I help you?" }),
|
|
5901
5910
|
Bt.length > 0 && /* @__PURE__ */ f("div", { className: "mt-4 px-4 max-w-md mx-auto", children: /* @__PURE__ */ C("div", { className: "flex flex-wrap gap-2 justify-center", children: [
|
|
@@ -5906,7 +5915,7 @@ function mf({
|
|
|
5906
5915
|
variant: "secondary",
|
|
5907
5916
|
className: "cursor-pointer text-xs px-2 py-1 hover:bg-stone-200 dark:hover:bg-stone-700 transition-colors",
|
|
5908
5917
|
onClick: () => {
|
|
5909
|
-
|
|
5918
|
+
we(m.sampleUsage), Qt.current?.focus();
|
|
5910
5919
|
},
|
|
5911
5920
|
children: m.friendlyName
|
|
5912
5921
|
}
|
|
@@ -5963,7 +5972,7 @@ function mf({
|
|
|
5963
5972
|
)
|
|
5964
5973
|
] }) })
|
|
5965
5974
|
] }) : /* @__PURE__ */ C(ee, { children: [
|
|
5966
|
-
|
|
5975
|
+
Te.map((m) => {
|
|
5967
5976
|
const O = m.parts.filter((S) => S.type === "text").map((S) => S.text).join("");
|
|
5968
5977
|
return /* @__PURE__ */ f(
|
|
5969
5978
|
"div",
|
|
@@ -5987,7 +5996,7 @@ function mf({
|
|
|
5987
5996
|
const j = S.type?.replace("tool-", "") || "", Et = vn.find((st) => st.name === j), Tt = S.state === "input-available", kt = S.state === "output-available";
|
|
5988
5997
|
if (Tt)
|
|
5989
5998
|
return Gs.has(j) ? ((async () => {
|
|
5990
|
-
if (
|
|
5999
|
+
if (H.has(S.toolCallId))
|
|
5991
6000
|
return;
|
|
5992
6001
|
ut(($t) => new Set($t).add(S.toolCallId));
|
|
5993
6002
|
const St = Xs.get(j);
|
|
@@ -5995,20 +6004,20 @@ function mf({
|
|
|
5995
6004
|
try {
|
|
5996
6005
|
console.log("Auto-executing safe tool:", j);
|
|
5997
6006
|
const $t = await St(...Object.values(S.input || {}));
|
|
5998
|
-
|
|
6007
|
+
Se({
|
|
5999
6008
|
toolCallId: S.toolCallId,
|
|
6000
6009
|
tool: j,
|
|
6001
6010
|
output: $t
|
|
6002
6011
|
}), console.log("Safe tool result added:", S.toolCallId);
|
|
6003
6012
|
} catch ($t) {
|
|
6004
|
-
|
|
6013
|
+
Se({
|
|
6005
6014
|
toolCallId: S.toolCallId,
|
|
6006
6015
|
tool: j,
|
|
6007
6016
|
output: `Error: ${$t}`
|
|
6008
6017
|
}), console.log("Safe tool error result added:", S.toolCallId);
|
|
6009
6018
|
}
|
|
6010
6019
|
})(), null) : /* @__PURE__ */ f(
|
|
6011
|
-
|
|
6020
|
+
qe,
|
|
6012
6021
|
{
|
|
6013
6022
|
initial: { opacity: 0, y: 10, filter: "blur(4px)" },
|
|
6014
6023
|
animate: { opacity: 1, y: 0, filter: "blur(0px)" },
|
|
@@ -6020,7 +6029,7 @@ function mf({
|
|
|
6020
6029
|
description: Et?.description || "",
|
|
6021
6030
|
args: S.input || {},
|
|
6022
6031
|
onApprove: async () => {
|
|
6023
|
-
if (
|
|
6032
|
+
if (H.has(S.toolCallId)) {
|
|
6024
6033
|
console.log("Tool call already being processed:", S.toolCallId);
|
|
6025
6034
|
return;
|
|
6026
6035
|
}
|
|
@@ -6029,13 +6038,13 @@ function mf({
|
|
|
6029
6038
|
if (st)
|
|
6030
6039
|
try {
|
|
6031
6040
|
const St = await st(...Object.values(S.input || {}));
|
|
6032
|
-
|
|
6041
|
+
Se({
|
|
6033
6042
|
toolCallId: S.toolCallId,
|
|
6034
6043
|
tool: j,
|
|
6035
6044
|
output: St
|
|
6036
6045
|
}), console.log("Tool result added:", S.toolCallId);
|
|
6037
6046
|
} catch (St) {
|
|
6038
|
-
|
|
6047
|
+
Se({
|
|
6039
6048
|
toolCallId: S.toolCallId,
|
|
6040
6049
|
tool: j,
|
|
6041
6050
|
output: `Error: ${St}`
|
|
@@ -6043,11 +6052,11 @@ function mf({
|
|
|
6043
6052
|
}
|
|
6044
6053
|
},
|
|
6045
6054
|
onDeny: async () => {
|
|
6046
|
-
if (
|
|
6055
|
+
if (H.has(S.toolCallId)) {
|
|
6047
6056
|
console.log("Tool call already being processed:", S.toolCallId);
|
|
6048
6057
|
return;
|
|
6049
6058
|
}
|
|
6050
|
-
ut((st) => new Set(st).add(S.toolCallId)),
|
|
6059
|
+
ut((st) => new Set(st).add(S.toolCallId)), Se({
|
|
6051
6060
|
toolCallId: S.toolCallId,
|
|
6052
6061
|
tool: j,
|
|
6053
6062
|
output: "User denied tool execution"
|
|
@@ -6084,7 +6093,7 @@ function mf({
|
|
|
6084
6093
|
da,
|
|
6085
6094
|
{
|
|
6086
6095
|
className: "w-full",
|
|
6087
|
-
isStreaming: wt === "streaming" && z === m.parts.length - 1 && m.id ===
|
|
6096
|
+
isStreaming: wt === "streaming" && z === m.parts.length - 1 && m.id === Te.at(-1)?.id,
|
|
6088
6097
|
children: [
|
|
6089
6098
|
/* @__PURE__ */ f(ha, {}),
|
|
6090
6099
|
/* @__PURE__ */ f(fa, { children: S.text })
|
|
@@ -6099,7 +6108,7 @@ function mf({
|
|
|
6099
6108
|
m.id
|
|
6100
6109
|
);
|
|
6101
6110
|
}),
|
|
6102
|
-
/* @__PURE__ */ f("div", { ref:
|
|
6111
|
+
/* @__PURE__ */ f("div", { ref: be })
|
|
6103
6112
|
] }) }),
|
|
6104
6113
|
Zs && /* @__PURE__ */ C("div", { className: "px-4 py-2 bg-destructive/10 text-destructive text-xs", children: [
|
|
6105
6114
|
"Error: ",
|
|
@@ -6107,7 +6116,7 @@ function mf({
|
|
|
6107
6116
|
] }),
|
|
6108
6117
|
/* @__PURE__ */ C("div", { className: "p-4 border-t border-border relative overflow-visible", children: [
|
|
6109
6118
|
/* @__PURE__ */ f(ru, { mode: "wait", children: (wt === "streaming" || wt === "submitted") && /* @__PURE__ */ C(
|
|
6110
|
-
|
|
6119
|
+
qe,
|
|
6111
6120
|
{
|
|
6112
6121
|
initial: { opacity: 0, filter: "blur(4px)", y: 5 },
|
|
6113
6122
|
animate: { opacity: 1, filter: "blur(0px)", y: 0 },
|
|
@@ -6119,7 +6128,7 @@ function mf({
|
|
|
6119
6128
|
className: "absolute left-1/2 -translate-x-1/2 -top-6 flex items-center gap-1.5 bg-stone-100 dark:bg-stone-800 px-3 py-1.5 rounded-full shadow-lg border border-border z-50",
|
|
6120
6129
|
children: [
|
|
6121
6130
|
/* @__PURE__ */ f(
|
|
6122
|
-
|
|
6131
|
+
qe,
|
|
6123
6132
|
{
|
|
6124
6133
|
className: "w-2 h-2 bg-stone-400 dark:bg-stone-600",
|
|
6125
6134
|
animate: {
|
|
@@ -6161,7 +6170,7 @@ function mf({
|
|
|
6161
6170
|
{
|
|
6162
6171
|
type: "button",
|
|
6163
6172
|
className: et(Kt({ variant: "ghost", size: "icon" }), "absolute top-1/2 -translate-y-1/2 right-2 h-8 w-8"),
|
|
6164
|
-
onClick:
|
|
6173
|
+
onClick: _e,
|
|
6165
6174
|
children: /* @__PURE__ */ f(qa, { className: "h-4 w-4" })
|
|
6166
6175
|
}
|
|
6167
6176
|
) }),
|
|
@@ -6235,18 +6244,18 @@ function pf({
|
|
|
6235
6244
|
toolsCount: r.length,
|
|
6236
6245
|
safeToolsCount: o.length
|
|
6237
6246
|
});
|
|
6238
|
-
const [g, v] = I(n || null), b = ot(n || null), [y, T] = I(null), [x,
|
|
6247
|
+
const [g, v] = I(n || null), b = ot(n || null), [y, T] = I(null), [x, R] = I(null), A = ot(null), [E, N] = I([]), [P, L] = I(
|
|
6239
6248
|
c || (typeof window < "u" ? crypto.randomUUID() : null)
|
|
6240
|
-
), [
|
|
6249
|
+
), [X, _] = I(!1), [Pt, Dt] = I(/* @__PURE__ */ new Set()), pt = Z(() => [...r, ...o], [r, o]), at = Z(() => ca(pt, a), [pt, a]), xt = Z(() => {
|
|
6241
6250
|
const V = /* @__PURE__ */ new Map();
|
|
6242
6251
|
let M = 0;
|
|
6243
6252
|
return pt.forEach((F) => {
|
|
6244
|
-
const Q = at.find((
|
|
6253
|
+
const Q = at.find((H) => H.name === F.name);
|
|
6245
6254
|
if (Q)
|
|
6246
6255
|
V.set(Q.name, F), M++;
|
|
6247
6256
|
else if (M < at.length) {
|
|
6248
|
-
const
|
|
6249
|
-
V.set(
|
|
6257
|
+
const H = at[M];
|
|
6258
|
+
H && (V.set(H.name, F), M++);
|
|
6250
6259
|
}
|
|
6251
6260
|
}), V;
|
|
6252
6261
|
}, [pt, at]), k = Z(() => new Set(at.map((V) => V.name)), [at]), J = Z(() => at.filter((V) => k.has(V.name)), [at, k]), Y = Z(() => {
|
|
@@ -6289,7 +6298,7 @@ function pf({
|
|
|
6289
6298
|
console.log("[useAgent] Token fetched successfully", {
|
|
6290
6299
|
expiresAt: F.expiresAt,
|
|
6291
6300
|
expiresIn: F.expiresAt ? `${F.expiresAt - Math.floor(Date.now() / 1e3)}s` : "unknown"
|
|
6292
|
-
}), v(F.clientToken), b.current = F.clientToken,
|
|
6301
|
+
}), v(F.clientToken), b.current = F.clientToken, R(F.expiresAt), T(null);
|
|
6293
6302
|
} catch (M) {
|
|
6294
6303
|
console.error("[useAgent] Token fetch failed:", M), T(M instanceof Error ? M.message : "Failed to fetch token");
|
|
6295
6304
|
}
|
|
@@ -6319,7 +6328,7 @@ function pf({
|
|
|
6319
6328
|
}), A.current = setTimeout(async () => {
|
|
6320
6329
|
console.log("[useAgent] Refreshing token...");
|
|
6321
6330
|
try {
|
|
6322
|
-
const
|
|
6331
|
+
const H = await fetch(e, {
|
|
6323
6332
|
method: "POST",
|
|
6324
6333
|
headers: {
|
|
6325
6334
|
"Content-Type": "application/json"
|
|
@@ -6328,15 +6337,15 @@ function pf({
|
|
|
6328
6337
|
user: i
|
|
6329
6338
|
})
|
|
6330
6339
|
});
|
|
6331
|
-
if (!
|
|
6340
|
+
if (!H.ok)
|
|
6332
6341
|
throw new Error("Failed to refresh token");
|
|
6333
|
-
const ut = await
|
|
6342
|
+
const ut = await H.json();
|
|
6334
6343
|
console.log("[useAgent] Token refreshed successfully", {
|
|
6335
6344
|
newExpiresAt: ut.expiresAt,
|
|
6336
6345
|
expiresIn: `${ut.expiresAt - Math.floor(Date.now() / 1e3)}s`
|
|
6337
|
-
}), v(ut.clientToken), b.current = ut.clientToken,
|
|
6338
|
-
} catch (
|
|
6339
|
-
console.error("[useAgent] Token refresh failed:",
|
|
6346
|
+
}), v(ut.clientToken), b.current = ut.clientToken, R(ut.expiresAt), T(null);
|
|
6347
|
+
} catch (H) {
|
|
6348
|
+
console.error("[useAgent] Token refresh failed:", H), T(H instanceof Error ? H.message : "Failed to refresh token");
|
|
6340
6349
|
}
|
|
6341
6350
|
}, Q * 1e3), () => {
|
|
6342
6351
|
console.log("[useAgent] Cleaning up token refresh effect"), A.current && clearTimeout(A.current);
|
|
@@ -6348,7 +6357,7 @@ function pf({
|
|
|
6348
6357
|
...M,
|
|
6349
6358
|
headers: F
|
|
6350
6359
|
});
|
|
6351
|
-
}, { messages: K, sendMessage:
|
|
6360
|
+
}, { messages: K, sendMessage: ye, status: Jt, error: Ot, stop: ve, addToolResult: Ft, setMessages: xe } = To({
|
|
6352
6361
|
id: P || void 0,
|
|
6353
6362
|
messages: u,
|
|
6354
6363
|
transport: new Ao({
|
|
@@ -6385,11 +6394,11 @@ function pf({
|
|
|
6385
6394
|
if (!M.type?.startsWith("tool-") || M.state !== "input-available") return;
|
|
6386
6395
|
const F = M.type.replace("tool-", ""), Q = M.toolCallId;
|
|
6387
6396
|
if (!Pt.has(Q)) {
|
|
6388
|
-
if (Dt((
|
|
6389
|
-
const
|
|
6390
|
-
|
|
6397
|
+
if (Dt((H) => new Set(H).add(Q)), Y.has(F)) {
|
|
6398
|
+
const H = xt.get(F);
|
|
6399
|
+
H && (async () => {
|
|
6391
6400
|
try {
|
|
6392
|
-
const ut = await
|
|
6401
|
+
const ut = await H(...Object.values(M.input || {}));
|
|
6393
6402
|
Ft({
|
|
6394
6403
|
toolCallId: Q,
|
|
6395
6404
|
tool: F,
|
|
@@ -6404,12 +6413,12 @@ function pf({
|
|
|
6404
6413
|
}
|
|
6405
6414
|
})();
|
|
6406
6415
|
} else if (d) {
|
|
6407
|
-
const
|
|
6416
|
+
const H = {
|
|
6408
6417
|
toolCallId: Q,
|
|
6409
6418
|
toolName: F,
|
|
6410
6419
|
args: M.input || {}
|
|
6411
6420
|
};
|
|
6412
|
-
d({ toolCall:
|
|
6421
|
+
d({ toolCall: H });
|
|
6413
6422
|
}
|
|
6414
6423
|
}
|
|
6415
6424
|
});
|
|
@@ -6435,7 +6444,7 @@ function pf({
|
|
|
6435
6444
|
Authorization: `Bearer ${g}`
|
|
6436
6445
|
}
|
|
6437
6446
|
})).json();
|
|
6438
|
-
|
|
6447
|
+
N(M.conversations || []);
|
|
6439
6448
|
} catch (V) {
|
|
6440
6449
|
console.error("Failed to fetch conversations:", V);
|
|
6441
6450
|
} finally {
|
|
@@ -6446,7 +6455,7 @@ function pf({
|
|
|
6446
6455
|
B(() => {
|
|
6447
6456
|
i?.id && g && mn();
|
|
6448
6457
|
}, [JSON.stringify(i), g, t]);
|
|
6449
|
-
async function
|
|
6458
|
+
async function be(V) {
|
|
6450
6459
|
L(V), _(!0);
|
|
6451
6460
|
try {
|
|
6452
6461
|
const M = await fetch(`${t}/conversations/${V}/messages`, {
|
|
@@ -6457,7 +6466,7 @@ function pf({
|
|
|
6457
6466
|
if (!M.ok)
|
|
6458
6467
|
throw new Error(`Failed to fetch messages: ${M.statusText}`);
|
|
6459
6468
|
const Q = (await M.json()).messages || [];
|
|
6460
|
-
|
|
6469
|
+
xe(Q);
|
|
6461
6470
|
} catch (M) {
|
|
6462
6471
|
console.error("Failed to load conversation messages:", M);
|
|
6463
6472
|
} finally {
|
|
@@ -6472,16 +6481,16 @@ function pf({
|
|
|
6472
6481
|
headers: {
|
|
6473
6482
|
Authorization: `Bearer ${g}`
|
|
6474
6483
|
}
|
|
6475
|
-
}),
|
|
6484
|
+
}), N(E.filter((M) => M._id !== V)), V === P && jt();
|
|
6476
6485
|
} catch (M) {
|
|
6477
6486
|
console.error("Failed to delete conversation:", M);
|
|
6478
6487
|
}
|
|
6479
6488
|
}
|
|
6480
6489
|
function jt() {
|
|
6481
6490
|
const V = crypto.randomUUID();
|
|
6482
|
-
L(V),
|
|
6491
|
+
L(V), xe([]), Dt(/* @__PURE__ */ new Set());
|
|
6483
6492
|
}
|
|
6484
|
-
function
|
|
6493
|
+
function we(V) {
|
|
6485
6494
|
Ft(V);
|
|
6486
6495
|
}
|
|
6487
6496
|
return {
|
|
@@ -6489,21 +6498,21 @@ function pf({
|
|
|
6489
6498
|
messages: K,
|
|
6490
6499
|
status: Jt,
|
|
6491
6500
|
error: Ot,
|
|
6492
|
-
sendMessage:
|
|
6493
|
-
stop:
|
|
6494
|
-
addToolOutput:
|
|
6495
|
-
setMessages:
|
|
6501
|
+
sendMessage: ye,
|
|
6502
|
+
stop: ve,
|
|
6503
|
+
addToolOutput: we,
|
|
6504
|
+
setMessages: xe,
|
|
6496
6505
|
conversations: E,
|
|
6497
|
-
loadConversation:
|
|
6506
|
+
loadConversation: be,
|
|
6498
6507
|
deleteConversation: Qt,
|
|
6499
6508
|
startNewConversation: jt,
|
|
6500
|
-
isLoadingConversations:
|
|
6509
|
+
isLoadingConversations: X,
|
|
6501
6510
|
clientToken: g,
|
|
6502
6511
|
tokenError: y
|
|
6503
6512
|
};
|
|
6504
6513
|
}
|
|
6505
6514
|
export {
|
|
6506
|
-
|
|
6515
|
+
le as ARCTEN_ORIGINAL_NAME,
|
|
6507
6516
|
mf as ArctenAgent,
|
|
6508
6517
|
ff as preserveToolName,
|
|
6509
6518
|
pf as useAgent,
|