import{r as e}from"./rolldown-runtime-C_s2cVnS.js";import{in as t,kn as n,kt as r}from"./profile-DkxWhVLn.js";import{Mt as i,zt as a}from"./store-CZ73mANc.js";import{A as o,S as s,_ as c,g as l}from"./session-states-CS762cjB.js";import{t as u,x as d}from"./routes-DSsMo3DY.js";var f=e({mainChatOccupied:()=>p,openSession:()=>h,openSessionIntentFromModifiers:()=>m});function p(e,t){return!!(e||t)}function m(e,t=`in-place`){if(!e)return t;let n=!!(e.metaKey||e.ctrlKey);return n&&e.shiftKey?`window`:n?`tab`:t}function h(e,f,m=`in-place`){if(!e)return;n(e);let h=m;if(h===`window`){if(i()){a(e);return}h=`tab`}if(h===`main`){f(d(e));return}let g=!1;if(h===`stack`&&(g=p(r.get(),t.get()),h=g?`tab`:`in-place`),h===`tab`){if(l(e)||g&&o(e))return;s(e,`center`);return}c(l(e),u.get())&&f(d(e))}export{f as i,h as n,m as r,p as t};