@kteneyck/cesium-timeline-react 0.8.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,9 @@
1
- import et, { useMemo as Xe, useRef as x, useState as _e, useEffect as P, forwardRef as tt, useCallback as le, useImperativeHandle as nt, useLayoutEffect as rt } from "react";
2
- import * as _ from "cesium";
3
- import { DEFAULT_LABELS as ot, splitForDisplay as st, getTimezoneAbbr as ct, formatDateTime as Je, resolveLabel as Ye, drawTimeline as it, hitTestSwimLane as ut, hitTestLaneLabel as lt, isInSwimLaneRegion as at, zoomRange as dt, TICK_AREA_HEIGHT as Ke, DEFAULT_LANE_HEIGHT as ze, LANE_GAP as We, SWIM_LANE_SCROLL_SPEED as ft, MIN_SPAN_MS as pt, MAX_SPAN_MS as mt, zoomAroundMs as ht, toJulianDate as Ae, defaultTheme as xt, generateTicks as gt, timeToPosition as vt, snapToTick as bt } from "@kteneyck/cesium-timeline-core";
1
+ import ct, { useMemo as Ne, useRef as x, useState as Ae, useEffect as z, forwardRef as st, useCallback as ae, useImperativeHandle as it, useLayoutEffect as ut } from "react";
2
+ import * as D from "cesium";
3
+ import { DEFAULT_LABELS as lt, splitForDisplay as at, getTimezoneAbbr as dt, formatDateTime as We, resolveLabel as Be, drawTimeline as ft, hitTestSwimLane as pt, hitTestLaneLabel as mt, isInSwimLaneRegion as ht, TICK_AREA_HEIGHT as Oe, zoomRange as gt, DEFAULT_LANE_HEIGHT as $e, LANE_GAP as He, SWIM_LANE_SCROLL_SPEED as xt, MIN_SPAN_MS as vt, MAX_SPAN_MS as bt, zoomAroundMs as Tt, toJulianDate as De, defaultTheme as wt, generateTicks as Mt, timeToPosition as yt, snapToTick as Et } from "@kteneyck/cesium-timeline-core";
4
4
  export * from "@kteneyck/cesium-timeline-core";
5
- import { TICK_AREA_HEIGHT as kt } from "@kteneyck/cesium-timeline-core";
6
- var Fe = { exports: {} }, je = {};
5
+ import { TICK_AREA_HEIGHT as Ot } from "@kteneyck/cesium-timeline-core";
6
+ var Xe = { exports: {} }, Se = {};
7
7
  /**
8
8
  * @license React
9
9
  * react-jsx-runtime.production.js
@@ -13,29 +13,29 @@ var Fe = { exports: {} }, je = {};
13
13
  * This source code is licensed under the MIT license found in the
14
14
  * LICENSE file in the root directory of this source tree.
15
15
  */
