import{j as e}from"./@radix-AvWw-1nd.js";import{a as c,c as d,i as x}from"./type-guards-CaeD8wHO.js";import{n as f,T as g,H as u,J as N,K as b,Z as y}from"./index-DWoLoYDY.js";import{C as K}from"./CodeSnippet-D8ptwPjg.js";import{C as O}from"./CollapsibleCard-Djtd_ocf.js";function F({children:i,className:a,...l}){return e.jsx("dt",{...l,className:f("col-span-1 flex min-w-0 items-center truncate text-theme-text-secondary",a),children:i})}function J({children:i,className:a,...l}){return e.jsx("dd",{...l,className:f("col-span-2 flex h-6 w-full min-w-0 items-center truncate text-neutral-700",a),children:i})}function C({label:i,value:a}){return e.jsxs(e.Fragment,{children:[e.jsx(F,{children:i}),e.jsx(J,{children:a})]})}function w({title:i,data:a,intent:l="primary",isInitialOpen:o=!1,contentClassName:n,children:t,className:T}){const m={},j={},p={},V=/^<class\s+'.*'>$/;for(const[r,s]of Object.entries(a||{}))x(s)?m[r]=s:d(s)?p[r]=s:j[r]=s;const h=Object.entries(j);return h.sort((r,s)=>r[0].localeCompare(s[0])),e.jsxs(O,{contentClassName:n,className:T,initialOpen:o,intent:l,title:i,children:[Object.keys(a||{}).length===0?e.jsx("p",{children:"Not available"}):e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx("dl",{className:"grid grid-cols-1 gap-x-[10px] gap-y-2 md:grid-cols-3 md:gap-y-4",children:h.map(([r,s])=>e.jsx(C,{label:e.jsx(g,{children:e.jsxs(u,{children:[e.jsx(N,{className:"cursor-default truncate",children:r}),e.jsx(b,{className:"max-w-[480px]",children:r})]})}),value:e.jsx(e.Fragment,{children:c(s)&&V.test(s)?e.jsx(K,{className:"py-1",highlightCode:!0,code:s}):s===null?e.jsx("div",{children:"null"}):c(s)&&y(s)?e.jsx("a",{className:"underline transition-all duration-200 hover:decoration-transparent",href:s,target:"_blank",rel:"noopener noreferrer",children:s}):e.jsx("div",{className:"whitespace-normal",children:c(s)?s:JSON.stringify(s)})})},r))}),Object.entries(p).map(([r,s])=>e.jsx(S,{title:r,value:s},r)),Object.entries(m).map(([r,s])=>e.jsx(w,{intent:"secondary",title:r,data:s},r))]}),t]})}function S({title:i,value:a}){const l=a.filter(n=>!d(n)&&!x(n)||n===null),o=a.filter(n=>d(n)||x(n));return e.jsx(e.Fragment,{children:e.jsxs(O,{intent:"secondary",title:i,children:[l.length>0&&e.jsx("dl",{className:"grid grid-cols-1 gap-x-[10px] gap-y-2 truncate md:grid-cols-3 md:gap-y-4",children:Object.entries(l).map(([n,t])=>e.jsx(C,{label:e.jsx(g,{children:e.jsxs(u,{children:[e.jsx(N,{className:"cursor-default truncate",children:n}),e.jsx(b,{className:"max-w-[480px]",children:n})]})}),value:e.jsx("div",{className:"py-1",children:t===null?e.jsx("div",{children:"null"}):c(t)&&y(t)?e.jsx("a",{className:"underline transition-all duration-200 hover:decoration-transparent",href:t,target:"_blank",rel:"noopener noreferrer",children:t}):e.jsx("div",{className:"whitespace-normal",children:c(t)?t:JSON.stringify(t)})})},n))}),o.length>0&&e.jsx("ul",{className:"space-y-4",children:o.map((n,t)=>e.jsx("li",{children:e.jsx(w,{intent:"secondary",title:t,data:n},t)},t))})]},i)})}export{C as K,w as N,J as V,F as a};
