"use strict";const e=require("react/jsx-runtime"),o=require("@mui/material/Box"),x=require("./CopyButton-3fq1UAiv.cjs");function l({children:r,lineNumbers:a=!1,copy:i=!0,maxHeight:d,wrap:n=!1,sx:t}){const c=r.split(`
`);return e.jsxs(o,{sx:{position:"relative",bgcolor:"var(--ov-bg-surface-inset)",borderRadius:"6px",border:"1px solid var(--ov-border-muted)",overflow:"hidden",...typeof t=="object"&&!Array.isArray(t)?t:{}},children:[i&&e.jsx(o,{sx:{position:"absolute",top:4,right:4,zIndex:1},children:e.jsx(x.CopyButton,{value:r,size:"xs"})}),e.jsx(o,{component:"pre",sx:{m:0,p:1.5,pr:i?5:1.5,overflow:"auto",maxHeight:d,fontFamily:"var(--ov-font-mono)",fontSize:"13px",lineHeight:1.6,color:"var(--ov-fg-default)",whiteSpace:n?"pre-wrap":"pre",wordBreak:n?"break-all":void 0},children:a?e.jsx(o,{component:"table",sx:{borderCollapse:"collapse",width:"100%"},children:e.jsx("tbody",{children:c.map((p,s)=>e.jsxs("tr",{children:[e.jsx(o,{component:"td",sx:{pr:2,pl:.5,textAlign:"right",userSelect:"none",color:"var(--ov-fg-faint)",width:1,whiteSpace:"nowrap",verticalAlign:"top"},children:s+1}),e.jsx("td",{children:p})]},s))})}):e.jsx("code",{children:r})})]})}l.displayName="CodeBlock";exports.CodeBlock=l;
