@feedmepos/mf-report 5.19.20 → 5.19.21-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 (30) hide show
  1. package/dist/{App-CpPkDCME.js → App-C4x7ZEye.js} +31 -31
  2. package/dist/{BaseDialog.vue_vue_type_script_setup_true_lang-BLVm6EP9.js → BaseDialog.vue_vue_type_script_setup_true_lang-CosulEnD.js} +862 -662
  3. package/dist/DateRangeSelect.vue_vue_type_script_setup_true_lang-BeBr4VIF.js +282 -0
  4. package/dist/{Default.vue_vue_type_script_setup_true_lang-DTHkWGvx.js → Default.vue_vue_type_script_setup_true_lang-g1a2ZeGy.js} +2 -2
  5. package/dist/FilterSelector.vue_vue_type_script_setup_true_lang-Cgc4ZMrl.js +2455 -0
  6. package/dist/{InsightView-wYbhKrWa.js → InsightView-jAOVvZfx.js} +5 -5
  7. package/dist/{Integration-GkPCivXG.js → Integration-BovNO2yX.js} +2 -2
  8. package/dist/{Integrations-BGNXoeWI.js → Integrations-DIXSWGS_.js} +3 -3
  9. package/dist/{Layout-B7pJLV4_.js → Layout-CptBKFVs.js} +1 -1
  10. package/dist/MenuTab.vue_vue_type_script_setup_true_lang-BGEMZOKu.js +107 -0
  11. package/dist/{NavigationTab.vue_vue_type_script_setup_true_lang-Cl6q8Efn.js → NavigationTab.vue_vue_type_script_setup_true_lang-B3sRs2Tc.js} +7331 -7518
  12. package/dist/{NoData.vue_vue_type_script_setup_true_lang-CUuIeYhQ.js → NoData.vue_vue_type_script_setup_true_lang-CtN7oqXx.js} +1 -1
  13. package/dist/{OverviewView-DzumtIfB.js → OverviewView-DVL5KgO_.js} +5 -5
  14. package/dist/{Report-B_SX8ejx.js → Report-C6U6OiZy.js} +4 -4
  15. package/dist/ReportEditor-DD8jAl9a.js +1070 -0
  16. package/dist/{ReportView-DPMurcsC.js → ReportView-DAL1aJFD.js} +7 -7
  17. package/dist/{SelectComponent.vue_vue_type_script_setup_true_lang-IdXw91_v.js → SelectComponent.vue_vue_type_script_setup_true_lang-BcQEW5MO.js} +1 -1
  18. package/dist/{Setting-BsikuNba.js → Setting-DpyuOpXG.js} +4 -4
  19. package/dist/TileEditor-B4NsHTN2.js +2744 -0
  20. package/dist/TransitionFade-z0DXUsgP.js +2366 -0
  21. package/dist/app.js +41 -15
  22. package/dist/{vue-i18n-D33f1SSo.js → vue-i18n-BJW_sJot.js} +405 -400
  23. package/package.json +1 -1
  24. package/dist/DateRangeSelect.vue_vue_type_script_setup_true_lang-C7mhpRK0.js +0 -185
  25. package/dist/DynamicWidget.vue_vue_type_script_setup_true_lang-DVY4vxAN.js +0 -1669
  26. package/dist/MenuTab.vue_vue_type_script_setup_true_lang-C7pQMilo.js +0 -352
  27. package/dist/ReportEditor-D5OHT5As.js +0 -1013
  28. package/dist/TileEditor-Bzk4U52d.js +0 -2735
  29. package/dist/TransitionFade-Blz6m84x.js +0 -2499
  30. package/dist/helper-B2iB0Dbh.js +0 -75
