@jaeungkim/gantt-chart 0.3.0 → 0.4.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.
Files changed (57) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +60 -101
  3. package/dist/components/GanttBar.d.ts +23 -0
  4. package/dist/components/GanttChartHeader.d.ts +17 -0
  5. package/dist/components/GanttDependencyArrows.d.ts +15 -0
  6. package/dist/components/GanttDragGuides.d.ts +9 -0
  7. package/dist/components/GanttGridSplitter.d.ts +14 -0
  8. package/dist/components/GanttMarkers.d.ts +18 -0
  9. package/dist/components/GanttTaskGrid.d.ts +42 -0
  10. package/dist/components/ScaleSelector.d.ts +11 -0
  11. package/dist/constants/gantt.d.ts +47 -0
  12. package/dist/core/calendar.d.ts +45 -0
  13. package/dist/core/criticalPath.d.ts +67 -0
  14. package/dist/core/dates.d.ts +32 -0
  15. package/dist/core/index.d.ts +16 -0
  16. package/dist/core/scheduling.d.ts +104 -0
  17. package/dist/core/tree.d.ts +42 -0
  18. package/dist/core/types.d.ts +76 -0
  19. package/dist/gantt-chart.css +1 -1
  20. package/dist/hooks/useGanttBarDrag.d.ts +35 -0
  21. package/dist/hooks/useGanttDrawCreate.d.ts +31 -0
  22. package/dist/hooks/useGanttExportApi.d.ts +30 -0
  23. package/dist/hooks/useGanttHistoryApi.d.ts +28 -0
  24. package/dist/hooks/useGanttLinkDrag.d.ts +31 -0
  25. package/dist/hooks/useGanttProgressDrag.d.ts +16 -0
  26. package/dist/hooks/useGanttRowDrag.d.ts +33 -0
  27. package/dist/hooks/useGanttScrollApi.d.ts +63 -0
  28. package/dist/hooks/useGanttSelectors.d.ts +23 -0
  29. package/dist/hooks/useGanttVirtualization.d.ts +32 -0
  30. package/dist/hooks/useResolvedTheme.d.ts +15 -0
  31. package/dist/index.cjs +4 -0
  32. package/dist/index.d.cts +13 -0
  33. package/dist/index.d.ts +13 -51
  34. package/dist/index.js +5819 -0
  35. package/dist/pages/Gantt.d.ts +306 -0
  36. package/dist/stores/context.d.ts +10 -0
  37. package/dist/stores/store.d.ts +118 -0
  38. package/dist/types/gantt.d.ts +283 -0
  39. package/dist/types/task.d.ts +111 -0
  40. package/dist/utils/a11y.d.ts +141 -0
  41. package/dist/utils/arrowPath.d.ts +66 -0
  42. package/dist/utils/dependency.d.ts +42 -0
  43. package/dist/utils/grouping.d.ts +81 -0
  44. package/dist/utils/headerUtils.d.ts +6 -0
  45. package/dist/utils/history.d.ts +56 -0
  46. package/dist/utils/i18n.d.ts +16 -0
  47. package/dist/utils/mutation.d.ts +47 -0
  48. package/dist/utils/pngExport.d.ts +67 -0
  49. package/dist/utils/pointerGesture.d.ts +31 -0
  50. package/dist/utils/rowDrag.d.ts +69 -0
  51. package/dist/utils/timeline.d.ts +161 -0
  52. package/dist/utils/transformData.d.ts +15 -0
  53. package/dist/utils/viewport.d.ts +95 -0
  54. package/package.json +47 -32
  55. package/dist/index.cjs.js +0 -4
  56. package/dist/index.es.js +0 -2357
  57. package/dist/readmeImg.png +0 -0
