*/function i(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function r(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?i(Object(n),!0).forEach((function(e){l(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function a(t){return a="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}function l(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function s(){return s=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},s.apply(this,arguments)}function c(t,e){if(null==t)return{};var n,o,i={},r=Object.keys(t);for(o=0;o<r.length;o++)n=r[o],e.indexOf(n)>=0||(i[n]=t[n]);return i}function u(t,e){if(null==t)return{};var n,o,i=c(t,e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);for(o=0;o<r.length;o++)n=r[o],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}var d="1.14.0";function h(t){if("undefined"!==typeof window&&window.navigator)return!!navigator.userAgent.match(t)}var p=h(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),f=h(/Edge/i),g=h(/firefox/i),m=h(/safari/i)&&!h(/chrome/i)&&!h(/android/i),v=h(/iP(ad|od|hone)/i),b=h(/chrome/i)&&h(/android/i),w={capture:!1,passive:!1};function y(t,e,n){t.addEventListener(e,n,!p&&w)}function E(t,e,n){t.removeEventListener(e,n,!p&&w)}function _(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 D(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function O(t,e,n,o){if(t){n=n||document;do{if(null!=e&&(">"===e[0]?t.parentNode===n&&_(t,e):_(t,e))||o&&t===n)return t;if(t===n)break}while(t=D(t))}return null}var S,x=/\s+/g;function C(t,e,n){if(t&&e)if(t.classList)t.classList[n?"add":"remove"](e);else{var o=(" "+t.className+" ").replace(x," ").replace(" "+e+" "," ");t.className=(o+(n?" "+e:"")).replace(x," ")}}function T(t,e,n){var o=t&&t.style;if(o){if(void 0===n)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(n=t.currentStyle),void 0===e?n:n[e];e in o||-1!==e.indexOf("webkit")||(e="-webkit-"+e),o[e]=n+("string"===typeof n?"":"px")}}function I(t,e){var n="";if("string"===typeof t)n=t;else do{var o=T(t,"transform");o&&"none"!==o&&(n=o+" "+n)}while(!e&&(t=t.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(n)}function N(t,e,n){if(t){var o=t.getElementsByTagName(e),i=0,r=o.length;if(n)for(;i<r;i++)n(o[i],i);return o}return[]}function M(){var t=document.scrollingElement;return t||document.documentElement}function A(t,e,n,o,i){if(t.getBoundingClientRect||t===window){var r,a,l,s,c,u,d;if(t!==window&&t.parentNode&&t!==M()?(r=t.getBoundingClientRect(),a=r.top,l=r.left,s=r.bottom,c=r.right,u=r.height,d=r.width):(a=0,l=0,s=window.innerHeight,c=window.innerWidth,u=window.innerHeight,d=window.innerWidth),(e||n)&&t!==window&&(i=i||t.parentNode,!p))do{if(i&&i.getBoundingClientRect&&("none"!==T(i,"transform")||n&&"static"!==T(i,"position"))){var h=i.getBoundingClientRect();a-=h.top+parseInt(T(i,"border-top-width")),l-=h.left+parseInt(T(i,"border-left-width")),s=a+r.height,c=l+r.width;break}}while(i=i.parentNode);if(o&&t!==window){var f=I(i||t),g=f&&f.a,m=f&&f.d;f&&(a/=m,l/=g,d/=g,u/=m,s=a+u,c=l+d)}return{top:a,left:l,bottom:s,right:c,width:d,height:u}}}function P(t,e,n){var o=F(t,!0),i=A(t)[e];while(o){var r=A(o)[n],a=void 0;if(a="top"===n||"left"===n?i>=r:i<=r,!a)return o;if(o===M())break;o=F(o,!1)}return!1}function j(t,e,n,o){var i=0,r=0,a=t.children;while(r<a.length){if("none"!==a[r].style.display&&a[r]!==qt.ghost&&(o||a[r]!==qt.dragged)&&O(a[r],n.draggable,t,!1)){if(i===e)return a[r];i++}r++}return null}function k(t,e){var n=t.lastElementChild;while(n&&(n===qt.ghost||"none"===T(n,"display")||e&&!_(n,e)))n=n.previousElementSibling;return n||null}function X(t,e){var n=0;if(!t||!t.parentNode)return-1;while(t=t.previousElementSibling)"TEMPLATE"===t.nodeName.toUpperCase()||t===qt.clone||e&&!_(t,e)||n++;return n}function R(t){var e=0,n=0,o=M();if(t)do{var i=I(t),r=i.a,a=i.d;e+=t.scrollLeft*r,n+=t.scrollTop*a}while(t!==o&&(t=t.parentNode));return[e,n]}function Y(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 F(t,e){if(!t||!t.getBoundingClientRect)return M();var n=t,o=!1;do{if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var i=T(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 M();if(o||e)return n;o=!0}}}while(n=n.parentNode);return M()}function B(t,e){if(t&&e)for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}function L(t,e){return Math.round(t.top)===Math.round(e.top)&&Math.round(t.left)===Math.round(e.left)&&Math.round(t.height)===Math.round(e.height)&&Math.round(t.width)===Math.round(e.width)}function V(t,e){return function(){if(!S){var n=arguments,o=this;1===n.length?t.call(o,n[0]):t.apply(o,n),S=setTimeout((function(){S=void 0}),e)}}}function $(){clearTimeout(S),S=void 0}function H(t,e,n){t.scrollLeft+=e,t.scrollTop+=n}function W(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 U="Sortable"+(new Date).getTime();function z(){var t,e=[];return{captureAnimationState:function(){if(e=[],this.options.animation){var t=[].slice.call(this.el.children);t.forEach((function(t){if("none"!==T(t,"display")&&t!==qt.ghost){e.push({target:t,rect:A(t)});var n=r({},e[e.length-1].rect);if(t.thisAnimationDuration){var o=I(t,!0);o&&(n.top-=o.f,n.left-=o.e)}t.fromRect=n}}))}},addAnimationState:function(t){e.push(t)},removeAnimationState:function(t){e.splice(Y(e,{target:t}),1)},animateAll:function(n){var o=this;if(!this.options.animation)return clearTimeout(t),void("function"===typeof n&&n());var i=!1,r=0;e.forEach((function(t){var e=0,n=t.target,a=n.fromRect,l=A(n),s=n.prevFromRect,c=n.prevToRect,u=t.rect,d=I(n,!0);d&&(l.top-=d.f,l.left-=d.e),n.toRect=l,n.thisAnimationDuration&&L(s,l)&&!L(a,l)&&(u.top-l.top)/(u.left-l.left)===(a.top-l.top)/(a.left-l.left)&&(e=q(u,s,c,o.options)),L(l,a)||(n.prevFromRect=a,n.prevToRect=l,e||(e=o.options.animation),o.animate(n,u,l,e)),e&&(i=!0,r=Math.max(r,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(t),i?t=setTimeout((function(){"function"===typeof n&&n()}),r):"function"===typeof n&&n(),e=[]},animate:function(t,e,n,o){if(o){T(t,"transition",""),T(t,"transform","");var i=I(this.el),r=i&&i.a,a=i&&i.d,l=(e.left-n.left)/(r||1),s=(e.top-n.top)/(a||1);t.animatingX=!!l,t.animatingY=!!s,T(t,"transform","translate3d("+l+"px,"+s+"px,0)"),this.forRepaintDummy=G(t),T(t,"transition","transform "+o+"ms"+(this.options.easing?" "+this.options.easing:"")),T(t,"transform","translate3d(0,0,0)"),"number"===typeof t.animated&&clearTimeout(t.animated),t.animated=setTimeout((function(){T(t,"transition",""),T(t,"transform",""),t.animated=!1,t.animatingX=!1,t.animatingY=!1}),o)}}}}function G(t){return t.offsetWidth}function q(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 J=[],Z={initializeByDefault:!0},K={mount:function(t){for(var e in Z)Z.hasOwnProperty(e)&&!(e in t)&&(t[e]=Z[e]);J.forEach((function(e){if(e.pluginName===t.pluginName)throw"Sortable: Cannot mount plugin ".concat(t.pluginName," more than once")})),J.push(t)},pluginEvent:function(t,e,n){var o=this;this.eventCanceled=!1,n.cancel=function(){o.eventCanceled=!0};var i=t+"Global";J.forEach((function(o){e[o.pluginName]&&(e[o.pluginName][i]&&e[o.pluginName][i](r({sortable:e},n)),e.options[o.pluginName]&&e[o.pluginName][t]&&e[o.pluginName][t](r({sortable:e},n)))}))},initializePlugins:function(t,e,n,o){for(var i in J.forEach((function(o){var i=o.pluginName;if(t.options[i]||o.initializeByDefault){var r=new o(t,e,t.options);r.sortable=t,r.options=t.options,t[i]=r,s(n,r.defaults)}})),t.options)if(t.options.hasOwnProperty(i)){var r=this.modifyOption(t,i,t.options[i]);"undefined"!==typeof r&&(t.options[i]=r)}},getEventProperties:function(t,e){var n={};return J.forEach((function(o){"function"===typeof o.eventProperties&&s(n,o.eventProperties.call(e[o.pluginName],t))})),n},modifyOption:function(t,e,n){var o;return J.forEach((function(i){t[i.pluginName]&&i.optionListeners&&"function"===typeof i.optionListeners[e]&&(o=i.optionListeners[e].call(t[i.pluginName],n))})),o}};function Q(t){var e=t.sortable,n=t.rootEl,o=t.name,i=t.targetEl,a=t.cloneEl,l=t.toEl,s=t.fromEl,c=t.oldIndex,u=t.newIndex,d=t.oldDraggableIndex,h=t.newDraggableIndex,g=t.originalEvent,m=t.putSortable,v=t.extraEventProperties;if(e=e||n&&n[U],e){var b,w=e.options,y="on"+o.charAt(0).toUpperCase()+o.substr(1);!window.CustomEvent||p||f?(b=document.createEvent("Event"),b.initEvent(o,!0,!0)):b=new CustomEvent(o,{bubbles:!0,cancelable:!0}),b.to=l||n,b.from=s||n,b.item=i||n,b.clone=a,b.oldIndex=c,b.newIndex=u,b.oldDraggableIndex=d,b.newDraggableIndex=h,b.originalEvent=g,b.pullMode=m?m.lastPutMode:void 0;var E=r(r({},v),K.getEventProperties(o,e));for(var _ in E)b[_]=E[_];n&&n.dispatchEvent(b),w[y]&&w[y].call(e,b)}}var tt=["evt"],et=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=n.evt,i=u(n,tt);K.pluginEvent.bind(qt)(t,e,r({dragEl:ot,parentEl:it,ghostEl:rt,rootEl:at,nextEl:lt,lastDownEl:st,cloneEl:ct,cloneHidden:ut,dragStarted:Dt,putSortable:mt,activeSortable:qt.active,originalEvent:o,oldIndex:dt,oldDraggableIndex:pt,newIndex:ht,newDraggableIndex:ft,hideGhostForTarget:Wt,unhideGhostForTarget:Ut,cloneNowHidden:function(){ut=!0},cloneNowShown:function(){ut=!1},dispatchSortableEvent:function(t){nt({sortable:e,name:t,originalEvent:o})}},i))};function nt(t){Q(r({putSortable:mt,cloneEl:ct,targetEl:ot,rootEl:at,oldIndex:dt,oldDraggableIndex:pt,newIndex:ht,newDraggableIndex:ft},t))}var ot,it,rt,at,lt,st,ct,ut,dt,ht,pt,ft,gt,mt,vt,bt,wt,yt,Et,_t,Dt,Ot,St,xt,Ct,Tt=!1,It=!1,Nt=[],Mt=!1,At=!1,Pt=[],jt=!1,kt=[],Xt="undefined"!==typeof document,Rt=v,Yt=f||p?"cssFloat":"float",Ft=Xt&&!b&&!v&&"draggable"in document.createElement("div"),Bt=function(){if(Xt){if(p)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto","auto"===t.style.pointerEvents}}(),Lt=function(t,e){var n=T(t),o=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),i=j(t,0,e),r=j(t,1,e),a=i&&T(i),l=r&&T(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"===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"]){var u="left"===a["float"]?"left":"right";return!r||"both"!==l.clear&&l.clear!==u?"horizontal":"vertical"}return i&&("block"===a.display||"flex"===a.display||"table"===a.display||"grid"===a.display||s>=o&&"none"===n[Yt]||r&&"none"===n[Yt]&&s+c>o)?"vertical":"horizontal"},Vt=function(t,e,n){var o=n?t.left:t.top,i=n?t.right:t.bottom,r=n?t.width:t.height,a=n?e.left:e.top,l=n?e.right:e.bottom,s=n?e.width:e.height;return o===a||i===l||o+r/2===a+s/2},$t=function(t,e){var n;return Nt.some((function(o){var i=o[U].options.emptyInsertThreshold;if(i&&!k(o)){var r=A(o),a=t>=r.left-i&&t<=r.right+i,l=e>=r.top-i&&e<=r.bottom+i;return a&&l?n=o:void 0}})),n},Ht=function(t){function e(t,n){return function(o,i,r,a){var l=o.options.group.name&&i.options.group.name&&o.options.group.name===i.options.group.name;if(null==t&&(n||l))return!0;if(null==t||!1===t)return!1;if(n&&"clone"===t)return t;if("function"===typeof t)return e(t(o,i,r,a),n)(o,i,r,a);var s=(n?o:i).options.group.name;return!0===t||"string"===typeof t&&t===s||t.join&&t.indexOf(s)>-1}}var n={},o=t.group;o&&"object"==a(o)||(o={name:o}),n.name=o.name,n.checkPull=e(o.pull,!0),n.checkPut=e(o.put),n.revertClone=o.revertClone,t.group=n},Wt=function(){!Bt&&rt&&T(rt,"display","none")},Ut=function(){!Bt&&rt&&T(rt,"display","")};Xt&&document.addEventListener("click",(function(t){if(It)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),It=!1,!1}),!0);var zt=function(t){if(ot){t=t.touches?t.touches[0]:t;var e=$t(t.clientX,t.clientY);if(e){var n={};for(var o in t)t.hasOwnProperty(o)&&(n[o]=t[o]);n.target=n.rootEl=e,n.preventDefault=void 0,n.stopPropagation=void 0,e[U]._onDragOver(n)}}},Gt=function(t){ot&&ot.parentNode[U]._isOutsideThisEl(t.target)};function qt(t,e){if(!t||!t.nodeType||1!==t.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));this.el=t,this.options=e=s({},e),t[U]=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 Lt(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!==qt.supportPointer&&"PointerEvent"in window&&!m,emptyInsertThreshold:5};for(var o in K.initializePlugins(this,t,n),n)!(o in e)&&(e[o]=n[o]);for(var i in Ht(e),this)"_"===i.charAt(0)&&"function"===typeof this[i]&&(this[i]=this[i].bind(this));this.nativeDraggable=!e.forceFallback&&Ft,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)),Nt.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),s(this,z())}function Jt(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move"),t.cancelable&&t.preventDefault()}function Zt(t,e,n,o,i,r,a,l){var s,c,u=t[U],d=u.options.onMove;return!window.CustomEvent||p||f?(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||A(e),s.willInsertAfter=l,s.originalEvent=a,t.dispatchEvent(s),d&&(c=d.call(u,s,a)),c}function Kt(t){t.draggable=!1}function Qt(){jt=!1}function te(t,e,n){var o=A(j(n.el,0,n.options,!0)),i=10;return e?t.clientX<o.left-i||t.clientY<o.top&&t.clientX<o.right:t.clientY<o.top-i||t.clientY<o.bottom&&t.clientX<o.left}function ee(t,e,n){var o=A(k(n.el,n.options.draggable)),i=10;return e?t.clientX>o.right+i||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+i}function ne(t,e,n,o,i,r,a,l){var s=o?t.clientY:t.clientX,c=o?n.height:n.width,u=o?n.top:n.left,d=o?n.bottom:n.right,h=!1;if(!a)if(l&&xt<c*i){if(!Mt&&(1===St?s>u+c*r/2:s<d-c*r/2)&&(Mt=!0),Mt)h=!0;else if(1===St?s<u+xt:s>d-xt)return-St}else if(s>u+c*(1-i)/2&&s<d-c*(1-i)/2)return oe(e);return h=h||a,h&&(s<u+c*r/2||s>d-c*r/2)?s>u+c/2?1:-1:0}function oe(t){return X(ot)<X(t)?1:-1}function ie(t){var e=t.tagName+t.className+t.src+t.href+t.textContent,n=e.length,o=0;while(n--)o+=e.charCodeAt(n);return o.toString(36)}function re(t){kt.length=0;var e=t.getElementsByTagName("input"),n=e.length;while(n--){var o=e[n];o.checked&&kt.push(o)}}function ae(t){return setTimeout(t,0)}function le(t){return clearTimeout(t)}qt.prototype={constructor:qt,_isOutsideThisEl:function(t){this.el.contains(t)||t===this.el||(Ot=null)},_getDirection:function(t,e){return"function"===typeof this.options.direction?this.options.direction.call(this,t,e,ot):this.options.direction},_onTapStart:function(t){if(t.cancelable){var e=this,n=this.el,o=this.options,i=o.preventOnFilter,r=t.type,a=t.touches&&t.touches[0]||t.pointerType&&"touch"===t.pointerType&&t,l=(a||t).target,s=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||l,c=o.filter;if(re(n),!ot&&!(/mousedown|pointerdown/.test(r)&&0!==t.button||o.disabled)&&!s.isContentEditable&&(this.nativeDraggable||!m||!l||"SELECT"!==l.tagName.toUpperCase())&&(l=O(l,o.draggable,n,!1),(!l||!l.animated)&&st!==l)){if(dt=X(l),pt=X(l,o.draggable),"function"===typeof c){if(c.call(this,t,l,this))return nt({sortable:e,rootEl:s,name:"filter",targetEl:l,toEl:n,fromEl:n}),et("filter",e,{evt:t}),void(i&&t.cancelable&&t.preventDefault())}else if(c&&(c=c.split(",").some((function(o){if(o=O(s,o.trim(),n,!1),o)return nt({sortable:e,rootEl:o,name:"filter",targetEl:l,fromEl:n,toEl:n}),et("filter",e,{evt:t}),!0})),c))return void(i&&t.cancelable&&t.preventDefault());o.handle&&!O(s,o.handle,n,!1)||this._prepareDragStart(t,a,l)}}},_prepareDragStart:function(t,e,n){var o,i=this,r=i.el,a=i.options,l=r.ownerDocument;if(n&&!ot&&n.parentNode===r){var s=A(n);if(at=r,ot=n,it=ot.parentNode,lt=ot.nextSibling,st=n,gt=a.group,qt.dragged=ot,vt={target:ot,clientX:(e||t).clientX,clientY:(e||t).clientY},Et=vt.clientX-s.left,_t=vt.clientY-s.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,ot.style["will-change"]="all",o=function(){et("delayEnded",i,{evt:t}),qt.eventCanceled?i._onDrop():(i._disableDelayedDragEvents(),!g&&i.nativeDraggable&&(ot.draggable=!0),i._triggerDragStart(t,e),nt({sortable:i,name:"choose",originalEvent:t}),C(ot,a.chosenClass,!0))},a.ignore.split(",").forEach((function(t){N(ot,t.trim(),Kt)})),y(l,"dragover",zt),y(l,"mousemove",zt),y(l,"touchmove",zt),y(l,"mouseup",i._onDrop),y(l,"touchend",i._onDrop),y(l,"touchcancel",i._onDrop),g&&this.nativeDraggable&&(this.options.touchStartThreshold=4,ot.draggable=!0),et("delayStart",this,{evt:t}),!a.delay||a.delayOnTouchOnly&&!e||this.nativeDraggable&&(f||p))o();else{if(qt.eventCanceled)return void this._onDrop();y(l,"mouseup",i._disableDelayedDrag),y(l,"touchend",i._disableDelayedDrag),y(l,"touchcancel",i._disableDelayedDrag),y(l,"mousemove",i._delayedDragTouchMoveHandler),y(l,"touchmove",i._delayedDragTouchMoveHandler),a.supportPointer&&y(l,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(o,a.delay)}}},_delayedDragTouchMoveHandler:function(t){var e=t.touches?t.touches[0]:t;Math.max(Math.abs(e.clientX-this._lastX),Math.abs(e.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){ot&&Kt(ot),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;E(t,"mouseup",this._disableDelayedDrag),E(t,"touchend",this._disableDelayedDrag),E(t,"touchcancel",this._disableDelayedDrag),E(t,"mousemove",this._delayedDragTouchMoveHandler),E(t,"touchmove",this._delayedDragTouchMoveHandler),E(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,e){e=e||"touch"==t.pointerType&&t,!this.nativeDraggable||e?this.options.supportPointer?y(document,"pointermove",this._onTouchMove):y(document,e?"touchmove":"mousemove",this._onTouchMove):(y(ot,"dragend",this),y(at,"dragstart",this._onDragStart));try{document.selection?ae((function(){document.selection.empty()})):window.getSelection().removeAllRanges()}catch(n){}},_dragStarted:function(t,e){if(Tt=!1,at&&ot){et("dragStarted",this,{evt:e}),this.nativeDraggable&&y(document,"dragover",Gt);var n=this.options;!t&&C(ot,n.dragClass,!1),C(ot,n.ghostClass,!0),qt.active=this,t&&this._appendGhost(),nt({sortable:this,name:"start",originalEvent:e})}else this._nulling()},_emulateDragOver:function(){if(bt){this._lastX=bt.clientX,this._lastY=bt.clientY,Wt();var t=document.elementFromPoint(bt.clientX,bt.clientY),e=t;while(t&&t.shadowRoot){if(t=t.shadowRoot.elementFromPoint(bt.clientX,bt.clientY),t===e)break;e=t}if(ot.parentNode[U]._isOutsideThisEl(t),e)do{if(e[U]){var n=void 0;if(n=e[U]._onDragOver({clientX:bt.clientX,clientY:bt.clientY,target:t,rootEl:e}),n&&!this.options.dragoverBubble)break}t=e}while(e=e.parentNode);Ut()}},_onTouchMove:function(t){if(vt){var e=this.options,n=e.fallbackTolerance,o=e.fallbackOffset,i=t.touches?t.touches[0]:t,r=rt&&I(rt,!0),a=rt&&r&&r.a,l=rt&&r&&r.d,s=Rt&&Ct&&R(Ct),c=(i.clientX-vt.clientX+o.x)/(a||1)+(s?s[0]-Pt[0]:0)/(a||1),u=(i.clientY-vt.clientY+o.y)/(l||1)+(s?s[1]-Pt[1]:0)/(l||1);if(!qt.active&&!Tt){if(n&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))<n)return;this._onDragStart(t,!0)}if(rt){r?(r.e+=c-(wt||0),r.f+=u-(yt||0)):r={a:1,b:0,c:0,d:1,e:c,f:u};var d="matrix(".concat(r.a,",").concat(r.b,",").concat(r.c,",").concat(r.d,",").concat(r.e,",").concat(r.f,")");T(rt,"webkitTransform",d),T(rt,"mozTransform",d),T(rt,"msTransform",d),T(rt,"transform",d),wt=c,yt=u,bt=i}t.cancelable&&t.preventDefault()}},_appendGhost:function(){if(!rt){var t=this.options.fallbackOnBody?document.body:at,e=A(ot,!0,Rt,!0,t),n=this.options;if(Rt){Ct=t;while("static"===T(Ct,"position")&&"none"===T(Ct,"transform")&&Ct!==document)Ct=Ct.parentNode;Ct!==document.body&&Ct!==document.documentElement?(Ct===document&&(Ct=M()),e.top+=Ct.scrollTop,e.left+=Ct.scrollLeft):Ct=M(),Pt=R(Ct)}rt=ot.cloneNode(!0),C(rt,n.ghostClass,!1),C(rt,n.fallbackClass,!0),C(rt,n.dragClass,!0),T(rt,"transition",""),T(rt,"transform",""),T(rt,"box-sizing","border-box"),T(rt,"margin",0),T(rt,"top",e.top),T(rt,"left",e.left),T(rt,"width",e.width),T(rt,"height",e.height),T(rt,"opacity","0.8"),T(rt,"position",Rt?"absolute":"fixed"),T(rt,"zIndex","100000"),T(rt,"pointerEvents","none"),qt.ghost=rt,t.appendChild(rt),T(rt,"transform-origin",Et/parseInt(rt.style.width)*100+"% "+_t/parseInt(rt.style.height)*100+"%")}},_onDragStart:function(t,e){var n=this,o=t.dataTransfer,i=n.options;et("dragStart",this,{evt:t}),qt.eventCanceled?this._onDrop():(et("setupClone",this),qt.eventCanceled||(ct=W(ot),ct.draggable=!1,ct.style["will-change"]="",this._hideClone(),C(ct,this.options.chosenClass,!1),qt.clone=ct),n.cloneId=ae((function(){et("clone",n),qt.eventCanceled||(n.options.removeCloneOnHide||at.insertBefore(ct,ot),n._hideClone(),nt({sortable:n,name:"clone"}))})),!e&&C(ot,i.dragClass,!0),e?(It=!0,n._loopId=setInterval(n._emulateDragOver,50)):(E(document,"mouseup",n._onDrop),E(document,"touchend",n._onDrop),E(document,"touchcancel",n._onDrop),o&&(o.effectAllowed="move",i.setData&&i.setData.call(n,o,ot)),y(document,"drop",n),T(ot,"transform","translateZ(0)")),Tt=!0,n._dragStartId=ae(n._dragStarted.bind(n,e,t)),y(document,"selectstart",n),Dt=!0,m&&T(document.body,"user-select","none"))},_onDragOver:function(t){var e,n,o,i,a=this.el,l=t.target,s=this.options,c=s.group,u=qt.active,d=gt===c,h=s.sort,p=mt||u,f=this,g=!1;if(!jt){if(void 0!==t.preventDefault&&t.cancelable&&t.preventDefault(),l=O(l,s.draggable,a,!0),Y("dragOver"),qt.eventCanceled)return g;if(ot.contains(t.target)||l.animated&&l.animatingX&&l.animatingY||f._ignoreWhileAnimating===l)return B(!1);if(It=!1,u&&!s.disabled&&(d?h||(o=it!==at):mt===this||(this.lastPutMode=gt.checkPull(this,u,ot,t))&&c.checkPut(this,u,ot,t))){if(i="vertical"===this._getDirection(t,l),e=A(ot),Y("dragOverValid"),qt.eventCanceled)return g;if(o)return it=at,F(),this._hideClone(),Y("revert"),qt.eventCanceled||(lt?at.insertBefore(ot,lt):at.appendChild(ot)),B(!0);var m=k(a,s.draggable);if(!m||ee(t,i,this)&&!m.animated){if(m===ot)return B(!1);if(m&&a===t.target&&(l=m),l&&(n=A(l)),!1!==Zt(at,a,ot,e,l,n,t,!!l))return F(),a.appendChild(ot),it=a,L(),B(!0)}else if(m&&te(t,i,this)){var v=j(a,0,s,!0);if(v===ot)return B(!1);if(l=v,n=A(l),!1!==Zt(at,a,ot,e,l,n,t,!1))return F(),a.insertBefore(ot,v),it=a,L(),B(!0)}else if(l.parentNode===a){n=A(l);var b,w,y=0,E=ot.parentNode!==a,_=!Vt(ot.animated&&ot.toRect||e,l.animated&&l.toRect||n,i),D=i?"top":"left",S=P(l,"top","top")||P(ot,"top","top"),x=S?S.scrollTop:void 0;if(Ot!==l&&(b=n[D],Mt=!1,At=!_&&s.invertSwap||E),y=ne(t,l,n,i,_?1:s.swapThreshold,null==s.invertedSwapThreshold?s.swapThreshold:s.invertedSwapThreshold,At,Ot===l),0!==y){var I=X(ot);do{I-=y,w=it.children[I]}while(w&&("none"===T(w,"display")||w===rt))}if(0===y||w===l)return B(!1);Ot=l,St=y;var N=l.nextElementSibling,M=!1;M=1===y;var R=Zt(at,a,ot,e,l,n,t,M);if(!1!==R)return 1!==R&&-1!==R||(M=1===R),jt=!0,setTimeout(Qt,30),F(),M&&!N?a.appendChild(ot):l.parentNode.insertBefore(ot,M?N:l),S&&H(S,0,x-S.scrollTop),it=ot.parentNode,void 0===b||At||(xt=Math.abs(b-A(l)[D])),L(),B(!0)}if(a.contains(ot))return B(!1)}return!1}function Y(s,c){et(s,f,r({evt:t,isOwner:d,axis:i?"vertical":"horizontal",revert:o,dragRect:e,targetRect:n,canSort:h,fromSortable:p,target:l,completed:B,onMove:function(n,o){return Zt(at,a,ot,e,n,A(n),t,o)},changed:L},c))}function F(){Y("dragOverAnimationCapture"),f.captureAnimationState(),f!==p&&p.captureAnimationState()}function B(e){return Y("dragOverCompleted",{insertion:e}),e&&(d?u._hideClone():u._showClone(f),f!==p&&(C(ot,mt?mt.options.ghostClass:u.options.ghostClass,!1),C(ot,s.ghostClass,!0)),mt!==f&&f!==qt.active?mt=f:f===qt.active&&mt&&(mt=null),p===f&&(f._ignoreWhileAnimating=l),f.animateAll((function(){Y("dragOverAnimationComplete"),f._ignoreWhileAnimating=null})),f!==p&&(p.animateAll(),p._ignoreWhileAnimating=null)),(l===ot&&!ot.animated||l===a&&!l.animated)&&(Ot=null),s.dragoverBubble||t.rootEl||l===document||(ot.parentNode[U]._isOutsideThisEl(t.target),!e&&zt(t)),!s.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),g=!0}function L(){ht=X(ot),ft=X(ot,s.draggable),nt({sortable:f,name:"change",toEl:a,newIndex:ht,newDraggableIndex:ft,originalEvent:t})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){E(document,"mousemove",this._onTouchMove),E(document,"touchmove",this._onTouchMove),E(document,"pointermove",this._onTouchMove),E(document,"dragover",zt),E(document,"mousemove",zt),E(document,"touchmove",zt)},_offUpEvents:function(){var t=this.el.ownerDocument;E(t,"mouseup",this._onDrop),E(t,"touchend",this._onDrop),E(t,"pointerup",this._onDrop),E(t,"touchcancel",this._onDrop),E(document,"selectstart",this)},_onDrop:function(t){var e=this.el,n=this.options;ht=X(ot),ft=X(ot,n.draggable),et("drop",this,{evt:t}),it=ot&&ot.parentNode,ht=X(ot),ft=X(ot,n.draggable),qt.eventCanceled||(Tt=!1,At=!1,Mt=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),le(this.cloneId),le(this._dragStartId),this.nativeDraggable&&(E(document,"drop",this),E(e,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),m&&T(document.body,"user-select",""),T(ot,"transform",""),t&&(Dt&&(t.cancelable&&t.preventDefault(),!n.dropBubble&&t.stopPropagation()),rt&&rt.parentNode&&rt.parentNode.removeChild(rt),(at===it||mt&&"clone"!==mt.lastPutMode)&&ct&&ct.parentNode&&ct.parentNode.removeChild(ct),ot&&(this.nativeDraggable&&E(ot,"dragend",this),Kt(ot),ot.style["will-change"]="",Dt&&!Tt&&C(ot,mt?mt.options.ghostClass:this.options.ghostClass,!1),C(ot,this.options.chosenClass,!1),nt({sortable:this,name:"unchoose",toEl:it,newIndex:null,newDraggableIndex:null,originalEvent:t}),at!==it?(ht>=0&&(nt({rootEl:it,name:"add",toEl:it,fromEl:at,originalEvent:t}),nt({sortable:this,name:"remove",toEl:it,originalEvent:t}),nt({rootEl:it,name:"sort",toEl:it,fromEl:at,originalEvent:t}),nt({sortable:this,name:"sort",toEl:it,originalEvent:t})),mt&&mt.save()):ht!==dt&&ht>=0&&(nt({sortable:this,name:"update",toEl:it,originalEvent:t}),nt({sortable:this,name:"sort",toEl:it,originalEvent:t})),qt.active&&(null!=ht&&-1!==ht||(ht=dt,ft=pt),nt({sortable:this,name:"end",toEl:it,originalEvent:t}),this.save())))),this._nulling()},_nulling:function(){et("nulling",this),at=ot=it=rt=lt=ct=st=ut=vt=bt=Dt=ht=ft=dt=pt=Ot=St=mt=gt=qt.dragged=qt.ghost=qt.clone=qt.active=null,kt.forEach((function(t){t.checked=!0})),kt.length=wt=yt=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":ot&&(this._onDragOver(t),Jt(t));break;case"selectstart":t.preventDefault();break}},toArray:function(){for(var t,e=[],n=this.el.children,o=0,i=n.length,r=this.options;o<i;o++)t=n[o],O(t,r.draggable,this.el,!1)&&e.push(t.getAttribute(r.dataIdAttr)||ie(t));return e},sort:function(t,e){var n={},o=this.el;this.toArray().forEach((function(t,e){var i=o.children[e];O(i,this.options.draggable,o,!1)&&(n[t]=i)}),this),e&&this.captureAnimationState(),t.forEach((function(t){n[t]&&(o.removeChild(n[t]),o.appendChild(n[t]))})),e&&this.animateAll()},save:function(){var t=this.options.store;t&&t.set&&t.set(this)},closest:function(t,e){return O(t,e||this.options.draggable,this.el,!1)},option:function(t,e){var n=this.options;if(void 0===e)return n[t];var o=K.modifyOption(this,t,e);n[t]="undefined"!==typeof o?o:e,"group"===t&&Ht(n)},destroy:function(){et("destroy",this);var t=this.el;t[U]=null,E(t,"mousedown",this._onTapStart),E(t,"touchstart",this._onTapStart),E(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(E(t,"dragover",this),E(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(){if(!ut){if(et("hideClone",this),qt.eventCanceled)return;T(ct,"display","none"),this.options.removeCloneOnHide&&ct.parentNode&&ct.parentNode.removeChild(ct),ut=!0}},_showClone:function(t){if("clone"===t.lastPutMode){if(ut){if(et("showClone",this),qt.eventCanceled)return;ot.parentNode!=at||this.options.group.revertClone?lt?at.insertBefore(ct,lt):at.appendChild(ct):at.insertBefore(ct,ot),this.options.group.revertClone&&this.animate(ot,ct),T(ct,"display",""),ut=!1}}else this._hideClone()}},Xt&&y(document,"touchmove",(function(t){(qt.active||Tt)&&t.cancelable&&t.preventDefault()})),qt.utils={on:y,off:E,css:T,find:N,is:function(t,e){return!!O(t,e,t,!1)},extend:B,throttle:V,closest:O,toggleClass:C,clone:W,index:X,nextTick:ae,cancelNextTick:le,detectDirection:Lt,getChild:j},qt.get=function(t){return t[U]},qt.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(t){if(!t.prototype||!t.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(t));t.utils&&(qt.utils=r(r({},qt.utils),t.utils)),K.mount(t)}))},qt.create=function(t,e){return new qt(t,e)},qt.version=d;var se,ce,ue,de,he,pe,fe=[],ge=!1;function me(){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:function(t){var e=t.originalEvent;this.sortable.nativeDraggable?y(document,"dragover",this._handleAutoScroll):this.options.supportPointer?y(document,"pointermove",this._handleFallbackAutoScroll):e.touches?y(document,"touchmove",this._handleFallbackAutoScroll):y(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(t){var e=t.originalEvent;this.options.dragOverBubble||e.rootEl||this._handleAutoScroll(e)},drop:function(){this.sortable.nativeDraggable?E(document,"dragover",this._handleAutoScroll):(E(document,"pointermove",this._handleFallbackAutoScroll),E(document,"touchmove",this._handleFallbackAutoScroll),E(document,"mousemove",this._handleFallbackAutoScroll)),be(),ve(),$()},nulling:function(){he=ce=se=ge=pe=ue=de=null,fe.length=0},_handleFallbackAutoScroll:function(t){this._handleAutoScroll(t,!0)},_handleAutoScroll:function(t,e){var n=this,o=(t.touches?t.touches[0]:t).clientX,i=(t.touches?t.touches[0]:t).clientY,r=document.elementFromPoint(o,i);if(he=t,e||this.options.forceAutoScrollFallback||f||p||m){we(t,this.options,r,e);var a=F(r,!0);!ge||pe&&o===ue&&i===de||(pe&&be(),pe=setInterval((function(){var r=F(document.elementFromPoint(o,i),!0);r!==a&&(a=r,ve()),we(t,n.options,r,e)}),10),ue=o,de=i)}else{if(!this.options.bubbleScroll||F(r,!0)===M())return void ve();we(t,this.options,F(r,!1),!1)}}},s(t,{pluginName:"scroll",initializeByDefault:!0})}function ve(){fe.forEach((function(t){clearInterval(t.pid)})),fe=[]}function be(){clearInterval(pe)}var we=V((function(t,e,n,o){if(e.scroll){var i,r=(t.touches?t.touches[0]:t).clientX,a=(t.touches?t.touches[0]:t).clientY,l=e.scrollSensitivity,s=e.scrollSpeed,c=M(),u=!1;ce!==n&&(ce=n,ve(),se=e.scroll,i=e.scrollFn,!0===se&&(se=F(n,!0)));var d=0,h=se;do{var p=h,f=A(p),g=f.top,m=f.bottom,v=f.left,b=f.right,w=f.width,y=f.height,E=void 0,_=void 0,D=p.scrollWidth,O=p.scrollHeight,S=T(p),x=p.scrollLeft,C=p.scrollTop;p===c?(E=w<D&&("auto"===S.overflowX||"scroll"===S.overflowX||"visible"===S.overflowX),_=y<O&&("auto"===S.overflowY||"scroll"===S.overflowY||"visible"===S.overflowY)):(E=w<D&&("auto"===S.overflowX||"scroll"===S.overflowX),_=y<O&&("auto"===S.overflowY||"scroll"===S.overflowY));var I=E&&(Math.abs(b-r)<=l&&x+w<D)-(Math.abs(v-r)<=l&&!!x),N=_&&(Math.abs(m-a)<=l&&C+y<O)-(Math.abs(g-a)<=l&&!!C);if(!fe[d])for(var P=0;P<=d;P++)fe[P]||(fe[P]={});fe[d].vx==I&&fe[d].vy==N&&fe[d].el===p||(fe[d].el=p,fe[d].vx=I,fe[d].vy=N,clearInterval(fe[d].pid),0==I&&0==N||(u=!0,fe[d].pid=setInterval(function(){o&&0===this.layer&&qt.active._onTouchMove(he);var e=fe[this.layer].vy?fe[this.layer].vy*s:0,n=fe[this.layer].vx?fe[this.layer].vx*s:0;"function"===typeof i&&"continue"!==i.call(qt.dragged.parentNode[U],n,e,t,he,fe[this.layer].el)||H(fe[this.layer].el,n,e)}.bind({layer:d}),24))),d++}while(e.bubbleScroll&&h!==c&&(h=F(h,!1)));ge=u}}),30),ye=function(t){var e=t.originalEvent,n=t.putSortable,o=t.dragEl,i=t.activeSortable,r=t.dispatchSortableEvent,a=t.hideGhostForTarget,l=t.unhideGhostForTarget;if(e){var s=n||i;a();var c=e.changedTouches&&e.changedTouches.length?e.changedTouches[0]:e,u=document.elementFromPoint(c.clientX,c.clientY);l(),s&&!s.el.contains(u)&&(r("spill"),this.onSpill({dragEl:o,putSortable:n}))}};function Ee(){}function _e(){}function De(){return"undefined"!==typeof window?window.console:t.console}Ee.prototype={startIndex:null,dragStart:function(t){var e=t.oldDraggableIndex;this.startIndex=e},onSpill:function(t){var e=t.dragEl,n=t.putSortable;this.sortable.captureAnimationState(),n&&n.captureAnimationState();var o=j(this.sortable.el,this.startIndex,this.options);o?this.sortable.el.insertBefore(e,o):this.sortable.el.appendChild(e),this.sortable.animateAll(),n&&n.animateAll()},drop:ye},s(Ee,{pluginName:"revertOnSpill"}),_e.prototype={onSpill:function(t){var e=t.dragEl,n=t.putSortable,o=n||this.sortable;o.captureAnimationState(),e.parentNode&&e.parentNode.removeChild(e),o.animateAll()},drop:ye},s(_e,{pluginName:"removeOnSpill"}),qt.mount(new me),qt.mount(_e,Ee);const Oe=De();function Se(t){const e=Object.create(null);return function(n){const o=e[n];return o||(e[n]=t(n))}}const xe=/-(\w)/g,Ce=Se(t=>t.replace(xe,(t,e)=>e?e.toUpperCase():""));function Te(t){null!==t.parentElement&&t.parentElement.removeChild(t)}function Ie(t,e,n){const o=0===n?t.children[0]:t.children[n-1].nextSibling;t.insertBefore(e,o)}function Ne(t,e){return Object.values(t).indexOf(e)}function Me(t,e,n,o){if(!t)return[];const i=Object.values(t),r=e.length-o,a=[...e].map((t,e)=>e>=r?i.length:i.indexOf(t));return a}function Ae(t,e){this.$nextTick(()=>this.$emit(t.toLowerCase(),e))}function Pe(t){return e=>{null!==this.realList&&this["onDrag"+t](e),Ae.call(this,t,e)}}function je(t){return["transition-group","TransitionGroup"].includes(t)}function ke(t){if(!t||1!==t.length)return!1;const[{type:e}]=t;return!!e&&je(e.name)}function Xe(t,e){return e?{...e.props,...e.attrs}:t}const Re=["Start","Add","Remove","Update","End"],Ye=["Choose","Unchoose","Sort","Filter","Clone"],Fe=["Move",...Re,...Ye].map(t=>"on"+t);let Be=null;const Le={options:Object,list:{type:Array,required:!1,default:null},noTransitionOnDrag:{type:Boolean,default:!1},clone:{type:Function,default:t=>t},tag:{type:String,default:"div"},move:{type:Function,default:null},componentData:{type:Object,required:!1,default:null},component:{type:String,default:null},modelValue:{type:Array,required:!1,default:null}},Ve=Object(o["defineComponent"])({name:"VueDraggableNext",inheritAttrs:!1,emits:["update:modelValue","move","change",...Re.map(t=>t.toLowerCase()),...Ye.map(t=>t.toLowerCase())],props:Le,data(){return{transitionMode:!1,noneFunctionalComponentMode:!1,headerOffset:0,footerOffset:0,_sortable:{},visibleIndexes:[],context:{}}},render(){const t=this.$slots.default?this.$slots.default():null,e=Xe(this.$attrs,this.componentData);return t?(this.transitionMode=ke(t),Object(o["h"])(this.getTag(),e,t)):Object(o["h"])(this.getTag(),e,[])},created(){null!==this.list&&null!==this.modelValue&&Oe.error("list props are mutually exclusive! Please set one.")},mounted(){const t={};Re.forEach(e=>{t["on"+e]=Pe.call(this,e)}),Ye.forEach(e=>{t["on"+e]=Ae.bind(this,e)});const e=Object.keys(this.$attrs).reduce((t,e)=>(t[Ce(e)]=this.$attrs[e],t),{}),n=Object.assign({},e,t,{onMove:(t,e)=>this.onDragMove(t,e)});!("draggable"in n)&&(n.draggable=">*");const o=1===this.$el.nodeType?this.$el:this.$el.parentElement;this._sortable=new qt(o,n),o.__draggable_component__=this,this.computeIndexes()},beforeUnmount(){try{void 0!==this._sortable&&this._sortable.destroy()}catch(t){}},computed:{realList(){return this.list?this.list:this.modelValue}},watch:{$attrs:{handler(t){this.updateOptions(t)},deep:!0},realList(){this.computeIndexes()}},methods:{getTag(){return this.component?Object(o["resolveComponent"])(this.component):this.tag},updateOptions(t){for(var e in t){const n=Ce(e);-1===Fe.indexOf(n)&&this._sortable.option(n,t[e])}},getChildrenNodes(){return this.$el.children},computeIndexes(){this.$nextTick(()=>{this.visibleIndexes=Me(this.getChildrenNodes(),this.$el.children,this.transitionMode,this.footerOffset)})},getUnderlyingVm(t){const e=Ne(this.getChildrenNodes()||[],t);if(-1===e)return null;const n=this.realList[e];return{index:e,element:n}},emitChanges(t){this.$nextTick(()=>{this.$emit("change",t)})},alterList(t){if(this.list)return void t(this.list);const e=[...this.modelValue];t(e),this.$emit("update:modelValue",e)},spliceList(){const t=t=>t.splice(...arguments);this.alterList(t)},updatePosition(t,e){const n=n=>n.splice(e,0,n.splice(t,1)[0]);this.alterList(n)},getVmIndex(t){const e=this.visibleIndexes,n=e.length;return t>n-1?n:e[t]},getComponent(){return this.$slots.default?this.$slots.default()[0].componentInstance:null},resetTransitionData(t){if(!this.noTransitionOnDrag||!this.transitionMode)return;var e=this.getChildrenNodes();e[t].data=null;const n=this.getComponent();n.children=[],n.kept=void 0},onDragStart(t){this.computeIndexes(),this.context=this.getUnderlyingVm(t.item),this.context&&(t.item._underlying_vm_=this.clone(this.context.element),Be=t.item)},onDragAdd(t){const e=t.item._underlying_vm_;if(void 0===e)return;Te(t.item);const n=this.getVmIndex(t.newIndex);this.spliceList(n,0,e),this.computeIndexes();const o={element:e,newIndex:n};this.emitChanges({added:o})},onDragRemove(t){if(Ie(this.$el,t.item,t.oldIndex),"clone"===t.pullMode)return void Te(t.clone);if(!this.context)return;const e=this.context.index;this.spliceList(e,1);const n={element:this.context.element,oldIndex:e};this.resetTransitionData(e),this.emitChanges({removed:n})},onDragUpdate(t){Te(t.item),Ie(t.from,t.item,t.oldIndex);const e=this.context.index,n=this.getVmIndex(t.newIndex);this.updatePosition(e,n);const o={element:this.context.element,oldIndex:e,newIndex:n};this.emitChanges({moved:o})},updateProperty(t,e){t.hasOwnProperty(e)&&(t[e]+=this.headerOffset)},onDragMove(t,e){const n=this.move;if(!n||!this.realList)return!0;const o=this.getRelatedContextFromMoveEvent(t),i=this.context,r=this.computeFutureIndex(o,t);Object.assign(i,{futureIndex:r});const a=Object.assign({},t,{relatedContext:o,draggedContext:i});return n(a,e)},onDragEnd(){this.computeIndexes(),Be=null},getTrargetedComponent(t){return t.__draggable_component__},getRelatedContextFromMoveEvent({to:t,related:e}){const n=this.getTrargetedComponent(t);if(!n)return{component:n};const o=n.realList,i={list:o,component:n};if(t!==e&&o&&n.getUnderlyingVm){const t=n.getUnderlyingVm(e);if(t)return Object.assign(t,i)}return i},computeFutureIndex(t,e){const n=[...e.to.children].filter(t=>"none"!==t.style["display"]);if(0===n.length)return 0;const o=n.indexOf(e.related),i=t.component.getVmIndex(o),r=-1!==n.indexOf(Be);return r||!e.willInsertAfter?i:i+1}}})}).call(this,n("a282"))}}]);
|