@@ -1,2499 +0,0 @@
1
- import { defineComponent as Ce, onBeforeMount as xn, onBeforeUnmount as On, resolveComponent as N, createElementBlock as Q, openBlock as V, normalizeStyle as Fn, unref as M, renderSlot as Ge, createVNode as k, createElementVNode as be, toDisplayString as Pe, TransitionGroup as In, nextTick as en, h as $t, mergeModels as Nt, useModel as ze, computed as ke, Fragment as qe, renderList as tn, createBlock as Me, normalizeClass as kn, withCtx as le, createTextVNode as nn, Transition as xt, createCommentVNode as fe, ref as De, watch as pt, withModifiers as Rt } from "vue";
2
- import { u as Pt, f as An, p as Nn, d as ht, h as Pn } from "./vue-i18n-D33f1SSo.js";
3
- import { useCoreStore as Vn } from "@feedmepos/mf-common";
4
- import { storeToRefs as Mn } from "pinia";
5
- import { useRoute as Ln } from "vue-router";
6
- import { W as L, D as Ze, c as z, C as de, _ as Bn } from "./BaseDialog.vue_vue_type_script_setup_true_lang-BLVm6EP9.js";
7
- import { a as Vt, _ as Yt } from "./SelectComponent.vue_vue_type_script_setup_true_lang-IdXw91_v.js";
8
- import { R as $n } from "./DynamicWidget.vue_vue_type_script_setup_true_lang-DVY4vxAN.js";
9
- import { useSnackbar as Rn } from "@feedmepos/ui-library";
10
- import { a as Yn } from "./helper-B2iB0Dbh.js";
11
- const Wn = {
12
- key: 0,
13
- class: "flex gap-24 flex-col h-screen w-screen justify-center items-center"
14
- }, Xn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, fr = /* @__PURE__ */ Ce({
15
- __name: "FullScreen",
16
- setup(t) {
17
- const { t: e } = Pt(), n = Ln(), { isLoading: o } = Mn(An()), r = Vn();
18
- return xn(() => {
19
- r.hideSidebarToggle(!0);
20
- }), On(() => {
21
- r.hideSidebarToggle(!1);
22
- }), (a, i) => {
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", Wn, [
31
- k(u, { size: "xl" }),
32
- be("span", Xn, Pe(M(e)("report.common.isLoading")), 1)
33
- ])) : Ge(a.$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 Wt(t, e) {
45
- var n = Object.keys(t);
46
- if (Object.getOwnPropertySymbols) {
47
- var o = Object.getOwnPropertySymbols(t);
48
- e && (o = o.filter(function(r) {
49
- return Object.getOwnPropertyDescriptor(t, r).enumerable;
50
- })), n.push.apply(n, o);
51
- }
52
- return n;
53
- }
54
- function ue(t) {
55
- for (var e = 1; e < arguments.length; e++) {
56
- var n = arguments[e] != null ? arguments[e] : {};
57
- e % 2 ? Wt(Object(n), !0).forEach(function(o) {
58
- Un(t, o, n[o]);
59
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : Wt(Object(n)).forEach(function(o) {
60
- Object.defineProperty(t, o, Object.getOwnPropertyDescriptor(n, o));
61
- });
62
- }
63
- return t;
64
- }
65
- function ot(t) {
66
- "@babel/helpers - typeof";
67
- return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? ot = function(e) {
68
- return typeof e;
69
- } : ot = function(e) {
70
- return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
71
- }, ot(t);
72
- }
73
- function Un(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 Hn(t, e) {
92
- if (t == null) return {};
93
- var n = {}, o = Object.keys(t), r, a;
94
- for (a = 0; a < o.length; a++)
95
- r = o[a], !(e.indexOf(r) >= 0) && (n[r] = t[r]);
96
- return n;
97
- }
98
- function jn(t, e) {
99
- if (t == null) return {};
100
- var n = Hn(t, e), o, r;
101
- if (Object.getOwnPropertySymbols) {
102
- var a = Object.getOwnPropertySymbols(t);
103
- for (r = 0; r < a.length; r++)
104
- o = a[r], !(e.indexOf(o) >= 0) && Object.prototype.propertyIsEnumerable.call(t, o) && (n[o] = t[o]);
105
- }
106
- return n;
107
- }
108
- var Gn = "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), Ke = me(/Edge/i), Xt = me(/firefox/i), We = me(/safari/i) && !me(/chrome/i) && !me(/android/i), on = me(/iP(ad|od|hone)/i), zn = me(/chrome/i) && me(/android/i), rn = {
114
- capture: !1,
115
- passive: !1
116
- };
117
- function D(t, e, n) {
118
- t.addEventListener(e, n, !he && rn);
119
- }
120
- function S(t, e, n) {
121
- t.removeEventListener(e, n, !he && rn);
122
- }
123
- function st(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 qn(t) {
140
- return t.host && t !== document && t.host.nodeType ? t.host : t.parentNode;
141
- }
142
- function ie(t, e, n, o) {
143
- if (t) {
144
- n = n || document;
145
- do {
146
- if (e != null && (e[0] === ">" ? t.parentNode === n && st(t, e) : st(t, e)) || o && t === n)
147
- return t;
148
- if (t === n) break;
149
- } while (t = qn(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 Le(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 r = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix;
181
- return r && new r(n);
182
- }
183
- function an(t, e, n) {
184
- if (t) {
185
- var o = t.getElementsByTagName(e), r = 0, a = o.length;
186
- if (n)
187
- for (; r < a; r++)
188
- n(o[r], r);
189
- return o;
190
- }
191
- return [];
192
- }
193
- function se() {
194
- var t = document.scrollingElement;
195
- return t || document.documentElement;
196
- }
197
- function P(t, e, n, o, r) {
198
- if (!(!t.getBoundingClientRect && t !== window)) {
199
- var a, i, u, s, c, l, f;
200
- if (t !== window && t.parentNode && t !== se() ? (a = t.getBoundingClientRect(), i = a.top, u = a.left, s = a.bottom, c = a.right, l = a.height, f = a.width) : (i = 0, u = 0, s = window.innerHeight, c = window.innerWidth, l = window.innerHeight, f = window.innerWidth), (e || n) && t !== window && (r = r || t.parentNode, !he))
201
- do
202
- if (r && r.getBoundingClientRect && (g(r, "transform") !== "none" || n && g(r, "position") !== "static")) {
203
- var h = r.getBoundingClientRect();
204
- i -= h.top + parseInt(g(r, "border-top-width")), u -= h.left + parseInt(g(r, "border-left-width")), s = i + a.height, c = u + a.width;
205
- break;
206
- }
207
- while (r = r.parentNode);
208
- if (o && t !== window) {
209
- var w = Le(r || t), b = w && w.a, y = w && w.d;
210
- w && (i /= y, u /= b, f /= b, l /= y, s = i + l, c = u + f);
211
- }
212
- return {
213
- top: i,
214
- left: u,
215
- bottom: s,
216
- right: c,
217
- width: f,
218
- height: l
219
- };
220
- }
221
- }
222
- function Ht(t, e, n) {
223
- for (var o = _e(t, !0), r = P(t)[e]; o; ) {
224
- var a = P(o)[n], i = void 0;
225
- if (i = r >= a, !i) return o;
226
- if (o === se()) break;
227
- o = _e(o, !1);
228
- }
229
- return !1;
230
- }
231
- function Be(t, e, n, o) {
232
- for (var r = 0, a = 0, i = t.children; a < i.length; ) {
233
- if (i[a].style.display !== "none" && i[a] !== v.ghost && (o || i[a] !== v.dragged) && ie(i[a], n.draggable, t, !1)) {
234
- if (r === e)
235
- return i[a];
236
- r++;
237
- }
238
- a++;
239
- }
240
- return null;
241
- }
242
- function Mt(t, e) {
243
- for (var n = t.lastElementChild; n && (n === v.ghost || g(n, "display") === "none" || e && !st(n, e)); )
244
- n = n.previousElementSibling;
245
- return n || null;
246
- }
247
- function ne(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 || st(t, e)) && n++;
253
- return n;
254
- }
255
- function jt(t) {
256
- var e = 0, n = 0, o = se();
257
- if (t)
258
- do {
259
- var r = Le(t), a = r.a, i = r.d;
260
- e += t.scrollLeft * a, n += t.scrollTop * i;
261
- } while (t !== o && (t = t.parentNode));
262
- return [e, n];
263
- }
264
- function Kn(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 _e(t, e) {
273
- if (!t || !t.getBoundingClientRect) return se();
274
- var n = t, o = !1;
275
- do
276
- if (n.clientWidth < n.scrollWidth || n.clientHeight < n.scrollHeight) {
277
- var r = g(n);
278
- if (n.clientWidth < n.scrollWidth && (r.overflowX == "auto" || r.overflowX == "scroll") || n.clientHeight < n.scrollHeight && (r.overflowY == "auto" || r.overflowY == "scroll")) {
279
- if (!n.getBoundingClientRect || n === document.body) return se();
280
- if (o || e) return n;
281
- o = !0;
282
- }
283
- }
284
- while (n = n.parentNode);
285
- return se();
286
- }
287
- function Jn(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 gt(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 Xe;
297
- function ln(t, e) {
298
- return function() {
299
- if (!Xe) {
300
- var n = arguments, o = this;
301
- n.length === 1 ? t.call(o, n[0]) : t.apply(o, n), Xe = setTimeout(function() {
302
- Xe = void 0;
303
- }, e);
304
- }
305
- };
306
- }
307
- function Zn() {
308
- clearTimeout(Xe), Xe = void 0;
309
- }
310
- function sn(t, e, n) {
311
- t.scrollLeft += e, t.scrollTop += n;
312
- }
313
- function un(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 Qn() {
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(r) {
325
- if (!(g(r, "display") === "none" || r === v.ghost)) {
326
- t.push({
327
- target: r,
328
- rect: P(r)
329
- });
330
- var a = ue({}, t[t.length - 1].rect);
331
- if (r.thisAnimationDuration) {
332
- var i = Le(r, !0);
333
- i && (a.top -= i.f, a.left -= i.e);
334
- }
335
- r.fromRect = a;
336
- }
337
- });
338
- }
339
- },
340
- addAnimationState: function(o) {
341
- t.push(o);
342
- },
343
- removeAnimationState: function(o) {
344
- t.splice(Kn(t, {
345
- target: o
346
- }), 1);
347
- },
348
- animateAll: function(o) {
349
- var r = this;
350
- if (!this.options.animation) {
351
- clearTimeout(e), typeof o == "function" && o();
352
- return;
353
- }
354
- var a = !1, i = 0;
355
- t.forEach(function(u) {
356
- var s = 0, c = u.target, l = c.fromRect, f = P(c), h = c.prevFromRect, w = c.prevToRect, b = u.rect, y = Le(c, !0);
357
- y && (f.top -= y.f, f.left -= y.e), c.toRect = f, c.thisAnimationDuration && gt(h, f) && !gt(l, f) && // Make sure animatingRect is on line between toRect & fromRect
358
- (b.top - f.top) / (b.left - f.left) === (l.top - f.top) / (l.left - f.left) && (s = to(b, h, w, r.options)), gt(f, l) || (c.prevFromRect = l, c.prevToRect = f, s || (s = r.options.animation), r.animate(c, b, f, s)), s && (a = !0, i = Math.max(i, s), clearTimeout(c.animationResetTimer), c.animationResetTimer = setTimeout(function() {
359
- c.animationTime = 0, c.prevFromRect = null, c.fromRect = null, c.prevToRect = null, c.thisAnimationDuration = null;
360
- }, s), c.thisAnimationDuration = s);
361
- }), clearTimeout(e), a ? e = setTimeout(function() {
362
- typeof o == "function" && o();
363
- }, i) : typeof o == "function" && o(), t = [];
364
- },
365
- animate: function(o, r, a, i) {
366
- if (i) {
367
- g(o, "transition", ""), g(o, "transform", "");
368
- var u = Le(this.el), s = u && u.a, c = u && u.d, l = (r.left - a.left) / (s || 1), f = (r.top - a.top) / (c || 1);
369
- o.animatingX = !!l, o.animatingY = !!f, g(o, "transform", "translate3d(" + l + "px," + f + "px,0)"), this.forRepaintDummy = eo(o), g(o, "transition", "transform " + i + "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
- }, i);
372
- }
373
- }
374
- };
375
- }
376
- function eo(t) {
377
- return t.offsetWidth;
378
- }
379
- function to(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 Fe = [], vt = {
383
- initializeByDefault: !0
384
- }, Je = {
385
- mount: function(e) {
386
- for (var n in vt)
387
- vt.hasOwnProperty(n) && !(n in e) && (e[n] = vt[n]);
388
- Fe.forEach(function(o) {
389
- if (o.pluginName === e.pluginName)
390
- throw "Sortable: Cannot mount plugin ".concat(e.pluginName, " more than once");
391
- }), Fe.push(e);
392
- },
393
- pluginEvent: function(e, n, o) {
394
- var r = this;
395
- this.eventCanceled = !1, o.cancel = function() {
396
- r.eventCanceled = !0;
397
- };
398
- var a = e + "Global";
399
- Fe.forEach(function(i) {
400
- n[i.pluginName] && (n[i.pluginName][a] && n[i.pluginName][a](ue({
401
- sortable: n
402
- }, o)), n.options[i.pluginName] && n[i.pluginName][e] && n[i.pluginName][e](ue({
403
- sortable: n
404
- }, o)));
405
- });
406
- },
407
- initializePlugins: function(e, n, o, r) {
408
- Fe.forEach(function(u) {
409
- var s = u.pluginName;
410
- if (!(!e.options[s] && !u.initializeByDefault)) {
411
- var c = new u(e, n, e.options);
412
- c.sortable = e, c.options = e.options, e[s] = c, pe(o, c.defaults);
413
- }
414
- });
415
- for (var a in e.options)
416
- if (e.options.hasOwnProperty(a)) {
417
- var i = this.modifyOption(e, a, e.options[a]);
418
- typeof i < "u" && (e.options[a] = i);
419
- }
420
- },
421
- getEventProperties: function(e, n) {
422
- var o = {};
423
- return Fe.forEach(function(r) {
424
- typeof r.eventProperties == "function" && pe(o, r.eventProperties.call(n[r.pluginName], e));
425
- }), o;
426
- },
427
- modifyOption: function(e, n, o) {
428
- var r;
429
- return Fe.forEach(function(a) {
430
- e[a.pluginName] && a.optionListeners && typeof a.optionListeners[n] == "function" && (r = a.optionListeners[n].call(e[a.pluginName], o));
431
- }), r;
432
- }
433
- };
434
- function no(t) {
435
- var e = t.sortable, n = t.rootEl, o = t.name, r = t.targetEl, a = t.cloneEl, i = t.toEl, u = t.fromEl, s = t.oldIndex, c = t.newIndex, l = 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, Y = e.options, B = "on" + o.charAt(0).toUpperCase() + o.substr(1);
438
- window.CustomEvent && !he && !Ke ? y = new CustomEvent(o, {
439
- bubbles: !0,
440
- cancelable: !0
441
- }) : (y = document.createEvent("Event"), y.initEvent(o, !0, !0)), y.to = i || n, y.from = u || n, y.item = r || n, y.clone = a, y.oldIndex = s, y.newIndex = c, y.oldDraggableIndex = l, y.newDraggableIndex = f, y.originalEvent = h, y.pullMode = w ? w.lastPutMode : void 0;
442
- var F = ue(ue({}, b), Je.getEventProperties(o, e));
443
- for (var W in F)
444
- y[W] = F[W];
445
- n && n.dispatchEvent(y), Y[B] && Y[B].call(e, y);
446
- }
447
- }
448
- var oo = ["evt"], G = function(e, n) {
449
- var o = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, r = o.evt, a = jn(o, oo);
450
- Je.pluginEvent.bind(v)(e, n, ue({
451
- dragEl: d,
452
- parentEl: C,
453
- ghostEl: _,
454
- rootEl: T,
455
- nextEl: Te,
456
- lastDownEl: rt,
457
- cloneEl: x,
458
- cloneHidden: ye,
459
- dragStarted: $e,
460
- putSortable: R,
461
- activeSortable: v.active,
462
- originalEvent: r,
463
- oldIndex: Ve,
464
- oldDraggableIndex: Ue,
465
- newIndex: J,
466
- newDraggableIndex: ve,
467
- hideGhostForTarget: mn,
468
- unhideGhostForTarget: pn,
469
- cloneNowHidden: function() {
470
- ye = !0;
471
- },
472
- cloneNowShown: function() {
473
- ye = !1;
474
- },
475
- dispatchSortableEvent: function(u) {
476
- j({
477
- sortable: n,
478
- name: u,
479
- originalEvent: r
480
- });
481
- }
482
- }, a));
483
- };
484
- function j(t) {
485
- no(ue({
486
- putSortable: R,
487
- cloneEl: x,
488
- targetEl: d,
489
- rootEl: T,
490
- oldIndex: Ve,
491
- oldDraggableIndex: Ue,
492
- newIndex: J,
493
- newDraggableIndex: ve
494
- }, t));
495
- }
496
- var d, C, _, T, Te, rt, x, ye, Ve, J, Ue, ve, Qe, R, Ae = !1, ut = !1, ct = [], Ee, ae, bt, yt, Gt, zt, $e, Ie, He, je = !1, et = !1, at, U, _t = [], Ot = !1, dt = [], mt = typeof document < "u", tt = on, qt = Ke || he ? "cssFloat" : "float", ro = mt && !zn && !on && "draggable" in document.createElement("div"), cn = function() {
497
- if (mt) {
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
- }(), dn = function(e, n) {
504
- var o = g(e), r = parseInt(o.width) - parseInt(o.paddingLeft) - parseInt(o.paddingRight) - parseInt(o.borderLeftWidth) - parseInt(o.borderRightWidth), a = Be(e, 0, n), i = Be(e, 1, n), u = a && g(a), s = i && g(i), c = u && parseInt(u.marginLeft) + parseInt(u.marginRight) + P(a).width, l = s && parseInt(s.marginLeft) + parseInt(s.marginRight) + P(i).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 (a && u.float && u.float !== "none") {
510
- var f = u.float === "left" ? "left" : "right";
511
- return i && (s.clear === "both" || s.clear === f) ? "vertical" : "horizontal";
512
- }
513
- return a && (u.display === "block" || u.display === "flex" || u.display === "table" || u.display === "grid" || c >= r && o[qt] === "none" || i && o[qt] === "none" && c + l > r) ? "vertical" : "horizontal";
514
- }, ao = function(e, n, o) {
515
- var r = o ? e.left : e.top, a = o ? e.right : e.bottom, i = o ? e.width : e.height, u = o ? n.left : n.top, s = o ? n.right : n.bottom, c = o ? n.width : n.height;
516
- return r === u || a === s || r + i / 2 === u + c / 2;
517
- }, io = function(e, n) {
518
- var o;
519
- return ct.some(function(r) {
520
- var a = r[Z].options.emptyInsertThreshold;
521
- if (!(!a || Mt(r))) {
522
- var i = P(r), u = e >= i.left - a && e <= i.right + a, s = n >= i.top - a && n <= i.bottom + a;
523
- if (u && s)
524
- return o = r;
525
- }
526
- }), o;
527
- }, fn = function(e) {
528
- function n(a, i) {
529
- return function(u, s, c, l) {
530
- var f = u.options.group.name && s.options.group.name && u.options.group.name === s.options.group.name;
531
- if (a == null && (i || f))
532
- return !0;
533
- if (a == null || a === !1)
534
- return !1;
535
- if (i && a === "clone")
536
- return a;
537
- if (typeof a == "function")
538
- return n(a(u, s, c, l), i)(u, s, c, l);
539
- var h = (i ? u : s).options.group.name;
540
- return a === !0 || typeof a == "string" && a === h || a.join && a.indexOf(h) > -1;
541
- };
542
- }
543
- var o = {}, r = e.group;
544
- (!r || ot(r) != "object") && (r = {
545
- name: r
546
- }), o.name = r.name, o.checkPull = n(r.pull, !0), o.checkPut = n(r.put), o.revertClone = r.revertClone, e.group = o;
547
- }, mn = function() {
548
- !cn && _ && g(_, "display", "none");
549
- }, pn = function() {
550
- !cn && _ && g(_, "display", "");
551
- };
552
- mt && document.addEventListener("click", function(t) {
553
- if (ut)
554
- return t.preventDefault(), t.stopPropagation && t.stopPropagation(), t.stopImmediatePropagation && t.stopImmediatePropagation(), ut = !1, !1;
555
- }, !0);
556
- var Se = function(e) {
557
- if (d) {
558
- e = e.touches ? e.touches[0] : e;
559
- var n = io(e.clientX, e.clientY);
560
- if (n) {
561
- var o = {};
562
- for (var r in e)
563
- e.hasOwnProperty(r) && (o[r] = e[r]);
564
- o.target = o.rootEl = n, o.preventDefault = void 0, o.stopPropagation = void 0, n[Z]._onDragOver(o);
565
- }
566
- }
567
- }, lo = 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 dn(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(i, u) {
600
- i.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 && !We,
617
- emptyInsertThreshold: 5
618
- };
619
- Je.initializePlugins(this, t, n);
620
- for (var o in n)
621
- !(o in e) && (e[o] = n[o]);
622
- fn(e);
623
- for (var r in this)
624
- r.charAt(0) === "_" && typeof this[r] == "function" && (this[r] = this[r].bind(this));
625
- this.nativeDraggable = e.forceFallback ? !1 : ro, 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)), ct.push(this.el), e.store && e.store.get && this.sort(e.store.get(this) || []), pe(this, Qn());
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, r = this.options, a = r.preventOnFilter, i = e.type, u = e.touches && e.touches[0] || e.pointerType && e.pointerType === "touch" && e, s = (u || e).target, c = e.target.shadowRoot && (e.path && e.path[0] || e.composedPath && e.composedPath()[0]) || s, l = r.filter;
639
- if (go(o), !d && !(/mousedown|pointerdown/.test(i) && e.button !== 0 || r.disabled) && !c.isContentEditable && !(!this.nativeDraggable && We && s && s.tagName.toUpperCase() === "SELECT") && (s = ie(s, r.draggable, o, !1), !(s && s.animated) && rt !== s)) {
640
- if (Ve = ne(s), Ue = ne(s, r.draggable), typeof l == "function") {
641
- if (l.call(this, e, s, this)) {
642
- j({
643
- sortable: n,
644
- rootEl: c,
645
- name: "filter",
646
- targetEl: s,
647
- toEl: o,
648
- fromEl: o
649
- }), G("filter", n, {
650
- evt: e
651
- }), a && e.cancelable && e.preventDefault();
652
- return;
653
- }
654
- } else if (l && (l = l.split(",").some(function(f) {
655
- if (f = ie(c, f.trim(), o, !1), f)
656
- return j({
657
- sortable: n,
658
- rootEl: f,
659
- name: "filter",
660
- targetEl: s,
661
- fromEl: o,
662
- toEl: o
663
- }), G("filter", n, {
664
- evt: e
665
- }), !0;
666
- }), l)) {
667
- a && e.cancelable && e.preventDefault();
668
- return;
669
- }
670
- r.handle && !ie(c, r.handle, o, !1) || this._prepareDragStart(e, u, s);
671
- }
672
- }
673
- },
674
- _prepareDragStart: function(e, n, o) {
675
- var r = this, a = r.el, i = r.options, u = a.ownerDocument, s;
676
- if (o && !d && o.parentNode === a) {
677
- var c = P(o);
678
- if (T = a, d = o, C = d.parentNode, Te = d.nextSibling, rt = o, Qe = i.group, v.dragged = d, Ee = {
679
- target: d,
680
- clientX: (n || e).clientX,
681
- clientY: (n || e).clientY
682
- }, Gt = Ee.clientX - c.left, zt = Ee.clientY - c.top, this._lastX = (n || e).clientX, this._lastY = (n || e).clientY, d.style["will-change"] = "all", s = function() {
683
- if (G("delayEnded", r, {
684
- evt: e
685
- }), v.eventCanceled) {
686
- r._onDrop();
687
- return;
688
- }
689
- r._disableDelayedDragEvents(), !Xt && r.nativeDraggable && (d.draggable = !0), r._triggerDragStart(e, n), j({
690
- sortable: r,
691
- name: "choose",
692
- originalEvent: e
693
- }), K(d, i.chosenClass, !0);
694
- }, i.ignore.split(",").forEach(function(l) {
695
- an(d, l.trim(), wt);
696
- }), D(u, "dragover", Se), D(u, "mousemove", Se), D(u, "touchmove", Se), D(u, "mouseup", r._onDrop), D(u, "touchend", r._onDrop), D(u, "touchcancel", r._onDrop), Xt && this.nativeDraggable && (this.options.touchStartThreshold = 4, d.draggable = !0), G("delayStart", this, {
697
- evt: e
698
- }), i.delay && (!i.delayOnTouchOnly || n) && (!this.nativeDraggable || !(Ke || he))) {
699
- if (v.eventCanceled) {
700
- this._onDrop();
701
- return;
702
- }
703
- D(u, "mouseup", r._disableDelayedDrag), D(u, "touchend", r._disableDelayedDrag), D(u, "touchcancel", r._disableDelayedDrag), D(u, "mousemove", r._delayedDragTouchMoveHandler), D(u, "touchmove", r._delayedDragTouchMoveHandler), i.supportPointer && D(u, "pointermove", r._delayedDragTouchMoveHandler), r._dragStartTimer = setTimeout(s, i.delay);
704
- } else
705
- s();
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 && wt(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 (Ae = !1, T && d) {
730
- G("dragStarted", this, {
731
- evt: n
732
- }), this.nativeDraggable && D(document, "dragover", lo);
733
- var o = this.options;
734
- !e && K(d, o.dragClass, !1), K(d, o.ghostClass, !0), v.active = this, e && this._appendGhost(), j({
735
- sortable: this,
736
- name: "start",
737
- originalEvent: n
738
- });
739
- } else
740
- this._nulling();
741
- },
742
- _emulateDragOver: function() {
743
- if (ae) {
744
- this._lastX = ae.clientX, this._lastY = ae.clientY, mn();
745
- for (var e = document.elementFromPoint(ae.clientX, ae.clientY), n = e; e && e.shadowRoot && (e = e.shadowRoot.elementFromPoint(ae.clientX, ae.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: ae.clientX,
753
- clientY: ae.clientY,
754
- target: e,
755
- rootEl: n
756
- }), o && !this.options.dragoverBubble)
757
- break;
758
- }
759
- e = n;
760
- } while (n = n.parentNode);
761
- pn();
762
- }
763
- },
764
- _onTouchMove: function(e) {
765
- if (Ee) {
766
- var n = this.options, o = n.fallbackTolerance, r = n.fallbackOffset, a = e.touches ? e.touches[0] : e, i = _ && Le(_, !0), u = _ && i && i.a, s = _ && i && i.d, c = tt && U && jt(U), l = (a.clientX - Ee.clientX + r.x) / (u || 1) + (c ? c[0] - _t[0] : 0) / (u || 1), f = (a.clientY - Ee.clientY + r.y) / (s || 1) + (c ? c[1] - _t[1] : 0) / (s || 1);
767
- if (!v.active && !Ae) {
768
- if (o && Math.max(Math.abs(a.clientX - this._lastX), Math.abs(a.clientY - this._lastY)) < o)
769
- return;
770
- this._onDragStart(e, !0);
771
- }
772
- if (_) {
773
- i ? (i.e += l - (bt || 0), i.f += f - (yt || 0)) : i = {
774
- a: 1,
775
- b: 0,
776
- c: 0,
777
- d: 1,
778
- e: l,
779
- f
780
- };
781
- var h = "matrix(".concat(i.a, ",").concat(i.b, ",").concat(i.c, ",").concat(i.d, ",").concat(i.e, ",").concat(i.f, ")");
782
- g(_, "webkitTransform", h), g(_, "mozTransform", h), g(_, "msTransform", h), g(_, "transform", h), bt = l, yt = f, ae = a;
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, tt, !0, e), o = this.options;
790
- if (tt) {
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 = se()), n.top += U.scrollTop, n.left += U.scrollLeft) : U = se(), _t = jt(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", tt ? "absolute" : "fixed"), g(_, "zIndex", "100000"), g(_, "pointerEvents", "none"), v.ghost = _, e.appendChild(_), g(_, "transform-origin", Gt / parseInt(_.style.width) * 100 + "% " + zt / parseInt(_.style.height) * 100 + "%");
796
- }
797
- },
798
- _onDragStart: function(e, n) {
799
- var o = this, r = e.dataTransfer, a = o.options;
800
- if (G("dragStart", this, {
801
- evt: e
802
- }), v.eventCanceled) {
803
- this._onDrop();
804
- return;
805
- }
806
- G("setupClone", this), v.eventCanceled || (x = un(d), x.draggable = !1, x.style["will-change"] = "", this._hideClone(), K(x, this.options.chosenClass, !1), v.clone = x), o.cloneId = it(function() {
807
- G("clone", o), !v.eventCanceled && (o.options.removeCloneOnHide || T.insertBefore(x, d), o._hideClone(), j({
808
- sortable: o,
809
- name: "clone"
810
- }));
811
- }), !n && K(d, a.dragClass, !0), n ? (ut = !0, o._loopId = setInterval(o._emulateDragOver, 50)) : (S(document, "mouseup", o._onDrop), S(document, "touchend", o._onDrop), S(document, "touchcancel", o._onDrop), r && (r.effectAllowed = "move", a.setData && a.setData.call(o, r, d)), D(document, "drop", o), g(d, "transform", "translateZ(0)")), Ae = !0, o._dragStartId = it(o._dragStarted.bind(o, n, e)), D(document, "selectstart", o), $e = !0, We && 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, r, a, i, u = this.options, s = u.group, c = v.active, l = Qe === s, f = u.sort, h = R || c, w, b = this, y = !1;
816
- if (Ot) return;
817
- function Y(we, ge) {
818
- G(we, b, ue({
819
- evt: e,
820
- isOwner: l,
821
- axis: w ? "vertical" : "horizontal",
822
- revert: i,
823
- dragRect: r,
824
- targetRect: a,
825
- canSort: f,
826
- fromSortable: h,
827
- target: o,
828
- completed: F,
829
- onMove: function(A, Cn) {
830
- return nt(T, n, d, r, A, P(A), e, Cn);
831
- },
832
- changed: W
833
- }, ge));
834
- }
835
- function B() {
836
- Y("dragOverAnimationCapture"), b.captureAnimationState(), b !== h && h.captureAnimationState();
837
- }
838
- function F(we) {
839
- return Y("dragOverCompleted", {
840
- insertion: we
841
- }), we && (l ? c._hideClone() : c._showClone(b), b !== h && (K(d, R ? R.options.ghostClass : c.options.ghostClass, !1), K(d, u.ghostClass, !0)), R !== b && b !== v.active ? R = b : b === v.active && R && (R = null), h === b && (b._ignoreWhileAnimating = o), b.animateAll(function() {
842
- Y("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), !we && Se(e)), !u.dragoverBubble && e.stopPropagation && e.stopPropagation(), y = !0;
844
- }
845
- function W() {
846
- J = ne(d), ve = ne(d, u.draggable), j({
847
- sortable: b,
848
- name: "change",
849
- toEl: n,
850
- newIndex: J,
851
- newDraggableIndex: ve,
852
- originalEvent: e
853
- });
854
- }
855
- if (e.preventDefault !== void 0 && e.cancelable && e.preventDefault(), o = ie(o, u.draggable, n, !0), Y("dragOver"), v.eventCanceled) return y;
856
- if (d.contains(e.target) || o.animated && o.animatingX && o.animatingY || b._ignoreWhileAnimating === o)
857
- return F(!1);
858
- if (ut = !1, c && !u.disabled && (l ? f || (i = C !== T) : R === this || (this.lastPutMode = Qe.checkPull(this, c, d, e)) && s.checkPut(this, c, d, e))) {
859
- if (w = this._getDirection(e, o) === "vertical", r = P(d), Y("dragOverValid"), v.eventCanceled) return y;
860
- if (i)
861
- return C = T, B(), this._hideClone(), Y("revert"), v.eventCanceled || (Te ? T.insertBefore(d, Te) : T.appendChild(d)), F(!0);
862
- var H = Mt(n, u.draggable);
863
- if (!H || fo(e, w, this) && !H.animated) {
864
- if (H === d)
865
- return F(!1);
866
- if (H && n === e.target && (o = H), o && (a = P(o)), nt(T, n, d, r, o, a, e, !!o) !== !1)
867
- return B(), n.appendChild(d), C = n, W(), F(!0);
868
- } else if (H && co(e, w, this)) {
869
- var X = Be(n, 0, u, !0);
870
- if (X === d)
871
- return F(!1);
872
- if (o = X, a = P(o), nt(T, n, d, r, o, a, e, !1) !== !1)
873
- return B(), n.insertBefore(d, X), C = n, W(), F(!0);
874
- } else if (o.parentNode === n) {
875
- a = P(o);
876
- var ee = 0, ce, m = d.parentNode !== n, p = !ao(d.animated && d.toRect || r, o.animated && o.toRect || a, w), E = w ? "top" : "left", O = Ht(o, "top", "top") || Ht(d, "top", "top"), oe = O ? O.scrollTop : void 0;
877
- Ie !== o && (ce = a[E], je = !1, et = !p && u.invertSwap || m), ee = mo(e, o, a, w, p ? 1 : u.swapThreshold, u.invertedSwapThreshold == null ? u.swapThreshold : u.invertedSwapThreshold, et, Ie === o);
878
- var q;
879
- if (ee !== 0) {
880
- var re = ne(d);
881
- do
882
- re -= ee, q = C.children[re];
883
- while (q && (g(q, "display") === "none" || q === _));
884
- }
885
- if (ee === 0 || q === o)
886
- return F(!1);
887
- Ie = o, He = ee;
888
- var $ = o.nextElementSibling, te = !1;
889
- te = ee === 1;
890
- var xe = nt(T, n, d, r, o, a, e, te);
891
- if (xe !== !1)
892
- return (xe === 1 || xe === -1) && (te = xe === 1), Ot = !0, setTimeout(uo, 30), B(), te && !$ ? n.appendChild(d) : o.parentNode.insertBefore(d, te ? $ : o), O && sn(O, 0, oe - O.scrollTop), C = d.parentNode, ce !== void 0 && !et && (at = Math.abs(ce - P(o)[E])), W(), F(!0);
893
- }
894
- if (n.contains(d))
895
- return F(!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 = ne(d), ve = ne(d, o.draggable), G("drop", this, {
910
- evt: e
911
- }), C = d && d.parentNode, J = ne(d), ve = ne(d, o.draggable), v.eventCanceled) {
912
- this._nulling();
913
- return;
914
- }
915
- Ae = !1, et = !1, je = !1, clearInterval(this._loopId), clearTimeout(this._dragStartTimer), Ft(this.cloneId), Ft(this._dragStartId), this.nativeDraggable && (S(document, "drop", this), S(n, "dragstart", this._onDragStart)), this._offMoveEvents(), this._offUpEvents(), We && g(document.body, "user-select", ""), g(d, "transform", ""), e && ($e && (e.cancelable && e.preventDefault(), !o.dropBubble && e.stopPropagation()), _ && _.parentNode && _.parentNode.removeChild(_), (T === C || R && R.lastPutMode !== "clone") && x && x.parentNode && x.parentNode.removeChild(x), d && (this.nativeDraggable && S(d, "dragend", this), wt(d), d.style["will-change"] = "", $e && !Ae && K(d, R ? R.options.ghostClass : this.options.ghostClass, !1), K(d, this.options.chosenClass, !1), j({
916
- sortable: this,
917
- name: "unchoose",
918
- toEl: C,
919
- newIndex: null,
920
- newDraggableIndex: null,
921
- originalEvent: e
922
- }), T !== C ? (J >= 0 && (j({
923
- rootEl: C,
924
- name: "add",
925
- toEl: C,
926
- fromEl: T,
927
- originalEvent: e
928
- }), j({
929
- sortable: this,
930
- name: "remove",
931
- toEl: C,
932
- originalEvent: e
933
- }), j({
934
- rootEl: C,
935
- name: "sort",
936
- toEl: C,
937
- fromEl: T,
938
- originalEvent: e
939
- }), j({
940
- sortable: this,
941
- name: "sort",
942
- toEl: C,
943
- originalEvent: e
944
- })), R && R.save()) : J !== Ve && J >= 0 && (j({
945
- sortable: this,
946
- name: "update",
947
- toEl: C,
948
- originalEvent: e
949
- }), j({
950
- sortable: this,
951
- name: "sort",
952
- toEl: C,
953
- originalEvent: e
954
- })), v.active && ((J == null || J === -1) && (J = Ve, ve = Ue), j({
955
- sortable: this,
956
- name: "end",
957
- toEl: C,
958
- originalEvent: e
959
- }), this.save()))), this._nulling();
960
- },
961
- _nulling: function() {
962
- G("nulling", this), T = d = C = _ = Te = x = rt = ye = Ee = ae = $e = J = ve = Ve = Ue = Ie = He = R = Qe = v.dragged = v.ghost = v.clone = v.active = null, dt.forEach(function(e) {
963
- e.checked = !0;
964
- }), dt.length = bt = yt = 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), so(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, r = 0, a = o.length, i = this.options; r < a; r++)
987
- n = o[r], ie(n, i.draggable, this.el, !1) && e.push(n.getAttribute(i.dataIdAttr) || ho(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 = {}, r = this.el;
996
- this.toArray().forEach(function(a, i) {
997
- var u = r.children[i];
998
- ie(u, this.options.draggable, r, !1) && (o[a] = u);
999
- }, this), n && this.captureAnimationState(), e.forEach(function(a) {
1000
- o[a] && (r.removeChild(o[a]), r.appendChild(o[a]));
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 ie(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 r = Je.modifyOption(this, e, n);
1030
- typeof r < "u" ? o[e] = r : o[e] = n, e === "group" && fn(o);
1031
- },
1032
- /**
1033
- * Destroy
1034
- */
1035
- destroy: function() {
1036
- G("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(), ct.splice(ct.indexOf(this.el), 1), this.el = e = null;
1041
- },
1042
- _hideClone: function() {
1043
- if (!ye) {
1044
- if (G("hideClone", this), v.eventCanceled) return;
1045
- g(x, "display", "none"), this.options.removeCloneOnHide && x.parentNode && x.parentNode.removeChild(x), ye = !0;
1046
- }
1047
- },
1048
- _showClone: function(e) {
1049
- if (e.lastPutMode !== "clone") {
1050
- this._hideClone();
1051
- return;
1052
- }
1053
- if (ye) {
1054
- if (G("showClone", this), v.eventCanceled) return;
1055
- d.parentNode == T && !this.options.group.revertClone ? T.insertBefore(x, d) : Te ? T.insertBefore(x, Te) : T.appendChild(x), this.options.group.revertClone && this.animate(d, x), g(x, "display", ""), ye = !1;
1056
- }
1057
- }
1058
- };
1059
- function so(t) {
1060
- t.dataTransfer && (t.dataTransfer.dropEffect = "move"), t.cancelable && t.preventDefault();
1061
- }
1062
- function nt(t, e, n, o, r, a, i, u) {
1063
- var s, c = t[Z], l = c.options.onMove, f;
1064
- return window.CustomEvent && !he && !Ke ? s = new CustomEvent("move", {
1065
- bubbles: !0,
1066
- cancelable: !0
1067
- }) : (s = document.createEvent("Event"), s.initEvent("move", !0, !0)), s.to = e, s.from = t, s.dragged = n, s.draggedRect = o, s.related = r || e, s.relatedRect = a || P(e), s.willInsertAfter = u, s.originalEvent = i, t.dispatchEvent(s), l && (f = l.call(c, s, i)), f;
1068
- }
1069
- function wt(t) {
1070
- t.draggable = !1;
1071
- }
1072
- function uo() {
1073
- Ot = !1;
1074
- }
1075
- function co(t, e, n) {
1076
- var o = P(Be(n.el, 0, n.options, !0)), r = 10;
1077
- return e ? t.clientX < o.left - r || t.clientY < o.top && t.clientX < o.right : t.clientY < o.top - r || t.clientY < o.bottom && t.clientX < o.left;
1078
- }
1079
- function fo(t, e, n) {
1080
- var o = P(Mt(n.el, n.options.draggable)), r = 10;
1081
- return e ? t.clientX > o.right + r || 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 + r;
1082
- }
1083
- function mo(t, e, n, o, r, a, i, u) {
1084
- var s = o ? t.clientY : t.clientX, c = o ? n.height : n.width, l = o ? n.top : n.left, f = o ? n.bottom : n.right, h = !1;
1085
- if (!i) {
1086
- if (u && at < c * r) {
1087
- if (!je && (He === 1 ? s > l + c * a / 2 : s < f - c * a / 2) && (je = !0), je)
1088
- h = !0;
1089
- else if (He === 1 ? s < l + at : s > f - at)
1090
- return -He;
1091
- } else if (s > l + c * (1 - r) / 2 && s < f - c * (1 - r) / 2)
1092
- return po(e);
1093
- }
1094
- return h = h || i, h && (s < l + c * a / 2 || s > f - c * a / 2) ? s > l + c / 2 ? 1 : -1 : 0;
1095
- }
1096
- function po(t) {
1097
- return ne(d) < ne(t) ? 1 : -1;
1098
- }
1099
- function ho(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 go(t) {
1105
- dt.length = 0;
1106
- for (var e = t.getElementsByTagName("input"), n = e.length; n--; ) {
1107
- var o = e[n];
1108
- o.checked && dt.push(o);
1109
- }
1110
- }
1111
- function it(t) {
1112
- return setTimeout(t, 0);
1113
- }
1114
- function Ft(t) {
1115
- return clearTimeout(t);
1116
- }
1117
- mt && D(document, "touchmove", function(t) {
1118
- (v.active || Ae) && t.cancelable && t.preventDefault();
1119
- });
1120
- v.utils = {
1121
- on: D,
1122
- off: S,
1123
- css: g,
1124
- find: an,
1125
- is: function(e, n) {
1126
- return !!ie(e, n, e, !1);
1127
- },
1128
- extend: Jn,
1129
- throttle: ln,
1130
- closest: ie,
1131
- toggleClass: K,
1132
- clone: un,
1133
- index: ne,
1134
- nextTick: it,
1135
- cancelNextTick: Ft,
1136
- detectDirection: dn,
1137
- getChild: Be
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 = ue(ue({}, v.utils), o.utils)), Je.mount(o);
1149
- });
1150
- };
1151
- v.create = function(t, e) {
1152
- return new v(t, e);
1153
- };
1154
- v.version = Gn;
1155
- var I = [], Re, It, kt = !1, Et, St, ft, Ye;
1156
- function vo() {
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(), lt(), Zn();
1179
- },
1180
- nulling: function() {
1181
- ft = It = Re = kt = Ye = Et = St = null, I.length = 0;
1182
- },
1183
- _handleFallbackAutoScroll: function(n) {
1184
- this._handleAutoScroll(n, !0);
1185
- },
1186
- _handleAutoScroll: function(n, o) {
1187
- var r = this, a = (n.touches ? n.touches[0] : n).clientX, i = (n.touches ? n.touches[0] : n).clientY, u = document.elementFromPoint(a, i);
1188
- if (ft = n, o || this.options.forceAutoScrollFallback || Ke || he || We) {
1189
- Dt(n, this.options, u, o);
1190
- var s = _e(u, !0);
1191
- kt && (!Ye || a !== Et || i !== St) && (Ye && Kt(), Ye = setInterval(function() {
1192
- var c = _e(document.elementFromPoint(a, i), !0);
1193
- c !== s && (s = c, lt()), Dt(n, r.options, c, o);
1194
- }, 10), Et = a, St = i);
1195
- } else {
1196
- if (!this.options.bubbleScroll || _e(u, !0) === se()) {
1197
- lt();
1198
- return;
1199
- }
1200
- Dt(n, this.options, _e(u, !1), !1);
1201
- }
1202
- }
1203
- }, pe(t, {
1204
- pluginName: "scroll",
1205
- initializeByDefault: !0
1206
- });
1207
- }
1208
- function lt() {
1209
- I.forEach(function(t) {
1210
- clearInterval(t.pid);
1211
- }), I = [];
1212
- }
1213
- function Kt() {
1214
- clearInterval(Ye);
1215
- }
1216
- var Dt = ln(function(t, e, n, o) {
1217
- if (e.scroll) {
1218
- var r = (t.touches ? t.touches[0] : t).clientX, a = (t.touches ? t.touches[0] : t).clientY, i = e.scrollSensitivity, u = e.scrollSpeed, s = se(), c = !1, l;
1219
- It !== n && (It = n, lt(), Re = e.scroll, l = e.scrollFn, Re === !0 && (Re = _e(n, !0)));
1220
- var f = 0, h = Re;
1221
- do {
1222
- var w = h, b = P(w), y = b.top, Y = b.bottom, B = b.left, F = b.right, W = b.width, H = b.height, X = void 0, ee = void 0, ce = w.scrollWidth, m = w.scrollHeight, p = g(w), E = w.scrollLeft, O = w.scrollTop;
1223
- w === s ? (X = W < ce && (p.overflowX === "auto" || p.overflowX === "scroll" || p.overflowX === "visible"), ee = H < m && (p.overflowY === "auto" || p.overflowY === "scroll" || p.overflowY === "visible")) : (X = W < ce && (p.overflowX === "auto" || p.overflowX === "scroll"), ee = H < m && (p.overflowY === "auto" || p.overflowY === "scroll"));
1224
- var oe = X && (Math.abs(F - r) <= i && E + W < ce) - (Math.abs(B - r) <= i && !!E), q = ee && (Math.abs(Y - a) <= i && O + H < m) - (Math.abs(y - a) <= i && !!O);
1225
- if (!I[f])
1226
- for (var re = 0; re <= f; re++)
1227
- I[re] || (I[re] = {});
1228
- (I[f].vx != oe || I[f].vy != q || I[f].el !== w) && (I[f].el = w, I[f].vx = oe, I[f].vy = q, clearInterval(I[f].pid), (oe != 0 || q != 0) && (c = !0, I[f].pid = setInterval((function() {
1229
- o && this.layer === 0 && v.active._onTouchMove(ft);
1230
- var $ = I[this.layer].vy ? I[this.layer].vy * u : 0, te = I[this.layer].vx ? I[this.layer].vx * u : 0;
1231
- typeof l == "function" && l.call(v.dragged.parentNode[Z], te, $, t, ft, I[this.layer].el) !== "continue" || sn(I[this.layer].el, te, $);
1232
- }).bind({
1233
- layer: f
1234
- }), 24))), f++;
1235
- } while (e.bubbleScroll && h !== s && (h = _e(h, !1)));
1236
- kt = c;
1237
- }
1238
- }, 30), hn = function(e) {
1239
- var n = e.originalEvent, o = e.putSortable, r = e.dragEl, a = e.activeSortable, i = e.dispatchSortableEvent, u = e.hideGhostForTarget, s = e.unhideGhostForTarget;
1240
- if (n) {
1241
- var c = o || a;
1242
- u();
1243
- var l = n.changedTouches && n.changedTouches.length ? n.changedTouches[0] : n, f = document.elementFromPoint(l.clientX, l.clientY);
1244
- s(), c && !c.el.contains(f) && (i("spill"), this.onSpill({
1245
- dragEl: r,
1246
- putSortable: o
1247
- }));
1248
- }
1249
- };
1250
- function Lt() {
1251
- }
1252
- Lt.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 r = Be(this.sortable.el, this.startIndex, this.options);
1262
- r ? this.sortable.el.insertBefore(n, r) : this.sortable.el.appendChild(n), this.sortable.animateAll(), o && o.animateAll();
1263
- },
1264
- drop: hn
1265
- };
1266
- pe(Lt, {
1267
- pluginName: "revertOnSpill"
1268
- });
1269
- function Bt() {
1270
- }
1271
- Bt.prototype = {
1272
- onSpill: function(e) {
1273
- var n = e.dragEl, o = e.putSortable, r = o || this.sortable;
1274
- r.captureAnimationState(), n.parentNode && n.parentNode.removeChild(n), r.animateAll();
1275
- },
1276
- drop: hn
1277
- };
1278
- pe(Bt, {
1279
- pluginName: "removeOnSpill"
1280
- });
1281
- v.mount(new vo());
1282
- v.mount(Bt, Lt);
1283
- function Tt(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 bo() {
1291
- return typeof window < "u" ? window.console : globalThis.console;
1292
- }
1293
- const yo = bo();
1294
- function _o(t) {
1295
- const e = /* @__PURE__ */ Object.create(null);
1296
- return function(o) {
1297
- return e[o] || (e[o] = t(o));
1298
- };
1299
- }
1300
- const wo = /-(\w)/g, Eo = _o((t) => t.replace(wo, (e, n) => n.toUpperCase())), gn = ["Start", "Add", "Remove", "Update", "End"], vn = ["Choose", "Unchoose", "Sort", "Filter", "Clone"], bn = ["Move"], So = [bn, gn, vn].flatMap((t) => t).map((t) => `on${t}`), At = {
1301
- manage: bn,
1302
- manageAndEmit: gn,
1303
- emit: vn
1304
- };
1305
- function Do(t) {
1306
- return So.indexOf(t) !== -1;
1307
- }
1308
- const To = [
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 Co(t) {
1428
- return To.includes(t);
1429
- }
1430
- function xo(t) {
1431
- return ["transition-group", "TransitionGroup"].includes(t);
1432
- }
1433
- function yn(t) {
1434
- return ["id", "class", "role", "style"].includes(t) || t.startsWith("data-") || t.startsWith("aria-") || t.startsWith("on");
1435
- }
1436
- function _n(t) {
1437
- return t.reduce((e, [n, o]) => (e[n] = o, e), {});
1438
- }
1439
- function Oo({ $attrs: t, componentData: e = {} }) {
1440
- return {
1441
- ..._n(
1442
- Object.entries(t).filter(([o, r]) => yn(o))
1443
- ),
1444
- ...e
1445
- };
1446
- }
1447
- function Fo({ $attrs: t, callBackBuilder: e }) {
1448
- const n = _n(wn(t));
1449
- Object.entries(e).forEach(([r, a]) => {
1450
- At[r].forEach((i) => {
1451
- n[`on${i}`] = a(i);
1452
- });
1453
- });
1454
- const o = `[data-draggable]${n.draggable || ""}`;
1455
- return {
1456
- ...n,
1457
- draggable: o
1458
- };
1459
- }
1460
- function wn(t) {
1461
- return Object.entries(t).filter(([e, n]) => !yn(e)).map(([e, n]) => [Eo(e), n]).filter(([e, n]) => !Do(e));
1462
- }
1463
- const Zt = ({ el: t }) => t, Io = (t, e) => t.__draggable_context = e, Qt = (t) => t.__draggable_context;
1464
- class ko {
1465
- constructor({
1466
- nodes: { header: e, default: n, footer: o },
1467
- root: r,
1468
- realList: a
1469
- }) {
1470
- this.defaultNodes = n, this.children = [...e, ...n, ...o], this.externalComponent = r.externalComponent, this.rootTransition = r.transition, this.tag = r.tag, this.realList = a;
1471
- }
1472
- get _isRootComponent() {
1473
- return this.externalComponent || this.rootTransition;
1474
- }
1475
- render(e, n) {
1476
- const { tag: o, children: r, _isRootComponent: a } = this;
1477
- return e(o, n, a ? { default: () => r } : r);
1478
- }
1479
- updated() {
1480
- const { defaultNodes: e, realList: n } = this;
1481
- e.forEach((o, r) => {
1482
- Io(Zt(o), {
1483
- element: n[r],
1484
- index: r
1485
- });
1486
- });
1487
- }
1488
- getUnderlyingVm(e) {
1489
- return Qt(e);
1490
- }
1491
- getVmIndexFromDomIndex(e, n) {
1492
- const { defaultNodes: o } = this, { length: r } = o, a = n.children, i = a.item(e);
1493
- if (i === null)
1494
- return r;
1495
- const u = Qt(i);
1496
- if (u)
1497
- return u.index;
1498
- if (r === 0)
1499
- return 0;
1500
- const s = Zt(o[0]), c = [...a].findIndex(
1501
- (l) => l === s
1502
- );
1503
- return e < c ? 0 : r;
1504
- }
1505
- }
1506
- function Ao(t, e) {
1507
- const n = t[e];
1508
- return n ? n() : [];
1509
- }
1510
- function No({ $slots: t, realList: e, getKey: n }) {
1511
- const o = e || [], [r, a] = ["header", "footer"].map(
1512
- (s) => Ao(t, s)
1513
- ), { item: i } = t;
1514
- if (!i)
1515
- throw new Error("draggable element must have an item slot");
1516
- const u = o.flatMap(
1517
- (s, c) => i({ element: s, index: c }).map((l) => (l.key = n(s), l.props = { ...l.props || {}, "data-draggable": !0 }, l))
1518
- );
1519
- if (u.length !== o.length)
1520
- throw new Error("Item slot must have only one child");
1521
- return {
1522
- header: r,
1523
- footer: a,
1524
- default: u
1525
- };
1526
- }
1527
- function Po(t) {
1528
- const e = xo(t), n = !Co(t) && !e;
1529
- return {
1530
- transition: e,
1531
- externalComponent: n,
1532
- tag: n ? N(t) : e ? In : t
1533
- };
1534
- }
1535
- function Vo({ $slots: t, tag: e, realList: n, getKey: o }) {
1536
- const r = No({ $slots: t, realList: n, getKey: o }), a = Po(e);
1537
- return new ko({ nodes: r, root: a, realList: n });
1538
- }
1539
- function En(t, e) {
1540
- en(() => this.$emit(t.toLowerCase(), e));
1541
- }
1542
- function Sn(t) {
1543
- return (e, n) => {
1544
- if (this.realList !== null)
1545
- return this[`onDrag${t}`](e, n);
1546
- };
1547
- }
1548
- function Mo(t) {
1549
- const e = Sn.call(this, t);
1550
- return (n, o) => {
1551
- e.call(this, n, o), En.call(this, t, n);
1552
- };
1553
- }
1554
- let Ct = null;
1555
- const Lo = {
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
- }, Bo = [
1588
- "update:modelValue",
1589
- "change",
1590
- ...[...At.manageAndEmit, ...At.emit].map((t) => t.toLowerCase())
1591
- ], $o = Ce({
1592
- name: "draggable",
1593
- inheritAttrs: !1,
1594
- props: Lo,
1595
- emits: Bo,
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: r, getKey: a } = this, i = Vo({
1605
- $slots: t,
1606
- tag: n,
1607
- realList: r,
1608
- getKey: a
1609
- });
1610
- this.componentStructure = i;
1611
- const u = Oo({ $attrs: e, componentData: o });
1612
- return i.render($t, u);
1613
- } catch (t) {
1614
- return this.error = !0, $t("pre", { style: { color: "red" } }, t.stack);
1615
- }
1616
- },
1617
- created() {
1618
- this.list !== null && this.modelValue !== null && yo.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 = Fo({
1628
- $attrs: t,
1629
- callBackBuilder: {
1630
- manageAndEmit: (a) => Mo.call(this, a),
1631
- emit: (a) => En.bind(this, a),
1632
- manage: (a) => Sn.call(this, a)
1633
- }
1634
- }), r = e.nodeType === 1 ? e : e.parentElement;
1635
- this._sortable = new v(r, o), this.targetDomElement = r, r.__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 && wn(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, r = { list: o, component: n };
1695
- return t !== e && o ? { ...n.getUnderlyingVm(e) || {}, ...r } : r;
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
- Tt(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
- Tt(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
- Tt(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
- (i) => i.style.display !== "none"
1738
- ), o = n.indexOf(e.related), r = t.component.getVmIndexFromDomIndex(
1739
- o
1740
- );
1741
- return n.indexOf(Ct) !== -1 || !e.willInsertAfter ? r : r + 1;
1742
- },
1743
- onDragMove(t, e) {
1744
- const { move: n, realList: o } = this;
1745
- if (!n || !o)
1746
- return !0;
1747
- const r = this.getRelatedContextFromMoveEvent(t), a = this.computeFutureIndex(r, t), i = {
1748
- ...this.context,
1749
- futureIndex: a
1750
- }, u = {
1751
- ...t,
1752
- relatedContext: r,
1753
- draggedContext: i
1754
- };
1755
- return n(u, e);
1756
- },
1757
- onDragEnd() {
1758
- Ct = null;
1759
- }
1760
- }
1761
- }), Ro = 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: Nn(t[0]),
1791
- icon: e,
1792
- value: t[1]
1793
- };
1794
- }), Yo = /* @__PURE__ */ Ce({
1795
- __name: "WidgetTypeList",
1796
- props: /* @__PURE__ */ Nt({
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 } = Pt(), n = ze(t, "modelValue"), o = t, r = ke(
1819
- () => Ro.map((a) => ({
1820
- ...a,
1821
- label: e(`report.widget.types.${a.value.toLowerCase()}`)
1822
- }))
1823
- );
1824
- return (a, i) => {
1825
- const u = N("FmIcon"), s = N("FmCard");
1826
- return V(), Q("div", null, [
1827
- (V(!0), Q(qe, null, tn(r.value.filter(
1828
- (c) => o.excludeWidgeType.indexOf(c.value) === -1
1829
- ), (c, l) => (V(), Me(s, {
1830
- key: l,
1831
- class: kn(`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: le(() => [
1836
- k(u, {
1837
- name: c.icon,
1838
- size: o.isList ? "md" : "lg",
1839
- outline: !0
1840
- }, null, 8, ["name", "size"]),
1841
- nn(" " + Pe(c.label), 1)
1842
- ]),
1843
- _: 2
1844
- }, 1032, ["class", "onClick"]))), 128))
1845
- ]);
1846
- };
1847
- }
1848
- }), mr = /* @__PURE__ */ Vt(Yo, [["__scopeId", "data-v-7c1916a3"]]);
1849
- function Wo(t) {
1850
- let e, n, o;
1851
- switch (t) {
1852
- case L.Table:
1853
- e = [], n = !1, o = $n.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 pr(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: Wo(t)
1906
- }
1907
- };
1908
- }
1909
- function hr(t, e) {
1910
- return t.filter((n, o) => o !== e);
1911
- }
1912
- const Xo = {
1913
- key: 0,
1914
- class: "flex flex-col gap-5"
1915
- }, Uo = /* @__PURE__ */ Ce({
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 r = N("FmIcon"), a = N("FmMenuDivider");
1926
- return V(), Q(qe, null, [
1927
- be("div", {
1928
- class: "flex items-center cursor-pointer fm-typo-en-body-lg-600",
1929
- onClick: o[0] || (o[0] = (i) => e.value = !e.value)
1930
- }, [
1931
- Ge(n.$slots, "header", {}, void 0, !0),
1932
- k(r, {
1933
- name: e.value ? "keyboard_arrow_up" : "keyboard_arrow_down"
1934
- }, null, 8, ["name"])
1935
- ]),
1936
- k(xt, { name: "slide-fade" }, {
1937
- default: le(() => [
1938
- e.value ? (V(), Q("div", Xo, [
1939
- Ge(n.$slots, "content", {}, void 0, !0)
1940
- ])) : fe("", !0)
1941
- ]),
1942
- _: 3
1943
- }),
1944
- k(a)
1945
- ], 64);
1946
- };
1947
- }
1948
- }), gr = /* @__PURE__ */ Vt(Uo, [["__scopeId", "data-v-fa67a3a4"]]);
1949
- var Ne = /* @__PURE__ */ ((t) => (t.Select = "Select", t.TextField = "TextField", t.Timestamp = "Timestamp", t))(Ne || {});
1950
- function Ho(t) {
1951
- let e = !1, n = 1;
1952
- switch (t) {
1953
- case de.Equal:
1954
- case de.NotEqual:
1955
- case de.Like:
1956
- case de.NotLike:
1957
- e = !1, n = 1;
1958
- break;
1959
- case de.GreaterThan:
1960
- case de.GreaterThanOrEqual:
1961
- case de.LessThan:
1962
- case de.LessThanOrEqual:
1963
- e = !0, n = 1;
1964
- break;
1965
- case de.Between:
1966
- e = !0, n = 2;
1967
- break;
1968
- }
1969
- return {
1970
- fixed: e,
1971
- count: n
1972
- };
1973
- }
1974
- function jo({
1975
- operator: t,
1976
- dimensionOption: e,
1977
- dataType: n,
1978
- t: o
1979
- }) {
1980
- const { fixed: r, count: a } = Ho(t);
1981
- switch (n) {
1982
- case Ze.String:
1983
- return {
1984
- type: "TextField",
1985
- fixed: r,
1986
- count: a,
1987
- dataType: void 0,
1988
- default: ""
1989
- };
1990
- case Ze.Numeric:
1991
- return {
1992
- type: "TextField",
1993
- fixed: r,
1994
- count: a,
1995
- dataType: "number",
1996
- default: 0
1997
- };
1998
- case Ze.Bool:
1999
- return {
2000
- type: "Select",
2001
- fixed: r,
2002
- count: a,
2003
- options: [
2004
- { label: o("report.common.yes"), value: !0 },
2005
- { label: o("report.common.no"), value: !1 }
2006
- ],
2007
- default: !0
2008
- };
2009
- case Ze.Timestamp:
2010
- switch (e) {
2011
- case z.HourOfDay:
2012
- return {
2013
- type: "TextField",
2014
- fixed: r,
2015
- count: a,
2016
- dataType: "number",
2017
- default: "0"
2018
- };
2019
- case z.DayOfWeek:
2020
- return {
2021
- type: "Select",
2022
- fixed: r,
2023
- count: a,
2024
- options: [
2025
- { label: o("report.days.sunday"), value: "1" },
2026
- { label: o("report.days.monday"), value: "2" },
2027
- { label: o("report.days.tuesday"), value: "3" },
2028
- { label: o("report.days.wednesday"), value: "4" },
2029
- { label: o("report.days.thursday"), value: "5" },
2030
- { label: o("report.days.friday"), value: "6" },
2031
- { label: o("report.days.saturday"), value: "7" }
2032
- ],
2033
- default: "1"
2034
- };
2035
- case z.DayOfMonth:
2036
- return {
2037
- type: "TextField",
2038
- fixed: r,
2039
- count: a,
2040
- dataType: "number",
2041
- default: "1"
2042
- };
2043
- case z.MonthOfYear:
2044
- return {
2045
- type: "Select",
2046
- fixed: r,
2047
- count: a,
2048
- options: [
2049
- { label: o("report.months.january"), value: "1" },
2050
- { label: o("report.months.february"), value: "2" },
2051
- { label: o("report.months.march"), value: "3" },
2052
- { label: o("report.months.april"), value: "4" },
2053
- { label: o("report.months.may"), value: "5" },
2054
- { label: o("report.months.june"), value: "6" },
2055
- { label: o("report.months.july"), value: "7" },
2056
- { label: o("report.months.august"), value: "8" },
2057
- { label: o("report.months.september"), value: "9" },
2058
- { label: o("report.months.october"), value: "10" },
2059
- { label: o("report.months.november"), value: "11" },
2060
- { label: o("report.months.december"), value: "12" }
2061
- ],
2062
- default: "1"
2063
- };
2064
- case z.TimeOfDay:
2065
- return {
2066
- type: "Timestamp",
2067
- fixed: r,
2068
- count: a,
2069
- default: (/* @__PURE__ */ new Date()).toISOString()
2070
- };
2071
- }
2072
- }
2073
- return {
2074
- type: "TextField",
2075
- fixed: r,
2076
- count: a,
2077
- dataType: void 0,
2078
- default: ""
2079
- };
2080
- }
2081
- function Dn(t) {
2082
- switch (t) {
2083
- case z.HourOfDay:
2084
- return 0;
2085
- case z.DayOfMonth:
2086
- return 1;
2087
- default:
2088
- return;
2089
- }
2090
- }
2091
- function Tn(t) {
2092
- switch (t) {
2093
- case z.HourOfDay:
2094
- return 23;
2095
- case z.DayOfMonth:
2096
- return 31;
2097
- default:
2098
- return;
2099
- }
2100
- }
2101
- const Go = { class: "grow" }, zo = {
2102
- key: 2,
2103
- class: "w-full"
2104
- }, qo = { key: 0 }, Ko = /* @__PURE__ */ Ce({
2105
- __name: "FilterValueInput",
2106
- props: /* @__PURE__ */ Nt({
2107
- config: {
2108
- type: Object,
2109
- default: () => {
2110
- }
2111
- },
2112
- option: {
2113
- type: [String, null],
2114
- default: () => {
2115
- }
2116
- }
2117
- }, {
2118
- modelValue: { required: !0, default: () => [] },
2119
- modelModifiers: {}
2120
- }),
2121
- emits: ["update:modelValue"],
2122
- setup(t) {
2123
- const e = ze(t, "modelValue"), n = t, o = De([]);
2124
- function r(s) {
2125
- return (s ? ht(s) : ht()).format("HH:mm");
2126
- }
2127
- function a({ hour: s, minute: c }) {
2128
- return ht().set("hour", s).set("minute", c).toISOString();
2129
- }
2130
- function i(s, c) {
2131
- var w, b;
2132
- const l = Dn(n.option), f = Tn(n.option);
2133
- ((w = n.config) == null ? void 0 : w.type) === Ne.TextField && (l !== void 0 && c < l || f !== void 0 && c > f) && (o.value[s] = `Value must be between ${l} and ${f}`);
2134
- const h = [...e.value];
2135
- ((b = n.config) == null ? void 0 : b.type) === Ne.Timestamp ? h[s] = a({
2136
- hour: Number(c.split(":")[0]),
2137
- minute: Number(c.split(":")[1])
2138
- }) : h[s] = c, e.value = h;
2139
- }
2140
- function u(s) {
2141
- var c;
2142
- if (s === 0)
2143
- e.value = [(c = n.config) == null ? void 0 : c.default, ...e.value];
2144
- else {
2145
- const l = [...e.value];
2146
- l.splice(s, 1), e.value = l;
2147
- }
2148
- }
2149
- return (s, c) => {
2150
- const l = N("FmSelect"), f = N("FmTextField"), h = N("FmTimePicker"), w = N("FmButton");
2151
- return V(!0), Q(qe, null, tn(new Array(e.value.length !== 0 ? e.value.length : 1), (b, y) => {
2152
- var Y, B, F, W, H;
2153
- return V(), Q("div", {
2154
- key: y,
2155
- class: "flex flex-row align-center gap-2 w-full"
2156
- }, [
2157
- be("div", Go, [
2158
- ((Y = n.config) == null ? void 0 : Y.type) === M(Ne).Select ? (V(), Me(l, {
2159
- key: 0,
2160
- "model-value": e.value[y],
2161
- items: n.config.options,
2162
- "onUpdate:modelValue": (X) => i(y, X)
2163
- }, null, 8, ["model-value", "items", "onUpdate:modelValue"])) : ((B = n.config) == null ? void 0 : B.type) === M(Ne).TextField ? (V(), Me(f, {
2164
- key: 1,
2165
- "model-value": e.value[y],
2166
- type: ((F = n.config) == null ? void 0 : F.dataType) === "number" ? "number" : "text",
2167
- "helper-text": o.value[y] || void 0,
2168
- "helper-state": "error",
2169
- "onUpdate:modelValue": (X) => i(y, X)
2170
- }, null, 8, ["model-value", "type", "helper-text", "onUpdate:modelValue"])) : ((W = n.config) == null ? void 0 : W.type) === M(Ne).Timestamp ? (V(), Q("div", zo, [
2171
- k(h, {
2172
- "model-value": r(e.value[y]),
2173
- "onUpdate:modelValue": (X) => i(y, X)
2174
- }, null, 8, ["model-value", "onUpdate:modelValue"])
2175
- ])) : fe("", !0)
2176
- ]),
2177
- ((H = n.config) == null ? void 0 : H.fixed) === !1 ? (V(), Q("div", qo, [
2178
- k(w, {
2179
- icon: y === 0 ? "add" : "remove",
2180
- onClick: (X) => u(y)
2181
- }, null, 8, ["icon", "onClick"])
2182
- ])) : fe("", !0)
2183
- ]);
2184
- }), 128);
2185
- };
2186
- }
2187
- }), Jo = { class: "flex flex-col my-2 gap-8" }, Zo = { class: "fm-typo-en-body-lg-600" }, Qo = { class: "fm-typo-en-body-sm-600 text-fm-color-neutral-gray-400" }, er = { class: "fm-typo-en-body-lg-400 text-ellipsis overflow-hidden line-clamp-1" }, vr = /* @__PURE__ */ Ce({
2188
- __name: "FilterSection",
2189
- props: /* @__PURE__ */ Nt({
2190
- options: {
2191
- type: Array,
2192
- default: () => []
2193
- },
2194
- label: {
2195
- type: String,
2196
- default: "Filter"
2197
- }
2198
- }, {
2199
- modelValue: { required: !1, default: () => [] },
2200
- modelModifiers: {}
2201
- }),
2202
- emits: ["update:modelValue"],
2203
- setup(t) {
2204
- const { t: e } = Pt(), n = ze(t, "modelValue"), o = t, r = ke(() => e(`report.section.filter.${o.label}`)), a = De(!1), i = Rn(), u = ke(
2205
- () => n.value.map((m, p) => {
2206
- const E = o.options.find(
2207
- (O) => O.schemaName === m.schemaName && O.name === m.name
2208
- );
2209
- return {
2210
- index: p,
2211
- labels: (E == null ? void 0 : E.labels) || [m.schemaName, m.name],
2212
- value: m
2213
- };
2214
- })
2215
- ), s = De(n.value.length > 0 ? 0 : void 0);
2216
- function c(m) {
2217
- var p;
2218
- a.value = !0, b.value = [], l.value = m != null && m.value ? JSON.parse(JSON.stringify(m.value)) : void 0, s.value = m == null ? void 0 : m.index, f.value = !!((p = l.value) != null && p.dataFormula), B();
2219
- }
2220
- const l = De(void 0), f = De(!1), h = De(void 0), w = ke(
2221
- () => o.options.find(
2222
- (m) => {
2223
- var p, E;
2224
- return m.schemaName === ((p = l.value) == null ? void 0 : p.schemaName) && m.name === ((E = l.value) == null ? void 0 : E.name);
2225
- }
2226
- ) ?? {}
2227
- ), b = De([]);
2228
- function y(m) {
2229
- var p;
2230
- return (p = b.value.find((E) => E.option === m)) == null ? void 0 : p.value;
2231
- }
2232
- const Y = Yn(
2233
- (m, p) => {
2234
- const E = b.value.find((O) => O.option === m);
2235
- E ? E.value = p : b.value.push({ option: m, value: p });
2236
- },
2237
- 300
2238
- );
2239
- pt(
2240
- [() => {
2241
- var m;
2242
- return (m = l.value) == null ? void 0 : m.option;
2243
- }, () => {
2244
- var m;
2245
- return (m = l.value) == null ? void 0 : m.values;
2246
- }],
2247
- ([m, p]) => {
2248
- m !== void 0 && Array.isArray(p) && Y(m, p);
2249
- },
2250
- { deep: !0 }
2251
- ), pt(
2252
- () => {
2253
- var m;
2254
- return (m = l.value) == null ? void 0 : m.option;
2255
- },
2256
- (m, p) => {
2257
- if (p !== void 0 && m !== p && l.value) {
2258
- if (B(), !h.value) return;
2259
- const E = y(m);
2260
- l.value = {
2261
- ...l.value,
2262
- values: Array.isArray(E) ? E : [h.value.default]
2263
- };
2264
- }
2265
- }
2266
- ), pt(
2267
- () => {
2268
- var m;
2269
- return (m = l.value) == null ? void 0 : m.operator;
2270
- },
2271
- (m, p) => {
2272
- if (m !== p && w.value && l.value) {
2273
- if (B(), !h.value) return;
2274
- const E = l.value.values.length - h.value.count;
2275
- E > 0 && h.value.fixed ? l.value = {
2276
- ...l.value,
2277
- values: l.value.values.slice(0, h.value.count)
2278
- } : E < 0 && (l.value = {
2279
- ...l.value,
2280
- values: [
2281
- ...l.value.values,
2282
- ...Array(Math.abs(E)).fill(h.value.default)
2283
- ]
2284
- });
2285
- }
2286
- },
2287
- {
2288
- deep: !0
2289
- }
2290
- );
2291
- function B() {
2292
- w.value && l.value && (h.value = jo({
2293
- operator: l.value.operator,
2294
- dataType: w.value.type,
2295
- dimensionOption: l.value.option,
2296
- t: e
2297
- }));
2298
- }
2299
- function F(m) {
2300
- var p, E, O;
2301
- (m.schemaName !== ((p = l.value) == null ? void 0 : p.schemaName) || m.name !== ((E = l.value) == null ? void 0 : E.name)) && (l.value = {
2302
- schemaName: m.schemaName,
2303
- name: m.name,
2304
- operator: m.filterOperators[0],
2305
- option: m.filterDimensionOptions[0],
2306
- values: []
2307
- }, B(), l.value.values = [(O = h.value) == null ? void 0 : O.default]);
2308
- }
2309
- function W() {
2310
- var p, E, O;
2311
- const m = [...u.value.map((oe) => oe.value)];
2312
- if (l.value) {
2313
- const oe = Dn((p = l.value) == null ? void 0 : p.option), q = Tn((E = l.value) == null ? void 0 : E.option), re = (O = l.value.values) == null ? void 0 : O.map(
2314
- ($, te) => $ == null || $ === "" || !ce($, oe, q) ? te : null
2315
- ).filter(($) => $ !== null);
2316
- if (!l.value.values || re.length > 0) {
2317
- i.open({ message: "One or more values are invalid", type: "error" });
2318
- return;
2319
- }
2320
- l.value.values = l.value.values.filter(
2321
- ($) => $ !== "" && $ !== null
2322
- ), s.value !== void 0 ? m[Number(s.value)] = l.value : m.push(l.value), n.value = m;
2323
- }
2324
- a.value = !1;
2325
- }
2326
- function H(m) {
2327
- const p = [...u.value.map((E) => E.value)];
2328
- p.splice(m, 1), n.value = p, a.value = !1;
2329
- }
2330
- const X = ke(
2331
- () => o.options.map((m) => ({
2332
- label: m.labels.join(" "),
2333
- value: m
2334
- }))
2335
- ), ee = ke(() => [
2336
- { label: e("report.section.filter.hourOfDay"), value: z.HourOfDay },
2337
- { label: e("report.section.filter.dayOfMonth"), value: z.DayOfMonth },
2338
- { label: e("report.section.filter.dayOfWeek"), value: z.DayOfWeek },
2339
- { label: e("report.section.filter.monthOfYear"), value: z.MonthOfYear },
2340
- { label: e("report.section.filter.timeOfDay"), value: z.TimeOfDay }
2341
- ]);
2342
- function ce(m, p, E) {
2343
- return !(p !== void 0 && m < p || E !== void 0 && m > E);
2344
- }
2345
- return (m, p) => {
2346
- const E = N("FmCheckbox"), O = N("FmTextarea"), oe = N("FmSelect"), q = N("FmForm"), re = N("FmIcon"), $ = N("FmButton"), te = N("FmListItem"), xe = N("FmList"), we = N("FmField");
2347
- return V(), Q("div", Jo, [
2348
- k(Bn, {
2349
- modelValue: a.value,
2350
- "onUpdate:modelValue": p[6] || (p[6] = (ge) => a.value = ge),
2351
- title: r.value,
2352
- "primary-button-label": M(e)("report.common.confirm"),
2353
- "secondary-button-label": M(e)("report.common.cancel"),
2354
- onConfirm: W
2355
- }, {
2356
- content: le(() => [
2357
- k(q, {
2358
- ref: "form",
2359
- class: "flex flex-col gap-2 w-[490px]"
2360
- }, {
2361
- default: le(() => {
2362
- var ge, Oe;
2363
- return [
2364
- k(Yt, {
2365
- "model-value": w.value,
2366
- items: X.value,
2367
- placeholder: r.value,
2368
- label: r.value,
2369
- "onUpdate:modelValue": p[0] || (p[0] = (A) => F(A))
2370
- }, null, 8, ["model-value", "items", "placeholder", "label"]),
2371
- l.value ? (V(), Q(qe, { key: 0 }, [
2372
- k(E, {
2373
- modelValue: f.value,
2374
- "onUpdate:modelValue": p[1] || (p[1] = (A) => f.value = A),
2375
- label: M(e)("report.section.filter.advance"),
2376
- value: !0
2377
- }, null, 8, ["modelValue", "label"]),
2378
- f.value ? (V(), Me(O, {
2379
- key: 0,
2380
- modelValue: l.value.dataFormula,
2381
- "onUpdate:modelValue": p[2] || (p[2] = (A) => l.value.dataFormula = A),
2382
- placeholder: M(e)("report.section.filter.dataFormula")
2383
- }, null, 8, ["modelValue", "placeholder"])) : fe("", !0),
2384
- k(oe, {
2385
- modelValue: l.value.option,
2386
- "onUpdate:modelValue": p[3] || (p[3] = (A) => l.value.option = A),
2387
- items: ee.value,
2388
- placeholder: M(e)("report.section.filter.timeFormatter"),
2389
- label: M(e)("report.section.filter.timeFormatter")
2390
- }, null, 8, ["modelValue", "items", "placeholder", "label"]),
2391
- (((ge = w.value) == null ? void 0 : ge.filterOperators) || []).length > 0 ? (V(), Me(Yt, {
2392
- key: 1,
2393
- modelValue: l.value.operator,
2394
- "onUpdate:modelValue": p[4] || (p[4] = (A) => l.value.operator = A),
2395
- items: (((Oe = w.value) == null ? void 0 : Oe.filterOperators) ?? []).map((A) => ({
2396
- label: M(e)("report.section.comparisonOperator." + A),
2397
- value: A
2398
- }))
2399
- }, null, 8, ["modelValue", "items"])) : fe("", !0),
2400
- h.value ? (V(), Me(Ko, {
2401
- key: l.value.option ?? "",
2402
- modelValue: l.value.values,
2403
- "onUpdate:modelValue": p[5] || (p[5] = (A) => l.value.values = A),
2404
- config: h.value,
2405
- option: l.value.option
2406
- }, null, 8, ["modelValue", "config", "option"])) : fe("", !0)
2407
- ], 64)) : fe("", !0)
2408
- ];
2409
- }),
2410
- _: 1
2411
- }, 512)
2412
- ]),
2413
- _: 1
2414
- }, 8, ["modelValue", "title", "primary-button-label", "secondary-button-label"]),
2415
- be("div", null, [
2416
- be("p", Zo, Pe(r.value), 1),
2417
- be("p", Qo, Pe(M(e)("report.section.filter.description")), 1)
2418
- ]),
2419
- k(xe, null, {
2420
- default: le(() => [
2421
- k(M($o), {
2422
- list: n.value,
2423
- "item-key": "id",
2424
- class: "flex flex-col gap-2 w-full"
2425
- }, {
2426
- item: le(({ element: ge, index: Oe }) => [
2427
- k(te, {
2428
- class: "!cursor-grab border rounded-md border-neutral-300 h-[40px] !p-[8px]",
2429
- onClick: Rt((A) => c(u.value[Oe]), ["stop"])
2430
- }, {
2431
- default: le(() => [
2432
- k(re, { name: "drag_handle" }),
2433
- be("p", er, Pe(M(Pn)(ge.name)), 1),
2434
- p[8] || (p[8] = be("div", { class: "grow" }, null, -1)),
2435
- k($, {
2436
- icon: "close",
2437
- size: "md",
2438
- variant: "tertiary",
2439
- onClick: Rt((A) => H(Oe), ["stop"])
2440
- }, null, 8, ["onClick"])
2441
- ]),
2442
- _: 2
2443
- }, 1032, ["onClick"])
2444
- ]),
2445
- _: 1
2446
- }, 8, ["list"])
2447
- ]),
2448
- _: 1
2449
- }),
2450
- k(we, {
2451
- class: "text-fm-color-typo-tertiary",
2452
- onClick: p[7] || (p[7] = () => {
2453
- c();
2454
- })
2455
- }, {
2456
- default: le(() => [
2457
- nn(Pe(M(e)("report.section.filter.add")), 1)
2458
- ]),
2459
- _: 1
2460
- })
2461
- ]);
2462
- };
2463
- }
2464
- }), tr = /* @__PURE__ */ Ce({
2465
- __name: "TransitionFade",
2466
- props: {
2467
- modelValue: { type: Boolean, required: !0, default: !0 },
2468
- modelModifiers: {}
2469
- },
2470
- emits: ["update:modelValue"],
2471
- setup(t) {
2472
- const e = ze(t, "modelValue");
2473
- return (n, o) => (V(), Q(qe, null, [
2474
- k(xt, { name: "slide-fade-right" }, {
2475
- default: le(() => [
2476
- e.value ? Ge(n.$slots, "right", { key: 0 }, void 0, !0) : fe("", !0)
2477
- ]),
2478
- _: 3
2479
- }),
2480
- k(xt, { name: "slide-fade-left" }, {
2481
- default: le(() => [
2482
- e.value ? fe("", !0) : Ge(n.$slots, "left", { key: 0 }, void 0, !0)
2483
- ]),
2484
- _: 3
2485
- })
2486
- ], 64));
2487
- }
2488
- }), br = /* @__PURE__ */ Vt(tr, [["__scopeId", "data-v-a98ca9bc"]]);
2489
- export {
2490
- gr as S,
2491
- br as T,
2492
- mr as W,
2493
- vr as _,
2494
- fr as a,
2495
- Wo as b,
2496
- $o as d,
2497
- hr as h,
2498
- pr as i
2499
- };