@umriss-ui/schedule 0.44.0 → 0.45.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.
package/dist/schedule.js CHANGED
@@ -1,19 +1,19 @@
1
1
  "use client";
2
2
  import "./schedule.css";
3
- import { localOffset as Kt, toWorkingTimeClamped as H, calendarFrom as vt, toWallClock as Vt, MINUTE as q, DAY as U, timeStep as bs, workingTimeTicks as Ms, HOUR as jt, LinearScale as Ts, resolveColours as Ss, removedIntervals as Is, subscribeTheme as Ls } from "@umriss-ui/charts";
4
- import { useContext as Ge, createContext as He, useRef as V, useEffect as j, useId as As, useState as at, useLayoutEffect as pt, useImperativeHandle as Cs, useSyncExternalStore as Ye, useMemo as W, createElement as Ds } from "react";
5
- import { jsxs as N, Fragment as lt, jsx as m } from "react/jsx-runtime";
6
- import { useFormats as Wt, useWording as yt, Skeleton as _s, AngleGlyph as Os, VisuallyHidden as ve, createLongPress as Fs } from "@umriss-ui/core";
7
- function nt(s) {
3
+ import { localOffset as Ke, toWorkingTimeClamped as Y, calendarFrom as bt, toWallClock as Wt, MINUTE as X, DAY as j, timeStep as Ls, workingTimeTicks as As, inDoubledHour as Cs, HOUR as Ut, LinearScale as Ds, resolveColours as _s, removedIntervals as Os, subscribeTheme as Fs } from "@umriss-ui/charts";
4
+ import { useContext as Ve, createContext as qe, useRef as V, useEffect as q, useId as $s, useState as dt, useLayoutEffect as wt, useImperativeHandle as Es, useSyncExternalStore as ze, useMemo as z, createElement as xs } from "react";
5
+ import { jsxs as B, Fragment as ht, jsx as m } from "react/jsx-runtime";
6
+ import { zoneFields as We, zoneInstant as Gt, useFormats as Xt, useWording as Mt, useTimeZoneLabel as Rs, Skeleton as Ns, AngleGlyph as Bs, VisuallyHidden as be, createLongPress as Ps, zoneDayStart as Gs } from "@umriss-ui/core";
7
+ function it(s) {
8
8
  return { from: s.from - (s.leadIn ?? 0), to: s.to + (s.leadOut ?? 0) };
9
9
  }
10
- function zt(s, t) {
10
+ function jt(s, t) {
11
11
  return (s.leaves ?? "leadOut") === "main" ? t.to : t.to + (t.leadOut ?? 0);
12
12
  }
13
- function Ut(s, t) {
13
+ function Zt(s, t) {
14
14
  return (s.arrives ?? "leadIn") === "main" ? t.from : t.from - (t.leadIn ?? 0);
15
15
  }
16
- function ye(s, t) {
16
+ function Me(s, t) {
17
17
  if (t.kind === "place" || t.subtask !== s.id) return s;
18
18
  switch (t.kind) {
19
19
  case "move":
@@ -27,7 +27,7 @@ function ye(s, t) {
27
27
  return { ...s, lane: t.lane };
28
28
  }
29
29
  }
30
- function Fi(s, t) {
30
+ function Yi(s, t) {
31
31
  return {
32
32
  id: t,
33
33
  task: s.task,
@@ -38,10 +38,10 @@ function Fi(s, t) {
38
38
  ...s.leadOut === void 0 ? {} : { leadOut: s.leadOut }
39
39
  };
40
40
  }
41
- function Xt(s) {
41
+ function Jt(s) {
42
42
  const t = [], e = /* @__PURE__ */ new Map();
43
43
  s.forEach((i, n) => {
44
- const { from: o, to: r } = nt(i);
44
+ const { from: o, to: r } = it(i);
45
45
  if (!(o < r)) return;
46
46
  const a = e.get(i.lane) ?? [];
47
47
  a.push({ subtask: i, index: n, from: o, to: r }), e.set(i.lane, a);
@@ -59,10 +59,10 @@ function Xt(s) {
59
59
  }
60
60
  return t;
61
61
  }
62
- function Es(s) {
62
+ function Hs(s) {
63
63
  const t = /* @__PURE__ */ new Map(), e = /* @__PURE__ */ new Map();
64
64
  for (const i of s) {
65
- const n = nt(i), o = e.get(i.lane) ?? [];
65
+ const n = it(i), o = e.get(i.lane) ?? [];
66
66
  let r = 0;
67
67
  if (n.from < n.to) {
68
68
  for (const a of o) n.from < a.to && a.from < n.to && r++;
@@ -72,35 +72,35 @@ function Es(s) {
72
72
  }
73
73
  return t;
74
74
  }
75
- function qt(s, t) {
75
+ function Qt(s, t) {
76
76
  const e = new Map(s.map((n) => [n.id, n])), i = [];
77
77
  for (const n of t) {
78
78
  const o = e.get(n.from), r = e.get(n.to);
79
79
  if (o === void 0 || r === void 0) continue;
80
- const a = zt(n, o), l = Ut(n, r), d = a + n.lag - l;
80
+ const a = jt(n, o), l = Zt(n, r), d = a + n.lag - l;
81
81
  d > 0 && i.push({ dependency: n.id, departure: a, arrival: l, shortBy: d });
82
82
  }
83
83
  return i;
84
84
  }
85
- function Ke(s, t) {
85
+ function Ue(s, t) {
86
86
  const e = [];
87
87
  for (const i of s) {
88
- const n = nt(i);
88
+ const n = it(i);
89
89
  for (const o of t)
90
90
  o.lane !== i.lane || !(n.from < o.to && o.from < n.to) || e.push({ subtask: i.id, blocked: o.id, lane: o.lane, from: Math.max(n.from, o.from), to: Math.min(n.to, o.to) });
91
91
  }
92
92
  return e;
93
93
  }
94
- function Ei(s, t, e = []) {
94
+ function Ki(s, t, e = []) {
95
95
  return {
96
- overlaps: Xt(s),
97
- violatedDependencies: qt(s, t),
98
- inBlockedTime: Ke(s, e)
96
+ overlaps: Jt(s),
97
+ violatedDependencies: Qt(s, t),
98
+ inBlockedTime: Ue(s, e)
99
99
  };
100
100
  }
101
- function $i(s, t, e) {
101
+ function Vi(s, t, e) {
102
102
  if (e.kind === "place") return [];
103
- const i = new Map(s.map((l) => [l.id, ye(l, e)])), n = /* @__PURE__ */ new Map();
103
+ const i = new Map(s.map((l) => [l.id, Me(l, e)])), n = /* @__PURE__ */ new Map();
104
104
  for (const l of t) {
105
105
  const d = n.get(l.from) ?? [];
106
106
  d.push(l), n.set(l.from, d);
@@ -114,99 +114,99 @@ function $i(s, t, e) {
114
114
  if (h.to === e.subtask) continue;
115
115
  const c = i.get(h.to);
116
116
  if (c === void 0) continue;
117
- const f = zt(h, d) + h.lag - Ut(h, c);
117
+ const f = jt(h, d) + h.lag - Zt(h, c);
118
118
  if (!(f > 0)) continue;
119
119
  const g = { kind: "move", subtask: c.id, from: c.from + f, to: c.to + f };
120
- i.set(c.id, ye(c, g)), o.set(c.id, g), r.push(c.id);
120
+ i.set(c.id, Me(c, g)), o.set(c.id, g), r.push(c.id);
121
121
  }
122
122
  }
123
123
  return [...o.values()];
124
124
  }
125
- function $s(s, t) {
126
- const { step: e, offset: i } = typeof t == "number" ? { step: t, offset: 0 } : t;
127
- if (!(e > 0) || !Number.isFinite(s)) return s;
128
- const n = Kt(s) + i;
129
- return n + Math.round((s - n) / e) * e;
125
+ function Ys(s, t, e) {
126
+ const { step: i, offset: n } = typeof t == "number" ? { step: t, offset: 0 } : t;
127
+ if (!(i > 0) || !Number.isFinite(s)) return s;
128
+ const o = Ke(s, e) + n;
129
+ return o + Math.round((s - o) / i) * i;
130
130
  }
131
- function Ri(s, t, e) {
131
+ function qi(s, t, e) {
132
132
  return e === 0 || !Number.isFinite(e) ? [] : s.filter((i) => i.task === t).map((i) => ({ kind: "move", subtask: i.id, from: i.from + e, to: i.to + e }));
133
133
  }
134
- function wt(s) {
134
+ function Tt(s) {
135
135
  let t = !1, e = !1, i = !1, n = !1;
136
136
  for (const o of s ?? [])
137
137
  o === "provisional" ? (t = !0, e = !1) : o === "fixed" ? (e = !0, t = !1) : o === "muted" ? i = !0 : o === "open" && (n = !0);
138
138
  return { dashed: t, hatched: e, muted: i, open: n };
139
139
  }
140
- const Ve = /* @__PURE__ */ He(null), je = /* @__PURE__ */ He(null);
141
- function We() {
142
- return Ge(je);
140
+ const Xe = /* @__PURE__ */ qe(null), je = /* @__PURE__ */ qe(null);
141
+ function Ze() {
142
+ return Ve(je);
143
143
  }
144
- function Rs(s) {
145
- const t = Ge(Ve);
144
+ function Ks(s) {
145
+ const t = Ve(Xe);
146
146
  if (t === null)
147
147
  throw new Error(`@umriss-ui/schedule: <${s}> must be used inside a <Schedule>.`);
148
148
  return t;
149
149
  }
150
- function Jt(s, t, e, i, n) {
151
- const o = Rs(s), r = V(null);
152
- j(() => (r.current = e(o, t), () => {
150
+ function te(s, t, e, i, n) {
151
+ const o = Ks(s), r = V(null);
152
+ q(() => (r.current = e(o, t), () => {
153
153
  r.current !== null && n(o, r.current), r.current = null;
154
- }), [o]), j(() => {
154
+ }), [o]), q(() => {
155
155
  r.current !== null && i(o, r.current, t);
156
156
  });
157
157
  }
158
- function xs(s) {
159
- Jt("Lane", s, (t, e) => t.registerLane(e), (t, e, i) => t.updateLane(e, i), (t, e) => t.unregisterLane(e));
158
+ function Vs(s) {
159
+ te("Lane", s, (t, e) => t.registerLane(e), (t, e, i) => t.updateLane(e, i), (t, e) => t.unregisterLane(e));
160
160
  }
161
- function Bs(s) {
162
- Jt("LaneGroup", s, (t, e) => t.registerGroup(e), (t, e, i) => t.updateGroup(e, i), (t, e) => t.unregisterGroup(e));
161
+ function qs(s) {
162
+ te("LaneGroup", s, (t, e) => t.registerGroup(e), (t, e, i) => t.updateGroup(e, i), (t, e) => t.unregisterGroup(e));
163
163
  }
164
- function bt(s, t) {
165
- Jt(s, t, (e, i) => e.registerLayer(i), (e, i, n) => e.updateLayer(i, n), (e, i) => e.unregisterLayer(i));
164
+ function St(s, t) {
165
+ te(s, t, (e, i) => e.registerLayer(i), (e, i, n) => e.updateLayer(i, n), (e, i) => e.unregisterLayer(i));
166
166
  }
167
- const ze = 24, Ns = 4, Ps = 3, Et = 4;
168
- function we(s) {
169
- const { lanes: t, groups: e, collapsed: i, laneHeight: n, headHeight: o = ze } = s, r = new Map(e.map((w) => [w.id, w])), a = (w) => w !== void 0 && r.has(w) ? w : void 0, l = /* @__PURE__ */ new Map(), d = (w) => {
167
+ const Je = 24, zs = 4, Ws = 3, Rt = 4;
168
+ function Te(s) {
169
+ const { lanes: t, groups: e, collapsed: i, laneHeight: n, headHeight: o = Je } = s, r = new Map(e.map((y) => [y.id, y])), a = (y) => y !== void 0 && r.has(y) ? y : void 0, l = /* @__PURE__ */ new Map(), d = (y) => {
170
170
  const M = [];
171
- let T = a(w.parent);
171
+ let T = a(y.parent);
172
172
  const F = /* @__PURE__ */ new Set();
173
173
  for (; T !== void 0 && !F.has(T); )
174
174
  F.add(T), M.unshift(T), T = a(r.get(T).parent);
175
175
  return M;
176
176
  }, h = /* @__PURE__ */ new Map();
177
- for (const w of t) {
178
- const M = d(w);
179
- h.set(w.id, M);
177
+ for (const y of t) {
178
+ const M = d(y);
179
+ h.set(y.id, M);
180
180
  for (const T of M) {
181
181
  const F = l.get(T) ?? [];
182
- F.push(w.id), l.set(T, F);
182
+ F.push(y.id), l.set(T, F);
183
183
  }
184
184
  }
185
185
  const c = [], f = /* @__PURE__ */ new Map();
186
- let g = [], v = null, A = 0;
187
- const I = (w) => (c.push({ ...w, top: A }), A += w.height, c.length - 1), L = (w) => w.find((M) => i.has(M)), D = () => {
188
- if (v === null) return;
189
- const { row: w, lanes: M } = v, T = c[w], F = Math.max(T.height, M.length * Ns + 2 * Et);
190
- c[w] = { ...T, height: F }, A += F - T.height;
191
- const O = F - 2 * Et, x = Math.max(Ps, Math.floor(O / M.length));
192
- M.forEach((X, ft) => {
193
- const mt = h.get(X) ?? [];
194
- f.set(X, {
195
- top: T.top + Et + ft * x,
196
- height: x,
186
+ let g = [], w = null, A = 0;
187
+ const I = (y) => (c.push({ ...y, top: A }), A += y.height, c.length - 1), L = (y) => y.find((M) => i.has(M)), D = () => {
188
+ if (w === null) return;
189
+ const { row: y, lanes: M } = w, T = c[y], F = Math.max(T.height, M.length * zs + 2 * Rt);
190
+ c[y] = { ...T, height: F }, A += F - T.height;
191
+ const O = F - 2 * Rt, R = Math.max(Ws, Math.floor(O / M.length));
192
+ M.forEach((U, pt) => {
193
+ const gt = h.get(U) ?? [];
194
+ f.set(U, {
195
+ top: T.top + Rt + pt * R,
196
+ height: R,
197
197
  miniature: !0,
198
- group: mt[mt.length - 1]
198
+ group: gt[gt.length - 1]
199
199
  });
200
- }), v = null;
200
+ }), w = null;
201
201
  };
202
- for (const w of t) {
203
- const M = (h.get(w.id) ?? []).filter((O) => (l.get(O) ?? []).length > 0), T = L(M);
204
- if (v !== null && T === v.group) {
205
- v.lanes.push(w.id);
202
+ for (const y of t) {
203
+ const M = (h.get(y.id) ?? []).filter((O) => (l.get(O) ?? []).length > 0), T = L(M);
204
+ if (w !== null && T === w.group) {
205
+ w.lanes.push(y.id);
206
206
  continue;
207
207
  }
208
208
  D();
209
- const F = M.filter((O, x) => g[x] === O).length;
209
+ const F = M.filter((O, R) => g[R] === O).length;
210
210
  g = g.slice(0, F);
211
211
  for (const O of M.slice(F)) {
212
212
  if (g.push(O), O === T) break;
@@ -221,7 +221,7 @@ function we(s) {
221
221
  });
222
222
  }
223
223
  if (T !== void 0) {
224
- const O = M.indexOf(T), x = I({
224
+ const O = M.indexOf(T), R = I({
225
225
  kind: "miniature",
226
226
  lane: void 0,
227
227
  group: T,
@@ -230,10 +230,10 @@ function we(s) {
230
230
  lanes: (l.get(T) ?? []).length,
231
231
  height: n
232
232
  });
233
- v = { group: T, row: x, lanes: [w.id] };
233
+ w = { group: T, row: R, lanes: [y.id] };
234
234
  continue;
235
235
  }
236
- I({ kind: "lane", lane: w.id, group: M[M.length - 1], depth: M.length, within: M, lanes: 1, height: n }), f.set(w.id, {
236
+ I({ kind: "lane", lane: y.id, group: M[M.length - 1], depth: M.length, within: M, lanes: 1, height: n }), f.set(y.id, {
237
237
  top: c[c.length - 1].top,
238
238
  height: n,
239
239
  miniature: !1,
@@ -242,13 +242,13 @@ function we(s) {
242
242
  }
243
243
  return D(), { rows: c, slots: f, height: A };
244
244
  }
245
- function Gs(s, t) {
245
+ function Us(s, t) {
246
246
  if (t.size === 0) return s;
247
247
  const e = /* @__PURE__ */ new Set();
248
248
  for (const i of s) t.has(i) || e.add(i);
249
249
  return e;
250
250
  }
251
- function st(s, t) {
251
+ function nt(s, t) {
252
252
  if (t < 0 || t >= s.height) return null;
253
253
  let e = 0, i = s.rows.length - 1;
254
254
  for (; e <= i; ) {
@@ -259,11 +259,11 @@ function st(s, t) {
259
259
  }
260
260
  return null;
261
261
  }
262
- function Zt(s, t) {
262
+ function ee(s, t) {
263
263
  return s.slots.get(t) ?? null;
264
264
  }
265
- function Hs(s, t) {
266
- const e = st(s, t);
265
+ function Xs(s, t) {
266
+ const e = nt(s, t);
267
267
  if (e === null) return null;
268
268
  if (e.kind === "lane") return e.lane ?? null;
269
269
  if (e.kind === "groupHead") return null;
@@ -271,84 +271,84 @@ function Hs(s, t) {
271
271
  if (n.miniature && t >= n.top && t < n.top + n.height) return i;
272
272
  return null;
273
273
  }
274
- const Ys = 6, Ue = 3, rt = 2, be = 3, Me = 3;
275
- function $(s, t) {
276
- return Math.round(s.scale.toPx(H(t, s.calendar)));
274
+ const js = 6, Qe = 3, lt = 2, Se = 3, Ie = 3;
275
+ function E(s, t) {
276
+ return Math.round(s.scale.toPx(Y(t, s.calendar)));
277
277
  }
278
- function J(s, t) {
279
- const e = Zt(s.rows, t);
278
+ function Z(s, t) {
279
+ const e = ee(s.rows, t);
280
280
  return e === null ? null : { ...e, top: e.top - s.scrollY };
281
281
  }
282
- function Qt(s, t) {
283
- const e = J(s, t.lane);
284
- return e === null ? null : { x: $(s, t.at), y: e.top + e.height / 2, half: Math.max(2, Math.min(7, e.height * 0.3)) };
282
+ function se(s, t) {
283
+ const e = Z(s, t.lane);
284
+ return e === null ? null : { x: E(s, t.at), y: e.top + e.height / 2, half: Math.max(2, Math.min(7, e.height * 0.3)) };
285
285
  }
286
- function Te(s, t) {
287
- return Hs(s.rows, t + s.scrollY);
286
+ function Le(s, t) {
287
+ return Xs(s.rows, t + s.scrollY);
288
288
  }
289
- function Xe(s, t, e, i) {
290
- const n = e.miniature ? 0 : Ys, o = e.miniature ? 0 : Me * be, r = Math.max(e.miniature ? 1 : 4, e.height - 2 * n - o), a = e.top - s.scrollY + Math.floor((e.height - r) / 2), l = nt(t);
289
+ function ts(s, t, e, i) {
290
+ const n = e.miniature ? 0 : js, o = e.miniature ? 0 : Ie * Se, r = Math.max(e.miniature ? 1 : 4, e.height - 2 * n - o), a = e.top - s.scrollY + Math.floor((e.height - r) / 2), l = it(t);
291
291
  return {
292
292
  subtask: t,
293
293
  miniature: e.miniature,
294
294
  depth: i,
295
- y: a + (e.miniature ? 0 : Math.min(i, Me) * be),
295
+ y: a + (e.miniature ? 0 : Math.min(i, Ie) * Se),
296
296
  height: r,
297
- outerFrom: $(s, l.from),
298
- mainFrom: $(s, t.from),
299
- mainTo: $(s, t.to),
300
- outerTo: $(s, l.to)
297
+ outerFrom: E(s, l.from),
298
+ mainFrom: E(s, t.from),
299
+ mainTo: E(s, t.to),
300
+ outerTo: E(s, l.to)
301
301
  };
302
302
  }
303
- function qe(s, t, e) {
303
+ function es(s, t, e) {
304
304
  if (e < s.y || e > s.y + s.height) return null;
305
305
  const i = Math.max(0, (6 - (s.outerTo - s.outerFrom)) / 2);
306
306
  return t < s.outerFrom - i || t > s.outerTo + i ? null : t < s.mainFrom ? "leadIn" : t > s.mainTo ? "leadOut" : "main";
307
307
  }
308
- function Ks(s, t, e, i = 5) {
308
+ function Zs(s, t, e, i = 5) {
309
309
  if (e < s.y || e > s.y + s.height) return null;
310
310
  const n = Math.abs(t - s.mainFrom), o = Math.abs(t - s.mainTo);
311
311
  return Math.min(n, o) > i ? null : n <= o ? "from" : "to";
312
312
  }
313
- function Bt(s, t, e) {
313
+ function Ht(s, t, e) {
314
314
  return s.outerTo >= 0 && s.outerFrom <= t && s.y + s.height >= 0 && s.y <= e;
315
315
  }
316
- function Vs(s, t, e) {
316
+ function Js(s, t, e) {
317
317
  let n = Math.min(s.x1, s.x2, s.c1x, s.c2x), o = Math.max(s.x1, s.x2, s.c1x, s.c2x), r = Math.min(s.y1, s.y2), a = Math.max(s.y1, s.y2);
318
318
  for (let l = 0; l + 1 < s.points.length; l += 2)
319
319
  n = Math.min(n, s.points[l]), o = Math.max(o, s.points[l]), r = Math.min(r, s.points[l + 1]), a = Math.max(a, s.points[l + 1]);
320
320
  return o >= -8 && n <= t + 8 && a >= -8 && r <= e + 8;
321
321
  }
322
- const js = 64;
323
- function Ws(s, t) {
322
+ const Qs = 64;
323
+ function tn(s, t) {
324
324
  if (s.miniature) return null;
325
- const e = wt(s.subtask.appearance).hatched ? rt + Ue + 1 : 0, i = Math.max(s.mainFrom + e, 0), n = Math.min(s.mainTo - e, t) - i;
326
- return n < js ? null : { x: i, width: n, y: s.y, height: s.height };
325
+ const e = Tt(s.subtask.appearance).hatched ? lt + Qe + 1 : 0, i = Math.max(s.mainFrom + e, 0), n = Math.min(s.mainTo - e, t) - i;
326
+ return n < Qs ? null : { x: i, width: n, y: s.y, height: s.height };
327
327
  }
328
- const zs = 10;
329
- function Se(s, t, e) {
328
+ const en = 10;
329
+ function Ae(s, t, e) {
330
330
  const i = Math.round(t.y + t.height / 2);
331
331
  return s === "centre" || e.y === t.y ? i : Math.round(e.y > t.y ? t.y + t.height - 1 : t.y + 1);
332
332
  }
333
- function Nt(s, t, e, i, n) {
334
- const o = t.route ?? n.route, r = t.attach ?? n.attach, a = t.ends ?? n.ends, l = $(s, zt(t, e.subtask)), d = $(s, Ut(t, i.subtask)), h = Se(r, e, i), c = Se(r, i, e);
333
+ function Yt(s, t, e, i, n) {
334
+ const o = t.route ?? n.route, r = t.attach ?? n.attach, a = t.ends ?? n.ends, l = E(s, jt(t, e.subtask)), d = E(s, Zt(t, i.subtask)), h = Ae(r, e, i), c = Ae(r, i, e);
335
335
  if (o === "straight")
336
336
  return { dependency: t, kind: o, ends: a, x1: l, y1: h, x2: d, y2: c, c1x: l, c2x: d, points: [l, h, d, c] };
337
337
  if (o === "orthogonal") {
338
- const I = l + zs, L = h === c ? I : Math.round((I + d) / 2);
338
+ const I = l + en, L = h === c ? I : Math.round((I + d) / 2);
339
339
  return { dependency: t, kind: o, ends: a, x1: l, y1: h, x2: d, y2: c, c1x: l, c2x: d, points: h === c ? [l, h, d, c] : [l, h, L, h, L, c, d, c] };
340
340
  }
341
- const f = Math.max(14, Math.abs(d - l) / 2), g = l + f, v = d - f, A = [];
341
+ const f = Math.max(14, Math.abs(d - l) / 2), g = l + f, w = d - f, A = [];
342
342
  for (let I = 0; I <= 16; I++) {
343
343
  const L = I / 16, D = 1 - L;
344
344
  A.push(
345
- D * D * D * l + 3 * D * D * L * g + 3 * D * L * L * v + L * L * L * d,
345
+ D * D * D * l + 3 * D * D * L * g + 3 * D * L * L * w + L * L * L * d,
346
346
  D * D * D * h + 3 * D * D * L * h + 3 * D * L * L * c + L * L * L * c
347
347
  );
348
348
  }
349
- return { dependency: t, kind: "curve", ends: a, x1: l, y1: h, x2: d, y2: c, c1x: g, c2x: v, points: A };
349
+ return { dependency: t, kind: "curve", ends: a, x1: l, y1: h, x2: d, y2: c, c1x: g, c2x: w, points: A };
350
350
  }
351
- function Us(s, t, e) {
351
+ function sn(s, t, e) {
352
352
  let i = 1 / 0;
353
353
  const n = s.points;
354
354
  for (let o = 0; o + 3 < n.length; o += 2) {
@@ -357,65 +357,69 @@ function Us(s, t, e) {
357
357
  }
358
358
  return i;
359
359
  }
360
- const Je = [], Ze = 56;
361
- function Xs(s) {
360
+ const ss = [], ns = 56;
361
+ function nn(s) {
362
362
  return s > 16 ? s / 16 : 1;
363
363
  }
364
- function qs(s, t = Ze) {
365
- return s > 0 ? Math.min(U, Math.max(15 * q, bs(s * t, 1))) : 15 * q;
364
+ function on(s, t = ns) {
365
+ return s > 0 ? Math.min(j, Math.max(15 * X, Ls(s * t, 1))) : 15 * X;
366
366
  }
367
- function Js(s, t, e = Je) {
368
- const [i, n] = Qe(s, e);
369
- return Ms(e, i, n, t, Kt(i)).filter(
370
- (o) => o.workingTime >= s[0] && o.workingTime <= s[1]
367
+ const rn = () => new Intl.DateTimeFormat().resolvedOptions().timeZone;
368
+ function an(s, t, e = ss, i) {
369
+ const [n, o] = is(s, e);
370
+ return As(e, n, o, t, 0, i ?? rn()).filter(
371
+ (r) => r.workingTime >= s[0] && r.workingTime <= s[1]
371
372
  );
372
373
  }
373
- function Zs(s, t = Je) {
374
- const [e, i] = Qe(s, t), n = [], o = new Date(e);
375
- for (o.setHours(0, 0, 0, 0); o.getTime() < i && n.length < 400; ) {
376
- const r = o.getTime();
377
- o.setDate(o.getDate() + 1);
378
- const a = o.getTime();
379
- n.push({
380
- start: r,
381
- from: H(r, t),
382
- to: H(a, t)
374
+ function ln(s, t = ss, e) {
375
+ const [i, n] = is(s, t), o = [], { year: r, month: a, day: l } = We(i, e);
376
+ let d = l, h = Gt({ year: r, month: a, day: d }, e).getTime();
377
+ for (; h < n && o.length < 400; ) {
378
+ const c = h;
379
+ h = Gt({ year: r, month: a, day: ++d }, e).getTime(), o.push({
380
+ start: c,
381
+ from: Y(c, t),
382
+ to: Y(h, t)
383
383
  });
384
384
  }
385
- return n;
385
+ return o;
386
386
  }
387
- const $t = [1, 2, 7, 14, 28];
388
- function Qs(s, t) {
389
- return $t.find((e) => e * s >= t) ?? $t[$t.length - 1];
387
+ const Nt = [1, 2, 7, 14, 28];
388
+ function dn(s, t) {
389
+ return Nt.find((e) => e * s >= t) ?? Nt[Nt.length - 1];
390
390
  }
391
- function Rt(s, t) {
392
- return ((Math.round((s - Kt(s)) / U) - 4) % t + t) % t === 0;
391
+ function Bt(s, t, e) {
392
+ return ((Math.round((s - Ke(s, e)) / j) - 4) % t + t) % t === 0;
393
393
  }
394
- function tn(s, t, e, i) {
394
+ function et(s, t) {
395
+ const e = s.time(new Date(t), !1);
396
+ return Cs(t, s.timeZone) ? `${e} ${s.offset(new Date(t))}` : e;
397
+ }
398
+ function hn(s, t, e, i) {
395
399
  const n = s[1] - s[0];
396
400
  if (!(n > 0)) return [s[0], s[1]];
397
401
  const o = Math.min(i.max, Math.max(i.min, n * e)), r = (t - s[0]) / n, a = t - r * o;
398
402
  return [a, a + o];
399
403
  }
400
- function en(s, t) {
404
+ function cn(s, t) {
401
405
  return [s[0] + t, s[1] + t];
402
406
  }
403
- function ht(s, t) {
404
- const e = vt(t);
405
- return e.intervals.length === 0 ? s : Vt(Math.max(0, Math.min(e.total, s)), e);
407
+ function ut(s, t) {
408
+ const e = bt(t);
409
+ return e.intervals.length === 0 ? s : Wt(Math.max(0, Math.min(e.total, s)), e);
406
410
  }
407
- function Qe(s, t) {
408
- return [ht(s[0], t), ht(s[1], t)];
411
+ function is(s, t) {
412
+ return [ut(s[0], t), ut(s[1], t)];
409
413
  }
410
- const Pt = 44;
411
- class sn {
414
+ const Kt = 44;
415
+ class un {
412
416
  constructor(t) {
413
417
  this.data = t;
414
418
  }
415
419
  options = {
416
- laneHeight: Pt,
420
+ laneHeight: Kt,
417
421
  calendar: [],
418
- zoomLimits: { min: jt, max: 28 * U },
422
+ zoomLimits: { min: Ut, max: 28 * j },
419
423
  snap: "ticks",
420
424
  intents: [],
421
425
  now: null,
@@ -425,14 +429,14 @@ class sn {
425
429
  };
426
430
  /** The root font size over 16 px, 1 at the default size and below (`fontScaleOf`). */
427
431
  fontScale = 1;
428
- domain = [0, U];
432
+ domain = [0, j];
429
433
  scrollY = 0;
430
434
  width = 0;
431
435
  height = 0;
432
436
  /* What is laid out from top to bottom (`rows.ts`). It is derived here and
433
437
  not in the data, because a row's height comes from a view option; every y
434
438
  in the package reads it. */
435
- rows = we({ lanes: [], groups: [], collapsed: /* @__PURE__ */ new Set(), laneHeight: Pt });
439
+ rows = Te({ lanes: [], groups: [], collapsed: /* @__PURE__ */ new Set(), laneHeight: Kt });
436
440
  /** The folded groups, as the scene holds them. */
437
441
  collapsed = /* @__PURE__ */ new Set();
438
442
  /** The groups a gesture in flight holds open. Dropped when it ends; the
@@ -468,20 +472,20 @@ class sn {
468
472
  setOptions(t) {
469
473
  const e = t.calendar !== this.options.calendar, i = this.options.calendar;
470
474
  if (this.options = t, e) {
471
- const n = vt(i), o = (r) => {
475
+ const n = bt(i), o = (r) => {
472
476
  const a = n.intervals.length === 0 ? r : Math.max(0, Math.min(n.total, r));
473
- return H(Vt(a, n), t.calendar) + (r - a);
477
+ return Y(Wt(a, n), t.calendar) + (r - a);
474
478
  };
475
479
  this.domain = [o(this.domain[0]), o(this.domain[1])];
476
480
  }
477
481
  }
478
482
  /** Puts a span of two wall-clock instants in view. */
479
483
  showWall(t) {
480
- this.domain = [H(t[0], this.options.calendar), H(t[1], this.options.calendar)];
484
+ this.domain = [Y(t[0], this.options.calendar), Y(t[1], this.options.calendar)];
481
485
  }
482
486
  viewport() {
483
487
  return {
484
- scale: new Ts(this.domain, [0, this.width]),
488
+ scale: new Ds(this.domain, [0, this.width]),
485
489
  calendar: this.options.calendar,
486
490
  scrollY: this.scrollY,
487
491
  rows: this.rows
@@ -497,29 +501,29 @@ class sn {
497
501
  /** The fine band's step at the current zoom. */
498
502
  step() {
499
503
  const t = this.domain[1] - this.domain[0];
500
- return qs(this.width > 0 ? t / this.width : t, Ze * this.fontScale);
504
+ return on(this.width > 0 ? t / this.width : t, ns * this.fontScale);
501
505
  }
502
506
  /** Lays the rows out, clamps the scroll, and lays the data out anew. */
503
507
  layout() {
504
- this.moved = !1, this.rows = we({
508
+ this.moved = !1, this.rows = Te({
505
509
  lanes: this.data.lanes,
506
510
  groups: this.data.groups,
507
- collapsed: Gs(this.collapsed, this.openForGesture),
511
+ collapsed: Us(this.collapsed, this.openForGesture),
508
512
  laneHeight: Math.round(this.options.laneHeight * this.fontScale),
509
- headHeight: Math.round(ze * this.fontScale)
513
+ headHeight: Math.round(Je * this.fontScale)
510
514
  }), this.scrollY = Math.max(0, Math.min(this.maxScroll(), this.scrollY));
511
515
  const t = this.viewport();
512
516
  this.laidBoxes = [], this.laidBoxById = /* @__PURE__ */ new Map();
513
517
  for (const e of this.data.subtasks) {
514
- const i = Zt(this.rows, e.lane);
518
+ const i = ee(this.rows, e.lane);
515
519
  if (i === null) continue;
516
- const n = Xe(t, e, i, this.data.depth.get(e.id) ?? 0);
520
+ const n = ts(t, e, i, this.data.depth.get(e.id) ?? 0);
517
521
  this.laidBoxes.push(n), this.laidBoxById.set(e.id, n);
518
522
  }
519
523
  this.laidPaths = [];
520
524
  for (const e of this.data.dependencies) {
521
525
  const i = this.boxById.get(e.from), n = this.boxById.get(e.to);
522
- i === void 0 || n === void 0 || this.laidPaths.push(Nt(t, e, i, n, this.options));
526
+ i === void 0 || n === void 0 || this.laidPaths.push(Yt(t, e, i, n, this.options));
523
527
  }
524
528
  }
525
529
  /** The days of the coarse band and the ticks of the fine band, in pixels. */
@@ -528,11 +532,11 @@ class sn {
528
532
  if (this.width <= 0) return { days: [], ticks: [], step: t };
529
533
  const e = this.viewport().scale, i = this.options.calendar;
530
534
  return {
531
- days: Zs(this.domain, i).map((n) => {
535
+ days: ln(this.domain, i, this.options.timeZone).map((n) => {
532
536
  const o = Math.round(e.toPx(n.from));
533
537
  return { start: n.start, x: o, width: Math.round(e.toPx(n.to)) - o };
534
538
  }),
535
- ticks: Js(this.domain, t, i).map((n) => ({ wallClock: n.wallClock, x: Math.round(e.toPx(n.workingTime)) })),
539
+ ticks: an(this.domain, t, i, this.options.timeZone).map((n) => ({ wallClock: n.wallClock, x: Math.round(e.toPx(n.workingTime)) })),
536
540
  step: t
537
541
  };
538
542
  }
@@ -540,32 +544,32 @@ class sn {
540
544
  nowX() {
541
545
  const t = this.options.now;
542
546
  if (t === null || this.width <= 0) return null;
543
- const e = Math.round(this.viewport().scale.toPx(H(t, this.options.calendar)));
547
+ const e = Math.round(this.viewport().scale.toPx(Y(t, this.options.calendar)));
544
548
  return e >= 0 && e <= this.width ? e : null;
545
549
  }
546
550
  hitAt(t, e) {
547
551
  const i = this.viewport();
548
552
  for (let a = this.data.milestones.length - 1; a >= 0; a--) {
549
- const l = this.data.milestones[a], d = Qt(i, l);
553
+ const l = this.data.milestones[a], d = se(i, l);
550
554
  if (d !== null && Math.abs(t - d.x) + Math.abs(e - d.y) <= d.half + 2) return { kind: "milestone", milestone: l };
551
555
  }
552
556
  for (let a = this.boxes.length - 1; a >= 0; a--) {
553
- const l = this.boxes[a], d = qe(l, t, e);
557
+ const l = this.boxes[a], d = es(l, t, e);
554
558
  if (d !== null) return { kind: "subtask", subtask: l.subtask, part: d };
555
559
  }
556
560
  let n = null, o = 4;
557
561
  for (const a of this.paths) {
558
- const l = Us(a, t, e);
562
+ const l = sn(a, t, e);
559
563
  l <= o && (o = l, n = a);
560
564
  }
561
565
  if (n !== null) return { kind: "dependency", dependency: n.dependency };
562
- const r = Te(this.viewport(), e);
566
+ const r = Le(this.viewport(), e);
563
567
  return r !== null ? { kind: "lane", lane: r } : { kind: "nothing" };
564
568
  }
565
569
  /** The wall-clock time at a plot x; within the calendar's extent. */
566
570
  timeAt(t) {
567
571
  const e = this.viewport().scale.fromPx(t);
568
- return ht(e, this.options.calendar);
572
+ return ut(e, this.options.calendar);
569
573
  }
570
574
  /** The lane at a y, strips included: what the pointer is ON.
571
575
 
@@ -574,7 +578,7 @@ class sn {
574
578
  `foldedGroupAt` - and a caller that reached through `viewport()` for it
575
579
  would be depending on the layout rather than asking the view. */
576
580
  laneIdAt(t) {
577
- return Te(this.viewport(), t);
581
+ return Le(this.viewport(), t);
578
582
  }
579
583
  /** The lane a DROP at this y would land on.
580
584
 
@@ -584,19 +588,19 @@ class sn {
584
588
  aim at. Hover, the tooltip and selection do read a strip - they cost
585
589
  nothing if they are a pixel out. */
586
590
  dropLaneIdAt(t) {
587
- const e = st(this.rows, t + this.scrollY);
591
+ const e = nt(this.rows, t + this.scrollY);
588
592
  return e === null || e.kind !== "lane" ? null : e.lane ?? null;
589
593
  }
590
594
  /** The folded group a y lies over, or null. */
591
595
  foldedGroupAt(t) {
592
- const e = st(this.rows, t + this.scrollY);
596
+ const e = nt(this.rows, t + this.scrollY);
593
597
  return e !== null && e.kind === "miniature" ? e.group ?? null : null;
594
598
  }
595
599
  /** Pans by pixels. Says what moved: the span through time, the lanes, or
596
600
  neither - a scroll through the lanes is no news about the time. */
597
601
  pan(t, e) {
598
602
  const i = this.domain[0], n = this.scrollY, o = this.domain[1] - i;
599
- this.width > 0 && t !== 0 && (this.domain = en(this.domain, t / this.width * o)), this.scrollY = Math.max(0, Math.min(this.maxScroll(), this.scrollY + e));
603
+ this.width > 0 && t !== 0 && (this.domain = cn(this.domain, t / this.width * o)), this.scrollY = Math.max(0, Math.min(this.maxScroll(), this.scrollY + e));
600
604
  const r = this.domain[0] !== i;
601
605
  return { moved: r || this.scrollY !== n, time: r };
602
606
  }
@@ -604,63 +608,64 @@ class sn {
604
608
  zoomAt(t, e) {
605
609
  if (this.width <= 0 || !Number.isFinite(e)) return !1;
606
610
  const i = this.domain, n = this.viewport().scale.fromPx(t);
607
- return this.domain = tn(this.domain, n, e, this.options.zoomLimits), i[0] !== this.domain[0] || i[1] !== this.domain[1];
608
- }
609
- }
610
- const nn = "_root_mm9nj_4 _text_18806_22", on = "_corner_mm9nj_19", rn = "_dayBand_mm9nj_23", an = "_tickBand_mm9nj_24", ln = "_day_mm9nj_23", dn = "_dayLabel_mm9nj_50", hn = "_tick_mm9nj_24", cn = "_tickLabel_mm9nj_71", un = "_headers_mm9nj_81", fn = "_header_mm9nj_81", mn = "_headerLabel_mm9nj_100", pn = "_headerCount_mm9nj_136", gn = "_chevron_mm9nj_145", kn = "_plot_mm9nj_223", vn = "_focusRing_mm9nj_237", yn = "_layer_mm9nj_255", wn = "_grip_mm9nj_282", bn = "_ghostLabel_mm9nj_292", Mn = "_finding_mm9nj_305", Tn = "_refusal_mm9nj_313", Sn = "_tooltip_mm9nj_317", In = "_tooltipHead_mm9nj_336", Ln = "_tooltipTimes_mm9nj_341", An = "_now_mm9nj_350", Cn = "_barLabel_mm9nj_364", Dn = "_barLabelText_mm9nj_377", p = {
611
- root: nn,
612
- corner: on,
613
- dayBand: rn,
614
- tickBand: an,
615
- day: ln,
616
- dayLabel: dn,
617
- tick: hn,
618
- tickLabel: cn,
619
- headers: un,
620
- header: fn,
621
- headerLabel: mn,
622
- headerCount: pn,
623
- chevron: gn,
624
- plot: kn,
625
- focusRing: vn,
626
- layer: yn,
627
- grip: wn,
628
- ghostLabel: bn,
629
- finding: Mn,
630
- refusal: Tn,
631
- tooltip: Sn,
632
- tooltipHead: In,
633
- tooltipTimes: Ln,
634
- now: An,
635
- barLabel: Cn,
636
- barLabelText: Dn
611
+ return this.domain = hn(this.domain, n, e, this.options.zoomLimits), i[0] !== this.domain[0] || i[1] !== this.domain[1];
612
+ }
613
+ }
614
+ const fn = "_root_q0w8s_4 _text_18806_22", mn = "_corner_q0w8s_19", pn = "_zoneLabel_q0w8s_24", gn = "_dayBand_q0w8s_40", kn = "_tickBand_q0w8s_41", wn = "_day_q0w8s_40", vn = "_dayLabel_q0w8s_67", yn = "_tick_q0w8s_41", bn = "_tickLabel_q0w8s_88", Mn = "_headers_q0w8s_98", Tn = "_header_q0w8s_98", Sn = "_headerLabel_q0w8s_117", In = "_headerCount_q0w8s_153", Ln = "_chevron_q0w8s_162", An = "_plot_q0w8s_240", Cn = "_focusRing_q0w8s_254", Dn = "_layer_q0w8s_272", _n = "_grip_q0w8s_299", On = "_ghostLabel_q0w8s_309", Fn = "_finding_q0w8s_322", $n = "_refusal_q0w8s_330", En = "_tooltip_q0w8s_334", xn = "_tooltipHead_q0w8s_353", Rn = "_tooltipTimes_q0w8s_358", Nn = "_now_q0w8s_367", Bn = "_barLabel_q0w8s_381", Pn = "_barLabelText_q0w8s_394", p = {
615
+ root: fn,
616
+ corner: mn,
617
+ zoneLabel: pn,
618
+ dayBand: gn,
619
+ tickBand: kn,
620
+ day: wn,
621
+ dayLabel: vn,
622
+ tick: yn,
623
+ tickLabel: bn,
624
+ headers: Mn,
625
+ header: Tn,
626
+ headerLabel: Sn,
627
+ headerCount: In,
628
+ chevron: Ln,
629
+ plot: An,
630
+ focusRing: Cn,
631
+ layer: Dn,
632
+ grip: _n,
633
+ ghostLabel: On,
634
+ finding: Fn,
635
+ refusal: $n,
636
+ tooltip: En,
637
+ tooltipHead: xn,
638
+ tooltipTimes: Rn,
639
+ now: Nn,
640
+ barLabel: Bn,
641
+ barLabelText: Pn
637
642
  };
638
- function ts() {
639
- const s = yt();
643
+ function os() {
644
+ const s = Mt();
640
645
  return (t) => {
641
- const e = Math.round(t / q), i = Math.floor(e / 60), n = e % 60;
646
+ const e = Math.round(t / X), i = Math.floor(e / 60), n = e % 60;
642
647
  return [i > 0 ? s.hoursShort(i) : "", n > 0 || i === 0 ? s.minutesShort(n) : ""].filter(Boolean).join(" ");
643
648
  };
644
649
  }
645
- function _n({ target: s, lane: t }) {
646
- const e = Wt(), i = yt(), n = ts(), o = (c) => e.time(new Date(c), !1);
650
+ function Gn({ target: s, lane: t }) {
651
+ const e = Xt(), i = Mt(), n = os(), o = (c) => et(e, c);
647
652
  if (s.kind === "subtask") {
648
653
  const { subtask: c, task: f } = s, g = [
649
654
  f?.name ?? c.task,
650
655
  c.name ?? c.id,
651
656
  `${e.dateShort(new Date(c.from))} ${i.scheduleGhostTimes(o(c.from), o(c.to))}`,
652
- ...s.overlapping.map((v) => i.scheduleOverlapWith(v.name ?? v.id)),
653
- ...s.violatedDependencies.map((v) => i.scheduleViolatedBy(n(v.shortBy))),
654
- ...s.blocked.map((v) => i.scheduleInBlockedTime(v.label))
657
+ ...s.overlapping.map((w) => i.scheduleOverlapWith(w.name ?? w.id)),
658
+ ...s.violatedDependencies.map((w) => i.scheduleViolatedBy(n(w.shortBy))),
659
+ ...s.blocked.map((w) => i.scheduleInBlockedTime(w.label))
655
660
  ];
656
- return /* @__PURE__ */ N(lt, { children: [
661
+ return /* @__PURE__ */ B(ht, { children: [
657
662
  t,
658
663
  `, ${g.join(", ")}`
659
664
  ] });
660
665
  }
661
666
  if (s.kind === "milestone") {
662
667
  const { milestone: c } = s;
663
- return /* @__PURE__ */ N(lt, { children: [
668
+ return /* @__PURE__ */ B(ht, { children: [
664
669
  t,
665
670
  `, ${i.scheduleMilestone(c.label ?? c.id)}, ${e.dateShort(new Date(c.at))} ${o(c.at)}`
666
671
  ] });
@@ -673,11 +678,11 @@ function _n({ target: s, lane: t }) {
673
678
  ...h === void 0 ? [] : [i.scheduleViolatedBy(n(h.shortBy))]
674
679
  ].join(", ");
675
680
  }
676
- function On({ target: s }) {
677
- const t = Wt(), e = yt(), i = (h) => t.time(new Date(h), !1), n = ts();
681
+ function Hn({ target: s }) {
682
+ const t = Xt(), e = Mt(), i = (h) => et(t, h), n = os();
678
683
  if (s.kind === "subtask") {
679
684
  const { subtask: h, task: c } = s;
680
- return /* @__PURE__ */ N(lt, { children: [
685
+ return /* @__PURE__ */ B(ht, { children: [
681
686
  /* @__PURE__ */ m("span", { className: p.tooltipHead, children: c?.name ?? h.task }),
682
687
  /* @__PURE__ */ m("span", { children: h.name ?? h.id }),
683
688
  /* @__PURE__ */ m("span", { className: p.tooltipTimes, children: e.scheduleGhostTimes(i(h.from), i(h.to)) }),
@@ -690,21 +695,21 @@ function On({ target: s }) {
690
695
  }
691
696
  if (s.kind === "milestone") {
692
697
  const { milestone: h } = s;
693
- return /* @__PURE__ */ N(lt, { children: [
698
+ return /* @__PURE__ */ B(ht, { children: [
694
699
  /* @__PURE__ */ m("span", { className: p.tooltipHead, children: e.scheduleMilestone(h.label ?? h.id) }),
695
700
  /* @__PURE__ */ m("span", { className: p.tooltipTimes, children: `${t.dateShort(new Date(h.at))} ${i(h.at)}` })
696
701
  ] });
697
702
  }
698
703
  const { dependency: o, task: r, from: a, to: l, violated: d } = s;
699
- return /* @__PURE__ */ N(lt, { children: [
704
+ return /* @__PURE__ */ B(ht, { children: [
700
705
  /* @__PURE__ */ m("span", { className: p.tooltipHead, children: r?.name ?? r?.id ?? o.id }),
701
706
  /* @__PURE__ */ m("span", { children: e.scheduleRoute(a?.name ?? o.from, l?.name ?? o.to) }),
702
707
  /* @__PURE__ */ m("span", { children: `${e.scheduleDependency} ${n(o.lag)}` }),
703
708
  d !== void 0 && /* @__PURE__ */ m("span", { className: p.finding, children: e.scheduleViolatedBy(n(d.shortBy)) })
704
709
  ] });
705
710
  }
706
- const Fn = [], Ie = { min: jt, max: 28 * U }, En = [], Le = 20, $n = 44, Rn = 84, xn = 200;
707
- function Bn(s) {
711
+ const Yn = [], Ce = { min: Ut, max: 28 * j }, Kn = [], De = 20, Vn = 44, qn = 84, zn = 200;
712
+ function Wn(s) {
708
713
  const {
709
714
  ref: t,
710
715
  scene: e,
@@ -712,162 +717,162 @@ function Bn(s) {
712
717
  "aria-labelledby": n,
713
718
  "aria-describedby": o,
714
719
  height: r,
715
- laneHeight: a = Pt,
720
+ laneHeight: a = Kt,
716
721
  headerWidth: l = 160,
717
- calendar: d = En,
722
+ calendar: d = Kn,
718
723
  zoomLimits: h,
719
724
  snap: c = "ticks",
720
- intents: f = Fn,
725
+ intents: f = Yn,
721
726
  onIntent: g,
722
- canMoveTo: v,
727
+ canMoveTo: w,
723
728
  onInteraction: A,
724
729
  selectedTask: I,
725
730
  onSelectedTaskChange: L,
726
731
  placing: D,
727
- route: w = "curve",
732
+ route: y = "curve",
728
733
  attach: M = "centre",
729
734
  ends: T = "dot",
730
735
  label: F,
731
736
  tooltip: O,
732
- now: x,
733
- loading: X = !1,
734
- className: ft,
735
- style: mt,
736
- children: ds,
737
- ...hs
738
- } = s, ee = { "aria-label": i, "aria-labelledby": n }, Mt = As(), Tt = `${Mt}-summary`, St = V(null), se = V(null), ne = V(null), ie = V(null), Y = Wt(), B = yt(), oe = h?.min ?? Ie.min, re = h?.max ?? Ie.max, ae = typeof c == "object" ? c.step : null, le = typeof c == "object" ? c.offset : null, de = typeof c == "object" ? null : c, [cs, us] = at(() => Date.now());
739
- j(() => {
740
- if (x !== !0) return;
741
- const u = setInterval(() => us(Date.now()), q);
737
+ now: R,
738
+ loading: U = !1,
739
+ className: pt,
740
+ style: gt,
741
+ children: ms,
742
+ ...ps
743
+ } = s, ie = { "aria-label": i, "aria-labelledby": n }, It = $s(), Lt = `${It}-summary`, At = V(null), oe = V(null), re = V(null), ae = V(null), H = Xt(), N = Mt(), ot = H.timeZone, kt = Rs(), le = h?.min ?? Ce.min, de = h?.max ?? Ce.max, he = typeof c == "object" ? c.step : null, ce = typeof c == "object" ? c.offset : null, ue = typeof c == "object" ? null : c, [gs, ks] = dt(() => Date.now());
744
+ q(() => {
745
+ if (R !== !0) return;
746
+ const u = setInterval(() => ks(Date.now()), X);
742
747
  return () => clearInterval(u);
743
- }, [x]);
744
- const he = x === !0 ? cs : typeof x == "number" ? x : null;
745
- pt(() => {
746
- const u = de ?? { step: ae ?? 0, offset: le ?? 0 };
747
- e.setOptions({ laneHeight: a, calendar: d, zoomLimits: { min: oe, max: re }, snap: u, intents: f, now: he, route: w, attach: M, ends: T });
748
- }, [e, a, d, oe, re, de, ae, le, f, he, w, M, T]), j(() => {
749
- e.setHandlers({ onIntent: g, canMoveTo: v, onInteraction: A, onSelectedTaskChange: L });
750
- }, [e, g, v, A, L]), Cs(t, () => St.current, []), j(() => {
751
- e.setLoading(X);
752
- }, [e, X]), j(() => {
748
+ }, [R]);
749
+ const fe = R === !0 ? gs : typeof R == "number" ? R : null;
750
+ wt(() => {
751
+ const u = ue ?? { step: he ?? 0, offset: ce ?? 0 };
752
+ e.setOptions({ laneHeight: a, calendar: d, zoomLimits: { min: le, max: de }, snap: u, intents: f, now: fe, timeZone: ot, route: y, attach: M, ends: T });
753
+ }, [e, a, d, le, de, ue, he, ce, f, fe, ot, y, M, T]), q(() => {
754
+ e.setHandlers({ onIntent: g, canMoveTo: w, onInteraction: A, onSelectedTaskChange: L });
755
+ }, [e, g, w, A, L]), Es(t, () => At.current, []), q(() => {
756
+ e.setLoading(U);
757
+ }, [e, U]), q(() => {
753
758
  e.setControlledTask(I);
754
- }, [e, I]), j(() => {
759
+ }, [e, I]), q(() => {
755
760
  e.setPlacing(D ?? null);
756
- }, [e, D]), j(() => {
757
- const u = St.current, y = se.current, S = ne.current, E = ie.current;
758
- if (!u || !y || !S || !E) return;
759
- e.bind(u, y, S, E);
760
- const C = y.getBoundingClientRect();
761
+ }, [e, D]), q(() => {
762
+ const u = At.current, v = oe.current, S = re.current, $ = ae.current;
763
+ if (!u || !v || !S || !$) return;
764
+ e.bind(u, v, S, $);
765
+ const C = v.getBoundingClientRect();
761
766
  e.resize(C.width, C.height);
762
767
  const _ = new ResizeObserver((K) => {
763
- const Ft = K[K.length - 1]?.contentRect;
764
- Ft !== void 0 && e.resize(Ft.width, Ft.height);
768
+ const xt = K[K.length - 1]?.contentRect;
769
+ xt !== void 0 && e.resize(xt.width, xt.height);
765
770
  });
766
- _.observe(y);
767
- const R = document.createElement("div");
768
- R.setAttribute("aria-hidden", "true"), R.style.cssText = "position:absolute;visibility:hidden;pointer-events:none;width:1rem;height:0", u.appendChild(R);
769
- const P = () => e.setFontScale(Xs(parseFloat(getComputedStyle(R).width)));
771
+ _.observe(v);
772
+ const x = document.createElement("div");
773
+ x.setAttribute("aria-hidden", "true"), x.style.cssText = "position:absolute;visibility:hidden;pointer-events:none;width:1rem;height:0", u.appendChild(x);
774
+ const P = () => e.setFontScale(nn(parseFloat(getComputedStyle(x).width)));
770
775
  P();
771
776
  const G = new ResizeObserver(P);
772
- G.observe(R);
777
+ G.observe(x);
773
778
  const tt = (K) => e.wheel(K);
774
779
  u.addEventListener("wheel", tt, { passive: !1 });
775
- const ge = (K) => e.touchMove(K);
776
- u.addEventListener("touchmove", ge, { passive: !1 });
777
- const ke = (K) => {
780
+ const ve = (K) => e.touchMove(K);
781
+ u.addEventListener("touchmove", ve, { passive: !1 });
782
+ const ye = (K) => {
778
783
  K.key === "Escape" && e.cancelEdit() && K.preventDefault();
779
784
  };
780
- return window.addEventListener("keydown", ke), () => {
781
- window.removeEventListener("keydown", ke), u.removeEventListener("wheel", tt), u.removeEventListener("touchmove", ge), _.disconnect(), G.disconnect(), R.remove(), e.unbind();
785
+ return window.addEventListener("keydown", ye), () => {
786
+ window.removeEventListener("keydown", ye), u.removeEventListener("wheel", tt), u.removeEventListener("touchmove", ve), _.disconnect(), G.disconnect(), x.remove(), e.unbind();
782
787
  };
783
788
  }, [e]);
784
- const k = Ye(e.subscribe, e.getSnapshot, e.getServerSnapshot), { fontScale: it } = k, It = $n * it, fs = Rn * it, ms = xn * it, ps = (u, y) => {
789
+ const k = ze(e.subscribe, e.getSnapshot, e.getServerSnapshot), { fontScale: rt } = k, Ct = Vn * rt, ws = qn * rt, vs = zn * rt, ys = (u, v) => {
785
790
  const S = new Date(u);
786
- return y >= ms ? Y.dateLong(S) : y >= fs ? Y.date(S) : y >= It ? Y.dateShort(S) : "";
787
- }, gs = k.days.reduce((u, y) => Math.max(u, y.width), 0), Z = Qs(gs, It), ce = k.step >= U ? Z : 1, b = k.ghost, Q = k.spoken, Lt = k.summary, ue = (u) => `${Y.dateShort(new Date(u))} ${Y.time(new Date(u), !1)}`, At = (u) => `${Mt}-row-${encodeURIComponent(u.key)}`, ks = W(() => {
791
+ return v >= vs ? H.dateLong(S) : v >= ws ? H.date(S) : v >= Ct ? H.dateShort(S) : "";
792
+ }, bs = k.days.reduce((u, v) => Math.max(u, v.width), 0), J = dn(bs, Ct), me = k.step >= j ? J : 1, b = k.ghost, Q = k.spoken, Dt = k.summary, pe = (u) => `${H.dateShort(new Date(u))} ${et(H, u)}`, _t = (u) => `${It}-row-${encodeURIComponent(u.key)}`, Ms = z(() => {
788
793
  const u = /* @__PURE__ */ new Map();
789
- for (const y of k.headers)
790
- for (const S of y.within)
791
- y.kind === "groupHead" && S === y.group || u.set(S, [...u.get(S) ?? [], At(y)]);
794
+ for (const v of k.headers)
795
+ for (const S of v.within)
796
+ v.kind === "groupHead" && S === v.group || u.set(S, [...u.get(S) ?? [], _t(v)]);
792
797
  return u;
793
- }, [k.headers, Mt]), fe = V(null);
794
- pt(() => {
795
- const u = fe.current;
798
+ }, [k.headers, It]), ge = V(null);
799
+ wt(() => {
800
+ const u = ge.current;
796
801
  if (u === null) return;
797
- let y = !0;
802
+ let v = !0;
798
803
  const S = () => {
799
- if (!y) return;
804
+ if (!v) return;
800
805
  const _ = [...u.querySelectorAll("[data-lane-count]")];
801
806
  for (const P of _) P.hidden = !1;
802
- const R = _.some((P) => {
807
+ const x = _.some((P) => {
803
808
  const G = P.previousElementSibling;
804
809
  if (!(G instanceof HTMLElement)) return !1;
805
810
  const tt = parseFloat(getComputedStyle(G).lineHeight);
806
811
  return G.scrollWidth > G.clientWidth || G.clientHeight > tt * 1.5;
807
812
  });
808
- for (const P of _) P.hidden = R;
813
+ for (const P of _) P.hidden = x;
809
814
  };
810
815
  S(), document.fonts?.ready.then(S);
811
- const E = new ResizeObserver(S);
812
- E.observe(u);
816
+ const $ = new ResizeObserver(S);
817
+ $.observe(u);
813
818
  const C = new MutationObserver(S);
814
819
  return C.observe(u, { childList: !0, characterData: !0, subtree: !0 }), () => {
815
- y = !1, E.disconnect(), C.disconnect();
820
+ v = !1, $.disconnect(), C.disconnect();
816
821
  };
817
822
  }, []);
818
- const vs = W(() => new Set(b?.refusedLanes ?? []), [b?.refusedLanes]), me = V(null), [Ct, ys] = at({ x: 0, y: 0, at: "" }), Dt = b === null ? "" : `${b.x}:${b.y}:${b.from}:${b.to}:${b.overlap}:${b.violated}:${b.refused}:${b.blocked}`;
819
- pt(() => {
820
- const u = me.current;
823
+ const Ts = z(() => new Set(b?.refusedLanes ?? []), [b?.refusedLanes]), ke = V(null), [Ot, Ss] = dt({ x: 0, y: 0, at: "" }), Ft = b === null ? "" : `${b.x}:${b.y}:${b.from}:${b.to}:${b.overlap}:${b.violated}:${b.refused}:${b.blocked}`;
824
+ wt(() => {
825
+ const u = ke.current;
821
826
  if (b === null || u === null) return;
822
- const y = 4, S = b.y - u.offsetHeight - y, E = b.y + b.height + y, C = {
827
+ const v = 4, S = b.y - u.offsetHeight - v, $ = b.y + b.height + v, C = {
823
828
  x: Math.max(2, Math.min(b.x, k.width - u.offsetWidth - 2)),
824
- y: S >= 2 ? S : Math.min(E, k.height - u.offsetHeight - 2),
825
- at: Dt
829
+ y: S >= 2 ? S : Math.min($, k.height - u.offsetHeight - 2),
830
+ at: Ft
826
831
  };
827
- ys((_) => _.x === C.x && _.y === C.y && _.at === C.at ? _ : C);
828
- }, [b, Dt, k.width, k.height]);
829
- const pe = V(null), [_t, ws] = at({ x: 0, y: 0, at: "" }), z = k.tooltip, Ot = z === null ? "" : `${z.x}:${z.y}:${z.target.kind}`;
830
- return pt(() => {
831
- const u = pe.current;
832
- if (z === null || u === null) return;
833
- const y = 12, S = (C, _, R) => {
834
- const P = C + y, G = C - y - _, tt = P + _ <= R - 4 || G < 4 ? P : G;
835
- return Math.max(4, Math.min(tt, R - _ - 4));
836
- }, E = {
837
- x: S(z.x, u.offsetWidth, k.width),
838
- y: S(z.y, u.offsetHeight, k.height),
839
- at: Ot
832
+ Ss((_) => _.x === C.x && _.y === C.y && _.at === C.at ? _ : C);
833
+ }, [b, Ft, k.width, k.height]);
834
+ const we = V(null), [$t, Is] = dt({ x: 0, y: 0, at: "" }), W = k.tooltip, Et = W === null ? "" : `${W.x}:${W.y}:${W.target.kind}`;
835
+ return wt(() => {
836
+ const u = we.current;
837
+ if (W === null || u === null) return;
838
+ const v = 12, S = (C, _, x) => {
839
+ const P = C + v, G = C - v - _, tt = P + _ <= x - 4 || G < 4 ? P : G;
840
+ return Math.max(4, Math.min(tt, x - _ - 4));
841
+ }, $ = {
842
+ x: S(W.x, u.offsetWidth, k.width),
843
+ y: S(W.y, u.offsetHeight, k.height),
844
+ at: Et
840
845
  };
841
- ws((C) => C.x === E.x && C.y === E.y && C.at === E.at ? C : E);
842
- }, [z, Ot, k.width, k.height]), /* @__PURE__ */ N(Ve, { value: e, children: [
843
- /* @__PURE__ */ N(
846
+ Is((C) => C.x === $.x && C.y === $.y && C.at === $.at ? C : $);
847
+ }, [W, Et, k.width, k.height]), /* @__PURE__ */ B(Xe, { value: e, children: [
848
+ /* @__PURE__ */ B(
844
849
  "div",
845
850
  {
846
- ...hs,
847
- ref: St,
851
+ ...ps,
852
+ ref: At,
848
853
  role: "figure",
849
- ...ee,
850
- className: ft ? `${p.root} ${ft}` : p.root,
851
- style: { ...r === void 0 ? { height: "100%", minHeight: 400 } : { height: `${r}px` }, gridTemplateColumns: `min(${l}px, 40%) minmax(0, 1fr)`, ...mt },
854
+ ...ie,
855
+ className: pt ? `${p.root} ${pt}` : p.root,
856
+ style: { ...r === void 0 ? { height: "100%", minHeight: 400 } : { height: `${r}px` }, gridTemplateColumns: `min(${l}px, 40%) minmax(0, 1fr)`, ...gt },
852
857
  children: [
853
- /* @__PURE__ */ m("div", { className: p.corner }),
854
- /* @__PURE__ */ m("div", { className: p.dayBand, "aria-hidden": "true", "data-schedule-days": "", "data-schedule-clip": "day band", children: k.days.map((u, y) => {
855
- const S = Z === 1 || y === 0 || Rt(u.start, Z), E = Z === 1 ? u.x + u.width : k.days.slice(y + 1).find((R) => Rt(R.start, Z))?.x ?? k.width, C = Math.max(0, -u.x), _ = Math.min(E, k.width) - Math.max(u.x, 0);
856
- return /* @__PURE__ */ m("span", { className: p.day, style: { left: `${u.x}px`, width: `${S ? E - u.x : u.width}px` }, children: /* @__PURE__ */ m("span", { className: p.dayLabel, "data-schedule-overlay": "day label", style: { marginLeft: `${C}px` }, children: S ? ps(u.start, Z === 1 ? _ : Math.min(_, It)) : "" }) }, u.start);
858
+ /* @__PURE__ */ m("div", { className: p.corner, children: kt !== null && /* @__PURE__ */ m("span", { className: p.zoneLabel, "data-schedule-overlay": "zone label", children: kt }) }),
859
+ /* @__PURE__ */ m("div", { className: p.dayBand, "aria-hidden": "true", "data-schedule-days": "", "data-schedule-clip": "day band", children: k.days.map((u, v) => {
860
+ const S = J === 1 || v === 0 || Bt(u.start, J, ot), $ = J === 1 ? u.x + u.width : k.days.slice(v + 1).find((x) => Bt(x.start, J, ot))?.x ?? k.width, C = Math.max(0, -u.x), _ = Math.min($, k.width) - Math.max(u.x, 0);
861
+ return /* @__PURE__ */ m("span", { className: p.day, style: { left: `${u.x}px`, width: `${S ? $ - u.x : u.width}px` }, children: /* @__PURE__ */ m("span", { className: p.dayLabel, "data-schedule-overlay": "day label", style: { marginLeft: `${C}px` }, children: S ? ys(u.start, J === 1 ? _ : Math.min(_, Ct)) : "" }) }, u.start);
857
862
  }) }),
858
- /* @__PURE__ */ m("div", { ref: fe, className: p.headers, "data-schedule-headers": "", children: /* @__PURE__ */ N("div", { className: p.headerRun, style: { transform: `translateY(${-k.scrollY}px)` }, children: [
859
- X && k.headers.length === 0 && Array.from({ length: Math.floor(k.height / Math.round(a * it)) }, (u, y) => /* @__PURE__ */ m("div", { className: p.header, style: { height: `${Math.round(a * it)}px` }, children: /* @__PURE__ */ m(_s, { width: "60%" }) }, y)),
860
- k.headers.map((u) => /* @__PURE__ */ N(
863
+ /* @__PURE__ */ m("div", { ref: ge, className: p.headers, "data-schedule-headers": "", children: /* @__PURE__ */ B("div", { className: p.headerRun, style: { transform: `translateY(${-k.scrollY}px)` }, children: [
864
+ U && k.headers.length === 0 && Array.from({ length: Math.floor(k.height / Math.round(a * rt)) }, (u, v) => /* @__PURE__ */ m("div", { className: p.header, style: { height: `${Math.round(a * rt)}px` }, children: /* @__PURE__ */ m(Ns, { width: "60%" }) }, v)),
865
+ k.headers.map((u) => /* @__PURE__ */ B(
861
866
  "div",
862
867
  {
863
- id: At(u),
868
+ id: _t(u),
864
869
  className: p.header,
865
870
  style: { height: `${u.height}px`, paddingLeft: `calc(var(--u-space-3) + ${u.depth} * var(--u-space-3))` },
866
871
  "data-lane": u.lane,
867
872
  "data-group": u.group,
868
873
  "data-row": u.kind,
869
874
  "data-schedule-clip": `header ${u.kind}`,
870
- "data-refused": u.lane !== void 0 && vs.has(u.lane) ? "" : void 0,
875
+ "data-refused": u.lane !== void 0 && Ts.has(u.lane) ? "" : void 0,
871
876
  children: [
872
877
  u.kind !== "lane" && u.group !== void 0 && /* @__PURE__ */ m(
873
878
  "button",
@@ -876,38 +881,38 @@ function Bn(s) {
876
881
  className: p.chevron,
877
882
  "data-schedule-overlay": "fold control",
878
883
  "aria-expanded": u.collapsed === !1,
879
- "aria-controls": (ks.get(u.group) ?? [At(u)]).join(" "),
880
- "aria-label": `${u.collapsed === !0 ? B.scheduleUnfoldGroup : B.scheduleFoldGroup}: ${typeof u.label == "string" ? u.label : u.group}`,
884
+ "aria-controls": (Ms.get(u.group) ?? [_t(u)]).join(" "),
885
+ "aria-label": `${u.collapsed === !0 ? N.scheduleUnfoldGroup : N.scheduleFoldGroup}: ${typeof u.label == "string" ? u.label : u.group}`,
881
886
  onClick: () => e.toggleGroup(u.group),
882
- children: /* @__PURE__ */ m(Os, { size: 9, "data-open": u.collapsed === !1 ? "" : void 0 })
887
+ children: /* @__PURE__ */ m(Bs, { size: 9, "data-open": u.collapsed === !1 ? "" : void 0 })
883
888
  }
884
889
  ),
885
890
  /* @__PURE__ */ m("span", { className: p.headerLabel, "data-schedule-overlay": "header label", children: u.label }),
886
- u.kind !== "lane" && /* @__PURE__ */ m("span", { className: p.headerCount, "data-schedule-overlay": "lane count", "data-lane-count": u.lanes, children: B.scheduleLaneCount(u.lanes) })
891
+ u.kind !== "lane" && /* @__PURE__ */ m("span", { className: p.headerCount, "data-schedule-overlay": "lane count", "data-lane-count": u.lanes, children: N.scheduleLaneCount(u.lanes) })
887
892
  ]
888
893
  },
889
894
  u.key
890
895
  ))
891
896
  ] }) }),
892
- /* @__PURE__ */ N(
897
+ /* @__PURE__ */ B(
893
898
  "div",
894
899
  {
895
- ref: se,
900
+ ref: oe,
896
901
  className: p.plot,
897
902
  "data-schedule-plot": "",
898
903
  "data-schedule-clip": "plot",
899
904
  style: { cursor: k.cursor },
900
- "aria-busy": X || void 0,
905
+ "aria-busy": U || void 0,
901
906
  "data-stale": k.loading && k.headers.length > 0 || void 0,
902
907
  tabIndex: 0,
903
908
  role: "application",
904
- "aria-roledescription": B.scheduleRoleDescription,
905
- ...ee,
906
- "aria-describedby": o ? `${Tt} ${o}` : Tt,
909
+ "aria-roledescription": N.scheduleRoleDescription,
910
+ ...ie,
911
+ "aria-describedby": o ? `${Lt} ${o}` : Lt,
907
912
  onKeyDown: (u) => {
908
913
  e.key(u.nativeEvent) && u.preventDefault();
909
914
  },
910
- onFocus: (u) => e.focus(Nn(u.currentTarget)),
915
+ onFocus: (u) => e.focus(Un(u.currentTarget)),
911
916
  onBlur: () => e.blur(),
912
917
  onPointerDown: (u) => e.pointerDown(u.nativeEvent),
913
918
  onPointerMove: (u) => e.pointerMove(u.nativeEvent),
@@ -918,12 +923,12 @@ function Bn(s) {
918
923
  onDragOver: (u) => e.dragOver(u.nativeEvent),
919
924
  onDrop: (u) => e.drop(u.nativeEvent),
920
925
  onDragLeave: (u) => {
921
- const y = u.nativeEvent.relatedTarget;
922
- (!(y instanceof Node) || !u.currentTarget.contains(y)) && e.dragLeave();
926
+ const v = u.nativeEvent.relatedTarget;
927
+ (!(v instanceof Node) || !u.currentTarget.contains(v)) && e.dragLeave();
923
928
  },
924
929
  children: [
925
- /* @__PURE__ */ m("canvas", { ref: ne, className: p.layer, "aria-hidden": "true" }),
926
- /* @__PURE__ */ m("canvas", { ref: ie, className: p.layer, "aria-hidden": "true" }),
930
+ /* @__PURE__ */ m("canvas", { ref: re, className: p.layer, "aria-hidden": "true" }),
931
+ /* @__PURE__ */ m("canvas", { ref: ae, className: p.layer, "aria-hidden": "true" }),
927
932
  k.grips.map((u) => /* @__PURE__ */ m(
928
933
  "span",
929
934
  {
@@ -951,23 +956,23 @@ function Bn(s) {
951
956
  O !== !1 && k.tooltip !== null && /* @__PURE__ */ m(
952
957
  "span",
953
958
  {
954
- ref: pe,
959
+ ref: we,
955
960
  role: "tooltip",
956
961
  className: p.tooltip,
957
962
  "data-schedule-tooltip": "",
958
963
  "data-schedule-overlay": "tooltip",
959
964
  style: {
960
- left: `${_t.x}px`,
961
- top: `${_t.y}px`,
962
- visibility: _t.at === Ot ? void 0 : "hidden"
965
+ left: `${$t.x}px`,
966
+ top: `${$t.y}px`,
967
+ visibility: $t.at === Et ? void 0 : "hidden"
963
968
  },
964
- children: typeof O == "function" ? O(k.tooltip.target) : /* @__PURE__ */ m(On, { target: k.tooltip.target })
969
+ children: typeof O == "function" ? O(k.tooltip.target) : /* @__PURE__ */ m(Hn, { target: k.tooltip.target })
965
970
  }
966
971
  ),
967
- b !== null && /* @__PURE__ */ N(
972
+ b !== null && /* @__PURE__ */ B(
968
973
  "span",
969
974
  {
970
- ref: me,
975
+ ref: ke,
971
976
  className: p.ghostLabel,
972
977
  "data-ghost": "",
973
978
  "data-schedule-overlay": "ghost label",
@@ -975,16 +980,16 @@ function Bn(s) {
975
980
  "data-refused": b.refused ? "" : void 0,
976
981
  "data-blocked": b.blocked ? "" : void 0,
977
982
  style: {
978
- left: `${Ct.x}px`,
979
- top: `${Ct.y}px`,
980
- visibility: Ct.at === Dt ? void 0 : "hidden"
983
+ left: `${Ot.x}px`,
984
+ top: `${Ot.y}px`,
985
+ visibility: Ot.at === Ft ? void 0 : "hidden"
981
986
  },
982
987
  children: [
983
- B.scheduleGhostTimes(Y.time(new Date(b.from), !1), Y.time(new Date(b.to), !1)),
984
- b.refused && /* @__PURE__ */ m("span", { className: p.refusal, children: B.scheduleLaneRefused }),
985
- b.blocked && /* @__PURE__ */ m("span", { className: p.refusal, children: B.scheduleBlockedTime }),
986
- b.overlap && /* @__PURE__ */ m("span", { className: p.finding, children: B.scheduleOverlap }),
987
- b.violated && /* @__PURE__ */ m("span", { className: p.finding, children: B.scheduleViolatedDependency })
988
+ N.scheduleGhostTimes(et(H, b.from), et(H, b.to)),
989
+ b.refused && /* @__PURE__ */ m("span", { className: p.refusal, children: N.scheduleLaneRefused }),
990
+ b.blocked && /* @__PURE__ */ m("span", { className: p.refusal, children: N.scheduleBlockedTime }),
991
+ b.overlap && /* @__PURE__ */ m("span", { className: p.finding, children: N.scheduleOverlap }),
992
+ b.violated && /* @__PURE__ */ m("span", { className: p.finding, children: N.scheduleViolatedDependency })
988
993
  ]
989
994
  }
990
995
  ),
@@ -993,68 +998,68 @@ function Bn(s) {
993
998
  }
994
999
  ),
995
1000
  /* @__PURE__ */ m("div", { className: p.corner }),
996
- /* @__PURE__ */ N("div", { className: p.tickBand, "aria-hidden": "true", "data-schedule-ticks": "", "data-schedule-clip": "time band", children: [
1001
+ /* @__PURE__ */ B("div", { className: p.tickBand, "aria-hidden": "true", "data-schedule-ticks": "", "data-schedule-clip": "time band", children: [
997
1002
  k.now !== null && /* @__PURE__ */ m("span", { className: p.now, "data-now": "", "data-schedule-overlay": "now mark", style: { left: `${k.now}px` } }),
998
- k.ticks.map((u) => /* @__PURE__ */ m("span", { className: p.tick, style: { left: `${u.x}px` }, children: u.x >= Le && u.x <= k.width - Le && (ce === 1 || Rt(u.wallClock, ce)) && /* @__PURE__ */ m("span", { className: p.tickLabel, "data-schedule-overlay": "time label", children: k.step >= U ? Y.dateShort(new Date(u.wallClock)) : Y.time(new Date(u.wallClock), !1) }) }, u.wallClock))
1003
+ k.ticks.map((u) => /* @__PURE__ */ m("span", { className: p.tick, style: { left: `${u.x}px` }, children: u.x >= De && u.x <= k.width - De && (me === 1 || Bt(u.wallClock, me, ot)) && /* @__PURE__ */ m("span", { className: p.tickLabel, "data-schedule-overlay": "time label", children: k.step >= j ? H.dateShort(new Date(u.wallClock)) : et(H, u.wallClock) }) }, u.wallClock))
999
1004
  ] }),
1000
- /* @__PURE__ */ m(ve, { "aria-live": "polite", children: Q !== null && /* @__PURE__ */ m(
1001
- _n,
1005
+ /* @__PURE__ */ m(be, { "aria-live": "polite", children: Q !== null && /* @__PURE__ */ m(
1006
+ Gn,
1002
1007
  {
1003
1008
  target: Q.target,
1004
1009
  lane: Q.lane === null ? null : e.data.lanes.find((u) => u.id === Q.lane)?.label ?? Q.lane
1005
1010
  },
1006
1011
  Q.count
1007
1012
  ) }),
1008
- /* @__PURE__ */ m(ve, { id: Tt, children: k === e.getServerSnapshot() ? B.scheduleKeyHelp : `${B.scheduleSummary({ ...Lt, from: ue(Lt.from), to: ue(Lt.to) })} ${B.scheduleKeyHelp}` })
1013
+ /* @__PURE__ */ m(be, { id: Lt, children: k === e.getServerSnapshot() ? N.scheduleKeyHelp : `${N.scheduleSummary({ ...Dt, from: pe(Dt.from), to: pe(Dt.to) })}${kt === null ? "" : ` ${kt}.`} ${N.scheduleKeyHelp}` })
1009
1014
  ]
1010
1015
  }
1011
1016
  ),
1012
- ds
1017
+ ms
1013
1018
  ] });
1014
1019
  }
1015
- function Nn(s) {
1020
+ function Un(s) {
1016
1021
  try {
1017
1022
  return s.matches(":focus-visible");
1018
1023
  } catch {
1019
1024
  return !0;
1020
1025
  }
1021
1026
  }
1022
- function Pn({ id: s, label: t }) {
1023
- const e = We(), i = W(() => ({ id: s, label: t ?? s, ...e === null ? {} : { parent: e } }), [s, t, e]);
1024
- return xs(i), null;
1027
+ function Xn({ id: s, label: t }) {
1028
+ const e = Ze(), i = z(() => ({ id: s, label: t ?? s, ...e === null ? {} : { parent: e } }), [s, t, e]);
1029
+ return Vs(i), null;
1025
1030
  }
1026
- function Gn({ id: s, label: t, children: e }) {
1027
- const i = We(), n = W(() => ({ id: s, label: t ?? s, ...i === null ? {} : { parent: i } }), [s, t, i]);
1028
- return Bs(n), /* @__PURE__ */ m(je, { value: s, children: e });
1031
+ function jn({ id: s, label: t, children: e }) {
1032
+ const i = Ze(), n = z(() => ({ id: s, label: t ?? s, ...i === null ? {} : { parent: i } }), [s, t, i]);
1033
+ return qs(n), /* @__PURE__ */ m(je, { value: s, children: e });
1029
1034
  }
1030
- function Hn({ data: s, tasks: t }) {
1031
- const e = W(() => ({ kind: "subtasks", data: s, tasks: t }), [s, t]);
1032
- return bt("Subtasks", e), null;
1035
+ function Zn({ data: s, tasks: t }) {
1036
+ const e = z(() => ({ kind: "subtasks", data: s, tasks: t }), [s, t]);
1037
+ return St("Subtasks", e), null;
1033
1038
  }
1034
- function Yn({ data: s }) {
1035
- const t = W(() => ({ kind: "dependencies", data: s }), [s]);
1036
- return bt("Dependencies", t), null;
1039
+ function Jn({ data: s }) {
1040
+ const t = z(() => ({ kind: "dependencies", data: s }), [s]);
1041
+ return St("Dependencies", t), null;
1037
1042
  }
1038
- function Kn({ data: s }) {
1039
- const t = W(() => ({ kind: "blocked", data: s }), [s]);
1040
- return bt("BlockedTimes", t), null;
1043
+ function Qn({ data: s }) {
1044
+ const t = z(() => ({ kind: "blocked", data: s }), [s]);
1045
+ return St("BlockedTimes", t), null;
1041
1046
  }
1042
- function Vn({ data: s }) {
1043
- const t = W(() => ({ kind: "milestones", data: s }), [s]);
1044
- return bt("Milestones", t), null;
1047
+ function ti({ data: s }) {
1048
+ const t = z(() => ({ kind: "milestones", data: s }), [s]);
1049
+ return St("Milestones", t), null;
1045
1050
  }
1046
- function jn() {
1051
+ function ei() {
1047
1052
  try {
1048
1053
  return process.env.NODE_ENV !== "production";
1049
1054
  } catch {
1050
1055
  return !1;
1051
1056
  }
1052
1057
  }
1053
- const es = jn(), Ae = /* @__PURE__ */ new Set();
1054
- function ot(s, t) {
1055
- !es || Ae.has(s) || (Ae.add(s), console.warn(`@umriss-ui/schedule: ${t}`));
1058
+ const rs = ei(), _e = /* @__PURE__ */ new Set();
1059
+ function at(s, t) {
1060
+ !rs || _e.has(s) || (_e.add(s), console.warn(`@umriss-ui/schedule: ${t}`));
1056
1061
  }
1057
- class Wn {
1062
+ class si {
1058
1063
  /** `changed` is called after every registration change. */
1059
1064
  constructor(t) {
1060
1065
  this.changed = t;
@@ -1126,7 +1131,7 @@ class Wn {
1126
1131
  this.subtasks.push(...e.data);
1127
1132
  for (const i of e.tasks) this.tasks.set(i.id, i);
1128
1133
  } else e.kind === "dependencies" ? this.dependencies.push(...e.data) : e.kind === "milestones" ? this.milestones.push(...e.data) : this.blocked.push(...e.data);
1129
- return this.subtaskById = new Map(this.subtasks.map((e) => [e.id, e])), this.overlaps = Xt(this.subtasks), this.violatedById = new Map(qt(this.subtasks, this.dependencies).map((e) => [e.dependency, e])), this.depth = Es(this.subtasks), this.inBlocked = Ke(this.subtasks, this.blocked), this.warnOfMalformedData(), !0;
1134
+ return this.subtaskById = new Map(this.subtasks.map((e) => [e.id, e])), this.overlaps = Jt(this.subtasks), this.violatedById = new Map(Qt(this.subtasks, this.dependencies).map((e) => [e.dependency, e])), this.depth = Hs(this.subtasks), this.inBlocked = Ue(this.subtasks, this.blocked), this.warnOfMalformedData(), !0;
1130
1135
  }
1131
1136
  /** Says in development what the data gets wrong and is drawn, dropped or
1132
1137
  counted regardless. It runs here, once the parts have registered, so a
@@ -1134,28 +1139,28 @@ class Wn {
1134
1139
  the lanes are still on their way, and an empty `tasks` is a plan drawn
1135
1140
  muted on purpose. */
1136
1141
  warnOfMalformedData() {
1137
- if (!es) return;
1142
+ if (!rs) return;
1138
1143
  const t = (n, o) => {
1139
1144
  const r = /* @__PURE__ */ new Set();
1140
1145
  for (const a of o)
1141
- r.has(a) && ot(`twice:${n}:${a}`, `the ${n} id "${a}" stands twice; give each ${n} an id of its own, or only the first is found.`), r.add(a);
1146
+ r.has(a) && at(`twice:${n}:${a}`, `the ${n} id "${a}" stands twice; give each ${n} an id of its own, or only the first is found.`), r.add(a);
1142
1147
  };
1143
1148
  t("subtask", this.subtasks.map((n) => n.id)), t("dependency", this.dependencies.map((n) => n.id)), t("lane", this.lanes.map((n) => n.id));
1144
1149
  for (const n of this.subtasks)
1145
- n.to > n.from || ot(`span:${n.id}`, `subtask "${n.id}" does not end after it starts (from ${n.from}, to ${n.to}); a point in time is a Milestone, and a span with no length is drawn as a hairline.`);
1150
+ n.to > n.from || at(`span:${n.id}`, `subtask "${n.id}" does not end after it starts (from ${n.from}, to ${n.to}); a point in time is a Milestone, and a span with no length is drawn as a hairline.`);
1146
1151
  for (const n of this.layers) {
1147
1152
  if (n.kind !== "subtasks" || n.tasks.length === 0) continue;
1148
1153
  const o = new Set(n.tasks.map((r) => r.id));
1149
1154
  for (const r of n.data)
1150
- o.has(r.task) || ot(`task:${r.id}`, `subtask "${r.id}" names the task "${r.task}", which is not among the tasks of its Subtasks layer; it is drawn muted. Add the task, or correct the subtask's task.`);
1155
+ o.has(r.task) || at(`task:${r.id}`, `subtask "${r.id}" names the task "${r.task}", which is not among the tasks of its Subtasks layer; it is drawn muted. Add the task, or correct the subtask's task.`);
1151
1156
  }
1152
1157
  for (const n of this.dependencies)
1153
1158
  for (const o of [n.from, n.to])
1154
- this.subtaskById.has(o) || ot(`end:${n.id}:${o}`, `dependency "${n.id}" names the subtask "${o}", and no subtask has that id; the dependency is left out.`);
1159
+ this.subtaskById.has(o) || at(`end:${n.id}:${o}`, `dependency "${n.id}" names the subtask "${o}", and no subtask has that id; the dependency is left out.`);
1155
1160
  if (this.lanes.length === 0) return;
1156
1161
  const e = new Set(this.lanes.map((n) => n.id)), i = (n, o) => {
1157
1162
  for (const { id: r, lane: a } of o)
1158
- e.has(a) || ot(`lane:${n}:${r}`, `${n} "${r}" is on the lane "${a}", which no Lane declares; it is left out. Declare <Lane id="${a}" />.`);
1163
+ e.has(a) || at(`lane:${n}:${r}`, `${n} "${r}" is on the lane "${a}", which no Lane declares; it is left out. Declare <Lane id="${a}" />.`);
1159
1164
  };
1160
1165
  i("subtask", this.subtasks), i("milestone", this.milestones), i("blocked time", this.blocked);
1161
1166
  }
@@ -1183,60 +1188,60 @@ class Wn {
1183
1188
  };
1184
1189
  }
1185
1190
  }
1186
- const zn = 6;
1187
- function ss(s, t, e, i, n, o) {
1191
+ const ni = 6;
1192
+ function as(s, t, e, i, n, o) {
1188
1193
  s.save(), s.beginPath(), s.rect(t, e, i, n), s.clip(), s.globalAlpha = 0.35, s.strokeStyle = o, s.lineWidth = 1, s.beginPath();
1189
- for (let r = t - n; r < t + i + n; r += zn)
1194
+ for (let r = t - n; r < t + i + n; r += ni)
1190
1195
  s.moveTo(r, e + n), s.lineTo(r + n, e);
1191
1196
  s.stroke(), s.restore();
1192
1197
  }
1193
- function Un(s, t, e, i) {
1198
+ function ii(s, t, e, i) {
1194
1199
  if (i.size === 0) return;
1195
1200
  const { width: n, height: o } = t.view;
1196
1201
  for (const r of i) {
1197
- const a = J(e, r);
1202
+ const a = Z(e, r);
1198
1203
  if (a === null) continue;
1199
1204
  const { top: l, height: d } = a;
1200
- l + d < 0 || l > o || (s.globalAlpha = 0.6, s.fillStyle = t.colours.surface, s.fillRect(0, l, n, d), s.globalAlpha = 1, ss(s, 0, l, n, d, t.colours.muted));
1205
+ l + d < 0 || l > o || (s.globalAlpha = 0.6, s.fillStyle = t.colours.surface, s.fillRect(0, l, n, d), s.globalAlpha = 1, as(s, 0, l, n, d, t.colours.muted));
1201
1206
  }
1202
1207
  }
1203
- function Xn(s, t, e) {
1208
+ function oi(s, t, e) {
1204
1209
  const { data: i } = t;
1205
1210
  if (i.violatedById.size !== 0)
1206
1211
  for (const n of i.violatedById.values()) {
1207
1212
  const o = i.dependencies.find((c) => c.id === n.dependency), r = o === void 0 ? void 0 : i.subtaskById.get(o.to);
1208
1213
  if (r === void 0) continue;
1209
- const a = J(e, r.lane);
1214
+ const a = Z(e, r.lane);
1210
1215
  if (a === null || !a.miniature) continue;
1211
- const l = st(e.rows, a.top + e.scrollY);
1216
+ const l = nt(e.rows, a.top + e.scrollY);
1212
1217
  if (l === null) continue;
1213
- const d = $(e, n.arrival), h = Math.max(d + 2, $(e, n.arrival + n.shortBy));
1214
- Gt(s, t, d, h, l.top - e.scrollY + 1, 3);
1218
+ const d = E(e, n.arrival), h = Math.max(d + 2, E(e, n.arrival + n.shortBy));
1219
+ Vt(s, t, d, h, l.top - e.scrollY + 1, 3);
1215
1220
  }
1216
1221
  }
1217
- function Gt(s, t, e, i, n, o) {
1222
+ function Vt(s, t, e, i, n, o) {
1218
1223
  if (!t.colours.forced) {
1219
1224
  s.fillStyle = t.colours.alarm, s.fillRect(e, n, i - e, o);
1220
1225
  return;
1221
1226
  }
1222
1227
  s.strokeStyle = t.colours.alarm, s.lineWidth = o, s.setLineDash([4, 3]), s.beginPath(), s.moveTo(e, n + o / 2), s.lineTo(i, n + o / 2), s.stroke(), s.setLineDash([]);
1223
1228
  }
1224
- function qn(s, t, e, i) {
1225
- const n = J(e, i.lane);
1229
+ function ri(s, t, e, i) {
1230
+ const n = Z(e, i.lane);
1226
1231
  if (n === null || n.top + n.height < 0 || n.top > t.view.height) return;
1227
- const o = Math.max(0, $(e, i.from)), r = Math.min(t.view.width, $(e, i.to));
1228
- r <= o || (s.globalAlpha = 0.1, s.fillStyle = t.colours.muted, s.fillRect(o, n.top, r - o, n.height), s.globalAlpha = 1, ss(s, o, n.top, r - o, n.height, t.colours.muted));
1232
+ const o = Math.max(0, E(e, i.from)), r = Math.min(t.view.width, E(e, i.to));
1233
+ r <= o || (s.globalAlpha = 0.1, s.fillStyle = t.colours.muted, s.fillRect(o, n.top, r - o, n.height), s.globalAlpha = 1, as(s, o, n.top, r - o, n.height, t.colours.muted));
1229
1234
  }
1230
- function Ht(s, t, e, i) {
1231
- const n = J(e, i.lane);
1235
+ function qt(s, t, e, i) {
1236
+ const n = Z(e, i.lane);
1232
1237
  if (n === null) return;
1233
- const o = $(e, i.from), r = Math.max(o + 2, $(e, i.to));
1234
- if (s.fillStyle = t.colours.alarm, s.globalAlpha = 0.14, s.fillRect(o, n.top + 1, r - o, Math.max(1, n.height - 2)), s.globalAlpha = 1, Gt(s, t, o, r, n.top + 1, Math.min(3, Math.max(1, n.height - 1))), n.miniature) {
1235
- const a = st(e.rows, n.top + e.scrollY);
1236
- a !== null && Gt(s, t, o, r, a.top - e.scrollY + 1, 3);
1238
+ const o = E(e, i.from), r = Math.max(o + 2, E(e, i.to));
1239
+ if (s.fillStyle = t.colours.alarm, s.globalAlpha = 0.14, s.fillRect(o, n.top + 1, r - o, Math.max(1, n.height - 2)), s.globalAlpha = 1, Vt(s, t, o, r, n.top + 1, Math.min(3, Math.max(1, n.height - 1))), n.miniature) {
1240
+ const a = nt(e.rows, n.top + e.scrollY);
1241
+ a !== null && Vt(s, t, o, r, a.top - e.scrollY + 1, 3);
1237
1242
  }
1238
1243
  }
1239
- const Jn = {
1244
+ const ai = {
1240
1245
  line: "var(--u-hairline)",
1241
1246
  lineStrong: "var(--u-hairline-strong)",
1242
1247
  text: "var(--u-color-text)",
@@ -1250,7 +1255,7 @@ const Jn = {
1250
1255
  /* What text and marks take ON a filled bar - the same token the bar labels
1251
1256
  use in CSS, so a cap and the label beside it are one colour. */
1252
1257
  onAccent: "var(--u-color-on-accent)"
1253
- }, ns = {
1258
+ }, ls = {
1254
1259
  line: "GrayText",
1255
1260
  lineStrong: "CanvasText",
1256
1261
  text: "CanvasText",
@@ -1260,11 +1265,11 @@ const Jn = {
1260
1265
  active: "Highlight",
1261
1266
  now: "GrayText",
1262
1267
  onAccent: "Canvas"
1263
- }, Zn = (s) => s ? ns : Jn, Qn = () => typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(forced-colors: active)").matches;
1264
- function ti(s, t) {
1265
- const e = Qn(), i = {};
1266
- for (const r of t.tasks.values()) i[`task:${r.id}`] = e ? ns.text : r.color;
1267
- const n = Ss(s, { ...Zn(e), ...i }), o = /* @__PURE__ */ new Map();
1268
+ }, li = (s) => s ? ls : ai, di = () => typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(forced-colors: active)").matches;
1269
+ function hi(s, t) {
1270
+ const e = di(), i = {};
1271
+ for (const r of t.tasks.values()) i[`task:${r.id}`] = e ? ls.text : r.color;
1272
+ const n = _s(s, { ...li(e), ...i }), o = /* @__PURE__ */ new Map();
1268
1273
  for (const r of t.tasks.values()) o.set(r.id, n[`task:${r.id}`] ?? r.color);
1269
1274
  return {
1270
1275
  line: n.line,
@@ -1280,89 +1285,89 @@ function ti(s, t) {
1280
1285
  forced: e
1281
1286
  };
1282
1287
  }
1283
- function ct(s) {
1288
+ function ft(s) {
1284
1289
  const t = s.match(/[\d.]+/g);
1285
1290
  return t === null || t.length < 3 ? null : [Number(t[0]), Number(t[1]), Number(t[2])];
1286
1291
  }
1287
- function Ce(s) {
1288
- const t = ct(s);
1289
- return t === null ? 0 : os(is(t));
1292
+ function Oe(s) {
1293
+ const t = ft(s);
1294
+ return t === null ? 0 : hs(ds(t));
1290
1295
  }
1291
- function is(s) {
1296
+ function ds(s) {
1292
1297
  return s.map((t) => {
1293
1298
  const e = t / 255;
1294
1299
  return e <= 0.04045 ? e / 12.92 : ((e + 0.055) / 1.055) ** 2.4;
1295
1300
  });
1296
1301
  }
1297
- function os([s, t, e]) {
1302
+ function hs([s, t, e]) {
1298
1303
  return 0.2126 * s + 0.7152 * t + 0.0722 * e;
1299
1304
  }
1300
- function De(s, t) {
1301
- const e = Ce(s), i = Ce(t);
1305
+ function Fe(s, t) {
1306
+ const e = Oe(s), i = Oe(t);
1302
1307
  return (Math.max(e, i) + 0.05) / (Math.min(e, i) + 0.05);
1303
1308
  }
1304
- function _e(s, t, e) {
1309
+ function $e(s, t, e) {
1305
1310
  if (s === null) return null;
1306
1311
  const i = typeof window > "u" ? 1 : window.devicePixelRatio || 1, n = Math.round(t * i), o = Math.round(e * i);
1307
1312
  s.width !== n && (s.width = n), s.height !== o && (s.height = o);
1308
1313
  const r = s.getContext("2d");
1309
1314
  return r === null ? null : (r.setTransform(i, 0, 0, i, 0, 0), r.clearRect(0, 0, t, e), r);
1310
1315
  }
1311
- function ei(s, t) {
1316
+ function ci(s, t) {
1312
1317
  const { data: e, view: i } = t, n = i.viewport();
1313
- ii(s, t, n);
1314
- for (const o of e.blocked) qn(s, t, n, o);
1315
- oi(s, t);
1318
+ mi(s, t, n);
1319
+ for (const o of e.blocked) ri(s, t, n, o);
1320
+ pi(s, t);
1316
1321
  for (const o of e.layers) {
1317
1322
  if (o.kind === "blocked" || o.kind === "milestones") continue;
1318
1323
  const r = new Set(o.data);
1319
1324
  if (o.kind === "dependencies")
1320
- for (const a of i.paths) r.has(a.dependency) && Vs(a, i.width, i.height) && Yt(s, t, a, !1);
1325
+ for (const a of i.paths) r.has(a.dependency) && Js(a, i.width, i.height) && zt(s, t, a, !1);
1321
1326
  else
1322
- for (const a of i.boxes) r.has(a.subtask) && as(s, t, a, 1);
1327
+ for (const a of i.boxes) r.has(a.subtask) && us(s, t, a, 1);
1323
1328
  }
1324
- for (const o of e.overlaps) Ht(s, t, n, o);
1325
- for (const o of e.inBlocked) Ht(s, t, n, o);
1326
- Xn(s, t, n);
1327
- for (const o of e.milestones) ls(s, t, n, o, !1);
1328
- fi(s, t);
1329
+ for (const o of e.overlaps) qt(s, t, n, o);
1330
+ for (const o of e.inBlocked) qt(s, t, n, o);
1331
+ oi(s, t, n);
1332
+ for (const o of e.milestones) fs(s, t, n, o, !1);
1333
+ Ti(s, t);
1329
1334
  }
1330
- function si(s, t) {
1335
+ function ui(s, t) {
1331
1336
  const { view: e, hover: i } = t, n = e.viewport();
1332
1337
  if (t.ghost === null) {
1333
1338
  if (i.kind === "subtask") {
1334
1339
  const c = e.boxById.get(i.subtask.id);
1335
- c !== void 0 && ci(s, t, c);
1340
+ c !== void 0 && bi(s, t, c);
1336
1341
  } else if (i.kind === "dependency") {
1337
1342
  const c = e.paths.find((f) => f.dependency === i.dependency);
1338
- c !== void 0 && Yt(s, t, c, !0);
1339
- } else i.kind === "milestone" && ls(s, t, n, i.milestone, !0);
1343
+ c !== void 0 && zt(s, t, c, !0);
1344
+ } else i.kind === "milestone" && fs(s, t, n, i.milestone, !0);
1340
1345
  return;
1341
1346
  }
1342
1347
  const o = t.ghost, { ghost: r, overlaps: a, violated: l } = o;
1343
- Un(s, t, n, o.refusedLanes);
1344
- const d = rs(n, r);
1348
+ ii(s, t, n, o.refusedLanes);
1349
+ const d = cs(n, r);
1345
1350
  if (d === null) return;
1346
- for (const c of a) Ht(s, t, n, c);
1351
+ for (const c of a) qt(s, t, n, c);
1347
1352
  const h = new Set(l.map((c) => c.dependency));
1348
1353
  for (const c of t.data.dependencies) {
1349
1354
  if (c.from !== r.id && c.to !== r.id) continue;
1350
1355
  const f = e.boxById.get(c.from === r.id ? c.to : c.from);
1351
1356
  if (f === void 0) continue;
1352
- const g = c.from === r.id ? Nt(n, c, d, f, e.options) : Nt(n, c, f, d, e.options);
1353
- Yt(s, t, g, !0, h.has(c.id));
1357
+ const g = c.from === r.id ? Yt(n, c, d, f, e.options) : Yt(n, c, f, d, e.options);
1358
+ zt(s, t, g, !0, h.has(c.id));
1354
1359
  }
1355
- as(s, { ...t, selectedTask: null }, d, 0.55), s.strokeStyle = t.colours.text, s.lineWidth = 1, s.setLineDash([3, 2]), s.strokeRect(d.outerFrom + 0.5, d.y + 0.5, Math.max(1, d.outerTo - d.outerFrom - 1), d.height - 1), s.setLineDash([]), o.tether !== null && ni(s, t, d, o.tether);
1360
+ us(s, { ...t, selectedTask: null }, d, 0.55), s.strokeStyle = t.colours.text, s.lineWidth = 1, s.setLineDash([3, 2]), s.strokeRect(d.outerFrom + 0.5, d.y + 0.5, Math.max(1, d.outerTo - d.outerFrom - 1), d.height - 1), s.setLineDash([]), o.tether !== null && fi(s, t, d, o.tether);
1356
1361
  }
1357
- function ni(s, t, e, i) {
1362
+ function fi(s, t, e, i) {
1358
1363
  const n = Math.max(e.outerFrom, Math.min(e.outerTo, i.x)), o = Math.max(e.y, Math.min(e.y + e.height, i.y));
1359
1364
  Math.hypot(i.x - n, i.y - o) < 2 || (s.strokeStyle = t.colours.text, s.lineWidth = 1, s.setLineDash([2, 3]), s.beginPath(), s.moveTo(n + 0.5, o + 0.5), s.lineTo(i.x + 0.5, i.y + 0.5), s.stroke(), s.setLineDash([]));
1360
1365
  }
1361
- function rs(s, t) {
1362
- const e = Zt(s.rows, t.lane);
1363
- return e === null ? null : Xe(s, t, e, 0);
1366
+ function cs(s, t) {
1367
+ const e = ee(s.rows, t.lane);
1368
+ return e === null ? null : ts(s, t, e, 0);
1364
1369
  }
1365
- function ii(s, t, e) {
1370
+ function mi(s, t, e) {
1366
1371
  const { view: i, colours: n, bands: o } = t, { width: r, height: a } = i;
1367
1372
  s.lineWidth = 1, s.strokeStyle = n.line, s.beginPath();
1368
1373
  for (const h of o.ticks)
@@ -1381,7 +1386,7 @@ function ii(s, t, e) {
1381
1386
  for (const h of o.days)
1382
1387
  s.moveTo(h.x + 0.5, 0), s.lineTo(h.x + 0.5, a);
1383
1388
  s.stroke();
1384
- const d = Is(i.options.calendar);
1389
+ const d = Os(i.options.calendar);
1385
1390
  if (d.length > 0) {
1386
1391
  s.strokeStyle = n.muted, s.setLineDash([2, 3]), s.beginPath();
1387
1392
  for (const h of d) {
@@ -1391,12 +1396,12 @@ function ii(s, t, e) {
1391
1396
  s.stroke(), s.setLineDash([]);
1392
1397
  }
1393
1398
  }
1394
- function oi(s, t) {
1399
+ function pi(s, t) {
1395
1400
  const e = t.view.nowX();
1396
1401
  e !== null && (s.fillStyle = t.colours.now, s.fillRect(e, 0, 2, t.view.height));
1397
1402
  }
1398
- function ri(s, t, e, i) {
1399
- const n = ut(t.colours, t, e.subtask.task, e.subtask.id);
1403
+ function gi(s, t, e, i) {
1404
+ const n = mt(t.colours, t, e.subtask.task, e.subtask.id);
1400
1405
  s.fillStyle = n;
1401
1406
  for (const [o, r] of [
1402
1407
  [e.outerFrom, e.mainFrom],
@@ -1405,72 +1410,72 @@ function ri(s, t, e, i) {
1405
1410
  r <= o || (s.globalAlpha = 0.28 * i, s.fillRect(o, e.y, r - o, e.height));
1406
1411
  s.globalAlpha = i, s.fillRect(e.mainFrom, e.y, Math.max(1, e.mainTo - e.mainFrom), e.height), s.globalAlpha = 1;
1407
1412
  }
1408
- function te(s, t, e) {
1413
+ function ne(s, t, e) {
1409
1414
  if (s.dashed) return { fill: null, onDark: !1 };
1410
- const i = s.muted ? ai(t, e.surface, 0.5) : t;
1411
- return { fill: i, onDark: De(i, e.onAccent) > De(i, e.text) };
1415
+ const i = s.muted ? ki(t, e.surface, 0.5) : t;
1416
+ return { fill: i, onDark: Fe(i, e.onAccent) > Fe(i, e.text) };
1412
1417
  }
1413
- function ai(s, t, e) {
1414
- const i = ct(s), n = ct(t);
1418
+ function ki(s, t, e) {
1419
+ const i = ft(s), n = ft(t);
1415
1420
  if (i === null || n === null) return s;
1416
1421
  const o = (r) => Math.round(i[r] + (n[r] - i[r]) * e);
1417
1422
  return `rgb(${o(0)}, ${o(1)}, ${o(2)})`;
1418
1423
  }
1419
- function Oe(s, t) {
1420
- const e = ct(s);
1424
+ function Ee(s, t) {
1425
+ const e = ft(s);
1421
1426
  if (e === null || t === 0) return s;
1422
- const i = is(e), n = os(i), [o, r, a] = i.map((l) => {
1427
+ const i = ds(e), n = hs(i), [o, r, a] = i.map((l) => {
1423
1428
  const d = l + (n - l) * t, h = d <= 31308e-7 ? d * 12.92 : 1.055 * d ** (1 / 2.4) - 0.055;
1424
1429
  return Math.round(Math.min(1, Math.max(0, h)) * 255);
1425
1430
  });
1426
1431
  return `rgb(${o}, ${r}, ${a})`;
1427
1432
  }
1428
- function ut(s, t, e, i) {
1433
+ function mt(s, t, e, i) {
1429
1434
  const n = (e === null ? void 0 : s.tasks.get(e)) ?? s.muted;
1430
- return t.selectedTask === null ? n : e !== t.selectedTask ? s.forced ? s.muted : Oe(n, 1) : s.forced || t.selectedSubtask === null || i === null || i === t.selectedSubtask ? n : Oe(n, 0.5);
1435
+ return t.selectedTask === null ? n : e !== t.selectedTask ? s.forced ? s.muted : Ee(n, 1) : s.forced || t.selectedSubtask === null || i === null || i === t.selectedSubtask ? n : Ee(n, 0.5);
1431
1436
  }
1432
- const li = 2;
1433
- function as(s, t, e, i) {
1437
+ const wi = 2;
1438
+ function us(s, t, e, i) {
1434
1439
  const { view: n, colours: o } = t;
1435
- if (!Bt(e, n.width, n.height)) return;
1440
+ if (!Ht(e, n.width, n.height)) return;
1436
1441
  if (e.miniature) {
1437
- ri(s, t, e, i);
1442
+ gi(s, t, e, i);
1438
1443
  return;
1439
1444
  }
1440
- const r = wt(e.subtask.appearance), a = ut(o, t, e.subtask.task, e.subtask.id), l = te(r, a, o), d = e.y, h = e.height, c = Math.max(1, e.mainTo - e.mainFrom), f = l.onDark ? o.onAccent : o.text;
1445
+ const r = Tt(e.subtask.appearance), a = mt(o, t, e.subtask.task, e.subtask.id), l = ne(r, a, o), d = e.y, h = e.height, c = Math.max(1, e.mainTo - e.mainFrom), f = l.onDark ? o.onAccent : o.text;
1441
1446
  s.lineWidth = 1, s.fillStyle = a, s.strokeStyle = a;
1442
- for (const [v, A] of [
1447
+ for (const [w, A] of [
1443
1448
  [e.outerFrom, e.mainFrom],
1444
1449
  [e.mainTo, e.outerTo]
1445
1450
  ])
1446
- A <= v || (s.globalAlpha = 0.28 * i, s.fillRect(v, d, A - v, h), s.globalAlpha = i, s.strokeRect(v + 0.5, d + 0.5, A - v - 1, h - 1));
1451
+ A <= w || (s.globalAlpha = 0.28 * i, s.fillRect(w, d, A - w, h), s.globalAlpha = i, s.strokeRect(w + 0.5, d + 0.5, A - w - 1, h - 1));
1447
1452
  l.fill !== null && (s.globalAlpha = i, s.fillStyle = l.fill, s.fillRect(e.mainFrom, d, c, h));
1448
1453
  const g = e.subtask.progress;
1449
1454
  if (g !== void 0) {
1450
- const v = Math.min(4, Math.max(2, Math.round(h / 6))), A = d + h - v - li, I = Math.round(c * Math.max(0, Math.min(1, g)));
1451
- s.fillStyle = l.fill === null ? a : f, s.globalAlpha = 0.3 * i, s.fillRect(e.mainFrom, A, c, v), s.globalAlpha = i, I > 0 && s.fillRect(e.mainFrom, A, I, v);
1455
+ const w = Math.min(4, Math.max(2, Math.round(h / 6))), A = d + h - w - wi, I = Math.round(c * Math.max(0, Math.min(1, g)));
1456
+ s.fillStyle = l.fill === null ? a : f, s.globalAlpha = 0.3 * i, s.fillRect(e.mainFrom, A, c, w), s.globalAlpha = i, I > 0 && s.fillRect(e.mainFrom, A, I, w);
1452
1457
  }
1453
1458
  if (r.hatched) {
1454
- const v = Math.max(1, Math.min(Ue, Math.floor((c - 2 * rt) / 3))), A = c >= 4 * v ? rt : 0, I = h >= 4 * rt ? rt : 0;
1455
- s.globalAlpha = i, s.fillStyle = f, s.fillRect(e.mainFrom + A, d + I, v, h - 2 * I), s.fillRect(e.mainTo - A - v, d + I, v, h - 2 * I);
1459
+ const w = Math.max(1, Math.min(Qe, Math.floor((c - 2 * lt) / 3))), A = c >= 4 * w ? lt : 0, I = h >= 4 * lt ? lt : 0;
1460
+ s.globalAlpha = i, s.fillStyle = f, s.fillRect(e.mainFrom + A, d + I, w, h - 2 * I), s.fillRect(e.mainTo - A - w, d + I, w, h - 2 * I);
1456
1461
  }
1457
- r.open && hi(s, e, d, h, o.surface, n.width), r.dashed && (s.globalAlpha = i, s.strokeStyle = a, s.setLineDash([4, 3]), s.strokeRect(e.mainFrom + 0.5, d + 0.5, c - 1, h - 1), s.setLineDash([])), s.globalAlpha = 1, e.depth > 0 && i === 1 && (s.strokeStyle = o.surface, s.strokeRect(e.outerFrom - 0.5, d - 0.5, e.outerTo - e.outerFrom + 1, h + 1));
1462
+ r.open && yi(s, e, d, h, o.surface, n.width), r.dashed && (s.globalAlpha = i, s.strokeStyle = a, s.setLineDash([4, 3]), s.strokeRect(e.mainFrom + 0.5, d + 0.5, c - 1, h - 1), s.setLineDash([])), s.globalAlpha = 1, e.depth > 0 && i === 1 && (s.strokeStyle = o.surface, s.strokeRect(e.outerFrom - 0.5, d - 0.5, e.outerTo - e.outerFrom + 1, h + 1));
1458
1463
  }
1459
- const di = 16;
1460
- function hi(s, t, e, i, n, o) {
1461
- const r = t.mainFrom < 0, a = t.mainTo > o, l = Math.max(1, Math.min(t.mainTo, o) - Math.max(t.mainFrom, 0)), d = Math.min(di, l);
1462
- r && Fe(s, 0, d, e, i, n), a && Fe(s, o, -d, e, i, n);
1464
+ const vi = 16;
1465
+ function yi(s, t, e, i, n, o) {
1466
+ const r = t.mainFrom < 0, a = t.mainTo > o, l = Math.max(1, Math.min(t.mainTo, o) - Math.max(t.mainFrom, 0)), d = Math.min(vi, l);
1467
+ r && xe(s, 0, d, e, i, n), a && xe(s, o, -d, e, i, n);
1463
1468
  }
1464
- function Fe(s, t, e, i, n, o) {
1469
+ function xe(s, t, e, i, n, o) {
1465
1470
  const r = s.createLinearGradient(t, 0, t + e, 0);
1466
- r.addColorStop(0, Ee(o, 1)), r.addColorStop(1, Ee(o, 0)), s.globalAlpha = 1, s.fillStyle = r, s.fillRect(Math.min(t, t + e), i, Math.abs(e), n);
1471
+ r.addColorStop(0, Re(o, 1)), r.addColorStop(1, Re(o, 0)), s.globalAlpha = 1, s.fillStyle = r, s.fillRect(Math.min(t, t + e), i, Math.abs(e), n);
1467
1472
  }
1468
- function Ee(s, t) {
1469
- const e = ct(s);
1473
+ function Re(s, t) {
1474
+ const e = ft(s);
1470
1475
  return e === null ? s : `rgba(${e[0]}, ${e[1]}, ${e[2]}, ${t})`;
1471
1476
  }
1472
- function Yt(s, t, e, i, n) {
1473
- const { data: o, colours: r } = t, a = o.taskOfDependency(e.dependency), l = n ?? o.violatedById.has(e.dependency.id), d = a !== null && a === t.selectedTask, h = l ? r.alarm : ut(r, t, a, null);
1477
+ function zt(s, t, e, i, n) {
1478
+ const { data: o, colours: r } = t, a = o.taskOfDependency(e.dependency), l = n ?? o.violatedById.has(e.dependency.id), d = a !== null && a === t.selectedTask, h = l ? r.alarm : mt(r, t, a, null);
1474
1479
  if (s.strokeStyle = h, s.fillStyle = h, s.lineWidth = i || d ? 2 : 1.25, s.setLineDash(l ? [4, 3] : []), s.beginPath(), s.moveTo(e.x1, e.y1), e.kind === "curve")
1475
1480
  s.bezierCurveTo(e.c1x, e.y1, e.c2x, e.y2, e.x2, e.y2);
1476
1481
  else
@@ -1482,24 +1487,24 @@ function Yt(s, t, e, i, n) {
1482
1487
  ])
1483
1488
  s.beginPath(), s.arc(c, f, l ? 3 : 2.5, 0, Math.PI * 2), s.fill();
1484
1489
  }
1485
- function ls(s, t, e, i, n) {
1486
- const o = Qt(e, i);
1490
+ function fs(s, t, e, i, n) {
1491
+ const o = se(e, i);
1487
1492
  if (o === null || o.x < -o.half || o.x > t.view.width + o.half) return;
1488
1493
  const r = (a) => {
1489
1494
  s.beginPath(), s.moveTo(o.x, o.y - a), s.lineTo(o.x + a, o.y), s.lineTo(o.x, o.y + a), s.lineTo(o.x - a, o.y), s.closePath();
1490
1495
  };
1491
1496
  n && (r(o.half + 3), s.fillStyle = t.colours.active, s.fill()), r(o.half + 1), s.fillStyle = t.colours.surface, s.fill(), r(o.half), s.fillStyle = t.colours.text, s.fill();
1492
1497
  }
1493
- function ci(s, t, e) {
1494
- const { colours: i } = t, n = wt(e.subtask.appearance), o = te(n, ut(i, t, e.subtask.task, e.subtask.id), i);
1498
+ function bi(s, t, e) {
1499
+ const { colours: i } = t, n = Tt(e.subtask.appearance), o = ne(n, mt(i, t, e.subtask.task, e.subtask.id), i);
1495
1500
  if (i.forced) {
1496
1501
  s.strokeStyle = i.active, s.lineWidth = 2, s.strokeRect(e.outerFrom - 2, e.y - 2, Math.max(1, e.outerTo - e.outerFrom) + 4, e.height + 4);
1497
1502
  return;
1498
1503
  }
1499
- s.globalAlpha = ui, s.fillStyle = o.onDark ? i.onAccent : i.text, s.fillRect(e.outerFrom, e.y, Math.max(1, e.outerTo - e.outerFrom), e.height), s.globalAlpha = 1;
1504
+ s.globalAlpha = Mi, s.fillStyle = o.onDark ? i.onAccent : i.text, s.fillRect(e.outerFrom, e.y, Math.max(1, e.outerTo - e.outerFrom), e.height), s.globalAlpha = 1;
1500
1505
  }
1501
- const ui = 0.2;
1502
- function fi(s, t) {
1506
+ const Mi = 0.2;
1507
+ function Ti(s, t) {
1503
1508
  const e = t.selectedTask;
1504
1509
  if (e !== null) {
1505
1510
  s.strokeStyle = t.colours.text;
@@ -1512,30 +1517,30 @@ function fi(s, t) {
1512
1517
  }
1513
1518
  }
1514
1519
  }
1515
- const gt = 32, mi = 18;
1516
- function $e(s, t) {
1517
- if (!(t > 2 * gt)) return 0;
1518
- const e = gt - s, i = s - (t - gt), n = Math.max(e, i);
1520
+ const vt = 32, Si = 18;
1521
+ function Ne(s, t) {
1522
+ if (!(t > 2 * vt)) return 0;
1523
+ const e = vt - s, i = s - (t - vt), n = Math.max(e, i);
1519
1524
  if (n <= 0) return 0;
1520
- const o = Math.min(1, n / gt), r = mi * o * o;
1525
+ const o = Math.min(1, n / vt), r = Si * o * o;
1521
1526
  return e > 0 ? -r : r;
1522
1527
  }
1523
- function dt(s, t, e) {
1528
+ function ct(s, t, e) {
1524
1529
  const i = (n, o) => {
1525
- const r = nt(n);
1530
+ const r = it(n);
1526
1531
  return n.lane === o.lane && r.from < o.to && o.from < r.to;
1527
1532
  };
1528
1533
  return e.some((n) => i(s, n) && !(t !== null && i(t, n)));
1529
1534
  }
1530
- function pi(s, t, e, i) {
1535
+ function Ii(s, t, e, i) {
1531
1536
  const n = /* @__PURE__ */ new Set();
1532
1537
  if (i === void 0) return n;
1533
1538
  for (const o of s)
1534
1539
  o !== e && (i(t, o) || n.add(o));
1535
1540
  return n;
1536
1541
  }
1537
- const Re = "\0placing", xe = /* @__PURE__ */ new Set();
1538
- function xt(s) {
1542
+ const Be = "\0placing", Pe = /* @__PURE__ */ new Set();
1543
+ function Pt(s) {
1539
1544
  switch (s.kind) {
1540
1545
  case "subtask":
1541
1546
  return `subtask:${s.subtask.id}:${s.part}`;
@@ -1549,8 +1554,8 @@ function xt(s) {
1549
1554
  return "nothing";
1550
1555
  }
1551
1556
  }
1552
- const Be = 3, gi = 10, ki = 600;
1553
- class vi {
1557
+ const Ge = 3, Li = 10, Ai = 600;
1558
+ class Ci {
1554
1559
  constructor(t) {
1555
1560
  this.host = t;
1556
1561
  }
@@ -1577,7 +1582,7 @@ class vi {
1577
1582
  /** The finger's long press, armed by a touch on a bar that may be moved.
1578
1583
  `armed` is whether the press may still turn into a grab - and, once it
1579
1584
  has, whether the `contextmenu` Android fires for it is the grab's. */
1580
- press = Fs((t) => this.grab(t));
1585
+ press = Ps((t) => this.grab(t));
1581
1586
  armed = !1;
1582
1587
  hover = { kind: "nothing" };
1583
1588
  /** Where the pointer rests on the plot while nothing is being dragged - or,
@@ -1616,9 +1621,9 @@ class vi {
1616
1621
  ghostSummary() {
1617
1622
  const t = this.gesture;
1618
1623
  if (t.kind !== "edit" && t.kind !== "place") return null;
1619
- const e = rs(this.host.view.viewport(), t.ghost);
1624
+ const e = cs(this.host.view.viewport(), t.ghost);
1620
1625
  if (e === null) return null;
1621
- const i = this.ghostFindings(t.ghost, this.ghostHome(t)), n = t.kind === "edit" && (t.mode === "leadIn" || t.mode === "leadOut"), o = n ? nt(t.ghost) : t.ghost;
1626
+ const i = this.ghostFindings(t.ghost, this.ghostHome(t)), n = t.kind === "edit" && (t.mode === "leadIn" || t.mode === "leadOut"), o = n ? it(t.ghost) : t.ghost;
1622
1627
  return {
1623
1628
  refused: this.refused,
1624
1629
  refusedLanes: [...t.refused],
@@ -1670,7 +1675,7 @@ class vi {
1670
1675
  group: i,
1671
1676
  timer: setTimeout(() => {
1672
1677
  this.resting = null, e.openForGesture = /* @__PURE__ */ new Set([...e.openForGesture, i]), this.host.viewChanged();
1673
- }, ki)
1678
+ }, Ai)
1674
1679
  }));
1675
1680
  }
1676
1681
  stopResting() {
@@ -1698,9 +1703,9 @@ class vi {
1698
1703
  gesture that cannot change a lane at all asks nothing: the intents the
1699
1704
  caller handles decide whether the question exists. */
1700
1705
  askRefused(t, e) {
1701
- if (!this.host.view.options.intents.includes(e === null ? "place" : "lane")) return xe;
1706
+ if (!this.host.view.options.intents.includes(e === null ? "place" : "lane")) return Pe;
1702
1707
  const i = this.host.data.lanes.map((n) => n.id);
1703
- return pi(i, t, e, this.host.handlers().canMoveTo);
1708
+ return Ii(i, t, e, this.host.handlers().canMoveTo);
1704
1709
  }
1705
1710
  /** What a press at a point would start, given the intents the caller handles. */
1706
1711
  modeAt(t, e) {
@@ -1709,10 +1714,10 @@ class vi {
1709
1714
  for (let o = i.boxes.length - 1; o >= 0; o--) {
1710
1715
  const r = i.boxes[o];
1711
1716
  if (n.includes("stretch")) {
1712
- const a = Ks(r, t, e);
1717
+ const a = Zs(r, t, e);
1713
1718
  if (a !== null) return { mode: a === "from" ? "stretch-from" : "stretch-to", subtask: r.subtask };
1714
1719
  }
1715
- if (qe(r, t, e) !== null)
1720
+ if (es(r, t, e) !== null)
1716
1721
  return n.includes("move") || n.includes("lane") ? { mode: "move", subtask: r.subtask } : { mode: "pan", subtask: r.subtask };
1717
1722
  }
1718
1723
  return { mode: "pan", subtask: null };
@@ -1726,7 +1731,7 @@ class vi {
1726
1731
  }
1727
1732
  const n = this.gesture;
1728
1733
  if (n.kind === "pending" && n.pointerId === t.pointerId) {
1729
- if (Math.hypot(e - n.x0, i - n.y0) < (t.pointerType === "touch" ? gi : Be)) return;
1734
+ if (Math.hypot(e - n.x0, i - n.y0) < (t.pointerType === "touch" ? Li : Ge)) return;
1730
1735
  n.mode === "pan" || n.subtask === null ? (this.gesture = { kind: "pan", pointerId: n.pointerId, lastX: n.x0, lastY: n.y0 }, this.setCursor("grabbing")) : this.startEdit(n, n.mode, n.subtask);
1731
1736
  }
1732
1737
  const o = this.gesture;
@@ -1755,7 +1760,7 @@ class vi {
1755
1760
  ghost: i,
1756
1761
  /* Asked here, once, and drawn from the first frame of the drag: the
1757
1762
  lanes that are closed are marked before the pointer reaches one. */
1758
- refused: e === "move" ? this.askRefused(i, i.lane) : xe
1763
+ refused: e === "move" ? this.askRefused(i, i.lane) : Pe
1759
1764
  }, this.setCursor(e === "move" ? "grabbing" : "ew-resize");
1760
1765
  }
1761
1766
  /** The finger has been held on a bar: the bar is grabbed, unless the finger
@@ -1805,7 +1810,7 @@ class vi {
1805
1810
  this.panFrame = 0;
1806
1811
  const e = this.gesture;
1807
1812
  if (e.kind !== "edit" && e.kind !== "place") return;
1808
- const i = this.host.view, { x: n, y: o } = this.local(this.lastClient.x, this.lastClient.y), r = $e(n, i.width), a = $e(o, i.height);
1813
+ const i = this.host.view, { x: n, y: o } = this.local(this.lastClient.x, this.lastClient.y), r = Ne(n, i.width), a = Ne(o, i.height);
1809
1814
  if (r === 0 && a === 0) return;
1810
1815
  const l = i.pan(r, a);
1811
1816
  if (l.moved) {
@@ -1833,7 +1838,7 @@ class vi {
1833
1838
  refreshHover() {
1834
1839
  if (!this.idle || this.hoverKey === "nothing" || this.byKeyboard) return;
1835
1840
  const { x: t, y: e } = this.hoverPoint, i = this.host.view.hitAt(t, e);
1836
- this.hover = i, this.hoverKey = xt(i);
1841
+ this.hover = i, this.hoverKey = Pt(i);
1837
1842
  }
1838
1843
  pointerLeave() {
1839
1844
  this.gesture.kind !== "none" || this.byKeyboard || this.setHover({ kind: "nothing" }, "nothing");
@@ -1877,7 +1882,7 @@ class vi {
1877
1882
  this.host.select(r, o.kind === "subtask" ? o.subtask.id : null), this.report("click", o, t, e, i, n);
1878
1883
  }
1879
1884
  hoverAt(t, e, i, n) {
1880
- const o = this.host.view.hitAt(i, n), r = xt(o), { mode: a } = this.modeAt(i, n);
1885
+ const o = this.host.view.hitAt(i, n), r = Pt(o), { mode: a } = this.modeAt(i, n);
1881
1886
  if (this.setCursor(a === "move" ? "grab" : a === "stretch-from" || a === "stretch-to" ? "ew-resize" : "default"), this.hoverPoint = { x: i, y: n }, r === this.hoverKey) {
1882
1887
  (o.kind === "subtask" || o.kind === "dependency" || o.kind === "milestone") && this.host.hoverChanged();
1883
1888
  return;
@@ -1888,7 +1893,7 @@ class vi {
1888
1893
  pointer's would be - and reported to nobody, since `onInteraction`
1889
1894
  speaks of pointer positions. `nothing` hands the hover back. */
1890
1895
  setKeyboardHover(t, e) {
1891
- this.byKeyboard = t.kind !== "nothing", this.hoverPoint = e, this.hover = t, this.hoverKey = xt(t), this.host.interactionChanged();
1896
+ this.byKeyboard = t.kind !== "nothing", this.hoverPoint = e, this.hover = t, this.hoverKey = Pt(t), this.host.interactionChanged();
1892
1897
  }
1893
1898
  setHover(t, e) {
1894
1899
  e !== this.hoverKey && (this.hoverKey = e, this.hover = t, this.host.hoverChanged());
@@ -1938,8 +1943,8 @@ class vi {
1938
1943
  const o = this.onLane(i);
1939
1944
  if (o === null) return { ghost: null, refused: !1, blocked: !1 };
1940
1945
  if (n.has(o)) return { ghost: null, refused: !0, blocked: !1 };
1941
- const r = { ...this.askedFor(t, o, e), id: Re };
1942
- return dt(r, null, this.host.data.blocked) ? { ghost: null, refused: !1, blocked: !0 } : { ghost: r, refused: !1, blocked: !1 };
1946
+ const r = { ...this.askedFor(t, o, e), id: Be };
1947
+ return ct(r, null, this.host.data.blocked) ? { ghost: null, refused: !1, blocked: !0 } : { ghost: r, refused: !1, blocked: !1 };
1943
1948
  }
1944
1949
  /** The dragged item as a subtask, under the caller's key for it - not the
1945
1950
  internal sentinel: the rule is asked about the thing the application says
@@ -1996,7 +2001,7 @@ class vi {
1996
2001
  blocked time takes the ghost along again. */
1997
2002
  heldGhost(t, e, i) {
1998
2003
  const n = this.ghostFor(t, e, i);
1999
- return this.blocked = dt(n, t.subtask, this.host.data.blocked), this.blocked ? t.ghost : n;
2004
+ return this.blocked = ct(n, t.subtask, this.host.data.blocked), this.blocked ? t.ghost : n;
2000
2005
  }
2001
2006
  ghostFor(t, e, i) {
2002
2007
  const n = this.host.view, o = t.subtask, r = this.snapStep(), a = n.options.intents, l = this.snapInside(n.timeAt(e), r);
@@ -2004,7 +2009,7 @@ class vi {
2004
2009
  case "move": {
2005
2010
  let d = o.from;
2006
2011
  const h = n.viewport().scale, c = h.fromPx(e) - t.t0;
2007
- a.includes("move") && Math.abs(c * h.m) >= Be && (d = this.shifted(o.from, c, r));
2012
+ a.includes("move") && Math.abs(c * h.m) >= Ge && (d = this.shifted(o.from, c, r));
2008
2013
  let f = t.ghost.lane;
2009
2014
  if (a.includes("lane")) {
2010
2015
  const g = this.onLane(i) ?? f;
@@ -2014,9 +2019,9 @@ class vi {
2014
2019
  return { ...o, from: d, to: d + (o.to - o.from), lane: f };
2015
2020
  }
2016
2021
  case "stretch-from":
2017
- return { ...o, from: Math.min(l, o.to - Math.max(r.step, q)) };
2022
+ return { ...o, from: Math.min(l, o.to - Math.max(r.step, X)) };
2018
2023
  case "stretch-to":
2019
- return { ...o, to: Math.max(l, o.from + Math.max(r.step, q)) };
2024
+ return { ...o, to: Math.max(l, o.from + Math.max(r.step, X)) };
2020
2025
  case "leadIn":
2021
2026
  return { ...o, leadIn: Math.max(0, o.from - l) };
2022
2027
  case "leadOut":
@@ -2027,15 +2032,15 @@ class vi {
2027
2032
  a start this way, and a key by one step of the raster - one arithmetic,
2028
2033
  so a key proposes exactly what a drag of that length would. */
2029
2034
  shifted(t, e, i) {
2030
- const n = vt(this.host.view.options.calendar), o = H(t, n) + e, r = ht(o, n);
2035
+ const n = bt(this.host.view.options.calendar), o = Y(t, n) + e, r = ut(o, n);
2031
2036
  return this.snapInside(r, i);
2032
2037
  }
2033
2038
  /** Snapped - and, where the raster lands in time the calendar removes, moved
2034
2039
  on to the seam, where time counts again. An intent never asks for a time
2035
2040
  nobody works. */
2036
2041
  snapInside(t, e) {
2037
- const i = $s(t, e), n = vt(this.host.view.options.calendar);
2038
- return n.intervals.length === 0 ? i : Vt(H(i, n), n);
2042
+ const i = Ys(t, e, this.host.view.options.timeZone), n = bt(this.host.view.options.calendar);
2043
+ return n.intervals.length === 0 ? i : Wt(Y(i, n), n);
2039
2044
  }
2040
2045
  intentsOf(t, e, i) {
2041
2046
  const n = [], o = this.host.view.options.intents, r = t.id;
@@ -2055,22 +2060,22 @@ class vi {
2055
2060
  keeps a plan of hundreds of tasks fluid while a drag runs, since this is
2056
2061
  computed on every pointer movement. */
2057
2062
  ghostFindings(t, e) {
2058
- const i = this.host.data, n = (h) => h.lane === t.lane || h.lane === e, r = [...i.subtasks.filter((h) => h.id !== t.id && n(h)), t], a = (h) => h.first === t.id || h.second === t.id, l = i.dependencies.filter((h) => h.from === t.id || h.to === t.id), d = t.id === Re ? i.subtasks : i.subtasks.map((h) => h.id === t.id ? t : h);
2059
- return { overlaps: Xt(r).filter(a), violated: qt(d, l) };
2063
+ const i = this.host.data, n = (h) => h.lane === t.lane || h.lane === e, r = [...i.subtasks.filter((h) => h.id !== t.id && n(h)), t], a = (h) => h.first === t.id || h.second === t.id, l = i.dependencies.filter((h) => h.from === t.id || h.to === t.id), d = t.id === Be ? i.subtasks : i.subtasks.map((h) => h.id === t.id ? t : h);
2064
+ return { overlaps: Jt(r).filter(a), violated: Qt(d, l) };
2060
2065
  }
2061
2066
  }
2062
- function yi(s, t) {
2067
+ function Di(s, t) {
2063
2068
  const e = /* @__PURE__ */ new Map();
2064
2069
  for (const i of t) {
2065
- const n = s.slots.get(i.lane), o = n === void 0 ? null : st(s, n.top);
2070
+ const n = s.slots.get(i.lane), o = n === void 0 ? null : nt(s, n.top);
2066
2071
  if (o === null) continue;
2067
2072
  const r = s.rows.indexOf(o);
2068
2073
  e.set(r, [...e.get(r) ?? [], i]);
2069
2074
  }
2070
2075
  return [...e.entries()].sort(([i], [n]) => i - n).map(([, i]) => i.sort((n, o) => n.from - o.from || n.to - o.to));
2071
2076
  }
2072
- const Ne = (s, t) => t < s.from ? s.from - t : t > s.to ? t - s.to : 0;
2073
- function wi(s, t, e, i) {
2077
+ const He = (s, t) => t < s.from ? s.from - t : t > s.to ? t - s.to : 0;
2078
+ function _i(s, t, e, i) {
2074
2079
  let n = -1, o = -1;
2075
2080
  for (let d = 0; d < s.length && t !== null && n < 0; d++)
2076
2081
  o = s[d].findIndex((h) => h.id === t), o >= 0 && (n = d);
@@ -2101,11 +2106,11 @@ function wi(s, t, e, i) {
2101
2106
  const d = s[e === "up" ? n - 1 : n + 1];
2102
2107
  if (d === void 0) return a;
2103
2108
  const h = (a.from + a.to) / 2;
2104
- return d.reduce((c, f) => Ne(f, h) < Ne(c, h) ? f : c);
2109
+ return d.reduce((c, f) => He(f, h) < He(c, h) ? f : c);
2105
2110
  }
2106
2111
  }
2107
2112
  }
2108
- function bi(s, t, e, i) {
2113
+ function Oi(s, t, e, i) {
2109
2114
  if (e.kind === "milestone") return e;
2110
2115
  if (e.kind === "dependency") {
2111
2116
  const o = s.find((a) => a.id === e.id), r = o === void 0 ? void 0 : i === "out" ? o.to : o.from;
@@ -2116,7 +2121,7 @@ function bi(s, t, e, i) {
2116
2121
  );
2117
2122
  return n === void 0 ? e : { kind: "dependency", id: n.id };
2118
2123
  }
2119
- const kt = "\0milestone:", Mi = 150, Ti = {
2124
+ const yt = "\0milestone:", Fi = 150, $i = {
2120
2125
  ArrowRight: "next",
2121
2126
  ArrowLeft: "previous",
2122
2127
  ArrowUp: "up",
@@ -2126,7 +2131,7 @@ const kt = "\0milestone:", Mi = 150, Ti = {
2126
2131
  PageDown: "pageNext",
2127
2132
  PageUp: "pagePrevious"
2128
2133
  };
2129
- class Si {
2134
+ class Ei {
2130
2135
  constructor(t) {
2131
2136
  this.host = t;
2132
2137
  }
@@ -2156,28 +2161,28 @@ class Si {
2156
2161
  const o = this.active();
2157
2162
  if (o === null) return !1;
2158
2163
  const r = this.host.data, a = i ? !t.shiftKey : t.key === "]";
2159
- return this.show(bi(r.dependencies, r.subtaskById, o, a ? "out" : "back")), !0;
2164
+ return this.show(Oi(r.dependencies, r.subtaskById, o, a ? "out" : "back")), !0;
2160
2165
  }
2161
2166
  if (t.ctrlKey) return !1;
2162
2167
  if (t.altKey) return this.edit(t);
2163
2168
  if (t.key === "Escape")
2164
2169
  return e.byKeyboard ? (this.blur(), !0) : !1;
2165
2170
  if (t.key === "Enter" || t.key === " ") return this.select();
2166
- const n = t.shiftKey ? void 0 : Ti[t.key];
2171
+ const n = t.shiftKey ? void 0 : $i[t.key];
2167
2172
  return n === void 0 ? !1 : (this.walk(n), !0);
2168
2173
  }
2169
2174
  walk(t) {
2170
- const { data: e, view: i } = this.host, n = this.active(), o = n === null ? null : n.kind === "subtask" ? n.id : n.kind === "milestone" ? kt + n.id : e.dependencies.find((d) => d.id === n.id)?.from ?? null, r = [...e.subtasks, ...e.milestones.map((d) => ({ id: kt + d.id, lane: d.lane, from: d.at, to: d.at }))];
2171
- let a = yi(i.rows, r);
2175
+ const { data: e, view: i } = this.host, n = this.active(), o = n === null ? null : n.kind === "subtask" ? n.id : n.kind === "milestone" ? yt + n.id : e.dependencies.find((d) => d.id === n.id)?.from ?? null, r = [...e.subtasks, ...e.milestones.map((d) => ({ id: yt + d.id, lane: d.lane, from: d.at, to: d.at }))];
2176
+ let a = Di(i.rows, r);
2172
2177
  if (o === null) {
2173
2178
  const d = a.filter((h) => {
2174
- const c = J(i.viewport(), h[0].lane);
2179
+ const c = Z(i.viewport(), h[0].lane);
2175
2180
  return c !== null && c.top + c.height > 0 && c.top < i.height;
2176
2181
  });
2177
2182
  d.length > 0 && (a = d);
2178
2183
  }
2179
- const l = wi(a, o, t, this.host.visibleDomain());
2180
- l !== null && this.show(l.id.startsWith(kt) ? { kind: "milestone", id: l.id.slice(kt.length) } : { kind: "subtask", id: l.id });
2184
+ const l = _i(a, o, t, this.host.visibleDomain());
2185
+ l !== null && this.show(l.id.startsWith(yt) ? { kind: "milestone", id: l.id.slice(yt.length) } : { kind: "subtask", id: l.id });
2181
2186
  }
2182
2187
  /** Space and Enter select as a click does: the whole task, and the subtask. */
2183
2188
  select() {
@@ -2200,13 +2205,13 @@ class Si {
2200
2205
  const c = (g) => ({ ...n, from: g, to: g + (n.to - n.from) });
2201
2206
  let f = n.from;
2202
2207
  for (let g = 0; g < 1e3; g++) {
2203
- const v = o.shifted(f, i * l.step, l);
2204
- if (v === f || (f = v, !dt(c(f), n, d))) break;
2208
+ const w = o.shifted(f, i * l.step, l);
2209
+ if (w === f || (f = w, !ct(c(f), n, d))) break;
2205
2210
  }
2206
- f !== n.from && !dt(c(f), n, d) && (h = { kind: "move", subtask: n.id, from: f, to: c(f).to });
2211
+ f !== n.from && !ct(c(f), n, d) && (h = { kind: "move", subtask: n.id, from: f, to: c(f).to });
2207
2212
  } else if (t.shiftKey && r.includes("stretch")) {
2208
- const c = Math.max(o.shifted(n.to, i * l.step, l), n.from + Math.max(l.step, q));
2209
- c !== n.to && !dt({ ...n, to: c }, n, d) && (h = { kind: "stretch", subtask: n.id, from: n.from, to: c });
2213
+ const c = Math.max(o.shifted(n.to, i * l.step, l), n.from + Math.max(l.step, X));
2214
+ c !== n.to && !ct({ ...n, to: c }, n, d) && (h = { kind: "stretch", subtask: n.id, from: n.from, to: c });
2210
2215
  }
2211
2216
  return o.byKeyboard = !0, h !== null && this.host.handlers().onIntent?.(h), this.scheduleReadout(), !0;
2212
2217
  }
@@ -2245,7 +2250,7 @@ class Si {
2245
2250
  return a === void 0 ? null : { x0: a.outerFrom, x1: a.outerTo, y0: a.y, y1: a.y + a.height };
2246
2251
  }
2247
2252
  if (t.kind === "milestone") {
2248
- const a = this.host.data.milestones.find((d) => d.id === t.id), l = a === void 0 ? null : Qt(e.viewport(), a);
2253
+ const a = this.host.data.milestones.find((d) => d.id === t.id), l = a === void 0 ? null : se(e.viewport(), a);
2249
2254
  return l === null ? null : { x0: l.x - l.half, x1: l.x + l.half, y0: l.y - l.half, y1: l.y + l.half };
2250
2255
  }
2251
2256
  const n = this.host.data.dependencies.find((a) => a.id === t.id), o = n === void 0 ? void 0 : i(n.from), r = n === void 0 ? void 0 : i(n.to);
@@ -2282,20 +2287,20 @@ class Si {
2282
2287
  if (!this.host.gestures.byKeyboard) return;
2283
2288
  const e = this.host.data.tooltipTargetFor(t);
2284
2289
  e !== null && (this.spoken = { target: e, lane: t.kind === "subtask" ? t.subtask.lane : t.kind === "milestone" ? t.milestone.lane : null, count: (this.spoken?.count ?? 0) + 1 }, this.host.spokenChanged());
2285
- }, Mi);
2290
+ }, Fi);
2286
2291
  }
2287
2292
  /** Unmount: no readout after it. */
2288
2293
  stop() {
2289
2294
  this.timer !== null && clearTimeout(this.timer), this.timer = null;
2290
2295
  }
2291
2296
  }
2292
- const et = (s) => JSON.stringify([s.domain ?? null, [...s.folded ?? []].sort()]);
2293
- function Ii(s, t) {
2297
+ const st = (s) => JSON.stringify([s.domain ?? null, [...s.folded ?? []].sort()]);
2298
+ function xi(s, t) {
2294
2299
  if (t.size === 0 || s.folded === void 0) return s;
2295
2300
  const e = s.folded.filter((i) => t.has(i));
2296
2301
  return e.length === s.folded.length ? s : { ...s.domain ? { domain: s.domain } : {}, ...e.length ? { folded: e } : {} };
2297
2302
  }
2298
- function Li(s, t, e = (i) => i) {
2303
+ function Ri(s, t, e = (i) => i) {
2299
2304
  if (s.length === 0) return null;
2300
2305
  let i = 1 / 0, n = -1 / 0;
2301
2306
  for (const a of s)
@@ -2304,14 +2309,14 @@ function Li(s, t, e = (i) => i) {
2304
2309
  const o = Math.min(t.max, Math.max(t.min, n - i)), r = (i + n) / 2;
2305
2310
  return [r - o / 2, r + o / 2];
2306
2311
  }
2307
- const Pe = {
2312
+ const Ye = {
2308
2313
  width: 0,
2309
2314
  height: 0,
2310
2315
  scrollY: 0,
2311
2316
  headers: [],
2312
2317
  days: [],
2313
2318
  ticks: [],
2314
- step: jt,
2319
+ step: Ut,
2315
2320
  fontScale: 1,
2316
2321
  ghost: null,
2317
2322
  grips: [],
@@ -2323,9 +2328,9 @@ const Pe = {
2323
2328
  spoken: null,
2324
2329
  summary: { lanes: 0, subtasks: 0, from: 0, to: 0, overlaps: 0, violated: 0, blocked: 0, milestones: 0 }
2325
2330
  };
2326
- class Ai {
2327
- data = new Wn(() => this.viewChanged());
2328
- view = new sn(this.data);
2331
+ class Ni {
2332
+ data = new si(() => this.viewChanged());
2333
+ view = new un(this.data);
2329
2334
  gestures;
2330
2335
  keys;
2331
2336
  handlersNow = {};
@@ -2366,10 +2371,10 @@ class Ai {
2366
2371
  movePending = !1;
2367
2372
  domainFrame = 0;
2368
2373
  unsubscribeTheme = null;
2369
- snapshot = Pe;
2374
+ snapshot = Ye;
2370
2375
  listeners = /* @__PURE__ */ new Set();
2371
2376
  constructor(t = {}) {
2372
- this.folded = t.folded ?? [], this.domainInView = t.domain ?? null, this.domainInView !== null && this.view.showWall(this.domainInView), this.viewNow = this.currentView(), this.gestures = new vi({
2377
+ this.folded = t.folded ?? [], this.domainInView = t.domain ?? null, this.domainInView !== null && this.view.showWall(this.domainInView), this.viewNow = this.currentView(), this.gestures = new Ci({
2373
2378
  data: this.data,
2374
2379
  view: this.view,
2375
2380
  plotElement: () => this.plot,
@@ -2380,7 +2385,7 @@ class Ai {
2380
2385
  viewMoved: (e) => this.viewMoved(e),
2381
2386
  interactionChanged: () => this.interactionChanged(),
2382
2387
  hoverChanged: () => this.hoverChanged()
2383
- }), this.keys = new Si({
2388
+ }), this.keys = new Ei({
2384
2389
  data: this.data,
2385
2390
  view: this.view,
2386
2391
  gestures: this.gestures,
@@ -2430,7 +2435,7 @@ class Ai {
2430
2435
  getView = () => this.viewNow;
2431
2436
  /** Goes to a whole view (`setView`); what it leaves out goes back to its default. */
2432
2437
  applyView(t) {
2433
- et(t) !== et(this.viewNow) && (this.actedOn = !0, this.folded = t.folded ?? [], this.setDomain(t.domain ?? null));
2438
+ st(t) !== st(this.viewNow) && (this.actedOn = !0, this.folded = t.folded ?? [], this.setDomain(t.domain ?? null));
2434
2439
  }
2435
2440
  /** Puts a span of two wall-clock instants in view; null shows the
2436
2441
  subtasks' extent. */
@@ -2449,14 +2454,14 @@ class Ai {
2449
2454
  this.actedOn = !0, this.folded = [], this.viewChanged();
2450
2455
  };
2451
2456
  currentView() {
2452
- return Ii(
2457
+ return xi(
2453
2458
  { ...this.domainInView === null ? {} : { domain: this.domainInView }, ...this.folded.length > 0 ? { folded: this.folded } : {} },
2454
2459
  new Set(this.data.groups.map((t) => t.id))
2455
2460
  );
2456
2461
  }
2457
2462
  publishView() {
2458
2463
  const t = this.currentView();
2459
- if (et(t) !== et(this.viewNow)) {
2464
+ if (st(t) !== st(this.viewNow)) {
2460
2465
  this.viewNow = t;
2461
2466
  for (const e of this.viewListeners) e();
2462
2467
  }
@@ -2464,13 +2469,13 @@ class Ai {
2464
2469
  /** The subtasks' extent within the zoom limits, while the view names no
2465
2470
  span - and the local day of today while there is no work to show. */
2466
2471
  fit() {
2467
- const t = this.view.options.calendar, e = Li(this.data.subtasks, this.view.options.zoomLimits, (n) => H(n, t));
2472
+ const t = this.view.options.calendar, e = Ri(this.data.subtasks, this.view.options.zoomLimits, (l) => Y(l, t));
2468
2473
  if (e !== null) {
2469
2474
  this.view.domain = e, this.fitted = !0;
2470
2475
  return;
2471
2476
  }
2472
- const i = /* @__PURE__ */ new Date();
2473
- i.setHours(0, 0, 0, 0), this.view.showWall([i.getTime(), i.getTime() + U]);
2477
+ const i = this.view.options.timeZone, n = Gs(Date.now(), i), { year: o, month: r, day: a } = We(n, i);
2478
+ this.view.showWall([n.getTime(), Gt({ year: o, month: r, day: a + 1 }, i).getTime()]);
2474
2479
  }
2475
2480
  /** `undefined`: the scene keeps the selection itself. */
2476
2481
  setControlledTask(t) {
@@ -2494,7 +2499,7 @@ class Ai {
2494
2499
  /* DOM binding */
2495
2500
  /* ---------------------------------------------------------------- */
2496
2501
  bind(t, e, i, n) {
2497
- this.root = t, this.plot = e, this.dataCanvas = i, this.overlayCanvas = n, this.unsubscribeTheme = Ls(() => {
2502
+ this.root = t, this.plot = e, this.dataCanvas = i, this.overlayCanvas = n, this.unsubscribeTheme = Fs(() => {
2498
2503
  this.colours = null, this.dataStale = !0, this.requestDraw();
2499
2504
  }), this.viewChanged();
2500
2505
  }
@@ -2509,7 +2514,7 @@ class Ai {
2509
2514
  this.listeners.delete(t);
2510
2515
  });
2511
2516
  getSnapshot = () => this.snapshot;
2512
- getServerSnapshot = () => Pe;
2517
+ getServerSnapshot = () => Ye;
2513
2518
  /* ---------------------------------------------------------------- */
2514
2519
  /* Changes */
2515
2520
  /* ---------------------------------------------------------------- */
@@ -2587,12 +2592,12 @@ class Ai {
2587
2592
  if (t.width <= 0) return [];
2588
2593
  const e = this.colours;
2589
2594
  return t.boxes.flatMap((i) => {
2590
- if (!Bt(i, t.width, t.height)) return [];
2591
- const n = Ws(i, t.width);
2595
+ if (!Ht(i, t.width, t.height)) return [];
2596
+ const n = tn(i, t.width);
2592
2597
  if (n === null) return [];
2593
- const o = e === null ? !0 : te(
2594
- wt(i.subtask.appearance),
2595
- ut(e, { selectedTask: this.selectedTask, selectedSubtask: this.selectedSubtask }, i.subtask.task, i.subtask.id),
2598
+ const o = e === null ? !0 : ne(
2599
+ Tt(i.subtask.appearance),
2600
+ mt(e, { selectedTask: this.selectedTask, selectedSubtask: this.selectedSubtask }, i.subtask.task, i.subtask.id),
2596
2601
  e
2597
2602
  ).onDark;
2598
2603
  return [{ subtask: i.subtask, ...n, dark: o }];
@@ -2604,7 +2609,7 @@ class Ai {
2604
2609
  const t = this.view, [e, i] = this.visibleDomain();
2605
2610
  return {
2606
2611
  lanes: this.data.lanes.length,
2607
- subtasks: t.boxes.filter((n) => Bt(n, t.width, t.height)).length,
2612
+ subtasks: t.boxes.filter((n) => Ht(n, t.width, t.height)).length,
2608
2613
  from: e,
2609
2614
  to: i,
2610
2615
  overlaps: this.data.overlaps.length,
@@ -2623,7 +2628,7 @@ class Ai {
2623
2628
  }
2624
2629
  /** The visible span, as two wall-clock instants. */
2625
2630
  visibleDomain() {
2626
- const t = (e) => ht(e, this.view.options.calendar);
2631
+ const t = (e) => ut(e, this.view.options.calendar);
2627
2632
  return [t(this.view.domain[0]), t(this.view.domain[1])];
2628
2633
  }
2629
2634
  /** A pan or zoom of the planner's goes into the view once per frame,
@@ -2647,8 +2652,8 @@ class Ai {
2647
2652
  clientPointOf(t, e) {
2648
2653
  const i = this.plot?.getBoundingClientRect();
2649
2654
  if (i === void 0) return null;
2650
- const n = this.view.viewport(), o = e === void 0 ? null : J(n, e), r = o === null ? 0 : o.top + o.height / 2;
2651
- return { x: i.left + $(n, t), y: i.top + r };
2655
+ const n = this.view.viewport(), o = e === void 0 ? null : Z(n, e), r = o === null ? 0 : o.top + o.height / 2;
2656
+ return { x: i.left + E(n, t), y: i.top + r };
2652
2657
  }
2653
2658
  /** Whether a lane has a row of its own on a mounted plot: not unknown, not
2654
2659
  in a folded group, whose lanes are strips and no rows. */
@@ -2680,8 +2685,8 @@ class Ai {
2680
2685
  }
2681
2686
  draw() {
2682
2687
  if (this.root === null) return;
2683
- this.colours === null && (this.colours = ti(this.root, this.data), this.publish());
2684
- const { width: t, height: e } = this.view, i = this.dataStale ? _e(this.dataCanvas, t, e) : null, n = _e(this.overlayCanvas, t, e);
2688
+ this.colours === null && (this.colours = hi(this.root, this.data), this.publish());
2689
+ const { width: t, height: e } = this.view, i = this.dataStale ? $e(this.dataCanvas, t, e) : null, n = $e(this.overlayCanvas, t, e);
2685
2690
  if (n === null || t === 0 || this.dataStale && i === null) return;
2686
2691
  this.dataStale = !1;
2687
2692
  const o = {
@@ -2694,7 +2699,7 @@ class Ai {
2694
2699
  hover: this.gestures.hover,
2695
2700
  ghost: this.gestures.ghostDrawing()
2696
2701
  };
2697
- i !== null && ei(i, o), si(n, o);
2702
+ i !== null && ci(i, o), ui(n, o);
2698
2703
  }
2699
2704
  /* ---------------------------------------------------------------- */
2700
2705
  /* Gestures, as the component hands them in */
@@ -2715,19 +2720,19 @@ class Ai {
2715
2720
  focus = (t) => this.keys.focus(t);
2716
2721
  blur = () => this.keys.blur();
2717
2722
  }
2718
- function xi(s = {}) {
2719
- const { initialView: t, onViewChange: e } = s, [i] = at(() => new Ai(t)), n = V(""), [o] = at(() => {
2720
- const l = (d) => Ds(Bn, { ...d, scene: i });
2723
+ function zi(s = {}) {
2724
+ const { initialView: t, onViewChange: e } = s, [i] = dt(() => new Ni(t)), n = V(""), [o] = dt(() => {
2725
+ const l = (d) => xs(Wn, { ...d, scene: i });
2721
2726
  return l.displayName = "Schedule", {
2722
2727
  Schedule: l,
2723
- Lane: Pn,
2724
- LaneGroup: Gn,
2725
- Subtasks: Hn,
2726
- Dependencies: Yn,
2727
- BlockedTimes: Kn,
2728
- Milestones: Vn,
2728
+ Lane: Xn,
2729
+ LaneGroup: jn,
2730
+ Subtasks: Zn,
2731
+ Dependencies: Jn,
2732
+ BlockedTimes: Qn,
2733
+ Milestones: ti,
2729
2734
  setView: (d) => {
2730
- i.applyView(d), n.current = et(i.getView());
2735
+ i.applyView(d), n.current = st(i.getView());
2731
2736
  },
2732
2737
  setDomain: i.setDomain,
2733
2738
  positionAt: (d, h) => i.positionAt(d, h),
@@ -2740,24 +2745,24 @@ function xi(s = {}) {
2740
2745
  foldAll: i.foldAll,
2741
2746
  unfoldAll: i.unfoldAll
2742
2747
  };
2743
- }), r = Ye(i.subscribeView, i.getView, i.getView), a = et(r);
2744
- return j(() => {
2748
+ }), r = ze(i.subscribeView, i.getView, i.getView), a = st(r);
2749
+ return q(() => {
2745
2750
  n.current !== a && (n.current = a, i.acted && e?.(r));
2746
- }, [a]), W(() => ({ ...o, view: r }), [o, r]);
2751
+ }, [a]), z(() => ({ ...o, view: r }), [o, r]);
2747
2752
  }
2748
2753
  export {
2749
- ye as applyIntent,
2750
- Ut as arrival,
2751
- zt as departure,
2752
- Ei as findings,
2753
- Ke as inBlockedTime,
2754
- nt as occupied,
2755
- Xt as overlaps,
2756
- wt as resolveAppearance,
2757
- $i as ripple,
2758
- Ri as shiftTask,
2759
- $s as snapTime,
2760
- Fi as subtaskFromPlace,
2761
- xi as useSchedule,
2762
- qt as violatedDependencies
2754
+ Me as applyIntent,
2755
+ Zt as arrival,
2756
+ jt as departure,
2757
+ Ki as findings,
2758
+ Ue as inBlockedTime,
2759
+ it as occupied,
2760
+ Jt as overlaps,
2761
+ Tt as resolveAppearance,
2762
+ Vi as ripple,
2763
+ qi as shiftTask,
2764
+ Ys as snapTime,
2765
+ Yi as subtaskFromPlace,
2766
+ zi as useSchedule,
2767
+ Qt as violatedDependencies
2763
2768
  };