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