import{j as e,c as p,r as h}from"./index-Dbk1Plmn.js";import{C as x}from"./chevron-down-BMaycUN9.js";import{C as o}from"./chevron-right-L2MnFoxW.js";function N({data:s,defaultExpanded:c=!1,expandAll:n=!1,className:t}){return e.jsx("div",{className:p("font-mono text-xs",t),children:e.jsx(l,{value:s,defaultExpanded:c,expandAll:n,depth:0})})}function l({value:s,defaultExpanded:c,expandAll:n,depth:t}){const[r,d]=h.useState(n||c||t<1);if(s===null)return e.jsx("span",{className:"text-muted-foreground",children:"null"});if(s===void 0)return e.jsx("span",{className:"text-muted-foreground",children:"undefined"});if(typeof s=="boolean")return e.jsx("span",{className:"text-blue-600",children:String(s)});if(typeof s=="number")return e.jsx("span",{className:"text-green-600",children:s});if(typeof s=="string")return s.length>200?e.jsxs("span",{className:"text-amber-700",children:['"',s.slice(0,200),'…"']}):e.jsxs("span",{className:"text-amber-700",children:['"',s,'"']});if(Array.isArray(s))return s.length===0?e.jsx("span",{children:"[]"}):e.jsxs("div",{children:[e.jsxs("button",{onClick:()=>d(!r),className:"inline-flex items-center gap-0.5 hover:text-primary",children:[r?e.jsx(x,{className:"h-3 w-3"}):e.jsx(o,{className:"h-3 w-3"}),e.jsxs("span",{className:"text-muted-foreground",children:["Array(",s.length,")"]})]}),r&&e.jsx("div",{className:"ml-4 border-l pl-2",children:s.map((a,i)=>e.jsxs("div",{className:"py-0.5",children:[e.jsxs("span",{className:"text-muted-foreground mr-1",children:[i,":"]}),e.jsx(l,{value:a,defaultExpanded:!1,expandAll:n,depth:t+1})]},i))})]});if(typeof s=="object"){const a=Object.entries(s);return a.length===0?e.jsx("span",{children:"{}"}):e.jsxs("div",{children:[e.jsxs("button",{onClick:()=>d(!r),className:"inline-flex items-center gap-0.5 hover:text-primary",children:[r?e.jsx(x,{className:"h-3 w-3"}):e.jsx(o,{className:"h-3 w-3"}),e.jsx("span",{className:"text-muted-foreground",children:`{${a.length}}`})]}),r&&e.jsx("div",{className:"ml-4 border-l pl-2",children:a.map(([i,m])=>e.jsxs("div",{className:"py-0.5",children:[e.jsxs("span",{className:"text-purple-600 mr-1",children:[i,":"]}),e.jsx(l,{value:m,defaultExpanded:!1,expandAll:n,depth:t+1})]},i))})]})}return e.jsx("span",{children:String(s)})}export{N as J};
