import{n as B,p as x,q as N,r as O,o as i,d as q,b as D,w as C,s as a,v as g,x as f,l as e,c as b,y as w,z as h,a as p,A as d,B as R,e as A,t as M,P as V,F as P,m as T,C as y,D as U,E}from"./BAy_whwk.js";import{u as j,_ as F,a as I,b as K}from"./DYfrkrYL.js";const G={slots:{root:"h-(--ui-header-height) shrink-0 flex items-center justify-between border-b border-default px-4 sm:px-6 gap-1.5",left:"flex items-center gap-1.5 min-w-0",icon:"shrink-0 size-5 self-center me-1.5",title:"flex items-center gap-1.5 font-semibold text-highlighted truncate",center:"hidden lg:flex",right:"flex items-center shrink-0 gap-1.5",toggle:""},variants:{toggleSide:{left:{toggle:""},right:{toggle:""}}}},X=Object.assign({inheritAttrs:!1},{__name:"UDashboardNavbar",props:{as:{type:null,required:!1},icon:{type:null,required:!1},title:{type:String,required:!1},toggle:{type:[Boolean,Object],required:!1,default:!0},toggleSide:{type:String,required:!1,default:"left"},class:{type:null,required:!1},ui:{type:Object,required:!1}},setup(t){const n=t,v=B(),m=x(),l=N("dashboardNavbar",n),r=j({}),[$,u]=O(),s=T(()=>y({extend:y(G),...m.ui?.dashboardNavbar||{}})());return(o,k)=>(i(),q(P,null,[D(e($),null,{default:C(()=>[a(o.$slots,"toggle",g(f({...e(r),ui:s.value})),()=>[t.toggle?(i(),b(F,w({key:0},typeof t.toggle=="object"?t.toggle:{},{side:t.toggleSide,"data-slot":"toggle",class:s.value.toggle({class:e(l)?.toggle,toggleSide:t.toggleSide})}),null,16,["side","class"])):h("",!0)])]),_:3}),D(e(V),w({as:t.as},o.$attrs,{"data-slot":"root",class:s.value.root({class:[e(l)?.root,n.class]})}),{default:C(()=>[p("div",{"data-slot":"left",class:d(s.value.left({class:e(l)?.left}))},[t.toggleSide==="left"?(i(),b(e(u),{key:0})):h("",!0),a(o.$slots,"left",g(f(e(r))),()=>[a(o.$slots,"leading",g(f({...e(r),ui:s.value})),()=>[t.icon?(i(),b(R,{key:0,name:t.icon,"data-slot":"icon",class:d(s.value.icon({class:e(l)?.icon}))},null,8,["name","class"])):h("",!0)]),p("h1",{"data-slot":"title",class:d(s.value.title({class:e(l)?.title}))},[a(o.$slots,"title",{},()=>[A(M(t.title),1)])],2),a(o.$slots,"trailing",g(f({...e(r),ui:s.value})))])],2),v.default?(i(),q("div",{key:0,"data-slot":"center",class:d(s.value.center({class:e(l)?.center}))},[a(o.$slots,"default",g(f(e(r))))],2)):h("",!0),p("div",{"data-slot":"right",class:d(s.value.right({class:e(l)?.right}))},[a(o.$slots,"right",g(f(e(r)))),t.toggleSide==="right"?(i(),b(e(u),{key:0})):h("",!0)],2)]),_:3},16,["as","class"])],64))}}),H={slots:{root:"relative flex flex-col min-w-0 min-h-svh lg:not-last:border-e lg:not-last:border-default shrink-0",body:"flex flex-col gap-4 sm:gap-6 flex-1 overflow-y-auto p-4 sm:p-6",handle:""},variants:{size:{true:{root:"w-full lg:w-(--width)"},false:{root:"flex-1"}}}},J=["data-dragging"],Y=Object.assign({inheritAttrs:!1},{__name:"UDashboardPanel",props:{class:{type:null,required:!1},ui:{type:Object,required:!1},id:{type:String,required:!1},minSize:{type:Number,required:!1,default:15},maxSize:{type:Number,required:!1},defaultSize:{type:Number,required:!1},resizable:{type:Boolean,required:!1,default:!1}},setup(t){const n=t,v=x(),m=N("dashboardPanel",n),l=j({storageKey:"dashboard",unit:"%"}),r=`${l.storageKey}-panel-${n.id||U()}`,{el:$,size:u,isDragging:s,onMouseDown:o,onTouchStart:k,onDoubleClick:z}=I(r,E(()=>({...l,...n}))),S=T(()=>y({extend:y(H),...v.ui?.dashboardPanel||{}})({size:!!u.value}));return(c,L)=>(i(),q(P,null,[p("div",w({id:r,ref_key:"el",ref:$},c.$attrs,{"data-dragging":e(s),"data-slot":"root",class:S.value.root({class:[e(m)?.root,n.class]}),style:[e(u)?{"--width":`${e(u)}${e(l).unit}`}:void 0]}),[a(c.$slots,"default",{},()=>[a(c.$slots,"header"),p("div",{"data-slot":"body",class:d(S.value.body({class:e(m)?.body}))},[a(c.$slots,"body")],2),a(c.$slots,"footer")])],16,J),a(c.$slots,"resize-handle",{onMouseDown:e(o),onTouchStart:e(k),onDoubleClick:e(z)},()=>[t.resizable?(i(),b(K,{key:0,"aria-controls":r,"data-slot":"handle",class:d(S.value.handle({class:e(m)?.handle})),onMousedown:e(o),onTouchstart:e(k),onDblclick:e(z)},null,8,["class","onMousedown","onTouchstart","onDblclick"])):h("",!0)])],64))}});export{X as _,Y as a};
