react-timelane 1.2.1 → 1.2.2

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 (139) hide show
  1. package/dist/_virtual/bind-all.js +4 -0
  2. package/dist/_virtual/bind.js +4 -0
  3. package/dist/_virtual/index.js +5 -0
  4. package/dist/_virtual/index2.js +4 -0
  5. package/dist/_virtual/index3.js +5 -0
  6. package/dist/_virtual/index4.js +4 -0
  7. package/dist/_virtual/react-dom.development.js +4 -0
  8. package/dist/_virtual/react-dom.production.js +4 -0
  9. package/dist/components/Timelane/Timelane.css +1 -0
  10. package/dist/components/Timelane/Timelane.js +53 -0
  11. package/dist/components/TimelaneAllocation/TimelaneAllocation.js +49 -0
  12. package/dist/components/TimelaneAside/TimelaneAside.js +60 -0
  13. package/dist/components/TimelaneBackground/TimelaneBackground.js +46 -0
  14. package/dist/components/TimelaneBody/TimelaneBody.js +13 -0
  15. package/dist/components/TimelaneBody/TimelaneSelectionLayer.js +96 -0
  16. package/dist/components/TimelaneHeader/DaysHeader.js +30 -0
  17. package/dist/components/TimelaneHeader/MonthsHeader.js +38 -0
  18. package/dist/components/TimelaneHeader/TimelaneHeader.js +55 -0
  19. package/dist/components/TimelaneHeader/WeeksHeader.js +39 -0
  20. package/dist/components/TimelaneHeader/renderingUtils.js +26 -0
  21. package/dist/components/TimelaneItem/DragResizeComponent.js +125 -0
  22. package/dist/components/TimelaneItem/TimelaneItem.js +42 -0
  23. package/dist/components/TimelaneLane/DropPreview.js +25 -0
  24. package/dist/components/TimelaneLane/DropTarget.js +57 -0
  25. package/dist/components/TimelaneLane/OverlapIndicator.js +21 -0
  26. package/dist/components/TimelaneLane/TimelaneLane.js +164 -0
  27. package/dist/components/TimelaneLayout/TimelaneLayout.js +77 -0
  28. package/dist/components/TimelaneLayout/layout.css +1 -0
  29. package/dist/components/TimelaneSettingsProvider/TimelaneSettingsContext.js +21 -0
  30. package/dist/components/TimelaneSettingsProvider/TimelaneSettingsProvider.js +15 -0
  31. package/dist/components/utils.js +243 -0
  32. package/dist/hooks/useScroll.js +47 -0
  33. package/dist/hooks/useTimelaneContext.js +6 -0
  34. package/dist/index.js +36 -0
  35. package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/adapter/element-adapter-native-data-key.js +4 -0
  36. package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/adapter/element-adapter.js +127 -0
  37. package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/honey-pot-fix/get-element-from-point-without-honey-pot.js +9 -0
  38. package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/honey-pot-fix/honey-pot-data-attribute.js +4 -0
  39. package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/honey-pot-fix/is-honey-pot-element.js +7 -0
  40. package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/honey-pot-fix/make-honey-pot-fix.js +226 -0
  41. package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/ledger/dispatch-consumer-event.js +107 -0
  42. package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/ledger/lifecycle-manager.js +195 -0
  43. package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/ledger/usage-ledger.js +21 -0
  44. package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/make-adapter/make-adapter.js +43 -0
  45. package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/make-adapter/make-drop-target.js +253 -0
  46. package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/make-adapter/make-monitor.js +121 -0
  47. package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/public-utils/combine.js +12 -0
  48. package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/public-utils/once.js +17 -0
  49. package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/add-attribute.js +9 -0
  50. package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/android.js +8 -0
  51. package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/changing-window/count-events-for-safari.js +57 -0
  52. package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/changing-window/is-from-another-window.js +9 -0
  53. package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/changing-window/is-leaving-window.js +13 -0
  54. package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/detect-broken-drag.js +47 -0
  55. package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/get-input.js +17 -0
  56. package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/is-firefox.js +7 -0
  57. package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/is-safari.js +10 -0
  58. package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/max-z-index.js +4 -0
  59. package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/media-types/text-media-type.js +4 -0
  60. package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/media-types/url-media-type.js +4 -0
  61. package/dist/node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js +8 -0
  62. package/dist/node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js +6 -0
  63. package/dist/node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js +7 -0
  64. package/dist/node_modules/@babel/runtime/helpers/esm/defineProperty.js +12 -0
  65. package/dist/node_modules/@babel/runtime/helpers/esm/iterableToArray.js +6 -0
  66. package/dist/node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js +21 -0
  67. package/dist/node_modules/@babel/runtime/helpers/esm/nonIterableRest.js +7 -0
  68. package/dist/node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js +7 -0
  69. package/dist/node_modules/@babel/runtime/helpers/esm/slicedToArray.js +10 -0
  70. package/dist/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js +10 -0
  71. package/dist/node_modules/@babel/runtime/helpers/esm/toPrimitive.js +14 -0
  72. package/dist/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js +9 -0
  73. package/dist/node_modules/@babel/runtime/helpers/esm/typeof.js +11 -0
  74. package/dist/node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js +11 -0
  75. package/dist/node_modules/bind-event-listener/dist/bind-all.js +45 -0
  76. package/dist/node_modules/bind-event-listener/dist/bind.js +16 -0
  77. package/dist/node_modules/bind-event-listener/dist/index.js +20 -0
  78. package/dist/node_modules/date-fns/_lib/addLeadingZeros.js +7 -0
  79. package/dist/node_modules/date-fns/_lib/defaultOptions.js +7 -0
  80. package/dist/node_modules/date-fns/_lib/format/formatters.js +583 -0
  81. package/dist/node_modules/date-fns/_lib/format/lightFormatters.js +59 -0
  82. package/dist/node_modules/date-fns/_lib/format/longFormatters.js +52 -0
  83. package/dist/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js +18 -0
  84. package/dist/node_modules/date-fns/_lib/normalizeDates.js +11 -0
  85. package/dist/node_modules/date-fns/_lib/normalizeInterval.js +8 -0
  86. package/dist/node_modules/date-fns/_lib/protectedTokens.js +20 -0
  87. package/dist/node_modules/date-fns/addDays.js +10 -0
  88. package/dist/node_modules/date-fns/addWeeks.js +8 -0
  89. package/dist/node_modules/date-fns/constants.js +6 -0
  90. package/dist/node_modules/date-fns/constructFrom.js +8 -0
  91. package/dist/node_modules/date-fns/differenceInCalendarDays.js +16 -0
  92. package/dist/node_modules/date-fns/eachDayOfInterval.js +17 -0
  93. package/dist/node_modules/date-fns/eachMonthOfInterval.js +17 -0
  94. package/dist/node_modules/date-fns/eachWeekOfInterval.js +22 -0
  95. package/dist/node_modules/date-fns/format.js +59 -0
  96. package/dist/node_modules/date-fns/getDay.js +8 -0
  97. package/dist/node_modules/date-fns/getDayOfYear.js +11 -0
  98. package/dist/node_modules/date-fns/getISOWeek.js +12 -0
  99. package/dist/node_modules/date-fns/getISOWeekYear.js +15 -0
  100. package/dist/node_modules/date-fns/getWeek.js +12 -0
  101. package/dist/node_modules/date-fns/getWeekYear.js +17 -0
  102. package/dist/node_modules/date-fns/isDate.js +7 -0
  103. package/dist/node_modules/date-fns/isSameDay.js +14 -0
  104. package/dist/node_modules/date-fns/isSunday.js +8 -0
  105. package/dist/node_modules/date-fns/isValid.js +9 -0
  106. package/dist/node_modules/date-fns/lastDayOfMonth.js +9 -0
  107. package/dist/node_modules/date-fns/locale/_lib/buildFormatLongFn.js +9 -0
  108. package/dist/node_modules/date-fns/locale/_lib/buildLocalizeFn.js +18 -0
  109. package/dist/node_modules/date-fns/locale/_lib/buildMatchFn.js +31 -0
  110. package/dist/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js +15 -0
  111. package/dist/node_modules/date-fns/locale/en-US/_lib/formatDistance.js +70 -0
  112. package/dist/node_modules/date-fns/locale/en-US/_lib/formatLong.js +33 -0
  113. package/dist/node_modules/date-fns/locale/en-US/_lib/formatRelative.js +11 -0
  114. package/dist/node_modules/date-fns/locale/en-US/_lib/localize.js +155 -0
  115. package/dist/node_modules/date-fns/locale/en-US/_lib/match.js +110 -0
  116. package/dist/node_modules/date-fns/locale/en-US.js +21 -0
  117. package/dist/node_modules/date-fns/max.js +14 -0
  118. package/dist/node_modules/date-fns/min.js +14 -0
  119. package/dist/node_modules/date-fns/nextDay.js +10 -0
  120. package/dist/node_modules/date-fns/nextSunday.js +8 -0
  121. package/dist/node_modules/date-fns/setHours.js +9 -0
  122. package/dist/node_modules/date-fns/startOfDay.js +9 -0
  123. package/dist/node_modules/date-fns/startOfISOWeek.js +8 -0
  124. package/dist/node_modules/date-fns/startOfISOWeekYear.js +11 -0
  125. package/dist/node_modules/date-fns/startOfWeek.js +11 -0
  126. package/dist/node_modules/date-fns/startOfWeekYear.js +13 -0
  127. package/dist/node_modules/date-fns/startOfYear.js +9 -0
  128. package/dist/node_modules/date-fns/toDate.js +8 -0
  129. package/dist/node_modules/raf-schd/dist/raf-schd.esm.js +15 -0
  130. package/dist/node_modules/re-resizable/lib/index.js +424 -0
  131. package/dist/node_modules/re-resizable/lib/resizer.js +49 -0
  132. package/dist/node_modules/react-dom/cjs/react-dom.development.js +227 -0
  133. package/dist/node_modules/react-dom/cjs/react-dom.production.js +147 -0
  134. package/dist/node_modules/react-dom/index.js +23 -0
  135. package/dist/node_modules/tiny-invariant/dist/esm/tiny-invariant.js +12 -0
  136. package/dist/types/Item.js +6 -0
  137. package/package.json +10 -7
  138. package/dist/react-timelane.css +0 -1
  139. package/dist/react-timelane.js +0 -4754
