import{d as w,y as g,E as B,H as C,u as e,c as p,o as n,r as l,j as m,a as d,t as I,k as x,F as L,I as N,b as k,w as z}from"./index-CDPBytck.js";import{p as D,g as F,w as E,x as X,s as j,T as R}from"./ReferenceContentLoader-34zh6S1n.js";import{E as V}from"./ScalarHotkey.vue-DjARVWea.js";const W={key:0,class:"xl:min-h-header flex min-h-12 items-center justify-between px-3 py-1.5 text-sm md:px-[18px] md:py-2.5"},q={class:"m-0 text-sm font-medium whitespace-nowrap"},H={class:"bg-b-1 relative sticky bottom-0 z-10 w-[inherit] pt-0 has-[.empty-sidebar-item]:border-t md:px-2.5 md:pb-2.5"},M=w({__name:"Sidebar",props:{title:{}},setup(b){const{isSidebarOpen:u}=D(),{sidebarWidth:s,setSidebarWidth:r}=F(),{layout:o}=E(),i=g(!1),v=g(null),{breakpoints:c}=X(),S=t=>{t.preventDefault();const f=t.clientX,_=Number.parseInt(getComputedStyle(v.value).width||s.value,10),h=$=>{i.value=!0,document.body.classList.add("dragging");let a=_+$.clientX-f;a>420&&(a=420+(a-420)*.2),a<240&&(a=240),r(`${a}px`)},y=()=>{i.value=!1,document.body.classList.remove("dragging"),document.documentElement.removeEventListener("mousemove",h,!1),document.documentElement.removeEventListener("mouseup",y,!1),Number.parseInt(s.value,10)>420?r("360px"):Number.parseInt(s.value,10)<240&&r("240px")};document.documentElement.addEventListener("mousemove",h,!1),document.documentElement.addEventListener("mouseup",y,!1)};return(t,f)=>B((n(),p("aside",{ref_key:"sidebarRef",ref:v,class:x(["sidebar bg-b-1 relative flex min-w-full flex-1 flex-col overflow-hidden leading-3 md:min-w-fit md:flex-none md:border-r md:border-b-0",{dragging:i.value}]),style:N({width:e(c).lg?e(s):"100%"})},[l(t.$slots,"header",{},void 0,!0),e(o)!=="modal"&&t.title?(n(),p("div",W,[d("h2",q,I(t.title),1),e(c).lg?m("",!0):l(t.$slots,"button",{key:0},void 0,!0)])):m("",!0),d("div",{class:x(["custom-scroll sidebar-height w-[inherit] pb-0 md:pb-[37px]",{"sidebar-mask":e(o)!=="modal"}])},[l(t.$slots,"content",{},void 0,!0)],2),e(c).lg?(n(),p(L,{key:1},[d("div",H,[l(t.$slots,"button",{},void 0,!0)]),d("div",{class:"resizer",onMousedown:S},null,32)],64)):m("",!0)],6)),[[C,e(u)]])}}),G=j(M,[["__scopeId","data-v-72824faa"]]),J=w({__name:"SidebarButton",props:{click:{type:Function},hotkey:{}},setup(b){const u=b,{layout:s}=E(),r=()=>{u.click()};return(o,i)=>(n(),k(e(R),{class:"bg-b-1 text-c-1 hover:bg-b-2 group relative h-auto w-auto border px-2 py-1 md:w-full md:p-1.5",variant:"outlined",onClick:r},{default:z(()=>[l(o.$slots,"title"),o.hotkey&&e(s)==="desktop"?(n(),k(e(V),{key:0,class:"text-c-2 add-item-hotkey absolute right-2 hidden group-hover:opacity-80 md:flex",hotkey:o.hotkey},null,8,["hotkey"])):m("",!0)]),_:3}))}});export{J as g,G as m};
