import{c as h,r as c,j as o}from"./vendor-tanstack-DE4ALVGD.js";import{u as g,m as x,E as b}from"./vendor-codemirror-BT6VBNns.js";import{aZ as w,q as v,I as y,y as C}from"./index-CNL5pSma.js";import"./vendor-react-HBv6Kpyp.js";import"./vendor-radix-K8EF6rBE.js";import"./vendor-recharts-B3wzJa9e.js";import"./vendor-forms-BvpM0AtX.js";import"./vendor-date-Bck8LDfw.js";const j=[x(),b.lineWrapping],E=h.forwardRef(({className:l,value:r,onChange:u,copy:p=!1,onBlur:N,disabled:s,hideLineNumbers:f=!1,...m},i)=>{const e=c.useRef(null);let n;s&&(n={lineNumbers:!f,highlightActiveLine:!1,foldGutter:!1,highlightActiveLineGutter:!1});const{setContainer:a}=g({container:e.current,extensions:j,value:r,onChange:u,indentWithTab:!1,editable:!s,basicSetup:n});c.useEffect(()=>{e.current&&a(e.current)},[a]);const d=t=>{C.success("Copied to clipboard"),navigator.clipboard.writeText(t)};return o.jsx("div",{className:w("rounded-md border shadow-xs overflow-hidden focus-within:outline-hidden focus-within:ring-1 focus-within:ring-ring relative",l),ref:t=>{e.current=t,typeof i=="function"?i(t):i&&(i.current=t)},...m,children:p&&r&&o.jsx(v,{onClick:()=>d(r),variant:"ghost",size:"icon",className:"absolute top-0 right-0 z-10","aria-label":"copy",children:o.jsx(y,{id:"Copy",className:"size-2"})})})});E.displayName="MarkdownInput";export{E as MarkdownInput};
//# sourceMappingURL=markdown-input-BnozRFR_.js.map
