@feedmepos/mf-report 5.19.19-beta.0 → 5.19.20-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/dist/{App-BG5uoHAn.js → App-tXXht-5s.js} +4 -4
  2. package/dist/{BaseDialog.vue_vue_type_script_setup_true_lang-dX7Y4f-_.js → BaseDialog.vue_vue_type_script_setup_true_lang-DZvH0Y-3.js} +718 -962
  3. package/dist/DateRangeSelect.vue_vue_type_script_setup_true_lang-BVi8DNni.js +185 -0
  4. package/dist/{Default.vue_vue_type_script_setup_true_lang-arY3ZcKZ.js → Default.vue_vue_type_script_setup_true_lang-CC4O6KVY.js} +2 -2
  5. package/dist/DynamicWidget.vue_vue_type_script_setup_true_lang-BQh_qEEI.js +1669 -0
  6. package/dist/{InsightView-BEo7cPN3.js → InsightView-BnOUYD5B.js} +5 -5
  7. package/dist/{Integration-BovNO2yX.js → Integration-BkIHfAt8.js} +2 -2
  8. package/dist/{Integrations-DIXSWGS_.js → Integrations-D4ju0l38.js} +3 -3
  9. package/dist/{Layout-DhAHGBTk.js → Layout-Bx8ljvot.js} +1 -1
  10. package/dist/MenuTab.vue_vue_type_script_setup_true_lang-CSLsIaD4.js +352 -0
  11. package/dist/{NavigationTab.vue_vue_type_script_setup_true_lang-DuzQ1OX-.js → NavigationTab.vue_vue_type_script_setup_true_lang-TcdhfNBd.js} +7518 -7331
  12. package/dist/{NoData.vue_vue_type_script_setup_true_lang-CtN7oqXx.js → NoData.vue_vue_type_script_setup_true_lang-DX1We5Q0.js} +1 -1
  13. package/dist/{OverviewView-DEZKfz6j.js → OverviewView-CNqRybNx.js} +5 -5
  14. package/dist/{Report-WQb5zc2W.js → Report-CTiAbY0D.js} +4 -4
  15. package/dist/ReportEditor-C47BEkUJ.js +1013 -0
  16. package/dist/{ReportView-CJ4PA-Je.js → ReportView-CQuveOhV.js} +7 -7
  17. package/dist/{SelectComponent.vue_vue_type_script_setup_true_lang-BcQEW5MO.js → SelectComponent.vue_vue_type_script_setup_true_lang-DYOjRnAy.js} +1 -1
  18. package/dist/{Setting-Do3ReOAh.js → Setting-GJaJ_nux.js} +4 -4
  19. package/dist/TileEditor-BRQvaLQy.js +2735 -0
  20. package/dist/TransitionFade-B-VvNjOR.js +2499 -0
  21. package/dist/app.js +15 -41
  22. package/dist/assets/{formatChartData.worker-DOuklPCk.js → formatChartData.worker-CO5zKPH5.js} +6 -6
  23. package/dist/assets/{processTableData.worker-DphUPEW7.js → processTableData.worker-BAMcED0j.js} +6 -6
  24. package/dist/helper-CLGnwM-X.js +75 -0
  25. package/dist/{vue-i18n-BJW_sJot.js → vue-i18n-DsnU36hZ.js} +400 -405
  26. package/package.json +1 -1
  27. package/dist/DateRangeSelect.vue_vue_type_script_setup_true_lang-BeBr4VIF.js +0 -282
  28. package/dist/FilterSelector.vue_vue_type_script_setup_true_lang-BlJuhyD7.js +0 -2377
  29. package/dist/MenuTab.vue_vue_type_script_setup_true_lang-BSapw37S.js +0 -107
  30. package/dist/ReportEditor-BiRciW22.js +0 -1055
  31. package/dist/TileEditor-S-aswtJh.js +0 -2744
  32. package/dist/TransitionFade-C6FDOvN4.js +0 -2365
