@umriss-ui/schedule 0.2.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/schedule.js CHANGED
@@ -1,123 +1,123 @@
1
1
  import "./schedule.css";
2
- var Ze = Object.defineProperty;
3
- var Je = (o, t, e) => t in o ? Ze(o, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[t] = e;
4
- var f = (o, t, e) => Je(o, typeof t != "symbol" ? t + "" : t, e);
2
+ var es = Object.defineProperty;
3
+ var ss = (o, t, e) => t in o ? es(o, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[t] = e;
4
+ var f = (o, t, e) => ss(o, typeof t != "symbol" ? t + "" : t, e);
5
5
  import { jsxs as Y, Fragment as St, jsx as k } from "react/jsx-runtime";
6
- import { useContext as Ce, createContext as Le, useRef as O, useEffect as H, forwardRef as Qe, useState as rt, useId as ts, useLayoutEffect as Tt, useImperativeHandle as es, useSyncExternalStore as ss, useMemo as q } from "react";
7
- import { toOperatingTimeClamped as K, resolveColours as ns, removedIntervals as os, localOffset as Se, MINUTE as X, calendarFrom as V, toWallClock as W, DAY as ot, timeStep as is, operatingTimeTicks as rs, HOUR as Dt, LinearScale as as, subscribeTheme as ls } from "@umriss-ui/charts";
8
- import { useFormats as Et, useWording as ut, AngleGlyph as hs, VisuallyHidden as oe } from "@umriss-ui/core";
9
- const Ie = Le(null), Ae = Le(null);
10
- function _e() {
11
- return Ce(Ae);
12
- }
13
- function us(o) {
14
- const t = Ce(Ie);
6
+ import { useContext as Se, createContext as Ae, useRef as $, useEffect as H, forwardRef as ns, useState as ht, useId as os, useLayoutEffect as It, useImperativeHandle as is, useSyncExternalStore as rs, useMemo as X } from "react";
7
+ import { toWorkingTimeClamped as K, resolveColours as as, removedIntervals as ls, localOffset as _e, MINUTE as W, calendarFrom as q, toWallClock as z, DAY as rt, timeStep as hs, workingTimeTicks as ds, HOUR as Et, LinearScale as us, subscribeTheme as cs } from "@umriss-ui/charts";
8
+ import { useFormats as Rt, useWording as ft, AngleGlyph as fs, VisuallyHidden as ae } from "@umriss-ui/core";
9
+ const De = Ae(null), Fe = Ae(null);
10
+ function Oe() {
11
+ return Se(Fe);
12
+ }
13
+ function ps(o) {
14
+ const t = Se(De);
15
15
  if (t === null)
16
16
  throw new Error(`@umriss-ui/schedule: <${o}> must be used inside a <Schedule>.`);
17
17
  return t;
18
18
  }
19
19
  function Pt(o, t, e, s, n) {
20
- const i = us(o), r = O(null);
20
+ const i = ps(o), r = $(null);
21
21
  H(() => (r.current = e(i, t), () => {
22
22
  r.current !== null && n(i, r.current), r.current = null;
23
23
  }), [i]), H(() => {
24
24
  r.current !== null && s(i, r.current, t);
25
25
  });
26
26
  }
27
- function cs(o) {
27
+ function ms(o) {
28
28
  Pt("Lane", o, (t, e) => t.registerLane(e), (t, e, s) => t.updateLane(e, s), (t, e) => t.unregisterLane(e));
29
29
  }
30
- function ds(o) {
30
+ function gs(o) {
31
31
  Pt("LaneGroup", o, (t, e) => t.registerGroup(e), (t, e, s) => t.updateGroup(e, s), (t, e) => t.unregisterGroup(e));
32
32
  }
33
- function Fe(o, t) {
33
+ function Bt(o, t) {
34
34
  Pt(o, t, (e, s) => e.registerLayer(s), (e, s, n) => e.updateLayer(s, n), (e, s) => e.unregisterLayer(s));
35
35
  }
36
- function ct(o) {
36
+ function pt(o) {
37
37
  let t = !1, e = !1, s = !1, n = !1;
38
38
  for (const i of o ?? [])
39
39
  i === "provisional" ? (t = !0, e = !1) : i === "fixed" ? (e = !0, t = !1) : i === "muted" ? s = !0 : i === "open" && (n = !0);
40
40
  return { dashed: t, hatched: e, muted: s, open: n };
41
41
  }
42
- const fs = 24, ps = 4, ms = 3, Ct = 4;
43
- function ie(o) {
44
- const { lanes: t, groups: e, collapsed: s, laneHeight: n } = o, i = new Map(e.map((m) => [m.id, m])), r = (m) => m !== void 0 && i.has(m) ? m : void 0, a = /* @__PURE__ */ new Map(), h = (m) => {
45
- const C = [];
46
- let L = r(m.parent);
47
- const D = /* @__PURE__ */ new Set();
48
- for (; L !== void 0 && !D.has(L); )
49
- D.add(L), C.unshift(L), L = r(i.get(L).parent);
50
- return C;
51
- }, c = /* @__PURE__ */ new Map();
52
- for (const m of t) {
53
- const C = h(m);
54
- c.set(m.id, C);
55
- for (const L of C) {
56
- const D = a.get(L) ?? [];
57
- D.push(m.id), a.set(L, D);
42
+ const ks = 24, ys = 4, vs = 3, Ct = 4;
43
+ function le(o) {
44
+ 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(), h = (g) => {
45
+ const I = [];
46
+ let L = r(g.parent);
47
+ const F = /* @__PURE__ */ new Set();
48
+ for (; L !== void 0 && !F.has(L); )
49
+ F.add(L), I.unshift(L), L = r(i.get(L).parent);
50
+ return I;
51
+ }, d = /* @__PURE__ */ new Map();
52
+ for (const g of t) {
53
+ const I = h(g);
54
+ d.set(g.id, I);
55
+ for (const L of I) {
56
+ const F = a.get(L) ?? [];
57
+ F.push(g.id), a.set(L, F);
58
58
  }
59
59
  }
60
- const l = [], d = /* @__PURE__ */ new Map();
61
- let p = [], w = null, v = 0;
62
- const A = (m) => (l.push({ ...m, top: v }), v += m.height, l.length - 1), _ = (m) => m.find((C) => s.has(C)), S = () => {
63
- if (w === null) return;
64
- const { row: m, lanes: C } = w, L = l[m], D = Math.max(L.height, C.length * ps + 2 * Ct);
65
- l[m] = { ...L, height: D }, v += D - L.height;
66
- const F = D - 2 * Ct, G = Math.max(ms, Math.floor(F / C.length));
67
- C.forEach((J, it) => {
68
- const z = c.get(J) ?? [];
69
- d.set(J, {
70
- top: L.top + Ct + it * G,
71
- height: G,
60
+ const l = [], c = /* @__PURE__ */ new Map();
61
+ let p = [], m = null, y = 0;
62
+ const C = (g) => (l.push({ ...g, top: y }), y += g.height, l.length - 1), S = (g) => g.find((I) => s.has(I)), A = () => {
63
+ if (m === null) return;
64
+ const { row: g, lanes: I } = m, L = l[g], F = Math.max(L.height, I.length * ys + 2 * Ct);
65
+ l[g] = { ...L, height: F }, y += F - L.height;
66
+ const D = F - 2 * Ct, N = Math.max(vs, Math.floor(D / I.length));
67
+ I.forEach((Q, lt) => {
68
+ const V = d.get(Q) ?? [];
69
+ c.set(Q, {
70
+ top: L.top + Ct + lt * N,
71
+ height: N,
72
72
  miniature: !0,
73
- group: z[z.length - 1]
73
+ group: V[V.length - 1]
74
74
  });
75
- }), w = null;
75
+ }), m = null;
76
76
  };
77
- for (const m of t) {
78
- const C = (c.get(m.id) ?? []).filter((F) => (a.get(F) ?? []).length > 0), L = _(C);
79
- if (w !== null && L === w.group) {
80
- w.lanes.push(m.id);
77
+ for (const g of t) {
78
+ const I = (d.get(g.id) ?? []).filter((D) => (a.get(D) ?? []).length > 0), L = S(I);
79
+ if (m !== null && L === m.group) {
80
+ m.lanes.push(g.id);
81
81
  continue;
82
82
  }
83
- S();
84
- const D = C.filter((F, G) => p[G] === F).length;
85
- p = p.slice(0, D);
86
- for (const F of C.slice(D)) {
87
- if (p.push(F), F === L) break;
88
- A({
83
+ A();
84
+ const F = I.filter((D, N) => p[N] === D).length;
85
+ p = p.slice(0, F);
86
+ for (const D of I.slice(F)) {
87
+ if (p.push(D), D === L) break;
88
+ C({
89
89
  kind: "groupHead",
90
90
  lane: void 0,
91
- group: F,
91
+ group: D,
92
92
  depth: p.length - 1,
93
93
  within: [...p],
94
- lanes: (a.get(F) ?? []).length,
95
- height: fs
94
+ lanes: (a.get(D) ?? []).length,
95
+ height: ks
96
96
  });
97
97
  }
98
98
  if (L !== void 0) {
99
- const F = C.indexOf(L), G = A({
99
+ const D = I.indexOf(L), N = C({
100
100
  kind: "miniature",
101
101
  lane: void 0,
102
102
  group: L,
103
- depth: F,
104
- within: C.slice(0, F + 1),
103
+ depth: D,
104
+ within: I.slice(0, D + 1),
105
105
  lanes: (a.get(L) ?? []).length,
106
106
  height: n
107
107
  });
108
- w = { group: L, row: G, lanes: [m.id] };
108
+ m = { group: L, row: N, lanes: [g.id] };
109
109
  continue;
110
110
  }
111
- A({ kind: "lane", lane: m.id, group: C[C.length - 1], depth: C.length, within: C, lanes: 1, height: n }), d.set(m.id, {
111
+ C({ kind: "lane", lane: g.id, group: I[I.length - 1], depth: I.length, within: I, lanes: 1, height: n }), c.set(g.id, {
112
112
  top: l[l.length - 1].top,
113
113
  height: n,
114
114
  miniature: !1,
115
- group: C[C.length - 1]
115
+ group: I[I.length - 1]
116
116
  });
117
117
  }
118
- return S(), { rows: l, slots: d, height: v };
118
+ return A(), { rows: l, slots: c, height: y };
119
119
  }
120
- function gs(o, t) {
120
+ function ws(o, t) {
121
121
  if (t.size === 0) return o;
122
122
  const e = /* @__PURE__ */ new Set();
123
123
  for (const s of o) t.has(s) || e.add(s);
@@ -134,10 +134,10 @@ function Z(o, t) {
134
134
  }
135
135
  return null;
136
136
  }
137
- function Rt(o, t) {
137
+ function Nt(o, t) {
138
138
  return o.slots.get(t) ?? null;
139
139
  }
140
- function ks(o, t) {
140
+ function bs(o, t) {
141
141
  const e = Z(o, t);
142
142
  if (e === null) return null;
143
143
  if (e.kind === "lane") return e.lane ?? null;
@@ -146,121 +146,121 @@ function ks(o, t) {
146
146
  if (n.miniature && t >= n.top && t < n.top + n.height) return s;
147
147
  return null;
148
148
  }
149
- function dt(o) {
150
- return { from: o.from - (o.setup ?? 0), to: o.to + (o.teardown ?? 0) };
149
+ function J(o) {
150
+ return { from: o.from - (o.leadIn ?? 0), to: o.to + (o.leadOut ?? 0) };
151
151
  }
152
152
  function xt(o, t) {
153
- return (o.leaves ?? "teardown") === "main" ? t.to : t.to + (t.teardown ?? 0);
153
+ return (o.leaves ?? "leadOut") === "main" ? t.to : t.to + (t.leadOut ?? 0);
154
154
  }
155
- function Nt(o, t) {
156
- return (o.arrives ?? "setup") === "main" ? t.from : t.from - (t.setup ?? 0);
155
+ function Gt(o, t) {
156
+ return (o.arrives ?? "leadIn") === "main" ? t.from : t.from - (t.leadIn ?? 0);
157
157
  }
158
- function re(o, t) {
158
+ function he(o, t) {
159
159
  if (t.kind === "place" || t.subtask !== o.id) return o;
160
160
  switch (t.kind) {
161
161
  case "move":
162
162
  case "stretch":
163
163
  return { ...o, from: t.from, to: t.to };
164
- case "setup":
165
- return { ...o, setup: t.setup };
166
- case "teardown":
167
- return { ...o, teardown: t.teardown };
164
+ case "leadIn":
165
+ return { ...o, leadIn: t.leadIn };
166
+ case "leadOut":
167
+ return { ...o, leadOut: t.leadOut };
168
168
  case "lane":
169
169
  return { ...o, lane: t.lane };
170
170
  }
171
171
  }
172
- function Vn(o, t) {
172
+ function Qn(o, t) {
173
173
  return {
174
174
  id: t,
175
175
  task: o.task,
176
176
  lane: o.lane,
177
177
  from: o.from,
178
178
  to: o.to,
179
- ...o.setup === void 0 ? {} : { setup: o.setup },
180
- ...o.teardown === void 0 ? {} : { teardown: o.teardown }
179
+ ...o.leadIn === void 0 ? {} : { leadIn: o.leadIn },
180
+ ...o.leadOut === void 0 ? {} : { leadOut: o.leadOut }
181
181
  };
182
182
  }
183
- const ws = 6, De = 3, nt = 2, ae = 3, le = 3;
184
- function R(o, t) {
183
+ const Ms = 6, Ee = 3, ot = 2, de = 3, ue = 3;
184
+ function E(o, t) {
185
185
  return Math.round(o.scale.toPx(K(t, o.calendar)));
186
186
  }
187
- function ft(o, t) {
188
- const e = Rt(o.rows, t);
187
+ function at(o, t) {
188
+ const e = Nt(o.rows, t);
189
189
  return e === null ? null : { ...e, top: e.top - o.scrollY };
190
190
  }
191
- function he(o, t) {
192
- return ks(o.rows, t + o.scrollY);
191
+ function ce(o, t) {
192
+ return bs(o.rows, t + o.scrollY);
193
193
  }
194
- function Ee(o, t, e, s, n) {
195
- const i = s.miniature ? 0 : ws, r = s.miniature ? 0 : le * ae, a = Math.max(s.miniature ? 1 : 4, s.height - 2 * i - r), h = s.top - o.scrollY + Math.floor((s.height - a) / 2), c = dt(t);
194
+ function Re(o, t, e, s, n) {
195
+ const i = s.miniature ? 0 : Ms, r = s.miniature ? 0 : ue * de, a = Math.max(s.miniature ? 1 : 4, s.height - 2 * i - r), h = s.top - o.scrollY + Math.floor((s.height - a) / 2), d = J(t);
196
196
  return {
197
197
  subtask: t,
198
198
  lane: e,
199
199
  miniature: s.miniature,
200
200
  depth: n,
201
- y: h + (s.miniature ? 0 : Math.min(n, le) * ae),
201
+ y: h + (s.miniature ? 0 : Math.min(n, ue) * de),
202
202
  height: a,
203
- outerFrom: R(o, c.from),
204
- mainFrom: R(o, t.from),
205
- mainTo: R(o, t.to),
206
- outerTo: R(o, c.to)
203
+ outerFrom: E(o, d.from),
204
+ mainFrom: E(o, t.from),
205
+ mainTo: E(o, t.to),
206
+ outerTo: E(o, d.to)
207
207
  };
208
208
  }
209
209
  function Pe(o, t, e) {
210
210
  if (e < o.y || e > o.y + o.height) return null;
211
211
  const s = Math.max(0, (6 - (o.outerTo - o.outerFrom)) / 2);
212
- return t < o.outerFrom - s || t > o.outerTo + s ? null : t < o.mainFrom ? "setup" : t > o.mainTo ? "teardown" : "main";
212
+ return t < o.outerFrom - s || t > o.outerTo + s ? null : t < o.mainFrom ? "leadIn" : t > o.mainTo ? "leadOut" : "main";
213
213
  }
214
- function ys(o, t, e, s = 5) {
214
+ function Ts(o, t, e, s = 5) {
215
215
  if (e < o.y || e > o.y + o.height) return null;
216
216
  const n = Math.abs(t - o.mainFrom), i = Math.abs(t - o.mainTo);
217
217
  return Math.min(n, i) > s ? null : n <= i ? "from" : "to";
218
218
  }
219
- function It(o, t, e) {
219
+ function At(o, t, e) {
220
220
  return o.outerTo >= 0 && o.outerFrom <= t && o.y + o.height >= 0 && o.y <= e;
221
221
  }
222
- const vs = 64;
223
- function bs(o, t) {
222
+ const Is = 64;
223
+ function Cs(o, t) {
224
224
  if (o.miniature) return null;
225
- const e = ct(o.subtask.appearance).hatched ? nt + De + 1 : 0, s = Math.max(o.mainFrom + e, 0), n = Math.min(o.mainTo - e, t) - s;
226
- return n < vs ? null : { x: s, width: n, y: o.y, height: o.height };
225
+ const e = pt(o.subtask.appearance).hatched ? ot + Ee + 1 : 0, s = Math.max(o.mainFrom + e, 0), n = Math.min(o.mainTo - e, t) - s;
226
+ return n < Is ? null : { x: s, width: n, y: o.y, height: o.height };
227
227
  }
228
- const Ms = 10;
229
- function ue(o, t, e) {
228
+ const Ls = 10;
229
+ function fe(o, t, e) {
230
230
  const s = Math.round(t.y + t.height / 2);
231
231
  return o === "centre" || e.y === t.y ? s : Math.round(e.y > t.y ? t.y + t.height - 1 : t.y + 1);
232
232
  }
233
- function At(o, t, e, s, n) {
234
- const i = t.route ?? n.route, r = t.attach ?? n.attach, a = t.ends ?? n.ends, h = R(o, xt(t, e.subtask)), c = R(o, Nt(t, s.subtask)), l = ue(r, e, s), d = ue(r, s, e);
233
+ function _t(o, t, e, s, n) {
234
+ const i = t.route ?? n.route, r = t.attach ?? n.attach, a = t.ends ?? n.ends, h = E(o, xt(t, e.subtask)), d = E(o, Gt(t, s.subtask)), l = fe(r, e, s), c = fe(r, s, e);
235
235
  if (i === "straight")
236
- return { transport: t, kind: i, ends: a, x1: h, y1: l, x2: c, y2: d, c1x: h, c2x: c, points: [h, l, c, d] };
236
+ return { dependency: t, kind: i, ends: a, x1: h, y1: l, x2: d, y2: c, c1x: h, c2x: d, points: [h, l, d, c] };
237
237
  if (i === "orthogonal") {
238
- const _ = h + Ms, S = l === d ? _ : Math.round((_ + c) / 2);
239
- return { transport: t, kind: i, ends: a, x1: h, y1: l, x2: c, y2: d, c1x: h, c2x: c, points: l === d ? [h, l, c, d] : [h, l, S, l, S, d, c, d] };
240
- }
241
- const p = Math.max(14, Math.abs(c - h) / 2), w = h + p, v = c - p, A = [];
242
- for (let _ = 0; _ <= 16; _++) {
243
- const S = _ / 16, m = 1 - S;
244
- A.push(
245
- m * m * m * h + 3 * m * m * S * w + 3 * m * S * S * v + S * S * S * c,
246
- m * m * m * l + 3 * m * m * S * l + 3 * m * S * S * d + S * S * S * d
238
+ const S = h + Ls, A = l === c ? S : Math.round((S + d) / 2);
239
+ return { dependency: t, kind: i, ends: a, x1: h, y1: l, x2: d, y2: c, c1x: h, c2x: d, points: l === c ? [h, l, d, c] : [h, l, A, l, A, c, d, c] };
240
+ }
241
+ const p = Math.max(14, Math.abs(d - h) / 2), m = h + p, y = d - p, C = [];
242
+ for (let S = 0; S <= 16; S++) {
243
+ const A = S / 16, g = 1 - A;
244
+ C.push(
245
+ g * g * g * h + 3 * g * g * A * m + 3 * g * A * A * y + A * A * A * d,
246
+ g * g * g * l + 3 * g * g * A * l + 3 * g * A * A * c + A * A * A * c
247
247
  );
248
248
  }
249
- return { transport: t, kind: "curve", ends: a, x1: h, y1: l, x2: c, y2: d, c1x: w, c2x: v, points: A };
249
+ return { dependency: t, kind: "curve", ends: a, x1: h, y1: l, x2: d, y2: c, c1x: m, c2x: y, points: C };
250
250
  }
251
- function Ts(o, t, e) {
251
+ function Ss(o, t, e) {
252
252
  let s = 1 / 0;
253
253
  const n = o.points;
254
254
  for (let i = 0; i + 3 < n.length; i += 2) {
255
- const r = n[i], a = n[i + 1], h = n[i + 2], c = n[i + 3], l = h - r, d = c - a, p = l * l + d * d, w = p === 0 ? 0 : Math.max(0, Math.min(1, ((t - r) * l + (e - a) * d) / p));
256
- s = Math.min(s, Math.hypot(t - (r + w * l), e - (a + w * d)));
255
+ const r = n[i], a = n[i + 1], h = n[i + 2], d = n[i + 3], l = h - r, c = d - a, p = l * l + c * c, m = p === 0 ? 0 : Math.max(0, Math.min(1, ((t - r) * l + (e - a) * c) / p));
256
+ s = Math.min(s, Math.hypot(t - (r + m * l), e - (a + m * c)));
257
257
  }
258
258
  return s;
259
259
  }
260
- function Gt(o) {
260
+ function $t(o) {
261
261
  const t = [], e = /* @__PURE__ */ new Map();
262
262
  o.forEach((s, n) => {
263
- const { from: i, to: r } = dt(s);
263
+ const { from: i, to: r } = J(s);
264
264
  if (!(i < r)) return;
265
265
  const a = e.get(s.lane) ?? [];
266
266
  a.push({ subtask: s, index: n, from: i, to: r }), e.set(s.lane, a);
@@ -278,10 +278,10 @@ function Gt(o) {
278
278
  }
279
279
  return t;
280
280
  }
281
- function Cs(o) {
281
+ function As(o) {
282
282
  const t = /* @__PURE__ */ new Map(), e = /* @__PURE__ */ new Map();
283
283
  for (const s of o) {
284
- const n = dt(s), i = e.get(s.lane) ?? [];
284
+ const n = J(s), i = e.get(s.lane) ?? [];
285
285
  let r = 0;
286
286
  if (n.from < n.to) {
287
287
  for (const a of i) n.from < a.to && a.from < n.to && r++;
@@ -291,20 +291,33 @@ function Cs(o) {
291
291
  }
292
292
  return t;
293
293
  }
294
- function $t(o, t) {
294
+ function Ht(o, t) {
295
295
  const e = new Map(o.map((n) => [n.id, n])), s = [];
296
296
  for (const n of t) {
297
297
  const i = e.get(n.from), r = e.get(n.to);
298
298
  if (i === void 0 || r === void 0) continue;
299
- const a = xt(n, i), h = Nt(n, r), c = a + n.duration - h;
300
- c > 0 && s.push({ transport: n.id, departure: a, arrival: h, shortBy: c });
299
+ const a = xt(n, i), h = Gt(n, r), d = a + n.lag - h;
300
+ d > 0 && s.push({ dependency: n.id, departure: a, arrival: h, shortBy: d });
301
301
  }
302
302
  return s;
303
303
  }
304
- function Zn(o, t) {
305
- return { overlaps: Gt(o), lateTransports: $t(o, t) };
304
+ function Be(o, t) {
305
+ const e = [];
306
+ for (const s of o) {
307
+ const n = J(s);
308
+ for (const i of t)
309
+ 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) });
310
+ }
311
+ return e;
312
+ }
313
+ function to(o, t, e = []) {
314
+ return {
315
+ overlaps: $t(o),
316
+ violatedDependencies: Ht(o, t),
317
+ inBlockedTime: Be(o, e)
318
+ };
306
319
  }
307
- class Ls {
320
+ class _s {
308
321
  /** `changed` is called after every registration change. */
309
322
  constructor(t) {
310
323
  f(this, "nextId", 1);
@@ -320,11 +333,14 @@ class Ls {
320
333
  f(this, "layers", []);
321
334
  f(this, "subtasks", []);
322
335
  f(this, "subtaskById", /* @__PURE__ */ new Map());
323
- f(this, "transports", []);
336
+ f(this, "dependencies", []);
337
+ /** Every blocked time, whichever layer declared it. */
338
+ f(this, "blocked", []);
324
339
  f(this, "tasks", /* @__PURE__ */ new Map());
325
340
  f(this, "overlaps", []);
326
- f(this, "lateById", /* @__PURE__ */ new Map());
341
+ f(this, "violatedById", /* @__PURE__ */ new Map());
327
342
  f(this, "depth", /* @__PURE__ */ new Map());
343
+ f(this, "inBlocked", []);
328
344
  this.changed = t;
329
345
  }
330
346
  registerLane(t) {
@@ -366,40 +382,39 @@ class Ls {
366
382
  if (!this.dirty) return !1;
367
383
  this.dirty = !1;
368
384
  const t = (e) => [...e.keys()].sort((s, n) => s - n).map((s) => e.get(s));
369
- 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.transports = [], this.tasks = /* @__PURE__ */ new Map();
385
+ 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();
370
386
  for (const e of this.layers)
371
387
  if (e.kind === "subtasks") {
372
388
  this.subtasks.push(...e.data);
373
389
  for (const s of e.tasks) this.tasks.set(s.id, s);
374
- } else
375
- this.transports.push(...e.data);
376
- return this.subtaskById = new Map(this.subtasks.map((e) => [e.id, e])), this.overlaps = Gt(this.subtasks), this.lateById = new Map($t(this.subtasks, this.transports).map((e) => [e.transport, e])), this.depth = Cs(this.subtasks), !0;
390
+ } else e.kind === "dependencies" ? this.dependencies.push(...e.data) : this.blocked.push(...e.data);
391
+ return this.subtaskById = new Map(this.subtasks.map((e) => [e.id, e])), this.overlaps = $t(this.subtasks), this.violatedById = new Map(Ht(this.subtasks, this.dependencies).map((e) => [e.dependency, e])), this.depth = As(this.subtasks), this.inBlocked = Be(this.subtasks, this.blocked), !0;
377
392
  }
378
- /** The task a transport belongs to: its departing subtask's. */
379
- taskOfTransport(t) {
393
+ /** The task a dependency belongs to: its departing subtask's. */
394
+ taskOfDependency(t) {
380
395
  var e;
381
396
  return ((e = this.subtaskById.get(t.from)) == null ? void 0 : e.task) ?? null;
382
397
  }
383
- /** What a tooltip is about: the hovered subtask or transport with what this
398
+ /** What a tooltip is about: the hovered subtask or dependency with what this
384
399
  data knows about it - its task, and the findings it stands in. */
385
400
  tooltipTargetFor(t) {
386
401
  if (t.kind === "subtask") {
387
- const n = t.subtask.id, i = this.overlaps.filter((a) => a.first === n || a.second === n).map((a) => this.subtaskById.get(a.first === n ? a.second : a.first)).filter((a) => a !== void 0), r = this.transports.filter((a) => a.from === n || a.to === n).map((a) => this.lateById.get(a.id)).filter((a) => a !== void 0);
388
- return { kind: "subtask", subtask: t.subtask, task: this.tasks.get(t.subtask.task), overlapping: i, lateTransports: r };
402
+ const n = t.subtask.id, i = this.overlaps.filter((h) => h.first === n || h.second === n).map((h) => this.subtaskById.get(h.first === n ? h.second : h.first)).filter((h) => h !== void 0), r = this.dependencies.filter((h) => h.from === n || h.to === n).map((h) => this.violatedById.get(h.id)).filter((h) => h !== void 0), a = this.inBlocked.filter((h) => h.subtask === n).map((h) => this.blocked.find((d) => d.id === h.blocked)).filter((h) => h !== void 0);
403
+ return { kind: "subtask", subtask: t.subtask, task: this.tasks.get(t.subtask.task), overlapping: i, violatedDependencies: r, blocked: a };
389
404
  }
390
- if (t.kind !== "transport") return null;
391
- const e = t.transport, s = this.taskOfTransport(e);
405
+ if (t.kind !== "dependency") return null;
406
+ const e = t.dependency, s = this.taskOfDependency(e);
392
407
  return {
393
- kind: "transport",
394
- transport: e,
408
+ kind: "dependency",
409
+ dependency: e,
395
410
  task: s !== null ? this.tasks.get(s) : void 0,
396
411
  from: this.subtaskById.get(e.from),
397
412
  to: this.subtaskById.get(e.to),
398
- late: this.lateById.get(e.id)
413
+ violated: this.violatedById.get(e.id)
399
414
  };
400
415
  }
401
416
  }
402
- const Ss = {
417
+ const Ds = {
403
418
  line: "var(--u-hairline)",
404
419
  lineStrong: "var(--u-hairline-strong)",
405
420
  text: "var(--u-color-text)",
@@ -413,7 +428,7 @@ const Ss = {
413
428
  /* What text and marks take ON a filled bar - the same token the bar labels
414
429
  use in CSS, so a cap and the label beside it are one colour. */
415
430
  onAccent: "var(--u-color-on-accent)"
416
- }, Re = {
431
+ }, Ne = {
417
432
  line: "GrayText",
418
433
  lineStrong: "CanvasText",
419
434
  text: "CanvasText",
@@ -423,11 +438,11 @@ const Ss = {
423
438
  active: "Highlight",
424
439
  now: "GrayText",
425
440
  onAccent: "Canvas"
426
- }, Is = (o) => o ? Re : Ss, As = () => typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(forced-colors: active)").matches;
427
- function _s(o, t) {
428
- const e = As(), s = {};
429
- for (const r of t.tasks.values()) s[`task:${r.id}`] = e ? Re.text : r.color;
430
- const n = ns(o, { ...Is(e), ...s }), i = /* @__PURE__ */ new Map();
441
+ }, Fs = (o) => o ? Ne : Ds, Os = () => typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(forced-colors: active)").matches;
442
+ function Es(o, t) {
443
+ const e = Os(), s = {};
444
+ for (const r of t.tasks.values()) s[`task:${r.id}`] = e ? Ne.text : r.color;
445
+ const n = as(o, { ...Fs(e), ...s }), i = /* @__PURE__ */ new Map();
431
446
  for (const r of t.tasks.values()) i.set(r.id, n[`task:${r.id}`] ?? r.color);
432
447
  return {
433
448
  line: n.line,
@@ -443,12 +458,12 @@ function _s(o, t) {
443
458
  forced: e
444
459
  };
445
460
  }
446
- function lt(o) {
461
+ function ut(o) {
447
462
  const t = o.match(/[\d.]+/g);
448
463
  return t === null || t.length < 3 ? null : [Number(t[0]), Number(t[1]), Number(t[2])];
449
464
  }
450
- function ce(o) {
451
- const t = lt(o);
465
+ function pe(o) {
466
+ const t = ut(o);
452
467
  if (t === null) return 0;
453
468
  const [e, s, n] = t.map((i) => {
454
469
  const r = i / 255;
@@ -456,109 +471,113 @@ function ce(o) {
456
471
  });
457
472
  return 0.2126 * e + 0.7152 * s + 0.0722 * n;
458
473
  }
459
- function de(o, t) {
460
- const e = ce(o), s = ce(t);
474
+ function me(o, t) {
475
+ const e = pe(o), s = pe(t);
461
476
  return (Math.max(e, s) + 0.05) / (Math.min(e, s) + 0.05);
462
477
  }
463
- function fe(o, t, e) {
478
+ function ge(o, t, e) {
464
479
  if (o === null) return null;
465
480
  const s = typeof window > "u" ? 1 : window.devicePixelRatio || 1, n = Math.round(t * s), i = Math.round(e * s);
466
481
  o.width !== n && (o.width = n), o.height !== i && (o.height = i);
467
482
  const r = o.getContext("2d");
468
483
  return r === null ? null : (r.setTransform(s, 0, 0, s, 0, 0), r.clearRect(0, 0, t, e), r);
469
484
  }
470
- function Fs(o, t) {
485
+ function Rs(o, t) {
471
486
  const { data: e, view: s } = t, n = s.viewport();
472
- Rs(o, t, n), xs(o, t);
487
+ xs(o, t, n);
488
+ for (const i of e.blocked) Ws(o, t, n, i);
489
+ Gs(o, t);
473
490
  for (const i of e.layers) {
491
+ if (i.kind === "blocked") continue;
474
492
  const r = new Set(i.data);
475
- if (i.kind === "transports")
476
- for (const a of s.paths) r.has(a.transport) && _t(o, t, a, !1);
493
+ if (i.kind === "dependencies")
494
+ for (const a of s.paths) r.has(a.dependency) && Dt(o, t, a, !1);
477
495
  else
478
- for (const a of s.boxes) r.has(a.subtask) && Ne(o, t, a, 1);
496
+ for (const a of s.boxes) r.has(a.subtask) && Ge(o, t, a, 1);
479
497
  }
480
- for (const i of e.overlaps) Ge(o, t, n, i);
481
- Ks(o, t, n), Ws(o, t);
498
+ for (const i of e.overlaps) Ot(o, t, n, i);
499
+ for (const i of e.inBlocked) Ot(o, t, n, i);
500
+ Xs(o, t, n), js(o, t);
482
501
  }
483
- function Ds(o, t) {
502
+ function Ps(o, t) {
484
503
  const { view: e, hover: s } = t, n = e.viewport();
485
504
  if (t.ghost === null) {
486
505
  if (s.kind === "subtask") {
487
506
  const l = e.boxById.get(s.subtask.id);
488
- l !== void 0 && Us(o, t, l);
489
- } else if (s.kind === "transport") {
490
- const l = e.paths.find((d) => d.transport === s.transport);
491
- l !== void 0 && _t(o, t, l, !0);
507
+ l !== void 0 && zs(o, t, l);
508
+ } else if (s.kind === "dependency") {
509
+ const l = e.paths.find((c) => c.dependency === s.dependency);
510
+ l !== void 0 && Dt(o, t, l, !0);
492
511
  }
493
512
  return;
494
513
  }
495
- const { ghost: i, overlaps: r, late: a } = t.ghost;
496
- Es(o, t, n, t.ghost.refusedLanes);
514
+ const { ghost: i, overlaps: r, violated: a } = t.ghost;
515
+ Bs(o, t, n, t.ghost.refusedLanes);
497
516
  const h = xe(n, i);
498
517
  if (h === null) return;
499
- for (const l of r) Ge(o, t, n, l);
500
- const c = new Set(a.map((l) => l.transport));
501
- for (const l of t.data.transports) {
518
+ for (const l of r) Ot(o, t, n, l);
519
+ const d = new Set(a.map((l) => l.dependency));
520
+ for (const l of t.data.dependencies) {
502
521
  if (l.from !== i.id && l.to !== i.id) continue;
503
- const d = e.boxById.get(l.from === i.id ? l.to : l.from);
504
- if (d === void 0) continue;
505
- const p = l.from === i.id ? At(n, l, h, d, e.options) : At(n, l, d, h, e.options);
506
- _t(o, t, p, !0, c.has(l.id));
522
+ const c = e.boxById.get(l.from === i.id ? l.to : l.from);
523
+ if (c === void 0) continue;
524
+ const p = l.from === i.id ? _t(n, l, h, c, e.options) : _t(n, l, c, h, e.options);
525
+ Dt(o, t, p, !0, d.has(l.id));
507
526
  }
508
- Ne(o, t, 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([]), t.ghost.tether !== null && Ps(o, t, h, t.ghost.tether);
527
+ Ge(o, t, 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([]), t.ghost.tether !== null && Ns(o, t, h, t.ghost.tether);
509
528
  }
510
- function Es(o, t, e, s) {
529
+ function Bs(o, t, e, s) {
511
530
  if (s.size === 0) return;
512
531
  const { width: n, height: i } = t.view;
513
532
  for (const r of s) {
514
- const a = ft(e, r);
533
+ const a = at(e, r);
515
534
  if (a === null) continue;
516
- const { top: h, height: c } = a;
517
- h + c < 0 || h > i || (o.globalAlpha = 0.6, o.fillStyle = t.colours.surface, o.fillRect(0, h, n, c), o.globalAlpha = 1, Hs(o, 0, h, n, c, t.colours.muted, 0.7, Bs, 1));
535
+ const { top: h, height: d } = a;
536
+ h + d < 0 || h > i || (o.globalAlpha = 0.6, o.fillStyle = t.colours.surface, o.fillRect(0, h, n, d), o.globalAlpha = 1, He(o, 0, h, n, d, t.colours.muted, 0.7, $e, 1));
518
537
  }
519
538
  }
520
- function Ps(o, t, e, s) {
539
+ function Ns(o, t, e, s) {
521
540
  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));
522
541
  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([]));
523
542
  }
524
543
  function xe(o, t) {
525
- const e = Rt(o.rows, t.lane);
526
- return e === null ? null : Ee(o, t, t.lane, e, 0);
544
+ const e = Nt(o.rows, t.lane);
545
+ return e === null ? null : Re(o, t, t.lane, e, 0);
527
546
  }
528
- function Rs(o, t, e) {
547
+ function xs(o, t, e) {
529
548
  const { view: s, colours: n, bands: i } = t, { width: r, height: a } = s;
530
549
  o.lineWidth = 1, o.strokeStyle = n.line, o.beginPath();
531
550
  for (const l of i.ticks)
532
551
  o.moveTo(l.x + 0.5, 0), o.lineTo(l.x + 0.5, a);
533
552
  for (const l of e.rows.rows) {
534
- const d = l.top + l.height - e.scrollY - 0.5;
535
- d < 0 || d > a || (o.moveTo(0, d), o.lineTo(r, d));
553
+ const c = l.top + l.height - e.scrollY - 0.5;
554
+ c < 0 || c > a || (o.moveTo(0, c), o.lineTo(r, c));
536
555
  }
537
- const h = [...e.rows.slots.values()].filter((l) => l.miniature).sort((l, d) => l.top - d.top);
538
- h.forEach((l, d) => {
539
- const p = h[d + 1];
556
+ const h = [...e.rows.slots.values()].filter((l) => l.miniature).sort((l, c) => l.top - c.top);
557
+ h.forEach((l, c) => {
558
+ const p = h[c + 1];
540
559
  if (p === void 0 || p.top !== l.top + l.height || p.group === l.group) return;
541
- const w = l.top + l.height - e.scrollY - 0.5;
542
- w < 0 || w > a || (o.moveTo(0, w), o.lineTo(r, w));
560
+ const m = l.top + l.height - e.scrollY - 0.5;
561
+ m < 0 || m > a || (o.moveTo(0, m), o.lineTo(r, m));
543
562
  }), o.stroke(), o.strokeStyle = n.lineStrong, o.beginPath();
544
563
  for (const l of i.days)
545
564
  o.moveTo(l.x + 0.5, 0), o.lineTo(l.x + 0.5, a);
546
565
  o.stroke();
547
- const c = os(s.options.calendar);
548
- if (c.length > 0) {
566
+ const d = ls(s.options.calendar);
567
+ if (d.length > 0) {
549
568
  o.strokeStyle = n.muted, o.setLineDash([2, 3]), o.beginPath();
550
- for (const l of c) {
551
- const d = Math.round(e.scale.toPx(l.operatingTime)) + 0.5;
552
- d < 0 || d > r || (o.moveTo(d, 0), o.lineTo(d, a));
569
+ for (const l of d) {
570
+ const c = Math.round(e.scale.toPx(l.workingTime)) + 0.5;
571
+ c < 0 || c > r || (o.moveTo(c, 0), o.lineTo(c, a));
553
572
  }
554
573
  o.stroke(), o.setLineDash([]);
555
574
  }
556
575
  }
557
- function xs(o, t) {
576
+ function Gs(o, t) {
558
577
  const e = t.view.nowX();
559
578
  e !== null && (o.fillStyle = t.colours.now, o.fillRect(e, 0, 2, t.view.height));
560
579
  }
561
- function Ns(o, t, e, s) {
580
+ function $s(o, t, e, s) {
562
581
  const n = t.colours.tasks.get(e.subtask.task) ?? t.colours.muted;
563
582
  o.fillStyle = n;
564
583
  for (const [i, r] of [
@@ -568,88 +587,88 @@ function Ns(o, t, e, s) {
568
587
  r <= i || (o.globalAlpha = 0.28 * s, o.fillRect(i, e.y, r - i, e.height));
569
588
  o.globalAlpha = s, o.fillRect(e.mainFrom, e.y, Math.max(1, e.mainTo - e.mainFrom), e.height), o.globalAlpha = 1;
570
589
  }
571
- function Bt(o, t, e) {
590
+ function Yt(o, t, e) {
572
591
  if (o.dashed) return { fill: null, onDark: !1 };
573
- const s = o.muted ? Gs(t, e.surface, 0.5) : t;
574
- return { fill: s, onDark: de(s, e.onAccent) > de(s, e.text) };
592
+ const s = o.muted ? Hs(t, e.surface, 0.5) : t;
593
+ return { fill: s, onDark: me(s, e.onAccent) > me(s, e.text) };
575
594
  }
576
- function Gs(o, t, e) {
577
- const s = lt(o), n = lt(t);
595
+ function Hs(o, t, e) {
596
+ const s = ut(o), n = ut(t);
578
597
  if (s === null || n === null) return o;
579
598
  const i = (r) => Math.round(s[r] + (n[r] - s[r]) * e);
580
599
  return `rgb(${i(0)}, ${i(1)}, ${i(2)})`;
581
600
  }
582
- const $s = 2;
583
- function Ne(o, t, e, s) {
601
+ const Ys = 2;
602
+ function Ge(o, t, e, s) {
584
603
  const { view: n, colours: i } = t;
585
- if (!It(e, n.width, n.height)) return;
604
+ if (!At(e, n.width, n.height)) return;
586
605
  if (e.miniature) {
587
- Ns(o, t, e, s);
606
+ $s(o, t, e, s);
588
607
  return;
589
608
  }
590
- const r = ct(e.subtask.appearance), a = i.tasks.get(e.subtask.task) ?? i.muted, h = Bt(r, a, i), c = e.y, l = e.height, d = Math.max(1, e.mainTo - e.mainFrom), p = h.onDark ? i.onAccent : i.text;
609
+ const r = pt(e.subtask.appearance), a = i.tasks.get(e.subtask.task) ?? i.muted, h = Yt(r, a, i), d = e.y, l = e.height, c = Math.max(1, e.mainTo - e.mainFrom), p = h.onDark ? i.onAccent : i.text;
591
610
  o.lineWidth = 1, o.fillStyle = a, o.strokeStyle = a;
592
- for (const [v, A] of [
611
+ for (const [y, C] of [
593
612
  [e.outerFrom, e.mainFrom],
594
613
  [e.mainTo, e.outerTo]
595
614
  ])
596
- A <= v || (o.globalAlpha = 0.28 * s, o.fillRect(v, c, A - v, l), o.globalAlpha = s, o.strokeRect(v + 0.5, c + 0.5, A - v - 1, l - 1));
597
- h.fill !== null && (o.globalAlpha = s, o.fillStyle = h.fill, o.fillRect(e.mainFrom, c, d, l));
598
- const w = e.subtask.progress;
599
- if (w !== void 0) {
600
- const v = Math.min(4, Math.max(2, Math.round(l / 6))), A = c + l - v - $s, _ = Math.round(d * Math.max(0, Math.min(1, w)));
601
- o.fillStyle = h.fill === null ? a : p, o.globalAlpha = 0.3 * s, o.fillRect(e.mainFrom, A, d, v), o.globalAlpha = s, _ > 0 && o.fillRect(e.mainFrom, A, _, v);
615
+ C <= y || (o.globalAlpha = 0.28 * s, o.fillRect(y, d, C - y, l), o.globalAlpha = s, o.strokeRect(y + 0.5, d + 0.5, C - y - 1, l - 1));
616
+ h.fill !== null && (o.globalAlpha = s, o.fillStyle = h.fill, o.fillRect(e.mainFrom, d, c, l));
617
+ const m = e.subtask.progress;
618
+ if (m !== void 0) {
619
+ const y = Math.min(4, Math.max(2, Math.round(l / 6))), C = d + l - y - Ys, S = Math.round(c * Math.max(0, Math.min(1, m)));
620
+ o.fillStyle = h.fill === null ? a : p, o.globalAlpha = 0.3 * s, o.fillRect(e.mainFrom, C, c, y), o.globalAlpha = s, S > 0 && o.fillRect(e.mainFrom, C, S, y);
602
621
  }
603
622
  if (r.hatched) {
604
- const v = Math.max(1, Math.min(De, Math.floor((d - 2 * nt) / 3))), A = d >= 4 * v ? nt : 0, _ = l >= 4 * nt ? nt : 0;
605
- o.globalAlpha = s, o.fillStyle = p, o.fillRect(e.mainFrom + A, c + _, v, l - 2 * _), o.fillRect(e.mainTo - A - v, c + _, v, l - 2 * _);
623
+ const y = Math.max(1, Math.min(Ee, Math.floor((c - 2 * ot) / 3))), C = c >= 4 * y ? ot : 0, S = l >= 4 * ot ? ot : 0;
624
+ o.globalAlpha = s, o.fillStyle = p, o.fillRect(e.mainFrom + C, d + S, y, l - 2 * S), o.fillRect(e.mainTo - C - y, d + S, y, l - 2 * S);
606
625
  }
607
- r.open && Ys(o, e, c, l, i.surface, n.width), r.dashed && (o.globalAlpha = s, o.strokeStyle = a, o.setLineDash([4, 3]), o.strokeRect(e.mainFrom + 0.5, c + 0.5, d - 1, l - 1), o.setLineDash([])), o.globalAlpha = 1, e.depth > 0 && s === 1 && (o.strokeStyle = i.surface, o.strokeRect(e.outerFrom - 0.5, c - 0.5, e.outerTo - e.outerFrom + 1, l + 1));
626
+ r.open && Us(o, e, d, l, i.surface, n.width), r.dashed && (o.globalAlpha = s, o.strokeStyle = a, o.setLineDash([4, 3]), o.strokeRect(e.mainFrom + 0.5, d + 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, d - 0.5, e.outerTo - e.outerFrom + 1, l + 1));
608
627
  }
609
- const Bs = 6, Os = 16;
610
- function Hs(o, t, e, s, n, i, r, a, h) {
628
+ const $e = 6, Ks = 16;
629
+ function He(o, t, e, s, n, i, r, a, h) {
611
630
  o.save(), o.beginPath(), o.rect(t, e, s, n), o.clip(), o.globalAlpha = 0.5 * r, o.strokeStyle = i, o.lineWidth = h, o.beginPath();
612
- for (let c = t - n; c < t + s + n; c += a)
613
- o.moveTo(c, e + n), o.lineTo(c + n, e);
631
+ for (let d = t - n; d < t + s + n; d += a)
632
+ o.moveTo(d, e + n), o.lineTo(d + n, e);
614
633
  o.stroke(), o.restore();
615
634
  }
616
- function Ys(o, t, e, s, n, i) {
617
- const r = t.mainFrom < 0, a = t.mainTo > i, h = Math.max(1, Math.min(t.mainTo, i) - Math.max(t.mainFrom, 0)), c = Math.min(Os, h);
618
- r && pe(o, 0, c, e, s, n, 1), a && pe(o, i, -c, e, s, n, 1);
635
+ function Us(o, t, e, s, n, i) {
636
+ const r = t.mainFrom < 0, a = t.mainTo > i, h = Math.max(1, Math.min(t.mainTo, i) - Math.max(t.mainFrom, 0)), d = Math.min(Ks, h);
637
+ r && ke(o, 0, d, e, s, n, 1), a && ke(o, i, -d, e, s, n, 1);
619
638
  }
620
- function pe(o, t, e, s, n, i, r) {
639
+ function ke(o, t, e, s, n, i, r) {
621
640
  const a = o.createLinearGradient(t, 0, t + e, 0);
622
- a.addColorStop(0, me(i, r)), a.addColorStop(1, me(i, 0)), o.globalAlpha = 1, o.fillStyle = a, o.fillRect(Math.min(t, t + e), s, Math.abs(e), n);
641
+ a.addColorStop(0, ye(i, r)), a.addColorStop(1, ye(i, 0)), o.globalAlpha = 1, o.fillStyle = a, o.fillRect(Math.min(t, t + e), s, Math.abs(e), n);
623
642
  }
624
- function me(o, t) {
625
- const e = lt(o);
643
+ function ye(o, t) {
644
+ const e = ut(o);
626
645
  return e === null ? o : `rgba(${e[0]}, ${e[1]}, ${e[2]}, ${t})`;
627
646
  }
628
- function _t(o, t, e, s, n) {
629
- const { data: i, colours: r } = t, a = i.taskOfTransport(e.transport), h = n ?? i.lateById.has(e.transport.id), c = a !== null && a === t.selectedTask, l = h ? r.alarm : (a !== null ? r.tasks.get(a) : void 0) ?? r.muted;
630
- if (o.strokeStyle = l, o.fillStyle = l, o.lineWidth = s || c ? 2 : 1.25, o.setLineDash(h ? [4, 3] : []), o.beginPath(), o.moveTo(e.x1, e.y1), e.kind === "curve")
647
+ function Dt(o, t, e, s, n) {
648
+ const { data: i, colours: r } = t, a = i.taskOfDependency(e.dependency), h = n ?? i.violatedById.has(e.dependency.id), d = a !== null && a === t.selectedTask, l = h ? r.alarm : (a !== null ? r.tasks.get(a) : void 0) ?? r.muted;
649
+ if (o.strokeStyle = l, o.fillStyle = l, o.lineWidth = s || d ? 2 : 1.25, o.setLineDash(h ? [4, 3] : []), o.beginPath(), o.moveTo(e.x1, e.y1), e.kind === "curve")
631
650
  o.bezierCurveTo(e.c1x, e.y1, e.c2x, e.y2, e.x2, e.y2);
632
651
  else
633
- for (let d = 2; d + 1 < e.points.length; d += 2) o.lineTo(e.points[d], e.points[d + 1]);
652
+ for (let c = 2; c + 1 < e.points.length; c += 2) o.lineTo(e.points[c], e.points[c + 1]);
634
653
  if (o.stroke(), o.setLineDash([]), e.ends === "dot")
635
- for (const [d, p] of [
654
+ for (const [c, p] of [
636
655
  [e.x1, e.y1],
637
656
  [e.x2, e.y2]
638
657
  ])
639
- o.beginPath(), o.arc(d, p, h ? 3 : 2.5, 0, Math.PI * 2), o.fill();
658
+ o.beginPath(), o.arc(c, p, h ? 3 : 2.5, 0, Math.PI * 2), o.fill();
640
659
  }
641
- function Ks(o, t, e) {
660
+ function Xs(o, t, e) {
642
661
  const { data: s } = t;
643
- if (s.lateById.size !== 0)
644
- for (const n of s.lateById.values()) {
645
- const i = s.transports.find((d) => d.id === n.transport), r = i === void 0 ? void 0 : s.subtaskById.get(i.to);
662
+ if (s.violatedById.size !== 0)
663
+ for (const n of s.violatedById.values()) {
664
+ const i = s.dependencies.find((c) => c.id === n.dependency), r = i === void 0 ? void 0 : s.subtaskById.get(i.to);
646
665
  if (r === void 0) continue;
647
- const a = ft(e, r.lane);
666
+ const a = at(e, r.lane);
648
667
  if (a === null || !a.miniature) continue;
649
668
  const h = Z(e.rows, a.top + e.scrollY);
650
669
  if (h === null) continue;
651
- const c = R(e, n.arrival), l = Math.max(c + 2, R(e, n.arrival + n.shortBy));
652
- Ft(o, t, c, l, h.top - e.scrollY + 1, 3);
670
+ const d = E(e, n.arrival), l = Math.max(d + 2, E(e, n.arrival + n.shortBy));
671
+ Ft(o, t, d, l, h.top - e.scrollY + 1, 3);
653
672
  }
654
673
  }
655
674
  function Ft(o, t, e, s, n, i) {
@@ -659,25 +678,31 @@ function Ft(o, t, e, s, n, i) {
659
678
  }
660
679
  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([]);
661
680
  }
662
- function Ge(o, t, e, s) {
663
- const n = ft(e, s.lane);
681
+ function Ws(o, t, e, s) {
682
+ const n = at(e, s.lane);
683
+ if (n === null || n.top + n.height < 0 || n.top > t.view.height) return;
684
+ const i = Math.max(0, E(e, s.from)), r = Math.min(t.view.width, E(e, s.to));
685
+ r <= i || (o.globalAlpha = 0.1, o.fillStyle = t.colours.muted, o.fillRect(i, n.top, r - i, n.height), o.globalAlpha = 1, He(o, i, n.top, r - i, n.height, t.colours.muted, 0.7, $e, 1));
686
+ }
687
+ function Ot(o, t, e, s) {
688
+ const n = at(e, s.lane);
664
689
  if (n === null) return;
665
- const i = R(e, s.from), r = Math.max(i + 2, R(e, s.to));
690
+ const i = E(e, s.from), r = Math.max(i + 2, E(e, s.to));
666
691
  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, Ft(o, t, i, r, n.top + 1, Math.min(3, Math.max(1, n.height - 1))), n.miniature) {
667
692
  const a = Z(e.rows, n.top + e.scrollY);
668
693
  a !== null && Ft(o, t, i, r, a.top - e.scrollY + 1, 3);
669
694
  }
670
695
  }
671
- function Us(o, t, e) {
672
- const { colours: s } = t, n = ct(e.subtask.appearance), i = Bt(n, s.tasks.get(e.subtask.task) ?? s.muted, s);
696
+ function zs(o, t, e) {
697
+ const { colours: s } = t, n = pt(e.subtask.appearance), i = Yt(n, s.tasks.get(e.subtask.task) ?? s.muted, s);
673
698
  if (s.forced) {
674
699
  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);
675
700
  return;
676
701
  }
677
- o.globalAlpha = Xs, 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;
702
+ o.globalAlpha = Vs, 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;
678
703
  }
679
- const Xs = 0.2;
680
- function Ws(o, t) {
704
+ const Vs = 0.2;
705
+ function js(o, t) {
681
706
  const e = t.selectedTask;
682
707
  if (e !== null) {
683
708
  o.strokeStyle = t.colours.text;
@@ -690,42 +715,49 @@ function Ws(o, t) {
690
715
  }
691
716
  }
692
717
  }
693
- const at = 32, zs = 18;
694
- function ge(o, t) {
695
- if (!(t > 2 * at)) return 0;
696
- const e = at - o, s = o - (t - at), n = Math.max(e, s);
718
+ const dt = 32, qs = 18;
719
+ function ve(o, t) {
720
+ if (!(t > 2 * dt)) return 0;
721
+ const e = dt - o, s = o - (t - dt), n = Math.max(e, s);
697
722
  if (n <= 0) return 0;
698
- const i = Math.min(1, n / at), r = zs * i * i;
723
+ const i = Math.min(1, n / dt), r = qs * i * i;
699
724
  return e > 0 ? -r : r;
700
725
  }
701
- function js(o, t, e, s) {
726
+ function it(o, t, e) {
727
+ const s = (n, i) => {
728
+ const r = J(n);
729
+ return n.lane === i.lane && r.from < i.to && i.from < r.to;
730
+ };
731
+ return e.some((n) => s(o, n) && !(t !== null && s(t, n)));
732
+ }
733
+ function Zs(o, t, e, s) {
702
734
  const n = /* @__PURE__ */ new Set();
703
735
  if (s === void 0) return n;
704
736
  for (const i of o)
705
737
  i !== e && (s(t, i) || n.add(i));
706
738
  return n;
707
739
  }
708
- function qs(o, t) {
740
+ function Js(o, t) {
709
741
  const { step: e, offset: s } = typeof t == "number" ? { step: t, offset: 0 } : t;
710
742
  if (!(e > 0) || !Number.isFinite(o)) return o;
711
- const n = Se(o) + s;
743
+ const n = _e(o) + s;
712
744
  return n + Math.round((o - n) / e) * e;
713
745
  }
714
- const ke = "\0placing", we = /* @__PURE__ */ new Set();
746
+ const we = "\0placing", be = /* @__PURE__ */ new Set();
715
747
  function Lt(o) {
716
748
  switch (o.kind) {
717
749
  case "subtask":
718
750
  return `subtask:${o.subtask.id}:${o.part}`;
719
- case "transport":
720
- return `transport:${o.transport.id}`;
751
+ case "dependency":
752
+ return `dependency:${o.dependency.id}`;
721
753
  case "lane":
722
754
  return `lane:${o.lane}`;
723
755
  default:
724
756
  return "nothing";
725
757
  }
726
758
  }
727
- const ye = 3, Vs = 10, Zs = 600;
728
- class Js {
759
+ const Me = 3, Qs = 10, tn = 600;
760
+ class en {
729
761
  constructor(t) {
730
762
  f(this, "gesture", { kind: "none" });
731
763
  f(this, "touches", /* @__PURE__ */ new Map());
@@ -738,6 +770,9 @@ class Js {
738
770
  to. It is a fact about the pointer and not about the ghost, which stayed
739
771
  where it was allowed. */
740
772
  f(this, "refused", !1);
773
+ /** Whether the pointer last stood where the dragged work would cover blocked
774
+ time - as `refused`, a fact about the pointer and not about the ghost. */
775
+ f(this, "blocked", !1);
741
776
  /** Where the pointer stands on the plot while a drag is in flight - what the
742
777
  tether is drawn to, since the ghost is not following it. */
743
778
  f(this, "dragPoint", { x: 0, y: 0 });
@@ -772,12 +807,12 @@ class Js {
772
807
  return {
773
808
  ghost: t.ghost,
774
809
  overlaps: e.overlaps,
775
- late: e.late,
810
+ violated: e.violated,
776
811
  refusedLanes: t.refused,
777
812
  /* The tether is drawn only while the pointer really stands on a refused
778
813
  lane: the marked lanes say where the work may not go, the tether says
779
814
  that the ghost is held on purpose right now. */
780
- tether: this.refused ? this.dragPoint : null
815
+ tether: this.refused || this.blocked ? this.dragPoint : null
781
816
  };
782
817
  }
783
818
  ghostSummary() {
@@ -785,17 +820,18 @@ class Js {
785
820
  if (t.kind !== "edit" && t.kind !== "place") return null;
786
821
  const e = xe(this.host.view.viewport(), t.ghost);
787
822
  if (e === null) return null;
788
- const s = this.ghostFindings(t.ghost, this.ghostHome(t)), n = t.kind === "edit" && (t.mode === "setup" || t.mode === "teardown"), i = n ? dt(t.ghost) : t.ghost;
823
+ const s = this.ghostFindings(t.ghost, this.ghostHome(t)), n = t.kind === "edit" && (t.mode === "leadIn" || t.mode === "leadOut"), i = n ? J(t.ghost) : t.ghost;
789
824
  return {
790
825
  refused: this.refused,
791
826
  refusedLanes: [...t.refused],
827
+ blocked: this.blocked,
792
828
  x: n ? e.outerFrom : e.mainFrom,
793
829
  y: e.y,
794
830
  height: e.height,
795
831
  from: i.from,
796
832
  to: i.to,
797
833
  overlap: s.overlaps.length > 0,
798
- late: s.late.length > 0
834
+ violated: s.violated.length > 0
799
835
  };
800
836
  }
801
837
  /* ---------------------------------------------------------------- */
@@ -807,20 +843,20 @@ class Js {
807
843
  return { x: t - ((s == null ? void 0 : s.left) ?? 0), y: e - ((s == null ? void 0 : s.top) ?? 0) };
808
844
  }
809
845
  report(t, e, s, n, i, r) {
810
- var h, c;
846
+ var h, d;
811
847
  const a = this.host.view;
812
- (c = (h = this.host.handlers()).onInteraction) == null || c.call(h, { type: t, hit: e, clientX: s, clientY: n, time: a.timeAt(i), lane: a.laneIdAt(r) });
848
+ (d = (h = this.host.handlers()).onInteraction) == null || d.call(h, { type: t, hit: e, clientX: s, clientY: n, time: a.timeAt(i), lane: a.laneIdAt(r) });
813
849
  }
814
850
  pointerDown(t) {
815
- var a, h, c, l, d;
851
+ var a, h, d, l, c;
816
852
  const { x: e, y: s } = this.local(t.clientX, t.clientY);
817
853
  if (t.pointerType === "touch" && (this.touches.set(t.pointerId, { x: e, y: s }), this.touches.size >= 2)) {
818
854
  this.gesture.kind !== "pinch" && (this.cancelEdit(), this.gesture = { kind: "pinch", distance: this.touchDistance() });
819
855
  return;
820
856
  }
821
857
  if (t.button !== 0) return;
822
- const n = (c = (h = (a = t.target) == null ? void 0 : a.closest) == null ? void 0 : h.call(a, "[data-grip]")) == null ? void 0 : c.getAttribute("data-grip"), i = this.host.selectedSubtask(), r = i !== null ? this.host.data.subtaskById.get(i) ?? null : null;
823
- t.pointerType === "touch" ? this.gesture = { kind: "pending", pointerId: t.pointerId, x0: e, y0: s, mode: "pan", subtask: null } : (n === "setup" || n === "teardown") && 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) }, (d = (l = this.host.plotElement()) == null ? void 0 : l.setPointerCapture) == null || d.call(l, t.pointerId);
858
+ const n = (d = (h = (a = t.target) == null ? void 0 : a.closest) == null ? void 0 : h.call(a, "[data-grip]")) == null ? void 0 : d.getAttribute("data-grip"), i = this.host.selectedSubtask(), r = i !== null ? this.host.data.subtaskById.get(i) ?? null : null;
859
+ 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);
824
860
  }
825
861
  /** A drag over a folded group: resting on one opens it for the GESTURE.
826
862
 
@@ -836,7 +872,7 @@ class Js {
836
872
  group: s,
837
873
  timer: setTimeout(() => {
838
874
  this.resting = null, e.openForGesture = /* @__PURE__ */ new Set([...e.openForGesture, s]), this.host.viewChanged();
839
- }, Zs)
875
+ }, tn)
840
876
  }));
841
877
  }
842
878
  stopResting() {
@@ -865,9 +901,9 @@ class Js {
865
901
  gesture that cannot change a lane at all asks nothing: the intents the
866
902
  caller handles decide whether the question exists. */
867
903
  askRefused(t, e) {
868
- if (!this.host.view.options.intents.includes(e === null ? "place" : "lane")) return we;
904
+ if (!this.host.view.options.intents.includes(e === null ? "place" : "lane")) return be;
869
905
  const s = this.host.data.lanes.map((n) => n.id);
870
- return js(s, t, e, this.host.handlers().canMoveTo);
906
+ return Zs(s, t, e, this.host.handlers().canMoveTo);
871
907
  }
872
908
  /** What a press at a point would start, given the intents the caller handles. */
873
909
  modeAt(t, e) {
@@ -875,7 +911,7 @@ class Js {
875
911
  for (let i = s.boxes.length - 1; i >= 0; i--) {
876
912
  const r = s.boxes[i];
877
913
  if (n.includes("stretch")) {
878
- const a = ys(r, t, e);
914
+ const a = Ts(r, t, e);
879
915
  if (a !== null) return { mode: a === "from" ? "stretch-from" : "stretch-to", subtask: r.subtask };
880
916
  }
881
917
  if (Pe(r, t, e) !== null)
@@ -892,7 +928,7 @@ class Js {
892
928
  }
893
929
  const n = this.gesture;
894
930
  if (n.kind === "pending" && n.pointerId === t.pointerId) {
895
- if (Math.hypot(e - n.x0, s - n.y0) < (t.pointerType === "touch" ? Vs : ye)) return;
931
+ if (Math.hypot(e - n.x0, s - n.y0) < (t.pointerType === "touch" ? Qs : Me)) return;
896
932
  if (n.mode === "pan" || n.subtask === null)
897
933
  this.gesture = { kind: "pan", pointerId: n.pointerId, lastX: n.x0, lastY: n.y0 }, this.setCursor("grabbing");
898
934
  else {
@@ -906,7 +942,7 @@ class Js {
906
942
  ghost: n.subtask,
907
943
  /* Asked here, once, and drawn from the first frame of the drag: the
908
944
  lanes that are closed are marked before the pointer reaches one. */
909
- refused: n.mode === "move" ? this.askRefused(n.subtask, n.subtask.lane) : we
945
+ refused: n.mode === "move" ? this.askRefused(n.subtask, n.subtask.lane) : be
910
946
  }, this.setCursor(n.mode === "move" ? "grabbing" : "ew-resize");
911
947
  }
912
948
  }
@@ -917,7 +953,7 @@ class Js {
917
953
  return;
918
954
  }
919
955
  if (i.kind === "edit" && i.pointerId === t.pointerId) {
920
- this.lastClient = { x: t.clientX, y: t.clientY }, this.dragPoint = { x: e, y: s }, this.restOver(s), this.gesture = { ...i, ghost: this.ghostFor(i, e, s) }, this.setCursor(this.refused ? "not-allowed" : i.mode === "move" ? "grabbing" : "ew-resize"), this.host.interactionChanged(), this.autoPan();
956
+ 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();
921
957
  return;
922
958
  }
923
959
  i.kind === "none" && (this.byKeyboard = !1, this.hoverAt(t.clientX, t.clientY, e, s));
@@ -937,10 +973,10 @@ class Js {
937
973
  else if (e.kind === "edit" && e.pointerId === t.pointerId) {
938
974
  this.stopAutoPan(), this.closeGestureFolds(), this.gesture = { kind: "none" };
939
975
  const a = e.ghost.lane === e.subtask.lane || this.allowed(e.subtask, e.ghost.lane), h = this.intentsOf(e.subtask, e.ghost, e.mode).filter(
940
- (c) => a || c.kind !== "lane"
976
+ (d) => a || d.kind !== "lane"
941
977
  );
942
- this.refused = !1, this.cursor = "default", this.host.interactionChanged();
943
- for (const c of h) (r = (i = this.host.handlers()).onIntent) == null || r.call(i, c);
978
+ this.refused = !1, this.blocked = !1, this.cursor = "default", this.host.interactionChanged();
979
+ for (const d of h) (r = (i = this.host.handlers()).onIntent) == null || r.call(i, d);
944
980
  }
945
981
  }
946
982
  /** While a drag is in flight near an edge, pans along once per frame and
@@ -952,15 +988,15 @@ class Js {
952
988
  this.panFrame = 0;
953
989
  const e = this.gesture;
954
990
  if (e.kind !== "edit" && e.kind !== "place") return;
955
- const s = this.host.view, { x: n, y: i } = this.local(this.lastClient.x, this.lastClient.y), r = ge(n, s.width), a = ge(i, s.height);
991
+ const s = this.host.view, { x: n, y: i } = this.local(this.lastClient.x, this.lastClient.y), r = ve(n, s.width), a = ve(i, s.height);
956
992
  if (r === 0 && a === 0) return;
957
993
  const h = s.pan(r, a);
958
994
  if (h.moved) {
959
995
  if (this.dragPoint = { x: n, y: i }, e.kind === "edit")
960
- this.gesture = { ...e, ghost: this.ghostFor(e, n, i) };
996
+ this.gesture = { ...e, ghost: this.heldGhost(e, n, i) };
961
997
  else {
962
- const c = this.placeGhost(e.item, n, i, e.refused);
963
- this.refused = c.refused, this.gesture = { ...e, ghost: c.ghost ?? e.ghost };
998
+ const d = this.placeGhost(e.item, n, i, e.refused);
999
+ this.refused = d.refused, this.blocked = d.blocked, this.gesture = { ...e, ghost: d.ghost ?? e.ghost };
964
1000
  }
965
1001
  this.host.viewMoved(h.time), this.panFrame = requestAnimationFrame(t);
966
1002
  }
@@ -988,7 +1024,7 @@ class Js {
988
1024
  /** Escape while a drag is in flight: the ghost goes, and nothing is reported.
989
1025
  It ends a drag from outside as it ends one inside. */
990
1026
  cancelEdit() {
991
- return this.gesture.kind !== "edit" && this.gesture.kind !== "place" ? !1 : (this.stopAutoPan(), this.closeGestureFolds(), this.gesture = { kind: "none" }, this.refused = !1, this.cursor = "default", this.host.interactionChanged(), !0);
1027
+ return this.gesture.kind !== "edit" && this.gesture.kind !== "place" ? !1 : (this.stopAutoPan(), this.closeGestureFolds(), this.gesture = { kind: "none" }, this.refused = !1, this.blocked = !1, this.cursor = "default", this.host.interactionChanged(), !0);
992
1028
  }
993
1029
  contextMenu(t) {
994
1030
  if (this.host.handlers().onInteraction === void 0) return;
@@ -1004,14 +1040,14 @@ class Js {
1004
1040
  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;
1005
1041
  if (t.ctrlKey || t.metaKey) {
1006
1042
  t.preventDefault();
1007
- const c = Math.abs(r) < 50 ? 0.01 : 15e-4;
1008
- e.zoomAt(s, Math.exp(r * c)) && this.host.viewMoved(!0);
1043
+ const d = Math.abs(r) < 50 ? 0.01 : 15e-4;
1044
+ e.zoomAt(s, Math.exp(r * d)) && this.host.viewMoved(!0);
1009
1045
  return;
1010
1046
  }
1011
1047
  if (Math.abs(i) > Math.abs(r) || t.shiftKey) {
1012
1048
  t.preventDefault();
1013
- const c = e.pan(t.shiftKey && i === 0 ? r : i, 0);
1014
- c.moved && this.host.viewMoved(c.time);
1049
+ const d = e.pan(t.shiftKey && i === 0 ? r : i, 0);
1050
+ d.moved && this.host.viewMoved(d.time);
1015
1051
  return;
1016
1052
  }
1017
1053
  const a = r > 0 ? e.maxScroll() - e.scrollY : e.scrollY;
@@ -1021,13 +1057,13 @@ class Js {
1021
1057
  h.moved && this.host.viewMoved(h.time);
1022
1058
  }
1023
1059
  click(t, e, s, n) {
1024
- const i = this.host.view.hitAt(s, n), r = i.kind === "subtask" ? i.subtask.task : i.kind === "transport" ? this.host.data.taskOfTransport(i.transport) : null;
1060
+ 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;
1025
1061
  this.host.select(r, i.kind === "subtask" ? i.subtask.id : null), this.report("click", i, t, e, s, n);
1026
1062
  }
1027
1063
  hoverAt(t, e, s, n) {
1028
1064
  const i = this.host.view.hitAt(s, n), r = Lt(i), { mode: a } = this.modeAt(s, n);
1029
1065
  if (this.setCursor(a === "move" ? "grab" : a === "stretch-from" || a === "stretch-to" ? "ew-resize" : "default"), this.hoverPoint = { x: s, y: n }, r === this.hoverKey) {
1030
- (i.kind === "subtask" || i.kind === "transport") && this.host.interactionChanged();
1066
+ (i.kind === "subtask" || i.kind === "dependency") && this.host.interactionChanged();
1031
1067
  return;
1032
1068
  }
1033
1069
  this.setHover(i, r), this.report("hover", i, t, e, s, n);
@@ -1074,16 +1110,20 @@ class Js {
1074
1110
  is asked ABOUT a lane, and the one this item is on is none. */
1075
1111
  this.askRefused(this.askedFor(e, this.onLane(i) ?? "", n), null)
1076
1112
  ), a = this.placeGhost(e, n, i, r);
1077
- this.refused = a.refused, this.setCursor(a.refused ? "not-allowed" : "default");
1078
- const h = this.gesture.kind === "place" ? this.gesture.ghost : null, c = a.ghost ?? (a.refused ? h : null);
1079
- t.dataTransfer !== null && (t.dataTransfer.dropEffect = c === null ? "none" : "copy"), c !== null && (this.lastClient = { x: t.clientX, y: t.clientY }, this.dragPoint = { x: n, y: i }, this.gesture = { kind: "place", ghost: c, item: e, refused: r }, this.host.interactionChanged(), this.autoPan());
1113
+ this.refused = a.refused, this.blocked = a.blocked, this.setCursor(a.refused || a.blocked ? "not-allowed" : "default");
1114
+ const h = this.gesture.kind === "place" ? this.gesture.ghost : null, d = a.ghost ?? (a.refused || a.blocked ? h : null);
1115
+ t.dataTransfer !== null && (t.dataTransfer.dropEffect = d === null ? "none" : "copy"), d !== null && (this.lastClient = { x: t.clientX, y: t.clientY }, this.dragPoint = { x: n, y: i }, this.gesture = { kind: "place", ghost: d, item: e, refused: r }, this.host.interactionChanged(), this.autoPan());
1080
1116
  }
1081
1117
  /** The ghost of a drag from outside at a point on the plot: none off the
1082
- lanes, and none where the caller refuses that lane - which the answer
1083
- says apart, because the two mean different things to the drag. */
1118
+ lanes, none where the caller refuses that lane and none where it would
1119
+ cover blocked time - which the answer says apart, because they mean
1120
+ different things to the drag. */
1084
1121
  placeGhost(t, e, s, n) {
1085
1122
  const i = this.onLane(s);
1086
- return i === null ? { ghost: null, refused: !1 } : n.has(i) ? { ghost: null, refused: !0 } : { ghost: { ...this.askedFor(t, i, e), id: ke }, refused: !1 };
1123
+ if (i === null) return { ghost: null, refused: !1, blocked: !1 };
1124
+ if (n.has(i)) return { ghost: null, refused: !0, blocked: !1 };
1125
+ const r = { ...this.askedFor(t, i, e), id: we };
1126
+ return it(r, null, this.host.data.blocked) ? { ghost: null, refused: !1, blocked: !0 } : { ghost: r, refused: !1, blocked: !1 };
1087
1127
  }
1088
1128
  /** The dragged item as a subtask, under the caller's key for it - not the
1089
1129
  internal sentinel: the rule is asked about the thing the application says
@@ -1096,8 +1136,8 @@ class Js {
1096
1136
  lane: e,
1097
1137
  from: n,
1098
1138
  to: n + t.duration,
1099
- ...t.setup === void 0 ? {} : { setup: t.setup },
1100
- ...t.teardown === void 0 ? {} : { teardown: t.teardown }
1139
+ ...t.leadIn === void 0 ? {} : { leadIn: t.leadIn },
1140
+ ...t.leadOut === void 0 ? {} : { leadOut: t.leadOut }
1101
1141
  };
1102
1142
  }
1103
1143
  /** The drop: the place intent, and the ghost goes. Off every lane, or with
@@ -1108,7 +1148,7 @@ class Js {
1108
1148
  if (e.kind !== "place") return;
1109
1149
  t.preventDefault();
1110
1150
  const { ghost: s, item: n } = e;
1111
- if (this.stopAutoPan(), this.closeGestureFolds(), this.gesture = { kind: "none" }, this.refused = !1, this.cursor = "default", this.host.interactionChanged(), !this.allowed({ ...s, id: n.item }, s.lane)) return;
1151
+ 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;
1112
1152
  const i = {
1113
1153
  kind: "place",
1114
1154
  item: n.item,
@@ -1116,8 +1156,8 @@ class Js {
1116
1156
  lane: s.lane,
1117
1157
  from: s.from,
1118
1158
  to: s.to,
1119
- ...s.setup === void 0 ? {} : { setup: s.setup },
1120
- ...s.teardown === void 0 ? {} : { teardown: s.teardown }
1159
+ ...s.leadIn === void 0 ? {} : { leadIn: s.leadIn },
1160
+ ...s.leadOut === void 0 ? {} : { leadOut: s.leadOut }
1121
1161
  };
1122
1162
  (a = (r = this.host.handlers()).onIntent) == null || a.call(r, i);
1123
1163
  }
@@ -1126,7 +1166,7 @@ class Js {
1126
1166
  and a `dragend`, since it delivers no key events while a native drag
1127
1167
  runs. */
1128
1168
  clearPlacing() {
1129
- this.refused = !1, this.cursor = "default", this.closeGestureFolds(), this.gesture.kind === "place" && (this.stopAutoPan(), this.gesture = { kind: "none" }, this.host.interactionChanged());
1169
+ this.refused = !1, this.blocked = !1, this.cursor = "default", this.closeGestureFolds(), this.gesture.kind === "place" && (this.stopAutoPan(), this.gesture = { kind: "none" }, this.host.interactionChanged());
1130
1170
  }
1131
1171
  /* ---------------------------------------------------------------- */
1132
1172
  /* Ghost and intents */
@@ -1135,48 +1175,56 @@ class Js {
1135
1175
  const t = this.host.view.options.snap;
1136
1176
  return t === "ticks" ? { step: this.host.view.step(), offset: 0 } : t === !1 ? { step: 0, offset: 0 } : typeof t == "number" ? { step: t, offset: 0 } : t;
1137
1177
  }
1178
+ /** The ghost of a drag inside the plot at a point - or, where that would
1179
+ put the work into blocked time it did not already cover, the ghost where
1180
+ it last stood. It is held, not clamped: a pointer carried on past the
1181
+ blocked time takes the ghost along again. */
1182
+ heldGhost(t, e, s) {
1183
+ const n = this.ghostFor(t, e, s);
1184
+ return this.blocked = it(n, t.subtask, this.host.data.blocked), this.blocked ? t.ghost : n;
1185
+ }
1138
1186
  ghostFor(t, e, s) {
1139
1187
  const n = this.host.view, i = t.subtask, r = this.snapStep(), a = n.options.intents, h = this.snapInside(n.timeAt(e), r);
1140
1188
  switch (t.mode) {
1141
1189
  case "move": {
1142
- let c = i.from;
1143
- const l = n.viewport().scale, d = l.fromPx(e) - t.t0;
1144
- a.includes("move") && Math.abs(d * l.m) >= ye && (c = this.shifted(i.from, d, r));
1190
+ let d = i.from;
1191
+ const l = n.viewport().scale, c = l.fromPx(e) - t.t0;
1192
+ a.includes("move") && Math.abs(c * l.m) >= Me && (d = this.shifted(i.from, c, r));
1145
1193
  let p = t.ghost.lane;
1146
1194
  if (a.includes("lane")) {
1147
- const w = this.onLane(s) ?? p;
1148
- this.refused = t.refused.has(w), this.refused || (p = w);
1195
+ const m = this.onLane(s) ?? p;
1196
+ this.refused = t.refused.has(m), this.refused || (p = m);
1149
1197
  } else
1150
1198
  this.refused = !1;
1151
- return { ...i, from: c, to: c + (i.to - i.from), lane: p };
1199
+ return { ...i, from: d, to: d + (i.to - i.from), lane: p };
1152
1200
  }
1153
1201
  case "stretch-from":
1154
- return { ...i, from: Math.min(h, i.to - Math.max(r.step, X)) };
1202
+ return { ...i, from: Math.min(h, i.to - Math.max(r.step, W)) };
1155
1203
  case "stretch-to":
1156
- return { ...i, to: Math.max(h, i.from + Math.max(r.step, X)) };
1157
- case "setup":
1158
- return { ...i, setup: Math.max(0, i.from - h) };
1159
- case "teardown":
1160
- return { ...i, teardown: Math.max(0, h - i.to) };
1204
+ return { ...i, to: Math.max(h, i.from + Math.max(r.step, W)) };
1205
+ case "leadIn":
1206
+ return { ...i, leadIn: Math.max(0, i.from - h) };
1207
+ case "leadOut":
1208
+ return { ...i, leadOut: Math.max(0, h - i.to) };
1161
1209
  }
1162
1210
  }
1163
- /** A time moved by an amount of OPERATING time and snapped: a drag moves
1211
+ /** A time moved by an amount of WORKING time and snapped: a drag moves
1164
1212
  a start this way, and a key by one step of the raster - one arithmetic,
1165
1213
  so a key proposes exactly what a drag of that length would. */
1166
1214
  shifted(t, e, s) {
1167
- const n = V(this.host.view.options.calendar), i = K(t, n) + e, r = n.intervals.length === 0 ? i : W(Math.max(0, Math.min(n.total, i)), n);
1215
+ const n = q(this.host.view.options.calendar), i = K(t, n) + e, r = n.intervals.length === 0 ? i : z(Math.max(0, Math.min(n.total, i)), n);
1168
1216
  return this.snapInside(r, s);
1169
1217
  }
1170
1218
  /** Snapped - and, where the raster lands in time the calendar removes, moved
1171
1219
  on to the seam, where time counts again. An intent never asks for a time
1172
- the plant does not run. */
1220
+ nobody works. */
1173
1221
  snapInside(t, e) {
1174
- const s = qs(t, e), n = V(this.host.view.options.calendar);
1175
- return n.intervals.length === 0 ? s : W(K(s, n), n);
1222
+ const s = Js(t, e), n = q(this.host.view.options.calendar);
1223
+ return n.intervals.length === 0 ? s : z(K(s, n), n);
1176
1224
  }
1177
1225
  intentsOf(t, e, s) {
1178
1226
  const n = [], i = this.host.view.options.intents, r = t.id;
1179
- 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 === "setup" ? (e.setup ?? 0) !== (t.setup ?? 0) && n.push({ kind: "setup", subtask: r, setup: e.setup ?? 0 }) : (e.teardown ?? 0) !== (t.teardown ?? 0) && n.push({ kind: "teardown", subtask: r, teardown: e.teardown ?? 0 }), n;
1227
+ 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;
1180
1228
  }
1181
1229
  /** The lane the ghost came from - the only other lane a drag can touch. */
1182
1230
  ghostHome(t) {
@@ -1192,11 +1240,11 @@ class Js {
1192
1240
  keeps a plan of hundreds of tasks fluid while a drag runs, since this is
1193
1241
  computed on every pointer movement. */
1194
1242
  ghostFindings(t, e) {
1195
- 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, h = s.transports.filter((l) => l.from === t.id || l.to === t.id), c = t.id === ke ? s.subtasks : s.subtasks.map((l) => l.id === t.id ? t : l);
1196
- return { overlaps: Gt(r).filter(a), late: $t(c, h) };
1243
+ 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, h = s.dependencies.filter((l) => l.from === t.id || l.to === t.id), d = t.id === we ? s.subtasks : s.subtasks.map((l) => l.id === t.id ? t : l);
1244
+ return { overlaps: $t(r).filter(a), violated: Ht(d, h) };
1197
1245
  }
1198
1246
  }
1199
- function Qs(o, t) {
1247
+ function sn(o, t) {
1200
1248
  const e = /* @__PURE__ */ new Map();
1201
1249
  for (const s of t) {
1202
1250
  const n = o.slots.get(s.lane), i = n === void 0 ? null : Z(o, n.top);
@@ -1206,18 +1254,18 @@ function Qs(o, t) {
1206
1254
  }
1207
1255
  return [...e.entries()].sort(([s], [n]) => s - n).map(([, s]) => s.sort((n, i) => n.from - i.from || n.to - i.to));
1208
1256
  }
1209
- const ve = (o, t) => t < o.from ? o.from - t : t > o.to ? t - o.to : 0;
1210
- function tn(o, t, e, s) {
1211
- var c;
1257
+ const Te = (o, t) => t < o.from ? o.from - t : t > o.to ? t - o.to : 0;
1258
+ function nn(o, t, e, s) {
1259
+ var d;
1212
1260
  let n = -1, i = -1;
1213
1261
  for (let l = 0; l < o.length && t !== null && n < 0; l++)
1214
- i = o[l].findIndex((d) => d.id === t), i >= 0 && (n = l);
1262
+ i = o[l].findIndex((c) => c.id === t), i >= 0 && (n = l);
1215
1263
  if (n < 0) {
1216
1264
  for (const l of o) {
1217
- const d = l.find((p) => p.to > s[0] && p.from < s[1]);
1218
- if (d !== void 0) return d;
1265
+ const c = l.find((p) => p.to > s[0] && p.from < s[1]);
1266
+ if (c !== void 0) return c;
1219
1267
  }
1220
- return ((c = o[0]) == null ? void 0 : c[0]) ?? null;
1268
+ return ((d = o[0]) == null ? void 0 : d[0]) ?? null;
1221
1269
  }
1222
1270
  const r = o[n], a = r[i], h = (s[1] - s[0]) / 10;
1223
1271
  switch (e) {
@@ -1230,7 +1278,7 @@ function tn(o, t, e, s) {
1230
1278
  case "last":
1231
1279
  return r[r.length - 1];
1232
1280
  case "pageNext":
1233
- return r.find((l, d) => d > i && l.from >= a.from + h) ?? r[r.length - 1];
1281
+ return r.find((l, c) => c > i && l.from >= a.from + h) ?? r[r.length - 1];
1234
1282
  case "pagePrevious":
1235
1283
  for (let l = i - 1; l >= 0; l--) if (r[l].from <= a.from - h) return r[l];
1236
1284
  return r[0];
@@ -1238,22 +1286,22 @@ function tn(o, t, e, s) {
1238
1286
  case "down": {
1239
1287
  const l = o[e === "up" ? n - 1 : n + 1];
1240
1288
  if (l === void 0) return a;
1241
- const d = (a.from + a.to) / 2;
1242
- return l.reduce((p, w) => ve(w, d) < ve(p, d) ? w : p);
1289
+ const c = (a.from + a.to) / 2;
1290
+ return l.reduce((p, m) => Te(m, c) < Te(p, c) ? m : p);
1243
1291
  }
1244
1292
  }
1245
1293
  }
1246
- function en(o, t, e, s) {
1247
- if (e.kind === "transport") {
1294
+ function on(o, t, e, s) {
1295
+ if (e.kind === "dependency") {
1248
1296
  const i = o.find((a) => a.id === e.id), r = i === void 0 ? void 0 : s === "out" ? i.to : i.from;
1249
1297
  return r !== void 0 && t.has(r) ? { kind: "subtask", id: r } : e;
1250
1298
  }
1251
1299
  const n = o.find(
1252
1300
  (i) => (s === "out" ? i.from : i.to) === e.id && t.has(s === "out" ? i.to : i.from)
1253
1301
  );
1254
- return n === void 0 ? e : { kind: "transport", id: n.id };
1302
+ return n === void 0 ? e : { kind: "dependency", id: n.id };
1255
1303
  }
1256
- const sn = 150, nn = {
1304
+ const rn = 150, an = {
1257
1305
  ArrowRight: "next",
1258
1306
  ArrowLeft: "previous",
1259
1307
  ArrowUp: "up",
@@ -1263,7 +1311,7 @@ const sn = 150, nn = {
1263
1311
  PageDown: "pageNext",
1264
1312
  PageUp: "pagePrevious"
1265
1313
  };
1266
- class on {
1314
+ class ln {
1267
1315
  constructor(t) {
1268
1316
  f(this, "spoken", null);
1269
1317
  f(this, "timer", null);
@@ -1272,7 +1320,7 @@ class on {
1272
1320
  /** Where the keys stand: the hover, whoever set it. */
1273
1321
  active() {
1274
1322
  const t = this.host.gestures.hover;
1275
- return t.kind === "subtask" ? { kind: "subtask", id: t.subtask.id } : t.kind === "transport" ? { kind: "transport", id: t.transport.id } : null;
1323
+ return t.kind === "subtask" ? { kind: "subtask", id: t.subtask.id } : t.kind === "dependency" ? { kind: "dependency", id: t.dependency.id } : null;
1276
1324
  }
1277
1325
  /** The focus came in by keyboard: the walk starts where the pointer
1278
1326
  stands, or at the first subtask in view. A click focuses the plot too,
@@ -1293,35 +1341,35 @@ class on {
1293
1341
  const i = this.active();
1294
1342
  if (i === null) return !1;
1295
1343
  const r = this.host.data, a = s ? !t.shiftKey : t.key === "]";
1296
- return this.show(en(r.transports, r.subtaskById, i, a ? "out" : "back")), !0;
1344
+ return this.show(on(r.dependencies, r.subtaskById, i, a ? "out" : "back")), !0;
1297
1345
  }
1298
1346
  if (t.ctrlKey) return !1;
1299
1347
  if (t.altKey) return this.edit(t);
1300
1348
  if (t.key === "Escape")
1301
1349
  return e.byKeyboard ? (this.blur(), !0) : !1;
1302
1350
  if (t.key === "Enter" || t.key === " ") return this.select();
1303
- const n = t.shiftKey ? void 0 : nn[t.key];
1351
+ const n = t.shiftKey ? void 0 : an[t.key];
1304
1352
  return n === void 0 ? !1 : (this.walk(n), !0);
1305
1353
  }
1306
1354
  walk(t) {
1307
1355
  var h;
1308
- const { data: e, view: s } = this.host, n = this.active(), i = n === null ? null : n.kind === "subtask" ? n.id : ((h = e.transports.find((c) => c.id === n.id)) == null ? void 0 : h.from) ?? null;
1309
- let r = Qs(s.rows, e.subtasks);
1356
+ const { data: e, view: s } = this.host, n = this.active(), i = n === null ? null : n.kind === "subtask" ? n.id : ((h = e.dependencies.find((d) => d.id === n.id)) == null ? void 0 : h.from) ?? null;
1357
+ let r = sn(s.rows, e.subtasks);
1310
1358
  if (i === null) {
1311
- const c = r.filter((l) => {
1312
- const d = s.boxById.get(l[0].id);
1313
- return d !== void 0 && d.y + d.height > 0 && d.y < s.height;
1359
+ const d = r.filter((l) => {
1360
+ const c = s.boxById.get(l[0].id);
1361
+ return c !== void 0 && c.y + c.height > 0 && c.y < s.height;
1314
1362
  });
1315
- c.length > 0 && (r = c);
1363
+ d.length > 0 && (r = d);
1316
1364
  }
1317
- const a = tn(r, i, t, this.host.visibleDomain());
1365
+ const a = nn(r, i, t, this.host.visibleDomain());
1318
1366
  a !== null && this.show({ kind: "subtask", id: a.id });
1319
1367
  }
1320
1368
  /** Space and Enter select as a click does: the whole task, and the subtask. */
1321
1369
  select() {
1322
1370
  const t = this.host.gestures.hover;
1323
1371
  if (t.kind === "subtask") this.host.select(t.subtask.task, t.subtask.id);
1324
- else if (t.kind === "transport") this.host.select(this.host.data.taskOfTransport(t.transport), null);
1372
+ else if (t.kind === "dependency") this.host.select(this.host.data.taskOfDependency(t.dependency), null);
1325
1373
  else return !1;
1326
1374
  return !0;
1327
1375
  }
@@ -1329,20 +1377,25 @@ class on {
1329
1377
  end - the intents a drag of that length reports (ADR-0023), and only
1330
1378
  where the caller handles them. Nothing is applied here. */
1331
1379
  edit(t) {
1332
- var l, d;
1380
+ var c, p;
1333
1381
  const e = this.host.gestures.hover, s = t.key === "ArrowRight" ? 1 : t.key === "ArrowLeft" ? -1 : 0;
1334
1382
  if (s === 0) return !1;
1335
1383
  if (e.kind !== "subtask") return !0;
1336
- const n = e.subtask, i = this.host.gestures, r = this.host.view.options.intents, a = i.snapStep(), h = a.step > 0 ? a : { step: this.host.view.step(), offset: 0 };
1337
- let c = null;
1384
+ const n = e.subtask, i = this.host.gestures, r = this.host.view.options.intents, a = i.snapStep(), h = a.step > 0 ? a : { step: this.host.view.step(), offset: 0 }, d = this.host.data.blocked;
1385
+ let l = null;
1338
1386
  if (!t.shiftKey && r.includes("move")) {
1339
- const p = i.shifted(n.from, s * h.step, h);
1340
- p !== n.from && (c = { kind: "move", subtask: n.id, from: p, to: p + (n.to - n.from) });
1387
+ const m = (C) => ({ ...n, from: C, to: C + (n.to - n.from) });
1388
+ let y = n.from;
1389
+ for (let C = 0; C < 1e3; C++) {
1390
+ const S = i.shifted(y, s * h.step, h);
1391
+ if (S === y || (y = S, !it(m(y), n, d))) break;
1392
+ }
1393
+ y !== n.from && !it(m(y), n, d) && (l = { kind: "move", subtask: n.id, from: y, to: m(y).to });
1341
1394
  } else if (t.shiftKey && r.includes("stretch")) {
1342
- const p = Math.max(i.shifted(n.to, s * h.step, h), n.from + Math.max(h.step, X));
1343
- p !== n.to && (c = { kind: "stretch", subtask: n.id, from: n.from, to: p });
1395
+ const m = Math.max(i.shifted(n.to, s * h.step, h), n.from + Math.max(h.step, W));
1396
+ m !== n.to && !it({ ...n, to: m }, n, d) && (l = { kind: "stretch", subtask: n.id, from: n.from, to: m });
1344
1397
  }
1345
- return i.byKeyboard = !0, c !== null && ((d = (l = this.host.handlers()).onIntent) == null || d.call(l, c)), this.scheduleReadout(), !0;
1398
+ return i.byKeyboard = !0, l !== null && ((p = (c = this.host.handlers()).onIntent) == null || p.call(c, l)), this.scheduleReadout(), !0;
1346
1399
  }
1347
1400
  /** The keys stand on this target: brought into view, drawn as the hover. */
1348
1401
  show(t, e = !0) {
@@ -1363,18 +1416,18 @@ class on {
1363
1416
  const n = e.subtaskById.get(t.id);
1364
1417
  return n === void 0 ? null : { kind: "subtask", subtask: n, part: "main" };
1365
1418
  }
1366
- const s = e.transports.find((n) => n.id === t.id);
1367
- return s === void 0 ? null : { kind: "transport", transport: s };
1419
+ const s = e.dependencies.find((n) => n.id === t.id);
1420
+ return s === void 0 ? null : { kind: "dependency", dependency: s };
1368
1421
  }
1369
1422
  /** Where a target lies on the plot: a subtask's bar, or the span between
1370
- the two bars a transport joins. */
1423
+ the two bars a dependency joins. */
1371
1424
  bounds(t) {
1372
1425
  const e = this.host.view, s = (a) => e.boxById.get(a);
1373
1426
  if (t.kind === "subtask") {
1374
1427
  const a = s(t.id);
1375
1428
  return a === void 0 ? null : { x0: a.outerFrom, x1: a.outerTo, y0: a.y, y1: a.y + a.height };
1376
1429
  }
1377
- const n = this.host.data.transports.find((a) => a.id === t.id), i = n === void 0 ? void 0 : s(n.from), r = n === void 0 ? void 0 : s(n.to);
1430
+ 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);
1378
1431
  return i === void 0 || r === void 0 ? null : {
1379
1432
  x0: Math.min(i.mainTo, r.mainFrom),
1380
1433
  x1: Math.max(i.mainTo, r.mainFrom),
@@ -1409,25 +1462,25 @@ class on {
1409
1462
  if (!this.host.gestures.byKeyboard) return;
1410
1463
  const e = this.host.data.tooltipTargetFor(t);
1411
1464
  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());
1412
- }, sn);
1465
+ }, rn);
1413
1466
  }
1414
1467
  /** Unmount: no readout after it. */
1415
1468
  stop() {
1416
1469
  this.timer !== null && clearTimeout(this.timer), this.timer = null;
1417
1470
  }
1418
1471
  }
1419
- const $e = [], rn = 56;
1420
- function an(o, t = rn) {
1421
- return o > 0 ? Math.min(ot, Math.max(15 * X, is(o * t, 1))) : 15 * X;
1472
+ const Ye = [], hn = 56;
1473
+ function dn(o, t = hn) {
1474
+ return o > 0 ? Math.min(rt, Math.max(15 * W, hs(o * t, 1))) : 15 * W;
1422
1475
  }
1423
- function ln(o, t, e = $e) {
1424
- const [s, n] = Be(o, e);
1425
- return rs(e, s, n, t, Se(s)).filter(
1426
- (i) => i.operatingTime >= o[0] && i.operatingTime <= o[1]
1476
+ function un(o, t, e = Ye) {
1477
+ const [s, n] = Ke(o, e);
1478
+ return ds(e, s, n, t, _e(s)).filter(
1479
+ (i) => i.workingTime >= o[0] && i.workingTime <= o[1]
1427
1480
  );
1428
1481
  }
1429
- function hn(o, t = $e) {
1430
- const [e, s] = Be(o, t), n = [], i = new Date(e);
1482
+ function cn(o, t = Ye) {
1483
+ const [e, s] = Ke(o, t), n = [], i = new Date(e);
1431
1484
  for (i.setHours(0, 0, 0, 0); i.getTime() < s && n.length < 400; ) {
1432
1485
  const r = i.getTime();
1433
1486
  i.setDate(i.getDate() + 1);
@@ -1441,28 +1494,28 @@ function hn(o, t = $e) {
1441
1494
  }
1442
1495
  return n;
1443
1496
  }
1444
- function un(o, t, e, s) {
1497
+ function fn(o, t, e, s) {
1445
1498
  const n = o[1] - o[0];
1446
1499
  if (!(n > 0)) return [o[0], o[1]];
1447
1500
  const i = Math.min(s.max, Math.max(s.min, n * e)), r = (t - o[0]) / n, a = t - r * i;
1448
1501
  return [a, a + i];
1449
1502
  }
1450
- function cn(o, t) {
1503
+ function pn(o, t) {
1451
1504
  return [o[0] + t, o[1] + t];
1452
1505
  }
1453
- function Be(o, t) {
1454
- const e = V(t);
1506
+ function Ke(o, t) {
1507
+ const e = q(t);
1455
1508
  if (e.intervals.length === 0) return [o[0], o[1]];
1456
1509
  const s = (n) => Math.max(0, Math.min(e.total, n));
1457
- return [W(s(o[0]), e), W(s(o[1]), e)];
1510
+ return [z(s(o[0]), e), z(s(o[1]), e)];
1458
1511
  }
1459
- const ht = 44;
1460
- class dn {
1512
+ const ct = 44;
1513
+ class mn {
1461
1514
  constructor(t) {
1462
1515
  f(this, "options", {
1463
- laneHeight: ht,
1516
+ laneHeight: ct,
1464
1517
  calendar: [],
1465
- zoomLimits: { min: Dt, max: 28 * ot },
1518
+ zoomLimits: { min: Et, max: 28 * rt },
1466
1519
  snap: "ticks",
1467
1520
  intents: [],
1468
1521
  now: null,
@@ -1470,14 +1523,14 @@ class dn {
1470
1523
  attach: "centre",
1471
1524
  ends: "dot"
1472
1525
  });
1473
- f(this, "domain", [0, ot]);
1526
+ f(this, "domain", [0, rt]);
1474
1527
  f(this, "scrollY", 0);
1475
1528
  f(this, "width", 0);
1476
1529
  f(this, "height", 0);
1477
1530
  /* What is laid out from top to bottom (`rows.ts`). It is derived here and
1478
1531
  not in the data, because a row's height comes from a view option; every y
1479
1532
  in the package reads it. */
1480
- f(this, "rows", ie({ lanes: [], groups: [], collapsed: /* @__PURE__ */ new Set(), laneHeight: ht }));
1533
+ f(this, "rows", le({ lanes: [], groups: [], collapsed: /* @__PURE__ */ new Set(), laneHeight: ct }));
1481
1534
  /** The folded groups, as the scene holds them. */
1482
1535
  f(this, "collapsed", /* @__PURE__ */ new Set());
1483
1536
  /** The groups a gesture in flight holds open. Dropped when it ends; the
@@ -1495,16 +1548,16 @@ class dn {
1495
1548
  if (this.options = t, e !== null)
1496
1549
  this.domain = [K(e[0], t.calendar), K(e[1], t.calendar)];
1497
1550
  else if (s) {
1498
- const i = V(n), r = (a) => {
1551
+ const i = q(n), r = (a) => {
1499
1552
  const h = i.intervals.length === 0 ? a : Math.max(0, Math.min(i.total, a));
1500
- return K(W(h, i), t.calendar) + (a - h);
1553
+ return K(z(h, i), t.calendar) + (a - h);
1501
1554
  };
1502
1555
  this.domain = [r(this.domain[0]), r(this.domain[1])];
1503
1556
  }
1504
1557
  }
1505
1558
  viewport() {
1506
1559
  return {
1507
- scale: new as(this.domain, [0, this.width]),
1560
+ scale: new us(this.domain, [0, this.width]),
1508
1561
  calendar: this.options.calendar,
1509
1562
  laneHeight: this.options.laneHeight,
1510
1563
  scrollY: this.scrollY,
@@ -1521,28 +1574,28 @@ class dn {
1521
1574
  /** The fine band's step at the current zoom. */
1522
1575
  step() {
1523
1576
  const t = this.domain[1] - this.domain[0];
1524
- return an(this.width > 0 ? t / this.width : t);
1577
+ return dn(this.width > 0 ? t / this.width : t);
1525
1578
  }
1526
1579
  /** Lays the rows out, clamps the scroll, and lays the data out anew. */
1527
1580
  layout() {
1528
- this.rows = ie({
1581
+ this.rows = le({
1529
1582
  lanes: this.data.lanes,
1530
1583
  groups: this.data.groups,
1531
- collapsed: gs(this.collapsed, this.openForGesture),
1584
+ collapsed: ws(this.collapsed, this.openForGesture),
1532
1585
  laneHeight: this.options.laneHeight
1533
1586
  }), this.scrollY = Math.max(0, Math.min(this.maxScroll(), this.scrollY));
1534
1587
  const t = this.viewport();
1535
1588
  this.boxes = [], this.boxById = /* @__PURE__ */ new Map();
1536
1589
  for (const e of this.data.subtasks) {
1537
- const s = Rt(this.rows, e.lane);
1590
+ const s = Nt(this.rows, e.lane);
1538
1591
  if (s === null) continue;
1539
- const n = Ee(t, e, e.lane, s, this.data.depth.get(e.id) ?? 0);
1592
+ const n = Re(t, e, e.lane, s, this.data.depth.get(e.id) ?? 0);
1540
1593
  this.boxes.push(n), this.boxById.set(e.id, n);
1541
1594
  }
1542
1595
  this.paths = [];
1543
- for (const e of this.data.transports) {
1596
+ for (const e of this.data.dependencies) {
1544
1597
  const s = this.boxById.get(e.from), n = this.boxById.get(e.to);
1545
- s === void 0 || n === void 0 || this.paths.push(At(t, e, s, n, this.options));
1598
+ s === void 0 || n === void 0 || this.paths.push(_t(t, e, s, n, this.options));
1546
1599
  }
1547
1600
  }
1548
1601
  /** The days of the coarse band and the ticks of the fine band, in pixels. */
@@ -1551,11 +1604,11 @@ class dn {
1551
1604
  if (this.width <= 0) return { days: [], ticks: [], step: t };
1552
1605
  const e = this.viewport().scale, s = this.options.calendar;
1553
1606
  return {
1554
- days: hn(this.domain, s).map((n) => {
1607
+ days: cn(this.domain, s).map((n) => {
1555
1608
  const i = Math.round(e.toPx(n.from));
1556
1609
  return { start: n.start, x: i, width: Math.round(e.toPx(n.to)) - i };
1557
1610
  }),
1558
- ticks: ln(this.domain, t, s).map((n) => ({ wallClock: n.wallClock, x: Math.round(e.toPx(n.operatingTime)) })),
1611
+ ticks: un(this.domain, t, s).map((n) => ({ wallClock: n.wallClock, x: Math.round(e.toPx(n.workingTime)) })),
1559
1612
  step: t
1560
1613
  };
1561
1614
  }
@@ -1573,17 +1626,17 @@ class dn {
1573
1626
  }
1574
1627
  let s = null, n = 4;
1575
1628
  for (const r of this.paths) {
1576
- const a = Ts(r, t, e);
1629
+ const a = Ss(r, t, e);
1577
1630
  a <= n && (n = a, s = r);
1578
1631
  }
1579
- if (s !== null) return { kind: "transport", transport: s.transport };
1580
- const i = he(this.viewport(), e);
1632
+ if (s !== null) return { kind: "dependency", dependency: s.dependency };
1633
+ const i = ce(this.viewport(), e);
1581
1634
  return i !== null ? { kind: "lane", lane: i } : { kind: "nothing" };
1582
1635
  }
1583
1636
  /** The wall-clock time at a plot x; within the calendar's extent. */
1584
1637
  timeAt(t) {
1585
- const e = this.viewport().scale.fromPx(t), s = V(this.options.calendar);
1586
- return s.intervals.length === 0 ? e : W(Math.max(0, Math.min(s.total, e)), s);
1638
+ const e = this.viewport().scale.fromPx(t), s = q(this.options.calendar);
1639
+ return s.intervals.length === 0 ? e : z(Math.max(0, Math.min(s.total, e)), s);
1587
1640
  }
1588
1641
  /** The lane at a y, strips included: what the pointer is ON.
1589
1642
 
@@ -1592,11 +1645,11 @@ class dn {
1592
1645
  `foldedGroupAt` - and a caller that reached through `viewport()` for it
1593
1646
  would be depending on the layout rather than asking the view. */
1594
1647
  laneIdAt(t) {
1595
- return he(this.viewport(), t);
1648
+ return ce(this.viewport(), t);
1596
1649
  }
1597
1650
  /** The lane a DROP at this y would land on.
1598
1651
 
1599
- A **Miniature** is no drop target. A strip is three pixels of a machine's
1652
+ A **Miniature** is no drop target. A strip is three pixels of a lane's
1600
1653
  whole day, and a drop aimed at one would be a guess; resting over the
1601
1654
  group opens it for the gesture instead, and then there is a real lane to
1602
1655
  aim at. Hover, the tooltip and selection do read a strip - they cost
@@ -1614,7 +1667,7 @@ class dn {
1614
1667
  neither - a scroll through the lanes is no news about the time. */
1615
1668
  pan(t, e) {
1616
1669
  const s = this.domain[0], n = this.scrollY, i = this.domain[1] - s;
1617
- this.width > 0 && t !== 0 && (this.domain = cn(this.domain, t / this.width * i)), this.scrollY = Math.max(0, Math.min(this.maxScroll(), this.scrollY + e));
1670
+ this.width > 0 && t !== 0 && (this.domain = pn(this.domain, t / this.width * i)), this.scrollY = Math.max(0, Math.min(this.maxScroll(), this.scrollY + e));
1618
1671
  const r = this.domain[0] !== s;
1619
1672
  return { moved: r || this.scrollY !== n, time: r };
1620
1673
  }
@@ -1622,18 +1675,18 @@ class dn {
1622
1675
  zoomAt(t, e) {
1623
1676
  if (this.width <= 0 || !Number.isFinite(e)) return !1;
1624
1677
  const s = this.domain, n = this.viewport().scale.fromPx(t);
1625
- return this.domain = un(this.domain, n, e, this.options.zoomLimits), s[0] !== this.domain[0] || s[1] !== this.domain[1];
1678
+ return this.domain = fn(this.domain, n, e, this.options.zoomLimits), s[0] !== this.domain[0] || s[1] !== this.domain[1];
1626
1679
  }
1627
1680
  }
1628
- const be = {
1681
+ const Ie = {
1629
1682
  width: 0,
1630
1683
  height: 0,
1631
- laneHeight: ht,
1684
+ laneHeight: ct,
1632
1685
  scrollY: 0,
1633
1686
  headers: [],
1634
1687
  days: [],
1635
1688
  ticks: [],
1636
- step: Dt,
1689
+ step: Et,
1637
1690
  ghost: null,
1638
1691
  grips: [],
1639
1692
  cursor: "default",
@@ -1641,12 +1694,12 @@ const be = {
1641
1694
  now: null,
1642
1695
  bars: [],
1643
1696
  spoken: null,
1644
- summary: { lanes: 0, subtasks: 0, from: 0, to: 0, overlaps: 0, late: 0 }
1697
+ summary: { lanes: 0, subtasks: 0, from: 0, to: 0, overlaps: 0, violated: 0, blocked: 0 }
1645
1698
  };
1646
- class fn {
1699
+ class gn {
1647
1700
  constructor() {
1648
- f(this, "data", new Ls(() => this.viewChanged()));
1649
- f(this, "view", new dn(this.data));
1701
+ f(this, "data", new _s(() => this.viewChanged()));
1702
+ f(this, "view", new mn(this.data));
1650
1703
  f(this, "gestures");
1651
1704
  f(this, "keys");
1652
1705
  f(this, "handlersNow", {});
@@ -1667,7 +1720,7 @@ class fn {
1667
1720
  f(this, "frame", 0);
1668
1721
  f(this, "domainFrame", 0);
1669
1722
  f(this, "unsubscribeTheme", null);
1670
- f(this, "snapshot", be);
1723
+ f(this, "snapshot", Ie);
1671
1724
  f(this, "listeners", /* @__PURE__ */ new Set());
1672
1725
  /* ---------------------------------------------------------------- */
1673
1726
  /* Registration and options */
@@ -1685,7 +1738,7 @@ class fn {
1685
1738
  this.listeners.delete(t);
1686
1739
  }));
1687
1740
  f(this, "getSnapshot", () => this.snapshot);
1688
- f(this, "getServerSnapshot", () => be);
1741
+ f(this, "getServerSnapshot", () => Ie);
1689
1742
  /* ---------------------------------------------------------------- */
1690
1743
  /* Gestures, as the component hands them in */
1691
1744
  /* ---------------------------------------------------------------- */
@@ -1703,7 +1756,7 @@ class fn {
1703
1756
  f(this, "key", (t) => this.keys.key(t));
1704
1757
  f(this, "focus", (t) => this.keys.focus(t));
1705
1758
  f(this, "blur", () => this.keys.blur());
1706
- this.gestures = new Js({
1759
+ this.gestures = new en({
1707
1760
  data: this.data,
1708
1761
  view: this.view,
1709
1762
  plotElement: () => this.plot,
@@ -1715,7 +1768,7 @@ class fn {
1715
1768
  this.viewChanged(), t && this.reportDomain();
1716
1769
  },
1717
1770
  interactionChanged: () => this.interactionChanged()
1718
- }), this.keys = new on({
1771
+ }), this.keys = new ln({
1719
1772
  data: this.data,
1720
1773
  view: this.view,
1721
1774
  gestures: this.gestures,
@@ -1772,7 +1825,7 @@ class fn {
1772
1825
  /* DOM binding */
1773
1826
  /* ---------------------------------------------------------------- */
1774
1827
  bind(t, e, s, n) {
1775
- this.root = t, this.plot = e, this.dataCanvas = s, this.overlayCanvas = n, this.unsubscribeTheme = ls(() => {
1828
+ this.root = t, this.plot = e, this.dataCanvas = s, this.overlayCanvas = n, this.unsubscribeTheme = cs(() => {
1776
1829
  this.colours = null, this.requestDraw();
1777
1830
  }), this.viewChanged();
1778
1831
  }
@@ -1795,7 +1848,7 @@ class fn {
1795
1848
  }
1796
1849
  publish() {
1797
1850
  const t = this.view, e = this.selected !== null ? t.boxById.get(this.selected) : void 0, s = [];
1798
- e !== void 0 && !e.miniature && !this.gestures.editing && e.subtask.task === this.selectedTask && (t.options.intents.includes("setup") && s.push({ kind: "setup", x: e.outerFrom, y: e.y, height: e.height }), t.options.intents.includes("teardown") && s.push({ kind: "teardown", x: e.outerTo, y: e.y, height: e.height })), this.snapshot = {
1851
+ 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 = {
1799
1852
  width: t.width,
1800
1853
  height: t.height,
1801
1854
  laneHeight: t.options.laneHeight,
@@ -1840,10 +1893,10 @@ class fn {
1840
1893
  if (t.width <= 0) return [];
1841
1894
  const e = this.colours;
1842
1895
  return t.boxes.flatMap((s) => {
1843
- if (!It(s, t.width, t.height)) return [];
1844
- const n = bs(s, t.width);
1896
+ if (!At(s, t.width, t.height)) return [];
1897
+ const n = Cs(s, t.width);
1845
1898
  if (n === null) return [];
1846
- const i = e === null ? void 0 : e.tasks.get(s.subtask.task), r = i === void 0 || e === null ? !0 : Bt(ct(s.subtask.appearance), i, e).onDark;
1899
+ const i = e === null ? void 0 : e.tasks.get(s.subtask.task), r = i === void 0 || e === null ? !0 : Yt(pt(s.subtask.appearance), i, e).onDark;
1847
1900
  return [{ subtask: s.subtask, ...n, dark: r }];
1848
1901
  });
1849
1902
  }
@@ -1853,11 +1906,12 @@ class fn {
1853
1906
  const t = this.view, [e, s] = this.visibleDomain();
1854
1907
  return {
1855
1908
  lanes: this.data.lanes.length,
1856
- subtasks: t.boxes.filter((n) => It(n, t.width, t.height)).length,
1909
+ subtasks: t.boxes.filter((n) => At(n, t.width, t.height)).length,
1857
1910
  from: e,
1858
1911
  to: s,
1859
1912
  overlaps: this.data.overlaps.length,
1860
- late: this.data.lateById.size
1913
+ violated: this.data.violatedById.size,
1914
+ blocked: this.data.inBlocked.length
1861
1915
  };
1862
1916
  }
1863
1917
  tooltip() {
@@ -1870,7 +1924,7 @@ class fn {
1870
1924
  }
1871
1925
  /** The visible span, as two wall-clock instants. */
1872
1926
  visibleDomain() {
1873
- const t = V(this.view.options.calendar), e = (s) => t.intervals.length === 0 ? s : W(Math.max(0, Math.min(t.total, s)), t);
1927
+ const t = q(this.view.options.calendar), e = (s) => t.intervals.length === 0 ? s : z(Math.max(0, Math.min(t.total, s)), t);
1874
1928
  return [e(this.view.domain[0]), e(this.view.domain[1])];
1875
1929
  }
1876
1930
  /** Reported once per frame, however many wheel steps a planner turns - and
@@ -1902,8 +1956,8 @@ class fn {
1902
1956
  var a;
1903
1957
  const s = (a = this.plot) == null ? void 0 : a.getBoundingClientRect();
1904
1958
  if (s === void 0) return null;
1905
- const n = this.view.viewport(), i = e === void 0 ? null : ft(n, e), r = i === null ? 0 : i.top + i.height / 2;
1906
- return { x: s.left + R(n, t), y: s.top + r };
1959
+ const n = this.view.viewport(), i = e === void 0 ? null : at(n, e), r = i === null ? 0 : i.top + i.height / 2;
1960
+ return { x: s.left + E(n, t), y: s.top + r };
1907
1961
  }
1908
1962
  requestDraw() {
1909
1963
  this.frame !== 0 || this.dataCanvas === null || typeof requestAnimationFrame != "function" || (this.frame = requestAnimationFrame(() => {
@@ -1912,8 +1966,8 @@ class fn {
1912
1966
  }
1913
1967
  draw() {
1914
1968
  if (this.root === null) return;
1915
- this.colours === null && (this.colours = _s(this.root, this.data), this.publish());
1916
- const { width: t, height: e } = this.view, s = fe(this.dataCanvas, t, e), n = fe(this.overlayCanvas, t, e);
1969
+ this.colours === null && (this.colours = Es(this.root, this.data), this.publish());
1970
+ const { width: t, height: e } = this.view, s = ge(this.dataCanvas, t, e), n = ge(this.overlayCanvas, t, e);
1917
1971
  if (s === null || n === null || t === 0) return;
1918
1972
  const i = {
1919
1973
  data: this.data,
@@ -1925,252 +1979,254 @@ class fn {
1925
1979
  hover: this.gestures.hover,
1926
1980
  ghost: this.gestures.ghostDrawing()
1927
1981
  };
1928
- Fs(s, i), Ds(n, i);
1929
- }
1930
- }
1931
- const pn = "_root_19uyg_4 _text_k1tvc_23", mn = "_corner_19uyg_19", gn = "_dayBand_19uyg_23", kn = "_tickBand_19uyg_24", wn = "_day_19uyg_23", yn = "_dayLabel_19uyg_47", vn = "_tick_19uyg_24", bn = "_tickLabel_19uyg_65", Mn = "_headers_19uyg_73", Tn = "_header_19uyg_73", Cn = "_headerLabel_19uyg_91", Ln = "_headerCount_19uyg_104", Sn = "_chevron_19uyg_113", In = "_plot_19uyg_171", An = "_focusRing_19uyg_178", _n = "_layer_19uyg_196", Fn = "_grip_19uyg_205", Dn = "_ghostLabel_19uyg_215", En = "_finding_19uyg_228", Pn = "_refusal_19uyg_236", Rn = "_tooltip_19uyg_240", xn = "_tooltipHead_19uyg_259", Nn = "_tooltipTimes_19uyg_264", Gn = "_now_19uyg_273", $n = "_barLabel_19uyg_287", Bn = "_barLabelText_19uyg_300", y = {
1932
- root: pn,
1933
- corner: mn,
1934
- dayBand: gn,
1935
- tickBand: kn,
1936
- day: wn,
1937
- dayLabel: yn,
1938
- tick: vn,
1939
- tickLabel: bn,
1940
- headers: Mn,
1941
- header: Tn,
1942
- headerLabel: Cn,
1943
- headerCount: Ln,
1944
- chevron: Sn,
1945
- plot: In,
1946
- focusRing: An,
1947
- layer: _n,
1948
- grip: Fn,
1949
- ghostLabel: Dn,
1950
- finding: En,
1951
- refusal: Pn,
1952
- tooltip: Rn,
1982
+ Rs(s, i), Ps(n, i);
1983
+ }
1984
+ }
1985
+ const kn = "_root_19uyg_4 _text_k1tvc_23", yn = "_corner_19uyg_19", vn = "_dayBand_19uyg_23", wn = "_tickBand_19uyg_24", bn = "_day_19uyg_23", Mn = "_dayLabel_19uyg_47", Tn = "_tick_19uyg_24", In = "_tickLabel_19uyg_65", Cn = "_headers_19uyg_73", Ln = "_header_19uyg_73", Sn = "_headerLabel_19uyg_91", An = "_headerCount_19uyg_104", _n = "_chevron_19uyg_113", Dn = "_plot_19uyg_171", Fn = "_focusRing_19uyg_178", On = "_layer_19uyg_196", En = "_grip_19uyg_205", Rn = "_ghostLabel_19uyg_215", Pn = "_finding_19uyg_228", Bn = "_refusal_19uyg_236", Nn = "_tooltip_19uyg_240", xn = "_tooltipHead_19uyg_259", Gn = "_tooltipTimes_19uyg_264", $n = "_now_19uyg_273", Hn = "_barLabel_19uyg_287", Yn = "_barLabelText_19uyg_300", w = {
1986
+ root: kn,
1987
+ corner: yn,
1988
+ dayBand: vn,
1989
+ tickBand: wn,
1990
+ day: bn,
1991
+ dayLabel: Mn,
1992
+ tick: Tn,
1993
+ tickLabel: In,
1994
+ headers: Cn,
1995
+ header: Ln,
1996
+ headerLabel: Sn,
1997
+ headerCount: An,
1998
+ chevron: _n,
1999
+ plot: Dn,
2000
+ focusRing: Fn,
2001
+ layer: On,
2002
+ grip: En,
2003
+ ghostLabel: Rn,
2004
+ finding: Pn,
2005
+ refusal: Bn,
2006
+ tooltip: Nn,
1953
2007
  tooltipHead: xn,
1954
- tooltipTimes: Nn,
1955
- now: Gn,
1956
- barLabel: $n,
1957
- barLabelText: Bn
2008
+ tooltipTimes: Gn,
2009
+ now: $n,
2010
+ barLabel: Hn,
2011
+ barLabelText: Yn
1958
2012
  };
1959
- function Oe() {
1960
- const o = ut();
2013
+ function Ue() {
2014
+ const o = ft();
1961
2015
  return (t) => {
1962
- const e = Math.round(t / X), s = Math.floor(e / 60), n = e % 60;
2016
+ const e = Math.round(t / W), s = Math.floor(e / 60), n = e % 60;
1963
2017
  return [s > 0 ? o.hoursShort(s) : "", n > 0 || s === 0 ? o.minutesShort(n) : ""].filter(Boolean).join(" ");
1964
2018
  };
1965
2019
  }
1966
- function On({ target: o, lane: t }) {
1967
- const e = Et(), s = ut(), n = Oe(), i = (d) => e.time(new Date(d), !1);
2020
+ function Kn({ target: o, lane: t }) {
2021
+ const e = Rt(), s = ft(), n = Ue(), i = (c) => e.time(new Date(c), !1);
1968
2022
  if (o.kind === "subtask") {
1969
- const { subtask: d, task: p } = o, w = [
1970
- (p == null ? void 0 : p.name) ?? d.task,
1971
- d.name ?? d.id,
1972
- `${e.dateShort(new Date(d.from))} ${s.scheduleGhostTimes(i(d.from), i(d.to))}`,
1973
- ...o.overlapping.map((v) => s.scheduleOverlapWith(v.name ?? v.id)),
1974
- ...o.lateTransports.map((v) => s.scheduleLateBy(n(v.shortBy)))
2023
+ const { subtask: c, task: p } = o, m = [
2024
+ (p == null ? void 0 : p.name) ?? c.task,
2025
+ c.name ?? c.id,
2026
+ `${e.dateShort(new Date(c.from))} ${s.scheduleGhostTimes(i(c.from), i(c.to))}`,
2027
+ ...o.overlapping.map((y) => s.scheduleOverlapWith(y.name ?? y.id)),
2028
+ ...o.violatedDependencies.map((y) => s.scheduleViolatedBy(n(y.shortBy))),
2029
+ ...o.blocked.map((y) => s.scheduleInBlockedTime(y.label))
1975
2030
  ];
1976
2031
  return /* @__PURE__ */ Y(St, { children: [
1977
2032
  t,
1978
- `, ${w.join(", ")}`
2033
+ `, ${m.join(", ")}`
1979
2034
  ] });
1980
2035
  }
1981
- const { transport: r, task: a, from: h, to: c, late: l } = o;
2036
+ const { dependency: r, task: a, from: h, to: d, violated: l } = o;
1982
2037
  return [
1983
2038
  (a == null ? void 0 : a.name) ?? (a == null ? void 0 : a.id) ?? r.id,
1984
- `${s.scheduleTransport} ${n(r.duration)}`,
1985
- s.scheduleRoute((h == null ? void 0 : h.name) ?? r.from, (c == null ? void 0 : c.name) ?? r.to),
1986
- ...l === void 0 ? [] : [s.scheduleLateBy(n(l.shortBy))]
2039
+ `${s.scheduleDependency} ${n(r.lag)}`,
2040
+ s.scheduleRoute((h == null ? void 0 : h.name) ?? r.from, (d == null ? void 0 : d.name) ?? r.to),
2041
+ ...l === void 0 ? [] : [s.scheduleViolatedBy(n(l.shortBy))]
1987
2042
  ].join(", ");
1988
2043
  }
1989
- function Hn({ target: o }) {
1990
- const t = Et(), e = ut(), s = (l) => t.time(new Date(l), !1), n = Oe();
2044
+ function Un({ target: o }) {
2045
+ const t = Rt(), e = ft(), s = (l) => t.time(new Date(l), !1), n = Ue();
1991
2046
  if (o.kind === "subtask") {
1992
- const { subtask: l, task: d } = o;
2047
+ const { subtask: l, task: c } = o;
1993
2048
  return /* @__PURE__ */ Y(St, { children: [
1994
- /* @__PURE__ */ k("span", { className: y.tooltipHead, children: (d == null ? void 0 : d.name) ?? l.task }),
2049
+ /* @__PURE__ */ k("span", { className: w.tooltipHead, children: (c == null ? void 0 : c.name) ?? l.task }),
1995
2050
  /* @__PURE__ */ k("span", { children: l.name ?? l.id }),
1996
- /* @__PURE__ */ k("span", { className: y.tooltipTimes, children: e.scheduleGhostTimes(s(l.from), s(l.to)) }),
1997
- (l.setup ?? 0) > 0 && /* @__PURE__ */ k("span", { children: `${e.scheduleSetup} ${n(l.setup)}` }),
1998
- (l.teardown ?? 0) > 0 && /* @__PURE__ */ k("span", { children: `${e.scheduleTeardown} ${n(l.teardown)}` }),
1999
- o.overlapping.map((p) => /* @__PURE__ */ k("span", { className: y.finding, children: e.scheduleOverlapWith(p.name ?? p.id) }, p.id)),
2000
- o.lateTransports.map((p) => /* @__PURE__ */ k("span", { className: y.finding, children: e.scheduleLateBy(n(p.shortBy)) }, p.transport))
2051
+ /* @__PURE__ */ k("span", { className: w.tooltipTimes, children: e.scheduleGhostTimes(s(l.from), s(l.to)) }),
2052
+ (l.leadIn ?? 0) > 0 && /* @__PURE__ */ k("span", { children: `${e.scheduleLeadIn} ${n(l.leadIn)}` }),
2053
+ (l.leadOut ?? 0) > 0 && /* @__PURE__ */ k("span", { children: `${e.scheduleLeadOut} ${n(l.leadOut)}` }),
2054
+ o.overlapping.map((p) => /* @__PURE__ */ k("span", { className: w.finding, children: e.scheduleOverlapWith(p.name ?? p.id) }, p.id)),
2055
+ o.violatedDependencies.map((p) => /* @__PURE__ */ k("span", { className: w.finding, children: e.scheduleViolatedBy(n(p.shortBy)) }, p.dependency)),
2056
+ o.blocked.map((p) => /* @__PURE__ */ k("span", { className: w.finding, children: e.scheduleInBlockedTime(p.label) }, p.id))
2001
2057
  ] });
2002
2058
  }
2003
- const { transport: i, task: r, from: a, to: h, late: c } = o;
2059
+ const { dependency: i, task: r, from: a, to: h, violated: d } = o;
2004
2060
  return /* @__PURE__ */ Y(St, { children: [
2005
- /* @__PURE__ */ k("span", { className: y.tooltipHead, children: (r == null ? void 0 : r.name) ?? (r == null ? void 0 : r.id) ?? i.id }),
2061
+ /* @__PURE__ */ k("span", { className: w.tooltipHead, children: (r == null ? void 0 : r.name) ?? (r == null ? void 0 : r.id) ?? i.id }),
2006
2062
  /* @__PURE__ */ k("span", { children: e.scheduleRoute((a == null ? void 0 : a.name) ?? i.from, (h == null ? void 0 : h.name) ?? i.to) }),
2007
- /* @__PURE__ */ k("span", { children: `${e.scheduleTransport} ${n(i.duration)}` }),
2008
- c !== void 0 && /* @__PURE__ */ k("span", { className: y.finding, children: e.scheduleLateBy(n(c.shortBy)) })
2063
+ /* @__PURE__ */ k("span", { children: `${e.scheduleDependency} ${n(i.lag)}` }),
2064
+ d !== void 0 && /* @__PURE__ */ k("span", { className: w.finding, children: e.scheduleViolatedBy(n(d.shortBy)) })
2009
2065
  ] });
2010
2066
  }
2011
- const Yn = [], Me = { min: Dt, max: 28 * ot }, Kn = [], Te = 20, Jn = Qe(function(t, e) {
2012
- var se;
2067
+ const Xn = [], Ce = { min: Et, max: 28 * rt }, Wn = [], Le = 20, eo = ns(function(t, e) {
2068
+ var ie;
2013
2069
  const {
2014
2070
  ariaLabel: s,
2015
2071
  initialDomain: n,
2016
2072
  height: i = 400,
2017
- laneHeight: r = ht,
2073
+ laneHeight: r = ct,
2018
2074
  headerWidth: a = 160,
2019
- calendar: h = Kn,
2020
- zoomLimits: c,
2075
+ calendar: h = Wn,
2076
+ zoomLimits: d,
2021
2077
  snap: l = "ticks",
2022
- intents: d = Yn,
2078
+ intents: c = Xn,
2023
2079
  onIntent: p,
2024
- canMoveTo: w,
2025
- onInteraction: v,
2026
- selectedTask: A,
2027
- onSelectedTaskChange: _,
2028
- collapsedGroups: S,
2029
- defaultCollapsedGroups: m,
2030
- onCollapsedGroupsChange: C,
2080
+ canMoveTo: m,
2081
+ onInteraction: y,
2082
+ selectedTask: C,
2083
+ onSelectedTaskChange: S,
2084
+ collapsedGroups: A,
2085
+ defaultCollapsedGroups: g,
2086
+ onCollapsedGroupsChange: I,
2031
2087
  onDomainChange: L,
2032
- placing: D,
2033
- route: F = "curve",
2034
- attach: G = "centre",
2035
- ends: J = "dot",
2036
- label: it,
2037
- tooltip: z,
2038
- now: Q,
2039
- className: Ot,
2040
- style: He,
2041
- children: Ye
2042
- } = t, [g] = rt(() => new fn()), pt = ts(), Ht = `${pt}-summary`, Yt = O(null), Kt = O(null), Ut = O(null), Xt = O(null), $ = Et(), x = ut(), [mt, gt] = n, Wt = (c == null ? void 0 : c.min) ?? Me.min, zt = (c == null ? void 0 : c.max) ?? Me.max, jt = O(null), qt = typeof l == "object" ? l.step : null, Vt = typeof l == "object" ? l.offset : null, Zt = typeof l == "object" ? null : l, [Ke, Ue] = rt(() => Date.now());
2088
+ placing: F,
2089
+ route: D = "curve",
2090
+ attach: N = "centre",
2091
+ ends: Q = "dot",
2092
+ label: lt,
2093
+ tooltip: V,
2094
+ now: tt,
2095
+ className: Kt,
2096
+ style: Xe,
2097
+ children: We
2098
+ } = t, [v] = ht(() => new gn()), mt = os(), Ut = `${mt}-summary`, Xt = $(null), Wt = $(null), zt = $(null), Vt = $(null), x = Rt(), R = ft(), [gt, kt] = n, jt = (d == null ? void 0 : d.min) ?? Ce.min, qt = (d == null ? void 0 : d.max) ?? Ce.max, Zt = $(null), Jt = typeof l == "object" ? l.step : null, Qt = typeof l == "object" ? l.offset : null, te = typeof l == "object" ? null : l, [ze, Ve] = ht(() => Date.now());
2043
2099
  H(() => {
2044
- if (Q !== !0) return;
2045
- const u = setInterval(() => Ue(Date.now()), X);
2100
+ if (tt !== !0) return;
2101
+ const u = setInterval(() => Ve(Date.now()), W);
2046
2102
  return () => clearInterval(u);
2047
- }, [Q]);
2048
- const Jt = Q === !0 ? Ke : typeof Q == "number" ? Q : null;
2049
- Tt(() => {
2050
- const u = `${mt}|${gt}`, b = jt.current !== u;
2051
- jt.current = u;
2052
- const I = Zt ?? { step: qt ?? 0, offset: Vt ?? 0 };
2053
- g.setOptions(
2054
- { laneHeight: r, calendar: h, zoomLimits: { min: Wt, max: zt }, snap: I, intents: d, now: Jt, route: F, attach: G, ends: J },
2055
- b ? [mt, gt] : null
2103
+ }, [tt]);
2104
+ const ee = tt === !0 ? ze : typeof tt == "number" ? tt : null;
2105
+ It(() => {
2106
+ const u = `${gt}|${kt}`, M = Zt.current !== u;
2107
+ Zt.current = u;
2108
+ const _ = te ?? { step: Jt ?? 0, offset: Qt ?? 0 };
2109
+ v.setOptions(
2110
+ { laneHeight: r, calendar: h, zoomLimits: { min: jt, max: qt }, snap: _, intents: c, now: ee, route: D, attach: N, ends: Q },
2111
+ M ? [gt, kt] : null
2056
2112
  );
2057
- }, [g, mt, gt, r, h, Wt, zt, Zt, qt, Vt, d, Jt, F, G, J]), H(() => {
2058
- g.setHandlers({ onIntent: p, canMoveTo: w, onInteraction: v, onSelectedTaskChange: _, onCollapsedGroupsChange: C, onDomainChange: L });
2059
- }, [g, p, w, v, _, C, L]);
2060
- const Xe = O(m);
2113
+ }, [v, gt, kt, r, h, jt, qt, te, Jt, Qt, c, ee, D, N, Q]), H(() => {
2114
+ v.setHandlers({ onIntent: p, canMoveTo: m, onInteraction: y, onSelectedTaskChange: S, onCollapsedGroupsChange: I, onDomainChange: L });
2115
+ }, [v, p, m, y, S, I, L]);
2116
+ const je = $(g);
2061
2117
  H(() => {
2062
- const u = Xe.current;
2063
- u !== void 0 && g.setDefaultCollapsedGroups(u);
2064
- }, [g]), H(() => {
2065
- g.setCollapsedGroups(S);
2066
- }, [g, S]), es(
2118
+ const u = je.current;
2119
+ u !== void 0 && v.setDefaultCollapsedGroups(u);
2120
+ }, [v]), H(() => {
2121
+ v.setCollapsedGroups(A);
2122
+ }, [v, A]), is(
2067
2123
  e,
2068
2124
  () => ({
2069
- positionAt: (u, b) => g.positionAt(u, b),
2070
- clientPointOf: (u, b) => g.clientPointOf(u, b),
2071
- visibleDomain: () => g.visibleDomain()
2125
+ positionAt: (u, M) => v.positionAt(u, M),
2126
+ clientPointOf: (u, M) => v.clientPointOf(u, M),
2127
+ visibleDomain: () => v.visibleDomain()
2072
2128
  }),
2073
- [g]
2129
+ [v]
2074
2130
  ), H(() => {
2075
- g.setControlledTask(A);
2076
- }, [g, A]), H(() => {
2077
- g.setPlacing(D ?? null);
2078
- }, [g, D]), H(() => {
2079
- const u = Yt.current, b = Kt.current, I = Ut.current, B = Xt.current;
2080
- if (!u || !b || !I || !B) return;
2081
- g.bind(u, b, I, B);
2082
- const E = b.getBoundingClientRect();
2083
- g.resize(E.width, E.height);
2084
- const P = new ResizeObserver((N) => {
2085
- var ne;
2086
- const st = (ne = N[N.length - 1]) == null ? void 0 : ne.contentRect;
2087
- st !== void 0 && g.resize(st.width, st.height);
2131
+ v.setControlledTask(C);
2132
+ }, [v, C]), H(() => {
2133
+ v.setPlacing(F ?? null);
2134
+ }, [v, F]), H(() => {
2135
+ const u = Xt.current, M = Wt.current, _ = zt.current, G = Vt.current;
2136
+ if (!u || !M || !_ || !G) return;
2137
+ v.bind(u, M, _, G);
2138
+ const O = M.getBoundingClientRect();
2139
+ v.resize(O.width, O.height);
2140
+ const P = new ResizeObserver((B) => {
2141
+ var re;
2142
+ const nt = (re = B[B.length - 1]) == null ? void 0 : re.contentRect;
2143
+ nt !== void 0 && v.resize(nt.width, nt.height);
2088
2144
  });
2089
- P.observe(b);
2090
- const tt = (N) => g.wheel(N);
2091
- u.addEventListener("wheel", tt, { passive: !1 });
2092
- const et = (N) => {
2093
- N.key === "Escape" && g.cancelEdit() && N.preventDefault();
2145
+ P.observe(M);
2146
+ const et = (B) => v.wheel(B);
2147
+ u.addEventListener("wheel", et, { passive: !1 });
2148
+ const st = (B) => {
2149
+ B.key === "Escape" && v.cancelEdit() && B.preventDefault();
2094
2150
  };
2095
- return window.addEventListener("keydown", et), () => {
2096
- window.removeEventListener("keydown", et), u.removeEventListener("wheel", tt), P.disconnect(), g.unbind();
2151
+ return window.addEventListener("keydown", st), () => {
2152
+ window.removeEventListener("keydown", st), u.removeEventListener("wheel", et), P.disconnect(), v.unbind();
2097
2153
  };
2098
- }, [g]);
2099
- const M = ss(g.subscribe, g.getSnapshot, g.getServerSnapshot), We = (u, b) => {
2100
- const I = new Date(u);
2101
- return b >= 200 ? $.dateLong(I) : b >= 84 ? $.date(I) : b >= 44 ? $.dateShort(I) : "";
2102
- }, T = M.ghost, j = M.spoken, kt = M.summary, Qt = (u) => `${$.dateShort(new Date(u))} ${$.time(new Date(u), !1)}`, wt = (u) => `${pt}-row-${encodeURIComponent(u.key)}`, ze = q(() => {
2154
+ }, [v]);
2155
+ const T = rs(v.subscribe, v.getSnapshot, v.getServerSnapshot), qe = (u, M) => {
2156
+ const _ = new Date(u);
2157
+ return M >= 200 ? x.dateLong(_) : M >= 84 ? x.date(_) : M >= 44 ? x.dateShort(_) : "";
2158
+ }, b = T.ghost, j = T.spoken, yt = T.summary, se = (u) => `${x.dateShort(new Date(u))} ${x.time(new Date(u), !1)}`, vt = (u) => `${mt}-row-${encodeURIComponent(u.key)}`, Ze = X(() => {
2103
2159
  const u = /* @__PURE__ */ new Map();
2104
- for (const b of M.headers)
2105
- for (const I of b.within)
2106
- b.kind === "groupHead" && I === b.group || u.set(I, [...u.get(I) ?? [], wt(b)]);
2160
+ for (const M of T.headers)
2161
+ for (const _ of M.within)
2162
+ M.kind === "groupHead" && _ === M.group || u.set(_, [...u.get(_) ?? [], vt(M)]);
2107
2163
  return u;
2108
- }, [M.headers, pt]), je = q(() => new Set((T == null ? void 0 : T.refusedLanes) ?? []), [T == null ? void 0 : T.refusedLanes]), te = O(null), [yt, qe] = rt({ x: 0, y: 0, at: "" }), vt = T === null ? "" : `${T.x}:${T.y}:${T.from}:${T.to}:${T.overlap}:${T.late}`;
2109
- Tt(() => {
2110
- const u = te.current;
2111
- if (T === null || u === null) return;
2112
- const b = 4, I = T.y - u.offsetHeight - b, B = T.y + T.height + b, E = {
2113
- x: Math.max(2, Math.min(T.x, M.width - u.offsetWidth - 2)),
2114
- y: I >= 2 ? I : Math.min(B, M.height - u.offsetHeight - 2),
2115
- at: vt
2164
+ }, [T.headers, mt]), Je = X(() => new Set((b == null ? void 0 : b.refusedLanes) ?? []), [b == null ? void 0 : b.refusedLanes]), ne = $(null), [wt, Qe] = ht({ x: 0, y: 0, at: "" }), bt = b === null ? "" : `${b.x}:${b.y}:${b.from}:${b.to}:${b.overlap}:${b.violated}:${b.refused}:${b.blocked}`;
2165
+ It(() => {
2166
+ const u = ne.current;
2167
+ if (b === null || u === null) return;
2168
+ const M = 4, _ = b.y - u.offsetHeight - M, G = b.y + b.height + M, O = {
2169
+ x: Math.max(2, Math.min(b.x, T.width - u.offsetWidth - 2)),
2170
+ y: _ >= 2 ? _ : Math.min(G, T.height - u.offsetHeight - 2),
2171
+ at: bt
2116
2172
  };
2117
- qe((P) => P.x === E.x && P.y === E.y && P.at === E.at ? P : E);
2118
- }, [T, vt, M.width, M.height]);
2119
- const ee = O(null), [bt, Ve] = rt({ x: 0, y: 0, at: "" }), U = M.tooltip, Mt = U === null ? "" : `${U.x}:${U.y}:${U.target.kind}`;
2120
- return Tt(() => {
2121
- const u = ee.current;
2173
+ Qe((P) => P.x === O.x && P.y === O.y && P.at === O.at ? P : O);
2174
+ }, [b, bt, T.width, T.height]);
2175
+ const oe = $(null), [Mt, ts] = ht({ x: 0, y: 0, at: "" }), U = T.tooltip, Tt = U === null ? "" : `${U.x}:${U.y}:${U.target.kind}`;
2176
+ return It(() => {
2177
+ const u = oe.current;
2122
2178
  if (U === null || u === null) return;
2123
- const b = 12, I = (E, P, tt) => {
2124
- const et = E + b, N = E - b - P, st = et + P <= tt - 4 || N < 4 ? et : N;
2125
- return Math.max(4, Math.min(st, tt - P - 4));
2126
- }, B = {
2127
- x: I(U.x, u.offsetWidth, M.width),
2128
- y: I(U.y, u.offsetHeight, M.height),
2129
- at: Mt
2179
+ const M = 12, _ = (O, P, et) => {
2180
+ const st = O + M, B = O - M - P, nt = st + P <= et - 4 || B < 4 ? st : B;
2181
+ return Math.max(4, Math.min(nt, et - P - 4));
2182
+ }, G = {
2183
+ x: _(U.x, u.offsetWidth, T.width),
2184
+ y: _(U.y, u.offsetHeight, T.height),
2185
+ at: Tt
2130
2186
  };
2131
- Ve((E) => E.x === B.x && E.y === B.y && E.at === B.at ? E : B);
2132
- }, [U, Mt, M.width, M.height]), /* @__PURE__ */ Y(Ie.Provider, { value: g, children: [
2187
+ ts((O) => O.x === G.x && O.y === G.y && O.at === G.at ? O : G);
2188
+ }, [U, Tt, T.width, T.height]), /* @__PURE__ */ Y(De.Provider, { value: v, children: [
2133
2189
  /* @__PURE__ */ Y(
2134
2190
  "div",
2135
2191
  {
2136
- ref: Yt,
2192
+ ref: Xt,
2137
2193
  role: "figure",
2138
2194
  "aria-label": s,
2139
- className: Ot ? `${y.root} ${Ot}` : y.root,
2140
- style: { height: `${i}px`, gridTemplateColumns: `min(${a}px, 40%) minmax(0, 1fr)`, ...He },
2195
+ className: Kt ? `${w.root} ${Kt}` : w.root,
2196
+ style: { height: `${i}px`, gridTemplateColumns: `min(${a}px, 40%) minmax(0, 1fr)`, ...Xe },
2141
2197
  children: [
2142
- /* @__PURE__ */ k("div", { className: y.corner }),
2143
- /* @__PURE__ */ k("div", { className: y.dayBand, "aria-hidden": "true", "data-schedule-days": "", "data-schedule-clip": "day band", children: M.days.map((u) => {
2144
- const b = Math.max(0, -u.x), I = Math.min(u.x + u.width, M.width) - Math.max(u.x, 0);
2145
- return /* @__PURE__ */ k("span", { className: y.day, style: { left: `${u.x}px`, width: `${u.width}px` }, children: /* @__PURE__ */ k("span", { className: y.dayLabel, "data-schedule-overlay": "day label", style: { marginLeft: `${b}px` }, children: We(u.start, I) }) }, u.start);
2198
+ /* @__PURE__ */ k("div", { className: w.corner }),
2199
+ /* @__PURE__ */ k("div", { className: w.dayBand, "aria-hidden": "true", "data-schedule-days": "", "data-schedule-clip": "day band", children: T.days.map((u) => {
2200
+ const M = Math.max(0, -u.x), _ = Math.min(u.x + u.width, T.width) - Math.max(u.x, 0);
2201
+ return /* @__PURE__ */ k("span", { className: w.day, style: { left: `${u.x}px`, width: `${u.width}px` }, children: /* @__PURE__ */ k("span", { className: w.dayLabel, "data-schedule-overlay": "day label", style: { marginLeft: `${M}px` }, children: qe(u.start, _) }) }, u.start);
2146
2202
  }) }),
2147
- /* @__PURE__ */ k("div", { className: y.headers, "data-schedule-headers": "", children: /* @__PURE__ */ k("div", { className: y.headerRun, style: { transform: `translateY(${-M.scrollY}px)` }, children: M.headers.map((u) => /* @__PURE__ */ Y(
2203
+ /* @__PURE__ */ k("div", { className: w.headers, "data-schedule-headers": "", children: /* @__PURE__ */ k("div", { className: w.headerRun, style: { transform: `translateY(${-T.scrollY}px)` }, children: T.headers.map((u) => /* @__PURE__ */ Y(
2148
2204
  "div",
2149
2205
  {
2150
- id: wt(u),
2151
- className: y.header,
2206
+ id: vt(u),
2207
+ className: w.header,
2152
2208
  style: { height: `${u.height}px`, paddingLeft: `calc(var(--u-space-3) + ${u.depth} * var(--u-space-3))` },
2153
2209
  "data-lane": u.lane,
2154
2210
  "data-group": u.group,
2155
2211
  "data-row": u.kind,
2156
2212
  "data-schedule-clip": `header ${u.kind}`,
2157
- "data-refused": u.lane !== void 0 && je.has(u.lane) ? "" : void 0,
2213
+ "data-refused": u.lane !== void 0 && Je.has(u.lane) ? "" : void 0,
2158
2214
  children: [
2159
2215
  u.kind !== "lane" && u.group !== void 0 && /* @__PURE__ */ k(
2160
2216
  "button",
2161
2217
  {
2162
2218
  type: "button",
2163
- className: y.chevron,
2219
+ className: w.chevron,
2164
2220
  "data-schedule-overlay": "fold control",
2165
2221
  "aria-expanded": u.collapsed === !1,
2166
- "aria-controls": (ze.get(u.group) ?? [wt(u)]).join(" "),
2167
- "aria-label": `${u.collapsed === !0 ? x.scheduleUnfoldGroup : x.scheduleFoldGroup}: ${typeof u.label == "string" ? u.label : u.group}`,
2168
- onClick: () => g.toggleGroup(u.group),
2169
- children: /* @__PURE__ */ k(hs, { size: 9, "data-open": u.collapsed === !1 ? "" : void 0 })
2222
+ "aria-controls": (Ze.get(u.group) ?? [vt(u)]).join(" "),
2223
+ "aria-label": `${u.collapsed === !0 ? R.scheduleUnfoldGroup : R.scheduleFoldGroup}: ${typeof u.label == "string" ? u.label : u.group}`,
2224
+ onClick: () => v.toggleGroup(u.group),
2225
+ children: /* @__PURE__ */ k(fs, { size: 9, "data-open": u.collapsed === !1 ? "" : void 0 })
2170
2226
  }
2171
2227
  ),
2172
- /* @__PURE__ */ k("span", { className: y.headerLabel, "data-schedule-overlay": "header label", children: u.label }),
2173
- u.kind !== "lane" && /* @__PURE__ */ k("span", { className: y.headerCount, "data-schedule-overlay": "lane count", "data-lane-count": u.lanes, children: x.scheduleLaneCount(u.lanes) })
2228
+ /* @__PURE__ */ k("span", { className: w.headerLabel, "data-schedule-overlay": "header label", children: u.label }),
2229
+ u.kind !== "lane" && /* @__PURE__ */ k("span", { className: w.headerCount, "data-schedule-overlay": "lane count", "data-lane-count": u.lanes, children: R.scheduleLaneCount(u.lanes) })
2174
2230
  ]
2175
2231
  },
2176
2232
  u.key
@@ -2178,188 +2234,196 @@ const Yn = [], Me = { min: Dt, max: 28 * ot }, Kn = [], Te = 20, Jn = Qe(functio
2178
2234
  /* @__PURE__ */ Y(
2179
2235
  "div",
2180
2236
  {
2181
- ref: Kt,
2182
- className: y.plot,
2237
+ ref: Wt,
2238
+ className: w.plot,
2183
2239
  "data-schedule-plot": "",
2184
2240
  "data-schedule-clip": "plot",
2185
- style: { cursor: M.cursor },
2241
+ style: { cursor: T.cursor },
2186
2242
  tabIndex: 0,
2187
2243
  role: "application",
2188
- "aria-roledescription": x.scheduleRoleDescription,
2244
+ "aria-roledescription": R.scheduleRoleDescription,
2189
2245
  "aria-label": s,
2190
- "aria-describedby": Ht,
2246
+ "aria-describedby": Ut,
2191
2247
  onKeyDown: (u) => {
2192
- g.key(u.nativeEvent) && u.preventDefault();
2248
+ v.key(u.nativeEvent) && u.preventDefault();
2193
2249
  },
2194
- onFocus: (u) => g.focus(Un(u.currentTarget)),
2195
- onBlur: () => g.blur(),
2196
- onPointerDown: (u) => g.pointerDown(u.nativeEvent),
2197
- onPointerMove: (u) => g.pointerMove(u.nativeEvent),
2198
- onPointerUp: (u) => g.pointerUp(u.nativeEvent),
2199
- onPointerCancel: (u) => g.pointerCancel(u.nativeEvent),
2200
- onPointerLeave: () => g.pointerLeave(),
2201
- onContextMenu: (u) => g.contextMenu(u.nativeEvent),
2202
- onDragOver: (u) => g.dragOver(u.nativeEvent),
2203
- onDrop: (u) => g.drop(u.nativeEvent),
2250
+ onFocus: (u) => v.focus(zn(u.currentTarget)),
2251
+ onBlur: () => v.blur(),
2252
+ onPointerDown: (u) => v.pointerDown(u.nativeEvent),
2253
+ onPointerMove: (u) => v.pointerMove(u.nativeEvent),
2254
+ onPointerUp: (u) => v.pointerUp(u.nativeEvent),
2255
+ onPointerCancel: (u) => v.pointerCancel(u.nativeEvent),
2256
+ onPointerLeave: () => v.pointerLeave(),
2257
+ onContextMenu: (u) => v.contextMenu(u.nativeEvent),
2258
+ onDragOver: (u) => v.dragOver(u.nativeEvent),
2259
+ onDrop: (u) => v.drop(u.nativeEvent),
2204
2260
  onDragLeave: (u) => {
2205
- const b = u.nativeEvent.relatedTarget;
2206
- (!(b instanceof Node) || !u.currentTarget.contains(b)) && g.dragLeave();
2261
+ const M = u.nativeEvent.relatedTarget;
2262
+ (!(M instanceof Node) || !u.currentTarget.contains(M)) && v.dragLeave();
2207
2263
  },
2208
2264
  children: [
2209
- /* @__PURE__ */ k("canvas", { ref: Ut, className: y.layer, "aria-hidden": "true" }),
2210
- /* @__PURE__ */ k("canvas", { ref: Xt, className: y.layer, "aria-hidden": "true" }),
2211
- M.grips.map((u) => /* @__PURE__ */ k(
2265
+ /* @__PURE__ */ k("canvas", { ref: zt, className: w.layer, "aria-hidden": "true" }),
2266
+ /* @__PURE__ */ k("canvas", { ref: Vt, className: w.layer, "aria-hidden": "true" }),
2267
+ T.grips.map((u) => /* @__PURE__ */ k(
2212
2268
  "span",
2213
2269
  {
2214
2270
  "data-grip": u.kind,
2215
2271
  "data-schedule-overlay": `${u.kind} grip`,
2216
2272
  "aria-hidden": "true",
2217
- className: y.grip,
2273
+ className: w.grip,
2218
2274
  style: { left: `${u.x}px`, top: `${u.y}px`, height: `${u.height}px` }
2219
2275
  },
2220
2276
  u.kind
2221
2277
  )),
2222
- it !== void 0 && M.bars.map((u) => /* @__PURE__ */ k(
2278
+ lt !== void 0 && T.bars.map((u) => /* @__PURE__ */ k(
2223
2279
  "span",
2224
2280
  {
2225
- className: y.barLabel,
2281
+ className: w.barLabel,
2226
2282
  "data-bar-label": u.subtask.id,
2227
2283
  "data-schedule-overlay": "bar label",
2228
2284
  "data-schedule-may-cover": "",
2229
2285
  "data-on": u.dark ? "dark" : "light",
2230
2286
  style: { left: `${u.x}px`, top: `${u.y}px`, width: `${u.width}px`, height: `${u.height}px` },
2231
- children: /* @__PURE__ */ k("span", { className: y.barLabelText, children: it(u.subtask) })
2287
+ children: /* @__PURE__ */ k("span", { className: w.barLabelText, children: lt(u.subtask) })
2232
2288
  },
2233
2289
  u.subtask.id
2234
2290
  )),
2235
- z !== !1 && M.tooltip !== null && /* @__PURE__ */ k(
2291
+ V !== !1 && T.tooltip !== null && /* @__PURE__ */ k(
2236
2292
  "span",
2237
2293
  {
2238
- ref: ee,
2294
+ ref: oe,
2239
2295
  role: "tooltip",
2240
- className: y.tooltip,
2296
+ className: w.tooltip,
2241
2297
  "data-schedule-tooltip": "",
2242
2298
  "data-schedule-overlay": "tooltip",
2243
2299
  style: {
2244
- left: `${bt.x}px`,
2245
- top: `${bt.y}px`,
2246
- visibility: bt.at === Mt ? void 0 : "hidden"
2300
+ left: `${Mt.x}px`,
2301
+ top: `${Mt.y}px`,
2302
+ visibility: Mt.at === Tt ? void 0 : "hidden"
2247
2303
  },
2248
- children: typeof z == "function" ? z(M.tooltip.target) : /* @__PURE__ */ k(Hn, { target: M.tooltip.target })
2304
+ children: typeof V == "function" ? V(T.tooltip.target) : /* @__PURE__ */ k(Un, { target: T.tooltip.target })
2249
2305
  }
2250
2306
  ),
2251
- T !== null && /* @__PURE__ */ Y(
2307
+ b !== null && /* @__PURE__ */ Y(
2252
2308
  "span",
2253
2309
  {
2254
- ref: te,
2255
- className: y.ghostLabel,
2310
+ ref: ne,
2311
+ className: w.ghostLabel,
2256
2312
  "data-ghost": "",
2257
2313
  "data-schedule-overlay": "ghost label",
2258
- "data-findings": [T.overlap ? "overlap" : "", T.late ? "late-transport" : ""].filter(Boolean).join(" "),
2259
- "data-refused": T.refused ? "" : void 0,
2314
+ "data-findings": [b.overlap ? "overlap" : "", b.violated ? "violated-dependency" : ""].filter(Boolean).join(" "),
2315
+ "data-refused": b.refused ? "" : void 0,
2316
+ "data-blocked": b.blocked ? "" : void 0,
2260
2317
  style: {
2261
- left: `${yt.x}px`,
2262
- top: `${yt.y}px`,
2263
- visibility: yt.at === vt ? void 0 : "hidden"
2318
+ left: `${wt.x}px`,
2319
+ top: `${wt.y}px`,
2320
+ visibility: wt.at === bt ? void 0 : "hidden"
2264
2321
  },
2265
2322
  children: [
2266
- x.scheduleGhostTimes($.time(new Date(T.from), !1), $.time(new Date(T.to), !1)),
2267
- T.refused && /* @__PURE__ */ k("span", { className: y.refusal, children: x.scheduleLaneRefused }),
2268
- T.overlap && /* @__PURE__ */ k("span", { className: y.finding, children: x.scheduleOverlap }),
2269
- T.late && /* @__PURE__ */ k("span", { className: y.finding, children: x.scheduleLateTransport })
2323
+ R.scheduleGhostTimes(x.time(new Date(b.from), !1), x.time(new Date(b.to), !1)),
2324
+ b.refused && /* @__PURE__ */ k("span", { className: w.refusal, children: R.scheduleLaneRefused }),
2325
+ b.blocked && /* @__PURE__ */ k("span", { className: w.refusal, children: R.scheduleBlockedTime }),
2326
+ b.overlap && /* @__PURE__ */ k("span", { className: w.finding, children: R.scheduleOverlap }),
2327
+ b.violated && /* @__PURE__ */ k("span", { className: w.finding, children: R.scheduleViolatedDependency })
2270
2328
  ]
2271
2329
  }
2272
2330
  ),
2273
- /* @__PURE__ */ k("span", { className: y.focusRing, "aria-hidden": "true" })
2331
+ /* @__PURE__ */ k("span", { className: w.focusRing, "aria-hidden": "true" })
2274
2332
  ]
2275
2333
  }
2276
2334
  ),
2277
- /* @__PURE__ */ k("div", { className: y.corner }),
2278
- /* @__PURE__ */ Y("div", { className: y.tickBand, "aria-hidden": "true", "data-schedule-ticks": "", "data-schedule-clip": "time band", children: [
2279
- M.now !== null && /* @__PURE__ */ k("span", { className: y.now, "data-now": "", "data-schedule-overlay": "now mark", style: { left: `${M.now}px` } }),
2280
- M.ticks.map((u) => /* @__PURE__ */ k("span", { className: y.tick, style: { left: `${u.x}px` }, children: u.x >= Te && u.x <= M.width - Te && /* @__PURE__ */ k("span", { className: y.tickLabel, "data-schedule-overlay": "time label", children: M.step >= ot ? $.dateShort(new Date(u.wallClock)) : $.time(new Date(u.wallClock), !1) }) }, u.wallClock))
2335
+ /* @__PURE__ */ k("div", { className: w.corner }),
2336
+ /* @__PURE__ */ Y("div", { className: w.tickBand, "aria-hidden": "true", "data-schedule-ticks": "", "data-schedule-clip": "time band", children: [
2337
+ T.now !== null && /* @__PURE__ */ k("span", { className: w.now, "data-now": "", "data-schedule-overlay": "now mark", style: { left: `${T.now}px` } }),
2338
+ T.ticks.map((u) => /* @__PURE__ */ k("span", { className: w.tick, style: { left: `${u.x}px` }, children: u.x >= Le && u.x <= T.width - Le && /* @__PURE__ */ k("span", { className: w.tickLabel, "data-schedule-overlay": "time label", children: T.step >= rt ? x.dateShort(new Date(u.wallClock)) : x.time(new Date(u.wallClock), !1) }) }, u.wallClock))
2281
2339
  ] }),
2282
- /* @__PURE__ */ k(oe, { "aria-live": "polite", children: j !== null && /* @__PURE__ */ k(
2283
- On,
2340
+ /* @__PURE__ */ k(ae, { "aria-live": "polite", children: j !== null && /* @__PURE__ */ k(
2341
+ Kn,
2284
2342
  {
2285
2343
  target: j.target,
2286
- lane: j.lane === null ? null : ((se = g.data.lanes.find((u) => u.id === j.lane)) == null ? void 0 : se.label) ?? j.lane
2344
+ lane: j.lane === null ? null : ((ie = v.data.lanes.find((u) => u.id === j.lane)) == null ? void 0 : ie.label) ?? j.lane
2287
2345
  },
2288
2346
  j.count
2289
2347
  ) }),
2290
- /* @__PURE__ */ k(oe, { id: Ht, children: `${x.scheduleSummary({ ...kt, from: Qt(kt.from), to: Qt(kt.to) })} ${x.scheduleKeyHelp}` })
2348
+ /* @__PURE__ */ k(ae, { id: Ut, children: `${R.scheduleSummary({ ...yt, from: se(yt.from), to: se(yt.to) })} ${R.scheduleKeyHelp}` })
2291
2349
  ]
2292
2350
  }
2293
2351
  ),
2294
- Ye
2352
+ We
2295
2353
  ] });
2296
2354
  });
2297
- function Un(o) {
2355
+ function zn(o) {
2298
2356
  try {
2299
2357
  return o.matches(":focus-visible");
2300
2358
  } catch {
2301
2359
  return !0;
2302
2360
  }
2303
2361
  }
2304
- function Qn({ id: o, label: t }) {
2305
- const e = _e(), s = q(() => ({ id: o, label: t ?? o, ...e === null ? {} : { parent: e } }), [o, t, e]);
2306
- return cs(s), null;
2362
+ function so({ id: o, label: t }) {
2363
+ const e = Oe(), s = X(() => ({ id: o, label: t ?? o, ...e === null ? {} : { parent: e } }), [o, t, e]);
2364
+ return ms(s), null;
2365
+ }
2366
+ function no({ id: o, label: t, children: e }) {
2367
+ const s = Oe(), n = X(() => ({ id: o, label: t ?? o, ...s === null ? {} : { parent: s } }), [o, t, s]);
2368
+ return gs(n), /* @__PURE__ */ k(Fe.Provider, { value: o, children: e });
2307
2369
  }
2308
- function to({ id: o, label: t, children: e }) {
2309
- const s = _e(), n = q(() => ({ id: o, label: t ?? o, ...s === null ? {} : { parent: s } }), [o, t, s]);
2310
- return ds(n), /* @__PURE__ */ k(Ae.Provider, { value: o, children: e });
2370
+ function oo({ data: o, tasks: t }) {
2371
+ const e = X(() => ({ kind: "subtasks", data: o, tasks: t }), [o, t]);
2372
+ return Bt("Subtasks", e), null;
2311
2373
  }
2312
- function eo({ data: o, tasks: t }) {
2313
- const e = q(() => ({ kind: "subtasks", data: o, tasks: t }), [o, t]);
2314
- return Fe("Subtasks", e), null;
2374
+ function io({ data: o }) {
2375
+ const t = X(() => ({ kind: "dependencies", data: o }), [o]);
2376
+ return Bt("Dependencies", t), null;
2315
2377
  }
2316
- function so({ data: o }) {
2317
- const t = q(() => ({ kind: "transports", data: o }), [o]);
2318
- return Fe("Transports", t), null;
2378
+ function ro({ data: o }) {
2379
+ const t = X(() => ({ kind: "blocked", data: o }), [o]);
2380
+ return Bt("BlockedTimes", t), null;
2319
2381
  }
2320
- function no(o, t, e) {
2382
+ function ao(o, t, e) {
2321
2383
  if (e.kind === "place") return [];
2322
- const s = new Map(o.map((h) => [h.id, re(h, e)])), n = /* @__PURE__ */ new Map();
2384
+ const s = new Map(o.map((h) => [h.id, he(h, e)])), n = /* @__PURE__ */ new Map();
2323
2385
  for (const h of t) {
2324
- const c = n.get(h.from) ?? [];
2325
- c.push(h), n.set(h.from, c);
2386
+ const d = n.get(h.from) ?? [];
2387
+ d.push(h), n.set(h.from, d);
2326
2388
  }
2327
2389
  const i = /* @__PURE__ */ new Map(), r = [e.subtask];
2328
2390
  let a = (o.length + 1) * (t.length + 1);
2329
2391
  for (; r.length > 0 && a-- > 0; ) {
2330
- const h = r.shift(), c = s.get(h);
2331
- if (c !== void 0)
2392
+ const h = r.shift(), d = s.get(h);
2393
+ if (d !== void 0)
2332
2394
  for (const l of n.get(h) ?? []) {
2333
2395
  if (l.to === e.subtask) continue;
2334
- const d = s.get(l.to);
2335
- if (d === void 0) continue;
2336
- const p = xt(l, c) + l.duration - Nt(l, d);
2396
+ const c = s.get(l.to);
2397
+ if (c === void 0) continue;
2398
+ const p = xt(l, d) + l.lag - Gt(l, c);
2337
2399
  if (!(p > 0)) continue;
2338
- const w = { kind: "move", subtask: d.id, from: d.from + p, to: d.to + p };
2339
- s.set(d.id, re(d, w)), i.set(d.id, w), r.push(d.id);
2400
+ const m = { kind: "move", subtask: c.id, from: c.from + p, to: c.to + p };
2401
+ s.set(c.id, he(c, m)), i.set(c.id, m), r.push(c.id);
2340
2402
  }
2341
2403
  }
2342
2404
  return [...i.values()];
2343
2405
  }
2344
- function oo(o, t, e) {
2406
+ function lo(o, t, e) {
2345
2407
  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 }));
2346
2408
  }
2347
2409
  export {
2348
- Qn as Lane,
2349
- to as LaneGroup,
2350
- Jn as Schedule,
2351
- eo as Subtasks,
2352
- so as Transports,
2353
- re as applyIntent,
2354
- Nt as arrival,
2410
+ ro as BlockedTimes,
2411
+ io as Dependencies,
2412
+ so as Lane,
2413
+ no as LaneGroup,
2414
+ eo as Schedule,
2415
+ oo as Subtasks,
2416
+ he as applyIntent,
2417
+ Gt as arrival,
2355
2418
  xt as departure,
2356
- Zn as findings,
2357
- $t as lateTransports,
2358
- dt as occupied,
2359
- Gt as overlaps,
2360
- ct as resolveAppearance,
2361
- no as ripple,
2362
- oo as shiftTask,
2363
- qs as snapTime,
2364
- Vn as subtaskFromPlace
2419
+ to as findings,
2420
+ Be as inBlockedTime,
2421
+ J as occupied,
2422
+ $t as overlaps,
2423
+ pt as resolveAppearance,
2424
+ ao as ripple,
2425
+ lo as shiftTask,
2426
+ Js as snapTime,
2427
+ Qn as subtaskFromPlace,
2428
+ Ht as violatedDependencies
2365
2429
  };