@voltro/client 0.71.0 → 0.71.1
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/CHANGELOG.md +52 -0
- package/dist/index.js +321 -321
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { A as e, C as t, D as n, E as r, O as i, S as a, T as o, _ as s, a as c, b as l, c as u, d, f, g as p, h as m, i as h, k as g, l as _, m as v, n as y, o as b, p as x, r as S, s as C, t as w, u as T, v as E, w as D, x as ee, y as O } from "./authRefresh-8OXBP96t.js";
|
|
2
|
-
import { C as k, S as A, _ as j, a as te, b as ne, c as re, d as ie, f as ae, g as oe, h as se, i as
|
|
3
|
-
import { createContext as
|
|
2
|
+
import { C as k, S as A, _ as j, a as te, b as ne, c as re, d as ie, f as ae, g as oe, h as se, i as ce, l as le, m as ue, n as de, o as fe, p as pe, r as me, s as he, t as ge, u as _e, v as M, w as ve, x as ye, y as be } from "./formData-dGz5aoUR.js";
|
|
3
|
+
import { createContext as N, createElement as P, useCallback as F, useContext as I, useDebugValue as xe, useEffect as L, useId as Se, useMemo as R, useRef as z, useState as B, useSyncExternalStore as V } from "react";
|
|
4
4
|
import { Cause as H, Duration as Ce, Effect as U, Exit as we, Fiber as Te, Option as Ee, Schedule as De, Schema as Oe, Stream as W } from "effect";
|
|
5
5
|
import * as ke from "@effect/platform/Headers";
|
|
6
6
|
import { RpcClient as Ae } from "@effect/rpc";
|
|
@@ -10,7 +10,7 @@ import { FormApi as Pe } from "@tanstack/form-core";
|
|
|
10
10
|
import { useStore as Fe } from "@tanstack/react-store";
|
|
11
11
|
import { ArrayFormatter as Ie } from "effect/ParseResult";
|
|
12
12
|
//#region src/runtimeContext.ts
|
|
13
|
-
var Le =
|
|
13
|
+
var Le = N(null), Re = () => {
|
|
14
14
|
throw Error("Voltro: rpc / cache calls are not invokable on a not-yet-resolved api — either during SSR, or in the client boot window before the api client resolves");
|
|
15
15
|
}, ze = new Proxy(() => Re(), {
|
|
16
16
|
get: (e, t) => ze,
|
|
@@ -40,7 +40,7 @@ var Le = P(null), Re = () => {
|
|
|
40
40
|
}, Je = !1, Ye = !1, G = null, Xe = () => {
|
|
41
41
|
Je = !1, Ye = !1, G !== null && (clearTimeout(G), G = null);
|
|
42
42
|
}, Ze = () => {
|
|
43
|
-
let e =
|
|
43
|
+
let e = I(Le);
|
|
44
44
|
return e ? (Ye || (Ye = !0, G !== null && (clearTimeout(G), G = null)), e) : (globalThis.window !== void 0 && !Je && !Ye && G === null && process.env.NODE_ENV !== "production" && (G = setTimeout(() => {
|
|
45
45
|
G = null, !(Je || Ye) && (Je = !0, console.warn("useFrameworkRuntimes: no <FrameworkRuntimesProvider> in the tree — returning a loading baseline (subscriptions read `undefined`, mutations are no-ops). If this is not an intentional lazy/conditional mount, mount your app via @voltro/web mount() or wrap the subtree in <VoltroRuntimeProvider>."));
|
|
46
46
|
}, 0)), qe);
|
|
@@ -279,7 +279,7 @@ var Nt = () => {
|
|
|
279
279
|
state: void 0,
|
|
280
280
|
value: void 0,
|
|
281
281
|
has: !1
|
|
282
|
-
}), s =
|
|
282
|
+
}), s = F((t) => {
|
|
283
283
|
let n = o.current;
|
|
284
284
|
if (n.has && Object.is(n.state, t)) return n.value;
|
|
285
285
|
let r = i.current(t), s = a.current, c = n.has && (s ? s(n.value, r) : Object.is(n.value, r));
|
|
@@ -296,7 +296,7 @@ var Nt = () => {
|
|
|
296
296
|
value: l,
|
|
297
297
|
has: !0
|
|
298
298
|
}, l;
|
|
299
|
-
}, []), c = n?.key, l = n?.retain === !0, u =
|
|
299
|
+
}, []), c = n?.key, l = n?.retain === !0, u = F((e) => {
|
|
300
300
|
let t = r.subscribe(e);
|
|
301
301
|
return c !== void 0 && !l && v(c), () => {
|
|
302
302
|
t(), c !== void 0 && !l && y(c);
|
|
@@ -305,7 +305,7 @@ var Nt = () => {
|
|
|
305
305
|
r,
|
|
306
306
|
c,
|
|
307
307
|
l
|
|
308
|
-
]), p =
|
|
308
|
+
]), p = F(() => s(r.get()), [r, s]), m = F(() => s(ft(e, n?.key, n?.key === void 0 && f !== void 0 ? f : r.get())), [
|
|
309
309
|
r,
|
|
310
310
|
n?.key,
|
|
311
311
|
s
|
|
@@ -389,13 +389,13 @@ function q(e, t, n = {}, r = {}) {
|
|
|
389
389
|
queryKey: [t, e],
|
|
390
390
|
fetch: () => h(d.current, t)(e)
|
|
391
391
|
};
|
|
392
|
-
}, [t, f]), m = p.queryKey, g =
|
|
392
|
+
}, [t, f]), m = p.queryKey, g = F((e) => i ? () => {} : o.subscribe(p.queryKey, p.fetch, a, e, l === void 0 ? {} : { source: l }).unsubscribe, [
|
|
393
393
|
o,
|
|
394
394
|
a,
|
|
395
395
|
l,
|
|
396
396
|
i,
|
|
397
397
|
p
|
|
398
|
-
]), _ =
|
|
398
|
+
]), _ = F(() => i ? Vt : o.peek(m), [
|
|
399
399
|
o,
|
|
400
400
|
i,
|
|
401
401
|
m
|
|
@@ -589,7 +589,7 @@ var Ut = 15e3, J = async (e, t, n) => {
|
|
|
589
589
|
let n = o?.kind;
|
|
590
590
|
n !== void 0 && n !== "mutation" && console.error(`[@voltro/client] useMutation('${e}', '${t}') targets a ${n}, not a mutation. Use ${n === "action" ? "useAction" : n === "workflow" ? "useWorkflow" : `the ${n} hook`} instead.`);
|
|
591
591
|
}
|
|
592
|
-
let [c, l] = B(!1), [f, p] = B(void 0), [m, _] = B(void 0), v = z(null), y = z(!1), b = z(0), x =
|
|
592
|
+
let [c, l] = B(!1), [f, p] = B(void 0), [m, _] = B(void 0), v = z(null), y = z(!1), b = z(0), x = F(async (n, r) => {
|
|
593
593
|
let o = r?.onError !== void 0 || r?.notify?.error !== void 0, c = (e) => {
|
|
594
594
|
r?.onError?.(e, n);
|
|
595
595
|
let t = _n(r?.notify?.error, e, n);
|
|
@@ -771,7 +771,7 @@ var Ut = 15e3, J = async (e, t, n) => {
|
|
|
771
771
|
let n = r[t]?.kind;
|
|
772
772
|
n !== void 0 && n !== "action" && console.error(`[@voltro/client] useAction('${e}', '${t}') targets a ${n}, not an action. Use ${n === "mutation" ? "useMutation" : n === "workflow" ? "useWorkflow" : `the ${n} hook`} instead.`);
|
|
773
773
|
}
|
|
774
|
-
let [o, s] = B(!1), [c, l] = B(void 0), [u, d] = B(void 0), f =
|
|
774
|
+
let [o, s] = B(!1), [c, l] = B(void 0), [u, d] = B(void 0), f = F(async (n, r) => {
|
|
775
775
|
let o = r?.onError !== void 0 || r?.notify?.error !== void 0;
|
|
776
776
|
s(!0), l(void 0);
|
|
777
777
|
let c = Tn(), u = r?.idempotencyKey ?? sn();
|
|
@@ -840,7 +840,7 @@ var Ut = 15e3, J = async (e, t, n) => {
|
|
|
840
840
|
c,
|
|
841
841
|
u
|
|
842
842
|
]);
|
|
843
|
-
}, Dn =
|
|
843
|
+
}, Dn = N(void 0), On = (e) => P(Dn.Provider, { value: e.messages }, e.children), kn = () => I(Dn), An = Symbol.for("voltro.client.formEngine"), jn = N(void 0), Mn = (e, t) => {
|
|
844
844
|
let n = e;
|
|
845
845
|
for (let e of t.split(".")) {
|
|
846
846
|
if (typeof n != "object" || !n) return;
|
|
@@ -871,7 +871,7 @@ var Ut = 15e3, J = async (e, t, n) => {
|
|
|
871
871
|
onSubmit: async ({ input: t }) => e.onSubmit(await Oe.decodeUnknownPromise(e.schema)(t))
|
|
872
872
|
}, e.schema, t);
|
|
873
873
|
}, Rn = (e, t, n, r, i, a) => {
|
|
874
|
-
let o = R(() => r ?
|
|
874
|
+
let o = R(() => r ? ve(r) : [], [r]), s = kn(), c = n.messages ?? s, l = R(() => ({
|
|
875
875
|
...n.locale === void 0 ? {} : { locale: n.locale },
|
|
876
876
|
...c === void 0 ? {} : { messages: c }
|
|
877
877
|
}), [n.locale, c]), u = z(n.asyncFields);
|
|
@@ -884,7 +884,7 @@ var Ut = 15e3, J = async (e, t, n) => {
|
|
|
884
884
|
p.current = l;
|
|
885
885
|
let m = z(r);
|
|
886
886
|
m.current = r;
|
|
887
|
-
let [h, g] = B(() => n.flash?.errors ?? {}), [_, v] = B(n.flash?.formError), [y, b] = B(void 0), x = z(void 0), S = z(!1), C =
|
|
887
|
+
let [h, g] = B(() => n.flash?.errors ?? {}), [_, v] = B(n.flash?.formError), [y, b] = B(void 0), x = z(void 0), S = z(!1), C = F((e) => {
|
|
888
888
|
let t = m.current;
|
|
889
889
|
if (t === void 0) return [];
|
|
890
890
|
let n = d.current, r = e;
|
|
@@ -903,9 +903,9 @@ var Ut = 15e3, J = async (e, t, n) => {
|
|
|
903
903
|
path: n
|
|
904
904
|
};
|
|
905
905
|
});
|
|
906
|
-
}, []), w =
|
|
906
|
+
}, []), w = F((e) => {
|
|
907
907
|
let t = { ...e ?? {} }, n = m.current;
|
|
908
|
-
if (n !== void 0) for (let e of
|
|
908
|
+
if (n !== void 0) for (let e of ve(n)) (e.widget === "checkbox" || e.widget === "switch") && !(e.name in t) && (t[e.name] = !1);
|
|
909
909
|
return t;
|
|
910
910
|
}, []), T = z(() => Promise.resolve());
|
|
911
911
|
if (i.current === void 0) {
|
|
@@ -920,7 +920,7 @@ var Ut = 15e3, J = async (e, t, n) => {
|
|
|
920
920
|
let t = C(e);
|
|
921
921
|
if (t.length === 0) return;
|
|
922
922
|
let n = {};
|
|
923
|
-
for (let e of t) e.path !== "" && !(e.path in n) && (n[e.path] =
|
|
923
|
+
for (let e of t) e.path !== "" && !(e.path in n) && (n[e.path] = M(e, p.current));
|
|
924
924
|
return { fields: n };
|
|
925
925
|
} }
|
|
926
926
|
});
|
|
@@ -929,7 +929,7 @@ var Ut = 15e3, J = async (e, t, n) => {
|
|
|
929
929
|
L(() => D.mount(), [D]);
|
|
930
930
|
let ee = n.subscribe ?? "all";
|
|
931
931
|
Fe(E.store, (e) => ee === "all" ? e : `${e.submissionAttempts}|${String(e.isSubmitting)}|${String(e.isDirty)}|${String(e.isTouched)}`);
|
|
932
|
-
let O = E.store.state.values, k = E.store.state, A = R(() => C(O), [C, O]), j = n.isLoading === !0, te = n.validate, re = te?.onChange ?? "afterTouched", ie = te?.onBlur ?? !0, ae = k.submissionAttempts, oe = k.fieldMetaBase ?? {}, se =
|
|
932
|
+
let O = E.store.state.values, k = E.store.state, A = R(() => C(O), [C, O]), j = n.isLoading === !0, te = n.validate, re = te?.onChange ?? "afterTouched", ie = te?.onBlur ?? !0, ae = k.submissionAttempts, oe = k.fieldMetaBase ?? {}, se = F((e) => {
|
|
933
933
|
if (j) return !1;
|
|
934
934
|
if (ae > 0 || re === "always") return !0;
|
|
935
935
|
if (re === "never") return !1;
|
|
@@ -941,45 +941,45 @@ var Ut = 15e3, J = async (e, t, n) => {
|
|
|
941
941
|
j,
|
|
942
942
|
re,
|
|
943
943
|
ie
|
|
944
|
-
]),
|
|
944
|
+
]), ce = F((e) => {
|
|
945
945
|
let t = h[e];
|
|
946
946
|
if (t !== void 0) return t;
|
|
947
947
|
let n = u.current?.[e];
|
|
948
|
-
if (n !== void 0 && n.status === "invalid") return n.message ??
|
|
948
|
+
if (n !== void 0 && n.status === "invalid") return n.message ?? M({
|
|
949
949
|
id: "validation.invalid",
|
|
950
950
|
fallback: "Invalid value"
|
|
951
951
|
}, p.current);
|
|
952
952
|
if (!se(e)) return;
|
|
953
953
|
let r = A.find((t) => t.path === e);
|
|
954
|
-
return r === void 0 ? void 0 :
|
|
954
|
+
return r === void 0 ? void 0 : M(r, p.current);
|
|
955
955
|
}, [
|
|
956
956
|
h,
|
|
957
957
|
se,
|
|
958
958
|
A
|
|
959
|
-
]),
|
|
959
|
+
]), le = R(() => {
|
|
960
960
|
let e = {}, t = /* @__PURE__ */ new Set([...A.map((e) => e.path).filter((e) => e !== ""), ...Object.keys(h)]);
|
|
961
961
|
for (let [e, n] of Object.entries(u.current ?? {})) n.status === "invalid" && t.add(e);
|
|
962
962
|
for (let n of t) {
|
|
963
|
-
let t =
|
|
963
|
+
let t = ce(n);
|
|
964
964
|
t !== void 0 && (e[n] = t);
|
|
965
965
|
}
|
|
966
966
|
return e;
|
|
967
967
|
}, [
|
|
968
968
|
A,
|
|
969
969
|
h,
|
|
970
|
-
|
|
971
|
-
]),
|
|
970
|
+
ce
|
|
971
|
+
]), ue = F((e) => {
|
|
972
972
|
g((t) => {
|
|
973
973
|
if (!(e in t)) return t;
|
|
974
974
|
let n = { ...t };
|
|
975
975
|
return delete n[e], n;
|
|
976
976
|
});
|
|
977
|
-
}, []),
|
|
978
|
-
let r = Fn(o, n), i = D.getFieldMeta(n), a =
|
|
977
|
+
}, []), de = F((n) => {
|
|
978
|
+
let r = Fn(o, n), i = D.getFieldMeta(n), a = ce(n), s = Nn(e, t, n), c = u.current?.[n], l = [a === void 0 ? void 0 : `${s}-error`, r?.description === void 0 ? void 0 : `${s}-help`].filter((e) => e !== void 0);
|
|
979
979
|
return {
|
|
980
980
|
value: D.getFieldValue(n),
|
|
981
981
|
setValue: (e) => {
|
|
982
|
-
|
|
982
|
+
ue(n), !Object.is(D.getFieldValue(n), e) && D.setFieldValue(n, e);
|
|
983
983
|
},
|
|
984
984
|
onBlur: () => {
|
|
985
985
|
D.setFieldMeta(n, (e) => ({
|
|
@@ -1010,12 +1010,12 @@ var Ut = 15e3, J = async (e, t, n) => {
|
|
|
1010
1010
|
}, [
|
|
1011
1011
|
e,
|
|
1012
1012
|
t,
|
|
1013
|
-
|
|
1013
|
+
ue,
|
|
1014
1014
|
D,
|
|
1015
1015
|
o,
|
|
1016
1016
|
h,
|
|
1017
|
-
|
|
1018
|
-
]),
|
|
1017
|
+
ce
|
|
1018
|
+
]), fe = F((e) => ({
|
|
1019
1019
|
items: D.getFieldValue(e) ?? [],
|
|
1020
1020
|
push: (t) => {
|
|
1021
1021
|
D.pushFieldValue(e, t);
|
|
@@ -1032,14 +1032,14 @@ var Ut = 15e3, J = async (e, t, n) => {
|
|
|
1032
1032
|
swap: (t, n) => {
|
|
1033
1033
|
D.swapFieldValues(e, t, n);
|
|
1034
1034
|
},
|
|
1035
|
-
field: (t, n) =>
|
|
1036
|
-
}), [D,
|
|
1037
|
-
|
|
1038
|
-
}, [
|
|
1035
|
+
field: (t, n) => de(`${e}.${t}.${n}`)
|
|
1036
|
+
}), [D, de]), pe = F((e) => o.filter((t) => t.section === e), [o]), me = F((e, t) => {
|
|
1037
|
+
ue(e), !Object.is(D.getFieldValue(e), t) && D.setFieldValue(e, t);
|
|
1038
|
+
}, [ue, D]), he = F((e) => {
|
|
1039
1039
|
for (let [t, n] of Object.entries(e)) D.setFieldValue(t, n);
|
|
1040
|
-
}, [D]),
|
|
1040
|
+
}, [D]), ge = F((e) => {
|
|
1041
1041
|
g({}), v(void 0), b(void 0), x.current = void 0, S.current = !1, e === void 0 ? D.reset() : D.reset(w(e));
|
|
1042
|
-
}, [D, w]),
|
|
1042
|
+
}, [D, w]), _e = n.asyncTimeoutMs ?? 5e3, ye = F(async () => {
|
|
1043
1043
|
let e = Date.now();
|
|
1044
1044
|
for (;;) {
|
|
1045
1045
|
let t = u.current;
|
|
@@ -1047,22 +1047,22 @@ var Ut = 15e3, J = async (e, t, n) => {
|
|
|
1047
1047
|
let n = Object.entries(t), r = n.filter(([, e]) => e.status === "checking");
|
|
1048
1048
|
if (r.length === 0) {
|
|
1049
1049
|
let e = n.filter(([, e]) => e.status === "invalid");
|
|
1050
|
-
return e.length === 0 ? void 0 : Object.fromEntries(e.map(([e, t]) => [e, t.message ??
|
|
1050
|
+
return e.length === 0 ? void 0 : Object.fromEntries(e.map(([e, t]) => [e, t.message ?? M({
|
|
1051
1051
|
id: "validation.invalid",
|
|
1052
1052
|
fallback: "Invalid value"
|
|
1053
1053
|
}, p.current)]));
|
|
1054
1054
|
}
|
|
1055
|
-
if (Date.now() - e >
|
|
1055
|
+
if (Date.now() - e > _e) return Object.fromEntries(r.map(([e]) => [e, M({
|
|
1056
1056
|
id: "validation.checking",
|
|
1057
1057
|
fallback: "Still checking…"
|
|
1058
1058
|
}, p.current)]));
|
|
1059
1059
|
await new Promise((e) => setTimeout(e, 50));
|
|
1060
1060
|
}
|
|
1061
|
-
}, [
|
|
1061
|
+
}, [_e]), N = F(() => {
|
|
1062
1062
|
let n = globalThis.document;
|
|
1063
1063
|
if (n?.getElementById === void 0) return;
|
|
1064
1064
|
let r = [...o.map((e) => e.name), ...Object.keys(h).filter((e) => !o.some((t) => t.name === e))];
|
|
1065
|
-
for (let i of r) if (
|
|
1065
|
+
for (let i of r) if (ce(i) !== void 0) {
|
|
1066
1066
|
n.getElementById(Nn(e, t, i))?.focus?.();
|
|
1067
1067
|
return;
|
|
1068
1068
|
}
|
|
@@ -1071,17 +1071,17 @@ var Ut = 15e3, J = async (e, t, n) => {
|
|
|
1071
1071
|
t,
|
|
1072
1072
|
o,
|
|
1073
1073
|
h,
|
|
1074
|
-
|
|
1075
|
-
]),
|
|
1076
|
-
|
|
1077
|
-
let
|
|
1074
|
+
ce
|
|
1075
|
+
]), P = z(N);
|
|
1076
|
+
P.current = N;
|
|
1077
|
+
let I = F(async () => {
|
|
1078
1078
|
v(void 0), g({}), b(void 0), x.current = void 0, S.current = !1;
|
|
1079
1079
|
let e, t = !1;
|
|
1080
1080
|
if (await D.handleSubmit().catch((n) => {
|
|
1081
1081
|
t = !0, e = n;
|
|
1082
1082
|
}), t) throw e;
|
|
1083
1083
|
return S.current || queueMicrotask(() => {
|
|
1084
|
-
|
|
1084
|
+
P.current();
|
|
1085
1085
|
}), x.current;
|
|
1086
1086
|
}, [D]);
|
|
1087
1087
|
T.current = (async (e) => {
|
|
@@ -1094,22 +1094,22 @@ var Ut = 15e3, J = async (e, t, n) => {
|
|
|
1094
1094
|
}
|
|
1095
1095
|
if (C(n).length > 0) {
|
|
1096
1096
|
queueMicrotask(() => {
|
|
1097
|
-
|
|
1097
|
+
P.current();
|
|
1098
1098
|
});
|
|
1099
1099
|
return;
|
|
1100
1100
|
}
|
|
1101
1101
|
let i = m.current;
|
|
1102
1102
|
if (i !== void 0) {
|
|
1103
|
-
let e =
|
|
1103
|
+
let e = be(i, r);
|
|
1104
1104
|
e.dropped.length > 0 && process.env.NODE_ENV !== "production" && console.warn(`[@voltro/client] useFormBinding: dropped ${e.dropped.length} value(s) the mutation's input does not declare (${e.dropped.join(", ")}). The server refuses undeclared fields, so they are not sent. Map them with \`toInput\` if they belong in the write; ignore this if they are form-only state.`), r = e.input;
|
|
1105
1105
|
}
|
|
1106
|
-
let a = await
|
|
1106
|
+
let a = await ye();
|
|
1107
1107
|
if (a !== void 0) {
|
|
1108
1108
|
g((e) => ({
|
|
1109
1109
|
...e,
|
|
1110
1110
|
...a
|
|
1111
1111
|
})), queueMicrotask(() => {
|
|
1112
|
-
|
|
1112
|
+
P.current();
|
|
1113
1113
|
});
|
|
1114
1114
|
return;
|
|
1115
1115
|
}
|
|
@@ -1131,7 +1131,7 @@ var Ut = 15e3, J = async (e, t, n) => {
|
|
|
1131
1131
|
return;
|
|
1132
1132
|
}
|
|
1133
1133
|
let n = {};
|
|
1134
|
-
for (let e of t) e.field in n || (n[e.field] =
|
|
1134
|
+
for (let e of t) e.field in n || (n[e.field] = M({
|
|
1135
1135
|
id: e.message,
|
|
1136
1136
|
...e.params === void 0 ? {} : { params: e.params },
|
|
1137
1137
|
fallback: e.message
|
|
@@ -1140,13 +1140,13 @@ var Ut = 15e3, J = async (e, t, n) => {
|
|
|
1140
1140
|
...e,
|
|
1141
1141
|
...n
|
|
1142
1142
|
})), queueMicrotask(() => {
|
|
1143
|
-
|
|
1143
|
+
P.current();
|
|
1144
1144
|
});
|
|
1145
1145
|
}
|
|
1146
1146
|
});
|
|
1147
|
-
let xe = A.length === 0, Se = Object.values(u.current ?? {}).some((e) => e.status === "checking"), V = y ?? a?.error, H = V !== void 0 && je(V).length > 0 ? void 0 : V, Ce = Object.keys(
|
|
1148
|
-
for (let e of o) if (
|
|
1149
|
-
let e = Object.keys(
|
|
1147
|
+
let xe = A.length === 0, Se = Object.values(u.current ?? {}).some((e) => e.status === "checking"), V = y ?? a?.error, H = V !== void 0 && je(V).length > 0 ? void 0 : V, Ce = Object.keys(le).length, U = (() => {
|
|
1148
|
+
for (let e of o) if (le[e.name] !== void 0) return e.name;
|
|
1149
|
+
let e = Object.keys(le);
|
|
1150
1150
|
return e.length > 0 ? e[0] : void 0;
|
|
1151
1151
|
})(), we = {
|
|
1152
1152
|
isDirty: !j && k.isDirty,
|
|
@@ -1168,33 +1168,33 @@ var Ut = 15e3, J = async (e, t, n) => {
|
|
|
1168
1168
|
}, Te = {
|
|
1169
1169
|
fields: o,
|
|
1170
1170
|
values: O,
|
|
1171
|
-
errors:
|
|
1171
|
+
errors: le,
|
|
1172
1172
|
issues: A,
|
|
1173
1173
|
isValid: xe,
|
|
1174
1174
|
pending: a?.pending ?? k.isSubmitting,
|
|
1175
1175
|
submitError: H,
|
|
1176
1176
|
formError: _,
|
|
1177
1177
|
data: a?.data ?? x.current,
|
|
1178
|
-
setValue:
|
|
1179
|
-
setValues:
|
|
1180
|
-
reset:
|
|
1181
|
-
submit:
|
|
1182
|
-
field:
|
|
1183
|
-
array:
|
|
1184
|
-
section:
|
|
1178
|
+
setValue: me,
|
|
1179
|
+
setValues: he,
|
|
1180
|
+
reset: ge,
|
|
1181
|
+
submit: I,
|
|
1182
|
+
field: de,
|
|
1183
|
+
array: fe,
|
|
1184
|
+
section: pe,
|
|
1185
1185
|
state: we,
|
|
1186
|
-
focusFirstInvalid:
|
|
1186
|
+
focusFirstInvalid: N
|
|
1187
1187
|
};
|
|
1188
1188
|
return Object.defineProperty(Te, An, {
|
|
1189
1189
|
value: {
|
|
1190
1190
|
store: E.store,
|
|
1191
|
-
field:
|
|
1191
|
+
field: de
|
|
1192
1192
|
},
|
|
1193
1193
|
enumerable: !1
|
|
1194
1194
|
}), Te;
|
|
1195
|
-
}, zn = (e) =>
|
|
1195
|
+
}, zn = (e) => P(jn.Provider, { value: e.binding }, e.children), Bn = () => I(jn);
|
|
1196
1196
|
function Vn(e, t) {
|
|
1197
|
-
let n =
|
|
1197
|
+
let n = I(jn), r = typeof e == "string" ? void 0 : e, i = typeof e == "string" ? e : t, a = r ?? n;
|
|
1198
1198
|
if (a === void 0) throw Error("useFormField(path) found no form binding — mount <FormBindingProvider binding={form}> above this field, or call useFormField(form, path) with the binding in hand.");
|
|
1199
1199
|
let o = a[An];
|
|
1200
1200
|
if (o === void 0) throw Error("useFormField: not a useFormBinding result");
|
|
@@ -1205,13 +1205,13 @@ function Vn(e, t) {
|
|
|
1205
1205
|
}
|
|
1206
1206
|
//#endregion
|
|
1207
1207
|
//#region src/connectionPrerequisite.ts
|
|
1208
|
-
var Z = class extends Error {
|
|
1208
|
+
var Hn = "voltro:connection-setup-superseded", Un = (e) => e.reason === "voltro:connection-setup-superseded" ? "superseded" : "inactive", Z = class extends Error {
|
|
1209
1209
|
reason;
|
|
1210
1210
|
_tag = "ConnectionPrerequisiteInvalidated";
|
|
1211
1211
|
constructor(e) {
|
|
1212
1212
|
super(`Voltro connection prerequisite: ${e}`), this.reason = e, n(this, e === "connection-unavailable" || e === "connection-changed" ? "transport" : "client");
|
|
1213
1213
|
}
|
|
1214
|
-
},
|
|
1214
|
+
}, Wn = class {
|
|
1215
1215
|
#e;
|
|
1216
1216
|
#t;
|
|
1217
1217
|
#n = /* @__PURE__ */ new WeakMap();
|
|
@@ -1222,7 +1222,7 @@ var Z = class extends Error {
|
|
|
1222
1222
|
}
|
|
1223
1223
|
prepare(e, t) {
|
|
1224
1224
|
let n = u(e)?.getSnapshot();
|
|
1225
|
-
if (this.#e.aborted) return Promise.reject(new Z(
|
|
1225
|
+
if (this.#e.aborted) return Promise.reject(new Z(Un(this.#e)));
|
|
1226
1226
|
if (n === void 0) return Promise.reject(new Z("connection-unavailable"));
|
|
1227
1227
|
let r = this.#n.get(n);
|
|
1228
1228
|
if (r !== void 0) return r.then((t) => (this.assertCurrent(e, t), t));
|
|
@@ -1241,11 +1241,11 @@ var Z = class extends Error {
|
|
|
1241
1241
|
}), a;
|
|
1242
1242
|
}
|
|
1243
1243
|
assertCurrent(e, t) {
|
|
1244
|
-
if (!this.#r.has(t)) throw new Z(
|
|
1244
|
+
if (!this.#r.has(t)) throw new Z(Un(this.#e));
|
|
1245
1245
|
this.#i(e, t.lease);
|
|
1246
1246
|
}
|
|
1247
1247
|
#i(e, t) {
|
|
1248
|
-
if (this.#e.aborted) throw new Z(
|
|
1248
|
+
if (this.#e.aborted) throw new Z(Un(this.#e));
|
|
1249
1249
|
if (t.signal.aborted || u(e)?.getSnapshot() !== t) throw new Z("connection-changed");
|
|
1250
1250
|
}
|
|
1251
1251
|
run(e, t, n) {
|
|
@@ -1260,14 +1260,14 @@ var Z = class extends Error {
|
|
|
1260
1260
|
try: () => this.#i(e, t),
|
|
1261
1261
|
catch: (e) => e
|
|
1262
1262
|
}), i = U.async((e) => {
|
|
1263
|
-
let n = () => e(U.fail(new Z(this.#e.aborted ?
|
|
1263
|
+
let n = () => e(U.fail(new Z(this.#e.aborted ? Un(this.#e) : "connection-changed")));
|
|
1264
1264
|
return this.#e.addEventListener("abort", n, { once: !0 }), t.signal.addEventListener("abort", n, { once: !0 }), (this.#e.aborted || t.signal.aborted) && n(), U.sync(() => {
|
|
1265
1265
|
this.#e.removeEventListener("abort", n), t.signal.removeEventListener("abort", n);
|
|
1266
1266
|
});
|
|
1267
1267
|
});
|
|
1268
1268
|
return r.pipe(U.zipRight(n), U.tap(() => r), U.raceFirst(i));
|
|
1269
1269
|
}
|
|
1270
|
-
},
|
|
1270
|
+
}, Gn = class {
|
|
1271
1271
|
#e;
|
|
1272
1272
|
#t;
|
|
1273
1273
|
#n;
|
|
@@ -1288,23 +1288,23 @@ var Z = class extends Error {
|
|
|
1288
1288
|
subscribe = (e) => (this.#r.add(e), () => {
|
|
1289
1289
|
this.#r.delete(e);
|
|
1290
1290
|
});
|
|
1291
|
-
clear = () => {
|
|
1292
|
-
let
|
|
1293
|
-
this.#i = void 0, this.#s = void 0,
|
|
1291
|
+
clear = (e = !1) => {
|
|
1292
|
+
let t = this.#i;
|
|
1293
|
+
this.#i = void 0, this.#s = void 0, t?.detachSubject?.(), t?.controller.abort(e ? Hn : void 0), this.#h({
|
|
1294
1294
|
status: "idle",
|
|
1295
1295
|
data: void 0,
|
|
1296
1296
|
error: void 0
|
|
1297
1297
|
});
|
|
1298
1298
|
};
|
|
1299
1299
|
async activate(e, t) {
|
|
1300
|
-
this.clear();
|
|
1300
|
+
this.clear(!0);
|
|
1301
1301
|
let n = new AbortController(), r = {
|
|
1302
1302
|
input: e,
|
|
1303
1303
|
key: sn(),
|
|
1304
1304
|
controller: n,
|
|
1305
1305
|
subject: void 0,
|
|
1306
1306
|
detachSubject: void 0,
|
|
1307
|
-
prerequisite: new
|
|
1307
|
+
prerequisite: new Wn(n.signal, this.#c(this.#n()).options.replayWindowMs),
|
|
1308
1308
|
established: !1
|
|
1309
1309
|
};
|
|
1310
1310
|
this.#i = r, this.#h({
|
|
@@ -1344,7 +1344,7 @@ var Z = class extends Error {
|
|
|
1344
1344
|
return e.recovery ?? d(e.errorBus, this.#e);
|
|
1345
1345
|
}
|
|
1346
1346
|
#l(e) {
|
|
1347
|
-
if (this.#i !== e || e.controller.signal.aborted) throw new Z(
|
|
1347
|
+
if (this.#i !== e || e.controller.signal.aborted) throw new Z(Un(e.controller.signal));
|
|
1348
1348
|
}
|
|
1349
1349
|
#u(e, t, n) {
|
|
1350
1350
|
this.#l(e);
|
|
@@ -1383,7 +1383,7 @@ var Z = class extends Error {
|
|
|
1383
1383
|
let n = U.async((t) => {
|
|
1384
1384
|
let n = () => {
|
|
1385
1385
|
let n = a.getSnapshot();
|
|
1386
|
-
e.controller.signal.aborted ? t(U.fail(new Z(
|
|
1386
|
+
e.controller.signal.aborted ? t(U.fail(new Z(Un(e.controller.signal)))) : n !== void 0 && t(U.succeed(n));
|
|
1387
1387
|
}, r = a.subscribe(n);
|
|
1388
1388
|
return e.controller.signal.addEventListener("abort", n, { once: !0 }), n(), U.sync(() => {
|
|
1389
1389
|
r(), e.controller.signal.removeEventListener("abort", n);
|
|
@@ -1454,10 +1454,10 @@ var Z = class extends Error {
|
|
|
1454
1454
|
} catch {}
|
|
1455
1455
|
}
|
|
1456
1456
|
}
|
|
1457
|
-
},
|
|
1457
|
+
}, Kn = (e, t) => {
|
|
1458
1458
|
let n = K(e), r = z(n);
|
|
1459
1459
|
r.current = n;
|
|
1460
|
-
let i = R(() => new
|
|
1460
|
+
let i = R(() => new Gn(e, t, () => r.current), [e, t]), a = F((n) => i.activate(n, () => J(r, e, t)), [
|
|
1461
1461
|
i,
|
|
1462
1462
|
e,
|
|
1463
1463
|
t
|
|
@@ -1474,77 +1474,77 @@ var Z = class extends Error {
|
|
|
1474
1474
|
clear: i.clear,
|
|
1475
1475
|
ready: o.status === "ready"
|
|
1476
1476
|
};
|
|
1477
|
-
},
|
|
1478
|
-
useSubscription: (t, n, r) =>
|
|
1477
|
+
}, qn = q, Jn = (e) => ({
|
|
1478
|
+
useSubscription: (t, n, r) => qn(e, t, n, r),
|
|
1479
1479
|
useMutation: (t) => xn(e, t),
|
|
1480
|
-
useConnectionSetup: (t) =>
|
|
1480
|
+
useConnectionSetup: (t) => Kn(e, t),
|
|
1481
1481
|
useAction: (t) => En(e, t),
|
|
1482
1482
|
useFormBinding: (t, n) => In(e, t, n ?? {})
|
|
1483
|
-
}),
|
|
1484
|
-
|
|
1485
|
-
},
|
|
1486
|
-
let i =
|
|
1483
|
+
}), Yn = () => ({ seeds: [] }), Xn = null, Zn = (e) => {
|
|
1484
|
+
Xn = e;
|
|
1485
|
+
}, Qn = /* @__PURE__ */ new Map(), $n = (e, t) => `${e}\u0000${t}`, er = (e, t, n, r) => {
|
|
1486
|
+
let i = Xn?.() ?? null;
|
|
1487
1487
|
if (i === null) throw Error(`seedPreloadedSubscription('${e}', '${t}') was called outside a server render. Preload seeds exist to put a subscription's first value into the SSR hydration payload; on the client the live subscription already provides it. (If this IS server code, the render did not install a seed bag — that is a framework bug.)`);
|
|
1488
1488
|
i.seeds.push({
|
|
1489
1489
|
api: e,
|
|
1490
1490
|
key: O([t, n]),
|
|
1491
1491
|
value: r
|
|
1492
1492
|
});
|
|
1493
|
-
},
|
|
1494
|
-
let r =
|
|
1493
|
+
}, tr = (e, t, n) => {
|
|
1494
|
+
let r = Xn?.() ?? null;
|
|
1495
1495
|
r !== null && r.seeds.push({
|
|
1496
1496
|
api: e,
|
|
1497
1497
|
key: O([t, n]),
|
|
1498
1498
|
value: void 0,
|
|
1499
1499
|
failed: !0
|
|
1500
1500
|
});
|
|
1501
|
-
},
|
|
1502
|
-
if (e !== void 0) for (let t of e)
|
|
1501
|
+
}, nr = (e) => {
|
|
1502
|
+
if (e !== void 0) for (let t of e) Qn.set($n(t.api, t.key), {
|
|
1503
1503
|
value: t.value,
|
|
1504
1504
|
failed: t.failed === !0
|
|
1505
1505
|
});
|
|
1506
|
-
},
|
|
1507
|
-
let r = O([t, n]), i =
|
|
1506
|
+
}, rr = (e, t, n) => {
|
|
1507
|
+
let r = O([t, n]), i = Xn?.() ?? null;
|
|
1508
1508
|
if (i !== null) {
|
|
1509
1509
|
for (let t of i.seeds) if (t.api === e && t.key === r) return t.failed === !0 ? void 0 : t.value;
|
|
1510
1510
|
return;
|
|
1511
1511
|
}
|
|
1512
|
-
let a =
|
|
1512
|
+
let a = Qn.get($n(e, r));
|
|
1513
1513
|
return a === void 0 || a.failed ? void 0 : a.value;
|
|
1514
|
-
},
|
|
1515
|
-
let r = O([t, n]), i =
|
|
1514
|
+
}, ir = (e, t, n) => {
|
|
1515
|
+
let r = O([t, n]), i = Xn?.() ?? null;
|
|
1516
1516
|
if (i !== null) {
|
|
1517
1517
|
for (let t of i.seeds) if (t.api === e && t.key === r) return t.failed === !0 ? "failed" : "seeded";
|
|
1518
1518
|
return "absent";
|
|
1519
1519
|
}
|
|
1520
|
-
let a =
|
|
1520
|
+
let a = Qn.get($n(e, r));
|
|
1521
1521
|
return a === void 0 ? "absent" : a.failed ? "failed" : "seeded";
|
|
1522
|
-
},
|
|
1523
|
-
|
|
1522
|
+
}, ar = () => {
|
|
1523
|
+
Qn.clear();
|
|
1524
1524
|
};
|
|
1525
1525
|
//#endregion
|
|
1526
1526
|
//#region src/usePreloadedSubscription.ts
|
|
1527
|
-
function
|
|
1528
|
-
let i =
|
|
1527
|
+
function or(e, t, n = {}, r = {}) {
|
|
1528
|
+
let i = rr(e, t, n), a = q(e, t, n, i === void 0 ? r : {
|
|
1529
1529
|
...r,
|
|
1530
1530
|
initialSnapshot: i
|
|
1531
1531
|
});
|
|
1532
|
-
return
|
|
1532
|
+
return ir(e, t, n) === "failed" ? {
|
|
1533
1533
|
...a,
|
|
1534
1534
|
preloadFailed: !0
|
|
1535
1535
|
} : a;
|
|
1536
1536
|
}
|
|
1537
1537
|
//#endregion
|
|
1538
1538
|
//#region src/useEvent.ts
|
|
1539
|
-
var
|
|
1539
|
+
var sr = {
|
|
1540
1540
|
status: "idle",
|
|
1541
1541
|
missed: 0,
|
|
1542
1542
|
lastMiss: void 0
|
|
1543
|
-
},
|
|
1543
|
+
}, cr = class {
|
|
1544
1544
|
_tag = "EventStreamClosed";
|
|
1545
1545
|
};
|
|
1546
|
-
function
|
|
1547
|
-
let { skip: i = !1, apiName: a = "app", onMissed: s } = r, c = K(a), { runtime: l, client: u } = c, [d, f] = B(
|
|
1546
|
+
function lr(e, t, n, r = {}) {
|
|
1547
|
+
let { skip: i = !1, apiName: a = "app", onMissed: s } = r, c = K(a), { runtime: l, client: u } = c, [d, f] = B(sr), p = z(n);
|
|
1548
1548
|
p.current = n;
|
|
1549
1549
|
let m = z(s);
|
|
1550
1550
|
m.current = s;
|
|
@@ -1556,7 +1556,7 @@ function sr(e, t, n, r = {}) {
|
|
|
1556
1556
|
b.current = t;
|
|
1557
1557
|
let x = z(null);
|
|
1558
1558
|
x.current !== y && (x.current = y, v.current = /* @__PURE__ */ new Map());
|
|
1559
|
-
let S =
|
|
1559
|
+
let S = F((t, n) => {
|
|
1560
1560
|
t <= 0 || (o(a, "event.gap", {
|
|
1561
1561
|
tag: e.name,
|
|
1562
1562
|
missed: t,
|
|
@@ -1575,7 +1575,7 @@ function sr(e, t, n, r = {}) {
|
|
|
1575
1575
|
}, [a, e.name]), C = !i && y !== null && !Qe(c);
|
|
1576
1576
|
return L(() => {
|
|
1577
1577
|
if (!C) {
|
|
1578
|
-
f(
|
|
1578
|
+
f(sr);
|
|
1579
1579
|
return;
|
|
1580
1580
|
}
|
|
1581
1581
|
f((e) => ({
|
|
@@ -1593,7 +1593,7 @@ function sr(e, t, n, r = {}) {
|
|
|
1593
1593
|
});
|
|
1594
1594
|
}), r = W.unwrap(n).pipe(W.tap(() => U.sync(() => {
|
|
1595
1595
|
t = 0;
|
|
1596
|
-
})), W.concat(W.fail(new
|
|
1596
|
+
})), W.concat(W.fail(new cr())), W.retry(De.exponential("250 millis", 2).pipe(De.either(De.spaced("30 seconds")), De.jittered, De.tapOutput(() => U.sync(() => {
|
|
1597
1597
|
t += 1, f((e) => ({
|
|
1598
1598
|
...e,
|
|
1599
1599
|
status: "connecting"
|
|
@@ -1620,11 +1620,11 @@ function sr(e, t, n, r = {}) {
|
|
|
1620
1620
|
y,
|
|
1621
1621
|
e.name,
|
|
1622
1622
|
S
|
|
1623
|
-
]), C ? d :
|
|
1623
|
+
]), C ? d : sr;
|
|
1624
1624
|
}
|
|
1625
1625
|
//#endregion
|
|
1626
1626
|
//#region src/sequence.ts
|
|
1627
|
-
var
|
|
1627
|
+
var ur = () => {
|
|
1628
1628
|
let e = (t) => ({
|
|
1629
1629
|
steps: t,
|
|
1630
1630
|
step: ((n, r, i) => e([...t, {
|
|
@@ -1636,7 +1636,7 @@ var cr = () => {
|
|
|
1636
1636
|
}]))
|
|
1637
1637
|
});
|
|
1638
1638
|
return e([]);
|
|
1639
|
-
},
|
|
1639
|
+
}, dr = async (e, t = {}) => {
|
|
1640
1640
|
let n = {}, r = [];
|
|
1641
1641
|
for (let i of e.steps) {
|
|
1642
1642
|
if (i.when !== void 0 && !i.when(n)) {
|
|
@@ -1696,13 +1696,13 @@ var cr = () => {
|
|
|
1696
1696
|
ok: !0,
|
|
1697
1697
|
data: n
|
|
1698
1698
|
};
|
|
1699
|
-
},
|
|
1699
|
+
}, fr = (e = {}) => {
|
|
1700
1700
|
let [t, n] = B(!1), [r, i] = B(void 0), [a, o] = B(void 0), s = z(e);
|
|
1701
1701
|
return s.current = e, {
|
|
1702
|
-
run:
|
|
1702
|
+
run: F(async (e, t = {}) => {
|
|
1703
1703
|
n(!0), i(void 0), o(void 0);
|
|
1704
1704
|
try {
|
|
1705
|
-
let n = await
|
|
1705
|
+
let n = await dr(e, {
|
|
1706
1706
|
...s.current,
|
|
1707
1707
|
...t
|
|
1708
1708
|
});
|
|
@@ -1715,7 +1715,7 @@ var cr = () => {
|
|
|
1715
1715
|
error: r,
|
|
1716
1716
|
failedStep: a
|
|
1717
1717
|
};
|
|
1718
|
-
},
|
|
1718
|
+
}, pr = "@voltro/plugin-storage", Q = (e) => Me(pr, e), mr = (e, t, n, r) => new Promise((i, a) => {
|
|
1719
1719
|
let o = new XMLHttpRequest();
|
|
1720
1720
|
if (o.open("PUT", e), o.upload.onprogress = (e) => {
|
|
1721
1721
|
e.lengthComputable && n(e.loaded / e.total);
|
|
@@ -1729,7 +1729,7 @@ var cr = () => {
|
|
|
1729
1729
|
return;
|
|
1730
1730
|
}
|
|
1731
1731
|
r.addEventListener("abort", () => o.abort(), { once: !0 }), o.send(t);
|
|
1732
|
-
}),
|
|
1732
|
+
}), hr = (e, t, n, r, i, a) => new Promise((o, s) => {
|
|
1733
1733
|
let c = new XMLHttpRequest();
|
|
1734
1734
|
if (c.open("POST", e), c.setRequestHeader("content-type", t), c.upload.onprogress = (e) => {
|
|
1735
1735
|
e.lengthComputable && r(e.loaded / e.total);
|
|
@@ -1747,7 +1747,7 @@ var cr = () => {
|
|
|
1747
1747
|
return;
|
|
1748
1748
|
}
|
|
1749
1749
|
i.addEventListener("abort", () => c.abort(), { once: !0 }), c.send(n);
|
|
1750
|
-
}),
|
|
1750
|
+
}), gr = (e, t, n, r, i) => new Promise((a, o) => {
|
|
1751
1751
|
let s = new XMLHttpRequest();
|
|
1752
1752
|
if (s.open("PUT", e), s.setRequestHeader("content-type", t), s.upload.onprogress = (e) => {
|
|
1753
1753
|
e.lengthComputable && r(e.loaded / e.total);
|
|
@@ -1758,7 +1758,7 @@ var cr = () => {
|
|
|
1758
1758
|
return;
|
|
1759
1759
|
}
|
|
1760
1760
|
i.addEventListener("abort", () => s.abort(), { once: !0 }), s.send(n);
|
|
1761
|
-
}),
|
|
1761
|
+
}), _r = (e, t, n, r, i) => new Promise((a, o) => {
|
|
1762
1762
|
let s = new XMLHttpRequest();
|
|
1763
1763
|
if (s.open("POST", e), s.setRequestHeader("content-type", t), s.upload.onprogress = (e) => {
|
|
1764
1764
|
e.lengthComputable && r(e.loaded / e.total);
|
|
@@ -1774,14 +1774,14 @@ var cr = () => {
|
|
|
1774
1774
|
return;
|
|
1775
1775
|
}
|
|
1776
1776
|
i.addEventListener("abort", () => s.abort(), { once: !0 }), s.send(n);
|
|
1777
|
-
}),
|
|
1777
|
+
}), vr = (e, t = {}) => {
|
|
1778
1778
|
let r = K(e), { inspectBaseUrl: a } = r, o = z(r);
|
|
1779
1779
|
o.current = r;
|
|
1780
|
-
let [s, c] = B(0), [l, u] = B("idle"), [d, f] = B(void 0), p = z(null), m =
|
|
1780
|
+
let [s, c] = B(0), [l, u] = B("idle"), [d, f] = B(void 0), p = z(null), m = F(() => {
|
|
1781
1781
|
c(0), u("idle"), f(void 0);
|
|
1782
|
-
}, []), g =
|
|
1782
|
+
}, []), g = F(() => {
|
|
1783
1783
|
p.current?.abort();
|
|
1784
|
-
}, []), _ =
|
|
1784
|
+
}, []), _ = F((e) => /^https?:\/\//.test(e) ? e : `${a}${e}`, [a]), v = F(async (r, i, a, s) => {
|
|
1785
1785
|
let { runtime: c, client: l } = await J(o, e, "storage.upload").catch((e) => {
|
|
1786
1786
|
throw n(e, "client");
|
|
1787
1787
|
}), u = Math.max(0, i.retries ?? t.retries ?? 1), d = (r instanceof File, r.type || "application/octet-stream"), f = r instanceof File ? r.name : "blob", p = i.visibility ?? t.visibility, m = i.key ?? t.key, g = i.folder ?? t.folder, v = i.tags ?? t.tags, y = {
|
|
@@ -1803,7 +1803,7 @@ var cr = () => {
|
|
|
1803
1803
|
contentType: d,
|
|
1804
1804
|
...y,
|
|
1805
1805
|
...m ? { key: m } : {}
|
|
1806
|
-
})), u = await
|
|
1806
|
+
})), u = await _r(_(o.uploadUrl), d, r, s, a);
|
|
1807
1807
|
return b(u);
|
|
1808
1808
|
}, C = async () => {
|
|
1809
1809
|
let e = i.presignMintTag ?? t.presignMintTag ?? Q("mintPresignedUpload"), n = i.finalizeTag ?? t.finalizeTag ?? Q("finalizeUpload"), o;
|
|
@@ -1816,7 +1816,7 @@ var cr = () => {
|
|
|
1816
1816
|
} catch {
|
|
1817
1817
|
return null;
|
|
1818
1818
|
}
|
|
1819
|
-
await
|
|
1819
|
+
await gr(o.uploadUrl, d, r, s, a);
|
|
1820
1820
|
let u = h(l, n), f = await S(c, u({ finalizeToken: o.finalizeToken }));
|
|
1821
1821
|
return b(f);
|
|
1822
1822
|
}, w = async () => {
|
|
@@ -1831,7 +1831,7 @@ var cr = () => {
|
|
|
1831
1831
|
for (;;) {
|
|
1832
1832
|
if (a.aborted) throw new DOMException("upload aborted", "AbortError");
|
|
1833
1833
|
try {
|
|
1834
|
-
let t = await
|
|
1834
|
+
let t = await hr(`${p}?${`token=${encodeURIComponent(f.resumableToken)}&index=${e}${c ? "&final=1" : ""}`}`, d, i, (e) => s((x + e * l) / o), a, c);
|
|
1835
1835
|
c && (C = t);
|
|
1836
1836
|
break;
|
|
1837
1837
|
} catch (e) {
|
|
@@ -1865,7 +1865,7 @@ var cr = () => {
|
|
|
1865
1865
|
let { url: e } = await S(c, v({
|
|
1866
1866
|
multipartToken: g.multipartToken,
|
|
1867
1867
|
partNumber: o
|
|
1868
|
-
})), t = await
|
|
1868
|
+
})), t = await mr(e, i, (e) => s((D + e * l) / p), a);
|
|
1869
1869
|
E.push({
|
|
1870
1870
|
partNumber: o,
|
|
1871
1871
|
etag: t
|
|
@@ -1929,7 +1929,7 @@ var cr = () => {
|
|
|
1929
1929
|
t.folder,
|
|
1930
1930
|
t.tags,
|
|
1931
1931
|
t.retries
|
|
1932
|
-
]), y =
|
|
1932
|
+
]), y = F(async (e, n = {}) => {
|
|
1933
1933
|
let r = new AbortController();
|
|
1934
1934
|
p.current = r, u("uploading"), f(void 0), c(0);
|
|
1935
1935
|
try {
|
|
@@ -1944,7 +1944,7 @@ var cr = () => {
|
|
|
1944
1944
|
outcome: i(e, "unknown") === "transport" ? "unknown" : "not-applicable"
|
|
1945
1945
|
}), e;
|
|
1946
1946
|
}
|
|
1947
|
-
}, [v, t.mintTag]), b =
|
|
1947
|
+
}, [v, t.mintTag]), b = F(async (e, n = {}) => {
|
|
1948
1948
|
if (e.length === 0) return [];
|
|
1949
1949
|
let r = new AbortController();
|
|
1950
1950
|
p.current = r, u("uploading"), f(void 0), c(0);
|
|
@@ -1972,11 +1972,11 @@ var cr = () => {
|
|
|
1972
1972
|
v,
|
|
1973
1973
|
t.concurrency,
|
|
1974
1974
|
t.mintTag
|
|
1975
|
-
]), x =
|
|
1975
|
+
]), x = F((e, t = {}) => {
|
|
1976
1976
|
e.preventDefault();
|
|
1977
1977
|
let n = e.dataTransfer ? Array.from(e.dataTransfer.files) : [];
|
|
1978
1978
|
return n.length ? b(n, t) : Promise.resolve([]);
|
|
1979
|
-
}, [b]), C =
|
|
1979
|
+
}, [b]), C = F((e, t = {}) => {
|
|
1980
1980
|
let n = e.clipboardData ? Array.from(e.clipboardData.files) : [];
|
|
1981
1981
|
return n.length ? b(n, t) : Promise.resolve([]);
|
|
1982
1982
|
}, [b]), w = R(() => ({
|
|
@@ -2008,10 +2008,10 @@ var cr = () => {
|
|
|
2008
2008
|
C,
|
|
2009
2009
|
w
|
|
2010
2010
|
]);
|
|
2011
|
-
},
|
|
2012
|
-
let n =
|
|
2011
|
+
}, yr = (e, t) => {
|
|
2012
|
+
let n = vr(e), r = En(e, t.action), [i, a] = B("idle"), [o, s] = B(void 0), [c, l] = B(void 0), u = z(t.extra);
|
|
2013
2013
|
u.current = t.extra;
|
|
2014
|
-
let d =
|
|
2014
|
+
let d = F(async (e) => {
|
|
2015
2015
|
l(void 0), s(void 0), a("uploading");
|
|
2016
2016
|
let t;
|
|
2017
2017
|
try {
|
|
@@ -2029,9 +2029,9 @@ var cr = () => {
|
|
|
2029
2029
|
} catch (e) {
|
|
2030
2030
|
throw a("error"), l(e), e;
|
|
2031
2031
|
}
|
|
2032
|
-
}, [n, r]), f =
|
|
2032
|
+
}, [n, r]), f = F(() => {
|
|
2033
2033
|
n.cancel(), a("idle");
|
|
2034
|
-
}, [n]), p =
|
|
2034
|
+
}, [n]), p = F(() => {
|
|
2035
2035
|
n.reset(), a("idle"), s(void 0), l(void 0);
|
|
2036
2036
|
}, [n]);
|
|
2037
2037
|
return R(() => ({
|
|
@@ -2065,13 +2065,13 @@ var cr = () => {
|
|
|
2065
2065
|
"rpc.tag": e.tag
|
|
2066
2066
|
} }));
|
|
2067
2067
|
return S(e.runtime, n);
|
|
2068
|
-
},
|
|
2068
|
+
}, br = (e, t) => {
|
|
2069
2069
|
let n = K(e), { descriptors: r } = n, i = z(n);
|
|
2070
2070
|
if (i.current = n, process.env.NODE_ENV !== "production") {
|
|
2071
2071
|
let n = r[t]?.kind;
|
|
2072
2072
|
n !== void 0 && n !== "workflow" && console.error(`[@voltro/client] useWorkflow('${e}', '${t}') targets a ${n}, not a workflow. Use ${n === "mutation" ? "useMutation" : n === "action" ? "useAction" : `the ${n} hook`} instead.`);
|
|
2073
2073
|
}
|
|
2074
|
-
let [a, o] = B(!1), [s, c] = B(void 0), [l, u] = B(void 0), d =
|
|
2074
|
+
let [a, o] = B(!1), [s, c] = B(void 0), [l, u] = B(void 0), d = F(async (n) => {
|
|
2075
2075
|
o(!0), c(void 0);
|
|
2076
2076
|
try {
|
|
2077
2077
|
let { runtime: r, client: a } = await J(i, e, t), o = await $({
|
|
@@ -2088,7 +2088,7 @@ var cr = () => {
|
|
|
2088
2088
|
} finally {
|
|
2089
2089
|
o(!1);
|
|
2090
2090
|
}
|
|
2091
|
-
}, [e, t]), f =
|
|
2091
|
+
}, [e, t]), f = F(async (t) => {
|
|
2092
2092
|
let n = "__voltro.workflow.queued.cancel", { runtime: r, client: a } = await J(i, e, n);
|
|
2093
2093
|
return $({
|
|
2094
2094
|
apiName: e,
|
|
@@ -2098,7 +2098,7 @@ var cr = () => {
|
|
|
2098
2098
|
input: t,
|
|
2099
2099
|
spanPrefix: "client.workflow.queued.cancel"
|
|
2100
2100
|
});
|
|
2101
|
-
}, [e]), p =
|
|
2101
|
+
}, [e]), p = F(async (t) => {
|
|
2102
2102
|
let n = "__voltro.workflow.queued.control", { runtime: r, client: a } = await J(i, e, n), o = h(a, n);
|
|
2103
2103
|
return S(r, W.runHead(o(t)).pipe(U.flatMap((e) => {
|
|
2104
2104
|
if (Ee.isSome(e)) {
|
|
@@ -2107,7 +2107,7 @@ var cr = () => {
|
|
|
2107
2107
|
}
|
|
2108
2108
|
return U.fail(/* @__PURE__ */ Error("queued workflow control query ended without a snapshot"));
|
|
2109
2109
|
})));
|
|
2110
|
-
}, [e]), m =
|
|
2110
|
+
}, [e]), m = F(async (t) => {
|
|
2111
2111
|
let n = "__voltro.workflow.control", { runtime: r, client: a } = await J(i, e, n), o = h(a, n);
|
|
2112
2112
|
return S(r, W.runHead(o(t)).pipe(U.flatMap((e) => {
|
|
2113
2113
|
if (Ee.isSome(e)) {
|
|
@@ -2116,7 +2116,7 @@ var cr = () => {
|
|
|
2116
2116
|
}
|
|
2117
2117
|
return U.fail(/* @__PURE__ */ Error("workflow control query ended without a snapshot"));
|
|
2118
2118
|
})));
|
|
2119
|
-
}, [e]), g =
|
|
2119
|
+
}, [e]), g = F(async (t, n) => {
|
|
2120
2120
|
let { runtime: r, client: a } = await J(i, e, "__voltro.workflow.cancel");
|
|
2121
2121
|
return $({
|
|
2122
2122
|
apiName: e,
|
|
@@ -2129,7 +2129,7 @@ var cr = () => {
|
|
|
2129
2129
|
},
|
|
2130
2130
|
spanPrefix: "client.workflow.cancel"
|
|
2131
2131
|
});
|
|
2132
|
-
}, [e]), _ =
|
|
2132
|
+
}, [e]), _ = F(async (t, n) => {
|
|
2133
2133
|
let { runtime: r, client: a } = await J(i, e, "__voltro.workflow.resume");
|
|
2134
2134
|
return $({
|
|
2135
2135
|
apiName: e,
|
|
@@ -2142,7 +2142,7 @@ var cr = () => {
|
|
|
2142
2142
|
},
|
|
2143
2143
|
spanPrefix: "client.workflow.resume"
|
|
2144
2144
|
});
|
|
2145
|
-
}, [e]), v =
|
|
2145
|
+
}, [e]), v = F(async (t, n, r) => {
|
|
2146
2146
|
let { runtime: a, client: o } = await J(i, e, "__voltro.workflow.signal");
|
|
2147
2147
|
return $({
|
|
2148
2148
|
apiName: e,
|
|
@@ -2156,7 +2156,7 @@ var cr = () => {
|
|
|
2156
2156
|
},
|
|
2157
2157
|
spanPrefix: "client.workflow.signal"
|
|
2158
2158
|
});
|
|
2159
|
-
}, [e]), y =
|
|
2159
|
+
}, [e]), y = F(async (t, n, r, a) => {
|
|
2160
2160
|
let { runtime: o, client: s } = await J(i, e, "__voltro.workflow.update");
|
|
2161
2161
|
return $({
|
|
2162
2162
|
apiName: e,
|
|
@@ -2197,10 +2197,10 @@ var cr = () => {
|
|
|
2197
2197
|
s,
|
|
2198
2198
|
l
|
|
2199
2199
|
]);
|
|
2200
|
-
},
|
|
2200
|
+
}, xr = (e) => {
|
|
2201
2201
|
let t = K(e), n = z(t);
|
|
2202
2202
|
n.current = t;
|
|
2203
|
-
let [r, i] = B(!1), [a, o] = B(void 0), [s, c] = B(void 0), l =
|
|
2203
|
+
let [r, i] = B(!1), [a, o] = B(void 0), [s, c] = B(void 0), l = F(async (t, r, a) => {
|
|
2204
2204
|
i(!0), o(void 0);
|
|
2205
2205
|
try {
|
|
2206
2206
|
let { runtime: i, client: o } = await J(n, e, "__voltro.workflow.signal"), s = await $({
|
|
@@ -2233,10 +2233,10 @@ var cr = () => {
|
|
|
2233
2233
|
a,
|
|
2234
2234
|
s
|
|
2235
2235
|
]);
|
|
2236
|
-
},
|
|
2236
|
+
}, Sr = (e) => {
|
|
2237
2237
|
let t = K(e), n = z(t);
|
|
2238
2238
|
n.current = t;
|
|
2239
|
-
let [r, i] = B(!1), [a, o] = B(void 0), [s, c] = B(void 0), l =
|
|
2239
|
+
let [r, i] = B(!1), [a, o] = B(void 0), [s, c] = B(void 0), l = F(async (t, r, a, s) => {
|
|
2240
2240
|
i(!0), o(void 0);
|
|
2241
2241
|
try {
|
|
2242
2242
|
let { runtime: i, client: o } = await J(n, e, "__voltro.workflow.update"), l = await $({
|
|
@@ -2270,7 +2270,7 @@ var cr = () => {
|
|
|
2270
2270
|
a,
|
|
2271
2271
|
s
|
|
2272
2272
|
]);
|
|
2273
|
-
},
|
|
2273
|
+
}, Cr = (e, t) => {
|
|
2274
2274
|
let n = q(e, "__voltro.workflow.run", t ? { id: t } : {}, { skip: t === void 0 });
|
|
2275
2275
|
return n.loading || n.idle || n.failed ? {
|
|
2276
2276
|
...n,
|
|
@@ -2279,7 +2279,7 @@ var cr = () => {
|
|
|
2279
2279
|
...n,
|
|
2280
2280
|
run: n.data[0]
|
|
2281
2281
|
};
|
|
2282
|
-
},
|
|
2282
|
+
}, wr = (e, t = {}, n = {}) => {
|
|
2283
2283
|
let r = q(e, "__voltro.workflow.runs", t, n);
|
|
2284
2284
|
return r.loading || r.idle || r.failed ? {
|
|
2285
2285
|
...r,
|
|
@@ -2288,7 +2288,7 @@ var cr = () => {
|
|
|
2288
2288
|
...r,
|
|
2289
2289
|
runs: r.data
|
|
2290
2290
|
};
|
|
2291
|
-
},
|
|
2291
|
+
}, Tr = (e, t) => {
|
|
2292
2292
|
let n = q(e, "__voltro.workflow.run.steps", t ? { runId: t } : {}, { skip: t === void 0 });
|
|
2293
2293
|
return n.loading || n.idle || n.failed ? {
|
|
2294
2294
|
...n,
|
|
@@ -2297,7 +2297,7 @@ var cr = () => {
|
|
|
2297
2297
|
...n,
|
|
2298
2298
|
steps: n.data
|
|
2299
2299
|
};
|
|
2300
|
-
},
|
|
2300
|
+
}, Er = (e, t) => {
|
|
2301
2301
|
let n = q(e, "__voltro.workflow.run.events", t ? { runId: t } : {}, { skip: t === void 0 });
|
|
2302
2302
|
return n.loading || n.idle || n.failed ? {
|
|
2303
2303
|
...n,
|
|
@@ -2306,7 +2306,7 @@ var cr = () => {
|
|
|
2306
2306
|
...n,
|
|
2307
2307
|
events: n.data
|
|
2308
2308
|
};
|
|
2309
|
-
},
|
|
2309
|
+
}, Dr = Er, Or = (e, t = {}, n = {}) => {
|
|
2310
2310
|
let r = q(e, "__voltro.workflow.domainEvents", t, n);
|
|
2311
2311
|
return r.loading || r.idle || r.failed ? {
|
|
2312
2312
|
...r,
|
|
@@ -2315,7 +2315,7 @@ var cr = () => {
|
|
|
2315
2315
|
...r,
|
|
2316
2316
|
events: r.data
|
|
2317
2317
|
};
|
|
2318
|
-
},
|
|
2318
|
+
}, kr = (e, t) => {
|
|
2319
2319
|
let n = q(e, "__voltro.workflow.event.deliveries", t ? { eventId: t } : {}, { skip: t === void 0 });
|
|
2320
2320
|
return n.loading || n.idle || n.failed ? {
|
|
2321
2321
|
...n,
|
|
@@ -2324,42 +2324,42 @@ var cr = () => {
|
|
|
2324
2324
|
...n,
|
|
2325
2325
|
deliveries: n.data
|
|
2326
2326
|
};
|
|
2327
|
-
},
|
|
2327
|
+
}, Ar = (e, t) => {
|
|
2328
2328
|
let n = e.payload;
|
|
2329
2329
|
if (!n || typeof n != "object") return;
|
|
2330
2330
|
let r = n[t];
|
|
2331
2331
|
return typeof r == "string" ? r : void 0;
|
|
2332
|
-
},
|
|
2332
|
+
}, jr = (e) => {
|
|
2333
2333
|
let t = e.payload;
|
|
2334
2334
|
if (!t || typeof t != "object") return;
|
|
2335
2335
|
let n = t.updateId;
|
|
2336
2336
|
return typeof n == "string" ? n : void 0;
|
|
2337
|
-
},
|
|
2337
|
+
}, Mr = (e) => {
|
|
2338
2338
|
let t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set();
|
|
2339
2339
|
for (let r of e) if (r.eventType === "signal-received") {
|
|
2340
|
-
let e =
|
|
2340
|
+
let e = Ar(r, "signalName");
|
|
2341
2341
|
e && t.add(e);
|
|
2342
2342
|
} else if (r.eventType === "update-completed" || r.eventType === "update-failed") {
|
|
2343
|
-
let e =
|
|
2343
|
+
let e = jr(r);
|
|
2344
2344
|
e && n.add(e);
|
|
2345
2345
|
}
|
|
2346
2346
|
for (let r = e.length - 1; r >= 0; --r) {
|
|
2347
2347
|
let i = e[r];
|
|
2348
2348
|
if (i.eventType === "signal-awaited") {
|
|
2349
|
-
let e =
|
|
2349
|
+
let e = Ar(i, "signalName");
|
|
2350
2350
|
if (e && !t.has(e)) return {
|
|
2351
2351
|
name: e,
|
|
2352
2352
|
kind: "signal"
|
|
2353
2353
|
};
|
|
2354
2354
|
} else if (i.eventType === "update-requested") {
|
|
2355
|
-
let e =
|
|
2355
|
+
let e = jr(i), t = Ar(i, "updateName");
|
|
2356
2356
|
if (t && (!e || !n.has(e))) return {
|
|
2357
2357
|
name: t,
|
|
2358
2358
|
kind: "update"
|
|
2359
2359
|
};
|
|
2360
2360
|
}
|
|
2361
2361
|
}
|
|
2362
|
-
},
|
|
2362
|
+
}, Nr = (e) => e.find((e) => e.status === "running") || (e.length > 0 ? e[e.length - 1] : void 0), Pr = (e, t) => {
|
|
2363
2363
|
if (!e || e.status !== "failed") return;
|
|
2364
2364
|
let n = t.find((e) => e.status === "failed");
|
|
2365
2365
|
return {
|
|
@@ -2367,23 +2367,23 @@ var cr = () => {
|
|
|
2367
2367
|
message: e.errorMessage,
|
|
2368
2368
|
step: n?.stepName
|
|
2369
2369
|
};
|
|
2370
|
-
},
|
|
2371
|
-
let n =
|
|
2370
|
+
}, Fr = (e, t) => {
|
|
2371
|
+
let n = Cr(e, t), r = Tr(e, t), i = Er(e, t), a = br(e, n.run?.tag ?? ""), o = n.run, s = r.steps, c = i.events, l = F(async () => {
|
|
2372
2372
|
if (!o) throw Error("useWorkflowRunState: no run loaded — cannot cancel");
|
|
2373
2373
|
await a.cancel({
|
|
2374
2374
|
workflowName: o.tag,
|
|
2375
2375
|
executionId: o.executionId
|
|
2376
2376
|
});
|
|
2377
|
-
}, [a, o]), u =
|
|
2377
|
+
}, [a, o]), u = F(async () => {
|
|
2378
2378
|
if (!o) throw Error("useWorkflowRunState: no run loaded — cannot resume");
|
|
2379
2379
|
await a.resume({
|
|
2380
2380
|
workflowName: o.tag,
|
|
2381
2381
|
executionId: o.executionId
|
|
2382
2382
|
});
|
|
2383
|
-
}, [a, o]), d =
|
|
2383
|
+
}, [a, o]), d = F((e, n) => {
|
|
2384
2384
|
if (t === void 0) throw Error("useWorkflowRunState: no run id — cannot signal");
|
|
2385
2385
|
return a.signal({ id: t }, e, n);
|
|
2386
|
-
}, [a, t]), f =
|
|
2386
|
+
}, [a, t]), f = F((e, n, r) => {
|
|
2387
2387
|
if (t === void 0) throw Error("useWorkflowRunState: no run id — cannot update");
|
|
2388
2388
|
return a.update({ id: t }, e, n, r);
|
|
2389
2389
|
}, [a, t]);
|
|
@@ -2392,9 +2392,9 @@ var cr = () => {
|
|
|
2392
2392
|
status: o?.status,
|
|
2393
2393
|
steps: s,
|
|
2394
2394
|
events: c,
|
|
2395
|
-
currentStep:
|
|
2396
|
-
waitingFor: o?.status === "suspended" ?
|
|
2397
|
-
error:
|
|
2395
|
+
currentStep: Nr(s),
|
|
2396
|
+
waitingFor: o?.status === "suspended" ? Mr(c) : void 0,
|
|
2397
|
+
error: Pr(o, s),
|
|
2398
2398
|
traceId: o?.traceId,
|
|
2399
2399
|
loading: n.data === void 0,
|
|
2400
2400
|
cancel: l,
|
|
@@ -2411,8 +2411,8 @@ var cr = () => {
|
|
|
2411
2411
|
d,
|
|
2412
2412
|
f
|
|
2413
2413
|
]);
|
|
2414
|
-
},
|
|
2415
|
-
let { runtime: n, client: r } = K(e), [i, a] = B([]), [o, s] = B("idle"), [c, l] = B(void 0), u = z(null), d =
|
|
2414
|
+
}, Ir = (e, t) => {
|
|
2415
|
+
let { runtime: n, client: r } = K(e), [i, a] = B([]), [o, s] = B("idle"), [c, l] = B(void 0), u = z(null), d = F(() => {
|
|
2416
2416
|
let e = u.current;
|
|
2417
2417
|
e && (u.current = null, n.runFork(Te.interrupt(e)), s((e) => e === "streaming" ? "idle" : e));
|
|
2418
2418
|
}, [n]);
|
|
@@ -2420,7 +2420,7 @@ var cr = () => {
|
|
|
2420
2420
|
events: i,
|
|
2421
2421
|
status: o,
|
|
2422
2422
|
error: c,
|
|
2423
|
-
start:
|
|
2423
|
+
start: F((e = {}) => {
|
|
2424
2424
|
let i = u.current;
|
|
2425
2425
|
i && n.runFork(Te.interrupt(i)), a([]), l(void 0), s("streaming");
|
|
2426
2426
|
let o = h(r, t)(e), c = W.runForEach(o, (e) => U.sync(() => a((t) => [...t, e]))).pipe(U.matchCause({
|
|
@@ -2439,7 +2439,7 @@ var cr = () => {
|
|
|
2439
2439
|
]),
|
|
2440
2440
|
cancel: d
|
|
2441
2441
|
};
|
|
2442
|
-
},
|
|
2442
|
+
}, Lr = (e, t, n, r) => {
|
|
2443
2443
|
let i = 0, a = !1, o = (e) => U.sync(() => {
|
|
2444
2444
|
e.seq <= i || (i = e.seq, n.onEvent(e.event), r.isTerminal(e.event) && (a = !0));
|
|
2445
2445
|
}), s = (e) => {
|
|
@@ -2466,16 +2466,16 @@ var cr = () => {
|
|
|
2466
2466
|
}));
|
|
2467
2467
|
});
|
|
2468
2468
|
return u(0);
|
|
2469
|
-
},
|
|
2469
|
+
}, Rr = (e) => {
|
|
2470
2470
|
let t = e?._tag;
|
|
2471
2471
|
return t === "done" || t === "error";
|
|
2472
|
-
},
|
|
2472
|
+
}, zr = (e, t, n = {}) => {
|
|
2473
2473
|
let { runtime: r, client: i } = K(e), [a, o] = B([]), [s, c] = B("idle"), [l, u] = B(0), [d, f] = B(void 0), p = z(null), m = {
|
|
2474
2474
|
maxReconnects: n.maxReconnects ?? 6,
|
|
2475
2475
|
backoffMs: n.backoffMs ?? 400,
|
|
2476
2476
|
maxBackoffMs: n.maxBackoffMs ?? 8e3,
|
|
2477
|
-
isTerminal: n.isTerminal ??
|
|
2478
|
-
}, g =
|
|
2477
|
+
isTerminal: n.isTerminal ?? Rr
|
|
2478
|
+
}, g = F(() => {
|
|
2479
2479
|
let e = p.current;
|
|
2480
2480
|
e && (p.current = null, r.runFork(Te.interrupt(e)), c((e) => e === "streaming" || e === "reconnecting" ? "idle" : e));
|
|
2481
2481
|
}, [r]);
|
|
@@ -2484,7 +2484,7 @@ var cr = () => {
|
|
|
2484
2484
|
status: s,
|
|
2485
2485
|
reconnects: l,
|
|
2486
2486
|
error: d,
|
|
2487
|
-
start:
|
|
2487
|
+
start: F((e = {}) => {
|
|
2488
2488
|
let n = p.current;
|
|
2489
2489
|
n && r.runFork(Te.interrupt(n)), o([]), f(void 0), u(0), c("streaming");
|
|
2490
2490
|
let a = h(i, t), s = {
|
|
@@ -2493,7 +2493,7 @@ var cr = () => {
|
|
|
2493
2493
|
onReconnect: () => u((e) => e + 1),
|
|
2494
2494
|
onError: f
|
|
2495
2495
|
};
|
|
2496
|
-
p.current = r.runFork(
|
|
2496
|
+
p.current = r.runFork(Lr(a, e, s, m));
|
|
2497
2497
|
}, [
|
|
2498
2498
|
r,
|
|
2499
2499
|
i,
|
|
@@ -2505,13 +2505,13 @@ var cr = () => {
|
|
|
2505
2505
|
]),
|
|
2506
2506
|
cancel: g
|
|
2507
2507
|
};
|
|
2508
|
-
},
|
|
2508
|
+
}, Br = (e, t) => e.order - t.order || (e.stepOrder ?? 0) - (t.stepOrder ?? 0), Vr = (e) => {
|
|
2509
2509
|
for (let t = e.length - 1; t >= 0; --t) {
|
|
2510
2510
|
let n = e[t];
|
|
2511
2511
|
if (n.role === "user" && n.content) return n.content;
|
|
2512
2512
|
}
|
|
2513
|
-
},
|
|
2514
|
-
let { threadId: r } = n, i = q(e, `${t}.messages`, { threadId: r }), a = En(e, `${t}.send`), o = R(() => [...i.data ?? []].sort(
|
|
2513
|
+
}, Hr = (e, t, n) => {
|
|
2514
|
+
let { threadId: r } = n, i = q(e, `${t}.messages`, { threadId: r }), a = En(e, `${t}.send`), o = R(() => [...i.data ?? []].sort(Br), [i.data]), s = F((e, t = {}) => a.run({
|
|
2515
2515
|
threadId: r,
|
|
2516
2516
|
order: i.data?.length ?? 0,
|
|
2517
2517
|
prompt: e,
|
|
@@ -2520,8 +2520,8 @@ var cr = () => {
|
|
|
2520
2520
|
a,
|
|
2521
2521
|
r,
|
|
2522
2522
|
i.data
|
|
2523
|
-
]), c =
|
|
2524
|
-
let e =
|
|
2523
|
+
]), c = F(() => {
|
|
2524
|
+
let e = Vr(o);
|
|
2525
2525
|
return e === void 0 ? void 0 : s(e);
|
|
2526
2526
|
}, [o, s]);
|
|
2527
2527
|
return R(() => ({
|
|
@@ -2541,8 +2541,8 @@ var cr = () => {
|
|
|
2541
2541
|
s,
|
|
2542
2542
|
c
|
|
2543
2543
|
]);
|
|
2544
|
-
},
|
|
2545
|
-
let { events: n, status: r, error: i, start: a, cancel: o } =
|
|
2544
|
+
}, Ur = (e, t) => {
|
|
2545
|
+
let { events: n, status: r, error: i, start: a, cancel: o } = Ir(e, t), [s, c] = B([]), l = z(null), u = R(() => n.filter((e) => e._tag === "token").map((e) => e.text ?? "").join(""), [n]);
|
|
2546
2546
|
return L(() => {
|
|
2547
2547
|
if (r !== "done" || l.current === null) return;
|
|
2548
2548
|
let e = l.current;
|
|
@@ -2562,17 +2562,17 @@ var cr = () => {
|
|
|
2562
2562
|
history: s,
|
|
2563
2563
|
status: r,
|
|
2564
2564
|
error: i,
|
|
2565
|
-
send:
|
|
2565
|
+
send: F((e = {}) => {
|
|
2566
2566
|
let t = e.message;
|
|
2567
2567
|
l.current = typeof t == "string" ? t : "", a(e);
|
|
2568
2568
|
}, [a]),
|
|
2569
2569
|
cancel: o
|
|
2570
2570
|
};
|
|
2571
|
-
},
|
|
2572
|
-
let n = En(e, t), [r, i] = B(void 0), a =
|
|
2571
|
+
}, Wr = (e, t) => {
|
|
2572
|
+
let n = En(e, t), [r, i] = B(void 0), a = F(async (e) => {
|
|
2573
2573
|
let t = await n.run({ question: e });
|
|
2574
2574
|
return i(t), t;
|
|
2575
|
-
}, [n]), o =
|
|
2575
|
+
}, [n]), o = F(() => i(void 0), []);
|
|
2576
2576
|
return R(() => ({
|
|
2577
2577
|
ask: a,
|
|
2578
2578
|
answer: r,
|
|
@@ -2586,32 +2586,32 @@ var cr = () => {
|
|
|
2586
2586
|
n.error,
|
|
2587
2587
|
o
|
|
2588
2588
|
]);
|
|
2589
|
-
},
|
|
2589
|
+
}, Gr = (e) => {
|
|
2590
2590
|
let { cache: t, runtime: n } = K(e);
|
|
2591
|
-
return
|
|
2591
|
+
return F(() => {
|
|
2592
2592
|
t.refreshAll(n);
|
|
2593
2593
|
}, [t, n]);
|
|
2594
|
-
},
|
|
2594
|
+
}, Kr = (e, t, n) => {
|
|
2595
2595
|
let { cache: r } = K(e), i = O([t, n]), a = z([t, n]);
|
|
2596
2596
|
return a.current = [t, n], R(() => {
|
|
2597
2597
|
let e = a.current;
|
|
2598
2598
|
return () => r.refresh(e);
|
|
2599
2599
|
}, [r, i]);
|
|
2600
|
-
},
|
|
2600
|
+
}, qr = (e, t) => {
|
|
2601
2601
|
let n = K(e), r = n.recovery ?? d(n.errorBus, e), i = z(t);
|
|
2602
2602
|
i.current = t, L(() => r.onVisibleError((e) => i.current(e)), [r]);
|
|
2603
|
-
},
|
|
2603
|
+
}, Jr = (e, t) => {
|
|
2604
2604
|
let { errorBus: n } = K(e), r = z(t);
|
|
2605
2605
|
r.current = t, L(() => n.on((e) => r.current(e)), [n]);
|
|
2606
|
-
},
|
|
2606
|
+
}, Yr = {
|
|
2607
2607
|
failed: [],
|
|
2608
2608
|
healthy: !0
|
|
2609
|
-
},
|
|
2610
|
-
let { errorBus: t } = K(e), [n, r] = B(
|
|
2609
|
+
}, Xr = (e) => {
|
|
2610
|
+
let { errorBus: t } = K(e), [n, r] = B(Yr);
|
|
2611
2611
|
return L(() => {
|
|
2612
2612
|
let e = /* @__PURE__ */ new Map(), n = () => {
|
|
2613
2613
|
let t = [...e.values()].sort((e, t) => t.at - e.at);
|
|
2614
|
-
r(t.length === 0 ?
|
|
2614
|
+
r(t.length === 0 ? Yr : {
|
|
2615
2615
|
failed: t,
|
|
2616
2616
|
healthy: !1
|
|
2617
2617
|
});
|
|
@@ -2629,20 +2629,20 @@ var cr = () => {
|
|
|
2629
2629
|
i(), a();
|
|
2630
2630
|
};
|
|
2631
2631
|
}, [t]), n;
|
|
2632
|
-
},
|
|
2632
|
+
}, Zr = (e, t) => {
|
|
2633
2633
|
let n = globalThis, r = Symbol.for(`@voltro/web/context:${e}`), i = n[r];
|
|
2634
2634
|
if (i) return i;
|
|
2635
|
-
let a =
|
|
2635
|
+
let a = N(t);
|
|
2636
2636
|
return n[r] = a, a;
|
|
2637
|
-
},
|
|
2637
|
+
}, Qr = Zr("serverRequest", null), $r = () => I(Qr), ei = ({ value: e, children: t }) => /* @__PURE__ */ Ne(Qr.Provider, {
|
|
2638
2638
|
value: e,
|
|
2639
2639
|
children: t
|
|
2640
|
-
}),
|
|
2641
|
-
let t =
|
|
2640
|
+
}), ti = (e) => {
|
|
2641
|
+
let t = $r();
|
|
2642
2642
|
return R(() => {
|
|
2643
2643
|
if (t !== null) return t.formFlash?.formKey === e ? t.formFlash : void 0;
|
|
2644
2644
|
if (typeof document > "u") return;
|
|
2645
|
-
let n = document.getElementById(
|
|
2645
|
+
let n = document.getElementById(ge);
|
|
2646
2646
|
if (n !== null && n.textContent !== null && n.textContent !== "") try {
|
|
2647
2647
|
let t = JSON.parse(n.textContent);
|
|
2648
2648
|
return t.formKey === e ? t : void 0;
|
|
@@ -2650,13 +2650,13 @@ var cr = () => {
|
|
|
2650
2650
|
return;
|
|
2651
2651
|
}
|
|
2652
2652
|
}, [t, e]);
|
|
2653
|
-
},
|
|
2653
|
+
}, ni = (e, t, n) => e.map((e) => {
|
|
2654
2654
|
let r = String(e[n] ?? ""), i = e[t];
|
|
2655
2655
|
return {
|
|
2656
2656
|
value: r,
|
|
2657
2657
|
label: i == null ? r : String(i)
|
|
2658
2658
|
};
|
|
2659
|
-
}),
|
|
2659
|
+
}), ri = (e, t, n = {}) => {
|
|
2660
2660
|
let r = n.debounceMs ?? 200, i = n.labelField ?? "name", a = n.valueField ?? "id", o = n.input ?? ((e) => ({ q: e })), [s, c] = B(n.initialTerm ?? ""), [l, u] = B(s);
|
|
2661
2661
|
L(() => {
|
|
2662
2662
|
if (s === l) return;
|
|
@@ -2667,24 +2667,24 @@ var cr = () => {
|
|
|
2667
2667
|
l,
|
|
2668
2668
|
r
|
|
2669
2669
|
]);
|
|
2670
|
-
let d = n.skipUntilTerm === !0 && l.trim() === "", f = q(e, t, R(() => o(l), [o, l]), { skip: d }), p = R(() =>
|
|
2670
|
+
let d = n.skipUntilTerm === !0 && l.trim() === "", f = q(e, t, R(() => o(l), [o, l]), { skip: d }), p = R(() => ni(f.data ?? [], i, a), [
|
|
2671
2671
|
f.data,
|
|
2672
2672
|
i,
|
|
2673
2673
|
a
|
|
2674
|
-
]), m =
|
|
2674
|
+
]), m = F((e) => c(e), []);
|
|
2675
2675
|
return {
|
|
2676
2676
|
options: p,
|
|
2677
2677
|
loading: !d && f.data === void 0,
|
|
2678
2678
|
term: s,
|
|
2679
2679
|
search: m
|
|
2680
2680
|
};
|
|
2681
|
-
},
|
|
2681
|
+
}, ii = (e, t) => e === t ? 0 : e == null ? 1 : t == null || e < t ? -1 : 1, ai = (e, t, n = {}) => {
|
|
2682
2682
|
let r = K(e), [i, a] = B(n.pageSize), o = q(e, t, R(() => i === void 0 ? n.input ?? {} : {
|
|
2683
2683
|
...n.input,
|
|
2684
2684
|
limit: i
|
|
2685
|
-
}, [n.input, i])), s = r.descriptors[t]?.output, c =
|
|
2685
|
+
}, [n.input, i])), s = r.descriptors[t]?.output, c = F(() => {
|
|
2686
2686
|
n.pageSize !== void 0 && a((e) => (e ?? n.pageSize) + n.pageSize);
|
|
2687
|
-
}, [n.pageSize]), l = R(() => n.columns ?? (s === void 0 ? [] : k(s)), [n.columns, s]), [u, d] = B(n.initialSort), f =
|
|
2687
|
+
}, [n.pageSize]), l = R(() => n.columns ?? (s === void 0 ? [] : k(s)), [n.columns, s]), [u, d] = B(n.initialSort), f = F((e) => {
|
|
2688
2688
|
d((t) => t?.column === e ? {
|
|
2689
2689
|
column: e,
|
|
2690
2690
|
direction: t.direction === "asc" ? "desc" : "asc"
|
|
@@ -2699,7 +2699,7 @@ var cr = () => {
|
|
|
2699
2699
|
let e = o.data ?? [];
|
|
2700
2700
|
if (u === void 0) return e;
|
|
2701
2701
|
let t = u.direction === "asc" ? 1 : -1;
|
|
2702
|
-
return [...e].sort((e, n) =>
|
|
2702
|
+
return [...e].sort((e, n) => ii(e[u.column], n[u.column]) * t);
|
|
2703
2703
|
}, [o.data, u]),
|
|
2704
2704
|
loading: o.data === void 0,
|
|
2705
2705
|
error: o.error,
|
|
@@ -2708,13 +2708,13 @@ var cr = () => {
|
|
|
2708
2708
|
loadMore: c,
|
|
2709
2709
|
hasMore: i !== void 0 && (o.data?.length ?? 0) >= i
|
|
2710
2710
|
};
|
|
2711
|
-
},
|
|
2711
|
+
}, oi = (e, t, n, r) => {
|
|
2712
2712
|
let i = e.replace(/\/$/, ""), a = new URLSearchParams({
|
|
2713
2713
|
table: t,
|
|
2714
2714
|
id: n
|
|
2715
2715
|
});
|
|
2716
2716
|
return r !== void 0 && a.set("column", r), `${i}/_voltro/inspect/provenance?${a.toString()}`;
|
|
2717
|
-
},
|
|
2717
|
+
}, si = oi, ci = (e, t, n, r) => {
|
|
2718
2718
|
let { inspectBaseUrl: i } = K(e), [a, o] = B({
|
|
2719
2719
|
data: void 0,
|
|
2720
2720
|
loading: !0,
|
|
@@ -2727,7 +2727,7 @@ var cr = () => {
|
|
|
2727
2727
|
loading: !0,
|
|
2728
2728
|
error: void 0
|
|
2729
2729
|
});
|
|
2730
|
-
let a =
|
|
2730
|
+
let a = oi(i ?? "", t, n, r);
|
|
2731
2731
|
return fetch(a).then(async (e) => {
|
|
2732
2732
|
if (!e.ok) throw Error(`provenance fetch failed: HTTP ${e.status}`);
|
|
2733
2733
|
return await e.json();
|
|
@@ -2753,11 +2753,11 @@ var cr = () => {
|
|
|
2753
2753
|
n,
|
|
2754
2754
|
r
|
|
2755
2755
|
]), a;
|
|
2756
|
-
},
|
|
2757
|
-
function
|
|
2758
|
-
return
|
|
2756
|
+
}, li = "admin:full", ui = (e, t) => e.includes("admin:full") ? !0 : (typeof t == "string" ? [t] : t).every((t) => e.includes(t)), di = (e, t) => t.length === 0 || e.includes("admin:full") ? !0 : t.some((t) => e.includes(t)), fi = N({ scopes: [] });
|
|
2757
|
+
function pi(e) {
|
|
2758
|
+
return P(fi.Provider, { value: { scopes: e.scopes } }, e.children);
|
|
2759
2759
|
}
|
|
2760
|
-
var
|
|
2760
|
+
var mi = () => I(fi), hi = (e) => ui(mi().scopes, e), gi = (e) => di(mi().scopes, e), _i = (e) => `${e.replace(/\/$/, "")}/_voltro/inspect/manifest`, vi = (e) => {
|
|
2761
2761
|
let { inspectBaseUrl: t } = K(e), [n, r] = B({
|
|
2762
2762
|
manifest: void 0,
|
|
2763
2763
|
loading: !0,
|
|
@@ -2769,7 +2769,7 @@ var fi = () => be(ui), pi = (e) => ci(fi().scopes, e), mi = (e) => li(fi().scope
|
|
|
2769
2769
|
manifest: void 0,
|
|
2770
2770
|
loading: !0,
|
|
2771
2771
|
error: void 0
|
|
2772
|
-
}), fetch(
|
|
2772
|
+
}), fetch(_i(t ?? "")).then(async (e) => {
|
|
2773
2773
|
if (!e.ok) throw Error(`manifest fetch failed: HTTP ${e.status}`);
|
|
2774
2774
|
return await e.json();
|
|
2775
2775
|
}).then((t) => {
|
|
@@ -2788,7 +2788,7 @@ var fi = () => be(ui), pi = (e) => ci(fi().scopes, e), mi = (e) => li(fi().scope
|
|
|
2788
2788
|
e = !0;
|
|
2789
2789
|
};
|
|
2790
2790
|
}, [e, t]), n;
|
|
2791
|
-
},
|
|
2791
|
+
}, yi = (e, t) => t.scope.length === 0 || (t.mode === "any" ? t.scope.some((t) => e.includes(t)) : t.scope.every((t) => e.includes(t))), bi = (e, t) => {
|
|
2792
2792
|
if (e === void 0) return "unknown";
|
|
2793
2793
|
if (t.includes("admin:full") || e.length === 0) return "allowed";
|
|
2794
2794
|
let n = !1;
|
|
@@ -2797,7 +2797,7 @@ var fi = () => be(ui), pi = (e) => ci(fi().scopes, e), mi = (e) => li(fi().scope
|
|
|
2797
2797
|
n = !0;
|
|
2798
2798
|
continue;
|
|
2799
2799
|
}
|
|
2800
|
-
if (!
|
|
2800
|
+
if (!yi(t, r)) {
|
|
2801
2801
|
if (r.resourceScoped) {
|
|
2802
2802
|
n = !0;
|
|
2803
2803
|
continue;
|
|
@@ -2806,13 +2806,13 @@ var fi = () => be(ui), pi = (e) => ci(fi().scopes, e), mi = (e) => li(fi().scope
|
|
|
2806
2806
|
}
|
|
2807
2807
|
}
|
|
2808
2808
|
return n ? "unknown" : "allowed";
|
|
2809
|
-
},
|
|
2809
|
+
}, xi = (e) => (e ?? []).flatMap((e) => e.kind === "scope" ? [...e.scope] : []), Si = (e) => {
|
|
2810
2810
|
for (let t of e ?? []) if (t.kind === "open") return t.reason;
|
|
2811
|
-
},
|
|
2811
|
+
}, Ci = (e) => bi(e, mi().scopes), wi = (e, t) => Array.isArray(e) ? e.includes(t) : e === t, Ti = (e, t, n) => e.targets?.some((e) => e.table === t && e.op === n) ?? !1, Ei = (e) => e === void 0 ? {} : {
|
|
2812
2812
|
tag: e.tag,
|
|
2813
2813
|
...e.guards === void 0 ? {} : { guards: e.guards }
|
|
2814
|
-
},
|
|
2815
|
-
let n = e.procedures.find((e) => e.kind === "query" &&
|
|
2814
|
+
}, Di = (e) => e.tables.filter((e) => !e.framework).map((t) => {
|
|
2815
|
+
let n = e.procedures.find((e) => e.kind === "query" && wi(e.source, t.name)), r = e.procedures.find((e) => e.kind === "mutation" && Ti(e, t.name, "insert")), i = e.procedures.find((e) => e.kind === "mutation" && Ti(e, t.name, "update")), a = e.procedures.find((e) => e.kind === "mutation" && Ti(e, t.name, "delete")), o = t.pkColumn ?? (t.columns.some((e) => e.name === "id") ? "id" : void 0);
|
|
2816
2816
|
return {
|
|
2817
2817
|
table: t.name,
|
|
2818
2818
|
columns: t.columns.filter((e) => e.serverOnly !== !0),
|
|
@@ -2821,18 +2821,18 @@ var fi = () => be(ui), pi = (e) => ci(fi().scopes, e), mi = (e) => li(fi().scope
|
|
|
2821
2821
|
reactive: t.reactive,
|
|
2822
2822
|
...o === void 0 ? {} : { pkColumn: o },
|
|
2823
2823
|
editable: (t.editable ?? !0) && o !== void 0,
|
|
2824
|
-
list:
|
|
2825
|
-
create:
|
|
2826
|
-
update:
|
|
2827
|
-
delete:
|
|
2824
|
+
list: Ei(n),
|
|
2825
|
+
create: Ei(r),
|
|
2826
|
+
update: Ei(i),
|
|
2827
|
+
delete: Ei(a)
|
|
2828
2828
|
};
|
|
2829
|
-
}),
|
|
2830
|
-
let [t, n] = B([]), [r, i] = B([]), a =
|
|
2829
|
+
}), Oi = (e) => {
|
|
2830
|
+
let [t, n] = B([]), [r, i] = B([]), a = F((e) => {
|
|
2831
2831
|
n((t) => [...t, e]), i([]);
|
|
2832
|
-
}, []), o =
|
|
2832
|
+
}, []), o = F(async () => {
|
|
2833
2833
|
let r = t[t.length - 1];
|
|
2834
2834
|
r !== void 0 && r.blockedBy === void 0 && (await e.onUndo(r.invocationId), n((e) => e.slice(0, -1)), i((e) => [...e, r]));
|
|
2835
|
-
}, [t, e]), s =
|
|
2835
|
+
}, [t, e]), s = F(async () => {
|
|
2836
2836
|
let t = r[r.length - 1];
|
|
2837
2837
|
t !== void 0 && (await e.onRedo(t.invocationId), i((e) => e.slice(0, -1)), n((e) => [...e, t]));
|
|
2838
2838
|
}, [r, e]);
|
|
@@ -2854,14 +2854,14 @@ var fi = () => be(ui), pi = (e) => ci(fi().scopes, e), mi = (e) => li(fi().scope
|
|
|
2854
2854
|
o,
|
|
2855
2855
|
s
|
|
2856
2856
|
]);
|
|
2857
|
-
},
|
|
2858
|
-
let n = t?.limit, { data: r } = q(e,
|
|
2857
|
+
}, ki = "__voltro.undo.log", Ai = "__voltro.undo.apply", ji = "__voltro.undo.redo", Mi = (e, t) => {
|
|
2858
|
+
let n = t?.limit, { data: r } = q(e, ki, n === void 0 ? {} : { limit: n }), i = xn(e, Ai), a = xn(e, ji), o = r ?? [], s = o.find((e) => !e.undone && !e.crossesAction), c = o.find((e) => e.undone), l = F(async (e) => {
|
|
2859
2859
|
await i.mutate({ invocationId: e });
|
|
2860
|
-
}, [i]), u =
|
|
2860
|
+
}, [i]), u = F(async (e) => {
|
|
2861
2861
|
await a.mutate({ invocationId: e });
|
|
2862
|
-
}, [a]), d =
|
|
2862
|
+
}, [a]), d = F(async () => {
|
|
2863
2863
|
s && await l(s.id);
|
|
2864
|
-
}, [s, l]), f =
|
|
2864
|
+
}, [s, l]), f = F(async () => {
|
|
2865
2865
|
c && await u(c.id);
|
|
2866
2866
|
}, [c, u]);
|
|
2867
2867
|
return {
|
|
@@ -2874,21 +2874,21 @@ var fi = () => be(ui), pi = (e) => ci(fi().scopes, e), mi = (e) => li(fi().scope
|
|
|
2874
2874
|
undoLast: d,
|
|
2875
2875
|
redoLast: f
|
|
2876
2876
|
};
|
|
2877
|
-
},
|
|
2877
|
+
}, Ni = (e, t) => ({
|
|
2878
2878
|
name: e,
|
|
2879
2879
|
map: t
|
|
2880
|
-
}),
|
|
2880
|
+
}), Pi = (e, t) => e === void 0 ? null : typeof e == "string" ? { event: e } : e(t), Fi = /* @__PURE__ */ new Set(["onMount", "onUnmount"]), Ii = (e, t, n) => {
|
|
2881
2881
|
let r = { ...t };
|
|
2882
2882
|
for (let [i, a] of Object.entries(e.map)) {
|
|
2883
|
-
if (
|
|
2883
|
+
if (Fi.has(i) || a === void 0) continue;
|
|
2884
2884
|
let e = t[i];
|
|
2885
2885
|
r[i] = (...r) => {
|
|
2886
|
-
let i =
|
|
2886
|
+
let i = Pi(a, t);
|
|
2887
2887
|
if (i !== null && n(i), typeof e == "function") return e(...r);
|
|
2888
2888
|
};
|
|
2889
2889
|
}
|
|
2890
2890
|
return r;
|
|
2891
|
-
},
|
|
2891
|
+
}, Li = (e, t, n) => {
|
|
2892
2892
|
let r = z({
|
|
2893
2893
|
spec: e,
|
|
2894
2894
|
props: t,
|
|
@@ -2899,46 +2899,46 @@ var fi = () => be(ui), pi = (e) => ci(fi().scopes, e), mi = (e) => li(fi().scope
|
|
|
2899
2899
|
props: t,
|
|
2900
2900
|
sink: n
|
|
2901
2901
|
}, L(() => {
|
|
2902
|
-
let e = r.current, t =
|
|
2902
|
+
let e = r.current, t = Pi(e.spec.map.onMount, e.props);
|
|
2903
2903
|
return t !== null && e.sink(t), () => {
|
|
2904
|
-
let e = r.current, t =
|
|
2904
|
+
let e = r.current, t = Pi(e.spec.map.onUnmount, e.props);
|
|
2905
2905
|
t !== null && e.sink(t);
|
|
2906
2906
|
};
|
|
2907
|
-
}, []), R(() =>
|
|
2907
|
+
}, []), R(() => Ii(e, t, n), [
|
|
2908
2908
|
e,
|
|
2909
2909
|
t,
|
|
2910
2910
|
n
|
|
2911
2911
|
]);
|
|
2912
|
-
},
|
|
2912
|
+
}, Ri = (e, t) => {
|
|
2913
2913
|
let n = K(e).descriptors[t]?.input;
|
|
2914
|
-
return R(() => n === void 0 ? [] :
|
|
2915
|
-
},
|
|
2914
|
+
return R(() => n === void 0 ? [] : ve(n), [n]);
|
|
2915
|
+
}, zi = (e, t) => {
|
|
2916
2916
|
let n = K(e).descriptors[t]?.output;
|
|
2917
2917
|
return R(() => n === void 0 ? [] : k(n), [n]);
|
|
2918
|
-
},
|
|
2918
|
+
}, Bi = (e, t) => {
|
|
2919
2919
|
if (e === t) return !0;
|
|
2920
2920
|
if (e.length !== t.length) return !1;
|
|
2921
2921
|
for (let n = 0; n < e.length; n += 1) if (!Object.is(e[n], t[n])) return !1;
|
|
2922
2922
|
return !0;
|
|
2923
|
-
},
|
|
2924
|
-
let n = z(null), r =
|
|
2925
|
-
return (n.current === null || !
|
|
2923
|
+
}, Vi = (e) => Object.keys(e).sort().map((t) => e[t]), Hi = (e, t) => {
|
|
2924
|
+
let n = z(null), r = Vi(e);
|
|
2925
|
+
return (n.current === null || !Bi(n.current.key, r)) && (n.current = {
|
|
2926
2926
|
key: r,
|
|
2927
2927
|
value: t(e)
|
|
2928
2928
|
}), n.current.value;
|
|
2929
|
-
},
|
|
2929
|
+
}, Ui = (e, t, n, r = {}) => {
|
|
2930
2930
|
let i = q(e, t, { ...n }, r);
|
|
2931
2931
|
return R(() => ({
|
|
2932
2932
|
allowed: i.data?.allowed === !0,
|
|
2933
2933
|
pending: i.data === void 0
|
|
2934
2934
|
}), [i.data]);
|
|
2935
|
-
},
|
|
2935
|
+
}, Wi = (e, t, n, r = {}) => {
|
|
2936
2936
|
let i = q(e, t, { ...n }, r);
|
|
2937
2937
|
return R(() => ({
|
|
2938
2938
|
allowedIds: new Set(i.data?.allowedIds ?? []),
|
|
2939
2939
|
pending: i.data === void 0
|
|
2940
2940
|
}), [i.data]);
|
|
2941
|
-
},
|
|
2941
|
+
}, Gi = (e) => {
|
|
2942
2942
|
switch (e) {
|
|
2943
2943
|
case "select":
|
|
2944
2944
|
case "radio":
|
|
@@ -2954,26 +2954,26 @@ var fi = () => be(ui), pi = (e) => ci(fi().scopes, e), mi = (e) => li(fi().scope
|
|
|
2954
2954
|
case "switch": return "boolean";
|
|
2955
2955
|
default: return null;
|
|
2956
2956
|
}
|
|
2957
|
-
},
|
|
2957
|
+
}, Ki = (e) => ve(e).map((e) => {
|
|
2958
2958
|
if (e.name.includes(".")) return null;
|
|
2959
|
-
let t =
|
|
2959
|
+
let t = Gi(e.widget);
|
|
2960
2960
|
return t === null ? null : {
|
|
2961
2961
|
name: e.name,
|
|
2962
2962
|
label: e.label,
|
|
2963
2963
|
kind: t,
|
|
2964
2964
|
...e.options ? { options: e.options } : {}
|
|
2965
2965
|
};
|
|
2966
|
-
}).filter((e) => e !== null),
|
|
2966
|
+
}).filter((e) => e !== null), qi = (e) => {
|
|
2967
2967
|
let t = {};
|
|
2968
2968
|
for (let [n, r] of Object.entries(e)) r === void 0 || r === "" || Array.isArray(r) && r.length === 0 || (t[n] = r);
|
|
2969
2969
|
return t;
|
|
2970
|
-
},
|
|
2971
|
-
let r = K(e).descriptors[t]?.input, i = R(() => r === void 0 ? [] :
|
|
2972
|
-
o((n) =>
|
|
2970
|
+
}, Ji = (e, t, n = {}) => {
|
|
2971
|
+
let r = K(e).descriptors[t]?.input, i = R(() => r === void 0 ? [] : Ki(r), [r]), [a, o] = B(n.initial ?? {}), s = F((e, t) => {
|
|
2972
|
+
o((n) => qi({
|
|
2973
2973
|
...n,
|
|
2974
2974
|
[e]: t
|
|
2975
2975
|
}));
|
|
2976
|
-
}, []), c =
|
|
2976
|
+
}, []), c = F(() => o({}), []), l = q(e, t, R(() => qi(a), [a]));
|
|
2977
2977
|
return {
|
|
2978
2978
|
filters: i,
|
|
2979
2979
|
values: a,
|
|
@@ -2984,20 +2984,20 @@ var fi = () => be(ui), pi = (e) => ci(fi().scopes, e), mi = (e) => li(fi().scope
|
|
|
2984
2984
|
loading: l.data === void 0,
|
|
2985
2985
|
error: l.error
|
|
2986
2986
|
};
|
|
2987
|
-
},
|
|
2987
|
+
}, Yi = (e, t, n = {}) => {
|
|
2988
2988
|
let r = q(e, t, n), i = r.data;
|
|
2989
2989
|
return {
|
|
2990
2990
|
record: Array.isArray(i) ? i[0] : i,
|
|
2991
2991
|
loading: i === void 0,
|
|
2992
2992
|
error: r.error
|
|
2993
2993
|
};
|
|
2994
|
-
},
|
|
2994
|
+
}, Xi = (e, t = 300) => {
|
|
2995
2995
|
let [n, r] = B(e);
|
|
2996
2996
|
return L(() => {
|
|
2997
2997
|
let n = setTimeout(() => r(e), t);
|
|
2998
2998
|
return () => clearTimeout(n);
|
|
2999
2999
|
}, [e, t]), n;
|
|
3000
|
-
},
|
|
3000
|
+
}, Zi = (e) => {
|
|
3001
3001
|
let { value: t, debouncedValue: n, data: r, interpret: i, skipEmpty: a = !0 } = e;
|
|
3002
3002
|
if (a && t.trim() === "") return {
|
|
3003
3003
|
status: "idle",
|
|
@@ -3015,19 +3015,19 @@ var fi = () => be(ui), pi = (e) => ci(fi().scopes, e), mi = (e) => li(fi().scope
|
|
|
3015
3015
|
valid: o.valid,
|
|
3016
3016
|
message: o.message
|
|
3017
3017
|
};
|
|
3018
|
-
},
|
|
3019
|
-
let { input: i, interpret: a, debounceMs: o = 300, skipEmpty: s = !0 } = r, c =
|
|
3020
|
-
return
|
|
3018
|
+
}, Qi = (e, t, n, r) => {
|
|
3019
|
+
let { input: i, interpret: a, debounceMs: o = 300, skipEmpty: s = !0 } = r, c = Xi(n, o), l = s && c.trim() === "", u = q(e, t, R(() => i ? i(c) : { value: c }, [i, c]), { skip: l });
|
|
3020
|
+
return Zi({
|
|
3021
3021
|
value: n,
|
|
3022
3022
|
debouncedValue: c,
|
|
3023
3023
|
data: l ? null : u.data,
|
|
3024
3024
|
interpret: a,
|
|
3025
3025
|
skipEmpty: s
|
|
3026
3026
|
});
|
|
3027
|
-
},
|
|
3027
|
+
}, $i = (e, t) => ({
|
|
3028
3028
|
name: e,
|
|
3029
3029
|
payload: t
|
|
3030
|
-
}),
|
|
3030
|
+
}), ea = (e, t) => {
|
|
3031
3031
|
let n = Oe.decodeUnknownEither(e.payload, { errors: "all" })(t);
|
|
3032
3032
|
if (n._tag === "Right") return {
|
|
3033
3033
|
valid: !0,
|
|
@@ -3039,15 +3039,15 @@ var fi = () => be(ui), pi = (e) => ci(fi().scopes, e), mi = (e) => li(fi().scope
|
|
|
3039
3039
|
valid: !1,
|
|
3040
3040
|
errors: r
|
|
3041
3041
|
};
|
|
3042
|
-
},
|
|
3042
|
+
}, ta = (e) => {
|
|
3043
3043
|
let t = new Map(e.map((e) => [e.name, e]));
|
|
3044
3044
|
return {
|
|
3045
3045
|
names: [...t.keys()].sort(),
|
|
3046
3046
|
get: (e) => t.get(e),
|
|
3047
3047
|
events: e
|
|
3048
3048
|
};
|
|
3049
|
-
},
|
|
3050
|
-
let n =
|
|
3049
|
+
}, na = (e, t) => {
|
|
3050
|
+
let n = ta(e);
|
|
3051
3051
|
return {
|
|
3052
3052
|
track: (e, r) => {
|
|
3053
3053
|
let i = n.get(e);
|
|
@@ -3056,7 +3056,7 @@ var fi = () => be(ui), pi = (e) => ci(fi().scopes, e), mi = (e) => li(fi().scope
|
|
|
3056
3056
|
return;
|
|
3057
3057
|
}
|
|
3058
3058
|
if (process.env.NODE_ENV !== "production") {
|
|
3059
|
-
let t =
|
|
3059
|
+
let t = ea(i, r);
|
|
3060
3060
|
t.valid || console.error(`[@voltro/client] analytics.track('${e}'): payload failed its schema`, t.errors);
|
|
3061
3061
|
}
|
|
3062
3062
|
t({
|
|
@@ -3067,47 +3067,47 @@ var fi = () => be(ui), pi = (e) => ci(fi().scopes, e), mi = (e) => li(fi().scope
|
|
|
3067
3067
|
names: n.names,
|
|
3068
3068
|
catalog: n
|
|
3069
3069
|
};
|
|
3070
|
-
},
|
|
3070
|
+
}, ra = (e, t) => {
|
|
3071
3071
|
let n = En(e, t);
|
|
3072
3072
|
return {
|
|
3073
|
-
preview:
|
|
3073
|
+
preview: F((e) => n.run(e), [n]),
|
|
3074
3074
|
diff: n.lastResult,
|
|
3075
3075
|
pending: n.pending,
|
|
3076
3076
|
error: n.error
|
|
3077
3077
|
};
|
|
3078
|
-
},
|
|
3078
|
+
}, ia = (e, t, n, r) => [...e, {
|
|
3079
3079
|
id: t,
|
|
3080
3080
|
tag: n,
|
|
3081
3081
|
input: r,
|
|
3082
3082
|
status: "pending",
|
|
3083
3083
|
attempts: 0
|
|
3084
|
-
}],
|
|
3084
|
+
}], aa = (e, t, n) => e.map((e) => e.id === t ? {
|
|
3085
3085
|
...e,
|
|
3086
3086
|
...n
|
|
3087
|
-
} : e),
|
|
3087
|
+
} : e), oa = (e, t) => aa(e, t, { status: "sent" }), sa = (e, t, n) => e.map((e) => e.id === t ? {
|
|
3088
3088
|
...e,
|
|
3089
3089
|
status: "failed",
|
|
3090
3090
|
error: n,
|
|
3091
3091
|
attempts: e.attempts + 1
|
|
3092
|
-
} : e),
|
|
3092
|
+
} : e), ca = (e, t, n) => aa(e, t, {
|
|
3093
3093
|
status: "conflict",
|
|
3094
3094
|
error: n
|
|
3095
|
-
}),
|
|
3095
|
+
}), la = (e, t, n) => e.map((e) => e.id === t && e.status === "conflict" ? {
|
|
3096
3096
|
...e,
|
|
3097
3097
|
input: n,
|
|
3098
3098
|
status: "pending",
|
|
3099
3099
|
error: void 0
|
|
3100
|
-
} : e),
|
|
3100
|
+
} : e), ua = (e) => e.filter((e) => e.status !== "sent"), da = (e) => {
|
|
3101
3101
|
let t = [];
|
|
3102
3102
|
for (let n of e) {
|
|
3103
3103
|
if (n.status === "conflict") break;
|
|
3104
3104
|
(n.status === "pending" || n.status === "failed") && t.push(n);
|
|
3105
3105
|
}
|
|
3106
3106
|
return t;
|
|
3107
|
-
},
|
|
3107
|
+
}, fa = (e) => {
|
|
3108
3108
|
let t = e;
|
|
3109
3109
|
return t?.conflict === !0 || t?._tag === "UndoBoundaryError" && t?.boundary === "conflict";
|
|
3110
|
-
},
|
|
3110
|
+
}, pa = (e) => {
|
|
3111
3111
|
let [t, n] = B(e ?? (typeof navigator < "u" ? navigator.onLine : !0));
|
|
3112
3112
|
return L(() => {
|
|
3113
3113
|
if (e !== void 0) {
|
|
@@ -3120,8 +3120,8 @@ var fi = () => be(ui), pi = (e) => ci(fi().scopes, e), mi = (e) => li(fi().scope
|
|
|
3120
3120
|
window.removeEventListener("online", t), window.removeEventListener("offline", r);
|
|
3121
3121
|
};
|
|
3122
3122
|
}, [e]), t;
|
|
3123
|
-
},
|
|
3124
|
-
let { send: t, persistence: n, isConflict: r =
|
|
3123
|
+
}, ma = (e) => {
|
|
3124
|
+
let { send: t, persistence: n, isConflict: r = fa, idFor: i } = e, [a, o] = B([]), [s, c] = B(0), l = pa(e.online), u = z([]), d = F((e) => {
|
|
3125
3125
|
let t = e(u.current);
|
|
3126
3126
|
u.current = t, o(t);
|
|
3127
3127
|
}, []), f = z(t);
|
|
@@ -3144,29 +3144,29 @@ var fi = () => be(ui), pi = (e) => ci(fi().scopes, e), mi = (e) => li(fi().scope
|
|
|
3144
3144
|
e = !0;
|
|
3145
3145
|
};
|
|
3146
3146
|
}, [n, d]), L(() => {
|
|
3147
|
-
n !== void 0 && y.current && n.save(
|
|
3147
|
+
n !== void 0 && y.current && n.save(ua(a)).catch(() => {});
|
|
3148
3148
|
}, [
|
|
3149
3149
|
n,
|
|
3150
3150
|
a,
|
|
3151
3151
|
s
|
|
3152
3152
|
]);
|
|
3153
|
-
let b =
|
|
3153
|
+
let b = F((e, t) => {
|
|
3154
3154
|
let n = i?.() ?? `obx_${v.current}_${_.current++}_${e}`;
|
|
3155
|
-
d((r) =>
|
|
3156
|
-
}, [i, d]), x =
|
|
3155
|
+
d((r) => ia(r, n, e, t)), c((e) => e + 1);
|
|
3156
|
+
}, [i, d]), x = F(() => {
|
|
3157
3157
|
if (!y.current || !g.current) return Promise.resolve();
|
|
3158
3158
|
if (m.current !== void 0) return m.current;
|
|
3159
3159
|
h.current = !1;
|
|
3160
3160
|
let e = Promise.resolve().then(async () => {
|
|
3161
3161
|
for (; g.current;) {
|
|
3162
|
-
let e =
|
|
3162
|
+
let e = da(u.current)[0];
|
|
3163
3163
|
if (e === void 0) break;
|
|
3164
3164
|
try {
|
|
3165
3165
|
if (await f.current(e), !g.current) break;
|
|
3166
|
-
d((t) =>
|
|
3166
|
+
d((t) => oa(t, e.id));
|
|
3167
3167
|
} catch (t) {
|
|
3168
3168
|
if (!g.current) break;
|
|
3169
|
-
d((n) => p.current(t) ?
|
|
3169
|
+
d((n) => p.current(t) ? ca(n, e.id, t) : sa(n, e.id, t)), h.current = !0;
|
|
3170
3170
|
break;
|
|
3171
3171
|
}
|
|
3172
3172
|
}
|
|
@@ -3184,8 +3184,8 @@ var fi = () => be(ui), pi = (e) => ci(fi().scopes, e), mi = (e) => li(fi().scope
|
|
|
3184
3184
|
l,
|
|
3185
3185
|
x
|
|
3186
3186
|
]);
|
|
3187
|
-
let S =
|
|
3188
|
-
d((n) =>
|
|
3187
|
+
let S = F((e, t) => {
|
|
3188
|
+
d((n) => la(n, e, t)), l && x();
|
|
3189
3189
|
}, [
|
|
3190
3190
|
l,
|
|
3191
3191
|
x,
|
|
@@ -3200,7 +3200,7 @@ var fi = () => be(ui), pi = (e) => ci(fi().scopes, e), mi = (e) => li(fi().scope
|
|
|
3200
3200
|
conflicts: a.filter((e) => e.status === "conflict"),
|
|
3201
3201
|
resolveConflict: S
|
|
3202
3202
|
};
|
|
3203
|
-
},
|
|
3203
|
+
}, ha = (e) => {
|
|
3204
3204
|
let { scrollTop: t, viewportHeight: n, rowHeight: r, overscan: i = 5, total: a } = e, o = r > 0 ? r : 1, s = Math.max(0, Math.floor(t / o)), c = Math.ceil(n / o), l = Math.max(0, s - i), u = s + c + i, d = a === void 0 ? u : Math.min(u, a);
|
|
3205
3205
|
return {
|
|
3206
3206
|
startIndex: l,
|
|
@@ -3210,8 +3210,8 @@ var fi = () => be(ui), pi = (e) => ci(fi().scopes, e), mi = (e) => li(fi().scope
|
|
|
3210
3210
|
topSpacer: l * r,
|
|
3211
3211
|
bottomSpacer: a === void 0 ? 0 : Math.max(0, (a - d) * r)
|
|
3212
3212
|
};
|
|
3213
|
-
},
|
|
3214
|
-
let { rowHeight: r, viewportHeight: i, overscan: a, total: o, input: s } = n, [c, l] = B(0), u = R(() =>
|
|
3213
|
+
}, ga = (e, t, n) => {
|
|
3214
|
+
let { rowHeight: r, viewportHeight: i, overscan: a, total: o, input: s } = n, [c, l] = B(0), u = R(() => ha({
|
|
3215
3215
|
scrollTop: c,
|
|
3216
3216
|
viewportHeight: i,
|
|
3217
3217
|
rowHeight: r,
|
|
@@ -3231,7 +3231,7 @@ var fi = () => be(ui), pi = (e) => ci(fi().scopes, e), mi = (e) => li(fi().scope
|
|
|
3231
3231
|
s,
|
|
3232
3232
|
u.offset,
|
|
3233
3233
|
u.limit
|
|
3234
|
-
])), f =
|
|
3234
|
+
])), f = F((e) => {
|
|
3235
3235
|
l(e.currentTarget.scrollTop);
|
|
3236
3236
|
}, []);
|
|
3237
3237
|
return {
|
|
@@ -3243,10 +3243,10 @@ var fi = () => be(ui), pi = (e) => ci(fi().scopes, e), mi = (e) => li(fi().scope
|
|
|
3243
3243
|
loading: d.data === void 0,
|
|
3244
3244
|
error: d.error
|
|
3245
3245
|
};
|
|
3246
|
-
},
|
|
3246
|
+
}, _a = () => typeof navigator > "u" || navigator.onLine, va = () => !0, ya = (e) => typeof window > "u" ? () => {} : (window.addEventListener("online", e), window.addEventListener("offline", e), () => {
|
|
3247
3247
|
window.removeEventListener("online", e), window.removeEventListener("offline", e);
|
|
3248
|
-
}),
|
|
3249
|
-
let t = K(e), n = t.recovery ?? d(t.errorBus, e), r = V(n.subscribe, n.getSnapshot, n.getServerSnapshot ?? (() => _)), i = V(
|
|
3248
|
+
}), ba = (e) => {
|
|
3249
|
+
let t = K(e), n = t.recovery ?? d(t.errorBus, e), r = V(n.subscribe, n.getSnapshot, n.getServerSnapshot ?? (() => _)), i = V(ya, _a, va), a = F(() => n.reportExternalSuccess(), [n]), s = i ? r.status : "offline";
|
|
3250
3250
|
return L(() => {
|
|
3251
3251
|
o(e, "connection.status", {
|
|
3252
3252
|
status: s,
|
|
@@ -3273,7 +3273,7 @@ var fi = () => be(ui), pi = (e) => ci(fi().scopes, e), mi = (e) => li(fi().scope
|
|
|
3273
3273
|
mutationReplay: r.mutationReplay,
|
|
3274
3274
|
reportSuccess: a
|
|
3275
3275
|
};
|
|
3276
|
-
},
|
|
3276
|
+
}, xa = "__voltro.connections.list", Sa = "__voltro.connections.start", Ca = "__voltro.connections.submitToken", wa = "__voltro.connections.disconnect", Ta = {
|
|
3277
3277
|
connectionId: "",
|
|
3278
3278
|
kind: "oauth2",
|
|
3279
3279
|
label: "",
|
|
@@ -3284,14 +3284,14 @@ var fi = () => be(ui), pi = (e) => ci(fi().scopes, e), mi = (e) => li(fi().scope
|
|
|
3284
3284
|
expiresAt: null,
|
|
3285
3285
|
lastError: null,
|
|
3286
3286
|
connectedAt: null
|
|
3287
|
-
},
|
|
3287
|
+
}, Ea = (e, t) => {
|
|
3288
3288
|
if (t === "redirect") {
|
|
3289
3289
|
globalThis.location.assign(e);
|
|
3290
3290
|
return;
|
|
3291
3291
|
}
|
|
3292
3292
|
globalThis.open(e, "voltro-connect", "width=620,height=760,menubar=no,toolbar=no") === null && globalThis.location.assign(e);
|
|
3293
|
-
},
|
|
3294
|
-
let { data: t } = q(e,
|
|
3293
|
+
}, Da = (e) => {
|
|
3294
|
+
let { data: t } = q(e, xa, {}), n = En(e, Sa), r = xn(e, Ca), i = xn(e, wa), a = t ?? [], o = n.pending || r.pending || i.pending, s = F((e) => ({
|
|
3295
3295
|
...e,
|
|
3296
3296
|
connected: e.status === "connected",
|
|
3297
3297
|
needsAttention: e.status === "expired" || e.status === "revoked" || e.status === "error",
|
|
@@ -3299,7 +3299,7 @@ var fi = () => be(ui), pi = (e) => ci(fi().scopes, e), mi = (e) => li(fi().scope
|
|
|
3299
3299
|
connect: async (t) => {
|
|
3300
3300
|
if (e.kind !== "oauth2") throw Error(`connection "${e.connectionId}" is a personal-access-token connection — call submitToken(token), not connect().`);
|
|
3301
3301
|
let r = t?.redirectTo ?? `${globalThis.location.pathname}${globalThis.location.search}`;
|
|
3302
|
-
|
|
3302
|
+
Ea((await n.run({
|
|
3303
3303
|
connectionId: e.connectionId,
|
|
3304
3304
|
redirectTo: r
|
|
3305
3305
|
})).authorizeUrl, t?.mode);
|
|
@@ -3319,7 +3319,7 @@ var fi = () => be(ui), pi = (e) => ci(fi().scopes, e), mi = (e) => li(fi().scope
|
|
|
3319
3319
|
n,
|
|
3320
3320
|
r,
|
|
3321
3321
|
i
|
|
3322
|
-
]), c =
|
|
3322
|
+
]), c = F((e) => {
|
|
3323
3323
|
let t = a.find((t) => t.connectionId === e);
|
|
3324
3324
|
return t === void 0 ? void 0 : s(t);
|
|
3325
3325
|
}, [a, s]);
|
|
@@ -3329,10 +3329,10 @@ var fi = () => be(ui), pi = (e) => ci(fi().scopes, e), mi = (e) => li(fi().scope
|
|
|
3329
3329
|
get: c,
|
|
3330
3330
|
pending: o
|
|
3331
3331
|
};
|
|
3332
|
-
},
|
|
3333
|
-
let n =
|
|
3332
|
+
}, Oa = (e, t) => {
|
|
3333
|
+
let n = Da(e), r = n.get(t);
|
|
3334
3334
|
return R(() => r === void 0 ? {
|
|
3335
|
-
...
|
|
3335
|
+
...Ta,
|
|
3336
3336
|
connectionId: t,
|
|
3337
3337
|
label: t,
|
|
3338
3338
|
connected: !1,
|
|
@@ -3357,6 +3357,6 @@ var fi = () => be(ui), pi = (e) => ci(fi().scopes, e), mi = (e) => li(fi().scope
|
|
|
3357
3357
|
n.loading,
|
|
3358
3358
|
n.pending
|
|
3359
3359
|
]);
|
|
3360
|
-
},
|
|
3360
|
+
}, ka = "framework-client";
|
|
3361
3361
|
//#endregion
|
|
3362
|
-
export {
|
|
3362
|
+
export { li as ADMIN_SCOPE, ka as CLIENT_NAME, xa as CONNECTIONS_LIST_TAG, wa as CONNECTION_DISCONNECT_TAG, Sa as CONNECTION_START_TAG, Ca as CONNECTION_SUBMIT_TOKEN_TAG, ge as FORM_FLASH_SCRIPT_ID, de as FORM_KEY_FIELD, me as FORM_PATH_PREFIX, ce as FORM_REDIRECT_FIELD, zn as FormBindingProvider, Le as FrameworkRuntimesContext, $e as FrameworkRuntimesProvider, _ as INITIAL_RECOVERY_SNAPSHOT, s as LoadingSubscriptionCache, ln as MutationSerialExecutionError, pi as PermissionProvider, he as RICH_TEXT_MARKS, re as RICH_TEXT_MAX_NODES, T as RecoveryCoordinator, le as RichTextDocument, x as RpcErrorBus, Qr as ServerRequestContext, ei as ServerRequestProvider, E as SubscriptionCache, Ai as UNDO_APPLY_TAG, ki as UNDO_LOG_TAG, ji as UNDO_REDO_TAG, On as ValidationMessagesProvider, Xe as _resetFrameworkRuntimesWarning, Ge as _resetSsrDescriptors, nr as applyPreloadSeeds, Bt as applyStoreSeeds, b as buildApiRuntime, ui as canCall, di as canCallAny, ee as clearClientDiagnostics, Qt as clearMutations, ua as clearSent, bt as clearStoreHistory, a as clientDiagnosticsSnapshot, ha as computeWindow, na as createAnalytics, Jn as createHooks, bi as decideAccess, oe as decodeFieldIssues, $i as defineEvent, Ft as defineStore, Ni as defineTracking, Pt as definedStores, Di as deriveEntityAdmins, t as disableClientDiagnosticsPersistence, j as documentLocale, _e as emptyRichTextDocument, D as enableClientDiagnosticsPersistence, ia as enqueueEntry, ta as eventCatalog, Ki as filtersFromSchema, te as formActionPath, fe as formDataToInput, ye as formField, A as formSections, sn as freshIdempotencyKey, gn as getMutationNotifier, Xt as getMutations, Zr as globalContext, ie as isRichTextDocument, ae as isSafeHref, w as isUnauthenticated, Qe as isUnresolvedApi, Yn as makePreloadSeedBag, Lt as makeStoreSeedBag, _i as manifestUrl, ca as markConflict, sa as markFailed, oa as markSent, Si as openAccessReason, pe as parseRichText, si as provenanceUrl, v as publishClientError, g as publishClientTrace, ir as readPreloadedSeedOutcome, rr as readPreloadedSnapshot, o as recordClientDiagnostic, d as recoveryCoordinatorFor, Ue as registerSsrDescriptors, da as replayable, m as reportClientError, xi as requiredScopes, ar as resetPreloadSeeds, It as resetStoreRegistryForTests, at as resetStoreStorageForTest, h as resolveByTag, la as resolveConflictEntry, f as resolveRecoveryOptions, it as resolveStoreStorage, Pi as resolveTrackingEvent, M as resolveValidationMessage, be as restrictToSchema, Lr as resumableConsumeProgram, ue as richTextToPlainText, ni as rowsToOptions, dr as runSequence, k as schemaToColumns, ve as schemaToFields, er as seedPreloadedSubscription, tr as seedPreloadedSubscriptionFailure, zt as seedStore, ur as sequence, se as serializeRichText, hn as setMutationNotifier, Zn as setPreloadSeedResolver, Rt as setStoreSeedResolver, rt as setStoreStorage, X as settleMutation, ot as shallow, Bi as shallowArrayEqual, Vi as sourceValues, ze as ssrClientProxy, We as ssrDescriptorsFor, Ke as ssrStubHandle, O as stableKey, c as startApiSupervisor, Yt as startMutation, vt as storeHistory, r as subscribeClientDiagnostics, p as subscribeClientErrors, e as subscribeClientTraces, Zt as subscribeMutations, yt as subscribeStoreHistory, l as supersedesConfirmedPatches, xt as travelToStoreState, Ci as useAccessDecision, En as useAction, Ur as useAgent, Hr as useAgentChat, Ir as useAgentStream, Qi as useAsyncValidation, hi as useCan, gi as useCanAny, vi as useCapabilityManifest, Oa as useConnection, Kn as useConnectionSetup, ba as useConnectionStatus, Da as useConnections, Wr as useDataCopilot, ai as useDataTable, Xi as useDebounced, Hi as useDerived, lr as useEvent, In as useFormBinding, Bn as useFormBindingContext, Vn as useFormField, ti as useFormFlash, Ri as useFormSkeleton, K as useFrameworkApi, Ze as useFrameworkRuntimes, xn as useMutation, Jr as useOnRawRpcError, qr as useOnRpcError, ma as useOutbox, mi as usePermissions, or as usePreloadedSubscription, ra as usePreview, ci as useProvenance, ri as useQueryField, Ji as useQueryFilters, Yi as useRecord, Kr as useRefreshSubscription, Gr as useRefreshSubscriptions, Ui as useResourceCan, Wi as useResourceCans, zr as useResumableAgentStream, Ln as useSchemaFormBinding, fr as useSequence, $r as useServerRequest, q as useSubscription, Xr as useSubscriptionHealth, zi as useTableSkeleton, Li as useTracking, yr as useTranscription, Oi as useUndo, Mi as useUndoLog, vr as useUpload, kn as useValidationMessages, ga as useWindowedSubscription, br as useWorkflow, Or as useWorkflowDomainEvents, kr as useWorkflowEventDeliveries, Dr as useWorkflowEvents, Cr as useWorkflowRun, Er as useWorkflowRunEvents, Fr as useWorkflowRunState, Tr as useWorkflowRunSteps, wr as useWorkflowRuns, xr as useWorkflowSignal, Sr as useWorkflowUpdate, ea as validateEventPayload, ne as validateFields, Zi as validationStatus, y as wireAuthRefresh, cn as withIdempotencyKey, C as withProtocolOpenRecovery, Ii as wrapTrackedCallbacks };
|