import{B as e,Bt as t,Ct as n,F as r,G as i,L as a,N as o,Nt as s,Pt as c,U as l,Vt as u,W as d,X as f,Y as p,_t as m,a as h,at as g,bt as _,d as v,ft as y,g as b,ht as x,it as S,o as C,ot as w,u as T,vt as E,x as D,z as O}from"./xY0c-UfG.js";import"./xihTtKlq.js";import{J as k}from"./3mkRcVr2.js";import"./9K8VREGP.js";var A=O(`<div></div>`);function j(e,t){c(t,!0);let n=_(!1),r=0,o=null,l=_(null);function u(e){e.button===0&&(e.preventDefault(),E(n,!0),r=e.clientX,o=e.pointerId,f(l)?.setPointerCapture(e.pointerId),document.body.style.cursor=`col-resize`,document.body.style.userSelect=`none`,t.onresizestart?.())}function p(e){if(!f(n))return;if(e.buttons===0){m();return}let i=t.side===`right`?e.clientX-r:r-e.clientX;r=e.clientX,t.onresize(i)}function m(){if(f(n)&&(E(n,!1),document.body.style.cursor=``,document.body.style.userSelect=``,o!==null)){try{f(l)?.releasePointerCapture(o)}catch{}o=null}}var h=A();let g;v(h,e=>E(l,e),()=>f(l)),w(()=>g=D(h,1,`resize-handle svelte-tfh9g9`,null,g,{left:t.side===`left`,right:t.side===`right`,active:f(n)})),d(`pointerdown`,h,u),d(`pointermove`,h,p),d(`pointerup`,h,m),i(`pointercancel`,h,m),i(`lostpointercapture`,h,m),d(`dblclick`,h,function(...e){t.ondblclick?.apply(this,e)}),a(e,h),s()}l([`pointerdown`,`pointermove`,`pointerup`,`dblclick`]);function M(e,t,n,r=null){let i=Math.min(440,Math.max(280,Number.isFinite(e)?e:280)),a=Math.min(480,Math.max(340,Number.isFinite(t)?t:340));if(!Number.isFinite(n)||n<=0||i+a<=n)return{sidebar:i,rail:a};if(n<=620)return{sidebar:280,rail:340};if(r===`sidebar`){let e=Math.min(i,n-340);return{sidebar:e,rail:n-e}}if(r===`rail`){let e=Math.min(a,n-280);return{rail:e,sidebar:n-e}}let o=i+a-n,s=i-280,c=s+(a-340);if(c<=0)return{sidebar:280,rail:340};let l=i-o*s/c;return{sidebar:l,rail:n-l}}var N=`sg-sidebar-width`,P=`sg-agent-rail-width`;function F(e,t,n){if(typeof localStorage>`u`)return t;let r=Number(localStorage.getItem(e));return Number.isFinite(r)&&r>0?Math.min(n,Math.max(t,r)):t}function I(e,t){if(!(typeof localStorage>`u`))try{localStorage.setItem(e,String(t))}catch{}}function L(){let e=_(x(F(N,280,440))),t=_(x(F(P,340,480))),r=_(x(1/0)),i=_(null),a=0,o=0,s=n(()=>M(f(e),f(t),f(r),f(i))),c=()=>Number.isFinite(f(r))&&f(r)>0?Math.min(440,Math.max(280,f(r)-340)):440,l=()=>Number.isFinite(f(r))&&f(r)>0?Math.min(480,Math.max(340,f(r)-280)):480;return{get sidebarWidth(){return f(s).sidebar},get railWidth(){return f(s).rail},setAvailable(e){Number.isFinite(e)&&e>0&&E(r,e,!0)},startSidebarResize(){a=f(s).sidebar,E(e,a,!0),E(i,`sidebar`)},resizeSidebar(t){a+=t,E(e,Math.min(c(),Math.max(280,a)),!0),I(N,f(e))},startRailResize(){o=f(s).rail,E(t,o,!0),E(i,`rail`)},resizeRail(e){o+=e,E(t,Math.min(l(),Math.max(340,o)),!0),I(P,f(t))}}}var R=L();async function z(e){return k(`/api/notifications${e?.unreadOnly?`?unreadOnly=true`:``}`)}async function B(e){await k(`/api/notifications/${e}/read`,{method:`POST`})}async function V(){await k(`/api/notifications/read-all`,{method:`POST`})}async function H(){let{users:e}=await k(`/api/auth/users`);return e}var U=e(`<title> </title>`),W=e(`<svg><!><path d="M24,6H8A2,2,0,0,0,6,8V24a2,2,0,0,0,2,2H24a2,2,0,0,0,2-2V8a2,2,0,0,0-2-2Z"></path></svg>`);function G(e,n){let i=h(n,[`children`,`$$slots`,`$$events`,`$$legacy`]),l=h(i,[`size`,`title`]);c(n,!1);let d=m(),_=m(),v=C(n,`size`,8,16),x=C(n,`title`,8,void 0);S(()=>(p(i),p(x())),()=>{E(d,i[`aria-label`]||i[`aria-labelledby`]||x())}),S(()=>(f(d),p(i)),()=>{E(_,{"aria-hidden":f(d)?void 0:!0,role:f(d)?`img`:void 0,focusable:Number(i.tabindex)===0?!0:void 0})}),g(),T();var D=W();b(D,()=>({xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 32`,fill:`currentColor`,preserveAspectRatio:`xMidYMid meet`,width:v(),height:v(),...f(_),...l}));var O=y(D),k=e=>{var t=U(),n=y(t,!0);u(t),w(()=>r(n,x())),a(e,t)};o(O,e=>{x()&&e(k)}),t(),u(D),a(e,D),s()}export{B as a,V as i,H as n,R as o,z as r,j as s,G as t};