@@ -1,4754 +0,0 @@
1
- import { jsx as m, jsxs as X, Fragment as Oe } from "react/jsx-runtime";
2
- import Nt, { useRef as re, useEffect as ne, memo as Jt, useCallback as Ve, useMemo as Zt, PureComponent as er, createContext as tr, useContext as rr, useState as Q } from "react";
3
- function nr(e) {
4
- if (Array.isArray(e)) return e;
5
- }
6
- function ir(e, t) {
7
- var r = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
8
- if (r != null) {
9
- var n, i, a, u, c = [], s = !0, o = !1;
10
- try {
11
- if (a = (r = r.call(e)).next, t !== 0) for (; !(s = (n = a.call(r)).done) && (c.push(n.value), c.length !== t); s = !0) ;
12
- } catch (f) {
13
- o = !0, i = f;
14
- } finally {
15
- try {
16
- if (!s && r.return != null && (u = r.return(), Object(u) !== u)) return;
17
- } finally {
18
- if (o) throw i;
19
- }
20
- }
21
- return c;
22
- }
23
- }
24
- function _e(e, t) {
25
- (t == null || t > e.length) && (t = e.length);
26
- for (var r = 0, n = Array(t); r < t; r++) n[r] = e[r];
27
- return n;
28
- }
29
- function At(e, t) {
30
- if (e) {
31
- if (typeof e == "string") return _e(e, t);
32
- var r = {}.toString.call(e).slice(8, -1);
33
- return r === "Object" && e.constructor && (r = e.constructor.name), r === "Map" || r === "Set" ? Array.from(e) : r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? _e(e, t) : void 0;
34
- }
35
- }
36
- function ar() {
37
- throw new TypeError(`Invalid attempt to destructure non-iterable instance.
38
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
39
- }
40
- function zt(e, t) {
41
- return nr(e) || ir(e, t) || At(e, t) || ar();
42
- }
43
- var Ee = {}, se = {}, Qe;
44
- function _t() {
45
- if (Qe) return se;
46
- Qe = 1, Object.defineProperty(se, "__esModule", { value: !0 }), se.bind = void 0;
47
- function e(t, r) {
48
- var n = r.type, i = r.listener, a = r.options;
49
- return t.addEventListener(n, i, a), function() {
50
- t.removeEventListener(n, i, a);
51
- };
52
- }
53
- return se.bind = e, se;
54
- }
55
- var K = {}, Je;
56
- function or() {
57
- if (Je) return K;
58
- Je = 1;
59
- var e = K && K.__assign || function() {
60
- return e = Object.assign || function(a) {
61
- for (var u, c = 1, s = arguments.length; c < s; c++) {
62
- u = arguments[c];
63
- for (var o in u) Object.prototype.hasOwnProperty.call(u, o) && (a[o] = u[o]);
64
- }
65
- return a;
66
- }, e.apply(this, arguments);
67
- };
68
- Object.defineProperty(K, "__esModule", { value: !0 }), K.bindAll = void 0;
69
- var t = /* @__PURE__ */ _t();
70
- function r(a) {
71
- if (!(typeof a > "u"))
72
- return typeof a == "boolean" ? {
73
- capture: a
74
- } : a;
75
- }
76
- function n(a, u) {
77
- if (u == null)
78
- return a;
79
- var c = e(e({}, a), { options: e(e({}, r(u)), r(a.options)) });
80
- return c;
81
- }
82
- function i(a, u, c) {
83
- var s = u.map(function(o) {
84
- var f = n(o, c);
85
- return (0, t.bind)(a, f);
86
- });
87
- return function() {
88
- s.forEach(function(f) {
89
- return f();
90
- });
91
- };
92
- }
93
- return K.bindAll = i, K;
94
- }
95
- var Ze;
96
- function sr() {
97
- return Ze || (Ze = 1, function(e) {
98
- Object.defineProperty(e, "__esModule", { value: !0 }), e.bindAll = e.bind = void 0;
99
- var t = /* @__PURE__ */ _t();
100
- Object.defineProperty(e, "bind", { enumerable: !0, get: function() {
101
- return t.bind;
102
- } });
103
- var r = /* @__PURE__ */ or();
104
- Object.defineProperty(e, "bindAll", { enumerable: !0, get: function() {
105
- return r.bindAll;
106
- } });
107
- }(Ee)), Ee;
108
- }
109
- var ie = /* @__PURE__ */ sr(), Wt = "data-pdnd-honey-pot";
110
- function Ct(e) {
111
- return e instanceof Element && e.hasAttribute(Wt);
112
- }
113
- function Lt(e) {
114
- var t = document.elementsFromPoint(e.x, e.y), r = zt(t, 2), n = r[0], i = r[1];
115
- return n ? Ct(n) ? i ?? null : n : null;
116
- }
117
- function fe(e) {
118
- "@babel/helpers - typeof";
119
- return fe = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
120
- return typeof t;
121
- } : function(t) {
122
- return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
123
- }, fe(e);
124
- }
125
- function ur(e, t) {
126
- if (fe(e) != "object" || !e) return e;
127
- var r = e[Symbol.toPrimitive];
128
- if (r !== void 0) {
129
- var n = r.call(e, t);
130
- if (fe(n) != "object") return n;
131
- throw new TypeError("@@toPrimitive must return a primitive value.");
132
- }
133
- return (t === "string" ? String : Number)(e);
134
- }
135
- function cr(e) {
136
- var t = ur(e, "string");
137
- return fe(t) == "symbol" ? t : t + "";
138
- }
139
- function je(e, t, r) {
140
- return (t = cr(t)) in e ? Object.defineProperty(e, t, {
141
- value: r,
142
- enumerable: !0,
143
- configurable: !0,
144
- writable: !0
145
- }) : e[t] = r, e;
146
- }
147
- var lr = 2147483647;
148
- function et(e, t) {
149
- var r = Object.keys(e);
150
- if (Object.getOwnPropertySymbols) {
151
- var n = Object.getOwnPropertySymbols(e);
152
- t && (n = n.filter(function(i) {
153
- return Object.getOwnPropertyDescriptor(e, i).enumerable;
154
- })), r.push.apply(r, n);
155
- }
156
- return r;
157
- }
158
- function tt(e) {
159
- for (var t = 1; t < arguments.length; t++) {
160
- var r = arguments[t] != null ? arguments[t] : {};
161
- t % 2 ? et(Object(r), !0).forEach(function(n) {
162
- je(e, n, r[n]);
163
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : et(Object(r)).forEach(function(n) {
164
- Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
165
- });
166
- }
167
- return e;
168
- }
169
- var he = 2, rt = he / 2;
170
- function dr(e) {
171
- return {
172
- x: Math.floor(e.x),
173
- y: Math.floor(e.y)
174
- };
175
- }
176
- function fr(e) {
177
- return {
178
- x: e.x - rt,
179
- y: e.y - rt
180
- };
181
- }
182
- function hr(e) {
183
- return {
184
- x: Math.max(e.x, 0),
185
- y: Math.max(e.y, 0)
186
- };
187
- }
188
- function gr(e) {
189
- return {
190
- x: Math.min(e.x, window.innerWidth - he),
191
- y: Math.min(e.y, window.innerHeight - he)
192
- };
193
- }
194
- function nt(e) {
195
- var t = e.client, r = gr(hr(fr(dr(t))));
196
- return DOMRect.fromRect({
197
- x: r.x,
198
- y: r.y,
199
- width: he,
200
- height: he
201
- });
202
- }
203
- function it(e) {
204
- var t = e.clientRect;
205
- return {
206
- left: "".concat(t.left, "px"),
207
- top: "".concat(t.top, "px"),
208
- width: "".concat(t.width, "px"),
209
- height: "".concat(t.height, "px")
210
- };
211
- }
212
- function pr(e) {
213
- var t = e.client, r = e.clientRect;
214
- return (
215
- // is within horizontal bounds
216
- t.x >= r.x && t.x <= r.x + r.width && // is within vertical bounds
217
- t.y >= r.y && t.y <= r.y + r.height
218
- );
219
- }
220
- function mr(e) {
221
- var t = e.initial, r = document.createElement("div");
222
- r.setAttribute(Wt, "true");
223
- var n = nt({
224
- client: t
225
- });
226
- Object.assign(r.style, tt(tt({
227
- // Setting a background color explicitly to avoid any inherited styles.
228
- // Looks like this could be `opacity: 0`, but worried that _might_
229
- // cause the element to be ignored on some platforms.
230
- // When debugging, set backgroundColor to something like "red".
231
- backgroundColor: "transparent",
232
- position: "fixed",
233
- // Being explicit to avoid inheriting styles
234
- padding: 0,
235
- margin: 0,
236
- boxSizing: "border-box"
237
- }, it({
238
- clientRect: n
239
- })), {}, {
240
- // We want this element to absorb pointer events,
241
- // it's kind of the whole point 😉
242
- pointerEvents: "auto",
243
- // Want to make sure the honey pot is top of everything else.
244
- // Don't need to worry about native drag previews, as they will
245
- // have been rendered (and removed) before the honey pot is rendered
246
- zIndex: lr
247
- })), document.body.appendChild(r);
248
- var i = ie.bind(window, {
249
- type: "pointermove",
250
- listener: function(u) {
251
- var c = {
252
- x: u.clientX,
253
- y: u.clientY
254
- };
255
- n = nt({
256
- client: c
257
- }), Object.assign(r.style, it({
258
- clientRect: n
259
- }));
260
- },
261
- // using capture so we are less likely to be impacted by event stopping
262
- options: {
263
- capture: !0
264
- }
265
- });
266
- return function(u) {
267
- var c = u.current;
268
- if (i(), pr({
269
- client: c,
270
- clientRect: n
271
- })) {
272
- r.remove();
273
- return;
274
- }
275
- function s() {
276
- o(), r.remove();
277
- }
278
- var o = ie.bindAll(window, [
279
- {
280
- type: "pointerdown",
281
- listener: s
282
- },
283
- {
284
- type: "pointermove",
285
- listener: s
286
- },
287
- {
288
- type: "focusin",
289
- listener: s
290
- },
291
- {
292
- type: "focusout",
293
- listener: s
294
- },
295
- // a 'pointerdown' should happen before 'dragstart', but just being super safe
296
- {
297
- type: "dragstart",
298
- listener: s
299
- },
300
- // if the user has dragged something out of the window
301
- // and then is dragging something back into the window
302
- // the first events we will see are "dragenter" (and then "dragover").
303
- // So if we see any of these we need to clear the post drag fix.
304
- {
305
- type: "dragenter",
306
- listener: s
307
- },
308
- {
309
- type: "dragover",
310
- listener: s
311
- }
312
- // Not adding a "wheel" event listener, as "wheel" by itself does not
313
- // resolve the bug.
314
- ], {
315
- // Using `capture` so less likely to be impacted by other code stopping events
316
- capture: !0
317
- });
318
- };
319
- }
320
- function yr() {
321
- var e = null;
322
- function t() {
323
- return e = null, ie.bind(window, {
324
- type: "pointermove",
325
- listener: function(i) {
326
- e = {
327
- x: i.clientX,
328
- y: i.clientY
329
- };
330
- },
331
- // listening for pointer move in capture phase
332
- // so we are less likely to be impacted by events being stopped.
333
- options: {
334
- capture: !0
335
- }
336
- });
337
- }
338
- function r() {
339
- var n = null;
340
- return function(a) {
341
- var u = a.eventName, c = a.payload;
342
- if (u === "onDragStart") {
343
- var s = c.location.initial.input, o = e ?? {
344
- x: s.clientX,
345
- y: s.clientY
346
- };
347
- n = mr({
348
- initial: o
349
- });
350
- }
351
- if (u === "onDrop") {
352
- var f, d = c.location.current.input;
353
- (f = n) === null || f === void 0 || f({
354
- current: {
355
- x: d.clientX,
356
- y: d.clientY
357
- }
358
- }), n = null, e = null;
359
- }
360
- };
361
- }
362
- return {
363
- bindEvents: t,
364
- getOnPostDispatch: r
365
- };
366
- }
367
- function vr(e) {
368
- if (Array.isArray(e)) return _e(e);
369
- }
370
- function br(e) {
371
- if (typeof Symbol < "u" && e[Symbol.iterator] != null || e["@@iterator"] != null) return Array.from(e);
372
- }
373
- function wr() {
374
- throw new TypeError(`Invalid attempt to spread non-iterable instance.
375
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
376
- }
377
- function It(e) {
378
- return vr(e) || br(e) || At(e) || wr();
379
- }
380
- function ae(e) {
381
- var t = null;
382
- return function() {
383
- if (!t) {
384
- for (var n = arguments.length, i = new Array(n), a = 0; a < n; a++)
385
- i[a] = arguments[a];
386
- var u = e.apply(this, i);
387
- t = {
388
- result: u
389
- };
390
- }
391
- return t.result;
392
- };
393
- }
394
- var xr = ae(function() {
395
- return process.env.NODE_ENV === "test" ? !1 : navigator.userAgent.includes("Firefox");
396
- }), Be = ae(function() {
397
- if (process.env.NODE_ENV === "test")
398
- return !1;
399
- var t = navigator, r = t.userAgent;
400
- return r.includes("AppleWebKit") && !r.includes("Chrome");
401
- }), We = {
402
- isLeavingWindow: Symbol("leaving"),
403
- isEnteringWindow: Symbol("entering")
404
- };
405
- function Sr(e) {
406
- var t = e.dragLeave;
407
- return Be() ? t.hasOwnProperty(We.isLeavingWindow) : !1;
408
- }
409
- (function() {
410
- if (typeof window > "u" || process.env.NODE_ENV === "test" || !Be())
411
- return;
412
- function t() {
413
- return {
414
- enterCount: 0,
415
- isOverWindow: !1
416
- };
417
- }
418
- var r = t();
419
- function n() {
420
- r = t();
421
- }
422
- ie.bindAll(
423
- window,
424
- [{
425
- type: "dragstart",
426
- listener: function() {
427
- r.enterCount = 0, r.isOverWindow = !0;
428
- }
429
- }, {
430
- type: "drop",
431
- listener: n
432
- }, {
433
- type: "dragend",
434
- listener: n
435
- }, {
436
- type: "dragenter",
437
- listener: function(a) {
438
- !r.isOverWindow && r.enterCount === 0 && (a[We.isEnteringWindow] = !0), r.isOverWindow = !0, r.enterCount++;
439
- }
440
- }, {
441
- type: "dragleave",
442
- listener: function(a) {
443
- r.enterCount--, r.isOverWindow && r.enterCount === 0 && (a[We.isLeavingWindow] = !0, r.isOverWindow = !1);
444
- }
445
- }],
446
- // using `capture: true` so that adding event listeners
447
- // in bubble phase will have the correct symbols
448
- {
449
- capture: !0
450
- }
451
- );
452
- })();
453
- function Or(e) {
454
- return "nodeName" in e;
455
- }
456
- function Dr(e) {
457
- return Or(e) && e.ownerDocument !== document;
458
- }
459
- function Tr(e) {
460
- var t = e.dragLeave, r = t.type, n = t.relatedTarget;
461
- return r !== "dragleave" ? !1 : Be() ? Sr({
462
- dragLeave: t
463
- }) : n == null ? !0 : xr() ? Dr(n) : n instanceof HTMLIFrameElement;
464
- }
465
- function Mr(e) {
466
- var t = e.onDragEnd;
467
- return [
468
- // ## Detecting drag ending for removed draggables
469
- //
470
- // If a draggable element is removed during a drag and the user drops:
471
- // 1. if over a valid drop target: we get a "drop" event to know the drag is finished
472
- // 2. if not over a valid drop target (or cancelled): we get nothing
473
- // The "dragend" event will not fire on the source draggable if it has been
474
- // removed from the DOM.
475
- // So we need to figure out if a drag operation has finished by looking at other events
476
- // We can do this by looking at other events
477
- // ### First detection: "pointermove" events
478
- // 1. "pointermove" events cannot fire during a drag and drop operation
479
- // according to the spec. So if we get a "pointermove" it means that
480
- // the drag and drop operations has finished. So if we get a "pointermove"
481
- // we know that the drag is over
482
- // 2. 🦊😤 Drag and drop operations are _supposed_ to suppress
483
- // other pointer events. However, firefox will allow a few
484
- // pointer event to get through after a drag starts.
485
- // The most I've seen is 3
486
- {
487
- type: "pointermove",
488
- listener: /* @__PURE__ */ function() {
489
- var r = 0;
490
- return function() {
491
- if (r < 20) {
492
- r++;
493
- return;
494
- }
495
- t();
496
- };
497
- }()
498
- },
499
- // ### Second detection: "pointerdown" events
500
- // If we receive this event then we know that a drag operation has finished
501
- // and potentially another one is about to start.
502
- // Note: `pointerdown` fires on all browsers / platforms before "dragstart"
503
- {
504
- type: "pointerdown",
505
- listener: t
506
- }
507
- ];
508
- }
509
- function de(e) {
510
- return {
511
- altKey: e.altKey,
512
- button: e.button,
513
- buttons: e.buttons,
514
- ctrlKey: e.ctrlKey,
515
- metaKey: e.metaKey,
516
- shiftKey: e.shiftKey,
517
- clientX: e.clientX,
518
- clientY: e.clientY,
519
- pageX: e.pageX,
520
- pageY: e.pageY
521
- };
522
- }
523
- var Er = function(t) {
524
- var r = [], n = null, i = function() {
525
- for (var u = arguments.length, c = new Array(u), s = 0; s < u; s++)
526
- c[s] = arguments[s];
527
- r = c, !n && (n = requestAnimationFrame(function() {
528
- n = null, t.apply(void 0, r);
529
- }));
530
- };
531
- return i.cancel = function() {
532
- n && (cancelAnimationFrame(n), n = null);
533
- }, i;
534
- }, Pe = Er(function(e) {
535
- return e();
536
- }), me = /* @__PURE__ */ function() {
537
- var e = null;
538
- function t(n) {
539
- var i = requestAnimationFrame(function() {
540
- e = null, n();
541
- });
542
- e = {
543
- frameId: i,
544
- fn: n
545
- };
546
- }
547
- function r() {
548
- e && (cancelAnimationFrame(e.frameId), e.fn(), e = null);
549
- }
550
- return {
551
- schedule: t,
552
- flush: r
553
- };
554
- }();
555
- function Pr(e) {
556
- var t = e.source, r = e.initial, n = e.dispatchEvent, i = {
557
- dropTargets: []
558
- };
559
- function a(c) {
560
- n(c), i = {
561
- dropTargets: c.payload.location.current.dropTargets
562
- };
563
- }
564
- var u = {
565
- start: function(s) {
566
- var o = s.nativeSetDragImage, f = {
567
- current: r,
568
- previous: i,
569
- initial: r
570
- };
571
- a({
572
- eventName: "onGenerateDragPreview",
573
- payload: {
574
- source: t,
575
- location: f,
576
- nativeSetDragImage: o
577
- }
578
- }), me.schedule(function() {
579
- a({
580
- eventName: "onDragStart",
581
- payload: {
582
- source: t,
583
- location: f
584
- }
585
- });
586
- });
587
- },
588
- dragUpdate: function(s) {
589
- var o = s.current;
590
- me.flush(), Pe.cancel(), a({
591
- eventName: "onDropTargetChange",
592
- payload: {
593
- source: t,
594
- location: {
595
- initial: r,
596
- previous: i,
597
- current: o
598
- }
599
- }
600
- });
601
- },
602
- drag: function(s) {
603
- var o = s.current;
604
- Pe(function() {
605
- me.flush();
606
- var f = {
607
- initial: r,
608
- previous: i,
609
- current: o
610
- };
611
- a({
612
- eventName: "onDrag",
613
- payload: {
614
- source: t,
615
- location: f
616
- }
617
- });
618
- });
619
- },
620
- drop: function(s) {
621
- var o = s.current, f = s.updatedSourcePayload;
622
- me.flush(), Pe.cancel(), a({
623
- eventName: "onDrop",
624
- payload: {
625
- source: f ?? t,
626
- location: {
627
- current: o,
628
- previous: i,
629
- initial: r
630
- }
631
- }
632
- });
633
- }
634
- };
635
- return u;
636
- }
637
- var Ce = {
638
- isActive: !1
639
- };
640
- function Ht() {
641
- return !Ce.isActive;
642
- }
643
- function Rr(e) {
644
- return e.dataTransfer ? e.dataTransfer.setDragImage.bind(e.dataTransfer) : null;
645
- }
646
- function kr(e) {
647
- var t = e.current, r = e.next;
648
- if (t.length !== r.length)
649
- return !0;
650
- for (var n = 0; n < t.length; n++)
651
- if (t[n].element !== r[n].element)
652
- return !0;
653
- return !1;
654
- }
655
- function Nr(e) {
656
- var t = e.event, r = e.dragType, n = e.getDropTargetsOver, i = e.dispatchEvent;
657
- if (!Ht())
658
- return;
659
- var a = Ar({
660
- event: t,
661
- dragType: r,
662
- getDropTargetsOver: n
663
- });
664
- Ce.isActive = !0;
665
- var u = {
666
- current: a
667
- };
668
- Re({
669
- event: t,
670
- current: a.dropTargets
671
- });
672
- var c = Pr({
673
- source: r.payload,
674
- dispatchEvent: i,
675
- initial: a
676
- });
677
- function s(h) {
678
- var p = kr({
679
- current: u.current.dropTargets,
680
- next: h.dropTargets
681
- });
682
- u.current = h, p && c.dragUpdate({
683
- current: u.current
684
- });
685
- }
686
- function o(h) {
687
- var p = de(h), g = Ct(h.target) ? Lt({
688
- x: p.clientX,
689
- y: p.clientY
690
- }) : h.target, y = n({
691
- target: g,
692
- input: p,
693
- source: r.payload,
694
- current: u.current.dropTargets
695
- });
696
- y.length && (h.preventDefault(), Re({
697
- event: h,
698
- current: y
699
- })), s({
700
- dropTargets: y,
701
- input: p
702
- });
703
- }
704
- function f() {
705
- u.current.dropTargets.length && s({
706
- dropTargets: [],
707
- input: u.current.input
708
- }), c.drop({
709
- current: u.current,
710
- updatedSourcePayload: null
711
- }), d();
712
- }
713
- function d() {
714
- Ce.isActive = !1, l();
715
- }
716
- var l = ie.bindAll(
717
- window,
718
- [{
719
- // 👋 Note: we are repurposing the `dragover` event as our `drag` event
720
- // this is because firefox does not publish pointer coordinates during
721
- // a `drag` event, but does for every other type of drag event
722
- // `dragover` fires on all elements that are being dragged over
723
- // Because we are binding to `window` - our `dragover` is effectively the same as a `drag`
724
- // 🦊😤
725
- type: "dragover",
726
- listener: function(p) {
727
- o(p), c.drag({
728
- current: u.current
729
- });
730
- }
731
- }, {
732
- type: "dragenter",
733
- listener: o
734
- }, {
735
- type: "dragleave",
736
- listener: function(p) {
737
- Tr({
738
- dragLeave: p
739
- }) && (s({
740
- input: u.current.input,
741
- dropTargets: []
742
- }), r.startedFrom === "external" && f());
743
- }
744
- }, {
745
- // A "drop" can only happen if the browser allowed the drop
746
- type: "drop",
747
- listener: function(p) {
748
- if (u.current = {
749
- dropTargets: u.current.dropTargets,
750
- input: de(p)
751
- }, !u.current.dropTargets.length) {
752
- f();
753
- return;
754
- }
755
- p.preventDefault(), Re({
756
- event: p,
757
- current: u.current.dropTargets
758
- }), c.drop({
759
- current: u.current,
760
- // When dropping something native, we need to extract the latest
761
- // `.items` from the "drop" event as it is now accessible
762
- updatedSourcePayload: r.type === "external" ? r.getDropPayload(p) : null
763
- }), d();
764
- }
765
- }, {
766
- // "dragend" fires when on the drag source (eg a draggable element)
767
- // when the drag is finished.
768
- // "dragend" will fire after "drop" (if there was a successful drop)
769
- // "dragend" does not fire if the draggable source has been removed during the drag
770
- // or for external drag sources (eg files)
771
- // This "dragend" listener will not fire if there was a successful drop
772
- // as we will have already removed the event listener
773
- type: "dragend",
774
- listener: function(p) {
775
- u.current = {
776
- dropTargets: u.current.dropTargets,
777
- input: de(p)
778
- }, f();
779
- }
780
- }].concat(It(Mr({
781
- onDragEnd: f
782
- }))),
783
- // Once we have started a managed drag operation it is important that we see / own all drag events
784
- // We got one adoption bug pop up where some code was stopping (`event.stopPropagation()`)
785
- // all "drop" events in the bubble phase on the `document.body`.
786
- // This meant that we never saw the "drop" event.
787
- {
788
- capture: !0
789
- }
790
- );
791
- c.start({
792
- nativeSetDragImage: Rr(t)
793
- });
794
- }
795
- function Re(e) {
796
- var t, r = e.event, n = e.current, i = (t = n[0]) === null || t === void 0 ? void 0 : t.dropEffect;
797
- i != null && r.dataTransfer && (r.dataTransfer.dropEffect = i);
798
- }
799
- function Ar(e) {
800
- var t = e.event, r = e.dragType, n = e.getDropTargetsOver, i = de(t);
801
- if (r.startedFrom === "external")
802
- return {
803
- input: i,
804
- dropTargets: []
805
- };
806
- var a = n({
807
- input: i,
808
- source: r.payload,
809
- target: t.target,
810
- current: []
811
- });
812
- return {
813
- input: i,
814
- dropTargets: a
815
- };
816
- }
817
- var at = {
818
- canStart: Ht,
819
- start: Nr
820
- }, Le = /* @__PURE__ */ new Map();
821
- function zr(e) {
822
- var t = e.typeKey, r = e.mount, n = Le.get(t);
823
- if (n)
824
- return n.usageCount++, n;
825
- var i = {
826
- typeKey: t,
827
- unmount: r(),
828
- usageCount: 1
829
- };
830
- return Le.set(t, i), i;
831
- }
832
- function _r(e) {
833
- var t = zr(e);
834
- return function() {
835
- t.usageCount--, !(t.usageCount > 0) && (t.unmount(), Le.delete(e.typeKey));
836
- };
837
- }
838
- function Ye() {
839
- for (var e = arguments.length, t = new Array(e), r = 0; r < e; r++)
840
- t[r] = arguments[r];
841
- return function() {
842
- t.forEach(function(i) {
843
- return i();
844
- });
845
- };
846
- }
847
- function jt(e, t) {
848
- var r = t.attribute, n = t.value;
849
- return e.setAttribute(r, n), function() {
850
- return e.removeAttribute(r);
851
- };
852
- }
853
- function ot(e, t) {
854
- var r = Object.keys(e);
855
- if (Object.getOwnPropertySymbols) {
856
- var n = Object.getOwnPropertySymbols(e);
857
- t && (n = n.filter(function(i) {
858
- return Object.getOwnPropertyDescriptor(e, i).enumerable;
859
- })), r.push.apply(r, n);
860
- }
861
- return r;
862
- }
863
- function $(e) {
864
- for (var t = 1; t < arguments.length; t++) {
865
- var r = arguments[t] != null ? arguments[t] : {};
866
- t % 2 ? ot(Object(r), !0).forEach(function(n) {
867
- je(e, n, r[n]);
868
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : ot(Object(r)).forEach(function(n) {
869
- Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
870
- });
871
- }
872
- return e;
873
- }
874
- function ke(e, t) {
875
- var r = typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
876
- if (!r) {
877
- if (Array.isArray(e) || (r = Wr(e)) || t) {
878
- r && (e = r);
879
- var n = 0, i = function() {
880
- };
881
- return { s: i, n: function() {
882
- return n >= e.length ? { done: !0 } : { done: !1, value: e[n++] };
883
- }, e: function(o) {
884
- throw o;
885
- }, f: i };
886
- }
887
- throw new TypeError(`Invalid attempt to iterate non-iterable instance.
888
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
889
- }
890
- var a, u = !0, c = !1;
891
- return { s: function() {
892
- r = r.call(e);
893
- }, n: function() {
894
- var o = r.next();
895
- return u = o.done, o;
896
- }, e: function(o) {
897
- c = !0, a = o;
898
- }, f: function() {
899
- try {
900
- u || r.return == null || r.return();
901
- } finally {
902
- if (c) throw a;
903
- }
904
- } };
905
- }
906
- function Wr(e, t) {
907
- if (e) {
908
- if (typeof e == "string") return st(e, t);
909
- var r = {}.toString.call(e).slice(8, -1);
910
- return r === "Object" && e.constructor && (r = e.constructor.name), r === "Map" || r === "Set" ? Array.from(e) : r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? st(e, t) : void 0;
911
- }
912
- }
913
- function st(e, t) {
914
- (t == null || t > e.length) && (t = e.length);
915
- for (var r = 0, n = Array(t); r < t; r++) n[r] = e[r];
916
- return n;
917
- }
918
- function Ne(e) {
919
- return e.slice(0).reverse();
920
- }
921
- function Cr(e) {
922
- var t = e.typeKey, r = e.defaultDropEffect, n = /* @__PURE__ */ new WeakMap(), i = "data-drop-target-for-".concat(t), a = "[".concat(i, "]");
923
- function u(h) {
924
- return n.set(h.element, h), function() {
925
- return n.delete(h.element);
926
- };
927
- }
928
- function c(h) {
929
- if (process.env.NODE_ENV !== "production") {
930
- var p = n.get(h.element);
931
- p && console.warn("You have already registered a [".concat(t, "] dropTarget on the same element"), {
932
- existing: p,
933
- proposed: h
934
- }), h.element instanceof HTMLIFrameElement && console.warn(`
935
- We recommend not registering <iframe> elements as drop targets
936
- as it can result in some strange browser event ordering.
937
- `.replace(/\s{2,}/g, " ").trim());
938
- }
939
- var g = Ye(jt(h.element, {
940
- attribute: i,
941
- value: "true"
942
- }), u(h));
943
- return ae(g);
944
- }
945
- function s(h) {
946
- var p, g, y, b, w = h.source, S = h.target, x = h.input, M = h.result, O = M === void 0 ? [] : M;
947
- if (S == null)
948
- return O;
949
- if (!(S instanceof Element))
950
- return S instanceof Node ? s({
951
- source: w,
952
- target: S.parentElement,
953
- input: x,
954
- result: O
955
- }) : O;
956
- var C = S.closest(a);
957
- if (C == null)
958
- return O;
959
- var E = n.get(C);
960
- if (E == null)
961
- return O;
962
- var N = {
963
- input: x,
964
- source: w,
965
- element: E.element
966
- };
967
- if (E.canDrop && !E.canDrop(N))
968
- return s({
969
- source: w,
970
- target: E.element.parentElement,
971
- input: x,
972
- result: O
973
- });
974
- var L = (p = (g = E.getData) === null || g === void 0 ? void 0 : g.call(E, N)) !== null && p !== void 0 ? p : {}, v = (y = (b = E.getDropEffect) === null || b === void 0 ? void 0 : b.call(E, N)) !== null && y !== void 0 ? y : r, D = {
975
- data: L,
976
- element: E.element,
977
- dropEffect: v,
978
- // we are collecting _actual_ drop targets, so these are
979
- // being applied _not_ due to stickiness
980
- isActiveDueToStickiness: !1
981
- };
982
- return s({
983
- source: w,
984
- target: E.element.parentElement,
985
- input: x,
986
- // Using bubble ordering. Same ordering as `event.getPath()`
987
- result: [].concat(It(O), [D])
988
- });
989
- }
990
- function o(h) {
991
- var p = h.eventName, g = h.payload, y = ke(g.location.current.dropTargets), b;
992
- try {
993
- for (y.s(); !(b = y.n()).done; ) {
994
- var w, S = b.value, x = n.get(S.element), M = $($({}, g), {}, {
995
- self: S
996
- });
997
- x == null || (w = x[p]) === null || w === void 0 || w.call(
998
- x,
999
- // I cannot seem to get the types right here.
1000
- // TS doesn't seem to like that one event can need `nativeSetDragImage`
1001
- // @ts-expect-error
1002
- M
1003
- );
1004
- }
1005
- } catch (O) {
1006
- y.e(O);
1007
- } finally {
1008
- y.f();
1009
- }
1010
- }
1011
- var f = {
1012
- onGenerateDragPreview: o,
1013
- onDrag: o,
1014
- onDragStart: o,
1015
- onDrop: o,
1016
- onDropTargetChange: function(p) {
1017
- var g = p.payload, y = new Set(g.location.current.dropTargets.map(function(G) {
1018
- return G.element;
1019
- })), b = /* @__PURE__ */ new Set(), w = ke(g.location.previous.dropTargets), S;
1020
- try {
1021
- for (w.s(); !(S = w.n()).done; ) {
1022
- var x, M = S.value;
1023
- b.add(M.element);
1024
- var O = n.get(M.element), C = y.has(M.element), E = $($({}, g), {}, {
1025
- self: M
1026
- });
1027
- if (O == null || (x = O.onDropTargetChange) === null || x === void 0 || x.call(O, E), !C) {
1028
- var N;
1029
- O == null || (N = O.onDragLeave) === null || N === void 0 || N.call(O, E);
1030
- }
1031
- }
1032
- } catch (G) {
1033
- w.e(G);
1034
- } finally {
1035
- w.f();
1036
- }
1037
- var L = ke(g.location.current.dropTargets), v;
1038
- try {
1039
- for (L.s(); !(v = L.n()).done; ) {
1040
- var D, P, I = v.value;
1041
- if (!b.has(I.element)) {
1042
- var Y = $($({}, g), {}, {
1043
- self: I
1044
- }), A = n.get(I.element);
1045
- A == null || (D = A.onDropTargetChange) === null || D === void 0 || D.call(A, Y), A == null || (P = A.onDragEnter) === null || P === void 0 || P.call(A, Y);
1046
- }
1047
- }
1048
- } catch (G) {
1049
- L.e(G);
1050
- } finally {
1051
- L.f();
1052
- }
1053
- }
1054
- };
1055
- function d(h) {
1056
- f[h.eventName](h);
1057
- }
1058
- function l(h) {
1059
- var p = h.source, g = h.target, y = h.input, b = h.current, w = s({
1060
- source: p,
1061
- target: g,
1062
- input: y
1063
- });
1064
- if (w.length >= b.length)
1065
- return w;
1066
- for (var S = Ne(b), x = Ne(w), M = [], O = 0; O < S.length; O++) {
1067
- var C, E = S[O], N = x[O];
1068
- if (N != null) {
1069
- M.push(N);
1070
- continue;
1071
- }
1072
- var L = M[O - 1], v = S[O - 1];
1073
- if ((L == null ? void 0 : L.element) !== (v == null ? void 0 : v.element))
1074
- break;
1075
- var D = n.get(E.element);
1076
- if (!D)
1077
- break;
1078
- var P = {
1079
- input: y,
1080
- source: p,
1081
- element: D.element
1082
- };
1083
- if (D.canDrop && !D.canDrop(P) || !((C = D.getIsSticky) !== null && C !== void 0 && C.call(D, P)))
1084
- break;
1085
- M.push($($({}, E), {}, {
1086
- // making it clear to consumers this drop target is active due to stickiness
1087
- isActiveDueToStickiness: !0
1088
- }));
1089
- }
1090
- return Ne(M);
1091
- }
1092
- return {
1093
- dropTargetForConsumers: c,
1094
- getIsOver: l,
1095
- dispatchEvent: d
1096
- };
1097
- }
1098
- function Lr(e, t) {
1099
- var r = typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
1100
- if (!r) {
1101
- if (Array.isArray(e) || (r = Ir(e)) || t) {
1102
- r && (e = r);
1103
- var n = 0, i = function() {
1104
- };
1105
- return { s: i, n: function() {
1106
- return n >= e.length ? { done: !0 } : { done: !1, value: e[n++] };
1107
- }, e: function(o) {
1108
- throw o;
1109
- }, f: i };
1110
- }
1111
- throw new TypeError(`Invalid attempt to iterate non-iterable instance.
1112
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
1113
- }
1114
- var a, u = !0, c = !1;
1115
- return { s: function() {
1116
- r = r.call(e);
1117
- }, n: function() {
1118
- var o = r.next();
1119
- return u = o.done, o;
1120
- }, e: function(o) {
1121
- c = !0, a = o;
1122
- }, f: function() {
1123
- try {
1124
- u || r.return == null || r.return();
1125
- } finally {
1126
- if (c) throw a;
1127
- }
1128
- } };
1129
- }
1130
- function Ir(e, t) {
1131
- if (e) {
1132
- if (typeof e == "string") return ut(e, t);
1133
- var r = {}.toString.call(e).slice(8, -1);
1134
- return r === "Object" && e.constructor && (r = e.constructor.name), r === "Map" || r === "Set" ? Array.from(e) : r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? ut(e, t) : void 0;
1135
- }
1136
- }
1137
- function ut(e, t) {
1138
- (t == null || t > e.length) && (t = e.length);
1139
- for (var r = 0, n = Array(t); r < t; r++) n[r] = e[r];
1140
- return n;
1141
- }
1142
- function ct(e, t) {
1143
- var r = Object.keys(e);
1144
- if (Object.getOwnPropertySymbols) {
1145
- var n = Object.getOwnPropertySymbols(e);
1146
- t && (n = n.filter(function(i) {
1147
- return Object.getOwnPropertyDescriptor(e, i).enumerable;
1148
- })), r.push.apply(r, n);
1149
- }
1150
- return r;
1151
- }
1152
- function Hr(e) {
1153
- for (var t = 1; t < arguments.length; t++) {
1154
- var r = arguments[t] != null ? arguments[t] : {};
1155
- t % 2 ? ct(Object(r), !0).forEach(function(n) {
1156
- je(e, n, r[n]);
1157
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : ct(Object(r)).forEach(function(n) {
1158
- Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
1159
- });
1160
- }
1161
- return e;
1162
- }
1163
- function jr() {
1164
- var e = /* @__PURE__ */ new Set(), t = null;
1165
- function r(a) {
1166
- t && (!a.canMonitor || a.canMonitor(t.canMonitorArgs)) && t.active.add(a);
1167
- }
1168
- function n(a) {
1169
- var u = Hr({}, a);
1170
- e.add(u), r(u);
1171
- function c() {
1172
- e.delete(u), t && t.active.delete(u);
1173
- }
1174
- return ae(c);
1175
- }
1176
- function i(a) {
1177
- var u = a.eventName, c = a.payload;
1178
- if (u === "onGenerateDragPreview") {
1179
- t = {
1180
- canMonitorArgs: {
1181
- initial: c.location.initial,
1182
- source: c.source
1183
- },
1184
- active: /* @__PURE__ */ new Set()
1185
- };
1186
- var s = Lr(e), o;
1187
- try {
1188
- for (s.s(); !(o = s.n()).done; ) {
1189
- var f = o.value;
1190
- r(f);
1191
- }
1192
- } catch (y) {
1193
- s.e(y);
1194
- } finally {
1195
- s.f();
1196
- }
1197
- }
1198
- if (t) {
1199
- for (var d = Array.from(t.active), l = 0, h = d; l < h.length; l++) {
1200
- var p = h[l];
1201
- if (t.active.has(p)) {
1202
- var g;
1203
- (g = p[u]) === null || g === void 0 || g.call(p, c);
1204
- }
1205
- }
1206
- u === "onDrop" && (t.active.clear(), t = null);
1207
- }
1208
- }
1209
- return {
1210
- dispatchEvent: i,
1211
- monitorForConsumers: n
1212
- };
1213
- }
1214
- function Br(e) {
1215
- var t = e.typeKey, r = e.mount, n = e.dispatchEventToSource, i = e.onPostDispatch, a = e.defaultDropEffect, u = jr(), c = Cr({
1216
- typeKey: t,
1217
- defaultDropEffect: a
1218
- });
1219
- function s(d) {
1220
- n == null || n(d), c.dispatchEvent(d), u.dispatchEvent(d), i == null || i(d);
1221
- }
1222
- function o(d) {
1223
- var l = d.event, h = d.dragType;
1224
- at.start({
1225
- event: l,
1226
- dragType: h,
1227
- getDropTargetsOver: c.getIsOver,
1228
- dispatchEvent: s
1229
- });
1230
- }
1231
- function f() {
1232
- function d() {
1233
- var l = {
1234
- canStart: at.canStart,
1235
- start: o
1236
- };
1237
- return r(l);
1238
- }
1239
- return _r({
1240
- typeKey: t,
1241
- mount: d
1242
- });
1243
- }
1244
- return {
1245
- registerUsage: f,
1246
- dropTarget: c.dropTargetForConsumers,
1247
- monitor: u.monitorForConsumers
1248
- };
1249
- }
1250
- var Yr = ae(function() {
1251
- return navigator.userAgent.toLocaleLowerCase().includes("android");
1252
- }), Fr = "pdnd:android-fallback", lt = "text/plain", $r = "text/uri-list", qr = "application/vnd.pdnd", ge = /* @__PURE__ */ new WeakMap();
1253
- function Xr(e) {
1254
- return ge.set(e.element, e), function() {
1255
- ge.delete(e.element);
1256
- };
1257
- }
1258
- var dt = yr(), Fe = Br({
1259
- typeKey: "element",
1260
- defaultDropEffect: "move",
1261
- mount: function(t) {
1262
- return Ye(dt.bindEvents(), ie.bind(document, {
1263
- type: "dragstart",
1264
- listener: function(n) {
1265
- var i, a, u, c, s, o;
1266
- if (t.canStart(n) && !n.defaultPrevented) {
1267
- if (!n.dataTransfer) {
1268
- process.env.NODE_ENV !== "production" && console.warn(`
1269
- It appears as though you have are not testing DragEvents correctly.
1270
-
1271
- - If you are unit testing, ensure you have polyfilled DragEvent.
1272
- - If you are browser testing, ensure you are dispatching drag events correctly.
1273
-
1274
- Please see our testing guides for more information:
1275
- https://atlassian.design/components/pragmatic-drag-and-drop/core-package/testing
1276
- `.replace(/ {2}/g, ""));
1277
- return;
1278
- }
1279
- var f = n.target;
1280
- if (!(f instanceof HTMLElement))
1281
- return null;
1282
- var d = ge.get(f);
1283
- if (!d)
1284
- return null;
1285
- var l = de(n), h = {
1286
- element: d.element,
1287
- dragHandle: (i = d.dragHandle) !== null && i !== void 0 ? i : null,
1288
- input: l
1289
- };
1290
- if (d.canDrag && !d.canDrag(h))
1291
- return n.preventDefault(), null;
1292
- if (d.dragHandle) {
1293
- var p = Lt({
1294
- x: l.clientX,
1295
- y: l.clientY
1296
- });
1297
- if (!d.dragHandle.contains(p))
1298
- return n.preventDefault(), null;
1299
- }
1300
- var g = (a = (u = d.getInitialDataForExternal) === null || u === void 0 ? void 0 : u.call(d, h)) !== null && a !== void 0 ? a : null;
1301
- if (g)
1302
- for (var y = 0, b = Object.entries(g); y < b.length; y++) {
1303
- var w = zt(b[y], 2), S = w[0], x = w[1];
1304
- n.dataTransfer.setData(S, x ?? "");
1305
- }
1306
- Yr() && !n.dataTransfer.types.includes(lt) && !n.dataTransfer.types.includes($r) && n.dataTransfer.setData(lt, Fr), n.dataTransfer.setData(qr, "");
1307
- var M = {
1308
- element: d.element,
1309
- dragHandle: (c = d.dragHandle) !== null && c !== void 0 ? c : null,
1310
- data: (s = (o = d.getInitialData) === null || o === void 0 ? void 0 : o.call(d, h)) !== null && s !== void 0 ? s : {}
1311
- }, O = {
1312
- type: "element",
1313
- payload: M,
1314
- startedFrom: "internal"
1315
- };
1316
- t.start({
1317
- event: n,
1318
- dragType: O
1319
- });
1320
- }
1321
- }
1322
- }));
1323
- },
1324
- dispatchEventToSource: function(t) {
1325
- var r, n, i = t.eventName, a = t.payload;
1326
- (r = ge.get(a.source.element)) === null || r === void 0 || (n = r[i]) === null || n === void 0 || n.call(
1327
- r,
1328
- // I cannot seem to get the types right here.
1329
- // TS doesn't seem to like that one event can need `nativeSetDragImage`
1330
- // @ts-expect-error
1331
- a
1332
- );
1333
- },
1334
- onPostDispatch: dt.getOnPostDispatch()
1335
- }), Ur = Fe.dropTarget, Gr = Fe.monitor;
1336
- function Kr(e) {
1337
- if (process.env.NODE_ENV !== "production" && e.dragHandle && !e.element.contains(e.dragHandle) && console.warn("Drag handle element must be contained in draggable element", {
1338
- element: e.element,
1339
- dragHandle: e.dragHandle
1340
- }), process.env.NODE_ENV !== "production") {
1341
- var t = ge.get(e.element);
1342
- t && console.warn("You have already registered a `draggable` on the same element", {
1343
- existing: t,
1344
- proposed: e
1345
- });
1346
- }
1347
- var r = Ye(
1348
- // making the draggable register the adapter rather than drop targets
1349
- // this is because you *must* have a draggable element to start a drag
1350
- // but you _might_ not have any drop targets immediately
1351
- // (You might create drop targets async)
1352
- Fe.registerUsage(),
1353
- Xr(e),
1354
- jt(e.element, {
1355
- attribute: "draggable",
1356
- value: "true"
1357
- })
1358
- );
1359
- return ae(r);
1360
- }
1361
- var Vr = process.env.NODE_ENV === "production", ft = "Invariant failed";
1362
- function Ie(e, t) {
1363
- if (!e) {
1364
- if (Vr)
1365
- throw new Error(ft);
1366
- var r = ft;
1367
- throw new Error(r);
1368
- }
1369
- }
1370
- const Bt = 6048e5, Qr = 864e5, ht = Symbol.for("constructDateFrom");
1371
- function W(e, t) {
1372
- return typeof e == "function" ? e(t) : e && typeof e == "object" && ht in e ? e[ht](t) : e instanceof Date ? new e.constructor(t) : new Date(t);
1373
- }
1374
- function k(e, t) {
1375
- return W(t || e, e);
1376
- }
1377
- function pe(e, t, r) {
1378
- const n = k(e, r == null ? void 0 : r.in);
1379
- return isNaN(t) ? W(e, NaN) : (t && n.setDate(n.getDate() + t), n);
1380
- }
1381
- function Yt(e, t) {
1382
- return k(e, t == null ? void 0 : t.in).getDay() === 0;
1383
- }
1384
- let Jr = {};
1385
- function Me() {
1386
- return Jr;
1387
- }
1388
- function F(e, t) {
1389
- var c, s, o, f;
1390
- const r = Me(), n = (t == null ? void 0 : t.weekStartsOn) ?? ((s = (c = t == null ? void 0 : t.locale) == null ? void 0 : c.options) == null ? void 0 : s.weekStartsOn) ?? r.weekStartsOn ?? ((f = (o = r.locale) == null ? void 0 : o.options) == null ? void 0 : f.weekStartsOn) ?? 0, i = k(e, t == null ? void 0 : t.in), a = i.getDay(), u = (a < n ? 7 : 0) + a - n;
1391
- return i.setDate(i.getDate() - u), i.setHours(0, 0, 0, 0), i;
1392
- }
1393
- function De(e, t) {
1394
- return F(e, { ...t, weekStartsOn: 1 });
1395
- }
1396
- function Ft(e, t) {
1397
- const r = k(e, t == null ? void 0 : t.in), n = r.getFullYear(), i = W(r, 0);
1398
- i.setFullYear(n + 1, 0, 4), i.setHours(0, 0, 0, 0);
1399
- const a = De(i), u = W(r, 0);
1400
- u.setFullYear(n, 0, 4), u.setHours(0, 0, 0, 0);
1401
- const c = De(u);
1402
- return r.getTime() >= a.getTime() ? n + 1 : r.getTime() >= c.getTime() ? n : n - 1;
1403
- }
1404
- function gt(e) {
1405
- const t = k(e), r = new Date(
1406
- Date.UTC(
1407
- t.getFullYear(),
1408
- t.getMonth(),
1409
- t.getDate(),
1410
- t.getHours(),
1411
- t.getMinutes(),
1412
- t.getSeconds(),
1413
- t.getMilliseconds()
1414
- )
1415
- );
1416
- return r.setUTCFullYear(t.getFullYear()), +e - +r;
1417
- }
1418
- function $e(e, ...t) {
1419
- const r = W.bind(
1420
- null,
1421
- e || t.find((n) => typeof n == "object")
1422
- );
1423
- return t.map(r);
1424
- }
1425
- function Te(e, t) {
1426
- const r = k(e, t == null ? void 0 : t.in);
1427
- return r.setHours(0, 0, 0, 0), r;
1428
- }
1429
- function U(e, t, r) {
1430
- const [n, i] = $e(
1431
- r == null ? void 0 : r.in,
1432
- e,
1433
- t
1434
- ), a = Te(n), u = Te(i), c = +a - gt(a), s = +u - gt(u);
1435
- return Math.round((c - s) / Qr);
1436
- }
1437
- function Zr(e, t) {
1438
- const r = Ft(e, t), n = W(e, 0);
1439
- return n.setFullYear(r, 0, 4), n.setHours(0, 0, 0, 0), De(n);
1440
- }
1441
- function en(e, t, r) {
1442
- return pe(e, t * 7, r);
1443
- }
1444
- function tn(e, t) {
1445
- let r, n = t == null ? void 0 : t.in;
1446
- return e.forEach((i) => {
1447
- !n && typeof i == "object" && (n = W.bind(null, i));
1448
- const a = k(i, n);
1449
- (!r || r < a || isNaN(+a)) && (r = a);
1450
- }), W(n, r || NaN);
1451
- }
1452
- function rn(e, t) {
1453
- let r, n = t == null ? void 0 : t.in;
1454
- return e.forEach((i) => {
1455
- !n && typeof i == "object" && (n = W.bind(null, i));
1456
- const a = k(i, n);
1457
- (!r || r > a || isNaN(+a)) && (r = a);
1458
- }), W(n, r || NaN);
1459
- }
1460
- function nn(e, t, r) {
1461
- const [n, i] = $e(
1462
- r == null ? void 0 : r.in,
1463
- e,
1464
- t
1465
- );
1466
- return +Te(n) == +Te(i);
1467
- }
1468
- function an(e) {
1469
- return e instanceof Date || typeof e == "object" && Object.prototype.toString.call(e) === "[object Date]";
1470
- }
1471
- function on(e) {
1472
- return !(!an(e) && typeof e != "number" || isNaN(+k(e)));
1473
- }
1474
- function qe(e, t) {
1475
- const [r, n] = $e(e, t.start, t.end);
1476
- return { start: r, end: n };
1477
- }
1478
- function $t(e, t) {
1479
- const { start: r, end: n } = qe(t == null ? void 0 : t.in, e);
1480
- let i = +r > +n;
1481
- const a = i ? +r : +n, u = i ? n : r;
1482
- u.setHours(0, 0, 0, 0);
1483
- let c = 1;
1484
- const s = [];
1485
- for (; +u <= a; )
1486
- s.push(W(r, u)), u.setDate(u.getDate() + c), u.setHours(0, 0, 0, 0);
1487
- return i ? s.reverse() : s;
1488
- }
1489
- function sn(e, t) {
1490
- const { start: r, end: n } = qe(t == null ? void 0 : t.in, e);
1491
- let i = +r > +n;
1492
- const a = i ? +r : +n, u = i ? n : r;
1493
- u.setHours(0, 0, 0, 0), u.setDate(1);
1494
- let c = 1;
1495
- const s = [];
1496
- for (; +u <= a; )
1497
- s.push(W(r, u)), u.setMonth(u.getMonth() + c);
1498
- return i ? s.reverse() : s;
1499
- }
1500
- function un(e, t) {
1501
- const { start: r, end: n } = qe(t == null ? void 0 : t.in, e);
1502
- let i = +r > +n;
1503
- const a = F(i ? n : r, t), u = F(i ? r : n, t);
1504
- a.setHours(15), u.setHours(15);
1505
- const c = +u.getTime();
1506
- let s = a, o = (t == null ? void 0 : t.step) ?? 1;
1507
- if (!o) return [];
1508
- o < 0 && (o = -o, i = !i);
1509
- const f = [];
1510
- for (; +s <= c; )
1511
- s.setHours(0), f.push(W(r, s)), s = en(s, o), s.setHours(15);
1512
- return i ? f.reverse() : f;
1513
- }
1514
- function cn(e, t) {
1515
- const r = k(e, t == null ? void 0 : t.in);
1516
- return r.setFullYear(r.getFullYear(), 0, 1), r.setHours(0, 0, 0, 0), r;
1517
- }
1518
- const ln = {
1519
- lessThanXSeconds: {
1520
- one: "less than a second",
1521
- other: "less than {{count}} seconds"
1522
- },
1523
- xSeconds: {
1524
- one: "1 second",
1525
- other: "{{count}} seconds"
1526
- },
1527
- halfAMinute: "half a minute",
1528
- lessThanXMinutes: {
1529
- one: "less than a minute",
1530
- other: "less than {{count}} minutes"
1531
- },
1532
- xMinutes: {
1533
- one: "1 minute",
1534
- other: "{{count}} minutes"
1535
- },
1536
- aboutXHours: {
1537
- one: "about 1 hour",
1538
- other: "about {{count}} hours"
1539
- },
1540
- xHours: {
1541
- one: "1 hour",
1542
- other: "{{count}} hours"
1543
- },
1544
- xDays: {
1545
- one: "1 day",
1546
- other: "{{count}} days"
1547
- },
1548
- aboutXWeeks: {
1549
- one: "about 1 week",
1550
- other: "about {{count}} weeks"
1551
- },
1552
- xWeeks: {
1553
- one: "1 week",
1554
- other: "{{count}} weeks"
1555
- },
1556
- aboutXMonths: {
1557
- one: "about 1 month",
1558
- other: "about {{count}} months"
1559
- },
1560
- xMonths: {
1561
- one: "1 month",
1562
- other: "{{count}} months"
1563
- },
1564
- aboutXYears: {
1565
- one: "about 1 year",
1566
- other: "about {{count}} years"
1567
- },
1568
- xYears: {
1569
- one: "1 year",
1570
- other: "{{count}} years"
1571
- },
1572
- overXYears: {
1573
- one: "over 1 year",
1574
- other: "over {{count}} years"
1575
- },
1576
- almostXYears: {
1577
- one: "almost 1 year",
1578
- other: "almost {{count}} years"
1579
- }
1580
- }, dn = (e, t, r) => {
1581
- let n;
1582
- const i = ln[e];
1583
- return typeof i == "string" ? n = i : t === 1 ? n = i.one : n = i.other.replace("{{count}}", t.toString()), r != null && r.addSuffix ? r.comparison && r.comparison > 0 ? "in " + n : n + " ago" : n;
1584
- };
1585
- function Ae(e) {
1586
- return (t = {}) => {
1587
- const r = t.width ? String(t.width) : e.defaultWidth;
1588
- return e.formats[r] || e.formats[e.defaultWidth];
1589
- };
1590
- }
1591
- const fn = {
1592
- full: "EEEE, MMMM do, y",
1593
- long: "MMMM do, y",
1594
- medium: "MMM d, y",
1595
- short: "MM/dd/yyyy"
1596
- }, hn = {
1597
- full: "h:mm:ss a zzzz",
1598
- long: "h:mm:ss a z",
1599
- medium: "h:mm:ss a",
1600
- short: "h:mm a"
1601
- }, gn = {
1602
- full: "{{date}} 'at' {{time}}",
1603
- long: "{{date}} 'at' {{time}}",
1604
- medium: "{{date}}, {{time}}",
1605
- short: "{{date}}, {{time}}"
1606
- }, pn = {
1607
- date: Ae({
1608
- formats: fn,
1609
- defaultWidth: "full"
1610
- }),
1611
- time: Ae({
1612
- formats: hn,
1613
- defaultWidth: "full"
1614
- }),
1615
- dateTime: Ae({
1616
- formats: gn,
1617
- defaultWidth: "full"
1618
- })
1619
- }, mn = {
1620
- lastWeek: "'last' eeee 'at' p",
1621
- yesterday: "'yesterday at' p",
1622
- today: "'today at' p",
1623
- tomorrow: "'tomorrow at' p",
1624
- nextWeek: "eeee 'at' p",
1625
- other: "P"
1626
- }, yn = (e, t, r, n) => mn[e];
1627
- function ue(e) {
1628
- return (t, r) => {
1629
- const n = r != null && r.context ? String(r.context) : "standalone";
1630
- let i;
1631
- if (n === "formatting" && e.formattingValues) {
1632
- const u = e.defaultFormattingWidth || e.defaultWidth, c = r != null && r.width ? String(r.width) : u;
1633
- i = e.formattingValues[c] || e.formattingValues[u];
1634
- } else {
1635
- const u = e.defaultWidth, c = r != null && r.width ? String(r.width) : e.defaultWidth;
1636
- i = e.values[c] || e.values[u];
1637
- }
1638
- const a = e.argumentCallback ? e.argumentCallback(t) : t;
1639
- return i[a];
1640
- };
1641
- }
1642
- const vn = {
1643
- narrow: ["B", "A"],
1644
- abbreviated: ["BC", "AD"],
1645
- wide: ["Before Christ", "Anno Domini"]
1646
- }, bn = {
1647
- narrow: ["1", "2", "3", "4"],
1648
- abbreviated: ["Q1", "Q2", "Q3", "Q4"],
1649
- wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
1650
- }, wn = {
1651
- narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
1652
- abbreviated: [
1653
- "Jan",
1654
- "Feb",
1655
- "Mar",
1656
- "Apr",
1657
- "May",
1658
- "Jun",
1659
- "Jul",
1660
- "Aug",
1661
- "Sep",
1662
- "Oct",
1663
- "Nov",
1664
- "Dec"
1665
- ],
1666
- wide: [
1667
- "January",
1668
- "February",
1669
- "March",
1670
- "April",
1671
- "May",
1672
- "June",
1673
- "July",
1674
- "August",
1675
- "September",
1676
- "October",
1677
- "November",
1678
- "December"
1679
- ]
1680
- }, xn = {
1681
- narrow: ["S", "M", "T", "W", "T", "F", "S"],
1682
- short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
1683
- abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
1684
- wide: [
1685
- "Sunday",
1686
- "Monday",
1687
- "Tuesday",
1688
- "Wednesday",
1689
- "Thursday",
1690
- "Friday",
1691
- "Saturday"
1692
- ]
1693
- }, Sn = {
1694
- narrow: {
1695
- am: "a",
1696
- pm: "p",
1697
- midnight: "mi",
1698
- noon: "n",
1699
- morning: "morning",
1700
- afternoon: "afternoon",
1701
- evening: "evening",
1702
- night: "night"
1703
- },
1704
- abbreviated: {
1705
- am: "AM",
1706
- pm: "PM",
1707
- midnight: "midnight",
1708
- noon: "noon",
1709
- morning: "morning",
1710
- afternoon: "afternoon",
1711
- evening: "evening",
1712
- night: "night"
1713
- },
1714
- wide: {
1715
- am: "a.m.",
1716
- pm: "p.m.",
1717
- midnight: "midnight",
1718
- noon: "noon",
1719
- morning: "morning",
1720
- afternoon: "afternoon",
1721
- evening: "evening",
1722
- night: "night"
1723
- }
1724
- }, On = {
1725
- narrow: {
1726
- am: "a",
1727
- pm: "p",
1728
- midnight: "mi",
1729
- noon: "n",
1730
- morning: "in the morning",
1731
- afternoon: "in the afternoon",
1732
- evening: "in the evening",
1733
- night: "at night"
1734
- },
1735
- abbreviated: {
1736
- am: "AM",
1737
- pm: "PM",
1738
- midnight: "midnight",
1739
- noon: "noon",
1740
- morning: "in the morning",
1741
- afternoon: "in the afternoon",
1742
- evening: "in the evening",
1743
- night: "at night"
1744
- },
1745
- wide: {
1746
- am: "a.m.",
1747
- pm: "p.m.",
1748
- midnight: "midnight",
1749
- noon: "noon",
1750
- morning: "in the morning",
1751
- afternoon: "in the afternoon",
1752
- evening: "in the evening",
1753
- night: "at night"
1754
- }
1755
- }, Dn = (e, t) => {
1756
- const r = Number(e), n = r % 100;
1757
- if (n > 20 || n < 10)
1758
- switch (n % 10) {
1759
- case 1:
1760
- return r + "st";
1761
- case 2:
1762
- return r + "nd";
1763
- case 3:
1764
- return r + "rd";
1765
- }
1766
- return r + "th";
1767
- }, Tn = {
1768
- ordinalNumber: Dn,
1769
- era: ue({
1770
- values: vn,
1771
- defaultWidth: "wide"
1772
- }),
1773
- quarter: ue({
1774
- values: bn,
1775
- defaultWidth: "wide",
1776
- argumentCallback: (e) => e - 1
1777
- }),
1778
- month: ue({
1779
- values: wn,
1780
- defaultWidth: "wide"
1781
- }),
1782
- day: ue({
1783
- values: xn,
1784
- defaultWidth: "wide"
1785
- }),
1786
- dayPeriod: ue({
1787
- values: Sn,
1788
- defaultWidth: "wide",
1789
- formattingValues: On,
1790
- defaultFormattingWidth: "wide"
1791
- })
1792
- };
1793
- function ce(e) {
1794
- return (t, r = {}) => {
1795
- const n = r.width, i = n && e.matchPatterns[n] || e.matchPatterns[e.defaultMatchWidth], a = t.match(i);
1796
- if (!a)
1797
- return null;
1798
- const u = a[0], c = n && e.parsePatterns[n] || e.parsePatterns[e.defaultParseWidth], s = Array.isArray(c) ? En(c, (d) => d.test(u)) : (
1799
- // [TODO] -- I challenge you to fix the type
1800
- Mn(c, (d) => d.test(u))
1801
- );
1802
- let o;
1803
- o = e.valueCallback ? e.valueCallback(s) : s, o = r.valueCallback ? (
1804
- // [TODO] -- I challenge you to fix the type
1805
- r.valueCallback(o)
1806
- ) : o;
1807
- const f = t.slice(u.length);
1808
- return { value: o, rest: f };
1809
- };
1810
- }
1811
- function Mn(e, t) {
1812
- for (const r in e)
1813
- if (Object.prototype.hasOwnProperty.call(e, r) && t(e[r]))
1814
- return r;
1815
- }
1816
- function En(e, t) {
1817
- for (let r = 0; r < e.length; r++)
1818
- if (t(e[r]))
1819
- return r;
1820
- }
1821
- function Pn(e) {
1822
- return (t, r = {}) => {
1823
- const n = t.match(e.matchPattern);
1824
- if (!n) return null;
1825
- const i = n[0], a = t.match(e.parsePattern);
1826
- if (!a) return null;
1827
- let u = e.valueCallback ? e.valueCallback(a[0]) : a[0];
1828
- u = r.valueCallback ? r.valueCallback(u) : u;
1829
- const c = t.slice(i.length);
1830
- return { value: u, rest: c };
1831
- };
1832
- }
1833
- const Rn = /^(\d+)(th|st|nd|rd)?/i, kn = /\d+/i, Nn = {
1834
- narrow: /^(b|a)/i,
1835
- abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
1836
- wide: /^(before christ|before common era|anno domini|common era)/i
1837
- }, An = {
1838
- any: [/^b/i, /^(a|c)/i]
1839
- }, zn = {
1840
- narrow: /^[1234]/i,
1841
- abbreviated: /^q[1234]/i,
1842
- wide: /^[1234](th|st|nd|rd)? quarter/i
1843
- }, _n = {
1844
- any: [/1/i, /2/i, /3/i, /4/i]
1845
- }, Wn = {
1846
- narrow: /^[jfmasond]/i,
1847
- abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
1848
- wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
1849
- }, Cn = {
1850
- narrow: [
1851
- /^j/i,
1852
- /^f/i,
1853
- /^m/i,
1854
- /^a/i,
1855
- /^m/i,
1856
- /^j/i,
1857
- /^j/i,
1858
- /^a/i,
1859
- /^s/i,
1860
- /^o/i,
1861
- /^n/i,
1862
- /^d/i
1863
- ],
1864
- any: [
1865
- /^ja/i,
1866
- /^f/i,
1867
- /^mar/i,
1868
- /^ap/i,
1869
- /^may/i,
1870
- /^jun/i,
1871
- /^jul/i,
1872
- /^au/i,
1873
- /^s/i,
1874
- /^o/i,
1875
- /^n/i,
1876
- /^d/i
1877
- ]
1878
- }, Ln = {
1879
- narrow: /^[smtwf]/i,
1880
- short: /^(su|mo|tu|we|th|fr|sa)/i,
1881
- abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
1882
- wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
1883
- }, In = {
1884
- narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
1885
- any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
1886
- }, Hn = {
1887
- narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
1888
- any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
1889
- }, jn = {
1890
- any: {
1891
- am: /^a/i,
1892
- pm: /^p/i,
1893
- midnight: /^mi/i,
1894
- noon: /^no/i,
1895
- morning: /morning/i,
1896
- afternoon: /afternoon/i,
1897
- evening: /evening/i,
1898
- night: /night/i
1899
- }
1900
- }, Bn = {
1901
- ordinalNumber: Pn({
1902
- matchPattern: Rn,
1903
- parsePattern: kn,
1904
- valueCallback: (e) => parseInt(e, 10)
1905
- }),
1906
- era: ce({
1907
- matchPatterns: Nn,
1908
- defaultMatchWidth: "wide",
1909
- parsePatterns: An,
1910
- defaultParseWidth: "any"
1911
- }),
1912
- quarter: ce({
1913
- matchPatterns: zn,
1914
- defaultMatchWidth: "wide",
1915
- parsePatterns: _n,
1916
- defaultParseWidth: "any",
1917
- valueCallback: (e) => e + 1
1918
- }),
1919
- month: ce({
1920
- matchPatterns: Wn,
1921
- defaultMatchWidth: "wide",
1922
- parsePatterns: Cn,
1923
- defaultParseWidth: "any"
1924
- }),
1925
- day: ce({
1926
- matchPatterns: Ln,
1927
- defaultMatchWidth: "wide",
1928
- parsePatterns: In,
1929
- defaultParseWidth: "any"
1930
- }),
1931
- dayPeriod: ce({
1932
- matchPatterns: Hn,
1933
- defaultMatchWidth: "any",
1934
- parsePatterns: jn,
1935
- defaultParseWidth: "any"
1936
- })
1937
- }, Yn = {
1938
- code: "en-US",
1939
- formatDistance: dn,
1940
- formatLong: pn,
1941
- formatRelative: yn,
1942
- localize: Tn,
1943
- match: Bn,
1944
- options: {
1945
- weekStartsOn: 0,
1946
- firstWeekContainsDate: 1
1947
- }
1948
- };
1949
- function Fn(e, t) {
1950
- const r = k(e, t == null ? void 0 : t.in);
1951
- return U(r, cn(r)) + 1;
1952
- }
1953
- function $n(e, t) {
1954
- const r = k(e, t == null ? void 0 : t.in), n = +De(r) - +Zr(r);
1955
- return Math.round(n / Bt) + 1;
1956
- }
1957
- function qt(e, t) {
1958
- var f, d, l, h;
1959
- const r = k(e, t == null ? void 0 : t.in), n = r.getFullYear(), i = Me(), a = (t == null ? void 0 : t.firstWeekContainsDate) ?? ((d = (f = t == null ? void 0 : t.locale) == null ? void 0 : f.options) == null ? void 0 : d.firstWeekContainsDate) ?? i.firstWeekContainsDate ?? ((h = (l = i.locale) == null ? void 0 : l.options) == null ? void 0 : h.firstWeekContainsDate) ?? 1, u = W((t == null ? void 0 : t.in) || e, 0);
1960
- u.setFullYear(n + 1, 0, a), u.setHours(0, 0, 0, 0);
1961
- const c = F(u, t), s = W((t == null ? void 0 : t.in) || e, 0);
1962
- s.setFullYear(n, 0, a), s.setHours(0, 0, 0, 0);
1963
- const o = F(s, t);
1964
- return +r >= +c ? n + 1 : +r >= +o ? n : n - 1;
1965
- }
1966
- function qn(e, t) {
1967
- var c, s, o, f;
1968
- const r = Me(), n = (t == null ? void 0 : t.firstWeekContainsDate) ?? ((s = (c = t == null ? void 0 : t.locale) == null ? void 0 : c.options) == null ? void 0 : s.firstWeekContainsDate) ?? r.firstWeekContainsDate ?? ((f = (o = r.locale) == null ? void 0 : o.options) == null ? void 0 : f.firstWeekContainsDate) ?? 1, i = qt(e, t), a = W((t == null ? void 0 : t.in) || e, 0);
1969
- return a.setFullYear(i, 0, n), a.setHours(0, 0, 0, 0), F(a, t);
1970
- }
1971
- function Xn(e, t) {
1972
- const r = k(e, t == null ? void 0 : t.in), n = +F(r, t) - +qn(r, t);
1973
- return Math.round(n / Bt) + 1;
1974
- }
1975
- function T(e, t) {
1976
- const r = e < 0 ? "-" : "", n = Math.abs(e).toString().padStart(t, "0");
1977
- return r + n;
1978
- }
1979
- const q = {
1980
- // Year
1981
- y(e, t) {
1982
- const r = e.getFullYear(), n = r > 0 ? r : 1 - r;
1983
- return T(t === "yy" ? n % 100 : n, t.length);
1984
- },
1985
- // Month
1986
- M(e, t) {
1987
- const r = e.getMonth();
1988
- return t === "M" ? String(r + 1) : T(r + 1, 2);
1989
- },
1990
- // Day of the month
1991
- d(e, t) {
1992
- return T(e.getDate(), t.length);
1993
- },
1994
- // AM or PM
1995
- a(e, t) {
1996
- const r = e.getHours() / 12 >= 1 ? "pm" : "am";
1997
- switch (t) {
1998
- case "a":
1999
- case "aa":
2000
- return r.toUpperCase();
2001
- case "aaa":
2002
- return r;
2003
- case "aaaaa":
2004
- return r[0];
2005
- case "aaaa":
2006
- default:
2007
- return r === "am" ? "a.m." : "p.m.";
2008
- }
2009
- },
2010
- // Hour [1-12]
2011
- h(e, t) {
2012
- return T(e.getHours() % 12 || 12, t.length);
2013
- },
2014
- // Hour [0-23]
2015
- H(e, t) {
2016
- return T(e.getHours(), t.length);
2017
- },
2018
- // Minute
2019
- m(e, t) {
2020
- return T(e.getMinutes(), t.length);
2021
- },
2022
- // Second
2023
- s(e, t) {
2024
- return T(e.getSeconds(), t.length);
2025
- },
2026
- // Fraction of second
2027
- S(e, t) {
2028
- const r = t.length, n = e.getMilliseconds(), i = Math.trunc(
2029
- n * Math.pow(10, r - 3)
2030
- );
2031
- return T(i, t.length);
2032
- }
2033
- }, Z = {
2034
- midnight: "midnight",
2035
- noon: "noon",
2036
- morning: "morning",
2037
- afternoon: "afternoon",
2038
- evening: "evening",
2039
- night: "night"
2040
- }, pt = {
2041
- // Era
2042
- G: function(e, t, r) {
2043
- const n = e.getFullYear() > 0 ? 1 : 0;
2044
- switch (t) {
2045
- // AD, BC
2046
- case "G":
2047
- case "GG":
2048
- case "GGG":
2049
- return r.era(n, { width: "abbreviated" });
2050
- // A, B
2051
- case "GGGGG":
2052
- return r.era(n, { width: "narrow" });
2053
- // Anno Domini, Before Christ
2054
- case "GGGG":
2055
- default:
2056
- return r.era(n, { width: "wide" });
2057
- }
2058
- },
2059
- // Year
2060
- y: function(e, t, r) {
2061
- if (t === "yo") {
2062
- const n = e.getFullYear(), i = n > 0 ? n : 1 - n;
2063
- return r.ordinalNumber(i, { unit: "year" });
2064
- }
2065
- return q.y(e, t);
2066
- },
2067
- // Local week-numbering year
2068
- Y: function(e, t, r, n) {
2069
- const i = qt(e, n), a = i > 0 ? i : 1 - i;
2070
- if (t === "YY") {
2071
- const u = a % 100;
2072
- return T(u, 2);
2073
- }
2074
- return t === "Yo" ? r.ordinalNumber(a, { unit: "year" }) : T(a, t.length);
2075
- },
2076
- // ISO week-numbering year
2077
- R: function(e, t) {
2078
- const r = Ft(e);
2079
- return T(r, t.length);
2080
- },
2081
- // Extended year. This is a single number designating the year of this calendar system.
2082
- // The main difference between `y` and `u` localizers are B.C. years:
2083
- // | Year | `y` | `u` |
2084
- // |------|-----|-----|
2085
- // | AC 1 | 1 | 1 |
2086
- // | BC 1 | 1 | 0 |
2087
- // | BC 2 | 2 | -1 |
2088
- // Also `yy` always returns the last two digits of a year,
2089
- // while `uu` pads single digit years to 2 characters and returns other years unchanged.
2090
- u: function(e, t) {
2091
- const r = e.getFullYear();
2092
- return T(r, t.length);
2093
- },
2094
- // Quarter
2095
- Q: function(e, t, r) {
2096
- const n = Math.ceil((e.getMonth() + 1) / 3);
2097
- switch (t) {
2098
- // 1, 2, 3, 4
2099
- case "Q":
2100
- return String(n);
2101
- // 01, 02, 03, 04
2102
- case "QQ":
2103
- return T(n, 2);
2104
- // 1st, 2nd, 3rd, 4th
2105
- case "Qo":
2106
- return r.ordinalNumber(n, { unit: "quarter" });
2107
- // Q1, Q2, Q3, Q4
2108
- case "QQQ":
2109
- return r.quarter(n, {
2110
- width: "abbreviated",
2111
- context: "formatting"
2112
- });
2113
- // 1, 2, 3, 4 (narrow quarter; could be not numerical)
2114
- case "QQQQQ":
2115
- return r.quarter(n, {
2116
- width: "narrow",
2117
- context: "formatting"
2118
- });
2119
- // 1st quarter, 2nd quarter, ...
2120
- case "QQQQ":
2121
- default:
2122
- return r.quarter(n, {
2123
- width: "wide",
2124
- context: "formatting"
2125
- });
2126
- }
2127
- },
2128
- // Stand-alone quarter
2129
- q: function(e, t, r) {
2130
- const n = Math.ceil((e.getMonth() + 1) / 3);
2131
- switch (t) {
2132
- // 1, 2, 3, 4
2133
- case "q":
2134
- return String(n);
2135
- // 01, 02, 03, 04
2136
- case "qq":
2137
- return T(n, 2);
2138
- // 1st, 2nd, 3rd, 4th
2139
- case "qo":
2140
- return r.ordinalNumber(n, { unit: "quarter" });
2141
- // Q1, Q2, Q3, Q4
2142
- case "qqq":
2143
- return r.quarter(n, {
2144
- width: "abbreviated",
2145
- context: "standalone"
2146
- });
2147
- // 1, 2, 3, 4 (narrow quarter; could be not numerical)
2148
- case "qqqqq":
2149
- return r.quarter(n, {
2150
- width: "narrow",
2151
- context: "standalone"
2152
- });
2153
- // 1st quarter, 2nd quarter, ...
2154
- case "qqqq":
2155
- default:
2156
- return r.quarter(n, {
2157
- width: "wide",
2158
- context: "standalone"
2159
- });
2160
- }
2161
- },
2162
- // Month
2163
- M: function(e, t, r) {
2164
- const n = e.getMonth();
2165
- switch (t) {
2166
- case "M":
2167
- case "MM":
2168
- return q.M(e, t);
2169
- // 1st, 2nd, ..., 12th
2170
- case "Mo":
2171
- return r.ordinalNumber(n + 1, { unit: "month" });
2172
- // Jan, Feb, ..., Dec
2173
- case "MMM":
2174
- return r.month(n, {
2175
- width: "abbreviated",
2176
- context: "formatting"
2177
- });
2178
- // J, F, ..., D
2179
- case "MMMMM":
2180
- return r.month(n, {
2181
- width: "narrow",
2182
- context: "formatting"
2183
- });
2184
- // January, February, ..., December
2185
- case "MMMM":
2186
- default:
2187
- return r.month(n, { width: "wide", context: "formatting" });
2188
- }
2189
- },
2190
- // Stand-alone month
2191
- L: function(e, t, r) {
2192
- const n = e.getMonth();
2193
- switch (t) {
2194
- // 1, 2, ..., 12
2195
- case "L":
2196
- return String(n + 1);
2197
- // 01, 02, ..., 12
2198
- case "LL":
2199
- return T(n + 1, 2);
2200
- // 1st, 2nd, ..., 12th
2201
- case "Lo":
2202
- return r.ordinalNumber(n + 1, { unit: "month" });
2203
- // Jan, Feb, ..., Dec
2204
- case "LLL":
2205
- return r.month(n, {
2206
- width: "abbreviated",
2207
- context: "standalone"
2208
- });
2209
- // J, F, ..., D
2210
- case "LLLLL":
2211
- return r.month(n, {
2212
- width: "narrow",
2213
- context: "standalone"
2214
- });
2215
- // January, February, ..., December
2216
- case "LLLL":
2217
- default:
2218
- return r.month(n, { width: "wide", context: "standalone" });
2219
- }
2220
- },
2221
- // Local week of year
2222
- w: function(e, t, r, n) {
2223
- const i = Xn(e, n);
2224
- return t === "wo" ? r.ordinalNumber(i, { unit: "week" }) : T(i, t.length);
2225
- },
2226
- // ISO week of year
2227
- I: function(e, t, r) {
2228
- const n = $n(e);
2229
- return t === "Io" ? r.ordinalNumber(n, { unit: "week" }) : T(n, t.length);
2230
- },
2231
- // Day of the month
2232
- d: function(e, t, r) {
2233
- return t === "do" ? r.ordinalNumber(e.getDate(), { unit: "date" }) : q.d(e, t);
2234
- },
2235
- // Day of year
2236
- D: function(e, t, r) {
2237
- const n = Fn(e);
2238
- return t === "Do" ? r.ordinalNumber(n, { unit: "dayOfYear" }) : T(n, t.length);
2239
- },
2240
- // Day of week
2241
- E: function(e, t, r) {
2242
- const n = e.getDay();
2243
- switch (t) {
2244
- // Tue
2245
- case "E":
2246
- case "EE":
2247
- case "EEE":
2248
- return r.day(n, {
2249
- width: "abbreviated",
2250
- context: "formatting"
2251
- });
2252
- // T
2253
- case "EEEEE":
2254
- return r.day(n, {
2255
- width: "narrow",
2256
- context: "formatting"
2257
- });
2258
- // Tu
2259
- case "EEEEEE":
2260
- return r.day(n, {
2261
- width: "short",
2262
- context: "formatting"
2263
- });
2264
- // Tuesday
2265
- case "EEEE":
2266
- default:
2267
- return r.day(n, {
2268
- width: "wide",
2269
- context: "formatting"
2270
- });
2271
- }
2272
- },
2273
- // Local day of week
2274
- e: function(e, t, r, n) {
2275
- const i = e.getDay(), a = (i - n.weekStartsOn + 8) % 7 || 7;
2276
- switch (t) {
2277
- // Numerical value (Nth day of week with current locale or weekStartsOn)
2278
- case "e":
2279
- return String(a);
2280
- // Padded numerical value
2281
- case "ee":
2282
- return T(a, 2);
2283
- // 1st, 2nd, ..., 7th
2284
- case "eo":
2285
- return r.ordinalNumber(a, { unit: "day" });
2286
- case "eee":
2287
- return r.day(i, {
2288
- width: "abbreviated",
2289
- context: "formatting"
2290
- });
2291
- // T
2292
- case "eeeee":
2293
- return r.day(i, {
2294
- width: "narrow",
2295
- context: "formatting"
2296
- });
2297
- // Tu
2298
- case "eeeeee":
2299
- return r.day(i, {
2300
- width: "short",
2301
- context: "formatting"
2302
- });
2303
- // Tuesday
2304
- case "eeee":
2305
- default:
2306
- return r.day(i, {
2307
- width: "wide",
2308
- context: "formatting"
2309
- });
2310
- }
2311
- },
2312
- // Stand-alone local day of week
2313
- c: function(e, t, r, n) {
2314
- const i = e.getDay(), a = (i - n.weekStartsOn + 8) % 7 || 7;
2315
- switch (t) {
2316
- // Numerical value (same as in `e`)
2317
- case "c":
2318
- return String(a);
2319
- // Padded numerical value
2320
- case "cc":
2321
- return T(a, t.length);
2322
- // 1st, 2nd, ..., 7th
2323
- case "co":
2324
- return r.ordinalNumber(a, { unit: "day" });
2325
- case "ccc":
2326
- return r.day(i, {
2327
- width: "abbreviated",
2328
- context: "standalone"
2329
- });
2330
- // T
2331
- case "ccccc":
2332
- return r.day(i, {
2333
- width: "narrow",
2334
- context: "standalone"
2335
- });
2336
- // Tu
2337
- case "cccccc":
2338
- return r.day(i, {
2339
- width: "short",
2340
- context: "standalone"
2341
- });
2342
- // Tuesday
2343
- case "cccc":
2344
- default:
2345
- return r.day(i, {
2346
- width: "wide",
2347
- context: "standalone"
2348
- });
2349
- }
2350
- },
2351
- // ISO day of week
2352
- i: function(e, t, r) {
2353
- const n = e.getDay(), i = n === 0 ? 7 : n;
2354
- switch (t) {
2355
- // 2
2356
- case "i":
2357
- return String(i);
2358
- // 02
2359
- case "ii":
2360
- return T(i, t.length);
2361
- // 2nd
2362
- case "io":
2363
- return r.ordinalNumber(i, { unit: "day" });
2364
- // Tue
2365
- case "iii":
2366
- return r.day(n, {
2367
- width: "abbreviated",
2368
- context: "formatting"
2369
- });
2370
- // T
2371
- case "iiiii":
2372
- return r.day(n, {
2373
- width: "narrow",
2374
- context: "formatting"
2375
- });
2376
- // Tu
2377
- case "iiiiii":
2378
- return r.day(n, {
2379
- width: "short",
2380
- context: "formatting"
2381
- });
2382
- // Tuesday
2383
- case "iiii":
2384
- default:
2385
- return r.day(n, {
2386
- width: "wide",
2387
- context: "formatting"
2388
- });
2389
- }
2390
- },
2391
- // AM or PM
2392
- a: function(e, t, r) {
2393
- const i = e.getHours() / 12 >= 1 ? "pm" : "am";
2394
- switch (t) {
2395
- case "a":
2396
- case "aa":
2397
- return r.dayPeriod(i, {
2398
- width: "abbreviated",
2399
- context: "formatting"
2400
- });
2401
- case "aaa":
2402
- return r.dayPeriod(i, {
2403
- width: "abbreviated",
2404
- context: "formatting"
2405
- }).toLowerCase();
2406
- case "aaaaa":
2407
- return r.dayPeriod(i, {
2408
- width: "narrow",
2409
- context: "formatting"
2410
- });
2411
- case "aaaa":
2412
- default:
2413
- return r.dayPeriod(i, {
2414
- width: "wide",
2415
- context: "formatting"
2416
- });
2417
- }
2418
- },
2419
- // AM, PM, midnight, noon
2420
- b: function(e, t, r) {
2421
- const n = e.getHours();
2422
- let i;
2423
- switch (n === 12 ? i = Z.noon : n === 0 ? i = Z.midnight : i = n / 12 >= 1 ? "pm" : "am", t) {
2424
- case "b":
2425
- case "bb":
2426
- return r.dayPeriod(i, {
2427
- width: "abbreviated",
2428
- context: "formatting"
2429
- });
2430
- case "bbb":
2431
- return r.dayPeriod(i, {
2432
- width: "abbreviated",
2433
- context: "formatting"
2434
- }).toLowerCase();
2435
- case "bbbbb":
2436
- return r.dayPeriod(i, {
2437
- width: "narrow",
2438
- context: "formatting"
2439
- });
2440
- case "bbbb":
2441
- default:
2442
- return r.dayPeriod(i, {
2443
- width: "wide",
2444
- context: "formatting"
2445
- });
2446
- }
2447
- },
2448
- // in the morning, in the afternoon, in the evening, at night
2449
- B: function(e, t, r) {
2450
- const n = e.getHours();
2451
- let i;
2452
- switch (n >= 17 ? i = Z.evening : n >= 12 ? i = Z.afternoon : n >= 4 ? i = Z.morning : i = Z.night, t) {
2453
- case "B":
2454
- case "BB":
2455
- case "BBB":
2456
- return r.dayPeriod(i, {
2457
- width: "abbreviated",
2458
- context: "formatting"
2459
- });
2460
- case "BBBBB":
2461
- return r.dayPeriod(i, {
2462
- width: "narrow",
2463
- context: "formatting"
2464
- });
2465
- case "BBBB":
2466
- default:
2467
- return r.dayPeriod(i, {
2468
- width: "wide",
2469
- context: "formatting"
2470
- });
2471
- }
2472
- },
2473
- // Hour [1-12]
2474
- h: function(e, t, r) {
2475
- if (t === "ho") {
2476
- let n = e.getHours() % 12;
2477
- return n === 0 && (n = 12), r.ordinalNumber(n, { unit: "hour" });
2478
- }
2479
- return q.h(e, t);
2480
- },
2481
- // Hour [0-23]
2482
- H: function(e, t, r) {
2483
- return t === "Ho" ? r.ordinalNumber(e.getHours(), { unit: "hour" }) : q.H(e, t);
2484
- },
2485
- // Hour [0-11]
2486
- K: function(e, t, r) {
2487
- const n = e.getHours() % 12;
2488
- return t === "Ko" ? r.ordinalNumber(n, { unit: "hour" }) : T(n, t.length);
2489
- },
2490
- // Hour [1-24]
2491
- k: function(e, t, r) {
2492
- let n = e.getHours();
2493
- return n === 0 && (n = 24), t === "ko" ? r.ordinalNumber(n, { unit: "hour" }) : T(n, t.length);
2494
- },
2495
- // Minute
2496
- m: function(e, t, r) {
2497
- return t === "mo" ? r.ordinalNumber(e.getMinutes(), { unit: "minute" }) : q.m(e, t);
2498
- },
2499
- // Second
2500
- s: function(e, t, r) {
2501
- return t === "so" ? r.ordinalNumber(e.getSeconds(), { unit: "second" }) : q.s(e, t);
2502
- },
2503
- // Fraction of second
2504
- S: function(e, t) {
2505
- return q.S(e, t);
2506
- },
2507
- // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
2508
- X: function(e, t, r) {
2509
- const n = e.getTimezoneOffset();
2510
- if (n === 0)
2511
- return "Z";
2512
- switch (t) {
2513
- // Hours and optional minutes
2514
- case "X":
2515
- return yt(n);
2516
- // Hours, minutes and optional seconds without `:` delimiter
2517
- // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
2518
- // so this token always has the same output as `XX`
2519
- case "XXXX":
2520
- case "XX":
2521
- return V(n);
2522
- // Hours, minutes and optional seconds with `:` delimiter
2523
- // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
2524
- // so this token always has the same output as `XXX`
2525
- case "XXXXX":
2526
- case "XXX":
2527
- // Hours and minutes with `:` delimiter
2528
- default:
2529
- return V(n, ":");
2530
- }
2531
- },
2532
- // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
2533
- x: function(e, t, r) {
2534
- const n = e.getTimezoneOffset();
2535
- switch (t) {
2536
- // Hours and optional minutes
2537
- case "x":
2538
- return yt(n);
2539
- // Hours, minutes and optional seconds without `:` delimiter
2540
- // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
2541
- // so this token always has the same output as `xx`
2542
- case "xxxx":
2543
- case "xx":
2544
- return V(n);
2545
- // Hours, minutes and optional seconds with `:` delimiter
2546
- // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
2547
- // so this token always has the same output as `xxx`
2548
- case "xxxxx":
2549
- case "xxx":
2550
- // Hours and minutes with `:` delimiter
2551
- default:
2552
- return V(n, ":");
2553
- }
2554
- },
2555
- // Timezone (GMT)
2556
- O: function(e, t, r) {
2557
- const n = e.getTimezoneOffset();
2558
- switch (t) {
2559
- // Short
2560
- case "O":
2561
- case "OO":
2562
- case "OOO":
2563
- return "GMT" + mt(n, ":");
2564
- // Long
2565
- case "OOOO":
2566
- default:
2567
- return "GMT" + V(n, ":");
2568
- }
2569
- },
2570
- // Timezone (specific non-location)
2571
- z: function(e, t, r) {
2572
- const n = e.getTimezoneOffset();
2573
- switch (t) {
2574
- // Short
2575
- case "z":
2576
- case "zz":
2577
- case "zzz":
2578
- return "GMT" + mt(n, ":");
2579
- // Long
2580
- case "zzzz":
2581
- default:
2582
- return "GMT" + V(n, ":");
2583
- }
2584
- },
2585
- // Seconds timestamp
2586
- t: function(e, t, r) {
2587
- const n = Math.trunc(+e / 1e3);
2588
- return T(n, t.length);
2589
- },
2590
- // Milliseconds timestamp
2591
- T: function(e, t, r) {
2592
- return T(+e, t.length);
2593
- }
2594
- };
2595
- function mt(e, t = "") {
2596
- const r = e > 0 ? "-" : "+", n = Math.abs(e), i = Math.trunc(n / 60), a = n % 60;
2597
- return a === 0 ? r + String(i) : r + String(i) + t + T(a, 2);
2598
- }
2599
- function yt(e, t) {
2600
- return e % 60 === 0 ? (e > 0 ? "-" : "+") + T(Math.abs(e) / 60, 2) : V(e, t);
2601
- }
2602
- function V(e, t = "") {
2603
- const r = e > 0 ? "-" : "+", n = Math.abs(e), i = T(Math.trunc(n / 60), 2), a = T(n % 60, 2);
2604
- return r + i + t + a;
2605
- }
2606
- const vt = (e, t) => {
2607
- switch (e) {
2608
- case "P":
2609
- return t.date({ width: "short" });
2610
- case "PP":
2611
- return t.date({ width: "medium" });
2612
- case "PPP":
2613
- return t.date({ width: "long" });
2614
- case "PPPP":
2615
- default:
2616
- return t.date({ width: "full" });
2617
- }
2618
- }, Xt = (e, t) => {
2619
- switch (e) {
2620
- case "p":
2621
- return t.time({ width: "short" });
2622
- case "pp":
2623
- return t.time({ width: "medium" });
2624
- case "ppp":
2625
- return t.time({ width: "long" });
2626
- case "pppp":
2627
- default:
2628
- return t.time({ width: "full" });
2629
- }
2630
- }, Un = (e, t) => {
2631
- const r = e.match(/(P+)(p+)?/) || [], n = r[1], i = r[2];
2632
- if (!i)
2633
- return vt(e, t);
2634
- let a;
2635
- switch (n) {
2636
- case "P":
2637
- a = t.dateTime({ width: "short" });
2638
- break;
2639
- case "PP":
2640
- a = t.dateTime({ width: "medium" });
2641
- break;
2642
- case "PPP":
2643
- a = t.dateTime({ width: "long" });
2644
- break;
2645
- case "PPPP":
2646
- default:
2647
- a = t.dateTime({ width: "full" });
2648
- break;
2649
- }
2650
- return a.replace("{{date}}", vt(n, t)).replace("{{time}}", Xt(i, t));
2651
- }, Gn = {
2652
- p: Xt,
2653
- P: Un
2654
- }, Kn = /^D+$/, Vn = /^Y+$/, Qn = ["D", "DD", "YY", "YYYY"];
2655
- function Jn(e) {
2656
- return Kn.test(e);
2657
- }
2658
- function Zn(e) {
2659
- return Vn.test(e);
2660
- }
2661
- function ei(e, t, r) {
2662
- const n = ti(e, t, r);
2663
- if (console.warn(n), Qn.includes(e)) throw new RangeError(n);
2664
- }
2665
- function ti(e, t, r) {
2666
- const n = e[0] === "Y" ? "years" : "days of the month";
2667
- return `Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${n} to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
2668
- }
2669
- const ri = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, ni = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, ii = /^'([^]*?)'?$/, ai = /''/g, oi = /[a-zA-Z]/;
2670
- function B(e, t, r) {
2671
- var f, d, l, h;
2672
- const n = Me(), i = n.locale ?? Yn, a = n.firstWeekContainsDate ?? ((d = (f = n.locale) == null ? void 0 : f.options) == null ? void 0 : d.firstWeekContainsDate) ?? 1, u = n.weekStartsOn ?? ((h = (l = n.locale) == null ? void 0 : l.options) == null ? void 0 : h.weekStartsOn) ?? 0, c = k(e, r == null ? void 0 : r.in);
2673
- if (!on(c))
2674
- throw new RangeError("Invalid time value");
2675
- let s = t.match(ni).map((p) => {
2676
- const g = p[0];
2677
- if (g === "p" || g === "P") {
2678
- const y = Gn[g];
2679
- return y(p, i.formatLong);
2680
- }
2681
- return p;
2682
- }).join("").match(ri).map((p) => {
2683
- if (p === "''")
2684
- return { isToken: !1, value: "'" };
2685
- const g = p[0];
2686
- if (g === "'")
2687
- return { isToken: !1, value: si(p) };
2688
- if (pt[g])
2689
- return { isToken: !0, value: p };
2690
- if (g.match(oi))
2691
- throw new RangeError(
2692
- "Format string contains an unescaped latin alphabet character `" + g + "`"
2693
- );
2694
- return { isToken: !1, value: p };
2695
- });
2696
- i.localize.preprocessor && (s = i.localize.preprocessor(c, s));
2697
- const o = {
2698
- firstWeekContainsDate: a,
2699
- weekStartsOn: u,
2700
- locale: i
2701
- };
2702
- return s.map((p) => {
2703
- if (!p.isToken) return p.value;
2704
- const g = p.value;
2705
- (Zn(g) || Jn(g)) && ei(g, t, String(e));
2706
- const y = pt[g[0]];
2707
- return y(c, g, i.localize, o);
2708
- }).join("");
2709
- }
2710
- function si(e) {
2711
- const t = e.match(ii);
2712
- return t ? t[1].replace(ai, "'") : e;
2713
- }
2714
- function ui(e, t) {
2715
- return k(e, t == null ? void 0 : t.in).getDay();
2716
- }
2717
- function ci(e, t) {
2718
- const r = k(e, t == null ? void 0 : t.in), n = r.getMonth();
2719
- return r.setFullYear(r.getFullYear(), n + 1, 0), r.setHours(0, 0, 0, 0), k(r, t == null ? void 0 : t.in);
2720
- }
2721
- function li(e, t, r) {
2722
- let n = t - ui(e, r);
2723
- return n <= 0 && (n += 7), pe(e, n, r);
2724
- }
2725
- function di(e, t) {
2726
- return li(e, 0, t);
2727
- }
2728
- function He(e, t, r) {
2729
- const n = k(e, r == null ? void 0 : r.in);
2730
- return n.setHours(t), n;
2731
- }
2732
- function Xe(e, t, r) {
2733
- const n = hi(e, t, r), i = fi(e, t);
2734
- return { width: n, height: i };
2735
- }
2736
- function fi(e, t) {
2737
- return t.pixelsPerLane;
2738
- }
2739
- function hi(e, t, r) {
2740
- return Math.abs(
2741
- (U(r.end, r.start) + 1) * t.pixelsPerDay
2742
- );
2743
- }
2744
- function Ue(e, t, r, n) {
2745
- const i = Ut(e, t, n), a = pi(e, t, r.start, n);
2746
- return {
2747
- ...i,
2748
- ...a
2749
- };
2750
- }
2751
- function Ut(e, t, r) {
2752
- const n = U(e.end, e.start) * r.pixelsPerDay, i = e.size / t.capacity * r.pixelsPerLane;
2753
- return { width: n, height: i };
2754
- }
2755
- function Ge(e, t, r) {
2756
- return U(e, t) * r.pixelsPerDay + r.pixelsPerDay / 2;
2757
- }
2758
- function gi(e, t, r) {
2759
- return e / t * r.pixelsPerLane;
2760
- }
2761
- function pi(e, t, r, n) {
2762
- const i = Ge(e.start, r, n), a = gi(e.offset, t.capacity, n);
2763
- return { x: i, y: a };
2764
- }
2765
- function te(e, t) {
2766
- const r = e.element.getBoundingClientRect(), n = {
2767
- x: r.x - t.initial.input.pageX,
2768
- y: r.y - t.initial.input.pageY
2769
- }, i = {
2770
- x: n.x / r.width,
2771
- y: n.y / r.height
2772
- };
2773
- return {
2774
- absolute: n,
2775
- relative: i
2776
- };
2777
- }
2778
- function Gt(e, t, r, n, i) {
2779
- return {
2780
- id: e.id,
2781
- laneId: t.id,
2782
- start: He(
2783
- pe(i.start, Math.floor(r.x / n.pixelsPerDay)),
2784
- 12
2785
- ),
2786
- end: He(
2787
- pe(
2788
- i.start,
2789
- Math.floor(
2790
- (r.x + r.width) / n.pixelsPerDay
2791
- )
2792
- ),
2793
- 12
2794
- ),
2795
- offset: Math.floor(
2796
- r.y / n.pixelsPerLane * t.capacity
2797
- ),
2798
- size: Math.floor(
2799
- r.height / n.pixelsPerLane * t.capacity
2800
- ),
2801
- payload: e.payload
2802
- };
2803
- }
2804
- function mi(e, t, r, n, i, a, u, c, s) {
2805
- if (n === null)
2806
- return null;
2807
- const o = Xe(
2808
- e,
2809
- a,
2810
- c
2811
- ), f = t.filter((l) => l.id !== r.id).map((l) => Ue(l, e, c, a));
2812
- let d = null;
2813
- return d = yi(
2814
- e,
2815
- r,
2816
- i,
2817
- a,
2818
- n
2819
- ), d = bi(d, u), d = vi(
2820
- d,
2821
- o
2822
- ), d = wi(
2823
- d,
2824
- f,
2825
- o,
2826
- s
2827
- ), d;
2828
- }
2829
- function yi(e, t, r, n, i) {
2830
- const { width: a, height: u } = Ut(t, e, n), c = i.x + a * r.relative.x, s = i.y + u * r.relative.y;
2831
- return {
2832
- x: c,
2833
- y: s,
2834
- width: a,
2835
- height: u
2836
- };
2837
- }
2838
- function vi(e, t) {
2839
- const r = Math.max(
2840
- 0,
2841
- Math.min(e.x, t.width - e.width)
2842
- ), n = Math.max(
2843
- 0,
2844
- Math.min(e.y, t.height - e.height)
2845
- );
2846
- return {
2847
- ...e,
2848
- x: r,
2849
- y: n
2850
- };
2851
- }
2852
- function bi(e, t) {
2853
- const r = {
2854
- ...e
2855
- };
2856
- return t && t.x && (r.x = bt(r.x, t.x, t.offsetX || 0)), t && t.y && (r.y = bt(r.y, t.y, t.offsetY || 0)), r;
2857
- }
2858
- function bt(e, t, r) {
2859
- return Math.max(
2860
- r,
2861
- r + Math.round((e - r) / t) * t
2862
- );
2863
- }
2864
- function wi(e, t, r, n) {
2865
- const i = {
2866
- ...e
2867
- };
2868
- if (!n) {
2869
- let a = !0;
2870
- for (; a; ) {
2871
- const u = t.find((c) => le(i, c));
2872
- u !== void 0 ? i.y = u.y + u.height : a = !1;
2873
- }
2874
- }
2875
- return Oi(i, r) ? i : null;
2876
- }
2877
- function le(e, t) {
2878
- return !(e.x >= t.x + t.width || t.x >= e.x + e.width || e.y >= t.y + t.height || t.y >= e.y + e.height);
2879
- }
2880
- function xi(e, t) {
2881
- const r = Math.max(e.x, t.x), n = Math.max(e.y, t.y), i = Math.min(e.x + e.width, t.x + t.width), a = Math.min(e.y + e.height, t.y + t.height);
2882
- return r < i && n < a ? {
2883
- x: r,
2884
- y: n,
2885
- width: i - r,
2886
- height: a - n
2887
- } : null;
2888
- }
2889
- function Si(e, t) {
2890
- return !(e.start >= t.end || t.start >= e.end || e.offset >= t.offset + t.size || t.offset >= e.offset + e.size);
2891
- }
2892
- function Oi(e, t) {
2893
- return e.x >= 0 && e.y >= 0 && e.x + e.width <= t.width && e.y + e.height <= t.height;
2894
- }
2895
- function Di(e, t, r, n, i) {
2896
- const a = Ti(
2897
- e,
2898
- t,
2899
- r.capacity,
2900
- n
2901
- );
2902
- if (a) {
2903
- const u = Mi(
2904
- e,
2905
- i.start,
2906
- i.end,
2907
- n,
2908
- a
2909
- );
2910
- if (u)
2911
- return {
2912
- start: u.lower,
2913
- end: u.upper,
2914
- minOffset: a.lower,
2915
- maxOffset: a.upper
2916
- };
2917
- }
2918
- return null;
2919
- }
2920
- function Ti(e, t, r, n) {
2921
- const i = n.filter((f) => f.start <= e && f.end >= e);
2922
- if (i.find(
2923
- (f) => f.offset <= t && f.offset + f.size >= t
2924
- ))
2925
- return null;
2926
- const u = i.filter((f) => f.offset + f.size <= t), c = i.filter((f) => f.offset >= t), s = u.length > 0 ? Math.max(...u.map((f) => f.offset + f.size)) : 0, o = c.length > 0 ? Math.min(...c.map((f) => f.offset)) : r;
2927
- return {
2928
- lower: s,
2929
- upper: o
2930
- };
2931
- }
2932
- function Mi(e, t, r, n, i) {
2933
- const a = {
2934
- start: t,
2935
- end: r,
2936
- offset: i.lower,
2937
- size: i.upper - i.lower
2938
- }, u = n.filter(
2939
- (d) => Si(d, a)
2940
- );
2941
- if (u.length === 0)
2942
- return {
2943
- lower: t,
2944
- upper: r
2945
- };
2946
- const c = u.filter((d) => d.end <= e), s = u.filter((d) => d.start >= e), o = c.length > 0 ? tn(c.map((d) => d.end)) : t, f = s.length > 0 ? rn(s.map((d) => d.start)) : r;
2947
- return {
2948
- lower: o,
2949
- upper: f
2950
- };
2951
- }
2952
- function Ei({
2953
- children: e,
2954
- onDragStart: t = () => {
2955
- },
2956
- onDrag: r = () => {
2957
- },
2958
- onDrop: n = () => {
2959
- },
2960
- onDragEnter: i = () => {
2961
- },
2962
- onDragLeave: a = () => {
2963
- }
2964
- }) {
2965
- const u = re(null);
2966
- return ne(() => {
2967
- const c = u.current;
2968
- return Ie(c), Ur({
2969
- element: c,
2970
- getData: () => ({ drop: "drop" }),
2971
- onDragStart: ({ source: s, location: o }) => {
2972
- const f = ye(o), d = te(s, o);
2973
- t(f, d, s.data);
2974
- },
2975
- onDragEnter: ({ source: s, location: o }) => {
2976
- const f = ye(o), d = te(s, o);
2977
- i(f, d, s.data);
2978
- },
2979
- onDrag: ({ source: s, location: o }) => {
2980
- const f = ye(o), d = te(s, o);
2981
- r(f, d, s.data);
2982
- },
2983
- onDrop: ({ source: s, location: o }) => {
2984
- const f = ye(o), d = te(s, o);
2985
- n(f, d, s.data);
2986
- },
2987
- onDragLeave: ({ source: s, location: o }) => {
2988
- const f = te(s, o);
2989
- a(f, s.data);
2990
- }
2991
- });
2992
- }, [r, a, t, n, i]), /* @__PURE__ */ m("div", { className: "timelane-drop-target", ref: u, children: e });
2993
- }
2994
- function ye(e) {
2995
- const t = e.current.dropTargets[0].element.getBoundingClientRect();
2996
- return {
2997
- x: e.current.input.pageX - t.x,
2998
- y: e.current.input.pageY - t.y
2999
- };
3000
- }
3001
- function Pi({
3002
- x: e,
3003
- y: t,
3004
- width: r,
3005
- height: n,
3006
- children: i
3007
- }) {
3008
- return /* @__PURE__ */ m(
3009
- "div",
3010
- {
3011
- className: "timelane-drop-preview",
3012
- style: {
3013
- left: `${e}px`,
3014
- top: `${t}px`,
3015
- width: `${r}px`,
3016
- height: `${n}px`
3017
- },
3018
- children: i
3019
- }
3020
- );
3021
- }
3022
- var ve = { exports: {} }, z = {};
3023
- /**
3024
- * @license React
3025
- * react-dom.production.js
3026
- *
3027
- * Copyright (c) Meta Platforms, Inc. and affiliates.
3028
- *
3029
- * This source code is licensed under the MIT license found in the
3030
- * LICENSE file in the root directory of this source tree.
3031
- */
3032
- var wt;
3033
- function Ri() {
3034
- if (wt) return z;
3035
- wt = 1;
3036
- var e = Nt;
3037
- function t(s) {
3038
- var o = "https://react.dev/errors/" + s;
3039
- if (1 < arguments.length) {
3040
- o += "?args[]=" + encodeURIComponent(arguments[1]);
3041
- for (var f = 2; f < arguments.length; f++)
3042
- o += "&args[]=" + encodeURIComponent(arguments[f]);
3043
- }
3044
- return "Minified React error #" + s + "; visit " + o + " for the full message or use the non-minified dev environment for full errors and additional helpful warnings.";
3045
- }
3046
- function r() {
3047
- }
3048
- var n = {
3049
- d: {
3050
- f: r,
3051
- r: function() {
3052
- throw Error(t(522));
3053
- },
3054
- D: r,
3055
- C: r,
3056
- L: r,
3057
- m: r,
3058
- X: r,
3059
- S: r,
3060
- M: r
3061
- },
3062
- p: 0,
3063
- findDOMNode: null
3064
- }, i = Symbol.for("react.portal");
3065
- function a(s, o, f) {
3066
- var d = 3 < arguments.length && arguments[3] !== void 0 ? arguments[3] : null;
3067
- return {
3068
- $$typeof: i,
3069
- key: d == null ? null : "" + d,
3070
- children: s,
3071
- containerInfo: o,
3072
- implementation: f
3073
- };
3074
- }
3075
- var u = e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
3076
- function c(s, o) {
3077
- if (s === "font") return "";
3078
- if (typeof o == "string")
3079
- return o === "use-credentials" ? o : "";
3080
- }
3081
- return z.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = n, z.createPortal = function(s, o) {
3082
- var f = 2 < arguments.length && arguments[2] !== void 0 ? arguments[2] : null;
3083
- if (!o || o.nodeType !== 1 && o.nodeType !== 9 && o.nodeType !== 11)
3084
- throw Error(t(299));
3085
- return a(s, o, null, f);
3086
- }, z.flushSync = function(s) {
3087
- var o = u.T, f = n.p;
3088
- try {
3089
- if (u.T = null, n.p = 2, s) return s();
3090
- } finally {
3091
- u.T = o, n.p = f, n.d.f();
3092
- }
3093
- }, z.preconnect = function(s, o) {
3094
- typeof s == "string" && (o ? (o = o.crossOrigin, o = typeof o == "string" ? o === "use-credentials" ? o : "" : void 0) : o = null, n.d.C(s, o));
3095
- }, z.prefetchDNS = function(s) {
3096
- typeof s == "string" && n.d.D(s);
3097
- }, z.preinit = function(s, o) {
3098
- if (typeof s == "string" && o && typeof o.as == "string") {
3099
- var f = o.as, d = c(f, o.crossOrigin), l = typeof o.integrity == "string" ? o.integrity : void 0, h = typeof o.fetchPriority == "string" ? o.fetchPriority : void 0;
3100
- f === "style" ? n.d.S(
3101
- s,
3102
- typeof o.precedence == "string" ? o.precedence : void 0,
3103
- {
3104
- crossOrigin: d,
3105
- integrity: l,
3106
- fetchPriority: h
3107
- }
3108
- ) : f === "script" && n.d.X(s, {
3109
- crossOrigin: d,
3110
- integrity: l,
3111
- fetchPriority: h,
3112
- nonce: typeof o.nonce == "string" ? o.nonce : void 0
3113
- });
3114
- }
3115
- }, z.preinitModule = function(s, o) {
3116
- if (typeof s == "string")
3117
- if (typeof o == "object" && o !== null) {
3118
- if (o.as == null || o.as === "script") {
3119
- var f = c(
3120
- o.as,
3121
- o.crossOrigin
3122
- );
3123
- n.d.M(s, {
3124
- crossOrigin: f,
3125
- integrity: typeof o.integrity == "string" ? o.integrity : void 0,
3126
- nonce: typeof o.nonce == "string" ? o.nonce : void 0
3127
- });
3128
- }
3129
- } else o == null && n.d.M(s);
3130
- }, z.preload = function(s, o) {
3131
- if (typeof s == "string" && typeof o == "object" && o !== null && typeof o.as == "string") {
3132
- var f = o.as, d = c(f, o.crossOrigin);
3133
- n.d.L(s, f, {
3134
- crossOrigin: d,
3135
- integrity: typeof o.integrity == "string" ? o.integrity : void 0,
3136
- nonce: typeof o.nonce == "string" ? o.nonce : void 0,
3137
- type: typeof o.type == "string" ? o.type : void 0,
3138
- fetchPriority: typeof o.fetchPriority == "string" ? o.fetchPriority : void 0,
3139
- referrerPolicy: typeof o.referrerPolicy == "string" ? o.referrerPolicy : void 0,
3140
- imageSrcSet: typeof o.imageSrcSet == "string" ? o.imageSrcSet : void 0,
3141
- imageSizes: typeof o.imageSizes == "string" ? o.imageSizes : void 0,
3142
- media: typeof o.media == "string" ? o.media : void 0
3143
- });
3144
- }
3145
- }, z.preloadModule = function(s, o) {
3146
- if (typeof s == "string")
3147
- if (o) {
3148
- var f = c(o.as, o.crossOrigin);
3149
- n.d.m(s, {
3150
- as: typeof o.as == "string" && o.as !== "script" ? o.as : void 0,
3151
- crossOrigin: f,
3152
- integrity: typeof o.integrity == "string" ? o.integrity : void 0
3153
- });
3154
- } else n.d.m(s);
3155
- }, z.requestFormReset = function(s) {
3156
- n.d.r(s);
3157
- }, z.unstable_batchedUpdates = function(s, o) {
3158
- return s(o);
3159
- }, z.useFormState = function(s, o, f) {
3160
- return u.H.useFormState(s, o, f);
3161
- }, z.useFormStatus = function() {
3162
- return u.H.useHostTransitionStatus();
3163
- }, z.version = "19.1.0", z;
3164
- }
3165
- var _ = {};
3166
- /**
3167
- * @license React
3168
- * react-dom.development.js
3169
- *
3170
- * Copyright (c) Meta Platforms, Inc. and affiliates.
3171
- *
3172
- * This source code is licensed under the MIT license found in the
3173
- * LICENSE file in the root directory of this source tree.
3174
- */
3175
- var xt;
3176
- function ki() {
3177
- return xt || (xt = 1, process.env.NODE_ENV !== "production" && function() {
3178
- function e() {
3179
- }
3180
- function t(d) {
3181
- return "" + d;
3182
- }
3183
- function r(d, l, h) {
3184
- var p = 3 < arguments.length && arguments[3] !== void 0 ? arguments[3] : null;
3185
- try {
3186
- t(p);
3187
- var g = !1;
3188
- } catch {
3189
- g = !0;
3190
- }
3191
- return g && (console.error(
3192
- "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
3193
- typeof Symbol == "function" && Symbol.toStringTag && p[Symbol.toStringTag] || p.constructor.name || "Object"
3194
- ), t(p)), {
3195
- $$typeof: o,
3196
- key: p == null ? null : "" + p,
3197
- children: d,
3198
- containerInfo: l,
3199
- implementation: h
3200
- };
3201
- }
3202
- function n(d, l) {
3203
- if (d === "font") return "";
3204
- if (typeof l == "string")
3205
- return l === "use-credentials" ? l : "";
3206
- }
3207
- function i(d) {
3208
- return d === null ? "`null`" : d === void 0 ? "`undefined`" : d === "" ? "an empty string" : 'something with type "' + typeof d + '"';
3209
- }
3210
- function a(d) {
3211
- return d === null ? "`null`" : d === void 0 ? "`undefined`" : d === "" ? "an empty string" : typeof d == "string" ? JSON.stringify(d) : typeof d == "number" ? "`" + d + "`" : 'something with type "' + typeof d + '"';
3212
- }
3213
- function u() {
3214
- var d = f.H;
3215
- return d === null && console.error(
3216
- `Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
3217
- 1. You might have mismatching versions of React and the renderer (such as React DOM)
3218
- 2. You might be breaking the Rules of Hooks
3219
- 3. You might have more than one copy of React in the same app
3220
- See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`
3221
- ), d;
3222
- }
3223
- typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
3224
- var c = Nt, s = {
3225
- d: {
3226
- f: e,
3227
- r: function() {
3228
- throw Error(
3229
- "Invalid form element. requestFormReset must be passed a form that was rendered by React."
3230
- );
3231
- },
3232
- D: e,
3233
- C: e,
3234
- L: e,
3235
- m: e,
3236
- X: e,
3237
- S: e,
3238
- M: e
3239
- },
3240
- p: 0,
3241
- findDOMNode: null
3242
- }, o = Symbol.for("react.portal"), f = c.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
3243
- typeof Map == "function" && Map.prototype != null && typeof Map.prototype.forEach == "function" && typeof Set == "function" && Set.prototype != null && typeof Set.prototype.clear == "function" && typeof Set.prototype.forEach == "function" || console.error(
3244
- "React depends on Map and Set built-in types. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"
3245
- ), _.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = s, _.createPortal = function(d, l) {
3246
- var h = 2 < arguments.length && arguments[2] !== void 0 ? arguments[2] : null;
3247
- if (!l || l.nodeType !== 1 && l.nodeType !== 9 && l.nodeType !== 11)
3248
- throw Error("Target container is not a DOM element.");
3249
- return r(d, l, null, h);
3250
- }, _.flushSync = function(d) {
3251
- var l = f.T, h = s.p;
3252
- try {
3253
- if (f.T = null, s.p = 2, d)
3254
- return d();
3255
- } finally {
3256
- f.T = l, s.p = h, s.d.f() && console.error(
3257
- "flushSync was called from inside a lifecycle method. React cannot flush when React is already rendering. Consider moving this call to a scheduler task or micro task."
3258
- );
3259
- }
3260
- }, _.preconnect = function(d, l) {
3261
- typeof d == "string" && d ? l != null && typeof l != "object" ? console.error(
3262
- "ReactDOM.preconnect(): Expected the `options` argument (second) to be an object but encountered %s instead. The only supported option at this time is `crossOrigin` which accepts a string.",
3263
- a(l)
3264
- ) : l != null && typeof l.crossOrigin != "string" && console.error(
3265
- "ReactDOM.preconnect(): Expected the `crossOrigin` option (second argument) to be a string but encountered %s instead. Try removing this option or passing a string value instead.",
3266
- i(l.crossOrigin)
3267
- ) : console.error(
3268
- "ReactDOM.preconnect(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",
3269
- i(d)
3270
- ), typeof d == "string" && (l ? (l = l.crossOrigin, l = typeof l == "string" ? l === "use-credentials" ? l : "" : void 0) : l = null, s.d.C(d, l));
3271
- }, _.prefetchDNS = function(d) {
3272
- if (typeof d != "string" || !d)
3273
- console.error(
3274
- "ReactDOM.prefetchDNS(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",
3275
- i(d)
3276
- );
3277
- else if (1 < arguments.length) {
3278
- var l = arguments[1];
3279
- typeof l == "object" && l.hasOwnProperty("crossOrigin") ? console.error(
3280
- "ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. It looks like the you are attempting to set a crossOrigin property for this DNS lookup hint. Browsers do not perform DNS queries using CORS and setting this attribute on the resource hint has no effect. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.",
3281
- a(l)
3282
- ) : console.error(
3283
- "ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.",
3284
- a(l)
3285
- );
3286
- }
3287
- typeof d == "string" && s.d.D(d);
3288
- }, _.preinit = function(d, l) {
3289
- if (typeof d == "string" && d ? l == null || typeof l != "object" ? console.error(
3290
- "ReactDOM.preinit(): Expected the `options` argument (second) to be an object with an `as` property describing the type of resource to be preinitialized but encountered %s instead.",
3291
- a(l)
3292
- ) : l.as !== "style" && l.as !== "script" && console.error(
3293
- 'ReactDOM.preinit(): Expected the `as` property in the `options` argument (second) to contain a valid value describing the type of resource to be preinitialized but encountered %s instead. Valid values for `as` are "style" and "script".',
3294
- a(l.as)
3295
- ) : console.error(
3296
- "ReactDOM.preinit(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",
3297
- i(d)
3298
- ), typeof d == "string" && l && typeof l.as == "string") {
3299
- var h = l.as, p = n(h, l.crossOrigin), g = typeof l.integrity == "string" ? l.integrity : void 0, y = typeof l.fetchPriority == "string" ? l.fetchPriority : void 0;
3300
- h === "style" ? s.d.S(
3301
- d,
3302
- typeof l.precedence == "string" ? l.precedence : void 0,
3303
- {
3304
- crossOrigin: p,
3305
- integrity: g,
3306
- fetchPriority: y
3307
- }
3308
- ) : h === "script" && s.d.X(d, {
3309
- crossOrigin: p,
3310
- integrity: g,
3311
- fetchPriority: y,
3312
- nonce: typeof l.nonce == "string" ? l.nonce : void 0
3313
- });
3314
- }
3315
- }, _.preinitModule = function(d, l) {
3316
- var h = "";
3317
- if (typeof d == "string" && d || (h += " The `href` argument encountered was " + i(d) + "."), l !== void 0 && typeof l != "object" ? h += " The `options` argument encountered was " + i(l) + "." : l && "as" in l && l.as !== "script" && (h += " The `as` option encountered was " + a(l.as) + "."), h)
3318
- console.error(
3319
- "ReactDOM.preinitModule(): Expected up to two arguments, a non-empty `href` string and, optionally, an `options` object with a valid `as` property.%s",
3320
- h
3321
- );
3322
- else
3323
- switch (h = l && typeof l.as == "string" ? l.as : "script", h) {
3324
- case "script":
3325
- break;
3326
- default:
3327
- h = a(h), console.error(
3328
- 'ReactDOM.preinitModule(): Currently the only supported "as" type for this function is "script" but received "%s" instead. This warning was generated for `href` "%s". In the future other module types will be supported, aligning with the import-attributes proposal. Learn more here: (https://github.com/tc39/proposal-import-attributes)',
3329
- h,
3330
- d
3331
- );
3332
- }
3333
- typeof d == "string" && (typeof l == "object" && l !== null ? (l.as == null || l.as === "script") && (h = n(
3334
- l.as,
3335
- l.crossOrigin
3336
- ), s.d.M(d, {
3337
- crossOrigin: h,
3338
- integrity: typeof l.integrity == "string" ? l.integrity : void 0,
3339
- nonce: typeof l.nonce == "string" ? l.nonce : void 0
3340
- })) : l == null && s.d.M(d));
3341
- }, _.preload = function(d, l) {
3342
- var h = "";
3343
- if (typeof d == "string" && d || (h += " The `href` argument encountered was " + i(d) + "."), l == null || typeof l != "object" ? h += " The `options` argument encountered was " + i(l) + "." : typeof l.as == "string" && l.as || (h += " The `as` option encountered was " + i(l.as) + "."), h && console.error(
3344
- 'ReactDOM.preload(): Expected two arguments, a non-empty `href` string and an `options` object with an `as` property valid for a `<link rel="preload" as="..." />` tag.%s',
3345
- h
3346
- ), typeof d == "string" && typeof l == "object" && l !== null && typeof l.as == "string") {
3347
- h = l.as;
3348
- var p = n(
3349
- h,
3350
- l.crossOrigin
3351
- );
3352
- s.d.L(d, h, {
3353
- crossOrigin: p,
3354
- integrity: typeof l.integrity == "string" ? l.integrity : void 0,
3355
- nonce: typeof l.nonce == "string" ? l.nonce : void 0,
3356
- type: typeof l.type == "string" ? l.type : void 0,
3357
- fetchPriority: typeof l.fetchPriority == "string" ? l.fetchPriority : void 0,
3358
- referrerPolicy: typeof l.referrerPolicy == "string" ? l.referrerPolicy : void 0,
3359
- imageSrcSet: typeof l.imageSrcSet == "string" ? l.imageSrcSet : void 0,
3360
- imageSizes: typeof l.imageSizes == "string" ? l.imageSizes : void 0,
3361
- media: typeof l.media == "string" ? l.media : void 0
3362
- });
3363
- }
3364
- }, _.preloadModule = function(d, l) {
3365
- var h = "";
3366
- typeof d == "string" && d || (h += " The `href` argument encountered was " + i(d) + "."), l !== void 0 && typeof l != "object" ? h += " The `options` argument encountered was " + i(l) + "." : l && "as" in l && typeof l.as != "string" && (h += " The `as` option encountered was " + i(l.as) + "."), h && console.error(
3367
- 'ReactDOM.preloadModule(): Expected two arguments, a non-empty `href` string and, optionally, an `options` object with an `as` property valid for a `<link rel="modulepreload" as="..." />` tag.%s',
3368
- h
3369
- ), typeof d == "string" && (l ? (h = n(
3370
- l.as,
3371
- l.crossOrigin
3372
- ), s.d.m(d, {
3373
- as: typeof l.as == "string" && l.as !== "script" ? l.as : void 0,
3374
- crossOrigin: h,
3375
- integrity: typeof l.integrity == "string" ? l.integrity : void 0
3376
- })) : s.d.m(d));
3377
- }, _.requestFormReset = function(d) {
3378
- s.d.r(d);
3379
- }, _.unstable_batchedUpdates = function(d, l) {
3380
- return d(l);
3381
- }, _.useFormState = function(d, l, h) {
3382
- return u().useFormState(d, l, h);
3383
- }, _.useFormStatus = function() {
3384
- return u().useHostTransitionStatus();
3385
- }, _.version = "19.1.0", typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
3386
- }()), _;
3387
- }
3388
- var St;
3389
- function Ni() {
3390
- if (St) return ve.exports;
3391
- St = 1;
3392
- function e() {
3393
- if (!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ > "u" || typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE != "function")) {
3394
- if (process.env.NODE_ENV !== "production")
3395
- throw new Error("^_^");
3396
- try {
3397
- __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e);
3398
- } catch (t) {
3399
- console.error(t);
3400
- }
3401
- }
3402
- }
3403
- return process.env.NODE_ENV === "production" ? (e(), ve.exports = Ri()) : ve.exports = ki(), ve.exports;
3404
- }
3405
- var Ai = Ni(), R = function() {
3406
- return R = Object.assign || function(e) {
3407
- for (var t, r = 1, n = arguments.length; r < n; r++) {
3408
- t = arguments[r];
3409
- for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]);
3410
- }
3411
- return e;
3412
- }, R.apply(this, arguments);
3413
- }, Ot = {
3414
- width: "100%",
3415
- height: "10px",
3416
- top: "0px",
3417
- left: "0px",
3418
- cursor: "row-resize"
3419
- }, Dt = {
3420
- width: "10px",
3421
- height: "100%",
3422
- top: "0px",
3423
- left: "0px",
3424
- cursor: "col-resize"
3425
- }, be = {
3426
- width: "20px",
3427
- height: "20px",
3428
- position: "absolute",
3429
- zIndex: 1
3430
- }, zi = {
3431
- top: R(R({}, Ot), { top: "-5px" }),
3432
- right: R(R({}, Dt), { left: void 0, right: "-5px" }),
3433
- bottom: R(R({}, Ot), { top: void 0, bottom: "-5px" }),
3434
- left: R(R({}, Dt), { left: "-5px" }),
3435
- topRight: R(R({}, be), { right: "-10px", top: "-10px", cursor: "ne-resize" }),
3436
- bottomRight: R(R({}, be), { right: "-10px", bottom: "-10px", cursor: "se-resize" }),
3437
- bottomLeft: R(R({}, be), { left: "-10px", bottom: "-10px", cursor: "sw-resize" }),
3438
- topLeft: R(R({}, be), { left: "-10px", top: "-10px", cursor: "nw-resize" })
3439
- }, _i = Jt(function(e) {
3440
- var t = e.onResizeStart, r = e.direction, n = e.children, i = e.replaceStyles, a = e.className, u = Ve(function(o) {
3441
- t(o, r);
3442
- }, [t, r]), c = Ve(function(o) {
3443
- t(o, r);
3444
- }, [t, r]), s = Zt(function() {
3445
- return R(R({ position: "absolute", userSelect: "none" }, zi[r]), i ?? {});
3446
- }, [i, r]);
3447
- return m("div", { className: a || void 0, style: s, onMouseDown: u, onTouchStart: c, children: n });
3448
- }), Wi = /* @__PURE__ */ function() {
3449
- var e = function(t, r) {
3450
- return e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(n, i) {
3451
- n.__proto__ = i;
3452
- } || function(n, i) {
3453
- for (var a in i) Object.prototype.hasOwnProperty.call(i, a) && (n[a] = i[a]);
3454
- }, e(t, r);
3455
- };
3456
- return function(t, r) {
3457
- if (typeof r != "function" && r !== null)
3458
- throw new TypeError("Class extends value " + String(r) + " is not a constructor or null");
3459
- e(t, r);
3460
- function n() {
3461
- this.constructor = t;
3462
- }
3463
- t.prototype = r === null ? Object.create(r) : (n.prototype = r.prototype, new n());
3464
- };
3465
- }(), j = function() {
3466
- return j = Object.assign || function(e) {
3467
- for (var t, r = 1, n = arguments.length; r < n; r++) {
3468
- t = arguments[r];
3469
- for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]);
3470
- }
3471
- return e;
3472
- }, j.apply(this, arguments);
3473
- }, Ci = {
3474
- width: "auto",
3475
- height: "auto"
3476
- }, we = function(e, t, r) {
3477
- return Math.max(Math.min(e, r), t);
3478
- }, Tt = function(e, t, r) {
3479
- var n = Math.round(e / t);
3480
- return n * t + r * (n - 1);
3481
- }, ee = function(e, t) {
3482
- return new RegExp(e, "i").test(t);
3483
- }, xe = function(e) {
3484
- return !!(e.touches && e.touches.length);
3485
- }, Li = function(e) {
3486
- return !!((e.clientX || e.clientX === 0) && (e.clientY || e.clientY === 0));
3487
- }, Mt = function(e, t, r) {
3488
- r === void 0 && (r = 0);
3489
- var n = t.reduce(function(a, u, c) {
3490
- return Math.abs(u - e) < Math.abs(t[a] - e) ? c : a;
3491
- }, 0), i = Math.abs(t[n] - e);
3492
- return r === 0 || i < r ? t[n] : e;
3493
- }, ze = function(e) {
3494
- return e = e.toString(), e === "auto" || e.endsWith("px") || e.endsWith("%") || e.endsWith("vh") || e.endsWith("vw") || e.endsWith("vmax") || e.endsWith("vmin") ? e : "".concat(e, "px");
3495
- }, Se = function(e, t, r, n) {
3496
- if (e && typeof e == "string") {
3497
- if (e.endsWith("px"))
3498
- return Number(e.replace("px", ""));
3499
- if (e.endsWith("%")) {
3500
- var i = Number(e.replace("%", "")) / 100;
3501
- return t * i;
3502
- }
3503
- if (e.endsWith("vw")) {
3504
- var i = Number(e.replace("vw", "")) / 100;
3505
- return r * i;
3506
- }
3507
- if (e.endsWith("vh")) {
3508
- var i = Number(e.replace("vh", "")) / 100;
3509
- return n * i;
3510
- }
3511
- }
3512
- return e;
3513
- }, Ii = function(e, t, r, n, i, a, u) {
3514
- return n = Se(n, e.width, t, r), i = Se(i, e.height, t, r), a = Se(a, e.width, t, r), u = Se(u, e.height, t, r), {
3515
- maxWidth: typeof n > "u" ? void 0 : Number(n),
3516
- maxHeight: typeof i > "u" ? void 0 : Number(i),
3517
- minWidth: typeof a > "u" ? void 0 : Number(a),
3518
- minHeight: typeof u > "u" ? void 0 : Number(u)
3519
- };
3520
- }, Hi = function(e) {
3521
- return Array.isArray(e) ? e : [e, e];
3522
- }, ji = [
3523
- "as",
3524
- "ref",
3525
- "style",
3526
- "className",
3527
- "grid",
3528
- "gridGap",
3529
- "snap",
3530
- "bounds",
3531
- "boundsByDirection",
3532
- "size",
3533
- "defaultSize",
3534
- "minWidth",
3535
- "minHeight",
3536
- "maxWidth",
3537
- "maxHeight",
3538
- "lockAspectRatio",
3539
- "lockAspectRatioExtraWidth",
3540
- "lockAspectRatioExtraHeight",
3541
- "enable",
3542
- "handleStyles",
3543
- "handleClasses",
3544
- "handleWrapperStyle",
3545
- "handleWrapperClass",
3546
- "children",
3547
- "onResizeStart",
3548
- "onResize",
3549
- "onResizeStop",
3550
- "handleComponent",
3551
- "scale",
3552
- "resizeRatio",
3553
- "snapGap"
3554
- ], Et = "__resizable_base__", Bi = (
3555
- /** @class */
3556
- function(e) {
3557
- Wi(t, e);
3558
- function t(r) {
3559
- var n, i, a, u, c = e.call(this, r) || this;
3560
- return c.ratio = 1, c.resizable = null, c.parentLeft = 0, c.parentTop = 0, c.resizableLeft = 0, c.resizableRight = 0, c.resizableTop = 0, c.resizableBottom = 0, c.targetLeft = 0, c.targetTop = 0, c.delta = {
3561
- width: 0,
3562
- height: 0
3563
- }, c.appendBase = function() {
3564
- if (!c.resizable || !c.window)
3565
- return null;
3566
- var s = c.parentNode;
3567
- if (!s)
3568
- return null;
3569
- var o = c.window.document.createElement("div");
3570
- return o.style.width = "100%", o.style.height = "100%", o.style.position = "absolute", o.style.transform = "scale(0, 0)", o.style.left = "0", o.style.flex = "0 0 100%", o.classList ? o.classList.add(Et) : o.className += Et, s.appendChild(o), o;
3571
- }, c.removeBase = function(s) {
3572
- var o = c.parentNode;
3573
- o && o.removeChild(s);
3574
- }, c.state = {
3575
- isResizing: !1,
3576
- width: (i = (n = c.propsSize) === null || n === void 0 ? void 0 : n.width) !== null && i !== void 0 ? i : "auto",
3577
- height: (u = (a = c.propsSize) === null || a === void 0 ? void 0 : a.height) !== null && u !== void 0 ? u : "auto",
3578
- direction: "right",
3579
- original: {
3580
- x: 0,
3581
- y: 0,
3582
- width: 0,
3583
- height: 0
3584
- },
3585
- backgroundStyle: {
3586
- height: "100%",
3587
- width: "100%",
3588
- backgroundColor: "rgba(0,0,0,0)",
3589
- cursor: "auto",
3590
- opacity: 0,
3591
- position: "fixed",
3592
- zIndex: 9999,
3593
- top: "0",
3594
- left: "0",
3595
- bottom: "0",
3596
- right: "0"
3597
- },
3598
- flexBasis: void 0
3599
- }, c.onResizeStart = c.onResizeStart.bind(c), c.onMouseMove = c.onMouseMove.bind(c), c.onMouseUp = c.onMouseUp.bind(c), c;
3600
- }
3601
- return Object.defineProperty(t.prototype, "parentNode", {
3602
- get: function() {
3603
- return this.resizable ? this.resizable.parentNode : null;
3604
- },
3605
- enumerable: !1,
3606
- configurable: !0
3607
- }), Object.defineProperty(t.prototype, "window", {
3608
- get: function() {
3609
- return !this.resizable || !this.resizable.ownerDocument ? null : this.resizable.ownerDocument.defaultView;
3610
- },
3611
- enumerable: !1,
3612
- configurable: !0
3613
- }), Object.defineProperty(t.prototype, "propsSize", {
3614
- get: function() {
3615
- return this.props.size || this.props.defaultSize || Ci;
3616
- },
3617
- enumerable: !1,
3618
- configurable: !0
3619
- }), Object.defineProperty(t.prototype, "size", {
3620
- get: function() {
3621
- var r = 0, n = 0;
3622
- if (this.resizable && this.window) {
3623
- var i = this.resizable.offsetWidth, a = this.resizable.offsetHeight, u = this.resizable.style.position;
3624
- u !== "relative" && (this.resizable.style.position = "relative"), r = this.resizable.style.width !== "auto" ? this.resizable.offsetWidth : i, n = this.resizable.style.height !== "auto" ? this.resizable.offsetHeight : a, this.resizable.style.position = u;
3625
- }
3626
- return { width: r, height: n };
3627
- },
3628
- enumerable: !1,
3629
- configurable: !0
3630
- }), Object.defineProperty(t.prototype, "sizeStyle", {
3631
- get: function() {
3632
- var r = this, n = this.props.size, i = function(c) {
3633
- var s;
3634
- if (typeof r.state[c] > "u" || r.state[c] === "auto")
3635
- return "auto";
3636
- if (r.propsSize && r.propsSize[c] && (!((s = r.propsSize[c]) === null || s === void 0) && s.toString().endsWith("%"))) {
3637
- if (r.state[c].toString().endsWith("%"))
3638
- return r.state[c].toString();
3639
- var o = r.getParentSize(), f = Number(r.state[c].toString().replace("px", "")), d = f / o[c] * 100;
3640
- return "".concat(d, "%");
3641
- }
3642
- return ze(r.state[c]);
3643
- }, a = n && typeof n.width < "u" && !this.state.isResizing ? ze(n.width) : i("width"), u = n && typeof n.height < "u" && !this.state.isResizing ? ze(n.height) : i("height");
3644
- return { width: a, height: u };
3645
- },
3646
- enumerable: !1,
3647
- configurable: !0
3648
- }), t.prototype.getParentSize = function() {
3649
- if (!this.parentNode)
3650
- return this.window ? { width: this.window.innerWidth, height: this.window.innerHeight } : { width: 0, height: 0 };
3651
- var r = this.appendBase();
3652
- if (!r)
3653
- return { width: 0, height: 0 };
3654
- var n = !1, i = this.parentNode.style.flexWrap;
3655
- i !== "wrap" && (n = !0, this.parentNode.style.flexWrap = "wrap"), r.style.position = "relative", r.style.minWidth = "100%", r.style.minHeight = "100%";
3656
- var a = {
3657
- width: r.offsetWidth,
3658
- height: r.offsetHeight
3659
- };
3660
- return n && (this.parentNode.style.flexWrap = i), this.removeBase(r), a;
3661
- }, t.prototype.bindEvents = function() {
3662
- this.window && (this.window.addEventListener("mouseup", this.onMouseUp), this.window.addEventListener("mousemove", this.onMouseMove), this.window.addEventListener("mouseleave", this.onMouseUp), this.window.addEventListener("touchmove", this.onMouseMove, {
3663
- capture: !0,
3664
- passive: !1
3665
- }), this.window.addEventListener("touchend", this.onMouseUp));
3666
- }, t.prototype.unbindEvents = function() {
3667
- this.window && (this.window.removeEventListener("mouseup", this.onMouseUp), this.window.removeEventListener("mousemove", this.onMouseMove), this.window.removeEventListener("mouseleave", this.onMouseUp), this.window.removeEventListener("touchmove", this.onMouseMove, !0), this.window.removeEventListener("touchend", this.onMouseUp));
3668
- }, t.prototype.componentDidMount = function() {
3669
- if (!(!this.resizable || !this.window)) {
3670
- var r = this.window.getComputedStyle(this.resizable);
3671
- this.setState({
3672
- width: this.state.width || this.size.width,
3673
- height: this.state.height || this.size.height,
3674
- flexBasis: r.flexBasis !== "auto" ? r.flexBasis : void 0
3675
- });
3676
- }
3677
- }, t.prototype.componentWillUnmount = function() {
3678
- this.window && this.unbindEvents();
3679
- }, t.prototype.createSizeForCssProperty = function(r, n) {
3680
- var i = this.propsSize && this.propsSize[n];
3681
- return this.state[n] === "auto" && this.state.original[n] === r && (typeof i > "u" || i === "auto") ? "auto" : r;
3682
- }, t.prototype.calculateNewMaxFromBoundary = function(r, n) {
3683
- var i = this.props.boundsByDirection, a = this.state.direction, u = i && ee("left", a), c = i && ee("top", a), s, o;
3684
- if (this.props.bounds === "parent") {
3685
- var f = this.parentNode;
3686
- f && (s = u ? this.resizableRight - this.parentLeft : f.offsetWidth + (this.parentLeft - this.resizableLeft), o = c ? this.resizableBottom - this.parentTop : f.offsetHeight + (this.parentTop - this.resizableTop));
3687
- } else this.props.bounds === "window" ? this.window && (s = u ? this.resizableRight : this.window.innerWidth - this.resizableLeft, o = c ? this.resizableBottom : this.window.innerHeight - this.resizableTop) : this.props.bounds && (s = u ? this.resizableRight - this.targetLeft : this.props.bounds.offsetWidth + (this.targetLeft - this.resizableLeft), o = c ? this.resizableBottom - this.targetTop : this.props.bounds.offsetHeight + (this.targetTop - this.resizableTop));
3688
- return s && Number.isFinite(s) && (r = r && r < s ? r : s), o && Number.isFinite(o) && (n = n && n < o ? n : o), { maxWidth: r, maxHeight: n };
3689
- }, t.prototype.calculateNewSizeFromDirection = function(r, n) {
3690
- var i = this.props.scale || 1, a = Hi(this.props.resizeRatio || 1), u = a[0], c = a[1], s = this.state, o = s.direction, f = s.original, d = this.props, l = d.lockAspectRatio, h = d.lockAspectRatioExtraHeight, p = d.lockAspectRatioExtraWidth, g = f.width, y = f.height, b = h || 0, w = p || 0;
3691
- return ee("right", o) && (g = f.width + (r - f.x) * u / i, l && (y = (g - w) / this.ratio + b)), ee("left", o) && (g = f.width - (r - f.x) * u / i, l && (y = (g - w) / this.ratio + b)), ee("bottom", o) && (y = f.height + (n - f.y) * c / i, l && (g = (y - b) * this.ratio + w)), ee("top", o) && (y = f.height - (n - f.y) * c / i, l && (g = (y - b) * this.ratio + w)), { newWidth: g, newHeight: y };
3692
- }, t.prototype.calculateNewSizeFromAspectRatio = function(r, n, i, a) {
3693
- var u = this.props, c = u.lockAspectRatio, s = u.lockAspectRatioExtraHeight, o = u.lockAspectRatioExtraWidth, f = typeof a.width > "u" ? 10 : a.width, d = typeof i.width > "u" || i.width < 0 ? r : i.width, l = typeof a.height > "u" ? 10 : a.height, h = typeof i.height > "u" || i.height < 0 ? n : i.height, p = s || 0, g = o || 0;
3694
- if (c) {
3695
- var y = (l - p) * this.ratio + g, b = (h - p) * this.ratio + g, w = (f - g) / this.ratio + p, S = (d - g) / this.ratio + p, x = Math.max(f, y), M = Math.min(d, b), O = Math.max(l, w), C = Math.min(h, S);
3696
- r = we(r, x, M), n = we(n, O, C);
3697
- } else
3698
- r = we(r, f, d), n = we(n, l, h);
3699
- return { newWidth: r, newHeight: n };
3700
- }, t.prototype.setBoundingClientRect = function() {
3701
- var r = 1 / (this.props.scale || 1);
3702
- if (this.props.bounds === "parent") {
3703
- var n = this.parentNode;
3704
- if (n) {
3705
- var i = n.getBoundingClientRect();
3706
- this.parentLeft = i.left * r, this.parentTop = i.top * r;
3707
- }
3708
- }
3709
- if (this.props.bounds && typeof this.props.bounds != "string") {
3710
- var a = this.props.bounds.getBoundingClientRect();
3711
- this.targetLeft = a.left * r, this.targetTop = a.top * r;
3712
- }
3713
- if (this.resizable) {
3714
- var u = this.resizable.getBoundingClientRect(), c = u.left, s = u.top, o = u.right, f = u.bottom;
3715
- this.resizableLeft = c * r, this.resizableRight = o * r, this.resizableTop = s * r, this.resizableBottom = f * r;
3716
- }
3717
- }, t.prototype.onResizeStart = function(r, n) {
3718
- if (!(!this.resizable || !this.window)) {
3719
- var i = 0, a = 0;
3720
- if (r.nativeEvent && Li(r.nativeEvent) ? (i = r.nativeEvent.clientX, a = r.nativeEvent.clientY) : r.nativeEvent && xe(r.nativeEvent) && (i = r.nativeEvent.touches[0].clientX, a = r.nativeEvent.touches[0].clientY), this.props.onResizeStart && this.resizable) {
3721
- var u = this.props.onResizeStart(r, n, this.resizable);
3722
- if (u === !1)
3723
- return;
3724
- }
3725
- this.props.size && (typeof this.props.size.height < "u" && this.props.size.height !== this.state.height && this.setState({ height: this.props.size.height }), typeof this.props.size.width < "u" && this.props.size.width !== this.state.width && this.setState({ width: this.props.size.width })), this.ratio = typeof this.props.lockAspectRatio == "number" ? this.props.lockAspectRatio : this.size.width / this.size.height;
3726
- var c, s = this.window.getComputedStyle(this.resizable);
3727
- if (s.flexBasis !== "auto") {
3728
- var o = this.parentNode;
3729
- if (o) {
3730
- var f = this.window.getComputedStyle(o).flexDirection;
3731
- this.flexDir = f.startsWith("row") ? "row" : "column", c = s.flexBasis;
3732
- }
3733
- }
3734
- this.setBoundingClientRect(), this.bindEvents();
3735
- var d = {
3736
- original: {
3737
- x: i,
3738
- y: a,
3739
- width: this.size.width,
3740
- height: this.size.height
3741
- },
3742
- isResizing: !0,
3743
- backgroundStyle: j(j({}, this.state.backgroundStyle), { cursor: this.window.getComputedStyle(r.target).cursor || "auto" }),
3744
- direction: n,
3745
- flexBasis: c
3746
- };
3747
- this.setState(d);
3748
- }
3749
- }, t.prototype.onMouseMove = function(r) {
3750
- var n = this;
3751
- if (!(!this.state.isResizing || !this.resizable || !this.window)) {
3752
- if (this.window.TouchEvent && xe(r))
3753
- try {
3754
- r.preventDefault(), r.stopPropagation();
3755
- } catch {
3756
- }
3757
- var i = this.props, a = i.maxWidth, u = i.maxHeight, c = i.minWidth, s = i.minHeight, o = xe(r) ? r.touches[0].clientX : r.clientX, f = xe(r) ? r.touches[0].clientY : r.clientY, d = this.state, l = d.direction, h = d.original, p = d.width, g = d.height, y = this.getParentSize(), b = Ii(y, this.window.innerWidth, this.window.innerHeight, a, u, c, s);
3758
- a = b.maxWidth, u = b.maxHeight, c = b.minWidth, s = b.minHeight;
3759
- var w = this.calculateNewSizeFromDirection(o, f), S = w.newHeight, x = w.newWidth, M = this.calculateNewMaxFromBoundary(a, u);
3760
- this.props.snap && this.props.snap.x && (x = Mt(x, this.props.snap.x, this.props.snapGap)), this.props.snap && this.props.snap.y && (S = Mt(S, this.props.snap.y, this.props.snapGap));
3761
- var O = this.calculateNewSizeFromAspectRatio(x, S, { width: M.maxWidth, height: M.maxHeight }, { width: c, height: s });
3762
- if (x = O.newWidth, S = O.newHeight, this.props.grid) {
3763
- var C = Tt(x, this.props.grid[0], this.props.gridGap ? this.props.gridGap[0] : 0), E = Tt(S, this.props.grid[1], this.props.gridGap ? this.props.gridGap[1] : 0), N = this.props.snapGap || 0, L = N === 0 || Math.abs(C - x) <= N ? C : x, v = N === 0 || Math.abs(E - S) <= N ? E : S;
3764
- x = L, S = v;
3765
- }
3766
- var D = {
3767
- width: x - h.width,
3768
- height: S - h.height
3769
- };
3770
- if (this.delta = D, p && typeof p == "string") {
3771
- if (p.endsWith("%")) {
3772
- var P = x / y.width * 100;
3773
- x = "".concat(P, "%");
3774
- } else if (p.endsWith("vw")) {
3775
- var I = x / this.window.innerWidth * 100;
3776
- x = "".concat(I, "vw");
3777
- } else if (p.endsWith("vh")) {
3778
- var Y = x / this.window.innerHeight * 100;
3779
- x = "".concat(Y, "vh");
3780
- }
3781
- }
3782
- if (g && typeof g == "string") {
3783
- if (g.endsWith("%")) {
3784
- var P = S / y.height * 100;
3785
- S = "".concat(P, "%");
3786
- } else if (g.endsWith("vw")) {
3787
- var I = S / this.window.innerWidth * 100;
3788
- S = "".concat(I, "vw");
3789
- } else if (g.endsWith("vh")) {
3790
- var Y = S / this.window.innerHeight * 100;
3791
- S = "".concat(Y, "vh");
3792
- }
3793
- }
3794
- var A = {
3795
- width: this.createSizeForCssProperty(x, "width"),
3796
- height: this.createSizeForCssProperty(S, "height")
3797
- };
3798
- this.flexDir === "row" ? A.flexBasis = A.width : this.flexDir === "column" && (A.flexBasis = A.height);
3799
- var G = this.state.width !== A.width, Vt = this.state.height !== A.height, Qt = this.state.flexBasis !== A.flexBasis, Ke = G || Vt || Qt;
3800
- Ke && Ai.flushSync(function() {
3801
- n.setState(A);
3802
- }), this.props.onResize && Ke && this.props.onResize(r, l, this.resizable, D);
3803
- }
3804
- }, t.prototype.onMouseUp = function(r) {
3805
- var n, i, a = this.state, u = a.isResizing, c = a.direction;
3806
- a.original, !(!u || !this.resizable) && (this.props.onResizeStop && this.props.onResizeStop(r, c, this.resizable, this.delta), this.props.size && this.setState({ width: (n = this.props.size.width) !== null && n !== void 0 ? n : "auto", height: (i = this.props.size.height) !== null && i !== void 0 ? i : "auto" }), this.unbindEvents(), this.setState({
3807
- isResizing: !1,
3808
- backgroundStyle: j(j({}, this.state.backgroundStyle), { cursor: "auto" })
3809
- }));
3810
- }, t.prototype.updateSize = function(r) {
3811
- var n, i;
3812
- this.setState({ width: (n = r.width) !== null && n !== void 0 ? n : "auto", height: (i = r.height) !== null && i !== void 0 ? i : "auto" });
3813
- }, t.prototype.renderResizer = function() {
3814
- var r = this, n = this.props, i = n.enable, a = n.handleStyles, u = n.handleClasses, c = n.handleWrapperStyle, s = n.handleWrapperClass, o = n.handleComponent;
3815
- if (!i)
3816
- return null;
3817
- var f = Object.keys(i).map(function(d) {
3818
- return i[d] !== !1 ? m(_i, { direction: d, onResizeStart: r.onResizeStart, replaceStyles: a && a[d], className: u && u[d], children: o && o[d] ? o[d] : null }, d) : null;
3819
- });
3820
- return m("div", { className: s, style: c, children: f });
3821
- }, t.prototype.render = function() {
3822
- var r = this, n = Object.keys(this.props).reduce(function(u, c) {
3823
- return ji.indexOf(c) !== -1 || (u[c] = r.props[c]), u;
3824
- }, {}), i = j(j(j({ position: "relative", userSelect: this.state.isResizing ? "none" : "auto" }, this.props.style), this.sizeStyle), { maxWidth: this.props.maxWidth, maxHeight: this.props.maxHeight, minWidth: this.props.minWidth, minHeight: this.props.minHeight, boxSizing: "border-box", flexShrink: 0 });
3825
- this.state.flexBasis && (i.flexBasis = this.state.flexBasis);
3826
- var a = this.props.as || "div";
3827
- return X(a, j({ style: i, className: this.props.className }, n, {
3828
- // `ref` is after `extendsProps` to ensure this one wins over a version
3829
- // passed in
3830
- ref: function(u) {
3831
- u && (r.resizable = u);
3832
- },
3833
- children: [this.state.isResizing && m("div", { style: this.state.backgroundStyle }), this.props.children, this.renderResizer()]
3834
- }));
3835
- }, t.defaultProps = {
3836
- as: "div",
3837
- onResizeStart: function() {
3838
- },
3839
- onResize: function() {
3840
- },
3841
- onResizeStop: function() {
3842
- },
3843
- enable: {
3844
- top: !0,
3845
- right: !0,
3846
- bottom: !0,
3847
- left: !0,
3848
- topRight: !0,
3849
- bottomRight: !0,
3850
- bottomLeft: !0,
3851
- topLeft: !0
3852
- },
3853
- style: {},
3854
- grid: [1, 1],
3855
- gridGap: [0, 0],
3856
- lockAspectRatio: !1,
3857
- lockAspectRatioExtraWidth: 0,
3858
- lockAspectRatioExtraHeight: 0,
3859
- scale: 1,
3860
- resizeRatio: 1,
3861
- snapGap: 0
3862
- }, t;
3863
- }(er)
3864
- );
3865
- const Yi = {
3866
- start: new Date(2025, 1, 1),
3867
- end: new Date(2025, 5, 1),
3868
- pixelsPerDay: 30,
3869
- pixelsPerLane: 100,
3870
- showMonths: !0,
3871
- showWeeks: !0,
3872
- showDays: !0,
3873
- allowOverlaps: !0,
3874
- focusedDate: null,
3875
- enableItemDragging: !0,
3876
- enableItemResizing: !0
3877
- }, Fi = {
3878
- settings: Yi,
3879
- setSettings: () => {
3880
- }
3881
- }, Kt = tr(Fi), J = () => rr(Kt);
3882
- function $i({
3883
- item: e,
3884
- rectangle: t,
3885
- boundingRectangle: r,
3886
- children: n,
3887
- onDrag: i,
3888
- onDragStart: a,
3889
- onDrop: u,
3890
- onUpdate: c,
3891
- onResizeStart: s
3892
- }) {
3893
- const { settings: o } = J(), f = re(null), d = re(null), [l, h] = Q(t);
3894
- return ne(() => {
3895
- h(t);
3896
- }, [t]), ne(() => (Ie(f.current), Ie(d.current), Kr({
3897
- element: f.current,
3898
- dragHandle: d.current,
3899
- onDragStart: ({ source: p, location: g }) => {
3900
- const y = te(p, g);
3901
- a(y.absolute, y.relative);
3902
- },
3903
- onDrag: () => {
3904
- i();
3905
- },
3906
- onDrop: () => {
3907
- u();
3908
- },
3909
- getInitialData: () => ({ ...e }),
3910
- canDrag: () => o.enableItemDragging
3911
- })), [o.enableItemDragging, e, i, a, u]), /* @__PURE__ */ m(
3912
- "div",
3913
- {
3914
- id: `timelane-item-${e.id}`,
3915
- className: "timelane-item",
3916
- "data-timelane-item-id": e.id,
3917
- ref: f,
3918
- style: {
3919
- width: `${l.width}px`,
3920
- height: `${l.height}px`,
3921
- minWidth: `${l.width}px`,
3922
- minHeight: `${l.height}px`,
3923
- maxWidth: `${l.width}px`,
3924
- maxHeight: `${l.height}px`,
3925
- top: `${l.y}px`,
3926
- left: `${l.x}px`
3927
- },
3928
- onMouseDown: (p) => {
3929
- p.stopPropagation();
3930
- },
3931
- onClick: (p) => {
3932
- p.stopPropagation();
3933
- },
3934
- children: /* @__PURE__ */ m(
3935
- Bi,
3936
- {
3937
- enable: o.enableItemResizing === !0 ? void 0 : o.enableItemResizing,
3938
- handleClasses: {
3939
- left: "timelane-item-resize-handle timelane-item-resize-handle-left",
3940
- right: "timelane-item-resize-handle timelane-item-resize-handle-right"
3941
- },
3942
- size: {
3943
- width: l.width,
3944
- height: l.height
3945
- },
3946
- onResizeStart: () => {
3947
- s();
3948
- },
3949
- onResize: (p, g, y, b) => {
3950
- h((w) => g === "right" ? {
3951
- ...w,
3952
- width: t.width + b.width
3953
- } : g === "left" ? {
3954
- ...w,
3955
- x: t.x - b.width,
3956
- width: t.width + b.width
3957
- } : g === "bottom" ? {
3958
- ...w,
3959
- height: Math.min(
3960
- t.height + b.height,
3961
- r.height - t.y
3962
- )
3963
- } : g === "top" ? {
3964
- ...w,
3965
- y: t.y - b.height,
3966
- height: t.height + b.height
3967
- } : w);
3968
- },
3969
- onResizeStop: (p, g, y, b) => {
3970
- let w = t;
3971
- g === "right" ? w = {
3972
- ...t,
3973
- width: t.width + b.width
3974
- } : g === "left" ? w = {
3975
- ...t,
3976
- x: t.x - b.width,
3977
- width: t.width + b.width
3978
- } : g === "bottom" ? w = {
3979
- ...t,
3980
- height: Math.min(
3981
- t.height + b.height,
3982
- r.height - t.y
3983
- )
3984
- } : g === "top" && (w = {
3985
- ...t,
3986
- y: t.y - b.height,
3987
- height: t.height + b.height
3988
- }), c(w);
3989
- },
3990
- style: { overflow: "hidden" },
3991
- children: /* @__PURE__ */ m("div", { className: "timelane-item-drag-handle", ref: d, children: n })
3992
- }
3993
- )
3994
- }
3995
- );
3996
- }
3997
- function qi({
3998
- lane: e,
3999
- item: t,
4000
- settings: r,
4001
- children: n,
4002
- onDragStart: i,
4003
- onDrag: a,
4004
- onDrop: u,
4005
- onUpdate: c,
4006
- onResizeStart: s
4007
- }) {
4008
- const o = Ue(t, e, r, r), f = Xe(e, r, r);
4009
- return /* @__PURE__ */ m(
4010
- $i,
4011
- {
4012
- item: t,
4013
- rectangle: o,
4014
- boundingRectangle: f,
4015
- onDrag: a,
4016
- onDragStart: i,
4017
- onDrop: u,
4018
- onUpdate: (d) => {
4019
- const l = Gt(
4020
- t,
4021
- e,
4022
- d,
4023
- r,
4024
- r
4025
- );
4026
- c(l);
4027
- },
4028
- onResizeStart: s,
4029
- children: n
4030
- }
4031
- );
4032
- }
4033
- function Xi({ overlap: e }) {
4034
- return /* @__PURE__ */ m(
4035
- "div",
4036
- {
4037
- style: {
4038
- position: "absolute",
4039
- left: `${e.x}px`,
4040
- top: `${e.y}px`,
4041
- width: `${e.width - 1}px`,
4042
- height: `${e.height - 1}px`,
4043
- background: "rgba(255,0,0, 0.3)",
4044
- marginLeft: "1px",
4045
- pointerEvents: "none"
4046
- }
4047
- }
4048
- );
4049
- }
4050
- function Pt(e) {
4051
- return "id" in e && "laneId" in e && "start" in e && "end" in e && "size" in e && "offset" in e;
4052
- }
4053
- function Ui({
4054
- id: e,
4055
- capacity: t = 100,
4056
- items: r = [],
4057
- focused: n = !1,
4058
- onItemUpdate: i = () => {
4059
- },
4060
- onMouseUp: a = () => {
4061
- },
4062
- onClick: u = () => {
4063
- },
4064
- onDoubleClick: c = () => {
4065
- },
4066
- onContextMenu: s = () => {
4067
- },
4068
- renderItem: o = Gi,
4069
- onResizeStart: f = () => {
4070
- }
4071
- }) {
4072
- const d = { id: e, capacity: t }, { settings: l } = J(), h = {
4073
- x: l.pixelsPerDay,
4074
- offsetX: l.pixelsPerDay / 2
4075
- }, p = Xe(d, l, l), [g, y] = Q(null), [b, w] = Q(
4076
- null
4077
- );
4078
- function S(v) {
4079
- const D = v.currentTarget.getBoundingClientRect();
4080
- return He(
4081
- pe(
4082
- l.start,
4083
- (v.clientX - D.left) / l.pixelsPerDay
4084
- ),
4085
- 12
4086
- );
4087
- }
4088
- function x(v) {
4089
- const D = v.currentTarget.getBoundingClientRect();
4090
- return (v.pageY - D.top) / D.height * t;
4091
- }
4092
- function M(v, D, P) {
4093
- if (!Pt(P)) return;
4094
- const I = mi(
4095
- d,
4096
- r,
4097
- P,
4098
- v,
4099
- D,
4100
- l,
4101
- h,
4102
- l,
4103
- l.allowOverlaps
4104
- );
4105
- w(I);
4106
- }
4107
- function O(v, D, P) {
4108
- if (!Pt(P) || b === null) return;
4109
- const I = Gt(
4110
- P,
4111
- d,
4112
- b,
4113
- l,
4114
- l
4115
- );
4116
- i(I), w(null);
4117
- }
4118
- function C() {
4119
- w(null);
4120
- }
4121
- function E(v, D) {
4122
- const P = S(v), I = x(v), Y = Di(
4123
- P,
4124
- I,
4125
- d,
4126
- r,
4127
- l
4128
- );
4129
- D == "single" ? u(P, Y, v) : c(P, Y, v);
4130
- }
4131
- const N = r.map((v) => ({
4132
- id: v.id,
4133
- ...Ue(v, d, l, l)
4134
- })), L = N.flatMap(
4135
- (v) => N.map((D) => v.id < D.id ? xi(v, D) : null)
4136
- ).filter((v) => v !== null);
4137
- return /* @__PURE__ */ m(
4138
- "div",
4139
- {
4140
- id: `timelane-lane-${e}`,
4141
- className: `timelane-lane ${n ? "timelane-lane-focused" : ""}`,
4142
- "data-timelane-lane-id": e,
4143
- style: p,
4144
- onMouseUp: a,
4145
- onClick: (v) => E(v, "single"),
4146
- onDoubleClick: (v) => E(v, "double"),
4147
- onContextMenu: (v) => {
4148
- s(S(v), v);
4149
- },
4150
- children: /* @__PURE__ */ X(
4151
- Ei,
4152
- {
4153
- onDrag: M,
4154
- onDragLeave: C,
4155
- onDrop: O,
4156
- children: [
4157
- r.map((v, D) => /* @__PURE__ */ m(
4158
- qi,
4159
- {
4160
- item: v,
4161
- settings: l,
4162
- lane: d,
4163
- onDragStart: () => {
4164
- y(v);
4165
- },
4166
- onDrag: () => {
4167
- },
4168
- onDrop: () => {
4169
- y(null);
4170
- },
4171
- onUpdate: i,
4172
- onResizeStart: () => {
4173
- f(v.payload);
4174
- },
4175
- children: o(
4176
- v,
4177
- g !== null && g.id === v.id
4178
- )
4179
- },
4180
- D
4181
- )),
4182
- b && /* @__PURE__ */ m(Pi, { ...b }),
4183
- L.map((v, D) => /* @__PURE__ */ m(Xi, { overlap: v }, D))
4184
- ]
4185
- }
4186
- )
4187
- }
4188
- );
4189
- }
4190
- function Gi(e, t) {
4191
- return /* @__PURE__ */ X("div", { children: [
4192
- e.id,
4193
- " (",
4194
- B(e.start, "yyyy-mm-dd"),
4195
- " -",
4196
- " ",
4197
- B(e.end, "yyyy-mm-dd"),
4198
- ")",
4199
- t ? "dragging" : ""
4200
- ] });
4201
- }
4202
- function H({ children: e }) {
4203
- const t = re(null);
4204
- return /* @__PURE__ */ m(
4205
- "div",
4206
- {
4207
- className: "timelane-layout",
4208
- onWheel: (r) => {
4209
- t.current && (r.ctrlKey || r.shiftKey) && (t.current.scrollLeft += r.deltaY, r.preventDefault());
4210
- },
4211
- ref: t,
4212
- children: /* @__PURE__ */ m("div", { className: "timelane-layout-inner", children: e })
4213
- }
4214
- );
4215
- }
4216
- function Ki({ children: e }) {
4217
- return /* @__PURE__ */ m("div", { className: "timelane-layout-header", children: e });
4218
- }
4219
- function Vi({ children: e }) {
4220
- return /* @__PURE__ */ m("div", { className: "timelane-layout-background", children: e });
4221
- }
4222
- function Qi({ children: e }) {
4223
- return /* @__PURE__ */ m("div", { className: "timelane-layout-body", children: e });
4224
- }
4225
- function Ji({ children: e }) {
4226
- return /* @__PURE__ */ m("div", { className: "timelane-layout-footer", children: e });
4227
- }
4228
- function Zi({
4229
- side: e = "left",
4230
- children: t
4231
- }) {
4232
- return /* @__PURE__ */ m(
4233
- "div",
4234
- {
4235
- className: `timelane-layout-aside ${e == "left" ? "timelane-layout-aside-left" : "timelane-layout-aside-right"}`,
4236
- children: t
4237
- }
4238
- );
4239
- }
4240
- function ea({
4241
- corner: e = "top left",
4242
- children: t
4243
- }) {
4244
- let r = "";
4245
- switch (e) {
4246
- case "top left":
4247
- r = "timelane-layout-corner-top-left";
4248
- break;
4249
- case "top right":
4250
- r = "timelane-layout-corner-top-right";
4251
- break;
4252
- case "bottom left":
4253
- r = "timelane-layout-corner-bottom-left";
4254
- break;
4255
- case "bottom right":
4256
- r = "timelane-layout-corner-bottom-right";
4257
- break;
4258
- }
4259
- return /* @__PURE__ */ m("div", { className: `timelane-layout-corner ${r}`, children: t });
4260
- }
4261
- H.Header = Ki;
4262
- H.Body = Qi;
4263
- H.Background = Vi;
4264
- H.Footer = Ji;
4265
- H.Aside = Zi;
4266
- H.Corner = ea;
4267
- function ta({
4268
- children: e,
4269
- onSelect: t
4270
- }) {
4271
- const [r, n] = Q([]), i = re(null), [a, u] = Q(null), [c, s] = Q(null);
4272
- ne(() => Gr({
4273
- onDragStart: (l) => {
4274
- n([l.source.data.id]);
4275
- }
4276
- }), []), ne(() => {
4277
- t(r);
4278
- }, [t, r]);
4279
- function o(l) {
4280
- !l.shiftKey && !l.ctrlKey && n([]), u({ x: l.clientX, y: l.clientY });
4281
- }
4282
- function f(l) {
4283
- if (a) {
4284
- const h = {
4285
- x: Math.min(l.clientX, a.x),
4286
- y: Math.min(l.clientY, a.y),
4287
- width: Math.abs(l.clientX - a.x),
4288
- height: Math.abs(l.clientY - a.y)
4289
- }, p = l.currentTarget.getBoundingClientRect();
4290
- s({
4291
- ...h,
4292
- x: h.x - p.left,
4293
- y: h.y - p.top
4294
- }), document.querySelectorAll(".timelane-drop-target").forEach((g) => {
4295
- le(g.getBoundingClientRect(), h) && g.querySelectorAll(".timelane-item").forEach((y) => {
4296
- le(y.getBoundingClientRect(), h) ? y.classList.add("timelane-item-marked") : y.classList.remove("timelane-item-marked");
4297
- });
4298
- }), (h.width > 5 || h.height > 5) && !i.current && (i.current = Rt, window.addEventListener("click", Rt, !0));
4299
- }
4300
- }
4301
- function d(l) {
4302
- if (a && c) {
4303
- l.stopPropagation();
4304
- const h = {
4305
- x: Math.min(l.clientX, a.x),
4306
- y: Math.min(l.clientY, a.y),
4307
- width: Math.abs(l.clientX - a.x),
4308
- height: Math.abs(l.clientY - a.y)
4309
- }, p = Array.from(
4310
- document.querySelectorAll(".timelane-drop-target")
4311
- ).filter((g) => le(g.getBoundingClientRect(), h)).map((g) => Array.from(g.querySelectorAll(".timelane-item"))).flatMap((g) => g).filter((g) => le(g.getBoundingClientRect(), h)).map((g) => g instanceof HTMLElement ? Number.parseInt(g.dataset.timelaneItemId || "-1") : -1).filter((g) => g > 0);
4312
- p.length > 0 && (l.shiftKey || l.ctrlKey ? n((g) => Array.from(/* @__PURE__ */ new Set([...g, ...p]))) : n(p)), document.querySelectorAll(".timelane-item-marked").forEach((g) => {
4313
- g.classList.remove("timelane-item-marked");
4314
- });
4315
- }
4316
- u(null), s(null), requestAnimationFrame(() => {
4317
- i.current && i.current !== null && (window.removeEventListener("click", i.current, !0), i.current = null);
4318
- });
4319
- }
4320
- return /* @__PURE__ */ X(
4321
- "div",
4322
- {
4323
- onMouseDown: o,
4324
- onMouseMove: f,
4325
- onMouseUp: d,
4326
- style: {
4327
- position: "relative"
4328
- },
4329
- children: [
4330
- c && /* @__PURE__ */ m(ra, { rect: c }),
4331
- e
4332
- ]
4333
- }
4334
- );
4335
- }
4336
- const Rt = (e) => {
4337
- e.preventDefault(), e.stopPropagation();
4338
- };
4339
- function ra({ rect: e }) {
4340
- return /* @__PURE__ */ m(
4341
- "div",
4342
- {
4343
- id: "mouse-selection-indicator",
4344
- style: {
4345
- border: "1px dashed blue",
4346
- position: "absolute",
4347
- top: `${e.y}px`,
4348
- left: `${e.x}px`,
4349
- width: `${e.width}px`,
4350
- height: `${e.height}px`,
4351
- zIndex: 1e6
4352
- }
4353
- }
4354
- );
4355
- }
4356
- function na({
4357
- onSelect: e = () => {
4358
- },
4359
- children: t
4360
- }) {
4361
- return /* @__PURE__ */ m(H.Body, { children: /* @__PURE__ */ m(ta, { onSelect: e, children: /* @__PURE__ */ m("div", { className: "timelane-body", children: t }) }) });
4362
- }
4363
- function ia(e, t) {
4364
- const r = U(t, e) + 1;
4365
- return /* @__PURE__ */ m(Oe, { children: r > 4 ? B(e, "LLLL yyyy") : /* @__PURE__ */ m(Oe, {}) });
4366
- }
4367
- function aa(e, t) {
4368
- const r = U(t, e) + 1, n = `KW ${B(e, "w")} (${B(
4369
- e,
4370
- "MM-dd"
4371
- )} - ${B(t, "MM-dd")}`;
4372
- return /* @__PURE__ */ m("div", { title: n, children: r > 2 ? /* @__PURE__ */ X(Oe, { children: [
4373
- "KW ",
4374
- B(e, "w")
4375
- ] }) : /* @__PURE__ */ m(Oe, {}) });
4376
- }
4377
- function oa(e) {
4378
- const t = `${B(e, "yyyy-MM-dd")}`;
4379
- return /* @__PURE__ */ m("div", { title: t, children: B(e, "d") });
4380
- }
4381
- function sa({
4382
- range: e,
4383
- pixels: t,
4384
- setFocusedDay: r = () => {
4385
- },
4386
- render: n = ia,
4387
- onMonthClick: i = () => {
4388
- }
4389
- }) {
4390
- return /* @__PURE__ */ m("div", { className: "timelane-header-months", children: sn(e).map((a, u) => {
4391
- a < e.start && (a = e.start);
4392
- let c = ci(a);
4393
- c > e.end && (c = e.end);
4394
- const s = U(c, a) + 1;
4395
- return /* @__PURE__ */ m(
4396
- "div",
4397
- {
4398
- className: "timelane-header-month-label",
4399
- style: {
4400
- width: `${t.pixelsPerDay * s}px`
4401
- },
4402
- onClick: (o) => {
4403
- i({ firstDay: a, lastDay: c, e: o }), r(a);
4404
- },
4405
- children: n(a, c)
4406
- },
4407
- u
4408
- );
4409
- }) });
4410
- }
4411
- function ua({
4412
- range: e,
4413
- pixels: t,
4414
- setFocusedDay: r = () => {
4415
- },
4416
- render: n = aa,
4417
- onWeekClick: i = () => {
4418
- }
4419
- }) {
4420
- return /* @__PURE__ */ m("div", { className: "timelane-header-weeks", children: un(e, { weekStartsOn: 1 }).map((a, u) => {
4421
- a < e.start && (a = e.start);
4422
- let c = Yt(a) ? a : di(a);
4423
- c > e.end && (c = e.end);
4424
- const s = U(c, a) + 1;
4425
- return /* @__PURE__ */ m(
4426
- "div",
4427
- {
4428
- className: "timelane-header-week-label",
4429
- style: {
4430
- width: `${t.pixelsPerDay * s}px`
4431
- },
4432
- onClick: (o) => {
4433
- i({ firstDay: a, lastDay: c, e: o }), r(a);
4434
- },
4435
- children: n(a, c)
4436
- },
4437
- u
4438
- );
4439
- }) });
4440
- }
4441
- function ca({
4442
- range: e,
4443
- pixels: t,
4444
- focusedDay: r,
4445
- setFocusedDay: n = () => {
4446
- },
4447
- render: i = oa,
4448
- onDayClick: a = () => {
4449
- }
4450
- }) {
4451
- return /* @__PURE__ */ m("div", { className: "timelane-header-days", children: $t(e).map((u, c) => /* @__PURE__ */ m(
4452
- "div",
4453
- {
4454
- className: `timelane-header-day-label ${r && nn(r, u) ? "timelane-header-day-label-focused" : ""}`,
4455
- style: { width: `${t.pixelsPerDay}px` },
4456
- onClick: (s) => {
4457
- a({ day: u, e: s }), n(u);
4458
- },
4459
- children: i(u)
4460
- },
4461
- c
4462
- )) });
4463
- }
4464
- function la({
4465
- focusedDay: e,
4466
- setFocusedDay: t = () => {
4467
- },
4468
- renderMonthHeader: r,
4469
- renderWeekHeader: n,
4470
- renderDayHeader: i,
4471
- onMonthClick: a,
4472
- onDayClick: u,
4473
- onWeekClick: c
4474
- }) {
4475
- const { settings: s } = J();
4476
- return /* @__PURE__ */ m(H.Header, { children: /* @__PURE__ */ X("div", { className: "timelane-header", children: [
4477
- s.showMonths && /* @__PURE__ */ m(
4478
- sa,
4479
- {
4480
- range: s,
4481
- pixels: s,
4482
- setFocusedDay: t,
4483
- render: r,
4484
- onMonthClick: a
4485
- }
4486
- ),
4487
- s.showWeeks && /* @__PURE__ */ m(
4488
- ua,
4489
- {
4490
- range: s,
4491
- pixels: s,
4492
- setFocusedDay: t,
4493
- render: n,
4494
- onWeekClick: c
4495
- }
4496
- ),
4497
- s.showDays && /* @__PURE__ */ m(
4498
- ca,
4499
- {
4500
- range: s,
4501
- pixels: s,
4502
- focusedDay: e,
4503
- setFocusedDay: t,
4504
- render: i,
4505
- onDayClick: u
4506
- }
4507
- )
4508
- ] }) });
4509
- }
4510
- function da({ focusedDay: e }) {
4511
- const { settings: t } = J();
4512
- return /* @__PURE__ */ m(H.Background, { children: /* @__PURE__ */ m("div", { className: "timelane-background", children: /* @__PURE__ */ X("div", { className: "timelane-background-inner", children: [
4513
- e && /* @__PURE__ */ m(
4514
- "div",
4515
- {
4516
- className: "timelane-background-focused-day-position",
4517
- style: {
4518
- width: `${t.pixelsPerDay}px`,
4519
- marginLeft: `${Ge(e, t.start, t) - t.pixelsPerDay / 2}px`
4520
- }
4521
- }
4522
- ),
4523
- /* @__PURE__ */ m(
4524
- "div",
4525
- {
4526
- id: "timelane-background-date-anchor",
4527
- style: {
4528
- position: "absolute",
4529
- top: 0,
4530
- width: "1px",
4531
- height: "100%"
4532
- }
4533
- }
4534
- ),
4535
- $t(t).map((r, n) => /* @__PURE__ */ m(
4536
- "div",
4537
- {
4538
- className: `timelane-background-day-label ${Yt(r) ? "timelane-background-day-label-sunday" : ""} `,
4539
- style: { width: `${t.pixelsPerDay}px` },
4540
- "data-day": B(r, "yyyy-MM-dd")
4541
- },
4542
- n
4543
- ))
4544
- ] }) }) });
4545
- }
4546
- function fa({
4547
- lanes: e,
4548
- width: t = 100,
4549
- side: r = "left",
4550
- focusedLane: n,
4551
- setFocusedLane: i = () => {
4552
- },
4553
- onLaneHeaderClick: a = () => {
4554
- },
4555
- onLaneHeaderDoubleClick: u = () => {
4556
- },
4557
- onLaneHeaderContextMenu: c = () => {
4558
- },
4559
- renderLaneHeader: s = ga
4560
- }) {
4561
- const { settings: o } = J();
4562
- return /* @__PURE__ */ m(H.Aside, { side: r, children: /* @__PURE__ */ m("div", { className: "timelane-aside", style: { width: `${t}px` }, children: e && e.map((f) => /* @__PURE__ */ m(
4563
- ha,
4564
- {
4565
- height: o.pixelsPerLane,
4566
- isFocused: n ? n.id === f.id : !1,
4567
- onClick: (d) => {
4568
- i(f), a(f, d);
4569
- },
4570
- onDoubleClick: (d) => u(f, d),
4571
- onContextMenu: (d) => c(f, d),
4572
- children: s(f)
4573
- },
4574
- f.id
4575
- )) }) });
4576
- }
4577
- function ha({
4578
- height: e,
4579
- isFocused: t,
4580
- onClick: r,
4581
- onDoubleClick: n,
4582
- onContextMenu: i,
4583
- children: a
4584
- }) {
4585
- return /* @__PURE__ */ m(
4586
- "div",
4587
- {
4588
- className: `timelane-aside-lane-header ${t ? "timelane-aside-lane-header-focused" : ""}`,
4589
- style: { height: `${e}px` },
4590
- onClick: r,
4591
- onDoubleClick: n,
4592
- onContextMenu: i,
4593
- children: a
4594
- }
4595
- );
4596
- }
4597
- function ga(e) {
4598
- return /* @__PURE__ */ m("div", { children: e.id });
4599
- }
4600
- function pa({
4601
- settings: e,
4602
- children: t
4603
- }) {
4604
- const [r, n] = Q(e);
4605
- return ne(() => {
4606
- n((i) => ({ ...i, ...e }));
4607
- }, [e]), /* @__PURE__ */ m(Kt.Provider, { value: { settings: r, setSettings: n }, children: t });
4608
- }
4609
- function oe({
4610
- start: e,
4611
- end: t,
4612
- pixelsPerDay: r,
4613
- pixelsPerLane: n,
4614
- showMonths: i,
4615
- showWeeks: a,
4616
- showDays: u,
4617
- allowOverlaps: c,
4618
- enableItemResizing: s,
4619
- enableItemDragging: o,
4620
- children: f
4621
- }) {
4622
- const { settings: d } = J();
4623
- return /* @__PURE__ */ m(
4624
- pa,
4625
- {
4626
- settings: {
4627
- ...d,
4628
- start: e || d.start,
4629
- end: t || d.end,
4630
- pixelsPerDay: r || d.pixelsPerDay,
4631
- pixelsPerLane: n || d.pixelsPerLane,
4632
- showMonths: i !== void 0 ? i : d.showMonths,
4633
- showWeeks: a !== void 0 ? a : d.showWeeks,
4634
- showDays: u !== void 0 ? u : d.showDays,
4635
- allowOverlaps: c !== void 0 ? c : d.allowOverlaps,
4636
- enableItemDragging: o !== void 0 ? o : d.enableItemDragging,
4637
- enableItemResizing: s !== void 0 ? s : d.enableItemResizing
4638
- },
4639
- children: /* @__PURE__ */ m("div", { className: "timelane", children: /* @__PURE__ */ m(H, { children: f }) })
4640
- }
4641
- );
4642
- }
4643
- oe.Header = la;
4644
- oe.Body = na;
4645
- oe.Background = da;
4646
- oe.Aside = fa;
4647
- oe.Lane = Ui;
4648
- oe.Layout = H;
4649
- const kt = 30;
4650
- function ba({
4651
- name: e,
4652
- description: t = "",
4653
- isSelected: r = !1,
4654
- onClick: n = () => {
4655
- },
4656
- onContextMenu: i = () => {
4657
- }
4658
- }) {
4659
- const a = re(null);
4660
- let u = 1;
4661
- if (a.current) {
4662
- const c = a.current.getBoundingClientRect().height;
4663
- c > 0 && c < kt && (u = c / kt);
4664
- }
4665
- return /* @__PURE__ */ X(
4666
- "div",
4667
- {
4668
- className: `timelane-allocation ${r ? "timelane-allocation-selected" : ""}`,
4669
- onClick: n,
4670
- onContextMenu: (c) => {
4671
- c.preventDefault(), c.stopPropagation(), i(c);
4672
- },
4673
- ref: a,
4674
- style: {
4675
- background: "lightblue"
4676
- },
4677
- children: [
4678
- /* @__PURE__ */ m(
4679
- "div",
4680
- {
4681
- className: "timelane-allocation-title",
4682
- style: {
4683
- transform: `scale(${u})`
4684
- },
4685
- children: e
4686
- }
4687
- ),
4688
- /* @__PURE__ */ m("div", { style: { fontSize: "small" }, children: t })
4689
- ]
4690
- }
4691
- );
4692
- }
4693
- const wa = () => {
4694
- const { settings: e } = J();
4695
- function t(a) {
4696
- a instanceof Object ? (a.horz !== void 0 && r(a.horz), a.vert !== void 0 && n(a.vert)) : i(a);
4697
- }
4698
- function r(a) {
4699
- window.requestAnimationFrame(() => {
4700
- const u = document.getElementById(
4701
- "timelane-background-date-anchor"
4702
- );
4703
- if (u) {
4704
- const c = Ge(a, e.start, e);
4705
- u.style.setProperty("left", `${c}px`), u.scrollIntoView({
4706
- block: "nearest",
4707
- inline: "center",
4708
- behavior: "smooth"
4709
- });
4710
- }
4711
- });
4712
- }
4713
- function n(a) {
4714
- window.requestAnimationFrame(() => {
4715
- const u = document.getElementById(
4716
- `timelane-lane-${a}`
4717
- );
4718
- u && u.scrollIntoView({ block: "center", behavior: "smooth" });
4719
- });
4720
- }
4721
- function i(a) {
4722
- window.requestAnimationFrame(() => {
4723
- const u = document.getElementById(
4724
- `timelane-item-${a}`
4725
- );
4726
- u && u.scrollIntoView({
4727
- block: "center",
4728
- inline: "center",
4729
- behavior: "smooth"
4730
- });
4731
- });
4732
- }
4733
- return { scrollTo: t, scrollToDate: r, scrollToItem: i, scrollToLane: n };
4734
- };
4735
- export {
4736
- ca as DaysHeader,
4737
- sa as MonthsHeader,
4738
- oe as Timelane,
4739
- ba as TimelaneAllocation,
4740
- fa as TimelaneAside,
4741
- da as TimelaneBackground,
4742
- na as TimelaneBody,
4743
- la as TimelaneHeader,
4744
- Ui as TimelaneLane,
4745
- H as TimelaneLayout,
4746
- pa as TimelaneSettingsProvider,
4747
- ua as WeeksHeader,
4748
- Pt as isItem,
4749
- oa as renderDayHeader,
4750
- ia as renderMonthHeader,
4751
- aa as renderWeekHeader,
4752
- wa as useScroll,
4753
- J as useTimelaneContext
4754
- };