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