@engenty/wizards 0.9.6 → 0.9.8
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/openui/index.d.ts +2318 -2317
- package/dist/openui/index.js +805 -779
- package/dist/openui/index.js.map +1 -1
- package/dist/plugin/index.d.ts +2 -2
- package/dist/plugin/studio.d.ts +1 -1
- package/package.json +1 -1
package/dist/openui/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { WIZARD_COMPONENT as e, WIZARD_DESCRIPTION as t, WizardSpec as n, addWizard as r, loadWizards as i, wizardProps as a, wizardRules as o } from "./server.js";
|
|
2
|
-
import { ArrowDown as s, ArrowLeft as c, ArrowRight as l, ArrowUp as u, Bell as d, BellRing as f, Braces as p, Camera as m, Check as h, ChevronRight as g, Clock as _, Copy as v, CornerDownLeft as y, Database as b, Download as x, Eraser as S, ExternalLink as C, FileAudio as w, FileText as T, Film as ee, Flashlight as te, FlashlightOff as ne, GripVertical as re, ImagePlus as E, ImageUp as
|
|
2
|
+
import { ArrowDown as s, ArrowLeft as c, ArrowRight as l, ArrowUp as u, Bell as d, BellRing as f, Braces as p, Camera as m, Check as h, ChevronRight as g, Clock as _, Copy as v, CornerDownLeft as y, Database as b, Download as x, Eraser as S, ExternalLink as C, FileAudio as w, FileText as T, Film as ee, Flashlight as te, FlashlightOff as ne, GripVertical as re, ImagePlus as E, ImageUp as D, Languages as O, Lightbulb as k, Link2 as ie, LocateFixed as ae, LockKeyhole as oe, MapPin as se, Maximize2 as ce, Mic as le, MoreVertical as ue, MousePointerClick as de, Paperclip as fe, PenLine as pe, Pencil as me, PencilLine as he, Plus as ge, Printer as _e, RefreshCw as ve, RotateCcw as ye, ScanLine as be, Share as xe, Share2 as Se, ShieldCheck as Ce, Sparkles as we, Square as Te, SwitchCamera as Ee, Trash2 as De, TriangleAlert as Oe, Unplug as ke, Video as Ae, X as je } from "lucide-react";
|
|
3
3
|
import { forwardRef as Me, useCallback as Ne, useEffect as A, useId as Pe, useLayoutEffect as Fe, useMemo as Ie, useRef as j, useState as M, useSyncExternalStore as Le } from "react";
|
|
4
4
|
import { z as N } from "zod";
|
|
5
5
|
import { Fragment as P, jsx as F, jsxs as I } from "react/jsx-runtime";
|
|
@@ -593,9 +593,9 @@ var tn = [
|
|
|
593
593
|
"code"
|
|
594
594
|
], nn = /^[a-z][a-z0-9-]{0,39}$/, rn = /^[a-z][a-z0-9_]{0,39}$/, an = [
|
|
595
595
|
"classifier",
|
|
596
|
+
"low",
|
|
596
597
|
"standard",
|
|
597
|
-
"high"
|
|
598
|
-
"highest"
|
|
598
|
+
"high"
|
|
599
599
|
];
|
|
600
600
|
[...an];
|
|
601
601
|
var on = [
|
|
@@ -894,9 +894,34 @@ var In = N.object({
|
|
|
894
894
|
policy: N.record(N.string(), N.enum(["allow", "ask"])).optional(),
|
|
895
895
|
title: N.string().optional(),
|
|
896
896
|
description: N.string().optional()
|
|
897
|
-
})
|
|
898
|
-
|
|
899
|
-
|
|
897
|
+
}), Rn = {
|
|
898
|
+
standard: "low",
|
|
899
|
+
high: "standard",
|
|
900
|
+
highest: "high"
|
|
901
|
+
};
|
|
902
|
+
function zn(e, t = 1) {
|
|
903
|
+
if (!e || typeof e != "object" || Array.isArray(e)) return e;
|
|
904
|
+
let n = e, r = n.version ?? t;
|
|
905
|
+
if (r === 2) return n.version === void 0 ? {
|
|
906
|
+
...n,
|
|
907
|
+
version: r
|
|
908
|
+
} : n;
|
|
909
|
+
if (r !== 1) return e;
|
|
910
|
+
let i = Array.isArray(n.steps) ? n.steps.map((e) => {
|
|
911
|
+
let t = e?.model;
|
|
912
|
+
return typeof t == "string" && Rn[t] ? {
|
|
913
|
+
...e,
|
|
914
|
+
model: Rn[t]
|
|
915
|
+
} : e;
|
|
916
|
+
}) : n.steps;
|
|
917
|
+
return {
|
|
918
|
+
...n,
|
|
919
|
+
version: 2,
|
|
920
|
+
steps: i
|
|
921
|
+
};
|
|
922
|
+
}
|
|
923
|
+
var Bn = N.object({
|
|
924
|
+
version: N.literal(2).default(2),
|
|
900
925
|
title: N.string().min(1),
|
|
901
926
|
description: N.string().default(""),
|
|
902
927
|
avatar: N.enum(Gt).default("round"),
|
|
@@ -908,17 +933,18 @@ N.object({
|
|
|
908
933
|
themes: N.array(N.string().regex(qt)).max(8).optional(),
|
|
909
934
|
steps: N.array(Nn).min(1)
|
|
910
935
|
});
|
|
911
|
-
|
|
936
|
+
N.preprocess((e) => zn(e), Bn);
|
|
937
|
+
function Vn(e) {
|
|
912
938
|
return e == null || e === "" || Array.isArray(e) && e.length === 0;
|
|
913
939
|
}
|
|
914
|
-
function
|
|
940
|
+
function Hn(e) {
|
|
915
941
|
return e === void 0 ? [] : Array.isArray(e) ? e : [e];
|
|
916
942
|
}
|
|
917
|
-
function
|
|
943
|
+
function Un(e, t) {
|
|
918
944
|
let n = t[e.field];
|
|
919
945
|
switch (e.op) {
|
|
920
|
-
case "empty": return
|
|
921
|
-
case "notEmpty": return !
|
|
946
|
+
case "empty": return Vn(n);
|
|
947
|
+
case "notEmpty": return !Vn(n);
|
|
922
948
|
case "equals": return String(n) === String(e.value);
|
|
923
949
|
case "notEquals": return String(n) !== String(e.value);
|
|
924
950
|
case "in": return Array.isArray(e.value) && e.value.map(String).includes(String(n));
|
|
@@ -930,23 +956,23 @@ function Bn(e, t) {
|
|
|
930
956
|
case "contains": return Array.isArray(n) ? n.map(String).includes(String(e.value)) : typeof n == "string" && e.value !== void 0 && n.toLowerCase().includes(String(e.value).toLowerCase());
|
|
931
957
|
}
|
|
932
958
|
}
|
|
933
|
-
function
|
|
934
|
-
return
|
|
959
|
+
function Wn(e, t) {
|
|
960
|
+
return Hn(e).every((e) => Un(e, t));
|
|
935
961
|
}
|
|
936
|
-
function
|
|
962
|
+
function Gn(e) {
|
|
937
963
|
return !!(e.ask || e.group);
|
|
938
964
|
}
|
|
939
|
-
function
|
|
965
|
+
function Kn(e, t, n) {
|
|
940
966
|
let r = {
|
|
941
967
|
...t,
|
|
942
968
|
...n
|
|
943
969
|
}, i = [];
|
|
944
|
-
for (let t of e)
|
|
970
|
+
for (let t of e) Wn(t.when, r) ? i.push(t) : delete r[t.id];
|
|
945
971
|
return i;
|
|
946
972
|
}
|
|
947
|
-
var
|
|
948
|
-
function
|
|
949
|
-
let t =
|
|
973
|
+
var qn = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2})(?:\.\d+)?)?(Z|[+-]\d{2}:\d{2})$/;
|
|
974
|
+
function Jn(e) {
|
|
975
|
+
let t = qn.exec(e.trim());
|
|
950
976
|
if (!t) return null;
|
|
951
977
|
let [, n, r, i, a, o] = t.map(Number), s = new Date(Date.UTC(n, r - 1, i, a, o));
|
|
952
978
|
return s.getUTCMonth() !== r - 1 || s.getUTCDate() !== i || a > 23 || o > 59 || !Number.isFinite(Date.parse(e)) ? null : {
|
|
@@ -955,8 +981,8 @@ function Gn(e) {
|
|
|
955
981
|
wall: s
|
|
956
982
|
};
|
|
957
983
|
}
|
|
958
|
-
function
|
|
959
|
-
let n =
|
|
984
|
+
function Yn(e, t = "en") {
|
|
985
|
+
let n = Jn(e);
|
|
960
986
|
if (!n) return e;
|
|
961
987
|
let r = Zt(t);
|
|
962
988
|
return `${n.wall.toLocaleDateString(r, {
|
|
@@ -968,63 +994,63 @@ function Kn(e, t = "en") {
|
|
|
968
994
|
timeZone: "UTC"
|
|
969
995
|
})}`;
|
|
970
996
|
}
|
|
971
|
-
function
|
|
997
|
+
function Xn(e, t, n) {
|
|
972
998
|
let r = Array.isArray(t) ? t : [], i = (e.columns ?? []).filter((e) => e.kind !== "text"), a = r.map((e) => {
|
|
973
|
-
let t = i.length ? i.reduce((t, n) => t *
|
|
999
|
+
let t = i.length ? i.reduce((t, n) => t * Zn(e[n.id]), 1) : 0;
|
|
974
1000
|
return {
|
|
975
1001
|
...e,
|
|
976
|
-
amount:
|
|
1002
|
+
amount: Qn(t)
|
|
977
1003
|
};
|
|
978
|
-
}), o =
|
|
1004
|
+
}), o = Qn(a.reduce((e, t) => e + t.amount, 0)), s = e.vat?.rate ?? 0;
|
|
979
1005
|
if (e.vat?.field) {
|
|
980
1006
|
let t = n[e.vat.field], r = yt(t, { units: !0 });
|
|
981
1007
|
r !== null && (s = r);
|
|
982
1008
|
}
|
|
983
|
-
let c =
|
|
1009
|
+
let c = Qn(o * s / 100);
|
|
984
1010
|
return {
|
|
985
1011
|
rows: a,
|
|
986
1012
|
net: o,
|
|
987
1013
|
vatRate: s,
|
|
988
1014
|
vat: c,
|
|
989
|
-
gross:
|
|
1015
|
+
gross: Qn(o + c),
|
|
990
1016
|
currency: e.currency ?? "EUR"
|
|
991
1017
|
};
|
|
992
1018
|
}
|
|
993
|
-
function
|
|
1019
|
+
function Zn(e) {
|
|
994
1020
|
return yt(e) ?? 0;
|
|
995
1021
|
}
|
|
996
|
-
function
|
|
1022
|
+
function Qn(e) {
|
|
997
1023
|
return Math.round(e * 100) / 100;
|
|
998
1024
|
}
|
|
999
1025
|
//#endregion
|
|
1000
1026
|
//#region ../shared/src/texts.ts
|
|
1001
|
-
var
|
|
1002
|
-
function
|
|
1003
|
-
let t =
|
|
1004
|
-
return t || (t = new Intl.PluralRules(Zt(e)),
|
|
1027
|
+
var $n = /* @__PURE__ */ new Map();
|
|
1028
|
+
function er(e) {
|
|
1029
|
+
let t = $n.get(e);
|
|
1030
|
+
return t || (t = new Intl.PluralRules(Zt(e)), $n.set(e, t)), t;
|
|
1005
1031
|
}
|
|
1006
|
-
function
|
|
1007
|
-
return typeof e == "string" ? e : typeof n == "number" ? e[
|
|
1032
|
+
function tr(e, t, n) {
|
|
1033
|
+
return typeof e == "string" ? e : typeof n == "number" ? e[er(t).select(n)] ?? e.other : e.other;
|
|
1008
1034
|
}
|
|
1009
|
-
function
|
|
1010
|
-
return typeof e == "number" ? e.toLocaleString(Zt(t)) : Array.isArray(e) ? e.map((e) =>
|
|
1035
|
+
function nr(e, t) {
|
|
1036
|
+
return typeof e == "number" ? e.toLocaleString(Zt(t)) : Array.isArray(e) ? e.map((e) => nr(e, t)).join(", ") : e;
|
|
1011
1037
|
}
|
|
1012
|
-
function
|
|
1038
|
+
function rr(e, t, n) {
|
|
1013
1039
|
return e.replace(/\{(\w+)\}/g, (e, r) => {
|
|
1014
1040
|
let i = n?.[r];
|
|
1015
|
-
return i === void 0 ? e :
|
|
1041
|
+
return i === void 0 ? e : nr(i, t);
|
|
1016
1042
|
});
|
|
1017
1043
|
}
|
|
1018
|
-
function
|
|
1044
|
+
function ir(e, t, n, r) {
|
|
1019
1045
|
let i = e[n][t] ?? e.en[t];
|
|
1020
|
-
return i === void 0 ? t :
|
|
1046
|
+
return i === void 0 ? t : rr(tr(i, n, r?.count ?? r?.n), n, r);
|
|
1021
1047
|
}
|
|
1022
|
-
function
|
|
1023
|
-
return
|
|
1048
|
+
function ar(e, t, n) {
|
|
1049
|
+
return rr(tr(e, t, n?.count ?? n?.n), t, n);
|
|
1024
1050
|
}
|
|
1025
1051
|
//#endregion
|
|
1026
1052
|
//#region ../shared/src/run.ts
|
|
1027
|
-
var
|
|
1053
|
+
var or = {
|
|
1028
1054
|
entry: "Entry {n} of {total}",
|
|
1029
1055
|
deciding: "Deciding what to do next…",
|
|
1030
1056
|
choosingFields: "Choosing the right questions…",
|
|
@@ -1209,7 +1235,7 @@ var rr = {
|
|
|
1209
1235
|
},
|
|
1210
1236
|
twoEntriesSameKey: "Two entries have the same key.",
|
|
1211
1237
|
pageSlugInvalid: "A page address holds lower-case letters a–z, digits and hyphens.",
|
|
1212
|
-
pageSlugTaken: "Another space of your
|
|
1238
|
+
pageSlugTaken: "Another space of your organization has this address.",
|
|
1213
1239
|
pageTaken: "The page is already at “{space}”.",
|
|
1214
1240
|
notDeleteLastSpace: "You can’t delete the last space.",
|
|
1215
1241
|
notFound: "This doesn’t exist or was deleted.",
|
|
@@ -1261,7 +1287,7 @@ var rr = {
|
|
|
1261
1287
|
pageNeedsTitle: "A page needs a title.",
|
|
1262
1288
|
unknownSpace: "There’s no space “{space}”.",
|
|
1263
1289
|
noParentPage: "There’s no page with the key “{parent}” to put this page under.",
|
|
1264
|
-
|
|
1290
|
+
onlyOrganizationAdmins: "Only organization admins can do that. As a member, you can edit the wizards that already exist.",
|
|
1265
1291
|
spaceEditedLocally: "You edit this space in engenty wizards on your computer, not here.",
|
|
1266
1292
|
wizardsRunOncePublished: "Wizards run here once you publish them in engenty wizards on your computer. You build and edit them there.",
|
|
1267
1293
|
logoImagePngSvg: "A logo is an image (PNG, SVG, JPEG, WebP).",
|
|
@@ -1332,8 +1358,8 @@ var rr = {
|
|
|
1332
1358
|
makesVideos: "videos",
|
|
1333
1359
|
makesSpeech: "speech",
|
|
1334
1360
|
makesVoiceNotes: "voice notes"
|
|
1335
|
-
},
|
|
1336
|
-
en:
|
|
1361
|
+
}, sr = {
|
|
1362
|
+
en: or,
|
|
1337
1363
|
de: {
|
|
1338
1364
|
entry: "Eintrag {n} von {total}",
|
|
1339
1365
|
deciding: "Entscheidet, wie es weitergeht …",
|
|
@@ -1519,7 +1545,7 @@ var rr = {
|
|
|
1519
1545
|
},
|
|
1520
1546
|
twoEntriesSameKey: "Zwei Einträge haben denselben Schlüssel.",
|
|
1521
1547
|
pageSlugInvalid: "Eine Seitenadresse besteht aus Kleinbuchstaben a–z, Ziffern und Bindestrichen.",
|
|
1522
|
-
pageSlugTaken: "Ein anderer Space
|
|
1548
|
+
pageSlugTaken: "Ein anderer Space deiner Organisation hat diese Adresse.",
|
|
1523
1549
|
pageTaken: "Die Seite ist schon bei „{space}“.",
|
|
1524
1550
|
notDeleteLastSpace: "Der letzte Space lässt sich nicht löschen.",
|
|
1525
1551
|
notFound: "Das gibt es nicht oder nicht mehr.",
|
|
@@ -1571,7 +1597,7 @@ var rr = {
|
|
|
1571
1597
|
pageNeedsTitle: "Eine Seite braucht einen Titel.",
|
|
1572
1598
|
unknownSpace: "Den Space „{space}“ gibt es nicht.",
|
|
1573
1599
|
noParentPage: "Es gibt keine Seite mit dem Schlüssel „{parent}“, unter die diese Seite könnte.",
|
|
1574
|
-
|
|
1600
|
+
onlyOrganizationAdmins: "Das dürfen nur Admins der Organisation. Als Mitglied bearbeitest du die Wizards, die es schon gibt.",
|
|
1575
1601
|
spaceEditedLocally: "Diesen Space bearbeitest du in engenty wizards auf deinem Computer, nicht hier.",
|
|
1576
1602
|
wizardsRunOncePublished: "Hier laufen die Wizards, die du in engenty wizards auf deinem Computer veröffentlichst. Gebaut und bearbeitet wird dort.",
|
|
1577
1603
|
logoImagePngSvg: "Ein Logo ist ein Bild (PNG, SVG, JPEG, WebP).",
|
|
@@ -1638,17 +1664,17 @@ var rr = {
|
|
|
1638
1664
|
makesVoiceNotes: "Sprachnotizen"
|
|
1639
1665
|
}
|
|
1640
1666
|
};
|
|
1641
|
-
function
|
|
1642
|
-
return Array.isArray(e) ? e.map((e) =>
|
|
1667
|
+
function cr(e, t, n) {
|
|
1668
|
+
return Array.isArray(e) ? e.map((e) => cr(e, t, n)) : typeof e == "object" && e && "code" in e ? lr(e, t, n) : e;
|
|
1643
1669
|
}
|
|
1644
|
-
function
|
|
1645
|
-
if (!(e.code in
|
|
1670
|
+
function lr(e, t, n) {
|
|
1671
|
+
if (!(e.code in or)) return "";
|
|
1646
1672
|
let r = {};
|
|
1647
|
-
for (let [i, a] of Object.entries(e.params ?? {})) r[i] = a === void 0 ? void 0 :
|
|
1673
|
+
for (let [i, a] of Object.entries(e.params ?? {})) r[i] = a === void 0 ? void 0 : cr(a, t, n);
|
|
1648
1674
|
let i = n?.[e.code];
|
|
1649
|
-
return i === void 0 ?
|
|
1675
|
+
return i === void 0 ? ir(sr, e.code, Xt(t) ? t : "en", r) : ar(i, t, r);
|
|
1650
1676
|
}
|
|
1651
|
-
var
|
|
1677
|
+
var ur = {
|
|
1652
1678
|
en: {
|
|
1653
1679
|
"result.translate": "Translate",
|
|
1654
1680
|
"translation.working": "Translating…",
|
|
@@ -2185,47 +2211,47 @@ var sr = {
|
|
|
2185
2211
|
"video.you": "Du",
|
|
2186
2212
|
"nav.language": "Sprache"
|
|
2187
2213
|
}
|
|
2188
|
-
}, B = "en",
|
|
2189
|
-
function
|
|
2190
|
-
|
|
2191
|
-
for (let e of
|
|
2214
|
+
}, B = "en", dr = null, fr = 0, pr = /* @__PURE__ */ new Set();
|
|
2215
|
+
function mr() {
|
|
2216
|
+
fr += 1;
|
|
2217
|
+
for (let e of pr) e();
|
|
2192
2218
|
}
|
|
2193
|
-
function
|
|
2194
|
-
e !== B && (B = e,
|
|
2219
|
+
function hr(e) {
|
|
2220
|
+
e !== B && (B = e, mr());
|
|
2195
2221
|
}
|
|
2196
|
-
function
|
|
2197
|
-
return
|
|
2222
|
+
function gr() {
|
|
2223
|
+
return dr?.lang ?? B;
|
|
2198
2224
|
}
|
|
2199
|
-
function
|
|
2200
|
-
return e.note &&
|
|
2225
|
+
function _r(e) {
|
|
2226
|
+
return e.note && lr(e.note, gr(), dr?.notes) || e.message;
|
|
2201
2227
|
}
|
|
2202
|
-
var
|
|
2203
|
-
function
|
|
2204
|
-
|
|
2228
|
+
var vr = {};
|
|
2229
|
+
function yr(e) {
|
|
2230
|
+
vr = e ?? {};
|
|
2205
2231
|
}
|
|
2206
|
-
function
|
|
2207
|
-
return
|
|
2232
|
+
function br(e) {
|
|
2233
|
+
return vr[e] ?? e;
|
|
2208
2234
|
}
|
|
2209
2235
|
function V(e, t) {
|
|
2210
|
-
return
|
|
2236
|
+
return dr?.runner[e], ir(ur, e, B, t);
|
|
2211
2237
|
}
|
|
2212
2238
|
//#endregion
|
|
2213
2239
|
//#region ../runner/src/api.ts
|
|
2214
|
-
var
|
|
2240
|
+
var xr = class extends Error {
|
|
2215
2241
|
status;
|
|
2216
2242
|
body;
|
|
2217
2243
|
constructor(e, t, n) {
|
|
2218
2244
|
super(e), this.status = t, this.body = n;
|
|
2219
2245
|
}
|
|
2220
2246
|
};
|
|
2221
|
-
function
|
|
2247
|
+
function Sr(e) {
|
|
2222
2248
|
try {
|
|
2223
2249
|
return JSON.parse(e);
|
|
2224
2250
|
} catch {
|
|
2225
2251
|
return { error: e };
|
|
2226
2252
|
}
|
|
2227
2253
|
}
|
|
2228
|
-
function
|
|
2254
|
+
function Cr(e, t = {}, n) {
|
|
2229
2255
|
async function r(r, i, a) {
|
|
2230
2256
|
let o = await fetch(e(i), {
|
|
2231
2257
|
method: r,
|
|
@@ -2237,9 +2263,9 @@ function br(e, t = {}, n) {
|
|
|
2237
2263
|
},
|
|
2238
2264
|
body: a === void 0 ? void 0 : a instanceof FormData ? a : JSON.stringify(a)
|
|
2239
2265
|
}).catch(() => {
|
|
2240
|
-
throw new
|
|
2241
|
-
}), s = await o.text(), c = s ?
|
|
2242
|
-
if (!o.ok) throw o.status >= 500 && n?.(`${r} ${i} answered ${o.status}: ${c?.error ?? ""}`), new
|
|
2266
|
+
throw new xr(V("common.offline"), 0, null);
|
|
2267
|
+
}), s = await o.text(), c = s ? Sr(s) : null;
|
|
2268
|
+
if (!o.ok) throw o.status >= 500 && n?.(`${r} ${i} answered ${o.status}: ${c?.error ?? ""}`), new xr(c?.error ?? c?.message ?? o.statusText, o.status, c);
|
|
2243
2269
|
return c;
|
|
2244
2270
|
}
|
|
2245
2271
|
return {
|
|
@@ -2256,26 +2282,26 @@ function br(e, t = {}, n) {
|
|
|
2256
2282
|
}
|
|
2257
2283
|
//#endregion
|
|
2258
2284
|
//#region ../runner/src/env.ts
|
|
2259
|
-
var
|
|
2285
|
+
var wr = {
|
|
2260
2286
|
can: () => !1,
|
|
2261
2287
|
call: (e) => Promise.reject(/* @__PURE__ */ Error(`the app cannot ${e}`)),
|
|
2262
2288
|
tell: () => void 0,
|
|
2263
2289
|
download: () => !1
|
|
2264
|
-
},
|
|
2265
|
-
function
|
|
2266
|
-
|
|
2290
|
+
}, Tr = null;
|
|
2291
|
+
function Er(e) {
|
|
2292
|
+
Tr = e, U = Cr(e.withBase, e.headers, e.onServerError), hr(e.lang);
|
|
2267
2293
|
}
|
|
2268
2294
|
function H() {
|
|
2269
|
-
if (!
|
|
2270
|
-
return
|
|
2295
|
+
if (!Tr) throw Error("configureRunner() first");
|
|
2296
|
+
return Tr;
|
|
2271
2297
|
}
|
|
2272
|
-
var U =
|
|
2298
|
+
var U = Cr((e) => e), W = (e) => H().withBase(e), Dr = (e) => H().asset(e), G = (e) => H().runBase(e), K = (e) => (Tr?.app ?? wr).can(e), Or = (e, t) => (Tr?.app ?? wr).call(e, t), kr = (e, t) => (Tr?.app ?? wr).tell(e, t), Ar = (e, t, n) => (Tr?.app ?? wr).download(e, t, n), jr = () => Tr?.standalone === !0;
|
|
2273
2299
|
//#endregion
|
|
2274
2300
|
//#region ../runner/src/ui.tsx
|
|
2275
2301
|
function q(...e) {
|
|
2276
2302
|
return e.filter(Boolean).join(" ");
|
|
2277
2303
|
}
|
|
2278
|
-
var
|
|
2304
|
+
var Mr = {
|
|
2279
2305
|
primary: "bg-primary text-primary-foreground hover:brightness-[1.06] active:brightness-95 shadow-[0_1px_0_oklch(0%_0_0/0.08)]",
|
|
2280
2306
|
secondary: "bg-card text-ink border border-border hover:bg-paper-2",
|
|
2281
2307
|
ghost: "text-ink-2 hover:text-ink hover:bg-accent",
|
|
@@ -2287,9 +2313,9 @@ var kr = {
|
|
|
2287
2313
|
type: "button",
|
|
2288
2314
|
"data-variant": e,
|
|
2289
2315
|
disabled: a || n,
|
|
2290
|
-
className: q("inline-flex select-none items-center justify-center gap-2 whitespace-nowrap rounded-full font-medium transition-[background,filter,color,transform] duration-150 active:scale-[0.98] disabled:pointer-events-none disabled:opacity-50", t === "sm" && "h-8 px-3 text-[0.8125rem] coarse:h-11 coarse:px-4", t === "md" && "h-10 px-4 text-sm coarse:h-11", t === "lg" && "h-12 px-6 text-[0.9375rem]",
|
|
2316
|
+
className: q("inline-flex select-none items-center justify-center gap-2 whitespace-nowrap rounded-full font-medium transition-[background,filter,color,transform] duration-150 active:scale-[0.98] disabled:pointer-events-none disabled:opacity-50", t === "sm" && "h-8 px-3 text-[0.8125rem] coarse:h-11 coarse:px-4", t === "md" && "h-10 px-4 text-sm coarse:h-11", t === "lg" && "h-12 px-6 text-[0.9375rem]", Mr[e], e === "primary" && "wizard-button", r),
|
|
2291
2317
|
...o,
|
|
2292
|
-
children: [n ? /* @__PURE__ */ F(
|
|
2318
|
+
children: [n ? /* @__PURE__ */ F(Ur, { className: "size-4" }) : null, i]
|
|
2293
2319
|
});
|
|
2294
2320
|
});
|
|
2295
2321
|
function Y({ label: e, className: t, children: n, ...r }) {
|
|
@@ -2302,25 +2328,25 @@ function Y({ label: e, className: t, children: n, ...r }) {
|
|
|
2302
2328
|
children: n
|
|
2303
2329
|
});
|
|
2304
2330
|
}
|
|
2305
|
-
var
|
|
2306
|
-
function
|
|
2331
|
+
var Nr = "wizard-field rounded-lg border border-input bg-card px-3.5 text-[0.9375rem] text-ink shadow-[inset_0_1px_0_oklch(0%_0_0/0.02)] outline-none transition placeholder:text-ink-4 focus:border-focus focus:ring-4 focus:ring-focus-glow disabled:opacity-60";
|
|
2332
|
+
function Pr(e) {
|
|
2307
2333
|
return /(^|\s)w-/.test(e ?? "") ? null : "w-full";
|
|
2308
2334
|
}
|
|
2309
2335
|
var X = Me(function({ className: e, ...t }, n) {
|
|
2310
2336
|
return /* @__PURE__ */ F("input", {
|
|
2311
2337
|
ref: n,
|
|
2312
|
-
className: q(
|
|
2338
|
+
className: q(Nr, Pr(e), "h-11", e),
|
|
2313
2339
|
...t
|
|
2314
2340
|
});
|
|
2315
2341
|
});
|
|
2316
|
-
function
|
|
2342
|
+
function Fr(e) {
|
|
2317
2343
|
return /* @__PURE__ */ F("input", {
|
|
2318
2344
|
type: "color",
|
|
2319
2345
|
className: "swatch size-11 shrink-0 cursor-pointer rounded-lg border border-input bg-card p-1",
|
|
2320
2346
|
...e
|
|
2321
2347
|
});
|
|
2322
2348
|
}
|
|
2323
|
-
var
|
|
2349
|
+
var Ir = Me(function({ className: e, minRows: t = 3, maxRows: n = 14, onChange: r, ...i }, a) {
|
|
2324
2350
|
let o = j(null), s = () => {
|
|
2325
2351
|
let e = o.current;
|
|
2326
2352
|
if (!e) return;
|
|
@@ -2333,20 +2359,20 @@ var Nr = Me(function({ className: e, minRows: t = 3, maxRows: n = 14, onChange:
|
|
|
2333
2359
|
ref: (e) => {
|
|
2334
2360
|
o.current = e, typeof a == "function" ? a(e) : a && (a.current = e);
|
|
2335
2361
|
},
|
|
2336
|
-
className: q(
|
|
2362
|
+
className: q(Nr, Pr(e), "resize-none py-2.5 leading-[1.5]", e),
|
|
2337
2363
|
onChange: (e) => {
|
|
2338
2364
|
s(), r?.(e);
|
|
2339
2365
|
},
|
|
2340
2366
|
...i
|
|
2341
2367
|
});
|
|
2342
2368
|
});
|
|
2343
|
-
function
|
|
2369
|
+
function Lr({ value: e, onChange: t, options: n, className: r, placeholder: i }) {
|
|
2344
2370
|
return /* @__PURE__ */ I("div", {
|
|
2345
2371
|
className: q("relative", r),
|
|
2346
2372
|
children: [/* @__PURE__ */ I("select", {
|
|
2347
2373
|
value: e,
|
|
2348
2374
|
onChange: (e) => t(e.target.value),
|
|
2349
|
-
className: q(
|
|
2375
|
+
className: q(Nr, "h-11 w-full appearance-none pr-9"),
|
|
2350
2376
|
children: [i === void 0 ? null : /* @__PURE__ */ F("option", {
|
|
2351
2377
|
value: "",
|
|
2352
2378
|
children: i
|
|
@@ -2368,7 +2394,7 @@ function Pr({ value: e, onChange: t, options: n, className: r, placeholder: i })
|
|
|
2368
2394
|
})]
|
|
2369
2395
|
});
|
|
2370
2396
|
}
|
|
2371
|
-
function
|
|
2397
|
+
function Rr({ value: e, onChange: t, options: n, multi: r, disabled: i, label: a }) {
|
|
2372
2398
|
let o = new Set(Array.isArray(e) ? e : e ? [e] : []);
|
|
2373
2399
|
return /* @__PURE__ */ F("div", {
|
|
2374
2400
|
className: "flex flex-wrap gap-2",
|
|
@@ -2390,8 +2416,8 @@ function Fr({ value: e, onChange: t, options: n, multi: r, disabled: i, label: a
|
|
|
2390
2416
|
})
|
|
2391
2417
|
});
|
|
2392
2418
|
}
|
|
2393
|
-
var
|
|
2394
|
-
function
|
|
2419
|
+
var zr = "cubic-bezier(0.3, 0.7, 0.2, 1)";
|
|
2420
|
+
function Br({ value: e, onChange: t, options: n, label: r }) {
|
|
2395
2421
|
let i = j(/* @__PURE__ */ new Map()), [a, o] = M(null);
|
|
2396
2422
|
return Fe(() => {
|
|
2397
2423
|
let t = i.current.get(e);
|
|
@@ -2413,7 +2439,7 @@ function Lr({ value: e, onChange: t, options: n, label: r }) {
|
|
|
2413
2439
|
style: {
|
|
2414
2440
|
width: a.w,
|
|
2415
2441
|
transform: `translateX(${a.x}px)`,
|
|
2416
|
-
transition: `transform 300ms ${
|
|
2442
|
+
transition: `transform 300ms ${zr}, width 300ms ${zr}`
|
|
2417
2443
|
}
|
|
2418
2444
|
}) : null, n.map((n) => {
|
|
2419
2445
|
let r = n.id === e;
|
|
@@ -2431,7 +2457,7 @@ function Lr({ value: e, onChange: t, options: n, label: r }) {
|
|
|
2431
2457
|
})]
|
|
2432
2458
|
});
|
|
2433
2459
|
}
|
|
2434
|
-
function
|
|
2460
|
+
function Vr({ checked: e, onChange: t, label: n, disabled: r }) {
|
|
2435
2461
|
return /* @__PURE__ */ F("button", {
|
|
2436
2462
|
type: "button",
|
|
2437
2463
|
role: "switch",
|
|
@@ -2443,7 +2469,7 @@ function Rr({ checked: e, onChange: t, label: n, disabled: r }) {
|
|
|
2443
2469
|
children: /* @__PURE__ */ F("span", { className: q("inline-block size-5 rounded-full bg-white shadow-sm transition-transform", e ? "translate-x-[22px]" : "translate-x-[2px]") })
|
|
2444
2470
|
});
|
|
2445
2471
|
}
|
|
2446
|
-
function
|
|
2472
|
+
function Hr({ children: e, hint: t, required: n }) {
|
|
2447
2473
|
return /* @__PURE__ */ I("div", {
|
|
2448
2474
|
className: "mb-2",
|
|
2449
2475
|
children: [/* @__PURE__ */ I("div", {
|
|
@@ -2458,7 +2484,7 @@ function zr({ children: e, hint: t, required: n }) {
|
|
|
2458
2484
|
}) : null]
|
|
2459
2485
|
});
|
|
2460
2486
|
}
|
|
2461
|
-
function
|
|
2487
|
+
function Ur({ className: e }) {
|
|
2462
2488
|
return /* @__PURE__ */ I("svg", {
|
|
2463
2489
|
className: q("size-5 animate-spin", e),
|
|
2464
2490
|
viewBox: "0 0 24 24",
|
|
@@ -2478,14 +2504,14 @@ function Br({ className: e }) {
|
|
|
2478
2504
|
})]
|
|
2479
2505
|
});
|
|
2480
2506
|
}
|
|
2481
|
-
function
|
|
2507
|
+
function Wr({ className: e, children: t, ...n }) {
|
|
2482
2508
|
return /* @__PURE__ */ F("div", {
|
|
2483
2509
|
className: q("wizard-card rounded-xl bg-card shadow-soft ring-1 ring-border-soft", e),
|
|
2484
2510
|
...n,
|
|
2485
2511
|
children: t
|
|
2486
2512
|
});
|
|
2487
2513
|
}
|
|
2488
|
-
function
|
|
2514
|
+
function Gr({ open: e, onClose: t, title: n, children: r, wide: i, bare: a, height: o = "auto" }) {
|
|
2489
2515
|
let s = j(null);
|
|
2490
2516
|
return A(() => {
|
|
2491
2517
|
let t = s.current;
|
|
@@ -2538,7 +2564,7 @@ function Hr({ open: e, onClose: t, title: n, children: r, wide: i, bare: a, heig
|
|
|
2538
2564
|
}) : null
|
|
2539
2565
|
});
|
|
2540
2566
|
}
|
|
2541
|
-
function
|
|
2567
|
+
function Kr({ text: e }) {
|
|
2542
2568
|
return e.split(/(https?:\/\/[^\s)]+)/).map((e, t) => t % 2 ? /* @__PURE__ */ F("a", {
|
|
2543
2569
|
href: e,
|
|
2544
2570
|
target: "_blank",
|
|
@@ -2549,8 +2575,8 @@ function Ur({ text: e }) {
|
|
|
2549
2575
|
}
|
|
2550
2576
|
//#endregion
|
|
2551
2577
|
//#region ../runner/src/browser-live.tsx
|
|
2552
|
-
var
|
|
2553
|
-
function
|
|
2578
|
+
var qr = 250;
|
|
2579
|
+
function Jr({ runId: e, driving: t, caption: n, action: r, hint: i, className: a, onBroken: o }) {
|
|
2554
2580
|
let c = j(null), l = j(null), [d, f] = M(""), [p, m] = M(!1), [h, g] = M(null), _ = async (t) => {
|
|
2555
2581
|
g(null);
|
|
2556
2582
|
try {
|
|
@@ -2575,7 +2601,7 @@ function Gr({ runId: e, driving: t, caption: n, action: r, hint: i, className: a
|
|
|
2575
2601
|
type: "scroll",
|
|
2576
2602
|
dy: t
|
|
2577
2603
|
}).catch(() => void 0);
|
|
2578
|
-
},
|
|
2604
|
+
}, qr);
|
|
2579
2605
|
};
|
|
2580
2606
|
return n.addEventListener("wheel", a, { passive: !1 }), () => {
|
|
2581
2607
|
n.removeEventListener("wheel", a), i && clearTimeout(i);
|
|
@@ -2649,7 +2675,7 @@ function Gr({ runId: e, driving: t, caption: n, action: r, hint: i, className: a
|
|
|
2649
2675
|
className: q("h-9 shrink-0 rounded-md px-2.5 text-[0.75rem] coarse:h-11 coarse:px-3.5", p ? "bg-ember-veil text-ink" : "text-ink-3 hover:bg-paper-2"),
|
|
2650
2676
|
children: V("ask.hide")
|
|
2651
2677
|
}),
|
|
2652
|
-
/* @__PURE__ */ F(
|
|
2678
|
+
/* @__PURE__ */ F(Yr, {
|
|
2653
2679
|
label: "Enter",
|
|
2654
2680
|
onClick: () => void _({
|
|
2655
2681
|
type: "key",
|
|
@@ -2657,7 +2683,7 @@ function Gr({ runId: e, driving: t, caption: n, action: r, hint: i, className: a
|
|
|
2657
2683
|
}),
|
|
2658
2684
|
children: /* @__PURE__ */ F(y, { className: "size-4" })
|
|
2659
2685
|
}),
|
|
2660
|
-
/* @__PURE__ */ F(
|
|
2686
|
+
/* @__PURE__ */ F(Yr, {
|
|
2661
2687
|
label: V("ask.up"),
|
|
2662
2688
|
onClick: () => void _({
|
|
2663
2689
|
type: "scroll",
|
|
@@ -2665,7 +2691,7 @@ function Gr({ runId: e, driving: t, caption: n, action: r, hint: i, className: a
|
|
|
2665
2691
|
}),
|
|
2666
2692
|
children: /* @__PURE__ */ F(u, { className: "size-4" })
|
|
2667
2693
|
}),
|
|
2668
|
-
/* @__PURE__ */ F(
|
|
2694
|
+
/* @__PURE__ */ F(Yr, {
|
|
2669
2695
|
label: V("ask.down"),
|
|
2670
2696
|
onClick: () => void _({
|
|
2671
2697
|
type: "scroll",
|
|
@@ -2683,7 +2709,7 @@ function Gr({ runId: e, driving: t, caption: n, action: r, hint: i, className: a
|
|
|
2683
2709
|
}) : null]
|
|
2684
2710
|
});
|
|
2685
2711
|
}
|
|
2686
|
-
function
|
|
2712
|
+
function Yr({ label: e, onClick: t, children: n }) {
|
|
2687
2713
|
return /* @__PURE__ */ F("button", {
|
|
2688
2714
|
type: "button",
|
|
2689
2715
|
"aria-label": e,
|
|
@@ -2695,16 +2721,16 @@ function Kr({ label: e, onClick: t, children: n }) {
|
|
|
2695
2721
|
}
|
|
2696
2722
|
//#endregion
|
|
2697
2723
|
//#region ../runner/src/AskPanel.tsx
|
|
2698
|
-
function
|
|
2699
|
-
return t.kind === "confirm" ? /* @__PURE__ */ F(
|
|
2724
|
+
function Xr({ runId: e, ask: t }) {
|
|
2725
|
+
return t.kind === "confirm" ? /* @__PURE__ */ F(Zr, {
|
|
2700
2726
|
runId: e,
|
|
2701
2727
|
ask: t
|
|
2702
|
-
}) : /* @__PURE__ */ F(
|
|
2728
|
+
}) : /* @__PURE__ */ F(Qr, {
|
|
2703
2729
|
runId: e,
|
|
2704
2730
|
ask: t
|
|
2705
2731
|
});
|
|
2706
2732
|
}
|
|
2707
|
-
function
|
|
2733
|
+
function Zr({ runId: e, ask: t }) {
|
|
2708
2734
|
let [n, r] = M(!1), [i, a] = M(!1), [o, s] = M(null), c = async (n) => {
|
|
2709
2735
|
a(!0), s(null);
|
|
2710
2736
|
try {
|
|
@@ -2738,7 +2764,7 @@ function Jr({ runId: e, ask: t }) {
|
|
|
2738
2764
|
}),
|
|
2739
2765
|
t.once ? null : /* @__PURE__ */ I("div", {
|
|
2740
2766
|
className: "mt-5 flex items-center gap-4",
|
|
2741
|
-
children: [/* @__PURE__ */ F(
|
|
2767
|
+
children: [/* @__PURE__ */ F(Vr, {
|
|
2742
2768
|
checked: n,
|
|
2743
2769
|
onChange: r,
|
|
2744
2770
|
label: V("ask.allowRest")
|
|
@@ -2770,7 +2796,7 @@ function Jr({ runId: e, ask: t }) {
|
|
|
2770
2796
|
]
|
|
2771
2797
|
});
|
|
2772
2798
|
}
|
|
2773
|
-
function
|
|
2799
|
+
function Qr({ runId: e, ask: t }) {
|
|
2774
2800
|
let [n, r] = M({}), [i, a] = M(!1), [o, s] = M(!1), [c, l] = M(null), u = async (n) => {
|
|
2775
2801
|
s(!0), l(null);
|
|
2776
2802
|
try {
|
|
@@ -2798,7 +2824,7 @@ function Yr({ runId: e, ask: t }) {
|
|
|
2798
2824
|
})]
|
|
2799
2825
|
})]
|
|
2800
2826
|
}),
|
|
2801
|
-
/* @__PURE__ */ F(
|
|
2827
|
+
/* @__PURE__ */ F(Jr, {
|
|
2802
2828
|
runId: e,
|
|
2803
2829
|
driving: !0
|
|
2804
2830
|
}),
|
|
@@ -2815,7 +2841,7 @@ function Yr({ runId: e, ask: t }) {
|
|
|
2815
2841
|
remember: i
|
|
2816
2842
|
});
|
|
2817
2843
|
},
|
|
2818
|
-
children: [t.fields.map((e, i) => /* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F(
|
|
2844
|
+
children: [t.fields.map((e, i) => /* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F(Hr, { children: e.label }), /* @__PURE__ */ F(X, {
|
|
2819
2845
|
autoFocus: i === 0,
|
|
2820
2846
|
type: e.secret ? "password" : "text",
|
|
2821
2847
|
autoComplete: "off",
|
|
@@ -2835,7 +2861,7 @@ function Yr({ runId: e, ask: t }) {
|
|
|
2835
2861
|
}) : null,
|
|
2836
2862
|
/* @__PURE__ */ I("div", {
|
|
2837
2863
|
className: "mt-5 flex items-center justify-between gap-4",
|
|
2838
|
-
children: [/* @__PURE__ */ F(
|
|
2864
|
+
children: [/* @__PURE__ */ F(Vr, {
|
|
2839
2865
|
checked: i,
|
|
2840
2866
|
onChange: a,
|
|
2841
2867
|
label: V("ask.remember")
|
|
@@ -2897,8 +2923,8 @@ function Yr({ runId: e, ask: t }) {
|
|
|
2897
2923
|
}
|
|
2898
2924
|
//#endregion
|
|
2899
2925
|
//#region ../runner/src/device.ts
|
|
2900
|
-
var
|
|
2901
|
-
function
|
|
2926
|
+
var $r = typeof window < "u" && window.matchMedia?.("(pointer: coarse)").matches === !0, ei = typeof navigator < "u" && !!navigator.mediaDevices?.getUserMedia;
|
|
2927
|
+
function ti() {
|
|
2902
2928
|
A(() => {
|
|
2903
2929
|
let e = window.visualViewport;
|
|
2904
2930
|
if (!e) return;
|
|
@@ -2914,11 +2940,11 @@ function Qr() {
|
|
|
2914
2940
|
};
|
|
2915
2941
|
}, []);
|
|
2916
2942
|
}
|
|
2917
|
-
function
|
|
2943
|
+
function ni(e) {
|
|
2918
2944
|
let [t, n] = M(!1);
|
|
2919
2945
|
return A(() => {
|
|
2920
|
-
if (e && K("keepAwake")) return
|
|
2921
|
-
|
|
2946
|
+
if (e && K("keepAwake")) return kr("keepAwake", !0), n(!0), () => {
|
|
2947
|
+
kr("keepAwake", !1), n(!1);
|
|
2922
2948
|
};
|
|
2923
2949
|
if (!e || !("wakeLock" in navigator)) return;
|
|
2924
2950
|
let t = null, r = !1, i = async () => {
|
|
@@ -2938,56 +2964,56 @@ function $r(e) {
|
|
|
2938
2964
|
};
|
|
2939
2965
|
}, [e]), t;
|
|
2940
2966
|
}
|
|
2941
|
-
var
|
|
2942
|
-
function
|
|
2967
|
+
var ri = "wz.notify", ii = /* @__PURE__ */ new Set(), ai = null;
|
|
2968
|
+
function oi() {
|
|
2943
2969
|
try {
|
|
2944
|
-
return localStorage.getItem(
|
|
2970
|
+
return localStorage.getItem(ri) === "1";
|
|
2945
2971
|
} catch {
|
|
2946
2972
|
return !1;
|
|
2947
2973
|
}
|
|
2948
2974
|
}
|
|
2949
|
-
function
|
|
2975
|
+
function si(e) {
|
|
2950
2976
|
try {
|
|
2951
|
-
e ? localStorage.setItem(
|
|
2977
|
+
e ? localStorage.setItem(ri, "1") : localStorage.removeItem(ri);
|
|
2952
2978
|
} catch {}
|
|
2953
|
-
for (let e of
|
|
2979
|
+
for (let e of ii) e();
|
|
2954
2980
|
}
|
|
2955
|
-
var
|
|
2956
|
-
function
|
|
2957
|
-
return
|
|
2981
|
+
var ci = typeof window < "u" && "Notification" in window, li = null;
|
|
2982
|
+
function ui() {
|
|
2983
|
+
return oi() ? K("notify") ? li === !1 ? "quiet" : "on" : ci && Notification.permission === "granted" ? "on" : "quiet" : "off";
|
|
2958
2984
|
}
|
|
2959
|
-
function
|
|
2960
|
-
return Le((e) => (
|
|
2985
|
+
function di() {
|
|
2986
|
+
return Le((e) => (ii.add(e), () => ii.delete(e)), ui, () => "off");
|
|
2961
2987
|
}
|
|
2962
|
-
function
|
|
2963
|
-
return K("notify") ?
|
|
2988
|
+
function fi() {
|
|
2989
|
+
return K("notify") ? li === !1 : ci && Notification.permission === "denied";
|
|
2964
2990
|
}
|
|
2965
|
-
async function
|
|
2966
|
-
if (
|
|
2967
|
-
|
|
2968
|
-
for (let e of
|
|
2969
|
-
return
|
|
2991
|
+
async function pi() {
|
|
2992
|
+
if (si(!0), K("notify")) {
|
|
2993
|
+
li = !K("notifyPermission") || await Or("notifyPermission").catch(() => !1);
|
|
2994
|
+
for (let e of ii) e();
|
|
2995
|
+
return ui();
|
|
2970
2996
|
}
|
|
2971
2997
|
try {
|
|
2972
|
-
|
|
2998
|
+
ai ??= new AudioContext(), ai.resume();
|
|
2973
2999
|
} catch {
|
|
2974
|
-
|
|
3000
|
+
ai = null;
|
|
2975
3001
|
}
|
|
2976
|
-
if (
|
|
3002
|
+
if (ci && Notification.permission === "default") try {
|
|
2977
3003
|
await Notification.requestPermission();
|
|
2978
3004
|
} catch {}
|
|
2979
|
-
if (
|
|
3005
|
+
if (ci && Notification.permission === "granted") {
|
|
2980
3006
|
let e = H().serviceWorker;
|
|
2981
3007
|
e && await navigator.serviceWorker?.register(e).catch(() => void 0);
|
|
2982
3008
|
}
|
|
2983
|
-
for (let e of
|
|
2984
|
-
return
|
|
3009
|
+
for (let e of ii) e();
|
|
3010
|
+
return ui();
|
|
2985
3011
|
}
|
|
2986
|
-
function
|
|
2987
|
-
|
|
3012
|
+
function mi() {
|
|
3013
|
+
si(!1);
|
|
2988
3014
|
}
|
|
2989
|
-
function
|
|
2990
|
-
let e =
|
|
3015
|
+
function hi() {
|
|
3016
|
+
let e = ai;
|
|
2991
3017
|
if (e?.state !== "running") return;
|
|
2992
3018
|
let t = e.currentTime;
|
|
2993
3019
|
for (let [n, r] of [660, 880].entries()) {
|
|
@@ -2995,26 +3021,26 @@ function fi() {
|
|
|
2995
3021
|
i.frequency.value = r, a.gain.setValueAtTime(0, t + n * .16), a.gain.linearRampToValueAtTime(.18, t + n * .16 + .02), a.gain.exponentialRampToValueAtTime(.001, t + n * .16 + .32), i.connect(a).connect(e.destination), i.start(t + n * .16), i.stop(t + n * .16 + .34);
|
|
2996
3022
|
}
|
|
2997
3023
|
}
|
|
2998
|
-
async function
|
|
2999
|
-
if (!
|
|
3024
|
+
async function gi(e) {
|
|
3025
|
+
if (!oi()) return;
|
|
3000
3026
|
if (K("notify")) {
|
|
3001
|
-
|
|
3027
|
+
kr("notify", e);
|
|
3002
3028
|
return;
|
|
3003
3029
|
}
|
|
3004
3030
|
if (document.visibilityState === "visible") {
|
|
3005
|
-
|
|
3031
|
+
hi(), navigator.vibrate?.([
|
|
3006
3032
|
120,
|
|
3007
3033
|
60,
|
|
3008
3034
|
120
|
|
3009
3035
|
]);
|
|
3010
3036
|
return;
|
|
3011
3037
|
}
|
|
3012
|
-
if (!
|
|
3038
|
+
if (!ci || Notification.permission !== "granted") return;
|
|
3013
3039
|
let t = {
|
|
3014
3040
|
body: e.body,
|
|
3015
3041
|
tag: e.tag,
|
|
3016
|
-
icon:
|
|
3017
|
-
badge:
|
|
3042
|
+
icon: Dr("icons/icon-192.png"),
|
|
3043
|
+
badge: Dr("icons/icon-192.png"),
|
|
3018
3044
|
data: { url: location.href }
|
|
3019
3045
|
};
|
|
3020
3046
|
try {
|
|
@@ -3028,7 +3054,7 @@ async function pi(e) {
|
|
|
3028
3054
|
new Notification(e.title, t);
|
|
3029
3055
|
} catch {}
|
|
3030
3056
|
}
|
|
3031
|
-
function
|
|
3057
|
+
function _i() {
|
|
3032
3058
|
if (typeof navigator > "u" || !navigator.canShare) return !1;
|
|
3033
3059
|
try {
|
|
3034
3060
|
return navigator.canShare({ files: [new File(["x"], "x.pdf", { type: "application/pdf" })] });
|
|
@@ -3038,7 +3064,7 @@ function mi() {
|
|
|
3038
3064
|
}
|
|
3039
3065
|
//#endregion
|
|
3040
3066
|
//#region ../runner/src/camera.tsx
|
|
3041
|
-
async function
|
|
3067
|
+
async function vi(e, t = 2400) {
|
|
3042
3068
|
if (!/^image\/(jpeg|png|webp)$/.test(e.type) || e.size < 12e5) return e;
|
|
3043
3069
|
try {
|
|
3044
3070
|
let n = await createImageBitmap(e), r = Math.min(1, t / Math.max(n.width, n.height)), i = document.createElement("canvas");
|
|
@@ -3049,17 +3075,17 @@ async function hi(e, t = 2400) {
|
|
|
3049
3075
|
return e;
|
|
3050
3076
|
}
|
|
3051
3077
|
}
|
|
3052
|
-
function
|
|
3078
|
+
function yi() {
|
|
3053
3079
|
return (/* @__PURE__ */ new Date()).toISOString().slice(0, 19).replace(/[:T]/g, "-");
|
|
3054
3080
|
}
|
|
3055
|
-
function
|
|
3081
|
+
function bi(e) {
|
|
3056
3082
|
let t = e?.name;
|
|
3057
3083
|
return t === "NotFoundError" || t === "OverconstrainedError" ? "missing" : t === "NotReadableError" || t === "AbortError" ? "busy" : "denied";
|
|
3058
3084
|
}
|
|
3059
|
-
function
|
|
3085
|
+
function xi(e) {
|
|
3060
3086
|
return !!e?.getCapabilities?.()?.torch;
|
|
3061
3087
|
}
|
|
3062
|
-
function
|
|
3088
|
+
function Si(e, t, n = !1) {
|
|
3063
3089
|
let r = j(null), [i, a] = M(null), [o, s] = M(null), [c, l] = M(1), [u, d] = M(!1), [f, p] = M(!1);
|
|
3064
3090
|
return A(() => {
|
|
3065
3091
|
if (!e) return;
|
|
@@ -3086,11 +3112,11 @@ function yi(e, t, n = !1) {
|
|
|
3086
3112
|
return;
|
|
3087
3113
|
}
|
|
3088
3114
|
a(r);
|
|
3089
|
-
let e = r.getVideoTracks()[0], t = () => !i && d(
|
|
3115
|
+
let e = r.getVideoTracks()[0], t = () => !i && d(xi(e));
|
|
3090
3116
|
t(), setTimeout(t, 600);
|
|
3091
3117
|
let s = await navigator.mediaDevices.enumerateDevices().catch(() => []);
|
|
3092
3118
|
i || l(s.filter((e) => e.kind === "videoinput").length);
|
|
3093
|
-
})().catch((e) => !i && s(
|
|
3119
|
+
})().catch((e) => !i && s(bi(e))), () => {
|
|
3094
3120
|
i = !0;
|
|
3095
3121
|
for (let e of r?.getTracks() ?? []) e.stop();
|
|
3096
3122
|
};
|
|
@@ -3118,7 +3144,7 @@ function yi(e, t, n = !1) {
|
|
|
3118
3144
|
mirrored: i?.getVideoTracks()[0]?.getSettings().facingMode === "user"
|
|
3119
3145
|
};
|
|
3120
3146
|
}
|
|
3121
|
-
function
|
|
3147
|
+
function Ci({ open: e, onClose: t, label: n, children: r }) {
|
|
3122
3148
|
let i = j(null);
|
|
3123
3149
|
return A(() => {
|
|
3124
3150
|
let t = i.current;
|
|
@@ -3134,7 +3160,7 @@ function bi({ open: e, onClose: t, label: n, children: r }) {
|
|
|
3134
3160
|
}) : null
|
|
3135
3161
|
});
|
|
3136
3162
|
}
|
|
3137
|
-
function
|
|
3163
|
+
function wi({ label: e, onClick: t, active: n, children: r }) {
|
|
3138
3164
|
return /* @__PURE__ */ F("button", {
|
|
3139
3165
|
type: "button",
|
|
3140
3166
|
"aria-label": e,
|
|
@@ -3145,13 +3171,13 @@ function xi({ label: e, onClick: t, active: n, children: r }) {
|
|
|
3145
3171
|
children: r
|
|
3146
3172
|
});
|
|
3147
3173
|
}
|
|
3148
|
-
function
|
|
3174
|
+
function Ti({ title: e, onClose: t, camera: n, onFlip: r }) {
|
|
3149
3175
|
return /* @__PURE__ */ F("div", {
|
|
3150
3176
|
className: "safe-top",
|
|
3151
3177
|
children: /* @__PURE__ */ I("div", {
|
|
3152
3178
|
className: "flex items-center gap-2 px-3 py-2",
|
|
3153
3179
|
children: [
|
|
3154
|
-
/* @__PURE__ */ F(
|
|
3180
|
+
/* @__PURE__ */ F(wi, {
|
|
3155
3181
|
label: V("common.close"),
|
|
3156
3182
|
onClick: t,
|
|
3157
3183
|
children: /* @__PURE__ */ F(je, { className: "size-5" })
|
|
@@ -3160,13 +3186,13 @@ function Si({ title: e, onClose: t, camera: n, onFlip: r }) {
|
|
|
3160
3186
|
className: "min-w-0 flex-1 truncate text-center font-medium text-[0.9375rem]",
|
|
3161
3187
|
children: e
|
|
3162
3188
|
}),
|
|
3163
|
-
n.torchable ? /* @__PURE__ */ F(
|
|
3189
|
+
n.torchable ? /* @__PURE__ */ F(wi, {
|
|
3164
3190
|
label: V("camera.torch"),
|
|
3165
3191
|
active: n.torch,
|
|
3166
3192
|
onClick: () => void n.setTorch(!n.torch),
|
|
3167
3193
|
children: n.torch ? /* @__PURE__ */ F(te, { className: "size-5" }) : /* @__PURE__ */ F(ne, { className: "size-5" })
|
|
3168
3194
|
}) : null,
|
|
3169
|
-
n.stream && (n.cameras > 1 ||
|
|
3195
|
+
n.stream && (n.cameras > 1 || $r) ? /* @__PURE__ */ F(wi, {
|
|
3170
3196
|
label: V("camera.flip"),
|
|
3171
3197
|
onClick: r,
|
|
3172
3198
|
children: /* @__PURE__ */ F(Ee, { className: "size-5" })
|
|
@@ -3175,7 +3201,7 @@ function Si({ title: e, onClose: t, camera: n, onFlip: r }) {
|
|
|
3175
3201
|
})
|
|
3176
3202
|
});
|
|
3177
3203
|
}
|
|
3178
|
-
function
|
|
3204
|
+
function Ei({ camera: e, asking: t, children: n, actions: r }) {
|
|
3179
3205
|
return /* @__PURE__ */ I("div", {
|
|
3180
3206
|
className: "relative min-h-0 flex-1 overflow-hidden",
|
|
3181
3207
|
children: [/* @__PURE__ */ F("video", {
|
|
@@ -3192,15 +3218,15 @@ function Ci({ camera: e, asking: t, children: n, actions: r }) {
|
|
|
3192
3218
|
}), r]
|
|
3193
3219
|
}) : e.stream ? n : /* @__PURE__ */ I("div", {
|
|
3194
3220
|
className: "absolute inset-0 flex flex-col items-center justify-center gap-4 px-8 text-center text-white/75",
|
|
3195
|
-
children: [/* @__PURE__ */ F(
|
|
3221
|
+
children: [/* @__PURE__ */ F(Ur, {}), /* @__PURE__ */ F("p", {
|
|
3196
3222
|
className: "max-w-xs text-[0.875rem] leading-relaxed",
|
|
3197
3223
|
children: t
|
|
3198
3224
|
})]
|
|
3199
3225
|
})]
|
|
3200
3226
|
});
|
|
3201
3227
|
}
|
|
3202
|
-
var
|
|
3203
|
-
function
|
|
3228
|
+
var Di = 30;
|
|
3229
|
+
function Oi() {
|
|
3204
3230
|
if (typeof MediaRecorder < "u") return [
|
|
3205
3231
|
"video/mp4;codecs=avc1.42E01E,mp4a.40.2",
|
|
3206
3232
|
"video/mp4",
|
|
@@ -3209,9 +3235,9 @@ function Ti() {
|
|
|
3209
3235
|
"video/webm"
|
|
3210
3236
|
].find((e) => MediaRecorder.isTypeSupported(e));
|
|
3211
3237
|
}
|
|
3212
|
-
var
|
|
3213
|
-
function
|
|
3214
|
-
let [o, s] = M("environment"), [c, l] = M("photo"), [u, d] = M(0), [f, p] = M(!1), [g, _] = M(null), v = j(null), y =
|
|
3238
|
+
var ki = !!Oi();
|
|
3239
|
+
function Ai({ open: e, multiple: t, video: n, onClose: r, onCapture: i, onNative: a }) {
|
|
3240
|
+
let [o, s] = M("environment"), [c, l] = M("photo"), [u, d] = M(0), [f, p] = M(!1), [g, _] = M(null), v = j(null), y = Si(e, o, c === "video");
|
|
3215
3241
|
A(() => {
|
|
3216
3242
|
e && (d(0), l("photo"), _(null));
|
|
3217
3243
|
}, [e]);
|
|
@@ -3228,11 +3254,11 @@ function Di({ open: e, multiple: t, video: n, onClose: r, onCapture: i, onNative
|
|
|
3228
3254
|
let t = document.createElement("canvas");
|
|
3229
3255
|
t.width = e.videoWidth, t.height = e.videoHeight, t.getContext("2d")?.drawImage(e, 0, 0);
|
|
3230
3256
|
let n = await new Promise((e) => t.toBlob(e, "image/jpeg", .9));
|
|
3231
|
-
n && await b(new File([n], `foto-${
|
|
3257
|
+
n && await b(new File([n], `foto-${yi()}.jpg`, { type: "image/jpeg" }));
|
|
3232
3258
|
}, S = () => {
|
|
3233
3259
|
v.current?.state === "recording" && v.current.stop();
|
|
3234
3260
|
}, C = () => {
|
|
3235
|
-
let e =
|
|
3261
|
+
let e = Oi();
|
|
3236
3262
|
if (!y.stream || !e) return;
|
|
3237
3263
|
let t = [], n = new MediaRecorder(y.stream, {
|
|
3238
3264
|
mimeType: e,
|
|
@@ -3244,13 +3270,13 @@ function Di({ open: e, multiple: t, video: n, onClose: r, onCapture: i, onNative
|
|
|
3244
3270
|
let n = e.split(";")[0];
|
|
3245
3271
|
if (t.length) {
|
|
3246
3272
|
let e = n === "video/mp4" ? "mp4" : "webm";
|
|
3247
|
-
b(new File(t, `video-${
|
|
3273
|
+
b(new File(t, `video-${yi()}.${e}`, { type: n }));
|
|
3248
3274
|
}
|
|
3249
3275
|
}, v.current = n, n.start(1e3), _(0);
|
|
3250
3276
|
};
|
|
3251
3277
|
A(() => {
|
|
3252
3278
|
if (g === null) return;
|
|
3253
|
-
if (g >=
|
|
3279
|
+
if (g >= Di) {
|
|
3254
3280
|
v.current?.state === "recording" && v.current.stop();
|
|
3255
3281
|
return;
|
|
3256
3282
|
}
|
|
@@ -3260,32 +3286,32 @@ function Di({ open: e, multiple: t, video: n, onClose: r, onCapture: i, onNative
|
|
|
3260
3286
|
!e && v.current && (v.current.onstop = null, v.current.stop(), v.current = null);
|
|
3261
3287
|
}, [e]);
|
|
3262
3288
|
let w = (e) => `0:${String(e).padStart(2, "0")}`;
|
|
3263
|
-
return /* @__PURE__ */ I(
|
|
3289
|
+
return /* @__PURE__ */ I(Ci, {
|
|
3264
3290
|
open: e,
|
|
3265
3291
|
onClose: r,
|
|
3266
3292
|
label: V("camera.title"),
|
|
3267
3293
|
children: [
|
|
3268
|
-
/* @__PURE__ */ F(
|
|
3269
|
-
title: g === null ? u ? V("camera.taken", { n: u }) : V("camera.title") : `${w(g)} / ${w(
|
|
3294
|
+
/* @__PURE__ */ F(Ti, {
|
|
3295
|
+
title: g === null ? u ? V("camera.taken", { n: u }) : V("camera.title") : `${w(g)} / ${w(Di)}`,
|
|
3270
3296
|
onClose: r,
|
|
3271
3297
|
camera: y,
|
|
3272
3298
|
onFlip: () => s((e) => e === "environment" ? "user" : "environment")
|
|
3273
3299
|
}),
|
|
3274
|
-
/* @__PURE__ */ F(
|
|
3300
|
+
/* @__PURE__ */ F(Ei, {
|
|
3275
3301
|
camera: y,
|
|
3276
3302
|
asking: V("camera.asking"),
|
|
3277
3303
|
actions: /* @__PURE__ */ I("div", {
|
|
3278
3304
|
className: "flex flex-col gap-2",
|
|
3279
|
-
children: [a ? /* @__PURE__ */ I(
|
|
3305
|
+
children: [a ? /* @__PURE__ */ I(ji, {
|
|
3280
3306
|
onClick: () => {
|
|
3281
3307
|
r(), a();
|
|
3282
3308
|
},
|
|
3283
3309
|
children: [
|
|
3284
3310
|
/* @__PURE__ */ F(m, { className: "size-4" }),
|
|
3285
3311
|
" ",
|
|
3286
|
-
V(
|
|
3312
|
+
V($r ? "camera.native" : "camera.pick")
|
|
3287
3313
|
]
|
|
3288
|
-
}) : null, /* @__PURE__ */ F(
|
|
3314
|
+
}) : null, /* @__PURE__ */ F(ji, {
|
|
3289
3315
|
quiet: !0,
|
|
3290
3316
|
onClick: r,
|
|
3291
3317
|
children: V("common.close")
|
|
@@ -3294,7 +3320,7 @@ function Di({ open: e, multiple: t, video: n, onClose: r, onCapture: i, onNative
|
|
|
3294
3320
|
}),
|
|
3295
3321
|
/* @__PURE__ */ I("div", {
|
|
3296
3322
|
className: q("safe-bottom px-4 pt-3", y.error && "invisible"),
|
|
3297
|
-
children: [n &&
|
|
3323
|
+
children: [n && ki && g === null ? /* @__PURE__ */ F("div", {
|
|
3298
3324
|
className: "mb-3 flex justify-center gap-1 text-[0.8125rem]",
|
|
3299
3325
|
children: ["photo", "video"].map((e) => /* @__PURE__ */ F("button", {
|
|
3300
3326
|
type: "button",
|
|
@@ -3308,7 +3334,7 @@ function Di({ open: e, multiple: t, video: n, onClose: r, onCapture: i, onNative
|
|
|
3308
3334
|
children: [
|
|
3309
3335
|
/* @__PURE__ */ F("span", {
|
|
3310
3336
|
className: "text-[0.8125rem] text-white/70 leading-snug",
|
|
3311
|
-
children: g === null ? c === "video" ? V("camera.clipHint", { s:
|
|
3337
|
+
children: g === null ? c === "video" ? V("camera.clipHint", { s: Di }) : V(t ? "camera.hintMany" : "camera.hint") : V("camera.recording")
|
|
3312
3338
|
}),
|
|
3313
3339
|
/* @__PURE__ */ F("button", {
|
|
3314
3340
|
type: "button",
|
|
@@ -3316,14 +3342,14 @@ function Di({ open: e, multiple: t, video: n, onClose: r, onCapture: i, onNative
|
|
|
3316
3342
|
disabled: !y.stream || f,
|
|
3317
3343
|
onClick: () => c === "photo" ? void x() : g === null ? C() : S(),
|
|
3318
3344
|
className: "flex size-[72px] items-center justify-center rounded-full border-4 border-white transition active:scale-95 disabled:opacity-40",
|
|
3319
|
-
children: f ? /* @__PURE__ */ F(
|
|
3345
|
+
children: f ? /* @__PURE__ */ F(Ur, { className: "text-white" }) : c === "photo" ? /* @__PURE__ */ F("span", { className: "size-[54px] rounded-full bg-white" }) : g === null ? /* @__PURE__ */ F("span", {
|
|
3320
3346
|
className: "flex size-[54px] items-center justify-center rounded-full bg-[#e5484d]",
|
|
3321
3347
|
children: /* @__PURE__ */ F(Ae, { className: "size-6 text-white" })
|
|
3322
3348
|
}) : /* @__PURE__ */ F("span", { className: "size-7 rounded-md bg-[#e5484d]" })
|
|
3323
3349
|
}),
|
|
3324
3350
|
/* @__PURE__ */ F("div", {
|
|
3325
3351
|
className: "flex justify-end",
|
|
3326
|
-
children: t && u && g === null ? /* @__PURE__ */ I(
|
|
3352
|
+
children: t && u && g === null ? /* @__PURE__ */ I(ji, {
|
|
3327
3353
|
onClick: r,
|
|
3328
3354
|
children: [
|
|
3329
3355
|
/* @__PURE__ */ F(h, { className: "size-4" }),
|
|
@@ -3338,7 +3364,7 @@ function Di({ open: e, multiple: t, video: n, onClose: r, onCapture: i, onNative
|
|
|
3338
3364
|
]
|
|
3339
3365
|
});
|
|
3340
3366
|
}
|
|
3341
|
-
function
|
|
3367
|
+
function ji({ onClick: e, quiet: t, children: n }) {
|
|
3342
3368
|
return /* @__PURE__ */ F("button", {
|
|
3343
3369
|
type: "button",
|
|
3344
3370
|
onClick: e,
|
|
@@ -3348,54 +3374,54 @@ function Oi({ onClick: e, quiet: t, children: n }) {
|
|
|
3348
3374
|
}
|
|
3349
3375
|
//#endregion
|
|
3350
3376
|
//#region ../runner/src/data.tsx
|
|
3351
|
-
var
|
|
3352
|
-
function
|
|
3377
|
+
var Mi = "w-full min-w-0 rounded-md bg-transparent px-2 py-1.5 text-[0.875rem] outline-none transition placeholder:text-ink-4 hover:bg-accent focus:bg-paper focus:ring-1 focus:ring-ring", Ni = "font-medium text-[0.6875rem] text-ink-3 uppercase tracking-[0.08em]", Pi = (e) => !!e && typeof e == "object" && !Array.isArray(e);
|
|
3378
|
+
function Fi(e, t, n) {
|
|
3353
3379
|
if (!t.length) return n;
|
|
3354
3380
|
let [r, ...i] = t;
|
|
3355
3381
|
if (Array.isArray(e)) {
|
|
3356
3382
|
let t = [...e];
|
|
3357
|
-
return t[r] =
|
|
3383
|
+
return t[r] = Fi(t[r], i, n), t;
|
|
3358
3384
|
}
|
|
3359
3385
|
let a = e ?? {};
|
|
3360
3386
|
return {
|
|
3361
3387
|
...a,
|
|
3362
|
-
[r]:
|
|
3388
|
+
[r]: Fi(a[r], i, n)
|
|
3363
3389
|
};
|
|
3364
3390
|
}
|
|
3365
|
-
function
|
|
3366
|
-
let n = e?.length ? e : [...new Set(t.filter(
|
|
3391
|
+
function Ii(e, t) {
|
|
3392
|
+
let n = e?.length ? e : [...new Set(t.filter(Pi).flatMap((e) => Object.keys(e)))];
|
|
3367
3393
|
return {
|
|
3368
3394
|
kind: "object",
|
|
3369
3395
|
fields: Object.fromEntries(n.map((e) => [e, { kind: "text" }]))
|
|
3370
3396
|
};
|
|
3371
3397
|
}
|
|
3372
|
-
var
|
|
3373
|
-
function
|
|
3398
|
+
var Li = (e) => e.kind !== "object" && e.kind !== "table" && (e.kind !== "list" || e.of.kind !== "object") && !(e.kind === "text" && e.long), Ri = (e) => Object.values(e.fields).every(Li), zi = (e) => Object.values(e.fields).every((e) => e.kind !== "table" && (e.kind !== "list" || e.of.kind !== "object"));
|
|
3399
|
+
function Bi(e, t) {
|
|
3374
3400
|
let n = jt(e);
|
|
3375
3401
|
return n ? String(t[n] ?? "") : "";
|
|
3376
3402
|
}
|
|
3377
|
-
function
|
|
3403
|
+
function Vi({ text: e }) {
|
|
3378
3404
|
return /* @__PURE__ */ F("span", {
|
|
3379
3405
|
className: "whitespace-pre-wrap",
|
|
3380
3406
|
children: e
|
|
3381
3407
|
});
|
|
3382
3408
|
}
|
|
3383
|
-
function
|
|
3409
|
+
function Hi({ shape: e, value: t, path: n, ctx: r, cell: i }) {
|
|
3384
3410
|
switch (e.kind) {
|
|
3385
3411
|
case "text": return r.edit ? e.long ? /* @__PURE__ */ F("textarea", {
|
|
3386
|
-
className: q(
|
|
3412
|
+
className: q(Mi, "field-sizing-content max-h-60 resize-none"),
|
|
3387
3413
|
value: String(t ?? ""),
|
|
3388
3414
|
onChange: (e) => r.set(n, e.target.value)
|
|
3389
3415
|
}) : /* @__PURE__ */ F("input", {
|
|
3390
|
-
className:
|
|
3416
|
+
className: Mi,
|
|
3391
3417
|
value: String(t ?? ""),
|
|
3392
3418
|
onChange: (e) => r.set(n, e.target.value)
|
|
3393
|
-
}) : /* @__PURE__ */ F(
|
|
3419
|
+
}) : /* @__PURE__ */ F(Vi, { text: t == null ? "" : String(t) });
|
|
3394
3420
|
case "number": return r.edit ? /* @__PURE__ */ I("span", {
|
|
3395
3421
|
className: "flex items-center gap-1",
|
|
3396
3422
|
children: [/* @__PURE__ */ F("input", {
|
|
3397
3423
|
type: "number",
|
|
3398
|
-
className: q(
|
|
3424
|
+
className: q(Mi, "text-right tabular-nums", i && "w-20"),
|
|
3399
3425
|
value: t == null ? "" : Number(t),
|
|
3400
3426
|
onChange: (e) => r.set(n, e.target.value === "" ? null : Number(e.target.value))
|
|
3401
3427
|
}), e.unit ? /* @__PURE__ */ F("span", {
|
|
@@ -3423,7 +3449,7 @@ function zi({ shape: e, value: t, path: n, ctx: r, cell: i }) {
|
|
|
3423
3449
|
}
|
|
3424
3450
|
case "choice":
|
|
3425
3451
|
case "score": return r.edit ? /* @__PURE__ */ F("select", {
|
|
3426
|
-
className:
|
|
3452
|
+
className: Mi,
|
|
3427
3453
|
value: String(t ?? ""),
|
|
3428
3454
|
onChange: (e) => r.set(n, e.target.value),
|
|
3429
3455
|
children: [.../* @__PURE__ */ new Set([String(t ?? ""), ...e.options])].map((e) => /* @__PURE__ */ F("option", {
|
|
@@ -3435,9 +3461,9 @@ function zi({ shape: e, value: t, path: n, ctx: r, cell: i }) {
|
|
|
3435
3461
|
let i = r.shape.fields[e.to], a = i?.kind === "list" && i.of.kind === "object" ? i.of : {
|
|
3436
3462
|
kind: "object",
|
|
3437
3463
|
fields: {}
|
|
3438
|
-
}, o = (Array.isArray(r.root[e.to]) ? r.root[e.to] : []).filter(
|
|
3464
|
+
}, o = (Array.isArray(r.root[e.to]) ? r.root[e.to] : []).filter(Pi), s = o.find((e) => e.id === t);
|
|
3439
3465
|
return r.edit ? /* @__PURE__ */ I("select", {
|
|
3440
|
-
className:
|
|
3466
|
+
className: Mi,
|
|
3441
3467
|
value: String(t ?? ""),
|
|
3442
3468
|
onChange: (e) => r.set(n, e.target.value),
|
|
3443
3469
|
children: [s ? null : /* @__PURE__ */ F("option", {
|
|
@@ -3445,13 +3471,13 @@ function zi({ shape: e, value: t, path: n, ctx: r, cell: i }) {
|
|
|
3445
3471
|
children: String(t ?? "")
|
|
3446
3472
|
}), o.map((e) => /* @__PURE__ */ F("option", {
|
|
3447
3473
|
value: String(e.id),
|
|
3448
|
-
children:
|
|
3474
|
+
children: Bi(a, e) || String(e.id)
|
|
3449
3475
|
}, String(e.id)))]
|
|
3450
3476
|
}) : s ? /* @__PURE__ */ I("button", {
|
|
3451
3477
|
type: "button",
|
|
3452
3478
|
onClick: () => r.open(String(s.id)),
|
|
3453
3479
|
className: "inline-flex items-center gap-1 text-left text-ember-strong hover:underline",
|
|
3454
|
-
children: [/* @__PURE__ */ F(
|
|
3480
|
+
children: [/* @__PURE__ */ F(ie, { className: "size-3.5 shrink-0" }), Bi(a, s) || String(s.id)]
|
|
3455
3481
|
}) : /* @__PURE__ */ F("span", {
|
|
3456
3482
|
className: "text-rose",
|
|
3457
3483
|
children: V("data.missing", { id: String(t ?? "") })
|
|
@@ -3459,8 +3485,8 @@ function zi({ shape: e, value: t, path: n, ctx: r, cell: i }) {
|
|
|
3459
3485
|
}
|
|
3460
3486
|
case "table": {
|
|
3461
3487
|
let i = Array.isArray(t) ? t : [];
|
|
3462
|
-
return /* @__PURE__ */ F(
|
|
3463
|
-
shape:
|
|
3488
|
+
return /* @__PURE__ */ F(Ki, {
|
|
3489
|
+
shape: Ii(e.columns, i),
|
|
3464
3490
|
value: i,
|
|
3465
3491
|
path: n,
|
|
3466
3492
|
ctx: r
|
|
@@ -3468,7 +3494,7 @@ function zi({ shape: e, value: t, path: n, ctx: r, cell: i }) {
|
|
|
3468
3494
|
}
|
|
3469
3495
|
case "list":
|
|
3470
3496
|
if (e.of.kind === "object") {
|
|
3471
|
-
let i = e.of, a =
|
|
3497
|
+
let i = e.of, a = Ri(i) ? Ki : zi(i) ? qi : Ji;
|
|
3472
3498
|
return /* @__PURE__ */ F(a, {
|
|
3473
3499
|
shape: i,
|
|
3474
3500
|
value: t,
|
|
@@ -3476,12 +3502,12 @@ function zi({ shape: e, value: t, path: n, ctx: r, cell: i }) {
|
|
|
3476
3502
|
ctx: r
|
|
3477
3503
|
});
|
|
3478
3504
|
}
|
|
3479
|
-
return /* @__PURE__ */ F(
|
|
3505
|
+
return /* @__PURE__ */ F(Ui, {
|
|
3480
3506
|
value: t,
|
|
3481
3507
|
path: n,
|
|
3482
3508
|
ctx: r
|
|
3483
3509
|
});
|
|
3484
|
-
case "object": return /* @__PURE__ */ F(
|
|
3510
|
+
case "object": return /* @__PURE__ */ F(Yi, {
|
|
3485
3511
|
shape: e,
|
|
3486
3512
|
value: t,
|
|
3487
3513
|
path: n,
|
|
@@ -3489,7 +3515,7 @@ function zi({ shape: e, value: t, path: n, ctx: r, cell: i }) {
|
|
|
3489
3515
|
});
|
|
3490
3516
|
}
|
|
3491
3517
|
}
|
|
3492
|
-
function
|
|
3518
|
+
function Ui({ value: e, path: t, ctx: n }) {
|
|
3493
3519
|
let r = Array.isArray(e) ? e.map(String) : [], [i, a] = M("");
|
|
3494
3520
|
return /* @__PURE__ */ I("span", {
|
|
3495
3521
|
className: "flex flex-wrap items-center gap-1",
|
|
@@ -3513,9 +3539,9 @@ function Bi({ value: e, path: t, ctx: n }) {
|
|
|
3513
3539
|
}) : null]
|
|
3514
3540
|
});
|
|
3515
3541
|
}
|
|
3516
|
-
var
|
|
3517
|
-
function
|
|
3518
|
-
let i =
|
|
3542
|
+
var Wi = (e) => (Array.isArray(e) ? e : []).filter(Pi), Gi = (e) => e.fields.id ? { id: `n${Date.now().toString(36)}` } : {};
|
|
3543
|
+
function Ki({ shape: e, value: t, path: n, ctx: r }) {
|
|
3544
|
+
let i = Wi(t), a = Object.entries(e.fields);
|
|
3519
3545
|
return /* @__PURE__ */ I("div", {
|
|
3520
3546
|
className: "overflow-x-auto rounded-lg ring-1 ring-border-soft",
|
|
3521
3547
|
children: [/* @__PURE__ */ I("table", {
|
|
@@ -3530,7 +3556,7 @@ function Ui({ shape: e, value: t, path: n, ctx: r }) {
|
|
|
3530
3556
|
className: "group border-border-soft border-t",
|
|
3531
3557
|
children: [a.map(([i, a]) => /* @__PURE__ */ F("td", {
|
|
3532
3558
|
className: q("align-top", r.edit ? "p-0.5" : "px-3 py-2"),
|
|
3533
|
-
children: /* @__PURE__ */ F(
|
|
3559
|
+
children: /* @__PURE__ */ F(Hi, {
|
|
3534
3560
|
shape: a,
|
|
3535
3561
|
value: e[i],
|
|
3536
3562
|
path: [
|
|
@@ -3543,17 +3569,17 @@ function Ui({ shape: e, value: t, path: n, ctx: r }) {
|
|
|
3543
3569
|
})
|
|
3544
3570
|
}, i)), r.edit ? /* @__PURE__ */ F("td", {
|
|
3545
3571
|
className: "p-0.5 align-middle",
|
|
3546
|
-
children: /* @__PURE__ */ F(
|
|
3572
|
+
children: /* @__PURE__ */ F(Zi, { onClick: () => r.set(n, i.filter((e, n) => n !== t)) })
|
|
3547
3573
|
}) : null]
|
|
3548
3574
|
}, t)) })]
|
|
3549
|
-
}), r.edit ? /* @__PURE__ */ F(
|
|
3575
|
+
}), r.edit ? /* @__PURE__ */ F(Qi, {
|
|
3550
3576
|
what: e.label,
|
|
3551
|
-
onClick: () => r.set(n, [...i,
|
|
3577
|
+
onClick: () => r.set(n, [...i, Gi(e)])
|
|
3552
3578
|
}) : null]
|
|
3553
3579
|
});
|
|
3554
3580
|
}
|
|
3555
|
-
function
|
|
3556
|
-
let i =
|
|
3581
|
+
function qi({ shape: e, value: t, path: n, ctx: r }) {
|
|
3582
|
+
let i = Wi(t), a = Object.entries(e.fields), o = a.filter(([, e]) => e.kind === "text" && e.long), s = a.filter(([, e]) => !(e.kind === "text" && e.long));
|
|
3557
3583
|
return /* @__PURE__ */ I("div", {
|
|
3558
3584
|
className: "overflow-hidden rounded-lg ring-1 ring-border-soft",
|
|
3559
3585
|
children: [/* @__PURE__ */ F("ol", { children: i.map((e, t) => /* @__PURE__ */ I("li", {
|
|
@@ -3565,7 +3591,7 @@ function Wi({ shape: e, value: t, path: n, ctx: r }) {
|
|
|
3565
3591
|
}),
|
|
3566
3592
|
/* @__PURE__ */ F("div", {
|
|
3567
3593
|
className: q("flex min-w-0 flex-col", !r.edit && "pt-1"),
|
|
3568
|
-
children: o.map(([i, a]) => /* @__PURE__ */ F(
|
|
3594
|
+
children: o.map(([i, a]) => /* @__PURE__ */ F(Hi, {
|
|
3569
3595
|
shape: a,
|
|
3570
3596
|
value: e[i],
|
|
3571
3597
|
path: [
|
|
@@ -3578,7 +3604,7 @@ function Wi({ shape: e, value: t, path: n, ctx: r }) {
|
|
|
3578
3604
|
}),
|
|
3579
3605
|
/* @__PURE__ */ I("div", {
|
|
3580
3606
|
className: q("flex items-center gap-2 text-[0.8125rem] text-ink-3", !r.edit && "pt-1"),
|
|
3581
|
-
children: [s.map(([i, a]) => /* @__PURE__ */ F(
|
|
3607
|
+
children: [s.map(([i, a]) => /* @__PURE__ */ F(Hi, {
|
|
3582
3608
|
shape: a,
|
|
3583
3609
|
value: e[i],
|
|
3584
3610
|
path: [
|
|
@@ -3588,17 +3614,17 @@ function Wi({ shape: e, value: t, path: n, ctx: r }) {
|
|
|
3588
3614
|
],
|
|
3589
3615
|
ctx: r,
|
|
3590
3616
|
cell: !0
|
|
3591
|
-
}, i)), r.edit ? /* @__PURE__ */ F(
|
|
3617
|
+
}, i)), r.edit ? /* @__PURE__ */ F(Zi, { onClick: () => r.set(n, i.filter((e, n) => n !== t)) }) : null]
|
|
3592
3618
|
})
|
|
3593
3619
|
]
|
|
3594
|
-
}, t)) }), r.edit ? /* @__PURE__ */ F(
|
|
3620
|
+
}, t)) }), r.edit ? /* @__PURE__ */ F(Qi, {
|
|
3595
3621
|
what: e.label,
|
|
3596
|
-
onClick: () => r.set(n, [...i,
|
|
3622
|
+
onClick: () => r.set(n, [...i, Gi(e)])
|
|
3597
3623
|
}) : null]
|
|
3598
3624
|
});
|
|
3599
3625
|
}
|
|
3600
|
-
function
|
|
3601
|
-
let i =
|
|
3626
|
+
function Ji({ shape: e, value: t, path: n, ctx: r }) {
|
|
3627
|
+
let i = Wi(t), a = Object.entries(e.fields), o = jt(e), s = a.filter(([e, t]) => e !== o && e !== "id" && (t.kind === "text" && !t.long || t.kind === "number" || t.kind === "choice")), c = a.filter(([, e]) => e.kind === "list" && e.of.kind === "object");
|
|
3602
3628
|
return /* @__PURE__ */ I("div", {
|
|
3603
3629
|
className: "flex flex-col gap-2",
|
|
3604
3630
|
children: [i.map((t, a) => {
|
|
@@ -3614,7 +3640,7 @@ function Gi({ shape: e, value: t, path: n, ctx: r }) {
|
|
|
3614
3640
|
className: "min-w-0 flex-1",
|
|
3615
3641
|
children: [/* @__PURE__ */ F("span", {
|
|
3616
3642
|
className: "block truncate font-medium text-[0.9375rem]",
|
|
3617
|
-
children:
|
|
3643
|
+
children: Bi(e, t) || `${e.label ?? ""} ${a + 1}`.trim()
|
|
3618
3644
|
}), /* @__PURE__ */ I("span", {
|
|
3619
3645
|
className: "flex flex-wrap gap-x-2 text-[0.75rem] text-ink-3",
|
|
3620
3646
|
children: [s.map(([e, n]) => t[e] === void 0 || t[e] === "" ? null : /* @__PURE__ */ F("span", { children: n.kind === "number" && n.unit ? `${t[e]} ${n.unit}` : String(t[e]) }, e)), c.map(([e, n]) => /* @__PURE__ */ I("span", { children: [
|
|
@@ -3624,11 +3650,11 @@ function Gi({ shape: e, value: t, path: n, ctx: r }) {
|
|
|
3624
3650
|
] }, e))]
|
|
3625
3651
|
})]
|
|
3626
3652
|
}),
|
|
3627
|
-
r.edit ? /* @__PURE__ */ F(
|
|
3653
|
+
r.edit ? /* @__PURE__ */ F(Zi, { onClick: () => r.set(n, i.filter((e, t) => t !== a)) }) : null
|
|
3628
3654
|
]
|
|
3629
3655
|
}), /* @__PURE__ */ F("div", {
|
|
3630
3656
|
className: "border-border-soft border-t px-4 py-4",
|
|
3631
|
-
children: /* @__PURE__ */ F(
|
|
3657
|
+
children: /* @__PURE__ */ F(Yi, {
|
|
3632
3658
|
shape: e,
|
|
3633
3659
|
value: t,
|
|
3634
3660
|
path: [...n, a],
|
|
@@ -3636,21 +3662,21 @@ function Gi({ shape: e, value: t, path: n, ctx: r }) {
|
|
|
3636
3662
|
})
|
|
3637
3663
|
})]
|
|
3638
3664
|
}, a);
|
|
3639
|
-
}), r.edit ? /* @__PURE__ */ F(
|
|
3665
|
+
}), r.edit ? /* @__PURE__ */ F(Qi, {
|
|
3640
3666
|
what: e.label,
|
|
3641
|
-
onClick: () => r.set(n, [...i,
|
|
3667
|
+
onClick: () => r.set(n, [...i, Gi(e)])
|
|
3642
3668
|
}) : null]
|
|
3643
3669
|
});
|
|
3644
3670
|
}
|
|
3645
|
-
function
|
|
3646
|
-
let i =
|
|
3671
|
+
function Yi({ shape: e, value: t, path: n, ctx: r }) {
|
|
3672
|
+
let i = Pi(t) ? t : {}, a = (e) => e.kind === "list" || e.kind === "object" || e.kind === "table" || e.kind === "text" && !!e.long;
|
|
3647
3673
|
return /* @__PURE__ */ F("div", {
|
|
3648
3674
|
className: "grid grid-cols-[repeat(auto-fill,minmax(10rem,1fr))] gap-x-4 gap-y-4",
|
|
3649
|
-
children: Object.entries(e.fields).map(([e, t]) => /* @__PURE__ */ F(
|
|
3675
|
+
children: Object.entries(e.fields).map(([e, t]) => /* @__PURE__ */ F(Xi, {
|
|
3650
3676
|
title: L(e, t),
|
|
3651
3677
|
wide: a(t),
|
|
3652
3678
|
count: Array.isArray(i[e]) ? i[e].length : null,
|
|
3653
|
-
children: /* @__PURE__ */ F(
|
|
3679
|
+
children: /* @__PURE__ */ F(Hi, {
|
|
3654
3680
|
shape: t,
|
|
3655
3681
|
value: i[e],
|
|
3656
3682
|
path: [...n, e],
|
|
@@ -3659,11 +3685,11 @@ function Ki({ shape: e, value: t, path: n, ctx: r }) {
|
|
|
3659
3685
|
}, e))
|
|
3660
3686
|
});
|
|
3661
3687
|
}
|
|
3662
|
-
function
|
|
3688
|
+
function Xi({ title: e, wide: t, count: n, children: r }) {
|
|
3663
3689
|
return /* @__PURE__ */ I("div", {
|
|
3664
3690
|
className: q("flex min-w-0 flex-col gap-1.5 text-[0.875rem]", t && "col-span-full"),
|
|
3665
3691
|
children: [/* @__PURE__ */ I("span", {
|
|
3666
|
-
className:
|
|
3692
|
+
className: Ni,
|
|
3667
3693
|
children: [e, n === null ? null : /* @__PURE__ */ F("span", {
|
|
3668
3694
|
className: "ml-1 text-ink-4",
|
|
3669
3695
|
children: n
|
|
@@ -3671,7 +3697,7 @@ function qi({ title: e, wide: t, count: n, children: r }) {
|
|
|
3671
3697
|
}), r]
|
|
3672
3698
|
});
|
|
3673
3699
|
}
|
|
3674
|
-
function
|
|
3700
|
+
function Zi({ onClick: e }) {
|
|
3675
3701
|
return /* @__PURE__ */ F("button", {
|
|
3676
3702
|
type: "button",
|
|
3677
3703
|
"aria-label": V("data.remove"),
|
|
@@ -3682,7 +3708,7 @@ function Ji({ onClick: e }) {
|
|
|
3682
3708
|
children: /* @__PURE__ */ F(De, { className: "size-3.5" })
|
|
3683
3709
|
});
|
|
3684
3710
|
}
|
|
3685
|
-
function
|
|
3711
|
+
function Qi({ what: e, onClick: t }) {
|
|
3686
3712
|
return /* @__PURE__ */ I("button", {
|
|
3687
3713
|
type: "button",
|
|
3688
3714
|
onClick: t,
|
|
@@ -3694,7 +3720,7 @@ function Yi({ what: e, onClick: t }) {
|
|
|
3694
3720
|
]
|
|
3695
3721
|
});
|
|
3696
3722
|
}
|
|
3697
|
-
function
|
|
3723
|
+
function $i({ shape: e, value: t, onChange: n, mode: r, onMode: i, modes: a = [
|
|
3698
3724
|
"view",
|
|
3699
3725
|
"edit",
|
|
3700
3726
|
"json"
|
|
@@ -3704,7 +3730,7 @@ function Xi({ shape: e, value: t, onChange: n, mode: r, onMode: i, modes: a = [
|
|
|
3704
3730
|
shape: e,
|
|
3705
3731
|
edit: u === "edit" && !!n,
|
|
3706
3732
|
scope: f,
|
|
3707
|
-
set: (e, r) => n?.(
|
|
3733
|
+
set: (e, r) => n?.(Fi(t, e, r)),
|
|
3708
3734
|
open: (e) => {
|
|
3709
3735
|
let t = document.getElementById(`${f}-${e}`);
|
|
3710
3736
|
t && (t.open = !0, t.scrollIntoView({
|
|
@@ -3727,7 +3753,7 @@ function Xi({ shape: e, value: t, onChange: n, mode: r, onMode: i, modes: a = [
|
|
|
3727
3753
|
children: t[e].length
|
|
3728
3754
|
}) : null]
|
|
3729
3755
|
}, e)) : null
|
|
3730
|
-
}), s.length > 1 ? /* @__PURE__ */ F(
|
|
3756
|
+
}), s.length > 1 ? /* @__PURE__ */ F(Br, {
|
|
3731
3757
|
value: u,
|
|
3732
3758
|
onChange: d,
|
|
3733
3759
|
label: V("data.modes"),
|
|
@@ -3752,7 +3778,7 @@ function Xi({ shape: e, value: t, onChange: n, mode: r, onMode: i, modes: a = [
|
|
|
3752
3778
|
}) : null]
|
|
3753
3779
|
}), /* @__PURE__ */ F("div", {
|
|
3754
3780
|
className: "text-[0.9375rem] leading-relaxed",
|
|
3755
|
-
children: /* @__PURE__ */ F(
|
|
3781
|
+
children: /* @__PURE__ */ F(Hi, {
|
|
3756
3782
|
shape: n,
|
|
3757
3783
|
value: t[e],
|
|
3758
3784
|
path: [e],
|
|
@@ -3763,7 +3789,7 @@ function Xi({ shape: e, value: t, onChange: n, mode: r, onMode: i, modes: a = [
|
|
|
3763
3789
|
})]
|
|
3764
3790
|
});
|
|
3765
3791
|
}
|
|
3766
|
-
function
|
|
3792
|
+
function ea({ items: e }) {
|
|
3767
3793
|
let [t, n] = M(!1), r = j(null);
|
|
3768
3794
|
return A(() => {
|
|
3769
3795
|
if (!t) return;
|
|
@@ -3800,12 +3826,12 @@ function Zi({ items: e }) {
|
|
|
3800
3826
|
}) : null]
|
|
3801
3827
|
});
|
|
3802
3828
|
}
|
|
3803
|
-
function
|
|
3829
|
+
function ta(e) {
|
|
3804
3830
|
return e.toLowerCase().replace(/ä/g, "ae").replace(/ö/g, "oe").replace(/ü/g, "ue").replace(/ß/g, "ss").replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "") || "output";
|
|
3805
3831
|
}
|
|
3806
|
-
function
|
|
3832
|
+
function na({ shape: e, title: t, open: n, onClose: r }) {
|
|
3807
3833
|
let [i, a] = M(!1), o = n ? JSON.stringify(Ft(e, t), null, 2) : "";
|
|
3808
|
-
return /* @__PURE__ */ F(
|
|
3834
|
+
return /* @__PURE__ */ F(Gr, {
|
|
3809
3835
|
open: n,
|
|
3810
3836
|
onClose: r,
|
|
3811
3837
|
title: `${V("data.schema")} · ${t}`,
|
|
@@ -3829,7 +3855,7 @@ function $i({ shape: e, title: t, open: n, onClose: r }) {
|
|
|
3829
3855
|
type: "button",
|
|
3830
3856
|
onClick: () => {
|
|
3831
3857
|
let e = URL.createObjectURL(new Blob([o], { type: "application/schema+json" })), n = document.createElement("a");
|
|
3832
|
-
n.href = e, n.download = `${
|
|
3858
|
+
n.href = e, n.download = `${ta(t)}.schema.json`, n.click(), setTimeout(() => URL.revokeObjectURL(e), 1e3);
|
|
3833
3859
|
},
|
|
3834
3860
|
className: "inline-flex h-8 items-center gap-1.5 rounded-full bg-paper-2 px-3 text-[0.8125rem] text-ink-2 hover:text-ink coarse:h-11 coarse:px-4",
|
|
3835
3861
|
children: [
|
|
@@ -3842,12 +3868,12 @@ function $i({ shape: e, title: t, open: n, onClose: r }) {
|
|
|
3842
3868
|
})
|
|
3843
3869
|
});
|
|
3844
3870
|
}
|
|
3845
|
-
function
|
|
3871
|
+
function ra(e) {
|
|
3846
3872
|
let t = e;
|
|
3847
3873
|
return t.type === "agent" && t.output.format === "json" && !t.each && !t.call;
|
|
3848
3874
|
}
|
|
3849
|
-
function
|
|
3850
|
-
let a = Fn(t), [o, s] = M(!1), [c, l] = M(!1), [u, d] = M(null), [f, m] = M(!1), [h, g] = M(null), _ = u ?? (
|
|
3875
|
+
function ia({ runId: e, step: t, output: n, header: r, children: i }) {
|
|
3876
|
+
let a = Fn(t), [o, s] = M(!1), [c, l] = M(!1), [u, d] = M(null), [f, m] = M(!1), [h, g] = M(null), _ = u ?? (Pi(n.json) ? n.json : {}), v = async () => {
|
|
3851
3877
|
if (u) {
|
|
3852
3878
|
m(!0), g(null);
|
|
3853
3879
|
try {
|
|
@@ -3858,7 +3884,7 @@ function ta({ runId: e, step: t, output: n, header: r, children: i }) {
|
|
|
3858
3884
|
m(!1);
|
|
3859
3885
|
}
|
|
3860
3886
|
}
|
|
3861
|
-
}, y = /* @__PURE__ */ F(
|
|
3887
|
+
}, y = /* @__PURE__ */ F(ea, { items: [{
|
|
3862
3888
|
label: V(o ? "data.close" : "data.open"),
|
|
3863
3889
|
icon: /* @__PURE__ */ F(b, { className: "size-4 shrink-0" }),
|
|
3864
3890
|
onClick: () => {
|
|
@@ -3873,7 +3899,7 @@ function ta({ runId: e, step: t, output: n, header: r, children: i }) {
|
|
|
3873
3899
|
r(y),
|
|
3874
3900
|
o ? /* @__PURE__ */ I("div", {
|
|
3875
3901
|
className: "overflow-hidden rounded-xl bg-card ring-1 ring-border-soft",
|
|
3876
|
-
children: [/* @__PURE__ */ F(
|
|
3902
|
+
children: [/* @__PURE__ */ F($i, {
|
|
3877
3903
|
shape: a,
|
|
3878
3904
|
value: _,
|
|
3879
3905
|
onChange: d
|
|
@@ -3899,7 +3925,7 @@ function ta({ runId: e, step: t, output: n, header: r, children: i }) {
|
|
|
3899
3925
|
]
|
|
3900
3926
|
}) : null]
|
|
3901
3927
|
}) : i,
|
|
3902
|
-
/* @__PURE__ */ F(
|
|
3928
|
+
/* @__PURE__ */ F(na, {
|
|
3903
3929
|
shape: a,
|
|
3904
3930
|
title: t.title,
|
|
3905
3931
|
open: c,
|
|
@@ -3909,11 +3935,11 @@ function ta({ runId: e, step: t, output: n, header: r, children: i }) {
|
|
|
3909
3935
|
}
|
|
3910
3936
|
//#endregion
|
|
3911
3937
|
//#region ../runner/src/location.tsx
|
|
3912
|
-
var
|
|
3913
|
-
function
|
|
3938
|
+
var aa = 25, oa = 9e3;
|
|
3939
|
+
function sa(e) {
|
|
3914
3940
|
return e.code === e.PERMISSION_DENIED ? "denied" : e.code === e.TIMEOUT ? "timeout" : "unavailable";
|
|
3915
3941
|
}
|
|
3916
|
-
function
|
|
3942
|
+
function ca({ value: e, runId: t, placeholder: n, onChange: r, onBusy: i }) {
|
|
3917
3943
|
let a = $t(e) ? e : null, [o, s] = M(!1), [c, l] = M(null), u = j(null), d = j(!!a?.label), f = j(a);
|
|
3918
3944
|
f.current = a;
|
|
3919
3945
|
let p = a?.lat !== void 0 && a.lng !== void 0, m = typeof navigator < "u" && "geolocation" in navigator, h = () => {
|
|
@@ -3949,13 +3975,13 @@ function aa({ value: e, runId: t, placeholder: n, onChange: r, onBusy: i }) {
|
|
|
3949
3975
|
};
|
|
3950
3976
|
f.current = c, r(c);
|
|
3951
3977
|
}
|
|
3952
|
-
if (t <=
|
|
3978
|
+
if (t <= aa || Date.now() - e > oa) {
|
|
3953
3979
|
h();
|
|
3954
3980
|
let e = f.current;
|
|
3955
3981
|
e?.lat !== void 0 && e.lng !== void 0 && g(e.lat, e.lng);
|
|
3956
3982
|
}
|
|
3957
3983
|
}, (e) => {
|
|
3958
|
-
h(), t === Infinity && l(
|
|
3984
|
+
h(), t === Infinity && l(sa(e));
|
|
3959
3985
|
}, {
|
|
3960
3986
|
enableHighAccuracy: !0,
|
|
3961
3987
|
timeout: 15e3,
|
|
@@ -4035,9 +4061,9 @@ function aa({ value: e, runId: t, placeholder: n, onChange: r, onBusy: i }) {
|
|
|
4035
4061
|
}
|
|
4036
4062
|
//#endregion
|
|
4037
4063
|
//#region ../runner/src/scan.tsx
|
|
4038
|
-
var
|
|
4039
|
-
function
|
|
4040
|
-
return
|
|
4064
|
+
var la = null;
|
|
4065
|
+
function ua() {
|
|
4066
|
+
return la ??= (async () => {
|
|
4041
4067
|
let e = window.BarcodeDetector;
|
|
4042
4068
|
if (e) try {
|
|
4043
4069
|
let t = await e.getSupportedFormats();
|
|
@@ -4063,33 +4089,33 @@ function sa() {
|
|
|
4063
4089
|
}
|
|
4064
4090
|
}
|
|
4065
4091
|
};
|
|
4066
|
-
})(),
|
|
4092
|
+
})(), la;
|
|
4067
4093
|
}
|
|
4068
|
-
function
|
|
4094
|
+
function da({ open: e, onClose: t, onResult: n }) {
|
|
4069
4095
|
let r = j(n);
|
|
4070
4096
|
r.current = n;
|
|
4071
4097
|
let i = j(t);
|
|
4072
4098
|
return i.current = t, A(() => {
|
|
4073
|
-
e &&
|
|
4099
|
+
e && Or("scan").then((e) => {
|
|
4074
4100
|
e && r.current(e);
|
|
4075
4101
|
}).catch(() => void 0).finally(() => i.current());
|
|
4076
4102
|
}, [e]), null;
|
|
4077
4103
|
}
|
|
4078
|
-
function
|
|
4079
|
-
return K("scan") ? /* @__PURE__ */ F(
|
|
4104
|
+
function fa(e) {
|
|
4105
|
+
return K("scan") ? /* @__PURE__ */ F(da, { ...e }) : /* @__PURE__ */ F(pa, { ...e });
|
|
4080
4106
|
}
|
|
4081
|
-
function
|
|
4082
|
-
let [r, i] = M("environment"), [a, o] = M(!1), [s, c] = M(!1), l = j(null), u =
|
|
4107
|
+
function pa({ open: e, onClose: t, onResult: n }) {
|
|
4108
|
+
let [r, i] = M("environment"), [a, o] = M(!1), [s, c] = M(!1), l = j(null), u = Si(e, r), d = j(n);
|
|
4083
4109
|
d.current = n;
|
|
4084
4110
|
let f = j(t);
|
|
4085
4111
|
f.current = t, A(() => {
|
|
4086
|
-
e && (c(!1),
|
|
4112
|
+
e && (c(!1), ua().then((e) => o(e.qrOnly)));
|
|
4087
4113
|
}, [e]), A(() => {
|
|
4088
4114
|
if (!e || !u.stream) return;
|
|
4089
4115
|
let t = !1, n, r = async () => {
|
|
4090
4116
|
let e = u.video.current;
|
|
4091
4117
|
if (!t && e && e.readyState >= 2 && e.videoWidth) {
|
|
4092
|
-
let n = await (await
|
|
4118
|
+
let n = await (await ua()).detect(e).catch(() => null);
|
|
4093
4119
|
if (n && !t) {
|
|
4094
4120
|
navigator.vibrate?.(60), d.current(n), f.current();
|
|
4095
4121
|
return;
|
|
@@ -4108,33 +4134,33 @@ function ua({ open: e, onClose: t, onResult: n }) {
|
|
|
4108
4134
|
let p = async (e) => {
|
|
4109
4135
|
if (!e) return;
|
|
4110
4136
|
c(!1);
|
|
4111
|
-
let r = await createImageBitmap(e).catch(() => null), i = r ? await (await
|
|
4137
|
+
let r = await createImageBitmap(e).catch(() => null), i = r ? await (await ua()).detect(r).catch(() => null) : null;
|
|
4112
4138
|
i ? (n(i), t()) : c(!0);
|
|
4113
4139
|
};
|
|
4114
|
-
return /* @__PURE__ */ I(
|
|
4140
|
+
return /* @__PURE__ */ I(Ci, {
|
|
4115
4141
|
open: e,
|
|
4116
4142
|
onClose: t,
|
|
4117
4143
|
label: V("scan.title"),
|
|
4118
4144
|
children: [
|
|
4119
|
-
/* @__PURE__ */ F(
|
|
4145
|
+
/* @__PURE__ */ F(Ti, {
|
|
4120
4146
|
title: V("scan.title"),
|
|
4121
4147
|
onClose: t,
|
|
4122
4148
|
camera: u,
|
|
4123
4149
|
onFlip: () => i((e) => e === "environment" ? "user" : "environment")
|
|
4124
4150
|
}),
|
|
4125
|
-
/* @__PURE__ */ F(
|
|
4151
|
+
/* @__PURE__ */ F(Ei, {
|
|
4126
4152
|
camera: u,
|
|
4127
4153
|
asking: V("scan.asking"),
|
|
4128
4154
|
actions: /* @__PURE__ */ I("div", {
|
|
4129
4155
|
className: "flex flex-col gap-2",
|
|
4130
|
-
children: [/* @__PURE__ */ I(
|
|
4156
|
+
children: [/* @__PURE__ */ I(ji, {
|
|
4131
4157
|
onClick: () => l.current?.click(),
|
|
4132
4158
|
children: [
|
|
4133
|
-
/* @__PURE__ */ F(
|
|
4159
|
+
/* @__PURE__ */ F(D, { className: "size-4" }),
|
|
4134
4160
|
" ",
|
|
4135
4161
|
V("scan.fromPhoto")
|
|
4136
4162
|
]
|
|
4137
|
-
}), /* @__PURE__ */ F(
|
|
4163
|
+
}), /* @__PURE__ */ F(ji, {
|
|
4138
4164
|
quiet: !0,
|
|
4139
4165
|
onClick: t,
|
|
4140
4166
|
children: V("scan.typeInstead")
|
|
@@ -4150,11 +4176,11 @@ function ua({ open: e, onClose: t, onResult: n }) {
|
|
|
4150
4176
|
children: [/* @__PURE__ */ F("p", {
|
|
4151
4177
|
className: "text-[0.8125rem] text-white/75 leading-snug",
|
|
4152
4178
|
children: V(s ? "scan.miss" : a ? "scan.hintQr" : "scan.hint")
|
|
4153
|
-
}), u.stream ? /* @__PURE__ */ I(
|
|
4179
|
+
}), u.stream ? /* @__PURE__ */ I(ji, {
|
|
4154
4180
|
quiet: !0,
|
|
4155
4181
|
onClick: () => l.current?.click(),
|
|
4156
4182
|
children: [
|
|
4157
|
-
/* @__PURE__ */ F(
|
|
4183
|
+
/* @__PURE__ */ F(D, { className: "size-4" }),
|
|
4158
4184
|
" ",
|
|
4159
4185
|
V("scan.fromPhoto")
|
|
4160
4186
|
]
|
|
@@ -4174,12 +4200,12 @@ function ua({ open: e, onClose: t, onResult: n }) {
|
|
|
4174
4200
|
}
|
|
4175
4201
|
//#endregion
|
|
4176
4202
|
//#region ../runner/src/signature.tsx
|
|
4177
|
-
var
|
|
4203
|
+
var ma = "#1d1a17", ha = {
|
|
4178
4204
|
width: 1200,
|
|
4179
4205
|
height: 480
|
|
4180
4206
|
};
|
|
4181
|
-
function
|
|
4182
|
-
e.lineCap = "round", e.lineJoin = "round", e.strokeStyle =
|
|
4207
|
+
function ga(e, t, n, r, i) {
|
|
4208
|
+
e.lineCap = "round", e.lineJoin = "round", e.strokeStyle = ma, e.fillStyle = ma, e.lineWidth = i;
|
|
4183
4209
|
for (let a of t) {
|
|
4184
4210
|
if (a.length === 1) {
|
|
4185
4211
|
e.beginPath(), e.arc(a[0].x * n, a[0].y * r, i / 2, 0, Math.PI * 2), e.fill();
|
|
@@ -4194,14 +4220,14 @@ function pa(e, t, n, r, i) {
|
|
|
4194
4220
|
e.lineTo(t.x * n, t.y * r), e.stroke();
|
|
4195
4221
|
}
|
|
4196
4222
|
}
|
|
4197
|
-
function
|
|
4223
|
+
function _a({ strokes: e, onStrokes: t }) {
|
|
4198
4224
|
let n = j(null), r = j(null), i = j(e);
|
|
4199
4225
|
i.current = e;
|
|
4200
4226
|
let a = () => {
|
|
4201
4227
|
let e = n.current, t = e?.getContext("2d");
|
|
4202
4228
|
if (!e || !t) return;
|
|
4203
4229
|
let a = window.devicePixelRatio || 1, o = Math.round(e.clientWidth * a), s = Math.round(e.clientHeight * a);
|
|
4204
|
-
(e.width !== o || e.height !== s) && (e.width = o, e.height = s), t.clearRect(0, 0, o, s),
|
|
4230
|
+
(e.width !== o || e.height !== s) && (e.width = o, e.height = s), t.clearRect(0, 0, o, s), ga(t, r.current ? [...i.current, r.current] : i.current, o, s, 2.4 * a);
|
|
4205
4231
|
};
|
|
4206
4232
|
A(() => {
|
|
4207
4233
|
a();
|
|
@@ -4248,20 +4274,20 @@ function ma({ strokes: e, onStrokes: t }) {
|
|
|
4248
4274
|
]
|
|
4249
4275
|
});
|
|
4250
4276
|
}
|
|
4251
|
-
async function
|
|
4277
|
+
async function va(e) {
|
|
4252
4278
|
let t = document.createElement("canvas");
|
|
4253
|
-
t.width =
|
|
4279
|
+
t.width = ha.width, t.height = ha.height;
|
|
4254
4280
|
let n = t.getContext("2d");
|
|
4255
4281
|
if (!n) return null;
|
|
4256
|
-
|
|
4282
|
+
ga(n, e, ha.width, ha.height, 7);
|
|
4257
4283
|
let r = await new Promise((e) => t.toBlob(e, "image/png"));
|
|
4258
4284
|
return r ? new File([r], "unterschrift.png", { type: "image/png" }) : null;
|
|
4259
4285
|
}
|
|
4260
|
-
function
|
|
4286
|
+
function ya({ label: e, value: t, runId: n, onChange: r }) {
|
|
4261
4287
|
let [i, a] = M(!1), [o, s] = M([]), [c, l] = M(!1), [u, d] = M(null), f = typeof t == "string" && t ? t : null, p = async () => {
|
|
4262
4288
|
l(!0), d(null);
|
|
4263
4289
|
try {
|
|
4264
|
-
let e = await
|
|
4290
|
+
let e = await va(o);
|
|
4265
4291
|
if (!e) return;
|
|
4266
4292
|
r((await U.upload(`${G(n)}/uploads`, e)).id), a(!1);
|
|
4267
4293
|
} catch (e) {
|
|
@@ -4296,13 +4322,13 @@ function ga({ label: e, value: t, runId: n, onChange: r }) {
|
|
|
4296
4322
|
},
|
|
4297
4323
|
className: "flex w-full flex-col items-center justify-center gap-2 rounded-xl border border-input border-dashed bg-card px-4 py-7 text-[0.875rem] text-ink-3 transition hover:border-ember hover:text-ink",
|
|
4298
4324
|
children: [/* @__PURE__ */ F(pe, { className: "size-6" }), V("sign.open")]
|
|
4299
|
-
}), /* @__PURE__ */ I(
|
|
4325
|
+
}), /* @__PURE__ */ I(Gr, {
|
|
4300
4326
|
open: i,
|
|
4301
4327
|
onClose: () => a(!1),
|
|
4302
4328
|
title: e,
|
|
4303
4329
|
wide: !0,
|
|
4304
4330
|
children: [
|
|
4305
|
-
/* @__PURE__ */ F(
|
|
4331
|
+
/* @__PURE__ */ F(_a, {
|
|
4306
4332
|
strokes: o,
|
|
4307
4333
|
onStrokes: s
|
|
4308
4334
|
}),
|
|
@@ -4333,7 +4359,7 @@ function ga({ label: e, value: t, runId: n, onChange: r }) {
|
|
|
4333
4359
|
}
|
|
4334
4360
|
//#endregion
|
|
4335
4361
|
//#region ../runner/src/store.tsx
|
|
4336
|
-
function
|
|
4362
|
+
function ba({ runId: e, connectionId: t, connector: n, onCancel: r }) {
|
|
4337
4363
|
let [i, a] = M({}), [o, s] = M(!1), [c, l] = M(null), u = async () => {
|
|
4338
4364
|
s(!0), l(null);
|
|
4339
4365
|
try {
|
|
@@ -4347,7 +4373,7 @@ function _a({ runId: e, connectionId: t, connector: n, onCancel: r }) {
|
|
|
4347
4373
|
return /* @__PURE__ */ I("div", {
|
|
4348
4374
|
className: "flex flex-col gap-3 rounded-xl bg-card p-4 ring-1 ring-input",
|
|
4349
4375
|
children: [
|
|
4350
|
-
(n.fields ?? []).map((e) => /* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F(
|
|
4376
|
+
(n.fields ?? []).map((e) => /* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F(Hr, { children: e.label }), /* @__PURE__ */ F(X, {
|
|
4351
4377
|
type: e.secret ? "password" : "text",
|
|
4352
4378
|
autoComplete: "off",
|
|
4353
4379
|
value: i[e.key] ?? "",
|
|
@@ -4385,7 +4411,7 @@ function _a({ runId: e, connectionId: t, connector: n, onCancel: r }) {
|
|
|
4385
4411
|
]
|
|
4386
4412
|
});
|
|
4387
4413
|
}
|
|
4388
|
-
function
|
|
4414
|
+
function xa({ runId: e, connection: t }) {
|
|
4389
4415
|
let [n, r] = M(null), [i, a] = M(null), [o, s] = M(null);
|
|
4390
4416
|
if (!t) return null;
|
|
4391
4417
|
if (t.account) {
|
|
@@ -4419,7 +4445,7 @@ function va({ runId: e, connection: t }) {
|
|
|
4419
4445
|
if (s(null), a(null), K("signIn")) {
|
|
4420
4446
|
try {
|
|
4421
4447
|
let { url: r } = await U.post(`${G(e)}/connections/${t.id}/oauth/${n.id}`);
|
|
4422
|
-
await
|
|
4448
|
+
await Or("signIn", { url: r });
|
|
4423
4449
|
} catch (e) {
|
|
4424
4450
|
s(e.message);
|
|
4425
4451
|
}
|
|
@@ -4443,13 +4469,13 @@ function va({ runId: e, connection: t }) {
|
|
|
4443
4469
|
onClick: () => e.auth === "oauth2" ? void c(e) : r(n === e.id ? null : e.id),
|
|
4444
4470
|
className: q("inline-flex h-11 items-center gap-2 rounded-full px-4 font-medium text-[0.875rem] ring-1 transition", n === e.id ? "bg-ember-veil text-ink ring-ember" : "bg-card text-ink-2 ring-input hover:text-ink hover:ring-ember"),
|
|
4445
4471
|
children: [
|
|
4446
|
-
/* @__PURE__ */ F(
|
|
4472
|
+
/* @__PURE__ */ F(ie, { className: "size-4" }),
|
|
4447
4473
|
" ",
|
|
4448
4474
|
e.name
|
|
4449
4475
|
]
|
|
4450
4476
|
}, e.id))
|
|
4451
4477
|
}),
|
|
4452
|
-
l ? /* @__PURE__ */ F(
|
|
4478
|
+
l ? /* @__PURE__ */ F(ba, {
|
|
4453
4479
|
runId: e,
|
|
4454
4480
|
connectionId: t.id,
|
|
4455
4481
|
connector: l,
|
|
@@ -4472,12 +4498,12 @@ function va({ runId: e, connection: t }) {
|
|
|
4472
4498
|
children: V("connect.none")
|
|
4473
4499
|
});
|
|
4474
4500
|
}
|
|
4475
|
-
function
|
|
4501
|
+
function Sa(e) {
|
|
4476
4502
|
return e == null ? "" : Array.isArray(e) ? e.join(", ") : String(e);
|
|
4477
4503
|
}
|
|
4478
|
-
function
|
|
4479
|
-
let [i, a] = M(
|
|
4480
|
-
A(() => a(
|
|
4504
|
+
function Ca({ column: e, value: t, boxed: n, onCommit: r }) {
|
|
4505
|
+
let [i, a] = M(Sa(t));
|
|
4506
|
+
A(() => a(Sa(t)), [t]);
|
|
4481
4507
|
let o = q("w-full min-w-0 rounded-md border border-transparent px-2 text-[0.8125rem] outline-none focus:border-ember focus:bg-card", n ? "h-11 bg-paper-2" : "h-9 bg-transparent hover:bg-paper-2 coarse:h-11");
|
|
4482
4508
|
return e.type === "boolean" ? /* @__PURE__ */ F("label", {
|
|
4483
4509
|
className: "flex size-9 cursor-pointer items-center justify-center coarse:size-11",
|
|
@@ -4505,7 +4531,7 @@ function ba({ column: e, value: t, boxed: n, onCommit: r }) {
|
|
|
4505
4531
|
value: i,
|
|
4506
4532
|
onChange: (e) => a(e.target.value),
|
|
4507
4533
|
onBlur: () => {
|
|
4508
|
-
i !==
|
|
4534
|
+
i !== Sa(t) && r(Lt(e, i));
|
|
4509
4535
|
},
|
|
4510
4536
|
onKeyDown: (e) => {
|
|
4511
4537
|
e.key === "Enter" && (e.preventDefault(), e.target.blur());
|
|
@@ -4513,13 +4539,13 @@ function ba({ column: e, value: t, boxed: n, onCommit: r }) {
|
|
|
4513
4539
|
className: q(o, e.type === "number" && "text-right tabular-nums")
|
|
4514
4540
|
});
|
|
4515
4541
|
}
|
|
4516
|
-
function
|
|
4542
|
+
function wa({ runId: e, list: t, editable: n }) {
|
|
4517
4543
|
let { def: r, rows: i } = t, [a, o] = M(null), [s, c] = M({}), l = `${G(e)}/lists/${r.id}/rows`, u = async (e) => {
|
|
4518
4544
|
o(null);
|
|
4519
4545
|
try {
|
|
4520
4546
|
await e();
|
|
4521
4547
|
} catch (e) {
|
|
4522
|
-
o(e instanceof
|
|
4548
|
+
o(e instanceof xr ? e.message : String(e));
|
|
4523
4549
|
}
|
|
4524
4550
|
}, d = () => u(async () => {
|
|
4525
4551
|
await U.post(l, { cells: s }), c({});
|
|
@@ -4541,7 +4567,7 @@ function xa({ runId: e, list: t, editable: n }) {
|
|
|
4541
4567
|
children: [/* @__PURE__ */ F("div", {
|
|
4542
4568
|
className: "px-1 pb-0.5 text-[0.6875rem] text-ink-3",
|
|
4543
4569
|
children: t.name
|
|
4544
|
-
}), n ? /* @__PURE__ */ F(
|
|
4570
|
+
}), n ? /* @__PURE__ */ F(Ca, {
|
|
4545
4571
|
boxed: !0,
|
|
4546
4572
|
column: t,
|
|
4547
4573
|
value: e.cells[t.id],
|
|
@@ -4568,7 +4594,7 @@ function xa({ runId: e, list: t, editable: n }) {
|
|
|
4568
4594
|
children: [/* @__PURE__ */ F("div", {
|
|
4569
4595
|
className: "px-1 pb-0.5 text-[0.6875rem] text-ink-3",
|
|
4570
4596
|
children: e.name
|
|
4571
|
-
}), /* @__PURE__ */ F(
|
|
4597
|
+
}), /* @__PURE__ */ F(Ca, {
|
|
4572
4598
|
boxed: !0,
|
|
4573
4599
|
column: e,
|
|
4574
4600
|
value: s[e.id],
|
|
@@ -4607,7 +4633,7 @@ function xa({ runId: e, list: t, editable: n }) {
|
|
|
4607
4633
|
className: "border-border-soft border-t align-top",
|
|
4608
4634
|
children: [r.columns.map((t) => /* @__PURE__ */ F("td", {
|
|
4609
4635
|
className: q("min-w-[7.5rem]", n ? "px-1 py-0.5" : "px-3 py-2"),
|
|
4610
|
-
children: n ? /* @__PURE__ */ F(
|
|
4636
|
+
children: n ? /* @__PURE__ */ F(Ca, {
|
|
4611
4637
|
column: t,
|
|
4612
4638
|
value: e.cells[t.id],
|
|
4613
4639
|
onCommit: (n) => m(e.id, t.id, n)
|
|
@@ -4628,7 +4654,7 @@ function xa({ runId: e, list: t, editable: n }) {
|
|
|
4628
4654
|
className: "border-border-soft border-t bg-paper",
|
|
4629
4655
|
children: [r.columns.map((e) => /* @__PURE__ */ F("td", {
|
|
4630
4656
|
className: "px-1 py-0.5",
|
|
4631
|
-
children: /* @__PURE__ */ F(
|
|
4657
|
+
children: /* @__PURE__ */ F(Ca, {
|
|
4632
4658
|
column: e,
|
|
4633
4659
|
value: s[e.id],
|
|
4634
4660
|
onCommit: (t) => c((n) => ({
|
|
@@ -4654,23 +4680,23 @@ function xa({ runId: e, list: t, editable: n }) {
|
|
|
4654
4680
|
}) : null
|
|
4655
4681
|
] });
|
|
4656
4682
|
}
|
|
4657
|
-
function
|
|
4683
|
+
function Ta(e, t, n) {
|
|
4658
4684
|
let r = t.split("/").map(encodeURIComponent).join("/");
|
|
4659
4685
|
return W(`${G(e)}/store/files/${r}${n ? "?inline=1" : ""}`);
|
|
4660
4686
|
}
|
|
4661
|
-
var
|
|
4687
|
+
var Ea = [
|
|
4662
4688
|
"bg-paper-3 text-ink-3",
|
|
4663
4689
|
"bg-moss-tint text-moss",
|
|
4664
4690
|
"bg-rose-tint text-rose",
|
|
4665
4691
|
"bg-ember-tint text-ember-strong"
|
|
4666
4692
|
];
|
|
4667
|
-
function
|
|
4693
|
+
function Da({ runId: e, list: t }) {
|
|
4668
4694
|
let { def: n, rows: r } = t, i = n.columns.find((e) => e.id === n.check?.file), a = n.columns.find((e) => e.id === n.check?.status), o = a?.type === "select" ? a.format.options : [], s = o[0]?.id, c = (e) => a ? String(e.cells[a.id] ?? s ?? "") : "", l = (e) => !a || c(e) === s, [u, d] = M(() => (r.find(l) ?? r[0])?.id ?? null), [f, p] = M(!1), [m, g] = M(null), _ = `${G(e)}/lists/${n.id}/rows`, v = r.find((e) => e.id === u) ?? r[0], y = f ? r.filter((e) => l(e) || e.id === v?.id) : r, b = r.filter((e) => !l(e)).length, x = n.columns.filter((e) => e !== i && e !== a), S = x.filter((e) => e.id !== n.key), C = S.find((e) => e.type === "text") ?? S[0], w = S.filter((e) => e !== C), ee = async (e, t) => {
|
|
4669
4695
|
g(null);
|
|
4670
4696
|
try {
|
|
4671
4697
|
await U.patch(`${_}/${e}`, { cells: t });
|
|
4672
4698
|
} catch (e) {
|
|
4673
|
-
g(e instanceof
|
|
4699
|
+
g(e instanceof xr ? e.message : String(e));
|
|
4674
4700
|
}
|
|
4675
4701
|
}, te = (e) => {
|
|
4676
4702
|
let t = y.findIndex((e) => e.id === v?.id), n = y[Math.min(y.length - 1, Math.max(0, t + e))];
|
|
@@ -4686,7 +4712,7 @@ function wa({ runId: e, list: t }) {
|
|
|
4686
4712
|
className: "text-[0.875rem] text-ink-3",
|
|
4687
4713
|
children: V("list.empty")
|
|
4688
4714
|
});
|
|
4689
|
-
let E = i && v ? String(v.cells[i.id] ?? "").trim() : "",
|
|
4715
|
+
let E = i && v ? String(v.cells[i.id] ?? "").trim() : "", D = E.split(".").pop()?.toLowerCase() ?? "", O = (e) => Ea[Math.min(Math.max(0, o.findIndex((t) => t.id === c(e))), 3)];
|
|
4690
4716
|
return /* @__PURE__ */ I("div", {
|
|
4691
4717
|
className: "grid gap-4 lg:grid-cols-[minmax(280px,360px)_minmax(0,1fr)]",
|
|
4692
4718
|
onKeyDown: re,
|
|
@@ -4724,7 +4750,7 @@ function wa({ runId: e, list: t }) {
|
|
|
4724
4750
|
children: w.slice(0, 2).map((t) => _t(t, e.cells[t.id], B)).filter(Boolean).join(" · ")
|
|
4725
4751
|
})]
|
|
4726
4752
|
}), a ? /* @__PURE__ */ F("span", {
|
|
4727
|
-
className: q("shrink-0 rounded-full px-2 py-0.5 font-medium text-[0.6875rem]",
|
|
4753
|
+
className: q("shrink-0 rounded-full px-2 py-0.5 font-medium text-[0.6875rem]", O(e)),
|
|
4728
4754
|
children: o.find((t) => t.id === c(e))?.label ?? c(e)
|
|
4729
4755
|
}) : null]
|
|
4730
4756
|
}) }, e.id))
|
|
@@ -4764,26 +4790,26 @@ function wa({ runId: e, list: t }) {
|
|
|
4764
4790
|
children: E.split("/").pop()
|
|
4765
4791
|
}),
|
|
4766
4792
|
/* @__PURE__ */ F("a", {
|
|
4767
|
-
href:
|
|
4793
|
+
href: Ta(e, E, D === "pdf"),
|
|
4768
4794
|
target: "_blank",
|
|
4769
4795
|
rel: "noreferrer",
|
|
4770
4796
|
className: "shrink-0 text-ink-2 underline-offset-2 hover:text-ink hover:underline",
|
|
4771
4797
|
children: V("run.openFull")
|
|
4772
4798
|
})
|
|
4773
4799
|
]
|
|
4774
|
-
}),
|
|
4800
|
+
}), D === "pdf" ? /* @__PURE__ */ F("iframe", {
|
|
4775
4801
|
title: E,
|
|
4776
|
-
src: `${
|
|
4802
|
+
src: `${Ta(e, E, !0)}#toolbar=0&navpanes=0&view=FitH`,
|
|
4777
4803
|
className: "h-[46vh] w-full border-0 bg-white lg:h-[calc(100vh-27rem)] lg:min-h-[360px]"
|
|
4778
4804
|
}, E) : [
|
|
4779
4805
|
"png",
|
|
4780
4806
|
"jpg",
|
|
4781
4807
|
"jpeg",
|
|
4782
4808
|
"webp"
|
|
4783
|
-
].includes(
|
|
4809
|
+
].includes(D) ? /* @__PURE__ */ F("div", {
|
|
4784
4810
|
className: "flex max-h-[46vh] justify-center overflow-auto bg-white lg:max-h-[calc(100vh-27rem)]",
|
|
4785
4811
|
children: /* @__PURE__ */ F("img", {
|
|
4786
|
-
src:
|
|
4812
|
+
src: Ta(e, E, !0),
|
|
4787
4813
|
alt: E,
|
|
4788
4814
|
className: "max-w-full object-contain"
|
|
4789
4815
|
}, E)
|
|
@@ -4802,7 +4828,7 @@ function wa({ runId: e, list: t }) {
|
|
|
4802
4828
|
children: [/* @__PURE__ */ F("div", {
|
|
4803
4829
|
className: "px-1 pb-0.5 text-[0.6875rem] text-ink-3",
|
|
4804
4830
|
children: e.name
|
|
4805
|
-
}), /* @__PURE__ */ F(
|
|
4831
|
+
}), /* @__PURE__ */ F(Ca, {
|
|
4806
4832
|
boxed: !0,
|
|
4807
4833
|
column: e,
|
|
4808
4834
|
value: v.cells[e.id],
|
|
@@ -4818,24 +4844,24 @@ function wa({ runId: e, list: t }) {
|
|
|
4818
4844
|
}) : null]
|
|
4819
4845
|
});
|
|
4820
4846
|
}
|
|
4821
|
-
var
|
|
4847
|
+
var Oa = {
|
|
4822
4848
|
xlsx: "Excel",
|
|
4823
4849
|
csv: "CSV",
|
|
4824
4850
|
json: "JSON",
|
|
4825
4851
|
md: "Markdown",
|
|
4826
4852
|
zip: "ZIP"
|
|
4827
4853
|
};
|
|
4828
|
-
function
|
|
4854
|
+
function ka({ runId: e, list: t }) {
|
|
4829
4855
|
return /* @__PURE__ */ F("div", {
|
|
4830
4856
|
className: "flex flex-wrap gap-2",
|
|
4831
4857
|
children: t.formats.map((n) => /* @__PURE__ */ F("a", {
|
|
4832
4858
|
href: W(`${G(e)}/lists/${t.def.id}/download?format=${n}`),
|
|
4833
4859
|
className: "inline-flex h-9 items-center rounded-full bg-paper-2 px-3.5 font-medium text-[0.8125rem] text-ink-2 transition hover:bg-paper-3 hover:text-ink coarse:h-11 coarse:px-4",
|
|
4834
|
-
children:
|
|
4860
|
+
children: Oa[n] ?? n
|
|
4835
4861
|
}, n))
|
|
4836
4862
|
});
|
|
4837
4863
|
}
|
|
4838
|
-
function
|
|
4864
|
+
function Aa({ runId: e }) {
|
|
4839
4865
|
let [t, n] = M(!1), [r, i] = M(null), [a, o] = M(!1);
|
|
4840
4866
|
A(() => {
|
|
4841
4867
|
t && (o(!1), U.get(`${G(e)}/store`).then(i));
|
|
@@ -4850,7 +4876,7 @@ function Da({ runId: e }) {
|
|
|
4850
4876
|
" ",
|
|
4851
4877
|
V("store.open")
|
|
4852
4878
|
]
|
|
4853
|
-
}), /* @__PURE__ */ F(
|
|
4879
|
+
}), /* @__PURE__ */ F(Gr, {
|
|
4854
4880
|
open: t,
|
|
4855
4881
|
onClose: () => n(!1),
|
|
4856
4882
|
title: V("store.title"),
|
|
@@ -4879,7 +4905,7 @@ function Da({ runId: e }) {
|
|
|
4879
4905
|
r.connections.map((e) => /* @__PURE__ */ I("div", {
|
|
4880
4906
|
className: "flex items-center gap-2",
|
|
4881
4907
|
children: [
|
|
4882
|
-
/* @__PURE__ */ F(
|
|
4908
|
+
/* @__PURE__ */ F(ie, { className: "size-4 text-ink-3" }),
|
|
4883
4909
|
" ",
|
|
4884
4910
|
e.account?.label
|
|
4885
4911
|
]
|
|
@@ -4948,14 +4974,14 @@ function Da({ runId: e }) {
|
|
|
4948
4974
|
]
|
|
4949
4975
|
}) : /* @__PURE__ */ F("div", {
|
|
4950
4976
|
className: "flex justify-center py-8 text-ink-4",
|
|
4951
|
-
children: /* @__PURE__ */ F(
|
|
4977
|
+
children: /* @__PURE__ */ F(Ur, {})
|
|
4952
4978
|
})
|
|
4953
4979
|
})] });
|
|
4954
4980
|
}
|
|
4955
4981
|
//#endregion
|
|
4956
4982
|
//#region ../runner/src/voice.tsx
|
|
4957
|
-
var
|
|
4958
|
-
function
|
|
4983
|
+
var ja = 300;
|
|
4984
|
+
function Ma() {
|
|
4959
4985
|
if (typeof MediaRecorder < "u") return (K("transcribe") ? [
|
|
4960
4986
|
"audio/mp4",
|
|
4961
4987
|
"audio/webm;codecs=opus",
|
|
@@ -4968,9 +4994,9 @@ function ka() {
|
|
|
4968
4994
|
"audio/ogg;codecs=opus"
|
|
4969
4995
|
]).find((e) => MediaRecorder.isTypeSupported(e));
|
|
4970
4996
|
}
|
|
4971
|
-
async function
|
|
4997
|
+
async function Na(e, t) {
|
|
4972
4998
|
if (K("transcribe")) try {
|
|
4973
|
-
let n = await
|
|
4999
|
+
let n = await Or("transcribe", {
|
|
4974
5000
|
audio: await new Promise((t, n) => {
|
|
4975
5001
|
let r = new FileReader();
|
|
4976
5002
|
r.onload = () => t(String(r.result).split(",")[1] ?? ""), r.onerror = () => n(r.error), r.readAsDataURL(e);
|
|
@@ -4983,11 +5009,11 @@ async function Aa(e, t) {
|
|
|
4983
5009
|
return;
|
|
4984
5010
|
}
|
|
4985
5011
|
}
|
|
4986
|
-
function
|
|
5012
|
+
function Pa(e) {
|
|
4987
5013
|
return `${Math.floor(e / 60)}:${String(Math.floor(e % 60)).padStart(2, "0")}`;
|
|
4988
5014
|
}
|
|
4989
|
-
function
|
|
4990
|
-
let i = en(e) ? e : null, [a, o] = M(null), [s, c] = M(0), [l, u] = M(!1), [d, f] = M(null), [p, m] = M(!1), [h, g] = M(null), _ = j(null), v = j(null), y =
|
|
5015
|
+
function Fa({ value: e, runId: t, onChange: n, onBusy: r }) {
|
|
5016
|
+
let i = en(e) ? e : null, [a, o] = M(null), [s, c] = M(0), [l, u] = M(!1), [d, f] = M(null), [p, m] = M(!1), [h, g] = M(null), _ = j(null), v = j(null), y = Ma(), b = ei && !!y;
|
|
4991
5017
|
A(() => () => {
|
|
4992
5018
|
_.current && (_.current.recorder.onstop = null, _.current.stop());
|
|
4993
5019
|
}, []), A(() => () => {
|
|
@@ -5001,7 +5027,7 @@ function Ma({ value: e, runId: t, onChange: n, onBusy: r }) {
|
|
|
5001
5027
|
asset: r.id,
|
|
5002
5028
|
url: URL.createObjectURL(e)
|
|
5003
5029
|
});
|
|
5004
|
-
let { lang: a } = H(), o = await
|
|
5030
|
+
let { lang: a } = H(), o = await Na(e, a);
|
|
5005
5031
|
n({
|
|
5006
5032
|
asset: r.id,
|
|
5007
5033
|
lang: a,
|
|
@@ -5034,7 +5060,7 @@ function Ma({ value: e, runId: t, onChange: n, onBusy: r }) {
|
|
|
5034
5060
|
s.getByteTimeDomainData(l);
|
|
5035
5061
|
let e = 0;
|
|
5036
5062
|
for (let t of l) e = Math.max(e, Math.abs(t - 128));
|
|
5037
|
-
if (c(Math.min(1, e / 64)), o((Date.now() - i) / 1e3), (Date.now() - i) / 1e3 >=
|
|
5063
|
+
if (c(Math.min(1, e / 64)), o((Date.now() - i) / 1e3), (Date.now() - i) / 1e3 >= ja) {
|
|
5038
5064
|
p();
|
|
5039
5065
|
return;
|
|
5040
5066
|
}
|
|
@@ -5046,7 +5072,7 @@ function Ma({ value: e, runId: t, onChange: n, onBusy: r }) {
|
|
|
5046
5072
|
};
|
|
5047
5073
|
n.ondataavailable = (e) => e.data.size && t.push(e.data), n.onstop = () => {
|
|
5048
5074
|
let e = (n.mimeType || y || "audio/webm").split(";")[0], r = e === "audio/mp4" ? "m4a" : e === "audio/ogg" ? "ogg" : "webm", a = Math.max(1, Math.round((Date.now() - i) / 1e3));
|
|
5049
|
-
x(new File(t, `sprachnotiz-${
|
|
5075
|
+
x(new File(t, `sprachnotiz-${yi()}.${r}`, { type: e }), a);
|
|
5050
5076
|
}, _.current = {
|
|
5051
5077
|
recorder: n,
|
|
5052
5078
|
stop: p
|
|
@@ -5075,10 +5101,10 @@ function Ma({ value: e, runId: t, onChange: n, onBusy: r }) {
|
|
|
5075
5101
|
className: "min-w-0 flex-1",
|
|
5076
5102
|
children: [/* @__PURE__ */ F("div", {
|
|
5077
5103
|
className: "font-medium text-[0.9375rem] tabular-nums",
|
|
5078
|
-
children:
|
|
5104
|
+
children: Pa(a)
|
|
5079
5105
|
}), /* @__PURE__ */ F("div", {
|
|
5080
5106
|
className: "text-[0.8125rem] text-ink-3",
|
|
5081
|
-
children: a > 270 ? V("voice.left", { s: Math.ceil(
|
|
5107
|
+
children: a > 270 ? V("voice.left", { s: Math.ceil(ja - a) }) : V("voice.recording")
|
|
5082
5108
|
})]
|
|
5083
5109
|
}),
|
|
5084
5110
|
/* @__PURE__ */ I(J, {
|
|
@@ -5093,7 +5119,7 @@ function Ma({ value: e, runId: t, onChange: n, onBusy: r }) {
|
|
|
5093
5119
|
}) : l ? /* @__PURE__ */ I("div", {
|
|
5094
5120
|
className: "flex items-center gap-3 rounded-xl bg-card p-4 text-[0.875rem] text-ink-3 ring-1 ring-input",
|
|
5095
5121
|
children: [
|
|
5096
|
-
/* @__PURE__ */ F(
|
|
5122
|
+
/* @__PURE__ */ F(Ur, { className: "size-4" }),
|
|
5097
5123
|
" ",
|
|
5098
5124
|
V("run.uploading")
|
|
5099
5125
|
]
|
|
@@ -5114,7 +5140,7 @@ function Ma({ value: e, runId: t, onChange: n, onBusy: r }) {
|
|
|
5114
5140
|
className: "mt-2 flex flex-wrap items-center justify-between gap-2",
|
|
5115
5141
|
children: [/* @__PURE__ */ F("span", {
|
|
5116
5142
|
className: "px-1 text-[0.8125rem] text-ink-3",
|
|
5117
|
-
children: i.seconds ?
|
|
5143
|
+
children: i.seconds ? Pa(i.seconds) : null
|
|
5118
5144
|
}), /* @__PURE__ */ I("div", {
|
|
5119
5145
|
className: "flex gap-1",
|
|
5120
5146
|
children: [b ? /* @__PURE__ */ I(J, {
|
|
@@ -5174,8 +5200,8 @@ function Ma({ value: e, runId: t, onChange: n, onBusy: r }) {
|
|
|
5174
5200
|
}
|
|
5175
5201
|
//#endregion
|
|
5176
5202
|
//#region ../runner/src/fields.tsx
|
|
5177
|
-
function
|
|
5178
|
-
let i = e.columns ?? [], a = Array.isArray(t) && t.length ? t : [{}], o =
|
|
5203
|
+
function Ia({ field: e, value: t, values: n, onChange: r }) {
|
|
5204
|
+
let i = e.columns ?? [], a = Array.isArray(t) && t.length ? t : [{}], o = Xn(e, a, n), s = (e, t, n) => {
|
|
5179
5205
|
r(a.map((r, i) => i === e ? {
|
|
5180
5206
|
...r,
|
|
5181
5207
|
[t]: n
|
|
@@ -5263,22 +5289,22 @@ function Na({ field: e, value: t, values: n, onChange: r }) {
|
|
|
5263
5289
|
]
|
|
5264
5290
|
});
|
|
5265
5291
|
}
|
|
5266
|
-
function
|
|
5292
|
+
function La(e) {
|
|
5267
5293
|
return !!e?.closest("input, textarea, [contenteditable='true']");
|
|
5268
5294
|
}
|
|
5269
|
-
function
|
|
5295
|
+
function Ra({ field: e, value: t, runId: n, onChange: r, onBusy: i }) {
|
|
5270
5296
|
let a = j(null), o = j(null), s = j(null), c = j(null), [l, u] = M(!1), [d, f] = M({}), [p, h] = M(null), [g, _] = M(!1), [v, y] = M(!1), [b, x] = M(null), S = j(null), C = (e) => {
|
|
5271
5297
|
S.current = e, x(e);
|
|
5272
|
-
}, w = e.kind === "image", T = !!e.multiple, te = T ? e.max ?? 30 : 1, ne = w || !!e.camera || !!e.video,
|
|
5273
|
-
|
|
5274
|
-
let
|
|
5298
|
+
}, w = e.kind === "image", T = !!e.multiple, te = T ? e.max ?? 30 : 1, ne = w || !!e.camera || !!e.video, D = !w && !!e.video, O = Array.isArray(t) ? t : typeof t == "string" && t ? [t] : [], k = j(O);
|
|
5299
|
+
k.current = O;
|
|
5300
|
+
let ie = O.length < te, ae = async (e) => {
|
|
5275
5301
|
let t = (w ? e.filter((e) => e.type.startsWith("image/")) : e).sort((e, t) => e.name.localeCompare(t.name, void 0, { numeric: !0 }));
|
|
5276
5302
|
if (!t.length) return;
|
|
5277
|
-
let a = te - (T ?
|
|
5303
|
+
let a = te - (T ? k.current.length : 0);
|
|
5278
5304
|
u(!0), i?.(!0), h(t.length > a && T ? V("run.maxFiles", { n: te }) : null);
|
|
5279
5305
|
try {
|
|
5280
5306
|
for (let e of t.slice(0, Math.max(0, a))) {
|
|
5281
|
-
let t = await
|
|
5307
|
+
let t = await vi(e), i = await U.upload(`${G(n)}/uploads`, t);
|
|
5282
5308
|
f((e) => ({
|
|
5283
5309
|
...e,
|
|
5284
5310
|
[i.id]: {
|
|
@@ -5286,8 +5312,8 @@ function Fa({ field: e, value: t, runId: n, onChange: r, onBusy: i }) {
|
|
|
5286
5312
|
mime: i.mime
|
|
5287
5313
|
}
|
|
5288
5314
|
}));
|
|
5289
|
-
let a = T ? [...
|
|
5290
|
-
|
|
5315
|
+
let a = T ? [...k.current, i.id] : i.id;
|
|
5316
|
+
k.current = T ? a : [i.id], r(a);
|
|
5291
5317
|
}
|
|
5292
5318
|
} catch (e) {
|
|
5293
5319
|
h(e.message);
|
|
@@ -5297,39 +5323,39 @@ function Fa({ field: e, value: t, runId: n, onChange: r, onBusy: i }) {
|
|
|
5297
5323
|
}, oe = j(ae);
|
|
5298
5324
|
oe.current = ae;
|
|
5299
5325
|
let se = (e) => {
|
|
5300
|
-
let t =
|
|
5326
|
+
let t = O.filter((t) => t !== e);
|
|
5301
5327
|
r(T ? t : void 0);
|
|
5302
5328
|
}, ce = (e, t) => {
|
|
5303
|
-
let n =
|
|
5329
|
+
let n = k.current.indexOf(e), i = Math.min(k.current.length - 1, Math.max(0, t));
|
|
5304
5330
|
if (n < 0 || n === i) return;
|
|
5305
|
-
let a =
|
|
5306
|
-
a.splice(i, 0, e),
|
|
5307
|
-
}, le = T &&
|
|
5331
|
+
let a = k.current.filter((t) => t !== e);
|
|
5332
|
+
a.splice(i, 0, e), k.current = a, r(a);
|
|
5333
|
+
}, le = T && O.length > 1;
|
|
5308
5334
|
A(() => {
|
|
5309
|
-
if (!
|
|
5335
|
+
if (!ie) return;
|
|
5310
5336
|
let e = (e) => {
|
|
5311
5337
|
let t = Array.from(e.clipboardData?.files ?? []), n = a.current;
|
|
5312
|
-
if (!t.length || !n ||
|
|
5338
|
+
if (!t.length || !n || La(document.activeElement)) return;
|
|
5313
5339
|
let r = document.querySelectorAll("[data-upload-field]");
|
|
5314
5340
|
(n.matches(":hover") || n.contains(document.activeElement) || r.length === 1) && (e.preventDefault(), oe.current(t));
|
|
5315
5341
|
};
|
|
5316
5342
|
return document.addEventListener("paste", e), () => document.removeEventListener("paste", e);
|
|
5317
|
-
}, [
|
|
5318
|
-
let ue = q("flex flex-col items-center justify-center gap-2 rounded-xl border border-input border-dashed bg-card px-3 text-[0.875rem] text-ink-3 transition hover:border-ember hover:text-ink",
|
|
5343
|
+
}, [ie]);
|
|
5344
|
+
let ue = q("flex flex-col items-center justify-center gap-2 rounded-xl border border-input border-dashed bg-card px-3 text-[0.875rem] text-ink-3 transition hover:border-ember hover:text-ink", O.length ? "py-4" : "py-8");
|
|
5319
5345
|
return /* @__PURE__ */ I("div", {
|
|
5320
5346
|
ref: a,
|
|
5321
5347
|
"data-upload-field": "",
|
|
5322
5348
|
onDragOver: (e) => {
|
|
5323
|
-
|
|
5349
|
+
ie && (e.preventDefault(), y(!0));
|
|
5324
5350
|
},
|
|
5325
5351
|
onDragLeave: () => y(!1),
|
|
5326
5352
|
onDrop: (e) => {
|
|
5327
|
-
y(!1),
|
|
5353
|
+
y(!1), ie && (e.preventDefault(), ae(Array.from(e.dataTransfer.files)));
|
|
5328
5354
|
},
|
|
5329
5355
|
children: [
|
|
5330
|
-
|
|
5356
|
+
O.length ? /* @__PURE__ */ F("div", {
|
|
5331
5357
|
className: "mb-2 flex flex-col gap-2",
|
|
5332
|
-
children:
|
|
5358
|
+
children: O.map((e, t) => {
|
|
5333
5359
|
let r = d[e], i = r?.mime ?? (w ? "image/" : "");
|
|
5334
5360
|
return /* @__PURE__ */ I("div", {
|
|
5335
5361
|
"data-file-id": e,
|
|
@@ -5349,7 +5375,7 @@ function Fa({ field: e, value: t, runId: n, onChange: r, onBusy: i }) {
|
|
|
5349
5375
|
onPointerMove: (t) => {
|
|
5350
5376
|
if (S.current !== e) return;
|
|
5351
5377
|
let n = document.elementFromPoint(t.clientX, t.clientY)?.closest("[data-file-id]"), r = n?.getAttribute("data-file-id");
|
|
5352
|
-
r && r !== e && a.current?.contains(n ?? null) && ce(e,
|
|
5378
|
+
r && r !== e && a.current?.contains(n ?? null) && ce(e, k.current.indexOf(r));
|
|
5353
5379
|
},
|
|
5354
5380
|
onPointerUp: () => C(null),
|
|
5355
5381
|
onPointerCancel: () => C(null),
|
|
@@ -5382,22 +5408,22 @@ function Fa({ field: e, value: t, runId: n, onChange: r, onBusy: i }) {
|
|
|
5382
5408
|
}, e);
|
|
5383
5409
|
})
|
|
5384
5410
|
}) : null,
|
|
5385
|
-
|
|
5411
|
+
ie ? /* @__PURE__ */ I("div", {
|
|
5386
5412
|
className: "flex flex-wrap gap-2",
|
|
5387
5413
|
children: [
|
|
5388
5414
|
/* @__PURE__ */ I("button", {
|
|
5389
5415
|
type: "button",
|
|
5390
5416
|
onClick: () => o.current?.click(),
|
|
5391
5417
|
className: q(ue, "min-w-[9rem] flex-1 px-4", v && "border-ember text-ink"),
|
|
5392
|
-
children: [F(w ? E : fe, { className: "size-6" }), l ? V("run.uploading") :
|
|
5418
|
+
children: [F(w ? E : fe, { className: "size-6" }), l ? V("run.uploading") : O.length ? V("run.uploadMore") : V($r ? "run.uploadTouch" : "run.upload")]
|
|
5393
5419
|
}),
|
|
5394
5420
|
ne ? /* @__PURE__ */ I("button", {
|
|
5395
5421
|
type: "button",
|
|
5396
|
-
onClick: () =>
|
|
5422
|
+
onClick: () => ei ? _(!0) : s.current?.click(),
|
|
5397
5423
|
className: q(ue, "w-28"),
|
|
5398
5424
|
children: [/* @__PURE__ */ F(m, { className: "size-6" }), V("run.camera")]
|
|
5399
5425
|
}) : null,
|
|
5400
|
-
|
|
5426
|
+
D && !(ei && ki) ? /* @__PURE__ */ I("button", {
|
|
5401
5427
|
type: "button",
|
|
5402
5428
|
onClick: () => c.current?.click(),
|
|
5403
5429
|
className: q(ue, "w-28"),
|
|
@@ -5425,7 +5451,7 @@ function Fa({ field: e, value: t, runId: n, onChange: r, onBusy: i }) {
|
|
|
5425
5451
|
ae(Array.from(e.target.files ?? [])), e.target.value = "";
|
|
5426
5452
|
}
|
|
5427
5453
|
}),
|
|
5428
|
-
|
|
5454
|
+
D ? /* @__PURE__ */ F("input", {
|
|
5429
5455
|
ref: c,
|
|
5430
5456
|
type: "file",
|
|
5431
5457
|
hidden: !0,
|
|
@@ -5435,21 +5461,21 @@ function Fa({ field: e, value: t, runId: n, onChange: r, onBusy: i }) {
|
|
|
5435
5461
|
ae(Array.from(e.target.files ?? [])), e.target.value = "";
|
|
5436
5462
|
}
|
|
5437
5463
|
}) : null,
|
|
5438
|
-
/* @__PURE__ */ F(
|
|
5464
|
+
/* @__PURE__ */ F(Ai, {
|
|
5439
5465
|
open: g,
|
|
5440
5466
|
multiple: T,
|
|
5441
|
-
video:
|
|
5467
|
+
video: D,
|
|
5442
5468
|
onClose: () => _(!1),
|
|
5443
5469
|
onCapture: (e) => ae([e]),
|
|
5444
5470
|
onNative: () => s.current?.click()
|
|
5445
5471
|
}),
|
|
5446
5472
|
T && (e.min || e.max) ? /* @__PURE__ */ F("div", {
|
|
5447
5473
|
className: "mt-2 text-[0.8125rem] text-ink-3 tabular-nums",
|
|
5448
|
-
children: e.min &&
|
|
5449
|
-
n:
|
|
5474
|
+
children: e.min && O.length < e.min ? V("run.filesMin", {
|
|
5475
|
+
n: O.length,
|
|
5450
5476
|
min: e.min
|
|
5451
5477
|
}) : e.max ? V("run.filesOf", {
|
|
5452
|
-
n:
|
|
5478
|
+
n: O.length,
|
|
5453
5479
|
max: e.max
|
|
5454
5480
|
}) : null
|
|
5455
5481
|
}) : null,
|
|
@@ -5460,7 +5486,7 @@ function Fa({ field: e, value: t, runId: n, onChange: r, onBusy: i }) {
|
|
|
5460
5486
|
]
|
|
5461
5487
|
});
|
|
5462
5488
|
}
|
|
5463
|
-
function
|
|
5489
|
+
function za(e) {
|
|
5464
5490
|
let t = `${e.id} ${e.label}`.toLowerCase();
|
|
5465
5491
|
return /telefon|phone|handy|mobil(?!it)|\btel\b|rückruf/.test(t) ? {
|
|
5466
5492
|
type: "tel",
|
|
@@ -5493,7 +5519,7 @@ function Ia(e) {
|
|
|
5493
5519
|
autoCapitalize: "words"
|
|
5494
5520
|
} : { autoCapitalize: "sentences" };
|
|
5495
5521
|
}
|
|
5496
|
-
function
|
|
5522
|
+
function Ba({ field: e, value: t, onChange: n }) {
|
|
5497
5523
|
let [r, i] = M(!1);
|
|
5498
5524
|
return /* @__PURE__ */ I("div", {
|
|
5499
5525
|
className: "flex gap-2",
|
|
@@ -5516,7 +5542,7 @@ function La({ field: e, value: t, onChange: n }) {
|
|
|
5516
5542
|
V("scan.button")
|
|
5517
5543
|
]
|
|
5518
5544
|
}),
|
|
5519
|
-
/* @__PURE__ */ F(
|
|
5545
|
+
/* @__PURE__ */ F(fa, {
|
|
5520
5546
|
open: r,
|
|
5521
5547
|
onClose: () => i(!1),
|
|
5522
5548
|
onResult: n
|
|
@@ -5524,16 +5550,16 @@ function La({ field: e, value: t, onChange: n }) {
|
|
|
5524
5550
|
]
|
|
5525
5551
|
});
|
|
5526
5552
|
}
|
|
5527
|
-
var
|
|
5528
|
-
function
|
|
5553
|
+
var Va = 4;
|
|
5554
|
+
function Ha(e) {
|
|
5529
5555
|
let t = /* @__PURE__ */ new Map(), n = e.map((e) => ({
|
|
5530
5556
|
value: e,
|
|
5531
|
-
slot:
|
|
5557
|
+
slot: Jn(e)
|
|
5532
5558
|
})).filter((e) => e.slot).sort((e, t) => Date.parse(e.value) - Date.parse(t.value));
|
|
5533
5559
|
for (let { value: e, slot: r } of n) {
|
|
5534
5560
|
if (!r) continue;
|
|
5535
5561
|
let n = t.get(r.day) ?? {
|
|
5536
|
-
label:
|
|
5562
|
+
label: Yn(e, B),
|
|
5537
5563
|
times: []
|
|
5538
5564
|
};
|
|
5539
5565
|
n.times.push({
|
|
@@ -5543,13 +5569,13 @@ function za(e) {
|
|
|
5543
5569
|
}
|
|
5544
5570
|
return [...t.values()];
|
|
5545
5571
|
}
|
|
5546
|
-
function
|
|
5547
|
-
let o =
|
|
5572
|
+
function Ua({ name: e, label: t, options: n, value: r, onChange: i, disabled: a }) {
|
|
5573
|
+
let o = Ha(n), s = o.findIndex((e) => e.times.some((e) => e.value === r)), [c, l] = M(s >= Va);
|
|
5548
5574
|
if (!o.length) return /* @__PURE__ */ F("p", {
|
|
5549
5575
|
className: "text-[0.875rem] text-ink-3",
|
|
5550
5576
|
children: V("slot.none")
|
|
5551
5577
|
});
|
|
5552
|
-
let u = c ? o : o.slice(0,
|
|
5578
|
+
let u = c ? o : o.slice(0, Va);
|
|
5553
5579
|
return /* @__PURE__ */ I("div", {
|
|
5554
5580
|
className: "flex flex-col gap-4",
|
|
5555
5581
|
children: [/* @__PURE__ */ I("fieldset", {
|
|
@@ -5587,7 +5613,7 @@ function Ba({ name: e, label: t, options: n, value: r, onChange: i, disabled: a
|
|
|
5587
5613
|
}) : null]
|
|
5588
5614
|
});
|
|
5589
5615
|
}
|
|
5590
|
-
function
|
|
5616
|
+
function Wa({ cards: e, value: t, multi: n, runId: r, onChange: i, disabled: a }) {
|
|
5591
5617
|
let o = new Set(n ? Array.isArray(t) ? t.map(String) : [] : t == null || t === "" ? [] : [String(t)]), s = (e) => {
|
|
5592
5618
|
i(n ? o.has(e) ? [...o].filter((t) => t !== e) : [...o, e] : o.has(e) ? "" : e);
|
|
5593
5619
|
}, c = (e) => /^(https?:|data:|\/)/.test(e) ? e : W(`/api/runs/${r}/assets/${e}`);
|
|
@@ -5640,11 +5666,11 @@ function Va({ cards: e, value: t, multi: n, runId: r, onChange: i, disabled: a }
|
|
|
5640
5666
|
})
|
|
5641
5667
|
});
|
|
5642
5668
|
}
|
|
5643
|
-
function
|
|
5669
|
+
function Ga({ field: e, value: t, values: n, runId: r, view: i, onChange: a, onBusy: o, error: s, closed: c }) {
|
|
5644
5670
|
let l = t == null ? "" : String(t), u = new Set(c?.values.map(String)), d;
|
|
5645
5671
|
switch (e.kind) {
|
|
5646
5672
|
case "textarea":
|
|
5647
|
-
d = /* @__PURE__ */ F(
|
|
5673
|
+
d = /* @__PURE__ */ F(Ir, {
|
|
5648
5674
|
value: l,
|
|
5649
5675
|
placeholder: e.placeholder,
|
|
5650
5676
|
autoCapitalize: "sentences",
|
|
@@ -5663,33 +5689,33 @@ function Ha({ field: e, value: t, values: n, runId: r, view: i, onChange: a, onB
|
|
|
5663
5689
|
break;
|
|
5664
5690
|
case "select": {
|
|
5665
5691
|
let n = e.options ?? [], o = i?.cards?.[e.id];
|
|
5666
|
-
d = o?.length ? /* @__PURE__ */ F(
|
|
5692
|
+
d = o?.length ? /* @__PURE__ */ F(Wa, {
|
|
5667
5693
|
cards: o,
|
|
5668
5694
|
value: t,
|
|
5669
5695
|
multi: !1,
|
|
5670
5696
|
runId: r,
|
|
5671
5697
|
onChange: a,
|
|
5672
5698
|
disabled: u
|
|
5673
|
-
}) : n.length <= 5 && n.every((e) => e.length <= 28) ? /* @__PURE__ */ F(
|
|
5699
|
+
}) : n.length <= 5 && n.every((e) => e.length <= 28) ? /* @__PURE__ */ F(Rr, {
|
|
5674
5700
|
value: l,
|
|
5675
5701
|
options: n,
|
|
5676
5702
|
onChange: a,
|
|
5677
5703
|
disabled: [...u],
|
|
5678
|
-
label:
|
|
5679
|
-
}) : /* @__PURE__ */ F(
|
|
5704
|
+
label: br
|
|
5705
|
+
}) : /* @__PURE__ */ F(Lr, {
|
|
5680
5706
|
value: l,
|
|
5681
5707
|
placeholder: "—",
|
|
5682
5708
|
onChange: a,
|
|
5683
5709
|
options: n.map((e) => ({
|
|
5684
5710
|
value: e,
|
|
5685
|
-
label:
|
|
5711
|
+
label: br(e),
|
|
5686
5712
|
disabled: u.has(e)
|
|
5687
5713
|
}))
|
|
5688
5714
|
});
|
|
5689
5715
|
break;
|
|
5690
5716
|
}
|
|
5691
5717
|
case "slot":
|
|
5692
|
-
d = /* @__PURE__ */ F(
|
|
5718
|
+
d = /* @__PURE__ */ F(Ua, {
|
|
5693
5719
|
name: e.id,
|
|
5694
5720
|
label: e.label,
|
|
5695
5721
|
options: e.options ?? [],
|
|
@@ -5700,19 +5726,19 @@ function Ha({ field: e, value: t, values: n, runId: r, view: i, onChange: a, onB
|
|
|
5700
5726
|
break;
|
|
5701
5727
|
case "multiselect": {
|
|
5702
5728
|
let n = i?.cards?.[e.id];
|
|
5703
|
-
d = n?.length ? /* @__PURE__ */ F(
|
|
5729
|
+
d = n?.length ? /* @__PURE__ */ F(Wa, {
|
|
5704
5730
|
cards: n,
|
|
5705
5731
|
value: t,
|
|
5706
5732
|
multi: !0,
|
|
5707
5733
|
runId: r,
|
|
5708
5734
|
onChange: a,
|
|
5709
5735
|
disabled: u
|
|
5710
|
-
}) : /* @__PURE__ */ F(
|
|
5736
|
+
}) : /* @__PURE__ */ F(Rr, {
|
|
5711
5737
|
multi: !0,
|
|
5712
5738
|
value: Array.isArray(t) ? t : [],
|
|
5713
5739
|
options: e.options ?? [],
|
|
5714
5740
|
onChange: a,
|
|
5715
|
-
label:
|
|
5741
|
+
label: br
|
|
5716
5742
|
});
|
|
5717
5743
|
break;
|
|
5718
5744
|
}
|
|
@@ -5751,7 +5777,7 @@ function Ha({ field: e, value: t, values: n, runId: r, view: i, onChange: a, onB
|
|
|
5751
5777
|
});
|
|
5752
5778
|
break;
|
|
5753
5779
|
case "toggle":
|
|
5754
|
-
d = /* @__PURE__ */ F(
|
|
5780
|
+
d = /* @__PURE__ */ F(Vr, {
|
|
5755
5781
|
checked: t === !0,
|
|
5756
5782
|
onChange: a,
|
|
5757
5783
|
label: e.label,
|
|
@@ -5761,7 +5787,7 @@ function Ha({ field: e, value: t, values: n, runId: r, view: i, onChange: a, onB
|
|
|
5761
5787
|
case "color":
|
|
5762
5788
|
d = /* @__PURE__ */ I("div", {
|
|
5763
5789
|
className: "flex items-center gap-3",
|
|
5764
|
-
children: [/* @__PURE__ */ F(
|
|
5790
|
+
children: [/* @__PURE__ */ F(Fr, {
|
|
5765
5791
|
value: l || "#e0531b",
|
|
5766
5792
|
onChange: (e) => a(e.target.value)
|
|
5767
5793
|
}), /* @__PURE__ */ F(X, {
|
|
@@ -5777,7 +5803,7 @@ function Ha({ field: e, value: t, values: n, runId: r, view: i, onChange: a, onB
|
|
|
5777
5803
|
break;
|
|
5778
5804
|
case "image":
|
|
5779
5805
|
case "file":
|
|
5780
|
-
d = /* @__PURE__ */ F(
|
|
5806
|
+
d = /* @__PURE__ */ F(Ra, {
|
|
5781
5807
|
field: e,
|
|
5782
5808
|
value: t,
|
|
5783
5809
|
runId: r,
|
|
@@ -5786,7 +5812,7 @@ function Ha({ field: e, value: t, values: n, runId: r, view: i, onChange: a, onB
|
|
|
5786
5812
|
});
|
|
5787
5813
|
break;
|
|
5788
5814
|
case "items":
|
|
5789
|
-
d = /* @__PURE__ */ F(
|
|
5815
|
+
d = /* @__PURE__ */ F(Ia, {
|
|
5790
5816
|
field: e,
|
|
5791
5817
|
value: t,
|
|
5792
5818
|
values: n,
|
|
@@ -5794,14 +5820,14 @@ function Ha({ field: e, value: t, values: n, runId: r, view: i, onChange: a, onB
|
|
|
5794
5820
|
});
|
|
5795
5821
|
break;
|
|
5796
5822
|
case "connection":
|
|
5797
|
-
d = /* @__PURE__ */ F(
|
|
5823
|
+
d = /* @__PURE__ */ F(xa, {
|
|
5798
5824
|
runId: r,
|
|
5799
5825
|
connection: i?.connections.find((t) => t.id === e.connection)
|
|
5800
5826
|
});
|
|
5801
5827
|
break;
|
|
5802
5828
|
case "list": {
|
|
5803
5829
|
let t = i?.lists.find((t) => t.def.id === e.list);
|
|
5804
|
-
d = t ? /* @__PURE__ */ F(
|
|
5830
|
+
d = t ? /* @__PURE__ */ F(wa, {
|
|
5805
5831
|
runId: r,
|
|
5806
5832
|
list: t,
|
|
5807
5833
|
editable: !0
|
|
@@ -5809,7 +5835,7 @@ function Ha({ field: e, value: t, values: n, runId: r, view: i, onChange: a, onB
|
|
|
5809
5835
|
break;
|
|
5810
5836
|
}
|
|
5811
5837
|
case "location":
|
|
5812
|
-
d = /* @__PURE__ */ F(
|
|
5838
|
+
d = /* @__PURE__ */ F(ca, {
|
|
5813
5839
|
value: t,
|
|
5814
5840
|
runId: r,
|
|
5815
5841
|
placeholder: e.placeholder,
|
|
@@ -5818,7 +5844,7 @@ function Ha({ field: e, value: t, values: n, runId: r, view: i, onChange: a, onB
|
|
|
5818
5844
|
});
|
|
5819
5845
|
break;
|
|
5820
5846
|
case "audio":
|
|
5821
|
-
d = c ? null : /* @__PURE__ */ F(
|
|
5847
|
+
d = c ? null : /* @__PURE__ */ F(Fa, {
|
|
5822
5848
|
value: t,
|
|
5823
5849
|
runId: r,
|
|
5824
5850
|
onChange: a,
|
|
@@ -5826,19 +5852,19 @@ function Ha({ field: e, value: t, values: n, runId: r, view: i, onChange: a, onB
|
|
|
5826
5852
|
});
|
|
5827
5853
|
break;
|
|
5828
5854
|
case "signature":
|
|
5829
|
-
d = /* @__PURE__ */ F(
|
|
5855
|
+
d = /* @__PURE__ */ F(ya, {
|
|
5830
5856
|
label: e.label,
|
|
5831
5857
|
value: t,
|
|
5832
5858
|
runId: r,
|
|
5833
5859
|
onChange: a
|
|
5834
5860
|
});
|
|
5835
5861
|
break;
|
|
5836
|
-
default: d = e.scan ? /* @__PURE__ */ F(
|
|
5862
|
+
default: d = e.scan ? /* @__PURE__ */ F(Ba, {
|
|
5837
5863
|
field: e,
|
|
5838
5864
|
value: l,
|
|
5839
5865
|
onChange: a
|
|
5840
5866
|
}) : /* @__PURE__ */ F(X, {
|
|
5841
|
-
...
|
|
5867
|
+
...za(e),
|
|
5842
5868
|
value: l,
|
|
5843
5869
|
placeholder: e.placeholder,
|
|
5844
5870
|
onChange: (e) => a(e.target.value)
|
|
@@ -5847,18 +5873,18 @@ function Ha({ field: e, value: t, values: n, runId: r, view: i, onChange: a, onB
|
|
|
5847
5873
|
return /* @__PURE__ */ I("div", { children: [
|
|
5848
5874
|
e.kind === "toggle" ? /* @__PURE__ */ I("div", {
|
|
5849
5875
|
className: "flex items-start justify-between gap-6",
|
|
5850
|
-
children: [/* @__PURE__ */ F(
|
|
5876
|
+
children: [/* @__PURE__ */ F(Hr, {
|
|
5851
5877
|
hint: e.help,
|
|
5852
5878
|
children: e.label
|
|
5853
5879
|
}), d]
|
|
5854
|
-
}) : /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F(
|
|
5880
|
+
}) : /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F(Hr, {
|
|
5855
5881
|
hint: e.help,
|
|
5856
5882
|
required: e.required,
|
|
5857
5883
|
children: e.label
|
|
5858
5884
|
}), d] }),
|
|
5859
5885
|
c ? /* @__PURE__ */ F("div", {
|
|
5860
5886
|
className: "mt-1.5 text-[0.8125rem] text-ink-3",
|
|
5861
|
-
children: V("run.closed", { list: c.classes.map((e) => V(`run.cls.${
|
|
5887
|
+
children: V("run.closed", { list: c.classes.map((e) => V(`run.cls.${Ka(e)}`)).join(", ") })
|
|
5862
5888
|
}) : null,
|
|
5863
5889
|
s ? /* @__PURE__ */ F("div", {
|
|
5864
5890
|
className: "mt-1.5 text-[0.8125rem] text-rose",
|
|
@@ -5866,24 +5892,24 @@ function Ha({ field: e, value: t, values: n, runId: r, view: i, onChange: a, onB
|
|
|
5866
5892
|
}) : null
|
|
5867
5893
|
] });
|
|
5868
5894
|
}
|
|
5869
|
-
function
|
|
5870
|
-
return e in
|
|
5895
|
+
function Ka(e) {
|
|
5896
|
+
return e in qa ? qa[e] : e === "account" ? "account" : "text";
|
|
5871
5897
|
}
|
|
5872
|
-
var
|
|
5898
|
+
var qa = {
|
|
5873
5899
|
classifier: "text",
|
|
5900
|
+
low: "text",
|
|
5874
5901
|
standard: "text",
|
|
5875
5902
|
high: "text",
|
|
5876
|
-
highest: "text",
|
|
5877
5903
|
image: "image",
|
|
5878
5904
|
video: "video",
|
|
5879
5905
|
speech: "speech",
|
|
5880
5906
|
audio: "audio"
|
|
5881
|
-
},
|
|
5882
|
-
function
|
|
5907
|
+
}, Ja = 3e3, Ya = /* @__PURE__ */ new Set();
|
|
5908
|
+
function Xa(e, t, n) {
|
|
5883
5909
|
let r = `${e.family}\n${e.url}`;
|
|
5884
|
-
if (
|
|
5885
|
-
|
|
5886
|
-
let i = !1, a = setTimeout(() => i || n(),
|
|
5910
|
+
if (Ya.has(r)) return;
|
|
5911
|
+
Ya.add(r);
|
|
5912
|
+
let i = !1, a = setTimeout(() => i || n(), Ja), o = () => {
|
|
5887
5913
|
i = !0, clearTimeout(a);
|
|
5888
5914
|
}, s = () => {
|
|
5889
5915
|
o(), n();
|
|
@@ -5904,8 +5930,8 @@ function qa(e, t, n) {
|
|
|
5904
5930
|
}
|
|
5905
5931
|
//#endregion
|
|
5906
5932
|
//#region ../runner/src/json-view.tsx
|
|
5907
|
-
var Z = (e) => e == null ? "" : typeof e == "object" ? JSON.stringify(e) : String(e),
|
|
5908
|
-
function
|
|
5933
|
+
var Z = (e) => e == null ? "" : typeof e == "object" ? JSON.stringify(e) : String(e), Za = "mb-1.5 font-medium text-[0.75rem] text-ink-3 uppercase tracking-[0.06em]";
|
|
5934
|
+
function Qa(e, t) {
|
|
5909
5935
|
if (e?.kind === "object") return e;
|
|
5910
5936
|
let n = [...new Set(t.flatMap((e) => Object.keys(e ?? {})))];
|
|
5911
5937
|
return {
|
|
@@ -5919,11 +5945,11 @@ function Ya(e, t) {
|
|
|
5919
5945
|
}))
|
|
5920
5946
|
};
|
|
5921
5947
|
}
|
|
5922
|
-
function
|
|
5948
|
+
function $a(e) {
|
|
5923
5949
|
let t = Object.values(e.fields), n = t.filter((e) => e.kind === "number").length;
|
|
5924
5950
|
return n >= 3 && n > t.length / 2;
|
|
5925
5951
|
}
|
|
5926
|
-
function
|
|
5952
|
+
function eo(e, t, n) {
|
|
5927
5953
|
if (t == null || t === "") return "";
|
|
5928
5954
|
switch (e.kind) {
|
|
5929
5955
|
case "number": return `${typeof t == "number" ? t.toLocaleString(B) : Z(t)}${e.unit ? ` ${e.unit}` : ""}`;
|
|
@@ -5935,7 +5961,7 @@ function Za(e, t, n) {
|
|
|
5935
5961
|
default: return Z(t);
|
|
5936
5962
|
}
|
|
5937
5963
|
}
|
|
5938
|
-
function
|
|
5964
|
+
function to({ items: e }) {
|
|
5939
5965
|
return /* @__PURE__ */ F("div", {
|
|
5940
5966
|
className: "flex flex-wrap gap-1.5",
|
|
5941
5967
|
children: e.map((e, t) => /* @__PURE__ */ F("span", {
|
|
@@ -5944,9 +5970,9 @@ function Qa({ items: e }) {
|
|
|
5944
5970
|
}, t))
|
|
5945
5971
|
});
|
|
5946
5972
|
}
|
|
5947
|
-
function
|
|
5948
|
-
let r = t.map((t) =>
|
|
5949
|
-
return r.every((e) => e.length <= 32) ? /* @__PURE__ */ F(
|
|
5973
|
+
function no({ of: e, values: t, root: n }) {
|
|
5974
|
+
let r = t.map((t) => eo(e, t, n)).filter(Boolean);
|
|
5975
|
+
return r.every((e) => e.length <= 32) ? /* @__PURE__ */ F(to, { items: r }) : /* @__PURE__ */ F("ul", {
|
|
5950
5976
|
className: "flex list-disc flex-col gap-1 pl-5 text-[0.9375rem]",
|
|
5951
5977
|
children: r.map((e, t) => /* @__PURE__ */ F("li", {
|
|
5952
5978
|
className: "break-words",
|
|
@@ -5954,7 +5980,7 @@ function $a({ of: e, values: t, root: n }) {
|
|
|
5954
5980
|
}, t))
|
|
5955
5981
|
});
|
|
5956
5982
|
}
|
|
5957
|
-
function
|
|
5983
|
+
function ro({ shape: e, rows: t, root: n }) {
|
|
5958
5984
|
let r = Object.entries(e.fields);
|
|
5959
5985
|
return /* @__PURE__ */ F("div", {
|
|
5960
5986
|
className: "overflow-x-auto rounded-lg ring-1 ring-border-soft",
|
|
@@ -5970,18 +5996,18 @@ function eo({ shape: e, rows: t, root: n }) {
|
|
|
5970
5996
|
className: "border-border-soft border-t",
|
|
5971
5997
|
children: r.map(([t, r]) => /* @__PURE__ */ F("td", {
|
|
5972
5998
|
className: q("px-3 py-2 tabular-nums", r.kind === "number" && "text-right"),
|
|
5973
|
-
children:
|
|
5999
|
+
children: eo(r, e?.[t], n)
|
|
5974
6000
|
}, t))
|
|
5975
6001
|
}, t)) })]
|
|
5976
6002
|
})
|
|
5977
6003
|
});
|
|
5978
6004
|
}
|
|
5979
|
-
function
|
|
6005
|
+
function io({ shape: e, rows: t, root: n }) {
|
|
5980
6006
|
let r = Object.entries(e.fields), i = r.find(([, e]) => e.kind === "text" && e.long)?.[0] ?? jt(e), a = r.filter(([e, t]) => e !== i && e !== "id" && t.kind !== "list"), o = !!r.find(([, e]) => e.kind === "text" && e.long);
|
|
5981
6007
|
return /* @__PURE__ */ F(o ? "ol" : "ul", {
|
|
5982
6008
|
className: "flex flex-col gap-1.5 text-[0.875rem]",
|
|
5983
6009
|
children: t.map((e, t) => {
|
|
5984
|
-
let r = [i ? Z(e?.[i]) : "", ...a.map(([t, r]) =>
|
|
6010
|
+
let r = [i ? Z(e?.[i]) : "", ...a.map(([t, r]) => eo(r, e?.[t], n))].filter(Boolean);
|
|
5985
6011
|
return /* @__PURE__ */ I("li", {
|
|
5986
6012
|
className: q(o && "grid grid-cols-[1.25rem_1fr] gap-1.5"),
|
|
5987
6013
|
children: [o ? /* @__PURE__ */ F("span", {
|
|
@@ -5995,7 +6021,7 @@ function to({ shape: e, rows: t, root: n }) {
|
|
|
5995
6021
|
})
|
|
5996
6022
|
});
|
|
5997
6023
|
}
|
|
5998
|
-
function
|
|
6024
|
+
function ao({ fields: e, entry: t }) {
|
|
5999
6025
|
let n = e.flatMap(([e, n]) => {
|
|
6000
6026
|
if (n.kind !== "yesno" || t[e] === void 0 || t[e] === null) return [];
|
|
6001
6027
|
let r = t[e] ? n.yes ?? L(e, n) : n.no;
|
|
@@ -6013,7 +6039,7 @@ function no({ fields: e, entry: t }) {
|
|
|
6013
6039
|
}, e.k))
|
|
6014
6040
|
}) : null;
|
|
6015
6041
|
}
|
|
6016
|
-
function
|
|
6042
|
+
function oo({ shape: e, rows: t, root: n }) {
|
|
6017
6043
|
let r = Object.entries(e.fields).filter(([e]) => e !== "id"), i = jt(e), a = r.filter(([, e]) => e.kind === "yesno"), o = r.filter(([e, t]) => e !== i && t.kind !== "yesno");
|
|
6018
6044
|
return /* @__PURE__ */ F("div", {
|
|
6019
6045
|
className: "divide-y divide-border-soft overflow-hidden rounded-xl bg-card ring-1 ring-border-soft",
|
|
@@ -6026,16 +6052,16 @@ function ro({ shape: e, rows: t, root: n }) {
|
|
|
6026
6052
|
children: i ? Z(e?.[i]) : ""
|
|
6027
6053
|
}), /* @__PURE__ */ F("div", {
|
|
6028
6054
|
className: "text-[0.8125rem] text-ink-3",
|
|
6029
|
-
children: o.map(([t, r]) =>
|
|
6055
|
+
children: o.map(([t, r]) => eo(r, e?.[t], n)).filter(Boolean).join(" · ")
|
|
6030
6056
|
})]
|
|
6031
|
-
}), /* @__PURE__ */ F(
|
|
6057
|
+
}), /* @__PURE__ */ F(ao, {
|
|
6032
6058
|
fields: a,
|
|
6033
6059
|
entry: e ?? {}
|
|
6034
6060
|
})]
|
|
6035
6061
|
}, t))
|
|
6036
6062
|
});
|
|
6037
6063
|
}
|
|
6038
|
-
function
|
|
6064
|
+
function so({ shape: e, entry: t, root: n }) {
|
|
6039
6065
|
let r = Object.entries(e.fields).filter(([e]) => e !== "id"), i = jt(e), a = r.find(([, e]) => e.kind === "text" && e.long), o = r.filter(([e, t]) => e !== i && e !== a?.[0] && (t.kind === "number" || t.kind === "choice" || t.kind === "score" || t.kind === "ref" || t.kind === "text" && !t.long)), s = r.filter(([, e]) => e.kind === "yesno"), c = r.filter(([e, t]) => t.kind === "text" && t.long && e !== a?.[0]), l = r.filter(([, e]) => e.kind === "list" || e.kind === "table");
|
|
6040
6066
|
return /* @__PURE__ */ I("article", {
|
|
6041
6067
|
className: "flex flex-col gap-2 rounded-xl bg-card p-4 ring-1 ring-border-soft",
|
|
@@ -6045,7 +6071,7 @@ function io({ shape: e, entry: t, root: n }) {
|
|
|
6045
6071
|
children: [/* @__PURE__ */ F("h4", {
|
|
6046
6072
|
className: "text-balance font-display font-semibold text-[1.0625rem] leading-snug",
|
|
6047
6073
|
children: i ? Z(t[i]) : ""
|
|
6048
|
-
}), /* @__PURE__ */ F(
|
|
6074
|
+
}), /* @__PURE__ */ F(ao, {
|
|
6049
6075
|
fields: s,
|
|
6050
6076
|
entry: t
|
|
6051
6077
|
})]
|
|
@@ -6056,7 +6082,7 @@ function io({ shape: e, entry: t, root: n }) {
|
|
|
6056
6082
|
}) : null,
|
|
6057
6083
|
o.length ? /* @__PURE__ */ F("div", {
|
|
6058
6084
|
className: "flex flex-wrap gap-1.5",
|
|
6059
|
-
children: o.map(([e, r]) =>
|
|
6085
|
+
children: o.map(([e, r]) => eo(r, t[e], n)).filter(Boolean).map((e, t) => /* @__PURE__ */ F("span", {
|
|
6060
6086
|
className: "rounded-full bg-paper-2 px-2 py-0.5 text-[0.75rem] text-ink-2",
|
|
6061
6087
|
children: e
|
|
6062
6088
|
}, t))
|
|
@@ -6073,14 +6099,14 @@ function io({ shape: e, entry: t, root: n }) {
|
|
|
6073
6099
|
return !Array.isArray(i) || !i.length ? null : /* @__PURE__ */ I("div", {
|
|
6074
6100
|
className: "border-border-soft border-t pt-2",
|
|
6075
6101
|
children: [/* @__PURE__ */ F("div", {
|
|
6076
|
-
className:
|
|
6102
|
+
className: Za,
|
|
6077
6103
|
children: L(e, r)
|
|
6078
|
-
}), r.kind === "list" && r.of.kind !== "object" ? /* @__PURE__ */ F(
|
|
6104
|
+
}), r.kind === "list" && r.of.kind !== "object" ? /* @__PURE__ */ F(no, {
|
|
6079
6105
|
of: r.of,
|
|
6080
6106
|
values: i,
|
|
6081
6107
|
root: n
|
|
6082
|
-
}) : /* @__PURE__ */ F(
|
|
6083
|
-
shape:
|
|
6108
|
+
}) : /* @__PURE__ */ F(io, {
|
|
6109
|
+
shape: Qa(r.kind === "list" ? r.of : void 0, i),
|
|
6084
6110
|
rows: i,
|
|
6085
6111
|
root: n
|
|
6086
6112
|
})]
|
|
@@ -6089,26 +6115,26 @@ function io({ shape: e, entry: t, root: n }) {
|
|
|
6089
6115
|
]
|
|
6090
6116
|
});
|
|
6091
6117
|
}
|
|
6092
|
-
function
|
|
6093
|
-
let r =
|
|
6094
|
-
return
|
|
6118
|
+
function co({ of: e, rows: t, root: n }) {
|
|
6119
|
+
let r = Qa(e, t);
|
|
6120
|
+
return $a(r) ? /* @__PURE__ */ F(ro, {
|
|
6095
6121
|
shape: r,
|
|
6096
6122
|
rows: t,
|
|
6097
6123
|
root: n
|
|
6098
6124
|
}) : Object.values(r.fields).some((e) => e.kind === "list" || e.kind === "table" || e.kind === "text" && e.long) ? /* @__PURE__ */ F("div", {
|
|
6099
6125
|
className: "grid grid-cols-[repeat(auto-fill,minmax(min(100%,16rem),1fr))] gap-3",
|
|
6100
|
-
children: t.map((e, t) => /* @__PURE__ */ F(
|
|
6126
|
+
children: t.map((e, t) => /* @__PURE__ */ F(so, {
|
|
6101
6127
|
shape: r,
|
|
6102
6128
|
entry: e ?? {},
|
|
6103
6129
|
root: n
|
|
6104
6130
|
}, t))
|
|
6105
|
-
}) : /* @__PURE__ */ F(
|
|
6131
|
+
}) : /* @__PURE__ */ F(oo, {
|
|
6106
6132
|
shape: r,
|
|
6107
6133
|
rows: t,
|
|
6108
6134
|
root: n
|
|
6109
6135
|
});
|
|
6110
6136
|
}
|
|
6111
|
-
function
|
|
6137
|
+
function lo({ step: e, json: t }) {
|
|
6112
6138
|
if (!t || typeof t != "object" || Array.isArray(t)) return /* @__PURE__ */ F("pre", {
|
|
6113
6139
|
className: "text-[0.8125rem]",
|
|
6114
6140
|
children: JSON.stringify(t, null, 2)
|
|
@@ -6118,12 +6144,12 @@ function oo({ step: e, json: t }) {
|
|
|
6118
6144
|
className: "flex flex-col gap-5",
|
|
6119
6145
|
children: Object.entries(n).map(([e, t]) => {
|
|
6120
6146
|
let i = r.fields[e], a = i ? L(e, i) : e, o;
|
|
6121
|
-
if (Array.isArray(t) && t.length && t.every((e) => e && typeof e == "object")) o = /* @__PURE__ */ F(
|
|
6147
|
+
if (Array.isArray(t) && t.length && t.every((e) => e && typeof e == "object")) o = /* @__PURE__ */ F(co, {
|
|
6122
6148
|
of: i?.kind === "list" ? i.of : void 0,
|
|
6123
6149
|
rows: t,
|
|
6124
6150
|
root: n
|
|
6125
6151
|
});
|
|
6126
|
-
else if (Array.isArray(t)) o = /* @__PURE__ */ F(
|
|
6152
|
+
else if (Array.isArray(t)) o = /* @__PURE__ */ F(no, {
|
|
6127
6153
|
of: i?.kind === "list" ? i.of : { kind: "text" },
|
|
6128
6154
|
values: t,
|
|
6129
6155
|
root: n
|
|
@@ -6136,11 +6162,11 @@ function oo({ step: e, json: t }) {
|
|
|
6136
6162
|
let e = i && i.kind !== "list" && i.kind !== "table" ? i : { kind: "text" };
|
|
6137
6163
|
o = /* @__PURE__ */ F("div", {
|
|
6138
6164
|
className: "whitespace-pre-wrap text-[0.9375rem] leading-relaxed",
|
|
6139
|
-
children:
|
|
6165
|
+
children: eo(e, t, n)
|
|
6140
6166
|
});
|
|
6141
6167
|
}
|
|
6142
6168
|
return /* @__PURE__ */ I("section", { children: [/* @__PURE__ */ F("div", {
|
|
6143
|
-
className:
|
|
6169
|
+
className: Za,
|
|
6144
6170
|
children: a
|
|
6145
6171
|
}), o] }, e);
|
|
6146
6172
|
})
|
|
@@ -6148,7 +6174,7 @@ function oo({ step: e, json: t }) {
|
|
|
6148
6174
|
}
|
|
6149
6175
|
//#endregion
|
|
6150
6176
|
//#region ../runner/src/pdf.ts
|
|
6151
|
-
var
|
|
6177
|
+
var uo = "#282623", fo = "#81807e", po = "#1a5fb4", mo = "#dbd9d6", ho = 483.28, go = {
|
|
6152
6178
|
amp: "&",
|
|
6153
6179
|
lt: "<",
|
|
6154
6180
|
gt: ">",
|
|
@@ -6157,17 +6183,17 @@ var so = "#282623", co = "#81807e", lo = "#1a5fb4", uo = "#dbd9d6", fo = 483.28,
|
|
|
6157
6183
|
"#39": "'",
|
|
6158
6184
|
nbsp: "\xA0"
|
|
6159
6185
|
};
|
|
6160
|
-
function
|
|
6186
|
+
function _o(e) {
|
|
6161
6187
|
return e.replace(/&(#x[0-9a-f]+|#\d+|[a-z]+\d*);/gi, (e, t) => {
|
|
6162
6188
|
if (t[0] === "#") {
|
|
6163
6189
|
let n = t[1]?.toLowerCase() === "x" ? Number.parseInt(t.slice(2), 16) : Number(t.slice(1));
|
|
6164
6190
|
return Number.isFinite(n) ? String.fromCodePoint(n) : e;
|
|
6165
6191
|
}
|
|
6166
|
-
return
|
|
6192
|
+
return go[t.toLowerCase()] ?? e;
|
|
6167
6193
|
});
|
|
6168
6194
|
}
|
|
6169
|
-
function
|
|
6170
|
-
return
|
|
6195
|
+
function vo(e) {
|
|
6196
|
+
return _o(e.replace(/<[^>]+>/g, "")).trim();
|
|
6171
6197
|
}
|
|
6172
6198
|
function Q(e, t = {}) {
|
|
6173
6199
|
let n = [];
|
|
@@ -6176,14 +6202,14 @@ function Q(e, t = {}) {
|
|
|
6176
6202
|
let e = r.tokens;
|
|
6177
6203
|
e?.length ? n.push(...Q(e, t)) : n.push({
|
|
6178
6204
|
...t,
|
|
6179
|
-
text:
|
|
6205
|
+
text: _o(r.text)
|
|
6180
6206
|
});
|
|
6181
6207
|
break;
|
|
6182
6208
|
}
|
|
6183
6209
|
case "escape":
|
|
6184
6210
|
n.push({
|
|
6185
6211
|
...t,
|
|
6186
|
-
text:
|
|
6212
|
+
text: _o(r.text)
|
|
6187
6213
|
});
|
|
6188
6214
|
break;
|
|
6189
6215
|
case "strong":
|
|
@@ -6207,7 +6233,7 @@ function Q(e, t = {}) {
|
|
|
6207
6233
|
case "codespan":
|
|
6208
6234
|
n.push({
|
|
6209
6235
|
...t,
|
|
6210
|
-
text:
|
|
6236
|
+
text: _o(r.text),
|
|
6211
6237
|
color: "#3d3b38"
|
|
6212
6238
|
});
|
|
6213
6239
|
break;
|
|
@@ -6216,7 +6242,7 @@ function Q(e, t = {}) {
|
|
|
6216
6242
|
n.push(...Q(e.tokens, {
|
|
6217
6243
|
...t,
|
|
6218
6244
|
link: e.href,
|
|
6219
|
-
color:
|
|
6245
|
+
color: po,
|
|
6220
6246
|
decoration: "underline"
|
|
6221
6247
|
}));
|
|
6222
6248
|
break;
|
|
@@ -6236,39 +6262,39 @@ function Q(e, t = {}) {
|
|
|
6236
6262
|
case "html":
|
|
6237
6263
|
n.push({
|
|
6238
6264
|
...t,
|
|
6239
|
-
text:
|
|
6265
|
+
text: vo(r.text)
|
|
6240
6266
|
});
|
|
6241
6267
|
break;
|
|
6242
6268
|
default: "tokens" in r && Array.isArray(r.tokens) ? n.push(...Q(r.tokens, t)) : "text" in r && typeof r.text == "string" && n.push({
|
|
6243
6269
|
...t,
|
|
6244
|
-
text:
|
|
6270
|
+
text: _o(r.text)
|
|
6245
6271
|
});
|
|
6246
6272
|
}
|
|
6247
6273
|
return n;
|
|
6248
6274
|
}
|
|
6249
|
-
function
|
|
6250
|
-
let t =
|
|
6275
|
+
function yo(e) {
|
|
6276
|
+
let t = So(e);
|
|
6251
6277
|
if (t.length === 1 && typeof t[0] == "object" && "style" in t[0]) {
|
|
6252
6278
|
let { style: e, ...n } = t[0];
|
|
6253
6279
|
return n;
|
|
6254
6280
|
}
|
|
6255
6281
|
return t.length === 1 ? t[0] : { stack: t };
|
|
6256
6282
|
}
|
|
6257
|
-
function
|
|
6283
|
+
function bo(e, t) {
|
|
6258
6284
|
return {
|
|
6259
6285
|
text: Q(e.tokens),
|
|
6260
6286
|
alignment: e.align ?? "left",
|
|
6261
6287
|
...t ? { style: "th" } : {}
|
|
6262
6288
|
};
|
|
6263
6289
|
}
|
|
6264
|
-
var
|
|
6290
|
+
var xo = {
|
|
6265
6291
|
hLineWidth: () => .5,
|
|
6266
6292
|
vLineWidth: () => 0,
|
|
6267
|
-
hLineColor: () =>
|
|
6293
|
+
hLineColor: () => mo,
|
|
6268
6294
|
paddingTop: () => 4,
|
|
6269
6295
|
paddingBottom: () => 4
|
|
6270
6296
|
};
|
|
6271
|
-
function
|
|
6297
|
+
function So(e) {
|
|
6272
6298
|
let t = [];
|
|
6273
6299
|
for (let n of e) switch (n.type) {
|
|
6274
6300
|
case "space": break;
|
|
@@ -6293,7 +6319,7 @@ function yo(e) {
|
|
|
6293
6319
|
});
|
|
6294
6320
|
break;
|
|
6295
6321
|
case "list": {
|
|
6296
|
-
let e = n, r = e.items.map((e) =>
|
|
6322
|
+
let e = n, r = e.items.map((e) => yo(e.tokens));
|
|
6297
6323
|
t.push(e.ordered ? {
|
|
6298
6324
|
ol: r,
|
|
6299
6325
|
style: "list",
|
|
@@ -6311,23 +6337,23 @@ function yo(e) {
|
|
|
6311
6337
|
table: {
|
|
6312
6338
|
headerRows: 1,
|
|
6313
6339
|
widths: e.header.map(() => "*"),
|
|
6314
|
-
body: [e.header.map((e) =>
|
|
6340
|
+
body: [e.header.map((e) => bo(e, !0)), ...e.rows.map((e) => e.map((e) => bo(e, !1)))]
|
|
6315
6341
|
},
|
|
6316
|
-
layout:
|
|
6342
|
+
layout: xo,
|
|
6317
6343
|
style: "table"
|
|
6318
6344
|
});
|
|
6319
6345
|
break;
|
|
6320
6346
|
}
|
|
6321
6347
|
case "code":
|
|
6322
6348
|
t.push({
|
|
6323
|
-
text:
|
|
6349
|
+
text: _o(n.text),
|
|
6324
6350
|
style: "code",
|
|
6325
6351
|
preserveLeadingSpaces: !0
|
|
6326
6352
|
});
|
|
6327
6353
|
break;
|
|
6328
6354
|
case "blockquote":
|
|
6329
6355
|
t.push({
|
|
6330
|
-
stack:
|
|
6356
|
+
stack: So(n.tokens),
|
|
6331
6357
|
style: "quote"
|
|
6332
6358
|
});
|
|
6333
6359
|
break;
|
|
@@ -6337,10 +6363,10 @@ function yo(e) {
|
|
|
6337
6363
|
type: "line",
|
|
6338
6364
|
x1: 0,
|
|
6339
6365
|
y1: 0,
|
|
6340
|
-
x2:
|
|
6366
|
+
x2: ho,
|
|
6341
6367
|
y2: 0,
|
|
6342
6368
|
lineWidth: .5,
|
|
6343
|
-
lineColor:
|
|
6369
|
+
lineColor: mo
|
|
6344
6370
|
}],
|
|
6345
6371
|
margin: [
|
|
6346
6372
|
0,
|
|
@@ -6351,7 +6377,7 @@ function yo(e) {
|
|
|
6351
6377
|
});
|
|
6352
6378
|
break;
|
|
6353
6379
|
case "html": {
|
|
6354
|
-
let e =
|
|
6380
|
+
let e = vo(n.text);
|
|
6355
6381
|
e && t.push({
|
|
6356
6382
|
text: e,
|
|
6357
6383
|
style: "p"
|
|
@@ -6362,16 +6388,16 @@ function yo(e) {
|
|
|
6362
6388
|
text: Q(n.tokens),
|
|
6363
6389
|
style: "p"
|
|
6364
6390
|
}) : "text" in n && typeof n.text == "string" && t.push({
|
|
6365
|
-
text:
|
|
6391
|
+
text: _o(n.text),
|
|
6366
6392
|
style: "p"
|
|
6367
6393
|
});
|
|
6368
6394
|
}
|
|
6369
6395
|
return t;
|
|
6370
6396
|
}
|
|
6371
|
-
function
|
|
6372
|
-
return
|
|
6397
|
+
function Co(e) {
|
|
6398
|
+
return So(ze.lexer(e));
|
|
6373
6399
|
}
|
|
6374
|
-
function
|
|
6400
|
+
function wo(e, t = (e) => e) {
|
|
6375
6401
|
if (!e || typeof e != "object") return [{
|
|
6376
6402
|
text: JSON.stringify(e, null, 2) ?? "",
|
|
6377
6403
|
style: "code"
|
|
@@ -6403,7 +6429,7 @@ function xo(e, t = (e) => e) {
|
|
|
6403
6429
|
style: "th"
|
|
6404
6430
|
})), ...e.map((e) => t.map((t) => ({ text: e[t] === null || e[t] === void 0 ? "" : String(e[t]) })))]
|
|
6405
6431
|
},
|
|
6406
|
-
layout:
|
|
6432
|
+
layout: xo,
|
|
6407
6433
|
style: "table"
|
|
6408
6434
|
});
|
|
6409
6435
|
} else n.push({
|
|
@@ -6412,8 +6438,8 @@ function xo(e, t = (e) => e) {
|
|
|
6412
6438
|
});
|
|
6413
6439
|
return n;
|
|
6414
6440
|
}
|
|
6415
|
-
function
|
|
6416
|
-
let t = e.json !== void 0 && e.json !== null ?
|
|
6441
|
+
function To(e) {
|
|
6442
|
+
let t = e.json !== void 0 && e.json !== null ? wo(e.json, e.label) : Co(e.text ?? ""), n = e.foot ?? "";
|
|
6417
6443
|
return {
|
|
6418
6444
|
info: { title: e.title },
|
|
6419
6445
|
pageSize: "A4",
|
|
@@ -6427,7 +6453,7 @@ function So(e) {
|
|
|
6427
6453
|
font: "Roboto",
|
|
6428
6454
|
fontSize: 10.5,
|
|
6429
6455
|
lineHeight: 1.3,
|
|
6430
|
-
color:
|
|
6456
|
+
color: uo
|
|
6431
6457
|
},
|
|
6432
6458
|
styles: {
|
|
6433
6459
|
title: {
|
|
@@ -6496,7 +6522,7 @@ function So(e) {
|
|
|
6496
6522
|
label: {
|
|
6497
6523
|
fontSize: 8,
|
|
6498
6524
|
bold: !0,
|
|
6499
|
-
color:
|
|
6525
|
+
color: fo,
|
|
6500
6526
|
characterSpacing: .6,
|
|
6501
6527
|
margin: [
|
|
6502
6528
|
0,
|
|
@@ -6533,12 +6559,12 @@ function So(e) {
|
|
|
6533
6559
|
footer: (e, t) => ({
|
|
6534
6560
|
columns: [{
|
|
6535
6561
|
text: n,
|
|
6536
|
-
color:
|
|
6562
|
+
color: fo,
|
|
6537
6563
|
fontSize: 8.5
|
|
6538
6564
|
}, {
|
|
6539
6565
|
text: `${e} / ${t}`,
|
|
6540
6566
|
alignment: "right",
|
|
6541
|
-
color:
|
|
6567
|
+
color: fo,
|
|
6542
6568
|
fontSize: 8.5
|
|
6543
6569
|
}],
|
|
6544
6570
|
margin: [
|
|
@@ -6550,80 +6576,80 @@ function So(e) {
|
|
|
6550
6576
|
})
|
|
6551
6577
|
};
|
|
6552
6578
|
}
|
|
6553
|
-
var
|
|
6579
|
+
var Eo = { Roboto: {
|
|
6554
6580
|
normal: "Roboto-Regular.ttf",
|
|
6555
6581
|
bold: "Roboto-Medium.ttf",
|
|
6556
6582
|
italics: "Roboto-Italic.ttf",
|
|
6557
6583
|
bolditalics: "Roboto-MediumItalic.ttf"
|
|
6558
|
-
} },
|
|
6559
|
-
function
|
|
6560
|
-
return
|
|
6584
|
+
} }, Do = null;
|
|
6585
|
+
function Oo() {
|
|
6586
|
+
return Do ??= Promise.all([import("pdfmake/build/pdfmake"), import("pdfmake/build/vfs_fonts")]).then(([e, t]) => {
|
|
6561
6587
|
let n = e.default;
|
|
6562
|
-
return n.addVirtualFileSystem(t.default), n.addFonts(
|
|
6588
|
+
return n.addVirtualFileSystem(t.default), n.addFonts(Eo), n;
|
|
6563
6589
|
}).catch((e) => {
|
|
6564
|
-
throw
|
|
6565
|
-
}),
|
|
6590
|
+
throw Do = null, e;
|
|
6591
|
+
}), Do;
|
|
6566
6592
|
}
|
|
6567
|
-
function
|
|
6593
|
+
function ko(e) {
|
|
6568
6594
|
return e.replace(/[\\/:*?"<>|]+|\p{Cc}+/gu, "-").replace(/\s+/g, " ").trim() || "result";
|
|
6569
6595
|
}
|
|
6570
|
-
async function
|
|
6571
|
-
let t = await (await
|
|
6572
|
-
return new File([t], `${
|
|
6596
|
+
async function Ao(e) {
|
|
6597
|
+
let t = await (await Oo()).createPdf(To(e)).getBlob();
|
|
6598
|
+
return new File([t], `${ko(e.title)}.pdf`, { type: "application/pdf" });
|
|
6573
6599
|
}
|
|
6574
6600
|
//#endregion
|
|
6575
6601
|
//#region ../runner/src/surface.tsx
|
|
6576
|
-
var $ = (e) => e == null ? "" : typeof e == "boolean" ? V(e ? "run.yes" : "run.no") : typeof e == "object" ? JSON.stringify(e) : String(e),
|
|
6602
|
+
var $ = (e) => e == null ? "" : typeof e == "boolean" ? V(e ? "run.yes" : "run.no") : typeof e == "object" ? JSON.stringify(e) : String(e), jo = (e) => {
|
|
6577
6603
|
let t = typeof e == "number" ? e : Number(String(e ?? "").replace(",", "."));
|
|
6578
6604
|
return Number.isFinite(t) ? t : 0;
|
|
6579
6605
|
};
|
|
6580
|
-
function
|
|
6606
|
+
function Mo(e, t) {
|
|
6581
6607
|
let n = $(e);
|
|
6582
6608
|
return n ? /^(https?:|data:|\/)/.test(n) ? n : t(n) : null;
|
|
6583
6609
|
}
|
|
6584
|
-
function
|
|
6610
|
+
function No(e, t, n, r) {
|
|
6585
6611
|
return R(e[t], n.data, r);
|
|
6586
6612
|
}
|
|
6587
|
-
function
|
|
6613
|
+
function Po(e, t, n) {
|
|
6588
6614
|
let r = $(t) || "label", i = $(n) || "value";
|
|
6589
6615
|
return Array.isArray(e) ? e.map((e) => ({
|
|
6590
6616
|
label: $(e?.[r]),
|
|
6591
|
-
value:
|
|
6617
|
+
value: jo(e?.[i])
|
|
6592
6618
|
})) : [];
|
|
6593
6619
|
}
|
|
6594
|
-
function
|
|
6620
|
+
function Fo({ c: e, ctx: t, row: n }) {
|
|
6595
6621
|
let r = e.children;
|
|
6596
6622
|
if (!r) return null;
|
|
6597
|
-
if (Array.isArray(r)) return /* @__PURE__ */ F(P, { children: r.map((e) => /* @__PURE__ */ F(
|
|
6623
|
+
if (Array.isArray(r)) return /* @__PURE__ */ F(P, { children: r.map((e) => /* @__PURE__ */ F(Zo, {
|
|
6598
6624
|
id: e,
|
|
6599
6625
|
ctx: t,
|
|
6600
6626
|
row: n
|
|
6601
6627
|
}, e)) });
|
|
6602
6628
|
let i = R({ path: r.path }, t.data, n);
|
|
6603
|
-
return /* @__PURE__ */ F(P, { children: (Array.isArray(i) ? i : []).map((e, n) => /* @__PURE__ */ F(
|
|
6629
|
+
return /* @__PURE__ */ F(P, { children: (Array.isArray(i) ? i : []).map((e, n) => /* @__PURE__ */ F(Zo, {
|
|
6604
6630
|
id: r.componentId,
|
|
6605
6631
|
ctx: t,
|
|
6606
6632
|
row: e
|
|
6607
6633
|
}, n)) });
|
|
6608
6634
|
}
|
|
6609
|
-
var
|
|
6635
|
+
var Io = {
|
|
6610
6636
|
success: "bg-second-tint text-second",
|
|
6611
6637
|
warning: "bg-amber-tint text-ink-2",
|
|
6612
6638
|
accent: "bg-ember-tint text-ember-strong",
|
|
6613
6639
|
default: "bg-paper-2 text-ink-2"
|
|
6614
|
-
},
|
|
6615
|
-
function
|
|
6640
|
+
}, Lo = (e) => Array.isArray(e) ? e : [];
|
|
6641
|
+
function Ro(e, t) {
|
|
6616
6642
|
return typeof e != "object" || !e ? t === "" ? e : void 0 : e[t];
|
|
6617
6643
|
}
|
|
6618
|
-
function
|
|
6644
|
+
function zo(e, t) {
|
|
6619
6645
|
if (typeof e != "object" || !e) return $(e);
|
|
6620
6646
|
let n = e;
|
|
6621
6647
|
return $(t ? n[t] : n.label ?? n.name ?? n.title ?? n.text);
|
|
6622
6648
|
}
|
|
6623
|
-
function
|
|
6649
|
+
function Bo(e, t, n) {
|
|
6624
6650
|
let r = /* @__PURE__ */ new Map();
|
|
6625
6651
|
for (let n of e) {
|
|
6626
|
-
let e = $(
|
|
6652
|
+
let e = $(Ro(n, t));
|
|
6627
6653
|
r.set(e, [...r.get(e) ?? [], n]);
|
|
6628
6654
|
}
|
|
6629
6655
|
let i = (e) => {
|
|
@@ -6632,8 +6658,8 @@ function Lo(e, t, n) {
|
|
|
6632
6658
|
};
|
|
6633
6659
|
return [...r.entries()].sort((e, t) => i(e[0]) - i(t[0]));
|
|
6634
6660
|
}
|
|
6635
|
-
var
|
|
6636
|
-
function
|
|
6661
|
+
var Vo = (e) => e ? `${$(e)} ${B === "de" ? "Min" : "min"}` : "";
|
|
6662
|
+
function Ho({ items: e }) {
|
|
6637
6663
|
return e.length ? /* @__PURE__ */ F("div", {
|
|
6638
6664
|
className: "flex flex-wrap gap-1.5",
|
|
6639
6665
|
children: e.map((e, t) => /* @__PURE__ */ F("span", {
|
|
@@ -6642,12 +6668,12 @@ function zo({ items: e }) {
|
|
|
6642
6668
|
}, t))
|
|
6643
6669
|
}) : null;
|
|
6644
6670
|
}
|
|
6645
|
-
function
|
|
6671
|
+
function Uo(e, t, n) {
|
|
6646
6672
|
let r = e.meta;
|
|
6647
6673
|
return (Array.isArray(r) ? r : [r]).map((e) => $(R(e, t.data, n))).filter(Boolean);
|
|
6648
6674
|
}
|
|
6649
|
-
function
|
|
6650
|
-
let [r, i] = M("0"), a =
|
|
6675
|
+
function Wo({ c: e, ctx: t, row: n }) {
|
|
6676
|
+
let [r, i] = M("0"), a = Lo(e.tabs), o = a.map((e, r) => {
|
|
6651
6677
|
let i = R(e?.count, t.data, n), a = Array.isArray(i) ? i.length : i, o = $(R(e?.label, t.data, n));
|
|
6652
6678
|
return {
|
|
6653
6679
|
id: String(r),
|
|
@@ -6658,24 +6684,24 @@ function Vo({ c: e, ctx: t, row: n }) {
|
|
|
6658
6684
|
className: "flex flex-col gap-4",
|
|
6659
6685
|
children: [/* @__PURE__ */ F("div", {
|
|
6660
6686
|
className: "sticky top-2 z-10 max-w-full self-start overflow-x-auto rounded-full",
|
|
6661
|
-
children: /* @__PURE__ */ F(
|
|
6687
|
+
children: /* @__PURE__ */ F(Br, {
|
|
6662
6688
|
value: r,
|
|
6663
6689
|
onChange: i,
|
|
6664
6690
|
options: o
|
|
6665
6691
|
})
|
|
6666
|
-
}), typeof s == "string" ? /* @__PURE__ */ F(
|
|
6692
|
+
}), typeof s == "string" ? /* @__PURE__ */ F(Zo, {
|
|
6667
6693
|
id: s,
|
|
6668
6694
|
ctx: t,
|
|
6669
6695
|
row: n
|
|
6670
6696
|
}) : null]
|
|
6671
6697
|
});
|
|
6672
6698
|
}
|
|
6673
|
-
function
|
|
6674
|
-
let r = (r) =>
|
|
6699
|
+
function Go({ c: e, ctx: t, row: n }) {
|
|
6700
|
+
let r = (r) => No(e, r, t, n), [i, a] = M(!1), o = Lo(r("items")), s = $(r("labelKey")), c = $(r("detailKey")) || "amount", l = $(r("noteKey")), u = $(r("noteFormat")), d = $(r("groupKey")), f = Lo(r("groupOrder")).map($), p = t.state[e.id] ?? {}, m = (e, t) => `${t}:${zo(e, s)}`, g = o.filter((e, t) => p[m(e, t)]).length, _ = o.map((e, t) => ({
|
|
6675
6701
|
item: e,
|
|
6676
6702
|
i: t
|
|
6677
|
-
})), v = d ?
|
|
6678
|
-
let t = l ?
|
|
6703
|
+
})), v = d ? Bo(o, d, f).map(([e]) => [e, _.filter(({ item: t }) => $(Ro(t, d)) === e)]) : [["", _]], y = (e) => $(Ro(e, c)), b = r("noteMap"), x = (e) => {
|
|
6704
|
+
let t = l ? Ro(e, l) : void 0;
|
|
6679
6705
|
if (typeof t == "boolean") return $((b && typeof b == "object" ? b[String(t)] : "") ?? "");
|
|
6680
6706
|
let n = Array.isArray(t) ? t.map($).join(", ") : $(t);
|
|
6681
6707
|
return n && u ? u.replace("{}", n) : n;
|
|
@@ -6703,7 +6729,7 @@ function Ho({ c: e, ctx: t, row: n }) {
|
|
|
6703
6729
|
type: "button",
|
|
6704
6730
|
onClick: async () => {
|
|
6705
6731
|
let e = v.map(([e, t]) => {
|
|
6706
|
-
let n = t.filter(({ item: e, i: t }) => !p[m(e, t)]).map(({ item: e }) => `☐ ${
|
|
6732
|
+
let n = t.filter(({ item: e, i: t }) => !p[m(e, t)]).map(({ item: e }) => `☐ ${zo(e, s)}${y(e) ? ` – ${y(e)}` : ""}`);
|
|
6707
6733
|
return n.length ? [e, ...n].filter(Boolean).join("\n") : "";
|
|
6708
6734
|
}).filter(Boolean).join("\n\n");
|
|
6709
6735
|
try {
|
|
@@ -6735,7 +6761,7 @@ function Ho({ c: e, ctx: t, row: n }) {
|
|
|
6735
6761
|
className: "min-w-0 flex-1",
|
|
6736
6762
|
children: [/* @__PURE__ */ I("span", {
|
|
6737
6763
|
className: q("text-[0.9375rem]", a && "text-ink-3 line-through"),
|
|
6738
|
-
children: [
|
|
6764
|
+
children: [zo(n, s), y(n) ? /* @__PURE__ */ I("span", {
|
|
6739
6765
|
className: "text-ink-3",
|
|
6740
6766
|
children: [" · ", y(n)]
|
|
6741
6767
|
}) : null]
|
|
@@ -6749,7 +6775,7 @@ function Ho({ c: e, ctx: t, row: n }) {
|
|
|
6749
6775
|
}, n))]
|
|
6750
6776
|
});
|
|
6751
6777
|
}
|
|
6752
|
-
function
|
|
6778
|
+
function Ko({ data: e }) {
|
|
6753
6779
|
let t = Math.max(1, ...e.map((e) => e.value));
|
|
6754
6780
|
return /* @__PURE__ */ F("div", {
|
|
6755
6781
|
className: "flex flex-col gap-1.5",
|
|
@@ -6775,8 +6801,8 @@ function Uo({ data: e }) {
|
|
|
6775
6801
|
}, n))
|
|
6776
6802
|
});
|
|
6777
6803
|
}
|
|
6778
|
-
function
|
|
6779
|
-
if (e.length < 2) return /* @__PURE__ */ F(
|
|
6804
|
+
function qo({ data: e }) {
|
|
6805
|
+
if (e.length < 2) return /* @__PURE__ */ F(Ko, { data: e });
|
|
6780
6806
|
let t = Math.max(...e.map((e) => e.value)), n = Math.min(...e.map((e) => e.value)), r = t - n || 1, i = e.map((t, i) => [i / (e.length - 1) * 312 + 4, 116 - (t.value - n) / r * 112]);
|
|
6781
6807
|
return /* @__PURE__ */ I("figure", { children: [/* @__PURE__ */ I("svg", {
|
|
6782
6808
|
viewBox: "0 0 320 120",
|
|
@@ -6800,14 +6826,14 @@ function Wo({ data: e }) {
|
|
|
6800
6826
|
children: [/* @__PURE__ */ F("span", { children: e[0].label }), /* @__PURE__ */ F("span", { children: e.at(-1)?.label })]
|
|
6801
6827
|
})] });
|
|
6802
6828
|
}
|
|
6803
|
-
var
|
|
6829
|
+
var Jo = [
|
|
6804
6830
|
"var(--color-ember)",
|
|
6805
6831
|
"var(--color-cobalt)",
|
|
6806
6832
|
"var(--color-moss)",
|
|
6807
6833
|
"var(--color-amber)",
|
|
6808
6834
|
"var(--color-ink-3)"
|
|
6809
6835
|
];
|
|
6810
|
-
function
|
|
6836
|
+
function Yo({ data: e }) {
|
|
6811
6837
|
let t = e.reduce((e, t) => e + Math.max(0, t.value), 0) || 1, n = 0, r = 2 * Math.PI * 40;
|
|
6812
6838
|
return /* @__PURE__ */ I("div", {
|
|
6813
6839
|
className: "flex items-center gap-4",
|
|
@@ -6821,7 +6847,7 @@ function Ko({ data: e }) {
|
|
|
6821
6847
|
cy: "50",
|
|
6822
6848
|
r: 40,
|
|
6823
6849
|
fill: "none",
|
|
6824
|
-
stroke:
|
|
6850
|
+
stroke: Jo[i % Jo.length],
|
|
6825
6851
|
strokeWidth: "16",
|
|
6826
6852
|
strokeDasharray: `${a} ${r - a}`,
|
|
6827
6853
|
strokeDashoffset: -n,
|
|
@@ -6836,7 +6862,7 @@ function Ko({ data: e }) {
|
|
|
6836
6862
|
children: [
|
|
6837
6863
|
/* @__PURE__ */ F("span", {
|
|
6838
6864
|
className: "size-2.5 rounded-full",
|
|
6839
|
-
style: { background:
|
|
6865
|
+
style: { background: Jo[t % Jo.length] }
|
|
6840
6866
|
}),
|
|
6841
6867
|
/* @__PURE__ */ F("span", {
|
|
6842
6868
|
className: "text-ink-2",
|
|
@@ -6851,7 +6877,7 @@ function Ko({ data: e }) {
|
|
|
6851
6877
|
})]
|
|
6852
6878
|
});
|
|
6853
6879
|
}
|
|
6854
|
-
function
|
|
6880
|
+
function Xo({ title: e, children: t }) {
|
|
6855
6881
|
return /* @__PURE__ */ I("div", {
|
|
6856
6882
|
className: "rounded-xl bg-card p-4 ring-1 ring-border-soft",
|
|
6857
6883
|
children: [e ? /* @__PURE__ */ F("div", {
|
|
@@ -6860,14 +6886,14 @@ function qo({ title: e, children: t }) {
|
|
|
6860
6886
|
}) : null, t]
|
|
6861
6887
|
});
|
|
6862
6888
|
}
|
|
6863
|
-
function
|
|
6889
|
+
function Zo({ id: e, ctx: t, row: n }) {
|
|
6864
6890
|
let r = t.byId.get(e);
|
|
6865
6891
|
if (!r) return null;
|
|
6866
|
-
let i = (e) =>
|
|
6892
|
+
let i = (e) => No(r, e, t, n);
|
|
6867
6893
|
switch (r.component) {
|
|
6868
6894
|
case "Column": return /* @__PURE__ */ F("div", {
|
|
6869
6895
|
className: "flex flex-col gap-4",
|
|
6870
|
-
children: /* @__PURE__ */ F(
|
|
6896
|
+
children: /* @__PURE__ */ F(Fo, {
|
|
6871
6897
|
c: r,
|
|
6872
6898
|
ctx: t,
|
|
6873
6899
|
row: n
|
|
@@ -6882,14 +6908,14 @@ function Jo({ id: e, ctx: t, row: n }) {
|
|
|
6882
6908
|
}
|
|
6883
6909
|
case "List": return /* @__PURE__ */ F("div", {
|
|
6884
6910
|
className: "flex flex-col divide-y divide-border-soft overflow-hidden rounded-xl bg-card ring-1 ring-border-soft",
|
|
6885
|
-
children: /* @__PURE__ */ F(
|
|
6911
|
+
children: /* @__PURE__ */ F(Fo, {
|
|
6886
6912
|
c: r,
|
|
6887
6913
|
ctx: t,
|
|
6888
6914
|
row: n
|
|
6889
6915
|
})
|
|
6890
6916
|
});
|
|
6891
6917
|
case "Row": {
|
|
6892
|
-
let e =
|
|
6918
|
+
let e = Mo(i("image"), t.assetUrl), n = $(i("badge"));
|
|
6893
6919
|
return /* @__PURE__ */ I("div", {
|
|
6894
6920
|
className: "flex items-center gap-3 px-4 py-3",
|
|
6895
6921
|
children: [
|
|
@@ -6913,7 +6939,7 @@ function Jo({ id: e, ctx: t, row: n }) {
|
|
|
6913
6939
|
children: $(i("meta"))
|
|
6914
6940
|
}) : null,
|
|
6915
6941
|
n ? /* @__PURE__ */ F("span", {
|
|
6916
|
-
className: q("shrink-0 rounded-full px-2 py-0.5 text-[0.75rem]",
|
|
6942
|
+
className: q("shrink-0 rounded-full px-2 py-0.5 text-[0.75rem]", Io[$(i("badgeTone"))] ?? Io.default),
|
|
6917
6943
|
children: n
|
|
6918
6944
|
}) : null
|
|
6919
6945
|
]
|
|
@@ -6936,15 +6962,15 @@ function Jo({ id: e, ctx: t, row: n }) {
|
|
|
6936
6962
|
});
|
|
6937
6963
|
}
|
|
6938
6964
|
case "Badge": return /* @__PURE__ */ F("span", {
|
|
6939
|
-
className: q("inline-flex w-fit rounded-full px-2.5 py-0.5 text-[0.75rem]",
|
|
6965
|
+
className: q("inline-flex w-fit rounded-full px-2.5 py-0.5 text-[0.75rem]", Io[$(i("tone"))] ?? Io.default),
|
|
6940
6966
|
children: $(i("label"))
|
|
6941
6967
|
});
|
|
6942
6968
|
case "Grid": {
|
|
6943
|
-
let e = Math.min(4, Math.max(1,
|
|
6969
|
+
let e = Math.min(4, Math.max(1, jo(i("columns")) || 2)), a = Math.min(24, Math.max(6, jo(i("min")) || (e > 2 ? 9 : 12)));
|
|
6944
6970
|
return /* @__PURE__ */ F("div", {
|
|
6945
6971
|
className: "grid gap-3",
|
|
6946
6972
|
style: { gridTemplateColumns: `repeat(auto-fit, minmax(min(100%, ${a}rem), 1fr))` },
|
|
6947
|
-
children: /* @__PURE__ */ F(
|
|
6973
|
+
children: /* @__PURE__ */ F(Fo, {
|
|
6948
6974
|
c: r,
|
|
6949
6975
|
ctx: t,
|
|
6950
6976
|
row: n
|
|
@@ -6997,28 +7023,28 @@ function Jo({ id: e, ctx: t, row: n }) {
|
|
|
6997
7023
|
});
|
|
6998
7024
|
}
|
|
6999
7025
|
case "Image": {
|
|
7000
|
-
let e =
|
|
7026
|
+
let e = Mo(i("src"), t.assetUrl);
|
|
7001
7027
|
return e ? /* @__PURE__ */ F("img", {
|
|
7002
7028
|
src: e,
|
|
7003
7029
|
alt: $(i("alt")),
|
|
7004
7030
|
className: "w-full rounded-xl"
|
|
7005
7031
|
}) : null;
|
|
7006
7032
|
}
|
|
7007
|
-
case "BarChart": return /* @__PURE__ */ F(
|
|
7033
|
+
case "BarChart": return /* @__PURE__ */ F(Xo, {
|
|
7008
7034
|
title: $(i("title")),
|
|
7009
|
-
children: /* @__PURE__ */ F(
|
|
7035
|
+
children: /* @__PURE__ */ F(Ko, { data: Po(i("points"), i("labelKey"), i("valueKey")) })
|
|
7010
7036
|
});
|
|
7011
|
-
case "LineChart": return /* @__PURE__ */ F(
|
|
7037
|
+
case "LineChart": return /* @__PURE__ */ F(Xo, {
|
|
7012
7038
|
title: $(i("title")),
|
|
7013
|
-
children: /* @__PURE__ */ F(
|
|
7039
|
+
children: /* @__PURE__ */ F(qo, { data: Po(i("points"), i("labelKey"), i("valueKey")) })
|
|
7014
7040
|
});
|
|
7015
|
-
case "DonutChart": return /* @__PURE__ */ F(
|
|
7041
|
+
case "DonutChart": return /* @__PURE__ */ F(Xo, {
|
|
7016
7042
|
title: $(i("title")),
|
|
7017
|
-
children: /* @__PURE__ */ F(
|
|
7043
|
+
children: /* @__PURE__ */ F(Yo, { data: Po(i("slices"), i("labelKey"), i("valueKey")) })
|
|
7018
7044
|
});
|
|
7019
7045
|
case "Actions": return /* @__PURE__ */ F("div", {
|
|
7020
7046
|
className: "flex flex-wrap gap-2",
|
|
7021
|
-
children: /* @__PURE__ */ F(
|
|
7047
|
+
children: /* @__PURE__ */ F(Fo, {
|
|
7022
7048
|
c: r,
|
|
7023
7049
|
ctx: t,
|
|
7024
7050
|
row: n
|
|
@@ -7031,7 +7057,7 @@ function Jo({ id: e, ctx: t, row: n }) {
|
|
|
7031
7057
|
onClick: () => {
|
|
7032
7058
|
let n = i("target");
|
|
7033
7059
|
if (e === "open") {
|
|
7034
|
-
let e =
|
|
7060
|
+
let e = Mo(n, t.assetUrl);
|
|
7035
7061
|
e && window.open(e, "_blank", "noopener");
|
|
7036
7062
|
return;
|
|
7037
7063
|
}
|
|
@@ -7044,13 +7070,13 @@ function Jo({ id: e, ctx: t, row: n }) {
|
|
|
7044
7070
|
children: $(i("label"))
|
|
7045
7071
|
});
|
|
7046
7072
|
}
|
|
7047
|
-
case "Tabs": return /* @__PURE__ */ F(
|
|
7073
|
+
case "Tabs": return /* @__PURE__ */ F(Wo, {
|
|
7048
7074
|
c: r,
|
|
7049
7075
|
ctx: t,
|
|
7050
7076
|
row: n
|
|
7051
7077
|
});
|
|
7052
7078
|
case "Card": {
|
|
7053
|
-
let e =
|
|
7079
|
+
let e = Mo(i("image"), t.assetUrl), a = $(i("eyebrow")), o = $(i("subtitle"));
|
|
7054
7080
|
return /* @__PURE__ */ I("article", {
|
|
7055
7081
|
className: "overflow-hidden rounded-xl bg-card ring-1 ring-border-soft",
|
|
7056
7082
|
children: [
|
|
@@ -7074,12 +7100,12 @@ function Jo({ id: e, ctx: t, row: n }) {
|
|
|
7074
7100
|
className: "text-[0.875rem] text-ink-3 leading-relaxed",
|
|
7075
7101
|
children: o
|
|
7076
7102
|
}) : null,
|
|
7077
|
-
/* @__PURE__ */ F(
|
|
7103
|
+
/* @__PURE__ */ F(Ho, { items: Uo(r, t, n) })
|
|
7078
7104
|
]
|
|
7079
7105
|
}),
|
|
7080
7106
|
r.children ? /* @__PURE__ */ F("div", {
|
|
7081
7107
|
className: "flex flex-col gap-3 border-border-soft border-t px-4 py-3.5 empty:hidden",
|
|
7082
|
-
children: /* @__PURE__ */ F(
|
|
7108
|
+
children: /* @__PURE__ */ F(Fo, {
|
|
7083
7109
|
c: r,
|
|
7084
7110
|
ctx: t,
|
|
7085
7111
|
row: n
|
|
@@ -7096,7 +7122,7 @@ function Jo({ id: e, ctx: t, row: n }) {
|
|
|
7096
7122
|
children: [$(i("title")), /* @__PURE__ */ F(g, { className: "size-4 text-ink-3 transition-transform group-open:rotate-90 motion-reduce:transition-none" })]
|
|
7097
7123
|
}), /* @__PURE__ */ F("div", {
|
|
7098
7124
|
className: "flex flex-col gap-3 pt-3",
|
|
7099
|
-
children: /* @__PURE__ */ F(
|
|
7125
|
+
children: /* @__PURE__ */ F(Fo, {
|
|
7100
7126
|
c: r,
|
|
7101
7127
|
ctx: t,
|
|
7102
7128
|
row: n
|
|
@@ -7106,15 +7132,15 @@ function Jo({ id: e, ctx: t, row: n }) {
|
|
|
7106
7132
|
case "Group": {
|
|
7107
7133
|
let e = r.children;
|
|
7108
7134
|
if (!e || Array.isArray(e)) return null;
|
|
7109
|
-
let a =
|
|
7135
|
+
let a = Lo(R({ path: e.path }, t.data, n));
|
|
7110
7136
|
return /* @__PURE__ */ F("div", {
|
|
7111
7137
|
className: "flex flex-col gap-5",
|
|
7112
|
-
children:
|
|
7138
|
+
children: Bo(a, $(i("by")), Lo(i("order")).map($)).map(([n, r]) => /* @__PURE__ */ I("section", {
|
|
7113
7139
|
className: "flex flex-col gap-2",
|
|
7114
7140
|
children: [n ? /* @__PURE__ */ F("h4", {
|
|
7115
7141
|
className: "font-semibold text-[0.6875rem] text-second uppercase tracking-[0.14em]",
|
|
7116
7142
|
children: n
|
|
7117
|
-
}) : null, r.map((n, r) => /* @__PURE__ */ F(
|
|
7143
|
+
}) : null, r.map((n, r) => /* @__PURE__ */ F(Zo, {
|
|
7118
7144
|
id: e.componentId,
|
|
7119
7145
|
ctx: t,
|
|
7120
7146
|
row: n
|
|
@@ -7131,17 +7157,17 @@ function Jo({ id: e, ctx: t, row: n }) {
|
|
|
7131
7157
|
children: r
|
|
7132
7158
|
}) : null, /* @__PURE__ */ F("div", {
|
|
7133
7159
|
className: "flex flex-wrap gap-1.5",
|
|
7134
|
-
children:
|
|
7135
|
-
let a = !!(t &&
|
|
7160
|
+
children: Lo(i("items")).map((r, i) => {
|
|
7161
|
+
let a = !!(t && Ro(r, t));
|
|
7136
7162
|
return /* @__PURE__ */ I("span", {
|
|
7137
7163
|
className: q("rounded-full px-2.5 py-1 text-[0.8125rem]", a ? "bg-amber-tint font-medium text-ink ring-1 ring-amber/60" : "bg-card text-ink-2 ring-1 ring-border-soft"),
|
|
7138
|
-
children: [
|
|
7164
|
+
children: [zo(r, e), a && n ? ` · ${n}` : ""]
|
|
7139
7165
|
}, i);
|
|
7140
7166
|
})
|
|
7141
7167
|
})]
|
|
7142
7168
|
});
|
|
7143
7169
|
}
|
|
7144
|
-
case "Checklist": return /* @__PURE__ */ F(
|
|
7170
|
+
case "Checklist": return /* @__PURE__ */ F(Go, {
|
|
7145
7171
|
c: r,
|
|
7146
7172
|
ctx: t,
|
|
7147
7173
|
row: n
|
|
@@ -7150,8 +7176,8 @@ function Jo({ id: e, ctx: t, row: n }) {
|
|
|
7150
7176
|
let e = $(i("textKey")) || "text", t = $(i("minutesKey")) || "minutes";
|
|
7151
7177
|
return /* @__PURE__ */ F("ol", {
|
|
7152
7178
|
className: "flex flex-col gap-3",
|
|
7153
|
-
children:
|
|
7154
|
-
let i = $(typeof n == "object" ?
|
|
7179
|
+
children: Lo(i("items")).map((n, r) => {
|
|
7180
|
+
let i = $(typeof n == "object" ? Ro(n, e) : n), a = Vo(Ro(n, t));
|
|
7155
7181
|
return /* @__PURE__ */ I("li", {
|
|
7156
7182
|
className: "grid grid-cols-[1.5rem_1fr] gap-2",
|
|
7157
7183
|
children: [/* @__PURE__ */ F("span", {
|
|
@@ -7169,9 +7195,9 @@ function Jo({ id: e, ctx: t, row: n }) {
|
|
|
7169
7195
|
});
|
|
7170
7196
|
}
|
|
7171
7197
|
case "Link": {
|
|
7172
|
-
let e = $(i("key")) || "id", n = $(i("value")), a =
|
|
7198
|
+
let e = $(i("key")) || "id", n = $(i("value")), a = Lo(i("items")).find((t) => $(Ro(t, e)) === n), o = r.view;
|
|
7173
7199
|
if (a === void 0) return null;
|
|
7174
|
-
let s = (e) => R(r[e], t.data, a), c = $(i("eyebrow")), l =
|
|
7200
|
+
let s = (e) => R(r[e], t.data, a), c = $(i("eyebrow")), l = Uo(r, t, a);
|
|
7175
7201
|
return /* @__PURE__ */ I("button", {
|
|
7176
7202
|
type: "button",
|
|
7177
7203
|
onClick: () => typeof o == "string" && t.open(o, a),
|
|
@@ -7203,7 +7229,7 @@ function Jo({ id: e, ctx: t, row: n }) {
|
|
|
7203
7229
|
let e = $(i("tone")) || "tip", t = $(i("title"));
|
|
7204
7230
|
return /* @__PURE__ */ I("div", {
|
|
7205
7231
|
className: q("flex gap-2.5 rounded-xl px-4 py-3 text-[0.875rem] leading-relaxed", e === "tip" && "bg-second-tint", e === "note" && "bg-paper-2", e === "warning" && "bg-amber-tint"),
|
|
7206
|
-
children: [/* @__PURE__ */ F(
|
|
7232
|
+
children: [/* @__PURE__ */ F(k, { className: q("mt-0.5 size-4 shrink-0", e === "tip" ? "text-second" : "text-ink-3") }), /* @__PURE__ */ I("p", { children: [t ? /* @__PURE__ */ I("b", {
|
|
7207
7233
|
className: "font-semibold",
|
|
7208
7234
|
children: [t, " "]
|
|
7209
7235
|
}) : null, $(i("text"))] })]
|
|
@@ -7212,7 +7238,7 @@ function Jo({ id: e, ctx: t, row: n }) {
|
|
|
7212
7238
|
}
|
|
7213
7239
|
return null;
|
|
7214
7240
|
}
|
|
7215
|
-
function
|
|
7241
|
+
function Qo({ surface: e, assetUrl: t, onAction: n, initial: r, onState: i }) {
|
|
7216
7242
|
let [a, o] = M(r ?? {}), [s, c] = M(null), l = {
|
|
7217
7243
|
byId: new Map(e.components.map((e) => [e.id, e])),
|
|
7218
7244
|
data: e.data,
|
|
@@ -7231,16 +7257,16 @@ function Yo({ surface: e, assetUrl: t, onAction: n, initial: r, onState: i }) {
|
|
|
7231
7257
|
row: t
|
|
7232
7258
|
})
|
|
7233
7259
|
};
|
|
7234
|
-
return /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F(
|
|
7260
|
+
return /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F(Zo, {
|
|
7235
7261
|
id: "root",
|
|
7236
7262
|
ctx: l
|
|
7237
|
-
}), /* @__PURE__ */ F(
|
|
7263
|
+
}), /* @__PURE__ */ F(Gr, {
|
|
7238
7264
|
open: s !== null,
|
|
7239
7265
|
onClose: () => c(null),
|
|
7240
7266
|
height: "tall",
|
|
7241
7267
|
children: s ? /* @__PURE__ */ I("div", {
|
|
7242
7268
|
className: "flex flex-col gap-4",
|
|
7243
|
-
children: [/* @__PURE__ */ F(
|
|
7269
|
+
children: [/* @__PURE__ */ F(Zo, {
|
|
7244
7270
|
id: s.view,
|
|
7245
7271
|
ctx: l,
|
|
7246
7272
|
row: s.row
|
|
@@ -7255,14 +7281,14 @@ function Yo({ surface: e, assetUrl: t, onAction: n, initial: r, onState: i }) {
|
|
|
7255
7281
|
}
|
|
7256
7282
|
//#endregion
|
|
7257
7283
|
//#region ../runner/src/outputs.tsx
|
|
7258
|
-
function
|
|
7284
|
+
function $o({ text: e, className: t }) {
|
|
7259
7285
|
let n = Ie(() => Re.sanitize(ze.parse(e, { async: !1 })), [e]);
|
|
7260
7286
|
return /* @__PURE__ */ F("div", {
|
|
7261
7287
|
className: q("prose-zen", t),
|
|
7262
7288
|
dangerouslySetInnerHTML: { __html: n }
|
|
7263
7289
|
});
|
|
7264
7290
|
}
|
|
7265
|
-
function
|
|
7291
|
+
function es({ src: e, page: t, height: n, fit: r, flow: i, state: a, onState: o }) {
|
|
7266
7292
|
let s = j(null), [c, l] = M(n), [u] = M(() => a ?? {}), d = j(o);
|
|
7267
7293
|
d.current = o, A(() => {
|
|
7268
7294
|
let e = (e) => {
|
|
@@ -7320,7 +7346,7 @@ function Zo({ src: e, page: t, height: n, fit: r, flow: i, state: a, onState: o
|
|
|
7320
7346
|
})]
|
|
7321
7347
|
});
|
|
7322
7348
|
}
|
|
7323
|
-
var
|
|
7349
|
+
var ts = {
|
|
7324
7350
|
disc: {
|
|
7325
7351
|
file: "ai",
|
|
7326
7352
|
box: 566.93,
|
|
@@ -7346,10 +7372,10 @@ var Qo = {
|
|
|
7346
7372
|
h: 266.41
|
|
7347
7373
|
}
|
|
7348
7374
|
};
|
|
7349
|
-
function
|
|
7350
|
-
let i =
|
|
7375
|
+
function ns({ icon: e, tone: t, size: n, className: r }) {
|
|
7376
|
+
let i = ts[e], a = n / i.h;
|
|
7351
7377
|
return /* @__PURE__ */ F("img", {
|
|
7352
|
-
src:
|
|
7378
|
+
src: Dr(`ai-labels/${i.file}-${t}.svg`),
|
|
7353
7379
|
alt: "",
|
|
7354
7380
|
draggable: !1,
|
|
7355
7381
|
className: q("pointer-events-none absolute max-w-none select-none", r),
|
|
@@ -7361,10 +7387,10 @@ function $o({ icon: e, tone: t, size: n, className: r }) {
|
|
|
7361
7387
|
}
|
|
7362
7388
|
});
|
|
7363
7389
|
}
|
|
7364
|
-
function
|
|
7390
|
+
function rs({ ai: e, className: t }) {
|
|
7365
7391
|
let [n, r] = M(!1);
|
|
7366
7392
|
if (!e) return null;
|
|
7367
|
-
let i =
|
|
7393
|
+
let i = ts[e], a = t === "static", o = a ? [["black", "dark:hidden"], ["white", "hidden dark:block"]] : [["white", ""]];
|
|
7368
7394
|
return /* @__PURE__ */ F("button", {
|
|
7369
7395
|
type: "button",
|
|
7370
7396
|
"aria-label": V(e === "edited" ? "ai.modified" : "ai.generated"),
|
|
@@ -7379,12 +7405,12 @@ function es({ ai: e, className: t }) {
|
|
|
7379
7405
|
},
|
|
7380
7406
|
children: o.map(([t, r]) => /* @__PURE__ */ I("span", {
|
|
7381
7407
|
className: r,
|
|
7382
|
-
children: [/* @__PURE__ */ F(
|
|
7408
|
+
children: [/* @__PURE__ */ F(ns, {
|
|
7383
7409
|
icon: "disc",
|
|
7384
7410
|
tone: t,
|
|
7385
7411
|
size: 18,
|
|
7386
7412
|
className: q("transition-opacity duration-200", n ? "opacity-0" : "opacity-100 group-hover:opacity-0 group-focus-visible:opacity-0")
|
|
7387
|
-
}), /* @__PURE__ */ F(
|
|
7413
|
+
}), /* @__PURE__ */ F(ns, {
|
|
7388
7414
|
icon: e,
|
|
7389
7415
|
tone: t,
|
|
7390
7416
|
size: 18,
|
|
@@ -7393,11 +7419,11 @@ function es({ ai: e, className: t }) {
|
|
|
7393
7419
|
}, t))
|
|
7394
7420
|
});
|
|
7395
7421
|
}
|
|
7396
|
-
function
|
|
7422
|
+
function is(e, t) {
|
|
7397
7423
|
let n = e.type === "agent" ? Fn(e).fields[t] : void 0;
|
|
7398
7424
|
return n ? L(t, n) : t;
|
|
7399
7425
|
}
|
|
7400
|
-
function
|
|
7426
|
+
function as({ text: e }) {
|
|
7401
7427
|
let [t, n] = M(!1);
|
|
7402
7428
|
return /* @__PURE__ */ I("button", {
|
|
7403
7429
|
type: "button",
|
|
@@ -7408,10 +7434,10 @@ function ns({ text: e }) {
|
|
|
7408
7434
|
children: [F(t ? h : v, { className: "size-3.5" }), V(t ? "share.copied" : "run.copy")]
|
|
7409
7435
|
});
|
|
7410
7436
|
}
|
|
7411
|
-
function
|
|
7437
|
+
function os({ base: e, step: t, output: n, editable: r, draft: i, onDraft: a, picked: o, onPick: s, onSurfaceAction: c, onView: l }) {
|
|
7412
7438
|
if (!n) return null;
|
|
7413
7439
|
let u = (t) => W(`${e}/assets/${t}`);
|
|
7414
|
-
if (n.surface) return /* @__PURE__ */ F(
|
|
7440
|
+
if (n.surface) return /* @__PURE__ */ F(Qo, {
|
|
7415
7441
|
surface: n.surface,
|
|
7416
7442
|
assetUrl: u,
|
|
7417
7443
|
onAction: c,
|
|
@@ -7429,14 +7455,14 @@ function rs({ base: e, step: t, output: n, editable: r, draft: i, onDraft: a, pi
|
|
|
7429
7455
|
controls: !0,
|
|
7430
7456
|
playsInline: !0,
|
|
7431
7457
|
className: q("rounded-lg bg-black ring-1 ring-border-soft", i ? "max-h-[76vh]" : "w-full")
|
|
7432
|
-
}), /* @__PURE__ */ F(
|
|
7458
|
+
}), /* @__PURE__ */ F(rs, {
|
|
7433
7459
|
ai: e.ai,
|
|
7434
7460
|
className: "top-2 right-2"
|
|
7435
7461
|
})]
|
|
7436
7462
|
});
|
|
7437
7463
|
return t.type === "film" && n.text ? /* @__PURE__ */ I("div", {
|
|
7438
7464
|
className: "flex flex-col gap-4",
|
|
7439
|
-
children: [a, /* @__PURE__ */ F(
|
|
7465
|
+
children: [a, /* @__PURE__ */ F($o, {
|
|
7440
7466
|
text: n.text,
|
|
7441
7467
|
className: "text-[0.875rem] text-ink-2"
|
|
7442
7468
|
})]
|
|
@@ -7447,7 +7473,7 @@ function rs({ base: e, step: t, output: n, editable: r, draft: i, onDraft: a, pi
|
|
|
7447
7473
|
width: 1280,
|
|
7448
7474
|
height: 720
|
|
7449
7475
|
};
|
|
7450
|
-
return r ? /* @__PURE__ */ F(
|
|
7476
|
+
return r ? /* @__PURE__ */ F(es, {
|
|
7451
7477
|
src: u(r.id),
|
|
7452
7478
|
page: i.width,
|
|
7453
7479
|
height: i.height,
|
|
@@ -7468,7 +7494,7 @@ function rs({ base: e, step: t, output: n, editable: r, draft: i, onDraft: a, pi
|
|
|
7468
7494
|
controls: !0,
|
|
7469
7495
|
className: "w-full"
|
|
7470
7496
|
}),
|
|
7471
|
-
/* @__PURE__ */ F(
|
|
7497
|
+
/* @__PURE__ */ F(rs, {
|
|
7472
7498
|
ai: e.ai,
|
|
7473
7499
|
className: "static"
|
|
7474
7500
|
}),
|
|
@@ -7508,7 +7534,7 @@ function rs({ base: e, step: t, output: n, editable: r, draft: i, onDraft: a, pi
|
|
|
7508
7534
|
className: "absolute top-2 left-2 rounded-full bg-card/90 px-2.5 py-1 font-medium text-[0.75rem] text-ink-2",
|
|
7509
7535
|
children: n + 1
|
|
7510
7536
|
}),
|
|
7511
|
-
/* @__PURE__ */ F(
|
|
7537
|
+
/* @__PURE__ */ F(rs, {
|
|
7512
7538
|
ai: e.ai,
|
|
7513
7539
|
className: t.asset === "image" ? "bottom-2 left-2" : "top-2 right-2"
|
|
7514
7540
|
})
|
|
@@ -7523,7 +7549,7 @@ function rs({ base: e, step: t, output: n, editable: r, draft: i, onDraft: a, pi
|
|
|
7523
7549
|
src: u(e.id),
|
|
7524
7550
|
alt: t.title,
|
|
7525
7551
|
className: "w-full rounded-lg bg-paper-2 ring-1 ring-border-soft"
|
|
7526
|
-
}), /* @__PURE__ */ F(
|
|
7552
|
+
}), /* @__PURE__ */ F(rs, { ai: e.ai })]
|
|
7527
7553
|
});
|
|
7528
7554
|
if (t.asset === "video") {
|
|
7529
7555
|
let n = t.options?.aspectRatio === "9:16";
|
|
@@ -7535,17 +7561,17 @@ function rs({ base: e, step: t, output: n, editable: r, draft: i, onDraft: a, pi
|
|
|
7535
7561
|
playsInline: !0,
|
|
7536
7562
|
loop: !0,
|
|
7537
7563
|
className: q("rounded-lg bg-black ring-1 ring-border-soft", n ? "max-h-[70vh]" : "w-full")
|
|
7538
|
-
}), /* @__PURE__ */ F(
|
|
7564
|
+
}), /* @__PURE__ */ F(rs, {
|
|
7539
7565
|
ai: e.ai,
|
|
7540
7566
|
className: "top-2 left-2"
|
|
7541
7567
|
})]
|
|
7542
7568
|
});
|
|
7543
7569
|
}
|
|
7544
|
-
return t.asset === "document" ? /* @__PURE__ */ F(
|
|
7570
|
+
return t.asset === "document" ? /* @__PURE__ */ F(es, {
|
|
7545
7571
|
src: u(e.id),
|
|
7546
7572
|
page: 820,
|
|
7547
7573
|
height: 1100
|
|
7548
|
-
}) : /* @__PURE__ */ F(
|
|
7574
|
+
}) : /* @__PURE__ */ F(es, {
|
|
7549
7575
|
src: u(e.id),
|
|
7550
7576
|
page: null,
|
|
7551
7577
|
height: 760
|
|
@@ -7556,15 +7582,15 @@ function rs({ base: e, step: t, output: n, editable: r, draft: i, onDraft: a, pi
|
|
|
7556
7582
|
return /* @__PURE__ */ I("div", {
|
|
7557
7583
|
className: "flex flex-col gap-4",
|
|
7558
7584
|
children: [
|
|
7559
|
-
t.output.format === "json" && n.json !== void 0 ? /* @__PURE__ */ F(
|
|
7585
|
+
t.output.format === "json" && n.json !== void 0 ? /* @__PURE__ */ F(lo, {
|
|
7560
7586
|
step: t,
|
|
7561
7587
|
json: n.json
|
|
7562
|
-
}) : r ? /* @__PURE__ */ F(
|
|
7588
|
+
}) : r ? /* @__PURE__ */ F(Ir, {
|
|
7563
7589
|
value: i ?? n.text ?? "",
|
|
7564
7590
|
onChange: (e) => a?.(e.target.value),
|
|
7565
7591
|
minRows: 4,
|
|
7566
7592
|
maxRows: 24
|
|
7567
|
-
}) : t.output.format === "markdown" ? /* @__PURE__ */ F(
|
|
7593
|
+
}) : t.output.format === "markdown" ? /* @__PURE__ */ F($o, { text: n.text ?? "" }) : /* @__PURE__ */ F("div", {
|
|
7568
7594
|
className: "whitespace-pre-wrap text-[1rem] leading-relaxed",
|
|
7569
7595
|
children: n.text
|
|
7570
7596
|
}),
|
|
@@ -7574,7 +7600,7 @@ function rs({ base: e, step: t, output: n, editable: r, draft: i, onDraft: a, pi
|
|
|
7574
7600
|
src: u(e.id),
|
|
7575
7601
|
alt: "",
|
|
7576
7602
|
className: "w-full rounded-lg ring-1 ring-border-soft"
|
|
7577
|
-
}), /* @__PURE__ */ F(
|
|
7603
|
+
}), /* @__PURE__ */ F(rs, { ai: e.ai })]
|
|
7578
7604
|
}, e.id)),
|
|
7579
7605
|
o.length ? /* @__PURE__ */ F("ul", {
|
|
7580
7606
|
className: "overflow-hidden rounded-lg ring-1 ring-border-soft",
|
|
@@ -7583,7 +7609,7 @@ function rs({ base: e, step: t, output: n, editable: r, draft: i, onDraft: a, pi
|
|
|
7583
7609
|
children: /* @__PURE__ */ I("a", {
|
|
7584
7610
|
href: u(e.id),
|
|
7585
7611
|
download: e.name,
|
|
7586
|
-
onClick: (t) =>
|
|
7612
|
+
onClick: (t) => Ar(t, u(e.id), e.name),
|
|
7587
7613
|
className: "flex items-center gap-2 px-3 py-2 text-[0.8125rem] hover:bg-paper-2 coarse:min-h-11",
|
|
7588
7614
|
children: [/* @__PURE__ */ F(T, { className: "size-3.5 shrink-0 text-ink-3" }), /* @__PURE__ */ F("span", {
|
|
7589
7615
|
className: "min-w-0 flex-1 truncate",
|
|
@@ -7592,13 +7618,13 @@ function rs({ base: e, step: t, output: n, editable: r, draft: i, onDraft: a, pi
|
|
|
7592
7618
|
})
|
|
7593
7619
|
}, e.id))
|
|
7594
7620
|
}) : null,
|
|
7595
|
-
t.output.format !== "json" && !r && n.text ? /* @__PURE__ */ F("div", { children: /* @__PURE__ */ F(
|
|
7621
|
+
t.output.format !== "json" && !r && n.text ? /* @__PURE__ */ F("div", { children: /* @__PURE__ */ F(as, { text: n.text }) }) : null
|
|
7596
7622
|
]
|
|
7597
7623
|
});
|
|
7598
7624
|
}
|
|
7599
7625
|
return null;
|
|
7600
7626
|
}
|
|
7601
|
-
var
|
|
7627
|
+
var ss = {
|
|
7602
7628
|
png: "PNG",
|
|
7603
7629
|
mp4: "MP4",
|
|
7604
7630
|
mp3: "MP3",
|
|
@@ -7612,17 +7638,17 @@ var is = {
|
|
|
7612
7638
|
json: "JSON",
|
|
7613
7639
|
zip: "ZIP"
|
|
7614
7640
|
};
|
|
7615
|
-
function
|
|
7641
|
+
function cs(e, t) {
|
|
7616
7642
|
return (e.headers.get("content-disposition") ?? "").match(/filename="([^"]+)"/)?.[1] ?? t;
|
|
7617
7643
|
}
|
|
7618
|
-
function
|
|
7644
|
+
function ls(e) {
|
|
7619
7645
|
let t = URL.createObjectURL(e), n = document.createElement("a");
|
|
7620
7646
|
n.href = t, n.download = e.name, n.rel = "noopener", document.body.append(n), n.click(), n.remove(), setTimeout(() => URL.revokeObjectURL(t), 6e4);
|
|
7621
7647
|
}
|
|
7622
|
-
function
|
|
7648
|
+
function us({ url: e, format: t, title: n, make: r }) {
|
|
7623
7649
|
let [i, a] = M("idle"), o = j(null), s = async () => {
|
|
7624
7650
|
if (K("share") && !r) {
|
|
7625
|
-
a("busy"), await
|
|
7651
|
+
a("busy"), await Or("share", {
|
|
7626
7652
|
url: new URL(e, location.href).href,
|
|
7627
7653
|
title: n
|
|
7628
7654
|
}).catch(() => void 0), a("idle");
|
|
@@ -7635,7 +7661,7 @@ function ss({ url: e, format: t, title: n, make: r }) {
|
|
|
7635
7661
|
let n = await fetch(e, { credentials: "include" });
|
|
7636
7662
|
if (!n.ok) throw Error(String(n.status));
|
|
7637
7663
|
let r = await n.blob();
|
|
7638
|
-
o.current = new File([r],
|
|
7664
|
+
o.current = new File([r], cs(n, `download.${t}`), { type: r.type.split(";")[0] });
|
|
7639
7665
|
}
|
|
7640
7666
|
}
|
|
7641
7667
|
let i = {
|
|
@@ -7643,7 +7669,7 @@ function ss({ url: e, format: t, title: n, make: r }) {
|
|
|
7643
7669
|
title: n
|
|
7644
7670
|
};
|
|
7645
7671
|
if (!navigator.canShare(i)) {
|
|
7646
|
-
r ?
|
|
7672
|
+
r ? ls(o.current) : location.href = e, a("idle");
|
|
7647
7673
|
return;
|
|
7648
7674
|
}
|
|
7649
7675
|
await navigator.share(i), a("idle");
|
|
@@ -7658,24 +7684,24 @@ function ss({ url: e, format: t, title: n, make: r }) {
|
|
|
7658
7684
|
"aria-label": V("run.shareFile"),
|
|
7659
7685
|
title: V("run.shareFile"),
|
|
7660
7686
|
className: q("inline-flex h-9 items-center gap-1.5 rounded-full px-3 font-medium text-[0.8125rem] transition coarse:h-11 coarse:px-4", i === "ready" ? "bg-ember-tint text-ink ring-1 ring-ember" : "bg-paper-2 text-ink-2 hover:bg-paper-3 hover:text-ink"),
|
|
7661
|
-
children: [F(i === "busy" ?
|
|
7687
|
+
children: [F(i === "busy" ? Ur : xe, { className: "size-3.5" }), V(i === "ready" ? "run.shareNow" : "run.share")]
|
|
7662
7688
|
});
|
|
7663
7689
|
}
|
|
7664
|
-
var
|
|
7665
|
-
function
|
|
7666
|
-
let s = (n) => W(`${e}/steps/${t}/download?format=${n}`), [c, l] = M(!1), u = j(null), d =
|
|
7690
|
+
var ds = K("share") || _i();
|
|
7691
|
+
function fs({ base: e, stepId: t, formats: n, title: r, step: i, output: a, foot: o }) {
|
|
7692
|
+
let s = (n) => W(`${e}/steps/${t}/download?format=${n}`), [c, l] = M(!1), u = j(null), d = jr() && i?.type === "agent" && a && (a.text || a.json !== void 0) ? {
|
|
7667
7693
|
title: r ?? i.title,
|
|
7668
7694
|
text: a.text,
|
|
7669
7695
|
json: i.output.format === "json" ? a.json : void 0,
|
|
7670
|
-
label: (e) =>
|
|
7696
|
+
label: (e) => is(i, e),
|
|
7671
7697
|
foot: o
|
|
7672
7698
|
} : null, f = async () => {
|
|
7673
7699
|
if (!d) throw Error("nothing written");
|
|
7674
|
-
return u.current ??= await
|
|
7700
|
+
return u.current ??= await Ao(d), u.current;
|
|
7675
7701
|
}, p = async () => {
|
|
7676
7702
|
l(!0);
|
|
7677
7703
|
try {
|
|
7678
|
-
|
|
7704
|
+
ls(await f());
|
|
7679
7705
|
} catch (e) {
|
|
7680
7706
|
console.warn(`pdf: ${e.message}`), n.includes("html") && window.open(s("html"), "_blank", "noopener");
|
|
7681
7707
|
} finally {
|
|
@@ -7689,8 +7715,8 @@ function ls({ base: e, stepId: t, formats: n, title: r, step: i, output: a, foot
|
|
|
7689
7715
|
onClick: () => void p(),
|
|
7690
7716
|
disabled: c,
|
|
7691
7717
|
className: m(t),
|
|
7692
|
-
children: [c ? /* @__PURE__ */ F(
|
|
7693
|
-
}, e) : e === "html" &&
|
|
7718
|
+
children: [c ? /* @__PURE__ */ F(Ur, { className: "size-3.5" }) : t === 0 ? /* @__PURE__ */ F(x, { className: "size-3.5" }) : null, ss[e]]
|
|
7719
|
+
}, e) : e === "html" && jr() ? /* @__PURE__ */ I("a", {
|
|
7694
7720
|
href: s(e),
|
|
7695
7721
|
target: "_blank",
|
|
7696
7722
|
rel: "noopener",
|
|
@@ -7698,10 +7724,10 @@ function ls({ base: e, stepId: t, formats: n, title: r, step: i, output: a, foot
|
|
|
7698
7724
|
children: [t === 0 ? /* @__PURE__ */ F(_e, { className: "size-3.5" }) : null, V("run.print")]
|
|
7699
7725
|
}, e) : /* @__PURE__ */ I("a", {
|
|
7700
7726
|
href: s(e),
|
|
7701
|
-
onClick: (t) =>
|
|
7727
|
+
onClick: (t) => Ar(t, s(e)),
|
|
7702
7728
|
className: m(t),
|
|
7703
|
-
children: [t === 0 ? /* @__PURE__ */ F(x, { className: "size-3.5" }) : null,
|
|
7704
|
-
}, e)),
|
|
7729
|
+
children: [t === 0 ? /* @__PURE__ */ F(x, { className: "size-3.5" }) : null, ss[e]]
|
|
7730
|
+
}, e)), ds && n.length ? /* @__PURE__ */ F(us, {
|
|
7705
7731
|
url: s(n[0]),
|
|
7706
7732
|
format: n[0],
|
|
7707
7733
|
title: r,
|
|
@@ -7711,7 +7737,7 @@ function ls({ base: e, stepId: t, formats: n, title: r, step: i, output: a, foot
|
|
|
7711
7737
|
}
|
|
7712
7738
|
//#endregion
|
|
7713
7739
|
//#region ../runner/src/RunnerView.tsx
|
|
7714
|
-
function
|
|
7740
|
+
function ps({ view: e }) {
|
|
7715
7741
|
let t = Math.round(Math.min(e.progress.done, e.progress.total) / Math.max(1, e.progress.total) * 100);
|
|
7716
7742
|
return /* @__PURE__ */ F("div", {
|
|
7717
7743
|
className: "h-[3px] w-full bg-paper-2",
|
|
@@ -7721,10 +7747,10 @@ function us({ view: e }) {
|
|
|
7721
7747
|
})
|
|
7722
7748
|
});
|
|
7723
7749
|
}
|
|
7724
|
-
var
|
|
7750
|
+
var ms = (e, t) => (n) => {
|
|
7725
7751
|
U.put(`${G(e)}/views/${t}`, { state: n }).catch(() => void 0);
|
|
7726
7752
|
};
|
|
7727
|
-
function
|
|
7753
|
+
function hs({ title: e, description: t, kicker: n }) {
|
|
7728
7754
|
return /* @__PURE__ */ I("div", {
|
|
7729
7755
|
className: "kb-title mb-8",
|
|
7730
7756
|
children: [
|
|
@@ -7743,16 +7769,16 @@ function fs({ title: e, description: t, kicker: n }) {
|
|
|
7743
7769
|
]
|
|
7744
7770
|
});
|
|
7745
7771
|
}
|
|
7746
|
-
function
|
|
7772
|
+
function gs(e, t) {
|
|
7747
7773
|
let n = {};
|
|
7748
7774
|
for (let r of e.fields) n[r.id] = t.values[r.id] ?? t.prefill?.[r.id] ?? r.default ?? (r.kind === "multiselect" ? [] : void 0);
|
|
7749
7775
|
return n;
|
|
7750
7776
|
}
|
|
7751
|
-
function
|
|
7777
|
+
function _s(e) {
|
|
7752
7778
|
return Array.from(e.querySelectorAll("input:not([type=\"hidden\"], [type=\"file\"], [type=\"checkbox\"], [type=\"color\"], [type=\"range\"], [disabled]), textarea:not([disabled])")).filter((e) => !e.closest("dialog") && e.offsetParent !== null);
|
|
7753
7779
|
}
|
|
7754
|
-
function
|
|
7755
|
-
let [r, i] = M(() =>
|
|
7780
|
+
function vs({ view: e, run: t, step: n }) {
|
|
7781
|
+
let [r, i] = M(() => gs(n, e)), [a, o] = M(/* @__PURE__ */ new Set()), s = j(null), c = e.progress.done === 0, u = Kn(Ie(() => n.fields.filter((t) => !Gn(t) || e.decidedFields?.includes(t.id)).map((t) => e.options?.[t.id]?.length ? {
|
|
7756
7782
|
...t,
|
|
7757
7783
|
options: e.options[t.id]
|
|
7758
7784
|
} : t), [
|
|
@@ -7762,7 +7788,7 @@ function hs({ view: e, run: t, step: n }) {
|
|
|
7762
7788
|
]), e.known ?? {}, r), d = () => void t.submitPage(n.id, r);
|
|
7763
7789
|
return A(() => {
|
|
7764
7790
|
if (!s.current) return;
|
|
7765
|
-
let e =
|
|
7791
|
+
let e = _s(s.current).filter((e) => e instanceof HTMLInputElement);
|
|
7766
7792
|
for (let [t, n] of e.entries()) (n.dataset.hint || !n.hasAttribute("enterkeyhint")) && (n.dataset.hint = "1", n.setAttribute("enterkeyhint", t === e.length - 1 ? "go" : "next"));
|
|
7767
7793
|
}), /* @__PURE__ */ I("form", {
|
|
7768
7794
|
ref: s,
|
|
@@ -7773,18 +7799,18 @@ function hs({ view: e, run: t, step: n }) {
|
|
|
7773
7799
|
onKeyDown: (e) => {
|
|
7774
7800
|
let t = e.target;
|
|
7775
7801
|
if (e.key !== "Enter" || e.defaultPrevented || e.nativeEvent.isComposing || !(t instanceof HTMLInputElement) || t.closest("dialog")) return;
|
|
7776
|
-
let n =
|
|
7802
|
+
let n = _s(e.currentTarget), r = n[n.indexOf(t) + 1];
|
|
7777
7803
|
r && (e.preventDefault(), r.focus());
|
|
7778
7804
|
},
|
|
7779
7805
|
children: [
|
|
7780
|
-
/* @__PURE__ */ F(
|
|
7806
|
+
/* @__PURE__ */ F(hs, {
|
|
7781
7807
|
title: n.title,
|
|
7782
7808
|
description: n.description,
|
|
7783
7809
|
kicker: c ? e.wizard.intro : null
|
|
7784
7810
|
}),
|
|
7785
7811
|
/* @__PURE__ */ F("div", {
|
|
7786
7812
|
className: "flex flex-col gap-7",
|
|
7787
|
-
children: u.map((n) => /* @__PURE__ */ F(
|
|
7813
|
+
children: u.map((n) => /* @__PURE__ */ F(Ga, {
|
|
7788
7814
|
field: n,
|
|
7789
7815
|
value: r[n.id],
|
|
7790
7816
|
values: r,
|
|
@@ -7803,7 +7829,7 @@ function hs({ view: e, run: t, step: n }) {
|
|
|
7803
7829
|
})
|
|
7804
7830
|
}, n.id))
|
|
7805
7831
|
}),
|
|
7806
|
-
/* @__PURE__ */ F(
|
|
7832
|
+
/* @__PURE__ */ F(ys, {
|
|
7807
7833
|
view: e,
|
|
7808
7834
|
run: t,
|
|
7809
7835
|
sticky: !0,
|
|
@@ -7822,7 +7848,7 @@ function hs({ view: e, run: t, step: n }) {
|
|
|
7822
7848
|
]
|
|
7823
7849
|
});
|
|
7824
7850
|
}
|
|
7825
|
-
function
|
|
7851
|
+
function ys({ view: e, run: t, sticky: n, children: r }) {
|
|
7826
7852
|
return /* @__PURE__ */ I("div", {
|
|
7827
7853
|
className: q("mt-10 flex items-center justify-between gap-3", n && "action-bar"),
|
|
7828
7854
|
children: [e.canBack ? /* @__PURE__ */ I(J, {
|
|
@@ -7837,8 +7863,8 @@ function gs({ view: e, run: t, sticky: n, children: r }) {
|
|
|
7837
7863
|
}) : /* @__PURE__ */ F("span", {}), r]
|
|
7838
7864
|
});
|
|
7839
7865
|
}
|
|
7840
|
-
function
|
|
7841
|
-
let e =
|
|
7866
|
+
function bs() {
|
|
7867
|
+
let e = di(), [t, n] = M(!1), r = e !== "off";
|
|
7842
7868
|
return /* @__PURE__ */ I("div", {
|
|
7843
7869
|
className: "mt-6 flex flex-col items-center gap-2",
|
|
7844
7870
|
children: [/* @__PURE__ */ I("button", {
|
|
@@ -7847,20 +7873,20 @@ function _s() {
|
|
|
7847
7873
|
disabled: t,
|
|
7848
7874
|
onClick: async () => {
|
|
7849
7875
|
if (r) {
|
|
7850
|
-
|
|
7876
|
+
mi();
|
|
7851
7877
|
return;
|
|
7852
7878
|
}
|
|
7853
|
-
n(!0), await
|
|
7879
|
+
n(!0), await pi(), n(!1);
|
|
7854
7880
|
},
|
|
7855
7881
|
className: q("inline-flex h-11 items-center gap-2 rounded-full px-4 font-medium text-[0.875rem] ring-1 transition", r ? "bg-ember-tint text-ink ring-ember" : "bg-card text-ink-2 ring-input hover:text-ink hover:ring-ink-4"),
|
|
7856
7882
|
children: [r ? /* @__PURE__ */ F(f, { className: "size-4 text-ember-strong" }) : /* @__PURE__ */ F(d, { className: "size-4" }), V(r ? "notify.on" : "notify.ask")]
|
|
7857
7883
|
}), /* @__PURE__ */ F("p", {
|
|
7858
7884
|
className: "max-w-xs text-[0.75rem] text-ink-4 leading-relaxed",
|
|
7859
|
-
children: V(e === "off" ? "notify.why" : e === "on" ? "notify.onHint" :
|
|
7885
|
+
children: V(e === "off" ? "notify.why" : e === "on" ? "notify.onHint" : fi() ? "notify.blocked" : "notify.quiet")
|
|
7860
7886
|
})]
|
|
7861
7887
|
});
|
|
7862
7888
|
}
|
|
7863
|
-
function
|
|
7889
|
+
function xs({ view: e, compact: t, awake: n }) {
|
|
7864
7890
|
let r = Ie(() => {
|
|
7865
7891
|
let t = [...e.events].reverse().find((t) => t.type === "step_started" && t.stepId === e.step?.id);
|
|
7866
7892
|
return t ? new Date(t.at).getTime() : Date.now();
|
|
@@ -7901,11 +7927,11 @@ function vs({ view: e, compact: t, awake: n }) {
|
|
|
7901
7927
|
className: q("flex items-center justify-center gap-2 text-[0.8125rem] transition-opacity", t === c.length - 1 ? "text-ink-2" : "text-ink-4"),
|
|
7902
7928
|
children: [t === c.length - 1 ? /* @__PURE__ */ F(we, { className: "size-3.5 animate-breathe text-ember" }) : null, /* @__PURE__ */ F("span", {
|
|
7903
7929
|
className: "truncate",
|
|
7904
|
-
children:
|
|
7930
|
+
children: _r(e)
|
|
7905
7931
|
})]
|
|
7906
7932
|
}, e.id))
|
|
7907
7933
|
}),
|
|
7908
|
-
t ? null : /* @__PURE__ */ F(
|
|
7934
|
+
t ? null : /* @__PURE__ */ F(bs, {}),
|
|
7909
7935
|
n ? /* @__PURE__ */ F("p", {
|
|
7910
7936
|
className: "mt-3 text-[0.75rem] text-ink-4",
|
|
7911
7937
|
children: V("run.awake")
|
|
@@ -7913,7 +7939,7 @@ function vs({ view: e, compact: t, awake: n }) {
|
|
|
7913
7939
|
]
|
|
7914
7940
|
});
|
|
7915
7941
|
}
|
|
7916
|
-
function
|
|
7942
|
+
function Ss(e) {
|
|
7917
7943
|
let t = j({
|
|
7918
7944
|
running: !1,
|
|
7919
7945
|
since: 0,
|
|
@@ -7922,7 +7948,7 @@ function ys(e) {
|
|
|
7922
7948
|
A(() => {
|
|
7923
7949
|
if (!e) return;
|
|
7924
7950
|
let n = t.current, r = e.status === "running", i = r ? n.running ? n.since : Date.now() : 0, a = (t) => {
|
|
7925
|
-
document.visibilityState !== "visible" && !document.title.startsWith("● ") && (document.title = `● ${document.title}`),
|
|
7951
|
+
document.visibilityState !== "visible" && !document.title.startsWith("● ") && (document.title = `● ${document.title}`), gi({
|
|
7926
7952
|
title: e.wizard.title,
|
|
7927
7953
|
body: t,
|
|
7928
7954
|
tag: e.id
|
|
@@ -7940,14 +7966,14 @@ function ys(e) {
|
|
|
7940
7966
|
return document.addEventListener("visibilitychange", e), () => document.removeEventListener("visibilitychange", e);
|
|
7941
7967
|
}, []);
|
|
7942
7968
|
}
|
|
7943
|
-
function
|
|
7969
|
+
function Cs({ view: e, run: t, step: n, studio: r }) {
|
|
7944
7970
|
let [i, a] = M({}), [o, s] = M({}), [c, u] = M(""), d = e.shown.filter((e) => e.output), [f, p] = M(d.length === 1 ? d[0].step.id : null), [m, h] = M({}), g = j(null), _ = d.find((e) => e.step.id === f), v = _?.step.type === "generate" && (_.output?.assets?.length ?? 0) > 1, y = () => {
|
|
7945
7971
|
_ && c.trim() && t.regenerate(n.id, _.step.id, c.trim(), m[_.step.id]);
|
|
7946
7972
|
};
|
|
7947
7973
|
return /* @__PURE__ */ I("div", {
|
|
7948
7974
|
className: "animate-rise",
|
|
7949
7975
|
children: [
|
|
7950
|
-
/* @__PURE__ */ F(
|
|
7976
|
+
/* @__PURE__ */ F(hs, {
|
|
7951
7977
|
title: n.title,
|
|
7952
7978
|
description: n.description
|
|
7953
7979
|
}),
|
|
@@ -7955,7 +7981,7 @@ function bs({ view: e, run: t, step: n, studio: r }) {
|
|
|
7955
7981
|
className: "flex flex-col gap-6",
|
|
7956
7982
|
children: [
|
|
7957
7983
|
e.shown.filter((e) => e.output).map(({ step: t, output: c }) => {
|
|
7958
|
-
let l =
|
|
7984
|
+
let l = ra(t) ? t : null, u = !!n.edit && t.type === "agent" && (t.output.format !== "json" || !!l), d = i[t.id], f = (e) => /* @__PURE__ */ I("div", {
|
|
7959
7985
|
className: "mb-2 flex items-center justify-between gap-3",
|
|
7960
7986
|
children: [/* @__PURE__ */ F("h3", {
|
|
7961
7987
|
className: "font-medium text-[0.8125rem] text-ink-3 uppercase tracking-[0.06em]",
|
|
@@ -7978,7 +8004,7 @@ function bs({ view: e, run: t, step: n, studio: r }) {
|
|
|
7978
8004
|
})]
|
|
7979
8005
|
}), _ = l && c && u && o[t.id] ? /* @__PURE__ */ F("div", {
|
|
7980
8006
|
className: "overflow-hidden rounded-xl bg-card ring-1 ring-border-soft",
|
|
7981
|
-
children: /* @__PURE__ */ F(
|
|
8007
|
+
children: /* @__PURE__ */ F($i, {
|
|
7982
8008
|
shape: Fn(l),
|
|
7983
8009
|
value: d && typeof d == "object" ? d : c.json ?? {},
|
|
7984
8010
|
onChange: (e) => a((n) => ({
|
|
@@ -7987,11 +8013,11 @@ function bs({ view: e, run: t, step: n, studio: r }) {
|
|
|
7987
8013
|
})),
|
|
7988
8014
|
start: "edit"
|
|
7989
8015
|
})
|
|
7990
|
-
}) : /* @__PURE__ */ F(
|
|
8016
|
+
}) : /* @__PURE__ */ F(os, {
|
|
7991
8017
|
base: `${G(e.id)}`,
|
|
7992
8018
|
step: t,
|
|
7993
8019
|
output: c,
|
|
7994
|
-
onView:
|
|
8020
|
+
onView: ms(e.id, t.id),
|
|
7995
8021
|
editable: u && o[t.id] && !l,
|
|
7996
8022
|
draft: typeof d == "string" ? d : void 0,
|
|
7997
8023
|
onDraft: (e) => a((n) => ({
|
|
@@ -8012,7 +8038,7 @@ function bs({ view: e, run: t, step: n, studio: r }) {
|
|
|
8012
8038
|
p(t.id), g.current?.focus();
|
|
8013
8039
|
} : void 0
|
|
8014
8040
|
});
|
|
8015
|
-
return /* @__PURE__ */ F("section", { children: r && l && c ? /* @__PURE__ */ F(
|
|
8041
|
+
return /* @__PURE__ */ F("section", { children: r && l && c ? /* @__PURE__ */ F(ia, {
|
|
8016
8042
|
runId: e.id,
|
|
8017
8043
|
step: l,
|
|
8018
8044
|
output: c,
|
|
@@ -8023,15 +8049,15 @@ function bs({ view: e, run: t, step: n, studio: r }) {
|
|
|
8023
8049
|
e.lists.map((t) => /* @__PURE__ */ I("section", { children: [/* @__PURE__ */ F("h3", {
|
|
8024
8050
|
className: "mb-2 font-medium text-[0.8125rem] text-ink-3 uppercase tracking-[0.06em]",
|
|
8025
8051
|
children: t.def.title
|
|
8026
|
-
}), t.def.check ? /* @__PURE__ */ F(
|
|
8052
|
+
}), t.def.check ? /* @__PURE__ */ F(Da, {
|
|
8027
8053
|
runId: e.id,
|
|
8028
8054
|
list: t
|
|
8029
|
-
}) : /* @__PURE__ */ F(
|
|
8055
|
+
}) : /* @__PURE__ */ F(wa, {
|
|
8030
8056
|
runId: e.id,
|
|
8031
8057
|
list: t,
|
|
8032
8058
|
editable: !0
|
|
8033
8059
|
})] }, t.def.id)),
|
|
8034
|
-
n.regenerate && d.length ? /* @__PURE__ */ I(
|
|
8060
|
+
n.regenerate && d.length ? /* @__PURE__ */ I(Wr, {
|
|
8035
8061
|
className: "p-3",
|
|
8036
8062
|
children: [
|
|
8037
8063
|
d.length > 1 ? /* @__PURE__ */ I("div", {
|
|
@@ -8049,7 +8075,7 @@ function bs({ view: e, run: t, step: n, studio: r }) {
|
|
|
8049
8075
|
children: e.title
|
|
8050
8076
|
}, e.id))]
|
|
8051
8077
|
}) : null,
|
|
8052
|
-
/* @__PURE__ */ F(
|
|
8078
|
+
/* @__PURE__ */ F(Ir, {
|
|
8053
8079
|
ref: g,
|
|
8054
8080
|
minRows: 2,
|
|
8055
8081
|
maxRows: 8,
|
|
@@ -8083,7 +8109,7 @@ function bs({ view: e, run: t, step: n, studio: r }) {
|
|
|
8083
8109
|
}) : null
|
|
8084
8110
|
]
|
|
8085
8111
|
}),
|
|
8086
|
-
/* @__PURE__ */ F(
|
|
8112
|
+
/* @__PURE__ */ F(ys, {
|
|
8087
8113
|
view: e,
|
|
8088
8114
|
run: t,
|
|
8089
8115
|
sticky: !0,
|
|
@@ -8101,7 +8127,7 @@ function bs({ view: e, run: t, step: n, studio: r }) {
|
|
|
8101
8127
|
]
|
|
8102
8128
|
});
|
|
8103
8129
|
}
|
|
8104
|
-
function
|
|
8130
|
+
function ws({ view: e, run: t, step: n, onRestart: r, studio: i }) {
|
|
8105
8131
|
let a = e.shown.filter((e) => e.output), { Mascot: o, ShareResultButton: s } = H();
|
|
8106
8132
|
return /* @__PURE__ */ I("div", {
|
|
8107
8133
|
className: "animate-rise",
|
|
@@ -8143,7 +8169,7 @@ function xs({ view: e, run: t, step: n, onRestart: r, studio: i }) {
|
|
|
8143
8169
|
children: o ?? n.title
|
|
8144
8170
|
}), /* @__PURE__ */ I("div", {
|
|
8145
8171
|
className: "flex items-center gap-1",
|
|
8146
|
-
children: [/* @__PURE__ */ F(
|
|
8172
|
+
children: [/* @__PURE__ */ F(fs, {
|
|
8147
8173
|
base: `${G(e.id)}`,
|
|
8148
8174
|
stepId: n.id,
|
|
8149
8175
|
formats: a,
|
|
@@ -8153,16 +8179,16 @@ function xs({ view: e, run: t, step: n, onRestart: r, studio: i }) {
|
|
|
8153
8179
|
foot: `${e.wizard.title} · ${(/* @__PURE__ */ new Date()).toLocaleDateString(H().lang)}`
|
|
8154
8180
|
}), t]
|
|
8155
8181
|
})]
|
|
8156
|
-
}), c = /* @__PURE__ */ F(
|
|
8182
|
+
}), c = /* @__PURE__ */ F(Es, {
|
|
8157
8183
|
view: e,
|
|
8158
8184
|
run: t,
|
|
8159
8185
|
step: n,
|
|
8160
8186
|
output: r,
|
|
8161
|
-
onView:
|
|
8187
|
+
onView: ms(e.id, n.id)
|
|
8162
8188
|
});
|
|
8163
|
-
return /* @__PURE__ */ I(
|
|
8189
|
+
return /* @__PURE__ */ I(Wr, {
|
|
8164
8190
|
className: "p-4 sm:p-5",
|
|
8165
|
-
children: [i &&
|
|
8191
|
+
children: [i && ra(n) && r ? /* @__PURE__ */ F(ia, {
|
|
8166
8192
|
runId: e.id,
|
|
8167
8193
|
step: n,
|
|
8168
8194
|
output: r,
|
|
@@ -8173,25 +8199,25 @@ function xs({ view: e, run: t, step: n, onRestart: r, studio: i }) {
|
|
|
8173
8199
|
children: V("ai.publish")
|
|
8174
8200
|
}) : null]
|
|
8175
8201
|
}, n.id);
|
|
8176
|
-
}), e.lists.map((t) => /* @__PURE__ */ I(
|
|
8202
|
+
}), e.lists.map((t) => /* @__PURE__ */ I(Wr, {
|
|
8177
8203
|
className: "p-4 sm:p-5",
|
|
8178
8204
|
children: [/* @__PURE__ */ I("div", {
|
|
8179
8205
|
className: "mb-3 flex flex-wrap items-center justify-between gap-3",
|
|
8180
8206
|
children: [/* @__PURE__ */ F("h3", {
|
|
8181
8207
|
className: "font-display font-semibold text-[1.0625rem]",
|
|
8182
8208
|
children: t.label ?? t.def.title
|
|
8183
|
-
}), /* @__PURE__ */ F(
|
|
8209
|
+
}), /* @__PURE__ */ F(ka, {
|
|
8184
8210
|
runId: e.id,
|
|
8185
8211
|
list: t
|
|
8186
8212
|
})]
|
|
8187
|
-
}), /* @__PURE__ */ F(
|
|
8213
|
+
}), /* @__PURE__ */ F(wa, {
|
|
8188
8214
|
runId: e.id,
|
|
8189
8215
|
list: t,
|
|
8190
8216
|
editable: !0
|
|
8191
8217
|
})]
|
|
8192
8218
|
}, t.def.id))]
|
|
8193
8219
|
}),
|
|
8194
|
-
/* @__PURE__ */ F(
|
|
8220
|
+
/* @__PURE__ */ F(ys, {
|
|
8195
8221
|
view: e,
|
|
8196
8222
|
run: t,
|
|
8197
8223
|
children: r ? /* @__PURE__ */ I(J, {
|
|
@@ -8207,7 +8233,7 @@ function xs({ view: e, run: t, step: n, onRestart: r, studio: i }) {
|
|
|
8207
8233
|
]
|
|
8208
8234
|
});
|
|
8209
8235
|
}
|
|
8210
|
-
function
|
|
8236
|
+
function Ts({ view: e, run: t }) {
|
|
8211
8237
|
let { Mascot: n } = H();
|
|
8212
8238
|
return /* @__PURE__ */ I("div", {
|
|
8213
8239
|
className: "flex animate-rise flex-col items-center pt-8 text-center",
|
|
@@ -8223,7 +8249,7 @@ function Ss({ view: e, run: t }) {
|
|
|
8223
8249
|
}),
|
|
8224
8250
|
/* @__PURE__ */ F("p", {
|
|
8225
8251
|
className: "mt-2 max-w-md text-[0.9375rem] text-ink-3",
|
|
8226
|
-
children: /* @__PURE__ */ F(
|
|
8252
|
+
children: /* @__PURE__ */ F(Kr, { text: e.error ?? "" })
|
|
8227
8253
|
}),
|
|
8228
8254
|
/* @__PURE__ */ I("div", {
|
|
8229
8255
|
className: "mt-8 flex gap-3",
|
|
@@ -8248,9 +8274,9 @@ function Ss({ view: e, run: t }) {
|
|
|
8248
8274
|
]
|
|
8249
8275
|
});
|
|
8250
8276
|
}
|
|
8251
|
-
function
|
|
8277
|
+
function Es({ view: e, run: t, step: n, output: r, onView: i }) {
|
|
8252
8278
|
let [a, o] = M(!1), [s, c] = M(!1), l = G(e.id), u = e.translation?.results[n.id];
|
|
8253
|
-
if (!(e.translation && r?.text && t.translateResult)) return /* @__PURE__ */ F(
|
|
8279
|
+
if (!(e.translation && r?.text && t.translateResult)) return /* @__PURE__ */ F(os, {
|
|
8254
8280
|
base: l,
|
|
8255
8281
|
step: n,
|
|
8256
8282
|
output: r,
|
|
@@ -8260,7 +8286,7 @@ function Cs({ view: e, run: t, step: n, output: r, onView: i }) {
|
|
|
8260
8286
|
...r,
|
|
8261
8287
|
text: u
|
|
8262
8288
|
} : r;
|
|
8263
|
-
return /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F(
|
|
8289
|
+
return /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F(os, {
|
|
8264
8290
|
base: l,
|
|
8265
8291
|
step: n,
|
|
8266
8292
|
output: d,
|
|
@@ -8280,38 +8306,38 @@ function Cs({ view: e, run: t, step: n, output: r, onView: i }) {
|
|
|
8280
8306
|
c(!0), await t.translateResult?.(n.id), c(!1);
|
|
8281
8307
|
},
|
|
8282
8308
|
children: [
|
|
8283
|
-
/* @__PURE__ */ F(
|
|
8309
|
+
/* @__PURE__ */ F(O, { className: "size-4" }),
|
|
8284
8310
|
" ",
|
|
8285
8311
|
V(s ? "translation.working" : "result.translate")
|
|
8286
8312
|
]
|
|
8287
8313
|
})
|
|
8288
8314
|
})] });
|
|
8289
8315
|
}
|
|
8290
|
-
function
|
|
8316
|
+
function Ds({ run: e, compact: t, onRestart: n, onView: r, stickyProgress: i, studio: a }) {
|
|
8291
8317
|
let { view: o } = e;
|
|
8292
|
-
|
|
8318
|
+
yr(o?.translation?.labels), A(() => {
|
|
8293
8319
|
r?.(o);
|
|
8294
|
-
}, [o, r]),
|
|
8295
|
-
let s =
|
|
8296
|
-
if (
|
|
8320
|
+
}, [o, r]), ti();
|
|
8321
|
+
let s = ni(o?.status === "running" && !o.ask);
|
|
8322
|
+
if (Ss(o), e.notFound) return /* @__PURE__ */ F("div", {
|
|
8297
8323
|
className: "py-24 text-center text-ink-3",
|
|
8298
8324
|
children: V("run.notFound")
|
|
8299
8325
|
});
|
|
8300
8326
|
if (!o) return /* @__PURE__ */ F("div", {
|
|
8301
8327
|
className: "flex justify-center py-24 text-ink-4",
|
|
8302
|
-
children: /* @__PURE__ */ F(
|
|
8328
|
+
children: /* @__PURE__ */ F(Ur, {})
|
|
8303
8329
|
});
|
|
8304
8330
|
let c = o.step, l = null;
|
|
8305
|
-
if (o.status === "running" && o.ask) l = /* @__PURE__ */ F(
|
|
8331
|
+
if (o.status === "running" && o.ask) l = /* @__PURE__ */ F(Xr, {
|
|
8306
8332
|
runId: o.id,
|
|
8307
8333
|
ask: o.ask
|
|
8308
8334
|
}, o.ask.id);
|
|
8309
|
-
else if (o.status === "running") l = /* @__PURE__ */ F(
|
|
8335
|
+
else if (o.status === "running") l = /* @__PURE__ */ F(xs, {
|
|
8310
8336
|
view: o,
|
|
8311
8337
|
compact: t,
|
|
8312
8338
|
awake: s
|
|
8313
8339
|
});
|
|
8314
|
-
else if (o.status === "failed") l = /* @__PURE__ */ F(
|
|
8340
|
+
else if (o.status === "failed") l = /* @__PURE__ */ F(Ts, {
|
|
8315
8341
|
view: o,
|
|
8316
8342
|
run: e
|
|
8317
8343
|
});
|
|
@@ -8319,20 +8345,20 @@ function ws({ run: e, compact: t, onRestart: n, onView: r, stickyProgress: i, st
|
|
|
8319
8345
|
className: "py-24 text-center text-ink-3",
|
|
8320
8346
|
children: V("run.cancelled")
|
|
8321
8347
|
});
|
|
8322
|
-
else if (c?.type === "page") l = /* @__PURE__ */ F(
|
|
8348
|
+
else if (c?.type === "page") l = /* @__PURE__ */ F(vs, {
|
|
8323
8349
|
view: o,
|
|
8324
8350
|
run: e,
|
|
8325
8351
|
step: c
|
|
8326
8352
|
}, c.id);
|
|
8327
8353
|
else if (c?.type === "review") {
|
|
8328
8354
|
let t = o.shown.map((e) => e.output?.at ?? "").join("|");
|
|
8329
|
-
l = /* @__PURE__ */ F(
|
|
8355
|
+
l = /* @__PURE__ */ F(Cs, {
|
|
8330
8356
|
view: o,
|
|
8331
8357
|
run: e,
|
|
8332
8358
|
step: c,
|
|
8333
8359
|
studio: a
|
|
8334
8360
|
}, `${c.id}:${t}`);
|
|
8335
|
-
} else c?.type === "result" && (l = /* @__PURE__ */ F(
|
|
8361
|
+
} else c?.type === "result" && (l = /* @__PURE__ */ F(ws, {
|
|
8336
8362
|
view: o,
|
|
8337
8363
|
run: e,
|
|
8338
8364
|
step: c,
|
|
@@ -8344,8 +8370,8 @@ function ws({ run: e, compact: t, onRestart: n, onView: r, stickyProgress: i, st
|
|
|
8344
8370
|
className: "flex min-h-full flex-col",
|
|
8345
8371
|
children: [i ? /* @__PURE__ */ F("div", {
|
|
8346
8372
|
className: "sticky top-0 z-10",
|
|
8347
|
-
children: /* @__PURE__ */ F(
|
|
8348
|
-
}) : /* @__PURE__ */ F(
|
|
8373
|
+
children: /* @__PURE__ */ F(ps, { view: o })
|
|
8374
|
+
}) : /* @__PURE__ */ F(ps, { view: o }), /* @__PURE__ */ I("div", {
|
|
8349
8375
|
className: q("safe-x kb-tight mx-auto w-full flex-1", u ? "max-w-[1240px] py-8" : t ? "max-w-[620px] py-8" : "max-w-[640px] py-8 sm:py-16"),
|
|
8350
8376
|
children: [
|
|
8351
8377
|
l,
|
|
@@ -8355,7 +8381,7 @@ function ws({ run: e, compact: t, onRestart: n, onView: r, stickyProgress: i, st
|
|
|
8355
8381
|
}) : null,
|
|
8356
8382
|
o.keeps && o.status !== "running" ? /* @__PURE__ */ F("div", {
|
|
8357
8383
|
className: "mt-10 flex justify-center",
|
|
8358
|
-
children: /* @__PURE__ */ F(
|
|
8384
|
+
children: /* @__PURE__ */ F(Aa, { runId: o.id })
|
|
8359
8385
|
}) : null
|
|
8360
8386
|
]
|
|
8361
8387
|
})]
|
|
@@ -8363,13 +8389,13 @@ function ws({ run: e, compact: t, onRestart: n, onView: r, stickyProgress: i, st
|
|
|
8363
8389
|
}
|
|
8364
8390
|
//#endregion
|
|
8365
8391
|
//#region ../shared/src/theme.ts
|
|
8366
|
-
var
|
|
8392
|
+
var Os = [
|
|
8367
8393
|
"brand",
|
|
8368
8394
|
"host",
|
|
8369
8395
|
"default"
|
|
8370
8396
|
];
|
|
8371
|
-
[...
|
|
8372
|
-
var
|
|
8397
|
+
[...Os];
|
|
8398
|
+
var ks = [
|
|
8373
8399
|
"Inter",
|
|
8374
8400
|
"Figtree",
|
|
8375
8401
|
"DM Sans",
|
|
@@ -8383,11 +8409,11 @@ var Es = [
|
|
|
8383
8409
|
"Caveat",
|
|
8384
8410
|
"Creepster",
|
|
8385
8411
|
"Nosifer"
|
|
8386
|
-
],
|
|
8387
|
-
accent:
|
|
8388
|
-
background:
|
|
8389
|
-
text:
|
|
8390
|
-
}).extend({ scheme: N.enum(["light", "dark"]) }),
|
|
8412
|
+
], As = N.string().regex(/^#[0-9a-fA-F]{6}$/, "a colour as #rrggbb"), js = N.object({
|
|
8413
|
+
accent: As.optional(),
|
|
8414
|
+
background: As.optional(),
|
|
8415
|
+
text: As.optional()
|
|
8416
|
+
}).extend({ scheme: N.enum(["light", "dark"]) }), Ms = N.object({
|
|
8391
8417
|
radius: N.enum([
|
|
8392
8418
|
"sharp",
|
|
8393
8419
|
"soft",
|
|
@@ -8399,33 +8425,33 @@ var Es = [
|
|
|
8399
8425
|
"glass"
|
|
8400
8426
|
]).optional(),
|
|
8401
8427
|
headings: N.enum(["normal", "uppercase"]).optional()
|
|
8402
|
-
}),
|
|
8428
|
+
}), Ns = N.object({ id: N.string().min(1).max(40) }).catchall(N.union([
|
|
8403
8429
|
N.string().max(40),
|
|
8404
8430
|
N.number(),
|
|
8405
8431
|
N.boolean()
|
|
8406
|
-
])),
|
|
8432
|
+
])), Ps = N.string().min(1).max(60).regex(/^[A-Za-z0-9 -]+$/, "a font by its family name, or brand");
|
|
8407
8433
|
N.object({
|
|
8408
8434
|
id: N.string().regex(qt, "a theme id: lowercase letters, digits and dashes"),
|
|
8409
8435
|
name: N.string().min(1).max(80),
|
|
8410
8436
|
version: N.string().regex(/^\d+\.\d+\.\d+$/).default("1.0.0"),
|
|
8411
|
-
base: N.enum(
|
|
8412
|
-
colors: N.array(
|
|
8437
|
+
base: N.enum(Os).default("brand"),
|
|
8438
|
+
colors: N.array(js).min(1).max(2).refine((e) => new Set(e.map((e) => e.scheme)).size === e.length, { message: "Each scheme once: light, dark." }).optional(),
|
|
8413
8439
|
fonts: N.object({
|
|
8414
|
-
heading:
|
|
8415
|
-
text:
|
|
8440
|
+
heading: Ps.optional(),
|
|
8441
|
+
text: Ps.optional()
|
|
8416
8442
|
}).optional(),
|
|
8417
|
-
shape:
|
|
8418
|
-
effects: N.array(
|
|
8443
|
+
shape: Ms.optional(),
|
|
8444
|
+
effects: N.array(Ns).max(8).optional()
|
|
8419
8445
|
});
|
|
8420
|
-
var
|
|
8421
|
-
function
|
|
8422
|
-
return
|
|
8446
|
+
var Fs = "ui-sans-serif, system-ui, sans-serif", Is = "ui-serif, Georgia, serif", Ls = /serif|fraunces|playfair|lora|garamond|antiqua|baskerville|caslon|bodoni|didot|times|georgia|merriweather|tiempos/i, Rs = (e) => Ls.test(e) && !/sans/i.test(e), zs = (e) => Rs(e) ? "Lora" : "Inter", Bs = (e) => e.toLowerCase().replace(/ /g, "-");
|
|
8447
|
+
function Vs(e) {
|
|
8448
|
+
return ks.includes(e) ? `/api/public/fonts/shipped/${Bs(e)}.css` : null;
|
|
8423
8449
|
}
|
|
8424
|
-
function
|
|
8425
|
-
let n = t.some((t) => t.family === e) ? `"${
|
|
8426
|
-
return `"${e.replace(/"/g, "")}", ${n}${
|
|
8450
|
+
function Hs(e, t = []) {
|
|
8451
|
+
let n = t.some((t) => t.family === e) ? `"${zs(e)}", ` : "";
|
|
8452
|
+
return `"${e.replace(/"/g, "")}", ${n}${Rs(e) ? Is : Fs}`;
|
|
8427
8453
|
}
|
|
8428
|
-
function
|
|
8454
|
+
function Us(e, t) {
|
|
8429
8455
|
let n = e.modes?.[t];
|
|
8430
8456
|
return {
|
|
8431
8457
|
accent: n?.accent ?? e.accent,
|
|
@@ -8435,30 +8461,30 @@ function Bs(e, t) {
|
|
|
8435
8461
|
}
|
|
8436
8462
|
//#endregion
|
|
8437
8463
|
//#region src/openui/fonts.ts
|
|
8438
|
-
var
|
|
8439
|
-
function
|
|
8440
|
-
let n = e ?
|
|
8441
|
-
if (!n ||
|
|
8442
|
-
|
|
8464
|
+
var Ws = /* @__PURE__ */ new Set();
|
|
8465
|
+
function Gs(e, t) {
|
|
8466
|
+
let n = e ? Vs(e) : null;
|
|
8467
|
+
if (!n || Ws.has(n)) return;
|
|
8468
|
+
Ws.add(n);
|
|
8443
8469
|
let r = document.createElement("link");
|
|
8444
8470
|
r.rel = "stylesheet", r.href = `${t}${n}`, document.head.append(r);
|
|
8445
8471
|
}
|
|
8446
|
-
function
|
|
8447
|
-
for (let n of e.faces)
|
|
8448
|
-
|
|
8472
|
+
function Ks(e, t) {
|
|
8473
|
+
for (let n of e.faces) Xa(n, n.url.startsWith("/") ? `${t}${n.url}` : n.url, () => Gs(zs(n.family), t));
|
|
8474
|
+
Gs(e.display, t), Gs(e.body, t);
|
|
8449
8475
|
}
|
|
8450
8476
|
//#endregion
|
|
8451
8477
|
//#region src/openui/look.ts
|
|
8452
|
-
var
|
|
8478
|
+
var qs = ["glow", "pattern"], Js = {
|
|
8453
8479
|
sharp: "0.25rem",
|
|
8454
8480
|
soft: "0.5rem",
|
|
8455
8481
|
round: "0.8rem"
|
|
8456
8482
|
};
|
|
8457
|
-
function
|
|
8458
|
-
let n = e.dark ? "dark" : "light", r =
|
|
8483
|
+
function Ys(e, t = {}) {
|
|
8484
|
+
let n = e.dark ? "dark" : "light", r = Us(e, e.pinned ? n : t.mode ?? e.prefer ?? n), i = {}, a = (e, t) => {
|
|
8459
8485
|
t && (i[e] = t);
|
|
8460
8486
|
};
|
|
8461
|
-
a("--wizard-accent", r.accent), a("--wizard-background", r.background), a("--wizard-text", r.text), a("--wizard-font-heading", e.display ?
|
|
8487
|
+
a("--wizard-accent", r.accent), a("--wizard-background", r.background), a("--wizard-text", r.text), a("--wizard-font-heading", e.display ? Hs(e.display, e.faces) : null), a("--wizard-font-text", e.body ? Hs(e.body, e.faces) : null), a("--wizard-radius", e.shape?.radius ? Js[e.shape.radius] : null), a("backgroundColor", r.background ? "var(--paper)" : null);
|
|
8462
8488
|
let o = new Set(t.effects ?? []), s = e.effects.flatMap((e) => o.has(e.id) ? e.id === "glow" ? ["glow"] : e.id === "pattern" ? [`pattern-${e.kind === "grid" ? "grid" : "dots"}`] : [] : []);
|
|
8463
8489
|
return {
|
|
8464
8490
|
style: i,
|
|
@@ -8469,8 +8495,8 @@ function Ks(e, t = {}) {
|
|
|
8469
8495
|
}
|
|
8470
8496
|
//#endregion
|
|
8471
8497
|
//#region src/openui/run.ts
|
|
8472
|
-
var
|
|
8473
|
-
function
|
|
8498
|
+
var Xs = 45e3;
|
|
8499
|
+
function Zs(e, t) {
|
|
8474
8500
|
let [n, r] = M(null), [i, a] = M(null), [o, s] = M(!1), [c, l] = M(!1), [u, d] = M({});
|
|
8475
8501
|
A(() => {
|
|
8476
8502
|
if (r(null), s(!1), !e) return;
|
|
@@ -8479,7 +8505,7 @@ function Js(e, t) {
|
|
|
8479
8505
|
let n = await U.get(t(e));
|
|
8480
8506
|
i || r(n);
|
|
8481
8507
|
} catch (e) {
|
|
8482
|
-
e instanceof
|
|
8508
|
+
e instanceof xr && e.status === 404 && (i = !0, c?.close(), s(!0));
|
|
8483
8509
|
}
|
|
8484
8510
|
}, d = () => {
|
|
8485
8511
|
if (clearTimeout(o), c?.close(), i) return;
|
|
@@ -8492,7 +8518,7 @@ function Js(e, t) {
|
|
|
8492
8518
|
s.close(), !(i || c !== s) && (c = null, u(), a = Math.min(a + 1, 6), o = setTimeout(d, 500 * 2 ** a));
|
|
8493
8519
|
};
|
|
8494
8520
|
}, f = setInterval(() => {
|
|
8495
|
-
!i && c && Date.now() - l >
|
|
8521
|
+
!i && c && Date.now() - l > Xs && (a = 0, d());
|
|
8496
8522
|
}, 15e3);
|
|
8497
8523
|
return d(), () => {
|
|
8498
8524
|
i = !0, clearTimeout(o), clearInterval(f), c?.close();
|
|
@@ -8504,7 +8530,7 @@ function Js(e, t) {
|
|
|
8504
8530
|
try {
|
|
8505
8531
|
return await U.post(`${H().runBase(e)}/${t}`, n), !0;
|
|
8506
8532
|
} catch (e) {
|
|
8507
|
-
return e instanceof
|
|
8533
|
+
return e instanceof xr && e.status === 422 && Array.isArray(e.body?.fields) && d(Object.fromEntries(e.body.fields.map((e) => [e.field, e.message]))), a(e.message), !1;
|
|
8508
8534
|
} finally {
|
|
8509
8535
|
l(!1);
|
|
8510
8536
|
}
|
|
@@ -8519,7 +8545,7 @@ function Js(e, t) {
|
|
|
8519
8545
|
}
|
|
8520
8546
|
} : n;
|
|
8521
8547
|
}, [n, t]);
|
|
8522
|
-
return
|
|
8548
|
+
return yr(n?.translation?.labels), {
|
|
8523
8549
|
view: p,
|
|
8524
8550
|
notFound: o,
|
|
8525
8551
|
error: i,
|
|
@@ -8543,22 +8569,22 @@ function Js(e, t) {
|
|
|
8543
8569
|
}
|
|
8544
8570
|
//#endregion
|
|
8545
8571
|
//#region src/openui/message.ts
|
|
8546
|
-
var
|
|
8547
|
-
function
|
|
8572
|
+
var Qs = (e) => `wizard:${e}`, $s = "wizard:empty";
|
|
8573
|
+
function ec(t, n) {
|
|
8548
8574
|
let r = He(), i = Ve(), a = Ue(), [o, s] = M(null), [c, l] = M(null), u = j(null);
|
|
8549
8575
|
return A(() => {
|
|
8550
8576
|
if (r || o || c || !t) return;
|
|
8551
8577
|
let d = !1;
|
|
8552
8578
|
return (async () => {
|
|
8553
8579
|
if (await Promise.resolve(), d) return;
|
|
8554
|
-
let r = i(void 0,
|
|
8580
|
+
let r = i(void 0, Qs(t));
|
|
8555
8581
|
if (typeof r == "string") {
|
|
8556
8582
|
s(r);
|
|
8557
8583
|
return;
|
|
8558
8584
|
}
|
|
8559
8585
|
u.current ??= n(t);
|
|
8560
8586
|
let o = await u.current;
|
|
8561
|
-
d || (s(o), a(void 0, e,
|
|
8587
|
+
d || (s(o), a(void 0, e, Qs(t), o, !0));
|
|
8562
8588
|
})().catch((e) => {
|
|
8563
8589
|
d || l(e instanceof Error ? e.message : String(e));
|
|
8564
8590
|
}), () => {
|
|
@@ -8577,10 +8603,10 @@ function Zs(t, n) {
|
|
|
8577
8603
|
failed: c
|
|
8578
8604
|
};
|
|
8579
8605
|
}
|
|
8580
|
-
function
|
|
8606
|
+
function tc() {
|
|
8581
8607
|
let e = Ue(), t = We();
|
|
8582
8608
|
return Ne((n, r) => {
|
|
8583
|
-
e(
|
|
8609
|
+
e($s, void 0, "empty", void 0, !1), t(n, $s, {
|
|
8584
8610
|
type: "continue_conversation",
|
|
8585
8611
|
params: { context: r }
|
|
8586
8612
|
});
|
|
@@ -8588,8 +8614,8 @@ function Qs() {
|
|
|
8588
8614
|
}
|
|
8589
8615
|
//#endregion
|
|
8590
8616
|
//#region src/openui/Wizard.tsx
|
|
8591
|
-
var
|
|
8592
|
-
function
|
|
8617
|
+
var nc = {}, rc = "";
|
|
8618
|
+
function ic({ size: e = 64 }) {
|
|
8593
8619
|
let t = Math.min(e, 72);
|
|
8594
8620
|
return /* @__PURE__ */ F("span", {
|
|
8595
8621
|
"aria-hidden": "true",
|
|
@@ -8600,44 +8626,44 @@ function tc({ size: e = 64 }) {
|
|
|
8600
8626
|
}
|
|
8601
8627
|
});
|
|
8602
8628
|
}
|
|
8603
|
-
function
|
|
8629
|
+
function ac(e) {
|
|
8604
8630
|
let t = e.runtime.replace(/\/+$/, "");
|
|
8605
|
-
|
|
8631
|
+
rc = t, Er({
|
|
8606
8632
|
lang: e.lang ?? "en",
|
|
8607
8633
|
runBase: (e) => `/api/runs/${e}`,
|
|
8608
8634
|
withBase: (e) => `${t}${e}`,
|
|
8609
8635
|
asset: (e) => `${t}/${e.replace(/^\/+/, "")}`,
|
|
8610
|
-
Mascot: e.Mascot ??
|
|
8611
|
-
}),
|
|
8636
|
+
Mascot: e.Mascot ?? ic
|
|
8637
|
+
}), nc = {
|
|
8612
8638
|
theme: e.theme,
|
|
8613
8639
|
mode: e.mode,
|
|
8614
8640
|
effects: e.effects
|
|
8615
|
-
},
|
|
8641
|
+
}, oc.clear();
|
|
8616
8642
|
}
|
|
8617
|
-
var
|
|
8618
|
-
function
|
|
8619
|
-
let t =
|
|
8643
|
+
var oc = /* @__PURE__ */ new Map();
|
|
8644
|
+
function sc(e) {
|
|
8645
|
+
let t = oc.get(e);
|
|
8620
8646
|
if (!t) {
|
|
8621
|
-
let n =
|
|
8622
|
-
t = U.get(`/api/public/wizards/${encodeURIComponent(e)}${n}`).then((e) => (
|
|
8647
|
+
let n = nc.theme ? `?theme=${encodeURIComponent(nc.theme)}` : "";
|
|
8648
|
+
t = U.get(`/api/public/wizards/${encodeURIComponent(e)}${n}`).then((e) => (Ks(e.brand.theme, rc), e.brand.theme), () => null), oc.set(e, t);
|
|
8623
8649
|
}
|
|
8624
8650
|
return t;
|
|
8625
8651
|
}
|
|
8626
|
-
function
|
|
8652
|
+
function cc(e) {
|
|
8627
8653
|
let [t, n] = M(null);
|
|
8628
8654
|
return A(() => {
|
|
8629
|
-
if (
|
|
8655
|
+
if (nc.theme === "host") return;
|
|
8630
8656
|
let t = !0;
|
|
8631
|
-
return
|
|
8657
|
+
return sc(e).then((e) => t && n(e)), () => {
|
|
8632
8658
|
t = !1;
|
|
8633
8659
|
};
|
|
8634
|
-
}, [e]), t ?
|
|
8635
|
-
mode:
|
|
8636
|
-
effects:
|
|
8660
|
+
}, [e]), t ? Ys(t, {
|
|
8661
|
+
mode: nc.mode,
|
|
8662
|
+
effects: nc.effects
|
|
8637
8663
|
}) : null;
|
|
8638
8664
|
}
|
|
8639
|
-
var
|
|
8640
|
-
function
|
|
8665
|
+
var lc = (e) => U.post(`/api/public/wizards/${encodeURIComponent(e)}/runs`, {}).then((e) => e.runId);
|
|
8666
|
+
function uc(e) {
|
|
8641
8667
|
let t = Object.entries(e.outputs).filter(([, e]) => typeof e.text == "string" && e.text.trim()).map(([e, t]) => ({
|
|
8642
8668
|
step: e,
|
|
8643
8669
|
text: (t.text ?? "").slice(0, 4e3)
|
|
@@ -8648,10 +8674,10 @@ function sc(e) {
|
|
|
8648
8674
|
results: t
|
|
8649
8675
|
};
|
|
8650
8676
|
}
|
|
8651
|
-
function
|
|
8652
|
-
let { runId: t, failed: n } =
|
|
8677
|
+
function dc({ props: e }) {
|
|
8678
|
+
let { runId: t, failed: n } = ec(e.wizard, lc), r = Zs(t, e.prefill), i = tc(), a = cc(e.wizard), o = r.view, s = j(!1);
|
|
8653
8679
|
return A(() => {
|
|
8654
|
-
o && (o.status === "done" ? s.current && (s.current = !1, i(`The wizard “${o.wizard.title}” finished.`,
|
|
8680
|
+
o && (o.status === "done" ? s.current && (s.current = !1, i(`The wizard “${o.wizard.title}” finished.`, uc(o))) : s.current = !0);
|
|
8655
8681
|
}, [o, i]), /* @__PURE__ */ I("div", {
|
|
8656
8682
|
...a,
|
|
8657
8683
|
style: a?.style,
|
|
@@ -8664,20 +8690,20 @@ function cc({ props: e }) {
|
|
|
8664
8690
|
children: n ? /* @__PURE__ */ F("p", {
|
|
8665
8691
|
className: "py-10 text-center text-ink-3",
|
|
8666
8692
|
children: n
|
|
8667
|
-
}) : /* @__PURE__ */ F(
|
|
8693
|
+
}) : /* @__PURE__ */ F(Ds, {
|
|
8668
8694
|
run: r,
|
|
8669
8695
|
compact: !0
|
|
8670
8696
|
})
|
|
8671
8697
|
})]
|
|
8672
8698
|
});
|
|
8673
8699
|
}
|
|
8674
|
-
var
|
|
8700
|
+
var fc = Be({
|
|
8675
8701
|
name: e,
|
|
8676
8702
|
description: t,
|
|
8677
8703
|
props: a,
|
|
8678
|
-
component: ({ props: e }) => /* @__PURE__ */ F(
|
|
8704
|
+
component: ({ props: e }) => /* @__PURE__ */ F(dc, { props: e })
|
|
8679
8705
|
});
|
|
8680
8706
|
//#endregion
|
|
8681
|
-
export {
|
|
8707
|
+
export { qs as CARD_EFFECTS, e as WIZARD_COMPONENT, t as WIZARD_DESCRIPTION, fc as Wizard, n as WizardSpec, r as addWizard, ac as configureWizards, Ks as loadLookFonts, i as loadWizards, Zs as useWizardRun, Ys as wizardLook, a as wizardProps, o as wizardRules };
|
|
8682
8708
|
|
|
8683
8709
|
//# sourceMappingURL=index.js.map
|