16
- var Be;
17
- function Tt() {
18
- if (Be) return je;
19
- Be = 1;
20
- var j = Symbol.for("react.transitional.element"), I = Symbol.for("react.fragment");
21
- function U(l, C, A) {
22
- var O = null;
23
- if (A !== void 0 && (O = "" + A), C.key !== void 0 && (O = "" + C.key), "key" in C) {
24
- A = {};
25
- for (var N in C)
26
- N !== "key" && (A[N] = C[N]);
27
- } else A = C;
28
- return C = A.ref, {
29
- $$typeof: j,
30
- type: l,
31
- key: O,
32
- ref: C !== void 0 ? C : null,
33
- props: A
16
+ var Ue;
17
+ function Rt() {
18
+ if (Ue) return Se;
19
+ Ue = 1;
20
+ var F = Symbol.for("react.transitional.element"), X = Symbol.for("react.fragment");
21
+ function K(d, _, S) {
22
+ var W = null;
23
+ if (S !== void 0 && (W = "" + S), _.key !== void 0 && (W = "" + _.key), "key" in _) {
24
+ S = {};
25
+ for (var $ in _)
26
+ $ !== "key" && (S[$] = _[$]);
27
+ } else S = _;
28
+ return _ = S.ref, {
29
+ $$typeof: F,
30
+ type: d,
31
+ key: W,
32
+ ref: _ !== void 0 ? _ : null,
33
+ props: S
34
34
  };
35
35
  }
36
- return je.Fragment = I, je.jsx = U, je.jsxs = U, je;
36
+ return Se.Fragment = X, Se.jsx = K, Se.jsxs = K, Se;
37
37
  }
38
- var Se = {};
38
+ var Le = {};
39
39
  /**
40
40
  * @license React
41
41
  * react-jsx-runtime.development.js
@@ -45,126 +45,126 @@ var Se = {};
45
45
  * This source code is licensed under the MIT license found in the
46
46
  * LICENSE file in the root directory of this source tree.
47
47
  */
48
- var $e;
49
- function wt() {
50
- return $e || ($e = 1, process.env.NODE_ENV !== "production" && (function() {
51
- function j(t) {
48
+ var qe;
49
+ function Dt() {
50
+ return qe || (qe = 1, process.env.NODE_ENV !== "production" && (function() {
51
+ function F(t) {
52
52
  if (t == null) return null;
53
53
  if (typeof t == "function")
54
- return t.$$typeof === y ? null : t.displayName || t.name || null;
54
+ return t.$$typeof === p ? null : t.displayName || t.name || null;
55
55
  if (typeof t == "string") return t;
56
56
  switch (t) {
57
- case Z:
57
+ case te:
58
58
  return "Fragment";
59
- case T:
59
+ case w:
60
60
  return "Profiler";
61
- case ce:
61
+ case ue:
62
62
  return "StrictMode";
63
- case X:
63
+ case B:
64
64
  return "Suspense";
65
- case Q:
65
+ case oe:
66
66
  return "SuspenseList";
67
- case s:
67
+ case A:
68
68
  return "Activity";
69
69
  }
70
70
  if (typeof t == "object")
71
71
  switch (typeof t.tag == "number" && console.error(
72
72
  "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
73
73
  ), t.$$typeof) {
74
- case se:
74
+ case ie:
75
75
  return "Portal";
76
- case M:
76
+ case Q:
77
77
  return t.displayName || "Context";
78
- case g:
78
+ case v:
79
79
  return (t._context.displayName || "Context") + ".Consumer";
80
- case ne:
81
- var u = t.render;
82
- return t = t.displayName, t || (t = u.displayName || u.name || "", t = t !== "" ? "ForwardRef(" + t + ")" : "ForwardRef"), t;
83
- case he:
84
- return u = t.displayName || null, u !== null ? u : j(t.type) || "Memo";
85
- case ee:
86
- u = t._payload, t = t._init;
80
+ case M:
81
+ var f = t.render;
82
+ return t = t.displayName, t || (t = f.displayName || f.name || "", t = t !== "" ? "ForwardRef(" + t + ")" : "ForwardRef"), t;
83
+ case ge:
84
+ return f = t.displayName || null, f !== null ? f : F(t.type) || "Memo";
85
+ case ce:
86
+ f = t._payload, t = t._init;
87
87
  try {
88
- return j(t(u));
88
+ return F(t(f));
89
89
  } catch {
90
90
  }
91
91
  }
92
92
  return null;
93
93
  }
94
- function I(t) {
94
+ function X(t) {
95
95
  return "" + t;
96
96
  }
97
- function U(t) {
97
+ function K(t) {
98
98
  try {
99
- I(t);
100
- var u = !1;
99
+ X(t);
100
+ var f = !1;
101
101
  } catch {
102
- u = !0;
102
+ f = !0;
103
103
  }
104
- if (u) {
105
- u = console;
106
- var v = u.error, E = typeof Symbol == "function" && Symbol.toStringTag && t[Symbol.toStringTag] || t.constructor.name || "Object";
107
- return v.call(
108
- u,
104
+ if (f) {
105
+ f = console;
106
+ var b = f.error, y = typeof Symbol == "function" && Symbol.toStringTag && t[Symbol.toStringTag] || t.constructor.name || "Object";
107
+ return b.call(
108
+ f,
109
109
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
110
- E
111
- ), I(t);
110
+ y
111
+ ), X(t);
112
112
  }
113
113
  }
114
- function l(t) {
115
- if (t === Z) return "<>";
116
- if (typeof t == "object" && t !== null && t.$$typeof === ee)
114
+ function d(t) {
115
+ if (t === te) return "<>";
116
+ if (typeof t == "object" && t !== null && t.$$typeof === ce)
117
117
  return "<...>";
118
118
  try {
119
- var u = j(t);
120
- return u ? "<" + u + ">" : "<...>";
119
+ var f = F(t);
120
+ return f ? "<" + f + ">" : "<...>";
121
121
  } catch {
122
122
  return "<...>";
123
123
  }
124
124
  }
125
- function C() {
126
- var t = R.A;
125
+ function _() {
126
+ var t = g.A;
127
127
  return t === null ? null : t.getOwner();
128
128
  }
129
- function A() {
129
+ function S() {
130
130
  return Error("react-stack-top-frame");
131
131
  }
132
- function O(t) {
133
- if (k.call(t, "key")) {
134
- var u = Object.getOwnPropertyDescriptor(t, "key").get;
135
- if (u && u.isReactWarning) return !1;
132
+ function W(t) {
133
+ if (L.call(t, "key")) {
134
+ var f = Object.getOwnPropertyDescriptor(t, "key").get;
135
+ if (f && f.isReactWarning) return !1;
136
136
  }
137
137
  return t.key !== void 0;
138
138
  }
139
- function N(t, u) {
140
- function v() {
141
- S || (S = !0, console.error(
139
+ function $(t, f) {
140
+ function b() {
141
+ O || (O = !0, console.error(
142
142
  "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
143
- u
143
+ f
144
144
  ));
145
145
  }
146
- v.isReactWarning = !0, Object.defineProperty(t, "key", {
147
- get: v,
146
+ b.isReactWarning = !0, Object.defineProperty(t, "key", {
147
+ get: b,
148
148
  configurable: !0
149
149
  });
150
150
  }
151
- function ae() {
152
- var t = j(this.type);
153
- return L[t] || (L[t] = !0, console.error(
151
+ function de() {
152
+ var t = F(this.type);
153
+ return j[t] || (j[t] = !0, console.error(
154
154
  "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
155
155
  )), t = this.props.ref, t !== void 0 ? t : null;
156
156
  }
157
- function J(t, u, v, E, de, be) {
158
- var b = v.ref;
157
+ function H(t, f, b, y, re, he) {
158
+ var J = b.ref;
159
159
  return t = {
160
- $$typeof: oe,
160
+ $$typeof: Z,
161
161
  type: t,
162
- key: u,
163
- props: v,
164
- _owner: E
165
- }, (b !== void 0 ? b : null) !== null ? Object.defineProperty(t, "ref", {
162
+ key: f,
163
+ props: b,
164
+ _owner: y
165
+ }, (J !== void 0 ? J : null) !== null ? Object.defineProperty(t, "ref", {
166
166
  enumerable: !1,
167
- get: ae
167
+ get: de
168
168
  }) : Object.defineProperty(t, "ref", { enumerable: !1, value: null }), t._store = {}, Object.defineProperty(t._store, "validated", {
169
169
  configurable: !1,
170
170
  enumerable: !1,
@@ -179,148 +179,148 @@ function wt() {
179
179
  configurable: !1,
180
180
  enumerable: !1,
181
181
  writable: !0,
182
- value: de
182
+ value: re
183
183
  }), Object.defineProperty(t, "_debugTask", {
184
184
  configurable: !1,
185
185
  enumerable: !1,
186
186
  writable: !0,
187
- value: be
187
+ value: he
188
188
  }), Object.freeze && (Object.freeze(t.props), Object.freeze(t)), t;
189
189
  }
190
- function q(t, u, v, E, de, be) {
191
- var b = u.children;
192
- if (b !== void 0)
193
- if (E)
194
- if (z(b)) {
195
- for (E = 0; E < b.length; E++)
196
- K(b[E]);
197
- Object.freeze && Object.freeze(b);
190
+ function G(t, f, b, y, re, he) {
191
+ var J = f.children;
192
+ if (J !== void 0)
193
+ if (y)
194
+ if (C(J)) {
195
+ for (y = 0; y < J.length; y++)
196
+ U(J[y]);
197
+ Object.freeze && Object.freeze(J);
198
198
  } else
199
199
  console.error(
200
200
  "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
201
201
  );
202
- else K(b);
203
- if (k.call(u, "key")) {
204
- b = j(t);
205
- var re = Object.keys(u).filter(function(ye) {
206
- return ye !== "key";
202
+ else U(J);
203
+ if (L.call(f, "key")) {
204
+ J = F(t);
205
+ var E = Object.keys(f).filter(function(Te) {
206
+ return Te !== "key";
207
207
  });
208
- E = 0 < re.length ? "{key: someKey, " + re.join(": ..., ") + ": ...}" : "{key: someKey}", ie[b + E] || (re = 0 < re.length ? "{" + re.join(": ..., ") + ": ...}" : "{}", console.error(
208
+ y = 0 < E.length ? "{key: someKey, " + E.join(": ..., ") + ": ...}" : "{key: someKey}", k[J + y] || (E = 0 < E.length ? "{" + E.join(": ..., ") + ": ...}" : "{}", console.error(
209
209
  `A props object containing a "key" prop is being spread into JSX:
210
210
  let props = %s;
211
211
  <%s {...props} />
212
212
  React keys must be passed directly to JSX without using spread:
213
213
  let props = %s;
214
214
  <%s key={someKey} {...props} />`,
215
+ y,
216
+ J,
215
217
  E,
216
- b,
217
- re,
218
- b
219
- ), ie[b + E] = !0);
218
+ J
219
+ ), k[J + y] = !0);
220
220
  }
221
- if (b = null, v !== void 0 && (U(v), b = "" + v), O(u) && (U(u.key), b = "" + u.key), "key" in u) {
222
- v = {};
223
- for (var pe in u)
224
- pe !== "key" && (v[pe] = u[pe]);
225
- } else v = u;
226
- return b && N(
227
- v,
221
+ if (J = null, b !== void 0 && (K(b), J = "" + b), W(f) && (K(f.key), J = "" + f.key), "key" in f) {
222
+ b = {};
223
+ for (var fe in f)
224
+ fe !== "key" && (b[fe] = f[fe]);
225
+ } else b = f;
226
+ return J && $(
227
+ b,
228
228
  typeof t == "function" ? t.displayName || t.name || "Unknown" : t
229
- ), J(
229
+ ), H(
230
230
  t,
231
+ J,
231
232
  b,
232
- v,
233
- C(),
234
- de,
235
- be
233
+ _(),
234
+ re,
235
+ he
236
236
  );
237
237
  }
238
- function K(t) {
239
- G(t) ? t._store && (t._store.validated = 1) : typeof t == "object" && t !== null && t.$$typeof === ee && (t._payload.status === "fulfilled" ? G(t._payload.value) && t._payload.value._store && (t._payload.value._store.validated = 1) : t._store && (t._store.validated = 1));
238
+ function U(t) {
239
+ I(t) ? t._store && (t._store.validated = 1) : typeof t == "object" && t !== null && t.$$typeof === ce && (t._payload.status === "fulfilled" ? I(t._payload.value) && t._payload.value._store && (t._payload.value._store.validated = 1) : t._store && (t._store.validated = 1));
240
240
  }
241
- function G(t) {
242
- return typeof t == "object" && t !== null && t.$$typeof === oe;
241
+ function I(t) {
242
+ return typeof t == "object" && t !== null && t.$$typeof === Z;
243
243
  }
244
- var Y = et, oe = Symbol.for("react.transitional.element"), se = Symbol.for("react.portal"), Z = Symbol.for("react.fragment"), ce = Symbol.for("react.strict_mode"), T = Symbol.for("react.profiler"), g = Symbol.for("react.consumer"), M = Symbol.for("react.context"), ne = Symbol.for("react.forward_ref"), X = Symbol.for("react.suspense"), Q = Symbol.for("react.suspense_list"), he = Symbol.for("react.memo"), ee = Symbol.for("react.lazy"), s = Symbol.for("react.activity"), y = Symbol.for("react.client.reference"), R = Y.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, k = Object.prototype.hasOwnProperty, z = Array.isArray, W = console.createTask ? console.createTask : function() {
244
+ var se = ct, Z = Symbol.for("react.transitional.element"), ie = Symbol.for("react.portal"), te = Symbol.for("react.fragment"), ue = Symbol.for("react.strict_mode"), w = Symbol.for("react.profiler"), v = Symbol.for("react.consumer"), Q = Symbol.for("react.context"), M = Symbol.for("react.forward_ref"), B = Symbol.for("react.suspense"), oe = Symbol.for("react.suspense_list"), ge = Symbol.for("react.memo"), ce = Symbol.for("react.lazy"), A = Symbol.for("react.activity"), p = Symbol.for("react.client.reference"), g = se.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, L = Object.prototype.hasOwnProperty, C = Array.isArray, ee = console.createTask ? console.createTask : function() {
245
245
  return null;
246
246
  };
247
- Y = {
247
+ se = {
248
248
  react_stack_bottom_frame: function(t) {
249
249
  return t();
250
250
  }
251
251
  };
252
- var S, L = {}, c = Y.react_stack_bottom_frame.bind(
253
- Y,
254
- A
255
- )(), w = W(l(A)), ie = {};
256
- Se.Fragment = Z, Se.jsx = function(t, u, v) {
257
- var E = 1e4 > R.recentlyCreatedOwnerStacks++;
258
- return q(
252
+ var O, j = {}, s = se.react_stack_bottom_frame.bind(
253
+ se,
254
+ S
255
+ )(), V = ee(d(S)), k = {};
256
+ Le.Fragment = te, Le.jsx = function(t, f, b) {
257
+ var y = 1e4 > g.recentlyCreatedOwnerStacks++;
258
+ return G(
259
259
  t,
260
- u,
261
- v,
260
+ f,
261
+ b,
262
262
  !1,
263
- E ? Error("react-stack-top-frame") : c,
264
- E ? W(l(t)) : w
263
+ y ? Error("react-stack-top-frame") : s,
264
+ y ? ee(d(t)) : V
265
265
  );
266
- }, Se.jsxs = function(t, u, v) {
267
- var E = 1e4 > R.recentlyCreatedOwnerStacks++;
268
- return q(
266
+ }, Le.jsxs = function(t, f, b) {
267
+ var y = 1e4 > g.recentlyCreatedOwnerStacks++;
268
+ return G(
269
269
  t,
270
- u,
271
- v,
270
+ f,
271
+ b,
272
272
  !0,
273
- E ? Error("react-stack-top-frame") : c,
274
- E ? W(l(t)) : w
273
+ y ? Error("react-stack-top-frame") : s,
274
+ y ? ee(d(t)) : V
275
275
  );
276
276
  };
277
- })()), Se;
277
+ })()), Le;
278
278
  }
279
- var He;
280
- function Et() {
281
- return He || (He = 1, process.env.NODE_ENV === "production" ? Fe.exports = Tt() : Fe.exports = wt()), Fe.exports;
279
+ var Ge;
280
+ function At() {
281
+ return Ge || (Ge = 1, process.env.NODE_ENV === "production" ? Xe.exports = Rt() : Xe.exports = Dt()), Xe.exports;
282
282
  }
283
- var i = Et();
284
- const Mt = 520, yt = () => /* @__PURE__ */ i.jsxs("svg", { width: "14", height: "16", viewBox: "0 0 14 16", fill: "currentColor", "aria-hidden": "true", children: [
285
- /* @__PURE__ */ i.jsx("rect", { x: "1", y: "0", width: "4", height: "16", rx: "1" }),
286
- /* @__PURE__ */ i.jsx("rect", { x: "9", y: "0", width: "4", height: "16", rx: "1" })
287
- ] }), Ue = () => /* @__PURE__ */ i.jsx("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: /* @__PURE__ */ i.jsx("polyline", { points: "3,5 7,9 11,5" }) }), qe = () => /* @__PURE__ */ i.jsx("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: /* @__PURE__ */ i.jsx("polyline", { points: "3,9 7,5 11,9" }) }), Rt = ({
288
- currentTime: j,
289
- isPlaying: I,
290
- multiplier: U,
291
- dateTimeFormat: l,
292
- timezone: C,
293
- isLive: A,
294
- hasStartTime: O,
295
- hasEndTime: N,
296
- showJumpToStart: ae = !0,
297
- showJumpToEnd: J = !0,
298
- onPlayPause: q,
299
- onJumpToStart: K,
300
- onRewind: G,
301
- onFastForward: Y,
302
- onJumpToEnd: oe,
303
- onJumpToLive: se,
304
- onResetSpeed: Z,
305
- onDateTimeClick: ce,
306
- theme: T,
307
- swimLanesVisible: g,
308
- onToggleSwimLanes: M,
309
- labels: ne
283
+ var u = At();
284
+ const Ct = 520, _t = () => /* @__PURE__ */ u.jsxs("svg", { width: "14", height: "16", viewBox: "0 0 14 16", fill: "currentColor", "aria-hidden": "true", children: [
285
+ /* @__PURE__ */ u.jsx("rect", { x: "1", y: "0", width: "4", height: "16", rx: "1" }),
286
+ /* @__PURE__ */ u.jsx("rect", { x: "9", y: "0", width: "4", height: "16", rx: "1" })
287
+ ] }), Ve = () => /* @__PURE__ */ u.jsx("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: /* @__PURE__ */ u.jsx("polyline", { points: "3,5 7,9 11,5" }) }), Ke = () => /* @__PURE__ */ u.jsx("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: /* @__PURE__ */ u.jsx("polyline", { points: "3,9 7,5 11,9" }) }), jt = ({
288
+ currentTime: F,
289
+ isPlaying: X,
290
+ multiplier: K,
291
+ dateTimeFormat: d,
292
+ timezone: _,
293
+ isLive: S,
294
+ hasStartTime: W,
295
+ hasEndTime: $,
296
+ showJumpToStart: de = !0,
297
+ showJumpToEnd: H = !0,
298
+ onPlayPause: G,
299
+ onJumpToStart: U,
300
+ onRewind: I,
301
+ onFastForward: se,
302
+ onJumpToEnd: Z,
303
+ onJumpToLive: ie,
304
+ onResetSpeed: te,
305
+ onDateTimeClick: ue,
306
+ theme: w,
307
+ swimLanesVisible: v,
308
+ onToggleSwimLanes: Q,
309
+ labels: M
310
310
  }) => {
311
- const X = U < 0, Q = U > 1, he = U === 1, ee = Math.abs(U), s = Xe(
312
- () => ({ ...ot, ...ne }),
313
- [ne]
314
- ), y = x(null), [R, k] = _e(!1);
315
- P(() => {
316
- const c = y.current;
317
- if (!c) return;
318
- const w = new ResizeObserver(([ie]) => {
319
- k(ie.contentRect.width < Mt);
311
+ const B = K < 0, oe = K > 1, ge = K === 1, ce = Math.abs(K), A = Ne(
312
+ () => ({ ...lt, ...M }),
313
+ [M]
314
+ ), p = x(null), [g, L] = Ae(!1);
315
+ z(() => {
316
+ const s = p.current;
317
+ if (!s) return;
318
+ const V = new ResizeObserver(([k]) => {
319
+ L(k.contentRect.width < Ct);
320
320
  });
321
- return w.observe(c), () => w.disconnect();
321
+ return V.observe(s), () => V.disconnect();
322
322
  }, []);
323
- const z = {
323
+ const C = {
324
324
  background: "none",
325
325
  border: "1px solid transparent",
326
326
  cursor: "pointer",
@@ -337,73 +337,73 @@ const Mt = 520, yt = () => /* @__PURE__ */ i.jsxs("svg", { width: "14", height:
337
337
  fontFamily: "system-ui, -apple-system, sans-serif",
338
338
  flexShrink: 0,
339
339
  lineHeight: 1
340
- }, W = (c) => ({
341
- ...z,
342
- color: c ? T.buttonActiveColor : T.buttonColor,
343
- borderColor: c ? `${T.buttonActiveColor}33` : "transparent"
344
- }), S = (c, w) => {
345
- c.currentTarget.style.backgroundColor = w ? `${T.buttonActiveColor}22` : T.buttonHoverColor + "44";
346
- }, L = (c) => {
347
- c.currentTarget.style.backgroundColor = "transparent";
340
+ }, ee = (s) => ({
341
+ ...C,
342
+ color: s ? w.buttonActiveColor : w.buttonColor,
343
+ borderColor: s ? `${w.buttonActiveColor}33` : "transparent"
344
+ }), O = (s, V) => {
345
+ s.currentTarget.style.backgroundColor = V ? `${w.buttonActiveColor}22` : w.buttonHoverColor + "44";
346
+ }, j = (s) => {
347
+ s.currentTarget.style.backgroundColor = "transparent";
348
348
  };
349
- return /* @__PURE__ */ i.jsxs(
349
+ return /* @__PURE__ */ u.jsxs(
350
350
  "div",
351
351
  {
352
- ref: y,
352
+ ref: p,
353
353
  style: {
354
- display: R ? "flex" : "grid",
355
- gridTemplateColumns: R ? void 0 : "1fr auto 1fr",
354
+ display: g ? "flex" : "grid",
355
+ gridTemplateColumns: g ? void 0 : "1fr auto 1fr",
356
356
  alignItems: "center",
357
357
  padding: "6px 16px",
358
- backgroundColor: T.controlBarBackground,
359
- borderBottom: `1px solid ${T.controlBarBorder}`,
358
+ backgroundColor: w.controlBarBackground,
359
+ borderBottom: `1px solid ${w.controlBarBorder}`,
360
360
  fontFamily: "system-ui, -apple-system, sans-serif"
361
361
  },
362
362
  children: [
363
- /* @__PURE__ */ i.jsxs("div", { style: { display: "flex", alignItems: "center", gap: "8px", flexShrink: 0 }, children: [
364
- /* @__PURE__ */ i.jsx(
363
+ /* @__PURE__ */ u.jsxs("div", { style: { display: "flex", alignItems: "center", gap: "8px", flexShrink: 0 }, children: [
364
+ /* @__PURE__ */ u.jsx(
365
365
  "div",
366
366
  {
367
- onClick: ce,
368
- title: ce ? s.dateTimeClickTooltip : void 0,
367
+ onClick: ue,
368
+ title: ue ? A.dateTimeClickTooltip : void 0,
369
369
  style: {
370
- color: T.labelColor,
370
+ color: w.labelColor,
371
371
  fontFamily: "monospace",
372
372
  lineHeight: 1.15,
373
- cursor: ce ? "pointer" : "default",
373
+ cursor: ue ? "pointer" : "default",
374
374
  borderRadius: "4px",
375
375
  padding: "2px 4px",
376
376
  transition: "background 0.15s"
377
377
  },
378
- onMouseEnter: (c) => {
379
- ce && (c.currentTarget.style.background = T.buttonHoverColor + "44");
378
+ onMouseEnter: (s) => {
379
+ ue && (s.currentTarget.style.background = w.buttonHoverColor + "44");
380
380
  },
381
- onMouseLeave: (c) => c.currentTarget.style.background = "transparent",
381
+ onMouseLeave: (s) => s.currentTarget.style.background = "transparent",
382
382
  children: (() => {
383
- const { timeFormat: c, dateFormat: w } = st(l), ie = ct(j, C);
384
- return /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
385
- c && /* @__PURE__ */ i.jsx("div", { style: { fontSize: "2em", fontWeight: "bold", letterSpacing: "0.02em" }, children: Je(j, c, C) }),
386
- w && /* @__PURE__ */ i.jsxs("div", { style: { display: "flex", alignItems: "center", gap: "6px" }, children: [
387
- /* @__PURE__ */ i.jsx("span", { style: { fontSize: "1.15em", letterSpacing: "0.03em", color: T.buttonActiveColor }, children: Je(j, w, C) }),
388
- ie && /* @__PURE__ */ i.jsx("span", { style: {
383
+ const { timeFormat: s, dateFormat: V } = at(d), k = dt(F, _);
384
+ return /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
385
+ s && /* @__PURE__ */ u.jsx("div", { style: { fontSize: "2em", fontWeight: "bold", letterSpacing: "0.02em" }, children: We(F, s, _) }),
386
+ V && /* @__PURE__ */ u.jsxs("div", { style: { display: "flex", alignItems: "center", gap: "6px" }, children: [
387
+ /* @__PURE__ */ u.jsx("span", { style: { fontSize: "1.15em", letterSpacing: "0.03em", color: w.buttonActiveColor }, children: We(F, V, _) }),
388
+ k && /* @__PURE__ */ u.jsx("span", { style: {
389
389
  fontSize: "0.9em",
390
- color: T.labelColor,
390
+ color: w.labelColor,
391
391
  opacity: 0.7,
392
392
  fontWeight: "bold",
393
393
  letterSpacing: "0.04em"
394
- }, children: ie })
394
+ }, children: k })
395
395
  ] })
396
396
  ] });
397
397
  })()
398
398
  }
399
399
  ),
400
- /* @__PURE__ */ i.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: "2px", justifyContent: "center" }, children: [
401
- /* @__PURE__ */ i.jsx(
400
+ /* @__PURE__ */ u.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: "2px", justifyContent: "center" }, children: [
401
+ /* @__PURE__ */ u.jsx(
402
402
  "button",
403
403
  {
404
- onClick: se,
404
+ onClick: ie,
405
405
  style: {
406
- ...z,
406
+ ...C,
407
407
  fontSize: "11px",
408
408
  fontWeight: "bold",
409
409
  letterSpacing: "0.05em",
@@ -411,315 +411,321 @@ const Mt = 520, yt = () => /* @__PURE__ */ i.jsxs("svg", { width: "14", height:
411
411
  minWidth: "52px",
412
412
  height: "20px",
413
413
  borderRadius: "3px",
414
- color: A ? T.controlBarBackground : T.buttonActiveColor,
415
- backgroundColor: A ? T.buttonActiveColor : "transparent",
416
- borderColor: T.buttonActiveColor,
417
- opacity: A ? 1 : 0.55
414
+ color: S ? w.controlBarBackground : w.buttonActiveColor,
415
+ backgroundColor: S ? w.buttonActiveColor : "transparent",
416
+ borderColor: w.buttonActiveColor,
417
+ opacity: S ? 1 : 0.55
418
418
  },
419
- onMouseEnter: (c) => {
420
- c.currentTarget.style.opacity = "1";
419
+ onMouseEnter: (s) => {
420
+ s.currentTarget.style.opacity = "1";
421
421
  },
422
- onMouseLeave: (c) => {
423
- c.currentTarget.style.opacity = A ? "1" : "0.55";
422
+ onMouseLeave: (s) => {
423
+ s.currentTarget.style.opacity = S ? "1" : "0.55";
424
424
  },
425
- title: A ? s.liveActiveTooltip : s.liveTooltip,
426
- children: A ? s.liveActiveLabel : s.liveLabel
425
+ title: S ? A.liveActiveTooltip : A.liveTooltip,
426
+ children: S ? A.liveActiveLabel : A.liveLabel
427
427
  }
428
428
  ),
429
- /* @__PURE__ */ i.jsx("div", { style: { height: "20px", display: "flex", alignItems: "center" }, children: !he && /* @__PURE__ */ i.jsx(
429
+ /* @__PURE__ */ u.jsx("div", { style: { height: "20px", display: "flex", alignItems: "center" }, children: !ge && /* @__PURE__ */ u.jsx(
430
430
  "button",
431
431
  {
432
- onClick: () => Z(),
432
+ onClick: () => te(),
433
433
  style: {
434
- ...z,
434
+ ...C,
435
435
  fontSize: "11px",
436
- color: T.buttonActiveColor,
437
- borderColor: `${T.buttonActiveColor}44`,
436
+ color: w.buttonActiveColor,
437
+ borderColor: `${w.buttonActiveColor}44`,
438
438
  width: "52px",
439
439
  minWidth: "52px",
440
440
  height: "20px"
441
441
  },
442
- onMouseEnter: (c) => S(c, !0),
443
- onMouseLeave: L,
444
- title: s.resetSpeedTooltip,
445
- children: X ? `◀ ${ee}×` : `${ee}× ▶`
442
+ onMouseEnter: (s) => O(s, !0),
443
+ onMouseLeave: j,
444
+ title: A.resetSpeedTooltip,
445
+ children: B ? `◀ ${ce}×` : `${ce}× ▶`
446
446
  }
447
447
  ) })
448
448
  ] })
449
449
  ] }),
450
- /* @__PURE__ */ i.jsxs("div", { style: { display: "flex", alignItems: "center", gap: "2px", ...R ? { flex: 1, justifyContent: "center" } : {} }, children: [
451
- ae && /* @__PURE__ */ i.jsx(
450
+ /* @__PURE__ */ u.jsxs("div", { style: { display: "flex", alignItems: "center", gap: "2px", ...g ? { flex: 1, justifyContent: "center" } : {} }, children: [
451
+ de && /* @__PURE__ */ u.jsx(
452
452
  "button",
453
453
  {
454
- onClick: O ? K : void 0,
455
- disabled: !O,
456
- style: { ...W(!1), opacity: O ? 1 : 0.3, cursor: O ? "pointer" : "default" },
457
- onMouseEnter: O ? (c) => S(c, !1) : void 0,
458
- onMouseLeave: O ? L : void 0,
459
- title: O ? s.jumpToStartTooltip : s.noStartTimeTooltip,
454
+ onClick: W ? U : void 0,
455
+ disabled: !W,
456
+ style: { ...ee(!1), opacity: W ? 1 : 0.3, cursor: W ? "pointer" : "default" },
457
+ onMouseEnter: W ? (s) => O(s, !1) : void 0,
458
+ onMouseLeave: W ? j : void 0,
459
+ title: W ? A.jumpToStartTooltip : A.noStartTimeTooltip,
460
460
  children: "⏮"
461
461
  }
462
462
  ),
463
- /* @__PURE__ */ i.jsx(
463
+ /* @__PURE__ */ u.jsx(
464
464
  "button",
465
465
  {
466
- onClick: G,
467
- style: { ...W(X), width: "64px", minWidth: "64px", gap: "3px" },
468
- onMouseEnter: (c) => S(c, X),
469
- onMouseLeave: L,
470
- title: X ? Ye(s.rewindActiveTooltip, ee) : s.rewindTooltip,
471
- children: X ? /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
472
- /* @__PURE__ */ i.jsxs("span", { style: { fontSize: "11px", fontWeight: "bold" }, children: [
473
- ee,
466
+ onClick: I,
467
+ style: { ...ee(B), width: "64px", minWidth: "64px", gap: "3px" },
468
+ onMouseEnter: (s) => O(s, B),
469
+ onMouseLeave: j,
470
+ title: B ? Be(A.rewindActiveTooltip, ce) : A.rewindTooltip,
471
+ children: B ? /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
472
+ /* @__PURE__ */ u.jsxs("span", { style: { fontSize: "11px", fontWeight: "bold" }, children: [
473
+ ce,
474
474
  "×"
475
475
  ] }),
476
476
  "◀◀"
477
477
  ] }) : "◀◀"
478
478
  }
479
479
  ),
480
- /* @__PURE__ */ i.jsx(
480
+ /* @__PURE__ */ u.jsx(
481
481
  "button",
482
482
  {
483
- onClick: () => q(!I),
483
+ onClick: () => G(!X),
484
484
  style: {
485
- ...z,
486
- color: T.buttonActiveColor,
485
+ ...C,
486
+ color: w.buttonActiveColor,
487
487
  fontSize: "18px",
488
488
  width: "40px",
489
489
  minWidth: "40px",
490
490
  height: "40px",
491
- borderColor: `${T.buttonActiveColor}55`,
491
+ borderColor: `${w.buttonActiveColor}55`,
492
492
  borderRadius: "50%",
493
- paddingLeft: I ? "0" : "2px"
493
+ paddingLeft: X ? "0" : "2px"
494
494
  },
495
- onMouseEnter: (c) => S(c, !0),
496
- onMouseLeave: L,
497
- title: I ? s.pauseTooltip : X ? s.playFromRewindTooltip : s.playTooltip,
498
- children: I ? /* @__PURE__ */ i.jsx(yt, {}) : "▶"
495
+ onMouseEnter: (s) => O(s, !0),
496
+ onMouseLeave: j,
497
+ title: X ? A.pauseTooltip : B ? A.playFromRewindTooltip : A.playTooltip,
498
+ children: X ? /* @__PURE__ */ u.jsx(_t, {}) : "▶"
499
499
  }
500
500
  ),
501
- /* @__PURE__ */ i.jsx(
501
+ /* @__PURE__ */ u.jsx(
502
502
  "button",
503
503
  {
504
- onClick: Y,
505
- style: { ...W(Q), width: "64px", minWidth: "64px", gap: "3px" },
506
- onMouseEnter: (c) => S(c, Q),
507
- onMouseLeave: L,
508
- title: Q ? Ye(s.fastForwardActiveTooltip, ee) : s.fastForwardTooltip,
509
- children: Q ? /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
504
+ onClick: se,
505
+ style: { ...ee(oe), width: "64px", minWidth: "64px", gap: "3px" },
506
+ onMouseEnter: (s) => O(s, oe),
507
+ onMouseLeave: j,
508
+ title: oe ? Be(A.fastForwardActiveTooltip, ce) : A.fastForwardTooltip,
509
+ children: oe ? /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
510
510
  "▶▶",
511
- /* @__PURE__ */ i.jsxs("span", { style: { fontSize: "11px", fontWeight: "bold" }, children: [
512
- ee,
511
+ /* @__PURE__ */ u.jsxs("span", { style: { fontSize: "11px", fontWeight: "bold" }, children: [
512
+ ce,
513
513
  "×"
514
514
  ] })
515
515
  ] }) : "▶▶"
516
516
  }
517
517
  ),
518
- J && /* @__PURE__ */ i.jsx(
518
+ H && /* @__PURE__ */ u.jsx(
519
519
  "button",
520
520
  {
521
- onClick: N ? oe : void 0,
522
- disabled: !N,
523
- style: { ...W(!1), opacity: N ? 1 : 0.3, cursor: N ? "pointer" : "default" },
524
- onMouseEnter: N ? (c) => S(c, !1) : void 0,
525
- onMouseLeave: N ? L : void 0,
526
- title: N ? s.jumpToEndTooltip : s.noEndTimeTooltip,
521
+ onClick: $ ? Z : void 0,
522
+ disabled: !$,
523
+ style: { ...ee(!1), opacity: $ ? 1 : 0.3, cursor: $ ? "pointer" : "default" },
524
+ onMouseEnter: $ ? (s) => O(s, !1) : void 0,
525
+ onMouseLeave: $ ? j : void 0,
526
+ title: $ ? A.jumpToEndTooltip : A.noEndTimeTooltip,
527
527
  children: "⏭"
528
528
  }
529
529
  )
530
530
  ] }),
531
- !R && /* @__PURE__ */ i.jsx("div", { style: { display: "flex", justifyContent: "flex-end", alignItems: "center" }, children: M != null && g != null && /* @__PURE__ */ i.jsx(
531
+ !g && /* @__PURE__ */ u.jsx("div", { style: { display: "flex", justifyContent: "flex-end", alignItems: "center" }, children: Q != null && v != null && /* @__PURE__ */ u.jsx(
532
532
  "button",
533
533
  {
534
- onClick: M,
534
+ onClick: Q,
535
535
  style: {
536
- ...z,
537
- color: T.buttonActiveColor,
538
- borderColor: `${T.buttonActiveColor}33`
536
+ ...C,
537
+ color: w.buttonActiveColor,
538
+ borderColor: `${w.buttonActiveColor}33`
539
539
  },
540
- onMouseEnter: (c) => S(c, g),
541
- onMouseLeave: L,
542
- title: g ? s.collapseSwimLanesTooltip : s.expandSwimLanesTooltip,
543
- children: g ? /* @__PURE__ */ i.jsx(Ue, {}) : /* @__PURE__ */ i.jsx(qe, {})
540
+ onMouseEnter: (s) => O(s, v),
541
+ onMouseLeave: j,
542
+ title: v ? A.collapseSwimLanesTooltip : A.expandSwimLanesTooltip,
543
+ children: v ? /* @__PURE__ */ u.jsx(Ve, {}) : /* @__PURE__ */ u.jsx(Ke, {})
544
544
  }
545
545
  ) }),
546
- R && M != null && g != null && /* @__PURE__ */ i.jsx(
546
+ g && Q != null && v != null && /* @__PURE__ */ u.jsx(
547
547
  "button",
548
548
  {
549
- onClick: M,
549
+ onClick: Q,
550
550
  style: {
551
- ...z,
552
- color: T.buttonActiveColor,
553
- borderColor: `${T.buttonActiveColor}33`,
551
+ ...C,
552
+ color: w.buttonActiveColor,
553
+ borderColor: `${w.buttonActiveColor}33`,
554
554
  marginLeft: "4px"
555
555
  },
556
- onMouseEnter: (c) => S(c, g),
557
- onMouseLeave: L,
558
- title: g ? s.collapseSwimLanesTooltip : s.expandSwimLanesTooltip,
559
- children: g ? /* @__PURE__ */ i.jsx(Ue, {}) : /* @__PURE__ */ i.jsx(qe, {})
556
+ onMouseEnter: (s) => O(s, v),
557
+ onMouseLeave: j,
558
+ title: v ? A.collapseSwimLanesTooltip : A.expandSwimLanesTooltip,
559
+ children: v ? /* @__PURE__ */ u.jsx(Ve, {}) : /* @__PURE__ */ u.jsx(Ke, {})
560
560
  }
561
561
  )
562
562
  ]
563
563
  }
564
564
  );
565
- }, Ze = tt(
566
- (j, I) => {
565
+ }, et = st(
566
+ (F, X) => {
567
567
  const {
568
- currentTime: U,
569
- defaultStartMs: l,
570
- defaultEndMs: C,
571
- theme: A,
572
- maxTicks: O,
573
- timezone: N,
574
- dateTimeFormat: ae,
575
- months: J,
576
- onTimeChange: q,
577
- onDragStart: K,
578
- onDragEnd: G,
579
- swimLanes: Y,
580
- showSwimLanes: oe,
581
- onSwimLaneItemClick: se,
582
- onSwimLaneItemHover: Z,
583
- onSwimLaneItemDoubleClick: ce,
584
- onSwimLaneItemContextMenu: T,
585
- onSwimLaneReorder: g
586
- } = j, M = x(null), ne = x(A), X = x(O), Q = x(N), he = x(ae), ee = x(J), s = x(l), y = x(C), R = x(_.JulianDate.toDate(U).getTime());
587
- P(() => {
588
- ne.current = A;
589
- }, [A]), P(() => {
590
- X.current = O;
591
- }, [O]), P(() => {
592
- Q.current = N, m();
593
- }, [N]), P(() => {
594
- he.current = ae, m();
595
- }, [ae]), P(() => {
596
- ee.current = J, m();
597
- }, [J]);
598
- const k = x(Y ?? []), z = x(oe ?? (Y != null && Y.length > 0)), W = x(0), S = x(null), L = x(null), c = x(se), w = x(Z), ie = x(ce), t = x(T), u = x(g);
599
- P(() => {
600
- c.current = se;
601
- }, [se]), P(() => {
602
- w.current = Z;
603
- }, [Z]), P(() => {
604
- ie.current = ce;
605
- }, [ce]), P(() => {
606
- t.current = T;
607
- }, [T]), P(() => {
608
- u.current = g;
609
- }, [g]), P(() => {
610
- k.current = Y ?? [], m();
611
- }, [Y]), P(() => {
612
- z.current = oe ?? (Y != null && Y.length > 0), m();
613
- }, [oe, Y]);
614
- const v = x(null), E = x(null), de = x(!1), be = x(0), b = x("none"), re = x(0), pe = x(0), ye = x(0), xe = x("none"), Re = x(0), ve = x(0), B = x(0), De = x(0), Te = (e, n) => Math.hypot(n.clientX - e.clientX, n.clientY - e.clientY), me = le(() => ({
615
- startMs: s.current,
616
- endMs: y.current,
617
- currentMs: R.current,
618
- theme: ne.current,
619
- maxTicks: X.current,
620
- timezone: Q.current,
621
- use12h: /h/.test(he.current ?? ""),
622
- months: ee.current,
623
- swimLanes: k.current,
624
- showSwimLanes: z.current,
625
- scrollTop: W.current,
626
- reorderState: L.current
568
+ currentTime: K,
569
+ defaultStartMs: d,
570
+ defaultEndMs: _,
571
+ theme: S,
572
+ maxTicks: W,
573
+ timezone: $,
574
+ dateTimeFormat: de,
575
+ months: H,
576
+ onTimeChange: G,
577
+ onDragStart: U,
578
+ onDragEnd: I,
579
+ onRangeSelect: se,
580
+ swimLanes: Z,
581
+ showSwimLanes: ie,
582
+ onSwimLaneItemClick: te,
583
+ onSwimLaneItemHover: ue,
584
+ onSwimLaneItemDoubleClick: w,
585
+ onSwimLaneItemContextMenu: v,
586
+ onSwimLaneReorder: Q
587
+ } = F, M = x(null), B = x(S), oe = x(W), ge = x($), ce = x(de), A = x(H), p = x(d), g = x(_), L = x(D.JulianDate.toDate(K).getTime());
588
+ z(() => {
589
+ B.current = S;
590
+ }, [S]), z(() => {
591
+ oe.current = W;
592
+ }, [W]), z(() => {
593
+ ge.current = $, m();
594
+ }, [$]), z(() => {
595
+ ce.current = de, m();
596
+ }, [de]), z(() => {
597
+ A.current = H, m();
598
+ }, [H]);
599
+ const C = x(Z ?? []), ee = x(ie ?? (Z != null && Z.length > 0)), O = x(0), j = x(null), s = x(null), V = x(te), k = x(ue), t = x(w), f = x(v), b = x(Q);
600
+ z(() => {
601
+ V.current = te;
602
+ }, [te]), z(() => {
603
+ k.current = ue;
604
+ }, [ue]), z(() => {
605
+ t.current = w;
606
+ }, [w]), z(() => {
607
+ f.current = v;
608
+ }, [v]), z(() => {
609
+ b.current = Q;
610
+ }, [Q]), z(() => {
611
+ C.current = Z ?? [], m();
612
+ }, [Z]), z(() => {
613
+ ee.current = ie ?? (Z != null && Z.length > 0), m();
614
+ }, [ie, Z]);
615
+ const y = x(null), re = x(null), he = x(!1), J = x(0), E = x("none"), fe = x(0), Te = x(0), ke = x(0), Ce = x(0), Fe = x(0), xe = x(null), q = x(se);
616
+ z(() => {
617
+ q.current = se;
618
+ }, [se]);
619
+ const pe = x("none"), ve = x(0), ye = x(0), _e = x(0), je = x(0), Ie = (e, n) => Math.hypot(n.clientX - e.clientX, n.clientY - e.clientY), be = ae(() => ({
620
+ startMs: p.current,
621
+ endMs: g.current,
622
+ currentMs: L.current,
623
+ theme: B.current,
624
+ maxTicks: oe.current,
625
+ timezone: ge.current,
626
+ use12h: /h/.test(ce.current ?? ""),
627
+ months: A.current,
628
+ swimLanes: C.current,
629
+ showSwimLanes: ee.current,
630
+ scrollTop: O.current,
631
+ reorderState: s.current,
632
+ rangeSelection: xe.current
627
633
  }), []);
628
- nt(I, () => ({
629
- zoomTo(e, n, o) {
630
- const f = Math.max(pt, Math.min(mt, n - e)), r = (e + n) / 2;
631
- s.current = r - f / 2, y.current = r + f / 2, o !== void 0 && (R.current = o), m();
634
+ it(X, () => ({
635
+ zoomTo(e, n, r) {
636
+ const a = Math.max(vt, Math.min(bt, n - e)), o = (e + n) / 2;
637
+ p.current = o - a / 2, g.current = o + a / 2, r !== void 0 && (L.current = r), m();
632
638
  },
633
639
  getVisibleRange() {
634
- return { startMs: s.current, endMs: y.current };
640
+ return { startMs: p.current, endMs: g.current };
635
641
  },
636
642
  startFollow(e) {
637
- if (be.current = e, E.current !== null) return;
638
- de.current = !0;
643
+ if (J.current = e, re.current !== null) return;
644
+ he.current = !0;
639
645
  let n = performance.now();
640
- const o = () => {
641
- const f = performance.now(), r = f - n;
642
- n = f;
643
- const d = r * be.current;
644
- s.current += d, y.current += d, R.current += d, m(), E.current = requestAnimationFrame(o);
646
+ const r = () => {
647
+ const a = performance.now(), o = a - n;
648
+ n = a;
649
+ const c = o * J.current;
650
+ p.current += c, g.current += c, L.current += c, m(), re.current = requestAnimationFrame(r);
645
651
  };
646
- E.current = requestAnimationFrame(o);
652
+ re.current = requestAnimationFrame(r);
647
653
  },
648
654
  stopFollow() {
649
- de.current = !1, E.current !== null && (cancelAnimationFrame(E.current), E.current = null);
655
+ he.current = !1, re.current !== null && (cancelAnimationFrame(re.current), re.current = null);
650
656
  },
651
657
  correctFollow(e) {
652
- if (!de.current) return;
653
- const n = e - R.current;
654
- R.current = e, s.current += n, y.current += n;
658
+ if (!he.current) return;
659
+ const n = e - L.current;
660
+ L.current = e, p.current += n, g.current += n;
655
661
  },
656
662
  // ── Swim lane CRUD ──────────────────────────────────────────────
657
663
  appendSwimLane(e) {
658
- k.current = [...k.current, e], m();
664
+ C.current = [...C.current, e], m();
659
665
  },
660
666
  updateSwimLane(e, n) {
661
- k.current = k.current.map(
662
- (o) => o.id === e ? { ...o, ...n, id: o.id } : o
667
+ C.current = C.current.map(
668
+ (r) => r.id === e ? { ...r, ...n, id: r.id } : r
663
669
  ), m();
664
670
  },
665
671
  removeSwimLane(e) {
666
- k.current = k.current.filter((n) => n.id !== e), m();
672
+ C.current = C.current.filter((n) => n.id !== e), m();
667
673
  },
668
674
  reorderSwimLanes(e) {
669
- const n = new Map(k.current.map((f) => [f.id, f])), o = [];
670
- for (const f of e) {
671
- const r = n.get(f);
672
- r && o.push(r);
675
+ const n = new Map(C.current.map((a) => [a.id, a])), r = [];
676
+ for (const a of e) {
677
+ const o = n.get(a);
678
+ o && r.push(o);
673
679
  }
674
- k.current = o, m();
680
+ C.current = r, m();
675
681
  }
676
682
  }));
677
- const m = le(() => {
683
+ const m = ae(() => {
678
684
  const e = M.current;
679
685
  if (!e) return;
680
686
  const n = e.getContext("2d");
681
687
  if (!n) return;
682
- const o = e.getBoundingClientRect(), f = o.width, r = o.height;
683
- if (f === 0 || r === 0) return;
684
- const d = window.devicePixelRatio || 1, h = Math.round(f * d), p = Math.round(r * d);
685
- (e.width !== h || e.height !== p) && (e.width = h, e.height = p), n.save(), n.scale(d, d);
686
- const F = it(n, f, r, me());
687
- F !== W.current && (W.current = F), n.restore();
688
- }, [me]);
689
- rt(() => {
688
+ const r = e.getBoundingClientRect(), a = r.width, o = r.height;
689
+ if (a === 0 || o === 0) return;
690
+ const c = window.devicePixelRatio || 1, h = Math.round(a * c), l = Math.round(o * c);
691
+ (e.width !== h || e.height !== l) && (e.width = h, e.height = l), n.save(), n.scale(c, c);
692
+ const T = ft(n, a, o, be());
693
+ T !== O.current && (O.current = T), n.restore();
694
+ }, [be]);
695
+ ut(() => {
690
696
  m();
691
697
  const e = M.current;
692
698
  if (!e) return;
693
699
  const n = new ResizeObserver(() => m());
694
700
  return n.observe(e), () => n.disconnect();
695
- }, [m]), P(() => {
696
- if (de.current) return;
697
- const e = _.JulianDate.toDate(U).getTime();
698
- R.current !== e && (R.current = e, m());
699
- }, [U, m]);
700
- const we = le((e) => {
701
- if (v.current !== null) return;
701
+ }, [m]), z(() => {
702
+ if (he.current) return;
703
+ const e = D.JulianDate.toDate(K).getTime();
704
+ L.current !== e && (L.current = e, m());
705
+ }, [K, m]);
706
+ const we = ae((e) => {
707
+ if (y.current !== null) return;
702
708
  const n = () => {
703
- const o = M.current, f = y.current - s.current, r = e * f * 0.01;
704
- if (s.current += r, y.current += r, o) {
705
- const d = o.getBoundingClientRect(), h = Math.max(0, Math.min(d.width, pe.current - d.left)), p = s.current + h / d.width * (y.current - s.current);
706
- R.current = p, q(_.JulianDate.fromDate(new Date(p)));
709
+ const r = M.current, a = g.current - p.current, o = e * a * 0.01;
710
+ if (p.current += o, g.current += o, r) {
711
+ const c = r.getBoundingClientRect(), h = Math.max(0, Math.min(c.width, Te.current - c.left)), l = p.current + h / c.width * (g.current - p.current);
712
+ L.current = l, G(D.JulianDate.fromDate(new Date(l)));
707
713
  }
708
- m(), v.current = requestAnimationFrame(n);
714
+ m(), y.current = requestAnimationFrame(n);
709
715
  };
710
- v.current = requestAnimationFrame(n);
711
- }, [m, q]), Ee = le(() => {
712
- v.current !== null && (cancelAnimationFrame(v.current), v.current = null);
713
- }, []), fe = le((e, n, o, f) => ut(e, n, o, f, me()), [me]), Ce = le((e, n, o) => lt(e, n, o, me()), [me]), Me = le((e, n) => at(e, n, me()), [me]), Ie = le((e) => {
716
+ y.current = requestAnimationFrame(n);
717
+ }, [m, G]), Me = ae(() => {
718
+ y.current !== null && (cancelAnimationFrame(y.current), y.current = null);
719
+ }, []), i = ae((e, n, r, a) => pt(e, n, r, a, be()), [be]), R = ae((e, n, r) => mt(e, n, r, be()), [be]), P = ae((e, n) => ht(e, n, be()), [be]), le = ae((e) => {
714
720
  e.preventDefault();
715
- const n = e.currentTarget.getBoundingClientRect(), o = e.clientX - n.left, f = e.clientY - n.top;
716
- if (e.button === 0 && u.current) {
717
- const r = Ce(o, f, n.height);
718
- if (r) {
719
- const h = k.current.findIndex((p) => p.id === r.id);
720
- L.current = {
721
+ const n = e.currentTarget.getBoundingClientRect(), r = e.clientX - n.left, a = e.clientY - n.top;
722
+ if (e.button === 0 && b.current) {
723
+ const o = R(r, a, n.height);
724
+ if (o) {
725
+ const h = C.current.findIndex((l) => l.id === o.id);
726
+ s.current = {
721
727
  dragging: !0,
722
- dragLaneId: r.id,
728
+ dragLaneId: o.id,
723
729
  dragStartY: e.clientY,
724
730
  currentY: e.clientY,
725
731
  insertIndex: h
@@ -727,516 +733,547 @@ const Mt = 520, yt = () => /* @__PURE__ */ i.jsxs("svg", { width: "14", height:
727
733
  return;
728
734
  }
729
735
  }
730
- if (e.button === 0 && Me(f, n.height)) {
731
- const r = (R.current - s.current) / (y.current - s.current) * n.width;
732
- if (!(Math.abs(o - r) <= 10) && fe(o, f, n.width, n.height)) {
733
- ye.current = performance.now();
736
+ if (e.button === 0 && P(a, n.height)) {
737
+ const o = (L.current - p.current) / (g.current - p.current) * n.width;
738
+ if (!(Math.abs(r - o) <= 10) && i(r, a, n.width, n.height)) {
739
+ ke.current = performance.now();
734
740
  return;
735
741
  }
736
742
  }
737
743
  if (e.button === 0) {
738
- b.current = "scrub", pe.current = e.clientX, e.currentTarget.style.cursor = "grabbing", K == null || K();
739
- const r = s.current + o / n.width * (y.current - s.current);
740
- R.current = r, m(), q(_.JulianDate.fromDate(new Date(r)));
744
+ const o = (L.current - p.current) / (g.current - p.current) * n.width, c = Math.abs(r - o) <= 10, h = a >= n.height - Oe;
745
+ if (!c && h)
746
+ E.current = "rangeSelectPending", Fe.current = r, Ce.current = p.current + r / n.width * (g.current - p.current), e.currentTarget.style.cursor = "crosshair", U == null || U();
747
+ else {
748
+ E.current = "scrub", Te.current = e.clientX, e.currentTarget.style.cursor = "grabbing", U == null || U();
749
+ const l = p.current + r / n.width * (g.current - p.current);
750
+ L.current = l, m(), G(D.JulianDate.fromDate(new Date(l)));
751
+ }
741
752
  } else if (e.button === 1)
742
- b.current = "slide", re.current = e.clientX;
753
+ E.current = "slide", fe.current = e.clientX;
743
754
  else if (e.button === 2) {
744
- if (t.current && Me(f, n.height))
755
+ if (f.current && P(a, n.height))
745
756
  return;
746
- b.current = "zoom", re.current = e.clientX;
757
+ E.current = "zoom", fe.current = e.clientX;
747
758
  }
748
- }, [m, q, K, Ce, Me, fe]);
749
- P(() => {
750
- const e = (o) => {
751
- const f = L.current;
752
- if (f && f.dragging) {
753
- f.currentY = o.clientY;
754
- const p = M.current;
755
- if (p) {
756
- const F = p.getBoundingClientRect(), V = o.clientY - F.top;
757
- let Le = -W.current;
758
- const Oe = k.current;
759
- let Pe = Oe.length;
760
- for (let ke = 0; ke < Oe.length; ke++) {
761
- const Ne = Oe[ke].height ?? ze, Qe = Le + Ne / 2;
762
- if (V < Qe) {
763
- Pe = ke;
759
+ }, [m, G, U, R, P, i]);
760
+ z(() => {
761
+ const e = (r) => {
762
+ const a = s.current;
763
+ if (a && a.dragging) {
764
+ a.currentY = r.clientY;
765
+ const l = M.current;
766
+ if (l) {
767
+ const T = l.getBoundingClientRect(), Y = r.clientY - T.top;
768
+ let Re = -O.current;
769
+ const Je = C.current;
770
+ let Ye = Je.length;
771
+ for (let Pe = 0; Pe < Je.length; Pe++) {
772
+ const ze = Je[Pe].height ?? $e, ot = Re + ze / 2;
773
+ if (Y < ot) {
774
+ Ye = Pe;
764
775
  break;
765
776
  }
766
- Le += Ne + We;
777
+ Re += ze + He;
767
778
  }
768
- f.insertIndex = Pe;
779
+ a.insertIndex = Ye;
769
780
  }
770
781
  m();
771
782
  return;
772
783
  }
773
- if (b.current === "none") return;
774
- const r = M.current;
775
- if (!r) return;
776
- const d = r.getBoundingClientRect(), h = d.width;
777
- if (b.current === "scrub") {
778
- pe.current = o.clientX;
779
- const p = o.clientX - d.left, F = h * 0.08;
780
- p < F ? we(-1) : p > h - F ? we(1) : Ee();
781
- const V = Math.max(0, Math.min(h, p)), ge = s.current + V / h * (y.current - s.current);
782
- R.current = ge, m(), q(_.JulianDate.fromDate(new Date(ge)));
783
- } else if (b.current === "slide") {
784
- const p = re.current - o.clientX;
785
- if (re.current = o.clientX, p !== 0) {
786
- const F = p / h * (y.current - s.current);
787
- s.current += F, y.current += F, m();
784
+ if (E.current === "none") return;
785
+ const o = M.current;
786
+ if (!o) return;
787
+ const c = o.getBoundingClientRect(), h = c.width;
788
+ if (E.current === "scrub") {
789
+ Te.current = r.clientX;
790
+ const l = r.clientX - c.left, T = h * 0.08;
791
+ l < T ? we(-1) : l > h - T ? we(1) : Me();
792
+ const Y = Math.max(0, Math.min(h, l)), me = p.current + Y / h * (g.current - p.current);
793
+ L.current = me, m(), G(D.JulianDate.fromDate(new Date(me)));
794
+ } else if (E.current === "rangeSelectPending" || E.current === "rangeSelect") {
795
+ const l = r.clientX - c.left, T = Math.abs(l - Fe.current);
796
+ if (E.current === "rangeSelectPending" && T >= 3 && (E.current = "rangeSelect"), E.current === "rangeSelect") {
797
+ const Y = Math.max(0, Math.min(h, l)), me = p.current + Y / h * (g.current - p.current);
798
+ xe.current = {
799
+ startMs: Ce.current,
800
+ endMs: me
801
+ }, m();
788
802
  }
789
- } else if (b.current === "zoom") {
790
- const p = re.current - o.clientX;
791
- re.current = o.clientX, p !== 0 && a(Math.pow(1.01, p));
803
+ } else if (E.current === "slide") {
804
+ const l = fe.current - r.clientX;
805
+ if (fe.current = r.clientX, l !== 0) {
806
+ const T = l / h * (g.current - p.current);
807
+ p.current += T, g.current += T, m();
808
+ }
809
+ } else if (E.current === "zoom") {
810
+ const l = fe.current - r.clientX;
811
+ fe.current = r.clientX, l !== 0 && N(Math.pow(1.01, l));
792
812
  }
793
813
  }, n = () => {
794
- var f;
795
- const o = L.current;
796
- if (o && o.dragging) {
797
- const r = Math.abs(o.currentY - o.dragStartY), d = k.current, h = d.findIndex((p) => p.id === o.dragLaneId);
798
- if (r > 5 && h >= 0 && o.insertIndex !== h && o.insertIndex !== h + 1) {
799
- const p = [...d], [F] = p.splice(h, 1), V = o.insertIndex > h ? o.insertIndex - 1 : o.insertIndex;
800
- p.splice(V, 0, F), k.current = p, (f = u.current) == null || f.call(u, p.map((ge) => ge.id));
814
+ var a, o;
815
+ const r = s.current;
816
+ if (r && r.dragging) {
817
+ const c = Math.abs(r.currentY - r.dragStartY), h = C.current, l = h.findIndex((T) => T.id === r.dragLaneId);
818
+ if (c > 5 && l >= 0 && r.insertIndex !== l && r.insertIndex !== l + 1) {
819
+ const T = [...h], [Y] = T.splice(l, 1), me = r.insertIndex > l ? r.insertIndex - 1 : r.insertIndex;
820
+ T.splice(me, 0, Y), C.current = T, (a = b.current) == null || a.call(b, T.map((Re) => Re.id));
821
+ }
822
+ s.current = null, M.current && (M.current.style.cursor = "default"), m();
823
+ return;
824
+ }
825
+ if (Me(), E.current === "rangeSelectPending") {
826
+ L.current = Ce.current, xe.current = null, E.current = "none", M.current && (M.current.style.cursor = "default"), m(), G(D.JulianDate.fromDate(new Date(Ce.current))), I == null || I();
827
+ return;
828
+ }
829
+ if (E.current === "rangeSelect") {
830
+ const c = xe.current;
831
+ if (xe.current = null, c) {
832
+ const h = Math.min(c.startMs, c.endMs), l = Math.max(c.startMs, c.endMs);
833
+ p.current = h, g.current = l;
834
+ const T = D.JulianDate.fromDate(new Date(h)), Y = D.JulianDate.fromDate(new Date(l));
835
+ (o = q.current) == null || o.call(q, T, Y);
801
836
  }
802
- L.current = null, M.current && (M.current.style.cursor = "default"), m();
837
+ E.current = "none", M.current && (M.current.style.cursor = "default"), m(), I == null || I();
803
838
  return;
804
839
  }
805
- Ee(), b.current = "none", M.current && (M.current.style.cursor = "default"), G == null || G();
840
+ E.current = "none", M.current && (M.current.style.cursor = "default"), I == null || I();
806
841
  };
807
842
  return document.addEventListener("mousemove", e), document.addEventListener("mouseup", n), () => {
808
843
  document.removeEventListener("mousemove", e), document.removeEventListener("mouseup", n);
809
844
  };
810
- }, [m, q, G, we, Ee]);
811
- const a = le((e) => {
812
- const n = dt(s.current, y.current, e);
813
- s.current = n.startMs, y.current = n.endMs, m();
814
- }, [m]), D = le((e) => {
845
+ }, [m, G, I, we, Me]);
846
+ const N = ae((e) => {
847
+ const n = gt(p.current, g.current, e);
848
+ p.current = n.startMs, g.current = n.endMs, m();
849
+ }, [m]), ne = ae((e) => {
815
850
  e.preventDefault();
816
851
  const n = M.current;
817
852
  if (!n) return;
818
- const o = n.getBoundingClientRect(), f = e.clientY - o.top, r = z.current, d = k.current;
819
- if (r && d.length > 0) {
820
- const h = Math.max(0, o.height - Ke);
821
- if (f >= 0 && f < h) {
822
- let p = 0;
823
- for (const V of d) p += (V.height ?? ze) + We;
824
- const F = Math.max(0, p - h);
825
- if (F > 0) {
826
- W.current = Math.max(0, Math.min(F, W.current + e.deltaY * ft)), m();
853
+ const r = n.getBoundingClientRect(), a = e.clientY - r.top, o = ee.current, c = C.current;
854
+ if (o && c.length > 0) {
855
+ const h = Math.max(0, r.height - Oe);
856
+ if (a >= 0 && a < h) {
857
+ let l = 0;
858
+ for (const Y of c) l += (Y.height ?? $e) + He;
859
+ const T = Math.max(0, l - h);
860
+ if (T > 0) {
861
+ O.current = Math.max(0, Math.min(T, O.current + e.deltaY * xt)), m();
827
862
  return;
828
863
  }
829
864
  }
830
865
  }
831
- a(Math.pow(1.05, e.deltaY > 0 ? -1 : 1));
832
- }, [a, m]);
833
- P(() => {
866
+ N(Math.pow(1.05, e.deltaY > 0 ? -1 : 1));
867
+ }, [N, m]);
868
+ z(() => {
834
869
  const e = M.current;
835
870
  if (e)
836
- return e.addEventListener("wheel", D, { passive: !1 }), () => e.removeEventListener("wheel", D);
837
- }, [D]), P(() => {
871
+ return e.addEventListener("wheel", ne, { passive: !1 }), () => e.removeEventListener("wheel", ne);
872
+ }, [ne]), z(() => {
838
873
  const e = M.current;
839
874
  if (!e) return;
840
- const n = (r) => {
841
- r.preventDefault();
842
- const d = e.getBoundingClientRect();
843
- if (r.touches.length === 1) {
844
- const h = r.touches[0].clientX - d.left, p = Math.max(0, Math.min(d.width, h)), F = s.current + p / d.width * (y.current - s.current);
845
- De.current = R.current, xe.current = "scrub", Re.current = r.touches[0].clientX, pe.current = r.touches[0].clientX, R.current = F, m(), K == null || K(), q(_.JulianDate.fromDate(new Date(F)));
846
- } else r.touches.length >= 2 && (xe.current === "scrub" && (R.current = De.current, m(), q(_.JulianDate.fromDate(new Date(De.current)))), xe.current = "pinch", ve.current = Te(r.touches[0], r.touches[1]), B.current = (r.touches[0].clientX + r.touches[1].clientX) / 2 - d.left);
847
- }, o = (r) => {
848
- r.preventDefault();
849
- const d = e.getBoundingClientRect();
850
- if (xe.current === "scrub" && r.touches.length >= 1) {
851
- const h = r.touches[0].clientX - d.left, p = d.width * 0.08;
852
- if (pe.current = r.touches[0].clientX, h < p) we(-1);
853
- else if (h > d.width - p) we(1);
875
+ const n = (o) => {
876
+ o.preventDefault();
877
+ const c = e.getBoundingClientRect();
878
+ if (o.touches.length === 1) {
879
+ const h = o.touches[0].clientX - c.left, l = Math.max(0, Math.min(c.width, h)), T = p.current + l / c.width * (g.current - p.current);
880
+ je.current = L.current, pe.current = "scrub", ve.current = o.touches[0].clientX, Te.current = o.touches[0].clientX, L.current = T, m(), U == null || U(), G(D.JulianDate.fromDate(new Date(T)));
881
+ } else o.touches.length >= 2 && (pe.current === "scrub" && (L.current = je.current, m(), G(D.JulianDate.fromDate(new Date(je.current)))), pe.current = "pinch", ye.current = Ie(o.touches[0], o.touches[1]), _e.current = (o.touches[0].clientX + o.touches[1].clientX) / 2 - c.left);
882
+ }, r = (o) => {
883
+ o.preventDefault();
884
+ const c = e.getBoundingClientRect();
885
+ if (pe.current === "scrub" && o.touches.length >= 1) {
886
+ const h = o.touches[0].clientX - c.left, l = c.width * 0.08;
887
+ if (Te.current = o.touches[0].clientX, h < l) we(-1);
888
+ else if (h > c.width - l) we(1);
854
889
  else {
855
- Ee();
856
- const F = Math.max(0, Math.min(d.width, h)), V = s.current + F / d.width * (y.current - s.current);
857
- R.current = V, m(), q(_.JulianDate.fromDate(new Date(V)));
890
+ Me();
891
+ const T = Math.max(0, Math.min(c.width, h)), Y = p.current + T / c.width * (g.current - p.current);
892
+ L.current = Y, m(), G(D.JulianDate.fromDate(new Date(Y)));
858
893
  }
859
- } else if (xe.current === "slide" && r.touches.length >= 1) {
860
- const h = Re.current - r.touches[0].clientX;
861
- if (Re.current = r.touches[0].clientX, h !== 0) {
862
- const p = h / d.width * (y.current - s.current);
863
- s.current += p, y.current += p, m();
894
+ } else if (pe.current === "slide" && o.touches.length >= 1) {
895
+ const h = ve.current - o.touches[0].clientX;
896
+ if (ve.current = o.touches[0].clientX, h !== 0) {
897
+ const l = h / c.width * (g.current - p.current);
898
+ p.current += l, g.current += l, m();
864
899
  }
865
- } else if (xe.current === "pinch" && r.touches.length >= 2) {
866
- const h = Te(r.touches[0], r.touches[1]), p = (r.touches[0].clientX + r.touches[1].clientX) / 2 - d.left;
867
- if (h > 0 && ve.current > 0) {
868
- const F = s.current + B.current / d.width * (y.current - s.current), V = ht(s.current, y.current, ve.current / h, F);
869
- s.current = V.startMs, y.current = V.endMs, m();
900
+ } else if (pe.current === "pinch" && o.touches.length >= 2) {
901
+ const h = Ie(o.touches[0], o.touches[1]), l = (o.touches[0].clientX + o.touches[1].clientX) / 2 - c.left;
902
+ if (h > 0 && ye.current > 0) {
903
+ const T = p.current + _e.current / c.width * (g.current - p.current), Y = Tt(p.current, g.current, ye.current / h, T);
904
+ p.current = Y.startMs, g.current = Y.endMs, m();
870
905
  }
871
- ve.current = h, B.current = p;
906
+ ye.current = h, _e.current = l;
872
907
  }
873
- }, f = (r) => {
874
- Ee(), xe.current === "scrub" && (G == null || G()), r.touches.length === 0 ? xe.current = "none" : r.touches.length === 1 && (xe.current = "slide", Re.current = r.touches[0].clientX);
908
+ }, a = (o) => {
909
+ Me(), pe.current === "scrub" && (I == null || I()), o.touches.length === 0 ? pe.current = "none" : o.touches.length === 1 && (pe.current = "slide", ve.current = o.touches[0].clientX);
875
910
  };
876
- return e.addEventListener("touchstart", n, { passive: !1 }), e.addEventListener("touchmove", o, { passive: !1 }), e.addEventListener("touchend", f, { passive: !1 }), () => {
877
- e.removeEventListener("touchstart", n), e.removeEventListener("touchmove", o), e.removeEventListener("touchend", f);
911
+ return e.addEventListener("touchstart", n, { passive: !1 }), e.addEventListener("touchmove", r, { passive: !1 }), e.addEventListener("touchend", a, { passive: !1 }), () => {
912
+ e.removeEventListener("touchstart", n), e.removeEventListener("touchmove", r), e.removeEventListener("touchend", a);
878
913
  };
879
- }, [m, K, G, q, a, we, Ee]);
880
- const $ = le((e) => {
881
- var h, p, F;
882
- if (b.current !== "none") return;
883
- const n = e.currentTarget.getBoundingClientRect(), o = e.clientX - n.left, f = e.clientY - n.top, r = (R.current - s.current) / (y.current - s.current) * n.width, d = Math.abs(o - r) <= 10;
884
- if (Me(f, n.height)) {
885
- const V = fe(o, f, n.width, n.height), ge = S.current;
886
- if (V)
887
- e.currentTarget.style.cursor = d ? "grab" : "pointer", (!ge || ge.item.id !== V.item.id || ge.lane.id !== V.lane.id) && (S.current = V, (h = w.current) == null || h.call(w, { laneId: V.lane.id, item: V.item, originalEvent: e.nativeEvent }), m());
888
- else if (ge && (S.current = null, (p = w.current) == null || p.call(w, null), m()), d)
914
+ }, [m, U, I, G, N, we, Me]);
915
+ const Ee = ae((e) => {
916
+ var h, l, T;
917
+ if (E.current !== "none") return;
918
+ const n = e.currentTarget.getBoundingClientRect(), r = e.clientX - n.left, a = e.clientY - n.top, o = (L.current - p.current) / (g.current - p.current) * n.width, c = Math.abs(r - o) <= 10;
919
+ if (P(a, n.height)) {
920
+ const Y = i(r, a, n.width, n.height), me = j.current;
921
+ if (Y)
922
+ e.currentTarget.style.cursor = c ? "grab" : "pointer", (!me || me.item.id !== Y.item.id || me.lane.id !== Y.lane.id) && (j.current = Y, (h = k.current) == null || h.call(k, { laneId: Y.lane.id, item: Y.item, originalEvent: e.nativeEvent }), m());
923
+ else if (me && (j.current = null, (l = k.current) == null || l.call(k, null), m()), c)
889
924
  e.currentTarget.style.cursor = "grab";
890
925
  else {
891
- const Le = Ce(o, f, n.height);
892
- e.currentTarget.style.cursor = Le && u.current ? "grab" : "default";
926
+ const Re = R(r, a, n.height);
927
+ e.currentTarget.style.cursor = Re && b.current ? "grab" : "default";
893
928
  }
894
929
  return;
895
930
  }
896
- S.current && (S.current = null, (F = w.current) == null || F.call(w, null), m()), e.currentTarget.style.cursor = d ? "grab" : "default";
897
- }, [m, fe, Me, Ce]), ue = le((e) => {
931
+ j.current && (j.current = null, (T = k.current) == null || T.call(k, null), m()), c ? e.currentTarget.style.cursor = "grab" : a >= n.height - Oe ? e.currentTarget.style.cursor = "crosshair" : e.currentTarget.style.cursor = "default";
932
+ }, [m, i, P, R]), tt = ae((e) => {
898
933
  var h;
899
- if (performance.now() - ye.current > 300) return;
900
- const o = e.currentTarget.getBoundingClientRect(), f = e.clientX - o.left, r = e.clientY - o.top, d = fe(f, r, o.width, o.height);
901
- d && ((h = c.current) == null || h.call(c, { laneId: d.lane.id, item: d.item, originalEvent: e.nativeEvent }));
902
- }, [fe]), H = le((e) => {
903
- var d;
904
- const n = e.currentTarget.getBoundingClientRect(), o = e.clientX - n.left, f = e.clientY - n.top, r = fe(o, f, n.width, n.height);
905
- r && ((d = ie.current) == null || d.call(ie, { laneId: r.lane.id, item: r.item, originalEvent: e.nativeEvent }));
906
- }, [fe]), te = le((e) => {
907
- const n = e.currentTarget.getBoundingClientRect(), o = e.clientX - n.left, f = e.clientY - n.top, r = fe(o, f, n.width, n.height);
908
- r && t.current ? (e.preventDefault(), t.current({ laneId: r.lane.id, item: r.item, originalEvent: e.nativeEvent })) : e.preventDefault();
909
- }, [fe]);
910
- return P(() => () => {
911
- v.current !== null && cancelAnimationFrame(v.current), E.current !== null && cancelAnimationFrame(E.current);
912
- }, []), /* @__PURE__ */ i.jsx(
934
+ if (performance.now() - ke.current > 300) return;
935
+ const r = e.currentTarget.getBoundingClientRect(), a = e.clientX - r.left, o = e.clientY - r.top, c = i(a, o, r.width, r.height);
936
+ c && ((h = V.current) == null || h.call(V, { laneId: c.lane.id, item: c.item, originalEvent: e.nativeEvent }));
937
+ }, [i]), nt = ae((e) => {
938
+ var c;
939
+ const n = e.currentTarget.getBoundingClientRect(), r = e.clientX - n.left, a = e.clientY - n.top, o = i(r, a, n.width, n.height);
940
+ o && ((c = t.current) == null || c.call(t, { laneId: o.lane.id, item: o.item, originalEvent: e.nativeEvent }));
941
+ }, [i]), rt = ae((e) => {
942
+ const n = e.currentTarget.getBoundingClientRect(), r = e.clientX - n.left, a = e.clientY - n.top, o = i(r, a, n.width, n.height);
943
+ o && f.current ? (e.preventDefault(), f.current({ laneId: o.lane.id, item: o.item, originalEvent: e.nativeEvent })) : e.preventDefault();
944
+ }, [i]);
945
+ return z(() => () => {
946
+ y.current !== null && cancelAnimationFrame(y.current), re.current !== null && cancelAnimationFrame(re.current);
947
+ }, []), /* @__PURE__ */ u.jsx(
913
948
  "canvas",
914
949
  {
915
950
  ref: M,
916
951
  style: { width: "100%", flex: 1, minHeight: 0, display: "block", cursor: "default" },
917
- onMouseDown: Ie,
918
- onMouseMove: $,
919
- onClick: ue,
920
- onDoubleClick: H,
952
+ onMouseDown: le,
953
+ onMouseMove: Ee,
954
+ onClick: tt,
955
+ onDoubleClick: nt,
921
956
  onMouseLeave: () => {
922
957
  var e;
923
- S.current && (S.current = null, (e = w.current) == null || e.call(w, null), m()), b.current === "none" && M.current && (M.current.style.cursor = "default");
958
+ j.current && (j.current = null, (e = k.current) == null || e.call(k, null), m()), E.current === "none" && M.current && (M.current.style.cursor = "default");
924
959
  },
925
- onContextMenu: te
960
+ onContextMenu: rt
926
961
  }
927
962
  );
928
963
  }
929
964
  );
930
- Ze.displayName = "TimelineCanvas";
931
- const Ge = [2, 4, 8, 16, 32, 100, 1], Ve = [1, 2, 4, 8, 16, 32, 100], At = ({
932
- startTime: j,
933
- endTime: I,
934
- currentTime: U,
935
- clock: l,
936
- onTimeChange: C,
937
- onPlayPause: A,
938
- onMultiplierChange: O,
939
- height: N,
940
- showControls: ae = !0,
941
- showJumpToStart: J,
942
- showJumpToEnd: q,
943
- enableDrag: K = !0,
944
- dateTimeFormat: G,
945
- onDateTimeClick: Y,
946
- jumpToTime: oe,
947
- maxTicks: se,
948
- ffSpeeds: Z = Ge,
949
- rwSpeeds: ce = Ve,
950
- theme: T,
951
- className: g,
952
- timezone: M,
953
- swimLanes: ne,
954
- showSwimLanes: X,
955
- onShowSwimLanesChange: Q,
956
- swimLaneTransition: he = "animated",
957
- onSwimLaneItemClick: ee,
958
- onSwimLaneItemHover: s,
959
- onSwimLaneItemDoubleClick: y,
960
- onSwimLaneItemContextMenu: R,
961
- onSwimLaneReorder: k,
962
- labels: z
965
+ et.displayName = "TimelineCanvas";
966
+ const Ze = [2, 4, 8, 16, 32, 100, 1], Qe = [1, 2, 4, 8, 16, 32, 100], kt = ({
967
+ startTime: F,
968
+ endTime: X,
969
+ currentTime: K,
970
+ clock: d,
971
+ onTimeChange: _,
972
+ onPlayPause: S,
973
+ onMultiplierChange: W,
974
+ height: $,
975
+ showControls: de = !0,
976
+ showJumpToStart: H,
977
+ showJumpToEnd: G,
978
+ enableDrag: U = !0,
979
+ dateTimeFormat: I,
980
+ onDateTimeClick: se,
981
+ jumpToTime: Z,
982
+ maxTicks: ie,
983
+ ffSpeeds: te = Ze,
984
+ rwSpeeds: ue = Qe,
985
+ theme: w,
986
+ className: v,
987
+ timezone: Q,
988
+ swimLanes: M,
989
+ showSwimLanes: B,
990
+ onShowSwimLanesChange: oe,
991
+ swimLaneTransition: ge = "animated",
992
+ onSwimLaneItemClick: ce,
993
+ onSwimLaneItemHover: A,
994
+ onSwimLaneItemDoubleClick: p,
995
+ onSwimLaneItemContextMenu: g,
996
+ onSwimLaneReorder: L,
997
+ onRangeSelect: C,
998
+ labels: ee
963
999
  }) => {
964
- const W = () => Date.now(), S = j ? _.JulianDate.toDate(Ae(j)).getTime() : W() - 432e5, L = I ? _.JulianDate.toDate(Ae(I)).getTime() : W() + 12 * 3600 * 1e3, [c, w] = _e(
965
- () => Ae(U ?? j ?? _.JulianDate.fromDate(/* @__PURE__ */ new Date()))
966
- ), [ie, t] = _e((l == null ? void 0 : l.shouldAnimate) ?? !1), [u, v] = _e((l == null ? void 0 : l.multiplier) ?? 1), [E, de] = _e(X ?? !0);
967
- P(() => {
968
- X != null && de(X);
969
- }, [X]);
970
- const be = () => {
971
- const a = !E;
972
- de(a), Q == null || Q(a);
973
- }, b = ne != null && ne.length > 0, re = x(null), [pe, ye] = _e(0);
974
- P(() => {
975
- const a = re.current;
976
- if (!a) return;
977
- const D = new ResizeObserver(([$]) => ye($.borderBoxSize[0].blockSize));
978
- return D.observe(a), () => D.disconnect();
979
- }, [ae]);
980
- const Re = b && !E ? `${pe + Ke}px` : N != null ? `${N}px` : "100%", ve = x(!1), B = x(null), De = { ...xt, ...T };
981
- P(() => {
982
- if (!l) return;
983
- const a = () => {
984
- if (!ve.current) {
985
- const D = _.JulianDate.clone(l.currentTime);
986
- if (w(D), t(l.shouldAnimate), v(l.multiplier), B.current) {
987
- const { startMs: $, endMs: ue } = B.current.getVisibleRange(), H = ue - $, te = _.JulianDate.toDate(D).getTime(), e = te - $;
988
- e <= H * 0.1 ? B.current.zoomTo(te - H * 0.1, te + H * 0.9, te) : e >= H * 0.9 && B.current.zoomTo(te - H * 0.9, te + H * 0.1, te);
1000
+ const O = () => Date.now(), j = F ? D.JulianDate.toDate(De(F)).getTime() : O() - 432e5, s = X ? D.JulianDate.toDate(De(X)).getTime() : O() + 12 * 3600 * 1e3, [V, k] = Ae(
1001
+ () => De(K ?? F ?? D.JulianDate.fromDate(/* @__PURE__ */ new Date()))
1002
+ ), [t, f] = Ae((d == null ? void 0 : d.shouldAnimate) ?? !1), [b, y] = Ae((d == null ? void 0 : d.multiplier) ?? 1), [re, he] = Ae(B ?? !0);
1003
+ z(() => {
1004
+ B != null && he(B);
1005
+ }, [B]);
1006
+ const J = () => {
1007
+ const i = !re;
1008
+ he(i), oe == null || oe(i);
1009
+ }, E = M != null && M.length > 0, fe = x(null), [Te, ke] = Ae(0);
1010
+ z(() => {
1011
+ const i = fe.current;
1012
+ if (!i) return;
1013
+ const R = new ResizeObserver(([P]) => ke(P.borderBoxSize[0].blockSize));
1014
+ return R.observe(i), () => R.disconnect();
1015
+ }, [de]);
1016
+ const Fe = E && !re ? `${Te + Oe}px` : $ != null ? `${$}px` : "100%", xe = x(!1), q = x(null), pe = { ...wt, ...w };
1017
+ z(() => {
1018
+ if (!d) return;
1019
+ const i = () => {
1020
+ if (!xe.current) {
1021
+ const R = D.JulianDate.clone(d.currentTime);
1022
+ if (k(R), f(d.shouldAnimate), y(d.multiplier), q.current) {
1023
+ const { startMs: P, endMs: le } = q.current.getVisibleRange(), N = le - P, ne = D.JulianDate.toDate(R).getTime(), Ee = ne - P;
1024
+ Ee <= N * 0.1 ? q.current.zoomTo(ne - N * 0.1, ne + N * 0.9, ne) : Ee >= N * 0.9 && q.current.zoomTo(ne - N * 0.9, ne + N * 0.1, ne);
989
1025
  }
990
1026
  }
991
1027
  };
992
- return l.onTick.addEventListener(a), () => {
993
- l.onTick.removeEventListener(a);
1028
+ return d.onTick.addEventListener(i), () => {
1029
+ d.onTick.removeEventListener(i);
994
1030
  };
995
- }, [l]), P(() => {
996
- if (l) return;
997
- const a = setInterval(() => {
998
- if (ve.current) return;
999
- const D = _.JulianDate.fromDate(/* @__PURE__ */ new Date());
1000
- if (w(D), B.current) {
1001
- const { startMs: $, endMs: ue } = B.current.getVisibleRange(), H = ue - $, te = _.JulianDate.toDate(D).getTime(), e = te - $;
1002
- e <= H * 0.1 ? B.current.zoomTo(te - H * 0.1, te + H * 0.9, te) : e >= H * 0.9 && B.current.zoomTo(te - H * 0.9, te + H * 0.1, te);
1031
+ }, [d]), z(() => {
1032
+ if (d) return;
1033
+ const i = setInterval(() => {
1034
+ if (xe.current) return;
1035
+ const R = D.JulianDate.fromDate(/* @__PURE__ */ new Date());
1036
+ if (k(R), q.current) {
1037
+ const { startMs: P, endMs: le } = q.current.getVisibleRange(), N = le - P, ne = D.JulianDate.toDate(R).getTime(), Ee = ne - P;
1038
+ Ee <= N * 0.1 ? q.current.zoomTo(ne - N * 0.1, ne + N * 0.9, ne) : Ee >= N * 0.9 && q.current.zoomTo(ne - N * 0.9, ne + N * 0.1, ne);
1003
1039
  }
1004
1040
  }, 1e3);
1005
- return () => clearInterval(a);
1006
- }, [l]), P(() => {
1007
- if (!oe) return;
1008
- const a = Ae(oe);
1009
- if (me(a), B.current) {
1010
- const { startMs: D, endMs: $ } = B.current.getVisibleRange(), ue = $ - D, H = _.JulianDate.toDate(a).getTime();
1011
- B.current.zoomTo(H - ue / 2, H + ue / 2);
1041
+ return () => clearInterval(i);
1042
+ }, [d]), z(() => {
1043
+ if (!Z) return;
1044
+ const i = De(Z);
1045
+ if (ye(i), q.current) {
1046
+ const { startMs: R, endMs: P } = q.current.getVisibleRange(), le = P - R, N = D.JulianDate.toDate(i).getTime();
1047
+ q.current.zoomTo(N - le / 2, N + le / 2);
1012
1048
  }
1013
- }, [oe]);
1014
- const Te = (a, D = !0) => {
1015
- l && (l.multiplier = a, D && (l.shouldAnimate = !0)), v(a), D && t(!0), O == null || O(a);
1016
- }, me = (a) => {
1017
- w(a), l && (l.currentTime = _.JulianDate.clone(a)), C == null || C(a);
1018
- }, m = (a) => {
1019
- a && u < 0 && Te(1, !1), l && (l.shouldAnimate = a), t(a), A == null || A(a);
1049
+ }, [Z]);
1050
+ const ve = (i, R = !0) => {
1051
+ d && (d.multiplier = i, R && (d.shouldAnimate = !0)), y(i), R && f(!0), W == null || W(i);
1052
+ }, ye = (i) => {
1053
+ k(i), d && (d.currentTime = D.JulianDate.clone(i)), _ == null || _(i);
1054
+ }, _e = (i) => {
1055
+ i && b < 0 && ve(1, !1), d && (d.shouldAnimate = i), f(i), S == null || S(i);
1056
+ }, je = () => {
1057
+ const i = te.length > 0 ? te : Ze, R = b > 1 ? b : 1, P = i.indexOf(R), le = i[P < 0 || P === i.length - 1 ? 0 : P + 1];
1058
+ ve(le);
1059
+ }, Ie = () => {
1060
+ const i = ue.length > 0 ? ue : Qe, R = b < 0 ? Math.abs(b) : 0, P = i.indexOf(R), le = -i[P < 0 || P === i.length - 1 ? 0 : P + 1];
1061
+ ve(le);
1062
+ }, be = () => {
1063
+ var R;
1064
+ const i = De(F ?? D.JulianDate.fromDate(new Date(j)));
1065
+ d && (d.currentTime = D.JulianDate.clone(i)), k(i), (R = q.current) == null || R.zoomTo(j, s);
1066
+ }, m = () => {
1067
+ var R;
1068
+ const i = De(X ?? D.JulianDate.fromDate(new Date(s)));
1069
+ d && (d.currentTime = D.JulianDate.clone(i)), k(i), (R = q.current) == null || R.zoomTo(j, s);
1020
1070
  }, we = () => {
1021
- const a = Z.length > 0 ? Z : Ge, D = u > 1 ? u : 1, $ = a.indexOf(D), ue = a[$ < 0 || $ === a.length - 1 ? 0 : $ + 1];
1022
- Te(ue);
1023
- }, Ee = () => {
1024
- const a = ce.length > 0 ? ce : Ve, D = u < 0 ? Math.abs(u) : 0, $ = a.indexOf(D), ue = -a[$ < 0 || $ === a.length - 1 ? 0 : $ + 1];
1025
- Te(ue);
1026
- }, fe = () => {
1027
- var D;
1028
- const a = Ae(j ?? _.JulianDate.fromDate(new Date(S)));
1029
- l && (l.currentTime = _.JulianDate.clone(a)), w(a), (D = B.current) == null || D.zoomTo(S, L);
1030
- }, Ce = () => {
1031
- var D;
1032
- const a = Ae(I ?? _.JulianDate.fromDate(new Date(L)));
1033
- l && (l.currentTime = _.JulianDate.clone(a)), w(a), (D = B.current) == null || D.zoomTo(S, L);
1034
- }, Me = () => {
1035
- const a = _.JulianDate.fromDate(/* @__PURE__ */ new Date());
1036
- l && (l.currentTime = _.JulianDate.clone(a)), w(a), Te(1);
1037
- const D = Date.now();
1038
- if (B.current) {
1039
- const { startMs: $, endMs: ue } = B.current.getVisibleRange(), H = ue - $;
1040
- B.current.zoomTo(D - H / 2, D + H / 2);
1071
+ const i = D.JulianDate.fromDate(/* @__PURE__ */ new Date());
1072
+ d && (d.currentTime = D.JulianDate.clone(i)), k(i), ve(1);
1073
+ const R = Date.now();
1074
+ if (q.current) {
1075
+ const { startMs: P, endMs: le } = q.current.getVisibleRange(), N = le - P;
1076
+ q.current.zoomTo(R - N / 2, R + N / 2);
1041
1077
  }
1042
- }, Ie = Math.abs(_.JulianDate.toDate(c).getTime() - Date.now()) < 1e4;
1043
- return /* @__PURE__ */ i.jsxs(
1078
+ }, Me = Math.abs(D.JulianDate.toDate(V).getTime() - Date.now()) < 1e4;
1079
+ return /* @__PURE__ */ u.jsxs(
1044
1080
  "div",
1045
1081
  {
1046
- className: g,
1082
+ className: v,
1047
1083
  style: {
1048
1084
  width: "100%",
1049
- height: Re,
1085
+ height: Fe,
1050
1086
  overflow: "hidden",
1051
1087
  display: "flex",
1052
1088
  flexDirection: "column",
1053
1089
  fontFamily: "system-ui, -apple-system, sans-serif",
1054
- transition: he === "animated" ? "height 0.2s ease" : void 0
1090
+ transition: ge === "animated" ? "height 0.2s ease" : void 0
1055
1091
  },
1056
1092
  children: [
1057
- ae && /* @__PURE__ */ i.jsx("div", { ref: re, children: /* @__PURE__ */ i.jsx(
1058
- Rt,
1093
+ de && /* @__PURE__ */ u.jsx("div", { ref: fe, children: /* @__PURE__ */ u.jsx(
1094
+ jt,
1059
1095
  {
1060
- currentTime: c,
1061
- isPlaying: ie,
1062
- multiplier: u,
1063
- isLive: Ie,
1064
- hasStartTime: j != null,
1065
- hasEndTime: I != null,
1066
- showJumpToStart: J,
1067
- showJumpToEnd: q,
1068
- onPlayPause: m,
1069
- onJumpToStart: fe,
1070
- onRewind: Ee,
1071
- onFastForward: we,
1072
- onJumpToEnd: Ce,
1073
- onJumpToLive: Me,
1074
- onResetSpeed: () => Te(1),
1075
- onDateTimeClick: Y,
1076
- dateTimeFormat: G,
1077
- timezone: M,
1078
- theme: De,
1079
- swimLanesVisible: b ? E : void 0,
1080
- onToggleSwimLanes: b ? be : void 0,
1081
- labels: z
1096
+ currentTime: V,
1097
+ isPlaying: t,
1098
+ multiplier: b,
1099
+ isLive: Me,
1100
+ hasStartTime: F != null,
1101
+ hasEndTime: X != null,
1102
+ showJumpToStart: H,
1103
+ showJumpToEnd: G,
1104
+ onPlayPause: _e,
1105
+ onJumpToStart: be,
1106
+ onRewind: Ie,
1107
+ onFastForward: je,
1108
+ onJumpToEnd: m,
1109
+ onJumpToLive: we,
1110
+ onResetSpeed: () => ve(1),
1111
+ onDateTimeClick: se,
1112
+ dateTimeFormat: I,
1113
+ timezone: Q,
1114
+ theme: pe,
1115
+ swimLanesVisible: E ? re : void 0,
1116
+ onToggleSwimLanes: E ? J : void 0,
1117
+ labels: ee
1082
1118
  }
1083
1119
  ) }),
1084
- K !== !1 && /* @__PURE__ */ i.jsx(
1085
- Ze,
1120
+ U !== !1 && /* @__PURE__ */ u.jsx(
1121
+ et,
1086
1122
  {
1087
- ref: B,
1088
- currentTime: c,
1089
- defaultStartMs: S,
1090
- defaultEndMs: L,
1091
- theme: De,
1092
- maxTicks: se,
1093
- timezone: M,
1094
- dateTimeFormat: G,
1095
- months: z == null ? void 0 : z.months,
1096
- onTimeChange: me,
1123
+ ref: q,
1124
+ currentTime: V,
1125
+ defaultStartMs: j,
1126
+ defaultEndMs: s,
1127
+ theme: pe,
1128
+ maxTicks: ie,
1129
+ timezone: Q,
1130
+ dateTimeFormat: I,
1131
+ months: ee == null ? void 0 : ee.months,
1132
+ onTimeChange: ye,
1097
1133
  onDragStart: () => {
1098
- ve.current = !0;
1134
+ xe.current = !0;
1099
1135
  },
1100
1136
  onDragEnd: () => {
1101
- ve.current = !1;
1137
+ xe.current = !1;
1102
1138
  },
1103
- swimLanes: ne,
1104
- showSwimLanes: E,
1105
- onSwimLaneItemClick: ee,
1106
- onSwimLaneItemHover: s,
1107
- onSwimLaneItemDoubleClick: y,
1108
- onSwimLaneItemContextMenu: R,
1109
- onSwimLaneReorder: k
1139
+ swimLanes: M,
1140
+ showSwimLanes: re,
1141
+ onSwimLaneItemClick: ce,
1142
+ onSwimLaneItemHover: A,
1143
+ onSwimLaneItemDoubleClick: p,
1144
+ onSwimLaneItemContextMenu: g,
1145
+ onSwimLaneReorder: L,
1146
+ onRangeSelect: C
1110
1147
  }
1111
1148
  )
1112
1149
  ]
1113
1150
  }
1114
1151
  );
1115
- }, _t = ({
1116
- startTime: j,
1117
- endTime: I,
1118
- currentTime: U,
1119
- width: l,
1120
- height: C,
1121
- tickInterval: A,
1122
- showLabels: O,
1123
- snapToTicks: N,
1124
- enableDrag: ae,
1125
- theme: J,
1126
- onTimeChange: q,
1127
- onVisibleRangeChange: K,
1128
- onDragStart: G,
1129
- onDragEnd: Y
1152
+ }, Ft = ({
1153
+ startTime: F,
1154
+ endTime: X,
1155
+ currentTime: K,
1156
+ width: d,
1157
+ height: _,
1158
+ tickInterval: S,
1159
+ showLabels: W,
1160
+ snapToTicks: $,
1161
+ enableDrag: de,
1162
+ theme: H,
1163
+ onTimeChange: G,
1164
+ onVisibleRangeChange: U,
1165
+ onDragStart: I,
1166
+ onDragEnd: se
1130
1167
  }) => {
1131
- const oe = Xe(
1132
- () => gt(j, I, A, l),
1133
- [j, I, A, l]
1134
- ), se = Xe(
1135
- () => vt(U, j, I, l),
1136
- [U, j, I, l]
1137
- ), Z = x(null), ce = (g) => {
1138
- if (!ae) return;
1139
- const M = g.currentTarget.getBoundingClientRect(), ne = g.clientX - M.left, X = Math.max(0, Math.min(l, ne));
1140
- if (!(Math.abs(X - se) <= 10)) {
1141
- let L = X;
1142
- N && (L = bt(X, oe, 10));
1143
- const c = new Date(j).getTime(), w = new Date(I).getTime();
1144
- q(_.JulianDate.fromDate(new Date(c + L / l * (w - c))));
1168
+ const Z = Ne(
1169
+ () => Mt(F, X, S, d),
1170
+ [F, X, S, d]
1171
+ ), ie = Ne(
1172
+ () => yt(K, F, X, d),
1173
+ [K, F, X, d]
1174
+ ), te = x(null), ue = (v) => {
1175
+ if (!de) return;
1176
+ const Q = v.currentTarget.getBoundingClientRect(), M = v.clientX - Q.left, B = Math.max(0, Math.min(d, M));
1177
+ if (!(Math.abs(B - ie) <= 10)) {
1178
+ let j = B;
1179
+ $ && (j = Et(B, Z, 10));
1180
+ const s = new Date(F).getTime(), V = new Date(X).getTime();
1181
+ G(D.JulianDate.fromDate(new Date(s + j / d * (V - s))));
1145
1182
  return;
1146
1183
  }
1147
- G == null || G();
1148
- const he = g.clientX, ee = new Date(U).getTime(), s = new Date(j).getTime(), R = (new Date(I).getTime() - s) / l;
1149
- let k = 0, z = !1;
1150
- const W = (L) => {
1151
- k = L.clientX - he, z = !0, Z.current || (Z.current = requestAnimationFrame(() => {
1152
- if (z) {
1153
- const c = ee + k * R;
1154
- q(_.JulianDate.fromDate(new Date(c))), z = !1;
1184
+ I == null || I();
1185
+ const ge = v.clientX, ce = new Date(K).getTime(), A = new Date(F).getTime(), g = (new Date(X).getTime() - A) / d;
1186
+ let L = 0, C = !1;
1187
+ const ee = (j) => {
1188
+ L = j.clientX - ge, C = !0, te.current || (te.current = requestAnimationFrame(() => {
1189
+ if (C) {
1190
+ const s = ce + L * g;
1191
+ G(D.JulianDate.fromDate(new Date(s))), C = !1;
1155
1192
  }
1156
- Z.current = null;
1193
+ te.current = null;
1157
1194
  }));
1158
- }, S = () => {
1159
- document.removeEventListener("mousemove", W), document.removeEventListener("mouseup", S), Z.current !== null && (cancelAnimationFrame(Z.current), Z.current = null), Y == null || Y();
1195
+ }, O = () => {
1196
+ document.removeEventListener("mousemove", ee), document.removeEventListener("mouseup", O), te.current !== null && (cancelAnimationFrame(te.current), te.current = null), se == null || se();
1160
1197
  };
1161
- document.addEventListener("mousemove", W), document.addEventListener("mouseup", S);
1162
- }, T = (g) => {
1163
- g.preventDefault();
1164
- const M = g.shiftKey ? g.deltaY : g.deltaX !== 0 ? g.deltaX : g.deltaY;
1165
- if (Math.abs(M) < 1) return;
1166
- const ne = new Date(j).getTime(), X = new Date(I).getTime(), Q = M / l * (X - ne) * 0.5;
1167
- K == null || K(
1168
- _.JulianDate.fromDate(new Date(ne + Q)),
1169
- _.JulianDate.fromDate(new Date(X + Q))
1198
+ document.addEventListener("mousemove", ee), document.addEventListener("mouseup", O);
1199
+ }, w = (v) => {
1200
+ v.preventDefault();
1201
+ const Q = v.shiftKey ? v.deltaY : v.deltaX !== 0 ? v.deltaX : v.deltaY;
1202
+ if (Math.abs(Q) < 1) return;
1203
+ const M = new Date(F).getTime(), B = new Date(X).getTime(), oe = Q / d * (B - M) * 0.5;
1204
+ U == null || U(
1205
+ D.JulianDate.fromDate(new Date(M + oe)),
1206
+ D.JulianDate.fromDate(new Date(B + oe))
1170
1207
  );
1171
1208
  };
1172
- return /* @__PURE__ */ i.jsxs(
1209
+ return /* @__PURE__ */ u.jsxs(
1173
1210
  "svg",
1174
1211
  {
1175
1212
  width: "100%",
1176
- height: C,
1177
- style: { backgroundColor: J.backgroundColor, display: "block", cursor: "default" },
1178
- onMouseDown: ce,
1179
- onWheel: T,
1213
+ height: _,
1214
+ style: { backgroundColor: H.backgroundColor, display: "block", cursor: "default" },
1215
+ onMouseDown: ue,
1216
+ onWheel: w,
1180
1217
  children: [
1181
- /* @__PURE__ */ i.jsx("rect", { width: l, height: C, fill: J.backgroundColor }),
1182
- oe.map((g, M) => /* @__PURE__ */ i.jsxs("g", { children: [
1183
- /* @__PURE__ */ i.jsx(
1218
+ /* @__PURE__ */ u.jsx("rect", { width: d, height: _, fill: H.backgroundColor }),
1219
+ Z.map((v, Q) => /* @__PURE__ */ u.jsxs("g", { children: [
1220
+ /* @__PURE__ */ u.jsx(
1184
1221
  "line",
1185
1222
  {
1186
- x1: g.position,
1187
- y1: C - (g.isMajor ? J.majorTickHeight : J.minorTickHeight),
1188
- x2: g.position,
1189
- y2: C,
1190
- stroke: g.isMajor ? J.majorTickColor : J.tickColor,
1223
+ x1: v.position,
1224
+ y1: _ - (v.isMajor ? H.majorTickHeight : H.minorTickHeight),
1225
+ x2: v.position,
1226
+ y2: _,
1227
+ stroke: v.isMajor ? H.majorTickColor : H.tickColor,
1191
1228
  strokeWidth: "1"
1192
1229
  }
1193
1230
  ),
1194
- O && g.isMajor && g.label && /* @__PURE__ */ i.jsx(
1231
+ W && v.isMajor && v.label && /* @__PURE__ */ u.jsx(
1195
1232
  "text",
1196
1233
  {
1197
- x: g.position,
1198
- y: C - J.majorTickHeight - 5,
1234
+ x: v.position,
1235
+ y: _ - H.majorTickHeight - 5,
1199
1236
  textAnchor: "middle",
1200
- fill: J.labelColor,
1201
- fontSize: J.fontSize,
1237
+ fill: H.labelColor,
1238
+ fontSize: H.fontSize,
1202
1239
  fontFamily: "monospace",
1203
- children: g.label
1240
+ children: v.label
1204
1241
  }
1205
1242
  )
1206
- ] }, M)),
1207
- /* @__PURE__ */ i.jsx(
1243
+ ] }, Q)),
1244
+ /* @__PURE__ */ u.jsx(
1208
1245
  "line",
1209
1246
  {
1210
- x1: se,
1247
+ x1: ie,
1211
1248
  y1: 0,
1212
- x2: se,
1213
- y2: C,
1214
- stroke: J.indicatorColor,
1215
- strokeWidth: J.indicatorLineWidth,
1249
+ x2: ie,
1250
+ y2: _,
1251
+ stroke: H.indicatorColor,
1252
+ strokeWidth: H.indicatorLineWidth,
1216
1253
  pointerEvents: "none"
1217
1254
  }
1218
1255
  ),
1219
- ae && /* @__PURE__ */ i.jsx(
1256
+ de && /* @__PURE__ */ u.jsx(
1220
1257
  "rect",
1221
1258
  {
1222
- x: Math.max(0, se - 10),
1259
+ x: Math.max(0, ie - 10),
1223
1260
  y: 0,
1224
1261
  width: 20,
1225
- height: C,
1262
+ height: _,
1226
1263
  fill: "transparent",
1227
1264
  style: { cursor: "ew-resize" },
1228
1265
  pointerEvents: "visiblePainted"
1229
1266
  }
1230
1267
  ),
1231
- /* @__PURE__ */ i.jsx("circle", { cx: se, cy: 5, r: 4, fill: J.indicatorColor, pointerEvents: "none" })
1268
+ /* @__PURE__ */ u.jsx("circle", { cx: ie, cy: 5, r: 4, fill: H.indicatorColor, pointerEvents: "none" })
1232
1269
  ]
1233
1270
  }
1234
1271
  );
1235
1272
  };
1236
1273
  export {
1237
- kt as TICK_AREA_HEIGHT,
1238
- At as Timeline,
1239
- Ze as TimelineCanvas,
1240
- Rt as TimelineControls,
1241
- _t as TimelineSVG
1274
+ Ot as TICK_AREA_HEIGHT,
1275
+ kt as Timeline,
1276
+ et as TimelineCanvas,
1277
+ jt as TimelineControls,
1278
+ Ft as TimelineSVG
1242
1279
  };