import{s as y}from"./chunk-LvLJmgfZ.js";import{t as j}from"./react-Bj1aDYRI.js";import{t as g}from"./compiler-runtime-B3qBwwSJ.js";import{t as v}from"./jsx-runtime-CP2fAiZX.js";import{r as T}from"./button-BmOH9agK.js";import{t as w}from"./cn-d_A4rA-x.js";import{t as D}from"./check-BnZGcuDh.js";import{t as S}from"./copy-CAR4dOiD.js";import{t as k}from"./use-toast-BhMe50aT.js";import{t as E}from"./tooltip-DOQlecCr.js";import{t as L}from"./copy-DMCkK2TI.js";var P=g(),_=y(j(),1),n=y(v(),1);const q=C=>{let t=(0,P.c)(14),{value:a,className:r,buttonClassName:c,tooltip:d,toastTitle:s,ariaLabel:N}=C,[e,x]=(0,_.useState)(!1),m;t[0]!==s||t[1]!==a?(m=T.stopPropagation(async h=>{await L(typeof a=="function"?a(h):a).then(()=>{x(!0),setTimeout(()=>x(!1),2e3),s&&k({title:s})})}),t[0]=s,t[1]=a,t[2]=m):m=t[2];let f=m,u=N??"Copy to clipboard",o;t[3]!==r||t[4]!==e?(o=e?(0,n.jsx)(D,{className:w(r,"text-(--grass-11)")}):(0,n.jsx)(S,{className:r}),t[3]=r,t[4]=e,t[5]=o):o=t[5];let i;t[6]!==c||t[7]!==f||t[8]!==u||t[9]!==o?(i=(0,n.jsx)("button",{type:"button",onClick:f,"aria-label":u,className:c,children:o}),t[6]=c,t[7]=f,t[8]=u,t[9]=o,t[10]=i):i=t[10];let l=i;if(d===!1)return l;let b=e?"Copied!":d??"Copy to clipboard",p;return t[11]!==l||t[12]!==b?(p=(0,n.jsx)(E,{content:b,delayDuration:400,children:l}),t[11]=l,t[12]=b,t[13]=p):p=t[13],p};export{q as t};
