1import{a as T,b as w,T as I,c as B,d as M}from"./CrzlI0Vo.js";import{S as q,T as L,V as z,W as G,s as U,M as $,q as y,bV as j,o as n,h as d,j as f,b as m,f as a,n as i,c as h,r as V,a as D,t as F,F as x,aH as N,aa as P,m as A,p as S,ab as _}from"./CxesHY2y.js";import E from"./DUbjfpmR.js";import"./DNQ_KE87.js";const H={slots:{root:"relative group *:not-first:!my-0 *:not-first:!static my-5",list:"relative flex items-center gap-1 border border-muted bg-default border-b-0 rounded-t-md overflow-x-auto p-2",indicator:"absolute left-0 inset-y-2 w-(--reka-tabs-indicator-size) translate-x-(--reka-tabs-indicator-position) transition-[translate,width] duration-200 bg-elevated rounded-md shadow-xs",trigger:["relative inline-flex items-center gap-1.5 text-default data-[state=active]:text-highlighted hover:bg-elevated/50 px-2 py-1.5 text-sm rounded-md disabled:cursor-not-allowed disabled:opacity-75 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-primary focus:outline-none","transition-colors"],triggerIcon:"size-4 shrink-0",triggerLabel:"truncate"}},J={__name:"ProseCodeGroup",props:P({defaultValue:{type:String,required:!1,default:"0"},sync:{type:String,required:!1},class:{type:null,required:!1},ui:{type:Object,required:!1}},{modelValue:{type:String},modelModifiers:{}}),emits:["update:modelValue"],setup(p){const c=p,C=q(),s=L(p,"modelValue"),k=z(),r=G("prose.codeGroup",c),o=S(()=>_({extend:_(H),...k.ui?.prose?.codeGroup||{}})()),g=A(1),v=S(()=>(g.value,C.default?.()?.flatMap(b).filter(Boolean)||[]));function b(e,t){return typeof e.type=="symbol"?e.children?.map(b):{label:e.props?.filename||e.props?.label||`${t}`,icon:e.props?.icon,component:e}}return U(()=>{if(c.sync){const e=`code-group-${c.sync}`,t=$(e,()=>localStorage.getItem(e));y(t,()=>{t.value&&(s.value=t.value)},{immediate:!0}),y(s,()=>{s.value&&(t.value=s.value,localStorage.setItem(e,s.value))})}}),j(()=>g.value++),(e,t)=>(n(),d(a(M),{modelValue:s.value,"onUpdate:modelValue":t[0]||(t[0]=l=>s.value=l),"default-value":p.defaultValue,"unmount-on-hide":!1,class:i(o.value.root({class:[a(r)?.root,c.class]}))},{default:f(()=>[m(a(I),{class:i(o.value.list({class:a(r)?.list}))},{default:f(()=>[m(a(T),{class:i(o.value.indicator({class:a(r)?.indicator}))},null,8,["class"]),(n(!0),h(x,null,V(v.value,(l,u)=>(n(),d(a(w),{key:u,value:String(u),class:i(o.value.trigger({class:a(r)?.trigger}))},{default:f(()=>[m(E,{icon:l.icon,filename:l.label,class:i(o.value.triggerIcon({class:a(r)?.triggerIcon}))},null,8,["icon","filename","class"]),D("span",{class:i(o.value.triggerLabel({class:a(r)?.triggerLabel}))},F(l.label),3)]),_:2},1032,["value","class"]))),128))]),_:1},8,["class"]),(n(!0),h(x,null,V(v.value,(l,u)=>(n(),d(a(B),{key:u,value:String(u),"as-child":""},{default:f(()=>[(n(),d(N(l.component),{"hide-header":"",tabindex:"-1"}))]),_:2},1032,["value"]))),128))]),_:1},8,["modelValue","default-value","class"]))}};export{J as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.