UNPKG

@jesec/flood

Version:

A modern Web UI for various torrent clients with multi-user and multi-client support

1 lines • 163 kB
(globalThis.webpackChunk_jesec_flood=globalThis.webpackChunk_jesec_flood||[]).push([[525],{124:(e,t,n)=>{var r=n(9325);e.exports=function(){return r.Date.now()}},940:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(6540);const o=function(e,t){var n=(0,r.useRef)(function(){});(0,r.useEffect)(function(){n.current=e}),(0,r.useEffect)(function(){if(null!==t){var e=setInterval(function(){return n.current()},t||0);return function(){return clearInterval(e)}}},[t])}},1133:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n=null;if(!e||"string"!=typeof e)return n;var r=(0,o.default)(e),i="function"==typeof t;return r.forEach(function(e){if("declaration"===e.type){var r=e.property,o=e.value;i?t(r,o,e):o&&((n=n||{})[r]=o)}}),n};var o=r(n(9788))},1800:e=>{var t=/\s/;e.exports=function(e){for(var n=e.length;n--&&t.test(e.charAt(n)););return n}},2849:e=>{"use strict";var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=Object.defineProperty,o=Object.getOwnPropertyDescriptor,i=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===n.call(e)},l=function(e){if(!e||"[object Object]"!==n.call(e))return!1;var r,o=t.call(e,"constructor"),i=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!o&&!i)return!1;for(r in e);return void 0===r||t.call(e,r)},a=function(e,t){r&&"__proto__"===t.name?r(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},s=function(e,n){if("__proto__"===n){if(!t.call(e,n))return;if(o)return o(e,n).value}return e[n]};e.exports=function e(){var t,n,r,o,c,u,d=arguments[0],f=1,p=arguments.length,h=!1;for("boolean"==typeof d&&(h=d,d=arguments[1]||{},f=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});f<p;++f)if(null!=(t=arguments[f]))for(n in t)r=s(d,n),d!==(o=s(t,n))&&(h&&o&&(l(o)||(c=i(o)))?(c?(c=!1,u=r&&i(r)?r:[]):u=r&&l(r)?r:{},a(d,{name:n,newValue:e(h,u,o)})):void 0!==o&&a(d,{name:n,newValue:o}));return d}},3375:(e,t,n)=>{"use strict";n.d(t,{Mp:()=>_e,vL:()=>Y,uN:()=>G,cA:()=>ie,IG:()=>ae,Sj:()=>E,fF:()=>Ve,PM:()=>He,zM:()=>Ye,MS:()=>g});var r=n(6540),o=n(961),i=n(4979);const l={display:"none"};function a(e){let{id:t,value:n}=e;return r.createElement("div",{id:t,style:l},n)}function s(e){let{id:t,announcement:n,ariaLiveType:o="assertive"}=e;return r.createElement("div",{id:t,style:{position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"},role:"status","aria-live":o,"aria-atomic":!0},n)}const c=(0,r.createContext)(null);const u={draggable:"\n To pick up a draggable item, press the space bar.\n While dragging, use the arrow keys to move the item.\n Press space again to drop the item in its new position, or press escape to cancel.\n "},d={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function f(e){let{announcements:t=d,container:n,hiddenTextDescribedById:l,screenReaderInstructions:f=u}=e;const{announce:p,announcement:h}=function(){const[e,t]=(0,r.useState)("");return{announce:(0,r.useCallback)(e=>{null!=e&&t(e)},[]),announcement:e}}(),g=(0,i.YG)("DndLiveRegion"),[m,v]=(0,r.useState)(!1);if((0,r.useEffect)(()=>{v(!0)},[]),function(e){const t=(0,r.useContext)(c);(0,r.useEffect)(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}((0,r.useMemo)(()=>({onDragStart(e){let{active:n}=e;p(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:r}=e;t.onDragMove&&p(t.onDragMove({active:n,over:r}))},onDragOver(e){let{active:n,over:r}=e;p(t.onDragOver({active:n,over:r}))},onDragEnd(e){let{active:n,over:r}=e;p(t.onDragEnd({active:n,over:r}))},onDragCancel(e){let{active:n,over:r}=e;p(t.onDragCancel({active:n,over:r}))}}),[p,t])),!m)return null;const y=r.createElement(r.Fragment,null,r.createElement(a,{id:l,value:f.draggable}),r.createElement(s,{id:g,announcement:h}));return n?(0,o.createPortal)(y,n):y}var p;function h(){}function g(e,t){return(0,r.useMemo)(()=>({sensor:e,options:null!=t?t:{}}),[e,t])}!function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"}(p||(p={}));const m=Object.freeze({x:0,y:0});function v(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function y(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),l=o-r,a=i-n;if(r<o&&n<i){const n=t.width*t.height,r=e.width*e.height,o=l*a;return Number((o/(n+r-o)).toFixed(4))}return 0}const x=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const e of r){const{id:r}=e,i=n.get(r);if(i){const n=y(i,t);n>0&&o.push({id:r,data:{droppableContainer:e,value:n}})}}return o.sort(v)};function b(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:m}function k(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((t,n)=>({...t,top:t.top+e*n.y,bottom:t.bottom+e*n.y,left:t.left+e*n.x,right:t.right+e*n.x}),{...t})}}const w=k(1);function S(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}const C={ignoreTransform:!1};function E(e,t){void 0===t&&(t=C);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:t,transformOrigin:r}=(0,i.zk)(e).getComputedStyle(e);t&&(n=function(e,t,n){const r=S(t);if(!r)return e;const{scaleX:o,scaleY:i,x:l,y:a}=r,s=e.left-l-(1-o)*parseFloat(n),c=e.top-a-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),u=o?e.width/o:e.width,d=i?e.height/i:e.height;return{width:u,height:d,top:c,right:s+u,bottom:c+d,left:s}}(n,t,r))}const{top:r,left:o,width:l,height:a,bottom:s,right:c}=n;return{top:r,left:o,width:l,height:a,bottom:s,right:c}}function I(e){return E(e,{ignoreTransform:!0})}function D(e,t){const n=[];return e?function r(o){if(null!=t&&n.length>=t)return n;if(!o)return n;if((0,i.wz)(o)&&null!=o.scrollingElement&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!(0,i.sb)(o)||(0,i.xZ)(o))return n;if(n.includes(o))return n;const l=(0,i.zk)(e).getComputedStyle(o);return o!==e&&function(e,t){void 0===t&&(t=(0,i.zk)(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(e=>{const r=t[e];return"string"==typeof r&&n.test(r)})}(o,l)&&n.push(o),function(e,t){return void 0===t&&(t=(0,i.zk)(e).getComputedStyle(e)),"fixed"===t.position}(o,l)?n:r(o.parentNode)}(e):n}function T(e){const[t]=D(e,1);return null!=t?t:null}function R(e){return i.Sw&&e?(0,i.l6)(e)?e:(0,i.Ll)(e)?(0,i.wz)(e)||e===(0,i.TW)(e).scrollingElement?window:(0,i.sb)(e)?e:null:null:null}function A(e){return(0,i.l6)(e)?e.scrollX:e.scrollLeft}function P(e){return(0,i.l6)(e)?e.scrollY:e.scrollTop}function M(e){return{x:A(e),y:P(e)}}var N;function L(e){return!(!i.Sw||!e)&&e===document.scrollingElement}function O(e){const t={x:0,y:0},n=L(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:t}}!function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"}(N||(N={}));const z={x:.2,y:.2};function F(e,t,n,r,o){let{top:i,left:l,right:a,bottom:s}=n;void 0===r&&(r=10),void 0===o&&(o=z);const{isTop:c,isBottom:u,isLeft:d,isRight:f}=O(e),p={x:0,y:0},h={x:0,y:0},g=t.height*o.y,m=t.width*o.x;return!c&&i<=t.top+g?(p.y=N.Backward,h.y=r*Math.abs((t.top+g-i)/g)):!u&&s>=t.bottom-g&&(p.y=N.Forward,h.y=r*Math.abs((t.bottom-g-s)/g)),!f&&a>=t.right-m?(p.x=N.Forward,h.x=r*Math.abs((t.right-m-a)/m)):!d&&l<=t.left+m&&(p.x=N.Backward,h.x=r*Math.abs((t.left+m-l)/m)),{direction:p,speed:h}}function _(e){if(e===document.scrollingElement){const{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}const{top:t,left:n,right:r,bottom:o}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:o,width:e.clientWidth,height:e.clientHeight}}function B(e){return e.reduce((e,t)=>(0,i.WQ)(e,M(t)),m)}function j(e,t){if(void 0===t&&(t=E),!e)return;const{top:n,left:r,bottom:o,right:i}=t(e);T(e)&&(o<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const U=[["x",["left","right"],function(e){return e.reduce((e,t)=>e+A(t),0)}],["y",["top","bottom"],function(e){return e.reduce((e,t)=>e+P(t),0)}]];class H{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=D(t),r=B(n);this.rect={...e},this.width=e.width,this.height=e.height;for(const[e,t,o]of U)for(const i of t)Object.defineProperty(this,i,{get:()=>{const t=o(n),l=r[e]-t;return this.rect[i]+l},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class V{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>{var t;return null==(t=this.target)?void 0:t.removeEventListener(...e)})},this.target=e}add(e,t,n){var r;null==(r=this.target)||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}}function q(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return"number"==typeof t?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t&&r>t.y}var W,Y;function K(e){e.preventDefault()}function X(e){e.stopPropagation()}!function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"}(W||(W={})),function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"}(Y||(Y={}));const Q={start:[Y.Space,Y.Enter],cancel:[Y.Esc],end:[Y.Space,Y.Enter,Y.Tab]},$=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Y.Right:return{...n,x:n.x+25};case Y.Left:return{...n,x:n.x-25};case Y.Down:return{...n,y:n.y+25};case Y.Up:return{...n,y:n.y-25}}};class G{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:t}}=e;this.props=e,this.listeners=new V((0,i.TW)(t)),this.windowListeners=new V((0,i.zk)(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(W.Resize,this.handleCancel),this.windowListeners.add(W.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(W.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&j(n),t(m)}handleKeyDown(e){if((0,i.kx)(e)){const{active:t,context:n,options:r}=this.props,{keyboardCodes:o=Q,coordinateGetter:l=$,scrollBehavior:a="smooth"}=r,{code:s}=e;if(o.end.includes(s))return void this.handleEnd(e);if(o.cancel.includes(s))return void this.handleCancel(e);const{collisionRect:c}=n.current,u=c?{x:c.left,y:c.top}:m;this.referenceCoordinates||(this.referenceCoordinates=u);const d=l(e,{active:t,context:n.current,currentCoordinates:u});if(d){const t=(0,i.Re)(d,u),r={x:0,y:0},{scrollableAncestors:o}=n.current;for(const n of o){const o=e.code,{isTop:i,isRight:l,isLeft:s,isBottom:c,maxScroll:u,minScroll:f}=O(n),p=_(n),h={x:Math.min(o===Y.Right?p.right-p.width/2:p.right,Math.max(o===Y.Right?p.left:p.left+p.width/2,d.x)),y:Math.min(o===Y.Down?p.bottom-p.height/2:p.bottom,Math.max(o===Y.Down?p.top:p.top+p.height/2,d.y))},g=o===Y.Right&&!l||o===Y.Left&&!s,m=o===Y.Down&&!c||o===Y.Up&&!i;if(g&&h.x!==d.x){const e=n.scrollLeft+t.x,i=o===Y.Right&&e<=u.x||o===Y.Left&&e>=f.x;if(i&&!t.y)return void n.scrollTo({left:e,behavior:a});r.x=i?n.scrollLeft-e:o===Y.Right?n.scrollLeft-u.x:n.scrollLeft-f.x,r.x&&n.scrollBy({left:-r.x,behavior:a});break}if(m&&h.y!==d.y){const e=n.scrollTop+t.y,i=o===Y.Down&&e<=u.y||o===Y.Up&&e>=f.y;if(i&&!t.x)return void n.scrollTo({top:e,behavior:a});r.y=i?n.scrollTop-e:o===Y.Down?n.scrollTop-u.y:n.scrollTop-f.y,r.y&&n.scrollBy({top:-r.y,behavior:a});break}}this.handleMove(e,(0,i.WQ)((0,i.Re)(d,this.referenceCoordinates),r))}}}handleMove(e,t){const{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){const{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){const{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function J(e){return Boolean(e&&"distance"in e)}function Z(e){return Boolean(e&&"delay"in e)}G.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=Q,onActivation:o}=t,{active:i}=n;const{code:l}=e.nativeEvent;if(r.start.includes(l)){const t=i.activatorNode.current;return(!t||e.target===t)&&(e.preventDefault(),null==o||o({event:e.nativeEvent}),!0)}return!1}}];class ee{constructor(e,t,n){var r;void 0===n&&(n=function(e){const{EventTarget:t}=(0,i.zk)(e);return e instanceof t?e:(0,i.TW)(e)}(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;const{event:o}=e,{target:l}=o;this.props=e,this.events=t,this.document=(0,i.TW)(l),this.documentListeners=new V(this.document),this.listeners=new V(n),this.windowListeners=new V((0,i.zk)(l)),this.initialCoordinates=null!=(r=(0,i.e_)(o))?r:m,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(W.Resize,this.handleCancel),this.windowListeners.add(W.DragStart,K),this.windowListeners.add(W.VisibilityChange,this.handleCancel),this.windowListeners.add(W.ContextMenu,K),this.documentListeners.add(W.Keydown,this.handleKeydown),t){if(null!=n&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Z(t))return this.timeoutId=setTimeout(this.handleStart,t.delay),void this.handlePending(t);if(J(t))return void this.handlePending(t)}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),null!==this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){const{active:n,onPending:r}=this.props;r(n,e,this.initialCoordinates,t)}handleStart(){const{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(W.Click,X,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(W.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;const{activated:n,initialCoordinates:r,props:o}=this,{onMove:l,options:{activationConstraint:a}}=o;if(!r)return;const s=null!=(t=(0,i.e_)(e))?t:m,c=(0,i.Re)(r,s);if(!n&&a){if(J(a)){if(null!=a.tolerance&&q(c,a.tolerance))return this.handleCancel();if(q(c,a.distance))return this.handleStart()}return Z(a)&&q(c,a.tolerance)?this.handleCancel():void this.handlePending(a,c)}e.cancelable&&e.preventDefault(),l(s)}handleEnd(){const{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){const{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===Y.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const te={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class ne extends ee{constructor(e){const{event:t}=e,n=(0,i.TW)(t.target);super(e,te,n)}}ne.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!(!n.isPrimary||0!==n.button)&&(null==r||r({event:n}),!0)}}];const re={move:{name:"mousemove"},end:{name:"mouseup"}};var oe;!function(e){e[e.RightClick=2]="RightClick"}(oe||(oe={}));class ie extends ee{constructor(e){super(e,re,(0,i.TW)(e.event.target))}}ie.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button!==oe.RightClick&&(null==r||r({event:n}),!0)}}];const le={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class ae extends ee{constructor(e){super(e,le)}static setup(){return window.addEventListener(le.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(le.move.name,e)};function e(){}}}var se,ce;function ue(e){let{acceleration:t,activator:n=se.Pointer,canScroll:o,draggingRect:l,enabled:a,interval:s=5,order:c=ce.TreeOrder,pointerCoordinates:u,scrollableAncestors:d,scrollableAncestorRects:f,delta:p,threshold:h}=e;const g=function(e){let{delta:t,disabled:n}=e;const r=(0,i.ZC)(t);return(0,i.KG)(e=>{if(n||!r||!e)return de;const o={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[N.Backward]:e.x[N.Backward]||-1===o.x,[N.Forward]:e.x[N.Forward]||1===o.x},y:{[N.Backward]:e.y[N.Backward]||-1===o.y,[N.Forward]:e.y[N.Forward]||1===o.y}}},[n,t,r])}({delta:p,disabled:!a}),[m,v]=(0,i.$$)(),y=(0,r.useRef)({x:0,y:0}),x=(0,r.useRef)({x:0,y:0}),b=(0,r.useMemo)(()=>{switch(n){case se.Pointer:return u?{top:u.y,bottom:u.y,left:u.x,right:u.x}:null;case se.DraggableRect:return l}},[n,l,u]),k=(0,r.useRef)(null),w=(0,r.useCallback)(()=>{const e=k.current;if(!e)return;const t=y.current.x*x.current.x,n=y.current.y*x.current.y;e.scrollBy(t,n)},[]),S=(0,r.useMemo)(()=>c===ce.TreeOrder?[...d].reverse():d,[c,d]);(0,r.useEffect)(()=>{if(a&&d.length&&b){for(const e of S){if(!1===(null==o?void 0:o(e)))continue;const n=d.indexOf(e),r=f[n];if(!r)continue;const{direction:i,speed:l}=F(e,r,b,t,h);for(const e of["x","y"])g[e][i[e]]||(l[e]=0,i[e]=0);if(l.x>0||l.y>0)return v(),k.current=e,m(w,s),y.current=l,void(x.current=i)}y.current={x:0,y:0},x.current={x:0,y:0},v()}else v()},[t,w,o,v,a,s,JSON.stringify(b),JSON.stringify(g),m,d,S,f,JSON.stringify(h)])}ae.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:o}=n;return!(o.length>1)&&(null==r||r({event:n}),!0)}}],function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"}(se||(se={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(ce||(ce={}));const de={x:{[N.Backward]:!1,[N.Forward]:!1},y:{[N.Backward]:!1,[N.Forward]:!1}};var fe,pe;!function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}(fe||(fe={})),function(e){e.Optimized="optimized"}(pe||(pe={}));const he=new Map;function ge(e,t){return(0,i.KG)(n=>e?n||("function"==typeof t?t(e):e):null,[t,e])}function me(e){let{callback:t,disabled:n}=e;const o=(0,i._q)(t),l=(0,r.useMemo)(()=>{if(n||"undefined"==typeof window||void 0===window.ResizeObserver)return;const{ResizeObserver:e}=window;return new e(o)},[n]);return(0,r.useEffect)(()=>()=>null==l?void 0:l.disconnect(),[l]),l}function ve(e){return new H(E(e),e)}function ye(e,t,n){void 0===t&&(t=ve);const[o,l]=(0,r.useState)(null);function a(){l(r=>{if(!e)return null;var o;if(!1===e.isConnected)return null!=(o=null!=r?r:n)?o:null;const i=t(e);return JSON.stringify(r)===JSON.stringify(i)?r:i})}const s=function(e){let{callback:t,disabled:n}=e;const o=(0,i._q)(t),l=(0,r.useMemo)(()=>{if(n||"undefined"==typeof window||void 0===window.MutationObserver)return;const{MutationObserver:e}=window;return new e(o)},[o,n]);return(0,r.useEffect)(()=>()=>null==l?void 0:l.disconnect(),[l]),l}({callback(t){if(e)for(const n of t){const{type:t,target:r}=n;if("childList"===t&&r instanceof HTMLElement&&r.contains(e)){a();break}}}}),c=me({callback:a});return(0,i.Es)(()=>{a(),e?(null==c||c.observe(e),null==s||s.observe(document.body,{childList:!0,subtree:!0})):(null==c||c.disconnect(),null==s||s.disconnect())},[e]),o}const xe=[];function be(e,t){void 0===t&&(t=[]);const n=(0,r.useRef)(null);return(0,r.useEffect)(()=>{n.current=null},t),(0,r.useEffect)(()=>{const t=e!==m;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)},[e]),n.current?(0,i.Re)(e,n.current):m}function ke(e){return(0,r.useMemo)(()=>e?function(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}(e):null,[e])}const we=[];function Se(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return(0,i.sb)(t)?t:e}const Ce=[{sensor:ne,options:{}},{sensor:G,options:{}}],Ee={current:{}},Ie={draggable:{measure:I},droppable:{measure:I,strategy:fe.WhileDragging,frequency:pe.Optimized},dragOverlay:{measure:E}};class De extends Map{get(e){var t;return null!=e&&null!=(t=super.get(e))?t:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:t}=e;return!t})}getNodeFor(e){var t,n;return null!=(t=null==(n=this.get(e))?void 0:n.node.current)?t:void 0}}const Te={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new De,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:h},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Ie,measureDroppableContainers:h,windowRect:null,measuringScheduled:!1},Re={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:h,draggableNodes:new Map,over:null,measureDroppableContainers:h},Ae=(0,r.createContext)(Re),Pe=(0,r.createContext)(Te);function Me(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new De}}}function Ne(e,t){switch(t.type){case p.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case p.DragMove:return null==e.draggable.active?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case p.DragEnd:case p.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case p.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new De(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case p.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const l=new De(e.droppable.containers);return l.set(n,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:l}}}case p.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const i=new De(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function Le(e){let{disabled:t}=e;const{active:n,activatorEvent:o,draggableNodes:l}=(0,r.useContext)(Ae),a=(0,i.ZC)(o),s=(0,i.ZC)(null==n?void 0:n.id);return(0,r.useEffect)(()=>{if(!t&&!o&&a&&null!=s){if(!(0,i.kx)(a))return;if(document.activeElement===a.target)return;const e=l.get(s);if(!e)return;const{activatorNode:t,node:n}=e;if(!t.current&&!n.current)return;requestAnimationFrame(()=>{for(const e of[t.current,n.current]){if(!e)continue;const t=(0,i.ag)(e);if(t){t.focus();break}}})}},[o,t,l,s,a]),null}function Oe(e,t){let{transform:n,...r}=t;return null!=e&&e.length?e.reduce((e,t)=>t({transform:e,...r}),n):n}const ze=(0,r.createContext)({...m,scaleX:1,scaleY:1});var Fe;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(Fe||(Fe={}));const _e=(0,r.memo)(function(e){var t,n,l,a;let{id:s,accessibility:u,autoScroll:d=!0,children:h,sensors:g=Ce,collisionDetection:v=x,measuring:y,modifiers:k,...S}=e;const C=(0,r.useReducer)(Ne,void 0,Me),[I,A]=C,[P,N]=function(){const[e]=(0,r.useState)(()=>new Set),t=(0,r.useCallback)(t=>(e.add(t),()=>e.delete(t)),[e]);return[(0,r.useCallback)(t=>{let{type:n,event:r}=t;e.forEach(e=>{var t;return null==(t=e[n])?void 0:t.call(e,r)})},[e]),t]}(),[O,z]=(0,r.useState)(Fe.Uninitialized),F=O===Fe.Initialized,{draggable:{active:_,nodes:j,translate:U},droppable:{containers:V}}=I,q=null!=_?j.get(_):null,W=(0,r.useRef)({initial:null,translated:null}),Y=(0,r.useMemo)(()=>{var e;return null!=_?{id:_,data:null!=(e=null==q?void 0:q.data)?e:Ee,rect:W}:null},[_,q]),K=(0,r.useRef)(null),[X,Q]=(0,r.useState)(null),[$,G]=(0,r.useState)(null),J=(0,i.YN)(S,Object.values(S)),Z=(0,i.YG)("DndDescribedBy",s),ee=(0,r.useMemo)(()=>V.getEnabled(),[V]),te=(ne=y,(0,r.useMemo)(()=>({draggable:{...Ie.draggable,...null==ne?void 0:ne.draggable},droppable:{...Ie.droppable,...null==ne?void 0:ne.droppable},dragOverlay:{...Ie.dragOverlay,...null==ne?void 0:ne.dragOverlay}}),[null==ne?void 0:ne.draggable,null==ne?void 0:ne.droppable,null==ne?void 0:ne.dragOverlay]));var ne;const{droppableRects:re,measureDroppableContainers:oe,measuringScheduled:ie}=function(e,t){let{dragging:n,dependencies:o,config:l}=t;const[a,s]=(0,r.useState)(null),{frequency:c,measure:u,strategy:d}=l,f=(0,r.useRef)(e),p=function(){switch(d){case fe.Always:return!1;case fe.BeforeDragging:return n;default:return!n}}(),h=(0,i.YN)(p),g=(0,r.useCallback)(function(e){void 0===e&&(e=[]),h.current||s(t=>null===t?e:t.concat(e.filter(e=>!t.includes(e))))},[h]),m=(0,r.useRef)(null),v=(0,i.KG)(t=>{if(p&&!n)return he;if(!t||t===he||f.current!==e||null!=a){const t=new Map;for(let n of e){if(!n)continue;if(a&&a.length>0&&!a.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}const e=n.node.current,r=e?new H(u(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t},[e,a,n,p,u]);return(0,r.useEffect)(()=>{f.current=e},[e]),(0,r.useEffect)(()=>{p||g()},[n,p]),(0,r.useEffect)(()=>{a&&a.length>0&&s(null)},[JSON.stringify(a)]),(0,r.useEffect)(()=>{p||"number"!=typeof c||null!==m.current||(m.current=setTimeout(()=>{g(),m.current=null},c))},[c,p,g,...o]),{droppableRects:v,measureDroppableContainers:g,measuringScheduled:null!=a}}(ee,{dragging:F,dependencies:[U.x,U.y],config:te.droppable}),le=function(e,t){const n=null!=t?e.get(t):void 0,r=n?n.node.current:null;return(0,i.KG)(e=>{var n;return null==t?null:null!=(n=null!=r?r:e)?n:null},[r,t])}(j,_),ae=(0,r.useMemo)(()=>$?(0,i.e_)($):null,[$]),se=function(){const e=!1===(null==X?void 0:X.autoScrollEnabled),t="object"==typeof d?!1===d.enabled:!1===d,n=F&&!e&&!t;if("object"==typeof d)return{...d,enabled:n};return{enabled:n}}(),ce=function(e,t){return ge(e,t)}(le,te.draggable.measure);!function(e){let{activeNode:t,measure:n,initialRect:o,config:l=!0}=e;const a=(0,r.useRef)(!1),{x:s,y:c}="boolean"==typeof l?{x:l,y:l}:l;(0,i.Es)(()=>{if(!s&&!c||!t)return void(a.current=!1);if(a.current||!o)return;const e=null==t?void 0:t.node.current;if(!e||!1===e.isConnected)return;const r=b(n(e),o);if(s||(r.x=0),c||(r.y=0),a.current=!0,Math.abs(r.x)>0||Math.abs(r.y)>0){const t=T(e);t&&t.scrollBy({top:r.y,left:r.x})}},[t,s,c,o,n])}({activeNode:null!=_?j.get(_):null,config:se.layoutShiftCompensation,initialRect:ce,measure:te.draggable.measure});const de=ye(le,te.draggable.measure,ce),pe=ye(le?le.parentElement:null),ve=(0,r.useRef)({activatorEvent:null,active:null,activeNode:le,collisionRect:null,collisions:null,droppableRects:re,draggableNodes:j,draggingNode:null,draggingNodeRect:null,droppableContainers:V,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),De=V.getNodeFor(null==(t=ve.current.over)?void 0:t.id),Te=function(e){let{measure:t}=e;const[n,o]=(0,r.useState)(null),l=me({callback:(0,r.useCallback)(e=>{for(const{target:n}of e)if((0,i.sb)(n)){o(e=>{const r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t])}),a=(0,r.useCallback)(e=>{const n=Se(e);null==l||l.disconnect(),n&&(null==l||l.observe(n)),o(n?t(n):null)},[t,l]),[s,c]=(0,i.lk)(a);return(0,r.useMemo)(()=>({nodeRef:s,rect:n,setRef:c}),[n,s,c])}({measure:te.dragOverlay.measure}),Re=null!=(n=Te.nodeRef.current)?n:le,_e=F?null!=(l=Te.rect)?l:de:null,Be=Boolean(Te.nodeRef.current&&Te.rect),je=b(Ue=Be?null:de,ge(Ue));var Ue;const He=ke(Re?(0,i.zk)(Re):null),Ve=function(e){const t=(0,r.useRef)(e),n=(0,i.KG)(n=>e?n&&n!==xe&&e&&t.current&&e.parentNode===t.current.parentNode?n:D(e):xe,[e]);return(0,r.useEffect)(()=>{t.current=e},[e]),n}(F?null!=De?De:le:null),qe=function(e,t){void 0===t&&(t=E);const[n]=e,o=ke(n?(0,i.zk)(n):null),[l,a]=(0,r.useState)(we);function s(){a(()=>e.length?e.map(e=>L(e)?o:new H(t(e),e)):we)}const c=me({callback:s});return(0,i.Es)(()=>{null==c||c.disconnect(),s(),e.forEach(e=>null==c?void 0:c.observe(e))},[e]),l}(Ve),We=Oe(k,{transform:{x:U.x-je.x,y:U.y-je.y,scaleX:1,scaleY:1},activatorEvent:$,active:Y,activeNodeRect:de,containerNodeRect:pe,draggingNodeRect:_e,over:ve.current.over,overlayNodeRect:Te.rect,scrollableAncestors:Ve,scrollableAncestorRects:qe,windowRect:He}),Ye=ae?(0,i.WQ)(ae,U):null,Ke=function(e){const[t,n]=(0,r.useState)(null),o=(0,r.useRef)(e),l=(0,r.useCallback)(e=>{const t=R(e.target);t&&n(e=>e?(e.set(t,M(t)),new Map(e)):null)},[]);return(0,r.useEffect)(()=>{const t=o.current;if(e!==t){r(t);const i=e.map(e=>{const t=R(e);return t?(t.addEventListener("scroll",l,{passive:!0}),[t,M(t)]):null}).filter(e=>null!=e);n(i.length?new Map(i):null),o.current=e}return()=>{r(e),r(t)};function r(e){e.forEach(e=>{const t=R(e);null==t||t.removeEventListener("scroll",l)})}},[l,e]),(0,r.useMemo)(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>(0,i.WQ)(e,t),m):B(e):m,[e,t])}(Ve),Xe=be(Ke),Qe=be(Ke,[de]),$e=(0,i.WQ)(We,Xe),Ge=_e?w(_e,We):null,Je=Y&&Ge?v({active:Y,collisionRect:Ge,droppableRects:re,droppableContainers:ee,pointerCoordinates:Ye}):null,Ze=function(e,t){if(!e||0===e.length)return null;const[n]=e;return t?n[t]:n}(Je,"id"),[et,tt]=(0,r.useState)(null),nt=function(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}(Be?We:(0,i.WQ)(We,Qe),null!=(a=null==et?void 0:et.rect)?a:null,de),rt=(0,r.useRef)(null),ot=(0,r.useCallback)((e,t)=>{let{sensor:n,options:r}=t;if(null==K.current)return;const i=j.get(K.current);if(!i)return;const l=e.nativeEvent,a=new n({active:K.current,activeNode:i,event:l,options:r,context:ve,onAbort(e){if(!j.get(e))return;const{onDragAbort:t}=J.current,n={id:e};null==t||t(n),P({type:"onDragAbort",event:n})},onPending(e,t,n,r){if(!j.get(e))return;const{onDragPending:o}=J.current,i={id:e,constraint:t,initialCoordinates:n,offset:r};null==o||o(i),P({type:"onDragPending",event:i})},onStart(e){const t=K.current;if(null==t)return;const n=j.get(t);if(!n)return;const{onDragStart:r}=J.current,i={activatorEvent:l,active:{id:t,data:n.data,rect:W}};(0,o.unstable_batchedUpdates)(()=>{null==r||r(i),z(Fe.Initializing),A({type:p.DragStart,initialCoordinates:e,active:t}),P({type:"onDragStart",event:i}),Q(rt.current),G(l)})},onMove(e){A({type:p.DragMove,coordinates:e})},onEnd:s(p.DragEnd),onCancel:s(p.DragCancel)});function s(e){return async function(){const{active:t,collisions:n,over:r,scrollAdjustedTranslate:i}=ve.current;let a=null;if(t&&i){const{cancelDrop:o}=J.current;if(a={activatorEvent:l,active:t,collisions:n,delta:i,over:r},e===p.DragEnd&&"function"==typeof o){await Promise.resolve(o(a))&&(e=p.DragCancel)}}K.current=null,(0,o.unstable_batchedUpdates)(()=>{A({type:e}),z(Fe.Uninitialized),tt(null),Q(null),G(null),rt.current=null;const t=e===p.DragEnd?"onDragEnd":"onDragCancel";if(a){const e=J.current[t];null==e||e(a),P({type:t,event:a})}})}}rt.current=a},[j]),it=(0,r.useCallback)((e,t)=>(n,r)=>{const o=n.nativeEvent,i=j.get(r);if(null!==K.current||!i||o.dndKit||o.defaultPrevented)return;const l={active:i};!0===e(n,t.options,l)&&(o.dndKit={capturedBy:t.sensor},K.current=r,ot(n,t))},[j,ot]),lt=function(e,t){return(0,r.useMemo)(()=>e.reduce((e,n)=>{const{sensor:r}=n;return[...e,...r.activators.map(e=>({eventName:e.eventName,handler:t(e.handler,n)}))]},[]),[e,t])}(g,it);!function(e){(0,r.useEffect)(()=>{if(!i.Sw)return;const t=e.map(e=>{let{sensor:t}=e;return null==t.setup?void 0:t.setup()});return()=>{for(const e of t)null==e||e()}},e.map(e=>{let{sensor:t}=e;return t}))}(g),(0,i.Es)(()=>{de&&O===Fe.Initializing&&z(Fe.Initialized)},[de,O]),(0,r.useEffect)(()=>{const{onDragMove:e}=J.current,{active:t,activatorEvent:n,collisions:r,over:i}=ve.current;if(!t||!n)return;const l={active:t,activatorEvent:n,collisions:r,delta:{x:$e.x,y:$e.y},over:i};(0,o.unstable_batchedUpdates)(()=>{null==e||e(l),P({type:"onDragMove",event:l})})},[$e.x,$e.y]),(0,r.useEffect)(()=>{const{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:i}=ve.current;if(!e||null==K.current||!t||!i)return;const{onDragOver:l}=J.current,a=r.get(Ze),s=a&&a.rect.current?{id:a.id,rect:a.rect.current,data:a.data,disabled:a.disabled}:null,c={active:e,activatorEvent:t,collisions:n,delta:{x:i.x,y:i.y},over:s};(0,o.unstable_batchedUpdates)(()=>{tt(s),null==l||l(c),P({type:"onDragOver",event:c})})},[Ze]),(0,i.Es)(()=>{ve.current={activatorEvent:$,active:Y,activeNode:le,collisionRect:Ge,collisions:Je,droppableRects:re,draggableNodes:j,draggingNode:Re,draggingNodeRect:_e,droppableContainers:V,over:et,scrollableAncestors:Ve,scrollAdjustedTranslate:$e},W.current={initial:_e,translated:Ge}},[Y,le,Je,Ge,j,Re,_e,re,V,et,Ve,$e]),ue({...se,delta:U,draggingRect:Ge,pointerCoordinates:Ye,scrollableAncestors:Ve,scrollableAncestorRects:qe});const at=(0,r.useMemo)(()=>({active:Y,activeNode:le,activeNodeRect:de,activatorEvent:$,collisions:Je,containerNodeRect:pe,dragOverlay:Te,draggableNodes:j,droppableContainers:V,droppableRects:re,over:et,measureDroppableContainers:oe,scrollableAncestors:Ve,scrollableAncestorRects:qe,measuringConfiguration:te,measuringScheduled:ie,windowRect:He}),[Y,le,de,$,Je,pe,Te,j,V,re,et,oe,Ve,qe,te,ie,He]),st=(0,r.useMemo)(()=>({activatorEvent:$,activators:lt,active:Y,activeNodeRect:de,ariaDescribedById:{draggable:Z},dispatch:A,draggableNodes:j,over:et,measureDroppableContainers:oe}),[$,lt,Y,de,A,Z,j,et,oe]);return r.createElement(c.Provider,{value:N},r.createElement(Ae.Provider,{value:st},r.createElement(Pe.Provider,{value:at},r.createElement(ze.Provider,{value:nt},h)),r.createElement(Le,{disabled:!1===(null==u?void 0:u.restoreFocus)})),r.createElement(f,{...u,hiddenTextDescribedById:Z}))}),Be=(0,r.createContext)(null),je="button",Ue="Draggable";function He(e){let{id:t,data:n,disabled:o=!1,attributes:l}=e;const a=(0,i.YG)(Ue),{activators:s,activatorEvent:c,active:u,activeNodeRect:d,ariaDescribedById:f,draggableNodes:p,over:h}=(0,r.useContext)(Ae),{role:g=je,roleDescription:m="draggable",tabIndex:v=0}=null!=l?l:{},y=(null==u?void 0:u.id)===t,x=(0,r.useContext)(y?ze:Be),[b,k]=(0,i.lk)(),[w,S]=(0,i.lk)(),C=function(e,t){return(0,r.useMemo)(()=>e.reduce((e,n)=>{let{eventName:r,handler:o}=n;return e[r]=e=>{o(e,t)},e},{}),[e,t])}(s,t),E=(0,i.YN)(n);(0,i.Es)(()=>(p.set(t,{id:t,key:a,node:b,activatorNode:w,data:E}),()=>{const e=p.get(t);e&&e.key===a&&p.delete(t)}),[p,t]);return{active:u,activatorEvent:c,activeNodeRect:d,attributes:(0,r.useMemo)(()=>({role:g,tabIndex:v,"aria-disabled":o,"aria-pressed":!(!y||g!==je)||void 0,"aria-roledescription":m,"aria-describedby":f.draggable}),[o,g,v,y,m,f.draggable]),isDragging:y,listeners:o?void 0:C,node:b,over:h,setNodeRef:k,setActivatorNodeRef:S,transform:x}}function Ve(){return(0,r.useContext)(Pe)}const qe="Droppable",We={timeout:25};function Ye(e){let{data:t,disabled:n=!1,id:o,resizeObserverConfig:l}=e;const a=(0,i.YG)(qe),{active:s,dispatch:c,over:u,measureDroppableContainers:d}=(0,r.useContext)(Ae),f=(0,r.useRef)({disabled:n}),h=(0,r.useRef)(!1),g=(0,r.useRef)(null),m=(0,r.useRef)(null),{disabled:v,updateMeasurementsFor:y,timeout:x}={...We,...l},b=(0,i.YN)(null!=y?y:o),k=me({callback:(0,r.useCallback)(()=>{h.current?(null!=m.current&&clearTimeout(m.current),m.current=setTimeout(()=>{d(Array.isArray(b.current)?b.current:[b.current]),m.current=null},x)):h.current=!0},[x]),disabled:v||!s}),w=(0,r.useCallback)((e,t)=>{k&&(t&&(k.unobserve(t),h.current=!1),e&&k.observe(e))},[k]),[S,C]=(0,i.lk)(w),E=(0,i.YN)(t);return(0,r.useEffect)(()=>{k&&S.current&&(k.disconnect(),h.current=!1,k.observe(S.current))},[S,k]),(0,r.useEffect)(()=>(c({type:p.RegisterDroppable,element:{id:o,key:a,disabled:n,node:S,rect:g,data:E}}),()=>c({type:p.UnregisterDroppable,key:a,id:o})),[o]),(0,r.useEffect)(()=>{n!==f.current.disabled&&(c({type:p.SetDroppableDisabled,id:o,key:a,disabled:n}),f.current.disabled=n)},[o,a,n,c]),{active:s,rect:g,isOver:(null==u?void 0:u.id)===o,node:S,over:u,setNodeRef:C}}},3627:(e,t,n)=>{"use strict";n.d(t,{_G:()=>d,be:()=>l,gB:()=>h,gl:()=>k});var r=n(6540),o=n(3375),i=n(4979);function l(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function a(e,t){return e.reduce((e,n,r)=>{const o=t.get(n);return o&&(e[r]=o),e},Array(e.length))}function s(e){return null!==e&&e>=0}const c=e=>{let{rects:t,activeIndex:n,overIndex:r,index:o}=e;const i=l(t,r,n),a=t[o],s=i[o];return s&&a?{x:s.left-a.left,y:s.top-a.top,scaleX:s.width/a.width,scaleY:s.height/a.height}:null},u={scaleX:1,scaleY:1},d=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:o,rects:i,overIndex:l}=e;const a=null!=(t=i[n])?t:r;if(!a)return null;if(o===n){const e=i[l];return e?{x:0,y:n<l?e.top+e.height-(a.top+a.height):e.top-a.top,...u}:null}const s=function(e,t,n){const r=e[t],o=e[t-1],i=e[t+1];if(!r)return 0;if(n<t)return o?r.top-(o.top+o.height):i?i.top-(r.top+r.height):0;return i?i.top-(r.top+r.height):o?r.top-(o.top+o.height):0}(i,o,n);return o>n&&o<=l?{x:0,y:-a.height-s,...u}:o<n&&o>=l?{x:0,y:a.height+s,...u}:{x:0,y:0,...u}};const f="Sortable",p=r.createContext({activeIndex:-1,containerId:f,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:c,disabled:{draggable:!1,droppable:!1}});function h(e){let{children:t,id:n,items:l,strategy:s=c,disabled:u=!1}=e;const{active:d,dragOverlay:h,droppableRects:g,over:m,measureDroppableContainers:v}=(0,o.fF)(),y=(0,i.YG)(f,n),x=Boolean(null!==h.rect),b=(0,r.useMemo)(()=>l.map(e=>"object"==typeof e&&"id"in e?e.id:e),[l]),k=null!=d,w=d?b.indexOf(d.id):-1,S=m?b.indexOf(m.id):-1,C=(0,r.useRef)(b),E=!function(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}(b,C.current),I=-1!==S&&-1===w||E,D=function(e){return"boolean"==typeof e?{draggable:e,droppable:e}:e}(u);(0,i.Es)(()=>{E&&k&&v(b)},[E,b,k,v]),(0,r.useEffect)(()=>{C.current=b},[b]);const T=(0,r.useMemo)(()=>({activeIndex:w,containerId:y,disabled:D,disableTransforms:I,items:b,overIndex:S,useDragOverlay:x,sortedRects:a(b,g),strategy:s}),[w,y,D.draggable,D.droppable,I,b,S,g,x,s]);return r.createElement(p.Provider,{value:T},t)}const g=e=>{let{id:t,items:n,activeIndex:r,overIndex:o}=e;return l(n,r,o).indexOf(t)},m=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:o,items:i,newIndex:l,previousItems:a,previousContainerId:s,transition:c}=e;return!(!c||!r)&&((a===i||o!==l)&&(!!n||l!==o&&t===s))},v={duration:200,easing:"ease"},y="transform",x=i.Ks.Transition.toString({property:y,duration:0,easing:"linear"}),b={roleDescription:"sortable"};function k(e){let{animateLayoutChanges:t=m,attributes:n,disabled:l,data:a,getNewIndex:c=g,id:u,strategy:d,resizeObserverConfig:f,transition:h=v}=e;const{items:k,containerId:w,activeIndex:S,disabled:C,disableTransforms:E,sortedRects:I,overIndex:D,useDragOverlay:T,strategy:R}=(0,r.useContext)(p),A=function(e,t){var n,r;if("boolean"==typeof e)return{draggable:e,droppable:!1};return{draggable:null!=(n=null==e?void 0:e.draggable)?n:t.draggable,droppable:null!=(r=null==e?void 0:e.droppable)?r:t.droppable}}(l,C),P=k.indexOf(u),M=(0,r.useMemo)(()=>({sortable:{containerId:w,index:P,items:k},...a}),[w,a,P,k]),N=(0,r.useMemo)(()=>k.slice(k.indexOf(u)),[k,u]),{rect:L,node:O,isOver:z,setNodeRef:F}=(0,o.zM)({id:u,data:M,disabled:A.droppable,resizeObserverConfig:{updateMeasurementsFor:N,...f}}),{active:_,activatorEvent:B,activeNodeRect:j,attributes:U,setNodeRef:H,listeners:V,isDragging:q,over:W,setActivatorNodeRef:Y,transform:K}=(0,o.PM)({id:u,data:M,attributes:{...b,...n},disabled:A.draggable}),X=(0,i.jn)(F,H),Q=Boolean(_),$=Q&&!E&&s(S)&&s(D),G=!T&&q,J=G&&$?K:null,Z=$?null!=J?J:(null!=d?d:R)({rects:I,activeNodeRect:j,activeIndex:S,overIndex:D,index:P}):null,ee=s(S)&&s(D)?c({id:u,items:k,activeIndex:S,overIndex:D}):P,te=null==_?void 0:_.id,ne=(0,r.useRef)({activeId:te,items:k,newIndex:ee,containerId:w}),re=k!==ne.current.items,oe=t({active:_,containerId:w,isDragging:q,isSorting:Q,id:u,index:P,items:k,newIndex:ne.current.newIndex,previousItems:ne.current.items,previousContainerId:ne.current.containerId,transition:h,wasDragging:null!=ne.current.activeId}),ie=function(e){let{disabled:t,index:n,node:l,rect:a}=e;const[s,c]=(0,r.useState)(null),u=(0,r.useRef)(n);return(0,i.Es)(()=>{if(!t&&n!==u.current&&l.current){const e=a.current;if(e){const t=(0,o.Sj)(l.current,{ignoreTransform:!0}),n={x:e.left-t.left,y:e.top-t.top,scaleX:e.width/t.width,scaleY:e.height/t.height};(n.x||n.y)&&c(n)}}n!==u.current&&(u.current=n)},[t,n,l,a]),(0,r.useEffect)(()=>{s&&c(null)},[s]),s}({disabled:!oe,index:P,node:O,rect:L});return(0,r.useEffect)(()=>{Q&&ne.current.newIndex!==ee&&(ne.current.newIndex=ee),w!==ne.current.containerId&&(ne.current.containerId=w),k!==ne.current.items&&(ne.current.items=k)},[Q,ee,w,k]),(0,r.useEffect)(()=>{if(te===ne.current.activeId)return;if(te&&!ne.current.activeId)return void(ne.current.activeId=te);const e=setTimeout(()=>{ne.current.activeId=te},50);return()=>clearTimeout(e)},[te]),{active:_,activeIndex:S,attributes:U,data:M,rect:L,index:P,newIndex:ee,items:k,isOver:z,isSorting:Q,isDragging:q,listeners:V,node:O,overIndex:D,over:W,setNodeRef:X,setActivatorNodeRef:Y,setDroppableNodeRef:F,setDraggableNodeRef:H,transform:null!=ie?ie:Z,transition:function(){if(ie||re&&ne.current.newIndex===P)return x;if(G&&!(0,i.kx)(B)||!h)return;if(Q||oe)return i.Ks.Transition.toString({...h,property:y});return}()}}o.vL.Down,o.vL.Right,o.vL.Up,o.vL.Left},3805:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},4128:(e,t,n)=>{var r=n(1800),o=/^\s+/;e.exports=function(e){return e?e.slice(0,r(e)+1).replace(o,""):e}},4979:(e,t,n)=>{"use strict";n.d(t,{$$:()=>g,Es:()=>p,KG:()=>v,Ks:()=>D,Ll:()=>a,Re:()=>C,Sw:()=>i,TW:()=>f,WQ:()=>S,YG:()=>k,YN:()=>m,ZC:()=>x,_q:()=>h,ag:()=>R,e_:()=>I,jn:()=>o,kx:()=>E,l6:()=>l,lk:()=>y,sb:()=>u,wz:()=>c,xZ:()=>d,zk:()=>s});var r=n(6540);function o(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return(0,r.useMemo)(()=>e=>{t.forEach(t=>t(e))},t)}const i="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function l(e){const t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function a(e){return"nodeType"in e}function s(e){var t,n;return e?l(e)?e:a(e)&&null!=(t=null==(n=e.ownerDocument)?void 0:n.defaultView)?t:window:window}function c(e){const{Document:t}=s(e);return e instanceof t}function u(e){return!l(e)&&e instanceof s(e).HTMLElement}function d(e){return e instanceof s(e).SVGElement}function f(e){return e?l(e)?e.document:a(e)?c(e)?e:u(e)||d(e)?e.ownerDocument:document:document:document}const p=i?r.useLayoutEffect:r.useEffect;function h(e){const t=(0,r.useRef)(e);return p(()=>{t.current=e}),(0,r.useCallback)(function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return null==t.current?void 0:t.current(...n)},[])}function g(){const e=(0,r.useRef)(null);return[(0,r.useCallback)((t,n)=>{e.current=setInterval(t,n)},[]),(0,r.useCallback)(()=>{null!==e.current&&(clearInterval(e.current),e.current=null)},[])]}function m(e,t){void 0===t&&(t=[e]);const n=(0,r.useRef)(e);return p(()=>{n.current!==e&&(n.current=e)},t),n}function v(e,t){const n=(0,r.useRef)();return(0,r.useMemo)(()=>{const t=e(n.current);return n.current=t,t},[...t])}function y(e){const t=h(e),n=(0,r.useRef)(null),o=(0,r.useCallback)(e=>{e!==n.current&&(null==t||t(e,n.current)),n.current=e},[]);return[n,o]}function x(e){const t=(0,r.useRef)();return(0,r.useEffect)(()=>{t.current=e},[e]),t.current}let b={};function k(e,t){return(0,r.useMemo)(()=>{if(t)return t;const n=null==b[e]?0:b[e]+1;return b[e]=n,e+"-"+n},[e,t])}function w(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((t,n)=>{const r=Object.entries(n);for(const[n,o]of r){const r=t[n];null!=r&&(t[n]=r+e*o)}return t},{...t})}}const S=w(1),C=w(-1);function E(e){if(!e)return!1;const{KeyboardEvent:t}=s(e.target);return t&&e instanceof t}function I(e){if(function(e){if(!e)return!1;const{TouchEvent:t}=s(e.target);return t&&e instanceof t}(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return function(e){return"clientX"in e&&"clientY"in e}(e)?{x:e.clientX,y:e.clientY}:null}const D=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[D.Translate.toString(e),D.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),T="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function R(e){return e.matches(T)?e:e.querySelector(T)}},5229:function(e,t,n){"use strict";var r=(this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(n(1133)),o=n(8917);function i(e,t){var n={};return e&&"string"==typeof e?((0,r.default)(e,function(e,r){e&&r&&(n[(0,o.camelCase)(e,t)]=r)}),n):n}i.default=i,e.exports=i},8221:(e,t,n)=>{var r=n(3805),o=n(124),i=n(9374),l=Math.max,a=Math.min;e.exports=function(e,t,n){var s,c,u,d,f,p,h=0,g=!1,m=!1,v=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function y(t){var n=s,r=c;return s=c=void 0,h=t,d=e.apply(r,n)}function x(e){var n=e-p;return void 0===p||n>=t||n<0||m&&e-h>=u}function b(){var e=o();if(x(e))return k(e);f=setTimeout(b,function(e){var n=t-(e-p);return m?a(n,u-(e-h)):n}(e))}function k(e){return f=void 0,v&&s?y(e):(s=c=void 0,d)}function w(){var e=o(),n=x(e);if(s=arguments,c=this,p=e,n){if(void 0===f)return function(e){return h=e,f=setTimeout(b,t),g?y(e):d}(p);if(m)return clearTimeout(f),f=setTimeout(b,t),y(p)}return void 0===f&&(f=setTimeout(b,t)),d}return t=i(t)||0,r(n)&&(g=!!n.leading,u=(m="maxWait"in n)?l(i(n.maxWait)||0,t):u,v="trailing"in n?!!n.trailing:v),w.cancel=function(){void 0!==f&&clearTimeout(f),h=0,s=p=c=f=void 0},w.flush=function(){return void 0===f?d:k(o())},w}},8334:(e,t,n)=>{"use strict";n.d(t,{oz:()=>Ir});var r={};n.r(r),n.d(r,{boolean:()=>y,booleanish:()=>x,commaOrSpaceSeparated:()=>C,commaSeparated:()=>S,number:()=>k,overloadedBoolean:()=>b,spaceSeparated:()=>w});var o={};function i(){}function l(){}n.r(o),n.d(o,{attentionMarkers:()=>Zt,contentInitial:()=>Kt,disable:()=>en,document:()=>Yt,flow:()=>Qt,flowInitial:()=>Xt,insideSpan:()=>Jt,string:()=>$t,text:()=>Gt});const a=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,s=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,c={};function u(e,t){return((t||c).jsx?s:a).test(e)}const d=/[ \t\n\f\r]/g;function f(e){return""===e.replace(d,"")}class p{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}}function h(e,t){const n={},r={};for(const t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new p(n,r,t)}function g(e){return e.toLowerCase()}p.prototype.normal={},p.prototype.property={},p.prototype.space=void 0;class m{constructor(e,t){this.attribute=t,this.property=e}}m.prototype.attribute="",m.prototype.booleanish=!1,m.prototype.boolean=!1,m.prototype.commaOrSpaceSeparated=!1,m.prototype.commaSeparated=!1,m.prototype.defined=!1,m.prototype.mustUseProperty=!1,m.prototype.number=!1,m.prototype.overloadedBoolean=!1,m.prototype.property="",m.prototype.spaceSeparated=!1,m.prototype.space=void 0;let v=0;const y=E(),x=E(),b=E(),k=E(),w=E(),S=E(),C=E();function E(){return 2**++v}const I=Object.keys(r);class D extends m{constructor(e,t,n,o){let i=-1;if(super(e,t),T(this,"space",o),"number"==typeof n)for(;++i<I.length;){const e=I[i];T(this,I[i],(n&r[e])===r[e])}}}function T(e,t,n){n&&(e[t]=n)}function R(e){const t={},n={};for(const[r,o]of Object.entries(e.properties)){const i=new D(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[g(r)]=r,n[g(i.attribute)]=r}return new p(t,n,e.space)}D.prototype.defined=!0;