@@ -1,2365 +0,0 @@
1
- import { defineComponent as xe, onBeforeMount as On, onBeforeUnmount as In, resolveComponent as N, createElementBlock as Q, openBlock as V, normalizeStyle as Fn, unref as M, renderSlot as He, createVNode as k, createElementVNode as ve, toDisplayString as Ae, TransitionGroup as kn, nextTick as en, h as Bt, mergeModels as At, useModel as ze, computed as Fe, Fragment as Ge, renderList as tn, createBlock as Pe, normalizeClass as An, withCtx as ae, createTextVNode as nn, Transition as Tt, createCommentVNode as fe, ref as De, watch as mt, withModifiers as Rt } from "vue";
2
- import { u as Nt, f as Nn, p as Pn, d as pt, j as on, h as Vn } from "./vue-i18n-BJW_sJot.js";
3
- import { useCoreStore as Mn } from "@feedmepos/mf-common";
4
- import { storeToRefs as Ln } from "pinia";
5
- import { useRoute as $n } from "vue-router";
6
- import { W as L, c as Ce, d as Bn } from "./BaseDialog.vue_vue_type_script_setup_true_lang-dX7Y4f-_.js";
7
- import { a as Pt, _ as Xt } from "./SelectComponent.vue_vue_type_script_setup_true_lang-BcQEW5MO.js";
8
- import { R as Rn, I as Le, c as rn, d as an, e as Xn } from "./FilterSelector.vue_vue_type_script_setup_true_lang-BlJuhyD7.js";
9
- import { useSnackbar as Yn } from "@feedmepos/ui-library";
10
- import { d as Wn } from "./DateRangeSelect.vue_vue_type_script_setup_true_lang-BeBr4VIF.js";
11
- const Un = {
12
- key: 0,
13
- class: "flex gap-24 flex-col h-screen w-screen justify-center items-center"
14
- }, jn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, pi = /* @__PURE__ */ xe({
15
- __name: "FullScreen",
16
- setup(t) {
17
- const { t: e } = Nt(), n = $n(), { isLoading: o } = Ln(Nn()), i = Mn();
18
- return On(() => {
19
- i.hideSidebarToggle(!0);
20
- }), In(() => {
21
- i.hideSidebarToggle(!1);
22
- }), (r, a) => {
23
- const u = N("FmCircularProgress");
24
- return V(), Q("div", {
25
- class: "mx-auto",
26
- style: Fn({
27
- height: `calc(100vh - ${M(n).query.token && M(n).query.businessId ? "0" : "64"}px)`
28
- })
29
- }, [
30
- M(o) ? (V(), Q("div", Un, [
31
- k(u, { size: "xl" }),
32
- ve("span", jn, Ae(M(e)("report.common.isLoading")), 1)
33
- ])) : He(r.$slots, "default", { key: 1 })
34
- ], 4);
35
- };
36
- }
37
- });
38
- /**!
39
- * Sortable 1.14.0
40
- * @author RubaXa <trash@rubaxa.org>
41
- * @author owenm <owen23355@gmail.com>
42
- * @license MIT
43
- */
44
- function Yt(t, e) {
45
- var n = Object.keys(t);
46
- if (Object.getOwnPropertySymbols) {
47
- var o = Object.getOwnPropertySymbols(t);
48
- e && (o = o.filter(function(i) {
49
- return Object.getOwnPropertyDescriptor(t, i).enumerable;
50
- })), n.push.apply(n, o);
51
- }
52
- return n;
53
- }
54
- function se(t) {
55
- for (var e = 1; e < arguments.length; e++) {
56
- var n = arguments[e] != null ? arguments[e] : {};
57
- e % 2 ? Yt(Object(n), !0).forEach(function(o) {
58
- Hn(t, o, n[o]);
59
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : Yt(Object(n)).forEach(function(o) {
60
- Object.defineProperty(t, o, Object.getOwnPropertyDescriptor(n, o));
61
- });
62
- }
63
- return t;
64
- }
65
- function tt(t) {
66
- "@babel/helpers - typeof";
67
- return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? tt = function(e) {
68
- return typeof e;
69
- } : tt = function(e) {
70
- return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
71
- }, tt(t);
72
- }
73
- function Hn(t, e, n) {
74
- return e in t ? Object.defineProperty(t, e, {
75
- value: n,
76
- enumerable: !0,
77
- configurable: !0,
78
- writable: !0
79
- }) : t[e] = n, t;
80
- }
81
- function pe() {
82
- return pe = Object.assign || function(t) {
83
- for (var e = 1; e < arguments.length; e++) {
84
- var n = arguments[e];
85
- for (var o in n)
86
- Object.prototype.hasOwnProperty.call(n, o) && (t[o] = n[o]);
87
- }
88
- return t;
89
- }, pe.apply(this, arguments);
90
- }
91
- function zn(t, e) {
92
- if (t == null) return {};
93
- var n = {}, o = Object.keys(t), i, r;
94
- for (r = 0; r < o.length; r++)
95
- i = o[r], !(e.indexOf(i) >= 0) && (n[i] = t[i]);
96
- return n;
97
- }
98
- function Gn(t, e) {
99
- if (t == null) return {};
100
- var n = zn(t, e), o, i;
101
- if (Object.getOwnPropertySymbols) {
102
- var r = Object.getOwnPropertySymbols(t);
103
- for (i = 0; i < r.length; i++)
104
- o = r[i], !(e.indexOf(o) >= 0) && Object.prototype.propertyIsEnumerable.call(t, o) && (n[o] = t[o]);
105
- }
106
- return n;
107
- }
108
- var qn = "1.14.0";
109
- function me(t) {
110
- if (typeof window < "u" && window.navigator)
111
- return !!/* @__PURE__ */ navigator.userAgent.match(t);
112
- }
113
- var he = me(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i), qe = me(/Edge/i), Wt = me(/firefox/i), Xe = me(/safari/i) && !me(/chrome/i) && !me(/android/i), ln = me(/iP(ad|od|hone)/i), Kn = me(/chrome/i) && me(/android/i), sn = {
114
- capture: !1,
115
- passive: !1
116
- };
117
- function D(t, e, n) {
118
- t.addEventListener(e, n, !he && sn);
119
- }
120
- function S(t, e, n) {
121
- t.removeEventListener(e, n, !he && sn);
122
- }
123
- function at(t, e) {
124
- if (e) {
125
- if (e[0] === ">" && (e = e.substring(1)), t)
126
- try {
127
- if (t.matches)
128
- return t.matches(e);
129
- if (t.msMatchesSelector)
130
- return t.msMatchesSelector(e);
131
- if (t.webkitMatchesSelector)
132
- return t.webkitMatchesSelector(e);
133
- } catch {
134
- return !1;
135
- }
136
- return !1;
137
- }
138
- }
139
- function Jn(t) {
140
- return t.host && t !== document && t.host.nodeType ? t.host : t.parentNode;
141
- }
142
- function re(t, e, n, o) {
143
- if (t) {
144
- n = n || document;
145
- do {
146
- if (e != null && (e[0] === ">" ? t.parentNode === n && at(t, e) : at(t, e)) || o && t === n)
147
- return t;
148
- if (t === n) break;
149
- } while (t = Jn(t));
150
- }
151
- return null;
152
- }
153
- var Ut = /\s+/g;
154
- function K(t, e, n) {
155
- if (t && e)
156
- if (t.classList)
157
- t.classList[n ? "add" : "remove"](e);
158
- else {
159
- var o = (" " + t.className + " ").replace(Ut, " ").replace(" " + e + " ", " ");
160
- t.className = (o + (n ? " " + e : "")).replace(Ut, " ");
161
- }
162
- }
163
- function g(t, e, n) {
164
- var o = t && t.style;
165
- if (o) {
166
- if (n === void 0)
167
- return document.defaultView && document.defaultView.getComputedStyle ? n = document.defaultView.getComputedStyle(t, "") : t.currentStyle && (n = t.currentStyle), e === void 0 ? n : n[e];
168
- !(e in o) && e.indexOf("webkit") === -1 && (e = "-webkit-" + e), o[e] = n + (typeof n == "string" ? "" : "px");
169
- }
170
- }
171
- function Ve(t, e) {
172
- var n = "";
173
- if (typeof t == "string")
174
- n = t;
175
- else
176
- do {
177
- var o = g(t, "transform");
178
- o && o !== "none" && (n = o + " " + n);
179
- } while (!e && (t = t.parentNode));
180
- var i = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix;
181
- return i && new i(n);
182
- }
183
- function un(t, e, n) {
184
- if (t) {
185
- var o = t.getElementsByTagName(e), i = 0, r = o.length;
186
- if (n)
187
- for (; i < r; i++)
188
- n(o[i], i);
189
- return o;
190
- }
191
- return [];
192
- }
193
- function le() {
194
- var t = document.scrollingElement;
195
- return t || document.documentElement;
196
- }
197
- function P(t, e, n, o, i) {
198
- if (!(!t.getBoundingClientRect && t !== window)) {
199
- var r, a, u, l, c, s, f;
200
- if (t !== window && t.parentNode && t !== le() ? (r = t.getBoundingClientRect(), a = r.top, u = r.left, l = r.bottom, c = r.right, s = r.height, f = r.width) : (a = 0, u = 0, l = window.innerHeight, c = window.innerWidth, s = window.innerHeight, f = window.innerWidth), (e || n) && t !== window && (i = i || t.parentNode, !he))
201
- do
202
- if (i && i.getBoundingClientRect && (g(i, "transform") !== "none" || n && g(i, "position") !== "static")) {
203
- var h = i.getBoundingClientRect();
204
- a -= h.top + parseInt(g(i, "border-top-width")), u -= h.left + parseInt(g(i, "border-left-width")), l = a + r.height, c = u + r.width;
205
- break;
206
- }
207
- while (i = i.parentNode);
208
- if (o && t !== window) {
209
- var w = Ve(i || t), b = w && w.a, y = w && w.d;
210
- w && (a /= y, u /= b, f /= b, s /= y, l = a + s, c = u + f);
211
- }
212
- return {
213
- top: a,
214
- left: u,
215
- bottom: l,
216
- right: c,
217
- width: f,
218
- height: s
219
- };
220
- }
221
- }
222
- function jt(t, e, n) {
223
- for (var o = ye(t, !0), i = P(t)[e]; o; ) {
224
- var r = P(o)[n], a = void 0;
225
- if (a = i >= r, !a) return o;
226
- if (o === le()) break;
227
- o = ye(o, !1);
228
- }
229
- return !1;
230
- }
231
- function Me(t, e, n, o) {
232
- for (var i = 0, r = 0, a = t.children; r < a.length; ) {
233
- if (a[r].style.display !== "none" && a[r] !== v.ghost && (o || a[r] !== v.dragged) && re(a[r], n.draggable, t, !1)) {
234
- if (i === e)
235
- return a[r];
236
- i++;
237
- }
238
- r++;
239
- }
240
- return null;
241
- }
242
- function Vt(t, e) {
243
- for (var n = t.lastElementChild; n && (n === v.ghost || g(n, "display") === "none" || e && !at(n, e)); )
244
- n = n.previousElementSibling;
245
- return n || null;
246
- }
247
- function oe(t, e) {
248
- var n = 0;
249
- if (!t || !t.parentNode)
250
- return -1;
251
- for (; t = t.previousElementSibling; )
252
- t.nodeName.toUpperCase() !== "TEMPLATE" && t !== v.clone && (!e || at(t, e)) && n++;
253
- return n;
254
- }
255
- function Ht(t) {
256
- var e = 0, n = 0, o = le();
257
- if (t)
258
- do {
259
- var i = Ve(t), r = i.a, a = i.d;
260
- e += t.scrollLeft * r, n += t.scrollTop * a;
261
- } while (t !== o && (t = t.parentNode));
262
- return [e, n];
263
- }
264
- function Zn(t, e) {
265
- for (var n in t)
266
- if (t.hasOwnProperty(n)) {
267
- for (var o in e)
268
- if (e.hasOwnProperty(o) && e[o] === t[n][o]) return Number(n);
269
- }
270
- return -1;
271
- }
272
- function ye(t, e) {
273
- if (!t || !t.getBoundingClientRect) return le();
274
- var n = t, o = !1;
275
- do
276
- if (n.clientWidth < n.scrollWidth || n.clientHeight < n.scrollHeight) {
277
- var i = g(n);
278
- if (n.clientWidth < n.scrollWidth && (i.overflowX == "auto" || i.overflowX == "scroll") || n.clientHeight < n.scrollHeight && (i.overflowY == "auto" || i.overflowY == "scroll")) {
279
- if (!n.getBoundingClientRect || n === document.body) return le();
280
- if (o || e) return n;
281
- o = !0;
282
- }
283
- }
284
- while (n = n.parentNode);
285
- return le();
286
- }
287
- function Qn(t, e) {
288
- if (t && e)
289
- for (var n in e)
290
- e.hasOwnProperty(n) && (t[n] = e[n]);
291
- return t;
292
- }
293
- function ht(t, e) {
294
- return Math.round(t.top) === Math.round(e.top) && Math.round(t.left) === Math.round(e.left) && Math.round(t.height) === Math.round(e.height) && Math.round(t.width) === Math.round(e.width);
295
- }
296
- var Ye;
297
- function cn(t, e) {
298
- return function() {
299
- if (!Ye) {
300
- var n = arguments, o = this;
301
- n.length === 1 ? t.call(o, n[0]) : t.apply(o, n), Ye = setTimeout(function() {
302
- Ye = void 0;
303
- }, e);
304
- }
305
- };
306
- }
307
- function eo() {
308
- clearTimeout(Ye), Ye = void 0;
309
- }
310
- function dn(t, e, n) {
311
- t.scrollLeft += e, t.scrollTop += n;
312
- }
313
- function fn(t) {
314
- var e = window.Polymer, n = window.jQuery || window.Zepto;
315
- return e && e.dom ? e.dom(t).cloneNode(!0) : n ? n(t).clone(!0)[0] : t.cloneNode(!0);
316
- }
317
- var Z = "Sortable" + (/* @__PURE__ */ new Date()).getTime();
318
- function to() {
319
- var t = [], e;
320
- return {
321
- captureAnimationState: function() {
322
- if (t = [], !!this.options.animation) {
323
- var o = [].slice.call(this.el.children);
324
- o.forEach(function(i) {
325
- if (!(g(i, "display") === "none" || i === v.ghost)) {
326
- t.push({
327
- target: i,
328
- rect: P(i)
329
- });
330
- var r = se({}, t[t.length - 1].rect);
331
- if (i.thisAnimationDuration) {
332
- var a = Ve(i, !0);
333
- a && (r.top -= a.f, r.left -= a.e);
334
- }
335
- i.fromRect = r;
336
- }
337
- });
338
- }
339
- },
340
- addAnimationState: function(o) {
341
- t.push(o);
342
- },
343
- removeAnimationState: function(o) {
344
- t.splice(Zn(t, {
345
- target: o
346
- }), 1);
347
- },
348
- animateAll: function(o) {
349
- var i = this;
350
- if (!this.options.animation) {
351
- clearTimeout(e), typeof o == "function" && o();
352
- return;
353
- }
354
- var r = !1, a = 0;
355
- t.forEach(function(u) {
356
- var l = 0, c = u.target, s = c.fromRect, f = P(c), h = c.prevFromRect, w = c.prevToRect, b = u.rect, y = Ve(c, !0);
357
- y && (f.top -= y.f, f.left -= y.e), c.toRect = f, c.thisAnimationDuration && ht(h, f) && !ht(s, f) && // Make sure animatingRect is on line between toRect & fromRect
358
- (b.top - f.top) / (b.left - f.left) === (s.top - f.top) / (s.left - f.left) && (l = oo(b, h, w, i.options)), ht(f, s) || (c.prevFromRect = s, c.prevToRect = f, l || (l = i.options.animation), i.animate(c, b, f, l)), l && (r = !0, a = Math.max(a, l), clearTimeout(c.animationResetTimer), c.animationResetTimer = setTimeout(function() {
359
- c.animationTime = 0, c.prevFromRect = null, c.fromRect = null, c.prevToRect = null, c.thisAnimationDuration = null;
360
- }, l), c.thisAnimationDuration = l);
361
- }), clearTimeout(e), r ? e = setTimeout(function() {
362
- typeof o == "function" && o();
363
- }, a) : typeof o == "function" && o(), t = [];
364
- },
365
- animate: function(o, i, r, a) {
366
- if (a) {
367
- g(o, "transition", ""), g(o, "transform", "");
368
- var u = Ve(this.el), l = u && u.a, c = u && u.d, s = (i.left - r.left) / (l || 1), f = (i.top - r.top) / (c || 1);
369
- o.animatingX = !!s, o.animatingY = !!f, g(o, "transform", "translate3d(" + s + "px," + f + "px,0)"), this.forRepaintDummy = no(o), g(o, "transition", "transform " + a + "ms" + (this.options.easing ? " " + this.options.easing : "")), g(o, "transform", "translate3d(0,0,0)"), typeof o.animated == "number" && clearTimeout(o.animated), o.animated = setTimeout(function() {
370
- g(o, "transition", ""), g(o, "transform", ""), o.animated = !1, o.animatingX = !1, o.animatingY = !1;
371
- }, a);
372
- }
373
- }
374
- };
375
- }
376
- function no(t) {
377
- return t.offsetWidth;
378
- }
379
- function oo(t, e, n, o) {
380
- return Math.sqrt(Math.pow(e.top - t.top, 2) + Math.pow(e.left - t.left, 2)) / Math.sqrt(Math.pow(e.top - n.top, 2) + Math.pow(e.left - n.left, 2)) * o.animation;
381
- }
382
- var Oe = [], gt = {
383
- initializeByDefault: !0
384
- }, Ke = {
385
- mount: function(e) {
386
- for (var n in gt)
387
- gt.hasOwnProperty(n) && !(n in e) && (e[n] = gt[n]);
388
- Oe.forEach(function(o) {
389
- if (o.pluginName === e.pluginName)
390
- throw "Sortable: Cannot mount plugin ".concat(e.pluginName, " more than once");
391
- }), Oe.push(e);
392
- },
393
- pluginEvent: function(e, n, o) {
394
- var i = this;
395
- this.eventCanceled = !1, o.cancel = function() {
396
- i.eventCanceled = !0;
397
- };
398
- var r = e + "Global";
399
- Oe.forEach(function(a) {
400
- n[a.pluginName] && (n[a.pluginName][r] && n[a.pluginName][r](se({
401
- sortable: n
402
- }, o)), n.options[a.pluginName] && n[a.pluginName][e] && n[a.pluginName][e](se({
403
- sortable: n
404
- }, o)));
405
- });
406
- },
407
- initializePlugins: function(e, n, o, i) {
408
- Oe.forEach(function(u) {
409
- var l = u.pluginName;
410
- if (!(!e.options[l] && !u.initializeByDefault)) {
411
- var c = new u(e, n, e.options);
412
- c.sortable = e, c.options = e.options, e[l] = c, pe(o, c.defaults);
413
- }
414
- });
415
- for (var r in e.options)
416
- if (e.options.hasOwnProperty(r)) {
417
- var a = this.modifyOption(e, r, e.options[r]);
418
- typeof a < "u" && (e.options[r] = a);
419
- }
420
- },
421
- getEventProperties: function(e, n) {
422
- var o = {};
423
- return Oe.forEach(function(i) {
424
- typeof i.eventProperties == "function" && pe(o, i.eventProperties.call(n[i.pluginName], e));
425
- }), o;
426
- },
427
- modifyOption: function(e, n, o) {
428
- var i;
429
- return Oe.forEach(function(r) {
430
- e[r.pluginName] && r.optionListeners && typeof r.optionListeners[n] == "function" && (i = r.optionListeners[n].call(e[r.pluginName], o));
431
- }), i;
432
- }
433
- };
434
- function io(t) {
435
- var e = t.sortable, n = t.rootEl, o = t.name, i = t.targetEl, r = t.cloneEl, a = t.toEl, u = t.fromEl, l = t.oldIndex, c = t.newIndex, s = t.oldDraggableIndex, f = t.newDraggableIndex, h = t.originalEvent, w = t.putSortable, b = t.extraEventProperties;
436
- if (e = e || n && n[Z], !!e) {
437
- var y, B = e.options, R = "on" + o.charAt(0).toUpperCase() + o.substr(1);
438
- window.CustomEvent && !he && !qe ? y = new CustomEvent(o, {
439
- bubbles: !0,
440
- cancelable: !0
441
- }) : (y = document.createEvent("Event"), y.initEvent(o, !0, !0)), y.to = a || n, y.from = u || n, y.item = i || n, y.clone = r, y.oldIndex = l, y.newIndex = c, y.oldDraggableIndex = s, y.newDraggableIndex = f, y.originalEvent = h, y.pullMode = w ? w.lastPutMode : void 0;
442
- var x = se(se({}, b), Ke.getEventProperties(o, e));
443
- for (var A in x)
444
- y[A] = x[A];
445
- n && n.dispatchEvent(y), B[R] && B[R].call(e, y);
446
- }
447
- }
448
- var ro = ["evt"], q = function(e, n) {
449
- var o = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, i = o.evt, r = Gn(o, ro);
450
- Ke.pluginEvent.bind(v)(e, n, se({
451
- dragEl: d,
452
- parentEl: O,
453
- ghostEl: _,
454
- rootEl: T,
455
- nextEl: Te,
456
- lastDownEl: nt,
457
- cloneEl: I,
458
- cloneHidden: be,
459
- dragStarted: $e,
460
- putSortable: $,
461
- activeSortable: v.active,
462
- originalEvent: i,
463
- oldIndex: Ne,
464
- oldDraggableIndex: We,
465
- newIndex: J,
466
- newDraggableIndex: ge,
467
- hideGhostForTarget: gn,
468
- unhideGhostForTarget: vn,
469
- cloneNowHidden: function() {
470
- be = !0;
471
- },
472
- cloneNowShown: function() {
473
- be = !1;
474
- },
475
- dispatchSortableEvent: function(u) {
476
- G({
477
- sortable: n,
478
- name: u,
479
- originalEvent: i
480
- });
481
- }
482
- }, r));
483
- };
484
- function G(t) {
485
- io(se({
486
- putSortable: $,
487
- cloneEl: I,
488
- targetEl: d,
489
- rootEl: T,
490
- oldIndex: Ne,
491
- oldDraggableIndex: We,
492
- newIndex: J,
493
- newDraggableIndex: ge
494
- }, t));
495
- }
496
- var d, O, _, T, Te, nt, I, be, Ne, J, We, ge, Je, $, ke = !1, lt = !1, st = [], Ee, ie, vt, bt, zt, Gt, $e, Ie, Ue, je = !1, Ze = !1, ot, U, yt = [], xt = !1, ut = [], dt = typeof document < "u", Qe = ln, qt = qe || he ? "cssFloat" : "float", ao = dt && !Kn && !ln && "draggable" in document.createElement("div"), mn = function() {
497
- if (dt) {
498
- if (he)
499
- return !1;
500
- var t = document.createElement("x");
501
- return t.style.cssText = "pointer-events:auto", t.style.pointerEvents === "auto";
502
- }
503
- }(), pn = function(e, n) {
504
- var o = g(e), i = parseInt(o.width) - parseInt(o.paddingLeft) - parseInt(o.paddingRight) - parseInt(o.borderLeftWidth) - parseInt(o.borderRightWidth), r = Me(e, 0, n), a = Me(e, 1, n), u = r && g(r), l = a && g(a), c = u && parseInt(u.marginLeft) + parseInt(u.marginRight) + P(r).width, s = l && parseInt(l.marginLeft) + parseInt(l.marginRight) + P(a).width;
505
- if (o.display === "flex")
506
- return o.flexDirection === "column" || o.flexDirection === "column-reverse" ? "vertical" : "horizontal";
507
- if (o.display === "grid")
508
- return o.gridTemplateColumns.split(" ").length <= 1 ? "vertical" : "horizontal";
509
- if (r && u.float && u.float !== "none") {
510
- var f = u.float === "left" ? "left" : "right";
511
- return a && (l.clear === "both" || l.clear === f) ? "vertical" : "horizontal";
512
- }
513
- return r && (u.display === "block" || u.display === "flex" || u.display === "table" || u.display === "grid" || c >= i && o[qt] === "none" || a && o[qt] === "none" && c + s > i) ? "vertical" : "horizontal";
514
- }, lo = function(e, n, o) {
515
- var i = o ? e.left : e.top, r = o ? e.right : e.bottom, a = o ? e.width : e.height, u = o ? n.left : n.top, l = o ? n.right : n.bottom, c = o ? n.width : n.height;
516
- return i === u || r === l || i + a / 2 === u + c / 2;
517
- }, so = function(e, n) {
518
- var o;
519
- return st.some(function(i) {
520
- var r = i[Z].options.emptyInsertThreshold;
521
- if (!(!r || Vt(i))) {
522
- var a = P(i), u = e >= a.left - r && e <= a.right + r, l = n >= a.top - r && n <= a.bottom + r;
523
- if (u && l)
524
- return o = i;
525
- }
526
- }), o;
527
- }, hn = function(e) {
528
- function n(r, a) {
529
- return function(u, l, c, s) {
530
- var f = u.options.group.name && l.options.group.name && u.options.group.name === l.options.group.name;
531
- if (r == null && (a || f))
532
- return !0;
533
- if (r == null || r === !1)
534
- return !1;
535
- if (a && r === "clone")
536
- return r;
537
- if (typeof r == "function")
538
- return n(r(u, l, c, s), a)(u, l, c, s);
539
- var h = (a ? u : l).options.group.name;
540
- return r === !0 || typeof r == "string" && r === h || r.join && r.indexOf(h) > -1;
541
- };
542
- }
543
- var o = {}, i = e.group;
544
- (!i || tt(i) != "object") && (i = {
545
- name: i
546
- }), o.name = i.name, o.checkPull = n(i.pull, !0), o.checkPut = n(i.put), o.revertClone = i.revertClone, e.group = o;
547
- }, gn = function() {
548
- !mn && _ && g(_, "display", "none");
549
- }, vn = function() {
550
- !mn && _ && g(_, "display", "");
551
- };
552
- dt && document.addEventListener("click", function(t) {
553
- if (lt)
554
- return t.preventDefault(), t.stopPropagation && t.stopPropagation(), t.stopImmediatePropagation && t.stopImmediatePropagation(), lt = !1, !1;
555
- }, !0);
556
- var Se = function(e) {
557
- if (d) {
558
- e = e.touches ? e.touches[0] : e;
559
- var n = so(e.clientX, e.clientY);
560
- if (n) {
561
- var o = {};
562
- for (var i in e)
563
- e.hasOwnProperty(i) && (o[i] = e[i]);
564
- o.target = o.rootEl = n, o.preventDefault = void 0, o.stopPropagation = void 0, n[Z]._onDragOver(o);
565
- }
566
- }
567
- }, uo = function(e) {
568
- d && d.parentNode[Z]._isOutsideThisEl(e.target);
569
- };
570
- function v(t, e) {
571
- if (!(t && t.nodeType && t.nodeType === 1))
572
- throw "Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));
573
- this.el = t, this.options = e = pe({}, e), t[Z] = this;
574
- var n = {
575
- group: null,
576
- sort: !0,
577
- disabled: !1,
578
- store: null,
579
- handle: null,
580
- draggable: /^[uo]l$/i.test(t.nodeName) ? ">li" : ">*",
581
- swapThreshold: 1,
582
- // percentage; 0 <= x <= 1
583
- invertSwap: !1,
584
- // invert always
585
- invertedSwapThreshold: null,
586
- // will be set to same as swapThreshold if default
587
- removeCloneOnHide: !0,
588
- direction: function() {
589
- return pn(t, this.options);
590
- },
591
- ghostClass: "sortable-ghost",
592
- chosenClass: "sortable-chosen",
593
- dragClass: "sortable-drag",
594
- ignore: "a, img",
595
- filter: null,
596
- preventOnFilter: !0,
597
- animation: 0,
598
- easing: null,
599
- setData: function(a, u) {
600
- a.setData("Text", u.textContent);
601
- },
602
- dropBubble: !1,
603
- dragoverBubble: !1,
604
- dataIdAttr: "data-id",
605
- delay: 0,
606
- delayOnTouchOnly: !1,
607
- touchStartThreshold: (Number.parseInt ? Number : window).parseInt(window.devicePixelRatio, 10) || 1,
608
- forceFallback: !1,
609
- fallbackClass: "sortable-fallback",
610
- fallbackOnBody: !1,
611
- fallbackTolerance: 0,
612
- fallbackOffset: {
613
- x: 0,
614
- y: 0
615
- },
616
- supportPointer: v.supportPointer !== !1 && "PointerEvent" in window && !Xe,
617
- emptyInsertThreshold: 5
618
- };
619
- Ke.initializePlugins(this, t, n);
620
- for (var o in n)
621
- !(o in e) && (e[o] = n[o]);
622
- hn(e);
623
- for (var i in this)
624
- i.charAt(0) === "_" && typeof this[i] == "function" && (this[i] = this[i].bind(this));
625
- this.nativeDraggable = e.forceFallback ? !1 : ao, this.nativeDraggable && (this.options.touchStartThreshold = 1), e.supportPointer ? D(t, "pointerdown", this._onTapStart) : (D(t, "mousedown", this._onTapStart), D(t, "touchstart", this._onTapStart)), this.nativeDraggable && (D(t, "dragover", this), D(t, "dragenter", this)), st.push(this.el), e.store && e.store.get && this.sort(e.store.get(this) || []), pe(this, to());
626
- }
627
- v.prototype = /** @lends Sortable.prototype */
628
- {
629
- constructor: v,
630
- _isOutsideThisEl: function(e) {
631
- !this.el.contains(e) && e !== this.el && (Ie = null);
632
- },
633
- _getDirection: function(e, n) {
634
- return typeof this.options.direction == "function" ? this.options.direction.call(this, e, n, d) : this.options.direction;
635
- },
636
- _onTapStart: function(e) {
637
- if (e.cancelable) {
638
- var n = this, o = this.el, i = this.options, r = i.preventOnFilter, a = e.type, u = e.touches && e.touches[0] || e.pointerType && e.pointerType === "touch" && e, l = (u || e).target, c = e.target.shadowRoot && (e.path && e.path[0] || e.composedPath && e.composedPath()[0]) || l, s = i.filter;
639
- if (bo(o), !d && !(/mousedown|pointerdown/.test(a) && e.button !== 0 || i.disabled) && !c.isContentEditable && !(!this.nativeDraggable && Xe && l && l.tagName.toUpperCase() === "SELECT") && (l = re(l, i.draggable, o, !1), !(l && l.animated) && nt !== l)) {
640
- if (Ne = oe(l), We = oe(l, i.draggable), typeof s == "function") {
641
- if (s.call(this, e, l, this)) {
642
- G({
643
- sortable: n,
644
- rootEl: c,
645
- name: "filter",
646
- targetEl: l,
647
- toEl: o,
648
- fromEl: o
649
- }), q("filter", n, {
650
- evt: e
651
- }), r && e.cancelable && e.preventDefault();
652
- return;
653
- }
654
- } else if (s && (s = s.split(",").some(function(f) {
655
- if (f = re(c, f.trim(), o, !1), f)
656
- return G({
657
- sortable: n,
658
- rootEl: f,
659
- name: "filter",
660
- targetEl: l,
661
- fromEl: o,
662
- toEl: o
663
- }), q("filter", n, {
664
- evt: e
665
- }), !0;
666
- }), s)) {
667
- r && e.cancelable && e.preventDefault();
668
- return;
669
- }
670
- i.handle && !re(c, i.handle, o, !1) || this._prepareDragStart(e, u, l);
671
- }
672
- }
673
- },
674
- _prepareDragStart: function(e, n, o) {
675
- var i = this, r = i.el, a = i.options, u = r.ownerDocument, l;
676
- if (o && !d && o.parentNode === r) {
677
- var c = P(o);
678
- if (T = r, d = o, O = d.parentNode, Te = d.nextSibling, nt = o, Je = a.group, v.dragged = d, Ee = {
679
- target: d,
680
- clientX: (n || e).clientX,
681
- clientY: (n || e).clientY
682
- }, zt = Ee.clientX - c.left, Gt = Ee.clientY - c.top, this._lastX = (n || e).clientX, this._lastY = (n || e).clientY, d.style["will-change"] = "all", l = function() {
683
- if (q("delayEnded", i, {
684
- evt: e
685
- }), v.eventCanceled) {
686
- i._onDrop();
687
- return;
688
- }
689
- i._disableDelayedDragEvents(), !Wt && i.nativeDraggable && (d.draggable = !0), i._triggerDragStart(e, n), G({
690
- sortable: i,
691
- name: "choose",
692
- originalEvent: e
693
- }), K(d, a.chosenClass, !0);
694
- }, a.ignore.split(",").forEach(function(s) {
695
- un(d, s.trim(), _t);
696
- }), D(u, "dragover", Se), D(u, "mousemove", Se), D(u, "touchmove", Se), D(u, "mouseup", i._onDrop), D(u, "touchend", i._onDrop), D(u, "touchcancel", i._onDrop), Wt && this.nativeDraggable && (this.options.touchStartThreshold = 4, d.draggable = !0), q("delayStart", this, {
697
- evt: e
698
- }), a.delay && (!a.delayOnTouchOnly || n) && (!this.nativeDraggable || !(qe || he))) {
699
- if (v.eventCanceled) {
700
- this._onDrop();
701
- return;
702
- }
703
- D(u, "mouseup", i._disableDelayedDrag), D(u, "touchend", i._disableDelayedDrag), D(u, "touchcancel", i._disableDelayedDrag), D(u, "mousemove", i._delayedDragTouchMoveHandler), D(u, "touchmove", i._delayedDragTouchMoveHandler), a.supportPointer && D(u, "pointermove", i._delayedDragTouchMoveHandler), i._dragStartTimer = setTimeout(l, a.delay);
704
- } else
705
- l();
706
- }
707
- },
708
- _delayedDragTouchMoveHandler: function(e) {
709
- var n = e.touches ? e.touches[0] : e;
710
- Math.max(Math.abs(n.clientX - this._lastX), Math.abs(n.clientY - this._lastY)) >= Math.floor(this.options.touchStartThreshold / (this.nativeDraggable && window.devicePixelRatio || 1)) && this._disableDelayedDrag();
711
- },
712
- _disableDelayedDrag: function() {
713
- d && _t(d), clearTimeout(this._dragStartTimer), this._disableDelayedDragEvents();
714
- },
715
- _disableDelayedDragEvents: function() {
716
- var e = this.el.ownerDocument;
717
- S(e, "mouseup", this._disableDelayedDrag), S(e, "touchend", this._disableDelayedDrag), S(e, "touchcancel", this._disableDelayedDrag), S(e, "mousemove", this._delayedDragTouchMoveHandler), S(e, "touchmove", this._delayedDragTouchMoveHandler), S(e, "pointermove", this._delayedDragTouchMoveHandler);
718
- },
719
- _triggerDragStart: function(e, n) {
720
- n = n || e.pointerType == "touch" && e, !this.nativeDraggable || n ? this.options.supportPointer ? D(document, "pointermove", this._onTouchMove) : n ? D(document, "touchmove", this._onTouchMove) : D(document, "mousemove", this._onTouchMove) : (D(d, "dragend", this), D(T, "dragstart", this._onDragStart));
721
- try {
722
- document.selection ? it(function() {
723
- document.selection.empty();
724
- }) : window.getSelection().removeAllRanges();
725
- } catch {
726
- }
727
- },
728
- _dragStarted: function(e, n) {
729
- if (ke = !1, T && d) {
730
- q("dragStarted", this, {
731
- evt: n
732
- }), this.nativeDraggable && D(document, "dragover", uo);
733
- var o = this.options;
734
- !e && K(d, o.dragClass, !1), K(d, o.ghostClass, !0), v.active = this, e && this._appendGhost(), G({
735
- sortable: this,
736
- name: "start",
737
- originalEvent: n
738
- });
739
- } else
740
- this._nulling();
741
- },
742
- _emulateDragOver: function() {
743
- if (ie) {
744
- this._lastX = ie.clientX, this._lastY = ie.clientY, gn();
745
- for (var e = document.elementFromPoint(ie.clientX, ie.clientY), n = e; e && e.shadowRoot && (e = e.shadowRoot.elementFromPoint(ie.clientX, ie.clientY), e !== n); )
746
- n = e;
747
- if (d.parentNode[Z]._isOutsideThisEl(e), n)
748
- do {
749
- if (n[Z]) {
750
- var o = void 0;
751
- if (o = n[Z]._onDragOver({
752
- clientX: ie.clientX,
753
- clientY: ie.clientY,
754
- target: e,
755
- rootEl: n
756
- }), o && !this.options.dragoverBubble)
757
- break;
758
- }
759
- e = n;
760
- } while (n = n.parentNode);
761
- vn();
762
- }
763
- },
764
- _onTouchMove: function(e) {
765
- if (Ee) {
766
- var n = this.options, o = n.fallbackTolerance, i = n.fallbackOffset, r = e.touches ? e.touches[0] : e, a = _ && Ve(_, !0), u = _ && a && a.a, l = _ && a && a.d, c = Qe && U && Ht(U), s = (r.clientX - Ee.clientX + i.x) / (u || 1) + (c ? c[0] - yt[0] : 0) / (u || 1), f = (r.clientY - Ee.clientY + i.y) / (l || 1) + (c ? c[1] - yt[1] : 0) / (l || 1);
767
- if (!v.active && !ke) {
768
- if (o && Math.max(Math.abs(r.clientX - this._lastX), Math.abs(r.clientY - this._lastY)) < o)
769
- return;
770
- this._onDragStart(e, !0);
771
- }
772
- if (_) {
773
- a ? (a.e += s - (vt || 0), a.f += f - (bt || 0)) : a = {
774
- a: 1,
775
- b: 0,
776
- c: 0,
777
- d: 1,
778
- e: s,
779
- f
780
- };
781
- var h = "matrix(".concat(a.a, ",").concat(a.b, ",").concat(a.c, ",").concat(a.d, ",").concat(a.e, ",").concat(a.f, ")");
782
- g(_, "webkitTransform", h), g(_, "mozTransform", h), g(_, "msTransform", h), g(_, "transform", h), vt = s, bt = f, ie = r;
783
- }
784
- e.cancelable && e.preventDefault();
785
- }
786
- },
787
- _appendGhost: function() {
788
- if (!_) {
789
- var e = this.options.fallbackOnBody ? document.body : T, n = P(d, !0, Qe, !0, e), o = this.options;
790
- if (Qe) {
791
- for (U = e; g(U, "position") === "static" && g(U, "transform") === "none" && U !== document; )
792
- U = U.parentNode;
793
- U !== document.body && U !== document.documentElement ? (U === document && (U = le()), n.top += U.scrollTop, n.left += U.scrollLeft) : U = le(), yt = Ht(U);
794
- }
795
- _ = d.cloneNode(!0), K(_, o.ghostClass, !1), K(_, o.fallbackClass, !0), K(_, o.dragClass, !0), g(_, "transition", ""), g(_, "transform", ""), g(_, "box-sizing", "border-box"), g(_, "margin", 0), g(_, "top", n.top), g(_, "left", n.left), g(_, "width", n.width), g(_, "height", n.height), g(_, "opacity", "0.8"), g(_, "position", Qe ? "absolute" : "fixed"), g(_, "zIndex", "100000"), g(_, "pointerEvents", "none"), v.ghost = _, e.appendChild(_), g(_, "transform-origin", zt / parseInt(_.style.width) * 100 + "% " + Gt / parseInt(_.style.height) * 100 + "%");
796
- }
797
- },
798
- _onDragStart: function(e, n) {
799
- var o = this, i = e.dataTransfer, r = o.options;
800
- if (q("dragStart", this, {
801
- evt: e
802
- }), v.eventCanceled) {
803
- this._onDrop();
804
- return;
805
- }
806
- q("setupClone", this), v.eventCanceled || (I = fn(d), I.draggable = !1, I.style["will-change"] = "", this._hideClone(), K(I, this.options.chosenClass, !1), v.clone = I), o.cloneId = it(function() {
807
- q("clone", o), !v.eventCanceled && (o.options.removeCloneOnHide || T.insertBefore(I, d), o._hideClone(), G({
808
- sortable: o,
809
- name: "clone"
810
- }));
811
- }), !n && K(d, r.dragClass, !0), n ? (lt = !0, o._loopId = setInterval(o._emulateDragOver, 50)) : (S(document, "mouseup", o._onDrop), S(document, "touchend", o._onDrop), S(document, "touchcancel", o._onDrop), i && (i.effectAllowed = "move", r.setData && r.setData.call(o, i, d)), D(document, "drop", o), g(d, "transform", "translateZ(0)")), ke = !0, o._dragStartId = it(o._dragStarted.bind(o, n, e)), D(document, "selectstart", o), $e = !0, Xe && g(document.body, "user-select", "none");
812
- },
813
- // Returns true - if no further action is needed (either inserted or another condition)
814
- _onDragOver: function(e) {
815
- var n = this.el, o = e.target, i, r, a, u = this.options, l = u.group, c = v.active, s = Je === l, f = u.sort, h = $ || c, w, b = this, y = !1;
816
- if (xt) return;
817
- function B(ce, ft) {
818
- q(ce, b, se({
819
- evt: e,
820
- isOwner: s,
821
- axis: w ? "vertical" : "horizontal",
822
- revert: a,
823
- dragRect: i,
824
- targetRect: r,
825
- canSort: f,
826
- fromSortable: h,
827
- target: o,
828
- completed: x,
829
- onMove: function(de, we) {
830
- return et(T, n, d, i, de, P(de), e, we);
831
- },
832
- changed: A
833
- }, ft));
834
- }
835
- function R() {
836
- B("dragOverAnimationCapture"), b.captureAnimationState(), b !== h && h.captureAnimationState();
837
- }
838
- function x(ce) {
839
- return B("dragOverCompleted", {
840
- insertion: ce
841
- }), ce && (s ? c._hideClone() : c._showClone(b), b !== h && (K(d, $ ? $.options.ghostClass : c.options.ghostClass, !1), K(d, u.ghostClass, !0)), $ !== b && b !== v.active ? $ = b : b === v.active && $ && ($ = null), h === b && (b._ignoreWhileAnimating = o), b.animateAll(function() {
842
- B("dragOverAnimationComplete"), b._ignoreWhileAnimating = null;
843
- }), b !== h && (h.animateAll(), h._ignoreWhileAnimating = null)), (o === d && !d.animated || o === n && !o.animated) && (Ie = null), !u.dragoverBubble && !e.rootEl && o !== document && (d.parentNode[Z]._isOutsideThisEl(e.target), !ce && Se(e)), !u.dragoverBubble && e.stopPropagation && e.stopPropagation(), y = !0;
844
- }
845
- function A() {
846
- J = oe(d), ge = oe(d, u.draggable), G({
847
- sortable: b,
848
- name: "change",
849
- toEl: n,
850
- newIndex: J,
851
- newDraggableIndex: ge,
852
- originalEvent: e
853
- });
854
- }
855
- if (e.preventDefault !== void 0 && e.cancelable && e.preventDefault(), o = re(o, u.draggable, n, !0), B("dragOver"), v.eventCanceled) return y;
856
- if (d.contains(e.target) || o.animated && o.animatingX && o.animatingY || b._ignoreWhileAnimating === o)
857
- return x(!1);
858
- if (lt = !1, c && !u.disabled && (s ? f || (a = O !== T) : $ === this || (this.lastPutMode = Je.checkPull(this, c, d, e)) && l.checkPut(this, c, d, e))) {
859
- if (w = this._getDirection(e, o) === "vertical", i = P(d), B("dragOverValid"), v.eventCanceled) return y;
860
- if (a)
861
- return O = T, R(), this._hideClone(), B("revert"), v.eventCanceled || (Te ? T.insertBefore(d, Te) : T.appendChild(d)), x(!0);
862
- var j = Vt(n, u.draggable);
863
- if (!j || po(e, w, this) && !j.animated) {
864
- if (j === d)
865
- return x(!1);
866
- if (j && n === e.target && (o = j), o && (r = P(o)), et(T, n, d, i, o, r, e, !!o) !== !1)
867
- return R(), n.appendChild(d), O = n, A(), x(!0);
868
- } else if (j && mo(e, w, this)) {
869
- var X = Me(n, 0, u, !0);
870
- if (X === d)
871
- return x(!1);
872
- if (o = X, r = P(o), et(T, n, d, i, o, r, e, !1) !== !1)
873
- return R(), n.insertBefore(d, X), O = n, A(), x(!0);
874
- } else if (o.parentNode === n) {
875
- r = P(o);
876
- var ee = 0, ue, _e = d.parentNode !== n, H = !lo(d.animated && d.toRect || i, o.animated && o.toRect || r, w), m = w ? "top" : "left", p = jt(o, "top", "top") || jt(d, "top", "top"), E = p ? p.scrollTop : void 0;
877
- Ie !== o && (ue = r[m], je = !1, Ze = !H && u.invertSwap || _e), ee = ho(e, o, r, w, H ? 1 : u.swapThreshold, u.invertedSwapThreshold == null ? u.swapThreshold : u.invertedSwapThreshold, Ze, Ie === o);
878
- var C;
879
- if (ee !== 0) {
880
- var z = oe(d);
881
- do
882
- z -= ee, C = O.children[z];
883
- while (C && (g(C, "display") === "none" || C === _));
884
- }
885
- if (ee === 0 || C === o)
886
- return x(!1);
887
- Ie = o, Ue = ee;
888
- var te = o.nextElementSibling, ne = !1;
889
- ne = ee === 1;
890
- var Y = et(T, n, d, i, o, r, e, ne);
891
- if (Y !== !1)
892
- return (Y === 1 || Y === -1) && (ne = Y === 1), xt = !0, setTimeout(fo, 30), R(), ne && !te ? n.appendChild(d) : o.parentNode.insertBefore(d, ne ? te : o), p && dn(p, 0, E - p.scrollTop), O = d.parentNode, ue !== void 0 && !Ze && (ot = Math.abs(ue - P(o)[m])), A(), x(!0);
893
- }
894
- if (n.contains(d))
895
- return x(!1);
896
- }
897
- return !1;
898
- },
899
- _ignoreWhileAnimating: null,
900
- _offMoveEvents: function() {
901
- S(document, "mousemove", this._onTouchMove), S(document, "touchmove", this._onTouchMove), S(document, "pointermove", this._onTouchMove), S(document, "dragover", Se), S(document, "mousemove", Se), S(document, "touchmove", Se);
902
- },
903
- _offUpEvents: function() {
904
- var e = this.el.ownerDocument;
905
- S(e, "mouseup", this._onDrop), S(e, "touchend", this._onDrop), S(e, "pointerup", this._onDrop), S(e, "touchcancel", this._onDrop), S(document, "selectstart", this);
906
- },
907
- _onDrop: function(e) {
908
- var n = this.el, o = this.options;
909
- if (J = oe(d), ge = oe(d, o.draggable), q("drop", this, {
910
- evt: e
911
- }), O = d && d.parentNode, J = oe(d), ge = oe(d, o.draggable), v.eventCanceled) {
912
- this._nulling();
913
- return;
914
- }
915
- ke = !1, Ze = !1, je = !1, clearInterval(this._loopId), clearTimeout(this._dragStartTimer), Ot(this.cloneId), Ot(this._dragStartId), this.nativeDraggable && (S(document, "drop", this), S(n, "dragstart", this._onDragStart)), this._offMoveEvents(), this._offUpEvents(), Xe && g(document.body, "user-select", ""), g(d, "transform", ""), e && ($e && (e.cancelable && e.preventDefault(), !o.dropBubble && e.stopPropagation()), _ && _.parentNode && _.parentNode.removeChild(_), (T === O || $ && $.lastPutMode !== "clone") && I && I.parentNode && I.parentNode.removeChild(I), d && (this.nativeDraggable && S(d, "dragend", this), _t(d), d.style["will-change"] = "", $e && !ke && K(d, $ ? $.options.ghostClass : this.options.ghostClass, !1), K(d, this.options.chosenClass, !1), G({
916
- sortable: this,
917
- name: "unchoose",
918
- toEl: O,
919
- newIndex: null,
920
- newDraggableIndex: null,
921
- originalEvent: e
922
- }), T !== O ? (J >= 0 && (G({
923
- rootEl: O,
924
- name: "add",
925
- toEl: O,
926
- fromEl: T,
927
- originalEvent: e
928
- }), G({
929
- sortable: this,
930
- name: "remove",
931
- toEl: O,
932
- originalEvent: e
933
- }), G({
934
- rootEl: O,
935
- name: "sort",
936
- toEl: O,
937
- fromEl: T,
938
- originalEvent: e
939
- }), G({
940
- sortable: this,
941
- name: "sort",
942
- toEl: O,
943
- originalEvent: e
944
- })), $ && $.save()) : J !== Ne && J >= 0 && (G({
945
- sortable: this,
946
- name: "update",
947
- toEl: O,
948
- originalEvent: e
949
- }), G({
950
- sortable: this,
951
- name: "sort",
952
- toEl: O,
953
- originalEvent: e
954
- })), v.active && ((J == null || J === -1) && (J = Ne, ge = We), G({
955
- sortable: this,
956
- name: "end",
957
- toEl: O,
958
- originalEvent: e
959
- }), this.save()))), this._nulling();
960
- },
961
- _nulling: function() {
962
- q("nulling", this), T = d = O = _ = Te = I = nt = be = Ee = ie = $e = J = ge = Ne = We = Ie = Ue = $ = Je = v.dragged = v.ghost = v.clone = v.active = null, ut.forEach(function(e) {
963
- e.checked = !0;
964
- }), ut.length = vt = bt = 0;
965
- },
966
- handleEvent: function(e) {
967
- switch (e.type) {
968
- case "drop":
969
- case "dragend":
970
- this._onDrop(e);
971
- break;
972
- case "dragenter":
973
- case "dragover":
974
- d && (this._onDragOver(e), co(e));
975
- break;
976
- case "selectstart":
977
- e.preventDefault();
978
- break;
979
- }
980
- },
981
- /**
982
- * Serializes the item into an array of string.
983
- * @returns {String[]}
984
- */
985
- toArray: function() {
986
- for (var e = [], n, o = this.el.children, i = 0, r = o.length, a = this.options; i < r; i++)
987
- n = o[i], re(n, a.draggable, this.el, !1) && e.push(n.getAttribute(a.dataIdAttr) || vo(n));
988
- return e;
989
- },
990
- /**
991
- * Sorts the elements according to the array.
992
- * @param {String[]} order order of the items
993
- */
994
- sort: function(e, n) {
995
- var o = {}, i = this.el;
996
- this.toArray().forEach(function(r, a) {
997
- var u = i.children[a];
998
- re(u, this.options.draggable, i, !1) && (o[r] = u);
999
- }, this), n && this.captureAnimationState(), e.forEach(function(r) {
1000
- o[r] && (i.removeChild(o[r]), i.appendChild(o[r]));
1001
- }), n && this.animateAll();
1002
- },
1003
- /**
1004
- * Save the current sorting
1005
- */
1006
- save: function() {
1007
- var e = this.options.store;
1008
- e && e.set && e.set(this);
1009
- },
1010
- /**
1011
- * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.
1012
- * @param {HTMLElement} el
1013
- * @param {String} [selector] default: `options.draggable`
1014
- * @returns {HTMLElement|null}
1015
- */
1016
- closest: function(e, n) {
1017
- return re(e, n || this.options.draggable, this.el, !1);
1018
- },
1019
- /**
1020
- * Set/get option
1021
- * @param {string} name
1022
- * @param {*} [value]
1023
- * @returns {*}
1024
- */
1025
- option: function(e, n) {
1026
- var o = this.options;
1027
- if (n === void 0)
1028
- return o[e];
1029
- var i = Ke.modifyOption(this, e, n);
1030
- typeof i < "u" ? o[e] = i : o[e] = n, e === "group" && hn(o);
1031
- },
1032
- /**
1033
- * Destroy
1034
- */
1035
- destroy: function() {
1036
- q("destroy", this);
1037
- var e = this.el;
1038
- e[Z] = null, S(e, "mousedown", this._onTapStart), S(e, "touchstart", this._onTapStart), S(e, "pointerdown", this._onTapStart), this.nativeDraggable && (S(e, "dragover", this), S(e, "dragenter", this)), Array.prototype.forEach.call(e.querySelectorAll("[draggable]"), function(n) {
1039
- n.removeAttribute("draggable");
1040
- }), this._onDrop(), this._disableDelayedDragEvents(), st.splice(st.indexOf(this.el), 1), this.el = e = null;
1041
- },
1042
- _hideClone: function() {
1043
- if (!be) {
1044
- if (q("hideClone", this), v.eventCanceled) return;
1045
- g(I, "display", "none"), this.options.removeCloneOnHide && I.parentNode && I.parentNode.removeChild(I), be = !0;
1046
- }
1047
- },
1048
- _showClone: function(e) {
1049
- if (e.lastPutMode !== "clone") {
1050
- this._hideClone();
1051
- return;
1052
- }
1053
- if (be) {
1054
- if (q("showClone", this), v.eventCanceled) return;
1055
- d.parentNode == T && !this.options.group.revertClone ? T.insertBefore(I, d) : Te ? T.insertBefore(I, Te) : T.appendChild(I), this.options.group.revertClone && this.animate(d, I), g(I, "display", ""), be = !1;
1056
- }
1057
- }
1058
- };
1059
- function co(t) {
1060
- t.dataTransfer && (t.dataTransfer.dropEffect = "move"), t.cancelable && t.preventDefault();
1061
- }
1062
- function et(t, e, n, o, i, r, a, u) {
1063
- var l, c = t[Z], s = c.options.onMove, f;
1064
- return window.CustomEvent && !he && !qe ? l = new CustomEvent("move", {
1065
- bubbles: !0,
1066
- cancelable: !0
1067
- }) : (l = document.createEvent("Event"), l.initEvent("move", !0, !0)), l.to = e, l.from = t, l.dragged = n, l.draggedRect = o, l.related = i || e, l.relatedRect = r || P(e), l.willInsertAfter = u, l.originalEvent = a, t.dispatchEvent(l), s && (f = s.call(c, l, a)), f;
1068
- }
1069
- function _t(t) {
1070
- t.draggable = !1;
1071
- }
1072
- function fo() {
1073
- xt = !1;
1074
- }
1075
- function mo(t, e, n) {
1076
- var o = P(Me(n.el, 0, n.options, !0)), i = 10;
1077
- return e ? t.clientX < o.left - i || t.clientY < o.top && t.clientX < o.right : t.clientY < o.top - i || t.clientY < o.bottom && t.clientX < o.left;
1078
- }
1079
- function po(t, e, n) {
1080
- var o = P(Vt(n.el, n.options.draggable)), i = 10;
1081
- return e ? t.clientX > o.right + i || t.clientX <= o.right && t.clientY > o.bottom && t.clientX >= o.left : t.clientX > o.right && t.clientY > o.top || t.clientX <= o.right && t.clientY > o.bottom + i;
1082
- }
1083
- function ho(t, e, n, o, i, r, a, u) {
1084
- var l = o ? t.clientY : t.clientX, c = o ? n.height : n.width, s = o ? n.top : n.left, f = o ? n.bottom : n.right, h = !1;
1085
- if (!a) {
1086
- if (u && ot < c * i) {
1087
- if (!je && (Ue === 1 ? l > s + c * r / 2 : l < f - c * r / 2) && (je = !0), je)
1088
- h = !0;
1089
- else if (Ue === 1 ? l < s + ot : l > f - ot)
1090
- return -Ue;
1091
- } else if (l > s + c * (1 - i) / 2 && l < f - c * (1 - i) / 2)
1092
- return go(e);
1093
- }
1094
- return h = h || a, h && (l < s + c * r / 2 || l > f - c * r / 2) ? l > s + c / 2 ? 1 : -1 : 0;
1095
- }
1096
- function go(t) {
1097
- return oe(d) < oe(t) ? 1 : -1;
1098
- }
1099
- function vo(t) {
1100
- for (var e = t.tagName + t.className + t.src + t.href + t.textContent, n = e.length, o = 0; n--; )
1101
- o += e.charCodeAt(n);
1102
- return o.toString(36);
1103
- }
1104
- function bo(t) {
1105
- ut.length = 0;
1106
- for (var e = t.getElementsByTagName("input"), n = e.length; n--; ) {
1107
- var o = e[n];
1108
- o.checked && ut.push(o);
1109
- }
1110
- }
1111
- function it(t) {
1112
- return setTimeout(t, 0);
1113
- }
1114
- function Ot(t) {
1115
- return clearTimeout(t);
1116
- }
1117
- dt && D(document, "touchmove", function(t) {
1118
- (v.active || ke) && t.cancelable && t.preventDefault();
1119
- });
1120
- v.utils = {
1121
- on: D,
1122
- off: S,
1123
- css: g,
1124
- find: un,
1125
- is: function(e, n) {
1126
- return !!re(e, n, e, !1);
1127
- },
1128
- extend: Qn,
1129
- throttle: cn,
1130
- closest: re,
1131
- toggleClass: K,
1132
- clone: fn,
1133
- index: oe,
1134
- nextTick: it,
1135
- cancelNextTick: Ot,
1136
- detectDirection: pn,
1137
- getChild: Me
1138
- };
1139
- v.get = function(t) {
1140
- return t[Z];
1141
- };
1142
- v.mount = function() {
1143
- for (var t = arguments.length, e = new Array(t), n = 0; n < t; n++)
1144
- e[n] = arguments[n];
1145
- e[0].constructor === Array && (e = e[0]), e.forEach(function(o) {
1146
- if (!o.prototype || !o.prototype.constructor)
1147
- throw "Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(o));
1148
- o.utils && (v.utils = se(se({}, v.utils), o.utils)), Ke.mount(o);
1149
- });
1150
- };
1151
- v.create = function(t, e) {
1152
- return new v(t, e);
1153
- };
1154
- v.version = qn;
1155
- var F = [], Be, It, Ft = !1, wt, Et, ct, Re;
1156
- function yo() {
1157
- function t() {
1158
- this.defaults = {
1159
- scroll: !0,
1160
- forceAutoScrollFallback: !1,
1161
- scrollSensitivity: 30,
1162
- scrollSpeed: 10,
1163
- bubbleScroll: !0
1164
- };
1165
- for (var e in this)
1166
- e.charAt(0) === "_" && typeof this[e] == "function" && (this[e] = this[e].bind(this));
1167
- }
1168
- return t.prototype = {
1169
- dragStarted: function(n) {
1170
- var o = n.originalEvent;
1171
- this.sortable.nativeDraggable ? D(document, "dragover", this._handleAutoScroll) : this.options.supportPointer ? D(document, "pointermove", this._handleFallbackAutoScroll) : o.touches ? D(document, "touchmove", this._handleFallbackAutoScroll) : D(document, "mousemove", this._handleFallbackAutoScroll);
1172
- },
1173
- dragOverCompleted: function(n) {
1174
- var o = n.originalEvent;
1175
- !this.options.dragOverBubble && !o.rootEl && this._handleAutoScroll(o);
1176
- },
1177
- drop: function() {
1178
- this.sortable.nativeDraggable ? S(document, "dragover", this._handleAutoScroll) : (S(document, "pointermove", this._handleFallbackAutoScroll), S(document, "touchmove", this._handleFallbackAutoScroll), S(document, "mousemove", this._handleFallbackAutoScroll)), Kt(), rt(), eo();
1179
- },
1180
- nulling: function() {
1181
- ct = It = Be = Ft = Re = wt = Et = null, F.length = 0;
1182
- },
1183
- _handleFallbackAutoScroll: function(n) {
1184
- this._handleAutoScroll(n, !0);
1185
- },
1186
- _handleAutoScroll: function(n, o) {
1187
- var i = this, r = (n.touches ? n.touches[0] : n).clientX, a = (n.touches ? n.touches[0] : n).clientY, u = document.elementFromPoint(r, a);
1188
- if (ct = n, o || this.options.forceAutoScrollFallback || qe || he || Xe) {
1189
- St(n, this.options, u, o);
1190
- var l = ye(u, !0);
1191
- Ft && (!Re || r !== wt || a !== Et) && (Re && Kt(), Re = setInterval(function() {
1192
- var c = ye(document.elementFromPoint(r, a), !0);
1193
- c !== l && (l = c, rt()), St(n, i.options, c, o);
1194
- }, 10), wt = r, Et = a);
1195
- } else {
1196
- if (!this.options.bubbleScroll || ye(u, !0) === le()) {
1197
- rt();
1198
- return;
1199
- }
1200
- St(n, this.options, ye(u, !1), !1);
1201
- }
1202
- }
1203
- }, pe(t, {
1204
- pluginName: "scroll",
1205
- initializeByDefault: !0
1206
- });
1207
- }
1208
- function rt() {
1209
- F.forEach(function(t) {
1210
- clearInterval(t.pid);
1211
- }), F = [];
1212
- }
1213
- function Kt() {
1214
- clearInterval(Re);
1215
- }
1216
- var St = cn(function(t, e, n, o) {
1217
- if (e.scroll) {
1218
- var i = (t.touches ? t.touches[0] : t).clientX, r = (t.touches ? t.touches[0] : t).clientY, a = e.scrollSensitivity, u = e.scrollSpeed, l = le(), c = !1, s;
1219
- It !== n && (It = n, rt(), Be = e.scroll, s = e.scrollFn, Be === !0 && (Be = ye(n, !0)));
1220
- var f = 0, h = Be;
1221
- do {
1222
- var w = h, b = P(w), y = b.top, B = b.bottom, R = b.left, x = b.right, A = b.width, j = b.height, X = void 0, ee = void 0, ue = w.scrollWidth, _e = w.scrollHeight, H = g(w), m = w.scrollLeft, p = w.scrollTop;
1223
- w === l ? (X = A < ue && (H.overflowX === "auto" || H.overflowX === "scroll" || H.overflowX === "visible"), ee = j < _e && (H.overflowY === "auto" || H.overflowY === "scroll" || H.overflowY === "visible")) : (X = A < ue && (H.overflowX === "auto" || H.overflowX === "scroll"), ee = j < _e && (H.overflowY === "auto" || H.overflowY === "scroll"));
1224
- var E = X && (Math.abs(x - i) <= a && m + A < ue) - (Math.abs(R - i) <= a && !!m), C = ee && (Math.abs(B - r) <= a && p + j < _e) - (Math.abs(y - r) <= a && !!p);
1225
- if (!F[f])
1226
- for (var z = 0; z <= f; z++)
1227
- F[z] || (F[z] = {});
1228
- (F[f].vx != E || F[f].vy != C || F[f].el !== w) && (F[f].el = w, F[f].vx = E, F[f].vy = C, clearInterval(F[f].pid), (E != 0 || C != 0) && (c = !0, F[f].pid = setInterval((function() {
1229
- o && this.layer === 0 && v.active._onTouchMove(ct);
1230
- var te = F[this.layer].vy ? F[this.layer].vy * u : 0, ne = F[this.layer].vx ? F[this.layer].vx * u : 0;
1231
- typeof s == "function" && s.call(v.dragged.parentNode[Z], ne, te, t, ct, F[this.layer].el) !== "continue" || dn(F[this.layer].el, ne, te);
1232
- }).bind({
1233
- layer: f
1234
- }), 24))), f++;
1235
- } while (e.bubbleScroll && h !== l && (h = ye(h, !1)));
1236
- Ft = c;
1237
- }
1238
- }, 30), bn = function(e) {
1239
- var n = e.originalEvent, o = e.putSortable, i = e.dragEl, r = e.activeSortable, a = e.dispatchSortableEvent, u = e.hideGhostForTarget, l = e.unhideGhostForTarget;
1240
- if (n) {
1241
- var c = o || r;
1242
- u();
1243
- var s = n.changedTouches && n.changedTouches.length ? n.changedTouches[0] : n, f = document.elementFromPoint(s.clientX, s.clientY);
1244
- l(), c && !c.el.contains(f) && (a("spill"), this.onSpill({
1245
- dragEl: i,
1246
- putSortable: o
1247
- }));
1248
- }
1249
- };
1250
- function Mt() {
1251
- }
1252
- Mt.prototype = {
1253
- startIndex: null,
1254
- dragStart: function(e) {
1255
- var n = e.oldDraggableIndex;
1256
- this.startIndex = n;
1257
- },
1258
- onSpill: function(e) {
1259
- var n = e.dragEl, o = e.putSortable;
1260
- this.sortable.captureAnimationState(), o && o.captureAnimationState();
1261
- var i = Me(this.sortable.el, this.startIndex, this.options);
1262
- i ? this.sortable.el.insertBefore(n, i) : this.sortable.el.appendChild(n), this.sortable.animateAll(), o && o.animateAll();
1263
- },
1264
- drop: bn
1265
- };
1266
- pe(Mt, {
1267
- pluginName: "revertOnSpill"
1268
- });
1269
- function Lt() {
1270
- }
1271
- Lt.prototype = {
1272
- onSpill: function(e) {
1273
- var n = e.dragEl, o = e.putSortable, i = o || this.sortable;
1274
- i.captureAnimationState(), n.parentNode && n.parentNode.removeChild(n), i.animateAll();
1275
- },
1276
- drop: bn
1277
- };
1278
- pe(Lt, {
1279
- pluginName: "removeOnSpill"
1280
- });
1281
- v.mount(new yo());
1282
- v.mount(Lt, Mt);
1283
- function Dt(t) {
1284
- t.parentElement !== null && t.parentElement.removeChild(t);
1285
- }
1286
- function Jt(t, e, n) {
1287
- const o = n === 0 ? t.children[0] : t.children[n - 1].nextSibling;
1288
- t.insertBefore(e, o);
1289
- }
1290
- function _o() {
1291
- return typeof window < "u" ? window.console : globalThis.console;
1292
- }
1293
- const wo = _o();
1294
- function Eo(t) {
1295
- const e = /* @__PURE__ */ Object.create(null);
1296
- return function(o) {
1297
- return e[o] || (e[o] = t(o));
1298
- };
1299
- }
1300
- const So = /-(\w)/g, Do = Eo((t) => t.replace(So, (e, n) => n.toUpperCase())), yn = ["Start", "Add", "Remove", "Update", "End"], _n = ["Choose", "Unchoose", "Sort", "Filter", "Clone"], wn = ["Move"], Co = [wn, yn, _n].flatMap((t) => t).map((t) => `on${t}`), kt = {
1301
- manage: wn,
1302
- manageAndEmit: yn,
1303
- emit: _n
1304
- };
1305
- function To(t) {
1306
- return Co.indexOf(t) !== -1;
1307
- }
1308
- const xo = [
1309
- "a",
1310
- "abbr",
1311
- "address",
1312
- "area",
1313
- "article",
1314
- "aside",
1315
- "audio",
1316
- "b",
1317
- "base",
1318
- "bdi",
1319
- "bdo",
1320
- "blockquote",
1321
- "body",
1322
- "br",
1323
- "button",
1324
- "canvas",
1325
- "caption",
1326
- "cite",
1327
- "code",
1328
- "col",
1329
- "colgroup",
1330
- "data",
1331
- "datalist",
1332
- "dd",
1333
- "del",
1334
- "details",
1335
- "dfn",
1336
- "dialog",
1337
- "div",
1338
- "dl",
1339
- "dt",
1340
- "em",
1341
- "embed",
1342
- "fieldset",
1343
- "figcaption",
1344
- "figure",
1345
- "footer",
1346
- "form",
1347
- "h1",
1348
- "h2",
1349
- "h3",
1350
- "h4",
1351
- "h5",
1352
- "h6",
1353
- "head",
1354
- "header",
1355
- "hgroup",
1356
- "hr",
1357
- "html",
1358
- "i",
1359
- "iframe",
1360
- "img",
1361
- "input",
1362
- "ins",
1363
- "kbd",
1364
- "label",
1365
- "legend",
1366
- "li",
1367
- "link",
1368
- "main",
1369
- "map",
1370
- "mark",
1371
- "math",
1372
- "menu",
1373
- "menuitem",
1374
- "meta",
1375
- "meter",
1376
- "nav",
1377
- "noscript",
1378
- "object",
1379
- "ol",
1380
- "optgroup",
1381
- "option",
1382
- "output",
1383
- "p",
1384
- "param",
1385
- "picture",
1386
- "pre",
1387
- "progress",
1388
- "q",
1389
- "rb",
1390
- "rp",
1391
- "rt",
1392
- "rtc",
1393
- "ruby",
1394
- "s",
1395
- "samp",
1396
- "script",
1397
- "section",
1398
- "select",
1399
- "slot",
1400
- "small",
1401
- "source",
1402
- "span",
1403
- "strong",
1404
- "style",
1405
- "sub",
1406
- "summary",
1407
- "sup",
1408
- "svg",
1409
- "table",
1410
- "tbody",
1411
- "td",
1412
- "template",
1413
- "textarea",
1414
- "tfoot",
1415
- "th",
1416
- "thead",
1417
- "time",
1418
- "title",
1419
- "tr",
1420
- "track",
1421
- "u",
1422
- "ul",
1423
- "var",
1424
- "video",
1425
- "wbr"
1426
- ];
1427
- function Oo(t) {
1428
- return xo.includes(t);
1429
- }
1430
- function Io(t) {
1431
- return ["transition-group", "TransitionGroup"].includes(t);
1432
- }
1433
- function En(t) {
1434
- return ["id", "class", "role", "style"].includes(t) || t.startsWith("data-") || t.startsWith("aria-") || t.startsWith("on");
1435
- }
1436
- function Sn(t) {
1437
- return t.reduce((e, [n, o]) => (e[n] = o, e), {});
1438
- }
1439
- function Fo({ $attrs: t, componentData: e = {} }) {
1440
- return {
1441
- ...Sn(
1442
- Object.entries(t).filter(([o, i]) => En(o))
1443
- ),
1444
- ...e
1445
- };
1446
- }
1447
- function ko({ $attrs: t, callBackBuilder: e }) {
1448
- const n = Sn(Dn(t));
1449
- Object.entries(e).forEach(([i, r]) => {
1450
- kt[i].forEach((a) => {
1451
- n[`on${a}`] = r(a);
1452
- });
1453
- });
1454
- const o = `[data-draggable]${n.draggable || ""}`;
1455
- return {
1456
- ...n,
1457
- draggable: o
1458
- };
1459
- }
1460
- function Dn(t) {
1461
- return Object.entries(t).filter(([e, n]) => !En(e)).map(([e, n]) => [Do(e), n]).filter(([e, n]) => !To(e));
1462
- }
1463
- const Zt = ({ el: t }) => t, Ao = (t, e) => t.__draggable_context = e, Qt = (t) => t.__draggable_context;
1464
- class No {
1465
- constructor({
1466
- nodes: { header: e, default: n, footer: o },
1467
- root: i,
1468
- realList: r
1469
- }) {
1470
- this.defaultNodes = n, this.children = [...e, ...n, ...o], this.externalComponent = i.externalComponent, this.rootTransition = i.transition, this.tag = i.tag, this.realList = r;
1471
- }
1472
- get _isRootComponent() {
1473
- return this.externalComponent || this.rootTransition;
1474
- }
1475
- render(e, n) {
1476
- const { tag: o, children: i, _isRootComponent: r } = this;
1477
- return e(o, n, r ? { default: () => i } : i);
1478
- }
1479
- updated() {
1480
- const { defaultNodes: e, realList: n } = this;
1481
- e.forEach((o, i) => {
1482
- Ao(Zt(o), {
1483
- element: n[i],
1484
- index: i
1485
- });
1486
- });
1487
- }
1488
- getUnderlyingVm(e) {
1489
- return Qt(e);
1490
- }
1491
- getVmIndexFromDomIndex(e, n) {
1492
- const { defaultNodes: o } = this, { length: i } = o, r = n.children, a = r.item(e);
1493
- if (a === null)
1494
- return i;
1495
- const u = Qt(a);
1496
- if (u)
1497
- return u.index;
1498
- if (i === 0)
1499
- return 0;
1500
- const l = Zt(o[0]), c = [...r].findIndex(
1501
- (s) => s === l
1502
- );
1503
- return e < c ? 0 : i;
1504
- }
1505
- }
1506
- function Po(t, e) {
1507
- const n = t[e];
1508
- return n ? n() : [];
1509
- }
1510
- function Vo({ $slots: t, realList: e, getKey: n }) {
1511
- const o = e || [], [i, r] = ["header", "footer"].map(
1512
- (l) => Po(t, l)
1513
- ), { item: a } = t;
1514
- if (!a)
1515
- throw new Error("draggable element must have an item slot");
1516
- const u = o.flatMap(
1517
- (l, c) => a({ element: l, index: c }).map((s) => (s.key = n(l), s.props = { ...s.props || {}, "data-draggable": !0 }, s))
1518
- );
1519
- if (u.length !== o.length)
1520
- throw new Error("Item slot must have only one child");
1521
- return {
1522
- header: i,
1523
- footer: r,
1524
- default: u
1525
- };
1526
- }
1527
- function Mo(t) {
1528
- const e = Io(t), n = !Oo(t) && !e;
1529
- return {
1530
- transition: e,
1531
- externalComponent: n,
1532
- tag: n ? N(t) : e ? kn : t
1533
- };
1534
- }
1535
- function Lo({ $slots: t, tag: e, realList: n, getKey: o }) {
1536
- const i = Vo({ $slots: t, realList: n, getKey: o }), r = Mo(e);
1537
- return new No({ nodes: i, root: r, realList: n });
1538
- }
1539
- function Cn(t, e) {
1540
- en(() => this.$emit(t.toLowerCase(), e));
1541
- }
1542
- function Tn(t) {
1543
- return (e, n) => {
1544
- if (this.realList !== null)
1545
- return this[`onDrag${t}`](e, n);
1546
- };
1547
- }
1548
- function $o(t) {
1549
- const e = Tn.call(this, t);
1550
- return (n, o) => {
1551
- e.call(this, n, o), Cn.call(this, t, n);
1552
- };
1553
- }
1554
- let Ct = null;
1555
- const Bo = {
1556
- list: {
1557
- type: Array,
1558
- required: !1,
1559
- default: null
1560
- },
1561
- modelValue: {
1562
- type: Array,
1563
- required: !1,
1564
- default: null
1565
- },
1566
- itemKey: {
1567
- type: [String, Function],
1568
- required: !0
1569
- },
1570
- clone: {
1571
- type: Function,
1572
- default: (t) => t
1573
- },
1574
- tag: {
1575
- type: String,
1576
- default: "div"
1577
- },
1578
- move: {
1579
- type: Function,
1580
- default: null
1581
- },
1582
- componentData: {
1583
- type: Object,
1584
- required: !1,
1585
- default: null
1586
- }
1587
- }, Ro = [
1588
- "update:modelValue",
1589
- "change",
1590
- ...[...kt.manageAndEmit, ...kt.emit].map((t) => t.toLowerCase())
1591
- ], Xo = xe({
1592
- name: "draggable",
1593
- inheritAttrs: !1,
1594
- props: Bo,
1595
- emits: Ro,
1596
- data() {
1597
- return {
1598
- error: !1
1599
- };
1600
- },
1601
- render() {
1602
- try {
1603
- this.error = !1;
1604
- const { $slots: t, $attrs: e, tag: n, componentData: o, realList: i, getKey: r } = this, a = Lo({
1605
- $slots: t,
1606
- tag: n,
1607
- realList: i,
1608
- getKey: r
1609
- });
1610
- this.componentStructure = a;
1611
- const u = Fo({ $attrs: e, componentData: o });
1612
- return a.render(Bt, u);
1613
- } catch (t) {
1614
- return this.error = !0, Bt("pre", { style: { color: "red" } }, t.stack);
1615
- }
1616
- },
1617
- created() {
1618
- this.list !== null && this.modelValue !== null && wo.error(
1619
- "modelValue and list props are mutually exclusive! Please set one or another."
1620
- );
1621
- },
1622
- mounted() {
1623
- if (this.error)
1624
- return;
1625
- const { $attrs: t, $el: e, componentStructure: n } = this;
1626
- n.updated();
1627
- const o = ko({
1628
- $attrs: t,
1629
- callBackBuilder: {
1630
- manageAndEmit: (r) => $o.call(this, r),
1631
- emit: (r) => Cn.bind(this, r),
1632
- manage: (r) => Tn.call(this, r)
1633
- }
1634
- }), i = e.nodeType === 1 ? e : e.parentElement;
1635
- this._sortable = new v(i, o), this.targetDomElement = i, i.__draggable_component__ = this;
1636
- },
1637
- updated() {
1638
- this.componentStructure.updated();
1639
- },
1640
- beforeUnmount() {
1641
- this._sortable !== void 0 && this._sortable.destroy();
1642
- },
1643
- computed: {
1644
- realList() {
1645
- const { list: t } = this;
1646
- return t || this.modelValue;
1647
- },
1648
- getKey() {
1649
- const { itemKey: t } = this;
1650
- return typeof t == "function" ? t : (e) => e[t];
1651
- }
1652
- },
1653
- watch: {
1654
- $attrs: {
1655
- handler(t) {
1656
- const { _sortable: e } = this;
1657
- e && Dn(t).forEach(([n, o]) => {
1658
- e.option(n, o);
1659
- });
1660
- },
1661
- deep: !0
1662
- }
1663
- },
1664
- methods: {
1665
- getUnderlyingVm(t) {
1666
- return this.componentStructure.getUnderlyingVm(t) || null;
1667
- },
1668
- getUnderlyingPotencialDraggableComponent(t) {
1669
- return t.__draggable_component__;
1670
- },
1671
- emitChanges(t) {
1672
- en(() => this.$emit("change", t));
1673
- },
1674
- alterList(t) {
1675
- if (this.list) {
1676
- t(this.list);
1677
- return;
1678
- }
1679
- const e = [...this.modelValue];
1680
- t(e), this.$emit("update:modelValue", e);
1681
- },
1682
- spliceList() {
1683
- const t = (e) => e.splice(...arguments);
1684
- this.alterList(t);
1685
- },
1686
- updatePosition(t, e) {
1687
- const n = (o) => o.splice(e, 0, o.splice(t, 1)[0]);
1688
- this.alterList(n);
1689
- },
1690
- getRelatedContextFromMoveEvent({ to: t, related: e }) {
1691
- const n = this.getUnderlyingPotencialDraggableComponent(t);
1692
- if (!n)
1693
- return { component: n };
1694
- const o = n.realList, i = { list: o, component: n };
1695
- return t !== e && o ? { ...n.getUnderlyingVm(e) || {}, ...i } : i;
1696
- },
1697
- getVmIndexFromDomIndex(t) {
1698
- return this.componentStructure.getVmIndexFromDomIndex(
1699
- t,
1700
- this.targetDomElement
1701
- );
1702
- },
1703
- onDragStart(t) {
1704
- this.context = this.getUnderlyingVm(t.item), t.item._underlying_vm_ = this.clone(this.context.element), Ct = t.item;
1705
- },
1706
- onDragAdd(t) {
1707
- const e = t.item._underlying_vm_;
1708
- if (e === void 0)
1709
- return;
1710
- Dt(t.item);
1711
- const n = this.getVmIndexFromDomIndex(t.newIndex);
1712
- this.spliceList(n, 0, e);
1713
- const o = { element: e, newIndex: n };
1714
- this.emitChanges({ added: o });
1715
- },
1716
- onDragRemove(t) {
1717
- if (Jt(this.$el, t.item, t.oldIndex), t.pullMode === "clone") {
1718
- Dt(t.clone);
1719
- return;
1720
- }
1721
- const { index: e, element: n } = this.context;
1722
- this.spliceList(e, 1);
1723
- const o = { element: n, oldIndex: e };
1724
- this.emitChanges({ removed: o });
1725
- },
1726
- onDragUpdate(t) {
1727
- Dt(t.item), Jt(t.from, t.item, t.oldIndex);
1728
- const e = this.context.index, n = this.getVmIndexFromDomIndex(t.newIndex);
1729
- this.updatePosition(e, n);
1730
- const o = { element: this.context.element, oldIndex: e, newIndex: n };
1731
- this.emitChanges({ moved: o });
1732
- },
1733
- computeFutureIndex(t, e) {
1734
- if (!t.element)
1735
- return 0;
1736
- const n = [...e.to.children].filter(
1737
- (a) => a.style.display !== "none"
1738
- ), o = n.indexOf(e.related), i = t.component.getVmIndexFromDomIndex(
1739
- o
1740
- );
1741
- return n.indexOf(Ct) !== -1 || !e.willInsertAfter ? i : i + 1;
1742
- },
1743
- onDragMove(t, e) {
1744
- const { move: n, realList: o } = this;
1745
- if (!n || !o)
1746
- return !0;
1747
- const i = this.getRelatedContextFromMoveEvent(t), r = this.computeFutureIndex(i, t), a = {
1748
- ...this.context,
1749
- futureIndex: r
1750
- }, u = {
1751
- ...t,
1752
- relatedContext: i,
1753
- draggedContext: a
1754
- };
1755
- return n(u, e);
1756
- },
1757
- onDragEnd() {
1758
- Ct = null;
1759
- }
1760
- }
1761
- }), Yo = Object.entries(L).map((t) => {
1762
- let e = "";
1763
- switch (t[1]) {
1764
- case L.BarChart:
1765
- e = "bar_chart";
1766
- break;
1767
- case L.Table:
1768
- e = "table";
1769
- break;
1770
- case L.Circular:
1771
- e = "pie_chart";
1772
- break;
1773
- case L.LineChart:
1774
- e = "show_chart";
1775
- break;
1776
- case L.Scorecard:
1777
- e = "money";
1778
- break;
1779
- case L.Spacer:
1780
- e = "space_bar";
1781
- break;
1782
- case L.StackBarChart:
1783
- e = "stacked_bar_chart";
1784
- break;
1785
- case L.StackLineChart:
1786
- e = "stacked_line_chart";
1787
- break;
1788
- }
1789
- return {
1790
- label: Pn(t[0]),
1791
- icon: e,
1792
- value: t[1]
1793
- };
1794
- }), Wo = /* @__PURE__ */ xe({
1795
- __name: "WidgetTypeList",
1796
- props: /* @__PURE__ */ At({
1797
- childClass: {
1798
- type: String,
1799
- default: ""
1800
- },
1801
- excludeWidgeType: {
1802
- type: Array,
1803
- default: () => []
1804
- },
1805
- isList: {
1806
- type: Boolean,
1807
- required: !1,
1808
- default: !1
1809
- }
1810
- }, {
1811
- modelValue: {
1812
- default: ""
1813
- },
1814
- modelModifiers: {}
1815
- }),
1816
- emits: ["update:modelValue"],
1817
- setup(t) {
1818
- const { t: e } = Nt(), n = ze(t, "modelValue"), o = t, i = Fe(
1819
- () => Yo.map((r) => ({
1820
- ...r,
1821
- label: e(`report.widget.types.${r.value.toLowerCase()}`)
1822
- }))
1823
- );
1824
- return (r, a) => {
1825
- const u = N("FmIcon"), l = N("FmCard");
1826
- return V(), Q("div", null, [
1827
- (V(!0), Q(Ge, null, tn(i.value.filter(
1828
- (c) => o.excludeWidgeType.indexOf(c.value) === -1
1829
- ), (c, s) => (V(), Pe(l, {
1830
- key: s,
1831
- class: An(`items-center ${o.childClass} cursor-pointer rounded-[8px] ${o.isList ? "" : "gap-[16px]"} ${n.value === c.value ? "selected-widget" : ""}`),
1832
- variant: "outlined",
1833
- onClick: (f) => n.value = c.value
1834
- }, {
1835
- default: ae(() => [
1836
- k(u, {
1837
- name: c.icon,
1838
- size: o.isList ? "md" : "lg",
1839
- outline: !0
1840
- }, null, 8, ["name", "size"]),
1841
- nn(" " + Ae(c.label), 1)
1842
- ]),
1843
- _: 2
1844
- }, 1032, ["class", "onClick"]))), 128))
1845
- ]);
1846
- };
1847
- }
1848
- }), hi = /* @__PURE__ */ Pt(Wo, [["__scopeId", "data-v-7c1916a3"]]);
1849
- function Uo(t) {
1850
- let e, n, o;
1851
- switch (t) {
1852
- case L.Table:
1853
- e = [], n = !1, o = Rn.top;
1854
- break;
1855
- }
1856
- return {
1857
- schemaNames: [],
1858
- dimensions: [],
1859
- metrics: [],
1860
- filters: [],
1861
- sorts: [],
1862
- breakdownDimension: void 0,
1863
- sparklineDimension: void 0,
1864
- limit: null,
1865
- showGrandTotal: !1,
1866
- rollupPosition: o,
1867
- showSearchBar: n,
1868
- isTransposed: !1,
1869
- isDrillable: !1,
1870
- columnIds: [],
1871
- rowIds: [],
1872
- joinDatasources: e
1873
- };
1874
- }
1875
- function gi(t, e) {
1876
- let n = 1, o = 1;
1877
- switch (t) {
1878
- case L.Scorecard:
1879
- n = 1, o = 2;
1880
- break;
1881
- case L.BarChart:
1882
- case L.StackBarChart:
1883
- case L.LineChart:
1884
- case L.StackLineChart:
1885
- n = 4, o = 6;
1886
- break;
1887
- case L.Table:
1888
- n = 4, o = 12;
1889
- break;
1890
- case L.Circular:
1891
- n = 4, o = 4;
1892
- break;
1893
- case L.Spacer:
1894
- n = 0, o = 12;
1895
- break;
1896
- }
1897
- return {
1898
- size: {
1899
- width: o,
1900
- height: n
1901
- },
1902
- widget: {
1903
- title: e || "New widget",
1904
- type: t,
1905
- config: Uo(t)
1906
- }
1907
- };
1908
- }
1909
- function vi(t, e) {
1910
- return t.filter((n, o) => o !== e);
1911
- }
1912
- const jo = {
1913
- key: 0,
1914
- class: "flex flex-col gap-5"
1915
- }, Ho = /* @__PURE__ */ xe({
1916
- __name: "Section",
1917
- props: {
1918
- isOpen: { type: Boolean, default: !0 },
1919
- isOpenModifiers: {}
1920
- },
1921
- emits: ["update:isOpen"],
1922
- setup(t) {
1923
- const e = ze(t, "isOpen");
1924
- return (n, o) => {
1925
- const i = N("FmIcon"), r = N("FmMenuDivider");
1926
- return V(), Q(Ge, null, [
1927
- ve("div", {
1928
- class: "flex items-center cursor-pointer fm-typo-en-body-lg-600",
1929
- onClick: o[0] || (o[0] = (a) => e.value = !e.value)
1930
- }, [
1931
- He(n.$slots, "header", {}, void 0, !0),
1932
- k(i, {
1933
- name: e.value ? "keyboard_arrow_up" : "keyboard_arrow_down"
1934
- }, null, 8, ["name"])
1935
- ]),
1936
- k(Tt, { name: "slide-fade" }, {
1937
- default: ae(() => [
1938
- e.value ? (V(), Q("div", jo, [
1939
- He(n.$slots, "content", {}, void 0, !0)
1940
- ])) : fe("", !0)
1941
- ]),
1942
- _: 3
1943
- }),
1944
- k(r)
1945
- ], 64);
1946
- };
1947
- }
1948
- }), bi = /* @__PURE__ */ Pt(Ho, [["__scopeId", "data-v-fa67a3a4"]]), zo = { class: "grow" }, Go = {
1949
- key: 2,
1950
- class: "w-full"
1951
- }, qo = { key: 0 }, Ko = /* @__PURE__ */ xe({
1952
- __name: "FilterValueInput",
1953
- props: /* @__PURE__ */ At({
1954
- config: {
1955
- type: Object,
1956
- default: () => {
1957
- }
1958
- },
1959
- option: {
1960
- type: [String, null],
1961
- default: () => {
1962
- }
1963
- }
1964
- }, {
1965
- modelValue: { required: !0, default: () => [] },
1966
- modelModifiers: {}
1967
- }),
1968
- emits: ["update:modelValue"],
1969
- setup(t) {
1970
- const e = ze(t, "modelValue"), n = t, o = De([]);
1971
- function i(l) {
1972
- return (l ? pt(l) : pt()).format("HH:mm");
1973
- }
1974
- function r({ hour: l, minute: c }) {
1975
- return pt().set("hour", l).set("minute", c).toISOString();
1976
- }
1977
- function a(l, c) {
1978
- var w, b;
1979
- const s = rn(n.option), f = an(n.option);
1980
- ((w = n.config) == null ? void 0 : w.type) === Le.TextField && (s !== void 0 && c < s || f !== void 0 && c > f) && (o.value[l] = `Value must be between ${s} and ${f}`);
1981
- const h = [...e.value];
1982
- ((b = n.config) == null ? void 0 : b.type) === Le.Timestamp ? h[l] = r({
1983
- hour: Number(c.split(":")[0]),
1984
- minute: Number(c.split(":")[1])
1985
- }) : h[l] = c, e.value = h;
1986
- }
1987
- function u(l) {
1988
- var c;
1989
- if (l === 0)
1990
- e.value = [(c = n.config) == null ? void 0 : c.default, ...e.value];
1991
- else {
1992
- const s = [...e.value];
1993
- s.splice(l, 1), e.value = s;
1994
- }
1995
- }
1996
- return (l, c) => {
1997
- const s = N("FmSelect"), f = N("FmTextField"), h = N("FmTimePicker"), w = N("FmButton");
1998
- return V(!0), Q(Ge, null, tn(new Array(e.value.length !== 0 ? e.value.length : 1), (b, y) => {
1999
- var B, R, x, A, j;
2000
- return V(), Q("div", {
2001
- key: y,
2002
- class: "flex flex-row align-center gap-2 w-full"
2003
- }, [
2004
- ve("div", zo, [
2005
- ((B = n.config) == null ? void 0 : B.type) === M(Le).Select ? (V(), Pe(s, {
2006
- key: 0,
2007
- "model-value": e.value[y],
2008
- items: n.config.options,
2009
- "onUpdate:modelValue": (X) => a(y, X)
2010
- }, null, 8, ["model-value", "items", "onUpdate:modelValue"])) : ((R = n.config) == null ? void 0 : R.type) === M(Le).TextField ? (V(), Pe(f, {
2011
- key: 1,
2012
- "model-value": e.value[y],
2013
- type: ((x = n.config) == null ? void 0 : x.dataType) === "number" ? "number" : "text",
2014
- "helper-text": o.value[y] || void 0,
2015
- "helper-state": "error",
2016
- "onUpdate:modelValue": (X) => a(y, X)
2017
- }, null, 8, ["model-value", "type", "helper-text", "onUpdate:modelValue"])) : ((A = n.config) == null ? void 0 : A.type) === M(Le).Timestamp ? (V(), Q("div", Go, [
2018
- k(h, {
2019
- "model-value": i(e.value[y]),
2020
- "onUpdate:modelValue": (X) => a(y, X)
2021
- }, null, 8, ["model-value", "onUpdate:modelValue"])
2022
- ])) : fe("", !0)
2023
- ]),
2024
- ((j = n.config) == null ? void 0 : j.fixed) === !1 ? (V(), Q("div", qo, [
2025
- k(w, {
2026
- icon: y === 0 ? "add" : "remove",
2027
- onClick: (X) => u(y)
2028
- }, null, 8, ["icon", "onClick"])
2029
- ])) : fe("", !0)
2030
- ]);
2031
- }), 128);
2032
- };
2033
- }
2034
- }), xn = [
2035
- Ce.HourOfDay,
2036
- Ce.DayOfMonth,
2037
- Ce.DayOfWeek,
2038
- Ce.MonthOfYear,
2039
- Ce.TimeOfDay,
2040
- Ce.DateTime
2041
- ], Jo = xn.filter(
2042
- (t) => t !== Ce.DateTime
2043
- );
2044
- function yi(t) {
2045
- return xn.map((e) => ({
2046
- label: t(`report.section.filter.${on(e)}`),
2047
- value: e
2048
- }));
2049
- }
2050
- function Zo(t) {
2051
- return Jo.map((e) => ({
2052
- label: t(`report.section.filter.${on(e)}`),
2053
- value: e
2054
- }));
2055
- }
2056
- const Qo = { class: "flex flex-col my-2 gap-8" }, ei = { class: "fm-typo-en-body-lg-600" }, ti = { class: "fm-typo-en-body-sm-600 text-fm-color-neutral-gray-400" }, ni = { class: "fm-typo-en-body-lg-400 text-ellipsis overflow-hidden line-clamp-1" }, _i = /* @__PURE__ */ xe({
2057
- __name: "FilterSection",
2058
- props: /* @__PURE__ */ At({
2059
- options: {
2060
- type: Array,
2061
- default: () => []
2062
- },
2063
- label: {
2064
- type: String,
2065
- default: "Filter"
2066
- }
2067
- }, {
2068
- modelValue: { required: !1, default: () => [] },
2069
- modelModifiers: {}
2070
- }),
2071
- emits: ["update:modelValue"],
2072
- setup(t) {
2073
- const { t: e } = Nt(), n = ze(t, "modelValue"), o = t, i = Fe(() => e(`report.section.filter.${o.label}`)), r = De(!1), a = Yn(), u = Fe(
2074
- () => n.value.map((m, p) => {
2075
- const E = o.options.find(
2076
- (C) => C.schemaName === m.schemaName && C.name === m.name
2077
- );
2078
- return {
2079
- index: p,
2080
- labels: (E == null ? void 0 : E.labels) || [m.schemaName, m.name],
2081
- value: m
2082
- };
2083
- })
2084
- ), l = De(n.value.length > 0 ? 0 : void 0);
2085
- function c(m) {
2086
- var p;
2087
- r.value = !0, b.value = [], s.value = m != null && m.value ? JSON.parse(JSON.stringify(m.value)) : void 0, l.value = m == null ? void 0 : m.index, f.value = !!((p = s.value) != null && p.dataFormula), A();
2088
- }
2089
- const s = De(void 0), f = De(!1), h = De(void 0), w = Fe(
2090
- () => o.options.find(
2091
- (m) => {
2092
- var p, E;
2093
- return m.schemaName === ((p = s.value) == null ? void 0 : p.schemaName) && m.name === ((E = s.value) == null ? void 0 : E.name);
2094
- }
2095
- ) ?? {}
2096
- ), b = De([]);
2097
- function y(m) {
2098
- var p;
2099
- return (p = b.value.find((E) => E.option === m)) == null ? void 0 : p.value;
2100
- }
2101
- const B = Wn(
2102
- (m, p) => {
2103
- const E = b.value.find((C) => C.option === m);
2104
- E ? E.value = p : b.value.push({ option: m, value: p });
2105
- },
2106
- 300
2107
- );
2108
- mt(
2109
- [() => {
2110
- var m;
2111
- return (m = s.value) == null ? void 0 : m.option;
2112
- }, () => {
2113
- var m;
2114
- return (m = s.value) == null ? void 0 : m.values;
2115
- }],
2116
- ([m, p]) => {
2117
- m !== void 0 && Array.isArray(p) && B(m, p);
2118
- },
2119
- { deep: !0 }
2120
- ), mt(
2121
- () => {
2122
- var m;
2123
- return (m = s.value) == null ? void 0 : m.option;
2124
- },
2125
- (m, p) => {
2126
- p !== void 0 && m !== p && s.value && (A(), R(m), x());
2127
- }
2128
- ), mt(
2129
- () => {
2130
- var m;
2131
- return (m = s.value) == null ? void 0 : m.operator;
2132
- },
2133
- (m, p) => {
2134
- m !== p && w.value && s.value && (A(), R(s.value.option), x());
2135
- },
2136
- {
2137
- deep: !0
2138
- }
2139
- );
2140
- function R(m) {
2141
- var te;
2142
- if (!s.value || !h.value) return;
2143
- const p = l.value !== void 0 && n.value[l.value] && Array.isArray(n.value[l.value].values) ? [...n.value[l.value].values] : [], E = y(m);
2144
- let C;
2145
- const z = l.value !== void 0 ? (te = n.value[l.value]) == null ? void 0 : te.option : void 0;
2146
- Array.isArray(E) ? C = E : p.length > 0 && m === z ? C = p : C = [h.value.default], s.value = {
2147
- ...s.value,
2148
- values: C
2149
- };
2150
- }
2151
- function x() {
2152
- if (!h.value || !s.value) return;
2153
- const m = s.value.values.length - h.value.count;
2154
- m > 0 && h.value.fixed ? s.value = {
2155
- ...s.value,
2156
- values: s.value.values.slice(0, h.value.count)
2157
- } : m < 0 && (s.value = {
2158
- ...s.value,
2159
- values: [...s.value.values, ...Array(Math.abs(m)).fill(h.value.default)]
2160
- });
2161
- }
2162
- function A() {
2163
- w.value && s.value && (h.value = Xn({
2164
- operator: s.value.operator,
2165
- dataType: w.value.type,
2166
- dimensionOption: s.value.option,
2167
- t: e
2168
- }));
2169
- }
2170
- function j(m) {
2171
- var p, E;
2172
- (m.schemaName !== ((p = s.value) == null ? void 0 : p.schemaName) || m.name !== ((E = s.value) == null ? void 0 : E.name)) && (s.value = {
2173
- schemaName: m.schemaName,
2174
- name: m.name,
2175
- operator: m.filterOperators[0],
2176
- option: m.filterDimensionOptions[0],
2177
- values: []
2178
- }, A(), R(s.value.option), x());
2179
- }
2180
- function X() {
2181
- var p, E, C;
2182
- const m = [...u.value.map((z) => z.value)];
2183
- if (s.value) {
2184
- const z = rn((p = s.value) == null ? void 0 : p.option), te = an((E = s.value) == null ? void 0 : E.option), ne = (C = s.value.values) == null ? void 0 : C.map(
2185
- (Y, ce) => Y == null || Y === "" || !H(Y, z, te) ? ce : null
2186
- ).filter((Y) => Y !== null);
2187
- if (!s.value.values || ne.length > 0) {
2188
- a.open({ message: "One or more values are invalid", type: "error" });
2189
- return;
2190
- }
2191
- s.value.values = s.value.values.filter(
2192
- (Y) => Y !== "" && Y !== null
2193
- ), l.value !== void 0 ? m[Number(l.value)] = s.value : m.push(s.value), n.value = m;
2194
- }
2195
- r.value = !1;
2196
- }
2197
- function ee(m) {
2198
- const p = [...u.value.map((E) => E.value)];
2199
- p.splice(m, 1), n.value = p, r.value = !1;
2200
- }
2201
- const ue = Fe(
2202
- () => o.options.map((m) => ({
2203
- label: m.labels.join(" "),
2204
- value: m
2205
- }))
2206
- ), _e = Fe(() => Zo(e));
2207
- function H(m, p, E) {
2208
- return !(p !== void 0 && m < p || E !== void 0 && m > E);
2209
- }
2210
- return (m, p) => {
2211
- const E = N("FmCheckbox"), C = N("FmTextarea"), z = N("FmSelect"), te = N("FmForm"), ne = N("FmIcon"), Y = N("FmButton"), ce = N("FmListItem"), ft = N("FmList"), $t = N("FmField");
2212
- return V(), Q("div", Qo, [
2213
- k(Bn, {
2214
- modelValue: r.value,
2215
- "onUpdate:modelValue": p[6] || (p[6] = (de) => r.value = de),
2216
- title: i.value,
2217
- "primary-button-label": M(e)("report.common.confirm"),
2218
- "secondary-button-label": M(e)("report.common.cancel"),
2219
- onConfirm: X
2220
- }, {
2221
- content: ae(() => [
2222
- k(te, {
2223
- ref: "form",
2224
- class: "flex flex-col gap-2 w-[490px]"
2225
- }, {
2226
- default: ae(() => {
2227
- var de, we;
2228
- return [
2229
- k(Xt, {
2230
- "model-value": w.value,
2231
- items: ue.value,
2232
- placeholder: i.value,
2233
- label: i.value,
2234
- "onUpdate:modelValue": p[0] || (p[0] = (W) => j(W))
2235
- }, null, 8, ["model-value", "items", "placeholder", "label"]),
2236
- s.value ? (V(), Q(Ge, { key: 0 }, [
2237
- k(E, {
2238
- modelValue: f.value,
2239
- "onUpdate:modelValue": p[1] || (p[1] = (W) => f.value = W),
2240
- label: M(e)("report.section.filter.advance"),
2241
- value: !0
2242
- }, null, 8, ["modelValue", "label"]),
2243
- f.value ? (V(), Pe(C, {
2244
- key: 0,
2245
- modelValue: s.value.dataFormula,
2246
- "onUpdate:modelValue": p[2] || (p[2] = (W) => s.value.dataFormula = W),
2247
- placeholder: M(e)("report.section.filter.dataFormula")
2248
- }, null, 8, ["modelValue", "placeholder"])) : fe("", !0),
2249
- k(z, {
2250
- modelValue: s.value.option,
2251
- "onUpdate:modelValue": p[3] || (p[3] = (W) => s.value.option = W),
2252
- items: _e.value,
2253
- placeholder: M(e)("report.section.filter.timeFormatter"),
2254
- label: M(e)("report.section.filter.timeFormatter")
2255
- }, null, 8, ["modelValue", "items", "placeholder", "label"]),
2256
- (((de = w.value) == null ? void 0 : de.filterOperators) || []).length > 0 ? (V(), Pe(Xt, {
2257
- key: 1,
2258
- modelValue: s.value.operator,
2259
- "onUpdate:modelValue": p[4] || (p[4] = (W) => s.value.operator = W),
2260
- items: (((we = w.value) == null ? void 0 : we.filterOperators) ?? []).map((W) => ({
2261
- label: M(e)("report.section.comparisonOperator." + W),
2262
- value: W
2263
- }))
2264
- }, null, 8, ["modelValue", "items"])) : fe("", !0),
2265
- h.value ? (V(), Pe(Ko, {
2266
- key: s.value.option ?? "",
2267
- modelValue: s.value.values,
2268
- "onUpdate:modelValue": p[5] || (p[5] = (W) => s.value.values = W),
2269
- config: h.value,
2270
- option: s.value.option
2271
- }, null, 8, ["modelValue", "config", "option"])) : fe("", !0)
2272
- ], 64)) : fe("", !0)
2273
- ];
2274
- }),
2275
- _: 1
2276
- }, 512)
2277
- ]),
2278
- _: 1
2279
- }, 8, ["modelValue", "title", "primary-button-label", "secondary-button-label"]),
2280
- ve("div", null, [
2281
- ve("p", ei, Ae(i.value), 1),
2282
- ve("p", ti, Ae(M(e)("report.section.filter.description")), 1)
2283
- ]),
2284
- k(ft, null, {
2285
- default: ae(() => [
2286
- k(M(Xo), {
2287
- list: n.value,
2288
- "item-key": "id",
2289
- class: "flex flex-col gap-2 w-full"
2290
- }, {
2291
- item: ae(({ element: de, index: we }) => [
2292
- k(ce, {
2293
- class: "!cursor-grab border rounded-md border-neutral-300 h-[40px] !p-[8px]",
2294
- onClick: Rt((W) => c(u.value[we]), ["stop"])
2295
- }, {
2296
- default: ae(() => [
2297
- k(ne, { name: "drag_handle" }),
2298
- ve("p", ni, Ae(M(Vn)(de.name)), 1),
2299
- p[8] || (p[8] = ve("div", { class: "grow" }, null, -1)),
2300
- k(Y, {
2301
- icon: "close",
2302
- size: "md",
2303
- variant: "tertiary",
2304
- onClick: Rt((W) => ee(we), ["stop"])
2305
- }, null, 8, ["onClick"])
2306
- ]),
2307
- _: 2
2308
- }, 1032, ["onClick"])
2309
- ]),
2310
- _: 1
2311
- }, 8, ["list"])
2312
- ]),
2313
- _: 1
2314
- }),
2315
- k($t, {
2316
- class: "text-fm-color-typo-tertiary",
2317
- onClick: p[7] || (p[7] = () => {
2318
- c();
2319
- })
2320
- }, {
2321
- default: ae(() => [
2322
- nn(Ae(M(e)("report.section.filter.add")), 1)
2323
- ]),
2324
- _: 1
2325
- })
2326
- ]);
2327
- };
2328
- }
2329
- }), oi = /* @__PURE__ */ xe({
2330
- __name: "TransitionFade",
2331
- props: {
2332
- modelValue: { type: Boolean, required: !0, default: !0 },
2333
- modelModifiers: {}
2334
- },
2335
- emits: ["update:modelValue"],
2336
- setup(t) {
2337
- const e = ze(t, "modelValue");
2338
- return (n, o) => (V(), Q(Ge, null, [
2339
- k(Tt, { name: "slide-fade-right" }, {
2340
- default: ae(() => [
2341
- e.value ? He(n.$slots, "right", { key: 0 }, void 0, !0) : fe("", !0)
2342
- ]),
2343
- _: 3
2344
- }),
2345
- k(Tt, { name: "slide-fade-left" }, {
2346
- default: ae(() => [
2347
- e.value ? fe("", !0) : He(n.$slots, "left", { key: 0 }, void 0, !0)
2348
- ]),
2349
- _: 3
2350
- })
2351
- ], 64));
2352
- }
2353
- }), wi = /* @__PURE__ */ Pt(oi, [["__scopeId", "data-v-a98ca9bc"]]);
2354
- export {
2355
- bi as S,
2356
- wi as T,
2357
- hi as W,
2358
- _i as _,
2359
- pi as a,
2360
- Uo as b,
2361
- Xo as d,
2362
- yi as g,
2363
- vi as h,
2364
- gi as i
2365
- };