New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-virtual-drag-list

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-virtual-drag-list - npm Package Compare versions

Comparing version 2.5.0 to 2.5.1

2

dist/virtual-drag-list.min.js

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

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("react")):"function"==typeof define&&define.amd?define(["react"],e):(t=t||self).VirtualDragList=e(t.React)}(this,function(gt){"use strict";function O(){O=function(){return a};var a={},t=Object.prototype,c=t.hasOwnProperty,e="function"==typeof Symbol?Symbol:{},r=e.iterator||"@@iterator",n=e.asyncIterator||"@@asyncIterator",o=e.toStringTag||"@@toStringTag";function i(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{i({},"")}catch(t){i=function(t,e,n){return t[e]=n}}function s(t,e,n,r){var o,i,a,s,e=e&&e.prototype instanceof h?e:h,e=Object.create(e.prototype),r=new w(r||[]);return e._invoke=(o=t,i=n,a=r,s="suspendedStart",function(t,e){if("executing"===s)throw new Error("Generator is already running");if("completed"===s){if("throw"===t)throw e;return x()}for(a.method=t,a.arg=e;;){var n=a.delegate;if(n){n=function t(e,n){var r=e.iterator[n.method];if(void 0===r){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=void 0,t(e,n),"throw"===n.method))return u;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return u}r=l(r,e.iterator,n.arg);if("throw"===r.type)return n.method="throw",n.arg=r.arg,n.delegate=null,u;r=r.arg;return r?r.done?(n[e.resultName]=r.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=void 0),n.delegate=null,u):r:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,u)}(n,a);if(n){if(n===u)continue;return n}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if("suspendedStart"===s)throw s="completed",a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);s="executing";n=l(o,i,a);if("normal"===n.type){if(s=a.done?"completed":"suspendedYield",n.arg===u)continue;return{value:n.arg,done:a.done}}"throw"===n.type&&(s="completed",a.method="throw",a.arg=n.arg)}}),e}function l(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}a.wrap=s;var u={};function h(){}function f(){}function d(){}var e={},p=(i(e,r,function(){return this}),Object.getPrototypeOf),p=p&&p(p(S([]))),m=(p&&p!==t&&c.call(p,r)&&(e=p),d.prototype=h.prototype=Object.create(e));function g(t){["next","throw","return"].forEach(function(e){i(t,e,function(t){return this._invoke(e,t)})})}function v(a,s){var e;this._invoke=function(n,r){function t(){return new s(function(t,e){!function e(t,n,r,o){var i,t=l(a[t],a,n);if("throw"!==t.type)return(n=(i=t.arg).value)&&"object"==typeof n&&c.call(n,"__await")?s.resolve(n.__await).then(function(t){e("next",t,r,o)},function(t){e("throw",t,r,o)}):s.resolve(n).then(function(t){i.value=t,r(i)},function(t){return e("throw",t,r,o)});o(t.arg)}(n,r,t,e)})}return e=e?e.then(t,t):t()}}function y(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function b(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function w(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(y,this),this.reset(!0)}function S(e){if(e){var n,t=e[r];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return n=-1,(t=function t(){for(;++n<e.length;)if(c.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t}).next=t}return{next:x}}function x(){return{value:void 0,done:!0}}return i(m,"constructor",f.prototype=d),i(d,"constructor",f),f.displayName=i(d,o,"GeneratorFunction"),a.isGeneratorFunction=function(t){t="function"==typeof t&&t.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},a.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,i(t,o,"GeneratorFunction")),t.prototype=Object.create(m),t},a.awrap=function(t){return{__await:t}},g(v.prototype),i(v.prototype,n,function(){return this}),a.AsyncIterator=v,a.async=function(t,e,n,r,o){void 0===o&&(o=Promise);var i=new v(s(t,e,n,r),o);return a.isGeneratorFunction(e)?i:i.next().then(function(t){return t.done?t.value:i.next()})},g(m),i(m,o,"Generator"),i(m,r,function(){return this}),i(m,"toString",function(){return"[object Generator]"}),a.keys=function(n){var t,r=[];for(t in n)r.push(t);return r.reverse(),function t(){for(;r.length;){var e=r.pop();if(e in n)return t.value=e,t.done=!1,t}return t.done=!0,t}},a.values=S,w.prototype={constructor:w,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(b),!t)for(var e in this)"t"===e.charAt(0)&&c.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(n){if(this.done)throw n;var r=this;function t(t,e){return i.type="throw",i.arg=n,r.next=t,e&&(r.method="next",r.arg=void 0),!!e}for(var e=this.tryEntries.length-1;0<=e;--e){var o=this.tryEntries[e],i=o.completion;if("root"===o.tryLoc)return t("end");if(o.tryLoc<=this.prev){var a=c.call(o,"catchLoc"),s=c.call(o,"finallyLoc");if(a&&s){if(this.prev<o.catchLoc)return t(o.catchLoc,!0);if(this.prev<o.finallyLoc)return t(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return t(o.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return t(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;0<=n;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&c.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}var i=(o=o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc?null:o)?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,u):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),u},finish:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),b(n),u}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n,r,o=this.tryEntries[e];if(o.tryLoc===t)return"throw"===(n=o.completion).type&&(r=n.arg,b(o)),r}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:S(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),u}},a}function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function e(t,e,n){e&&r(t.prototype,e),n&&r(t,n),Object.defineProperty(t,"prototype",{writable:!1})}function vt(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),!e||i.length!==e);a=!0);}catch(t){s=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(t,e)||n(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function yt(t){return function(t){if(Array.isArray(t))return a(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||n(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(t,e){if(t){if("string"==typeof t)return a(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(n="Object"===n&&t.constructor?t.constructor.name:n)||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(t,e):void 0}}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function bt(i,t,e){function n(){for(var t,e=this,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return a&&clearTimeout(a),l?(t=!a,a=setTimeout(function(){a=null},c),t&&(s=i.apply(this,r))):a=setTimeout(function(){i.apply(e,r)},c),s}var a,s,c=1<arguments.length&&void 0!==t?t:50,l=2<arguments.length&&void 0!==e&&e;return n.prototype.cancel=function(){clearTimeout(a),a=null},n}function wt(t,e){return(Array.isArray(e)?e:e.replace(/\[/g,".").replace(/\]/g,".").split(".")).reduce(function(t,e){return(t||{})[e]},t)}gt=gt&&Object.prototype.hasOwnProperty.call(gt,"default")?gt.default:gt;var s="INIT",c="FIXED",l="DYNAMIC",u="FRONT",h="BEHIND",St=function(){function n(t,e){o(this,n),this.options=Object.assign({},t),this.callback=e,this.sizes=new Map,this.calcIndex=0,this.calcType=s,this.calcSize=Object.create(null),this.direction="",this.offset=0,this.range=Object.create(null),t&&this.checkIfUpdate(0,t.keeps-1)}return e(n,[{key:"updateUniqueKeys",value:function(t){this.options.uniqueKeys=t}},{key:"updateSizes",value:function(n){var r=this;this.sizes.forEach(function(t,e){n.includes(e)||r.sizes.delete(e)})}},{key:"updateRange",value:function(){var t,e,n=this,r=0<arguments.length&&void 0!==arguments[0]?arguments[0]:1;10<r||(t=this.range.start,this.isFront()?t-=2:this.isBehind()&&(t+=2),t=Math.max(t,0),e=Math.min(this.options.keeps,this.options.uniqueKeys.length),this.sizes.size>=e-2?this.handleUpdate(t,this.getEndByStart(t)):window.requestAnimationFrame?window.requestAnimationFrame(function(){return n.updateRange(r++)}):setTimeout(function(){return n.updateRange(r++)},3))}},{key:"handleScroll",value:function(t){this.direction=t<this.offset?u:h,this.offset=t;t=this.getScrollItems(t);this.isFront()?this.handleScrollFront(t):this.isBehind()&&this.handleScrollBehind(t)}},{key:"isFront",value:function(){return this.direction===u}},{key:"isBehind",value:function(){return this.direction===h}},{key:"isFixed",value:function(){return this.calcType===c}},{key:"getScrollItems",value:function(t){var e=this.calcSize,n=e.fixed,e=e.header;if(e&&(t-=e),t<=0)return 0;if(this.isFixed())return Math.floor(t/n);for(var r,o,i=0,a=this.options.uniqueKeys.length;i<=a;){if(r=i+Math.floor((a-i)/2),(o=this.getOffsetByIndex(r))===t)return r;o<t?i=r+1:t<o&&(a=r-1)}return 0<i?--i:0}},{key:"handleScrollFront",value:function(t){t>this.range.start||(t=Math.max(t-Math.round(this.options.keeps/3),0),this.checkIfUpdate(t,this.getEndByStart(t)))}},{key:"handleScrollBehind",value:function(t){t<this.range.start+Math.round(this.options.keeps/3)||this.checkIfUpdate(t,this.getEndByStart(t))}},{key:"checkIfUpdate",value:function(t,e){var n=this.options,r=n.uniqueKeys,n=n.keeps;r.length&&r.length<=n?(t=0,e=r.length-1):e-t<n-1&&(t=e-n+1),this.range.start!==t&&this.handleUpdate(t,e)}},{key:"handleUpdate",value:function(t,e){this.range.start=t,this.range.end=e,this.range.front=this.getFrontOffset(),this.range.behind=this.getBehindOffset(),this.callback(Object.assign({},this.range))}},{key:"getFrontOffset",value:function(){return this.isFixed()?this.calcSize.fixed*this.range.start:this.getOffsetByIndex(this.range.start)}},{key:"getBehindOffset",value:function(){var t=this.getLastIndex();return this.isFixed()?(t-this.range.end)*this.calcSize.fixed:this.calcIndex===t?this.getOffsetByIndex(t)-this.getOffsetByIndex(this.range.end):(t-this.range.end)*this.getItemSize()}},{key:"getOffsetByIndex",value:function(t){if(!t)return 0;for(var e=0,n=0;n<t;n++){var r=this.sizes.get(this.options.uniqueKeys[n]);e+="number"==typeof r?r:this.getItemSize()}return this.calcIndex=Math.max(this.calcIndex,t-1),this.calcIndex=Math.min(this.calcIndex,this.getLastIndex()),e}},{key:"getEndByStart",value:function(t){return Math.min(t+this.options.keeps-1,this.getLastIndex())}},{key:"getLastIndex",value:function(){var t=this.options,e=t.uniqueKeys,t=t.keeps;return 0<e.length?e.length-1:t-1}},{key:"getItemSize",value:function(){return this.isFixed()?this.calcSize.fixed:this.calcSize.average||this.options.size}},{key:"handleItemSizeChange",value:function(t,e){this.sizes.set(t,e),this.calcType===s?(this.calcType=c,this.calcSize.fixed=e):this.isFixed()&&this.calcSize.fixed!==e&&(this.calcType=l,this.calcSize.fixed=0),this.calcType!==c&&(this.calcSize.total=yt(this.sizes.values()).reduce(function(t,e){return t+e},0),this.calcSize.average=Math.round(this.calcSize.total/this.sizes.size))}},{key:"handleSlotSizeChange",value:function(t,e){this.calcSize[t]=e}}]),n}();function f(t,a,s,c){return new(s=s||Promise)(function(n,e){function r(t){try{i(c.next(t))}catch(t){e(t)}}function o(t){try{i(c.throw(t))}catch(t){e(t)}}function i(t){var e;t.done?n(t.value):((e=t.value)instanceof s?e:new s(function(t){t(e)})).then(r,o)}i((c=c.apply(t,a||[])).next())})}(function(F){function B(e,t){var n,r=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)),r}function c(o){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?B(Object(i),!0).forEach(function(t){var e,n=o,r=i[t];(t="symbol"==typeof(e=function(t){if("object"!=typeof t||null===t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return String(t);if("object"!=typeof(e=e.call(t,"string")))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t))?e:String(e))in n?Object.defineProperty(n,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):n[t]=r}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(i)):B(Object(i)).forEach(function(t){Object.defineProperty(o,t,Object.getOwnPropertyDescriptor(i,t))})}return o}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})(t)}function t(t){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(t)}function o(t,e){t.style["".concat(b,"TransitionDuration")]=null==e?"":"".concat(e,"ms")}function l(t,e){t.style["".concat(b,"Transform")]=e?"".concat(e):""}function u(t,e,n){window.addEventListener?t.addEventListener(e,n,!(!Q&&v)&&G):window.attachEvent&&t.attachEvent("on"+e,n)}function n(t,e,n){window.removeEventListener?t.removeEventListener(e,n,!(!Q&&v)&&G):window.detachEvent&&t.detachEvent("on"+e,n)}function R(t){var e=t,n=t.touches&&t.touches[0]||t.changedTouches&&t.changedTouches[0],t=n?document.elementFromPoint(n.clientX,n.clientY):t.target;return!n||"clientX"in e||(e.clientX=n.clientX,e.clientY=n.clientY,e.pageX=n.pageX,e.pageY=n.pageY,e.screenX=n.screenX,e.screenY=n.screenY),{touch:n,event:e,target:t}}function h(t,e){for(var n={top:0,left:0,height:t.offsetHeight,width:t.offsetWidth};n.top+=t.offsetTop,n.left+=t.offsetLeft,(t=t.parentNode)&&t!==e;);return n}function d(){return document.scrollingElement||document.documentElement}function m(t){var e,n,r,o,i,a,s,c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},l=2<arguments.length?arguments[2]:void 0;if(t.getBoundingClientRect||t===window){if(t!==window&&t.parentNode&&t!==d()){if(n=(e=t.getBoundingClientRect()).top,r=e.left,o=e.bottom,i=e.right,a=e.height,s=e.width,c.parent&&t.parentNode!==t.ownerDocument.body)for(var u,h=t.parentNode;h&&h.getBoundingClientRect&&h!==t.ownerDocument.body;){if((u=h.getBoundingClientRect()).height<a)return n=u.top,r=u.left,o=u.bottom,i=u.right,a=u.height,{top:n,left:r,bottom:o,right:i,width:s=u.width,height:a};h=h.parentNode}}else r=n=0,o=window.innerHeight,i=window.innerWidth,a=window.innerHeight,s=window.innerWidth;if((c.block||c.relative)&&t!==window&&(l=l||t.parentNode,!v))do{if(l&&l.getBoundingClientRect&&("none"!==p(l,"transform")||c.relative&&"static"!==p(l,"position"))){var f=l.getBoundingClientRect();n-=f.top+parseInt(p(l,"border-top-width")),r-=f.left+parseInt(p(l,"border-left-width")),o=n+e.height,i=r+e.width;break}}while(l=l.parentNode);return{top:n,left:r,bottom:o,right:i,width:s,height:a}}}function P(t,e,n,r){if(t){n=n||document;do{if(null==e){var o=Array.prototype.slice.call(n.children),i=o.indexOf(t);if(-1<i)return o[i];for(var a=0;a<o.length;a++)if(K(t,o[a]))return o[a]}else if((">"!==e[0]||t.parentNode===n)&&H(t,e)||r&&t===n)return t}while(t=t.parentNode)}return null}function K(t,e){if(t&&e){if(e.compareDocumentPosition)return e===t||16&e.compareDocumentPosition(t);if(e.contains&&1===t.nodeType)return e.contains(t)&&e!==t;for(;t=t.parentNode;)if(t===e)return 1}}function Y(t,e,n){var r;t&&e&&(t.classList?t.classList[n?"add":"remove"](e):(r=(" "+t.className+" ").replace(J," ").replace(" "+e+" "," "),t.className=(r+(n?" "+e:"")).replace(J," ")))}function H(t,e){if(e&&(">"===e[0]&&(e=e.substring(1)),t))try{return t.matches?t.matches(e):t.msMatchesSelector?t.msMatchesSelector(e):t.webkitMatchesSelector&&t.webkitMatchesSelector(e)}catch(t){return}}function X(t,e){return t.top!==e.top||t.left!==e.left}function p(t,e,n){var r=t&&t.style;if(r){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];r[e=e in r||-1!==e.indexOf("webkit")?e:"-webkit-"+e]=n+("string"==typeof n?"":"px")}}function s(t,e){return t.sortable.el!==e.sortable.el}function f(t,e){p(t,"display",e?"":"none")}function q(t){this.options=t||{},this.groupName=t.group.name||"group_"+Number(Math.random().toString().slice(-3)+Date.now()).toString(32)}function V(){this.autoScrollAnimationFrame=null,this.speed={x:10,y:10}}function W(t){this.options=t,this.animations=[]}function U(){this.helper=null,this.distance={x:0,y:0}}function i(){var t,e={from:c({},j),to:c({},z)};return C&&(t={from:c({},S),to:c({},x)},e.from=c(c({},t.from),e.from),e.to=c(c({},t.to),e.to)),e}function a(t,e){if(!t||!t.nodeType||1!==t.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));(t[w]=this).el=t,this.ownerDocument=t.ownerDocument,this.options=e=Object.assign({},e);var n,r,o={disabled:!1,group:"",animation:150,multiple:!1,draggable:null,handle:null,onDrag:null,onMove:null,onDrop:null,onChange:null,autoScroll:!0,scrollThreshold:55,delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,ghostClass:"",ghostStyle:{},chosenClass:"",selectedClass:"",swapOnDrop:!0,fallbackOnBody:!1,stopPropagation:!1,supportTouch:"ontouchstart"in window,emptyInsertThreshold:5};for(n in o)n in this.options||(this.options[n]=o[n]);for(r in rt(e),this)"_"===r.charAt(0)&&"function"==typeof this[r]&&(this[r]=this[r].bind(this));u(t,this.options.supportTouch?"touchstart":"mousedown",this._onDrag),I.push(t),this.multiplayer=new q(this.options),this.animator=new W(this.options)}var G,J,g,Z,v,$,y,Q,b,w,e,S,x,O,_,E,T,k,N,L,C,tt,et,r,I,D,nt,j,z,M,rt;F.exports=(G={capture:!1,passive:!1},J=/\s+/g,g={start:["touchstart","mousedown"],move:["touchmove","mousemove"],end:["touchend","touchcancel","mouseup"]},v=t(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),$=t(/Edge/i),y=t(/safari/i)&&!t(/chrome/i)&&!t(/android/i),Z=!1,document.addEventListener("checkIfSupportPassive",null,{get passive(){return Z=!0}}),Q=Z,b="undefined"==typeof window||"undefined"==typeof document?"":(e=window.getComputedStyle(document.documentElement,"")||["-moz-hidden-iframe"],"ms"!==(e=(Array.prototype.slice.call(e).join("").match(/-(moz|webkit|ms)-/)||""===e.OLink&&["","o"])[1])?e&&e.length?e[0].toUpperCase()+e.substr(1):"":"ms"),w="Sortable"+Date.now(),S=c({},e={sortable:null,nodes:[]}),x=c({},e),O={},q.prototype={allowDrag:function(t){return this.options.multiple&&O[this.groupName]&&O[this.groupName].length&&-1<O[this.groupName].indexOf(t)},getHelper:function(){var n=document.createElement("div");return O[this.groupName].forEach(function(t,e){(t=t.cloneNode(!0)).style="\n opacity: ".concat(0===e?1:.5,";\n position: absolute;\n z-index: ").concat(e,";\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n "),n.appendChild(t)}),n},select:function(t,e,n,r){var o;e&&(O[this.groupName]||(O[this.groupName]=[]),o=O[this.groupName].indexOf(e),Y(e,this.options.selectedClass,o<0),t=c(c({},r),{},{event:t}),o<0?(O[this.groupName].push(e),r.sortable._dispatchEvent("onSelect",t)):(O[this.groupName].splice(o,1),r.sortable._dispatchEvent("onDeselect",t)),O[this.groupName].sort(function(t,e){return t=h(t,n),e=h(e,n),t.top==e.top?t.left-e.left:t.top-e.top}))},onDrag:function(e,t){S.sortable=t,S.nodes=O[this.groupName].map(function(t){return{node:t,rect:m(t),offset:h(t,e)}}),x.sortable=t},onTrulyStarted:function(e,t){t.animator.collect(e,null,e.parentNode),O[this.groupName].forEach(function(t){t!=e&&f(t,!1)}),t.animator.animate()},onChange:function(t,e){var n=m(t),r=h(t,e.el);x.sortable=e,x.nodes=O[this.groupName].map(function(t){return{node:t,rect:n,offset:r}})},onDrop:function(t,n,e,r,o){var i=this,a=(x.sortable.animator.collect(n,null,n.parentNode),O[this.groupName].indexOf(n)),r=(O[this.groupName].forEach(function(t,e){f(t,!0),e<a?n.parentNode.insertBefore(t,n):(e=0<e?O[i.groupName][e-1]:n,n.parentNode.insertBefore(t,e.nextSibling))}),S.sortable=r.sortable,x.nodes=O[this.groupName].map(function(t){return{node:t,rect:m(t),offset:h(t,e)}}),s(S,x)||this._offsetChanged(S.nodes,x.nodes)),o=c(c({},o()),{},{changed:r,event:t});s(S,x)&&S.sortable._dispatchEvent("onDrop",o),x.sortable._dispatchEvent("onDrop",o),x.sortable.animator.animate()},_offsetChanged:function(t,n){return!!t.find(function(e){return X(n.find(function(t){return t.node===e.node}).offset,e.offset)})}},window.requestAnimationFrame||(window.requestAnimationFrame=function(t){return setTimeout(t,17)}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)}),V.prototype={clear:function(){null!=this.autoScrollAnimationFrame&&(cancelAnimationFrame(this.autoScrollAnimationFrame),this.autoScrollAnimationFrame=null)},update:function(t,e,n,r){var o=this;cancelAnimationFrame(this.autoScrollAnimationFrame),this.autoScrollAnimationFrame=requestAnimationFrame(function(){n&&r&&o.autoScroll(t,e,r),o.update(t,e,n,r)})},autoScroll:function(t,e,n){var r,o,i,a,s,c,l,u,h,f,d,p;t&&(r=n.clientX,n=n.clientY,void 0!==r)&&void 0!==n&&(h=m(t))&&(d=t.scrollTop,o=t.scrollLeft,i=t.scrollHeight,f=t.scrollWidth,a=h.top,s=h.right,c=h.bottom,l=h.left,p=h.height,h=h.width,n<a||s<r||c<n||r<l||(u=0<d&&a<=n&&n<=a+e,h=o+h<f&&r<=s&&s-e<=r,f=d+p<i&&n<=c&&c-e<=n,(p=d=0)<o&&l<=r&&r<=l+e&&(d=Math.floor(Math.max(-1,(r-l)/e-1)*this.speed.x)),h&&(d=Math.ceil(Math.min(1,(r-s)/e+1)*this.speed.x)),u&&(p=Math.floor(Math.max(-1,(n-a)/e-1)*this.speed.y)),(p=f?Math.ceil(Math.min(1,(n-c)/e+1)*this.speed.y):p)&&(t.scrollTop+=p),d&&(t.scrollLeft+=d)))}},W.prototype={collect:function(t,e,n,r){var o=this;n&&(n=Array.prototype.slice.call(n.children),e=(t=this._getRange(n,t,e,r)).start,t=t.end,this.animations.length=0,n.slice(e,t+1).forEach(function(t){"none"!==p(t,"display")&&t!==r&&t!==a.helper&&o.animations.push({node:t,rect:m(t)})}))},animate:function(){var n=this;this.animations.forEach(function(t){var e=t.node,t=t.rect;n._excute(e,t)})},_excute:function(t,e){var n=e.left,e=(e=e.top)-(r=m(t)).top,n=n-r.left,r=(o(t),l(t,"translate3d(".concat(n,"px, ").concat(e,"px, 0)")),t.offsetWidth,this.options.animation);o(t,r),l(t,"translate3d(0px, 0px, 0px)"),clearTimeout(t.animated),t.animated=setTimeout(function(){o(t),l(t,""),t.animated=null},r)},_getRange:function(t,e,n){var r,e=t.indexOf(e);return(n=t.indexOf(n))<e&&(e=(r=[n,e])[0],n=r[1]),e<0&&(e=n,n=t.length-1),{start:e,end:n=n<0?t.length-1:n}}},U.prototype={get node(){return this.helper},destroy:function(){this.helper&&this.helper.parentNode&&this.helper.parentNode.removeChild(this.helper),this.helper=null,this.distance={x:0,y:0}},move:function(t,e){this.helper&&l(this.helper,"translate3d(".concat(t,"px, ").concat(e,"px, 0)"))},init:function(t,e,n,r){if(!this.helper){var o,i=r.fallbackOnBody,a=r.ghostClass,r=void 0===(r=r.ghostStyle)?{}:r,i=i?document.body:n,s=(this.helper=e.cloneNode(!0),Y(this.helper,a,!0),c({"box-sizing":"border-box",top:t.top,left:t.left,width:t.width,height:t.height,position:"fixed",opacity:"0.8","z-index":1e5,"pointer-events":"none"},r));for(o in s)p(this.helper,o,s[o]);e="none",(n=this.helper).style["".concat(b,"Transition")]=e?"none"===e?"none":"".concat(e):"",l(this.helper,"translate3d(0px, 0px, 0px)"),i.appendChild(this.helper),a=this.distance.x/parseInt(this.helper.style.width)*100,t=this.distance.y/parseInt(this.helper.style.height)*100,p(this.helper,"transform-origin","".concat(a,"% ").concat(t,"%")),p(this.helper,"transform","translateZ(0)"),p(this.helper,"will-change","transform")}}},r={sortable:null,group:null,node:null,rect:{},offset:{}},I=[],D=new U,nt=new V,j=c({},r),z=c({},r),M={x:0,y:0},rt=function(t){var e={},n=t.group;n&&"object"==A(n)||(n={name:n,pull:!0,put:!0}),e.name=n.name,e.pull=n.pull,e.put=n.put,t.group=e},(a.prototype={constructor:a,destroy:function(){this._dispatchEvent("destroy",this),this.el[w]=null;for(var t=0;t<g.start.length;t++)n(this.el,g.start[t],this._onDrag);this._clearState(),I.splice(I.indexOf(this.el),1),this.el=null},option:function(t,e){var n=this.options;if(void 0===e)return n[t];n[t]=e,"group"===t&&rt(n)},_onDrag:function(t){if(!this.options.disabled&&this.options.group.pull&&(!/mousedown|pointerdown/.test(t.type)||0===t.button)){var e=(r=R(t)).touch,n=r.event,r=r.target;if(!(y&&r&&"SELECT"===r.tagName.toUpperCase()||r===this.el)){var o=this.options,i=o.draggable;if(("function"!=typeof(o=o.handle)||o(t))&&("string"!=typeof o||H(r,o))){if("function"==typeof i){if(!(o=i(t)))return;!function(t){if(t){var e=document.createElement("div");try{return e.appendChild(t.cloneNode(!0)),1==t.nodeType}catch(e){return t==window||t==document}}}(o)||(E=o)}else E=P(r,i,this.el,!1);E&&!E.animated&&(k=E.cloneNode(!0),this._prepareStart(e,n))}}}},_prepareStart:function(t,e){var n=this,r=E.parentNode,o=((N=e).sortable=this,N.group=E.parentNode,(C=this.options.multiple&&this.multiplayer.allowDrag(E))&&this.multiplayer.onDrag(this.el,this),m(E)),i=h(E,this.el);j={sortable:this,group:r,node:E,rect:o,offset:i},z.group=r,z.sortable=this,D.distance={x:e.clientX-o.left,y:e.clientY-o.top},u(document,"touchend",this._onDrop),u(document,"touchcancel",this._onDrop),u(document,"mouseup",this._onDrop);r=(i=this.options).delay,e=i.delayOnTouchOnly;if(!r||e&&!t||$||v)this._onStart(t);else{for(var a=0;a<g.end.length;a++)u(this.ownerDocument,g.end[a],this._cancelStart);for(var s=0;s<g.move.length;s++)u(this.ownerDocument,g.move[s],this._delayMoveHandler);et=setTimeout(function(){return n._onStart(t)},r)}},_delayMoveHandler:function(t){t=t.touches?t.touches[0]:t,Math.max(Math.abs(t.clientX-N.clientX),Math.abs(t.clientY-N.clientY))>=Math.floor(this.options.touchStartThreshold/(window.devicePixelRatio||1))&&this._cancelStart()},_cancelStart:function(){clearTimeout(et);for(var t=0;t<g.end.length;t++)n(this.ownerDocument,g.end[t],this._cancelStart);for(var e=0;e<g.move.length;e++)n(this.ownerDocument,g.move[e],this._delayMoveHandler)},_onStart:function(t){_=this.el,u(document,t?"touchmove":"mousemove",this._nearestSortable);try{document.selection?setTimeout(function(){document.selection.empty()},0):window.getSelection().removeAllRanges()}catch(t){}},_onTrulyStarted:function(){var t;L||(this._dispatchEvent("onDrag",c(c({},i()),{},{event:N})),C&&this.multiplayer.onTrulyStarted(E,this),t=C?this.multiplayer.getHelper():E,D.init(j.rect,t,this.el,this.options),a.helper=D.node,f(E,!1),E.parentNode.insertBefore(k,E),Y(k,this.options.chosenClass,!0),y&&p(document.body,"user-select","none"))},_nearestSortable:function(t){var e,n,r,o,i,a,s;this._preventEvent(t),N&&E&&(e=(n=t).clientX,n=n.clientY,r=e-M.x,o=n-M.y,M.x=e,M.y=n,void 0!==e&&void 0!==n&&Math.abs(r)<=0&&Math.abs(o)<=0||(n=(e=R(t)).event,r=e.target,i=n.clientX,a=n.clientY,I.some(function(t){var e,n,r=t[w].options.emptyInsertThreshold;if(r)return n=m(t,{parent:!0}),e=i>=n.left-r&&i<=n.right+r,n=a>=n.top-r&&a<=n.bottom+r,e&&n?s=t:void 0}),o=s,this._onTrulyStarted(),L=n,D.move(n.clientX-N.clientX,n.clientY-N.clientY),this._autoScroll(r),o&&(_=o)[w]._onMove(n,r)))},_allowPut:function(){var t,e;return N.sortable.el===this.el||!!this.options.group.put&&(t=this.options.group.name,(e=N.sortable.options.group).name)&&t&&e.name===t},_onMove:function(t,e){if(this._dispatchEvent("onMove",c(c({},i()),{},{event:t})),this._allowPut()){if(T=P(e,this.options.draggable,_,!1)){if(T===tt)return;if((tt=T)===k)return;if(T.animated||K(T,k))return}_!==j.sortable.el?e!==_&&function(t,e){for(var n=t.lastElementChild;n&&(n===e||"none"===p(n,"display"));)n=n.previousElementSibling;return n}(_,D.node)?T&&this._onInsert(t,!1):this._onInsert(t,!0):T&&this._onChange(t)}},_autoScroll:function(n){var n=function(){if(n&&n.getBoundingClientRect){var t=n;do{if(t.clientWidth<t.scrollWidth||t.clientHeight<t.scrollHeight){var e=p(t);if(t.clientWidth<t.scrollWidth&&("auto"==e.overflowX||"scroll"==e.overflowX)||t.clientHeight<t.scrollHeight&&("auto"==e.overflowY||"scroll"==e.overflowY))return t.getBoundingClientRect&&t!==document.body?t:d()}}while(t=t.parentNode)}return d()}(),t=(e=this.options).autoScroll,e=e.scrollThreshold;t&&nt.update(n,e,N,L)},_onInsert:function(t,e){var n=e?k:T,r=e?_:T.parentNode;j.sortable.animator.collect(k,null,k.parentNode,k),this.animator.collect(null,n,r,k),C&&this.multiplayer.onChange(k,this),z={sortable:this,group:r,node:n,rect:m(n),offset:h(n,_)},j.sortable._dispatchEvent("onRemove",c(c({},i()),{},{event:t})),e?r.appendChild(k):r.insertBefore(k,T),this._dispatchEvent("onAdd",c(c({},i()),{},{event:t})),j.sortable.animator.animate(),this.animator.animate(),j.group=r,j.sortable=this},_onChange:function(t){var e=T.parentNode;this.animator.collect(k,T,e),C&&this.multiplayer.onChange(k,this),z={sortable:this,group:e,node:T,rect:m(T),offset:h(T,_)},this._dispatchEvent("onChange",c(c({},i()),{},{event:t}));t=(t=h(k,_)).top===z.offset.top?t.left<z.offset.left?T.nextSibling:T:t.top<z.offset.top?T.nextSibling:T;e.insertBefore(k,t),this.animator.animate(),j.group=e,j.sortable=this},_onDrop:function(t){this._unbindMoveEvents(),this._unbindDropEvents(),this._preventEvent(t),this._cancelStart(),nt.clear(),E&&N&&L?this._onEnd(t):this.options.multiple&&this.multiplayer.select(t,E,_,c({},j)),this._clearState()},_onEnd:function(t){var e;this.options.swapOnDrop&&k.parentNode.insertBefore(E,k),j.group=N.group,j.sortable=N.sortable,C?this.multiplayer.onDrop(t,E,_,N,i):(z.rect=m(k),z.offset=h(k,_),z.node===k&&(z.node=E),e=s(j,z)||X(j.offset,z.offset),e=c(c({},i()),{},{changed:e,event:t}),s(j,z)&&j.sortable._dispatchEvent("onDrop",e),z.sortable._dispatchEvent("onDrop",e)),f(E,!0),k.parentNode.removeChild(k),y&&p(document.body,"user-select","")},_preventEvent:function(t){void 0!==t.preventDefault&&t.cancelable&&t.preventDefault(),this.options.stopPropagation&&(t&&t.stopPropagation?t.stopPropagation():window.event.cancelBubble=!0)},_dispatchEvent:function(t,e){"function"==typeof(t=this.options[t])&&t(e)},_clearState:function(){E=T=k=N=L=C=tt=et=a.helper=null,M={x:0,y:0},j=z=c({},r),D.destroy()},_unbindMoveEvents:function(){for(var t=0;t<g.move.length;t++)n(document,g.move[t],this._nearestSortable)},_unbindDropEvents:function(){for(var t=0;t<g.end.length;t++)n(document,g.end[t],this._onDrop)}}).utils={getRect:m,getOffset:h},a.get=function(t){return t[w]},a.create=function(t,e){return new a(t,e)},a)})(t={exports:{}});var t,d=t.exports,p="virtualSortableState",m={from:{},to:{}},xt=new(function(){function t(){o(this,t)}return e(t,[{key:"clear",value:function(){localStorage.removeItem(p)}},{key:"getStore",value:function(){try{return JSON.parse(localStorage.getItem(p))||m}catch(t){return m}}},{key:"getValue",value:function(){return new Promise(function(t,e){try{t(JSON.parse(localStorage.getItem(p))||m)}catch(t){e(m)}})}},{key:"setValue",value:function(o){return new Promise(function(t,e){try{var n=JSON.parse(localStorage.getItem(p)),r=JSON.stringify(Object.assign(Object.assign({},n),o));localStorage.setItem(p,r),t(r)}catch(t){e("{}")}})}}]),t}()),g=["group","handle","disabled","draggable","ghostClass","ghostStyle","chosenClass","animation","autoScroll","scrollThreshold","fallbackOnBody","pressDelay","pressDelayOnTouchOnly"],v="v-drag",y="v-drop",b="v-add",w="v-remove",S=null,Ot=function(){function r(t,e,n){o(this,r),this.context=t,this.handleStart=e,this.handleEnd=n,this.initialList=yt(t.list),this.dynamicList=yt(t.list),this.sortable=null,this.rangeChanged=!1,this._init()}return e(r,[{key:"destroy",value:function(){this.sortable&&this.sortable.destroy(),this.sortable=null}},{key:"setValue",value:function(t,e){"list"===t?(this.initialList=yt(e),S&&this._onDrag(S,!1)):(this.context[t]=e,this.sortable&&this.sortable.option(t,e))}},{key:"_init",value:function(){var r=this,t=g.reduce(function(t,e){return t["pressDelayOnTouchOnly"===e?"delayOnTouchOnly":"pressDelay"===e?"delay":e]=r.context[e],t},{});this.sortable=new d(this.context.container,Object.assign(Object.assign({},t),{swapOnDrop:!1,list:this.dynamicList,onDrag:function(t){t=t.from;return r._onDrag(t.node)},onAdd:function(t){var e=t.from,t=t.to;return r._onAdd(e,t)},onRemove:function(t){var e=t.from,t=t.to;return r._onRemove(e,t)},onChange:function(t){var e=t.from,t=t.to;return r._onChange(e,t)},onDrop:function(t){var e=t.from,n=t.to,t=t.changed;return r._onDrop(e,n,t)}}))}},{key:"_onDrag",value:function(o){var i=!(1<arguments.length&&void 0!==arguments[1])||arguments[1];return f(this,void 0,void 0,O().mark(function t(){var e,n,r;return O().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return S=o,this.dynamicList=yt(this.initialList),e=yt(this.initialList),n=this._getFromTo({node:o},e),t.next=6,xt.setValue({from:Object.assign({list:e},n)});case 6:if(i)return this.rangeChanged=!1,t.next=10,xt.getValue();t.next=16;break;case 10:n=t.sent,(r=this.context[v])&&r(Object.assign({list:e},n)),this.handleStart&&this.handleStart(n),t.next=17;break;case 16:this.rangeChanged=!0;case 17:case"end":return t.stop()}},t,this)}))}},{key:"_onAdd",value:function(o,i){var a;return f(this,void 0,void 0,O().mark(function t(){var e,n,r;return O().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return this.dynamicList.length||(this.dynamicList=yt(this.initialList)),t.next=3,xt.getValue();case 3:e=t.sent,r=yt(this.dynamicList),r=this._getIndex(r,i.node.dataset.key),n=Object.assign(Object.assign({},e.from),{index:r}),o.node===i.node?(n.index=this.dynamicList.length,this.dynamicList.push(null==(a=e.from)?void 0:a.item)):this.dynamicList.splice(r,0,null==(a=e.from)?void 0:a.item),delete n.list,(r=this.context[b])&&r(Object.assign({},n));case 11:case"end":return t.stop()}},t,this)}))}},{key:"_onRemove",value:function(r){return f(this,void 0,void 0,O().mark(function t(){var e,n;return O().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:e=yt(this.dynamicList),e=this._getFromTo(r,e),this.dynamicList.splice(e.index,1),(n=this.context[w])&&n(Object.assign({},e));case 5:case"end":return t.stop()}},t,this)}))}},{key:"_onChange",value:function(r,o){return f(this,void 0,void 0,O().mark(function t(){var e,n;return O().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:e=yt(this.dynamicList),n=yt(this.dynamicList),e=this._getFromTo(r,e),n=this._getFromTo(o,n),this.dynamicList.splice(e.index,1),this.dynamicList.splice(n.index,0,e.item);case 6:case"end":return t.stop()}},t,this)}))}},{key:"_onDrop",value:function(i,t,a){return f(this,void 0,void 0,O().mark(function t(){var e,n,r,o;return O().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e=yt(this.dynamicList),n=this._getIndex(e,i.node.dataset.key),r=this.initialList[n],o=wt(r,this.context.dataKey),t.next=6,xt.setValue({to:{list:yt(this.initialList),index:n,item:r,key:o}});case 6:return t.next=8,xt.getValue();case 8:n=t.sent,r=Object.assign(Object.assign({list:e},n),{changed:a}),(o=this.context[y])&&o(Object.assign({},r)),this.handleEnd&&this.handleEnd(n,r),this.initialList=yt(e),this._clear();case 15:case"end":return t.stop()}},t,this)}))}},{key:"_getFromTo",value:function(t,e){var t=t.node.dataset.key,n=this._getIndex(e,t);return{key:t,item:e[n],index:n}}},{key:"_getIndex",value:function(t,e){var n=this;return t.findIndex(function(t){return wt(t,n.context.dataKey)==e})}},{key:"_clear",value:function(){S=null,xt.clear(),this.rangeChanged=!1}}]),r}();function x(t){var e=t.dataKey,n=t.children,r=t.onSizeChange,o=gt.useRef(null),t="function"==typeof n?n(o):n;return gt.useLayoutEffect(function(){var t;return void 0!==("undefined"==typeof ResizeObserver?"undefined":i(ResizeObserver))&&(t=new ResizeObserver(function(){var t=o.current.clientHeight;r&&r(e,t)}),o.current&&t.observe(o.current)),function(){t&&(t.disconnect(),t=null)}},[o]),gt.cloneElement(t,{ref:o})}function _t(t){var e=t.children,n=t.dataKey,r=t.className,o=t.style,i=t.Tag,a=t.record,s=t.index,t=t.onSizeChange;return gt.createElement(x,{dataKey:n,onSizeChange:t},gt.createElement(void 0===i?"div":i,{className:r,style:o,"data-key":n},"function"==typeof e?e(a,s,n):e))}function Et(t){var e=t.Tag,n=t.style,r=t.className,o=t.children,i=t.roleId,t=t.onSizeChange;return o?gt.createElement(x,{dataKey:i,onSizeChange:t},gt.createElement(void 0===e?"div":e,{"v-role":i,style:n,className:r},o)):gt.createElement(gt.Fragment,null)}var Tt="v-top",kt="v-bottom";function _(r,t){function F(){e(),O(function(){return yt(c)}),T.current=yt(c)}function B(t){return D.current.sizes.get(t)}function n(t){N.current[z]=t}function o(t){var e;t>=c.length-1?i():(e=D.current.getOffsetByIndex(t),n(e),setTimeout(function(){j()!==D.current.getOffsetByIndex(t)&&o(t)},5))}function e(){N.current[z]=0}function i(){var t;L.current&&(t=L.current[ct],N.current[z]=t,setTimeout(function(){var t=N.current;j()+Math.ceil(t[lt])+1<Math.ceil(t[st])&&i()},5))}function A(t,e){D.current&&D.current.handleItemSizeChange(t,e)}function a(t,e){D.current&&D.current.handleSlotSizeChange(t,e)}var s=r.dataSource,c=void 0===s?[]:s,s=r.dataKey,l=void 0===s?"":s,s=r.direction,u=void 0===s?"vertical":s,s=r.keeps,h=void 0===s?30:s,s=r.size,R=void 0===s?void 0:s,s=r.delay,s=void 0===s?0:s,f=r.keepOffset,P=void 0!==f&&f,f=r.autoScroll,K=void 0===f||f,f=r.scrollThreshold,Y=void 0===f?55:f,f=r.animation,H=void 0===f?150:f,f=r.pressDelay,X=void 0===f?0:f,f=r.pressDelayOnTouchOnly,q=void 0!==f&&f,f=r.fallbackOnBody,V=void 0!==f&&f,f=r.style,d=void 0===f?{}:f,f=r.className,f=void 0===f?"":f,p=r.wrapTag,m=void 0===p?"div":p,p=r.rootTag,g=void 0===p?"div":p,p=r.itemTag,W=void 0===p?"div":p,p=r.headerTag,p=void 0===p?"div":p,v=r.footerTag,v=void 0===v?"div":v,y=r.itemStyle,U=void 0===y?{}:y,y=r.itemClass,G=void 0===y?"":y,y=r.wrapStyle,b=void 0===y?{}:y,y=r.wrapClass,y=void 0===y?"":y,w=r.ghostClass,J=void 0===w?"":w,w=r.ghostStyle,Z=void 0===w?{}:w,w=r.chosenClass,$=void 0===w?"":w,w=r.disabled,S=void 0!==w&&w,w=vt(gt.useState([]),2),x=w[0],O=w[1],w=vt(gt.useState({end:h-1}),2),_=w[0],Q=w[1],w=vt(gt.useState({from:{},to:{}}),2),E=w[0],tt=w[1],T=gt.useRef([]),k=gt.useRef([]),N=gt.useRef(null),et=gt.useRef(null),L=gt.useRef(null),C=gt.useRef(null),I=gt.useRef(null),D=gt.useRef(null),j=function(){var t=N.current;return t?Math.ceil(t[z]):0},nt=(gt.useImperativeHandle(t,function(){return{reset:F,getSize:B,getOffset:j,scrollToTop:e,scrollToIndex:o,scrollToOffset:n,scrollToBottom:i}}),gt.useEffect(function(){return nt(),rt(),function(){ot()}},[]),gt.useEffect(function(){var t;T.current=yt(c),it(),D.current&&(D.current.updateUniqueKeys(k.current),D.current.updateSizes(k.current),setTimeout(function(){return D.current.updateRange()},0)),I.current&&I.current.setValue("list",c),O(function(){return yt(c)}),C.current&&P&&(t=at(C.current),o(t),C.current=null)},[c]),gt.useEffect(function(){I.current&&I.current.setValue("disabled",S)},[S]),function(){D.current=new St({size:R,keeps:h,uniqueKeys:k.current},function(t){var e,n,r;I.current&&(Q(function(){return t}),r=xt.getStore(),e=t.start,n=t.end,-1<(r=r.from.index)&&!(e<=r&&r<=n)&&(I.current.rangeChanged=!0))})}),rt=function(){I.current=new Ot(Object.assign({container:et.current,list:T.current,disabled:S,ghostClass:J,ghostStyle:Z,chosenClass:$,animation:H,autoScroll:K,scrollThreshold:Y,pressDelay:X,pressDelayOnTouchOnly:q,fallbackOnBody:V},r),function(t){tt(function(){return Object.assign({},t)})},function(t,e){var n,r=e.list,e=e.changed;tt(function(){return Object.assign({},t)}),e&&(I.current.rangeChanged&&D.current.direction&&(n=T.current,Q(function(t){var e;return e=0<t.start&&-1<(e=r.indexOf(n[t.start]))?Object.assign(Object.assign({},t),{start:e,end:e+h-1}):Object.assign({},t),r.length>x.length&&t.end===x.length-1&&e.end++,e})),T.current=yt(r),O(function(){return yt(r)}),it())})},ot=function(){I.current&&I.current.destroy(),I.current=null},it=function(){k.current=T.current.map(function(t){return wt(t,l)})},at=function(e){return T.current.findIndex(function(t){return wt(t,l)===wt(e,l)})},w=gt.useMemo(function(){var t="vertical"!==u;return{offsetSizeKey:t?"offsetLeft":"offsetTop",scrollSizeKey:t?"scrollWidth":"scrollHeight",clientSizeKey:t?"clientWidth":"clientHeight",scrollDirectionKey:t?"scrollLeft":"scrollTop"}},[u]),st=w.scrollSizeKey,z=w.scrollDirectionKey,ct=w.offsetSizeKey,lt=w.clientSizeKey,ut=bt(function(){C.current=T.current[0];var t=r[Tt];t&&t()}),ht=bt(function(){var t=r[kt];t&&t()}),ft=gt.useCallback(function(t){if(!I.current||!E)return{};var e=E.from.key;return I.current.rangeChanged&&t==e?{display:"none"}:{}},[E]),t=gt.useMemo(function(){return{RTag:g,WTag:m}},[m,g]),w=t.RTag,t=t.WTag,dt=gt.useMemo(function(){return Object.assign(Object.assign({},d),{overflow:"vertical"!==u?"auto hidden":"hidden auto"})},[d,u]),pt=gt.useMemo(function(){var t=_.front,e=_.behind;return Object.assign(Object.assign({},b),{padding:"vertical"!==u?"0px ".concat(e,"px 0px ").concat(t,"px"):"".concat(t,"px 0px ").concat(e,"px")})},[b,u,_]),M=gt.useMemo(function(){return Object.assign({},_)},[_]),mt=M.start,M=M.end;return gt.createElement(w,{ref:N,style:dt,className:f,onScroll:bt(function(){var t=N.current,e=j(),n=Math.ceil(t[lt]),t=Math.ceil(t[st]);e<0||t+1<e+n||!t||(D.current.handleScroll(e),D.current.isFront()?c.length&&e<=0&&ut():D.current.isBehind()&&t<=n+e&&ht())},s)},gt.createElement(Et,{roleId:"header",Tag:p,children:r.header,onSizeChange:a}),gt.createElement(t,{ref:et,"v-role":"group",style:pt,className:y},x.slice(mt,M+1).map(function(t){var e=wt(t,l),n=at(t);return gt.createElement(_t,{key:e,record:t,index:n,dataKey:e,Tag:W,children:r.children,className:G,style:Object.assign(Object.assign({},U),ft(e)),onSizeChange:A})})),gt.createElement(Et,{roleId:"footer",Tag:v,children:r.footer,onSizeChange:a}),gt.createElement("div",{ref:L,style:{width:"vertical"!==u?"0px":"100%",height:"vertical"!==u?"100%":"0px"}}))}return gt.forwardRef(_)});
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("react")):"function"==typeof define&&define.amd?define(["react"],e):(t=t||self).VirtualDragList=e(t.React)}(this,function(Tt){"use strict";function O(){O=function(){return a};var a={},t=Object.prototype,c=t.hasOwnProperty,e="function"==typeof Symbol?Symbol:{},o=e.iterator||"@@iterator",n=e.asyncIterator||"@@asyncIterator",r=e.toStringTag||"@@toStringTag";function i(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{i({},"")}catch(t){i=function(t,e,n){return t[e]=n}}function s(t,e,n,o){var r,i,a,s,e=e&&e.prototype instanceof h?e:h,e=Object.create(e.prototype),o=new w(o||[]);return e._invoke=(r=t,i=n,a=o,s="suspendedStart",function(t,e){if("executing"===s)throw new Error("Generator is already running");if("completed"===s){if("throw"===t)throw e;return x()}for(a.method=t,a.arg=e;;){var n=a.delegate;if(n){n=function t(e,n){var o=e.iterator[n.method];if(void 0===o){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=void 0,t(e,n),"throw"===n.method))return u;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return u}o=l(o,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,u;o=o.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=void 0),n.delegate=null,u):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,u)}(n,a);if(n){if(n===u)continue;return n}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if("suspendedStart"===s)throw s="completed",a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);s="executing";n=l(r,i,a);if("normal"===n.type){if(s=a.done?"completed":"suspendedYield",n.arg===u)continue;return{value:n.arg,done:a.done}}"throw"===n.type&&(s="completed",a.method="throw",a.arg=n.arg)}}),e}function l(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}a.wrap=s;var u={};function h(){}function f(){}function d(){}var e={},p=(i(e,o,function(){return this}),Object.getPrototypeOf),p=p&&p(p(S([]))),m=(p&&p!==t&&c.call(p,o)&&(e=p),d.prototype=h.prototype=Object.create(e));function g(t){["next","throw","return"].forEach(function(e){i(t,e,function(t){return this._invoke(e,t)})})}function y(a,s){var e;this._invoke=function(n,o){function t(){return new s(function(t,e){!function e(t,n,o,r){var i,t=l(a[t],a,n);if("throw"!==t.type)return(n=(i=t.arg).value)&&"object"==typeof n&&c.call(n,"__await")?s.resolve(n.__await).then(function(t){e("next",t,o,r)},function(t){e("throw",t,o,r)}):s.resolve(n).then(function(t){i.value=t,o(i)},function(t){return e("throw",t,o,r)});r(t.arg)}(n,o,t,e)})}return e=e?e.then(t,t):t()}}function v(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function b(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function w(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(v,this),this.reset(!0)}function S(e){if(e){var n,t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return n=-1,(t=function t(){for(;++n<e.length;)if(c.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t}).next=t}return{next:x}}function x(){return{value:void 0,done:!0}}return i(m,"constructor",f.prototype=d),i(d,"constructor",f),f.displayName=i(d,r,"GeneratorFunction"),a.isGeneratorFunction=function(t){t="function"==typeof t&&t.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},a.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,i(t,r,"GeneratorFunction")),t.prototype=Object.create(m),t},a.awrap=function(t){return{__await:t}},g(y.prototype),i(y.prototype,n,function(){return this}),a.AsyncIterator=y,a.async=function(t,e,n,o,r){void 0===r&&(r=Promise);var i=new y(s(t,e,n,o),r);return a.isGeneratorFunction(e)?i:i.next().then(function(t){return t.done?t.value:i.next()})},g(m),i(m,r,"Generator"),i(m,o,function(){return this}),i(m,"toString",function(){return"[object Generator]"}),a.keys=function(n){var t,o=[];for(t in n)o.push(t);return o.reverse(),function t(){for(;o.length;){var e=o.pop();if(e in n)return t.value=e,t.done=!1,t}return t.done=!0,t}},a.values=S,w.prototype={constructor:w,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(b),!t)for(var e in this)"t"===e.charAt(0)&&c.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(n){if(this.done)throw n;var o=this;function t(t,e){return i.type="throw",i.arg=n,o.next=t,e&&(o.method="next",o.arg=void 0),!!e}for(var e=this.tryEntries.length-1;0<=e;--e){var r=this.tryEntries[e],i=r.completion;if("root"===r.tryLoc)return t("end");if(r.tryLoc<=this.prev){var a=c.call(r,"catchLoc"),s=c.call(r,"finallyLoc");if(a&&s){if(this.prev<r.catchLoc)return t(r.catchLoc,!0);if(this.prev<r.finallyLoc)return t(r.finallyLoc)}else if(a){if(this.prev<r.catchLoc)return t(r.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<r.finallyLoc)return t(r.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;0<=n;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&c.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var r=o;break}}var i=(r=r&&("break"===t||"continue"===t)&&r.tryLoc<=e&&e<=r.finallyLoc?null:r)?r.completion:{};return i.type=t,i.arg=e,r?(this.method="next",this.next=r.finallyLoc,u):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),u},finish:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),b(n),u}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n,o,r=this.tryEntries[e];if(r.tryLoc===t)return"throw"===(n=r.completion).type&&(o=n.arg,b(r)),o}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:S(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),u}},a}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})(t)}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function e(t,e,n){e&&o(t.prototype,e),n&&o(t,n),Object.defineProperty(t,"prototype",{writable:!1})}function kt(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var o,r,i=[],a=!0,s=!1;try{for(n=n.call(t);!(a=(o=n.next()).done)&&(i.push(o.value),!e||i.length!==e);a=!0);}catch(t){s=!0,r=t}finally{try{a||null==n.return||n.return()}finally{if(s)throw r}}return i}}(t,e)||n(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Nt(t){return function(t){if(Array.isArray(t))return i(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||n(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(t,e){if(t){if("string"==typeof t)return i(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(n="Object"===n&&t.constructor?t.constructor.name:n)||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(t,e):void 0}}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n<e;n++)o[n]=t[n];return o}function Lt(i,t,e){function n(){for(var t,e=this,n=arguments.length,o=new Array(n),r=0;r<n;r++)o[r]=arguments[r];return a&&clearTimeout(a),l?(t=!a,a=setTimeout(function(){a=null},c),t&&(s=i.apply(this,o))):a=setTimeout(function(){i.apply(e,o)},c),s}var a,s,c=1<arguments.length&&void 0!==t?t:50,l=2<arguments.length&&void 0!==e&&e;return n.prototype.cancel=function(){clearTimeout(a),a=null},n}function zt(t,e){return(Array.isArray(e)?e:e.replace(/\[/g,".").replace(/\]/g,".").split(".")).reduce(function(t,e){return(t||{})[e]},t)}Tt=Tt&&Object.prototype.hasOwnProperty.call(Tt,"default")?Tt.default:Tt;var s="INIT",c="FIXED",l="DYNAMIC",u="FRONT",h="BEHIND",Ct=function(){function n(t,e){r(this,n),this.options=Object.assign({},t),this.callback=e,this.sizes=new Map,this.calcType=s,this.calcSize=Object.create(null),this.direction="",this.offset=0,this.range=Object.create(null),t&&this.checkIfUpdate(0,t.keeps-1)}return e(n,[{key:"isFront",value:function(){return this.direction===u}},{key:"isBehind",value:function(){return this.direction===h}},{key:"isFixed",value:function(){return this.calcType===c}},{key:"updateOptions",value:function(t,n){var o=this;this.options&&t in this.options&&("uniqueKeys"===t&&this.sizes.forEach(function(t,e){n.includes(e)||o.sizes.delete(e)}),this.options[t]=n)}},{key:"updateRange",value:function(){var t=this.range.start;this.isFront()?t-=2:this.isBehind()&&(t+=2),t=Math.max(t,0),this.handleUpdate(t,this.getEndByStart(t))}},{key:"handleItemSizeChange",value:function(t,e){this.sizes.set(t,e),this.calcType===s?(this.calcType=c,this.calcSize.fixed=e):this.isFixed()&&this.calcSize.fixed!==e&&(this.calcType=l,this.calcSize.fixed=0),this.calcType!==c&&(this.calcSize.total=Nt(this.sizes.values()).reduce(function(t,e){return t+e},0),this.calcSize.average=Math.round(this.calcSize.total/this.sizes.size))}},{key:"handleSlotSizeChange",value:function(t,e){this.calcSize[t]=e}},{key:"handleScroll",value:function(t){this.direction=t<this.offset?u:h,this.offset=t,this.isFront()?this.handleScrollFront():this.isBehind()&&this.handleScrollBehind()}},{key:"handleScrollFront",value:function(){var t=this.getScrollItems();t>this.range.start||(t=Math.max(t-this.options.buffer,0),this.checkIfUpdate(t,this.getEndByStart(t)))}},{key:"handleScrollBehind",value:function(){var t=this.getScrollItems();t<this.range.start+this.options.buffer||this.checkIfUpdate(t,this.getEndByStart(t))}},{key:"getScrollItems",value:function(){var t=this.offset-(this.calcSize.header||0);if(t<=0)return 0;if(this.isFixed())return Math.floor(t/this.calcSize.fixed);for(var e,n,o=0,r=this.options.uniqueKeys.length;o<=r;){if(e=o+Math.floor((r-o)/2),(n=this.getOffsetByIndex(e))===t)return e;n<t?o=e+1:t<n&&(r=e-1)}return 0<o?--o:0}},{key:"checkIfUpdate",value:function(t,e){var n=this.options.keeps;this.options.uniqueKeys.length<=n?(t=0,e=this.getLastIndex()):e-t<n-1&&(t=e-n+1),this.range.start!==t&&this.handleUpdate(t,e)}},{key:"handleUpdate",value:function(t,e){this.range.start=t,this.range.end=e,this.range.front=this.getFrontOffset(),this.range.behind=this.getBehindOffset(),this.callback(Object.assign({},this.range))}},{key:"getFrontOffset",value:function(){return this.isFixed()?this.calcSize.fixed*this.range.start:this.getOffsetByIndex(this.range.start)}},{key:"getBehindOffset",value:function(){var t=this.range.end,e=this.getLastIndex();return this.isFixed()?(e-t)*this.calcSize.fixed:(e-t)*this.getItemSize()}},{key:"getOffsetByIndex",value:function(t){if(!t)return 0;for(var e=this.calcSize.header||0,n=0;n<t;n++){var o=this.sizes.get(this.options.uniqueKeys[n]);e+="number"==typeof o?o:this.getItemSize()}return e}},{key:"getEndByStart",value:function(t){return Math.min(t+this.options.keeps-1,this.getLastIndex())}},{key:"getLastIndex",value:function(){var t=this.options,e=t.uniqueKeys,t=t.keeps;return 0<e.length?e.length-1:t-1}},{key:"getItemSize",value:function(){return this.isFixed()?this.calcSize.fixed:this.calcSize.average||this.options.size}}]),n}();function f(t,a,s,c){return new(s=s||Promise)(function(n,e){function o(t){try{i(c.next(t))}catch(t){e(t)}}function r(t){try{i(c.throw(t))}catch(t){e(t)}}function i(t){var e;t.done?n(t.value):((e=t.value)instanceof s?e:new s(function(t){t(e)})).then(o,r)}i((c=c.apply(t,a||[])).next())})}(function(F){function B(e,t){var n,o=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),o.push.apply(o,n)),o}function c(r){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?B(Object(i),!0).forEach(function(t){var e,n=r,o=i[t];(t="symbol"==typeof(e=function(t){if("object"!=typeof t||null===t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return String(t);if("object"!=typeof(e=e.call(t,"string")))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t))?e:String(e))in n?Object.defineProperty(n,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[t]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(i)):B(Object(i)).forEach(function(t){Object.defineProperty(r,t,Object.getOwnPropertyDescriptor(i,t))})}return r}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})(t)}function t(t){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(t)}function r(t,e){t.style["".concat(b,"TransitionDuration")]=null==e?"":"".concat(e,"ms")}function l(t,e){t.style["".concat(b,"Transform")]=e?"".concat(e):""}function u(t,e,n){window.addEventListener?t.addEventListener(e,n,!(!Q&&y)&&G):window.attachEvent&&t.attachEvent("on"+e,n)}function n(t,e,n){window.removeEventListener?t.removeEventListener(e,n,!(!Q&&y)&&G):window.detachEvent&&t.detachEvent("on"+e,n)}function R(t){var e=t,n=t.touches&&t.touches[0]||t.changedTouches&&t.changedTouches[0],t=n?document.elementFromPoint(n.clientX,n.clientY):t.target;return!n||"clientX"in e||(e.clientX=n.clientX,e.clientY=n.clientY,e.pageX=n.pageX,e.pageY=n.pageY,e.screenX=n.screenX,e.screenY=n.screenY),{touch:n,event:e,target:t}}function h(t,e){for(var n={top:0,left:0,height:t.offsetHeight,width:t.offsetWidth};n.top+=t.offsetTop,n.left+=t.offsetLeft,(t=t.parentNode)&&t!==e;);return n}function d(){return document.scrollingElement||document.documentElement}function m(t){var e,n,o,r,i,a,s,c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},l=2<arguments.length?arguments[2]:void 0;if(t.getBoundingClientRect||t===window){if(t!==window&&t.parentNode&&t!==d()){if(n=(e=t.getBoundingClientRect()).top,o=e.left,r=e.bottom,i=e.right,a=e.height,s=e.width,c.parent&&t.parentNode!==t.ownerDocument.body)for(var u,h=t.parentNode;h&&h.getBoundingClientRect&&h!==t.ownerDocument.body;){if((u=h.getBoundingClientRect()).height<a)return n=u.top,o=u.left,r=u.bottom,i=u.right,a=u.height,{top:n,left:o,bottom:r,right:i,width:s=u.width,height:a};h=h.parentNode}}else o=n=0,r=window.innerHeight,i=window.innerWidth,a=window.innerHeight,s=window.innerWidth;if((c.block||c.relative)&&t!==window&&(l=l||t.parentNode,!y))do{if(l&&l.getBoundingClientRect&&("none"!==p(l,"transform")||c.relative&&"static"!==p(l,"position"))){var f=l.getBoundingClientRect();n-=f.top+parseInt(p(l,"border-top-width")),o-=f.left+parseInt(p(l,"border-left-width")),r=n+e.height,i=o+e.width;break}}while(l=l.parentNode);return{top:n,left:o,bottom:r,right:i,width:s,height:a}}}function a(t,e,n,o){if(t){n=n||document;do{if(null==e){var r=Array.prototype.slice.call(n.children),i=r.indexOf(t);if(-1<i)return r[i];for(var a=0;a<r.length;a++)if(P(t,r[a]))return r[a]}else if((">"!==e[0]||t.parentNode===n)&&H(t,e)||o&&t===n)return t}while(t=t.parentNode)}return null}function P(t,e){if(t&&e){if(e.compareDocumentPosition)return e===t||16&e.compareDocumentPosition(t);if(e.contains&&1===t.nodeType)return e.contains(t)&&e!==t;for(;t=t.parentNode;)if(t===e)return 1}}function K(t,e,n){var o;t&&e&&(t.classList?t.classList[n?"add":"remove"](e):(o=(" "+t.className+" ").replace(J," ").replace(" "+e+" "," "),t.className=(o+(n?" "+e:"")).replace(J," ")))}function H(t,e){if(e&&(">"===e[0]&&(e=e.substring(1)),t))try{return t.matches?t.matches(e):t.msMatchesSelector?t.msMatchesSelector(e):t.webkitMatchesSelector&&t.webkitMatchesSelector(e)}catch(t){return}}function Y(t,e){return t.top!==e.top||t.left!==e.left}function p(t,e,n){var o=t&&t.style;if(o){if(void 0===n)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(n=t.currentStyle),void 0===e?n:n[e];o[e=e in o||-1!==e.indexOf("webkit")?e:"-webkit-"+e]=n+("string"==typeof n?"":"px")}}function X(t,e){return t.sortable.el!==e.sortable.el}function f(t,e){p(t,"display",e?"":"none")}function V(t){this.options=t||{},this.groupName=t.group.name||"group_"+Number(Math.random().toString().slice(-3)+Date.now()).toString(32)}function W(){this.autoScrollAnimationFrame=null,this.speed={x:10,y:10}}function q(t){this.options=t,this.animations=[]}function U(){this.helper=null,this.distance={x:0,y:0}}function i(){var t,e={from:c({},j),to:c({},I)};return z&&(t={from:c({},S),to:c({},x)},e.from=c(c({},t.from),e.from),e.to=c(c({},t.to),e.to)),e}function s(t,e){if(!t||!t.nodeType||1!==t.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));(t[w]=this).el=t,this.ownerDocument=t.ownerDocument,this.options=e=Object.assign({},e);var n,o,r={disabled:!1,group:"",animation:150,multiple:!1,draggable:null,handle:null,onDrag:null,onMove:null,onDrop:null,onChange:null,autoScroll:!0,scrollThreshold:55,delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,ghostClass:"",ghostStyle:{},chosenClass:"",selectedClass:"",swapOnDrop:!0,fallbackOnBody:!1,stopPropagation:!1,supportTouch:"ontouchstart"in window,emptyInsertThreshold:5};for(n in r)n in this.options||(this.options[n]=r[n]);for(o in ot(e),this)"_"===o.charAt(0)&&"function"==typeof this[o]&&(this[o]=this[o].bind(this));u(t,this.options.supportTouch?"touchstart":"mousedown",this._onDrag),C.push(t),this.multiplayer=new V(this.options),this.animator=new q(this.options)}var G,J,g,Z,y,$,v,Q,b,w,e,S,x,O,_,E,T,k,N,L,z,tt,et,o,C,D,nt,j,I,M,ot;F.exports=(G={capture:!1,passive:!1},J=/\s+/g,g={start:["touchstart","mousedown"],move:["touchmove","mousemove"],end:["touchend","touchcancel","mouseup"]},y=t(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),$=t(/Edge/i),v=t(/safari/i)&&!t(/chrome/i)&&!t(/android/i),Z=!1,document.addEventListener("checkIfSupportPassive",null,{get passive(){return Z=!0}}),Q=Z,b="undefined"==typeof window||"undefined"==typeof document?"":(e=window.getComputedStyle(document.documentElement,"")||["-moz-hidden-iframe"],"ms"!==(e=(Array.prototype.slice.call(e).join("").match(/-(moz|webkit|ms)-/)||""===e.OLink&&["","o"])[1])?e&&e.length?e[0].toUpperCase()+e.substr(1):"":"ms"),w="Sortable"+Date.now(),S=c({},e={sortable:null,nodes:[]}),x=c({},e),O={},V.prototype={allowDrag:function(t){return this.options.multiple&&O[this.groupName]&&O[this.groupName].length&&-1<O[this.groupName].indexOf(t)},getHelper:function(){var n=document.createElement("div");return O[this.groupName].forEach(function(t,e){(t=t.cloneNode(!0)).style="\n opacity: ".concat(0===e?1:.5,";\n position: absolute;\n z-index: ").concat(e,";\n left: 0;\n top: 0;\n bottom: 0;\n right: 0;\n "),n.appendChild(t)}),n},select:function(t,e,n,o){var r;e&&(O[this.groupName]||(O[this.groupName]=[]),r=O[this.groupName].indexOf(e),K(e,this.options.selectedClass,r<0),t=c(c({},o),{},{event:t}),r<0?(O[this.groupName].push(e),o.sortable._dispatchEvent("onSelect",t)):(O[this.groupName].splice(r,1),o.sortable._dispatchEvent("onDeselect",t)),O[this.groupName].sort(function(t,e){return t=h(t,n),e=h(e,n),t.top==e.top?t.left-e.left:t.top-e.top}))},onDrag:function(e,t){S.sortable=t,S.nodes=O[this.groupName].map(function(t){return{node:t,rect:m(t),offset:h(t,e)}}),x.sortable=t},onTrulyStarted:function(e,t){t.animator.collect(e,null,e.parentNode),O[this.groupName].forEach(function(t){t!=e&&f(t,!1)}),t.animator.animate()},onChange:function(t,e){var n=m(t),o=h(t,e.el);x.sortable=e,x.nodes=O[this.groupName].map(function(t){return{node:t,rect:n,offset:o}})},onDrop:function(t,n,e,o,r){var i=this,a=(x.sortable.animator.collect(n,null,n.parentNode),O[this.groupName].indexOf(n));O[this.groupName].forEach(function(t,e){f(t,!0),e<a?n.parentNode.insertBefore(t,n):(e=0<e?O[i.groupName][e-1]:n,n.parentNode.insertBefore(t,e.nextSibling))}),S.sortable=o.sortable,x.nodes=O[this.groupName].map(function(t){return{node:t,rect:m(t),offset:h(t,e)}});var s=(o=X(S,x))||this._offsetChanged(S.nodes,x.nodes),r=c(c({},r()),{},{changed:s,event:t});o&&S.sortable._dispatchEvent("onDrop",r),x.sortable._dispatchEvent("onDrop",r),x.sortable.animator.animate()},_offsetChanged:function(t,n){return!!t.find(function(e){return Y(n.find(function(t){return t.node===e.node}).offset,e.offset)})}},window.requestAnimationFrame||(window.requestAnimationFrame=function(t){return setTimeout(t,17)}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)}),W.prototype={clear:function(){null!=this.autoScrollAnimationFrame&&(cancelAnimationFrame(this.autoScrollAnimationFrame),this.autoScrollAnimationFrame=null)},update:function(t,e,n,o){var r=this;cancelAnimationFrame(this.autoScrollAnimationFrame),this.autoScrollAnimationFrame=requestAnimationFrame(function(){n&&o&&r.autoScroll(t,e,o),r.update(t,e,n,o)})},autoScroll:function(t,e,n){var o,r,i,a,s,c,l,u,h,f,d,p;t&&(o=n.clientX,n=n.clientY,void 0!==o)&&void 0!==n&&(h=m(t))&&(d=t.scrollTop,r=t.scrollLeft,i=t.scrollHeight,f=t.scrollWidth,a=h.top,s=h.right,c=h.bottom,l=h.left,p=h.height,h=h.width,n<a||s<o||c<n||o<l||(u=0<d&&a<=n&&n<=a+e,h=r+h<f&&o<=s&&s-e<=o,f=d+p<i&&n<=c&&c-e<=n,(p=d=0)<r&&l<=o&&o<=l+e&&(d=Math.floor(Math.max(-1,(o-l)/e-1)*this.speed.x)),h&&(d=Math.ceil(Math.min(1,(o-s)/e+1)*this.speed.x)),u&&(p=Math.floor(Math.max(-1,(n-a)/e-1)*this.speed.y)),(p=f?Math.ceil(Math.min(1,(n-c)/e+1)*this.speed.y):p)&&(t.scrollTop+=p),d&&(t.scrollLeft+=d)))}},q.prototype={collect:function(t,e,n,o){var r=this;n&&(n=Array.prototype.slice.call(n.children),e=(t=this._getRange(n,t,e,o)).start,t=t.end,this.animations.length=0,n.slice(e,t+1).forEach(function(t){"none"!==p(t,"display")&&t!==o&&t!==s.helper&&r.animations.push({node:t,rect:m(t)})}))},animate:function(){var n=this;this.animations.forEach(function(t){var e=t.node,t=t.rect;n._excute(e,t)})},_excute:function(t,e){var n=e.left,e=(e=e.top)-(o=m(t)).top,n=n-o.left,o=(r(t),l(t,"translate3d(".concat(n,"px, ").concat(e,"px, 0)")),t.offsetWidth,this.options.animation);r(t,o),l(t,"translate3d(0px, 0px, 0px)"),clearTimeout(t.animated),t.animated=setTimeout(function(){r(t),l(t,""),t.animated=null},o)},_getRange:function(t,e,n){var o,e=t.indexOf(e);return(n=t.indexOf(n))<e&&(e=(o=[n,e])[0],n=o[1]),e<0&&(e=n,n=t.length-1),{start:e,end:n=n<0?t.length-1:n}}},U.prototype={get node(){return this.helper},destroy:function(){this.helper&&this.helper.parentNode&&this.helper.parentNode.removeChild(this.helper),this.helper=null,this.distance={x:0,y:0}},move:function(t,e){this.helper&&l(this.helper,"translate3d(".concat(t,"px, ").concat(e,"px, 0)"))},init:function(t,e,n,o){if(!this.helper){var r,i=o.fallbackOnBody,a=o.ghostClass,o=o.ghostStyle,i=i?document.body:n,s=(this.helper=e.cloneNode(!0),K(this.helper,a,!0),c({top:t.top,left:t.left,width:t.width,height:t.height,position:"fixed",opacity:"0.8","z-index":1e5,"pointer-events":"none","box-sizing":"border-box"},o));for(r in s)p(this.helper,r,s[r]);e="none",(n=this.helper).style["".concat(b,"Transition")]=e?"none"===e?"none":"".concat(e):"",l(this.helper,"translate3d(0px, 0px, 0px)"),i.appendChild(this.helper),a=this.distance.x/parseInt(this.helper.style.width)*100,t=this.distance.y/parseInt(this.helper.style.height)*100,p(this.helper,"transform-origin","".concat(a,"% ").concat(t,"%")),p(this.helper,"transform","translateZ(0)"),p(this.helper,"will-change","transform")}}},o={sortable:null,group:null,node:null,rect:{},offset:{}},C=[],D=new U,nt=new W,j=c({},o),I=c({},o),M={x:0,y:0},ot=function(t){var e={},n=t.group;n&&"object"==A(n)||(n={name:n,pull:!0,put:!0}),e.name=n.name,e.pull=n.pull,e.put=n.put,t.group=e},(s.prototype={constructor:s,destroy:function(){this._dispatchEvent("destroy",this),this.el[w]=null;for(var t=0;t<g.start.length;t++)n(this.el,g.start[t],this._onDrag);this._clearState(),C.splice(C.indexOf(this.el),1),this.el=null},option:function(t,e){var n=this.options;if(void 0===e)return n[t];n[t]=e,"group"===t&&ot(n)},_onDrag:function(t){if(!this.options.disabled&&this.options.group.pull&&(!/mousedown|pointerdown/.test(t.type)||0===t.button)){var e=R(t),n=e.touch,o=e.event;if(!((e=e.target)===this.el||v&&e&&"SELECT"===e.tagName.toUpperCase())){var r=this.options,i=r.draggable;if(("function"!=typeof(r=r.handle)||r(t))&&("string"!=typeof r||H(e,r))){if("function"==typeof i){if(!(r=i(t)))return;!function(t){if(t){var e=document.createElement("div");try{return e.appendChild(t.cloneNode(!0)),1==t.nodeType}catch(e){return t==window||t==document}}}(r)||(E=r)}else E=a(e,i,this.el,!1);E&&!E.animated&&(k=E.cloneNode(!0),this._prepareStart(n,o))}}}},_prepareStart:function(t,e){var n=this,o=E.parentNode,r=((N=e).sortable=this,N.group=E.parentNode,(z=this.options.multiple&&this.multiplayer.allowDrag(E))&&this.multiplayer.onDrag(this.el,this),m(E)),i=h(E,this.el);j={sortable:this,group:o,node:E,rect:r,offset:i},I.group=o,I.sortable=this,D.distance={x:e.clientX-r.left,y:e.clientY-r.top},u(document,"touchend",this._onDrop),u(document,"touchcancel",this._onDrop),u(document,"mouseup",this._onDrop);o=(i=this.options).delay,e=i.delayOnTouchOnly;if(!o||e&&!t||$||y)this._onStart(t);else{for(var a=0;a<g.end.length;a++)u(this.ownerDocument,g.end[a],this._cancelStart);for(var s=0;s<g.move.length;s++)u(this.ownerDocument,g.move[s],this._delayMoveHandler);et=setTimeout(function(){return n._onStart(t)},o)}},_delayMoveHandler:function(t){t=t.touches?t.touches[0]:t,Math.max(Math.abs(t.clientX-N.clientX),Math.abs(t.clientY-N.clientY))>=Math.floor(this.options.touchStartThreshold/(window.devicePixelRatio||1))&&this._cancelStart()},_cancelStart:function(){clearTimeout(et);for(var t=0;t<g.end.length;t++)n(this.ownerDocument,g.end[t],this._cancelStart);for(var e=0;e<g.move.length;e++)n(this.ownerDocument,g.move[e],this._delayMoveHandler)},_onStart:function(t){_=this.el,u(document,t?"touchmove":"mousemove",this._nearestSortable);try{document.selection?setTimeout(function(){document.selection.empty()},0):window.getSelection().removeAllRanges()}catch(t){}},_onTrulyStarted:function(){var t;L||(this._dispatchEvent("onDrag",c(c({},i()),{},{event:N})),z&&this.multiplayer.onTrulyStarted(E,this),t=z?this.multiplayer.getHelper():E,D.init(j.rect,t,this.el,this.options),s.helper=D.node,f(E,!1),E.parentNode.insertBefore(k,E),K(k,this.options.chosenClass,!0),v&&p(document.body,"user-select","none"))},_nearestSortable:function(t){var e,n,o,r,i,a,s;this._preventEvent(t),!N||!E||(e=(n=t).clientX,n=n.clientY,o=e-M.x,r=n-M.y,M.x=e,M.y=n,void 0!==e&&void 0!==n&&Math.abs(o)<=0&&Math.abs(r)<=0)||(n=(e=R(t)).event,o=e.target,i=n.clientX,a=n.clientY,C.some(function(t){var e,n,o=t[w].options.emptyInsertThreshold;if(o)return n=m(t,{parent:!0}),e=i>=n.left-o&&i<=n.right+o,n=a>=n.top-o&&a<=n.bottom+o,e&&n?s=t:void 0}),r=s,this._onTrulyStarted(),L=n,D.move(n.clientX-N.clientX,n.clientY-N.clientY),this._autoScroll(o),r&&r[w]._onMove(n,o))},_allowPut:function(){var t,e;return N.sortable.el===this.el||!!this.options.group.put&&(t=this.options.group.name,(e=N.sortable.options.group).name)&&t&&e.name===t},_onMove:function(t,e){if(this._allowPut()){if(this._dispatchEvent("onMove",c(c({},i()),{},{event:t})),_=this.el,T=a(e,this.options.draggable,_,!1)){if(T===tt)return;if((tt=T)===k)return;if(T.animated||P(T,k))return}_!==j.sortable.el?e!==_&&function(t,e){for(var n=t.lastElementChild;n&&(n===e||"none"===p(n,"display"));)n=n.previousElementSibling;return n}(_,D.node)?T&&this._onInsert(t,!1):this._onInsert(t,!0):T&&this._onChange(t)}},_autoScroll:function(n){var n=function(){if(n&&n.getBoundingClientRect){var t=n;do{if(t.clientWidth<t.scrollWidth||t.clientHeight<t.scrollHeight){var e=p(t);if(t.clientWidth<t.scrollWidth&&("auto"==e.overflowX||"scroll"==e.overflowX)||t.clientHeight<t.scrollHeight&&("auto"==e.overflowY||"scroll"==e.overflowY))return t.getBoundingClientRect&&t!==document.body?t:d()}}while(t=t.parentNode)}return d()}(),t=(e=this.options).autoScroll,e=e.scrollThreshold;t&&nt.update(n,e,N,L)},_onInsert:function(t,e){var n=e?k:T,o=e?_:T.parentNode;j.sortable.animator.collect(k,null,k.parentNode,k),this.animator.collect(null,n,o,k),z&&this.multiplayer.onChange(k,this),I={sortable:this,group:o,node:n,rect:m(n),offset:h(n,_)},j.sortable._dispatchEvent("onRemove",c(c({},i()),{},{event:t})),e?o.appendChild(k):o.insertBefore(k,T),this._dispatchEvent("onAdd",c(c({},i()),{},{event:t})),j.sortable.animator.animate(),this.animator.animate(),j.group=o,j.sortable=this},_onChange:function(t){var e=T.parentNode;this.animator.collect(k,T,e),z&&this.multiplayer.onChange(k,this),I={sortable:this,group:e,node:T,rect:m(T),offset:h(T,_)},this._dispatchEvent("onChange",c(c({},i()),{},{event:t}));t=(t=h(k,_)).top===I.offset.top?t.left<I.offset.left?T.nextSibling:T:t.top<I.offset.top?T.nextSibling:T;e.insertBefore(k,t),this.animator.animate(),j.group=e,j.sortable=this},_onDrop:function(t){this._unbindMoveEvents(),this._unbindDropEvents(),this._preventEvent(t),this._cancelStart(),nt.clear(),E&&N&&L?this._onEnd(t):this.options.multiple&&this.multiplayer.select(t,E,_,c({},j)),this._clearState()},_onEnd:function(t){var e,n;this.options.swapOnDrop&&k.parentNode.insertBefore(E,k),j.group=N.group,j.sortable=N.sortable,I.rect=m(k),I.offset=h(k,_),z?this.multiplayer.onDrop(t,E,_,N,i):(I.node===k&&(I.node=E),n=(e=X(j,I))||Y(j.offset,I.offset),n=c(c({},i()),{},{changed:n,event:t}),e&&j.sortable._dispatchEvent("onDrop",n),I.sortable._dispatchEvent("onDrop",n)),f(E,!0),k.parentNode.removeChild(k),v&&p(document.body,"user-select","")},_preventEvent:function(t){void 0!==t.preventDefault&&t.cancelable&&t.preventDefault(),this.options.stopPropagation&&(t&&t.stopPropagation?t.stopPropagation():window.event.cancelBubble=!0)},_dispatchEvent:function(t,e){"function"==typeof(t=this.options[t])&&t(e)},_clearState:function(){E=T=k=N=L=z=tt=et=s.helper=null,M={x:0,y:0},j=I=c({},o),D.destroy()},_unbindMoveEvents:function(){for(var t=0;t<g.move.length;t++)n(document,g.move[t],this._nearestSortable)},_unbindDropEvents:function(){for(var t=0;t<g.end.length;t++)n(document,g.end[t],this._onDrop)}}).utils={on:u,off:n,css:p,closest:a,getRect:m,getOffset:h},s.get=function(t){return t[w]},s.create=function(t,e){return new s(t,e)},s)})(t={exports:{}});var t,d=t.exports,p="virtualSortableState",m={from:{},to:{}},Dt=new(function(){function t(){r(this,t)}return e(t,[{key:"clear",value:function(){window[p]=null}},{key:"getStore",value:function(){try{return JSON.parse(window[p])||m}catch(t){return m}}},{key:"getValue",value:function(){return new Promise(function(t,e){try{t(JSON.parse(window[p])||m)}catch(t){e(m)}})}},{key:"setValue",value:function(r){return new Promise(function(t,e){try{var n=JSON.parse(window[p]||"{}"),o=Object.assign(Object.assign({},n),r);window[p]=JSON.stringify(o),t(o)}catch(t){e(m)}})}}]),t}()),g=["group","handle","disabled","draggable","ghostClass","ghostStyle","chosenClass","animation","autoScroll","scrollThreshold","fallbackOnBody","pressDelay","pressDelayOnTouchOnly"],y="v-drag",v="v-drop",b="v-add",w="v-remove",S=null,jt=function(){function o(t,e,n){r(this,o),this.ctx=t,this.onStart=e,this.onEnd=n,this.initialList=Nt(t.list),this.dynamicList=Nt(t.list),this.sortable=null,this.rangeChanged=!1,this._init()}return e(o,[{key:"destroy",value:function(){this.sortable&&this.sortable.destroy(),this.sortable=null}},{key:"setValue",value:function(t,e){"list"===t?(this.initialList=Nt(e),S&&this._onDrag(S,!1)):(this.ctx[t]=e,this.sortable&&this.sortable.option(t,e))}},{key:"_init",value:function(){var o=this,t=g.reduce(function(t,e){return t["pressDelayOnTouchOnly"===e?"delayOnTouchOnly":"pressDelay"===e?"delay":e]=o.ctx[e],t},{});this.sortable=new d(this.ctx.container,Object.assign(Object.assign({},t),{swapOnDrop:!1,list:this.dynamicList,onDrag:function(t){t=t.from;return o._onDrag(t.node)},onAdd:function(t){var e=t.from,t=t.to;return o._onAdd(e,t)},onRemove:function(t){var e=t.from,t=t.to;return o._onRemove(e,t)},onChange:function(t){var e=t.from,t=t.to;return o._onChange(e,t)},onDrop:function(t){var e=t.from,n=t.to,t=t.changed;return o._onDrop(e,n,t)}}))}},{key:"_onDrag",value:function(r){var i=!(1<arguments.length&&void 0!==arguments[1])||arguments[1];return f(this,void 0,void 0,O().mark(function t(){var e,n,o;return O().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return S=r,this.dynamicList=Nt(this.initialList),e=Nt(this.initialList),n=this._getFromTo({node:r},e),t.next=6,Dt.setValue({from:Object.assign({list:e},n)});case 6:if(i)return this.rangeChanged=!1,t.next=10,Dt.getValue();t.next=16;break;case 10:n=t.sent,(o=this.ctx[y])&&o(Object.assign({list:e},n)),this.onStart&&this.onStart(n),t.next=17;break;case 16:this.rangeChanged=!0;case 17:case"end":return t.stop()}},t,this)}))}},{key:"_onAdd",value:function(r,i){var a;return f(this,void 0,void 0,O().mark(function t(){var e,n,o;return O().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return this.dynamicList.length||(this.dynamicList=Nt(this.initialList)),t.next=3,Dt.getValue();case 3:e=t.sent,o=Nt(this.dynamicList),o=this._getIndex(o,i.node.dataset.key),n=Object.assign(Object.assign({},e.from),{index:o}),r.node===i.node?(n.index=this.dynamicList.length,this.dynamicList.push(null==(a=e.from)?void 0:a.item)):this.dynamicList.splice(o,0,null==(a=e.from)?void 0:a.item),delete n.list,(o=this.ctx[b])&&o(Object.assign({},n));case 11:case"end":return t.stop()}},t,this)}))}},{key:"_onRemove",value:function(o,t){return f(this,void 0,void 0,O().mark(function t(){var e,n;return O().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:e=Nt(this.dynamicList),e=this._getFromTo(o,e),this.dynamicList.splice(e.index,1),(n=this.ctx[w])&&n(Object.assign({},e));case 5:case"end":return t.stop()}},t,this)}))}},{key:"_onChange",value:function(o,r){return f(this,void 0,void 0,O().mark(function t(){var e,n;return O().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:e=Nt(this.dynamicList),n=Nt(this.dynamicList),e=this._getFromTo(o,e),n=this._getFromTo(r,n),this.dynamicList.splice(e.index,1),this.dynamicList.splice(n.index,0,e.item);case 6:case"end":return t.stop()}},t,this)}))}},{key:"_onDrop",value:function(i,t,a){return f(this,void 0,void 0,O().mark(function t(){var e,n,o,r;return O().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e=Nt(this.dynamicList),n=this._getIndex(e,i.node.dataset.key),o=this.initialList[n],r=zt(o,this.ctx.dataKey),t.next=6,Dt.setValue({to:{list:Nt(this.initialList),index:n,item:o,key:r}});case 6:return t.next=8,Dt.getValue();case 8:n=t.sent,o=Object.assign(Object.assign({list:e},n),{changed:a}),(r=this.ctx[v])&&r(Object.assign({},o)),this.onEnd&&this.onEnd(n,o),this.initialList=Nt(e),this._clear();case 15:case"end":return t.stop()}},t,this)}))}},{key:"_getFromTo",value:function(t,e){var t=t.node.dataset.key,n=this._getIndex(e,t);return{key:t,item:e[n],index:n}}},{key:"_getIndex",value:function(t,e){for(var n=0;n<t.length;n++)if(zt(t[n],this.ctx.dataKey)==e)return n;return-1}},{key:"_clear",value:function(){S=null,Dt.clear(),this.rangeChanged=!1}}]),o}(),x=Tt.memo(function(t){var e=t.dataKey,n=t.children,o=t.onSizeChange,r=t.sizeKey,i=Tt.useRef(null),t="function"==typeof n?n(i):n;return Tt.useLayoutEffect(function(){var t;return void 0!==("undefined"==typeof ResizeObserver?"undefined":a(ResizeObserver))&&(t=new ResizeObserver(function(){var t=i.current[r];o&&o(e,t)}),i.current&&t.observe(i.current)),function(){t&&(t.disconnect(),t=null)}},[i]),Tt.cloneElement(t,{ref:i})}),It=Tt.memo(function(t){var e=t.Tag,n=t.children;return Tt.createElement(x,{dataKey:t.dataKey,sizeKey:t.sizeKey,onSizeChange:t.onSizeChange},Tt.createElement(void 0===e?"div":e,{className:t.className,style:t.style,"data-key":t.dataKey,"data-index":t.index},"function"==typeof n?n(t.record,t.index,t.dataKey):n))}),Mt=Tt.memo(function(t){var e=t.Tag,n=t.children;return n?Tt.createElement(x,{dataKey:t.roleId,sizeKey:t.sizeKey,onSizeChange:t.onSizeChange},Tt.createElement(void 0===e?"div":e,{role:t.roleId,style:t.style,className:t.className},n)):null}),Ft="v-top",Bt="v-bottom";return function(o,t){function F(){A(),v(function(){return Nt(s)}),S.current=Nt(s)}function B(t){return k.current.sizes.get(t)}function r(){var t;return l?document.documentElement[C]||document.body[C]:(t=O.current)?Math.ceil(t[C]):0}function i(){var t;return l?document.documentElement[z]||document.body[z]:(t=O.current)?Math.ceil(t[z]):0}function a(){var t;return l?document.documentElement[L]||document.body[L]:(t=O.current)?Math.ceil(t[L]):0}function e(t){t>=s.length-1?n():(t=k.current.getOffsetByIndex(t),D(t))}function A(){D(0)}function n(){var t;_.current&&(t=_.current[ft],D(t),setTimeout(function(){St()||n()},5))}function R(t,e){k.current.handleItemSizeChange(t,e)}function P(t,e){k.current.handleSlotSizeChange(t,e)}function K(t,e){return Tt.createElement(Mt,{roleId:e,Tag:t,children:o[e],sizeKey:ht,onSizeChange:P})}var s=void 0===(u=o.dataSource)?[]:u,H=void 0===(u=o.dataKey)?"":u,Y=void 0===(u=o.direction)?"vertical":u,c=void 0===(u=o.keeps)?30:u,X=void 0===(u=o.size)?void 0:u,l=void 0!==(u=o.pageMode)&&u,u=void 0===(u=o.delay)?10:u,V=void 0!==(h=o.keepOffset)&&h,W=void 0===(h=o.autoScroll)||h,q=void 0===(h=o.scrollThreshold)?55:h,U=void 0===(h=o.animation)?150:h,G=void 0===(h=o.pressDelay)?0:h,J=void 0!==(h=o.pressDelayOnTouchOnly)&&h,Z=void 0!==(h=o.fallbackOnBody)&&h,$=void 0===(h=o.style)?{}:h,h=void 0===(h=o.className)?"":h,f=void 0===(f=o.wrapTag)?"div":f,d=void 0===(d=o.rootTag)?"div":d,Q=void 0===(p=o.itemTag)?"div":p,p=void 0===(p=o.headerTag)?"div":p,m=void 0===(m=o.footerTag)?"div":m,tt=void 0===(g=o.itemStyle)?{}:g,et=void 0===(g=o.itemClass)?"":g,nt=void 0===(g=o.wrapStyle)?{}:g,g=void 0===(g=o.wrapClass)?"":g,ot=void 0===(I=o.ghostClass)?"":I,rt=void 0===(I=o.ghostStyle)?{}:I,it=void 0===(I=o.chosenClass)?"":I,y=void 0!==(I=o.disabled)&&I,at=(I=kt(Tt.useState([]),2))[0],v=I[1],b=(I=kt(Tt.useState({start:0,end:c-1}),2))[0],st=I[1],w=(I=kt(Tt.useState({from:{},to:{}}),2))[0],ct=I[1],S=Tt.useRef([]),x=Tt.useRef([]),lt=Tt.useRef(null),O=Tt.useRef(null),ut=Tt.useRef(null),_=Tt.useRef(null),E=Tt.useRef(null),T=Tt.useRef(null),k=Tt.useRef(null),N=(I=Tt.useMemo(function(){var t="vertical"!==Y;return{isHorizontal:t,slotSizeKey:t?"offsetWidth":"offsetHeight",offsetSizeKey:t?"offsetLeft":"offsetTop",scrollSizeKey:t?"scrollWidth":"scrollHeight",clientSizeKey:t?"clientWidth":"clientHeight",scrollDirectionKey:t?"scrollLeft":"scrollTop"}},[Y])).isHorizontal,ht=I.slotSizeKey,L=I.scrollSizeKey,ft=I.offsetSizeKey,z=I.clientSizeKey,C=I.scrollDirectionKey,D=function(t){l?(document.body[C]=t,document.documentElement[C]=t):O.current[C]=t},dt=(Tt.useImperativeHandle(t,function(){return{reset:F,getSize:B,getOffset:r,getClientSize:i,getScrollSize:a,scrollToTop:A,scrollToIndex:e,scrollToOffset:D,scrollToBottom:n}}),Tt.useLayoutEffect(function(){gt()},[]),Tt.useEffect(function(){return yt(),l&&(mt(),dt()),function(){bt(),l&&pt()}},[]),Tt.useEffect(function(){T.current&&T.current.setValue("disabled",y)},[y]),Tt.useEffect(function(){var t;S.current=Nt(s),wt(),v(function(){return k.current.sizes.size?k.current.updateRange():(clearTimeout(lt.current),lt.current=setTimeout(function(){return k.current.updateRange()},17)),Nt(s)}),T.current&&T.current.setValue("list",s),E.current&&V&&(t=Math.abs(s.length-E.current),e(t),E.current=null)},[s]),function(){document.addEventListener("scroll",j,{passive:!1})}),pt=function(){document.removeEventListener("scroll",j)},mt=function(){var t,e=O.current;e&&(t=e.getBoundingClientRect(),e=e.ownerDocument.defaultView,t=N?t.left+e.pageXOffset:t.top+e.pageYOffset,k.current.handleSlotSizeChange("header",t))},gt=function(){k.current=new Ct({size:X,keeps:c,uniqueKeys:x.current,buffer:Math.round(c/3)},function(t){var e,n,o;T.current&&(st(function(){return t}),o=Dt.getStore(),e=t.start,n=t.end,-1<(o=o.from.index)&&!(e<=o&&o<=n)&&(T.current.rangeChanged=!0))})},yt=function(){T.current=new jt(Object.assign({container:ut.current,list:S.current,disabled:y,ghostClass:ot,ghostStyle:rt,chosenClass:it,animation:U,autoScroll:W,scrollThreshold:q,pressDelay:G,pressDelayOnTouchOnly:J,fallbackOnBody:Z},o),function(t){ct(function(){return Object.assign({},t)})},function(t,e){var n=e.list,e=e.changed;ct(function(){return Object.assign({},t)}),e&&(e=S.current,S.current=Nt(n),v(function(){return Nt(n)}),wt(),vt(e,n))})},vt=function(o,r){st(function(t){var e,n=Object.assign({},t);return 0<t.start&&(-1<(e=r.indexOf(o[t.start]))&&(n=Object.assign(Object.assign({},t),{start:e,end:e+c-1}))),r.length>o.length&&t.end===o.length-1&&St()&&(n.end++,n.start=Math.max(0,n.end-c+1)),k.current.handleUpdate(n.start,n.end),n})},bt=function(){T.current&&T.current.destroy(),T.current=null},wt=function(){x.current=S.current.map(function(t){return zt(t,H)}),k.current.updateOptions("uniqueKeys",x.current)},j=Lt(function(){var t=r(),e=i(),n=a();t<0||n+1<t+e||!n||(k.current.handleScroll(t),k.current.isFront()&&s.length&&t<=0?xt():k.current.isBehind()&&n<=e+t&&Ot())},u),St=function(){var t=r(),e=i();return a()<=t+e+1},xt=Lt(function(){E.current=S.current.length;var t=o[Ft];t&&t()}),Ot=Lt(function(){var t=o[Bt];t&&t()}),_t=Tt.useCallback(function(t){if(!T.current||!w)return{};var e=w.from.key;return T.current.rangeChanged&&t==e?{display:"none"}:{}},[w]),I=Tt.useMemo(function(){return Object.assign(Object.assign({},$),{overflow:l?"":N?"auto hidden":"hidden auto"})},[$,N]),t=Tt.useMemo(function(){var t=b.front,e=b.behind;return Object.assign(Object.assign({},nt),{padding:N?"0px ".concat(e,"px 0px ").concat(t,"px"):"".concat(t,"px 0px ").concat(e,"px")})},[nt,N,b]),u=Tt.useMemo(function(){return{width:N?"0px":"100%",height:N?"100%":"0px"}},[N]),Et=(M=Tt.useMemo(function(){return Object.assign({},b)},[b])).start,M=M.end;return Tt.createElement(d,{ref:O,style:I,className:h,onScroll:l?null:j},K(p,"header"),Tt.createElement(f,{ref:ut,role:"group",style:t,className:g},at.slice(Et,M+1).map(function(t,e){var e=Et+e,n=zt(t,H);return Tt.createElement(It,{key:n,record:t,index:e,dataKey:n,Tag:Q,children:o.children,className:et,style:Object.assign(Object.assign({},tt),_t(n)),sizeKey:ht,onSizeChange:R})})),K(m,"footer"),Tt.createElement("div",{ref:_,style:u}))}});
{
"name": "react-virtual-drag-list",
"version": "2.5.0",
"version": "2.5.1",
"description": "A virtual scrolling list component that can be sorted by dragging",

@@ -39,3 +39,3 @@ "main": "dist/virtual-drag-list.js",

"dependencies": {
"sortable-dnd": "0.5.3"
"sortable-dnd": "0.5.4"
},

@@ -42,0 +42,0 @@ "devDependencies": {

@@ -89,2 +89,3 @@ # react-virtual-drag-list

| `keepOffset` | `Boolean` | | `false` | When scrolling up to load data, keep the same offset as the previous scroll |
| `pageMode` | `Boolean` | | `false` | Let virtual list using global document to scroll through the list |

@@ -143,5 +144,6 @@ **Uncommonly used**

|-------------------|-----------------|
| `reset()` | reset to initial |
| `getSize(key)` | get the height of the specified item by key value |
| `getOffset()` | get the current scroll height |
| `getClientSize()` | Get wrapper element client viewport size (width or height) |
| `getScrollSize()` | Get all scroll size (scrollHeight or scrollWidth) |
| `scrollToTop()` | scroll to the top of the list |

@@ -148,0 +150,0 @@ | `scrollToBottom()`| scroll to the bottom of the list |

@@ -12,2 +12,3 @@ import React from 'react';

size?: number;
pageMode?: boolean;
disabled?: boolean;

@@ -14,0 +15,0 @@ draggable?: Function | string;

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