Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

better-sortable

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

better-sortable - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

2

package.json
{
"name": "better-sortable",
"exportName": "Sortable",
"version": "0.0.4",
"version": "0.0.5",
"devDependencies": {

@@ -6,0 +6,0 @@ "@babel/core": "^7.4.4",

@@ -1,2 +0,2 @@

/*! Sortable 0.0.2 - MIT | https://github.com/novlan1/Sortable */
!function(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(){"use strict";function a(){return(a=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n,o=arguments[e];for(n in o)Object.prototype.hasOwnProperty.call(o,n)&&(t[n]=o[n])}return t}).apply(this,arguments)}function t(t){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(t)}const w=t(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),E=t(/Edge/i),c=t(/firefox/i),d=t(/safari/i)&&!t(/chrome/i)&&!t(/android/i);var e=t(/iP(ad|od|hone)/i),n=t(/chrome/i)&&t(/android/i);const o={capture:!1,passive:!1};function h(t,e,n){t.addEventListener(e,n,!w&&o)}function r(t,e,n){t.removeEventListener(e,n,!w&&o)}function l(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 x(t,e,n,o){if(t){n=n||document;do{if(null!=e&&(">"!==e[0]||t.parentNode===n)&&l(t,e)||o&&t===n)return t}while(t!==n&&(t=(i=t).host&&i!==document&&i.host.nodeType?i.host:i.parentNode))}var i;return null}const i=/\s+/g;function M(t,e,n){var o;t&&e&&(t.classList?t.classList[n?"add":"remove"](e):(o=(" "+t.className+" ").replace(i," ").replace(" "+e+" "," "),t.className=(o+(n?" "+e:"")).replace(i," ")))}function N(t,e,n){let 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];e in o||-1!==e.indexOf("webkit")||(e="-webkit-"+e),o[e]=n+("string"==typeof n?"":"px")}}function f(t,e){let n="";if("string"==typeof t)n=t;else do{var o=N(t,"transform");o&&"none"!==o&&(n=o+" "+n)}while(!e&&(t=t.parentNode));const i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(n)}function u(o,i,r){if(o){let t=o.getElementsByTagName(i),e=0,n=t.length;if(r)for(;e<n;e++)r(t[e],e);return t}return[]}function p(){var t=document.scrollingElement;return t||document.documentElement}function I(l,s,c,d,h){if(l.getBoundingClientRect||l===window){let t,e,n,o,i,r,a;if(a=l!==window&&l.parentNode&&l!==p()?(t=l.getBoundingClientRect(),e=t.top,n=t.left,o=t.bottom,i=t.right,r=t.height,t.width):(e=0,n=0,o=window.innerHeight,i=window.innerWidth,r=window.innerHeight,window.innerWidth),(s||c)&&l!==window&&(h=h||l.parentNode,!w))do{if(h&&h.getBoundingClientRect&&("none"!==N(h,"transform")||c&&"static"!==N(h,"position"))){var u=h.getBoundingClientRect();e-=u.top+parseInt(N(h,"border-top-width")),n-=u.left+parseInt(N(h,"border-left-width")),o=e+t.height,i=n+t.width;break}}while(h=h.parentNode);return d&&l!==window&&(d=(s=f(h||l))&&s.a,l=s&&s.d,s&&(e/=l,n/=d,a/=d,r/=l,o=e+r,i=n+a)),{top:e,left:n,bottom:o,right:i,width:a,height:r}}}function A(t,e,n){let o=s(t,!0),i=I(t)[e];for(;o;){let t=I(o)[n],e;if(e="top"===n||"left"===n?t<=i:i<=t,!e)return o;if(o===p())break;o=s(o,!1)}return!1}function O(t,e,n,o){let i=0,r=0,a=t.children;for(;r<a.length;){if("none"!==a[r].style.display&&a[r]!==At.ghost&&(o||a[r]!==At.dragged)&&x(a[r],n.draggable,t,!1)){if(i===e)return a[r];i++}r++}return null}function P(t,e){let n=t.lastElementChild;for(;n&&(n===At.ghost||"none"===N(n,"display")||e&&!l(n,e));)n=n.previousElementSibling;return n||null}function k(t,e){let n=0;if(!t||!t.parentNode)return-1;for(;t=t.previousElementSibling;)"TEMPLATE"===t.nodeName.toUpperCase()||t===At.clone||e&&!l(t,e)||n++;return n}function g(t){let e=0,n=0,o=p();if(t)do{var i=f(t),r=i.a,i=i.d;e+=t.scrollLeft*r,n+=t.scrollTop*i}while(t!==o&&(t=t.parentNode));return[e,n]}function s(t,e){if(!t||!t.getBoundingClientRect)return p();let n=t,o=!1;do{if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var i=N(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 p();if(o||e)return n;o=!0}}}while(n=n.parentNode);return p()}function m(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)}let v;function b(e,n){return function(){var t;v||(1===(t=arguments).length?e.call(this,t[0]):e.apply(this,t),v=setTimeout(function(){v=void 0},n))}}function R(t,e,n){t.scrollLeft+=e,t.scrollTop+=n}function y(t){let 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 D(t,e){N(t,"position","absolute"),N(t,"top",e.top),N(t,"left",e.left),N(t,"width",e.width),N(t,"height",e.height)}function _(t){N(t,"position",""),N(t,"top",""),N(t,"left",""),N(t,"width",""),N(t,"height","")}const X="Sortable"+(new Date).getTime();function C(){let o=[],e;return{captureAnimationState(){if(o=[],this.options.animation){let t=[].slice.call(this.el.children);t.forEach(e=>{if("none"!==N(e,"display")&&e!==At.ghost){o.push({target:e,rect:I(e)});let t={...o[o.length-1].rect};var n;!e.thisAnimationDuration||(n=f(e,!0))&&(t.top-=n.f,t.left-=n.e),e.fromRect=t}})}},addAnimationState(t){o.push(t)},removeAnimationState(t){o.splice(function(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(t){if(!this.options.animation)return clearTimeout(e),void("function"==typeof t&&t());let u=!1,p=0;o.forEach(t=>{let e=0,n=t.target,o=n.fromRect,i=I(n),r=n.prevFromRect,a=n.prevToRect,l=t.rect,s=f(n,!0);var c,d,h;s&&(i.top-=s.f,i.left-=s.e),n.toRect=i,n.thisAnimationDuration&&m(r,i)&&!m(o,i)&&(l.top-i.top)/(l.left-i.left)==(o.top-i.top)/(o.left-i.left)&&(e=(c=l,d=r,h=a,t=this.options,Math.sqrt(Math.pow(d.top-c.top,2)+Math.pow(d.left-c.left,2))/Math.sqrt(Math.pow(d.top-h.top,2)+Math.pow(d.left-h.left,2))*t.animation)),m(i,o)||(n.prevFromRect=o,n.prevToRect=i,e=e||this.options.animation,this.animate(n,l,i,e)),e&&(u=!0,p=Math.max(p,e),clearTimeout(n.animationResetTimer),n.animationResetTimer=setTimeout(function(){n.animationTime=0,n.prevFromRect=null,n.fromRect=null,n.prevToRect=null,n.thisAnimationDuration=null},e),n.thisAnimationDuration=e)}),clearTimeout(e),u?e=setTimeout(function(){"function"==typeof t&&t()},p):"function"==typeof t&&t(),o=[]},animate(t,e,n,o){var i,r;o&&(N(t,"transition",""),N(t,"transform",""),i=(r=f(this.el))&&r.a,r=r&&r.d,i=(e.left-n.left)/(i||1),r=(e.top-n.top)/(r||1),t.animatingX=!!i,t.animatingY=!!r,N(t,"transform","translate3d("+i+"px,"+r+"px,0)"),this.forRepaintDummy=t.offsetWidth,N(t,"transition","transform "+o+"ms"+(this.options.easing?" "+this.options.easing:"")),N(t,"transform","translate3d(0,0,0)"),"number"==typeof t.animated&&clearTimeout(t.animated),t.animated=setTimeout(function(){N(t,"transition",""),N(t,"transform",""),t.animated=!1,t.animatingX=!1,t.animatingY=!1},o))}}}let S=[];const T={initializeByDefault:!0};var Y={mount(e){for(var t in T)!T.hasOwnProperty(t)||t in e||(e[t]=T[t]);S.forEach(t=>{if(t.pluginName===e.pluginName)throw`Sortable: Cannot mount plugin ${e.pluginName} more than once`}),S.push(e)},pluginEvent(e,n,o){this.eventCanceled=!1,o.cancel=()=>{this.eventCanceled=!0};const i=e+"Global";S.forEach(t=>{n[t.pluginName]&&(n[t.pluginName][i]&&n[t.pluginName][i]({sortable:n,...o}),n.options[t.pluginName]&&n[t.pluginName][e]&&n[t.pluginName][e]({sortable:n,...o}))})},initializePlugins(o,i,r,t){for(var e in S.forEach(e=>{var n=e.pluginName;if(o.options[n]||e.initializeByDefault){let t=new e(o,i,o.options);t.sortable=o,t.options=o.options,o[n]=t,a(r,t.defaults)}}),o.options){var n;o.options.hasOwnProperty(e)&&(void 0!==(n=this.modifyOption(o,e,o.options[e]))&&(o.options[e]=n))}},getEventProperties(e,n){let o={};return S.forEach(t=>{"function"==typeof t.eventProperties&&a(o,t.eventProperties.call(n[t.pluginName],e))}),o},modifyOption(e,n,o){let i;return S.forEach(t=>{e[t.pluginName]&&t.optionListeners&&"function"==typeof t.optionListeners[n]&&(i=t.optionListeners[n].call(e[t.pluginName],o))}),i}};function B({sortable:o,rootEl:i,name:r,targetEl:a,cloneEl:l,toEl:s,fromEl:c,oldIndex:d,newIndex:h,oldDraggableIndex:u,newDraggableIndex:p,originalEvent:f,putSortable:g,extraEventProperties:m}){if(o=o||i&&i[X]){let t,e=o.options,n="on"+r.charAt(0).toUpperCase()+r.substr(1);!window.CustomEvent||w||E?(t=document.createEvent("Event"),t.initEvent(r,!0,!0)):t=new CustomEvent(r,{bubbles:!0,cancelable:!0}),t.to=s||i,t.from=c||i,t.item=a||i,t.clone=l,t.oldIndex=d,t.newIndex=h,t.oldDraggableIndex=u,t.newDraggableIndex=p,t.originalEvent=f,t.pullMode=g?g.lastPutMode:void 0;var v,b={...m,...Y.getEventProperties(r,o)};for(v in b)t[v]=b[v];i&&i.dispatchEvent(t),e[n]&&e[n].call(o,t)}}let H=function(t,e,{evt:n,...o}={}){Y.pluginEvent.bind(At)(t,e,{dragEl:K,parentEl:W,ghostEl:F,rootEl:z,nextEl:G,lastDownEl:$,cloneEl:U,cloneHidden:j,dragStarted:dt,putSortable:tt,activeSortable:At.active,originalEvent:n,oldIndex:q,oldDraggableIndex:Z,newIndex:V,newDraggableIndex:Q,hideGhostForTarget:xt,unhideGhostForTarget:Mt,cloneNowHidden(){j=!0},cloneNowShown(){j=!1},dispatchSortableEvent(t){L({sortable:e,name:t,originalEvent:n})},...o})};function L(t){B({putSortable:tt,cloneEl:U,targetEl:K,rootEl:z,oldIndex:q,oldDraggableIndex:Z,newIndex:V,newDraggableIndex:Q,...t})}let K,W,F,z,G,$,U,j,q,V,Z,Q,J,tt,et=!1,nt=!1,ot=[],it,rt,at,lt,st,ct,dt,ht,ut,pt=!1,ft=!1,gt,mt,vt=[],bt=!1,wt=[];const Et="undefined"!=typeof document,yt=e,Dt=E||w?"cssFloat":"float",_t=Et&&!n&&!e&&"draggable"in document.createElement("div"),Ct=function(){if(Et){if(w)return!1;let t=document.createElement("x");return t.style.cssText="pointer-events:auto","auto"===t.style.pointerEvents}}(),St=function(t,e){let n=N(t),o=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),i=O(t,0,e),r=O(t,1,e),a=i&&N(i),l=r&&N(r),s=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+I(i).width,c=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+I(r).width;if("flex"===n.display)return"column"===n.flexDirection||"column-reverse"===n.flexDirection?"vertical":"horizontal";if("grid"===n.display)return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(i&&a.float&&"none"!==a.float){e="left"===a.float?"left":"right";return!r||"both"!==l.clear&&l.clear!==e?"horizontal":"vertical"}return i&&("block"===a.display||"flex"===a.display||"table"===a.display||"grid"===a.display||o<=s&&"none"===n[Dt]||r&&"none"===n[Dt]&&o<s+c)?"vertical":"horizontal"},Tt=function(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;if(null==r&&(a||i))return!0;if(null==r||!1===r)return!1;if(a&&"clone"===r)return r;if("function"==typeof r)return l(r(t,e,n,o),a)(t,e,n,o);e=(a?t:e).options.group.name;return!0===r||"string"==typeof r&&r===e||r.join&&-1<r.indexOf(e)}}let e={},n=t.group;n&&"object"==typeof 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},xt=function(){!Ct&&F&&N(F,"display","none")},Mt=function(){!Ct&&F&&N(F,"display","")};Et&&document.addEventListener("click",function(t){if(nt)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),nt=!1},!0);let Nt=function(n){if(K){let e=function(i,r){let a;return ot.some(t=>{var e=t[X].options.emptyInsertThreshold;if(e&&!P(t)){var n=I(t),o=i>=n.left-e&&i<=n.right+e,e=r>=n.top-e&&r<=n.bottom+e;return o&&e?a=t:void 0}}),a}((n=n.touches?n.touches[0]:n).clientX,n.clientY);if(e){let t={};for(var o in n)n.hasOwnProperty(o)&&(t[o]=n[o]);t.target=t.rootEl=e,t.preventDefault=void 0,t.stopPropagation=void 0,e[X]._onDragOver(t)}}},It=function(t){K&&K.parentNode[X]._isOutsideThisEl(t.target)};function At(t,e){if(!t||!t.nodeType||1!==t.nodeType)throw`Sortable: \`el\` must be an HTMLElement, not ${{}.toString.call(t)}`;this.el=t,this.options=e=a({},e),t[X]=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 St(t,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,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!==At.supportPointer&&"PointerEvent"in window&&!d,emptyInsertThreshold:5};for(n in Y.initializePlugins(this,t,i),i)n in e||(e[n]=i[n]);for(o in Tt(e),this)"_"===o.charAt(0)&&"function"==typeof this[o]&&(this[o]=this[o].bind(this));this.nativeDraggable=!e.forceFallback&&_t,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?h(t,"pointerdown",this._onTapStart):(h(t,"mousedown",this._onTapStart),h(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(h(t,"dragover",this),h(t,"dragenter",this)),ot.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),a(this,C())}function Ot(t,e,n,o,i,r,a,l){let s,c=t[X],d=c.options.onMove,h;return!window.CustomEvent||w||E?(s=document.createEvent("Event"),s.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||I(e),s.willInsertAfter=l,s.originalEvent=a,t.dispatchEvent(s),d&&(h=d.call(c,s,a)),h}function Pt(t){t.draggable=!1}function kt(){bt=!1}function Rt(t){return setTimeout(t,0)}function Xt(t){return clearTimeout(t)}At.prototype={constructor:At,_isOutsideThisEl:function(t){this.el.contains(t)||t===this.el||(ht=null)},_getDirection:function(t,e){return"function"==typeof this.options.direction?this.options.direction.call(this,t,e,K):this.options.direction},_onTapStart:function(c){if(c.cancelable){let e=this,n=this.el,t=this.options,o=t.preventOnFilter,i=c.type,r=c.touches&&c.touches[0]||c.pointerType&&"touch"===c.pointerType&&c,a=(r||c).target,l=c.target.shadowRoot&&(c.path&&c.path[0]||c.composedPath&&c.composedPath()[0])||a,s=t.filter;if(!function(t){wt.length=0;let e=t.getElementsByTagName("input"),n=e.length;for(;n--;){var o=e[n];o.checked&&wt.push(o)}}(n),!K&&!(/mousedown|pointerdown/.test(i)&&0!==c.button||t.disabled)&&!l.isContentEditable&&(this.nativeDraggable||!d||!a||"SELECT"!==a.tagName.toUpperCase())&&(a=x(a,t.draggable,n,!1),!(a&&a.animated||$===a))){if(q=k(a),Z=k(a,t.draggable),"function"==typeof s){if(s.call(this,c,a,this))return L({sortable:e,rootEl:l,name:"filter",targetEl:a,toEl:n,fromEl:n}),H("filter",e,{evt:c}),void(o&&c.cancelable&&c.preventDefault())}else if(s&&(s=s.split(",").some(function(t){if(t=x(l,t.trim(),n,!1))return L({sortable:e,rootEl:t,name:"filter",targetEl:a,fromEl:n,toEl:n}),H("filter",e,{evt:c}),!0}),s))return void(o&&c.cancelable&&c.preventDefault());t.handle&&!x(l,t.handle,n,!1)||this._prepareDragStart(c,r,a)}}},_prepareDragStart:function(t,e,n){let o=this,i=o.el,r=o.options,a=i.ownerDocument,l;var s;n&&!K&&n.parentNode===i&&(s=I(n),z=i,K=n,W=K.parentNode,G=K.nextSibling,$=n,J=r.group,At.dragged=K,it={target:K,clientX:(e||t).clientX,clientY:(e||t).clientY},st=it.clientX-s.left,ct=it.clientY-s.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,K.style["will-change"]="all",l=function(){H("delayEnded",o,{evt:t}),At.eventCanceled?o._onDrop():(o._disableDelayedDragEvents(),!c&&o.nativeDraggable&&(K.draggable=!0),o._triggerDragStart(t,e),L({sortable:o,name:"choose",originalEvent:t}),M(K,r.chosenClass,!0))},r.ignore.split(",").forEach(function(t){u(K,t.trim(),Pt)}),h(a,"dragover",Nt),h(a,"mousemove",Nt),h(a,"touchmove",Nt),h(a,"mouseup",o._onDrop),h(a,"touchend",o._onDrop),h(a,"touchcancel",o._onDrop),c&&this.nativeDraggable&&(this.options.touchStartThreshold=4,K.draggable=!0),H("delayStart",this,{evt:t}),!r.delay||r.delayOnTouchOnly&&!e||this.nativeDraggable&&(E||w)?l():At.eventCanceled?this._onDrop():(h(a,"mouseup",o._disableDelayedDrag),h(a,"touchend",o._disableDelayedDrag),h(a,"touchcancel",o._disableDelayedDrag),h(a,"mousemove",o._delayedDragTouchMoveHandler),h(a,"touchmove",o._delayedDragTouchMoveHandler),r.supportPointer&&h(a,"pointermove",o._delayedDragTouchMoveHandler),o._dragStartTimer=setTimeout(l,r.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(){K&&Pt(K),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,"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?h(document,"pointermove",this._onTouchMove):h(document,e?"touchmove":"mousemove",this._onTouchMove):(h(K,"dragend",this),h(z,"dragstart",this._onDragStart));try{document.selection?Rt(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch(t){}},_dragStarted:function(t,e){var n;et=!1,z&&K?(H("dragStarted",this,{evt:e}),this.nativeDraggable&&h(document,"dragover",It),n=this.options,t||M(K,n.dragClass,!1),M(K,n.ghostClass,!0),At.active=this,t&&this._appendGhost(),L({sortable:this,name:"start",originalEvent:e})):this._nulling()},_emulateDragOver:function(){if(rt){this._lastX=rt.clientX,this._lastY=rt.clientY,xt();let t=document.elementFromPoint(rt.clientX,rt.clientY),e=t;for(;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(rt.clientX,rt.clientY),t!==e);)e=t;if(K.parentNode[X]._isOutsideThisEl(t),e)do{if(e[X])if(e[X]._onDragOver({clientX:rt.clientX,clientY:rt.clientY,target:t,rootEl:e})&&!this.options.dragoverBubble)break}while(t=e,e=e.parentNode);Mt()}},_onTouchMove:function(d){if(it){let t=this.options,e=t.fallbackTolerance,n=t.fallbackOffset,o=d.touches?d.touches[0]:d,i=F&&f(F,!0),r=F&&i&&i.a,a=F&&i&&i.d,l=yt&&mt&&g(mt),s=(o.clientX-it.clientX+n.x)/(r||1)+(l?l[0]-vt[0]:0)/(r||1),c=(o.clientY-it.clientY+n.y)/(a||1)+(l?l[1]-vt[1]:0)/(a||1);if(!At.active&&!et){if(e&&Math.max(Math.abs(o.clientX-this._lastX),Math.abs(o.clientY-this._lastY))<e)return;this._onDragStart(d,!0)}var h;F&&(i?(i.e+=s-(at||0),i.f+=c-(lt||0)):i={a:1,b:0,c:0,d:1,e:s,f:c},h=`matrix(${i.a},${i.b},${i.c},${i.d},${i.e},${i.f})`,N(F,"webkitTransform",h),N(F,"mozTransform",h),N(F,"msTransform",h),N(F,"transform",h),at=s,lt=c,rt=o),d.cancelable&&d.preventDefault()}},_appendGhost:function(){if(!F){let t=this.options.fallbackOnBody?document.body:z,e=I(K,!0,yt,!0,t),n=this.options;if(yt){for(mt=t;"static"===N(mt,"position")&&"none"===N(mt,"transform")&&mt!==document;)mt=mt.parentNode;mt!==document.body&&mt!==document.documentElement?(mt===document&&(mt=p()),e.top+=mt.scrollTop,e.left+=mt.scrollLeft):mt=p(),vt=g(mt)}F=K.cloneNode(!0),M(F,n.ghostClass,!1),M(F,n.fallbackClass,!0),M(F,n.dragClass,!0),N(F,"transition",""),N(F,"transform",""),N(F,"box-sizing","border-box"),N(F,"margin",0),N(F,"top",e.top),N(F,"left",e.left),N(F,"width",e.width),N(F,"height",e.height),N(F,"opacity","0.8"),N(F,"position",yt?"absolute":"fixed"),N(F,"zIndex","100000"),N(F,"pointerEvents","none"),At.ghost=F,t.appendChild(F),N(F,"transform-origin",st/parseInt(F.style.width)*100+"% "+ct/parseInt(F.style.height)*100+"%")}},_onDragStart:function(t,e){let n=this,o=t.dataTransfer,i=n.options;H("dragStart",this,{evt:t}),At.eventCanceled?this._onDrop():(H("setupClone",this),At.eventCanceled||(U=y(K),U.removeAttribute("id"),U.draggable=!1,U.style["will-change"]="",this._hideClone(),M(U,this.options.chosenClass,!1),At.clone=U),n.cloneId=Rt(function(){H("clone",n),At.eventCanceled||(n.options.removeCloneOnHide||z.insertBefore(U,K),n._hideClone(),L({sortable:n,name:"clone"}))}),e||M(K,i.dragClass,!0),e?(nt=!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,K)),h(document,"drop",n),N(K,"transform","translateZ(0)")),et=!0,n._dragStartId=Rt(n._dragStarted.bind(n,e,t)),h(document,"selectstart",n),dt=!0,d&&N(document.body,"user-select","none"))},_onDragOver:function(d){let h=this.el,u=d.target,p,f,n,g=this.options,t=g.group,e=At.active,o=J===t,i=g.sort,r=tt||e,m,a=this,l=!1;if(!bt){if(void 0!==d.preventDefault&&d.cancelable&&d.preventDefault(),u=x(u,g.draggable,h,!0),s("dragOver"),At.eventCanceled)return l;if(K.contains(d.target)||u.animated&&u.animatingX&&u.animatingY||a._ignoreWhileAnimating===u)return S(!1);if(nt=!1,e&&!g.disabled&&(o?i||(n=W!==z):tt===this||(this.lastPutMode=J.checkPull(this,e,K,d))&&t.checkPut(this,e,K,d))){if(m="vertical"===this._getDirection(d,u),p=I(K),s("dragOverValid"),At.eventCanceled)return l;if(n)return W=z,C(),this._hideClone(),s("revert"),At.eventCanceled||(G?z.insertBefore(K,G):z.appendChild(K)),S(!0);var v=P(h,g.draggable);if(!v||function(t,e,n){n=I(P(n.el,n.options.draggable));return e?t.clientX>n.right+10||t.clientX<=n.right&&t.clientY>n.bottom&&t.clientX>=n.left:t.clientX>n.right&&t.clientY>n.top||t.clientX<=n.right&&t.clientY>n.bottom+10}(d,m,this)&&!v.animated){if(v===K)return S(!1);if(v&&h===d.target&&(u=v),u&&(f=I(u)),!1!==Ot(z,h,K,p,u,f,d,!!u))return C(),v&&v.nextSibling?h.insertBefore(K,v.nextSibling):h.appendChild(K),W=h,T(),S(!0)}else if(v&&function(t,e,n){n=I(O(n.el,0,n.options,!0));return e?t.clientX<n.left-10||t.clientY<n.top&&t.clientX<n.right:t.clientY<n.top-10||t.clientY<n.bottom&&t.clientX<n.left}(d,m,this)){var b=O(h,0,g,!0);if(b===K)return S(!1);if(u=b,f=I(u),!1!==Ot(z,h,K,p,u,f,d,!1))return C(),h.insertBefore(K,b),W=h,T(),S(!0)}else if(u.parentNode===h){f=I(u);let e,t,n=K.parentNode!==h,o=(w=K.animated&&K.toRect||p,E=u.animated&&u.toRect||f,y=m,D=y?w.left:w.top,_=y?w.right:w.bottom,v=y?w.width:w.height,b=y?E.left:E.top,w=y?E.right:E.bottom,E=y?E.width:E.height,!(D===b||_===w||D+v/2===b+E/2)),i=m?"top":"left",r=A(u,"top","top")||A(K,"top","top"),a=r?r.scrollTop:void 0;ht!==u&&(t=f[i],pt=!1,ft=!o&&g.invertSwap||n);let l;if(0!==(e=function(t,e,n,o,i,r,a,l){let s=o?t.clientY:t.clientX,c=o?n.height:n.width,d=o?n.top:n.left,h=o?n.bottom:n.right,u=!1;if(!a)if(l&&gt<c*i){if(!pt&&(1===ut?d+c*r/2<s:s<h-c*r/2)&&(pt=!0),pt)u=!0;else if(1===ut?s<d+gt:s>h-gt)return-ut}else if(d+c*(1-i)/2<s&&s<h-c*(1-i)/2)return function(t){return k(K)<k(t)?1:-1}(e);if(u=u||a,u&&(s<d+c*r/2||h-c*r/2<s))return d+c/2<s?1:-1;return 0}(d,u,f,m,o?1:g.swapThreshold,null==g.invertedSwapThreshold?g.swapThreshold:g.invertedSwapThreshold,ft,ht===u))){let t=k(K);for(;t-=e,l=W.children[t],l&&("none"===N(l,"display")||l===F););}if(0===e||l===u)return S(!1);ht=u,ut=e;let s=u.nextElementSibling,c=!1;c=1===e;E=Ot(z,h,K,p,u,f,d,c);if(!1!==E)return 1!==E&&-1!==E||(c=1===E),bt=!0,setTimeout(kt,30),C(),c&&!s?h.appendChild(K):u.parentNode.insertBefore(K,c?s:u),r&&R(r,0,a-r.scrollTop),W=K.parentNode,void 0===t||ft||(gt=Math.abs(t-I(u)[i])),T(),S(!0)}if(h.contains(K))return S(!1)}var w,E,y,D,_;return!1}function s(t,e){H(t,a,{evt:d,isOwner:o,axis:m?"vertical":"horizontal",revert:n,dragRect:p,targetRect:f,canSort:i,fromSortable:r,target:u,completed:S,onMove(t,e){return Ot(z,h,K,p,t,I(t),d,e)},changed:T,...e})}function C(){s("dragOverAnimationCapture"),a.captureAnimationState(),a!==r&&r.captureAnimationState()}function S(t){return s("dragOverCompleted",{insertion:t}),t&&(o?e._hideClone():e._showClone(a),a!==r&&(M(K,(tt||e).options.ghostClass,!1),M(K,g.ghostClass,!0)),tt!==a&&a!==At.active?tt=a:a===At.active&&tt&&(tt=null),r===a&&(a._ignoreWhileAnimating=u),a.animateAll(function(){s("dragOverAnimationComplete"),a._ignoreWhileAnimating=null}),a!==r&&(r.animateAll(),r._ignoreWhileAnimating=null)),(u===K&&!K.animated||u===h&&!u.animated)&&(ht=null),g.dragoverBubble||d.rootEl||u===document||(K.parentNode[X]._isOutsideThisEl(d.target),t||Nt(d)),!g.dragoverBubble&&d.stopPropagation&&d.stopPropagation(),l=!0}function T(){V=k(K),Q=k(K,g.draggable),L({sortable:a,name:"change",toEl:h,newIndex:V,newDraggableIndex:Q,originalEvent:d})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){r(document,"mousemove",this._onTouchMove),r(document,"touchmove",this._onTouchMove),r(document,"pointermove",this._onTouchMove),r(document,"dragover",Nt),r(document,"mousemove",Nt),r(document,"touchmove",Nt)},_offUpEvents:function(){var t=this.el.ownerDocument;r(t,"mouseup",this._onDrop),r(t,"touchend",this._onDrop),r(t,"pointerup",this._onDrop),r(t,"touchcancel",this._onDrop),r(document,"selectstart",this)},_onDrop:function(t){var e=this.el,n=this.options;V=k(K),Q=k(K,n.draggable),H("drop",this,{evt:t}),W=K&&K.parentNode,V=k(K),Q=k(K,n.draggable),At.eventCanceled||(et=!1,ft=!1,pt=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),Xt(this.cloneId),Xt(this._dragStartId),this.nativeDraggable&&(r(document,"drop",this),r(e,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),d&&N(document.body,"user-select",""),N(K,"transform",""),t&&(dt&&(t.cancelable&&t.preventDefault(),n.dropBubble||t.stopPropagation()),F&&F.parentNode&&F.parentNode.removeChild(F),(z===W||tt&&"clone"!==tt.lastPutMode)&&U&&U.parentNode&&U.parentNode.removeChild(U),K&&(this.nativeDraggable&&r(K,"dragend",this),Pt(K),K.style["will-change"]="",dt&&!et&&M(K,(tt||this).options.ghostClass,!1),M(K,this.options.chosenClass,!1),L({sortable:this,name:"unchoose",toEl:W,newIndex:null,newDraggableIndex:null,originalEvent:t}),z!==W?(0<=V&&(L({rootEl:W,name:"add",toEl:W,fromEl:z,originalEvent:t}),L({sortable:this,name:"remove",toEl:W,originalEvent:t}),L({rootEl:W,name:"sort",toEl:W,fromEl:z,originalEvent:t}),L({sortable:this,name:"sort",toEl:W,originalEvent:t})),tt&&tt.save()):V!==q&&0<=V&&(L({sortable:this,name:"update",toEl:W,originalEvent:t}),L({sortable:this,name:"sort",toEl:W,originalEvent:t})),At.active&&(null!=V&&-1!==V||(V=q,Q=Z),L({sortable:this,name:"end",toEl:W,originalEvent:t}),this.save())))),this._nulling()},_nulling:function(){H("nulling",this),z=K=W=F=G=U=$=j=it=rt=dt=V=Q=q=Z=ht=ut=tt=J=At.dragged=At.ghost=At.clone=At.active=null,wt.forEach(function(t){t.checked=!0}),wt.length=at=lt=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":K&&(this._onDragOver(t),function(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move");t.cancelable&&t.preventDefault()}(t));break;case"selectstart":t.preventDefault()}},toArray:function(){let t=[],e,n=this.el.children,o=0,i=n.length,r=this.options;for(;o<i;o++)e=n[o],x(e,r.draggable,this.el,!1)&&t.push(e.getAttribute(r.dataIdAttr)||function(t){let e=t.tagName+t.className+t.src+t.href+t.textContent,n=e.length,o=0;for(;n--;)o+=e.charCodeAt(n);return o.toString(36)}(e));return t},sort:function(t,e){let n={},o=this.el;this.toArray().forEach(function(t,e){e=o.children[e];x(e,this.options.draggable,o,!1)&&(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(){let t=this.options.store;t&&t.set&&t.set(this)},closest:function(t,e){return x(t,e||this.options.draggable,this.el,!1)},option:function(t,e){let n=this.options;if(void 0===e)return n[t];var o=Y.modifyOption(this,t,e);n[t]=void 0!==o?o:e,"group"===t&&Tt(n)},destroy:function(){H("destroy",this);let t=this.el;t[X]=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(),ot.splice(ot.indexOf(this.el),1),this.el=t=null},_hideClone:function(){j||(H("hideClone",this),At.eventCanceled||(N(U,"display","none"),this.options.removeCloneOnHide&&U.parentNode&&U.parentNode.removeChild(U),j=!0))},_showClone:function(t){"clone"===t.lastPutMode?j&&(H("showClone",this),At.eventCanceled||(K.parentNode!=z||this.options.group.revertClone?G?z.insertBefore(U,G):z.appendChild(U):z.insertBefore(U,K),this.options.group.revertClone&&this.animate(K,U),N(U,"display",""),j=!1)):this._hideClone()}},Et&&h(document,"touchmove",function(t){(At.active||et)&&t.cancelable&&t.preventDefault()}),At.utils={on:h,off:r,css:N,find:u,is:function(t,e){return!!x(t,e,t,!1)},extend:function(t,e){if(t&&e)for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t},throttle:b,closest:x,toggleClass:M,clone:y,index:k,nextTick:Rt,cancelNextTick:Xt,detectDirection:St,getChild:O},At.get=function(t){return t[X]},At.mount=function(...t){(t=t[0].constructor===Array?t[0]:t).forEach(t=>{if(!t.prototype||!t.prototype.constructor)throw`Sortable: Mounted plugin must be a constructor function, not ${{}.toString.call(t)}`;t.utils&&(At.utils={...At.utils,...t.utils}),Y.mount(t)})},At.create=function(t,e){return new At(t,e)};let Yt=[],Bt,Ht,Lt=!(At.version="0.0.2"),Kt;function Wt(){Yt.forEach(function(t){clearInterval(t.pid)}),Yt=[]}scrollHeight=0;b(function(b,t,e,w){if(t.scroll){const D=(b.touches?b.touches[0]:b).clientX,_=(b.touches?b.touches[0]:b).clientY,C=t.scrollSensitivity,S=t.scrollSpeed,T=p();let f=!1,g;Ht!==e&&(Ht=e,Wt(),Bt=t.scroll,g=t.scrollFn,!0===Bt&&(Bt=s(e,!0)));let m=0,v=Bt;scrollHeight=scrollHeight||Bt.scrollHeight;do{let t=v,e=I(t),n=e.top,o=e.bottom,i=e.left,r=e.right,a=e.width,l=e.height,s,c,d=t.scrollWidth,h=N(t),u=t.scrollLeft,p=t.scrollTop;c=t===T?(s=a<d&&("auto"===h.overflowX||"scroll"===h.overflowX||"visible"===h.overflowX),l<scrollHeight&&("auto"===h.overflowY||"scroll"===h.overflowY||"visible"===h.overflowY)):(s=a<d&&("auto"===h.overflowX||"scroll"===h.overflowX),l<scrollHeight&&("auto"===h.overflowY||"scroll"===h.overflowY));var E=s&&(Math.abs(r-D)<=C&&u+a<d)-(Math.abs(i-D)<=C&&!!u),y=c&&(Math.abs(o-_)<=C&&p+l<scrollHeight)-(Math.abs(n-_)<=C&&!!p);if(!Yt[m])for(let t=0;t<=m;t++)Yt[t]||(Yt[t]={});Yt[m].vx==E&&Yt[m].vy==y&&Yt[m].el===t||(Yt[m].el=t,Yt[m].vx=E,Yt[m].vy=y,clearInterval(Yt[m].pid),0==E&&0==y||(f=!0,Yt[m].pid=setInterval(function(){w&&0===this.layer&&At.active._onTouchMove(Kt);var t=Yt[this.layer].vy?Yt[this.layer].vy*S:0,e=Yt[this.layer].vx?Yt[this.layer].vx*S:0;"function"==typeof g&&"continue"!==g.call(At.dragged.parentNode[X],e,t,b,Kt,Yt[this.layer].el)||R(Yt[this.layer].el,e,t)}.bind({layer:m}),24))),m++}while(t.bubbleScroll&&v!==T&&(v=s(v,!1)));Lt=f}},30);e=function({originalEvent:e,putSortable:n,dragEl:o,activeSortable:i,dispatchSortableEvent:r,hideGhostForTarget:a,unhideGhostForTarget:l}){if(e){let t=n||i;a();e=e.changedTouches&&e.changedTouches.length?e.changedTouches[0]:e,e=document.elementFromPoint(e.clientX,e.clientY);l(),t&&!t.el.contains(e)&&(r("spill"),this.onSpill({dragEl:o,putSortable:n}))}};function Ft(){}function zt(){}Ft.prototype={startIndex:null,dragStart({oldDraggableIndex:t}){this.startIndex=t},onSpill({dragEl:t,putSortable:e}){this.sortable.captureAnimationState(),e&&e.captureAnimationState();var n=O(this.sortable.el,this.startIndex,this.options);n?this.sortable.el.insertBefore(t,n):this.sortable.el.appendChild(t),this.sortable.animateAll(),e&&e.animateAll()},drop:e},a(Ft,{pluginName:"revertOnSpill"}),zt.prototype={onSpill({dragEl:t,putSortable:e}){const n=e||this.sortable;n.captureAnimationState(),t.parentNode&&t.parentNode.removeChild(t),n.animateAll()},drop:e},a(zt,{pluginName:"removeOnSpill"});let Gt;let $t=[],Ut=[],jt,qt,Vt=!1,Zt=!1,Qt=!1,Jt,te,ee;function ne(n,o){Ut.forEach((t,e)=>{e=o.children[t.sortableIndex+(n?Number(e):0)];e?o.insertBefore(t,e):o.appendChild(t)})}function oe(){$t.forEach(t=>{t!==Jt&&t.parentNode&&t.parentNode.removeChild(t)})}return At.mount(new AutoScrollPlugin),At.mount(zt,Ft),At.mount(new function(){function t(){this.defaults={swapClass:"sortable-swap-highlight"}}return t.prototype={dragStart({dragEl:t}){Gt=t},dragOverValid({completed:t,target:e,onMove:n,activeSortable:o,changed:i,cancel:r}){var a;o.options.swap&&(a=this.sortable.el,o=this.options,e&&e!==a&&(a=Gt,Gt=!1!==n(e)?(M(e,o.swapClass,!0),e):null,a&&a!==Gt&&M(a,o.swapClass,!1)),i(),t(!0),r())},drop({activeSortable:t,putSortable:e,dragEl:n}){let o=e||this.sortable;var i=this.options;Gt&&M(Gt,i.swapClass,!1),Gt&&(i.swap||e&&e.options.swap)&&n!==Gt&&(o.captureAnimationState(),o!==t&&t.captureAnimationState(),function(t,e){let n=t.parentNode,o=e.parentNode,i,r;n&&o&&!n.isEqualNode(e)&&!o.isEqualNode(t)&&(i=k(t),r=k(e),n.isEqualNode(o)&&i<r&&r++,n.insertBefore(e,n.children[i]),o.insertBefore(t,o.children[r]))}(n,Gt),o.animateAll(),o!==t&&t.animateAll())},nulling(){Gt=null}},a(t,{pluginName:"swap",eventProperties(){return{swapItem:Gt}}})}),At.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?h(document,"pointerup",this._deselectMultiDrag):(h(document,"mouseup",this._deselectMultiDrag),h(document,"touchend",this._deselectMultiDrag))),h(document,"keydown",this._checkKeyDown),h(document,"keyup",this._checkKeyUp),this.defaults={selectedClass:"sortable-selected",multiDragKey:null,avoidImplicitDeselect:!1,setData(t,e){let n="";$t.length&&qt===o?$t.forEach((t,e)=>{n+=(e?", ":"")+t.textContent}):n=e.textContent,t.setData("Text",n)}}}return t.prototype={multiDragKeyDown:!1,isMultiDrag:!1,delayStartGlobal({dragEl:t}){Jt=t},delayEnded(){this.isMultiDrag=~$t.indexOf(Jt)},setupClone({sortable:t,cancel:e}){if(this.isMultiDrag){for(let t=0;t<$t.length;t++)Ut.push(y($t[t])),Ut[t].sortableIndex=$t[t].sortableIndex,Ut[t].draggable=!1,Ut[t].style["will-change"]="",M(Ut[t],this.options.selectedClass,!1),$t[t]===Jt&&M(Ut[t],this.options.chosenClass,!1);t._hideClone(),e()}},clone({sortable:t,rootEl:e,dispatchSortableEvent:n,cancel:o}){this.isMultiDrag&&(this.options.removeCloneOnHide||$t.length&&qt===t&&(ne(!0,e),n("clone"),o()))},showClone({cloneNowShown:t,rootEl:e,cancel:n}){this.isMultiDrag&&(ne(!1,e),Ut.forEach(t=>{N(t,"display","")}),t(),ee=!1,n())},hideClone({cloneNowHidden:t,cancel:e}){this.isMultiDrag&&(Ut.forEach(t=>{N(t,"display","none"),this.options.removeCloneOnHide&&t.parentNode&&t.parentNode.removeChild(t)}),t(),ee=!0,e())},dragStartGlobal({}){!this.isMultiDrag&&qt&&qt.multiDrag._deselectMultiDrag(),$t.forEach(t=>{t.sortableIndex=k(t)}),$t=$t.sort(function(t,e){return t.sortableIndex-e.sortableIndex}),Qt=!0},dragStarted({sortable:t}){if(this.isMultiDrag){if(this.options.sort&&(t.captureAnimationState(),this.options.animation)){$t.forEach(t=>{t!==Jt&&N(t,"position","absolute")});let e=I(Jt,!1,!0,!0);$t.forEach(t=>{t!==Jt&&D(t,e)}),Zt=!0,Vt=!0}t.animateAll(()=>{Zt=!1,Vt=!1,this.options.animation&&$t.forEach(t=>{_(t)}),this.options.sort&&oe()})}},dragOver({target:t,completed:e,cancel:n}){Zt&&~$t.indexOf(t)&&(e(!1),n())},revert({fromSortable:e,rootEl:t,sortable:n,dragRect:o}){var i,r;1<$t.length&&($t.forEach(t=>{n.addAnimationState({target:t,rect:Zt?I(t):o}),_(t),t.fromRect=o,e.removeAnimationState(t)}),Zt=!1,i=!this.options.removeCloneOnHide,r=t,$t.forEach((t,e)=>{e=r.children[t.sortableIndex+(i?Number(e):0)];e?r.insertBefore(t,e):r.appendChild(t)}))},dragOverCompleted({sortable:t,isOwner:e,insertion:n,activeSortable:o,parentEl:i,putSortable:r}){var a=this.options;if(n){if(e&&o._hideClone(),Vt=!1,a.animation&&1<$t.length&&(Zt||!e&&!o.options.sort&&!r)){let e=I(Jt,!1,!0,!0);$t.forEach(t=>{t!==Jt&&(D(t,e),i.appendChild(t))}),Zt=!0}e||(Zt||oe(),1<$t.length?(e=ee,o._showClone(t),o.options.animation&&!ee&&e&&Ut.forEach(t=>{o.addAnimationState({target:t,rect:te}),t.fromRect=te,t.thisAnimationDuration=null})):o._showClone(t))}},dragOverAnimationCapture({dragRect:t,isOwner:e,activeSortable:n}){$t.forEach(t=>{t.thisAnimationDuration=null}),n.options.animation&&!e&&n.multiDrag.isMultiDrag&&(te=a({},t),t=f(Jt,!0),te.top-=t.f,te.left-=t.e)},dragOverAnimationComplete(){Zt&&(Zt=!1,oe())},drop({originalEvent:n,rootEl:r,parentEl:a,sortable:l,dispatchSortableEvent:t,oldIndex:s,putSortable:e}){let c=e||this.sortable;if(n){let o=this.options,i=a.children;if(!Qt)if(o.multiDragKey&&!this.multiDragKeyDown&&this._deselectMultiDrag(),M(Jt,o.selectedClass,!~$t.indexOf(Jt)),~$t.indexOf(Jt))$t.splice($t.indexOf(Jt),1),jt=null,B({sortable:l,rootEl:r,name:"deselect",targetEl:Jt,originalEvent:n});else{if($t.push(Jt),B({sortable:l,rootEl:r,name:"select",targetEl:Jt,originalEvent:n}),n.shiftKey&&jt&&l.el.contains(jt)){var d=k(jt),h=k(Jt);if(~d&&~h&&d!==h){let t,e;for(t=d<h?(e=d,h):(e=h,d+1);e<t;e++)~$t.indexOf(i[e])||(M(i[e],o.selectedClass,!0),$t.push(i[e]),B({sortable:l,rootEl:r,name:"select",targetEl:i[e],originalEvent:n}))}}else jt=Jt;qt=c}if(Qt&&this.isMultiDrag){if(Zt=!1,(a[X].options.sort||a!==r)&&1<$t.length){let n=I(Jt),e=k(Jt,":not(."+this.options.selectedClass+")");if(!Vt&&o.animation&&(Jt.thisAnimationDuration=null),c.captureAnimationState(),!Vt&&(o.animation&&(Jt.fromRect=n,$t.forEach(t=>{var e;t.thisAnimationDuration=null,t!==Jt&&(e=Zt?I(t):n,t.fromRect=e,c.addAnimationState({target:t,rect:e}))})),oe(),$t.forEach(t=>{i[e]?a.insertBefore(t,i[e]):a.appendChild(t),e++}),s===k(Jt))){let e=!1;$t.forEach(t=>{t.sortableIndex!==k(t)&&(e=!0)}),e&&t("update")}$t.forEach(t=>{_(t)}),c.animateAll()}qt=c}(r===a||e&&"clone"!==e.lastPutMode)&&Ut.forEach(t=>{t.parentNode&&t.parentNode.removeChild(t)})}},nullingGlobal(){this.isMultiDrag=Qt=!1,Ut.length=0},destroyGlobal(){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(t){if(!(void 0!==Qt&&Qt||qt!==this.sortable||t&&x(t.target,this.options.draggable,this.sortable.el,!1)||t&&0!==t.button))for(;$t.length;){var e=$t[0];M(e,this.options.selectedClass,!1),$t.shift(),B({sortable:this.sortable,rootEl:this.sortable.el,name:"deselect",targetEl:e,originalEvent:t})}},_checkKeyDown(t){t.key===this.options.multiDragKey&&(this.multiDragKeyDown=!0)},_checkKeyUp(t){t.key===this.options.multiDragKey&&(this.multiDragKeyDown=!1)}},a(t,{pluginName:"multiDrag",utils:{select(t){var e=t.parentNode[X];e&&e.options.multiDrag&&!~$t.indexOf(t)&&(qt&&qt!==e&&(qt.multiDrag._deselectMultiDrag(),qt=e),M(t,e.options.selectedClass,!0),$t.push(t))},deselect(t){var e=t.parentNode[X],n=$t.indexOf(t);e&&e.options.multiDrag&&~n&&(M(t,e.options.selectedClass,!1),$t.splice(n,1))}},eventProperties(){const n=[],o=[];return $t.forEach(t=>{n.push({multiDragElement:t,index:t.sortableIndex});let e;e=Zt&&t!==Jt?-1:Zt?k(t,":not(."+this.options.selectedClass+")"):k(t),o.push({multiDragElement:t,index:e})}),{items:[...$t],clones:[...Ut],oldIndicies:n,newIndicies:o}},optionListeners:{multiDragKey(t){return"ctrl"===(t=t.toLowerCase())?t="Control":1<t.length&&(t=t.charAt(0).toUpperCase()+t.substr(1)),t}}})}),At});
/*! Sortable 0.0.5 - MIT | https://github.com/novlan1/Sortable */
!function(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(){"use strict";function a(){return(a=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var o,n=arguments[e];for(o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t}).apply(this,arguments)}function t(t){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(t)}const w=t(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),E=t(/Edge/i),c=t(/firefox/i),d=t(/safari/i)&&!t(/chrome/i)&&!t(/android/i);var e=t(/iP(ad|od|hone)/i),o=t(/chrome/i)&&t(/android/i);const n={capture:!1,passive:!1};function h(t,e,o){t.addEventListener(e,o,!w&&n)}function r(t,e,o){t.removeEventListener(e,o,!w&&n)}function l(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 x(t,e,o,n){if(t){o=o||document;do{if(null!=e&&(">"!==e[0]||t.parentNode===o)&&l(t,e)||n&&t===o)return t}while(t!==o&&(t=(i=t).host&&i!==document&&i.host.nodeType?i.host:i.parentNode))}var i;return null}const i=/\s+/g;function M(t,e,o){var n;t&&e&&(t.classList?t.classList[o?"add":"remove"](e):(n=(" "+t.className+" ").replace(i," ").replace(" "+e+" "," "),t.className=(n+(o?" "+e:"")).replace(i," ")))}function N(t,e,o){let n=t&&t.style;if(n){if(void 0===o)return document.defaultView&&document.defaultView.getComputedStyle?o=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(o=t.currentStyle),void 0===e?o:o[e];e in n||-1!==e.indexOf("webkit")||(e="-webkit-"+e),n[e]=o+("string"==typeof o?"":"px")}}function f(t,e){let o="";if("string"==typeof t)o=t;else do{var n=N(t,"transform");n&&"none"!==n&&(o=n+" "+o)}while(!e&&(t=t.parentNode));const i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(o)}function u(n,i,r){if(n){let t=n.getElementsByTagName(i),e=0,o=t.length;if(r)for(;e<o;e++)r(t[e],e);return t}return[]}function p(){var t=document.scrollingElement;return t||document.documentElement}function A(l,s,c,d,h){if(l.getBoundingClientRect||l===window){let t,e,o,n,i,r,a;if(a=l!==window&&l.parentNode&&l!==p()?(t=l.getBoundingClientRect(),e=t.top,o=t.left,n=t.bottom,i=t.right,r=t.height,t.width):(e=0,o=0,n=window.innerHeight,i=window.innerWidth,r=window.innerHeight,window.innerWidth),(s||c)&&l!==window&&(h=h||l.parentNode,!w))do{if(h&&h.getBoundingClientRect&&("none"!==N(h,"transform")||c&&"static"!==N(h,"position"))){var u=h.getBoundingClientRect();e-=u.top+parseInt(N(h,"border-top-width")),o-=u.left+parseInt(N(h,"border-left-width")),n=e+t.height,i=o+t.width;break}}while(h=h.parentNode);return d&&l!==window&&(d=(s=f(h||l))&&s.a,l=s&&s.d,s&&(e/=l,o/=d,a/=d,r/=l,n=e+r,i=o+a)),{top:e,left:o,bottom:n,right:i,width:a,height:r}}}function I(t,e,o){let n=s(t,!0),i=A(t)[e];for(;n;){let t=A(n)[o],e;if(e="top"===o||"left"===o?t<=i:i<=t,!e)return n;if(n===p())break;n=s(n,!1)}return!1}function O(t,e,o,n){let i=0,r=0,a=t.children;for(;r<a.length;){if("none"!==a[r].style.display&&a[r]!==It.ghost&&(n||a[r]!==It.dragged)&&x(a[r],o.draggable,t,!1)){if(i===e)return a[r];i++}r++}return null}function P(t,e){let o=t.lastElementChild;for(;o&&(o===It.ghost||"none"===N(o,"display")||e&&!l(o,e));)o=o.previousElementSibling;return o||null}function k(t,e){let o=0;if(!t||!t.parentNode)return-1;for(;t=t.previousElementSibling;)"TEMPLATE"===t.nodeName.toUpperCase()||t===It.clone||e&&!l(t,e)||o++;return o}function g(t){let e=0,o=0,n=p();if(t)do{var i=f(t),r=i.a,i=i.d;e+=t.scrollLeft*r,o+=t.scrollTop*i}while(t!==n&&(t=t.parentNode));return[e,o]}function s(t,e){if(!t||!t.getBoundingClientRect)return p();let o=t,n=!1;do{if(o.clientWidth<o.scrollWidth||o.clientHeight<o.scrollHeight){var i=N(o);if(o.clientWidth<o.scrollWidth&&("auto"==i.overflowX||"scroll"==i.overflowX)||o.clientHeight<o.scrollHeight&&("auto"==i.overflowY||"scroll"==i.overflowY)){if(!o.getBoundingClientRect||o===document.body)return p();if(n||e)return o;n=!0}}}while(o=o.parentNode);return p()}function m(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)}let v;function b(e,o){return function(){var t;v||(1===(t=arguments).length?e.call(this,t[0]):e.apply(this,t),v=setTimeout(function(){v=void 0},o))}}function R(t,e,o){t.scrollLeft+=e,t.scrollTop+=o}function y(t){let e=window.Polymer,o=window.jQuery||window.Zepto;return e&&e.dom?e.dom(t).cloneNode(!0):o?o(t).clone(!0)[0]:t.cloneNode(!0)}function D(t,e){N(t,"position","absolute"),N(t,"top",e.top),N(t,"left",e.left),N(t,"width",e.width),N(t,"height",e.height)}function _(t){N(t,"position",""),N(t,"top",""),N(t,"left",""),N(t,"width",""),N(t,"height","")}const X="Sortable"+(new Date).getTime();function S(){let n=[],e;return{captureAnimationState(){if(n=[],this.options.animation){let t=[].slice.call(this.el.children);t.forEach(e=>{if("none"!==N(e,"display")&&e!==It.ghost){n.push({target:e,rect:A(e)});let t={...n[n.length-1].rect};var o;!e.thisAnimationDuration||(o=f(e,!0))&&(t.top-=o.f,t.left-=o.e),e.fromRect=t}})}},addAnimationState(t){n.push(t)},removeAnimationState(t){n.splice(function(t,e){for(var o in t)if(t.hasOwnProperty(o))for(var n in e)if(e.hasOwnProperty(n)&&e[n]===t[o][n])return Number(o);return-1}(n,{target:t}),1)},animateAll(t){if(!this.options.animation)return clearTimeout(e),void("function"==typeof t&&t());let u=!1,p=0;n.forEach(t=>{let e=0,o=t.target,n=o.fromRect,i=A(o),r=o.prevFromRect,a=o.prevToRect,l=t.rect,s=f(o,!0);var c,d,h;s&&(i.top-=s.f,i.left-=s.e),o.toRect=i,o.thisAnimationDuration&&m(r,i)&&!m(n,i)&&(l.top-i.top)/(l.left-i.left)==(n.top-i.top)/(n.left-i.left)&&(e=(c=l,d=r,h=a,t=this.options,Math.sqrt(Math.pow(d.top-c.top,2)+Math.pow(d.left-c.left,2))/Math.sqrt(Math.pow(d.top-h.top,2)+Math.pow(d.left-h.left,2))*t.animation)),m(i,n)||(o.prevFromRect=n,o.prevToRect=i,e=e||this.options.animation,this.animate(o,l,i,e)),e&&(u=!0,p=Math.max(p,e),clearTimeout(o.animationResetTimer),o.animationResetTimer=setTimeout(function(){o.animationTime=0,o.prevFromRect=null,o.fromRect=null,o.prevToRect=null,o.thisAnimationDuration=null},e),o.thisAnimationDuration=e)}),clearTimeout(e),u?e=setTimeout(function(){"function"==typeof t&&t()},p):"function"==typeof t&&t(),n=[]},animate(t,e,o,n){var i,r;n&&(N(t,"transition",""),N(t,"transform",""),i=(r=f(this.el))&&r.a,r=r&&r.d,i=(e.left-o.left)/(i||1),r=(e.top-o.top)/(r||1),t.animatingX=!!i,t.animatingY=!!r,N(t,"transform","translate3d("+i+"px,"+r+"px,0)"),this.forRepaintDummy=t.offsetWidth,N(t,"transition","transform "+n+"ms"+(this.options.easing?" "+this.options.easing:"")),N(t,"transform","translate3d(0,0,0)"),"number"==typeof t.animated&&clearTimeout(t.animated),t.animated=setTimeout(function(){N(t,"transition",""),N(t,"transform",""),t.animated=!1,t.animatingX=!1,t.animatingY=!1},n))}}}let C=[];const T={initializeByDefault:!0};var Y={mount(e){for(var t in T)!T.hasOwnProperty(t)||t in e||(e[t]=T[t]);C.forEach(t=>{if(t.pluginName===e.pluginName)throw`Sortable: Cannot mount plugin ${e.pluginName} more than once`}),C.push(e)},pluginEvent(e,o,n){this.eventCanceled=!1,n.cancel=()=>{this.eventCanceled=!0};const i=e+"Global";C.forEach(t=>{o[t.pluginName]&&(o[t.pluginName][i]&&o[t.pluginName][i]({sortable:o,...n}),o.options[t.pluginName]&&o[t.pluginName][e]&&o[t.pluginName][e]({sortable:o,...n}))})},initializePlugins(n,i,r,t){for(var e in C.forEach(e=>{var o=e.pluginName;if(n.options[o]||e.initializeByDefault){let t=new e(n,i,n.options);t.sortable=n,t.options=n.options,n[o]=t,a(r,t.defaults)}}),n.options){var o;n.options.hasOwnProperty(e)&&(void 0!==(o=this.modifyOption(n,e,n.options[e]))&&(n.options[e]=o))}},getEventProperties(e,o){let n={};return C.forEach(t=>{"function"==typeof t.eventProperties&&a(n,t.eventProperties.call(o[t.pluginName],e))}),n},modifyOption(e,o,n){let i;return C.forEach(t=>{e[t.pluginName]&&t.optionListeners&&"function"==typeof t.optionListeners[o]&&(i=t.optionListeners[o].call(e[t.pluginName],n))}),i}};function B({sortable:n,rootEl:i,name:r,targetEl:a,cloneEl:l,toEl:s,fromEl:c,oldIndex:d,newIndex:h,oldDraggableIndex:u,newDraggableIndex:p,originalEvent:f,putSortable:g,extraEventProperties:m}){if(n=n||i&&i[X]){let t,e=n.options,o="on"+r.charAt(0).toUpperCase()+r.substr(1);!window.CustomEvent||w||E?(t=document.createEvent("Event"),t.initEvent(r,!0,!0)):t=new CustomEvent(r,{bubbles:!0,cancelable:!0}),t.to=s||i,t.from=c||i,t.item=a||i,t.clone=l,t.oldIndex=d,t.newIndex=h,t.oldDraggableIndex=u,t.newDraggableIndex=p,t.originalEvent=f,t.pullMode=g?g.lastPutMode:void 0;var v,b={...m,...Y.getEventProperties(r,n)};for(v in b)t[v]=b[v];i&&i.dispatchEvent(t),e[o]&&e[o].call(n,t)}}let F=function(t,e,{evt:o,...n}={}){Y.pluginEvent.bind(It)(t,e,{dragEl:L,parentEl:K,ghostEl:W,rootEl:z,nextEl:G,lastDownEl:$,cloneEl:U,cloneHidden:j,dragStarted:dt,putSortable:tt,activeSortable:It.active,originalEvent:o,oldIndex:q,oldDraggableIndex:Z,newIndex:V,newDraggableIndex:Q,hideGhostForTarget:xt,unhideGhostForTarget:Mt,cloneNowHidden(){j=!0},cloneNowShown(){j=!1},dispatchSortableEvent(t){H({sortable:e,name:t,originalEvent:o})},...n})};function H(t){B({putSortable:tt,cloneEl:U,targetEl:L,rootEl:z,oldIndex:q,oldDraggableIndex:Z,newIndex:V,newDraggableIndex:Q,...t})}let L,K,W,z,G,$,U,j,q,V,Z,Q,J,tt,et=!1,ot=!1,nt=[],it,rt,at,lt,st,ct,dt,ht,ut,pt=!1,ft=!1,gt,mt,vt=[],bt=!1,wt=[];const Et="undefined"!=typeof document,yt=e,Dt=E||w?"cssFloat":"float",_t=Et&&!o&&!e&&"draggable"in document.createElement("div"),St=function(){if(Et){if(w)return!1;let t=document.createElement("x");return t.style.cssText="pointer-events:auto","auto"===t.style.pointerEvents}}(),Ct=function(t,e){let o=N(t),n=parseInt(o.width)-parseInt(o.paddingLeft)-parseInt(o.paddingRight)-parseInt(o.borderLeftWidth)-parseInt(o.borderRightWidth),i=O(t,0,e),r=O(t,1,e),a=i&&N(i),l=r&&N(r),s=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+A(i).width,c=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+A(r).width;if("flex"===o.display)return"column"===o.flexDirection||"column-reverse"===o.flexDirection?"vertical":"horizontal";if("grid"===o.display)return o.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(i&&a.float&&"none"!==a.float){e="left"===a.float?"left":"right";return!r||"both"!==l.clear&&l.clear!==e?"horizontal":"vertical"}return i&&("block"===a.display||"flex"===a.display||"table"===a.display||"grid"===a.display||n<=s&&"none"===o[Dt]||r&&"none"===o[Dt]&&n<s+c)?"vertical":"horizontal"},Tt=function(t){function l(r,a){return function(t,e,o,n){var i=t.options.group.name&&e.options.group.name&&t.options.group.name===e.options.group.name;if(null==r&&(a||i))return!0;if(null==r||!1===r)return!1;if(a&&"clone"===r)return r;if("function"==typeof r)return l(r(t,e,o,n),a)(t,e,o,n);e=(a?t:e).options.group.name;return!0===r||"string"==typeof r&&r===e||r.join&&-1<r.indexOf(e)}}let e={},o=t.group;o&&"object"==typeof o||(o={name:o}),e.name=o.name,e.checkPull=l(o.pull,!0),e.checkPut=l(o.put),e.revertClone=o.revertClone,t.group=e},xt=function(){!St&&W&&N(W,"display","none")},Mt=function(){!St&&W&&N(W,"display","")};Et&&document.addEventListener("click",function(t){if(ot)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),ot=!1},!0);let Nt=function(o){if(L){let e=function(i,r){let a;return nt.some(t=>{var e=t[X].options.emptyInsertThreshold;if(e&&!P(t)){var o=A(t),n=i>=o.left-e&&i<=o.right+e,e=r>=o.top-e&&r<=o.bottom+e;return n&&e?a=t:void 0}}),a}((o=o.touches?o.touches[0]:o).clientX,o.clientY);if(e){let t={};for(var n in o)o.hasOwnProperty(n)&&(t[n]=o[n]);t.target=t.rootEl=e,t.preventDefault=void 0,t.stopPropagation=void 0,e[X]._onDragOver(t)}}},At=function(t){L&&L.parentNode[X]._isOutsideThisEl(t.target)};function It(t,e){if(!t||!t.nodeType||1!==t.nodeType)throw`Sortable: \`el\` must be an HTMLElement, not ${{}.toString.call(t)}`;this.el=t,this.options=e=a({},e),t[X]=this;var o,n,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 Ct(t,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,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!==It.supportPointer&&"PointerEvent"in window&&!d,emptyInsertThreshold:5};for(o in Y.initializePlugins(this,t,i),i)o in e||(e[o]=i[o]);for(n in Tt(e),this)"_"===n.charAt(0)&&"function"==typeof this[n]&&(this[n]=this[n].bind(this));this.nativeDraggable=!e.forceFallback&&_t,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?h(t,"pointerdown",this._onTapStart):(h(t,"mousedown",this._onTapStart),h(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(h(t,"dragover",this),h(t,"dragenter",this)),nt.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),a(this,S())}function Ot(t,e,o,n,i,r,a,l){let s,c=t[X],d=c.options.onMove,h;return!window.CustomEvent||w||E?(s=document.createEvent("Event"),s.initEvent("move",!0,!0)):s=new CustomEvent("move",{bubbles:!0,cancelable:!0}),s.to=e,s.from=t,s.dragged=o,s.draggedRect=n,s.related=i||e,s.relatedRect=r||A(e),s.willInsertAfter=l,s.originalEvent=a,t.dispatchEvent(s),d&&(h=d.call(c,s,a)),h}function Pt(t){t.draggable=!1}function kt(){bt=!1}function Rt(t){return setTimeout(t,0)}function Xt(t){return clearTimeout(t)}It.prototype={constructor:It,_isOutsideThisEl:function(t){this.el.contains(t)||t===this.el||(ht=null)},_getDirection:function(t,e){return"function"==typeof this.options.direction?this.options.direction.call(this,t,e,L):this.options.direction},_onTapStart:function(c){if(c.cancelable){let e=this,o=this.el,t=this.options,n=t.preventOnFilter,i=c.type,r=c.touches&&c.touches[0]||c.pointerType&&"touch"===c.pointerType&&c,a=(r||c).target,l=c.target.shadowRoot&&(c.path&&c.path[0]||c.composedPath&&c.composedPath()[0])||a,s=t.filter;if(!function(t){wt.length=0;let e=t.getElementsByTagName("input"),o=e.length;for(;o--;){var n=e[o];n.checked&&wt.push(n)}}(o),!L&&!(/mousedown|pointerdown/.test(i)&&0!==c.button||t.disabled)&&!l.isContentEditable&&(this.nativeDraggable||!d||!a||"SELECT"!==a.tagName.toUpperCase())&&(a=x(a,t.draggable,o,!1),!(a&&a.animated||$===a))){if(q=k(a),Z=k(a,t.draggable),"function"==typeof s){if(s.call(this,c,a,this))return H({sortable:e,rootEl:l,name:"filter",targetEl:a,toEl:o,fromEl:o}),F("filter",e,{evt:c}),void(n&&c.cancelable&&c.preventDefault())}else if(s&&(s=s.split(",").some(function(t){if(t=x(l,t.trim(),o,!1))return H({sortable:e,rootEl:t,name:"filter",targetEl:a,fromEl:o,toEl:o}),F("filter",e,{evt:c}),!0}),s))return void(n&&c.cancelable&&c.preventDefault());t.handle&&!x(l,t.handle,o,!1)||this._prepareDragStart(c,r,a)}}},_prepareDragStart:function(t,e,o){let n=this,i=n.el,r=n.options,a=i.ownerDocument,l;var s;o&&!L&&o.parentNode===i&&(s=A(o),z=i,L=o,K=L.parentNode,G=L.nextSibling,$=o,J=r.group,It.dragged=L,it={target:L,clientX:(e||t).clientX,clientY:(e||t).clientY},st=it.clientX-s.left,ct=it.clientY-s.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,L.style["will-change"]="all",l=function(){F("delayEnded",n,{evt:t}),It.eventCanceled?n._onDrop():(n._disableDelayedDragEvents(),!c&&n.nativeDraggable&&(L.draggable=!0),n._triggerDragStart(t,e),H({sortable:n,name:"choose",originalEvent:t}),M(L,r.chosenClass,!0))},r.ignore.split(",").forEach(function(t){u(L,t.trim(),Pt)}),h(a,"dragover",Nt),h(a,"mousemove",Nt),h(a,"touchmove",Nt),h(a,"mouseup",n._onDrop),h(a,"touchend",n._onDrop),h(a,"touchcancel",n._onDrop),c&&this.nativeDraggable&&(this.options.touchStartThreshold=4,L.draggable=!0),F("delayStart",this,{evt:t}),!r.delay||r.delayOnTouchOnly&&!e||this.nativeDraggable&&(E||w)?l():It.eventCanceled?this._onDrop():(h(a,"mouseup",n._disableDelayedDrag),h(a,"touchend",n._disableDelayedDrag),h(a,"touchcancel",n._disableDelayedDrag),h(a,"mousemove",n._delayedDragTouchMoveHandler),h(a,"touchmove",n._delayedDragTouchMoveHandler),r.supportPointer&&h(a,"pointermove",n._delayedDragTouchMoveHandler),n._dragStartTimer=setTimeout(l,r.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(){L&&Pt(L),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,"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?h(document,"pointermove",this._onTouchMove):h(document,e?"touchmove":"mousemove",this._onTouchMove):(h(L,"dragend",this),h(z,"dragstart",this._onDragStart));try{document.selection?Rt(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch(t){}},_dragStarted:function(t,e){var o;et=!1,z&&L?(F("dragStarted",this,{evt:e}),this.nativeDraggable&&h(document,"dragover",At),o=this.options,t||M(L,o.dragClass,!1),M(L,o.ghostClass,!0),It.active=this,t&&this._appendGhost(),H({sortable:this,name:"start",originalEvent:e})):this._nulling()},_emulateDragOver:function(){if(rt){this._lastX=rt.clientX,this._lastY=rt.clientY,xt();let t=document.elementFromPoint(rt.clientX,rt.clientY),e=t;for(;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(rt.clientX,rt.clientY),t!==e);)e=t;if(L.parentNode[X]._isOutsideThisEl(t),e)do{if(e[X])if(e[X]._onDragOver({clientX:rt.clientX,clientY:rt.clientY,target:t,rootEl:e})&&!this.options.dragoverBubble)break}while(t=e,e=e.parentNode);Mt()}},_onTouchMove:function(d){if(it){let t=this.options,e=t.fallbackTolerance,o=t.fallbackOffset,n=d.touches?d.touches[0]:d,i=W&&f(W,!0),r=W&&i&&i.a,a=W&&i&&i.d,l=yt&&mt&&g(mt),s=(n.clientX-it.clientX+o.x)/(r||1)+(l?l[0]-vt[0]:0)/(r||1),c=(n.clientY-it.clientY+o.y)/(a||1)+(l?l[1]-vt[1]:0)/(a||1);if(!It.active&&!et){if(e&&Math.max(Math.abs(n.clientX-this._lastX),Math.abs(n.clientY-this._lastY))<e)return;this._onDragStart(d,!0)}var h;W&&(i?(i.e+=s-(at||0),i.f+=c-(lt||0)):i={a:1,b:0,c:0,d:1,e:s,f:c},h=`matrix(${i.a},${i.b},${i.c},${i.d},${i.e},${i.f})`,N(W,"webkitTransform",h),N(W,"mozTransform",h),N(W,"msTransform",h),N(W,"transform",h),at=s,lt=c,rt=n),d.cancelable&&d.preventDefault()}},_appendGhost:function(){if(!W){let t=this.options.fallbackOnBody?document.body:z,e=A(L,!0,yt,!0,t),o=this.options;if(yt){for(mt=t;"static"===N(mt,"position")&&"none"===N(mt,"transform")&&mt!==document;)mt=mt.parentNode;mt!==document.body&&mt!==document.documentElement?(mt===document&&(mt=p()),e.top+=mt.scrollTop,e.left+=mt.scrollLeft):mt=p(),vt=g(mt)}W=L.cloneNode(!0),M(W,o.ghostClass,!1),M(W,o.fallbackClass,!0),M(W,o.dragClass,!0),N(W,"transition",""),N(W,"transform",""),N(W,"box-sizing","border-box"),N(W,"margin",0),N(W,"top",e.top),N(W,"left",e.left),N(W,"width",e.width),N(W,"height",e.height),N(W,"opacity","0.8"),N(W,"position",yt?"absolute":"fixed"),N(W,"zIndex","100000"),N(W,"pointerEvents","none"),It.ghost=W,t.appendChild(W),N(W,"transform-origin",st/parseInt(W.style.width)*100+"% "+ct/parseInt(W.style.height)*100+"%")}},_onDragStart:function(t,e){let o=this,n=t.dataTransfer,i=o.options;F("dragStart",this,{evt:t}),It.eventCanceled?this._onDrop():(F("setupClone",this),It.eventCanceled||(U=y(L),U.removeAttribute("id"),U.draggable=!1,U.style["will-change"]="",this._hideClone(),M(U,this.options.chosenClass,!1),It.clone=U),o.cloneId=Rt(function(){F("clone",o),It.eventCanceled||(o.options.removeCloneOnHide||z.insertBefore(U,L),o._hideClone(),H({sortable:o,name:"clone"}))}),e||M(L,i.dragClass,!0),e?(ot=!0,o._loopId=setInterval(o._emulateDragOver,50)):(r(document,"mouseup",o._onDrop),r(document,"touchend",o._onDrop),r(document,"touchcancel",o._onDrop),n&&(n.effectAllowed="move",i.setData&&i.setData.call(o,n,L)),h(document,"drop",o),N(L,"transform","translateZ(0)")),et=!0,o._dragStartId=Rt(o._dragStarted.bind(o,e,t)),h(document,"selectstart",o),dt=!0,d&&N(document.body,"user-select","none"))},_onDragOver:function(d){let h=this.el,u=d.target,p,f,o,g=this.options,t=g.group,e=It.active,n=J===t,i=g.sort,r=tt||e,m,a=this,l=!1;if(!bt){if(void 0!==d.preventDefault&&d.cancelable&&d.preventDefault(),u=x(u,g.draggable,h,!0),s("dragOver"),It.eventCanceled)return l;if(L.contains(d.target)||u.animated&&u.animatingX&&u.animatingY||a._ignoreWhileAnimating===u)return C(!1);if(ot=!1,e&&!g.disabled&&(n?i||(o=K!==z):tt===this||(this.lastPutMode=J.checkPull(this,e,L,d))&&t.checkPut(this,e,L,d))){if(m="vertical"===this._getDirection(d,u),p=A(L),s("dragOverValid"),It.eventCanceled)return l;if(o)return K=z,S(),this._hideClone(),s("revert"),It.eventCanceled||(G?z.insertBefore(L,G):z.appendChild(L)),C(!0);var v=P(h,g.draggable);if(!v||function(t,e,o){o=A(P(o.el,o.options.draggable));return e?t.clientX>o.right+10||t.clientX<=o.right&&t.clientY>o.bottom&&t.clientX>=o.left:t.clientX>o.right&&t.clientY>o.top||t.clientX<=o.right&&t.clientY>o.bottom+10}(d,m,this)&&!v.animated){if(v===L)return C(!1);if(v&&h===d.target&&(u=v),u&&(f=A(u)),!1!==Ot(z,h,L,p,u,f,d,!!u))return S(),v&&v.nextSibling?h.insertBefore(L,v.nextSibling):h.appendChild(L),K=h,T(),C(!0)}else if(v&&function(t,e,o){o=A(O(o.el,0,o.options,!0));return e?t.clientX<o.left-10||t.clientY<o.top&&t.clientX<o.right:t.clientY<o.top-10||t.clientY<o.bottom&&t.clientX<o.left}(d,m,this)){var b=O(h,0,g,!0);if(b===L)return C(!1);if(u=b,f=A(u),!1!==Ot(z,h,L,p,u,f,d,!1))return S(),h.insertBefore(L,b),K=h,T(),C(!0)}else if(u.parentNode===h){f=A(u);let e,t,o=L.parentNode!==h,n=(w=L.animated&&L.toRect||p,E=u.animated&&u.toRect||f,y=m,D=y?w.left:w.top,_=y?w.right:w.bottom,v=y?w.width:w.height,b=y?E.left:E.top,w=y?E.right:E.bottom,E=y?E.width:E.height,!(D===b||_===w||D+v/2===b+E/2)),i=m?"top":"left",r=I(u,"top","top")||I(L,"top","top"),a=r?r.scrollTop:void 0;ht!==u&&(t=f[i],pt=!1,ft=!n&&g.invertSwap||o);let l;if(0!==(e=function(t,e,o,n,i,r,a,l){let s=n?t.clientY:t.clientX,c=n?o.height:o.width,d=n?o.top:o.left,h=n?o.bottom:o.right,u=!1;if(!a)if(l&&gt<c*i){if(!pt&&(1===ut?d+c*r/2<s:s<h-c*r/2)&&(pt=!0),pt)u=!0;else if(1===ut?s<d+gt:s>h-gt)return-ut}else if(d+c*(1-i)/2<s&&s<h-c*(1-i)/2)return function(t){return k(L)<k(t)?1:-1}(e);if(u=u||a,u&&(s<d+c*r/2||h-c*r/2<s))return d+c/2<s?1:-1;return 0}(d,u,f,m,n?1:g.swapThreshold,null==g.invertedSwapThreshold?g.swapThreshold:g.invertedSwapThreshold,ft,ht===u))){let t=k(L);for(;t-=e,l=K.children[t],l&&("none"===N(l,"display")||l===W););}if(0===e||l===u)return C(!1);ht=u,ut=e;let s=u.nextElementSibling,c=!1;c=1===e;E=Ot(z,h,L,p,u,f,d,c);if(!1!==E)return 1!==E&&-1!==E||(c=1===E),bt=!0,setTimeout(kt,30),S(),c&&!s?h.appendChild(L):u.parentNode.insertBefore(L,c?s:u),r&&R(r,0,a-r.scrollTop),K=L.parentNode,void 0===t||ft||(gt=Math.abs(t-A(u)[i])),T(),C(!0)}if(h.contains(L))return C(!1)}var w,E,y,D,_;return!1}function s(t,e){F(t,a,{evt:d,isOwner:n,axis:m?"vertical":"horizontal",revert:o,dragRect:p,targetRect:f,canSort:i,fromSortable:r,target:u,completed:C,onMove(t,e){return Ot(z,h,L,p,t,A(t),d,e)},changed:T,...e})}function S(){s("dragOverAnimationCapture"),a.captureAnimationState(),a!==r&&r.captureAnimationState()}function C(t){return s("dragOverCompleted",{insertion:t}),t&&(n?e._hideClone():e._showClone(a),a!==r&&(M(L,(tt||e).options.ghostClass,!1),M(L,g.ghostClass,!0)),tt!==a&&a!==It.active?tt=a:a===It.active&&tt&&(tt=null),r===a&&(a._ignoreWhileAnimating=u),a.animateAll(function(){s("dragOverAnimationComplete"),a._ignoreWhileAnimating=null}),a!==r&&(r.animateAll(),r._ignoreWhileAnimating=null)),(u===L&&!L.animated||u===h&&!u.animated)&&(ht=null),g.dragoverBubble||d.rootEl||u===document||(L.parentNode[X]._isOutsideThisEl(d.target),t||Nt(d)),!g.dragoverBubble&&d.stopPropagation&&d.stopPropagation(),l=!0}function T(){V=k(L),Q=k(L,g.draggable),H({sortable:a,name:"change",toEl:h,newIndex:V,newDraggableIndex:Q,originalEvent:d})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){r(document,"mousemove",this._onTouchMove),r(document,"touchmove",this._onTouchMove),r(document,"pointermove",this._onTouchMove),r(document,"dragover",Nt),r(document,"mousemove",Nt),r(document,"touchmove",Nt)},_offUpEvents:function(){var t=this.el.ownerDocument;r(t,"mouseup",this._onDrop),r(t,"touchend",this._onDrop),r(t,"pointerup",this._onDrop),r(t,"touchcancel",this._onDrop),r(document,"selectstart",this)},_onDrop:function(t){var e=this.el,o=this.options;V=k(L),Q=k(L,o.draggable),F("drop",this,{evt:t}),K=L&&L.parentNode,V=k(L),Q=k(L,o.draggable),It.eventCanceled||(et=!1,ft=!1,pt=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),Xt(this.cloneId),Xt(this._dragStartId),this.nativeDraggable&&(r(document,"drop",this),r(e,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),d&&N(document.body,"user-select",""),N(L,"transform",""),t&&(dt&&(t.cancelable&&t.preventDefault(),o.dropBubble||t.stopPropagation()),W&&W.parentNode&&W.parentNode.removeChild(W),(z===K||tt&&"clone"!==tt.lastPutMode)&&U&&U.parentNode&&U.parentNode.removeChild(U),L&&(this.nativeDraggable&&r(L,"dragend",this),Pt(L),L.style["will-change"]="",dt&&!et&&M(L,(tt||this).options.ghostClass,!1),M(L,this.options.chosenClass,!1),H({sortable:this,name:"unchoose",toEl:K,newIndex:null,newDraggableIndex:null,originalEvent:t}),z!==K?(0<=V&&(H({rootEl:K,name:"add",toEl:K,fromEl:z,originalEvent:t}),H({sortable:this,name:"remove",toEl:K,originalEvent:t}),H({rootEl:K,name:"sort",toEl:K,fromEl:z,originalEvent:t}),H({sortable:this,name:"sort",toEl:K,originalEvent:t})),tt&&tt.save()):V!==q&&0<=V&&(H({sortable:this,name:"update",toEl:K,originalEvent:t}),H({sortable:this,name:"sort",toEl:K,originalEvent:t})),It.active&&(null!=V&&-1!==V||(V=q,Q=Z),H({sortable:this,name:"end",toEl:K,originalEvent:t}),this.save())))),this._nulling()},_nulling:function(){F("nulling",this),z=L=K=W=G=U=$=j=it=rt=dt=V=Q=q=Z=ht=ut=tt=J=It.dragged=It.ghost=It.clone=It.active=null,wt.forEach(function(t){t.checked=!0}),wt.length=at=lt=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":L&&(this._onDragOver(t),function(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move");t.cancelable&&t.preventDefault()}(t));break;case"selectstart":t.preventDefault()}},toArray:function(){let t=[],e,o=this.el.children,n=0,i=o.length,r=this.options;for(;n<i;n++)e=o[n],x(e,r.draggable,this.el,!1)&&t.push(e.getAttribute(r.dataIdAttr)||function(t){let e=t.tagName+t.className+t.src+t.href+t.textContent,o=e.length,n=0;for(;o--;)n+=e.charCodeAt(o);return n.toString(36)}(e));return t},sort:function(t,e){let o={},n=this.el;this.toArray().forEach(function(t,e){e=n.children[e];x(e,this.options.draggable,n,!1)&&(o[t]=e)},this),e&&this.captureAnimationState(),t.forEach(function(t){o[t]&&(n.removeChild(o[t]),n.appendChild(o[t]))}),e&&this.animateAll()},save:function(){let t=this.options.store;t&&t.set&&t.set(this)},closest:function(t,e){return x(t,e||this.options.draggable,this.el,!1)},option:function(t,e){let o=this.options;if(void 0===e)return o[t];var n=Y.modifyOption(this,t,e);o[t]=void 0!==n?n:e,"group"===t&&Tt(o)},destroy:function(){F("destroy",this);let t=this.el;t[X]=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(),nt.splice(nt.indexOf(this.el),1),this.el=t=null},_hideClone:function(){j||(F("hideClone",this),It.eventCanceled||(N(U,"display","none"),this.options.removeCloneOnHide&&U.parentNode&&U.parentNode.removeChild(U),j=!0))},_showClone:function(t){"clone"===t.lastPutMode?j&&(F("showClone",this),It.eventCanceled||(L.parentNode!=z||this.options.group.revertClone?G?z.insertBefore(U,G):z.appendChild(U):z.insertBefore(U,L),this.options.group.revertClone&&this.animate(L,U),N(U,"display",""),j=!1)):this._hideClone()}},Et&&h(document,"touchmove",function(t){(It.active||et)&&t.cancelable&&t.preventDefault()}),It.utils={on:h,off:r,css:N,find:u,is:function(t,e){return!!x(t,e,t,!1)},extend:function(t,e){if(t&&e)for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o]);return t},throttle:b,closest:x,toggleClass:M,clone:y,index:k,nextTick:Rt,cancelNextTick:Xt,detectDirection:Ct,getChild:O},It.get=function(t){return t[X]},It.mount=function(...t){(t=t[0].constructor===Array?t[0]:t).forEach(t=>{if(!t.prototype||!t.prototype.constructor)throw`Sortable: Mounted plugin must be a constructor function, not ${{}.toString.call(t)}`;t.utils&&(It.utils={...It.utils,...t.utils}),Y.mount(t)})},It.create=function(t,e){return new It(t,e)};let Yt=[],Bt,Ft,Ht=!(It.version="0.0.5"),Lt,Kt,Wt,zt=0,Gt;function $t(){Yt.forEach(function(t){clearInterval(t.pid)}),Yt=[]}function Ut(){clearInterval(Gt)}const jt=b(function(b,t,e,w){if(t.scroll){const D=(b.touches?b.touches[0]:b).clientX,_=(b.touches?b.touches[0]:b).clientY,S=t.scrollSensitivity,C=t.scrollSpeed,T=p();let f=!1,g;Ft!==e&&(Ft=e,$t(),Bt=t.scroll,g=t.scrollFn,!0===Bt&&(Bt=s(e,!0)));let m=0,v=Bt;zt=zt||Bt.scrollHeight;do{let t=v,e=A(t),o=e.top,n=e.bottom,i=e.left,r=e.right,a=e.width,l=e.height,s,c,d=t.scrollWidth,h=N(t),u=t.scrollLeft,p=t.scrollTop;c=t===T?(s=a<d&&("auto"===h.overflowX||"scroll"===h.overflowX||"visible"===h.overflowX),l<zt&&("auto"===h.overflowY||"scroll"===h.overflowY||"visible"===h.overflowY)):(s=a<d&&("auto"===h.overflowX||"scroll"===h.overflowX),l<zt&&("auto"===h.overflowY||"scroll"===h.overflowY));var E=s&&(Math.abs(r-D)<=S&&u+a<d)-(Math.abs(i-D)<=S&&!!u),y=c&&(Math.abs(n-_)<=S&&p+l<zt)-(Math.abs(o-_)<=S&&!!p);if(!Yt[m])for(let t=0;t<=m;t++)Yt[t]||(Yt[t]={});Yt[m].vx==E&&Yt[m].vy==y&&Yt[m].el===t||(Yt[m].el=t,Yt[m].vx=E,Yt[m].vy=y,clearInterval(Yt[m].pid),0==E&&0==y||(f=!0,Yt[m].pid=setInterval(function(){w&&0===this.layer&&It.active._onTouchMove(Wt);var t=Yt[this.layer].vy?Yt[this.layer].vy*C:0,e=Yt[this.layer].vx?Yt[this.layer].vx*C:0;"function"==typeof g&&"continue"!==g.call(It.dragged.parentNode[X],e,t,b,Wt,Yt[this.layer].el)||R(Yt[this.layer].el,e,t)}.bind({layer:m}),24))),m++}while(t.bubbleScroll&&v!==T&&(v=s(v,!1)));Ht=f}},30);e=function({originalEvent:e,putSortable:o,dragEl:n,activeSortable:i,dispatchSortableEvent:r,hideGhostForTarget:a,unhideGhostForTarget:l}){if(e){let t=o||i;a();e=e.changedTouches&&e.changedTouches.length?e.changedTouches[0]:e,e=document.elementFromPoint(e.clientX,e.clientY);l(),t&&!t.el.contains(e)&&(r("spill"),this.onSpill({dragEl:n,putSortable:o}))}};function qt(){}function Vt(){}qt.prototype={startIndex:null,dragStart({oldDraggableIndex:t}){this.startIndex=t},onSpill({dragEl:t,putSortable:e}){this.sortable.captureAnimationState(),e&&e.captureAnimationState();var o=O(this.sortable.el,this.startIndex,this.options);o?this.sortable.el.insertBefore(t,o):this.sortable.el.appendChild(t),this.sortable.animateAll(),e&&e.animateAll()},drop:e},a(qt,{pluginName:"revertOnSpill"}),Vt.prototype={onSpill({dragEl:t,putSortable:e}){const o=e||this.sortable;o.captureAnimationState(),t.parentNode&&t.parentNode.removeChild(t),o.animateAll()},drop:e},a(Vt,{pluginName:"removeOnSpill"});let Zt;let Qt=[],Jt=[],te,ee,oe=!1,ne=!1,ie=!1,re,ae,le;function se(o,n){Jt.forEach((t,e)=>{e=n.children[t.sortableIndex+(o?Number(e):0)];e?n.insertBefore(t,e):n.appendChild(t)})}function ce(){Qt.forEach(t=>{t!==re&&t.parentNode&&t.parentNode.removeChild(t)})}return It.mount(new function(){function t(){for(var t in this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0},this)"_"===t.charAt(0)&&"function"==typeof this[t]&&(this[t]=this[t].bind(this))}return t.prototype={dragStarted({originalEvent:t}){this.sortable.nativeDraggable?h(document,"dragover",this._handleAutoScroll):this.options.supportPointer?h(document,"pointermove",this._handleFallbackAutoScroll):t.touches?h(document,"touchmove",this._handleFallbackAutoScroll):h(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted({originalEvent:t}){this.options.dragOverBubble||t.rootEl||this._handleAutoScroll(t)},drop(){this.sortable.nativeDraggable?r(document,"dragover",this._handleAutoScroll):(r(document,"pointermove",this._handleFallbackAutoScroll),r(document,"touchmove",this._handleFallbackAutoScroll),r(document,"mousemove",this._handleFallbackAutoScroll)),Ut(),$t(),clearTimeout(v),v=void 0},nulling(){Wt=Ft=Bt=Ht=Gt=Lt=Kt=null,Yt.length=0},_handleFallbackAutoScroll(t){this._handleAutoScroll(t,!0)},_handleAutoScroll(o,n){const i=(o.touches?o.touches[0]:o).clientX,r=(o.touches?o.touches[0]:o).clientY,t=document.elementFromPoint(i,r);if(Wt=o,n||this.options.forceAutoScrollFallback||E||w||d){jt(o,this.options,t,n);let e=s(t,!0);!Ht||Gt&&i===Lt&&r===Kt||(Gt&&Ut(),Gt=setInterval(()=>{var t=s(document.elementFromPoint(i,r),!0);t!==e&&(e=t,$t()),jt(o,this.options,t,n)},10),Lt=i,Kt=r)}else this.options.bubbleScroll&&s(t,!0)!==p()?jt(o,this.options,s(t,!1),!1):$t()}},a(t,{pluginName:"scroll",initializeByDefault:!0})}),It.mount(Vt,qt),It.mount(new function(){function t(){this.defaults={swapClass:"sortable-swap-highlight"}}return t.prototype={dragStart({dragEl:t}){Zt=t},dragOverValid({completed:t,target:e,onMove:o,activeSortable:n,changed:i,cancel:r}){var a;n.options.swap&&(a=this.sortable.el,n=this.options,e&&e!==a&&(a=Zt,Zt=!1!==o(e)?(M(e,n.swapClass,!0),e):null,a&&a!==Zt&&M(a,n.swapClass,!1)),i(),t(!0),r())},drop({activeSortable:t,putSortable:e,dragEl:o}){let n=e||this.sortable;var i=this.options;Zt&&M(Zt,i.swapClass,!1),Zt&&(i.swap||e&&e.options.swap)&&o!==Zt&&(n.captureAnimationState(),n!==t&&t.captureAnimationState(),function(t,e){let o=t.parentNode,n=e.parentNode,i,r;o&&n&&!o.isEqualNode(e)&&!n.isEqualNode(t)&&(i=k(t),r=k(e),o.isEqualNode(n)&&i<r&&r++,o.insertBefore(e,o.children[i]),n.insertBefore(t,n.children[r]))}(o,Zt),n.animateAll(),n!==t&&t.animateAll())},nulling(){Zt=null}},a(t,{pluginName:"swap",eventProperties(){return{swapItem:Zt}}})}),It.mount(new function(){function t(n){for(var t in this)"_"===t.charAt(0)&&"function"==typeof this[t]&&(this[t]=this[t].bind(this));n.options.avoidImplicitDeselect||(n.options.supportPointer?h(document,"pointerup",this._deselectMultiDrag):(h(document,"mouseup",this._deselectMultiDrag),h(document,"touchend",this._deselectMultiDrag))),h(document,"keydown",this._checkKeyDown),h(document,"keyup",this._checkKeyUp),this.defaults={selectedClass:"sortable-selected",multiDragKey:null,avoidImplicitDeselect:!1,setData(t,e){let o="";Qt.length&&ee===n?Qt.forEach((t,e)=>{o+=(e?", ":"")+t.textContent}):o=e.textContent,t.setData("Text",o)}}}return t.prototype={multiDragKeyDown:!1,isMultiDrag:!1,delayStartGlobal({dragEl:t}){re=t},delayEnded(){this.isMultiDrag=~Qt.indexOf(re)},setupClone({sortable:t,cancel:e}){if(this.isMultiDrag){for(let t=0;t<Qt.length;t++)Jt.push(y(Qt[t])),Jt[t].sortableIndex=Qt[t].sortableIndex,Jt[t].draggable=!1,Jt[t].style["will-change"]="",M(Jt[t],this.options.selectedClass,!1),Qt[t]===re&&M(Jt[t],this.options.chosenClass,!1);t._hideClone(),e()}},clone({sortable:t,rootEl:e,dispatchSortableEvent:o,cancel:n}){this.isMultiDrag&&(this.options.removeCloneOnHide||Qt.length&&ee===t&&(se(!0,e),o("clone"),n()))},showClone({cloneNowShown:t,rootEl:e,cancel:o}){this.isMultiDrag&&(se(!1,e),Jt.forEach(t=>{N(t,"display","")}),t(),le=!1,o())},hideClone({cloneNowHidden:t,cancel:e}){this.isMultiDrag&&(Jt.forEach(t=>{N(t,"display","none"),this.options.removeCloneOnHide&&t.parentNode&&t.parentNode.removeChild(t)}),t(),le=!0,e())},dragStartGlobal({}){!this.isMultiDrag&&ee&&ee.multiDrag._deselectMultiDrag(),Qt.forEach(t=>{t.sortableIndex=k(t)}),Qt=Qt.sort(function(t,e){return t.sortableIndex-e.sortableIndex}),ie=!0},dragStarted({sortable:t}){if(this.isMultiDrag){if(this.options.sort&&(t.captureAnimationState(),this.options.animation)){Qt.forEach(t=>{t!==re&&N(t,"position","absolute")});let e=A(re,!1,!0,!0);Qt.forEach(t=>{t!==re&&D(t,e)}),ne=!0,oe=!0}t.animateAll(()=>{ne=!1,oe=!1,this.options.animation&&Qt.forEach(t=>{_(t)}),this.options.sort&&ce()})}},dragOver({target:t,completed:e,cancel:o}){ne&&~Qt.indexOf(t)&&(e(!1),o())},revert({fromSortable:e,rootEl:t,sortable:o,dragRect:n}){var i,r;1<Qt.length&&(Qt.forEach(t=>{o.addAnimationState({target:t,rect:ne?A(t):n}),_(t),t.fromRect=n,e.removeAnimationState(t)}),ne=!1,i=!this.options.removeCloneOnHide,r=t,Qt.forEach((t,e)=>{e=r.children[t.sortableIndex+(i?Number(e):0)];e?r.insertBefore(t,e):r.appendChild(t)}))},dragOverCompleted({sortable:t,isOwner:e,insertion:o,activeSortable:n,parentEl:i,putSortable:r}){var a=this.options;if(o){if(e&&n._hideClone(),oe=!1,a.animation&&1<Qt.length&&(ne||!e&&!n.options.sort&&!r)){let e=A(re,!1,!0,!0);Qt.forEach(t=>{t!==re&&(D(t,e),i.appendChild(t))}),ne=!0}e||(ne||ce(),1<Qt.length?(e=le,n._showClone(t),n.options.animation&&!le&&e&&Jt.forEach(t=>{n.addAnimationState({target:t,rect:ae}),t.fromRect=ae,t.thisAnimationDuration=null})):n._showClone(t))}},dragOverAnimationCapture({dragRect:t,isOwner:e,activeSortable:o}){Qt.forEach(t=>{t.thisAnimationDuration=null}),o.options.animation&&!e&&o.multiDrag.isMultiDrag&&(ae=a({},t),t=f(re,!0),ae.top-=t.f,ae.left-=t.e)},dragOverAnimationComplete(){ne&&(ne=!1,ce())},drop({originalEvent:o,rootEl:r,parentEl:a,sortable:l,dispatchSortableEvent:t,oldIndex:s,putSortable:e}){let c=e||this.sortable;if(o){let n=this.options,i=a.children;if(!ie)if(n.multiDragKey&&!this.multiDragKeyDown&&this._deselectMultiDrag(),M(re,n.selectedClass,!~Qt.indexOf(re)),~Qt.indexOf(re))Qt.splice(Qt.indexOf(re),1),te=null,B({sortable:l,rootEl:r,name:"deselect",targetEl:re,originalEvent:o});else{if(Qt.push(re),B({sortable:l,rootEl:r,name:"select",targetEl:re,originalEvent:o}),o.shiftKey&&te&&l.el.contains(te)){var d=k(te),h=k(re);if(~d&&~h&&d!==h){let t,e;for(t=d<h?(e=d,h):(e=h,d+1);e<t;e++)~Qt.indexOf(i[e])||(M(i[e],n.selectedClass,!0),Qt.push(i[e]),B({sortable:l,rootEl:r,name:"select",targetEl:i[e],originalEvent:o}))}}else te=re;ee=c}if(ie&&this.isMultiDrag){if(ne=!1,(a[X].options.sort||a!==r)&&1<Qt.length){let o=A(re),e=k(re,":not(."+this.options.selectedClass+")");if(!oe&&n.animation&&(re.thisAnimationDuration=null),c.captureAnimationState(),!oe&&(n.animation&&(re.fromRect=o,Qt.forEach(t=>{var e;t.thisAnimationDuration=null,t!==re&&(e=ne?A(t):o,t.fromRect=e,c.addAnimationState({target:t,rect:e}))})),ce(),Qt.forEach(t=>{i[e]?a.insertBefore(t,i[e]):a.appendChild(t),e++}),s===k(re))){let e=!1;Qt.forEach(t=>{t.sortableIndex!==k(t)&&(e=!0)}),e&&t("update")}Qt.forEach(t=>{_(t)}),c.animateAll()}ee=c}(r===a||e&&"clone"!==e.lastPutMode)&&Jt.forEach(t=>{t.parentNode&&t.parentNode.removeChild(t)})}},nullingGlobal(){this.isMultiDrag=ie=!1,Jt.length=0},destroyGlobal(){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(t){if(!(void 0!==ie&&ie||ee!==this.sortable||t&&x(t.target,this.options.draggable,this.sortable.el,!1)||t&&0!==t.button))for(;Qt.length;){var e=Qt[0];M(e,this.options.selectedClass,!1),Qt.shift(),B({sortable:this.sortable,rootEl:this.sortable.el,name:"deselect",targetEl:e,originalEvent:t})}},_checkKeyDown(t){t.key===this.options.multiDragKey&&(this.multiDragKeyDown=!0)},_checkKeyUp(t){t.key===this.options.multiDragKey&&(this.multiDragKeyDown=!1)}},a(t,{pluginName:"multiDrag",utils:{select(t){var e=t.parentNode[X];e&&e.options.multiDrag&&!~Qt.indexOf(t)&&(ee&&ee!==e&&(ee.multiDrag._deselectMultiDrag(),ee=e),M(t,e.options.selectedClass,!0),Qt.push(t))},deselect(t){var e=t.parentNode[X],o=Qt.indexOf(t);e&&e.options.multiDrag&&~o&&(M(t,e.options.selectedClass,!1),Qt.splice(o,1))}},eventProperties(){const o=[],n=[];return Qt.forEach(t=>{o.push({multiDragElement:t,index:t.sortableIndex});let e;e=ne&&t!==re?-1:ne?k(t,":not(."+this.options.selectedClass+")"):k(t),n.push({multiDragElement:t,index:e})}),{items:[...Qt],clones:[...Jt],oldIndicies:o,newIndicies:n}},optionListeners:{multiDragKey(t){return"ctrl"===(t=t.toLowerCase())?t="Control":1<t.length&&(t=t.charAt(0).toUpperCase()+t.substr(1)),t}}})}),It});

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc