You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
NewEduCoderBuild/2191.async.js

1 line
28 KiB

"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[2191],{32134:function(e,t,n){n.d(t,{Z:function(){return s}});var i=n(5016),o=n(59301),r={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M696 480H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z"}},{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"plus-circle",theme:"outlined"},a=n(7657),l=function(e,t){return o.createElement(a.Z,(0,i.Z)({},e,{ref:t,icon:r}))};var s=o.forwardRef(l)},28103:function(e,t,n){n.d(t,{Z:function(){return u}});var i=n(92310),o=n.n(i),r=n(59301),a=n(36355),l=n(17313),s=n(83116),d=n(37613);const c=e=>{const{componentCls:t,sizePaddingEdgeHorizontal:n,colorSplit:i,lineWidth:o,textPaddingInline:r,orientationMargin:a,verticalMarginInline:s}=e;return{[t]:Object.assign(Object.assign({},(0,l.Wf)(e)),{borderBlockStart:`${o}px solid ${i}`,"&-vertical":{position:"relative",top:"-0.06em",display:"inline-block",height:"0.9em",marginInline:s,marginBlock:0,verticalAlign:"middle",borderTop:0,borderInlineStart:`${o}px solid ${i}`},"&-horizontal":{display:"flex",clear:"both",width:"100%",minWidth:"100%",margin:`${e.dividerHorizontalGutterMargin}px 0`},[`&-horizontal${t}-with-text`]:{display:"flex",alignItems:"center",margin:`${e.dividerHorizontalWithTextGutterMargin}px 0`,color:e.colorTextHeading,fontWeight:500,fontSize:e.fontSizeLG,whiteSpace:"nowrap",textAlign:"center",borderBlockStart:`0 ${i}`,"&::before, &::after":{position:"relative",width:"50%",borderBlockStart:`${o}px solid transparent`,borderBlockStartColor:"inherit",borderBlockEnd:0,transform:"translateY(50%)",content:"''"}},[`&-horizontal${t}-with-text-left`]:{"&::before":{width:100*a+"%"},"&::after":{width:100-100*a+"%"}},[`&-horizontal${t}-with-text-right`]:{"&::before":{width:100-100*a+"%"},"&::after":{width:100*a+"%"}},[`${t}-inner-text`]:{display:"inline-block",paddingBlock:0,paddingInline:r},"&-dashed":{background:"none",borderColor:i,borderStyle:"dashed",borderWidth:`${o}px 0 0`},[`&-horizontal${t}-with-text${t}-dashed`]:{"&::before, &::after":{borderStyle:"dashed none none"}},[`&-vertical${t}-dashed`]:{borderInlineStartWidth:o,borderInlineEnd:0,borderBlockStart:0,borderBlockEnd:0},[`&-plain${t}-with-text`]:{color:e.colorText,fontWeight:"normal",fontSize:e.fontSize},[`&-horizontal${t}-with-text-left${t}-no-default-orientation-margin-left`]:{"&::before":{width:0},"&::after":{width:"100%"},[`${t}-inner-text`]:{paddingInlineStart:n}},[`&-horizontal${t}-with-text-right${t}-no-default-orientation-margin-right`]:{"&::before":{width:"100%"},"&::after":{width:0},[`${t}-inner-text`]:{paddingInlineEnd:n}}})}};var h=(0,s.Z)("Divider",(e=>{const t=(0,d.TS)(e,{dividerHorizontalWithTextGutterMargin:e.margin,dividerHorizontalGutterMargin:e.marginLG,sizePaddingEdgeHorizontal:0});return[c(t)]}),(e=>({textPaddingInline:"1em",orientationMargin:.05,verticalMarginInline:e.marginXS}))),f=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]])}return n};var u=e=>{const{getPrefixCls:t,direction:n,divider:i}=r.useContext(a.E_),{prefixCls:l,type:s="horizontal",orientation:d="center",orientationMargin:c,className:u,rootClassName:p,children:g,dashed:x,plain:m,style:y}=e,v=f(e,["prefixCls","type","orientation","orientationMargin","className","rootClassName","children","dashed","plain","style"]),w=t("divider",l),[b,S]=h(w),C=d.length>0?`-${d}`:d,k=!!g,O="left"===d&&null!=c,Z="right"===d&&null!=c,T=o()(w,null==i?void 0:i.className,S,`${w}-${s}`,{[`${w}-with-text`]:k,[`${w}-with-text${C}`]:k,[`${w}-dashed`]:!!x,[`${w}-plain`]:!!m,[`${w}-rtl`]:"rtl"===n,[`${w}-no-default-orientation-margin-left`]:O,[`${w}-no-default-orientation-margin-right`]:Z},u,p),I=r.useMemo((()=>"number"==typeof c?c:/^\d+$/.test(c)?Number(c):c),[c]),E=Object.assign(Object.assign({},O&&{marginLeft:I}),Z&&{marginRight:I});return b(r.createElement("div",Object.assign({className:T,style:Object.assign(Object.assign({},null==i?void 0:i.style),y)},v,{role:"separator"}),g&&"vertical"!==s&&r.createElement("span",{className:`${w}-inner-text`,style:E},g)))}},39180:function(e){const t=(e,t,n)=>{const i=t<0?e.length+t:t;if(i>=0&&i<e.length){const i=n<0?e.length+n:n,[o]=e.splice(t,1);e.splice(i,0,o)}};e.exports=(e,n,i)=>(e=[...e],t(e,n,i),e),e.exports.mutate=t},44589:function(e,t,n){n.d(t,{JN:function(){return ce},W8:function(){return ue}});var i=n(5016),o=n(52456),r=n(76267),a=n(6487),l=n(56789),s=n(96233),d=n(7828),c=n(7942),h=n(41281),f=n(18082),u=n(59301),p=n(12708),g=n.n(p),x=n(4676),m=n(44520),y=n.n(m),v=n(92393),w=function(){function e(){(0,a.Z)(this,e),(0,f.Z)(this,"refs",{})}return(0,l.Z)(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){return Object.keys(e).reduce((function(n,i){return-1===t.indexOf(i)&&(n[i]=e[i]),n}),{})}var C={end:["touchend","touchcancel","mouseup"],move:["touchmove","mousemove"],start:["touchstart","mousedown"]},k=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 O(e,t){Object.keys(t).forEach((function(n){e.style[n]=t[n]}))}function Z(e,t){e.style["".concat(k,"Transform")]=null==t?"":"translate3d(".concat(t.x,"px,").concat(t.y,"px,0)")}function T(e,t){e.style["".concat(k,"TransitionDuration")]=null==t?"":"".concat(t,"ms")}function I(e,t){for(;e;){if(t(e))return e;e=e.parentNode}return null}function E(e,t,n){return Math.max(e,Math.min(n,t))}function N(e){return"px"===e.substr(-2)?parseFloat(e):0}function R(e){var t=window.getComputedStyle(e);return{bottom:N(t.marginBottom),left:N(t.marginLeft),right:N(t.marginRight),top:N(t.marginTop)}}function M(e,t){var n=t.displayName||t.name;return n?"".concat(e,"(").concat(n,")"):e}function D(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 $(e){return e.touches&&e.touches.length||e.changedTouches&&e.changedTouches.length}function L(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{left:0,top:0};if(e){var i={left:n.left+e.offsetLeft,top:n.top+e.offsetTop};return e.parentNode===t?i:L(e.parentNode,t,i)}}function A(e,t,n){return e<n&&e>t?e-1:e>n&&e<t?e+1:e}function H(e){var t=e.lockOffset,n=e.width,i=e.height,o=t,r=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),r=parseFloat(t),a=l[1]}return y()(isFinite(o)&&isFinite(r),"lockOffset value should be a finite. Given %s",t),"%"===a&&(o=o*n/100,r=r*i/100),{x:o,y:r}}function z(e){var t=e.height,n=e.width,i=e.lockOffset,r=Array.isArray(i)?i:[i,i];y()(2===r.length,"lockOffset prop of SortableContainer should be a single value or an array of exactly two values. Given %s",i);var a=(0,o.Z)(r,2),l=a[0],s=a[1];return[H({height:t,lockOffset:l,width:n}),H({height:t,lockOffset:s,width:n})]}function B(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:B(e.parentNode):null}function P(e){var t=window.getComputedStyle(e);return"grid"===t.display?{x:N(t.gridColumnGap),y:N(t.gridRowGap)}:{x:0,y:0}}var G=27,K=32,j=37,X=38,Y=39,U=40,F="A",_="BUTTON",V="CANVAS",q="INPUT",J="OPTION",Q="TEXTAREA",ee="SELECT";function te(e){var t="input, textarea, select, canvas, [contenteditable]",n=e.querySelectorAll(t),i=e.cloneNode(!0);return(0,v.Z)(i.querySelectorAll(t)).forEach((function(e,t){("file"!==e.type&&(e.value=n[t].value),"radio"===e.type&&e.name&&(e.name="__sortableClone__".concat(e.name)),e.tagName===V&&n[t].width>0&&n[t].height>0)&&e.getContext("2d").drawImage(n[t],0,0)})),i}function ne(e){return null!=e.sortableHandle}var ie=function(){function e(t,n){(0,a.Z)(this,e),this.container=t,this.onScrollCallback=n}return(0,l.Z)(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,i=e.minTranslate,o=e.maxTranslate,r=e.width,a=e.height,l={x:0,y:0},s={x:1,y:1},d=10,c=10,h=this.container,f=h.scrollTop,u=h.scrollLeft,p=h.scrollHeight,g=h.scrollWidth,x=0===f,m=p-f-h.clientHeight==0,y=0===u,v=g-u-h.clientWidth==0;n.y>=o.y-a/2&&!m?(l.y=1,s.y=c*Math.abs((o.y-a/2-n.y)/a)):n.x>=o.x-r/2&&!v?(l.x=1,s.x=d*Math.abs((o.x-r/2-n.x)/r)):n.y<=i.y+a/2&&!x?(l.y=-1,s.y=c*Math.abs((n.y-a/2-i.y)/a)):n.x<=i.x+r/2&&!y&&(l.x=-1,s.x=d*Math.abs((n.x-r/2-i.x)/r)),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 oe={axis:g().oneOf(["x","y","xy"]),contentWindow:g().any,disableAutoscroll:g().bool,distance:g().number,getContainer:g().func,getHelperDimensions:g().func,helperClass:g().string,helperContainer:g().oneOfType([g().func,"undefined"==typeof HTMLElement?g().any:g().instanceOf(HTMLElement)]),hideSortableGhost:g().bool,keyboardSortingTransitionDuration:g().number,lockAxis:g().string,lockOffset:g().oneOfType([g().number,g().string,g().arrayOf(g().oneOfType([g().number,g().string]))]),lockToContainerEdges:g().bool,onSortEnd:g().func,onSortMove:g().func,onSortOver:g().func,onSortStart:g().func,pressDelay:g().number,pressThreshold:g().number,keyCodes:g().shape({lift:g().arrayOf(g().number),drop:g().arrayOf(g().number),cancel:g().arrayOf(g().number),up:g().arrayOf(g().number),down:g().arrayOf(g().number)}),shouldCancelStart:g().func,transitionDuration:g().number,updateBeforeSortStart:g().func,useDragHandle:g().bool,useWindowAsScrollContainer:g().bool},re={lift:[K],drop:[K],cancel:[G],up:[X,j],down:[U,Y]},ae={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:re,shouldCancelStart:function(e){return-1!==[q,Q,ee,J,_].indexOf(e.target.tagName)||!!I(e.target,(function(e){return"true"===e.contentEditable}))},transitionDuration:300,useWindowAsScrollContainer:!1},le=Object.keys(oe);function se(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.")}function de(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 ce(e){var t,n,p=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{withRef:!1};return n=t=function(t){function n(e){var t;return(0,a.Z)(this,n),t=(0,s.Z)(this,(0,d.Z)(n).call(this,e)),(0,f.Z)((0,h.Z)((0,h.Z)(t)),"state",{}),(0,f.Z)((0,h.Z)((0,h.Z)(t)),"handleStart",(function(e){var n=t.props,i=n.distance,o=n.shouldCancelStart;if(2!==e.button&&!o(e)){t.touched=!0,t.position=W(e);var r=I(e.target,(function(e){return null!=e.sortableInfo}));if(r&&r.sortableInfo&&t.nodeIsChild(r)&&!t.state.sorting){var a=t.props.useDragHandle,l=r.sortableInfo,s=l.index,d=l.collection;if(l.disabled)return;if(a&&!I(e.target,ne))return;t.manager.active={collection:d,index:s},$(e)||e.target.tagName!==F||e.preventDefault(),i||(0===t.props.pressDelay?t.handlePress(e):t.pressTimer=setTimeout((function(){return t.handlePress(e)}),t.props.pressDelay))}}})),(0,f.Z)((0,h.Z)((0,h.Z)(t)),"nodeIsChild",(function(e){return e.sortableInfo.manager===t.manager})),(0,f.Z)((0,h.Z)((0,h.Z)(t)),"handleMove",(function(e){var n=t.props,i=n.distance,o=n.pressThreshold;if(!t.state.sorting&&t.touched&&!t._awaitingUpdateBeforeSortStart){var r=W(e),a={x:t.position.x-r.x,y:t.position.y-r.y},l=Math.abs(a.x)+Math.abs(a.y);t.delta=a,i||o&&!(l>=o)?i&&l>=i&&t.manager.isActive()&&t.handlePress(e):(clearTimeout(t.cancelTimer),t.cancelTimer=setTimeout(t.cancel,0))}})),(0,f.Z)((0,h.Z)((0,h.Z)(t)),"handleEnd",(function(){t.touched=!1,t.cancel()})),(0,f.Z)((0,h.Z)((0,h.Z)(t)),"cancel",(function(){var e=t.props.distance;t.state.sorting||(e||clearTimeout(t.pressTimer),t.manager.active=null)})),(0,f.Z)((0,h.Z)((0,h.Z)(t)),"handlePress",(function(e){try{var n=t.manager.getActive(),i=function(){if(n){var i=function(){var n=u.sortableInfo.index,i=R(u),o=P(t.container),c=t.scrollContainer.getBoundingClientRect(),x=l({index:n,node:u,collection:p});if(t.node=u,t.margin=i,t.gridGap=o,t.width=x.width,t.height=x.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=u.getBoundingClientRect(),t.containerBoundingRect=c,t.index=n,t.newIndex=n,t.axis={x:a.indexOf("x")>=0,y:a.indexOf("y")>=0},t.offsetEdge=L(u,t.container),t.initialOffset=W(g?(0,r.Z)({},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(te(u)),O(t.helper,{boxSizing:"border-box",height:"".concat(t.height,"px"),left:"".concat(t.boundingClientRect.left-i.left,"px"),pointerEvents:"none",position:"fixed",top:"".concat(t.boundingClientRect.top-i.top,"px"),width:"".concat(t.width,"px")}),g&&t.helper.focus(),d&&(t.sortableGhost=u,O(u,{opacity:0,visibility:"hidden"})),t.minTranslate={},t.maxTranslate={},g){var m=f?{top:0,left:0,width:t.contentWindow.innerWidth,height:t.contentWindow.innerHeight}:t.containerBoundingRect,y=m.top,v=m.left,w=m.width,b=y+m.height,S=v+w;t.axis.x&&(t.minTranslate.x=v-t.boundingClientRect.left,t.maxTranslate.x=S-(t.boundingClientRect.left+t.width)),t.axis.y&&(t.minTranslate.y=y-t.boundingClientRect.top,t.maxTranslate.y=b-(t.boundingClientRect.top+t.height))}else t.axis.x&&(t.minTranslate.x=(f?0:c.left)-t.boundingClientRect.left-t.width/2,t.maxTranslate.x=(f?t.contentWindow.innerWidth:c.left+c.width)-t.boundingClientRect.left-t.width/2),t.axis.y&&(t.minTranslate.y=(f?0:c.top)-t.boundingClientRect.top-t.height/2,t.maxTranslate.y=(f?t.contentWindow.innerHeight:c.top+c.height)-t.boundingClientRect.top-t.height/2);s&&s.split(" ").forEach((function(e){return t.helper.classList.add(e)})),t.listenerNode=e.touches?u: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:n}),h&&h({node:u,index:n,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,c=o.updateBeforeSortStart,h=o.onSortStart,f=o.useWindowAsScrollContainer,u=n.node,p=n.collection,g=t.manager.isKeySorting,x=function(){if("function"==typeof c){t._awaitingUpdateBeforeSortStart=!0;var n=de((function(){var t=u.sortableInfo.index;return Promise.resolve(c({collection:p,index:t,node:u,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 x&&x.then?x.then(i):i()}}();return Promise.resolve(i&&i.then?i.then((function(){})):void 0)}catch(e){return Promise.reject(e)}})),(0,f.Z)((0,h.Z)((0,h.Z)(t)),"handleSortMove",(function(e){var n=t.props.onSortMove;"function"==typeof e.preventDefault&&e.preventDefault(),t.updateHelperPosition(e),t.animateNodes(),t.autoscroll(),n&&n(e)})),(0,f.Z)((0,h.Z)((0,h.Z)(t)),"handleSortEnd",(function(e){var n=t.props,i=n.hideSortableGhost,o=n.onSortEnd,r=t.manager,a=r.active.collection,l=r.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),i&&t.sortableGhost&&O(t.sortableGhost,{opacity:"",visibility:""});for(var d=0,c=s.length;d<c;d++){var h=s[d],f=h.node;h.edgeOffset=null,h.boundingClientRect=null,Z(f,null),T(f,null),h.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,f.Z)((0,h.Z)((0,h.Z)(t)),"autoscroll",(function(){var e=t.props.disableAutoscroll,n=t.manager.isKeySorting;if(e)t.autoScroller.clear();else{if(n){var i=(0,r.Z)({},t.translate),o=0,a=0;return t.axis.x&&(i.x=Math.min(t.maxTranslate.x,Math.max(t.minTranslate.x,t.translate.x)),o=t.translate.x-i.x),t.axis.y&&(i.y=Math.min(t.maxTranslate.y,Math.max(t.minTranslate.y,t.translate.y)),a=t.translate.y-i.y),t.translate=i,Z(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,f.Z)((0,h.Z)((0,h.Z)(t)),"onAutoScroll",(function(e){t.translate.x+=e.left,t.translate.y+=e.top,t.animateNodes()})),(0,f.Z)((0,h.Z)((0,h.Z)(t)),"handleKeyDown",(function(e){var n=e.keyCode,i=t.props,o=i.shouldCancelStart,a=i.keyCodes,l=void 0===a?{}:a,s=(0,r.Z)({},re,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,f.Z)((0,h.Z)((0,h.Z)(t)),"keyLift",(function(e){var n=e.target,i=I(n,(function(e){return null!=e.sortableInfo})).sortableInfo,o=i.index,r=i.collection;t.initialFocusedNode=n,t.manager.isKeySorting=!0,t.manager.active={index:o,collection:r},t.handlePress(e)})),(0,f.Z)((0,h.Z)((0,h.Z)(t)),"keyMove",(function(e){var n=t.manager.getOrderedRefs(),i=n[n.length-1].node.sortableInfo.index,o=t.newIndex+e,r=t.newIndex;if(!(o<0||o>i)){t.prevIndex=r,t.newIndex=o;var a=A(t.newIndex,t.prevIndex,t.index),l=n.find((function(e){return e.node.sortableInfo.index===a})),s=l.node,d=t.containerScrollDelta,c=l.boundingClientRect||D(s,d),h=l.translate||{x:0,y:0},f=c.top+h.y-d.top,u=c.left+h.x-d.left,p=r<o,g=p&&t.axis.x?s.offsetWidth-t.width:0,x=p&&t.axis.y?s.offsetHeight-t.height:0;t.handleSortMove({pageX:u+g,pageY:f+x,ignoreTransition:0===e})}})),(0,f.Z)((0,h.Z)((0,h.Z)(t)),"keyDrop",(function(e){t.handleSortEnd(e),t.initialFocusedNode&&t.initialFocusedNode.focus()})),(0,f.Z)((0,h.Z)((0,h.Z)(t)),"handleKeyEnd",(function(e){t.manager.active&&t.keyDrop(e)})),(0,f.Z)((0,h.Z)((0,h.Z)(t)),"isValidSortingTarget",(function(e){var n=t.props.useDragHandle,i=e.target,o=I(i,(function(e){return null!=e.sortableInfo}));return o&&o.sortableInfo&&!o.sortableInfo.disabled&&(n?ne(i):i.sortableInfo)})),se(e),t.manager=new w,t.events={end:t.handleEnd,move:t.handleMove,start:t.handleStart},t}return(0,c.Z)(n,t),(0,l.Z)(n,[{key:"getChildContext",value:function(){return{manager:this.manager}}},{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 i=e.props.contentWindow||e.document.defaultView||window;e.contentWindow="function"==typeof i?i():i,e.scrollContainer=t?e.document.scrollingElement||e.document.documentElement:B(e.container)||e.container,e.autoScroller=new ie(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,i=t.lockOffset,r=t.lockToContainerEdges,a=t.transitionDuration,l=t.keyboardSortingTransitionDuration,s=void 0===l?a:l,d=this.manager.isKeySorting,c=e.ignoreTransition,h=W(e),f={x:h.x-this.initialOffset.x,y:h.y-this.initialOffset.y};if(f.y-=window.pageYOffset-this.initialWindowScroll.top,f.x-=window.pageXOffset-this.initialWindowScroll.left,this.translate=f,r){var u=z({height:this.height,lockOffset:i,width:this.width}),p=(0,o.Z)(u,2),g=p[0],x=p[1],m={x:this.width/2-g.x,y:this.height/2-g.y},y={x:this.width/2-x.x,y:this.height/2-x.y};f.x=E(this.minTranslate.x+m.x,this.maxTranslate.x-y.x,f.x),f.y=E(this.minTranslate.y+m.y,this.maxTranslate.y-y.y,f.y)}"x"===n?f.y=0:"y"===n&&(f.x=0),d&&s&&!c&&T(this.helper,s),Z(this.helper,f)}},{key:"animateNodes",value:function(){var e=this.props,t=e.transitionDuration,n=e.hideSortableGhost,i=e.onSortOver,o=this.containerScrollDelta,r=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,c=this.newIndex;this.newIndex=null;for(var h=0,f=a.length;h<f;h++){var u=a[h].node,p=u.sortableInfo.index,g=u.offsetWidth,x=u.offsetHeight,m={height:this.height>x?x/2:this.height/2,width:this.width>g?g/2:this.width/2},y=d&&p>this.index&&p<=c,v=d&&p<this.index&&p>=c,w={x:0,y:0},b=a[h].edgeOffset;b||(b=L(u,this.container),a[h].edgeOffset=b,d&&(a[h].boundingClientRect=D(u,o)));var S=h<a.length-1&&a[h+1],C=h>0&&a[h-1];S&&!S.edgeOffset&&(S.edgeOffset=L(S.node,this.container),d&&(S.boundingClientRect=D(S.node,o))),p!==this.index?(t&&T(u,t),this.axis.x?this.axis.y?v||p<this.index&&(l+r.left-m.width<=b.left&&s+r.top<=b.top+m.height||s+r.top+m.height<=b.top)?(w.x=this.width+this.marginOffset.x,b.left+w.x>this.containerBoundingRect.width-m.width&&S&&(w.x=S.edgeOffset.left-b.left,w.y=S.edgeOffset.top-b.top),null===this.newIndex&&(this.newIndex=p)):(y||p>this.index&&(l+r.left+m.width>=b.left&&s+r.top+m.height>=b.top||s+r.top+m.height>=b.top+x))&&(w.x=-(this.width+this.marginOffset.x),b.left+w.x<this.containerBoundingRect.left+m.width&&C&&(w.x=C.edgeOffset.left-b.left,w.y=C.edgeOffset.top-b.top),this.newIndex=p):y||p>this.index&&l+r.left+m.width>=b.left?(w.x=-(this.width+this.marginOffset.x),this.newIndex=p):(v||p<this.index&&l+r.left<=b.left+m.width)&&(w.x=this.width+this.marginOffset.x,null==this.newIndex&&(this.newIndex=p)):this.axis.y&&(y||p>this.index&&s+r.top+m.height>=b.top?(w.y=-(this.height+this.marginOffset.y),this.newIndex=p):(v||p<this.index&&s+r.top<=b.top+m.height)&&(w.y=this.height+this.marginOffset.y,null==this.newIndex&&(this.newIndex=p))),Z(u,w),a[h].translate=w):n&&(this.sortableGhost=u,O(u,{opacity:0,visibility:"hidden"}))}null==this.newIndex&&(this.newIndex=this.index),d&&(this.newIndex=c);var k=d?this.prevIndex:c;i&&this.newIndex!==k&&i({collection:this.manager.active.collection,index:this.index,newIndex:this.newIndex,oldIndex:k,isKeySorting:d,nodes:a,helper:this.helper})}},{key:"getWrappedInstance",value:function(){return y()(p.withRef,"To access the wrapped instance, you need to pass in {withRef: true} as the second argument of the SortableContainer() call"),this.refs.wrappedInstance}},{key:"getContainer",value:function(){var e=this.props.getContainer;return"function"!=typeof e?(0,x.findDOMNode)(this):e(p.withRef?this.getWrappedInstance():void 0)}},{key:"render",value:function(){var t=p.withRef?"wrappedInstance":null;return(0,u.createElement)(e,(0,i.Z)({ref:t},S(this.props,le)))}},{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}(u.Component),(0,f.Z)(t,"displayName",M("sortableList",e)),(0,f.Z)(t,"defaultProps",ae),(0,f.Z)(t,"propTypes",oe),(0,f.Z)(t,"childContextTypes",{manager:g().object.isRequired}),n}var he={index:g().number.isRequired,collection:g().oneOfType([g().number,g().string]),disabled:g().bool},fe=Object.keys(he);function ue(e){var t,n,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{withRef:!1};return n=t=function(t){function n(){return(0,a.Z)(this,n),(0,s.Z)(this,(0,d.Z)(n).apply(this,arguments))}return(0,c.Z)(n,t),(0,l.Z)(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,i=e.index,o=(0,x.findDOMNode)(this);o.sortableInfo={collection:t,disabled:n,index:i,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.refs.wrappedInstance}},{key:"render",value:function(){var t=o.withRef?"wrappedInstance":null;return(0,u.createElement)(e,(0,i.Z)({ref:t},S(this.props,fe)))}}]),n}(u.Component),(0,f.Z)(t,"displayName",M("sortableElement",e)),(0,f.Z)(t,"contextTypes",{manager:g().object.isRequired}),(0,f.Z)(t,"propTypes",he),(0,f.Z)(t,"defaultProps",{collection:0}),n}}}]);