chordia-ui 3.3.8 → 3.3.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (159) hide show
  1. package/dist/AgentLiftCard.cjs.js.map +1 -1
  2. package/dist/AgentLiftCard.es.js +5 -3
  3. package/dist/AgentLiftCard.es.js.map +1 -1
  4. package/dist/CustomFilterChips.cjs.js.map +1 -1
  5. package/dist/CustomFilterChips.es.js +2 -1
  6. package/dist/CustomFilterChips.es.js.map +1 -1
  7. package/dist/FileUploadingState.cjs.js.map +1 -1
  8. package/dist/FileUploadingState.es.js +16 -10
  9. package/dist/FileUploadingState.es.js.map +1 -1
  10. package/dist/IntegrationCard.cjs.js.map +1 -1
  11. package/dist/IntegrationCard.es.js +3 -3
  12. package/dist/IntegrationCard.es.js.map +1 -1
  13. package/dist/SectionLabel.cjs.js.map +1 -1
  14. package/dist/SectionLabel.es.js.map +1 -1
  15. package/dist/SmallButton.cjs.js.map +1 -1
  16. package/dist/SmallButton.es.js +16 -16
  17. package/dist/SmallButton.es.js.map +1 -1
  18. package/dist/SummarySection.cjs.js.map +1 -1
  19. package/dist/SummarySection.es.js +11 -9
  20. package/dist/SummarySection.es.js.map +1 -1
  21. package/dist/TextInput.cjs.js.map +1 -1
  22. package/dist/TextInput.es.js.map +1 -1
  23. package/dist/Timeline.cjs.js.map +1 -1
  24. package/dist/Timeline.es.js +14 -8
  25. package/dist/Timeline.es.js.map +1 -1
  26. package/dist/Tooltip.cjs.js +1 -1
  27. package/dist/Tooltip.cjs.js.map +1 -1
  28. package/dist/Tooltip.es.js +31 -20
  29. package/dist/Tooltip.es.js.map +1 -1
  30. package/dist/TourGuideTooltip.cjs.js.map +1 -1
  31. package/dist/TourGuideTooltip.es.js +2 -1
  32. package/dist/TourGuideTooltip.es.js.map +1 -1
  33. package/dist/UpdatedInteractionRecording.cjs.js +1 -1
  34. package/dist/UpdatedInteractionRecording.cjs.js.map +1 -1
  35. package/dist/UpdatedInteractionRecording.es.js +79 -97
  36. package/dist/UpdatedInteractionRecording.es.js.map +1 -1
  37. package/dist/UploadInteraction.cjs.js.map +1 -1
  38. package/dist/UploadInteraction.es.js.map +1 -1
  39. package/dist/colors.cjs.js +2 -0
  40. package/dist/colors.cjs.js.map +1 -0
  41. package/dist/colors.es.js +2 -0
  42. package/dist/colors.es.js.map +1 -0
  43. package/dist/components/UpdatedInteractionDetails.cjs.js +10 -1
  44. package/dist/components/UpdatedInteractionDetails.cjs.js.map +1 -1
  45. package/dist/components/UpdatedInteractionDetails.es.js +1531 -9
  46. package/dist/components/UpdatedInteractionDetails.es.js.map +1 -1
  47. package/dist/components/chat.cjs.js +30 -1
  48. package/dist/components/chat.cjs.js.map +1 -1
  49. package/dist/components/chat.es.js +2222 -7
  50. package/dist/components/chat.es.js.map +1 -1
  51. package/dist/components/common.cjs.js +1 -1
  52. package/dist/components/common.es.js +32 -25
  53. package/dist/components/common.es.js.map +1 -1
  54. package/dist/components/data.cjs.js +1 -1
  55. package/dist/components/data.cjs.js.map +1 -1
  56. package/dist/components/data.es.js +1033 -4
  57. package/dist/components/data.es.js.map +1 -1
  58. package/dist/components/layout.cjs.js +3 -1
  59. package/dist/components/layout.cjs.js.map +1 -1
  60. package/dist/components/layout.es.js +1533 -8
  61. package/dist/components/layout.es.js.map +1 -1
  62. package/dist/components/login.cjs.js +1 -1
  63. package/dist/components/login.es.js +6 -2
  64. package/dist/components/login.es.js.map +1 -1
  65. package/dist/components/media.cjs.js +1 -1
  66. package/dist/components/media.cjs.js.map +1 -1
  67. package/dist/components/media.es.js +220 -6
  68. package/dist/components/media.es.js.map +1 -1
  69. package/dist/components/models.cjs.js +1 -1
  70. package/dist/components/models.cjs.js.map +1 -1
  71. package/dist/components/models.es.js +91 -2
  72. package/dist/components/models.es.js.map +1 -1
  73. package/dist/components/navigation.cjs.js +1 -1
  74. package/dist/components/navigation.cjs.js.map +1 -1
  75. package/dist/components/navigation.es.js +766 -7
  76. package/dist/components/navigation.es.js.map +1 -1
  77. package/dist/components/notifications.cjs.js +1 -1
  78. package/dist/components/notifications.cjs.js.map +1 -1
  79. package/dist/components/notifications.es.js +368 -3
  80. package/dist/components/notifications.es.js.map +1 -1
  81. package/dist/components/onboarding.cjs.js +1 -1
  82. package/dist/components/onboarding.cjs.js.map +1 -1
  83. package/dist/components/onboarding.es.js +985 -7
  84. package/dist/components/onboarding.es.js.map +1 -1
  85. package/dist/components/primitives.cjs.js +1 -1
  86. package/dist/components/primitives.cjs.js.map +1 -1
  87. package/dist/components/primitives.es.js +635 -25
  88. package/dist/components/primitives.es.js.map +1 -1
  89. package/dist/debugger-wc.cjs.js +4 -4
  90. package/dist/debugger-wc.cjs.js.map +1 -1
  91. package/dist/debugger-wc.es.js +15 -11
  92. package/dist/debugger-wc.es.js.map +1 -1
  93. package/dist/index.cjs.js +1 -1
  94. package/dist/index.cjs2.js +2 -49
  95. package/dist/index.cjs2.js.map +1 -1
  96. package/dist/index.cjs3.js +50 -0
  97. package/dist/index.cjs3.js.map +1 -0
  98. package/dist/index.es.js +104 -99
  99. package/dist/index.es.js.map +1 -1
  100. package/dist/index.es2.js +2632 -1776
  101. package/dist/index.es2.js.map +1 -1
  102. package/dist/index.es3.js +1944 -0
  103. package/dist/index.es3.js.map +1 -0
  104. package/dist/pages/interactionDetails.cjs.js +1 -1
  105. package/dist/pages/interactionDetails.cjs.js.map +1 -1
  106. package/dist/pages/interactionDetails.es.js +70 -47
  107. package/dist/pages/interactionDetails.es.js.map +1 -1
  108. package/dist/sortable.esm.cjs.js +1 -1
  109. package/dist/sortable.esm.cjs.js.map +1 -1
  110. package/dist/sortable.esm.es.js +55 -53
  111. package/dist/sortable.esm.es.js.map +1 -1
  112. package/dist/{chordia-ui.css → style.css} +1 -1
  113. package/package.json +1 -1
  114. package/src/components/UpdatedInteractionDetails/UpdatedInteractionDetails.jsx +318 -77
  115. package/src/components/UpdatedInteractionDetails/UpdatedInteractionRecording.jsx +7 -17
  116. package/dist/ChartRenderer.cjs.js +0 -31
  117. package/dist/ChartRenderer.cjs.js.map +0 -1
  118. package/dist/ChartRenderer.es.js +0 -2210
  119. package/dist/ChartRenderer.es.js.map +0 -1
  120. package/dist/GettingStarted.cjs.js +0 -2
  121. package/dist/GettingStarted.cjs.js.map +0 -1
  122. package/dist/GettingStarted.es.js +0 -983
  123. package/dist/GettingStarted.es.js.map +0 -1
  124. package/dist/InlineConfirm.cjs.js +0 -2
  125. package/dist/InlineConfirm.cjs.js.map +0 -1
  126. package/dist/InlineConfirm.es.js +0 -618
  127. package/dist/InlineConfirm.es.js.map +0 -1
  128. package/dist/InteractionSummaryCard.cjs.js +0 -2
  129. package/dist/InteractionSummaryCard.cjs.js.map +0 -1
  130. package/dist/InteractionSummaryCard.es.js +0 -216
  131. package/dist/InteractionSummaryCard.es.js.map +0 -1
  132. package/dist/LoginPage.cjs.js +0 -3
  133. package/dist/LoginPage.cjs.js.map +0 -1
  134. package/dist/LoginPage.es.js +0 -2618
  135. package/dist/LoginPage.es.js.map +0 -1
  136. package/dist/NavigationBar.cjs.js +0 -2
  137. package/dist/NavigationBar.cjs.js.map +0 -1
  138. package/dist/NavigationBar.es.js +0 -762
  139. package/dist/NavigationBar.es.js.map +0 -1
  140. package/dist/NotificationPanel.cjs.js +0 -2
  141. package/dist/NotificationPanel.cjs.js.map +0 -1
  142. package/dist/NotificationPanel.es.js +0 -371
  143. package/dist/NotificationPanel.es.js.map +0 -1
  144. package/dist/OverlayPanel.cjs.js +0 -2
  145. package/dist/OverlayPanel.cjs.js.map +0 -1
  146. package/dist/OverlayPanel.es.js +0 -93
  147. package/dist/OverlayPanel.es.js.map +0 -1
  148. package/dist/SplitPane.cjs.js +0 -4
  149. package/dist/SplitPane.cjs.js.map +0 -1
  150. package/dist/SplitPane.es.js +0 -1531
  151. package/dist/SplitPane.es.js.map +0 -1
  152. package/dist/SummaryStatsPanel.cjs.js +0 -2
  153. package/dist/SummaryStatsPanel.cjs.js.map +0 -1
  154. package/dist/SummaryStatsPanel.es.js +0 -1027
  155. package/dist/SummaryStatsPanel.es.js.map +0 -1
  156. package/dist/UpdatedInteractionDetails.cjs.js +0 -11
  157. package/dist/UpdatedInteractionDetails.cjs.js.map +0 -1
  158. package/dist/UpdatedInteractionDetails.es.js +0 -1310
  159. package/dist/UpdatedInteractionDetails.es.js.map +0 -1
@@ -2,5 +2,5 @@
2
2
  To pick up a draggable item, press the space bar.
3
3
  While dragging, use the arrow keys to move the item.
4
4
  Press space again to drop the item in its new position, or press escape to cancel.
