import{r as I,cs as en,bs as P,bu as tn,ct as Ct,cu as ur,cv as pr,cw as fr,cx as gr,cy as mr,cz as nn,l as Pe,j as y,N as rn,cA as br,aa as nt,o as rt,aX as on,G as Ke,a3 as hr,W as vr,M as Dr,q as yr,S as sn,R as xr,bb as Ir,cl as Sr,cB as Cr,cC as $e,u as Er,a as Ar,P as wr,b as Rr}from"./index-DTC0Ed21.js";import{E as Pr}from"./tasks-ClycqzjK.js";import{u as Br,T as Nr}from"./useDnd-BDrl7hC3.js";import{N as Or,u as Tr,S as Lr,a as Gr,b as Mr,c as Fr}from"./useSprintPage-Cgkrvgqy.js";import"./tasks-R9G1-k7v.js";import"./TasksSearchInput-CjnnmYfA.js";import"./index-Ckr8pn3D.js";import"./IconChevronLeft-DwnMQlxZ.js";import"./modifiers.esm-C4X3-xc2.js";import"./IconUser-Bh9n--nN.js";import"./IconGripVertical-A4WphpSm.js";import"./useTasksData-Vq9uamq9.js";function Wr(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function ln(e,t){var n=I.useState(function(){return{inputs:t,result:e()}})[0],r=I.useRef(!0),o=I.useRef(n),i=r.current||!!(t&&o.current.inputs&&Wr(t,o.current.inputs)),s=i?o.current:{inputs:t,result:e()};return I.useEffect(function(){r.current=!1,o.current=s},[s]),s.result}function $r(e,t){return ln(function(){return e},t)}var A=ln,v=$r,_r="Invariant failed";function kr(e,t){throw new Error(_r)}var j=function(t){var n=t.top,r=t.right,o=t.bottom,i=t.left,s=r-i,l=o-n,c={top:n,right:r,bottom:o,left:i,width:s,height:l,x:i,y:n,center:{x:(r+i)/2,y:(o+n)/2}};return c},ot=function(t,n){return{top:t.top-n.top,left:t.left-n.left,bottom:t.bottom+n.bottom,right:t.right+n.right}},Et=function(t,n){return{top:t.top+n.top,left:t.left+n.left,bottom:t.bottom-n.bottom,right:t.right-n.right}},Hr=function(t,n){return{top:t.top+n.y,left:t.left+n.x,bottom:t.bottom+n.y,right:t.right+n.x}},_e={top:0,right:0,bottom:0,left:0},it=function(t){var n=t.borderBox,r=t.margin,o=r===void 0?_e:r,i=t.border,s=i===void 0?_e:i,l=t.padding,c=l===void 0?_e:l,u=j(ot(n,o)),p=j(Et(n,s)),a=j(Et(p,c));return{marginBox:u,borderBox:j(n),paddingBox:p,contentBox:a,margin:o,border:s,padding:c}},k=function(t){var n=t.slice(0,-2),r=t.slice(-2);if(r!=="px")return 0;var o=Number(n);return isNaN(o)&&kr(),o},Vr=function(){return{x:window.pageXOffset,y:window.pageYOffset}},Ie=function(t,n){var r=t.borderBox,o=t.border,i=t.margin,s=t.padding,l=Hr(r,n);return it({borderBox:l,border:o,margin:i,padding:s})},Se=function(t,n){return n===void 0&&(n=Vr()),Ie(t,n)},an=function(t,n){var r={top:k(n.marginTop),right:k(n.marginRight),bottom:k(n.marginBottom),left:k(n.marginLeft)},o={top:k(n.paddingTop),right:k(n.paddingRight),bottom:k(n.paddingBottom),left:k(n.paddingLeft)},i={top:k(n.borderTopWidth),right:k(n.borderRightWidth),bottom:k(n.borderBottomWidth),left:k(n.borderLeftWidth)};return it({borderBox:t,margin:r,padding:o,border:i})},cn=function(t){var n=t.getBoundingClientRect(),r=window.getComputedStyle(t);return an(n,r)},At=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function jr(e,t){return!!(e===t||At(e)&&At(t))}function Ur(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!jr(e[n],t[n]))return!1;return!0}function N(e,t){t===void 0&&(t=Ur);var n=null;function r(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];if(n&&n.lastThis===this&&t(o,n.lastArgs))return n.lastResult;var s=e.apply(this,o);return n={lastResult:s,lastArgs:o,lastThis:this},s}return r.clear=function(){n=null},r}var ce=function(t){var n=[],r=null,o=function(){for(var s=arguments.length,l=new Array(s),c=0;c<s;c++)l[c]=arguments[c];n=l,!r&&(r=requestAnimationFrame(function(){r=null,t.apply(void 0,n)}))};return o.cancel=function(){r&&(cancelAnimationFrame(r),r=null)},o};function dn(e,t){}dn.bind(null,"warn");dn.bind(null,"error");function z(){}function zr(e,t){return{...e,...t}}function H(e,t,n){const r=t.map(o=>{const i=zr(n,o.options);return e.addEventListener(o.eventName,o.fn,i),function(){e.removeEventListener(o.eventName,o.fn,i)}});return function(){r.forEach(i=>{i()})}}const qr="Invariant failed";class Ce extends Error{}Ce.prototype.toString=function(){return this.message};function b(e,t){throw new Ce(qr)}class Yr extends P.Component{constructor(...t){super(...t),this.callbacks=null,this.unbind=z,this.onWindowError=n=>{const r=this.getCallbacks();r.isDragging()&&r.tryAbort(),n.error instanceof Ce&&n.preventDefault()},this.getCallbacks=()=>{if(!this.callbacks)throw new Error("Unable to find AppCallbacks in <ErrorBoundary/>");return this.callbacks},this.setCallbacks=n=>{this.callbacks=n}}componentDidMount(){this.unbind=H(window,[{eventName:"error",fn:this.onWindowError}])}componentDidCatch(t){if(t instanceof Ce){this.setState({});return}throw t}componentWillUnmount(){this.unbind()}render(){return this.props.children(this.setCallbacks)}}const Kr=`
  Press space bar to start a drag.
  When dragging you can use the arrow keys to move the item around and escape to cancel.
  Some screen readers may require you to be in focus mode or to use your pass through key
`,Ee=e=>e+1,Jr=e=>`
  You have lifted an item in position ${Ee(e.source.index)}
`,un=(e,t)=>{const n=e.droppableId===t.droppableId,r=Ee(e.index),o=Ee(t.index);return n?`
      You have moved the item from position ${r}
      to position ${o}
    `:`
    You have moved the item from position ${r}
    in list ${e.droppableId}
    to list ${t.droppableId}
    in position ${o}
  `},pn=(e,t,n)=>t.droppableId===n.droppableId?`
      The item ${e}
      has been combined with ${n.draggableId}`:`
      The item ${e}
      in list ${t.droppableId}
      has been combined with ${n.draggableId}
      in list ${n.droppableId}
    `,Xr=e=>{const t=e.destination;if(t)return un(e.source,t);const n=e.combine;return n?pn(e.draggableId,e.source,n):"You are over an area that cannot be dropped on"},wt=e=>`
  The item has returned to its starting position
  of ${Ee(e.index)}
`,Zr=e=>{if(e.reason==="CANCEL")return`
      Movement cancelled.
      ${wt(e.source)}
    `;const t=e.destination,n=e.combine;return t?`
      You have dropped the item.
      ${un(e.source,t)}
    `:n?`
      You have dropped the item.
      ${pn(e.draggableId,e.source,n)}
    `:`
    The item has been dropped while not over a drop area.
    ${wt(e.source)}
  `},xe={dragHandleUsageInstructions:Kr,onDragStart:Jr,onDragUpdate:Xr,onDragEnd:Zr},O={x:0,y:0},T=(e,t)=>({x:e.x+t.x,y:e.y+t.y}),W=(e,t)=>({x:e.x-t.x,y:e.y-t.y}),q=(e,t)=>e.x===t.x&&e.y===t.y,te=e=>({x:e.x!==0?-e.x:0,y:e.y!==0?-e.y:0}),X=(e,t,n=0)=>e==="x"?{x:t,y:n}:{x:n,y:t},de=(e,t)=>Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2),Rt=(e,t)=>Math.min(...t.map(n=>de(e,n))),fn=e=>t=>({x:e(t.x),y:e(t.y)});var Qr=(e,t)=>{const n=j({top:Math.max(t.top,e.top),right:Math.min(t.right,e.right),bottom:Math.min(t.bottom,e.bottom),left:Math.max(t.left,e.left)});return n.width<=0||n.height<=0?null:n};const be=(e,t)=>({top:e.top+t.y,left:e.left+t.x,bottom:e.bottom+t.y,right:e.right+t.x}),Pt=e=>[{x:e.left,y:e.top},{x:e.right,y:e.top},{x:e.left,y:e.bottom},{x:e.right,y:e.bottom}],eo={top:0,right:0,bottom:0,left:0},to=(e,t)=>t?be(e,t.scroll.diff.displacement):e,no=(e,t,n)=>n&&n.increasedBy?{...e,[t.end]:e[t.end]+n.increasedBy[t.line]}:e,ro=(e,t)=>t&&t.shouldClipSubject?Qr(t.pageMarginBox,e):j(e);var Z=({page:e,withPlaceholder:t,axis:n,frame:r})=>{const o=to(e.marginBox,r),i=no(o,n,t),s=ro(i,r);return{page:e,withPlaceholder:t,active:s}},st=(e,t)=>{e.frame||b();const n=e.frame,r=W(t,n.scroll.initial),o=te(r),i={...n,scroll:{initial:n.scroll.initial,current:t,diff:{value:r,displacement:o},max:n.scroll.max}},s=Z({page:e.subject.page,withPlaceholder:e.subject.withPlaceholder,axis:e.axis,frame:i});return{...e,frame:i,subject:s}};const gn=N(e=>e.reduce((t,n)=>(t[n.descriptor.id]=n,t),{})),mn=N(e=>e.reduce((t,n)=>(t[n.descriptor.id]=n,t),{})),Be=N(e=>Object.values(e)),oo=N(e=>Object.values(e));var ne=N((e,t)=>oo(t).filter(r=>e===r.descriptor.droppableId).sort((r,o)=>r.descriptor.index-o.descriptor.index));function lt(e){return e.at&&e.at.type==="REORDER"?e.at.destination:null}function Ne(e){return e.at&&e.at.type==="COMBINE"?e.at.combine:null}var Oe=N((e,t)=>t.filter(n=>n.descriptor.id!==e.descriptor.id)),io=({isMovingForward:e,draggable:t,destination:n,insideDestination:r,previousImpact:o})=>{if(!n.isCombineEnabled||!lt(o))return null;function s(f){const g={type:"COMBINE",combine:{draggableId:f,droppableId:n.descriptor.id}};return{...o,at:g}}const l=o.displaced.all,c=l.length?l[0]:null;if(e)return c?s(c):null;const u=Oe(t,r);if(!c){if(!u.length)return null;const f=u[u.length-1];return s(f.descriptor.id)}const p=u.findIndex(f=>f.descriptor.id===c);p===-1&&b();const a=p-1;if(a<0)return null;const d=u[a];return s(d.descriptor.id)},re=(e,t)=>e.descriptor.droppableId===t.descriptor.id;const bn={point:O,value:0},ue={invisible:{},visible:{},all:[]},so={displaced:ue,displacedBy:bn,at:null};var V=(e,t)=>n=>e<=n&&n<=t,hn=e=>{const t=V(e.top,e.bottom),n=V(e.left,e.right);return r=>{if(t(r.top)&&t(r.bottom)&&n(r.left)&&n(r.right))return!0;const i=t(r.top)||t(r.bottom),s=n(r.left)||n(r.right);if(i&&s)return!0;const c=r.top<e.top&&r.bottom>e.bottom,u=r.left<e.left&&r.right>e.right;return c&&u?!0:c&&s||u&&i}},lo=e=>{const t=V(e.top,e.bottom),n=V(e.left,e.right);return r=>t(r.top)&&t(r.bottom)&&n(r.left)&&n(r.right)};const at={direction:"vertical",line:"y",crossAxisLine:"x",start:"top",end:"bottom",size:"height",crossAxisStart:"left",crossAxisEnd:"right",crossAxisSize:"width"},vn={direction:"horizontal",line:"x",crossAxisLine:"y",start:"left",end:"right",size:"width",crossAxisStart:"top",crossAxisEnd:"bottom",crossAxisSize:"height"};var ao=e=>t=>{const n=V(t.top,t.bottom),r=V(t.left,t.right);return o=>e===at?n(o.top)&&n(o.bottom):r(o.left)&&r(o.right)};const co=(e,t)=>{const n=t.frame?t.frame.scroll.diff.displacement:O;return be(e,n)},uo=(e,t,n)=>t.subject.active?n(t.subject.active)(e):!1,po=(e,t,n)=>n(t)(e),ct=({target:e,destination:t,viewport:n,withDroppableDisplacement:r,isVisibleThroughFrameFn:o})=>{const i=r?co(e,t):e;return uo(i,t,o)&&po(i,n,o)},fo=e=>ct({...e,isVisibleThroughFrameFn:hn}),Dn=e=>ct({...e,isVisibleThroughFrameFn:lo}),go=e=>ct({...e,isVisibleThroughFrameFn:ao(e.destination.axis)}),mo=(e,t,n)=>{if(typeof n=="boolean")return n;if(!t)return!0;const{invisible:r,visible:o}=t;if(r[e])return!1;const i=o[e];return i?i.shouldAnimate:!0};function bo(e,t){const n=e.page.marginBox,r={top:t.point.y,right:0,bottom:0,left:t.point.x};return j(ot(n,r))}function pe({afterDragging:e,destination:t,displacedBy:n,viewport:r,forceShouldAnimate:o,last:i}){return e.reduce(function(l,c){const u=bo(c,n),p=c.descriptor.id;if(l.all.push(p),!fo({target:u,destination:t,viewport:r,withDroppableDisplacement:!0}))return l.invisible[c.descriptor.id]=!0,l;const d=mo(p,i,o),f={draggableId:p,shouldAnimate:d};return l.visible[p]=f,l},{all:[],visible:{},invisible:{}})}function ho(e,t){if(!e.length)return 0;const n=e[e.length-1].descriptor.index;return t.inHomeList?n:n+1}function Bt({insideDestination:e,inHomeList:t,displacedBy:n,destination:r}){const o=ho(e,{inHomeList:t});return{displaced:ue,displacedBy:n,at:{type:"REORDER",destination:{droppableId:r.descriptor.id,index:o}}}}function Ae({draggable:e,insideDestination:t,destination:n,viewport:r,displacedBy:o,last:i,index:s,forceShouldAnimate:l}){const c=re(e,n);if(s==null)return Bt({insideDestination:t,inHomeList:c,displacedBy:o,destination:n});const u=t.find(g=>g.descriptor.index===s);if(!u)return Bt({insideDestination:t,inHomeList:c,displacedBy:o,destination:n});const p=Oe(e,t),a=t.indexOf(u),d=p.slice(a);return{displaced:pe({afterDragging:d,destination:n,displacedBy:o,last:i,viewport:r.frame,forceShouldAnimate:l}),displacedBy:o,at:{type:"REORDER",destination:{droppableId:n.descriptor.id,index:s}}}}function Y(e,t){return!!t.effected[e]}var vo=({isMovingForward:e,destination:t,draggables:n,combine:r,afterCritical:o})=>{if(!t.isCombineEnabled)return null;const i=r.draggableId,l=n[i].descriptor.index;return Y(i,o)?e?l:l-1:e?l+1:l},Do=({isMovingForward:e,isInHomeList:t,insideDestination:n,location:r})=>{if(!n.length)return null;const o=r.index,i=e?o+1:o-1,s=n[0].descriptor.index,l=n[n.length-1].descriptor.index,c=t?l:l+1;return i<s||i>c?null:i},yo=({isMovingForward:e,isInHomeList:t,draggable:n,draggables:r,destination:o,insideDestination:i,previousImpact:s,viewport:l,afterCritical:c})=>{const u=s.at;if(u||b(),u.type==="REORDER"){const a=Do({isMovingForward:e,isInHomeList:t,location:u.destination,insideDestination:i});return a==null?null:Ae({draggable:n,insideDestination:i,destination:o,viewport:l,last:s.displaced,displacedBy:s.displacedBy,index:a})}const p=vo({isMovingForward:e,destination:o,displaced:s.displaced,draggables:r,combine:u.combine,afterCritical:c});return p==null?null:Ae({draggable:n,insideDestination:i,destination:o,viewport:l,last:s.displaced,displacedBy:s.displacedBy,index:p})},xo=({displaced:e,afterCritical:t,combineWith:n,displacedBy:r})=>{const o=!!(e.visible[n]||e.invisible[n]);return Y(n,t)?o?O:te(r.point):o?r.point:O},Io=({afterCritical:e,impact:t,draggables:n})=>{const r=Ne(t);r||b();const o=r.draggableId,i=n[o].page.borderBox.center,s=xo({displaced:t.displaced,afterCritical:e,combineWith:o,displacedBy:t.displacedBy});return T(i,s)};const yn=(e,t)=>t.margin[e.start]+t.borderBox[e.size]/2,So=(e,t)=>t.margin[e.end]+t.borderBox[e.size]/2,dt=(e,t,n)=>t[e.crossAxisStart]+n.margin[e.crossAxisStart]+n.borderBox[e.crossAxisSize]/2,Nt=({axis:e,moveRelativeTo:t,isMoving:n})=>X(e.line,t.marginBox[e.end]+yn(e,n),dt(e,t.marginBox,n)),Ot=({axis:e,moveRelativeTo:t,isMoving:n})=>X(e.line,t.marginBox[e.start]-So(e,n),dt(e,t.marginBox,n)),Co=({axis:e,moveInto:t,isMoving:n})=>X(e.line,t.contentBox[e.start]+yn(e,n),dt(e,t.contentBox,n));var Eo=({impact:e,draggable:t,draggables:n,droppable:r,afterCritical:o})=>{const i=ne(r.descriptor.id,n),s=t.page,l=r.axis;if(!i.length)return Co({axis:l,moveInto:r.page,isMoving:s});const{displaced:c,displacedBy:u}=e,p=c.all[0];if(p){const d=n[p];if(Y(p,o))return Ot({axis:l,moveRelativeTo:d.page,isMoving:s});const f=Ie(d.page,u.point);return Ot({axis:l,moveRelativeTo:f,isMoving:s})}const a=i[i.length-1];if(a.descriptor.id===t.descriptor.id)return s.borderBox.center;if(Y(a.descriptor.id,o)){const d=Ie(a.page,te(o.displacedBy.point));return Nt({axis:l,moveRelativeTo:d,isMoving:s})}return Nt({axis:l,moveRelativeTo:a.page,isMoving:s})},Je=(e,t)=>{const n=e.frame;return n?T(t,n.scroll.diff.displacement):t};const Ao=({impact:e,draggable:t,droppable:n,draggables:r,afterCritical:o})=>{const i=t.page.borderBox.center,s=e.at;return!n||!s?i:s.type==="REORDER"?Eo({impact:e,draggable:t,draggables:r,droppable:n,afterCritical:o}):Io({impact:e,draggables:r,afterCritical:o})};var Te=e=>{const t=Ao(e),n=e.droppable;return n?Je(n,t):t},xn=(e,t)=>{const n=W(t,e.scroll.initial),r=te(n);return{frame:j({top:t.y,bottom:t.y+e.frame.height,left:t.x,right:t.x+e.frame.width}),scroll:{initial:e.scroll.initial,max:e.scroll.max,current:t,diff:{value:n,displacement:r}}}};function Tt(e,t){return e.map(n=>t[n])}function wo(e,t){for(let n=0;n<t.length;n++){const r=t[n].visible[e];if(r)return r}return null}var Ro=({impact:e,viewport:t,destination:n,draggables:r,maxScrollChange:o})=>{const i=xn(t,T(t.scroll.current,o)),s=n.frame?st(n,T(n.frame.scroll.current,o)):n,l=e.displaced,c=pe({afterDragging:Tt(l.all,r),destination:n,displacedBy:e.displacedBy,viewport:i.frame,last:l,forceShouldAnimate:!1}),u=pe({afterDragging:Tt(l.all,r),destination:s,displacedBy:e.displacedBy,viewport:t.frame,last:l,forceShouldAnimate:!1}),p={},a={},d=[l,c,u];return l.all.forEach(g=>{const m=wo(g,d);if(m){a[g]=m;return}p[g]=!0}),{...e,displaced:{all:l.all,invisible:p,visible:a}}},Po=(e,t)=>T(e.scroll.diff.displacement,t),ut=({pageBorderBoxCenter:e,draggable:t,viewport:n})=>{const r=Po(n,e),o=W(r,t.page.borderBox.center);return T(t.client.borderBox.center,o)},In=({draggable:e,destination:t,newPageBorderBoxCenter:n,viewport:r,withDroppableDisplacement:o,onlyOnMainAxis:i=!1})=>{const s=W(n,e.page.borderBox.center),c={target:be(e.page.borderBox,s),destination:t,withDroppableDisplacement:o,viewport:r};return i?go(c):Dn(c)},Bo=({isMovingForward:e,draggable:t,destination:n,draggables:r,previousImpact:o,viewport:i,previousPageBorderBoxCenter:s,previousClientSelection:l,afterCritical:c})=>{if(!n.isEnabled)return null;const u=ne(n.descriptor.id,r),p=re(t,n),a=io({isMovingForward:e,draggable:t,destination:n,insideDestination:u,previousImpact:o})||yo({isMovingForward:e,isInHomeList:p,draggable:t,draggables:r,destination:n,insideDestination:u,previousImpact:o,viewport:i,afterCritical:c});if(!a)return null;const d=Te({impact:a,draggable:t,droppable:n,draggables:r,afterCritical:c});if(In({draggable:t,destination:n,newPageBorderBoxCenter:d,viewport:i.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0}))return{clientSelection:ut({pageBorderBoxCenter:d,draggable:t,viewport:i}),impact:a,scrollJumpRequest:null};const g=W(d,s),m=Ro({impact:a,viewport:i,destination:n,draggables:r,maxScrollChange:g});return{clientSelection:l,impact:m,scrollJumpRequest:g}};const M=e=>{const t=e.subject.active;return t||b(),t};var No=({isMovingForward:e,pageBorderBoxCenter:t,source:n,droppables:r,viewport:o})=>{const i=n.subject.active;if(!i)return null;const s=n.axis,l=V(i[s.start],i[s.end]),c=Be(r).filter(p=>p!==n).filter(p=>p.isEnabled).filter(p=>!!p.subject.active).filter(p=>hn(o.frame)(M(p))).filter(p=>{const a=M(p);return e?i[s.crossAxisEnd]<a[s.crossAxisEnd]:a[s.crossAxisStart]<i[s.crossAxisStart]}).filter(p=>{const a=M(p),d=V(a[s.start],a[s.end]);return l(a[s.start])||l(a[s.end])||d(i[s.start])||d(i[s.end])}).sort((p,a)=>{const d=M(p)[s.crossAxisStart],f=M(a)[s.crossAxisStart];return e?d-f:f-d}).filter((p,a,d)=>M(p)[s.crossAxisStart]===M(d[0])[s.crossAxisStart]);if(!c.length)return null;if(c.length===1)return c[0];const u=c.filter(p=>V(M(p)[s.start],M(p)[s.end])(t[s.line]));return u.length===1?u[0]:u.length>1?u.sort((p,a)=>M(p)[s.start]-M(a)[s.start])[0]:c.sort((p,a)=>{const d=Rt(t,Pt(M(p))),f=Rt(t,Pt(M(a)));return d!==f?d-f:M(p)[s.start]-M(a)[s.start]})[0]};const Lt=(e,t)=>{const n=e.page.borderBox.center;return Y(e.descriptor.id,t)?W(n,t.displacedBy.point):n},Oo=(e,t)=>{const n=e.page.borderBox;return Y(e.descriptor.id,t)?be(n,te(t.displacedBy.point)):n};var To=({pageBorderBoxCenter:e,viewport:t,destination:n,insideDestination:r,afterCritical:o})=>r.filter(s=>Dn({target:Oo(s,o),destination:n,viewport:t.frame,withDroppableDisplacement:!0})).sort((s,l)=>{const c=de(e,Je(n,Lt(s,o))),u=de(e,Je(n,Lt(l,o)));return c<u?-1:u<c?1:s.descriptor.index-l.descriptor.index})[0]||null,he=N(function(t,n){const r=n[t.line];return{value:r,point:X(t.line,r)}});const Lo=(e,t,n)=>{const r=e.axis;if(e.descriptor.mode==="virtual")return X(r.line,t[r.line]);const o=e.subject.page.contentBox[r.size],c=ne(e.descriptor.id,n).reduce((u,p)=>u+p.client.marginBox[r.size],0)+t[r.line]-o;return c<=0?null:X(r.line,c)},Sn=(e,t)=>({...e,scroll:{...e.scroll,max:t}}),Cn=(e,t,n)=>{const r=e.frame;re(t,e)&&b(),e.subject.withPlaceholder&&b();const o=he(e.axis,t.displaceBy).point,i=Lo(e,o,n),s={placeholderSize:o,increasedBy:i,oldFrameMaxScroll:e.frame?e.frame.scroll.max:null};if(!r){const p=Z({page:e.subject.page,withPlaceholder:s,axis:e.axis,frame:e.frame});return{...e,subject:p}}const l=i?T(r.scroll.max,i):r.scroll.max,c=Sn(r,l),u=Z({page:e.subject.page,withPlaceholder:s,axis:e.axis,frame:c});return{...e,subject:u,frame:c}},Go=e=>{const t=e.subject.withPlaceholder;t||b();const n=e.frame;if(!n){const s=Z({page:e.subject.page,axis:e.axis,frame:null,withPlaceholder:null});return{...e,subject:s}}const r=t.oldFrameMaxScroll;r||b();const o=Sn(n,r),i=Z({page:e.subject.page,axis:e.axis,frame:o,withPlaceholder:null});return{...e,subject:i,frame:o}};var Mo=({previousPageBorderBoxCenter:e,moveRelativeTo:t,insideDestination:n,draggable:r,draggables:o,destination:i,viewport:s,afterCritical:l})=>{if(!t){if(n.length)return null;const a={displaced:ue,displacedBy:bn,at:{type:"REORDER",destination:{droppableId:i.descriptor.id,index:0}}},d=Te({impact:a,draggable:r,droppable:i,draggables:o,afterCritical:l}),f=re(r,i)?i:Cn(i,r,o);return In({draggable:r,destination:f,newPageBorderBoxCenter:d,viewport:s.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0})?a:null}const c=e[i.axis.line]<=t.page.borderBox.center[i.axis.line],u=(()=>{const a=t.descriptor.index;return t.descriptor.id===r.descriptor.id||c?a:a+1})(),p=he(i.axis,r.displaceBy);return Ae({draggable:r,insideDestination:n,destination:i,viewport:s,displacedBy:p,last:ue,index:u})},Fo=({isMovingForward:e,previousPageBorderBoxCenter:t,draggable:n,isOver:r,draggables:o,droppables:i,viewport:s,afterCritical:l})=>{const c=No({isMovingForward:e,pageBorderBoxCenter:t,source:r,droppables:i,viewport:s});if(!c)return null;const u=ne(c.descriptor.id,o),p=To({pageBorderBoxCenter:t,viewport:s,destination:c,insideDestination:u,afterCritical:l}),a=Mo({previousPageBorderBoxCenter:t,destination:c,draggable:n,draggables:o,moveRelativeTo:p,insideDestination:u,viewport:s,afterCritical:l});if(!a)return null;const d=Te({impact:a,draggable:n,droppable:c,draggables:o,afterCritical:l});return{clientSelection:ut({pageBorderBoxCenter:d,draggable:n,viewport:s}),impact:a,scrollJumpRequest:null}},$=e=>{const t=e.at;return t?t.type==="REORDER"?t.destination.droppableId:t.combine.droppableId:null};const Wo=(e,t)=>{const n=$(e);return n?t[n]:null};var $o=({state:e,type:t})=>{const n=Wo(e.impact,e.dimensions.droppables),r=!!n,o=e.dimensions.droppables[e.critical.droppable.id],i=n||o,s=i.axis.direction,l=s==="vertical"&&(t==="MOVE_UP"||t==="MOVE_DOWN")||s==="horizontal"&&(t==="MOVE_LEFT"||t==="MOVE_RIGHT");if(l&&!r)return null;const c=t==="MOVE_DOWN"||t==="MOVE_RIGHT",u=e.dimensions.draggables[e.critical.draggable.id],p=e.current.page.borderBoxCenter,{draggables:a,droppables:d}=e.dimensions;return l?Bo({isMovingForward:c,previousPageBorderBoxCenter:p,draggable:u,destination:i,draggables:a,viewport:e.viewport,previousClientSelection:e.current.client.selection,previousImpact:e.impact,afterCritical:e.afterCritical}):Fo({isMovingForward:c,previousPageBorderBoxCenter:p,draggable:u,isOver:i,draggables:a,droppables:d,viewport:e.viewport,afterCritical:e.afterCritical})};function J(e){return e.phase==="DRAGGING"||e.phase==="COLLECTING"}function En(e){const t=V(e.top,e.bottom),n=V(e.left,e.right);return function(o){return t(o.y)&&n(o.x)}}function _o(e,t){return e.left<t.right&&e.right>t.left&&e.top<t.bottom&&e.bottom>t.top}function ko({pageBorderBox:e,draggable:t,candidates:n}){const r=t.page.borderBox.center,o=n.map(i=>{const s=i.axis,l=X(i.axis.line,e.center[s.line],i.page.borderBox.center[s.crossAxisLine]);return{id:i.descriptor.id,distance:de(r,l)}}).sort((i,s)=>s.distance-i.distance);return o[0]?o[0].id:null}function Ho({pageBorderBox:e,draggable:t,droppables:n}){const r=Be(n).filter(o=>{if(!o.isEnabled)return!1;const i=o.subject.active;if(!i||!_o(e,i))return!1;if(En(i)(e.center))return!0;const s=o.axis,l=i.center[s.crossAxisLine],c=e[s.crossAxisStart],u=e[s.crossAxisEnd],p=V(i[s.crossAxisStart],i[s.crossAxisEnd]),a=p(c),d=p(u);return!a&&!d?!0:a?c<l:u>l});return r.length?r.length===1?r[0].descriptor.id:ko({pageBorderBox:e,draggable:t,candidates:r}):null}const An=(e,t)=>j(be(e,t));var Vo=(e,t)=>{const n=e.frame;return n?An(t,n.scroll.diff.value):t};function wn({displaced:e,id:t}){return!!(e.visible[t]||e.invisible[t])}function jo({draggable:e,closest:t,inHomeList:n}){return t?n&&t.descriptor.index>e.descriptor.index?t.descriptor.index-1:t.descriptor.index:null}var Uo=({pageBorderBoxWithDroppableScroll:e,draggable:t,destination:n,insideDestination:r,last:o,viewport:i,afterCritical:s})=>{const l=n.axis,c=he(n.axis,t.displaceBy),u=c.value,p=e[l.start],a=e[l.end],f=Oe(t,r).find(m=>{const h=m.descriptor.id,D=m.page.borderBox.center[l.line],S=Y(h,s),R=wn({displaced:o,id:h});return S?R?a<=D:p<D-u:R?a<=D+u:p<D})||null,g=jo({draggable:t,closest:f,inHomeList:re(t,n)});return Ae({draggable:t,insideDestination:r,destination:n,viewport:i,last:o,displacedBy:c,index:g})};const zo=4;var qo=({draggable:e,pageBorderBoxWithDroppableScroll:t,previousImpact:n,destination:r,insideDestination:o,afterCritical:i})=>{if(!r.isCombineEnabled)return null;const s=r.axis,l=he(r.axis,e.displaceBy),c=l.value,u=t[s.start],p=t[s.end],d=Oe(e,o).find(g=>{const m=g.descriptor.id,h=g.page.borderBox,S=h[s.size]/zo,R=Y(m,i),x=wn({displaced:n.displaced,id:m});return R?x?p>h[s.start]+S&&p<h[s.end]-S:u>h[s.start]-c+S&&u<h[s.end]-c-S:x?p>h[s.start]+c+S&&p<h[s.end]+c-S:u>h[s.start]+S&&u<h[s.end]-S});return d?{displacedBy:l,displaced:n.displaced,at:{type:"COMBINE",combine:{draggableId:d.descriptor.id,droppableId:r.descriptor.id}}}:null},Rn=({pageOffset:e,draggable:t,draggables:n,droppables:r,previousImpact:o,viewport:i,afterCritical:s})=>{const l=An(t.page.borderBox,e),c=Ho({pageBorderBox:l,draggable:t,droppables:r});if(!c)return so;const u=r[c],p=ne(u.descriptor.id,n),a=Vo(u,l);return qo({pageBorderBoxWithDroppableScroll:a,draggable:t,previousImpact:o,destination:u,insideDestination:p,afterCritical:s})||Uo({pageBorderBoxWithDroppableScroll:a,draggable:t,destination:u,insideDestination:p,last:o.displaced,viewport:i,afterCritical:s})},pt=(e,t)=>({...e,[t.descriptor.id]:t});const Yo=({previousImpact:e,impact:t,droppables:n})=>{const r=$(e),o=$(t);if(!r||r===o)return n;const i=n[r];if(!i.subject.withPlaceholder)return n;const s=Go(i);return pt(n,s)};var Ko=({draggable:e,draggables:t,droppables:n,previousImpact:r,impact:o})=>{const i=Yo({previousImpact:r,impact:o,droppables:n}),s=$(o);if(!s)return i;const l=n[s];if(re(e,l)||l.subject.withPlaceholder)return i;const c=Cn(l,e,t);return pt(i,c)},le=({state:e,clientSelection:t,dimensions:n,viewport:r,impact:o,scrollJumpRequest:i})=>{const s=r||e.viewport,l=n||e.dimensions,c=t||e.current.client.selection,u=W(c,e.initial.client.selection),p={offset:u,selection:c,borderBoxCenter:T(e.initial.client.borderBoxCenter,u)},a={selection:T(p.selection,s.scroll.current),borderBoxCenter:T(p.borderBoxCenter,s.scroll.current),offset:T(p.offset,s.scroll.diff.value)},d={client:p,page:a};if(e.phase==="COLLECTING")return{...e,dimensions:l,viewport:s,current:d};const f=l.draggables[e.critical.draggable.id],g=o||Rn({pageOffset:a.offset,draggable:f,draggables:l.draggables,droppables:l.droppables,previousImpact:e.impact,viewport:s,afterCritical:e.afterCritical}),m=Ko({draggable:f,impact:g,previousImpact:e.impact,draggables:l.draggables,droppables:l.droppables});return{...e,current:d,dimensions:{draggables:l.draggables,droppables:m},impact:g,viewport:s,scrollJumpRequest:i||null,forceShouldAnimate:i?!1:null}};function Jo(e,t){return e.map(n=>t[n])}var Pn=({impact:e,viewport:t,draggables:n,destination:r,forceShouldAnimate:o})=>{const i=e.displaced,s=Jo(i.all,n),l=pe({afterDragging:s,destination:r,displacedBy:e.displacedBy,viewport:t.frame,forceShouldAnimate:o,last:i});return{...e,displaced:l}},Bn=({impact:e,draggable:t,droppable:n,draggables:r,viewport:o,afterCritical:i})=>{const s=Te({impact:e,draggable:t,draggables:r,droppable:n,afterCritical:i});return ut({pageBorderBoxCenter:s,draggable:t,viewport:o})},Nn=({state:e,dimensions:t,viewport:n})=>{e.movementMode!=="SNAP"&&b();const r=e.impact,o=n||e.viewport,i=t||e.dimensions,{draggables:s,droppables:l}=i,c=s[e.critical.draggable.id],u=$(r);u||b();const p=l[u],a=Pn({impact:r,viewport:o,destination:p,draggables:s}),d=Bn({impact:a,draggable:c,droppable:p,draggables:s,viewport:o,afterCritical:e.afterCritical});return le({impact:a,clientSelection:d,state:e,dimensions:i,viewport:o})},Xo=e=>({index:e.index,droppableId:e.droppableId}),On=({draggable:e,home:t,draggables:n,viewport:r})=>{const o=he(t.axis,e.displaceBy),i=ne(t.descriptor.id,n),s=i.indexOf(e);s===-1&&b();const l=i.slice(s+1),c=l.reduce((d,f)=>(d[f.descriptor.id]=!0,d),{}),u={inVirtualList:t.descriptor.mode==="virtual",displacedBy:o,effected:c};return{impact:{displaced:pe({afterDragging:l,destination:t,displacedBy:o,last:null,viewport:r.frame,forceShouldAnimate:!1}),displacedBy:o,at:{type:"REORDER",destination:Xo(e.descriptor)}},afterCritical:u}},Zo=(e,t)=>({draggables:e.draggables,droppables:pt(e.droppables,t)}),Qo=({draggable:e,offset:t,initialWindowScroll:n})=>{const r=Ie(e.client,t),o=Se(r,n);return{...e,placeholder:{...e.placeholder,client:r},client:r,page:o}},ei=e=>{const t=e.frame;return t||b(),t},ti=({additions:e,updatedDroppables:t,viewport:n})=>{const r=n.scroll.diff.value;return e.map(o=>{const i=o.descriptor.droppableId,s=t[i],c=ei(s).scroll.diff.value,u=T(r,c);return Qo({draggable:o,offset:u,initialWindowScroll:n.scroll.initial})})},ni=({state:e,published:t})=>{const n=t.modified.map(D=>{const S=e.dimensions.droppables[D.droppableId];return st(S,D.scroll)}),r={...e.dimensions.droppables,...gn(n)},o=mn(ti({additions:t.additions,updatedDroppables:r,viewport:e.viewport})),i={...e.dimensions.draggables,...o};t.removals.forEach(D=>{delete i[D]});const s={droppables:r,draggables:i},l=$(e.impact),c=l?s.droppables[l]:null,u=s.draggables[e.critical.draggable.id],p=s.droppables[e.critical.droppable.id],{impact:a,afterCritical:d}=On({draggable:u,home:p,draggables:i,viewport:e.viewport}),f=c&&c.isCombineEnabled?e.impact:a,g=Rn({pageOffset:e.current.page.offset,draggable:s.draggables[e.critical.draggable.id],draggables:s.draggables,droppables:s.droppables,previousImpact:f,viewport:e.viewport,afterCritical:d}),m={...e,phase:"DRAGGING",impact:g,onLiftImpact:a,dimensions:s,afterCritical:d,forceShouldAnimate:!1};return e.phase==="COLLECTING"?m:{...m,phase:"DROP_PENDING",reason:e.reason,isWaiting:!1}};const Xe=e=>e.movementMode==="SNAP",ke=(e,t,n)=>{const r=Zo(e.dimensions,t);return!Xe(e)||n?le({state:e,dimensions:r}):Nn({state:e,dimensions:r})};function He(e){return e.isDragging&&e.movementMode==="SNAP"?{...e,scrollJumpRequest:null}:e}const Gt={phase:"IDLE",completed:null,shouldFlush:!1};var ri=(e=Gt,t)=>{if(t.type==="FLUSH")return{...Gt,shouldFlush:!0};if(t.type==="INITIAL_PUBLISH"){e.phase!=="IDLE"&&b();const{critical:n,clientSelection:r,viewport:o,dimensions:i,movementMode:s}=t.payload,l=i.draggables[n.draggable.id],c=i.droppables[n.droppable.id],u={selection:r,borderBoxCenter:l.client.borderBox.center,offset:O},p={client:u,page:{selection:T(u.selection,o.scroll.initial),borderBoxCenter:T(u.selection,o.scroll.initial),offset:T(u.selection,o.scroll.diff.value)}},a=Be(i.droppables).every(m=>!m.isFixedOnPage),{impact:d,afterCritical:f}=On({draggable:l,home:c,draggables:i.draggables,viewport:o});return{phase:"DRAGGING",isDragging:!0,critical:n,movementMode:s,dimensions:i,initial:p,current:p,isWindowScrollAllowed:a,impact:d,afterCritical:f,onLiftImpact:d,viewport:o,scrollJumpRequest:null,forceShouldAnimate:null}}if(t.type==="COLLECTION_STARTING")return e.phase==="COLLECTING"||e.phase==="DROP_PENDING"?e:(e.phase!=="DRAGGING"&&b(),{...e,phase:"COLLECTING"});if(t.type==="PUBLISH_WHILE_DRAGGING")return e.phase==="COLLECTING"||e.phase==="DROP_PENDING"||b(),ni({state:e,published:t.payload});if(t.type==="MOVE"){if(e.phase==="DROP_PENDING")return e;J(e)||b();const{client:n}=t.payload;return q(n,e.current.client.selection)?e:le({state:e,clientSelection:n,impact:Xe(e)?e.impact:null})}if(t.type==="UPDATE_DROPPABLE_SCROLL"){if(e.phase==="DROP_PENDING"||e.phase==="COLLECTING")return He(e);J(e)||b();const{id:n,newScroll:r}=t.payload,o=e.dimensions.droppables[n];if(!o)return e;const i=st(o,r);return ke(e,i,!1)}if(t.type==="UPDATE_DROPPABLE_IS_ENABLED"){if(e.phase==="DROP_PENDING")return e;J(e)||b();const{id:n,isEnabled:r}=t.payload,o=e.dimensions.droppables[n];o||b(),o.isEnabled===r&&b();const i={...o,isEnabled:r};return ke(e,i,!0)}if(t.type==="UPDATE_DROPPABLE_IS_COMBINE_ENABLED"){if(e.phase==="DROP_PENDING")return e;J(e)||b();const{id:n,isCombineEnabled:r}=t.payload,o=e.dimensions.droppables[n];o||b(),o.isCombineEnabled===r&&b();const i={...o,isCombineEnabled:r};return ke(e,i,!0)}if(t.type==="MOVE_BY_WINDOW_SCROLL"){if(e.phase==="DROP_PENDING"||e.phase==="DROP_ANIMATING")return e;J(e)||b(),e.isWindowScrollAllowed||b();const n=t.payload.newScroll;if(q(e.viewport.scroll.current,n))return He(e);const r=xn(e.viewport,n);return Xe(e)?Nn({state:e,viewport:r}):le({state:e,viewport:r})}if(t.type==="UPDATE_VIEWPORT_MAX_SCROLL"){if(!J(e))return e;const n=t.payload.maxScroll;if(q(n,e.viewport.scroll.max))return e;const r={...e.viewport,scroll:{...e.viewport.scroll,max:n}};return{...e,viewport:r}}if(t.type==="MOVE_UP"||t.type==="MOVE_DOWN"||t.type==="MOVE_LEFT"||t.type==="MOVE_RIGHT"){if(e.phase==="COLLECTING"||e.phase==="DROP_PENDING")return e;e.phase!=="DRAGGING"&&b();const n=$o({state:e,type:t.type});return n?le({state:e,impact:n.impact,clientSelection:n.clientSelection,scrollJumpRequest:n.scrollJumpRequest}):e}if(t.type==="DROP_PENDING"){const n=t.payload.reason;return e.phase!=="COLLECTING"&&b(),{...e,phase:"DROP_PENDING",isWaiting:!0,reason:n}}if(t.type==="DROP_ANIMATE"){const{completed:n,dropDuration:r,newHomeClientOffset:o}=t.payload;return e.phase==="DRAGGING"||e.phase==="DROP_PENDING"||b(),{phase:"DROP_ANIMATING",completed:n,dropDuration:r,newHomeClientOffset:o,dimensions:e.dimensions}}if(t.type==="DROP_COMPLETE"){const{completed:n}=t.payload;return{phase:"IDLE",completed:n,shouldFlush:!1}}return e};function w(e,t){return e instanceof Object&&"type"in e&&e.type===t}const oi=e=>({type:"BEFORE_INITIAL_CAPTURE",payload:e}),ii=e=>({type:"LIFT",payload:e}),si=e=>({type:"INITIAL_PUBLISH",payload:e}),li=e=>({type:"PUBLISH_WHILE_DRAGGING",payload:e}),ai=()=>({type:"COLLECTION_STARTING",payload:null}),ci=e=>({type:"UPDATE_DROPPABLE_SCROLL",payload:e}),di=e=>({type:"UPDATE_DROPPABLE_IS_ENABLED",payload:e}),ui=e=>({type:"UPDATE_DROPPABLE_IS_COMBINE_ENABLED",payload:e}),Tn=e=>({type:"MOVE",payload:e}),pi=e=>({type:"MOVE_BY_WINDOW_SCROLL",payload:e}),fi=e=>({type:"UPDATE_VIEWPORT_MAX_SCROLL",payload:e}),gi=()=>({type:"MOVE_UP",payload:null}),mi=()=>({type:"MOVE_DOWN",payload:null}),bi=()=>({type:"MOVE_RIGHT",payload:null}),hi=()=>({type:"MOVE_LEFT",payload:null}),ft=()=>({type:"FLUSH",payload:null}),vi=e=>({type:"DROP_ANIMATE",payload:e}),gt=e=>({type:"DROP_COMPLETE",payload:e}),Ln=e=>({type:"DROP",payload:e}),Di=e=>({type:"DROP_PENDING",payload:e}),Gn=()=>({type:"DROP_ANIMATION_FINISHED",payload:null});var yi=e=>({getState:t,dispatch:n})=>r=>o=>{if(!w(o,"LIFT")){r(o);return}const{id:i,clientSelection:s,movementMode:l}=o.payload,c=t();c.phase==="DROP_ANIMATING"&&n(gt({completed:c.completed})),t().phase!=="IDLE"&&b(),n(ft()),n(oi({draggableId:i,movementMode:l}));const p={draggableId:i,scrollOptions:{shouldPublishImmediately:l==="SNAP"}},{critical:a,dimensions:d,viewport:f}=e.startPublishing(p);n(si({critical:a,dimensions:d,clientSelection:s,movementMode:l,viewport:f}))},xi=e=>()=>t=>n=>{w(n,"INITIAL_PUBLISH")&&e.dragging(),w(n,"DROP_ANIMATE")&&e.dropping(n.payload.completed.result.reason),(w(n,"FLUSH")||w(n,"DROP_COMPLETE"))&&e.resting(),t(n)};const mt={outOfTheWay:"cubic-bezier(0.2, 0, 0, 1)",drop:"cubic-bezier(.2,1,.1,1)"},fe={opacity:{drop:0,combining:.7},scale:{drop:.75}},Mn={outOfTheWay:.2,minDropTime:.33,maxDropTime:.55},K=`${Mn.outOfTheWay}s ${mt.outOfTheWay}`,ae={fluid:`opacity ${K}`,snap:`transform ${K}, opacity ${K}`,drop:e=>{const t=`${e}s ${mt.drop}`;return`transform ${t}, opacity ${t}`},outOfTheWay:`transform ${K}`,placeholder:`height ${K}, width ${K}, margin ${K}`},Mt=e=>q(e,O)?void 0:`translate(${e.x}px, ${e.y}px)`,Ze={moveTo:Mt,drop:(e,t)=>{const n=Mt(e);if(n)return t?`${n} scale(${fe.scale.drop})`:n}},{minDropTime:Qe,maxDropTime:Fn}=Mn,Ii=Fn-Qe,Ft=1500,Si=.6;var Ci=({current:e,destination:t,reason:n})=>{const r=de(e,t);if(r<=0)return Qe;if(r>=Ft)return Fn;const o=r/Ft,i=Qe+Ii*o,s=n==="CANCEL"?i*Si:i;return Number(s.toFixed(2))},Ei=({impact:e,draggable:t,dimensions:n,viewport:r,afterCritical:o})=>{const{draggables:i,droppables:s}=n,l=$(e),c=l?s[l]:null,u=s[t.descriptor.droppableId],p=Bn({impact:e,draggable:t,draggables:i,afterCritical:o,droppable:c||u,viewport:r});return W(p,t.client.borderBox.center)},Ai=({draggables:e,reason:t,lastImpact:n,home:r,viewport:o,onLiftImpact:i})=>!n.at||t!=="DROP"?{impact:Pn({draggables:e,impact:i,destination:r,viewport:o,forceShouldAnimate:!0}),didDropInsideDroppable:!1}:n.at.type==="REORDER"?{impact:n,didDropInsideDroppable:!0}:{impact:{...n,displaced:ue},didDropInsideDroppable:!0};const wi=({getState:e,dispatch:t})=>n=>r=>{if(!w(r,"DROP")){n(r);return}const o=e(),i=r.payload.reason;if(o.phase==="COLLECTING"){t(Di({reason:i}));return}if(o.phase==="IDLE")return;o.phase==="DROP_PENDING"&&o.isWaiting&&b(),o.phase==="DRAGGING"||o.phase==="DROP_PENDING"||b();const l=o.critical,c=o.dimensions,u=c.draggables[o.critical.draggable.id],{impact:p,didDropInsideDroppable:a}=Ai({reason:i,lastImpact:o.impact,afterCritical:o.afterCritical,onLiftImpact:o.onLiftImpact,home:o.dimensions.droppables[o.critical.droppable.id],viewport:o.viewport,draggables:o.dimensions.draggables}),d=a?lt(p):null,f=a?Ne(p):null,g={index:l.draggable.index,droppableId:l.droppable.id},m={draggableId:u.descriptor.id,type:u.descriptor.type,source:g,reason:i,mode:o.movementMode,destination:d,combine:f},h=Ei({impact:p,draggable:u,dimensions:c,viewport:o.viewport,afterCritical:o.afterCritical}),D={critical:o.critical,afterCritical:o.afterCritical,result:m,impact:p};if(!(!q(o.current.client.offset,h)||!!m.combine)){t(gt({completed:D}));return}const R=Ci({current:o.current.client.offset,destination:h,reason:i});t(vi({newHomeClientOffset:h,dropDuration:R,completed:D}))};var Wn=()=>({x:window.pageXOffset,y:window.pageYOffset});function Ri(e){return{eventName:"scroll",options:{passive:!0,capture:!1},fn:t=>{t.target!==window&&t.target!==window.document||e()}}}function Pi({onWindowScroll:e}){function t(){e(Wn())}const n=ce(t),r=Ri(n);let o=z;function i(){return o!==z}function s(){i()&&b(),o=H(window,[r])}function l(){i()||b(),n.cancel(),o(),o=z}return{start:s,stop:l,isActive:i}}const Bi=e=>w(e,"DROP_COMPLETE")||w(e,"DROP_ANIMATE")||w(e,"FLUSH"),Ni=e=>{const t=Pi({onWindowScroll:n=>{e.dispatch(pi({newScroll:n}))}});return n=>r=>{!t.isActive()&&w(r,"INITIAL_PUBLISH")&&t.start(),t.isActive()&&Bi(r)&&t.stop(),n(r)}};var Oi=e=>{let t=!1,n=!1;const r=setTimeout(()=>{n=!0}),o=i=>{t||n||(t=!0,e(i),clearTimeout(r))};return o.wasCalled=()=>t,o},Ti=()=>{const e=[],t=o=>{const i=e.findIndex(l=>l.timerId===o);i===-1&&b();const[s]=e.splice(i,1);s.callback()};return{add:o=>{const i=setTimeout(()=>t(i)),s={timerId:i,callback:o};e.push(s)},flush:()=>{if(!e.length)return;const o=[...e];e.length=0,o.forEach(i=>{clearTimeout(i.timerId),i.callback()})}}};const Li=(e,t)=>e==null&&t==null?!0:e==null||t==null?!1:e.droppableId===t.droppableId&&e.index===t.index,Gi=(e,t)=>e==null&&t==null?!0:e==null||t==null?!1:e.draggableId===t.draggableId&&e.droppableId===t.droppableId,Mi=(e,t)=>{if(e===t)return!0;const n=e.draggable.id===t.draggable.id&&e.draggable.droppableId===t.draggable.droppableId&&e.draggable.type===t.draggable.type&&e.draggable.index===t.draggable.index,r=e.droppable.id===t.droppable.id&&e.droppable.type===t.droppable.type;return n&&r},oe=(e,t)=>{t()},ve=(e,t)=>({draggableId:e.draggable.id,type:e.droppable.type,source:{droppableId:e.droppable.id,index:e.draggable.index},mode:t});function Ve(e,t,n,r){if(!e){n(r(t));return}const o=Oi(n);e(t,{announce:o}),o.wasCalled()||n(r(t))}var Fi=(e,t)=>{const n=Ti();let r=null;const o=(a,d)=>{r&&b(),oe("onBeforeCapture",()=>{const f=e().onBeforeCapture;f&&f({draggableId:a,mode:d})})},i=(a,d)=>{r&&b(),oe("onBeforeDragStart",()=>{const f=e().onBeforeDragStart;f&&f(ve(a,d))})},s=(a,d)=>{r&&b();const f=ve(a,d);r={mode:d,lastCritical:a,lastLocation:f.source,lastCombine:null},n.add(()=>{oe("onDragStart",()=>Ve(e().onDragStart,f,t,xe.onDragStart))})},l=(a,d)=>{const f=lt(d),g=Ne(d);r||b();const m=!Mi(a,r.lastCritical);m&&(r.lastCritical=a);const h=!Li(r.lastLocation,f);h&&(r.lastLocation=f);const D=!Gi(r.lastCombine,g);if(D&&(r.lastCombine=g),!m&&!h&&!D)return;const S={...ve(a,r.mode),combine:g,destination:f};n.add(()=>{oe("onDragUpdate",()=>Ve(e().onDragUpdate,S,t,xe.onDragUpdate))})},c=()=>{r||b(),n.flush()},u=a=>{r||b(),r=null,oe("onDragEnd",()=>Ve(e().onDragEnd,a,t,xe.onDragEnd))};return{beforeCapture:o,beforeStart:i,start:s,update:l,flush:c,drop:u,abort:()=>{if(!r)return;const a={...ve(r.lastCritical,r.mode),combine:null,destination:null,reason:"CANCEL"};u(a)}}},Wi=(e,t)=>{const n=Fi(e,t);return r=>o=>i=>{if(w(i,"BEFORE_INITIAL_CAPTURE")){n.beforeCapture(i.payload.draggableId,i.payload.movementMode);return}if(w(i,"INITIAL_PUBLISH")){const l=i.payload.critical;n.beforeStart(l,i.payload.movementMode),o(i),n.start(l,i.payload.movementMode);return}if(w(i,"DROP_COMPLETE")){const l=i.payload.completed.result;n.flush(),o(i),n.drop(l);return}if(o(i),w(i,"FLUSH")){n.abort();return}const s=r.getState();s.phase==="DRAGGING"&&n.update(s.critical,s.impact)}};const $i=e=>t=>n=>{if(!w(n,"DROP_ANIMATION_FINISHED")){t(n);return}const r=e.getState();r.phase!=="DROP_ANIMATING"&&b(),e.dispatch(gt({completed:r.completed}))},_i=e=>{let t=null,n=null;function r(){n&&(cancelAnimationFrame(n),n=null),t&&(t(),t=null)}return o=>i=>{if((w(i,"FLUSH")||w(i,"DROP_COMPLETE")||w(i,"DROP_ANIMATION_FINISHED"))&&r(),o(i),!w(i,"DROP_ANIMATE"))return;const s={eventName:"scroll",options:{capture:!0,passive:!1,once:!0},fn:function(){e.getState().phase==="DROP_ANIMATING"&&e.dispatch(Gn())}};n=requestAnimationFrame(()=>{n=null,t=H(window,[s])})}};var ki=e=>()=>t=>n=>{(w(n,"DROP_COMPLETE")||w(n,"FLUSH")||w(n,"DROP_ANIMATE"))&&e.stopPublishing(),t(n)},Hi=e=>{let t=!1;return()=>n=>r=>{if(w(r,"INITIAL_PUBLISH")){t=!0,e.tryRecordFocus(r.payload.critical.draggable.id),n(r),e.tryRestoreFocusRecorded();return}if(n(r),!!t){if(w(r,"FLUSH")){t=!1,e.tryRestoreFocusRecorded();return}if(w(r,"DROP_COMPLETE")){t=!1;const o=r.payload.completed.result;o.combine&&e.tryShiftRecord(o.draggableId,o.combine.draggableId),e.tryRestoreFocusRecorded()}}}};const Vi=e=>w(e,"DROP_COMPLETE")||w(e,"DROP_ANIMATE")||w(e,"FLUSH");var ji=e=>t=>n=>r=>{if(Vi(r)){e.stop(),n(r);return}if(w(r,"INITIAL_PUBLISH")){n(r);const o=t.getState();o.phase!=="DRAGGING"&&b(),e.start(o);return}n(r),e.scroll(t.getState())};const Ui=e=>t=>n=>{if(t(n),!w(n,"PUBLISH_WHILE_DRAGGING"))return;const r=e.getState();r.phase==="DROP_PENDING"&&(r.isWaiting||e.dispatch(Ln({reason:r.reason})))},zi=gr;var qi=({dimensionMarshal:e,focusMarshal:t,styleMarshal:n,getResponders:r,announce:o,autoScroller:i})=>pr(ri,zi(mr(xi(n),ki(e),yi(e),wi,$i,_i,Ui,ji(i),Ni,Hi(t),Wi(r,o))));const je=()=>({additions:{},removals:{},modified:{}});function Yi({registry:e,callbacks:t}){let n=je(),r=null;const o=()=>{r||(t.collectionStarting(),r=requestAnimationFrame(()=>{r=null;const{additions:c,removals:u,modified:p}=n,a=Object.keys(c).map(g=>e.draggable.getById(g).getDimension(O)).sort((g,m)=>g.descriptor.index-m.descriptor.index),d=Object.keys(p).map(g=>{const h=e.droppable.getById(g).callbacks.getScrollWhileDragging();return{droppableId:g,scroll:h}}),f={additions:a,removals:Object.keys(u),modified:d};n=je(),t.publish(f)}))};return{add:c=>{const u=c.descriptor.id;n.additions[u]=c,n.modified[c.descriptor.droppableId]=!0,n.removals[u]&&delete n.removals[u],o()},remove:c=>{const u=c.descriptor;n.removals[u.id]=!0,n.modified[u.droppableId]=!0,n.additions[u.id]&&delete n.additions[u.id],o()},stop:()=>{r&&(cancelAnimationFrame(r),r=null,n=je())}}}var $n=({scrollHeight:e,scrollWidth:t,height:n,width:r})=>{const o=W({x:t,y:e},{x:r,y:n});return{x:Math.max(0,o.x),y:Math.max(0,o.y)}},_n=()=>{const e=document.documentElement;return e||b(),e},kn=()=>{const e=_n();return $n({scrollHeight:e.scrollHeight,scrollWidth:e.scrollWidth,width:e.clientWidth,height:e.clientHeight})},Ki=()=>{const e=Wn(),t=kn(),n=e.y,r=e.x,o=_n(),i=o.clientWidth,s=o.clientHeight,l=r+i,c=n+s;return{frame:j({top:n,left:r,right:l,bottom:c}),scroll:{initial:e,current:e,max:t,diff:{value:O,displacement:O}}}},Ji=({critical:e,scrollOptions:t,registry:n})=>{const r=Ki(),o=r.scroll.current,i=e.droppable,s=n.droppable.getAllByType(i.type).map(p=>p.callbacks.getDimensionAndWatchScroll(o,t)),l=n.draggable.getAllByType(e.draggable.type).map(p=>p.getDimension(o));return{dimensions:{draggables:mn(l),droppables:gn(s)},critical:e,viewport:r}};function Wt(e,t,n){return!(n.descriptor.id===t.id||n.descriptor.type!==t.type||e.droppable.getById(n.descriptor.droppableId).descriptor.mode!=="virtual")}var Xi=(e,t)=>{let n=null;const r=Yi({callbacks:{publish:t.publishWhileDragging,collectionStarting:t.collectionStarting},registry:e}),o=(d,f)=>{e.droppable.exists(d)||b(),n&&t.updateDroppableIsEnabled({id:d,isEnabled:f})},i=(d,f)=>{n&&(e.droppable.exists(d)||b(),t.updateDroppableIsCombineEnabled({id:d,isCombineEnabled:f}))},s=(d,f)=>{n&&(e.droppable.exists(d)||b(),t.updateDroppableScroll({id:d,newScroll:f}))},l=(d,f)=>{n&&e.droppable.getById(d).callbacks.scroll(f)},c=()=>{if(!n)return;r.stop();const d=n.critical.droppable;e.droppable.getAllByType(d.type).forEach(f=>f.callbacks.dragStopped()),n.unsubscribe(),n=null},u=d=>{n||b();const f=n.critical.draggable;d.type==="ADDITION"&&Wt(e,f,d.value)&&r.add(d.value),d.type==="REMOVAL"&&Wt(e,f,d.value)&&r.remove(d.value)};return{updateDroppableIsEnabled:o,updateDroppableIsCombineEnabled:i,scrollDroppable:l,updateDroppableScroll:s,startPublishing:d=>{n&&b();const f=e.draggable.getById(d.draggableId),g=e.droppable.getById(f.descriptor.droppableId),m={draggable:f.descriptor,droppable:g.descriptor},h=e.subscribe(u);return n={critical:m,unsubscribe:h},Ji({critical:m,registry:e,scrollOptions:d.scrollOptions})},stopPublishing:c}},Hn=(e,t)=>e.phase==="IDLE"?!0:e.phase!=="DROP_ANIMATING"||e.completed.result.draggableId===t?!1:e.completed.result.reason==="DROP",Zi=e=>{window.scrollBy(e.x,e.y)};const Qi=N(e=>Be(e).filter(t=>!(!t.isEnabled||!t.frame))),es=(e,t)=>Qi(t).find(r=>(r.frame||b(),En(r.frame.pageMarginBox)(e)))||null;var ts=({center:e,destination:t,droppables:n})=>{if(t){const o=n[t];return o.frame?o:null}return es(e,n)};const ge={startFromPercentage:.25,maxScrollAtPercentage:.05,maxPixelScroll:28,ease:e=>e**2,durationDampening:{stopDampeningAt:1200,accelerateAt:360},disabled:!1};var ns=(e,t,n=()=>ge)=>{const r=n(),o=e[t.size]*r.startFromPercentage,i=e[t.size]*r.maxScrollAtPercentage;return{startScrollingFrom:o,maxScrollValueAt:i}},Vn=({startOfRange:e,endOfRange:t,current:n})=>{const r=t-e;return r===0?0:(n-e)/r},bt=1,rs=(e,t,n=()=>ge)=>{const r=n();if(e>t.startScrollingFrom)return 0;if(e<=t.maxScrollValueAt)return r.maxPixelScroll;if(e===t.startScrollingFrom)return bt;const i=1-Vn({startOfRange:t.maxScrollValueAt,endOfRange:t.startScrollingFrom,current:e}),s=r.maxPixelScroll*r.ease(i);return Math.ceil(s)},os=(e,t,n)=>{const r=n(),o=r.durationDampening.accelerateAt,i=r.durationDampening.stopDampeningAt,s=t,l=i,u=Date.now()-s;if(u>=i)return e;if(u<o)return bt;const p=Vn({startOfRange:o,endOfRange:l,current:u}),a=e*r.ease(p);return Math.ceil(a)},$t=({distanceToEdge:e,thresholds:t,dragStartTime:n,shouldUseTimeDampening:r,getAutoScrollerOptions:o})=>{const i=rs(e,t,o);return i===0?0:r?Math.max(os(i,n,o),bt):i},_t=({container:e,distanceToEdges:t,dragStartTime:n,axis:r,shouldUseTimeDampening:o,getAutoScrollerOptions:i})=>{const s=ns(e,r,i);return t[r.end]<t[r.start]?$t({distanceToEdge:t[r.end],thresholds:s,dragStartTime:n,shouldUseTimeDampening:o,getAutoScrollerOptions:i}):-1*$t({distanceToEdge:t[r.start],thresholds:s,dragStartTime:n,shouldUseTimeDampening:o,getAutoScrollerOptions:i})},is=({container:e,subject:t,proposedScroll:n})=>{const r=t.height>e.height,o=t.width>e.width;return!o&&!r?n:o&&r?null:{x:o?0:n.x,y:r?0:n.y}};const ss=fn(e=>e===0?0:e);var jn=({dragStartTime:e,container:t,subject:n,center:r,shouldUseTimeDampening:o,getAutoScrollerOptions:i})=>{const s={top:r.y-t.top,right:t.right-r.x,bottom:t.bottom-r.y,left:r.x-t.left},l=_t({container:t,distanceToEdges:s,dragStartTime:e,axis:at,shouldUseTimeDampening:o,getAutoScrollerOptions:i}),c=_t({container:t,distanceToEdges:s,dragStartTime:e,axis:vn,shouldUseTimeDampening:o,getAutoScrollerOptions:i}),u=ss({x:c,y:l});if(q(u,O))return null;const p=is({container:t,subject:n,proposedScroll:u});return p?q(p,O)?null:p:null};const ls=fn(e=>e===0?0:e>0?1:-1),ht=(()=>{const e=(t,n)=>t<0?t:t>n?t-n:0;return({current:t,max:n,change:r})=>{const o=T(t,r),i={x:e(o.x,n.x),y:e(o.y,n.y)};return q(i,O)?null:i}})(),Un=({max:e,current:t,change:n})=>{const r={x:Math.max(t.x,e.x),y:Math.max(t.y,e.y)},o=ls(n),i=ht({max:r,current:t,change:o});return!i||o.x!==0&&i.x===0||o.y!==0&&i.y===0},vt=(e,t)=>Un({current:e.scroll.current,max:e.scroll.max,change:t}),as=(e,t)=>{if(!vt(e,t))return null;const n=e.scroll.max,r=e.scroll.current;return ht({current:r,max:n,change:t})},Dt=(e,t)=>{const n=e.frame;return n?Un({current:n.scroll.current,max:n.scroll.max,change:t}):!1},cs=(e,t)=>{const n=e.frame;return!n||!Dt(e,t)?null:ht({current:n.scroll.current,max:n.scroll.max,change:t})};var ds=({viewport:e,subject:t,center:n,dragStartTime:r,shouldUseTimeDampening:o,getAutoScrollerOptions:i})=>{const s=jn({dragStartTime:r,container:e.frame,subject:t,center:n,shouldUseTimeDampening:o,getAutoScrollerOptions:i});return s&&vt(e,s)?s:null},us=({droppable:e,subject:t,center:n,dragStartTime:r,shouldUseTimeDampening:o,getAutoScrollerOptions:i})=>{const s=e.frame;if(!s)return null;const l=jn({dragStartTime:r,container:s.pageMarginBox,subject:t,center:n,shouldUseTimeDampening:o,getAutoScrollerOptions:i});return l&&Dt(e,l)?l:null},kt=({state:e,dragStartTime:t,shouldUseTimeDampening:n,scrollWindow:r,scrollDroppable:o,getAutoScrollerOptions:i})=>{const s=e.current.page.borderBoxCenter,c=e.dimensions.draggables[e.critical.draggable.id].page.marginBox;if(e.isWindowScrollAllowed){const a=e.viewport,d=ds({dragStartTime:t,viewport:a,subject:c,center:s,shouldUseTimeDampening:n,getAutoScrollerOptions:i});if(d){r(d);return}}const u=ts({center:s,destination:$(e.impact),droppables:e.dimensions.droppables});if(!u)return;const p=us({dragStartTime:t,droppable:u,subject:c,center:s,shouldUseTimeDampening:n,getAutoScrollerOptions:i});p&&o(u.descriptor.id,p)},ps=({scrollWindow:e,scrollDroppable:t,getAutoScrollerOptions:n=()=>ge})=>{const r=ce(e),o=ce(t);let i=null;const s=u=>{i||b();const{shouldUseTimeDampening:p,dragStartTime:a}=i;kt({state:u,scrollWindow:r,scrollDroppable:o,dragStartTime:a,shouldUseTimeDampening:p,getAutoScrollerOptions:n})};return{start:u=>{i&&b();const p=Date.now();let a=!1;const d=()=>{a=!0};kt({state:u,dragStartTime:0,shouldUseTimeDampening:!1,scrollWindow:d,scrollDroppable:d,getAutoScrollerOptions:n}),i={dragStartTime:p,shouldUseTimeDampening:a},a&&s(u)},stop:()=>{i&&(r.cancel(),o.cancel(),i=null)},scroll:s}},fs=({move:e,scrollDroppable:t,scrollWindow:n})=>{const r=(l,c)=>{const u=T(l.current.client.selection,c);e({client:u})},o=(l,c)=>{if(!Dt(l,c))return c;const u=cs(l,c);if(!u)return t(l.descriptor.id,c),null;const p=W(c,u);return t(l.descriptor.id,p),W(c,p)},i=(l,c,u)=>{if(!l||!vt(c,u))return u;const p=as(c,u);if(!p)return n(u),null;const a=W(u,p);return n(a),W(u,a)};return l=>{const c=l.scrollJumpRequest;if(!c)return;const u=$(l.impact);u||b();const p=o(l.dimensions.droppables[u],c);if(!p)return;const a=l.viewport,d=i(l.isWindowScrollAllowed,a,p);d&&r(l,d)}},gs=({scrollDroppable:e,scrollWindow:t,move:n,getAutoScrollerOptions:r})=>{const o=ps({scrollWindow:t,scrollDroppable:e,getAutoScrollerOptions:r}),i=fs({move:n,scrollWindow:t,scrollDroppable:e});return{scroll:c=>{if(!(r().disabled||c.phase!=="DRAGGING")){if(c.movementMode==="FLUID"){o.scroll(c);return}c.scrollJumpRequest&&i(c)}},start:o.start,stop:o.stop}};const Q="data-rfd",ee=(()=>{const e=`${Q}-drag-handle`;return{base:e,draggableId:`${e}-draggable-id`,contextId:`${e}-context-id`}})(),et=(()=>{const e=`${Q}-draggable`;return{base:e,contextId:`${e}-context-id`,id:`${e}-id`}})(),ms=(()=>{const e=`${Q}-droppable`;return{base:e,contextId:`${e}-context-id`,id:`${e}-id`}})(),Ht={contextId:`${Q}-scroll-container-context-id`},bs=e=>t=>`[${t}="${e}"]`,ie=(e,t)=>e.map(n=>{const r=n.styles[t];return r?`${n.selector} { ${r} }`:""}).join(" "),hs="pointer-events: none;";var vs=e=>{const t=bs(e),n=(()=>{const l=`
      cursor: -webkit-grab;
      cursor: grab;
    `;return{selector:t(ee.contextId),styles:{always:`
          -webkit-touch-callout: none;
          -webkit-tap-highlight-color: rgba(0,0,0,0);
          touch-action: manipulation;
        `,resting:l,dragging:hs,dropAnimating:l}}})(),r=(()=>{const l=`
      transition: ${ae.outOfTheWay};
    `;return{selector:t(et.contextId),styles:{dragging:l,dropAnimating:l,userCancel:l}}})(),o={selector:t(ms.contextId),styles:{always:"overflow-anchor: none;"}},s=[r,n,o,{selector:"body",styles:{dragging:`
        cursor: grabbing;
        cursor: -webkit-grabbing;
        user-select: none;
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        overflow-anchor: none;
      `}}];return{always:ie(s,"always"),resting:ie(s,"resting"),dragging:ie(s,"dragging"),dropAnimating:ie(s,"dropAnimating"),userCancel:ie(s,"userCancel")}};const _=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?I.useLayoutEffect:I.useEffect,Ue=()=>{const e=document.querySelector("head");return e||b(),e},Vt=e=>{const t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.type="text/css",t};function Ds(e,t){const n=A(()=>vs(e),[e]),r=I.useRef(null),o=I.useRef(null),i=v(N(a=>{const d=o.current;d||b(),d.textContent=a}),[]),s=v(a=>{const d=r.current;d||b(),d.textContent=a},[]);_(()=>{!r.current&&!o.current||b();const a=Vt(t),d=Vt(t);return r.current=a,o.current=d,a.setAttribute(`${Q}-always`,e),d.setAttribute(`${Q}-dynamic`,e),Ue().appendChild(a),Ue().appendChild(d),s(n.always),i(n.resting),()=>{const f=g=>{const m=g.current;m||b(),Ue().removeChild(m),g.current=null};f(r),f(o)}},[t,s,i,n.always,n.resting,e]);const l=v(()=>i(n.dragging),[i,n.dragging]),c=v(a=>{if(a==="DROP"){i(n.dropAnimating);return}i(n.userCancel)},[i,n.dropAnimating,n.userCancel]),u=v(()=>{o.current&&i(n.resting)},[i,n.resting]);return A(()=>({dragging:l,dropping:c,resting:u}),[l,c,u])}function zn(e,t){return Array.from(e.querySelectorAll(t))}var qn=e=>e&&e.ownerDocument&&e.ownerDocument.defaultView?e.ownerDocument.defaultView:window;function Le(e){return e instanceof qn(e).HTMLElement}function ys(e,t){const n=`[${ee.contextId}="${e}"]`,r=zn(document,n);if(!r.length)return null;const o=r.find(i=>i.getAttribute(ee.draggableId)===t);return!o||!Le(o)?null:o}function xs(e){const t=I.useRef({}),n=I.useRef(null),r=I.useRef(null),o=I.useRef(!1),i=v(function(d,f){const g={id:d,focus:f};return t.current[d]=g,function(){const h=t.current;h[d]!==g&&delete h[d]}},[]),s=v(function(d){const f=ys(e,d);f&&f!==document.activeElement&&f.focus()},[e]),l=v(function(d,f){n.current===d&&(n.current=f)},[]),c=v(function(){r.current||o.current&&(r.current=requestAnimationFrame(()=>{r.current=null;const d=n.current;d&&s(d)}))},[s]),u=v(function(d){n.current=null;const f=document.activeElement;f&&f.getAttribute(ee.draggableId)===d&&(n.current=d)},[]);return _(()=>(o.current=!0,function(){o.current=!1;const d=r.current;d&&cancelAnimationFrame(d)}),[]),A(()=>({register:i,tryRecordFocus:u,tryRestoreFocusRecorded:c,tryShiftRecord:l}),[i,u,c,l])}function Is(){const e={draggables:{},droppables:{}},t=[];function n(a){return t.push(a),function(){const f=t.indexOf(a);f!==-1&&t.splice(f,1)}}function r(a){t.length&&t.forEach(d=>d(a))}function o(a){return e.draggables[a]||null}function i(a){const d=o(a);return d||b(),d}const s={register:a=>{e.draggables[a.descriptor.id]=a,r({type:"ADDITION",value:a})},update:(a,d)=>{const f=e.draggables[d.descriptor.id];f&&f.uniqueId===a.uniqueId&&(delete e.draggables[d.descriptor.id],e.draggables[a.descriptor.id]=a)},unregister:a=>{const d=a.descriptor.id,f=o(d);f&&a.uniqueId===f.uniqueId&&(delete e.draggables[d],e.droppables[a.descriptor.droppableId]&&r({type:"REMOVAL",value:a}))},getById:i,findById:o,exists:a=>!!o(a),getAllByType:a=>Object.values(e.draggables).filter(d=>d.descriptor.type===a)};function l(a){return e.droppables[a]||null}function c(a){const d=l(a);return d||b(),d}const u={register:a=>{e.droppables[a.descriptor.id]=a},unregister:a=>{const d=l(a.descriptor.id);d&&a.uniqueId===d.uniqueId&&delete e.droppables[a.descriptor.id]},getById:c,findById:l,exists:a=>!!l(a),getAllByType:a=>Object.values(e.droppables).filter(d=>d.descriptor.type===a)};function p(){e.draggables={},e.droppables={},t.length=0}return{draggable:s,droppable:u,subscribe:n,clean:p}}function Ss(){const e=A(Is,[]);return I.useEffect(()=>function(){e.clean()},[e]),e}var yt=P.createContext(null),we=()=>{const e=document.body;return e||b(),e};const Cs={position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",overflow:"hidden",clip:"rect(0 0 0 0)","clip-path":"inset(100%)"},Es=e=>`rfd-announcement-${e}`;function As(e){const t=A(()=>Es(e),[e]),n=I.useRef(null);return I.useEffect(function(){const i=document.createElement("div");return n.current=i,i.id=t,i.setAttribute("aria-live","assertive"),i.setAttribute("aria-atomic","true"),tn(i.style,Cs),we().appendChild(i),function(){setTimeout(function(){const c=we();c.contains(i)&&c.removeChild(i),i===n.current&&(n.current=null)})}},[t]),v(o=>{const i=n.current;if(i){i.textContent=o;return}},[])}const ws={separator:"::"};function xt(e,t=ws){const n=P.useId();return A(()=>`${e}${t.separator}${n}`,[t.separator,e,n])}function Rs({contextId:e,uniqueId:t}){return`rfd-hidden-text-${e}-${t}`}function Ps({contextId:e,text:t}){const n=xt("hidden-text",{separator:"-"}),r=A(()=>Rs({contextId:e,uniqueId:n}),[n,e]);return I.useEffect(function(){const i=document.createElement("div");return i.id=r,i.textContent=t,i.style.display="none",we().appendChild(i),function(){const l=we();l.contains(i)&&l.removeChild(i)}},[r,t]),r}var Ge=P.createContext(null);function Yn(e){const t=I.useRef(e);return I.useEffect(()=>{t.current=e}),t}function Bs(){let e=null;function t(){return!!e}function n(s){return s===e}function r(s){e&&b();const l={abandon:s};return e=l,l}function o(){e||b(),e=null}function i(){e&&(e.abandon(),o())}return{isClaimed:t,isActive:n,claim:r,release:o,tryAbandon:i}}function me(e){return e.phase==="IDLE"||e.phase==="DROP_ANIMATING"?!1:e.isDragging}const Ns=9,Os=13,It=27,Kn=32,Ts=33,Ls=34,Gs=35,Ms=36,Fs=37,Ws=38,$s=39,_s=40,ks={[Os]:!0,[Ns]:!0};var Jn=e=>{ks[e.keyCode]&&e.preventDefault()};const Me=(()=>{const e="visibilitychange";return typeof document>"u"?e:[e,`ms${e}`,`webkit${e}`,`moz${e}`,`o${e}`].find(r=>`on${r}`in document)||e})(),Xn=0,jt=5;function Hs(e,t){return Math.abs(t.x-e.x)>=jt||Math.abs(t.y-e.y)>=jt}const Ut={type:"IDLE"};function Vs({cancel:e,completed:t,getPhase:n,setPhase:r}){return[{eventName:"mousemove",fn:o=>{const{button:i,clientX:s,clientY:l}=o;if(i!==Xn)return;const c={x:s,y:l},u=n();if(u.type==="DRAGGING"){o.preventDefault(),u.actions.move(c);return}u.type!=="PENDING"&&b();const p=u.point;if(!Hs(p,c))return;o.preventDefault();const a=u.actions.fluidLift(c);r({type:"DRAGGING",actions:a})}},{eventName:"mouseup",fn:o=>{const i=n();if(i.type!=="DRAGGING"){e();return}o.preventDefault(),i.actions.drop({shouldBlockNextClick:!0}),t()}},{eventName:"mousedown",fn:o=>{n().type==="DRAGGING"&&o.preventDefault(),e()}},{eventName:"keydown",fn:o=>{if(n().type==="PENDING"){e();return}if(o.keyCode===It){o.preventDefault(),e();return}Jn(o)}},{eventName:"resize",fn:e},{eventName:"scroll",options:{passive:!0,capture:!1},fn:()=>{n().type==="PENDING"&&e()}},{eventName:"webkitmouseforcedown",fn:o=>{const i=n();if(i.type==="IDLE"&&b(),i.actions.shouldRespectForcePress()){e();return}o.preventDefault()}},{eventName:Me,fn:e}]}function js(e){const t=I.useRef(Ut),n=I.useRef(z),r=A(()=>({eventName:"mousedown",fn:function(a){if(a.defaultPrevented||a.button!==Xn||a.ctrlKey||a.metaKey||a.shiftKey||a.altKey)return;const d=e.findClosestDraggableId(a);if(!d)return;const f=e.tryGetLock(d,s,{sourceEvent:a});if(!f)return;a.preventDefault();const g={x:a.clientX,y:a.clientY};n.current(),u(f,g)}}),[e]),o=A(()=>({eventName:"webkitmouseforcewillbegin",fn:p=>{if(p.defaultPrevented)return;const a=e.findClosestDraggableId(p);if(!a)return;const d=e.findOptionsForDraggable(a);d&&(d.shouldRespectForcePress||e.canGetLock(a)&&p.preventDefault())}}),[e]),i=v(function(){const a={passive:!1,capture:!0};n.current=H(window,[o,r],a)},[o,r]),s=v(()=>{t.current.type!=="IDLE"&&(t.current=Ut,n.current(),i())},[i]),l=v(()=>{const p=t.current;s(),p.type==="DRAGGING"&&p.actions.cancel({shouldBlockNextClick:!0}),p.type==="PENDING"&&p.actions.abort()},[s]),c=v(function(){const a={capture:!0,passive:!1},d=Vs({cancel:l,completed:s,getPhase:()=>t.current,setPhase:f=>{t.current=f}});n.current=H(window,d,a)},[l,s]),u=v(function(a,d){t.current.type!=="IDLE"&&b(),t.current={type:"PENDING",point:d,actions:a},c()},[c]);_(function(){return i(),function(){n.current()}},[i])}function Us(){}const zs={[Ls]:!0,[Ts]:!0,[Ms]:!0,[Gs]:!0};function qs(e,t){function n(){t(),e.cancel()}function r(){t(),e.drop()}return[{eventName:"keydown",fn:o=>{if(o.keyCode===It){o.preventDefault(),n();return}if(o.keyCode===Kn){o.preventDefault(),r();return}if(o.keyCode===_s){o.preventDefault(),e.moveDown();return}if(o.keyCode===Ws){o.preventDefault(),e.moveUp();return}if(o.keyCode===$s){o.preventDefault(),e.moveRight();return}if(o.keyCode===Fs){o.preventDefault(),e.moveLeft();return}if(zs[o.keyCode]){o.preventDefault();return}Jn(o)}},{eventName:"mousedown",fn:n},{eventName:"mouseup",fn:n},{eventName:"click",fn:n},{eventName:"touchstart",fn:n},{eventName:"resize",fn:n},{eventName:"wheel",fn:n,options:{passive:!0}},{eventName:Me,fn:n}]}function Ys(e){const t=I.useRef(Us),n=A(()=>({eventName:"keydown",fn:function(i){if(i.defaultPrevented||i.keyCode!==Kn)return;const s=e.findClosestDraggableId(i);if(!s)return;const l=e.tryGetLock(s,p,{sourceEvent:i});if(!l)return;i.preventDefault();let c=!0;const u=l.snapLift();t.current();function p(){c||b(),c=!1,t.current(),r()}t.current=H(window,qs(u,p),{capture:!0,passive:!1})}}),[e]),r=v(function(){const i={passive:!1,capture:!0};t.current=H(window,[n],i)},[n]);_(function(){return r(),function(){t.current()}},[r])}const ze={type:"IDLE"},Ks=120,Js=.15;function Xs({cancel:e,getPhase:t}){return[{eventName:"orientationchange",fn:e},{eventName:"resize",fn:e},{eventName:"contextmenu",fn:n=>{n.preventDefault()}},{eventName:"keydown",fn:n=>{if(t().type!=="DRAGGING"){e();return}n.keyCode===It&&n.preventDefault(),e()}},{eventName:Me,fn:e}]}function Zs({cancel:e,completed:t,getPhase:n}){return[{eventName:"touchmove",options:{capture:!1},fn:r=>{const o=n();if(o.type!=="DRAGGING"){e();return}o.hasMoved=!0;const{clientX:i,clientY:s}=r.touches[0],l={x:i,y:s};r.preventDefault(),o.actions.move(l)}},{eventName:"touchend",fn:r=>{const o=n();if(o.type!=="DRAGGING"){e();return}r.preventDefault(),o.actions.drop({shouldBlockNextClick:!0}),t()}},{eventName:"touchcancel",fn:r=>{if(n().type!=="DRAGGING"){e();return}r.preventDefault(),e()}},{eventName:"touchforcechange",fn:r=>{const o=n();o.type==="IDLE"&&b();const i=r.touches[0];if(!i||!(i.force>=Js))return;const l=o.actions.shouldRespectForcePress();if(o.type==="PENDING"){l&&e();return}if(l){if(o.hasMoved){r.preventDefault();return}e();return}r.preventDefault()}},{eventName:Me,fn:e}]}function Qs(e){const t=I.useRef(ze),n=I.useRef(z),r=v(function(){return t.current},[]),o=v(function(f){t.current=f},[]),i=A(()=>({eventName:"touchstart",fn:function(f){if(f.defaultPrevented)return;const g=e.findClosestDraggableId(f);if(!g)return;const m=e.tryGetLock(g,l,{sourceEvent:f});if(!m)return;const h=f.touches[0],{clientX:D,clientY:S}=h,R={x:D,y:S};n.current(),a(m,R)}}),[e]),s=v(function(){const f={capture:!0,passive:!1};n.current=H(window,[i],f)},[i]),l=v(()=>{const d=t.current;d.type!=="IDLE"&&(d.type==="PENDING"&&clearTimeout(d.longPressTimerId),o(ze),n.current(),s())},[s,o]),c=v(()=>{const d=t.current;l(),d.type==="DRAGGING"&&d.actions.cancel({shouldBlockNextClick:!0}),d.type==="PENDING"&&d.actions.abort()},[l]),u=v(function(){const f={capture:!0,passive:!1},g={cancel:c,completed:l,getPhase:r},m=H(window,Zs(g),f),h=H(window,Xs(g),f);n.current=function(){m(),h()}},[c,r,l]),p=v(function(){const f=r();f.type!=="PENDING"&&b();const g=f.actions.fluidLift(f.point);o({type:"DRAGGING",actions:g,hasMoved:!1})},[r,o]),a=v(function(f,g){r().type!=="IDLE"&&b();const m=setTimeout(p,Ks);o({type:"PENDING",point:g,actions:f,longPressTimerId:m}),u()},[u,r,o,p]);_(function(){return s(),function(){n.current();const g=r();g.type==="PENDING"&&(clearTimeout(g.longPressTimerId),o(ze))}},[r,s,o]),_(function(){return H(window,[{eventName:"touchmove",fn:()=>{},options:{capture:!1,passive:!1}}])},[])}const el=["input","button","textarea","select","option","optgroup","video","audio"];function Zn(e,t){if(t==null)return!1;if(el.includes(t.tagName.toLowerCase()))return!0;const r=t.getAttribute("contenteditable");return r==="true"||r===""?!0:t===e?!1:Zn(e,t.parentElement)}function tl(e,t){const n=t.target;return Le(n)?Zn(e,n):!1}var nl=e=>j(e.getBoundingClientRect()).center;function rl(e){return e instanceof qn(e).Element}const ol=(()=>{const e="matches";return typeof document>"u"?e:[e,"msMatchesSelector","webkitMatchesSelector"].find(r=>r in Element.prototype)||e})();function Qn(e,t){return e==null?null:e[ol](t)?e:Qn(e.parentElement,t)}function il(e,t){return e.closest?e.closest(t):Qn(e,t)}function sl(e){return`[${ee.contextId}="${e}"]`}function ll(e,t){const n=t.target;if(!rl(n))return null;const r=sl(e),o=il(n,r);return!o||!Le(o)?null:o}function al(e,t){const n=ll(e,t);return n?n.getAttribute(ee.draggableId):null}function cl(e,t){const n=`[${et.contextId}="${e}"]`,o=zn(document,n).find(i=>i.getAttribute(et.id)===t);return!o||!Le(o)?null:o}function dl(e){e.preventDefault()}function De({expected:e,phase:t,isLockActive:n,shouldWarn:r}){return!(!n()||e!==t)}function er({lockAPI:e,store:t,registry:n,draggableId:r}){if(e.isClaimed())return!1;const o=n.draggable.findById(r);return!(!o||!o.options.isEnabled||!Hn(t.getState(),r))}function ul({lockAPI:e,contextId:t,store:n,registry:r,draggableId:o,forceSensorStop:i,sourceEvent:s}){if(!er({lockAPI:e,store:n,registry:r,draggableId:o}))return null;const c=r.draggable.getById(o),u=cl(t,c.descriptor.id);if(!u||s&&!c.options.canDragInteractiveElements&&tl(u,s))return null;const p=e.claim(i||z);let a="PRE_DRAG";function d(){return c.options.shouldRespectForcePress}function f(){return e.isActive(p)}function g(C,E){De({expected:C,phase:a,isLockActive:f,shouldWarn:!0})&&n.dispatch(E())}const m=g.bind(null,"DRAGGING");function h(C){function E(){e.release(),a="COMPLETED"}a!=="PRE_DRAG"&&(E(),b()),n.dispatch(ii(C.liftActionArgs)),a="DRAGGING";function G(B,U={shouldBlockNextClick:!1}){if(C.cleanup(),U.shouldBlockNextClick){const L=H(window,[{eventName:"click",fn:dl,options:{once:!0,passive:!1,capture:!0}}]);setTimeout(L)}E(),n.dispatch(Ln({reason:B}))}return{isActive:()=>De({expected:"DRAGGING",phase:a,isLockActive:f,shouldWarn:!1}),shouldRespectForcePress:d,drop:B=>G("DROP",B),cancel:B=>G("CANCEL",B),...C.actions}}function D(C){const E=ce(B=>{m(()=>Tn({client:B}))});return{...h({liftActionArgs:{id:o,clientSelection:C,movementMode:"FLUID"},cleanup:()=>E.cancel(),actions:{move:E}}),move:E}}function S(){const C={moveUp:()=>m(gi),moveRight:()=>m(bi),moveDown:()=>m(mi),moveLeft:()=>m(hi)};return h({liftActionArgs:{id:o,clientSelection:nl(u),movementMode:"SNAP"},cleanup:z,actions:C})}function R(){De({expected:"PRE_DRAG",phase:a,isLockActive:f,shouldWarn:!0})&&e.release()}return{isActive:()=>De({expected:"PRE_DRAG",phase:a,isLockActive:f,shouldWarn:!1}),shouldRespectForcePress:d,fluidLift:D,snapLift:S,abort:R}}const pl=[js,Ys,Qs];function fl({contextId:e,store:t,registry:n,customSensors:r,enableDefaultSensors:o}){const i=[...o?pl:[],...r||[]],s=I.useState(()=>Bs())[0],l=v(function(h,D){me(h)&&!me(D)&&s.tryAbandon()},[s]);_(function(){let h=t.getState();return t.subscribe(()=>{const S=t.getState();l(h,S),h=S})},[s,t,l]),_(()=>s.tryAbandon,[s.tryAbandon]);const c=v(m=>er({lockAPI:s,registry:n,store:t,draggableId:m}),[s,n,t]),u=v((m,h,D)=>ul({lockAPI:s,registry:n,contextId:e,store:t,draggableId:m,forceSensorStop:h||null,sourceEvent:D&&D.sourceEvent?D.sourceEvent:null}),[e,s,n,t]),p=v(m=>al(e,m),[e]),a=v(m=>{const h=n.draggable.findById(m);return h?h.options:null},[n.draggable]),d=v(function(){s.isClaimed()&&(s.tryAbandon(),t.getState().phase!=="IDLE"&&t.dispatch(ft()))},[s,t]),f=v(()=>s.isClaimed(),[s]),g=A(()=>({canGetLock:c,tryGetLock:u,findClosestDraggableId:p,findOptionsForDraggable:a,tryReleaseLock:d,isLockClaimed:f}),[c,u,p,a,d,f]);for(let m=0;m<i.length;m++)i[m](g)}const gl=e=>({onBeforeCapture:t=>{const n=()=>{e.onBeforeCapture&&e.onBeforeCapture(t)};nn.flushSync(n)},onBeforeDragStart:e.onBeforeDragStart,onDragStart:e.onDragStart,onDragEnd:e.onDragEnd,onDragUpdate:e.onDragUpdate}),ml=e=>({...ge,...e.autoScrollerOptions,durationDampening:{...ge.durationDampening,...e.autoScrollerOptions}});function se(e){return e.current||b(),e.current}function bl(e){const{contextId:t,setCallbacks:n,sensors:r,nonce:o,dragHandleUsageInstructions:i}=e,s=I.useRef(null),l=Yn(e),c=v(()=>gl(l.current),[l]),u=v(()=>ml(l.current),[l]),p=As(t),a=Ps({contextId:t,text:i}),d=Ds(t,o),f=v(L=>{se(s).dispatch(L)},[]),g=A(()=>Ct({publishWhileDragging:li,updateDroppableScroll:ci,updateDroppableIsEnabled:di,updateDroppableIsCombineEnabled:ui,collectionStarting:ai},f),[f]),m=Ss(),h=A(()=>Xi(m,g),[m,g]),D=A(()=>gs({scrollWindow:Zi,scrollDroppable:h.scrollDroppable,getAutoScrollerOptions:u,...Ct({move:Tn},f)}),[h.scrollDroppable,f,u]),S=xs(t),R=A(()=>qi({announce:p,autoScroller:D,dimensionMarshal:h,focusMarshal:S,getResponders:c,styleMarshal:d}),[p,D,h,S,c,d]);s.current=R;const x=v(()=>{const L=se(s);L.getState().phase!=="IDLE"&&L.dispatch(ft())},[]),C=v(()=>{const L=se(s).getState();return L.phase==="DROP_ANIMATING"?!0:L.phase==="IDLE"?!1:L.isDragging},[]),E=A(()=>({isDragging:C,tryAbort:x}),[C,x]);n(E);const G=v(L=>Hn(se(s).getState(),L),[]),B=v(()=>J(se(s).getState()),[]),U=A(()=>({marshal:h,focus:S,contextId:t,canLift:G,isMovementAllowed:B,dragHandleUsageInstructionsId:a,registry:m}),[t,h,a,S,G,B,m]);return fl({contextId:t,store:R,registry:m,customSensors:r||null,enableDefaultSensors:e.enableDefaultSensors!==!1}),I.useEffect(()=>x,[x]),P.createElement(Ge.Provider,{value:U},P.createElement(ur,{context:yt,store:R},e.children))}function hl(){return P.useId()}function vl(e){const t=hl(),n=e.dragHandleUsageInstructions||xe.dragHandleUsageInstructions;return P.createElement(Yr,null,r=>P.createElement(bl,{nonce:e.nonce,contextId:t,setCallbacks:r,dragHandleUsageInstructions:n,enableDefaultSensors:e.enableDefaultSensors,sensors:e.sensors,onBeforeCapture:e.onBeforeCapture,onBeforeDragStart:e.onBeforeDragStart,onDragStart:e.onDragStart,onDragUpdate:e.onDragUpdate,onDragEnd:e.onDragEnd,autoScrollerOptions:e.autoScrollerOptions},e.children))}const zt={dragging:5e3,dropAnimating:4500},Dl=(e,t)=>t?ae.drop(t.duration):e?ae.snap:ae.fluid,yl=(e,t)=>{if(e)return t?fe.opacity.drop:fe.opacity.combining},xl=e=>e.forceShouldAnimate!=null?e.forceShouldAnimate:e.mode==="SNAP";function Il(e){const n=e.dimension.client,{offset:r,combineWith:o,dropping:i}=e,s=!!o,l=xl(e),c=!!i,u=c?Ze.drop(r,s):Ze.moveTo(r);return{position:"fixed",top:n.marginBox.top,left:n.marginBox.left,boxSizing:"border-box",width:n.borderBox.width,height:n.borderBox.height,transition:Dl(l,i),transform:u,opacity:yl(s,c),zIndex:c?zt.dropAnimating:zt.dragging,pointerEvents:"none"}}function Sl(e){return{transform:Ze.moveTo(e.offset),transition:e.shouldAnimateDisplacement?void 0:"none"}}function Cl(e){return e.type==="DRAGGING"?Il(e):Sl(e)}function El(e,t,n=O){const r=window.getComputedStyle(t),o=t.getBoundingClientRect(),i=an(o,r),s=Se(i,n),l={client:i,tagName:t.tagName.toLowerCase(),display:r.display},c={x:i.marginBox.width,y:i.marginBox.height};return{descriptor:e,placeholder:l,displaceBy:c,client:i,page:s}}function Al(e){const t=xt("draggable"),{descriptor:n,registry:r,getDraggableRef:o,canDragInteractiveElements:i,shouldRespectForcePress:s,isEnabled:l}=e,c=A(()=>({canDragInteractiveElements:i,shouldRespectForcePress:s,isEnabled:l}),[i,l,s]),u=v(f=>{const g=o();return g||b(),El(n,g,f)},[n,o]),p=A(()=>({uniqueId:t,descriptor:n,options:c,getDimension:u}),[n,u,c,t]),a=I.useRef(p),d=I.useRef(!0);_(()=>(r.draggable.register(a.current),()=>r.draggable.unregister(a.current)),[r.draggable]),_(()=>{if(d.current){d.current=!1;return}const f=a.current;a.current=p,r.draggable.update(p,f)},[p,r.draggable])}var St=P.createContext(null);function Re(e){const t=I.useContext(e);return t||b(),t}function wl(e){e.preventDefault()}const Rl=e=>{const t=I.useRef(null),n=v((E=null)=>{t.current=E},[]),r=v(()=>t.current,[]),{contextId:o,dragHandleUsageInstructionsId:i,registry:s}=Re(Ge),{type:l,droppableId:c}=Re(St),u=A(()=>({id:e.draggableId,index:e.index,type:l,droppableId:c}),[e.draggableId,e.index,l,c]),{children:p,draggableId:a,isEnabled:d,shouldRespectForcePress:f,canDragInteractiveElements:g,isClone:m,mapped:h,dropAnimationFinished:D}=e;if(!m){const E=A(()=>({descriptor:u,registry:s,getDraggableRef:r,canDragInteractiveElements:g,shouldRespectForcePress:f,isEnabled:d}),[u,s,r,g,f,d]);Al(E)}const S=A(()=>d?{tabIndex:0,role:"button","aria-describedby":i,"data-rfd-drag-handle-draggable-id":a,"data-rfd-drag-handle-context-id":o,draggable:!1,onDragStart:wl}:null,[o,i,a,d]),R=v(E=>{h.type==="DRAGGING"&&h.dropping&&E.propertyName==="transform"&&nn.flushSync(D)},[D,h]),x=A(()=>{const E=Cl(h),G=h.type==="DRAGGING"&&h.dropping?R:void 0;return{innerRef:n,draggableProps:{"data-rfd-draggable-context-id":o,"data-rfd-draggable-id":a,style:E,onTransitionEnd:G},dragHandleProps:S}},[o,S,a,h,R,n]),C=A(()=>({draggableId:u.id,type:u.type,source:{index:u.index,droppableId:u.droppableId}}),[u.droppableId,u.id,u.index,u.type]);return P.createElement(P.Fragment,null,p(x,h.snapshot,C))};var tr=(e,t)=>e===t,nr=e=>{const{combine:t,destination:n}=e;return n?n.droppableId:t?t.droppableId:null};const Pl=e=>e.combine?e.combine.draggableId:null,Bl=e=>e.at&&e.at.type==="COMBINE"?e.at.combine.draggableId:null;function Nl(){const e=N((o,i)=>({x:o,y:i})),t=N((o,i,s=null,l=null,c=null)=>({isDragging:!0,isClone:i,isDropAnimating:!!c,dropAnimation:c,mode:o,draggingOver:s,combineWith:l,combineTargetFor:null})),n=N((o,i,s,l,c=null,u=null,p=null)=>({mapped:{type:"DRAGGING",dropping:null,draggingOver:c,combineWith:u,mode:i,offset:o,dimension:s,forceShouldAnimate:p,snapshot:t(i,l,c,u,null)}}));return(o,i)=>{if(me(o)){if(o.critical.draggable.id!==i.draggableId)return null;const s=o.current.client.offset,l=o.dimensions.draggables[i.draggableId],c=$(o.impact),u=Bl(o.impact),p=o.forceShouldAnimate;return n(e(s.x,s.y),o.movementMode,l,i.isClone,c,u,p)}if(o.phase==="DROP_ANIMATING"){const s=o.completed;if(s.result.draggableId!==i.draggableId)return null;const l=i.isClone,c=o.dimensions.draggables[i.draggableId],u=s.result,p=u.mode,a=nr(u),d=Pl(u),g={duration:o.dropDuration,curve:mt.drop,moveTo:o.newHomeClientOffset,opacity:d?fe.opacity.drop:null,scale:d?fe.scale.drop:null};return{mapped:{type:"DRAGGING",offset:o.newHomeClientOffset,dimension:c,dropping:g,draggingOver:a,combineWith:d,mode:p,forceShouldAnimate:null,snapshot:t(p,l,a,d,g)}}}return null}}function rr(e=null){return{isDragging:!1,isDropAnimating:!1,isClone:!1,dropAnimation:null,mode:null,draggingOver:null,combineTargetFor:e,combineWith:null}}const Ol={mapped:{type:"SECONDARY",offset:O,combineTargetFor:null,shouldAnimateDisplacement:!0,snapshot:rr(null)}};function Tl(){const e=N((s,l)=>({x:s,y:l})),t=N(rr),n=N((s,l=null,c)=>({mapped:{type:"SECONDARY",offset:s,combineTargetFor:l,shouldAnimateDisplacement:c,snapshot:t(l)}})),r=s=>s?n(O,s,!0):null,o=(s,l,c,u)=>{const p=c.displaced.visible[s],a=!!(u.inVirtualList&&u.effected[s]),d=Ne(c),f=d&&d.draggableId===s?l:null;if(!p){if(!a)return r(f);if(c.displaced.invisible[s])return null;const h=te(u.displacedBy.point),D=e(h.x,h.y);return n(D,f,!0)}if(a)return r(f);const g=c.displacedBy.point,m=e(g.x,g.y);return n(m,f,p.shouldAnimate)};return(s,l)=>{if(me(s))return s.critical.draggable.id===l.draggableId?null:o(l.draggableId,s.critical.draggable.id,s.impact,s.afterCritical);if(s.phase==="DROP_ANIMATING"){const c=s.completed;return c.result.draggableId===l.draggableId?null:o(l.draggableId,c.result.draggableId,c.impact,c.afterCritical)}return null}}const Ll=()=>{const e=Nl(),t=Tl();return(r,o)=>e(r,o)||t(r,o)||Ol},Gl={dropAnimationFinished:Gn},Ml=en(Ll,Gl,null,{context:yt,areStatePropsEqual:tr})(Rl);function or(e){return Re(St).isUsingCloneFor===e.draggableId&&!e.isClone?null:P.createElement(Ml,e)}function Fl(e){const t=typeof e.isDragDisabled=="boolean"?!e.isDragDisabled:!0,n=!!e.disableInteractiveElementBlocking,r=!!e.shouldRespectForcePress;return P.createElement(or,tn({},e,{isClone:!1,isEnabled:t,canDragInteractiveElements:n,shouldRespectForcePress:r}))}const ir=e=>t=>e===t,Wl=ir("scroll"),$l=ir("auto"),qt=(e,t)=>t(e.overflowX)||t(e.overflowY),_l=e=>{const t=window.getComputedStyle(e),n={overflowX:t.overflowX,overflowY:t.overflowY};return qt(n,Wl)||qt(n,$l)},kl=()=>!1,sr=e=>e==null?null:e===document.body?kl()?e:null:e===document.documentElement?null:_l(e)?e:sr(e.parentElement);var tt=e=>({x:e.scrollLeft,y:e.scrollTop});const lr=e=>e?window.getComputedStyle(e).position==="fixed"?!0:lr(e.parentElement):!1;var Hl=e=>{const t=sr(e),n=lr(e);return{closestScrollable:t,isFixedOnPage:n}},Vl=({descriptor:e,isEnabled:t,isCombineEnabled:n,isFixedOnPage:r,direction:o,client:i,page:s,closest:l})=>{const c=(()=>{if(!l)return null;const{scrollSize:d,client:f}=l,g=$n({scrollHeight:d.scrollHeight,scrollWidth:d.scrollWidth,height:f.paddingBox.height,width:f.paddingBox.width});return{pageMarginBox:l.page.marginBox,frameClient:f,scrollSize:d,shouldClipSubject:l.shouldClipSubject,scroll:{initial:l.scroll,current:l.scroll,max:g,diff:{value:O,displacement:O}}}})(),u=o==="vertical"?at:vn,p=Z({page:s,withPlaceholder:null,axis:u,frame:c});return{descriptor:e,isCombineEnabled:n,isFixedOnPage:r,axis:u,isEnabled:t,client:i,page:s,frame:c,subject:p}};const jl=(e,t)=>{const n=cn(e);if(!t||e!==t)return n;const r=n.paddingBox.top-t.scrollTop,o=n.paddingBox.left-t.scrollLeft,i=r+t.scrollHeight,s=o+t.scrollWidth,c=ot({top:r,right:s,bottom:i,left:o},n.border);return it({borderBox:c,margin:n.margin,border:n.border,padding:n.padding})};var Ul=({ref:e,descriptor:t,env:n,windowScroll:r,direction:o,isDropDisabled:i,isCombineEnabled:s,shouldClipSubject:l})=>{const c=n.closestScrollable,u=jl(e,c),p=Se(u,r),a=(()=>{if(!c)return null;const f=cn(c),g={scrollHeight:c.scrollHeight,scrollWidth:c.scrollWidth};return{client:f,page:Se(f,r),scroll:tt(c),scrollSize:g,shouldClipSubject:l}})();return Vl({descriptor:t,isEnabled:!i,isCombineEnabled:s,isFixedOnPage:n.isFixedOnPage,direction:o,client:u,page:p,closest:a})};const zl={passive:!1},ql={passive:!0};var Yt=e=>e.shouldPublishImmediately?zl:ql;const ye=e=>e&&e.env.closestScrollable||null;function Yl(e){const t=I.useRef(null),n=Re(Ge),r=xt("droppable"),{registry:o,marshal:i}=n,s=Yn(e),l=A(()=>({id:e.droppableId,type:e.type,mode:e.mode}),[e.droppableId,e.mode,e.type]),c=I.useRef(l),u=A(()=>N((x,C)=>{t.current||b();const E={x,y:C};i.updateDroppableScroll(l.id,E)}),[l.id,i]),p=v(()=>{const x=t.current;return!x||!x.env.closestScrollable?O:tt(x.env.closestScrollable)},[]),a=v(()=>{const x=p();u(x.x,x.y)},[p,u]),d=A(()=>ce(a),[a]),f=v(()=>{const x=t.current,C=ye(x);if(x&&C||b(),x.scrollOptions.shouldPublishImmediately){a();return}d()},[d,a]),g=v((x,C)=>{t.current&&b();const E=s.current,G=E.getDroppableRef();G||b();const B=Hl(G),U={ref:G,descriptor:l,env:B,scrollOptions:C};t.current=U;const L=Ul({ref:G,descriptor:l,env:B,windowScroll:x,direction:E.direction,isDropDisabled:E.isDropDisabled,isCombineEnabled:E.isCombineEnabled,shouldClipSubject:!E.ignoreContainerClipping}),F=B.closestScrollable;return F&&(F.setAttribute(Ht.contextId,n.contextId),F.addEventListener("scroll",f,Yt(U.scrollOptions))),L},[n.contextId,l,f,s]),m=v(()=>{const x=t.current,C=ye(x);return x&&C||b(),tt(C)},[]),h=v(()=>{const x=t.current;x||b();const C=ye(x);t.current=null,C&&(d.cancel(),C.removeAttribute(Ht.contextId),C.removeEventListener("scroll",f,Yt(x.scrollOptions)))},[f,d]),D=v(x=>{const C=t.current;C||b();const E=ye(C);E||b(),E.scrollTop+=x.y,E.scrollLeft+=x.x},[]),S=A(()=>({getDimensionAndWatchScroll:g,getScrollWhileDragging:m,dragStopped:h,scroll:D}),[h,g,m,D]),R=A(()=>({uniqueId:r,descriptor:l,callbacks:S}),[S,l,r]);_(()=>(c.current=R.descriptor,o.droppable.register(R),()=>{t.current&&h(),o.droppable.unregister(R)}),[S,l,h,R,i,o.droppable]),_(()=>{t.current&&i.updateDroppableIsEnabled(c.current.id,!e.isDropDisabled)},[e.isDropDisabled,i]),_(()=>{t.current&&i.updateDroppableIsCombineEnabled(c.current.id,e.isCombineEnabled)},[e.isCombineEnabled,i])}function qe(){}const Kt={width:0,height:0,margin:eo},Kl=({isAnimatingOpenOnMount:e,placeholder:t,animate:n})=>e||n==="close"?Kt:{height:t.client.borderBox.height,width:t.client.borderBox.width,margin:t.client.margin},Jl=({isAnimatingOpenOnMount:e,placeholder:t,animate:n})=>{const r=Kl({isAnimatingOpenOnMount:e,placeholder:t,animate:n});return{display:t.display,boxSizing:"border-box",width:r.width,height:r.height,marginTop:r.margin.top,marginRight:r.margin.right,marginBottom:r.margin.bottom,marginLeft:r.margin.left,flexShrink:"0",flexGrow:"0",pointerEvents:"none",transition:n!=="none"?ae.placeholder:null}},Xl=e=>{const t=I.useRef(null),n=v(()=>{t.current&&(clearTimeout(t.current),t.current=null)},[]),{animate:r,onTransitionEnd:o,onClose:i,contextId:s}=e,[l,c]=I.useState(e.animate==="open");I.useEffect(()=>l?r!=="open"?(n(),c(!1),qe):t.current?qe:(t.current=setTimeout(()=>{t.current=null,c(!1)}),n):qe,[r,l,n]);const u=v(a=>{a.propertyName==="height"&&(o(),r==="close"&&i())},[r,i,o]),p=Jl({isAnimatingOpenOnMount:l,animate:e.animate,placeholder:e.placeholder});return P.createElement(e.placeholder.tagName,{style:p,"data-rfd-placeholder-context-id":s,onTransitionEnd:u,ref:e.innerRef})};var Zl=P.memo(Xl);class Ql extends P.PureComponent{constructor(...t){super(...t),this.state={isVisible:!!this.props.on,data:this.props.on,animate:this.props.shouldAnimate&&this.props.on?"open":"none"},this.onClose=()=>{this.state.animate==="close"&&this.setState({isVisible:!1})}}static getDerivedStateFromProps(t,n){return t.shouldAnimate?t.on?{isVisible:!0,data:t.on,animate:"open"}:n.isVisible?{isVisible:!0,data:n.data,animate:"close"}:{isVisible:!1,animate:"close",data:null}:{isVisible:!!t.on,data:t.on,animate:"none"}}render(){if(!this.state.isVisible)return null;const t={onClose:this.onClose,data:this.state.data,animate:this.state.animate};return this.props.children(t)}}const ea=e=>{const t=I.useContext(Ge);t||b();const{contextId:n,isMovementAllowed:r}=t,o=I.useRef(null),i=I.useRef(null),{children:s,droppableId:l,type:c,mode:u,direction:p,ignoreContainerClipping:a,isDropDisabled:d,isCombineEnabled:f,snapshot:g,useClone:m,updateViewportMaxScroll:h,getContainerForClone:D}=e,S=v(()=>o.current,[]),R=v((F=null)=>{o.current=F},[]);v(()=>i.current,[]);const x=v((F=null)=>{i.current=F},[]),C=v(()=>{r()&&h({maxScroll:kn()})},[r,h]);Yl({droppableId:l,type:c,mode:u,direction:p,isDropDisabled:d,isCombineEnabled:f,ignoreContainerClipping:a,getDroppableRef:S});const E=A(()=>P.createElement(Ql,{on:e.placeholder,shouldAnimate:e.shouldAnimatePlaceholder},({onClose:F,data:Fe,animate:We})=>P.createElement(Zl,{placeholder:Fe,onClose:F,innerRef:x,animate:We,contextId:n,onTransitionEnd:C})),[n,C,e.placeholder,e.shouldAnimatePlaceholder,x]),G=A(()=>({innerRef:R,placeholder:E,droppableProps:{"data-rfd-droppable-id":l,"data-rfd-droppable-context-id":n}}),[n,l,E,R]),B=m?m.dragging.draggableId:null,U=A(()=>({droppableId:l,type:c,isUsingCloneFor:B}),[l,B,c]);function L(){if(!m)return null;const{dragging:F,render:Fe}=m,We=P.createElement(or,{draggableId:F.draggableId,index:F.source.index,isClone:!0,isEnabled:!0,shouldRespectForcePress:!1,canDragInteractiveElements:!0},(cr,dr)=>Fe(cr,dr,F));return fr.createPortal(We,D())}return P.createElement(St.Provider,{value:U},s(G,g),L())};function ta(){return document.body||b(),document.body}const Jt={mode:"standard",type:"DEFAULT",direction:"vertical",isDropDisabled:!1,isCombineEnabled:!1,ignoreContainerClipping:!1,renderClone:null,getContainerForClone:ta},ar=e=>{let t={...e},n;for(n in Jt)e[n]===void 0&&(t={...t,[n]:Jt[n]});return t},Ye=(e,t)=>e===t.droppable.type,Xt=(e,t)=>t.draggables[e.draggable.id],na=()=>{const e={placeholder:null,shouldAnimatePlaceholder:!0,snapshot:{isDraggingOver:!1,draggingOverWith:null,draggingFromThisWith:null,isUsingPlaceholder:!1},useClone:null},t={...e,shouldAnimatePlaceholder:!1},n=N(i=>({draggableId:i.id,type:i.type,source:{index:i.index,droppableId:i.droppableId}})),r=N((i,s,l,c,u,p)=>{const a=u.descriptor.id;if(u.descriptor.droppableId===i){const g=p?{render:p,dragging:n(u.descriptor)}:null,m={isDraggingOver:l,draggingOverWith:l?a:null,draggingFromThisWith:a,isUsingPlaceholder:!0};return{placeholder:u.placeholder,shouldAnimatePlaceholder:!1,snapshot:m,useClone:g}}if(!s)return t;if(!c)return e;const f={isDraggingOver:l,draggingOverWith:a,draggingFromThisWith:null,isUsingPlaceholder:!0};return{placeholder:u.placeholder,shouldAnimatePlaceholder:!0,snapshot:f,useClone:null}});return(i,s)=>{const l=ar(s),c=l.droppableId,u=l.type,p=!l.isDropDisabled,a=l.renderClone;if(me(i)){const d=i.critical;if(!Ye(u,d))return t;const f=Xt(d,i.dimensions),g=$(i.impact)===c;return r(c,p,g,g,f,a)}if(i.phase==="DROP_ANIMATING"){const d=i.completed;if(!Ye(u,d.critical))return t;const f=Xt(d.critical,i.dimensions);return r(c,p,nr(d.result)===c,$(d.impact)===c,f,a)}if(i.phase==="IDLE"&&i.completed&&!i.shouldFlush){const d=i.completed;if(!Ye(u,d.critical))return t;const f=$(d.impact)===c,g=!!(d.impact.at&&d.impact.at.type==="COMBINE"),m=d.critical.droppable.id===c;return f?g?e:t:m?e:t}return t}},ra={updateViewportMaxScroll:fi},oa=en(na,ra,(e,t,n)=>({...ar(n),...e,...t}),{context:yt,areStatePropsEqual:tr})(ea);var ia=oa;const sa=({sprint:e,...t})=>{const{t:n}=Pe();return y.jsx(rn,{fullWidth:!0,leftSection:y.jsx(nt,{size:12}),size:"xs",variant:"subtle",color:"gray.8",justify:"flex-start",onClick:()=>br(e,"statuses"),...t,children:n("entitySettings.statusSection.addStatus")})},la=({sprint:e,statusId:t,order:n,...r})=>{const{t:o}=Pe();return y.jsx(rn,{fullWidth:!0,leftSection:y.jsx(nt,{size:12}),size:"xs",variant:"transparent",justify:"flex-start",fw:400,color:"blue.5",onClick:()=>rt({defaultValues:{sprint:e,Status:t,Order:n}}),...r,children:o("sidebar.action.addTask")})},aa="_root_1cbze_1",ca="_header_1cbze_9",Zt={root:aa,header:ca},da=({status:e,count:t,sprint:n,order:r,children:o})=>{const{t:i}=Pe(),s=on(n.rootProjectId);return y.jsxs(y.Fragment,{children:[y.jsxs(Ke,{gap:8,py:8,px:6,justify:"space-between",className:Zt.header,children:[y.jsxs(Ke,{gap:8,miw:0,children:[y.jsx(hr,{label:e==null?void 0:e.Name,openDelay:400,children:y.jsx(vr,{status:e,truncate:!0})}),y.jsx(Dr,{size:"sm",c:"dark.2",style:{whiteSpace:"nowrap"},children:i("createTask.taskCount",{count:t})})]}),s.tasks.create&&y.jsx(yr,{size:24,variant:"subtle",color:"gray.7",onClick:()=>rt({defaultValues:{sprint:n,Status:e==null?void 0:e.Id,Order:r}}),children:y.jsx(nt,{size:18})})]}),y.jsx("div",{className:Zt.root,children:y.jsx(sn,{gap:0,p:6,children:o})})]})},ua=I.memo(({sprint:e,tasks:t,isError:n,isLoading:r,emptyState:o=null})=>{const{t:i}=Pe(),s=on(e.rootProjectId),[l,c]=I.useState(!1),{statuses:u}=xr(e),{types:p}=Ir(e.rootProjectId),{groupedData:a,onDragEnd:d}=Br({tasks:t,statuses:u,includeAllStatuses:!0}),f=I.useCallback(()=>{c(!0)},[]),g=I.useCallback((m,h)=>{c(!1),d(m,h)},[d]);return n?y.jsx(Sr,{message:i("notification.error.getSprint")}):r?y.jsx(Cr,{}):t!=null&&t.length?y.jsxs("div",{className:`${$e.root} ${l?$e.dragging:""}`,style:{gridTemplateColumns:`repeat(${a.length}, minmax(300px, 420px)) ${s.sprints.edit?"300px":""}`},children:[y.jsx(vl,{onDragStart:f,onDragEnd:g,children:a.map(({status:m,tasks:h})=>y.jsx(ia,{droppableId:m.Id.toString(),children:D=>y.jsx("div",{ref:D.innerRef,...D.droppableProps,children:y.jsxs(da,{count:h.length,status:m,sprint:e,order:Qt(h),children:[h.map((S,R)=>y.jsx(Fl,{draggableId:S.Id.toString(),index:R,isDragDisabled:!s.tasks.edit,children:x=>y.jsx("div",{ref:x.innerRef,...x.draggableProps,...x.dragHandleProps,children:y.jsx(Nr,{task:S,types:p,my:3},S.Id)})},S.Id)),D.placeholder,s.tasks.create&&y.jsx(la,{className:$e.createTaskKanban,sprint:e,statusId:m.Id,order:Qt(h,"last"),my:3,w:"fit-content"})]})})},m.Id))}),s.sprints.edit&&y.jsx("div",{children:y.jsx("div",{style:{backgroundColor:"light-dark(var(--mantine-color-gray-0), var(--mantine-color-dark-8))",borderRadius:4,position:"sticky",top:0},children:y.jsx(sa,{sprint:e,py:3})})})]}):y.jsx(y.Fragment,{children:o})}),Qt=(e,t="first")=>{const n=e.at(t==="first"?0:-1);if(n)return n.Order+(t==="first"?-1:1)},Ea=()=>{const e=Er(),{project:t,isFetching:n}=Ar(e==null?void 0:e.ProjectId);return n?y.jsx(wr,{h:"calc(100vh - 81px)"}):!e||!t?y.jsx(Or,{}):y.jsx(Rr,{projectId:t.Id,children:y.jsx(pa,{sprintData:e,projectData:t})})},pa=e=>{const{sprintData:t,search:n,setSearch:r,error:o,performerIds:i,handleAssign:s,isFetching:l,isError:c,isLoading:u,groupedBySprint:p,withFilters:a}=Tr(e);return c?y.jsx(Pr,{error:o}):y.jsxs(y.Fragment,{children:[y.jsx(Lr,{sprint:t}),y.jsxs(sn,{gap:"lg",flex:1,children:[y.jsx(Gr,{sprintData:t,search:n,setSearch:r,performerIds:i,setPerformerIds:s,loading:l}),y.jsx(Ke,{pos:"relative",flex:1,children:y.jsx(ua,{sprint:t,isError:c,isLoading:u,tasks:p[t.Id],emptyState:a?y.jsx(Mr,{onClick:()=>{s([]),r("")}}):y.jsx(Fr,{onClick:()=>rt({defaultValues:{sprint:t}})})})})]})]})};export{Ea as default};
