@object-ui/plugin-kanban 0.5.0 → 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.
- package/.turbo/turbo-build.log +7 -7
- package/CHANGELOG.md +14 -0
- package/dist/{KanbanEnhanced-BqDEu7Z6.js → KanbanEnhanced-BMreTWOT.js} +1 -1
- package/dist/{KanbanImpl-B8nu2BvG.js → KanbanImpl--kTNN_B8.js} +1 -1
- package/dist/{index-CrR06na7.js → index-a4_RI-v7.js} +221 -204
- package/dist/index.js +1 -1
- package/dist/index.umd.cjs +4 -4
- package/dist/src/index.d.ts.map +1 -1
- package/package.json +7 -7
- package/src/index.test.ts +8 -8
- package/src/index.tsx +27 -4
package/dist/index.js
CHANGED
package/dist/index.umd.cjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
(function(G,c){typeof exports=="object"&&typeof module<"u"?c(exports,require("react"),require("@object-ui/core"),require("@object-ui/react"),require("@object-ui/components"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","@object-ui/core","@object-ui/react","@object-ui/components","react-dom"],c):(G=typeof globalThis<"u"?globalThis:G||self,c(G.ObjectUIPluginKanban={},G.React,G.ObjectUICore,G.ObjectUIReact,G.ObjectUIComponents,G.ReactDOM))})(this,(function(G,c,
|
|
1
|
+
(function(G,c){typeof exports=="object"&&typeof module<"u"?c(exports,require("react"),require("@object-ui/core"),require("@object-ui/react"),require("@object-ui/components"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","@object-ui/core","@object-ui/react","@object-ui/components","react-dom"],c):(G=typeof globalThis<"u"?globalThis:G||self,c(G.ObjectUIPluginKanban={},G.React,G.ObjectUICore,G.ObjectUIReact,G.ObjectUIComponents,G.ReactDOM))})(this,(function(G,c,Ge,Bt,B,Se){"use strict";function tr(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const F=tr(c);var Ze={exports:{}},Re={};var $t;function nr(){if($t)return Re;$t=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function t(r,s,o){var i=null;if(o!==void 0&&(i=""+o),s.key!==void 0&&(i=""+s.key),"key"in s){o={};for(var a in s)a!=="key"&&(o[a]=s[a])}else o=s;return s=o.ref,{$$typeof:e,type:r,key:i,ref:s!==void 0?s:null,props:o}}return Re.Fragment=n,Re.jsx=t,Re.jsxs=t,Re}var ze={};var Wt;function rr(){return Wt||(Wt=1,process.env.NODE_ENV!=="production"&&(function(){function e(h){if(h==null)return null;if(typeof h=="function")return h.$$typeof===M?null:h.displayName||h.name||null;if(typeof h=="string")return h;switch(h){case x:return"Fragment";case v:return"Profiler";case y:return"StrictMode";case T:return"Suspense";case O:return"SuspenseList";case I:return"Activity"}if(typeof h=="object")switch(typeof h.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),h.$$typeof){case b:return"Portal";case S:return h.displayName||"Context";case m:return(h._context.displayName||"Context")+".Consumer";case E:var D=h.render;return h=h.displayName,h||(h=D.displayName||D.name||"",h=h!==""?"ForwardRef("+h+")":"ForwardRef"),h;case N:return D=h.displayName||null,D!==null?D:e(h.type)||"Memo";case A:D=h._payload,h=h._init;try{return e(h(D))}catch{}}return null}function n(h){return""+h}function t(h){try{n(h);var D=!1}catch{D=!0}if(D){D=console;var j=D.error,R=typeof Symbol=="function"&&Symbol.toStringTag&&h[Symbol.toStringTag]||h.constructor.name||"Object";return j.call(D,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",R),n(h)}}function r(h){if(h===x)return"<>";if(typeof h=="object"&&h!==null&&h.$$typeof===A)return"<...>";try{var D=e(h);return D?"<"+D+">":"<...>"}catch{return"<...>"}}function s(){var h=z.A;return h===null?null:h.getOwner()}function o(){return Error("react-stack-top-frame")}function i(h){if(P.call(h,"key")){var D=Object.getOwnPropertyDescriptor(h,"key").get;if(D&&D.isReactWarning)return!1}return h.key!==void 0}function a(h,D){function j(){Z||(Z=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",D))}j.isReactWarning=!0,Object.defineProperty(h,"key",{get:j,configurable:!0})}function l(){var h=e(this.type);return K[h]||(K[h]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),h=this.props.ref,h!==void 0?h:null}function u(h,D,j,R,le,U){var L=j.ref;return h={$$typeof:C,type:h,key:D,props:j,_owner:R},(L!==void 0?L:null)!==null?Object.defineProperty(h,"ref",{enumerable:!1,get:l}):Object.defineProperty(h,"ref",{enumerable:!1,value:null}),h._store={},Object.defineProperty(h._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(h,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(h,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:le}),Object.defineProperty(h,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:U}),Object.freeze&&(Object.freeze(h.props),Object.freeze(h)),h}function d(h,D,j,R,le,U){var L=D.children;if(L!==void 0)if(R)if(V(L)){for(R=0;R<L.length;R++)f(L[R]);Object.freeze&&Object.freeze(L)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else f(L);if(P.call(D,"key")){L=e(h);var J=Object.keys(D).filter(function(_){return _!=="key"});R=0<J.length?"{key: someKey, "+J.join(": ..., ")+": ...}":"{key: someKey}",me[L+R]||(J=0<J.length?"{"+J.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
2
2
|
let props = %s;
|
|
3
3
|
<%s {...props} />
|
|
4
4
|
React keys must be passed directly to JSX without using spread:
|
|
5
5
|
let props = %s;
|
|
6
|
-
<%s key={someKey} {...props} />`,R,L,J,L),me[L+R]=!0)}if(L=null,j!==void 0&&(t(j),L=""+j),i(D)&&(t(D.key),L=""+D.key),"key"in D){j={};for(var Q in D)Q!=="key"&&(j[Q]=D[Q])}else j=D;return L&&a(j,typeof h=="function"?h.displayName||h.name||"Unknown":h),u(h,L,j,s(),le,U)}function f(h){g(h)?h._store&&(h._store.validated=1):typeof h=="object"&&h!==null&&h.$$typeof===A&&(h._payload.status==="fulfilled"?g(h._payload.value)&&h._payload.value._store&&(h._payload.value._store.validated=1):h._store&&(h._store.validated=1))}function g(h){return typeof h=="object"&&h!==null&&h.$$typeof===C}var p=c,C=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),x=Symbol.for("react.fragment"),y=Symbol.for("react.strict_mode"),v=Symbol.for("react.profiler"),m=Symbol.for("react.consumer"),S=Symbol.for("react.context"),E=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),O=Symbol.for("react.suspense_list"),N=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),I=Symbol.for("react.activity"),M=Symbol.for("react.client.reference"),z=p.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=Object.prototype.hasOwnProperty,V=Array.isArray,H=console.createTask?console.createTask:function(){return null};p={react_stack_bottom_frame:function(h){return h()}};var Z,K={},Ce=p.react_stack_bottom_frame.bind(p,o)(),se=H(r(o)),me={};ze.Fragment=x,ze.jsx=function(h,D,j){var R=1e4>z.recentlyCreatedOwnerStacks++;return d(h,D,j,!1,R?Error("react-stack-top-frame"):Ce,R?H(r(h)):se)},ze.jsxs=function(h,D,j){var R=1e4>z.recentlyCreatedOwnerStacks++;return d(h,D,j,!0,R?Error("react-stack-top-frame"):Ce,R?H(r(h)):se)}})()),ze}var Wt;function sr(){return Wt||(Wt=1,process.env.NODE_ENV==="production"?Ge.exports=nr():Ge.exports=rr()),Ge.exports}var w=sr();const yt=({schema:e,dataSource:n,className:t,...r})=>{const[s,o]=c.useState([]),[i,a]=c.useState(null),[l,u]=c.useState(!1),[d,f]=c.useState(null),g=Ft.useDataScope(e.bind);c.useEffect(()=>{let y=!0;return(async()=>{if(!(!n||!e.objectName))try{const m=await n.getObjectSchema(e.objectName);y&&a(m)}catch(m){console.warn("Failed to fetch object def",m)}})(),()=>{y=!1}},[e.objectName,n]),c.useEffect(()=>{let y=!0;const v=async()=>{if(!(!n||!e.objectName)){y&&u(!0);try{const m=await n.find(e.objectName,{options:{$top:100},$filter:e.filter});let S=[];Array.isArray(m)?S=m:m&&typeof m=="object"&&(Array.isArray(m.value)?S=m.value:Array.isArray(m.data)&&(S=m.data)),console.log(`[ObjectKanban] Extracted data (length: ${S.length})`),y&&o(S)}catch(m){console.error("[ObjectKanban] Fetch error:",m),y&&f(m)}finally{y&&u(!1)}}};return e.objectName&&!g&&!e.data&&!r.data&&v(),()=>{y=!1}},[e.objectName,n,g,e.data,e.filter,r.data]);const p=r.data||g||e.data||s,C=c.useMemo(()=>{if(!Array.isArray(p))return[];let y=e.cardTitle||e.titleField;if(!y&&i){if(i.titleFormat){const m=/\{(.+?)\}/.exec(i.titleFormat);m&&(y=m[1])}!y&&i.NAME_FIELD_KEY&&(y=i.NAME_FIELD_KEY)}const v=y||"name";return p.map(m=>({...m,id:m.id||m._id,title:m[v]||m.title||"Untitled"}))},[p,e,i]),b=c.useMemo(()=>{if(e.columns&&e.columns.length>0)if(typeof e.columns[0]=="string"){if(!e.groupBy)return e.columns.map(y=>({id:y,title:y}))}else return e.columns;if(e.groupBy&&i?.fields?.[e.groupBy]?.options)return i.fields[e.groupBy].options.map(y=>({id:y.value,title:y.label}));if(e.groupBy&&C.length>0){const y=new Set(C.map(v=>v[e.groupBy]));return Array.from(y).map(v=>({id:String(v),title:String(v)}))}return[]},[e.columns,e.groupBy,C,i]),x={...e,data:C,columns:b,className:t||e.className};return d?w.jsxs("div",{className:"p-4 border border-destructive/50 rounded bg-destructive/10 text-destructive",children:["Error loading kanban data: ",d.message]}):w.jsx(Ze,{schema:x})},or=c.lazy(()=>Promise.resolve().then(()=>Xs)),Vt=c.lazy(()=>Promise.resolve().then(()=>bo)),Ze=({schema:e})=>{const n=c.useMemo(()=>{const{columns:t=[],data:r,groupBy:s}=e;if(r&&s&&Array.isArray(r)){const o=r.reduce((i,a)=>{const l=a[s];return i[l]||(i[l]=[]),i[l].push(a),i},{});return t.map(i=>({...i,cards:[...i.cards||[],...o[i.id]||[]]}))}return t},[e]);return w.jsx(c.Suspense,{fallback:w.jsx(B.Skeleton,{className:"w-full h-[600px]"}),children:w.jsx(or,{columns:n,onCardMove:e.onCardMove,className:e.className})})};bt.ComponentRegistry.register("kanban",Ze,{namespace:"plugin-kanban",label:"Kanban Board",icon:"LayoutDashboard",category:"plugin",inputs:[{name:"columns",type:"array",label:"Columns",description:"Array of { id, title, cards, limit, className }",required:!0},{name:"onCardMove",type:"code",label:"On Card Move",description:"Callback when a card is moved",advanced:!0},{name:"className",type:"string",label:"CSS Class"}],defaultProps:{columns:[{id:"todo",title:"To Do",cards:[{id:"card-1",title:"Task 1",description:"This is the first task",badges:[{label:"High Priority",variant:"destructive"},{label:"Feature",variant:"default"}]},{id:"card-2",title:"Task 2",description:"This is the second task",badges:[{label:"Bug",variant:"destructive"}]}]},{id:"in-progress",title:"In Progress",limit:3,cards:[{id:"card-3",title:"Task 3",description:"Currently working on this",badges:[{label:"In Progress",variant:"default"}]}]},{id:"done",title:"Done",cards:[{id:"card-4",title:"Task 4",description:"This task is completed",badges:[{label:"Completed",variant:"outline"}]},{id:"card-5",title:"Task 5",description:"Another completed task",badges:[{label:"Completed",variant:"outline"}]}]}],className:"w-full"}});const ir={kanban:Ze,"kanban-enhanced":Vt,"object-kanban":yt};bt.ComponentRegistry.register("kanban-enhanced",({schema:e})=>{const n=c.useMemo(()=>{const{columns:t=[],data:r,groupBy:s}=e;if(r&&s&&Array.isArray(r)){const o=r.reduce((i,a)=>{const l=a[s];return i[l]||(i[l]=[]),i[l].push(a),i},{});return t.map(i=>({...i,cards:[...i.cards||[],...o[i.id]||[]]}))}return t},[e]);return w.jsx(c.Suspense,{fallback:w.jsx(B.Skeleton,{className:"w-full h-[600px]"}),children:w.jsx(Vt,{columns:n,onCardMove:e.onCardMove,onColumnToggle:e.onColumnToggle,enableVirtualScrolling:e.enableVirtualScrolling,virtualScrollThreshold:e.virtualScrollThreshold,className:e.className})})},{namespace:"plugin-kanban",label:"Kanban Board (Enhanced)",icon:"LayoutGrid",category:"plugin",inputs:[{name:"columns",type:"array",label:"Columns",required:!0},{name:"enableVirtualScrolling",type:"boolean",label:"Virtual Scrolling",defaultValue:!1},{name:"virtualScrollThreshold",type:"number",label:"Virtual Scroll Threshold",defaultValue:50},{name:"onCardMove",type:"code",label:"On Card Move",advanced:!0},{name:"onColumnToggle",type:"code",label:"On Column Toggle",advanced:!0},{name:"className",type:"string",label:"CSS Class"}],defaultProps:{columns:[],enableVirtualScrolling:!1,virtualScrollThreshold:50,className:"w-full"}});const Yt=({schema:e,...n})=>{const{dataSource:t}=Ft.useSchemaContext()||{};return w.jsx(yt,{schema:e,dataSource:t,...n})};bt.ComponentRegistry.register("object-kanban",Yt,{namespace:"plugin-kanban",label:"Object Kanban",category:"plugin",inputs:[{name:"objectName",type:"string",label:"Object Name",required:!0},{name:"columns",type:"array",label:"Columns"}]});function ar(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];return c.useMemo(()=>r=>{n.forEach(s=>s(r))},n)}const Qe=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ee(e){const n=Object.prototype.toString.call(e);return n==="[object Window]"||n==="[object global]"}function xt(e){return"nodeType"in e}function X(e){var n,t;return e?Ee(e)?e:xt(e)&&(n=(t=e.ownerDocument)==null?void 0:t.defaultView)!=null?n:window:window}function wt(e){const{Document:n}=X(e);return e instanceof n}function Le(e){return Ee(e)?!1:e instanceof X(e).HTMLElement}function Kt(e){return e instanceof X(e).SVGElement}function De(e){return e?Ee(e)?e.document:xt(e)?wt(e)?e:Le(e)||Kt(e)?e.ownerDocument:document:document:document}const ie=Qe?c.useLayoutEffect:c.useEffect;function et(e){const n=c.useRef(e);return ie(()=>{n.current=e}),c.useCallback(function(){for(var t=arguments.length,r=new Array(t),s=0;s<t;s++)r[s]=arguments[s];return n.current==null?void 0:n.current(...r)},[])}function lr(){const e=c.useRef(null),n=c.useCallback((r,s)=>{e.current=setInterval(r,s)},[]),t=c.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[n,t]}function Pe(e,n){n===void 0&&(n=[e]);const t=c.useRef(e);return ie(()=>{t.current!==e&&(t.current=e)},n),t}function Fe(e,n){const t=c.useRef();return c.useMemo(()=>{const r=e(t.current);return t.current=r,r},[...n])}function tt(e){const n=et(e),t=c.useRef(null),r=c.useCallback(s=>{s!==t.current&&n?.(s,t.current),t.current=s},[]);return[t,r]}function nt(e){const n=c.useRef();return c.useEffect(()=>{n.current=e},[e]),n.current}let Ct={};function Be(e,n){return c.useMemo(()=>{if(n)return n;const t=Ct[e]==null?0:Ct[e]+1;return Ct[e]=t,e+"-"+t},[e,n])}function Ut(e){return function(n){for(var t=arguments.length,r=new Array(t>1?t-1:0),s=1;s<t;s++)r[s-1]=arguments[s];return r.reduce((o,i)=>{const a=Object.entries(i);for(const[l,u]of a){const d=o[l];d!=null&&(o[l]=d+e*u)}return o},{...n})}}const Oe=Ut(1),rt=Ut(-1);function cr(e){return"clientX"in e&&"clientY"in e}function st(e){if(!e)return!1;const{KeyboardEvent:n}=X(e.target);return n&&e instanceof n}function ur(e){if(!e)return!1;const{TouchEvent:n}=X(e.target);return n&&e instanceof n}function ot(e){if(ur(e)){if(e.touches&&e.touches.length){const{clientX:n,clientY:t}=e.touches[0];return{x:n,y:t}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:n,clientY:t}=e.changedTouches[0];return{x:n,y:t}}}return cr(e)?{x:e.clientX,y:e.clientY}:null}const fe=Object.freeze({Translate:{toString(e){if(!e)return;const{x:n,y:t}=e;return"translate3d("+(n?Math.round(n):0)+"px, "+(t?Math.round(t):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:n,scaleY:t}=e;return"scaleX("+n+") scaleY("+t+")"}},Transform:{toString(e){if(e)return[fe.Translate.toString(e),fe.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:n,duration:t,easing:r}=e;return n+" "+t+"ms "+r}}}),qt="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function dr(e){return e.matches(qt)?e:e.querySelector(qt)}const fr={display:"none"};function hr(e){let{id:n,value:t}=e;return c.createElement("div",{id:n,style:fr},t)}function gr(e){let{id:n,announcement:t,ariaLiveType:r="assertive"}=e;const s={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 c.createElement("div",{id:n,style:s,role:"status","aria-live":r,"aria-atomic":!0},t)}function pr(){const[e,n]=c.useState("");return{announce:c.useCallback(r=>{r!=null&&n(r)},[]),announcement:e}}const Xt=c.createContext(null);function mr(e){const n=c.useContext(Xt);c.useEffect(()=>{if(!n)throw new Error("useDndMonitor must be used within a children of <DndContext>");return n(e)},[e,n])}function vr(){const[e]=c.useState(()=>new Set),n=c.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[c.useCallback(r=>{let{type:s,event:o}=r;e.forEach(i=>{var a;return(a=i[s])==null?void 0:a.call(i,o)})},[e]),n]}const br={draggable:`
|
|
6
|
+
<%s key={someKey} {...props} />`,R,L,J,L),me[L+R]=!0)}if(L=null,j!==void 0&&(t(j),L=""+j),i(D)&&(t(D.key),L=""+D.key),"key"in D){j={};for(var Q in D)Q!=="key"&&(j[Q]=D[Q])}else j=D;return L&&a(j,typeof h=="function"?h.displayName||h.name||"Unknown":h),u(h,L,j,s(),le,U)}function f(h){g(h)?h._store&&(h._store.validated=1):typeof h=="object"&&h!==null&&h.$$typeof===A&&(h._payload.status==="fulfilled"?g(h._payload.value)&&h._payload.value._store&&(h._payload.value._store.validated=1):h._store&&(h._store.validated=1))}function g(h){return typeof h=="object"&&h!==null&&h.$$typeof===C}var p=c,C=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),x=Symbol.for("react.fragment"),y=Symbol.for("react.strict_mode"),v=Symbol.for("react.profiler"),m=Symbol.for("react.consumer"),S=Symbol.for("react.context"),E=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),O=Symbol.for("react.suspense_list"),N=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),I=Symbol.for("react.activity"),M=Symbol.for("react.client.reference"),z=p.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=Object.prototype.hasOwnProperty,V=Array.isArray,H=console.createTask?console.createTask:function(){return null};p={react_stack_bottom_frame:function(h){return h()}};var Z,K={},Ce=p.react_stack_bottom_frame.bind(p,o)(),se=H(r(o)),me={};ze.Fragment=x,ze.jsx=function(h,D,j){var R=1e4>z.recentlyCreatedOwnerStacks++;return d(h,D,j,!1,R?Error("react-stack-top-frame"):Ce,R?H(r(h)):se)},ze.jsxs=function(h,D,j){var R=1e4>z.recentlyCreatedOwnerStacks++;return d(h,D,j,!0,R?Error("react-stack-top-frame"):Ce,R?H(r(h)):se)}})()),ze}var Vt;function sr(){return Vt||(Vt=1,process.env.NODE_ENV==="production"?Ze.exports=nr():Ze.exports=rr()),Ze.exports}var w=sr();const yt=({schema:e,dataSource:n,className:t,...r})=>{const[s,o]=c.useState([]),[i,a]=c.useState(null),[l,u]=c.useState(!1),[d,f]=c.useState(null),g=Bt.useDataScope(e.bind);c.useEffect(()=>{let y=!0;return(async()=>{if(!(!n||!e.objectName))try{const m=await n.getObjectSchema(e.objectName);y&&a(m)}catch(m){console.warn("Failed to fetch object def",m)}})(),()=>{y=!1}},[e.objectName,n]),c.useEffect(()=>{let y=!0;const v=async()=>{if(!(!n||!e.objectName)){y&&u(!0);try{const m=await n.find(e.objectName,{options:{$top:100},$filter:e.filter});let S=[];Array.isArray(m)?S=m:m&&typeof m=="object"&&(Array.isArray(m.value)?S=m.value:Array.isArray(m.data)&&(S=m.data)),console.log(`[ObjectKanban] Extracted data (length: ${S.length})`),y&&o(S)}catch(m){console.error("[ObjectKanban] Fetch error:",m),y&&f(m)}finally{y&&u(!1)}}};return e.objectName&&!g&&!e.data&&!r.data&&v(),()=>{y=!1}},[e.objectName,n,g,e.data,e.filter,r.data]);const p=r.data||g||e.data||s,C=c.useMemo(()=>{if(!Array.isArray(p))return[];let y=e.cardTitle||e.titleField;if(!y&&i){if(i.titleFormat){const m=/\{(.+?)\}/.exec(i.titleFormat);m&&(y=m[1])}!y&&i.NAME_FIELD_KEY&&(y=i.NAME_FIELD_KEY)}const v=y||"name";return p.map(m=>({...m,id:m.id||m._id,title:m[v]||m.title||"Untitled"}))},[p,e,i]),b=c.useMemo(()=>{if(e.columns&&e.columns.length>0)if(typeof e.columns[0]=="string"){if(!e.groupBy)return e.columns.map(y=>({id:y,title:y}))}else return e.columns;if(e.groupBy&&i?.fields?.[e.groupBy]?.options)return i.fields[e.groupBy].options.map(y=>({id:y.value,title:y.label}));if(e.groupBy&&C.length>0){const y=new Set(C.map(v=>v[e.groupBy]));return Array.from(y).map(v=>({id:String(v),title:String(v)}))}return[]},[e.columns,e.groupBy,C,i]),x={...e,data:C,columns:b,className:t||e.className};return d?w.jsxs("div",{className:"p-4 border border-destructive/50 rounded bg-destructive/10 text-destructive",children:["Error loading kanban data: ",d.message]}):w.jsx(Qe,{schema:x})},or=c.lazy(()=>Promise.resolve().then(()=>Xs)),Yt=c.lazy(()=>Promise.resolve().then(()=>bo)),Qe=({schema:e})=>{const n=c.useMemo(()=>{const{columns:t=[],data:r,groupBy:s}=e;if(r&&s&&Array.isArray(r)){const o={};t.forEach(a=>{a.id&&(o[String(a.id).toLowerCase()]=a.id),a.title&&(o[String(a.title).toLowerCase()]=a.id)});const i=r.reduce((a,l)=>{const u=String(l[s]??""),d=o[u.toLowerCase()]??u;return a[d]||(a[d]=[]),a[d].push(l),a},{});return t.map(a=>({...a,cards:[...a.cards||[],...i[a.id]||[]]}))}return t},[e]);return w.jsx(c.Suspense,{fallback:w.jsx(B.Skeleton,{className:"w-full h-[600px]"}),children:w.jsx(or,{columns:n,onCardMove:e.onCardMove,className:e.className})})};Ge.ComponentRegistry.register("kanban-ui",Qe,{namespace:"plugin-kanban",label:"Kanban Board",icon:"LayoutDashboard",category:"plugin",inputs:[{name:"columns",type:"array",label:"Columns",description:"Array of { id, title, cards, limit, className }",required:!0},{name:"onCardMove",type:"code",label:"On Card Move",description:"Callback when a card is moved",advanced:!0},{name:"className",type:"string",label:"CSS Class"}],defaultProps:{columns:[{id:"todo",title:"To Do",cards:[{id:"card-1",title:"Task 1",description:"This is the first task",badges:[{label:"High Priority",variant:"destructive"},{label:"Feature",variant:"default"}]},{id:"card-2",title:"Task 2",description:"This is the second task",badges:[{label:"Bug",variant:"destructive"}]}]},{id:"in-progress",title:"In Progress",limit:3,cards:[{id:"card-3",title:"Task 3",description:"Currently working on this",badges:[{label:"In Progress",variant:"default"}]}]},{id:"done",title:"Done",cards:[{id:"card-4",title:"Task 4",description:"This task is completed",badges:[{label:"Completed",variant:"outline"}]},{id:"card-5",title:"Task 5",description:"Another completed task",badges:[{label:"Completed",variant:"outline"}]}]}],className:"w-full"}});const ir={kanban:Qe,"kanban-enhanced":Yt,"object-kanban":yt};Ge.ComponentRegistry.register("kanban-enhanced",({schema:e})=>{const n=c.useMemo(()=>{const{columns:t=[],data:r,groupBy:s}=e;if(r&&s&&Array.isArray(r)){const o=r.reduce((i,a)=>{const l=a[s];return i[l]||(i[l]=[]),i[l].push(a),i},{});return t.map(i=>({...i,cards:[...i.cards||[],...o[i.id]||[]]}))}return t},[e]);return w.jsx(c.Suspense,{fallback:w.jsx(B.Skeleton,{className:"w-full h-[600px]"}),children:w.jsx(Yt,{columns:n,onCardMove:e.onCardMove,onColumnToggle:e.onColumnToggle,enableVirtualScrolling:e.enableVirtualScrolling,virtualScrollThreshold:e.virtualScrollThreshold,className:e.className})})},{namespace:"plugin-kanban",label:"Kanban Board (Enhanced)",icon:"LayoutGrid",category:"plugin",inputs:[{name:"columns",type:"array",label:"Columns",required:!0},{name:"enableVirtualScrolling",type:"boolean",label:"Virtual Scrolling",defaultValue:!1},{name:"virtualScrollThreshold",type:"number",label:"Virtual Scroll Threshold",defaultValue:50},{name:"onCardMove",type:"code",label:"On Card Move",advanced:!0},{name:"onColumnToggle",type:"code",label:"On Column Toggle",advanced:!0},{name:"className",type:"string",label:"CSS Class"}],defaultProps:{columns:[],enableVirtualScrolling:!1,virtualScrollThreshold:50,className:"w-full"}});const xt=({schema:e,...n})=>{const{dataSource:t}=Bt.useSchemaContext()||{};return w.jsx(yt,{schema:e,dataSource:t,...n})};Ge.ComponentRegistry.register("object-kanban",xt,{namespace:"plugin-kanban",label:"Object Kanban",category:"view",inputs:[{name:"objectName",type:"string",label:"Object Name",required:!0},{name:"columns",type:"array",label:"Columns"}]}),Ge.ComponentRegistry.register("kanban",xt,{namespace:"view",label:"Kanban Board",category:"view",inputs:[{name:"objectName",type:"string",label:"Object Name",required:!0},{name:"columns",type:"array",label:"Columns"}]});function ar(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];return c.useMemo(()=>r=>{n.forEach(s=>s(r))},n)}const et=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ee(e){const n=Object.prototype.toString.call(e);return n==="[object Window]"||n==="[object global]"}function wt(e){return"nodeType"in e}function X(e){var n,t;return e?Ee(e)?e:wt(e)&&(n=(t=e.ownerDocument)==null?void 0:t.defaultView)!=null?n:window:window}function Ct(e){const{Document:n}=X(e);return e instanceof n}function Le(e){return Ee(e)?!1:e instanceof X(e).HTMLElement}function Kt(e){return e instanceof X(e).SVGElement}function De(e){return e?Ee(e)?e.document:wt(e)?Ct(e)?e:Le(e)||Kt(e)?e.ownerDocument:document:document:document}const ie=et?c.useLayoutEffect:c.useEffect;function tt(e){const n=c.useRef(e);return ie(()=>{n.current=e}),c.useCallback(function(){for(var t=arguments.length,r=new Array(t),s=0;s<t;s++)r[s]=arguments[s];return n.current==null?void 0:n.current(...r)},[])}function lr(){const e=c.useRef(null),n=c.useCallback((r,s)=>{e.current=setInterval(r,s)},[]),t=c.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[n,t]}function Pe(e,n){n===void 0&&(n=[e]);const t=c.useRef(e);return ie(()=>{t.current!==e&&(t.current=e)},n),t}function Fe(e,n){const t=c.useRef();return c.useMemo(()=>{const r=e(t.current);return t.current=r,r},[...n])}function nt(e){const n=tt(e),t=c.useRef(null),r=c.useCallback(s=>{s!==t.current&&n?.(s,t.current),t.current=s},[]);return[t,r]}function rt(e){const n=c.useRef();return c.useEffect(()=>{n.current=e},[e]),n.current}let St={};function Be(e,n){return c.useMemo(()=>{if(n)return n;const t=St[e]==null?0:St[e]+1;return St[e]=t,e+"-"+t},[e,n])}function Ut(e){return function(n){for(var t=arguments.length,r=new Array(t>1?t-1:0),s=1;s<t;s++)r[s-1]=arguments[s];return r.reduce((o,i)=>{const a=Object.entries(i);for(const[l,u]of a){const d=o[l];d!=null&&(o[l]=d+e*u)}return o},{...n})}}const Oe=Ut(1),st=Ut(-1);function cr(e){return"clientX"in e&&"clientY"in e}function ot(e){if(!e)return!1;const{KeyboardEvent:n}=X(e.target);return n&&e instanceof n}function ur(e){if(!e)return!1;const{TouchEvent:n}=X(e.target);return n&&e instanceof n}function it(e){if(ur(e)){if(e.touches&&e.touches.length){const{clientX:n,clientY:t}=e.touches[0];return{x:n,y:t}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:n,clientY:t}=e.changedTouches[0];return{x:n,y:t}}}return cr(e)?{x:e.clientX,y:e.clientY}:null}const fe=Object.freeze({Translate:{toString(e){if(!e)return;const{x:n,y:t}=e;return"translate3d("+(n?Math.round(n):0)+"px, "+(t?Math.round(t):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:n,scaleY:t}=e;return"scaleX("+n+") scaleY("+t+")"}},Transform:{toString(e){if(e)return[fe.Translate.toString(e),fe.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:n,duration:t,easing:r}=e;return n+" "+t+"ms "+r}}}),qt="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function dr(e){return e.matches(qt)?e:e.querySelector(qt)}const fr={display:"none"};function hr(e){let{id:n,value:t}=e;return c.createElement("div",{id:n,style:fr},t)}function gr(e){let{id:n,announcement:t,ariaLiveType:r="assertive"}=e;const s={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 c.createElement("div",{id:n,style:s,role:"status","aria-live":r,"aria-atomic":!0},t)}function pr(){const[e,n]=c.useState("");return{announce:c.useCallback(r=>{r!=null&&n(r)},[]),announcement:e}}const Xt=c.createContext(null);function mr(e){const n=c.useContext(Xt);c.useEffect(()=>{if(!n)throw new Error("useDndMonitor must be used within a children of <DndContext>");return n(e)},[e,n])}function vr(){const[e]=c.useState(()=>new Set),n=c.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[c.useCallback(r=>{let{type:s,event:o}=r;e.forEach(i=>{var a;return(a=i[s])==null?void 0:a.call(i,o)})},[e]),n]}const br={draggable:`
|
|
7
7
|
To pick up a draggable item, press the space bar.
|
|
8
8
|
While dragging, use the arrow keys to move the item.
|
|
9
9
|
Press space again to drop the item in its new position, or press escape to cancel.
|
|
10
|
-
`},yr={onDragStart(e){let{active:n}=e;return"Picked up draggable item "+n.id+"."},onDragOver(e){let{active:n,over:t}=e;return t?"Draggable item "+n.id+" was moved over droppable area "+t.id+".":"Draggable item "+n.id+" is no longer over a droppable area."},onDragEnd(e){let{active:n,over:t}=e;return t?"Draggable item "+n.id+" was dropped over droppable area "+t.id:"Draggable item "+n.id+" was dropped."},onDragCancel(e){let{active:n}=e;return"Dragging was cancelled. Draggable item "+n.id+" was dropped."}};function xr(e){let{announcements:n=yr,container:t,hiddenTextDescribedById:r,screenReaderInstructions:s=br}=e;const{announce:o,announcement:i}=pr(),a=Be("DndLiveRegion"),[l,u]=c.useState(!1);if(c.useEffect(()=>{u(!0)},[]),mr(c.useMemo(()=>({onDragStart(f){let{active:g}=f;o(n.onDragStart({active:g}))},onDragMove(f){let{active:g,over:p}=f;n.onDragMove&&o(n.onDragMove({active:g,over:p}))},onDragOver(f){let{active:g,over:p}=f;o(n.onDragOver({active:g,over:p}))},onDragEnd(f){let{active:g,over:p}=f;o(n.onDragEnd({active:g,over:p}))},onDragCancel(f){let{active:g,over:p}=f;o(n.onDragCancel({active:g,over:p}))}}),[o,n])),!l)return null;const d=c.createElement(c.Fragment,null,c.createElement(hr,{id:r,value:s.draggable}),c.createElement(gr,{id:a,announcement:i}));return t?Se.createPortal(d,t):d}var $;(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"})($||($={}));function it(){}function Ht(e,n){return c.useMemo(()=>({sensor:e,options:n??{}}),[e,n])}function Jt(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];return c.useMemo(()=>[...n].filter(r=>r!=null),[...n])}const ae=Object.freeze({x:0,y:0});function wr(e,n){return Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2))}function Cr(e,n){const t=ot(e);if(!t)return"0 0";const r={x:(t.x-n.left)/n.width*100,y:(t.y-n.top)/n.height*100};return r.x+"% "+r.y+"%"}function Sr(e,n){let{data:{value:t}}=e,{data:{value:r}}=n;return t-r}function Er(e,n){let{data:{value:t}}=e,{data:{value:r}}=n;return r-t}function Gt(e){let{left:n,top:t,height:r,width:s}=e;return[{x:n,y:t},{x:n+s,y:t},{x:n,y:t+r},{x:n+s,y:t+r}]}function Dr(e,n){if(!e||e.length===0)return null;const[t]=e;return t[n]}const Zt=e=>{let{collisionRect:n,droppableRects:t,droppableContainers:r}=e;const s=Gt(n),o=[];for(const i of r){const{id:a}=i,l=t.get(a);if(l){const u=Gt(l),d=s.reduce((g,p,C)=>g+wr(u[C],p),0),f=Number((d/4).toFixed(4));o.push({id:a,data:{droppableContainer:i,value:f}})}}return o.sort(Sr)};function Or(e,n){const t=Math.max(n.top,e.top),r=Math.max(n.left,e.left),s=Math.min(n.left+n.width,e.left+e.width),o=Math.min(n.top+n.height,e.top+e.height),i=s-r,a=o-t;if(r<s&&t<o){const l=n.width*n.height,u=e.width*e.height,d=i*a,f=d/(l+u-d);return Number(f.toFixed(4))}return 0}const Nr=e=>{let{collisionRect:n,droppableRects:t,droppableContainers:r}=e;const s=[];for(const o of r){const{id:i}=o,a=t.get(i);if(a){const l=Or(a,n);l>0&&s.push({id:i,data:{droppableContainer:o,value:l}})}}return s.sort(Er)};function Tr(e,n,t){return{...e,scaleX:n&&t?n.width/t.width:1,scaleY:n&&t?n.height/t.height:1}}function Qt(e,n){return e&&n?{x:e.left-n.left,y:e.top-n.top}:ae}function Ar(e){return function(t){for(var r=arguments.length,s=new Array(r>1?r-1:0),o=1;o<r;o++)s[o-1]=arguments[o];return s.reduce((i,a)=>({...i,top:i.top+e*a.y,bottom:i.bottom+e*a.y,left:i.left+e*a.x,right:i.right+e*a.x}),{...t})}}const Mr=Ar(1);function en(e){if(e.startsWith("matrix3d(")){const n=e.slice(9,-1).split(/, /);return{x:+n[12],y:+n[13],scaleX:+n[0],scaleY:+n[5]}}else if(e.startsWith("matrix(")){const n=e.slice(7,-1).split(/, /);return{x:+n[4],y:+n[5],scaleX:+n[0],scaleY:+n[3]}}return null}function Ir(e,n,t){const r=en(n);if(!r)return e;const{scaleX:s,scaleY:o,x:i,y:a}=r,l=e.left-i-(1-s)*parseFloat(t),u=e.top-a-(1-o)*parseFloat(t.slice(t.indexOf(" ")+1)),d=s?e.width/s:e.width,f=o?e.height/o:e.height;return{width:d,height:f,top:u,right:l+d,bottom:u+f,left:l}}const jr={ignoreTransform:!1};function Ne(e,n){n===void 0&&(n=jr);let t=e.getBoundingClientRect();if(n.ignoreTransform){const{transform:u,transformOrigin:d}=X(e).getComputedStyle(e);u&&(t=Ir(t,u,d))}const{top:r,left:s,width:o,height:i,bottom:a,right:l}=t;return{top:r,left:s,width:o,height:i,bottom:a,right:l}}function tn(e){return Ne(e,{ignoreTransform:!0})}function kr(e){const n=e.innerWidth,t=e.innerHeight;return{top:0,left:0,right:n,bottom:t,width:n,height:t}}function _r(e,n){return n===void 0&&(n=X(e).getComputedStyle(e)),n.position==="fixed"}function Rr(e,n){n===void 0&&(n=X(e).getComputedStyle(e));const t=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(s=>{const o=n[s];return typeof o=="string"?t.test(o):!1})}function St(e,n){const t=[];function r(s){if(n!=null&&t.length>=n||!s)return t;if(wt(s)&&s.scrollingElement!=null&&!t.includes(s.scrollingElement))return t.push(s.scrollingElement),t;if(!Le(s)||Kt(s)||t.includes(s))return t;const o=X(e).getComputedStyle(s);return s!==e&&Rr(s,o)&&t.push(s),_r(s,o)?t:r(s.parentNode)}return e?r(e):t}function nn(e){const[n]=St(e,1);return n??null}function Et(e){return!Qe||!e?null:Ee(e)?e:xt(e)?wt(e)||e===De(e).scrollingElement?window:Le(e)?e:null:null}function rn(e){return Ee(e)?e.scrollX:e.scrollLeft}function sn(e){return Ee(e)?e.scrollY:e.scrollTop}function Dt(e){return{x:rn(e),y:sn(e)}}var W;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(W||(W={}));function on(e){return!Qe||!e?!1:e===document.scrollingElement}function an(e){const n={x:0,y:0},t=on(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-t.width,y:e.scrollHeight-t.height},s=e.scrollTop<=n.y,o=e.scrollLeft<=n.x,i=e.scrollTop>=r.y,a=e.scrollLeft>=r.x;return{isTop:s,isLeft:o,isBottom:i,isRight:a,maxScroll:r,minScroll:n}}const zr={x:.2,y:.2};function Lr(e,n,t,r,s){let{top:o,left:i,right:a,bottom:l}=t;r===void 0&&(r=10),s===void 0&&(s=zr);const{isTop:u,isBottom:d,isLeft:f,isRight:g}=an(e),p={x:0,y:0},C={x:0,y:0},b={height:n.height*s.y,width:n.width*s.x};return!u&&o<=n.top+b.height?(p.y=W.Backward,C.y=r*Math.abs((n.top+b.height-o)/b.height)):!d&&l>=n.bottom-b.height&&(p.y=W.Forward,C.y=r*Math.abs((n.bottom-b.height-l)/b.height)),!g&&a>=n.right-b.width?(p.x=W.Forward,C.x=r*Math.abs((n.right-b.width-a)/b.width)):!f&&i<=n.left+b.width&&(p.x=W.Backward,C.x=r*Math.abs((n.left+b.width-i)/b.width)),{direction:p,speed:C}}function Pr(e){if(e===document.scrollingElement){const{innerWidth:o,innerHeight:i}=window;return{top:0,left:0,right:o,bottom:i,width:o,height:i}}const{top:n,left:t,right:r,bottom:s}=e.getBoundingClientRect();return{top:n,left:t,right:r,bottom:s,width:e.clientWidth,height:e.clientHeight}}function ln(e){return e.reduce((n,t)=>Oe(n,Dt(t)),ae)}function Fr(e){return e.reduce((n,t)=>n+rn(t),0)}function Br(e){return e.reduce((n,t)=>n+sn(t),0)}function cn(e,n){if(n===void 0&&(n=Ne),!e)return;const{top:t,left:r,bottom:s,right:o}=n(e);nn(e)&&(s<=0||o<=0||t>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const $r=[["x",["left","right"],Fr],["y",["top","bottom"],Br]];class Ot{constructor(n,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=St(t),s=ln(r);this.rect={...n},this.width=n.width,this.height=n.height;for(const[o,i,a]of $r)for(const l of i)Object.defineProperty(this,l,{get:()=>{const u=a(r),d=s[o]-u;return this.rect[l]+d},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class $e{constructor(n){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(t=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...t)})},this.target=n}add(n,t,r){var s;(s=this.target)==null||s.addEventListener(n,t,r),this.listeners.push([n,t,r])}}function Wr(e){const{EventTarget:n}=X(e);return e instanceof n?e:De(e)}function Nt(e,n){const t=Math.abs(e.x),r=Math.abs(e.y);return typeof n=="number"?Math.sqrt(t**2+r**2)>n:"x"in n&&"y"in n?t>n.x&&r>n.y:"x"in n?t>n.x:"y"in n?r>n.y:!1}var re;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(re||(re={}));function un(e){e.preventDefault()}function Vr(e){e.stopPropagation()}var k;(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"})(k||(k={}));const dn={start:[k.Space,k.Enter],cancel:[k.Esc],end:[k.Space,k.Enter,k.Tab]},Yr=(e,n)=>{let{currentCoordinates:t}=n;switch(e.code){case k.Right:return{...t,x:t.x+25};case k.Left:return{...t,x:t.x-25};case k.Down:return{...t,y:t.y+25};case k.Up:return{...t,y:t.y-25}}};class fn{constructor(n){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=n;const{event:{target:t}}=n;this.props=n,this.listeners=new $e(De(t)),this.windowListeners=new $e(X(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(re.Resize,this.handleCancel),this.windowListeners.add(re.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(re.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:n,onStart:t}=this.props,r=n.node.current;r&&cn(r),t(ae)}handleKeyDown(n){if(st(n)){const{active:t,context:r,options:s}=this.props,{keyboardCodes:o=dn,coordinateGetter:i=Yr,scrollBehavior:a="smooth"}=s,{code:l}=n;if(o.end.includes(l)){this.handleEnd(n);return}if(o.cancel.includes(l)){this.handleCancel(n);return}const{collisionRect:u}=r.current,d=u?{x:u.left,y:u.top}:ae;this.referenceCoordinates||(this.referenceCoordinates=d);const f=i(n,{active:t,context:r.current,currentCoordinates:d});if(f){const g=rt(f,d),p={x:0,y:0},{scrollableAncestors:C}=r.current;for(const b of C){const x=n.code,{isTop:y,isRight:v,isLeft:m,isBottom:S,maxScroll:E,minScroll:T}=an(b),O=Pr(b),N={x:Math.min(x===k.Right?O.right-O.width/2:O.right,Math.max(x===k.Right?O.left:O.left+O.width/2,f.x)),y:Math.min(x===k.Down?O.bottom-O.height/2:O.bottom,Math.max(x===k.Down?O.top:O.top+O.height/2,f.y))},A=x===k.Right&&!v||x===k.Left&&!m,I=x===k.Down&&!S||x===k.Up&&!y;if(A&&N.x!==f.x){const M=b.scrollLeft+g.x,z=x===k.Right&&M<=E.x||x===k.Left&&M>=T.x;if(z&&!g.y){b.scrollTo({left:M,behavior:a});return}z?p.x=b.scrollLeft-M:p.x=x===k.Right?b.scrollLeft-E.x:b.scrollLeft-T.x,p.x&&b.scrollBy({left:-p.x,behavior:a});break}else if(I&&N.y!==f.y){const M=b.scrollTop+g.y,z=x===k.Down&&M<=E.y||x===k.Up&&M>=T.y;if(z&&!g.x){b.scrollTo({top:M,behavior:a});return}z?p.y=b.scrollTop-M:p.y=x===k.Down?b.scrollTop-E.y:b.scrollTop-T.y,p.y&&b.scrollBy({top:-p.y,behavior:a});break}}this.handleMove(n,Oe(rt(f,this.referenceCoordinates),p))}}}handleMove(n,t){const{onMove:r}=this.props;n.preventDefault(),r(t)}handleEnd(n){const{onEnd:t}=this.props;n.preventDefault(),this.detach(),t()}handleCancel(n){const{onCancel:t}=this.props;n.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}fn.activators=[{eventName:"onKeyDown",handler:(e,n,t)=>{let{keyboardCodes:r=dn,onActivation:s}=n,{active:o}=t;const{code:i}=e.nativeEvent;if(r.start.includes(i)){const a=o.activatorNode.current;return a&&e.target!==a?!1:(e.preventDefault(),s?.({event:e.nativeEvent}),!0)}return!1}}];function hn(e){return!!(e&&"distance"in e)}function gn(e){return!!(e&&"delay"in e)}class Tt{constructor(n,t,r){var s;r===void 0&&(r=Wr(n.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=n,this.events=t;const{event:o}=n,{target:i}=o;this.props=n,this.events=t,this.document=De(i),this.documentListeners=new $e(this.document),this.listeners=new $e(r),this.windowListeners=new $e(X(i)),this.initialCoordinates=(s=ot(o))!=null?s:ae,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:n,props:{options:{activationConstraint:t,bypassActivationConstraint:r}}}=this;if(this.listeners.add(n.move.name,this.handleMove,{passive:!1}),this.listeners.add(n.end.name,this.handleEnd),n.cancel&&this.listeners.add(n.cancel.name,this.handleCancel),this.windowListeners.add(re.Resize,this.handleCancel),this.windowListeners.add(re.DragStart,un),this.windowListeners.add(re.VisibilityChange,this.handleCancel),this.windowListeners.add(re.ContextMenu,un),this.documentListeners.add(re.Keydown,this.handleKeydown),t){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(gn(t)){this.timeoutId=setTimeout(this.handleStart,t.delay),this.handlePending(t);return}if(hn(t)){this.handlePending(t);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(n,t){const{active:r,onPending:s}=this.props;s(r,n,this.initialCoordinates,t)}handleStart(){const{initialCoordinates:n}=this,{onStart:t}=this.props;n&&(this.activated=!0,this.documentListeners.add(re.Click,Vr,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(re.SelectionChange,this.removeTextSelection),t(n))}handleMove(n){var t;const{activated:r,initialCoordinates:s,props:o}=this,{onMove:i,options:{activationConstraint:a}}=o;if(!s)return;const l=(t=ot(n))!=null?t:ae,u=rt(s,l);if(!r&&a){if(hn(a)){if(a.tolerance!=null&&Nt(u,a.tolerance))return this.handleCancel();if(Nt(u,a.distance))return this.handleStart()}if(gn(a)&&Nt(u,a.tolerance))return this.handleCancel();this.handlePending(a,u);return}n.cancelable&&n.preventDefault(),i(l)}handleEnd(){const{onAbort:n,onEnd:t}=this.props;this.detach(),this.activated||n(this.props.active),t()}handleCancel(){const{onAbort:n,onCancel:t}=this.props;this.detach(),this.activated||n(this.props.active),t()}handleKeydown(n){n.code===k.Esc&&this.handleCancel()}removeTextSelection(){var n;(n=this.document.getSelection())==null||n.removeAllRanges()}}const Kr={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class at extends Tt{constructor(n){const{event:t}=n,r=De(t.target);super(n,Kr,r)}}at.activators=[{eventName:"onPointerDown",handler:(e,n)=>{let{nativeEvent:t}=e,{onActivation:r}=n;return!t.isPrimary||t.button!==0?!1:(r?.({event:t}),!0)}}];const Ur={move:{name:"mousemove"},end:{name:"mouseup"}};var At;(function(e){e[e.RightClick=2]="RightClick"})(At||(At={}));class qr extends Tt{constructor(n){super(n,Ur,De(n.event.target))}}qr.activators=[{eventName:"onMouseDown",handler:(e,n)=>{let{nativeEvent:t}=e,{onActivation:r}=n;return t.button===At.RightClick?!1:(r?.({event:t}),!0)}}];const Mt={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Xr extends Tt{constructor(n){super(n,Mt)}static setup(){return window.addEventListener(Mt.move.name,n,{capture:!1,passive:!1}),function(){window.removeEventListener(Mt.move.name,n)};function n(){}}}Xr.activators=[{eventName:"onTouchStart",handler:(e,n)=>{let{nativeEvent:t}=e,{onActivation:r}=n;const{touches:s}=t;return s.length>1?!1:(r?.({event:t}),!0)}}];var We;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(We||(We={}));var lt;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(lt||(lt={}));function Hr(e){let{acceleration:n,activator:t=We.Pointer,canScroll:r,draggingRect:s,enabled:o,interval:i=5,order:a=lt.TreeOrder,pointerCoordinates:l,scrollableAncestors:u,scrollableAncestorRects:d,delta:f,threshold:g}=e;const p=Gr({delta:f,disabled:!o}),[C,b]=lr(),x=c.useRef({x:0,y:0}),y=c.useRef({x:0,y:0}),v=c.useMemo(()=>{switch(t){case We.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case We.DraggableRect:return s}},[t,s,l]),m=c.useRef(null),S=c.useCallback(()=>{const T=m.current;if(!T)return;const O=x.current.x*y.current.x,N=x.current.y*y.current.y;T.scrollBy(O,N)},[]),E=c.useMemo(()=>a===lt.TreeOrder?[...u].reverse():u,[a,u]);c.useEffect(()=>{if(!o||!u.length||!v){b();return}for(const T of E){if(r?.(T)===!1)continue;const O=u.indexOf(T),N=d[O];if(!N)continue;const{direction:A,speed:I}=Lr(T,N,v,n,g);for(const M of["x","y"])p[M][A[M]]||(I[M]=0,A[M]=0);if(I.x>0||I.y>0){b(),m.current=T,C(S,i),x.current=I,y.current=A;return}}x.current={x:0,y:0},y.current={x:0,y:0},b()},[n,S,r,b,o,i,JSON.stringify(v),JSON.stringify(p),C,u,E,d,JSON.stringify(g)])}const Jr={x:{[W.Backward]:!1,[W.Forward]:!1},y:{[W.Backward]:!1,[W.Forward]:!1}};function Gr(e){let{delta:n,disabled:t}=e;const r=nt(n);return Fe(s=>{if(t||!r||!s)return Jr;const o={x:Math.sign(n.x-r.x),y:Math.sign(n.y-r.y)};return{x:{[W.Backward]:s.x[W.Backward]||o.x===-1,[W.Forward]:s.x[W.Forward]||o.x===1},y:{[W.Backward]:s.y[W.Backward]||o.y===-1,[W.Forward]:s.y[W.Forward]||o.y===1}}},[t,n,r])}function Zr(e,n){const t=n!=null?e.get(n):void 0,r=t?t.node.current:null;return Fe(s=>{var o;return n==null?null:(o=r??s)!=null?o:null},[r,n])}function Qr(e,n){return c.useMemo(()=>e.reduce((t,r)=>{const{sensor:s}=r,o=s.activators.map(i=>({eventName:i.eventName,handler:n(i.handler,r)}));return[...t,...o]},[]),[e,n])}var Ve;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Ve||(Ve={}));var It;(function(e){e.Optimized="optimized"})(It||(It={}));const pn=new Map;function es(e,n){let{dragging:t,dependencies:r,config:s}=n;const[o,i]=c.useState(null),{frequency:a,measure:l,strategy:u}=s,d=c.useRef(e),f=x(),g=Pe(f),p=c.useCallback(function(y){y===void 0&&(y=[]),!g.current&&i(v=>v===null?y:v.concat(y.filter(m=>!v.includes(m))))},[g]),C=c.useRef(null),b=Fe(y=>{if(f&&!t)return pn;if(!y||y===pn||d.current!==e||o!=null){const v=new Map;for(let m of e){if(!m)continue;if(o&&o.length>0&&!o.includes(m.id)&&m.rect.current){v.set(m.id,m.rect.current);continue}const S=m.node.current,E=S?new Ot(l(S),S):null;m.rect.current=E,E&&v.set(m.id,E)}return v}return y},[e,o,t,f,l]);return c.useEffect(()=>{d.current=e},[e]),c.useEffect(()=>{f||p()},[t,f]),c.useEffect(()=>{o&&o.length>0&&i(null)},[JSON.stringify(o)]),c.useEffect(()=>{f||typeof a!="number"||C.current!==null||(C.current=setTimeout(()=>{p(),C.current=null},a))},[a,f,p,...r]),{droppableRects:b,measureDroppableContainers:p,measuringScheduled:o!=null};function x(){switch(u){case Ve.Always:return!1;case Ve.BeforeDragging:return t;default:return!t}}}function jt(e,n){return Fe(t=>e?t||(typeof n=="function"?n(e):e):null,[n,e])}function ts(e,n){return jt(e,n)}function ns(e){let{callback:n,disabled:t}=e;const r=et(n),s=c.useMemo(()=>{if(t||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:o}=window;return new o(r)},[r,t]);return c.useEffect(()=>()=>s?.disconnect(),[s]),s}function ct(e){let{callback:n,disabled:t}=e;const r=et(n),s=c.useMemo(()=>{if(t||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:o}=window;return new o(r)},[t]);return c.useEffect(()=>()=>s?.disconnect(),[s]),s}function rs(e){return new Ot(Ne(e),e)}function mn(e,n,t){n===void 0&&(n=rs);const[r,s]=c.useState(null);function o(){s(l=>{if(!e)return null;if(e.isConnected===!1){var u;return(u=l??t)!=null?u:null}const d=n(e);return JSON.stringify(l)===JSON.stringify(d)?l:d})}const i=ns({callback(l){if(e)for(const u of l){const{type:d,target:f}=u;if(d==="childList"&&f instanceof HTMLElement&&f.contains(e)){o();break}}}}),a=ct({callback:o});return ie(()=>{o(),e?(a?.observe(e),i?.observe(document.body,{childList:!0,subtree:!0})):(a?.disconnect(),i?.disconnect())},[e]),r}function ss(e){const n=jt(e);return Qt(e,n)}const vn=[];function os(e){const n=c.useRef(e),t=Fe(r=>e?r&&r!==vn&&e&&n.current&&e.parentNode===n.current.parentNode?r:St(e):vn,[e]);return c.useEffect(()=>{n.current=e},[e]),t}function is(e){const[n,t]=c.useState(null),r=c.useRef(e),s=c.useCallback(o=>{const i=Et(o.target);i&&t(a=>a?(a.set(i,Dt(i)),new Map(a)):null)},[]);return c.useEffect(()=>{const o=r.current;if(e!==o){i(o);const a=e.map(l=>{const u=Et(l);return u?(u.addEventListener("scroll",s,{passive:!0}),[u,Dt(u)]):null}).filter(l=>l!=null);t(a.length?new Map(a):null),r.current=e}return()=>{i(e),i(o)};function i(a){a.forEach(l=>{const u=Et(l);u?.removeEventListener("scroll",s)})}},[s,e]),c.useMemo(()=>e.length?n?Array.from(n.values()).reduce((o,i)=>Oe(o,i),ae):ln(e):ae,[e,n])}function bn(e,n){n===void 0&&(n=[]);const t=c.useRef(null);return c.useEffect(()=>{t.current=null},n),c.useEffect(()=>{const r=e!==ae;r&&!t.current&&(t.current=e),!r&&t.current&&(t.current=null)},[e]),t.current?rt(e,t.current):ae}function as(e){c.useEffect(()=>{if(!Qe)return;const n=e.map(t=>{let{sensor:r}=t;return r.setup==null?void 0:r.setup()});return()=>{for(const t of n)t?.()}},e.map(n=>{let{sensor:t}=n;return t}))}function ls(e,n){return c.useMemo(()=>e.reduce((t,r)=>{let{eventName:s,handler:o}=r;return t[s]=i=>{o(i,n)},t},{}),[e,n])}function yn(e){return c.useMemo(()=>e?kr(e):null,[e])}const xn=[];function cs(e,n){n===void 0&&(n=Ne);const[t]=e,r=yn(t?X(t):null),[s,o]=c.useState(xn);function i(){o(()=>e.length?e.map(l=>on(l)?r:new Ot(n(l),l)):xn)}const a=ct({callback:i});return ie(()=>{a?.disconnect(),i(),e.forEach(l=>a?.observe(l))},[e]),s}function wn(e){if(!e)return null;if(e.children.length>1)return e;const n=e.children[0];return Le(n)?n:e}function us(e){let{measure:n}=e;const[t,r]=c.useState(null),s=c.useCallback(u=>{for(const{target:d}of u)if(Le(d)){r(f=>{const g=n(d);return f?{...f,width:g.width,height:g.height}:g});break}},[n]),o=ct({callback:s}),i=c.useCallback(u=>{const d=wn(u);o?.disconnect(),d&&o?.observe(d),r(d?n(d):null)},[n,o]),[a,l]=tt(i);return c.useMemo(()=>({nodeRef:a,rect:t,setRef:l}),[t,a,l])}const ds=[{sensor:at,options:{}},{sensor:fn,options:{}}],fs={current:{}},ut={draggable:{measure:tn},droppable:{measure:tn,strategy:Ve.WhileDragging,frequency:It.Optimized},dragOverlay:{measure:Ne}};class Ye extends Map{get(n){var t;return n!=null&&(t=super.get(n))!=null?t:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(n=>{let{disabled:t}=n;return!t})}getNodeFor(n){var t,r;return(t=(r=this.get(n))==null?void 0:r.node.current)!=null?t:void 0}}const hs={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Ye,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:it},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:ut,measureDroppableContainers:it,windowRect:null,measuringScheduled:!1},Cn={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:it,draggableNodes:new Map,over:null,measureDroppableContainers:it},Ke=c.createContext(Cn),Sn=c.createContext(hs);function gs(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Ye}}}function ps(e,n){switch(n.type){case $.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:n.initialCoordinates,active:n.active}};case $.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:n.coordinates.x-e.draggable.initialCoordinates.x,y:n.coordinates.y-e.draggable.initialCoordinates.y}}};case $.DragEnd:case $.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case $.RegisterDroppable:{const{element:t}=n,{id:r}=t,s=new Ye(e.droppable.containers);return s.set(r,t),{...e,droppable:{...e.droppable,containers:s}}}case $.SetDroppableDisabled:{const{id:t,key:r,disabled:s}=n,o=e.droppable.containers.get(t);if(!o||r!==o.key)return e;const i=new Ye(e.droppable.containers);return i.set(t,{...o,disabled:s}),{...e,droppable:{...e.droppable,containers:i}}}case $.UnregisterDroppable:{const{id:t,key:r}=n,s=e.droppable.containers.get(t);if(!s||r!==s.key)return e;const o=new Ye(e.droppable.containers);return o.delete(t),{...e,droppable:{...e.droppable,containers:o}}}default:return e}}function ms(e){let{disabled:n}=e;const{active:t,activatorEvent:r,draggableNodes:s}=c.useContext(Ke),o=nt(r),i=nt(t?.id);return c.useEffect(()=>{if(!n&&!r&&o&&i!=null){if(!st(o)||document.activeElement===o.target)return;const a=s.get(i);if(!a)return;const{activatorNode:l,node:u}=a;if(!l.current&&!u.current)return;requestAnimationFrame(()=>{for(const d of[l.current,u.current]){if(!d)continue;const f=dr(d);if(f){f.focus();break}}})}},[r,n,s,i,o]),null}function En(e,n){let{transform:t,...r}=n;return e!=null&&e.length?e.reduce((s,o)=>o({transform:s,...r}),t):t}function vs(e){return c.useMemo(()=>({draggable:{...ut.draggable,...e?.draggable},droppable:{...ut.droppable,...e?.droppable},dragOverlay:{...ut.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function bs(e){let{activeNode:n,measure:t,initialRect:r,config:s=!0}=e;const o=c.useRef(!1),{x:i,y:a}=typeof s=="boolean"?{x:s,y:s}:s;ie(()=>{if(!i&&!a||!n){o.current=!1;return}if(o.current||!r)return;const u=n?.node.current;if(!u||u.isConnected===!1)return;const d=t(u),f=Qt(d,r);if(i||(f.x=0),a||(f.y=0),o.current=!0,Math.abs(f.x)>0||Math.abs(f.y)>0){const g=nn(u);g&&g.scrollBy({top:f.y,left:f.x})}},[n,i,a,r,t])}const dt=c.createContext({...ae,scaleX:1,scaleY:1});var pe;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(pe||(pe={}));const Dn=c.memo(function(n){var t,r,s,o;let{id:i,accessibility:a,autoScroll:l=!0,children:u,sensors:d=ds,collisionDetection:f=Nr,measuring:g,modifiers:p,...C}=n;const b=c.useReducer(ps,void 0,gs),[x,y]=b,[v,m]=vr(),[S,E]=c.useState(pe.Uninitialized),T=S===pe.Initialized,{draggable:{active:O,nodes:N,translate:A},droppable:{containers:I}}=x,M=O!=null?N.get(O):null,z=c.useRef({initial:null,translated:null}),P=c.useMemo(()=>{var q;return O!=null?{id:O,data:(q=M?.data)!=null?q:fs,rect:z}:null},[O,M]),V=c.useRef(null),[H,Z]=c.useState(null),[K,Ce]=c.useState(null),se=Pe(C,Object.values(C)),me=Be("DndDescribedBy",i),h=c.useMemo(()=>I.getEnabled(),[I]),D=vs(g),{droppableRects:j,measureDroppableContainers:R,measuringScheduled:le}=es(h,{dragging:T,dependencies:[A.x,A.y],config:D.droppable}),U=Zr(N,O),L=c.useMemo(()=>K?ot(K):null,[K]),J=Oo(),Q=ts(U,D.draggable.measure);bs({activeNode:O!=null?N.get(O):null,config:J.layoutShiftCompensation,initialRect:Q,measure:D.draggable.measure});const _=mn(U,D.draggable.measure,Q),Ue=mn(U?U.parentElement:null),ce=c.useRef({activatorEvent:null,active:null,activeNode:U,collisionRect:null,collisions:null,droppableRects:j,draggableNodes:N,draggingNode:null,draggingNodeRect:null,droppableContainers:I,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Ae=I.getNodeFor((t=ce.current.over)==null?void 0:t.id),he=us({measure:D.dragOverlay.measure}),Me=(r=he.nodeRef.current)!=null?r:U,Ie=T?(s=he.rect)!=null?s:_:null,qn=!!(he.nodeRef.current&&he.rect),Xn=ss(qn?null:_),zt=yn(Me?X(Me):null),ve=os(T?Ae??U:null),mt=cs(ve),vt=En(p,{transform:{x:A.x-Xn.x,y:A.y-Xn.y,scaleX:1,scaleY:1},activatorEvent:K,active:P,activeNodeRect:_,containerNodeRect:Ue,draggingNodeRect:Ie,over:ce.current.over,overlayNodeRect:he.rect,scrollableAncestors:ve,scrollableAncestorRects:mt,windowRect:zt}),Hn=L?Oe(L,A):null,Jn=is(ve),yo=bn(Jn),xo=bn(Jn,[_]),je=Oe(vt,yo),ke=Ie?Mr(Ie,vt):null,qe=P&&ke?f({active:P,collisionRect:ke,droppableRects:j,droppableContainers:h,pointerCoordinates:Hn}):null,Gn=Dr(qe,"id"),[be,Zn]=c.useState(null),wo=qn?vt:Oe(vt,xo),Co=Tr(wo,(o=be?.rect)!=null?o:null,_),Lt=c.useRef(null),Qn=c.useCallback((q,ee)=>{let{sensor:te,options:ye}=ee;if(V.current==null)return;const oe=N.get(V.current);if(!oe)return;const ne=q.nativeEvent,ue=new te({active:V.current,activeNode:oe,event:ne,options:ye,context:ce,onAbort(Y){if(!N.get(Y))return;const{onDragAbort:de}=se.current,ge={id:Y};de?.(ge),v({type:"onDragAbort",event:ge})},onPending(Y,xe,de,ge){if(!N.get(Y))return;const{onDragPending:He}=se.current,we={id:Y,constraint:xe,initialCoordinates:de,offset:ge};He?.(we),v({type:"onDragPending",event:we})},onStart(Y){const xe=V.current;if(xe==null)return;const de=N.get(xe);if(!de)return;const{onDragStart:ge}=se.current,Xe={activatorEvent:ne,active:{id:xe,data:de.data,rect:z}};Se.unstable_batchedUpdates(()=>{ge?.(Xe),E(pe.Initializing),y({type:$.DragStart,initialCoordinates:Y,active:xe}),v({type:"onDragStart",event:Xe}),Z(Lt.current),Ce(ne)})},onMove(Y){y({type:$.DragMove,coordinates:Y})},onEnd:_e($.DragEnd),onCancel:_e($.DragCancel)});Lt.current=ue;function _e(Y){return async function(){const{active:de,collisions:ge,over:Xe,scrollAdjustedTranslate:He}=ce.current;let we=null;if(de&&He){const{cancelDrop:Je}=se.current;we={activatorEvent:ne,active:de,collisions:ge,delta:He,over:Xe},Y===$.DragEnd&&typeof Je=="function"&&await Promise.resolve(Je(we))&&(Y=$.DragCancel)}V.current=null,Se.unstable_batchedUpdates(()=>{y({type:Y}),E(pe.Uninitialized),Zn(null),Z(null),Ce(null),Lt.current=null;const Je=Y===$.DragEnd?"onDragEnd":"onDragCancel";if(we){const Pt=se.current[Je];Pt?.(we),v({type:Je,event:we})}})}}},[N]),So=c.useCallback((q,ee)=>(te,ye)=>{const oe=te.nativeEvent,ne=N.get(ye);if(V.current!==null||!ne||oe.dndKit||oe.defaultPrevented)return;const ue={active:ne};q(te,ee.options,ue)===!0&&(oe.dndKit={capturedBy:ee.sensor},V.current=ye,Qn(te,ee))},[N,Qn]),er=Qr(d,So);as(d),ie(()=>{_&&S===pe.Initializing&&E(pe.Initialized)},[_,S]),c.useEffect(()=>{const{onDragMove:q}=se.current,{active:ee,activatorEvent:te,collisions:ye,over:oe}=ce.current;if(!ee||!te)return;const ne={active:ee,activatorEvent:te,collisions:ye,delta:{x:je.x,y:je.y},over:oe};Se.unstable_batchedUpdates(()=>{q?.(ne),v({type:"onDragMove",event:ne})})},[je.x,je.y]),c.useEffect(()=>{const{active:q,activatorEvent:ee,collisions:te,droppableContainers:ye,scrollAdjustedTranslate:oe}=ce.current;if(!q||V.current==null||!ee||!oe)return;const{onDragOver:ne}=se.current,ue=ye.get(Gn),_e=ue&&ue.rect.current?{id:ue.id,rect:ue.rect.current,data:ue.data,disabled:ue.disabled}:null,Y={active:q,activatorEvent:ee,collisions:te,delta:{x:oe.x,y:oe.y},over:_e};Se.unstable_batchedUpdates(()=>{Zn(_e),ne?.(Y),v({type:"onDragOver",event:Y})})},[Gn]),ie(()=>{ce.current={activatorEvent:K,active:P,activeNode:U,collisionRect:ke,collisions:qe,droppableRects:j,draggableNodes:N,draggingNode:Me,draggingNodeRect:Ie,droppableContainers:I,over:be,scrollableAncestors:ve,scrollAdjustedTranslate:je},z.current={initial:Ie,translated:ke}},[P,U,qe,ke,N,Me,Ie,j,I,be,ve,je]),Hr({...J,delta:A,draggingRect:ke,pointerCoordinates:Hn,scrollableAncestors:ve,scrollableAncestorRects:mt});const Eo=c.useMemo(()=>({active:P,activeNode:U,activeNodeRect:_,activatorEvent:K,collisions:qe,containerNodeRect:Ue,dragOverlay:he,draggableNodes:N,droppableContainers:I,droppableRects:j,over:be,measureDroppableContainers:R,scrollableAncestors:ve,scrollableAncestorRects:mt,measuringConfiguration:D,measuringScheduled:le,windowRect:zt}),[P,U,_,K,qe,Ue,he,N,I,j,be,R,ve,mt,D,le,zt]),Do=c.useMemo(()=>({activatorEvent:K,activators:er,active:P,activeNodeRect:_,ariaDescribedById:{draggable:me},dispatch:y,draggableNodes:N,over:be,measureDroppableContainers:R}),[K,er,P,_,y,me,N,be,R]);return c.createElement(Xt.Provider,{value:m},c.createElement(Ke.Provider,{value:Do},c.createElement(Sn.Provider,{value:Eo},c.createElement(dt.Provider,{value:Co},u)),c.createElement(ms,{disabled:a?.restoreFocus===!1})),c.createElement(xr,{...a,hiddenTextDescribedById:me}));function Oo(){const q=H?.autoScrollEnabled===!1,ee=typeof l=="object"?l.enabled===!1:l===!1,te=T&&!q&&!ee;return typeof l=="object"?{...l,enabled:te}:{enabled:te}}}),ys=c.createContext(null),On="button",xs="Draggable";function ws(e){let{id:n,data:t,disabled:r=!1,attributes:s}=e;const o=Be(xs),{activators:i,activatorEvent:a,active:l,activeNodeRect:u,ariaDescribedById:d,draggableNodes:f,over:g}=c.useContext(Ke),{role:p=On,roleDescription:C="draggable",tabIndex:b=0}=s??{},x=l?.id===n,y=c.useContext(x?dt:ys),[v,m]=tt(),[S,E]=tt(),T=ls(i,n),O=Pe(t);ie(()=>(f.set(n,{id:n,key:o,node:v,activatorNode:S,data:O}),()=>{const A=f.get(n);A&&A.key===o&&f.delete(n)}),[f,n]);const N=c.useMemo(()=>({role:p,tabIndex:b,"aria-disabled":r,"aria-pressed":x&&p===On?!0:void 0,"aria-roledescription":C,"aria-describedby":d.draggable}),[r,p,b,x,C,d.draggable]);return{active:l,activatorEvent:a,activeNodeRect:u,attributes:N,isDragging:x,listeners:r?void 0:T,node:v,over:g,setNodeRef:m,setActivatorNodeRef:E,transform:y}}function Nn(){return c.useContext(Sn)}const Cs="Droppable",Ss={timeout:25};function Es(e){let{data:n,disabled:t=!1,id:r,resizeObserverConfig:s}=e;const o=Be(Cs),{active:i,dispatch:a,over:l,measureDroppableContainers:u}=c.useContext(Ke),d=c.useRef({disabled:t}),f=c.useRef(!1),g=c.useRef(null),p=c.useRef(null),{disabled:C,updateMeasurementsFor:b,timeout:x}={...Ss,...s},y=Pe(b??r),v=c.useCallback(()=>{if(!f.current){f.current=!0;return}p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{u(Array.isArray(y.current)?y.current:[y.current]),p.current=null},x)},[x]),m=ct({callback:v,disabled:C||!i}),S=c.useCallback((N,A)=>{m&&(A&&(m.unobserve(A),f.current=!1),N&&m.observe(N))},[m]),[E,T]=tt(S),O=Pe(n);return c.useEffect(()=>{!m||!E.current||(m.disconnect(),f.current=!1,m.observe(E.current))},[E,m]),c.useEffect(()=>(a({type:$.RegisterDroppable,element:{id:r,key:o,disabled:t,node:E,rect:g,data:O}}),()=>a({type:$.UnregisterDroppable,key:o,id:r})),[r]),c.useEffect(()=>{t!==d.current.disabled&&(a({type:$.SetDroppableDisabled,id:r,key:o,disabled:t}),d.current.disabled=t)},[r,o,t,a]),{active:i,rect:g,isOver:l?.id===r,node:E,over:l,setNodeRef:T}}function Ds(e){let{animation:n,children:t}=e;const[r,s]=c.useState(null),[o,i]=c.useState(null),a=nt(t);return!t&&!r&&a&&s(a),ie(()=>{if(!o)return;const l=r?.key,u=r?.props.id;if(l==null||u==null){s(null);return}Promise.resolve(n(u,o)).then(()=>{s(null)})},[n,r,o]),c.createElement(c.Fragment,null,t,r?c.cloneElement(r,{ref:i}):null)}const Os={x:0,y:0,scaleX:1,scaleY:1};function Ns(e){let{children:n}=e;return c.createElement(Ke.Provider,{value:Cn},c.createElement(dt.Provider,{value:Os},n))}const Ts={position:"fixed",touchAction:"none"},As=e=>st(e)?"transform 250ms ease":void 0,Ms=c.forwardRef((e,n)=>{let{as:t,activatorEvent:r,adjustScale:s,children:o,className:i,rect:a,style:l,transform:u,transition:d=As}=e;if(!a)return null;const f=s?u:{...u,scaleX:1,scaleY:1},g={...Ts,width:a.width,height:a.height,top:a.top,left:a.left,transform:fe.Transform.toString(f),transformOrigin:s&&r?Cr(r,a):void 0,transition:typeof d=="function"?d(r):d,...l};return c.createElement(t,{className:i,style:g,ref:n},o)}),Is={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:n,final:t}}=e;return[{transform:fe.Transform.toString(n)},{transform:fe.Transform.toString(t)}]},sideEffects:(e=>n=>{let{active:t,dragOverlay:r}=n;const s={},{styles:o,className:i}=e;if(o!=null&&o.active)for(const[a,l]of Object.entries(o.active))l!==void 0&&(s[a]=t.node.style.getPropertyValue(a),t.node.style.setProperty(a,l));if(o!=null&&o.dragOverlay)for(const[a,l]of Object.entries(o.dragOverlay))l!==void 0&&r.node.style.setProperty(a,l);return i!=null&&i.active&&t.node.classList.add(i.active),i!=null&&i.dragOverlay&&r.node.classList.add(i.dragOverlay),function(){for(const[l,u]of Object.entries(s))t.node.style.setProperty(l,u);i!=null&&i.active&&t.node.classList.remove(i.active)}})({styles:{active:{opacity:"0"}}})};function js(e){let{config:n,draggableNodes:t,droppableContainers:r,measuringConfiguration:s}=e;return et((o,i)=>{if(n===null)return;const a=t.get(o);if(!a)return;const l=a.node.current;if(!l)return;const u=wn(i);if(!u)return;const{transform:d}=X(i).getComputedStyle(i),f=en(d);if(!f)return;const g=typeof n=="function"?n:ks(n);return cn(l,s.draggable.measure),g({active:{id:o,data:a.data,node:l,rect:s.draggable.measure(l)},draggableNodes:t,dragOverlay:{node:i,rect:s.dragOverlay.measure(u)},droppableContainers:r,measuringConfiguration:s,transform:f})})}function ks(e){const{duration:n,easing:t,sideEffects:r,keyframes:s}={...Is,...e};return o=>{let{active:i,dragOverlay:a,transform:l,...u}=o;if(!n)return;const d={x:a.rect.left-i.rect.left,y:a.rect.top-i.rect.top},f={scaleX:l.scaleX!==1?i.rect.width*l.scaleX/a.rect.width:1,scaleY:l.scaleY!==1?i.rect.height*l.scaleY/a.rect.height:1},g={x:l.x-d.x,y:l.y-d.y,...f},p=s({...u,active:i,dragOverlay:a,transform:{initial:l,final:g}}),[C]=p,b=p[p.length-1];if(JSON.stringify(C)===JSON.stringify(b))return;const x=r?.({active:i,dragOverlay:a,...u}),y=a.node.animate(p,{duration:n,easing:t,fill:"forwards"});return new Promise(v=>{y.onfinish=()=>{x?.(),v()}})}}let Tn=0;function _s(e){return c.useMemo(()=>{if(e!=null)return Tn++,Tn},[e])}const An=c.memo(e=>{let{adjustScale:n=!1,children:t,dropAnimation:r,style:s,transition:o,modifiers:i,wrapperElement:a="div",className:l,zIndex:u=999}=e;const{activatorEvent:d,active:f,activeNodeRect:g,containerNodeRect:p,draggableNodes:C,droppableContainers:b,dragOverlay:x,over:y,measuringConfiguration:v,scrollableAncestors:m,scrollableAncestorRects:S,windowRect:E}=Nn(),T=c.useContext(dt),O=_s(f?.id),N=En(i,{activatorEvent:d,active:f,activeNodeRect:g,containerNodeRect:p,draggingNodeRect:x.rect,over:y,overlayNodeRect:x.rect,scrollableAncestors:m,scrollableAncestorRects:S,transform:T,windowRect:E}),A=jt(g),I=js({config:r,draggableNodes:C,droppableContainers:b,measuringConfiguration:v}),M=A?x.setRef:void 0;return c.createElement(Ns,null,c.createElement(Ds,{animation:I},f&&O?c.createElement(Ms,{key:O,id:f.id,ref:M,as:a,activatorEvent:d,adjustScale:n,className:l,transition:o,rect:A,style:{zIndex:u,...s},transform:N},t):null))});function ft(e,n,t){const r=e.slice();return r.splice(t<0?r.length+t:t,0,r.splice(n,1)[0]),r}function Rs(e,n){return e.reduce((t,r,s)=>{const o=n.get(r);return o&&(t[s]=o),t},Array(e.length))}function ht(e){return e!==null&&e>=0}function zs(e,n){if(e===n)return!0;if(e.length!==n.length)return!1;for(let t=0;t<e.length;t++)if(e[t]!==n[t])return!1;return!0}function Ls(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const Mn=e=>{let{rects:n,activeIndex:t,overIndex:r,index:s}=e;const o=ft(n,r,t),i=n[s],a=o[s];return!a||!i?null:{x:a.left-i.left,y:a.top-i.top,scaleX:a.width/i.width,scaleY:a.height/i.height}},gt={scaleX:1,scaleY:1},In=e=>{var n;let{activeIndex:t,activeNodeRect:r,index:s,rects:o,overIndex:i}=e;const a=(n=o[t])!=null?n:r;if(!a)return null;if(s===t){const u=o[i];return u?{x:0,y:t<i?u.top+u.height-(a.top+a.height):u.top-a.top,...gt}:null}const l=Ps(o,s,t);return s>t&&s<=i?{x:0,y:-a.height-l,...gt}:s<t&&s>=i?{x:0,y:a.height+l,...gt}:{x:0,y:0,...gt}};function Ps(e,n,t){const r=e[n],s=e[n-1],o=e[n+1];return r?t<n?s?r.top-(s.top+s.height):o?o.top-(r.top+r.height):0:o?o.top-(r.top+r.height):s?r.top-(s.top+s.height):0:0}const jn="Sortable",kn=c.createContext({activeIndex:-1,containerId:jn,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Mn,disabled:{draggable:!1,droppable:!1}});function _n(e){let{children:n,id:t,items:r,strategy:s=Mn,disabled:o=!1}=e;const{active:i,dragOverlay:a,droppableRects:l,over:u,measureDroppableContainers:d}=Nn(),f=Be(jn,t),g=a.rect!==null,p=c.useMemo(()=>r.map(T=>typeof T=="object"&&"id"in T?T.id:T),[r]),C=i!=null,b=i?p.indexOf(i.id):-1,x=u?p.indexOf(u.id):-1,y=c.useRef(p),v=!zs(p,y.current),m=x!==-1&&b===-1||v,S=Ls(o);ie(()=>{v&&C&&d(p)},[v,p,C,d]),c.useEffect(()=>{y.current=p},[p]);const E=c.useMemo(()=>({activeIndex:b,containerId:f,disabled:S,disableTransforms:m,items:p,overIndex:x,useDragOverlay:g,sortedRects:Rs(p,l),strategy:s}),[b,f,S.draggable,S.droppable,m,p,x,l,g,s]);return c.createElement(kn.Provider,{value:E},n)}const Fs=e=>{let{id:n,items:t,activeIndex:r,overIndex:s}=e;return ft(t,r,s).indexOf(n)},Bs=e=>{let{containerId:n,isSorting:t,wasDragging:r,index:s,items:o,newIndex:i,previousItems:a,previousContainerId:l,transition:u}=e;return!u||!r||a!==o&&s===i?!1:t?!0:i!==s&&n===l},$s={duration:200,easing:"ease"},Rn="transform",Ws=fe.Transition.toString({property:Rn,duration:0,easing:"linear"}),Vs={roleDescription:"sortable"};function Ys(e){let{disabled:n,index:t,node:r,rect:s}=e;const[o,i]=c.useState(null),a=c.useRef(t);return ie(()=>{if(!n&&t!==a.current&&r.current){const l=s.current;if(l){const u=Ne(r.current,{ignoreTransform:!0}),d={x:l.left-u.left,y:l.top-u.top,scaleX:l.width/u.width,scaleY:l.height/u.height};(d.x||d.y)&&i(d)}}t!==a.current&&(a.current=t)},[n,t,r,s]),c.useEffect(()=>{o&&i(null)},[o]),o}function pt(e){let{animateLayoutChanges:n=Bs,attributes:t,disabled:r,data:s,getNewIndex:o=Fs,id:i,strategy:a,resizeObserverConfig:l,transition:u=$s}=e;const{items:d,containerId:f,activeIndex:g,disabled:p,disableTransforms:C,sortedRects:b,overIndex:x,useDragOverlay:y,strategy:v}=c.useContext(kn),m=Ks(r,p),S=d.indexOf(i),E=c.useMemo(()=>({sortable:{containerId:f,index:S,items:d},...s}),[f,s,S,d]),T=c.useMemo(()=>d.slice(d.indexOf(i)),[d,i]),{rect:O,node:N,isOver:A,setNodeRef:I}=Es({id:i,data:E,disabled:m.droppable,resizeObserverConfig:{updateMeasurementsFor:T,...l}}),{active:M,activatorEvent:z,activeNodeRect:P,attributes:V,setNodeRef:H,listeners:Z,isDragging:K,over:Ce,setActivatorNodeRef:se,transform:me}=ws({id:i,data:E,attributes:{...Vs,...t},disabled:m.draggable}),h=ar(I,H),D=!!M,j=D&&!C&&ht(g)&&ht(x),R=!y&&K,le=R&&j?me:null,L=j?le??(a??v)({rects:b,activeNodeRect:P,activeIndex:g,overIndex:x,index:S}):null,J=ht(g)&&ht(x)?o({id:i,items:d,activeIndex:g,overIndex:x}):S,Q=M?.id,_=c.useRef({activeId:Q,items:d,newIndex:J,containerId:f}),Ue=d!==_.current.items,ce=n({active:M,containerId:f,isDragging:K,isSorting:D,id:i,index:S,items:d,newIndex:_.current.newIndex,previousItems:_.current.items,previousContainerId:_.current.containerId,transition:u,wasDragging:_.current.activeId!=null}),Ae=Ys({disabled:!ce,index:S,node:N,rect:O});return c.useEffect(()=>{D&&_.current.newIndex!==J&&(_.current.newIndex=J),f!==_.current.containerId&&(_.current.containerId=f),d!==_.current.items&&(_.current.items=d)},[D,J,f,d]),c.useEffect(()=>{if(Q===_.current.activeId)return;if(Q!=null&&_.current.activeId==null){_.current.activeId=Q;return}const Me=setTimeout(()=>{_.current.activeId=Q},50);return()=>clearTimeout(Me)},[Q]),{active:M,activeIndex:g,attributes:V,data:E,rect:O,index:S,newIndex:J,items:d,isOver:A,isSorting:D,isDragging:K,listeners:Z,node:N,overIndex:x,over:Ce,setNodeRef:h,setActivatorNodeRef:se,setDroppableNodeRef:I,setDraggableNodeRef:H,transform:Ae??L,transition:he()};function he(){if(Ae||Ue&&_.current.newIndex===S)return Ws;if(!(R&&!st(z)||!u)&&(D||ce))return fe.Transition.toString({...u,property:Rn})}}function Ks(e,n){var t,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(t=e?.draggable)!=null?t:n.draggable,droppable:(r=e?.droppable)!=null?r:n.droppable}}k.Down,k.Right,k.Up,k.Left;const zn=(...e)=>e.filter(Boolean).join(" ");function Ln({card:e}){const{attributes:n,listeners:t,setNodeRef:r,transform:s,transition:o,isDragging:i}=pt({id:e.id}),a={transform:fe.Transform.toString(s),transition:o,opacity:i?.5:void 0};return w.jsx("div",{ref:r,style:a,...n,...t,children:w.jsxs(B.Card,{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:[w.jsxs(B.CardHeader,{className:"p-4",children:[w.jsx(B.CardTitle,{className:"text-sm font-medium font-mono tracking-tight text-foreground group-hover:text-primary transition-colors",children:e.title}),e.description&&w.jsx(B.CardDescription,{className:"text-xs text-muted-foreground font-mono",children:e.description})]}),e.badges&&e.badges.length>0&&w.jsx(B.CardContent,{className:"p-4 pt-0",children:w.jsx("div",{className:"flex flex-wrap gap-1",children:e.badges.map((l,u)=>w.jsx(B.Badge,{variant:l.variant||"default",className:"text-xs",children:l.label},u))})})]})})}function Us({column:e,cards:n}){const t=n||[],{setNodeRef:r}=pt({id:e.id,data:{type:"column"}}),s=e.limit&&t.length>=e.limit;return w.jsxs("div",{ref:r,className:zn("flex flex-col w-80 flex-shrink-0 rounded-lg border border-border bg-card/20 backdrop-blur-sm shadow-xl",e.className),children:[w.jsx("div",{className:"p-4 border-b border-border/50 bg-muted/20",children:w.jsxs("div",{className:"flex items-center justify-between",children:[w.jsx("h3",{className:"font-mono text-sm font-semibold tracking-wider text-primary/90 uppercase",children:e.title}),w.jsxs("div",{className:"flex items-center gap-2",children:[w.jsxs("span",{className:"font-mono text-xs text-muted-foreground",children:[t.length,e.limit&&` / ${e.limit}`]}),s&&w.jsx(B.Badge,{variant:"destructive",className:"text-xs",children:"Full"})]})]})}),w.jsx(B.ScrollArea,{className:"flex-1 p-4",children:w.jsx(_n,{items:t.map(o=>o.id),strategy:In,children:w.jsx("div",{className:"space-y-2",children:t.map(o=>w.jsx(Ln,{card:o},o.id))})})})]})}function qs({columns:e,onCardMove:n,className:t}){const[r,s]=F.useState(null),o=F.useMemo(()=>(e||[]).map(C=>({...C,cards:C.cards||[]})),[e]),[i,a]=F.useState(o);F.useEffect(()=>{a(o)},[o]);const l=Jt(Ht(at,{activationConstraint:{distance:8}})),u=C=>{const{active:b}=C,x=f(b.id);s(x)},d=C=>{const{active:b,over:x}=C;if(s(null),!x)return;const y=b.id,v=x.id;if(y===v)return;const m=g(y),S=g(v)||p(v);if(!(!m||!S))if(m.id===S.id){const E=[...m.cards],T=E.findIndex(A=>A.id===y),O=E.findIndex(A=>A.id===v),N=ft(E,T,O);a(A=>A.map(I=>I.id===m.id?{...I,cards:N}:I))}else{const E=[...m.cards],T=[...S.cards],O=E.findIndex(M=>M.id===y),A=v===S.id?T.length:T.findIndex(M=>M.id===v),[I]=E.splice(O,1);T.splice(A,0,I),a(M=>M.map(z=>z.id===m.id?{...z,cards:E}:z.id===S.id?{...z,cards:T}:z)),n&&n(y,m.id,S.id,A)}},f=F.useCallback(C=>{for(const b of i){const x=b.cards.find(y=>y.id===C);if(x)return x}return null},[i]),g=F.useCallback(C=>i.find(b=>b.cards.some(x=>x.id===C))||null,[i]),p=F.useCallback(C=>i.find(b=>b.id===C)||null,[i]);return w.jsxs(Dn,{sensors:l,collisionDetection:Zt,onDragStart:u,onDragEnd:d,children:[w.jsx("div",{className:zn("flex gap-4 overflow-x-auto p-4",t),children:i.map(C=>w.jsx(Us,{column:C,cards:C.cards},C.id))}),w.jsx(An,{children:r?w.jsx(Ln,{card:r}):null})]})}const Xs=Object.freeze(Object.defineProperty({__proto__:null,default:qs},Symbol.toStringTag,{value:"Module"}));function Te(e,n,t){let r=t.initialDeps??[],s,o=!0;function i(){var a,l,u;let d;t.key&&((a=t.debug)!=null&&a.call(t))&&(d=Date.now());const f=e();if(!(f.length!==r.length||f.some((C,b)=>r[b]!==C)))return s;r=f;let p;if(t.key&&((l=t.debug)!=null&&l.call(t))&&(p=Date.now()),s=n(...f),t.key&&((u=t.debug)!=null&&u.call(t))){const C=Math.round((Date.now()-d)*100)/100,b=Math.round((Date.now()-p)*100)/100,x=b/16,y=(v,m)=>{for(v=String(v);v.length<m;)v=" "+v;return v};console.info(`%c⏱ ${y(b,5)} /${y(C,5)} ms`,`
|
|
10
|
+
`},yr={onDragStart(e){let{active:n}=e;return"Picked up draggable item "+n.id+"."},onDragOver(e){let{active:n,over:t}=e;return t?"Draggable item "+n.id+" was moved over droppable area "+t.id+".":"Draggable item "+n.id+" is no longer over a droppable area."},onDragEnd(e){let{active:n,over:t}=e;return t?"Draggable item "+n.id+" was dropped over droppable area "+t.id:"Draggable item "+n.id+" was dropped."},onDragCancel(e){let{active:n}=e;return"Dragging was cancelled. Draggable item "+n.id+" was dropped."}};function xr(e){let{announcements:n=yr,container:t,hiddenTextDescribedById:r,screenReaderInstructions:s=br}=e;const{announce:o,announcement:i}=pr(),a=Be("DndLiveRegion"),[l,u]=c.useState(!1);if(c.useEffect(()=>{u(!0)},[]),mr(c.useMemo(()=>({onDragStart(f){let{active:g}=f;o(n.onDragStart({active:g}))},onDragMove(f){let{active:g,over:p}=f;n.onDragMove&&o(n.onDragMove({active:g,over:p}))},onDragOver(f){let{active:g,over:p}=f;o(n.onDragOver({active:g,over:p}))},onDragEnd(f){let{active:g,over:p}=f;o(n.onDragEnd({active:g,over:p}))},onDragCancel(f){let{active:g,over:p}=f;o(n.onDragCancel({active:g,over:p}))}}),[o,n])),!l)return null;const d=c.createElement(c.Fragment,null,c.createElement(hr,{id:r,value:s.draggable}),c.createElement(gr,{id:a,announcement:i}));return t?Se.createPortal(d,t):d}var $;(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"})($||($={}));function at(){}function Ht(e,n){return c.useMemo(()=>({sensor:e,options:n??{}}),[e,n])}function Jt(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];return c.useMemo(()=>[...n].filter(r=>r!=null),[...n])}const ae=Object.freeze({x:0,y:0});function wr(e,n){return Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2))}function Cr(e,n){const t=it(e);if(!t)return"0 0";const r={x:(t.x-n.left)/n.width*100,y:(t.y-n.top)/n.height*100};return r.x+"% "+r.y+"%"}function Sr(e,n){let{data:{value:t}}=e,{data:{value:r}}=n;return t-r}function Er(e,n){let{data:{value:t}}=e,{data:{value:r}}=n;return r-t}function Gt(e){let{left:n,top:t,height:r,width:s}=e;return[{x:n,y:t},{x:n+s,y:t},{x:n,y:t+r},{x:n+s,y:t+r}]}function Dr(e,n){if(!e||e.length===0)return null;const[t]=e;return t[n]}const Zt=e=>{let{collisionRect:n,droppableRects:t,droppableContainers:r}=e;const s=Gt(n),o=[];for(const i of r){const{id:a}=i,l=t.get(a);if(l){const u=Gt(l),d=s.reduce((g,p,C)=>g+wr(u[C],p),0),f=Number((d/4).toFixed(4));o.push({id:a,data:{droppableContainer:i,value:f}})}}return o.sort(Sr)};function Or(e,n){const t=Math.max(n.top,e.top),r=Math.max(n.left,e.left),s=Math.min(n.left+n.width,e.left+e.width),o=Math.min(n.top+n.height,e.top+e.height),i=s-r,a=o-t;if(r<s&&t<o){const l=n.width*n.height,u=e.width*e.height,d=i*a,f=d/(l+u-d);return Number(f.toFixed(4))}return 0}const Nr=e=>{let{collisionRect:n,droppableRects:t,droppableContainers:r}=e;const s=[];for(const o of r){const{id:i}=o,a=t.get(i);if(a){const l=Or(a,n);l>0&&s.push({id:i,data:{droppableContainer:o,value:l}})}}return s.sort(Er)};function Tr(e,n,t){return{...e,scaleX:n&&t?n.width/t.width:1,scaleY:n&&t?n.height/t.height:1}}function Qt(e,n){return e&&n?{x:e.left-n.left,y:e.top-n.top}:ae}function Ar(e){return function(t){for(var r=arguments.length,s=new Array(r>1?r-1:0),o=1;o<r;o++)s[o-1]=arguments[o];return s.reduce((i,a)=>({...i,top:i.top+e*a.y,bottom:i.bottom+e*a.y,left:i.left+e*a.x,right:i.right+e*a.x}),{...t})}}const Mr=Ar(1);function en(e){if(e.startsWith("matrix3d(")){const n=e.slice(9,-1).split(/, /);return{x:+n[12],y:+n[13],scaleX:+n[0],scaleY:+n[5]}}else if(e.startsWith("matrix(")){const n=e.slice(7,-1).split(/, /);return{x:+n[4],y:+n[5],scaleX:+n[0],scaleY:+n[3]}}return null}function Ir(e,n,t){const r=en(n);if(!r)return e;const{scaleX:s,scaleY:o,x:i,y:a}=r,l=e.left-i-(1-s)*parseFloat(t),u=e.top-a-(1-o)*parseFloat(t.slice(t.indexOf(" ")+1)),d=s?e.width/s:e.width,f=o?e.height/o:e.height;return{width:d,height:f,top:u,right:l+d,bottom:u+f,left:l}}const jr={ignoreTransform:!1};function Ne(e,n){n===void 0&&(n=jr);let t=e.getBoundingClientRect();if(n.ignoreTransform){const{transform:u,transformOrigin:d}=X(e).getComputedStyle(e);u&&(t=Ir(t,u,d))}const{top:r,left:s,width:o,height:i,bottom:a,right:l}=t;return{top:r,left:s,width:o,height:i,bottom:a,right:l}}function tn(e){return Ne(e,{ignoreTransform:!0})}function kr(e){const n=e.innerWidth,t=e.innerHeight;return{top:0,left:0,right:n,bottom:t,width:n,height:t}}function _r(e,n){return n===void 0&&(n=X(e).getComputedStyle(e)),n.position==="fixed"}function Rr(e,n){n===void 0&&(n=X(e).getComputedStyle(e));const t=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(s=>{const o=n[s];return typeof o=="string"?t.test(o):!1})}function Et(e,n){const t=[];function r(s){if(n!=null&&t.length>=n||!s)return t;if(Ct(s)&&s.scrollingElement!=null&&!t.includes(s.scrollingElement))return t.push(s.scrollingElement),t;if(!Le(s)||Kt(s)||t.includes(s))return t;const o=X(e).getComputedStyle(s);return s!==e&&Rr(s,o)&&t.push(s),_r(s,o)?t:r(s.parentNode)}return e?r(e):t}function nn(e){const[n]=Et(e,1);return n??null}function Dt(e){return!et||!e?null:Ee(e)?e:wt(e)?Ct(e)||e===De(e).scrollingElement?window:Le(e)?e:null:null}function rn(e){return Ee(e)?e.scrollX:e.scrollLeft}function sn(e){return Ee(e)?e.scrollY:e.scrollTop}function Ot(e){return{x:rn(e),y:sn(e)}}var W;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(W||(W={}));function on(e){return!et||!e?!1:e===document.scrollingElement}function an(e){const n={x:0,y:0},t=on(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-t.width,y:e.scrollHeight-t.height},s=e.scrollTop<=n.y,o=e.scrollLeft<=n.x,i=e.scrollTop>=r.y,a=e.scrollLeft>=r.x;return{isTop:s,isLeft:o,isBottom:i,isRight:a,maxScroll:r,minScroll:n}}const zr={x:.2,y:.2};function Lr(e,n,t,r,s){let{top:o,left:i,right:a,bottom:l}=t;r===void 0&&(r=10),s===void 0&&(s=zr);const{isTop:u,isBottom:d,isLeft:f,isRight:g}=an(e),p={x:0,y:0},C={x:0,y:0},b={height:n.height*s.y,width:n.width*s.x};return!u&&o<=n.top+b.height?(p.y=W.Backward,C.y=r*Math.abs((n.top+b.height-o)/b.height)):!d&&l>=n.bottom-b.height&&(p.y=W.Forward,C.y=r*Math.abs((n.bottom-b.height-l)/b.height)),!g&&a>=n.right-b.width?(p.x=W.Forward,C.x=r*Math.abs((n.right-b.width-a)/b.width)):!f&&i<=n.left+b.width&&(p.x=W.Backward,C.x=r*Math.abs((n.left+b.width-i)/b.width)),{direction:p,speed:C}}function Pr(e){if(e===document.scrollingElement){const{innerWidth:o,innerHeight:i}=window;return{top:0,left:0,right:o,bottom:i,width:o,height:i}}const{top:n,left:t,right:r,bottom:s}=e.getBoundingClientRect();return{top:n,left:t,right:r,bottom:s,width:e.clientWidth,height:e.clientHeight}}function ln(e){return e.reduce((n,t)=>Oe(n,Ot(t)),ae)}function Fr(e){return e.reduce((n,t)=>n+rn(t),0)}function Br(e){return e.reduce((n,t)=>n+sn(t),0)}function cn(e,n){if(n===void 0&&(n=Ne),!e)return;const{top:t,left:r,bottom:s,right:o}=n(e);nn(e)&&(s<=0||o<=0||t>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const $r=[["x",["left","right"],Fr],["y",["top","bottom"],Br]];class Nt{constructor(n,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=Et(t),s=ln(r);this.rect={...n},this.width=n.width,this.height=n.height;for(const[o,i,a]of $r)for(const l of i)Object.defineProperty(this,l,{get:()=>{const u=a(r),d=s[o]-u;return this.rect[l]+d},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class $e{constructor(n){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(t=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...t)})},this.target=n}add(n,t,r){var s;(s=this.target)==null||s.addEventListener(n,t,r),this.listeners.push([n,t,r])}}function Wr(e){const{EventTarget:n}=X(e);return e instanceof n?e:De(e)}function Tt(e,n){const t=Math.abs(e.x),r=Math.abs(e.y);return typeof n=="number"?Math.sqrt(t**2+r**2)>n:"x"in n&&"y"in n?t>n.x&&r>n.y:"x"in n?t>n.x:"y"in n?r>n.y:!1}var re;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(re||(re={}));function un(e){e.preventDefault()}function Vr(e){e.stopPropagation()}var k;(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"})(k||(k={}));const dn={start:[k.Space,k.Enter],cancel:[k.Esc],end:[k.Space,k.Enter,k.Tab]},Yr=(e,n)=>{let{currentCoordinates:t}=n;switch(e.code){case k.Right:return{...t,x:t.x+25};case k.Left:return{...t,x:t.x-25};case k.Down:return{...t,y:t.y+25};case k.Up:return{...t,y:t.y-25}}};class fn{constructor(n){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=n;const{event:{target:t}}=n;this.props=n,this.listeners=new $e(De(t)),this.windowListeners=new $e(X(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(re.Resize,this.handleCancel),this.windowListeners.add(re.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(re.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:n,onStart:t}=this.props,r=n.node.current;r&&cn(r),t(ae)}handleKeyDown(n){if(ot(n)){const{active:t,context:r,options:s}=this.props,{keyboardCodes:o=dn,coordinateGetter:i=Yr,scrollBehavior:a="smooth"}=s,{code:l}=n;if(o.end.includes(l)){this.handleEnd(n);return}if(o.cancel.includes(l)){this.handleCancel(n);return}const{collisionRect:u}=r.current,d=u?{x:u.left,y:u.top}:ae;this.referenceCoordinates||(this.referenceCoordinates=d);const f=i(n,{active:t,context:r.current,currentCoordinates:d});if(f){const g=st(f,d),p={x:0,y:0},{scrollableAncestors:C}=r.current;for(const b of C){const x=n.code,{isTop:y,isRight:v,isLeft:m,isBottom:S,maxScroll:E,minScroll:T}=an(b),O=Pr(b),N={x:Math.min(x===k.Right?O.right-O.width/2:O.right,Math.max(x===k.Right?O.left:O.left+O.width/2,f.x)),y:Math.min(x===k.Down?O.bottom-O.height/2:O.bottom,Math.max(x===k.Down?O.top:O.top+O.height/2,f.y))},A=x===k.Right&&!v||x===k.Left&&!m,I=x===k.Down&&!S||x===k.Up&&!y;if(A&&N.x!==f.x){const M=b.scrollLeft+g.x,z=x===k.Right&&M<=E.x||x===k.Left&&M>=T.x;if(z&&!g.y){b.scrollTo({left:M,behavior:a});return}z?p.x=b.scrollLeft-M:p.x=x===k.Right?b.scrollLeft-E.x:b.scrollLeft-T.x,p.x&&b.scrollBy({left:-p.x,behavior:a});break}else if(I&&N.y!==f.y){const M=b.scrollTop+g.y,z=x===k.Down&&M<=E.y||x===k.Up&&M>=T.y;if(z&&!g.x){b.scrollTo({top:M,behavior:a});return}z?p.y=b.scrollTop-M:p.y=x===k.Down?b.scrollTop-E.y:b.scrollTop-T.y,p.y&&b.scrollBy({top:-p.y,behavior:a});break}}this.handleMove(n,Oe(st(f,this.referenceCoordinates),p))}}}handleMove(n,t){const{onMove:r}=this.props;n.preventDefault(),r(t)}handleEnd(n){const{onEnd:t}=this.props;n.preventDefault(),this.detach(),t()}handleCancel(n){const{onCancel:t}=this.props;n.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}fn.activators=[{eventName:"onKeyDown",handler:(e,n,t)=>{let{keyboardCodes:r=dn,onActivation:s}=n,{active:o}=t;const{code:i}=e.nativeEvent;if(r.start.includes(i)){const a=o.activatorNode.current;return a&&e.target!==a?!1:(e.preventDefault(),s?.({event:e.nativeEvent}),!0)}return!1}}];function hn(e){return!!(e&&"distance"in e)}function gn(e){return!!(e&&"delay"in e)}class At{constructor(n,t,r){var s;r===void 0&&(r=Wr(n.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=n,this.events=t;const{event:o}=n,{target:i}=o;this.props=n,this.events=t,this.document=De(i),this.documentListeners=new $e(this.document),this.listeners=new $e(r),this.windowListeners=new $e(X(i)),this.initialCoordinates=(s=it(o))!=null?s:ae,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:n,props:{options:{activationConstraint:t,bypassActivationConstraint:r}}}=this;if(this.listeners.add(n.move.name,this.handleMove,{passive:!1}),this.listeners.add(n.end.name,this.handleEnd),n.cancel&&this.listeners.add(n.cancel.name,this.handleCancel),this.windowListeners.add(re.Resize,this.handleCancel),this.windowListeners.add(re.DragStart,un),this.windowListeners.add(re.VisibilityChange,this.handleCancel),this.windowListeners.add(re.ContextMenu,un),this.documentListeners.add(re.Keydown,this.handleKeydown),t){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(gn(t)){this.timeoutId=setTimeout(this.handleStart,t.delay),this.handlePending(t);return}if(hn(t)){this.handlePending(t);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(n,t){const{active:r,onPending:s}=this.props;s(r,n,this.initialCoordinates,t)}handleStart(){const{initialCoordinates:n}=this,{onStart:t}=this.props;n&&(this.activated=!0,this.documentListeners.add(re.Click,Vr,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(re.SelectionChange,this.removeTextSelection),t(n))}handleMove(n){var t;const{activated:r,initialCoordinates:s,props:o}=this,{onMove:i,options:{activationConstraint:a}}=o;if(!s)return;const l=(t=it(n))!=null?t:ae,u=st(s,l);if(!r&&a){if(hn(a)){if(a.tolerance!=null&&Tt(u,a.tolerance))return this.handleCancel();if(Tt(u,a.distance))return this.handleStart()}if(gn(a)&&Tt(u,a.tolerance))return this.handleCancel();this.handlePending(a,u);return}n.cancelable&&n.preventDefault(),i(l)}handleEnd(){const{onAbort:n,onEnd:t}=this.props;this.detach(),this.activated||n(this.props.active),t()}handleCancel(){const{onAbort:n,onCancel:t}=this.props;this.detach(),this.activated||n(this.props.active),t()}handleKeydown(n){n.code===k.Esc&&this.handleCancel()}removeTextSelection(){var n;(n=this.document.getSelection())==null||n.removeAllRanges()}}const Kr={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class lt extends At{constructor(n){const{event:t}=n,r=De(t.target);super(n,Kr,r)}}lt.activators=[{eventName:"onPointerDown",handler:(e,n)=>{let{nativeEvent:t}=e,{onActivation:r}=n;return!t.isPrimary||t.button!==0?!1:(r?.({event:t}),!0)}}];const Ur={move:{name:"mousemove"},end:{name:"mouseup"}};var Mt;(function(e){e[e.RightClick=2]="RightClick"})(Mt||(Mt={}));class qr extends At{constructor(n){super(n,Ur,De(n.event.target))}}qr.activators=[{eventName:"onMouseDown",handler:(e,n)=>{let{nativeEvent:t}=e,{onActivation:r}=n;return t.button===Mt.RightClick?!1:(r?.({event:t}),!0)}}];const It={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Xr extends At{constructor(n){super(n,It)}static setup(){return window.addEventListener(It.move.name,n,{capture:!1,passive:!1}),function(){window.removeEventListener(It.move.name,n)};function n(){}}}Xr.activators=[{eventName:"onTouchStart",handler:(e,n)=>{let{nativeEvent:t}=e,{onActivation:r}=n;const{touches:s}=t;return s.length>1?!1:(r?.({event:t}),!0)}}];var We;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(We||(We={}));var ct;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(ct||(ct={}));function Hr(e){let{acceleration:n,activator:t=We.Pointer,canScroll:r,draggingRect:s,enabled:o,interval:i=5,order:a=ct.TreeOrder,pointerCoordinates:l,scrollableAncestors:u,scrollableAncestorRects:d,delta:f,threshold:g}=e;const p=Gr({delta:f,disabled:!o}),[C,b]=lr(),x=c.useRef({x:0,y:0}),y=c.useRef({x:0,y:0}),v=c.useMemo(()=>{switch(t){case We.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case We.DraggableRect:return s}},[t,s,l]),m=c.useRef(null),S=c.useCallback(()=>{const T=m.current;if(!T)return;const O=x.current.x*y.current.x,N=x.current.y*y.current.y;T.scrollBy(O,N)},[]),E=c.useMemo(()=>a===ct.TreeOrder?[...u].reverse():u,[a,u]);c.useEffect(()=>{if(!o||!u.length||!v){b();return}for(const T of E){if(r?.(T)===!1)continue;const O=u.indexOf(T),N=d[O];if(!N)continue;const{direction:A,speed:I}=Lr(T,N,v,n,g);for(const M of["x","y"])p[M][A[M]]||(I[M]=0,A[M]=0);if(I.x>0||I.y>0){b(),m.current=T,C(S,i),x.current=I,y.current=A;return}}x.current={x:0,y:0},y.current={x:0,y:0},b()},[n,S,r,b,o,i,JSON.stringify(v),JSON.stringify(p),C,u,E,d,JSON.stringify(g)])}const Jr={x:{[W.Backward]:!1,[W.Forward]:!1},y:{[W.Backward]:!1,[W.Forward]:!1}};function Gr(e){let{delta:n,disabled:t}=e;const r=rt(n);return Fe(s=>{if(t||!r||!s)return Jr;const o={x:Math.sign(n.x-r.x),y:Math.sign(n.y-r.y)};return{x:{[W.Backward]:s.x[W.Backward]||o.x===-1,[W.Forward]:s.x[W.Forward]||o.x===1},y:{[W.Backward]:s.y[W.Backward]||o.y===-1,[W.Forward]:s.y[W.Forward]||o.y===1}}},[t,n,r])}function Zr(e,n){const t=n!=null?e.get(n):void 0,r=t?t.node.current:null;return Fe(s=>{var o;return n==null?null:(o=r??s)!=null?o:null},[r,n])}function Qr(e,n){return c.useMemo(()=>e.reduce((t,r)=>{const{sensor:s}=r,o=s.activators.map(i=>({eventName:i.eventName,handler:n(i.handler,r)}));return[...t,...o]},[]),[e,n])}var Ve;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Ve||(Ve={}));var jt;(function(e){e.Optimized="optimized"})(jt||(jt={}));const pn=new Map;function es(e,n){let{dragging:t,dependencies:r,config:s}=n;const[o,i]=c.useState(null),{frequency:a,measure:l,strategy:u}=s,d=c.useRef(e),f=x(),g=Pe(f),p=c.useCallback(function(y){y===void 0&&(y=[]),!g.current&&i(v=>v===null?y:v.concat(y.filter(m=>!v.includes(m))))},[g]),C=c.useRef(null),b=Fe(y=>{if(f&&!t)return pn;if(!y||y===pn||d.current!==e||o!=null){const v=new Map;for(let m of e){if(!m)continue;if(o&&o.length>0&&!o.includes(m.id)&&m.rect.current){v.set(m.id,m.rect.current);continue}const S=m.node.current,E=S?new Nt(l(S),S):null;m.rect.current=E,E&&v.set(m.id,E)}return v}return y},[e,o,t,f,l]);return c.useEffect(()=>{d.current=e},[e]),c.useEffect(()=>{f||p()},[t,f]),c.useEffect(()=>{o&&o.length>0&&i(null)},[JSON.stringify(o)]),c.useEffect(()=>{f||typeof a!="number"||C.current!==null||(C.current=setTimeout(()=>{p(),C.current=null},a))},[a,f,p,...r]),{droppableRects:b,measureDroppableContainers:p,measuringScheduled:o!=null};function x(){switch(u){case Ve.Always:return!1;case Ve.BeforeDragging:return t;default:return!t}}}function kt(e,n){return Fe(t=>e?t||(typeof n=="function"?n(e):e):null,[n,e])}function ts(e,n){return kt(e,n)}function ns(e){let{callback:n,disabled:t}=e;const r=tt(n),s=c.useMemo(()=>{if(t||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:o}=window;return new o(r)},[r,t]);return c.useEffect(()=>()=>s?.disconnect(),[s]),s}function ut(e){let{callback:n,disabled:t}=e;const r=tt(n),s=c.useMemo(()=>{if(t||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:o}=window;return new o(r)},[t]);return c.useEffect(()=>()=>s?.disconnect(),[s]),s}function rs(e){return new Nt(Ne(e),e)}function mn(e,n,t){n===void 0&&(n=rs);const[r,s]=c.useState(null);function o(){s(l=>{if(!e)return null;if(e.isConnected===!1){var u;return(u=l??t)!=null?u:null}const d=n(e);return JSON.stringify(l)===JSON.stringify(d)?l:d})}const i=ns({callback(l){if(e)for(const u of l){const{type:d,target:f}=u;if(d==="childList"&&f instanceof HTMLElement&&f.contains(e)){o();break}}}}),a=ut({callback:o});return ie(()=>{o(),e?(a?.observe(e),i?.observe(document.body,{childList:!0,subtree:!0})):(a?.disconnect(),i?.disconnect())},[e]),r}function ss(e){const n=kt(e);return Qt(e,n)}const vn=[];function os(e){const n=c.useRef(e),t=Fe(r=>e?r&&r!==vn&&e&&n.current&&e.parentNode===n.current.parentNode?r:Et(e):vn,[e]);return c.useEffect(()=>{n.current=e},[e]),t}function is(e){const[n,t]=c.useState(null),r=c.useRef(e),s=c.useCallback(o=>{const i=Dt(o.target);i&&t(a=>a?(a.set(i,Ot(i)),new Map(a)):null)},[]);return c.useEffect(()=>{const o=r.current;if(e!==o){i(o);const a=e.map(l=>{const u=Dt(l);return u?(u.addEventListener("scroll",s,{passive:!0}),[u,Ot(u)]):null}).filter(l=>l!=null);t(a.length?new Map(a):null),r.current=e}return()=>{i(e),i(o)};function i(a){a.forEach(l=>{const u=Dt(l);u?.removeEventListener("scroll",s)})}},[s,e]),c.useMemo(()=>e.length?n?Array.from(n.values()).reduce((o,i)=>Oe(o,i),ae):ln(e):ae,[e,n])}function bn(e,n){n===void 0&&(n=[]);const t=c.useRef(null);return c.useEffect(()=>{t.current=null},n),c.useEffect(()=>{const r=e!==ae;r&&!t.current&&(t.current=e),!r&&t.current&&(t.current=null)},[e]),t.current?st(e,t.current):ae}function as(e){c.useEffect(()=>{if(!et)return;const n=e.map(t=>{let{sensor:r}=t;return r.setup==null?void 0:r.setup()});return()=>{for(const t of n)t?.()}},e.map(n=>{let{sensor:t}=n;return t}))}function ls(e,n){return c.useMemo(()=>e.reduce((t,r)=>{let{eventName:s,handler:o}=r;return t[s]=i=>{o(i,n)},t},{}),[e,n])}function yn(e){return c.useMemo(()=>e?kr(e):null,[e])}const xn=[];function cs(e,n){n===void 0&&(n=Ne);const[t]=e,r=yn(t?X(t):null),[s,o]=c.useState(xn);function i(){o(()=>e.length?e.map(l=>on(l)?r:new Nt(n(l),l)):xn)}const a=ut({callback:i});return ie(()=>{a?.disconnect(),i(),e.forEach(l=>a?.observe(l))},[e]),s}function wn(e){if(!e)return null;if(e.children.length>1)return e;const n=e.children[0];return Le(n)?n:e}function us(e){let{measure:n}=e;const[t,r]=c.useState(null),s=c.useCallback(u=>{for(const{target:d}of u)if(Le(d)){r(f=>{const g=n(d);return f?{...f,width:g.width,height:g.height}:g});break}},[n]),o=ut({callback:s}),i=c.useCallback(u=>{const d=wn(u);o?.disconnect(),d&&o?.observe(d),r(d?n(d):null)},[n,o]),[a,l]=nt(i);return c.useMemo(()=>({nodeRef:a,rect:t,setRef:l}),[t,a,l])}const ds=[{sensor:lt,options:{}},{sensor:fn,options:{}}],fs={current:{}},dt={draggable:{measure:tn},droppable:{measure:tn,strategy:Ve.WhileDragging,frequency:jt.Optimized},dragOverlay:{measure:Ne}};class Ye extends Map{get(n){var t;return n!=null&&(t=super.get(n))!=null?t:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(n=>{let{disabled:t}=n;return!t})}getNodeFor(n){var t,r;return(t=(r=this.get(n))==null?void 0:r.node.current)!=null?t:void 0}}const hs={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Ye,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:at},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:dt,measureDroppableContainers:at,windowRect:null,measuringScheduled:!1},Cn={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:at,draggableNodes:new Map,over:null,measureDroppableContainers:at},Ke=c.createContext(Cn),Sn=c.createContext(hs);function gs(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Ye}}}function ps(e,n){switch(n.type){case $.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:n.initialCoordinates,active:n.active}};case $.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:n.coordinates.x-e.draggable.initialCoordinates.x,y:n.coordinates.y-e.draggable.initialCoordinates.y}}};case $.DragEnd:case $.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case $.RegisterDroppable:{const{element:t}=n,{id:r}=t,s=new Ye(e.droppable.containers);return s.set(r,t),{...e,droppable:{...e.droppable,containers:s}}}case $.SetDroppableDisabled:{const{id:t,key:r,disabled:s}=n,o=e.droppable.containers.get(t);if(!o||r!==o.key)return e;const i=new Ye(e.droppable.containers);return i.set(t,{...o,disabled:s}),{...e,droppable:{...e.droppable,containers:i}}}case $.UnregisterDroppable:{const{id:t,key:r}=n,s=e.droppable.containers.get(t);if(!s||r!==s.key)return e;const o=new Ye(e.droppable.containers);return o.delete(t),{...e,droppable:{...e.droppable,containers:o}}}default:return e}}function ms(e){let{disabled:n}=e;const{active:t,activatorEvent:r,draggableNodes:s}=c.useContext(Ke),o=rt(r),i=rt(t?.id);return c.useEffect(()=>{if(!n&&!r&&o&&i!=null){if(!ot(o)||document.activeElement===o.target)return;const a=s.get(i);if(!a)return;const{activatorNode:l,node:u}=a;if(!l.current&&!u.current)return;requestAnimationFrame(()=>{for(const d of[l.current,u.current]){if(!d)continue;const f=dr(d);if(f){f.focus();break}}})}},[r,n,s,i,o]),null}function En(e,n){let{transform:t,...r}=n;return e!=null&&e.length?e.reduce((s,o)=>o({transform:s,...r}),t):t}function vs(e){return c.useMemo(()=>({draggable:{...dt.draggable,...e?.draggable},droppable:{...dt.droppable,...e?.droppable},dragOverlay:{...dt.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function bs(e){let{activeNode:n,measure:t,initialRect:r,config:s=!0}=e;const o=c.useRef(!1),{x:i,y:a}=typeof s=="boolean"?{x:s,y:s}:s;ie(()=>{if(!i&&!a||!n){o.current=!1;return}if(o.current||!r)return;const u=n?.node.current;if(!u||u.isConnected===!1)return;const d=t(u),f=Qt(d,r);if(i||(f.x=0),a||(f.y=0),o.current=!0,Math.abs(f.x)>0||Math.abs(f.y)>0){const g=nn(u);g&&g.scrollBy({top:f.y,left:f.x})}},[n,i,a,r,t])}const ft=c.createContext({...ae,scaleX:1,scaleY:1});var pe;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(pe||(pe={}));const Dn=c.memo(function(n){var t,r,s,o;let{id:i,accessibility:a,autoScroll:l=!0,children:u,sensors:d=ds,collisionDetection:f=Nr,measuring:g,modifiers:p,...C}=n;const b=c.useReducer(ps,void 0,gs),[x,y]=b,[v,m]=vr(),[S,E]=c.useState(pe.Uninitialized),T=S===pe.Initialized,{draggable:{active:O,nodes:N,translate:A},droppable:{containers:I}}=x,M=O!=null?N.get(O):null,z=c.useRef({initial:null,translated:null}),P=c.useMemo(()=>{var q;return O!=null?{id:O,data:(q=M?.data)!=null?q:fs,rect:z}:null},[O,M]),V=c.useRef(null),[H,Z]=c.useState(null),[K,Ce]=c.useState(null),se=Pe(C,Object.values(C)),me=Be("DndDescribedBy",i),h=c.useMemo(()=>I.getEnabled(),[I]),D=vs(g),{droppableRects:j,measureDroppableContainers:R,measuringScheduled:le}=es(h,{dragging:T,dependencies:[A.x,A.y],config:D.droppable}),U=Zr(N,O),L=c.useMemo(()=>K?it(K):null,[K]),J=Oo(),Q=ts(U,D.draggable.measure);bs({activeNode:O!=null?N.get(O):null,config:J.layoutShiftCompensation,initialRect:Q,measure:D.draggable.measure});const _=mn(U,D.draggable.measure,Q),Ue=mn(U?U.parentElement:null),ce=c.useRef({activatorEvent:null,active:null,activeNode:U,collisionRect:null,collisions:null,droppableRects:j,draggableNodes:N,draggingNode:null,draggingNodeRect:null,droppableContainers:I,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Ae=I.getNodeFor((t=ce.current.over)==null?void 0:t.id),he=us({measure:D.dragOverlay.measure}),Me=(r=he.nodeRef.current)!=null?r:U,Ie=T?(s=he.rect)!=null?s:_:null,qn=!!(he.nodeRef.current&&he.rect),Xn=ss(qn?null:_),Lt=yn(Me?X(Me):null),ve=os(T?Ae??U:null),vt=cs(ve),bt=En(p,{transform:{x:A.x-Xn.x,y:A.y-Xn.y,scaleX:1,scaleY:1},activatorEvent:K,active:P,activeNodeRect:_,containerNodeRect:Ue,draggingNodeRect:Ie,over:ce.current.over,overlayNodeRect:he.rect,scrollableAncestors:ve,scrollableAncestorRects:vt,windowRect:Lt}),Hn=L?Oe(L,A):null,Jn=is(ve),yo=bn(Jn),xo=bn(Jn,[_]),je=Oe(bt,yo),ke=Ie?Mr(Ie,bt):null,qe=P&&ke?f({active:P,collisionRect:ke,droppableRects:j,droppableContainers:h,pointerCoordinates:Hn}):null,Gn=Dr(qe,"id"),[be,Zn]=c.useState(null),wo=qn?bt:Oe(bt,xo),Co=Tr(wo,(o=be?.rect)!=null?o:null,_),Pt=c.useRef(null),Qn=c.useCallback((q,ee)=>{let{sensor:te,options:ye}=ee;if(V.current==null)return;const oe=N.get(V.current);if(!oe)return;const ne=q.nativeEvent,ue=new te({active:V.current,activeNode:oe,event:ne,options:ye,context:ce,onAbort(Y){if(!N.get(Y))return;const{onDragAbort:de}=se.current,ge={id:Y};de?.(ge),v({type:"onDragAbort",event:ge})},onPending(Y,xe,de,ge){if(!N.get(Y))return;const{onDragPending:He}=se.current,we={id:Y,constraint:xe,initialCoordinates:de,offset:ge};He?.(we),v({type:"onDragPending",event:we})},onStart(Y){const xe=V.current;if(xe==null)return;const de=N.get(xe);if(!de)return;const{onDragStart:ge}=se.current,Xe={activatorEvent:ne,active:{id:xe,data:de.data,rect:z}};Se.unstable_batchedUpdates(()=>{ge?.(Xe),E(pe.Initializing),y({type:$.DragStart,initialCoordinates:Y,active:xe}),v({type:"onDragStart",event:Xe}),Z(Pt.current),Ce(ne)})},onMove(Y){y({type:$.DragMove,coordinates:Y})},onEnd:_e($.DragEnd),onCancel:_e($.DragCancel)});Pt.current=ue;function _e(Y){return async function(){const{active:de,collisions:ge,over:Xe,scrollAdjustedTranslate:He}=ce.current;let we=null;if(de&&He){const{cancelDrop:Je}=se.current;we={activatorEvent:ne,active:de,collisions:ge,delta:He,over:Xe},Y===$.DragEnd&&typeof Je=="function"&&await Promise.resolve(Je(we))&&(Y=$.DragCancel)}V.current=null,Se.unstable_batchedUpdates(()=>{y({type:Y}),E(pe.Uninitialized),Zn(null),Z(null),Ce(null),Pt.current=null;const Je=Y===$.DragEnd?"onDragEnd":"onDragCancel";if(we){const Ft=se.current[Je];Ft?.(we),v({type:Je,event:we})}})}}},[N]),So=c.useCallback((q,ee)=>(te,ye)=>{const oe=te.nativeEvent,ne=N.get(ye);if(V.current!==null||!ne||oe.dndKit||oe.defaultPrevented)return;const ue={active:ne};q(te,ee.options,ue)===!0&&(oe.dndKit={capturedBy:ee.sensor},V.current=ye,Qn(te,ee))},[N,Qn]),er=Qr(d,So);as(d),ie(()=>{_&&S===pe.Initializing&&E(pe.Initialized)},[_,S]),c.useEffect(()=>{const{onDragMove:q}=se.current,{active:ee,activatorEvent:te,collisions:ye,over:oe}=ce.current;if(!ee||!te)return;const ne={active:ee,activatorEvent:te,collisions:ye,delta:{x:je.x,y:je.y},over:oe};Se.unstable_batchedUpdates(()=>{q?.(ne),v({type:"onDragMove",event:ne})})},[je.x,je.y]),c.useEffect(()=>{const{active:q,activatorEvent:ee,collisions:te,droppableContainers:ye,scrollAdjustedTranslate:oe}=ce.current;if(!q||V.current==null||!ee||!oe)return;const{onDragOver:ne}=se.current,ue=ye.get(Gn),_e=ue&&ue.rect.current?{id:ue.id,rect:ue.rect.current,data:ue.data,disabled:ue.disabled}:null,Y={active:q,activatorEvent:ee,collisions:te,delta:{x:oe.x,y:oe.y},over:_e};Se.unstable_batchedUpdates(()=>{Zn(_e),ne?.(Y),v({type:"onDragOver",event:Y})})},[Gn]),ie(()=>{ce.current={activatorEvent:K,active:P,activeNode:U,collisionRect:ke,collisions:qe,droppableRects:j,draggableNodes:N,draggingNode:Me,draggingNodeRect:Ie,droppableContainers:I,over:be,scrollableAncestors:ve,scrollAdjustedTranslate:je},z.current={initial:Ie,translated:ke}},[P,U,qe,ke,N,Me,Ie,j,I,be,ve,je]),Hr({...J,delta:A,draggingRect:ke,pointerCoordinates:Hn,scrollableAncestors:ve,scrollableAncestorRects:vt});const Eo=c.useMemo(()=>({active:P,activeNode:U,activeNodeRect:_,activatorEvent:K,collisions:qe,containerNodeRect:Ue,dragOverlay:he,draggableNodes:N,droppableContainers:I,droppableRects:j,over:be,measureDroppableContainers:R,scrollableAncestors:ve,scrollableAncestorRects:vt,measuringConfiguration:D,measuringScheduled:le,windowRect:Lt}),[P,U,_,K,qe,Ue,he,N,I,j,be,R,ve,vt,D,le,Lt]),Do=c.useMemo(()=>({activatorEvent:K,activators:er,active:P,activeNodeRect:_,ariaDescribedById:{draggable:me},dispatch:y,draggableNodes:N,over:be,measureDroppableContainers:R}),[K,er,P,_,y,me,N,be,R]);return c.createElement(Xt.Provider,{value:m},c.createElement(Ke.Provider,{value:Do},c.createElement(Sn.Provider,{value:Eo},c.createElement(ft.Provider,{value:Co},u)),c.createElement(ms,{disabled:a?.restoreFocus===!1})),c.createElement(xr,{...a,hiddenTextDescribedById:me}));function Oo(){const q=H?.autoScrollEnabled===!1,ee=typeof l=="object"?l.enabled===!1:l===!1,te=T&&!q&&!ee;return typeof l=="object"?{...l,enabled:te}:{enabled:te}}}),ys=c.createContext(null),On="button",xs="Draggable";function ws(e){let{id:n,data:t,disabled:r=!1,attributes:s}=e;const o=Be(xs),{activators:i,activatorEvent:a,active:l,activeNodeRect:u,ariaDescribedById:d,draggableNodes:f,over:g}=c.useContext(Ke),{role:p=On,roleDescription:C="draggable",tabIndex:b=0}=s??{},x=l?.id===n,y=c.useContext(x?ft:ys),[v,m]=nt(),[S,E]=nt(),T=ls(i,n),O=Pe(t);ie(()=>(f.set(n,{id:n,key:o,node:v,activatorNode:S,data:O}),()=>{const A=f.get(n);A&&A.key===o&&f.delete(n)}),[f,n]);const N=c.useMemo(()=>({role:p,tabIndex:b,"aria-disabled":r,"aria-pressed":x&&p===On?!0:void 0,"aria-roledescription":C,"aria-describedby":d.draggable}),[r,p,b,x,C,d.draggable]);return{active:l,activatorEvent:a,activeNodeRect:u,attributes:N,isDragging:x,listeners:r?void 0:T,node:v,over:g,setNodeRef:m,setActivatorNodeRef:E,transform:y}}function Nn(){return c.useContext(Sn)}const Cs="Droppable",Ss={timeout:25};function Es(e){let{data:n,disabled:t=!1,id:r,resizeObserverConfig:s}=e;const o=Be(Cs),{active:i,dispatch:a,over:l,measureDroppableContainers:u}=c.useContext(Ke),d=c.useRef({disabled:t}),f=c.useRef(!1),g=c.useRef(null),p=c.useRef(null),{disabled:C,updateMeasurementsFor:b,timeout:x}={...Ss,...s},y=Pe(b??r),v=c.useCallback(()=>{if(!f.current){f.current=!0;return}p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{u(Array.isArray(y.current)?y.current:[y.current]),p.current=null},x)},[x]),m=ut({callback:v,disabled:C||!i}),S=c.useCallback((N,A)=>{m&&(A&&(m.unobserve(A),f.current=!1),N&&m.observe(N))},[m]),[E,T]=nt(S),O=Pe(n);return c.useEffect(()=>{!m||!E.current||(m.disconnect(),f.current=!1,m.observe(E.current))},[E,m]),c.useEffect(()=>(a({type:$.RegisterDroppable,element:{id:r,key:o,disabled:t,node:E,rect:g,data:O}}),()=>a({type:$.UnregisterDroppable,key:o,id:r})),[r]),c.useEffect(()=>{t!==d.current.disabled&&(a({type:$.SetDroppableDisabled,id:r,key:o,disabled:t}),d.current.disabled=t)},[r,o,t,a]),{active:i,rect:g,isOver:l?.id===r,node:E,over:l,setNodeRef:T}}function Ds(e){let{animation:n,children:t}=e;const[r,s]=c.useState(null),[o,i]=c.useState(null),a=rt(t);return!t&&!r&&a&&s(a),ie(()=>{if(!o)return;const l=r?.key,u=r?.props.id;if(l==null||u==null){s(null);return}Promise.resolve(n(u,o)).then(()=>{s(null)})},[n,r,o]),c.createElement(c.Fragment,null,t,r?c.cloneElement(r,{ref:i}):null)}const Os={x:0,y:0,scaleX:1,scaleY:1};function Ns(e){let{children:n}=e;return c.createElement(Ke.Provider,{value:Cn},c.createElement(ft.Provider,{value:Os},n))}const Ts={position:"fixed",touchAction:"none"},As=e=>ot(e)?"transform 250ms ease":void 0,Ms=c.forwardRef((e,n)=>{let{as:t,activatorEvent:r,adjustScale:s,children:o,className:i,rect:a,style:l,transform:u,transition:d=As}=e;if(!a)return null;const f=s?u:{...u,scaleX:1,scaleY:1},g={...Ts,width:a.width,height:a.height,top:a.top,left:a.left,transform:fe.Transform.toString(f),transformOrigin:s&&r?Cr(r,a):void 0,transition:typeof d=="function"?d(r):d,...l};return c.createElement(t,{className:i,style:g,ref:n},o)}),Is={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:n,final:t}}=e;return[{transform:fe.Transform.toString(n)},{transform:fe.Transform.toString(t)}]},sideEffects:(e=>n=>{let{active:t,dragOverlay:r}=n;const s={},{styles:o,className:i}=e;if(o!=null&&o.active)for(const[a,l]of Object.entries(o.active))l!==void 0&&(s[a]=t.node.style.getPropertyValue(a),t.node.style.setProperty(a,l));if(o!=null&&o.dragOverlay)for(const[a,l]of Object.entries(o.dragOverlay))l!==void 0&&r.node.style.setProperty(a,l);return i!=null&&i.active&&t.node.classList.add(i.active),i!=null&&i.dragOverlay&&r.node.classList.add(i.dragOverlay),function(){for(const[l,u]of Object.entries(s))t.node.style.setProperty(l,u);i!=null&&i.active&&t.node.classList.remove(i.active)}})({styles:{active:{opacity:"0"}}})};function js(e){let{config:n,draggableNodes:t,droppableContainers:r,measuringConfiguration:s}=e;return tt((o,i)=>{if(n===null)return;const a=t.get(o);if(!a)return;const l=a.node.current;if(!l)return;const u=wn(i);if(!u)return;const{transform:d}=X(i).getComputedStyle(i),f=en(d);if(!f)return;const g=typeof n=="function"?n:ks(n);return cn(l,s.draggable.measure),g({active:{id:o,data:a.data,node:l,rect:s.draggable.measure(l)},draggableNodes:t,dragOverlay:{node:i,rect:s.dragOverlay.measure(u)},droppableContainers:r,measuringConfiguration:s,transform:f})})}function ks(e){const{duration:n,easing:t,sideEffects:r,keyframes:s}={...Is,...e};return o=>{let{active:i,dragOverlay:a,transform:l,...u}=o;if(!n)return;const d={x:a.rect.left-i.rect.left,y:a.rect.top-i.rect.top},f={scaleX:l.scaleX!==1?i.rect.width*l.scaleX/a.rect.width:1,scaleY:l.scaleY!==1?i.rect.height*l.scaleY/a.rect.height:1},g={x:l.x-d.x,y:l.y-d.y,...f},p=s({...u,active:i,dragOverlay:a,transform:{initial:l,final:g}}),[C]=p,b=p[p.length-1];if(JSON.stringify(C)===JSON.stringify(b))return;const x=r?.({active:i,dragOverlay:a,...u}),y=a.node.animate(p,{duration:n,easing:t,fill:"forwards"});return new Promise(v=>{y.onfinish=()=>{x?.(),v()}})}}let Tn=0;function _s(e){return c.useMemo(()=>{if(e!=null)return Tn++,Tn},[e])}const An=c.memo(e=>{let{adjustScale:n=!1,children:t,dropAnimation:r,style:s,transition:o,modifiers:i,wrapperElement:a="div",className:l,zIndex:u=999}=e;const{activatorEvent:d,active:f,activeNodeRect:g,containerNodeRect:p,draggableNodes:C,droppableContainers:b,dragOverlay:x,over:y,measuringConfiguration:v,scrollableAncestors:m,scrollableAncestorRects:S,windowRect:E}=Nn(),T=c.useContext(ft),O=_s(f?.id),N=En(i,{activatorEvent:d,active:f,activeNodeRect:g,containerNodeRect:p,draggingNodeRect:x.rect,over:y,overlayNodeRect:x.rect,scrollableAncestors:m,scrollableAncestorRects:S,transform:T,windowRect:E}),A=kt(g),I=js({config:r,draggableNodes:C,droppableContainers:b,measuringConfiguration:v}),M=A?x.setRef:void 0;return c.createElement(Ns,null,c.createElement(Ds,{animation:I},f&&O?c.createElement(Ms,{key:O,id:f.id,ref:M,as:a,activatorEvent:d,adjustScale:n,className:l,transition:o,rect:A,style:{zIndex:u,...s},transform:N},t):null))});function ht(e,n,t){const r=e.slice();return r.splice(t<0?r.length+t:t,0,r.splice(n,1)[0]),r}function Rs(e,n){return e.reduce((t,r,s)=>{const o=n.get(r);return o&&(t[s]=o),t},Array(e.length))}function gt(e){return e!==null&&e>=0}function zs(e,n){if(e===n)return!0;if(e.length!==n.length)return!1;for(let t=0;t<e.length;t++)if(e[t]!==n[t])return!1;return!0}function Ls(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const Mn=e=>{let{rects:n,activeIndex:t,overIndex:r,index:s}=e;const o=ht(n,r,t),i=n[s],a=o[s];return!a||!i?null:{x:a.left-i.left,y:a.top-i.top,scaleX:a.width/i.width,scaleY:a.height/i.height}},pt={scaleX:1,scaleY:1},In=e=>{var n;let{activeIndex:t,activeNodeRect:r,index:s,rects:o,overIndex:i}=e;const a=(n=o[t])!=null?n:r;if(!a)return null;if(s===t){const u=o[i];return u?{x:0,y:t<i?u.top+u.height-(a.top+a.height):u.top-a.top,...pt}:null}const l=Ps(o,s,t);return s>t&&s<=i?{x:0,y:-a.height-l,...pt}:s<t&&s>=i?{x:0,y:a.height+l,...pt}:{x:0,y:0,...pt}};function Ps(e,n,t){const r=e[n],s=e[n-1],o=e[n+1];return r?t<n?s?r.top-(s.top+s.height):o?o.top-(r.top+r.height):0:o?o.top-(r.top+r.height):s?r.top-(s.top+s.height):0:0}const jn="Sortable",kn=c.createContext({activeIndex:-1,containerId:jn,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Mn,disabled:{draggable:!1,droppable:!1}});function _n(e){let{children:n,id:t,items:r,strategy:s=Mn,disabled:o=!1}=e;const{active:i,dragOverlay:a,droppableRects:l,over:u,measureDroppableContainers:d}=Nn(),f=Be(jn,t),g=a.rect!==null,p=c.useMemo(()=>r.map(T=>typeof T=="object"&&"id"in T?T.id:T),[r]),C=i!=null,b=i?p.indexOf(i.id):-1,x=u?p.indexOf(u.id):-1,y=c.useRef(p),v=!zs(p,y.current),m=x!==-1&&b===-1||v,S=Ls(o);ie(()=>{v&&C&&d(p)},[v,p,C,d]),c.useEffect(()=>{y.current=p},[p]);const E=c.useMemo(()=>({activeIndex:b,containerId:f,disabled:S,disableTransforms:m,items:p,overIndex:x,useDragOverlay:g,sortedRects:Rs(p,l),strategy:s}),[b,f,S.draggable,S.droppable,m,p,x,l,g,s]);return c.createElement(kn.Provider,{value:E},n)}const Fs=e=>{let{id:n,items:t,activeIndex:r,overIndex:s}=e;return ht(t,r,s).indexOf(n)},Bs=e=>{let{containerId:n,isSorting:t,wasDragging:r,index:s,items:o,newIndex:i,previousItems:a,previousContainerId:l,transition:u}=e;return!u||!r||a!==o&&s===i?!1:t?!0:i!==s&&n===l},$s={duration:200,easing:"ease"},Rn="transform",Ws=fe.Transition.toString({property:Rn,duration:0,easing:"linear"}),Vs={roleDescription:"sortable"};function Ys(e){let{disabled:n,index:t,node:r,rect:s}=e;const[o,i]=c.useState(null),a=c.useRef(t);return ie(()=>{if(!n&&t!==a.current&&r.current){const l=s.current;if(l){const u=Ne(r.current,{ignoreTransform:!0}),d={x:l.left-u.left,y:l.top-u.top,scaleX:l.width/u.width,scaleY:l.height/u.height};(d.x||d.y)&&i(d)}}t!==a.current&&(a.current=t)},[n,t,r,s]),c.useEffect(()=>{o&&i(null)},[o]),o}function mt(e){let{animateLayoutChanges:n=Bs,attributes:t,disabled:r,data:s,getNewIndex:o=Fs,id:i,strategy:a,resizeObserverConfig:l,transition:u=$s}=e;const{items:d,containerId:f,activeIndex:g,disabled:p,disableTransforms:C,sortedRects:b,overIndex:x,useDragOverlay:y,strategy:v}=c.useContext(kn),m=Ks(r,p),S=d.indexOf(i),E=c.useMemo(()=>({sortable:{containerId:f,index:S,items:d},...s}),[f,s,S,d]),T=c.useMemo(()=>d.slice(d.indexOf(i)),[d,i]),{rect:O,node:N,isOver:A,setNodeRef:I}=Es({id:i,data:E,disabled:m.droppable,resizeObserverConfig:{updateMeasurementsFor:T,...l}}),{active:M,activatorEvent:z,activeNodeRect:P,attributes:V,setNodeRef:H,listeners:Z,isDragging:K,over:Ce,setActivatorNodeRef:se,transform:me}=ws({id:i,data:E,attributes:{...Vs,...t},disabled:m.draggable}),h=ar(I,H),D=!!M,j=D&&!C&>(g)&>(x),R=!y&&K,le=R&&j?me:null,L=j?le??(a??v)({rects:b,activeNodeRect:P,activeIndex:g,overIndex:x,index:S}):null,J=gt(g)&>(x)?o({id:i,items:d,activeIndex:g,overIndex:x}):S,Q=M?.id,_=c.useRef({activeId:Q,items:d,newIndex:J,containerId:f}),Ue=d!==_.current.items,ce=n({active:M,containerId:f,isDragging:K,isSorting:D,id:i,index:S,items:d,newIndex:_.current.newIndex,previousItems:_.current.items,previousContainerId:_.current.containerId,transition:u,wasDragging:_.current.activeId!=null}),Ae=Ys({disabled:!ce,index:S,node:N,rect:O});return c.useEffect(()=>{D&&_.current.newIndex!==J&&(_.current.newIndex=J),f!==_.current.containerId&&(_.current.containerId=f),d!==_.current.items&&(_.current.items=d)},[D,J,f,d]),c.useEffect(()=>{if(Q===_.current.activeId)return;if(Q!=null&&_.current.activeId==null){_.current.activeId=Q;return}const Me=setTimeout(()=>{_.current.activeId=Q},50);return()=>clearTimeout(Me)},[Q]),{active:M,activeIndex:g,attributes:V,data:E,rect:O,index:S,newIndex:J,items:d,isOver:A,isSorting:D,isDragging:K,listeners:Z,node:N,overIndex:x,over:Ce,setNodeRef:h,setActivatorNodeRef:se,setDroppableNodeRef:I,setDraggableNodeRef:H,transform:Ae??L,transition:he()};function he(){if(Ae||Ue&&_.current.newIndex===S)return Ws;if(!(R&&!ot(z)||!u)&&(D||ce))return fe.Transition.toString({...u,property:Rn})}}function Ks(e,n){var t,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(t=e?.draggable)!=null?t:n.draggable,droppable:(r=e?.droppable)!=null?r:n.droppable}}k.Down,k.Right,k.Up,k.Left;const zn=(...e)=>e.filter(Boolean).join(" ");function Ln({card:e}){const{attributes:n,listeners:t,setNodeRef:r,transform:s,transition:o,isDragging:i}=mt({id:e.id}),a={transform:fe.Transform.toString(s),transition:o,opacity:i?.5:void 0};return w.jsx("div",{ref:r,style:a,...n,...t,children:w.jsxs(B.Card,{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:[w.jsxs(B.CardHeader,{className:"p-4",children:[w.jsx(B.CardTitle,{className:"text-sm font-medium font-mono tracking-tight text-foreground group-hover:text-primary transition-colors",children:e.title}),e.description&&w.jsx(B.CardDescription,{className:"text-xs text-muted-foreground font-mono",children:e.description})]}),e.badges&&e.badges.length>0&&w.jsx(B.CardContent,{className:"p-4 pt-0",children:w.jsx("div",{className:"flex flex-wrap gap-1",children:e.badges.map((l,u)=>w.jsx(B.Badge,{variant:l.variant||"default",className:"text-xs",children:l.label},u))})})]})})}function Us({column:e,cards:n}){const t=n||[],{setNodeRef:r}=mt({id:e.id,data:{type:"column"}}),s=e.limit&&t.length>=e.limit;return w.jsxs("div",{ref:r,className:zn("flex flex-col w-80 flex-shrink-0 rounded-lg border border-border bg-card/20 backdrop-blur-sm shadow-xl",e.className),children:[w.jsx("div",{className:"p-4 border-b border-border/50 bg-muted/20",children:w.jsxs("div",{className:"flex items-center justify-between",children:[w.jsx("h3",{className:"font-mono text-sm font-semibold tracking-wider text-primary/90 uppercase",children:e.title}),w.jsxs("div",{className:"flex items-center gap-2",children:[w.jsxs("span",{className:"font-mono text-xs text-muted-foreground",children:[t.length,e.limit&&` / ${e.limit}`]}),s&&w.jsx(B.Badge,{variant:"destructive",className:"text-xs",children:"Full"})]})]})}),w.jsx(B.ScrollArea,{className:"flex-1 p-4",children:w.jsx(_n,{items:t.map(o=>o.id),strategy:In,children:w.jsx("div",{className:"space-y-2",children:t.map(o=>w.jsx(Ln,{card:o},o.id))})})})]})}function qs({columns:e,onCardMove:n,className:t}){const[r,s]=F.useState(null),o=F.useMemo(()=>(e||[]).map(C=>({...C,cards:C.cards||[]})),[e]),[i,a]=F.useState(o);F.useEffect(()=>{a(o)},[o]);const l=Jt(Ht(lt,{activationConstraint:{distance:8}})),u=C=>{const{active:b}=C,x=f(b.id);s(x)},d=C=>{const{active:b,over:x}=C;if(s(null),!x)return;const y=b.id,v=x.id;if(y===v)return;const m=g(y),S=g(v)||p(v);if(!(!m||!S))if(m.id===S.id){const E=[...m.cards],T=E.findIndex(A=>A.id===y),O=E.findIndex(A=>A.id===v),N=ht(E,T,O);a(A=>A.map(I=>I.id===m.id?{...I,cards:N}:I))}else{const E=[...m.cards],T=[...S.cards],O=E.findIndex(M=>M.id===y),A=v===S.id?T.length:T.findIndex(M=>M.id===v),[I]=E.splice(O,1);T.splice(A,0,I),a(M=>M.map(z=>z.id===m.id?{...z,cards:E}:z.id===S.id?{...z,cards:T}:z)),n&&n(y,m.id,S.id,A)}},f=F.useCallback(C=>{for(const b of i){const x=b.cards.find(y=>y.id===C);if(x)return x}return null},[i]),g=F.useCallback(C=>i.find(b=>b.cards.some(x=>x.id===C))||null,[i]),p=F.useCallback(C=>i.find(b=>b.id===C)||null,[i]);return w.jsxs(Dn,{sensors:l,collisionDetection:Zt,onDragStart:u,onDragEnd:d,children:[w.jsx("div",{className:zn("flex gap-4 overflow-x-auto p-4",t),children:i.map(C=>w.jsx(Us,{column:C,cards:C.cards},C.id))}),w.jsx(An,{children:r?w.jsx(Ln,{card:r}):null})]})}const Xs=Object.freeze(Object.defineProperty({__proto__:null,default:qs},Symbol.toStringTag,{value:"Module"}));function Te(e,n,t){let r=t.initialDeps??[],s,o=!0;function i(){var a,l,u;let d;t.key&&((a=t.debug)!=null&&a.call(t))&&(d=Date.now());const f=e();if(!(f.length!==r.length||f.some((C,b)=>r[b]!==C)))return s;r=f;let p;if(t.key&&((l=t.debug)!=null&&l.call(t))&&(p=Date.now()),s=n(...f),t.key&&((u=t.debug)!=null&&u.call(t))){const C=Math.round((Date.now()-d)*100)/100,b=Math.round((Date.now()-p)*100)/100,x=b/16,y=(v,m)=>{for(v=String(v);v.length<m;)v=" "+v;return v};console.info(`%c⏱ ${y(b,5)} /${y(C,5)} ms`,`
|
|
11
11
|
font-size: .6rem;
|
|
12
12
|
font-weight: bold;
|
|
13
|
-
color: hsl(${Math.max(0,Math.min(120-120*x,120))}deg 100% 31%);`,t?.key)}return t?.onChange&&!(o&&t.skipInitialOnChange)&&t.onChange(s),o=!1,s}return i.updateDeps=a=>{r=a},i}function Pn(e,n){if(e===void 0)throw new Error("Unexpected undefined");return e}const Hs=(e,n)=>Math.abs(e-n)<1.01,Js=(e,n,t)=>{let r;return function(...s){e.clearTimeout(r),r=e.setTimeout(()=>n.apply(this,s),t)}},Fn=e=>{const{offsetWidth:n,offsetHeight:t}=e;return{width:n,height:t}},Gs=e=>e,Zs=e=>{const n=Math.max(e.startIndex-e.overscan,0),t=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let s=n;s<=t;s++)r.push(s);return r},Qs=(e,n)=>{const t=e.scrollElement;if(!t)return;const r=e.targetWindow;if(!r)return;const s=i=>{const{width:a,height:l}=i;n({width:Math.round(a),height:Math.round(l)})};if(s(Fn(t)),!r.ResizeObserver)return()=>{};const o=new r.ResizeObserver(i=>{const a=()=>{const l=i[0];if(l?.borderBoxSize){const u=l.borderBoxSize[0];if(u){s({width:u.inlineSize,height:u.blockSize});return}}s(Fn(t))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()});return o.observe(t,{box:"border-box"}),()=>{o.unobserve(t)}},Bn={passive:!0},$n=typeof window>"u"?!0:"onscrollend"in window,eo=(e,n)=>{const t=e.scrollElement;if(!t)return;const r=e.targetWindow;if(!r)return;let s=0;const o=e.options.useScrollendEvent&&$n?()=>{}:Js(r,()=>{n(s,!1)},e.options.isScrollingResetDelay),i=d=>()=>{const{horizontal:f,isRtl:g}=e.options;s=f?t.scrollLeft*(g&&-1||1):t.scrollTop,o(),n(s,d)},a=i(!0),l=i(!1);t.addEventListener("scroll",a,Bn);const u=e.options.useScrollendEvent&&$n;return u&&t.addEventListener("scrollend",l,Bn),()=>{t.removeEventListener("scroll",a),u&&t.removeEventListener("scrollend",l)}},to=(e,n,t)=>{if(n?.borderBoxSize){const r=n.borderBoxSize[0];if(r)return Math.round(r[t.options.horizontal?"inlineSize":"blockSize"])}return e[t.options.horizontal?"offsetWidth":"offsetHeight"]},no=(e,{adjustments:n=0,behavior:t},r)=>{var s,o;const i=e+n;(o=(s=r.scrollElement)==null?void 0:s.scrollTo)==null||o.call(s,{[r.options.horizontal?"left":"top"]:i,behavior:t})};class ro{constructor(n){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.currentScrollToIndex=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let t=null;const r=()=>t||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:t=new this.targetWindow.ResizeObserver(s=>{s.forEach(o=>{const i=()=>{this._measureElement(o.target,o)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(i):i()})}));return{disconnect:()=>{var s;(s=r())==null||s.disconnect(),t=null},observe:s=>{var o;return(o=r())==null?void 0:o.observe(s,{box:"border-box"})},unobserve:s=>{var o;return(o=r())==null?void 0:o.unobserve(s)}}})(),this.range=null,this.setOptions=t=>{Object.entries(t).forEach(([r,s])=>{typeof s>"u"&&delete t[r]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Gs,rangeExtractor:Zs,onChange:()=>{},measureElement:to,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...t}},this.notify=t=>{var r,s;(s=(r=this.options).onChange)==null||s.call(r,this,t)},this.maybeNotify=Te(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),t=>{this.notify(t)},{key:process.env.NODE_ENV!=="production"&&"maybeNotify",debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(t=>t()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var t;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((t=this.scrollElement)==null?void 0:t.window)??null,this.elementsCache.forEach(s=>{this.observer.observe(s)}),this.unsubs.push(this.options.observeElementRect(this,s=>{this.scrollRect=s,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(s,o)=>{this.scrollAdjustments=0,this.scrollDirection=o?this.getScrollOffset()<s?"forward":"backward":null,this.scrollOffset=s,this.isScrolling=o,this.maybeNotify()})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(t,r)=>{const s=new Map,o=new Map;for(let i=r-1;i>=0;i--){const a=t[i];if(s.has(a.lane))continue;const l=o.get(a.lane);if(l==null||a.end>l.end?o.set(a.lane,a):a.end<l.end&&s.set(a.lane,!0),s.size===this.options.lanes)break}return o.size===this.options.lanes?Array.from(o.values()).sort((i,a)=>i.end===a.end?i.index-a.index:i.end-a.end)[0]:void 0},this.getMeasurementOptions=Te(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes],(t,r,s,o,i,a)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMeasuredCacheIndexes=[],{count:t,paddingStart:r,scrollMargin:s,getItemKey:o,enabled:i,lanes:a}),{key:!1}),this.getMeasurements=Te(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:t,paddingStart:r,scrollMargin:s,getItemKey:o,enabled:i,lanes:a},l)=>{if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>t)for(const g of this.laneAssignments.keys())g>=t&&this.laneAssignments.delete(g);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(g=>{this.itemSizeCache.set(g.key,g.size)}));const u=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===t&&(this.lanesSettling=!1);const d=this.measurementsCache.slice(0,u),f=new Array(a).fill(void 0);for(let g=0;g<u;g++){const p=d[g];p&&(f[p.lane]=g)}for(let g=u;g<t;g++){const p=o(g),C=this.laneAssignments.get(g);let b,x;if(C!==void 0&&this.options.lanes>1){b=C;const S=f[b],E=S!==void 0?d[S]:void 0;x=E?E.end+this.options.gap:r+s}else{const S=this.options.lanes===1?d[g-1]:this.getFurthestMeasurement(d,g);x=S?S.end+this.options.gap:r+s,b=S?S.lane:g%this.options.lanes,this.options.lanes>1&&this.laneAssignments.set(g,b)}const y=l.get(p),v=typeof y=="number"?y:this.options.estimateSize(g),m=x+v;d[g]={index:g,start:x,size:v,end:m,key:p,lane:b},f[b]=g}return this.measurementsCache=d,d},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=Te(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(t,r,s,o)=>this.range=t.length>0&&r>0?so({measurements:t,outerSize:r,scrollOffset:s,lanes:o}):null,{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:()=>this.options.debug}),this.getVirtualIndexes=Te(()=>{let t=null,r=null;const s=this.calculateRange();return s&&(t=s.startIndex,r=s.endIndex),this.maybeNotify.updateDeps([this.isScrolling,t,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,t,r]},(t,r,s,o,i)=>o===null||i===null?[]:t({startIndex:o,endIndex:i,overscan:r,count:s}),{key:process.env.NODE_ENV!=="production"&&"getVirtualIndexes",debug:()=>this.options.debug}),this.indexFromElement=t=>{const r=this.options.indexAttribute,s=t.getAttribute(r);return s?parseInt(s,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this._measureElement=(t,r)=>{const s=this.indexFromElement(t),o=this.measurementsCache[s];if(!o)return;const i=o.key,a=this.elementsCache.get(i);a!==t&&(a&&this.observer.unobserve(a),this.observer.observe(t),this.elementsCache.set(i,t)),t.isConnected&&this.resizeItem(s,this.options.measureElement(t,r,this))},this.resizeItem=(t,r)=>{const s=this.measurementsCache[t];if(!s)return;const o=this.itemSizeCache.get(s.key)??s.size,i=r-o;i!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(s,i,this):s.start<this.getScrollOffset()+this.scrollAdjustments)&&(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("correction",i),this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=i,behavior:void 0})),this.pendingMeasuredCacheIndexes.push(s.index),this.itemSizeCache=new Map(this.itemSizeCache.set(s.key,r)),this.notify(!1))},this.measureElement=t=>{if(!t){this.elementsCache.forEach((r,s)=>{r.isConnected||(this.observer.unobserve(r),this.elementsCache.delete(s))});return}this._measureElement(t,void 0)},this.getVirtualItems=Te(()=>[this.getVirtualIndexes(),this.getMeasurements()],(t,r)=>{const s=[];for(let o=0,i=t.length;o<i;o++){const a=t[o],l=r[a];s.push(l)}return s},{key:process.env.NODE_ENV!=="production"&&"getVirtualItems",debug:()=>this.options.debug}),this.getVirtualItemForOffset=t=>{const r=this.getMeasurements();if(r.length!==0)return Pn(r[Wn(0,r.length-1,s=>Pn(r[s]).start,t)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const t=this.scrollElement.document.documentElement;return this.options.horizontal?t.scrollWidth-this.scrollElement.innerWidth:t.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(t,r,s=0)=>{if(!this.scrollElement)return 0;const o=this.getSize(),i=this.getScrollOffset();r==="auto"&&(r=t>=i+o?"end":"start"),r==="center"?t+=(s-o)/2:r==="end"&&(t-=o);const a=this.getMaxScrollOffset();return Math.max(Math.min(a,t),0)},this.getOffsetForIndex=(t,r="auto")=>{t=Math.max(0,Math.min(t,this.options.count-1));const s=this.measurementsCache[t];if(!s)return;const o=this.getSize(),i=this.getScrollOffset();if(r==="auto")if(s.end>=i+o-this.options.scrollPaddingEnd)r="end";else if(s.start<=i+this.options.scrollPaddingStart)r="start";else return[i,r];if(r==="end"&&t===this.options.count-1)return[this.getMaxScrollOffset(),r];const a=r==="end"?s.end+this.options.scrollPaddingEnd:s.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,r,s.size),r]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(t,{align:r="start",behavior:s}={})=>{s==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(t,r),{adjustments:void 0,behavior:s})},this.scrollToIndex=(t,{align:r="auto",behavior:s}={})=>{s==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),t=Math.max(0,Math.min(t,this.options.count-1)),this.currentScrollToIndex=t;let o=0;const i=10,a=u=>{if(!this.targetWindow)return;const d=this.getOffsetForIndex(t,u);if(!d){console.warn("Failed to get offset for index:",t);return}const[f,g]=d;this._scrollToOffset(f,{adjustments:void 0,behavior:s}),this.targetWindow.requestAnimationFrame(()=>{const p=()=>{if(this.currentScrollToIndex!==t)return;const C=this.getScrollOffset(),b=this.getOffsetForIndex(t,g);if(!b){console.warn("Failed to get offset for index:",t);return}Hs(b[0],C)||l(g)};this.isDynamicMode()?this.targetWindow.requestAnimationFrame(p):p()})},l=u=>{this.targetWindow&&this.currentScrollToIndex===t&&(o++,o<i?(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("Schedule retry",o,i),this.targetWindow.requestAnimationFrame(()=>a(u))):console.warn(`Failed to scroll to index ${t} after ${i} attempts.`))};a(r)},this.scrollBy=(t,{behavior:r}={})=>{r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+t,{adjustments:void 0,behavior:r})},this.getTotalSize=()=>{var t;const r=this.getMeasurements();let s;if(r.length===0)s=this.options.paddingStart;else if(this.options.lanes===1)s=((t=r[r.length-1])==null?void 0:t.end)??0;else{const o=Array(this.options.lanes).fill(null);let i=r.length-1;for(;i>=0&&o.some(a=>a===null);){const a=r[i];o[a.lane]===null&&(o[a.lane]=a.end),i--}s=Math.max(...o.filter(a=>a!==null))}return Math.max(s-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(t,{adjustments:r,behavior:s})=>{this.options.scrollToFn(t,{behavior:s,adjustments:r},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(n)}}const Wn=(e,n,t,r)=>{for(;e<=n;){const s=(e+n)/2|0,o=t(s);if(o<r)e=s+1;else if(o>r)n=s-1;else return s}return e>0?e-1:0};function so({measurements:e,outerSize:n,scrollOffset:t,lanes:r}){const s=e.length-1,o=l=>e[l].start;if(e.length<=r)return{startIndex:0,endIndex:s};let i=Wn(0,s,o,t),a=i;if(r===1)for(;a<s&&e[a].end<t+n;)a++;else if(r>1){const l=Array(r).fill(0);for(;a<s&&l.some(d=>d<t+n);){const d=e[a];l[d.lane]=d.end,a++}const u=Array(r).fill(t+n);for(;i>=0&&u.some(d=>d>=t);){const d=e[i];u[d.lane]=d.start,i--}i=Math.max(0,i-i%r),a=Math.min(s,a+(r-1-a%r))}return{startIndex:i,endIndex:a}}const Vn=typeof document<"u"?F.useLayoutEffect:F.useEffect;function oo({useFlushSync:e=!0,...n}){const t=F.useReducer(()=>({}),{})[1],r={...n,onChange:(o,i)=>{var a;e&&i?Se.flushSync(t):t(),(a=n.onChange)==null||a.call(n,o,i)}},[s]=F.useState(()=>new ro(r));return s.setOptions(r),Vn(()=>s._didMount(),[]),Vn(()=>s._willUpdate()),s}function io(e){return oo({observeElementRect:Qs,observeElementOffset:eo,scrollToFn:no,...e})}const Yn=(...e)=>e.filter((n,t,r)=>!!n&&n.trim()!==""&&r.indexOf(n)===t).join(" ").trim();const ao=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const lo=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,t,r)=>r?r.toUpperCase():t.toLowerCase());const Kn=e=>{const n=lo(e);return n.charAt(0).toUpperCase()+n.slice(1)};var co={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const uo=e=>{for(const n in e)if(n.startsWith("aria-")||n==="role"||n==="title")return!0;return!1};const fo=c.forwardRef(({color:e="currentColor",size:n=24,strokeWidth:t=2,absoluteStrokeWidth:r,className:s="",children:o,iconNode:i,...a},l)=>c.createElement("svg",{ref:l,...co,width:n,height:n,stroke:e,strokeWidth:r?Number(t)*24/Number(n):t,className:Yn("lucide",s),...!o&&!uo(a)&&{"aria-hidden":"true"},...a},[...i.map(([u,d])=>c.createElement(u,d)),...Array.isArray(o)?o:[o]]));const kt=(e,n)=>{const t=c.forwardRef(({className:r,...s},o)=>c.createElement(fo,{ref:o,iconNode:n,className:Yn(`lucide-${ao(Kn(e))}`,`lucide-${e}`,r),...s}));return t.displayName=Kn(e),t};const ho=kt("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const go=kt("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);const po=kt("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),_t=(...e)=>e.filter(Boolean).join(" ");function Rt({card:e}){const{attributes:n,listeners:t,setNodeRef:r,transform:s,transition:o,isDragging:i}=pt({id:e.id}),a={transform:fe.Transform.toString(s),transition:o,opacity:i?.5:void 0};return w.jsx("div",{ref:r,style:a,...n,...t,children:w.jsxs(B.Card,{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:[w.jsxs(B.CardHeader,{className:"p-4",children:[w.jsx(B.CardTitle,{className:"text-sm font-medium font-mono tracking-tight text-foreground group-hover:text-primary transition-colors",children:e.title}),e.description&&w.jsx(B.CardDescription,{className:"text-xs text-muted-foreground font-mono",children:e.description})]}),e.badges&&e.badges.length>0&&w.jsx(B.CardContent,{className:"p-4 pt-0",children:w.jsx("div",{className:"flex flex-wrap gap-1",children:e.badges.map((l,u)=>w.jsx(B.Badge,{variant:l.variant||"default",className:"text-xs",children:l.label},u))})})]})})}function mo({cards:e,parentRef:n}){const t=io({count:e.length,getScrollElement:()=>n.current,estimateSize:()=>120,overscan:5});return w.jsx("div",{style:{height:`${t.getTotalSize()}px`,width:"100%",position:"relative"},children:t.getVirtualItems().map(r=>{const s=e[r.index];return w.jsx("div",{style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${r.start}px)`},children:w.jsx(Rt,{card:s})},s.id)})})}function vo({column:e,cards:n,onToggle:t,enableVirtual:r}){const s=n||[],o=F.useRef(null),{setNodeRef:i}=pt({id:e.id,data:{type:"column"}}),a=e.limit&&s.length>=e.limit,l=e.limit&&s.length>=e.limit*.8;return w.jsxs("div",{ref:i,className:_t("flex flex-col flex-shrink-0 rounded-lg border border-border bg-card/20 backdrop-blur-sm shadow-xl transition-all",e.collapsed?"w-16":"w-80",e.className),children:[w.jsxs("div",{className:"p-4 border-b border-border/50 bg-muted/20 flex items-center justify-between",children:[w.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[w.jsx(B.Button,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>t(!e.collapsed),children:e.collapsed?w.jsx(go,{className:"h-4 w-4"}):w.jsx(ho,{className:"h-4 w-4"})}),!e.collapsed&&w.jsxs(w.Fragment,{children:[w.jsx("h3",{className:"font-mono text-sm font-semibold tracking-wider text-primary/90 uppercase truncate",children:e.title}),w.jsxs("div",{className:"flex items-center gap-2",children:[w.jsxs("span",{className:_t("font-mono text-xs",a?"text-destructive":l?"text-yellow-500":"text-muted-foreground"),children:[s.length,e.limit&&` / ${e.limit}`]}),a&&w.jsx(B.Badge,{variant:"destructive",className:"text-xs",children:"Full"}),l&&!a&&w.jsx(po,{className:"h-3 w-3 text-yellow-500"})]})]})]}),e.collapsed&&w.jsxs("div",{className:"flex flex-col items-center gap-1",children:[w.jsx("span",{className:"font-mono text-xs font-bold text-primary/90 [writing-mode:vertical-rl] rotate-180",children:e.title}),w.jsx(B.Badge,{variant:"secondary",className:"text-xs",children:s.length})]})]}),!e.collapsed&&w.jsx("div",{ref:o,className:"flex-1 p-4 overflow-y-auto",style:{maxHeight:"600px"},children:w.jsx(_n,{items:s.map(u=>u.id),strategy:In,children:r?w.jsx(mo,{cards:s,parentRef:o}):w.jsx("div",{className:"space-y-2",children:s.map(u=>w.jsx(Rt,{card:u},u.id))})})})]})}function Un({columns:e,onCardMove:n,onColumnToggle:t,enableVirtualScrolling:r=!1,virtualScrollThreshold:s=50,className:o}){const[i,a]=F.useState(null),l=F.useMemo(()=>(e||[]).map(v=>({...v,cards:v.cards||[]})),[e]),[u,d]=F.useState(l);F.useEffect(()=>{d(l)},[l]);const f=Jt(Ht(at,{activationConstraint:{distance:8}})),g=v=>{const{active:m}=v,S=C(m.id);a(S)},p=v=>{const{active:m,over:S}=v;if(a(null),!S)return;const E=m.id,T=S.id;if(E===T)return;const O=b(E),N=b(T)||x(T);if(!(!O||!N))if(O.id===N.id){const A=[...O.cards],I=A.findIndex(P=>P.id===E),M=A.findIndex(P=>P.id===T),z=ft(A,I,M);d(P=>P.map(V=>V.id===O.id?{...V,cards:z}:V))}else{const A=[...O.cards],I=[...N.cards],M=A.findIndex(H=>H.id===E),P=T===N.id?I.length:I.findIndex(H=>H.id===T),[V]=A.splice(M,1);I.splice(P,0,V),d(H=>H.map(Z=>Z.id===O.id?{...Z,cards:A}:Z.id===N.id?{...Z,cards:I}:Z)),n&&n(E,O.id,N.id,P)}},C=F.useCallback(v=>{for(const m of u){const S=m.cards.find(E=>E.id===v);if(S)return S}return null},[u]),b=F.useCallback(v=>u.find(m=>m.cards.some(S=>S.id===v))||null,[u]),x=F.useCallback(v=>u.find(m=>m.id===v)||null,[u]),y=F.useCallback((v,m)=>{d(S=>S.map(E=>E.id===v?{...E,collapsed:m}:E)),t?.(v,m)},[t]);return w.jsxs(Dn,{sensors:f,collisionDetection:Zt,onDragStart:g,onDragEnd:p,children:[w.jsx("div",{className:_t("flex gap-4 overflow-x-auto p-4",o),children:u.map(v=>{const m=r&&v.cards.length>s;return w.jsx(vo,{column:v,cards:v.cards,onToggle:S=>y(v.id,S),enableVirtual:m},v.id)})}),w.jsx(An,{children:i?w.jsx(Rt,{card:i}):null})]})}const bo=Object.freeze(Object.defineProperty({__proto__:null,KanbanEnhanced:Un,default:Un},Symbol.toStringTag,{value:"Module"}));G.KanbanRenderer=Ze,G.ObjectKanban=yt,G.ObjectKanbanRenderer=Yt,G.kanbanComponents=ir,Object.defineProperty(G,Symbol.toStringTag,{value:"Module"})}));
|
|
13
|
+
color: hsl(${Math.max(0,Math.min(120-120*x,120))}deg 100% 31%);`,t?.key)}return t?.onChange&&!(o&&t.skipInitialOnChange)&&t.onChange(s),o=!1,s}return i.updateDeps=a=>{r=a},i}function Pn(e,n){if(e===void 0)throw new Error("Unexpected undefined");return e}const Hs=(e,n)=>Math.abs(e-n)<1.01,Js=(e,n,t)=>{let r;return function(...s){e.clearTimeout(r),r=e.setTimeout(()=>n.apply(this,s),t)}},Fn=e=>{const{offsetWidth:n,offsetHeight:t}=e;return{width:n,height:t}},Gs=e=>e,Zs=e=>{const n=Math.max(e.startIndex-e.overscan,0),t=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let s=n;s<=t;s++)r.push(s);return r},Qs=(e,n)=>{const t=e.scrollElement;if(!t)return;const r=e.targetWindow;if(!r)return;const s=i=>{const{width:a,height:l}=i;n({width:Math.round(a),height:Math.round(l)})};if(s(Fn(t)),!r.ResizeObserver)return()=>{};const o=new r.ResizeObserver(i=>{const a=()=>{const l=i[0];if(l?.borderBoxSize){const u=l.borderBoxSize[0];if(u){s({width:u.inlineSize,height:u.blockSize});return}}s(Fn(t))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()});return o.observe(t,{box:"border-box"}),()=>{o.unobserve(t)}},Bn={passive:!0},$n=typeof window>"u"?!0:"onscrollend"in window,eo=(e,n)=>{const t=e.scrollElement;if(!t)return;const r=e.targetWindow;if(!r)return;let s=0;const o=e.options.useScrollendEvent&&$n?()=>{}:Js(r,()=>{n(s,!1)},e.options.isScrollingResetDelay),i=d=>()=>{const{horizontal:f,isRtl:g}=e.options;s=f?t.scrollLeft*(g&&-1||1):t.scrollTop,o(),n(s,d)},a=i(!0),l=i(!1);t.addEventListener("scroll",a,Bn);const u=e.options.useScrollendEvent&&$n;return u&&t.addEventListener("scrollend",l,Bn),()=>{t.removeEventListener("scroll",a),u&&t.removeEventListener("scrollend",l)}},to=(e,n,t)=>{if(n?.borderBoxSize){const r=n.borderBoxSize[0];if(r)return Math.round(r[t.options.horizontal?"inlineSize":"blockSize"])}return e[t.options.horizontal?"offsetWidth":"offsetHeight"]},no=(e,{adjustments:n=0,behavior:t},r)=>{var s,o;const i=e+n;(o=(s=r.scrollElement)==null?void 0:s.scrollTo)==null||o.call(s,{[r.options.horizontal?"left":"top"]:i,behavior:t})};class ro{constructor(n){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.currentScrollToIndex=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let t=null;const r=()=>t||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:t=new this.targetWindow.ResizeObserver(s=>{s.forEach(o=>{const i=()=>{this._measureElement(o.target,o)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(i):i()})}));return{disconnect:()=>{var s;(s=r())==null||s.disconnect(),t=null},observe:s=>{var o;return(o=r())==null?void 0:o.observe(s,{box:"border-box"})},unobserve:s=>{var o;return(o=r())==null?void 0:o.unobserve(s)}}})(),this.range=null,this.setOptions=t=>{Object.entries(t).forEach(([r,s])=>{typeof s>"u"&&delete t[r]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Gs,rangeExtractor:Zs,onChange:()=>{},measureElement:to,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...t}},this.notify=t=>{var r,s;(s=(r=this.options).onChange)==null||s.call(r,this,t)},this.maybeNotify=Te(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),t=>{this.notify(t)},{key:process.env.NODE_ENV!=="production"&&"maybeNotify",debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(t=>t()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var t;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((t=this.scrollElement)==null?void 0:t.window)??null,this.elementsCache.forEach(s=>{this.observer.observe(s)}),this.unsubs.push(this.options.observeElementRect(this,s=>{this.scrollRect=s,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(s,o)=>{this.scrollAdjustments=0,this.scrollDirection=o?this.getScrollOffset()<s?"forward":"backward":null,this.scrollOffset=s,this.isScrolling=o,this.maybeNotify()})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(t,r)=>{const s=new Map,o=new Map;for(let i=r-1;i>=0;i--){const a=t[i];if(s.has(a.lane))continue;const l=o.get(a.lane);if(l==null||a.end>l.end?o.set(a.lane,a):a.end<l.end&&s.set(a.lane,!0),s.size===this.options.lanes)break}return o.size===this.options.lanes?Array.from(o.values()).sort((i,a)=>i.end===a.end?i.index-a.index:i.end-a.end)[0]:void 0},this.getMeasurementOptions=Te(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes],(t,r,s,o,i,a)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMeasuredCacheIndexes=[],{count:t,paddingStart:r,scrollMargin:s,getItemKey:o,enabled:i,lanes:a}),{key:!1}),this.getMeasurements=Te(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:t,paddingStart:r,scrollMargin:s,getItemKey:o,enabled:i,lanes:a},l)=>{if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>t)for(const g of this.laneAssignments.keys())g>=t&&this.laneAssignments.delete(g);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(g=>{this.itemSizeCache.set(g.key,g.size)}));const u=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===t&&(this.lanesSettling=!1);const d=this.measurementsCache.slice(0,u),f=new Array(a).fill(void 0);for(let g=0;g<u;g++){const p=d[g];p&&(f[p.lane]=g)}for(let g=u;g<t;g++){const p=o(g),C=this.laneAssignments.get(g);let b,x;if(C!==void 0&&this.options.lanes>1){b=C;const S=f[b],E=S!==void 0?d[S]:void 0;x=E?E.end+this.options.gap:r+s}else{const S=this.options.lanes===1?d[g-1]:this.getFurthestMeasurement(d,g);x=S?S.end+this.options.gap:r+s,b=S?S.lane:g%this.options.lanes,this.options.lanes>1&&this.laneAssignments.set(g,b)}const y=l.get(p),v=typeof y=="number"?y:this.options.estimateSize(g),m=x+v;d[g]={index:g,start:x,size:v,end:m,key:p,lane:b},f[b]=g}return this.measurementsCache=d,d},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=Te(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(t,r,s,o)=>this.range=t.length>0&&r>0?so({measurements:t,outerSize:r,scrollOffset:s,lanes:o}):null,{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:()=>this.options.debug}),this.getVirtualIndexes=Te(()=>{let t=null,r=null;const s=this.calculateRange();return s&&(t=s.startIndex,r=s.endIndex),this.maybeNotify.updateDeps([this.isScrolling,t,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,t,r]},(t,r,s,o,i)=>o===null||i===null?[]:t({startIndex:o,endIndex:i,overscan:r,count:s}),{key:process.env.NODE_ENV!=="production"&&"getVirtualIndexes",debug:()=>this.options.debug}),this.indexFromElement=t=>{const r=this.options.indexAttribute,s=t.getAttribute(r);return s?parseInt(s,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this._measureElement=(t,r)=>{const s=this.indexFromElement(t),o=this.measurementsCache[s];if(!o)return;const i=o.key,a=this.elementsCache.get(i);a!==t&&(a&&this.observer.unobserve(a),this.observer.observe(t),this.elementsCache.set(i,t)),t.isConnected&&this.resizeItem(s,this.options.measureElement(t,r,this))},this.resizeItem=(t,r)=>{const s=this.measurementsCache[t];if(!s)return;const o=this.itemSizeCache.get(s.key)??s.size,i=r-o;i!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(s,i,this):s.start<this.getScrollOffset()+this.scrollAdjustments)&&(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("correction",i),this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=i,behavior:void 0})),this.pendingMeasuredCacheIndexes.push(s.index),this.itemSizeCache=new Map(this.itemSizeCache.set(s.key,r)),this.notify(!1))},this.measureElement=t=>{if(!t){this.elementsCache.forEach((r,s)=>{r.isConnected||(this.observer.unobserve(r),this.elementsCache.delete(s))});return}this._measureElement(t,void 0)},this.getVirtualItems=Te(()=>[this.getVirtualIndexes(),this.getMeasurements()],(t,r)=>{const s=[];for(let o=0,i=t.length;o<i;o++){const a=t[o],l=r[a];s.push(l)}return s},{key:process.env.NODE_ENV!=="production"&&"getVirtualItems",debug:()=>this.options.debug}),this.getVirtualItemForOffset=t=>{const r=this.getMeasurements();if(r.length!==0)return Pn(r[Wn(0,r.length-1,s=>Pn(r[s]).start,t)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const t=this.scrollElement.document.documentElement;return this.options.horizontal?t.scrollWidth-this.scrollElement.innerWidth:t.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(t,r,s=0)=>{if(!this.scrollElement)return 0;const o=this.getSize(),i=this.getScrollOffset();r==="auto"&&(r=t>=i+o?"end":"start"),r==="center"?t+=(s-o)/2:r==="end"&&(t-=o);const a=this.getMaxScrollOffset();return Math.max(Math.min(a,t),0)},this.getOffsetForIndex=(t,r="auto")=>{t=Math.max(0,Math.min(t,this.options.count-1));const s=this.measurementsCache[t];if(!s)return;const o=this.getSize(),i=this.getScrollOffset();if(r==="auto")if(s.end>=i+o-this.options.scrollPaddingEnd)r="end";else if(s.start<=i+this.options.scrollPaddingStart)r="start";else return[i,r];if(r==="end"&&t===this.options.count-1)return[this.getMaxScrollOffset(),r];const a=r==="end"?s.end+this.options.scrollPaddingEnd:s.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,r,s.size),r]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(t,{align:r="start",behavior:s}={})=>{s==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(t,r),{adjustments:void 0,behavior:s})},this.scrollToIndex=(t,{align:r="auto",behavior:s}={})=>{s==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),t=Math.max(0,Math.min(t,this.options.count-1)),this.currentScrollToIndex=t;let o=0;const i=10,a=u=>{if(!this.targetWindow)return;const d=this.getOffsetForIndex(t,u);if(!d){console.warn("Failed to get offset for index:",t);return}const[f,g]=d;this._scrollToOffset(f,{adjustments:void 0,behavior:s}),this.targetWindow.requestAnimationFrame(()=>{const p=()=>{if(this.currentScrollToIndex!==t)return;const C=this.getScrollOffset(),b=this.getOffsetForIndex(t,g);if(!b){console.warn("Failed to get offset for index:",t);return}Hs(b[0],C)||l(g)};this.isDynamicMode()?this.targetWindow.requestAnimationFrame(p):p()})},l=u=>{this.targetWindow&&this.currentScrollToIndex===t&&(o++,o<i?(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("Schedule retry",o,i),this.targetWindow.requestAnimationFrame(()=>a(u))):console.warn(`Failed to scroll to index ${t} after ${i} attempts.`))};a(r)},this.scrollBy=(t,{behavior:r}={})=>{r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+t,{adjustments:void 0,behavior:r})},this.getTotalSize=()=>{var t;const r=this.getMeasurements();let s;if(r.length===0)s=this.options.paddingStart;else if(this.options.lanes===1)s=((t=r[r.length-1])==null?void 0:t.end)??0;else{const o=Array(this.options.lanes).fill(null);let i=r.length-1;for(;i>=0&&o.some(a=>a===null);){const a=r[i];o[a.lane]===null&&(o[a.lane]=a.end),i--}s=Math.max(...o.filter(a=>a!==null))}return Math.max(s-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(t,{adjustments:r,behavior:s})=>{this.options.scrollToFn(t,{behavior:s,adjustments:r},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(n)}}const Wn=(e,n,t,r)=>{for(;e<=n;){const s=(e+n)/2|0,o=t(s);if(o<r)e=s+1;else if(o>r)n=s-1;else return s}return e>0?e-1:0};function so({measurements:e,outerSize:n,scrollOffset:t,lanes:r}){const s=e.length-1,o=l=>e[l].start;if(e.length<=r)return{startIndex:0,endIndex:s};let i=Wn(0,s,o,t),a=i;if(r===1)for(;a<s&&e[a].end<t+n;)a++;else if(r>1){const l=Array(r).fill(0);for(;a<s&&l.some(d=>d<t+n);){const d=e[a];l[d.lane]=d.end,a++}const u=Array(r).fill(t+n);for(;i>=0&&u.some(d=>d>=t);){const d=e[i];u[d.lane]=d.start,i--}i=Math.max(0,i-i%r),a=Math.min(s,a+(r-1-a%r))}return{startIndex:i,endIndex:a}}const Vn=typeof document<"u"?F.useLayoutEffect:F.useEffect;function oo({useFlushSync:e=!0,...n}){const t=F.useReducer(()=>({}),{})[1],r={...n,onChange:(o,i)=>{var a;e&&i?Se.flushSync(t):t(),(a=n.onChange)==null||a.call(n,o,i)}},[s]=F.useState(()=>new ro(r));return s.setOptions(r),Vn(()=>s._didMount(),[]),Vn(()=>s._willUpdate()),s}function io(e){return oo({observeElementRect:Qs,observeElementOffset:eo,scrollToFn:no,...e})}const Yn=(...e)=>e.filter((n,t,r)=>!!n&&n.trim()!==""&&r.indexOf(n)===t).join(" ").trim();const ao=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const lo=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,t,r)=>r?r.toUpperCase():t.toLowerCase());const Kn=e=>{const n=lo(e);return n.charAt(0).toUpperCase()+n.slice(1)};var co={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const uo=e=>{for(const n in e)if(n.startsWith("aria-")||n==="role"||n==="title")return!0;return!1};const fo=c.forwardRef(({color:e="currentColor",size:n=24,strokeWidth:t=2,absoluteStrokeWidth:r,className:s="",children:o,iconNode:i,...a},l)=>c.createElement("svg",{ref:l,...co,width:n,height:n,stroke:e,strokeWidth:r?Number(t)*24/Number(n):t,className:Yn("lucide",s),...!o&&!uo(a)&&{"aria-hidden":"true"},...a},[...i.map(([u,d])=>c.createElement(u,d)),...Array.isArray(o)?o:[o]]));const _t=(e,n)=>{const t=c.forwardRef(({className:r,...s},o)=>c.createElement(fo,{ref:o,iconNode:n,className:Yn(`lucide-${ao(Kn(e))}`,`lucide-${e}`,r),...s}));return t.displayName=Kn(e),t};const ho=_t("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const go=_t("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);const po=_t("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),Rt=(...e)=>e.filter(Boolean).join(" ");function zt({card:e}){const{attributes:n,listeners:t,setNodeRef:r,transform:s,transition:o,isDragging:i}=mt({id:e.id}),a={transform:fe.Transform.toString(s),transition:o,opacity:i?.5:void 0};return w.jsx("div",{ref:r,style:a,...n,...t,children:w.jsxs(B.Card,{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:[w.jsxs(B.CardHeader,{className:"p-4",children:[w.jsx(B.CardTitle,{className:"text-sm font-medium font-mono tracking-tight text-foreground group-hover:text-primary transition-colors",children:e.title}),e.description&&w.jsx(B.CardDescription,{className:"text-xs text-muted-foreground font-mono",children:e.description})]}),e.badges&&e.badges.length>0&&w.jsx(B.CardContent,{className:"p-4 pt-0",children:w.jsx("div",{className:"flex flex-wrap gap-1",children:e.badges.map((l,u)=>w.jsx(B.Badge,{variant:l.variant||"default",className:"text-xs",children:l.label},u))})})]})})}function mo({cards:e,parentRef:n}){const t=io({count:e.length,getScrollElement:()=>n.current,estimateSize:()=>120,overscan:5});return w.jsx("div",{style:{height:`${t.getTotalSize()}px`,width:"100%",position:"relative"},children:t.getVirtualItems().map(r=>{const s=e[r.index];return w.jsx("div",{style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${r.start}px)`},children:w.jsx(zt,{card:s})},s.id)})})}function vo({column:e,cards:n,onToggle:t,enableVirtual:r}){const s=n||[],o=F.useRef(null),{setNodeRef:i}=mt({id:e.id,data:{type:"column"}}),a=e.limit&&s.length>=e.limit,l=e.limit&&s.length>=e.limit*.8;return w.jsxs("div",{ref:i,className:Rt("flex flex-col flex-shrink-0 rounded-lg border border-border bg-card/20 backdrop-blur-sm shadow-xl transition-all",e.collapsed?"w-16":"w-80",e.className),children:[w.jsxs("div",{className:"p-4 border-b border-border/50 bg-muted/20 flex items-center justify-between",children:[w.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[w.jsx(B.Button,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>t(!e.collapsed),children:e.collapsed?w.jsx(go,{className:"h-4 w-4"}):w.jsx(ho,{className:"h-4 w-4"})}),!e.collapsed&&w.jsxs(w.Fragment,{children:[w.jsx("h3",{className:"font-mono text-sm font-semibold tracking-wider text-primary/90 uppercase truncate",children:e.title}),w.jsxs("div",{className:"flex items-center gap-2",children:[w.jsxs("span",{className:Rt("font-mono text-xs",a?"text-destructive":l?"text-yellow-500":"text-muted-foreground"),children:[s.length,e.limit&&` / ${e.limit}`]}),a&&w.jsx(B.Badge,{variant:"destructive",className:"text-xs",children:"Full"}),l&&!a&&w.jsx(po,{className:"h-3 w-3 text-yellow-500"})]})]})]}),e.collapsed&&w.jsxs("div",{className:"flex flex-col items-center gap-1",children:[w.jsx("span",{className:"font-mono text-xs font-bold text-primary/90 [writing-mode:vertical-rl] rotate-180",children:e.title}),w.jsx(B.Badge,{variant:"secondary",className:"text-xs",children:s.length})]})]}),!e.collapsed&&w.jsx("div",{ref:o,className:"flex-1 p-4 overflow-y-auto",style:{maxHeight:"600px"},children:w.jsx(_n,{items:s.map(u=>u.id),strategy:In,children:r?w.jsx(mo,{cards:s,parentRef:o}):w.jsx("div",{className:"space-y-2",children:s.map(u=>w.jsx(zt,{card:u},u.id))})})})]})}function Un({columns:e,onCardMove:n,onColumnToggle:t,enableVirtualScrolling:r=!1,virtualScrollThreshold:s=50,className:o}){const[i,a]=F.useState(null),l=F.useMemo(()=>(e||[]).map(v=>({...v,cards:v.cards||[]})),[e]),[u,d]=F.useState(l);F.useEffect(()=>{d(l)},[l]);const f=Jt(Ht(lt,{activationConstraint:{distance:8}})),g=v=>{const{active:m}=v,S=C(m.id);a(S)},p=v=>{const{active:m,over:S}=v;if(a(null),!S)return;const E=m.id,T=S.id;if(E===T)return;const O=b(E),N=b(T)||x(T);if(!(!O||!N))if(O.id===N.id){const A=[...O.cards],I=A.findIndex(P=>P.id===E),M=A.findIndex(P=>P.id===T),z=ht(A,I,M);d(P=>P.map(V=>V.id===O.id?{...V,cards:z}:V))}else{const A=[...O.cards],I=[...N.cards],M=A.findIndex(H=>H.id===E),P=T===N.id?I.length:I.findIndex(H=>H.id===T),[V]=A.splice(M,1);I.splice(P,0,V),d(H=>H.map(Z=>Z.id===O.id?{...Z,cards:A}:Z.id===N.id?{...Z,cards:I}:Z)),n&&n(E,O.id,N.id,P)}},C=F.useCallback(v=>{for(const m of u){const S=m.cards.find(E=>E.id===v);if(S)return S}return null},[u]),b=F.useCallback(v=>u.find(m=>m.cards.some(S=>S.id===v))||null,[u]),x=F.useCallback(v=>u.find(m=>m.id===v)||null,[u]),y=F.useCallback((v,m)=>{d(S=>S.map(E=>E.id===v?{...E,collapsed:m}:E)),t?.(v,m)},[t]);return w.jsxs(Dn,{sensors:f,collisionDetection:Zt,onDragStart:g,onDragEnd:p,children:[w.jsx("div",{className:Rt("flex gap-4 overflow-x-auto p-4",o),children:u.map(v=>{const m=r&&v.cards.length>s;return w.jsx(vo,{column:v,cards:v.cards,onToggle:S=>y(v.id,S),enableVirtual:m},v.id)})}),w.jsx(An,{children:i?w.jsx(zt,{card:i}):null})]})}const bo=Object.freeze(Object.defineProperty({__proto__:null,KanbanEnhanced:Un,default:Un},Symbol.toStringTag,{value:"Module"}));G.KanbanRenderer=Qe,G.ObjectKanban=yt,G.ObjectKanbanRenderer=xt,G.kanbanComponents=ir,Object.defineProperty(G,Symbol.toStringTag,{value:"Module"})}));
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAmB,MAAM,OAAO,CAAC;AAIxC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,CAAC;AACxB,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAMxD,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE;QACN,IAAI,EAAE,MAAM,CAAC;QACb,EAAE,CAAC,EAAE,MAAM,CAAC;QACZ,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,OAAO,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;QACrB,IAAI,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;QAClB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;KACnG,CAAC;CACH;AAED;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAmB,MAAM,OAAO,CAAC;AAIxC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,CAAC;AACxB,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAMxD,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE;QACN,IAAI,EAAE,MAAM,CAAC;QACb,EAAE,CAAC,EAAE,MAAM,CAAC;QACZ,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,OAAO,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;QACrB,IAAI,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;QAClB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;KACnG,CAAC;CACH;AAED;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CA+CxD,CAAC;AAqGF,eAAO,MAAM,gBAAgB;;;;CAI5B,CAAC;AA2DF,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC;IAAE,MAAM,EAAE,GAAG,CAAC;IAAC,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,CAG9E,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@object-ui/plugin-kanban",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "Kanban board plugin for Object UI, powered by dnd-kit",
|
|
@@ -29,23 +29,23 @@
|
|
|
29
29
|
"@dnd-kit/utilities": "^3.2.2",
|
|
30
30
|
"@tanstack/react-virtual": "^3.10.8",
|
|
31
31
|
"lucide-react": "^0.563.0",
|
|
32
|
-
"@object-ui/components": "0.
|
|
33
|
-
"@object-ui/core": "0.
|
|
34
|
-
"@object-ui/react": "0.
|
|
35
|
-
"@object-ui/types": "0.
|
|
32
|
+
"@object-ui/components": "2.0.0",
|
|
33
|
+
"@object-ui/core": "2.0.0",
|
|
34
|
+
"@object-ui/react": "2.0.0",
|
|
35
|
+
"@object-ui/types": "2.0.0"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
38
|
"react": "^18.0.0 || ^19.0.0",
|
|
39
39
|
"react-dom": "^18.0.0 || ^19.0.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@types/react": "^19.2.
|
|
42
|
+
"@types/react": "^19.2.13",
|
|
43
43
|
"@types/react-dom": "^19.2.3",
|
|
44
44
|
"@vitejs/plugin-react": "^5.1.3",
|
|
45
45
|
"typescript": "^5.9.3",
|
|
46
46
|
"vite": "^7.3.1",
|
|
47
47
|
"vite-plugin-dts": "^4.5.4",
|
|
48
|
-
"@object-ui/data-objectstack": "0.
|
|
48
|
+
"@object-ui/data-objectstack": "2.0.0"
|
|
49
49
|
},
|
|
50
50
|
"scripts": {
|
|
51
51
|
"build": "vite build",
|
package/src/index.test.ts
CHANGED
|
@@ -17,12 +17,12 @@ describe('Plugin Kanban', () => {
|
|
|
17
17
|
|
|
18
18
|
describe('kanban component', () => {
|
|
19
19
|
it('should be registered in ComponentRegistry', () => {
|
|
20
|
-
const kanbanRenderer = ComponentRegistry.get('kanban');
|
|
20
|
+
const kanbanRenderer = ComponentRegistry.get('kanban-ui');
|
|
21
21
|
expect(kanbanRenderer).toBeDefined();
|
|
22
22
|
});
|
|
23
23
|
|
|
24
24
|
it('should have proper metadata', () => {
|
|
25
|
-
const config = ComponentRegistry.getConfig('kanban');
|
|
25
|
+
const config = ComponentRegistry.getConfig('kanban-ui');
|
|
26
26
|
expect(config).toBeDefined();
|
|
27
27
|
expect(config?.label).toBe('Kanban Board');
|
|
28
28
|
expect(config?.icon).toBe('LayoutDashboard');
|
|
@@ -32,7 +32,7 @@ describe('Plugin Kanban', () => {
|
|
|
32
32
|
});
|
|
33
33
|
|
|
34
34
|
it('should have expected inputs', () => {
|
|
35
|
-
const config = ComponentRegistry.getConfig('kanban');
|
|
35
|
+
const config = ComponentRegistry.getConfig('kanban-ui');
|
|
36
36
|
const inputNames = config?.inputs?.map((input: any) => input.name) || [];
|
|
37
37
|
|
|
38
38
|
expect(inputNames).toContain('columns');
|
|
@@ -41,7 +41,7 @@ describe('Plugin Kanban', () => {
|
|
|
41
41
|
});
|
|
42
42
|
|
|
43
43
|
it('should have columns as required input', () => {
|
|
44
|
-
const config = ComponentRegistry.getConfig('kanban');
|
|
44
|
+
const config = ComponentRegistry.getConfig('kanban-ui');
|
|
45
45
|
const columnsInput = config?.inputs?.find((input: any) => input.name === 'columns');
|
|
46
46
|
|
|
47
47
|
expect(columnsInput).toBeDefined();
|
|
@@ -51,7 +51,7 @@ describe('Plugin Kanban', () => {
|
|
|
51
51
|
});
|
|
52
52
|
|
|
53
53
|
it('should have onCardMove as code input', () => {
|
|
54
|
-
const config = ComponentRegistry.getConfig('kanban');
|
|
54
|
+
const config = ComponentRegistry.getConfig('kanban-ui');
|
|
55
55
|
const onCardMoveInput = config?.inputs?.find((input: any) => input.name === 'onCardMove');
|
|
56
56
|
|
|
57
57
|
expect(onCardMoveInput).toBeDefined();
|
|
@@ -61,7 +61,7 @@ describe('Plugin Kanban', () => {
|
|
|
61
61
|
});
|
|
62
62
|
|
|
63
63
|
it('should have sensible default props', () => {
|
|
64
|
-
const config = ComponentRegistry.getConfig('kanban');
|
|
64
|
+
const config = ComponentRegistry.getConfig('kanban-ui');
|
|
65
65
|
const defaults = config?.defaultProps;
|
|
66
66
|
|
|
67
67
|
expect(defaults).toBeDefined();
|
|
@@ -72,7 +72,7 @@ describe('Plugin Kanban', () => {
|
|
|
72
72
|
});
|
|
73
73
|
|
|
74
74
|
it('should have default columns with proper structure', () => {
|
|
75
|
-
const config = ComponentRegistry.getConfig('kanban');
|
|
75
|
+
const config = ComponentRegistry.getConfig('kanban-ui');
|
|
76
76
|
const defaults = config?.defaultProps;
|
|
77
77
|
const columns = defaults?.columns || [];
|
|
78
78
|
|
|
@@ -93,7 +93,7 @@ describe('Plugin Kanban', () => {
|
|
|
93
93
|
});
|
|
94
94
|
|
|
95
95
|
it('should have cards with proper structure', () => {
|
|
96
|
-
const config = ComponentRegistry.getConfig('kanban');
|
|
96
|
+
const config = ComponentRegistry.getConfig('kanban-ui');
|
|
97
97
|
const defaults = config?.defaultProps;
|
|
98
98
|
const columns = defaults?.columns || [];
|
|
99
99
|
|