package/dist/index.es.js DELETED
@@ -1,2357 +0,0 @@
1
- import { jsxs as X, jsx as P } from "react/jsx-runtime";
2
- import * as yt from "react";
3
- import nt, { useRef as St, useState as Mt, useCallback as Qt, useMemo as st, useEffect as Q } from "react";
4
- import { flushSync as te } from "react-dom";
5
- const bt = 38, ee = 5, Z = {
6
- day: {
7
- labelUnit: "day",
8
- tickUnit: "hour",
9
- unitPerTick: 1,
10
- dragStepUnit: "hour",
11
- dragStepAmount: 1,
12
- basePxPerDragStep: 32,
13
- formatTickLabel: (r) => r.format("hh"),
14
- formatHeaderLabel: (r) => r.format("MMM D")
15
- },
16
- week: {
17
- labelUnit: "month",
18
- tickUnit: "day",
19
- unitPerTick: 1,
20
- dragStepUnit: "hour",
21
- dragStepAmount: 6,
22
- basePxPerDragStep: 54,
23
- formatTickLabel: (r) => r.format("D"),
24
- formatHeaderLabel: (r) => r.format("MMM")
25
- },
26
- month: {
27
- labelUnit: "month",
28
- tickUnit: "day",
29
- unitPerTick: 1,
30
- dragStepUnit: "day",
31
- dragStepAmount: 1,
32
- basePxPerDragStep: 32,
33
- formatTickLabel: (r) => r.format("D"),
34
- formatHeaderLabel: (r) => r.format("MMM YYYY")
35
- },
36
- year: {
37
- labelUnit: "month",
38
- tickUnit: "month",
39
- unitPerTick: 1,
40
- dragStepUnit: "day",
41
- dragStepAmount: 7,
42
- basePxPerDragStep: 28,
43
- formatTickLabel: (r) => r.format("D"),
44
- formatHeaderLabel: (r) => r.format("MMM YYYY")
45
- }
46
- }, wt = (r) => Symbol.iterator in r, Dt = (r) => (
47
- // HACK: avoid checking entries type
48
- "entries" in r
49
- ), Ot = (r, a) => {
50
- const e = r instanceof Map ? r : new Map(r.entries()), n = a instanceof Map ? a : new Map(a.entries());
51
- if (e.size !== n.size)
52
- return !1;
53
- for (const [s, t] of e)
54
- if (!n.has(s) || !Object.is(t, n.get(s)))
55
- return !1;
56
- return !0;
57
- }, ne = (r, a) => {
58
- const e = r[Symbol.iterator](), n = a[Symbol.iterator]();
59
- let s = e.next(), t = n.next();
60
- for (; !s.done && !t.done; ) {
61
- if (!Object.is(s.value, t.value))
62
- return !1;
63
- s = e.next(), t = n.next();
64
- }
65
- return !!s.done && !!t.done;
66
- };
67
- function re(r, a) {
68
- return Object.is(r, a) ? !0 : typeof r != "object" || r === null || typeof a != "object" || a === null || Object.getPrototypeOf(r) !== Object.getPrototypeOf(a) ? !1 : wt(r) && wt(a) ? Dt(r) && Dt(a) ? Ot(r, a) : ne(r, a) : Ot(
69
- { entries: () => Object.entries(r) },
70
- { entries: () => Object.entries(a) }
71
- );
72
- }
73
- function se(r) {
74
- const a = nt.useRef(void 0);
75
- return (e) => {
76
- const n = r(e);
77
- return re(a.current, n) ? a.current : a.current = n;
78
- };
79
- }
80
- const kt = (r) => {
81
- let a;
82
- const e = /* @__PURE__ */ new Set(), n = (c, d) => {
83
- const l = typeof c == "function" ? c(a) : c;
84
- if (!Object.is(l, a)) {
85
- const h = a;
86
- a = d ?? (typeof l != "object" || l === null) ? l : Object.assign({}, a, l), e.forEach((b) => b(a, h));
87
- }
88
- }, s = () => a, i = { setState: n, getState: s, getInitialState: () => u, subscribe: (c) => (e.add(c), () => e.delete(c)) }, u = a = r(n, s, i);
89
- return i;
90
- }, ie = ((r) => r ? kt(r) : kt), oe = (r) => r;
91
- function ae(r, a = oe) {
92
- const e = nt.useSyncExternalStore(
93
- r.subscribe,
94
- nt.useCallback(() => a(r.getState()), [r, a]),
95
- nt.useCallback(() => a(r.getInitialState()), [r, a])
96
- );
97
- return nt.useDebugValue(e), e;
98
- }
99
- const ue = (r) => {
100
- const a = ie(r), e = (n) => ae(a, n);
101
- return Object.assign(e, a), e;
102
- }, ce = ((r) => ue);
103
- function Zt(r, a) {
104
- let e;
105
- try {
106
- e = r();
107
- } catch {
108
- return;
109
- }
110
- return {
111
- getItem: (s) => {
112
- var t;
113
- const o = (u) => u === null ? null : JSON.parse(u, void 0), i = (t = e.getItem(s)) != null ? t : null;
114
- return i instanceof Promise ? i.then(o) : o(i);
115
- },
116
- setItem: (s, t) => e.setItem(s, JSON.stringify(t, void 0)),
117
- removeItem: (s) => e.removeItem(s)
118
- };
119
- }
120
- const xt = (r) => (a) => {
121
- try {
122
- const e = r(a);
123
- return e instanceof Promise ? e : {
124
- then(n) {
125
- return xt(n)(e);
126
- },
127
- catch(n) {
128
- return this;
129
- }
130
- };
131
- } catch (e) {
132
- return {
133
- then(n) {
134
- return this;
135
- },
136
- catch(n) {
137
- return xt(n)(e);
138
- }
139
- };
140
- }
141
- }, le = (r, a) => (e, n, s) => {
142
- let t = {
143
- storage: Zt(() => localStorage),
144
- partialize: (f) => f,
145
- version: 0,
146
- merge: (f, S) => ({
147
- ...S,
148
- ...f
149
- }),
150
- ...a
151
- }, o = !1;
152
- const i = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Set();
153
- let c = t.storage;
154
- if (!c)
155
- return r(
156
- (...f) => {
157
- console.warn(
158
- `[zustand persist middleware] Unable to update item '${t.name}', the given storage is currently unavailable.`
159
- ), e(...f);
160
- },
161
- n,
162
- s
163
- );
164
- const d = () => {
165
- const f = t.partialize({ ...n() });
166
- return c.setItem(t.name, {
167
- state: f,
168
- version: t.version
169
- });
170
- }, l = s.setState;
171
- s.setState = (f, S) => (l(f, S), d());
172
- const h = r(
173
- (...f) => (e(...f), d()),
174
- n,
175
- s
176
- );
177
- s.getInitialState = () => h;
178
- let b;
179
- const y = () => {
180
- var f, S;
181
- if (!c) return;
182
- o = !1, i.forEach((x) => {
183
- var p;
184
- return x((p = n()) != null ? p : h);
185
- });
186
- const D = ((S = t.onRehydrateStorage) == null ? void 0 : S.call(t, (f = n()) != null ? f : h)) || void 0;
187
- return xt(c.getItem.bind(c))(t.name).then((x) => {
188
- if (x)
189
- if (typeof x.version == "number" && x.version !== t.version) {
190
- if (t.migrate) {
191
- const p = t.migrate(
192
- x.state,
193
- x.version
194
- );
195
- return p instanceof Promise ? p.then((z) => [!0, z]) : [!0, p];
196
- }
197
- console.error(
198
- "State loaded from storage couldn't be migrated since no migrate function was provided"
199
- );
200
- } else
201
- return [!1, x.state];
202
- return [!1, void 0];
203
- }).then((x) => {
204
- var p;
205
- const [z, R] = x;
206
- if (b = t.merge(
207
- R,
208
- (p = n()) != null ? p : h
209
- ), e(b, !0), z)
210
- return d();
211
- }).then(() => {
212
- D == null || D(b, void 0), b = n(), o = !0, u.forEach((x) => x(b));
213
- }).catch((x) => {
214
- D == null || D(void 0, x);
215
- });
216
- };
217
- return s.persist = {
218
- setOptions: (f) => {
219
- t = {
220
- ...t,
221
- ...f
222
- }, f.storage && (c = f.storage);
223
- },
224
- clearStorage: () => {
225
- c == null || c.removeItem(t.name);
226
- },
227
- getOptions: () => t,
228
- rehydrate: () => y(),
229
- hasHydrated: () => o,
230
- onHydrate: (f) => (i.add(f), () => {
231
- i.delete(f);
232
- }),
233
- onFinishHydration: (f) => (u.add(f), () => {
234
- u.delete(f);
235
- })
236
- }, t.skipHydration || y(), b || h;
237
- }, fe = le, rt = ce()(
238
- fe(
239
- (r, a) => ({
240
- rawTasks: [],
241
- transformedTasks: [],
242
- bottomRowCells: [],
243
- selectedScale: "month",
244
- currentTask: null,
245
- dragOffsets: {},
246
- setCurrentTask: (e) => r({ currentTask: e }),
247
- setSelectedScale: (e) => r({ selectedScale: e }),
248
- setRawTasks: (e) => r({ rawTasks: e }),
249
- setBottomRowCells: (e) => r({ bottomRowCells: e }),
250
- setTransformedTasks: (e) => r({ transformedTasks: e }),
251
- setDragOffset: (e, n) => r((s) => ({
252
- dragOffsets: { ...s.dragOffsets, [e]: n }
253
- })),
254
- clearDragOffset: (e) => r((n) => {
255
- const { [e]: s, ...t } = n.dragOffsets;
256
- return { dragOffsets: t };
257
- }),
258
- getCurrentDragOffset: (e) => a().dragOffsets[e] || null,
259
- getTotalWidth: () => a().bottomRowCells.reduce((n, s) => n + s.widthPx, 0)
260
- }),
261
- {
262
- name: "gantt-storage",
263
- storage: Zt(() => sessionStorage),
264
- partialize: (r) => ({ selectedScale: r.selectedScale })
265
- }
266
- )
267
- );
268
- function Jt() {
269
- return rt(
270
- se((r) => ({
271
- // 상태
272
- rawTasks: r.rawTasks,
273
- transformedTasks: r.transformedTasks,
274
- bottomRowCells: r.bottomRowCells,
275
- selectedScale: r.selectedScale,
276
- currentTask: r.currentTask,
277
- dragOffsets: r.dragOffsets,
278
- // 액션
279
- setRawTasks: r.setRawTasks,
280
- setTransformedTasks: r.setTransformedTasks,
281
- setBottomRowCells: r.setBottomRowCells,
282
- setSelectedScale: r.setSelectedScale,
283
- setCurrentTask: r.setCurrentTask,
284
- setDragOffset: r.setDragOffset,
285
- clearDragOffset: r.clearDragOffset,
286
- // 계산된 값
287
- getTotalWidth: r.getTotalWidth,
288
- getCurrentDragOffset: r.getCurrentDragOffset
289
- }))
290
- );
291
- }
292
- function j(r) {
293
- return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
294
- }
295
- var ot = { exports: {} }, de = ot.exports, Tt;
296
- function he() {
297
- return Tt || (Tt = 1, (function(r, a) {
298
- (function(e, n) {
299
- r.exports = n();
300
- })(de, (function() {
301
- var e = 1e3, n = 6e4, s = 36e5, t = "millisecond", o = "second", i = "minute", u = "hour", c = "day", d = "week", l = "month", h = "quarter", b = "year", y = "date", f = "Invalid Date", S = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, D = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, x = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(E) {
302
- var O = ["th", "st", "nd", "rd"], M = E % 100;
303
- return "[" + E + (O[(M - 20) % 10] || O[M] || O[0]) + "]";
304
- } }, p = function(E, O, M) {
305
- var I = String(E);
306
- return !I || I.length >= O ? E : "" + Array(O + 1 - I.length).join(M) + E;
307
- }, z = { s: p, z: function(E) {
308
- var O = -E.utcOffset(), M = Math.abs(O), I = Math.floor(M / 60), w = M % 60;
309
- return (O <= 0 ? "+" : "-") + p(I, 2, "0") + ":" + p(w, 2, "0");
310
- }, m: function E(O, M) {
311
- if (O.date() < M.date()) return -E(M, O);
312
- var I = 12 * (M.year() - O.year()) + (M.month() - O.month()), w = O.clone().add(I, l), C = M - w < 0, L = O.clone().add(I + (C ? -1 : 1), l);
313
- return +(-(I + (M - w) / (C ? w - L : L - w)) || 0);
314
- }, a: function(E) {
315
- return E < 0 ? Math.ceil(E) || 0 : Math.floor(E);
316
- }, p: function(E) {
317
- return { M: l, y: b, w: d, d: c, D: y, h: u, m: i, s: o, ms: t, Q: h }[E] || String(E || "").toLowerCase().replace(/s$/, "");
318
- }, u: function(E) {
319
- return E === void 0;
320
- } }, R = "en", T = {};
321
- T[R] = x;
322
- var v = "$isDayjsObject", g = function(E) {
323
- return E instanceof W || !(!E || !E[v]);
324
- }, $ = function E(O, M, I) {
325
- var w;
326
- if (!O) return R;
327
- if (typeof O == "string") {
328
- var C = O.toLowerCase();
329
- T[C] && (w = C), M && (T[C] = M, w = C);
330
- var L = O.split("-");
331
- if (!w && L.length > 1) return E(L[0]);
332
- } else {
333
- var _ = O.name;
334
- T[_] = O, w = _;
335
- }
336
- return !I && w && (R = w), w || !I && R;
337
- }, m = function(E, O) {
338
- if (g(E)) return E.clone();
339
- var M = typeof O == "object" ? O : {};
340
- return M.date = E, M.args = arguments, new W(M);
341
- }, k = z;
342
- k.l = $, k.i = g, k.w = function(E, O) {
343
- return m(E, { locale: O.$L, utc: O.$u, x: O.$x, $offset: O.$offset });
344
- };
345
- var W = (function() {
346
- function E(M) {
347
- this.$L = $(M.locale, null, !0), this.parse(M), this.$x = this.$x || M.x || {}, this[v] = !0;
348
- }
349
- var O = E.prototype;
350
- return O.parse = function(M) {
351
- this.$d = (function(I) {
352
- var w = I.date, C = I.utc;
353
- if (w === null) return /* @__PURE__ */ new Date(NaN);
354
- if (k.u(w)) return /* @__PURE__ */ new Date();
355
- if (w instanceof Date) return new Date(w);
356
- if (typeof w == "string" && !/Z$/i.test(w)) {
357
- var L = w.match(S);
358
- if (L) {
359
- var _ = L[2] - 1 || 0, F = (L[7] || "0").substring(0, 3);
360
- return C ? new Date(Date.UTC(L[1], _, L[3] || 1, L[4] || 0, L[5] || 0, L[6] || 0, F)) : new Date(L[1], _, L[3] || 1, L[4] || 0, L[5] || 0, L[6] || 0, F);
361
- }
362
- }
363
- return new Date(w);
364
- })(M), this.init();
365
- }, O.init = function() {
366
- var M = this.$d;
367
- this.$y = M.getFullYear(), this.$M = M.getMonth(), this.$D = M.getDate(), this.$W = M.getDay(), this.$H = M.getHours(), this.$m = M.getMinutes(), this.$s = M.getSeconds(), this.$ms = M.getMilliseconds();
368
- }, O.$utils = function() {
369
- return k;
370
- }, O.isValid = function() {
371
- return this.$d.toString() !== f;
372
- }, O.isSame = function(M, I) {
373
- var w = m(M);
374
- return this.startOf(I) <= w && w <= this.endOf(I);
375
- }, O.isAfter = function(M, I) {
376
- return m(M) < this.startOf(I);
377
- }, O.isBefore = function(M, I) {
378
- return this.endOf(I) < m(M);
379
- }, O.$g = function(M, I, w) {
380
- return k.u(M) ? this[I] : this.set(w, M);
381
- }, O.unix = function() {
382
- return Math.floor(this.valueOf() / 1e3);
383
- }, O.valueOf = function() {
384
- return this.$d.getTime();
385
- }, O.startOf = function(M, I) {
386
- var w = this, C = !!k.u(I) || I, L = k.p(M), _ = function(G, U) {
387
- var q = k.w(w.$u ? Date.UTC(w.$y, U, G) : new Date(w.$y, U, G), w);
388
- return C ? q : q.endOf(c);
389
- }, F = function(G, U) {
390
- return k.w(w.toDate()[G].apply(w.toDate("s"), (C ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(U)), w);
391
- }, H = this.$W, Y = this.$M, B = this.$D, J = "set" + (this.$u ? "UTC" : "");
392
- switch (L) {
393
- case b:
394
- return C ? _(1, 0) : _(31, 11);
395
- case l:
396
- return C ? _(1, Y) : _(0, Y + 1);
397
- case d:
398
- var V = this.$locale().weekStart || 0, tt = (H < V ? H + 7 : H) - V;
399
- return _(C ? B - tt : B + (6 - tt), Y);
400
- case c:
401
- case y:
402
- return F(J + "Hours", 0);
403
- case u:
404
- return F(J + "Minutes", 1);
405
- case i:
406
- return F(J + "Seconds", 2);
407
- case o:
408
- return F(J + "Milliseconds", 3);
409
- default:
410
- return this.clone();
411
- }
412
- }, O.endOf = function(M) {
413
- return this.startOf(M, !1);
414
- }, O.$set = function(M, I) {
415
- var w, C = k.p(M), L = "set" + (this.$u ? "UTC" : ""), _ = (w = {}, w[c] = L + "Date", w[y] = L + "Date", w[l] = L + "Month", w[b] = L + "FullYear", w[u] = L + "Hours", w[i] = L + "Minutes", w[o] = L + "Seconds", w[t] = L + "Milliseconds", w)[C], F = C === c ? this.$D + (I - this.$W) : I;
416
- if (C === l || C === b) {
417
- var H = this.clone().set(y, 1);
418
- H.$d[_](F), H.init(), this.$d = H.set(y, Math.min(this.$D, H.daysInMonth())).$d;
419
- } else _ && this.$d[_](F);
420
- return this.init(), this;
421
- }, O.set = function(M, I) {
422
- return this.clone().$set(M, I);
423
- }, O.get = function(M) {
424
- return this[k.p(M)]();
425
- }, O.add = function(M, I) {
426
- var w, C = this;
427
- M = Number(M);
428
- var L = k.p(I), _ = function(Y) {
429
- var B = m(C);
430
- return k.w(B.date(B.date() + Math.round(Y * M)), C);
431
- };
432
- if (L === l) return this.set(l, this.$M + M);
433
- if (L === b) return this.set(b, this.$y + M);
434
- if (L === c) return _(1);
435
- if (L === d) return _(7);
436
- var F = (w = {}, w[i] = n, w[u] = s, w[o] = e, w)[L] || 1, H = this.$d.getTime() + M * F;
437
- return k.w(H, this);
438
- }, O.subtract = function(M, I) {
439
- return this.add(-1 * M, I);
440
- }, O.format = function(M) {
441
- var I = this, w = this.$locale();
442
- if (!this.isValid()) return w.invalidDate || f;
443
- var C = M || "YYYY-MM-DDTHH:mm:ssZ", L = k.z(this), _ = this.$H, F = this.$m, H = this.$M, Y = w.weekdays, B = w.months, J = w.meridiem, V = function(U, q, et, it) {
444
- return U && (U[q] || U(I, C)) || et[q].slice(0, it);
445
- }, tt = function(U) {
446
- return k.s(_ % 12 || 12, U, "0");
447
- }, G = J || function(U, q, et) {
448
- var it = U < 12 ? "AM" : "PM";
449
- return et ? it.toLowerCase() : it;
450
- };
451
- return C.replace(D, (function(U, q) {
452
- return q || (function(et) {
453
- switch (et) {
454
- case "YY":
455
- return String(I.$y).slice(-2);
456
- case "YYYY":
457
- return k.s(I.$y, 4, "0");
458
- case "M":
459
- return H + 1;
460
- case "MM":
461
- return k.s(H + 1, 2, "0");
462
- case "MMM":
463
- return V(w.monthsShort, H, B, 3);
464
- case "MMMM":
465
- return V(B, H);
466
- case "D":
467
- return I.$D;
468
- case "DD":
469
- return k.s(I.$D, 2, "0");
470
- case "d":
471
- return String(I.$W);
472
- case "dd":
473
- return V(w.weekdaysMin, I.$W, Y, 2);
474
- case "ddd":
475
- return V(w.weekdaysShort, I.$W, Y, 3);
476
- case "dddd":
477
- return Y[I.$W];
478
- case "H":
479
- return String(_);
480
- case "HH":
481
- return k.s(_, 2, "0");
482
- case "h":
483
- return tt(1);
484
- case "hh":
485
- return tt(2);
486
- case "a":
487
- return G(_, F, !0);
488
- case "A":
489
- return G(_, F, !1);
490
- case "m":
491
- return String(F);
492
- case "mm":
493
- return k.s(F, 2, "0");
494
- case "s":
495
- return String(I.$s);
496
- case "ss":
497
- return k.s(I.$s, 2, "0");
498
- case "SSS":
499
- return k.s(I.$ms, 3, "0");
500
- case "Z":
501
- return L;
502
- }
503
- return null;
504
- })(U) || L.replace(":", "");
505
- }));
506
- }, O.utcOffset = function() {
507
- return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
508
- }, O.diff = function(M, I, w) {
509
- var C, L = this, _ = k.p(I), F = m(M), H = (F.utcOffset() - this.utcOffset()) * n, Y = this - F, B = function() {
510
- return k.m(L, F);
511
- };
512
- switch (_) {
513
- case b:
514
- C = B() / 12;
515
- break;
516
- case l:
517
- C = B();
518
- break;
519
- case h:
520
- C = B() / 3;
521
- break;
522
- case d:
523
- C = (Y - H) / 6048e5;
524
- break;
525
- case c:
526
- C = (Y - H) / 864e5;
527
- break;
528
- case u:
529
- C = Y / s;
530
- break;
531
- case i:
532
- C = Y / n;
533
- break;
534
- case o:
535
- C = Y / e;
536
- break;
537
- default:
538
- C = Y;
539
- }
540
- return w ? C : k.a(C);
541
- }, O.daysInMonth = function() {
542
- return this.endOf(l).$D;
543
- }, O.$locale = function() {
544
- return T[this.$L];
545
- }, O.locale = function(M, I) {
546
- if (!M) return this.$L;
547
- var w = this.clone(), C = $(M, I, !0);
548
- return C && (w.$L = C), w;
549
- }, O.clone = function() {
550
- return k.w(this.$d, this);
551
- }, O.toDate = function() {
552
- return new Date(this.valueOf());
553
- }, O.toJSON = function() {
554
- return this.isValid() ? this.toISOString() : null;
555
- }, O.toISOString = function() {
556
- return this.$d.toISOString();
557
- }, O.toString = function() {
558
- return this.$d.toUTCString();
559
- }, E;
560
- })(), A = W.prototype;
561
- return m.prototype = A, [["$ms", t], ["$s", o], ["$m", i], ["$H", u], ["$W", c], ["$M", l], ["$y", b], ["$D", y]].forEach((function(E) {
562
- A[E[1]] = function(O) {
563
- return this.$g(O, E[0], E[1]);
564
- };
565
- })), m.extend = function(E, O) {
566
- return E.$i || (E(O, W, m), E.$i = !0), m;
567
- }, m.locale = $, m.isDayjs = g, m.unix = function(E) {
568
- return m(1e3 * E);
569
- }, m.en = T[R], m.Ls = T, m.p = {}, m;
570
- }));
571
- })(ot)), ot.exports;
572
- }
573
- var me = he();
574
- const N = /* @__PURE__ */ j(me);
575
- var at = { exports: {} }, $e = at.exports, Et;
576
- function pe() {
577
- return Et || (Et = 1, (function(r, a) {
578
- (function(e, n) {
579
- r.exports = n();
580
- })($e, (function() {
581
- var e, n, s = 1e3, t = 6e4, o = 36e5, i = 864e5, u = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, c = 31536e6, d = 2628e6, l = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/, h = { years: c, months: d, days: i, hours: o, minutes: t, seconds: s, milliseconds: 1, weeks: 6048e5 }, b = function(T) {
582
- return T instanceof z;
583
- }, y = function(T, v, g) {
584
- return new z(T, g, v.$l);
585
- }, f = function(T) {
586
- return n.p(T) + "s";
587
- }, S = function(T) {
588
- return T < 0;
589
- }, D = function(T) {
590
- return S(T) ? Math.ceil(T) : Math.floor(T);
591
- }, x = function(T) {
592
- return Math.abs(T);
593
- }, p = function(T, v) {
594
- return T ? S(T) ? { negative: !0, format: "" + x(T) + v } : { negative: !1, format: "" + T + v } : { negative: !1, format: "" };
595
- }, z = (function() {
596
- function T(g, $, m) {
597
- var k = this;
598
- if (this.$d = {}, this.$l = m, g === void 0 && (this.$ms = 0, this.parseFromMilliseconds()), $) return y(g * h[f($)], this);
599
- if (typeof g == "number") return this.$ms = g, this.parseFromMilliseconds(), this;
600
- if (typeof g == "object") return Object.keys(g).forEach((function(E) {
601
- k.$d[f(E)] = g[E];
602
- })), this.calMilliseconds(), this;
603
- if (typeof g == "string") {
604
- var W = g.match(l);
605
- if (W) {
606
- var A = W.slice(2).map((function(E) {
607
- return E != null ? Number(E) : 0;
608
- }));
609
- return this.$d.years = A[0], this.$d.months = A[1], this.$d.weeks = A[2], this.$d.days = A[3], this.$d.hours = A[4], this.$d.minutes = A[5], this.$d.seconds = A[6], this.calMilliseconds(), this;
610
- }
611
- }
612
- return this;
613
- }
614
- var v = T.prototype;
615
- return v.calMilliseconds = function() {
616
- var g = this;
617
- this.$ms = Object.keys(this.$d).reduce((function($, m) {
618
- return $ + (g.$d[m] || 0) * h[m];
619
- }), 0);
620
- }, v.parseFromMilliseconds = function() {
621
- var g = this.$ms;
622
- this.$d.years = D(g / c), g %= c, this.$d.months = D(g / d), g %= d, this.$d.days = D(g / i), g %= i, this.$d.hours = D(g / o), g %= o, this.$d.minutes = D(g / t), g %= t, this.$d.seconds = D(g / s), g %= s, this.$d.milliseconds = g;
623
- }, v.toISOString = function() {
624
- var g = p(this.$d.years, "Y"), $ = p(this.$d.months, "M"), m = +this.$d.days || 0;
625
- this.$d.weeks && (m += 7 * this.$d.weeks);
626
- var k = p(m, "D"), W = p(this.$d.hours, "H"), A = p(this.$d.minutes, "M"), E = this.$d.seconds || 0;
627
- this.$d.milliseconds && (E += this.$d.milliseconds / 1e3, E = Math.round(1e3 * E) / 1e3);
628
- var O = p(E, "S"), M = g.negative || $.negative || k.negative || W.negative || A.negative || O.negative, I = W.format || A.format || O.format ? "T" : "", w = (M ? "-" : "") + "P" + g.format + $.format + k.format + I + W.format + A.format + O.format;
629
- return w === "P" || w === "-P" ? "P0D" : w;
630
- }, v.toJSON = function() {
631
- return this.toISOString();
632
- }, v.format = function(g) {
633
- var $ = g || "YYYY-MM-DDTHH:mm:ss", m = { Y: this.$d.years, YY: n.s(this.$d.years, 2, "0"), YYYY: n.s(this.$d.years, 4, "0"), M: this.$d.months, MM: n.s(this.$d.months, 2, "0"), D: this.$d.days, DD: n.s(this.$d.days, 2, "0"), H: this.$d.hours, HH: n.s(this.$d.hours, 2, "0"), m: this.$d.minutes, mm: n.s(this.$d.minutes, 2, "0"), s: this.$d.seconds, ss: n.s(this.$d.seconds, 2, "0"), SSS: n.s(this.$d.milliseconds, 3, "0") };
634
- return $.replace(u, (function(k, W) {
635
- return W || String(m[k]);
636
- }));
637
- }, v.as = function(g) {
638
- return this.$ms / h[f(g)];
639
- }, v.get = function(g) {
640
- var $ = this.$ms, m = f(g);
641
- return m === "milliseconds" ? $ %= 1e3 : $ = m === "weeks" ? D($ / h[m]) : this.$d[m], $ || 0;
642
- }, v.add = function(g, $, m) {
643
- var k;
644
- return k = $ ? g * h[f($)] : b(g) ? g.$ms : y(g, this).$ms, y(this.$ms + k * (m ? -1 : 1), this);
645
- }, v.subtract = function(g, $) {
646
- return this.add(g, $, !0);
647
- }, v.locale = function(g) {
648
- var $ = this.clone();
649
- return $.$l = g, $;
650
- }, v.clone = function() {
651
- return y(this.$ms, this);
652
- }, v.humanize = function(g) {
653
- return e().add(this.$ms, "ms").locale(this.$l).fromNow(!g);
654
- }, v.valueOf = function() {
655
- return this.asMilliseconds();
656
- }, v.milliseconds = function() {
657
- return this.get("milliseconds");
658
- }, v.asMilliseconds = function() {
659
- return this.as("milliseconds");
660
- }, v.seconds = function() {
661
- return this.get("seconds");
662
- }, v.asSeconds = function() {
663
- return this.as("seconds");
664
- }, v.minutes = function() {
665
- return this.get("minutes");
666
- }, v.asMinutes = function() {
667
- return this.as("minutes");
668
- }, v.hours = function() {
669
- return this.get("hours");
670
- }, v.asHours = function() {
671
- return this.as("hours");
672
- }, v.days = function() {
673
- return this.get("days");
674
- }, v.asDays = function() {
675
- return this.as("days");
676
- }, v.weeks = function() {
677
- return this.get("weeks");
678
- }, v.asWeeks = function() {
679
- return this.as("weeks");
680
- }, v.months = function() {
681
- return this.get("months");
682
- }, v.asMonths = function() {
683
- return this.as("months");
684
- }, v.years = function() {
685
- return this.get("years");
686
- }, v.asYears = function() {
687
- return this.as("years");
688
- }, T;
689
- })(), R = function(T, v, g) {
690
- return T.add(v.years() * g, "y").add(v.months() * g, "M").add(v.days() * g, "d").add(v.hours() * g, "h").add(v.minutes() * g, "m").add(v.seconds() * g, "s").add(v.milliseconds() * g, "ms");
691
- };
692
- return function(T, v, g) {
693
- e = g, n = g().$utils(), g.duration = function(k, W) {
694
- var A = g.locale();
695
- return y(k, { $l: A }, W);
696
- }, g.isDuration = b;
697
- var $ = v.prototype.add, m = v.prototype.subtract;
698
- v.prototype.add = function(k, W) {
699
- return b(k) ? R(this, k, 1) : $.bind(this)(k, W);
700
- }, v.prototype.subtract = function(k, W) {
701
- return b(k) ? R(this, k, -1) : m.bind(this)(k, W);
702
- };
703
- };
704
- }));
705
- })(at)), at.exports;
706
- }
707
- var ge = pe();
708
- const ve = /* @__PURE__ */ j(ge);
709
- var ut = { exports: {} }, ye = ut.exports, It;
710
- function Se() {
711
- return It || (It = 1, (function(r, a) {
712
- (function(e, n) {
713
- r.exports = n();
714
- })(ye, (function() {
715
- return function(e, n, s) {
716
- n.prototype.isBetween = function(t, o, i, u) {
717
- var c = s(t), d = s(o), l = (u = u || "()")[0] === "(", h = u[1] === ")";
718
- return (l ? this.isAfter(c, i) : !this.isBefore(c, i)) && (h ? this.isBefore(d, i) : !this.isAfter(d, i)) || (l ? this.isBefore(c, i) : !this.isAfter(c, i)) && (h ? this.isAfter(d, i) : !this.isBefore(d, i));
719
- };
720
- };
721
- }));
722
- })(ut)), ut.exports;
723
- }
724
- var be = Se();
725
- const xe = /* @__PURE__ */ j(be);
726
- var ct = { exports: {} }, Me = ct.exports, zt;
727
- function we() {
728
- return zt || (zt = 1, (function(r, a) {
729
- (function(e, n) {
730
- r.exports = n();
731
- })(Me, (function() {
732
- var e = "day";
733
- return function(n, s, t) {
734
- var o = function(c) {
735
- return c.add(4 - c.isoWeekday(), e);
736
- }, i = s.prototype;
737
- i.isoWeekYear = function() {
738
- return o(this).year();
739
- }, i.isoWeek = function(c) {
740
- if (!this.$utils().u(c)) return this.add(7 * (c - this.isoWeek()), e);
741
- var d, l, h, b, y = o(this), f = (d = this.isoWeekYear(), l = this.$u, h = (l ? t.utc : t)().year(d).startOf("year"), b = 4 - h.isoWeekday(), h.isoWeekday() > 4 && (b += 7), h.add(b, e));
742
- return y.diff(f, "week") + 1;
743
- }, i.isoWeekday = function(c) {
744
- return this.$utils().u(c) ? this.day() || 7 : this.day(this.day() % 7 ? c : c - 7);
745
- };
746
- var u = i.startOf;
747
- i.startOf = function(c, d) {
748
- var l = this.$utils(), h = !!l.u(d) || d;
749
- return l.p(c) === "isoweek" ? h ? this.date(this.date() - (this.isoWeekday() - 1)).startOf("day") : this.date(this.date() - 1 - (this.isoWeekday() - 1) + 7).endOf("day") : u.bind(this)(c, d);
750
- };
751
- };
752
- }));
753
- })(ct)), ct.exports;
754
- }
755
- var De = we();
756
- const Oe = /* @__PURE__ */ j(De);
757
- var lt = { exports: {} }, ke = lt.exports, Ct;
758
- function Te() {
759
- return Ct || (Ct = 1, (function(r, a) {
760
- (function(e, n) {
761
- r.exports = n();
762
- })(ke, (function() {
763
- return function(e, n) {
764
- n.prototype.isSameOrAfter = function(s, t) {
765
- return this.isSame(s, t) || this.isAfter(s, t);
766
- };
767
- };
768
- }));
769
- })(lt)), lt.exports;
770
- }
771
- var Ee = Te();
772
- const Ie = /* @__PURE__ */ j(Ee);
773
- var ft = { exports: {} }, ze = ft.exports, Lt;
774
- function Ce() {
775
- return Lt || (Lt = 1, (function(r, a) {
776
- (function(e, n) {
777
- r.exports = n();
778
- })(ze, (function() {
779
- return function(e, n) {
780
- n.prototype.isSameOrBefore = function(s, t) {
781
- return this.isSame(s, t) || this.isBefore(s, t);
782
- };
783
- };
784
- }));
785
- })(ft)), ft.exports;
786
- }
787
- var Le = Ce();
788
- const Re = /* @__PURE__ */ j(Le);
789
- var dt = { exports: {} }, _e = dt.exports, Rt;
790
- function We() {
791
- return Rt || (Rt = 1, (function(r, a) {
792
- (function(e, n) {
793
- r.exports = n();
794
- })(_e, (function() {
795
- return function(e, n, s) {
796
- n.prototype.isToday = function() {
797
- var t = "YYYY-MM-DD", o = s();
798
- return this.format(t) === o.format(t);
799
- };
800
- };
801
- }));
802
- })(dt)), dt.exports;
803
- }
804
- var Pe = We();
805
- const Ne = /* @__PURE__ */ j(Pe);
806
- var ht = { exports: {} }, Fe = ht.exports, _t;
807
- function He() {
808
- return _t || (_t = 1, (function(r, a) {
809
- (function(e, n) {
810
- r.exports = n();
811
- })(Fe, (function() {
812
- return function(e, n, s) {
813
- var t = n.prototype, o = function(l) {
814
- return l && (l.indexOf ? l : l.s);
815
- }, i = function(l, h, b, y, f) {
816
- var S = l.name ? l : l.$locale(), D = o(S[h]), x = o(S[b]), p = D || x.map((function(R) {
817
- return R.slice(0, y);
818
- }));
819
- if (!f) return p;
820
- var z = S.weekStart;
821
- return p.map((function(R, T) {
822
- return p[(T + (z || 0)) % 7];
823
- }));
824
- }, u = function() {
825
- return s.Ls[s.locale()];
826
- }, c = function(l, h) {
827
- return l.formats[h] || (function(b) {
828
- return b.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, (function(y, f, S) {
829
- return f || S.slice(1);
830
- }));
831
- })(l.formats[h.toUpperCase()]);
832
- }, d = function() {
833
- var l = this;
834
- return { months: function(h) {
835
- return h ? h.format("MMMM") : i(l, "months");
836
- }, monthsShort: function(h) {
837
- return h ? h.format("MMM") : i(l, "monthsShort", "months", 3);
838
- }, firstDayOfWeek: function() {
839
- return l.$locale().weekStart || 0;
840
- }, weekdays: function(h) {
841
- return h ? h.format("dddd") : i(l, "weekdays");
842
- }, weekdaysMin: function(h) {
843
- return h ? h.format("dd") : i(l, "weekdaysMin", "weekdays", 2);
844
- }, weekdaysShort: function(h) {
845
- return h ? h.format("ddd") : i(l, "weekdaysShort", "weekdays", 3);
846
- }, longDateFormat: function(h) {
847
- return c(l.$locale(), h);
848
- }, meridiem: this.$locale().meridiem, ordinal: this.$locale().ordinal };
849
- };
850
- t.localeData = function() {
851
- return d.bind(this)();
852
- }, s.localeData = function() {
853
- var l = u();
854
- return { firstDayOfWeek: function() {
855
- return l.weekStart || 0;
856
- }, weekdays: function() {
857
- return s.weekdays();
858
- }, weekdaysShort: function() {
859
- return s.weekdaysShort();
860
- }, weekdaysMin: function() {
861
- return s.weekdaysMin();
862
- }, months: function() {
863
- return s.months();
864
- }, monthsShort: function() {
865
- return s.monthsShort();
866
- }, longDateFormat: function(h) {
867
- return c(l, h);
868
- }, meridiem: l.meridiem, ordinal: l.ordinal };
869
- }, s.months = function() {
870
- return i(u(), "months");
871
- }, s.monthsShort = function() {
872
- return i(u(), "monthsShort", "months", 3);
873
- }, s.weekdays = function(l) {
874
- return i(u(), "weekdays", null, null, l);
875
- }, s.weekdaysShort = function(l) {
876
- return i(u(), "weekdaysShort", "weekdays", 3, l);
877
- }, s.weekdaysMin = function(l) {
878
- return i(u(), "weekdaysMin", "weekdays", 2, l);
879
- };
880
- };
881
- }));
882
- })(ht)), ht.exports;
883
- }
884
- var Ae = He();
885
- const Ye = /* @__PURE__ */ j(Ae);
886
- var mt = { exports: {} }, Ue = mt.exports, Wt;
887
- function je() {
888
- return Wt || (Wt = 1, (function(r, a) {
889
- (function(e, n) {
890
- r.exports = n();
891
- })(Ue, (function() {
892
- return function(e, n, s) {
893
- var t = function(o, i) {
894
- if (!i || !i.length || i.length === 1 && !i[0] || i.length === 1 && Array.isArray(i[0]) && !i[0].length) return null;
895
- var u;
896
- i.length === 1 && i[0].length > 0 && (i = i[0]), u = (i = i.filter((function(d) {
897
- return d;
898
- })))[0];
899
- for (var c = 1; c < i.length; c += 1) i[c].isValid() && !i[c][o](u) || (u = i[c]);
900
- return u;
901
- };
902
- s.max = function() {
903
- var o = [].slice.call(arguments, 0);
904
- return t("isAfter", o);
905
- }, s.min = function() {
906
- var o = [].slice.call(arguments, 0);
907
- return t("isBefore", o);
908
- };
909
- };
910
- }));
911
- })(mt)), mt.exports;
912
- }
913
- var Be = je();
914
- const qe = /* @__PURE__ */ j(Be);
915
- var $t = { exports: {} }, Ve = $t.exports, Pt;
916
- function Ge() {
917
- return Pt || (Pt = 1, (function(r, a) {
918
- (function(e, n) {
919
- r.exports = n();
920
- })(Ve, (function() {
921
- var e = { year: 0, month: 1, day: 2, hour: 3, minute: 4, second: 5 }, n = {};
922
- return function(s, t, o) {
923
- var i, u = function(h, b, y) {
924
- y === void 0 && (y = {});
925
- var f = new Date(h), S = (function(D, x) {
926
- x === void 0 && (x = {});
927
- var p = x.timeZoneName || "short", z = D + "|" + p, R = n[z];
928
- return R || (R = new Intl.DateTimeFormat("en-US", { hour12: !1, timeZone: D, year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit", timeZoneName: p }), n[z] = R), R;
929
- })(b, y);
930
- return S.formatToParts(f);
931
- }, c = function(h, b) {
932
- for (var y = u(h, b), f = [], S = 0; S < y.length; S += 1) {
933
- var D = y[S], x = D.type, p = D.value, z = e[x];
934
- z >= 0 && (f[z] = parseInt(p, 10));
935
- }
936
- var R = f[3], T = R === 24 ? 0 : R, v = f[0] + "-" + f[1] + "-" + f[2] + " " + T + ":" + f[4] + ":" + f[5] + ":000", g = +h;
937
- return (o.utc(v).valueOf() - (g -= g % 1e3)) / 6e4;
938
- }, d = t.prototype;
939
- d.tz = function(h, b) {
940
- h === void 0 && (h = i);
941
- var y, f = this.utcOffset(), S = this.toDate(), D = S.toLocaleString("en-US", { timeZone: h }), x = Math.round((S - new Date(D)) / 1e3 / 60), p = 15 * -Math.round(S.getTimezoneOffset() / 15) - x;
942
- if (!Number(p)) y = this.utcOffset(0, b);
943
- else if (y = o(D, { locale: this.$L }).$set("millisecond", this.$ms).utcOffset(p, !0), b) {
944
- var z = y.utcOffset();
945
- y = y.add(f - z, "minute");
946
- }
947
- return y.$x.$timezone = h, y;
948
- }, d.offsetName = function(h) {
949
- var b = this.$x.$timezone || o.tz.guess(), y = u(this.valueOf(), b, { timeZoneName: h }).find((function(f) {
950
- return f.type.toLowerCase() === "timezonename";
951
- }));
952
- return y && y.value;
953
- };
954
- var l = d.startOf;
955
- d.startOf = function(h, b) {
956
- if (!this.$x || !this.$x.$timezone) return l.call(this, h, b);
957
- var y = o(this.format("YYYY-MM-DD HH:mm:ss:SSS"), { locale: this.$L });
958
- return l.call(y, h, b).tz(this.$x.$timezone, !0);
959
- }, o.tz = function(h, b, y) {
960
- var f = y && b, S = y || b || i, D = c(+o(), S);
961
- if (typeof h != "string") return o(h).tz(S);
962
- var x = (function(T, v, g) {
963
- var $ = T - 60 * v * 1e3, m = c($, g);
964
- if (v === m) return [$, v];
965
- var k = c($ -= 60 * (m - v) * 1e3, g);
966
- return m === k ? [$, m] : [T - 60 * Math.min(m, k) * 1e3, Math.max(m, k)];
967
- })(o.utc(h, f).valueOf(), D, S), p = x[0], z = x[1], R = o(p).utcOffset(z);
968
- return R.$x.$timezone = S, R;
969
- }, o.tz.guess = function() {
970
- return Intl.DateTimeFormat().resolvedOptions().timeZone;
971
- }, o.tz.setDefault = function(h) {
972
- i = h;
973
- };
974
- };
975
- }));
976
- })($t)), $t.exports;
977
- }
978
- var Xe = Ge();
979
- const Ze = /* @__PURE__ */ j(Xe);
980
- var pt = { exports: {} }, Je = pt.exports, Nt;
981
- function Ke() {
982
- return Nt || (Nt = 1, (function(r, a) {
983
- (function(e, n) {
984
- r.exports = n();
985
- })(Je, (function() {
986
- return function(e, n, s) {
987
- s.updateLocale = function(t, o) {
988
- var i = s.Ls[t];
989
- if (i) return (o ? Object.keys(o) : []).forEach((function(u) {
990
- i[u] = o[u];
991
- })), i;
992
- };
993
- };
994
- }));
995
- })(pt)), pt.exports;
996
- }
997
- var Qe = Ke();
998
- const tn = /* @__PURE__ */ j(Qe);
999
- var gt = { exports: {} }, en = gt.exports, Ft;
1000
- function nn() {
1001
- return Ft || (Ft = 1, (function(r, a) {
1002
- (function(e, n) {
1003
- r.exports = n();
1004
- })(en, (function() {
1005
- var e = "minute", n = /[+-]\d\d(?::?\d\d)?/g, s = /([+-]|\d\d)/g;
1006
- return function(t, o, i) {
1007
- var u = o.prototype;
1008
- i.utc = function(f) {
1009
- var S = { date: f, utc: !0, args: arguments };
1010
- return new o(S);
1011
- }, u.utc = function(f) {
1012
- var S = i(this.toDate(), { locale: this.$L, utc: !0 });
1013
- return f ? S.add(this.utcOffset(), e) : S;
1014
- }, u.local = function() {
1015
- return i(this.toDate(), { locale: this.$L, utc: !1 });
1016
- };
1017
- var c = u.parse;
1018
- u.parse = function(f) {
1019
- f.utc && (this.$u = !0), this.$utils().u(f.$offset) || (this.$offset = f.$offset), c.call(this, f);
1020
- };
1021
- var d = u.init;
1022
- u.init = function() {
1023
- if (this.$u) {
1024
- var f = this.$d;
1025
- this.$y = f.getUTCFullYear(), this.$M = f.getUTCMonth(), this.$D = f.getUTCDate(), this.$W = f.getUTCDay(), this.$H = f.getUTCHours(), this.$m = f.getUTCMinutes(), this.$s = f.getUTCSeconds(), this.$ms = f.getUTCMilliseconds();
1026
- } else d.call(this);
1027
- };
1028
- var l = u.utcOffset;
1029
- u.utcOffset = function(f, S) {
1030
- var D = this.$utils().u;
1031
- if (D(f)) return this.$u ? 0 : D(this.$offset) ? l.call(this) : this.$offset;
1032
- if (typeof f == "string" && (f = (function(R) {
1033
- R === void 0 && (R = "");
1034
- var T = R.match(n);
1035
- if (!T) return null;
1036
- var v = ("" + T[0]).match(s) || ["-", 0, 0], g = v[0], $ = 60 * +v[1] + +v[2];
1037
- return $ === 0 ? 0 : g === "+" ? $ : -$;
1038
- })(f), f === null)) return this;
1039
- var x = Math.abs(f) <= 16 ? 60 * f : f;
1040
- if (x === 0) return this.utc(S);
1041
- var p = this.clone();
1042
- if (S) return p.$offset = x, p.$u = !1, p;
1043
- var z = this.$u ? this.toDate().getTimezoneOffset() : -1 * this.utcOffset();
1044
- return (p = this.local().add(x + z, e)).$offset = x, p.$x.$localOffset = z, p;
1045
- };
1046
- var h = u.format;
1047
- u.format = function(f) {
1048
- var S = f || (this.$u ? "YYYY-MM-DDTHH:mm:ss[Z]" : "");
1049
- return h.call(this, S);
1050
- }, u.valueOf = function() {
1051
- var f = this.$utils().u(this.$offset) ? 0 : this.$offset + (this.$x.$localOffset || this.$d.getTimezoneOffset());
1052
- return this.$d.valueOf() - 6e4 * f;
1053
- }, u.isUTC = function() {
1054
- return !!this.$u;
1055
- }, u.toISOString = function() {
1056
- return this.toDate().toISOString();
1057
- }, u.toString = function() {
1058
- return this.toDate().toUTCString();
1059
- };
1060
- var b = u.toDate;
1061
- u.toDate = function(f) {
1062
- return f === "s" && this.$offset ? i(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate() : b.call(this);
1063
- };
1064
- var y = u.diff;
1065
- u.diff = function(f, S, D) {
1066
- if (f && this.$u === f.$u) return y.call(this, f, S, D);
1067
- var x = this.local(), p = i(f).local();
1068
- return y.call(x, p, S, D);
1069
- };
1070
- };
1071
- }));
1072
- })(gt)), gt.exports;
1073
- }
1074
- var rn = nn();
1075
- const sn = /* @__PURE__ */ j(rn);
1076
- var vt = { exports: {} }, on = vt.exports, Ht;
1077
- function an() {
1078
- return Ht || (Ht = 1, (function(r, a) {
1079
- (function(e, n) {
1080
- r.exports = n();
1081
- })(on, (function() {
1082
- return function(e, n) {
1083
- n.prototype.weekday = function(s) {
1084
- var t = this.$locale().weekStart || 0, o = this.$W, i = (o < t ? o + 7 : o) - t;
1085
- return this.$utils().u(s) ? i : this.subtract(i, "day").add(s, "day");
1086
- };
1087
- };
1088
- }));
1089
- })(vt)), vt.exports;
1090
- }
1091
- var un = an();
1092
- const cn = /* @__PURE__ */ j(un);
1093
- N.extend(qe);
1094
- N.extend(ve);
1095
- N.extend(cn);
1096
- N.extend(Ne);
1097
- N.extend(sn);
1098
- N.extend(Ze);
1099
- N.extend(Ie);
1100
- N.extend(Re);
1101
- N.extend(xe);
1102
- N.extend(Ye);
1103
- N.extend(tn);
1104
- N.extend(Oe);
1105
- const ln = {
1106
- minute: 1,
1107
- hour: 60,
1108
- day: 1440,
1109
- week: 1440 * 7,
1110
- month: 1440 * 30
1111
- }, fn = (r, a, e, n) => a === "left" ? Math.min(r, e - n) : a === "right" ? Math.max(r, -e + n) : r, dn = (r, a, e) => a === "left" && r < 0 ? Math.floor(r / e) * e : a === "right" && r > 0 ? Math.ceil(r / e) * e : r, hn = (r, a, e, n) => {
1112
- const s = { offsetStartDate: e, offsetEndDate: n };
1113
- switch (r) {
1114
- case "bar":
1115
- return { ...s, offsetX: a, offsetWidth: 0 };
1116
- case "left":
1117
- return { ...s, offsetX: a, offsetWidth: -a };
1118
- case "right":
1119
- return { ...s, offsetX: 0, offsetWidth: a };
1120
- default:
1121
- return { ...s, offsetX: 0, offsetWidth: 0 };
1122
- }
1123
- }, At = 8, mn = (r) => {
1124
- const e = r.currentTarget.getBoundingClientRect(), n = r.clientX - e.left;
1125
- return n <= At ? "left" : n >= e.width - At ? "right" : "bar";
1126
- };
1127
- function $n(r, a) {
1128
- const {
1129
- rawTasks: e,
1130
- selectedScale: n,
1131
- setCurrentTask: s,
1132
- setDragOffset: t,
1133
- clearDragOffset: o,
1134
- setRawTasks: i
1135
- } = Jt(), u = St(null), c = St(null), d = Z[n], { basePxPerDragStep: l, dragStepAmount: h, dragStepUnit: b } = d, y = h * ln[b] / l, f = (x) => {
1136
- const p = u.current;
1137
- if (!p) return;
1138
- let z = x.clientX - p.initialClientX;
1139
- z = fn(z, p.mode, r.barWidth, l), z = dn(z, p.mode, l);
1140
- const R = Math.round(z / p.basePxPerDragStep);
1141
- if (R === p.dragSteps) return;
1142
- p.dragSteps = R;
1143
- const T = R * p.basePxPerDragStep, v = T * p.minutesPerPixel, g = p.mode === "right" ? p.initialStartDate : p.initialStartDate.add(v, "minute"), $ = p.mode === "left" ? p.initialEndDate : p.initialEndDate.add(v, "minute");
1144
- t(r.id, hn(p.mode, T, g, $));
1145
- }, S = () => {
1146
- var T;
1147
- document.removeEventListener("pointermove", f), document.removeEventListener("pointerup", S), document.removeEventListener("pointercancel", S);
1148
- const x = u.current;
1149
- if (!x) return;
1150
- const p = (v) => v.add(x.dragSteps * h, b).toISOString(), z = e.map((v) => {
1151
- if (v.id !== r.id) return v;
1152
- switch (x.mode) {
1153
- case "bar":
1154
- return {
1155
- ...v,
1156
- startDate: p(N(v.startDate)),
1157
- endDate: p(N(v.endDate))
1158
- };
1159
- case "left":
1160
- return { ...v, startDate: p(N(v.startDate)) };
1161
- case "right":
1162
- return { ...v, endDate: p(N(v.endDate)) };
1163
- default:
1164
- return v;
1165
- }
1166
- });
1167
- i(z), a == null || a(z);
1168
- const R = c.current;
1169
- R !== null && ((T = document.getElementById(`task-${r.id}`)) == null || T.releasePointerCapture(R)), c.current = null, u.current = null, s(null), o(r.id);
1170
- };
1171
- return { onPointerDown: (x) => {
1172
- const p = mn(x);
1173
- u.current = {
1174
- mode: p,
1175
- initialClientX: x.clientX,
1176
- initialStartDate: N(r.startDate),
1177
- initialEndDate: N(r.endDate),
1178
- dragSteps: 0,
1179
- basePxPerDragStep: l,
1180
- minutesPerPixel: y
1181
- }, s(r), x.currentTarget.setPointerCapture(x.pointerId), c.current = x.pointerId, document.addEventListener("pointermove", f), document.addEventListener("pointerup", S), document.addEventListener("pointercancel", S);
1182
- } };
1183
- }
1184
- const Yt = 8, pn = {
1185
- day: "MMM D, h A",
1186
- week: "MMM D",
1187
- month: "MMM D",
1188
- year: "MMM YYYY"
1189
- };
1190
- function gn({
1191
- currentTask: r,
1192
- onTasksChange: a
1193
- }) {
1194
- const e = St(null), { onPointerDown: n } = $n(r, a), [s, t] = Mt("grab"), o = rt((D) => D.dragOffsets[r.id]), i = rt((D) => {
1195
- var x;
1196
- return ((x = D.currentTask) == null ? void 0 : x.id) === r.id;
1197
- }), u = rt((D) => D.selectedScale), c = (o == null ? void 0 : o.offsetX) ?? 0, d = (o == null ? void 0 : o.offsetWidth) ?? 0, l = r.barLeft + c, h = r.barWidth + d, b = Qt((D) => {
1198
- const x = e.current;
1199
- if (!x) return;
1200
- const p = x.getBoundingClientRect(), z = D.clientX - p.left;
1201
- z <= Yt || z >= p.width - Yt ? t("ew-resize") : t("grab");
1202
- }, []), y = pn[u], f = o == null ? void 0 : o.offsetStartDate.format(y), S = o == null ? void 0 : o.offsetEndDate.format(y);
1203
- return /* @__PURE__ */ X(
1204
- "div",
1205
- {
1206
- ref: e,
1207
- id: `task-${r.id}`,
1208
- className: `gantt-task-bar ${i ? "dragging" : ""}`,
1209
- onPointerDown: n,
1210
- onMouseMove: b,
1211
- onMouseLeave: () => t("grab"),
1212
- style: {
1213
- transform: `translateX(${l}px)`,
1214
- width: h,
1215
- height: bt / 2,
1216
- cursor: i ? "grabbing" : s
1217
- },
1218
- role: "button",
1219
- tabIndex: 0,
1220
- "aria-label": `Task: ${r.name}`,
1221
- children: [
1222
- /* @__PURE__ */ P("span", { className: "gantt-task-name", children: r.name }),
1223
- i && o && /* @__PURE__ */ X("div", { className: "gantt-bar-tooltip", role: "status", "aria-live": "polite", children: [
1224
- f,
1225
- " → ",
1226
- S
1227
- ] })
1228
- ]
1229
- }
1230
- );
1231
- }
1232
- function vn(r) {
1233
- const a = [];
1234
- for (const e of r) {
1235
- const n = a[a.length - 1];
1236
- n && n.label === e.label ? n.widthPx += e.widthPx : a.push({ ...e });
1237
- }
1238
- return a;
1239
- }
1240
- function yn(r) {
1241
- let a = 0;
1242
- return r.map((e) => {
1243
- const n = { ...e, left: a };
1244
- return a += e.widthPx, n;
1245
- });
1246
- }
1247
- function Sn(r) {
1248
- const a = vn(r);
1249
- return yn(a);
1250
- }
1251
- function Ut(r) {
1252
- return r.split(".").map(Number);
1253
- }
1254
- function bn(r) {
1255
- return [...r].sort((a, e) => {
1256
- const n = Ut(a.sequence), s = Ut(e.sequence), t = Math.max(n.length, s.length);
1257
- for (let o = 0; o < t; o++) {
1258
- const i = n[o] || 0, u = s[o] || 0;
1259
- if (i !== u) return i - u;
1260
- }
1261
- return 0;
1262
- });
1263
- }
1264
- function xn(r) {
1265
- return r.split(".").length - 1;
1266
- }
1267
- function Mn(r, a, e) {
1268
- return bn(r).map((s, t) => {
1269
- const o = xn(s.sequence), i = t + 1, { barMarginLeftAmount: u, barWidthSize: c } = wn(
1270
- N(s.startDate),
1271
- N(s.endDate),
1272
- a,
1273
- e
1274
- );
1275
- return {
1276
- ...s,
1277
- barLeft: u,
1278
- barWidth: c,
1279
- depth: o,
1280
- order: i,
1281
- originalOrder: i
1282
- };
1283
- });
1284
- }
1285
- function wn(r, a, e, n) {
1286
- if (!e.length)
1287
- return { barMarginLeftAmount: 0, barWidthSize: 0 };
1288
- const s = Z[n], { tickUnit: t, unitPerTick: o } = s;
1289
- let i = 0, u = 0, c = !1;
1290
- const d = r.valueOf(), l = a.valueOf();
1291
- for (const h of e) {
1292
- const b = h.startDate, y = b.add(o, t), f = h.widthPx, S = b.valueOf(), D = y.valueOf();
1293
- if (D <= d) {
1294
- i += f;
1295
- continue;
1296
- }
1297
- if (S >= l)
1298
- break;
1299
- const x = d > S ? r : b, p = l < D ? a : y, z = D - S, T = (p.valueOf() - x.valueOf()) / z;
1300
- if (!c && x.valueOf() > S) {
1301
- const v = (x.valueOf() - S) / z;
1302
- i += v * f;
1303
- }
1304
- u += T * f, c = !0;
1305
- }
1306
- return {
1307
- barMarginLeftAmount: i,
1308
- barWidthSize: Math.max(u, 1)
1309
- };
1310
- }
1311
- function Dn(r) {
1312
- let a = 1 / 0, e = -1 / 0;
1313
- for (const n of r) {
1314
- const s = N(n.startDate).valueOf(), t = N(n.endDate).valueOf();
1315
- Number.isNaN(s) || (a = Math.min(a, s)), Number.isNaN(t) || (e = Math.max(e, t));
1316
- }
1317
- return {
1318
- minDate: N(a),
1319
- maxDate: N(e)
1320
- };
1321
- }
1322
- function On(r, a, e) {
1323
- const n = Z[e], { tickUnit: s, unitPerTick: t } = n, o = ee * t;
1324
- return {
1325
- paddedMinDate: r.subtract(o, s),
1326
- paddedMaxDate: a.add(o, s)
1327
- };
1328
- }
1329
- function kn(r, a, e) {
1330
- const n = Z[e], {
1331
- tickUnit: s,
1332
- unitPerTick: t,
1333
- basePxPerDragStep: o,
1334
- dragStepUnit: i,
1335
- dragStepAmount: u
1336
- } = n, c = [];
1337
- let d = r.startOf(s);
1338
- const l = a.valueOf(), h = o / u;
1339
- for (; d.valueOf() < l; ) {
1340
- const b = d.add(t, s), f = b.diff(d, i) * h;
1341
- c.push({
1342
- startDate: d,
1343
- widthPx: f
1344
- }), d = b;
1345
- }
1346
- return c;
1347
- }
1348
- function Tn(r, a) {
1349
- const e = Z[a], { labelUnit: n, formatHeaderLabel: s } = e;
1350
- if (r.length === 0) return [];
1351
- const t = [];
1352
- let o = null;
1353
- for (const i of r) {
1354
- const u = i.startDate.startOf(n), c = u.valueOf(), d = (s == null ? void 0 : s(u)) ?? u.format();
1355
- o && o.startDate.valueOf() === c ? o.widthPx += i.widthPx : (o && t.push(o), o = {
1356
- label: d,
1357
- widthPx: i.widthPx,
1358
- startDate: u
1359
- });
1360
- }
1361
- return o && t.push(o), t;
1362
- }
1363
- function En(r, a) {
1364
- if (!r.length)
1365
- return { bottomCells: [], transformedTasks: [] };
1366
- const { minDate: e, maxDate: n } = Dn(r), { paddedMinDate: s, paddedMaxDate: t } = On(
1367
- e,
1368
- n,
1369
- a
1370
- ), o = kn(
1371
- s,
1372
- t,
1373
- a
1374
- ), i = Mn(r, o, a);
1375
- return { bottomCells: o, transformedTasks: i };
1376
- }
1377
- function In({
1378
- bottomRowCells: r,
1379
- selectedScale: a,
1380
- width: e,
1381
- scrollRef: n
1382
- }) {
1383
- const s = Z[a], [t, o] = Mt(0), i = st(() => {
1384
- const u = Tn(r, a);
1385
- return Sn(u);
1386
- }, [r, a]);
1387
- return Q(() => {
1388
- const u = n.current;
1389
- if (!u) return;
1390
- const c = () => {
1391
- const d = u.scrollLeft;
1392
- for (let l = i.length - 1; l >= 0; l--)
1393
- if (d >= i[l].left) {
1394
- o(l);
1395
- break;
1396
- }
1397
- };
1398
- return u.addEventListener("scroll", c), c(), () => u.removeEventListener("scroll", c);
1399
- }, [i, n]), /* @__PURE__ */ P("header", { className: "gantt-header", style: { width: `${e}px` }, children: /* @__PURE__ */ X("div", { className: "gantt-header-content", children: [
1400
- /* @__PURE__ */ P("div", { className: "gantt-top-header", children: /* @__PURE__ */ P("div", { className: "gantt-top-groups", children: i.map((u, c) => {
1401
- const d = c === t;
1402
- return /* @__PURE__ */ P(
1403
- "div",
1404
- {
1405
- className: `gantt-top-group ${d ? "sticky" : ""}`,
1406
- style: {
1407
- width: `${u.widthPx}px`,
1408
- ...d && { left: 0 }
1409
- },
1410
- children: /* @__PURE__ */ P("p", { className: "gantt-top-group-label", children: u.label })
1411
- },
1412
- `${u.label}-${c}`
1413
- );
1414
- }) }) }),
1415
- /* @__PURE__ */ P("div", { className: "gantt-bottom-row", children: r.map((u, c) => {
1416
- var l;
1417
- const d = ((l = s.formatTickLabel) == null ? void 0 : l.call(s, u.startDate)) || "";
1418
- return /* @__PURE__ */ P(
1419
- "div",
1420
- {
1421
- className: "gantt-bottom-cell",
1422
- style: { width: `${u.widthPx}px` },
1423
- children: d
1424
- },
1425
- `bottom-${c}`
1426
- );
1427
- }) })
1428
- ] }) });
1429
- }
1430
- function zn(r, a, e, n, s) {
1431
- if (e < 0 || s < 0)
1432
- return `M ${a} ${e} h ${(n - a) / 2}`;
1433
- const t = 7, o = 11, i = 25, u = 20, c = `M ${a} ${e}`, d = n - a, l = s - e, h = Math.abs(d), b = Math.abs(l), y = s <= e, f = s >= e, S = n >= a, D = n <= a, x = h > u, p = Math.abs(d / 2), z = Math.abs(l / 2);
1434
- function R() {
1435
- function $() {
1436
- return (S || D) && f && !x ? "downSmallHorizontal" : (S || D) && y && !x ? "upSmallHorizontal" : f && D ? "downLeft" : f && S ? "downRight" : y && D ? "upLeft" : y && S ? "upRight" : "";
1437
- }
1438
- let m = c;
1439
- switch ($()) {
1440
- case "downRight": {
1441
- m += ` h ${p - t}`, m += ` a ${t} ${t} 0 0 1 ${t} ${t}`, m += ` v ${l - t * 2}`, m += ` a ${t} ${t} 0 0 0 ${t} ${t}`, m += ` h ${p - t}`;
1442
- break;
1443
- }
1444
- case "upRight": {
1445
- m += ` h ${p - t}`, m += ` a ${t} ${t} 0 0 0 ${t} -${t}`, m += ` v -${b - t * 2}`, m += ` a ${t} ${t} 0 0 1 ${t} -${t}`, m += ` h ${p - t}`;
1446
- break;
1447
- }
1448
- case "downLeft":
1449
- case "downSmallHorizontal": {
1450
- const W = e + l / 2;
1451
- m += ` h ${o}`, m += ` a ${t} ${t} 0 0 1 ${t} ${t}`, m += ` v ${W - e - t * 2}`, m += ` a ${t} ${t} 0 0 1 -${t} ${t}`, m += ` h ${d - 2 * o}`, m += ` a ${t} ${t} 0 0 0 -${t} ${t}`, m += ` v ${W - e - t * 2}`, m += ` a ${t} ${t} 0 0 0 ${t} ${t}`, m += ` h ${o}`;
1452
- break;
1453
- }
1454
- case "upLeft":
1455
- case "upSmallHorizontal": {
1456
- const W = e + l / 2;
1457
- m += ` h ${o}`, m += ` a ${t} ${t} 0 0 0 ${t} -${t}`, m += ` v -${e - W - t * 2}`, m += ` a ${t} ${t} 0 0 0 -${t} -${t}`, m += ` h ${d - 2 * o}`, m += ` a ${t} ${t} 0 0 1 -${t} -${t}`, m += ` v -${e - W - t * 2}`, m += ` a ${t} ${t} 0 0 1 ${t} -${t}`, m += ` h ${o}`;
1458
- break;
1459
- }
1460
- default:
1461
- return m;
1462
- }
1463
- return m;
1464
- }
1465
- function T() {
1466
- let $ = c;
1467
- return f && D ? ($ += ` h ${i - o}`, $ += ` a ${t} ${t} 0 0 1 ${t} ${t}`, $ += ` v ${l - t * 2}`, $ += ` a ${t} ${t} 0 0 1 -${t} ${t}`, $ += ` h ${d - t * 2}`) : f && S ? ($ += ` h ${d + i - o}`, $ += ` a ${t} ${t} 0 0 1 ${t} ${t}`, $ += ` v ${l - t * 2}`, $ += ` a ${t} ${t} 0 0 1 -${t} ${t}`, $ += ` h -${i - o}`) : y && D ? ($ += ` h ${i - o}`, $ += ` a ${t} ${t} 0 0 0 ${t} -${t}`, $ += ` v ${l + t * 2}`, $ += ` a ${t} ${t} 0 0 0 -${t} -${t}`, $ += ` h ${d - i + o}`) : y && S && ($ += ` h ${d + i - o}`, $ += ` a ${t} ${t} 0 0 0 ${t} -${t}`, $ += ` v ${l + t * 2}`, $ += ` a ${t} ${t} 0 0 0 -${t} -${t}`, $ += ` h -${i - o}`), $;
1468
- }
1469
- function v() {
1470
- function $() {
1471
- return (S || D) && f && !x ? "downSmallHorizontal" : (S || D) && y && !x ? "upSmallHorizontal" : f && D ? "downLeft" : f && S ? "downRight" : y && D ? "upLeft" : y && S ? "upRight" : "";
1472
- }
1473
- let m = c;
1474
- switch ($()) {
1475
- case "downRight":
1476
- case "downSmallHorizontal": {
1477
- m += ` h ${-o}`, m += ` a ${t} ${t} 0 0 0 -${t} ${t}`, m += ` v ${z - t * 2}`, m += ` a ${t} ${t} 0 0 0 ${t} ${t}`, m += ` h ${o * 2 + d}`, m += ` a ${t} ${t} 0 0 1 ${t} ${t}`, m += ` v ${z - t * 2}`, m += ` a ${t} ${t} 0 0 1 -${t} ${t}`, m += ` h ${-o}`;
1478
- break;
1479
- }
1480
- case "upRight":
1481
- case "upSmallHorizontal": {
1482
- m += ` h ${-o}`, m += ` a ${t} ${t} 0 0 1 -${t} -${t}`, m += ` v ${-(z - t * 2)}`, m += ` a ${t} ${t} 0 0 1 ${t} -${t}`, m += ` h ${o * 2 + d}`, m += ` a ${t} ${t} 0 0 0 ${t} -${t}`, m += ` v ${-(z - t * 2)}`, m += ` a ${t} ${t} 0 0 0 -${t} -${t}`, m += ` h ${-o}`;
1483
- break;
1484
- }
1485
- case "downLeft": {
1486
- m += ` h ${-p + t}`, m += ` a ${t} ${t} 0 0 0 -${t} ${t}`, m += ` v ${b - t * 2}`, m += ` a ${t} ${t} 0 0 1 -${t} ${t}`, m += ` h ${-p + t}`;
1487
- break;
1488
- }
1489
- case "upLeft": {
1490
- m += ` h ${-(p - t)}`, m += ` a ${t} ${t} 0 0 1 -${t} -${t}`, m += ` v ${-(b - t * 2)}`, m += ` a ${t} ${t} 0 0 0 -${t} -${t}`, m += ` h ${-p + t}`;
1491
- break;
1492
- }
1493
- default:
1494
- return m;
1495
- }
1496
- return m;
1497
- }
1498
- function g() {
1499
- let $ = c;
1500
- return f && D ? ($ += ` h ${d - i}`, $ += ` a ${t} ${t} 0 0 0 -${t} ${t}`, $ += ` v ${l - t * 2}`, $ += ` a ${t} ${t} 0 0 0 ${t} ${t}`, $ += ` h ${i}`) : f && S ? ($ += ` h ${-i}`, $ += ` a ${t} ${t} 0 0 0 -${t} ${t}`, $ += ` v ${l - t * 2}`, $ += ` a ${t} ${t} 0 0 0 ${t} ${t}`, $ += ` h ${d + i}`) : y && D ? ($ += ` h ${d - i}`, $ += ` a ${t} ${t} 0 0 1 -${t} -${t}`, $ += ` v ${l + t * 2}`, $ += ` a ${t} ${t} 0 0 1 ${t} -${t}`, $ += ` h ${i}`) : y && S && ($ += ` h ${-i}`, $ += ` a ${t} ${t} 0 0 1 -${t} -${t}`, $ += ` v ${l + t * 2}`, $ += ` a ${t} ${t} 0 0 1 ${t} -${t}`, $ += ` h ${d + i}`), $;
1501
- }
1502
- switch (r) {
1503
- case "FS":
1504
- return R();
1505
- case "FF":
1506
- return T();
1507
- case "SF":
1508
- return v();
1509
- case "SS":
1510
- return g();
1511
- default:
1512
- return `${c} L ${n} ${s}`;
1513
- }
1514
- }
1515
- function Cn(r, a, e, n) {
1516
- const s = bt, t = r.order - 1, i = (a.order - 1) * s + s / 2 - 4, u = t * s + s / 2 + 4, c = a.barLeft, d = a.barLeft + a.barWidth, l = r.barLeft + e.offsetX, h = l + r.barWidth + e.offsetWidth, b = {
1517
- FS: [d, l],
1518
- SS: [c, l],
1519
- FF: [d, h],
1520
- SF: [c, h]
1521
- }, [y, f] = b[n];
1522
- return { fromX: y, fromY: i, toX: f, toY: u };
1523
- }
1524
- function Ln(r, a) {
1525
- const e = [];
1526
- for (const n of r) {
1527
- const s = a[n.id] ?? { offsetX: 0, offsetWidth: 0 };
1528
- for (const t of n.dependencies ?? []) {
1529
- const o = r.find((l) => l.id === t.targetId);
1530
- if (!o) continue;
1531
- const { fromX: i, fromY: u, toX: c, toY: d } = Cn(
1532
- n,
1533
- o,
1534
- s,
1535
- t.type
1536
- );
1537
- e.push({ ...t, fromX: i, fromY: u, toX: c, toY: d });
1538
- }
1539
- }
1540
- return e;
1541
- }
1542
- function Rn({
1543
- transformedTasks: r
1544
- }) {
1545
- const a = rt((n) => n.dragOffsets), e = Ln(r, a);
1546
- return /* @__PURE__ */ X(
1547
- "svg",
1548
- {
1549
- className: "gantt-dependency-arrows",
1550
- style: {
1551
- height: `${r.length * bt}px`
1552
- },
1553
- children: [
1554
- /* @__PURE__ */ P("defs", { children: /* @__PURE__ */ P(
1555
- "marker",
1556
- {
1557
- id: "arrowhead",
1558
- markerWidth: "8",
1559
- markerHeight: "8",
1560
- refX: "7",
1561
- refY: "4",
1562
- orient: "auto",
1563
- children: /* @__PURE__ */ P(
1564
- "polygon",
1565
- {
1566
- className: "gantt-dependency-arrow-head",
1567
- points: "0 0, 8 4, 0 8"
1568
- }
1569
- )
1570
- }
1571
- ) }),
1572
- e.map((n, s) => /* @__PURE__ */ P(
1573
- "path",
1574
- {
1575
- className: "gantt-dependency-arrow",
1576
- d: zn(
1577
- n.type,
1578
- n.fromX,
1579
- n.fromY,
1580
- n.toX,
1581
- n.toY
1582
- ),
1583
- markerEnd: "url(#arrowhead)",
1584
- fill: "none"
1585
- },
1586
- `arrow-${s}`
1587
- ))
1588
- ]
1589
- }
1590
- );
1591
- }
1592
- function _n({
1593
- selectedScale: r,
1594
- onScaleChange: a
1595
- }) {
1596
- return /* @__PURE__ */ P("div", { className: "gantt-scale-selector", children: /* @__PURE__ */ P(
1597
- "select",
1598
- {
1599
- className: "gantt-scale-select",
1600
- value: r,
1601
- onChange: (n) => {
1602
- a(n.target.value);
1603
- },
1604
- "aria-label": "타임라인 스케일 선택",
1605
- children: Object.keys(Z).map((n) => /* @__PURE__ */ P("option", { value: n, children: n }, n))
1606
- }
1607
- ) });
1608
- }
1609
- function Wn({
1610
- bottomRowCells: r,
1611
- height: a
1612
- }) {
1613
- const e = st(() => {
1614
- if (r.length === 0) return null;
1615
- const n = N();
1616
- let s = 0;
1617
- for (let t = 0; t < r.length; t++) {
1618
- const o = r[t], i = o.startDate, u = r[t + 1], c = (u == null ? void 0 : u.startDate) ?? i.add(1, "day");
1619
- if (n.isSameOrAfter(i) && n.isBefore(c)) {
1620
- const d = c.diff(i), h = n.diff(i) / d;
1621
- return s + h * o.widthPx;
1622
- }
1623
- s += o.widthPx;
1624
- }
1625
- return null;
1626
- }, [r]);
1627
- return e === null ? null : /* @__PURE__ */ P(
1628
- "div",
1629
- {
1630
- className: "gantt-today-marker",
1631
- style: { left: `${e}px`, height: `${a}px` },
1632
- role: "presentation",
1633
- "aria-label": "Today",
1634
- children: /* @__PURE__ */ P("span", { className: "gantt-today-label", children: "Today" })
1635
- }
1636
- );
1637
- }
1638
- function K(r, a, e) {
1639
- let n = e.initialDeps ?? [], s;
1640
- function t() {
1641
- var o, i, u, c;
1642
- let d;
1643
- e.key && ((o = e.debug) != null && o.call(e)) && (d = Date.now());
1644
- const l = r();
1645
- if (!(l.length !== n.length || l.some((y, f) => n[f] !== y)))
1646
- return s;
1647
- n = l;
1648
- let b;
1649
- if (e.key && ((i = e.debug) != null && i.call(e)) && (b = Date.now()), s = a(...l), e.key && ((u = e.debug) != null && u.call(e))) {
1650
- const y = Math.round((Date.now() - d) * 100) / 100, f = Math.round((Date.now() - b) * 100) / 100, S = f / 16, D = (x, p) => {
1651
- for (x = String(x); x.length < p; )
1652
- x = " " + x;
1653
- return x;
1654
- };
1655
- console.info(
1656
- `%c⏱ ${D(f, 5)} /${D(y, 5)} ms`,
1657
- `
1658
- font-size: .6rem;
1659
- font-weight: bold;
1660
- color: hsl(${Math.max(
1661
- 0,
1662
- Math.min(120 - 120 * S, 120)
1663
- )}deg 100% 31%);`,
1664
- e == null ? void 0 : e.key
1665
- );
1666
- }
1667
- return (c = e == null ? void 0 : e.onChange) == null || c.call(e, s), s;
1668
- }
1669
- return t.updateDeps = (o) => {
1670
- n = o;
1671
- }, t;
1672
- }
1673
- function jt(r, a) {
1674
- if (r === void 0)
1675
- throw new Error("Unexpected undefined");
1676
- return r;
1677
- }
1678
- const Pn = (r, a) => Math.abs(r - a) < 1.01, Nn = (r, a, e) => {
1679
- let n;
1680
- return function(...s) {
1681
- r.clearTimeout(n), n = r.setTimeout(() => a.apply(this, s), e);
1682
- };
1683
- }, Bt = (r) => {
1684
- const { offsetWidth: a, offsetHeight: e } = r;
1685
- return { width: a, height: e };
1686
- }, Fn = (r) => r, Hn = (r) => {
1687
- const a = Math.max(r.startIndex - r.overscan, 0), e = Math.min(r.endIndex + r.overscan, r.count - 1), n = [];
1688
- for (let s = a; s <= e; s++)
1689
- n.push(s);
1690
- return n;
1691
- }, An = (r, a) => {
1692
- const e = r.scrollElement;
1693
- if (!e)
1694
- return;
1695
- const n = r.targetWindow;
1696
- if (!n)
1697
- return;
1698
- const s = (o) => {
1699
- const { width: i, height: u } = o;
1700
- a({ width: Math.round(i), height: Math.round(u) });
1701
- };
1702
- if (s(Bt(e)), !n.ResizeObserver)
1703
- return () => {
1704
- };
1705
- const t = new n.ResizeObserver((o) => {
1706
- const i = () => {
1707
- const u = o[0];
1708
- if (u != null && u.borderBoxSize) {
1709
- const c = u.borderBoxSize[0];
1710
- if (c) {
1711
- s({ width: c.inlineSize, height: c.blockSize });
1712
- return;
1713
- }
1714
- }
1715
- s(Bt(e));
1716
- };
1717
- r.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(i) : i();
1718
- });
1719
- return t.observe(e, { box: "border-box" }), () => {
1720
- t.unobserve(e);
1721
- };
1722
- }, qt = {
1723
- passive: !0
1724
- }, Vt = typeof window > "u" ? !0 : "onscrollend" in window, Yn = (r, a) => {
1725
- const e = r.scrollElement;
1726
- if (!e)
1727
- return;
1728
- const n = r.targetWindow;
1729
- if (!n)
1730
- return;
1731
- let s = 0;
1732
- const t = r.options.useScrollendEvent && Vt ? () => {
1733
- } : Nn(
1734
- n,
1735
- () => {
1736
- a(s, !1);
1737
- },
1738
- r.options.isScrollingResetDelay
1739
- ), o = (d) => () => {
1740
- const { horizontal: l, isRtl: h } = r.options;
1741
- s = l ? e.scrollLeft * (h && -1 || 1) : e.scrollTop, t(), a(s, d);
1742
- }, i = o(!0), u = o(!1);
1743
- u(), e.addEventListener("scroll", i, qt);
1744
- const c = r.options.useScrollendEvent && Vt;
1745
- return c && e.addEventListener("scrollend", u, qt), () => {
1746
- e.removeEventListener("scroll", i), c && e.removeEventListener("scrollend", u);
1747
- };
1748
- }, Un = (r, a, e) => {
1749
- if (a != null && a.borderBoxSize) {
1750
- const n = a.borderBoxSize[0];
1751
- if (n)
1752
- return Math.round(
1753
- n[e.options.horizontal ? "inlineSize" : "blockSize"]
1754
- );
1755
- }
1756
- return r[e.options.horizontal ? "offsetWidth" : "offsetHeight"];
1757
- }, jn = (r, {
1758
- adjustments: a = 0,
1759
- behavior: e
1760
- }, n) => {
1761
- var s, t;
1762
- const o = r + a;
1763
- (t = (s = n.scrollElement) == null ? void 0 : s.scrollTo) == null || t.call(s, {
1764
- [n.options.horizontal ? "left" : "top"]: o,
1765
- behavior: e
1766
- });
1767
- };
1768
- class Bn {
1769
- constructor(a) {
1770
- this.unsubs = [], this.scrollElement = null, this.targetWindow = null, this.isScrolling = !1, this.measurementsCache = [], this.itemSizeCache = /* @__PURE__ */ new Map(), this.pendingMeasuredCacheIndexes = [], this.scrollRect = null, this.scrollOffset = null, this.scrollDirection = null, this.scrollAdjustments = 0, this.elementsCache = /* @__PURE__ */ new Map(), this.observer = /* @__PURE__ */ (() => {
1771
- let e = null;
1772
- const n = () => e || (!this.targetWindow || !this.targetWindow.ResizeObserver ? null : e = new this.targetWindow.ResizeObserver((s) => {
1773
- s.forEach((t) => {
1774
- const o = () => {
1775
- this._measureElement(t.target, t);
1776
- };
1777
- this.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(o) : o();
1778
- });
1779
- }));
1780
- return {
1781
- disconnect: () => {
1782
- var s;
1783
- (s = n()) == null || s.disconnect(), e = null;
1784
- },
1785
- observe: (s) => {
1786
- var t;
1787
- return (t = n()) == null ? void 0 : t.observe(s, { box: "border-box" });
1788
- },
1789
- unobserve: (s) => {
1790
- var t;
1791
- return (t = n()) == null ? void 0 : t.unobserve(s);
1792
- }
1793
- };
1794
- })(), this.range = null, this.setOptions = (e) => {
1795
- Object.entries(e).forEach(([n, s]) => {
1796
- typeof s > "u" && delete e[n];
1797
- }), this.options = {
1798
- debug: !1,
1799
- initialOffset: 0,
1800
- overscan: 1,
1801
- paddingStart: 0,
1802
- paddingEnd: 0,
1803
- scrollPaddingStart: 0,
1804
- scrollPaddingEnd: 0,
1805
- horizontal: !1,
1806
- getItemKey: Fn,
1807
- rangeExtractor: Hn,
1808
- onChange: () => {
1809
- },
1810
- measureElement: Un,
1811
- initialRect: { width: 0, height: 0 },
1812
- scrollMargin: 0,
1813
- gap: 0,
1814
- indexAttribute: "data-index",
1815
- initialMeasurementsCache: [],
1816
- lanes: 1,
1817
- isScrollingResetDelay: 150,
1818
- enabled: !0,
1819
- isRtl: !1,
1820
- useScrollendEvent: !1,
1821
- useAnimationFrameWithResizeObserver: !1,
1822
- ...e
1823
- };
1824
- }, this.notify = (e) => {
1825
- var n, s;
1826
- (s = (n = this.options).onChange) == null || s.call(n, this, e);
1827
- }, this.maybeNotify = K(
1828
- () => (this.calculateRange(), [
1829
- this.isScrolling,
1830
- this.range ? this.range.startIndex : null,
1831
- this.range ? this.range.endIndex : null
1832
- ]),
1833
- (e) => {
1834
- this.notify(e);
1835
- },
1836
- {
1837
- key: process.env.NODE_ENV !== "production" && "maybeNotify",
1838
- debug: () => this.options.debug,
1839
- initialDeps: [
1840
- this.isScrolling,
1841
- this.range ? this.range.startIndex : null,
1842
- this.range ? this.range.endIndex : null
1843
- ]
1844
- }
1845
- ), this.cleanup = () => {
1846
- this.unsubs.filter(Boolean).forEach((e) => e()), this.unsubs = [], this.observer.disconnect(), this.scrollElement = null, this.targetWindow = null;
1847
- }, this._didMount = () => () => {
1848
- this.cleanup();
1849
- }, this._willUpdate = () => {
1850
- var e;
1851
- const n = this.options.enabled ? this.options.getScrollElement() : null;
1852
- if (this.scrollElement !== n) {
1853
- if (this.cleanup(), !n) {
1854
- this.maybeNotify();
1855
- return;
1856
- }
1857
- this.scrollElement = n, this.scrollElement && "ownerDocument" in this.scrollElement ? this.targetWindow = this.scrollElement.ownerDocument.defaultView : this.targetWindow = ((e = this.scrollElement) == null ? void 0 : e.window) ?? null, this.elementsCache.forEach((s) => {
1858
- this.observer.observe(s);
1859
- }), this._scrollToOffset(this.getScrollOffset(), {
1860
- adjustments: void 0,
1861
- behavior: void 0
1862
- }), this.unsubs.push(
1863
- this.options.observeElementRect(this, (s) => {
1864
- this.scrollRect = s, this.maybeNotify();
1865
- })
1866
- ), this.unsubs.push(
1867
- this.options.observeElementOffset(this, (s, t) => {
1868
- this.scrollAdjustments = 0, this.scrollDirection = t ? this.getScrollOffset() < s ? "forward" : "backward" : null, this.scrollOffset = s, this.isScrolling = t, this.maybeNotify();
1869
- })
1870
- );
1871
- }
1872
- }, this.getSize = () => this.options.enabled ? (this.scrollRect = this.scrollRect ?? this.options.initialRect, this.scrollRect[this.options.horizontal ? "width" : "height"]) : (this.scrollRect = null, 0), this.getScrollOffset = () => this.options.enabled ? (this.scrollOffset = this.scrollOffset ?? (typeof this.options.initialOffset == "function" ? this.options.initialOffset() : this.options.initialOffset), this.scrollOffset) : (this.scrollOffset = null, 0), this.getFurthestMeasurement = (e, n) => {
1873
- const s = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map();
1874
- for (let o = n - 1; o >= 0; o--) {
1875
- const i = e[o];
1876
- if (s.has(i.lane))
1877
- continue;
1878
- const u = t.get(
1879
- i.lane
1880
- );
1881
- if (u == null || i.end > u.end ? t.set(i.lane, i) : i.end < u.end && s.set(i.lane, !0), s.size === this.options.lanes)
1882
- break;
1883
- }
1884
- return t.size === this.options.lanes ? Array.from(t.values()).sort((o, i) => o.end === i.end ? o.index - i.index : o.end - i.end)[0] : void 0;
1885
- }, this.getMeasurementOptions = K(
1886
- () => [
1887
- this.options.count,
1888
- this.options.paddingStart,
1889
- this.options.scrollMargin,
1890
- this.options.getItemKey,
1891
- this.options.enabled
1892
- ],
1893
- (e, n, s, t, o) => (this.pendingMeasuredCacheIndexes = [], {
1894
- count: e,
1895
- paddingStart: n,
1896
- scrollMargin: s,
1897
- getItemKey: t,
1898
- enabled: o
1899
- }),
1900
- {
1901
- key: !1
1902
- }
1903
- ), this.getMeasurements = K(
1904
- () => [this.getMeasurementOptions(), this.itemSizeCache],
1905
- ({ count: e, paddingStart: n, scrollMargin: s, getItemKey: t, enabled: o }, i) => {
1906
- if (!o)
1907
- return this.measurementsCache = [], this.itemSizeCache.clear(), [];
1908
- this.measurementsCache.length === 0 && (this.measurementsCache = this.options.initialMeasurementsCache, this.measurementsCache.forEach((d) => {
1909
- this.itemSizeCache.set(d.key, d.size);
1910
- }));
1911
- const u = this.pendingMeasuredCacheIndexes.length > 0 ? Math.min(...this.pendingMeasuredCacheIndexes) : 0;
1912
- this.pendingMeasuredCacheIndexes = [];
1913
- const c = this.measurementsCache.slice(0, u);
1914
- for (let d = u; d < e; d++) {
1915
- const l = t(d), h = this.options.lanes === 1 ? c[d - 1] : this.getFurthestMeasurement(c, d), b = h ? h.end + this.options.gap : n + s, y = i.get(l), f = typeof y == "number" ? y : this.options.estimateSize(d), S = b + f, D = h ? h.lane : d % this.options.lanes;
1916
- c[d] = {
1917
- index: d,
1918
- start: b,
1919
- size: f,
1920
- end: S,
1921
- key: l,
1922
- lane: D
1923
- };
1924
- }
1925
- return this.measurementsCache = c, c;
1926
- },
1927
- {
1928
- key: process.env.NODE_ENV !== "production" && "getMeasurements",
1929
- debug: () => this.options.debug
1930
- }
1931
- ), this.calculateRange = K(
1932
- () => [
1933
- this.getMeasurements(),
1934
- this.getSize(),
1935
- this.getScrollOffset(),
1936
- this.options.lanes
1937
- ],
1938
- (e, n, s, t) => this.range = e.length > 0 && n > 0 ? qn({
1939
- measurements: e,
1940
- outerSize: n,
1941
- scrollOffset: s,
1942
- lanes: t
1943
- }) : null,
1944
- {
1945
- key: process.env.NODE_ENV !== "production" && "calculateRange",
1946
- debug: () => this.options.debug
1947
- }
1948
- ), this.getVirtualIndexes = K(
1949
- () => {
1950
- let e = null, n = null;
1951
- const s = this.calculateRange();
1952
- return s && (e = s.startIndex, n = s.endIndex), this.maybeNotify.updateDeps([this.isScrolling, e, n]), [
1953
- this.options.rangeExtractor,
1954
- this.options.overscan,
1955
- this.options.count,
1956
- e,
1957
- n
1958
- ];
1959
- },
1960
- (e, n, s, t, o) => t === null || o === null ? [] : e({
1961
- startIndex: t,
1962
- endIndex: o,
1963
- overscan: n,
1964
- count: s
1965
- }),
1966
- {
1967
- key: process.env.NODE_ENV !== "production" && "getVirtualIndexes",
1968
- debug: () => this.options.debug
1969
- }
1970
- ), this.indexFromElement = (e) => {
1971
- const n = this.options.indexAttribute, s = e.getAttribute(n);
1972
- return s ? parseInt(s, 10) : (console.warn(
1973
- `Missing attribute name '${n}={index}' on measured element.`
1974
- ), -1);
1975
- }, this._measureElement = (e, n) => {
1976
- const s = this.indexFromElement(e), t = this.measurementsCache[s];
1977
- if (!t)
1978
- return;
1979
- const o = t.key, i = this.elementsCache.get(o);
1980
- i !== e && (i && this.observer.unobserve(i), this.observer.observe(e), this.elementsCache.set(o, e)), e.isConnected && this.resizeItem(s, this.options.measureElement(e, n, this));
1981
- }, this.resizeItem = (e, n) => {
1982
- const s = this.measurementsCache[e];
1983
- if (!s)
1984
- return;
1985
- const t = this.itemSizeCache.get(s.key) ?? s.size, o = n - t;
1986
- o !== 0 && ((this.shouldAdjustScrollPositionOnItemSizeChange !== void 0 ? this.shouldAdjustScrollPositionOnItemSizeChange(s, o, this) : s.start < this.getScrollOffset() + this.scrollAdjustments) && (process.env.NODE_ENV !== "production" && this.options.debug && console.info("correction", o), this._scrollToOffset(this.getScrollOffset(), {
1987
- adjustments: this.scrollAdjustments += o,
1988
- behavior: void 0
1989
- })), this.pendingMeasuredCacheIndexes.push(s.index), this.itemSizeCache = new Map(this.itemSizeCache.set(s.key, n)), this.notify(!1));
1990
- }, this.measureElement = (e) => {
1991
- if (!e) {
1992
- this.elementsCache.forEach((n, s) => {
1993
- n.isConnected || (this.observer.unobserve(n), this.elementsCache.delete(s));
1994
- });
1995
- return;
1996
- }
1997
- this._measureElement(e, void 0);
1998
- }, this.getVirtualItems = K(
1999
- () => [this.getVirtualIndexes(), this.getMeasurements()],
2000
- (e, n) => {
2001
- const s = [];
2002
- for (let t = 0, o = e.length; t < o; t++) {
2003
- const i = e[t], u = n[i];
2004
- s.push(u);
2005
- }
2006
- return s;
2007
- },
2008
- {
2009
- key: process.env.NODE_ENV !== "production" && "getVirtualItems",
2010
- debug: () => this.options.debug
2011
- }
2012
- ), this.getVirtualItemForOffset = (e) => {
2013
- const n = this.getMeasurements();
2014
- if (n.length !== 0)
2015
- return jt(
2016
- n[Kt(
2017
- 0,
2018
- n.length - 1,
2019
- (s) => jt(n[s]).start,
2020
- e
2021
- )]
2022
- );
2023
- }, this.getOffsetForAlignment = (e, n, s = 0) => {
2024
- const t = this.getSize(), o = this.getScrollOffset();
2025
- n === "auto" && (n = e >= o + t ? "end" : "start"), n === "center" ? e += (s - t) / 2 : n === "end" && (e -= t);
2026
- const i = this.getTotalSize() + this.options.scrollMargin - t;
2027
- return Math.max(Math.min(i, e), 0);
2028
- }, this.getOffsetForIndex = (e, n = "auto") => {
2029
- e = Math.max(0, Math.min(e, this.options.count - 1));
2030
- const s = this.measurementsCache[e];
2031
- if (!s)
2032
- return;
2033
- const t = this.getSize(), o = this.getScrollOffset();
2034
- if (n === "auto")
2035
- if (s.end >= o + t - this.options.scrollPaddingEnd)
2036
- n = "end";
2037
- else if (s.start <= o + this.options.scrollPaddingStart)
2038
- n = "start";
2039
- else
2040
- return [o, n];
2041
- const i = n === "end" ? s.end + this.options.scrollPaddingEnd : s.start - this.options.scrollPaddingStart;
2042
- return [
2043
- this.getOffsetForAlignment(i, n, s.size),
2044
- n
2045
- ];
2046
- }, this.isDynamicMode = () => this.elementsCache.size > 0, this.scrollToOffset = (e, { align: n = "start", behavior: s } = {}) => {
2047
- s === "smooth" && this.isDynamicMode() && console.warn(
2048
- "The `smooth` scroll behavior is not fully supported with dynamic size."
2049
- ), this._scrollToOffset(this.getOffsetForAlignment(e, n), {
2050
- adjustments: void 0,
2051
- behavior: s
2052
- });
2053
- }, this.scrollToIndex = (e, { align: n = "auto", behavior: s } = {}) => {
2054
- s === "smooth" && this.isDynamicMode() && console.warn(
2055
- "The `smooth` scroll behavior is not fully supported with dynamic size."
2056
- ), e = Math.max(0, Math.min(e, this.options.count - 1));
2057
- let t = 0;
2058
- const o = 10, i = (c) => {
2059
- if (!this.targetWindow) return;
2060
- const d = this.getOffsetForIndex(e, c);
2061
- if (!d) {
2062
- console.warn("Failed to get offset for index:", e);
2063
- return;
2064
- }
2065
- const [l, h] = d;
2066
- this._scrollToOffset(l, { adjustments: void 0, behavior: s }), this.targetWindow.requestAnimationFrame(() => {
2067
- const b = this.getScrollOffset(), y = this.getOffsetForIndex(e, h);
2068
- if (!y) {
2069
- console.warn("Failed to get offset for index:", e);
2070
- return;
2071
- }
2072
- Pn(y[0], b) || u(h);
2073
- });
2074
- }, u = (c) => {
2075
- this.targetWindow && (t++, t < o ? (process.env.NODE_ENV !== "production" && this.options.debug && console.info("Schedule retry", t, o), this.targetWindow.requestAnimationFrame(() => i(c))) : console.warn(
2076
- `Failed to scroll to index ${e} after ${o} attempts.`
2077
- ));
2078
- };
2079
- i(n);
2080
- }, this.scrollBy = (e, { behavior: n } = {}) => {
2081
- n === "smooth" && this.isDynamicMode() && console.warn(
2082
- "The `smooth` scroll behavior is not fully supported with dynamic size."
2083
- ), this._scrollToOffset(this.getScrollOffset() + e, {
2084
- adjustments: void 0,
2085
- behavior: n
2086
- });
2087
- }, this.getTotalSize = () => {
2088
- var e;
2089
- const n = this.getMeasurements();
2090
- let s;
2091
- if (n.length === 0)
2092
- s = this.options.paddingStart;
2093
- else if (this.options.lanes === 1)
2094
- s = ((e = n[n.length - 1]) == null ? void 0 : e.end) ?? 0;
2095
- else {
2096
- const t = Array(this.options.lanes).fill(null);
2097
- let o = n.length - 1;
2098
- for (; o >= 0 && t.some((i) => i === null); ) {
2099
- const i = n[o];
2100
- t[i.lane] === null && (t[i.lane] = i.end), o--;
2101
- }
2102
- s = Math.max(...t.filter((i) => i !== null));
2103
- }
2104
- return Math.max(
2105
- s - this.options.scrollMargin + this.options.paddingEnd,
2106
- 0
2107
- );
2108
- }, this._scrollToOffset = (e, {
2109
- adjustments: n,
2110
- behavior: s
2111
- }) => {
2112
- this.options.scrollToFn(e, { behavior: s, adjustments: n }, this);
2113
- }, this.measure = () => {
2114
- this.itemSizeCache = /* @__PURE__ */ new Map(), this.notify(!1);
2115
- }, this.setOptions(a);
2116
- }
2117
- }
2118
- const Kt = (r, a, e, n) => {
2119
- for (; r <= a; ) {
2120
- const s = (r + a) / 2 | 0, t = e(s);
2121
- if (t < n)
2122
- r = s + 1;
2123
- else if (t > n)
2124
- a = s - 1;
2125
- else
2126
- return s;
2127
- }
2128
- return r > 0 ? r - 1 : 0;
2129
- };
2130
- function qn({
2131
- measurements: r,
2132
- outerSize: a,
2133
- scrollOffset: e,
2134
- lanes: n
2135
- }) {
2136
- const s = r.length - 1, t = (u) => r[u].start;
2137
- if (r.length <= n)
2138
- return {
2139
- startIndex: 0,
2140
- endIndex: s
2141
- };
2142
- let o = Kt(
2143
- 0,
2144
- s,
2145
- t,
2146
- e
2147
- ), i = o;
2148
- if (n === 1)
2149
- for (; i < s && r[i].end < e + a; )
2150
- i++;
2151
- else if (n > 1) {
2152
- const u = Array(n).fill(0);
2153
- for (; i < s && u.some((d) => d < e + a); ) {
2154
- const d = r[i];
2155
- u[d.lane] = d.end, i++;
2156
- }
2157
- const c = Array(n).fill(e + a);
2158
- for (; o >= 0 && c.some((d) => d >= e); ) {
2159
- const d = r[o];
2160
- c[d.lane] = d.start, o--;
2161
- }
2162
- o = Math.max(0, o - o % n), i = Math.min(s, i + (n - 1 - i % n));
2163
- }
2164
- return { startIndex: o, endIndex: i };
2165
- }
2166
- const Gt = typeof document < "u" ? yt.useLayoutEffect : yt.useEffect;
2167
- function Vn(r) {
2168
- const a = yt.useReducer(() => ({}), {})[1], e = {
2169
- ...r,
2170
- onChange: (s, t) => {
2171
- var o;
2172
- t ? te(a) : a(), (o = r.onChange) == null || o.call(r, s, t);
2173
- }
2174
- }, [n] = yt.useState(
2175
- () => new Bn(e)
2176
- );
2177
- return n.setOptions(e), Gt(() => n._didMount(), []), Gt(() => n._willUpdate()), n;
2178
- }
2179
- function Xt(r) {
2180
- return Vn({
2181
- observeElementRect: An,
2182
- observeElementOffset: Yn,
2183
- scrollToFn: jn,
2184
- ...r
2185
- });
2186
- }
2187
- function Gn({
2188
- transformedTasks: r,
2189
- bottomRowCells: a,
2190
- scrollRef: e
2191
- }) {
2192
- var d;
2193
- const n = Xt({
2194
- count: r.length,
2195
- getScrollElement: () => e.current,
2196
- estimateSize: () => bt,
2197
- overscan: 5
2198
- }), s = Xt({
2199
- horizontal: !0,
2200
- count: a.length,
2201
- getScrollElement: () => e.current,
2202
- estimateSize: (l) => {
2203
- var h;
2204
- return ((h = a[l]) == null ? void 0 : h.widthPx) ?? 32;
2205
- },
2206
- overscan: 5
2207
- }), t = s.getVirtualItems(), o = ((d = t[0]) == null ? void 0 : d.start) ?? 0, i = t[t.length - 1], u = i ? i.start + i.size : 0, c = st(() => (l, h) => l + h >= o && l <= u, [o, u]);
2208
- return Q(() => {
2209
- if (!a.length) return;
2210
- const l = requestAnimationFrame(() => {
2211
- s.measure();
2212
- });
2213
- return () => cancelAnimationFrame(l);
2214
- }, [a, s]), {
2215
- rowVirtualizer: n,
2216
- columnVirtualizer: s,
2217
- isBarVisible: c
2218
- };
2219
- }
2220
- function Xn(r, a = "gantt-container") {
2221
- const [e, n] = Mt(() => typeof window < "u" && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light");
2222
- Q(() => {
2223
- if (typeof window > "u") return;
2224
- const i = window.matchMedia("(prefers-color-scheme: dark)"), u = (c) => {
2225
- n(c.matches ? "dark" : "light");
2226
- };
2227
- return i.addEventListener("change", u), () => i.removeEventListener("change", u);
2228
- }, []);
2229
- const s = st(() => !r || r === "system" ? e : r, [r, e]), t = st(() => {
2230
- const i = [a];
2231
- return r && i.push(s), i.join(" ");
2232
- }, [a, r, s]);
2233
- return {
2234
- resolvedTheme: s,
2235
- containerClassName: t,
2236
- dataTheme: r ? s : void 0
2237
- };
2238
- }
2239
- const Zn = 600, Jn = "100%", Kn = "month";
2240
- function nr({
2241
- tasks: r = [],
2242
- onTasksChange: a,
2243
- height: e = Zn,
2244
- width: n = Jn,
2245
- theme: s,
2246
- defaultScale: t = Kn,
2247
- className: o
2248
- }) {
2249
- const {
2250
- rawTasks: i,
2251
- transformedTasks: u,
2252
- bottomRowCells: c,
2253
- selectedScale: d,
2254
- setRawTasks: l,
2255
- setTransformedTasks: h,
2256
- setBottomRowCells: b,
2257
- setSelectedScale: y,
2258
- getTotalWidth: f
2259
- } = Jt(), S = St(null), { rowVirtualizer: D, isBarVisible: x } = Gn({
2260
- transformedTasks: u,
2261
- bottomRowCells: c,
2262
- scrollRef: S
2263
- }), { containerClassName: p, dataTheme: z } = Xn(
2264
- s,
2265
- o ? `gantt-container ${o}` : "gantt-container"
2266
- );
2267
- Q(() => {
2268
- t && t !== d && y(t);
2269
- }, []), Q(() => {
2270
- r.length > 0 && l(r);
2271
- }, [r, l]), Q(() => {
2272
- if (!i.length) return;
2273
- const { bottomCells: g, transformedTasks: $ } = En(
2274
- i,
2275
- d
2276
- );
2277
- b(g), h($);
2278
- }, [i, d, b, h]);
2279
- const R = (g) => {
2280
- y(g);
2281
- }, T = f(), v = {
2282
- height: typeof e == "number" ? `${e}px` : e,
2283
- width: typeof n == "number" ? `${n}px` : n
2284
- };
2285
- return /* @__PURE__ */ P(
2286
- "section",
2287
- {
2288
- className: p,
2289
- "data-theme": z,
2290
- style: v,
2291
- children: /* @__PURE__ */ P("div", { className: "gantt-inner", children: /* @__PURE__ */ X("section", { className: "gantt-section", children: [
2292
- /* @__PURE__ */ P(
2293
- _n,
2294
- {
2295
- selectedScale: d,
2296
- onScaleChange: R
2297
- }
2298
- ),
2299
- /* @__PURE__ */ X("div", { ref: S, className: "gantt-list", children: [
2300
- /* @__PURE__ */ P(
2301
- In,
2302
- {
2303
- bottomRowCells: c,
2304
- selectedScale: d,
2305
- width: T,
2306
- scrollRef: S
2307
- }
2308
- ),
2309
- /* @__PURE__ */ X(
2310
- "div",
2311
- {
2312
- className: "gantt-content",
2313
- style: {
2314
- height: `${D.getTotalSize()}px`,
2315
- width: `${T}px`
2316
- },
2317
- children: [
2318
- /* @__PURE__ */ P(
2319
- Wn,
2320
- {
2321
- bottomRowCells: c,
2322
- height: D.getTotalSize()
2323
- }
2324
- ),
2325
- /* @__PURE__ */ P(Rn, { transformedTasks: u }),
2326
- D.getVirtualItems().map((g) => {
2327
- const $ = u[g.index], m = $.barLeft ?? 0, k = $.barWidth ?? 0;
2328
- return /* @__PURE__ */ P(
2329
- "div",
2330
- {
2331
- className: "gantt-task-row",
2332
- style: {
2333
- height: `${g.size - 1}px`,
2334
- transform: `translateY(${g.start}px)`
2335
- },
2336
- children: x(m, k) && /* @__PURE__ */ P(
2337
- gn,
2338
- {
2339
- currentTask: $,
2340
- onTasksChange: a
2341
- }
2342
- )
2343
- },
2344
- $.id
2345
- );
2346
- })
2347
- ]
2348
- }
2349
- )
2350
- ] })
2351
- ] }) })
2352
- }
2353
- );
2354
- }
2355
- export {
2356
- nr as ReactGanttChart
2357
- };