import{j as e}from"./@radix-DeK6qiuw.js";import{i as f}from"./url-CkvKAnwF.js";import{n as u,T as g,E as N,G as y,H as b}from"./index-CCOPpudF.js";import{C as V}from"./CodeSnippet-JzR8CEtw.js";import{C as O}from"./CollapsibleCard-DQW_ktMO.js";function F({children:r,className:a,...l}){return e.jsx("dt",{...l,className:u("col-span-1 flex min-w-0 items-center truncate text-theme-text-secondary",a),children:r})}function K({children:r,className:a,...l}){return e.jsx("dd",{...l,className:u("col-span-2 flex h-6 w-full min-w-0 items-center truncate text-neutral-700",a),children:r})}function C({label:r,value:a}){return e.jsxs(e.Fragment,{children:[e.jsx(F,{children:r}),e.jsx(K,{children:a})]})}function c(r){return typeof r=="string"}function H(r){return typeof r=="number"&&!isNaN(r)}function d(r){return Array.isArray(r)}function m(r){return r!==null&&typeof r=="object"&&!Array.isArray(r)}function w({title:r,data:a,intent:l="primary",isInitialOpen:o=!1,contentClassName:i,children:t,className:A}){const x={},p={},j={},T=/^<class\s+'.*'>$/;for(const[n,s]of Object.entries(a||{}))m(s)?x[n]=s:d(s)?j[n]=s:p[n]=s;const h=Object.entries(p);return h.sort((n,s)=>n[0].localeCompare(s[0])),e.jsxs(O,{contentClassName:i,className:A,initialOpen:o,intent:l,title:r,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(([n,s])=>e.jsx(C,{label:e.jsx(g,{children:e.jsxs(N,{children:[e.jsx(y,{className:"cursor-default truncate",children:n}),e.jsx(b,{className:"max-w-[480px]",children:n})]})}),value:e.jsx(e.Fragment,{children:c(s)&&T.test(s)?e.jsx(V,{className:"py-1",highlightCode:!0,code:s}):s===null?e.jsx("div",{children:"null"}):c(s)&&f(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)})})},n))}),Object.entries(j).map(([n,s])=>e.jsx(S,{title:n,value:s},n)),Object.entries(x).map(([n,s])=>e.jsx(w,{intent:"secondary",title:n,data:s},n))]}),t]})}function S({title:r,value:a}){const l=a.filter(i=>!d(i)&&!m(i)||i===null),o=a.filter(i=>d(i)||m);return e.jsx(e.Fragment,{children:e.jsxs(O,{intent:"secondary",title:r,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(([i,t])=>e.jsx(C,{label:e.jsx(g,{children:e.jsxs(N,{children:[e.jsx(y,{className:"cursor-default truncate",children:i}),e.jsx(b,{className:"max-w-[480px]",children:i})]})}),value:e.jsx("div",{className:"py-1",children:t===null?e.jsx("div",{children:"null"}):c(t)&&f(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)})})},i))}),o.length>0&&e.jsx("ul",{className:"space-y-4",children:o.map((i,t)=>e.jsx("li",{children:e.jsx(w,{intent:"secondary",title:t,data:i},t)},t))})]},r)})}export{C as K,w as N,K as V,F as a,c as b,H as c,m as i};
