import{Q as B,a0 as q,a1 as v,a2 as $,a3 as P,o as d,a as f,p as n,s as e,aZ as T,q as m,f as O,B as x,a_ as S,ac as l,m as k,a$ as w,c as C,am as p,$ as I,ay as L,af as _,ab as N,ag as y}from"./B3fabVUf.js";const U={slots:{root:"",content:"data-[state=open]:animate-[collapsible-down_200ms_ease-out] data-[state=closed]:animate-[collapsible-up_200ms_ease-out] overflow-hidden"}},V={__name:"UCollapsible",props:{as:{type:null,required:!1},class:{type:null,required:!1},ui:{type:Object,required:!1},defaultOpen:{type:Boolean,required:!1},open:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},unmountOnHide:{type:Boolean,required:!1,default:!0}},emits:["update:open"],setup(r,{emit:s}){const a=r,i=s,t=B(),o=q(),c=v("collapsible",a),g=$(P(a,"as","defaultOpen","open","disabled","unmountOnHide"),i),u=C(()=>p({extend:p(U),...o.ui?.collapsible||{}})());return(b,z)=>(d(),f(e(w),k(e(g),{"data-slot":"root",class:u.value.root({class:[e(c)?.root,a.class]})}),{default:n(({open:h})=>[t.default?(d(),f(e(T),{key:0,"as-child":""},{default:n(()=>[m(b.$slots,"default",{open:h})]),_:2},1024)):O("",!0),x(e(S),{"data-slot":"content",class:l(u.value.content({class:e(c)?.content}))},{default:n(()=>[m(b.$slots,"content")]),_:3},8,["class"])]),_:3},16,["class"]))}},j={slots:{root:"my-5",trigger:["group relative rounded-xs inline-flex items-center gap-1.5 text-muted hover:text-default text-sm focus-visible:ring-2 focus-visible:ring-primary focus:outline-none","transition-colors"],triggerIcon:"size-4 shrink-0 group-data-[state=open]:rotate-180 transition-transform duration-200",triggerLabel:"truncate",content:"*:first:mt-2.5 *:last:mb-0 *:my-1.5"}},H={__name:"ProseCollapsible",props:{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}},setup(r){const s=r,{t:a}=I(),i=q(),t=v("prose.collapsible",s),o=C(()=>p({extend:p(j),...i.ui?.prose?.collapsible||{}})());return(c,g)=>(d(),f(V,{"unmount-on-hide":!1,class:l(s.class),ui:e(L)(o.value,e(t))},{default:n(({open:u})=>[_("button",{class:l(o.value.trigger({class:e(t)?.trigger}))},[x(N,{name:r.icon||e(i).ui.icons.chevronDown,class:l(o.value.triggerIcon({class:e(t)?.triggerIcon}))},null,8,["name","class"]),_("span",{class:l(o.value.triggerLabel({class:e(t)?.triggerLabel}))},y(u?s.closeText||e(a)("prose.collapsible.closeText"):s.openText||e(a)("prose.collapsible.openText"))+" "+y(s.name||e(a)("prose.collapsible.name")),3)],2)]),content:n(()=>[m(c.$slots,"default")]),_:3},8,["class","ui"]))}};export{H as default};
