@umriss-ui/schedule 0.5.7 → 0.6.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,409 +1,413 @@
1
1
  import "./schedule.css";
2
- var rs = Object.defineProperty;
3
- var as = (o, t, e) => t in o ? rs(o, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[t] = e;
4
- var f = (o, t, e) => as(o, typeof t != "symbol" ? t + "" : t, e);
5
- import { localOffset as Pt, toWorkingTimeClamped as H, DAY as U, MINUTE as q, timeStep as ls, workingTimeTicks as ds, calendarFrom as et, toWallClock as j, HOUR as Bt, LinearScale as hs, resolveColours as cs, removedIntervals as us, subscribeTheme as fs, Echoes as ps } from "@umriss-ui/charts";
6
- import { createContext as Fe, useContext as Oe, useRef as G, useEffect as W, forwardRef as Ee, useId as ms, useState as tt, useLayoutEffect as it, useImperativeHandle as gs, useSyncExternalStore as Re, useMemo as X, createElement as ks } from "react";
7
- import { jsxs as K, Fragment as Dt, jsx as k } from "react/jsx-runtime";
8
- import { useFormats as xt, useWording as mt, AngleGlyph as ys, VisuallyHidden as he } from "@umriss-ui/core";
9
- function nt(o) {
10
- return { from: o.from - (o.leadIn ?? 0), to: o.to + (o.leadOut ?? 0) };
11
- }
12
- function $t(o, t) {
13
- return (o.leaves ?? "leadOut") === "main" ? t.to : t.to + (t.leadOut ?? 0);
14
- }
15
- function Gt(o, t) {
16
- return (o.arrives ?? "leadIn") === "main" ? t.from : t.from - (t.leadIn ?? 0);
17
- }
18
- function ce(o, t) {
19
- if (t.kind === "place" || t.subtask !== o.id) return o;
2
+ var hn = Object.defineProperty;
3
+ var cn = (s, t, e) => t in s ? hn(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
4
+ var f = (s, t, e) => cn(s, typeof t != "symbol" ? t + "" : t, e);
5
+ import { localOffset as Bt, toWorkingTimeClamped as Y, DAY as X, MINUTE as q, timeStep as un, workingTimeTicks as fn, calendarFrom as nt, toWallClock as j, HOUR as xt, LinearScale as mn, resolveColours as pn, removedIntervals as gn, subscribeTheme as kn, Echoes as yn } from "@umriss-ui/charts";
6
+ import { createContext as Ee, useContext as Ne, useRef as G, useEffect as U, forwardRef as Re, useId as vn, useState as et, useLayoutEffect as rt, useImperativeHandle as wn, useSyncExternalStore as Pe, useMemo as V, createElement as bn } from "react";
7
+ import { jsxs as H, Fragment as lt, jsx as g } from "react/jsx-runtime";
8
+ import { useFormats as Ht, useWording as kt, AngleGlyph as Mn, VisuallyHidden as ue } from "@umriss-ui/core";
9
+ function ot(s) {
10
+ return { from: s.from - (s.leadIn ?? 0), to: s.to + (s.leadOut ?? 0) };
11
+ }
12
+ function Gt(s, t) {
13
+ return (s.leaves ?? "leadOut") === "main" ? t.to : t.to + (t.leadOut ?? 0);
14
+ }
15
+ function Yt(s, t) {
16
+ return (s.arrives ?? "leadIn") === "main" ? t.from : t.from - (t.leadIn ?? 0);
17
+ }
18
+ function fe(s, t) {
19
+ if (t.kind === "place" || t.subtask !== s.id) return s;
20
20
  switch (t.kind) {
21
21
  case "move":
22
22
  case "stretch":
23
- return { ...o, from: t.from, to: t.to };
23
+ return { ...s, from: t.from, to: t.to };
24
24
  case "leadIn":
25
- return { ...o, leadIn: t.leadIn };
25
+ return { ...s, leadIn: t.leadIn };
26
26
  case "leadOut":
27
- return { ...o, leadOut: t.leadOut };
27
+ return { ...s, leadOut: t.leadOut };
28
28
  case "lane":
29
- return { ...o, lane: t.lane };
29
+ return { ...s, lane: t.lane };
30
30
  }
31
31
  }
32
- function po(o, t) {
32
+ function yo(s, t) {
33
33
  return {
34
34
  id: t,
35
- task: o.task,
36
- lane: o.lane,
37
- from: o.from,
38
- to: o.to,
39
- ...o.leadIn === void 0 ? {} : { leadIn: o.leadIn },
40
- ...o.leadOut === void 0 ? {} : { leadOut: o.leadOut }
35
+ task: s.task,
36
+ lane: s.lane,
37
+ from: s.from,
38
+ to: s.to,
39
+ ...s.leadIn === void 0 ? {} : { leadIn: s.leadIn },
40
+ ...s.leadOut === void 0 ? {} : { leadOut: s.leadOut }
41
41
  };
42
42
  }
43
- function Ht(o) {
43
+ function zt(s) {
44
44
  const t = [], e = /* @__PURE__ */ new Map();
45
- o.forEach((s, n) => {
46
- const { from: i, to: r } = nt(s);
45
+ s.forEach((n, o) => {
46
+ const { from: i, to: r } = ot(n);
47
47
  if (!(i < r)) return;
48
- const a = e.get(s.lane) ?? [];
49
- a.push({ subtask: s, index: n, from: i, to: r }), e.set(s.lane, a);
48
+ const a = e.get(n.lane) ?? [];
49
+ a.push({ subtask: n, index: o, from: i, to: r }), e.set(n.lane, a);
50
50
  });
51
- for (const [s, n] of e) {
52
- n.sort((i, r) => i.from - r.from || i.index - r.index);
53
- for (let i = 0; i < n.length; i++) {
54
- const r = n[i];
55
- for (let a = i + 1; a < n.length; a++) {
56
- const d = n[a];
57
- if (d.from >= r.to) break;
58
- t.push({ lane: s, first: r.subtask.id, second: d.subtask.id, from: d.from, to: Math.min(r.to, d.to) });
51
+ for (const [n, o] of e) {
52
+ o.sort((i, r) => i.from - r.from || i.index - r.index);
53
+ for (let i = 0; i < o.length; i++) {
54
+ const r = o[i];
55
+ for (let a = i + 1; a < o.length; a++) {
56
+ const l = o[a];
57
+ if (l.from >= r.to) break;
58
+ t.push({ lane: n, first: r.subtask.id, second: l.subtask.id, from: l.from, to: Math.min(r.to, l.to) });
59
59
  }
60
60
  }
61
61
  }
62
62
  return t;
63
63
  }
64
- function vs(o) {
64
+ function Tn(s) {
65
65
  const t = /* @__PURE__ */ new Map(), e = /* @__PURE__ */ new Map();
66
- for (const s of o) {
67
- const n = nt(s), i = e.get(s.lane) ?? [];
66
+ for (const n of s) {
67
+ const o = ot(n), i = e.get(n.lane) ?? [];
68
68
  let r = 0;
69
- if (n.from < n.to) {
70
- for (const a of i) n.from < a.to && a.from < n.to && r++;
71
- i.push(n);
69
+ if (o.from < o.to) {
70
+ for (const a of i) o.from < a.to && a.from < o.to && r++;
71
+ i.push(o);
72
72
  }
73
- e.set(s.lane, i), t.set(s.id, r);
73
+ e.set(n.lane, i), t.set(n.id, r);
74
74
  }
75
75
  return t;
76
76
  }
77
- function Yt(o, t) {
78
- const e = new Map(o.map((n) => [n.id, n])), s = [];
79
- for (const n of t) {
80
- const i = e.get(n.from), r = e.get(n.to);
77
+ function Kt(s, t) {
78
+ const e = new Map(s.map((o) => [o.id, o])), n = [];
79
+ for (const o of t) {
80
+ const i = e.get(o.from), r = e.get(o.to);
81
81
  if (i === void 0 || r === void 0) continue;
82
- const a = $t(n, i), d = Gt(n, r), h = a + n.lag - d;
83
- h > 0 && s.push({ dependency: n.id, departure: a, arrival: d, shortBy: h });
82
+ const a = Gt(o, i), l = Yt(o, r), h = a + o.lag - l;
83
+ h > 0 && n.push({ dependency: o.id, departure: a, arrival: l, shortBy: h });
84
84
  }
85
- return s;
85
+ return n;
86
86
  }
87
- function Ne(o, t) {
87
+ function $e(s, t) {
88
88
  const e = [];
89
- for (const s of o) {
90
- const n = nt(s);
89
+ for (const n of s) {
90
+ const o = ot(n);
91
91
  for (const i of t)
92
- i.lane !== s.lane || !(n.from < i.to && i.from < n.to) || e.push({ subtask: s.id, blocked: i.id, lane: i.lane, from: Math.max(n.from, i.from), to: Math.min(n.to, i.to) });
92
+ i.lane !== n.lane || !(o.from < i.to && i.from < o.to) || e.push({ subtask: n.id, blocked: i.id, lane: i.lane, from: Math.max(o.from, i.from), to: Math.min(o.to, i.to) });
93
93
  }
94
94
  return e;
95
95
  }
96
- function mo(o, t, e = []) {
96
+ function vo(s, t, e = []) {
97
97
  return {
98
- overlaps: Ht(o),
99
- violatedDependencies: Yt(o, t),
100
- inBlockedTime: Ne(o, e)
98
+ overlaps: zt(s),
99
+ violatedDependencies: Kt(s, t),
100
+ inBlockedTime: $e(s, e)
101
101
  };
102
102
  }
103
- function go(o, t, e) {
103
+ function wo(s, t, e) {
104
104
  if (e.kind === "place") return [];
105
- const s = new Map(o.map((d) => [d.id, ce(d, e)])), n = /* @__PURE__ */ new Map();
106
- for (const d of t) {
107
- const h = n.get(d.from) ?? [];
108
- h.push(d), n.set(d.from, h);
105
+ const n = new Map(s.map((l) => [l.id, fe(l, e)])), o = /* @__PURE__ */ new Map();
106
+ for (const l of t) {
107
+ const h = o.get(l.from) ?? [];
108
+ h.push(l), o.set(l.from, h);
109
109
  }
110
110
  const i = /* @__PURE__ */ new Map(), r = [e.subtask];
111
- let a = (o.length + 1) * (t.length + 1);
111
+ let a = (s.length + 1) * (t.length + 1);
112
112
  for (; r.length > 0 && a-- > 0; ) {
113
- const d = r.shift(), h = s.get(d);
113
+ const l = r.shift(), h = n.get(l);
114
114
  if (h !== void 0)
115
- for (const l of n.get(d) ?? []) {
116
- if (l.to === e.subtask) continue;
117
- const c = s.get(l.to);
115
+ for (const d of o.get(l) ?? []) {
116
+ if (d.to === e.subtask) continue;
117
+ const c = n.get(d.to);
118
118
  if (c === void 0) continue;
119
- const p = $t(l, h) + l.lag - Gt(l, c);
120
- if (!(p > 0)) continue;
121
- const m = { kind: "move", subtask: c.id, from: c.from + p, to: c.to + p };
122
- s.set(c.id, ce(c, m)), i.set(c.id, m), r.push(c.id);
119
+ const m = Gt(d, h) + d.lag - Yt(d, c);
120
+ if (!(m > 0)) continue;
121
+ const p = { kind: "move", subtask: c.id, from: c.from + m, to: c.to + m };
122
+ n.set(c.id, fe(c, p)), i.set(c.id, p), r.push(c.id);
123
123
  }
124
124
  }
125
125
  return [...i.values()];
126
126
  }
127
- function ws(o, t) {
128
- const { step: e, offset: s } = typeof t == "number" ? { step: t, offset: 0 } : t;
129
- if (!(e > 0) || !Number.isFinite(o)) return o;
130
- const n = Pt(o) + s;
131
- return n + Math.round((o - n) / e) * e;
127
+ function In(s, t) {
128
+ const { step: e, offset: n } = typeof t == "number" ? { step: t, offset: 0 } : t;
129
+ if (!(e > 0) || !Number.isFinite(s)) return s;
130
+ const o = Bt(s) + n;
131
+ return o + Math.round((s - o) / e) * e;
132
132
  }
133
- function ko(o, t, e) {
134
- return e === 0 || !Number.isFinite(e) ? [] : o.filter((s) => s.task === t).map((s) => ({ kind: "move", subtask: s.id, from: s.from + e, to: s.to + e }));
133
+ function bo(s, t, e) {
134
+ return e === 0 || !Number.isFinite(e) ? [] : s.filter((n) => n.task === t).map((n) => ({ kind: "move", subtask: n.id, from: n.from + e, to: n.to + e }));
135
135
  }
136
- function gt(o) {
137
- let t = !1, e = !1, s = !1, n = !1;
138
- for (const i of o ?? [])
139
- i === "provisional" ? (t = !0, e = !1) : i === "fixed" ? (e = !0, t = !1) : i === "muted" ? s = !0 : i === "open" && (n = !0);
140
- return { dashed: t, hatched: e, muted: s, open: n };
136
+ function yt(s) {
137
+ let t = !1, e = !1, n = !1, o = !1;
138
+ for (const i of s ?? [])
139
+ i === "provisional" ? (t = !0, e = !1) : i === "fixed" ? (e = !0, t = !1) : i === "muted" ? n = !0 : i === "open" && (o = !0);
140
+ return { dashed: t, hatched: e, muted: n, open: o };
141
141
  }
142
- const Pe = Fe(null), Be = Fe(null);
143
- function xe() {
144
- return Oe(Be);
142
+ const Be = Ee(null), xe = Ee(null);
143
+ function He() {
144
+ return Ne(xe);
145
145
  }
146
- function bs(o) {
147
- const t = Oe(Pe);
146
+ function Sn(s) {
147
+ const t = Ne(Be);
148
148
  if (t === null)
149
- throw new Error(`@umriss-ui/schedule: <${o}> must be used inside a <Schedule>.`);
149
+ throw new Error(`@umriss-ui/schedule: <${s}> must be used inside a <Schedule>.`);
150
150
  return t;
151
151
  }
152
- function zt(o, t, e, s, n) {
153
- const i = bs(o), r = G(null);
154
- W(() => (r.current = e(i, t), () => {
155
- r.current !== null && n(i, r.current), r.current = null;
156
- }), [i]), W(() => {
157
- r.current !== null && s(i, r.current, t);
152
+ function Vt(s, t, e, n, o) {
153
+ const i = Sn(s), r = G(null);
154
+ U(() => (r.current = e(i, t), () => {
155
+ r.current !== null && o(i, r.current), r.current = null;
156
+ }), [i]), U(() => {
157
+ r.current !== null && n(i, r.current, t);
158
158
  });
159
159
  }
160
- function Ms(o) {
161
- zt("Lane", o, (t, e) => t.registerLane(e), (t, e, s) => t.updateLane(e, s), (t, e) => t.unregisterLane(e));
160
+ function Ln(s) {
161
+ Vt("Lane", s, (t, e) => t.registerLane(e), (t, e, n) => t.updateLane(e, n), (t, e) => t.unregisterLane(e));
162
162
  }
163
- function Ts(o) {
164
- zt("LaneGroup", o, (t, e) => t.registerGroup(e), (t, e, s) => t.updateGroup(e, s), (t, e) => t.unregisterGroup(e));
163
+ function An(s) {
164
+ Vt("LaneGroup", s, (t, e) => t.registerGroup(e), (t, e, n) => t.updateGroup(e, n), (t, e) => t.unregisterGroup(e));
165
165
  }
166
- function Kt(o, t) {
167
- zt(o, t, (e, s) => e.registerLayer(s), (e, s, n) => e.updateLayer(s, n), (e, s) => e.unregisterLayer(s));
166
+ function vt(s, t) {
167
+ Vt(s, t, (e, n) => e.registerLayer(n), (e, n, o) => e.updateLayer(n, o), (e, n) => e.unregisterLayer(n));
168
168
  }
169
- const Is = 24, Ss = 4, Ls = 3, St = 4;
170
- function ue(o) {
171
- const { lanes: t, groups: e, collapsed: s, laneHeight: n } = o, i = new Map(e.map((g) => [g.id, g])), r = (g) => g !== void 0 && i.has(g) ? g : void 0, a = /* @__PURE__ */ new Map(), d = (g) => {
169
+ const Cn = 24, Dn = 4, _n = 3, Ct = 4;
170
+ function me(s) {
171
+ const { lanes: t, groups: e, collapsed: n, laneHeight: o } = s, i = new Map(e.map((k) => [k.id, k])), r = (k) => k !== void 0 && i.has(k) ? k : void 0, a = /* @__PURE__ */ new Map(), l = (k) => {
172
172
  const T = [];
173
- let S = r(g.parent);
173
+ let S = r(k.parent);
174
174
  const E = /* @__PURE__ */ new Set();
175
175
  for (; S !== void 0 && !E.has(S); )
176
176
  E.add(S), T.unshift(S), S = r(i.get(S).parent);
177
177
  return T;
178
178
  }, h = /* @__PURE__ */ new Map();
179
- for (const g of t) {
180
- const T = d(g);
181
- h.set(g.id, T);
179
+ for (const k of t) {
180
+ const T = l(k);
181
+ h.set(k.id, T);
182
182
  for (const S of T) {
183
183
  const E = a.get(S) ?? [];
184
- E.push(g.id), a.set(S, E);
184
+ E.push(k.id), a.set(S, E);
185
185
  }
186
186
  }
187
- const l = [], c = /* @__PURE__ */ new Map();
188
- let p = [], m = null, y = 0;
189
- const I = (g) => (l.push({ ...g, top: y }), y += g.height, l.length - 1), A = (g) => g.find((T) => s.has(T)), C = () => {
190
- if (m === null) return;
191
- const { row: g, lanes: T } = m, S = l[g], E = Math.max(S.height, T.length * Ss + 2 * St);
192
- l[g] = { ...S, height: E }, y += E - S.height;
193
- const D = E - 2 * St, P = Math.max(Ls, Math.floor(D / T.length));
194
- T.forEach((ot, kt) => {
195
- const ct = h.get(ot) ?? [];
196
- c.set(ot, {
197
- top: S.top + St + kt * P,
187
+ const d = [], c = /* @__PURE__ */ new Map();
188
+ let m = [], p = null, y = 0;
189
+ const I = (k) => (d.push({ ...k, top: y }), y += k.height, d.length - 1), A = (k) => k.find((T) => n.has(T)), C = () => {
190
+ if (p === null) return;
191
+ const { row: k, lanes: T } = p, S = d[k], E = Math.max(S.height, T.length * Dn + 2 * Ct);
192
+ d[k] = { ...S, height: E }, y += E - S.height;
193
+ const _ = E - 2 * Ct, P = Math.max(_n, Math.floor(_ / T.length));
194
+ T.forEach((it, wt) => {
195
+ const ut = h.get(it) ?? [];
196
+ c.set(it, {
197
+ top: S.top + Ct + wt * P,
198
198
  height: P,
199
199
  miniature: !0,
200
- group: ct[ct.length - 1]
200
+ group: ut[ut.length - 1]
201
201
  });
202
- }), m = null;
202
+ }), p = null;
203
203
  };
204
- for (const g of t) {
205
- const T = (h.get(g.id) ?? []).filter((D) => (a.get(D) ?? []).length > 0), S = A(T);
206
- if (m !== null && S === m.group) {
207
- m.lanes.push(g.id);
204
+ for (const k of t) {
205
+ const T = (h.get(k.id) ?? []).filter((_) => (a.get(_) ?? []).length > 0), S = A(T);
206
+ if (p !== null && S === p.group) {
207
+ p.lanes.push(k.id);
208
208
  continue;
209
209
  }
210
210
  C();
211
- const E = T.filter((D, P) => p[P] === D).length;
212
- p = p.slice(0, E);
213
- for (const D of T.slice(E)) {
214
- if (p.push(D), D === S) break;
211
+ const E = T.filter((_, P) => m[P] === _).length;
212
+ m = m.slice(0, E);
213
+ for (const _ of T.slice(E)) {
214
+ if (m.push(_), _ === S) break;
215
215
  I({
216
216
  kind: "groupHead",
217
217
  lane: void 0,
218
- group: D,
219
- depth: p.length - 1,
220
- within: [...p],
221
- lanes: (a.get(D) ?? []).length,
222
- height: Is
218
+ group: _,
219
+ depth: m.length - 1,
220
+ within: [...m],
221
+ lanes: (a.get(_) ?? []).length,
222
+ height: Cn
223
223
  });
224
224
  }
225
225
  if (S !== void 0) {
226
- const D = T.indexOf(S), P = I({
226
+ const _ = T.indexOf(S), P = I({
227
227
  kind: "miniature",
228
228
  lane: void 0,
229
229
  group: S,
230
- depth: D,
231
- within: T.slice(0, D + 1),
230
+ depth: _,
231
+ within: T.slice(0, _ + 1),
232
232
  lanes: (a.get(S) ?? []).length,
233
- height: n
233
+ height: o
234
234
  });
235
- m = { group: S, row: P, lanes: [g.id] };
235
+ p = { group: S, row: P, lanes: [k.id] };
236
236
  continue;
237
237
  }
238
- I({ kind: "lane", lane: g.id, group: T[T.length - 1], depth: T.length, within: T, lanes: 1, height: n }), c.set(g.id, {
239
- top: l[l.length - 1].top,
240
- height: n,
238
+ I({ kind: "lane", lane: k.id, group: T[T.length - 1], depth: T.length, within: T, lanes: 1, height: o }), c.set(k.id, {
239
+ top: d[d.length - 1].top,
240
+ height: o,
241
241
  miniature: !1,
242
242
  group: T[T.length - 1]
243
243
  });
244
244
  }
245
- return C(), { rows: l, slots: c, height: y };
245
+ return C(), { rows: d, slots: c, height: y };
246
246
  }
247
- function As(o, t) {
248
- if (t.size === 0) return o;
247
+ function Fn(s, t) {
248
+ if (t.size === 0) return s;
249
249
  const e = /* @__PURE__ */ new Set();
250
- for (const s of o) t.has(s) || e.add(s);
250
+ for (const n of s) t.has(n) || e.add(n);
251
251
  return e;
252
252
  }
253
- function st(o, t) {
254
- if (t < 0 || t >= o.height) return null;
255
- let e = 0, s = o.rows.length - 1;
256
- for (; e <= s; ) {
257
- const n = e + s >> 1, i = o.rows[n];
258
- if (t < i.top) s = n - 1;
259
- else if (t >= i.top + i.height) e = n + 1;
253
+ function st(s, t) {
254
+ if (t < 0 || t >= s.height) return null;
255
+ let e = 0, n = s.rows.length - 1;
256
+ for (; e <= n; ) {
257
+ const o = e + n >> 1, i = s.rows[o];
258
+ if (t < i.top) n = o - 1;
259
+ else if (t >= i.top + i.height) e = o + 1;
260
260
  else return i;
261
261
  }
262
262
  return null;
263
263
  }
264
- function Vt(o, t) {
265
- return o.slots.get(t) ?? null;
264
+ function Wt(s, t) {
265
+ return s.slots.get(t) ?? null;
266
266
  }
267
- function Cs(o, t) {
268
- const e = st(o, t);
267
+ function On(s, t) {
268
+ const e = st(s, t);
269
269
  if (e === null) return null;
270
270
  if (e.kind === "lane") return e.lane ?? null;
271
271
  if (e.kind === "groupHead") return null;
272
- for (const [s, n] of o.slots)
273
- if (n.miniature && t >= n.top && t < n.top + n.height) return s;
272
+ for (const [n, o] of s.slots)
273
+ if (o.miniature && t >= o.top && t < o.top + o.height) return n;
274
274
  return null;
275
275
  }
276
- const _s = 6, $e = 3, rt = 2, fe = 3, pe = 3;
277
- function N(o, t) {
278
- return Math.round(o.scale.toPx(H(t, o.calendar)));
276
+ const En = 6, Ge = 3, at = 2, pe = 3, ge = 3;
277
+ function R(s, t) {
278
+ return Math.round(s.scale.toPx(Y(t, s.calendar)));
279
279
  }
280
- function dt(o, t) {
281
- const e = Vt(o.rows, t);
282
- return e === null ? null : { ...e, top: e.top - o.scrollY };
280
+ function J(s, t) {
281
+ const e = Wt(s.rows, t);
282
+ return e === null ? null : { ...e, top: e.top - s.scrollY };
283
283
  }
284
- function me(o, t) {
285
- return Cs(o.rows, t + o.scrollY);
284
+ function Ut(s, t) {
285
+ const e = J(s, t.lane);
286
+ return e === null ? null : { x: R(s, t.at), y: e.top + e.height / 2, half: Math.max(2, Math.min(7, e.height * 0.3)) };
286
287
  }
287
- function Ge(o, t, e, s, n) {
288
- const i = s.miniature ? 0 : _s, r = s.miniature ? 0 : pe * fe, a = Math.max(s.miniature ? 1 : 4, s.height - 2 * i - r), d = s.top - o.scrollY + Math.floor((s.height - a) / 2), h = nt(t);
288
+ function ke(s, t) {
289
+ return On(s.rows, t + s.scrollY);
290
+ }
291
+ function Ye(s, t, e, n, o) {
292
+ const i = n.miniature ? 0 : En, r = n.miniature ? 0 : ge * pe, a = Math.max(n.miniature ? 1 : 4, n.height - 2 * i - r), l = n.top - s.scrollY + Math.floor((n.height - a) / 2), h = ot(t);
289
293
  return {
290
294
  subtask: t,
291
295
  lane: e,
292
- miniature: s.miniature,
293
- depth: n,
294
- y: d + (s.miniature ? 0 : Math.min(n, pe) * fe),
296
+ miniature: n.miniature,
297
+ depth: o,
298
+ y: l + (n.miniature ? 0 : Math.min(o, ge) * pe),
295
299
  height: a,
296
- outerFrom: N(o, h.from),
297
- mainFrom: N(o, t.from),
298
- mainTo: N(o, t.to),
299
- outerTo: N(o, h.to)
300
+ outerFrom: R(s, h.from),
301
+ mainFrom: R(s, t.from),
302
+ mainTo: R(s, t.to),
303
+ outerTo: R(s, h.to)
300
304
  };
301
305
  }
302
- function He(o, t, e) {
303
- if (e < o.y || e > o.y + o.height) return null;
304
- const s = Math.max(0, (6 - (o.outerTo - o.outerFrom)) / 2);
305
- return t < o.outerFrom - s || t > o.outerTo + s ? null : t < o.mainFrom ? "leadIn" : t > o.mainTo ? "leadOut" : "main";
306
+ function ze(s, t, e) {
307
+ if (e < s.y || e > s.y + s.height) return null;
308
+ const n = Math.max(0, (6 - (s.outerTo - s.outerFrom)) / 2);
309
+ return t < s.outerFrom - n || t > s.outerTo + n ? null : t < s.mainFrom ? "leadIn" : t > s.mainTo ? "leadOut" : "main";
306
310
  }
307
- function Ds(o, t, e, s = 5) {
308
- if (e < o.y || e > o.y + o.height) return null;
309
- const n = Math.abs(t - o.mainFrom), i = Math.abs(t - o.mainTo);
310
- return Math.min(n, i) > s ? null : n <= i ? "from" : "to";
311
+ function Nn(s, t, e, n = 5) {
312
+ if (e < s.y || e > s.y + s.height) return null;
313
+ const o = Math.abs(t - s.mainFrom), i = Math.abs(t - s.mainTo);
314
+ return Math.min(o, i) > n ? null : o <= i ? "from" : "to";
311
315
  }
312
- function Ft(o, t, e) {
313
- return o.outerTo >= 0 && o.outerFrom <= t && o.y + o.height >= 0 && o.y <= e;
316
+ function Et(s, t, e) {
317
+ return s.outerTo >= 0 && s.outerFrom <= t && s.y + s.height >= 0 && s.y <= e;
314
318
  }
315
- const Fs = 64;
316
- function Os(o, t) {
317
- if (o.miniature) return null;
318
- const e = gt(o.subtask.appearance).hatched ? rt + $e + 1 : 0, s = Math.max(o.mainFrom + e, 0), n = Math.min(o.mainTo - e, t) - s;
319
- return n < Fs ? null : { x: s, width: n, y: o.y, height: o.height };
319
+ const Rn = 64;
320
+ function Pn(s, t) {
321
+ if (s.miniature) return null;
322
+ const e = yt(s.subtask.appearance).hatched ? at + Ge + 1 : 0, n = Math.max(s.mainFrom + e, 0), o = Math.min(s.mainTo - e, t) - n;
323
+ return o < Rn ? null : { x: n, width: o, y: s.y, height: s.height };
320
324
  }
321
- const Es = 10;
322
- function ge(o, t, e) {
323
- const s = Math.round(t.y + t.height / 2);
324
- return o === "centre" || e.y === t.y ? s : Math.round(e.y > t.y ? t.y + t.height - 1 : t.y + 1);
325
+ const $n = 10;
326
+ function ye(s, t, e) {
327
+ const n = Math.round(t.y + t.height / 2);
328
+ return s === "centre" || e.y === t.y ? n : Math.round(e.y > t.y ? t.y + t.height - 1 : t.y + 1);
325
329
  }
326
- function Ot(o, t, e, s, n) {
327
- const i = t.route ?? n.route, r = t.attach ?? n.attach, a = t.ends ?? n.ends, d = N(o, $t(t, e.subtask)), h = N(o, Gt(t, s.subtask)), l = ge(r, e, s), c = ge(r, s, e);
330
+ function Nt(s, t, e, n, o) {
331
+ const i = t.route ?? o.route, r = t.attach ?? o.attach, a = t.ends ?? o.ends, l = R(s, Gt(t, e.subtask)), h = R(s, Yt(t, n.subtask)), d = ye(r, e, n), c = ye(r, n, e);
328
332
  if (i === "straight")
329
- return { dependency: t, kind: i, ends: a, x1: d, y1: l, x2: h, y2: c, c1x: d, c2x: h, points: [d, l, h, c] };
333
+ return { dependency: t, kind: i, ends: a, x1: l, y1: d, x2: h, y2: c, c1x: l, c2x: h, points: [l, d, h, c] };
330
334
  if (i === "orthogonal") {
331
- const A = d + Es, C = l === c ? A : Math.round((A + h) / 2);
332
- return { dependency: t, kind: i, ends: a, x1: d, y1: l, x2: h, y2: c, c1x: d, c2x: h, points: l === c ? [d, l, h, c] : [d, l, C, l, C, c, h, c] };
335
+ const A = l + $n, C = d === c ? A : Math.round((A + h) / 2);
336
+ return { dependency: t, kind: i, ends: a, x1: l, y1: d, x2: h, y2: c, c1x: l, c2x: h, points: d === c ? [l, d, h, c] : [l, d, C, d, C, c, h, c] };
333
337
  }
334
- const p = Math.max(14, Math.abs(h - d) / 2), m = d + p, y = h - p, I = [];
338
+ const m = Math.max(14, Math.abs(h - l) / 2), p = l + m, y = h - m, I = [];
335
339
  for (let A = 0; A <= 16; A++) {
336
- const C = A / 16, g = 1 - C;
340
+ const C = A / 16, k = 1 - C;
337
341
  I.push(
338
- g * g * g * d + 3 * g * g * C * m + 3 * g * C * C * y + C * C * C * h,
339
- g * g * g * l + 3 * g * g * C * l + 3 * g * C * C * c + C * C * C * c
342
+ k * k * k * l + 3 * k * k * C * p + 3 * k * C * C * y + C * C * C * h,
343
+ k * k * k * d + 3 * k * k * C * d + 3 * k * C * C * c + C * C * C * c
340
344
  );
341
345
  }
342
- return { dependency: t, kind: "curve", ends: a, x1: d, y1: l, x2: h, y2: c, c1x: m, c2x: y, points: I };
346
+ return { dependency: t, kind: "curve", ends: a, x1: l, y1: d, x2: h, y2: c, c1x: p, c2x: y, points: I };
343
347
  }
344
- function Rs(o, t, e) {
345
- let s = 1 / 0;
346
- const n = o.points;
347
- for (let i = 0; i + 3 < n.length; i += 2) {
348
- const r = n[i], a = n[i + 1], d = n[i + 2], h = n[i + 3], l = d - r, c = h - a, p = l * l + c * c, m = p === 0 ? 0 : Math.max(0, Math.min(1, ((t - r) * l + (e - a) * c) / p));
349
- s = Math.min(s, Math.hypot(t - (r + m * l), e - (a + m * c)));
348
+ function Bn(s, t, e) {
349
+ let n = 1 / 0;
350
+ const o = s.points;
351
+ for (let i = 0; i + 3 < o.length; i += 2) {
352
+ const r = o[i], a = o[i + 1], l = o[i + 2], h = o[i + 3], d = l - r, c = h - a, m = d * d + c * c, p = m === 0 ? 0 : Math.max(0, Math.min(1, ((t - r) * d + (e - a) * c) / m));
353
+ n = Math.min(n, Math.hypot(t - (r + p * d), e - (a + p * c)));
350
354
  }
351
- return s;
355
+ return n;
352
356
  }
353
- const Ye = [], Ns = 56;
354
- function Ps(o, t = Ns) {
355
- return o > 0 ? Math.min(U, Math.max(15 * q, ls(o * t, 1))) : 15 * q;
357
+ const Ke = [], xn = 56;
358
+ function Hn(s, t = xn) {
359
+ return s > 0 ? Math.min(X, Math.max(15 * q, un(s * t, 1))) : 15 * q;
356
360
  }
357
- function Bs(o, t, e = Ye) {
358
- const [s, n] = ze(o, e);
359
- return ds(e, s, n, t, Pt(s)).filter(
360
- (i) => i.workingTime >= o[0] && i.workingTime <= o[1]
361
+ function Gn(s, t, e = Ke) {
362
+ const [n, o] = Ve(s, e);
363
+ return fn(e, n, o, t, Bt(n)).filter(
364
+ (i) => i.workingTime >= s[0] && i.workingTime <= s[1]
361
365
  );
362
366
  }
363
- function xs(o, t = Ye) {
364
- const [e, s] = ze(o, t), n = [], i = new Date(e);
365
- for (i.setHours(0, 0, 0, 0); i.getTime() < s && n.length < 400; ) {
367
+ function Yn(s, t = Ke) {
368
+ const [e, n] = Ve(s, t), o = [], i = new Date(e);
369
+ for (i.setHours(0, 0, 0, 0); i.getTime() < n && o.length < 400; ) {
366
370
  const r = i.getTime();
367
371
  i.setDate(i.getDate() + 1);
368
372
  const a = i.getTime();
369
- n.push({
373
+ o.push({
370
374
  start: r,
371
375
  end: a,
372
- from: H(r, t),
373
- to: H(a, t)
376
+ from: Y(r, t),
377
+ to: Y(a, t)
374
378
  });
375
379
  }
376
- return n;
380
+ return o;
377
381
  }
378
- const Lt = [1, 2, 7, 14, 28];
379
- function $s(o, t) {
380
- return Lt.find((e) => e * o >= t) ?? Lt[Lt.length - 1];
382
+ const Dt = [1, 2, 7, 14, 28];
383
+ function zn(s, t) {
384
+ return Dt.find((e) => e * s >= t) ?? Dt[Dt.length - 1];
381
385
  }
382
- function At(o, t) {
383
- return ((Math.round((o - Pt(o)) / U) - 4) % t + t) % t === 0;
386
+ function _t(s, t) {
387
+ return ((Math.round((s - Bt(s)) / X) - 4) % t + t) % t === 0;
384
388
  }
385
- function Gs(o, t, e, s) {
386
- const n = o[1] - o[0];
387
- if (!(n > 0)) return [o[0], o[1]];
388
- const i = Math.min(s.max, Math.max(s.min, n * e)), r = (t - o[0]) / n, a = t - r * i;
389
+ function Kn(s, t, e, n) {
390
+ const o = s[1] - s[0];
391
+ if (!(o > 0)) return [s[0], s[1]];
392
+ const i = Math.min(n.max, Math.max(n.min, o * e)), r = (t - s[0]) / o, a = t - r * i;
389
393
  return [a, a + i];
390
394
  }
391
- function Hs(o, t) {
392
- return [o[0] + t, o[1] + t];
395
+ function Vn(s, t) {
396
+ return [s[0] + t, s[1] + t];
393
397
  }
394
- function ze(o, t) {
395
- const e = et(t);
396
- if (e.intervals.length === 0) return [o[0], o[1]];
397
- const s = (n) => Math.max(0, Math.min(e.total, n));
398
- return [j(s(o[0]), e), j(s(o[1]), e)];
398
+ function Ve(s, t) {
399
+ const e = nt(t);
400
+ if (e.intervals.length === 0) return [s[0], s[1]];
401
+ const n = (o) => Math.max(0, Math.min(e.total, o));
402
+ return [j(n(s[0]), e), j(n(s[1]), e)];
399
403
  }
400
- const pt = 44;
401
- class Ys {
404
+ const gt = 44;
405
+ class Wn {
402
406
  constructor(t) {
403
407
  f(this, "options", {
404
- laneHeight: pt,
408
+ laneHeight: gt,
405
409
  calendar: [],
406
- zoomLimits: { min: Bt, max: 28 * U },
410
+ zoomLimits: { min: xt, max: 28 * X },
407
411
  snap: "ticks",
408
412
  intents: [],
409
413
  now: null,
@@ -411,14 +415,14 @@ class Ys {
411
415
  attach: "centre",
412
416
  ends: "dot"
413
417
  });
414
- f(this, "domain", [0, U]);
418
+ f(this, "domain", [0, X]);
415
419
  f(this, "scrollY", 0);
416
420
  f(this, "width", 0);
417
421
  f(this, "height", 0);
418
422
  /* What is laid out from top to bottom (`rows.ts`). It is derived here and
419
423
  not in the data, because a row's height comes from a view option; every y
420
424
  in the package reads it. */
421
- f(this, "rows", ue({ lanes: [], groups: [], collapsed: /* @__PURE__ */ new Set(), laneHeight: pt }));
425
+ f(this, "rows", me({ lanes: [], groups: [], collapsed: /* @__PURE__ */ new Set(), laneHeight: gt }));
422
426
  /** The folded groups, as the scene holds them. */
423
427
  f(this, "collapsed", /* @__PURE__ */ new Set());
424
428
  /** The groups a gesture in flight holds open. Dropped when it ends; the
@@ -431,22 +435,22 @@ class Ys {
431
435
  }
432
436
  /** Takes new options; a new calendar keeps the wall-clock span in view. */
433
437
  setOptions(t) {
434
- const e = t.calendar !== this.options.calendar, s = this.options.calendar;
438
+ const e = t.calendar !== this.options.calendar, n = this.options.calendar;
435
439
  if (this.options = t, e) {
436
- const n = et(s), i = (r) => {
437
- const a = n.intervals.length === 0 ? r : Math.max(0, Math.min(n.total, r));
438
- return H(j(a, n), t.calendar) + (r - a);
440
+ const o = nt(n), i = (r) => {
441
+ const a = o.intervals.length === 0 ? r : Math.max(0, Math.min(o.total, r));
442
+ return Y(j(a, o), t.calendar) + (r - a);
439
443
  };
440
444
  this.domain = [i(this.domain[0]), i(this.domain[1])];
441
445
  }
442
446
  }
443
447
  /** Puts a span of two wall-clock instants in view. */
444
448
  showWall(t) {
445
- this.domain = [H(t[0], this.options.calendar), H(t[1], this.options.calendar)];
449
+ this.domain = [Y(t[0], this.options.calendar), Y(t[1], this.options.calendar)];
446
450
  }
447
451
  viewport() {
448
452
  return {
449
- scale: new hs(this.domain, [0, this.width]),
453
+ scale: new mn(this.domain, [0, this.width]),
450
454
  calendar: this.options.calendar,
451
455
  laneHeight: this.options.laneHeight,
452
456
  scrollY: this.scrollY,
@@ -463,41 +467,41 @@ class Ys {
463
467
  /** The fine band's step at the current zoom. */
464
468
  step() {
465
469
  const t = this.domain[1] - this.domain[0];
466
- return Ps(this.width > 0 ? t / this.width : t);
470
+ return Hn(this.width > 0 ? t / this.width : t);
467
471
  }
468
472
  /** Lays the rows out, clamps the scroll, and lays the data out anew. */
469
473
  layout() {
470
- this.rows = ue({
474
+ this.rows = me({
471
475
  lanes: this.data.lanes,
472
476
  groups: this.data.groups,
473
- collapsed: As(this.collapsed, this.openForGesture),
477
+ collapsed: Fn(this.collapsed, this.openForGesture),
474
478
  laneHeight: this.options.laneHeight
475
479
  }), this.scrollY = Math.max(0, Math.min(this.maxScroll(), this.scrollY));
476
480
  const t = this.viewport();
477
481
  this.boxes = [], this.boxById = /* @__PURE__ */ new Map();
478
482
  for (const e of this.data.subtasks) {
479
- const s = Vt(this.rows, e.lane);
480
- if (s === null) continue;
481
- const n = Ge(t, e, e.lane, s, this.data.depth.get(e.id) ?? 0);
482
- this.boxes.push(n), this.boxById.set(e.id, n);
483
+ const n = Wt(this.rows, e.lane);
484
+ if (n === null) continue;
485
+ const o = Ye(t, e, e.lane, n, this.data.depth.get(e.id) ?? 0);
486
+ this.boxes.push(o), this.boxById.set(e.id, o);
483
487
  }
484
488
  this.paths = [];
485
489
  for (const e of this.data.dependencies) {
486
- const s = this.boxById.get(e.from), n = this.boxById.get(e.to);
487
- s === void 0 || n === void 0 || this.paths.push(Ot(t, e, s, n, this.options));
490
+ const n = this.boxById.get(e.from), o = this.boxById.get(e.to);
491
+ n === void 0 || o === void 0 || this.paths.push(Nt(t, e, n, o, this.options));
488
492
  }
489
493
  }
490
494
  /** The days of the coarse band and the ticks of the fine band, in pixels. */
491
495
  bands() {
492
496
  const t = this.step();
493
497
  if (this.width <= 0) return { days: [], ticks: [], step: t };
494
- const e = this.viewport().scale, s = this.options.calendar;
498
+ const e = this.viewport().scale, n = this.options.calendar;
495
499
  return {
496
- days: xs(this.domain, s).map((n) => {
497
- const i = Math.round(e.toPx(n.from));
498
- return { start: n.start, x: i, width: Math.round(e.toPx(n.to)) - i };
500
+ days: Yn(this.domain, n).map((o) => {
501
+ const i = Math.round(e.toPx(o.from));
502
+ return { start: o.start, x: i, width: Math.round(e.toPx(o.to)) - i };
499
503
  }),
500
- ticks: Bs(this.domain, t, s).map((n) => ({ wallClock: n.wallClock, x: Math.round(e.toPx(n.workingTime)) })),
504
+ ticks: Gn(this.domain, t, n).map((o) => ({ wallClock: o.wallClock, x: Math.round(e.toPx(o.workingTime)) })),
501
505
  step: t
502
506
  };
503
507
  }
@@ -505,27 +509,32 @@ class Ys {
505
509
  nowX() {
506
510
  const t = this.options.now;
507
511
  if (t === null || this.width <= 0) return null;
508
- const e = Math.round(this.viewport().scale.toPx(H(t, this.options.calendar)));
512
+ const e = Math.round(this.viewport().scale.toPx(Y(t, this.options.calendar)));
509
513
  return e >= 0 && e <= this.width ? e : null;
510
514
  }
511
515
  hitAt(t, e) {
512
- for (let r = this.boxes.length - 1; r >= 0; r--) {
513
- const a = this.boxes[r], d = He(a, t, e);
514
- if (d !== null) return { kind: "subtask", subtask: a.subtask, part: d };
516
+ const n = this.viewport();
517
+ for (let a = this.data.milestones.length - 1; a >= 0; a--) {
518
+ const l = this.data.milestones[a], h = Ut(n, l);
519
+ if (h !== null && Math.abs(t - h.x) + Math.abs(e - h.y) <= h.half + 2) return { kind: "milestone", milestone: l };
520
+ }
521
+ for (let a = this.boxes.length - 1; a >= 0; a--) {
522
+ const l = this.boxes[a], h = ze(l, t, e);
523
+ if (h !== null) return { kind: "subtask", subtask: l.subtask, part: h };
515
524
  }
516
- let s = null, n = 4;
517
- for (const r of this.paths) {
518
- const a = Rs(r, t, e);
519
- a <= n && (n = a, s = r);
525
+ let o = null, i = 4;
526
+ for (const a of this.paths) {
527
+ const l = Bn(a, t, e);
528
+ l <= i && (i = l, o = a);
520
529
  }
521
- if (s !== null) return { kind: "dependency", dependency: s.dependency };
522
- const i = me(this.viewport(), e);
523
- return i !== null ? { kind: "lane", lane: i } : { kind: "nothing" };
530
+ if (o !== null) return { kind: "dependency", dependency: o.dependency };
531
+ const r = ke(this.viewport(), e);
532
+ return r !== null ? { kind: "lane", lane: r } : { kind: "nothing" };
524
533
  }
525
534
  /** The wall-clock time at a plot x; within the calendar's extent. */
526
535
  timeAt(t) {
527
- const e = this.viewport().scale.fromPx(t), s = et(this.options.calendar);
528
- return s.intervals.length === 0 ? e : j(Math.max(0, Math.min(s.total, e)), s);
536
+ const e = this.viewport().scale.fromPx(t), n = nt(this.options.calendar);
537
+ return n.intervals.length === 0 ? e : j(Math.max(0, Math.min(n.total, e)), n);
529
538
  }
530
539
  /** The lane at a y, strips included: what the pointer is ON.
531
540
 
@@ -534,7 +543,7 @@ class Ys {
534
543
  `foldedGroupAt` - and a caller that reached through `viewport()` for it
535
544
  would be depending on the layout rather than asking the view. */
536
545
  laneIdAt(t) {
537
- return me(this.viewport(), t);
546
+ return ke(this.viewport(), t);
538
547
  }
539
548
  /** The lane a DROP at this y would land on.
540
549
 
@@ -555,312 +564,326 @@ class Ys {
555
564
  /** Pans by pixels. Says what moved: the span through time, the lanes, or
556
565
  neither - a scroll through the lanes is no news about the time. */
557
566
  pan(t, e) {
558
- const s = this.domain[0], n = this.scrollY, i = this.domain[1] - s;
559
- this.width > 0 && t !== 0 && (this.domain = Hs(this.domain, t / this.width * i)), this.scrollY = Math.max(0, Math.min(this.maxScroll(), this.scrollY + e));
560
- const r = this.domain[0] !== s;
561
- return { moved: r || this.scrollY !== n, time: r };
567
+ const n = this.domain[0], o = this.scrollY, i = this.domain[1] - n;
568
+ this.width > 0 && t !== 0 && (this.domain = Vn(this.domain, t / this.width * i)), this.scrollY = Math.max(0, Math.min(this.maxScroll(), this.scrollY + e));
569
+ const r = this.domain[0] !== n;
570
+ return { moved: r || this.scrollY !== o, time: r };
562
571
  }
563
572
  /** Zooms around a plot x; says whether the span changed. */
564
573
  zoomAt(t, e) {
565
574
  if (this.width <= 0 || !Number.isFinite(e)) return !1;
566
- const s = this.domain, n = this.viewport().scale.fromPx(t);
567
- return this.domain = Gs(this.domain, n, e, this.options.zoomLimits), s[0] !== this.domain[0] || s[1] !== this.domain[1];
568
- }
569
- }
570
- const zs = "_root_1892z_4 _text_r8i8z_23", Ks = "_corner_1892z_19", Vs = "_dayBand_1892z_23", Ws = "_tickBand_1892z_24", Us = "_day_1892z_23", Xs = "_dayLabel_1892z_50", qs = "_tick_1892z_24", js = "_tickLabel_1892z_71", Js = "_headers_1892z_79", Zs = "_header_1892z_79", Qs = "_headerLabel_1892z_97", tn = "_headerCount_1892z_134", en = "_chevron_1892z_143", sn = "_plot_1892z_201", nn = "_focusRing_1892z_208", on = "_layer_1892z_226", rn = "_grip_1892z_235", an = "_ghostLabel_1892z_245", ln = "_finding_1892z_258", dn = "_refusal_1892z_266", hn = "_tooltip_1892z_270", cn = "_tooltipHead_1892z_289", un = "_tooltipTimes_1892z_294", fn = "_now_1892z_303", pn = "_barLabel_1892z_317", mn = "_barLabelText_1892z_330", v = {
571
- root: zs,
572
- corner: Ks,
573
- dayBand: Vs,
574
- tickBand: Ws,
575
- day: Us,
576
- dayLabel: Xs,
577
- tick: qs,
578
- tickLabel: js,
579
- headers: Js,
580
- header: Zs,
581
- headerLabel: Qs,
582
- headerCount: tn,
583
- chevron: en,
584
- plot: sn,
585
- focusRing: nn,
586
- layer: on,
587
- grip: rn,
588
- ghostLabel: an,
589
- finding: ln,
590
- refusal: dn,
591
- tooltip: hn,
592
- tooltipHead: cn,
593
- tooltipTimes: un,
594
- now: fn,
595
- barLabel: pn,
596
- barLabelText: mn
575
+ const n = this.domain, o = this.viewport().scale.fromPx(t);
576
+ return this.domain = Kn(this.domain, o, e, this.options.zoomLimits), n[0] !== this.domain[0] || n[1] !== this.domain[1];
577
+ }
578
+ }
579
+ const Un = "_root_1892z_4 _text_1krlf_23", Xn = "_corner_1892z_19", qn = "_dayBand_1892z_23", jn = "_tickBand_1892z_24", Jn = "_day_1892z_23", Zn = "_dayLabel_1892z_50", Qn = "_tick_1892z_24", ts = "_tickLabel_1892z_71", es = "_headers_1892z_79", ns = "_header_1892z_79", ss = "_headerLabel_1892z_97", os = "_headerCount_1892z_134", is = "_chevron_1892z_143", rs = "_plot_1892z_201", as = "_focusRing_1892z_208", ls = "_layer_1892z_226", ds = "_grip_1892z_235", hs = "_ghostLabel_1892z_245", cs = "_finding_1892z_258", us = "_refusal_1892z_266", fs = "_tooltip_1892z_270", ms = "_tooltipHead_1892z_289", ps = "_tooltipTimes_1892z_294", gs = "_now_1892z_303", ks = "_barLabel_1892z_317", ys = "_barLabelText_1892z_330", v = {
580
+ root: Un,
581
+ corner: Xn,
582
+ dayBand: qn,
583
+ tickBand: jn,
584
+ day: Jn,
585
+ dayLabel: Zn,
586
+ tick: Qn,
587
+ tickLabel: ts,
588
+ headers: es,
589
+ header: ns,
590
+ headerLabel: ss,
591
+ headerCount: os,
592
+ chevron: is,
593
+ plot: rs,
594
+ focusRing: as,
595
+ layer: ls,
596
+ grip: ds,
597
+ ghostLabel: hs,
598
+ finding: cs,
599
+ refusal: us,
600
+ tooltip: fs,
601
+ tooltipHead: ms,
602
+ tooltipTimes: ps,
603
+ now: gs,
604
+ barLabel: ks,
605
+ barLabelText: ys
597
606
  };
598
- function Ke() {
599
- const o = mt();
607
+ function We() {
608
+ const s = kt();
600
609
  return (t) => {
601
- const e = Math.round(t / q), s = Math.floor(e / 60), n = e % 60;
602
- return [s > 0 ? o.hoursShort(s) : "", n > 0 || s === 0 ? o.minutesShort(n) : ""].filter(Boolean).join(" ");
610
+ const e = Math.round(t / q), n = Math.floor(e / 60), o = e % 60;
611
+ return [n > 0 ? s.hoursShort(n) : "", o > 0 || n === 0 ? s.minutesShort(o) : ""].filter(Boolean).join(" ");
603
612
  };
604
613
  }
605
- function gn({ target: o, lane: t }) {
606
- const e = xt(), s = mt(), n = Ke(), i = (c) => e.time(new Date(c), !1);
607
- if (o.kind === "subtask") {
608
- const { subtask: c, task: p } = o, m = [
609
- (p == null ? void 0 : p.name) ?? c.task,
614
+ function vs({ target: s, lane: t }) {
615
+ const e = Ht(), n = kt(), o = We(), i = (c) => e.time(new Date(c), !1);
616
+ if (s.kind === "subtask") {
617
+ const { subtask: c, task: m } = s, p = [
618
+ (m == null ? void 0 : m.name) ?? c.task,
610
619
  c.name ?? c.id,
611
- `${e.dateShort(new Date(c.from))} ${s.scheduleGhostTimes(i(c.from), i(c.to))}`,
612
- ...o.overlapping.map((y) => s.scheduleOverlapWith(y.name ?? y.id)),
613
- ...o.violatedDependencies.map((y) => s.scheduleViolatedBy(n(y.shortBy))),
614
- ...o.blocked.map((y) => s.scheduleInBlockedTime(y.label))
620
+ `${e.dateShort(new Date(c.from))} ${n.scheduleGhostTimes(i(c.from), i(c.to))}`,
621
+ ...s.overlapping.map((y) => n.scheduleOverlapWith(y.name ?? y.id)),
622
+ ...s.violatedDependencies.map((y) => n.scheduleViolatedBy(o(y.shortBy))),
623
+ ...s.blocked.map((y) => n.scheduleInBlockedTime(y.label))
615
624
  ];
616
- return /* @__PURE__ */ K(Dt, { children: [
625
+ return /* @__PURE__ */ H(lt, { children: [
626
+ t,
627
+ `, ${p.join(", ")}`
628
+ ] });
629
+ }
630
+ if (s.kind === "milestone") {
631
+ const { milestone: c } = s;
632
+ return /* @__PURE__ */ H(lt, { children: [
617
633
  t,
618
- `, ${m.join(", ")}`
634
+ `, ${n.scheduleMilestone(c.label ?? c.id)}, ${e.dateShort(new Date(c.at))} ${i(c.at)}`
619
635
  ] });
620
636
  }
621
- const { dependency: r, task: a, from: d, to: h, violated: l } = o;
637
+ const { dependency: r, task: a, from: l, to: h, violated: d } = s;
622
638
  return [
623
639
  (a == null ? void 0 : a.name) ?? (a == null ? void 0 : a.id) ?? r.id,
624
- `${s.scheduleDependency} ${n(r.lag)}`,
625
- s.scheduleRoute((d == null ? void 0 : d.name) ?? r.from, (h == null ? void 0 : h.name) ?? r.to),
626
- ...l === void 0 ? [] : [s.scheduleViolatedBy(n(l.shortBy))]
640
+ `${n.scheduleDependency} ${o(r.lag)}`,
641
+ n.scheduleRoute((l == null ? void 0 : l.name) ?? r.from, (h == null ? void 0 : h.name) ?? r.to),
642
+ ...d === void 0 ? [] : [n.scheduleViolatedBy(o(d.shortBy))]
627
643
  ].join(", ");
628
644
  }
629
- function kn({ target: o }) {
630
- const t = xt(), e = mt(), s = (l) => t.time(new Date(l), !1), n = Ke();
631
- if (o.kind === "subtask") {
632
- const { subtask: l, task: c } = o;
633
- return /* @__PURE__ */ K(Dt, { children: [
634
- /* @__PURE__ */ k("span", { className: v.tooltipHead, children: (c == null ? void 0 : c.name) ?? l.task }),
635
- /* @__PURE__ */ k("span", { children: l.name ?? l.id }),
636
- /* @__PURE__ */ k("span", { className: v.tooltipTimes, children: e.scheduleGhostTimes(s(l.from), s(l.to)) }),
637
- (l.leadIn ?? 0) > 0 && /* @__PURE__ */ k("span", { children: `${e.scheduleLeadIn} ${n(l.leadIn)}` }),
638
- (l.leadOut ?? 0) > 0 && /* @__PURE__ */ k("span", { children: `${e.scheduleLeadOut} ${n(l.leadOut)}` }),
639
- o.overlapping.map((p) => /* @__PURE__ */ k("span", { className: v.finding, children: e.scheduleOverlapWith(p.name ?? p.id) }, p.id)),
640
- o.violatedDependencies.map((p) => /* @__PURE__ */ k("span", { className: v.finding, children: e.scheduleViolatedBy(n(p.shortBy)) }, p.dependency)),
641
- o.blocked.map((p) => /* @__PURE__ */ k("span", { className: v.finding, children: e.scheduleInBlockedTime(p.label) }, p.id))
645
+ function ws({ target: s }) {
646
+ const t = Ht(), e = kt(), n = (d) => t.time(new Date(d), !1), o = We();
647
+ if (s.kind === "subtask") {
648
+ const { subtask: d, task: c } = s;
649
+ return /* @__PURE__ */ H(lt, { children: [
650
+ /* @__PURE__ */ g("span", { className: v.tooltipHead, children: (c == null ? void 0 : c.name) ?? d.task }),
651
+ /* @__PURE__ */ g("span", { children: d.name ?? d.id }),
652
+ /* @__PURE__ */ g("span", { className: v.tooltipTimes, children: e.scheduleGhostTimes(n(d.from), n(d.to)) }),
653
+ (d.leadIn ?? 0) > 0 && /* @__PURE__ */ g("span", { children: `${e.scheduleLeadIn} ${o(d.leadIn)}` }),
654
+ (d.leadOut ?? 0) > 0 && /* @__PURE__ */ g("span", { children: `${e.scheduleLeadOut} ${o(d.leadOut)}` }),
655
+ s.overlapping.map((m) => /* @__PURE__ */ g("span", { className: v.finding, children: e.scheduleOverlapWith(m.name ?? m.id) }, m.id)),
656
+ s.violatedDependencies.map((m) => /* @__PURE__ */ g("span", { className: v.finding, children: e.scheduleViolatedBy(o(m.shortBy)) }, m.dependency)),
657
+ s.blocked.map((m) => /* @__PURE__ */ g("span", { className: v.finding, children: e.scheduleInBlockedTime(m.label) }, m.id))
658
+ ] });
659
+ }
660
+ if (s.kind === "milestone") {
661
+ const { milestone: d } = s;
662
+ return /* @__PURE__ */ H(lt, { children: [
663
+ /* @__PURE__ */ g("span", { className: v.tooltipHead, children: e.scheduleMilestone(d.label ?? d.id) }),
664
+ /* @__PURE__ */ g("span", { className: v.tooltipTimes, children: `${t.dateShort(new Date(d.at))} ${n(d.at)}` })
642
665
  ] });
643
666
  }
644
- const { dependency: i, task: r, from: a, to: d, violated: h } = o;
645
- return /* @__PURE__ */ K(Dt, { children: [
646
- /* @__PURE__ */ k("span", { className: v.tooltipHead, children: (r == null ? void 0 : r.name) ?? (r == null ? void 0 : r.id) ?? i.id }),
647
- /* @__PURE__ */ k("span", { children: e.scheduleRoute((a == null ? void 0 : a.name) ?? i.from, (d == null ? void 0 : d.name) ?? i.to) }),
648
- /* @__PURE__ */ k("span", { children: `${e.scheduleDependency} ${n(i.lag)}` }),
649
- h !== void 0 && /* @__PURE__ */ k("span", { className: v.finding, children: e.scheduleViolatedBy(n(h.shortBy)) })
667
+ const { dependency: i, task: r, from: a, to: l, violated: h } = s;
668
+ return /* @__PURE__ */ H(lt, { children: [
669
+ /* @__PURE__ */ g("span", { className: v.tooltipHead, children: (r == null ? void 0 : r.name) ?? (r == null ? void 0 : r.id) ?? i.id }),
670
+ /* @__PURE__ */ g("span", { children: e.scheduleRoute((a == null ? void 0 : a.name) ?? i.from, (l == null ? void 0 : l.name) ?? i.to) }),
671
+ /* @__PURE__ */ g("span", { children: `${e.scheduleDependency} ${o(i.lag)}` }),
672
+ h !== void 0 && /* @__PURE__ */ g("span", { className: v.finding, children: e.scheduleViolatedBy(o(h.shortBy)) })
650
673
  ] });
651
674
  }
652
- const yn = [], ke = { min: Bt, max: 28 * U }, vn = [], ye = 20, Ct = 44, wn = Ee(function(t, e) {
653
- var de;
675
+ const bs = [], ve = { min: xt, max: 28 * X }, Ms = [], we = 20, Ft = 44, Ts = Re(function(t, e) {
676
+ var ce;
654
677
  const {
655
- scene: s,
656
- ariaLabel: n,
678
+ scene: n,
679
+ ariaLabel: o,
657
680
  height: i = 400,
658
- laneHeight: r = pt,
681
+ laneHeight: r = gt,
659
682
  headerWidth: a = 160,
660
- calendar: d = vn,
683
+ calendar: l = Ms,
661
684
  zoomLimits: h,
662
- snap: l = "ticks",
663
- intents: c = yn,
664
- onIntent: p,
665
- canMoveTo: m,
685
+ snap: d = "ticks",
686
+ intents: c = bs,
687
+ onIntent: m,
688
+ canMoveTo: p,
666
689
  onInteraction: y,
667
690
  selectedTask: I,
668
691
  onSelectedTaskChange: A,
669
692
  placing: C,
670
- route: g = "curve",
693
+ route: k = "curve",
671
694
  attach: T = "centre",
672
695
  ends: S = "dot",
673
696
  label: E,
674
- tooltip: D,
697
+ tooltip: _,
675
698
  now: P,
676
- className: ot,
677
- style: kt,
678
- children: ct
679
- } = t, yt = ms(), Ut = `${yt}-summary`, Xt = G(null), qt = G(null), jt = G(null), Jt = G(null), Y = xt(), x = mt(), Zt = (h == null ? void 0 : h.min) ?? ke.min, Qt = (h == null ? void 0 : h.max) ?? ke.max, te = typeof l == "object" ? l.step : null, ee = typeof l == "object" ? l.offset : null, se = typeof l == "object" ? null : l, [Ze, Qe] = tt(() => Date.now());
680
- W(() => {
699
+ className: it,
700
+ style: wt,
701
+ children: ut
702
+ } = t, bt = vn(), qt = `${bt}-summary`, jt = G(null), Jt = G(null), Zt = G(null), Qt = G(null), z = Ht(), B = kt(), te = (h == null ? void 0 : h.min) ?? ve.min, ee = (h == null ? void 0 : h.max) ?? ve.max, ne = typeof d == "object" ? d.step : null, se = typeof d == "object" ? d.offset : null, oe = typeof d == "object" ? null : d, [en, nn] = et(() => Date.now());
703
+ U(() => {
681
704
  if (P !== !0) return;
682
- const u = setInterval(() => Qe(Date.now()), q);
705
+ const u = setInterval(() => nn(Date.now()), q);
683
706
  return () => clearInterval(u);
684
707
  }, [P]);
685
- const ne = P === !0 ? Ze : typeof P == "number" ? P : null;
686
- it(() => {
687
- const u = se ?? { step: te ?? 0, offset: ee ?? 0 };
688
- s.setOptions({ laneHeight: r, calendar: d, zoomLimits: { min: Zt, max: Qt }, snap: u, intents: c, now: ne, route: g, attach: T, ends: S });
689
- }, [s, r, d, Zt, Qt, se, te, ee, c, ne, g, T, S]), W(() => {
690
- s.setHandlers({ onIntent: p, canMoveTo: m, onInteraction: y, onSelectedTaskChange: A });
691
- }, [s, p, m, y, A]), gs(
708
+ const ie = P === !0 ? en : typeof P == "number" ? P : null;
709
+ rt(() => {
710
+ const u = oe ?? { step: ne ?? 0, offset: se ?? 0 };
711
+ n.setOptions({ laneHeight: r, calendar: l, zoomLimits: { min: te, max: ee }, snap: u, intents: c, now: ie, route: k, attach: T, ends: S });
712
+ }, [n, r, l, te, ee, oe, ne, se, c, ie, k, T, S]), U(() => {
713
+ n.setHandlers({ onIntent: m, canMoveTo: p, onInteraction: y, onSelectedTaskChange: A });
714
+ }, [n, m, p, y, A]), wn(
692
715
  e,
693
716
  () => ({
694
- positionAt: (u, w) => s.positionAt(u, w),
695
- clientPointOf: (u, w) => s.clientPointOf(u, w),
696
- visibleDomain: () => s.visibleDomain()
717
+ positionAt: (u, w) => n.positionAt(u, w),
718
+ clientPointOf: (u, w) => n.clientPointOf(u, w),
719
+ visibleDomain: () => n.visibleDomain()
697
720
  }),
698
- [s]
699
- ), W(() => {
700
- s.setControlledTask(I);
701
- }, [s, I]), W(() => {
702
- s.setPlacing(C ?? null);
703
- }, [s, C]), W(() => {
704
- const u = Xt.current, w = qt.current, L = jt.current, R = Jt.current;
705
- if (!u || !w || !L || !R) return;
706
- s.bind(u, w, L, R);
707
- const _ = w.getBoundingClientRect();
708
- s.resize(_.width, _.height);
721
+ [n]
722
+ ), U(() => {
723
+ n.setControlledTask(I);
724
+ }, [n, I]), U(() => {
725
+ n.setPlacing(C ?? null);
726
+ }, [n, C]), U(() => {
727
+ const u = jt.current, w = Jt.current, L = Zt.current, N = Qt.current;
728
+ if (!u || !w || !L || !N) return;
729
+ n.bind(u, w, L, N);
730
+ const D = w.getBoundingClientRect();
731
+ n.resize(D.width, D.height);
709
732
  const F = new ResizeObserver((O) => {
710
- var ut;
711
- const $ = (ut = O[O.length - 1]) == null ? void 0 : ut.contentRect;
712
- $ !== void 0 && s.resize($.width, $.height);
733
+ var ft;
734
+ const x = (ft = O[O.length - 1]) == null ? void 0 : ft.contentRect;
735
+ x !== void 0 && n.resize(x.width, x.height);
713
736
  });
714
737
  F.observe(w);
715
- const B = (O) => s.wheel(O);
716
- u.addEventListener("wheel", B, { passive: !1 });
717
- const z = (O) => {
718
- O.key === "Escape" && s.cancelEdit() && O.preventDefault();
738
+ const $ = (O) => n.wheel(O);
739
+ u.addEventListener("wheel", $, { passive: !1 });
740
+ const K = (O) => {
741
+ O.key === "Escape" && n.cancelEdit() && O.preventDefault();
719
742
  };
720
- return window.addEventListener("keydown", z), () => {
721
- window.removeEventListener("keydown", z), u.removeEventListener("wheel", B), F.disconnect(), s.unbind();
743
+ return window.addEventListener("keydown", K), () => {
744
+ window.removeEventListener("keydown", K), u.removeEventListener("wheel", $), F.disconnect(), n.unbind();
722
745
  };
723
- }, [s]);
724
- const b = Re(s.subscribe, s.getSnapshot, s.getServerSnapshot), ts = (u, w) => {
746
+ }, [n]);
747
+ const b = Pe(n.subscribe, n.getSnapshot, n.getServerSnapshot), sn = (u, w) => {
725
748
  const L = new Date(u);
726
- return w >= 200 ? Y.dateLong(L) : w >= 84 ? Y.date(L) : w >= Ct ? Y.dateShort(L) : "";
727
- }, es = b.days.reduce((u, w) => Math.max(u, w.width), 0), J = $s(es, Ct), oe = b.step >= U ? J : 1, M = b.ghost, Z = b.spoken, vt = b.summary, ie = (u) => `${Y.dateShort(new Date(u))} ${Y.time(new Date(u), !1)}`, wt = (u) => `${yt}-row-${encodeURIComponent(u.key)}`, ss = X(() => {
749
+ return w >= 200 ? z.dateLong(L) : w >= 84 ? z.date(L) : w >= Ft ? z.dateShort(L) : "";
750
+ }, on = b.days.reduce((u, w) => Math.max(u, w.width), 0), Z = zn(on, Ft), re = b.step >= X ? Z : 1, M = b.ghost, Q = b.spoken, Mt = b.summary, ae = (u) => `${z.dateShort(new Date(u))} ${z.time(new Date(u), !1)}`, Tt = (u) => `${bt}-row-${encodeURIComponent(u.key)}`, rn = V(() => {
728
751
  const u = /* @__PURE__ */ new Map();
729
752
  for (const w of b.headers)
730
753
  for (const L of w.within)
731
- w.kind === "groupHead" && L === w.group || u.set(L, [...u.get(L) ?? [], wt(w)]);
754
+ w.kind === "groupHead" && L === w.group || u.set(L, [...u.get(L) ?? [], Tt(w)]);
732
755
  return u;
733
- }, [b.headers, yt]), re = G(null);
734
- it(() => {
756
+ }, [b.headers, bt]), le = G(null);
757
+ rt(() => {
735
758
  var F;
736
- const u = re.current;
759
+ const u = le.current;
737
760
  if (u === null) return;
738
761
  let w = !0;
739
762
  const L = () => {
740
763
  if (!w) return;
741
- const B = [...u.querySelectorAll("[data-lane-count]")];
742
- for (const O of B) O.hidden = !1;
743
- const z = B.some((O) => {
744
- const $ = O.previousElementSibling;
745
- if (!($ instanceof HTMLElement)) return !1;
746
- const ut = parseFloat(getComputedStyle($).lineHeight);
747
- return $.scrollWidth > $.clientWidth || $.clientHeight > ut * 1.5;
764
+ const $ = [...u.querySelectorAll("[data-lane-count]")];
765
+ for (const O of $) O.hidden = !1;
766
+ const K = $.some((O) => {
767
+ const x = O.previousElementSibling;
768
+ if (!(x instanceof HTMLElement)) return !1;
769
+ const ft = parseFloat(getComputedStyle(x).lineHeight);
770
+ return x.scrollWidth > x.clientWidth || x.clientHeight > ft * 1.5;
748
771
  });
749
- for (const O of B) O.hidden = z;
772
+ for (const O of $) O.hidden = K;
750
773
  };
751
774
  L(), (F = document.fonts) == null || F.ready.then(L);
752
- const R = new ResizeObserver(L);
753
- R.observe(u);
754
- const _ = new MutationObserver(L);
755
- return _.observe(u, { childList: !0, characterData: !0, subtree: !0 }), () => {
756
- w = !1, R.disconnect(), _.disconnect();
775
+ const N = new ResizeObserver(L);
776
+ N.observe(u);
777
+ const D = new MutationObserver(L);
778
+ return D.observe(u, { childList: !0, characterData: !0, subtree: !0 }), () => {
779
+ w = !1, N.disconnect(), D.disconnect();
757
780
  };
758
781
  }, []);
759
- const ns = X(() => new Set((M == null ? void 0 : M.refusedLanes) ?? []), [M == null ? void 0 : M.refusedLanes]), ae = G(null), [bt, os] = tt({ x: 0, y: 0, at: "" }), Mt = M === null ? "" : `${M.x}:${M.y}:${M.from}:${M.to}:${M.overlap}:${M.violated}:${M.refused}:${M.blocked}`;
760
- it(() => {
761
- const u = ae.current;
782
+ const an = V(() => new Set((M == null ? void 0 : M.refusedLanes) ?? []), [M == null ? void 0 : M.refusedLanes]), de = G(null), [It, ln] = et({ x: 0, y: 0, at: "" }), St = M === null ? "" : `${M.x}:${M.y}:${M.from}:${M.to}:${M.overlap}:${M.violated}:${M.refused}:${M.blocked}`;
783
+ rt(() => {
784
+ const u = de.current;
762
785
  if (M === null || u === null) return;
763
- const w = 4, L = M.y - u.offsetHeight - w, R = M.y + M.height + w, _ = {
786
+ const w = 4, L = M.y - u.offsetHeight - w, N = M.y + M.height + w, D = {
764
787
  x: Math.max(2, Math.min(M.x, b.width - u.offsetWidth - 2)),
765
- y: L >= 2 ? L : Math.min(R, b.height - u.offsetHeight - 2),
766
- at: Mt
788
+ y: L >= 2 ? L : Math.min(N, b.height - u.offsetHeight - 2),
789
+ at: St
767
790
  };
768
- os((F) => F.x === _.x && F.y === _.y && F.at === _.at ? F : _);
769
- }, [M, Mt, b.width, b.height]);
770
- const le = G(null), [Tt, is] = tt({ x: 0, y: 0, at: "" }), V = b.tooltip, It = V === null ? "" : `${V.x}:${V.y}:${V.target.kind}`;
771
- return it(() => {
772
- const u = le.current;
773
- if (V === null || u === null) return;
774
- const w = 12, L = (_, F, B) => {
775
- const z = _ + w, O = _ - w - F, $ = z + F <= B - 4 || O < 4 ? z : O;
776
- return Math.max(4, Math.min($, B - F - 4));
777
- }, R = {
778
- x: L(V.x, u.offsetWidth, b.width),
779
- y: L(V.y, u.offsetHeight, b.height),
780
- at: It
791
+ ln((F) => F.x === D.x && F.y === D.y && F.at === D.at ? F : D);
792
+ }, [M, St, b.width, b.height]);
793
+ const he = G(null), [Lt, dn] = et({ x: 0, y: 0, at: "" }), W = b.tooltip, At = W === null ? "" : `${W.x}:${W.y}:${W.target.kind}`;
794
+ return rt(() => {
795
+ const u = he.current;
796
+ if (W === null || u === null) return;
797
+ const w = 12, L = (D, F, $) => {
798
+ const K = D + w, O = D - w - F, x = K + F <= $ - 4 || O < 4 ? K : O;
799
+ return Math.max(4, Math.min(x, $ - F - 4));
800
+ }, N = {
801
+ x: L(W.x, u.offsetWidth, b.width),
802
+ y: L(W.y, u.offsetHeight, b.height),
803
+ at: At
781
804
  };
782
- is((_) => _.x === R.x && _.y === R.y && _.at === R.at ? _ : R);
783
- }, [V, It, b.width, b.height]), /* @__PURE__ */ K(Pe.Provider, { value: s, children: [
784
- /* @__PURE__ */ K(
805
+ dn((D) => D.x === N.x && D.y === N.y && D.at === N.at ? D : N);
806
+ }, [W, At, b.width, b.height]), /* @__PURE__ */ H(Be.Provider, { value: n, children: [
807
+ /* @__PURE__ */ H(
785
808
  "div",
786
809
  {
787
- ref: Xt,
810
+ ref: jt,
788
811
  role: "figure",
789
- "aria-label": n,
790
- className: ot ? `${v.root} ${ot}` : v.root,
791
- style: { height: `${i}px`, gridTemplateColumns: `min(${a}px, 40%) minmax(0, 1fr)`, ...kt },
812
+ "aria-label": o,
813
+ className: it ? `${v.root} ${it}` : v.root,
814
+ style: { height: `${i}px`, gridTemplateColumns: `min(${a}px, 40%) minmax(0, 1fr)`, ...wt },
792
815
  children: [
793
- /* @__PURE__ */ k("div", { className: v.corner }),
794
- /* @__PURE__ */ k("div", { className: v.dayBand, "aria-hidden": "true", "data-schedule-days": "", "data-schedule-clip": "day band", children: b.days.map((u, w) => {
795
- var B;
796
- const L = J === 1 || w === 0 || At(u.start, J), R = J === 1 ? u.x + u.width : ((B = b.days.slice(w + 1).find((z) => At(z.start, J))) == null ? void 0 : B.x) ?? b.width, _ = Math.max(0, -u.x), F = Math.min(R, b.width) - Math.max(u.x, 0);
797
- return /* @__PURE__ */ k("span", { className: v.day, style: { left: `${u.x}px`, width: `${L ? R - u.x : u.width}px` }, children: /* @__PURE__ */ k("span", { className: v.dayLabel, "data-schedule-overlay": "day label", style: { marginLeft: `${_}px` }, children: L ? ts(u.start, J === 1 ? F : Math.min(F, Ct)) : "" }) }, u.start);
816
+ /* @__PURE__ */ g("div", { className: v.corner }),
817
+ /* @__PURE__ */ g("div", { className: v.dayBand, "aria-hidden": "true", "data-schedule-days": "", "data-schedule-clip": "day band", children: b.days.map((u, w) => {
818
+ var $;
819
+ const L = Z === 1 || w === 0 || _t(u.start, Z), N = Z === 1 ? u.x + u.width : (($ = b.days.slice(w + 1).find((K) => _t(K.start, Z))) == null ? void 0 : $.x) ?? b.width, D = Math.max(0, -u.x), F = Math.min(N, b.width) - Math.max(u.x, 0);
820
+ return /* @__PURE__ */ g("span", { className: v.day, style: { left: `${u.x}px`, width: `${L ? N - u.x : u.width}px` }, children: /* @__PURE__ */ g("span", { className: v.dayLabel, "data-schedule-overlay": "day label", style: { marginLeft: `${D}px` }, children: L ? sn(u.start, Z === 1 ? F : Math.min(F, Ft)) : "" }) }, u.start);
798
821
  }) }),
799
- /* @__PURE__ */ k("div", { ref: re, className: v.headers, "data-schedule-headers": "", children: /* @__PURE__ */ k("div", { className: v.headerRun, style: { transform: `translateY(${-b.scrollY}px)` }, children: b.headers.map((u) => /* @__PURE__ */ K(
822
+ /* @__PURE__ */ g("div", { ref: le, className: v.headers, "data-schedule-headers": "", children: /* @__PURE__ */ g("div", { className: v.headerRun, style: { transform: `translateY(${-b.scrollY}px)` }, children: b.headers.map((u) => /* @__PURE__ */ H(
800
823
  "div",
801
824
  {
802
- id: wt(u),
825
+ id: Tt(u),
803
826
  className: v.header,
804
827
  style: { height: `${u.height}px`, paddingLeft: `calc(var(--u-space-3) + ${u.depth} * var(--u-space-3))` },
805
828
  "data-lane": u.lane,
806
829
  "data-group": u.group,
807
830
  "data-row": u.kind,
808
831
  "data-schedule-clip": `header ${u.kind}`,
809
- "data-refused": u.lane !== void 0 && ns.has(u.lane) ? "" : void 0,
832
+ "data-refused": u.lane !== void 0 && an.has(u.lane) ? "" : void 0,
810
833
  children: [
811
- u.kind !== "lane" && u.group !== void 0 && /* @__PURE__ */ k(
834
+ u.kind !== "lane" && u.group !== void 0 && /* @__PURE__ */ g(
812
835
  "button",
813
836
  {
814
837
  type: "button",
815
838
  className: v.chevron,
816
839
  "data-schedule-overlay": "fold control",
817
840
  "aria-expanded": u.collapsed === !1,
818
- "aria-controls": (ss.get(u.group) ?? [wt(u)]).join(" "),
819
- "aria-label": `${u.collapsed === !0 ? x.scheduleUnfoldGroup : x.scheduleFoldGroup}: ${typeof u.label == "string" ? u.label : u.group}`,
820
- onClick: () => s.toggleGroup(u.group),
821
- children: /* @__PURE__ */ k(ys, { size: 9, "data-open": u.collapsed === !1 ? "" : void 0 })
841
+ "aria-controls": (rn.get(u.group) ?? [Tt(u)]).join(" "),
842
+ "aria-label": `${u.collapsed === !0 ? B.scheduleUnfoldGroup : B.scheduleFoldGroup}: ${typeof u.label == "string" ? u.label : u.group}`,
843
+ onClick: () => n.toggleGroup(u.group),
844
+ children: /* @__PURE__ */ g(Mn, { size: 9, "data-open": u.collapsed === !1 ? "" : void 0 })
822
845
  }
823
846
  ),
824
- /* @__PURE__ */ k("span", { className: v.headerLabel, "data-schedule-overlay": "header label", children: u.label }),
825
- u.kind !== "lane" && /* @__PURE__ */ k("span", { className: v.headerCount, "data-schedule-overlay": "lane count", "data-lane-count": u.lanes, children: x.scheduleLaneCount(u.lanes) })
847
+ /* @__PURE__ */ g("span", { className: v.headerLabel, "data-schedule-overlay": "header label", children: u.label }),
848
+ u.kind !== "lane" && /* @__PURE__ */ g("span", { className: v.headerCount, "data-schedule-overlay": "lane count", "data-lane-count": u.lanes, children: B.scheduleLaneCount(u.lanes) })
826
849
  ]
827
850
  },
828
851
  u.key
829
852
  )) }) }),
830
- /* @__PURE__ */ K(
853
+ /* @__PURE__ */ H(
831
854
  "div",
832
855
  {
833
- ref: qt,
856
+ ref: Jt,
834
857
  className: v.plot,
835
858
  "data-schedule-plot": "",
836
859
  "data-schedule-clip": "plot",
837
860
  style: { cursor: b.cursor },
838
861
  tabIndex: 0,
839
862
  role: "application",
840
- "aria-roledescription": x.scheduleRoleDescription,
841
- "aria-label": n,
842
- "aria-describedby": Ut,
863
+ "aria-roledescription": B.scheduleRoleDescription,
864
+ "aria-label": o,
865
+ "aria-describedby": qt,
843
866
  onKeyDown: (u) => {
844
- s.key(u.nativeEvent) && u.preventDefault();
867
+ n.key(u.nativeEvent) && u.preventDefault();
845
868
  },
846
- onFocus: (u) => s.focus(bn(u.currentTarget)),
847
- onBlur: () => s.blur(),
848
- onPointerDown: (u) => s.pointerDown(u.nativeEvent),
849
- onPointerMove: (u) => s.pointerMove(u.nativeEvent),
850
- onPointerUp: (u) => s.pointerUp(u.nativeEvent),
851
- onPointerCancel: (u) => s.pointerCancel(u.nativeEvent),
852
- onPointerLeave: () => s.pointerLeave(),
853
- onContextMenu: (u) => s.contextMenu(u.nativeEvent),
854
- onDragOver: (u) => s.dragOver(u.nativeEvent),
855
- onDrop: (u) => s.drop(u.nativeEvent),
869
+ onFocus: (u) => n.focus(Is(u.currentTarget)),
870
+ onBlur: () => n.blur(),
871
+ onPointerDown: (u) => n.pointerDown(u.nativeEvent),
872
+ onPointerMove: (u) => n.pointerMove(u.nativeEvent),
873
+ onPointerUp: (u) => n.pointerUp(u.nativeEvent),
874
+ onPointerCancel: (u) => n.pointerCancel(u.nativeEvent),
875
+ onPointerLeave: () => n.pointerLeave(),
876
+ onContextMenu: (u) => n.contextMenu(u.nativeEvent),
877
+ onDragOver: (u) => n.dragOver(u.nativeEvent),
878
+ onDrop: (u) => n.drop(u.nativeEvent),
856
879
  onDragLeave: (u) => {
857
880
  const w = u.nativeEvent.relatedTarget;
858
- (!(w instanceof Node) || !u.currentTarget.contains(w)) && s.dragLeave();
881
+ (!(w instanceof Node) || !u.currentTarget.contains(w)) && n.dragLeave();
859
882
  },
860
883
  children: [
861
- /* @__PURE__ */ k("canvas", { ref: jt, className: v.layer, "aria-hidden": "true" }),
862
- /* @__PURE__ */ k("canvas", { ref: Jt, className: v.layer, "aria-hidden": "true" }),
863
- b.grips.map((u) => /* @__PURE__ */ k(
884
+ /* @__PURE__ */ g("canvas", { ref: Zt, className: v.layer, "aria-hidden": "true" }),
885
+ /* @__PURE__ */ g("canvas", { ref: Qt, className: v.layer, "aria-hidden": "true" }),
886
+ b.grips.map((u) => /* @__PURE__ */ g(
864
887
  "span",
865
888
  {
866
889
  "data-grip": u.kind,
@@ -871,7 +894,7 @@ const yn = [], ke = { min: Bt, max: 28 * U }, vn = [], ye = 20, Ct = 44, wn = Ee
871
894
  },
872
895
  u.kind
873
896
  )),
874
- E !== void 0 && b.bars.map((u) => /* @__PURE__ */ k(
897
+ E !== void 0 && b.bars.map((u) => /* @__PURE__ */ g(
875
898
  "span",
876
899
  {
877
900
  className: v.barLabel,
@@ -880,30 +903,30 @@ const yn = [], ke = { min: Bt, max: 28 * U }, vn = [], ye = 20, Ct = 44, wn = Ee
880
903
  "data-schedule-may-cover": "",
881
904
  "data-on": u.dark ? "dark" : "light",
882
905
  style: { left: `${u.x}px`, top: `${u.y}px`, width: `${u.width}px`, height: `${u.height}px` },
883
- children: /* @__PURE__ */ k("span", { className: v.barLabelText, children: E(u.subtask) })
906
+ children: /* @__PURE__ */ g("span", { className: v.barLabelText, children: E(u.subtask) })
884
907
  },
885
908
  u.subtask.id
886
909
  )),
887
- D !== !1 && b.tooltip !== null && /* @__PURE__ */ k(
910
+ _ !== !1 && b.tooltip !== null && /* @__PURE__ */ g(
888
911
  "span",
889
912
  {
890
- ref: le,
913
+ ref: he,
891
914
  role: "tooltip",
892
915
  className: v.tooltip,
893
916
  "data-schedule-tooltip": "",
894
917
  "data-schedule-overlay": "tooltip",
895
918
  style: {
896
- left: `${Tt.x}px`,
897
- top: `${Tt.y}px`,
898
- visibility: Tt.at === It ? void 0 : "hidden"
919
+ left: `${Lt.x}px`,
920
+ top: `${Lt.y}px`,
921
+ visibility: Lt.at === At ? void 0 : "hidden"
899
922
  },
900
- children: typeof D == "function" ? D(b.tooltip.target) : /* @__PURE__ */ k(kn, { target: b.tooltip.target })
923
+ children: typeof _ == "function" ? _(b.tooltip.target) : /* @__PURE__ */ g(ws, { target: b.tooltip.target })
901
924
  }
902
925
  ),
903
- M !== null && /* @__PURE__ */ K(
926
+ M !== null && /* @__PURE__ */ H(
904
927
  "span",
905
928
  {
906
- ref: ae,
929
+ ref: de,
907
930
  className: v.ghostLabel,
908
931
  "data-ghost": "",
909
932
  "data-schedule-overlay": "ghost label",
@@ -911,71 +934,75 @@ const yn = [], ke = { min: Bt, max: 28 * U }, vn = [], ye = 20, Ct = 44, wn = Ee
911
934
  "data-refused": M.refused ? "" : void 0,
912
935
  "data-blocked": M.blocked ? "" : void 0,
913
936
  style: {
914
- left: `${bt.x}px`,
915
- top: `${bt.y}px`,
916
- visibility: bt.at === Mt ? void 0 : "hidden"
937
+ left: `${It.x}px`,
938
+ top: `${It.y}px`,
939
+ visibility: It.at === St ? void 0 : "hidden"
917
940
  },
918
941
  children: [
919
- x.scheduleGhostTimes(Y.time(new Date(M.from), !1), Y.time(new Date(M.to), !1)),
920
- M.refused && /* @__PURE__ */ k("span", { className: v.refusal, children: x.scheduleLaneRefused }),
921
- M.blocked && /* @__PURE__ */ k("span", { className: v.refusal, children: x.scheduleBlockedTime }),
922
- M.overlap && /* @__PURE__ */ k("span", { className: v.finding, children: x.scheduleOverlap }),
923
- M.violated && /* @__PURE__ */ k("span", { className: v.finding, children: x.scheduleViolatedDependency })
942
+ B.scheduleGhostTimes(z.time(new Date(M.from), !1), z.time(new Date(M.to), !1)),
943
+ M.refused && /* @__PURE__ */ g("span", { className: v.refusal, children: B.scheduleLaneRefused }),
944
+ M.blocked && /* @__PURE__ */ g("span", { className: v.refusal, children: B.scheduleBlockedTime }),
945
+ M.overlap && /* @__PURE__ */ g("span", { className: v.finding, children: B.scheduleOverlap }),
946
+ M.violated && /* @__PURE__ */ g("span", { className: v.finding, children: B.scheduleViolatedDependency })
924
947
  ]
925
948
  }
926
949
  ),
927
- /* @__PURE__ */ k("span", { className: v.focusRing, "aria-hidden": "true" })
950
+ /* @__PURE__ */ g("span", { className: v.focusRing, "aria-hidden": "true" })
928
951
  ]
929
952
  }
930
953
  ),
931
- /* @__PURE__ */ k("div", { className: v.corner }),
932
- /* @__PURE__ */ K("div", { className: v.tickBand, "aria-hidden": "true", "data-schedule-ticks": "", "data-schedule-clip": "time band", children: [
933
- b.now !== null && /* @__PURE__ */ k("span", { className: v.now, "data-now": "", "data-schedule-overlay": "now mark", style: { left: `${b.now}px` } }),
934
- b.ticks.map((u) => /* @__PURE__ */ k("span", { className: v.tick, style: { left: `${u.x}px` }, children: u.x >= ye && u.x <= b.width - ye && (oe === 1 || At(u.wallClock, oe)) && /* @__PURE__ */ k("span", { className: v.tickLabel, "data-schedule-overlay": "time label", children: b.step >= U ? Y.dateShort(new Date(u.wallClock)) : Y.time(new Date(u.wallClock), !1) }) }, u.wallClock))
954
+ /* @__PURE__ */ g("div", { className: v.corner }),
955
+ /* @__PURE__ */ H("div", { className: v.tickBand, "aria-hidden": "true", "data-schedule-ticks": "", "data-schedule-clip": "time band", children: [
956
+ b.now !== null && /* @__PURE__ */ g("span", { className: v.now, "data-now": "", "data-schedule-overlay": "now mark", style: { left: `${b.now}px` } }),
957
+ b.ticks.map((u) => /* @__PURE__ */ g("span", { className: v.tick, style: { left: `${u.x}px` }, children: u.x >= we && u.x <= b.width - we && (re === 1 || _t(u.wallClock, re)) && /* @__PURE__ */ g("span", { className: v.tickLabel, "data-schedule-overlay": "time label", children: b.step >= X ? z.dateShort(new Date(u.wallClock)) : z.time(new Date(u.wallClock), !1) }) }, u.wallClock))
935
958
  ] }),
936
- /* @__PURE__ */ k(he, { "aria-live": "polite", children: Z !== null && /* @__PURE__ */ k(
937
- gn,
959
+ /* @__PURE__ */ g(ue, { "aria-live": "polite", children: Q !== null && /* @__PURE__ */ g(
960
+ vs,
938
961
  {
939
- target: Z.target,
940
- lane: Z.lane === null ? null : ((de = s.data.lanes.find((u) => u.id === Z.lane)) == null ? void 0 : de.label) ?? Z.lane
962
+ target: Q.target,
963
+ lane: Q.lane === null ? null : ((ce = n.data.lanes.find((u) => u.id === Q.lane)) == null ? void 0 : ce.label) ?? Q.lane
941
964
  },
942
- Z.count
965
+ Q.count
943
966
  ) }),
944
- /* @__PURE__ */ k(he, { id: Ut, children: `${x.scheduleSummary({ ...vt, from: ie(vt.from), to: ie(vt.to) })} ${x.scheduleKeyHelp}` })
967
+ /* @__PURE__ */ g(ue, { id: qt, children: `${B.scheduleSummary({ ...Mt, from: ae(Mt.from), to: ae(Mt.to) })} ${B.scheduleKeyHelp}` })
945
968
  ]
946
969
  }
947
970
  ),
948
- ct
971
+ ut
949
972
  ] });
950
973
  });
951
- function bn(o) {
974
+ function Is(s) {
952
975
  try {
953
- return o.matches(":focus-visible");
976
+ return s.matches(":focus-visible");
954
977
  } catch {
955
978
  return !0;
956
979
  }
957
980
  }
958
- function Mn({ id: o, label: t }) {
959
- const e = xe(), s = X(() => ({ id: o, label: t ?? o, ...e === null ? {} : { parent: e } }), [o, t, e]);
960
- return Ms(s), null;
981
+ function Ss({ id: s, label: t }) {
982
+ const e = He(), n = V(() => ({ id: s, label: t ?? s, ...e === null ? {} : { parent: e } }), [s, t, e]);
983
+ return Ln(n), null;
984
+ }
985
+ function Ls({ id: s, label: t, children: e }) {
986
+ const n = He(), o = V(() => ({ id: s, label: t ?? s, ...n === null ? {} : { parent: n } }), [s, t, n]);
987
+ return An(o), /* @__PURE__ */ g(xe.Provider, { value: s, children: e });
961
988
  }
962
- function Tn({ id: o, label: t, children: e }) {
963
- const s = xe(), n = X(() => ({ id: o, label: t ?? o, ...s === null ? {} : { parent: s } }), [o, t, s]);
964
- return Ts(n), /* @__PURE__ */ k(Be.Provider, { value: o, children: e });
989
+ function As({ data: s, tasks: t }) {
990
+ const e = V(() => ({ kind: "subtasks", data: s, tasks: t }), [s, t]);
991
+ return vt("Subtasks", e), null;
965
992
  }
966
- function In({ data: o, tasks: t }) {
967
- const e = X(() => ({ kind: "subtasks", data: o, tasks: t }), [o, t]);
968
- return Kt("Subtasks", e), null;
993
+ function Cs({ data: s }) {
994
+ const t = V(() => ({ kind: "dependencies", data: s }), [s]);
995
+ return vt("Dependencies", t), null;
969
996
  }
970
- function Sn({ data: o }) {
971
- const t = X(() => ({ kind: "dependencies", data: o }), [o]);
972
- return Kt("Dependencies", t), null;
997
+ function Ds({ data: s }) {
998
+ const t = V(() => ({ kind: "blocked", data: s }), [s]);
999
+ return vt("BlockedTimes", t), null;
973
1000
  }
974
- function Ln({ data: o }) {
975
- const t = X(() => ({ kind: "blocked", data: o }), [o]);
976
- return Kt("BlockedTimes", t), null;
1001
+ function _s({ data: s }) {
1002
+ const t = V(() => ({ kind: "milestones", data: s }), [s]);
1003
+ return vt("Milestones", t), null;
977
1004
  }
978
- class An {
1005
+ class Fs {
979
1006
  /** `changed` is called after every registration change. */
980
1007
  constructor(t) {
981
1008
  f(this, "nextId", 1);
@@ -994,6 +1021,8 @@ class An {
994
1021
  f(this, "dependencies", []);
995
1022
  /** Every blocked time, whichever layer declared it. */
996
1023
  f(this, "blocked", []);
1024
+ /** Every milestone, whichever layer declared it. */
1025
+ f(this, "milestones", []);
997
1026
  f(this, "tasks", /* @__PURE__ */ new Map());
998
1027
  f(this, "overlaps", []);
999
1028
  f(this, "violatedById", /* @__PURE__ */ new Map());
@@ -1039,14 +1068,14 @@ class An {
1039
1068
  rebuild() {
1040
1069
  if (!this.dirty) return !1;
1041
1070
  this.dirty = !1;
1042
- const t = (e) => [...e.keys()].sort((s, n) => s - n).map((s) => e.get(s));
1043
- this.lanes = t(this.laneEntries), this.groups = t(this.groupEntries), this.laneIndex = new Map(this.lanes.map((e, s) => [e.id, s])), this.layers = t(this.layerEntries), this.subtasks = [], this.dependencies = [], this.blocked = [], this.tasks = /* @__PURE__ */ new Map();
1071
+ const t = (e) => [...e.keys()].sort((n, o) => n - o).map((n) => e.get(n));
1072
+ this.lanes = t(this.laneEntries), this.groups = t(this.groupEntries), this.laneIndex = new Map(this.lanes.map((e, n) => [e.id, n])), this.layers = t(this.layerEntries), this.subtasks = [], this.dependencies = [], this.blocked = [], this.milestones = [], this.tasks = /* @__PURE__ */ new Map();
1044
1073
  for (const e of this.layers)
1045
1074
  if (e.kind === "subtasks") {
1046
1075
  this.subtasks.push(...e.data);
1047
- for (const s of e.tasks) this.tasks.set(s.id, s);
1048
- } else e.kind === "dependencies" ? this.dependencies.push(...e.data) : this.blocked.push(...e.data);
1049
- return this.subtaskById = new Map(this.subtasks.map((e) => [e.id, e])), this.overlaps = Ht(this.subtasks), this.violatedById = new Map(Yt(this.subtasks, this.dependencies).map((e) => [e.dependency, e])), this.depth = vs(this.subtasks), this.inBlocked = Ne(this.subtasks, this.blocked), !0;
1076
+ for (const n of e.tasks) this.tasks.set(n.id, n);
1077
+ } else e.kind === "dependencies" ? this.dependencies.push(...e.data) : e.kind === "milestones" ? this.milestones.push(...e.data) : this.blocked.push(...e.data);
1078
+ return this.subtaskById = new Map(this.subtasks.map((e) => [e.id, e])), this.overlaps = zt(this.subtasks), this.violatedById = new Map(Kt(this.subtasks, this.dependencies).map((e) => [e.dependency, e])), this.depth = Tn(this.subtasks), this.inBlocked = $e(this.subtasks, this.blocked), !0;
1050
1079
  }
1051
1080
  /** The task a dependency belongs to: its departing subtask's. */
1052
1081
  taskOfDependency(t) {
@@ -1057,22 +1086,23 @@ class An {
1057
1086
  data knows about it - its task, and the findings it stands in. */
1058
1087
  tooltipTargetFor(t) {
1059
1088
  if (t.kind === "subtask") {
1060
- const n = t.subtask.id, i = this.overlaps.filter((d) => d.first === n || d.second === n).map((d) => this.subtaskById.get(d.first === n ? d.second : d.first)).filter((d) => d !== void 0), r = this.dependencies.filter((d) => d.from === n || d.to === n).map((d) => this.violatedById.get(d.id)).filter((d) => d !== void 0), a = this.inBlocked.filter((d) => d.subtask === n).map((d) => this.blocked.find((h) => h.id === d.blocked)).filter((d) => d !== void 0);
1089
+ const o = t.subtask.id, i = this.overlaps.filter((l) => l.first === o || l.second === o).map((l) => this.subtaskById.get(l.first === o ? l.second : l.first)).filter((l) => l !== void 0), r = this.dependencies.filter((l) => l.from === o || l.to === o).map((l) => this.violatedById.get(l.id)).filter((l) => l !== void 0), a = this.inBlocked.filter((l) => l.subtask === o).map((l) => this.blocked.find((h) => h.id === l.blocked)).filter((l) => l !== void 0);
1061
1090
  return { kind: "subtask", subtask: t.subtask, task: this.tasks.get(t.subtask.task), overlapping: i, violatedDependencies: r, blocked: a };
1062
1091
  }
1092
+ if (t.kind === "milestone") return { kind: "milestone", milestone: t.milestone };
1063
1093
  if (t.kind !== "dependency") return null;
1064
- const e = t.dependency, s = this.taskOfDependency(e);
1094
+ const e = t.dependency, n = this.taskOfDependency(e);
1065
1095
  return {
1066
1096
  kind: "dependency",
1067
1097
  dependency: e,
1068
- task: s !== null ? this.tasks.get(s) : void 0,
1098
+ task: n !== null ? this.tasks.get(n) : void 0,
1069
1099
  from: this.subtaskById.get(e.from),
1070
1100
  to: this.subtaskById.get(e.to),
1071
1101
  violated: this.violatedById.get(e.id)
1072
1102
  };
1073
1103
  }
1074
1104
  }
1075
- const Cn = {
1105
+ const Os = {
1076
1106
  line: "var(--u-hairline)",
1077
1107
  lineStrong: "var(--u-hairline-strong)",
1078
1108
  text: "var(--u-color-text)",
@@ -1086,7 +1116,7 @@ const Cn = {
1086
1116
  /* What text and marks take ON a filled bar - the same token the bar labels
1087
1117
  use in CSS, so a cap and the label beside it are one colour. */
1088
1118
  onAccent: "var(--u-color-on-accent)"
1089
- }, Ve = {
1119
+ }, Ue = {
1090
1120
  line: "GrayText",
1091
1121
  lineStrong: "CanvasText",
1092
1122
  text: "CanvasText",
@@ -1096,337 +1126,349 @@ const Cn = {
1096
1126
  active: "Highlight",
1097
1127
  now: "GrayText",
1098
1128
  onAccent: "Canvas"
1099
- }, _n = (o) => o ? Ve : Cn, Dn = () => typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(forced-colors: active)").matches;
1100
- function Fn(o, t) {
1101
- const e = Dn(), s = {};
1102
- for (const r of t.tasks.values()) s[`task:${r.id}`] = e ? Ve.text : r.color;
1103
- const n = cs(o, { ..._n(e), ...s }), i = /* @__PURE__ */ new Map();
1104
- for (const r of t.tasks.values()) i.set(r.id, n[`task:${r.id}`] ?? r.color);
1129
+ }, Es = (s) => s ? Ue : Os, Ns = () => typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(forced-colors: active)").matches;
1130
+ function Rs(s, t) {
1131
+ const e = Ns(), n = {};
1132
+ for (const r of t.tasks.values()) n[`task:${r.id}`] = e ? Ue.text : r.color;
1133
+ const o = pn(s, { ...Es(e), ...n }), i = /* @__PURE__ */ new Map();
1134
+ for (const r of t.tasks.values()) i.set(r.id, o[`task:${r.id}`] ?? r.color);
1105
1135
  return {
1106
- line: n.line,
1107
- lineStrong: n.lineStrong,
1108
- text: n.text,
1109
- muted: n.muted,
1110
- alarm: n.alarm,
1111
- surface: n.surface,
1112
- active: n.active,
1113
- now: n.now,
1114
- onAccent: n.onAccent,
1136
+ line: o.line,
1137
+ lineStrong: o.lineStrong,
1138
+ text: o.text,
1139
+ muted: o.muted,
1140
+ alarm: o.alarm,
1141
+ surface: o.surface,
1142
+ active: o.active,
1143
+ now: o.now,
1144
+ onAccent: o.onAccent,
1115
1145
  tasks: i,
1116
1146
  forced: e
1117
1147
  };
1118
1148
  }
1119
- function lt(o) {
1120
- const t = o.match(/[\d.]+/g);
1149
+ function ht(s) {
1150
+ const t = s.match(/[\d.]+/g);
1121
1151
  return t === null || t.length < 3 ? null : [Number(t[0]), Number(t[1]), Number(t[2])];
1122
1152
  }
1123
- function ve(o) {
1124
- const t = lt(o);
1125
- return t === null ? 0 : Ue(We(t));
1153
+ function be(s) {
1154
+ const t = ht(s);
1155
+ return t === null ? 0 : qe(Xe(t));
1126
1156
  }
1127
- function We(o) {
1128
- return o.map((t) => {
1157
+ function Xe(s) {
1158
+ return s.map((t) => {
1129
1159
  const e = t / 255;
1130
1160
  return e <= 0.04045 ? e / 12.92 : ((e + 0.055) / 1.055) ** 2.4;
1131
1161
  });
1132
1162
  }
1133
- function Ue([o, t, e]) {
1134
- return 0.2126 * o + 0.7152 * t + 0.0722 * e;
1135
- }
1136
- function we(o, t) {
1137
- const e = ve(o), s = ve(t);
1138
- return (Math.max(e, s) + 0.05) / (Math.min(e, s) + 0.05);
1139
- }
1140
- function be(o, t, e) {
1141
- if (o === null) return null;
1142
- const s = typeof window > "u" ? 1 : window.devicePixelRatio || 1, n = Math.round(t * s), i = Math.round(e * s);
1143
- o.width !== n && (o.width = n), o.height !== i && (o.height = i);
1144
- const r = o.getContext("2d");
1145
- return r === null ? null : (r.setTransform(s, 0, 0, s, 0, 0), r.clearRect(0, 0, t, e), r);
1146
- }
1147
- function On(o, t) {
1148
- const { data: e, view: s } = t, n = s.viewport();
1149
- Pn(o, t, n);
1150
- for (const i of e.blocked) Kn(o, t, n, i);
1151
- Bn(o, t);
1163
+ function qe([s, t, e]) {
1164
+ return 0.2126 * s + 0.7152 * t + 0.0722 * e;
1165
+ }
1166
+ function Me(s, t) {
1167
+ const e = be(s), n = be(t);
1168
+ return (Math.max(e, n) + 0.05) / (Math.min(e, n) + 0.05);
1169
+ }
1170
+ function Te(s, t, e) {
1171
+ if (s === null) return null;
1172
+ const n = typeof window > "u" ? 1 : window.devicePixelRatio || 1, o = Math.round(t * n), i = Math.round(e * n);
1173
+ s.width !== o && (s.width = o), s.height !== i && (s.height = i);
1174
+ const r = s.getContext("2d");
1175
+ return r === null ? null : (r.setTransform(n, 0, 0, n, 0, 0), r.clearRect(0, 0, t, e), r);
1176
+ }
1177
+ function Ps(s, t) {
1178
+ const { data: e, view: n } = t, o = n.viewport();
1179
+ Hs(s, t, o);
1180
+ for (const i of e.blocked) Xs(s, t, o, i);
1181
+ Gs(s, t);
1152
1182
  for (const i of e.layers) {
1153
- if (i.kind === "blocked") continue;
1183
+ if (i.kind === "blocked" || i.kind === "milestones") continue;
1154
1184
  const r = new Set(i.data);
1155
1185
  if (i.kind === "dependencies")
1156
- for (const a of s.paths) r.has(a.dependency) && Et(o, t, a, !1);
1186
+ for (const a of n.paths) r.has(a.dependency) && Rt(s, t, a, !1);
1157
1187
  else
1158
- for (const a of s.boxes) r.has(a.subtask) && qe(o, t, a, 1);
1188
+ for (const a of n.boxes) r.has(a.subtask) && Je(s, t, a, 1);
1159
1189
  }
1160
- for (const i of e.overlaps) Nt(o, t, n, i);
1161
- for (const i of e.inBlocked) Nt(o, t, n, i);
1162
- zn(o, t, n), Un(o, t);
1190
+ for (const i of e.overlaps) $t(s, t, o, i);
1191
+ for (const i of e.inBlocked) $t(s, t, o, i);
1192
+ Us(s, t, o);
1193
+ for (const i of e.milestones) tn(s, t, o, i, !1);
1194
+ Js(s, t);
1163
1195
  }
1164
- function En(o, t) {
1165
- const { view: e, hover: s } = t, n = e.viewport();
1196
+ function $s(s, t) {
1197
+ const { view: e, hover: n } = t, o = e.viewport();
1166
1198
  if (t.ghost === null) {
1167
- if (s.kind === "subtask") {
1168
- const c = e.boxById.get(s.subtask.id);
1169
- c !== void 0 && Vn(o, t, c);
1170
- } else if (s.kind === "dependency") {
1171
- const c = e.paths.find((p) => p.dependency === s.dependency);
1172
- c !== void 0 && Et(o, t, c, !0);
1173
- }
1199
+ if (n.kind === "subtask") {
1200
+ const c = e.boxById.get(n.subtask.id);
1201
+ c !== void 0 && qs(s, t, c);
1202
+ } else if (n.kind === "dependency") {
1203
+ const c = e.paths.find((m) => m.dependency === n.dependency);
1204
+ c !== void 0 && Rt(s, t, c, !0);
1205
+ } else n.kind === "milestone" && tn(s, t, o, n.milestone, !0);
1174
1206
  return;
1175
1207
  }
1176
- const i = t.ghost, { ghost: r, overlaps: a, violated: d } = i;
1177
- Rn(o, t, n, i.refusedLanes);
1178
- const h = Xe(n, r);
1208
+ const i = t.ghost, { ghost: r, overlaps: a, violated: l } = i;
1209
+ Bs(s, t, o, i.refusedLanes);
1210
+ const h = je(o, r);
1179
1211
  if (h === null) return;
1180
- for (const c of a) Nt(o, t, n, c);
1181
- const l = new Set(d.map((c) => c.dependency));
1212
+ for (const c of a) $t(s, t, o, c);
1213
+ const d = new Set(l.map((c) => c.dependency));
1182
1214
  for (const c of t.data.dependencies) {
1183
1215
  if (c.from !== r.id && c.to !== r.id) continue;
1184
- const p = e.boxById.get(c.from === r.id ? c.to : c.from);
1185
- if (p === void 0) continue;
1186
- const m = c.from === r.id ? Ot(n, c, h, p, e.options) : Ot(n, c, p, h, e.options);
1187
- Et(o, t, m, !0, l.has(c.id));
1188
- }
1189
- qe(o, { ...t, selectedTask: null }, h, 0.55), o.strokeStyle = t.colours.text, o.lineWidth = 1, o.setLineDash([3, 2]), o.strokeRect(h.outerFrom + 0.5, h.y + 0.5, Math.max(1, h.outerTo - h.outerFrom - 1), h.height - 1), o.setLineDash([]), i.tether !== null && Nn(o, t, h, i.tether);
1190
- }
1191
- function Rn(o, t, e, s) {
1192
- if (s.size === 0) return;
1193
- const { width: n, height: i } = t.view;
1194
- for (const r of s) {
1195
- const a = dt(e, r);
1216
+ const m = e.boxById.get(c.from === r.id ? c.to : c.from);
1217
+ if (m === void 0) continue;
1218
+ const p = c.from === r.id ? Nt(o, c, h, m, e.options) : Nt(o, c, m, h, e.options);
1219
+ Rt(s, t, p, !0, d.has(c.id));
1220
+ }
1221
+ Je(s, { ...t, selectedTask: null }, h, 0.55), s.strokeStyle = t.colours.text, s.lineWidth = 1, s.setLineDash([3, 2]), s.strokeRect(h.outerFrom + 0.5, h.y + 0.5, Math.max(1, h.outerTo - h.outerFrom - 1), h.height - 1), s.setLineDash([]), i.tether !== null && xs(s, t, h, i.tether);
1222
+ }
1223
+ function Bs(s, t, e, n) {
1224
+ if (n.size === 0) return;
1225
+ const { width: o, height: i } = t.view;
1226
+ for (const r of n) {
1227
+ const a = J(e, r);
1196
1228
  if (a === null) continue;
1197
- const { top: d, height: h } = a;
1198
- d + h < 0 || d > i || (o.globalAlpha = 0.6, o.fillStyle = t.colours.surface, o.fillRect(0, d, n, h), o.globalAlpha = 1, Je(o, 0, d, n, h, t.colours.muted, 0.7, je, 1));
1199
- }
1200
- }
1201
- function Nn(o, t, e, s) {
1202
- const n = Math.max(e.outerFrom, Math.min(e.outerTo, s.x)), i = Math.max(e.y, Math.min(e.y + e.height, s.y));
1203
- Math.hypot(s.x - n, s.y - i) < 2 || (o.strokeStyle = t.colours.text, o.lineWidth = 1, o.setLineDash([2, 3]), o.beginPath(), o.moveTo(n + 0.5, i + 0.5), o.lineTo(s.x + 0.5, s.y + 0.5), o.stroke(), o.setLineDash([]));
1204
- }
1205
- function Xe(o, t) {
1206
- const e = Vt(o.rows, t.lane);
1207
- return e === null ? null : Ge(o, t, t.lane, e, 0);
1208
- }
1209
- function Pn(o, t, e) {
1210
- const { view: s, colours: n, bands: i } = t, { width: r, height: a } = s;
1211
- o.lineWidth = 1, o.strokeStyle = n.line, o.beginPath();
1212
- for (const l of i.ticks)
1213
- o.moveTo(l.x + 0.5, 0), o.lineTo(l.x + 0.5, a);
1214
- for (const l of e.rows.rows) {
1215
- const c = l.top + l.height - e.scrollY - 0.5;
1216
- c < 0 || c > a || (o.moveTo(0, c), o.lineTo(r, c));
1217
- }
1218
- const d = [...e.rows.slots.values()].filter((l) => l.miniature).sort((l, c) => l.top - c.top);
1219
- d.forEach((l, c) => {
1220
- const p = d[c + 1];
1221
- if (p === void 0 || p.top !== l.top + l.height || p.group === l.group) return;
1222
- const m = l.top + l.height - e.scrollY - 0.5;
1223
- m < 0 || m > a || (o.moveTo(0, m), o.lineTo(r, m));
1224
- }), o.stroke(), o.strokeStyle = n.lineStrong, o.beginPath();
1225
- for (const l of i.days)
1226
- o.moveTo(l.x + 0.5, 0), o.lineTo(l.x + 0.5, a);
1227
- o.stroke();
1228
- const h = us(s.options.calendar);
1229
+ const { top: l, height: h } = a;
1230
+ l + h < 0 || l > i || (s.globalAlpha = 0.6, s.fillStyle = t.colours.surface, s.fillRect(0, l, o, h), s.globalAlpha = 1, Qe(s, 0, l, o, h, t.colours.muted, 0.7, Ze, 1));
1231
+ }
1232
+ }
1233
+ function xs(s, t, e, n) {
1234
+ const o = Math.max(e.outerFrom, Math.min(e.outerTo, n.x)), i = Math.max(e.y, Math.min(e.y + e.height, n.y));
1235
+ Math.hypot(n.x - o, n.y - i) < 2 || (s.strokeStyle = t.colours.text, s.lineWidth = 1, s.setLineDash([2, 3]), s.beginPath(), s.moveTo(o + 0.5, i + 0.5), s.lineTo(n.x + 0.5, n.y + 0.5), s.stroke(), s.setLineDash([]));
1236
+ }
1237
+ function je(s, t) {
1238
+ const e = Wt(s.rows, t.lane);
1239
+ return e === null ? null : Ye(s, t, t.lane, e, 0);
1240
+ }
1241
+ function Hs(s, t, e) {
1242
+ const { view: n, colours: o, bands: i } = t, { width: r, height: a } = n;
1243
+ s.lineWidth = 1, s.strokeStyle = o.line, s.beginPath();
1244
+ for (const d of i.ticks)
1245
+ s.moveTo(d.x + 0.5, 0), s.lineTo(d.x + 0.5, a);
1246
+ for (const d of e.rows.rows) {
1247
+ const c = d.top + d.height - e.scrollY - 0.5;
1248
+ c < 0 || c > a || (s.moveTo(0, c), s.lineTo(r, c));
1249
+ }
1250
+ const l = [...e.rows.slots.values()].filter((d) => d.miniature).sort((d, c) => d.top - c.top);
1251
+ l.forEach((d, c) => {
1252
+ const m = l[c + 1];
1253
+ if (m === void 0 || m.top !== d.top + d.height || m.group === d.group) return;
1254
+ const p = d.top + d.height - e.scrollY - 0.5;
1255
+ p < 0 || p > a || (s.moveTo(0, p), s.lineTo(r, p));
1256
+ }), s.stroke(), s.strokeStyle = o.lineStrong, s.beginPath();
1257
+ for (const d of i.days)
1258
+ s.moveTo(d.x + 0.5, 0), s.lineTo(d.x + 0.5, a);
1259
+ s.stroke();
1260
+ const h = gn(n.options.calendar);
1229
1261
  if (h.length > 0) {
1230
- o.strokeStyle = n.muted, o.setLineDash([2, 3]), o.beginPath();
1231
- for (const l of h) {
1232
- const c = Math.round(e.scale.toPx(l.workingTime)) + 0.5;
1233
- c < 0 || c > r || (o.moveTo(c, 0), o.lineTo(c, a));
1262
+ s.strokeStyle = o.muted, s.setLineDash([2, 3]), s.beginPath();
1263
+ for (const d of h) {
1264
+ const c = Math.round(e.scale.toPx(d.workingTime)) + 0.5;
1265
+ c < 0 || c > r || (s.moveTo(c, 0), s.lineTo(c, a));
1234
1266
  }
1235
- o.stroke(), o.setLineDash([]);
1267
+ s.stroke(), s.setLineDash([]);
1236
1268
  }
1237
1269
  }
1238
- function Bn(o, t) {
1270
+ function Gs(s, t) {
1239
1271
  const e = t.view.nowX();
1240
- e !== null && (o.fillStyle = t.colours.now, o.fillRect(e, 0, 2, t.view.height));
1272
+ e !== null && (s.fillStyle = t.colours.now, s.fillRect(e, 0, 2, t.view.height));
1241
1273
  }
1242
- function xn(o, t, e, s) {
1243
- const n = ht(t.colours, t, e.subtask.task, e.subtask.id);
1244
- o.fillStyle = n;
1274
+ function Ys(s, t, e, n) {
1275
+ const o = ct(t.colours, t, e.subtask.task, e.subtask.id);
1276
+ s.fillStyle = o;
1245
1277
  for (const [i, r] of [
1246
1278
  [e.outerFrom, e.mainFrom],
1247
1279
  [e.mainTo, e.outerTo]
1248
1280
  ])
1249
- r <= i || (o.globalAlpha = 0.28 * s, o.fillRect(i, e.y, r - i, e.height));
1250
- o.globalAlpha = s, o.fillRect(e.mainFrom, e.y, Math.max(1, e.mainTo - e.mainFrom), e.height), o.globalAlpha = 1;
1251
- }
1252
- function Wt(o, t, e) {
1253
- if (o.dashed) return { fill: null, onDark: !1 };
1254
- const s = o.muted ? $n(t, e.surface, 0.5) : t;
1255
- return { fill: s, onDark: we(s, e.onAccent) > we(s, e.text) };
1256
- }
1257
- function $n(o, t, e) {
1258
- const s = lt(o), n = lt(t);
1259
- if (s === null || n === null) return o;
1260
- const i = (r) => Math.round(s[r] + (n[r] - s[r]) * e);
1281
+ r <= i || (s.globalAlpha = 0.28 * n, s.fillRect(i, e.y, r - i, e.height));
1282
+ s.globalAlpha = n, s.fillRect(e.mainFrom, e.y, Math.max(1, e.mainTo - e.mainFrom), e.height), s.globalAlpha = 1;
1283
+ }
1284
+ function Xt(s, t, e) {
1285
+ if (s.dashed) return { fill: null, onDark: !1 };
1286
+ const n = s.muted ? zs(t, e.surface, 0.5) : t;
1287
+ return { fill: n, onDark: Me(n, e.onAccent) > Me(n, e.text) };
1288
+ }
1289
+ function zs(s, t, e) {
1290
+ const n = ht(s), o = ht(t);
1291
+ if (n === null || o === null) return s;
1292
+ const i = (r) => Math.round(n[r] + (o[r] - n[r]) * e);
1261
1293
  return `rgb(${i(0)}, ${i(1)}, ${i(2)})`;
1262
1294
  }
1263
- function Me(o, t) {
1264
- const e = lt(o);
1265
- if (e === null || t === 0) return o;
1266
- const s = We(e), n = Ue(s), [i, r, a] = s.map((d) => {
1267
- const h = d + (n - d) * t, l = h <= 31308e-7 ? h * 12.92 : 1.055 * h ** (1 / 2.4) - 0.055;
1268
- return Math.round(Math.min(1, Math.max(0, l)) * 255);
1295
+ function Ie(s, t) {
1296
+ const e = ht(s);
1297
+ if (e === null || t === 0) return s;
1298
+ const n = Xe(e), o = qe(n), [i, r, a] = n.map((l) => {
1299
+ const h = l + (o - l) * t, d = h <= 31308e-7 ? h * 12.92 : 1.055 * h ** (1 / 2.4) - 0.055;
1300
+ return Math.round(Math.min(1, Math.max(0, d)) * 255);
1269
1301
  });
1270
1302
  return `rgb(${i}, ${r}, ${a})`;
1271
1303
  }
1272
- function ht(o, t, e, s) {
1273
- const n = (e === null ? void 0 : o.tasks.get(e)) ?? o.muted;
1274
- return t.selectedTask === null ? n : e !== t.selectedTask ? o.forced ? o.muted : Me(n, 1) : o.forced || t.selectedSubtask === null || s === null || s === t.selectedSubtask ? n : Me(n, 0.5);
1304
+ function ct(s, t, e, n) {
1305
+ const o = (e === null ? void 0 : s.tasks.get(e)) ?? s.muted;
1306
+ return t.selectedTask === null ? o : e !== t.selectedTask ? s.forced ? s.muted : Ie(o, 1) : s.forced || t.selectedSubtask === null || n === null || n === t.selectedSubtask ? o : Ie(o, 0.5);
1275
1307
  }
1276
- const Gn = 2;
1277
- function qe(o, t, e, s) {
1278
- const { view: n, colours: i } = t;
1279
- if (!Ft(e, n.width, n.height)) return;
1308
+ const Ks = 2;
1309
+ function Je(s, t, e, n) {
1310
+ const { view: o, colours: i } = t;
1311
+ if (!Et(e, o.width, o.height)) return;
1280
1312
  if (e.miniature) {
1281
- xn(o, t, e, s);
1313
+ Ys(s, t, e, n);
1282
1314
  return;
1283
1315
  }
1284
- const r = gt(e.subtask.appearance), a = ht(i, t, e.subtask.task, e.subtask.id), d = Wt(r, a, i), h = e.y, l = e.height, c = Math.max(1, e.mainTo - e.mainFrom), p = d.onDark ? i.onAccent : i.text;
1285
- o.lineWidth = 1, o.fillStyle = a, o.strokeStyle = a;
1316
+ const r = yt(e.subtask.appearance), a = ct(i, t, e.subtask.task, e.subtask.id), l = Xt(r, a, i), h = e.y, d = e.height, c = Math.max(1, e.mainTo - e.mainFrom), m = l.onDark ? i.onAccent : i.text;
1317
+ s.lineWidth = 1, s.fillStyle = a, s.strokeStyle = a;
1286
1318
  for (const [y, I] of [
1287
1319
  [e.outerFrom, e.mainFrom],
1288
1320
  [e.mainTo, e.outerTo]
1289
1321
  ])
1290
- I <= y || (o.globalAlpha = 0.28 * s, o.fillRect(y, h, I - y, l), o.globalAlpha = s, o.strokeRect(y + 0.5, h + 0.5, I - y - 1, l - 1));
1291
- d.fill !== null && (o.globalAlpha = s, o.fillStyle = d.fill, o.fillRect(e.mainFrom, h, c, l));
1292
- const m = e.subtask.progress;
1293
- if (m !== void 0) {
1294
- const y = Math.min(4, Math.max(2, Math.round(l / 6))), I = h + l - y - Gn, A = Math.round(c * Math.max(0, Math.min(1, m)));
1295
- o.fillStyle = d.fill === null ? a : p, o.globalAlpha = 0.3 * s, o.fillRect(e.mainFrom, I, c, y), o.globalAlpha = s, A > 0 && o.fillRect(e.mainFrom, I, A, y);
1322
+ I <= y || (s.globalAlpha = 0.28 * n, s.fillRect(y, h, I - y, d), s.globalAlpha = n, s.strokeRect(y + 0.5, h + 0.5, I - y - 1, d - 1));
1323
+ l.fill !== null && (s.globalAlpha = n, s.fillStyle = l.fill, s.fillRect(e.mainFrom, h, c, d));
1324
+ const p = e.subtask.progress;
1325
+ if (p !== void 0) {
1326
+ const y = Math.min(4, Math.max(2, Math.round(d / 6))), I = h + d - y - Ks, A = Math.round(c * Math.max(0, Math.min(1, p)));
1327
+ s.fillStyle = l.fill === null ? a : m, s.globalAlpha = 0.3 * n, s.fillRect(e.mainFrom, I, c, y), s.globalAlpha = n, A > 0 && s.fillRect(e.mainFrom, I, A, y);
1296
1328
  }
1297
1329
  if (r.hatched) {
1298
- const y = Math.max(1, Math.min($e, Math.floor((c - 2 * rt) / 3))), I = c >= 4 * y ? rt : 0, A = l >= 4 * rt ? rt : 0;
1299
- o.globalAlpha = s, o.fillStyle = p, o.fillRect(e.mainFrom + I, h + A, y, l - 2 * A), o.fillRect(e.mainTo - I - y, h + A, y, l - 2 * A);
1300
- }
1301
- r.open && Yn(o, e, h, l, i.surface, n.width), r.dashed && (o.globalAlpha = s, o.strokeStyle = a, o.setLineDash([4, 3]), o.strokeRect(e.mainFrom + 0.5, h + 0.5, c - 1, l - 1), o.setLineDash([])), o.globalAlpha = 1, e.depth > 0 && s === 1 && (o.strokeStyle = i.surface, o.strokeRect(e.outerFrom - 0.5, h - 0.5, e.outerTo - e.outerFrom + 1, l + 1));
1302
- }
1303
- const je = 6, Hn = 16;
1304
- function Je(o, t, e, s, n, i, r, a, d) {
1305
- o.save(), o.beginPath(), o.rect(t, e, s, n), o.clip(), o.globalAlpha = 0.5 * r, o.strokeStyle = i, o.lineWidth = d, o.beginPath();
1306
- for (let h = t - n; h < t + s + n; h += a)
1307
- o.moveTo(h, e + n), o.lineTo(h + n, e);
1308
- o.stroke(), o.restore();
1309
- }
1310
- function Yn(o, t, e, s, n, i) {
1311
- const r = t.mainFrom < 0, a = t.mainTo > i, d = Math.max(1, Math.min(t.mainTo, i) - Math.max(t.mainFrom, 0)), h = Math.min(Hn, d);
1312
- r && Te(o, 0, h, e, s, n, 1), a && Te(o, i, -h, e, s, n, 1);
1313
- }
1314
- function Te(o, t, e, s, n, i, r) {
1315
- const a = o.createLinearGradient(t, 0, t + e, 0);
1316
- a.addColorStop(0, Ie(i, r)), a.addColorStop(1, Ie(i, 0)), o.globalAlpha = 1, o.fillStyle = a, o.fillRect(Math.min(t, t + e), s, Math.abs(e), n);
1317
- }
1318
- function Ie(o, t) {
1319
- const e = lt(o);
1320
- return e === null ? o : `rgba(${e[0]}, ${e[1]}, ${e[2]}, ${t})`;
1321
- }
1322
- function Et(o, t, e, s, n) {
1323
- const { data: i, colours: r } = t, a = i.taskOfDependency(e.dependency), d = n ?? i.violatedById.has(e.dependency.id), h = a !== null && a === t.selectedTask, l = d ? r.alarm : ht(r, t, a, null);
1324
- if (o.strokeStyle = l, o.fillStyle = l, o.lineWidth = s || h ? 2 : 1.25, o.setLineDash(d ? [4, 3] : []), o.beginPath(), o.moveTo(e.x1, e.y1), e.kind === "curve")
1325
- o.bezierCurveTo(e.c1x, e.y1, e.c2x, e.y2, e.x2, e.y2);
1330
+ const y = Math.max(1, Math.min(Ge, Math.floor((c - 2 * at) / 3))), I = c >= 4 * y ? at : 0, A = d >= 4 * at ? at : 0;
1331
+ s.globalAlpha = n, s.fillStyle = m, s.fillRect(e.mainFrom + I, h + A, y, d - 2 * A), s.fillRect(e.mainTo - I - y, h + A, y, d - 2 * A);
1332
+ }
1333
+ r.open && Ws(s, e, h, d, i.surface, o.width), r.dashed && (s.globalAlpha = n, s.strokeStyle = a, s.setLineDash([4, 3]), s.strokeRect(e.mainFrom + 0.5, h + 0.5, c - 1, d - 1), s.setLineDash([])), s.globalAlpha = 1, e.depth > 0 && n === 1 && (s.strokeStyle = i.surface, s.strokeRect(e.outerFrom - 0.5, h - 0.5, e.outerTo - e.outerFrom + 1, d + 1));
1334
+ }
1335
+ const Ze = 6, Vs = 16;
1336
+ function Qe(s, t, e, n, o, i, r, a, l) {
1337
+ s.save(), s.beginPath(), s.rect(t, e, n, o), s.clip(), s.globalAlpha = 0.5 * r, s.strokeStyle = i, s.lineWidth = l, s.beginPath();
1338
+ for (let h = t - o; h < t + n + o; h += a)
1339
+ s.moveTo(h, e + o), s.lineTo(h + o, e);
1340
+ s.stroke(), s.restore();
1341
+ }
1342
+ function Ws(s, t, e, n, o, i) {
1343
+ const r = t.mainFrom < 0, a = t.mainTo > i, l = Math.max(1, Math.min(t.mainTo, i) - Math.max(t.mainFrom, 0)), h = Math.min(Vs, l);
1344
+ r && Se(s, 0, h, e, n, o, 1), a && Se(s, i, -h, e, n, o, 1);
1345
+ }
1346
+ function Se(s, t, e, n, o, i, r) {
1347
+ const a = s.createLinearGradient(t, 0, t + e, 0);
1348
+ a.addColorStop(0, Le(i, r)), a.addColorStop(1, Le(i, 0)), s.globalAlpha = 1, s.fillStyle = a, s.fillRect(Math.min(t, t + e), n, Math.abs(e), o);
1349
+ }
1350
+ function Le(s, t) {
1351
+ const e = ht(s);
1352
+ return e === null ? s : `rgba(${e[0]}, ${e[1]}, ${e[2]}, ${t})`;
1353
+ }
1354
+ function Rt(s, t, e, n, o) {
1355
+ const { data: i, colours: r } = t, a = i.taskOfDependency(e.dependency), l = o ?? i.violatedById.has(e.dependency.id), h = a !== null && a === t.selectedTask, d = l ? r.alarm : ct(r, t, a, null);
1356
+ if (s.strokeStyle = d, s.fillStyle = d, s.lineWidth = n || h ? 2 : 1.25, s.setLineDash(l ? [4, 3] : []), s.beginPath(), s.moveTo(e.x1, e.y1), e.kind === "curve")
1357
+ s.bezierCurveTo(e.c1x, e.y1, e.c2x, e.y2, e.x2, e.y2);
1326
1358
  else
1327
- for (let c = 2; c + 1 < e.points.length; c += 2) o.lineTo(e.points[c], e.points[c + 1]);
1328
- if (o.stroke(), o.setLineDash([]), e.ends === "dot")
1329
- for (const [c, p] of [
1359
+ for (let c = 2; c + 1 < e.points.length; c += 2) s.lineTo(e.points[c], e.points[c + 1]);
1360
+ if (s.stroke(), s.setLineDash([]), e.ends === "dot")
1361
+ for (const [c, m] of [
1330
1362
  [e.x1, e.y1],
1331
1363
  [e.x2, e.y2]
1332
1364
  ])
1333
- o.beginPath(), o.arc(c, p, d ? 3 : 2.5, 0, Math.PI * 2), o.fill();
1365
+ s.beginPath(), s.arc(c, m, l ? 3 : 2.5, 0, Math.PI * 2), s.fill();
1334
1366
  }
1335
- function zn(o, t, e) {
1336
- const { data: s } = t;
1337
- if (s.violatedById.size !== 0)
1338
- for (const n of s.violatedById.values()) {
1339
- const i = s.dependencies.find((c) => c.id === n.dependency), r = i === void 0 ? void 0 : s.subtaskById.get(i.to);
1367
+ function Us(s, t, e) {
1368
+ const { data: n } = t;
1369
+ if (n.violatedById.size !== 0)
1370
+ for (const o of n.violatedById.values()) {
1371
+ const i = n.dependencies.find((c) => c.id === o.dependency), r = i === void 0 ? void 0 : n.subtaskById.get(i.to);
1340
1372
  if (r === void 0) continue;
1341
- const a = dt(e, r.lane);
1373
+ const a = J(e, r.lane);
1342
1374
  if (a === null || !a.miniature) continue;
1343
- const d = st(e.rows, a.top + e.scrollY);
1344
- if (d === null) continue;
1345
- const h = N(e, n.arrival), l = Math.max(h + 2, N(e, n.arrival + n.shortBy));
1346
- Rt(o, t, h, l, d.top - e.scrollY + 1, 3);
1375
+ const l = st(e.rows, a.top + e.scrollY);
1376
+ if (l === null) continue;
1377
+ const h = R(e, o.arrival), d = Math.max(h + 2, R(e, o.arrival + o.shortBy));
1378
+ Pt(s, t, h, d, l.top - e.scrollY + 1, 3);
1347
1379
  }
1348
1380
  }
1349
- function Rt(o, t, e, s, n, i) {
1381
+ function Pt(s, t, e, n, o, i) {
1350
1382
  if (!t.colours.forced) {
1351
- o.fillStyle = t.colours.alarm, o.fillRect(e, n, s - e, i);
1383
+ s.fillStyle = t.colours.alarm, s.fillRect(e, o, n - e, i);
1352
1384
  return;
1353
1385
  }
1354
- o.strokeStyle = t.colours.alarm, o.lineWidth = i, o.setLineDash([4, 3]), o.beginPath(), o.moveTo(e, n + i / 2), o.lineTo(s, n + i / 2), o.stroke(), o.setLineDash([]);
1386
+ s.strokeStyle = t.colours.alarm, s.lineWidth = i, s.setLineDash([4, 3]), s.beginPath(), s.moveTo(e, o + i / 2), s.lineTo(n, o + i / 2), s.stroke(), s.setLineDash([]);
1387
+ }
1388
+ function Xs(s, t, e, n) {
1389
+ const o = J(e, n.lane);
1390
+ if (o === null || o.top + o.height < 0 || o.top > t.view.height) return;
1391
+ const i = Math.max(0, R(e, n.from)), r = Math.min(t.view.width, R(e, n.to));
1392
+ r <= i || (s.globalAlpha = 0.1, s.fillStyle = t.colours.muted, s.fillRect(i, o.top, r - i, o.height), s.globalAlpha = 1, Qe(s, i, o.top, r - i, o.height, t.colours.muted, 0.7, Ze, 1));
1355
1393
  }
1356
- function Kn(o, t, e, s) {
1357
- const n = dt(e, s.lane);
1358
- if (n === null || n.top + n.height < 0 || n.top > t.view.height) return;
1359
- const i = Math.max(0, N(e, s.from)), r = Math.min(t.view.width, N(e, s.to));
1360
- r <= i || (o.globalAlpha = 0.1, o.fillStyle = t.colours.muted, o.fillRect(i, n.top, r - i, n.height), o.globalAlpha = 1, Je(o, i, n.top, r - i, n.height, t.colours.muted, 0.7, je, 1));
1394
+ function tn(s, t, e, n, o) {
1395
+ const i = Ut(e, n);
1396
+ if (i === null || i.x < -i.half || i.x > t.view.width + i.half) return;
1397
+ const r = (a) => {
1398
+ s.beginPath(), s.moveTo(i.x, i.y - a), s.lineTo(i.x + a, i.y), s.lineTo(i.x, i.y + a), s.lineTo(i.x - a, i.y), s.closePath();
1399
+ };
1400
+ o && (r(i.half + 3), s.fillStyle = t.colours.active, s.fill()), r(i.half + 1), s.fillStyle = t.colours.surface, s.fill(), r(i.half), s.fillStyle = t.colours.text, s.fill();
1361
1401
  }
1362
- function Nt(o, t, e, s) {
1363
- const n = dt(e, s.lane);
1364
- if (n === null) return;
1365
- const i = N(e, s.from), r = Math.max(i + 2, N(e, s.to));
1366
- if (o.fillStyle = t.colours.alarm, o.globalAlpha = 0.14, o.fillRect(i, n.top + 1, r - i, Math.max(1, n.height - 2)), o.globalAlpha = 1, Rt(o, t, i, r, n.top + 1, Math.min(3, Math.max(1, n.height - 1))), n.miniature) {
1367
- const a = st(e.rows, n.top + e.scrollY);
1368
- a !== null && Rt(o, t, i, r, a.top - e.scrollY + 1, 3);
1402
+ function $t(s, t, e, n) {
1403
+ const o = J(e, n.lane);
1404
+ if (o === null) return;
1405
+ const i = R(e, n.from), r = Math.max(i + 2, R(e, n.to));
1406
+ if (s.fillStyle = t.colours.alarm, s.globalAlpha = 0.14, s.fillRect(i, o.top + 1, r - i, Math.max(1, o.height - 2)), s.globalAlpha = 1, Pt(s, t, i, r, o.top + 1, Math.min(3, Math.max(1, o.height - 1))), o.miniature) {
1407
+ const a = st(e.rows, o.top + e.scrollY);
1408
+ a !== null && Pt(s, t, i, r, a.top - e.scrollY + 1, 3);
1369
1409
  }
1370
1410
  }
1371
- function Vn(o, t, e) {
1372
- const { colours: s } = t, n = gt(e.subtask.appearance), i = Wt(n, ht(s, t, e.subtask.task, e.subtask.id), s);
1373
- if (s.forced) {
1374
- o.strokeStyle = s.active, o.lineWidth = 2, o.strokeRect(e.outerFrom - 2, e.y - 2, Math.max(1, e.outerTo - e.outerFrom) + 4, e.height + 4);
1411
+ function qs(s, t, e) {
1412
+ const { colours: n } = t, o = yt(e.subtask.appearance), i = Xt(o, ct(n, t, e.subtask.task, e.subtask.id), n);
1413
+ if (n.forced) {
1414
+ s.strokeStyle = n.active, s.lineWidth = 2, s.strokeRect(e.outerFrom - 2, e.y - 2, Math.max(1, e.outerTo - e.outerFrom) + 4, e.height + 4);
1375
1415
  return;
1376
1416
  }
1377
- o.globalAlpha = Wn, o.fillStyle = i.onDark ? s.onAccent : s.text, o.fillRect(e.outerFrom, e.y, Math.max(1, e.outerTo - e.outerFrom), e.height), o.globalAlpha = 1;
1417
+ s.globalAlpha = js, s.fillStyle = i.onDark ? n.onAccent : n.text, s.fillRect(e.outerFrom, e.y, Math.max(1, e.outerTo - e.outerFrom), e.height), s.globalAlpha = 1;
1378
1418
  }
1379
- const Wn = 0.2;
1380
- function Un(o, t) {
1419
+ const js = 0.2;
1420
+ function Js(s, t) {
1381
1421
  const e = t.selectedTask;
1382
1422
  if (e !== null) {
1383
- o.strokeStyle = t.colours.text;
1384
- for (const s of t.view.boxes) {
1385
- if (s.subtask.task !== e) continue;
1386
- const n = s.subtask.id === t.selectedSubtask;
1387
- o.lineWidth = n ? 2 : 1;
1388
- const i = n ? 1 : 0.5;
1389
- o.strokeRect(s.outerFrom - i, s.y - i, s.outerTo - s.outerFrom + 2 * i, s.height + 2 * i);
1423
+ s.strokeStyle = t.colours.text;
1424
+ for (const n of t.view.boxes) {
1425
+ if (n.subtask.task !== e) continue;
1426
+ const o = n.subtask.id === t.selectedSubtask;
1427
+ s.lineWidth = o ? 2 : 1;
1428
+ const i = o ? 1 : 0.5;
1429
+ s.strokeRect(n.outerFrom - i, n.y - i, n.outerTo - n.outerFrom + 2 * i, n.height + 2 * i);
1390
1430
  }
1391
1431
  }
1392
1432
  }
1393
- const ft = 32, Xn = 18;
1394
- function Se(o, t) {
1395
- if (!(t > 2 * ft)) return 0;
1396
- const e = ft - o, s = o - (t - ft), n = Math.max(e, s);
1397
- if (n <= 0) return 0;
1398
- const i = Math.min(1, n / ft), r = Xn * i * i;
1433
+ const mt = 32, Zs = 18;
1434
+ function Ae(s, t) {
1435
+ if (!(t > 2 * mt)) return 0;
1436
+ const e = mt - s, n = s - (t - mt), o = Math.max(e, n);
1437
+ if (o <= 0) return 0;
1438
+ const i = Math.min(1, o / mt), r = Zs * i * i;
1399
1439
  return e > 0 ? -r : r;
1400
1440
  }
1401
- function at(o, t, e) {
1402
- const s = (n, i) => {
1403
- const r = nt(n);
1404
- return n.lane === i.lane && r.from < i.to && i.from < r.to;
1441
+ function dt(s, t, e) {
1442
+ const n = (o, i) => {
1443
+ const r = ot(o);
1444
+ return o.lane === i.lane && r.from < i.to && i.from < r.to;
1405
1445
  };
1406
- return e.some((n) => s(o, n) && !(t !== null && s(t, n)));
1407
- }
1408
- function qn(o, t, e, s) {
1409
- const n = /* @__PURE__ */ new Set();
1410
- if (s === void 0) return n;
1411
- for (const i of o)
1412
- i !== e && (s(t, i) || n.add(i));
1413
- return n;
1414
- }
1415
- const Le = "\0placing", Ae = /* @__PURE__ */ new Set();
1416
- function _t(o) {
1417
- switch (o.kind) {
1446
+ return e.some((o) => n(s, o) && !(t !== null && n(t, o)));
1447
+ }
1448
+ function Qs(s, t, e, n) {
1449
+ const o = /* @__PURE__ */ new Set();
1450
+ if (n === void 0) return o;
1451
+ for (const i of s)
1452
+ i !== e && (n(t, i) || o.add(i));
1453
+ return o;
1454
+ }
1455
+ const Ce = "\0placing", De = /* @__PURE__ */ new Set();
1456
+ function Ot(s) {
1457
+ switch (s.kind) {
1418
1458
  case "subtask":
1419
- return `subtask:${o.subtask.id}:${o.part}`;
1459
+ return `subtask:${s.subtask.id}:${s.part}`;
1420
1460
  case "dependency":
1421
- return `dependency:${o.dependency.id}`;
1461
+ return `dependency:${s.dependency.id}`;
1462
+ case "milestone":
1463
+ return `milestone:${s.milestone.id}`;
1422
1464
  case "lane":
1423
- return `lane:${o.lane}`;
1465
+ return `lane:${s.lane}`;
1424
1466
  default:
1425
1467
  return "nothing";
1426
1468
  }
1427
1469
  }
1428
- const Ce = 3, jn = 10, Jn = 600;
1429
- class Zn {
1470
+ const _e = 3, to = 10, eo = 600;
1471
+ class no {
1430
1472
  constructor(t) {
1431
1473
  f(this, "gesture", { kind: "none" });
1432
1474
  f(this, "touches", /* @__PURE__ */ new Map());
@@ -1487,45 +1529,45 @@ class Zn {
1487
1529
  ghostSummary() {
1488
1530
  const t = this.gesture;
1489
1531
  if (t.kind !== "edit" && t.kind !== "place") return null;
1490
- const e = Xe(this.host.view.viewport(), t.ghost);
1532
+ const e = je(this.host.view.viewport(), t.ghost);
1491
1533
  if (e === null) return null;
1492
- const s = this.ghostFindings(t.ghost, this.ghostHome(t)), n = t.kind === "edit" && (t.mode === "leadIn" || t.mode === "leadOut"), i = n ? nt(t.ghost) : t.ghost;
1534
+ const n = this.ghostFindings(t.ghost, this.ghostHome(t)), o = t.kind === "edit" && (t.mode === "leadIn" || t.mode === "leadOut"), i = o ? ot(t.ghost) : t.ghost;
1493
1535
  return {
1494
1536
  refused: this.refused,
1495
1537
  refusedLanes: [...t.refused],
1496
1538
  blocked: this.blocked,
1497
- x: n ? e.outerFrom : e.mainFrom,
1539
+ x: o ? e.outerFrom : e.mainFrom,
1498
1540
  y: e.y,
1499
1541
  height: e.height,
1500
1542
  from: i.from,
1501
1543
  to: i.to,
1502
- overlap: s.overlaps.length > 0,
1503
- violated: s.violated.length > 0
1544
+ overlap: n.overlaps.length > 0,
1545
+ violated: n.violated.length > 0
1504
1546
  };
1505
1547
  }
1506
1548
  /* ---------------------------------------------------------------- */
1507
1549
  /* Pointer */
1508
1550
  /* ---------------------------------------------------------------- */
1509
1551
  local(t, e) {
1510
- var n;
1511
- const s = (n = this.host.plotElement()) == null ? void 0 : n.getBoundingClientRect();
1512
- return { x: t - ((s == null ? void 0 : s.left) ?? 0), y: e - ((s == null ? void 0 : s.top) ?? 0) };
1552
+ var o;
1553
+ const n = (o = this.host.plotElement()) == null ? void 0 : o.getBoundingClientRect();
1554
+ return { x: t - ((n == null ? void 0 : n.left) ?? 0), y: e - ((n == null ? void 0 : n.top) ?? 0) };
1513
1555
  }
1514
- report(t, e, s, n, i, r) {
1515
- var d, h;
1556
+ report(t, e, n, o, i, r) {
1557
+ var l, h;
1516
1558
  const a = this.host.view;
1517
- (h = (d = this.host.handlers()).onInteraction) == null || h.call(d, { type: t, hit: e, clientX: s, clientY: n, time: a.timeAt(i), lane: a.laneIdAt(r) });
1559
+ (h = (l = this.host.handlers()).onInteraction) == null || h.call(l, { type: t, hit: e, clientX: n, clientY: o, time: a.timeAt(i), lane: a.laneIdAt(r) });
1518
1560
  }
1519
1561
  pointerDown(t) {
1520
- var a, d, h, l, c;
1521
- const { x: e, y: s } = this.local(t.clientX, t.clientY);
1522
- if (t.pointerType === "touch" && (this.touches.set(t.pointerId, { x: e, y: s }), this.touches.size >= 2)) {
1562
+ var a, l, h, d, c;
1563
+ const { x: e, y: n } = this.local(t.clientX, t.clientY);
1564
+ if (t.pointerType === "touch" && (this.touches.set(t.pointerId, { x: e, y: n }), this.touches.size >= 2)) {
1523
1565
  this.gesture.kind !== "pinch" && (this.cancelEdit(), this.gesture = { kind: "pinch", distance: this.touchDistance() });
1524
1566
  return;
1525
1567
  }
1526
1568
  if (t.button !== 0) return;
1527
- const n = (h = (d = (a = t.target) == null ? void 0 : a.closest) == null ? void 0 : d.call(a, "[data-grip]")) == null ? void 0 : h.getAttribute("data-grip"), i = this.host.selectedSubtask(), r = i !== null ? this.host.data.subtaskById.get(i) ?? null : null;
1528
- t.pointerType === "touch" ? this.gesture = { kind: "pending", pointerId: t.pointerId, x0: e, y0: s, mode: "pan", subtask: null } : (n === "leadIn" || n === "leadOut") && r !== null ? this.gesture = { kind: "pending", pointerId: t.pointerId, x0: e, y0: s, mode: n, subtask: r } : this.gesture = { kind: "pending", pointerId: t.pointerId, x0: e, y0: s, ...this.modeAt(e, s) }, (c = (l = this.host.plotElement()) == null ? void 0 : l.setPointerCapture) == null || c.call(l, t.pointerId);
1569
+ const o = (h = (l = (a = t.target) == null ? void 0 : a.closest) == null ? void 0 : l.call(a, "[data-grip]")) == null ? void 0 : h.getAttribute("data-grip"), i = this.host.selectedSubtask(), r = i !== null ? this.host.data.subtaskById.get(i) ?? null : null;
1570
+ t.pointerType === "touch" ? this.gesture = { kind: "pending", pointerId: t.pointerId, x0: e, y0: n, mode: "pan", subtask: null } : (o === "leadIn" || o === "leadOut") && r !== null ? this.gesture = { kind: "pending", pointerId: t.pointerId, x0: e, y0: n, mode: o, subtask: r } : this.gesture = { kind: "pending", pointerId: t.pointerId, x0: e, y0: n, ...this.modeAt(e, n) }, (c = (d = this.host.plotElement()) == null ? void 0 : d.setPointerCapture) == null || c.call(d, t.pointerId);
1529
1571
  }
1530
1572
  /** A drag over a folded group: resting on one opens it for the GESTURE.
1531
1573
 
@@ -1535,13 +1577,13 @@ class Zn {
1535
1577
  never written to and no change is reported, because the application did
1536
1578
  not fold anything (ADR-0025). */
1537
1579
  restOver(t) {
1538
- var n;
1539
- const e = this.host.view, s = e.foldedGroupAt(t);
1540
- s !== ((n = this.resting) == null ? void 0 : n.group) && (this.stopResting(), s !== null && (this.resting = {
1541
- group: s,
1580
+ var o;
1581
+ const e = this.host.view, n = e.foldedGroupAt(t);
1582
+ n !== ((o = this.resting) == null ? void 0 : o.group) && (this.stopResting(), n !== null && (this.resting = {
1583
+ group: n,
1542
1584
  timer: setTimeout(() => {
1543
- this.resting = null, e.openForGesture = /* @__PURE__ */ new Set([...e.openForGesture, s]), this.host.viewChanged();
1544
- }, Jn)
1585
+ this.resting = null, e.openForGesture = /* @__PURE__ */ new Set([...e.openForGesture, n]), this.host.viewChanged();
1586
+ }, eo)
1545
1587
  }));
1546
1588
  }
1547
1589
  stopResting() {
@@ -1563,69 +1605,70 @@ class Zn {
1563
1605
  lane is open. Asked at a drop, where the answer has to be current; while
1564
1606
  a drag runs, the held set answers instead. */
1565
1607
  allowed(t, e) {
1566
- var s, n;
1567
- return ((n = (s = this.host.handlers()).canMoveTo) == null ? void 0 : n.call(s, t, e)) ?? !0;
1608
+ var n, o;
1609
+ return ((o = (n = this.host.handlers()).canMoveTo) == null ? void 0 : o.call(n, t, e)) ?? !0;
1568
1610
  }
1569
1611
  /** The lanes this work may not go to, for the gesture that is beginning. A
1570
1612
  gesture that cannot change a lane at all asks nothing: the intents the
1571
1613
  caller handles decide whether the question exists. */
1572
1614
  askRefused(t, e) {
1573
- if (!this.host.view.options.intents.includes(e === null ? "place" : "lane")) return Ae;
1574
- const s = this.host.data.lanes.map((n) => n.id);
1575
- return qn(s, t, e, this.host.handlers().canMoveTo);
1615
+ if (!this.host.view.options.intents.includes(e === null ? "place" : "lane")) return De;
1616
+ const n = this.host.data.lanes.map((o) => o.id);
1617
+ return Qs(n, t, e, this.host.handlers().canMoveTo);
1576
1618
  }
1577
1619
  /** What a press at a point would start, given the intents the caller handles. */
1578
1620
  modeAt(t, e) {
1579
- const s = this.host.view, n = s.options.intents;
1580
- for (let i = s.boxes.length - 1; i >= 0; i--) {
1581
- const r = s.boxes[i];
1582
- if (n.includes("stretch")) {
1583
- const a = Ds(r, t, e);
1621
+ const n = this.host.view, o = n.options.intents;
1622
+ if (n.hitAt(t, e).kind === "milestone") return { mode: "pan", subtask: null };
1623
+ for (let i = n.boxes.length - 1; i >= 0; i--) {
1624
+ const r = n.boxes[i];
1625
+ if (o.includes("stretch")) {
1626
+ const a = Nn(r, t, e);
1584
1627
  if (a !== null) return { mode: a === "from" ? "stretch-from" : "stretch-to", subtask: r.subtask };
1585
1628
  }
1586
- if (He(r, t, e) !== null)
1587
- return n.includes("move") || n.includes("lane") ? { mode: "move", subtask: r.subtask } : { mode: "pan", subtask: r.subtask };
1629
+ if (ze(r, t, e) !== null)
1630
+ return o.includes("move") || o.includes("lane") ? { mode: "move", subtask: r.subtask } : { mode: "pan", subtask: r.subtask };
1588
1631
  }
1589
1632
  return { mode: "pan", subtask: null };
1590
1633
  }
1591
1634
  pointerMove(t) {
1592
- const { x: e, y: s } = this.local(t.clientX, t.clientY);
1593
- if (t.pointerType === "touch" && this.touches.has(t.pointerId) && (this.touches.set(t.pointerId, { x: e, y: s }), this.gesture.kind === "pinch")) {
1635
+ const { x: e, y: n } = this.local(t.clientX, t.clientY);
1636
+ if (t.pointerType === "touch" && this.touches.has(t.pointerId) && (this.touches.set(t.pointerId, { x: e, y: n }), this.gesture.kind === "pinch")) {
1594
1637
  const r = this.touchDistance();
1595
1638
  r > 0 && this.gesture.distance > 0 && this.host.view.zoomAt(this.touchCentre(), this.gesture.distance / r) && this.host.viewMoved(!0), this.gesture = { kind: "pinch", distance: r };
1596
1639
  return;
1597
1640
  }
1598
- const n = this.gesture;
1599
- if (n.kind === "pending" && n.pointerId === t.pointerId) {
1600
- if (Math.hypot(e - n.x0, s - n.y0) < (t.pointerType === "touch" ? jn : Ce)) return;
1601
- if (n.mode === "pan" || n.subtask === null)
1602
- this.gesture = { kind: "pan", pointerId: n.pointerId, lastX: n.x0, lastY: n.y0 }, this.setCursor("grabbing");
1641
+ const o = this.gesture;
1642
+ if (o.kind === "pending" && o.pointerId === t.pointerId) {
1643
+ if (Math.hypot(e - o.x0, n - o.y0) < (t.pointerType === "touch" ? to : _e)) return;
1644
+ if (o.mode === "pan" || o.subtask === null)
1645
+ this.gesture = { kind: "pan", pointerId: o.pointerId, lastX: o.x0, lastY: o.y0 }, this.setCursor("grabbing");
1603
1646
  else {
1604
- const r = this.host.view.viewport().scale.fromPx(n.x0);
1647
+ const r = this.host.view.viewport().scale.fromPx(o.x0);
1605
1648
  this.gesture = {
1606
1649
  kind: "edit",
1607
- pointerId: n.pointerId,
1608
- mode: n.mode,
1609
- subtask: n.subtask,
1650
+ pointerId: o.pointerId,
1651
+ mode: o.mode,
1652
+ subtask: o.subtask,
1610
1653
  t0: r,
1611
- ghost: n.subtask,
1654
+ ghost: o.subtask,
1612
1655
  /* Asked here, once, and drawn from the first frame of the drag: the
1613
1656
  lanes that are closed are marked before the pointer reaches one. */
1614
- refused: n.mode === "move" ? this.askRefused(n.subtask, n.subtask.lane) : Ae
1615
- }, this.setCursor(n.mode === "move" ? "grabbing" : "ew-resize");
1657
+ refused: o.mode === "move" ? this.askRefused(o.subtask, o.subtask.lane) : De
1658
+ }, this.setCursor(o.mode === "move" ? "grabbing" : "ew-resize");
1616
1659
  }
1617
1660
  }
1618
1661
  const i = this.gesture;
1619
1662
  if (i.kind === "pan" && i.pointerId === t.pointerId) {
1620
- const r = this.host.view.pan(i.lastX - e, i.lastY - s);
1621
- r.moved && this.host.viewMoved(r.time), this.gesture = { ...i, lastX: e, lastY: s };
1663
+ const r = this.host.view.pan(i.lastX - e, i.lastY - n);
1664
+ r.moved && this.host.viewMoved(r.time), this.gesture = { ...i, lastX: e, lastY: n };
1622
1665
  return;
1623
1666
  }
1624
1667
  if (i.kind === "edit" && i.pointerId === t.pointerId) {
1625
- this.lastClient = { x: t.clientX, y: t.clientY }, this.dragPoint = { x: e, y: s }, this.restOver(s), this.gesture = { ...i, ghost: this.heldGhost(i, e, s) }, this.setCursor(this.refused || this.blocked ? "not-allowed" : i.mode === "move" ? "grabbing" : "ew-resize"), this.host.interactionChanged(), this.autoPan();
1668
+ this.lastClient = { x: t.clientX, y: t.clientY }, this.dragPoint = { x: e, y: n }, this.restOver(n), this.gesture = { ...i, ghost: this.heldGhost(i, e, n) }, this.setCursor(this.refused || this.blocked ? "not-allowed" : i.mode === "move" ? "grabbing" : "ew-resize"), this.host.interactionChanged(), this.autoPan();
1626
1669
  return;
1627
1670
  }
1628
- i.kind === "none" && (this.byKeyboard = !1, this.hoverAt(t.clientX, t.clientY, e, s));
1671
+ i.kind === "none" && (this.byKeyboard = !1, this.hoverAt(t.clientX, t.clientY, e, n));
1629
1672
  }
1630
1673
  pointerUp(t) {
1631
1674
  var i, r;
@@ -1634,18 +1677,18 @@ class Zn {
1634
1677
  this.touches.size === 1 && a !== void 0 ? this.gesture = { kind: "pan", pointerId: a[0], lastX: a[1].x, lastY: a[1].y } : this.touches.size === 0 && (this.gesture = { kind: "none" });
1635
1678
  return;
1636
1679
  }
1637
- const e = this.gesture, { x: s, y: n } = this.local(t.clientX, t.clientY);
1680
+ const e = this.gesture, { x: n, y: o } = this.local(t.clientX, t.clientY);
1638
1681
  if (e.kind === "pending" && e.pointerId === t.pointerId)
1639
- this.gesture = { kind: "none" }, this.click(t.clientX, t.clientY, s, n);
1682
+ this.gesture = { kind: "none" }, this.click(t.clientX, t.clientY, n, o);
1640
1683
  else if (e.kind === "pan" && e.pointerId === t.pointerId)
1641
- this.gesture = { kind: "none" }, this.setCursor("default"), this.hoverAt(t.clientX, t.clientY, s, n);
1684
+ this.gesture = { kind: "none" }, this.setCursor("default"), this.hoverAt(t.clientX, t.clientY, n, o);
1642
1685
  else if (e.kind === "edit" && e.pointerId === t.pointerId) {
1643
1686
  this.stopAutoPan(), this.closeGestureFolds(), this.gesture = { kind: "none" };
1644
- const a = e.ghost.lane === e.subtask.lane || this.allowed(e.subtask, e.ghost.lane), d = this.intentsOf(e.subtask, e.ghost, e.mode).filter(
1687
+ const a = e.ghost.lane === e.subtask.lane || this.allowed(e.subtask, e.ghost.lane), l = this.intentsOf(e.subtask, e.ghost, e.mode).filter(
1645
1688
  (h) => a || h.kind !== "lane"
1646
1689
  );
1647
1690
  this.refused = !1, this.blocked = !1, this.cursor = "default", this.host.interactionChanged();
1648
- for (const h of d) (r = (i = this.host.handlers()).onIntent) == null || r.call(i, h);
1691
+ for (const h of l) (r = (i = this.host.handlers()).onIntent) == null || r.call(i, h);
1649
1692
  }
1650
1693
  }
1651
1694
  /** While a drag is in flight near an edge, pans along once per frame and
@@ -1657,17 +1700,17 @@ class Zn {
1657
1700
  this.panFrame = 0;
1658
1701
  const e = this.gesture;
1659
1702
  if (e.kind !== "edit" && e.kind !== "place") return;
1660
- const s = this.host.view, { x: n, y: i } = this.local(this.lastClient.x, this.lastClient.y), r = Se(n, s.width), a = Se(i, s.height);
1703
+ const n = this.host.view, { x: o, y: i } = this.local(this.lastClient.x, this.lastClient.y), r = Ae(o, n.width), a = Ae(i, n.height);
1661
1704
  if (r === 0 && a === 0) return;
1662
- const d = s.pan(r, a);
1663
- if (d.moved) {
1664
- if (this.dragPoint = { x: n, y: i }, e.kind === "edit")
1665
- this.gesture = { ...e, ghost: this.heldGhost(e, n, i) };
1705
+ const l = n.pan(r, a);
1706
+ if (l.moved) {
1707
+ if (this.dragPoint = { x: o, y: i }, e.kind === "edit")
1708
+ this.gesture = { ...e, ghost: this.heldGhost(e, o, i) };
1666
1709
  else {
1667
- const h = this.placeGhost(e.item, n, i, e.refused);
1710
+ const h = this.placeGhost(e.item, o, i, e.refused);
1668
1711
  this.refused = h.refused, this.blocked = h.blocked, this.gesture = { ...e, ghost: h.ghost ?? e.ghost };
1669
1712
  }
1670
- this.host.viewMoved(d.time), this.panFrame = requestAnimationFrame(t);
1713
+ this.host.viewMoved(l.time), this.panFrame = requestAnimationFrame(t);
1671
1714
  }
1672
1715
  };
1673
1716
  this.panFrame = requestAnimationFrame(t);
@@ -1684,8 +1727,8 @@ class Zn {
1684
1727
  times would be a lie. Nothing is reported: no interaction happened. */
1685
1728
  refreshHover() {
1686
1729
  if (!this.idle || this.hoverKey === "nothing" || this.byKeyboard) return;
1687
- const { x: t, y: e } = this.hoverPoint, s = this.host.view.hitAt(t, e);
1688
- this.hover = s, this.hoverKey = _t(s);
1730
+ const { x: t, y: e } = this.hoverPoint, n = this.host.view.hitAt(t, e);
1731
+ this.hover = n, this.hoverKey = Ot(n);
1689
1732
  }
1690
1733
  pointerLeave() {
1691
1734
  this.gesture.kind !== "none" || this.byKeyboard || this.setHover({ kind: "nothing" }, "nothing");
@@ -1698,19 +1741,19 @@ class Zn {
1698
1741
  contextMenu(t) {
1699
1742
  if (this.host.handlers().onInteraction === void 0) return;
1700
1743
  t.preventDefault();
1701
- const { x: e, y: s } = this.local(t.clientX, t.clientY);
1702
- this.report("contextmenu", this.host.view.hitAt(e, s), t.clientX, t.clientY, e, s);
1744
+ const { x: e, y: n } = this.local(t.clientX, t.clientY);
1745
+ this.report("contextmenu", this.host.view.hitAt(e, n), t.clientX, t.clientY, e, n);
1703
1746
  }
1704
1747
  /** The wheel, as every scrolling area has it (schedule-refinement 02):
1705
1748
  vertical scrolls the lanes, and lets the page scroll on once they are at
1706
1749
  their end; Ctrl or ⌘ zooms - a trackpad pinch arrives as a wheel with
1707
1750
  Ctrl -; horizontal or Shift pans through time. */
1708
1751
  wheel(t) {
1709
- const e = this.host.view, s = Math.max(0, Math.min(e.width, this.local(t.clientX, t.clientY).x)), n = t.deltaMode === 1 ? 16 : t.deltaMode === 2 ? e.height : 1, i = t.deltaX * n, r = t.deltaY * n;
1752
+ const e = this.host.view, n = Math.max(0, Math.min(e.width, this.local(t.clientX, t.clientY).x)), o = t.deltaMode === 1 ? 16 : t.deltaMode === 2 ? e.height : 1, i = t.deltaX * o, r = t.deltaY * o;
1710
1753
  if (t.ctrlKey || t.metaKey) {
1711
1754
  t.preventDefault();
1712
1755
  const h = Math.abs(r) < 50 ? 0.01 : 15e-4;
1713
- e.zoomAt(s, Math.exp(r * h)) && this.host.viewMoved(!0);
1756
+ e.zoomAt(n, Math.exp(r * h)) && this.host.viewMoved(!0);
1714
1757
  return;
1715
1758
  }
1716
1759
  if (Math.abs(i) > Math.abs(r) || t.shiftKey) {
@@ -1722,26 +1765,26 @@ class Zn {
1722
1765
  const a = r > 0 ? e.maxScroll() - e.scrollY : e.scrollY;
1723
1766
  if (r === 0 || a <= 0) return;
1724
1767
  t.preventDefault();
1725
- const d = e.pan(0, r);
1726
- d.moved && this.host.viewMoved(d.time);
1768
+ const l = e.pan(0, r);
1769
+ l.moved && this.host.viewMoved(l.time);
1727
1770
  }
1728
- click(t, e, s, n) {
1729
- const i = this.host.view.hitAt(s, n), r = i.kind === "subtask" ? i.subtask.task : i.kind === "dependency" ? this.host.data.taskOfDependency(i.dependency) : null;
1730
- this.host.select(r, i.kind === "subtask" ? i.subtask.id : null), this.report("click", i, t, e, s, n);
1771
+ click(t, e, n, o) {
1772
+ const i = this.host.view.hitAt(n, o), r = i.kind === "subtask" ? i.subtask.task : i.kind === "dependency" ? this.host.data.taskOfDependency(i.dependency) : null;
1773
+ this.host.select(r, i.kind === "subtask" ? i.subtask.id : null), this.report("click", i, t, e, n, o);
1731
1774
  }
1732
- hoverAt(t, e, s, n) {
1733
- const i = this.host.view.hitAt(s, n), r = _t(i), { mode: a } = this.modeAt(s, n);
1734
- if (this.setCursor(a === "move" ? "grab" : a === "stretch-from" || a === "stretch-to" ? "ew-resize" : "default"), this.hoverPoint = { x: s, y: n }, r === this.hoverKey) {
1735
- (i.kind === "subtask" || i.kind === "dependency") && this.host.interactionChanged();
1775
+ hoverAt(t, e, n, o) {
1776
+ const i = this.host.view.hitAt(n, o), r = Ot(i), { mode: a } = this.modeAt(n, o);
1777
+ if (this.setCursor(a === "move" ? "grab" : a === "stretch-from" || a === "stretch-to" ? "ew-resize" : "default"), this.hoverPoint = { x: n, y: o }, r === this.hoverKey) {
1778
+ (i.kind === "subtask" || i.kind === "dependency" || i.kind === "milestone") && this.host.interactionChanged();
1736
1779
  return;
1737
1780
  }
1738
- this.setHover(i, r), this.report("hover", i, t, e, s, n);
1781
+ this.setHover(i, r), this.report("hover", i, t, e, n, o);
1739
1782
  }
1740
1783
  /** The keyboard sets the hover: drawn, and its tooltip shown, as the
1741
1784
  pointer's would be - and reported to nobody, since `onInteraction`
1742
1785
  speaks of pointer positions. `nothing` hands the hover back. */
1743
1786
  setKeyboardHover(t, e) {
1744
- this.byKeyboard = t.kind !== "nothing", this.hoverPoint = e, this.hover = t, this.hoverKey = _t(t), this.host.interactionChanged();
1787
+ this.byKeyboard = t.kind !== "nothing", this.hoverPoint = e, this.hover = t, this.hoverKey = Ot(t), this.host.interactionChanged();
1745
1788
  }
1746
1789
  setHover(t, e) {
1747
1790
  e !== this.hoverKey && (this.hoverKey = e, this.hover = t, this.host.interactionChanged());
@@ -1764,10 +1807,10 @@ class Zn {
1764
1807
  dragging and handles the place intent, the drop is accepted and a ghost
1765
1808
  shows where the work would land. */
1766
1809
  dragOver(t, e) {
1767
- const s = this.host.view;
1768
- if (e === null || !s.options.intents.includes("place")) return;
1769
- const { x: n, y: i } = this.local(t.clientX, t.clientY);
1770
- if (s.laneIdAt(i) === null && s.foldedGroupAt(i) === null) {
1810
+ const n = this.host.view;
1811
+ if (e === null || !n.options.intents.includes("place")) return;
1812
+ const { x: o, y: i } = this.local(t.clientX, t.clientY);
1813
+ if (n.laneIdAt(i) === null && n.foldedGroupAt(i) === null) {
1771
1814
  this.clearPlacing();
1772
1815
  return;
1773
1816
  }
@@ -1777,34 +1820,34 @@ class Zn {
1777
1820
  pointer is not over one either, the rule is asked about an item
1778
1821
  whose own lane is empty - which is the truth of it: `canMoveTo`
1779
1822
  is asked ABOUT a lane, and the one this item is on is none. */
1780
- this.askRefused(this.askedFor(e, this.onLane(i) ?? "", n), null)
1781
- ), a = this.placeGhost(e, n, i, r);
1823
+ this.askRefused(this.askedFor(e, this.onLane(i) ?? "", o), null)
1824
+ ), a = this.placeGhost(e, o, i, r);
1782
1825
  this.refused = a.refused, this.blocked = a.blocked, this.setCursor(a.refused || a.blocked ? "not-allowed" : "default");
1783
- const d = this.gesture.kind === "place" ? this.gesture.ghost : null, h = a.ghost ?? (a.refused || a.blocked ? d : null);
1784
- t.dataTransfer !== null && (t.dataTransfer.dropEffect = h === null ? "none" : "copy"), h !== null && (this.lastClient = { x: t.clientX, y: t.clientY }, this.dragPoint = { x: n, y: i }, this.gesture = { kind: "place", ghost: h, item: e, refused: r }, this.host.interactionChanged(), this.autoPan());
1826
+ const l = this.gesture.kind === "place" ? this.gesture.ghost : null, h = a.ghost ?? (a.refused || a.blocked ? l : null);
1827
+ t.dataTransfer !== null && (t.dataTransfer.dropEffect = h === null ? "none" : "copy"), h !== null && (this.lastClient = { x: t.clientX, y: t.clientY }, this.dragPoint = { x: o, y: i }, this.gesture = { kind: "place", ghost: h, item: e, refused: r }, this.host.interactionChanged(), this.autoPan());
1785
1828
  }
1786
1829
  /** The ghost of a drag from outside at a point on the plot: none off the
1787
1830
  lanes, none where the caller refuses that lane and none where it would
1788
1831
  cover blocked time - which the answer says apart, because they mean
1789
1832
  different things to the drag. */
1790
- placeGhost(t, e, s, n) {
1791
- const i = this.onLane(s);
1833
+ placeGhost(t, e, n, o) {
1834
+ const i = this.onLane(n);
1792
1835
  if (i === null) return { ghost: null, refused: !1, blocked: !1 };
1793
- if (n.has(i)) return { ghost: null, refused: !0, blocked: !1 };
1794
- const r = { ...this.askedFor(t, i, e), id: Le };
1795
- return at(r, null, this.host.data.blocked) ? { ghost: null, refused: !1, blocked: !0 } : { ghost: r, refused: !1, blocked: !1 };
1836
+ if (o.has(i)) return { ghost: null, refused: !0, blocked: !1 };
1837
+ const r = { ...this.askedFor(t, i, e), id: Ce };
1838
+ return dt(r, null, this.host.data.blocked) ? { ghost: null, refused: !1, blocked: !0 } : { ghost: r, refused: !1, blocked: !1 };
1796
1839
  }
1797
1840
  /** The dragged item as a subtask, under the caller's key for it - not the
1798
1841
  internal sentinel: the rule is asked about the thing the application says
1799
1842
  it is dragging, and the ghost only afterwards takes the sentinel. */
1800
- askedFor(t, e, s) {
1801
- const n = this.snapInside(this.host.view.timeAt(s), this.snapStep());
1843
+ askedFor(t, e, n) {
1844
+ const o = this.snapInside(this.host.view.timeAt(n), this.snapStep());
1802
1845
  return {
1803
1846
  id: t.item,
1804
1847
  task: t.task,
1805
1848
  lane: e,
1806
- from: n,
1807
- to: n + t.duration,
1849
+ from: o,
1850
+ to: o + t.duration,
1808
1851
  ...t.leadIn === void 0 ? {} : { leadIn: t.leadIn },
1809
1852
  ...t.leadOut === void 0 ? {} : { leadOut: t.leadOut }
1810
1853
  };
@@ -1816,17 +1859,17 @@ class Zn {
1816
1859
  const e = this.gesture;
1817
1860
  if (e.kind !== "place") return;
1818
1861
  t.preventDefault();
1819
- const { ghost: s, item: n } = e;
1820
- if (this.stopAutoPan(), this.closeGestureFolds(), this.gesture = { kind: "none" }, this.refused = !1, this.blocked = !1, this.cursor = "default", this.host.interactionChanged(), !this.allowed({ ...s, id: n.item }, s.lane)) return;
1862
+ const { ghost: n, item: o } = e;
1863
+ if (this.stopAutoPan(), this.closeGestureFolds(), this.gesture = { kind: "none" }, this.refused = !1, this.blocked = !1, this.cursor = "default", this.host.interactionChanged(), !this.allowed({ ...n, id: o.item }, n.lane)) return;
1821
1864
  const i = {
1822
1865
  kind: "place",
1823
- item: n.item,
1824
- task: s.task,
1825
- lane: s.lane,
1826
- from: s.from,
1827
- to: s.to,
1828
- ...s.leadIn === void 0 ? {} : { leadIn: s.leadIn },
1829
- ...s.leadOut === void 0 ? {} : { leadOut: s.leadOut }
1866
+ item: o.item,
1867
+ task: n.task,
1868
+ lane: n.lane,
1869
+ from: n.from,
1870
+ to: n.to,
1871
+ ...n.leadIn === void 0 ? {} : { leadIn: n.leadIn },
1872
+ ...n.leadOut === void 0 ? {} : { leadOut: n.leadOut }
1830
1873
  };
1831
1874
  (a = (r = this.host.handlers()).onIntent) == null || a.call(r, i);
1832
1875
  }
@@ -1848,52 +1891,52 @@ class Zn {
1848
1891
  put the work into blocked time it did not already cover, the ghost where
1849
1892
  it last stood. It is held, not clamped: a pointer carried on past the
1850
1893
  blocked time takes the ghost along again. */
1851
- heldGhost(t, e, s) {
1852
- const n = this.ghostFor(t, e, s);
1853
- return this.blocked = at(n, t.subtask, this.host.data.blocked), this.blocked ? t.ghost : n;
1894
+ heldGhost(t, e, n) {
1895
+ const o = this.ghostFor(t, e, n);
1896
+ return this.blocked = dt(o, t.subtask, this.host.data.blocked), this.blocked ? t.ghost : o;
1854
1897
  }
1855
- ghostFor(t, e, s) {
1856
- const n = this.host.view, i = t.subtask, r = this.snapStep(), a = n.options.intents, d = this.snapInside(n.timeAt(e), r);
1898
+ ghostFor(t, e, n) {
1899
+ const o = this.host.view, i = t.subtask, r = this.snapStep(), a = o.options.intents, l = this.snapInside(o.timeAt(e), r);
1857
1900
  switch (t.mode) {
1858
1901
  case "move": {
1859
1902
  let h = i.from;
1860
- const l = n.viewport().scale, c = l.fromPx(e) - t.t0;
1861
- a.includes("move") && Math.abs(c * l.m) >= Ce && (h = this.shifted(i.from, c, r));
1862
- let p = t.ghost.lane;
1903
+ const d = o.viewport().scale, c = d.fromPx(e) - t.t0;
1904
+ a.includes("move") && Math.abs(c * d.m) >= _e && (h = this.shifted(i.from, c, r));
1905
+ let m = t.ghost.lane;
1863
1906
  if (a.includes("lane")) {
1864
- const m = this.onLane(s) ?? p;
1865
- this.refused = t.refused.has(m), this.refused || (p = m);
1907
+ const p = this.onLane(n) ?? m;
1908
+ this.refused = t.refused.has(p), this.refused || (m = p);
1866
1909
  } else
1867
1910
  this.refused = !1;
1868
- return { ...i, from: h, to: h + (i.to - i.from), lane: p };
1911
+ return { ...i, from: h, to: h + (i.to - i.from), lane: m };
1869
1912
  }
1870
1913
  case "stretch-from":
1871
- return { ...i, from: Math.min(d, i.to - Math.max(r.step, q)) };
1914
+ return { ...i, from: Math.min(l, i.to - Math.max(r.step, q)) };
1872
1915
  case "stretch-to":
1873
- return { ...i, to: Math.max(d, i.from + Math.max(r.step, q)) };
1916
+ return { ...i, to: Math.max(l, i.from + Math.max(r.step, q)) };
1874
1917
  case "leadIn":
1875
- return { ...i, leadIn: Math.max(0, i.from - d) };
1918
+ return { ...i, leadIn: Math.max(0, i.from - l) };
1876
1919
  case "leadOut":
1877
- return { ...i, leadOut: Math.max(0, d - i.to) };
1920
+ return { ...i, leadOut: Math.max(0, l - i.to) };
1878
1921
  }
1879
1922
  }
1880
1923
  /** A time moved by an amount of WORKING time and snapped: a drag moves
1881
1924
  a start this way, and a key by one step of the raster - one arithmetic,
1882
1925
  so a key proposes exactly what a drag of that length would. */
1883
- shifted(t, e, s) {
1884
- const n = et(this.host.view.options.calendar), i = H(t, n) + e, r = n.intervals.length === 0 ? i : j(Math.max(0, Math.min(n.total, i)), n);
1885
- return this.snapInside(r, s);
1926
+ shifted(t, e, n) {
1927
+ const o = nt(this.host.view.options.calendar), i = Y(t, o) + e, r = o.intervals.length === 0 ? i : j(Math.max(0, Math.min(o.total, i)), o);
1928
+ return this.snapInside(r, n);
1886
1929
  }
1887
1930
  /** Snapped - and, where the raster lands in time the calendar removes, moved
1888
1931
  on to the seam, where time counts again. An intent never asks for a time
1889
1932
  nobody works. */
1890
1933
  snapInside(t, e) {
1891
- const s = ws(t, e), n = et(this.host.view.options.calendar);
1892
- return n.intervals.length === 0 ? s : j(H(s, n), n);
1934
+ const n = In(t, e), o = nt(this.host.view.options.calendar);
1935
+ return o.intervals.length === 0 ? n : j(Y(n, o), o);
1893
1936
  }
1894
- intentsOf(t, e, s) {
1895
- const n = [], i = this.host.view.options.intents, r = t.id;
1896
- return s === "move" ? (e.from !== t.from && i.includes("move") && n.push({ kind: "move", subtask: r, from: e.from, to: e.to }), e.lane !== t.lane && i.includes("lane") && n.push({ kind: "lane", subtask: r, lane: e.lane })) : s === "stretch-from" || s === "stretch-to" ? (e.from !== t.from || e.to !== t.to) && n.push({ kind: "stretch", subtask: r, from: e.from, to: e.to }) : s === "leadIn" ? (e.leadIn ?? 0) !== (t.leadIn ?? 0) && n.push({ kind: "leadIn", subtask: r, leadIn: e.leadIn ?? 0 }) : (e.leadOut ?? 0) !== (t.leadOut ?? 0) && n.push({ kind: "leadOut", subtask: r, leadOut: e.leadOut ?? 0 }), n;
1937
+ intentsOf(t, e, n) {
1938
+ const o = [], i = this.host.view.options.intents, r = t.id;
1939
+ return n === "move" ? (e.from !== t.from && i.includes("move") && o.push({ kind: "move", subtask: r, from: e.from, to: e.to }), e.lane !== t.lane && i.includes("lane") && o.push({ kind: "lane", subtask: r, lane: e.lane })) : n === "stretch-from" || n === "stretch-to" ? (e.from !== t.from || e.to !== t.to) && o.push({ kind: "stretch", subtask: r, from: e.from, to: e.to }) : n === "leadIn" ? (e.leadIn ?? 0) !== (t.leadIn ?? 0) && o.push({ kind: "leadIn", subtask: r, leadIn: e.leadIn ?? 0 }) : (e.leadOut ?? 0) !== (t.leadOut ?? 0) && o.push({ kind: "leadOut", subtask: r, leadOut: e.leadOut ?? 0 }), o;
1897
1940
  }
1898
1941
  /** The lane the ghost came from - the only other lane a drag can touch. */
1899
1942
  ghostHome(t) {
@@ -1909,34 +1952,34 @@ class Zn {
1909
1952
  keeps a plan of hundreds of tasks fluid while a drag runs, since this is
1910
1953
  computed on every pointer movement. */
1911
1954
  ghostFindings(t, e) {
1912
- const s = this.host.data, n = (l) => l.lane === t.lane || l.lane === e, r = [...s.subtasks.filter((l) => l.id !== t.id && n(l)), t], a = (l) => l.first === t.id || l.second === t.id, d = s.dependencies.filter((l) => l.from === t.id || l.to === t.id), h = t.id === Le ? s.subtasks : s.subtasks.map((l) => l.id === t.id ? t : l);
1913
- return { overlaps: Ht(r).filter(a), violated: Yt(h, d) };
1955
+ const n = this.host.data, o = (d) => d.lane === t.lane || d.lane === e, r = [...n.subtasks.filter((d) => d.id !== t.id && o(d)), t], a = (d) => d.first === t.id || d.second === t.id, l = n.dependencies.filter((d) => d.from === t.id || d.to === t.id), h = t.id === Ce ? n.subtasks : n.subtasks.map((d) => d.id === t.id ? t : d);
1956
+ return { overlaps: zt(r).filter(a), violated: Kt(h, l) };
1914
1957
  }
1915
1958
  }
1916
- function Qn(o, t) {
1959
+ function so(s, t) {
1917
1960
  const e = /* @__PURE__ */ new Map();
1918
- for (const s of t) {
1919
- const n = o.slots.get(s.lane), i = n === void 0 ? null : st(o, n.top);
1961
+ for (const n of t) {
1962
+ const o = s.slots.get(n.lane), i = o === void 0 ? null : st(s, o.top);
1920
1963
  if (i === null) continue;
1921
- const r = o.rows.indexOf(i);
1922
- e.set(r, [...e.get(r) ?? [], s]);
1964
+ const r = s.rows.indexOf(i);
1965
+ e.set(r, [...e.get(r) ?? [], n]);
1923
1966
  }
1924
- return [...e.entries()].sort(([s], [n]) => s - n).map(([, s]) => s.sort((n, i) => n.from - i.from || n.to - i.to));
1967
+ return [...e.entries()].sort(([n], [o]) => n - o).map(([, n]) => n.sort((o, i) => o.from - i.from || o.to - i.to));
1925
1968
  }
1926
- const _e = (o, t) => t < o.from ? o.from - t : t > o.to ? t - o.to : 0;
1927
- function to(o, t, e, s) {
1969
+ const Fe = (s, t) => t < s.from ? s.from - t : t > s.to ? t - s.to : 0;
1970
+ function oo(s, t, e, n) {
1928
1971
  var h;
1929
- let n = -1, i = -1;
1930
- for (let l = 0; l < o.length && t !== null && n < 0; l++)
1931
- i = o[l].findIndex((c) => c.id === t), i >= 0 && (n = l);
1932
- if (n < 0) {
1933
- for (const l of o) {
1934
- const c = l.find((p) => p.to > s[0] && p.from < s[1]);
1972
+ let o = -1, i = -1;
1973
+ for (let d = 0; d < s.length && t !== null && o < 0; d++)
1974
+ i = s[d].findIndex((c) => c.id === t), i >= 0 && (o = d);
1975
+ if (o < 0) {
1976
+ for (const d of s) {
1977
+ const c = d.find((m) => m.to > n[0] && m.from < n[1]);
1935
1978
  if (c !== void 0) return c;
1936
1979
  }
1937
- return ((h = o[0]) == null ? void 0 : h[0]) ?? null;
1980
+ return ((h = s[0]) == null ? void 0 : h[0]) ?? null;
1938
1981
  }
1939
- const r = o[n], a = r[i], d = (s[1] - s[0]) / 10;
1982
+ const r = s[o], a = r[i], l = (n[1] - n[0]) / 10;
1940
1983
  switch (e) {
1941
1984
  case "next":
1942
1985
  return r[i + 1] ?? a;
@@ -1947,30 +1990,31 @@ function to(o, t, e, s) {
1947
1990
  case "last":
1948
1991
  return r[r.length - 1];
1949
1992
  case "pageNext":
1950
- return r.find((l, c) => c > i && l.from >= a.from + d) ?? r[r.length - 1];
1993
+ return r.find((d, c) => c > i && d.from >= a.from + l) ?? r[r.length - 1];
1951
1994
  case "pagePrevious":
1952
- for (let l = i - 1; l >= 0; l--) if (r[l].from <= a.from - d) return r[l];
1995
+ for (let d = i - 1; d >= 0; d--) if (r[d].from <= a.from - l) return r[d];
1953
1996
  return r[0];
1954
1997
  case "up":
1955
1998
  case "down": {
1956
- const l = o[e === "up" ? n - 1 : n + 1];
1957
- if (l === void 0) return a;
1999
+ const d = s[e === "up" ? o - 1 : o + 1];
2000
+ if (d === void 0) return a;
1958
2001
  const c = (a.from + a.to) / 2;
1959
- return l.reduce((p, m) => _e(m, c) < _e(p, c) ? m : p);
2002
+ return d.reduce((m, p) => Fe(p, c) < Fe(m, c) ? p : m);
1960
2003
  }
1961
2004
  }
1962
2005
  }
1963
- function eo(o, t, e, s) {
2006
+ function io(s, t, e, n) {
2007
+ if (e.kind === "milestone") return e;
1964
2008
  if (e.kind === "dependency") {
1965
- const i = o.find((a) => a.id === e.id), r = i === void 0 ? void 0 : s === "out" ? i.to : i.from;
2009
+ const i = s.find((a) => a.id === e.id), r = i === void 0 ? void 0 : n === "out" ? i.to : i.from;
1966
2010
  return r !== void 0 && t.has(r) ? { kind: "subtask", id: r } : e;
1967
2011
  }
1968
- const n = o.find(
1969
- (i) => (s === "out" ? i.from : i.to) === e.id && t.has(s === "out" ? i.to : i.from)
2012
+ const o = s.find(
2013
+ (i) => (n === "out" ? i.from : i.to) === e.id && t.has(n === "out" ? i.to : i.from)
1970
2014
  );
1971
- return n === void 0 ? e : { kind: "dependency", id: n.id };
2015
+ return o === void 0 ? e : { kind: "dependency", id: o.id };
1972
2016
  }
1973
- const so = 150, no = {
2017
+ const pt = "\0milestone:", ro = 150, ao = {
1974
2018
  ArrowRight: "next",
1975
2019
  ArrowLeft: "previous",
1976
2020
  ArrowUp: "up",
@@ -1980,7 +2024,7 @@ const so = 150, no = {
1980
2024
  PageDown: "pageNext",
1981
2025
  PageUp: "pagePrevious"
1982
2026
  };
1983
- class oo {
2027
+ class lo {
1984
2028
  constructor(t) {
1985
2029
  f(this, "spoken", null);
1986
2030
  f(this, "timer", null);
@@ -1989,7 +2033,7 @@ class oo {
1989
2033
  /** Where the keys stand: the hover, whoever set it. */
1990
2034
  active() {
1991
2035
  const t = this.host.gestures.hover;
1992
- return t.kind === "subtask" ? { kind: "subtask", id: t.subtask.id } : t.kind === "dependency" ? { kind: "dependency", id: t.dependency.id } : null;
2036
+ return t.kind === "subtask" ? { kind: "subtask", id: t.subtask.id } : t.kind === "dependency" ? { kind: "dependency", id: t.dependency.id } : t.kind === "milestone" ? { kind: "milestone", id: t.milestone.id } : null;
1993
2037
  }
1994
2038
  /** The focus came in by keyboard: the walk starts where the pointer
1995
2039
  stands, or at the first subtask in view. A click focuses the plot too,
@@ -2005,34 +2049,34 @@ class oo {
2005
2049
  key(t) {
2006
2050
  const e = this.host.gestures;
2007
2051
  if (t.metaKey || !e.idle) return !1;
2008
- const s = t.key.toLowerCase() === "t" && !t.ctrlKey && !t.altKey;
2009
- if (t.key === "]" || t.key === "[" || s) {
2052
+ const n = t.key.toLowerCase() === "t" && !t.ctrlKey && !t.altKey;
2053
+ if (t.key === "]" || t.key === "[" || n) {
2010
2054
  const i = this.active();
2011
2055
  if (i === null) return !1;
2012
- const r = this.host.data, a = s ? !t.shiftKey : t.key === "]";
2013
- return this.show(eo(r.dependencies, r.subtaskById, i, a ? "out" : "back")), !0;
2056
+ const r = this.host.data, a = n ? !t.shiftKey : t.key === "]";
2057
+ return this.show(io(r.dependencies, r.subtaskById, i, a ? "out" : "back")), !0;
2014
2058
  }
2015
2059
  if (t.ctrlKey) return !1;
2016
2060
  if (t.altKey) return this.edit(t);
2017
2061
  if (t.key === "Escape")
2018
2062
  return e.byKeyboard ? (this.blur(), !0) : !1;
2019
2063
  if (t.key === "Enter" || t.key === " ") return this.select();
2020
- const n = t.shiftKey ? void 0 : no[t.key];
2021
- return n === void 0 ? !1 : (this.walk(n), !0);
2064
+ const o = t.shiftKey ? void 0 : ao[t.key];
2065
+ return o === void 0 ? !1 : (this.walk(o), !0);
2022
2066
  }
2023
2067
  walk(t) {
2024
- var d;
2025
- const { data: e, view: s } = this.host, n = this.active(), i = n === null ? null : n.kind === "subtask" ? n.id : ((d = e.dependencies.find((h) => h.id === n.id)) == null ? void 0 : d.from) ?? null;
2026
- let r = Qn(s.rows, e.subtasks);
2068
+ var h;
2069
+ const { data: e, view: n } = this.host, o = this.active(), i = o === null ? null : o.kind === "subtask" ? o.id : o.kind === "milestone" ? pt + o.id : ((h = e.dependencies.find((d) => d.id === o.id)) == null ? void 0 : h.from) ?? null, r = [...e.subtasks, ...e.milestones.map((d) => ({ id: pt + d.id, lane: d.lane, from: d.at, to: d.at }))];
2070
+ let a = so(n.rows, r);
2027
2071
  if (i === null) {
2028
- const h = r.filter((l) => {
2029
- const c = s.boxById.get(l[0].id);
2030
- return c !== void 0 && c.y + c.height > 0 && c.y < s.height;
2072
+ const d = a.filter((c) => {
2073
+ const m = J(n.viewport(), c[0].lane);
2074
+ return m !== null && m.top + m.height > 0 && m.top < n.height;
2031
2075
  });
2032
- h.length > 0 && (r = h);
2076
+ d.length > 0 && (a = d);
2033
2077
  }
2034
- const a = to(r, i, t, this.host.visibleDomain());
2035
- a !== null && this.show({ kind: "subtask", id: a.id });
2078
+ const l = oo(a, i, t, this.host.visibleDomain());
2079
+ l !== null && this.show(l.id.startsWith(pt) ? { kind: "milestone", id: l.id.slice(pt.length) } : { kind: "subtask", id: l.id });
2036
2080
  }
2037
2081
  /** Space and Enter select as a click does: the whole task, and the subtask. */
2038
2082
  select() {
@@ -2046,57 +2090,65 @@ class oo {
2046
2090
  end - the intents a drag of that length reports (ADR-0023), and only
2047
2091
  where the caller handles them. Nothing is applied here. */
2048
2092
  edit(t) {
2049
- var c, p;
2050
- const e = this.host.gestures.hover, s = t.key === "ArrowRight" ? 1 : t.key === "ArrowLeft" ? -1 : 0;
2051
- if (s === 0) return !1;
2093
+ var c, m;
2094
+ const e = this.host.gestures.hover, n = t.key === "ArrowRight" ? 1 : t.key === "ArrowLeft" ? -1 : 0;
2095
+ if (n === 0) return !1;
2052
2096
  if (e.kind !== "subtask") return !0;
2053
- const n = e.subtask, i = this.host.gestures, r = this.host.view.options.intents, a = i.snapStep(), d = a.step > 0 ? a : { step: this.host.view.step(), offset: 0 }, h = this.host.data.blocked;
2054
- let l = null;
2097
+ const o = e.subtask, i = this.host.gestures, r = this.host.view.options.intents, a = i.snapStep(), l = a.step > 0 ? a : { step: this.host.view.step(), offset: 0 }, h = this.host.data.blocked;
2098
+ let d = null;
2055
2099
  if (!t.shiftKey && r.includes("move")) {
2056
- const m = (I) => ({ ...n, from: I, to: I + (n.to - n.from) });
2057
- let y = n.from;
2100
+ const p = (I) => ({ ...o, from: I, to: I + (o.to - o.from) });
2101
+ let y = o.from;
2058
2102
  for (let I = 0; I < 1e3; I++) {
2059
- const A = i.shifted(y, s * d.step, d);
2060
- if (A === y || (y = A, !at(m(y), n, h))) break;
2103
+ const A = i.shifted(y, n * l.step, l);
2104
+ if (A === y || (y = A, !dt(p(y), o, h))) break;
2061
2105
  }
2062
- y !== n.from && !at(m(y), n, h) && (l = { kind: "move", subtask: n.id, from: y, to: m(y).to });
2106
+ y !== o.from && !dt(p(y), o, h) && (d = { kind: "move", subtask: o.id, from: y, to: p(y).to });
2063
2107
  } else if (t.shiftKey && r.includes("stretch")) {
2064
- const m = Math.max(i.shifted(n.to, s * d.step, d), n.from + Math.max(d.step, q));
2065
- m !== n.to && !at({ ...n, to: m }, n, h) && (l = { kind: "stretch", subtask: n.id, from: n.from, to: m });
2108
+ const p = Math.max(i.shifted(o.to, n * l.step, l), o.from + Math.max(l.step, q));
2109
+ p !== o.to && !dt({ ...o, to: p }, o, h) && (d = { kind: "stretch", subtask: o.id, from: o.from, to: p });
2066
2110
  }
2067
- return i.byKeyboard = !0, l !== null && ((p = (c = this.host.handlers()).onIntent) == null || p.call(c, l)), this.scheduleReadout(), !0;
2111
+ return i.byKeyboard = !0, d !== null && ((m = (c = this.host.handlers()).onIntent) == null || m.call(c, d)), this.scheduleReadout(), !0;
2068
2112
  }
2069
2113
  /** The keys stand on this target: brought into view, drawn as the hover. */
2070
2114
  show(t, e = !0) {
2071
- const s = this.hitOf(t);
2072
- if (s === null) return;
2073
- e && this.reveal(t);
2074
- const n = this.bounds(t);
2115
+ const n = this.hitOf(t);
2075
2116
  if (n === null) return;
2076
- const { view: i } = this.host, r = (a, d) => Math.max(0, Math.min(d, a));
2077
- this.host.gestures.setKeyboardHover(s, {
2078
- x: (r(n.x0, i.width) + r(n.x1, i.width)) / 2,
2079
- y: (r(n.y0, i.height) + r(n.y1, i.height)) / 2
2117
+ e && this.reveal(t);
2118
+ const o = this.bounds(t);
2119
+ if (o === null) return;
2120
+ const { view: i } = this.host, r = (a, l) => Math.max(0, Math.min(l, a));
2121
+ this.host.gestures.setKeyboardHover(n, {
2122
+ x: (r(o.x0, i.width) + r(o.x1, i.width)) / 2,
2123
+ y: (r(o.y0, i.height) + r(o.y1, i.height)) / 2
2080
2124
  }), e && this.scheduleReadout();
2081
2125
  }
2082
2126
  hitOf(t) {
2083
2127
  const e = this.host.data;
2084
2128
  if (t.kind === "subtask") {
2085
- const n = e.subtaskById.get(t.id);
2086
- return n === void 0 ? null : { kind: "subtask", subtask: n, part: "main" };
2129
+ const o = e.subtaskById.get(t.id);
2130
+ return o === void 0 ? null : { kind: "subtask", subtask: o, part: "main" };
2087
2131
  }
2088
- const s = e.dependencies.find((n) => n.id === t.id);
2089
- return s === void 0 ? null : { kind: "dependency", dependency: s };
2132
+ if (t.kind === "milestone") {
2133
+ const o = e.milestones.find((i) => i.id === t.id);
2134
+ return o === void 0 ? null : { kind: "milestone", milestone: o };
2135
+ }
2136
+ const n = e.dependencies.find((o) => o.id === t.id);
2137
+ return n === void 0 ? null : { kind: "dependency", dependency: n };
2090
2138
  }
2091
2139
  /** Where a target lies on the plot: a subtask's bar, or the span between
2092
2140
  the two bars a dependency joins. */
2093
2141
  bounds(t) {
2094
- const e = this.host.view, s = (a) => e.boxById.get(a);
2142
+ const e = this.host.view, n = (a) => e.boxById.get(a);
2095
2143
  if (t.kind === "subtask") {
2096
- const a = s(t.id);
2144
+ const a = n(t.id);
2097
2145
  return a === void 0 ? null : { x0: a.outerFrom, x1: a.outerTo, y0: a.y, y1: a.y + a.height };
2098
2146
  }
2099
- const n = this.host.data.dependencies.find((a) => a.id === t.id), i = n === void 0 ? void 0 : s(n.from), r = n === void 0 ? void 0 : s(n.to);
2147
+ if (t.kind === "milestone") {
2148
+ const a = this.host.data.milestones.find((h) => h.id === t.id), l = a === void 0 ? null : Ut(e.viewport(), a);
2149
+ return l === null ? null : { x0: l.x - l.half, x1: l.x + l.half, y0: l.y - l.half, y1: l.y + l.half };
2150
+ }
2151
+ const o = this.host.data.dependencies.find((a) => a.id === t.id), i = o === void 0 ? void 0 : n(o.from), r = o === void 0 ? void 0 : n(o.to);
2100
2152
  return i === void 0 || r === void 0 ? null : {
2101
2153
  x0: Math.min(i.mainTo, r.mainFrom),
2102
2154
  x1: Math.max(i.mainTo, r.mainFrom),
@@ -2108,11 +2160,11 @@ class oo {
2108
2160
  at the side it came in from; a target wider than the view shows its
2109
2161
  start. As a drag at the edge pans along, the keys do. */
2110
2162
  reveal(t) {
2111
- const e = this.bounds(t), s = this.host.view;
2112
- if (e === null || s.width <= 0) return;
2113
- const n = Math.min(24, s.width / 10), i = e.x0 < 0 ? e.x0 - n : e.x1 > s.width ? Math.max(0, Math.min(e.x1 - s.width + n, e.x0 - n)) : 0, r = e.y0 < 0 ? e.y0 : e.y1 > s.height ? Math.min(e.y1 - s.height, e.y0) : 0;
2163
+ const e = this.bounds(t), n = this.host.view;
2164
+ if (e === null || n.width <= 0) return;
2165
+ const o = Math.min(24, n.width / 10), i = e.x0 < 0 ? e.x0 - o : e.x1 > n.width ? Math.max(0, Math.min(e.x1 - n.width + o, e.x0 - o)) : 0, r = e.y0 < 0 ? e.y0 : e.y1 > n.height ? Math.min(e.y1 - n.height, e.y0) : 0;
2114
2166
  if (i === 0 && r === 0) return;
2115
- const a = s.pan(i, r);
2167
+ const a = n.pan(i, r);
2116
2168
  a.moved && this.host.viewMoved(a.time);
2117
2169
  }
2118
2170
  /** After the data or the view changed: the keys' target is read anew by its
@@ -2125,43 +2177,43 @@ class oo {
2125
2177
  the hover: a pointer that took it over in the pause is not spoken for. */
2126
2178
  scheduleReadout() {
2127
2179
  this.timer !== null && clearTimeout(this.timer), this.timer = setTimeout(() => {
2128
- var s;
2180
+ var n;
2129
2181
  this.timer = null;
2130
2182
  const t = this.host.gestures.hover;
2131
2183
  if (!this.host.gestures.byKeyboard) return;
2132
2184
  const e = this.host.data.tooltipTargetFor(t);
2133
- e !== null && (this.spoken = { target: e, lane: t.kind === "subtask" ? t.subtask.lane : null, count: (((s = this.spoken) == null ? void 0 : s.count) ?? 0) + 1 }, this.host.spokenChanged());
2134
- }, so);
2185
+ e !== null && (this.spoken = { target: e, lane: t.kind === "subtask" ? t.subtask.lane : t.kind === "milestone" ? t.milestone.lane : null, count: (((n = this.spoken) == null ? void 0 : n.count) ?? 0) + 1 }, this.host.spokenChanged());
2186
+ }, ro);
2135
2187
  }
2136
2188
  /** Unmount: no readout after it. */
2137
2189
  stop() {
2138
2190
  this.timer !== null && clearTimeout(this.timer), this.timer = null;
2139
2191
  }
2140
2192
  }
2141
- const Q = (o) => JSON.stringify([o.domain ?? null, [...o.folded ?? []].sort()]);
2142
- function io(o, t) {
2143
- if (t.size === 0 || o.folded === void 0) return o;
2144
- const e = o.folded.filter((s) => t.has(s));
2145
- return e.length === o.folded.length ? o : { ...o.domain ? { domain: o.domain } : {}, ...e.length ? { folded: e } : {} };
2193
+ const tt = (s) => JSON.stringify([s.domain ?? null, [...s.folded ?? []].sort()]);
2194
+ function ho(s, t) {
2195
+ if (t.size === 0 || s.folded === void 0) return s;
2196
+ const e = s.folded.filter((n) => t.has(n));
2197
+ return e.length === s.folded.length ? s : { ...s.domain ? { domain: s.domain } : {}, ...e.length ? { folded: e } : {} };
2146
2198
  }
2147
- function ro(o, t, e = (s) => s) {
2148
- if (o.length === 0) return null;
2149
- let s = 1 / 0, n = -1 / 0;
2150
- for (const a of o)
2151
- s = Math.min(s, a.from - (a.leadIn ?? 0)), n = Math.max(n, a.to + (a.leadOut ?? 0));
2152
- s = e(s), n = e(n);
2153
- const i = Math.min(t.max, Math.max(t.min, n - s)), r = (s + n) / 2;
2199
+ function co(s, t, e = (n) => n) {
2200
+ if (s.length === 0) return null;
2201
+ let n = 1 / 0, o = -1 / 0;
2202
+ for (const a of s)
2203
+ n = Math.min(n, a.from - (a.leadIn ?? 0)), o = Math.max(o, a.to + (a.leadOut ?? 0));
2204
+ n = e(n), o = e(o);
2205
+ const i = Math.min(t.max, Math.max(t.min, o - n)), r = (n + o) / 2;
2154
2206
  return [r - i / 2, r + i / 2];
2155
2207
  }
2156
- const De = {
2208
+ const Oe = {
2157
2209
  width: 0,
2158
2210
  height: 0,
2159
- laneHeight: pt,
2211
+ laneHeight: gt,
2160
2212
  scrollY: 0,
2161
2213
  headers: [],
2162
2214
  days: [],
2163
2215
  ticks: [],
2164
- step: Bt,
2216
+ step: xt,
2165
2217
  ghost: null,
2166
2218
  grips: [],
2167
2219
  cursor: "default",
@@ -2171,10 +2223,10 @@ const De = {
2171
2223
  spoken: null,
2172
2224
  summary: { lanes: 0, subtasks: 0, from: 0, to: 0, overlaps: 0, violated: 0, blocked: 0 }
2173
2225
  };
2174
- class ao {
2226
+ class uo {
2175
2227
  constructor(t = {}) {
2176
- f(this, "data", new An(() => this.viewChanged()));
2177
- f(this, "view", new Ys(this.data));
2228
+ f(this, "data", new Fs(() => this.viewChanged()));
2229
+ f(this, "view", new Wn(this.data));
2178
2230
  f(this, "gestures");
2179
2231
  f(this, "keys");
2180
2232
  f(this, "handlersNow", {});
@@ -2208,7 +2260,7 @@ class ao {
2208
2260
  f(this, "frame", 0);
2209
2261
  f(this, "domainFrame", 0);
2210
2262
  f(this, "unsubscribeTheme", null);
2211
- f(this, "snapshot", De);
2263
+ f(this, "snapshot", Oe);
2212
2264
  f(this, "listeners", /* @__PURE__ */ new Set());
2213
2265
  /* ---------------------------------------------------------------- */
2214
2266
  /* Registration and options */
@@ -2237,7 +2289,7 @@ class ao {
2237
2289
  /** Folds or unfolds one group. */
2238
2290
  f(this, "toggleGroup", (t) => {
2239
2291
  const e = this.viewNow.folded ?? [];
2240
- this.actedOn = !0, this.folded = e.includes(t) ? e.filter((s) => s !== t) : [...e, t], this.viewChanged();
2292
+ this.actedOn = !0, this.folded = e.includes(t) ? e.filter((n) => n !== t) : [...e, t], this.viewChanged();
2241
2293
  });
2242
2294
  f(this, "foldAll", () => {
2243
2295
  this.actedOn = !0, this.folded = this.data.groups.map((t) => t.id), this.viewChanged();
@@ -2249,7 +2301,7 @@ class ao {
2249
2301
  this.listeners.delete(t);
2250
2302
  }));
2251
2303
  f(this, "getSnapshot", () => this.snapshot);
2252
- f(this, "getServerSnapshot", () => De);
2304
+ f(this, "getServerSnapshot", () => Oe);
2253
2305
  /* ---------------------------------------------------------------- */
2254
2306
  /* Gestures, as the component hands them in */
2255
2307
  /* ---------------------------------------------------------------- */
@@ -2267,25 +2319,25 @@ class ao {
2267
2319
  f(this, "key", (t) => this.keys.key(t));
2268
2320
  f(this, "focus", (t) => this.keys.focus(t));
2269
2321
  f(this, "blur", () => this.keys.blur());
2270
- this.folded = t.folded ?? [], this.domainInView = t.domain ?? null, this.domainInView !== null && this.view.showWall(this.domainInView), this.viewNow = this.currentView(), this.gestures = new Zn({
2322
+ this.folded = t.folded ?? [], this.domainInView = t.domain ?? null, this.domainInView !== null && this.view.showWall(this.domainInView), this.viewNow = this.currentView(), this.gestures = new no({
2271
2323
  data: this.data,
2272
2324
  view: this.view,
2273
2325
  plotElement: () => this.plot,
2274
2326
  handlers: () => this.handlersNow,
2275
2327
  selectedSubtask: () => this.selected,
2276
- select: (e, s) => this.select(e, s),
2328
+ select: (e, n) => this.select(e, n),
2277
2329
  viewChanged: () => this.viewChanged(),
2278
2330
  viewMoved: (e) => {
2279
2331
  this.viewChanged(), e && this.reportDomain();
2280
2332
  },
2281
2333
  interactionChanged: () => this.interactionChanged()
2282
- }), this.keys = new oo({
2334
+ }), this.keys = new lo({
2283
2335
  data: this.data,
2284
2336
  view: this.view,
2285
2337
  gestures: this.gestures,
2286
2338
  handlers: () => this.handlersNow,
2287
2339
  visibleDomain: () => this.visibleDomain(),
2288
- select: (e, s) => this.select(e, s),
2340
+ select: (e, n) => this.select(e, n),
2289
2341
  viewMoved: (e) => {
2290
2342
  this.viewChanged(), e && this.reportDomain();
2291
2343
  },
@@ -2307,17 +2359,17 @@ class ao {
2307
2359
  }
2308
2360
  /** Goes to a view handed in; what it leaves out goes back to its default. */
2309
2361
  applyView(t) {
2310
- Q(t) !== Q(this.viewNow) && (this.actedOn = !0, this.folded = t.folded ?? [], this.setDomain(t.domain ?? null));
2362
+ tt(t) !== tt(this.viewNow) && (this.actedOn = !0, this.folded = t.folded ?? [], this.setDomain(t.domain ?? null));
2311
2363
  }
2312
2364
  currentView() {
2313
- return io(
2365
+ return ho(
2314
2366
  { ...this.domainInView === null ? {} : { domain: this.domainInView }, ...this.folded.length > 0 ? { folded: this.folded } : {} },
2315
2367
  new Set(this.data.groups.map((t) => t.id))
2316
2368
  );
2317
2369
  }
2318
2370
  publishView() {
2319
2371
  const t = this.currentView();
2320
- if (Q(t) !== Q(this.viewNow)) {
2372
+ if (tt(t) !== tt(this.viewNow)) {
2321
2373
  this.viewNow = t;
2322
2374
  for (const e of this.viewListeners) e();
2323
2375
  }
@@ -2325,13 +2377,13 @@ class ao {
2325
2377
  /** The subtasks' extent within the zoom limits, while the view names no
2326
2378
  span - and the local day of today while there is no work to show. */
2327
2379
  fit() {
2328
- const t = this.view.options.calendar, e = ro(this.data.subtasks, this.view.options.zoomLimits, (n) => H(n, t));
2380
+ const t = this.view.options.calendar, e = co(this.data.subtasks, this.view.options.zoomLimits, (o) => Y(o, t));
2329
2381
  if (e !== null) {
2330
2382
  this.view.domain = e, this.fitted = !0;
2331
2383
  return;
2332
2384
  }
2333
- const s = /* @__PURE__ */ new Date();
2334
- s.setHours(0, 0, 0, 0), this.view.showWall([s.getTime(), s.getTime() + U]);
2385
+ const n = /* @__PURE__ */ new Date();
2386
+ n.setHours(0, 0, 0, 0), this.view.showWall([n.getTime(), n.getTime() + X]);
2335
2387
  }
2336
2388
  /** `undefined`: the scene keeps the selection itself. */
2337
2389
  setControlledTask(t) {
@@ -2348,15 +2400,15 @@ class ao {
2348
2400
  return t !== void 0 && t.task === this.selectedTask ? t.id : null;
2349
2401
  }
2350
2402
  select(t, e) {
2351
- var n, i;
2352
- const s = t !== this.selectedTask || e !== this.selected;
2353
- this.selected = e, t !== this.selectedTask && this.controlledTask === void 0 && (this.ownTask = t), s && ((i = (n = this.handlersNow).onSelectedTaskChange) == null || i.call(n, t, e)), this.interactionChanged();
2403
+ var o, i;
2404
+ const n = t !== this.selectedTask || e !== this.selected;
2405
+ this.selected = e, t !== this.selectedTask && this.controlledTask === void 0 && (this.ownTask = t), n && ((i = (o = this.handlersNow).onSelectedTaskChange) == null || i.call(o, t, e)), this.interactionChanged();
2354
2406
  }
2355
2407
  /* ---------------------------------------------------------------- */
2356
2408
  /* DOM binding */
2357
2409
  /* ---------------------------------------------------------------- */
2358
- bind(t, e, s, n) {
2359
- this.root = t, this.plot = e, this.dataCanvas = s, this.overlayCanvas = n, this.unsubscribeTheme = fs(() => {
2410
+ bind(t, e, n, o) {
2411
+ this.root = t, this.plot = e, this.dataCanvas = n, this.overlayCanvas = o, this.unsubscribeTheme = kn(() => {
2360
2412
  this.colours = null, this.requestDraw();
2361
2413
  }), this.viewChanged();
2362
2414
  }
@@ -2365,8 +2417,8 @@ class ao {
2365
2417
  this.gestures.cancelEdit(), this.keys.stop(), (t = this.unsubscribeTheme) == null || t.call(this), this.unsubscribeTheme = null, this.frame !== 0 && cancelAnimationFrame(this.frame), this.domainFrame !== 0 && cancelAnimationFrame(this.domainFrame), this.frame = this.domainFrame = 0, this.root = this.plot = this.dataCanvas = this.overlayCanvas = null;
2366
2418
  }
2367
2419
  resize(t, e) {
2368
- const s = Math.max(0, Math.round(t)), n = Math.max(0, Math.round(e));
2369
- s === this.view.width && n === this.view.height || (this.view.width = s, this.view.height = n, this.viewChanged());
2420
+ const n = Math.max(0, Math.round(t)), o = Math.max(0, Math.round(e));
2421
+ n === this.view.width && o === this.view.height || (this.view.width = n, this.view.height = o, this.viewChanged());
2370
2422
  }
2371
2423
  /* ---------------------------------------------------------------- */
2372
2424
  /* Changes */
@@ -2378,8 +2430,8 @@ class ao {
2378
2430
  this.publish(), this.requestDraw();
2379
2431
  }
2380
2432
  publish() {
2381
- const t = this.view, e = this.selected !== null ? t.boxById.get(this.selected) : void 0, s = [];
2382
- e !== void 0 && !e.miniature && !this.gestures.editing && e.subtask.task === this.selectedTask && (t.options.intents.includes("leadIn") && s.push({ kind: "leadIn", x: e.outerFrom, y: e.y, height: e.height }), t.options.intents.includes("leadOut") && s.push({ kind: "leadOut", x: e.outerTo, y: e.y, height: e.height })), this.snapshot = {
2433
+ const t = this.view, e = this.selected !== null ? t.boxById.get(this.selected) : void 0, n = [];
2434
+ e !== void 0 && !e.miniature && !this.gestures.editing && e.subtask.task === this.selectedTask && (t.options.intents.includes("leadIn") && n.push({ kind: "leadIn", x: e.outerFrom, y: e.y, height: e.height }), t.options.intents.includes("leadOut") && n.push({ kind: "leadOut", x: e.outerTo, y: e.y, height: e.height })), this.snapshot = {
2383
2435
  width: t.width,
2384
2436
  height: t.height,
2385
2437
  laneHeight: t.options.laneHeight,
@@ -2387,7 +2439,7 @@ class ao {
2387
2439
  headers: this.headers(),
2388
2440
  ...t.bands(),
2389
2441
  ghost: this.gestures.ghostSummary(),
2390
- grips: s,
2442
+ grips: n,
2391
2443
  cursor: this.gestures.cursor,
2392
2444
  tooltip: this.tooltip(),
2393
2445
  now: t.nowX(),
@@ -2395,25 +2447,25 @@ class ao {
2395
2447
  spoken: this.keys.spoken,
2396
2448
  summary: this.summary()
2397
2449
  };
2398
- for (const n of this.listeners) n();
2450
+ for (const o of this.listeners) o();
2399
2451
  }
2400
2452
  /** One header per row, with what it says and where it sits. The scroll is
2401
2453
  not taken off here: the header column is moved as a whole, as it always
2402
2454
  was, so that a header and its row cannot drift apart by a rounding. */
2403
2455
  headers() {
2404
- const t = new Map(this.data.lanes.map((n) => [n.id, n.label])), e = new Map(this.data.groups.map((n) => [n.id, n.label])), s = new Set(this.folded);
2405
- return this.view.rows.rows.map((n) => ({
2406
- key: n.lane ?? n.group ?? "",
2407
- kind: n.kind,
2408
- lane: n.lane,
2409
- group: n.group,
2410
- label: (n.lane !== void 0 ? t.get(n.lane) : e.get(n.group ?? "")) ?? n.lane ?? n.group ?? "",
2411
- depth: n.depth,
2412
- within: n.within,
2413
- lanes: n.lanes,
2414
- collapsed: n.group === void 0 ? void 0 : s.has(n.group),
2415
- top: n.top,
2416
- height: n.height
2456
+ const t = new Map(this.data.lanes.map((o) => [o.id, o.label])), e = new Map(this.data.groups.map((o) => [o.id, o.label])), n = new Set(this.folded);
2457
+ return this.view.rows.rows.map((o) => ({
2458
+ key: o.lane ?? o.group ?? "",
2459
+ kind: o.kind,
2460
+ lane: o.lane,
2461
+ group: o.group,
2462
+ label: (o.lane !== void 0 ? t.get(o.lane) : e.get(o.group ?? "")) ?? o.lane ?? o.group ?? "",
2463
+ depth: o.depth,
2464
+ within: o.within,
2465
+ lanes: o.lanes,
2466
+ collapsed: o.group === void 0 ? void 0 : n.has(o.group),
2467
+ top: o.top,
2468
+ height: o.height
2417
2469
  }));
2418
2470
  }
2419
2471
  /** The bars a label could stand in: the visible part of every main time,
@@ -2423,27 +2475,27 @@ class ao {
2423
2475
  const t = this.view;
2424
2476
  if (t.width <= 0) return [];
2425
2477
  const e = this.colours;
2426
- return t.boxes.flatMap((s) => {
2427
- if (!Ft(s, t.width, t.height)) return [];
2428
- const n = Os(s, t.width);
2429
- if (n === null) return [];
2430
- const i = e === null ? !0 : Wt(
2431
- gt(s.subtask.appearance),
2432
- ht(e, { selectedTask: this.selectedTask, selectedSubtask: this.selectedSubtask }, s.subtask.task, s.subtask.id),
2478
+ return t.boxes.flatMap((n) => {
2479
+ if (!Et(n, t.width, t.height)) return [];
2480
+ const o = Pn(n, t.width);
2481
+ if (o === null) return [];
2482
+ const i = e === null ? !0 : Xt(
2483
+ yt(n.subtask.appearance),
2484
+ ct(e, { selectedTask: this.selectedTask, selectedSubtask: this.selectedSubtask }, n.subtask.task, n.subtask.id),
2433
2485
  e
2434
2486
  ).onDark;
2435
- return [{ subtask: s.subtask, ...n, dark: i }];
2487
+ return [{ subtask: n.subtask, ...o, dark: i }];
2436
2488
  });
2437
2489
  }
2438
2490
  /** The findings count the whole plan - an overlap out of view is still one
2439
2491
  to know of -, the subtasks only what is in view. */
2440
2492
  summary() {
2441
- const t = this.view, [e, s] = this.visibleDomain();
2493
+ const t = this.view, [e, n] = this.visibleDomain();
2442
2494
  return {
2443
2495
  lanes: this.data.lanes.length,
2444
- subtasks: t.boxes.filter((n) => Ft(n, t.width, t.height)).length,
2496
+ subtasks: t.boxes.filter((o) => Et(o, t.width, t.height)).length,
2445
2497
  from: e,
2446
- to: s,
2498
+ to: n,
2447
2499
  overlaps: this.data.overlaps.length,
2448
2500
  violated: this.data.violatedById.size,
2449
2501
  blocked: this.data.inBlocked.length
@@ -2454,12 +2506,12 @@ class ao {
2454
2506
  if (!this.gestures.idle) return null;
2455
2507
  const e = this.data.tooltipTargetFor(t);
2456
2508
  if (e === null) return null;
2457
- const { x: s, y: n } = this.gestures.hoverPoint;
2458
- return { target: e, x: s, y: n };
2509
+ const { x: n, y: o } = this.gestures.hoverPoint;
2510
+ return { target: e, x: n, y: o };
2459
2511
  }
2460
2512
  /** The visible span, as two wall-clock instants. */
2461
2513
  visibleDomain() {
2462
- const t = et(this.view.options.calendar), e = (s) => t.intervals.length === 0 ? s : j(Math.max(0, Math.min(t.total, s)), t);
2514
+ const t = nt(this.view.options.calendar), e = (n) => t.intervals.length === 0 ? n : j(Math.max(0, Math.min(t.total, n)), t);
2463
2515
  return [e(this.view.domain[0]), e(this.view.domain[1])];
2464
2516
  }
2465
2517
  /** A pan or zoom of the planner's goes into the view once per frame,
@@ -2474,19 +2526,19 @@ class ao {
2474
2526
  /** The time and the lane at a client point, or null outside the plot. */
2475
2527
  positionAt(t, e) {
2476
2528
  var r;
2477
- const s = (r = this.plot) == null ? void 0 : r.getBoundingClientRect();
2478
- if (s === void 0) return null;
2479
- const n = t - s.left, i = e - s.top;
2480
- return n < 0 || i < 0 || n > s.width || i > s.height ? null : { time: this.view.timeAt(n), lane: this.view.laneIdAt(i) };
2529
+ const n = (r = this.plot) == null ? void 0 : r.getBoundingClientRect();
2530
+ if (n === void 0) return null;
2531
+ const o = t - n.left, i = e - n.top;
2532
+ return o < 0 || i < 0 || o > n.width || i > n.height ? null : { time: this.view.timeAt(o), lane: this.view.laneIdAt(i) };
2481
2533
  }
2482
2534
  /** The client point of a time, on a lane's middle where one is named, or
2483
2535
  null while the schedule is not on screen. */
2484
2536
  clientPointOf(t, e) {
2485
2537
  var a;
2486
- const s = (a = this.plot) == null ? void 0 : a.getBoundingClientRect();
2487
- if (s === void 0) return null;
2488
- const n = this.view.viewport(), i = e === void 0 ? null : dt(n, e), r = i === null ? 0 : i.top + i.height / 2;
2489
- return { x: s.left + N(n, t), y: s.top + r };
2538
+ const n = (a = this.plot) == null ? void 0 : a.getBoundingClientRect();
2539
+ if (n === void 0) return null;
2540
+ const o = this.view.viewport(), i = e === void 0 ? null : J(o, e), r = i === null ? 0 : i.top + i.height / 2;
2541
+ return { x: n.left + R(o, t), y: n.top + r };
2490
2542
  }
2491
2543
  requestDraw() {
2492
2544
  this.frame !== 0 || this.dataCanvas === null || typeof requestAnimationFrame != "function" || (this.frame = requestAnimationFrame(() => {
@@ -2495,9 +2547,9 @@ class ao {
2495
2547
  }
2496
2548
  draw() {
2497
2549
  if (this.root === null) return;
2498
- this.colours === null && (this.colours = Fn(this.root, this.data), this.publish());
2499
- const { width: t, height: e } = this.view, s = be(this.dataCanvas, t, e), n = be(this.overlayCanvas, t, e);
2500
- if (s === null || n === null || t === 0) return;
2550
+ this.colours === null && (this.colours = Rs(this.root, this.data), this.publish());
2551
+ const { width: t, height: e } = this.view, n = Te(this.dataCanvas, t, e), o = Te(this.overlayCanvas, t, e);
2552
+ if (n === null || o === null || t === 0) return;
2501
2553
  const i = {
2502
2554
  data: this.data,
2503
2555
  view: this.view,
@@ -2508,49 +2560,50 @@ class ao {
2508
2560
  hover: this.gestures.hover,
2509
2561
  ghost: this.gestures.ghostDrawing()
2510
2562
  };
2511
- On(s, i), En(n, i);
2563
+ Ps(n, i), $s(o, i);
2512
2564
  }
2513
2565
  }
2514
- function yo(o = {}) {
2515
- const { initialView: t, onViewChange: e } = o, [s] = tt(() => new ao(t)), [n] = tt(() => new ps()), [i] = tt(() => {
2516
- const c = Ee((p, m) => ks(wn, { ...p, scene: s, ref: m }));
2566
+ function Mo(s = {}) {
2567
+ const { initialView: t, onViewChange: e } = s, [n] = et(() => new uo(t)), [o] = et(() => new yn()), [i] = et(() => {
2568
+ const c = Re((m, p) => bn(Ts, { ...m, scene: n, ref: p }));
2517
2569
  return c.displayName = "Schedule", {
2518
2570
  Schedule: c,
2519
- Lane: Mn,
2520
- LaneGroup: Tn,
2521
- Subtasks: In,
2522
- Dependencies: Sn,
2523
- BlockedTimes: Ln,
2524
- setDomain: s.setDomain,
2525
- toggleGroup: s.toggleGroup,
2526
- foldAll: s.foldAll,
2527
- unfoldAll: s.unfoldAll
2571
+ Lane: Ss,
2572
+ LaneGroup: Ls,
2573
+ Subtasks: As,
2574
+ Dependencies: Cs,
2575
+ BlockedTimes: Ds,
2576
+ Milestones: _s,
2577
+ setDomain: n.setDomain,
2578
+ toggleGroup: n.toggleGroup,
2579
+ foldAll: n.foldAll,
2580
+ unfoldAll: n.unfoldAll
2528
2581
  };
2529
- }), r = Re(s.subscribeView, s.getView, s.getView), a = t === void 0 ? null : Q(t), d = G(a);
2530
- it(() => {
2531
- if (t === void 0 || a === null || a === d.current) return;
2532
- d.current = a;
2533
- const c = n.has(a);
2534
- n.handed(a), c || s.applyView(t);
2582
+ }), r = Pe(n.subscribeView, n.getView, n.getView), a = t === void 0 ? null : tt(t), l = G(a);
2583
+ rt(() => {
2584
+ if (t === void 0 || a === null || a === l.current) return;
2585
+ l.current = a;
2586
+ const c = o.has(a);
2587
+ o.handed(a), c || n.applyView(t);
2535
2588
  }, [a]);
2536
- const h = Q(r), l = G(h);
2537
- return W(() => {
2538
- l.current !== h && (l.current = h, s.acted && (n.reported(h), e == null || e(r)));
2539
- }, [h]), X(() => ({ ...i, view: r }), [i, r]);
2589
+ const h = tt(r), d = G(h);
2590
+ return U(() => {
2591
+ d.current !== h && (d.current = h, n.acted && (o.reported(h), e == null || e(r)));
2592
+ }, [h]), V(() => ({ ...i, view: r }), [i, r]);
2540
2593
  }
2541
2594
  export {
2542
- ce as applyIntent,
2543
- Gt as arrival,
2544
- $t as departure,
2545
- mo as findings,
2546
- Ne as inBlockedTime,
2547
- nt as occupied,
2548
- Ht as overlaps,
2549
- gt as resolveAppearance,
2550
- go as ripple,
2551
- ko as shiftTask,
2552
- ws as snapTime,
2553
- po as subtaskFromPlace,
2554
- yo as useSchedule,
2555
- Yt as violatedDependencies
2595
+ fe as applyIntent,
2596
+ Yt as arrival,
2597
+ Gt as departure,
2598
+ vo as findings,
2599
+ $e as inBlockedTime,
2600
+ ot as occupied,
2601
+ zt as overlaps,
2602
+ yt as resolveAppearance,
2603
+ wo as ripple,
2604
+ bo as shiftTask,
2605
+ In as snapTime,
2606
+ yo as subtaskFromPlace,
2607
+ Mo as useSchedule,
2608
+ Kt as violatedDependencies
2556
2609
  };