5
- `},Yn={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function Kn(e){let{announcements:t=Yn,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=jn}=e;const{announce:i,announcement:s}=Fn(),a=Xe("DndLiveRegion"),[c,u]=l.useState(!1);if(l.useEffect(()=>{u(!0)},[]),Xn(l.useMemo(()=>({onDragStart(d){let{active:h}=d;i(t.onDragStart({active:h}))},onDragMove(d){let{active:h,over:g}=d;t.onDragMove&&i(t.onDragMove({active:h,over:g}))},onDragOver(d){let{active:h,over:g}=d;i(t.onDragOver({active:h,over:g}))},onDragEnd(d){let{active:h,over:g}=d;i(t.onDragEnd({active:h,over:g}))},onDragCancel(d){let{active:h,over:g}=d;i(t.onDragCancel({active:h,over:g}))}}),[i,t])),!c)return null;const f=l.createElement(l.Fragment,null,l.createElement(zn,{id:r,value:o.draggable}),l.createElement(Bn,{id:a,announcement:s}));return n?Ie.createPortal(f,n):f}var N;(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"})(N||(N={}));function Ze(){}function Un(e,t){return l.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function Wn(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return l.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const V=Object.freeze({x:0,y:0});function _t(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Hn(e,t){const n=Qe(e);if(!n)return"0 0";const r={x:(n.x-t.left)/t.width*100,y:(n.y-t.top)/t.height*100};return r.x+"% "+r.y+"%"}function Qt(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function Vn(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function Pt(e){let{left:t,top:n,height:r,width:o}=e;return[{x:t,y:n},{x:t+o,y:n},{x:t,y:n+r},{x:t+o,y:n+r}]}function Zt(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function zt(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}const qn=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=zt(t,t.left,t.top),i=[];for(const s of r){const{id:a}=s,c=n.get(a);if(c){const u=_t(zt(c),o);i.push({id:a,data:{droppableContainer:s,value:u}})}}return i.sort(Qt)},Gn=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=Pt(t),i=[];for(const s of r){const{id:a}=s,c=n.get(a);if(c){const u=Pt(c),f=o.reduce((h,g,x)=>h+_t(u[x],g),0),d=Number((f/4).toFixed(4));i.push({id:a,data:{droppableContainer:s,value:d}})}}return i.sort(Qt)};function Jn(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),s=o-r,a=i-n;if(r<o&&n<i){const c=t.width*t.height,u=e.width*e.height,f=s*a,d=f/(c+u-f);return Number(d.toFixed(4))}return 0}const _n=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const i of r){const{id:s}=i,a=n.get(s);if(a){const c=Jn(a,t);c>0&&o.push({id:s,data:{droppableContainer:i,value:c}})}}return o.sort(Vn)};function Qn(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function en(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:V}function Zn(e){return function(n){for(var r=arguments.length,o=new Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];return o.reduce((s,a)=>({...s,top:s.top+e*a.y,bottom:s.bottom+e*a.y,left:s.left+e*a.x,right:s.right+e*a.x}),{...n})}}const er=Zn(1);function tn(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]}}else 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}function tr(e,t,n){const r=tn(t);if(!r)return e;const{scaleX:o,scaleY:i,x:s,y:a}=r,c=e.left-s-(1-o)*parseFloat(n),u=e.top-a-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),f=o?e.width/o:e.width,d=i?e.height/i:e.height;return{width:f,height:d,top:u,right:c+f,bottom:u+d,left:c}}const nr={ignoreTransform:!1};function xe(e,t){t===void 0&&(t=nr);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:u,transformOrigin:f}=P(e).getComputedStyle(e);u&&(n=tr(n,u,f))}const{top:r,left:o,width:i,height:s,bottom:a,right:c}=n;return{top:r,left:o,width:i,height:s,bottom:a,right:c}}function Bt(e){return xe(e,{ignoreTransform:!0})}function rr(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function or(e,t){return t===void 0&&(t=P(e).getComputedStyle(e)),t.position==="fixed"}function ir(e,t){t===void 0&&(t=P(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{const i=t[o];return typeof i=="string"?n.test(i):!1})}function it(e,t){const n=[];function r(o){if(t!=null&&n.length>=t||!o)return n;if(yt(o)&&o.scrollingElement!=null&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!Be(o)||qt(o)||n.includes(o))return n;const i=P(e).getComputedStyle(o);return o!==e&&ir(o,i)&&n.push(o),or(o,i)?n:r(o.parentNode)}return e?r(e):n}function nn(e){const[t]=it(e,1);return t??null}function ft(e){return!nt||!e?null:ye(e)?e:mt(e)?yt(e)||e===we(e).scrollingElement?window:Be(e)?e:null:null}function rn(e){return ye(e)?e.scrollX:e.scrollLeft}function on(e){return ye(e)?e.scrollY:e.scrollTop}function vt(e){return{x:rn(e),y:on(e)}}var T;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(T||(T={}));function sn(e){return!nt||!e?!1:e===document.scrollingElement}function an(e){const t={x:0,y:0},n=sn(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},o=e.scrollTop<=t.y,i=e.scrollLeft<=t.x,s=e.scrollTop>=r.y,a=e.scrollLeft>=r.x;return{isTop:o,isLeft:i,isBottom:s,isRight:a,maxScroll:r,minScroll:t}}const sr={x:.2,y:.2};function ar(e,t,n,r,o){let{top:i,left:s,right:a,bottom:c}=n;r===void 0&&(r=10),o===void 0&&(o=sr);const{isTop:u,isBottom:f,isLeft:d,isRight:h}=an(e),g={x:0,y:0},x={x:0,y:0},v={height:t.height*o.y,width:t.width*o.x};return!u&&i<=t.top+v.height?(g.y=T.Backward,x.y=r*Math.abs((t.top+v.height-i)/v.height)):!f&&c>=t.bottom-v.height&&(g.y=T.Forward,x.y=r*Math.abs((t.bottom-v.height-c)/v.height)),!h&&a>=t.right-v.width?(g.x=T.Forward,x.x=r*Math.abs((t.right-v.width-a)/v.width)):!d&&s<=t.left+v.width&&(g.x=T.Backward,x.x=r*Math.abs((t.left+v.width-s)/v.width)),{direction:g,speed:x}}function lr(e){if(e===document.scrollingElement){const{innerWidth:i,innerHeight:s}=window;return{top:0,left:0,right:i,bottom:s,width:i,height:s}}const{top:t,left:n,right:r,bottom:o}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:o,width:e.clientWidth,height:e.clientHeight}}function ln(e){return e.reduce((t,n)=>me(t,vt(n)),V)}function cr(e){return e.reduce((t,n)=>t+rn(n),0)}function ur(e){return e.reduce((t,n)=>t+on(n),0)}function cn(e,t){if(t===void 0&&(t=xe),!e)return;const{top:n,left:r,bottom:o,right:i}=t(e);nn(e)&&(o<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const dr=[["x",["left","right"],cr],["y",["top","bottom"],ur]];class wt{constructor(t,n){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=it(n),o=ln(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[i,s,a]of dr)for(const c of s)Object.defineProperty(this,c,{get:()=>{const u=a(r),f=o[i]-u;return this.rect[c]+f},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Ne{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var o;(o=this.target)==null||o.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function fr(e){const{EventTarget:t}=P(e);return e instanceof t?e:we(e)}function gt(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var K;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(K||(K={}));function Ft(e){e.preventDefault()}function gr(e){e.stopPropagation()}var D;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(D||(D={}));const un={start:[D.Space,D.Enter],cancel:[D.Esc],end:[D.Space,D.Enter,D.Tab]},hr=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case D.Right:return{...n,x:n.x+25};case D.Left:return{...n,x:n.x-25};case D.Down:return{...n,y:n.y+25};case D.Up:return{...n,y:n.y-25}}};class xt{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new Ne(we(n)),this.windowListeners=new Ne(P(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(K.Resize,this.handleCancel),this.windowListeners.add(K.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(K.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&cn(r),n(V)}handleKeyDown(t){if(ot(t)){const{active:n,context:r,options:o}=this.props,{keyboardCodes:i=un,coordinateGetter:s=hr,scrollBehavior:a="smooth"}=o,{code:c}=t;if(i.end.includes(c)){this.handleEnd(t);return}if(i.cancel.includes(c)){this.handleCancel(t);return}const{collisionRect:u}=r.current,f=u?{x:u.left,y:u.top}:V;this.referenceCoordinates||(this.referenceCoordinates=f);const d=s(t,{active:n,context:r.current,currentCoordinates:f});if(d){const h=Pe(d,f),g={x:0,y:0},{scrollableAncestors:x}=r.current;for(const v of x){const p=t.code,{isTop:m,isRight:y,isLeft:b,isBottom:S,maxScroll:R,minScroll:E}=an(v),w=lr(v),C={x:Math.min(p===D.Right?w.right-w.width/2:w.right,Math.max(p===D.Right?w.left:w.left+w.width/2,d.x)),y:Math.min(p===D.Down?w.bottom-w.height/2:w.bottom,Math.max(p===D.Down?w.top:w.top+w.height/2,d.y))},O=p===D.Right&&!y||p===D.Left&&!b,I=p===D.Down&&!S||p===D.Up&&!m;if(O&&C.x!==d.x){const M=v.scrollLeft+h.x,U=p===D.Right&&M<=R.x||p===D.Left&&M>=E.x;if(U&&!h.y){v.scrollTo({left:M,behavior:a});return}U?g.x=v.scrollLeft-M:g.x=p===D.Right?v.scrollLeft-R.x:v.scrollLeft-E.x,g.x&&v.scrollBy({left:-g.x,behavior:a});break}else if(I&&C.y!==d.y){const M=v.scrollTop+h.y,U=p===D.Down&&M<=R.y||p===D.Up&&M>=E.y;if(U&&!h.x){v.scrollTo({top:M,behavior:a});return}U?g.y=v.scrollTop-M:g.y=p===D.Down?v.scrollTop-R.y:v.scrollTop-E.y,g.y&&v.scrollBy({top:-g.y,behavior:a});break}}this.handleMove(t,me(Pe(d,this.referenceCoordinates),g))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}xt.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=un,onActivation:o}=t,{active:i}=n;const{code:s}=e.nativeEvent;if(r.start.includes(s)){const a=i.activatorNode.current;return a&&e.target!==a?!1:(e.preventDefault(),o==null||o({event:e.nativeEvent}),!0)}return!1}}];function Xt(e){return!!(e&&"distance"in e)}function $t(e){return!!(e&&"delay"in e)}class Ct{constructor(t,n,r){var o;r===void 0&&(r=fr(t.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=t,this.events=n;const{event:i}=t,{target:s}=i;this.props=t,this.events=n,this.document=we(s),this.documentListeners=new Ne(this.document),this.listeners=new Ne(r),this.windowListeners=new Ne(P(s)),this.initialCoordinates=(o=Qe(i))!=null?o:V,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:t,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(K.Resize,this.handleCancel),this.windowListeners.add(K.DragStart,Ft),this.windowListeners.add(K.VisibilityChange,this.handleCancel),this.windowListeners.add(K.ContextMenu,Ft),this.documentListeners.add(K.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if($t(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(Xt(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:r,onPending:o}=this.props;o(r,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(K.Click,gr,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(K.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:o,props:i}=this,{onMove:s,options:{activationConstraint:a}}=i;if(!o)return;const c=(n=Qe(t))!=null?n:V,u=Pe(o,c);if(!r&&a){if(Xt(a)){if(a.tolerance!=null&&gt(u,a.tolerance))return this.handleCancel();if(gt(u,a.distance))return this.handleStart()}if($t(a)&&gt(u,a.tolerance))return this.handleCancel();this.handlePending(a,u);return}t.cancelable&&t.preventDefault(),s(c)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===D.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const vr={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Dt extends Ct{constructor(t){const{event:n}=t,r=we(n.target);super(t,vr,r)}}Dt.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r==null||r({event:n}),!0)}}];const pr={move:{name:"mousemove"},end:{name:"mouseup"}};var pt;(function(e){e[e.RightClick=2]="RightClick"})(pt||(pt={}));class br extends Ct{constructor(t){super(t,pr,we(t.event.target))}}br.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===pt.RightClick?!1:(r==null||r({event:n}),!0)}}];const ht={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class mr extends Ct{constructor(t){super(t,ht)}static setup(){return window.addEventListener(ht.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(ht.move.name,t)};function t(){}}}mr.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:o}=n;return o.length>1?!1:(r==null||r({event:n}),!0)}}];var Te;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Te||(Te={}));var et;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(et||(et={}));function yr(e){let{acceleration:t,activator:n=Te.Pointer,canScroll:r,draggingRect:o,enabled:i,interval:s=5,order:a=et.TreeOrder,pointerCoordinates:c,scrollableAncestors:u,scrollableAncestorRects:f,delta:d,threshold:h}=e;const g=xr({delta:d,disabled:!i}),[x,v]=Nn(),p=l.useRef({x:0,y:0}),m=l.useRef({x:0,y:0}),y=l.useMemo(()=>{switch(n){case Te.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case Te.DraggableRect:return o}},[n,o,c]),b=l.useRef(null),S=l.useCallback(()=>{const E=b.current;if(!E)return;const w=p.current.x*m.current.x,C=p.current.y*m.current.y;E.scrollBy(w,C)},[]),R=l.useMemo(()=>a===et.TreeOrder?[...u].reverse():u,[a,u]);l.useEffect(()=>{if(!i||!u.length||!y){v();return}for(const E of R){if((r==null?void 0:r(E))===!1)continue;const w=u.indexOf(E),C=f[w];if(!C)continue;const{direction:O,speed:I}=ar(E,C,y,t,h);for(const M of["x","y"])g[M][O[M]]||(I[M]=0,O[M]=0);if(I.x>0||I.y>0){v(),b.current=E,x(S,s),p.current=I,m.current=O;return}}p.current={x:0,y:0},m.current={x:0,y:0},v()},[t,S,r,v,i,s,JSON.stringify(y),JSON.stringify(g),x,u,R,f,JSON.stringify(h)])}const wr={x:{[T.Backward]:!1,[T.Forward]:!1},y:{[T.Backward]:!1,[T.Forward]:!1}};function xr(e){let{delta:t,disabled:n}=e;const r=_e(t);return Fe(o=>{if(n||!r||!o)return wr;const i={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[T.Backward]:o.x[T.Backward]||i.x===-1,[T.Forward]:o.x[T.Forward]||i.x===1},y:{[T.Backward]:o.y[T.Backward]||i.y===-1,[T.Forward]:o.y[T.Forward]||i.y===1}}},[n,t,r])}function Cr(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return Fe(o=>{var i;return t==null?null:(i=r??o)!=null?i:null},[r,t])}function Dr(e,t){return l.useMemo(()=>e.reduce((n,r)=>{const{sensor:o}=r,i=o.activators.map(s=>({eventName:s.eventName,handler:t(s.handler,r)}));return[...n,...i]},[]),[e,t])}var ze;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(ze||(ze={}));var bt;(function(e){e.Optimized="optimized"})(bt||(bt={}));const jt=new Map;function Sr(e,t){let{dragging:n,dependencies:r,config:o}=t;const[i,s]=l.useState(null),{frequency:a,measure:c,strategy:u}=o,f=l.useRef(e),d=p(),h=ke(d),g=l.useCallback(function(m){m===void 0&&(m=[]),!h.current&&s(y=>y===null?m:y.concat(m.filter(b=>!y.includes(b))))},[h]),x=l.useRef(null),v=Fe(m=>{if(d&&!n)return jt;if(!m||m===jt||f.current!==e||i!=null){const y=new Map;for(let b of e){if(!b)continue;if(i&&i.length>0&&!i.includes(b.id)&&b.rect.current){y.set(b.id,b.rect.current);continue}const S=b.node.current,R=S?new wt(c(S),S):null;b.rect.current=R,R&&y.set(b.id,R)}return y}return m},[e,i,n,d,c]);return l.useEffect(()=>{f.current=e},[e]),l.useEffect(()=>{d||g()},[n,d]),l.useEffect(()=>{i&&i.length>0&&s(null)},[JSON.stringify(i)]),l.useEffect(()=>{d||typeof a!="number"||x.current!==null||(x.current=setTimeout(()=>{g(),x.current=null},a))},[a,d,g,...r]),{droppableRects:v,measureDroppableContainers:g,measuringScheduled:i!=null};function p(){switch(u){case ze.Always:return!1;case ze.BeforeDragging:return n;default:return!n}}}function St(e,t){return Fe(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function Rr(e,t){return St(e,t)}function Er(e){let{callback:t,disabled:n}=e;const r=rt(t),o=l.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:i}=window;return new i(r)},[r,n]);return l.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function st(e){let{callback:t,disabled:n}=e;const r=rt(t),o=l.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:i}=window;return new i(r)},[n]);return l.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function Ar(e){return new wt(xe(e),e)}function Yt(e,t,n){t===void 0&&(t=Ar);const[r,o]=l.useState(null);function i(){o(c=>{if(!e)return null;if(e.isConnected===!1){var u;return(u=c??n)!=null?u:null}const f=t(e);return JSON.stringify(c)===JSON.stringify(f)?c:f})}const s=Er({callback(c){if(e)for(const u of c){const{type:f,target:d}=u;if(f==="childList"&&d instanceof HTMLElement&&d.contains(e)){i();break}}}}),a=st({callback:i});return H(()=>{i(),e?(a==null||a.observe(e),s==null||s.observe(document.body,{childList:!0,subtree:!0})):(a==null||a.disconnect(),s==null||s.disconnect())},[e]),r}function Mr(e){const t=St(e);return en(e,t)}const Kt=[];function Or(e){const t=l.useRef(e),n=Fe(r=>e?r&&r!==Kt&&e&&t.current&&e.parentNode===t.current.parentNode?r:it(e):Kt,[e]);return l.useEffect(()=>{t.current=e},[e]),n}function Ir(e){const[t,n]=l.useState(null),r=l.useRef(e),o=l.useCallback(i=>{const s=ft(i.target);s&&n(a=>a?(a.set(s,vt(s)),new Map(a)):null)},[]);return l.useEffect(()=>{const i=r.current;if(e!==i){s(i);const a=e.map(c=>{const u=ft(c);return u?(u.addEventListener("scroll",o,{passive:!0}),[u,vt(u)]):null}).filter(c=>c!=null);n(a.length?new Map(a):null),r.current=e}return()=>{s(e),s(i)};function s(a){a.forEach(c=>{const u=ft(c);u==null||u.removeEventListener("scroll",o)})}},[o,e]),l.useMemo(()=>e.length?t?Array.from(t.values()).reduce((i,s)=>me(i,s),V):ln(e):V,[e,t])}function Ut(e,t){t===void 0&&(t=[]);const n=l.useRef(null);return l.useEffect(()=>{n.current=null},t),l.useEffect(()=>{const r=e!==V;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?Pe(e,n.current):V}function Nr(e){l.useEffect(()=>{if(!nt)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n==null||n()}},e.map(t=>{let{sensor:n}=t;return n}))}function Tr(e,t){return l.useMemo(()=>e.reduce((n,r)=>{let{eventName:o,handler:i}=r;return n[o]=s=>{i(s,t)},n},{}),[e,t])}function dn(e){return l.useMemo(()=>e?rr(e):null,[e])}const Wt=[];function Lr(e,t){t===void 0&&(t=xe);const[n]=e,r=dn(n?P(n):null),[o,i]=l.useState(Wt);function s(){i(()=>e.length?e.map(c=>sn(c)?r:new wt(t(c),c)):Wt)}const a=st({callback:s});return H(()=>{a==null||a.disconnect(),s(),e.forEach(c=>a==null?void 0:a.observe(c))},[e]),o}function fn(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Be(t)?t:e}function kr(e){let{measure:t}=e;const[n,r]=l.useState(null),o=l.useCallback(u=>{for(const{target:f}of u)if(Be(f)){r(d=>{const h=t(f);return d?{...d,width:h.width,height:h.height}:h});break}},[t]),i=st({callback:o}),s=l.useCallback(u=>{const f=fn(u);i==null||i.disconnect(),f&&(i==null||i.observe(f)),r(f?t(f):null)},[t,i]),[a,c]=Je(s);return l.useMemo(()=>({nodeRef:a,rect:n,setRef:c}),[n,a,c])}const Pr=[{sensor:Dt,options:{}},{sensor:xt,options:{}}],zr={current:{}},Ge={draggable:{measure:Bt},droppable:{measure:Bt,strategy:ze.WhileDragging,frequency:bt.Optimized},dragOverlay:{measure:xe}};class Le extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const Br={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Le,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Ze},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Ge,measureDroppableContainers:Ze,windowRect:null,measuringScheduled:!1},gn={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Ze,draggableNodes:new Map,over:null,measureDroppableContainers:Ze},$e=l.createContext(gn),hn=l.createContext(Br);function Fr(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Le}}}function Xr(e,t){switch(t.type){case N.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case N.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case N.DragEnd:case N.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case N.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new Le(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case N.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const s=new Le(e.droppable.containers);return s.set(n,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:s}}}case N.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const i=new Le(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function $r(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=l.useContext($e),i=_e(r),s=_e(n==null?void 0:n.id);return l.useEffect(()=>{if(!t&&!r&&i&&s!=null){if(!ot(i)||document.activeElement===i.target)return;const a=o.get(s);if(!a)return;const{activatorNode:c,node:u}=a;if(!c.current&&!u.current)return;requestAnimationFrame(()=>{for(const f of[c.current,u.current]){if(!f)continue;const d=kn(f);if(d){d.focus();break}}})}},[r,t,o,s,i]),null}function vn(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((o,i)=>i({transform:o,...r}),n):n}function jr(e){return l.useMemo(()=>({draggable:{...Ge.draggable,...e==null?void 0:e.draggable},droppable:{...Ge.droppable,...e==null?void 0:e.droppable},dragOverlay:{...Ge.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function Yr(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const i=l.useRef(!1),{x:s,y:a}=typeof o=="boolean"?{x:o,y:o}:o;H(()=>{if(!s&&!a||!t){i.current=!1;return}if(i.current||!r)return;const u=t==null?void 0:t.node.current;if(!u||u.isConnected===!1)return;const f=n(u),d=en(f,r);if(s||(d.x=0),a||(d.y=0),i.current=!0,Math.abs(d.x)>0||Math.abs(d.y)>0){const h=nn(u);h&&h.scrollBy({top:d.y,left:d.x})}},[t,s,a,r,n])}const at=l.createContext({...V,scaleX:1,scaleY:1});var ce;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(ce||(ce={}));const Kr=l.memo(function(t){var n,r,o,i;let{id:s,accessibility:a,autoScroll:c=!0,children:u,sensors:f=Pr,collisionDetection:d=_n,measuring:h,modifiers:g,...x}=t;const v=l.useReducer(Xr,void 0,Fr),[p,m]=v,[y,b]=$n(),[S,R]=l.useState(ce.Uninitialized),E=S===ce.Initialized,{draggable:{active:w,nodes:C,translate:O},droppable:{containers:I}}=p,M=w!=null?C.get(w):null,U=l.useRef({initial:null,translated:null}),W=l.useMemo(()=>{var k;return w!=null?{id:w,data:(k=M==null?void 0:M.data)!=null?k:zr,rect:U}:null},[w,M]),q=l.useRef(null),[Ce,je]=l.useState(null),[B,Ye]=l.useState(null),Q=ke(x,Object.values(x)),De=Xe("DndDescribedBy",s),Ke=l.useMemo(()=>I.getEnabled(),[I]),z=jr(h),{droppableRects:Z,measureDroppableContainers:de,measuringScheduled:Se}=Sr(Ke,{dragging:E,dependencies:[O.x,O.y],config:z.droppable}),j=Cr(C,w),Ue=l.useMemo(()=>B?Qe(B):null,[B]),re=On(),ee=Rr(j,z.draggable.measure);Yr({activeNode:w!=null?C.get(w):null,config:re.layoutShiftCompensation,initialRect:ee,measure:z.draggable.measure});const A=Yt(j,z.draggable.measure,ee),Re=Yt(j?j.parentElement:null),G=l.useRef({activatorEvent:null,active:null,activeNode:j,collisionRect:null,collisions:null,droppableRects:Z,draggableNodes:C,draggingNode:null,draggingNodeRect:null,droppableContainers:I,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),fe=I.getNodeFor((n=G.current.over)==null?void 0:n.id),te=kr({measure:z.dragOverlay.measure}),ge=(r=te.nodeRef.current)!=null?r:j,he=E?(o=te.rect)!=null?o:A:null,Et=!!(te.nodeRef.current&&te.rect),At=Mr(Et?null:A),lt=dn(ge?P(ge):null),oe=Or(E?fe??j:null),We=Lr(oe),He=vn(g,{transform:{x:O.x-At.x,y:O.y-At.y,scaleX:1,scaleY:1},activatorEvent:B,active:W,activeNodeRect:A,containerNodeRect:Re,draggingNodeRect:he,over:G.current.over,overlayNodeRect:te.rect,scrollableAncestors:oe,scrollableAncestorRects:We,windowRect:lt}),Mt=Ue?me(Ue,O):null,Ot=Ir(oe),Cn=Ut(Ot),Dn=Ut(Ot,[A]),ve=me(He,Cn),pe=he?er(he,He):null,Ee=W&&pe?d({active:W,collisionRect:pe,droppableRects:Z,droppableContainers:Ke,pointerCoordinates:Mt}):null,It=Zt(Ee,"id"),[ie,Nt]=l.useState(null),Sn=Et?He:me(He,Dn),Rn=Qn(Sn,(i=ie==null?void 0:ie.rect)!=null?i:null,A),ct=l.useRef(null),Tt=l.useCallback((k,F)=>{let{sensor:X,options:se}=F;if(q.current==null)return;const Y=C.get(q.current);if(!Y)return;const $=k.nativeEvent,J=new X({active:q.current,activeNode:Y,event:$,options:se,context:G,onAbort(L){if(!C.get(L))return;const{onDragAbort:_}=Q.current,ne={id:L};_==null||_(ne),y({type:"onDragAbort",event:ne})},onPending(L,ae,_,ne){if(!C.get(L))return;const{onDragPending:Me}=Q.current,le={id:L,constraint:ae,initialCoordinates:_,offset:ne};Me==null||Me(le),y({type:"onDragPending",event:le})},onStart(L){const ae=q.current;if(ae==null)return;const _=C.get(ae);if(!_)return;const{onDragStart:ne}=Q.current,Ae={activatorEvent:$,active:{id:ae,data:_.data,rect:U}};Ie.unstable_batchedUpdates(()=>{ne==null||ne(Ae),R(ce.Initializing),m({type:N.DragStart,initialCoordinates:L,active:ae}),y({type:"onDragStart",event:Ae}),je(ct.current),Ye($)})},onMove(L){m({type:N.DragMove,coordinates:L})},onEnd:be(N.DragEnd),onCancel:be(N.DragCancel)});ct.current=J;function be(L){return async function(){const{active:_,collisions:ne,over:Ae,scrollAdjustedTranslate:Me}=G.current;let le=null;if(_&&Me){const{cancelDrop:Oe}=Q.current;le={activatorEvent:$,active:_,collisions:ne,delta:Me,over:Ae},L===N.DragEnd&&typeof Oe=="function"&&await Promise.resolve(Oe(le))&&(L=N.DragCancel)}q.current=null,Ie.unstable_batchedUpdates(()=>{m({type:L}),R(ce.Uninitialized),Nt(null),je(null),Ye(null),ct.current=null;const Oe=L===N.DragEnd?"onDragEnd":"onDragCancel";if(le){const ut=Q.current[Oe];ut==null||ut(le),y({type:Oe,event:le})}})}}},[C]),En=l.useCallback((k,F)=>(X,se)=>{const Y=X.nativeEvent,$=C.get(se);if(q.current!==null||!$||Y.dndKit||Y.defaultPrevented)return;const J={active:$};k(X,F.options,J)===!0&&(Y.dndKit={capturedBy:F.sensor},q.current=se,Tt(X,F))},[C,Tt]),Lt=Dr(f,En);Nr(f),H(()=>{A&&S===ce.Initializing&&R(ce.Initialized)},[A,S]),l.useEffect(()=>{const{onDragMove:k}=Q.current,{active:F,activatorEvent:X,collisions:se,over:Y}=G.current;if(!F||!X)return;const $={active:F,activatorEvent:X,collisions:se,delta:{x:ve.x,y:ve.y},over:Y};Ie.unstable_batchedUpdates(()=>{k==null||k($),y({type:"onDragMove",event:$})})},[ve.x,ve.y]),l.useEffect(()=>{const{active:k,activatorEvent:F,collisions:X,droppableContainers:se,scrollAdjustedTranslate:Y}=G.current;if(!k||q.current==null||!F||!Y)return;const{onDragOver:$}=Q.current,J=se.get(It),be=J&&J.rect.current?{id:J.id,rect:J.rect.current,data:J.data,disabled:J.disabled}:null,L={active:k,activatorEvent:F,collisions:X,delta:{x:Y.x,y:Y.y},over:be};Ie.unstable_batchedUpdates(()=>{Nt(be),$==null||$(L),y({type:"onDragOver",event:L})})},[It]),H(()=>{G.current={activatorEvent:B,active:W,activeNode:j,collisionRect:pe,collisions:Ee,droppableRects:Z,draggableNodes:C,draggingNode:ge,draggingNodeRect:he,droppableContainers:I,over:ie,scrollableAncestors:oe,scrollAdjustedTranslate:ve},U.current={initial:he,translated:pe}},[W,j,Ee,pe,C,ge,he,Z,I,ie,oe,ve]),yr({...re,delta:O,draggingRect:pe,pointerCoordinates:Mt,scrollableAncestors:oe,scrollableAncestorRects:We});const An=l.useMemo(()=>({active:W,activeNode:j,activeNodeRect:A,activatorEvent:B,collisions:Ee,containerNodeRect:Re,dragOverlay:te,draggableNodes:C,droppableContainers:I,droppableRects:Z,over:ie,measureDroppableContainers:de,scrollableAncestors:oe,scrollableAncestorRects:We,measuringConfiguration:z,measuringScheduled:Se,windowRect:lt}),[W,j,A,B,Ee,Re,te,C,I,Z,ie,de,oe,We,z,Se,lt]),Mn=l.useMemo(()=>({activatorEvent:B,activators:Lt,active:W,activeNodeRect:A,ariaDescribedById:{draggable:De},dispatch:m,draggableNodes:C,over:ie,measureDroppableContainers:de}),[B,Lt,W,A,m,De,C,ie,de]);return l.createElement(Jt.Provider,{value:b},l.createElement($e.Provider,{value:Mn},l.createElement(hn.Provider,{value:An},l.createElement(at.Provider,{value:Rn},u)),l.createElement($r,{disabled:(a==null?void 0:a.restoreFocus)===!1})),l.createElement(Kn,{...a,hiddenTextDescribedById:De}));function On(){const k=(Ce==null?void 0:Ce.autoScrollEnabled)===!1,F=typeof c=="object"?c.enabled===!1:c===!1,X=E&&!k&&!F;return typeof c=="object"?{...c,enabled:X}:{enabled:X}}}),Ur=l.createContext(null),Ht="button",Wr="Draggable";function Hr(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const i=Xe(Wr),{activators:s,activatorEvent:a,active:c,activeNodeRect:u,ariaDescribedById:f,draggableNodes:d,over:h}=l.useContext($e),{role:g=Ht,roleDescription:x="draggable",tabIndex:v=0}=o??{},p=(c==null?void 0:c.id)===t,m=l.useContext(p?at:Ur),[y,b]=Je(),[S,R]=Je(),E=Tr(s,t),w=ke(n);H(()=>(d.set(t,{id:t,key:i,node:y,activatorNode:S,data:w}),()=>{const O=d.get(t);O&&O.key===i&&d.delete(t)}),[d,t]);const C=l.useMemo(()=>({role:g,tabIndex:v,"aria-disabled":r,"aria-pressed":p&&g===Ht?!0:void 0,"aria-roledescription":x,"aria-describedby":f.draggable}),[r,g,v,p,x,f.draggable]);return{active:c,activatorEvent:a,activeNodeRect:u,attributes:C,isDragging:p,listeners:r?void 0:E,node:y,over:h,setNodeRef:b,setActivatorNodeRef:R,transform:m}}function pn(){return l.useContext(hn)}const Vr="Droppable",qr={timeout:25};function Gr(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const i=Xe(Vr),{active:s,dispatch:a,over:c,measureDroppableContainers:u}=l.useContext($e),f=l.useRef({disabled:n}),d=l.useRef(!1),h=l.useRef(null),g=l.useRef(null),{disabled:x,updateMeasurementsFor:v,timeout:p}={...qr,...o},m=ke(v??r),y=l.useCallback(()=>{if(!d.current){d.current=!0;return}g.current!=null&&clearTimeout(g.current),g.current=setTimeout(()=>{u(Array.isArray(m.current)?m.current:[m.current]),g.current=null},p)},[p]),b=st({callback:y,disabled:x||!s}),S=l.useCallback((C,O)=>{b&&(O&&(b.unobserve(O),d.current=!1),C&&b.observe(C))},[b]),[R,E]=Je(S),w=ke(t);return l.useEffect(()=>{!b||!R.current||(b.disconnect(),d.current=!1,b.observe(R.current))},[R,b]),l.useEffect(()=>(a({type:N.RegisterDroppable,element:{id:r,key:i,disabled:n,node:R,rect:h,data:w}}),()=>a({type:N.UnregisterDroppable,key:i,id:r})),[r]),l.useEffect(()=>{n!==f.current.disabled&&(a({type:N.SetDroppableDisabled,id:r,key:i,disabled:n}),f.current.disabled=n)},[r,i,n,a]),{active:s,rect:h,isOver:(c==null?void 0:c.id)===r,node:R,over:c,setNodeRef:E}}function Jr(e){let{animation:t,children:n}=e;const[r,o]=l.useState(null),[i,s]=l.useState(null),a=_e(n);return!n&&!r&&a&&o(a),H(()=>{if(!i)return;const c=r==null?void 0:r.key,u=r==null?void 0:r.props.id;if(c==null||u==null){o(null);return}Promise.resolve(t(u,i)).then(()=>{o(null)})},[t,r,i]),l.createElement(l.Fragment,null,n,r?l.cloneElement(r,{ref:s}):null)}const _r={x:0,y:0,scaleX:1,scaleY:1};function Qr(e){let{children:t}=e;return l.createElement($e.Provider,{value:gn},l.createElement(at.Provider,{value:_r},t))}const Zr={position:"fixed",touchAction:"none"},eo=e=>ot(e)?"transform 250ms ease":void 0,to=l.forwardRef((e,t)=>{let{as:n,activatorEvent:r,adjustScale:o,children:i,className:s,rect:a,style:c,transform:u,transition:f=eo}=e;if(!a)return null;const d=o?u:{...u,scaleX:1,scaleY:1},h={...Zr,width:a.width,height:a.height,top:a.top,left:a.left,transform:ue.Transform.toString(d),transformOrigin:o&&r?Hn(r,a):void 0,transition:typeof f=="function"?f(r):f,...c};return l.createElement(n,{className:s,style:h,ref:t},i)}),no=e=>t=>{let{active:n,dragOverlay:r}=t;const o={},{styles:i,className:s}=e;if(i!=null&&i.active)for(const[a,c]of Object.entries(i.active))c!==void 0&&(o[a]=n.node.style.getPropertyValue(a),n.node.style.setProperty(a,c));if(i!=null&&i.dragOverlay)for(const[a,c]of Object.entries(i.dragOverlay))c!==void 0&&r.node.style.setProperty(a,c);return s!=null&&s.active&&n.node.classList.add(s.active),s!=null&&s.dragOverlay&&r.node.classList.add(s.dragOverlay),function(){for(const[c,u]of Object.entries(o))n.node.style.setProperty(c,u);s!=null&&s.active&&n.node.classList.remove(s.active)}},ro=e=>{let{transform:{initial:t,final:n}}=e;return[{transform:ue.Transform.toString(t)},{transform:ue.Transform.toString(n)}]},oo={duration:250,easing:"ease",keyframes:ro,sideEffects:no({styles:{active:{opacity:"0"}}})};function io(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:o}=e;return rt((i,s)=>{if(t===null)return;const a=n.get(i);if(!a)return;const c=a.node.current;if(!c)return;const u=fn(s);if(!u)return;const{transform:f}=P(s).getComputedStyle(s),d=tn(f);if(!d)return;const h=typeof t=="function"?t:so(t);return cn(c,o.draggable.measure),h({active:{id:i,data:a.data,node:c,rect:o.draggable.measure(c)},draggableNodes:n,dragOverlay:{node:s,rect:o.dragOverlay.measure(u)},droppableContainers:r,measuringConfiguration:o,transform:d})})}function so(e){const{duration:t,easing:n,sideEffects:r,keyframes:o}={...oo,...e};return i=>{let{active:s,dragOverlay:a,transform:c,...u}=i;if(!t)return;const f={x:a.rect.left-s.rect.left,y:a.rect.top-s.rect.top},d={scaleX:c.scaleX!==1?s.rect.width*c.scaleX/a.rect.width:1,scaleY:c.scaleY!==1?s.rect.height*c.scaleY/a.rect.height:1},h={x:c.x-f.x,y:c.y-f.y,...d},g=o({...u,active:s,dragOverlay:a,transform:{initial:c,final:h}}),[x]=g,v=g[g.length-1];if(JSON.stringify(x)===JSON.stringify(v))return;const p=r==null?void 0:r({active:s,dragOverlay:a,...u}),m=a.node.animate(g,{duration:t,easing:n,fill:"forwards"});return new Promise(y=>{m.onfinish=()=>{p==null||p(),y()}})}}let Vt=0;function ao(e){return l.useMemo(()=>{if(e!=null)return Vt++,Vt},[e])}const lo=l.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:r,style:o,transition:i,modifiers:s,wrapperElement:a="div",className:c,zIndex:u=999}=e;const{activatorEvent:f,active:d,activeNodeRect:h,containerNodeRect:g,draggableNodes:x,droppableContainers:v,dragOverlay:p,over:m,measuringConfiguration:y,scrollableAncestors:b,scrollableAncestorRects:S,windowRect:R}=pn(),E=l.useContext(at),w=ao(d==null?void 0:d.id),C=vn(s,{activatorEvent:f,active:d,activeNodeRect:h,containerNodeRect:g,draggingNodeRect:p.rect,over:m,overlayNodeRect:p.rect,scrollableAncestors:b,scrollableAncestorRects:S,transform:E,windowRect:R}),O=St(h),I=io({config:r,draggableNodes:x,droppableContainers:v,measuringConfiguration:y}),M=O?p.setRef:void 0;return l.createElement(Qr,null,l.createElement(Jr,{animation:I},d&&w?l.createElement(to,{key:w,id:d.id,ref:M,as:a,activatorEvent:f,adjustScale:t,className:c,transition:i,rect:O,style:{zIndex:u,...o},transform:C},n):null))});function Rt(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function co(e,t){return e.reduce((n,r,o)=>{const i=t.get(r);return i&&(n[o]=i),n},Array(e.length))}function Ve(e){return e!==null&&e>=0}function uo(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function fo(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const qe={scaleX:1,scaleY:1},go=e=>{var t;let{rects:n,activeNodeRect:r,activeIndex:o,overIndex:i,index:s}=e;const a=(t=n[o])!=null?t:r;if(!a)return null;const c=ho(n,s,o);if(s===o){const u=n[i];return u?{x:o<i?u.left+u.width-(a.left+a.width):u.left-a.left,y:0,...qe}:null}return s>o&&s<=i?{x:-a.width-c,y:0,...qe}:s<o&&s>=i?{x:a.width+c,y:0,...qe}:{x:0,y:0,...qe}};function ho(e,t,n){const r=e[t],o=e[t-1],i=e[t+1];return!r||!o&&!i?0:n<t?o?r.left-(o.left+o.width):i.left-(r.left+r.width):i?i.left-(r.left+r.width):r.left-(o.left+o.width)}const bn=e=>{let{rects:t,activeIndex:n,overIndex:r,index:o}=e;const i=Rt(t,r,n),s=t[o],a=i[o];return!a||!s?null:{x:a.left-s.left,y:a.top-s.top,scaleX:a.width/s.width,scaleY:a.height/s.height}},mn="Sortable",yn=l.createContext({activeIndex:-1,containerId:mn,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:bn,disabled:{draggable:!1,droppable:!1}});function vo(e){let{children:t,id:n,items:r,strategy:o=bn,disabled:i=!1}=e;const{active:s,dragOverlay:a,droppableRects:c,over:u,measureDroppableContainers:f}=pn(),d=Xe(mn,n),h=a.rect!==null,g=l.useMemo(()=>r.map(E=>typeof E=="object"&&"id"in E?E.id:E),[r]),x=s!=null,v=s?g.indexOf(s.id):-1,p=u?g.indexOf(u.id):-1,m=l.useRef(g),y=!uo(g,m.current),b=p!==-1&&v===-1||y,S=fo(i);H(()=>{y&&x&&f(g)},[y,g,x,f]),l.useEffect(()=>{m.current=g},[g]);const R=l.useMemo(()=>({activeIndex:v,containerId:d,disabled:S,disableTransforms:b,items:g,overIndex:p,useDragOverlay:h,sortedRects:co(g,c),strategy:o}),[v,d,S.draggable,S.droppable,b,g,p,c,h,o]);return l.createElement(yn.Provider,{value:R},t)}const po=e=>{let{id:t,items:n,activeIndex:r,overIndex:o}=e;return Rt(n,r,o).indexOf(t)},bo=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:o,items:i,newIndex:s,previousItems:a,previousContainerId:c,transition:u}=e;return!u||!r||a!==i&&o===s?!1:n?!0:s!==o&&t===c},mo={duration:200,easing:"ease"},wn="transform",yo=ue.Transition.toString({property:wn,duration:0,easing:"linear"}),wo={roleDescription:"sortable"};function xo(e){let{disabled:t,index:n,node:r,rect:o}=e;const[i,s]=l.useState(null),a=l.useRef(n);return H(()=>{if(!t&&n!==a.current&&r.current){const c=o.current;if(c){const u=xe(r.current,{ignoreTransform:!0}),f={x:c.left-u.left,y:c.top-u.top,scaleX:c.width/u.width,scaleY:c.height/u.height};(f.x||f.y)&&s(f)}}n!==a.current&&(a.current=n)},[t,n,r,o]),l.useEffect(()=>{i&&s(null)},[i]),i}function Co(e){let{animateLayoutChanges:t=bo,attributes:n,disabled:r,data:o,getNewIndex:i=po,id:s,strategy:a,resizeObserverConfig:c,transition:u=mo}=e;const{items:f,containerId:d,activeIndex:h,disabled:g,disableTransforms:x,sortedRects:v,overIndex:p,useDragOverlay:m,strategy:y}=l.useContext(yn),b=Do(r,g),S=f.indexOf(s),R=l.useMemo(()=>({sortable:{containerId:d,index:S,items:f},...o}),[d,o,S,f]),E=l.useMemo(()=>f.slice(f.indexOf(s)),[f,s]),{rect:w,node:C,isOver:O,setNodeRef:I}=Gr({id:s,data:R,disabled:b.droppable,resizeObserverConfig:{updateMeasurementsFor:E,...c}}),{active:M,activatorEvent:U,activeNodeRect:W,attributes:q,setNodeRef:Ce,listeners:je,isDragging:B,over:Ye,setActivatorNodeRef:Q,transform:De}=Hr({id:s,data:R,attributes:{...wo,...n},disabled:b.draggable}),Ke=In(I,Ce),z=!!M,Z=z&&!x&&Ve(h)&&Ve(p),de=!m&&B,Se=de&&Z?De:null,Ue=Z?Se??(a??y)({rects:v,activeNodeRect:W,activeIndex:h,overIndex:p,index:S}):null,re=Ve(h)&&Ve(p)?i({id:s,items:f,activeIndex:h,overIndex:p}):S,ee=M==null?void 0:M.id,A=l.useRef({activeId:ee,items:f,newIndex:re,containerId:d}),Re=f!==A.current.items,G=t({active:M,containerId:d,isDragging:B,isSorting:z,id:s,index:S,items:f,newIndex:A.current.newIndex,previousItems:A.current.items,previousContainerId:A.current.containerId,transition:u,wasDragging:A.current.activeId!=null}),fe=xo({disabled:!G,index:S,node:C,rect:w});return l.useEffect(()=>{z&&A.current.newIndex!==re&&(A.current.newIndex=re),d!==A.current.containerId&&(A.current.containerId=d),f!==A.current.items&&(A.current.items=f)},[z,re,d,f]),l.useEffect(()=>{if(ee===A.current.activeId)return;if(ee!=null&&A.current.activeId==null){A.current.activeId=ee;return}const ge=setTimeout(()=>{A.current.activeId=ee},50);return()=>clearTimeout(ge)},[ee]),{active:M,activeIndex:h,attributes:q,data:R,rect:w,index:S,newIndex:re,items:f,isOver:O,isSorting:z,isDragging:B,listeners:je,node:C,overIndex:p,over:Ye,setNodeRef:Ke,setActivatorNodeRef:Q,setDroppableNodeRef:I,setDraggableNodeRef:Ce,transform:fe??Ue,transition:te()};function te(){if(fe||Re&&A.current.newIndex===S)return yo;if(!(de&&!ot(U)||!u)&&(z||G))return ue.Transition.toString({...u,property:wn})}}function Do(e,t){var n,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e==null?void 0:e.draggable)!=null?n:t.draggable,droppable:(r=e==null?void 0:e.droppable)!=null?r:t.droppable}}function tt(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const So=[D.Down,D.Right,D.Up,D.Left],Ro=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:o,droppableContainers:i,over:s,scrollableAncestors:a}}=t;if(So.includes(e.code)){if(e.preventDefault(),!n||!r)return;const c=[];i.getEnabled().forEach(d=>{if(!d||d!=null&&d.disabled)return;const h=o.get(d.id);if(h)switch(e.code){case D.Down:r.top<h.top&&c.push(d);break;case D.Up:r.top>h.top&&c.push(d);break;case D.Left:r.left>h.left&&c.push(d);break;case D.Right:r.left<h.left&&c.push(d);break}});const u=Gn({collisionRect:r,droppableRects:o,droppableContainers:c});let f=Zt(u,"id");if(f===(s==null?void 0:s.id)&&u.length>1&&(f=u[1].id),f!=null){const d=i.get(n.id),h=i.get(f),g=h?o.get(h.id):null,x=h==null?void 0:h.node.current;if(x&&g&&d&&h){const p=it(x).some((E,w)=>a[w]!==E),m=xn(d,h),y=Eo(d,h),b=p||!m?{x:0,y:0}:{x:y?r.width-g.width:0,y:y?r.height-g.height:0},S={x:g.left,y:g.top};return b.x&&b.y?S:Pe(S,b)}}}};function xn(e,t){return!tt(e)||!tt(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function Eo(e,t){return!tt(e)||!tt(t)||!xn(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}exports.CSS=ue;exports.DndContext=Kr;exports.DragOverlay=lo;exports.KeyboardSensor=xt;exports.PointerSensor=Dt;exports.SortableContext=vo;exports.arrayMove=Rt;exports.closestCenter=qn;exports.horizontalListSortingStrategy=go;exports.sortableKeyboardCoordinates=Ro;exports.useSensor=Un;exports.useSensors=Wn;exports.useSortable=Co;
5
+ `},Yn={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function Kn(e){let{announcements:t=Yn,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=jn}=e;const{announce:i,announcement:s}=Fn(),a=Xe("DndLiveRegion"),[c,u]=l.useState(!1);if(l.useEffect(()=>{u(!0)},[]),Xn(l.useMemo(()=>({onDragStart(d){let{active:h}=d;i(t.onDragStart({active:h}))},onDragMove(d){let{active:h,over:g}=d;t.onDragMove&&i(t.onDragMove({active:h,over:g}))},onDragOver(d){let{active:h,over:g}=d;i(t.onDragOver({active:h,over:g}))},onDragEnd(d){let{active:h,over:g}=d;i(t.onDragEnd({active:h,over:g}))},onDragCancel(d){let{active:h,over:g}=d;i(t.onDragCancel({active:h,over:g}))}}),[i,t])),!c)return null;const f=l.createElement(l.Fragment,null,l.createElement(zn,{id:r,value:o.draggable}),l.createElement(Bn,{id:a,announcement:s}));return n?Ie.createPortal(f,n):f}var N;(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"})(N||(N={}));function Ze(){}function Un(e,t){return l.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function Wn(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return l.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const V=Object.freeze({x:0,y:0});function _t(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Hn(e,t){const n=Qe(e);if(!n)return"0 0";const r={x:(n.x-t.left)/t.width*100,y:(n.y-t.top)/t.height*100};return r.x+"% "+r.y+"%"}function Qt(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function Vn(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function Pt(e){let{left:t,top:n,height:r,width:o}=e;return[{x:t,y:n},{x:t+o,y:n},{x:t,y:n+r},{x:t+o,y:n+r}]}function Zt(e,t){if(!e||e.length===0)return null;const[n]=e;return t?n[t]:n}function zt(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}const qn=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=zt(t,t.left,t.top),i=[];for(const s of r){const{id:a}=s,c=n.get(a);if(c){const u=_t(zt(c),o);i.push({id:a,data:{droppableContainer:s,value:u}})}}return i.sort(Qt)},Gn=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=Pt(t),i=[];for(const s of r){const{id:a}=s,c=n.get(a);if(c){const u=Pt(c),f=o.reduce((h,g,x)=>h+_t(u[x],g),0),d=Number((f/4).toFixed(4));i.push({id:a,data:{droppableContainer:s,value:d}})}}return i.sort(Qt)};function Jn(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),s=o-r,a=i-n;if(r<o&&n<i){const c=t.width*t.height,u=e.width*e.height,f=s*a,d=f/(c+u-f);return Number(d.toFixed(4))}return 0}const _n=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const i of r){const{id:s}=i,a=n.get(s);if(a){const c=Jn(a,t);c>0&&o.push({id:s,data:{droppableContainer:i,value:c}})}}return o.sort(Vn)};function Qn(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function en(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:V}function Zn(e){return function(n){for(var r=arguments.length,o=new Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];return o.reduce((s,a)=>({...s,top:s.top+e*a.y,bottom:s.bottom+e*a.y,left:s.left+e*a.x,right:s.right+e*a.x}),{...n})}}const er=Zn(1);function tn(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]}}else 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}function tr(e,t,n){const r=tn(t);if(!r)return e;const{scaleX:o,scaleY:i,x:s,y:a}=r,c=e.left-s-(1-o)*parseFloat(n),u=e.top-a-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),f=o?e.width/o:e.width,d=i?e.height/i:e.height;return{width:f,height:d,top:u,right:c+f,bottom:u+d,left:c}}const nr={ignoreTransform:!1};function xe(e,t){t===void 0&&(t=nr);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:u,transformOrigin:f}=P(e).getComputedStyle(e);u&&(n=tr(n,u,f))}const{top:r,left:o,width:i,height:s,bottom:a,right:c}=n;return{top:r,left:o,width:i,height:s,bottom:a,right:c}}function Bt(e){return xe(e,{ignoreTransform:!0})}function rr(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function or(e,t){return t===void 0&&(t=P(e).getComputedStyle(e)),t.position==="fixed"}function ir(e,t){t===void 0&&(t=P(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{const i=t[o];return typeof i=="string"?n.test(i):!1})}function it(e,t){const n=[];function r(o){if(t!=null&&n.length>=t||!o)return n;if(yt(o)&&o.scrollingElement!=null&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!Be(o)||qt(o)||n.includes(o))return n;const i=P(e).getComputedStyle(o);return o!==e&&ir(o,i)&&n.push(o),or(o,i)?n:r(o.parentNode)}return e?r(e):n}function nn(e){const[t]=it(e,1);return t??null}function ft(e){return!nt||!e?null:ye(e)?e:mt(e)?yt(e)||e===we(e).scrollingElement?window:Be(e)?e:null:null}function rn(e){return ye(e)?e.scrollX:e.scrollLeft}function on(e){return ye(e)?e.scrollY:e.scrollTop}function vt(e){return{x:rn(e),y:on(e)}}var T;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(T||(T={}));function sn(e){return!nt||!e?!1:e===document.scrollingElement}function an(e){const t={x:0,y:0},n=sn(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},o=e.scrollTop<=t.y,i=e.scrollLeft<=t.x,s=e.scrollTop>=r.y,a=e.scrollLeft>=r.x;return{isTop:o,isLeft:i,isBottom:s,isRight:a,maxScroll:r,minScroll:t}}const sr={x:.2,y:.2};function ar(e,t,n,r,o){let{top:i,left:s,right:a,bottom:c}=n;r===void 0&&(r=10),o===void 0&&(o=sr);const{isTop:u,isBottom:f,isLeft:d,isRight:h}=an(e),g={x:0,y:0},x={x:0,y:0},v={height:t.height*o.y,width:t.width*o.x};return!u&&i<=t.top+v.height?(g.y=T.Backward,x.y=r*Math.abs((t.top+v.height-i)/v.height)):!f&&c>=t.bottom-v.height&&(g.y=T.Forward,x.y=r*Math.abs((t.bottom-v.height-c)/v.height)),!h&&a>=t.right-v.width?(g.x=T.Forward,x.x=r*Math.abs((t.right-v.width-a)/v.width)):!d&&s<=t.left+v.width&&(g.x=T.Backward,x.x=r*Math.abs((t.left+v.width-s)/v.width)),{direction:g,speed:x}}function lr(e){if(e===document.scrollingElement){const{innerWidth:i,innerHeight:s}=window;return{top:0,left:0,right:i,bottom:s,width:i,height:s}}const{top:t,left:n,right:r,bottom:o}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:o,width:e.clientWidth,height:e.clientHeight}}function ln(e){return e.reduce((t,n)=>me(t,vt(n)),V)}function cr(e){return e.reduce((t,n)=>t+rn(n),0)}function ur(e){return e.reduce((t,n)=>t+on(n),0)}function cn(e,t){if(t===void 0&&(t=xe),!e)return;const{top:n,left:r,bottom:o,right:i}=t(e);nn(e)&&(o<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const dr=[["x",["left","right"],cr],["y",["top","bottom"],ur]];class wt{constructor(t,n){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=it(n),o=ln(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[i,s,a]of dr)for(const c of s)Object.defineProperty(this,c,{get:()=>{const u=a(r),f=o[i]-u;return this.rect[c]+f},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Ne{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var o;(o=this.target)==null||o.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function fr(e){const{EventTarget:t}=P(e);return e instanceof t?e:we(e)}function gt(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var K;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(K||(K={}));function Ft(e){e.preventDefault()}function gr(e){e.stopPropagation()}var D;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(D||(D={}));const un={start:[D.Space,D.Enter],cancel:[D.Esc],end:[D.Space,D.Enter,D.Tab]},hr=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case D.Right:return{...n,x:n.x+25};case D.Left:return{...n,x:n.x-25};case D.Down:return{...n,y:n.y+25};case D.Up:return{...n,y:n.y-25}}};class xt{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new Ne(we(n)),this.windowListeners=new Ne(P(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(K.Resize,this.handleCancel),this.windowListeners.add(K.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(K.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&cn(r),n(V)}handleKeyDown(t){if(ot(t)){const{active:n,context:r,options:o}=this.props,{keyboardCodes:i=un,coordinateGetter:s=hr,scrollBehavior:a="smooth"}=o,{code:c}=t;if(i.end.includes(c)){this.handleEnd(t);return}if(i.cancel.includes(c)){this.handleCancel(t);return}const{collisionRect:u}=r.current,f=u?{x:u.left,y:u.top}:V;this.referenceCoordinates||(this.referenceCoordinates=f);const d=s(t,{active:n,context:r.current,currentCoordinates:f});if(d){const h=Pe(d,f),g={x:0,y:0},{scrollableAncestors:x}=r.current;for(const v of x){const p=t.code,{isTop:m,isRight:y,isLeft:b,isBottom:S,maxScroll:R,minScroll:E}=an(v),w=lr(v),C={x:Math.min(p===D.Right?w.right-w.width/2:w.right,Math.max(p===D.Right?w.left:w.left+w.width/2,d.x)),y:Math.min(p===D.Down?w.bottom-w.height/2:w.bottom,Math.max(p===D.Down?w.top:w.top+w.height/2,d.y))},O=p===D.Right&&!y||p===D.Left&&!b,I=p===D.Down&&!S||p===D.Up&&!m;if(O&&C.x!==d.x){const M=v.scrollLeft+h.x,U=p===D.Right&&M<=R.x||p===D.Left&&M>=E.x;if(U&&!h.y){v.scrollTo({left:M,behavior:a});return}U?g.x=v.scrollLeft-M:g.x=p===D.Right?v.scrollLeft-R.x:v.scrollLeft-E.x,g.x&&v.scrollBy({left:-g.x,behavior:a});break}else if(I&&C.y!==d.y){const M=v.scrollTop+h.y,U=p===D.Down&&M<=R.y||p===D.Up&&M>=E.y;if(U&&!h.x){v.scrollTo({top:M,behavior:a});return}U?g.y=v.scrollTop-M:g.y=p===D.Down?v.scrollTop-R.y:v.scrollTop-E.y,g.y&&v.scrollBy({top:-g.y,behavior:a});break}}this.handleMove(t,me(Pe(d,this.referenceCoordinates),g))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}xt.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=un,onActivation:o}=t,{active:i}=n;const{code:s}=e.nativeEvent;if(r.start.includes(s)){const a=i.activatorNode.current;return a&&e.target!==a?!1:(e.preventDefault(),o==null||o({event:e.nativeEvent}),!0)}return!1}}];function Xt(e){return!!(e&&"distance"in e)}function $t(e){return!!(e&&"delay"in e)}class Ct{constructor(t,n,r){var o;r===void 0&&(r=fr(t.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=t,this.events=n;const{event:i}=t,{target:s}=i;this.props=t,this.events=n,this.document=we(s),this.documentListeners=new Ne(this.document),this.listeners=new Ne(r),this.windowListeners=new Ne(P(s)),this.initialCoordinates=(o=Qe(i))!=null?o:V,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:t,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(K.Resize,this.handleCancel),this.windowListeners.add(K.DragStart,Ft),this.windowListeners.add(K.VisibilityChange,this.handleCancel),this.windowListeners.add(K.ContextMenu,Ft),this.documentListeners.add(K.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if($t(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(Xt(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:r,onPending:o}=this.props;o(r,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(K.Click,gr,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(K.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:o,props:i}=this,{onMove:s,options:{activationConstraint:a}}=i;if(!o)return;const c=(n=Qe(t))!=null?n:V,u=Pe(o,c);if(!r&&a){if(Xt(a)){if(a.tolerance!=null&&gt(u,a.tolerance))return this.handleCancel();if(gt(u,a.distance))return this.handleStart()}if($t(a)&&gt(u,a.tolerance))return this.handleCancel();this.handlePending(a,u);return}t.cancelable&&t.preventDefault(),s(c)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===D.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const vr={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Dt extends Ct{constructor(t){const{event:n}=t,r=we(n.target);super(t,vr,r)}}Dt.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r==null||r({event:n}),!0)}}];const pr={move:{name:"mousemove"},end:{name:"mouseup"}};var pt;(function(e){e[e.RightClick=2]="RightClick"})(pt||(pt={}));class br extends Ct{constructor(t){super(t,pr,we(t.event.target))}}br.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===pt.RightClick?!1:(r==null||r({event:n}),!0)}}];const ht={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class mr extends Ct{constructor(t){super(t,ht)}static setup(){return window.addEventListener(ht.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(ht.move.name,t)};function t(){}}}mr.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:o}=n;return o.length>1?!1:(r==null||r({event:n}),!0)}}];var Te;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Te||(Te={}));var et;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(et||(et={}));function yr(e){let{acceleration:t,activator:n=Te.Pointer,canScroll:r,draggingRect:o,enabled:i,interval:s=5,order:a=et.TreeOrder,pointerCoordinates:c,scrollableAncestors:u,scrollableAncestorRects:f,delta:d,threshold:h}=e;const g=xr({delta:d,disabled:!i}),[x,v]=Nn(),p=l.useRef({x:0,y:0}),m=l.useRef({x:0,y:0}),y=l.useMemo(()=>{switch(n){case Te.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case Te.DraggableRect:return o}},[n,o,c]),b=l.useRef(null),S=l.useCallback(()=>{const E=b.current;if(!E)return;const w=p.current.x*m.current.x,C=p.current.y*m.current.y;E.scrollBy(w,C)},[]),R=l.useMemo(()=>a===et.TreeOrder?[...u].reverse():u,[a,u]);l.useEffect(()=>{if(!i||!u.length||!y){v();return}for(const E of R){if((r==null?void 0:r(E))===!1)continue;const w=u.indexOf(E),C=f[w];if(!C)continue;const{direction:O,speed:I}=ar(E,C,y,t,h);for(const M of["x","y"])g[M][O[M]]||(I[M]=0,O[M]=0);if(I.x>0||I.y>0){v(),b.current=E,x(S,s),p.current=I,m.current=O;return}}p.current={x:0,y:0},m.current={x:0,y:0},v()},[t,S,r,v,i,s,JSON.stringify(y),JSON.stringify(g),x,u,R,f,JSON.stringify(h)])}const wr={x:{[T.Backward]:!1,[T.Forward]:!1},y:{[T.Backward]:!1,[T.Forward]:!1}};function xr(e){let{delta:t,disabled:n}=e;const r=_e(t);return Fe(o=>{if(n||!r||!o)return wr;const i={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[T.Backward]:o.x[T.Backward]||i.x===-1,[T.Forward]:o.x[T.Forward]||i.x===1},y:{[T.Backward]:o.y[T.Backward]||i.y===-1,[T.Forward]:o.y[T.Forward]||i.y===1}}},[n,t,r])}function Cr(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return Fe(o=>{var i;return t==null?null:(i=r??o)!=null?i:null},[r,t])}function Dr(e,t){return l.useMemo(()=>e.reduce((n,r)=>{const{sensor:o}=r,i=o.activators.map(s=>({eventName:s.eventName,handler:t(s.handler,r)}));return[...n,...i]},[]),[e,t])}var ze;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(ze||(ze={}));var bt;(function(e){e.Optimized="optimized"})(bt||(bt={}));const jt=new Map;function Sr(e,t){let{dragging:n,dependencies:r,config:o}=t;const[i,s]=l.useState(null),{frequency:a,measure:c,strategy:u}=o,f=l.useRef(e),d=p(),h=ke(d),g=l.useCallback(function(m){m===void 0&&(m=[]),!h.current&&s(y=>y===null?m:y.concat(m.filter(b=>!y.includes(b))))},[h]),x=l.useRef(null),v=Fe(m=>{if(d&&!n)return jt;if(!m||m===jt||f.current!==e||i!=null){const y=new Map;for(let b of e){if(!b)continue;if(i&&i.length>0&&!i.includes(b.id)&&b.rect.current){y.set(b.id,b.rect.current);continue}const S=b.node.current,R=S?new wt(c(S),S):null;b.rect.current=R,R&&y.set(b.id,R)}return y}return m},[e,i,n,d,c]);return l.useEffect(()=>{f.current=e},[e]),l.useEffect(()=>{d||g()},[n,d]),l.useEffect(()=>{i&&i.length>0&&s(null)},[JSON.stringify(i)]),l.useEffect(()=>{d||typeof a!="number"||x.current!==null||(x.current=setTimeout(()=>{g(),x.current=null},a))},[a,d,g,...r]),{droppableRects:v,measureDroppableContainers:g,measuringScheduled:i!=null};function p(){switch(u){case ze.Always:return!1;case ze.BeforeDragging:return n;default:return!n}}}function St(e,t){return Fe(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function Rr(e,t){return St(e,t)}function Er(e){let{callback:t,disabled:n}=e;const r=rt(t),o=l.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:i}=window;return new i(r)},[r,n]);return l.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function st(e){let{callback:t,disabled:n}=e;const r=rt(t),o=l.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:i}=window;return new i(r)},[n]);return l.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function Ar(e){return new wt(xe(e),e)}function Yt(e,t,n){t===void 0&&(t=Ar);const[r,o]=l.useState(null);function i(){o(c=>{if(!e)return null;if(e.isConnected===!1){var u;return(u=c??n)!=null?u:null}const f=t(e);return JSON.stringify(c)===JSON.stringify(f)?c:f})}const s=Er({callback(c){if(e)for(const u of c){const{type:f,target:d}=u;if(f==="childList"&&d instanceof HTMLElement&&d.contains(e)){i();break}}}}),a=st({callback:i});return H(()=>{i(),e?(a==null||a.observe(e),s==null||s.observe(document.body,{childList:!0,subtree:!0})):(a==null||a.disconnect(),s==null||s.disconnect())},[e]),r}function Mr(e){const t=St(e);return en(e,t)}const Kt=[];function Or(e){const t=l.useRef(e),n=Fe(r=>e?r&&r!==Kt&&e&&t.current&&e.parentNode===t.current.parentNode?r:it(e):Kt,[e]);return l.useEffect(()=>{t.current=e},[e]),n}function Ir(e){const[t,n]=l.useState(null),r=l.useRef(e),o=l.useCallback(i=>{const s=ft(i.target);s&&n(a=>a?(a.set(s,vt(s)),new Map(a)):null)},[]);return l.useEffect(()=>{const i=r.current;if(e!==i){s(i);const a=e.map(c=>{const u=ft(c);return u?(u.addEventListener("scroll",o,{passive:!0}),[u,vt(u)]):null}).filter(c=>c!=null);n(a.length?new Map(a):null),r.current=e}return()=>{s(e),s(i)};function s(a){a.forEach(c=>{const u=ft(c);u==null||u.removeEventListener("scroll",o)})}},[o,e]),l.useMemo(()=>e.length?t?Array.from(t.values()).reduce((i,s)=>me(i,s),V):ln(e):V,[e,t])}function Ut(e,t){t===void 0&&(t=[]);const n=l.useRef(null);return l.useEffect(()=>{n.current=null},t),l.useEffect(()=>{const r=e!==V;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?Pe(e,n.current):V}function Nr(e){l.useEffect(()=>{if(!nt)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n==null||n()}},e.map(t=>{let{sensor:n}=t;return n}))}function Tr(e,t){return l.useMemo(()=>e.reduce((n,r)=>{let{eventName:o,handler:i}=r;return n[o]=s=>{i(s,t)},n},{}),[e,t])}function dn(e){return l.useMemo(()=>e?rr(e):null,[e])}const Wt=[];function Lr(e,t){t===void 0&&(t=xe);const[n]=e,r=dn(n?P(n):null),[o,i]=l.useState(Wt);function s(){i(()=>e.length?e.map(c=>sn(c)?r:new wt(t(c),c)):Wt)}const a=st({callback:s});return H(()=>{a==null||a.disconnect(),s(),e.forEach(c=>a==null?void 0:a.observe(c))},[e]),o}function fn(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Be(t)?t:e}function kr(e){let{measure:t}=e;const[n,r]=l.useState(null),o=l.useCallback(u=>{for(const{target:f}of u)if(Be(f)){r(d=>{const h=t(f);return d?{...d,width:h.width,height:h.height}:h});break}},[t]),i=st({callback:o}),s=l.useCallback(u=>{const f=fn(u);i==null||i.disconnect(),f&&(i==null||i.observe(f)),r(f?t(f):null)},[t,i]),[a,c]=Je(s);return l.useMemo(()=>({nodeRef:a,rect:n,setRef:c}),[n,a,c])}const Pr=[{sensor:Dt,options:{}},{sensor:xt,options:{}}],zr={current:{}},Ge={draggable:{measure:Bt},droppable:{measure:Bt,strategy:ze.WhileDragging,frequency:bt.Optimized},dragOverlay:{measure:xe}};class Le extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const Br={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Le,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Ze},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Ge,measureDroppableContainers:Ze,windowRect:null,measuringScheduled:!1},gn={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Ze,draggableNodes:new Map,over:null,measureDroppableContainers:Ze},$e=l.createContext(gn),hn=l.createContext(Br);function Fr(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Le}}}function Xr(e,t){switch(t.type){case N.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case N.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case N.DragEnd:case N.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case N.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new Le(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case N.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const s=new Le(e.droppable.containers);return s.set(n,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:s}}}case N.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const i=new Le(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function $r(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=l.useContext($e),i=_e(r),s=_e(n==null?void 0:n.id);return l.useEffect(()=>{if(!t&&!r&&i&&s!=null){if(!ot(i)||document.activeElement===i.target)return;const a=o.get(s);if(!a)return;const{activatorNode:c,node:u}=a;if(!c.current&&!u.current)return;requestAnimationFrame(()=>{for(const f of[c.current,u.current]){if(!f)continue;const d=kn(f);if(d){d.focus();break}}})}},[r,t,o,s,i]),null}function vn(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((o,i)=>i({transform:o,...r}),n):n}function jr(e){return l.useMemo(()=>({draggable:{...Ge.draggable,...e==null?void 0:e.draggable},droppable:{...Ge.droppable,...e==null?void 0:e.droppable},dragOverlay:{...Ge.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function Yr(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const i=l.useRef(!1),{x:s,y:a}=typeof o=="boolean"?{x:o,y:o}:o;H(()=>{if(!s&&!a||!t){i.current=!1;return}if(i.current||!r)return;const u=t==null?void 0:t.node.current;if(!u||u.isConnected===!1)return;const f=n(u),d=en(f,r);if(s||(d.x=0),a||(d.y=0),i.current=!0,Math.abs(d.x)>0||Math.abs(d.y)>0){const h=nn(u);h&&h.scrollBy({top:d.y,left:d.x})}},[t,s,a,r,n])}const at=l.createContext({...V,scaleX:1,scaleY:1});var ce;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(ce||(ce={}));const Kr=l.memo(function(t){var n,r,o,i;let{id:s,accessibility:a,autoScroll:c=!0,children:u,sensors:f=Pr,collisionDetection:d=_n,measuring:h,modifiers:g,...x}=t;const v=l.useReducer(Xr,void 0,Fr),[p,m]=v,[y,b]=$n(),[S,R]=l.useState(ce.Uninitialized),E=S===ce.Initialized,{draggable:{active:w,nodes:C,translate:O},droppable:{containers:I}}=p,M=w!=null?C.get(w):null,U=l.useRef({initial:null,translated:null}),W=l.useMemo(()=>{var k;return w!=null?{id:w,data:(k=M==null?void 0:M.data)!=null?k:zr,rect:U}:null},[w,M]),q=l.useRef(null),[Ce,je]=l.useState(null),[B,Ye]=l.useState(null),Q=ke(x,Object.values(x)),De=Xe("DndDescribedBy",s),Ke=l.useMemo(()=>I.getEnabled(),[I]),z=jr(h),{droppableRects:Z,measureDroppableContainers:de,measuringScheduled:Se}=Sr(Ke,{dragging:E,dependencies:[O.x,O.y],config:z.droppable}),j=Cr(C,w),Ue=l.useMemo(()=>B?Qe(B):null,[B]),re=On(),ee=Rr(j,z.draggable.measure);Yr({activeNode:w!=null?C.get(w):null,config:re.layoutShiftCompensation,initialRect:ee,measure:z.draggable.measure});const A=Yt(j,z.draggable.measure,ee),Re=Yt(j?j.parentElement:null),G=l.useRef({activatorEvent:null,active:null,activeNode:j,collisionRect:null,collisions:null,droppableRects:Z,draggableNodes:C,draggingNode:null,draggingNodeRect:null,droppableContainers:I,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),fe=I.getNodeFor((n=G.current.over)==null?void 0:n.id),te=kr({measure:z.dragOverlay.measure}),ge=(r=te.nodeRef.current)!=null?r:j,he=E?(o=te.rect)!=null?o:A:null,Et=!!(te.nodeRef.current&&te.rect),At=Mr(Et?null:A),lt=dn(ge?P(ge):null),oe=Or(E?fe??j:null),We=Lr(oe),He=vn(g,{transform:{x:O.x-At.x,y:O.y-At.y,scaleX:1,scaleY:1},activatorEvent:B,active:W,activeNodeRect:A,containerNodeRect:Re,draggingNodeRect:he,over:G.current.over,overlayNodeRect:te.rect,scrollableAncestors:oe,scrollableAncestorRects:We,windowRect:lt}),Mt=Ue?me(Ue,O):null,Ot=Ir(oe),Cn=Ut(Ot),Dn=Ut(Ot,[A]),ve=me(He,Cn),pe=he?er(he,He):null,Ee=W&&pe?d({active:W,collisionRect:pe,droppableRects:Z,droppableContainers:Ke,pointerCoordinates:Mt}):null,It=Zt(Ee,"id"),[ie,Nt]=l.useState(null),Sn=Et?He:me(He,Dn),Rn=Qn(Sn,(i=ie==null?void 0:ie.rect)!=null?i:null,A),ct=l.useRef(null),Tt=l.useCallback((k,F)=>{let{sensor:X,options:se}=F;if(q.current==null)return;const Y=C.get(q.current);if(!Y)return;const $=k.nativeEvent,J=new X({active:q.current,activeNode:Y,event:$,options:se,context:G,onAbort(L){if(!C.get(L))return;const{onDragAbort:_}=Q.current,ne={id:L};_==null||_(ne),y({type:"onDragAbort",event:ne})},onPending(L,ae,_,ne){if(!C.get(L))return;const{onDragPending:Me}=Q.current,le={id:L,constraint:ae,initialCoordinates:_,offset:ne};Me==null||Me(le),y({type:"onDragPending",event:le})},onStart(L){const ae=q.current;if(ae==null)return;const _=C.get(ae);if(!_)return;const{onDragStart:ne}=Q.current,Ae={activatorEvent:$,active:{id:ae,data:_.data,rect:U}};Ie.unstable_batchedUpdates(()=>{ne==null||ne(Ae),R(ce.Initializing),m({type:N.DragStart,initialCoordinates:L,active:ae}),y({type:"onDragStart",event:Ae}),je(ct.current),Ye($)})},onMove(L){m({type:N.DragMove,coordinates:L})},onEnd:be(N.DragEnd),onCancel:be(N.DragCancel)});ct.current=J;function be(L){return async function(){const{active:_,collisions:ne,over:Ae,scrollAdjustedTranslate:Me}=G.current;let le=null;if(_&&Me){const{cancelDrop:Oe}=Q.current;le={activatorEvent:$,active:_,collisions:ne,delta:Me,over:Ae},L===N.DragEnd&&typeof Oe=="function"&&await Promise.resolve(Oe(le))&&(L=N.DragCancel)}q.current=null,Ie.unstable_batchedUpdates(()=>{m({type:L}),R(ce.Uninitialized),Nt(null),je(null),Ye(null),ct.current=null;const Oe=L===N.DragEnd?"onDragEnd":"onDragCancel";if(le){const ut=Q.current[Oe];ut==null||ut(le),y({type:Oe,event:le})}})}}},[C]),En=l.useCallback((k,F)=>(X,se)=>{const Y=X.nativeEvent,$=C.get(se);if(q.current!==null||!$||Y.dndKit||Y.defaultPrevented)return;const J={active:$};k(X,F.options,J)===!0&&(Y.dndKit={capturedBy:F.sensor},q.current=se,Tt(X,F))},[C,Tt]),Lt=Dr(f,En);Nr(f),H(()=>{A&&S===ce.Initializing&&R(ce.Initialized)},[A,S]),l.useEffect(()=>{const{onDragMove:k}=Q.current,{active:F,activatorEvent:X,collisions:se,over:Y}=G.current;if(!F||!X)return;const $={active:F,activatorEvent:X,collisions:se,delta:{x:ve.x,y:ve.y},over:Y};Ie.unstable_batchedUpdates(()=>{k==null||k($),y({type:"onDragMove",event:$})})},[ve.x,ve.y]),l.useEffect(()=>{const{active:k,activatorEvent:F,collisions:X,droppableContainers:se,scrollAdjustedTranslate:Y}=G.current;if(!k||q.current==null||!F||!Y)return;const{onDragOver:$}=Q.current,J=se.get(It),be=J&&J.rect.current?{id:J.id,rect:J.rect.current,data:J.data,disabled:J.disabled}:null,L={active:k,activatorEvent:F,collisions:X,delta:{x:Y.x,y:Y.y},over:be};Ie.unstable_batchedUpdates(()=>{Nt(be),$==null||$(L),y({type:"onDragOver",event:L})})},[It]),H(()=>{G.current={activatorEvent:B,active:W,activeNode:j,collisionRect:pe,collisions:Ee,droppableRects:Z,draggableNodes:C,draggingNode:ge,draggingNodeRect:he,droppableContainers:I,over:ie,scrollableAncestors:oe,scrollAdjustedTranslate:ve},U.current={initial:he,translated:pe}},[W,j,Ee,pe,C,ge,he,Z,I,ie,oe,ve]),yr({...re,delta:O,draggingRect:pe,pointerCoordinates:Mt,scrollableAncestors:oe,scrollableAncestorRects:We});const An=l.useMemo(()=>({active:W,activeNode:j,activeNodeRect:A,activatorEvent:B,collisions:Ee,containerNodeRect:Re,dragOverlay:te,draggableNodes:C,droppableContainers:I,droppableRects:Z,over:ie,measureDroppableContainers:de,scrollableAncestors:oe,scrollableAncestorRects:We,measuringConfiguration:z,measuringScheduled:Se,windowRect:lt}),[W,j,A,B,Ee,Re,te,C,I,Z,ie,de,oe,We,z,Se,lt]),Mn=l.useMemo(()=>({activatorEvent:B,activators:Lt,active:W,activeNodeRect:A,ariaDescribedById:{draggable:De},dispatch:m,draggableNodes:C,over:ie,measureDroppableContainers:de}),[B,Lt,W,A,m,De,C,ie,de]);return l.createElement(Jt.Provider,{value:b},l.createElement($e.Provider,{value:Mn},l.createElement(hn.Provider,{value:An},l.createElement(at.Provider,{value:Rn},u)),l.createElement($r,{disabled:(a==null?void 0:a.restoreFocus)===!1})),l.createElement(Kn,{...a,hiddenTextDescribedById:De}));function On(){const k=(Ce==null?void 0:Ce.autoScrollEnabled)===!1,F=typeof c=="object"?c.enabled===!1:c===!1,X=E&&!k&&!F;return typeof c=="object"?{...c,enabled:X}:{enabled:X}}}),Ur=l.createContext(null),Ht="button",Wr="Draggable";function Hr(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const i=Xe(Wr),{activators:s,activatorEvent:a,active:c,activeNodeRect:u,ariaDescribedById:f,draggableNodes:d,over:h}=l.useContext($e),{role:g=Ht,roleDescription:x="draggable",tabIndex:v=0}=o??{},p=(c==null?void 0:c.id)===t,m=l.useContext(p?at:Ur),[y,b]=Je(),[S,R]=Je(),E=Tr(s,t),w=ke(n);H(()=>(d.set(t,{id:t,key:i,node:y,activatorNode:S,data:w}),()=>{const O=d.get(t);O&&O.key===i&&d.delete(t)}),[d,t]);const C=l.useMemo(()=>({role:g,tabIndex:v,"aria-disabled":r,"aria-pressed":p&&g===Ht?!0:void 0,"aria-roledescription":x,"aria-describedby":f.draggable}),[r,g,v,p,x,f.draggable]);return{active:c,activatorEvent:a,activeNodeRect:u,attributes:C,isDragging:p,listeners:r?void 0:E,node:y,over:h,setNodeRef:b,setActivatorNodeRef:R,transform:m}}function pn(){return l.useContext(hn)}const Vr="Droppable",qr={timeout:25};function Gr(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const i=Xe(Vr),{active:s,dispatch:a,over:c,measureDroppableContainers:u}=l.useContext($e),f=l.useRef({disabled:n}),d=l.useRef(!1),h=l.useRef(null),g=l.useRef(null),{disabled:x,updateMeasurementsFor:v,timeout:p}={...qr,...o},m=ke(v??r),y=l.useCallback(()=>{if(!d.current){d.current=!0;return}g.current!=null&&clearTimeout(g.current),g.current=setTimeout(()=>{u(Array.isArray(m.current)?m.current:[m.current]),g.current=null},p)},[p]),b=st({callback:y,disabled:x||!s}),S=l.useCallback((C,O)=>{b&&(O&&(b.unobserve(O),d.current=!1),C&&b.observe(C))},[b]),[R,E]=Je(S),w=ke(t);return l.useEffect(()=>{!b||!R.current||(b.disconnect(),d.current=!1,b.observe(R.current))},[R,b]),l.useEffect(()=>(a({type:N.RegisterDroppable,element:{id:r,key:i,disabled:n,node:R,rect:h,data:w}}),()=>a({type:N.UnregisterDroppable,key:i,id:r})),[r]),l.useEffect(()=>{n!==f.current.disabled&&(a({type:N.SetDroppableDisabled,id:r,key:i,disabled:n}),f.current.disabled=n)},[r,i,n,a]),{active:s,rect:h,isOver:(c==null?void 0:c.id)===r,node:R,over:c,setNodeRef:E}}function Jr(e){let{animation:t,children:n}=e;const[r,o]=l.useState(null),[i,s]=l.useState(null),a=_e(n);return!n&&!r&&a&&o(a),H(()=>{if(!i)return;const c=r==null?void 0:r.key,u=r==null?void 0:r.props.id;if(c==null||u==null){o(null);return}Promise.resolve(t(u,i)).then(()=>{o(null)})},[t,r,i]),l.createElement(l.Fragment,null,n,r?l.cloneElement(r,{ref:s}):null)}const _r={x:0,y:0,scaleX:1,scaleY:1};function Qr(e){let{children:t}=e;return l.createElement($e.Provider,{value:gn},l.createElement(at.Provider,{value:_r},t))}const Zr={position:"fixed",touchAction:"none"},eo=e=>ot(e)?"transform 250ms ease":void 0,to=l.forwardRef((e,t)=>{let{as:n,activatorEvent:r,adjustScale:o,children:i,className:s,rect:a,style:c,transform:u,transition:f=eo}=e;if(!a)return null;const d=o?u:{...u,scaleX:1,scaleY:1},h={...Zr,width:a.width,height:a.height,top:a.top,left:a.left,transform:ue.Transform.toString(d),transformOrigin:o&&r?Hn(r,a):void 0,transition:typeof f=="function"?f(r):f,...c};return l.createElement(n,{className:s,style:h,ref:t},i)}),no=e=>t=>{let{active:n,dragOverlay:r}=t;const o={},{styles:i,className:s}=e;if(i!=null&&i.active)for(const[a,c]of Object.entries(i.active))c!==void 0&&(o[a]=n.node.style.getPropertyValue(a),n.node.style.setProperty(a,c));if(i!=null&&i.dragOverlay)for(const[a,c]of Object.entries(i.dragOverlay))c!==void 0&&r.node.style.setProperty(a,c);return s!=null&&s.active&&n.node.classList.add(s.active),s!=null&&s.dragOverlay&&r.node.classList.add(s.dragOverlay),function(){for(const[c,u]of Object.entries(o))n.node.style.setProperty(c,u);s!=null&&s.active&&n.node.classList.remove(s.active)}},ro=e=>{let{transform:{initial:t,final:n}}=e;return[{transform:ue.Transform.toString(t)},{transform:ue.Transform.toString(n)}]},oo={duration:250,easing:"ease",keyframes:ro,sideEffects:no({styles:{active:{opacity:"0"}}})};function io(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:o}=e;return rt((i,s)=>{if(t===null)return;const a=n.get(i);if(!a)return;const c=a.node.current;if(!c)return;const u=fn(s);if(!u)return;const{transform:f}=P(s).getComputedStyle(s),d=tn(f);if(!d)return;const h=typeof t=="function"?t:so(t);return cn(c,o.draggable.measure),h({active:{id:i,data:a.data,node:c,rect:o.draggable.measure(c)},draggableNodes:n,dragOverlay:{node:s,rect:o.dragOverlay.measure(u)},droppableContainers:r,measuringConfiguration:o,transform:d})})}function so(e){const{duration:t,easing:n,sideEffects:r,keyframes:o}={...oo,...e};return i=>{let{active:s,dragOverlay:a,transform:c,...u}=i;if(!t)return;const f={x:a.rect.left-s.rect.left,y:a.rect.top-s.rect.top},d={scaleX:c.scaleX!==1?s.rect.width*c.scaleX/a.rect.width:1,scaleY:c.scaleY!==1?s.rect.height*c.scaleY/a.rect.height:1},h={x:c.x-f.x,y:c.y-f.y,...d},g=o({...u,active:s,dragOverlay:a,transform:{initial:c,final:h}}),[x]=g,v=g[g.length-1];if(JSON.stringify(x)===JSON.stringify(v))return;const p=r==null?void 0:r({active:s,dragOverlay:a,...u}),m=a.node.animate(g,{duration:t,easing:n,fill:"forwards"});return new Promise(y=>{m.onfinish=()=>{p==null||p(),y()}})}}let Vt=0;function ao(e){return l.useMemo(()=>{if(e!=null)return Vt++,Vt},[e])}const lo=l.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:r,style:o,transition:i,modifiers:s,wrapperElement:a="div",className:c,zIndex:u=999}=e;const{activatorEvent:f,active:d,activeNodeRect:h,containerNodeRect:g,draggableNodes:x,droppableContainers:v,dragOverlay:p,over:m,measuringConfiguration:y,scrollableAncestors:b,scrollableAncestorRects:S,windowRect:R}=pn(),E=l.useContext(at),w=ao(d==null?void 0:d.id),C=vn(s,{activatorEvent:f,active:d,activeNodeRect:h,containerNodeRect:g,draggingNodeRect:p.rect,over:m,overlayNodeRect:p.rect,scrollableAncestors:b,scrollableAncestorRects:S,transform:E,windowRect:R}),O=St(h),I=io({config:r,draggableNodes:x,droppableContainers:v,measuringConfiguration:y}),M=O?p.setRef:void 0;return l.createElement(Qr,null,l.createElement(Jr,{animation:I},d&&w?l.createElement(to,{key:w,id:d.id,ref:M,as:a,activatorEvent:f,adjustScale:t,className:c,transition:i,rect:O,style:{zIndex:u,...o},transform:C},n):null))});function Rt(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function co(e,t){return e.reduce((n,r,o)=>{const i=t.get(r);return i&&(n[o]=i),n},Array(e.length))}function Ve(e){return e!==null&&e>=0}function uo(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function fo(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const qe={scaleX:1,scaleY:1},go=e=>{var t;let{rects:n,activeNodeRect:r,activeIndex:o,overIndex:i,index:s}=e;const a=(t=n[o])!=null?t:r;if(!a)return null;const c=ho(n,s,o);if(s===o){const u=n[i];return u?{x:o<i?u.left+u.width-(a.left+a.width):u.left-a.left,y:0,...qe}:null}return s>o&&s<=i?{x:-a.width-c,y:0,...qe}:s<o&&s>=i?{x:a.width+c,y:0,...qe}:{x:0,y:0,...qe}};function ho(e,t,n){const r=e[t],o=e[t-1],i=e[t+1];return!r||!o&&!i?0:n<t?o?r.left-(o.left+o.width):i.left-(r.left+r.width):i?i.left-(r.left+r.width):r.left-(o.left+o.width)}const bn=e=>{let{rects:t,activeIndex:n,overIndex:r,index:o}=e;const i=Rt(t,r,n),s=t[o],a=i[o];return!a||!s?null:{x:a.left-s.left,y:a.top-s.top,scaleX:a.width/s.width,scaleY:a.height/s.height}},mn="Sortable",yn=l.createContext({activeIndex:-1,containerId:mn,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:bn,disabled:{draggable:!1,droppable:!1}});function vo(e){let{children:t,id:n,items:r,strategy:o=bn,disabled:i=!1}=e;const{active:s,dragOverlay:a,droppableRects:c,over:u,measureDroppableContainers:f}=pn(),d=Xe(mn,n),h=a.rect!==null,g=l.useMemo(()=>r.map(E=>typeof E=="object"&&"id"in E?E.id:E),[r]),x=s!=null,v=s?g.indexOf(s.id):-1,p=u?g.indexOf(u.id):-1,m=l.useRef(g),y=!uo(g,m.current),b=p!==-1&&v===-1||y,S=fo(i);H(()=>{y&&x&&f(g)},[y,g,x,f]),l.useEffect(()=>{m.current=g},[g]);const R=l.useMemo(()=>({activeIndex:v,containerId:d,disabled:S,disableTransforms:b,items:g,overIndex:p,useDragOverlay:h,sortedRects:co(g,c),strategy:o}),[v,d,S.draggable,S.droppable,b,g,p,c,h,o]);return l.createElement(yn.Provider,{value:R},t)}const po=e=>{let{id:t,items:n,activeIndex:r,overIndex:o}=e;return Rt(n,r,o).indexOf(t)},bo=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:o,items:i,newIndex:s,previousItems:a,previousContainerId:c,transition:u}=e;return!u||!r||a!==i&&o===s?!1:n?!0:s!==o&&t===c},mo={duration:200,easing:"ease"},wn="transform",yo=ue.Transition.toString({property:wn,duration:0,easing:"linear"}),wo={roleDescription:"sortable"};function xo(e){let{disabled:t,index:n,node:r,rect:o}=e;const[i,s]=l.useState(null),a=l.useRef(n);return H(()=>{if(!t&&n!==a.current&&r.current){const c=o.current;if(c){const u=xe(r.current,{ignoreTransform:!0}),f={x:c.left-u.left,y:c.top-u.top,scaleX:c.width/u.width,scaleY:c.height/u.height};(f.x||f.y)&&s(f)}}n!==a.current&&(a.current=n)},[t,n,r,o]),l.useEffect(()=>{i&&s(null)},[i]),i}function Co(e){let{animateLayoutChanges:t=bo,attributes:n,disabled:r,data:o,getNewIndex:i=po,id:s,strategy:a,resizeObserverConfig:c,transition:u=mo}=e;const{items:f,containerId:d,activeIndex:h,disabled:g,disableTransforms:x,sortedRects:v,overIndex:p,useDragOverlay:m,strategy:y}=l.useContext(yn),b=Do(r,g),S=f.indexOf(s),R=l.useMemo(()=>({sortable:{containerId:d,index:S,items:f},...o}),[d,o,S,f]),E=l.useMemo(()=>f.slice(f.indexOf(s)),[f,s]),{rect:w,node:C,isOver:O,setNodeRef:I}=Gr({id:s,data:R,disabled:b.droppable,resizeObserverConfig:{updateMeasurementsFor:E,...c}}),{active:M,activatorEvent:U,activeNodeRect:W,attributes:q,setNodeRef:Ce,listeners:je,isDragging:B,over:Ye,setActivatorNodeRef:Q,transform:De}=Hr({id:s,data:R,attributes:{...wo,...n},disabled:b.draggable}),Ke=In(I,Ce),z=!!M,Z=z&&!x&&Ve(h)&&Ve(p),de=!m&&B,Se=de&&Z?De:null,Ue=Z?Se??(a??y)({rects:v,activeNodeRect:W,activeIndex:h,overIndex:p,index:S}):null,re=Ve(h)&&Ve(p)?i({id:s,items:f,activeIndex:h,overIndex:p}):S,ee=M==null?void 0:M.id,A=l.useRef({activeId:ee,items:f,newIndex:re,containerId:d}),Re=f!==A.current.items,G=t({active:M,containerId:d,isDragging:B,isSorting:z,id:s,index:S,items:f,newIndex:A.current.newIndex,previousItems:A.current.items,previousContainerId:A.current.containerId,transition:u,wasDragging:A.current.activeId!=null}),fe=xo({disabled:!G,index:S,node:C,rect:w});return l.useEffect(()=>{z&&A.current.newIndex!==re&&(A.current.newIndex=re),d!==A.current.containerId&&(A.current.containerId=d),f!==A.current.items&&(A.current.items=f)},[z,re,d,f]),l.useEffect(()=>{if(ee===A.current.activeId)return;if(ee!=null&&A.current.activeId==null){A.current.activeId=ee;return}const ge=setTimeout(()=>{A.current.activeId=ee},50);return()=>clearTimeout(ge)},[ee]),{active:M,activeIndex:h,attributes:q,data:R,rect:w,index:S,newIndex:re,items:f,isOver:O,isSorting:z,isDragging:B,listeners:je,node:C,overIndex:p,over:Ye,setNodeRef:Ke,setActivatorNodeRef:Q,setDroppableNodeRef:I,setDraggableNodeRef:Ce,transform:fe??Ue,transition:te()};function te(){if(fe||Re&&A.current.newIndex===S)return yo;if(!(de&&!ot(U)||!u)&&(z||G))return ue.Transition.toString({...u,property:wn})}}function Do(e,t){var n,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e==null?void 0:e.draggable)!=null?n:t.draggable,droppable:(r=e==null?void 0:e.droppable)!=null?r:t.droppable}}function tt(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const So=[D.Down,D.Right,D.Up,D.Left],Ro=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:o,droppableContainers:i,over:s,scrollableAncestors:a}}=t;if(So.includes(e.code)){if(e.preventDefault(),!n||!r)return;const c=[];i.getEnabled().forEach(d=>{if(!d||d!=null&&d.disabled)return;const h=o.get(d.id);if(h)switch(e.code){case D.Down:r.top<h.top&&c.push(d);break;case D.Up:r.top>h.top&&c.push(d);break;case D.Left:r.left>h.left&&c.push(d);break;case D.Right:r.left<h.left&&c.push(d);break}});const u=Gn({active:n,collisionRect:r,droppableRects:o,droppableContainers:c,pointerCoordinates:null});let f=Zt(u,"id");if(f===(s==null?void 0:s.id)&&u.length>1&&(f=u[1].id),f!=null){const d=i.get(n.id),h=i.get(f),g=h?o.get(h.id):null,x=h==null?void 0:h.node.current;if(x&&g&&d&&h){const p=it(x).some((E,w)=>a[w]!==E),m=xn(d,h),y=Eo(d,h),b=p||!m?{x:0,y:0}:{x:y?r.width-g.width:0,y:y?r.height-g.height:0},S={x:g.left,y:g.top};return b.x&&b.y?S:Pe(S,b)}}}};function xn(e,t){return!tt(e)||!tt(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function Eo(e,t){return!tt(e)||!tt(t)||!xn(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}exports.CSS=ue;exports.DndContext=Kr;exports.DragOverlay=lo;exports.KeyboardSensor=xt;exports.PointerSensor=Dt;exports.SortableContext=vo;exports.arrayMove=Rt;exports.closestCenter=qn;exports.horizontalListSortingStrategy=go;exports.sortableKeyboardCoordinates=Ro;exports.useSensor=Un;exports.useSensors=Wn;exports.useSortable=Co;
6
6
  //# sourceMappingURL=sortable.esm.cjs.js.map