@tailor-cms/ce-accordion-edit 2.0.0 → 2.0.1

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.
package/dist/index.cjs CHANGED
@@ -37,27 +37,29 @@ function _v4(options, buf, offset) {
37
37
  }
38
38
  //#endregion
39
39
  //#region ../manifest/dist/index.mjs
40
- var id1 = v4();
41
- var id2 = v4();
42
40
  var type = "ACCORDION";
43
41
  var name = "Accordion";
44
- var initState = () => ({
45
- embeds: {},
46
- items: {
47
- [id1]: {
48
- id: id1,
49
- header: "Accordion Item Title",
50
- body: {},
51
- position: 1
52
- },
53
- [id2]: {
54
- id: id2,
55
- header: "Accordion Item Title",
56
- body: {},
57
- position: 1
42
+ var initState = () => {
43
+ const id1 = v4();
44
+ const id2 = v4();
45
+ return {
46
+ embeds: {},
47
+ items: {
48
+ [id1]: {
49
+ id: id1,
50
+ header: "",
51
+ body: {},
52
+ position: 1
53
+ },
54
+ [id2]: {
55
+ id: id2,
56
+ header: "",
57
+ body: {},
58
+ position: 2
59
+ }
58
60
  }
59
- }
60
- });
61
+ };
62
+ };
61
63
  var ui = {
62
64
  icon: "mdi-view-day",
63
65
  forceFullWidth: true
@@ -336,6 +338,37 @@ function baseToString(value) {
336
338
  return result == "0" && 1 / value == -INFINITY$1 ? "-0" : result;
337
339
  }
338
340
  //#endregion
341
+ //#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_trimmedEndIndex.js
342
+ /** Used to match a single whitespace character. */
343
+ var reWhitespace = /\s/;
344
+ /**
345
+ * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
346
+ * character of `string`.
347
+ *
348
+ * @private
349
+ * @param {string} string The string to inspect.
350
+ * @returns {number} Returns the index of the last non-whitespace character.
351
+ */
352
+ function trimmedEndIndex(string) {
353
+ var index = string.length;
354
+ while (index-- && reWhitespace.test(string.charAt(index)));
355
+ return index;
356
+ }
357
+ //#endregion
358
+ //#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseTrim.js
359
+ /** Used to match leading whitespace. */
360
+ var reTrimStart = /^\s+/;
361
+ /**
362
+ * The base implementation of `_.trim`.
363
+ *
364
+ * @private
365
+ * @param {string} string The string to trim.
366
+ * @returns {string} Returns the trimmed string.
367
+ */
368
+ function baseTrim(string) {
369
+ return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, "") : string;
370
+ }
371
+ //#endregion
339
372
  //#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isObject.js
340
373
  /**
341
374
  * Checks if `value` is the
@@ -367,6 +400,53 @@ function isObject(value) {
367
400
  return value != null && (type == "object" || type == "function");
368
401
  }
369
402
  //#endregion
403
+ //#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/toNumber.js
404
+ /** Used as references for various `Number` constants. */
405
+ var NAN = NaN;
406
+ /** Used to detect bad signed hexadecimal string values. */
407
+ var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
408
+ /** Used to detect binary string values. */
409
+ var reIsBinary = /^0b[01]+$/i;
410
+ /** Used to detect octal string values. */
411
+ var reIsOctal = /^0o[0-7]+$/i;
412
+ /** Built-in method references without a dependency on `root`. */
413
+ var freeParseInt = parseInt;
414
+ /**
415
+ * Converts `value` to a number.
416
+ *
417
+ * @static
418
+ * @memberOf _
419
+ * @since 4.0.0
420
+ * @category Lang
421
+ * @param {*} value The value to process.
422
+ * @returns {number} Returns the number.
423
+ * @example
424
+ *
425
+ * _.toNumber(3.2);
426
+ * // => 3.2
427
+ *
428
+ * _.toNumber(Number.MIN_VALUE);
429
+ * // => 5e-324
430
+ *
431
+ * _.toNumber(Infinity);
432
+ * // => Infinity
433
+ *
434
+ * _.toNumber('3.2');
435
+ * // => 3.2
436
+ */
437
+ function toNumber(value) {
438
+ if (typeof value == "number") return value;
439
+ if (isSymbol(value)) return NAN;
440
+ if (isObject(value)) {
441
+ var other = typeof value.valueOf == "function" ? value.valueOf() : value;
442
+ value = isObject(other) ? other + "" : other;
443
+ }
444
+ if (typeof value != "string") return value === 0 ? value : +value;
445
+ value = baseTrim(value);
446
+ var isBinary = reIsBinary.test(value);
447
+ return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
448
+ }
449
+ //#endregion
370
450
  //#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/identity.js
371
451
  /**
372
452
  * This method returns the first argument it receives.
@@ -514,7 +594,7 @@ function getNative(object, key) {
514
594
  }
515
595
  //#endregion
516
596
  //#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_WeakMap.js
517
- var WeakMap = getNative(root, "WeakMap");
597
+ var WeakMap$1 = getNative(root, "WeakMap");
518
598
  //#endregion
519
599
  //#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseCreate.js
520
600
  /** Built-in value references. */
@@ -851,7 +931,7 @@ function copyObject(source, props, object, customizer) {
851
931
  }
852
932
  //#endregion
853
933
  //#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_overRest.js
854
- var nativeMax = Math.max;
934
+ var nativeMax$1 = Math.max;
855
935
  /**
856
936
  * A specialized version of `baseRest` which transforms the rest array.
857
937
  *
@@ -862,9 +942,9 @@ var nativeMax = Math.max;
862
942
  * @returns {Function} Returns the new function.
863
943
  */
864
944
  function overRest(func, start, transform) {
865
- start = nativeMax(start === void 0 ? func.length - 1 : start, 0);
945
+ start = nativeMax$1(start === void 0 ? func.length - 1 : start, 0);
866
946
  return function() {
867
- var args = arguments, index = -1, length = nativeMax(args.length - start, 0), array = Array(length);
947
+ var args = arguments, index = -1, length = nativeMax$1(args.length - start, 0), array = Array(length);
868
948
  while (++index < length) array[index] = args[start + index];
869
949
  index = -1;
870
950
  var otherArgs = Array(start + 1);
@@ -1690,7 +1770,7 @@ MapCache.prototype.set = mapCacheSet;
1690
1770
  //#endregion
1691
1771
  //#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/memoize.js
1692
1772
  /** Error message constants. */
1693
- var FUNC_ERROR_TEXT = "Expected a function";
1773
+ var FUNC_ERROR_TEXT$1 = "Expected a function";
1694
1774
  /**
1695
1775
  * Creates a function that memoizes the result of `func`. If `resolver` is
1696
1776
  * provided, it determines the cache key for storing the result based on the
@@ -1736,7 +1816,7 @@ var FUNC_ERROR_TEXT = "Expected a function";
1736
1816
  * _.memoize.Cache = WeakMap;
1737
1817
  */
1738
1818
  function memoize(func, resolver) {
1739
- if (typeof func != "function" || resolver != null && typeof resolver != "function") throw new TypeError(FUNC_ERROR_TEXT);
1819
+ if (typeof func != "function" || resolver != null && typeof resolver != "function") throw new TypeError(FUNC_ERROR_TEXT$1);
1740
1820
  var memoized = function() {
1741
1821
  var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache;
1742
1822
  if (cache.has(key)) return cache.get(key);
@@ -2316,7 +2396,7 @@ var Set = getNative(root, "Set");
2316
2396
  var mapTag$5 = "[object Map]", objectTag$2 = "[object Object]", promiseTag = "[object Promise]", setTag$5 = "[object Set]", weakMapTag$1 = "[object WeakMap]";
2317
2397
  var dataViewTag$3 = "[object DataView]";
2318
2398
  /** Used to detect maps, sets, and weakmaps. */
2319
- var dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map), promiseCtorString = toSource(Promise$1), setCtorString = toSource(Set), weakMapCtorString = toSource(WeakMap);
2399
+ var dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map), promiseCtorString = toSource(Promise$1), setCtorString = toSource(Set), weakMapCtorString = toSource(WeakMap$1);
2320
2400
  /**
2321
2401
  * Gets the `toStringTag` of `value`.
2322
2402
  *
@@ -2325,7 +2405,7 @@ var dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map), prom
2325
2405
  * @returns {string} Returns the `toStringTag`.
2326
2406
  */
2327
2407
  var getTag = baseGetTag;
2328
- if (DataView && getTag(new DataView(/* @__PURE__ */ new ArrayBuffer(1))) != dataViewTag$3 || Map && getTag(new Map()) != mapTag$5 || Promise$1 && getTag(Promise$1.resolve()) != promiseTag || Set && getTag(new Set()) != setTag$5 || WeakMap && getTag(new WeakMap()) != weakMapTag$1) getTag = function(value) {
2408
+ if (DataView && getTag(new DataView(/* @__PURE__ */ new ArrayBuffer(1))) != dataViewTag$3 || Map && getTag(new Map()) != mapTag$5 || Promise$1 && getTag(Promise$1.resolve()) != promiseTag || Set && getTag(new Set()) != setTag$5 || WeakMap$1 && getTag(new WeakMap$1()) != weakMapTag$1) getTag = function(value) {
2329
2409
  var result = baseGetTag(value), Ctor = result == objectTag$2 ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : "";
2330
2410
  if (ctorString) switch (ctorString) {
2331
2411
  case dataViewCtorString: return dataViewTag$3;
@@ -3321,6 +3401,155 @@ function createBaseEach(eachFunc, fromRight) {
3321
3401
  */
3322
3402
  var baseEach = createBaseEach(baseForOwn);
3323
3403
  //#endregion
3404
+ //#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/now.js
3405
+ /**
3406
+ * Gets the timestamp of the number of milliseconds that have elapsed since
3407
+ * the Unix epoch (1 January 1970 00:00:00 UTC).
3408
+ *
3409
+ * @static
3410
+ * @memberOf _
3411
+ * @since 2.4.0
3412
+ * @category Date
3413
+ * @returns {number} Returns the timestamp.
3414
+ * @example
3415
+ *
3416
+ * _.defer(function(stamp) {
3417
+ * console.log(_.now() - stamp);
3418
+ * }, _.now());
3419
+ * // => Logs the number of milliseconds it took for the deferred invocation.
3420
+ */
3421
+ var now = function() {
3422
+ return root.Date.now();
3423
+ };
3424
+ //#endregion
3425
+ //#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/debounce.js
3426
+ /** Error message constants. */
3427
+ var FUNC_ERROR_TEXT = "Expected a function";
3428
+ var nativeMax = Math.max, nativeMin = Math.min;
3429
+ /**
3430
+ * Creates a debounced function that delays invoking `func` until after `wait`
3431
+ * milliseconds have elapsed since the last time the debounced function was
3432
+ * invoked. The debounced function comes with a `cancel` method to cancel
3433
+ * delayed `func` invocations and a `flush` method to immediately invoke them.
3434
+ * Provide `options` to indicate whether `func` should be invoked on the
3435
+ * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
3436
+ * with the last arguments provided to the debounced function. Subsequent
3437
+ * calls to the debounced function return the result of the last `func`
3438
+ * invocation.
3439
+ *
3440
+ * **Note:** If `leading` and `trailing` options are `true`, `func` is
3441
+ * invoked on the trailing edge of the timeout only if the debounced function
3442
+ * is invoked more than once during the `wait` timeout.
3443
+ *
3444
+ * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
3445
+ * until to the next tick, similar to `setTimeout` with a timeout of `0`.
3446
+ *
3447
+ * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
3448
+ * for details over the differences between `_.debounce` and `_.throttle`.
3449
+ *
3450
+ * @static
3451
+ * @memberOf _
3452
+ * @since 0.1.0
3453
+ * @category Function
3454
+ * @param {Function} func The function to debounce.
3455
+ * @param {number} [wait=0] The number of milliseconds to delay.
3456
+ * @param {Object} [options={}] The options object.
3457
+ * @param {boolean} [options.leading=false]
3458
+ * Specify invoking on the leading edge of the timeout.
3459
+ * @param {number} [options.maxWait]
3460
+ * The maximum time `func` is allowed to be delayed before it's invoked.
3461
+ * @param {boolean} [options.trailing=true]
3462
+ * Specify invoking on the trailing edge of the timeout.
3463
+ * @returns {Function} Returns the new debounced function.
3464
+ * @example
3465
+ *
3466
+ * // Avoid costly calculations while the window size is in flux.
3467
+ * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
3468
+ *
3469
+ * // Invoke `sendMail` when clicked, debouncing subsequent calls.
3470
+ * jQuery(element).on('click', _.debounce(sendMail, 300, {
3471
+ * 'leading': true,
3472
+ * 'trailing': false
3473
+ * }));
3474
+ *
3475
+ * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
3476
+ * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
3477
+ * var source = new EventSource('/stream');
3478
+ * jQuery(source).on('message', debounced);
3479
+ *
3480
+ * // Cancel the trailing debounced invocation.
3481
+ * jQuery(window).on('popstate', debounced.cancel);
3482
+ */
3483
+ function debounce(func, wait, options) {
3484
+ var lastArgs, lastThis, maxWait, result, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true;
3485
+ if (typeof func != "function") throw new TypeError(FUNC_ERROR_TEXT);
3486
+ wait = toNumber(wait) || 0;
3487
+ if (isObject(options)) {
3488
+ leading = !!options.leading;
3489
+ maxing = "maxWait" in options;
3490
+ maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
3491
+ trailing = "trailing" in options ? !!options.trailing : trailing;
3492
+ }
3493
+ function invokeFunc(time) {
3494
+ var args = lastArgs, thisArg = lastThis;
3495
+ lastArgs = lastThis = void 0;
3496
+ lastInvokeTime = time;
3497
+ result = func.apply(thisArg, args);
3498
+ return result;
3499
+ }
3500
+ function leadingEdge(time) {
3501
+ lastInvokeTime = time;
3502
+ timerId = setTimeout(timerExpired, wait);
3503
+ return leading ? invokeFunc(time) : result;
3504
+ }
3505
+ function remainingWait(time) {
3506
+ var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime, timeWaiting = wait - timeSinceLastCall;
3507
+ return maxing ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting;
3508
+ }
3509
+ function shouldInvoke(time) {
3510
+ var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime;
3511
+ return lastCallTime === void 0 || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;
3512
+ }
3513
+ function timerExpired() {
3514
+ var time = now();
3515
+ if (shouldInvoke(time)) return trailingEdge(time);
3516
+ timerId = setTimeout(timerExpired, remainingWait(time));
3517
+ }
3518
+ function trailingEdge(time) {
3519
+ timerId = void 0;
3520
+ if (trailing && lastArgs) return invokeFunc(time);
3521
+ lastArgs = lastThis = void 0;
3522
+ return result;
3523
+ }
3524
+ function cancel() {
3525
+ if (timerId !== void 0) clearTimeout(timerId);
3526
+ lastInvokeTime = 0;
3527
+ lastArgs = lastCallTime = lastThis = timerId = void 0;
3528
+ }
3529
+ function flush() {
3530
+ return timerId === void 0 ? result : trailingEdge(now());
3531
+ }
3532
+ function debounced() {
3533
+ var time = now(), isInvoking = shouldInvoke(time);
3534
+ lastArgs = arguments;
3535
+ lastThis = this;
3536
+ lastCallTime = time;
3537
+ if (isInvoking) {
3538
+ if (timerId === void 0) return leadingEdge(lastCallTime);
3539
+ if (maxing) {
3540
+ clearTimeout(timerId);
3541
+ timerId = setTimeout(timerExpired, wait);
3542
+ return invokeFunc(lastCallTime);
3543
+ }
3544
+ }
3545
+ if (timerId === void 0) timerId = setTimeout(timerExpired, wait);
3546
+ return result;
3547
+ }
3548
+ debounced.cancel = cancel;
3549
+ debounced.flush = flush;
3550
+ return debounced;
3551
+ }
3552
+ //#endregion
3324
3553
  //#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_castFunction.js
3325
3554
  /**
3326
3555
  * Casts `value` to `identity` if it's not a function.
@@ -3433,6 +3662,39 @@ function isEmpty(value) {
3433
3662
  return true;
3434
3663
  }
3435
3664
  //#endregion
3665
+ //#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isEqual.js
3666
+ /**
3667
+ * Performs a deep comparison between two values to determine if they are
3668
+ * equivalent.
3669
+ *
3670
+ * **Note:** This method supports comparing arrays, array buffers, booleans,
3671
+ * date objects, error objects, maps, numbers, `Object` objects, regexes,
3672
+ * sets, strings, symbols, and typed arrays. `Object` objects are compared
3673
+ * by their own, not inherited, enumerable properties. Functions and DOM
3674
+ * nodes are compared by strict equality, i.e. `===`.
3675
+ *
3676
+ * @static
3677
+ * @memberOf _
3678
+ * @since 0.1.0
3679
+ * @category Lang
3680
+ * @param {*} value The value to compare.
3681
+ * @param {*} other The other value to compare.
3682
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
3683
+ * @example
3684
+ *
3685
+ * var object = { 'a': 1 };
3686
+ * var other = { 'a': 1 };
3687
+ *
3688
+ * _.isEqual(object, other);
3689
+ * // => true
3690
+ *
3691
+ * object === other;
3692
+ * // => false
3693
+ */
3694
+ function isEqual(value, other) {
3695
+ return baseIsEqual(value, other);
3696
+ }
3697
+ //#endregion
3436
3698
  //#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isNumber.js
3437
3699
  /** `Object#toString` result references. */
3438
3700
  var numberTag = "[object Number]";
@@ -3847,1445 +4109,939 @@ var sortBy = baseRest(function(collection, iteratees) {
3847
4109
  return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
3848
4110
  });
3849
4111
  //#endregion
3850
- //#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/uniqueId.js
3851
- /** Used to generate unique IDs. */
3852
- var idCounter = 0;
3853
- /**
3854
- * Generates a unique ID. If `prefix` is given, the ID is appended to it.
3855
- *
3856
- * @static
3857
- * @since 0.1.0
3858
- * @memberOf _
3859
- * @category Util
3860
- * @param {string} [prefix=''] The value to prefix the ID with.
3861
- * @returns {string} Returns the unique ID.
3862
- * @example
3863
- *
3864
- * _.uniqueId('contact_');
3865
- * // => 'contact_104'
3866
- *
3867
- * _.uniqueId();
3868
- * // => '105'
3869
- */
3870
- function uniqueId(prefix) {
3871
- var id = ++idCounter;
3872
- return toString(prefix) + id;
4112
+ //#region ../../node_modules/.pnpm/vue-draggable-plus@0.6.1_@types+sortablejs@1.15.9/node_modules/vue-draggable-plus/dist/vue-draggable-plus.js
4113
+ var an = Object.defineProperty;
4114
+ var Pe = Object.getOwnPropertySymbols;
4115
+ var yt = Object.prototype.hasOwnProperty, wt = Object.prototype.propertyIsEnumerable;
4116
+ var bt = (t, e, n) => e in t ? an(t, e, {
4117
+ enumerable: !0,
4118
+ configurable: !0,
4119
+ writable: !0,
4120
+ value: n
4121
+ }) : t[e] = n, fe = (t, e) => {
4122
+ for (var n in e || (e = {})) yt.call(e, n) && bt(t, n, e[n]);
4123
+ if (Pe) for (var n of Pe(e)) wt.call(e, n) && bt(t, n, e[n]);
4124
+ return t;
4125
+ };
4126
+ var $e = (t, e) => {
4127
+ var n = {};
4128
+ for (var o in t) yt.call(t, o) && e.indexOf(o) < 0 && (n[o] = t[o]);
4129
+ if (t != null && Pe) for (var o of Pe(t)) e.indexOf(o) < 0 && wt.call(t, o) && (n[o] = t[o]);
4130
+ return n;
4131
+ };
4132
+ var Ht = "[vue-draggable-plus]: ";
4133
+ function mn(t) {
4134
+ console.warn(Ht + t);
3873
4135
  }
3874
- //#endregion
3875
- //#region ../../node_modules/.pnpm/sortablejs@1.15.7/node_modules/sortablejs/modular/sortable.esm.js
3876
- function _defineProperty(e, r, t) {
3877
- return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
3878
- value: t,
3879
- enumerable: !0,
3880
- configurable: !0,
3881
- writable: !0
3882
- }) : e[r] = t, e;
4136
+ function vn(t) {
4137
+ console.error(Ht + t);
3883
4138
  }
3884
- function _extends() {
3885
- return _extends = Object.assign ? Object.assign.bind() : function(n) {
3886
- for (var e = 1; e < arguments.length; e++) {
3887
- var t = arguments[e];
3888
- for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
3889
- }
3890
- return n;
3891
- }, _extends.apply(null, arguments);
4139
+ function St(t, e, n) {
4140
+ return n >= 0 && n < t.length && t.splice(n, 0, t.splice(e, 1)[0]), t;
3892
4141
  }
3893
- function ownKeys(e, r) {
3894
- var t = Object.keys(e);
3895
- if (Object.getOwnPropertySymbols) {
3896
- var o = Object.getOwnPropertySymbols(e);
3897
- r && (o = o.filter(function(r) {
3898
- return Object.getOwnPropertyDescriptor(e, r).enumerable;
3899
- })), t.push.apply(t, o);
3900
- }
3901
- return t;
4142
+ function bn(t) {
4143
+ return t.replace(/-(\w)/g, (e, n) => n ? n.toUpperCase() : "");
3902
4144
  }
3903
- function _objectSpread2(e) {
3904
- for (var r = 1; r < arguments.length; r++) {
3905
- var t = null != arguments[r] ? arguments[r] : {};
3906
- r % 2 ? ownKeys(Object(t), !0).forEach(function(r) {
3907
- _defineProperty(e, r, t[r]);
3908
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r) {
3909
- Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
3910
- });
3911
- }
3912
- return e;
4145
+ function yn(t) {
4146
+ return Object.keys(t).reduce((e, n) => (typeof t[n] != "undefined" && (e[bn(n)] = t[n]), e), {});
4147
+ }
4148
+ function Dt(t, e) {
4149
+ return Array.isArray(t) && t.splice(e, 1), t;
4150
+ }
4151
+ function _t(t, e, n) {
4152
+ return Array.isArray(t) && t.splice(e, 0, n), t;
4153
+ }
4154
+ function wn(t) {
4155
+ return typeof t == "undefined";
4156
+ }
4157
+ function En(t) {
4158
+ return typeof t == "string";
4159
+ }
4160
+ function Tt(t, e, n) {
4161
+ const o = t.children[n];
4162
+ t.insertBefore(e, o);
4163
+ }
4164
+ function Ke(t) {
4165
+ t.parentNode && t.parentNode.removeChild(t);
3913
4166
  }
3914
- function _objectWithoutProperties(e, t) {
3915
- if (null == e) return {};
3916
- var o, r, i = _objectWithoutPropertiesLoose(e, t);
4167
+ function Sn(t, e = document) {
4168
+ var o;
4169
+ let n = null;
4170
+ return typeof (e == null ? void 0 : e.querySelector) == "function" ? n = (o = e == null ? void 0 : e.querySelector) == null ? void 0 : o.call(e, t) : n = document.querySelector(t), n || mn(`Element not found: ${t}`), n;
4171
+ }
4172
+ function Dn(t, e, n = null) {
4173
+ return function(...o) {
4174
+ return t.apply(n, o), e.apply(n, o);
4175
+ };
4176
+ }
4177
+ function _n(t, e) {
4178
+ const n = fe({}, t);
4179
+ return Object.keys(e).forEach((o) => {
4180
+ n[o] ? n[o] = Dn(t[o], e[o]) : n[o] = e[o];
4181
+ }), n;
4182
+ }
4183
+ function Tn(t) {
4184
+ return t instanceof HTMLElement;
4185
+ }
4186
+ function Ct(t, e) {
4187
+ Object.keys(t).forEach((n) => {
4188
+ e(n, t[n]);
4189
+ });
4190
+ }
4191
+ function Cn(t) {
4192
+ return t.charCodeAt(0) === 111 && t.charCodeAt(1) === 110 && (t.charCodeAt(2) > 122 || t.charCodeAt(2) < 97);
4193
+ }
4194
+ var On = Object.assign;
4195
+ /**!
4196
+ * Sortable 1.15.2
4197
+ * @author RubaXa <trash@rubaxa.org>
4198
+ * @author owenm <owen23355@gmail.com>
4199
+ * @license MIT
4200
+ */
4201
+ function Ot(t, e) {
4202
+ var n = Object.keys(t);
3917
4203
  if (Object.getOwnPropertySymbols) {
3918
- var n = Object.getOwnPropertySymbols(e);
3919
- for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
4204
+ var o = Object.getOwnPropertySymbols(t);
4205
+ e && (o = o.filter(function(r) {
4206
+ return Object.getOwnPropertyDescriptor(t, r).enumerable;
4207
+ })), n.push.apply(n, o);
3920
4208
  }
3921
- return i;
3922
- }
3923
- function _objectWithoutPropertiesLoose(r, e) {
3924
- if (null == r) return {};
3925
- var t = {};
3926
- for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
3927
- if (-1 !== e.indexOf(n)) continue;
3928
- t[n] = r[n];
4209
+ return n;
4210
+ }
4211
+ function ne(t) {
4212
+ for (var e = 1; e < arguments.length; e++) {
4213
+ var n = arguments[e] != null ? arguments[e] : {};
4214
+ e % 2 ? Ot(Object(n), !0).forEach(function(o) {
4215
+ In(t, o, n[o]);
4216
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : Ot(Object(n)).forEach(function(o) {
4217
+ Object.defineProperty(t, o, Object.getOwnPropertyDescriptor(n, o));
4218
+ });
3929
4219
  }
3930
4220
  return t;
3931
4221
  }
3932
- function _toPrimitive(t, r) {
3933
- if ("object" != typeof t || !t) return t;
3934
- var e = t[Symbol.toPrimitive];
3935
- if (void 0 !== e) {
3936
- var i = e.call(t, r || "default");
3937
- if ("object" != typeof i) return i;
3938
- throw new TypeError("@@toPrimitive must return a primitive value.");
4222
+ function Ye(t) {
4223
+ "@babel/helpers - typeof";
4224
+ return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? Ye = function(e) {
4225
+ return typeof e;
4226
+ } : Ye = function(e) {
4227
+ return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
4228
+ }, Ye(t);
4229
+ }
4230
+ function In(t, e, n) {
4231
+ return e in t ? Object.defineProperty(t, e, {
4232
+ value: n,
4233
+ enumerable: !0,
4234
+ configurable: !0,
4235
+ writable: !0
4236
+ }) : t[e] = n, t;
4237
+ }
4238
+ function ie() {
4239
+ return ie = Object.assign || function(t) {
4240
+ for (var e = 1; e < arguments.length; e++) {
4241
+ var n = arguments[e];
4242
+ for (var o in n) Object.prototype.hasOwnProperty.call(n, o) && (t[o] = n[o]);
4243
+ }
4244
+ return t;
4245
+ }, ie.apply(this, arguments);
4246
+ }
4247
+ function An(t, e) {
4248
+ if (t == null) return {};
4249
+ var n = {}, o = Object.keys(t), r, i;
4250
+ for (i = 0; i < o.length; i++) r = o[i], !(e.indexOf(r) >= 0) && (n[r] = t[r]);
4251
+ return n;
4252
+ }
4253
+ function xn(t, e) {
4254
+ if (t == null) return {};
4255
+ var n = An(t, e), o, r;
4256
+ if (Object.getOwnPropertySymbols) {
4257
+ var i = Object.getOwnPropertySymbols(t);
4258
+ for (r = 0; r < i.length; r++) o = i[r], !(e.indexOf(o) >= 0) && Object.prototype.propertyIsEnumerable.call(t, o) && (n[o] = t[o]);
3939
4259
  }
3940
- return ("string" === r ? String : Number)(t);
4260
+ return n;
3941
4261
  }
3942
- function _toPropertyKey(t) {
3943
- var i = _toPrimitive(t, "string");
3944
- return "symbol" == typeof i ? i : i + "";
4262
+ var Nn = "1.15.2";
4263
+ function re(t) {
4264
+ if (typeof window != "undefined" && window.navigator) return !!/* @__PURE__ */ navigator.userAgent.match(t);
3945
4265
  }
3946
- function _typeof(o) {
3947
- "@babel/helpers - typeof";
3948
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
3949
- return typeof o;
3950
- } : function(o) {
3951
- return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
3952
- }, _typeof(o);
3953
- }
3954
- var version = "1.15.7";
3955
- function userAgent(pattern) {
3956
- if (typeof window !== "undefined" && window.navigator) return !!/* @__PURE__ */ navigator.userAgent.match(pattern);
3957
- }
3958
- var IE11OrLess = userAgent(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i);
3959
- var Edge = userAgent(/Edge/i);
3960
- var FireFox = userAgent(/firefox/i);
3961
- var Safari = userAgent(/safari/i) && !userAgent(/chrome/i) && !userAgent(/android/i);
3962
- var IOS = userAgent(/iP(ad|od|hone)/i);
3963
- var ChromeForAndroid = userAgent(/chrome/i) && userAgent(/android/i);
3964
- var captureMode = {
3965
- capture: false,
3966
- passive: false
4266
+ var ae = re(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i), xe = re(/Edge/i), It = re(/firefox/i), Te = re(/safari/i) && !re(/chrome/i) && !re(/android/i), Lt = re(/iP(ad|od|hone)/i), Wt = re(/chrome/i) && re(/android/i), Gt = {
4267
+ capture: !1,
4268
+ passive: !1
3967
4269
  };
3968
- function on(el, event, fn) {
3969
- el.addEventListener(event, fn, !IE11OrLess && captureMode);
3970
- }
3971
- function off(el, event, fn) {
3972
- el.removeEventListener(event, fn, !IE11OrLess && captureMode);
3973
- }
3974
- function matches(el, selector) {
3975
- if (!selector) return;
3976
- selector[0] === ">" && (selector = selector.substring(1));
3977
- if (el) try {
3978
- if (el.matches) return el.matches(selector);
3979
- else if (el.msMatchesSelector) return el.msMatchesSelector(selector);
3980
- else if (el.webkitMatchesSelector) return el.webkitMatchesSelector(selector);
3981
- } catch (_) {
3982
- return false;
4270
+ function S(t, e, n) {
4271
+ t.addEventListener(e, n, !ae && Gt);
4272
+ }
4273
+ function E(t, e, n) {
4274
+ t.removeEventListener(e, n, !ae && Gt);
4275
+ }
4276
+ function We(t, e) {
4277
+ if (e) {
4278
+ if (e[0] === ">" && (e = e.substring(1)), t) try {
4279
+ if (t.matches) return t.matches(e);
4280
+ if (t.msMatchesSelector) return t.msMatchesSelector(e);
4281
+ if (t.webkitMatchesSelector) return t.webkitMatchesSelector(e);
4282
+ } catch (n) {
4283
+ return !1;
4284
+ }
4285
+ return !1;
3983
4286
  }
3984
- return false;
3985
4287
  }
3986
- function getParentOrHost(el) {
3987
- return el.host && el !== document && el.host.nodeType && el.host !== el ? el.host : el.parentNode;
4288
+ function Pn(t) {
4289
+ return t.host && t !== document && t.host.nodeType ? t.host : t.parentNode;
3988
4290
  }
3989
- function closest(el, selector, ctx, includeCTX) {
3990
- if (el) {
3991
- ctx = ctx || document;
4291
+ function Q(t, e, n, o) {
4292
+ if (t) {
4293
+ n = n || document;
3992
4294
  do {
3993
- if (selector != null && (selector[0] === ">" ? el.parentNode === ctx && matches(el, selector) : matches(el, selector)) || includeCTX && el === ctx) return el;
3994
- if (el === ctx) break;
3995
- } while (el = getParentOrHost(el));
4295
+ if (e != null && (e[0] === ">" ? t.parentNode === n && We(t, e) : We(t, e)) || o && t === n) return t;
4296
+ if (t === n) break;
4297
+ } while (t = Pn(t));
3996
4298
  }
3997
4299
  return null;
3998
4300
  }
3999
- var R_SPACE = /\s+/g;
4000
- function toggleClass(el, name, state) {
4001
- if (el && name) if (el.classList) el.classList[state ? "add" : "remove"](name);
4002
- else el.className = ((" " + el.className + " ").replace(R_SPACE, " ").replace(" " + name + " ", " ") + (state ? " " + name : "")).replace(R_SPACE, " ");
4003
- }
4004
- function css(el, prop, val) {
4005
- var style = el && el.style;
4006
- if (style) if (val === void 0) {
4007
- if (document.defaultView && document.defaultView.getComputedStyle) val = document.defaultView.getComputedStyle(el, "");
4008
- else if (el.currentStyle) val = el.currentStyle;
4009
- return prop === void 0 ? val : val[prop];
4010
- } else {
4011
- if (!(prop in style) && prop.indexOf("webkit") === -1) prop = "-webkit-" + prop;
4012
- style[prop] = val + (typeof val === "string" ? "" : "px");
4301
+ var At = /\s+/g;
4302
+ function V(t, e, n) {
4303
+ if (t && e) if (t.classList) t.classList[n ? "add" : "remove"](e);
4304
+ else t.className = ((" " + t.className + " ").replace(At, " ").replace(" " + e + " ", " ") + (n ? " " + e : "")).replace(At, " ");
4305
+ }
4306
+ function h(t, e, n) {
4307
+ var o = t && t.style;
4308
+ if (o) {
4309
+ if (n === void 0) return document.defaultView && document.defaultView.getComputedStyle ? n = document.defaultView.getComputedStyle(t, "") : t.currentStyle && (n = t.currentStyle), e === void 0 ? n : n[e];
4310
+ !(e in o) && e.indexOf("webkit") === -1 && (e = "-webkit-" + e), o[e] = n + (typeof n == "string" ? "" : "px");
4013
4311
  }
4014
4312
  }
4015
- function matrix(el, selfOnly) {
4016
- var appliedTransforms = "";
4017
- if (typeof el === "string") appliedTransforms = el;
4313
+ function ye(t, e) {
4314
+ var n = "";
4315
+ if (typeof t == "string") n = t;
4018
4316
  else do {
4019
- var transform = css(el, "transform");
4020
- if (transform && transform !== "none") appliedTransforms = transform + " " + appliedTransforms;
4021
- } while (!selfOnly && (el = el.parentNode));
4022
- var matrixFn = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix;
4023
- return matrixFn && new matrixFn(appliedTransforms);
4024
- }
4025
- function find(ctx, tagName, iterator) {
4026
- if (ctx) {
4027
- var list = ctx.getElementsByTagName(tagName), i = 0, n = list.length;
4028
- if (iterator) for (; i < n; i++) iterator(list[i], i);
4029
- return list;
4317
+ var o = h(t, "transform");
4318
+ o && o !== "none" && (n = o + " " + n);
4319
+ } while (!e && (t = t.parentNode));
4320
+ var r = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix;
4321
+ return r && new r(n);
4322
+ }
4323
+ function jt(t, e, n) {
4324
+ if (t) {
4325
+ var o = t.getElementsByTagName(e), r = 0, i = o.length;
4326
+ if (n) for (; r < i; r++) n(o[r], r);
4327
+ return o;
4030
4328
  }
4031
4329
  return [];
4032
4330
  }
4033
- function getWindowScrollingElement() {
4034
- var scrollingElement = document.scrollingElement;
4035
- if (scrollingElement) return scrollingElement;
4036
- else return document.documentElement;
4037
- }
4038
- /**
4039
- * Returns the "bounding client rect" of given element
4040
- * @param {HTMLElement} el The element whose boundingClientRect is wanted
4041
- * @param {[Boolean]} relativeToContainingBlock Whether the rect should be relative to the containing block of (including) the container
4042
- * @param {[Boolean]} relativeToNonStaticParent Whether the rect should be relative to the relative parent of (including) the contaienr
4043
- * @param {[Boolean]} undoScale Whether the container's scale() should be undone
4044
- * @param {[HTMLElement]} container The parent the element will be placed in
4045
- * @return {Object} The boundingClientRect of el, with specified adjustments
4046
- */
4047
- function getRect(el, relativeToContainingBlock, relativeToNonStaticParent, undoScale, container) {
4048
- if (!el.getBoundingClientRect && el !== window) return;
4049
- var elRect, top, left, bottom, right, height, width;
4050
- if (el !== window && el.parentNode && el !== getWindowScrollingElement()) {
4051
- elRect = el.getBoundingClientRect();
4052
- top = elRect.top;
4053
- left = elRect.left;
4054
- bottom = elRect.bottom;
4055
- right = elRect.right;
4056
- height = elRect.height;
4057
- width = elRect.width;
4058
- } else {
4059
- top = 0;
4060
- left = 0;
4061
- bottom = window.innerHeight;
4062
- right = window.innerWidth;
4063
- height = window.innerHeight;
4064
- width = window.innerWidth;
4065
- }
4066
- if ((relativeToContainingBlock || relativeToNonStaticParent) && el !== window) {
4067
- container = container || el.parentNode;
4068
- if (!IE11OrLess) do
4069
- if (container && container.getBoundingClientRect && (css(container, "transform") !== "none" || relativeToNonStaticParent && css(container, "position") !== "static")) {
4070
- var containerRect = container.getBoundingClientRect();
4071
- top -= containerRect.top + parseInt(css(container, "border-top-width"));
4072
- left -= containerRect.left + parseInt(css(container, "border-left-width"));
4073
- bottom = top + elRect.height;
4074
- right = left + elRect.width;
4331
+ function te() {
4332
+ return document.scrollingElement || document.documentElement;
4333
+ }
4334
+ function P(t, e, n, o, r) {
4335
+ if (!(!t.getBoundingClientRect && t !== window)) {
4336
+ var i, a, l, s, u, d, f;
4337
+ if (t !== window && t.parentNode && t !== te() ? (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, !ae)) do
4338
+ if (r && r.getBoundingClientRect && (h(r, "transform") !== "none" || n && h(r, "position") !== "static")) {
4339
+ var m = r.getBoundingClientRect();
4340
+ a -= m.top + parseInt(h(r, "border-top-width")), l -= m.left + parseInt(h(r, "border-left-width")), s = a + i.height, u = l + i.width;
4075
4341
  break;
4076
4342
  }
4077
- while (container = container.parentNode);
4078
- }
4079
- if (undoScale && el !== window) {
4080
- var elMatrix = matrix(container || el), scaleX = elMatrix && elMatrix.a, scaleY = elMatrix && elMatrix.d;
4081
- if (elMatrix) {
4082
- top /= scaleY;
4083
- left /= scaleX;
4084
- width /= scaleX;
4085
- height /= scaleY;
4086
- bottom = top + height;
4087
- right = left + width;
4343
+ while (r = r.parentNode);
4344
+ if (o && t !== window) {
4345
+ var y = ye(r || t), b = y && y.a, w = y && y.d;
4346
+ y && (a /= w, l /= b, f /= b, d /= w, s = a + d, u = l + f);
4088
4347
  }
4348
+ return {
4349
+ top: a,
4350
+ left: l,
4351
+ bottom: s,
4352
+ right: u,
4353
+ width: f,
4354
+ height: d
4355
+ };
4089
4356
  }
4090
- return {
4091
- top,
4092
- left,
4093
- bottom,
4094
- right,
4095
- width,
4096
- height
4097
- };
4098
4357
  }
4099
- /**
4100
- * Checks if a side of an element is scrolled past a side of its parents
4101
- * @param {HTMLElement} el The element who's side being scrolled out of view is in question
4102
- * @param {String} elSide Side of the element in question ('top', 'left', 'right', 'bottom')
4103
- * @param {String} parentSide Side of the parent in question ('top', 'left', 'right', 'bottom')
4104
- * @return {HTMLElement} The parent scroll element that the el's side is scrolled past, or null if there is no such element
4105
- */
4106
- function isScrolledPast(el, elSide, parentSide) {
4107
- var parent = getParentAutoScrollElement(el, true), elSideVal = getRect(el)[elSide];
4108
- while (parent) {
4109
- var parentSideVal = getRect(parent)[parentSide], visible = void 0;
4110
- if (parentSide === "top" || parentSide === "left") visible = elSideVal >= parentSideVal;
4111
- else visible = elSideVal <= parentSideVal;
4112
- if (!visible) return parent;
4113
- if (parent === getWindowScrollingElement()) break;
4114
- parent = getParentAutoScrollElement(parent, false);
4358
+ function xt(t, e, n) {
4359
+ for (var o = ce(t, !0), r = P(t)[e]; o;) {
4360
+ var i = P(o)[n], a = void 0;
4361
+ if (a = r >= i, !a) return o;
4362
+ if (o === te()) break;
4363
+ o = ce(o, !1);
4115
4364
  }
4116
- return false;
4365
+ return !1;
4117
4366
  }
4118
- /**
4119
- * Gets nth child of el, ignoring hidden children, sortable's elements (does not ignore clone if it's visible)
4120
- * and non-draggable elements
4121
- * @param {HTMLElement} el The parent element
4122
- * @param {Number} childNum The index of the child
4123
- * @param {Object} options Parent Sortable's options
4124
- * @return {HTMLElement} The child at index childNum, or null if not found
4125
- */
4126
- function getChild(el, childNum, options, includeDragEl) {
4127
- var currentChild = 0, i = 0, children = el.children;
4128
- while (i < children.length) {
4129
- if (children[i].style.display !== "none" && children[i] !== Sortable.ghost && (includeDragEl || children[i] !== Sortable.dragged) && closest(children[i], options.draggable, el, false)) {
4130
- if (currentChild === childNum) return children[i];
4131
- currentChild++;
4367
+ function we(t, e, n, o) {
4368
+ for (var r = 0, i = 0, a = t.children; i < a.length;) {
4369
+ if (a[i].style.display !== "none" && a[i] !== p.ghost && (o || a[i] !== p.dragged) && Q(a[i], n.draggable, t, !1)) {
4370
+ if (r === e) return a[i];
4371
+ r++;
4132
4372
  }
4133
4373
  i++;
4134
4374
  }
4135
4375
  return null;
4136
4376
  }
4137
- /**
4138
- * Gets the last child in the el, ignoring ghostEl or invisible elements (clones)
4139
- * @param {HTMLElement} el Parent element
4140
- * @param {selector} selector Any other elements that should be ignored
4141
- * @return {HTMLElement} The last child, ignoring ghostEl
4142
- */
4143
- function lastChild(el, selector) {
4144
- var last = el.lastElementChild;
4145
- while (last && (last === Sortable.ghost || css(last, "display") === "none" || selector && !matches(last, selector))) last = last.previousElementSibling;
4146
- return last || null;
4147
- }
4148
- /**
4149
- * Returns the index of an element within its parent for a selected set of
4150
- * elements
4151
- * @param {HTMLElement} el
4152
- * @param {selector} selector
4153
- * @return {number}
4154
- */
4155
- function index(el, selector) {
4156
- var index = 0;
4157
- if (!el || !el.parentNode) return -1;
4158
- while (el = el.previousElementSibling) if (el.nodeName.toUpperCase() !== "TEMPLATE" && el !== Sortable.clone && (!selector || matches(el, selector))) index++;
4159
- return index;
4160
- }
4161
- /**
4162
- * Returns the scroll offset of the given element, added with all the scroll offsets of parent elements.
4163
- * The value is returned in real pixels.
4164
- * @param {HTMLElement} el
4165
- * @return {Array} Offsets in the format of [left, top]
4166
- */
4167
- function getRelativeScrollOffset(el) {
4168
- var offsetLeft = 0, offsetTop = 0, winScroller = getWindowScrollingElement();
4169
- if (el) do {
4170
- var elMatrix = matrix(el), scaleX = elMatrix.a, scaleY = elMatrix.d;
4171
- offsetLeft += el.scrollLeft * scaleX;
4172
- offsetTop += el.scrollTop * scaleY;
4173
- } while (el !== winScroller && (el = el.parentNode));
4174
- return [offsetLeft, offsetTop];
4175
- }
4176
- /**
4177
- * Returns the index of the object within the given array
4178
- * @param {Array} arr Array that may or may not hold the object
4179
- * @param {Object} obj An object that has a key-value pair unique to and identical to a key-value pair in the object you want to find
4180
- * @return {Number} The index of the object in the array, or -1
4181
- */
4182
- function indexOfObject(arr, obj) {
4183
- for (var i in arr) {
4184
- if (!arr.hasOwnProperty(i)) continue;
4185
- for (var key in obj) if (obj.hasOwnProperty(key) && obj[key] === arr[i][key]) return Number(i);
4377
+ function ht(t, e) {
4378
+ for (var n = t.lastElementChild; n && (n === p.ghost || h(n, "display") === "none" || e && !We(n, e));) n = n.previousElementSibling;
4379
+ return n || null;
4380
+ }
4381
+ function J(t, e) {
4382
+ var n = 0;
4383
+ if (!t || !t.parentNode) return -1;
4384
+ for (; t = t.previousElementSibling;) t.nodeName.toUpperCase() !== "TEMPLATE" && t !== p.clone && (!e || We(t, e)) && n++;
4385
+ return n;
4386
+ }
4387
+ function Nt(t) {
4388
+ var e = 0, n = 0, o = te();
4389
+ if (t) do {
4390
+ var r = ye(t), i = r.a, a = r.d;
4391
+ e += t.scrollLeft * i, n += t.scrollTop * a;
4392
+ } while (t !== o && (t = t.parentNode));
4393
+ return [e, n];
4394
+ }
4395
+ function Mn(t, e) {
4396
+ for (var n in t) if (t.hasOwnProperty(n)) {
4397
+ for (var o in e) if (e.hasOwnProperty(o) && e[o] === t[n][o]) return Number(n);
4186
4398
  }
4187
4399
  return -1;
4188
4400
  }
4189
- function getParentAutoScrollElement(el, includeSelf) {
4190
- if (!el || !el.getBoundingClientRect) return getWindowScrollingElement();
4191
- var elem = el;
4192
- var gotSelf = false;
4401
+ function ce(t, e) {
4402
+ if (!t || !t.getBoundingClientRect) return te();
4403
+ var n = t, o = !1;
4193
4404
  do
4194
- if (elem.clientWidth < elem.scrollWidth || elem.clientHeight < elem.scrollHeight) {
4195
- var elemCSS = css(elem);
4196
- if (elem.clientWidth < elem.scrollWidth && (elemCSS.overflowX == "auto" || elemCSS.overflowX == "scroll") || elem.clientHeight < elem.scrollHeight && (elemCSS.overflowY == "auto" || elemCSS.overflowY == "scroll")) {
4197
- if (!elem.getBoundingClientRect || elem === document.body) return getWindowScrollingElement();
4198
- if (gotSelf || includeSelf) return elem;
4199
- gotSelf = true;
4405
+ if (n.clientWidth < n.scrollWidth || n.clientHeight < n.scrollHeight) {
4406
+ var r = h(n);
4407
+ if (n.clientWidth < n.scrollWidth && (r.overflowX == "auto" || r.overflowX == "scroll") || n.clientHeight < n.scrollHeight && (r.overflowY == "auto" || r.overflowY == "scroll")) {
4408
+ if (!n.getBoundingClientRect || n === document.body) return te();
4409
+ if (o || e) return n;
4410
+ o = !0;
4200
4411
  }
4201
4412
  }
4202
- while (elem = elem.parentNode);
4203
- return getWindowScrollingElement();
4413
+ while (n = n.parentNode);
4414
+ return te();
4204
4415
  }
4205
- function extend(dst, src) {
4206
- if (dst && src) {
4207
- for (var key in src) if (src.hasOwnProperty(key)) dst[key] = src[key];
4208
- }
4209
- return dst;
4416
+ function Fn(t, e) {
4417
+ if (t && e) for (var n in e) e.hasOwnProperty(n) && (t[n] = e[n]);
4418
+ return t;
4210
4419
  }
4211
- function isRectEqual(rect1, rect2) {
4212
- return Math.round(rect1.top) === Math.round(rect2.top) && Math.round(rect1.left) === Math.round(rect2.left) && Math.round(rect1.height) === Math.round(rect2.height) && Math.round(rect1.width) === Math.round(rect2.width);
4420
+ function Je(t, e) {
4421
+ 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);
4213
4422
  }
4214
- var _throttleTimeout;
4215
- function throttle(callback, ms) {
4423
+ var Ce;
4424
+ function zt(t, e) {
4216
4425
  return function() {
4217
- if (!_throttleTimeout) {
4218
- var args = arguments, _this = this;
4219
- if (args.length === 1) callback.call(_this, args[0]);
4220
- else callback.apply(_this, args);
4221
- _throttleTimeout = setTimeout(function() {
4222
- _throttleTimeout = void 0;
4223
- }, ms);
4426
+ if (!Ce) {
4427
+ var n = arguments, o = this;
4428
+ n.length === 1 ? t.call(o, n[0]) : t.apply(o, n), Ce = setTimeout(function() {
4429
+ Ce = void 0;
4430
+ }, e);
4224
4431
  }
4225
4432
  };
4226
4433
  }
4227
- function cancelThrottle() {
4228
- clearTimeout(_throttleTimeout);
4229
- _throttleTimeout = void 0;
4230
- }
4231
- function scrollBy(el, x, y) {
4232
- el.scrollLeft += x;
4233
- el.scrollTop += y;
4234
- }
4235
- function clone(el) {
4236
- var Polymer = window.Polymer;
4237
- var $ = window.jQuery || window.Zepto;
4238
- if (Polymer && Polymer.dom) return Polymer.dom(el).cloneNode(true);
4239
- else if ($) return $(el).clone(true)[0];
4240
- else return el.cloneNode(true);
4241
- }
4242
- function getChildContainingRectFromElement(container, options, ghostEl) {
4243
- var rect = {};
4244
- Array.from(container.children).forEach(function(child) {
4245
- var _rect$left, _rect$top, _rect$right, _rect$bottom;
4246
- if (!closest(child, options.draggable, container, false) || child.animated || child === ghostEl) return;
4247
- var childRect = getRect(child);
4248
- rect.left = Math.min((_rect$left = rect.left) !== null && _rect$left !== void 0 ? _rect$left : Infinity, childRect.left);
4249
- rect.top = Math.min((_rect$top = rect.top) !== null && _rect$top !== void 0 ? _rect$top : Infinity, childRect.top);
4250
- rect.right = Math.max((_rect$right = rect.right) !== null && _rect$right !== void 0 ? _rect$right : -Infinity, childRect.right);
4251
- rect.bottom = Math.max((_rect$bottom = rect.bottom) !== null && _rect$bottom !== void 0 ? _rect$bottom : -Infinity, childRect.bottom);
4252
- });
4253
- rect.width = rect.right - rect.left;
4254
- rect.height = rect.bottom - rect.top;
4255
- rect.x = rect.left;
4256
- rect.y = rect.top;
4257
- return rect;
4258
- }
4259
- var expando = "Sortable" + (/* @__PURE__ */ new Date()).getTime();
4260
- function AnimationStateManager() {
4261
- var animationStates = [], animationCallbackId;
4434
+ function Rn() {
4435
+ clearTimeout(Ce), Ce = void 0;
4436
+ }
4437
+ function Ut(t, e, n) {
4438
+ t.scrollLeft += e, t.scrollTop += n;
4439
+ }
4440
+ function Vt(t) {
4441
+ var e = window.Polymer, n = window.jQuery || window.Zepto;
4442
+ return e && e.dom ? e.dom(t).cloneNode(!0) : n ? n(t).clone(!0)[0] : t.cloneNode(!0);
4443
+ }
4444
+ function $t(t, e, n) {
4445
+ var o = {};
4446
+ return Array.from(t.children).forEach(function(r) {
4447
+ var i, a, l, s;
4448
+ if (!(!Q(r, e.draggable, t, !1) || r.animated || r === n)) {
4449
+ var u = P(r);
4450
+ o.left = Math.min((i = o.left) !== null && i !== void 0 ? i : Infinity, u.left), o.top = Math.min((a = o.top) !== null && a !== void 0 ? a : Infinity, u.top), o.right = Math.max((l = o.right) !== null && l !== void 0 ? l : -Infinity, u.right), o.bottom = Math.max((s = o.bottom) !== null && s !== void 0 ? s : -Infinity, u.bottom);
4451
+ }
4452
+ }), o.width = o.right - o.left, o.height = o.bottom - o.top, o.x = o.left, o.y = o.top, o;
4453
+ }
4454
+ var q = "Sortable" + (/* @__PURE__ */ new Date()).getTime();
4455
+ function Xn() {
4456
+ var t = [], e;
4262
4457
  return {
4263
- captureAnimationState: function captureAnimationState() {
4264
- animationStates = [];
4265
- if (!this.options.animation) return;
4266
- [].slice.call(this.el.children).forEach(function(child) {
4267
- if (css(child, "display") === "none" || child === Sortable.ghost) return;
4268
- animationStates.push({
4269
- target: child,
4270
- rect: getRect(child)
4271
- });
4272
- var fromRect = _objectSpread2({}, animationStates[animationStates.length - 1].rect);
4273
- if (child.thisAnimationDuration) {
4274
- var childMatrix = matrix(child, true);
4275
- if (childMatrix) {
4276
- fromRect.top -= childMatrix.f;
4277
- fromRect.left -= childMatrix.e;
4458
+ captureAnimationState: function() {
4459
+ if (t = [], !!this.options.animation) [].slice.call(this.el.children).forEach(function(r) {
4460
+ if (!(h(r, "display") === "none" || r === p.ghost)) {
4461
+ t.push({
4462
+ target: r,
4463
+ rect: P(r)
4464
+ });
4465
+ var i = ne({}, t[t.length - 1].rect);
4466
+ if (r.thisAnimationDuration) {
4467
+ var a = ye(r, !0);
4468
+ a && (i.top -= a.f, i.left -= a.e);
4278
4469
  }
4470
+ r.fromRect = i;
4279
4471
  }
4280
- child.fromRect = fromRect;
4281
4472
  });
4282
4473
  },
4283
- addAnimationState: function addAnimationState(state) {
4284
- animationStates.push(state);
4474
+ addAnimationState: function(o) {
4475
+ t.push(o);
4285
4476
  },
4286
- removeAnimationState: function removeAnimationState(target) {
4287
- animationStates.splice(indexOfObject(animationStates, { target }), 1);
4477
+ removeAnimationState: function(o) {
4478
+ t.splice(Mn(t, { target: o }), 1);
4288
4479
  },
4289
- animateAll: function animateAll(callback) {
4290
- var _this = this;
4480
+ animateAll: function(o) {
4481
+ var r = this;
4291
4482
  if (!this.options.animation) {
4292
- clearTimeout(animationCallbackId);
4293
- if (typeof callback === "function") callback();
4483
+ clearTimeout(e), typeof o == "function" && o();
4294
4484
  return;
4295
4485
  }
4296
- var animating = false, animationTime = 0;
4297
- animationStates.forEach(function(state) {
4298
- var time = 0, target = state.target, fromRect = target.fromRect, toRect = getRect(target), prevFromRect = target.prevFromRect, prevToRect = target.prevToRect, animatingRect = state.rect, targetMatrix = matrix(target, true);
4299
- if (targetMatrix) {
4300
- toRect.top -= targetMatrix.f;
4301
- toRect.left -= targetMatrix.e;
4302
- }
4303
- target.toRect = toRect;
4304
- if (target.thisAnimationDuration) {
4305
- if (isRectEqual(prevFromRect, toRect) && !isRectEqual(fromRect, toRect) && (animatingRect.top - toRect.top) / (animatingRect.left - toRect.left) === (fromRect.top - toRect.top) / (fromRect.left - toRect.left)) time = calculateRealTime(animatingRect, prevFromRect, prevToRect, _this.options);
4306
- }
4307
- if (!isRectEqual(toRect, fromRect)) {
4308
- target.prevFromRect = fromRect;
4309
- target.prevToRect = toRect;
4310
- if (!time) time = _this.options.animation;
4311
- _this.animate(target, animatingRect, toRect, time);
4312
- }
4313
- if (time) {
4314
- animating = true;
4315
- animationTime = Math.max(animationTime, time);
4316
- clearTimeout(target.animationResetTimer);
4317
- target.animationResetTimer = setTimeout(function() {
4318
- target.animationTime = 0;
4319
- target.prevFromRect = null;
4320
- target.fromRect = null;
4321
- target.prevToRect = null;
4322
- target.thisAnimationDuration = null;
4323
- }, time);
4324
- target.thisAnimationDuration = time;
4325
- }
4326
- });
4327
- clearTimeout(animationCallbackId);
4328
- if (!animating) {
4329
- if (typeof callback === "function") callback();
4330
- } else animationCallbackId = setTimeout(function() {
4331
- if (typeof callback === "function") callback();
4332
- }, animationTime);
4333
- animationStates = [];
4486
+ var i = !1, a = 0;
4487
+ t.forEach(function(l) {
4488
+ var s = 0, u = l.target, d = u.fromRect, f = P(u), m = u.prevFromRect, y = u.prevToRect, b = l.rect, w = ye(u, !0);
4489
+ w && (f.top -= w.f, f.left -= w.e), u.toRect = f, u.thisAnimationDuration && Je(m, f) && !Je(d, f) && (b.top - f.top) / (b.left - f.left) === (d.top - f.top) / (d.left - f.left) && (s = Bn(b, m, y, r.options)), Je(f, d) || (u.prevFromRect = d, u.prevToRect = f, s || (s = r.options.animation), r.animate(u, b, f, s)), s && (i = !0, a = Math.max(a, s), clearTimeout(u.animationResetTimer), u.animationResetTimer = setTimeout(function() {
4490
+ u.animationTime = 0, u.prevFromRect = null, u.fromRect = null, u.prevToRect = null, u.thisAnimationDuration = null;
4491
+ }, s), u.thisAnimationDuration = s);
4492
+ }), clearTimeout(e), i ? e = setTimeout(function() {
4493
+ typeof o == "function" && o();
4494
+ }, a) : typeof o == "function" && o(), t = [];
4334
4495
  },
4335
- animate: function animate(target, currentRect, toRect, duration) {
4336
- if (duration) {
4337
- css(target, "transition", "");
4338
- css(target, "transform", "");
4339
- var elMatrix = matrix(this.el), scaleX = elMatrix && elMatrix.a, scaleY = elMatrix && elMatrix.d, translateX = (currentRect.left - toRect.left) / (scaleX || 1), translateY = (currentRect.top - toRect.top) / (scaleY || 1);
4340
- target.animatingX = !!translateX;
4341
- target.animatingY = !!translateY;
4342
- css(target, "transform", "translate3d(" + translateX + "px," + translateY + "px,0)");
4343
- this.forRepaintDummy = repaint(target);
4344
- css(target, "transition", "transform " + duration + "ms" + (this.options.easing ? " " + this.options.easing : ""));
4345
- css(target, "transform", "translate3d(0,0,0)");
4346
- typeof target.animated === "number" && clearTimeout(target.animated);
4347
- target.animated = setTimeout(function() {
4348
- css(target, "transition", "");
4349
- css(target, "transform", "");
4350
- target.animated = false;
4351
- target.animatingX = false;
4352
- target.animatingY = false;
4353
- }, duration);
4496
+ animate: function(o, r, i, a) {
4497
+ if (a) {
4498
+ h(o, "transition", ""), h(o, "transform", "");
4499
+ var l = ye(this.el), s = l && l.a, u = l && l.d, d = (r.left - i.left) / (s || 1), f = (r.top - i.top) / (u || 1);
4500
+ o.animatingX = !!d, o.animatingY = !!f, h(o, "transform", "translate3d(" + d + "px," + f + "px,0)"), this.forRepaintDummy = Yn(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() {
4501
+ h(o, "transition", ""), h(o, "transform", ""), o.animated = !1, o.animatingX = !1, o.animatingY = !1;
4502
+ }, a);
4354
4503
  }
4355
4504
  }
4356
4505
  };
4357
4506
  }
4358
- function repaint(target) {
4359
- return target.offsetWidth;
4507
+ function Yn(t) {
4508
+ return t.offsetWidth;
4360
4509
  }
4361
- function calculateRealTime(animatingRect, fromRect, toRect, options) {
4362
- return Math.sqrt(Math.pow(fromRect.top - animatingRect.top, 2) + Math.pow(fromRect.left - animatingRect.left, 2)) / Math.sqrt(Math.pow(fromRect.top - toRect.top, 2) + Math.pow(fromRect.left - toRect.left, 2)) * options.animation;
4510
+ function Bn(t, e, n, o) {
4511
+ 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;
4363
4512
  }
4364
- var plugins = [];
4365
- var defaults = { initializeByDefault: true };
4366
- var PluginManager = {
4367
- mount: function mount(plugin) {
4368
- for (var option in defaults) if (defaults.hasOwnProperty(option) && !(option in plugin)) plugin[option] = defaults[option];
4369
- plugins.forEach(function(p) {
4370
- if (p.pluginName === plugin.pluginName) throw "Sortable: Cannot mount plugin ".concat(plugin.pluginName, " more than once");
4371
- });
4372
- plugins.push(plugin);
4513
+ var ge = [], Ze = { initializeByDefault: !0 }, Ne = {
4514
+ mount: function(e) {
4515
+ for (var n in Ze) Ze.hasOwnProperty(n) && !(n in e) && (e[n] = Ze[n]);
4516
+ ge.forEach(function(o) {
4517
+ if (o.pluginName === e.pluginName) throw "Sortable: Cannot mount plugin ".concat(e.pluginName, " more than once");
4518
+ }), ge.push(e);
4373
4519
  },
4374
- pluginEvent: function pluginEvent(eventName, sortable, evt) {
4375
- var _this = this;
4376
- this.eventCanceled = false;
4377
- evt.cancel = function() {
4378
- _this.eventCanceled = true;
4520
+ pluginEvent: function(e, n, o) {
4521
+ var r = this;
4522
+ this.eventCanceled = !1, o.cancel = function() {
4523
+ r.eventCanceled = !0;
4379
4524
  };
4380
- var eventNameGlobal = eventName + "Global";
4381
- plugins.forEach(function(plugin) {
4382
- if (!sortable[plugin.pluginName]) return;
4383
- if (sortable[plugin.pluginName][eventNameGlobal]) sortable[plugin.pluginName][eventNameGlobal](_objectSpread2({ sortable }, evt));
4384
- if (sortable.options[plugin.pluginName] && sortable[plugin.pluginName][eventName]) sortable[plugin.pluginName][eventName](_objectSpread2({ sortable }, evt));
4525
+ var i = e + "Global";
4526
+ ge.forEach(function(a) {
4527
+ n[a.pluginName] && (n[a.pluginName][i] && n[a.pluginName][i](ne({ sortable: n }, o)), n.options[a.pluginName] && n[a.pluginName][e] && n[a.pluginName][e](ne({ sortable: n }, o)));
4385
4528
  });
4386
4529
  },
4387
- initializePlugins: function initializePlugins(sortable, el, defaults, options) {
4388
- plugins.forEach(function(plugin) {
4389
- var pluginName = plugin.pluginName;
4390
- if (!sortable.options[pluginName] && !plugin.initializeByDefault) return;
4391
- var initialized = new plugin(sortable, el, sortable.options);
4392
- initialized.sortable = sortable;
4393
- initialized.options = sortable.options;
4394
- sortable[pluginName] = initialized;
4395
- _extends(defaults, initialized.defaults);
4530
+ initializePlugins: function(e, n, o, r) {
4531
+ ge.forEach(function(l) {
4532
+ var s = l.pluginName;
4533
+ if (!(!e.options[s] && !l.initializeByDefault)) {
4534
+ var u = new l(e, n, e.options);
4535
+ u.sortable = e, u.options = e.options, e[s] = u, ie(o, u.defaults);
4536
+ }
4396
4537
  });
4397
- for (var option in sortable.options) {
4398
- if (!sortable.options.hasOwnProperty(option)) continue;
4399
- var modified = this.modifyOption(sortable, option, sortable.options[option]);
4400
- if (typeof modified !== "undefined") sortable.options[option] = modified;
4538
+ for (var i in e.options) if (e.options.hasOwnProperty(i)) {
4539
+ var a = this.modifyOption(e, i, e.options[i]);
4540
+ typeof a != "undefined" && (e.options[i] = a);
4401
4541
  }
4402
4542
  },
4403
- getEventProperties: function getEventProperties(name, sortable) {
4404
- var eventProperties = {};
4405
- plugins.forEach(function(plugin) {
4406
- if (typeof plugin.eventProperties !== "function") return;
4407
- _extends(eventProperties, plugin.eventProperties.call(sortable[plugin.pluginName], name));
4408
- });
4409
- return eventProperties;
4543
+ getEventProperties: function(e, n) {
4544
+ var o = {};
4545
+ return ge.forEach(function(r) {
4546
+ typeof r.eventProperties == "function" && ie(o, r.eventProperties.call(n[r.pluginName], e));
4547
+ }), o;
4410
4548
  },
4411
- modifyOption: function modifyOption(sortable, name, value) {
4412
- var modifiedValue;
4413
- plugins.forEach(function(plugin) {
4414
- if (!sortable[plugin.pluginName]) return;
4415
- if (plugin.optionListeners && typeof plugin.optionListeners[name] === "function") modifiedValue = plugin.optionListeners[name].call(sortable[plugin.pluginName], value);
4416
- });
4417
- return modifiedValue;
4549
+ modifyOption: function(e, n, o) {
4550
+ var r;
4551
+ return ge.forEach(function(i) {
4552
+ e[i.pluginName] && i.optionListeners && typeof i.optionListeners[n] == "function" && (r = i.optionListeners[n].call(e[i.pluginName], o));
4553
+ }), r;
4418
4554
  }
4419
4555
  };
4420
- function dispatchEvent(_ref) {
4421
- var sortable = _ref.sortable, rootEl = _ref.rootEl, name = _ref.name, targetEl = _ref.targetEl, cloneEl = _ref.cloneEl, toEl = _ref.toEl, fromEl = _ref.fromEl, oldIndex = _ref.oldIndex, newIndex = _ref.newIndex, oldDraggableIndex = _ref.oldDraggableIndex, newDraggableIndex = _ref.newDraggableIndex, originalEvent = _ref.originalEvent, putSortable = _ref.putSortable, extraEventProperties = _ref.extraEventProperties;
4422
- sortable = sortable || rootEl && rootEl[expando];
4423
- if (!sortable) return;
4424
- var evt, options = sortable.options, onName = "on" + name.charAt(0).toUpperCase() + name.substr(1);
4425
- if (window.CustomEvent && !IE11OrLess && !Edge) evt = new CustomEvent(name, {
4426
- bubbles: true,
4427
- cancelable: true
4428
- });
4429
- else {
4430
- evt = document.createEvent("Event");
4431
- evt.initEvent(name, true, true);
4556
+ function kn(t) {
4557
+ 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, m = t.originalEvent, y = t.putSortable, b = t.extraEventProperties;
4558
+ if (e = e || n && n[q], !!e) {
4559
+ var w, L = e.options, G = "on" + o.charAt(0).toUpperCase() + o.substr(1);
4560
+ window.CustomEvent && !ae && !xe ? w = new CustomEvent(o, {
4561
+ bubbles: !0,
4562
+ cancelable: !0
4563
+ }) : (w = document.createEvent("Event"), w.initEvent(o, !0, !0)), w.to = a || n, w.from = l || n, w.item = r || n, w.clone = i, w.oldIndex = s, w.newIndex = u, w.oldDraggableIndex = d, w.newDraggableIndex = f, w.originalEvent = m, w.pullMode = y ? y.lastPutMode : void 0;
4564
+ var R = ne(ne({}, b), Ne.getEventProperties(o, e));
4565
+ for (var j in R) w[j] = R[j];
4566
+ n && n.dispatchEvent(w), L[G] && L[G].call(e, w);
4432
4567
  }
4433
- evt.to = toEl || rootEl;
4434
- evt.from = fromEl || rootEl;
4435
- evt.item = targetEl || rootEl;
4436
- evt.clone = cloneEl;
4437
- evt.oldIndex = oldIndex;
4438
- evt.newIndex = newIndex;
4439
- evt.oldDraggableIndex = oldDraggableIndex;
4440
- evt.newDraggableIndex = newDraggableIndex;
4441
- evt.originalEvent = originalEvent;
4442
- evt.pullMode = putSortable ? putSortable.lastPutMode : void 0;
4443
- var allEventProperties = _objectSpread2(_objectSpread2({}, extraEventProperties), PluginManager.getEventProperties(name, sortable));
4444
- for (var option in allEventProperties) evt[option] = allEventProperties[option];
4445
- if (rootEl) rootEl.dispatchEvent(evt);
4446
- if (options[onName]) options[onName].call(sortable, evt);
4447
- }
4448
- var _excluded = ["evt"];
4449
- var pluginEvent = function pluginEvent(eventName, sortable) {
4450
- var _ref = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, originalEvent = _ref.evt, data = _objectWithoutProperties(_ref, _excluded);
4451
- PluginManager.pluginEvent.bind(Sortable)(eventName, sortable, _objectSpread2({
4452
- dragEl,
4453
- parentEl,
4454
- ghostEl,
4455
- rootEl,
4456
- nextEl,
4457
- lastDownEl,
4458
- cloneEl,
4459
- cloneHidden,
4460
- dragStarted: moved,
4461
- putSortable,
4462
- activeSortable: Sortable.active,
4463
- originalEvent,
4464
- oldIndex,
4465
- oldDraggableIndex,
4466
- newIndex,
4467
- newDraggableIndex,
4468
- hideGhostForTarget: _hideGhostForTarget,
4469
- unhideGhostForTarget: _unhideGhostForTarget,
4470
- cloneNowHidden: function cloneNowHidden() {
4471
- cloneHidden = true;
4568
+ }
4569
+ var Hn = ["evt"], z = function(e, n) {
4570
+ var o = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, r = o.evt, i = xn(o, Hn);
4571
+ Ne.pluginEvent.bind(p)(e, n, ne({
4572
+ dragEl: c,
4573
+ parentEl: O,
4574
+ ghostEl: g,
4575
+ rootEl: T,
4576
+ nextEl: pe,
4577
+ lastDownEl: Be,
4578
+ cloneEl: C,
4579
+ cloneHidden: ue,
4580
+ dragStarted: Se,
4581
+ putSortable: Y,
4582
+ activeSortable: p.active,
4583
+ originalEvent: r,
4584
+ oldIndex: be,
4585
+ oldDraggableIndex: Oe,
4586
+ newIndex: $,
4587
+ newDraggableIndex: se,
4588
+ hideGhostForTarget: Zt,
4589
+ unhideGhostForTarget: Qt,
4590
+ cloneNowHidden: function() {
4591
+ ue = !0;
4472
4592
  },
4473
- cloneNowShown: function cloneNowShown() {
4474
- cloneHidden = false;
4593
+ cloneNowShown: function() {
4594
+ ue = !1;
4475
4595
  },
4476
- dispatchSortableEvent: function dispatchSortableEvent(name) {
4477
- _dispatchEvent({
4478
- sortable,
4479
- name,
4480
- originalEvent
4596
+ dispatchSortableEvent: function(l) {
4597
+ W({
4598
+ sortable: n,
4599
+ name: l,
4600
+ originalEvent: r
4481
4601
  });
4482
4602
  }
4483
- }, data));
4603
+ }, i));
4484
4604
  };
4485
- function _dispatchEvent(info) {
4486
- dispatchEvent(_objectSpread2({
4487
- putSortable,
4488
- cloneEl,
4489
- targetEl: dragEl,
4490
- rootEl,
4491
- oldIndex,
4492
- oldDraggableIndex,
4493
- newIndex,
4494
- newDraggableIndex
4495
- }, info));
4496
- }
4497
- var dragEl, parentEl, ghostEl, rootEl, nextEl, lastDownEl, cloneEl, cloneHidden, oldIndex, newIndex, oldDraggableIndex, newDraggableIndex, activeGroup, putSortable, awaitingDragStarted = false, ignoreNextClick = false, sortables = [], tapEvt, touchEvt, lastDx, lastDy, tapDistanceLeft, tapDistanceTop, moved, lastTarget, lastDirection, pastFirstInvertThresh = false, isCircumstantialInvert = false, targetMoveDistance, ghostRelativeParent, ghostRelativeParentInitialScroll = [], _silent = false, savedInputChecked = [];
4498
- /** @const */
4499
- var documentExists = typeof document !== "undefined", PositionGhostAbsolutely = IOS, CSSFloatProperty = Edge || IE11OrLess ? "cssFloat" : "float", supportDraggable = documentExists && !ChromeForAndroid && !IOS && "draggable" in document.createElement("div"), supportCssPointerEvents = function() {
4500
- if (!documentExists) return;
4501
- if (IE11OrLess) return false;
4502
- var el = document.createElement("x");
4503
- el.style.cssText = "pointer-events:auto";
4504
- return el.style.pointerEvents === "auto";
4505
- }(), _detectDirection = function _detectDirection(el, options) {
4506
- var elCSS = css(el), elWidth = parseInt(elCSS.width) - parseInt(elCSS.paddingLeft) - parseInt(elCSS.paddingRight) - parseInt(elCSS.borderLeftWidth) - parseInt(elCSS.borderRightWidth), child1 = getChild(el, 0, options), child2 = getChild(el, 1, options), firstChildCSS = child1 && css(child1), secondChildCSS = child2 && css(child2), firstChildWidth = firstChildCSS && parseInt(firstChildCSS.marginLeft) + parseInt(firstChildCSS.marginRight) + getRect(child1).width, secondChildWidth = secondChildCSS && parseInt(secondChildCSS.marginLeft) + parseInt(secondChildCSS.marginRight) + getRect(child2).width;
4507
- if (elCSS.display === "flex") return elCSS.flexDirection === "column" || elCSS.flexDirection === "column-reverse" ? "vertical" : "horizontal";
4508
- if (elCSS.display === "grid") return elCSS.gridTemplateColumns.split(" ").length <= 1 ? "vertical" : "horizontal";
4509
- if (child1 && firstChildCSS["float"] && firstChildCSS["float"] !== "none") {
4510
- var touchingSideChild2 = firstChildCSS["float"] === "left" ? "left" : "right";
4511
- return child2 && (secondChildCSS.clear === "both" || secondChildCSS.clear === touchingSideChild2) ? "vertical" : "horizontal";
4605
+ function W(t) {
4606
+ kn(ne({
4607
+ putSortable: Y,
4608
+ cloneEl: C,
4609
+ targetEl: c,
4610
+ rootEl: T,
4611
+ oldIndex: be,
4612
+ oldDraggableIndex: Oe,
4613
+ newIndex: $,
4614
+ newDraggableIndex: se
4615
+ }, t));
4616
+ }
4617
+ var c, O, g, T, pe, Be, C, ue, be, $, Oe, se, Me, Y, ve = !1, Ge = !1, je = [], de, Z, Qe, et, Pt, Mt, Se, me, Ie, Ae = !1, Fe = !1, ke, H, tt = [], lt = !1, ze = [], Ve = typeof document != "undefined", Re = Lt, Ft = xe || ae ? "cssFloat" : "float", Ln = Ve && !Wt && !Lt && "draggable" in document.createElement("div"), qt = function() {
4618
+ if (Ve) {
4619
+ if (ae) return !1;
4620
+ var t = document.createElement("x");
4621
+ return t.style.cssText = "pointer-events:auto", t.style.pointerEvents === "auto";
4512
4622
  }
4513
- return child1 && (firstChildCSS.display === "block" || firstChildCSS.display === "flex" || firstChildCSS.display === "table" || firstChildCSS.display === "grid" || firstChildWidth >= elWidth && elCSS[CSSFloatProperty] === "none" || child2 && elCSS[CSSFloatProperty] === "none" && firstChildWidth + secondChildWidth > elWidth) ? "vertical" : "horizontal";
4514
- }, _dragElInRowColumn = function _dragElInRowColumn(dragRect, targetRect, vertical) {
4515
- var dragElS1Opp = vertical ? dragRect.left : dragRect.top, dragElS2Opp = vertical ? dragRect.right : dragRect.bottom, dragElOppLength = vertical ? dragRect.width : dragRect.height, targetS1Opp = vertical ? targetRect.left : targetRect.top, targetS2Opp = vertical ? targetRect.right : targetRect.bottom, targetOppLength = vertical ? targetRect.width : targetRect.height;
4516
- return dragElS1Opp === targetS1Opp || dragElS2Opp === targetS2Opp || dragElS1Opp + dragElOppLength / 2 === targetS1Opp + targetOppLength / 2;
4517
- }, _detectNearestEmptySortable = function _detectNearestEmptySortable(x, y) {
4518
- var ret;
4519
- sortables.some(function(sortable) {
4520
- var threshold = sortable[expando].options.emptyInsertThreshold;
4521
- if (!threshold || lastChild(sortable)) return;
4522
- var rect = getRect(sortable), insideHorizontally = x >= rect.left - threshold && x <= rect.right + threshold, insideVertically = y >= rect.top - threshold && y <= rect.bottom + threshold;
4523
- if (insideHorizontally && insideVertically) return ret = sortable;
4524
- });
4525
- return ret;
4526
- }, _prepareGroup = function _prepareGroup(options) {
4527
- function toFn(value, pull) {
4528
- return function(to, from, dragEl, evt) {
4529
- var sameGroup = to.options.group.name && from.options.group.name && to.options.group.name === from.options.group.name;
4530
- if (value == null && (pull || sameGroup)) return true;
4531
- else if (value == null || value === false) return false;
4532
- else if (pull && value === "clone") return value;
4533
- else if (typeof value === "function") return toFn(value(to, from, dragEl, evt), pull)(to, from, dragEl, evt);
4534
- else {
4535
- var otherGroup = (pull ? to : from).options.group.name;
4536
- return value === true || typeof value === "string" && value === otherGroup || value.join && value.indexOf(otherGroup) > -1;
4537
- }
4623
+ }(), Kt = function(e, n) {
4624
+ var o = h(e), r = parseInt(o.width) - parseInt(o.paddingLeft) - parseInt(o.paddingRight) - parseInt(o.borderLeftWidth) - parseInt(o.borderRightWidth), i = we(e, 0, n), a = we(e, 1, n), l = i && h(i), s = a && h(a), u = l && parseInt(l.marginLeft) + parseInt(l.marginRight) + P(i).width, d = s && parseInt(s.marginLeft) + parseInt(s.marginRight) + P(a).width;
4625
+ if (o.display === "flex") return o.flexDirection === "column" || o.flexDirection === "column-reverse" ? "vertical" : "horizontal";
4626
+ if (o.display === "grid") return o.gridTemplateColumns.split(" ").length <= 1 ? "vertical" : "horizontal";
4627
+ if (i && l.float && l.float !== "none") {
4628
+ var f = l.float === "left" ? "left" : "right";
4629
+ return a && (s.clear === "both" || s.clear === f) ? "vertical" : "horizontal";
4630
+ }
4631
+ return i && (l.display === "block" || l.display === "flex" || l.display === "table" || l.display === "grid" || u >= r && o[Ft] === "none" || a && o[Ft] === "none" && u + d > r) ? "vertical" : "horizontal";
4632
+ }, Wn = function(e, n, o) {
4633
+ 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;
4634
+ return r === l || i === s || r + a / 2 === l + u / 2;
4635
+ }, Gn = function(e, n) {
4636
+ var o;
4637
+ return je.some(function(r) {
4638
+ var i = r[q].options.emptyInsertThreshold;
4639
+ if (!(!i || ht(r))) {
4640
+ var a = P(r), l = e >= a.left - i && e <= a.right + i, s = n >= a.top - i && n <= a.bottom + i;
4641
+ if (l && s) return o = r;
4642
+ }
4643
+ }), o;
4644
+ }, Jt = function(e) {
4645
+ function n(i, a) {
4646
+ return function(l, s, u, d) {
4647
+ var f = l.options.group.name && s.options.group.name && l.options.group.name === s.options.group.name;
4648
+ if (i == null && (a || f)) return !0;
4649
+ if (i == null || i === !1) return !1;
4650
+ if (a && i === "clone") return i;
4651
+ if (typeof i == "function") return n(i(l, s, u, d), a)(l, s, u, d);
4652
+ var m = (a ? l : s).options.group.name;
4653
+ return i === !0 || typeof i == "string" && i === m || i.join && i.indexOf(m) > -1;
4538
4654
  };
4539
4655
  }
4540
- var group = {};
4541
- var originalGroup = options.group;
4542
- if (!originalGroup || _typeof(originalGroup) != "object") originalGroup = { name: originalGroup };
4543
- group.name = originalGroup.name;
4544
- group.checkPull = toFn(originalGroup.pull, true);
4545
- group.checkPut = toFn(originalGroup.put);
4546
- group.revertClone = originalGroup.revertClone;
4547
- options.group = group;
4548
- }, _hideGhostForTarget = function _hideGhostForTarget() {
4549
- if (!supportCssPointerEvents && ghostEl) css(ghostEl, "display", "none");
4550
- }, _unhideGhostForTarget = function _unhideGhostForTarget() {
4551
- if (!supportCssPointerEvents && ghostEl) css(ghostEl, "display", "");
4656
+ var o = {}, r = e.group;
4657
+ (!r || Ye(r) != "object") && (r = { name: r }), o.name = r.name, o.checkPull = n(r.pull, !0), o.checkPut = n(r.put), o.revertClone = r.revertClone, e.group = o;
4658
+ }, Zt = function() {
4659
+ !qt && g && h(g, "display", "none");
4660
+ }, Qt = function() {
4661
+ !qt && g && h(g, "display", "");
4552
4662
  };
4553
- if (documentExists && !ChromeForAndroid) document.addEventListener("click", function(evt) {
4554
- if (ignoreNextClick) {
4555
- evt.preventDefault();
4556
- evt.stopPropagation && evt.stopPropagation();
4557
- evt.stopImmediatePropagation && evt.stopImmediatePropagation();
4558
- ignoreNextClick = false;
4559
- return false;
4560
- }
4561
- }, true);
4562
- var nearestEmptyInsertDetectEvent = function nearestEmptyInsertDetectEvent(evt) {
4563
- if (dragEl) {
4564
- evt = evt.touches ? evt.touches[0] : evt;
4565
- var nearest = _detectNearestEmptySortable(evt.clientX, evt.clientY);
4566
- if (nearest) {
4567
- var event = {};
4568
- for (var i in evt) if (evt.hasOwnProperty(i)) event[i] = evt[i];
4569
- event.target = event.rootEl = nearest;
4570
- event.preventDefault = void 0;
4571
- event.stopPropagation = void 0;
4572
- nearest[expando]._onDragOver(event);
4663
+ Ve && !Wt && document.addEventListener("click", function(t) {
4664
+ if (Ge) return t.preventDefault(), t.stopPropagation && t.stopPropagation(), t.stopImmediatePropagation && t.stopImmediatePropagation(), Ge = !1, !1;
4665
+ }, !0);
4666
+ var he = function(e) {
4667
+ if (c) {
4668
+ e = e.touches ? e.touches[0] : e;
4669
+ var n = Gn(e.clientX, e.clientY);
4670
+ if (n) {
4671
+ var o = {};
4672
+ for (var r in e) e.hasOwnProperty(r) && (o[r] = e[r]);
4673
+ o.target = o.rootEl = n, o.preventDefault = void 0, o.stopPropagation = void 0, n[q]._onDragOver(o);
4573
4674
  }
4574
4675
  }
4676
+ }, jn = function(e) {
4677
+ c && c.parentNode[q]._isOutsideThisEl(e.target);
4575
4678
  };
4576
- var _checkOutsideTargetEl = function _checkOutsideTargetEl(evt) {
4577
- if (dragEl) dragEl.parentNode[expando]._isOutsideThisEl(evt.target);
4578
- };
4579
- /**
4580
- * @class Sortable
4581
- * @param {HTMLElement} el
4582
- * @param {Object} [options]
4583
- */
4584
- function Sortable(el, options) {
4585
- if (!(el && el.nodeType && el.nodeType === 1)) throw "Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(el));
4586
- this.el = el;
4587
- this.options = options = _extends({}, options);
4588
- el[expando] = this;
4589
- var defaults = {
4679
+ function p(t, e) {
4680
+ if (!(t && t.nodeType && t.nodeType === 1)) throw "Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));
4681
+ this.el = t, this.options = e = ie({}, e), t[q] = this;
4682
+ var n = {
4590
4683
  group: null,
4591
- sort: true,
4592
- disabled: false,
4684
+ sort: !0,
4685
+ disabled: !1,
4593
4686
  store: null,
4594
4687
  handle: null,
4595
- draggable: /^[uo]l$/i.test(el.nodeName) ? ">li" : ">*",
4688
+ draggable: /^[uo]l$/i.test(t.nodeName) ? ">li" : ">*",
4596
4689
  swapThreshold: 1,
4597
- invertSwap: false,
4690
+ invertSwap: !1,
4598
4691
  invertedSwapThreshold: null,
4599
- removeCloneOnHide: true,
4600
- direction: function direction() {
4601
- return _detectDirection(el, this.options);
4692
+ removeCloneOnHide: !0,
4693
+ direction: function() {
4694
+ return Kt(t, this.options);
4602
4695
  },
4603
4696
  ghostClass: "sortable-ghost",
4604
4697
  chosenClass: "sortable-chosen",
4605
4698
  dragClass: "sortable-drag",
4606
4699
  ignore: "a, img",
4607
4700
  filter: null,
4608
- preventOnFilter: true,
4701
+ preventOnFilter: !0,
4609
4702
  animation: 0,
4610
4703
  easing: null,
4611
- setData: function setData(dataTransfer, dragEl) {
4612
- dataTransfer.setData("Text", dragEl.textContent);
4704
+ setData: function(a, l) {
4705
+ a.setData("Text", l.textContent);
4613
4706
  },
4614
- dropBubble: false,
4615
- dragoverBubble: false,
4707
+ dropBubble: !1,
4708
+ dragoverBubble: !1,
4616
4709
  dataIdAttr: "data-id",
4617
4710
  delay: 0,
4618
- delayOnTouchOnly: false,
4711
+ delayOnTouchOnly: !1,
4619
4712
  touchStartThreshold: (Number.parseInt ? Number : window).parseInt(window.devicePixelRatio, 10) || 1,
4620
- forceFallback: false,
4713
+ forceFallback: !1,
4621
4714
  fallbackClass: "sortable-fallback",
4622
- fallbackOnBody: false,
4715
+ fallbackOnBody: !1,
4623
4716
  fallbackTolerance: 0,
4624
4717
  fallbackOffset: {
4625
4718
  x: 0,
4626
4719
  y: 0
4627
4720
  },
4628
- supportPointer: Sortable.supportPointer !== false && "PointerEvent" in window && (!Safari || IOS),
4721
+ supportPointer: p.supportPointer !== !1 && "PointerEvent" in window && !Te,
4629
4722
  emptyInsertThreshold: 5
4630
4723
  };
4631
- PluginManager.initializePlugins(this, el, defaults);
4632
- for (var name in defaults) !(name in options) && (options[name] = defaults[name]);
4633
- _prepareGroup(options);
4634
- for (var fn in this) if (fn.charAt(0) === "_" && typeof this[fn] === "function") this[fn] = this[fn].bind(this);
4635
- this.nativeDraggable = options.forceFallback ? false : supportDraggable;
4636
- if (this.nativeDraggable) this.options.touchStartThreshold = 1;
4637
- if (options.supportPointer) on(el, "pointerdown", this._onTapStart);
4638
- else {
4639
- on(el, "mousedown", this._onTapStart);
4640
- on(el, "touchstart", this._onTapStart);
4641
- }
4642
- if (this.nativeDraggable) {
4643
- on(el, "dragover", this);
4644
- on(el, "dragenter", this);
4645
- }
4646
- sortables.push(this.el);
4647
- options.store && options.store.get && this.sort(options.store.get(this) || []);
4648
- _extends(this, AnimationStateManager());
4649
- }
4650
- Sortable.prototype = (/** @lends Sortable.prototype */ {
4651
- constructor: Sortable,
4652
- _isOutsideThisEl: function _isOutsideThisEl(target) {
4653
- if (!this.el.contains(target) && target !== this.el) lastTarget = null;
4724
+ Ne.initializePlugins(this, t, n);
4725
+ for (var o in n) !(o in e) && (e[o] = n[o]);
4726
+ Jt(e);
4727
+ for (var r in this) r.charAt(0) === "_" && typeof this[r] == "function" && (this[r] = this[r].bind(this));
4728
+ this.nativeDraggable = e.forceFallback ? !1 : Ln, this.nativeDraggable && (this.options.touchStartThreshold = 1), e.supportPointer ? S(t, "pointerdown", this._onTapStart) : (S(t, "mousedown", this._onTapStart), S(t, "touchstart", this._onTapStart)), this.nativeDraggable && (S(t, "dragover", this), S(t, "dragenter", this)), je.push(this.el), e.store && e.store.get && this.sort(e.store.get(this) || []), ie(this, Xn());
4729
+ }
4730
+ p.prototype = {
4731
+ constructor: p,
4732
+ _isOutsideThisEl: function(e) {
4733
+ !this.el.contains(e) && e !== this.el && (me = null);
4654
4734
  },
4655
- _getDirection: function _getDirection(evt, target) {
4656
- return typeof this.options.direction === "function" ? this.options.direction.call(this, evt, target, dragEl) : this.options.direction;
4735
+ _getDirection: function(e, n) {
4736
+ return typeof this.options.direction == "function" ? this.options.direction.call(this, e, n, c) : this.options.direction;
4657
4737
  },
4658
- _onTapStart: function _onTapStart(evt) {
4659
- if (!evt.cancelable) return;
4660
- var _this = this, el = this.el, options = this.options, preventOnFilter = options.preventOnFilter, type = evt.type, touch = evt.touches && evt.touches[0] || evt.pointerType && evt.pointerType === "touch" && evt, target = (touch || evt).target, originalTarget = evt.target.shadowRoot && (evt.path && evt.path[0] || evt.composedPath && evt.composedPath()[0]) || target, filter = options.filter;
4661
- _saveInputCheckedState(el);
4662
- if (dragEl) return;
4663
- if (/mousedown|pointerdown/.test(type) && evt.button !== 0 || options.disabled) return;
4664
- if (originalTarget.isContentEditable) return;
4665
- if (!this.nativeDraggable && Safari && target && target.tagName.toUpperCase() === "SELECT") return;
4666
- target = closest(target, options.draggable, el, false);
4667
- if (target && target.animated) return;
4668
- if (lastDownEl === target) return;
4669
- oldIndex = index(target);
4670
- oldDraggableIndex = index(target, options.draggable);
4671
- if (typeof filter === "function") {
4672
- if (filter.call(this, evt, target, this)) {
4673
- _dispatchEvent({
4674
- sortable: _this,
4675
- rootEl: originalTarget,
4676
- name: "filter",
4677
- targetEl: target,
4678
- toEl: el,
4679
- fromEl: el
4680
- });
4681
- pluginEvent("filter", _this, { evt });
4682
- preventOnFilter && evt.preventDefault();
4683
- return;
4684
- }
4685
- } else if (filter) {
4686
- filter = filter.split(",").some(function(criteria) {
4687
- criteria = closest(originalTarget, criteria.trim(), el, false);
4688
- if (criteria) {
4689
- _dispatchEvent({
4690
- sortable: _this,
4691
- rootEl: criteria,
4738
+ _onTapStart: function(e) {
4739
+ if (e.cancelable) {
4740
+ 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;
4741
+ if (Zn(o), !c && !(/mousedown|pointerdown/.test(a) && e.button !== 0 || r.disabled) && !u.isContentEditable && !(!this.nativeDraggable && Te && s && s.tagName.toUpperCase() === "SELECT") && (s = Q(s, r.draggable, o, !1), !(s && s.animated) && Be !== s)) {
4742
+ if (be = J(s), Oe = J(s, r.draggable), typeof d == "function") {
4743
+ if (d.call(this, e, s, this)) {
4744
+ W({
4745
+ sortable: n,
4746
+ rootEl: u,
4747
+ name: "filter",
4748
+ targetEl: s,
4749
+ toEl: o,
4750
+ fromEl: o
4751
+ }), z("filter", n, { evt: e }), i && e.cancelable && e.preventDefault();
4752
+ return;
4753
+ }
4754
+ } else if (d && (d = d.split(",").some(function(f) {
4755
+ if (f = Q(u, f.trim(), o, !1), f) return W({
4756
+ sortable: n,
4757
+ rootEl: f,
4692
4758
  name: "filter",
4693
- targetEl: target,
4694
- fromEl: el,
4695
- toEl: el
4696
- });
4697
- pluginEvent("filter", _this, { evt });
4698
- return true;
4759
+ targetEl: s,
4760
+ fromEl: o,
4761
+ toEl: o
4762
+ }), z("filter", n, { evt: e }), !0;
4763
+ }), d)) {
4764
+ i && e.cancelable && e.preventDefault();
4765
+ return;
4699
4766
  }
4700
- });
4701
- if (filter) {
4702
- preventOnFilter && evt.preventDefault();
4703
- return;
4767
+ r.handle && !Q(u, r.handle, o, !1) || this._prepareDragStart(e, l, s);
4704
4768
  }
4705
4769
  }
4706
- if (options.handle && !closest(originalTarget, options.handle, el, false)) return;
4707
- this._prepareDragStart(evt, touch, target);
4708
4770
  },
4709
- _prepareDragStart: function _prepareDragStart(evt, touch, target) {
4710
- var _this = this, el = _this.el, options = _this.options, ownerDocument = el.ownerDocument, dragStartFn;
4711
- if (target && !dragEl && target.parentNode === el) {
4712
- var dragRect = getRect(target);
4713
- rootEl = el;
4714
- dragEl = target;
4715
- parentEl = dragEl.parentNode;
4716
- nextEl = dragEl.nextSibling;
4717
- lastDownEl = target;
4718
- activeGroup = options.group;
4719
- Sortable.dragged = dragEl;
4720
- tapEvt = {
4721
- target: dragEl,
4722
- clientX: (touch || evt).clientX,
4723
- clientY: (touch || evt).clientY
4724
- };
4725
- tapDistanceLeft = tapEvt.clientX - dragRect.left;
4726
- tapDistanceTop = tapEvt.clientY - dragRect.top;
4727
- this._lastX = (touch || evt).clientX;
4728
- this._lastY = (touch || evt).clientY;
4729
- dragEl.style["will-change"] = "all";
4730
- dragStartFn = function dragStartFn() {
4731
- pluginEvent("delayEnded", _this, { evt });
4732
- if (Sortable.eventCanceled) {
4733
- _this._onDrop();
4771
+ _prepareDragStart: function(e, n, o) {
4772
+ var r = this, i = r.el, a = r.options, l = i.ownerDocument, s;
4773
+ if (o && !c && o.parentNode === i) {
4774
+ var u = P(o);
4775
+ if (T = i, c = o, O = c.parentNode, pe = c.nextSibling, Be = o, Me = a.group, p.dragged = c, de = {
4776
+ target: c,
4777
+ clientX: (n || e).clientX,
4778
+ clientY: (n || e).clientY
4779
+ }, Pt = de.clientX - u.left, Mt = de.clientY - u.top, this._lastX = (n || e).clientX, this._lastY = (n || e).clientY, c.style["will-change"] = "all", s = function() {
4780
+ if (z("delayEnded", r, { evt: e }), p.eventCanceled) {
4781
+ r._onDrop();
4734
4782
  return;
4735
4783
  }
4736
- _this._disableDelayedDragEvents();
4737
- if (!FireFox && _this.nativeDraggable) dragEl.draggable = true;
4738
- _this._triggerDragStart(evt, touch);
4739
- _dispatchEvent({
4740
- sortable: _this,
4784
+ r._disableDelayedDragEvents(), !It && r.nativeDraggable && (c.draggable = !0), r._triggerDragStart(e, n), W({
4785
+ sortable: r,
4741
4786
  name: "choose",
4742
- originalEvent: evt
4743
- });
4744
- toggleClass(dragEl, options.chosenClass, true);
4745
- };
4746
- options.ignore.split(",").forEach(function(criteria) {
4747
- find(dragEl, criteria.trim(), _disableDraggable);
4748
- });
4749
- on(ownerDocument, "dragover", nearestEmptyInsertDetectEvent);
4750
- on(ownerDocument, "mousemove", nearestEmptyInsertDetectEvent);
4751
- on(ownerDocument, "touchmove", nearestEmptyInsertDetectEvent);
4752
- if (options.supportPointer) {
4753
- on(ownerDocument, "pointerup", _this._onDrop);
4754
- !this.nativeDraggable && on(ownerDocument, "pointercancel", _this._onDrop);
4755
- } else {
4756
- on(ownerDocument, "mouseup", _this._onDrop);
4757
- on(ownerDocument, "touchend", _this._onDrop);
4758
- on(ownerDocument, "touchcancel", _this._onDrop);
4759
- }
4760
- if (FireFox && this.nativeDraggable) {
4761
- this.options.touchStartThreshold = 4;
4762
- dragEl.draggable = true;
4763
- }
4764
- pluginEvent("delayStart", this, { evt });
4765
- if (options.delay && (!options.delayOnTouchOnly || touch) && (!this.nativeDraggable || !(Edge || IE11OrLess))) {
4766
- if (Sortable.eventCanceled) {
4787
+ originalEvent: e
4788
+ }), V(c, a.chosenClass, !0);
4789
+ }, a.ignore.split(",").forEach(function(d) {
4790
+ jt(c, d.trim(), nt);
4791
+ }), S(l, "dragover", he), S(l, "mousemove", he), S(l, "touchmove", he), S(l, "mouseup", r._onDrop), S(l, "touchend", r._onDrop), S(l, "touchcancel", r._onDrop), It && this.nativeDraggable && (this.options.touchStartThreshold = 4, c.draggable = !0), z("delayStart", this, { evt: e }), a.delay && (!a.delayOnTouchOnly || n) && (!this.nativeDraggable || !(xe || ae))) {
4792
+ if (p.eventCanceled) {
4767
4793
  this._onDrop();
4768
4794
  return;
4769
4795
  }
4770
- if (options.supportPointer) {
4771
- on(ownerDocument, "pointerup", _this._disableDelayedDrag);
4772
- on(ownerDocument, "pointercancel", _this._disableDelayedDrag);
4773
- } else {
4774
- on(ownerDocument, "mouseup", _this._disableDelayedDrag);
4775
- on(ownerDocument, "touchend", _this._disableDelayedDrag);
4776
- on(ownerDocument, "touchcancel", _this._disableDelayedDrag);
4777
- }
4778
- on(ownerDocument, "mousemove", _this._delayedDragTouchMoveHandler);
4779
- on(ownerDocument, "touchmove", _this._delayedDragTouchMoveHandler);
4780
- options.supportPointer && on(ownerDocument, "pointermove", _this._delayedDragTouchMoveHandler);
4781
- _this._dragStartTimer = setTimeout(dragStartFn, options.delay);
4782
- } else dragStartFn();
4796
+ S(l, "mouseup", r._disableDelayedDrag), S(l, "touchend", r._disableDelayedDrag), S(l, "touchcancel", r._disableDelayedDrag), S(l, "mousemove", r._delayedDragTouchMoveHandler), S(l, "touchmove", r._delayedDragTouchMoveHandler), a.supportPointer && S(l, "pointermove", r._delayedDragTouchMoveHandler), r._dragStartTimer = setTimeout(s, a.delay);
4797
+ } else s();
4783
4798
  }
4784
4799
  },
4785
- _delayedDragTouchMoveHandler: function _delayedDragTouchMoveHandler(e) {
4786
- var touch = e.touches ? e.touches[0] : e;
4787
- if (Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) >= Math.floor(this.options.touchStartThreshold / (this.nativeDraggable && window.devicePixelRatio || 1))) this._disableDelayedDrag();
4800
+ _delayedDragTouchMoveHandler: function(e) {
4801
+ var n = e.touches ? e.touches[0] : e;
4802
+ 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();
4788
4803
  },
4789
- _disableDelayedDrag: function _disableDelayedDrag() {
4790
- dragEl && _disableDraggable(dragEl);
4791
- clearTimeout(this._dragStartTimer);
4792
- this._disableDelayedDragEvents();
4804
+ _disableDelayedDrag: function() {
4805
+ c && nt(c), clearTimeout(this._dragStartTimer), this._disableDelayedDragEvents();
4793
4806
  },
4794
- _disableDelayedDragEvents: function _disableDelayedDragEvents() {
4795
- var ownerDocument = this.el.ownerDocument;
4796
- off(ownerDocument, "mouseup", this._disableDelayedDrag);
4797
- off(ownerDocument, "touchend", this._disableDelayedDrag);
4798
- off(ownerDocument, "touchcancel", this._disableDelayedDrag);
4799
- off(ownerDocument, "pointerup", this._disableDelayedDrag);
4800
- off(ownerDocument, "pointercancel", this._disableDelayedDrag);
4801
- off(ownerDocument, "mousemove", this._delayedDragTouchMoveHandler);
4802
- off(ownerDocument, "touchmove", this._delayedDragTouchMoveHandler);
4803
- off(ownerDocument, "pointermove", this._delayedDragTouchMoveHandler);
4807
+ _disableDelayedDragEvents: function() {
4808
+ var e = this.el.ownerDocument;
4809
+ E(e, "mouseup", this._disableDelayedDrag), E(e, "touchend", this._disableDelayedDrag), E(e, "touchcancel", this._disableDelayedDrag), E(e, "mousemove", this._delayedDragTouchMoveHandler), E(e, "touchmove", this._delayedDragTouchMoveHandler), E(e, "pointermove", this._delayedDragTouchMoveHandler);
4804
4810
  },
4805
- _triggerDragStart: function _triggerDragStart(evt, touch) {
4806
- touch = touch || evt.pointerType == "touch" && evt;
4807
- if (!this.nativeDraggable || touch) if (this.options.supportPointer) on(document, "pointermove", this._onTouchMove);
4808
- else if (touch) on(document, "touchmove", this._onTouchMove);
4809
- else on(document, "mousemove", this._onTouchMove);
4810
- else {
4811
- on(dragEl, "dragend", this);
4812
- on(rootEl, "dragstart", this._onDragStart);
4813
- }
4811
+ _triggerDragStart: function(e, n) {
4812
+ n = n || e.pointerType == "touch" && e, !this.nativeDraggable || n ? this.options.supportPointer ? S(document, "pointermove", this._onTouchMove) : n ? S(document, "touchmove", this._onTouchMove) : S(document, "mousemove", this._onTouchMove) : (S(c, "dragend", this), S(T, "dragstart", this._onDragStart));
4814
4813
  try {
4815
- if (document.selection) _nextTick(function() {
4814
+ document.selection ? He(function() {
4816
4815
  document.selection.empty();
4817
- });
4818
- else window.getSelection().removeAllRanges();
4819
- } catch (err) {}
4816
+ }) : window.getSelection().removeAllRanges();
4817
+ } catch (o) {}
4820
4818
  },
4821
- _dragStarted: function _dragStarted(fallback, evt) {
4822
- awaitingDragStarted = false;
4823
- if (rootEl && dragEl) {
4824
- pluginEvent("dragStarted", this, { evt });
4825
- if (this.nativeDraggable) on(document, "dragover", _checkOutsideTargetEl);
4826
- var options = this.options;
4827
- !fallback && toggleClass(dragEl, options.dragClass, false);
4828
- toggleClass(dragEl, options.ghostClass, true);
4829
- Sortable.active = this;
4830
- fallback && this._appendGhost();
4831
- _dispatchEvent({
4819
+ _dragStarted: function(e, n) {
4820
+ if (ve = !1, T && c) {
4821
+ z("dragStarted", this, { evt: n }), this.nativeDraggable && S(document, "dragover", jn);
4822
+ var o = this.options;
4823
+ !e && V(c, o.dragClass, !1), V(c, o.ghostClass, !0), p.active = this, e && this._appendGhost(), W({
4832
4824
  sortable: this,
4833
4825
  name: "start",
4834
- originalEvent: evt
4826
+ originalEvent: n
4835
4827
  });
4836
4828
  } else this._nulling();
4837
4829
  },
4838
- _emulateDragOver: function _emulateDragOver() {
4839
- if (touchEvt) {
4840
- this._lastX = touchEvt.clientX;
4841
- this._lastY = touchEvt.clientY;
4842
- _hideGhostForTarget();
4843
- var target = document.elementFromPoint(touchEvt.clientX, touchEvt.clientY);
4844
- var parent = target;
4845
- while (target && target.shadowRoot) {
4846
- target = target.shadowRoot.elementFromPoint(touchEvt.clientX, touchEvt.clientY);
4847
- if (target === parent) break;
4848
- parent = target;
4849
- }
4850
- dragEl.parentNode[expando]._isOutsideThisEl(target);
4851
- if (parent) do {
4852
- if (parent[expando]) {
4853
- var inserted = void 0;
4854
- inserted = parent[expando]._onDragOver({
4855
- clientX: touchEvt.clientX,
4856
- clientY: touchEvt.clientY,
4857
- target,
4858
- rootEl: parent
4859
- });
4860
- if (inserted && !this.options.dragoverBubble) break;
4830
+ _emulateDragOver: function() {
4831
+ if (Z) {
4832
+ this._lastX = Z.clientX, this._lastY = Z.clientY, Zt();
4833
+ for (var e = document.elementFromPoint(Z.clientX, Z.clientY), n = e; e && e.shadowRoot && (e = e.shadowRoot.elementFromPoint(Z.clientX, Z.clientY), e !== n);) n = e;
4834
+ if (c.parentNode[q]._isOutsideThisEl(e), n) do {
4835
+ if (n[q]) {
4836
+ var o = void 0;
4837
+ if (o = n[q]._onDragOver({
4838
+ clientX: Z.clientX,
4839
+ clientY: Z.clientY,
4840
+ target: e,
4841
+ rootEl: n
4842
+ }), o && !this.options.dragoverBubble) break;
4861
4843
  }
4862
- target = parent;
4863
- } while (parent = getParentOrHost(parent));
4864
- _unhideGhostForTarget();
4844
+ e = n;
4845
+ } while (n = n.parentNode);
4846
+ Qt();
4865
4847
  }
4866
4848
  },
4867
- _onTouchMove: function _onTouchMove(evt) {
4868
- if (tapEvt) {
4869
- var options = this.options, fallbackTolerance = options.fallbackTolerance, fallbackOffset = options.fallbackOffset, touch = evt.touches ? evt.touches[0] : evt, ghostMatrix = ghostEl && matrix(ghostEl, true), scaleX = ghostEl && ghostMatrix && ghostMatrix.a, scaleY = ghostEl && ghostMatrix && ghostMatrix.d, relativeScrollOffset = PositionGhostAbsolutely && ghostRelativeParent && getRelativeScrollOffset(ghostRelativeParent), dx = (touch.clientX - tapEvt.clientX + fallbackOffset.x) / (scaleX || 1) + (relativeScrollOffset ? relativeScrollOffset[0] - ghostRelativeParentInitialScroll[0] : 0) / (scaleX || 1), dy = (touch.clientY - tapEvt.clientY + fallbackOffset.y) / (scaleY || 1) + (relativeScrollOffset ? relativeScrollOffset[1] - ghostRelativeParentInitialScroll[1] : 0) / (scaleY || 1);
4870
- if (!Sortable.active && !awaitingDragStarted) {
4871
- if (fallbackTolerance && Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) < fallbackTolerance) return;
4872
- this._onDragStart(evt, true);
4849
+ _onTouchMove: function(e) {
4850
+ if (de) {
4851
+ var n = this.options, o = n.fallbackTolerance, r = n.fallbackOffset, i = e.touches ? e.touches[0] : e, a = g && ye(g, !0), l = g && a && a.a, s = g && a && a.d, u = Re && H && Nt(H), d = (i.clientX - de.clientX + r.x) / (l || 1) + (u ? u[0] - tt[0] : 0) / (l || 1), f = (i.clientY - de.clientY + r.y) / (s || 1) + (u ? u[1] - tt[1] : 0) / (s || 1);
4852
+ if (!p.active && !ve) {
4853
+ if (o && Math.max(Math.abs(i.clientX - this._lastX), Math.abs(i.clientY - this._lastY)) < o) return;
4854
+ this._onDragStart(e, !0);
4873
4855
  }
4874
- if (ghostEl) {
4875
- if (ghostMatrix) {
4876
- ghostMatrix.e += dx - (lastDx || 0);
4877
- ghostMatrix.f += dy - (lastDy || 0);
4878
- } else ghostMatrix = {
4856
+ if (g) {
4857
+ a ? (a.e += d - (Qe || 0), a.f += f - (et || 0)) : a = {
4879
4858
  a: 1,
4880
4859
  b: 0,
4881
4860
  c: 0,
4882
4861
  d: 1,
4883
- e: dx,
4884
- f: dy
4862
+ e: d,
4863
+ f
4885
4864
  };
4886
- var cssMatrix = "matrix(".concat(ghostMatrix.a, ",").concat(ghostMatrix.b, ",").concat(ghostMatrix.c, ",").concat(ghostMatrix.d, ",").concat(ghostMatrix.e, ",").concat(ghostMatrix.f, ")");
4887
- css(ghostEl, "webkitTransform", cssMatrix);
4888
- css(ghostEl, "mozTransform", cssMatrix);
4889
- css(ghostEl, "msTransform", cssMatrix);
4890
- css(ghostEl, "transform", cssMatrix);
4891
- lastDx = dx;
4892
- lastDy = dy;
4893
- touchEvt = touch;
4865
+ var m = "matrix(".concat(a.a, ",").concat(a.b, ",").concat(a.c, ",").concat(a.d, ",").concat(a.e, ",").concat(a.f, ")");
4866
+ h(g, "webkitTransform", m), h(g, "mozTransform", m), h(g, "msTransform", m), h(g, "transform", m), Qe = d, et = f, Z = i;
4894
4867
  }
4895
- evt.cancelable && evt.preventDefault();
4868
+ e.cancelable && e.preventDefault();
4896
4869
  }
4897
4870
  },
4898
- _appendGhost: function _appendGhost() {
4899
- if (!ghostEl) {
4900
- var container = this.options.fallbackOnBody ? document.body : rootEl, rect = getRect(dragEl, true, PositionGhostAbsolutely, true, container), options = this.options;
4901
- if (PositionGhostAbsolutely) {
4902
- ghostRelativeParent = container;
4903
- while (css(ghostRelativeParent, "position") === "static" && css(ghostRelativeParent, "transform") === "none" && ghostRelativeParent !== document) ghostRelativeParent = ghostRelativeParent.parentNode;
4904
- if (ghostRelativeParent !== document.body && ghostRelativeParent !== document.documentElement) {
4905
- if (ghostRelativeParent === document) ghostRelativeParent = getWindowScrollingElement();
4906
- rect.top += ghostRelativeParent.scrollTop;
4907
- rect.left += ghostRelativeParent.scrollLeft;
4908
- } else ghostRelativeParent = getWindowScrollingElement();
4909
- ghostRelativeParentInitialScroll = getRelativeScrollOffset(ghostRelativeParent);
4871
+ _appendGhost: function() {
4872
+ if (!g) {
4873
+ var e = this.options.fallbackOnBody ? document.body : T, n = P(c, !0, Re, !0, e), o = this.options;
4874
+ if (Re) {
4875
+ for (H = e; h(H, "position") === "static" && h(H, "transform") === "none" && H !== document;) H = H.parentNode;
4876
+ H !== document.body && H !== document.documentElement ? (H === document && (H = te()), n.top += H.scrollTop, n.left += H.scrollLeft) : H = te(), tt = Nt(H);
4910
4877
  }
4911
- ghostEl = dragEl.cloneNode(true);
4912
- toggleClass(ghostEl, options.ghostClass, false);
4913
- toggleClass(ghostEl, options.fallbackClass, true);
4914
- toggleClass(ghostEl, options.dragClass, true);
4915
- css(ghostEl, "transition", "");
4916
- css(ghostEl, "transform", "");
4917
- css(ghostEl, "box-sizing", "border-box");
4918
- css(ghostEl, "margin", 0);
4919
- css(ghostEl, "top", rect.top);
4920
- css(ghostEl, "left", rect.left);
4921
- css(ghostEl, "width", rect.width);
4922
- css(ghostEl, "height", rect.height);
4923
- css(ghostEl, "opacity", "0.8");
4924
- css(ghostEl, "position", PositionGhostAbsolutely ? "absolute" : "fixed");
4925
- css(ghostEl, "zIndex", "100000");
4926
- css(ghostEl, "pointerEvents", "none");
4927
- Sortable.ghost = ghostEl;
4928
- container.appendChild(ghostEl);
4929
- css(ghostEl, "transform-origin", tapDistanceLeft / parseInt(ghostEl.style.width) * 100 + "% " + tapDistanceTop / parseInt(ghostEl.style.height) * 100 + "%");
4878
+ g = c.cloneNode(!0), V(g, o.ghostClass, !1), V(g, o.fallbackClass, !0), V(g, o.dragClass, !0), h(g, "transition", ""), h(g, "transform", ""), h(g, "box-sizing", "border-box"), h(g, "margin", 0), h(g, "top", n.top), h(g, "left", n.left), h(g, "width", n.width), h(g, "height", n.height), h(g, "opacity", "0.8"), h(g, "position", Re ? "absolute" : "fixed"), h(g, "zIndex", "100000"), h(g, "pointerEvents", "none"), p.ghost = g, e.appendChild(g), h(g, "transform-origin", Pt / parseInt(g.style.width) * 100 + "% " + Mt / parseInt(g.style.height) * 100 + "%");
4930
4879
  }
4931
4880
  },
4932
- _onDragStart: function _onDragStart(evt, fallback) {
4933
- var _this = this;
4934
- var dataTransfer = evt.dataTransfer;
4935
- var options = _this.options;
4936
- pluginEvent("dragStart", this, { evt });
4937
- if (Sortable.eventCanceled) {
4881
+ _onDragStart: function(e, n) {
4882
+ var o = this, r = e.dataTransfer, i = o.options;
4883
+ if (z("dragStart", this, { evt: e }), p.eventCanceled) {
4938
4884
  this._onDrop();
4939
4885
  return;
4940
4886
  }
4941
- pluginEvent("setupClone", this);
4942
- if (!Sortable.eventCanceled) {
4943
- cloneEl = clone(dragEl);
4944
- cloneEl.removeAttribute("id");
4945
- cloneEl.draggable = false;
4946
- cloneEl.style["will-change"] = "";
4947
- this._hideClone();
4948
- toggleClass(cloneEl, this.options.chosenClass, false);
4949
- Sortable.clone = cloneEl;
4950
- }
4951
- _this.cloneId = _nextTick(function() {
4952
- pluginEvent("clone", _this);
4953
- if (Sortable.eventCanceled) return;
4954
- if (!_this.options.removeCloneOnHide) rootEl.insertBefore(cloneEl, dragEl);
4955
- _this._hideClone();
4956
- _dispatchEvent({
4957
- sortable: _this,
4887
+ z("setupClone", this), p.eventCanceled || (C = Vt(c), C.removeAttribute("id"), C.draggable = !1, C.style["will-change"] = "", this._hideClone(), V(C, this.options.chosenClass, !1), p.clone = C), o.cloneId = He(function() {
4888
+ z("clone", o), !p.eventCanceled && (o.options.removeCloneOnHide || T.insertBefore(C, c), o._hideClone(), W({
4889
+ sortable: o,
4958
4890
  name: "clone"
4959
- });
4960
- });
4961
- !fallback && toggleClass(dragEl, options.dragClass, true);
4962
- if (fallback) {
4963
- ignoreNextClick = true;
4964
- _this._loopId = setInterval(_this._emulateDragOver, 50);
4965
- } else {
4966
- off(document, "mouseup", _this._onDrop);
4967
- off(document, "touchend", _this._onDrop);
4968
- off(document, "touchcancel", _this._onDrop);
4969
- if (dataTransfer) {
4970
- dataTransfer.effectAllowed = "move";
4971
- options.setData && options.setData.call(_this, dataTransfer, dragEl);
4972
- }
4973
- on(document, "drop", _this);
4974
- css(dragEl, "transform", "translateZ(0)");
4975
- }
4976
- awaitingDragStarted = true;
4977
- _this._dragStartId = _nextTick(_this._dragStarted.bind(_this, fallback, evt));
4978
- on(document, "selectstart", _this);
4979
- moved = true;
4980
- window.getSelection().removeAllRanges();
4981
- if (Safari) css(document.body, "user-select", "none");
4891
+ }));
4892
+ }), !n && V(c, i.dragClass, !0), n ? (Ge = !0, o._loopId = setInterval(o._emulateDragOver, 50)) : (E(document, "mouseup", o._onDrop), E(document, "touchend", o._onDrop), E(document, "touchcancel", o._onDrop), r && (r.effectAllowed = "move", i.setData && i.setData.call(o, r, c)), S(document, "drop", o), h(c, "transform", "translateZ(0)")), ve = !0, o._dragStartId = He(o._dragStarted.bind(o, n, e)), S(document, "selectstart", o), Se = !0, Te && h(document.body, "user-select", "none");
4982
4893
  },
4983
- _onDragOver: function _onDragOver(evt) {
4984
- var el = this.el, target = evt.target, dragRect, targetRect, revert, options = this.options, group = options.group, activeSortable = Sortable.active, isOwner = activeGroup === group, canSort = options.sort, fromSortable = putSortable || activeSortable, vertical, _this = this, completedFired = false;
4985
- if (_silent) return;
4986
- function dragOverEvent(name, extra) {
4987
- pluginEvent(name, _this, _objectSpread2({
4988
- evt,
4989
- isOwner,
4990
- axis: vertical ? "vertical" : "horizontal",
4991
- revert,
4992
- dragRect,
4993
- targetRect,
4994
- canSort,
4995
- fromSortable,
4996
- target,
4997
- completed,
4998
- onMove: function onMove(target, after) {
4999
- return _onMove(rootEl, el, dragEl, dragRect, target, getRect(target), evt, after);
4894
+ _onDragOver: function(e) {
4895
+ var n = this.el, o = e.target, r, i, a, l = this.options, s = l.group, u = p.active, d = Me === s, f = l.sort, m = Y || u, y, b = this, w = !1;
4896
+ if (lt) return;
4897
+ function L(ee, Ee) {
4898
+ z(ee, b, ne({
4899
+ evt: e,
4900
+ isOwner: d,
4901
+ axis: y ? "vertical" : "horizontal",
4902
+ revert: a,
4903
+ dragRect: r,
4904
+ targetRect: i,
4905
+ canSort: f,
4906
+ fromSortable: m,
4907
+ target: o,
4908
+ completed: R,
4909
+ onMove: function(vt, rn) {
4910
+ return Xe(T, n, c, r, vt, P(vt), e, rn);
5000
4911
  },
5001
- changed
5002
- }, extra));
4912
+ changed: j
4913
+ }, Ee));
5003
4914
  }
5004
- function capture() {
5005
- dragOverEvent("dragOverAnimationCapture");
5006
- _this.captureAnimationState();
5007
- if (_this !== fromSortable) fromSortable.captureAnimationState();
4915
+ function G() {
4916
+ L("dragOverAnimationCapture"), b.captureAnimationState(), b !== m && m.captureAnimationState();
5008
4917
  }
5009
- function completed(insertion) {
5010
- dragOverEvent("dragOverCompleted", { insertion });
5011
- if (insertion) {
5012
- if (isOwner) activeSortable._hideClone();
5013
- else activeSortable._showClone(_this);
5014
- if (_this !== fromSortable) {
5015
- toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : activeSortable.options.ghostClass, false);
5016
- toggleClass(dragEl, options.ghostClass, true);
5017
- }
5018
- if (putSortable !== _this && _this !== Sortable.active) putSortable = _this;
5019
- else if (_this === Sortable.active && putSortable) putSortable = null;
5020
- if (fromSortable === _this) _this._ignoreWhileAnimating = target;
5021
- _this.animateAll(function() {
5022
- dragOverEvent("dragOverAnimationComplete");
5023
- _this._ignoreWhileAnimating = null;
5024
- });
5025
- if (_this !== fromSortable) {
5026
- fromSortable.animateAll();
5027
- fromSortable._ignoreWhileAnimating = null;
5028
- }
5029
- }
5030
- if (target === dragEl && !dragEl.animated || target === el && !target.animated) lastTarget = null;
5031
- if (!options.dragoverBubble && !evt.rootEl && target !== document) {
5032
- dragEl.parentNode[expando]._isOutsideThisEl(evt.target);
5033
- !insertion && nearestEmptyInsertDetectEvent(evt);
5034
- }
5035
- !options.dragoverBubble && evt.stopPropagation && evt.stopPropagation();
5036
- return completedFired = true;
4918
+ function R(ee) {
4919
+ return L("dragOverCompleted", { insertion: ee }), ee && (d ? u._hideClone() : u._showClone(b), b !== m && (V(c, Y ? Y.options.ghostClass : u.options.ghostClass, !1), V(c, l.ghostClass, !0)), Y !== b && b !== p.active ? Y = b : b === p.active && Y && (Y = null), m === b && (b._ignoreWhileAnimating = o), b.animateAll(function() {
4920
+ L("dragOverAnimationComplete"), b._ignoreWhileAnimating = null;
4921
+ }), b !== m && (m.animateAll(), m._ignoreWhileAnimating = null)), (o === c && !c.animated || o === n && !o.animated) && (me = null), !l.dragoverBubble && !e.rootEl && o !== document && (c.parentNode[q]._isOutsideThisEl(e.target), !ee && he(e)), !l.dragoverBubble && e.stopPropagation && e.stopPropagation(), w = !0;
5037
4922
  }
5038
- function changed() {
5039
- newIndex = index(dragEl);
5040
- newDraggableIndex = index(dragEl, options.draggable);
5041
- _dispatchEvent({
5042
- sortable: _this,
4923
+ function j() {
4924
+ $ = J(c), se = J(c, l.draggable), W({
4925
+ sortable: b,
5043
4926
  name: "change",
5044
- toEl: el,
5045
- newIndex,
5046
- newDraggableIndex,
5047
- originalEvent: evt
4927
+ toEl: n,
4928
+ newIndex: $,
4929
+ newDraggableIndex: se,
4930
+ originalEvent: e
5048
4931
  });
5049
4932
  }
5050
- if (evt.preventDefault !== void 0) evt.cancelable && evt.preventDefault();
5051
- target = closest(target, options.draggable, el, true);
5052
- dragOverEvent("dragOver");
5053
- if (Sortable.eventCanceled) return completedFired;
5054
- if (dragEl.contains(evt.target) || target.animated && target.animatingX && target.animatingY || _this._ignoreWhileAnimating === target) return completed(false);
5055
- ignoreNextClick = false;
5056
- if (activeSortable && !options.disabled && (isOwner ? canSort || (revert = parentEl !== rootEl) : putSortable === this || (this.lastPutMode = activeGroup.checkPull(this, activeSortable, dragEl, evt)) && group.checkPut(this, activeSortable, dragEl, evt))) {
5057
- vertical = this._getDirection(evt, target) === "vertical";
5058
- dragRect = getRect(dragEl);
5059
- dragOverEvent("dragOverValid");
5060
- if (Sortable.eventCanceled) return completedFired;
5061
- if (revert) {
5062
- parentEl = rootEl;
5063
- capture();
5064
- this._hideClone();
5065
- dragOverEvent("revert");
5066
- if (!Sortable.eventCanceled) if (nextEl) rootEl.insertBefore(dragEl, nextEl);
5067
- else rootEl.appendChild(dragEl);
5068
- return completed(true);
5069
- }
5070
- var elLastChild = lastChild(el, options.draggable);
5071
- if (!elLastChild || _ghostIsLast(evt, vertical, this) && !elLastChild.animated) {
5072
- if (elLastChild === dragEl) return completed(false);
5073
- if (elLastChild && el === evt.target) target = elLastChild;
5074
- if (target) targetRect = getRect(target);
5075
- if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, !!target) !== false) {
5076
- capture();
5077
- if (elLastChild && elLastChild.nextSibling) el.insertBefore(dragEl, elLastChild.nextSibling);
5078
- else el.appendChild(dragEl);
5079
- parentEl = el;
5080
- changed();
5081
- return completed(true);
5082
- }
5083
- } else if (elLastChild && _ghostIsFirst(evt, vertical, this)) {
5084
- var firstChild = getChild(el, 0, options, true);
5085
- if (firstChild === dragEl) return completed(false);
5086
- target = firstChild;
5087
- targetRect = getRect(target);
5088
- if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, false) !== false) {
5089
- capture();
5090
- el.insertBefore(dragEl, firstChild);
5091
- parentEl = el;
5092
- changed();
5093
- return completed(true);
5094
- }
5095
- } else if (target.parentNode === el) {
5096
- targetRect = getRect(target);
5097
- var direction = 0, targetBeforeFirstSwap, differentLevel = dragEl.parentNode !== el, differentRowCol = !_dragElInRowColumn(dragEl.animated && dragEl.toRect || dragRect, target.animated && target.toRect || targetRect, vertical), side1 = vertical ? "top" : "left", scrolledPastTop = isScrolledPast(target, "top", "top") || isScrolledPast(dragEl, "top", "top"), scrollBefore = scrolledPastTop ? scrolledPastTop.scrollTop : void 0;
5098
- if (lastTarget !== target) {
5099
- targetBeforeFirstSwap = targetRect[side1];
5100
- pastFirstInvertThresh = false;
5101
- isCircumstantialInvert = !differentRowCol && options.invertSwap || differentLevel;
5102
- }
5103
- direction = _getSwapDirection(evt, target, targetRect, vertical, differentRowCol ? 1 : options.swapThreshold, options.invertedSwapThreshold == null ? options.swapThreshold : options.invertedSwapThreshold, isCircumstantialInvert, lastTarget === target);
5104
- var sibling;
5105
- if (direction !== 0) {
5106
- var dragIndex = index(dragEl);
5107
- do {
5108
- dragIndex -= direction;
5109
- sibling = parentEl.children[dragIndex];
5110
- } while (sibling && (css(sibling, "display") === "none" || sibling === ghostEl));
5111
- }
5112
- if (direction === 0 || sibling === target) return completed(false);
5113
- lastTarget = target;
5114
- lastDirection = direction;
5115
- var nextSibling = target.nextElementSibling, after = false;
5116
- after = direction === 1;
5117
- var moveVector = _onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, after);
5118
- if (moveVector !== false) {
5119
- if (moveVector === 1 || moveVector === -1) after = moveVector === 1;
5120
- _silent = true;
5121
- setTimeout(_unsilent, 30);
5122
- capture();
5123
- if (after && !nextSibling) el.appendChild(dragEl);
5124
- else target.parentNode.insertBefore(dragEl, after ? nextSibling : target);
5125
- if (scrolledPastTop) scrollBy(scrolledPastTop, 0, scrollBefore - scrolledPastTop.scrollTop);
5126
- parentEl = dragEl.parentNode;
5127
- if (targetBeforeFirstSwap !== void 0 && !isCircumstantialInvert) targetMoveDistance = Math.abs(targetBeforeFirstSwap - getRect(target)[side1]);
5128
- changed();
5129
- return completed(true);
4933
+ if (e.preventDefault !== void 0 && e.cancelable && e.preventDefault(), o = Q(o, l.draggable, n, !0), L("dragOver"), p.eventCanceled) return w;
4934
+ if (c.contains(e.target) || o.animated && o.animatingX && o.animatingY || b._ignoreWhileAnimating === o) return R(!1);
4935
+ if (Ge = !1, u && !l.disabled && (d ? f || (a = O !== T) : Y === this || (this.lastPutMode = Me.checkPull(this, u, c, e)) && s.checkPut(this, u, c, e))) {
4936
+ if (y = this._getDirection(e, o) === "vertical", r = P(c), L("dragOverValid"), p.eventCanceled) return w;
4937
+ if (a) return O = T, G(), this._hideClone(), L("revert"), p.eventCanceled || (pe ? T.insertBefore(c, pe) : T.appendChild(c)), R(!0);
4938
+ var B = ht(n, l.draggable);
4939
+ if (!B || $n(e, y, this) && !B.animated) {
4940
+ if (B === c) return R(!1);
4941
+ if (B && n === e.target && (o = B), o && (i = P(o)), Xe(T, n, c, r, o, i, e, !!o) !== !1) return G(), B && B.nextSibling ? n.insertBefore(c, B.nextSibling) : n.appendChild(c), O = n, j(), R(!0);
4942
+ } else if (B && Vn(e, y, this)) {
4943
+ var X = we(n, 0, l, !0);
4944
+ if (X === c) return R(!1);
4945
+ if (o = X, i = P(o), Xe(T, n, c, r, o, i, e, !1) !== !1) return G(), n.insertBefore(c, X), O = n, j(), R(!0);
4946
+ } else if (o.parentNode === n) {
4947
+ i = P(o);
4948
+ var K = 0, oe, le = c.parentNode !== n, k = !Wn(c.animated && c.toRect || r, o.animated && o.toRect || i, y), v = y ? "top" : "left", D = xt(o, "top", "top") || xt(c, "top", "top"), A = D ? D.scrollTop : void 0;
4949
+ me !== o && (oe = i[v], Ae = !1, Fe = !k && l.invertSwap || le), K = qn(e, o, i, y, k ? 1 : l.swapThreshold, l.invertedSwapThreshold == null ? l.swapThreshold : l.invertedSwapThreshold, Fe, me === o);
4950
+ var I;
4951
+ if (K !== 0) {
4952
+ var _ = J(c);
4953
+ do
4954
+ _ -= K, I = O.children[_];
4955
+ while (I && (h(I, "display") === "none" || I === g));
5130
4956
  }
4957
+ if (K === 0 || I === o) return R(!1);
4958
+ me = o, Ie = K;
4959
+ var x = o.nextElementSibling, M = !1;
4960
+ M = K === 1;
4961
+ var F = Xe(T, n, c, r, o, i, e, M);
4962
+ if (F !== !1) return (F === 1 || F === -1) && (M = F === 1), lt = !0, setTimeout(Un, 30), G(), M && !x ? n.appendChild(c) : o.parentNode.insertBefore(c, M ? x : o), D && Ut(D, 0, A - D.scrollTop), O = c.parentNode, oe !== void 0 && !Fe && (ke = Math.abs(oe - P(o)[v])), j(), R(!0);
5131
4963
  }
5132
- if (el.contains(dragEl)) return completed(false);
4964
+ if (n.contains(c)) return R(!1);
5133
4965
  }
5134
- return false;
4966
+ return !1;
5135
4967
  },
5136
4968
  _ignoreWhileAnimating: null,
5137
- _offMoveEvents: function _offMoveEvents() {
5138
- off(document, "mousemove", this._onTouchMove);
5139
- off(document, "touchmove", this._onTouchMove);
5140
- off(document, "pointermove", this._onTouchMove);
5141
- off(document, "dragover", nearestEmptyInsertDetectEvent);
5142
- off(document, "mousemove", nearestEmptyInsertDetectEvent);
5143
- off(document, "touchmove", nearestEmptyInsertDetectEvent);
4969
+ _offMoveEvents: function() {
4970
+ E(document, "mousemove", this._onTouchMove), E(document, "touchmove", this._onTouchMove), E(document, "pointermove", this._onTouchMove), E(document, "dragover", he), E(document, "mousemove", he), E(document, "touchmove", he);
5144
4971
  },
5145
- _offUpEvents: function _offUpEvents() {
5146
- var ownerDocument = this.el.ownerDocument;
5147
- off(ownerDocument, "mouseup", this._onDrop);
5148
- off(ownerDocument, "touchend", this._onDrop);
5149
- off(ownerDocument, "pointerup", this._onDrop);
5150
- off(ownerDocument, "pointercancel", this._onDrop);
5151
- off(ownerDocument, "touchcancel", this._onDrop);
5152
- off(document, "selectstart", this);
4972
+ _offUpEvents: function() {
4973
+ var e = this.el.ownerDocument;
4974
+ E(e, "mouseup", this._onDrop), E(e, "touchend", this._onDrop), E(e, "pointerup", this._onDrop), E(e, "touchcancel", this._onDrop), E(document, "selectstart", this);
5153
4975
  },
5154
- _onDrop: function _onDrop(evt) {
5155
- var el = this.el, options = this.options;
5156
- newIndex = index(dragEl);
5157
- newDraggableIndex = index(dragEl, options.draggable);
5158
- pluginEvent("drop", this, { evt });
5159
- parentEl = dragEl && dragEl.parentNode;
5160
- newIndex = index(dragEl);
5161
- newDraggableIndex = index(dragEl, options.draggable);
5162
- if (Sortable.eventCanceled) {
4976
+ _onDrop: function(e) {
4977
+ var n = this.el, o = this.options;
4978
+ if ($ = J(c), se = J(c, o.draggable), z("drop", this, { evt: e }), O = c && c.parentNode, $ = J(c), se = J(c, o.draggable), p.eventCanceled) {
5163
4979
  this._nulling();
5164
4980
  return;
5165
4981
  }
5166
- awaitingDragStarted = false;
5167
- isCircumstantialInvert = false;
5168
- pastFirstInvertThresh = false;
5169
- clearInterval(this._loopId);
5170
- clearTimeout(this._dragStartTimer);
5171
- _cancelNextTick(this.cloneId);
5172
- _cancelNextTick(this._dragStartId);
5173
- if (this.nativeDraggable) {
5174
- off(document, "drop", this);
5175
- off(el, "dragstart", this._onDragStart);
5176
- }
5177
- this._offMoveEvents();
5178
- this._offUpEvents();
5179
- if (Safari) css(document.body, "user-select", "");
5180
- css(dragEl, "transform", "");
5181
- if (evt) {
5182
- if (moved) {
5183
- evt.cancelable && evt.preventDefault();
5184
- !options.dropBubble && evt.stopPropagation();
5185
- }
5186
- ghostEl && ghostEl.parentNode && ghostEl.parentNode.removeChild(ghostEl);
5187
- if (rootEl === parentEl || putSortable && putSortable.lastPutMode !== "clone") cloneEl && cloneEl.parentNode && cloneEl.parentNode.removeChild(cloneEl);
5188
- if (dragEl) {
5189
- if (this.nativeDraggable) off(dragEl, "dragend", this);
5190
- _disableDraggable(dragEl);
5191
- dragEl.style["will-change"] = "";
5192
- if (moved && !awaitingDragStarted) toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : this.options.ghostClass, false);
5193
- toggleClass(dragEl, this.options.chosenClass, false);
5194
- _dispatchEvent({
5195
- sortable: this,
5196
- name: "unchoose",
5197
- toEl: parentEl,
5198
- newIndex: null,
5199
- newDraggableIndex: null,
5200
- originalEvent: evt
5201
- });
5202
- if (rootEl !== parentEl) {
5203
- if (newIndex >= 0) {
5204
- _dispatchEvent({
5205
- rootEl: parentEl,
5206
- name: "add",
5207
- toEl: parentEl,
5208
- fromEl: rootEl,
5209
- originalEvent: evt
5210
- });
5211
- _dispatchEvent({
5212
- sortable: this,
5213
- name: "remove",
5214
- toEl: parentEl,
5215
- originalEvent: evt
5216
- });
5217
- _dispatchEvent({
5218
- rootEl: parentEl,
5219
- name: "sort",
5220
- toEl: parentEl,
5221
- fromEl: rootEl,
5222
- originalEvent: evt
5223
- });
5224
- _dispatchEvent({
5225
- sortable: this,
5226
- name: "sort",
5227
- toEl: parentEl,
5228
- originalEvent: evt
5229
- });
5230
- }
5231
- putSortable && putSortable.save();
5232
- } else if (newIndex !== oldIndex) {
5233
- if (newIndex >= 0) {
5234
- _dispatchEvent({
5235
- sortable: this,
5236
- name: "update",
5237
- toEl: parentEl,
5238
- originalEvent: evt
5239
- });
5240
- _dispatchEvent({
5241
- sortable: this,
5242
- name: "sort",
5243
- toEl: parentEl,
5244
- originalEvent: evt
5245
- });
5246
- }
5247
- }
5248
- if (Sortable.active) {
5249
- if (newIndex == null || newIndex === -1) {
5250
- newIndex = oldIndex;
5251
- newDraggableIndex = oldDraggableIndex;
5252
- }
5253
- _dispatchEvent({
5254
- sortable: this,
5255
- name: "end",
5256
- toEl: parentEl,
5257
- originalEvent: evt
5258
- });
5259
- this.save();
5260
- }
5261
- }
5262
- }
5263
- this._nulling();
4982
+ ve = !1, Fe = !1, Ae = !1, clearInterval(this._loopId), clearTimeout(this._dragStartTimer), st(this.cloneId), st(this._dragStartId), this.nativeDraggable && (E(document, "drop", this), E(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()), g && g.parentNode && g.parentNode.removeChild(g), (T === O || Y && Y.lastPutMode !== "clone") && C && C.parentNode && C.parentNode.removeChild(C), c && (this.nativeDraggable && E(c, "dragend", this), nt(c), c.style["will-change"] = "", Se && !ve && V(c, Y ? Y.options.ghostClass : this.options.ghostClass, !1), V(c, this.options.chosenClass, !1), W({
4983
+ sortable: this,
4984
+ name: "unchoose",
4985
+ toEl: O,
4986
+ newIndex: null,
4987
+ newDraggableIndex: null,
4988
+ originalEvent: e
4989
+ }), T !== O ? ($ >= 0 && (W({
4990
+ rootEl: O,
4991
+ name: "add",
4992
+ toEl: O,
4993
+ fromEl: T,
4994
+ originalEvent: e
4995
+ }), W({
4996
+ sortable: this,
4997
+ name: "remove",
4998
+ toEl: O,
4999
+ originalEvent: e
5000
+ }), W({
5001
+ rootEl: O,
5002
+ name: "sort",
5003
+ toEl: O,
5004
+ fromEl: T,
5005
+ originalEvent: e
5006
+ }), W({
5007
+ sortable: this,
5008
+ name: "sort",
5009
+ toEl: O,
5010
+ originalEvent: e
5011
+ })), Y && Y.save()) : $ !== be && $ >= 0 && (W({
5012
+ sortable: this,
5013
+ name: "update",
5014
+ toEl: O,
5015
+ originalEvent: e
5016
+ }), W({
5017
+ sortable: this,
5018
+ name: "sort",
5019
+ toEl: O,
5020
+ originalEvent: e
5021
+ })), p.active && (($ == null || $ === -1) && ($ = be, se = Oe), W({
5022
+ sortable: this,
5023
+ name: "end",
5024
+ toEl: O,
5025
+ originalEvent: e
5026
+ }), this.save()))), this._nulling();
5264
5027
  },
5265
- _nulling: function _nulling() {
5266
- pluginEvent("nulling", this);
5267
- rootEl = dragEl = parentEl = ghostEl = nextEl = cloneEl = lastDownEl = cloneHidden = tapEvt = touchEvt = moved = newIndex = newDraggableIndex = oldIndex = oldDraggableIndex = lastTarget = lastDirection = putSortable = activeGroup = Sortable.dragged = Sortable.ghost = Sortable.clone = Sortable.active = null;
5268
- var el = this.el;
5269
- savedInputChecked.forEach(function(checkEl) {
5270
- if (el.contains(checkEl)) checkEl.checked = true;
5271
- });
5272
- savedInputChecked.length = lastDx = lastDy = 0;
5028
+ _nulling: function() {
5029
+ z("nulling", this), T = c = O = g = pe = C = Be = ue = de = Z = Se = $ = se = be = Oe = me = Ie = Y = Me = p.dragged = p.ghost = p.clone = p.active = null, ze.forEach(function(e) {
5030
+ e.checked = !0;
5031
+ }), ze.length = Qe = et = 0;
5273
5032
  },
5274
- handleEvent: function handleEvent(evt) {
5275
- switch (evt.type) {
5033
+ handleEvent: function(e) {
5034
+ switch (e.type) {
5276
5035
  case "drop":
5277
5036
  case "dragend":
5278
- this._onDrop(evt);
5037
+ this._onDrop(e);
5279
5038
  break;
5280
5039
  case "dragenter":
5281
5040
  case "dragover":
5282
- if (dragEl) {
5283
- this._onDragOver(evt);
5284
- _globalDragOver(evt);
5285
- }
5041
+ c && (this._onDragOver(e), zn(e));
5286
5042
  break;
5287
5043
  case "selectstart":
5288
- evt.preventDefault();
5044
+ e.preventDefault();
5289
5045
  break;
5290
5046
  }
5291
5047
  },
@@ -5293,39 +5049,29 @@ Sortable.prototype = (/** @lends Sortable.prototype */ {
5293
5049
  * Serializes the item into an array of string.
5294
5050
  * @returns {String[]}
5295
5051
  */
5296
- toArray: function toArray() {
5297
- var order = [], el, children = this.el.children, i = 0, n = children.length, options = this.options;
5298
- for (; i < n; i++) {
5299
- el = children[i];
5300
- if (closest(el, options.draggable, this.el, false)) order.push(el.getAttribute(options.dataIdAttr) || _generateId(el));
5301
- }
5302
- return order;
5052
+ toArray: function() {
5053
+ for (var e = [], n, o = this.el.children, r = 0, i = o.length, a = this.options; r < i; r++) n = o[r], Q(n, a.draggable, this.el, !1) && e.push(n.getAttribute(a.dataIdAttr) || Jn(n));
5054
+ return e;
5303
5055
  },
5304
5056
  /**
5305
5057
  * Sorts the elements according to the array.
5306
5058
  * @param {String[]} order order of the items
5307
5059
  */
5308
- sort: function sort(order, useAnimation) {
5309
- var items = {}, rootEl = this.el;
5310
- this.toArray().forEach(function(id, i) {
5311
- var el = rootEl.children[i];
5312
- if (closest(el, this.options.draggable, rootEl, false)) items[id] = el;
5313
- }, this);
5314
- useAnimation && this.captureAnimationState();
5315
- order.forEach(function(id) {
5316
- if (items[id]) {
5317
- rootEl.removeChild(items[id]);
5318
- rootEl.appendChild(items[id]);
5319
- }
5320
- });
5321
- useAnimation && this.animateAll();
5060
+ sort: function(e, n) {
5061
+ var o = {}, r = this.el;
5062
+ this.toArray().forEach(function(i, a) {
5063
+ var l = r.children[a];
5064
+ Q(l, this.options.draggable, r, !1) && (o[i] = l);
5065
+ }, this), n && this.captureAnimationState(), e.forEach(function(i) {
5066
+ o[i] && (r.removeChild(o[i]), r.appendChild(o[i]));
5067
+ }), n && this.animateAll();
5322
5068
  },
5323
5069
  /**
5324
5070
  * Save the current sorting
5325
5071
  */
5326
- save: function save() {
5327
- var store = this.options.store;
5328
- store && store.set && store.set(this);
5072
+ save: function() {
5073
+ var e = this.options.store;
5074
+ e && e.set && e.set(this);
5329
5075
  },
5330
5076
  /**
5331
5077
  * 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.
@@ -5333,8 +5079,8 @@ Sortable.prototype = (/** @lends Sortable.prototype */ {
5333
5079
  * @param {String} [selector] default: `options.draggable`
5334
5080
  * @returns {HTMLElement|null}
5335
5081
  */
5336
- closest: function closest$1(el, selector) {
5337
- return closest(el, selector || this.options.draggable, this.el, false);
5082
+ closest: function(e, n) {
5083
+ return Q(e, n || this.options.draggable, this.el, !1);
5338
5084
  },
5339
5085
  /**
5340
5086
  * Set/get option
@@ -5342,407 +5088,482 @@ Sortable.prototype = (/** @lends Sortable.prototype */ {
5342
5088
  * @param {*} [value]
5343
5089
  * @returns {*}
5344
5090
  */
5345
- option: function option(name, value) {
5346
- var options = this.options;
5347
- if (value === void 0) return options[name];
5348
- else {
5349
- var modifiedValue = PluginManager.modifyOption(this, name, value);
5350
- if (typeof modifiedValue !== "undefined") options[name] = modifiedValue;
5351
- else options[name] = value;
5352
- if (name === "group") _prepareGroup(options);
5353
- }
5091
+ option: function(e, n) {
5092
+ var o = this.options;
5093
+ if (n === void 0) return o[e];
5094
+ var r = Ne.modifyOption(this, e, n);
5095
+ typeof r != "undefined" ? o[e] = r : o[e] = n, e === "group" && Jt(o);
5354
5096
  },
5355
5097
  /**
5356
5098
  * Destroy
5357
5099
  */
5358
- destroy: function destroy() {
5359
- pluginEvent("destroy", this);
5360
- var el = this.el;
5361
- el[expando] = null;
5362
- off(el, "mousedown", this._onTapStart);
5363
- off(el, "touchstart", this._onTapStart);
5364
- off(el, "pointerdown", this._onTapStart);
5365
- if (this.nativeDraggable) {
5366
- off(el, "dragover", this);
5367
- off(el, "dragenter", this);
5368
- }
5369
- Array.prototype.forEach.call(el.querySelectorAll("[draggable]"), function(el) {
5370
- el.removeAttribute("draggable");
5371
- });
5372
- this._onDrop();
5373
- this._disableDelayedDragEvents();
5374
- sortables.splice(sortables.indexOf(this.el), 1);
5375
- this.el = el = null;
5100
+ destroy: function() {
5101
+ z("destroy", this);
5102
+ var e = this.el;
5103
+ e[q] = null, E(e, "mousedown", this._onTapStart), E(e, "touchstart", this._onTapStart), E(e, "pointerdown", this._onTapStart), this.nativeDraggable && (E(e, "dragover", this), E(e, "dragenter", this)), Array.prototype.forEach.call(e.querySelectorAll("[draggable]"), function(n) {
5104
+ n.removeAttribute("draggable");
5105
+ }), this._onDrop(), this._disableDelayedDragEvents(), je.splice(je.indexOf(this.el), 1), this.el = e = null;
5376
5106
  },
5377
- _hideClone: function _hideClone() {
5378
- if (!cloneHidden) {
5379
- pluginEvent("hideClone", this);
5380
- if (Sortable.eventCanceled) return;
5381
- css(cloneEl, "display", "none");
5382
- if (this.options.removeCloneOnHide && cloneEl.parentNode) cloneEl.parentNode.removeChild(cloneEl);
5383
- cloneHidden = true;
5107
+ _hideClone: function() {
5108
+ if (!ue) {
5109
+ if (z("hideClone", this), p.eventCanceled) return;
5110
+ h(C, "display", "none"), this.options.removeCloneOnHide && C.parentNode && C.parentNode.removeChild(C), ue = !0;
5384
5111
  }
5385
5112
  },
5386
- _showClone: function _showClone(putSortable) {
5387
- if (putSortable.lastPutMode !== "clone") {
5113
+ _showClone: function(e) {
5114
+ if (e.lastPutMode !== "clone") {
5388
5115
  this._hideClone();
5389
5116
  return;
5390
5117
  }
5391
- if (cloneHidden) {
5392
- pluginEvent("showClone", this);
5393
- if (Sortable.eventCanceled) return;
5394
- if (dragEl.parentNode == rootEl && !this.options.group.revertClone) rootEl.insertBefore(cloneEl, dragEl);
5395
- else if (nextEl) rootEl.insertBefore(cloneEl, nextEl);
5396
- else rootEl.appendChild(cloneEl);
5397
- if (this.options.group.revertClone) this.animate(dragEl, cloneEl);
5398
- css(cloneEl, "display", "");
5399
- cloneHidden = false;
5118
+ if (ue) {
5119
+ if (z("showClone", this), p.eventCanceled) return;
5120
+ c.parentNode == T && !this.options.group.revertClone ? T.insertBefore(C, c) : pe ? T.insertBefore(C, pe) : T.appendChild(C), this.options.group.revertClone && this.animate(c, C), h(C, "display", ""), ue = !1;
5400
5121
  }
5401
5122
  }
5402
- });
5403
- function _globalDragOver(evt) {
5404
- if (evt.dataTransfer) evt.dataTransfer.dropEffect = "move";
5405
- evt.cancelable && evt.preventDefault();
5406
- }
5407
- function _onMove(fromEl, toEl, dragEl, dragRect, targetEl, targetRect, originalEvent, willInsertAfter) {
5408
- var evt, sortable = fromEl[expando], onMoveFn = sortable.options.onMove, retVal;
5409
- if (window.CustomEvent && !IE11OrLess && !Edge) evt = new CustomEvent("move", {
5410
- bubbles: true,
5411
- cancelable: true
5412
- });
5413
- else {
5414
- evt = document.createEvent("Event");
5415
- evt.initEvent("move", true, true);
5416
- }
5417
- evt.to = toEl;
5418
- evt.from = fromEl;
5419
- evt.dragged = dragEl;
5420
- evt.draggedRect = dragRect;
5421
- evt.related = targetEl || toEl;
5422
- evt.relatedRect = targetRect || getRect(toEl);
5423
- evt.willInsertAfter = willInsertAfter;
5424
- evt.originalEvent = originalEvent;
5425
- fromEl.dispatchEvent(evt);
5426
- if (onMoveFn) retVal = onMoveFn.call(sortable, evt, originalEvent);
5427
- return retVal;
5428
- }
5429
- function _disableDraggable(el) {
5430
- el.draggable = false;
5431
- }
5432
- function _unsilent() {
5433
- _silent = false;
5434
- }
5435
- function _ghostIsFirst(evt, vertical, sortable) {
5436
- var firstElRect = getRect(getChild(sortable.el, 0, sortable.options, true));
5437
- var childContainingRect = getChildContainingRectFromElement(sortable.el, sortable.options, ghostEl);
5438
- var spacer = 10;
5439
- return vertical ? evt.clientX < childContainingRect.left - spacer || evt.clientY < firstElRect.top && evt.clientX < firstElRect.right : evt.clientY < childContainingRect.top - spacer || evt.clientY < firstElRect.bottom && evt.clientX < firstElRect.left;
5440
- }
5441
- function _ghostIsLast(evt, vertical, sortable) {
5442
- var lastElRect = getRect(lastChild(sortable.el, sortable.options.draggable));
5443
- var childContainingRect = getChildContainingRectFromElement(sortable.el, sortable.options, ghostEl);
5444
- var spacer = 10;
5445
- return vertical ? evt.clientX > childContainingRect.right + spacer || evt.clientY > lastElRect.bottom && evt.clientX > lastElRect.left : evt.clientY > childContainingRect.bottom + spacer || evt.clientX > lastElRect.right && evt.clientY > lastElRect.top;
5446
- }
5447
- function _getSwapDirection(evt, target, targetRect, vertical, swapThreshold, invertedSwapThreshold, invertSwap, isLastTarget) {
5448
- var mouseOnAxis = vertical ? evt.clientY : evt.clientX, targetLength = vertical ? targetRect.height : targetRect.width, targetS1 = vertical ? targetRect.top : targetRect.left, targetS2 = vertical ? targetRect.bottom : targetRect.right, invert = false;
5449
- if (!invertSwap) {
5450
- if (isLastTarget && targetMoveDistance < targetLength * swapThreshold) {
5451
- if (!pastFirstInvertThresh && (lastDirection === 1 ? mouseOnAxis > targetS1 + targetLength * invertedSwapThreshold / 2 : mouseOnAxis < targetS2 - targetLength * invertedSwapThreshold / 2)) pastFirstInvertThresh = true;
5452
- if (!pastFirstInvertThresh) {
5453
- if (lastDirection === 1 ? mouseOnAxis < targetS1 + targetMoveDistance : mouseOnAxis > targetS2 - targetMoveDistance) return -lastDirection;
5454
- } else invert = true;
5455
- } else if (mouseOnAxis > targetS1 + targetLength * (1 - swapThreshold) / 2 && mouseOnAxis < targetS2 - targetLength * (1 - swapThreshold) / 2) return _getInsertDirection(target);
5456
- }
5457
- invert = invert || invertSwap;
5458
- if (invert) {
5459
- if (mouseOnAxis < targetS1 + targetLength * invertedSwapThreshold / 2 || mouseOnAxis > targetS2 - targetLength * invertedSwapThreshold / 2) return mouseOnAxis > targetS1 + targetLength / 2 ? 1 : -1;
5123
+ };
5124
+ function zn(t) {
5125
+ t.dataTransfer && (t.dataTransfer.dropEffect = "move"), t.cancelable && t.preventDefault();
5126
+ }
5127
+ function Xe(t, e, n, o, r, i, a, l) {
5128
+ var s, u = t[q], d = u.options.onMove, f;
5129
+ return window.CustomEvent && !ae && !xe ? s = new CustomEvent("move", {
5130
+ bubbles: !0,
5131
+ cancelable: !0
5132
+ }) : (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 || P(e), s.willInsertAfter = l, s.originalEvent = a, t.dispatchEvent(s), d && (f = d.call(u, s, a)), f;
5133
+ }
5134
+ function nt(t) {
5135
+ t.draggable = !1;
5136
+ }
5137
+ function Un() {
5138
+ lt = !1;
5139
+ }
5140
+ function Vn(t, e, n) {
5141
+ var o = P(we(n.el, 0, n.options, !0)), r = $t(n.el, n.options, g), i = 10;
5142
+ return e ? t.clientX < r.left - i || t.clientY < o.top && t.clientX < o.right : t.clientY < r.top - i || t.clientY < o.bottom && t.clientX < o.left;
5143
+ }
5144
+ function $n(t, e, n) {
5145
+ var o = P(ht(n.el, n.options.draggable)), r = $t(n.el, n.options, g), i = 10;
5146
+ return e ? t.clientX > r.right + i || t.clientY > o.bottom && t.clientX > o.left : t.clientY > r.bottom + i || t.clientX > o.right && t.clientY > o.top;
5147
+ }
5148
+ function qn(t, e, n, o, r, i, a, l) {
5149
+ 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, m = !1;
5150
+ if (!a) {
5151
+ if (l && ke < u * r) {
5152
+ if (!Ae && (Ie === 1 ? s > d + u * i / 2 : s < f - u * i / 2) && (Ae = !0), Ae) m = !0;
5153
+ else if (Ie === 1 ? s < d + ke : s > f - ke) return -Ie;
5154
+ } else if (s > d + u * (1 - r) / 2 && s < f - u * (1 - r) / 2) return Kn(e);
5460
5155
  }
5461
- return 0;
5156
+ return m = m || a, m && (s < d + u * i / 2 || s > f - u * i / 2) ? s > d + u / 2 ? 1 : -1 : 0;
5462
5157
  }
5463
- /**
5464
- * Gets the direction dragEl must be swapped relative to target in order to make it
5465
- * seem that dragEl has been "inserted" into that element's position
5466
- * @param {HTMLElement} target The target whose position dragEl is being inserted at
5467
- * @return {Number} Direction dragEl must be swapped
5468
- */
5469
- function _getInsertDirection(target) {
5470
- if (index(dragEl) < index(target)) return 1;
5471
- else return -1;
5158
+ function Kn(t) {
5159
+ return J(c) < J(t) ? 1 : -1;
5472
5160
  }
5473
- /**
5474
- * Generate id
5475
- * @param {HTMLElement} el
5476
- * @returns {String}
5477
- * @private
5478
- */
5479
- function _generateId(el) {
5480
- var str = el.tagName + el.className + el.src + el.href + el.textContent, i = str.length, sum = 0;
5481
- while (i--) sum += str.charCodeAt(i);
5482
- return sum.toString(36);
5161
+ function Jn(t) {
5162
+ for (var e = t.tagName + t.className + t.src + t.href + t.textContent, n = e.length, o = 0; n--;) o += e.charCodeAt(n);
5163
+ return o.toString(36);
5483
5164
  }
5484
- function _saveInputCheckedState(root) {
5485
- savedInputChecked.length = 0;
5486
- var inputs = root.getElementsByTagName("input");
5487
- var idx = inputs.length;
5488
- while (idx--) {
5489
- var el = inputs[idx];
5490
- el.checked && savedInputChecked.push(el);
5165
+ function Zn(t) {
5166
+ ze.length = 0;
5167
+ for (var e = t.getElementsByTagName("input"), n = e.length; n--;) {
5168
+ var o = e[n];
5169
+ o.checked && ze.push(o);
5491
5170
  }
5492
5171
  }
5493
- function _nextTick(fn) {
5494
- return setTimeout(fn, 0);
5172
+ function He(t) {
5173
+ return setTimeout(t, 0);
5495
5174
  }
5496
- function _cancelNextTick(id) {
5497
- return clearTimeout(id);
5175
+ function st(t) {
5176
+ return clearTimeout(t);
5498
5177
  }
5499
- if (documentExists) on(document, "touchmove", function(evt) {
5500
- if ((Sortable.active || awaitingDragStarted) && evt.cancelable) evt.preventDefault();
5178
+ Ve && S(document, "touchmove", function(t) {
5179
+ (p.active || ve) && t.cancelable && t.preventDefault();
5501
5180
  });
5502
- Sortable.utils = {
5503
- on,
5504
- off,
5505
- css,
5506
- find,
5507
- is: function is(el, selector) {
5508
- return !!closest(el, selector, el, false);
5181
+ p.utils = {
5182
+ on: S,
5183
+ off: E,
5184
+ css: h,
5185
+ find: jt,
5186
+ is: function(e, n) {
5187
+ return !!Q(e, n, e, !1);
5509
5188
  },
5510
- extend,
5511
- throttle,
5512
- closest,
5513
- toggleClass,
5514
- clone,
5515
- index,
5516
- nextTick: _nextTick,
5517
- cancelNextTick: _cancelNextTick,
5518
- detectDirection: _detectDirection,
5519
- getChild,
5520
- expando
5189
+ extend: Fn,
5190
+ throttle: zt,
5191
+ closest: Q,
5192
+ toggleClass: V,
5193
+ clone: Vt,
5194
+ index: J,
5195
+ nextTick: He,
5196
+ cancelNextTick: st,
5197
+ detectDirection: Kt,
5198
+ getChild: we
5521
5199
  };
5522
- /**
5523
- * Get the Sortable instance of an element
5524
- * @param {HTMLElement} element The element
5525
- * @return {Sortable|undefined} The instance of Sortable
5526
- */
5527
- Sortable.get = function(element) {
5528
- return element[expando];
5200
+ p.get = function(t) {
5201
+ return t[q];
5529
5202
  };
5530
- /**
5531
- * Mount a plugin to Sortable
5532
- * @param {...SortablePlugin|SortablePlugin[]} plugins Plugins being mounted
5533
- */
5534
- Sortable.mount = function() {
5535
- for (var _len = arguments.length, plugins = new Array(_len), _key = 0; _key < _len; _key++) plugins[_key] = arguments[_key];
5536
- if (plugins[0].constructor === Array) plugins = plugins[0];
5537
- plugins.forEach(function(plugin) {
5538
- if (!plugin.prototype || !plugin.prototype.constructor) throw "Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(plugin));
5539
- if (plugin.utils) Sortable.utils = _objectSpread2(_objectSpread2({}, Sortable.utils), plugin.utils);
5540
- PluginManager.mount(plugin);
5203
+ p.mount = function() {
5204
+ for (var t = arguments.length, e = new Array(t), n = 0; n < t; n++) e[n] = arguments[n];
5205
+ e[0].constructor === Array && (e = e[0]), e.forEach(function(o) {
5206
+ if (!o.prototype || !o.prototype.constructor) throw "Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(o));
5207
+ o.utils && (p.utils = ne(ne({}, p.utils), o.utils)), Ne.mount(o);
5541
5208
  });
5542
5209
  };
5543
- /**
5544
- * Create sortable instance
5545
- * @param {HTMLElement} el
5546
- * @param {Object} [options]
5547
- */
5548
- Sortable.create = function(el, options) {
5549
- return new Sortable(el, options);
5210
+ p.create = function(t, e) {
5211
+ return new p(t, e);
5550
5212
  };
5551
- Sortable.version = version;
5552
- var autoScrolls = [], scrollEl, scrollRootEl, scrolling = false, lastAutoScrollX, lastAutoScrollY, touchEvt$1, pointerElemChangedInterval;
5553
- function AutoScrollPlugin() {
5554
- function AutoScroll() {
5213
+ p.version = Nn;
5214
+ var N = [], De, ut, ct = !1, ot, rt, Ue, _e;
5215
+ function Qn() {
5216
+ function t() {
5555
5217
  this.defaults = {
5556
- scroll: true,
5557
- forceAutoScrollFallback: false,
5218
+ scroll: !0,
5219
+ forceAutoScrollFallback: !1,
5558
5220
  scrollSensitivity: 30,
5559
5221
  scrollSpeed: 10,
5560
- bubbleScroll: true
5222
+ bubbleScroll: !0
5561
5223
  };
5562
- for (var fn in this) if (fn.charAt(0) === "_" && typeof this[fn] === "function") this[fn] = this[fn].bind(this);
5224
+ for (var e in this) e.charAt(0) === "_" && typeof this[e] == "function" && (this[e] = this[e].bind(this));
5563
5225
  }
5564
- AutoScroll.prototype = {
5565
- dragStarted: function dragStarted(_ref) {
5566
- var originalEvent = _ref.originalEvent;
5567
- if (this.sortable.nativeDraggable) on(document, "dragover", this._handleAutoScroll);
5568
- else if (this.options.supportPointer) on(document, "pointermove", this._handleFallbackAutoScroll);
5569
- else if (originalEvent.touches) on(document, "touchmove", this._handleFallbackAutoScroll);
5570
- else on(document, "mousemove", this._handleFallbackAutoScroll);
5226
+ return t.prototype = {
5227
+ dragStarted: function(n) {
5228
+ var o = n.originalEvent;
5229
+ this.sortable.nativeDraggable ? S(document, "dragover", this._handleAutoScroll) : this.options.supportPointer ? S(document, "pointermove", this._handleFallbackAutoScroll) : o.touches ? S(document, "touchmove", this._handleFallbackAutoScroll) : S(document, "mousemove", this._handleFallbackAutoScroll);
5571
5230
  },
5572
- dragOverCompleted: function dragOverCompleted(_ref2) {
5573
- var originalEvent = _ref2.originalEvent;
5574
- if (!this.options.dragOverBubble && !originalEvent.rootEl) this._handleAutoScroll(originalEvent);
5231
+ dragOverCompleted: function(n) {
5232
+ var o = n.originalEvent;
5233
+ !this.options.dragOverBubble && !o.rootEl && this._handleAutoScroll(o);
5575
5234
  },
5576
- drop: function drop() {
5577
- if (this.sortable.nativeDraggable) off(document, "dragover", this._handleAutoScroll);
5578
- else {
5579
- off(document, "pointermove", this._handleFallbackAutoScroll);
5580
- off(document, "touchmove", this._handleFallbackAutoScroll);
5581
- off(document, "mousemove", this._handleFallbackAutoScroll);
5582
- }
5583
- clearPointerElemChangedInterval();
5584
- clearAutoScrolls();
5585
- cancelThrottle();
5235
+ drop: function() {
5236
+ this.sortable.nativeDraggable ? E(document, "dragover", this._handleAutoScroll) : (E(document, "pointermove", this._handleFallbackAutoScroll), E(document, "touchmove", this._handleFallbackAutoScroll), E(document, "mousemove", this._handleFallbackAutoScroll)), Rt(), Le(), Rn();
5586
5237
  },
5587
- nulling: function nulling() {
5588
- touchEvt$1 = scrollRootEl = scrollEl = scrolling = pointerElemChangedInterval = lastAutoScrollX = lastAutoScrollY = null;
5589
- autoScrolls.length = 0;
5238
+ nulling: function() {
5239
+ Ue = ut = De = ct = _e = ot = rt = null, N.length = 0;
5590
5240
  },
5591
- _handleFallbackAutoScroll: function _handleFallbackAutoScroll(evt) {
5592
- this._handleAutoScroll(evt, true);
5241
+ _handleFallbackAutoScroll: function(n) {
5242
+ this._handleAutoScroll(n, !0);
5593
5243
  },
5594
- _handleAutoScroll: function _handleAutoScroll(evt, fallback) {
5595
- var _this = this;
5596
- var x = (evt.touches ? evt.touches[0] : evt).clientX, y = (evt.touches ? evt.touches[0] : evt).clientY, elem = document.elementFromPoint(x, y);
5597
- touchEvt$1 = evt;
5598
- if (fallback || this.options.forceAutoScrollFallback || Edge || IE11OrLess || Safari) {
5599
- autoScroll(evt, this.options, elem, fallback);
5600
- var ogElemScroller = getParentAutoScrollElement(elem, true);
5601
- if (scrolling && (!pointerElemChangedInterval || x !== lastAutoScrollX || y !== lastAutoScrollY)) {
5602
- pointerElemChangedInterval && clearPointerElemChangedInterval();
5603
- pointerElemChangedInterval = setInterval(function() {
5604
- var newElem = getParentAutoScrollElement(document.elementFromPoint(x, y), true);
5605
- if (newElem !== ogElemScroller) {
5606
- ogElemScroller = newElem;
5607
- clearAutoScrolls();
5608
- }
5609
- autoScroll(evt, _this.options, newElem, fallback);
5610
- }, 10);
5611
- lastAutoScrollX = x;
5612
- lastAutoScrollY = y;
5613
- }
5244
+ _handleAutoScroll: function(n, o) {
5245
+ var r = this, i = (n.touches ? n.touches[0] : n).clientX, a = (n.touches ? n.touches[0] : n).clientY, l = document.elementFromPoint(i, a);
5246
+ if (Ue = n, o || this.options.forceAutoScrollFallback || xe || ae || Te) {
5247
+ it(n, this.options, l, o);
5248
+ var s = ce(l, !0);
5249
+ ct && (!_e || i !== ot || a !== rt) && (_e && Rt(), _e = setInterval(function() {
5250
+ var u = ce(document.elementFromPoint(i, a), !0);
5251
+ u !== s && (s = u, Le()), it(n, r.options, u, o);
5252
+ }, 10), ot = i, rt = a);
5614
5253
  } else {
5615
- if (!this.options.bubbleScroll || getParentAutoScrollElement(elem, true) === getWindowScrollingElement()) {
5616
- clearAutoScrolls();
5254
+ if (!this.options.bubbleScroll || ce(l, !0) === te()) {
5255
+ Le();
5617
5256
  return;
5618
5257
  }
5619
- autoScroll(evt, this.options, getParentAutoScrollElement(elem, false), false);
5258
+ it(n, this.options, ce(l, !1), !1);
5620
5259
  }
5621
5260
  }
5622
- };
5623
- return _extends(AutoScroll, {
5261
+ }, ie(t, {
5624
5262
  pluginName: "scroll",
5625
- initializeByDefault: true
5263
+ initializeByDefault: !0
5626
5264
  });
5627
5265
  }
5628
- function clearAutoScrolls() {
5629
- autoScrolls.forEach(function(autoScroll) {
5630
- clearInterval(autoScroll.pid);
5631
- });
5632
- autoScrolls = [];
5633
- }
5634
- function clearPointerElemChangedInterval() {
5635
- clearInterval(pointerElemChangedInterval);
5636
- }
5637
- var autoScroll = throttle(function(evt, options, rootEl, isFallback) {
5638
- if (!options.scroll) return;
5639
- var x = (evt.touches ? evt.touches[0] : evt).clientX, y = (evt.touches ? evt.touches[0] : evt).clientY, sens = options.scrollSensitivity, speed = options.scrollSpeed, winScroller = getWindowScrollingElement();
5640
- var scrollThisInstance = false, scrollCustomFn;
5641
- if (scrollRootEl !== rootEl) {
5642
- scrollRootEl = rootEl;
5643
- clearAutoScrolls();
5644
- scrollEl = options.scroll;
5645
- scrollCustomFn = options.scrollFn;
5646
- if (scrollEl === true) scrollEl = getParentAutoScrollElement(rootEl, true);
5266
+ function Le() {
5267
+ N.forEach(function(t) {
5268
+ clearInterval(t.pid);
5269
+ }), N = [];
5270
+ }
5271
+ function Rt() {
5272
+ clearInterval(_e);
5273
+ }
5274
+ var it = zt(function(t, e, n, o) {
5275
+ if (e.scroll) {
5276
+ var r = (t.touches ? t.touches[0] : t).clientX, i = (t.touches ? t.touches[0] : t).clientY, a = e.scrollSensitivity, l = e.scrollSpeed, s = te(), u = !1, d;
5277
+ ut !== n && (ut = n, Le(), De = e.scroll, d = e.scrollFn, De === !0 && (De = ce(n, !0)));
5278
+ var f = 0, m = De;
5279
+ do {
5280
+ var y = m, b = P(y), w = b.top, L = b.bottom, G = b.left, R = b.right, j = b.width, B = b.height, X = void 0, K = void 0, oe = y.scrollWidth, le = y.scrollHeight, k = h(y), v = y.scrollLeft, D = y.scrollTop;
5281
+ y === s ? (X = j < oe && (k.overflowX === "auto" || k.overflowX === "scroll" || k.overflowX === "visible"), K = B < le && (k.overflowY === "auto" || k.overflowY === "scroll" || k.overflowY === "visible")) : (X = j < oe && (k.overflowX === "auto" || k.overflowX === "scroll"), K = B < le && (k.overflowY === "auto" || k.overflowY === "scroll"));
5282
+ var A = X && (Math.abs(R - r) <= a && v + j < oe) - (Math.abs(G - r) <= a && !!v), I = K && (Math.abs(L - i) <= a && D + B < le) - (Math.abs(w - i) <= a && !!D);
5283
+ if (!N[f]) for (var _ = 0; _ <= f; _++) N[_] || (N[_] = {});
5284
+ (N[f].vx != A || N[f].vy != I || N[f].el !== y) && (N[f].el = y, N[f].vx = A, N[f].vy = I, clearInterval(N[f].pid), (A != 0 || I != 0) && (u = !0, N[f].pid = setInterval(function() {
5285
+ o && this.layer === 0 && p.active._onTouchMove(Ue);
5286
+ var x = N[this.layer].vy ? N[this.layer].vy * l : 0, M = N[this.layer].vx ? N[this.layer].vx * l : 0;
5287
+ typeof d == "function" && d.call(p.dragged.parentNode[q], M, x, t, Ue, N[this.layer].el) !== "continue" || Ut(N[this.layer].el, M, x);
5288
+ }.bind({ layer: f }), 24))), f++;
5289
+ } while (e.bubbleScroll && m !== s && (m = ce(m, !1)));
5290
+ ct = u;
5647
5291
  }
5648
- var layersOut = 0;
5649
- var currentParent = scrollEl;
5650
- do {
5651
- var el = currentParent, rect = getRect(el), top = rect.top, bottom = rect.bottom, left = rect.left, right = rect.right, width = rect.width, height = rect.height, canScrollX = void 0, canScrollY = void 0, scrollWidth = el.scrollWidth, scrollHeight = el.scrollHeight, elCSS = css(el), scrollPosX = el.scrollLeft, scrollPosY = el.scrollTop;
5652
- if (el === winScroller) {
5653
- canScrollX = width < scrollWidth && (elCSS.overflowX === "auto" || elCSS.overflowX === "scroll" || elCSS.overflowX === "visible");
5654
- canScrollY = height < scrollHeight && (elCSS.overflowY === "auto" || elCSS.overflowY === "scroll" || elCSS.overflowY === "visible");
5655
- } else {
5656
- canScrollX = width < scrollWidth && (elCSS.overflowX === "auto" || elCSS.overflowX === "scroll");
5657
- canScrollY = height < scrollHeight && (elCSS.overflowY === "auto" || elCSS.overflowY === "scroll");
5658
- }
5659
- var vx = canScrollX && (Math.abs(right - x) <= sens && scrollPosX + width < scrollWidth) - (Math.abs(left - x) <= sens && !!scrollPosX);
5660
- var vy = canScrollY && (Math.abs(bottom - y) <= sens && scrollPosY + height < scrollHeight) - (Math.abs(top - y) <= sens && !!scrollPosY);
5661
- if (!autoScrolls[layersOut]) {
5662
- for (var i = 0; i <= layersOut; i++) if (!autoScrolls[i]) autoScrolls[i] = {};
5663
- }
5664
- if (autoScrolls[layersOut].vx != vx || autoScrolls[layersOut].vy != vy || autoScrolls[layersOut].el !== el) {
5665
- autoScrolls[layersOut].el = el;
5666
- autoScrolls[layersOut].vx = vx;
5667
- autoScrolls[layersOut].vy = vy;
5668
- clearInterval(autoScrolls[layersOut].pid);
5669
- if (vx != 0 || vy != 0) {
5670
- scrollThisInstance = true;
5671
- autoScrolls[layersOut].pid = setInterval(function() {
5672
- if (isFallback && this.layer === 0) Sortable.active._onTouchMove(touchEvt$1);
5673
- var scrollOffsetY = autoScrolls[this.layer].vy ? autoScrolls[this.layer].vy * speed : 0;
5674
- var scrollOffsetX = autoScrolls[this.layer].vx ? autoScrolls[this.layer].vx * speed : 0;
5675
- if (typeof scrollCustomFn === "function") {
5676
- if (scrollCustomFn.call(Sortable.dragged.parentNode[expando], scrollOffsetX, scrollOffsetY, evt, touchEvt$1, autoScrolls[this.layer].el) !== "continue") return;
5677
- }
5678
- scrollBy(autoScrolls[this.layer].el, scrollOffsetX, scrollOffsetY);
5679
- }.bind({ layer: layersOut }), 24);
5680
- }
5681
- }
5682
- layersOut++;
5683
- } while (options.bubbleScroll && currentParent !== winScroller && (currentParent = getParentAutoScrollElement(currentParent, false)));
5684
- scrolling = scrollThisInstance;
5685
- }, 30);
5686
- var drop = function drop(_ref) {
5687
- var originalEvent = _ref.originalEvent, putSortable = _ref.putSortable, dragEl = _ref.dragEl, activeSortable = _ref.activeSortable, dispatchSortableEvent = _ref.dispatchSortableEvent, hideGhostForTarget = _ref.hideGhostForTarget, unhideGhostForTarget = _ref.unhideGhostForTarget;
5688
- if (!originalEvent) return;
5689
- var toSortable = putSortable || activeSortable;
5690
- hideGhostForTarget();
5691
- var touch = originalEvent.changedTouches && originalEvent.changedTouches.length ? originalEvent.changedTouches[0] : originalEvent;
5692
- var target = document.elementFromPoint(touch.clientX, touch.clientY);
5693
- unhideGhostForTarget();
5694
- if (toSortable && !toSortable.el.contains(target)) {
5695
- dispatchSortableEvent("spill");
5696
- this.onSpill({
5697
- dragEl,
5698
- putSortable
5699
- });
5292
+ }, 30), en = function(e) {
5293
+ var n = e.originalEvent, o = e.putSortable, r = e.dragEl, i = e.activeSortable, a = e.dispatchSortableEvent, l = e.hideGhostForTarget, s = e.unhideGhostForTarget;
5294
+ if (n) {
5295
+ var u = o || i;
5296
+ l();
5297
+ var d = n.changedTouches && n.changedTouches.length ? n.changedTouches[0] : n, f = document.elementFromPoint(d.clientX, d.clientY);
5298
+ s(), u && !u.el.contains(f) && (a("spill"), this.onSpill({
5299
+ dragEl: r,
5300
+ putSortable: o
5301
+ }));
5700
5302
  }
5701
5303
  };
5702
- function Revert() {}
5703
- Revert.prototype = {
5304
+ function pt() {}
5305
+ pt.prototype = {
5704
5306
  startIndex: null,
5705
- dragStart: function dragStart(_ref2) {
5706
- var oldDraggableIndex = _ref2.oldDraggableIndex;
5707
- this.startIndex = oldDraggableIndex;
5307
+ dragStart: function(e) {
5308
+ var n = e.oldDraggableIndex;
5309
+ this.startIndex = n;
5708
5310
  },
5709
- onSpill: function onSpill(_ref3) {
5710
- var dragEl = _ref3.dragEl, putSortable = _ref3.putSortable;
5711
- this.sortable.captureAnimationState();
5712
- if (putSortable) putSortable.captureAnimationState();
5713
- var nextSibling = getChild(this.sortable.el, this.startIndex, this.options);
5714
- if (nextSibling) this.sortable.el.insertBefore(dragEl, nextSibling);
5715
- else this.sortable.el.appendChild(dragEl);
5716
- this.sortable.animateAll();
5717
- if (putSortable) putSortable.animateAll();
5311
+ onSpill: function(e) {
5312
+ var n = e.dragEl, o = e.putSortable;
5313
+ this.sortable.captureAnimationState(), o && o.captureAnimationState();
5314
+ var r = we(this.sortable.el, this.startIndex, this.options);
5315
+ r ? this.sortable.el.insertBefore(n, r) : this.sortable.el.appendChild(n), this.sortable.animateAll(), o && o.animateAll();
5718
5316
  },
5719
- drop
5317
+ drop: en
5720
5318
  };
5721
- _extends(Revert, { pluginName: "revertOnSpill" });
5722
- function Remove() {}
5723
- Remove.prototype = {
5724
- onSpill: function onSpill(_ref4) {
5725
- var dragEl = _ref4.dragEl;
5726
- var parentSortable = _ref4.putSortable || this.sortable;
5727
- parentSortable.captureAnimationState();
5728
- dragEl.parentNode && dragEl.parentNode.removeChild(dragEl);
5729
- parentSortable.animateAll();
5319
+ ie(pt, { pluginName: "revertOnSpill" });
5320
+ function gt() {}
5321
+ gt.prototype = {
5322
+ onSpill: function(e) {
5323
+ var n = e.dragEl, r = e.putSortable || this.sortable;
5324
+ r.captureAnimationState(), n.parentNode && n.parentNode.removeChild(n), r.animateAll();
5730
5325
  },
5731
- drop
5326
+ drop: en
5732
5327
  };
5733
- _extends(Remove, { pluginName: "removeOnSpill" });
5734
- Sortable.mount(new AutoScrollPlugin());
5735
- Sortable.mount(Remove, Revert);
5328
+ ie(gt, { pluginName: "removeOnSpill" });
5329
+ p.mount(new Qn());
5330
+ p.mount(gt, pt);
5331
+ function eo(t) {
5332
+ return t == null ? t : JSON.parse(JSON.stringify(t));
5333
+ }
5334
+ function to(t) {
5335
+ (0, vue.getCurrentInstance)() && (0, vue.onUnmounted)(t);
5336
+ }
5337
+ function no(t) {
5338
+ (0, vue.getCurrentInstance)() ? (0, vue.onMounted)(t) : (0, vue.nextTick)(t);
5339
+ }
5340
+ var tn = null, nn = null;
5341
+ function Xt(t = null, e = null) {
5342
+ tn = t, nn = e;
5343
+ }
5344
+ function oo() {
5345
+ return {
5346
+ data: tn,
5347
+ clonedData: nn
5348
+ };
5349
+ }
5350
+ var Yt = Symbol("cloneElement");
5351
+ function on(...t) {
5352
+ var le, k;
5353
+ const e = (le = (0, vue.getCurrentInstance)()) == null ? void 0 : le.proxy;
5354
+ let n = null;
5355
+ const o = t[0];
5356
+ let [, r, i] = t;
5357
+ Array.isArray((0, vue.unref)(r)) || (i = r, r = null);
5358
+ let a = null;
5359
+ const { immediate: l = !0, clone: s = eo, forceFallback: u, fallbackOnBody: d, customUpdate: f } = (k = (0, vue.unref)(i)) != null ? k : {};
5360
+ function m(v) {
5361
+ var F;
5362
+ const { from: D, oldIndex: A, item: I } = v, _ = Array.from(D.childNodes);
5363
+ n = u && !d ? _.slice(0, -1) : _;
5364
+ const x = (0, vue.unref)((F = (0, vue.unref)(r)) == null ? void 0 : F[A]), M = s(x);
5365
+ Xt(x, M), I[Yt] = M;
5366
+ }
5367
+ function y(v) {
5368
+ const D = v.item[Yt];
5369
+ if (!wn(D)) {
5370
+ if (Ke(v.item), (0, vue.isRef)(r)) {
5371
+ const A = [...(0, vue.unref)(r)];
5372
+ r.value = _t(A, v.newDraggableIndex, D);
5373
+ return;
5374
+ }
5375
+ _t((0, vue.unref)(r), v.newDraggableIndex, D);
5376
+ }
5377
+ }
5378
+ function b(v) {
5379
+ const { from: D, item: A, oldIndex: I, oldDraggableIndex: _, pullMode: x, clone: M } = v;
5380
+ if (Tt(D, A, I), x === "clone") {
5381
+ Ke(M);
5382
+ return;
5383
+ }
5384
+ if ((0, vue.isRef)(r)) {
5385
+ const F = [...(0, vue.unref)(r)];
5386
+ r.value = Dt(F, _);
5387
+ return;
5388
+ }
5389
+ Dt((0, vue.unref)(r), _);
5390
+ }
5391
+ function w(v) {
5392
+ if (f) {
5393
+ f(v);
5394
+ return;
5395
+ }
5396
+ const { from: D, item: A, oldIndex: I, oldDraggableIndex: _, newDraggableIndex: x } = v;
5397
+ if (Ke(A), Tt(D, A, I), (0, vue.isRef)(r)) {
5398
+ const M = [...(0, vue.unref)(r)];
5399
+ r.value = St(M, _, x);
5400
+ return;
5401
+ }
5402
+ St((0, vue.unref)(r), _, x);
5403
+ }
5404
+ function L(v) {
5405
+ const { newIndex: D, oldIndex: A, from: I, to: _ } = v;
5406
+ let x = null;
5407
+ const M = D === A && I === _;
5408
+ try {
5409
+ if (M) {
5410
+ let F = null;
5411
+ n?.some((ee, Ee) => {
5412
+ if (F && (n == null ? void 0 : n.length) !== _.childNodes.length) return I.insertBefore(F, ee.nextSibling), !0;
5413
+ const mt = _.childNodes[Ee];
5414
+ F = _ == null ? void 0 : _.replaceChild(ee, mt);
5415
+ });
5416
+ }
5417
+ } catch (F) {
5418
+ x = F;
5419
+ } finally {
5420
+ n = null;
5421
+ }
5422
+ (0, vue.nextTick)(() => {
5423
+ if (Xt(), x) throw x;
5424
+ });
5425
+ }
5426
+ const G = {
5427
+ onUpdate: w,
5428
+ onStart: m,
5429
+ onAdd: y,
5430
+ onRemove: b,
5431
+ onEnd: L
5432
+ };
5433
+ function R(v) {
5434
+ const D = (0, vue.unref)(o);
5435
+ return v || (v = En(D) ? Sn(D, e == null ? void 0 : e.$el) : D), v && !Tn(v) && (v = v.$el), v || vn("Root element not found"), v;
5436
+ }
5437
+ function j() {
5438
+ var I;
5439
+ const _ = (I = (0, vue.unref)(i)) != null ? I : {}, { immediate: v, clone: D } = _, A = $e(_, ["immediate", "clone"]);
5440
+ return Ct(A, (x, M) => {
5441
+ Cn(x) && (A[x] = (F, ...ee) => {
5442
+ return On(F, oo()), M(F, ...ee);
5443
+ });
5444
+ }), _n(r === null ? {} : G, A);
5445
+ }
5446
+ const B = (v) => {
5447
+ v = R(v), a && X.destroy(), a = new p(v, j());
5448
+ };
5449
+ (0, vue.watch)(() => i, () => {
5450
+ a && Ct(j(), (v, D) => {
5451
+ a?.option(v, D);
5452
+ });
5453
+ }, { deep: !0 });
5454
+ const X = {
5455
+ option: (v, D) => a == null ? void 0 : a.option(v, D),
5456
+ destroy: () => {
5457
+ a?.destroy(), a = null;
5458
+ },
5459
+ save: () => a == null ? void 0 : a.save(),
5460
+ toArray: () => a == null ? void 0 : a.toArray(),
5461
+ closest: (...v) => a == null ? void 0 : a.closest(...v)
5462
+ }, K = () => X == null ? void 0 : X.option("disabled", !0), oe = () => X == null ? void 0 : X.option("disabled", !1);
5463
+ return no(() => {
5464
+ l && B();
5465
+ }), to(X.destroy), fe({
5466
+ start: B,
5467
+ pause: K,
5468
+ resume: oe
5469
+ }, X);
5470
+ }
5471
+ var ft = [
5472
+ "update",
5473
+ "start",
5474
+ "add",
5475
+ "remove",
5476
+ "choose",
5477
+ "unchoose",
5478
+ "end",
5479
+ "sort",
5480
+ "filter",
5481
+ "clone",
5482
+ "move",
5483
+ "change"
5484
+ ];
5485
+ (0, vue.defineComponent)({
5486
+ name: "VueDraggable",
5487
+ model: {
5488
+ prop: "modelValue",
5489
+ event: "update:modelValue"
5490
+ },
5491
+ props: [
5492
+ "clone",
5493
+ "animation",
5494
+ "ghostClass",
5495
+ "group",
5496
+ "sort",
5497
+ "disabled",
5498
+ "store",
5499
+ "handle",
5500
+ "draggable",
5501
+ "swapThreshold",
5502
+ "invertSwap",
5503
+ "invertedSwapThreshold",
5504
+ "removeCloneOnHide",
5505
+ "direction",
5506
+ "chosenClass",
5507
+ "dragClass",
5508
+ "ignore",
5509
+ "filter",
5510
+ "preventOnFilter",
5511
+ "easing",
5512
+ "setData",
5513
+ "dropBubble",
5514
+ "dragoverBubble",
5515
+ "dataIdAttr",
5516
+ "delay",
5517
+ "delayOnTouchOnly",
5518
+ "touchStartThreshold",
5519
+ "forceFallback",
5520
+ "fallbackClass",
5521
+ "fallbackOnBody",
5522
+ "fallbackTolerance",
5523
+ "fallbackOffset",
5524
+ "supportPointer",
5525
+ "emptyInsertThreshold",
5526
+ "scroll",
5527
+ "forceAutoScrollFallback",
5528
+ "scrollSensitivity",
5529
+ "scrollSpeed",
5530
+ "bubbleScroll",
5531
+ "modelValue",
5532
+ "tag",
5533
+ "target",
5534
+ "customUpdate",
5535
+ ...ft.map((t) => `on${t.replace(/^\S/, (e) => e.toUpperCase())}`)
5536
+ ],
5537
+ emits: ["update:modelValue", ...ft],
5538
+ setup(t, { slots: e, emit: n, expose: o, attrs: r }) {
5539
+ const i = ft.reduce((d, f) => {
5540
+ const m = `on${f.replace(/^\S/, (y) => y.toUpperCase())}`;
5541
+ return d[m] = (...y) => n(f, ...y), d;
5542
+ }, {}), a = (0, vue.computed)(() => {
5543
+ const y = (0, vue.toRefs)(t), { modelValue: d } = y, f = $e(y, ["modelValue"]), m = Object.entries(f).reduce((b, [w, L]) => {
5544
+ const G = (0, vue.unref)(L);
5545
+ return G !== void 0 && (b[w] = G), b;
5546
+ }, {});
5547
+ return fe(fe({}, i), yn(fe(fe({}, r), m)));
5548
+ }), l = (0, vue.computed)({
5549
+ get: () => t.modelValue,
5550
+ set: (d) => n("update:modelValue", d)
5551
+ }), s = (0, vue.ref)(), u = (0, vue.reactive)(on(t.target || s, l, a));
5552
+ return o(u), () => {
5553
+ var d;
5554
+ return (0, vue.h)(t.tag || "div", { ref: s }, (d = e == null ? void 0 : e.default) == null ? void 0 : d.call(e, u));
5555
+ };
5556
+ }
5557
+ });
5558
+ var Bt = {
5559
+ mounted: "mounted",
5560
+ unmounted: "unmounted"
5561
+ };
5562
+ Bt.mounted, Bt.unmounted;
5736
5563
  //#endregion
5737
5564
  //#region src/components/AccordionItem.vue?vue&type=script&setup=true&lang.ts
5738
- var _hoisted_1$1 = {
5739
- key: 2,
5740
- class: "accordion-title ml-4"
5741
- };
5742
- var _hoisted_2$1 = {
5743
- key: 3,
5744
- class: "d-flex mx-2 ga-1"
5745
- };
5565
+ var _hoisted_1$1 = { class: "d-flex align-center w-100 ga-2" };
5566
+ var SAVE_DEBOUNCE = 3e3;
5746
5567
  var AccordionItem_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
5747
5568
  __name: "AccordionItem",
5748
5569
  props: {
@@ -5768,45 +5589,29 @@ var AccordionItem_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
5768
5589
  const props = __props;
5769
5590
  const emit = __emit;
5770
5591
  const eventBus = (0, vue.inject)("$eventBus");
5771
- const isEditing = (0, vue.ref)(!props.item.header);
5772
- const form = (0, vue.ref)();
5773
- const header = (0, vue.ref)(props.item.header);
5592
+ const draft = (0, vue.reactive)({ header: props.item.header });
5774
5593
  const hasElements = (0, vue.computed)(() => !isEmpty(props.embeds));
5775
- const cancel = () => {
5776
- header.value = props.item.header;
5777
- isEditing.value = false;
5778
- };
5779
- const saveHeader = async () => {
5780
- if (!form.value) return;
5781
- const { valid } = await form.value.validate();
5782
- if (!valid) return;
5783
- isEditing.value = false;
5594
+ const currentItem = () => ({
5595
+ ...cloneDeep(props.item),
5596
+ ...draft
5597
+ });
5598
+ const save = debounce(() => {
5784
5599
  emit("save", {
5785
- item: {
5786
- ...props.item,
5787
- header: header.value
5788
- },
5600
+ item: currentItem(),
5789
5601
  embeds: props.embeds
5790
5602
  });
5791
- };
5603
+ }, SAVE_DEBOUNCE);
5792
5604
  const saveEmbed = (embeds) => {
5793
- const item = cloneDeep(props.item);
5605
+ const item = currentItem();
5794
5606
  forEach(embeds, (it) => item.body[it.id] = true);
5795
5607
  emit("save", {
5796
5608
  item,
5797
5609
  embeds
5798
5610
  });
5799
5611
  };
5800
- const deleteItem = () => {
5801
- return eventBus.channel("app").emit("showConfirmationModal", {
5802
- title: "Delete accordion item",
5803
- message: "Are you sure you want to delete selected item?",
5804
- action: () => emit("delete")
5805
- });
5806
- };
5807
5612
  const deleteEmbed = (embed) => {
5613
+ const item = currentItem();
5808
5614
  const embeds = cloneDeep(props.embeds);
5809
- const item = cloneDeep(props.item);
5810
5615
  delete embeds[embed.id];
5811
5616
  delete item.body[embed.id];
5812
5617
  emit("save", {
@@ -5814,13 +5619,18 @@ var AccordionItem_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
5814
5619
  embeds
5815
5620
  });
5816
5621
  };
5622
+ const deleteItem = () => {
5623
+ return eventBus.channel("app").emit("showConfirmationModal", {
5624
+ title: "Delete accordion item",
5625
+ message: "Are you sure you want to delete selected item?",
5626
+ action: () => emit("delete")
5627
+ });
5628
+ };
5817
5629
  return (_ctx, _cache) => {
5818
5630
  const _component_VIcon = (0, vue.resolveComponent)("VIcon");
5819
5631
  const _component_VTextField = (0, vue.resolveComponent)("VTextField");
5820
- const _component_VSpacer = (0, vue.resolveComponent)("VSpacer");
5821
5632
  const _component_VBtn = (0, vue.resolveComponent)("VBtn");
5822
5633
  const _component_VFadeTransition = (0, vue.resolveComponent)("VFadeTransition");
5823
- const _component_VForm = (0, vue.resolveComponent)("VForm");
5824
5634
  const _component_VExpansionPanelTitle = (0, vue.resolveComponent)("VExpansionPanelTitle");
5825
5635
  const _component_VHover = (0, vue.resolveComponent)("VHover");
5826
5636
  const _component_VAlert = (0, vue.resolveComponent)("VAlert");
@@ -5832,101 +5642,55 @@ var AccordionItem_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
5832
5642
  default: (0, vue.withCtx)(() => [(0, vue.createVNode)(_component_VHover, null, {
5833
5643
  default: (0, vue.withCtx)(({ isHovering, props: hoverProps }) => [(0, vue.createVNode)(_component_VExpansionPanelTitle, (0, vue.mergeProps)(hoverProps, {
5834
5644
  class: "pa-2 pr-4",
5835
- color: "primary-lighten-5",
5836
- "min-height": "64"
5645
+ "min-height": "56"
5837
5646
  }), {
5838
- default: (0, vue.withCtx)(() => [(0, vue.createVNode)(_component_VForm, {
5839
- ref_key: "form",
5840
- ref: form,
5841
- class: "d-flex align-center w-100",
5842
- "validate-on": "submit",
5843
- onSubmit: (0, vue.withModifiers)(saveHeader, ["prevent"])
5844
- }, {
5845
- default: (0, vue.withCtx)(() => [
5846
- !__props.isReadonly ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", {
5647
+ default: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", _hoisted_1$1, [
5648
+ !__props.isReadonly ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", {
5649
+ key: 0,
5650
+ class: "accordion-drag-handle",
5651
+ onDrag: _cache[0] || (_cache[0] = (0, vue.withModifiers)(() => {}, ["stop", "prevent"]))
5652
+ }, [(0, vue.createVNode)(_component_VIcon, { icon: "mdi-drag-vertical" })], 32)) : (0, vue.createCommentVNode)("", true),
5653
+ (0, vue.createVNode)(_component_VTextField, {
5654
+ modelValue: draft.header,
5655
+ "onUpdate:modelValue": [_cache[1] || (_cache[1] = ($event) => draft.header = $event), (0, vue.unref)(save)],
5656
+ readonly: __props.isReadonly,
5657
+ "bg-color": "transparent",
5658
+ class: "accordion-item-title",
5659
+ density: "compact",
5660
+ placeholder: "Accordion Title",
5661
+ variant: "plain",
5662
+ flat: "",
5663
+ "hide-details": "",
5664
+ onBlur: _cache[2] || (_cache[2] = ($event) => (0, vue.unref)(save).flush()),
5665
+ onClick: _cache[3] || (_cache[3] = (0, vue.withModifiers)(() => {}, ["stop"])),
5666
+ onKeyup: _cache[4] || (_cache[4] = (0, vue.withKeys)((0, vue.withModifiers)(() => {}, ["prevent"]), ["space"]))
5667
+ }, null, 8, [
5668
+ "modelValue",
5669
+ "readonly",
5670
+ "onUpdate:modelValue"
5671
+ ]),
5672
+ (0, vue.createVNode)(_component_VFadeTransition, null, {
5673
+ default: (0, vue.withCtx)(() => [(isHovering || __props.isExpanded) && !__props.isReadonly && __props.allowDeletion ? (0, vue.withDirectives)(((0, vue.openBlock)(), (0, vue.createBlock)(_component_VBtn, {
5847
5674
  key: 0,
5848
- class: "accordion-drag-handle",
5849
- onDrag: _cache[0] || (_cache[0] = (0, vue.withModifiers)(() => {}, ["stop", "prevent"]))
5850
- }, [(0, vue.createVNode)(_component_VIcon, { icon: "mdi-drag-vertical" })], 32)) : (0, vue.createCommentVNode)("", true),
5851
- isEditing.value ? ((0, vue.openBlock)(), (0, vue.createBlock)(_component_VTextField, {
5852
- key: 1,
5853
- modelValue: header.value,
5854
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => header.value = $event),
5855
- rules: [(val) => !!val || "Title is required"],
5856
- "bg-color": "white",
5857
- class: "w-100",
5858
- density: "compact",
5859
- "hide-details": "auto",
5860
- placeholder: "Accordion item title...",
5861
- variant: "outlined",
5862
- onClick: _cache[2] || (_cache[2] = (0, vue.withModifiers)(() => {}, ["stop"])),
5863
- onKeyup: _cache[3] || (_cache[3] = (0, vue.withKeys)((0, vue.withModifiers)(() => {}, ["prevent"]), ["space"]))
5864
- }, null, 8, ["modelValue", "rules"])) : ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_1$1, (0, vue.toDisplayString)(__props.item.header), 1)),
5865
- (0, vue.createVNode)(_component_VSpacer),
5866
- !__props.isReadonly ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_2$1, [isEditing.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: 0 }, [(0, vue.createVNode)(_component_VBtn, {
5867
- disabled: header.value === props.item.header,
5868
- color: "primary-darken-2",
5869
- text: "Save",
5870
- type: "submit",
5675
+ "aria-label": "Delete item",
5676
+ class: "mr-2",
5677
+ color: "error",
5678
+ density: "comfortable",
5679
+ icon: "mdi-trash-can-outline",
5680
+ size: "small",
5871
5681
  variant: "tonal",
5872
- onClick: _cache[4] || (_cache[4] = (0, vue.withModifiers)(() => {}, ["stop"]))
5873
- }, null, 8, ["disabled"]), (0, vue.createVNode)(_component_VBtn, {
5874
- disabled: !props.item.header,
5875
- color: "primary-darken-2",
5876
- text: "Cancel",
5877
- variant: "text",
5878
- onClick: (0, vue.withModifiers)(cancel, ["stop"])
5879
- }, null, 8, ["disabled"])], 64)) : ((0, vue.openBlock)(), (0, vue.createBlock)(_component_VFadeTransition, {
5880
- key: 1,
5881
- group: ""
5882
- }, {
5883
- default: (0, vue.withCtx)(() => [isHovering || __props.isExpanded ? ((0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: 0 }, [(0, vue.withDirectives)(((0, vue.openBlock)(), (0, vue.createBlock)(_component_VBtn, {
5884
- "aria-label": "Edit title",
5885
- color: "primary-darken-2",
5886
- size: "x-small",
5887
- variant: "tonal",
5888
- icon: "",
5889
- onClick: _cache[5] || (_cache[5] = (0, vue.withModifiers)(($event) => isEditing.value = true, ["stop"]))
5890
- }, {
5891
- default: (0, vue.withCtx)(() => [(0, vue.createVNode)(_component_VIcon, {
5892
- icon: "mdi-square-edit-outline",
5893
- size: "large"
5894
- })]),
5895
- _: 1
5896
- })), [[
5897
- _directive_tooltip,
5898
- {
5899
- text: "Edit title",
5900
- openDelay: 300
5901
- },
5902
- "bottom"
5903
- ]]), __props.allowDeletion ? (0, vue.withDirectives)(((0, vue.openBlock)(), (0, vue.createBlock)(_component_VBtn, {
5904
- key: 0,
5905
- "aria-label": "Delete item",
5906
- color: "secondary-lighten-1",
5907
- size: "x-small",
5908
- variant: "tonal",
5909
- icon: "",
5910
- onClick: (0, vue.withModifiers)(deleteItem, ["stop"])
5911
- }, {
5912
- default: (0, vue.withCtx)(() => [(0, vue.createVNode)(_component_VIcon, {
5913
- icon: "mdi-delete-outline",
5914
- size: "large"
5915
- })]),
5916
- _: 1
5917
- })), [[
5918
- _directive_tooltip,
5919
- {
5920
- text: "Delete item",
5921
- openDelay: 300
5922
- },
5923
- "bottom"
5924
- ]]) : (0, vue.createCommentVNode)("", true)], 64)) : (0, vue.createCommentVNode)("", true)]),
5925
- _: 2
5926
- }, 1024))])) : (0, vue.createCommentVNode)("", true)
5927
- ]),
5928
- _: 2
5929
- }, 1536)]),
5682
+ onClick: (0, vue.withModifiers)(deleteItem, ["stop"])
5683
+ }, null, 512)), [[
5684
+ _directive_tooltip,
5685
+ {
5686
+ text: "Delete item",
5687
+ openDelay: 300
5688
+ },
5689
+ "bottom"
5690
+ ]]) : (0, vue.createCommentVNode)("", true)]),
5691
+ _: 2
5692
+ }, 1024)
5693
+ ])]),
5930
5694
  _: 2
5931
5695
  }, 1040)]),
5932
5696
  _: 1
@@ -5934,7 +5698,6 @@ var AccordionItem_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
5934
5698
  default: (0, vue.withCtx)(() => [!hasElements.value ? ((0, vue.openBlock)(), (0, vue.createBlock)(_component_VAlert, {
5935
5699
  key: 0,
5936
5700
  class: "mx-6 mt-4 mb-2",
5937
- color: "primary-darken-1",
5938
5701
  icon: "mdi-information-outline",
5939
5702
  variant: "tonal",
5940
5703
  prominent: ""
@@ -5946,7 +5709,7 @@ var AccordionItem_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
5946
5709
  container: { embeds: __props.embeds },
5947
5710
  "is-readonly": __props.isReadonly,
5948
5711
  onDelete: deleteEmbed,
5949
- onSave: _cache[6] || (_cache[6] = ($event) => saveEmbed($event.embeds))
5712
+ onSave: _cache[5] || (_cache[5] = ($event) => saveEmbed($event.embeds))
5950
5713
  }, null, 8, [
5951
5714
  "allowed-element-config",
5952
5715
  "container",
@@ -5968,11 +5731,10 @@ var _plugin_vue_export_helper_default = (sfc, props) => {
5968
5731
  };
5969
5732
  //#endregion
5970
5733
  //#region src/components/AccordionItem.vue
5971
- var AccordionItem_default = /* @__PURE__ */ _plugin_vue_export_helper_default(AccordionItem_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-e39fe68d"]]);
5734
+ var AccordionItem_default = /* @__PURE__ */ _plugin_vue_export_helper_default(AccordionItem_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-6d959b25"]]);
5972
5735
  //#endregion
5973
5736
  //#region src/components/Edit.vue?vue&type=script&setup=true&lang.ts
5974
- var _hoisted_1 = { class: "text-title-small" };
5975
- var _hoisted_2 = { class: "pa-6 text-center" };
5737
+ var _hoisted_1 = { class: "tce-accordion text-center" };
5976
5738
  //#endregion
5977
5739
  //#region src/components/Edit.vue
5978
5740
  var Edit_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @__PURE__ */ (0, vue.defineComponent)({
@@ -5991,7 +5753,6 @@ var Edit_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @__PURE_
5991
5753
  const expanded = (0, vue.ref)([]);
5992
5754
  const elementData = (0, vue.reactive)(cloneDeep(props.element.data));
5993
5755
  const panels = (0, vue.ref)();
5994
- const sortable = (0, vue.ref)();
5995
5756
  const accordionItems = (0, vue.computed)(() => sortBy(elementData.items, "position"));
5996
5757
  const accordionItemCount = (0, vue.computed)(() => accordionItems.value.length);
5997
5758
  const embedsByItem = (0, vue.computed)(() => reduce(elementData.items, (acc, item) => {
@@ -6014,7 +5775,7 @@ var Edit_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @__PURE_
6014
5775
  const id = v4();
6015
5776
  elementData.items[id] = {
6016
5777
  id,
6017
- header: `Accordion Item Title`,
5778
+ header: "",
6018
5779
  body: {},
6019
5780
  position: accordionItemCount.value + 1
6020
5781
  };
@@ -6028,103 +5789,80 @@ var Edit_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @__PURE_
6028
5789
  const prevPos = accordionItems.value[newIndex].position;
6029
5790
  return (accordionItems.value[newIndex + direction].position + prevPos) / 2;
6030
5791
  };
6031
- (0, vue.onMounted)(() => {
6032
- sortable.value = Sortable.create(panels.value.$el, {
6033
- animation: 150,
6034
- group: `dragDrop-${uniqueId()}`,
6035
- handle: ".accordion-drag-handle",
6036
- onEnd: ({ oldIndex, newIndex }) => {
6037
- if (!isNumber(newIndex) || !isNumber(oldIndex)) return;
6038
- const position = calculateNewPosition(oldIndex, newIndex);
6039
- const currentItem = accordionItems.value[oldIndex];
6040
- Object.assign(elementData.items[currentItem.id], { position });
6041
- emit("save", elementData);
6042
- }
6043
- });
5792
+ on(panels, {
5793
+ animation: 150,
5794
+ handle: ".accordion-drag-handle",
5795
+ onUpdate: ({ oldIndex, newIndex }) => {
5796
+ if (!isNumber(newIndex) || !isNumber(oldIndex)) return;
5797
+ const position = calculateNewPosition(oldIndex, newIndex);
5798
+ const currentItem = accordionItems.value[oldIndex];
5799
+ Object.assign(elementData.items[currentItem.id], { position });
5800
+ emit("save", elementData);
5801
+ }
6044
5802
  });
6045
- (0, vue.onBeforeUnmount)(() => {
6046
- sortable.value.destroy();
5803
+ (0, vue.watch)(() => props.element.data, (data) => {
5804
+ if (isEqual(data, elementData)) return;
5805
+ Object.assign(elementData, cloneDeep(data));
6047
5806
  });
6048
5807
  return (_ctx, _cache) => {
6049
- const _component_VIcon = (0, vue.resolveComponent)("VIcon");
6050
- const _component_VToolbar = (0, vue.resolveComponent)("VToolbar");
6051
5808
  const _component_VExpandTransition = (0, vue.resolveComponent)("VExpandTransition");
6052
5809
  const _component_VExpansionPanels = (0, vue.resolveComponent)("VExpansionPanels");
6053
5810
  const _component_VBtn = (0, vue.resolveComponent)("VBtn");
6054
- const _component_VCard = (0, vue.resolveComponent)("VCard");
6055
- return (0, vue.openBlock)(), (0, vue.createBlock)(_component_VCard, {
6056
- class: "tce-accordion",
6057
- color: "grey-lighten-5"
5811
+ return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_1, [(0, vue.createVNode)(_component_VExpansionPanels, {
5812
+ ref_key: "panels",
5813
+ ref: panels,
5814
+ modelValue: expanded.value,
5815
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => expanded.value = $event),
5816
+ rounded: "lg",
5817
+ flat: "",
5818
+ multiple: ""
6058
5819
  }, {
6059
- default: (0, vue.withCtx)(() => [(0, vue.createVNode)(_component_VToolbar, {
6060
- class: "px-4",
6061
- color: "primary-darken-2",
6062
- height: "36"
6063
- }, {
6064
- default: (0, vue.withCtx)(() => [(0, vue.createVNode)(_component_VIcon, {
6065
- icon: (0, vue.unref)(manifest$1).ui.icon,
6066
- color: "secondary-lighten-2",
6067
- size: "18",
6068
- start: ""
6069
- }, null, 8, ["icon"]), (0, vue.createElementVNode)("span", _hoisted_1, (0, vue.toDisplayString)((0, vue.unref)(manifest$1).name), 1)]),
6070
- _: 1
6071
- }), (0, vue.createElementVNode)("div", _hoisted_2, [(0, vue.createVNode)(_component_VExpansionPanels, {
6072
- ref_key: "panels",
6073
- ref: panels,
6074
- modelValue: expanded.value,
6075
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => expanded.value = $event),
6076
- rounded: "lg",
6077
- flat: "",
6078
- multiple: ""
6079
- }, {
6080
- default: (0, vue.withCtx)(() => [!!accordionItemCount.value ? ((0, vue.openBlock)(), (0, vue.createBlock)(_component_VExpandTransition, {
6081
- key: 0,
6082
- group: ""
6083
- }, {
6084
- default: (0, vue.withCtx)(() => [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(accordionItems.value, (item) => {
6085
- return (0, vue.openBlock)(), (0, vue.createBlock)(AccordionItem_default, {
6086
- key: item.id,
6087
- "allow-deletion": accordionItemCount.value > 1,
6088
- "embed-element-config": __props.embedElementConfig,
6089
- embeds: embedsByItem.value[item.id],
6090
- "is-expanded": expanded.value.includes(item.id),
6091
- "is-focused": __props.isFocused,
6092
- "is-readonly": __props.isReadonly,
6093
- item,
6094
- onDelete: ($event) => deleteItem(item.id),
6095
- onExpand: ($event) => expanded.value.push(item.id),
6096
- onSave: _cache[0] || (_cache[0] = ($event) => saveItem($event))
6097
- }, null, 8, [
6098
- "allow-deletion",
6099
- "embed-element-config",
6100
- "embeds",
6101
- "is-expanded",
6102
- "is-focused",
6103
- "is-readonly",
6104
- "item",
6105
- "onDelete",
6106
- "onExpand"
6107
- ]);
6108
- }), 128))]),
6109
- _: 1
6110
- })) : (0, vue.createCommentVNode)("", true)]),
6111
- _: 1
6112
- }, 8, ["modelValue"]), !__props.isReadonly ? ((0, vue.openBlock)(), (0, vue.createBlock)(_component_VBtn, {
5820
+ default: (0, vue.withCtx)(() => [!!accordionItemCount.value ? ((0, vue.openBlock)(), (0, vue.createBlock)(_component_VExpandTransition, {
6113
5821
  key: 0,
6114
- class: "mt-6",
6115
- color: "primary-darken-4",
6116
- "prepend-icon": "mdi-tab-plus",
6117
- variant: "text",
6118
- onClick: addAccordionItem
5822
+ group: ""
6119
5823
  }, {
6120
- default: (0, vue.withCtx)(() => [..._cache[2] || (_cache[2] = [(0, vue.createTextVNode)(" Add Accordion Item ", -1)])]),
5824
+ default: (0, vue.withCtx)(() => [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(accordionItems.value, (item) => {
5825
+ return (0, vue.openBlock)(), (0, vue.createBlock)(AccordionItem_default, {
5826
+ key: item.id,
5827
+ "allow-deletion": accordionItemCount.value > 1,
5828
+ "embed-element-config": __props.embedElementConfig,
5829
+ embeds: embedsByItem.value[item.id],
5830
+ "is-expanded": expanded.value.includes(item.id),
5831
+ "is-focused": __props.isFocused,
5832
+ "is-readonly": __props.isReadonly,
5833
+ item,
5834
+ class: "text-left",
5835
+ onDelete: ($event) => deleteItem(item.id),
5836
+ onExpand: ($event) => expanded.value.push(item.id),
5837
+ onSave: _cache[0] || (_cache[0] = ($event) => saveItem($event))
5838
+ }, null, 8, [
5839
+ "allow-deletion",
5840
+ "embed-element-config",
5841
+ "embeds",
5842
+ "is-expanded",
5843
+ "is-focused",
5844
+ "is-readonly",
5845
+ "item",
5846
+ "onDelete",
5847
+ "onExpand"
5848
+ ]);
5849
+ }), 128))]),
6121
5850
  _: 1
6122
- })) : (0, vue.createCommentVNode)("", true)])]),
5851
+ })) : (0, vue.createCommentVNode)("", true)]),
6123
5852
  _: 1
6124
- });
5853
+ }, 8, ["modelValue"]), !__props.isReadonly ? ((0, vue.openBlock)(), (0, vue.createBlock)(_component_VBtn, {
5854
+ key: 0,
5855
+ class: "mt-4",
5856
+ "prepend-icon": "mdi-plus",
5857
+ variant: "text",
5858
+ onClick: addAccordionItem
5859
+ }, {
5860
+ default: (0, vue.withCtx)(() => [..._cache[2] || (_cache[2] = [(0, vue.createTextVNode)(" Add Accordion Item ", -1)])]),
5861
+ _: 1
5862
+ })) : (0, vue.createCommentVNode)("", true)]);
6125
5863
  };
6126
5864
  }
6127
- }), [["__scopeId", "data-v-55d0ed15"]]);
5865
+ }), [["__scopeId", "data-v-1aaa8449"]]);
6128
5866
  //#endregion
6129
5867
  //#region src/index.ts
6130
5868
  var manifest = {