ryugi-artifacts 1.77.0 → 1.78.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/dist/cli.cjs +75 -19
  2. package/dist/server.cjs +302 -298
  3. package/dist/viewer/ArtboardLayout-BTys-6Vg.js +13 -0
  4. package/dist/viewer/Canvas-CWPtxXag.js +1 -0
  5. package/dist/viewer/PreviewLayout-Dl9CuJaY.js +2 -0
  6. package/dist/viewer/index.js +2 -2
  7. package/dist/viewer/index4.css +16 -0
  8. package/dist/viewer/preview.html +2 -2
  9. package/dist/viewer/preview.js +1 -1
  10. package/dist/viewer/view-BJqsLsys.js +2 -0
  11. package/dist/viewer-lib/{Canvas-B2u5Xu4Q.js → Canvas-CCq4Ko7_.js} +392 -299
  12. package/dist/viewer-lib/{PhoneArtboardBar-DphUzdTc.js → PhoneArtboardBar-Cll7l0fz.js} +1 -1
  13. package/dist/viewer-lib/{PreviewView-Cmi8qyst.js → PreviewView-D7cDFhyg.js} +306 -65
  14. package/dist/viewer-lib/{ReadOnlyWhiteboard-0a1PF9WY.js → ReadOnlyWhiteboard-CmKjtHFJ.js} +59 -59
  15. package/dist/viewer-lib/{ar-SA-G6X2FPQ2-BxYqMSzi.js → ar-SA-G6X2FPQ2-HZky6mYE.js} +1 -1
  16. package/dist/viewer-lib/{az-AZ-76LH7QW2-Dq3nTGr-.js → az-AZ-76LH7QW2-Bz6gZGXm.js} +1 -1
  17. package/dist/viewer-lib/{bg-BG-XCXSNQG7-DskJTtPp.js → bg-BG-XCXSNQG7-Bj6azCuS.js} +1 -1
  18. package/dist/viewer-lib/{bn-BD-2XOGV67Q-D96UFHku.js → bn-BD-2XOGV67Q-pkZSsKMV.js} +1 -1
  19. package/dist/viewer-lib/{ca-ES-6MX7JW3Y-CuoxBVI2.js → ca-ES-6MX7JW3Y-DInd8tqd.js} +1 -1
  20. package/dist/viewer-lib/{chunk-EIO257PC-DeMrLF_7.js → chunk-EIO257PC-A9RZ-nRE.js} +1 -1
  21. package/dist/viewer-lib/core.js +3 -3
  22. package/dist/viewer-lib/{cs-CZ-2BRQDIVT-BEk-H_Vk.js → cs-CZ-2BRQDIVT-CQ0UDIDw.js} +1 -1
  23. package/dist/viewer-lib/{da-DK-5WZEPLOC-B-2tVr18.js → da-DK-5WZEPLOC-rSt6qKPe.js} +1 -1
  24. package/dist/viewer-lib/{de-DE-XR44H4JA-euPndqvM.js → de-DE-XR44H4JA-DrIjWm0C.js} +1 -1
  25. package/dist/viewer-lib/document.js +1 -1
  26. package/dist/viewer-lib/{el-GR-BZB4AONW-BstNT5YB.js → el-GR-BZB4AONW-3kVOQ15p.js} +1 -1
  27. package/dist/viewer-lib/{en-B4ZKOASM-CLuWsYJe.js → en-B4ZKOASM-sas4DJvS.js} +1 -1
  28. package/dist/viewer-lib/{es-ES-U4NZUMDT-CNH0TChZ.js → es-ES-U4NZUMDT-DF1DXGeP.js} +1 -1
  29. package/dist/viewer-lib/{eu-ES-A7QVB2H4-CNpCf9s7.js → eu-ES-A7QVB2H4-CIu5bgjr.js} +1 -1
  30. package/dist/viewer-lib/{fa-IR-HGAKTJCU-MD2DLnwr.js → fa-IR-HGAKTJCU-Dg12PelN.js} +1 -1
  31. package/dist/viewer-lib/{fi-FI-Z5N7JZ37-B0x5U-9a.js → fi-FI-Z5N7JZ37-DGfGckr2.js} +1 -1
  32. package/dist/viewer-lib/{fr-FR-RHASNOE6-CoVvXGyV.js → fr-FR-RHASNOE6-CB3RBQBb.js} +1 -1
  33. package/dist/viewer-lib/{gl-ES-HMX3MZ6V-BEtAqRTV.js → gl-ES-HMX3MZ6V-srdgH8Yb.js} +1 -1
  34. package/dist/viewer-lib/{he-IL-6SHJWFNN-JnZeHe4y.js → he-IL-6SHJWFNN-C-u3aIrD.js} +1 -1
  35. package/dist/viewer-lib/{hi-IN-IWLTKZ5I-BYVAF-an.js → hi-IN-IWLTKZ5I-DnRD5RwM.js} +1 -1
  36. package/dist/viewer-lib/{hu-HU-A5ZG7DT2-C1g6PvYO.js → hu-HU-A5ZG7DT2-cHUeODPe.js} +1 -1
  37. package/dist/viewer-lib/{id-ID-SAP4L64H-Dz8s_rEF.js → id-ID-SAP4L64H-BYp8Yosj.js} +1 -1
  38. package/dist/viewer-lib/{image-GAAHSSAO-Cp_Oy4Lg.js → image-GAAHSSAO-MaHRDtG2.js} +1 -1
  39. package/dist/viewer-lib/index.js +2352 -2327
  40. package/dist/viewer-lib/{it-IT-JPQ66NNP-B7NhscKF.js → it-IT-JPQ66NNP-K76B2vDZ.js} +1 -1
  41. package/dist/viewer-lib/{ja-JP-DBVTYXUO-CAiycqDW.js → ja-JP-DBVTYXUO-DGtajQ1n.js} +1 -1
  42. package/dist/viewer-lib/{kaa-6HZHGXH3-CAnRls-6.js → kaa-6HZHGXH3-Byq6aZnP.js} +1 -1
  43. package/dist/viewer-lib/{kab-KAB-ZGHBKWFO-DYWHAmBp.js → kab-KAB-ZGHBKWFO-xFQx0VKj.js} +1 -1
  44. package/dist/viewer-lib/{kk-KZ-P5N5QNE5-DPoDluwp.js → kk-KZ-P5N5QNE5-DqTYtjE9.js} +1 -1
  45. package/dist/viewer-lib/{km-KH-HSX4SM5Z-CBiZCJLZ.js → km-KH-HSX4SM5Z-CmHVZ3Pg.js} +1 -1
  46. package/dist/viewer-lib/{ko-KR-MTYHY66A-MocKQnzV.js → ko-KR-MTYHY66A-pItxT0ea.js} +1 -1
  47. package/dist/viewer-lib/{ku-TR-6OUDTVRD-CZzY2yy7.js → ku-TR-6OUDTVRD-DJoNwVzF.js} +1 -1
  48. package/dist/viewer-lib/{lt-LT-XHIRWOB4-Dh-omlnu.js → lt-LT-XHIRWOB4-DG1eQnL9.js} +1 -1
  49. package/dist/viewer-lib/{lv-LV-5QDEKY6T-DVUeEmOB.js → lv-LV-5QDEKY6T-BAFyGSRK.js} +1 -1
  50. package/dist/viewer-lib/{mr-IN-CRQNXWMA-BC2TCxWI.js → mr-IN-CRQNXWMA-Dpt8RtYD.js} +1 -1
  51. package/dist/viewer-lib/{my-MM-5M5IBNSE-D_UqzOnS.js → my-MM-5M5IBNSE-PB-QhewM.js} +1 -1
  52. package/dist/viewer-lib/{nb-NO-T6EIAALU-DZz9rgcM.js → nb-NO-T6EIAALU-DUOVY3a0.js} +1 -1
  53. package/dist/viewer-lib/{nl-NL-IS3SIHDZ-Cxx6IDq2.js → nl-NL-IS3SIHDZ-EvHXncDP.js} +1 -1
  54. package/dist/viewer-lib/{nn-NO-6E72VCQL-DHOwMIp2.js → nn-NO-6E72VCQL-DiLJJ6in.js} +1 -1
  55. package/dist/viewer-lib/{oc-FR-POXYY2M6-BUCg3oNi.js → oc-FR-POXYY2M6-BcMNlMjU.js} +1 -1
  56. package/dist/viewer-lib/{pa-IN-N4M65BXN-DlR0Cv0r.js → pa-IN-N4M65BXN-y8F6i_xQ.js} +1 -1
  57. package/dist/viewer-lib/{percentages-BXMCSKIN-CNHarTCz.js → percentages-BXMCSKIN-BcGLGIbY.js} +1 -1
  58. package/dist/viewer-lib/{pl-PL-T2D74RX3-DBCTNfwV.js → pl-PL-T2D74RX3-BcJAM87-.js} +1 -1
  59. package/dist/viewer-lib/{pt-BR-5N22H2LF-BViO6V5P.js → pt-BR-5N22H2LF-B6LXfMUc.js} +1 -1
  60. package/dist/viewer-lib/{pt-PT-UZXXM6DQ-_-hLEzme.js → pt-PT-UZXXM6DQ-Bp-xUqQ8.js} +1 -1
  61. package/dist/viewer-lib/{ro-RO-JPDTUUEW-B0pUzZSi.js → ro-RO-JPDTUUEW-BSUxwWXI.js} +1 -1
  62. package/dist/viewer-lib/{ru-RU-B4JR7IUQ-D5E11KR4.js → ru-RU-B4JR7IUQ-CQdjNcBG.js} +1 -1
  63. package/dist/viewer-lib/{si-LK-N5RQ5JYF-BFislBlI.js → si-LK-N5RQ5JYF-7CAmmMro.js} +1 -1
  64. package/dist/viewer-lib/{sk-SK-C5VTKIMK-D-yT3OQf.js → sk-SK-C5VTKIMK-CpC5WEtb.js} +1 -1
  65. package/dist/viewer-lib/{sl-SI-NN7IZMDC-BB9t_cfT.js → sl-SI-NN7IZMDC-s5Digk56.js} +1 -1
  66. package/dist/viewer-lib/{stylex-DjVDawxG.css → stylex-B6-Q1VRZ.css} +16 -0
  67. package/dist/viewer-lib/subset-shared.chunk-DVeVdUoS.js +2 -0
  68. package/dist/viewer-lib/{subset-worker.chunk-CthWNHJ8.js → subset-worker.chunk-V92b2YKH.js} +2 -2
  69. package/dist/viewer-lib/{sv-SE-XGPEYMSR-BYTui5Bf.js → sv-SE-XGPEYMSR-D7xx9CF4.js} +1 -1
  70. package/dist/viewer-lib/{ta-IN-2NMHFXQM-gcIYx9DJ.js → ta-IN-2NMHFXQM-DbRLNuGy.js} +1 -1
  71. package/dist/viewer-lib/{th-TH-HPSO5L25-DPpIkMiS.js → th-TH-HPSO5L25-FmDN7f8Q.js} +1 -1
  72. package/dist/viewer-lib/thumbnail.js +281 -1
  73. package/dist/viewer-lib/{tr-TR-DEFEU3FU-CdZ57PYq.js → tr-TR-DEFEU3FU-C6SMoY6h.js} +1 -1
  74. package/dist/viewer-lib/types/src/shared/flow.d.ts +24 -0
  75. package/dist/viewer-lib/types/src/shared/geometry.d.ts +7 -0
  76. package/dist/viewer-lib/types/src/shared/types.d.ts +7 -1
  77. package/dist/viewer-lib/types/src/shared/validate.d.ts +1 -0
  78. package/dist/viewer-lib/types/src/viewer/components/Canvas.d.ts +4 -2
  79. package/dist/viewer-lib/types/src/viewer/components/CanvasNotes.d.ts +6 -0
  80. package/dist/viewer-lib/types/src/viewer/components/FlowLayer.d.ts +9 -0
  81. package/dist/viewer-lib/{uk-UA-QMV73CPH-jb3KN0s9.js → uk-UA-QMV73CPH-UOEzCOen.js} +1 -1
  82. package/dist/viewer-lib/{vi-VN-M7AON7JQ-DczXZH3K.js → vi-VN-M7AON7JQ-Dxi27jBl.js} +1 -1
  83. package/dist/viewer-lib/{zh-CN-LNUGB5OW-B7ikml4p.js → zh-CN-LNUGB5OW-BkbG5N7o.js} +1 -1
  84. package/dist/viewer-lib/{zh-HK-E62DVLB3-GXxZysCg.js → zh-HK-E62DVLB3-Btkkw8Q_.js} +1 -1
  85. package/dist/viewer-lib/{zh-TW-RAJ6MFWO-CLRCR8wM.js → zh-TW-RAJ6MFWO-BeX560km.js} +1 -1
  86. package/package.json +1 -1
  87. package/dist/viewer/ArtboardLayout-C8odRO5-.js +0 -13
  88. package/dist/viewer/Canvas-Lvx_4l7N.js +0 -1
  89. package/dist/viewer/PreviewLayout-DxPulKHq.js +0 -2
  90. package/dist/viewer/view-_lCPxrgM.js +0 -2
  91. package/dist/viewer-lib/subset-shared.chunk-B_z_wg9E.js +0 -2
