import{B as e,C as t,H as n,L as r,T as i,_ as a,b as o,h as s,k as c,t as l,v as u,w as d,x as f}from"./_plugin-vue_export-helper-Cut4Z2wH.js";var p={class:`json-panel`},m={class:`toggle-arrow`},h={class:`json-title`},g=[`title`],_={key:0,class:`json-body`},v=d({name:`JsonNode`,props:{value:{type:null,required:!0},depth:{type:Number,default:0},keyName:{type:String,default:``}},setup(e){let t=r(e.depth>2);return()=>{let n=e.value,r=e.depth*16;if(n==null)return i(`div`,{class:`json-line`,style:{paddingLeft:`${r}px`}},[e.keyName?i(`span`,{class:`json-key`},`${e.keyName}: `):null,i(`span`,{class:`json-null`},`null`)]);if(typeof n==`boolean`)return i(`div`,{class:`json-line`,style:{paddingLeft:`${r}px`}},[e.keyName?i(`span`,{class:`json-key`},`${e.keyName}: `):null,i(`span`,{class:`json-bool`},String(n))]);if(typeof n==`number`)return i(`div`,{class:`json-line`,style:{paddingLeft:`${r}px`}},[e.keyName?i(`span`,{class:`json-key`},`${e.keyName}: `):null,i(`span`,{class:`json-number`},String(n))]);if(typeof n==`string`)return i(`div`,{class:`json-line`,style:{paddingLeft:`${r}px`}},[e.keyName?i(`span`,{class:`json-key`},`${e.keyName}: `):null,i(`span`,{class:`json-string`},`"${n}"`)]);if(Array.isArray(n))return n.length===0?i(`div`,{class:`json-line`,style:{paddingLeft:`${r}px`}},[e.keyName?i(`span`,{class:`json-key`},`${e.keyName}: `):null,i(`span`,{class:`json-bracket`},`[]`)]):i(`div`,{style:{paddingLeft:`${r}px`}},[i(`div`,{class:`json-line json-toggle`,onClick:e=>{e.stopPropagation(),t.value=!t.value}},[i(`span`,{class:`toggle-icon`},t.value?`▶`:`▼`),e.keyName?i(`span`,{class:`json-key`},`${e.keyName}: `):null,i(`span`,{class:`json-bracket`},t.value?`[ ... ${n.length} items ]`:`[`)]),...t.value?[]:[...n.map((t,n)=>i(v,{value:t,depth:e.depth+1,keyName:String(n),key:n})),i(`div`,{class:`json-line`,style:{paddingLeft:`${r}px`}},[i(`span`,{class:`json-bracket`},`]`)])]]);if(typeof n==`object`){let a=Object.keys(n);return a.length===0?i(`div`,{class:`json-line`,style:{paddingLeft:`${r}px`}},[e.keyName?i(`span`,{class:`json-key`},`${e.keyName}: `):null,i(`span`,{class:`json-bracket`},`{}`)]):i(`div`,{style:{paddingLeft:`${r}px`}},[i(`div`,{class:`json-line json-toggle`,onClick:e=>{e.stopPropagation(),t.value=!t.value}},[i(`span`,{class:`toggle-icon`},t.value?`▶`:`▼`),e.keyName?i(`span`,{class:`json-key`},`${e.keyName}: `):null,i(`span`,{class:`json-bracket`},t.value?`{ ... ${a.length} keys }`:`{`)]),...t.value?[]:[...a.map(t=>i(v,{value:n[t],depth:e.depth+1,keyName:t,key:t})),i(`div`,{class:`json-line`,style:{paddingLeft:`${r}px`}},[i(`span`,{class:`json-bracket`},`}`)])]])}return i(`div`,{class:`json-line`,style:{paddingLeft:`${r}px`}},[i(`span`,{class:`json-string`},String(n))])}}}),y=l(d({__name:`JsonPanel`,props:{data:{},title:{},collapsed:{type:Boolean}},setup(i){let l=i,d=r(l.collapsed??!0),y=r(!1),b=a(()=>JSON.stringify(l.data,null,2));function x(){d.value=!d.value}async function S(){try{await navigator.clipboard.writeText(b.value),y.value=!0,setTimeout(()=>{y.value=!1},1500)}catch{}}return(r,a)=>(c(),f(`div`,p,[u(`div`,{class:`json-header`,onClick:x},[u(`span`,m,n(d.value?`▶`:`▼`),1),u(`span`,h,n(i.title||`Raw JSON`),1),u(`button`,{class:`copy-btn`,onClick:s(S,[`stop`]),title:y.value?`Copied!`:`Copy JSON`},n(y.value?`Copied`:`Copy`),9,g)]),d.value?o(``,!0):(c(),f(`div`,_,[t(e(v),{value:i.data,depth:0},null,8,[`value`])]))]))}}),[[`__scopeId`,`data-v-42a2ad07`]]);export{y as t};