import{j as e,c as d,r as m}from"./index-CUDottTv.js";import{C as p}from"./chevron-right-Df1qu9CE.js";function h({data:t,defaultExpanded:s=!0,className:n}){return e.jsx("div",{className:d("font-mono text-[13px] leading-relaxed",n),children:e.jsx(c,{value:t,depth:0,defaultExpanded:s})})}function c({value:t,depth:s,defaultExpanded:n}){if(t===null)return e.jsx("span",{className:"text-text-muted",children:"null"});if(t===void 0)return e.jsx("span",{className:"text-text-muted",children:"undefined"});if(typeof t=="boolean")return e.jsx("span",{className:"text-purple",children:String(t)});if(typeof t=="number")return e.jsx("span",{className:"text-cyan",children:t});if(typeof t=="string")return e.jsxs("span",{className:"text-green",children:['"',t,'"']});if(Array.isArray(t))return e.jsx(l,{label:`Array(${t.length})`,depth:s,defaultExpanded:n&&s<2,bracketOpen:"[",bracketClose:"]",children:t.map((a,r)=>e.jsxs("div",{className:"flex",style:{paddingLeft:(s+1)*16},children:[e.jsxs("span",{className:"text-text-muted mr-1",children:[r,":"]}),e.jsx(c,{value:a,depth:s+1,defaultExpanded:n})]},r))});if(typeof t=="object"){const a=Object.entries(t);return e.jsx(l,{label:`{${a.length}}`,depth:s,defaultExpanded:n&&s<2,bracketOpen:"{",bracketClose:"}",children:a.map(([r,x])=>e.jsxs("div",{className:"flex",style:{paddingLeft:(s+1)*16},children:[e.jsxs("span",{className:"text-accent mr-1",children:[r,":"]}),e.jsx(c,{value:x,depth:s+1,defaultExpanded:n})]},r))})}return e.jsx("span",{className:"text-text-primary",children:String(t)})}function l({label:t,depth:s,defaultExpanded:n,bracketOpen:a,bracketClose:r,children:x}){const[i,o]=m.useState(n);return e.jsxs("div",{children:[e.jsxs("button",{onClick:()=>o(!i),className:"inline-flex items-center gap-0.5 cursor-pointer hover:bg-bg-hover rounded px-0.5",children:[e.jsx(p,{size:12,className:d("text-text-muted transition-transform",i&&"rotate-90")}),e.jsx("span",{className:"text-text-muted",children:i?a:`${a}${t}${r}`})]}),i&&e.jsxs(e.Fragment,{children:[x,e.jsx("div",{style:{paddingLeft:s*16},children:e.jsx("span",{className:"text-text-muted",children:r})})]})]})}export{h as J};
