import{j as e}from"./@radix-DGuLZ9Nd.js";import{B as b,l as _,Y as w,Z as C,_ as O,a0 as S,aE as o,aF as J,bj as m,aD as x,c as T}from"./index-DHfBZI1k.js";import{a as p}from"./@monaco-editor-CuNQBT0l.js";import{S as K}from"./eye-off-DGkKmlMW.js";import{S as z}from"./eye-CuzpINsY.js";import{c as V}from"./CollapsibleCard-Bpe4J0WI.js";import{C as H}from"./CodeSnippet-DWvTxFp3.js";function M(){return e.jsx("div",{className:"text-theme-text-tertiary",children:"Not available"})}const N="fill-neutral-500 shrink-0",P=10;function q({value:s}){const[n,i]=p.useState(!1);return e.jsxs("div",{className:"flex min-w-0 items-center gap-0.5 whitespace-normal",children:[e.jsx(b,{intent:"secondary",emphasis:"minimal",onClick:()=>i(l=>!l),className:"flex aspect-square size-6 items-center justify-center",children:n?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"sr-only",children:"Hide value"}),e.jsx(K,{width:24,height:24,className:N})]}):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"sr-only",children:"Show value"}),e.jsx(z,{width:24,height:24,className:N})]})}),n?e.jsx(v,{value:s}):e.jsx("p",{className:"min-w-0",children:"•".repeat(Math.min(s.length,P))})]})}function v({value:s}){const{copied:n,copyToClipboard:i}=_(),l=p.useRef(null);return e.jsx(w,{children:e.jsxs(C,{delayDuration:200,children:[e.jsx(O,{onClick:t=>{t.preventDefault(),i(s)},asChild:!0,children:e.jsx(b,{intent:"secondary",className:"block min-w-0 max-w-full truncate text-text-md font-medium",emphasis:"minimal",ref:l,children:s})}),e.jsx(S,{onPointerDownOutside:t=>{t.currentTarget===l.current&&t.preventDefault()},className:"z-50 rounded-md bg-theme-text-primary px-3 py-2 text-text-xs text-theme-text-negative shadow-lg",sideOffset:5,children:n?"Copied!":"Copy to Clipboard"})]})})}const G=/^<class\s+'.*'>$/;function D({title:s,schema:n,data:i,intent:l="primary",contentClassName:t,className:c,children:F,isInitialOpen:R=!1,sortKeysAlphabetically:k=!0,headerChildren:A}){const h={},u={},j={};for(const[r,a]of Object.entries(i||{}))x(a)?h[r]=a:m(a)?j[r]=a:u[r]=a;const f=Object.entries(u);k&&f.sort((r,a)=>r[0].localeCompare(a[0]));const g=Object.keys(i||{}).length===0;return e.jsxs(V,{headerChildren:A,contentClassName:t,initialOpen:R,intent:l,title:s,className:c,copyText:JSON.stringify(i),displayCopyButton:!g,children:[g?e.jsx(M,{}):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:f.map(([r,a])=>{const d=n?.properties?.[r],y=d?.title||r,B=d?.sensitive||d?.format==="password"||!1;return e.jsxs(p.Fragment,{children:[e.jsx("dt",{className:"col-span-1 flex items-start text-theme-text-secondary",children:e.jsx(w,{children:e.jsxs(C,{children:[e.jsx(O,{className:"cursor-default truncate",children:y}),e.jsx(S,{className:"max-w-[480px]",children:y})]})})}),e.jsx("dd",{className:"col-span-2 w-full truncate text-neutral-700",children:B&&o(a)?e.jsx(q,{value:a}):e.jsx(E,{value:a})})]},r)})}),Object.entries(j).map(([r,a])=>e.jsx(L,{title:r,value:a},r)),Object.entries(h).map(([r,a])=>e.jsx(D,{intent:"secondary",title:r,data:a},r))]}),F]})}function E({value:s}){return o(s)&&G.test(s)?e.jsx(H,{highlightCode:!0,code:s}):s===null?e.jsx("div",{children:"null"}):o(s)&&J(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:o(s)?s:JSON.stringify(s)})}function L({title:s,value:n}){const i=n.filter(t=>!m(t)&&!x(t)||t===null),l=n.filter(t=>m(t)||x(t));return e.jsx(e.Fragment,{children:e.jsxs(V,{copyText:JSON.stringify(n),intent:"secondary",title:s,children:[i.length>0&&e.jsx("ul",{className:"space-y-2 md:space-y-4",children:i.map((t,c)=>e.jsx("li",{children:e.jsx(E,{value:t})},c))}),l.length>0&&e.jsx("ul",{className:"space-y-4",children:l.map((t,c)=>e.jsx("li",{children:e.jsx(D,{intent:"secondary",title:c,data:t},c)},c))})]},s)})}function U({children:s,className:n,...i}){return e.jsx("dt",{...i,className:T("col-span-1 flex min-w-0 items-center truncate text-theme-text-secondary",n),children:s})}function W({children:s,className:n,...i}){return e.jsx("dd",{...i,className:T("col-span-2 flex h-6 w-full min-w-0 items-center truncate text-neutral-700",n),children:s})}function se({label:s,value:n}){return e.jsxs(e.Fragment,{children:[e.jsx(U,{children:s}),e.jsx(W,{children:n})]})}export{se as K,D as N,W as V,M as a,U as b};
