vue-pure-admin/static/js/draggable-Chils-ws.js

7 lines
46 KiB
JavaScript

var cn=Object.defineProperty,fn=Object.defineProperties;var hn=Object.getOwnPropertyDescriptors;var yt=Object.getOwnPropertySymbols;var pn=Object.prototype.hasOwnProperty,mn=Object.prototype.propertyIsEnumerable;var _t=(t,e,n)=>e in t?cn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,K=(t,e)=>{for(var n in e||(e={}))pn.call(e,n)&&_t(t,n,e[n]);if(yt)for(var n of yt(e))mn.call(e,n)&&_t(t,n,e[n]);return t},Ee=(t,e)=>fn(t,hn(e));import{S as Et,a as gn}from"./sortable.esm-VSgMS8pS.js";import{h as De,K as vn,d as Yt,x as Vt,L as Dt,a as Ze,m as bn,b as wn,e as Qe,w as I,g as M,f as V,u as St,v as yn,t as ke,k as Ct,l as _n,F as En,j as Je,_ as Dn}from"./index-DI6gHrBb.js";import{u as xt}from"./app-CnjhFlvF.js";/**!
* Sortable 1.14.0
* @author RubaXa <trash@rubaxa.org>
* @author owenm <owen23355@gmail.com>
* @license MIT
*/function Tt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,o)}return n}function U(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Tt(Object(n),!0).forEach(function(o){Sn(t,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Tt(Object(n)).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(n,o))})}return t}function Ye(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ye=function(e){return typeof e}:Ye=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ye(t)}function Sn(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Q(){return Q=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Q.apply(this,arguments)}function Cn(t,e){if(t==null)return{};var n={},o=Object.keys(t),r,i;for(i=0;i<o.length;i++)r=o[i],!(e.indexOf(r)>=0)&&(n[r]=t[r]);return n}function xn(t,e){if(t==null)return{};var n=Cn(t,e),o,r;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)o=i[r],!(e.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(n[o]=t[o])}return n}var Tn="1.14.0";function Z(t){if(typeof window!="undefined"&&window.navigator)return!!navigator.userAgent.match(t)}var J=Z(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Ne=Z(/Edge/i),It=Z(/firefox/i),Te=Z(/safari/i)&&!Z(/chrome/i)&&!Z(/android/i),Ht=Z(/iP(ad|od|hone)/i),In=Z(/chrome/i)&&Z(/android/i),jt={capture:!1,passive:!1};function y(t,e,n){t.addEventListener(e,n,!J&&jt)}function b(t,e,n){t.removeEventListener(e,n,!J&&jt)}function Ge(t,e){if(e){if(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(n){return!1}return!1}}function On(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function G(t,e,n,o){if(t){n=n||document;do{if(e!=null&&(e[0]===">"?t.parentNode===n&&Ge(t,e):Ge(t,e))||o&&t===n)return t;if(t===n)break}while(t=On(t))}return null}var Ot=/\s+/g;function k(t,e,n){if(t&&e)if(t.classList)t.classList[n?"add":"remove"](e);else{var o=(" "+t.className+" ").replace(Ot," ").replace(" "+e+" "," ");t.className=(o+(n?" "+e:"")).replace(Ot," ")}}function h(t,e,n){var o=t&&t.style;if(o){if(n===void 0)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(n=t.currentStyle),e===void 0?n:n[e];!(e in o)&&e.indexOf("webkit")===-1&&(e="-webkit-"+e),o[e]=n+(typeof n=="string"?"":"px")}}function me(t,e){var n="";if(typeof t=="string")n=t;else do{var o=h(t,"transform");o&&o!=="none"&&(n=o+" "+n)}while(!e&&(t=t.parentNode));var r=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return r&&new r(n)}function Wt(t,e,n){if(t){var o=t.getElementsByTagName(e),r=0,i=o.length;if(n)for(;r<i;r++)n(o[r],r);return o}return[]}function z(){var t=document.scrollingElement;return t||document.documentElement}function x(t,e,n,o,r){if(!(!t.getBoundingClientRect&&t!==window)){var i,a,l,s,u,c,f;if(t!==window&&t.parentNode&&t!==z()?(i=t.getBoundingClientRect(),a=i.top,l=i.left,s=i.bottom,u=i.right,c=i.height,f=i.width):(a=0,l=0,s=window.innerHeight,u=window.innerWidth,c=window.innerHeight,f=window.innerWidth),(e||n)&&t!==window&&(r=r||t.parentNode,!J))do if(r&&r.getBoundingClientRect&&(h(r,"transform")!=="none"||n&&h(r,"position")!=="static")){var m=r.getBoundingClientRect();a-=m.top+parseInt(h(r,"border-top-width")),l-=m.left+parseInt(h(r,"border-left-width")),s=a+i.height,u=l+i.width;break}while(r=r.parentNode);if(o&&t!==window){var w=me(r||t),v=w&&w.a,_=w&&w.d;w&&(a/=_,l/=v,f/=v,c/=_,s=a+c,u=l+f)}return{top:a,left:l,bottom:s,right:u,width:f,height:c}}}function At(t,e,n){for(var o=re(t,!0),r=x(t)[e];o;){var i=x(o)[n],a=void 0;if(a=r>=i,!a)return o;if(o===z())break;o=re(o,!1)}return!1}function ge(t,e,n,o){for(var r=0,i=0,a=t.children;i<a.length;){if(a[i].style.display!=="none"&&a[i]!==p.ghost&&(o||a[i]!==p.dragged)&&G(a[i],n.draggable,t,!1)){if(r===e)return a[i];r++}i++}return null}function gt(t,e){for(var n=t.lastElementChild;n&&(n===p.ghost||h(n,"display")==="none"||e&&!Ge(n,e));)n=n.previousElementSibling;return n||null}function X(t,e){var n=0;if(!t||!t.parentNode)return-1;for(;t=t.previousElementSibling;)t.nodeName.toUpperCase()!=="TEMPLATE"&&t!==p.clone&&(!e||Ge(t,e))&&n++;return n}function Pt(t){var e=0,n=0,o=z();if(t)do{var r=me(t),i=r.a,a=r.d;e+=t.scrollLeft*i,n+=t.scrollTop*a}while(t!==o&&(t=t.parentNode));return[e,n]}function An(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}function re(t,e){if(!t||!t.getBoundingClientRect)return z();var n=t,o=!1;do if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var r=h(n);if(n.clientWidth<n.scrollWidth&&(r.overflowX=="auto"||r.overflowX=="scroll")||n.clientHeight<n.scrollHeight&&(r.overflowY=="auto"||r.overflowY=="scroll")){if(!n.getBoundingClientRect||n===document.body)return z();if(o||e)return n;o=!0}}while(n=n.parentNode);return z()}function Pn(t,e){if(t&&e)for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}function et(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)}var Ie;function Gt(t,e){return function(){if(!Ie){var n=arguments,o=this;n.length===1?t.call(o,n[0]):t.apply(o,n),Ie=setTimeout(function(){Ie=void 0},e)}}}function Nn(){clearTimeout(Ie),Ie=void 0}function zt(t,e,n){t.scrollLeft+=e,t.scrollTop+=n}function Ut(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)}var R="Sortable"+new Date().getTime();function Fn(){var t=[],e;return{captureAnimationState:function(){if(t=[],!!this.options.animation){var o=[].slice.call(this.el.children);o.forEach(function(r){if(!(h(r,"display")==="none"||r===p.ghost)){t.push({target:r,rect:x(r)});var i=U({},t[t.length-1].rect);if(r.thisAnimationDuration){var a=me(r,!0);a&&(i.top-=a.f,i.left-=a.e)}r.fromRect=i}})}},addAnimationState:function(o){t.push(o)},removeAnimationState:function(o){t.splice(An(t,{target:o}),1)},animateAll:function(o){var r=this;if(!this.options.animation){clearTimeout(e),typeof o=="function"&&o();return}var i=!1,a=0;t.forEach(function(l){var s=0,u=l.target,c=u.fromRect,f=x(u),m=u.prevFromRect,w=u.prevToRect,v=l.rect,_=me(u,!0);_&&(f.top-=_.f,f.left-=_.e),u.toRect=f,u.thisAnimationDuration&&et(m,f)&&!et(c,f)&&(v.top-f.top)/(v.left-f.left)===(c.top-f.top)/(c.left-f.left)&&(s=kn(v,m,w,r.options)),et(f,c)||(u.prevFromRect=c,u.prevToRect=f,s||(s=r.options.animation),r.animate(u,v,f,s)),s&&(i=!0,a=Math.max(a,s),clearTimeout(u.animationResetTimer),u.animationResetTimer=setTimeout(function(){u.animationTime=0,u.prevFromRect=null,u.fromRect=null,u.prevToRect=null,u.thisAnimationDuration=null},s),u.thisAnimationDuration=s)}),clearTimeout(e),i?e=setTimeout(function(){typeof o=="function"&&o()},a):typeof o=="function"&&o(),t=[]},animate:function(o,r,i,a){if(a){h(o,"transition",""),h(o,"transform","");var l=me(this.el),s=l&&l.a,u=l&&l.d,c=(r.left-i.left)/(s||1),f=(r.top-i.top)/(u||1);o.animatingX=!!c,o.animatingY=!!f,h(o,"transform","translate3d("+c+"px,"+f+"px,0)"),this.forRepaintDummy=Mn(o),h(o,"transition","transform "+a+"ms"+(this.options.easing?" "+this.options.easing:"")),h(o,"transform","translate3d(0,0,0)"),typeof o.animated=="number"&&clearTimeout(o.animated),o.animated=setTimeout(function(){h(o,"transition",""),h(o,"transform",""),o.animated=!1,o.animatingX=!1,o.animatingY=!1},a)}}}}function Mn(t){return t.offsetWidth}function kn(t,e,n,o){return Math.sqrt(Math.pow(e.top-t.top,2)+Math.pow(e.left-t.left,2))/Math.sqrt(Math.pow(e.top-n.top,2)+Math.pow(e.left-n.left,2))*o.animation}var ce=[],tt={initializeByDefault:!0},Fe={mount:function(e){for(var n in tt)tt.hasOwnProperty(n)&&!(n in e)&&(e[n]=tt[n]);ce.forEach(function(o){if(o.pluginName===e.pluginName)throw"Sortable: Cannot mount plugin ".concat(e.pluginName," more than once")}),ce.push(e)},pluginEvent:function(e,n,o){var r=this;this.eventCanceled=!1,o.cancel=function(){r.eventCanceled=!0};var i=e+"Global";ce.forEach(function(a){n[a.pluginName]&&(n[a.pluginName][i]&&n[a.pluginName][i](U({sortable:n},o)),n.options[a.pluginName]&&n[a.pluginName][e]&&n[a.pluginName][e](U({sortable:n},o)))})},initializePlugins:function(e,n,o,r){ce.forEach(function(l){var s=l.pluginName;if(!(!e.options[s]&&!l.initializeByDefault)){var u=new l(e,n,e.options);u.sortable=e,u.options=e.options,e[s]=u,Q(o,u.defaults)}});for(var i in e.options)if(e.options.hasOwnProperty(i)){var a=this.modifyOption(e,i,e.options[i]);typeof a!="undefined"&&(e.options[i]=a)}},getEventProperties:function(e,n){var o={};return ce.forEach(function(r){typeof r.eventProperties=="function"&&Q(o,r.eventProperties.call(n[r.pluginName],e))}),o},modifyOption:function(e,n,o){var r;return ce.forEach(function(i){e[i.pluginName]&&i.optionListeners&&typeof i.optionListeners[n]=="function"&&(r=i.optionListeners[n].call(e[i.pluginName],o))}),r}};function Ln(t){var e=t.sortable,n=t.rootEl,o=t.name,r=t.targetEl,i=t.cloneEl,a=t.toEl,l=t.fromEl,s=t.oldIndex,u=t.newIndex,c=t.oldDraggableIndex,f=t.newDraggableIndex,m=t.originalEvent,w=t.putSortable,v=t.extraEventProperties;if(e=e||n&&n[R],!!e){var _,B=e.options,$="on"+o.charAt(0).toUpperCase()+o.substr(1);window.CustomEvent&&!J&&!Ne?_=new CustomEvent(o,{bubbles:!0,cancelable:!0}):(_=document.createEvent("Event"),_.initEvent(o,!0,!0)),_.to=a||n,_.from=l||n,_.item=r||n,_.clone=i,_.oldIndex=s,_.newIndex=u,_.oldDraggableIndex=c,_.newDraggableIndex=f,_.originalEvent=m,_.pullMode=w?w.lastPutMode:void 0;var A=U(U({},v),Fe.getEventProperties(o,e));for(var Y in A)_[Y]=A[Y];n&&n.dispatchEvent(_),B[$]&&B[$].call(e,_)}}var Rn=["evt"],N=function(e,n){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=o.evt,i=xn(o,Rn);Fe.pluginEvent.bind(p)(e,n,U({dragEl:d,parentEl:D,ghostEl:g,rootEl:E,nextEl:de,lastDownEl:Ve,cloneEl:S,cloneHidden:oe,dragStarted:Se,putSortable:T,activeSortable:p.active,originalEvent:r,oldIndex:pe,oldDraggableIndex:Oe,newIndex:L,newDraggableIndex:ne,hideGhostForTarget:Zt,unhideGhostForTarget:Qt,cloneNowHidden:function(){oe=!0},cloneNowShown:function(){oe=!1},dispatchSortableEvent:function(l){P({sortable:n,name:l,originalEvent:r})}},i))};function P(t){Ln(U({putSortable:T,cloneEl:S,targetEl:d,rootEl:E,oldIndex:pe,oldDraggableIndex:Oe,newIndex:L,newDraggableIndex:ne},t))}var d,D,g,E,de,Ve,S,oe,pe,L,Oe,ne,Le,T,he=!1,ze=!1,Ue=[],se,H,nt,ot,Nt,Ft,Se,fe,Ae,Pe=!1,Re=!1,He,O,rt=[],ct=!1,$e=[],Ke=typeof document!="undefined",Xe=Ht,Mt=Ne||J?"cssFloat":"float",Xn=Ke&&!In&&!Ht&&"draggable"in document.createElement("div"),$t=function(){if(Ke){if(J)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto",t.style.pointerEvents==="auto"}}(),qt=function(e,n){var o=h(e),r=parseInt(o.width)-parseInt(o.paddingLeft)-parseInt(o.paddingRight)-parseInt(o.borderLeftWidth)-parseInt(o.borderRightWidth),i=ge(e,0,n),a=ge(e,1,n),l=i&&h(i),s=a&&h(a),u=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+x(i).width,c=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+x(a).width;if(o.display==="flex")return o.flexDirection==="column"||o.flexDirection==="column-reverse"?"vertical":"horizontal";if(o.display==="grid")return o.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(i&&l.float&&l.float!=="none"){var f=l.float==="left"?"left":"right";return a&&(s.clear==="both"||s.clear===f)?"vertical":"horizontal"}return i&&(l.display==="block"||l.display==="flex"||l.display==="table"||l.display==="grid"||u>=r&&o[Mt]==="none"||a&&o[Mt]==="none"&&u+c>r)?"vertical":"horizontal"},Bn=function(e,n,o){var r=o?e.left:e.top,i=o?e.right:e.bottom,a=o?e.width:e.height,l=o?n.left:n.top,s=o?n.right:n.bottom,u=o?n.width:n.height;return r===l||i===s||r+a/2===l+u/2},Yn=function(e,n){var o;return Ue.some(function(r){var i=r[R].options.emptyInsertThreshold;if(!(!i||gt(r))){var a=x(r),l=e>=a.left-i&&e<=a.right+i,s=n>=a.top-i&&n<=a.bottom+i;if(l&&s)return o=r}}),o},Kt=function(e){function n(i,a){return function(l,s,u,c){var f=l.options.group.name&&s.options.group.name&&l.options.group.name===s.options.group.name;if(i==null&&(a||f))return!0;if(i==null||i===!1)return!1;if(a&&i==="clone")return i;if(typeof i=="function")return n(i(l,s,u,c),a)(l,s,u,c);var m=(a?l:s).options.group.name;return i===!0||typeof i=="string"&&i===m||i.join&&i.indexOf(m)>-1}}var o={},r=e.group;(!r||Ye(r)!="object")&&(r={name:r}),o.name=r.name,o.checkPull=n(r.pull,!0),o.checkPut=n(r.put),o.revertClone=r.revertClone,e.group=o},Zt=function(){!$t&&g&&h(g,"display","none")},Qt=function(){!$t&&g&&h(g,"display","")};Ke&&document.addEventListener("click",function(t){if(ze)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),ze=!1,!1},!0);var ue=function(e){if(d){e=e.touches?e.touches[0]:e;var n=Yn(e.clientX,e.clientY);if(n){var o={};for(var r in e)e.hasOwnProperty(r)&&(o[r]=e[r]);o.target=o.rootEl=n,o.preventDefault=void 0,o.stopPropagation=void 0,n[R]._onDragOver(o)}}},Vn=function(e){d&&d.parentNode[R]._isOutsideThisEl(e.target)};function p(t,e){if(!(t&&t.nodeType&&t.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));this.el=t,this.options=e=Q({},e),t[R]=this;var n={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 qt(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(a,l){a.setData("Text",l.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:p.supportPointer!==!1&&"PointerEvent"in window&&!Te,emptyInsertThreshold:5};Fe.initializePlugins(this,t,n);for(var o in n)!(o in e)&&(e[o]=n[o]);Kt(e);for(var r in this)r.charAt(0)==="_"&&typeof this[r]=="function"&&(this[r]=this[r].bind(this));this.nativeDraggable=e.forceFallback?!1:Xn,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?y(t,"pointerdown",this._onTapStart):(y(t,"mousedown",this._onTapStart),y(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(y(t,"dragover",this),y(t,"dragenter",this)),Ue.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),Q(this,Fn())}p.prototype={constructor:p,_isOutsideThisEl:function(e){!this.el.contains(e)&&e!==this.el&&(fe=null)},_getDirection:function(e,n){return typeof this.options.direction=="function"?this.options.direction.call(this,e,n,d):this.options.direction},_onTapStart:function(e){if(e.cancelable){var n=this,o=this.el,r=this.options,i=r.preventOnFilter,a=e.type,l=e.touches&&e.touches[0]||e.pointerType&&e.pointerType==="touch"&&e,s=(l||e).target,u=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||s,c=r.filter;if(qn(o),!d&&!(/mousedown|pointerdown/.test(a)&&e.button!==0||r.disabled)&&!u.isContentEditable&&!(!this.nativeDraggable&&Te&&s&&s.tagName.toUpperCase()==="SELECT")&&(s=G(s,r.draggable,o,!1),!(s&&s.animated)&&Ve!==s)){if(pe=X(s),Oe=X(s,r.draggable),typeof c=="function"){if(c.call(this,e,s,this)){P({sortable:n,rootEl:u,name:"filter",targetEl:s,toEl:o,fromEl:o}),N("filter",n,{evt:e}),i&&e.cancelable&&e.preventDefault();return}}else if(c&&(c=c.split(",").some(function(f){if(f=G(u,f.trim(),o,!1),f)return P({sortable:n,rootEl:f,name:"filter",targetEl:s,fromEl:o,toEl:o}),N("filter",n,{evt:e}),!0}),c)){i&&e.cancelable&&e.preventDefault();return}r.handle&&!G(u,r.handle,o,!1)||this._prepareDragStart(e,l,s)}}},_prepareDragStart:function(e,n,o){var r=this,i=r.el,a=r.options,l=i.ownerDocument,s;if(o&&!d&&o.parentNode===i){var u=x(o);if(E=i,d=o,D=d.parentNode,de=d.nextSibling,Ve=o,Le=a.group,p.dragged=d,se={target:d,clientX:(n||e).clientX,clientY:(n||e).clientY},Nt=se.clientX-u.left,Ft=se.clientY-u.top,this._lastX=(n||e).clientX,this._lastY=(n||e).clientY,d.style["will-change"]="all",s=function(){if(N("delayEnded",r,{evt:e}),p.eventCanceled){r._onDrop();return}r._disableDelayedDragEvents(),!It&&r.nativeDraggable&&(d.draggable=!0),r._triggerDragStart(e,n),P({sortable:r,name:"choose",originalEvent:e}),k(d,a.chosenClass,!0)},a.ignore.split(",").forEach(function(c){Wt(d,c.trim(),it)}),y(l,"dragover",ue),y(l,"mousemove",ue),y(l,"touchmove",ue),y(l,"mouseup",r._onDrop),y(l,"touchend",r._onDrop),y(l,"touchcancel",r._onDrop),It&&this.nativeDraggable&&(this.options.touchStartThreshold=4,d.draggable=!0),N("delayStart",this,{evt:e}),a.delay&&(!a.delayOnTouchOnly||n)&&(!this.nativeDraggable||!(Ne||J))){if(p.eventCanceled){this._onDrop();return}y(l,"mouseup",r._disableDelayedDrag),y(l,"touchend",r._disableDelayedDrag),y(l,"touchcancel",r._disableDelayedDrag),y(l,"mousemove",r._delayedDragTouchMoveHandler),y(l,"touchmove",r._delayedDragTouchMoveHandler),a.supportPointer&&y(l,"pointermove",r._delayedDragTouchMoveHandler),r._dragStartTimer=setTimeout(s,a.delay)}else s()}},_delayedDragTouchMoveHandler:function(e){var n=e.touches?e.touches[0]:e;Math.max(Math.abs(n.clientX-this._lastX),Math.abs(n.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){d&&it(d),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;b(e,"mouseup",this._disableDelayedDrag),b(e,"touchend",this._disableDelayedDrag),b(e,"touchcancel",this._disableDelayedDrag),b(e,"mousemove",this._delayedDragTouchMoveHandler),b(e,"touchmove",this._delayedDragTouchMoveHandler),b(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,n){n=n||e.pointerType=="touch"&&e,!this.nativeDraggable||n?this.options.supportPointer?y(document,"pointermove",this._onTouchMove):n?y(document,"touchmove",this._onTouchMove):y(document,"mousemove",this._onTouchMove):(y(d,"dragend",this),y(E,"dragstart",this._onDragStart));try{document.selection?je(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch(o){}},_dragStarted:function(e,n){if(he=!1,E&&d){N("dragStarted",this,{evt:n}),this.nativeDraggable&&y(document,"dragover",Vn);var o=this.options;!e&&k(d,o.dragClass,!1),k(d,o.ghostClass,!0),p.active=this,e&&this._appendGhost(),P({sortable:this,name:"start",originalEvent:n})}else this._nulling()},_emulateDragOver:function(){if(H){this._lastX=H.clientX,this._lastY=H.clientY,Zt();for(var e=document.elementFromPoint(H.clientX,H.clientY),n=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(H.clientX,H.clientY),e!==n);)n=e;if(d.parentNode[R]._isOutsideThisEl(e),n)do{if(n[R]){var o=void 0;if(o=n[R]._onDragOver({clientX:H.clientX,clientY:H.clientY,target:e,rootEl:n}),o&&!this.options.dragoverBubble)break}e=n}while(n=n.parentNode);Qt()}},_onTouchMove:function(e){if(se){var n=this.options,o=n.fallbackTolerance,r=n.fallbackOffset,i=e.touches?e.touches[0]:e,a=g&&me(g,!0),l=g&&a&&a.a,s=g&&a&&a.d,u=Xe&&O&&Pt(O),c=(i.clientX-se.clientX+r.x)/(l||1)+(u?u[0]-rt[0]:0)/(l||1),f=(i.clientY-se.clientY+r.y)/(s||1)+(u?u[1]-rt[1]:0)/(s||1);if(!p.active&&!he){if(o&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))<o)return;this._onDragStart(e,!0)}if(g){a?(a.e+=c-(nt||0),a.f+=f-(ot||0)):a={a:1,b:0,c:0,d:1,e:c,f};var m="matrix(".concat(a.a,",").concat(a.b,",").concat(a.c,",").concat(a.d,",").concat(a.e,",").concat(a.f,")");h(g,"webkitTransform",m),h(g,"mozTransform",m),h(g,"msTransform",m),h(g,"transform",m),nt=c,ot=f,H=i}e.cancelable&&e.preventDefault()}},_appendGhost:function(){if(!g){var e=this.options.fallbackOnBody?document.body:E,n=x(d,!0,Xe,!0,e),o=this.options;if(Xe){for(O=e;h(O,"position")==="static"&&h(O,"transform")==="none"&&O!==document;)O=O.parentNode;O!==document.body&&O!==document.documentElement?(O===document&&(O=z()),n.top+=O.scrollTop,n.left+=O.scrollLeft):O=z(),rt=Pt(O)}g=d.cloneNode(!0),k(g,o.ghostClass,!1),k(g,o.fallbackClass,!0),k(g,o.dragClass,!0),h(g,"transition",""),h(g,"transform",""),h(g,"box-sizing","border-box"),h(g,"margin",0),h(g,"top",n.top),h(g,"left",n.left),h(g,"width",n.width),h(g,"height",n.height),h(g,"opacity","0.8"),h(g,"position",Xe?"absolute":"fixed"),h(g,"zIndex","100000"),h(g,"pointerEvents","none"),p.ghost=g,e.appendChild(g),h(g,"transform-origin",Nt/parseInt(g.style.width)*100+"% "+Ft/parseInt(g.style.height)*100+"%")}},_onDragStart:function(e,n){var o=this,r=e.dataTransfer,i=o.options;if(N("dragStart",this,{evt:e}),p.eventCanceled){this._onDrop();return}N("setupClone",this),p.eventCanceled||(S=Ut(d),S.draggable=!1,S.style["will-change"]="",this._hideClone(),k(S,this.options.chosenClass,!1),p.clone=S),o.cloneId=je(function(){N("clone",o),!p.eventCanceled&&(o.options.removeCloneOnHide||E.insertBefore(S,d),o._hideClone(),P({sortable:o,name:"clone"}))}),!n&&k(d,i.dragClass,!0),n?(ze=!0,o._loopId=setInterval(o._emulateDragOver,50)):(b(document,"mouseup",o._onDrop),b(document,"touchend",o._onDrop),b(document,"touchcancel",o._onDrop),r&&(r.effectAllowed="move",i.setData&&i.setData.call(o,r,d)),y(document,"drop",o),h(d,"transform","translateZ(0)")),he=!0,o._dragStartId=je(o._dragStarted.bind(o,n,e)),y(document,"selectstart",o),Se=!0,Te&&h(document.body,"user-select","none")},_onDragOver:function(e){var n=this.el,o=e.target,r,i,a,l=this.options,s=l.group,u=p.active,c=Le===s,f=l.sort,m=T||u,w,v=this,_=!1;if(ct)return;function B(_e,un){N(_e,v,U({evt:e,isOwner:c,axis:w?"vertical":"horizontal",revert:a,dragRect:r,targetRect:i,canSort:f,fromSortable:m,target:o,completed:A,onMove:function(wt,dn){return Be(E,n,d,r,wt,x(wt),e,dn)},changed:Y},un))}function $(){B("dragOverAnimationCapture"),v.captureAnimationState(),v!==m&&m.captureAnimationState()}function A(_e){return B("dragOverCompleted",{insertion:_e}),_e&&(c?u._hideClone():u._showClone(v),v!==m&&(k(d,T?T.options.ghostClass:u.options.ghostClass,!1),k(d,l.ghostClass,!0)),T!==v&&v!==p.active?T=v:v===p.active&&T&&(T=null),m===v&&(v._ignoreWhileAnimating=o),v.animateAll(function(){B("dragOverAnimationComplete"),v._ignoreWhileAnimating=null}),v!==m&&(m.animateAll(),m._ignoreWhileAnimating=null)),(o===d&&!d.animated||o===n&&!o.animated)&&(fe=null),!l.dragoverBubble&&!e.rootEl&&o!==document&&(d.parentNode[R]._isOutsideThisEl(e.target),!_e&&ue(e)),!l.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),_=!0}function Y(){L=X(d),ne=X(d,l.draggable),P({sortable:v,name:"change",toEl:n,newIndex:L,newDraggableIndex:ne,originalEvent:e})}if(e.preventDefault!==void 0&&e.cancelable&&e.preventDefault(),o=G(o,l.draggable,n,!0),B("dragOver"),p.eventCanceled)return _;if(d.contains(e.target)||o.animated&&o.animatingX&&o.animatingY||v._ignoreWhileAnimating===o)return A(!1);if(ze=!1,u&&!l.disabled&&(c?f||(a=D!==E):T===this||(this.lastPutMode=Le.checkPull(this,u,d,e))&&s.checkPut(this,u,d,e))){if(w=this._getDirection(e,o)==="vertical",r=x(d),B("dragOverValid"),p.eventCanceled)return _;if(a)return D=E,$(),this._hideClone(),B("revert"),p.eventCanceled||(de?E.insertBefore(d,de):E.appendChild(d)),A(!0);var j=gt(n,l.draggable);if(!j||Gn(e,w,this)&&!j.animated){if(j===d)return A(!1);if(j&&n===e.target&&(o=j),o&&(i=x(o)),Be(E,n,d,r,o,i,e,!!o)!==!1)return $(),n.appendChild(d),D=n,Y(),A(!0)}else if(j&&Wn(e,w,this)){var ie=ge(n,0,l,!0);if(ie===d)return A(!1);if(o=ie,i=x(o),Be(E,n,d,r,o,i,e,!1)!==!1)return $(),n.insertBefore(d,ie),D=n,Y(),A(!0)}else if(o.parentNode===n){i=x(o);var W=0,ae,ve=d.parentNode!==n,F=!Bn(d.animated&&d.toRect||r,o.animated&&o.toRect||i,w),be=w?"top":"left",ee=At(o,"top","top")||At(d,"top","top"),we=ee?ee.scrollTop:void 0;fe!==o&&(ae=i[be],Pe=!1,Re=!F&&l.invertSwap||ve),W=zn(e,o,i,w,F?1:l.swapThreshold,l.invertedSwapThreshold==null?l.swapThreshold:l.invertedSwapThreshold,Re,fe===o);var q;if(W!==0){var le=X(d);do le-=W,q=D.children[le];while(q&&(h(q,"display")==="none"||q===g))}if(W===0||q===o)return A(!1);fe=o,Ae=W;var ye=o.nextElementSibling,te=!1;te=W===1;var Me=Be(E,n,d,r,o,i,e,te);if(Me!==!1)return(Me===1||Me===-1)&&(te=Me===1),ct=!0,setTimeout(jn,30),$(),te&&!ye?n.appendChild(d):o.parentNode.insertBefore(d,te?ye:o),ee&&zt(ee,0,we-ee.scrollTop),D=d.parentNode,ae!==void 0&&!Re&&(He=Math.abs(ae-x(o)[be])),Y(),A(!0)}if(n.contains(d))return A(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){b(document,"mousemove",this._onTouchMove),b(document,"touchmove",this._onTouchMove),b(document,"pointermove",this._onTouchMove),b(document,"dragover",ue),b(document,"mousemove",ue),b(document,"touchmove",ue)},_offUpEvents:function(){var e=this.el.ownerDocument;b(e,"mouseup",this._onDrop),b(e,"touchend",this._onDrop),b(e,"pointerup",this._onDrop),b(e,"touchcancel",this._onDrop),b(document,"selectstart",this)},_onDrop:function(e){var n=this.el,o=this.options;if(L=X(d),ne=X(d,o.draggable),N("drop",this,{evt:e}),D=d&&d.parentNode,L=X(d),ne=X(d,o.draggable),p.eventCanceled){this._nulling();return}he=!1,Re=!1,Pe=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),ft(this.cloneId),ft(this._dragStartId),this.nativeDraggable&&(b(document,"drop",this),b(n,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),Te&&h(document.body,"user-select",""),h(d,"transform",""),e&&(Se&&(e.cancelable&&e.preventDefault(),!o.dropBubble&&e.stopPropagation()),g&&g.parentNode&&g.parentNode.removeChild(g),(E===D||T&&T.lastPutMode!=="clone")&&S&&S.parentNode&&S.parentNode.removeChild(S),d&&(this.nativeDraggable&&b(d,"dragend",this),it(d),d.style["will-change"]="",Se&&!he&&k(d,T?T.options.ghostClass:this.options.ghostClass,!1),k(d,this.options.chosenClass,!1),P({sortable:this,name:"unchoose",toEl:D,newIndex:null,newDraggableIndex:null,originalEvent:e}),E!==D?(L>=0&&(P({rootEl:D,name:"add",toEl:D,fromEl:E,originalEvent:e}),P({sortable:this,name:"remove",toEl:D,originalEvent:e}),P({rootEl:D,name:"sort",toEl:D,fromEl:E,originalEvent:e}),P({sortable:this,name:"sort",toEl:D,originalEvent:e})),T&&T.save()):L!==pe&&L>=0&&(P({sortable:this,name:"update",toEl:D,originalEvent:e}),P({sortable:this,name:"sort",toEl:D,originalEvent:e})),p.active&&((L==null||L===-1)&&(L=pe,ne=Oe),P({sortable:this,name:"end",toEl:D,originalEvent:e}),this.save()))),this._nulling()},_nulling:function(){N("nulling",this),E=d=D=g=de=S=Ve=oe=se=H=Se=L=ne=pe=Oe=fe=Ae=T=Le=p.dragged=p.ghost=p.clone=p.active=null,$e.forEach(function(e){e.checked=!0}),$e.length=nt=ot=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":d&&(this._onDragOver(e),Hn(e));break;case"selectstart":e.preventDefault();break}},toArray:function(){for(var e=[],n,o=this.el.children,r=0,i=o.length,a=this.options;r<i;r++)n=o[r],G(n,a.draggable,this.el,!1)&&e.push(n.getAttribute(a.dataIdAttr)||$n(n));return e},sort:function(e,n){var o={},r=this.el;this.toArray().forEach(function(i,a){var l=r.children[a];G(l,this.options.draggable,r,!1)&&(o[i]=l)},this),n&&this.captureAnimationState(),e.forEach(function(i){o[i]&&(r.removeChild(o[i]),r.appendChild(o[i]))}),n&&this.animateAll()},save:function(){var e=this.options.store;e&&e.set&&e.set(this)},closest:function(e,n){return G(e,n||this.options.draggable,this.el,!1)},option:function(e,n){var o=this.options;if(n===void 0)return o[e];var r=Fe.modifyOption(this,e,n);typeof r!="undefined"?o[e]=r:o[e]=n,e==="group"&&Kt(o)},destroy:function(){N("destroy",this);var e=this.el;e[R]=null,b(e,"mousedown",this._onTapStart),b(e,"touchstart",this._onTapStart),b(e,"pointerdown",this._onTapStart),this.nativeDraggable&&(b(e,"dragover",this),b(e,"dragenter",this)),Array.prototype.forEach.call(e.querySelectorAll("[draggable]"),function(n){n.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),Ue.splice(Ue.indexOf(this.el),1),this.el=e=null},_hideClone:function(){if(!oe){if(N("hideClone",this),p.eventCanceled)return;h(S,"display","none"),this.options.removeCloneOnHide&&S.parentNode&&S.parentNode.removeChild(S),oe=!0}},_showClone:function(e){if(e.lastPutMode!=="clone"){this._hideClone();return}if(oe){if(N("showClone",this),p.eventCanceled)return;d.parentNode==E&&!this.options.group.revertClone?E.insertBefore(S,d):de?E.insertBefore(S,de):E.appendChild(S),this.options.group.revertClone&&this.animate(d,S),h(S,"display",""),oe=!1}}};function Hn(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move"),t.cancelable&&t.preventDefault()}function Be(t,e,n,o,r,i,a,l){var s,u=t[R],c=u.options.onMove,f;return window.CustomEvent&&!J&&!Ne?s=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(s=document.createEvent("Event"),s.initEvent("move",!0,!0)),s.to=e,s.from=t,s.dragged=n,s.draggedRect=o,s.related=r||e,s.relatedRect=i||x(e),s.willInsertAfter=l,s.originalEvent=a,t.dispatchEvent(s),c&&(f=c.call(u,s,a)),f}function it(t){t.draggable=!1}function jn(){ct=!1}function Wn(t,e,n){var o=x(ge(n.el,0,n.options,!0)),r=10;return e?t.clientX<o.left-r||t.clientY<o.top&&t.clientX<o.right:t.clientY<o.top-r||t.clientY<o.bottom&&t.clientX<o.left}function Gn(t,e,n){var o=x(gt(n.el,n.options.draggable)),r=10;return e?t.clientX>o.right+r||t.clientX<=o.right&&t.clientY>o.bottom&&t.clientX>=o.left:t.clientX>o.right&&t.clientY>o.top||t.clientX<=o.right&&t.clientY>o.bottom+r}function zn(t,e,n,o,r,i,a,l){var s=o?t.clientY:t.clientX,u=o?n.height:n.width,c=o?n.top:n.left,f=o?n.bottom:n.right,m=!1;if(!a){if(l&&He<u*r){if(!Pe&&(Ae===1?s>c+u*i/2:s<f-u*i/2)&&(Pe=!0),Pe)m=!0;else if(Ae===1?s<c+He:s>f-He)return-Ae}else if(s>c+u*(1-r)/2&&s<f-u*(1-r)/2)return Un(e)}return m=m||a,m&&(s<c+u*i/2||s>f-u*i/2)?s>c+u/2?1:-1:0}function Un(t){return X(d)<X(t)?1:-1}function $n(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)}function qn(t){$e.length=0;for(var e=t.getElementsByTagName("input"),n=e.length;n--;){var o=e[n];o.checked&&$e.push(o)}}function je(t){return setTimeout(t,0)}function ft(t){return clearTimeout(t)}Ke&&y(document,"touchmove",function(t){(p.active||he)&&t.cancelable&&t.preventDefault()});p.utils={on:y,off:b,css:h,find:Wt,is:function(e,n){return!!G(e,n,e,!1)},extend:Pn,throttle:Gt,closest:G,toggleClass:k,clone:Ut,index:X,nextTick:je,cancelNextTick:ft,detectDirection:qt,getChild:ge};p.get=function(t){return t[R]};p.mount=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];e[0].constructor===Array&&(e=e[0]),e.forEach(function(o){if(!o.prototype||!o.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(o));o.utils&&(p.utils=U(U({},p.utils),o.utils)),Fe.mount(o)})};p.create=function(t,e){return new p(t,e)};p.version=Tn;var C=[],Ce,ht,pt=!1,at,lt,qe,xe;function Kn(){function t(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var e in this)e.charAt(0)==="_"&&typeof this[e]=="function"&&(this[e]=this[e].bind(this))}return t.prototype={dragStarted:function(n){var o=n.originalEvent;this.sortable.nativeDraggable?y(document,"dragover",this._handleAutoScroll):this.options.supportPointer?y(document,"pointermove",this._handleFallbackAutoScroll):o.touches?y(document,"touchmove",this._handleFallbackAutoScroll):y(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(n){var o=n.originalEvent;!this.options.dragOverBubble&&!o.rootEl&&this._handleAutoScroll(o)},drop:function(){this.sortable.nativeDraggable?b(document,"dragover",this._handleAutoScroll):(b(document,"pointermove",this._handleFallbackAutoScroll),b(document,"touchmove",this._handleFallbackAutoScroll),b(document,"mousemove",this._handleFallbackAutoScroll)),kt(),We(),Nn()},nulling:function(){qe=ht=Ce=pt=xe=at=lt=null,C.length=0},_handleFallbackAutoScroll:function(n){this._handleAutoScroll(n,!0)},_handleAutoScroll:function(n,o){var r=this,i=(n.touches?n.touches[0]:n).clientX,a=(n.touches?n.touches[0]:n).clientY,l=document.elementFromPoint(i,a);if(qe=n,o||this.options.forceAutoScrollFallback||Ne||J||Te){st(n,this.options,l,o);var s=re(l,!0);pt&&(!xe||i!==at||a!==lt)&&(xe&&kt(),xe=setInterval(function(){var u=re(document.elementFromPoint(i,a),!0);u!==s&&(s=u,We()),st(n,r.options,u,o)},10),at=i,lt=a)}else{if(!this.options.bubbleScroll||re(l,!0)===z()){We();return}st(n,this.options,re(l,!1),!1)}}},Q(t,{pluginName:"scroll",initializeByDefault:!0})}function We(){C.forEach(function(t){clearInterval(t.pid)}),C=[]}function kt(){clearInterval(xe)}var st=Gt(function(t,e,n,o){if(e.scroll){var r=(t.touches?t.touches[0]:t).clientX,i=(t.touches?t.touches[0]:t).clientY,a=e.scrollSensitivity,l=e.scrollSpeed,s=z(),u=!1,c;ht!==n&&(ht=n,We(),Ce=e.scroll,c=e.scrollFn,Ce===!0&&(Ce=re(n,!0)));var f=0,m=Ce;do{var w=m,v=x(w),_=v.top,B=v.bottom,$=v.left,A=v.right,Y=v.width,j=v.height,ie=void 0,W=void 0,ae=w.scrollWidth,ve=w.scrollHeight,F=h(w),be=w.scrollLeft,ee=w.scrollTop;w===s?(ie=Y<ae&&(F.overflowX==="auto"||F.overflowX==="scroll"||F.overflowX==="visible"),W=j<ve&&(F.overflowY==="auto"||F.overflowY==="scroll"||F.overflowY==="visible")):(ie=Y<ae&&(F.overflowX==="auto"||F.overflowX==="scroll"),W=j<ve&&(F.overflowY==="auto"||F.overflowY==="scroll"));var we=ie&&(Math.abs(A-r)<=a&&be+Y<ae)-(Math.abs($-r)<=a&&!!be),q=W&&(Math.abs(B-i)<=a&&ee+j<ve)-(Math.abs(_-i)<=a&&!!ee);if(!C[f])for(var le=0;le<=f;le++)C[le]||(C[le]={});(C[f].vx!=we||C[f].vy!=q||C[f].el!==w)&&(C[f].el=w,C[f].vx=we,C[f].vy=q,clearInterval(C[f].pid),(we!=0||q!=0)&&(u=!0,C[f].pid=setInterval(function(){o&&this.layer===0&&p.active._onTouchMove(qe);var ye=C[this.layer].vy?C[this.layer].vy*l:0,te=C[this.layer].vx?C[this.layer].vx*l:0;typeof c=="function"&&c.call(p.dragged.parentNode[R],te,ye,t,qe,C[this.layer].el)!=="continue"||zt(C[this.layer].el,te,ye)}.bind({layer:f}),24))),f++}while(e.bubbleScroll&&m!==s&&(m=re(m,!1)));pt=u}},30),Jt=function(e){var n=e.originalEvent,o=e.putSortable,r=e.dragEl,i=e.activeSortable,a=e.dispatchSortableEvent,l=e.hideGhostForTarget,s=e.unhideGhostForTarget;if(n){var u=o||i;l();var c=n.changedTouches&&n.changedTouches.length?n.changedTouches[0]:n,f=document.elementFromPoint(c.clientX,c.clientY);s(),u&&!u.el.contains(f)&&(a("spill"),this.onSpill({dragEl:r,putSortable:o}))}};function vt(){}vt.prototype={startIndex:null,dragStart:function(e){var n=e.oldDraggableIndex;this.startIndex=n},onSpill:function(e){var n=e.dragEl,o=e.putSortable;this.sortable.captureAnimationState(),o&&o.captureAnimationState();var r=ge(this.sortable.el,this.startIndex,this.options);r?this.sortable.el.insertBefore(n,r):this.sortable.el.appendChild(n),this.sortable.animateAll(),o&&o.animateAll()},drop:Jt};Q(vt,{pluginName:"revertOnSpill"});function bt(){}bt.prototype={onSpill:function(e){var n=e.dragEl,o=e.putSortable,r=o||this.sortable;r.captureAnimationState(),n.parentNode&&n.parentNode.removeChild(n),r.animateAll()},drop:Jt};Q(bt,{pluginName:"removeOnSpill"});p.mount(new Kn);p.mount(bt,vt);function ut(t){t.parentElement!==null&&t.parentElement.removeChild(t)}function Lt(t,e,n){const o=n===0?t.children[0]:t.children[n-1].nextSibling;t.insertBefore(e,o)}function Zn(){return typeof window!="undefined"?window.console:global.console}const Qn=Zn();function Jn(t){const e=Object.create(null);return function(o){return e[o]||(e[o]=t(o))}}const eo=/-(\w)/g,to=Jn(t=>t.replace(eo,(e,n)=>n.toUpperCase())),en=["Start","Add","Remove","Update","End"],tn=["Choose","Unchoose","Sort","Filter","Clone"],nn=["Move"],no=[nn,en,tn].flatMap(t=>t).map(t=>`on${t}`),mt={manage:nn,manageAndEmit:en,emit:tn};function oo(t){return no.indexOf(t)!==-1}const ro=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","math","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rb","rp","rt","rtc","ruby","s","samp","script","section","select","slot","small","source","span","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"];function io(t){return ro.includes(t)}function ao(t){return["transition-group","TransitionGroup"].includes(t)}function on(t){return["id","class","role","style"].includes(t)||t.startsWith("data-")||t.startsWith("aria-")||t.startsWith("on")}function rn(t){return t.reduce((e,[n,o])=>(e[n]=o,e),{})}function lo({$attrs:t,componentData:e={}}){const n=rn(Object.entries(t).filter(([o,r])=>on(o)));return K(K({},n),e)}function so({$attrs:t,callBackBuilder:e}){const n=rn(an(t));Object.entries(e).forEach(([r,i])=>{mt[r].forEach(a=>{n[`on${a}`]=i(a)})});const o=`[data-draggable]${n.draggable||""}`;return Ee(K({},n),{draggable:o})}function an(t){return Object.entries(t).filter(([e,n])=>!on(e)).map(([e,n])=>[to(e),n]).filter(([e,n])=>!oo(e))}const Rt=({el:t})=>t,uo=(t,e)=>t.__draggable_context=e,Xt=t=>t.__draggable_context;class co{constructor({nodes:{header:e,default:n,footer:o},root:r,realList:i}){this.defaultNodes=n,this.children=[...e,...n,...o],this.externalComponent=r.externalComponent,this.rootTransition=r.transition,this.tag=r.tag,this.realList=i}get _isRootComponent(){return this.externalComponent||this.rootTransition}render(e,n){const{tag:o,children:r,_isRootComponent:i}=this;return e(o,n,i?{default:()=>r}:r)}updated(){const{defaultNodes:e,realList:n}=this;e.forEach((o,r)=>{uo(Rt(o),{element:n[r],index:r})})}getUnderlyingVm(e){return Xt(e)}getVmIndexFromDomIndex(e,n){const{defaultNodes:o}=this,{length:r}=o,i=n.children,a=i.item(e);if(a===null)return r;const l=Xt(a);if(l)return l.index;if(r===0)return 0;const s=Rt(o[0]),u=[...i].findIndex(c=>c===s);return e<u?0:r}}function fo(t,e){const n=t[e];return n?n():[]}function ho({$slots:t,realList:e,getKey:n}){const o=e||[],[r,i]=["header","footer"].map(s=>fo(t,s)),{item:a}=t;if(!a)throw new Error("draggable element must have an item slot");const l=o.flatMap((s,u)=>a({element:s,index:u}).map(c=>(c.key=n(s),c.props=Ee(K({},c.props||{}),{"data-draggable":!0}),c)));if(l.length!==o.length)throw new Error("Item slot must have only one child");return{header:r,footer:i,default:l}}function po(t){const e=ao(t),n=!io(t)&&!e;return{transition:e,externalComponent:n,tag:n?De(t):e?vn:t}}function mo({$slots:t,tag:e,realList:n,getKey:o}){const r=ho({$slots:t,realList:n,getKey:o}),i=po(e);return new co({nodes:r,root:i,realList:n})}function ln(t,e){Vt(()=>this.$emit(t.toLowerCase(),e))}function sn(t){return(e,n)=>{if(this.realList!==null)return this[`onDrag${t}`](e,n)}}function go(t){const e=sn.call(this,t);return(n,o)=>{e.call(this,n,o),ln.call(this,t,n)}}let dt=null;const vo={list:{type:Array,required:!1,default:null},modelValue:{type:Array,required:!1,default:null},itemKey:{type:[String,Function],required:!0},clone:{type:Function,default:t=>t},tag:{type:String,default:"div"},move:{type:Function,default:null},componentData:{type:Object,required:!1,default:null}},bo=["update:modelValue","change",...[...mt.manageAndEmit,...mt.emit].map(t=>t.toLowerCase())],Bt=Yt({name:"draggable",inheritAttrs:!1,props:vo,emits:bo,data(){return{error:!1}},render(){try{this.error=!1;const{$slots:t,$attrs:e,tag:n,componentData:o,realList:r,getKey:i}=this,a=mo({$slots:t,tag:n,realList:r,getKey:i});this.componentStructure=a;const l=lo({$attrs:e,componentData:o});return a.render(Dt,l)}catch(t){return this.error=!0,Dt("pre",{style:{color:"red"}},t.stack)}},created(){this.list!==null&&this.modelValue!==null&&Qn.error("modelValue and list props are mutually exclusive! Please set one or another.")},mounted(){if(this.error)return;const{$attrs:t,$el:e,componentStructure:n}=this;n.updated();const o=so({$attrs:t,callBackBuilder:{manageAndEmit:i=>go.call(this,i),emit:i=>ln.bind(this,i),manage:i=>sn.call(this,i)}}),r=e.nodeType===1?e:e.parentElement;this._sortable=new p(r,o),this.targetDomElement=r,r.__draggable_component__=this},updated(){this.componentStructure.updated()},beforeUnmount(){this._sortable!==void 0&&this._sortable.destroy()},computed:{realList(){const{list:t}=this;return t||this.modelValue},getKey(){const{itemKey:t}=this;return typeof t=="function"?t:e=>e[t]}},watch:{$attrs:{handler(t){const{_sortable:e}=this;e&&an(t).forEach(([n,o])=>{e.option(n,o)})},deep:!0}},methods:{getUnderlyingVm(t){return this.componentStructure.getUnderlyingVm(t)||null},getUnderlyingPotencialDraggableComponent(t){return t.__draggable_component__},emitChanges(t){Vt(()=>this.$emit("change",t))},alterList(t){if(this.list){t(this.list);return}const e=[...this.modelValue];t(e),this.$emit("update:modelValue",e)},spliceList(){const t=e=>e.splice(...arguments);this.alterList(t)},updatePosition(t,e){const n=o=>o.splice(e,0,o.splice(t,1)[0]);this.alterList(n)},getRelatedContextFromMoveEvent({to:t,related:e}){const n=this.getUnderlyingPotencialDraggableComponent(t);if(!n)return{component:n};const o=n.realList,r={list:o,component:n};if(t!==e&&o){const i=n.getUnderlyingVm(e)||{};return K(K({},i),r)}return r},getVmIndexFromDomIndex(t){return this.componentStructure.getVmIndexFromDomIndex(t,this.targetDomElement)},onDragStart(t){this.context=this.getUnderlyingVm(t.item),t.item._underlying_vm_=this.clone(this.context.element),dt=t.item},onDragAdd(t){const e=t.item._underlying_vm_;if(e===void 0)return;ut(t.item);const n=this.getVmIndexFromDomIndex(t.newIndex);this.spliceList(n,0,e);const o={element:e,newIndex:n};this.emitChanges({added:o})},onDragRemove(t){if(Lt(this.$el,t.item,t.oldIndex),t.pullMode==="clone"){ut(t.clone);return}const{index:e,element:n}=this.context;this.spliceList(e,1);const o={element:n,oldIndex:e};this.emitChanges({removed:o})},onDragUpdate(t){ut(t.item),Lt(t.from,t.item,t.oldIndex);const e=this.context.index,n=this.getVmIndexFromDomIndex(t.newIndex);this.updatePosition(e,n);const o={element:this.context.element,oldIndex:e,newIndex:n};this.emitChanges({moved:o})},computeFutureIndex(t,e){if(!t.element)return 0;const n=[...e.to.children].filter(a=>a.style.display!=="none"),o=n.indexOf(e.related),r=t.component.getVmIndexFromDomIndex(o);return n.indexOf(dt)!==-1||!e.willInsertAfter?r:r+1},onDragMove(t,e){const{move:n,realList:o}=this;if(!n||!o)return!0;const r=this.getRelatedContextFromMoveEvent(t),i=this.computeFutureIndex(r,t),a=Ee(K({},this.context),{futureIndex:i}),l=Ee(K({},t),{relatedContext:r,draggedContext:a});return n(l,e)},onDragEnd(){dt=null}}}),wo={class:"card-header"},yo={class:"font-medium"},_o={class:"drag-container"},Eo={class:"item-single"},Do={class:"cut-container"},So=Yt({name:"Draggable",__name:"draggable",setup(t){const{setSortSwap:e}=xt(),n=Ze([{grid:"cn",num:1},{grid:"cn",num:2},{grid:"cn",num:3},{grid:"cn",num:4},{grid:"cn",num:5},{grid:"cn",num:6},{grid:"cn",num:7},{grid:"cn",num:8},{grid:"cn",num:9}]),o=Ze([{people:"cn",id:1,name:"www.itxst.com"},{people:"cn",id:2,name:"www.baidu.com"},{people:"cn",id:3,name:"www.taobao.com"},{people:"cn",id:4,name:"www.google.com"}]),r=Ze([{people:"cn",id:1,name:"cut1"},{people:"cn",id:2,name:"cut2"},{people:"cn",id:3,name:"cut3"},{people:"cn",id:4,name:"cut4"}]),i=a=>{};return bn(()=>{xt().sortSwap||Et.mount(new gn),e(!0),new Et(document.querySelector(".cut-container"),{swap:!0,forceFallback:!0,chosenClass:"chosen",swapClass:"highlight",animation:300})}),(a,l)=>{const s=De("el-link"),u=De("el-card"),c=De("el-col"),f=De("el-row");return Qe(),wn(u,{shadow:"never"},{header:I(()=>[M("div",wo,[M("span",yo,[l[3]||(l[3]=Je(" 拖拽组件,采用开源的 ")),V(s,{href:"https://sortablejs.github.io/vue.draggable.next/#/simple",target:"_blank",style:{margin:"0 4px 5px","font-size":"16px"}},{default:I(()=>l[2]||(l[2]=[Je(" vuedraggable ")])),_:1})])]),V(s,{class:"mt-2",href:"https://github.com/pure-admin/vue-pure-admin/blob/main/src/views/able/draggable.vue",target:"_blank"},{default:I(()=>l[4]||(l[4]=[Je(" 代码位置 src/views/able/draggable.vue ")])),_:1})]),default:I(()=>[M("div",_o,[V(f,{gutter:25},{default:I(()=>[V(c,{xs:25,sm:8,md:8,lg:8},{default:I(()=>[V(u,{shadow:"never"},{header:I(()=>l[5]||(l[5]=[M("div",{class:"card-header"},[M("span",null,"grid列表拖拽")],-1)])),default:I(()=>[V(St(Bt),{modelValue:n.value,"onUpdate:modelValue":l[0]||(l[0]=m=>n.value=m),class:"grid-container","item-key":"grid",animation:"300",chosenClass:"chosen",forceFallback:"true"},{item:I(({element:m})=>[M("div",{class:yn("item item-"+m.num)},ke(m.num),3)]),_:1},8,["modelValue"])]),_:1})]),_:1}),V(c,{xs:25,sm:8,md:8,lg:8},{default:I(()=>[V(u,{shadow:"never"},{header:I(()=>l[6]||(l[6]=[M("div",{class:"card-header"},[M("span",null,"单列拖拽")],-1)])),default:I(()=>[V(St(Bt),{modelValue:o.value,"onUpdate:modelValue":l[1]||(l[1]=m=>o.value=m),"item-key":"name","chosen-class":"chosen","force-fallback":"true",animation:"300",onChange:i},{item:I(({element:m,index:w})=>[M("div",Eo,ke(m.name)+" "+ke(w),1)]),_:1},8,["modelValue"])]),_:1})]),_:1}),V(c,{xs:25,sm:8,md:8,lg:8},{default:I(()=>[V(u,{shadow:"never"},{header:I(()=>l[7]||(l[7]=[M("div",{class:"card-header"},[M("span",null,"拖拽实现元素位置交换")],-1)])),default:I(()=>[M("div",Do,[(Qe(!0),Ct(En,null,_n(r.value,(m,w)=>(Qe(),Ct("div",{key:w,class:"item-cut"},[M("p",null,ke(m.name),1)]))),128))])]),_:1})]),_:1})]),_:1})])]),_:1})}}}),Ao=Dn(So,[["__scopeId","data-v-97efa29c"]]);export{Ao as default};