@flesler/cursor-canvas-web 1.1.2 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,11 +1,11 @@
1
- import { jsx as a, jsxs as y } from "react/jsx-runtime";
2
- import { useComputedColorScheme as ge, Button as xe, Alert as ve, Card as be, Checkbox as Se, Divider as ke, Title as W, ActionIcon as Ce, Badge as we, Group as Le, Select as Te, Stack as Pe, Text as H, Table as w, Textarea as Ae, TextInput as Me, Switch as Be } from "@mantine/core";
3
- import { useState as $, createContext as $e, useCallback as _, useContext as oe } from "react";
4
- import { useEffect as Zt, useMemo as Jt, useRef as Ut, useState as Qt } from "react";
5
- import { r as Fe, u as te } from "./host-tokens-Dh2BFFjv.js";
6
- import { c as tr, a as rr, b as nr, d as or, e as ar, f as ir, g as sr, h as lr, i as cr } from "./host-tokens-Dh2BFFjv.js";
7
- import { BarChart as De, AreaChart as Ee, LineChart as Ie, DonutChart as ze, PieChart as Ne, ChartLegend as Re } from "@mantine/charts";
8
- const k = {
1
+ import { jsx as i, jsxs as y } from "react/jsx-runtime";
2
+ import { useComputedColorScheme as ge, Button as xe, Alert as ve, Card as be, Checkbox as Se, Divider as ke, Title as W, ActionIcon as we, Badge as Ce, Group as Le, Select as Te, Stack as Pe, Text as H, Table as L, Textarea as Ae, TextInput as Me, Switch as Be } from "@mantine/core";
3
+ import { useState as D, createContext as $e, useCallback as G, useContext as oe } from "react";
4
+ import { useEffect as Ut, useMemo as Qt, useRef as en, useState as tn } from "react";
5
+ import { r as De, u as te } from "./host-tokens-Dh2BFFjv.js";
6
+ import { c as rn, a as on, b as an, d as sn, e as ln, f as cn, g as dn, h as un, i as fn } from "./host-tokens-Dh2BFFjv.js";
7
+ import { BarChart as Fe, AreaChart as Ee, LineChart as Ne, DonutChart as Ie, PieChart as ze, ChartLegend as Re } from "@mantine/charts";
8
+ const w = {
9
9
  success: "#1F8A65",
10
10
  danger: "#CF2D56",
11
11
  warning: "#E8A33D",
@@ -26,7 +26,7 @@ const k = {
26
26
  };
27
27
  function m() {
28
28
  const t = ge("light") === "dark" ? "dark" : "light";
29
- return Fe(t);
29
+ return De(t);
30
30
  }
31
31
  const ie = {
32
32
  verticalAlign: "bottom",
@@ -34,60 +34,74 @@ const ie = {
34
34
  }, se = {
35
35
  legend: { justifyContent: "center" }
36
36
  };
37
- function G() {
37
+ function O() {
38
38
  const t = m().chart.sequence;
39
- return (r, n) => r ? k[r] : t[n % t.length];
39
+ return (n, r) => n ? w[n] : t[r % t.length];
40
40
  }
41
41
  function le() {
42
42
  const t = m().text.primary;
43
43
  return { textColor: t, barLabelColor: t };
44
44
  }
45
45
  function ce(e, t) {
46
- return e.map((r, n) => {
47
- const i = { category: r };
46
+ return e.map((n, r) => {
47
+ const a = { category: n };
48
48
  for (const o of t)
49
- i[o.name] = o.data[n] ?? 0;
50
- return i;
49
+ a[o.name] = o.data[r] ?? 0;
50
+ return a;
51
51
  });
52
52
  }
53
53
  function de(e, t) {
54
- return e.map((r, n) => ({
55
- name: r.name,
56
- color: t(r.tone, n)
54
+ return e.map((n, r) => ({
55
+ name: n.name,
56
+ color: t(n.tone, r)
57
57
  }));
58
58
  }
59
59
  function ue(e, t) {
60
- return (r) => `${t ?? ""}${r}${e ?? ""}`;
60
+ return (n) => `${t ?? ""}${n}${e ?? ""}`;
61
61
  }
62
- function He(e, t) {
62
+ function _e(e, t) {
63
63
  if (e != null && e.length)
64
- return e.map((r) => ({
65
- ...t ? { x: r.value } : { y: r.value },
66
- label: r.label,
67
- color: r.tone ? k[r.tone] : k.neutral
64
+ return e.map((n) => ({
65
+ ...t ? { x: n.value } : { y: n.value },
66
+ label: n.label,
67
+ color: n.tone ? w[n.tone] : w.neutral
68
68
  }));
69
69
  }
70
+ const He = /* @__PURE__ */ new Set(["log", "symlog", "pow", "sqrt"]);
71
+ function We(e) {
72
+ const { scale: t } = e;
73
+ return typeof t != "string" || !He.has(t) ? e : {
74
+ ...e,
75
+ type: e.type ?? "number",
76
+ allowDataOverflow: e.allowDataOverflow ?? !0,
77
+ allowDecimals: e.allowDecimals ?? !0,
78
+ domain: e.domain ?? [1, "dataMax"]
79
+ };
80
+ }
70
81
  function fe(e) {
71
- const t = He(e.referenceLines, !!e.horizontal);
72
- if (e.stacked || e.normalized)
82
+ const t = _e(e.referenceLines, !!e.horizontal);
83
+ let n;
84
+ if (!e.stacked && !e.normalized) {
85
+ const o = e.beginAtZero !== !1;
86
+ n = [e.yMin ?? (o ? 0 : "auto"), e.yMax ?? "auto"];
87
+ }
88
+ const r = e.valueAxis ? We(e.valueAxis) : void 0;
89
+ if (!n && !r)
73
90
  return { referenceLines: t };
74
- const r = e.beginAtZero !== !1, n = [
75
- e.yMin ?? (r ? 0 : "auto"),
76
- e.yMax ?? "auto"
77
- ];
78
- return e.horizontal ? { xAxisProps: { domain: n }, referenceLines: t } : { yAxisProps: { domain: n }, referenceLines: t };
91
+ const a = { ...n && { domain: n }, ...r };
92
+ return e.horizontal ? { xAxisProps: a, referenceLines: t } : { yAxisProps: a, referenceLines: t };
79
93
  }
80
- function We(e, t, r) {
81
- return e !== void 0 ? e : t.length === 1 && r.length <= 8;
94
+ function Ge(e, t, n) {
95
+ return e !== void 0 ? e : t.length === 1 && n.length <= 8;
82
96
  }
83
- const re = 14;
84
- function _e(e) {
85
- return e.length <= re ? e : `${e.slice(0, re - 1)}…`;
97
+ const ne = 14;
98
+ function Oe(e) {
99
+ return e.length <= ne ? e : `${e.slice(0, ne - 1)}…`;
86
100
  }
87
- function Ge(e) {
101
+ function je(e) {
88
102
  var o;
89
- const t = typeof e.x == "number" ? e.x : Number(e.x) || 0, r = typeof e.y == "number" ? e.y : Number(e.y) || 0, n = String(((o = e.payload) == null ? void 0 : o.value) ?? ""), i = _e(n);
90
- return /* @__PURE__ */ a("g", { transform: `translate(${t},${r})`, children: /* @__PURE__ */ y(
103
+ const t = typeof e.x == "number" ? e.x : Number(e.x) || 0, n = typeof e.y == "number" ? e.y : Number(e.y) || 0, r = String(((o = e.payload) == null ? void 0 : o.value) ?? ""), a = Oe(r);
104
+ return /* @__PURE__ */ i("g", { transform: `translate(${t},${n})`, children: /* @__PURE__ */ y(
91
105
  "text",
92
106
  {
93
107
  x: -10,
@@ -97,22 +111,22 @@ function Ge(e) {
97
111
  fill: "currentColor",
98
112
  fontSize: 12,
99
113
  children: [
100
- /* @__PURE__ */ a("title", { children: n }),
101
- i
114
+ /* @__PURE__ */ i("title", { children: r }),
115
+ a
102
116
  ]
103
117
  }
104
118
  ) });
105
119
  }
106
- function je(e) {
120
+ function Ke(e) {
107
121
  return {
108
122
  fontWeight: 700,
109
123
  fill: e
110
124
  };
111
125
  }
112
- function Oe() {
126
+ function Xe() {
113
127
  return {
114
128
  yAxisProps: {
115
- tick: Ge,
129
+ tick: je,
116
130
  width: 96
117
131
  },
118
132
  barChartProps: {
@@ -120,19 +134,19 @@ function Oe() {
120
134
  }
121
135
  };
122
136
  }
123
- function Ke() {
137
+ function qe() {
124
138
  return {
125
139
  barChartProps: {
126
140
  margin: { top: 22 }
127
141
  }
128
142
  };
129
143
  }
130
- function dt({
144
+ function ft({
131
145
  categories: e,
132
146
  series: t,
133
- height: r = 240,
134
- fill: n,
135
- valueSuffix: i,
147
+ height: n = 240,
148
+ fill: r,
149
+ valueSuffix: a,
136
150
  valuePrefix: o,
137
151
  showValues: c,
138
152
  showHoverGuide: f = !0,
@@ -141,41 +155,44 @@ function dt({
141
155
  yMax: u,
142
156
  referenceLines: g,
143
157
  style: v,
144
- smooth: h
158
+ extra: h,
159
+ smooth: k
145
160
  }) {
146
- const C = G(), S = le(), T = ce(e, t), P = de(t, C), A = fe({
161
+ const T = (h == null ? void 0 : h.smooth) ?? k, C = O(), P = le(), M = ce(e, t), $ = de(t, C), b = !!(r && (h != null && h.stacked)), F = fe({
147
162
  beginAtZero: d,
148
163
  yMin: l,
149
164
  yMax: u,
150
165
  referenceLines: g,
151
- horizontal: !1
152
- }), L = {
153
- h: r,
154
- data: T,
166
+ horizontal: !1,
167
+ stacked: b,
168
+ valueAxis: h == null ? void 0 : h.valueAxis
169
+ }), A = {
170
+ h: n,
171
+ data: M,
155
172
  dataKey: "category",
156
- series: P,
157
- curveType: h ? "monotone" : "linear",
173
+ series: $,
174
+ curveType: T ? "monotone" : "linear",
158
175
  withLegend: t.length > 1,
159
176
  legendProps: ie,
160
- valueFormatter: ue(i, o),
177
+ valueFormatter: ue(a, o),
161
178
  withPointLabels: c ?? e.length <= 20,
162
179
  tooltipProps: f ? void 0 : { cursor: !1 },
163
180
  styles: {
164
181
  ...se,
165
- legendItemName: { color: S.textColor }
182
+ legendItemName: { color: P.textColor }
166
183
  },
167
- ...S,
168
- ...A,
184
+ ...P,
185
+ ...F,
169
186
  style: v
170
187
  };
171
- return n ? /* @__PURE__ */ a(Ee, { ...L }) : /* @__PURE__ */ a(Ie, { ...L });
188
+ return r ? /* @__PURE__ */ i(Ee, { ...A, type: b ? "stacked" : "default" }) : /* @__PURE__ */ i(Ne, { ...A });
172
189
  }
173
- function ut({
190
+ function ht({
174
191
  categories: e,
175
192
  series: t,
176
- height: r = 240,
177
- stacked: n,
178
- horizontal: i,
193
+ height: n = 240,
194
+ stacked: r,
195
+ horizontal: a,
179
196
  normalized: o,
180
197
  valueSuffix: c,
181
198
  valuePrefix: f,
@@ -184,53 +201,55 @@ function ut({
184
201
  yMin: u,
185
202
  yMax: g,
186
203
  referenceLines: v,
187
- style: h
204
+ style: h,
205
+ extra: k
188
206
  }) {
189
- const C = G(), S = le(), T = ce(e, t), P = o ? "percent" : n ? "stacked" : "default", A = fe({
207
+ const T = O(), C = le(), P = ce(e, t), M = o ? "percent" : r ? "stacked" : "default", $ = fe({
190
208
  beginAtZero: l,
191
209
  yMin: u,
192
210
  yMax: g,
193
211
  referenceLines: v,
194
- horizontal: i,
195
- stacked: n,
196
- normalized: o
197
- }), L = !n && !o && We(d, t, e);
198
- return /* @__PURE__ */ a(
199
- De,
212
+ horizontal: a,
213
+ stacked: r,
214
+ normalized: o,
215
+ valueAxis: k == null ? void 0 : k.valueAxis
216
+ }), b = !r && !o && Ge(d, t, e);
217
+ return /* @__PURE__ */ i(
218
+ Fe,
200
219
  {
201
- h: r,
202
- data: T,
220
+ h: n,
221
+ data: P,
203
222
  dataKey: "category",
204
- series: de(t, C),
205
- type: P,
206
- orientation: i ? "vertical" : "horizontal",
223
+ series: de(t, T),
224
+ type: M,
225
+ orientation: a ? "vertical" : "horizontal",
207
226
  withLegend: t.length > 1,
208
227
  legendProps: ie,
209
228
  valueFormatter: ue(c, f),
210
- withBarValueLabel: L,
211
- ...L ? { valueLabelProps: je(S.barLabelColor) } : {},
212
- ...i ? Oe() : L ? Ke() : {},
229
+ withBarValueLabel: b,
230
+ ...b ? { valueLabelProps: Ke(C.barLabelColor) } : {},
231
+ ...a ? Xe() : b ? qe() : {},
213
232
  styles: {
214
233
  ...se,
215
- legendItemName: { color: S.textColor }
234
+ legendItemName: { color: C.textColor }
216
235
  },
217
- ...S,
218
- ...A,
236
+ ...C,
237
+ ...$,
219
238
  style: h
220
239
  }
221
240
  );
222
241
  }
223
- const Xe = 180, Ye = 540;
224
- function qe(e, t) {
242
+ const Ve = 180, Ye = 540;
243
+ function Ze(e, t) {
225
244
  if (t <= 0)
226
245
  return "0%";
227
- const r = e / t * 100;
228
- return r < 10 && Math.abs(r - Math.round(r)) > 0.05 ? `${r.toFixed(1)}%` : `${Math.round(r)}%`;
246
+ const n = e / t * 100;
247
+ return n < 10 && Math.abs(n - Math.round(n)) > 0.05 ? `${n.toFixed(1)}%` : `${Math.round(n)}%`;
229
248
  }
230
- function Ve(e) {
249
+ function Je(e) {
231
250
  return Math.max(28, Math.round(e * 0.22));
232
251
  }
233
- function Ze(e) {
252
+ function Ue(e) {
234
253
  return e.map((t) => ({
235
254
  dataKey: t.name,
236
255
  value: t.name,
@@ -238,18 +257,18 @@ function Ze(e) {
238
257
  type: "circle"
239
258
  }));
240
259
  }
241
- function Je(e, t) {
242
- return e.map((r) => ({
243
- name: r.name,
244
- color: r.color,
245
- label: `${r.name} ${qe(r.value, t)}`
260
+ function Qe(e, t) {
261
+ return e.map((n) => ({
262
+ name: n.name,
263
+ color: n.color,
264
+ label: `${n.name} ${Ze(n.value, t)}`
246
265
  }));
247
266
  }
248
- function Ue({
267
+ function et({
249
268
  total: e,
250
269
  family: t,
251
- primary: r,
252
- subtitle: n
270
+ primary: n,
271
+ subtitle: r
253
272
  }) {
254
273
  return /* @__PURE__ */ y(
255
274
  "text",
@@ -260,33 +279,33 @@ function Ue({
260
279
  dominantBaseline: "central",
261
280
  fontFamily: t,
262
281
  children: [
263
- /* @__PURE__ */ a("tspan", { x: "50%", dy: "-0.4em", fontSize: 20, fontWeight: 600, fill: r, children: e }),
264
- /* @__PURE__ */ a("tspan", { x: "50%", dy: "1.55em", fontSize: 16, fontWeight: 500, fill: n, children: "Total" })
282
+ /* @__PURE__ */ i("tspan", { x: "50%", dy: "-0.4em", fontSize: 20, fontWeight: 600, fill: n, children: e }),
283
+ /* @__PURE__ */ i("tspan", { x: "50%", dy: "1.55em", fontSize: 16, fontWeight: 500, fill: r, children: "Total" })
265
284
  ]
266
285
  }
267
286
  );
268
287
  }
269
- function ft({ data: e, size: t = 200, donut: r, style: n }) {
270
- const [i, o] = $(null), c = m(), f = G(), d = e.map((h, C) => ({
288
+ function pt({ data: e, size: t = 200, donut: n, style: r }) {
289
+ const [a, o] = D(null), c = m(), f = O(), d = e.map((h, k) => ({
271
290
  name: h.label,
272
291
  value: h.value,
273
- color: f(h.tone, C)
274
- })), l = d.reduce((h, C) => h + C.value, 0), u = {
275
- startAngle: Xe,
292
+ color: f(h.tone, k)
293
+ })), l = d.reduce((h, k) => h + k.value, 0), u = {
294
+ startAngle: Ve,
276
295
  endAngle: Ye
277
296
  }, g = (h) => ({
278
- opacity: i === null || i === h ? 1 : 0.35
279
- }), v = r ? /* @__PURE__ */ a(
280
- ze,
297
+ opacity: a === null || a === h ? 1 : 0.35
298
+ }), v = n ? /* @__PURE__ */ i(
299
+ Ie,
281
300
  {
282
301
  data: d,
283
302
  size: t,
284
- thickness: Ve(t),
303
+ thickness: Je(t),
285
304
  withTooltip: !0,
286
305
  cellProps: (h) => g(h.name),
287
306
  ...u,
288
- children: /* @__PURE__ */ a(
289
- Ue,
307
+ children: /* @__PURE__ */ i(
308
+ et,
290
309
  {
291
310
  total: l,
292
311
  family: c.typography.fontFamily,
@@ -295,8 +314,8 @@ function ft({ data: e, size: t = 200, donut: r, style: n }) {
295
314
  }
296
315
  )
297
316
  }
298
- ) : /* @__PURE__ */ a(
299
- Ne,
317
+ ) : /* @__PURE__ */ i(
318
+ ze,
300
319
  {
301
320
  data: d,
302
321
  size: t,
@@ -314,10 +333,10 @@ function ft({ data: e, size: t = 200, donut: r, style: n }) {
314
333
  display: "flex",
315
334
  flexDirection: "column",
316
335
  alignItems: "center",
317
- ...n
336
+ ...r
318
337
  },
319
338
  children: [
320
- /* @__PURE__ */ a(
339
+ /* @__PURE__ */ i(
321
340
  "div",
322
341
  {
323
342
  style: {
@@ -331,11 +350,11 @@ function ft({ data: e, size: t = 200, donut: r, style: n }) {
331
350
  children: v
332
351
  }
333
352
  ),
334
- /* @__PURE__ */ a(
353
+ /* @__PURE__ */ i(
335
354
  Re,
336
355
  {
337
- payload: Ze(d),
338
- series: Je(d, l),
356
+ payload: Ue(d),
357
+ series: Qe(d, l),
339
358
  legendPosition: "bottom",
340
359
  centered: !0,
341
360
  onHighlight: o,
@@ -357,71 +376,71 @@ function ft({ data: e, size: t = 200, donut: r, style: n }) {
357
376
  }
358
377
  );
359
378
  }
360
- function ht(e) {
379
+ function yt(e) {
361
380
  const {
362
381
  nodes: t,
363
- edges: r,
364
- direction: n = "vertical",
365
- nodeWidth: i = 160,
382
+ edges: n,
383
+ direction: r = "vertical",
384
+ nodeWidth: a = 160,
366
385
  nodeHeight: o = 40,
367
386
  rankGap: c = 64,
368
387
  nodeGap: f = 48,
369
388
  padding: d = 24
370
389
  } = e, l = t.map((s) => s.id), u = new Set(l), g = /* @__PURE__ */ new Map();
371
390
  for (const s of l) g.set(s, []);
372
- for (const s of r)
391
+ for (const s of n)
373
392
  u.has(s.from) && u.has(s.to) && g.get(s.from).push(s.to);
374
- const v = 0, h = 1, C = 2, S = new Map(l.map((s) => [s, v])), T = /* @__PURE__ */ new Set(), P = (s, p) => `${s}\0${p}`, A = (s) => {
375
- S.set(s, h);
393
+ const v = 0, h = 1, k = 2, T = new Map(l.map((s) => [s, v])), C = /* @__PURE__ */ new Set(), P = (s, p) => `${s}\0${p}`, M = (s) => {
394
+ T.set(s, h);
376
395
  for (const p of g.get(s) ?? []) {
377
- const x = S.get(p);
378
- x === h ? T.add(P(s, p)) : x === v && A(p);
396
+ const x = T.get(p);
397
+ x === h ? C.add(P(s, p)) : x === v && M(p);
379
398
  }
380
- S.set(s, C);
399
+ T.set(s, k);
381
400
  };
382
- for (const s of l) S.get(s) === v && A(s);
383
- const L = r.filter(
384
- (s) => u.has(s.from) && u.has(s.to) && !T.has(P(s.from, s.to))
385
- ), M = new Map(l.map((s) => [s, 0])), K = new Map(l.map((s) => [s, []]));
386
- for (const s of L)
387
- K.get(s.from).push(s.to), M.set(s.to, (M.get(s.to) ?? 0) + 1);
388
- const F = new Map(l.map((s) => [s, 0])), z = l.filter((s) => (M.get(s) ?? 0) === 0);
401
+ for (const s of l) T.get(s) === v && M(s);
402
+ const $ = n.filter(
403
+ (s) => u.has(s.from) && u.has(s.to) && !C.has(P(s.from, s.to))
404
+ ), b = new Map(l.map((s) => [s, 0])), F = new Map(l.map((s) => [s, []]));
405
+ for (const s of $)
406
+ F.get(s.from).push(s.to), b.set(s.to, (b.get(s.to) ?? 0) + 1);
407
+ const A = new Map(l.map((s) => [s, 0])), z = l.filter((s) => (b.get(s) ?? 0) === 0);
389
408
  for (; z.length > 0; ) {
390
- const s = z.shift(), p = F.get(s);
391
- for (const x of K.get(s))
392
- F.set(x, Math.max(F.get(x), p + 1)), M.set(x, M.get(x) - 1), M.get(x) === 0 && z.push(x);
409
+ const s = z.shift(), p = A.get(s);
410
+ for (const x of F.get(s))
411
+ A.set(x, Math.max(A.get(x), p + 1)), b.set(x, b.get(x) - 1), b.get(x) === 0 && z.push(x);
393
412
  }
394
413
  const B = /* @__PURE__ */ new Map();
395
414
  for (const s of l) {
396
- const p = F.get(s);
415
+ const p = A.get(s);
397
416
  B.has(p) || B.set(p, []), B.get(p).push(s);
398
417
  }
399
- const D = [...B.keys()].sort((s, p) => s - p), b = n === "vertical", X = (s) => s * (b ? i : o) + Math.max(0, s - 1) * f, Y = Math.max(
418
+ const E = [...B.keys()].sort((s, p) => s - p), S = r === "vertical", X = (s) => s * (S ? a : o) + Math.max(0, s - 1) * f, q = Math.max(
400
419
  0,
401
- ...D.map((s) => X(B.get(s).length))
402
- ), E = /* @__PURE__ */ new Map(), q = [];
403
- D.forEach((s, p) => {
404
- const x = B.get(s), N = X(x.length), R = d + (Y - N) / 2, I = d + p * ((b ? o : i) + c);
420
+ ...E.map((s) => X(B.get(s).length))
421
+ ), N = /* @__PURE__ */ new Map(), V = [];
422
+ E.forEach((s, p) => {
423
+ const x = B.get(s), R = X(x.length), _ = d + (q - R) / 2, I = d + p * ((S ? o : a) + c);
405
424
  x.forEach((U, Q) => {
406
- const ee = R + Q * ((b ? i : o) + f), ye = b ? ee : I, me = b ? I : ee;
407
- E.set(U, { id: U, x: ye, y: me, rank: s, order: Q });
408
- }), q.push({
425
+ const ee = _ + Q * ((S ? a : o) + f), ye = S ? ee : I, me = S ? I : ee;
426
+ N.set(U, { id: U, x: ye, y: me, rank: s, order: Q });
427
+ }), V.push({
409
428
  rank: s,
410
- x: b ? R : I,
411
- y: b ? I : R,
412
- width: b ? N : i,
413
- height: b ? o : N,
429
+ x: S ? _ : I,
430
+ y: S ? I : _,
431
+ width: S ? R : a,
432
+ height: S ? o : R,
414
433
  nodeIds: x
415
434
  });
416
435
  });
417
- const V = (s, p) => s ? b ? {
418
- x: s.x + i / 2,
436
+ const Y = (s, p) => s ? S ? {
437
+ x: s.x + a / 2,
419
438
  y: p === "source" ? s.y + o : s.y
420
439
  } : {
421
- x: p === "source" ? s.x + i : s.x,
440
+ x: p === "source" ? s.x + a : s.x,
422
441
  y: s.y + o / 2
423
- } : { x: 0, y: 0 }, pe = r.filter((s) => u.has(s.from) && u.has(s.to)).map((s) => {
424
- const p = V(E.get(s.from), "source"), x = V(E.get(s.to), "target");
442
+ } : { x: 0, y: 0 }, pe = n.filter((s) => u.has(s.from) && u.has(s.to)).map((s) => {
443
+ const p = Y(N.get(s.from), "source"), x = Y(N.get(s.to), "target");
425
444
  return {
426
445
  from: s.from,
427
446
  to: s.to,
@@ -429,22 +448,22 @@ function ht(e) {
429
448
  sourceY: p.y,
430
449
  targetX: x.x,
431
450
  targetY: x.y,
432
- isBackEdge: T.has(P(s.from, s.to))
451
+ isBackEdge: C.has(P(s.from, s.to))
433
452
  };
434
- }), Z = d * 2 + D.length * (b ? o : i) + Math.max(0, D.length - 1) * c, J = d * 2 + Y;
453
+ }), Z = d * 2 + E.length * (S ? o : a) + Math.max(0, E.length - 1) * c, J = d * 2 + q;
435
454
  return {
436
- nodes: [...E.values()],
455
+ nodes: [...N.values()],
437
456
  edges: pe,
438
- ranks: q,
439
- direction: n,
440
- width: b ? J : Z,
441
- height: b ? Z : J
457
+ ranks: V,
458
+ direction: r,
459
+ width: S ? J : Z,
460
+ height: S ? Z : J
442
461
  };
443
462
  }
444
- function pt({
463
+ function mt({
445
464
  additions: e = 0,
446
465
  deletions: t = 0,
447
- style: r
466
+ style: n
448
467
  }) {
449
468
  return e === 0 && t === 0 ? null : /* @__PURE__ */ y(
450
469
  "span",
@@ -455,14 +474,14 @@ function pt({
455
474
  fontVariantNumeric: "tabular-nums",
456
475
  fontSize: 12,
457
476
  fontWeight: 600,
458
- ...r
477
+ ...n
459
478
  },
460
479
  children: [
461
- e > 0 && /* @__PURE__ */ y("span", { style: { color: k.added }, children: [
480
+ e > 0 && /* @__PURE__ */ y("span", { style: { color: w.added }, children: [
462
481
  "+",
463
482
  e
464
483
  ] }),
465
- t > 0 && /* @__PURE__ */ y("span", { style: { color: k.deleted }, children: [
484
+ t > 0 && /* @__PURE__ */ y("span", { style: { color: w.deleted }, children: [
466
485
  "-",
467
486
  t
468
487
  ] })
@@ -470,20 +489,20 @@ function pt({
470
489
  }
471
490
  );
472
491
  }
473
- const Qe = {
492
+ const tt = {
474
493
  added: "+",
475
494
  removed: "-",
476
495
  unchanged: " "
477
496
  };
478
- function yt({
497
+ function gt({
479
498
  lines: e,
480
499
  showLineNumbers: t = !0,
481
- coloredLineNumbers: r = !0,
482
- showAccentStrip: n = !0,
483
- style: i
500
+ coloredLineNumbers: n = !0,
501
+ showAccentStrip: r = !0,
502
+ style: a
484
503
  }) {
485
- const o = m(), c = (l) => l === "added" ? o.diff.insertedLine : l === "removed" ? o.diff.removedLine : "transparent", f = (l) => l === "added" ? o.diff.stripAdded : l === "removed" ? o.diff.stripRemoved : "transparent", d = (l) => r && l === "added" ? k.added : r && l === "removed" ? k.deleted : o.text.tertiary;
486
- return /* @__PURE__ */ a(
504
+ const o = m(), c = (l) => l === "added" ? o.diff.insertedLine : l === "removed" ? o.diff.removedLine : "transparent", f = (l) => l === "added" ? o.diff.stripAdded : l === "removed" ? o.diff.stripRemoved : "transparent", d = (l) => n && l === "added" ? w.added : n && l === "removed" ? w.deleted : o.text.tertiary;
505
+ return /* @__PURE__ */ i(
487
506
  "div",
488
507
  {
489
508
  style: {
@@ -492,7 +511,7 @@ function yt({
492
511
  lineHeight: "18px",
493
512
  color: o.text.primary,
494
513
  overflowX: "auto",
495
- ...i
514
+ ...a
496
515
  },
497
516
  children: e.map((l, u) => /* @__PURE__ */ y(
498
517
  "div",
@@ -501,10 +520,10 @@ function yt({
501
520
  display: "flex",
502
521
  alignItems: "stretch",
503
522
  background: c(l.type),
504
- borderLeft: n ? `3px solid ${f(l.type)}` : void 0
523
+ borderLeft: r ? `3px solid ${f(l.type)}` : void 0
505
524
  },
506
525
  children: [
507
- t && /* @__PURE__ */ a(
526
+ t && /* @__PURE__ */ i(
508
527
  "span",
509
528
  {
510
529
  style: {
@@ -518,7 +537,7 @@ function yt({
518
537
  children: l.lineNumber ?? ""
519
538
  }
520
539
  ),
521
- /* @__PURE__ */ a(
540
+ /* @__PURE__ */ i(
522
541
  "span",
523
542
  {
524
543
  style: {
@@ -528,10 +547,10 @@ function yt({
528
547
  userSelect: "none",
529
548
  color: d(l.type)
530
549
  },
531
- children: Qe[l.type]
550
+ children: tt[l.type]
532
551
  }
533
552
  ),
534
- /* @__PURE__ */ a(
553
+ /* @__PURE__ */ i(
535
554
  "pre",
536
555
  {
537
556
  style: {
@@ -550,8 +569,8 @@ function yt({
550
569
  }
551
570
  );
552
571
  }
553
- function et({ status: e }) {
554
- const t = m(), r = e === "completed" ? k.success : e === "in_progress" ? t.accent.primary : e === "cancelled" ? k.danger : t.text.tertiary;
572
+ function nt({ status: e }) {
573
+ const t = m(), n = e === "completed" ? w.success : e === "in_progress" ? t.accent.primary : e === "cancelled" ? w.danger : t.text.tertiary;
555
574
  return /* @__PURE__ */ y(
556
575
  "svg",
557
576
  {
@@ -562,23 +581,23 @@ function et({ status: e }) {
562
581
  style: { flex: "0 0 auto", marginTop: 3 },
563
582
  "aria-hidden": !0,
564
583
  children: [
565
- /* @__PURE__ */ a("circle", { cx: 7, cy: 7, r: 6, stroke: r, strokeWidth: 1.4 }),
566
- e === "completed" && /* @__PURE__ */ a(
584
+ /* @__PURE__ */ i("circle", { cx: 7, cy: 7, r: 6, stroke: n, strokeWidth: 1.4 }),
585
+ e === "completed" && /* @__PURE__ */ i(
567
586
  "path",
568
587
  {
569
588
  d: "M4 7.2l2 2 4-4.4",
570
- stroke: r,
589
+ stroke: n,
571
590
  strokeWidth: 1.4,
572
591
  strokeLinecap: "round",
573
592
  strokeLinejoin: "round"
574
593
  }
575
594
  ),
576
- e === "in_progress" && /* @__PURE__ */ a("circle", { cx: 7, cy: 7, r: 3, fill: r }),
577
- e === "cancelled" && /* @__PURE__ */ a(
595
+ e === "in_progress" && /* @__PURE__ */ i("circle", { cx: 7, cy: 7, r: 3, fill: n }),
596
+ e === "cancelled" && /* @__PURE__ */ i(
578
597
  "path",
579
598
  {
580
599
  d: "M4.8 4.8l4.4 4.4M9.2 4.8l-4.4 4.4",
581
- stroke: r,
600
+ stroke: n,
582
601
  strokeWidth: 1.4,
583
602
  strokeLinecap: "round"
584
603
  }
@@ -587,20 +606,20 @@ function et({ status: e }) {
587
606
  }
588
607
  );
589
608
  }
590
- function tt({
609
+ function rt({
591
610
  todos: e,
592
611
  dimmedTodoIds: t,
593
- onTodoClick: r,
594
- style: n
612
+ onTodoClick: n,
613
+ style: r
595
614
  }) {
596
- const i = m();
597
- return e.length === 0 ? null : /* @__PURE__ */ a("div", { style: { display: "flex", flexDirection: "column", ...n }, children: e.map((o) => {
615
+ const a = m();
616
+ return e.length === 0 ? null : /* @__PURE__ */ i("div", { style: { display: "flex", flexDirection: "column", ...r }, children: e.map((o) => {
598
617
  const c = t == null ? void 0 : t.has(o.id);
599
618
  return /* @__PURE__ */ y(
600
619
  "button",
601
620
  {
602
621
  type: "button",
603
- onClick: () => r == null ? void 0 : r(o),
622
+ onClick: () => n == null ? void 0 : n(o),
604
623
  style: {
605
624
  display: "flex",
606
625
  gap: 8,
@@ -610,20 +629,20 @@ function tt({
610
629
  padding: "4px 6px",
611
630
  background: "transparent",
612
631
  border: "none",
613
- cursor: r ? "pointer" : "default",
614
- color: i.text.primary,
632
+ cursor: n ? "pointer" : "default",
633
+ color: a.text.primary,
615
634
  fontSize: 14,
616
635
  lineHeight: "20px",
617
636
  opacity: c ? 0.45 : 1
618
637
  },
619
638
  children: [
620
- /* @__PURE__ */ a(et, { status: o.status }),
621
- /* @__PURE__ */ a(
639
+ /* @__PURE__ */ i(nt, { status: o.status }),
640
+ /* @__PURE__ */ i(
622
641
  "span",
623
642
  {
624
643
  style: {
625
644
  textDecoration: o.status === "cancelled" ? "line-through" : void 0,
626
- color: o.status === "cancelled" ? i.text.tertiary : void 0
645
+ color: o.status === "cancelled" ? a.text.tertiary : void 0
627
646
  },
628
647
  children: o.content
629
648
  }
@@ -634,14 +653,14 @@ function tt({
634
653
  );
635
654
  }) });
636
655
  }
637
- function mt({
656
+ function xt({
638
657
  todos: e,
639
658
  dimmedTodoIds: t,
640
- defaultExpanded: r = !1,
641
- onTodoClick: n,
642
- style: i
659
+ defaultExpanded: n = !1,
660
+ onTodoClick: r,
661
+ style: a
643
662
  }) {
644
- const o = m(), [c, f] = $(r);
663
+ const o = m(), [c, f] = D(n);
645
664
  if (e.length === 0) return null;
646
665
  const d = e.filter((l) => l.status === "completed").length;
647
666
  return /* @__PURE__ */ y(
@@ -651,7 +670,7 @@ function mt({
651
670
  border: `1px solid ${o.stroke.primary}`,
652
671
  borderRadius: 6,
653
672
  overflow: "hidden",
654
- ...i
673
+ ...a
655
674
  },
656
675
  children: [
657
676
  /* @__PURE__ */ y(
@@ -673,7 +692,7 @@ function mt({
673
692
  fontWeight: 600
674
693
  },
675
694
  children: [
676
- /* @__PURE__ */ a(
695
+ /* @__PURE__ */ i(
677
696
  "svg",
678
697
  {
679
698
  width: 12,
@@ -685,7 +704,7 @@ function mt({
685
704
  transition: "transform 120ms"
686
705
  },
687
706
  "aria-hidden": !0,
688
- children: /* @__PURE__ */ a(
707
+ children: /* @__PURE__ */ i(
689
708
  "path",
690
709
  {
691
710
  d: "M4 2.5L8 6l-4 3.5",
@@ -697,8 +716,8 @@ function mt({
697
716
  )
698
717
  }
699
718
  ),
700
- /* @__PURE__ */ a("span", { children: "Todos" }),
701
- /* @__PURE__ */ a("span", { style: { flex: 1 } }),
719
+ /* @__PURE__ */ i("span", { children: "Todos" }),
720
+ /* @__PURE__ */ i("span", { style: { flex: 1 } }),
702
721
  /* @__PURE__ */ y("span", { children: [
703
722
  d,
704
723
  " of ",
@@ -708,96 +727,96 @@ function mt({
708
727
  ]
709
728
  }
710
729
  ),
711
- c && /* @__PURE__ */ a("div", { style: { padding: 6 }, children: /* @__PURE__ */ a(
712
- tt,
730
+ c && /* @__PURE__ */ i("div", { style: { padding: 6 }, children: /* @__PURE__ */ i(
731
+ rt,
713
732
  {
714
733
  todos: e,
715
734
  dimmedTodoIds: t,
716
- onTodoClick: n
735
+ onTodoClick: r
717
736
  }
718
737
  ) })
719
738
  ]
720
739
  }
721
740
  );
722
741
  }
723
- function gt(e, t) {
724
- const r = `canvas:${e}`, [n, i] = $(() => {
742
+ function vt(e, t) {
743
+ const n = `canvas:${e}`, [r, a] = D(() => {
725
744
  if (typeof localStorage > "u") return t;
726
745
  try {
727
- const c = localStorage.getItem(r);
746
+ const c = localStorage.getItem(n);
728
747
  return c === null ? t : JSON.parse(c);
729
748
  } catch {
730
749
  return t;
731
750
  }
732
- }), o = _(
751
+ }), o = G(
733
752
  (c) => {
734
- i((f) => {
753
+ a((f) => {
735
754
  const d = typeof c == "function" ? c(f) : c;
736
755
  try {
737
- localStorage == null || localStorage.setItem(r, JSON.stringify(d));
756
+ localStorage == null || localStorage.setItem(n, JSON.stringify(d));
738
757
  } catch {
739
758
  }
740
759
  return d;
741
760
  });
742
761
  },
743
- [r]
762
+ [n]
744
763
  );
745
- return [n, o];
764
+ return [r, o];
746
765
  }
747
- function xt() {
748
- return _((e) => {
766
+ function bt() {
767
+ return G((e) => {
749
768
  }, []);
750
769
  }
751
- function vt(e, t) {
770
+ function St(e, t) {
752
771
  return { ...e, ...t };
753
772
  }
754
- function j(e, t, r) {
755
- const n = e.typography[t];
773
+ function j(e, t, n) {
774
+ const r = e.typography[t];
756
775
  return {
757
776
  fontFamily: e.typography.fontFamily,
758
- fontSize: n.fontSize,
759
- lineHeight: n.lineHeight,
760
- fontWeight: n.fontWeight,
777
+ fontSize: r.fontSize,
778
+ lineHeight: r.lineHeight,
779
+ fontWeight: r.fontWeight,
761
780
  color: e.text.primary,
762
781
  margin: 0,
763
- ...r
782
+ ...n
764
783
  };
765
784
  }
766
- function bt({ children: e, style: t }) {
767
- const r = m();
768
- return /* @__PURE__ */ a(W, { order: 1, style: j(r, "h1", t), children: e });
785
+ function kt({ children: e, style: t }) {
786
+ const n = m();
787
+ return /* @__PURE__ */ i(W, { order: 1, style: j(n, "h1", t), children: e });
769
788
  }
770
- function St({ children: e, style: t }) {
771
- const r = m();
772
- return /* @__PURE__ */ a(W, { order: 2, style: j(r, "h2", t), children: e });
789
+ function wt({ children: e, style: t }) {
790
+ const n = m();
791
+ return /* @__PURE__ */ i(W, { order: 2, style: j(n, "h2", t), children: e });
773
792
  }
774
- function kt({ children: e, style: t }) {
775
- const r = m();
776
- return /* @__PURE__ */ a(W, { order: 3, style: j(r, "h3", t), children: e });
793
+ function Ct({ children: e, style: t }) {
794
+ const n = m();
795
+ return /* @__PURE__ */ i(W, { order: 3, style: j(n, "h3", t), children: e });
777
796
  }
778
- const rt = {
797
+ const ot = {
779
798
  normal: 400,
780
799
  medium: 500,
781
800
  semibold: 600,
782
801
  bold: 700
783
802
  };
784
- function Ct({
803
+ function Lt({
785
804
  children: e,
786
805
  tone: t = "primary",
787
- size: r = "body",
788
- as: n = "p",
789
- weight: i = "normal",
806
+ size: n = "body",
807
+ as: r = "p",
808
+ weight: a = "normal",
790
809
  italic: o,
791
810
  truncate: c,
792
811
  style: f
793
812
  }) {
794
813
  const d = m();
795
- return /* @__PURE__ */ a(
814
+ return /* @__PURE__ */ i(
796
815
  H,
797
816
  {
798
- component: n,
799
- size: r === "small" ? "xs" : "sm",
800
- fw: rt[i],
817
+ component: r,
818
+ size: n === "small" ? "xs" : "sm",
819
+ fw: ot[a],
801
820
  c: t === "primary" ? void 0 : d.text[t],
802
821
  truncate: c,
803
822
  style: {
@@ -810,17 +829,17 @@ function Ct({
810
829
  }
811
830
  );
812
831
  }
813
- function wt({ children: e, style: t }) {
814
- const r = m();
815
- return /* @__PURE__ */ a(
832
+ function Tt({ children: e, style: t }) {
833
+ const n = m();
834
+ return /* @__PURE__ */ i(
816
835
  "code",
817
836
  {
818
837
  style: {
819
838
  fontFamily: 'ui-monospace, SFMono-Regular, Menlo, Monaco, "Cascadia Code", monospace',
820
839
  fontSize: "0.92em",
821
- color: r.text.primary,
822
- background: r.fill.secondary,
823
- borderRadius: r.radius.sm,
840
+ color: n.text.primary,
841
+ background: n.fill.secondary,
842
+ borderRadius: n.radius.sm,
824
843
  padding: "1px 4px",
825
844
  ...t
826
845
  },
@@ -828,91 +847,91 @@ function wt({ children: e, style: t }) {
828
847
  }
829
848
  );
830
849
  }
831
- function Lt({ children: e, href: t, style: r }) {
832
- const n = m();
833
- return /* @__PURE__ */ a(
850
+ function Pt({ children: e, href: t, style: n }) {
851
+ const r = m();
852
+ return /* @__PURE__ */ i(
834
853
  "a",
835
854
  {
836
855
  href: t,
837
856
  target: "_blank",
838
857
  rel: "noreferrer",
839
- style: { color: n.text.link, ...r },
858
+ style: { color: r.text.link, ...n },
840
859
  children: e
841
860
  }
842
861
  );
843
862
  }
844
- function Tt({ children: e, gap: t, style: r }) {
845
- return /* @__PURE__ */ a(Pe, { gap: t, style: r, children: e });
863
+ function At({ children: e, gap: t, style: n }) {
864
+ return /* @__PURE__ */ i(Pe, { gap: t, style: n, children: e });
846
865
  }
847
- const ne = {
866
+ const re = {
848
867
  start: "flex-start",
849
868
  center: "center",
850
869
  end: "flex-end",
851
870
  stretch: "stretch",
852
871
  "space-between": "space-between"
853
872
  };
854
- function Pt({
873
+ function Mt({
855
874
  children: e,
856
875
  gap: t,
857
- align: r = "center",
858
- justify: n = "start",
859
- wrap: i = !1,
876
+ align: n = "center",
877
+ justify: r = "start",
878
+ wrap: a = !1,
860
879
  style: o
861
880
  }) {
862
- return /* @__PURE__ */ a(
881
+ return /* @__PURE__ */ i(
863
882
  Le,
864
883
  {
865
884
  gap: t,
866
- align: ne[r],
867
- justify: ne[n],
868
- wrap: i ? "wrap" : "nowrap",
885
+ align: re[n],
886
+ justify: re[r],
887
+ wrap: a ? "wrap" : "nowrap",
869
888
  style: o,
870
889
  children: e
871
890
  }
872
891
  );
873
892
  }
874
- function At() {
875
- return /* @__PURE__ */ a("div", { style: { flex: 1 } });
893
+ function Bt() {
894
+ return /* @__PURE__ */ i("div", { style: { flex: 1 } });
876
895
  }
877
- function Mt({ children: e, columns: t, gap: r = 16, align: n, style: i }) {
896
+ function $t({ children: e, columns: t, gap: n = 16, align: r, style: a }) {
878
897
  const o = typeof t == "number" ? `repeat(${t}, minmax(0, 1fr))` : t;
879
- return /* @__PURE__ */ a(
898
+ return /* @__PURE__ */ i(
880
899
  "div",
881
900
  {
882
901
  style: {
883
902
  display: "grid",
884
903
  gridTemplateColumns: o,
885
- gap: r,
886
- alignItems: n,
887
- ...i
904
+ gap: n,
905
+ alignItems: r,
906
+ ...a
888
907
  },
889
908
  children: e
890
909
  }
891
910
  );
892
911
  }
893
- function Bt({ style: e }) {
894
- return /* @__PURE__ */ a(ke, { style: e });
912
+ function Dt({ style: e }) {
913
+ return /* @__PURE__ */ i(ke, { style: e });
895
914
  }
896
- const O = $e({
915
+ const K = $e({
897
916
  collapsible: !1,
898
917
  open: !0,
899
918
  toggle: () => {
900
919
  }
901
920
  });
902
- function $t({
921
+ function Ft({
903
922
  children: e,
904
923
  variant: t = "default",
905
- collapsible: r = !1,
906
- defaultOpen: n = !0,
907
- open: i,
924
+ collapsible: n = !1,
925
+ defaultOpen: r = !0,
926
+ open: a,
908
927
  onOpenChange: o,
909
928
  style: c
910
929
  }) {
911
- const f = m(), [d, l] = $(n), u = i ?? d, g = _(() => {
930
+ const f = m(), [d, l] = D(r), u = a ?? d, g = G(() => {
912
931
  const v = !u;
913
- i === void 0 && l(v), o == null || o(v);
914
- }, [u, i, o]);
915
- return /* @__PURE__ */ a(
932
+ a === void 0 && l(v), o == null || o(v);
933
+ }, [u, a, o]);
934
+ return /* @__PURE__ */ i(
916
935
  be,
917
936
  {
918
937
  withBorder: t !== "borderless",
@@ -923,47 +942,47 @@ function $t({
923
942
  borderColor: f.stroke.secondary,
924
943
  ...c
925
944
  },
926
- children: /* @__PURE__ */ a(O.Provider, { value: { collapsible: r, open: u, toggle: g }, children: e })
945
+ children: /* @__PURE__ */ i(K.Provider, { value: { collapsible: n, open: u, toggle: g }, children: e })
927
946
  }
928
947
  );
929
948
  }
930
- function Ft({ children: e, trailing: t, style: r }) {
931
- const n = m(), { collapsible: i, open: o, toggle: c } = oe(O);
949
+ function Et({ children: e, trailing: t, style: n }) {
950
+ const r = m(), { collapsible: a, open: o, toggle: c } = oe(K);
932
951
  return /* @__PURE__ */ y(
933
952
  "div",
934
953
  {
935
- onClick: i ? c : void 0,
954
+ onClick: a ? c : void 0,
936
955
  style: {
937
956
  display: "flex",
938
957
  alignItems: "center",
939
958
  justifyContent: "space-between",
940
959
  gap: 8,
941
960
  padding: "8px 14px",
942
- borderBottom: `1px solid ${n.stroke.secondary}`,
943
- fontSize: n.typography.small.fontSize,
944
- fontWeight: n.typography.h3.fontWeight,
945
- color: n.text.primary,
946
- fontFamily: n.typography.fontFamily,
947
- cursor: i ? "pointer" : void 0,
948
- userSelect: i ? "none" : void 0,
949
- ...r
961
+ borderBottom: `1px solid ${r.stroke.secondary}`,
962
+ fontSize: r.typography.small.fontSize,
963
+ fontWeight: r.typography.h3.fontWeight,
964
+ color: r.text.primary,
965
+ fontFamily: r.typography.fontFamily,
966
+ cursor: a ? "pointer" : void 0,
967
+ userSelect: a ? "none" : void 0,
968
+ ...n
950
969
  },
951
970
  children: [
952
971
  /* @__PURE__ */ y("span", { style: { display: "inline-flex", alignItems: "center", gap: 6 }, children: [
953
- i && /* @__PURE__ */ a(he, { expanded: o }),
972
+ a && /* @__PURE__ */ i(he, { expanded: o }),
954
973
  e
955
974
  ] }),
956
- t != null && /* @__PURE__ */ a("span", { children: t })
975
+ t != null && /* @__PURE__ */ i("span", { children: t })
957
976
  ]
958
977
  }
959
978
  );
960
979
  }
961
- function Dt({ children: e, style: t }) {
962
- const { collapsible: r, open: n } = oe(O);
963
- return r && !n ? null : /* @__PURE__ */ a("div", { style: { padding: 14, ...t }, children: e });
980
+ function Nt({ children: e, style: t }) {
981
+ const { collapsible: n, open: r } = oe(K);
982
+ return n && !r ? null : /* @__PURE__ */ i("div", { style: { padding: 14, ...t }, children: e });
964
983
  }
965
984
  function he({ expanded: e }) {
966
- return /* @__PURE__ */ a(
985
+ return /* @__PURE__ */ i(
967
986
  "svg",
968
987
  {
969
988
  width: 12,
@@ -975,7 +994,7 @@ function he({ expanded: e }) {
975
994
  transition: "transform 120ms"
976
995
  },
977
996
  "aria-hidden": !0,
978
- children: /* @__PURE__ */ a(
997
+ children: /* @__PURE__ */ i(
979
998
  "path",
980
999
  {
981
1000
  d: "M4 2.5L8 6l-4 3.5",
@@ -988,53 +1007,53 @@ function he({ expanded: e }) {
988
1007
  }
989
1008
  );
990
1009
  }
991
- function Et({ value: e, label: t, tone: r, style: n }) {
992
- const i = m();
993
- return /* @__PURE__ */ y("div", { style: n, children: [
994
- /* @__PURE__ */ a(
1010
+ function It({ value: e, label: t, tone: n, style: r }) {
1011
+ const a = m();
1012
+ return /* @__PURE__ */ y("div", { style: r, children: [
1013
+ /* @__PURE__ */ i(
995
1014
  H,
996
1015
  {
997
1016
  fz: 22,
998
1017
  fw: 700,
999
1018
  lh: 1.2,
1000
1019
  style: {
1001
- color: r ? k[r] : i.text.primary,
1002
- fontFamily: i.typography.fontFamily
1020
+ color: n ? w[n] : a.text.primary,
1021
+ fontFamily: a.typography.fontFamily
1003
1022
  },
1004
1023
  children: e
1005
1024
  }
1006
1025
  ),
1007
- /* @__PURE__ */ a(
1026
+ /* @__PURE__ */ i(
1008
1027
  H,
1009
1028
  {
1010
1029
  fz: 12,
1011
1030
  style: {
1012
- color: i.text.tertiary,
1013
- fontFamily: i.typography.fontFamily
1031
+ color: a.text.tertiary,
1032
+ fontFamily: a.typography.fontFamily
1014
1033
  },
1015
1034
  children: t
1016
1035
  }
1017
1036
  )
1018
1037
  ] });
1019
1038
  }
1020
- function It({
1039
+ function zt({
1021
1040
  children: e,
1022
1041
  active: t,
1023
- tone: r = "neutral",
1024
- size: n = "md",
1025
- leadingContent: i,
1042
+ tone: n = "neutral",
1043
+ size: r = "md",
1044
+ leadingContent: a,
1026
1045
  keyboardHint: o,
1027
1046
  title: c,
1028
1047
  style: f,
1029
1048
  onClick: d
1030
1049
  }) {
1031
- return /* @__PURE__ */ a(
1032
- we,
1050
+ return /* @__PURE__ */ i(
1051
+ Ce,
1033
1052
  {
1034
- color: ae[r],
1053
+ color: ae[n],
1035
1054
  variant: t ? "filled" : "light",
1036
- size: n === "sm" ? "sm" : "md",
1037
- leftSection: i,
1055
+ size: r === "sm" ? "sm" : "md",
1056
+ leftSection: a,
1038
1057
  rightSection: o,
1039
1058
  title: c,
1040
1059
  onClick: d,
@@ -1047,64 +1066,64 @@ function It({
1047
1066
  }
1048
1067
  );
1049
1068
  }
1050
- function zt({
1069
+ function Rt({
1051
1070
  children: e,
1052
1071
  tone: t = "neutral",
1053
- title: r,
1054
- icon: n,
1055
- style: i
1072
+ title: n,
1073
+ icon: r,
1074
+ style: a
1056
1075
  }) {
1057
- return /* @__PURE__ */ a(
1076
+ return /* @__PURE__ */ i(
1058
1077
  ve,
1059
1078
  {
1060
1079
  color: ae[t],
1061
- title: r,
1062
- icon: n,
1080
+ title: n,
1081
+ icon: r,
1063
1082
  variant: "light",
1064
- style: i,
1083
+ style: a,
1065
1084
  children: e
1066
1085
  }
1067
1086
  );
1068
1087
  }
1069
- const nt = {
1088
+ const at = {
1070
1089
  success: "rgba(31,138,101,0.12)",
1071
1090
  danger: "rgba(207,45,86,0.12)",
1072
1091
  warning: "rgba(232,163,61,0.14)",
1073
1092
  info: "rgba(46,121,181,0.12)",
1074
1093
  neutral: "rgba(136,136,168,0.12)"
1075
1094
  };
1076
- function Nt({
1095
+ function _t({
1077
1096
  headers: e,
1078
1097
  rows: t,
1079
- columnAlign: r,
1080
- rowTone: n,
1081
- framed: i = !0,
1098
+ columnAlign: n,
1099
+ rowTone: r,
1100
+ framed: a = !0,
1082
1101
  striped: o,
1083
1102
  stickyHeader: c,
1084
1103
  style: f,
1085
1104
  emptyMessage: d
1086
1105
  }) {
1087
1106
  return /* @__PURE__ */ y(
1088
- w,
1107
+ L,
1089
1108
  {
1090
- withTableBorder: i,
1109
+ withTableBorder: a,
1091
1110
  withColumnBorders: !1,
1092
1111
  striped: o,
1093
1112
  stickyHeader: c,
1094
1113
  highlightOnHover: !0,
1095
1114
  style: f,
1096
1115
  children: [
1097
- /* @__PURE__ */ a(w.Thead, { children: /* @__PURE__ */ a(w.Tr, { children: e.map((l, u) => /* @__PURE__ */ a(w.Th, { ta: (r == null ? void 0 : r[u]) ?? "left", children: l }, u)) }) }),
1098
- /* @__PURE__ */ a(w.Tbody, { children: t.length === 0 ? /* @__PURE__ */ a(w.Tr, { children: /* @__PURE__ */ a(w.Td, { colSpan: e.length, ta: "center", c: "dimmed", children: d ?? "No data" }) }) : t.map((l, u) => {
1099
- const g = n == null ? void 0 : n[u];
1100
- return /* @__PURE__ */ a(
1101
- w.Tr,
1116
+ /* @__PURE__ */ i(L.Thead, { children: /* @__PURE__ */ i(L.Tr, { children: e.map((l, u) => /* @__PURE__ */ i(L.Th, { ta: (n == null ? void 0 : n[u]) ?? "left", children: l }, u)) }) }),
1117
+ /* @__PURE__ */ i(L.Tbody, { children: t.length === 0 ? /* @__PURE__ */ i(L.Tr, { children: /* @__PURE__ */ i(L.Td, { colSpan: e.length, ta: "center", c: "dimmed", children: d ?? "No data" }) }) : t.map((l, u) => {
1118
+ const g = r == null ? void 0 : r[u];
1119
+ return /* @__PURE__ */ i(
1120
+ L.Tr,
1102
1121
  {
1103
- style: g ? { background: nt[g] } : void 0,
1104
- children: e.map((v, h) => /* @__PURE__ */ a(
1105
- w.Td,
1122
+ style: g ? { background: at[g] } : void 0,
1123
+ children: e.map((v, h) => /* @__PURE__ */ i(
1124
+ L.Td,
1106
1125
  {
1107
- ta: (r == null ? void 0 : r[h]) ?? "left",
1126
+ ta: (n == null ? void 0 : n[h]) ?? "left",
1108
1127
  children: l[h]
1109
1128
  },
1110
1129
  h
@@ -1117,73 +1136,73 @@ function Nt({
1117
1136
  }
1118
1137
  );
1119
1138
  }
1120
- const ot = {
1139
+ const it = {
1121
1140
  primary: "filled",
1122
1141
  secondary: "default",
1123
1142
  ghost: "subtle"
1124
1143
  };
1125
- function Rt({
1144
+ function Ht({
1126
1145
  children: e,
1127
1146
  variant: t = "secondary",
1128
- disabled: r,
1129
- type: n = "button",
1130
- style: i,
1147
+ disabled: n,
1148
+ type: r = "button",
1149
+ style: a,
1131
1150
  onClick: o
1132
1151
  }) {
1133
- return /* @__PURE__ */ a(
1152
+ return /* @__PURE__ */ i(
1134
1153
  xe,
1135
1154
  {
1136
- variant: ot[t],
1155
+ variant: it[t],
1137
1156
  color: t === "primary" ? "accent" : void 0,
1138
1157
  size: "xs",
1139
- disabled: r,
1140
- type: n,
1158
+ disabled: n,
1159
+ type: r,
1141
1160
  onClick: o,
1142
- style: i,
1161
+ style: a,
1143
1162
  children: e
1144
1163
  }
1145
1164
  );
1146
1165
  }
1147
- function Ht({
1166
+ function Wt({
1148
1167
  children: e,
1149
1168
  onClick: t,
1150
- disabled: r,
1151
- title: n,
1152
- variant: i = "default",
1169
+ disabled: n,
1170
+ title: r,
1171
+ variant: a = "default",
1153
1172
  size: o = "md",
1154
1173
  style: c
1155
1174
  }) {
1156
- return /* @__PURE__ */ a(
1157
- Ce,
1175
+ return /* @__PURE__ */ i(
1176
+ we,
1158
1177
  {
1159
- variant: i === "circle" ? "light" : "subtle",
1160
- radius: i === "circle" ? "xl" : "sm",
1178
+ variant: a === "circle" ? "light" : "subtle",
1179
+ radius: a === "circle" ? "xl" : "sm",
1161
1180
  size: o === "sm" ? "sm" : "md",
1162
1181
  color: "gray",
1163
- disabled: r,
1164
- title: n,
1165
- "aria-label": n,
1182
+ disabled: n,
1183
+ title: r,
1184
+ "aria-label": r,
1166
1185
  onClick: t,
1167
1186
  style: c,
1168
1187
  children: e
1169
1188
  }
1170
1189
  );
1171
1190
  }
1172
- function Wt({
1191
+ function Gt({
1173
1192
  value: e,
1174
1193
  onChange: t,
1175
- options: r,
1176
- placeholder: n,
1177
- disabled: i,
1194
+ options: n,
1195
+ placeholder: r,
1196
+ disabled: a,
1178
1197
  style: o
1179
1198
  }) {
1180
- return /* @__PURE__ */ a(
1199
+ return /* @__PURE__ */ i(
1181
1200
  Te,
1182
1201
  {
1183
1202
  value: e,
1184
- data: r,
1185
- placeholder: n,
1186
- disabled: i,
1203
+ data: n,
1204
+ placeholder: r,
1205
+ disabled: a,
1187
1206
  allowDeselect: !1,
1188
1207
  onChange: (c) => {
1189
1208
  c !== null && (t == null || t(c));
@@ -1192,86 +1211,86 @@ function Wt({
1192
1211
  }
1193
1212
  );
1194
1213
  }
1195
- function _t({
1214
+ function Ot({
1196
1215
  checked: e,
1197
1216
  onChange: t,
1198
- disabled: r,
1199
- label: n,
1200
- style: i
1217
+ disabled: n,
1218
+ label: r,
1219
+ style: a
1201
1220
  }) {
1202
- return /* @__PURE__ */ a(
1221
+ return /* @__PURE__ */ i(
1203
1222
  Se,
1204
1223
  {
1205
1224
  checked: e,
1206
- disabled: r,
1207
- label: n,
1225
+ disabled: n,
1226
+ label: r,
1208
1227
  onChange: (o) => t == null ? void 0 : t(o.currentTarget.checked),
1209
- style: i
1228
+ style: a
1210
1229
  }
1211
1230
  );
1212
1231
  }
1213
- function Gt({
1232
+ function jt({
1214
1233
  checked: e,
1215
1234
  onChange: t,
1216
- disabled: r,
1217
- size: n = "sm",
1218
- style: i
1235
+ disabled: n,
1236
+ size: r = "sm",
1237
+ style: a
1219
1238
  }) {
1220
- return /* @__PURE__ */ a(
1239
+ return /* @__PURE__ */ i(
1221
1240
  Be,
1222
1241
  {
1223
1242
  checked: e,
1224
- disabled: r,
1225
- size: n === "sm" ? "sm" : "md",
1243
+ disabled: n,
1244
+ size: r === "sm" ? "sm" : "md",
1226
1245
  onChange: (o) => t == null ? void 0 : t(o.currentTarget.checked),
1227
- style: i
1246
+ style: a
1228
1247
  }
1229
1248
  );
1230
1249
  }
1231
- function jt({
1250
+ function Kt({
1232
1251
  value: e,
1233
1252
  onChange: t,
1234
- placeholder: r,
1235
- disabled: n,
1236
- type: i,
1253
+ placeholder: n,
1254
+ disabled: r,
1255
+ type: a,
1237
1256
  style: o
1238
1257
  }) {
1239
- return /* @__PURE__ */ a(
1258
+ return /* @__PURE__ */ i(
1240
1259
  Me,
1241
1260
  {
1242
1261
  value: e,
1243
- placeholder: r,
1244
- disabled: n,
1245
- type: i,
1262
+ placeholder: n,
1263
+ disabled: r,
1264
+ type: a,
1246
1265
  onChange: (c) => t == null ? void 0 : t(c.currentTarget.value),
1247
1266
  style: o
1248
1267
  }
1249
1268
  );
1250
1269
  }
1251
- function Ot({
1270
+ function Xt({
1252
1271
  value: e,
1253
1272
  onChange: t,
1254
- placeholder: r,
1255
- disabled: n,
1256
- rows: i = 3,
1273
+ placeholder: n,
1274
+ disabled: r,
1275
+ rows: a = 3,
1257
1276
  style: o
1258
1277
  }) {
1259
- return /* @__PURE__ */ a(
1278
+ return /* @__PURE__ */ i(
1260
1279
  Ae,
1261
1280
  {
1262
1281
  value: e,
1263
- placeholder: r,
1264
- disabled: n,
1282
+ placeholder: n,
1283
+ disabled: r,
1265
1284
  autosize: !0,
1266
- minRows: i,
1285
+ minRows: a,
1267
1286
  onChange: (c) => t == null ? void 0 : t(c.currentTarget.value),
1268
1287
  style: o
1269
1288
  }
1270
1289
  );
1271
1290
  }
1272
- function Kt({ color: e, style: t }) {
1273
- const r = m();
1274
- return /* @__PURE__ */ a(
1291
+ function qt({ color: e, style: t }) {
1292
+ const n = m();
1293
+ return /* @__PURE__ */ i(
1275
1294
  "span",
1276
1295
  {
1277
1296
  style: {
@@ -1279,26 +1298,26 @@ function Kt({ color: e, style: t }) {
1279
1298
  width: 14,
1280
1299
  height: 14,
1281
1300
  borderRadius: 4,
1282
- background: r.category[e],
1301
+ background: n.category[e],
1283
1302
  flex: "0 0 auto",
1284
1303
  ...t
1285
1304
  }
1286
1305
  }
1287
1306
  );
1288
1307
  }
1289
- function Xt({
1308
+ function Vt({
1290
1309
  segments: e,
1291
1310
  total: t,
1292
- topLeftLabel: r,
1293
- topRightLabel: n,
1294
- style: i
1311
+ topLeftLabel: n,
1312
+ topRightLabel: r,
1313
+ style: a
1295
1314
  }) {
1296
1315
  const o = m(), c = t > 0 ? t : 1, f = e.reduce(
1297
1316
  (l, u) => l + (Number.isFinite(u.value) && u.value > 0 ? u.value : 0),
1298
1317
  0
1299
1318
  ), d = Math.max(0, c - f);
1300
- return /* @__PURE__ */ y("div", { style: i, children: [
1301
- (r != null || n != null) && /* @__PURE__ */ y(
1319
+ return /* @__PURE__ */ y("div", { style: a, children: [
1320
+ (n != null || r != null) && /* @__PURE__ */ y(
1302
1321
  "div",
1303
1322
  {
1304
1323
  style: {
@@ -1309,15 +1328,15 @@ function Xt({
1309
1328
  marginBottom: 6
1310
1329
  },
1311
1330
  children: [
1312
- /* @__PURE__ */ a("span", { children: r }),
1313
- /* @__PURE__ */ a("span", { children: n })
1331
+ /* @__PURE__ */ i("span", { children: n }),
1332
+ /* @__PURE__ */ i("span", { children: r })
1314
1333
  ]
1315
1334
  }
1316
1335
  ),
1317
1336
  /* @__PURE__ */ y("div", { style: { display: "flex", gap: 2, height: 8 }, children: [
1318
1337
  e.map((l, u) => {
1319
1338
  const g = Number.isFinite(l.value) && l.value > 0 ? l.value : 0, v = o.category[l.color ?? te[u % te.length]];
1320
- return /* @__PURE__ */ a(
1339
+ return /* @__PURE__ */ i(
1321
1340
  "div",
1322
1341
  {
1323
1342
  style: {
@@ -1329,7 +1348,7 @@ function Xt({
1329
1348
  l.id
1330
1349
  );
1331
1350
  }),
1332
- d > 0 && /* @__PURE__ */ a(
1351
+ d > 0 && /* @__PURE__ */ i(
1333
1352
  "div",
1334
1353
  {
1335
1354
  style: {
@@ -1345,13 +1364,13 @@ function Xt({
1345
1364
  function Yt({
1346
1365
  title: e,
1347
1366
  leading: t,
1348
- count: r,
1349
- trailing: n,
1350
- children: i,
1367
+ count: n,
1368
+ trailing: r,
1369
+ children: a,
1351
1370
  defaultOpen: o = !1,
1352
1371
  style: c
1353
1372
  }) {
1354
- const f = m(), [d, l] = $(o);
1373
+ const f = m(), [d, l] = D(o);
1355
1374
  return /* @__PURE__ */ y("div", { style: c, children: [
1356
1375
  /* @__PURE__ */ y(
1357
1376
  "div",
@@ -1368,71 +1387,71 @@ function Yt({
1368
1387
  fontSize: 14
1369
1388
  },
1370
1389
  children: [
1371
- /* @__PURE__ */ a(he, { expanded: d }),
1390
+ /* @__PURE__ */ i(he, { expanded: d }),
1372
1391
  t,
1373
- /* @__PURE__ */ a("span", { style: { fontWeight: 500 }, children: e }),
1374
- r != null && /* @__PURE__ */ a("span", { style: { color: f.text.tertiary, fontSize: 12 }, children: r }),
1375
- /* @__PURE__ */ a("span", { style: { flex: 1 } }),
1376
- n != null && /* @__PURE__ */ a("span", { style: { color: f.text.tertiary }, children: n })
1392
+ /* @__PURE__ */ i("span", { style: { fontWeight: 500 }, children: e }),
1393
+ n != null && /* @__PURE__ */ i("span", { style: { color: f.text.tertiary, fontSize: 12 }, children: n }),
1394
+ /* @__PURE__ */ i("span", { style: { flex: 1 } }),
1395
+ r != null && /* @__PURE__ */ i("span", { style: { color: f.text.tertiary }, children: r })
1377
1396
  ]
1378
1397
  }
1379
1398
  ),
1380
- d && /* @__PURE__ */ a("div", { style: { paddingLeft: 18, paddingBottom: 4 }, children: i })
1399
+ d && /* @__PURE__ */ i("div", { style: { paddingLeft: 18, paddingBottom: 4 }, children: a })
1381
1400
  ] });
1382
1401
  }
1383
1402
  export {
1384
- ut as BarChart,
1385
- Rt as Button,
1386
- zt as Callout,
1387
- $t as Card,
1388
- Dt as CardBody,
1389
- Ft as CardHeader,
1390
- _t as Checkbox,
1391
- wt as Code,
1403
+ ht as BarChart,
1404
+ Ht as Button,
1405
+ Rt as Callout,
1406
+ Ft as Card,
1407
+ Nt as CardBody,
1408
+ Et as CardHeader,
1409
+ Ot as Checkbox,
1410
+ Tt as Code,
1392
1411
  Yt as CollapsibleSection,
1393
- pt as DiffStats,
1394
- yt as DiffView,
1395
- Bt as Divider,
1396
- Mt as Grid,
1397
- bt as H1,
1398
- St as H2,
1399
- kt as H3,
1400
- Ht as IconButton,
1401
- dt as LineChart,
1402
- Lt as Link,
1403
- ft as PieChart,
1404
- It as Pill,
1405
- Pt as Row,
1406
- Wt as Select,
1407
- At as Spacer,
1408
- Tt as Stack,
1409
- Et as Stat,
1410
- Kt as Swatch,
1411
- Nt as Table,
1412
- Ct as Text,
1413
- Ot as TextArea,
1414
- jt as TextInput,
1415
- tt as TodoList,
1416
- mt as TodoListCard,
1417
- Gt as Toggle,
1418
- Xt as UsageBar,
1419
- tr as canvasPaletteDark,
1420
- rr as canvasPaletteGrokDark,
1421
- nr as canvasPaletteGrokLight,
1422
- or as canvasPaletteLight,
1423
- ar as canvasTokens,
1424
- ir as canvasTokensLight,
1425
- sr as categoryPaletteDark,
1426
- lr as categoryPaletteLight,
1427
- cr as colorPalette,
1428
- ht as computeDAGLayout,
1429
- vt as mergeStyle,
1412
+ mt as DiffStats,
1413
+ gt as DiffView,
1414
+ Dt as Divider,
1415
+ $t as Grid,
1416
+ kt as H1,
1417
+ wt as H2,
1418
+ Ct as H3,
1419
+ Wt as IconButton,
1420
+ ft as LineChart,
1421
+ Pt as Link,
1422
+ pt as PieChart,
1423
+ zt as Pill,
1424
+ Mt as Row,
1425
+ Gt as Select,
1426
+ Bt as Spacer,
1427
+ At as Stack,
1428
+ It as Stat,
1429
+ qt as Swatch,
1430
+ _t as Table,
1431
+ Lt as Text,
1432
+ Xt as TextArea,
1433
+ Kt as TextInput,
1434
+ rt as TodoList,
1435
+ xt as TodoListCard,
1436
+ jt as Toggle,
1437
+ Vt as UsageBar,
1438
+ rn as canvasPaletteDark,
1439
+ on as canvasPaletteGrokDark,
1440
+ an as canvasPaletteGrokLight,
1441
+ sn as canvasPaletteLight,
1442
+ ln as canvasTokens,
1443
+ cn as canvasTokensLight,
1444
+ dn as categoryPaletteDark,
1445
+ un as categoryPaletteLight,
1446
+ fn as colorPalette,
1447
+ yt as computeDAGLayout,
1448
+ St as mergeStyle,
1430
1449
  te as usageColorSequence,
1431
- xt as useCanvasAction,
1432
- gt as useCanvasState,
1433
- Zt as useEffect,
1450
+ bt as useCanvasAction,
1451
+ vt as useCanvasState,
1452
+ Ut as useEffect,
1434
1453
  m as useHostTheme,
1435
- Jt as useMemo,
1436
- Ut as useRef,
1437
- Qt as useState
1454
+ Qt as useMemo,
1455
+ en as useRef,
1456
+ tn as useState
1438
1457
  };