import{aJ as e,r as d}from"./@ui-core-DKdciH1Z.js";import{t as h,c as o,l as u,B as C,S as x,m as g,C as f,o as b,q as y,v as j}from"./index-D7KLAbvI.js";function N({open:s,className:a}){return e.jsx(h,{className:o(` ${s?"":"-rotate-90"} size-5 shrink-0 rounded-md fill-neutral-500 transition-transform duration-200 hover:bg-neutral-200`,a)})}function v({copyText:s,className:a,...t}){const{copyToClipboard:l,copied:r}=u();return e.jsxs(C,{size:"sm",className:o("flex items-center gap-1 bg-theme-surface-primary",a),intent:"secondary",emphasis:"subtle",onClick:()=>l(s),...t,children:[r?e.jsx(x,{width:16,height:16,className:"shrink-0 fill-neutral-500"}):e.jsx(g,{width:16,height:16,className:"shrink-0 fill-neutral-500"}),r?"Copied":e.jsx("span",{children:"Copy"})]})}function k({title:s,children:a,initialOpen:t=!1,className:l,contentClassName:r,intent:i="primary",headerClassName:c,headerChildren:p}){const[n,m]=d.useState(t);return e.jsxs(f,{className:l,open:n,onOpenChange:m,children:[e.jsxs(b,{intent:i,className:c,children:[e.jsxs(y,{className:"flex flex-1 items-center gap-[10px]",children:[e.jsx(N,{open:n}),s]}),p]}),e.jsx(j,{className:o("space-y-3 border-t border-theme-border-moderate bg-theme-surface-primary px-5 py-3",r),children:a})]})}function B({copyText:s,displayCopyButton:a=!0,headerClassName:t,className:l,headerChildren:r,...i}){return e.jsx(k,{...i,className:o("group",l),headerClassName:o("flex flex-col lg:flex-row items-start lg:items-center gap-2",t),headerChildren:r||(a?e.jsx("div",{className:"opacity-100 transition-opacity duration-200 lg:opacity-0 lg:group-hover:opacity-100",children:e.jsx(v,{copyText:s})}):null)})}export{k as C,v as a,N as b,B as c};
