import{v,x as g,l as y,s as a,r as b}from"./x-CuOWXDIc.js";const z={__name:"ColumnResizer",props:{index:{type:Number,required:!0}},emits:["resize","resize-end"],setup(l,{emit:d}){const m=l,n=d,e=b(!1);function p(r){r.preventDefault(),e.value=!0;const t=r.clientX,o=r.target.closest("[data-columns-container]");if(!o)return;const s=o.getBoundingClientRect().width;function i(c){n("resize",{index:m.index,deltaPct:(c.clientX-t)/s*100,startX:t,currentX:c.clientX,containerWidth:s})}function u(){e.value=!1,n("resize-end"),document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",u),document.body.style.cursor="",document.body.style.userSelect=""}document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",i),document.addEventListener("mouseup",u)}return(r,t)=>(v(),g("div",{class:a(["w-2 cursor-col-resize flex items-center justify-center shrink-0 group relative z-10 -mx-1",e.value?"bg-primary-200 dark:bg-primary-800":"hover:bg-primary-100 dark:hover:bg-primary-900/30"]),onMousedown:p},[y("div",{class:a(["w-0.5 h-8 rounded-full transition-colors",e.value?"bg-primary-500":"bg-neutral-300 dark:bg-neutral-600 group-hover:bg-primary-400"])},null,2)],34))}};export{z as _};
