import{s as x}from"./chunk-LvLJmgfZ.js";import{t as u}from"./react-Bj1aDYRI.js";import{t as y}from"./compiler-runtime-B3qBwwSJ.js";import{t as p}from"./cn-DCUzRj2J.js";import{t as j}from"./jsx-runtime-BqBOg78p.js";import{t as w}from"./tooltip-DTV9tlSr.js";import{t as N}from"./button-BbCh-29a.js";import{t as C}from"./chevron-right-CG5QYXYk.js";import{t as b}from"./ellipsis-vertical-CkwWkOQL.js";import{t as k}from"./refresh-cw-DHwG4Mac.js";var d=y(),f=x(u(),1),l=x(j(),1);const v=i=>{let s=(0,d.c)(5),{isExpanded:a,className:o}=i,e=a&&"rotate-90",t;s[0]!==o||s[1]!==e?(t=p("shrink-0 transition-transform",e,o),s[0]=o,s[1]=e,s[2]=t):t=s[2];let r;return s[3]===t?r=s[4]:(r=(0,l.jsx)(C,{className:t}),s[3]=t,s[4]=r),r},g=({onClick:i,tooltip:s="Refresh",className:a,iconClassName:o})=>{let[e,t]=(0,f.useState)(!1);return(0,l.jsx)(w,{content:s,children:(0,l.jsx)(N,{variant:"text",size:"xs",className:a,onClick:(0,f.useCallback)(async r=>{t(!0);let m=new Promise(n=>setTimeout(n,500));try{await Promise.all([i(r),m])}finally{t(!1)}},[i]),children:(0,l.jsx)(k,{className:p("h-4 w-4",o,e&&"animate-[spin_0.5s]")})})})},h=f.forwardRef((i,s)=>{let a=(0,d.c)(15),o,e,t;a[0]===i?(o=a[1],e=a[2],t=a[3]):({className:o,iconClassName:e,...t}=i,a[0]=i,a[1]=o,a[2]=e,a[3]=t);let r;a[4]===o?r=a[5]:(r=p("mb-0 opacity-0 group-hover:opacity-100 transition-opacity",o),a[4]=o,a[5]=r);let m;a[6]===e?m=a[7]:(m=p("w-4 h-4",e),a[6]=e,a[7]=m);let n;a[8]===m?n=a[9]:(n=(0,l.jsx)(b,{className:m}),a[8]=m,a[9]=n);let c;return a[10]!==t||a[11]!==s||a[12]!==r||a[13]!==n?(c=(0,l.jsx)(N,{ref:s,variant:"text",tabIndex:-1,size:"xs",className:r,"aria-label":"More options",...t,children:n}),a[10]=t,a[11]=s,a[12]=r,a[13]=n,a[14]=c):c=a[14],c});h.displayName="MoreActionsButton";const z="h-3.5 w-3.5 mr-2";export{v as i,h as n,g as r,z as t};