@@ -1,14 +1,14 @@
1
1
  import { n as e } from "./rolldown-runtime-CwxnZyOB.js";
2
- import { m as t } from "./PreviewView-Cmi8qyst.js";
3
- import { d as n, k as r, n as i, t as a, u as o } from "./RyugiLoader-CspgSQMe.js";
4
- import { t as s } from "./cssVar.stylex-BAwVsjeH.js";
5
- import { a as c, n as l, t as u } from "./agentLook-DgVWDJBC.js";
6
- import { memo as d, useEffect as f, useImperativeHandle as p, useLayoutEffect as m, useRef as h, useState as g } from "react";
7
- import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
8
- import { Maximize2 as b, Repeat as x } from "lucide-react";
9
- import * as S from "motion/react-m";
2
+ import { m as t, v as n, x as r } from "./PreviewView-D7cDFhyg.js";
3
+ import { d as i, k as a, n as o, t as s, u as c } from "./RyugiLoader-CspgSQMe.js";
4
+ import { t as l } from "./cssVar.stylex-BAwVsjeH.js";
5
+ import { a as u, n as d, t as f } from "./agentLook-DgVWDJBC.js";
6
+ import { memo as p, useEffect as m, useId as h, useImperativeHandle as g, useLayoutEffect as _, useRef as v, useState as y } from "react";
7
+ import { Fragment as b, jsx as x, jsxs as S } from "react/jsx-runtime";
8
+ import { Maximize2 as C, Repeat as w } from "lucide-react";
9
+ import * as T from "motion/react-m";
10
10
  // src/shared/inspector.ts
