Files
server/opt/psa/admin/ui-library/react-sortable-hoc.min.js
cutemeli 0bfc6c8425 Initial
2025-12-22 10:32:59 +00:00

2 lines
29 KiB
JavaScript

"use strict";(globalThis.webpackChunkPleskUiLibrary=globalThis.webpackChunkPleskUiLibrary||[]).push([[4],{417:(e,t,n)=>{n.r(t),n.d(t,{SortableContainer:()=>Z,SortableElement:()=>ne,SortableHandle:()=>Y,arrayMove:()=>S,sortableContainer:()=>Z,sortableElement:()=>ne,sortableHandle:()=>Y});var r=n(93),o=n(418),i=n(424),a=n(425),l=n(426),s=n(427),d=n(428),u=n(429),f=n(271),c=n(12),h=n(7),p=n(79),g=n(430),y=n.n(g),v=n(431),m=n(29),x=n.n(m),w=function(){function e(){(0,a.default)(this,e),(0,c.default)(this,"refs",{})}return(0,l.default)(e,[{key:"add",value:function(e,t){this.refs[e]||(this.refs[e]=[]),this.refs[e].push(t)}},{key:"remove",value:function(e,t){var n=this.getIndex(e,t);-1!==n&&this.refs[e].splice(n,1)}},{key:"isActive",value:function(){return this.active}},{key:"getActive",value:function(){var e=this;return this.refs[this.active.collection].find(function(t){return t.node.sortableInfo.index==e.active.index})}},{key:"getIndex",value:function(e,t){return this.refs[e].indexOf(t)}},{key:"getOrderedRefs",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.active.collection;return this.refs[e].sort(b)}}]),e}();function b(e,t){return e.node.sortableInfo.index-t.node.sortableInfo.index}function S(e,t,n){return(e=e.slice()).splice(n<0?e.length+n:n,0,e.splice(t,1)[0]),e}function O(e,t){return Object.keys(e).reduce(function(n,r){return-1===t.indexOf(r)&&(n[r]=e[r]),n},{})}var C={end:["touchend","touchcancel","mouseup"],move:["touchmove","mousemove"],start:["touchstart","mousedown"]},T=function(){if("undefined"==typeof window||"undefined"==typeof document)return"";var e=window.getComputedStyle(document.documentElement,"")||["-moz-hidden-iframe"],t=(Array.prototype.slice.call(e).join("").match(/-(moz|webkit|ms)-/)||""===e.OLink&&["","o"])[1];return"ms"===t?"ms":t&&t.length?t[0].toUpperCase()+t.substr(1):""}();function I(e,t){Object.keys(t).forEach(function(n){e.style[n]=t[n]})}function k(e,t){e.style["".concat(T,"Transform")]=null==t?"":"translate3d(".concat(t.x,"px,").concat(t.y,"px,0)")}function E(e,t){e.style["".concat(T,"TransitionDuration")]=null==t?"":"".concat(t,"ms")}function R(e,t){for(;e;){if(t(e))return e;e=e.parentNode}return null}function D(e,t,n){return Math.max(e,Math.min(n,t))}function A(e){return"px"===e.substr(-2)?parseFloat(e):0}function N(e,t){var n=t.displayName||t.name;return n?"".concat(e,"(").concat(n,")"):e}function M(e,t){var n=e.getBoundingClientRect();return{top:n.top+t.top,left:n.left+t.left}}function W(e){return e.touches&&e.touches.length?{x:e.touches[0].pageX,y:e.touches[0].pageY}:e.changedTouches&&e.changedTouches.length?{x:e.changedTouches[0].pageX,y:e.changedTouches[0].pageY}:{x:e.pageX,y:e.pageY}}function L(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{left:0,top:0};if(e){var r={left:n.left+e.offsetLeft,top:n.top+e.offsetTop};return e.parentNode===t?r:L(e.parentNode,t,r)}}function P(e){var t=e.lockOffset,n=e.width,r=e.height,o=t,i=t,a="px";if("string"==typeof t){var l=/^[+-]?\d*(?:\.\d*)?(px|%)$/.exec(t);y()(null!==l,'lockOffset value should be a number or a string of a number followed by "px" or "%". Given %s',t),o=parseFloat(t),i=parseFloat(t),a=l[1]}return y()(isFinite(o)&&isFinite(i),"lockOffset value should be a finite. Given %s",t),"%"===a&&(o=o*n/100,i=i*r/100),{x:o,y:i}}function j(e){return e instanceof HTMLElement?function(e){var t=window.getComputedStyle(e),n=/(auto|scroll)/;return["overflow","overflowX","overflowY"].find(function(e){return n.test(t[e])})}(e)?e:j(e.parentNode):null}var H=27,K=32,G=37,B=38,U=39,_=40,X={Anchor:"A",Button:"BUTTON",Canvas:"CANVAS",Input:"INPUT",Option:"OPTION",Textarea:"TEXTAREA",Select:"SELECT"};function Y(e){var t,n,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{withRef:!1};return n=t=function(t){function n(){var e,t;(0,a.default)(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return t=(0,s.default)(this,(e=(0,d.default)(n)).call.apply(e,[this].concat(o))),(0,c.default)((0,f.default)((0,f.default)(t)),"wrappedInstance",(0,h.createRef)()),t}return(0,u.default)(n,t),(0,l.default)(n,[{key:"componentDidMount",value:function(){(0,p.findDOMNode)(this).sortableHandle=!0}},{key:"getWrappedInstance",value:function(){return y()(o.withRef,"To access the wrapped instance, you need to pass in {withRef: true} as the second argument of the SortableHandle() call"),this.wrappedInstance.current}},{key:"render",value:function(){var t=o.withRef?this.wrappedInstance:null;return(0,h.createElement)(e,(0,r.default)({ref:t},this.props))}}]),n}(h.Component),(0,c.default)(t,"displayName",N("sortableHandle",e)),n}function F(e){return null!=e.sortableHandle}var V=function(){function e(t,n){(0,a.default)(this,e),this.container=t,this.onScrollCallback=n}return(0,l.default)(e,[{key:"clear",value:function(){null!=this.interval&&(clearInterval(this.interval),this.interval=null)}},{key:"update",value:function(e){var t=this,n=e.translate,r=e.minTranslate,o=e.maxTranslate,i=e.width,a=e.height,l={x:0,y:0},s={x:1,y:1},d=10,u=10,f=this.container,c=f.scrollTop,h=f.scrollLeft,p=f.scrollHeight,g=f.scrollWidth,y=0===c,v=p-c-f.clientHeight===0,m=0===h,x=g-h-f.clientWidth===0;n.y>=o.y-a/2&&!v?(l.y=1,s.y=u*Math.abs((o.y-a/2-n.y)/a)):n.x>=o.x-i/2&&!x?(l.x=1,s.x=d*Math.abs((o.x-i/2-n.x)/i)):n.y<=r.y+a/2&&!y?(l.y=-1,s.y=u*Math.abs((n.y-a/2-r.y)/a)):n.x<=r.x+i/2&&!m&&(l.x=-1,s.x=d*Math.abs((n.x-i/2-r.x)/i)),this.interval&&(this.clear(),this.isAutoScrolling=!1),0===l.x&&0===l.y||(this.interval=setInterval(function(){t.isAutoScrolling=!0;var e={left:s.x*l.x,top:s.y*l.y};t.container.scrollTop+=e.top,t.container.scrollLeft+=e.left,t.onScrollCallback(e)},5))}}]),e}();var q={axis:x().oneOf(["x","y","xy"]),contentWindow:x().any,disableAutoscroll:x().bool,distance:x().number,getContainer:x().func,getHelperDimensions:x().func,helperClass:x().string,helperContainer:x().oneOfType([x().func,"undefined"==typeof HTMLElement?x().any:x().instanceOf(HTMLElement)]),hideSortableGhost:x().bool,keyboardSortingTransitionDuration:x().number,lockAxis:x().string,lockOffset:x().oneOfType([x().number,x().string,x().arrayOf(x().oneOfType([x().number,x().string]))]),lockToContainerEdges:x().bool,onSortEnd:x().func,onSortMove:x().func,onSortOver:x().func,onSortStart:x().func,pressDelay:x().number,pressThreshold:x().number,keyCodes:x().shape({lift:x().arrayOf(x().number),drop:x().arrayOf(x().number),cancel:x().arrayOf(x().number),up:x().arrayOf(x().number),down:x().arrayOf(x().number)}),shouldCancelStart:x().func,transitionDuration:x().number,updateBeforeSortStart:x().func,useDragHandle:x().bool,useWindowAsScrollContainer:x().bool},z={lift:[K],drop:[K],cancel:[H],up:[B,G],down:[_,U]},$={axis:"y",disableAutoscroll:!1,distance:0,getHelperDimensions:function(e){var t=e.node;return{height:t.offsetHeight,width:t.offsetWidth}},hideSortableGhost:!0,lockOffset:"50%",lockToContainerEdges:!1,pressDelay:0,pressThreshold:5,keyCodes:z,shouldCancelStart:function(e){return-1!==[X.Input,X.Textarea,X.Select,X.Option,X.Button].indexOf(e.target.tagName)||!!R(e.target,function(e){return"true"===e.contentEditable})},transitionDuration:300,useWindowAsScrollContainer:!1},J=Object.keys(q);var Q=(0,h.createContext)({manager:{}});function Z(e){var t,n,g=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{withRef:!1};return n=t=function(t){function n(e){var t;(0,a.default)(this,n),t=(0,s.default)(this,(0,d.default)(n).call(this,e)),(0,c.default)((0,f.default)((0,f.default)(t)),"state",{}),(0,c.default)((0,f.default)((0,f.default)(t)),"handleStart",function(e){var n=t.props,r=n.distance,o=n.shouldCancelStart;if(2!==e.button&&!o(e)){t.touched=!0,t.position=W(e);var i=R(e.target,function(e){return null!=e.sortableInfo});if(i&&i.sortableInfo&&t.nodeIsChild(i)&&!t.state.sorting){var a=t.props.useDragHandle,l=i.sortableInfo,s=l.index,d=l.collection;if(l.disabled)return;if(a&&!R(e.target,F))return;t.manager.active={collection:d,index:s},function(e){return e.touches&&e.touches.length||e.changedTouches&&e.changedTouches.length}(e)||e.target.tagName!==X.Anchor||e.preventDefault(),r||(0===t.props.pressDelay?t.handlePress(e):t.pressTimer=setTimeout(function(){return t.handlePress(e)},t.props.pressDelay))}}}),(0,c.default)((0,f.default)((0,f.default)(t)),"nodeIsChild",function(e){return e.sortableInfo.manager===t.manager}),(0,c.default)((0,f.default)((0,f.default)(t)),"handleMove",function(e){var n=t.props,r=n.distance,o=n.pressThreshold;if(!t.state.sorting&&t.touched&&!t._awaitingUpdateBeforeSortStart){var i=W(e),a={x:t.position.x-i.x,y:t.position.y-i.y},l=Math.abs(a.x)+Math.abs(a.y);t.delta=a,r||o&&!(l>=o)?r&&l>=r&&t.manager.isActive()&&t.handlePress(e):(clearTimeout(t.cancelTimer),t.cancelTimer=setTimeout(t.cancel,0))}}),(0,c.default)((0,f.default)((0,f.default)(t)),"handleEnd",function(){t.touched=!1,t.cancel()}),(0,c.default)((0,f.default)((0,f.default)(t)),"cancel",function(){var e=t.props.distance;t.state.sorting||(e||clearTimeout(t.pressTimer),t.manager.active=null)}),(0,c.default)((0,f.default)((0,f.default)(t)),"handlePress",function(e){try{var n=t.manager.getActive(),r=function(){if(n){var r=function(){var n,r,o,u,y,m,x=h.sortableInfo.index,w=(n=h,{bottom:A((r=window.getComputedStyle(n)).marginBottom),left:A(r.marginLeft),right:A(r.marginRight),top:A(r.marginTop)}),b=function(e){var t=window.getComputedStyle(e);return"grid"===t.display?{x:A(t.gridColumnGap),y:A(t.gridRowGap)}:{x:0,y:0}}(t.container),S=t.scrollContainer.getBoundingClientRect(),O=l({index:x,node:h,collection:p});if(t.node=h,t.margin=w,t.gridGap=b,t.width=O.width,t.height=O.height,t.marginOffset={x:t.margin.left+t.margin.right+t.gridGap.x,y:Math.max(t.margin.top,t.margin.bottom,t.gridGap.y)},t.boundingClientRect=h.getBoundingClientRect(),t.containerBoundingRect=S,t.index=x,t.newIndex=x,t.axis={x:a.indexOf("x")>=0,y:a.indexOf("y")>=0},t.offsetEdge=L(h,t.container),t.initialOffset=W(g?(0,i.default)({},e,{pageX:t.boundingClientRect.left,pageY:t.boundingClientRect.top}):e),t.initialScroll={left:t.scrollContainer.scrollLeft,top:t.scrollContainer.scrollTop},t.initialWindowScroll={left:window.pageXOffset,top:window.pageYOffset},t.helper=t.helperContainer.appendChild((u="input, textarea, select, canvas, [contenteditable]",y=(o=h).querySelectorAll(u),m=o.cloneNode(!0),(0,v.default)(m.querySelectorAll(u)).forEach(function(e,t){"file"!==e.type&&(e.value=y[t].value),"radio"===e.type&&e.name&&(e.name="__sortableClone__".concat(e.name)),e.tagName===X.Canvas&&y[t].width>0&&y[t].height>0&&e.getContext("2d").drawImage(y[t],0,0)}),m)),I(t.helper,{boxSizing:"border-box",height:"".concat(t.height,"px"),left:"".concat(t.boundingClientRect.left-w.left,"px"),pointerEvents:"none",position:"fixed",top:"".concat(t.boundingClientRect.top-w.top,"px"),width:"".concat(t.width,"px")}),g&&t.helper.focus(),d&&(t.sortableGhost=h,I(h,{opacity:0,visibility:"hidden"})),t.minTranslate={},t.maxTranslate={},g){var T=c?{top:0,left:0,width:t.contentWindow.innerWidth,height:t.contentWindow.innerHeight}:t.containerBoundingRect,k=T.top,E=T.left,R=T.width,D=k+T.height,N=E+R;t.axis.x&&(t.minTranslate.x=E-t.boundingClientRect.left,t.maxTranslate.x=N-(t.boundingClientRect.left+t.width)),t.axis.y&&(t.minTranslate.y=k-t.boundingClientRect.top,t.maxTranslate.y=D-(t.boundingClientRect.top+t.height))}else t.axis.x&&(t.minTranslate.x=(c?0:S.left)-t.boundingClientRect.left-t.width/2,t.maxTranslate.x=(c?t.contentWindow.innerWidth:S.left+S.width)-t.boundingClientRect.left-t.width/2),t.axis.y&&(t.minTranslate.y=(c?0:S.top)-t.boundingClientRect.top-t.height/2,t.maxTranslate.y=(c?t.contentWindow.innerHeight:S.top+S.height)-t.boundingClientRect.top-t.height/2);s&&s.split(" ").forEach(function(e){return t.helper.classList.add(e)}),t.listenerNode=e.touches?e.target:t.contentWindow,g?(t.listenerNode.addEventListener("wheel",t.handleKeyEnd,!0),t.listenerNode.addEventListener("mousedown",t.handleKeyEnd,!0),t.listenerNode.addEventListener("keydown",t.handleKeyDown)):(C.move.forEach(function(e){return t.listenerNode.addEventListener(e,t.handleSortMove,!1)}),C.end.forEach(function(e){return t.listenerNode.addEventListener(e,t.handleSortEnd,!1)})),t.setState({sorting:!0,sortingIndex:x}),f&&f({node:h,index:x,collection:p,isKeySorting:g,nodes:t.manager.getOrderedRefs(),helper:t.helper},e),g&&t.keyMove(0)},o=t.props,a=o.axis,l=o.getHelperDimensions,s=o.helperClass,d=o.hideSortableGhost,u=o.updateBeforeSortStart,f=o.onSortStart,c=o.useWindowAsScrollContainer,h=n.node,p=n.collection,g=t.manager.isKeySorting,y=function(){if("function"==typeof u){t._awaitingUpdateBeforeSortStart=!0;var n=function(e,t){try{var n=e()}catch(e){return t(!0,e)}return n&&n.then?n.then(t.bind(null,!1),t.bind(null,!0)):t(!1,value)}(function(){var t=h.sortableInfo.index;return Promise.resolve(u({collection:p,index:t,node:h,isKeySorting:g},e)).then(function(){})},function(e,n){if(t._awaitingUpdateBeforeSortStart=!1,e)throw n;return n});if(n&&n.then)return n.then(function(){})}}();return y&&y.then?y.then(r):r()}}();return Promise.resolve(r&&r.then?r.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}),(0,c.default)((0,f.default)((0,f.default)(t)),"handleSortMove",function(e){var n=t.props.onSortMove;"function"==typeof e.preventDefault&&e.cancelable&&e.preventDefault(),t.updateHelperPosition(e),t.animateNodes(),t.autoscroll(),n&&n(e)}),(0,c.default)((0,f.default)((0,f.default)(t)),"handleSortEnd",function(e){var n=t.props,r=n.hideSortableGhost,o=n.onSortEnd,i=t.manager,a=i.active.collection,l=i.isKeySorting,s=t.manager.getOrderedRefs();t.listenerNode&&(l?(t.listenerNode.removeEventListener("wheel",t.handleKeyEnd,!0),t.listenerNode.removeEventListener("mousedown",t.handleKeyEnd,!0),t.listenerNode.removeEventListener("keydown",t.handleKeyDown)):(C.move.forEach(function(e){return t.listenerNode.removeEventListener(e,t.handleSortMove)}),C.end.forEach(function(e){return t.listenerNode.removeEventListener(e,t.handleSortEnd)}))),t.helper.parentNode.removeChild(t.helper),r&&t.sortableGhost&&I(t.sortableGhost,{opacity:"",visibility:""});for(var d=0,u=s.length;d<u;d++){var f=s[d],c=f.node;f.edgeOffset=null,f.boundingClientRect=null,k(c,null),E(c,null),f.translate=null}t.autoScroller.clear(),t.manager.active=null,t.manager.isKeySorting=!1,t.setState({sorting:!1,sortingIndex:null}),"function"==typeof o&&o({collection:a,newIndex:t.newIndex,oldIndex:t.index,isKeySorting:l,nodes:s},e),t.touched=!1}),(0,c.default)((0,f.default)((0,f.default)(t)),"autoscroll",function(){var e=t.props.disableAutoscroll,n=t.manager.isKeySorting;if(e)t.autoScroller.clear();else{if(n){var r=(0,i.default)({},t.translate),o=0,a=0;return t.axis.x&&(r.x=Math.min(t.maxTranslate.x,Math.max(t.minTranslate.x,t.translate.x)),o=t.translate.x-r.x),t.axis.y&&(r.y=Math.min(t.maxTranslate.y,Math.max(t.minTranslate.y,t.translate.y)),a=t.translate.y-r.y),t.translate=r,k(t.helper,t.translate),t.scrollContainer.scrollLeft+=o,void(t.scrollContainer.scrollTop+=a)}t.autoScroller.update({height:t.height,maxTranslate:t.maxTranslate,minTranslate:t.minTranslate,translate:t.translate,width:t.width})}}),(0,c.default)((0,f.default)((0,f.default)(t)),"onAutoScroll",function(e){t.translate.x+=e.left,t.translate.y+=e.top,t.animateNodes()}),(0,c.default)((0,f.default)((0,f.default)(t)),"handleKeyDown",function(e){var n=e.keyCode,r=t.props,o=r.shouldCancelStart,a=r.keyCodes,l=void 0===a?{}:a,s=(0,i.default)({},z,l);t.manager.active&&!t.manager.isKeySorting||!(t.manager.active||s.lift.includes(n)&&!o(e)&&t.isValidSortingTarget(e))||(e.stopPropagation(),e.preventDefault(),s.lift.includes(n)&&!t.manager.active?t.keyLift(e):s.drop.includes(n)&&t.manager.active?t.keyDrop(e):s.cancel.includes(n)?(t.newIndex=t.manager.active.index,t.keyDrop(e)):s.up.includes(n)?t.keyMove(-1):s.down.includes(n)&&t.keyMove(1))}),(0,c.default)((0,f.default)((0,f.default)(t)),"keyLift",function(e){var n=e.target,r=R(n,function(e){return null!=e.sortableInfo}).sortableInfo,o=r.index,i=r.collection;t.initialFocusedNode=n,t.manager.isKeySorting=!0,t.manager.active={index:o,collection:i},t.handlePress(e)}),(0,c.default)((0,f.default)((0,f.default)(t)),"keyMove",function(e){var n=t.manager.getOrderedRefs(),r=n[n.length-1].node.sortableInfo.index,o=t.newIndex+e,i=t.newIndex;if(!(o<0||o>r)){t.prevIndex=i,t.newIndex=o;var a=function(e,t,n){return e<n&&e>t?e-1:e>n&&e<t?e+1:e}(t.newIndex,t.prevIndex,t.index),l=n.find(function(e){return e.node.sortableInfo.index===a}),s=l.node,d=t.containerScrollDelta,u=l.boundingClientRect||M(s,d),f=l.translate||{x:0,y:0},c=u.top+f.y-d.top,h=u.left+f.x-d.left,p=i<o,g=p&&t.axis.x?s.offsetWidth-t.width:0,y=p&&t.axis.y?s.offsetHeight-t.height:0;t.handleSortMove({pageX:h+g,pageY:c+y,ignoreTransition:0===e})}}),(0,c.default)((0,f.default)((0,f.default)(t)),"keyDrop",function(e){t.handleSortEnd(e),t.initialFocusedNode&&t.initialFocusedNode.focus()}),(0,c.default)((0,f.default)((0,f.default)(t)),"handleKeyEnd",function(e){t.manager.active&&t.keyDrop(e)}),(0,c.default)((0,f.default)((0,f.default)(t)),"isValidSortingTarget",function(e){var n=t.props.useDragHandle,r=e.target,o=R(r,function(e){return null!=e.sortableInfo});return o&&o.sortableInfo&&!o.sortableInfo.disabled&&(n?F(r):r.sortableInfo)});var r=new w;return function(e){y()(!(e.distance&&e.pressDelay),"Attempted to set both `pressDelay` and `distance` on SortableContainer, you may only use one or the other, not both at the same time.")}(e),t.manager=r,t.wrappedInstance=(0,h.createRef)(),t.sortableContextValue={manager:r},t.events={end:t.handleEnd,move:t.handleMove,start:t.handleStart},t}return(0,u.default)(n,t),(0,l.default)(n,[{key:"componentDidMount",value:function(){var e=this,t=this.props.useWindowAsScrollContainer,n=this.getContainer();Promise.resolve(n).then(function(n){e.container=n,e.document=e.container.ownerDocument||document;var r=e.props.contentWindow||e.document.defaultView||window;e.contentWindow="function"==typeof r?r():r,e.scrollContainer=t?e.document.scrollingElement||e.document.documentElement:j(e.container)||e.container,e.autoScroller=new V(e.scrollContainer,e.onAutoScroll),Object.keys(e.events).forEach(function(t){return C[t].forEach(function(n){return e.container.addEventListener(n,e.events[t],!1)})}),e.container.addEventListener("keydown",e.handleKeyDown)})}},{key:"componentWillUnmount",value:function(){var e=this;this.helper&&this.helper.parentNode&&this.helper.parentNode.removeChild(this.helper),this.container&&(Object.keys(this.events).forEach(function(t){return C[t].forEach(function(n){return e.container.removeEventListener(n,e.events[t])})}),this.container.removeEventListener("keydown",this.handleKeyDown))}},{key:"updateHelperPosition",value:function(e){var t=this.props,n=t.lockAxis,r=t.lockOffset,i=t.lockToContainerEdges,a=t.transitionDuration,l=t.keyboardSortingTransitionDuration,s=void 0===l?a:l,d=this.manager.isKeySorting,u=e.ignoreTransition,f=W(e),c={x:f.x-this.initialOffset.x,y:f.y-this.initialOffset.y};if(c.y-=window.pageYOffset-this.initialWindowScroll.top,c.x-=window.pageXOffset-this.initialWindowScroll.left,this.translate=c,i){var h=function(e){var t=e.height,n=e.width,r=e.lockOffset,i=Array.isArray(r)?r:[r,r];y()(2===i.length,"lockOffset prop of SortableContainer should be a single value or an array of exactly two values. Given %s",r);var a=(0,o.default)(i,2),l=a[0],s=a[1];return[P({height:t,lockOffset:l,width:n}),P({height:t,lockOffset:s,width:n})]}({height:this.height,lockOffset:r,width:this.width}),p=(0,o.default)(h,2),g=p[0],v=p[1],m={x:this.width/2-g.x,y:this.height/2-g.y},x={x:this.width/2-v.x,y:this.height/2-v.y};c.x=D(this.minTranslate.x+m.x,this.maxTranslate.x-x.x,c.x),c.y=D(this.minTranslate.y+m.y,this.maxTranslate.y-x.y,c.y)}"x"===n?c.y=0:"y"===n&&(c.x=0),d&&s&&!u&&E(this.helper,s),k(this.helper,c)}},{key:"animateNodes",value:function(){var e=this.props,t=e.transitionDuration,n=e.hideSortableGhost,r=e.onSortOver,o=this.containerScrollDelta,i=this.windowScrollDelta,a=this.manager.getOrderedRefs(),l=this.offsetEdge.left+this.translate.x+o.left,s=this.offsetEdge.top+this.translate.y+o.top,d=this.manager.isKeySorting,u=this.newIndex;this.newIndex=null;for(var f=0,c=a.length;f<c;f++){var h=a[f].node,p=h.sortableInfo.index,g=h.offsetWidth,y=h.offsetHeight,v={height:this.height>y?y/2:this.height/2,width:this.width>g?g/2:this.width/2},m=d&&p>this.index&&p<=u,x=d&&p<this.index&&p>=u,w={x:0,y:0},b=a[f].edgeOffset;b||(b=L(h,this.container),a[f].edgeOffset=b,d&&(a[f].boundingClientRect=M(h,o)));var S=f<a.length-1&&a[f+1],O=f>0&&a[f-1];S&&!S.edgeOffset&&(S.edgeOffset=L(S.node,this.container),d&&(S.boundingClientRect=M(S.node,o))),p!==this.index?(t&&E(h,t),this.axis.x?this.axis.y?x||p<this.index&&(l+i.left-v.width<=b.left&&s+i.top<=b.top+v.height||s+i.top+v.height<=b.top)?(w.x=this.width+this.marginOffset.x,b.left+w.x>this.containerBoundingRect.width-v.width&&S&&(w.x=S.edgeOffset.left-b.left,w.y=S.edgeOffset.top-b.top),null===this.newIndex&&(this.newIndex=p)):(m||p>this.index&&(l+i.left+v.width>=b.left&&s+i.top+v.height>=b.top||s+i.top+v.height>=b.top+y))&&(w.x=-(this.width+this.marginOffset.x),b.left+w.x<this.containerBoundingRect.left+v.width&&O&&(w.x=O.edgeOffset.left-b.left,w.y=O.edgeOffset.top-b.top),this.newIndex=p):m||p>this.index&&l+i.left+v.width>=b.left?(w.x=-(this.width+this.marginOffset.x),this.newIndex=p):(x||p<this.index&&l+i.left<=b.left+v.width)&&(w.x=this.width+this.marginOffset.x,null==this.newIndex&&(this.newIndex=p)):this.axis.y&&(m||p>this.index&&s+i.top+v.height>=b.top?(w.y=-(this.height+this.marginOffset.y),this.newIndex=p):(x||p<this.index&&s+i.top<=b.top+v.height)&&(w.y=this.height+this.marginOffset.y,null==this.newIndex&&(this.newIndex=p))),k(h,w),a[f].translate=w):n&&(this.sortableGhost=h,I(h,{opacity:0,visibility:"hidden"}))}null==this.newIndex&&(this.newIndex=this.index),d&&(this.newIndex=u);var C=d?this.prevIndex:u;r&&this.newIndex!==C&&r({collection:this.manager.active.collection,index:this.index,newIndex:this.newIndex,oldIndex:C,isKeySorting:d,nodes:a,helper:this.helper})}},{key:"getWrappedInstance",value:function(){return y()(g.withRef,"To access the wrapped instance, you need to pass in {withRef: true} as the second argument of the SortableContainer() call"),this.wrappedInstance.current}},{key:"getContainer",value:function(){var e=this.props.getContainer;return"function"!=typeof e?(0,p.findDOMNode)(this):e(g.withRef?this.getWrappedInstance():void 0)}},{key:"render",value:function(){var t=g.withRef?this.wrappedInstance:null;return(0,h.createElement)(Q.Provider,{value:this.sortableContextValue},(0,h.createElement)(e,(0,r.default)({ref:t},O(this.props,J))))}},{key:"helperContainer",get:function(){var e=this.props.helperContainer;return"function"==typeof e?e():this.props.helperContainer||this.document.body}},{key:"containerScrollDelta",get:function(){return this.props.useWindowAsScrollContainer?{left:0,top:0}:{left:this.scrollContainer.scrollLeft-this.initialScroll.left,top:this.scrollContainer.scrollTop-this.initialScroll.top}}},{key:"windowScrollDelta",get:function(){return{left:this.contentWindow.pageXOffset-this.initialWindowScroll.left,top:this.contentWindow.pageYOffset-this.initialWindowScroll.top}}}]),n}(h.Component),(0,c.default)(t,"displayName",N("sortableList",e)),(0,c.default)(t,"defaultProps",$),(0,c.default)(t,"propTypes",q),n}var ee={index:x().number.isRequired,collection:x().oneOfType([x().number,x().string]),disabled:x().bool},te=Object.keys(ee);function ne(e){var t,n,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{withRef:!1};return n=t=function(t){function n(){var e,t;(0,a.default)(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return t=(0,s.default)(this,(e=(0,d.default)(n)).call.apply(e,[this].concat(o))),(0,c.default)((0,f.default)((0,f.default)(t)),"wrappedInstance",(0,h.createRef)()),t}return(0,u.default)(n,t),(0,l.default)(n,[{key:"componentDidMount",value:function(){this.register()}},{key:"componentDidUpdate",value:function(e){this.node&&(e.index!==this.props.index&&(this.node.sortableInfo.index=this.props.index),e.disabled!==this.props.disabled&&(this.node.sortableInfo.disabled=this.props.disabled)),e.collection!==this.props.collection&&(this.unregister(e.collection),this.register())}},{key:"componentWillUnmount",value:function(){this.unregister()}},{key:"register",value:function(){var e=this.props,t=e.collection,n=e.disabled,r=e.index,o=(0,p.findDOMNode)(this);o.sortableInfo={collection:t,disabled:n,index:r,manager:this.context.manager},this.node=o,this.ref={node:o},this.context.manager.add(t,this.ref)}},{key:"unregister",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props.collection;this.context.manager.remove(e,this.ref)}},{key:"getWrappedInstance",value:function(){return y()(o.withRef,"To access the wrapped instance, you need to pass in {withRef: true} as the second argument of the SortableElement() call"),this.wrappedInstance.current}},{key:"render",value:function(){var t=o.withRef?this.wrappedInstance:null;return(0,h.createElement)(e,(0,r.default)({ref:t},O(this.props,te)))}}]),n}(h.Component),(0,c.default)(t,"displayName",N("sortableElement",e)),(0,c.default)(t,"contextType",Q),(0,c.default)(t,"propTypes",ee),(0,c.default)(t,"defaultProps",{collection:0}),n}},418:(e,t,n)=>{n.r(t),n.d(t,{default:()=>l});var r=n(419),o=n(420),i=n(421),a=n(423);function l(e,t){return(0,r.default)(e)||(0,o.default)(e,t)||(0,i.default)(e,t)||(0,a.default)()}},419:(e,t,n)=>{function r(e){if(Array.isArray(e))return e}n.r(t),n.d(t,{default:()=>r})},420:(e,t,n)=>{function r(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,l=[],s=!0,d=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){d=!0,o=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(d)throw o}}return l}}n.r(t),n.d(t,{default:()=>r})},421:(e,t,n)=>{n.r(t),n.d(t,{default:()=>o});var r=n(422);function o(e,t){if(e){if("string"==typeof e)return(0,r.default)(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?(0,r.default)(e,t):void 0}}},422:(e,t,n)=>{function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}n.r(t),n.d(t,{default:()=>r})},423:(e,t,n)=>{function r(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}n.r(t),n.d(t,{default:()=>r})},424:(e,t,n)=>{n.r(t),n.d(t,{default:()=>o});var r=n(12);function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&o.push.apply(o,Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})),o.forEach(function(t){(0,r.default)(e,t,n[t])})}return e}},425:(e,t,n)=>{function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}n.r(t),n.d(t,{default:()=>r})},426:(e,t,n)=>{n.r(t),n.d(t,{default:()=>i});var r=n(13);function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,(0,r.default)(o.key),o)}}function i(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}},427:(e,t,n)=>{n.r(t),n.d(t,{default:()=>i});var r=n(14),o=n(271);function i(e,t){if(t&&("object"==(0,r.default)(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return(0,o.default)(e)}},428:(e,t,n)=>{function r(e){return r=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},r(e)}n.r(t),n.d(t,{default:()=>r})},429:(e,t,n)=>{n.r(t),n.d(t,{default:()=>o});var r=n(96);function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&(0,r.default)(e,t)}},430:e=>{e.exports=function(e,t,n,r,o,i,a,l){if(!e){var s;if(void 0===t)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var d=[n,r,o,i,a,l],u=0;(s=new Error(t.replace(/%s/g,function(){return d[u++]}))).name="Invariant Violation"}throw s.framesToPop=1,s}}},431:(e,t,n)=>{n.r(t),n.d(t,{default:()=>l});var r=n(432),o=n(433),i=n(421),a=n(434);function l(e){return(0,r.default)(e)||(0,o.default)(e)||(0,i.default)(e)||(0,a.default)()}},432:(e,t,n)=>{n.r(t),n.d(t,{default:()=>o});var r=n(422);function o(e){if(Array.isArray(e))return(0,r.default)(e)}},433:(e,t,n)=>{function r(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}n.r(t),n.d(t,{default:()=>r})},434:(e,t,n)=>{function r(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}n.r(t),n.d(t,{default:()=>r})}}]);
//# sourceMappingURL=react-sortable-hoc.min.js.map?420235ec67d3e35dfb62