@pantograph/sortable 2.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +432 -829
- package/Sortable.js +1674 -1957
- package/{src/index.d.ts → index.d.ts} +13 -25
- package/modular/sortable.complete.esm.js +1674 -1957
- package/modular/sortable.core.esm.js +1566 -1913
- package/modular/sortable.esm.js +1674 -1956
- package/package.json +58 -58
- package/{src/plugins.d.ts → plugins.d.ts} +0 -33
- package/Sortable.min.js +0 -2
- package/src/Animation.js +0 -175
- package/src/BrowserInfo.js +0 -12
- package/src/EventDispatcher.js +0 -57
- package/src/PluginManager.js +0 -94
- package/src/Sortable.js +0 -2099
- package/src/utils.js +0 -600
package/package.json
CHANGED
|
@@ -1,58 +1,58 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@pantograph/sortable",
|
|
3
|
-
"exportName": "Sortable",
|
|
4
|
-
"version": "2.
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
"
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
"
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
"Sortable.
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
"
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
],
|
|
57
|
-
"license": "MIT"
|
|
58
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@pantograph/sortable",
|
|
3
|
+
"exportName": "Sortable",
|
|
4
|
+
"version": "2.1.0",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "sedmedgh",
|
|
7
|
+
"email": "sedmedgh@gmail.com"
|
|
8
|
+
},
|
|
9
|
+
"description": "JavaScript library for reorderable drag-and-drop lists on modern browsers and touch devices. No jQuery required. Supports Meteor, AngularJS, React, Polymer, Vue, Knockout and any CSS library, e.g. Bootstrap.",
|
|
10
|
+
"main": "./Sortable.min.js",
|
|
11
|
+
"module": "modular/sortable.esm.js",
|
|
12
|
+
"types": "./index.d.ts",
|
|
13
|
+
"scripts": {
|
|
14
|
+
"build:umd": "set NODE_ENV=umd&& rollup -c ./scripts/umd-build.js",
|
|
15
|
+
"build:umd:watch": "set NODE_ENV=umd&& rollup -w -c ./scripts/umd-build.js",
|
|
16
|
+
"build:es": "set NODE_ENV=es&& rollup -c ./scripts/esm-build.js",
|
|
17
|
+
"build:es:watch": "set NODE_ENV=es&& rollup -w -c ./scripts/esm-build.js",
|
|
18
|
+
"build": "npm run build:es && npm run build:umd",
|
|
19
|
+
"test:compat": "node ./scripts/test-compat.js",
|
|
20
|
+
"test": "node ./scripts/test.js"
|
|
21
|
+
},
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"@babel/core": "^7.4.4",
|
|
24
|
+
"@babel/plugin-transform-object-assign": "^7.2.0",
|
|
25
|
+
"@babel/preset-env": "^7.4.4",
|
|
26
|
+
"rollup": "^1.11.3",
|
|
27
|
+
"rollup-plugin-babel": "^4.3.2",
|
|
28
|
+
"rollup-plugin-json": "^4.0.0",
|
|
29
|
+
"rollup-plugin-node-resolve": "^5.0.0",
|
|
30
|
+
"testcafe": "^1.3.1",
|
|
31
|
+
"testcafe-browser-provider-saucelabs": "^1.7.0",
|
|
32
|
+
"testcafe-reporter-xunit": "^2.1.0",
|
|
33
|
+
"uglify-js": "^3.5.12"
|
|
34
|
+
},
|
|
35
|
+
"maintainers": [
|
|
36
|
+
"Konstantin Lebedev <ibnRubaXa@gmail.com>",
|
|
37
|
+
"Owen Mills <owen23355@gmail.com>"
|
|
38
|
+
],
|
|
39
|
+
"repository": {
|
|
40
|
+
"type": "git",
|
|
41
|
+
"url": "git://github.com/SortableJS/Sortable.git"
|
|
42
|
+
},
|
|
43
|
+
"files": [
|
|
44
|
+
"Sortable.js",
|
|
45
|
+
"Sortable.min.js",
|
|
46
|
+
"index.d.ts",
|
|
47
|
+
"plugins.d.ts",
|
|
48
|
+
"modular/"
|
|
49
|
+
],
|
|
50
|
+
"keywords": [
|
|
51
|
+
"sortable",
|
|
52
|
+
"reorder",
|
|
53
|
+
"native",
|
|
54
|
+
"drag",
|
|
55
|
+
"drop"
|
|
56
|
+
],
|
|
57
|
+
"license": "MIT"
|
|
58
|
+
}
|
|
@@ -4,7 +4,6 @@ import { SortableEvent } from './index'
|
|
|
4
4
|
declare class SortablePlugin {}
|
|
5
5
|
declare class AutoScrollPlugin {}
|
|
6
6
|
declare class OnSpillPlugin {}
|
|
7
|
-
declare class MultiDragPlugin {}
|
|
8
7
|
declare class SwapPlugin {}
|
|
9
8
|
declare class FlatTreePlugin {}
|
|
10
9
|
|
|
@@ -73,38 +72,6 @@ export interface OnSpillOptions {
|
|
|
73
72
|
*/
|
|
74
73
|
onSpill?: ((evt: SortableEvent) => void) | undefined
|
|
75
74
|
}
|
|
76
|
-
export interface MultiDragOptions {
|
|
77
|
-
/**
|
|
78
|
-
* Enable the plugin
|
|
79
|
-
*/
|
|
80
|
-
multiDrag?: boolean | undefined
|
|
81
|
-
/**
|
|
82
|
-
* Class name for selected item
|
|
83
|
-
*/
|
|
84
|
-
selectedClass?: string | undefined
|
|
85
|
-
/**
|
|
86
|
-
* The key that must be down for multiple items to be selected.
|
|
87
|
-
* The default is null, meaning no key must be down.
|
|
88
|
-
* For special keys, such as the CTRL key,
|
|
89
|
-
* simply specify the option as 'CTRL' (casing does not matter).
|
|
90
|
-
*/
|
|
91
|
-
multiDragKey?: null | undefined | string
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
* If you don't want to deselect items on outside click
|
|
95
|
-
*/
|
|
96
|
-
avoidImplicitDeselect?: boolean | undefined
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* Called when an item is selected
|
|
100
|
-
*/
|
|
101
|
-
onSelect?: ((event: SortableEvent) => void) | undefined
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* Called when an item is deselected
|
|
105
|
-
*/
|
|
106
|
-
onDeselect?: ((event: SortableEvent) => void) | undefined
|
|
107
|
-
}
|
|
108
75
|
export interface SwapOptions {
|
|
109
76
|
/**
|
|
110
77
|
* Enable swap mode
|
package/Sortable.min.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! Sortable 1.15.6 - MIT | git://github.com/SortableJS/Sortable.git */
|
|
2
|
-
((t,e)=>{"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).Sortable=e()})(this,function(){function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=Array(e);n<e;n++)o[n]=t[n];return o}function h(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function p(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,_(o.key),o)}}function e(t,e,n){return e&&p(t.prototype,e),n&&p(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function f(t,e,n){(e=_(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n}function a(){return(a=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n,o=arguments[e];for(n in o)!{}.hasOwnProperty.call(o,n)||(t[n]=o[n])}return t}).apply(null,arguments)}function g(e,t){var n,o=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),o.push.apply(o,n)),o}function P(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?g(Object(n),!0).forEach(function(t){f(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function v(t,e){if(null==t)return{};var n,o=((t,e)=>{if(null==t)return{};var n,o={};for(n in t)if({}.hasOwnProperty.call(t,n)){if(-1!==e.indexOf(n))continue;o[n]=t[n]}return o})(t,e);if(Object.getOwnPropertySymbols)for(var i=Object.getOwnPropertySymbols(t),r=0;r<i.length;r++)n=i[r],-1===e.indexOf(n)&&{}.propertyIsEnumerable.call(t,n)&&(o[n]=t[n]);return o}function m(t){return(t=>{if(Array.isArray(t))return o(t)})(t)||(t=>{if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)})(t)||x(t)||(()=>{throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")})()}function _(t){t=((t,e)=>{if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0===n)return("string"===e?String:Number)(t);if("object"!=typeof(n=n.call(t,e||"default")))return n;throw new TypeError("@@toPrimitive must return a primitive value.")})(t,"string");return"symbol"==typeof t?t:t+""}function C(t){return(C="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function x(t,e){var n;if(t)return"string"==typeof t?o(t,e):"Map"===(n="Object"===(n={}.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:n)||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(t,e):void 0}function t(t){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(t)}var y=t(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),O=t(/Edge/i),V=t(/firefox/i),Z=t(/safari/i)&&!t(/chrome/i)&&!t(/android/i),$=t(/iP(ad|od|hone)/i),n=t(/chrome/i)&&t(/android/i),Q={capture:!1,passive:!1};function s(t,e,n){t.addEventListener(e,n,!y&&Q)}function r(t,e,n){t.removeEventListener(e,n,!y&&Q)}function J(t,e){if(e&&(">"===e[0]&&(e=e.substring(1)),t))try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch(t){return}}function tt(t){return t.host&&t!==document&&t.host.nodeType&&t.host!==t?t.host:t.parentNode}function I(t,e,n,o,i){if(t){n=n||document;do{if(t!==i&&(null!=e&&(">"!==e[0]||t.parentNode===n)&&J(t,e)||o&&t===n))return t}while(t!==n&&(t=tt(t)))}return null}var et,nt=/\s+/g;function N(t,e,n){var o;t&&e&&(t.classList?t.classList[n?"add":"remove"](e):(o=(" "+t.className+" ").replace(nt," ").replace(" "+e+" "," "),t.className=(o+(n?" "+e:"")).replace(nt," ")))}function k(t,e,n){var o=t&&t.style;if(o){if(void 0===n)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(n=t.currentStyle),void 0===e?n:n[e];o[e=e in o||-1!==e.indexOf("webkit")?e:"-webkit-"+e]=n+("string"==typeof n?"":"px")}}function ot(t,e){var n="";if("string"==typeof t)n=t;else do{var o=k(t,"transform")}while(o&&"none"!==o&&(n=o+" "+n),!e&&(t=t.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(n)}function it(t,e,n){if(t){var o=t.getElementsByTagName(e),i=0,r=o.length;if(n)for(;i<r;i++)n(o[i],i);return o}return[]}function T(){var t=document.scrollingElement;return t||document.documentElement}function X(t,e,n,o,i){if(t.getBoundingClientRect||t===window){var r,a,l,s,c,u,d=t!==window&&t.parentNode&&t!==T()?(a=(r=t.getBoundingClientRect()).top,l=r.left,s=r.bottom,c=r.right,u=r.height,r.width):(l=a=0,s=window.innerHeight,u=window.innerHeight,c=window.innerWidth);if((e||n)&&t!==window&&(i=i||t.parentNode,!y))do{if(i&&i.getBoundingClientRect&&("none"!==k(i,"transform")||n&&"static"!==k(i,"position"))){var h=i.getBoundingClientRect();a-=h.top+parseInt(k(i,"border-top-width")),l-=h.left+parseInt(k(i,"border-left-width")),s=a+r.height,c=l+r.width;break}}while(i=i.parentNode);return o&&t!==window&&(o=(e=ot(i||t))&&e.a,t=e&&e.d,e)&&(s=(a/=t)+(u/=t),c=(l/=o)+(d/=o)),{top:a,left:l,bottom:s,right:c,width:d,height:u}}}function rt(t,e,n){for(var o=A(t,!0),i=X(t)[e];o;){var r=X(o)[n];if(!("top"===n||"left"===n?r<=i:i<=r))return o;if(o===T())break;o=A(o,!1)}return!1}function at(t,e,n,o,i){for(var r=0,a=0,l=t.children;a<l.length;){if(l[a]!==i&&"none"!==l[a].style.display&&l[a]!==q.ghost&&(o||l[a]!==q.dragged)&&I(l[a],n.draggable,t,!1)){if(r===e)return l[a];r++}a++}return null}function lt(t,e){for(var n=t.lastElementChild;n&&(n===q.ghost||"none"===k(n,"display")||e&&!J(n,e));)n=n.previousElementSibling;return n||null}function L(t,e,n){var o=0;if(!t||!t.parentNode)return-1;for(;t=t.previousElementSibling;)"TEMPLATE"===t.nodeName.toUpperCase()||t===q.clone||e&&!J(t,e)||t===n||o++;return o}function st(t){var e=0,n=0,o=T();if(t)do{var i=ot(t),r=i.a}while(e+=t.scrollLeft*r,n+=t.scrollTop*i.d,t!==o&&(t=t.parentNode));return[e,n]}function A(t,e){if(t&&t.getBoundingClientRect){var n=t,o=!1;do{if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var i=k(n);if(n.clientWidth<n.scrollWidth&&("auto"==i.overflowX||"scroll"==i.overflowX)||n.clientHeight<n.scrollHeight&&("auto"==i.overflowY||"scroll"==i.overflowY)){if(!n.getBoundingClientRect||n===document.body)return T();if(o||e)return n;o=!0}}}while(n=n.parentNode)}return T()}function ct(t,e){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)}function ut(e,n){return function(){var t;et||(1===(t=arguments).length?e.call(this,t[0]):e.apply(this,t),et=setTimeout(function(){et=void 0},n))}}function dt(t,e,n){t.scrollLeft+=e,t.scrollTop+=n}function ht(t){var e=window.Polymer,n=window.jQuery||window.Zepto;return e&&e.dom?e.dom(t).cloneNode(!0):n?n(t).clone(!0)[0]:t.cloneNode(!0)}function pt(t,e){k(t,"position","absolute"),k(t,"top",e.top),k(t,"left",e.left),k(t,"width",e.width),k(t,"height",e.height)}function ft(t){k(t,"position",""),k(t,"top",""),k(t,"left",""),k(t,"width",""),k(t,"height","")}function gt(n,o,i,r){var a={};return Array.from(n.children).forEach(function(t){var e;I(t,o.draggable,n,!1,r)&&!t.animated&&t!==i&&(t=X(t),a.left=Math.min(null!=(e=a.left)?e:1/0,t.left),a.top=Math.min(null!=(e=a.top)?e:1/0,t.top),a.right=Math.max(null!=(e=a.right)?e:-1/0,t.right),a.bottom=Math.max(null!=(e=a.bottom)?e:-1/0,t.bottom))}),a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}var R="Sortable"+(new Date).getTime();function vt(){var e,o=[];return{captureAnimationState:function(){o=[],this.options.animation&&[].slice.call(this.el.children).forEach(function(t){var e,n;"none"!==k(t,"display")&&t!==q.ghost&&(o.push({target:t,rect:X(t)}),e=P({},o[o.length-1].rect),t.thisAnimationDuration&&(n=ot(t,!0))&&(e.top-=n.f,e.left-=n.e),t.fromRect=e)})},addAnimationState:function(t){o.push(t)},removeAnimationState:function(t){o.splice(((t,e)=>{for(var n in t)if(t.hasOwnProperty(n))for(var o in e)if(e.hasOwnProperty(o)&&e[o]===t[n][o])return Number(n);return-1})(o,{target:t}),1)},animateAll:function(t){var c,u,d=this;this.options.animation?(c=!1,u=0,o.forEach(function(t){var e,n=0,o=t.target,i=o.fromRect,r=X(o),a=o.prevFromRect,l=o.prevToRect,t=t.rect,s=ot(o,!0);s&&(r.top-=s.f,r.left-=s.e),o.toRect=r,o.thisAnimationDuration&&ct(a,r)&&!ct(i,r)&&(t.top-r.top)/(t.left-r.left)==(i.top-r.top)/(i.left-r.left)&&(s=t,a=a,l=l,e=d.options,n=Math.sqrt(Math.pow(a.top-s.top,2)+Math.pow(a.left-s.left,2))/Math.sqrt(Math.pow(a.top-l.top,2)+Math.pow(a.left-l.left,2))*e.animation),ct(r,i)||(o.prevFromRect=i,o.prevToRect=r,n=n||d.options.animation,d.animate(o,t,r,n)),n&&(c=!0,u=Math.max(u,n),clearTimeout(o.animationResetTimer),o.animationResetTimer=setTimeout(function(){o.animationTime=0,o.prevFromRect=null,o.fromRect=null,o.prevToRect=null,o.thisAnimationDuration=null},n),o.thisAnimationDuration=n)}),clearTimeout(e),c?e=setTimeout(function(){"function"==typeof t&&t()},u):"function"==typeof t&&t(),o=[]):(clearTimeout(e),"function"==typeof t&&t())},animate:function(t,e,n,o){var i,r;o&&(k(t,"transition",""),k(t,"transform",""),r=(i=ot(this.el))&&i.a,i=i&&i.d,r=(e.left-n.left)/(r||1),e=(e.top-n.top)/(i||1),t.animatingX=!!r,t.animatingY=!!e,k(t,"transform","translate3d("+r+"px,"+e+"px,0)"),this.forRepaintDummy=t.offsetWidth,k(t,"transition","transform "+o+"ms"+(this.options.easing?" "+this.options.easing:"")),k(t,"transform","translate3d(0,0,0)"),"number"==typeof t.animated&&clearTimeout(t.animated),t.animated=setTimeout(function(){k(t,"transition",""),k(t,"transform",""),t.animated=!1,t.animatingX=!1,t.animatingY=!1},o))}}}var mt=[],bt={initializeByDefault:!0},yt={mount:function(e){for(var t in bt)!bt.hasOwnProperty(t)||t in e||(e[t]=bt[t]);mt.forEach(function(t){if(t.pluginName===e.pluginName)throw"Sortable: Cannot mount plugin ".concat(e.pluginName," more than once")}),mt.push(e)},pluginEvent:function(e,n,o){var t=this,i=(this.eventCanceled=!1,o.cancel=function(){t.eventCanceled=!0},e+"Global");mt.forEach(function(t){n[t.pluginName]&&(n[t.pluginName][i]&&n[t.pluginName][i](P({sortable:n},o)),n.options[t.pluginName])&&n[t.pluginName][e]&&n[t.pluginName][e](P({sortable:n},o))})},initializePlugins:function(n,o,i,t){for(var e in mt.forEach(function(t){var e=t.pluginName;(n.options[e]||t.initializeByDefault)&&((t=new t(n,o,n.options)).sortable=n,t.options=n.options,a(i,(n[e]=t).defaults))}),n.options){var r;n.options.hasOwnProperty(e)&&void 0!==(r=this.modifyOption(n,e,n.options[e]))&&(n.options[e]=r)}},getEventProperties:function(e,n){var o={};return mt.forEach(function(t){"function"==typeof t.eventProperties&&a(o,t.eventProperties.call(n[t.pluginName],e))}),o},modifyOption:function(e,n,o){var i;return mt.forEach(function(t){e[t.pluginName]&&t.optionListeners&&"function"==typeof t.optionListeners[n]&&(i=t.optionListeners[n].call(e[t.pluginName],o))}),i}};function Et(t){var e=t.sortable,n=t.rootEl,o=t.name,i=t.targetEl,r=t.cloneEl,a=t.toEl,l=t.fromEl,s=t.oldIndex,c=t.newIndex,u=t.oldDraggableIndex,d=t.newDraggableIndex,h=t.originalEvent,p=t.putSortable,t=t.extraEventProperties;if(e=e||n&&n[R]){var f,g,v=e.options,m="on"+o.charAt(0).toUpperCase()+o.substr(1),b=(!window.CustomEvent||y||O?(f=document.createEvent("Event")).initEvent(o,!0,!0):f=new CustomEvent(o,{bubbles:!0,cancelable:!0}),f.to=a||n,f.from=l||n,f.item=i||n,f.clone=r,f.oldIndex=s,f.newIndex=c,f.oldDraggableIndex=u,f.newDraggableIndex=d,f.originalEvent=h,f.pullMode=p?p.lastPutMode:void 0,P(P({},t),yt.getEventProperties(o,e)));for(g in b)f[g]=b[g];n&&n.dispatchEvent(f),v[m]&&v[m].call(e,f)}}function Y(t,e){var n=(o=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{}).evt,o=v(o,wt);yt.pluginEvent.bind(q)(t,e,P({dragEl:F,originalDragEl:j,originalDragElDisplay:Tt,parentEl:H,ghostEl:K,rootEl:W,nextEl:At,lastDownEl:Mt,cloneEl:l,cloneHidden:i,dragStarted:Bt,putSortable:U,activeSortable:q.active,originalEvent:n,oldIndex:Pt,oldDraggableIndex:It,newIndex:G,newDraggableIndex:z,hideGhostForTarget:_t,unhideGhostForTarget:Ct,cloneNowHidden:function(){i=!0},cloneNowShown:function(){i=!1},dispatchSortableEvent:function(t){B({sortable:e,name:t,originalEvent:n})}},o))}var wt=["evt"];function B(t){Et(P({putSortable:U,cloneEl:l,targetEl:j||F,rootEl:W,oldIndex:Pt,oldDraggableIndex:It,newIndex:G,newDraggableIndex:z},t))}function Dt(t,e){var n,o=k(t),i=parseInt(o.width)-parseInt(o.paddingLeft)-parseInt(o.paddingRight)-parseInt(o.borderLeftWidth)-parseInt(o.borderRightWidth),r=at(t,0,e,!1,j),t=at(t,1,e,!1,j),e=r&&k(r),a=t&&k(t),l=e&&parseInt(e.marginLeft)+parseInt(e.marginRight)+X(r).width,s=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+X(t).width;return"flex"===o.display?"column"===o.flexDirection||"column-reverse"===o.flexDirection?"vertical":"horizontal":"grid"===o.display?o.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal":r&&e.float&&"none"!==e.float?(n="left"===e.float?"left":"right",!t||"both"!==a.clear&&a.clear!==n?"horizontal":"vertical"):r&&("block"===e.display||"flex"===e.display||"table"===e.display||"grid"===e.display||i<=l&&"none"===o[Jt]||t&&"none"===o[Jt]&&i<l+s)?"vertical":"horizontal"}function St(t){function l(r,a){return function(t,e,n,o){var i=t.options.group.name&&e.options.group.name&&t.options.group.name===e.options.group.name;return!(null!=r||!a&&!i)||null!=r&&!1!==r&&(a&&"clone"===r?r:"function"==typeof r?l(r(t,e,n,o),a)(t,e,n,o):(i=(a?t:e).options.group.name,!0===r||"string"==typeof r&&r===i||r.join&&-1<r.indexOf(i)))}}var e={},n=t.group;n&&"object"==C(n)||(n={name:n}),e.name=n.name,e.checkPull=l(n.pull,!0),e.checkPut=l(n.put),e.revertClone=n.revertClone,t.group=e}function _t(){!ee&&K&&k(K,"display","none")}function Ct(){!ee&&K&&k(K,"display","")}function xt(t){if(F){t=t.touches?t.touches[0]:t;i=t.clientX,r=t.clientY,Gt.some(function(t){var e,n,o=t[R].options.emptyInsertThreshold;if(o&&!lt(t))return n=X(t),e=i>=n.left-o&&i<=n.right+o,n=n.top-o<=r&&r<=n.bottom+o,e&&n?a=t:void 0});var e=a;if(e){var n,o={};for(n in t)t.hasOwnProperty(n)&&(o[n]=t[n]);o.target=o.rootEl=e,o.preventDefault=void 0,o.stopPropagation=void 0,e[R]._onDragOver(o)}}var i,r,a}function Ot(t){F&&F.parentNode[R]._isOutsideThisEl(t.target)}var F,j,Tt,H,K,W,At,Mt,l,i,Pt,G,It,z,Nt,U,kt,c,Xt,Lt,Rt,Yt,Bt,Ft,jt,Ht,u,Kt=!1,Wt=!1,Gt=[],zt=!1,Ut=!1,qt=[],Vt=!1,Zt=[],$t="undefined"!=typeof document,Qt=$,Jt=O||y?"cssFloat":"float",te=$t&&!n&&!$&&"draggable"in document.createElement("div"),ee=(()=>{var t;if($t)return!y&&((t=document.createElement("x")).style.cssText="pointer-events:auto","auto"===t.style.pointerEvents)})();$t&&!n&&document.addEventListener("click",function(t){if(Wt)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),Wt=!1},!0);function q(t,e){if(!t||!t.nodeType||1!==t.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));this.el=t,this.options=e=a({},e),t[R]=this;var n,o,i={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(t.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Dt(t,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,getGhostFallback:void 0,getPlaceholder:void 0,getPlaceholderOnMove:void 0,tree:!1,treeItemLevelAttr:"data-level",treeIndentThreshold:10,animation:0,easing:null,setData:function(t,e){t.setData("Text",e.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==q.supportPointer&&"PointerEvent"in window&&(!Z||$),emptyInsertThreshold:5};for(n in yt.initializePlugins(this,t,i),i)n in e||(e[n]=i[n]);for(o in St(e),this)"_"===o.charAt(0)&&"function"==typeof this[o]&&(this[o]=this[o].bind(this));this.nativeDraggable=!e.forceFallback&&te,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)),Gt.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),a(this,vt())}q.prototype={constructor:q,_isOutsideThisEl:function(t){this.el.contains(t)||t===this.el||(Ft=null)},_getDirection:function(t,e){return"function"==typeof this.options.direction?this.options.direction.call(this,t,e,j||F):this.options.direction},_onTapStart:function(e){if(e.cancelable){var n=this,o=this.el,t=this.options,i=t.preventOnFilter,r=e.type,a=e.touches&&e.touches[0]||e.pointerType&&"touch"===e.pointerType&&e,l=(a||e).target,s=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||l,c=t.filter,u=o;Zt.length=0;for(var d=u.getElementsByTagName("input"),h=d.length;h--;){var p=d[h];p.checked&&Zt.push(p)}if(!F&&!(/mousedown|pointerdown/.test(r)&&0!==e.button||t.disabled)&&!s.isContentEditable&&(this.nativeDraggable||!Z||!l||"SELECT"!==l.tagName.toUpperCase())&&!((l=I(l,t.draggable,o,!1,j))&&l.animated||Mt===l)){if(Pt=L(l,void 0,j),It=L(l,t.draggable,j),"function"==typeof c){if(c.call(this,e,l,this))return B({sortable:n,rootEl:s,name:"filter",targetEl:l,toEl:o,fromEl:o}),Y("filter",n,{evt:e}),void(i&&e.preventDefault())}else if(c=c&&c.split(",").some(function(t){if(t=I(s,t.trim(),o,!1,j))return B({sortable:n,rootEl:t,name:"filter",targetEl:l,fromEl:o,toEl:o}),Y("filter",n,{evt:e}),!0}))return void(i&&e.preventDefault());t.handle&&!I(s,t.handle,o,!1,j)||this._prepareDragStart(e,a,l)}}},_prepareDragStart:function(t,e,n){var o,i=this,r=i.el,a=i.options,l=r.ownerDocument;n&&!F&&n.parentNode===r&&(o=X(n),W=r,H=(F=n).parentNode,At=F.nextSibling,Mt=n,Nt=a.group,kt={target:q.dragged=F,clientX:(e||t).clientX,clientY:(e||t).clientY},Rt=kt.clientX-o.left,Yt=kt.clientY-o.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,F.style["will-change"]="all",r=function(){Y("delayEnded",i,{evt:t}),q.eventCanceled?i._onDrop():(i._disableDelayedDragEvents(),!V&&i.nativeDraggable&&(F.draggable=!0),i._triggerDragStart(t,e),B({sortable:i,name:"choose",originalEvent:t}),N(F,a.chosenClass,!0))},a.ignore.split(",").forEach(function(t){it(F,t.trim(),ie)}),s(l,"dragover",xt),s(l,"mousemove",xt),s(l,"touchmove",xt),a.supportPointer?(s(l,"pointerup",i._onDrop),this.nativeDraggable||s(l,"pointercancel",i._onDrop)):(s(l,"mouseup",i._onDrop),s(l,"touchend",i._onDrop),s(l,"touchcancel",i._onDrop)),V&&this.nativeDraggable&&(this.options.touchStartThreshold=4,F.draggable=!0),Y("delayStart",this,{evt:t}),!a.delay||a.delayOnTouchOnly&&!e||this.nativeDraggable&&(O||y)?r():q.eventCanceled?this._onDrop():(a.supportPointer?(s(l,"pointerup",i._disableDelayedDrag),s(l,"pointercancel",i._disableDelayedDrag)):(s(l,"mouseup",i._disableDelayedDrag),s(l,"touchend",i._disableDelayedDrag),s(l,"touchcancel",i._disableDelayedDrag)),s(l,"mousemove",i._delayedDragTouchMoveHandler),s(l,"touchmove",i._delayedDragTouchMoveHandler),a.supportPointer&&s(l,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(r,a.delay)))},_delayedDragTouchMoveHandler:function(t){t=t.touches?t.touches[0]:t;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){F&&ie(F),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;r(t,"mouseup",this._disableDelayedDrag),r(t,"touchend",this._disableDelayedDrag),r(t,"touchcancel",this._disableDelayedDrag),r(t,"pointerup",this._disableDelayedDrag),r(t,"pointercancel",this._disableDelayedDrag),r(t,"mousemove",this._delayedDragTouchMoveHandler),r(t,"touchmove",this._delayedDragTouchMoveHandler),r(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,e){e=e||"touch"==t.pointerType&&t,!this.nativeDraggable||e?this.options.supportPointer?s(document,"pointermove",this._onTouchMove):s(document,e?"touchmove":"mousemove",this._onTouchMove):(s(F,"dragend",this),s(W,"dragstart",this._onDragStart));try{document.selection?ae(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch(t){}},_getPlaceholder:function(){"function"==typeof this.options.getPlaceholder&&(Tt=(j=F).style.display,(F=this.options.getPlaceholder(F))&&j&&(j.after(F),k(j,"display","none"),k(j,"transform",""),N(j,this.options.dragClass,!1),N(j,this.options.ghostClass,!1),N(j,this.options.chosenClass,!1)),Y("getPlaceholder",this))},_removeClonedSelectedItem:function(){"function"!=typeof this.options.getPlaceholder&&"function"!=typeof this.options.getPlaceholderOnMove||F&&j&&(k(j,"display",Tt||""),F.remove())},_replacePlaceholder:function(t){var e=F.parentNode;e?e.replaceChild(t,F):F.remove(),F=t},_getPlaceholderOnMove:function(t,e,n,o,i,r){"function"==typeof this.options.getPlaceholderOnMove&&(t=this.options.getPlaceholderOnMove(ne(W,t,j||F,e,n,o,i,r)))&&this._replacePlaceholder(t)},_dragStarted:function(t,e){var n;Kt=!1,W&&F?(this._getPlaceholder(),Y("dragStarted",this,{evt:e}),this.nativeDraggable&&s(document,"dragover",Ot),n=this.options,t||N(F,n.dragClass,!1),N(F,n.ghostClass,!0),q.active=this,t&&this._appendGhost(),B({sortable:this,name:"start",originalEvent:e})):this._nulling()},_emulateDragOver:function(){if(c){this._lastX=c.clientX,this._lastY=c.clientY,_t();for(var t=document.elementFromPoint(c.clientX,c.clientY),e=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(c.clientX,c.clientY))!==e;)e=t;if(F.parentNode[R]._isOutsideThisEl(t),e)do{if(e[R])if(e[R]._onDragOver({clientX:c.clientX,clientY:c.clientY,target:t,rootEl:e})&&!this.options.dragoverBubble)break}while(e=tt(t=e));Ct()}},_onTouchMove:function(t){if(kt){var e=this.options,n=e.fallbackTolerance,e=e.fallbackOffset,o=t.touches?t.touches[0]:t,i=K&&ot(K,!0),r=K&&i&&i.a,a=K&&i&&i.d,l=Qt&&u&&st(u),r=(o.clientX-kt.clientX+e.x)/(r||1)+(l?l[0]-qt[0]:0)/(r||1),e=(o.clientY-kt.clientY+e.y)/(a||1)+(l?l[1]-qt[1]:0)/(a||1);if(!q.active&&!Kt){if(n&&Math.max(Math.abs(o.clientX-this._lastX),Math.abs(o.clientY-this._lastY))<n)return;this._onDragStart(t,!0)}K&&(i?(i.e+=r-(Xt||0),i.f+=e-(Lt||0)):i={a:1,b:0,c:0,d:1,e:r,f:e},l="matrix(".concat(i.a,",").concat(i.b,",").concat(i.c,",").concat(i.d,",").concat(i.e,",").concat(i.f,")"),k(K,"webkitTransform",l),k(K,"mozTransform",l),k(K,"msTransform",l),k(K,"transform",l),Xt=r,Lt=e,c=o),t.cancelable&&t.preventDefault()}},_appendGhost:function(){if(!K){var t=this.options.fallbackOnBody?document.body:W,e=X(F,!0,Qt,!0,t),n=this.options;if(Qt){for(u=t;"static"===k(u,"position")&&"none"===k(u,"transform")&&u!==document;)u=u.parentNode;u!==document.body&&u!==document.documentElement?(u===document&&(u=T()),e.top+=u.scrollTop,e.left+=u.scrollLeft):u=T(),qt=st(u)}N(K=this.options.getGhostFallback&&"function"==typeof this.options.getGhostFallback?this.options.getGhostFallback(F):F.cloneNode(!0),n.ghostClass,!1),N(K,n.fallbackClass,!0),N(K,n.dragClass,!0),k(K,"transition",""),k(K,"transform",""),k(K,"box-sizing","border-box"),k(K,"margin",0),k(K,"top",e.top),k(K,"left",e.left),k(K,"width",e.width),k(K,"height",e.height),k(K,"opacity","0.8"),k(K,"position",Qt?"absolute":"fixed"),k(K,"zIndex","100000"),k(K,"pointerEvents","none"),q.ghost=K,t.appendChild(K),k(K,"transform-origin",Rt/parseInt(K.style.width)*100+"% "+Yt/parseInt(K.style.height)*100+"%")}},_onDragStart:function(t,e){var n=this,o=t.dataTransfer,i=n.options;Y("dragStart",this,{evt:t}),q.eventCanceled?this._onDrop():(Y("setupClone",this),q.eventCanceled||((l=ht(F)).removeAttribute("id"),l.draggable=!1,l.style["will-change"]="",this._hideClone(),N(l,this.options.chosenClass,!1),q.clone=l),n.cloneId=ae(function(){Y("clone",n),q.eventCanceled||(n.options.removeCloneOnHide||W.insertBefore(l,F),n._hideClone(),B({sortable:n,name:"clone"}))}),e||N(F,i.dragClass,!0),e?(Wt=!0,n._loopId=setInterval(n._emulateDragOver,50)):(r(document,"mouseup",n._onDrop),r(document,"touchend",n._onDrop),r(document,"touchcancel",n._onDrop),o&&(o.effectAllowed="move",i.setData)&&i.setData.call(n,o,F),s(document,"drop",n),k(F,"transform","translateZ(0)")),Kt=!0,n._dragStartId=ae(n._dragStarted.bind(n,e,t)),s(document,"selectstart",n),Bt=!0,window.getSelection().removeAllRanges(),Z&&k(document.body,"user-select","none"))},_onDragOver:function(n){var o,i,r,a=this.el,l=n.target,e=this.options,t=e.group,s=q.active,c=Nt===t,u=e.sort,d=U||s,h=this,p=!1;if(!Vt){if(void 0!==n.preventDefault&&n.cancelable&&n.preventDefault(),l=I(l,e.draggable,a,!0,j),O("dragOver"),q.eventCanceled)return p;if(F.contains(n.target)||l.animated&&l.animatingX&&l.animatingY||h._ignoreWhileAnimating===l)return A(!1);if(Wt=!1,s&&!e.disabled&&(c?u||(i=H!==W):U===this||(this.lastPutMode=Nt.checkPull(this,s,j||F,n))&&t.checkPut(this,s,j||F,n))){if(r="vertical"===this._getDirection(n,l),o=X(F),O("dragOverValid"),q.eventCanceled)return p;if(i)return H=W,T(),this._hideClone(),O("revert"),q.eventCanceled||(At?W.insertBefore(F,At):W.appendChild(F)),A(!0);t=lt(a,e.draggable);if(t&&(y=n,C=r,E=X(lt((f=this).el,f.options.draggable)),f=gt(f.el,f.options,K,j),!(C?y.clientX>f.right+10||y.clientY>E.bottom&&y.clientX>E.left:y.clientY>f.bottom+10||y.clientX>E.right&&y.clientY>E.top)||t.animated)){if(t&&(C=n,f=r,E=X(at((y=this).el,0,y.options,!0,j)),y=gt(y.el,y.options,K,j),f?C.clientX<y.left-10||C.clientY<E.top&&C.clientX<E.right:C.clientY<y.top-10||C.clientY<E.bottom&&C.clientX<E.left)){var f=at(a,0,e,!0,j);if(f===F)return A(!1);if(b=X(l=f),!1!==oe(W,a,j||F,o,l,b,n,!1))return this._getPlaceholderOnMove(a,o,l,b,n,!1),T(),a.insertBefore(F,f),H=a,M(),A(!0)}else if(l.parentNode===a){var g,v,m,b=X(l),y=F.parentNode!==a,E=(C=F.animated&&F.toRect||o,E=l.animated&&l.toRect||b,S=(f=r)?C.left:C.top,w=f?C.right:C.bottom,C=f?C.width:C.height,x=f?E.left:E.top,D=f?E.right:E.bottom,f=f?E.width:E.height,!(S===x||w===D||S+C/2===x+f/2)),w=r?"top":"left",D=rt(l,"top","top")||rt(F,"top","top"),S=D?D.scrollTop:void 0;if(Ft!==l&&(v=b[w],zt=!1,Ut=!E&&e.invertSwap||y),0!==(g=((t,e,n,o,i,r,a,l)=>{var t=o?t.clientY:t.clientX,s=o?n.height:n.width,c=o?n.top:n.left,o=o?n.bottom:n.right,n=!1;if(!a)if(l&&Ht<s*i){if(zt=!zt&&(1===jt?c+s*r/2<t:t<o-s*r/2)?!0:zt)n=!0;else if(1===jt?t<c+Ht:o-Ht<t)return-jt}else if(c+s*(1-i)/2<t&&t<o-s*(1-i)/2){l=e;return L(F,void 0,j)<L(l,void 0,j)?1:-1;return}return(n=n||a)&&(t<c+s*r/2||o-s*r/2<t)?c+s/2<t?1:-1:0})(n,l,b,r,E?1:e.swapThreshold,null==e.invertedSwapThreshold?e.swapThreshold:e.invertedSwapThreshold,Ut,Ft===l)))for(var _=L(F,void 0,j);(m=H.children[_-=g])&&("none"===k(m,"display")||m===K););if(0===g||m===l)return A(!1);var C=!1,x=oe(W,a,j||F,o,Ft=l,b,n,C=1===(jt=g));if(!1!==x)return 1!==x&&-1!==x||(C=1===x),Vt=!0,setTimeout(re,30),T(),this._getPlaceholderOnMove(a,o,l,b,n,C),f=l.nextElementSibling,C&&!f?a.appendChild(F):l.parentNode.insertBefore(F,C?f:l),D&&dt(D,0,S-D.scrollTop),H=F.parentNode,void 0===v||Ut||(Ht=Math.abs(v-X(l)[w])),M(),A(!0)}}else{if(t===F)return A(!1);if((l=t&&a===n.target?t:l)&&(b=X(l)),!1!==oe(W,a,j||F,o,l,b,n,!!l))return T(),this._getPlaceholderOnMove(a,o,l,b,n,Boolean(l)),t&&t.nextSibling?a.insertBefore(F,t.nextSibling):a.appendChild(F),H=a,M(),A(!0)}if(a.contains(F))return A(!1)}return!1}function O(t,e){Y(t,h,P({evt:n,isOwner:c,axis:r?"vertical":"horizontal",revert:i,dragRect:o,targetRect:b,canSort:u,fromSortable:d,target:l,completed:A,onMove:function(t,e){return oe(W,a,j||F,o,t,X(t),n,e)},changed:M},e))}function T(){O("dragOverAnimationCapture"),h.captureAnimationState(),h!==d&&d.captureAnimationState()}function A(t){return O("dragOverCompleted",{insertion:t}),t&&(c?s._hideClone():s._showClone(h),h!==d&&(N(F,(U||s).options.ghostClass,!1),N(F,e.ghostClass,!0)),U!==h&&h!==q.active?U=h:h===q.active&&(U=U&&null),d===h&&(h._ignoreWhileAnimating=l),h.animateAll(function(){O("dragOverAnimationComplete"),h._ignoreWhileAnimating=null}),h!==d)&&(d.animateAll(),d._ignoreWhileAnimating=null),(l===F&&!F.animated||l===a&&!l.animated)&&(Ft=null),e.dragoverBubble||n.rootEl||l===document||(F.parentNode[R]._isOutsideThisEl(n.target),t)||xt(n),!e.dragoverBubble&&n.stopPropagation&&n.stopPropagation(),p=!0}function M(){G=L(F,void 0,j),z=L(F,e.draggable,j),B({sortable:h,name:"change",toEl:a,newIndex:G,newDraggableIndex:z,originalEvent:n})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){r(document,"mousemove",this._onTouchMove),r(document,"touchmove",this._onTouchMove),r(document,"pointermove",this._onTouchMove),r(document,"dragover",xt),r(document,"mousemove",xt),r(document,"touchmove",xt)},_offUpEvents:function(){var t=this.el.ownerDocument;r(t,"mouseup",this._onDrop),r(t,"touchend",this._onDrop),r(t,"pointerup",this._onDrop),r(t,"pointercancel",this._onDrop),r(t,"touchcancel",this._onDrop),r(document,"selectstart",this)},_onDrop:function(t){var e=this.el,n=this.options;G=L(F,void 0,j),z=L(F,n.draggable,j),Y("drop",this,{evt:t}),H=F&&F.parentNode,G=L(F,void 0,j),z=L(F,n.draggable,j),q.eventCanceled||(zt=Ut=Kt=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),le(this.cloneId),le(this._dragStartId),this.nativeDraggable&&(r(document,"drop",this),r(e,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),Z&&k(document.body,"user-select",""),k(F,"transform",""),t&&(Bt&&(t.cancelable&&t.preventDefault(),n.dropBubble||t.stopPropagation()),K&&K.parentNode&&K.parentNode.removeChild(K),(W===H||U&&"clone"!==U.lastPutMode)&&l&&l.parentNode&&l.parentNode.removeChild(l),F)&&(this.nativeDraggable&&r(F,"dragend",this),ie(F),F.style["will-change"]="",Bt&&!Kt&&N(F,(U||this).options.ghostClass,!1),N(F,this.options.chosenClass,!1),B({sortable:this,name:"unchoose",toEl:H,newIndex:null,newDraggableIndex:null,originalEvent:t}),W!==H?(0<=G&&(B({rootEl:H,name:"add",toEl:H,fromEl:W,originalEvent:t}),B({sortable:this,name:"remove",toEl:H,originalEvent:t}),B({rootEl:H,name:"sort",toEl:H,fromEl:W,originalEvent:t}),B({sortable:this,name:"sort",toEl:H,originalEvent:t})),U&&U.save()):G!==Pt&&0<=G&&(B({sortable:this,name:"update",toEl:H,originalEvent:t}),B({sortable:this,name:"sort",toEl:H,originalEvent:t})),q.active)&&(null!=G&&-1!==G||(G=Pt,z=It),B({sortable:this,name:"end",toEl:H,originalEvent:t}),this.save())),this._nulling()},_nulling:function(){Y("nulling",this),this._removeClonedSelectedItem(),W=F=j=Tt=H=K=At=l=Mt=i=kt=c=Bt=G=z=Pt=It=Ft=jt=U=Nt=q.dragged=q.ghost=q.clone=q.active=null;var e=this.el;Zt.forEach(function(t){e.contains(t)&&(t.checked=!0)}),Zt.length=Xt=Lt=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":var e;F&&(this._onDragOver(t),(e=t).dataTransfer&&(e.dataTransfer.dropEffect="move"),e.cancelable)&&e.preventDefault();break;case"selectstart":t.preventDefault()}},toArray:function(){for(var t,e=[],n=this.el.children,o=0,i=n.length,r=this.options;o<i;o++)I(t=n[o],r.draggable,this.el,!1,j)&&e.push(t.getAttribute(r.dataIdAttr)||(t=>{for(var e=t.tagName+t.className+t.src+t.href+t.textContent,n=e.length,o=0;n--;)o+=e.charCodeAt(n);return o.toString(36)})(t));return e},sort:function(t,e){var n={},o=this.el;this.toArray().forEach(function(t,e){e=o.children[e];I(e,this.options.draggable,o,!1,j)&&(n[t]=e)},this),e&&this.captureAnimationState(),t.forEach(function(t){n[t]&&(o.removeChild(n[t]),o.appendChild(n[t]))}),e&&this.animateAll()},save:function(){var t=this.options.store;t&&t.set&&t.set(this)},closest:function(t,e){return I(t,e||this.options.draggable,this.el,!1,j)},option:function(t,e){var n=this.options;if(void 0===e)return n[t];var o=yt.modifyOption(this,t,e);n[t]=void 0!==o?o:e,"group"===t&&St(n)},destroy:function(){Y("destroy",this);var t=this.el;t[R]=null,r(t,"mousedown",this._onTapStart),r(t,"touchstart",this._onTapStart),r(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(r(t,"dragover",this),r(t,"dragenter",this)),Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),function(t){t.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),Gt.splice(Gt.indexOf(this.el),1),this.el=t=null},_hideClone:function(){i||(Y("hideClone",this),q.eventCanceled)||(k(l,"display","none"),this.options.removeCloneOnHide&&l.parentNode&&l.parentNode.removeChild(l),i=!0)},_showClone:function(t){"clone"!==t.lastPutMode?this._hideClone():i&&(Y("showClone",this),q.eventCanceled||("function"!=typeof this.options.getPlaceholder&&"function"!=typeof this.options.getPlaceholderOnMove&&(F.parentNode!=W||this.options.group.revertClone?At?W.insertBefore(l,At):W.appendChild(l):W.insertBefore(l,F)),this.options.group.revertClone&&this.animate(F,l),k(l,"display",""),i=!1))}};var ne=function(t,e,n,o,i,r,a,l){var s;return!window.CustomEvent||y||O?(s=document.createEvent("Event")).initEvent("move",!0,!0):s=new CustomEvent("move",{bubbles:!0,cancelable:!0}),s.to=e,s.from=t,s.dragged=n,s.draggedRect=o,s.related=i||e,s.relatedRect=r||X(e),s.willInsertAfter=l,s.originalEvent=a,s};function oe(t,e,n,o,i,r,a,l){var s,c=t[R],u=c.options.onMove,e=ne(t,e,n,o,i,r,a,l);return t.dispatchEvent(e),s=u?u.call(c,e):s}function ie(t){t.draggable=!1}function re(){Vt=!1}function ae(t){return setTimeout(t,0)}function le(t){return clearTimeout(t)}$t&&s(document,"touchmove",function(t){(q.active||Kt)&&t.cancelable&&t.preventDefault()}),q.utils={on:s,off:r,css:k,find:it,is:function(t,e){return!!I(t,e,t,!1,j)},extend:function(t,e){if(t&&e)for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t},throttle:ut,closest:I,toggleClass:N,clone:ht,index:L,nextTick:ae,cancelNextTick:le,detectDirection:Dt,getChild:at,expando:R},q.get=function(t){return t[R]},q.mount=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];(e=e[0].constructor===Array?e[0]:e).forEach(function(t){if(!t.prototype||!t.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(t));t.utils&&(q.utils=P(P({},q.utils),t.utils)),yt.mount(t)})},q.create=function(t,e){return new q(t,e)};var se,ce,ue,de,he,pe,M=[],fe=!(q.version="1.15.6"),n=(()=>e(function t(e){h(this,t),this.sortable=e,this.options=e.options,this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};var n,o=((t,e)=>{var n,o,i,r,a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(a)return i=!(o=!0),{s:function(){a=a.call(t)},n:function(){var t=a.next();return o=t.done,t},e:function(t){i=!0,n=t},f:function(){try{o||null==a.return||a.return()}finally{if(i)throw n}}};if(Array.isArray(t)||(a=x(t))||e&&t&&"number"==typeof t.length)return a&&(t=a),r=0,{s:e=function(){},n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:e};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")})(Object.getOwnPropertyNames(Object.getPrototypeOf(this)));try{for(o.s();!(n=o.n()).done;){var i=n.value;"_"===i.charAt(0)&&"function"==typeof this[i]&&(this[i]=this[i].bind(this))}}catch(t){o.e(t)}finally{o.f()}},[{key:"dragStarted",value:function(t){t=t.originalEvent;this.sortable.nativeDraggable?s(document,"dragover",this._handleAutoScroll):this.options.supportPointer?s(document,"pointermove",this._handleFallbackAutoScroll):t.touches?s(document,"touchmove",this._handleFallbackAutoScroll):s(document,"mousemove",this._handleFallbackAutoScroll)}},{key:"dragOverCompleted",value:function(t){t=t.originalEvent;this.options.dragOverBubble||t.rootEl||this._handleAutoScroll(t)}},{key:"drop",value:function(){this.sortable.nativeDraggable?r(document,"dragover",this._handleAutoScroll):(r(document,"pointermove",this._handleFallbackAutoScroll),r(document,"touchmove",this._handleFallbackAutoScroll),r(document,"mousemove",this._handleFallbackAutoScroll)),ve(),ge(),clearTimeout(et),et=void 0}},{key:"nulling",value:function(){he=ce=se=fe=pe=ue=de=null,M.length=0}},{key:"_handleFallbackAutoScroll",value:function(t){this._handleAutoScroll(t,!0)}},{key:"_handleAutoScroll",value:function(e,n){var o,i=this,r=(e.touches?e.touches[0]:e).clientX,a=(e.touches?e.touches[0]:e).clientY,t=document.elementFromPoint(r,a);he=e,n||this.options.forceAutoScrollFallback||O||y||Z?(ye(e,this.options,t,n),o=A(t,!0),!fe||pe&&r===ue&&a===de||(pe&&ve(),pe=setInterval(function(){var t=A(document.elementFromPoint(r,a),!0);t!==o&&(o=t,ge()),ye(e,i.options,t,n)},10),ue=r,de=a)):this.options.bubbleScroll&&A(t,!0)!==T()?ye(e,this.options,A(t,!1),!1):ge()}}]))();function ge(){M.forEach(function(t){clearInterval(t.pid)}),M=[]}function ve(){clearInterval(pe)}f(n,"pluginName","scroll"),f(n,"initializeByDefault",!0);function me(t){var e=t.originalEvent,n=t.putSortable,o=t.dragEl,i=t.dispatchSortableEvent,r=t.hideGhostForTarget,a=t.unhideGhostForTarget;e&&(t=n||t.activeSortable,r(),r=e.changedTouches&&e.changedTouches.length?e.changedTouches[0]:e,e=document.elementFromPoint(r.clientX,r.clientY),a(),t)&&!t.el.contains(e)&&(i("spill"),this.onSpill({dragEl:o,putSortable:n}))}var be,d,ye=ut(function(n,t,e,o){if(t.scroll){var i,r=(n.touches?n.touches[0]:n).clientX,a=(n.touches?n.touches[0]:n).clientY,l=t.scrollSensitivity,s=t.scrollSpeed,c=T(),u=!1,d=0,h=se=ce!==e&&(ce=e,ge(),se=t.scroll,i=t.scrollFn,!0===se)?A(e,!0):se;do{var p=h,f=X(p),g=f.top,v=f.bottom,m=f.left,b=f.right,y=f.width,f=f.height,E=void 0,w=void 0,D=p.scrollWidth,S=p.scrollHeight,_=k(p),C=p.scrollLeft,x=p.scrollTop,w=p===c?(E=y<D&&("auto"===_.overflowX||"scroll"===_.overflowX||"visible"===_.overflowX),f<S&&("auto"===_.overflowY||"scroll"===_.overflowY||"visible"===_.overflowY)):(E=y<D&&("auto"===_.overflowX||"scroll"===_.overflowX),f<S&&("auto"===_.overflowY||"scroll"===_.overflowY)),_=E&&(Math.abs(b-r)<=l&&C+y<D)-(Math.abs(m-r)<=l&&!!C),E=w&&(Math.abs(v-a)<=l&&x+f<S)-(Math.abs(g-a)<=l&&!!x);if(!M[d])for(var O=0;O<=d;O++)M[O]||(M[O]={});M[d].vx==_&&M[d].vy==E&&M[d].el===p||(M[d].el=p,M[d].vx=_,M[d].vy=E,clearInterval(M[d].pid),0==_&&0==E)||(u=!0,M[d].pid=setInterval(function(){o&&0===this.layer&&q.active._onTouchMove(he);var t=M[this.layer].vy?M[this.layer].vy*s:0,e=M[this.layer].vx?M[this.layer].vx*s:0;"function"==typeof i&&"continue"!==i.call(q.dragged.parentNode[R],e,t,n,he,M[this.layer].el)||dt(M[this.layer].el,e,t)}.bind({layer:d}),24)),d++}while(t.bubbleScroll&&h!==c&&(h=A(h,!1)));fe=u}},30);function Ee(){}function we(){}Ee.prototype={startIndex:null,dragStart:function(t){t=t.oldDraggableIndex;this.startIndex=t},getPlaceholder:function(t){t=t.originalDragEl;be=t},onSpill:function(t){var e=t.dragEl,t=t.putSortable,n=(this.sortable.captureAnimationState(),t&&t.captureAnimationState(),at(this.sortable.el,this.startIndex,this.options,be));n?this.sortable.el.insertBefore(e,n):this.sortable.el.appendChild(e),this.sortable.animateAll(),t&&t.animateAll()},drop:me},a(Ee,{pluginName:"revertOnSpill"}),we.prototype={onSpill:function(t){var e=t.dragEl,t=t.putSortable||this.sortable;t.captureAnimationState(),e.parentNode&&e.parentNode.removeChild(e),t.animateAll()},drop:me},a(we,{pluginName:"removeOnSpill"});var De,b,E,Se,_e,Ce,xe,w=[],D=[],Oe=!1,S=!1,Te=!1;function Ae(n,o){D.forEach(function(t,e){e=o.children[t.sortableIndex+(n?Number(e):0)];e?o.insertBefore(t,e):o.appendChild(t)})}function Me(){w.forEach(function(t){t!==E&&t.parentNode&&t.parentNode.removeChild(t)})}var Pe=(()=>e(function t(e){h(this,t),this.sortable=e,this.options=e.options,this.startX=0,this.startLevel=1,this.currentLevel=1,this.beforeElement=null},[{key:"mount",value:function(){this.options.tree}},{key:"dragStarted",value:function(t){this.options.tree&&(this.startX=t.originalEvent.clientX,this.startLevel=Ie(t.originalDragEl||t.dragEl,this.options),this.currentLevel=this.startLevel)}},{key:"_findPrevSibling",value:function(t,e){for(var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:void 0,o=t.previousElementSibling,i=this.options.treeItemLevelAttr||"data-level";o;){var r=I(o,this.options.draggable,this.sortable.el,!1,e);if(r&&("number"==typeof n&&r.getAttribute(i)===n.toString()||void 0===n))return r;o=o.previousElementSibling}return null}},{key:"_findNextSibling",value:function(t,e){for(var n=t.nextElementSibling;n;){var o=I(n,this.options.draggable,this.sortable.el,!1,e);if(o)return o;n=n.nextElementSibling}return null}},{key:"dragOver",value:function(t){var e,n,o,i,r,a,l,s,c;this.options.tree&&"vertical"!==t.axis&&(r=t.originalEvent.clientX-this.startX,c=this.options.treeIndentThreshold||10,e=this.options.treeItemLevelAttr||"data-level",n=this._findPrevSibling(t.dragEl,t.originalDragEl),o=this._findNextSibling(t.dragEl,t.originalDragEl),i=n?Ie(n,this.options):1,s=o?Ie(o,this.options):1,l=a=1,n&&o?(a=Math.min(i+1,s,i),l=Math.max(i+1,s)):o?a=l=1:l=i+(a=1),s=Math.floor(r/c),(i=Math.max(a,Math.min(l,this.startLevel+s)))===this.currentLevel&&this.beforeElement===n||(this.beforeElement=n,this.currentLevel=i,t.originalDragEl&&t.originalDragEl.setAttribute("sortable-".concat(e),this.currentLevel),null!=(r=t.dragEl)&&null!=(c=r.setAttribute)&&c.call(r,"sortable-".concat(e),this.currentLevel),null!=(a=t.ghostEl)&&null!=(l=a.setAttribute)&&l.call(a,"sortable-".concat(e),this.currentLevel),this.removeDragPrent(),1<i&&(xe=this._findPrevSibling(t.dragEl,t.originalDragEl,i-1))&&xe.setAttribute("sortable-data-parent","true"),c=X(s=n||o||this.sortable.el),this.sortable._getPlaceholderOnMove(this.sortable.el,X(t.dragEl),s,c,t,Boolean(n))))}},{key:"drop",value:function(t){var e,n,o;this.options.tree&&(o=this.options.treeItemLevelAttr||"data-level",t.originalDragEl&&t.originalDragEl.setAttribute("sortable-".concat(o),this.currentLevel),null!=(n=t.dragEl)&&null!=(e=n.setAttribute)&&e.call(n,"sortable-".concat(o),this.currentLevel),null!=(e=t.ghostEl))&&null!=(n=e.setAttribute)&&n.call(e,"sortable-".concat(o),this.currentLevel)}},{key:"removeDragPrent",value:function(){xe&&xe.removeAttribute("sortable-data-parent"),xe=null}},{key:"nulling",value:function(){this.removeDragPrent(),this.startX=0,this.startLevel=this.currentLevel=1}}]))();function Ie(t,e){e=e.treeItemLevelAttr||"data-level";return parseInt(t.getAttribute(e))||1}return f(Pe,"pluginName","tree"),q.mount(Pe),q.mount(n),q.mount(we,Ee),q.mount(new function(){function t(){this.defaults={swapClass:"sortable-swap-highlight"}}return t.prototype={dragStart:function(t){t=t.dragEl;d=t},dragOverValid:function(t){var e,n=t.completed,o=t.target,i=t.onMove,r=t.changed,a=t.cancel;t.activeSortable.options.swap&&(t=this.sortable.el,e=this.options,o&&o!==t&&(t=d,d=!1!==i(o)?(N(o,e.swapClass,!0),o):null,t)&&t!==d&&N(t,e.swapClass,!1),r(),n(!0),a())},drop:function(t){var e,n,o,i=t.activeSortable,r=t.putSortable,t=t.dragEl,a=r||this.sortable,l=this.options;d&&N(d,l.swapClass,!1),d&&(l.swap||r&&r.options.swap)&&t!==d&&(a.captureAnimationState(),a!==i&&i.captureAnimationState(),l=d,t=(r=t).parentNode,o=l.parentNode,t&&o&&!t.isEqualNode(l)&&!o.isEqualNode(r)&&(e=L(r),n=L(l),t.isEqualNode(o)&&e<n&&n++,t.insertBefore(l,t.children[e]),o.insertBefore(r,o.children[n])),a.animateAll(),a!==i)&&i.animateAll()},nulling:function(){d=null}},a(t,{pluginName:"swap",eventProperties:function(){return{swapItem:d}}})}),q.mount(new function(){function t(o){for(var t in this)"_"===t.charAt(0)&&"function"==typeof this[t]&&(this[t]=this[t].bind(this));o.options.avoidImplicitDeselect||(o.options.supportPointer?s(document,"pointerup",this._deselectMultiDrag):(s(document,"mouseup",this._deselectMultiDrag),s(document,"touchend",this._deselectMultiDrag))),s(document,"keydown",this._checkKeyDown),s(document,"keyup",this._checkKeyUp),this.defaults={selectedClass:"sortable-selected",multiDragKey:null,avoidImplicitDeselect:!1,setData:function(t,e){var n="";w.length&&b===o?w.forEach(function(t,e){n+=(e?", ":"")+t.textContent}):n=e.textContent,t.setData("Text",n)}}}return t.prototype={multiDragKeyDown:!1,isMultiDrag:!1,delayStartGlobal:function(t){t=t.dragEl;E=t},delayEnded:function(){this.isMultiDrag=~w.indexOf(E)},setupClone:function(t){var e=t.sortable,t=t.cancel;if(this.isMultiDrag){for(var n=0;n<w.length;n++)D.push(ht(w[n])),D[n].sortableIndex=w[n].sortableIndex,D[n].draggable=!1,D[n].style["will-change"]="",N(D[n],this.options.selectedClass,!1),w[n]===E&&N(D[n],this.options.chosenClass,!1);e._hideClone(),t()}},clone:function(t){var e=t.sortable,n=t.dispatchSortableEvent,o=t.cancel;this.isMultiDrag&&!this.options.removeCloneOnHide&&w.length&&b===e&&(Ae(!0,t.rootEl),n("clone"),o())},showClone:function(t){var e=t.cloneNowShown,n=t.cancel;this.isMultiDrag&&(Ae(!1,t.rootEl),D.forEach(function(t){k(t,"display","")}),e(),Ce=!1,n())},hideClone:function(t){var e=this,n=(t.sortable,t.cloneNowHidden),t=t.cancel;this.isMultiDrag&&(D.forEach(function(t){k(t,"display","none"),e.options.removeCloneOnHide&&t.parentNode&&t.parentNode.removeChild(t)}),n(),Ce=!0,t())},dragStartGlobal:function(t){t.sortable;!this.isMultiDrag&&b&&b.multiDrag._deselectMultiDrag(),w.forEach(function(t){t.sortableIndex=L(t)}),w=w.sort(function(t,e){return t.sortableIndex-e.sortableIndex}),Te=!0},getPlaceholder:function(t){t=t.originalDragEl;Se=t},dragStarted:function(t){var e,n=this,t=t.sortable;this.isMultiDrag&&(this.options.sort&&(t.captureAnimationState(),this.options.animation)&&(w.forEach(function(t){t!==E&&k(t,"position","absolute")}),e=X(E,!1,!0,!0),w.forEach(function(t){t!==E&&pt(t,e)}),Oe=S=!0),t.animateAll(function(){Oe=S=!1,n.options.animation&&w.forEach(function(t){ft(t)}),n.options.sort&&Me()}))},dragOver:function(t){var e=t.target,n=t.completed,t=t.cancel;S&&~w.indexOf(e)&&(n(!1),t())},revert:function(t){var n,o,e=t.fromSortable,i=t.rootEl,r=t.sortable,a=t.dragRect;1<w.length&&(w.forEach(function(t){r.addAnimationState({target:t,rect:S?X(t):a}),ft(t),t.fromRect=a,e.removeAnimationState(t)}),S=!1,n=!this.options.removeCloneOnHide,o=i,w.forEach(function(t,e){e=o.children[t.sortableIndex+(n?Number(e):0)];e?o.insertBefore(t,e):o.appendChild(t)}))},dragOverCompleted:function(t){var e,n=t.sortable,o=t.isOwner,i=t.activeSortable,r=t.parentEl,a=t.putSortable,l=this.options;t.insertion&&(o&&i._hideClone(),Oe=!1,l.animation&&1<w.length&&(S||!o&&!i.options.sort&&!a)&&(e=X(E,!1,!0,!0),w.forEach(function(t){t!==E&&(pt(t,e),r.appendChild(t))}),S=!0),o||(S||Me(),1<w.length?(t=Ce,i._showClone(n),i.options.animation&&!Ce&&t&&D.forEach(function(t){i.addAnimationState({target:t,rect:_e}),t.fromRect=_e,t.thisAnimationDuration=null})):i._showClone(n)))},dragOverAnimationCapture:function(t){var e=t.dragRect,n=t.isOwner,t=t.activeSortable;w.forEach(function(t){t.thisAnimationDuration=null}),t.options.animation&&!n&&t.multiDrag.isMultiDrag&&(_e=a({},e),n=ot(E,!0),_e.top-=n.f,_e.left-=n.e)},dragOverAnimationComplete:function(){S&&(S=!1,Me())},drop:function(t){var e=t.originalEvent,n=t.rootEl,o=t.parentEl,i=t.sortable,r=t.dispatchSortableEvent,a=t.oldIndex,t=t.putSortable,l=t||this.sortable;if(e){var s,c,u,d=this.options,h=o.children;if(!Te)if(d.multiDragKey&&!this.multiDragKeyDown&&this._deselectMultiDrag(),N(E,d.selectedClass,!~w.indexOf(E)),~w.indexOf(E))w.splice(w.indexOf(E),1),De=null,Et({sortable:i,rootEl:n,name:"deselect",targetEl:E,originalEvent:e});else{if(w.push(E),Et({sortable:i,rootEl:n,name:"select",targetEl:E,originalEvent:e}),e.shiftKey&&De&&i.el.contains(De)){var p=L(De),f=L(E);if(~p&&~f&&p!==f)for(var g,v=p<f?(g=p,f):(g=f,p+1),m=d.filter;g<v;g++)~w.indexOf(h[g])||!I(h[g],d.draggable,o,!1,Se)||m&&("function"==typeof m?m.call(i,e,h[g],i):m.split(",").some(function(t){return I(h[g],t.trim(),o,!1,Se)}))||(N(h[g],d.selectedClass,!0),w.push(h[g]),Et({sortable:i,rootEl:n,name:"select",targetEl:h[g],originalEvent:e}))}else De=E;b=l}Te&&this.isMultiDrag&&(S=!1,(o[R].options.sort||o!==n)&&1<w.length&&(s=X(E),c=L(E,":not(."+this.options.selectedClass+")"),!Oe&&d.animation&&(E.thisAnimationDuration=null),l.captureAnimationState(),Oe||(d.animation&&(E.fromRect=s,w.forEach(function(t){var e;t.thisAnimationDuration=null,t!==E&&(e=S?X(t):s,t.fromRect=e,l.addAnimationState({target:t,rect:e}))})),Me(),w.forEach(function(t){h[c]?o.insertBefore(t,h[c]):o.appendChild(t),c++}),a===L(E)&&(u=!1,w.forEach(function(t){t.sortableIndex!==L(t)&&(u=!0)}),u)&&(r("update"),r("sort"))),w.forEach(function(t){ft(t)}),l.animateAll()),b=l),(n===o||t&&"clone"!==t.lastPutMode)&&D.forEach(function(t){t.parentNode&&t.parentNode.removeChild(t)})}},nullingGlobal:function(){this.isMultiDrag=Te=!1,D.length=0},destroyGlobal:function(){this._deselectMultiDrag(),r(document,"pointerup",this._deselectMultiDrag),r(document,"mouseup",this._deselectMultiDrag),r(document,"touchend",this._deselectMultiDrag),r(document,"keydown",this._checkKeyDown),r(document,"keyup",this._checkKeyUp)},_deselectMultiDrag:function(t){if(!(void 0!==Te&&Te||b!==this.sortable||t&&I(t.target,this.options.draggable,this.sortable.el,!1,Se)||t&&0!==t.button))for(;w.length;){var e=w[0];N(e,this.options.selectedClass,!1),w.shift(),Et({sortable:this.sortable,rootEl:this.sortable.el,name:"deselect",targetEl:e,originalEvent:t})}},_checkKeyDown:function(t){t.key===this.options.multiDragKey&&(this.multiDragKeyDown=!0)},_checkKeyUp:function(t){t.key===this.options.multiDragKey&&(this.multiDragKeyDown=!1)}},a(t,{pluginName:"multiDrag",utils:{select:function(t){var e=t.parentNode[R];e&&e.options.multiDrag&&!~w.indexOf(t)&&(b&&b!==e&&(b.multiDrag._deselectMultiDrag(),b=e),N(t,e.options.selectedClass,!0),w.push(t))},deselect:function(t){var e=t.parentNode[R],n=w.indexOf(t);e&&e.options.multiDrag&&~n&&(N(t,e.options.selectedClass,!1),w.splice(n,1))}},eventProperties:function(){var n=this,o=[],i=[];return w.forEach(function(t){var e;o.push({multiDragElement:t,index:t.sortableIndex}),e=S&&t!==E?-1:S?L(t,":not(."+n.options.selectedClass+")"):L(t),i.push({multiDragElement:t,index:e})}),{items:m(w),clones:[].concat(D),oldIndicies:o,newIndicies:i}},optionListeners:{multiDragKey:function(t){return"ctrl"===(t=t.toLowerCase())?t="Control":1<t.length&&(t=t.charAt(0).toUpperCase()+t.substr(1)),t}}})}),q});
|
package/src/Animation.js
DELETED
|
@@ -1,175 +0,0 @@
|
|
|
1
|
-
import { getRect, css, matrix, isRectEqual, indexOfObject } from './utils.js';
|
|
2
|
-
import Sortable from './Sortable.js';
|
|
3
|
-
|
|
4
|
-
export default function AnimationStateManager() {
|
|
5
|
-
let animationStates = [],
|
|
6
|
-
animationCallbackId;
|
|
7
|
-
|
|
8
|
-
return {
|
|
9
|
-
captureAnimationState() {
|
|
10
|
-
animationStates = [];
|
|
11
|
-
if (!this.options.animation) return;
|
|
12
|
-
let children = [].slice.call(this.el.children);
|
|
13
|
-
|
|
14
|
-
children.forEach(child => {
|
|
15
|
-
if (css(child, 'display') === 'none' || child === Sortable.ghost) return;
|
|
16
|
-
animationStates.push({
|
|
17
|
-
target: child,
|
|
18
|
-
rect: getRect(child)
|
|
19
|
-
});
|
|
20
|
-
let fromRect = { ...animationStates[animationStates.length - 1].rect };
|
|
21
|
-
|
|
22
|
-
// If animating: compensate for current animation
|
|
23
|
-
if (child.thisAnimationDuration) {
|
|
24
|
-
let childMatrix = matrix(child, true);
|
|
25
|
-
if (childMatrix) {
|
|
26
|
-
fromRect.top -= childMatrix.f;
|
|
27
|
-
fromRect.left -= childMatrix.e;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
child.fromRect = fromRect;
|
|
32
|
-
});
|
|
33
|
-
},
|
|
34
|
-
|
|
35
|
-
addAnimationState(state) {
|
|
36
|
-
animationStates.push(state);
|
|
37
|
-
},
|
|
38
|
-
|
|
39
|
-
removeAnimationState(target) {
|
|
40
|
-
animationStates.splice(indexOfObject(animationStates, { target }), 1);
|
|
41
|
-
},
|
|
42
|
-
|
|
43
|
-
animateAll(callback) {
|
|
44
|
-
if (!this.options.animation) {
|
|
45
|
-
clearTimeout(animationCallbackId);
|
|
46
|
-
if (typeof(callback) === 'function') callback();
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
let animating = false,
|
|
51
|
-
animationTime = 0;
|
|
52
|
-
|
|
53
|
-
animationStates.forEach((state) => {
|
|
54
|
-
let time = 0,
|
|
55
|
-
animatingThis = false,
|
|
56
|
-
target = state.target,
|
|
57
|
-
fromRect = target.fromRect,
|
|
58
|
-
toRect = getRect(target),
|
|
59
|
-
prevFromRect = target.prevFromRect,
|
|
60
|
-
prevToRect = target.prevToRect,
|
|
61
|
-
animatingRect = state.rect,
|
|
62
|
-
targetMatrix = matrix(target, true);
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
if (targetMatrix) {
|
|
66
|
-
// Compensate for current animation
|
|
67
|
-
toRect.top -= targetMatrix.f;
|
|
68
|
-
toRect.left -= targetMatrix.e;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
target.toRect = toRect;
|
|
72
|
-
|
|
73
|
-
if (target.thisAnimationDuration) {
|
|
74
|
-
// Could also check if animatingRect is between fromRect and toRect
|
|
75
|
-
if (
|
|
76
|
-
isRectEqual(prevFromRect, toRect) &&
|
|
77
|
-
!isRectEqual(fromRect, toRect) &&
|
|
78
|
-
// Make sure animatingRect is on line between toRect & fromRect
|
|
79
|
-
(animatingRect.top - toRect.top) /
|
|
80
|
-
(animatingRect.left - toRect.left) ===
|
|
81
|
-
(fromRect.top - toRect.top) /
|
|
82
|
-
(fromRect.left - toRect.left)
|
|
83
|
-
) {
|
|
84
|
-
// If returning to same place as started from animation and on same axis
|
|
85
|
-
time = calculateRealTime(animatingRect, prevFromRect, prevToRect, this.options);
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
// if fromRect != toRect: animate
|
|
90
|
-
if (!isRectEqual(toRect, fromRect)) {
|
|
91
|
-
target.prevFromRect = fromRect;
|
|
92
|
-
target.prevToRect = toRect;
|
|
93
|
-
|
|
94
|
-
if (!time) {
|
|
95
|
-
time = this.options.animation;
|
|
96
|
-
}
|
|
97
|
-
this.animate(
|
|
98
|
-
target,
|
|
99
|
-
animatingRect,
|
|
100
|
-
toRect,
|
|
101
|
-
time
|
|
102
|
-
);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
if (time) {
|
|
106
|
-
animating = true;
|
|
107
|
-
animationTime = Math.max(animationTime, time);
|
|
108
|
-
clearTimeout(target.animationResetTimer);
|
|
109
|
-
target.animationResetTimer = setTimeout(function() {
|
|
110
|
-
target.animationTime = 0;
|
|
111
|
-
target.prevFromRect = null;
|
|
112
|
-
target.fromRect = null;
|
|
113
|
-
target.prevToRect = null;
|
|
114
|
-
target.thisAnimationDuration = null;
|
|
115
|
-
}, time);
|
|
116
|
-
target.thisAnimationDuration = time;
|
|
117
|
-
}
|
|
118
|
-
});
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
clearTimeout(animationCallbackId);
|
|
122
|
-
if (!animating) {
|
|
123
|
-
if (typeof(callback) === 'function') callback();
|
|
124
|
-
} else {
|
|
125
|
-
animationCallbackId = setTimeout(function() {
|
|
126
|
-
if (typeof(callback) === 'function') callback();
|
|
127
|
-
}, animationTime);
|
|
128
|
-
}
|
|
129
|
-
animationStates = [];
|
|
130
|
-
},
|
|
131
|
-
|
|
132
|
-
animate(target, currentRect, toRect, duration) {
|
|
133
|
-
if (duration) {
|
|
134
|
-
css(target, 'transition', '');
|
|
135
|
-
css(target, 'transform', '');
|
|
136
|
-
let elMatrix = matrix(this.el),
|
|
137
|
-
scaleX = elMatrix && elMatrix.a,
|
|
138
|
-
scaleY = elMatrix && elMatrix.d,
|
|
139
|
-
translateX = (currentRect.left - toRect.left) / (scaleX || 1),
|
|
140
|
-
translateY = (currentRect.top - toRect.top) / (scaleY || 1);
|
|
141
|
-
|
|
142
|
-
target.animatingX = !!translateX;
|
|
143
|
-
target.animatingY = !!translateY;
|
|
144
|
-
|
|
145
|
-
css(target, 'transform', 'translate3d(' + translateX + 'px,' + translateY + 'px,0)');
|
|
146
|
-
|
|
147
|
-
this.forRepaintDummy = repaint(target); // repaint
|
|
148
|
-
|
|
149
|
-
css(target, 'transition', 'transform ' + duration + 'ms' + (this.options.easing ? ' ' + this.options.easing : ''));
|
|
150
|
-
css(target, 'transform', 'translate3d(0,0,0)');
|
|
151
|
-
(typeof target.animated === 'number') && clearTimeout(target.animated);
|
|
152
|
-
target.animated = setTimeout(function () {
|
|
153
|
-
css(target, 'transition', '');
|
|
154
|
-
css(target, 'transform', '');
|
|
155
|
-
target.animated = false;
|
|
156
|
-
|
|
157
|
-
target.animatingX = false;
|
|
158
|
-
target.animatingY = false;
|
|
159
|
-
}, duration);
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
};
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
function repaint(target) {
|
|
166
|
-
return target.offsetWidth;
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
function calculateRealTime(animatingRect, fromRect, toRect, options) {
|
|
171
|
-
return (
|
|
172
|
-
Math.sqrt(Math.pow(fromRect.top - animatingRect.top, 2) + Math.pow(fromRect.left - animatingRect.left, 2)) /
|
|
173
|
-
Math.sqrt(Math.pow(fromRect.top - toRect.top, 2) + Math.pow(fromRect.left - toRect.left, 2))
|
|
174
|
-
) * options.animation;
|
|
175
|
-
}
|
package/src/BrowserInfo.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
function userAgent(pattern) {
|
|
2
|
-
if (typeof window !== 'undefined' && window.navigator) {
|
|
3
|
-
return !!/*@__PURE__*/navigator.userAgent.match(pattern);
|
|
4
|
-
}
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export const IE11OrLess = userAgent(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i);
|
|
8
|
-
export const Edge = userAgent(/Edge/i);
|
|
9
|
-
export const FireFox = userAgent(/firefox/i);
|
|
10
|
-
export const Safari = userAgent(/safari/i) && !userAgent(/chrome/i) && !userAgent(/android/i);
|
|
11
|
-
export const IOS = userAgent(/iP(ad|od|hone)/i);
|
|
12
|
-
export const ChromeForAndroid = userAgent(/chrome/i) && userAgent(/android/i);
|
package/src/EventDispatcher.js
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { IE11OrLess, Edge } from './BrowserInfo.js';
|
|
2
|
-
import { expando } from './utils.js';
|
|
3
|
-
import PluginManager from './PluginManager.js';
|
|
4
|
-
|
|
5
|
-
export default function dispatchEvent(
|
|
6
|
-
{
|
|
7
|
-
sortable, rootEl, name,
|
|
8
|
-
targetEl, cloneEl, toEl, fromEl,
|
|
9
|
-
oldIndex, newIndex,
|
|
10
|
-
oldDraggableIndex, newDraggableIndex,
|
|
11
|
-
originalEvent, putSortable, extraEventProperties
|
|
12
|
-
}
|
|
13
|
-
) {
|
|
14
|
-
sortable = (sortable || (rootEl && rootEl[expando]));
|
|
15
|
-
if (!sortable) return;
|
|
16
|
-
|
|
17
|
-
let evt,
|
|
18
|
-
options = sortable.options,
|
|
19
|
-
onName = 'on' + name.charAt(0).toUpperCase() + name.substr(1);
|
|
20
|
-
// Support for new CustomEvent feature
|
|
21
|
-
if (window.CustomEvent && !IE11OrLess && !Edge) {
|
|
22
|
-
evt = new CustomEvent(name, {
|
|
23
|
-
bubbles: true,
|
|
24
|
-
cancelable: true
|
|
25
|
-
});
|
|
26
|
-
} else {
|
|
27
|
-
evt = document.createEvent('Event');
|
|
28
|
-
evt.initEvent(name, true, true);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
evt.to = toEl || rootEl;
|
|
32
|
-
evt.from = fromEl || rootEl;
|
|
33
|
-
evt.item = targetEl || rootEl;
|
|
34
|
-
evt.clone = cloneEl;
|
|
35
|
-
|
|
36
|
-
evt.oldIndex = oldIndex;
|
|
37
|
-
evt.newIndex = newIndex;
|
|
38
|
-
|
|
39
|
-
evt.oldDraggableIndex = oldDraggableIndex;
|
|
40
|
-
evt.newDraggableIndex = newDraggableIndex;
|
|
41
|
-
|
|
42
|
-
evt.originalEvent = originalEvent;
|
|
43
|
-
evt.pullMode = putSortable ? putSortable.lastPutMode : undefined;
|
|
44
|
-
|
|
45
|
-
let allEventProperties = { ...extraEventProperties, ...PluginManager.getEventProperties(name, sortable) };
|
|
46
|
-
for (let option in allEventProperties) {
|
|
47
|
-
evt[option] = allEventProperties[option];
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
if (rootEl) {
|
|
51
|
-
rootEl.dispatchEvent(evt);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
if (options[onName]) {
|
|
55
|
-
options[onName].call(sortable, evt);
|
|
56
|
-
}
|
|
57
|
-
}
|
package/src/PluginManager.js
DELETED
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
let plugins = [];
|
|
2
|
-
|
|
3
|
-
const defaults = {
|
|
4
|
-
initializeByDefault: true
|
|
5
|
-
};
|
|
6
|
-
|
|
7
|
-
export default {
|
|
8
|
-
mount(plugin) {
|
|
9
|
-
// Set default static properties
|
|
10
|
-
for (let option in defaults) {
|
|
11
|
-
if (defaults.hasOwnProperty(option) && !(option in plugin)) {
|
|
12
|
-
plugin[option] = defaults[option];
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
plugins.forEach(p => {
|
|
17
|
-
if (p.pluginName === plugin.pluginName) {
|
|
18
|
-
throw (`Sortable: Cannot mount plugin ${ plugin.pluginName } more than once`);
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
plugins.push(plugin);
|
|
23
|
-
},
|
|
24
|
-
pluginEvent(eventName, sortable, evt) {
|
|
25
|
-
this.eventCanceled = false;
|
|
26
|
-
evt.cancel = () => {
|
|
27
|
-
this.eventCanceled = true;
|
|
28
|
-
};
|
|
29
|
-
const eventNameGlobal = eventName + 'Global';
|
|
30
|
-
plugins.forEach(plugin => {
|
|
31
|
-
if (!sortable[plugin.pluginName]) return;
|
|
32
|
-
// Fire global events if it exists in this sortable
|
|
33
|
-
if (
|
|
34
|
-
sortable[plugin.pluginName][eventNameGlobal]
|
|
35
|
-
) {
|
|
36
|
-
sortable[plugin.pluginName][eventNameGlobal]({ sortable, ...evt });
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
// Only fire plugin event if plugin is enabled in this sortable,
|
|
40
|
-
// and plugin has event defined
|
|
41
|
-
if (
|
|
42
|
-
sortable.options[plugin.pluginName] &&
|
|
43
|
-
sortable[plugin.pluginName][eventName]
|
|
44
|
-
) {
|
|
45
|
-
sortable[plugin.pluginName][eventName]({ sortable, ...evt });
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
},
|
|
49
|
-
initializePlugins(sortable, el, defaults, options) {
|
|
50
|
-
plugins.forEach(plugin => {
|
|
51
|
-
const pluginName = plugin.pluginName;
|
|
52
|
-
if (!sortable.options[pluginName] && !plugin.initializeByDefault) return;
|
|
53
|
-
|
|
54
|
-
let initialized = new plugin(sortable, el, sortable.options);
|
|
55
|
-
initialized.sortable = sortable;
|
|
56
|
-
initialized.options = sortable.options;
|
|
57
|
-
sortable[pluginName] = initialized;
|
|
58
|
-
|
|
59
|
-
// Add default options from plugin
|
|
60
|
-
Object.assign(defaults, initialized.defaults);
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
for (let option in sortable.options) {
|
|
64
|
-
if (!sortable.options.hasOwnProperty(option)) continue;
|
|
65
|
-
let modified = this.modifyOption(sortable, option, sortable.options[option]);
|
|
66
|
-
if (typeof(modified) !== 'undefined') {
|
|
67
|
-
sortable.options[option] = modified;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
|
-
getEventProperties(name, sortable) {
|
|
72
|
-
let eventProperties = {};
|
|
73
|
-
plugins.forEach(plugin => {
|
|
74
|
-
if (typeof(plugin.eventProperties) !== 'function') return;
|
|
75
|
-
Object.assign(eventProperties, plugin.eventProperties.call(sortable[plugin.pluginName], name));
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
return eventProperties;
|
|
79
|
-
},
|
|
80
|
-
modifyOption(sortable, name, value) {
|
|
81
|
-
let modifiedValue;
|
|
82
|
-
plugins.forEach(plugin => {
|
|
83
|
-
// Plugin must exist on the Sortable
|
|
84
|
-
if (!sortable[plugin.pluginName]) return;
|
|
85
|
-
|
|
86
|
-
// If static option listener exists for this option, call in the context of the Sortable's instance of this plugin
|
|
87
|
-
if (plugin.optionListeners && typeof(plugin.optionListeners[name]) === 'function') {
|
|
88
|
-
modifiedValue = plugin.optionListeners[name].call(sortable[plugin.pluginName], value);
|
|
89
|
-
}
|
|
90
|
-
});
|
|
91
|
-
|
|
92
|
-
return modifiedValue;
|
|
93
|
-
}
|
|
94
|
-
};
|