11
- var C = [
11
+ var E = [
12
12
  "width",
13
13
  "height",
14
14
  "position",
@@ -25,14 +25,14 @@ var C = [
25
25
  "font-size",
26
26
  "color",
27
27
  "box-shadow"
28
- ], w = "#0D99FF", T = "M6.2 3.6C5 2.7 3.4 3.6 3.6 5.1L6 22.7C6.2 24.3 8.2 24.8 9.1 23.5L13 18.3C13.4 17.8 14 17.5 14.6 17.5L21.1 17.3C22.7 17.2 23.4 15.2 22.2 14.3Z", E = "M13 3a9 9 0 0 1 0 18H4.5A1.5 1.5 0 0 1 3 19.5V13A10 10 0 0 1 13 3z", D = (e, t, n) => `url("data:image/svg+xml,${encodeURIComponent(e)}") ${t}, ${n}`, O = D(`<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 28 28'><path d='${T}' fill='none' stroke='white' stroke-width='4' stroke-linejoin='round'/><path d='${T}' fill='${w}'/></svg>`, "3 3", "default"), k = D(`<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'><path d='${E}' fill='none' stroke='white' stroke-width='3' stroke-linejoin='round'/><path d='${E}' fill='${w}'/><path d='M13 8.2v7.6M9.2 12h7.6' stroke='white' stroke-width='2.2' stroke-linecap='round'/></svg>`, "3 21", "crosshair"), A = 2e4, j = 16, M = 24;
29
- function N(e, t) {
30
- return t - e >= A;
28
+ ], D = "#0D99FF", O = "M6.2 3.6C5 2.7 3.4 3.6 3.6 5.1L6 22.7C6.2 24.3 8.2 24.8 9.1 23.5L13 18.3C13.4 17.8 14 17.5 14.6 17.5L21.1 17.3C22.7 17.2 23.4 15.2 22.2 14.3Z", k = "M13 3a9 9 0 0 1 0 18H4.5A1.5 1.5 0 0 1 3 19.5V13A10 10 0 0 1 13 3z", A = (e, t, n) => `url("data:image/svg+xml,${encodeURIComponent(e)}") ${t}, ${n}`, j = A(`<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 28 28'><path d='${O}' fill='none' stroke='white' stroke-width='4' stroke-linejoin='round'/><path d='${O}' fill='${D}'/></svg>`, "3 3", "default"), M = A(`<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'><path d='${k}' fill='none' stroke='white' stroke-width='3' stroke-linejoin='round'/><path d='${k}' fill='${D}'/><path d='M13 8.2v7.6M9.2 12h7.6' stroke='white' stroke-width='2.2' stroke-linecap='round'/></svg>`, "3 21", "crosshair"), N = 2e4, P = 16, F = 24;
29
+ function I(e, t) {
30
+ return t - e >= N;
31
31
  }
32
- function ee(e, t, n = j) {
32
+ function ee(e, t, n = P) {
33
33
  return t ? {
34
34
  x: e.x + Math.max(0, e.w - n),
35
- y: e.y + e.h + M
35
+ y: e.y + e.h + F
36
36
  } : {
37
37
  x: e.x + Math.min(64, e.w * .15),
38
38
  y: e.y + Math.min(80, e.h * .2)
@@ -40,24 +40,24 @@ function ee(e, t, n = j) {
40
40
  }
41
41
  // src/viewer/hooks/useCursorParked.ts
42
42
  function te(e) {
43
- let [t, n] = g(() => Date.now());
44
- return f(() => {
43
+ let [t, n] = y(() => Date.now());
44
+ return m(() => {
45
45
  if (e === void 0) return;
46
- let t = e + A - Date.now();
46
+ let t = e + N - Date.now();
47
47
  if (t <= 0) return;
48
48
  let r = setTimeout(() => n(Date.now()), t);
49
49
  return () => clearTimeout(r);
50
- }, [e]), e !== void 0 && N(e, t);
50
+ }, [e]), e !== void 0 && I(e, t);
51
51
  }
52
52
  // src/viewer/lib/play.ts
53
- function P(e, t) {
53
+ function ne(e, t) {
54
54
  let n = new Set(e);
55
55
  return n.delete(t) || n.add(t), n;
56
56
  }
57
- var F = (e, t) => (e[t] ?? 0) > 0, I = (e, t) => e.interactive === !0 && F(t, e.file), L = (e, t, n, r) => `${e}${t}?v=${n}${r > 0 ? `&r=${r}` : ""}`, R = 24, ne = 34.3, re = "76 130 360 252";
58
- function z({ agent: e, state: t, title: n }) {
57
+ var L = (e, t) => (e[t] ?? 0) > 0, R = (e, t) => e.interactive === !0 && L(t, e.file), z = (e, t, n, r) => `${e}${t}?v=${n}${r > 0 ? `&r=${r}` : ""}`, B = 24, re = 34.3, ie = "76 130 360 252";
58
+ function V({ agent: e, state: t, title: n }) {
59
59
  let r = t === "drawing";
60
- return /* @__PURE__ */ y("div", {
60
+ return /* @__PURE__ */ S("div", {
61
61
  "data-board-state": t,
62
62
  ...{
63
63
  0: { className: "x10l6tqk x10a8y8t x47corl xqfszdh" },
@@ -69,34 +69,34 @@ function z({ agent: e, state: t, title: n }) {
69
69
  3: { className: "x10l6tqk x10a8y8t x47corl xqfszdh xbk3nqn xaatb59 x1tjb3dp xknvxwu xox4ge1 xopnk0n x11xz5rz" },
70
70
  7: { className: "x10l6tqk x10a8y8t x47corl xqfszdh xbk3nqn xaatb59 x1tjb3dp xknvxwu xox4ge1 xopnk0n x11xz5rz" }
71
71
  }[(t === "waiting") << 2 | (t === "resting") << 1 | !!r],
72
- children: [t === "waiting" && /* @__PURE__ */ y(_, { children: [
73
- /* @__PURE__ */ v("i", { className: "x10l6tqk x1bjaxh0 x13q6o5s x1y0btm7 xhgr6co xc342km xmwf3kg x1oo2giq x1nhu8zx x14up9od" }),
74
- /* @__PURE__ */ v("i", { className: "x10l6tqk x1bjaxh0 x13q6o5s x1y0btm7 xhgr6co xc342km xmwf3kg x1oo2giq xetn906 x15guuwl" }),
75
- /* @__PURE__ */ v("i", { className: "x10l6tqk x1bjaxh0 x13q6o5s x1y0btm7 xhgr6co xc342km x1e3sxgq xppht8 x1nhu8zx x14up9od" }),
76
- /* @__PURE__ */ v("i", { className: "x10l6tqk x1bjaxh0 x13q6o5s x1y0btm7 xhgr6co xc342km x1e3sxgq xppht8 xetn906 x15guuwl" })
77
- ] }), /* @__PURE__ */ y("div", {
72
+ children: [t === "waiting" && /* @__PURE__ */ S(b, { children: [
73
+ /* @__PURE__ */ x("i", { className: "x10l6tqk x1bjaxh0 x13q6o5s x1y0btm7 xhgr6co xc342km xmwf3kg x1oo2giq x1nhu8zx x14up9od" }),
74
+ /* @__PURE__ */ x("i", { className: "x10l6tqk x1bjaxh0 x13q6o5s x1y0btm7 xhgr6co xc342km xmwf3kg x1oo2giq xetn906 x15guuwl" }),
75
+ /* @__PURE__ */ x("i", { className: "x10l6tqk x1bjaxh0 x13q6o5s x1y0btm7 xhgr6co xc342km x1e3sxgq xppht8 x1nhu8zx x14up9od" }),
76
+ /* @__PURE__ */ x("i", { className: "x10l6tqk x1bjaxh0 x13q6o5s x1y0btm7 xhgr6co xc342km x1e3sxgq xppht8 xetn906 x15guuwl" })
77
+ ] }), /* @__PURE__ */ S("div", {
78
78
  className: "x10l6tqk x1nrll8i xwa60dl x1pu78oe x1p8wexg x1b2v2uc x9f619 xe8ttls x78zum5 xdt5ytf x6s0dn4 xl56j7k x1v2ro7d xb3r6kr x2b8uid xo2rkog",
79
- children: [t === "resting" ? null : t === "waiting" ? /* @__PURE__ */ v("svg", {
79
+ children: [t === "resting" ? null : t === "waiting" ? /* @__PURE__ */ x("svg", {
80
80
  "aria-hidden": "true",
81
- dangerouslySetInnerHTML: { __html: i },
81
+ dangerouslySetInnerHTML: { __html: o },
82
82
  fill: "currentColor",
83
- height: R,
84
- viewBox: re,
85
- width: ne,
83
+ height: B,
84
+ viewBox: ie,
85
+ width: re,
86
86
  className: "x1lliihq x1vx7kgm"
87
- }) : /* @__PURE__ */ v(a, {
87
+ }) : /* @__PURE__ */ x(s, {
88
88
  decorative: !0,
89
- size: R,
89
+ size: B,
90
90
  variant: r ? "write" : "shiny"
91
- }), /* @__PURE__ */ y("span", {
91
+ }), /* @__PURE__ */ S("span", {
92
92
  className: "x78zum5 xdt5ytf x1jnr06f x193iq5w",
93
- children: [/* @__PURE__ */ v("span", {
93
+ children: [/* @__PURE__ */ x("span", {
94
94
  ...{
95
95
  0: { className: "xb3r6kr xlyipyv xuxw1ft x4z9k3i xk50ysn xd4r4e8 x1bo0w0s" },
96
96
  1: { className: "xb3r6kr xlyipyv xuxw1ft x4z9k3i xk50ysn xd4r4e8 xo2rkog" }
97
97
  }[!!r | 0],
98
98
  children: n
99
- }), t !== "resting" && /* @__PURE__ */ v("span", {
99
+ }), t !== "resting" && /* @__PURE__ */ x("span", {
100
100
  ...{
101
101
  0: { className: "xb3r6kr xlyipyv xuxw1ft xfifm61 x1d3mw78 xddlp02" },
102
102
  1: { className: "xb3r6kr xlyipyv xuxw1ft xfifm61 x1d3mw78 x1cfw786" }
@@ -107,23 +107,155 @@ function z({ agent: e, state: t, title: n }) {
107
107
  })]
108
108
  });
109
109
  }
110
+ // src/viewer/components/FlowLayer.tsx
111
+ var ae = 1.5, H = 11, oe = 16, U = (e, t) => `max(${e}px, calc(${t}px / var(--zoom, 1)))`, se = { strokeWidth: U(4, ae) }, ce = {
112
+ paddingInline: 16,
113
+ fontSize: U(32, H)
114
+ }, le = {
115
+ paddingInline: 16,
116
+ fontSize: U(28, H),
117
+ boxShadow: `0 0 0 ${U(2, 1)} ${l.colorBorder}`
118
+ }, ue = {
119
+ gap: 16,
120
+ height: 96,
121
+ fontSize: 40,
122
+ boxShadow: `inset 0 0 0 ${U(6, 2)} ${l.colorText}`
123
+ }, de = p(function({ routes: e }) {
124
+ let t = h();
125
+ return /* @__PURE__ */ S("div", {
126
+ "data-flow": !0,
127
+ className: "x10l6tqk xu96u03 x13vifvy xnalus7 xqtp20y",
128
+ style: { pointerEvents: "none" },
129
+ children: [/* @__PURE__ */ S("svg", {
130
+ "aria-hidden": !0,
131
+ height: 1,
132
+ width: 1,
133
+ className: "x10l6tqk xu96u03 x13vifvy x1rea2x4",
134
+ children: [/* @__PURE__ */ x("defs", { children: /* @__PURE__ */ x("marker", {
135
+ id: t,
136
+ markerHeight: 5,
137
+ markerWidth: 5,
138
+ orient: "auto",
139
+ refX: 8.6,
140
+ refY: 5,
141
+ viewBox: "0 0 10 10",
142
+ children: /* @__PURE__ */ x("path", {
143
+ d: "M2,1.5 L8.6,5 L2,8.5",
144
+ className: "xbh8q5q xtfjdih x1k315e8 x1owpc8m x1f6yumg"
145
+ })
146
+ }) }), e.map((e) => /* @__PURE__ */ x("path", {
147
+ d: n(e.points, 32),
148
+ "data-edge": e.id,
149
+ markerEnd: `url(#${t})`,
150
+ className: "xbh8q5q xtfjdih",
151
+ style: se
152
+ }, e.id))]
153
+ }), e.map(({ id: e, label: t }) => t && /* @__PURE__ */ x("div", {
154
+ "data-branch": t.branch || void 0,
155
+ "data-edge-label": e,
156
+ title: t.text,
157
+ ...{
158
+ 0: { className: "x10l6tqk x11lhmoz x9f619 xuxw1ft xb3r6kr xlyipyv x37zpob xk50ysn xo2rkog x184qs1t" },
159
+ 1: { className: "x10l6tqk x11lhmoz x9f619 xuxw1ft xb3r6kr xlyipyv x37zpob xk50ysn x1bo0w0s x1rozbrz x1e6avla" }
160
+ }[!!t.branch | 0],
161
+ style: {
162
+ ...t.branch ? le : ce,
163
+ left: t.x,
164
+ top: t.y,
165
+ maxWidth: `calc(${t.room}px - ${oe}px / var(--zoom, 1))`
166
+ },
167
+ children: t.text
168
+ }, e))]
169
+ });
170
+ });
171
+ function fe({ id: e, note: t }) {
172
+ return /* @__PURE__ */ S("div", {
173
+ "data-condition": !0,
174
+ "data-note": e,
175
+ className: "x10l6tqk x9f619 x78zum5 x6s0dn4 xl56j7k x1e6avla xuxw1ft x1s688f xo5v014 xo2rkog x1rozbrz",
176
+ style: {
177
+ ...ue,
178
+ left: t.x,
179
+ top: t.y,
180
+ width: r(t.text)
181
+ },
182
+ children: [/* @__PURE__ */ x("svg", {
183
+ "aria-hidden": !0,
184
+ height: 28,
185
+ viewBox: "0 0 10 10",
186
+ width: 28,
187
+ className: "x2lah0s xbh8q5q xfa2q5v xhxwl1 x1f6yumg",
188
+ children: /* @__PURE__ */ x("path", { d: "M5,0.9 L9.1,5 L5,9.1 L0.9,5 Z" })
189
+ }), t.text]
190
+ });
191
+ }
192
+ // src/viewer/components/CanvasNotes.tsx
193
+ function pe(e) {
194
+ if (!e) return {
195
+ backgroundColor: u.paperWarm,
196
+ color: u.inkWarm
197
+ };
198
+ let t = e.length === 4 ? e.slice(1).split("").map((e) => e + e).join("") : e.slice(1), [n, r, i] = [
199
+ 0,
200
+ 2,
201
+ 4
202
+ ].map((e) => {
203
+ let n = parseInt(t.slice(e, e + 2), 16) / 255;
204
+ return n <= .04045 ? n / 12.92 : ((n + .055) / 1.055) ** 2.4;
205
+ });
206
+ return {
207
+ backgroundColor: e,
208
+ color: .2126 * n + .7152 * r + .0722 * i > .179 ? u.black : u.white
209
+ };
210
+ }
211
+ function me({ notes: e, titleRooms: n, zoom: r }) {
212
+ return e.map(([e, i]) => i.kind === "title" ? /* @__PURE__ */ x("h2", {
213
+ "data-note": e,
214
+ className: "x10l6tqk x1ghz6dp x1xlr1w8 x1uo3zyz xjat59b xo2rkog x1bd091l",
215
+ style: {
216
+ left: i.x,
217
+ top: i.y,
218
+ width: i.w,
219
+ whiteSpace: i.w === void 0 ? "nowrap" : "normal",
220
+ fontSize: i.size ?? 96,
221
+ transform: `scale(${t(i.size ?? 96, r, n?.[e] ?? Infinity)})`
222
+ },
223
+ children: i.text
224
+ }, e) : i.kind === "condition" ? /* @__PURE__ */ x(fe, {
225
+ id: e,
226
+ note: i
227
+ }, e) : /* @__PURE__ */ x("div", {
228
+ "data-note": e,
229
+ className: "x10l6tqk x12oqio5 x126k92a xj0a0fe x1pmbvsm",
230
+ style: {
231
+ left: i.x,
232
+ top: i.y,
233
+ width: i.w ?? 240,
234
+ padding: 16,
235
+ fontSize: 18,
236
+ lineHeight: "27px",
237
+ ...pe(i.color)
238
+ },
239
+ children: i.text
240
+ }, e));
241
+ }
110
242
  // src/viewer/components/CompareSplit.tsx
111
- var ie = 5;
112
- function ae({ split: e, onSplit: t }) {
113
- let { t: n } = o(), r = (e) => Math.min(100, Math.max(0, Math.round(e))), i = (e) => {
243
+ var he = 5;
244
+ function ge({ split: e, onSplit: t }) {
245
+ let { t: n } = c(), r = (e) => Math.min(100, Math.max(0, Math.round(e))), i = (e) => {
114
246
  let n = e.currentTarget.parentElement?.getBoundingClientRect();
115
247
  !n || n.width <= 0 || t(r((e.clientX - n.left) / n.width * 100));
116
248
  };
117
- return /* @__PURE__ */ y(_, { children: [
118
- /* @__PURE__ */ v("span", {
249
+ return /* @__PURE__ */ S(b, { children: [
250
+ /* @__PURE__ */ x("span", {
119
251
  className: "x10l6tqk x13vifvy xu96u03 xoegz02 x1gm0aph x1hj3fc7 xm9j1uf x12oqio5 x71mcx3 x8r4el6 x1j6dyjg x1s688f xd4r4e8 x47corl",
120
252
  children: n("verdict.previous")
121
253
  }),
122
- /* @__PURE__ */ v("span", {
254
+ /* @__PURE__ */ x("span", {
123
255
  className: "x10l6tqk x13vifvy x1ey2m1c x1at6vp9 x1c7rsn6 x1l2ivya xavjpbr xzkaem6 x47corl",
124
256
  style: { left: `${e}%` }
125
257
  }),
126
- /* @__PURE__ */ v("button", {
258
+ /* @__PURE__ */ x("button", {
127
259
  className: "x10l6tqk xwa60dl xoegz02 xvy4d1p xxk0z11 x18xomjl x7wgvq7 xrvj5dj x1ku5rj1 x1717udv xc342km x16rqkct x1l2ivya x1twquvy xw0krtf xfifm61 xo5v014 x7eptgl x67bb7w x5ve5x3 x1hax9zg",
128
260
  "aria-label": n("verdict.compare"),
129
261
  "aria-valuemax": 100,
@@ -134,7 +266,7 @@ function ae({ split: e, onSplit: t }) {
134
266
  style: { left: `${e}%` },
135
267
  type: "button",
136
268
  onKeyDown: (n) => {
137
- (n.key === "ArrowLeft" || n.key === "ArrowRight") && (n.preventDefault(), n.stopPropagation(), t(r(e + (n.key === "ArrowLeft" ? -5 : ie))));
269
+ (n.key === "ArrowLeft" || n.key === "ArrowRight") && (n.preventDefault(), n.stopPropagation(), t(r(e + (n.key === "ArrowLeft" ? -5 : he))));
138
270
  },
139
271
  onPointerDown: (e) => {
140
272
  e.stopPropagation(), e.currentTarget.setPointerCapture(e.pointerId);
@@ -147,23 +279,23 @@ function ae({ split: e, onSplit: t }) {
147
279
  ] });
148
280
  }
149
281
  // src/viewer/components/VideoPlayer.tsx
150
- var oe = 160, B = [
282
+ var _e = 160, W = [
151
283
  1,
152
284
  1.5,
153
285
  2,
154
286
  .5
155
- ], V = (e) => {
287
+ ], G = (e) => {
156
288
  let t = Math.max(0, Math.floor(Number.isFinite(e) ? e : 0));
157
289
  return `${Math.floor(t / 60)}:${String(t % 60).padStart(2, "0")}`;
158
290
  };
159
- function se({ playing: e }) {
160
- return /* @__PURE__ */ v("svg", {
291
+ function ve({ playing: e }) {
292
+ return /* @__PURE__ */ x("svg", {
161
293
  "aria-hidden": "true",
162
294
  fill: "currentColor",
163
295
  height: "16",
164
296
  viewBox: "0 0 24 24",
165
297
  width: "16",
166
- children: [!1, !0].map((t) => /* @__PURE__ */ v(S.g, {
298
+ children: [!1, !0].map((t) => /* @__PURE__ */ x(T.g, {
167
299
  initial: !1,
168
300
  style: { transformOrigin: "12px 12px" },
169
301
  transition: {
@@ -176,29 +308,29 @@ function se({ playing: e }) {
176
308
  scale: e === t ? 1 : .25,
177
309
  filter: e === t ? "blur(0px)" : "blur(4px)"
178
310
  },
179
- children: t ? /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v("rect", {
311
+ children: t ? /* @__PURE__ */ S(b, { children: [/* @__PURE__ */ x("rect", {
180
312
  height: "16",
181
313
  rx: "1",
182
314
  width: "4",
183
315
  x: "6",
184
316
  y: "4"
185
- }), /* @__PURE__ */ v("rect", {
317
+ }), /* @__PURE__ */ x("rect", {
186
318
  height: "16",
187
319
  rx: "1",
188
320
  width: "4",
189
321
  x: "14",
190
322
  y: "4"
191
- })] }) : /* @__PURE__ */ v("path", { d: "M8 4.6c-.9-.5-2 .1-2 1.1v12.6c0 1 1.1 1.6 2 1.1l11-6.3c.9-.5.9-1.7 0-2.2Z" })
323
+ })] }) : /* @__PURE__ */ x("path", { d: "M8 4.6c-.9-.5-2 .1-2 1.1v12.6c0 1 1.1 1.6 2 1.1l11-6.3c.9-.5.9-1.7 0-2.2Z" })
192
324
  }, String(t)))
193
325
  });
194
326
  }
195
- function H({ src: e, title: t, barScale: n, barWidth: r, onExpand: i, onLoadedData: a }) {
196
- let { t: s } = o(), c = h(null), l = h(null), [u, d] = g(!1), [p, m] = g(0), [S, C] = g(0), [w, T] = g(1), [E, D] = g(!1), [O, k] = g(!1);
197
- f(() => {
198
- let e = c.current;
327
+ function K({ src: e, title: t, barScale: n, barWidth: r, onExpand: i, onLoadedData: a }) {
328
+ let { t: o } = c(), s = v(null), l = v(null), [u, d] = y(!1), [f, p] = y(0), [h, g] = y(0), [_, T] = y(1), [E, D] = y(!1), [O, k] = y(!1);
329
+ m(() => {
330
+ let e = s.current;
199
331
  if (!e) return;
200
332
  let t = () => {
201
- k(!1), m(e.currentTime), C(e.duration), d(!e.paused);
333
+ k(!1), p(e.currentTime), g(e.duration), d(!e.paused);
202
334
  }, n = [
203
335
  "loadedmetadata",
204
336
  "timeupdate",
@@ -214,33 +346,33 @@ function H({ src: e, title: t, barScale: n, barWidth: r, onExpand: i, onLoadedDa
214
346
  };
215
347
  }, []);
216
348
  let A = () => {
217
- let e = c.current;
349
+ let e = s.current;
218
350
  e && (e.paused ? e.play().catch(() => d(!e.paused)) : e.pause());
219
351
  }, j = () => {
220
- let e = B[(B.indexOf(w) + 1) % B.length];
221
- c.current && (c.current.playbackRate = e), T(e);
352
+ let e = W[(W.indexOf(_) + 1) % W.length];
353
+ s.current && (s.current.playbackRate = e), T(e);
222
354
  }, M = () => {
223
- c.current && (c.current.loop = !E), D(!E);
355
+ s.current && (s.current.loop = !E), D(!E);
224
356
  }, N = (e) => {
225
- let t = c.current;
357
+ let t = s.current;
226
358
  if (!t || !Number.isFinite(t.duration) || t.duration <= 0) return;
227
359
  let n = e.currentTarget.getBoundingClientRect();
228
- t.currentTime = Math.min(1, Math.max(0, (e.clientX - n.left) / n.width)) * t.duration, m(t.currentTime);
360
+ t.currentTime = Math.min(1, Math.max(0, (e.clientX - n.left) / n.width)) * t.duration, p(t.currentTime);
229
361
  };
230
- return /* @__PURE__ */ y(_, { children: [
231
- /* @__PURE__ */ v("video", {
362
+ return /* @__PURE__ */ S(b, { children: [
363
+ /* @__PURE__ */ x("video", {
232
364
  muted: !0,
233
365
  playsInline: !0,
234
366
  preload: "metadata",
235
- ref: c,
367
+ ref: s,
236
368
  src: e,
237
369
  title: t,
238
370
  onLoadedData: a,
239
371
  className: "x10l6tqk x10a8y8t xh8yej3 x5yr21d x1lliihq x19kjcj4 x1hpxl24 x47corl"
240
372
  }),
241
- /* @__PURE__ */ v("button", {
373
+ /* @__PURE__ */ x("button", {
242
374
  "data-video-surface": !0,
243
- "aria-label": s(u ? "video.pauseTitle" : "video.playTitle", { title: t }),
375
+ "aria-label": o(u ? "video.pauseTitle" : "video.playTitle", { title: t }),
244
376
  type: "button",
245
377
  onClick: (e) => {
246
378
  (!e.detail || !l.current || Math.hypot(e.clientX - l.current.x, e.clientY - l.current.y) < 4) && A(), l.current = null;
@@ -256,11 +388,11 @@ function H({ src: e, title: t, barScale: n, barWidth: r, onExpand: i, onLoadedDa
256
388
  },
257
389
  className: "x10l6tqk x10a8y8t xh8yej3 x5yr21d x1717udv xc342km xjbqb8w x1ypdohk x1t137rt x9v5kkp x1de99jn x1af67cj x1v57pqu"
258
390
  }),
259
- O && /* @__PURE__ */ v("div", {
391
+ O && /* @__PURE__ */ x("div", {
260
392
  className: "x10l6tqk x10a8y8t xrvj5dj x1ku5rj1 x1tamke2 x193dt0t xyxeb8y xqfszdh x4z9k3i x2b8uid x47corl",
261
- children: s("video.failed")
393
+ children: o("video.failed")
262
394
  }),
263
- r >= oe && /* @__PURE__ */ y("div", {
395
+ r >= _e && /* @__PURE__ */ S("div", {
264
396
  "data-chrome": "video-controls",
265
397
  onPointerDown: (e) => e.stopPropagation(),
266
398
  className: "x10l6tqk xu96u03 xdsb8wn xc9qbxq x9f619 x78zum5 x6s0dn4 x1v2ro7d xaope02 x1hj3fc7 x193dt0t x178xt8z x13fuv20 xyky8oz x1fh8tye x1fao0z8 x1j6dyjg x67bb7w xt0e3qv x87ps6o",
@@ -269,26 +401,26 @@ function H({ src: e, title: t, barScale: n, barWidth: r, onExpand: i, onLoadedDa
269
401
  transform: `scale(${n})`
270
402
  },
271
403
  children: [
272
- /* @__PURE__ */ v("button", {
273
- "aria-label": s(u ? "video.pause" : "video.play"),
404
+ /* @__PURE__ */ x("button", {
405
+ "aria-label": o(u ? "video.pause" : "video.play"),
274
406
  type: "button",
275
407
  onClick: A,
276
408
  className: "x2lah0s xrvj5dj x1ku5rj1 x1717udv xc342km xjbqb8w xagcll2 xazlcq2 xjb2p0i x1j6dyjg x1ypdohk",
277
- children: /* @__PURE__ */ v(se, { playing: u })
409
+ children: /* @__PURE__ */ x(ve, { playing: u })
278
410
  }),
279
- /* @__PURE__ */ y("span", {
411
+ /* @__PURE__ */ S("span", {
280
412
  className: "x2lah0s xss6m8b",
281
413
  children: [
282
- V(p),
414
+ G(f),
283
415
  " / ",
284
- V(S)
416
+ G(h)
285
417
  ]
286
418
  }),
287
- /* @__PURE__ */ y("div", {
288
- "aria-label": s("video.progress"),
289
- "aria-valuemax": Math.round(S || 0),
419
+ /* @__PURE__ */ S("div", {
420
+ "aria-label": o("video.progress"),
421
+ "aria-valuemax": Math.round(h || 0),
290
422
  "aria-valuemin": 0,
291
- "aria-valuenow": Math.round(p),
423
+ "aria-valuenow": Math.round(f),
292
424
  role: "slider",
293
425
  tabIndex: 0,
294
426
  onPointerDown: (e) => {
@@ -298,20 +430,20 @@ function H({ src: e, title: t, barScale: n, barWidth: r, onExpand: i, onLoadedDa
298
430
  e.buttons === 1 && N(e);
299
431
  },
300
432
  className: "x1n2onr6 x98rzlu x1v9usgg x78zum5 x6s0dn4 x1ypdohk",
301
- children: [/* @__PURE__ */ v("span", { className: "x10l6tqk xu96u03 x3m8u43 xuoj239 x1q6ipvf" }), /* @__PURE__ */ v("span", {
433
+ children: [/* @__PURE__ */ x("span", { className: "x10l6tqk xu96u03 x3m8u43 xuoj239 x1q6ipvf" }), /* @__PURE__ */ x("span", {
302
434
  className: "x10l6tqk xu96u03 xuoj239 x1l2ivya",
303
- style: { width: `${S > 0 ? p / S * 100 : 0}%` }
435
+ style: { width: `${h > 0 ? f / h * 100 : 0}%` }
304
436
  })]
305
437
  }),
306
- /* @__PURE__ */ y("button", {
307
- "aria-label": s("video.speed"),
438
+ /* @__PURE__ */ S("button", {
439
+ "aria-label": o("video.speed"),
308
440
  type: "button",
309
441
  onClick: j,
310
442
  className: "x2lah0s xrvj5dj x1ku5rj1 x1717udv xc342km xjbqb8w xagcll2 xazlcq2 xjb2p0i x1j6dyjg x1ypdohk x17s4nb9 x1s688f",
311
- children: [w, "×"]
443
+ children: [_, "×"]
312
444
  }),
313
- /* @__PURE__ */ v("button", {
314
- "aria-label": s("video.loop"),
445
+ /* @__PURE__ */ x("button", {
446
+ "aria-label": o("video.loop"),
315
447
  "aria-pressed": E,
316
448
  type: "button",
317
449
  onClick: M,
@@ -319,22 +451,22 @@ function H({ src: e, title: t, barScale: n, barWidth: r, onExpand: i, onLoadedDa
319
451
  0: { className: "x2lah0s xrvj5dj x1ku5rj1 x1717udv xc342km xjbqb8w xagcll2 xazlcq2 xjb2p0i x1j6dyjg x1ypdohk" },
320
452
  1: { className: "x2lah0s xrvj5dj x1ku5rj1 x1717udv xc342km xjbqb8w xjb2p0i x1j6dyjg x1ypdohk xymxiyj x1p2l8fb" }
321
453
  }[!E | 0],
322
- children: /* @__PURE__ */ v(x, { size: 14 })
454
+ children: /* @__PURE__ */ x(w, { size: 14 })
323
455
  }),
324
- i && /* @__PURE__ */ v("button", {
325
- "aria-label": s("video.expand"),
456
+ i && /* @__PURE__ */ x("button", {
457
+ "aria-label": o("video.expand"),
326
458
  type: "button",
327
459
  onClick: i,
328
460
  className: "x2lah0s xrvj5dj x1ku5rj1 x1717udv xc342km xjbqb8w xagcll2 xazlcq2 xjb2p0i x1j6dyjg x1ypdohk",
329
- children: /* @__PURE__ */ v(b, { size: 13 })
461
+ children: /* @__PURE__ */ x(C, { size: 13 })
330
462
  })
331
463
  ]
332
464
  })
333
465
  ] });
334
466
  }
335
467
  // src/viewer/components/MediaBoard.tsx
336
- var ce = (e) => `inset(0 ${100 - e}% 0 0)`;
337
- function le(e, t, n) {
468
+ var ye = (e) => `inset(0 ${100 - e}% 0 0)`;
469
+ function be(e, t, n) {
338
470
  return t === e.src ? !n && e.previous ? {
339
471
  ...e,
340
472
  previous: null
@@ -344,48 +476,48 @@ function le(e, t, n) {
344
476
  previous: n && e.loaded === e.src ? e.src : null
345
477
  };
346
478
  }
347
- function U({ id: e, board: t, src: n, zoom: r, compare: i = !1, onExpand: a }) {
348
- let [o, s] = g({
479
+ function q({ id: e, board: t, src: n, zoom: r, compare: i = !1, onExpand: a }) {
480
+ let [o, s] = y({
349
481
  src: n,
350
482
  loaded: null,
351
483
  previous: null
352
- }), [c, l] = g(50), u = le(o, n, i);
484
+ }), [c, l] = y(50), u = be(o, n, i);
353
485
  u !== o && s(u);
354
486
  let d = (e) => () => s((t) => t.src === e ? {
355
487
  ...t,
356
488
  loaded: e
357
- } : t), f = t.title ?? e, p = (e, n) => t.type === "video" ? /* @__PURE__ */ v(H, {
489
+ } : t), f = t.title ?? e, p = (e, n) => t.type === "video" ? /* @__PURE__ */ x(K, {
358
490
  barScale: 1 / r,
359
491
  barWidth: t.w * r,
360
492
  src: e,
361
493
  title: f,
362
494
  onExpand: n ? a : void 0,
363
495
  onLoadedData: n ? d(e) : void 0
364
- }) : /* @__PURE__ */ v("img", {
496
+ }) : /* @__PURE__ */ x("img", {
365
497
  alt: f,
366
498
  draggable: !1,
367
499
  src: e,
368
500
  onLoad: n ? d(e) : void 0,
369
501
  className: "x10l6tqk x10a8y8t xh8yej3 x5yr21d x1lliihq x19kjcj4 x1l2ivya x47corl"
370
502
  }), m = u.previous;
371
- return /* @__PURE__ */ y("div", {
503
+ return /* @__PURE__ */ S("div", {
372
504
  "data-compare": m ? "" : void 0,
373
505
  className: "x10l6tqk x10a8y8t",
374
- children: [[u.src, m].map((e) => e === null ? null : /* @__PURE__ */ v("div", {
506
+ children: [[u.src, m].map((e) => e === null ? null : /* @__PURE__ */ x("div", {
375
507
  ...{
376
508
  0: { className: "x10l6tqk x10a8y8t" },
377
509
  1: { className: "x10l6tqk x10a8y8t x47corl xhtitgo" }
378
510
  }[e === m | 0],
379
- style: e === m ? { clipPath: ce(c) } : void 0,
511
+ style: e === m ? { clipPath: ye(c) } : void 0,
380
512
  children: p(e, e === u.src)
381
- }, e)), m && /* @__PURE__ */ v(ae, {
513
+ }, e)), m && /* @__PURE__ */ x(ge, {
382
514
  split: c,
383
515
  onSplit: l
384
516
  })]
385
517
  });
386
518
  }
387
519
  // src/viewer/components/updated-styles.ts
388
- var W = {
520
+ var J = {
389
521
  slot: {
390
522
  k3XXqK: "xaatb59",
391
523
  kjBf7l: "xu54md5",
@@ -430,33 +562,33 @@ var W = {
430
562
  kWkggS: "x1c2n0v",
431
563
  $$css: !0
432
564
  }
433
- }, G = (e, t) => new Date(e).toLocaleTimeString(t, {
565
+ }, xe = (e, t) => new Date(e).toLocaleTimeString(t, {
434
566
  hour: "2-digit",
435
567
  minute: "2-digit",
436
568
  hour12: !1
437
569
  });
438
570
  // src/viewer/components/UpdatedMarks.tsx
439
- function K() {
440
- let { t: e } = o();
441
- return /* @__PURE__ */ v("span", {
571
+ function Se() {
572
+ let { t: e } = c();
573
+ return /* @__PURE__ */ x("span", {
442
574
  "data-updated-badge": "",
443
- ...n(W.badge),
575
+ ...i(J.badge),
444
576
  children: e("verdict.newBadge")
445
577
  });
446
578
  }
447
- function ue({ update: e }) {
448
- let { t, i18n: r } = o();
449
- return /* @__PURE__ */ y("span", {
579
+ function Ce({ update: e }) {
580
+ let { t, i18n: n } = c();
581
+ return /* @__PURE__ */ S("span", {
450
582
  "data-updated-pill": "",
451
- ...n(W.pill),
452
- children: [/* @__PURE__ */ v("span", { ...n(W.dot) }), t("verdict.updated", {
453
- time: G(e.at, r.language),
583
+ ...i(J.pill),
584
+ children: [/* @__PURE__ */ x("span", { ...i(J.dot) }), t("verdict.updated", {
585
+ time: xe(e.at, n.language),
454
586
  count: e.boards.length
455
587
  })]
456
588
  });
457
589
  }
458
590
  // src/viewer/lib/cursorMotion.ts
459
- function q(e, t) {
591
+ function Y(e, t) {
460
592
  let n = e;
461
593
  for (; n.length > 1;) n = n.slice(0, -1).map((e, r) => ({
462
594
  x: e.x + (n[r + 1].x - e.x) * t,
@@ -464,7 +596,7 @@ function q(e, t) {
464
596
  }));
465
597
  return n[0];
466
598
  }
467
- function de(e, t, n) {
599
+ function we(e, t, n) {
468
600
  let r = t.x - e.x, i = t.y - e.y, a = -i, o = r;
469
601
  a < 0 && (a = -a, o = -o);
470
602
  let s = (t, n) => ({
@@ -490,7 +622,7 @@ function de(e, t, n) {
490
622
  y: 5 * (c[t + 1].y - e.y)
491
623
  })), u = [0], d = e;
492
624
  for (let e = 1; e <= 600; e++) {
493
- let t = q(c, e / 600);
625
+ let t = Y(c, e / 600);
494
626
  u.push(u[e - 1] + Math.hypot(t.x - d.x, t.y - d.y)), d = t;
495
627
  }
496
628
  let f = u[600];
@@ -502,18 +634,18 @@ function de(e, t, n) {
502
634
  let e = n + r >> 1;
503
635
  u[e] < t ? n = e : r = e;
504
636
  }
505
- let i = u[r] - u[n], a = (n + (i ? (t - u[n]) / i : 0)) / 600, o = q(l, a);
637
+ let i = u[r] - u[n], a = (n + (i ? (t - u[n]) / i : 0)) / 600, o = Y(l, a);
506
638
  return {
507
- ...q(c, a),
639
+ ...Y(c, a),
508
640
  angle: Math.atan2(o.y, o.x) * 180 / Math.PI + 135
509
641
  };
510
642
  }
511
643
  };
512
644
  }
513
645
  // src/viewer/lib/dragMotion.ts
514
- var J = (e) => Math.max(0, Math.min(1, e)), Y = (e) => e * e * (3 - 2 * e);
515
- function fe(e, t, n, r, i) {
516
- let a = J(n), o = t.x - e.x, s = t.y - e.y, c = Y(a), l = Y(J((a - .11) / .89)), u = o * r * (c - l), d = s * r * (c - l), f = Math.min(1, 12 / (Math.hypot(u, d) || 1)), p = 1 - Y(J(a * 4)), m = u * f + (i?.pullX ?? 0) * p, h = d * f + (i?.pullY ?? 0) * p, g = Math.min(1, 12 / (Math.hypot(m, h) || 1)), _ = a * Math.max(2, Math.ceil(Math.hypot(o, s) * r / 36)) % 1;
646
+ var X = (e) => Math.max(0, Math.min(1, e)), Z = (e) => e * e * (3 - 2 * e);
647
+ function Te(e, t, n, r, i) {
648
+ let a = X(n), o = t.x - e.x, s = t.y - e.y, c = Z(a), l = Z(X((a - .11) / .89)), u = o * r * (c - l), d = s * r * (c - l), f = Math.min(1, 12 / (Math.hypot(u, d) || 1)), p = 1 - Z(X(a * 4)), m = u * f + (i?.pullX ?? 0) * p, h = d * f + (i?.pullY ?? 0) * p, g = Math.min(1, 12 / (Math.hypot(m, h) || 1)), _ = a * Math.max(2, Math.ceil(Math.hypot(o, s) * r / 36)) % 1;
517
649
  return {
518
650
  x: e.x + o * c - u * f / r,
519
651
  y: e.y + s * c - d * f / r,
@@ -527,59 +659,59 @@ function fe(e, t, n, r, i) {
527
659
  };
528
660
  }
529
661
  // src/viewer/components/Clawd.tsx
530
- var pe = "M2 0h12v2h-12zM2 2h2v2h-2zM5 2h6v2h-6zM12 2h2v2h-2zM0 4h16v2h-16zM2 6h12v2h-12z", me = "M4 2h1v2h-1zM11 2h1v2h-1z", X = "M3 8h1v2h-1zM5 8h1v2h-1zM10 8h1v2h-1zM12 8h1v2h-1z";
531
- function he({ fill: e, legs: t }) {
532
- return /* @__PURE__ */ y("svg", {
662
+ var Ee = "M2 0h12v2h-12zM2 2h2v2h-2zM5 2h6v2h-6zM12 2h2v2h-2zM0 4h16v2h-16zM2 6h12v2h-12z", De = "M4 2h1v2h-1zM11 2h1v2h-1z", Oe = "M3 8h1v2h-1zM5 8h1v2h-1zM10 8h1v2h-1zM12 8h1v2h-1z";
663
+ function ke({ fill: e, legs: t }) {
664
+ return /* @__PURE__ */ S("svg", {
533
665
  "aria-hidden": "true",
534
666
  height: "20",
535
667
  viewBox: "0 0 16 10",
536
668
  width: "32",
537
669
  className: "x1lliihq x1rea2x4 xqlk7fu x1so62im x1gh0xk6 x1pao9z2 x1vtvzbl x4hg4is xa4qsjk x1aquc0h",
538
670
  children: [
539
- /* @__PURE__ */ v("path", {
540
- d: pe,
671
+ /* @__PURE__ */ x("path", {
672
+ d: Ee,
541
673
  fill: e
542
674
  }),
543
- /* @__PURE__ */ v("path", {
544
- d: X,
675
+ /* @__PURE__ */ x("path", {
676
+ d: Oe,
545
677
  fill: e,
546
678
  ref: t
547
679
  }),
548
- /* @__PURE__ */ v("path", {
549
- d: me,
550
- fill: c.black,
680
+ /* @__PURE__ */ x("path", {
681
+ d: De,
682
+ fill: u.black,
551
683
  className: "x1764fhq x1g0ag68 x7w6qa3 x176w33q xa4qsjk x1aquc0h"
552
684
  })
553
685
  ]
554
686
  });
555
687
  }
556
688
  // src/viewer/components/DraggingPet.tsx
557
- var ge = "M2 8h1v2h-1zM5 8h1v1h-1zM10 8h1v2h-1zM13 8h1v1h-1z", _e = "M3 8h1v1h-1zM6 8h1v2h-1zM9 8h1v1h-1zM12 8h1v2h-1z";
558
- function ve({ fill: e, ref: t }) {
559
- let n = h(null), r = h(null), i = h(null), a = h(null), o = h(null);
560
- return p(t, () => ({ paint({ pullX: e, pullY: t, lift: s, lean: c, step: l, moving: u }) {
689
+ var Ae = "M2 8h1v2h-1zM5 8h1v1h-1zM10 8h1v2h-1zM13 8h1v1h-1z", je = "M3 8h1v1h-1zM6 8h1v2h-1zM9 8h1v1h-1zM12 8h1v2h-1z";
690
+ function Me({ fill: e, ref: t }) {
691
+ let n = v(null), r = v(null), i = v(null), a = v(null), o = v(null);
692
+ return g(t, () => ({ paint({ pullX: e, pullY: t, lift: s, lean: c, step: l, moving: u }) {
561
693
  n.current && (n.current.style.transform = `translate(${e}px, ${t - s}px) skewX(${c}deg)`);
562
694
  let d = 31 + e, f = 8 + t - s, p = `M12.5 14.5 Q${d - 7} ${f + 8} ${d} ${f}`;
563
- i.current?.setAttribute("d", p), a.current?.setAttribute("d", p), r.current?.setAttribute("d", u ? l < .5 ? ge : _e : X), o.current && (o.current.style.transform = `translate(${e}px, ${t}px)`);
564
- } }), []), /* @__PURE__ */ y("div", {
695
+ i.current?.setAttribute("d", p), a.current?.setAttribute("d", p), r.current?.setAttribute("d", u ? l < .5 ? Ae : je : Oe), o.current && (o.current.style.transform = `translate(${e}px, ${t}px)`);
696
+ } }), []), /* @__PURE__ */ S("div", {
565
697
  "aria-hidden": "true",
566
698
  style: { color: e },
567
699
  children: [
568
- /* @__PURE__ */ y("svg", {
700
+ /* @__PURE__ */ S("svg", {
569
701
  viewBox: "-40 -40 140 120",
570
702
  className: "x10l6tqk xar8odu x1toy1gi xifkd7f x1wkxgih x1rea2x4",
571
703
  children: [
572
- /* @__PURE__ */ v("path", {
704
+ /* @__PURE__ */ x("path", {
573
705
  d: "M12.5 14.5 Q24 16 31 8",
574
706
  ref: a,
575
707
  className: "xbh8q5q x1nvyj2c x1q82h7f x1owpc8m x1f6yumg"
576
708
  }),
577
- /* @__PURE__ */ v("path", {
709
+ /* @__PURE__ */ x("path", {
578
710
  d: "M12.5 14.5 Q24 16 31 8",
579
711
  ref: i,
580
712
  className: "xbh8q5q x73je2i x1ebhgje x1owpc8m x1f6yumg"
581
713
  }),
582
- /* @__PURE__ */ v("rect", {
714
+ /* @__PURE__ */ x("rect", {
583
715
  height: "4",
584
716
  rx: ".6",
585
717
  width: "4",
@@ -589,15 +721,15 @@ function ve({ fill: e, ref: t }) {
589
721
  })
590
722
  ]
591
723
  }),
592
- /* @__PURE__ */ v("div", {
724
+ /* @__PURE__ */ x("div", {
593
725
  ref: o,
594
726
  className: "x10l6tqk x1l0fap9 xmhk92p xvy4d1p xuoj239 x16rqkct xf6rkd6"
595
727
  }),
596
- /* @__PURE__ */ v("div", {
728
+ /* @__PURE__ */ x("div", {
597
729
  "data-mascot": "clawd",
598
730
  ref: n,
599
731
  className: "x10l6tqk xbnrxzc x1pdr0v7 xqlk7fu x1so62im",
600
- children: /* @__PURE__ */ v(he, {
732
+ children: /* @__PURE__ */ x(ke, {
601
733
  fill: e,
602
734
  legs: r
603
735
  })
@@ -606,21 +738,21 @@ function ve({ fill: e, ref: t }) {
606
738
  });
607
739
  }
608
740
  // src/viewer/components/WritingCursor.tsx
609
- function ye({ x: e, y: t, zoom: n, agent: r, title: i }) {
610
- let a = u(r), o = a.mascot === "clawd", s = a.icon ? l[a.icon] : null, d = h(null), f = h(null), p = h(null), g = h(null), _ = h(null), b = h(!1), x = h(n), S = (e) => `translate(${e.x}px, ${e.y}px) scale(${1 / x.current})`, C = (e) => `translate(-3.43px, -3.43px) rotate(${e}deg)`, w = (e) => {
611
- _.current = e, d.current && (d.current.style.transform = S(e)), f.current && (f.current.style.transform = C(e.angle));
612
- }, E = (e) => {
613
- g.current = e, p.current?.paint(e);
741
+ function Ne({ x: e, y: t, zoom: n, agent: r, title: i }) {
742
+ let a = f(r), o = a.mascot === "clawd", s = a.icon ? d[a.icon] : null, c = v(null), l = v(null), p = v(null), m = v(null), h = v(null), g = v(!1), y = v(n), b = (e) => `translate(${e.x}px, ${e.y}px) scale(${1 / y.current})`, C = (e) => `translate(-3.43px, -3.43px) rotate(${e}deg)`, w = (e) => {
743
+ h.current = e, c.current && (c.current.style.transform = b(e)), l.current && (l.current.style.transform = C(e.angle));
744
+ }, T = (e) => {
745
+ m.current = e, p.current?.paint(e);
614
746
  };
615
- return m(() => {
616
- x.current = n, _.current && w(_.current);
617
- }), m(() => {
618
- let n = matchMedia("(prefers-reduced-motion: reduce)"), r = _.current, i = 0, a = () => {
619
- cancelAnimationFrame(i), i = 0, b.current = !1, w({
747
+ return _(() => {
748
+ y.current = n, h.current && w(h.current);
749
+ }), _(() => {
750
+ let n = matchMedia("(prefers-reduced-motion: reduce)"), r = h.current, i = 0, a = () => {
751
+ cancelAnimationFrame(i), i = 0, g.current = !1, w({
620
752
  x: e,
621
753
  y: t,
622
- angle: o ? 0 : _.current?.angle ?? 0
623
- }), E({
754
+ angle: o ? 0 : h.current?.angle ?? 0
755
+ }), T({
624
756
  pullX: 0,
625
757
  pullY: 0,
626
758
  lift: 0,
@@ -629,26 +761,26 @@ function ye({ x: e, y: t, zoom: n, agent: r, title: i }) {
629
761
  moving: !1
630
762
  });
631
763
  };
632
- !r || n.matches || Math.hypot(e - r.x, t - r.y) * x.current < 2 ? a() : (b.current = !0, i = requestAnimationFrame(o ? ((n) => {
633
- let r = Math.hypot(e - n.x, t - n.y) * x.current, a = Math.max(500, Math.min(1200, r * 3.3)), o = g.current ?? void 0, s = performance.now(), c = (r) => {
634
- let l = Math.min(1, Math.max(0, (r - s) / a)), u = fe(n, {
764
+ !r || n.matches || Math.hypot(e - r.x, t - r.y) * y.current < 2 ? a() : (g.current = !0, i = requestAnimationFrame(o ? ((n) => {
765
+ let r = Math.hypot(e - n.x, t - n.y) * y.current, a = Math.max(500, Math.min(1200, r * 3.3)), o = m.current ?? void 0, s = performance.now(), c = (r) => {
766
+ let l = Math.min(1, Math.max(0, (r - s) / a)), u = Te(n, {
635
767
  x: e,
636
768
  y: t
637
- }, l, x.current, o);
638
- b.current = l < 1, w({
769
+ }, l, y.current, o);
770
+ g.current = l < 1, w({
639
771
  x: u.x,
640
772
  y: u.y,
641
773
  angle: 0
642
- }), E(u), i = l < 1 ? requestAnimationFrame(c) : 0;
774
+ }), T(u), i = l < 1 ? requestAnimationFrame(c) : 0;
643
775
  };
644
776
  return c;
645
777
  })(r) : ((n) => {
646
- let r = de(n, {
778
+ let r = we(n, {
647
779
  x: e,
648
780
  y: t
649
- }, b.current ? n.angle : void 0), a = Math.min(1800, 900 + r.length * x.current * 1.2), o = performance.now(), s = o, c = (e) => {
650
- let t = Math.min(1, Math.max(0, (e - o) / a)), n = r.at(t ** 3 * (t * (t * 6 - 15) + 10)), l = _.current.angle;
651
- n.angle = l + (((n.angle - l) % 360 + 540) % 360 - 180) * (1 - Math.exp(-(e - s) / 80)), s = e, b.current = t < 1, w(n), i = t < 1 ? requestAnimationFrame(c) : 0;
781
+ }, g.current ? n.angle : void 0), a = Math.min(1800, 900 + r.length * y.current * 1.2), o = performance.now(), s = o, c = (e) => {
782
+ let t = Math.min(1, Math.max(0, (e - o) / a)), n = r.at(t ** 3 * (t * (t * 6 - 15) + 10)), l = h.current.angle;
783
+ n.angle = l + (((n.angle - l) % 360 + 540) % 360 - 180) * (1 - Math.exp(-(e - s) / 80)), s = e, g.current = t < 1, w(n), i = t < 1 ? requestAnimationFrame(c) : 0;
652
784
  };
653
785
  return c;
654
786
  })(r)));
@@ -662,56 +794,56 @@ function ye({ x: e, y: t, zoom: n, agent: r, title: i }) {
662
794
  e,
663
795
  t,
664
796
  o
665
- ]), /* @__PURE__ */ y("div", {
797
+ ]), /* @__PURE__ */ S("div", {
666
798
  "aria-label": `${r} last worked on ${i}`,
667
- ref: d,
799
+ ref: c,
668
800
  role: "status",
669
801
  className: "x10l6tqk xu96u03 x13vifvy x1u8a7rm x47corl x1hj3fc7",
670
802
  style: { transform: `translate(${e}px, ${t}px) scale(${1 / n})` },
671
803
  children: [
672
- /* @__PURE__ */ y("svg", {
804
+ /* @__PURE__ */ S("svg", {
673
805
  "aria-hidden": "true",
674
806
  "data-agent-arrow": "",
675
807
  height: "24",
676
- ref: f,
808
+ ref: l,
677
809
  viewBox: "0 0 28 28",
678
810
  width: "24",
679
811
  className: "x1lliihq xqqlr9g x1gtfylx",
680
812
  style: { transform: C(0) },
681
- children: [/* @__PURE__ */ v("path", {
682
- d: T,
813
+ children: [/* @__PURE__ */ x("path", {
814
+ d: O,
683
815
  fill: "none",
684
- stroke: a.pale ? c.ink : c.white,
816
+ stroke: a.pale ? u.ink : u.white,
685
817
  strokeLinejoin: "round",
686
818
  strokeWidth: "4"
687
- }), /* @__PURE__ */ v("path", {
688
- d: T,
819
+ }), /* @__PURE__ */ x("path", {
820
+ d: O,
689
821
  fill: a.color
690
822
  })]
691
823
  }),
692
- o && /* @__PURE__ */ v(ve, {
824
+ o && /* @__PURE__ */ x(Me, {
693
825
  fill: a.color,
694
826
  ref: p
695
827
  }),
696
- !o && /* @__PURE__ */ y("div", {
828
+ !o && /* @__PURE__ */ S("div", {
697
829
  ...{
698
830
  0: { className: "x10l6tqk x1trqr8e xv4lvxq x78zum5 x6s0dn4 x1jnr06f x1w2h69v xaso8d8 x1bjonze xdocmp1 xgs1500 x828b17 x1bqy6mi x1j6dyjg x1s688f x152skdk xuxw1ft xmj57et" },
699
831
  1: { className: "x10l6tqk x1trqr8e xv4lvxq x78zum5 x6s0dn4 x1jnr06f x1w2h69v xaso8d8 x1bjonze xdocmp1 xgs1500 x828b17 x1bqy6mi x1j6dyjg x1s688f x152skdk xuxw1ft xpm4iv0" }
700
832
  }[!!a.pale | 0],
701
833
  style: {
702
834
  backgroundColor: a.color,
703
- color: a.darkInk ? c.ink : c.white
835
+ color: a.darkInk ? u.ink : u.white
704
836
  },
705
- children: [s && /* @__PURE__ */ v(s, {
837
+ children: [s && /* @__PURE__ */ x(s, {
706
838
  "aria-hidden": "true",
707
839
  size: 12
708
- }), /* @__PURE__ */ v("span", { children: r })]
840
+ }), /* @__PURE__ */ x("span", { children: r })]
709
841
  })
710
842
  ]
711
843
  });
712
844
  }
713
845
  // src/viewer/components/Canvas.tsx
714
- var be = /* @__PURE__ */ e({ Canvas: () => De }), Z = {
846
+ var Pe = /* @__PURE__ */ e({ Canvas: () => Ve }), Q = {
715
847
  slot: {
716
848
  kVAEAm: "x10l6tqk",
717
849
  $$css: !0
@@ -725,27 +857,8 @@ var be = /* @__PURE__ */ e({ Canvas: () => De }), Z = {
725
857
  kjBf7l: "x7vaw5c",
726
858
  $$css: !0
727
859
  }
728
- };
729
- function xe(e) {
730
- if (!e) return {
731
- backgroundColor: c.paperWarm,
732
- color: c.inkWarm
733
- };
734
- let t = e.length === 4 ? e.slice(1).split("").map((e) => e + e).join("") : e.slice(1), [n, r, i] = [
735
- 0,
736
- 2,
737
- 4
738
- ].map((e) => {
739
- let n = parseInt(t.slice(e, e + 2), 16) / 255;
740
- return n <= .04045 ? n / 12.92 : ((n + .055) / 1.055) ** 2.4;
741
- });
742
- return {
743
- backgroundColor: e,
744
- color: .2126 * n + .7152 * r + .0722 * i > .179 ? c.black : c.white
745
- };
746
- }
747
- var Se = /* @__PURE__ */ new Map(), Q = /* @__PURE__ */ new Set(), $ = /* @__PURE__ */ new Map();
748
- function Ce(e, t, n, r = !1) {
860
+ }, Fe = /* @__PURE__ */ new Map(), $ = /* @__PURE__ */ new Set(), Ie = /* @__PURE__ */ new Map();
861
+ function Le(e, t, n, r = !1) {
749
862
  return {
750
863
  left: e.x,
751
864
  top: e.y,
@@ -755,96 +868,96 @@ function Ce(e, t, n, r = !1) {
755
868
  ...n ? r ? { visibility: "hidden" } : { display: "none" } : {}
756
869
  };
757
870
  }
758
- function we({ frameLoaded: e, frameRef: t, gesturing: n, id: r, inspecting: i, agent: a, playing: o, sandbox: c, snapshot: l, src: u, title: d }) {
759
- let [f, p] = g(null), m = f !== u, h = !m && !n && (i || o);
760
- return /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v("iframe", {
871
+ function Re({ frameLoaded: e, frameRef: t, gesturing: n, id: r, inspecting: i, agent: a, playing: o, sandbox: s, snapshot: c, src: u, title: d }) {
872
+ let [f, p] = y(null), m = f !== u, h = !m && !n && (i || o);
873
+ return /* @__PURE__ */ S(b, { children: [/* @__PURE__ */ x("iframe", {
761
874
  ...{
762
875
  0: { className: "x10l6tqk x10a8y8t xh8yej3 x5yr21d x1lliihq xc342km x1l2ivya x1qgsegg xaatb59 x1tjb3dp" },
763
876
  1: { className: "x10l6tqk x10a8y8t xh8yej3 x5yr21d x1lliihq xc342km x1l2ivya xaatb59 x1de99jn x7vaw5c" }
764
877
  }[!!o | 0],
765
878
  ref: t(r),
766
- sandbox: c,
879
+ sandbox: s,
767
880
  src: u,
768
881
  title: d,
769
882
  style: {
770
883
  pointerEvents: h ? "auto" : "none",
771
- backgroundColor: m ? s.colorFillTertiary : void 0
884
+ backgroundColor: m ? l.colorFillTertiary : void 0
772
885
  },
773
886
  onLoad: () => {
774
887
  p(u), e(r);
775
888
  }
776
- }), f === null && !l && /* @__PURE__ */ v(z, {
889
+ }), f === null && !c && /* @__PURE__ */ x(V, {
777
890
  agent: a,
778
891
  state: "opening",
779
892
  title: d
780
893
  })] });
781
894
  }
782
- var Te = d(function({ active: e, agent: t, boardBase: i, boards: a, boardSandbox: o = "allow-scripts", contentBase: s, culled: c = Q, distant: l = Q, frameLoaded: u, frameRef: d, gesturing: f = !1, images: p = Se, inspecting: m, pending: h, phases: g, playing: _, replays: b, updated: x = $, versions: S, writing: C }) {
783
- return a.map(([a, w]) => {
784
- if (r(w)) return null;
785
- let T = x.has(a), E = F(S, w.file) && !h.has(a), D = g ? g.get(a) ?? "unloaded" : "mounted", O = p.get(a) ?? null, k = !!O && (D === "unloaded" || D === "restoring"), A = E && D !== "unloaded";
786
- if (!A && (c.has(a) || l.has(a))) return null;
787
- let j = a === C || !E && a === e;
788
- return /* @__PURE__ */ y("div", {
895
+ var ze = p(function({ active: e, agent: t, boardBase: n, boards: r, boardSandbox: o = "allow-scripts", contentBase: s, culled: c = $, distant: l = $, frameLoaded: u, frameRef: d, gesturing: f = !1, images: p = Fe, inspecting: m, pending: h, phases: g, playing: _, replays: v, updated: y = Ie, versions: b, writing: C }) {
896
+ return r.map(([r, w]) => {
897
+ if (a(w)) return null;
898
+ let T = y.has(r), E = L(b, w.file) && !h.has(r), D = g ? g.get(r) ?? "unloaded" : "mounted", O = p.get(r) ?? null, k = !!O && (D === "unloaded" || D === "restoring"), A = E && D !== "unloaded";
899
+ if (!A && (c.has(r) || l.has(r))) return null;
900
+ let j = r === C || !E && r === e;
901
+ return /* @__PURE__ */ S("div", {
789
902
  "aria-busy": j || void 0,
790
- "data-board": a,
903
+ "data-board": r,
791
904
  "data-updated": T || void 0,
792
- ...n(Z.slot, !E && Z.unready, j && Z.drawing, T && W.slot),
793
- style: Ce(w, j, c.has(a), D === "capturing"),
905
+ ...i(Q.slot, !E && Q.unready, j && Q.drawing, T && J.slot),
906
+ style: Le(w, j, c.has(r), D === "capturing"),
794
907
  children: [
795
- T && /* @__PURE__ */ v(K, {}),
796
- A && /* @__PURE__ */ v(we, {
908
+ T && /* @__PURE__ */ x(Se, {}),
909
+ A && /* @__PURE__ */ x(Re, {
797
910
  agent: t,
798
911
  frameLoaded: u,
799
912
  frameRef: d,
800
913
  gesturing: f,
801
- id: a,
914
+ id: r,
802
915
  inspecting: m,
803
- playing: I(w, S) && _.has(a),
916
+ playing: R(w, b) && _.has(r),
804
917
  sandbox: o,
805
918
  snapshot: k,
806
- title: w.title ?? a,
807
- src: L(i ?? s, w.file, S[w.file] ?? 0, b[a] ?? 0)
919
+ title: w.title ?? r,
920
+ src: z(n ?? s, w.file, b[w.file] ?? 0, v[r] ?? 0)
808
921
  }),
809
- k && /* @__PURE__ */ v("img", {
922
+ k && /* @__PURE__ */ x("img", {
810
923
  alt: "",
811
924
  decoding: "async",
812
925
  draggable: !1,
813
926
  src: O,
814
927
  className: "x10l6tqk x10a8y8t xh8yej3 x5yr21d x1lliihq x47corl x1l2ivya x1qgsegg xaatb59 x1tjb3dp"
815
928
  }),
816
- E && !A && !O && /* @__PURE__ */ v(z, {
929
+ E && !A && !O && /* @__PURE__ */ x(V, {
817
930
  agent: t,
818
931
  state: "resting",
819
- title: w.title ?? a
932
+ title: w.title ?? r
820
933
  }),
821
- !E && /* @__PURE__ */ v(z, {
934
+ !E && /* @__PURE__ */ x(V, {
822
935
  agent: t,
823
936
  state: j ? "drawing" : "waiting",
824
- title: w.title ?? a
937
+ title: w.title ?? r
825
938
  })
826
939
  ]
827
- }, a);
940
+ }, r);
828
941
  });
829
942
  });
830
- function Ee({ agent: e, boards: t, contentBase: i, culled: a = Q, pending: o, updated: s = $, versions: c, writing: l, zoom: u, onExpand: d }) {
943
+ function Be({ agent: e, boards: t, contentBase: n, culled: r = $, pending: o, updated: s = Ie, versions: c, writing: l, zoom: u, onExpand: d }) {
831
944
  return t.map(([t, f]) => {
832
- if (!r(f)) return null;
833
- let p = s.has(t), m = F(c, f.file) && !o.has(t), h = t === l;
834
- return /* @__PURE__ */ y("div", {
945
+ if (!a(f)) return null;
946
+ let p = s.has(t), m = L(c, f.file) && !o.has(t), h = t === l;
947
+ return /* @__PURE__ */ S("div", {
835
948
  "aria-busy": h || void 0,
836
949
  "data-board": t,
837
950
  "data-updated": p || void 0,
838
- ...n(Z.slot, !m && Z.unready, h && Z.drawing, p && W.slot),
839
- style: Ce(f, h, a.has(t)),
840
- children: [p && /* @__PURE__ */ v(K, {}), m ? /* @__PURE__ */ v(U, {
951
+ ...i(Q.slot, !m && Q.unready, h && Q.drawing, p && J.slot),
952
+ style: Le(f, h, r.has(t)),
953
+ children: [p && /* @__PURE__ */ x(Se, {}), m ? /* @__PURE__ */ x(q, {
841
954
  board: f,
842
955
  compare: s.get(t)?.compare === !0,
843
956
  id: t,
844
- src: L(i, f.file, c[f.file] ?? 0, 0),
957
+ src: z(n, f.file, c[f.file] ?? 0, 0),
845
958
  zoom: u,
846
959
  onExpand: d && (() => d(t))
847
- }) : /* @__PURE__ */ v(z, {
960
+ }) : /* @__PURE__ */ x(V, {
848
961
  agent: e,
849
962
  state: h ? "drawing" : "waiting",
850
963
  title: f.title ?? t
@@ -852,98 +965,78 @@ function Ee({ agent: e, boards: t, contentBase: i, culled: a = Q, pending: o, up
852
965
  }, t);
853
966
  });
854
967
  }
855
- function De({ boardBase: e, boardSandbox: n, view: i, worldRef: a, phases: o, images: s, culled: c, distant: l, gesturing: d, boards: f, notes: p, titleRooms: m, contentBase: h, versions: g, pending: _, playing: b, replays: x, inspecting: S, frameRef: C, frameLoaded: w, live: T, writing: E, agent: D, agentSessions: O, artifact: k, updated: A, onExpand: j }) {
968
+ function Ve({ boardBase: e, boardSandbox: t, view: n, worldRef: r, phases: i, images: o, culled: s, distant: c, gesturing: l, boards: u, notes: d, routes: p, titleRooms: m, contentBase: h, versions: g, pending: _, playing: v, replays: y, inspecting: b, frameRef: C, frameLoaded: w, live: T, writing: E, agent: D, agentSessions: O, artifact: k, updated: A, onExpand: j }) {
856
969
  let M = E;
857
970
  if (T) {
858
971
  M = void 0;
859
972
  let e = 0;
860
- for (let [t, n] of f) {
861
- let i = g[n.file] ?? 0;
862
- r(n) || _.has(t) || i <= e || (M = t, e = i);
973
+ for (let [t, n] of u) {
974
+ let r = g[n.file] ?? 0;
975
+ a(n) || _.has(t) || r <= e || (M = t, e = r);
863
976
  }
864
977
  }
865
978
  let N = (O ?? []).filter((e) => e.state === "thinking" || e.state === "running");
866
979
  if (T && k && N.some((e) => e.turnArtifacts.includes(k))) {
867
- let e = f.find(([e, t]) => _.has(e) && !r(t));
980
+ let e = u.find(([e, t]) => _.has(e) && !a(t));
868
981
  e && (M = e[0]);
869
982
  }
870
- let P = f.find(([e]) => e === M)?.[1], F = te(T && P ? g[P.file] : void 0), I = O?.length ? N.length === 0 : F;
871
- return /* @__PURE__ */ y("div", {
872
- ref: a,
983
+ let P = u.find(([e]) => e === M)?.[1], F = te(T && P ? g[P.file] : void 0), I = O?.length ? N.length === 0 : F;
984
+ return /* @__PURE__ */ S("div", {
985
+ ref: r,
873
986
  className: "x10l6tqk xu96u03 x13vifvy x1hj3fc7",
874
- style: a ? void 0 : {
875
- transform: `translate(${i.x}px, ${i.y}px) scale(${i.k})`,
876
- "--zoom": i.k
987
+ style: r ? void 0 : {
988
+ transform: `translate(${n.x}px, ${n.y}px) scale(${n.k})`,
989
+ "--zoom": n.k
877
990
  },
878
991
  children: [
879
- /* @__PURE__ */ v(Te, {
992
+ p && p.length > 0 && /* @__PURE__ */ x(de, { routes: p }),
993
+ /* @__PURE__ */ x(ze, {
880
994
  active: M,
881
995
  agent: D ?? "Agent",
882
996
  boardBase: e,
883
- boardSandbox: n,
884
- boards: f,
997
+ boardSandbox: t,
998
+ boards: u,
885
999
  contentBase: h,
886
- culled: c,
887
- distant: l,
1000
+ culled: s,
1001
+ distant: c,
888
1002
  frameLoaded: w,
889
1003
  frameRef: C,
890
- gesturing: d,
891
- images: s,
892
- inspecting: S,
1004
+ gesturing: l,
1005
+ images: o,
1006
+ inspecting: b,
893
1007
  pending: _,
894
- phases: o,
895
- playing: b,
896
- replays: x,
1008
+ phases: i,
1009
+ playing: v,
1010
+ replays: y,
897
1011
  updated: A,
898
1012
  versions: g,
899
1013
  writing: E,
900
1014
  onExpand: j
901
1015
  }),
902
- /* @__PURE__ */ v(Ee, {
1016
+ /* @__PURE__ */ x(Be, {
903
1017
  agent: D ?? "Agent",
904
- boards: f,
1018
+ boards: u,
905
1019
  contentBase: h,
906
- culled: c,
1020
+ culled: s,
907
1021
  pending: _,
908
1022
  updated: A,
909
1023
  versions: g,
910
1024
  writing: E,
911
- zoom: i.k,
1025
+ zoom: n.k,
912
1026
  onExpand: j
913
1027
  }),
914
- p.map(([e, n]) => n.kind === "title" ? /* @__PURE__ */ v("h2", {
915
- "data-note": e,
916
- className: "x10l6tqk x1ghz6dp x1xlr1w8 x1uo3zyz xjat59b xo2rkog x1bd091l",
917
- style: {
918
- left: n.x,
919
- top: n.y,
920
- width: n.w,
921
- whiteSpace: n.w === void 0 ? "nowrap" : "normal",
922
- fontSize: n.size ?? 96,
923
- transform: `scale(${t(n.size ?? 96, i.k, m?.[e] ?? Infinity)})`
924
- },
925
- children: n.text
926
- }, e) : /* @__PURE__ */ v("div", {
927
- "data-note": e,
928
- className: "x10l6tqk x12oqio5 x126k92a xj0a0fe x1pmbvsm",
929
- style: {
930
- left: n.x,
931
- top: n.y,
932
- width: n.w ?? 240,
933
- padding: 16,
934
- fontSize: 18,
935
- lineHeight: "27px",
936
- ...xe(n.color)
937
- },
938
- children: n.text
939
- }, e)),
940
- P && /* @__PURE__ */ v(ye, {
1028
+ /* @__PURE__ */ x(me, {
1029
+ notes: d,
1030
+ titleRooms: m,
1031
+ zoom: n.k
1032
+ }),
1033
+ P && /* @__PURE__ */ x(Ne, {
941
1034
  agent: D ?? "Agent",
942
1035
  title: P.title ?? M,
943
- ...ee(P, I, u(D ?? "Agent").mascot ? 72 / i.k : void 0),
944
- zoom: i.k
1036
+ ...ee(P, I, f(D ?? "Agent").mascot ? 72 / n.k : void 0),
1037
+ zoom: n.k
945
1038
  })
946
1039
  ]
947
1040
  });
948
1041
  }
949
- export { U as a, I as c, C as d, O as f, G as i, P as l, be as n, H as o, ue as r, F as s, De as t, k as u };
1042
+ export { q as a, R as c, E as d, j as f, xe as i, ne as l, Pe as n, K as o, Ce as r, L as s, Ve as t, M as u };