@object-ui/runner 0.3.1 → 2.0.0

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.
@@ -1 +0,0 @@
1
- import{r as n,f as L,j as i}from"./index-Czlaw_Lh.js";import{a as T,r as E,i as s,d as v,u as A,b as Y,g as B,c as R,e as F,f as G,h as m,s as I,j as _,k as z,l as M,m as N,n as H,o as K,p as W,C as q,R as V,B as X,q as $,X as J,T as Q,L as U,t as Z}from"./BarChart-CegIWQbY.js";var ee=["type"],re=["dangerouslySetInnerHTML","ticks","scale"],te=["id","scale"];function h(){return h=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var a in t)({}).hasOwnProperty.call(t,a)&&(r[a]=t[a])}return r},h.apply(null,arguments)}function O(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(r);e&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(r,l).enumerable})),t.push.apply(t,a)}return t}function k(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?O(Object(t),!0).forEach(function(a){ae(r,a,t[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):O(Object(t)).forEach(function(a){Object.defineProperty(r,a,Object.getOwnPropertyDescriptor(t,a))})}return r}function ae(r,e,t){return(e=ie(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function ie(r){var e=se(r,"string");return typeof e=="symbol"?e:e+""}function se(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var a=t.call(r,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function g(r,e){if(r==null)return{};var t,a,l=ne(r,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(r);for(a=0;a<o.length;a++)t=o[a],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(r,t)&&(l[t]=r[t])}return l}function ne(r,e){if(r==null)return{};var t={};for(var a in r)if({}.hasOwnProperty.call(r,a)){if(e.indexOf(a)!==-1)continue;t[a]=r[a]}return t}function oe(r){var e=A(),t=n.useRef(null),a=Y(),{type:l}=r,o=g(r,ee),f=B(a,"yAxis",l),c=n.useMemo(()=>{if(f!=null)return k(k({},o),{},{type:f})},[f,o]);return n.useLayoutEffect(()=>{c!=null&&(t.current===null?e(R(c)):t.current!==c&&e(F({prev:t.current,next:c})),t.current=c)},[c,e]),n.useLayoutEffect(()=>()=>{t.current&&(e(G(t.current)),t.current=null)},[e]),null}function le(r){var{yAxisId:e,className:t,width:a,label:l}=r,o=n.useRef(null),f=n.useRef(null),c=m(I),S=_(),b=A(),y="yAxis",d=m(u=>z(u,e)),x=m(u=>M(u,e)),w=m(u=>N(u,y,e,S)),p=m(u=>H(u,e));if(n.useLayoutEffect(()=>{if(!(a!=="auto"||!d||K(l)||n.isValidElement(l)||p==null)){var u=o.current;if(u){var j=u.getCalculatedWidth();Math.round(d.width)!==Math.round(j)&&b(W({id:e,width:j}))}}},[w,d,b,l,e,a,p]),d==null||x==null||p==null)return null;var{dangerouslySetInnerHTML:de,ticks:fe,scale:pe}=r,C=g(r,re),{id:me,scale:ye}=p,D=g(p,te);return n.createElement(q,h({},C,D,{ref:o,labelRef:f,x:x.x,y:x.y,tickTextProps:a==="auto"?{width:void 0}:{width:a},width:d.width,height:d.height,className:L("recharts-".concat(y," ").concat(y),t),viewBox:c,ticks:w,axisType:y}))}var ue={allowDataOverflow:s.allowDataOverflow,allowDecimals:s.allowDecimals,allowDuplicatedCategory:s.allowDuplicatedCategory,angle:s.angle,axisLine:v.axisLine,hide:!1,includeHidden:s.includeHidden,interval:s.interval,label:!1,minTickGap:s.minTickGap,mirror:s.mirror,orientation:s.orientation,padding:s.padding,reversed:s.reversed,scale:s.scale,tick:s.tick,tickCount:s.tickCount,tickLine:v.tickLine,tickSize:v.tickSize,type:s.type,width:s.width,yAxisId:0},ce=r=>{var e=E(r,ue);return n.createElement(n.Fragment,null,n.createElement(oe,{interval:e.interval,id:e.yAxisId,scale:e.scale,type:e.type,domain:e.domain,allowDataOverflow:e.allowDataOverflow,dataKey:e.dataKey,allowDuplicatedCategory:e.allowDuplicatedCategory,allowDecimals:e.allowDecimals,tickCount:e.tickCount,padding:e.padding,includeHidden:e.includeHidden,reversed:e.reversed,ticks:e.ticks,width:e.width,orientation:e.orientation,mirror:e.mirror,hide:e.hide,unit:e.unit,name:e.name,angle:e.angle,minTickGap:e.minTickGap,tick:e.tick,tickFormatter:e.tickFormatter}),n.createElement(le,e))},P=n.memo(ce,T);P.displayName="YAxis";function he({data:r=[],dataKey:e="value",xAxisKey:t="name",height:a=400,className:l="",color:o="hsl(var(--primary))"}){return i.jsx("div",{className:`p-4 rounded-xl border border-border bg-card/40 backdrop-blur-sm shadow-lg shadow-background/5 ${l}`,children:i.jsx(V,{width:"100%",height:a,children:i.jsxs(X,{data:r,margin:{top:20,right:30,left:20,bottom:5},children:[i.jsxs("defs",{children:[i.jsxs("linearGradient",{id:"barGradient",x1:"0",y1:"0",x2:"0",y2:"1",children:[i.jsx("stop",{offset:"0%",stopColor:o,stopOpacity:1}),i.jsx("stop",{offset:"90%",stopColor:o,stopOpacity:.6}),i.jsx("stop",{offset:"100%",stopColor:o,stopOpacity:.3})]}),i.jsxs("filter",{id:"glow",height:"130%",children:[i.jsx("feGaussianBlur",{in:"SourceAlpha",stdDeviation:"3",result:"blur"}),i.jsx("feOffset",{in:"blur",dx:"0",dy:"0",result:"offsetBlur"}),i.jsx("feFlood",{floodColor:o,floodOpacity:"0.5",result:"offsetColor"}),i.jsx("feComposite",{in:"offsetColor",in2:"offsetBlur",operator:"in",result:"offsetBlur"}),i.jsxs("feMerge",{children:[i.jsx("feMergeNode",{in:"offsetBlur"}),i.jsx("feMergeNode",{in:"SourceGraphic"})]})]})]}),i.jsx($,{strokeDasharray:"3 3",stroke:"hsl(var(--border))",vertical:!1}),i.jsx(J,{dataKey:t,tick:{fill:"hsl(var(--muted-foreground))",fontSize:12,fontFamily:"monospace"},tickLine:!1,axisLine:{stroke:"hsl(var(--border))"},dy:10}),i.jsx(P,{tick:{fill:"hsl(var(--muted-foreground))",fontSize:12,fontFamily:"monospace"},tickLine:!1,axisLine:!1}),i.jsx(Q,{cursor:{fill:"hsl(var(--muted))",opacity:.2},contentStyle:{backgroundColor:"hsl(var(--popover))",borderColor:"hsl(var(--border))",color:"hsl(var(--popover-foreground))",borderRadius:"8px",fontFamily:"monospace",boxShadow:"0 4px 6px -1px rgb(0 0 0 / 0.1)"},itemStyle:{color:"hsl(var(--primary))"}}),i.jsx(U,{wrapperStyle:{paddingTop:"20px",fontFamily:"monospace"}}),i.jsx(Z,{dataKey:e,fill:"url(#barGradient)",radius:[4,4,0,0],filter:"url(#glow)",animationDuration:1500})]})})})}export{he as default};
@@ -1,5 +0,0 @@
1
- import{r as l,R as T,a as Te,j as M,B as Vt,S as On,C as Mn,b as Tn,c as Ln,d as kn,e as jn}from"./index-Czlaw_Lh.js";function Pn(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return l.useMemo(()=>r=>{t.forEach(o=>o(r))},t)}const rt=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function we(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function mt(e){return"nodeType"in e}function B(e){var t,n;return e?we(e)?e:mt(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function yt(e){const{Document:t}=B(e);return e instanceof t}function Be(e){return we(e)?!1:e instanceof B(e).HTMLElement}function qt(e){return e instanceof B(e).SVGElement}function Ce(e){return e?we(e)?e.document:mt(e)?yt(e)?e:Be(e)||qt(e)?e.ownerDocument:document:document:document}const q=rt?l.useLayoutEffect:l.useEffect;function ot(e){const t=l.useRef(e);return q(()=>{t.current=e}),l.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}function zn(){const e=l.useRef(null),t=l.useCallback((r,o)=>{e.current=setInterval(r,o)},[]),n=l.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function Pe(e,t){t===void 0&&(t=[e]);const n=l.useRef(e);return q(()=>{n.current!==e&&(n.current=e)},t),n}function Fe(e,t){const n=l.useRef();return l.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function _e(e){const t=ot(e),n=l.useRef(null),r=l.useCallback(o=>{o!==n.current&&(t==null||t(o,n.current)),n.current=o},[]);return[n,r]}function Qe(e){const t=l.useRef();return l.useEffect(()=>{t.current=e},[e]),t.current}let dt={};function $e(e,t){return l.useMemo(()=>{if(t)return t;const n=dt[e]==null?0:dt[e]+1;return dt[e]=n,e+"-"+n},[e,t])}function Gt(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((i,s)=>{const a=Object.entries(s);for(const[c,u]of a){const d=i[c];d!=null&&(i[c]=d+e*u)}return i},{...t})}}const xe=Gt(1),Ze=Gt(-1);function Bn(e){return"clientX"in e&&"clientY"in e}function it(e){if(!e)return!1;const{KeyboardEvent:t}=B(e.target);return t&&e instanceof t}function Fn(e){if(!e)return!1;const{TouchEvent:t}=B(e.target);return t&&e instanceof t}function et(e){if(Fn(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return Bn(e)?{x:e.clientX,y:e.clientY}:null}const fe=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[fe.Translate.toString(e),fe.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),kt="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function $n(e){return e.matches(kt)?e:e.querySelector(kt)}const Xn={display:"none"};function Yn(e){let{id:t,value:n}=e;return T.createElement("div",{id:t,style:Xn},n)}function Kn(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const o={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return T.createElement("div",{id:t,style:o,role:"status","aria-live":r,"aria-atomic":!0},n)}function Un(){const[e,t]=l.useState("");return{announce:l.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const Jt=l.createContext(null);function Wn(e){const t=l.useContext(Jt);l.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function Hn(){const[e]=l.useState(()=>new Set),t=l.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[l.useCallback(r=>{let{type:o,event:i}=r;e.forEach(s=>{var a;return(a=s[o])==null?void 0:a.call(s,i)})},[e]),t]}const Vn={draggable:`
2
- To pick up a draggable item, press the space bar.
3
- While dragging, use the arrow keys to move the item.
4
- Press space again to drop the item in its new position, or press escape to cancel.
5
- `},qn={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 Gn(e){let{announcements:t=qn,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=Vn}=e;const{announce:i,announcement:s}=Un(),a=$e("DndLiveRegion"),[c,u]=l.useState(!1);if(l.useEffect(()=>{u(!0)},[]),Wn(l.useMemo(()=>({onDragStart(f){let{active:v}=f;i(t.onDragStart({active:v}))},onDragMove(f){let{active:v,over:g}=f;t.onDragMove&&i(t.onDragMove({active:v,over:g}))},onDragOver(f){let{active:v,over:g}=f;i(t.onDragOver({active:v,over:g}))},onDragEnd(f){let{active:v,over:g}=f;i(t.onDragEnd({active:v,over:g}))},onDragCancel(f){let{active:v,over:g}=f;i(t.onDragCancel({active:v,over:g}))}}),[i,t])),!c)return null;const d=T.createElement(T.Fragment,null,T.createElement(Yn,{id:r,value:o.draggable}),T.createElement(Kn,{id:a,announcement:s}));return n?Te.createPortal(d,n):d}var L;(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"})(L||(L={}));function tt(){}function Jn(e,t){return l.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function _n(){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 G=Object.freeze({x:0,y:0});function Qn(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Zn(e,t){const n=et(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 er(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function tr(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function jt(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 nr(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}const rr=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=jt(t),i=[];for(const s of r){const{id:a}=s,c=n.get(a);if(c){const u=jt(c),d=o.reduce((v,g,b)=>v+Qn(u[b],g),0),f=Number((d/4).toFixed(4));i.push({id:a,data:{droppableContainer:s,value:f}})}}return i.sort(er)};function or(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,d=s*a,f=d/(c+u-d);return Number(f.toFixed(4))}return 0}const ir=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=or(a,t);c>0&&o.push({id:s,data:{droppableContainer:i,value:c}})}}return o.sort(tr)};function sr(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function _t(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:G}function ar(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 lr=ar(1);function Qt(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 cr(e,t,n){const r=Qt(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)),d=o?e.width/o:e.width,f=i?e.height/i:e.height;return{width:d,height:f,top:u,right:c+d,bottom:u+f,left:c}}const ur={ignoreTransform:!1};function De(e,t){t===void 0&&(t=ur);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:u,transformOrigin:d}=B(e).getComputedStyle(e);u&&(n=cr(n,u,d))}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 Pt(e){return De(e,{ignoreTransform:!0})}function dr(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function fr(e,t){return t===void 0&&(t=B(e).getComputedStyle(e)),t.position==="fixed"}function gr(e,t){t===void 0&&(t=B(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 xt(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=B(e).getComputedStyle(o);return o!==e&&gr(o,i)&&n.push(o),fr(o,i)?n:r(o.parentNode)}return e?r(e):n}function Zt(e){const[t]=xt(e,1);return t??null}function ft(e){return!rt||!e?null:we(e)?e:mt(e)?yt(e)||e===Ce(e).scrollingElement?window:Be(e)?e:null:null}function en(e){return we(e)?e.scrollX:e.scrollLeft}function tn(e){return we(e)?e.scrollY:e.scrollTop}function vt(e){return{x:en(e),y:tn(e)}}var k;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(k||(k={}));function nn(e){return!rt||!e?!1:e===document.scrollingElement}function rn(e){const t={x:0,y:0},n=nn(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 hr={x:.2,y:.2};function vr(e,t,n,r,o){let{top:i,left:s,right:a,bottom:c}=n;r===void 0&&(r=10),o===void 0&&(o=hr);const{isTop:u,isBottom:d,isLeft:f,isRight:v}=rn(e),g={x:0,y:0},b={x:0,y:0},h={height:t.height*o.y,width:t.width*o.x};return!u&&i<=t.top+h.height?(g.y=k.Backward,b.y=r*Math.abs((t.top+h.height-i)/h.height)):!d&&c>=t.bottom-h.height&&(g.y=k.Forward,b.y=r*Math.abs((t.bottom-h.height-c)/h.height)),!v&&a>=t.right-h.width?(g.x=k.Forward,b.x=r*Math.abs((t.right-h.width-a)/h.width)):!f&&s<=t.left+h.width&&(g.x=k.Backward,b.x=r*Math.abs((t.left+h.width-s)/h.width)),{direction:g,speed:b}}function pr(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 on(e){return e.reduce((t,n)=>xe(t,vt(n)),G)}function br(e){return e.reduce((t,n)=>t+en(n),0)}function mr(e){return e.reduce((t,n)=>t+tn(n),0)}function sn(e,t){if(t===void 0&&(t=De),!e)return;const{top:n,left:r,bottom:o,right:i}=t(e);Zt(e)&&(o<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const yr=[["x",["left","right"],br],["y",["top","bottom"],mr]];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=xt(n),o=on(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[i,s,a]of yr)for(const c of s)Object.defineProperty(this,c,{get:()=>{const u=a(r),d=o[i]-u;return this.rect[c]+d},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Le{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 xr(e){const{EventTarget:t}=B(e);return e instanceof t?e:Ce(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 H;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(H||(H={}));function zt(e){e.preventDefault()}function wr(e){e.stopPropagation()}var I;(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"})(I||(I={}));const an={start:[I.Space,I.Enter],cancel:[I.Esc],end:[I.Space,I.Enter,I.Tab]},Cr=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case I.Right:return{...n,x:n.x+25};case I.Left:return{...n,x:n.x-25};case I.Down:return{...n,y:n.y+25};case I.Up:return{...n,y:n.y-25}}};class ln{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 Le(Ce(n)),this.windowListeners=new Le(B(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(H.Resize,this.handleCancel),this.windowListeners.add(H.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(H.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&sn(r),n(G)}handleKeyDown(t){if(it(t)){const{active:n,context:r,options:o}=this.props,{keyboardCodes:i=an,coordinateGetter:s=Cr,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,d=u?{x:u.left,y:u.top}:G;this.referenceCoordinates||(this.referenceCoordinates=d);const f=s(t,{active:n,context:r.current,currentCoordinates:d});if(f){const v=Ze(f,d),g={x:0,y:0},{scrollableAncestors:b}=r.current;for(const h of b){const p=t.code,{isTop:m,isRight:x,isLeft:y,isBottom:D,maxScroll:w,minScroll:R}=rn(h),C=pr(h),S={x:Math.min(p===I.Right?C.right-C.width/2:C.right,Math.max(p===I.Right?C.left:C.left+C.width/2,f.x)),y:Math.min(p===I.Down?C.bottom-C.height/2:C.bottom,Math.max(p===I.Down?C.top:C.top+C.height/2,f.y))},E=p===I.Right&&!x||p===I.Left&&!y,O=p===I.Down&&!D||p===I.Up&&!m;if(E&&S.x!==f.x){const N=h.scrollLeft+v.x,j=p===I.Right&&N<=w.x||p===I.Left&&N>=R.x;if(j&&!v.y){h.scrollTo({left:N,behavior:a});return}j?g.x=h.scrollLeft-N:g.x=p===I.Right?h.scrollLeft-w.x:h.scrollLeft-R.x,g.x&&h.scrollBy({left:-g.x,behavior:a});break}else if(O&&S.y!==f.y){const N=h.scrollTop+v.y,j=p===I.Down&&N<=w.y||p===I.Up&&N>=R.y;if(j&&!v.x){h.scrollTo({top:N,behavior:a});return}j?g.y=h.scrollTop-N:g.y=p===I.Down?h.scrollTop-w.y:h.scrollTop-R.y,g.y&&h.scrollBy({top:-g.y,behavior:a});break}}this.handleMove(t,xe(Ze(f,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()}}ln.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=an,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 Bt(e){return!!(e&&"distance"in e)}function Ft(e){return!!(e&&"delay"in e)}class Ct{constructor(t,n,r){var o;r===void 0&&(r=xr(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=Ce(s),this.documentListeners=new Le(this.document),this.listeners=new Le(r),this.windowListeners=new Le(B(s)),this.initialCoordinates=(o=et(i))!=null?o:G,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(H.Resize,this.handleCancel),this.windowListeners.add(H.DragStart,zt),this.windowListeners.add(H.VisibilityChange,this.handleCancel),this.windowListeners.add(H.ContextMenu,zt),this.documentListeners.add(H.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Ft(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(Bt(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(H.Click,wr,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(H.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=et(t))!=null?n:G,u=Ze(o,c);if(!r&&a){if(Bt(a)){if(a.tolerance!=null&&gt(u,a.tolerance))return this.handleCancel();if(gt(u,a.distance))return this.handleStart()}if(Ft(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===I.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const Dr={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Dt extends Ct{constructor(t){const{event:n}=t,r=Ce(n.target);super(t,Dr,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 Sr={move:{name:"mousemove"},end:{name:"mouseup"}};var pt;(function(e){e[e.RightClick=2]="RightClick"})(pt||(pt={}));class Rr extends Ct{constructor(t){super(t,Sr,Ce(t.event.target))}}Rr.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 Er 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(){}}}Er.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 ke;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(ke||(ke={}));var nt;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(nt||(nt={}));function Nr(e){let{acceleration:t,activator:n=ke.Pointer,canScroll:r,draggingRect:o,enabled:i,interval:s=5,order:a=nt.TreeOrder,pointerCoordinates:c,scrollableAncestors:u,scrollableAncestorRects:d,delta:f,threshold:v}=e;const g=Ar({delta:f,disabled:!i}),[b,h]=zn(),p=l.useRef({x:0,y:0}),m=l.useRef({x:0,y:0}),x=l.useMemo(()=>{switch(n){case ke.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case ke.DraggableRect:return o}},[n,o,c]),y=l.useRef(null),D=l.useCallback(()=>{const R=y.current;if(!R)return;const C=p.current.x*m.current.x,S=p.current.y*m.current.y;R.scrollBy(C,S)},[]),w=l.useMemo(()=>a===nt.TreeOrder?[...u].reverse():u,[a,u]);l.useEffect(()=>{if(!i||!u.length||!x){h();return}for(const R of w){if((r==null?void 0:r(R))===!1)continue;const C=u.indexOf(R),S=d[C];if(!S)continue;const{direction:E,speed:O}=vr(R,S,x,t,v);for(const N of["x","y"])g[N][E[N]]||(O[N]=0,E[N]=0);if(O.x>0||O.y>0){h(),y.current=R,b(D,s),p.current=O,m.current=E;return}}p.current={x:0,y:0},m.current={x:0,y:0},h()},[t,D,r,h,i,s,JSON.stringify(x),JSON.stringify(g),b,u,w,d,JSON.stringify(v)])}const Ir={x:{[k.Backward]:!1,[k.Forward]:!1},y:{[k.Backward]:!1,[k.Forward]:!1}};function Ar(e){let{delta:t,disabled:n}=e;const r=Qe(t);return Fe(o=>{if(n||!r||!o)return Ir;const i={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[k.Backward]:o.x[k.Backward]||i.x===-1,[k.Forward]:o.x[k.Forward]||i.x===1},y:{[k.Backward]:o.y[k.Backward]||i.y===-1,[k.Forward]:o.y[k.Forward]||i.y===1}}},[n,t,r])}function Or(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 Mr(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 $t=new Map;function Tr(e,t){let{dragging:n,dependencies:r,config:o}=t;const[i,s]=l.useState(null),{frequency:a,measure:c,strategy:u}=o,d=l.useRef(e),f=p(),v=Pe(f),g=l.useCallback(function(m){m===void 0&&(m=[]),!v.current&&s(x=>x===null?m:x.concat(m.filter(y=>!x.includes(y))))},[v]),b=l.useRef(null),h=Fe(m=>{if(f&&!n)return $t;if(!m||m===$t||d.current!==e||i!=null){const x=new Map;for(let y of e){if(!y)continue;if(i&&i.length>0&&!i.includes(y.id)&&y.rect.current){x.set(y.id,y.rect.current);continue}const D=y.node.current,w=D?new wt(c(D),D):null;y.rect.current=w,w&&x.set(y.id,w)}return x}return m},[e,i,n,f,c]);return l.useEffect(()=>{d.current=e},[e]),l.useEffect(()=>{f||g()},[n,f]),l.useEffect(()=>{i&&i.length>0&&s(null)},[JSON.stringify(i)]),l.useEffect(()=>{f||typeof a!="number"||b.current!==null||(b.current=setTimeout(()=>{g(),b.current=null},a))},[a,f,g,...r]),{droppableRects:h,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 Lr(e,t){return St(e,t)}function kr(e){let{callback:t,disabled:n}=e;const r=ot(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=ot(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 jr(e){return new wt(De(e),e)}function Xt(e,t,n){t===void 0&&(t=jr);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 d=t(e);return JSON.stringify(c)===JSON.stringify(d)?c:d})}const s=kr({callback(c){if(e)for(const u of c){const{type:d,target:f}=u;if(d==="childList"&&f instanceof HTMLElement&&f.contains(e)){i();break}}}}),a=st({callback:i});return q(()=>{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 Pr(e){const t=St(e);return _t(e,t)}const Yt=[];function zr(e){const t=l.useRef(e),n=Fe(r=>e?r&&r!==Yt&&e&&t.current&&e.parentNode===t.current.parentNode?r:xt(e):Yt,[e]);return l.useEffect(()=>{t.current=e},[e]),n}function Br(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)=>xe(i,s),G):on(e):G,[e,t])}function Kt(e,t){t===void 0&&(t=[]);const n=l.useRef(null);return l.useEffect(()=>{n.current=null},t),l.useEffect(()=>{const r=e!==G;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?Ze(e,n.current):G}function Fr(e){l.useEffect(()=>{if(!rt)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 $r(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 cn(e){return l.useMemo(()=>e?dr(e):null,[e])}const Ut=[];function Xr(e,t){t===void 0&&(t=De);const[n]=e,r=cn(n?B(n):null),[o,i]=l.useState(Ut);function s(){i(()=>e.length?e.map(c=>nn(c)?r:new wt(t(c),c)):Ut)}const a=st({callback:s});return q(()=>{a==null||a.disconnect(),s(),e.forEach(c=>a==null?void 0:a.observe(c))},[e]),o}function un(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Be(t)?t:e}function Yr(e){let{measure:t}=e;const[n,r]=l.useState(null),o=l.useCallback(u=>{for(const{target:d}of u)if(Be(d)){r(f=>{const v=t(d);return f?{...f,width:v.width,height:v.height}:v});break}},[t]),i=st({callback:o}),s=l.useCallback(u=>{const d=un(u);i==null||i.disconnect(),d&&(i==null||i.observe(d)),r(d?t(d):null)},[t,i]),[a,c]=_e(s);return l.useMemo(()=>({nodeRef:a,rect:n,setRef:c}),[n,a,c])}const Kr=[{sensor:Dt,options:{}},{sensor:ln,options:{}}],Ur={current:{}},Je={draggable:{measure:Pt},droppable:{measure:Pt,strategy:ze.WhileDragging,frequency:bt.Optimized},dragOverlay:{measure:De}};class je 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 Wr={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new je,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:tt},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Je,measureDroppableContainers:tt,windowRect:null,measuringScheduled:!1},dn={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:tt,draggableNodes:new Map,over:null,measureDroppableContainers:tt},Xe=l.createContext(dn),fn=l.createContext(Wr);function Hr(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new je}}}function Vr(e,t){switch(t.type){case L.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case L.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 L.DragEnd:case L.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case L.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new je(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case L.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 je(e.droppable.containers);return s.set(n,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:s}}}case L.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const i=new je(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function qr(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=l.useContext(Xe),i=Qe(r),s=Qe(n==null?void 0:n.id);return l.useEffect(()=>{if(!t&&!r&&i&&s!=null){if(!it(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 d of[c.current,u.current]){if(!d)continue;const f=$n(d);if(f){f.focus();break}}})}},[r,t,o,s,i]),null}function gn(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((o,i)=>i({transform:o,...r}),n):n}function Gr(e){return l.useMemo(()=>({draggable:{...Je.draggable,...e==null?void 0:e.draggable},droppable:{...Je.droppable,...e==null?void 0:e.droppable},dragOverlay:{...Je.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 Jr(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;q(()=>{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 d=n(u),f=_t(d,r);if(s||(f.x=0),a||(f.y=0),i.current=!0,Math.abs(f.x)>0||Math.abs(f.y)>0){const v=Zt(u);v&&v.scrollBy({top:f.y,left:f.x})}},[t,s,a,r,n])}const at=l.createContext({...G,scaleX:1,scaleY:1});var de;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(de||(de={}));const _r=l.memo(function(t){var n,r,o,i;let{id:s,accessibility:a,autoScroll:c=!0,children:u,sensors:d=Kr,collisionDetection:f=ir,measuring:v,modifiers:g,...b}=t;const h=l.useReducer(Vr,void 0,Hr),[p,m]=h,[x,y]=Hn(),[D,w]=l.useState(de.Uninitialized),R=D===de.Initialized,{draggable:{active:C,nodes:S,translate:E},droppable:{containers:O}}=p,N=C!=null?S.get(C):null,j=l.useRef({initial:null,translated:null}),V=l.useMemo(()=>{var z;return C!=null?{id:C,data:(z=N==null?void 0:N.data)!=null?z:Ur,rect:j}:null},[C,N]),J=l.useRef(null),[Se,Ye]=l.useState(null),[$,Ke]=l.useState(null),ee=Pe(b,Object.values(b)),Re=$e("DndDescribedBy",s),Ue=l.useMemo(()=>O.getEnabled(),[O]),F=Gr(v),{droppableRects:te,measureDroppableContainers:ge,measuringScheduled:Ee}=Tr(Ue,{dragging:R,dependencies:[E.x,E.y],config:F.droppable}),U=Or(S,C),We=l.useMemo(()=>$?et($):null,[$]),ie=An(),ne=Lr(U,F.draggable.measure);Jr({activeNode:C!=null?S.get(C):null,config:ie.layoutShiftCompensation,initialRect:ne,measure:F.draggable.measure});const A=Xt(U,F.draggable.measure,ne),Ne=Xt(U?U.parentElement:null),_=l.useRef({activatorEvent:null,active:null,activeNode:U,collisionRect:null,collisions:null,droppableRects:te,draggableNodes:S,draggingNode:null,draggingNodeRect:null,droppableContainers:O,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),he=O.getNodeFor((n=_.current.over)==null?void 0:n.id),re=Yr({measure:F.dragOverlay.measure}),ve=(r=re.nodeRef.current)!=null?r:U,pe=R?(o=re.rect)!=null?o:A:null,Et=!!(re.nodeRef.current&&re.rect),Nt=Pr(Et?null:A),lt=cn(ve?B(ve):null),se=zr(R?he??U:null),He=Xr(se),Ve=gn(g,{transform:{x:E.x-Nt.x,y:E.y-Nt.y,scaleX:1,scaleY:1},activatorEvent:$,active:V,activeNodeRect:A,containerNodeRect:Ne,draggingNodeRect:pe,over:_.current.over,overlayNodeRect:re.rect,scrollableAncestors:se,scrollableAncestorRects:He,windowRect:lt}),It=We?xe(We,E):null,At=Br(se),Cn=Kt(At),Dn=Kt(At,[A]),be=xe(Ve,Cn),me=pe?lr(pe,Ve):null,Ie=V&&me?f({active:V,collisionRect:me,droppableRects:te,droppableContainers:Ue,pointerCoordinates:It}):null,Ot=nr(Ie,"id"),[ae,Mt]=l.useState(null),Sn=Et?Ve:xe(Ve,Dn),Rn=sr(Sn,(i=ae==null?void 0:ae.rect)!=null?i:null,A),ct=l.useRef(null),Tt=l.useCallback((z,X)=>{let{sensor:Y,options:le}=X;if(J.current==null)return;const W=S.get(J.current);if(!W)return;const K=z.nativeEvent,Q=new Y({active:J.current,activeNode:W,event:K,options:le,context:_,onAbort(P){if(!S.get(P))return;const{onDragAbort:Z}=ee.current,oe={id:P};Z==null||Z(oe),x({type:"onDragAbort",event:oe})},onPending(P,ce,Z,oe){if(!S.get(P))return;const{onDragPending:Oe}=ee.current,ue={id:P,constraint:ce,initialCoordinates:Z,offset:oe};Oe==null||Oe(ue),x({type:"onDragPending",event:ue})},onStart(P){const ce=J.current;if(ce==null)return;const Z=S.get(ce);if(!Z)return;const{onDragStart:oe}=ee.current,Ae={activatorEvent:K,active:{id:ce,data:Z.data,rect:j}};Te.unstable_batchedUpdates(()=>{oe==null||oe(Ae),w(de.Initializing),m({type:L.DragStart,initialCoordinates:P,active:ce}),x({type:"onDragStart",event:Ae}),Ye(ct.current),Ke(K)})},onMove(P){m({type:L.DragMove,coordinates:P})},onEnd:ye(L.DragEnd),onCancel:ye(L.DragCancel)});ct.current=Q;function ye(P){return async function(){const{active:Z,collisions:oe,over:Ae,scrollAdjustedTranslate:Oe}=_.current;let ue=null;if(Z&&Oe){const{cancelDrop:Me}=ee.current;ue={activatorEvent:K,active:Z,collisions:oe,delta:Oe,over:Ae},P===L.DragEnd&&typeof Me=="function"&&await Promise.resolve(Me(ue))&&(P=L.DragCancel)}J.current=null,Te.unstable_batchedUpdates(()=>{m({type:P}),w(de.Uninitialized),Mt(null),Ye(null),Ke(null),ct.current=null;const Me=P===L.DragEnd?"onDragEnd":"onDragCancel";if(ue){const ut=ee.current[Me];ut==null||ut(ue),x({type:Me,event:ue})}})}}},[S]),En=l.useCallback((z,X)=>(Y,le)=>{const W=Y.nativeEvent,K=S.get(le);if(J.current!==null||!K||W.dndKit||W.defaultPrevented)return;const Q={active:K};z(Y,X.options,Q)===!0&&(W.dndKit={capturedBy:X.sensor},J.current=le,Tt(Y,X))},[S,Tt]),Lt=Mr(d,En);Fr(d),q(()=>{A&&D===de.Initializing&&w(de.Initialized)},[A,D]),l.useEffect(()=>{const{onDragMove:z}=ee.current,{active:X,activatorEvent:Y,collisions:le,over:W}=_.current;if(!X||!Y)return;const K={active:X,activatorEvent:Y,collisions:le,delta:{x:be.x,y:be.y},over:W};Te.unstable_batchedUpdates(()=>{z==null||z(K),x({type:"onDragMove",event:K})})},[be.x,be.y]),l.useEffect(()=>{const{active:z,activatorEvent:X,collisions:Y,droppableContainers:le,scrollAdjustedTranslate:W}=_.current;if(!z||J.current==null||!X||!W)return;const{onDragOver:K}=ee.current,Q=le.get(Ot),ye=Q&&Q.rect.current?{id:Q.id,rect:Q.rect.current,data:Q.data,disabled:Q.disabled}:null,P={active:z,activatorEvent:X,collisions:Y,delta:{x:W.x,y:W.y},over:ye};Te.unstable_batchedUpdates(()=>{Mt(ye),K==null||K(P),x({type:"onDragOver",event:P})})},[Ot]),q(()=>{_.current={activatorEvent:$,active:V,activeNode:U,collisionRect:me,collisions:Ie,droppableRects:te,draggableNodes:S,draggingNode:ve,draggingNodeRect:pe,droppableContainers:O,over:ae,scrollableAncestors:se,scrollAdjustedTranslate:be},j.current={initial:pe,translated:me}},[V,U,Ie,me,S,ve,pe,te,O,ae,se,be]),Nr({...ie,delta:E,draggingRect:me,pointerCoordinates:It,scrollableAncestors:se,scrollableAncestorRects:He});const Nn=l.useMemo(()=>({active:V,activeNode:U,activeNodeRect:A,activatorEvent:$,collisions:Ie,containerNodeRect:Ne,dragOverlay:re,draggableNodes:S,droppableContainers:O,droppableRects:te,over:ae,measureDroppableContainers:ge,scrollableAncestors:se,scrollableAncestorRects:He,measuringConfiguration:F,measuringScheduled:Ee,windowRect:lt}),[V,U,A,$,Ie,Ne,re,S,O,te,ae,ge,se,He,F,Ee,lt]),In=l.useMemo(()=>({activatorEvent:$,activators:Lt,active:V,activeNodeRect:A,ariaDescribedById:{draggable:Re},dispatch:m,draggableNodes:S,over:ae,measureDroppableContainers:ge}),[$,Lt,V,A,m,Re,S,ae,ge]);return T.createElement(Jt.Provider,{value:y},T.createElement(Xe.Provider,{value:In},T.createElement(fn.Provider,{value:Nn},T.createElement(at.Provider,{value:Rn},u)),T.createElement(qr,{disabled:(a==null?void 0:a.restoreFocus)===!1})),T.createElement(Gn,{...a,hiddenTextDescribedById:Re}));function An(){const z=(Se==null?void 0:Se.autoScrollEnabled)===!1,X=typeof c=="object"?c.enabled===!1:c===!1,Y=R&&!z&&!X;return typeof c=="object"?{...c,enabled:Y}:{enabled:Y}}}),Qr=l.createContext(null),Wt="button",Zr="Draggable";function eo(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const i=$e(Zr),{activators:s,activatorEvent:a,active:c,activeNodeRect:u,ariaDescribedById:d,draggableNodes:f,over:v}=l.useContext(Xe),{role:g=Wt,roleDescription:b="draggable",tabIndex:h=0}=o??{},p=(c==null?void 0:c.id)===t,m=l.useContext(p?at:Qr),[x,y]=_e(),[D,w]=_e(),R=$r(s,t),C=Pe(n);q(()=>(f.set(t,{id:t,key:i,node:x,activatorNode:D,data:C}),()=>{const E=f.get(t);E&&E.key===i&&f.delete(t)}),[f,t]);const S=l.useMemo(()=>({role:g,tabIndex:h,"aria-disabled":r,"aria-pressed":p&&g===Wt?!0:void 0,"aria-roledescription":b,"aria-describedby":d.draggable}),[r,g,h,p,b,d.draggable]);return{active:c,activatorEvent:a,activeNodeRect:u,attributes:S,isDragging:p,listeners:r?void 0:R,node:x,over:v,setNodeRef:y,setActivatorNodeRef:w,transform:m}}function hn(){return l.useContext(fn)}const to="Droppable",no={timeout:25};function ro(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const i=$e(to),{active:s,dispatch:a,over:c,measureDroppableContainers:u}=l.useContext(Xe),d=l.useRef({disabled:n}),f=l.useRef(!1),v=l.useRef(null),g=l.useRef(null),{disabled:b,updateMeasurementsFor:h,timeout:p}={...no,...o},m=Pe(h??r),x=l.useCallback(()=>{if(!f.current){f.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]),y=st({callback:x,disabled:b||!s}),D=l.useCallback((S,E)=>{y&&(E&&(y.unobserve(E),f.current=!1),S&&y.observe(S))},[y]),[w,R]=_e(D),C=Pe(t);return l.useEffect(()=>{!y||!w.current||(y.disconnect(),f.current=!1,y.observe(w.current))},[w,y]),l.useEffect(()=>(a({type:L.RegisterDroppable,element:{id:r,key:i,disabled:n,node:w,rect:v,data:C}}),()=>a({type:L.UnregisterDroppable,key:i,id:r})),[r]),l.useEffect(()=>{n!==d.current.disabled&&(a({type:L.SetDroppableDisabled,id:r,key:i,disabled:n}),d.current.disabled=n)},[r,i,n,a]),{active:s,rect:v,isOver:(c==null?void 0:c.id)===r,node:w,over:c,setNodeRef:R}}function oo(e){let{animation:t,children:n}=e;const[r,o]=l.useState(null),[i,s]=l.useState(null),a=Qe(n);return!n&&!r&&a&&o(a),q(()=>{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]),T.createElement(T.Fragment,null,n,r?l.cloneElement(r,{ref:s}):null)}const io={x:0,y:0,scaleX:1,scaleY:1};function so(e){let{children:t}=e;return T.createElement(Xe.Provider,{value:dn},T.createElement(at.Provider,{value:io},t))}const ao={position:"fixed",touchAction:"none"},lo=e=>it(e)?"transform 250ms ease":void 0,co=l.forwardRef((e,t)=>{let{as:n,activatorEvent:r,adjustScale:o,children:i,className:s,rect:a,style:c,transform:u,transition:d=lo}=e;if(!a)return null;const f=o?u:{...u,scaleX:1,scaleY:1},v={...ao,width:a.width,height:a.height,top:a.top,left:a.left,transform:fe.Transform.toString(f),transformOrigin:o&&r?Zn(r,a):void 0,transition:typeof d=="function"?d(r):d,...c};return T.createElement(n,{className:s,style:v,ref:t},i)}),uo=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)}},fo=e=>{let{transform:{initial:t,final:n}}=e;return[{transform:fe.Transform.toString(t)},{transform:fe.Transform.toString(n)}]},go={duration:250,easing:"ease",keyframes:fo,sideEffects:uo({styles:{active:{opacity:"0"}}})};function ho(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:o}=e;return ot((i,s)=>{if(t===null)return;const a=n.get(i);if(!a)return;const c=a.node.current;if(!c)return;const u=un(s);if(!u)return;const{transform:d}=B(s).getComputedStyle(s),f=Qt(d);if(!f)return;const v=typeof t=="function"?t:vo(t);return sn(c,o.draggable.measure),v({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:f})})}function vo(e){const{duration:t,easing:n,sideEffects:r,keyframes:o}={...go,...e};return i=>{let{active:s,dragOverlay:a,transform:c,...u}=i;if(!t)return;const d={x:a.rect.left-s.rect.left,y:a.rect.top-s.rect.top},f={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},v={x:c.x-d.x,y:c.y-d.y,...f},g=o({...u,active:s,dragOverlay:a,transform:{initial:c,final:v}}),[b]=g,h=g[g.length-1];if(JSON.stringify(b)===JSON.stringify(h))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(x=>{m.onfinish=()=>{p==null||p(),x()}})}}let Ht=0;function po(e){return l.useMemo(()=>{if(e!=null)return Ht++,Ht},[e])}const bo=T.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:d,active:f,activeNodeRect:v,containerNodeRect:g,draggableNodes:b,droppableContainers:h,dragOverlay:p,over:m,measuringConfiguration:x,scrollableAncestors:y,scrollableAncestorRects:D,windowRect:w}=hn(),R=l.useContext(at),C=po(f==null?void 0:f.id),S=gn(s,{activatorEvent:d,active:f,activeNodeRect:v,containerNodeRect:g,draggingNodeRect:p.rect,over:m,overlayNodeRect:p.rect,scrollableAncestors:y,scrollableAncestorRects:D,transform:R,windowRect:w}),E=St(v),O=ho({config:r,draggableNodes:b,droppableContainers:h,measuringConfiguration:x}),N=E?p.setRef:void 0;return T.createElement(so,null,T.createElement(oo,{animation:O},f&&C?T.createElement(co,{key:C,id:f.id,ref:N,as:a,activatorEvent:d,adjustScale:t,className:c,transition:i,rect:E,style:{zIndex:u,...o},transform:S},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 mo(e,t){return e.reduce((n,r,o)=>{const i=t.get(r);return i&&(n[o]=i),n},Array(e.length))}function qe(e){return e!==null&&e>=0}function yo(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 xo(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const vn=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}},Ge={scaleX:1,scaleY:1},wo=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:o,rects:i,overIndex:s}=e;const a=(t=i[n])!=null?t:r;if(!a)return null;if(o===n){const u=i[s];return u?{x:0,y:n<s?u.top+u.height-(a.top+a.height):u.top-a.top,...Ge}:null}const c=Co(i,o,n);return o>n&&o<=s?{x:0,y:-a.height-c,...Ge}:o<n&&o>=s?{x:0,y:a.height+c,...Ge}:{x:0,y:0,...Ge}};function Co(e,t,n){const r=e[t],o=e[t-1],i=e[t+1];return r?n<t?o?r.top-(o.top+o.height):i?i.top-(r.top+r.height):0:i?i.top-(r.top+r.height):o?r.top-(o.top+o.height):0:0}const pn="Sortable",bn=T.createContext({activeIndex:-1,containerId:pn,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:vn,disabled:{draggable:!1,droppable:!1}});function Do(e){let{children:t,id:n,items:r,strategy:o=vn,disabled:i=!1}=e;const{active:s,dragOverlay:a,droppableRects:c,over:u,measureDroppableContainers:d}=hn(),f=$e(pn,n),v=a.rect!==null,g=l.useMemo(()=>r.map(R=>typeof R=="object"&&"id"in R?R.id:R),[r]),b=s!=null,h=s?g.indexOf(s.id):-1,p=u?g.indexOf(u.id):-1,m=l.useRef(g),x=!yo(g,m.current),y=p!==-1&&h===-1||x,D=xo(i);q(()=>{x&&b&&d(g)},[x,g,b,d]),l.useEffect(()=>{m.current=g},[g]);const w=l.useMemo(()=>({activeIndex:h,containerId:f,disabled:D,disableTransforms:y,items:g,overIndex:p,useDragOverlay:v,sortedRects:mo(g,c),strategy:o}),[h,f,D.draggable,D.droppable,y,g,p,c,v,o]);return T.createElement(bn.Provider,{value:w},t)}const So=e=>{let{id:t,items:n,activeIndex:r,overIndex:o}=e;return Rt(n,r,o).indexOf(t)},Ro=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},Eo={duration:200,easing:"ease"},mn="transform",No=fe.Transition.toString({property:mn,duration:0,easing:"linear"}),Io={roleDescription:"sortable"};function Ao(e){let{disabled:t,index:n,node:r,rect:o}=e;const[i,s]=l.useState(null),a=l.useRef(n);return q(()=>{if(!t&&n!==a.current&&r.current){const c=o.current;if(c){const u=De(r.current,{ignoreTransform:!0}),d={x:c.left-u.left,y:c.top-u.top,scaleX:c.width/u.width,scaleY:c.height/u.height};(d.x||d.y)&&s(d)}}n!==a.current&&(a.current=n)},[t,n,r,o]),l.useEffect(()=>{i&&s(null)},[i]),i}function yn(e){let{animateLayoutChanges:t=Ro,attributes:n,disabled:r,data:o,getNewIndex:i=So,id:s,strategy:a,resizeObserverConfig:c,transition:u=Eo}=e;const{items:d,containerId:f,activeIndex:v,disabled:g,disableTransforms:b,sortedRects:h,overIndex:p,useDragOverlay:m,strategy:x}=l.useContext(bn),y=Oo(r,g),D=d.indexOf(s),w=l.useMemo(()=>({sortable:{containerId:f,index:D,items:d},...o}),[f,o,D,d]),R=l.useMemo(()=>d.slice(d.indexOf(s)),[d,s]),{rect:C,node:S,isOver:E,setNodeRef:O}=ro({id:s,data:w,disabled:y.droppable,resizeObserverConfig:{updateMeasurementsFor:R,...c}}),{active:N,activatorEvent:j,activeNodeRect:V,attributes:J,setNodeRef:Se,listeners:Ye,isDragging:$,over:Ke,setActivatorNodeRef:ee,transform:Re}=eo({id:s,data:w,attributes:{...Io,...n},disabled:y.draggable}),Ue=Pn(O,Se),F=!!N,te=F&&!b&&qe(v)&&qe(p),ge=!m&&$,Ee=ge&&te?Re:null,We=te?Ee??(a??x)({rects:h,activeNodeRect:V,activeIndex:v,overIndex:p,index:D}):null,ie=qe(v)&&qe(p)?i({id:s,items:d,activeIndex:v,overIndex:p}):D,ne=N==null?void 0:N.id,A=l.useRef({activeId:ne,items:d,newIndex:ie,containerId:f}),Ne=d!==A.current.items,_=t({active:N,containerId:f,isDragging:$,isSorting:F,id:s,index:D,items:d,newIndex:A.current.newIndex,previousItems:A.current.items,previousContainerId:A.current.containerId,transition:u,wasDragging:A.current.activeId!=null}),he=Ao({disabled:!_,index:D,node:S,rect:C});return l.useEffect(()=>{F&&A.current.newIndex!==ie&&(A.current.newIndex=ie),f!==A.current.containerId&&(A.current.containerId=f),d!==A.current.items&&(A.current.items=d)},[F,ie,f,d]),l.useEffect(()=>{if(ne===A.current.activeId)return;if(ne!=null&&A.current.activeId==null){A.current.activeId=ne;return}const ve=setTimeout(()=>{A.current.activeId=ne},50);return()=>clearTimeout(ve)},[ne]),{active:N,activeIndex:v,attributes:J,data:w,rect:C,index:D,newIndex:ie,items:d,isOver:E,isSorting:F,isDragging:$,listeners:Ye,node:S,overIndex:p,over:Ke,setNodeRef:Ue,setActivatorNodeRef:ee,setDroppableNodeRef:O,setDraggableNodeRef:Se,transform:he??We,transition:re()};function re(){if(he||Ne&&A.current.newIndex===D)return No;if(!(ge&&!it(j)||!u)&&(F||_))return fe.Transition.toString({...u,property:mn})}}function Oo(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}}I.Down,I.Right,I.Up,I.Left;const xn=(...e)=>e.filter(Boolean).join(" ");function wn({card:e}){const{attributes:t,listeners:n,setNodeRef:r,transform:o,transition:i,isDragging:s}=yn({id:e.id}),a={transform:fe.Transform.toString(o),transition:i,opacity:s?.5:void 0};return M.jsx("div",{ref:r,style:a,...t,...n,children:M.jsxs(Mn,{className:"mb-2 cursor-grab active:cursor-grabbing border-border bg-card/60 hover:border-primary/40 hover:shadow-lg hover:shadow-primary/10 transition-all duration-300 group",children:[M.jsxs(Tn,{className:"p-4",children:[M.jsx(Ln,{className:"text-sm font-medium font-mono tracking-tight text-foreground group-hover:text-primary transition-colors",children:e.title}),e.description&&M.jsx(kn,{className:"text-xs text-muted-foreground font-mono",children:e.description})]}),e.badges&&e.badges.length>0&&M.jsx(jn,{className:"p-4 pt-0",children:M.jsx("div",{className:"flex flex-wrap gap-1",children:e.badges.map((c,u)=>M.jsx(Vt,{variant:c.variant||"default",className:"text-xs",children:c.label},u))})})]})})}function Mo({column:e,cards:t}){const n=t||[],{setNodeRef:r}=yn({id:e.id,data:{type:"column"}}),o=e.limit&&n.length>=e.limit;return M.jsxs("div",{ref:r,className:xn("flex flex-col w-80 flex-shrink-0 rounded-lg border border-border bg-card/20 backdrop-blur-sm shadow-xl",e.className),children:[M.jsx("div",{className:"p-4 border-b border-border/50 bg-muted/20",children:M.jsxs("div",{className:"flex items-center justify-between",children:[M.jsx("h3",{className:"font-mono text-sm font-semibold tracking-wider text-primary/90 uppercase",children:e.title}),M.jsxs("div",{className:"flex items-center gap-2",children:[M.jsxs("span",{className:"font-mono text-xs text-muted-foreground",children:[n.length,e.limit&&` / ${e.limit}`]}),o&&M.jsx(Vt,{variant:"destructive",className:"text-xs",children:"Full"})]})]})}),M.jsx(On,{className:"flex-1 p-4",children:M.jsx(Do,{items:n.map(i=>i.id),strategy:wo,children:M.jsx("div",{className:"space-y-2",children:n.map(i=>M.jsx(wn,{card:i},i.id))})})})]})}function Lo({columns:e,onCardMove:t,className:n}){const[r,o]=l.useState(null),i=l.useMemo(()=>(e||[]).map(b=>({...b,cards:b.cards||[]})),[e]),[s,a]=l.useState(i);l.useEffect(()=>{a(i)},[i]);const c=_n(Jn(Dt,{activationConstraint:{distance:8}})),u=b=>{const{active:h}=b,p=f(h.id);o(p)},d=b=>{const{active:h,over:p}=b;if(o(null),!p)return;const m=h.id,x=p.id;if(m===x)return;const y=v(m),D=v(x)||g(x);if(!(!y||!D))if(y.id===D.id){const w=[...y.cards],R=w.findIndex(E=>E.id===m),C=w.findIndex(E=>E.id===x),S=Rt(w,R,C);a(E=>E.map(O=>O.id===y.id?{...O,cards:S}:O))}else{const w=[...y.cards],R=[...D.cards],C=w.findIndex(N=>N.id===m),E=x===D.id?R.length:R.findIndex(N=>N.id===x),[O]=w.splice(C,1);R.splice(E,0,O),a(N=>N.map(j=>j.id===y.id?{...j,cards:w}:j.id===D.id?{...j,cards:R}:j)),t&&t(m,y.id,D.id,E)}},f=l.useCallback(b=>{for(const h of s){const p=h.cards.find(m=>m.id===b);if(p)return p}return null},[s]),v=l.useCallback(b=>s.find(h=>h.cards.some(p=>p.id===b))||null,[s]),g=l.useCallback(b=>s.find(h=>h.id===b)||null,[s]);return M.jsxs(_r,{sensors:c,collisionDetection:rr,onDragStart:u,onDragEnd:d,children:[M.jsx("div",{className:xn("flex gap-4 overflow-x-auto p-4",n),children:s.map(b=>M.jsx(Mo,{column:b,cards:b.cards},b.id))}),M.jsx(bo,{children:r?M.jsx(wn,{card:r}):null})]})}export{Lo as default};