import{Kt as e,X as t,bt as n,ht as r,vt as i}from"./xY0c-UfG.js";import"./Cyv4P2rC.js";var a=`chat`;function o(e,t){return e===null?t:e===`1`}function s(e,t){return t!==e}function c(){return[`agent`,`comments`,`metadata`,`history`,`connections`]}var l=e({rail:()=>m}),u=`sg-rail-collapsed`;function d(){if(typeof localStorage>`u`)return!1;let e=typeof window<`u`&&window.matchMedia(`(max-width: 767.98px), (hover: none) and (pointer: coarse) and (max-height: 500px)`).matches;return o(localStorage.getItem(u),e)}function f(e){if(!(typeof localStorage>`u`))try{localStorage.setItem(u,e?`1`:`0`)}catch{}}function p(){let e=n(r(d())),o=n(r(a));function c(e,t){if(!(typeof window>`u`))try{window.dispatchEvent(new CustomEvent(e,{detail:t}))}catch{}}function l(e,n){if(!s(t(o),e))return;let r=t(o);i(o,e,!0),c(`rail.view_changed`,{from:r,to:e,trigger:n})}return{get collapsed(){return t(e)},get internalView(){return t(o)},toggle(){i(e,!t(e)),f(t(e))},show(){t(e)&&(i(e,!1),f(!1))},hide(){t(e)||(i(e,!0),f(!0))},setView:l}}var m=p();export{l as n,c as r,m as t};