@mjsz-vbr-elements/core 2.28.0 → 2.29.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,828 +0,0 @@
1
- /**
2
- * name: @mjsz-vbr-elements/core
3
- * version: v2.28.0 - 16/09/2025, 20:36:58
4
- * (c) 2025
5
- * description: Data visualization for MJSZ VBR
6
- * author: Ákos Stegner <akos.stegner@gmail.com>
7
- */
8
- import { ref as R, watch as O, unref as I, reactive as pe, defineComponent as Le, h as ke, computed as j, provide as me, inject as ve, onErrorCaptured as De, nextTick as Y, shallowRef as C, shallowReadonly as Ne, toValue as E, getCurrentScope as _e, onScopeDispose as Fe, readonly as ye, toRef as Me, customRef as Be, isRef as We } from "vue";
9
- import { _ as K, w as $e, x as Ue, z as Z, A as ze, B as Ke, C as he, D as B, E as ge, F as Ge, G as se, H as _, I as F, J as qe, K as He, u as Je } from "./datetime-D600LvsU.js";
10
- import { SORT_STATE_DESCEND as Q, SORT_STATE_ORIGINAL as W, SORT_STATE_ASCEND as U } from "./constants.js";
11
- function Qe(e) {
12
- var t = Object.prototype.toString.call(e);
13
- return t === "[object Uint8ClampedArray]" || t === "[object Int8Array]" || t === "[object Uint8Array]" || t === "[object Int16Array]" || t === "[object Uint16Array]" || t === "[object Int32Array]" || t === "[object Uint32Array]" || t === "[object Float32Array]" || t === "[object Float64Array]" || t === "[object BigInt64Array]" || t === "[object BigUint64Array]";
14
- }
15
- var Ve = /* @__PURE__ */ K(function(t) {
16
- return t != null && typeof t["fantasy-land/empty"] == "function" ? t["fantasy-land/empty"]() : t != null && t.constructor != null && typeof t.constructor["fantasy-land/empty"] == "function" ? t.constructor["fantasy-land/empty"]() : t != null && typeof t.empty == "function" ? t.empty() : t != null && t.constructor != null && typeof t.constructor.empty == "function" ? t.constructor.empty() : t == Set || t instanceof Set ? /* @__PURE__ */ new Set() : t == Map || t instanceof Map ? /* @__PURE__ */ new Map() : $e(t) ? [] : Ue(t) ? "" : Z(t) ? {} : ze(t) ? /* @__PURE__ */ function() {
17
- return arguments;
18
- }() : Qe(t) ? t.constructor.from("") : void 0;
19
- }), Xe = /* @__PURE__ */ K(function(t) {
20
- return t != null && Ke(t, Ve(t));
21
- }), Ye = /* @__PURE__ */ he(function(t, r, n) {
22
- var i = {}, o;
23
- r = r || {}, n = n || {};
24
- for (o in r)
25
- B(o, r) && (i[o] = B(o, n) ? t(o, r[o], n[o]) : r[o]);
26
- for (o in n)
27
- B(o, n) && !B(o, i) && (i[o] = n[o]);
28
- return i;
29
- }), Ze = /* @__PURE__ */ he(function e(t, r, n) {
30
- return Ye(function(i, o, u) {
31
- return Z(o) && Z(u) ? e(t, o, u) : t(i, o, u);
32
- }, r, n);
33
- }), et = /* @__PURE__ */ ge(function(t, r) {
34
- return Ze(function(n, i, o) {
35
- return o;
36
- }, t, r);
37
- }), tt = /* @__PURE__ */ ge(function(t, r) {
38
- for (var n = {}, i = {}, o = 0, u = t.length; o < u; )
39
- i[t[o]] = 1, o += 1;
40
- for (var s in r)
41
- i.hasOwnProperty(s) || (n[s] = r[s]);
42
- return n;
43
- }), D = `
44
- \v\f\r                 \u2028\u2029\uFEFF`, nt = "​", rt = typeof String.prototype.trim == "function", G = !rt || /* @__PURE__ */ D.trim() || !/* @__PURE__ */ nt.trim() ? /* @__PURE__ */ K(function(t) {
45
- var r = new RegExp("^[" + D + "][" + D + "]*"), n = new RegExp("[" + D + "][" + D + "]*$");
46
- return t.replace(r, "").replace(n, "");
47
- }) : /* @__PURE__ */ K(function(t) {
48
- return t.trim();
49
- });
50
- function jt(e, t, r, n) {
51
- const i = R(""), o = R(!1), u = (s) => {
52
- const a = Ge(se(t), s), d = a.length > 0;
53
- if (o.value = d, !d)
54
- return i.value = "";
55
- const f = a.map((p) => ({
56
- team: p.team.longName,
57
- points: Math.abs(se(t, p))
58
- })).map((p) => r(`additionalText.${t}.content`, p)).join(", ");
59
- i.value = [
60
- r(`additionalText.${t}.prependix`),
61
- f,
62
- ...r(`additionalText.${t}.appendix`) && [r(`additionalText.${t}.appendix`)]
63
- ].join(" ");
64
- };
65
- return O(e, u, { immediate: !0 }), O(
66
- () => I(n),
67
- () => u(I(e))
68
- ), {
69
- text: i,
70
- isVisible: o
71
- };
72
- }
73
- const we = Symbol("I18nContext"), T = pe({
74
- messages: {},
75
- locale: "",
76
- fallbackLocale: ""
77
- });
78
- function Lt({ messages: e = {}, locale: t = "", fallbackLocale: r = "" }) {
79
- T.messages = et(T.messages, e), T.locale = t, T.fallbackLocale = r;
80
- const n = (a, d = {}) => {
81
- const m = !Xe(d), f = _(G, F(".", a));
82
- return j(() => {
83
- const v = be(f);
84
- return m ? at(v, d) : v;
85
- }).value;
86
- }, i = (a) => {
87
- const d = _(G, F(".", a));
88
- return !!ee(T.locale, d, T.messages);
89
- }, o = (a) => {
90
- T.locale = a;
91
- }, s = {
92
- locale: j({
93
- get() {
94
- return T.locale;
95
- },
96
- set(a) {
97
- T.locale = a;
98
- }
99
- }),
100
- setLocale: o,
101
- translate: n,
102
- hasTranslation: i
103
- };
104
- return me(we, s), {
105
- translate: n
106
- };
107
- }
108
- function ot(e) {
109
- e && (T.messages = e.messages, T.locale = e.locale, T.fallbackLocale = e.fallbackLocale);
110
- const t = it();
111
- return {
112
- locale: t.locale,
113
- t: t.translate,
114
- setLocale: t.setLocale,
115
- hasTranslation: t.hasTranslation
116
- };
117
- }
118
- function it() {
119
- const e = ve(we, null);
120
- if (e === null)
121
- throw new Error("Provider is missing a parent component.");
122
- return e;
123
- }
124
- function be(e = []) {
125
- let t = ee(T.locale, e, T.messages);
126
- return !t && T.fallbackLocale && (t = ee(T.fallbackLocale, e, T.messages)), t || e.join(".");
127
- }
128
- function ee(e, t, r) {
129
- return qe([e, ...t], r);
130
- }
131
- function at(e, t) {
132
- return e.replace(/\{(\w+)\}/g, (r, n) => t[n]);
133
- }
134
- const kt = Le({
135
- props: {
136
- tag: {
137
- type: String,
138
- default: "div"
139
- },
140
- path: {
141
- type: String,
142
- defult: ""
143
- }
144
- },
145
- setup(e, { slots: t }) {
146
- const r = _(G, F(".", e.path)), n = be(r), i = F(/\{|\}/, n), o = Object.keys(t).map((u) => {
147
- const s = i.indexOf(u);
148
- return s > -1 && (i[s] = t[u]()[0]), i;
149
- });
150
- return () => ke(e.tag, o);
151
- }
152
- });
153
- function Dt(e, t = "", r = {}) {
154
- const n = R(""), { t: i } = ot(), o = j(() => {
155
- if (I(t))
156
- try {
157
- const a = st(I(e), I(t));
158
- return tt(a, I(e));
159
- } catch (a) {
160
- n.value = a;
161
- }
162
- return I(e);
163
- }), u = (a) => ({
164
- ...a,
165
- ...a.label && { label: i(a.label ?? "", I(r)) },
166
- ...a.tooltip && { tooltip: i(a.tooltip ?? "") }
167
- });
168
- return {
169
- columns: j(() => _(u, o.value)),
170
- error: n
171
- };
172
- }
173
- function st(e, t = "") {
174
- const r = _(G, F(",", t)), n = He(e);
175
- if (r[0] === "")
176
- return [];
177
- const i = r.findIndex((o) => !n.includes(o));
178
- if (i > -1)
179
- throw r[i];
180
- return r;
181
- }
182
- const Te = Symbol("ErrorProviderContext");
183
- function Nt() {
184
- const e = R(""), t = R({}), r = (o) => {
185
- console.error({ error: o }), e.value = o.message || o.error.message, t.value = {
186
- message: o.message,
187
- key: o.key || Je(o.message),
188
- cause: o.cause
189
- };
190
- }, n = () => {
191
- e.value = "", t.value = {};
192
- };
193
- return me(Te, {
194
- onError: r,
195
- reset: n
196
- }), window.onerror = (o) => {
197
- console.error("WINDOW_ONERROR:", o);
198
- }, De((o, u, s) => {
199
- console.error("onErrorCaptured:", o, u, s);
200
- }), {
201
- hasError: j(() => e.value.length > 0),
202
- message: e,
203
- error: t,
204
- reset: n,
205
- onError: r
206
- };
207
- }
208
- function _t() {
209
- const e = ut();
210
- return {
211
- onError: e.onError,
212
- reset: e.reset
213
- };
214
- }
215
- function ut() {
216
- const e = ve(Te, null);
217
- if (e === null)
218
- throw new Error("Provider is missing a parent component.");
219
- return e;
220
- }
221
- function Ee(e) {
222
- return _e() ? (Fe(e), !0) : !1;
223
- }
224
- const q = typeof window < "u" && typeof document < "u";
225
- typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
226
- const ct = Object.prototype.toString, lt = (e) => ct.call(e) === "[object Object]", x = () => {
227
- }, ft = /* @__PURE__ */ dt();
228
- function dt() {
229
- var e, t;
230
- return q && ((e = window?.navigator) == null ? void 0 : e.userAgent) && (/iP(?:ad|hone|od)/.test(window.navigator.userAgent) || ((t = window?.navigator) == null ? void 0 : t.maxTouchPoints) > 2 && /iPad|Macintosh/.test(window?.navigator.userAgent));
231
- }
232
- function pt(...e) {
233
- if (e.length !== 1)
234
- return Me(...e);
235
- const t = e[0];
236
- return typeof t == "function" ? ye(Be(() => ({ get: t, set: x }))) : R(t);
237
- }
238
- function mt(e, t) {
239
- function r(...n) {
240
- return new Promise((i, o) => {
241
- Promise.resolve(e(() => t.apply(this, n), { fn: t, thisArg: this, args: n })).then(i).catch(o);
242
- });
243
- }
244
- return r;
245
- }
246
- const Ae = (e) => e();
247
- function vt(e = Ae, t = {}) {
248
- const {
249
- initialState: r = "active"
250
- } = t, n = pt(r === "active");
251
- function i() {
252
- n.value = !1;
253
- }
254
- function o() {
255
- n.value = !0;
256
- }
257
- const u = (...s) => {
258
- n.value && e(...s);
259
- };
260
- return { isActive: ye(n), pause: i, resume: o, eventFilter: u };
261
- }
262
- function te(e, t = !1, r = "Timeout") {
263
- return new Promise((n, i) => {
264
- setTimeout(t ? () => i(r) : n, e);
265
- });
266
- }
267
- function V(e) {
268
- return Array.isArray(e) ? e : [e];
269
- }
270
- function yt(e, t, r = {}) {
271
- const {
272
- eventFilter: n = Ae,
273
- ...i
274
- } = r;
275
- return O(
276
- e,
277
- mt(
278
- n,
279
- t
280
- ),
281
- i
282
- );
283
- }
284
- function Ft(e, t, r = {}) {
285
- const {
286
- eventFilter: n,
287
- initialState: i = "active",
288
- ...o
289
- } = r, { eventFilter: u, pause: s, resume: a, isActive: d } = vt(n, { initialState: i });
290
- return { stop: yt(
291
- e,
292
- t,
293
- {
294
- ...o,
295
- eventFilter: u
296
- }
297
- ), pause: s, resume: a, isActive: d };
298
- }
299
- function ne(e, t = !1) {
300
- function r(f, { flush: p = "sync", deep: v = !1, timeout: h, throwOnTimeout: b } = {}) {
301
- let c = null;
302
- const y = [new Promise((A) => {
303
- c = O(
304
- e,
305
- (g) => {
306
- f(g) !== t && (c ? c() : Y(() => c?.()), A(g));
307
- },
308
- {
309
- flush: p,
310
- deep: v,
311
- immediate: !0
312
- }
313
- );
314
- })];
315
- return h != null && y.push(
316
- te(h, b).then(() => E(e)).finally(() => c?.())
317
- ), Promise.race(y);
318
- }
319
- function n(f, p) {
320
- if (!We(f))
321
- return r((g) => g === f, p);
322
- const { flush: v = "sync", deep: h = !1, timeout: b, throwOnTimeout: c } = p ?? {};
323
- let l = null;
324
- const A = [new Promise((g) => {
325
- l = O(
326
- [e, f],
327
- ([k, M]) => {
328
- t !== (k === M) && (l ? l() : Y(() => l?.()), g(k));
329
- },
330
- {
331
- flush: v,
332
- deep: h,
333
- immediate: !0
334
- }
335
- );
336
- })];
337
- return b != null && A.push(
338
- te(b, c).then(() => E(e)).finally(() => (l?.(), E(e)))
339
- ), Promise.race(A);
340
- }
341
- function i(f) {
342
- return r((p) => !!p, f);
343
- }
344
- function o(f) {
345
- return n(null, f);
346
- }
347
- function u(f) {
348
- return n(void 0, f);
349
- }
350
- function s(f) {
351
- return r(Number.isNaN, f);
352
- }
353
- function a(f, p) {
354
- return r((v) => {
355
- const h = Array.from(v);
356
- return h.includes(f) || h.includes(E(f));
357
- }, p);
358
- }
359
- function d(f) {
360
- return m(1, f);
361
- }
362
- function m(f = 1, p) {
363
- let v = -1;
364
- return r(() => (v += 1, v >= f), p);
365
- }
366
- return Array.isArray(E(e)) ? {
367
- toMatch: r,
368
- toContains: a,
369
- changed: d,
370
- changedTimes: m,
371
- get not() {
372
- return ne(e, !t);
373
- }
374
- } : {
375
- toMatch: r,
376
- toBe: n,
377
- toBeTruthy: i,
378
- toBeNull: o,
379
- toBeNaN: s,
380
- toBeUndefined: u,
381
- changed: d,
382
- changedTimes: m,
383
- get not() {
384
- return ne(e, !t);
385
- }
386
- };
387
- }
388
- function ht(e) {
389
- return ne(e);
390
- }
391
- function gt(e, t, r = {}) {
392
- const {
393
- immediate: n = !0,
394
- immediateCallback: i = !1
395
- } = r, o = C(!1);
396
- let u;
397
- function s() {
398
- u && (clearTimeout(u), u = void 0);
399
- }
400
- function a() {
401
- o.value = !1, s();
402
- }
403
- function d(...m) {
404
- i && e(), s(), o.value = !0, u = setTimeout(() => {
405
- o.value = !1, u = void 0, e(...m);
406
- }, E(t));
407
- }
408
- return n && (o.value = !0, q && d()), Ee(a), {
409
- isPending: Ne(o),
410
- start: d,
411
- stop: a
412
- };
413
- }
414
- function wt(e, t, r) {
415
- return O(
416
- e,
417
- t,
418
- {
419
- ...r,
420
- immediate: !0
421
- }
422
- );
423
- }
424
- function Mt(e, t, r) {
425
- return O(
426
- e,
427
- t,
428
- {
429
- ...r,
430
- once: !0
431
- }
432
- );
433
- }
434
- function Bt(e, t, r) {
435
- const n = O(
436
- e,
437
- (i, o, u) => {
438
- i && (r?.once && Y(() => n()), t(i, o, u));
439
- },
440
- {
441
- ...r,
442
- once: !1
443
- }
444
- );
445
- return n;
446
- }
447
- const Ie = q ? window : void 0, bt = q ? window.document : void 0;
448
- function N(e) {
449
- var t;
450
- const r = E(e);
451
- return (t = r?.$el) != null ? t : r;
452
- }
453
- function z(...e) {
454
- const t = [], r = () => {
455
- t.forEach((s) => s()), t.length = 0;
456
- }, n = (s, a, d, m) => (s.addEventListener(a, d, m), () => s.removeEventListener(a, d, m)), i = j(() => {
457
- const s = V(E(e[0])).filter((a) => a != null);
458
- return s.every((a) => typeof a != "string") ? s : void 0;
459
- }), o = wt(
460
- () => {
461
- var s, a;
462
- return [
463
- (a = (s = i.value) == null ? void 0 : s.map((d) => N(d))) != null ? a : [Ie].filter((d) => d != null),
464
- V(E(i.value ? e[1] : e[0])),
465
- V(I(i.value ? e[2] : e[1])),
466
- // @ts-expect-error - TypeScript gets the correct types, but somehow still complains
467
- E(i.value ? e[3] : e[2])
468
- ];
469
- },
470
- ([s, a, d, m]) => {
471
- if (r(), !s?.length || !a?.length || !d?.length)
472
- return;
473
- const f = lt(m) ? { ...m } : m;
474
- t.push(
475
- ...s.flatMap(
476
- (p) => a.flatMap(
477
- (v) => d.map((h) => n(p, v, h, f))
478
- )
479
- )
480
- );
481
- },
482
- { flush: "post" }
483
- ), u = () => {
484
- o(), r();
485
- };
486
- return Ee(r), u;
487
- }
488
- let ue = !1;
489
- function Wt(e, t, r = {}) {
490
- const { window: n = Ie, ignore: i = [], capture: o = !0, detectIframe: u = !1, controls: s = !1 } = r;
491
- if (!n)
492
- return s ? { stop: x, cancel: x, trigger: x } : x;
493
- if (ft && !ue) {
494
- ue = !0;
495
- const c = { passive: !0 };
496
- Array.from(n.document.body.children).forEach((l) => l.addEventListener("click", x, c)), n.document.documentElement.addEventListener("click", x, c);
497
- }
498
- let a = !0;
499
- const d = (c) => E(i).some((l) => {
500
- if (typeof l == "string")
501
- return Array.from(n.document.querySelectorAll(l)).some((y) => y === c.target || c.composedPath().includes(y));
502
- {
503
- const y = N(l);
504
- return y && (c.target === y || c.composedPath().includes(y));
505
- }
506
- });
507
- function m(c) {
508
- const l = E(c);
509
- return l && l.$.subTree.shapeFlag === 16;
510
- }
511
- function f(c, l) {
512
- const y = E(c), A = y.$.subTree && y.$.subTree.children;
513
- return A == null || !Array.isArray(A) ? !1 : A.some((g) => g.el === l.target || l.composedPath().includes(g.el));
514
- }
515
- const p = (c) => {
516
- const l = N(e);
517
- if (c.target != null && !(!(l instanceof Element) && m(e) && f(e, c)) && !(!l || l === c.target || c.composedPath().includes(l))) {
518
- if ("detail" in c && c.detail === 0 && (a = !d(c)), !a) {
519
- a = !0;
520
- return;
521
- }
522
- t(c);
523
- }
524
- };
525
- let v = !1;
526
- const h = [
527
- z(n, "click", (c) => {
528
- v || (v = !0, setTimeout(() => {
529
- v = !1;
530
- }, 0), p(c));
531
- }, { passive: !0, capture: o }),
532
- z(n, "pointerdown", (c) => {
533
- const l = N(e);
534
- a = !d(c) && !!(l && !c.composedPath().includes(l));
535
- }, { passive: !0 }),
536
- u && z(n, "blur", (c) => {
537
- setTimeout(() => {
538
- var l;
539
- const y = N(e);
540
- ((l = n.document.activeElement) == null ? void 0 : l.tagName) === "IFRAME" && !y?.contains(n.document.activeElement) && t(c);
541
- }, 0);
542
- }, { passive: !0 })
543
- ].filter(Boolean), b = () => h.forEach((c) => c());
544
- return s ? {
545
- stop: b,
546
- cancel: () => {
547
- a = !1;
548
- },
549
- trigger: (c) => {
550
- a = !0, p(c), a = !1;
551
- }
552
- } : b;
553
- }
554
- function Tt(e, t, r) {
555
- const {
556
- immediate: n = !0,
557
- delay: i = 0,
558
- onError: o = x,
559
- onSuccess: u = x,
560
- resetOnExecute: s = !0,
561
- shallow: a = !0,
562
- throwError: d
563
- } = r ?? {}, m = a ? C(t) : R(t), f = C(!1), p = C(!1), v = C(void 0);
564
- async function h(l = 0, ...y) {
565
- s && (m.value = t), v.value = void 0, f.value = !1, p.value = !0, l > 0 && await te(l);
566
- const A = typeof e == "function" ? e(...y) : e;
567
- try {
568
- const g = await A;
569
- m.value = g, f.value = !0, u(g);
570
- } catch (g) {
571
- if (v.value = g, o(g), d)
572
- throw g;
573
- } finally {
574
- p.value = !1;
575
- }
576
- return m.value;
577
- }
578
- n && h(i);
579
- const b = {
580
- state: m,
581
- isReady: f,
582
- isLoading: p,
583
- error: v,
584
- execute: h,
585
- executeImmediate: (...l) => h(0, ...l)
586
- };
587
- function c() {
588
- return new Promise((l, y) => {
589
- ht(p).toBe(!1).then(() => l(b)).catch(y);
590
- });
591
- }
592
- return {
593
- ...b,
594
- then(l, y) {
595
- return c().then(l, y);
596
- }
597
- };
598
- }
599
- function $t(e = {}) {
600
- const { document: t = bt } = e;
601
- if (!t)
602
- return C("visible");
603
- const r = C(t.visibilityState);
604
- return z(t, "visibilitychange", () => {
605
- r.value = t.visibilityState;
606
- }, { passive: !0 }), r;
607
- }
608
- async function Et(e) {
609
- return new Promise((t, r) => {
610
- const n = new Image(), { src: i, srcset: o, sizes: u, class: s, loading: a, crossorigin: d, referrerPolicy: m, width: f, height: p, decoding: v, fetchPriority: h, ismap: b, usemap: c } = e;
611
- n.src = i, o != null && (n.srcset = o), u != null && (n.sizes = u), s != null && (n.className = s), a != null && (n.loading = a), d != null && (n.crossOrigin = d), m != null && (n.referrerPolicy = m), f != null && (n.width = f), p != null && (n.height = p), v != null && (n.decoding = v), h != null && (n.fetchPriority = h), b != null && (n.isMap = b), c != null && (n.useMap = c), n.onload = () => t(n), n.onerror = r;
612
- });
613
- }
614
- function Ut(e, t = {}) {
615
- const r = Tt(
616
- () => Et(E(e)),
617
- void 0,
618
- {
619
- resetOnExecute: !0,
620
- ...t
621
- }
622
- );
623
- return O(
624
- () => E(e),
625
- () => r.execute(t.delay),
626
- { deep: !0 }
627
- ), r;
628
- }
629
- function zt(e = [], t = {}) {
630
- const { delay: r = 0 } = t, n = R(!1), i = j(() => {
631
- const s = I(e);
632
- return Array.isArray(s) ? s.map((a) => I(a)).some(Boolean) : s;
633
- }), { start: o, stop: u } = gt(() => {
634
- n.value = !0;
635
- }, r);
636
- return O(
637
- i,
638
- (s) => {
639
- if (s)
640
- return o();
641
- u(), n.value = !1;
642
- },
643
- { immediate: !0, deep: !0 }
644
- ), n;
645
- }
646
- /*! *****************************************************************************
647
- Copyright (c) Microsoft Corporation.
648
-
649
- Permission to use, copy, modify, and/or distribute this software for any
650
- purpose with or without fee is hereby granted.
651
-
652
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
653
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
654
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
655
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
656
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
657
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
658
- PERFORMANCE OF THIS SOFTWARE.
659
- ***************************************************************************** */
660
- function X(e, t) {
661
- var r = typeof Symbol == "function" && e[Symbol.iterator];
662
- if (!r) return e;
663
- var n, i, o = r.call(e), u = [];
664
- try {
665
- for (; (t === void 0 || t-- > 0) && !(n = o.next()).done; ) u.push(n.value);
666
- } catch (s) {
667
- i = { error: s };
668
- } finally {
669
- try {
670
- n && !n.done && (r = o.return) && r.call(o);
671
- } finally {
672
- if (i) throw i.error;
673
- }
674
- }
675
- return u;
676
- }
677
- var ce;
678
- (function(e) {
679
- e[e.NotStarted = 0] = "NotStarted", e[e.Running = 1] = "Running", e[e.Stopped = 2] = "Stopped";
680
- })(ce || (ce = {}));
681
- var At = { type: "xstate.init" };
682
- function $(e) {
683
- return e === void 0 ? [] : [].concat(e);
684
- }
685
- function le(e, t) {
686
- return typeof (e = typeof e == "string" && t && t[e] ? t[e] : e) == "string" ? { type: e } : typeof e == "function" ? { type: e.name, exec: e } : e;
687
- }
688
- function re(e) {
689
- return function(t) {
690
- return e === t;
691
- };
692
- }
693
- function It(e) {
694
- return typeof e == "string" ? { type: e } : e;
695
- }
696
- function fe(e, t) {
697
- return { value: e, context: t, actions: [], changed: !1, matches: re(e) };
698
- }
699
- function de(e, t, r) {
700
- var n = t, i = !1;
701
- return [e.filter(function(o) {
702
- if (o.type === "xstate.assign") {
703
- i = !0;
704
- var u = Object.assign({}, n);
705
- return typeof o.assignment == "function" ? u = o.assignment(n, r) : Object.keys(o.assignment).forEach(function(s) {
706
- u[s] = typeof o.assignment[s] == "function" ? o.assignment[s](n, r) : o.assignment[s];
707
- }), n = u, !1;
708
- }
709
- return !0;
710
- }), n, i];
711
- }
712
- function Ot(e, t) {
713
- t === void 0 && (t = {});
714
- var r = X(de($(e.states[e.initial].entry).map(function(u) {
715
- return le(u, t.actions);
716
- }), e.context, At), 2), n = r[0], i = r[1], o = { config: e, _options: t, initialState: { value: e.initial, actions: n, context: i, matches: re(e.initial) }, transition: function(u, s) {
717
- var a, d, m = typeof u == "string" ? { value: u, context: e.context } : u, f = m.value, p = m.context, v = It(s), h = e.states[f];
718
- if (h.on) {
719
- var b = $(h.on[v.type]);
720
- "*" in h.on && b.push.apply(b, function(w, S, J) {
721
- if (arguments.length === 2) for (var P, L = 0, je = S.length; L < je; L++) !P && L in S || (P || (P = Array.prototype.slice.call(S, 0, L)), P[L] = S[L]);
722
- return w.concat(P || Array.prototype.slice.call(S));
723
- }([], X($(h.on["*"])), !1));
724
- try {
725
- for (var c = function(w) {
726
- var S = typeof Symbol == "function" && Symbol.iterator, J = S && w[S], P = 0;
727
- if (J) return J.call(w);
728
- if (w && typeof w.length == "number") return { next: function() {
729
- return w && P >= w.length && (w = void 0), { value: w && w[P++], done: !w };
730
- } };
731
- throw new TypeError(S ? "Object is not iterable." : "Symbol.iterator is not defined.");
732
- }(b), l = c.next(); !l.done; l = c.next()) {
733
- var y = l.value;
734
- if (y === void 0) return fe(f, p);
735
- var A = typeof y == "string" ? { target: y } : y, g = A.target, k = A.actions, M = k === void 0 ? [] : k, oe = A.cond, Oe = oe === void 0 ? function() {
736
- return !0;
737
- } : oe, Se = g === void 0, xe = g ?? f, Pe = e.states[xe];
738
- if (Oe(p, v)) {
739
- var H = X(de((Se ? $(M) : [].concat(h.exit, M, Pe.entry).filter(function(w) {
740
- return w;
741
- })).map(function(w) {
742
- return le(w, o._options.actions);
743
- }), p, v), 3), ie = H[0], Re = H[1], Ce = H[2], ae = g ?? f;
744
- return { value: ae, context: Re, actions: ie, changed: g !== f || ie.length > 0 || Ce, matches: re(ae) };
745
- }
746
- }
747
- } catch (w) {
748
- a = { error: w };
749
- } finally {
750
- try {
751
- l && !l.done && (d = c.return) && d.call(c);
752
- } finally {
753
- if (a) throw a.error;
754
- }
755
- }
756
- }
757
- return fe(f, p);
758
- } };
759
- return o;
760
- }
761
- const St = Ot({
762
- id: "sort",
763
- initial: W,
764
- states: {
765
- [W]: {
766
- on: {
767
- DIRECTION1: Q,
768
- DIRECTION2: U
769
- }
770
- },
771
- [Q]: {
772
- on: {
773
- DIRECTION1: U,
774
- DIRECTION2: W
775
- }
776
- },
777
- [U]: {
778
- on: {
779
- DIRECTION1: W,
780
- DIRECTION2: Q
781
- }
782
- }
783
- }
784
- });
785
- function xt(e, t) {
786
- const r = t === U ? "DIRECTION2" : "DIRECTION1";
787
- return St.transition(e, r).value;
788
- }
789
- function Kt(e = {}) {
790
- const { sortTarget: t = null, orders: r = [] } = e, n = pe({ sortTarget: t, orders: r });
791
- return {
792
- sort: n,
793
- change: ({ target: o, orders: u }) => {
794
- if (n.sortTarget !== o) {
795
- n.sortTarget = o, n.orders = u;
796
- return;
797
- }
798
- const s = u.map((a, d) => ({
799
- ...a,
800
- direction: xt(n.orders[d].direction, a.direction)
801
- }));
802
- n.sortTarget = o, n.orders = s;
803
- }
804
- };
805
- }
806
- export {
807
- Dt as a,
808
- Nt as b,
809
- _t as c,
810
- Lt as d,
811
- ot as e,
812
- zt as f,
813
- Kt as g,
814
- Ut as h,
815
- kt as i,
816
- Xe as j,
817
- Mt as k,
818
- Ft as l,
819
- et as m,
820
- x as n,
821
- Wt as o,
822
- N as p,
823
- Tt as q,
824
- $t as r,
825
- jt as u,
826
- st as v,
827
- Bt as w
828
- };