UNPKG

@arteneo/forge

Version:
2 lines 504 kB
/*! For license information please see index.js.LICENSE.txt */ !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("react"),require("react-i18next"),require("@mui/material"),require("axios"),require("@mui/icons-material"),require("formik"),require("react-router-dom"),require("react-dom"),require("yup"),require("@mui/x-date-pickers"),require("@mui/x-date-pickers/internals/hooks/useUtils"),require("date-fns"),require("prop-types"),require("react-highlight-words"));else if("function"==typeof define&&define.amd)define(["react","react-i18next","@mui/material","axios","@mui/icons-material","formik","react-router-dom","react-dom","yup","@mui/x-date-pickers","@mui/x-date-pickers/internals/hooks/useUtils","date-fns","prop-types","react-highlight-words"],t);else{var r="object"==typeof exports?t(require("react"),require("react-i18next"),require("@mui/material"),require("axios"),require("@mui/icons-material"),require("formik"),require("react-router-dom"),require("react-dom"),require("yup"),require("@mui/x-date-pickers"),require("@mui/x-date-pickers/internals/hooks/useUtils"),require("date-fns"),require("prop-types"),require("react-highlight-words")):t(e.react,e["react-i18next"],e["@mui/material"],e.axios,e["@mui/icons-material"],e.formik,e["react-router-dom"],e["react-dom"],e.yup,e["@mui/x-date-pickers"],e["@mui/x-date-pickers/internals/hooks/useUtils"],e["date-fns"],e["prop-types"],e["react-highlight-words"]);for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}(self,((e,t,r,n,o,i,a,l,s,u,c,f,d,p)=>(()=>{var h={9752:(e,t,r)=>{"use strict";r.r(t),r.d(t,{AutoScrollActivator:()=>xe,DndContext:()=>$e,DragOverlay:()=>vt,KeyboardCode:()=>ae,KeyboardSensor:()=>fe,MeasuringFrequency:()=>Pe,MeasuringStrategy:()=>Ee,MouseSensor:()=>ye,PointerSensor:()=>ve,TouchSensor:()=>_e,TraversalOrder:()=>je,applyModifiers:()=>Ke,closestCenter:()=>S,closestCorners:()=>D,defaultAnnouncements:()=>h,defaultCoordinates:()=>O,defaultDropAnimation:()=>pt,defaultDropAnimationSideEffects:()=>dt,defaultScreenReaderInstructions:()=>p,getClientRect:()=>N,getFirstCollision:()=>P,getScrollableAncestors:()=>V,pointerWithin:()=>T,rectIntersection:()=>k,useDndContext:()=>rt,useDndMonitor:()=>d,useDraggable:()=>tt,useDroppable:()=>it,useSensor:()=>m,useSensors:()=>y});var n=r(8156),o=r.n(n),i=r(7111),a=r(4285);const l={display:"none"};function s(e){let{id:t,value:r}=e;return o().createElement("div",{id:t,style:l},r)}const u={position:"fixed",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};function c(e){let{id:t,announcement:r}=e;return o().createElement("div",{id:t,style:u,role:"status","aria-live":"assertive","aria-atomic":!0},r)}const f=(0,n.createContext)(null);function d(e){const t=(0,n.useContext)(f);(0,n.useEffect)((()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)}),[e,t])}const p={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 "},h={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was moved over droppable area "+r.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was dropped over droppable area "+r.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function b(e){let{announcements:t=h,container:r,hiddenTextDescribedById:l,screenReaderInstructions:u=p}=e;const{announce:f,announcement:b}=function(){const[e,t]=(0,n.useState)("");return{announce:(0,n.useCallback)((e=>{null!=e&&t(e)}),[]),announcement:e}}(),v=(0,a.useUniqueId)("DndLiveRegion"),[g,m]=(0,n.useState)(!1);if((0,n.useEffect)((()=>{m(!0)}),[]),d((0,n.useMemo)((()=>({onDragStart(e){let{active:r}=e;f(t.onDragStart({active:r}))},onDragMove(e){let{active:r,over:n}=e;t.onDragMove&&f(t.onDragMove({active:r,over:n}))},onDragOver(e){let{active:r,over:n}=e;f(t.onDragOver({active:r,over:n}))},onDragEnd(e){let{active:r,over:n}=e;f(t.onDragEnd({active:r,over:n}))},onDragCancel(e){let{active:r,over:n}=e;f(t.onDragCancel({active:r,over:n}))}})),[f,t])),!g)return null;const y=o().createElement(o().Fragment,null,o().createElement(s,{id:l,value:u.draggable}),o().createElement(c,{id:v,announcement:b}));return r?(0,i.createPortal)(y,r):y}var v;function g(){}function m(e,t){return(0,n.useMemo)((()=>({sensor:e,options:null!=t?t:{}})),[e,t])}function y(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return(0,n.useMemo)((()=>[...t].filter((e=>null!=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"}(v||(v={}));const O=Object.freeze({x:0,y:0});function _(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function x(e,t){const r=(0,a.getEventCoordinates)(e);return r?(r.x-t.left)/t.width*100+"% "+(r.y-t.top)/t.height*100+"%":"0 0"}function j(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return r-n}function w(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return n-r}function E(e){let{left:t,top:r,height:n,width:o}=e;return[{x:t,y:r},{x:t+o,y:r},{x:t,y:r+n},{x:t+o,y:r+n}]}function P(e,t){if(!e||0===e.length)return null;const[r]=e;return t?r[t]:r}function C(e,t,r){return void 0===t&&(t=e.left),void 0===r&&(r=e.top),{x:t+.5*e.width,y:r+.5*e.height}}const S=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=C(t,t.left,t.top),i=[];for(const e of n){const{id:t}=e,n=r.get(t);if(n){const r=_(C(n),o);i.push({id:t,data:{droppableContainer:e,value:r}})}}return i.sort(j)},D=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=E(t),i=[];for(const e of n){const{id:t}=e,n=r.get(t);if(n){const r=E(n),a=o.reduce(((e,t,n)=>e+_(r[n],t)),0),l=Number((a/4).toFixed(4));i.push({id:t,data:{droppableContainer:e,value:l}})}}return i.sort(j)};function M(e,t){const r=Math.max(t.top,e.top),n=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),a=o-n,l=i-r;if(n<o&&r<i){const r=t.width*t.height,n=e.width*e.height,o=a*l;return Number((o/(r+n-o)).toFixed(4))}return 0}const k=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=[];for(const e of n){const{id:n}=e,i=r.get(n);if(i){const r=M(i,t);r>0&&o.push({id:n,data:{droppableContainer:e,value:r}})}}return o.sort(w)};function F(e,t){const{top:r,left:n,bottom:o,right:i}=t;return r<=e.y&&e.y<=o&&n<=e.x&&e.x<=i}const T=e=>{let{droppableContainers:t,droppableRects:r,pointerCoordinates:n}=e;if(!n)return[];const o=[];for(const e of t){const{id:t}=e,i=r.get(t);if(i&&F(n,i)){const r=E(i).reduce(((e,t)=>e+_(n,t)),0),a=Number((r/4).toFixed(4));o.push({id:t,data:{droppableContainer:e,value:a}})}}return o.sort(j)};function B(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:O}function R(e){return function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return n.reduce(((t,r)=>({...t,top:t.top+e*r.y,bottom:t.bottom+e*r.y,left:t.left+e*r.x,right:t.right+e*r.x})),{...t})}}const A=R(1);function I(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 L={ignoreTransform:!1};function N(e,t){void 0===t&&(t=L);let r=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:t,transformOrigin:n}=(0,a.getWindow)(e).getComputedStyle(e);t&&(r=function(e,t,r){const n=I(t);if(!n)return e;const{scaleX:o,scaleY:i,x:a,y:l}=n,s=e.left-a-(1-o)*parseFloat(r),u=e.top-l-(1-i)*parseFloat(r.slice(r.indexOf(" ")+1)),c=o?e.width/o:e.width,f=i?e.height/i:e.height;return{width:c,height:f,top:u,right:s+c,bottom:u+f,left:s}}(r,t,n))}const{top:n,left:o,width:i,height:l,bottom:s,right:u}=r;return{top:n,left:o,width:i,height:l,bottom:s,right:u}}function z(e){return N(e,{ignoreTransform:!0})}function V(e,t){const r=[];return e?function n(o){if(null!=t&&r.length>=t)return r;if(!o)return r;if((0,a.isDocument)(o)&&null!=o.scrollingElement&&!r.includes(o.scrollingElement))return r.push(o.scrollingElement),r;if(!(0,a.isHTMLElement)(o)||(0,a.isSVGElement)(o))return r;if(r.includes(o))return r;const i=(0,a.getWindow)(e).getComputedStyle(o);return o!==e&&function(e,t){void 0===t&&(t=(0,a.getWindow)(e).getComputedStyle(e));const r=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some((e=>{const n=t[e];return"string"==typeof n&&r.test(n)}))}(o,i)&&r.push(o),function(e,t){return void 0===t&&(t=(0,a.getWindow)(e).getComputedStyle(e)),"fixed"===t.position}(o,i)?r:n(o.parentNode)}(e):r}function q(e){const[t]=V(e,1);return null!=t?t:null}function H(e){return a.canUseDOM&&e?(0,a.isWindow)(e)?e:(0,a.isNode)(e)?(0,a.isDocument)(e)||e===(0,a.getOwnerDocument)(e).scrollingElement?window:(0,a.isHTMLElement)(e)?e:null:null:null}function U(e){return(0,a.isWindow)(e)?e.scrollX:e.scrollLeft}function W(e){return(0,a.isWindow)(e)?e.scrollY:e.scrollTop}function G(e){return{x:U(e),y:W(e)}}var X;function K(e){return!(!a.canUseDOM||!e)&&e===document.scrollingElement}function Z(e){const t={x:0,y:0},r=K(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},n={x:e.scrollWidth-r.width,y:e.scrollHeight-r.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=n.y,isRight:e.scrollLeft>=n.x,maxScroll:n,minScroll:t}}!function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"}(X||(X={}));const Q={x:.2,y:.2};function $(e,t,r,n,o){let{top:i,left:a,right:l,bottom:s}=r;void 0===n&&(n=10),void 0===o&&(o=Q);const{isTop:u,isBottom:c,isLeft:f,isRight:d}=Z(e),p={x:0,y:0},h={x:0,y:0},b=t.height*o.y,v=t.width*o.x;return!u&&i<=t.top+b?(p.y=X.Backward,h.y=n*Math.abs((t.top+b-i)/b)):!c&&s>=t.bottom-b&&(p.y=X.Forward,h.y=n*Math.abs((t.bottom-b-s)/b)),!d&&l>=t.right-v?(p.x=X.Forward,h.x=n*Math.abs((t.right-v-l)/v)):!f&&a<=t.left+v&&(p.x=X.Backward,h.x=n*Math.abs((t.left+v-a)/v)),{direction:p,speed:h}}function Y(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:r,right:n,bottom:o}=e.getBoundingClientRect();return{top:t,left:r,right:n,bottom:o,width:e.clientWidth,height:e.clientHeight}}function J(e){return e.reduce(((e,t)=>(0,a.add)(e,G(t))),O)}function ee(e,t){if(void 0===t&&(t=N),!e)return;const{top:r,left:n,bottom:o,right:i}=t(e);q(e)&&(o<=0||i<=0||r>=window.innerHeight||n>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const te=[["x",["left","right"],function(e){return e.reduce(((e,t)=>e+U(t)),0)}],["y",["top","bottom"],function(e){return e.reduce(((e,t)=>e+W(t)),0)}]];class re{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 r=V(t),n=J(r);this.rect={...e},this.width=e.width,this.height=e.height;for(const[e,t,o]of te)for(const i of t)Object.defineProperty(this,i,{get:()=>{const t=o(r),a=n[e]-t;return this.rect[i]+a},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class ne{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,r){var n;null==(n=this.target)||n.addEventListener(e,t,r),this.listeners.push([e,t,r])}}function oe(e,t){const r=Math.abs(e.x),n=Math.abs(e.y);return"number"==typeof t?Math.sqrt(r**2+n**2)>t:"x"in t&&"y"in t?r>t.x&&n>t.y:"x"in t?r>t.x:"y"in t&&n>t.y}var ie,ae;function le(e){e.preventDefault()}function se(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"}(ie||(ie={})),function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter"}(ae||(ae={}));const ue={start:[ae.Space,ae.Enter],cancel:[ae.Esc],end:[ae.Space,ae.Enter]},ce=(e,t)=>{let{currentCoordinates:r}=t;switch(e.code){case ae.Right:return{...r,x:r.x+25};case ae.Left:return{...r,x:r.x-25};case ae.Down:return{...r,y:r.y+25};case ae.Up:return{...r,y:r.y-25}}};class fe{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 ne((0,a.getOwnerDocument)(t)),this.windowListeners=new ne((0,a.getWindow)(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(ie.Resize,this.handleCancel),this.windowListeners.add(ie.VisibilityChange,this.handleCancel),setTimeout((()=>this.listeners.add(ie.Keydown,this.handleKeyDown)))}handleStart(){const{activeNode:e,onStart:t}=this.props,r=e.node.current;r&&ee(r),t(O)}handleKeyDown(e){if((0,a.isKeyboardEvent)(e)){const{active:t,context:r,options:n}=this.props,{keyboardCodes:o=ue,coordinateGetter:i=ce,scrollBehavior:l="smooth"}=n,{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:u}=r.current,c=u?{x:u.left,y:u.top}:O;this.referenceCoordinates||(this.referenceCoordinates=c);const f=i(e,{active:t,context:r.current,currentCoordinates:c});if(f){const t=(0,a.subtract)(f,c),n={x:0,y:0},{scrollableAncestors:o}=r.current;for(const r of o){const o=e.code,{isTop:i,isRight:a,isLeft:s,isBottom:u,maxScroll:c,minScroll:d}=Z(r),p=Y(r),h={x:Math.min(o===ae.Right?p.right-p.width/2:p.right,Math.max(o===ae.Right?p.left:p.left+p.width/2,f.x)),y:Math.min(o===ae.Down?p.bottom-p.height/2:p.bottom,Math.max(o===ae.Down?p.top:p.top+p.height/2,f.y))},b=o===ae.Right&&!a||o===ae.Left&&!s,v=o===ae.Down&&!u||o===ae.Up&&!i;if(b&&h.x!==f.x){const e=r.scrollLeft+t.x,i=o===ae.Right&&e<=c.x||o===ae.Left&&e>=d.x;if(i&&!t.y)return void r.scrollTo({left:e,behavior:l});n.x=i?r.scrollLeft-e:o===ae.Right?r.scrollLeft-c.x:r.scrollLeft-d.x,n.x&&r.scrollBy({left:-n.x,behavior:l});break}if(v&&h.y!==f.y){const e=r.scrollTop+t.y,i=o===ae.Down&&e<=c.y||o===ae.Up&&e>=d.y;if(i&&!t.x)return void r.scrollTo({top:e,behavior:l});n.y=i?r.scrollTop-e:o===ae.Down?r.scrollTop-c.y:r.scrollTop-d.y,n.y&&r.scrollBy({top:-n.y,behavior:l});break}}this.handleMove(e,(0,a.add)((0,a.subtract)(f,this.referenceCoordinates),n))}}}handleMove(e,t){const{onMove:r}=this.props;e.preventDefault(),r(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 de(e){return Boolean(e&&"distance"in e)}function pe(e){return Boolean(e&&"delay"in e)}fe.activators=[{eventName:"onKeyDown",handler:(e,t,r)=>{let{keyboardCodes:n=ue,onActivation:o}=t,{active:i}=r;const{code:a}=e.nativeEvent;if(n.start.includes(a)){const t=i.activatorNode.current;return!(t&&e.target!==t||(e.preventDefault(),null==o||o({event:e.nativeEvent}),0))}return!1}}];class he{constructor(e,t,r){var n;void 0===r&&(r=function(e){const{EventTarget:t}=(0,a.getWindow)(e);return e instanceof t?e:(0,a.getOwnerDocument)(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:i}=o;this.props=e,this.events=t,this.document=(0,a.getOwnerDocument)(i),this.documentListeners=new ne(this.document),this.listeners=new ne(r),this.windowListeners=new ne((0,a.getWindow)(i)),this.initialCoordinates=null!=(n=(0,a.getEventCoordinates)(o))?n:O,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}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),this.windowListeners.add(ie.Resize,this.handleCancel),this.windowListeners.add(ie.DragStart,le),this.windowListeners.add(ie.VisibilityChange,this.handleCancel),this.windowListeners.add(ie.ContextMenu,le),this.documentListeners.add(ie.Keydown,this.handleKeydown),t){if(de(t))return;if(pe(t))return void(this.timeoutId=setTimeout(this.handleStart,t.delay))}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),null!==this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handleStart(){const{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(ie.Click,se,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(ie.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;const{activated:r,initialCoordinates:n,props:o}=this,{onMove:i,options:{activationConstraint:l}}=o;if(!n)return;const s=null!=(t=(0,a.getEventCoordinates)(e))?t:O,u=(0,a.subtract)(n,s);if(!r&&l){if(pe(l))return oe(u,l.tolerance)?this.handleCancel():void 0;if(de(l))return null!=l.tolerance&&oe(u,l.tolerance)?this.handleCancel():oe(u,l.distance)?this.handleStart():void 0}e.cancelable&&e.preventDefault(),i(s)}handleEnd(){const{onEnd:e}=this.props;this.detach(),e()}handleCancel(){const{onCancel:e}=this.props;this.detach(),e()}handleKeydown(e){e.code===ae.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const be={move:{name:"pointermove"},end:{name:"pointerup"}};class ve extends he{constructor(e){const{event:t}=e,r=(0,a.getOwnerDocument)(t.target);super(e,be,r)}}ve.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return!(!r.isPrimary||0!==r.button||(null==n||n({event:r}),0))}}];const ge={move:{name:"mousemove"},end:{name:"mouseup"}};var me;!function(e){e[e.RightClick=2]="RightClick"}(me||(me={}));class ye extends he{constructor(e){super(e,ge,(0,a.getOwnerDocument)(e.event.target))}}ye.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return r.button!==me.RightClick&&(null==n||n({event:r}),!0)}}];const Oe={move:{name:"touchmove"},end:{name:"touchend"}};class _e extends he{constructor(e){super(e,Oe)}static setup(){return window.addEventListener(Oe.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(Oe.move.name,e)};function e(){}}}var xe,je;_e.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;const{touches:o}=r;return!(o.length>1||(null==n||n({event:r}),0))}}],function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"}(xe||(xe={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(je||(je={}));const we={x:{[X.Backward]:!1,[X.Forward]:!1},y:{[X.Backward]:!1,[X.Forward]:!1}};var Ee,Pe;!function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}(Ee||(Ee={})),function(e){e.Optimized="optimized"}(Pe||(Pe={}));const Ce=new Map;function Se(e,t){return(0,a.useLazyMemo)((r=>e?r||("function"==typeof t?t(e):e):null),[t,e])}function De(e){let{callback:t,disabled:r}=e;const o=(0,a.useEvent)(t),i=(0,n.useMemo)((()=>{if(r||"undefined"==typeof window||void 0===window.ResizeObserver)return;const{ResizeObserver:e}=window;return new e(o)}),[r]);return(0,n.useEffect)((()=>()=>null==i?void 0:i.disconnect()),[i]),i}function Me(e){return new re(N(e),e)}function ke(e,t,r){void 0===t&&(t=Me);const[o,i]=(0,n.useReducer)((function(n){if(!e)return null;var o;if(!1===e.isConnected)return null!=(o=null!=n?n:r)?o:null;const i=t(e);return JSON.stringify(n)===JSON.stringify(i)?n:i}),null),l=function(e){let{callback:t,disabled:r}=e;const o=(0,a.useEvent)(t),i=(0,n.useMemo)((()=>{if(r||"undefined"==typeof window||void 0===window.MutationObserver)return;const{MutationObserver:e}=window;return new e(o)}),[o,r]);return(0,n.useEffect)((()=>()=>null==i?void 0:i.disconnect()),[i]),i}({callback(t){if(e)for(const r of t){const{type:t,target:n}=r;if("childList"===t&&n instanceof HTMLElement&&n.contains(e)){i();break}}}}),s=De({callback:i});return(0,a.useIsomorphicLayoutEffect)((()=>{i(),e?(null==s||s.observe(e),null==l||l.observe(document.body,{childList:!0,subtree:!0})):(null==s||s.disconnect(),null==l||l.disconnect())}),[e]),o}const Fe=[];function Te(e,t){void 0===t&&(t=[]);const r=(0,n.useRef)(null);return(0,n.useEffect)((()=>{r.current=null}),t),(0,n.useEffect)((()=>{const t=e!==O;t&&!r.current&&(r.current=e),!t&&r.current&&(r.current=null)}),[e]),r.current?(0,a.subtract)(e,r.current):O}function Be(e){return(0,n.useMemo)((()=>e?function(e){const t=e.innerWidth,r=e.innerHeight;return{top:0,left:0,right:t,bottom:r,width:t,height:r}}(e):null),[e])}const Re=[];function Ae(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return(0,a.isHTMLElement)(t)?t:e}const Ie=[{sensor:ve,options:{}},{sensor:fe,options:{}}],Le={current:{}},Ne={draggable:{measure:z},droppable:{measure:z,strategy:Ee.WhileDragging,frequency:Pe.Optimized},dragOverlay:{measure:N}};class ze 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,r;return null!=(t=null==(r=this.get(e))?void 0:r.node.current)?t:void 0}}const Ve={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new ze,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:g},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Ne,measureDroppableContainers:g,windowRect:null,measuringScheduled:!1},qe={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:g,draggableNodes:new Map,over:null,measureDroppableContainers:g},He=(0,n.createContext)(qe),Ue=(0,n.createContext)(Ve);function We(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new ze}}}function Ge(e,t){switch(t.type){case v.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case v.DragMove:return e.draggable.active?{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}}:e;case v.DragEnd:case v.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case v.RegisterDroppable:{const{element:r}=t,{id:n}=r,o=new ze(e.droppable.containers);return o.set(n,r),{...e,droppable:{...e.droppable,containers:o}}}case v.SetDroppableDisabled:{const{id:r,key:n,disabled:o}=t,i=e.droppable.containers.get(r);if(!i||n!==i.key)return e;const a=new ze(e.droppable.containers);return a.set(r,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:a}}}case v.UnregisterDroppable:{const{id:r,key:n}=t,o=e.droppable.containers.get(r);if(!o||n!==o.key)return e;const i=new ze(e.droppable.containers);return i.delete(r),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function Xe(e){let{disabled:t}=e;const{active:r,activatorEvent:o,draggableNodes:i}=(0,n.useContext)(He),l=(0,a.usePrevious)(o),s=(0,a.usePrevious)(null==r?void 0:r.id);return(0,n.useEffect)((()=>{if(!t&&!o&&l&&null!=s){if(!(0,a.isKeyboardEvent)(l))return;if(document.activeElement===l.target)return;const e=i.get(s);if(!e)return;const{activatorNode:t,node:r}=e;if(!t.current&&!r.current)return;requestAnimationFrame((()=>{for(const e of[t.current,r.current]){if(!e)continue;const t=(0,a.findFirstFocusableNode)(e);if(t){t.focus();break}}}))}}),[o,t,i,s,l]),null}function Ke(e,t){let{transform:r,...n}=t;return null!=e&&e.length?e.reduce(((e,t)=>t({transform:e,...n})),r):r}const Ze=(0,n.createContext)({...O,scaleX:1,scaleY:1});var Qe;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(Qe||(Qe={}));const $e=(0,n.memo)((function(e){var t,r,l,s;let{id:u,accessibility:c,autoScroll:d=!0,children:p,sensors:h=Ie,collisionDetection:g=k,measuring:m,modifiers:y,..._}=e;const x=(0,n.useReducer)(Ge,void 0,We),[j,w]=x,[E,C]=function(){const[e]=(0,n.useState)((()=>new Set)),t=(0,n.useCallback)((t=>(e.add(t),()=>e.delete(t))),[e]);return[(0,n.useCallback)((t=>{let{type:r,event:n}=t;e.forEach((e=>{var t;return null==(t=e[r])?void 0:t.call(e,n)}))}),[e]),t]}(),[S,D]=(0,n.useState)(Qe.Uninitialized),M=S===Qe.Initialized,{draggable:{active:F,nodes:T,translate:R},droppable:{containers:I}}=j,L=F?T.get(F):null,z=(0,n.useRef)({initial:null,translated:null}),U=(0,n.useMemo)((()=>{var e;return null!=F?{id:F,data:null!=(e=null==L?void 0:L.data)?e:Le,rect:z}:null}),[F,L]),W=(0,n.useRef)(null),[Z,Q]=(0,n.useState)(null),[Y,ee]=(0,n.useState)(null),te=(0,a.useLatestValue)(_,Object.values(_)),ne=(0,a.useUniqueId)("DndDescribedBy",u),oe=(0,n.useMemo)((()=>I.getEnabled()),[I]),ie=(ae=m,(0,n.useMemo)((()=>({draggable:{...Ne.draggable,...null==ae?void 0:ae.draggable},droppable:{...Ne.droppable,...null==ae?void 0:ae.droppable},dragOverlay:{...Ne.dragOverlay,...null==ae?void 0:ae.dragOverlay}})),[null==ae?void 0:ae.draggable,null==ae?void 0:ae.droppable,null==ae?void 0:ae.dragOverlay]));var ae;const{droppableRects:le,measureDroppableContainers:se,measuringScheduled:ue}=function(e,t){let{dragging:r,dependencies:o,config:i}=t;const[l,s]=(0,n.useState)(null),{frequency:u,measure:c,strategy:f}=i,d=(0,n.useRef)(e),p=function(){switch(f){case Ee.Always:return!1;case Ee.BeforeDragging:return r;default:return!r}}(),h=(0,a.useLatestValue)(p),b=(0,n.useCallback)((function(e){void 0===e&&(e=[]),h.current||s((t=>null===t?e:t.concat(e.filter((e=>!t.includes(e))))))}),[h]),v=(0,n.useRef)(null),g=(0,a.useLazyMemo)((t=>{if(p&&!r)return Ce;if(!t||t===Ce||d.current!==e||null!=l){const t=new Map;for(let r of e){if(!r)continue;if(l&&l.length>0&&!l.includes(r.id)&&r.rect.current){t.set(r.id,r.rect.current);continue}const e=r.node.current,n=e?new re(c(e),e):null;r.rect.current=n,n&&t.set(r.id,n)}return t}return t}),[e,l,r,p,c]);return(0,n.useEffect)((()=>{d.current=e}),[e]),(0,n.useEffect)((()=>{p||b()}),[r,p]),(0,n.useEffect)((()=>{l&&l.length>0&&s(null)}),[JSON.stringify(l)]),(0,n.useEffect)((()=>{p||"number"!=typeof u||null!==v.current||(v.current=setTimeout((()=>{b(),v.current=null}),u))}),[u,p,b,...o]),{droppableRects:g,measureDroppableContainers:b,measuringScheduled:null!=l}}(oe,{dragging:M,dependencies:[R.x,R.y],config:ie.droppable}),ce=function(e,t){const r=null!==t?e.get(t):void 0,n=r?r.node.current:null;return(0,a.useLazyMemo)((e=>{var r;return null===t?null:null!=(r=null!=n?n:e)?r:null}),[n,t])}(T,F),fe=(0,n.useMemo)((()=>Y?(0,a.getEventCoordinates)(Y):null),[Y]),de=function(){const e=!1===(null==Z?void 0:Z.autoScrollEnabled),t="object"==typeof d?!1===d.enabled:!1===d,r=M&&!e&&!t;return"object"==typeof d?{...d,enabled:r}:{enabled:r}}(),pe=function(e,t){return Se(e,t)}(ce,ie.draggable.measure);!function(e){let{activeNode:t,measure:r,initialRect:o,config:i=!0}=e;const l=(0,n.useRef)(!1),{x:s,y:u}="boolean"==typeof i?{x:i,y:i}:i;(0,a.useIsomorphicLayoutEffect)((()=>{if(!s&&!u||!t)return void(l.current=!1);if(l.current||!o)return;const e=null==t?void 0:t.node.current;if(!e||!1===e.isConnected)return;const n=B(r(e),o);if(s||(n.x=0),u||(n.y=0),l.current=!0,Math.abs(n.x)>0||Math.abs(n.y)>0){const t=q(e);t&&t.scrollBy({top:n.y,left:n.x})}}),[t,s,u,o,r])}({activeNode:F?T.get(F):null,config:de.layoutShiftCompensation,initialRect:pe,measure:ie.draggable.measure});const he=ke(ce,ie.draggable.measure,pe),be=ke(ce?ce.parentElement:null),ve=(0,n.useRef)({activatorEvent:null,active:null,activeNode:ce,collisionRect:null,collisions:null,droppableRects:le,draggableNodes:T,draggingNode:null,draggingNodeRect:null,droppableContainers:I,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ge=I.getNodeFor(null==(t=ve.current.over)?void 0:t.id),me=function(e){let{measure:t}=e;const[r,o]=(0,n.useState)(null),i=De({callback:(0,n.useCallback)((e=>{for(const{target:r}of e)if((0,a.isHTMLElement)(r)){o((e=>{const n=t(r);return e?{...e,width:n.width,height:n.height}:n}));break}}),[t])}),l=(0,n.useCallback)((e=>{const r=Ae(e);null==i||i.disconnect(),r&&(null==i||i.observe(r)),o(r?t(r):null)}),[t,i]),[s,u]=(0,a.useNodeRef)(l);return(0,n.useMemo)((()=>({nodeRef:s,rect:r,setRef:u})),[r,s,u])}({measure:ie.dragOverlay.measure}),ye=null!=(r=me.nodeRef.current)?r:ce,Oe=M?null!=(l=me.rect)?l:he:null,_e=Boolean(me.nodeRef.current&&me.rect),Pe=B(Me=_e?null:he,Se(Me));var Me;const ze=Be(ye?(0,a.getWindow)(ye):null),Ve=function(e){const t=(0,n.useRef)(e),r=(0,a.useLazyMemo)((r=>e?r&&r!==Fe&&e&&t.current&&e.parentNode===t.current.parentNode?r:V(e):Fe),[e]);return(0,n.useEffect)((()=>{t.current=e}),[e]),r}(M?null!=ge?ge:ce:null),qe=function(e,t){void 0===t&&(t=N);const[r]=e,o=Be(r?(0,a.getWindow)(r):null),[i,l]=(0,n.useReducer)((function(){return e.length?e.map((e=>K(e)?o:new re(t(e),e))):Re}),Re),s=De({callback:l});return e.length>0&&i===Re&&l(),(0,a.useIsomorphicLayoutEffect)((()=>{e.length?e.forEach((e=>null==s?void 0:s.observe(e))):(null==s||s.disconnect(),l())}),[e]),i}(Ve),$e=Ke(y,{transform:{x:R.x-Pe.x,y:R.y-Pe.y,scaleX:1,scaleY:1},activatorEvent:Y,active:U,activeNodeRect:he,containerNodeRect:be,draggingNodeRect:Oe,over:ve.current.over,overlayNodeRect:me.rect,scrollableAncestors:Ve,scrollableAncestorRects:qe,windowRect:ze}),Ye=fe?(0,a.add)(fe,R):null,Je=function(e){const[t,r]=(0,n.useState)(null),o=(0,n.useRef)(e),i=(0,n.useCallback)((e=>{const t=H(e.target);t&&r((e=>e?(e.set(t,G(t)),new Map(e)):null))}),[]);return(0,n.useEffect)((()=>{const t=o.current;if(e!==t){n(t);const a=e.map((e=>{const t=H(e);return t?(t.addEventListener("scroll",i,{passive:!0}),[t,G(t)]):null})).filter((e=>null!=e));r(a.length?new Map(a):null),o.current=e}return()=>{n(e),n(t)};function n(e){e.forEach((e=>{const t=H(e);null==t||t.removeEventListener("scroll",i)}))}}),[i,e]),(0,n.useMemo)((()=>e.length?t?Array.from(t.values()).reduce(((e,t)=>(0,a.add)(e,t)),O):J(e):O),[e,t])}(Ve),et=Te(Je),tt=Te(Je,[he]),rt=(0,a.add)($e,et),nt=Oe?A(Oe,$e):null,ot=U&&nt?g({active:U,collisionRect:nt,droppableRects:le,droppableContainers:oe,pointerCoordinates:Ye}):null,it=P(ot,"id"),[at,lt]=(0,n.useState)(null),st=function(e,t,r){return{...e,scaleX:t&&r?t.width/r.width:1,scaleY:t&&r?t.height/r.height:1}}(_e?$e:(0,a.add)($e,tt),null!=(s=null==at?void 0:at.rect)?s:null,he),ut=(0,n.useCallback)(((e,t)=>{let{sensor:r,options:n}=t;if(null==W.current)return;const o=T.get(W.current);if(!o)return;const a=e.nativeEvent,l=new r({active:W.current,activeNode:o,event:a,options:n,context:ve,onStart(e){const t=W.current;if(null==t)return;const r=T.get(t);if(!r)return;const{onDragStart:n}=te.current,o={active:{id:t,data:r.data,rect:z}};(0,i.unstable_batchedUpdates)((()=>{null==n||n(o),D(Qe.Initializing),w({type:v.DragStart,initialCoordinates:e,active:t}),E({type:"onDragStart",event:o})}))},onMove(e){w({type:v.DragMove,coordinates:e})},onEnd:s(v.DragEnd),onCancel:s(v.DragCancel)});function s(e){return async function(){const{active:t,collisions:r,over:n,scrollAdjustedTranslate:o}=ve.current;let l=null;if(t&&o){const{cancelDrop:i}=te.current;l={activatorEvent:a,active:t,collisions:r,delta:o,over:n},e===v.DragEnd&&"function"==typeof i&&await Promise.resolve(i(l))&&(e=v.DragCancel)}W.current=null,(0,i.unstable_batchedUpdates)((()=>{w({type:e}),D(Qe.Uninitialized),lt(null),Q(null),ee(null);const t=e===v.DragEnd?"onDragEnd":"onDragCancel";if(l){const e=te.current[t];null==e||e(l),E({type:t,event:l})}}))}}(0,i.unstable_batchedUpdates)((()=>{Q(l),ee(e.nativeEvent)}))}),[T]),ct=(0,n.useCallback)(((e,t)=>(r,n)=>{const o=r.nativeEvent,i=T.get(n);if(null!==W.current||!i||o.dndKit||o.defaultPrevented)return;const a={active:i};!0===e(r,t.options,a)&&(o.dndKit={capturedBy:t.sensor},W.current=n,ut(r,t))}),[T,ut]),ft=function(e,t){return(0,n.useMemo)((()=>e.reduce(((e,r)=>{const{sensor:n}=r;return[...e,...n.activators.map((e=>({eventName:e.eventName,handler:t(e.handler,r)})))]}),[])),[e,t])}(h,ct);!function(e){(0,n.useEffect)((()=>{if(!a.canUseDOM)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})))}(h),(0,a.useIsomorphicLayoutEffect)((()=>{he&&S===Qe.Initializing&&D(Qe.Initialized)}),[he,S]),(0,n.useEffect)((()=>{const{onDragMove:e}=te.current,{active:t,activatorEvent:r,collisions:n,over:o}=ve.current;if(!t||!r)return;const a={active:t,activatorEvent:r,collisions:n,delta:{x:rt.x,y:rt.y},over:o};(0,i.unstable_batchedUpdates)((()=>{null==e||e(a),E({type:"onDragMove",event:a})}))}),[rt.x,rt.y]),(0,n.useEffect)((()=>{const{active:e,activatorEvent:t,collisions:r,droppableContainers:n,scrollAdjustedTranslate:o}=ve.current;if(!e||null==W.current||!t||!o)return;const{onDragOver:a}=te.current,l=n.get(it),s=l&&l.rect.current?{id:l.id,rect:l.rect.current,data:l.data,disabled:l.disabled}:null,u={active:e,activatorEvent:t,collisions:r,delta:{x:o.x,y:o.y},over:s};(0,i.unstable_batchedUpdates)((()=>{lt(s),null==a||a(u),E({type:"onDragOver",event:u})}))}),[it]),(0,a.useIsomorphicLayoutEffect)((()=>{ve.current={activatorEvent:Y,active:U,activeNode:ce,collisionRect:nt,collisions:ot,droppableRects:le,draggableNodes:T,draggingNode:ye,draggingNodeRect:Oe,droppableContainers:I,over:at,scrollableAncestors:Ve,scrollAdjustedTranslate:rt},z.current={initial:Oe,translated:nt}}),[U,ce,ot,nt,T,ye,Oe,le,I,at,Ve,rt]),function(e){let{acceleration:t,activator:r=xe.Pointer,canScroll:o,draggingRect:i,enabled:l,interval:s=5,order:u=je.TreeOrder,pointerCoordinates:c,scrollableAncestors:f,scrollableAncestorRects:d,delta:p,threshold:h}=e;const b=function(e){let{delta:t,disabled:r}=e;const n=(0,a.usePrevious)(t);return(0,a.useLazyMemo)((e=>{if(r||!n||!e)return we;const o=Math.sign(t.x-n.x),i=Math.sign(t.y-n.y);return{x:{[X.Backward]:e.x[X.Backward]||-1===o,[X.Forward]:e.x[X.Forward]||1===o},y:{[X.Backward]:e.y[X.Backward]||-1===i,[X.Forward]:e.y[X.Forward]||1===i}}}),[r,t,n])}({delta:p,disabled:!l}),[v,g]=(0,a.useInterval)(),m=(0,n.useRef)({x:0,y:0}),y=(0,n.useRef)({x:0,y:0}),O=(0,n.useMemo)((()=>{switch(r){case xe.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case xe.DraggableRect:return i}}),[r,i,c]),_=(0,n.useRef)(null),x=(0,n.useCallback)((()=>{const e=_.current;if(!e)return;const t=m.current.x*y.current.x,r=m.current.y*y.current.y;e.scrollBy(t,r)}),[]),j=(0,n.useMemo)((()=>u===je.TreeOrder?[...f].reverse():f),[u,f]);(0,n.useEffect)((()=>{if(l&&f.length&&O){for(const e of j){if(!1===(null==o?void 0:o(e)))continue;const r=f.indexOf(e),n=d[r];if(!n)continue;const{direction:i,speed:a}=$(e,n,O,t,h);for(const e of["x","y"])b[e][i[e]]||(a[e]=0,i[e]=0);if(a.x>0||a.y>0)return g(),_.current=e,v(x,s),m.current=a,void(y.current=i)}m.current={x:0,y:0},y.current={x:0,y:0},g()}else g()}),[t,x,o,g,l,s,JSON.stringify(O),JSON.stringify(b),v,f,j,d,JSON.stringify(h)])}({...de,delta:R,draggingRect:nt,pointerCoordinates:Ye,scrollableAncestors:Ve,scrollableAncestorRects:qe});const dt=(0,n.useMemo)((()=>({active:U,activeNode:ce,activeNodeRect:he,activatorEvent:Y,collisions:ot,containerNodeRect:be,dragOverlay:me,draggableNodes:T,droppableContainers:I,droppableRects:le,over:at,measureDroppableContainers:se,scrollableAncestors:Ve,scrollableAncestorRects:qe,measuringConfiguration:ie,measuringScheduled:ue,windowRect:ze})),[U,ce,he,Y,ot,be,me,T,I,le,at,se,Ve,qe,ie,ue,ze]),pt=(0,n.useMemo)((()=>({activatorEvent:Y,activators:ft,active:U,activeNodeRect:he,ariaDescribedById:{draggable:ne},dispatch:w,draggableNodes:T,over:at,measureDroppableContainers:se})),[Y,ft,U,he,w,ne,T,at,se]);return o().createElement(f.Provider,{value:C},o().createElement(He.Provider,{value:pt},o().createElement(Ue.Provider,{value:dt},o().createElement(Ze.Provider,{value:st},p)),o().createElement(Xe,{disabled:!1===(null==c?void 0:c.restoreFocus)})),o().createElement(b,{...c,hiddenTextDescribedById:ne}))})),Ye=(0,n.createContext)(null),Je="button",et="Droppable";function tt(e){let{id:t,data:r,disabled:o=!1,attributes:i}=e;const l=(0,a.useUniqueId)(et),{activators:s,activatorEvent:u,active:c,activeNodeRect:f,ariaDescribedById:d,draggableNodes:p,over:h}=(0,n.useContext)(He),{role:b=Je,roleDescription:v="draggable",tabIndex:g=0}=null!=i?i:{},m=(null==c?void 0:c.id)===t,y=(0,n.useContext)(m?Ze:Ye),[O,_]=(0,a.useNodeRef)(),[x,j]=(0,a.useNodeRef)(),w=function(e,t){return(0,n.useMemo)((()=>e.reduce(((e,r)=>{let{eventName:n,handler:o}=r;return e[n]=e=>{o(e,t)},e}),{})),[e,t])}(s,t),E=(0,a.useLatestValue)(r);return(0,a.useIsomorphicLayoutEffect)((()=>(p.set(t,{id:t,key:l,node:O,activatorNode:x,data:E}),()=>{const e=p.get(t);e&&e.key===l&&p.delete(t)})),[p,t]),{active:c,activatorEvent:u,activeNodeRect:f,attributes:(0,n.useMemo)((()=>({role:b,tabIndex:g,"aria-disabled":o,"aria-pressed":!(!m||b!==Je)||void 0,"aria-roledescription":v,"aria-describedby":d.draggable})),[o,b,g,m,v,d.draggable]),isDragging:m,listeners:o?void 0:w,node:O,over:h,setNodeRef:_,setActivatorNodeRef:j,transform:y}}function rt(){return(0,n.useContext)(Ue)}const nt="Droppable",ot={timeout:25};function it(e){let{data:t,disabled:r=!1,id:o,resizeObserverConfig:i}=e;const l=(0,a.useUniqueId)(nt),{active:s,dispatch:u,over:c,measureDroppableContainers:f}=(0,n.useContext)(He),d=(0,n.useRef)({disabled:r}),p=(0,n.useRef)(!1),h=(0,n.useRef)(null),b=(0,n.useRef)(null),{disabled:g,updateMeasurementsFor:m,timeout:y}={...ot,...i},O=(0,a.useLatestValue)(null!=m?m:o),_=De({callback:(0,n.useCallback)((()=>{p.current?(null!=b.current&&clearTimeout(b.current),b.current=setTimeout((()=>{f(Array.isArray(O.current)?O.current:[O.current]),b.current=null}),y)):p.current=!0}),[y]),disabled:g||!s}),x=(0,n.useCallback)(((e,t)=>{_&&(t&&(_.unobserve(t),p.current=!1),e&&_.observe(e))}),[_]),[j,w]=(0,a.useNodeRef)(x),E=(0,a.useLatestValue)(t);return(0,n.useEffect)((()=>{_&&j.current&&(_.disconnect(),p.current=!1,_.observe(j.current))}),[j,_]),(0,a.useIsomorphicLayoutEffect)((()=>(u({type:v.RegisterDroppable,element:{id:o,key:l,disabled:r,node:j,rect:h,data:E}}),()=>u({type:v.UnregisterDroppable,key:l,id:o}))),[o]),(0,n.useEffect)((()=>{r!==d.current.disabled&&(u({type:v.SetDroppableDisabled,id:o,key:l,disabled:r}),d.current.disabled=r)}),[o,l,r,u]),{active:s,rect:h,isOver:(null==c?void 0:c.id)===o,node:j,over:c,setNodeRef:w}}function at(e){let{animation:t,children:r}=e;const[i,l]=(0,n.useState)(null),[s,u]=(0,n.useState)(null),c=(0,a.usePrevious)(r);return r||i||!c||l(c),(0,a.useIsomorphicLayoutEffect)((()=>{if(!s)return;const e=null==i?void 0:i.key,r=null==i?void 0:i.props.id;null!=e&&null!=r?Promise.resolve(t(r,s)).then((()=>{l(null)})):l(null)}),[t,i,s]),o().createElement(o().Fragment,null,r,i?(0,n.cloneElement)(i,{ref:u}):null)}const lt={x:0,y:0,scaleX:1,scaleY:1};function st(e){let{children:t}=e;return o().createElement(He.Provider,{value:qe},o().createElement(Ze.Provider,{value:lt},t))}const ut={position:"fixed",touchAction:"none"},ct=e=>(0,a.isKeyboardEvent)(e)?"transform 250ms ease":void 0,ft=(0,n.forwardRef)(((e,t)=>{let{as:r,activatorEvent:n,adjustScale:i,children:l,className:s,rect:u,style:c,transform:f,transition:d=ct}=e;if(!u)return null;const p=i?f:{...f,scaleX:1,scaleY:1},h={...ut,width:u.width,height:u.height,top:u.top,left:u.left,transform:a.CSS.Transform.toString(p),transformOrigin:i&&n?x(n,u):void 0,transition:"function"==typeof d?d(n):d,...c};return o().createElement(r,{className:s,style:h,ref:t},l)})),dt=e=>t=>{let{active:r,dragOverlay:n}=t;const o={},{styles:i,className:a}=e;if(null!=i&&i.active)for(const[e,t]of Object.entries(i.active))void 0!==t&&(o[e]=r.node.style.getPropertyValue(e),r.node.style.setProperty(e,t));if(null!=i&&i.dragOverlay)for(const[e,t]of Object.entries(i.dragOverlay))void 0!==t&&n.node.style.setProperty(e,t);return null!=a&&a.active&&r.node.classList.add(a.active),null!=a&&a.dragOverlay&&n.node.classList.add(a.dragOverlay),function(){for(const[e,t]of Object.entries(o))r.node.style.setProperty(e,t);null!=a&&a.active&&r.node.classList.remove(a.active)}},pt={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:r}}=e;return[{transform:a.CSS.Transform.toString(t)},{transform:a.CSS.Transform.toString(r)}]},sideEffects:dt({styles:{active:{opacity:"0"}}})};let ht=0;function bt(e){return(0,n.useMemo)((()=>{if(null!=e)return ht++,ht}),[e])}const vt=o().memo((e=>{let{adjustScale:t=!1,children:r,dropAnimation:i,style:l,transition:s,modifiers:u,wrapperElement:c="div",className:f,zIndex:d=999}=e;const{activatorEvent:p,active:h,activeNodeRect:b,containerNodeRect:v,draggableNodes:g,droppableContainers:m,dragOverlay:y,over:O,measuringConfiguration:_,scrollableAncestors:x,scrollableAncestorRects:j,windowRect:w}=rt(),E=(0,n.useContext)(Ze),P=bt(null==h?void 0:h.id),C=Ke(u,{activatorEvent:p,active:h,activeNodeRect:b,containerNodeRect:v,draggingNodeRect:y.rect,over:O,overlayNodeRect:y.rect,scrollableAncestors:x,scrollableAncestorRects:j,transform:E,windowRect:w}),S=Se(b),D=function(e){let{config:t,draggableNodes:r,droppableContainers:n,measuringConfiguration:o}=e;return(0,a.useEvent)(((e,i)=>{if(null===t)return;const l=r.get(e);if(!l)return;const s=l.node.current;if(!s)return;const u=Ae(i);if(!u)return;const{transform:c}=(0,a.getWindow)(i).getComputedStyle(i),f=I(c);if(!f)return;const d="function"==typeof t?t:function(e){const{duration:t,easing:r,sideEffects:n,keyframes:o}={...pt,...e};return e=>{let{active:i,dragOverlay:a,transform:l,...s}=e;if(!t)return;const u=a.rect.left-i.rect.left,c=a.rect.top-i.rect.top,f={scaleX:1!==l.scaleX?i.rect.width*l.scaleX/a.rect.width:1,scaleY:1!==l.scaleY?i.rect.height*l.scaleY/a.rect.height:1},d={x:l.x-u,y:l.y-c,...f},p=o({...s,active:i,dragOverlay:a,transform:{initial:l,final:d}}),[h]=p,b=p[p.length-1];if(JSON.stringify(h)===JSON.stringify(b))return;const v=null==n?void 0:n({active:i,dragOverlay:a,...s}),g=a.node.animate(p,{duration:t,easing:r,fill:"forwards"});return new Promise((e=>{g.onfinish=()=>{null==v||v(),e()}}))}}(t);return ee(s,o.draggable.measure),d({active:{id:e,data:l.data,node:s,rect:o.draggable.measure(s)},draggableNodes:r,dragOverlay:{node:i,rect:o.dragOverlay.measure(u)},droppableContainers:n,measuringConfiguration:o,transform:f})}))}({config:i,draggableNodes:g,droppableContainers:m,measuringConfiguration:_}),M=S?y.setRef:void 0;return o().createElement(st,null,o().createElement(at,{animation:D},h&&P?o().createElement(ft,{key:P,id:h.id,ref:M,as:c,activatorEvent:p,adjustScale:t,className:f,transition:s,rect:S,style:{zIndex:d,...l},transform:C},r):null))}))},5587:(e,t,r)=>{"use strict";r.r(t),r.d(t,{SortableContext:()=>y,arrayMove:()=>l,arraySwap:()=>s,defaultAnimateLayoutChanges:()=>_,defaultNewIndexGetter:()=>O,hasSortableData:()=>C,horizontalListSortingStrategy:()=>d,rectSortingStrategy:()=>p,rectSwappingStrategy:()=>h,sortableKeyboardCoordinates:()=>D,useSortable:()=>P,verticalListSortingStrategy:()=>v});var n=r(8156),o=r.n(n),i=r(9752),a=r(4285);function l(e,t,r){const n=e.slice();return n.splice(r<0?n.length+r:r,0,n.splice(t,1)[0]),n}function s(e,t,r){const n=e.slice();return n[t]=e[r],n[r]=e[t],n}function u(e,t){return e.reduce(((e,r,n)=>{const o=t.get(r);return o&&(e[n]=o),e}),Array(e.length))}function c(e){return null!==e&&e>=0}const f={scaleX:1,scaleY:1},d=e=>{var t;let{rects:r,activeNodeRect:n,activeIndex:o,overIndex:i,index:a}=e;const l=null!=(t=r[o])?t:n;if(!l)return null;const s=function(e,t,r){const n=e[t],o=e[t-1],i=e[t+1];return n&&(o||i)?r<t?o?n.left-(o.left+o.width):i.left-(n.left+n.width):i?i.left-(n.left+n.width):n.left-(o.left+o.width):0}(r,a,o);if(a===o){const e=r[i];return e?{x:o<i?e.left+e.width-(l.left+l.width):e.left-l.left,y:0,...f}:null}return a>o&&a<=i?{x:-l.width-s,y:0,...f}:a<o&&a>=i?{x:l.width+s,y:0,...f}:{x:0,y:0,...f}},p=e=>{let{rects:t,activeIndex:r,overIndex:n,index:o}=e;const i=l(t,n,r),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},h=e=>{let t,r,{activeIndex:n,index:o,rects:i,overIndex:a}=e;return o===n&&(t=i[o],r=i[a]),o===a&&(t=i[o],r=i[n]),r&&t?{x:r.left-t.left,y:r.top-t.top,scaleX:r.width/t.width,scaleY:r.height/t.height}:null},b={scaleX:1,scaleY:1},v=e=>{var t;let{activeIndex:r,activeNodeRect:n,index:o,rects:i,overIndex:a}=e;const l=null!=(t=i[r])?t:n;if(!l)return null;if(o===r){const e=i[a];return e?{x:0,y:r<a?e.top+e.height-(l.top+l.height):e.top-l.top,...b}:null}const s=function(e,t,r){const n=e[t],o=e[t-1],i=e[t+1];return n?r<t?o?n.top-(o.top+o.height):i?i.top-(n.top+n.height):0:i?i.top-(n.top+n.height):o?n.top-(o.top+o.height):0:0}(i,o,r);return o>r&&o<=a?{x:0,y:-l.height-s,...b}:o<r&&o>=a?{x:0,y:l.height+s,...b}:{x:0,y:0,...b}},g="Sortable",m=o().createContext({activeIndex:-1,containerId:g,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:p,disabled:{draggable:!1,droppable:!1}});function y(e){let{children:t,id:r,items:l,strategy:s=p,disabled:c=!1}=e;const{active:f,dragOverlay:d,droppableRects:h,over:b,measureDroppableContainers:v}=(0,i.useDndContext)(),y=(0,a.useUniqueId)(g,r),O=Boolean(null!==d.rect),_=(0,n.useMemo)((()=>l.map((e=>"object"==typeof e&&"id"in e?e.id:e))),[l]),x=null!=f,j=f?_.indexOf(f.id):-1,w=b?_.indexOf(b.id):-1,E=(0,n.useRef)(_),P=!function(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}(_,E.current),C=-1!==w&&-1===j||P,S=function(e){return"boolean"==typeof e?{draggable:e,droppable:e}:e}(c);(0,a.useIsomorphicLayoutEffect)((()=>{P&&x&&v(_)}),[P,_,x,v]),(0,n.useEffect)((()=>{E.current=_}),[_]);const D=(0,n.useMemo)((()=>({activeIndex:j,containerId:y,disabled:S,disableTransforms:C,items:_,overIndex:w,useDragOverlay:O,sortedRects:u(_,h),strategy:s})),[j,y,S.draggable,S.droppable,C,_,w,h,O,s]);return o().createElement(m.Provider,{value:D},t)}const O=e=>{let{id:t,items:r,activeIndex:n,overIndex:o}=e;return l(r,n,o).indexOf(t)},_=e=>{let{containerId:t,isSorting:r,wasDragging:n,index:o,items:i,newIndex:a,previousItems:l,previousContainerId:s,transition:u}=e;return!(!u||!n||l!==i&&o===a||!r&&(a===o||t!==s))},x={duration:200,easing:"ease"},j="transform",w=a.CSS.Transition.toString({property:j,duration:0,easing:"linear"}),E={roleDescription:"sortable"};function P(e){let{animateLayoutChanges:t=_,attributes:r,disabled:o,data:l,getNewIndex:s=O,id:u,strategy:f,resizeObserverConfig:d,transition:p=x}=e;const{items:h,containerId:b,activeIndex:v,disabled:g,disableTransforms:y,sortedRects:P,overIndex:C,useDragOverlay:S,strategy:D}=(0,n.useContext)(m),M=function(e,t){var r,n;return"boolean"==typeof e?{draggable:e,droppable:!1}:{draggable:null!=(r=null==e?void 0:e.draggable)?r:t.draggable,droppable:null!=(n=null==e?void 0:e.droppable)?n:t.droppable}}(o,g),k=h.indexOf(u),F=(0,n.useMemo)((()=>({sortable:{containerId:b,index:k,items:h},...l})),[b,l,k,h]),T=(0,n.useMemo)((()=>h.slice(h.indexOf(u))),[h,u]),{rect:B,node:R,isOver:A,setNodeRef:I}=(0,i.useDroppable)({id:u,data:F,disabled:M.droppable,resizeObserverConfig:{updateMeasurementsFor:T,...d}}),{active:L,activatorEvent:N,activeNodeRect:z,attributes:V,setNodeRef:q,listeners:H,isDragging:U,over:W,setActivatorNodeRef:G,transform:X}=(0,i.useDraggable)({id:u,data:F,attributes:{...E,...r},disabled:M.draggable}),K=(0,a.useCombinedRefs)(I,q),Z=Boolean(L),Q=Z&&!y&&c(v)&&c(C),$=!S&&U,Y=$&&Q?X:null,J=Q?null!=Y?Y:(null!=f?f:D)({rects:P,activeNodeRect:z,activeIndex:v,overIndex:C,index:k}):null,ee=c(v)&&c(C)?s({id:u,items:h,activeIndex:v,overIndex:C}):k,te=null==L?void 0:L.id,re=(0,n.useRef)({activeId:te,items:h,newIndex:ee,containerId:b}),ne=h!==re.current.items,oe=t({active:L,containerId:b,isDragging:U,isSorting:Z,id:u,index:k,items:h,newIndex:re.current.newIndex,previousItems:re.current.items,previousContainerId:re.current.containerId,transition:p,wasDragging:null!=re.current.activeId}),ie=function(e){let{disabled:t,index:r,node:o,rect:l}=e;const[s,u]=(0,n.useState)(null),c=(0,n.useRef)(r);return(0,a.useIsomorphicLayoutEffect)((()=>{if(!t&&r!==c.current&&o.current){const e=l.current;if(e){const t=(0,i.getClientRect)(o.current,{ignoreTransform:!0}),r={x:e.left-t.left,y:e.top-t.top,scaleX:e.width/t.width,scaleY:e.height/t.height};(r.x||r.y)&&u(r)}}r!==c.current&&(c.current=r)}),[t,r,o,l]),(0,n.useEffect)((()=>{s&&u(null)}),[s]),s}({disabled:!oe,index:k,node:R,rect:B});return(0,n.useEffect)((()=>{Z&&re.current.newIndex!==ee&&(re.current.newIndex=ee),b!==re.current.containerId&&(re.current.containerId=b),h!==re.current.items&&(re.current.items=h)}),[Z,ee,b,h]),(0,n.useEffect)((()=>{if(te===re.current.activeId)return;if(te&&!re.current.activeId)return void(re.current.activeId=te);const e=setTimeout((()=>{re.current.activeId=te}),50);return()=>clearTimeout(e)}),[te]),{active:L,activeIndex:v,attributes:V,data:F,rect:B,index:k,newIndex:ee,items:h,isOver:A,isSorting:Z,isDragging:U,listeners:H,node:R,overIn