buildgrid-ui 1.19.0 → 1.19.2

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/README.md CHANGED
@@ -28,7 +28,7 @@
28
28
  BuildGrid UI is a comprehensive React component library featuring **44+ components** and **12 specialized blocks**, all built with production use in mind.
29
29
 
30
30
  - 🎯 **Battle-Tested** - Components refined through real-world usage
31
- - 🎨 **Modern Stack** - Built with React 19, TypeScript, and Tailwind CSS
31
+ - 🎨 **Modern Stack** - Built with React 18+, TypeScript, and Tailwind CSS
32
32
  - ♿ **Accessible** - WCAG compliant with full keyboard navigation
33
33
  - 📱 **Responsive** - Mobile-first design approach
34
34
  - 🎭 **Customizable** - Flexible theming and styling options
@@ -10247,7 +10247,8 @@ function _S({
10247
10247
  placeholder: n,
10248
10248
  value: e,
10249
10249
  onChange: (r) => t(r.target.value),
10250
- className: "pl-10"
10250
+ className: "pl-10",
10251
+ style: { paddingLeft: "2.5rem" }
10251
10252
  }
10252
10253
  )
10253
10254
  ] });
@@ -285,7 +285,7 @@ React keys must be passed directly to JSX without using spread:
285
285
  `)},Rd=function(){var e=parseInt(document.body.getAttribute(Ar)||"0",10);return isFinite(e)?e:0},V1=function(){u.useEffect(function(){return document.body.setAttribute(Ar,(Rd()+1).toString()),function(){var e=Rd()-1;e<=0?document.body.removeAttribute(Ar):document.body.setAttribute(Ar,e.toString())}},[])},W1=function(e){var t=e.noRelative,r=e.noImportant,o=e.gapMode,n=o===void 0?"margin":o;V1();var a=u.useMemo(function(){return F1(n)},[n]);return u.createElement(z1,{styles:B1(a,!t,n,r?"":"!important")})},hi=!1;if(typeof window<"u")try{var wn=Object.defineProperty({},"passive",{get:function(){return hi=!0,!0}});window.addEventListener("test",wn,wn),window.removeEventListener("test",wn,wn)}catch{hi=!1}var Ir=hi?{passive:!1}:!1,H1=function(e){return e.tagName==="TEXTAREA"},Od=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!H1(e)&&r[t]==="visible")},U1=function(e){return Od(e,"overflowY")},G1=function(e){return Od(e,"overflowX")},$d=function(e,t){var r=t.ownerDocument,o=t;do{typeof ShadowRoot<"u"&&o instanceof ShadowRoot&&(o=o.host);var n=Ld(e,o);if(n){var a=Fd(e,o),i=a[1],s=a[2];if(i>s)return!0}o=o.parentNode}while(o&&o!==r.body);return!1},Y1=function(e){var t=e.scrollTop,r=e.scrollHeight,o=e.clientHeight;return[t,r,o]},q1=function(e){var t=e.scrollLeft,r=e.scrollWidth,o=e.clientWidth;return[t,r,o]},Ld=function(e,t){return e==="v"?U1(t):G1(t)},Fd=function(e,t){return e==="v"?Y1(t):q1(t)},K1=function(e,t){return e==="h"&&t==="rtl"?-1:1},X1=function(e,t,r,o,n){var a=K1(e,window.getComputedStyle(t).direction),i=a*o,s=r.target,c=t.contains(s),d=!1,p=i>0,f=0,v=0;do{if(!s)break;var m=Fd(e,s),h=m[0],g=m[1],w=m[2],x=g-w-a*h;(h||x)&&Ld(e,s)&&(f+=x,v+=h);var b=s.parentNode;s=b&&b.nodeType===Node.DOCUMENT_FRAGMENT_NODE?b.host:b}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(p&&Math.abs(f)<1||!p&&Math.abs(v)<1)&&(d=!0),d},xn=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},zd=function(e){return[e.deltaX,e.deltaY]},Bd=function(e){return e&&"current"in e?e.current:e},Z1=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Q1=function(e){return`
286
286
  .block-interactivity-`.concat(e,` {pointer-events: none;}
