import{Q as d,R as f,f as g,g as m,o as v,c as x,r as C,a as b,b as y,i as e,n,S as h,T,k as _,l as c}from"./B96cjQS3.js";const q={slots:{root:"relative [&_pre]:h-[200px]",footer:"h-16 absolute inset-x-px bottom-px rounded-b-md flex items-center justify-center",trigger:"group",triggerIcon:"group-data-[state=open]:rotate-180"},variants:{open:{true:{root:"[&_pre]:h-auto [&_pre]:min-h-[200px] [&_pre]:max-h-[80vh] [&_pre]:pb-12"},false:{root:"[&_pre]:overflow-hidden",footer:"bg-gradient-to-t from-muted"}}}},S={__name:"ProseCodeCollapse",props:T({icon:{type:null,required:!1},name:{type:String,required:!1},openText:{type:String,required:!1},closeText:{type:String,required:!1},class:{type:null,required:!1},ui:{type:Object,required:!1}},{open:{type:Boolean,default:!1},openModifiers:{}}),emits:["update:open"],setup(r){const o=r,t=d(r,"open",{type:Boolean,default:!1}),{t:l}=f(),p=g(),s=m("prose.codeCollapse",o),a=_(()=>c({extend:c(q),...p.ui?.prose?.codeCollapse||{}})({open:t.value}));return(u,i)=>(v(),x("div",{class:n(a.value.root({class:[e(s)?.root,o.class]}))},[C(u.$slots,"default"),b("div",{class:n(a.value.footer({class:e(s)?.footer}))},[y(h,{icon:r.icon||e(p).ui.icons.chevronDown,color:"neutral",variant:"outline","data-state":t.value?"open":"closed",label:`${t.value?o.closeText||e(l)("prose.codeCollapse.closeText"):o.openText||e(l)("prose.codeCollapse.openText")} ${o.name||e(l)("prose.codeCollapse.name")}`,class:n(a.value.trigger({class:e(s)?.trigger})),ui:{leadingIcon:a.value.triggerIcon({class:e(s)?.triggerIcon})},onClick:i[0]||(i[0]=B=>t.value=!t.value)},null,8,["icon","data-state","label","class","ui"])],2)],2))}};export{S as default};