287
287
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
288
- `)},J1=0,Rr=[];function ek(e){var t=u.useRef([]),r=u.useRef([0,0]),o=u.useRef(),n=u.useState(J1++)[0],a=u.useState(Id)[0],i=u.useRef(e);u.useEffect(function(){i.current=e},[e]),u.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(n));var g=y1([e.lockRef.current],(e.shards||[]).map(Bd),!0).filter(Boolean);return g.forEach(function(w){return w.classList.add("allow-interactivity-".concat(n))}),function(){document.body.classList.remove("block-interactivity-".concat(n)),g.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(n))})}}},[e.inert,e.lockRef.current,e.shards]);var s=u.useCallback(function(g,w){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!i.current.allowPinchZoom;var x=xn(g),b=r.current,y="deltaX"in g?g.deltaX:b[0]-x[0],S="deltaY"in g?g.deltaY:b[1]-x[1],k,M=g.target,j=Math.abs(y)>Math.abs(S)?"h":"v";if("touches"in g&&j==="h"&&M.type==="range")return!1;var T=$d(j,M);if(!T)return!0;if(T?k=j:(k=j==="v"?"h":"v",T=$d(j,M)),!T)return!1;if(!o.current&&"changedTouches"in g&&(y||S)&&(o.current=k),!k)return!0;var L=o.current||k;return X1(L,w,g,L==="h"?y:S)},[]),c=u.useCallback(function(g){var w=g;if(!(!Rr.length||Rr[Rr.length-1]!==a)){var x="deltaY"in w?zd(w):xn(w),b=t.current.filter(function(k){return k.name===w.type&&(k.target===w.target||w.target===k.shadowParent)&&Z1(k.delta,x)})[0];if(b&&b.should){w.cancelable&&w.preventDefault();return}if(!b){var y=(i.current.shards||[]).map(Bd).filter(Boolean).filter(function(k){return k.contains(w.target)}),S=y.length>0?s(w,y[0]):!i.current.noIsolation;S&&w.cancelable&&w.preventDefault()}}},[]),d=u.useCallback(function(g,w,x,b){var y={name:g,delta:w,target:x,should:b,shadowParent:tk(x)};t.current.push(y),setTimeout(function(){t.current=t.current.filter(function(S){return S!==y})},1)},[]),p=u.useCallback(function(g){r.current=xn(g),o.current=void 0},[]),f=u.useCallback(function(g){d(g.type,zd(g),g.target,s(g,e.lockRef.current))},[]),v=u.useCallback(function(g){d(g.type,xn(g),g.target,s(g,e.lockRef.current))},[]);u.useEffect(function(){return Rr.push(a),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:v}),document.addEventListener("wheel",c,Ir),document.addEventListener("touchmove",c,Ir),document.addEventListener("touchstart",p,Ir),function(){Rr=Rr.filter(function(g){return g!==a}),document.removeEventListener("wheel",c,Ir),document.removeEventListener("touchmove",c,Ir),document.removeEventListener("touchstart",p,Ir)}},[]);var m=e.removeScrollBar,h=e.inert;return u.createElement(u.Fragment,null,h?u.createElement(a,{styles:Q1(n)}):null,m?u.createElement(W1,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function tk(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const rk=_1(Ad,ek);var fo=u.forwardRef(function(e,t){return u.createElement(hn,Ct({},e,{ref:t,sideCar:rk}))});fo.classNames=hn.classNames;var wi=["Enter"," "],ok=["ArrowDown","PageUp","Home"],Vd=["ArrowUp","PageDown","End"],nk=[...ok,...Vd],ak={ltr:[...wi,"ArrowRight"],rtl:[...wi,"ArrowLeft"]},ik={ltr:["ArrowLeft"],rtl:["ArrowRight"]},mo="Menu",[go,sk,lk]=tr(mo),[ar,Wd]=De(mo,[lk,Ft,zt]),vo=Ft(),Hd=zt(),[Ud,Bt]=ar(mo),[ck,ho]=ar(mo),Gd=e=>{const{__scopeMenu:t,open:r=!1,children:o,dir:n,onOpenChange:a,modal:i=!0}=e,s=vo(t),[c,d]=u.useState(null),p=u.useRef(!1),f=$e(a),v=jt(n);return u.useEffect(()=>{const m=()=>{p.current=!0,document.addEventListener("pointerdown",h,{capture:!0,once:!0}),document.addEventListener("pointermove",h,{capture:!0,once:!0})},h=()=>p.current=!1;return document.addEventListener("keydown",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",h,{capture:!0}),document.removeEventListener("pointermove",h,{capture:!0})}},[]),l.jsx(lo,{...s,children:l.jsx(Ud,{scope:t,open:r,onOpenChange:f,content:c,onContentChange:d,children:l.jsx(ck,{scope:t,onClose:u.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:p,dir:v,modal:i,children:o})})})};Gd.displayName=mo;var dk="MenuAnchor",xi=u.forwardRef((e,t)=>{const{__scopeMenu:r,...o}=e,n=vo(r);return l.jsx(co,{...n,...o,ref:t})});xi.displayName=dk;var bi="MenuPortal",[uk,Yd]=ar(bi,{forceMount:void 0}),qd=e=>{const{__scopeMenu:t,forceMount:r,children:o,container:n}=e,a=Bt(bi,t);return l.jsx(uk,{scope:t,forceMount:r,children:l.jsx(Re,{present:r||a.open,children:l.jsx(uo,{asChild:!0,container:n,children:o})})})};qd.displayName=bi;var Qe="MenuContent",[pk,yi]=ar(Qe),Kd=u.forwardRef((e,t)=>{const r=Yd(Qe,e.__scopeMenu),{forceMount:o=r.forceMount,...n}=e,a=Bt(Qe,e.__scopeMenu),i=ho(Qe,e.__scopeMenu);return l.jsx(go.Provider,{scope:e.__scopeMenu,children:l.jsx(Re,{present:o||a.open,children:l.jsx(go.Slot,{scope:e.__scopeMenu,children:i.modal?l.jsx(fk,{...n,ref:t}):l.jsx(mk,{...n,ref:t})})})})}),fk=u.forwardRef((e,t)=>{const r=Bt(Qe,e.__scopeMenu),o=u.useRef(null),n=ce(t,o);return u.useEffect(()=>{const a=o.current;if(a)return mn(a)},[]),l.jsx(ki,{...e,ref:n,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:Y(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),mk=u.forwardRef((e,t)=>{const r=Bt(Qe,e.__scopeMenu);return l.jsx(ki,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),gk=Rt("MenuContent.ScrollLock"),ki=u.forwardRef((e,t)=>{const{__scopeMenu:r,loop:o=!1,trapFocus:n,onOpenAutoFocus:a,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:d,onPointerDownOutside:p,onFocusOutside:f,onInteractOutside:v,onDismiss:m,disableOutsideScroll:h,...g}=e,w=Bt(Qe,r),x=ho(Qe,r),b=vo(r),y=Hd(r),S=sk(r),[k,M]=u.useState(null),j=u.useRef(null),T=ce(t,j,w.onContentChange),L=u.useRef(0),O=u.useRef(""),I=u.useRef(0),q=u.useRef(null),te=u.useRef("right"),G=u.useRef(0),ee=h?fo:u.Fragment,U=h?{as:gk,allowPinchZoom:!0}:void 0,Q=F=>{const E=O.current+F,B=S().filter(_=>!_.disabled),P=document.activeElement,A=B.find(_=>_.ref.current===P)?.textValue,$=B.map(_=>_.textValue),V=jk($,E,A),H=B.find(_=>_.textValue===V)?.ref.current;(function _(W){O.current=W,window.clearTimeout(L.current),W!==""&&(L.current=window.setTimeout(()=>_(""),1e3))})(E),H&&setTimeout(()=>H.focus())};u.useEffect(()=>()=>window.clearTimeout(L.current),[]),Xo();const z=u.useCallback(F=>te.current===q.current?.side&&Pk(F,q.current?.area),[]);return l.jsx(pk,{scope:r,searchRef:O,onItemEnter:u.useCallback(F=>{z(F)&&F.preventDefault()},[z]),onItemLeave:u.useCallback(F=>{z(F)||(j.current?.focus(),M(null))},[z]),onTriggerLeave:u.useCallback(F=>{z(F)&&F.preventDefault()},[z]),pointerGraceTimerRef:I,onPointerGraceIntentChange:u.useCallback(F=>{q.current=F},[]),children:l.jsx(ee,{...U,children:l.jsx(oo,{asChild:!0,trapped:n,onMountAutoFocus:Y(a,F=>{F.preventDefault(),j.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:l.jsx(rr,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:d,onPointerDownOutside:p,onFocusOutside:f,onInteractOutside:v,onDismiss:m,children:l.jsx(dn,{asChild:!0,...y,dir:x.dir,orientation:"vertical",loop:o,currentTabStopId:k,onCurrentTabStopIdChange:M,onEntryFocus:Y(c,F=>{x.isUsingKeyboardRef.current||F.preventDefault()}),preventScrollOnEntryFocus:!0,children:l.jsx(sn,{role:"menu","aria-orientation":"vertical","data-state":fu(w.open),"data-radix-menu-content":"",dir:x.dir,...b,...g,ref:T,style:{outline:"none",...g.style},onKeyDown:Y(g.onKeyDown,F=>{const B=F.target.closest("[data-radix-menu-content]")===F.currentTarget,P=F.ctrlKey||F.altKey||F.metaKey,A=F.key.length===1;B&&(F.key==="Tab"&&F.preventDefault(),!P&&A&&Q(F.key));const $=j.current;if(F.target!==$||!nk.includes(F.key))return;F.preventDefault();const H=S().filter(_=>!_.disabled).map(_=>_.ref.current);Vd.includes(F.key)&&H.reverse(),Ek(H)}),onBlur:Y(e.onBlur,F=>{F.currentTarget.contains(F.target)||(window.clearTimeout(L.current),O.current="")}),onPointerMove:Y(e.onPointerMove,xo(F=>{const E=F.target,B=G.current!==F.clientX;if(F.currentTarget.contains(E)&&B){const P=F.clientX>G.current?"right":"left";te.current=P,G.current=F.clientX}}))})})})})})})});Kd.displayName=Qe;var vk="MenuGroup",Ci=u.forwardRef((e,t)=>{const{__scopeMenu:r,...o}=e;return l.jsx(J.div,{role:"group",...o,ref:t})});Ci.displayName=vk;var hk="MenuLabel",Xd=u.forwardRef((e,t)=>{const{__scopeMenu:r,...o}=e;return l.jsx(J.div,{...o,ref:t})});Xd.displayName=hk;var bn="MenuItem",Zd="menu.itemSelect",yn=u.forwardRef((e,t)=>{const{disabled:r=!1,onSelect:o,...n}=e,a=u.useRef(null),i=ho(bn,e.__scopeMenu),s=yi(bn,e.__scopeMenu),c=ce(t,a),d=u.useRef(!1),p=()=>{const f=a.current;if(!r&&f){const v=new CustomEvent(Zd,{bubbles:!0,cancelable:!0});f.addEventListener(Zd,m=>o?.(m),{once:!0}),Ko(f,v),v.defaultPrevented?d.current=!1:i.onClose()}};return l.jsx(Qd,{...n,ref:c,disabled:r,onClick:Y(e.onClick,p),onPointerDown:f=>{e.onPointerDown?.(f),d.current=!0},onPointerUp:Y(e.onPointerUp,f=>{d.current||f.currentTarget?.click()}),onKeyDown:Y(e.onKeyDown,f=>{const v=s.searchRef.current!=="";r||v&&f.key===" "||wi.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})})});yn.displayName=bn;var Qd=u.forwardRef((e,t)=>{const{__scopeMenu:r,disabled:o=!1,textValue:n,...a}=e,i=yi(bn,r),s=Hd(r),c=u.useRef(null),d=ce(t,c),[p,f]=u.useState(!1),[v,m]=u.useState("");return u.useEffect(()=>{const h=c.current;h&&m((h.textContent??"").trim())},[a.children]),l.jsx(go.ItemSlot,{scope:r,disabled:o,textValue:n??v,children:l.jsx(un,{asChild:!0,...s,focusable:!o,children:l.jsx(J.div,{role:"menuitem","data-highlighted":p?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...a,ref:d,onPointerMove:Y(e.onPointerMove,xo(h=>{o?i.onItemLeave(h):(i.onItemEnter(h),h.defaultPrevented||h.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Y(e.onPointerLeave,xo(h=>i.onItemLeave(h))),onFocus:Y(e.onFocus,()=>f(!0)),onBlur:Y(e.onBlur,()=>f(!1))})})})}),wk="MenuCheckboxItem",Jd=u.forwardRef((e,t)=>{const{checked:r=!1,onCheckedChange:o,...n}=e;return l.jsx(nu,{scope:e.__scopeMenu,checked:r,children:l.jsx(yn,{role:"menuitemcheckbox","aria-checked":kn(r)?"mixed":r,...n,ref:t,"data-state":Ni(r),onSelect:Y(n.onSelect,()=>o?.(kn(r)?!0:!r),{checkForDefaultPrevented:!1})})})});Jd.displayName=wk;var eu="MenuRadioGroup",[xk,bk]=ar(eu,{value:void 0,onValueChange:()=>{}}),tu=u.forwardRef((e,t)=>{const{value:r,onValueChange:o,...n}=e,a=$e(o);return l.jsx(xk,{scope:e.__scopeMenu,value:r,onValueChange:a,children:l.jsx(Ci,{...n,ref:t})})});tu.displayName=eu;var ru="MenuRadioItem",ou=u.forwardRef((e,t)=>{const{value:r,...o}=e,n=bk(ru,e.__scopeMenu),a=r===n.value;return l.jsx(nu,{scope:e.__scopeMenu,checked:a,children:l.jsx(yn,{role:"menuitemradio","aria-checked":a,...o,ref:t,"data-state":Ni(a),onSelect:Y(o.onSelect,()=>n.onValueChange?.(r),{checkForDefaultPrevented:!1})})})});ou.displayName=ru;var Si="MenuItemIndicator",[nu,yk]=ar(Si,{checked:!1}),au=u.forwardRef((e,t)=>{const{__scopeMenu:r,forceMount:o,...n}=e,a=yk(Si,r);return l.jsx(Re,{present:o||kn(a.checked)||a.checked===!0,children:l.jsx(J.span,{...n,ref:t,"data-state":Ni(a.checked)})})});au.displayName=Si;var kk="MenuSeparator",iu=u.forwardRef((e,t)=>{const{__scopeMenu:r,...o}=e;return l.jsx(J.div,{role:"separator","aria-orientation":"horizontal",...o,ref:t})});iu.displayName=kk;var Ck="MenuArrow",su=u.forwardRef((e,t)=>{const{__scopeMenu:r,...o}=e,n=vo(r);return l.jsx(ln,{...n,...o,ref:t})});su.displayName=Ck;var Ei="MenuSub",[Sk,lu]=ar(Ei),cu=e=>{const{__scopeMenu:t,children:r,open:o=!1,onOpenChange:n}=e,a=Bt(Ei,t),i=vo(t),[s,c]=u.useState(null),[d,p]=u.useState(null),f=$e(n);return u.useEffect(()=>(a.open===!1&&f(!1),()=>f(!1)),[a.open,f]),l.jsx(lo,{...i,children:l.jsx(Ud,{scope:t,open:o,onOpenChange:f,content:d,onContentChange:p,children:l.jsx(Sk,{scope:t,contentId:je(),triggerId:je(),trigger:s,onTriggerChange:c,children:r})})})};cu.displayName=Ei;var wo="MenuSubTrigger",du=u.forwardRef((e,t)=>{const r=Bt(wo,e.__scopeMenu),o=ho(wo,e.__scopeMenu),n=lu(wo,e.__scopeMenu),a=yi(wo,e.__scopeMenu),i=u.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:c}=a,d={__scopeMenu:e.__scopeMenu},p=u.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return u.useEffect(()=>p,[p]),u.useEffect(()=>{const f=s.current;return()=>{window.clearTimeout(f),c(null)}},[s,c]),l.jsx(xi,{asChild:!0,...d,children:l.jsx(Qd,{id:n.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":n.contentId,"data-state":fu(r.open),...e,ref:ht(t,n.onTriggerChange),onClick:f=>{e.onClick?.(f),!(e.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:Y(e.onPointerMove,xo(f=>{a.onItemEnter(f),!f.defaultPrevented&&!e.disabled&&!r.open&&!i.current&&(a.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{r.onOpenChange(!0),p()},100))})),onPointerLeave:Y(e.onPointerLeave,xo(f=>{p();const v=r.content?.getBoundingClientRect();if(v){const m=r.content?.dataset.side,h=m==="right",g=h?-5:5,w=v[h?"left":"right"],x=v[h?"right":"left"];a.onPointerGraceIntentChange({area:[{x:f.clientX+g,y:f.clientY},{x:w,y:v.top},{x,y:v.top},{x,y:v.bottom},{x:w,y:v.bottom}],side:m}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(f),f.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:Y(e.onKeyDown,f=>{const v=a.searchRef.current!=="";e.disabled||v&&f.key===" "||ak[o.dir].includes(f.key)&&(r.onOpenChange(!0),r.content?.focus(),f.preventDefault())})})})});du.displayName=wo;var uu="MenuSubContent",pu=u.forwardRef((e,t)=>{const r=Yd(Qe,e.__scopeMenu),{forceMount:o=r.forceMount,...n}=e,a=Bt(Qe,e.__scopeMenu),i=ho(Qe,e.__scopeMenu),s=lu(uu,e.__scopeMenu),c=u.useRef(null),d=ce(t,c);return l.jsx(go.Provider,{scope:e.__scopeMenu,children:l.jsx(Re,{present:o||a.open,children:l.jsx(go.Slot,{scope:e.__scopeMenu,children:l.jsx(ki,{id:s.contentId,"aria-labelledby":s.triggerId,...n,ref:d,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:p=>{i.isUsingKeyboardRef.current&&c.current?.focus(),p.preventDefault()},onCloseAutoFocus:p=>p.preventDefault(),onFocusOutside:Y(e.onFocusOutside,p=>{p.target!==s.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:Y(e.onEscapeKeyDown,p=>{i.onClose(),p.preventDefault()}),onKeyDown:Y(e.onKeyDown,p=>{const f=p.currentTarget.contains(p.target),v=ik[i.dir].includes(p.key);f&&v&&(a.onOpenChange(!1),s.trigger?.focus(),p.preventDefault())})})})})})});pu.displayName=uu;function fu(e){return e?"open":"closed"}function kn(e){return e==="indeterminate"}function Ni(e){return kn(e)?"indeterminate":e?"checked":"unchecked"}function Ek(e){const t=document.activeElement;for(const r of e)if(r===t||(r.focus(),document.activeElement!==t))return}function Nk(e,t){return e.map((r,o)=>e[(t+o)%e.length])}function jk(e,t,r){const n=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,a=r?e.indexOf(r):-1;let i=Nk(e,Math.max(a,0));n.length===1&&(i=i.filter(d=>d!==r));const c=i.find(d=>d.toLowerCase().startsWith(n.toLowerCase()));return c!==r?c:void 0}function Tk(e,t){const{x:r,y:o}=e;let n=!1;for(let a=0,i=t.length-1;a<t.length;i=a++){const s=t[a],c=t[i],d=s.x,p=s.y,f=c.x,v=c.y;p>o!=v>o&&r<(f-d)*(o-p)/(v-p)+d&&(n=!n)}return n}function Pk(e,t){if(!t)return!1;const r={x:e.clientX,y:e.clientY};return Tk(r,t)}function xo(e){return t=>t.pointerType==="mouse"?e(t):void 0}var _k=Gd,Mk=xi,Dk=qd,Ak=Kd,Ik=Ci,Rk=Xd,Ok=yn,$k=Jd,Lk=tu,Fk=ou,zk=au,Bk=iu,Vk=su,Wk=cu,Hk=du,Uk=pu,Cn="DropdownMenu",[Gk,pD]=De(Cn,[Wd]),ze=Wd(),[Yk,mu]=Gk(Cn),gu=e=>{const{__scopeDropdownMenu:t,children:r,dir:o,open:n,defaultOpen:a,onOpenChange:i,modal:s=!0}=e,c=ze(t),d=u.useRef(null),[p,f]=Ae({prop:n,defaultProp:a??!1,onChange:i,caller:Cn});return l.jsx(Yk,{scope:t,triggerId:je(),triggerRef:d,contentId:je(),open:p,onOpenChange:f,onOpenToggle:u.useCallback(()=>f(v=>!v),[f]),modal:s,children:l.jsx(_k,{...c,open:p,onOpenChange:f,dir:o,modal:s,children:r})})};gu.displayName=Cn;var vu="DropdownMenuTrigger",hu=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,disabled:o=!1,...n}=e,a=mu(vu,r),i=ze(r);return l.jsx(Mk,{asChild:!0,...i,children:l.jsx(J.button,{type:"button",id:a.triggerId,"aria-haspopup":"menu","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?"open":"closed","data-disabled":o?"":void 0,disabled:o,...n,ref:ht(t,a.triggerRef),onPointerDown:Y(e.onPointerDown,s=>{!o&&s.button===0&&s.ctrlKey===!1&&(a.onOpenToggle(),a.open||s.preventDefault())}),onKeyDown:Y(e.onKeyDown,s=>{o||(["Enter"," "].includes(s.key)&&a.onOpenToggle(),s.key==="ArrowDown"&&a.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(s.key)&&s.preventDefault())})})})});hu.displayName=vu;var qk="DropdownMenuPortal",wu=e=>{const{__scopeDropdownMenu:t,...r}=e,o=ze(t);return l.jsx(Dk,{...o,...r})};wu.displayName=qk;var xu="DropdownMenuContent",bu=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...o}=e,n=mu(xu,r),a=ze(r),i=u.useRef(!1);return l.jsx(Ak,{id:n.contentId,"aria-labelledby":n.triggerId,...a,...o,ref:t,onCloseAutoFocus:Y(e.onCloseAutoFocus,s=>{i.current||n.triggerRef.current?.focus(),i.current=!1,s.preventDefault()}),onInteractOutside:Y(e.onInteractOutside,s=>{const c=s.detail.originalEvent,d=c.button===0&&c.ctrlKey===!0,p=c.button===2||d;(!n.modal||p)&&(i.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});bu.displayName=xu;var Kk="DropdownMenuGroup",yu=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...o}=e,n=ze(r);return l.jsx(Ik,{...n,...o,ref:t})});yu.displayName=Kk;var Xk="DropdownMenuLabel",ku=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...o}=e,n=ze(r);return l.jsx(Rk,{...n,...o,ref:t})});ku.displayName=Xk;var Zk="DropdownMenuItem",Cu=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...o}=e,n=ze(r);return l.jsx(Ok,{...n,...o,ref:t})});Cu.displayName=Zk;var Qk="DropdownMenuCheckboxItem",Su=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...o}=e,n=ze(r);return l.jsx($k,{...n,...o,ref:t})});Su.displayName=Qk;var Jk="DropdownMenuRadioGroup",Eu=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...o}=e,n=ze(r);return l.jsx(Lk,{...n,...o,ref:t})});Eu.displayName=Jk;var eC="DropdownMenuRadioItem",Nu=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...o}=e,n=ze(r);return l.jsx(Fk,{...n,...o,ref:t})});Nu.displayName=eC;var tC="DropdownMenuItemIndicator",ju=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...o}=e,n=ze(r);return l.jsx(zk,{...n,...o,ref:t})});ju.displayName=tC;var rC="DropdownMenuSeparator",Tu=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...o}=e,n=ze(r);return l.jsx(Bk,{...n,...o,ref:t})});Tu.displayName=rC;var oC="DropdownMenuArrow",nC=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...o}=e,n=ze(r);return l.jsx(Vk,{...n,...o,ref:t})});nC.displayName=oC;var aC=e=>{const{__scopeDropdownMenu:t,children:r,open:o,onOpenChange:n,defaultOpen:a}=e,i=ze(t),[s,c]=Ae({prop:o,defaultProp:a??!1,onChange:n,caller:"DropdownMenuSub"});return l.jsx(Wk,{...i,open:s,onOpenChange:c,children:r})},iC="DropdownMenuSubTrigger",Pu=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...o}=e,n=ze(r);return l.jsx(Hk,{...n,...o,ref:t})});Pu.displayName=iC;var sC="DropdownMenuSubContent",_u=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...o}=e,n=ze(r);return l.jsx(Uk,{...n,...o,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});_u.displayName=sC;var lC=gu,cC=hu,Mu=wu,Du=bu,dC=yu,Au=ku,Iu=Cu,Ru=Su,uC=Eu,Ou=Nu,$u=ju,Lu=Tu,pC=aC,Fu=Pu,zu=_u;const Bu=lC,Vu=cC,fC=dC,mC=Mu,gC=pC,vC=uC,Wu=u.forwardRef(({className:e,inset:t,children:r,...o},n)=>l.jsxs(Fu,{ref:n,className:R("flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...o,children:[r,l.jsx(to,{className:"ml-auto"})]}));Wu.displayName=Fu.displayName;const Hu=u.forwardRef(({className:e,...t},r)=>l.jsx(zu,{ref:r,className:R("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));Hu.displayName=zu.displayName;const ji=u.forwardRef(({className:e,sideOffset:t=4,...r},o)=>l.jsx(Mu,{children:l.jsx(Du,{ref:o,sideOffset:t,className:R("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})}));ji.displayName=Du.displayName;const Uu=u.forwardRef(({className:e,inset:t,...r},o)=>l.jsx(Iu,{ref:o,className:R("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",t&&"pl-8",e),...r}));Uu.displayName=Iu.displayName;const Ti=u.forwardRef(({className:e,children:t,checked:r,...o},n)=>l.jsxs(Ru,{ref:n,className:R("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:r,...o,children:[l.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:l.jsx($u,{children:l.jsx(eo,{className:"h-4 w-4"})})}),t]}));Ti.displayName=Ru.displayName;const Gu=u.forwardRef(({className:e,children:t,...r},o)=>l.jsxs(Ou,{ref:o,className:R("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[l.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:l.jsx($u,{children:l.jsx(Pc,{className:"h-2 w-2 fill-current"})})}),t]}));Gu.displayName=Ou.displayName;const Pi=u.forwardRef(({className:e,inset:t,...r},o)=>l.jsx(Au,{ref:o,className:R("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...r}));Pi.displayName=Au.displayName;const Sn=u.forwardRef(({className:e,...t},r)=>l.jsx(Lu,{ref:r,className:R("-mx-1 my-1 h-px bg-muted",e),...t}));Sn.displayName=Lu.displayName;const Yu=({className:e,...t})=>l.jsx("span",{className:R("ml-auto text-xs tracking-widest opacity-60",e),...t});Yu.displayName="DropdownMenuShortcut";function hC({columns:e,onToggleVisibility:t,onReset:r}){return l.jsxs(Bu,{children:[l.jsx(Vu,{asChild:!0,children:l.jsxs(ve,{variant:"outline",className:"ml-auto",children:[l.jsx(ub,{className:"h-4 w-4 mr-2"}),"Columns"]})}),l.jsxs(ji,{align:"end",className:"w-48",children:[l.jsx(Pi,{children:"Toggle columns"}),l.jsx(Sn,{}),e.map(o=>l.jsx(Ti,{checked:!o.hidden,onCheckedChange:n=>t(String(o.key),n),children:o.title},String(o.key))),l.jsx(Sn,{}),l.jsx(ve,{variant:"ghost",size:"sm",className:"w-full justify-start",onClick:r,children:"Reset columns"})]})]})}function En(e,[t,r]){return Math.min(r,Math.max(t,e))}function Or(e){const t=u.useRef({value:e,previous:e});return u.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var qu=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),wC="VisuallyHidden",Ku=u.forwardRef((e,t)=>l.jsx(J.span,{...e,ref:t,style:{...qu,...e.style}}));Ku.displayName=wC;var Xu=Ku,xC=[" ","Enter","ArrowUp","ArrowDown"],bC=[" ","Enter"],ir="Select",[Nn,jn,yC]=tr(ir),[$r,fD]=De(ir,[yC,Ft]),Tn=Ft(),[kC,Vt]=$r(ir),[CC,SC]=$r(ir),Zu=e=>{const{__scopeSelect:t,children:r,open:o,defaultOpen:n,onOpenChange:a,value:i,defaultValue:s,onValueChange:c,dir:d,name:p,autoComplete:f,disabled:v,required:m,form:h}=e,g=Tn(t),[w,x]=u.useState(null),[b,y]=u.useState(null),[S,k]=u.useState(!1),M=jt(d),[j,T]=Ae({prop:o,defaultProp:n??!1,onChange:a,caller:ir}),[L,O]=Ae({prop:i,defaultProp:s,onChange:c,caller:ir}),I=u.useRef(null),q=w?h||!!w.closest("form"):!0,[te,G]=u.useState(new Set),ee=Array.from(te).map(U=>U.props.value).join(";");return l.jsx(lo,{...g,children:l.jsxs(kC,{required:m,scope:t,trigger:w,onTriggerChange:x,valueNode:b,onValueNodeChange:y,valueNodeHasChildren:S,onValueNodeHasChildrenChange:k,contentId:je(),value:L,onValueChange:O,open:j,onOpenChange:T,dir:M,triggerPointerDownPosRef:I,disabled:v,children:[l.jsx(Nn.Provider,{scope:t,children:l.jsx(CC,{scope:e.__scopeSelect,onNativeOptionAdd:u.useCallback(U=>{G(Q=>new Set(Q).add(U))},[]),onNativeOptionRemove:u.useCallback(U=>{G(Q=>{const z=new Set(Q);return z.delete(U),z})},[]),children:r})}),q?l.jsxs(yp,{"aria-hidden":!0,required:m,tabIndex:-1,name:p,autoComplete:f,value:L,onChange:U=>O(U.target.value),disabled:v,form:h,children:[L===void 0?l.jsx("option",{value:""}):null,Array.from(te)]},ee):null]})})};Zu.displayName=ir;var Qu="SelectTrigger",Ju=u.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:o=!1,...n}=e,a=Tn(r),i=Vt(Qu,r),s=i.disabled||o,c=ce(t,i.onTriggerChange),d=jn(r),p=u.useRef("touch"),[f,v,m]=Cp(g=>{const w=d().filter(y=>!y.disabled),x=w.find(y=>y.value===i.value),b=Sp(w,g,x);b!==void 0&&i.onValueChange(b.value)}),h=g=>{s||(i.onOpenChange(!0),m()),g&&(i.triggerPointerDownPosRef.current={x:Math.round(g.pageX),y:Math.round(g.pageY)})};return l.jsx(co,{asChild:!0,...a,children:l.jsx(J.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:s,"data-disabled":s?"":void 0,"data-placeholder":kp(i.value)?"":void 0,...n,ref:c,onClick:Y(n.onClick,g=>{g.currentTarget.focus(),p.current!=="mouse"&&h(g)}),onPointerDown:Y(n.onPointerDown,g=>{p.current=g.pointerType;const w=g.target;w.hasPointerCapture(g.pointerId)&&w.releasePointerCapture(g.pointerId),g.button===0&&g.ctrlKey===!1&&g.pointerType==="mouse"&&(h(g),g.preventDefault())}),onKeyDown:Y(n.onKeyDown,g=>{const w=f.current!=="";!(g.ctrlKey||g.altKey||g.metaKey)&&g.key.length===1&&v(g.key),!(w&&g.key===" ")&&xC.includes(g.key)&&(h(),g.preventDefault())})})})});Ju.displayName=Qu;var ep="SelectValue",tp=u.forwardRef((e,t)=>{const{__scopeSelect:r,className:o,style:n,children:a,placeholder:i="",...s}=e,c=Vt(ep,r),{onValueNodeHasChildrenChange:d}=c,p=a!==void 0,f=ce(t,c.onValueNodeChange);return Te(()=>{d(p)},[d,p]),l.jsx(J.span,{...s,ref:f,style:{pointerEvents:"none"},children:kp(c.value)?l.jsx(l.Fragment,{children:i}):a})});tp.displayName=ep;var EC="SelectIcon",rp=u.forwardRef((e,t)=>{const{__scopeSelect:r,children:o,...n}=e;return l.jsx(J.span,{"aria-hidden":!0,...n,ref:t,children:o||"▼"})});rp.displayName=EC;var sr="SelectContent",op=u.forwardRef((e,t)=>{const r=Vt(sr,e.__scopeSelect),[o,n]=u.useState();if(Te(()=>{n(new DocumentFragment)},[]),!r.open){const a=o;return a?Lo.createPortal(l.jsx(np,{scope:e.__scopeSelect,children:l.jsx(Nn.Slot,{scope:e.__scopeSelect,children:l.jsx("div",{children:e.children})})}),a):null}return l.jsx(ap,{...e,ref:t})});op.displayName=sr;var at=10,[np,Wt]=$r(sr),NC="SelectContentImpl",jC=Rt("SelectContent.RemoveScroll"),ap=u.forwardRef((e,t)=>{const{__scopeSelect:r,position:o="item-aligned",onCloseAutoFocus:n,onEscapeKeyDown:a,onPointerDownOutside:i,side:s,sideOffset:c,align:d,alignOffset:p,arrowPadding:f,collisionBoundary:v,collisionPadding:m,sticky:h,hideWhenDetached:g,avoidCollisions:w,...x}=e,b=Vt(sr,r),[y,S]=u.useState(null),[k,M]=u.useState(null),j=ce(t,_=>S(_)),[T,L]=u.useState(null),[O,I]=u.useState(null),q=jn(r),[te,G]=u.useState(!1),ee=u.useRef(!1);u.useEffect(()=>{if(y)return mn(y)},[y]),Xo();const U=u.useCallback(_=>{const[W,...X]=q().map(D=>D.ref.current),[K]=X.slice(-1),re=document.activeElement;for(const D of _)if(D===re||(D?.scrollIntoView({block:"nearest"}),D===W&&k&&(k.scrollTop=0),D===K&&k&&(k.scrollTop=k.scrollHeight),D?.focus(),document.activeElement!==re))return},[q,k]),Q=u.useCallback(()=>U([T,y]),[U,T,y]);u.useEffect(()=>{te&&Q()},[te,Q]);const{onOpenChange:z,triggerPointerDownPosRef:F}=b;u.useEffect(()=>{if(y){let _={x:0,y:0};const W=K=>{_={x:Math.abs(Math.round(K.pageX)-(F.current?.x??0)),y:Math.abs(Math.round(K.pageY)-(F.current?.y??0))}},X=K=>{_.x<=10&&_.y<=10?K.preventDefault():y.contains(K.target)||z(!1),document.removeEventListener("pointermove",W),F.current=null};return F.current!==null&&(document.addEventListener("pointermove",W),document.addEventListener("pointerup",X,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",W),document.removeEventListener("pointerup",X,{capture:!0})}}},[y,z,F]),u.useEffect(()=>{const _=()=>z(!1);return window.addEventListener("blur",_),window.addEventListener("resize",_),()=>{window.removeEventListener("blur",_),window.removeEventListener("resize",_)}},[z]);const[E,B]=Cp(_=>{const W=q().filter(re=>!re.disabled),X=W.find(re=>re.ref.current===document.activeElement),K=Sp(W,_,X);K&&setTimeout(()=>K.ref.current.focus())}),P=u.useCallback((_,W,X)=>{const K=!ee.current&&!X;(b.value!==void 0&&b.value===W||K)&&(L(_),K&&(ee.current=!0))},[b.value]),A=u.useCallback(()=>y?.focus(),[y]),$=u.useCallback((_,W,X)=>{const K=!ee.current&&!X;(b.value!==void 0&&b.value===W||K)&&I(_)},[b.value]),V=o==="popper"?_i:ip,H=V===_i?{side:s,sideOffset:c,align:d,alignOffset:p,arrowPadding:f,collisionBoundary:v,collisionPadding:m,sticky:h,hideWhenDetached:g,avoidCollisions:w}:{};return l.jsx(np,{scope:r,content:y,viewport:k,onViewportChange:M,itemRefCallback:P,selectedItem:T,onItemLeave:A,itemTextRefCallback:$,focusSelectedItem:Q,selectedItemText:O,position:o,isPositioned:te,searchRef:E,children:l.jsx(fo,{as:jC,allowPinchZoom:!0,children:l.jsx(oo,{asChild:!0,trapped:b.open,onMountAutoFocus:_=>{_.preventDefault()},onUnmountAutoFocus:Y(n,_=>{b.trigger?.focus({preventScroll:!0}),_.preventDefault()}),children:l.jsx(rr,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:i,onFocusOutside:_=>_.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:l.jsx(V,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:_=>_.preventDefault(),...x,...H,onPlaced:()=>G(!0),ref:j,style:{display:"flex",flexDirection:"column",outline:"none",...x.style},onKeyDown:Y(x.onKeyDown,_=>{const W=_.ctrlKey||_.altKey||_.metaKey;if(_.key==="Tab"&&_.preventDefault(),!W&&_.key.length===1&&B(_.key),["ArrowUp","ArrowDown","Home","End"].includes(_.key)){let K=q().filter(re=>!re.disabled).map(re=>re.ref.current);if(["ArrowUp","End"].includes(_.key)&&(K=K.slice().reverse()),["ArrowUp","ArrowDown"].includes(_.key)){const re=_.target,D=K.indexOf(re);K=K.slice(D+1)}setTimeout(()=>U(K)),_.preventDefault()}})})})})})})});ap.displayName=NC;var TC="SelectItemAlignedPosition",ip=u.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:o,...n}=e,a=Vt(sr,r),i=Wt(sr,r),[s,c]=u.useState(null),[d,p]=u.useState(null),f=ce(t,j=>p(j)),v=jn(r),m=u.useRef(!1),h=u.useRef(!0),{viewport:g,selectedItem:w,selectedItemText:x,focusSelectedItem:b}=i,y=u.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&d&&g&&w&&x){const j=a.trigger.getBoundingClientRect(),T=d.getBoundingClientRect(),L=a.valueNode.getBoundingClientRect(),O=x.getBoundingClientRect();if(a.dir!=="rtl"){const re=O.left-T.left,D=L.left-re,ie=j.left-D,ue=j.width+ie,we=Math.max(ue,T.width),Ne=window.innerWidth-at,Z=En(D,[at,Math.max(at,Ne-we)]);s.style.minWidth=ue+"px",s.style.left=Z+"px"}else{const re=T.right-O.right,D=window.innerWidth-L.right-re,ie=window.innerWidth-j.right-D,ue=j.width+ie,we=Math.max(ue,T.width),Ne=window.innerWidth-at,Z=En(D,[at,Math.max(at,Ne-we)]);s.style.minWidth=ue+"px",s.style.right=Z+"px"}const I=v(),q=window.innerHeight-at*2,te=g.scrollHeight,G=window.getComputedStyle(d),ee=parseInt(G.borderTopWidth,10),U=parseInt(G.paddingTop,10),Q=parseInt(G.borderBottomWidth,10),z=parseInt(G.paddingBottom,10),F=ee+U+te+z+Q,E=Math.min(w.offsetHeight*5,F),B=window.getComputedStyle(g),P=parseInt(B.paddingTop,10),A=parseInt(B.paddingBottom,10),$=j.top+j.height/2-at,V=q-$,H=w.offsetHeight/2,_=w.offsetTop+H,W=ee+U+_,X=F-W;if(W<=$){const re=I.length>0&&w===I[I.length-1].ref.current;s.style.bottom="0px";const D=d.clientHeight-g.offsetTop-g.offsetHeight,ie=Math.max(V,H+(re?A:0)+D+Q),ue=W+ie;s.style.height=ue+"px"}else{const re=I.length>0&&w===I[0].ref.current;s.style.top="0px";const ie=Math.max($,ee+g.offsetTop+(re?P:0)+H)+X;s.style.height=ie+"px",g.scrollTop=W-$+g.offsetTop}s.style.margin=`${at}px 0`,s.style.minHeight=E+"px",s.style.maxHeight=q+"px",o?.(),requestAnimationFrame(()=>m.current=!0)}},[v,a.trigger,a.valueNode,s,d,g,w,x,a.dir,o]);Te(()=>y(),[y]);const[S,k]=u.useState();Te(()=>{d&&k(window.getComputedStyle(d).zIndex)},[d]);const M=u.useCallback(j=>{j&&h.current===!0&&(y(),b?.(),h.current=!1)},[y,b]);return l.jsx(_C,{scope:r,contentWrapper:s,shouldExpandOnScrollRef:m,onScrollButtonChange:M,children:l.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:l.jsx(J.div,{...n,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...n.style}})})})});ip.displayName=TC;var PC="SelectPopperPosition",_i=u.forwardRef((e,t)=>{const{__scopeSelect:r,align:o="start",collisionPadding:n=at,...a}=e,i=Tn(r);return l.jsx(sn,{...i,...a,ref:t,align:o,collisionPadding:n,style:{boxSizing:"border-box",...a.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});_i.displayName=PC;var[_C,Mi]=$r(sr,{}),Di="SelectViewport",sp=u.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:o,...n}=e,a=Wt(Di,r),i=Mi(Di,r),s=ce(t,a.onViewportChange),c=u.useRef(0);return l.jsxs(l.Fragment,{children:[l.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),l.jsx(Nn.Slot,{scope:r,children:l.jsx(J.div,{"data-radix-select-viewport":"",role:"presentation",...n,ref:s,style:{position:"relative",flex:1,overflow:"hidden auto",...n.style},onScroll:Y(n.onScroll,d=>{const p=d.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:v}=i;if(v?.current&&f){const m=Math.abs(c.current-p.scrollTop);if(m>0){const h=window.innerHeight-at*2,g=parseFloat(f.style.minHeight),w=parseFloat(f.style.height),x=Math.max(g,w);if(x<h){const b=x+m,y=Math.min(h,b),S=b-y;f.style.height=y+"px",f.style.bottom==="0px"&&(p.scrollTop=S>0?S:0,f.style.justifyContent="flex-end")}}}c.current=p.scrollTop})})})]})});sp.displayName=Di;var lp="SelectGroup",[MC,DC]=$r(lp),cp=u.forwardRef((e,t)=>{const{__scopeSelect:r,...o}=e,n=je();return l.jsx(MC,{scope:r,id:n,children:l.jsx(J.div,{role:"group","aria-labelledby":n,...o,ref:t})})});cp.displayName=lp;var dp="SelectLabel",up=u.forwardRef((e,t)=>{const{__scopeSelect:r,...o}=e,n=DC(dp,r);return l.jsx(J.div,{id:n.id,...o,ref:t})});up.displayName=dp;var Pn="SelectItem",[AC,pp]=$r(Pn),fp=u.forwardRef((e,t)=>{const{__scopeSelect:r,value:o,disabled:n=!1,textValue:a,...i}=e,s=Vt(Pn,r),c=Wt(Pn,r),d=s.value===o,[p,f]=u.useState(a??""),[v,m]=u.useState(!1),h=ce(t,b=>c.itemRefCallback?.(b,o,n)),g=je(),w=u.useRef("touch"),x=()=>{n||(s.onValueChange(o),s.onOpenChange(!1))};if(o==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return l.jsx(AC,{scope:r,value:o,disabled:n,textId:g,isSelected:d,onItemTextChange:u.useCallback(b=>{f(y=>y||(b?.textContent??"").trim())},[]),children:l.jsx(Nn.ItemSlot,{scope:r,value:o,disabled:n,textValue:p,children:l.jsx(J.div,{role:"option","aria-labelledby":g,"data-highlighted":v?"":void 0,"aria-selected":d&&v,"data-state":d?"checked":"unchecked","aria-disabled":n||void 0,"data-disabled":n?"":void 0,tabIndex:n?void 0:-1,...i,ref:h,onFocus:Y(i.onFocus,()=>m(!0)),onBlur:Y(i.onBlur,()=>m(!1)),onClick:Y(i.onClick,()=>{w.current!=="mouse"&&x()}),onPointerUp:Y(i.onPointerUp,()=>{w.current==="mouse"&&x()}),onPointerDown:Y(i.onPointerDown,b=>{w.current=b.pointerType}),onPointerMove:Y(i.onPointerMove,b=>{w.current=b.pointerType,n?c.onItemLeave?.():w.current==="mouse"&&b.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Y(i.onPointerLeave,b=>{b.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:Y(i.onKeyDown,b=>{c.searchRef?.current!==""&&b.key===" "||(bC.includes(b.key)&&x(),b.key===" "&&b.preventDefault())})})})})});fp.displayName=Pn;var bo="SelectItemText",mp=u.forwardRef((e,t)=>{const{__scopeSelect:r,className:o,style:n,...a}=e,i=Vt(bo,r),s=Wt(bo,r),c=pp(bo,r),d=SC(bo,r),[p,f]=u.useState(null),v=ce(t,x=>f(x),c.onItemTextChange,x=>s.itemTextRefCallback?.(x,c.value,c.disabled)),m=p?.textContent,h=u.useMemo(()=>l.jsx("option",{value:c.value,disabled:c.disabled,children:m},c.value),[c.disabled,c.value,m]),{onNativeOptionAdd:g,onNativeOptionRemove:w}=d;return Te(()=>(g(h),()=>w(h)),[g,w,h]),l.jsxs(l.Fragment,{children:[l.jsx(J.span,{id:c.textId,...a,ref:v}),c.isSelected&&i.valueNode&&!i.valueNodeHasChildren?Lo.createPortal(a.children,i.valueNode):null]})});mp.displayName=bo;var gp="SelectItemIndicator",vp=u.forwardRef((e,t)=>{const{__scopeSelect:r,...o}=e;return pp(gp,r).isSelected?l.jsx(J.span,{"aria-hidden":!0,...o,ref:t}):null});vp.displayName=gp;var Ai="SelectScrollUpButton",hp=u.forwardRef((e,t)=>{const r=Wt(Ai,e.__scopeSelect),o=Mi(Ai,e.__scopeSelect),[n,a]=u.useState(!1),i=ce(t,o.onScrollButtonChange);return Te(()=>{if(r.viewport&&r.isPositioned){let s=function(){const d=c.scrollTop>0;a(d)};const c=r.viewport;return s(),c.addEventListener("scroll",s),()=>c.removeEventListener("scroll",s)}},[r.viewport,r.isPositioned]),n?l.jsx(xp,{...e,ref:i,onAutoScroll:()=>{const{viewport:s,selectedItem:c}=r;s&&c&&(s.scrollTop=s.scrollTop-c.offsetHeight)}}):null});hp.displayName=Ai;var Ii="SelectScrollDownButton",wp=u.forwardRef((e,t)=>{const r=Wt(Ii,e.__scopeSelect),o=Mi(Ii,e.__scopeSelect),[n,a]=u.useState(!1),i=ce(t,o.onScrollButtonChange);return Te(()=>{if(r.viewport&&r.isPositioned){let s=function(){const d=c.scrollHeight-c.clientHeight,p=Math.ceil(c.scrollTop)<d;a(p)};const c=r.viewport;return s(),c.addEventListener("scroll",s),()=>c.removeEventListener("scroll",s)}},[r.viewport,r.isPositioned]),n?l.jsx(xp,{...e,ref:i,onAutoScroll:()=>{const{viewport:s,selectedItem:c}=r;s&&c&&(s.scrollTop=s.scrollTop+c.offsetHeight)}}):null});wp.displayName=Ii;var xp=u.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:o,...n}=e,a=Wt("SelectScrollButton",r),i=u.useRef(null),s=jn(r),c=u.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return u.useEffect(()=>()=>c(),[c]),Te(()=>{s().find(p=>p.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[s]),l.jsx(J.div,{"aria-hidden":!0,...n,ref:t,style:{flexShrink:0,...n.style},onPointerDown:Y(n.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(o,50))}),onPointerMove:Y(n.onPointerMove,()=>{a.onItemLeave?.(),i.current===null&&(i.current=window.setInterval(o,50))}),onPointerLeave:Y(n.onPointerLeave,()=>{c()})})}),IC="SelectSeparator",bp=u.forwardRef((e,t)=>{const{__scopeSelect:r,...o}=e;return l.jsx(J.div,{"aria-hidden":!0,...o,ref:t})});bp.displayName=IC;var Ri="SelectArrow",RC=u.forwardRef((e,t)=>{const{__scopeSelect:r,...o}=e,n=Tn(r),a=Vt(Ri,r),i=Wt(Ri,r);return a.open&&i.position==="popper"?l.jsx(ln,{...n,...o,ref:t}):null});RC.displayName=Ri;var OC="SelectBubbleInput",yp=u.forwardRef(({__scopeSelect:e,value:t,...r},o)=>{const n=u.useRef(null),a=ce(o,n),i=Or(t);return u.useEffect(()=>{const s=n.current;if(!s)return;const c=window.HTMLSelectElement.prototype,p=Object.getOwnPropertyDescriptor(c,"value").set;if(i!==t&&p){const f=new Event("change",{bubbles:!0});p.call(s,t),s.dispatchEvent(f)}},[i,t]),l.jsx(J.select,{...r,style:{...qu,...r.style},ref:a,defaultValue:t})});yp.displayName=OC;function kp(e){return e===""||e===void 0}function Cp(e){const t=$e(e),r=u.useRef(""),o=u.useRef(0),n=u.useCallback(i=>{const s=r.current+i;t(s),function c(d){r.current=d,window.clearTimeout(o.current),d!==""&&(o.current=window.setTimeout(()=>c(""),1e3))}(s)},[t]),a=u.useCallback(()=>{r.current="",window.clearTimeout(o.current)},[]);return u.useEffect(()=>()=>window.clearTimeout(o.current),[]),[r,n,a]}function Sp(e,t,r){const n=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,a=r?e.indexOf(r):-1;let i=$C(e,Math.max(a,0));n.length===1&&(i=i.filter(d=>d!==r));const c=i.find(d=>d.textValue.toLowerCase().startsWith(n.toLowerCase()));return c!==r?c:void 0}function $C(e,t){return e.map((r,o)=>e[(t+o)%e.length])}var LC=Zu,Ep=Ju,FC=tp,zC=rp,Np=op,BC=sp,VC=cp,jp=up,Tp=fp,WC=mp,HC=vp,Pp=hp,_p=wp,Mp=bp;const Oi=LC,UC=VC,$i=FC,_n=u.forwardRef(({className:e,children:t,...r},o)=>l.jsxs(Ep,{ref:o,className:R("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...r,children:[t,l.jsx(zC,{asChild:!0,children:l.jsx(Cr,{className:"h-4 w-4 opacity-50"})})]}));_n.displayName=Ep.displayName;const Li=u.forwardRef(({className:e,...t},r)=>l.jsx(Pp,{ref:r,className:R("flex cursor-default items-center justify-center py-1",e),...t,children:l.jsx(Ec,{className:"h-4 w-4"})}));Li.displayName=Pp.displayName;const Fi=u.forwardRef(({className:e,...t},r)=>l.jsx(_p,{ref:r,className:R("flex cursor-default items-center justify-center py-1",e),...t,children:l.jsx(Cr,{className:"h-4 w-4"})}));Fi.displayName=_p.displayName;const Mn=u.forwardRef(({className:e,children:t,position:r="popper",...o},n)=>l.jsxs(Np,{ref:n,className:R("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...o,children:[l.jsx(Li,{}),l.jsx(BC,{className:R("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),l.jsx(Fi,{})]}));Mn.displayName=Np.displayName;const Dp=u.forwardRef(({className:e,...t},r)=>l.jsx(jp,{ref:r,className:R("px-2 py-1.5 text-sm font-semibold",e),...t}));Dp.displayName=jp.displayName;const Ht=u.forwardRef(({className:e,children:t,...r},o)=>l.jsxs(Tp,{ref:o,className:R("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[l.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:l.jsx(HC,{children:l.jsx(eo,{className:"h-4 w-4"})})}),l.jsx(WC,{children:t})]}));Ht.displayName=Tp.displayName;const Ap=u.forwardRef(({className:e,...t},r)=>l.jsx(Mp,{ref:r,className:R("-mx-1 my-1 h-px bg-muted",e),...t}));Ap.displayName=Mp.displayName;function GC({filter:e,value:t,onChange:r}){return l.jsxs(Oi,{value:t||"all",onValueChange:r,children:[l.jsx(_n,{className:"w-40",children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(ob,{className:"h-4 w-4"}),l.jsx($i,{placeholder:e.label})]})}),l.jsxs(Mn,{children:[l.jsxs(Ht,{value:"all",children:["All ",e.label]}),e.options.map(o=>l.jsx(Ht,{value:o.value,children:o.label},o.value))]})]})}const YC=wt("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",{variants:{sizing:{sm:"h-8 text-xs px-2",md:"h-10 text-sm px-3",lg:"h-12 text-base px-4",xl:"h-14 text-lg px-5","2xl":"h-16 text-xl px-6"}},defaultVariants:{sizing:"md"}}),Lr=u.forwardRef(({className:e,sizing:t,type:r,...o},n)=>l.jsx("input",{type:r,className:R(YC({sizing:t,className:e})),ref:n,...o}));Lr.displayName="Input";function qC({value:e,onChange:t,placeholder:r="Search..."}){return l.jsxs("div",{className:"relative flex-1 max-w-sm",children:[l.jsx(Ga,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-muted-foreground h-4 w-4"}),l.jsx(Lr,{placeholder:r,value:e,onChange:o=>t(o.target.value),className:"pl-10"})]})}function KC({selectedCount:e,onClearSelection:t}){return e===0?null:l.jsxs("div",{className:"bg-muted/50 p-2 rounded-md flex items-center justify-between",children:[l.jsxs("div",{className:"text-sm",children:[l.jsx("span",{className:"font-medium",children:e})," ",e===1?"row":"rows"," selected"]}),l.jsx(ve,{variant:"ghost",size:"sm",onClick:t,children:"Clear selection"})]})}var Dn="Checkbox",[XC,mD]=De(Dn),[ZC,zi]=XC(Dn);function QC(e){const{__scopeCheckbox:t,checked:r,children:o,defaultChecked:n,disabled:a,form:i,name:s,onCheckedChange:c,required:d,value:p="on",internal_do_not_use_render:f}=e,[v,m]=Ae({prop:r,defaultProp:n??!1,onChange:c,caller:Dn}),[h,g]=u.useState(null),[w,x]=u.useState(null),b=u.useRef(!1),y=h?!!i||!!h.closest("form"):!0,S={checked:v,disabled:a,setChecked:m,control:h,setControl:g,name:s,form:i,value:p,hasConsumerStoppedPropagationRef:b,required:d,defaultChecked:Ut(n)?!1:n,isFormControl:y,bubbleInput:w,setBubbleInput:x};return l.jsx(ZC,{scope:t,...S,children:JC(f)?f(S):o})}var Ip="CheckboxTrigger",Rp=u.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:r,...o},n)=>{const{control:a,value:i,disabled:s,checked:c,required:d,setControl:p,setChecked:f,hasConsumerStoppedPropagationRef:v,isFormControl:m,bubbleInput:h}=zi(Ip,e),g=ce(n,p),w=u.useRef(c);return u.useEffect(()=>{const x=a?.form;if(x){const b=()=>f(w.current);return x.addEventListener("reset",b),()=>x.removeEventListener("reset",b)}},[a,f]),l.jsx(J.button,{type:"button",role:"checkbox","aria-checked":Ut(c)?"mixed":c,"aria-required":d,"data-state":zp(c),"data-disabled":s?"":void 0,disabled:s,value:i,...o,ref:g,onKeyDown:Y(t,x=>{x.key==="Enter"&&x.preventDefault()}),onClick:Y(r,x=>{f(b=>Ut(b)?!0:!b),h&&m&&(v.current=x.isPropagationStopped(),v.current||x.stopPropagation())})})});Rp.displayName=Ip;var Bi=u.forwardRef((e,t)=>{const{__scopeCheckbox:r,name:o,checked:n,defaultChecked:a,required:i,disabled:s,value:c,onCheckedChange:d,form:p,...f}=e;return l.jsx(QC,{__scopeCheckbox:r,checked:n,defaultChecked:a,disabled:s,required:i,onCheckedChange:d,name:o,form:p,value:c,internal_do_not_use_render:({isFormControl:v})=>l.jsxs(l.Fragment,{children:[l.jsx(Rp,{...f,ref:t,__scopeCheckbox:r}),v&&l.jsx(Fp,{__scopeCheckbox:r})]})})});Bi.displayName=Dn;var Op="CheckboxIndicator",$p=u.forwardRef((e,t)=>{const{__scopeCheckbox:r,forceMount:o,...n}=e,a=zi(Op,r);return l.jsx(Re,{present:o||Ut(a.checked)||a.checked===!0,children:l.jsx(J.span,{"data-state":zp(a.checked),"data-disabled":a.disabled?"":void 0,...n,ref:t,style:{pointerEvents:"none",...e.style}})})});$p.displayName=Op;var Lp="CheckboxBubbleInput",Fp=u.forwardRef(({__scopeCheckbox:e,...t},r)=>{const{control:o,hasConsumerStoppedPropagationRef:n,checked:a,defaultChecked:i,required:s,disabled:c,name:d,value:p,form:f,bubbleInput:v,setBubbleInput:m}=zi(Lp,e),h=ce(r,m),g=Or(a),w=so(o);u.useEffect(()=>{const b=v;if(!b)return;const y=window.HTMLInputElement.prototype,k=Object.getOwnPropertyDescriptor(y,"checked").set,M=!n.current;if(g!==a&&k){const j=new Event("click",{bubbles:M});b.indeterminate=Ut(a),k.call(b,Ut(a)?!1:a),b.dispatchEvent(j)}},[v,g,a,n]);const x=u.useRef(Ut(a)?!1:a);return l.jsx(J.input,{type:"checkbox","aria-hidden":!0,defaultChecked:i??x.current,required:s,disabled:c,name:d,value:p,form:f,...t,tabIndex:-1,ref:h,style:{...t.style,...w,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});Fp.displayName=Lp;function JC(e){return typeof e=="function"}function Ut(e){return e==="indeterminate"}function zp(e){return Ut(e)?"indeterminate":e?"checked":"unchecked"}const An=u.forwardRef(({className:e,...t},r)=>l.jsx(Bi,{ref:r,className:R("peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:l.jsx($p,{className:R("flex items-center justify-center text-current"),children:l.jsx(eo,{className:"h-4 w-4"})})}));An.displayName=Bi.displayName;function eS({columns:e,sortState:t,allRowsSelected:r,hasData:o,onSort:n,onToggleAllRows:a,allowSelectAllRows:i}){const s=e.filter(c=>!c.hidden);return l.jsxs(Er,{children:[i&&l.jsx(ro,{className:"w-12",children:l.jsx(An,{checked:r&&o,onCheckedChange:a,"aria-label":"Select all rows"})}),s.map(c=>l.jsx(ro,{className:R(c.sortable?"cursor-pointer select-none":"",c.headerClassName,c.align==="right"?"text-right":"",c.align==="center"?"text-center":""),onClick:c.sortable?()=>n(String(c.key)):void 0,style:{width:c.width?typeof c.width=="number"?`${c.width}px`:c.width:void 0},children:l.jsxs("div",{className:"flex items-center gap-1",children:[c.title,c.sortable&&l.jsx(l.Fragment,{children:t.field===c.key?t.direction==="asc"?l.jsx(qx,{className:"h-4 w-4"}):l.jsx(Gx,{className:"h-4 w-4"}):l.jsx(Yx,{className:"h-4 w-4 opacity-50"})})]})},String(c.key)))]})}function tS({row:e,index:t,columns:r,isSelected:o,rowId:n,onToggleSelection:a,allowSelection:i=!0}){const s=r.filter(c=>!c.hidden);return l.jsxs(Er,{className:o?"bg-muted/50":"",children:[i&&l.jsx(Nr,{className:"w-12",children:l.jsx(An,{checked:o,onCheckedChange:c=>a(n,!!c),"aria-label":`Select row ${t+1}`})}),s.map(c=>{const d=e[c.key];return l.jsx(Nr,{className:R(c.align==="right"?"text-right":"",c.align==="center"?"text-center":"",c.cellClassName),children:c.customRenderer?c.customRenderer(d,e):String(d??"")},String(c.key))})]})}const Ke=({className:e,repeat:t=1,...r})=>{const o=t==null||Number.isNaN(t)||t<0?1:Math.floor(t);return o===0?null:l.jsx(l.Fragment,{children:Array.from({length:o}).map((n,a)=>l.jsx("div",{className:R("animate-shimmer bg-gradient-to-r from-gray-300 via-gray-100 to-gray-300","bg-[length:200%_100%] rounded-md h-5",e),...r},a))})};function rS({columns:e,rows:t=5}){return l.jsx("div",{className:"rounded-md border",children:l.jsxs(Go,{children:[l.jsx(Yo,{children:l.jsx(Er,{children:Array.from({length:e}).map((r,o)=>l.jsx(ro,{children:l.jsx(Ke,{className:"h-4 w-20"})},o))})}),l.jsx(qo,{children:Array.from({length:t}).map((r,o)=>l.jsx(Er,{children:Array.from({length:e}).map((n,a)=>l.jsx(Nr,{children:l.jsx(Ke,{className:"h-4 w-full"})},a))},o))})]})})}function oS(e,t,r){const o=t.filter(p=>!p.hidden),n=o.map(p=>p.title),a=e.map(p=>o.map(f=>{const v=p[f.key];return v!=null?String(v):""})),i=[n.join(","),...a.map(p=>p.join(","))].join(`
288
+ `)},J1=0,Rr=[];function ek(e){var t=u.useRef([]),r=u.useRef([0,0]),o=u.useRef(),n=u.useState(J1++)[0],a=u.useState(Id)[0],i=u.useRef(e);u.useEffect(function(){i.current=e},[e]),u.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(n));var g=y1([e.lockRef.current],(e.shards||[]).map(Bd),!0).filter(Boolean);return g.forEach(function(w){return w.classList.add("allow-interactivity-".concat(n))}),function(){document.body.classList.remove("block-interactivity-".concat(n)),g.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(n))})}}},[e.inert,e.lockRef.current,e.shards]);var s=u.useCallback(function(g,w){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!i.current.allowPinchZoom;var x=xn(g),b=r.current,y="deltaX"in g?g.deltaX:b[0]-x[0],S="deltaY"in g?g.deltaY:b[1]-x[1],k,M=g.target,j=Math.abs(y)>Math.abs(S)?"h":"v";if("touches"in g&&j==="h"&&M.type==="range")return!1;var T=$d(j,M);if(!T)return!0;if(T?k=j:(k=j==="v"?"h":"v",T=$d(j,M)),!T)return!1;if(!o.current&&"changedTouches"in g&&(y||S)&&(o.current=k),!k)return!0;var L=o.current||k;return X1(L,w,g,L==="h"?y:S)},[]),c=u.useCallback(function(g){var w=g;if(!(!Rr.length||Rr[Rr.length-1]!==a)){var x="deltaY"in w?zd(w):xn(w),b=t.current.filter(function(k){return k.name===w.type&&(k.target===w.target||w.target===k.shadowParent)&&Z1(k.delta,x)})[0];if(b&&b.should){w.cancelable&&w.preventDefault();return}if(!b){var y=(i.current.shards||[]).map(Bd).filter(Boolean).filter(function(k){return k.contains(w.target)}),S=y.length>0?s(w,y[0]):!i.current.noIsolation;S&&w.cancelable&&w.preventDefault()}}},[]),d=u.useCallback(function(g,w,x,b){var y={name:g,delta:w,target:x,should:b,shadowParent:tk(x)};t.current.push(y),setTimeout(function(){t.current=t.current.filter(function(S){return S!==y})},1)},[]),p=u.useCallback(function(g){r.current=xn(g),o.current=void 0},[]),f=u.useCallback(function(g){d(g.type,zd(g),g.target,s(g,e.lockRef.current))},[]),v=u.useCallback(function(g){d(g.type,xn(g),g.target,s(g,e.lockRef.current))},[]);u.useEffect(function(){return Rr.push(a),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:v}),document.addEventListener("wheel",c,Ir),document.addEventListener("touchmove",c,Ir),document.addEventListener("touchstart",p,Ir),function(){Rr=Rr.filter(function(g){return g!==a}),document.removeEventListener("wheel",c,Ir),document.removeEventListener("touchmove",c,Ir),document.removeEventListener("touchstart",p,Ir)}},[]);var m=e.removeScrollBar,h=e.inert;return u.createElement(u.Fragment,null,h?u.createElement(a,{styles:Q1(n)}):null,m?u.createElement(W1,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function tk(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const rk=_1(Ad,ek);var fo=u.forwardRef(function(e,t){return u.createElement(hn,Ct({},e,{ref:t,sideCar:rk}))});fo.classNames=hn.classNames;var wi=["Enter"," "],ok=["ArrowDown","PageUp","Home"],Vd=["ArrowUp","PageDown","End"],nk=[...ok,...Vd],ak={ltr:[...wi,"ArrowRight"],rtl:[...wi,"ArrowLeft"]},ik={ltr:["ArrowLeft"],rtl:["ArrowRight"]},mo="Menu",[go,sk,lk]=tr(mo),[ar,Wd]=De(mo,[lk,Ft,zt]),vo=Ft(),Hd=zt(),[Ud,Bt]=ar(mo),[ck,ho]=ar(mo),Gd=e=>{const{__scopeMenu:t,open:r=!1,children:o,dir:n,onOpenChange:a,modal:i=!0}=e,s=vo(t),[c,d]=u.useState(null),p=u.useRef(!1),f=$e(a),v=jt(n);return u.useEffect(()=>{const m=()=>{p.current=!0,document.addEventListener("pointerdown",h,{capture:!0,once:!0}),document.addEventListener("pointermove",h,{capture:!0,once:!0})},h=()=>p.current=!1;return document.addEventListener("keydown",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",h,{capture:!0}),document.removeEventListener("pointermove",h,{capture:!0})}},[]),l.jsx(lo,{...s,children:l.jsx(Ud,{scope:t,open:r,onOpenChange:f,content:c,onContentChange:d,children:l.jsx(ck,{scope:t,onClose:u.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:p,dir:v,modal:i,children:o})})})};Gd.displayName=mo;var dk="MenuAnchor",xi=u.forwardRef((e,t)=>{const{__scopeMenu:r,...o}=e,n=vo(r);return l.jsx(co,{...n,...o,ref:t})});xi.displayName=dk;var bi="MenuPortal",[uk,Yd]=ar(bi,{forceMount:void 0}),qd=e=>{const{__scopeMenu:t,forceMount:r,children:o,container:n}=e,a=Bt(bi,t);return l.jsx(uk,{scope:t,forceMount:r,children:l.jsx(Re,{present:r||a.open,children:l.jsx(uo,{asChild:!0,container:n,children:o})})})};qd.displayName=bi;var Qe="MenuContent",[pk,yi]=ar(Qe),Kd=u.forwardRef((e,t)=>{const r=Yd(Qe,e.__scopeMenu),{forceMount:o=r.forceMount,...n}=e,a=Bt(Qe,e.__scopeMenu),i=ho(Qe,e.__scopeMenu);return l.jsx(go.Provider,{scope:e.__scopeMenu,children:l.jsx(Re,{present:o||a.open,children:l.jsx(go.Slot,{scope:e.__scopeMenu,children:i.modal?l.jsx(fk,{...n,ref:t}):l.jsx(mk,{...n,ref:t})})})})}),fk=u.forwardRef((e,t)=>{const r=Bt(Qe,e.__scopeMenu),o=u.useRef(null),n=ce(t,o);return u.useEffect(()=>{const a=o.current;if(a)return mn(a)},[]),l.jsx(ki,{...e,ref:n,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:Y(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),mk=u.forwardRef((e,t)=>{const r=Bt(Qe,e.__scopeMenu);return l.jsx(ki,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),gk=Rt("MenuContent.ScrollLock"),ki=u.forwardRef((e,t)=>{const{__scopeMenu:r,loop:o=!1,trapFocus:n,onOpenAutoFocus:a,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:d,onPointerDownOutside:p,onFocusOutside:f,onInteractOutside:v,onDismiss:m,disableOutsideScroll:h,...g}=e,w=Bt(Qe,r),x=ho(Qe,r),b=vo(r),y=Hd(r),S=sk(r),[k,M]=u.useState(null),j=u.useRef(null),T=ce(t,j,w.onContentChange),L=u.useRef(0),O=u.useRef(""),I=u.useRef(0),q=u.useRef(null),te=u.useRef("right"),G=u.useRef(0),ee=h?fo:u.Fragment,U=h?{as:gk,allowPinchZoom:!0}:void 0,Q=F=>{const E=O.current+F,B=S().filter(_=>!_.disabled),P=document.activeElement,A=B.find(_=>_.ref.current===P)?.textValue,$=B.map(_=>_.textValue),V=jk($,E,A),H=B.find(_=>_.textValue===V)?.ref.current;(function _(W){O.current=W,window.clearTimeout(L.current),W!==""&&(L.current=window.setTimeout(()=>_(""),1e3))})(E),H&&setTimeout(()=>H.focus())};u.useEffect(()=>()=>window.clearTimeout(L.current),[]),Xo();const z=u.useCallback(F=>te.current===q.current?.side&&Pk(F,q.current?.area),[]);return l.jsx(pk,{scope:r,searchRef:O,onItemEnter:u.useCallback(F=>{z(F)&&F.preventDefault()},[z]),onItemLeave:u.useCallback(F=>{z(F)||(j.current?.focus(),M(null))},[z]),onTriggerLeave:u.useCallback(F=>{z(F)&&F.preventDefault()},[z]),pointerGraceTimerRef:I,onPointerGraceIntentChange:u.useCallback(F=>{q.current=F},[]),children:l.jsx(ee,{...U,children:l.jsx(oo,{asChild:!0,trapped:n,onMountAutoFocus:Y(a,F=>{F.preventDefault(),j.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:l.jsx(rr,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:d,onPointerDownOutside:p,onFocusOutside:f,onInteractOutside:v,onDismiss:m,children:l.jsx(dn,{asChild:!0,...y,dir:x.dir,orientation:"vertical",loop:o,currentTabStopId:k,onCurrentTabStopIdChange:M,onEntryFocus:Y(c,F=>{x.isUsingKeyboardRef.current||F.preventDefault()}),preventScrollOnEntryFocus:!0,children:l.jsx(sn,{role:"menu","aria-orientation":"vertical","data-state":fu(w.open),"data-radix-menu-content":"",dir:x.dir,...b,...g,ref:T,style:{outline:"none",...g.style},onKeyDown:Y(g.onKeyDown,F=>{const B=F.target.closest("[data-radix-menu-content]")===F.currentTarget,P=F.ctrlKey||F.altKey||F.metaKey,A=F.key.length===1;B&&(F.key==="Tab"&&F.preventDefault(),!P&&A&&Q(F.key));const $=j.current;if(F.target!==$||!nk.includes(F.key))return;F.preventDefault();const H=S().filter(_=>!_.disabled).map(_=>_.ref.current);Vd.includes(F.key)&&H.reverse(),Ek(H)}),onBlur:Y(e.onBlur,F=>{F.currentTarget.contains(F.target)||(window.clearTimeout(L.current),O.current="")}),onPointerMove:Y(e.onPointerMove,xo(F=>{const E=F.target,B=G.current!==F.clientX;if(F.currentTarget.contains(E)&&B){const P=F.clientX>G.current?"right":"left";te.current=P,G.current=F.clientX}}))})})})})})})});Kd.displayName=Qe;var vk="MenuGroup",Ci=u.forwardRef((e,t)=>{const{__scopeMenu:r,...o}=e;return l.jsx(J.div,{role:"group",...o,ref:t})});Ci.displayName=vk;var hk="MenuLabel",Xd=u.forwardRef((e,t)=>{const{__scopeMenu:r,...o}=e;return l.jsx(J.div,{...o,ref:t})});Xd.displayName=hk;var bn="MenuItem",Zd="menu.itemSelect",yn=u.forwardRef((e,t)=>{const{disabled:r=!1,onSelect:o,...n}=e,a=u.useRef(null),i=ho(bn,e.__scopeMenu),s=yi(bn,e.__scopeMenu),c=ce(t,a),d=u.useRef(!1),p=()=>{const f=a.current;if(!r&&f){const v=new CustomEvent(Zd,{bubbles:!0,cancelable:!0});f.addEventListener(Zd,m=>o?.(m),{once:!0}),Ko(f,v),v.defaultPrevented?d.current=!1:i.onClose()}};return l.jsx(Qd,{...n,ref:c,disabled:r,onClick:Y(e.onClick,p),onPointerDown:f=>{e.onPointerDown?.(f),d.current=!0},onPointerUp:Y(e.onPointerUp,f=>{d.current||f.currentTarget?.click()}),onKeyDown:Y(e.onKeyDown,f=>{const v=s.searchRef.current!=="";r||v&&f.key===" "||wi.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})})});yn.displayName=bn;var Qd=u.forwardRef((e,t)=>{const{__scopeMenu:r,disabled:o=!1,textValue:n,...a}=e,i=yi(bn,r),s=Hd(r),c=u.useRef(null),d=ce(t,c),[p,f]=u.useState(!1),[v,m]=u.useState("");return u.useEffect(()=>{const h=c.current;h&&m((h.textContent??"").trim())},[a.children]),l.jsx(go.ItemSlot,{scope:r,disabled:o,textValue:n??v,children:l.jsx(un,{asChild:!0,...s,focusable:!o,children:l.jsx(J.div,{role:"menuitem","data-highlighted":p?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...a,ref:d,onPointerMove:Y(e.onPointerMove,xo(h=>{o?i.onItemLeave(h):(i.onItemEnter(h),h.defaultPrevented||h.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Y(e.onPointerLeave,xo(h=>i.onItemLeave(h))),onFocus:Y(e.onFocus,()=>f(!0)),onBlur:Y(e.onBlur,()=>f(!1))})})})}),wk="MenuCheckboxItem",Jd=u.forwardRef((e,t)=>{const{checked:r=!1,onCheckedChange:o,...n}=e;return l.jsx(nu,{scope:e.__scopeMenu,checked:r,children:l.jsx(yn,{role:"menuitemcheckbox","aria-checked":kn(r)?"mixed":r,...n,ref:t,"data-state":Ni(r),onSelect:Y(n.onSelect,()=>o?.(kn(r)?!0:!r),{checkForDefaultPrevented:!1})})})});Jd.displayName=wk;var eu="MenuRadioGroup",[xk,bk]=ar(eu,{value:void 0,onValueChange:()=>{}}),tu=u.forwardRef((e,t)=>{const{value:r,onValueChange:o,...n}=e,a=$e(o);return l.jsx(xk,{scope:e.__scopeMenu,value:r,onValueChange:a,children:l.jsx(Ci,{...n,ref:t})})});tu.displayName=eu;var ru="MenuRadioItem",ou=u.forwardRef((e,t)=>{const{value:r,...o}=e,n=bk(ru,e.__scopeMenu),a=r===n.value;return l.jsx(nu,{scope:e.__scopeMenu,checked:a,children:l.jsx(yn,{role:"menuitemradio","aria-checked":a,...o,ref:t,"data-state":Ni(a),onSelect:Y(o.onSelect,()=>n.onValueChange?.(r),{checkForDefaultPrevented:!1})})})});ou.displayName=ru;var Si="MenuItemIndicator",[nu,yk]=ar(Si,{checked:!1}),au=u.forwardRef((e,t)=>{const{__scopeMenu:r,forceMount:o,...n}=e,a=yk(Si,r);return l.jsx(Re,{present:o||kn(a.checked)||a.checked===!0,children:l.jsx(J.span,{...n,ref:t,"data-state":Ni(a.checked)})})});au.displayName=Si;var kk="MenuSeparator",iu=u.forwardRef((e,t)=>{const{__scopeMenu:r,...o}=e;return l.jsx(J.div,{role:"separator","aria-orientation":"horizontal",...o,ref:t})});iu.displayName=kk;var Ck="MenuArrow",su=u.forwardRef((e,t)=>{const{__scopeMenu:r,...o}=e,n=vo(r);return l.jsx(ln,{...n,...o,ref:t})});su.displayName=Ck;var Ei="MenuSub",[Sk,lu]=ar(Ei),cu=e=>{const{__scopeMenu:t,children:r,open:o=!1,onOpenChange:n}=e,a=Bt(Ei,t),i=vo(t),[s,c]=u.useState(null),[d,p]=u.useState(null),f=$e(n);return u.useEffect(()=>(a.open===!1&&f(!1),()=>f(!1)),[a.open,f]),l.jsx(lo,{...i,children:l.jsx(Ud,{scope:t,open:o,onOpenChange:f,content:d,onContentChange:p,children:l.jsx(Sk,{scope:t,contentId:je(),triggerId:je(),trigger:s,onTriggerChange:c,children:r})})})};cu.displayName=Ei;var wo="MenuSubTrigger",du=u.forwardRef((e,t)=>{const r=Bt(wo,e.__scopeMenu),o=ho(wo,e.__scopeMenu),n=lu(wo,e.__scopeMenu),a=yi(wo,e.__scopeMenu),i=u.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:c}=a,d={__scopeMenu:e.__scopeMenu},p=u.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return u.useEffect(()=>p,[p]),u.useEffect(()=>{const f=s.current;return()=>{window.clearTimeout(f),c(null)}},[s,c]),l.jsx(xi,{asChild:!0,...d,children:l.jsx(Qd,{id:n.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":n.contentId,"data-state":fu(r.open),...e,ref:ht(t,n.onTriggerChange),onClick:f=>{e.onClick?.(f),!(e.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:Y(e.onPointerMove,xo(f=>{a.onItemEnter(f),!f.defaultPrevented&&!e.disabled&&!r.open&&!i.current&&(a.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{r.onOpenChange(!0),p()},100))})),onPointerLeave:Y(e.onPointerLeave,xo(f=>{p();const v=r.content?.getBoundingClientRect();if(v){const m=r.content?.dataset.side,h=m==="right",g=h?-5:5,w=v[h?"left":"right"],x=v[h?"right":"left"];a.onPointerGraceIntentChange({area:[{x:f.clientX+g,y:f.clientY},{x:w,y:v.top},{x,y:v.top},{x,y:v.bottom},{x:w,y:v.bottom}],side:m}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(f),f.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:Y(e.onKeyDown,f=>{const v=a.searchRef.current!=="";e.disabled||v&&f.key===" "||ak[o.dir].includes(f.key)&&(r.onOpenChange(!0),r.content?.focus(),f.preventDefault())})})})});du.displayName=wo;var uu="MenuSubContent",pu=u.forwardRef((e,t)=>{const r=Yd(Qe,e.__scopeMenu),{forceMount:o=r.forceMount,...n}=e,a=Bt(Qe,e.__scopeMenu),i=ho(Qe,e.__scopeMenu),s=lu(uu,e.__scopeMenu),c=u.useRef(null),d=ce(t,c);return l.jsx(go.Provider,{scope:e.__scopeMenu,children:l.jsx(Re,{present:o||a.open,children:l.jsx(go.Slot,{scope:e.__scopeMenu,children:l.jsx(ki,{id:s.contentId,"aria-labelledby":s.triggerId,...n,ref:d,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:p=>{i.isUsingKeyboardRef.current&&c.current?.focus(),p.preventDefault()},onCloseAutoFocus:p=>p.preventDefault(),onFocusOutside:Y(e.onFocusOutside,p=>{p.target!==s.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:Y(e.onEscapeKeyDown,p=>{i.onClose(),p.preventDefault()}),onKeyDown:Y(e.onKeyDown,p=>{const f=p.currentTarget.contains(p.target),v=ik[i.dir].includes(p.key);f&&v&&(a.onOpenChange(!1),s.trigger?.focus(),p.preventDefault())})})})})})});pu.displayName=uu;function fu(e){return e?"open":"closed"}function kn(e){return e==="indeterminate"}function Ni(e){return kn(e)?"indeterminate":e?"checked":"unchecked"}function Ek(e){const t=document.activeElement;for(const r of e)if(r===t||(r.focus(),document.activeElement!==t))return}function Nk(e,t){return e.map((r,o)=>e[(t+o)%e.length])}function jk(e,t,r){const n=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,a=r?e.indexOf(r):-1;let i=Nk(e,Math.max(a,0));n.length===1&&(i=i.filter(d=>d!==r));const c=i.find(d=>d.toLowerCase().startsWith(n.toLowerCase()));return c!==r?c:void 0}function Tk(e,t){const{x:r,y:o}=e;let n=!1;for(let a=0,i=t.length-1;a<t.length;i=a++){const s=t[a],c=t[i],d=s.x,p=s.y,f=c.x,v=c.y;p>o!=v>o&&r<(f-d)*(o-p)/(v-p)+d&&(n=!n)}return n}function Pk(e,t){if(!t)return!1;const r={x:e.clientX,y:e.clientY};return Tk(r,t)}function xo(e){return t=>t.pointerType==="mouse"?e(t):void 0}var _k=Gd,Mk=xi,Dk=qd,Ak=Kd,Ik=Ci,Rk=Xd,Ok=yn,$k=Jd,Lk=tu,Fk=ou,zk=au,Bk=iu,Vk=su,Wk=cu,Hk=du,Uk=pu,Cn="DropdownMenu",[Gk,pD]=De(Cn,[Wd]),ze=Wd(),[Yk,mu]=Gk(Cn),gu=e=>{const{__scopeDropdownMenu:t,children:r,dir:o,open:n,defaultOpen:a,onOpenChange:i,modal:s=!0}=e,c=ze(t),d=u.useRef(null),[p,f]=Ae({prop:n,defaultProp:a??!1,onChange:i,caller:Cn});return l.jsx(Yk,{scope:t,triggerId:je(),triggerRef:d,contentId:je(),open:p,onOpenChange:f,onOpenToggle:u.useCallback(()=>f(v=>!v),[f]),modal:s,children:l.jsx(_k,{...c,open:p,onOpenChange:f,dir:o,modal:s,children:r})})};gu.displayName=Cn;var vu="DropdownMenuTrigger",hu=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,disabled:o=!1,...n}=e,a=mu(vu,r),i=ze(r);return l.jsx(Mk,{asChild:!0,...i,children:l.jsx(J.button,{type:"button",id:a.triggerId,"aria-haspopup":"menu","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?"open":"closed","data-disabled":o?"":void 0,disabled:o,...n,ref:ht(t,a.triggerRef),onPointerDown:Y(e.onPointerDown,s=>{!o&&s.button===0&&s.ctrlKey===!1&&(a.onOpenToggle(),a.open||s.preventDefault())}),onKeyDown:Y(e.onKeyDown,s=>{o||(["Enter"," "].includes(s.key)&&a.onOpenToggle(),s.key==="ArrowDown"&&a.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(s.key)&&s.preventDefault())})})})});hu.displayName=vu;var qk="DropdownMenuPortal",wu=e=>{const{__scopeDropdownMenu:t,...r}=e,o=ze(t);return l.jsx(Dk,{...o,...r})};wu.displayName=qk;var xu="DropdownMenuContent",bu=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...o}=e,n=mu(xu,r),a=ze(r),i=u.useRef(!1);return l.jsx(Ak,{id:n.contentId,"aria-labelledby":n.triggerId,...a,...o,ref:t,onCloseAutoFocus:Y(e.onCloseAutoFocus,s=>{i.current||n.triggerRef.current?.focus(),i.current=!1,s.preventDefault()}),onInteractOutside:Y(e.onInteractOutside,s=>{const c=s.detail.originalEvent,d=c.button===0&&c.ctrlKey===!0,p=c.button===2||d;(!n.modal||p)&&(i.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});bu.displayName=xu;var Kk="DropdownMenuGroup",yu=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...o}=e,n=ze(r);return l.jsx(Ik,{...n,...o,ref:t})});yu.displayName=Kk;var Xk="DropdownMenuLabel",ku=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...o}=e,n=ze(r);return l.jsx(Rk,{...n,...o,ref:t})});ku.displayName=Xk;var Zk="DropdownMenuItem",Cu=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...o}=e,n=ze(r);return l.jsx(Ok,{...n,...o,ref:t})});Cu.displayName=Zk;var Qk="DropdownMenuCheckboxItem",Su=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...o}=e,n=ze(r);return l.jsx($k,{...n,...o,ref:t})});Su.displayName=Qk;var Jk="DropdownMenuRadioGroup",Eu=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...o}=e,n=ze(r);return l.jsx(Lk,{...n,...o,ref:t})});Eu.displayName=Jk;var eC="DropdownMenuRadioItem",Nu=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...o}=e,n=ze(r);return l.jsx(Fk,{...n,...o,ref:t})});Nu.displayName=eC;var tC="DropdownMenuItemIndicator",ju=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...o}=e,n=ze(r);return l.jsx(zk,{...n,...o,ref:t})});ju.displayName=tC;var rC="DropdownMenuSeparator",Tu=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...o}=e,n=ze(r);return l.jsx(Bk,{...n,...o,ref:t})});Tu.displayName=rC;var oC="DropdownMenuArrow",nC=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...o}=e,n=ze(r);return l.jsx(Vk,{...n,...o,ref:t})});nC.displayName=oC;var aC=e=>{const{__scopeDropdownMenu:t,children:r,open:o,onOpenChange:n,defaultOpen:a}=e,i=ze(t),[s,c]=Ae({prop:o,defaultProp:a??!1,onChange:n,caller:"DropdownMenuSub"});return l.jsx(Wk,{...i,open:s,onOpenChange:c,children:r})},iC="DropdownMenuSubTrigger",Pu=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...o}=e,n=ze(r);return l.jsx(Hk,{...n,...o,ref:t})});Pu.displayName=iC;var sC="DropdownMenuSubContent",_u=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...o}=e,n=ze(r);return l.jsx(Uk,{...n,...o,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});_u.displayName=sC;var lC=gu,cC=hu,Mu=wu,Du=bu,dC=yu,Au=ku,Iu=Cu,Ru=Su,uC=Eu,Ou=Nu,$u=ju,Lu=Tu,pC=aC,Fu=Pu,zu=_u;const Bu=lC,Vu=cC,fC=dC,mC=Mu,gC=pC,vC=uC,Wu=u.forwardRef(({className:e,inset:t,children:r,...o},n)=>l.jsxs(Fu,{ref:n,className:R("flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...o,children:[r,l.jsx(to,{className:"ml-auto"})]}));Wu.displayName=Fu.displayName;const Hu=u.forwardRef(({className:e,...t},r)=>l.jsx(zu,{ref:r,className:R("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));Hu.displayName=zu.displayName;const ji=u.forwardRef(({className:e,sideOffset:t=4,...r},o)=>l.jsx(Mu,{children:l.jsx(Du,{ref:o,sideOffset:t,className:R("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})}));ji.displayName=Du.displayName;const Uu=u.forwardRef(({className:e,inset:t,...r},o)=>l.jsx(Iu,{ref:o,className:R("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",t&&"pl-8",e),...r}));Uu.displayName=Iu.displayName;const Ti=u.forwardRef(({className:e,children:t,checked:r,...o},n)=>l.jsxs(Ru,{ref:n,className:R("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:r,...o,children:[l.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:l.jsx($u,{children:l.jsx(eo,{className:"h-4 w-4"})})}),t]}));Ti.displayName=Ru.displayName;const Gu=u.forwardRef(({className:e,children:t,...r},o)=>l.jsxs(Ou,{ref:o,className:R("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[l.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:l.jsx($u,{children:l.jsx(Pc,{className:"h-2 w-2 fill-current"})})}),t]}));Gu.displayName=Ou.displayName;const Pi=u.forwardRef(({className:e,inset:t,...r},o)=>l.jsx(Au,{ref:o,className:R("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...r}));Pi.displayName=Au.displayName;const Sn=u.forwardRef(({className:e,...t},r)=>l.jsx(Lu,{ref:r,className:R("-mx-1 my-1 h-px bg-muted",e),...t}));Sn.displayName=Lu.displayName;const Yu=({className:e,...t})=>l.jsx("span",{className:R("ml-auto text-xs tracking-widest opacity-60",e),...t});Yu.displayName="DropdownMenuShortcut";function hC({columns:e,onToggleVisibility:t,onReset:r}){return l.jsxs(Bu,{children:[l.jsx(Vu,{asChild:!0,children:l.jsxs(ve,{variant:"outline",className:"ml-auto",children:[l.jsx(ub,{className:"h-4 w-4 mr-2"}),"Columns"]})}),l.jsxs(ji,{align:"end",className:"w-48",children:[l.jsx(Pi,{children:"Toggle columns"}),l.jsx(Sn,{}),e.map(o=>l.jsx(Ti,{checked:!o.hidden,onCheckedChange:n=>t(String(o.key),n),children:o.title},String(o.key))),l.jsx(Sn,{}),l.jsx(ve,{variant:"ghost",size:"sm",className:"w-full justify-start",onClick:r,children:"Reset columns"})]})]})}function En(e,[t,r]){return Math.min(r,Math.max(t,e))}function Or(e){const t=u.useRef({value:e,previous:e});return u.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var qu=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),wC="VisuallyHidden",Ku=u.forwardRef((e,t)=>l.jsx(J.span,{...e,ref:t,style:{...qu,...e.style}}));Ku.displayName=wC;var Xu=Ku,xC=[" ","Enter","ArrowUp","ArrowDown"],bC=[" ","Enter"],ir="Select",[Nn,jn,yC]=tr(ir),[$r,fD]=De(ir,[yC,Ft]),Tn=Ft(),[kC,Vt]=$r(ir),[CC,SC]=$r(ir),Zu=e=>{const{__scopeSelect:t,children:r,open:o,defaultOpen:n,onOpenChange:a,value:i,defaultValue:s,onValueChange:c,dir:d,name:p,autoComplete:f,disabled:v,required:m,form:h}=e,g=Tn(t),[w,x]=u.useState(null),[b,y]=u.useState(null),[S,k]=u.useState(!1),M=jt(d),[j,T]=Ae({prop:o,defaultProp:n??!1,onChange:a,caller:ir}),[L,O]=Ae({prop:i,defaultProp:s,onChange:c,caller:ir}),I=u.useRef(null),q=w?h||!!w.closest("form"):!0,[te,G]=u.useState(new Set),ee=Array.from(te).map(U=>U.props.value).join(";");return l.jsx(lo,{...g,children:l.jsxs(kC,{required:m,scope:t,trigger:w,onTriggerChange:x,valueNode:b,onValueNodeChange:y,valueNodeHasChildren:S,onValueNodeHasChildrenChange:k,contentId:je(),value:L,onValueChange:O,open:j,onOpenChange:T,dir:M,triggerPointerDownPosRef:I,disabled:v,children:[l.jsx(Nn.Provider,{scope:t,children:l.jsx(CC,{scope:e.__scopeSelect,onNativeOptionAdd:u.useCallback(U=>{G(Q=>new Set(Q).add(U))},[]),onNativeOptionRemove:u.useCallback(U=>{G(Q=>{const z=new Set(Q);return z.delete(U),z})},[]),children:r})}),q?l.jsxs(yp,{"aria-hidden":!0,required:m,tabIndex:-1,name:p,autoComplete:f,value:L,onChange:U=>O(U.target.value),disabled:v,form:h,children:[L===void 0?l.jsx("option",{value:""}):null,Array.from(te)]},ee):null]})})};Zu.displayName=ir;var Qu="SelectTrigger",Ju=u.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:o=!1,...n}=e,a=Tn(r),i=Vt(Qu,r),s=i.disabled||o,c=ce(t,i.onTriggerChange),d=jn(r),p=u.useRef("touch"),[f,v,m]=Cp(g=>{const w=d().filter(y=>!y.disabled),x=w.find(y=>y.value===i.value),b=Sp(w,g,x);b!==void 0&&i.onValueChange(b.value)}),h=g=>{s||(i.onOpenChange(!0),m()),g&&(i.triggerPointerDownPosRef.current={x:Math.round(g.pageX),y:Math.round(g.pageY)})};return l.jsx(co,{asChild:!0,...a,children:l.jsx(J.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:s,"data-disabled":s?"":void 0,"data-placeholder":kp(i.value)?"":void 0,...n,ref:c,onClick:Y(n.onClick,g=>{g.currentTarget.focus(),p.current!=="mouse"&&h(g)}),onPointerDown:Y(n.onPointerDown,g=>{p.current=g.pointerType;const w=g.target;w.hasPointerCapture(g.pointerId)&&w.releasePointerCapture(g.pointerId),g.button===0&&g.ctrlKey===!1&&g.pointerType==="mouse"&&(h(g),g.preventDefault())}),onKeyDown:Y(n.onKeyDown,g=>{const w=f.current!=="";!(g.ctrlKey||g.altKey||g.metaKey)&&g.key.length===1&&v(g.key),!(w&&g.key===" ")&&xC.includes(g.key)&&(h(),g.preventDefault())})})})});Ju.displayName=Qu;var ep="SelectValue",tp=u.forwardRef((e,t)=>{const{__scopeSelect:r,className:o,style:n,children:a,placeholder:i="",...s}=e,c=Vt(ep,r),{onValueNodeHasChildrenChange:d}=c,p=a!==void 0,f=ce(t,c.onValueNodeChange);return Te(()=>{d(p)},[d,p]),l.jsx(J.span,{...s,ref:f,style:{pointerEvents:"none"},children:kp(c.value)?l.jsx(l.Fragment,{children:i}):a})});tp.displayName=ep;var EC="SelectIcon",rp=u.forwardRef((e,t)=>{const{__scopeSelect:r,children:o,...n}=e;return l.jsx(J.span,{"aria-hidden":!0,...n,ref:t,children:o||"▼"})});rp.displayName=EC;var sr="SelectContent",op=u.forwardRef((e,t)=>{const r=Vt(sr,e.__scopeSelect),[o,n]=u.useState();if(Te(()=>{n(new DocumentFragment)},[]),!r.open){const a=o;return a?Lo.createPortal(l.jsx(np,{scope:e.__scopeSelect,children:l.jsx(Nn.Slot,{scope:e.__scopeSelect,children:l.jsx("div",{children:e.children})})}),a):null}return l.jsx(ap,{...e,ref:t})});op.displayName=sr;var at=10,[np,Wt]=$r(sr),NC="SelectContentImpl",jC=Rt("SelectContent.RemoveScroll"),ap=u.forwardRef((e,t)=>{const{__scopeSelect:r,position:o="item-aligned",onCloseAutoFocus:n,onEscapeKeyDown:a,onPointerDownOutside:i,side:s,sideOffset:c,align:d,alignOffset:p,arrowPadding:f,collisionBoundary:v,collisionPadding:m,sticky:h,hideWhenDetached:g,avoidCollisions:w,...x}=e,b=Vt(sr,r),[y,S]=u.useState(null),[k,M]=u.useState(null),j=ce(t,_=>S(_)),[T,L]=u.useState(null),[O,I]=u.useState(null),q=jn(r),[te,G]=u.useState(!1),ee=u.useRef(!1);u.useEffect(()=>{if(y)return mn(y)},[y]),Xo();const U=u.useCallback(_=>{const[W,...X]=q().map(D=>D.ref.current),[K]=X.slice(-1),re=document.activeElement;for(const D of _)if(D===re||(D?.scrollIntoView({block:"nearest"}),D===W&&k&&(k.scrollTop=0),D===K&&k&&(k.scrollTop=k.scrollHeight),D?.focus(),document.activeElement!==re))return},[q,k]),Q=u.useCallback(()=>U([T,y]),[U,T,y]);u.useEffect(()=>{te&&Q()},[te,Q]);const{onOpenChange:z,triggerPointerDownPosRef:F}=b;u.useEffect(()=>{if(y){let _={x:0,y:0};const W=K=>{_={x:Math.abs(Math.round(K.pageX)-(F.current?.x??0)),y:Math.abs(Math.round(K.pageY)-(F.current?.y??0))}},X=K=>{_.x<=10&&_.y<=10?K.preventDefault():y.contains(K.target)||z(!1),document.removeEventListener("pointermove",W),F.current=null};return F.current!==null&&(document.addEventListener("pointermove",W),document.addEventListener("pointerup",X,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",W),document.removeEventListener("pointerup",X,{capture:!0})}}},[y,z,F]),u.useEffect(()=>{const _=()=>z(!1);return window.addEventListener("blur",_),window.addEventListener("resize",_),()=>{window.removeEventListener("blur",_),window.removeEventListener("resize",_)}},[z]);const[E,B]=Cp(_=>{const W=q().filter(re=>!re.disabled),X=W.find(re=>re.ref.current===document.activeElement),K=Sp(W,_,X);K&&setTimeout(()=>K.ref.current.focus())}),P=u.useCallback((_,W,X)=>{const K=!ee.current&&!X;(b.value!==void 0&&b.value===W||K)&&(L(_),K&&(ee.current=!0))},[b.value]),A=u.useCallback(()=>y?.focus(),[y]),$=u.useCallback((_,W,X)=>{const K=!ee.current&&!X;(b.value!==void 0&&b.value===W||K)&&I(_)},[b.value]),V=o==="popper"?_i:ip,H=V===_i?{side:s,sideOffset:c,align:d,alignOffset:p,arrowPadding:f,collisionBoundary:v,collisionPadding:m,sticky:h,hideWhenDetached:g,avoidCollisions:w}:{};return l.jsx(np,{scope:r,content:y,viewport:k,onViewportChange:M,itemRefCallback:P,selectedItem:T,onItemLeave:A,itemTextRefCallback:$,focusSelectedItem:Q,selectedItemText:O,position:o,isPositioned:te,searchRef:E,children:l.jsx(fo,{as:jC,allowPinchZoom:!0,children:l.jsx(oo,{asChild:!0,trapped:b.open,onMountAutoFocus:_=>{_.preventDefault()},onUnmountAutoFocus:Y(n,_=>{b.trigger?.focus({preventScroll:!0}),_.preventDefault()}),children:l.jsx(rr,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:i,onFocusOutside:_=>_.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:l.jsx(V,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:_=>_.preventDefault(),...x,...H,onPlaced:()=>G(!0),ref:j,style:{display:"flex",flexDirection:"column",outline:"none",...x.style},onKeyDown:Y(x.onKeyDown,_=>{const W=_.ctrlKey||_.altKey||_.metaKey;if(_.key==="Tab"&&_.preventDefault(),!W&&_.key.length===1&&B(_.key),["ArrowUp","ArrowDown","Home","End"].includes(_.key)){let K=q().filter(re=>!re.disabled).map(re=>re.ref.current);if(["ArrowUp","End"].includes(_.key)&&(K=K.slice().reverse()),["ArrowUp","ArrowDown"].includes(_.key)){const re=_.target,D=K.indexOf(re);K=K.slice(D+1)}setTimeout(()=>U(K)),_.preventDefault()}})})})})})})});ap.displayName=NC;var TC="SelectItemAlignedPosition",ip=u.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:o,...n}=e,a=Vt(sr,r),i=Wt(sr,r),[s,c]=u.useState(null),[d,p]=u.useState(null),f=ce(t,j=>p(j)),v=jn(r),m=u.useRef(!1),h=u.useRef(!0),{viewport:g,selectedItem:w,selectedItemText:x,focusSelectedItem:b}=i,y=u.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&d&&g&&w&&x){const j=a.trigger.getBoundingClientRect(),T=d.getBoundingClientRect(),L=a.valueNode.getBoundingClientRect(),O=x.getBoundingClientRect();if(a.dir!=="rtl"){const re=O.left-T.left,D=L.left-re,ie=j.left-D,ue=j.width+ie,we=Math.max(ue,T.width),Ne=window.innerWidth-at,Z=En(D,[at,Math.max(at,Ne-we)]);s.style.minWidth=ue+"px",s.style.left=Z+"px"}else{const re=T.right-O.right,D=window.innerWidth-L.right-re,ie=window.innerWidth-j.right-D,ue=j.width+ie,we=Math.max(ue,T.width),Ne=window.innerWidth-at,Z=En(D,[at,Math.max(at,Ne-we)]);s.style.minWidth=ue+"px",s.style.right=Z+"px"}const I=v(),q=window.innerHeight-at*2,te=g.scrollHeight,G=window.getComputedStyle(d),ee=parseInt(G.borderTopWidth,10),U=parseInt(G.paddingTop,10),Q=parseInt(G.borderBottomWidth,10),z=parseInt(G.paddingBottom,10),F=ee+U+te+z+Q,E=Math.min(w.offsetHeight*5,F),B=window.getComputedStyle(g),P=parseInt(B.paddingTop,10),A=parseInt(B.paddingBottom,10),$=j.top+j.height/2-at,V=q-$,H=w.offsetHeight/2,_=w.offsetTop+H,W=ee+U+_,X=F-W;if(W<=$){const re=I.length>0&&w===I[I.length-1].ref.current;s.style.bottom="0px";const D=d.clientHeight-g.offsetTop-g.offsetHeight,ie=Math.max(V,H+(re?A:0)+D+Q),ue=W+ie;s.style.height=ue+"px"}else{const re=I.length>0&&w===I[0].ref.current;s.style.top="0px";const ie=Math.max($,ee+g.offsetTop+(re?P:0)+H)+X;s.style.height=ie+"px",g.scrollTop=W-$+g.offsetTop}s.style.margin=`${at}px 0`,s.style.minHeight=E+"px",s.style.maxHeight=q+"px",o?.(),requestAnimationFrame(()=>m.current=!0)}},[v,a.trigger,a.valueNode,s,d,g,w,x,a.dir,o]);Te(()=>y(),[y]);const[S,k]=u.useState();Te(()=>{d&&k(window.getComputedStyle(d).zIndex)},[d]);const M=u.useCallback(j=>{j&&h.current===!0&&(y(),b?.(),h.current=!1)},[y,b]);return l.jsx(_C,{scope:r,contentWrapper:s,shouldExpandOnScrollRef:m,onScrollButtonChange:M,children:l.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:l.jsx(J.div,{...n,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...n.style}})})})});ip.displayName=TC;var PC="SelectPopperPosition",_i=u.forwardRef((e,t)=>{const{__scopeSelect:r,align:o="start",collisionPadding:n=at,...a}=e,i=Tn(r);return l.jsx(sn,{...i,...a,ref:t,align:o,collisionPadding:n,style:{boxSizing:"border-box",...a.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});_i.displayName=PC;var[_C,Mi]=$r(sr,{}),Di="SelectViewport",sp=u.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:o,...n}=e,a=Wt(Di,r),i=Mi(Di,r),s=ce(t,a.onViewportChange),c=u.useRef(0);return l.jsxs(l.Fragment,{children:[l.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),l.jsx(Nn.Slot,{scope:r,children:l.jsx(J.div,{"data-radix-select-viewport":"",role:"presentation",...n,ref:s,style:{position:"relative",flex:1,overflow:"hidden auto",...n.style},onScroll:Y(n.onScroll,d=>{const p=d.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:v}=i;if(v?.current&&f){const m=Math.abs(c.current-p.scrollTop);if(m>0){const h=window.innerHeight-at*2,g=parseFloat(f.style.minHeight),w=parseFloat(f.style.height),x=Math.max(g,w);if(x<h){const b=x+m,y=Math.min(h,b),S=b-y;f.style.height=y+"px",f.style.bottom==="0px"&&(p.scrollTop=S>0?S:0,f.style.justifyContent="flex-end")}}}c.current=p.scrollTop})})})]})});sp.displayName=Di;var lp="SelectGroup",[MC,DC]=$r(lp),cp=u.forwardRef((e,t)=>{const{__scopeSelect:r,...o}=e,n=je();return l.jsx(MC,{scope:r,id:n,children:l.jsx(J.div,{role:"group","aria-labelledby":n,...o,ref:t})})});cp.displayName=lp;var dp="SelectLabel",up=u.forwardRef((e,t)=>{const{__scopeSelect:r,...o}=e,n=DC(dp,r);return l.jsx(J.div,{id:n.id,...o,ref:t})});up.displayName=dp;var Pn="SelectItem",[AC,pp]=$r(Pn),fp=u.forwardRef((e,t)=>{const{__scopeSelect:r,value:o,disabled:n=!1,textValue:a,...i}=e,s=Vt(Pn,r),c=Wt(Pn,r),d=s.value===o,[p,f]=u.useState(a??""),[v,m]=u.useState(!1),h=ce(t,b=>c.itemRefCallback?.(b,o,n)),g=je(),w=u.useRef("touch"),x=()=>{n||(s.onValueChange(o),s.onOpenChange(!1))};if(o==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return l.jsx(AC,{scope:r,value:o,disabled:n,textId:g,isSelected:d,onItemTextChange:u.useCallback(b=>{f(y=>y||(b?.textContent??"").trim())},[]),children:l.jsx(Nn.ItemSlot,{scope:r,value:o,disabled:n,textValue:p,children:l.jsx(J.div,{role:"option","aria-labelledby":g,"data-highlighted":v?"":void 0,"aria-selected":d&&v,"data-state":d?"checked":"unchecked","aria-disabled":n||void 0,"data-disabled":n?"":void 0,tabIndex:n?void 0:-1,...i,ref:h,onFocus:Y(i.onFocus,()=>m(!0)),onBlur:Y(i.onBlur,()=>m(!1)),onClick:Y(i.onClick,()=>{w.current!=="mouse"&&x()}),onPointerUp:Y(i.onPointerUp,()=>{w.current==="mouse"&&x()}),onPointerDown:Y(i.onPointerDown,b=>{w.current=b.pointerType}),onPointerMove:Y(i.onPointerMove,b=>{w.current=b.pointerType,n?c.onItemLeave?.():w.current==="mouse"&&b.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Y(i.onPointerLeave,b=>{b.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:Y(i.onKeyDown,b=>{c.searchRef?.current!==""&&b.key===" "||(bC.includes(b.key)&&x(),b.key===" "&&b.preventDefault())})})})})});fp.displayName=Pn;var bo="SelectItemText",mp=u.forwardRef((e,t)=>{const{__scopeSelect:r,className:o,style:n,...a}=e,i=Vt(bo,r),s=Wt(bo,r),c=pp(bo,r),d=SC(bo,r),[p,f]=u.useState(null),v=ce(t,x=>f(x),c.onItemTextChange,x=>s.itemTextRefCallback?.(x,c.value,c.disabled)),m=p?.textContent,h=u.useMemo(()=>l.jsx("option",{value:c.value,disabled:c.disabled,children:m},c.value),[c.disabled,c.value,m]),{onNativeOptionAdd:g,onNativeOptionRemove:w}=d;return Te(()=>(g(h),()=>w(h)),[g,w,h]),l.jsxs(l.Fragment,{children:[l.jsx(J.span,{id:c.textId,...a,ref:v}),c.isSelected&&i.valueNode&&!i.valueNodeHasChildren?Lo.createPortal(a.children,i.valueNode):null]})});mp.displayName=bo;var gp="SelectItemIndicator",vp=u.forwardRef((e,t)=>{const{__scopeSelect:r,...o}=e;return pp(gp,r).isSelected?l.jsx(J.span,{"aria-hidden":!0,...o,ref:t}):null});vp.displayName=gp;var Ai="SelectScrollUpButton",hp=u.forwardRef((e,t)=>{const r=Wt(Ai,e.__scopeSelect),o=Mi(Ai,e.__scopeSelect),[n,a]=u.useState(!1),i=ce(t,o.onScrollButtonChange);return Te(()=>{if(r.viewport&&r.isPositioned){let s=function(){const d=c.scrollTop>0;a(d)};const c=r.viewport;return s(),c.addEventListener("scroll",s),()=>c.removeEventListener("scroll",s)}},[r.viewport,r.isPositioned]),n?l.jsx(xp,{...e,ref:i,onAutoScroll:()=>{const{viewport:s,selectedItem:c}=r;s&&c&&(s.scrollTop=s.scrollTop-c.offsetHeight)}}):null});hp.displayName=Ai;var Ii="SelectScrollDownButton",wp=u.forwardRef((e,t)=>{const r=Wt(Ii,e.__scopeSelect),o=Mi(Ii,e.__scopeSelect),[n,a]=u.useState(!1),i=ce(t,o.onScrollButtonChange);return Te(()=>{if(r.viewport&&r.isPositioned){let s=function(){const d=c.scrollHeight-c.clientHeight,p=Math.ceil(c.scrollTop)<d;a(p)};const c=r.viewport;return s(),c.addEventListener("scroll",s),()=>c.removeEventListener("scroll",s)}},[r.viewport,r.isPositioned]),n?l.jsx(xp,{...e,ref:i,onAutoScroll:()=>{const{viewport:s,selectedItem:c}=r;s&&c&&(s.scrollTop=s.scrollTop+c.offsetHeight)}}):null});wp.displayName=Ii;var xp=u.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:o,...n}=e,a=Wt("SelectScrollButton",r),i=u.useRef(null),s=jn(r),c=u.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return u.useEffect(()=>()=>c(),[c]),Te(()=>{s().find(p=>p.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[s]),l.jsx(J.div,{"aria-hidden":!0,...n,ref:t,style:{flexShrink:0,...n.style},onPointerDown:Y(n.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(o,50))}),onPointerMove:Y(n.onPointerMove,()=>{a.onItemLeave?.(),i.current===null&&(i.current=window.setInterval(o,50))}),onPointerLeave:Y(n.onPointerLeave,()=>{c()})})}),IC="SelectSeparator",bp=u.forwardRef((e,t)=>{const{__scopeSelect:r,...o}=e;return l.jsx(J.div,{"aria-hidden":!0,...o,ref:t})});bp.displayName=IC;var Ri="SelectArrow",RC=u.forwardRef((e,t)=>{const{__scopeSelect:r,...o}=e,n=Tn(r),a=Vt(Ri,r),i=Wt(Ri,r);return a.open&&i.position==="popper"?l.jsx(ln,{...n,...o,ref:t}):null});RC.displayName=Ri;var OC="SelectBubbleInput",yp=u.forwardRef(({__scopeSelect:e,value:t,...r},o)=>{const n=u.useRef(null),a=ce(o,n),i=Or(t);return u.useEffect(()=>{const s=n.current;if(!s)return;const c=window.HTMLSelectElement.prototype,p=Object.getOwnPropertyDescriptor(c,"value").set;if(i!==t&&p){const f=new Event("change",{bubbles:!0});p.call(s,t),s.dispatchEvent(f)}},[i,t]),l.jsx(J.select,{...r,style:{...qu,...r.style},ref:a,defaultValue:t})});yp.displayName=OC;function kp(e){return e===""||e===void 0}function Cp(e){const t=$e(e),r=u.useRef(""),o=u.useRef(0),n=u.useCallback(i=>{const s=r.current+i;t(s),function c(d){r.current=d,window.clearTimeout(o.current),d!==""&&(o.current=window.setTimeout(()=>c(""),1e3))}(s)},[t]),a=u.useCallback(()=>{r.current="",window.clearTimeout(o.current)},[]);return u.useEffect(()=>()=>window.clearTimeout(o.current),[]),[r,n,a]}function Sp(e,t,r){const n=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,a=r?e.indexOf(r):-1;let i=$C(e,Math.max(a,0));n.length===1&&(i=i.filter(d=>d!==r));const c=i.find(d=>d.textValue.toLowerCase().startsWith(n.toLowerCase()));return c!==r?c:void 0}function $C(e,t){return e.map((r,o)=>e[(t+o)%e.length])}var LC=Zu,Ep=Ju,FC=tp,zC=rp,Np=op,BC=sp,VC=cp,jp=up,Tp=fp,WC=mp,HC=vp,Pp=hp,_p=wp,Mp=bp;const Oi=LC,UC=VC,$i=FC,_n=u.forwardRef(({className:e,children:t,...r},o)=>l.jsxs(Ep,{ref:o,className:R("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...r,children:[t,l.jsx(zC,{asChild:!0,children:l.jsx(Cr,{className:"h-4 w-4 opacity-50"})})]}));_n.displayName=Ep.displayName;const Li=u.forwardRef(({className:e,...t},r)=>l.jsx(Pp,{ref:r,className:R("flex cursor-default items-center justify-center py-1",e),...t,children:l.jsx(Ec,{className:"h-4 w-4"})}));Li.displayName=Pp.displayName;const Fi=u.forwardRef(({className:e,...t},r)=>l.jsx(_p,{ref:r,className:R("flex cursor-default items-center justify-center py-1",e),...t,children:l.jsx(Cr,{className:"h-4 w-4"})}));Fi.displayName=_p.displayName;const Mn=u.forwardRef(({className:e,children:t,position:r="popper",...o},n)=>l.jsxs(Np,{ref:n,className:R("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...o,children:[l.jsx(Li,{}),l.jsx(BC,{className:R("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),l.jsx(Fi,{})]}));Mn.displayName=Np.displayName;const Dp=u.forwardRef(({className:e,...t},r)=>l.jsx(jp,{ref:r,className:R("px-2 py-1.5 text-sm font-semibold",e),...t}));Dp.displayName=jp.displayName;const Ht=u.forwardRef(({className:e,children:t,...r},o)=>l.jsxs(Tp,{ref:o,className:R("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[l.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:l.jsx(HC,{children:l.jsx(eo,{className:"h-4 w-4"})})}),l.jsx(WC,{children:t})]}));Ht.displayName=Tp.displayName;const Ap=u.forwardRef(({className:e,...t},r)=>l.jsx(Mp,{ref:r,className:R("-mx-1 my-1 h-px bg-muted",e),...t}));Ap.displayName=Mp.displayName;function GC({filter:e,value:t,onChange:r}){return l.jsxs(Oi,{value:t||"all",onValueChange:r,children:[l.jsx(_n,{className:"w-40",children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(ob,{className:"h-4 w-4"}),l.jsx($i,{placeholder:e.label})]})}),l.jsxs(Mn,{children:[l.jsxs(Ht,{value:"all",children:["All ",e.label]}),e.options.map(o=>l.jsx(Ht,{value:o.value,children:o.label},o.value))]})]})}const YC=wt("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",{variants:{sizing:{sm:"h-8 text-xs px-2",md:"h-10 text-sm px-3",lg:"h-12 text-base px-4",xl:"h-14 text-lg px-5","2xl":"h-16 text-xl px-6"}},defaultVariants:{sizing:"md"}}),Lr=u.forwardRef(({className:e,sizing:t,type:r,...o},n)=>l.jsx("input",{type:r,className:R(YC({sizing:t,className:e})),ref:n,...o}));Lr.displayName="Input";function qC({value:e,onChange:t,placeholder:r="Search..."}){return l.jsxs("div",{className:"relative flex-1 max-w-sm",children:[l.jsx(Ga,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-muted-foreground h-4 w-4"}),l.jsx(Lr,{placeholder:r,value:e,onChange:o=>t(o.target.value),className:"pl-10",style:{paddingLeft:"2.5rem"}})]})}function KC({selectedCount:e,onClearSelection:t}){return e===0?null:l.jsxs("div",{className:"bg-muted/50 p-2 rounded-md flex items-center justify-between",children:[l.jsxs("div",{className:"text-sm",children:[l.jsx("span",{className:"font-medium",children:e})," ",e===1?"row":"rows"," selected"]}),l.jsx(ve,{variant:"ghost",size:"sm",onClick:t,children:"Clear selection"})]})}var Dn="Checkbox",[XC,mD]=De(Dn),[ZC,zi]=XC(Dn);function QC(e){const{__scopeCheckbox:t,checked:r,children:o,defaultChecked:n,disabled:a,form:i,name:s,onCheckedChange:c,required:d,value:p="on",internal_do_not_use_render:f}=e,[v,m]=Ae({prop:r,defaultProp:n??!1,onChange:c,caller:Dn}),[h,g]=u.useState(null),[w,x]=u.useState(null),b=u.useRef(!1),y=h?!!i||!!h.closest("form"):!0,S={checked:v,disabled:a,setChecked:m,control:h,setControl:g,name:s,form:i,value:p,hasConsumerStoppedPropagationRef:b,required:d,defaultChecked:Ut(n)?!1:n,isFormControl:y,bubbleInput:w,setBubbleInput:x};return l.jsx(ZC,{scope:t,...S,children:JC(f)?f(S):o})}var Ip="CheckboxTrigger",Rp=u.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:r,...o},n)=>{const{control:a,value:i,disabled:s,checked:c,required:d,setControl:p,setChecked:f,hasConsumerStoppedPropagationRef:v,isFormControl:m,bubbleInput:h}=zi(Ip,e),g=ce(n,p),w=u.useRef(c);return u.useEffect(()=>{const x=a?.form;if(x){const b=()=>f(w.current);return x.addEventListener("reset",b),()=>x.removeEventListener("reset",b)}},[a,f]),l.jsx(J.button,{type:"button",role:"checkbox","aria-checked":Ut(c)?"mixed":c,"aria-required":d,"data-state":zp(c),"data-disabled":s?"":void 0,disabled:s,value:i,...o,ref:g,onKeyDown:Y(t,x=>{x.key==="Enter"&&x.preventDefault()}),onClick:Y(r,x=>{f(b=>Ut(b)?!0:!b),h&&m&&(v.current=x.isPropagationStopped(),v.current||x.stopPropagation())})})});Rp.displayName=Ip;var Bi=u.forwardRef((e,t)=>{const{__scopeCheckbox:r,name:o,checked:n,defaultChecked:a,required:i,disabled:s,value:c,onCheckedChange:d,form:p,...f}=e;return l.jsx(QC,{__scopeCheckbox:r,checked:n,defaultChecked:a,disabled:s,required:i,onCheckedChange:d,name:o,form:p,value:c,internal_do_not_use_render:({isFormControl:v})=>l.jsxs(l.Fragment,{children:[l.jsx(Rp,{...f,ref:t,__scopeCheckbox:r}),v&&l.jsx(Fp,{__scopeCheckbox:r})]})})});Bi.displayName=Dn;var Op="CheckboxIndicator",$p=u.forwardRef((e,t)=>{const{__scopeCheckbox:r,forceMount:o,...n}=e,a=zi(Op,r);return l.jsx(Re,{present:o||Ut(a.checked)||a.checked===!0,children:l.jsx(J.span,{"data-state":zp(a.checked),"data-disabled":a.disabled?"":void 0,...n,ref:t,style:{pointerEvents:"none",...e.style}})})});$p.displayName=Op;var Lp="CheckboxBubbleInput",Fp=u.forwardRef(({__scopeCheckbox:e,...t},r)=>{const{control:o,hasConsumerStoppedPropagationRef:n,checked:a,defaultChecked:i,required:s,disabled:c,name:d,value:p,form:f,bubbleInput:v,setBubbleInput:m}=zi(Lp,e),h=ce(r,m),g=Or(a),w=so(o);u.useEffect(()=>{const b=v;if(!b)return;const y=window.HTMLInputElement.prototype,k=Object.getOwnPropertyDescriptor(y,"checked").set,M=!n.current;if(g!==a&&k){const j=new Event("click",{bubbles:M});b.indeterminate=Ut(a),k.call(b,Ut(a)?!1:a),b.dispatchEvent(j)}},[v,g,a,n]);const x=u.useRef(Ut(a)?!1:a);return l.jsx(J.input,{type:"checkbox","aria-hidden":!0,defaultChecked:i??x.current,required:s,disabled:c,name:d,value:p,form:f,...t,tabIndex:-1,ref:h,style:{...t.style,...w,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});Fp.displayName=Lp;function JC(e){return typeof e=="function"}function Ut(e){return e==="indeterminate"}function zp(e){return Ut(e)?"indeterminate":e?"checked":"unchecked"}const An=u.forwardRef(({className:e,...t},r)=>l.jsx(Bi,{ref:r,className:R("peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:l.jsx($p,{className:R("flex items-center justify-center text-current"),children:l.jsx(eo,{className:"h-4 w-4"})})}));An.displayName=Bi.displayName;function eS({columns:e,sortState:t,allRowsSelected:r,hasData:o,onSort:n,onToggleAllRows:a,allowSelectAllRows:i}){const s=e.filter(c=>!c.hidden);return l.jsxs(Er,{children:[i&&l.jsx(ro,{className:"w-12",children:l.jsx(An,{checked:r&&o,onCheckedChange:a,"aria-label":"Select all rows"})}),s.map(c=>l.jsx(ro,{className:R(c.sortable?"cursor-pointer select-none":"",c.headerClassName,c.align==="right"?"text-right":"",c.align==="center"?"text-center":""),onClick:c.sortable?()=>n(String(c.key)):void 0,style:{width:c.width?typeof c.width=="number"?`${c.width}px`:c.width:void 0},children:l.jsxs("div",{className:"flex items-center gap-1",children:[c.title,c.sortable&&l.jsx(l.Fragment,{children:t.field===c.key?t.direction==="asc"?l.jsx(qx,{className:"h-4 w-4"}):l.jsx(Gx,{className:"h-4 w-4"}):l.jsx(Yx,{className:"h-4 w-4 opacity-50"})})]})},String(c.key)))]})}function tS({row:e,index:t,columns:r,isSelected:o,rowId:n,onToggleSelection:a,allowSelection:i=!0}){const s=r.filter(c=>!c.hidden);return l.jsxs(Er,{className:o?"bg-muted/50":"",children:[i&&l.jsx(Nr,{className:"w-12",children:l.jsx(An,{checked:o,onCheckedChange:c=>a(n,!!c),"aria-label":`Select row ${t+1}`})}),s.map(c=>{const d=e[c.key];return l.jsx(Nr,{className:R(c.align==="right"?"text-right":"",c.align==="center"?"text-center":"",c.cellClassName),children:c.customRenderer?c.customRenderer(d,e):String(d??"")},String(c.key))})]})}const Ke=({className:e,repeat:t=1,...r})=>{const o=t==null||Number.isNaN(t)||t<0?1:Math.floor(t);return o===0?null:l.jsx(l.Fragment,{children:Array.from({length:o}).map((n,a)=>l.jsx("div",{className:R("animate-shimmer bg-gradient-to-r from-gray-300 via-gray-100 to-gray-300","bg-[length:200%_100%] rounded-md h-5",e),...r},a))})};function rS({columns:e,rows:t=5}){return l.jsx("div",{className:"rounded-md border",children:l.jsxs(Go,{children:[l.jsx(Yo,{children:l.jsx(Er,{children:Array.from({length:e}).map((r,o)=>l.jsx(ro,{children:l.jsx(Ke,{className:"h-4 w-20"})},o))})}),l.jsx(qo,{children:Array.from({length:t}).map((r,o)=>l.jsx(Er,{children:Array.from({length:e}).map((n,a)=>l.jsx(Nr,{children:l.jsx(Ke,{className:"h-4 w-full"})},a))},o))})]})})}function oS(e,t,r){const o=t.filter(p=>!p.hidden),n=o.map(p=>p.title),a=e.map(p=>o.map(f=>{const v=p[f.key];return v!=null?String(v):""})),i=[n.join(","),...a.map(p=>p.join(","))].join(`
289
289
  `),s=new Blob([i],{type:"text/csv;charset=utf-8;"}),c=URL.createObjectURL(s),d=document.createElement("a");d.setAttribute("href",c),d.setAttribute("download",`${r}.csv`),d.style.visibility="hidden",document.body.appendChild(d),d.click(),document.body.removeChild(d)}var In="Collapsible",[nS,Bp]=De(In),[aS,Vi]=nS(In),Vp=u.forwardRef((e,t)=>{const{__scopeCollapsible:r,open:o,defaultOpen:n,disabled:a,onOpenChange:i,...s}=e,[c,d]=Ae({prop:o,defaultProp:n??!1,onChange:i,caller:In});return l.jsx(aS,{scope:r,disabled:a,contentId:je(),open:c,onOpenToggle:u.useCallback(()=>d(p=>!p),[d]),children:l.jsx(J.div,{"data-state":Gi(c),"data-disabled":a?"":void 0,...s,ref:t})})});Vp.displayName=In;var Wp="CollapsibleTrigger",Wi=u.forwardRef((e,t)=>{const{__scopeCollapsible:r,...o}=e,n=Vi(Wp,r);return l.jsx(J.button,{type:"button","aria-controls":n.contentId,"aria-expanded":n.open||!1,"data-state":Gi(n.open),"data-disabled":n.disabled?"":void 0,disabled:n.disabled,...o,ref:t,onClick:Y(e.onClick,n.onOpenToggle)})});Wi.displayName=Wp;var Hi="CollapsibleContent",Ui=u.forwardRef((e,t)=>{const{forceMount:r,...o}=e,n=Vi(Hi,e.__scopeCollapsible);return l.jsx(Re,{present:r||n.open,children:({present:a})=>l.jsx(iS,{...o,ref:t,present:a})})});Ui.displayName=Hi;var iS=u.forwardRef((e,t)=>{const{__scopeCollapsible:r,present:o,children:n,...a}=e,i=Vi(Hi,r),[s,c]=u.useState(o),d=u.useRef(null),p=ce(t,d),f=u.useRef(0),v=f.current,m=u.useRef(0),h=m.current,g=i.open||s,w=u.useRef(g),x=u.useRef(void 0);return u.useEffect(()=>{const b=requestAnimationFrame(()=>w.current=!1);return()=>cancelAnimationFrame(b)},[]),Te(()=>{const b=d.current;if(b){x.current=x.current||{transitionDuration:b.style.transitionDuration,animationName:b.style.animationName},b.style.transitionDuration="0s",b.style.animationName="none";const y=b.getBoundingClientRect();f.current=y.height,m.current=y.width,w.current||(b.style.transitionDuration=x.current.transitionDuration,b.style.animationName=x.current.animationName),c(o)}},[i.open,o]),l.jsx(J.div,{"data-state":Gi(i.open),"data-disabled":i.disabled?"":void 0,id:i.contentId,hidden:!g,...a,ref:p,style:{"--radix-collapsible-content-height":v?`${v}px`:void 0,"--radix-collapsible-content-width":h?`${h}px`:void 0,...e.style},children:g&&n})});function Gi(e){return e?"open":"closed"}var Hp=Vp,sS=Wi,lS=Ui,it="Accordion",cS=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[Yi,dS,uS]=tr(it),[Rn,gD]=De(it,[uS,Bp]),qi=Bp(),Up=C.forwardRef((e,t)=>{const{type:r,...o}=e,n=o,a=o;return l.jsx(Yi.Provider,{scope:e.__scopeAccordion,children:r==="multiple"?l.jsx(gS,{...a,ref:t}):l.jsx(mS,{...n,ref:t})})});Up.displayName=it;var[Gp,pS]=Rn(it),[Yp,fS]=Rn(it,{collapsible:!1}),mS=C.forwardRef((e,t)=>{const{value:r,defaultValue:o,onValueChange:n=()=>{},collapsible:a=!1,...i}=e,[s,c]=Ae({prop:r,defaultProp:o??"",onChange:n,caller:it});return l.jsx(Gp,{scope:e.__scopeAccordion,value:C.useMemo(()=>s?[s]:[],[s]),onItemOpen:c,onItemClose:C.useCallback(()=>a&&c(""),[a,c]),children:l.jsx(Yp,{scope:e.__scopeAccordion,collapsible:a,children:l.jsx(qp,{...i,ref:t})})})}),gS=C.forwardRef((e,t)=>{const{value:r,defaultValue:o,onValueChange:n=()=>{},...a}=e,[i,s]=Ae({prop:r,defaultProp:o??[],onChange:n,caller:it}),c=C.useCallback(p=>s((f=[])=>[...f,p]),[s]),d=C.useCallback(p=>s((f=[])=>f.filter(v=>v!==p)),[s]);return l.jsx(Gp,{scope:e.__scopeAccordion,value:i,onItemOpen:c,onItemClose:d,children:l.jsx(Yp,{scope:e.__scopeAccordion,collapsible:!0,children:l.jsx(qp,{...a,ref:t})})})}),[vS,On]=Rn(it),qp=C.forwardRef((e,t)=>{const{__scopeAccordion:r,disabled:o,dir:n,orientation:a="vertical",...i}=e,s=C.useRef(null),c=ce(s,t),d=dS(r),f=jt(n)==="ltr",v=Y(e.onKeyDown,m=>{if(!cS.includes(m.key))return;const h=m.target,g=d().filter(T=>!T.ref.current?.disabled),w=g.findIndex(T=>T.ref.current===h),x=g.length;if(w===-1)return;m.preventDefault();let b=w;const y=0,S=x-1,k=()=>{b=w+1,b>S&&(b=y)},M=()=>{b=w-1,b<y&&(b=S)};switch(m.key){case"Home":b=y;break;case"End":b=S;break;case"ArrowRight":a==="horizontal"&&(f?k():M());break;case"ArrowDown":a==="vertical"&&k();break;case"ArrowLeft":a==="horizontal"&&(f?M():k());break;case"ArrowUp":a==="vertical"&&M();break}const j=b%x;g[j].ref.current?.focus()});return l.jsx(vS,{scope:r,disabled:o,direction:n,orientation:a,children:l.jsx(Yi.Slot,{scope:r,children:l.jsx(J.div,{...i,"data-orientation":a,ref:c,onKeyDown:o?void 0:v})})})}),$n="AccordionItem",[hS,Ki]=Rn($n),Kp=C.forwardRef((e,t)=>{const{__scopeAccordion:r,value:o,...n}=e,a=On($n,r),i=pS($n,r),s=qi(r),c=je(),d=o&&i.value.includes(o)||!1,p=a.disabled||e.disabled;return l.jsx(hS,{scope:r,open:d,disabled:p,triggerId:c,children:l.jsx(Hp,{"data-orientation":a.orientation,"data-state":tf(d),...s,...n,ref:t,disabled:p,open:d,onOpenChange:f=>{f?i.onItemOpen(o):i.onItemClose(o)}})})});Kp.displayName=$n;var Xp="AccordionHeader",Zp=C.forwardRef((e,t)=>{const{__scopeAccordion:r,...o}=e,n=On(it,r),a=Ki(Xp,r);return l.jsx(J.h3,{"data-orientation":n.orientation,"data-state":tf(a.open),"data-disabled":a.disabled?"":void 0,...o,ref:t})});Zp.displayName=Xp;var Xi="AccordionTrigger",Qp=C.forwardRef((e,t)=>{const{__scopeAccordion:r,...o}=e,n=On(it,r),a=Ki(Xi,r),i=fS(Xi,r),s=qi(r);return l.jsx(Yi.ItemSlot,{scope:r,children:l.jsx(sS,{"aria-disabled":a.open&&!i.collapsible||void 0,"data-orientation":n.orientation,id:a.triggerId,...s,...o,ref:t})})});Qp.displayName=Xi;var Jp="AccordionContent",ef=C.forwardRef((e,t)=>{const{__scopeAccordion:r,...o}=e,n=On(it,r),a=Ki(Jp,r),i=qi(r);return l.jsx(lS,{role:"region","aria-labelledby":a.triggerId,"data-orientation":n.orientation,...i,...o,ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});ef.displayName=Jp;function tf(e){return e?"open":"closed"}var wS=Up,xS=Kp,bS=Zp,yS=Qp,kS=ef,Ln="Dialog",[rf,of]=De(Ln),[CS,st]=rf(Ln),nf=e=>{const{__scopeDialog:t,children:r,open:o,defaultOpen:n,onOpenChange:a,modal:i=!0}=e,s=u.useRef(null),c=u.useRef(null),[d,p]=Ae({prop:o,defaultProp:n??!1,onChange:a,caller:Ln});return l.jsx(CS,{scope:t,triggerRef:s,contentRef:c,contentId:je(),titleId:je(),descriptionId:je(),open:d,onOpenChange:p,onOpenToggle:u.useCallback(()=>p(f=>!f),[p]),modal:i,children:r})};nf.displayName=Ln;var af="DialogTrigger",sf=u.forwardRef((e,t)=>{const{__scopeDialog:r,...o}=e,n=st(af,r),a=ce(t,n.triggerRef);return l.jsx(J.button,{type:"button","aria-haspopup":"dialog","aria-expanded":n.open,"aria-controls":n.contentId,"data-state":Ji(n.open),...o,ref:a,onClick:Y(e.onClick,n.onOpenToggle)})});sf.displayName=af;var Zi="DialogPortal",[SS,lf]=rf(Zi,{forceMount:void 0}),cf=e=>{const{__scopeDialog:t,forceMount:r,children:o,container:n}=e,a=st(Zi,t);return l.jsx(SS,{scope:t,forceMount:r,children:u.Children.map(o,i=>l.jsx(Re,{present:r||a.open,children:l.jsx(uo,{asChild:!0,container:n,children:i})}))})};cf.displayName=Zi;var Fn="DialogOverlay",df=u.forwardRef((e,t)=>{const r=lf(Fn,e.__scopeDialog),{forceMount:o=r.forceMount,...n}=e,a=st(Fn,e.__scopeDialog);return a.modal?l.jsx(Re,{present:o||a.open,children:l.jsx(NS,{...n,ref:t})}):null});df.displayName=Fn;var ES=Rt("DialogOverlay.RemoveScroll"),NS=u.forwardRef((e,t)=>{const{__scopeDialog:r,...o}=e,n=st(Fn,r);return l.jsx(fo,{as:ES,allowPinchZoom:!0,shards:[n.contentRef],children:l.jsx(J.div,{"data-state":Ji(n.open),...o,ref:t,style:{pointerEvents:"auto",...o.style}})})}),lr="DialogContent",uf=u.forwardRef((e,t)=>{const r=lf(lr,e.__scopeDialog),{forceMount:o=r.forceMount,...n}=e,a=st(lr,e.__scopeDialog);return l.jsx(Re,{present:o||a.open,children:a.modal?l.jsx(jS,{...n,ref:t}):l.jsx(TS,{...n,ref:t})})});uf.displayName=lr;var jS=u.forwardRef((e,t)=>{const r=st(lr,e.__scopeDialog),o=u.useRef(null),n=ce(t,r.contentRef,o);return u.useEffect(()=>{const a=o.current;if(a)return mn(a)},[]),l.jsx(pf,{...e,ref:n,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Y(e.onCloseAutoFocus,a=>{a.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:Y(e.onPointerDownOutside,a=>{const i=a.detail.originalEvent,s=i.button===0&&i.ctrlKey===!0;(i.button===2||s)&&a.preventDefault()}),onFocusOutside:Y(e.onFocusOutside,a=>a.preventDefault())})}),TS=u.forwardRef((e,t)=>{const r=st(lr,e.__scopeDialog),o=u.useRef(!1),n=u.useRef(!1);return l.jsx(pf,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{e.onCloseAutoFocus?.(a),a.defaultPrevented||(o.current||r.triggerRef.current?.focus(),a.preventDefault()),o.current=!1,n.current=!1},onInteractOutside:a=>{e.onInteractOutside?.(a),a.defaultPrevented||(o.current=!0,a.detail.originalEvent.type==="pointerdown"&&(n.current=!0));const i=a.target;r.triggerRef.current?.contains(i)&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&n.current&&a.preventDefault()}})}),pf=u.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:o,onOpenAutoFocus:n,onCloseAutoFocus:a,...i}=e,s=st(lr,r),c=u.useRef(null),d=ce(t,c);return Xo(),l.jsxs(l.Fragment,{children:[l.jsx(oo,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:n,onUnmountAutoFocus:a,children:l.jsx(rr,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":Ji(s.open),...i,ref:d,onDismiss:()=>s.onOpenChange(!1)})}),l.jsxs(l.Fragment,{children:[l.jsx(_S,{titleId:s.titleId}),l.jsx(DS,{contentRef:c,descriptionId:s.descriptionId})]})]})}),Qi="DialogTitle",ff=u.forwardRef((e,t)=>{const{__scopeDialog:r,...o}=e,n=st(Qi,r);return l.jsx(J.h2,{id:n.titleId,...o,ref:t})});ff.displayName=Qi;var mf="DialogDescription",gf=u.forwardRef((e,t)=>{const{__scopeDialog:r,...o}=e,n=st(mf,r);return l.jsx(J.p,{id:n.descriptionId,...o,ref:t})});gf.displayName=mf;var vf="DialogClose",hf=u.forwardRef((e,t)=>{const{__scopeDialog:r,...o}=e,n=st(vf,r);return l.jsx(J.button,{type:"button",...o,ref:t,onClick:Y(e.onClick,()=>n.onOpenChange(!1))})});hf.displayName=vf;function Ji(e){return e?"open":"closed"}var wf="DialogTitleWarning",[PS,xf]=vb(wf,{contentName:lr,titleName:Qi,docsSlug:"dialog"}),_S=({titleId:e})=>{const t=xf(wf),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
290
290
 
291
291
  If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "buildgrid-ui",
3
- "version": "1.19.0",
3
+ "version": "1.19.2",
4
4
  "homepage": "http://adrianomaringolo.github.io/buildgrid-ui",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -108,8 +108,8 @@
108
108
  "tw-animate-css": "^1.3.6"
109
109
  },
110
110
  "peerDependencies": {
111
- "react": "^19.0.0",
112
- "react-dom": "^19.0.0"
111
+ "react": "^18.0.0 || ^19.0.0",
112
+ "react-dom": "^18.0.0 || ^19.0.0"
113
113
  },
114
114
  "devDependencies": {
115
115
  "@commitlint/cli": "^19.8.1",