const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/renderMobileApp-DHWdI195.js","assets/vendor-.bun-BE757pvp.js","assets/index-BklNmnVr.js","assets/index-C3uMIExE.css","assets/useAppFontEffects-9LFMCKYW.js","assets/runtimeEndpointReset-B0P2DED1.js","assets/mobileLayoutPreference-Dio-WWkI.js","assets/main-B0CxEOP5.js","assets/SessionSwitcherDropdown-DHO5Je6v.js","assets/main-BV3KOtdA.css"])))=>i.map(i=>d[i]);
import{c as w,g as _}from"./index-BklNmnVr.js";import{_ as a}from"./vendor-.bun-BE757pvp.js";import{g as h}from"./mobileLayoutPreference-Dio-WWkI.js";function g(t={}){const{immediate:r=!1,onNeedRefresh:o,onOfflineReady:n,onRegistered:s,onRegisteredSW:c,onRegisterError:d}=t;let i,u;const f=async(e=!0)=>{await u};async function m(){if("serviceWorker"in navigator){if(i=await a(async()=>{const{Workbox:e}=await import("./vendor-.bun-BE757pvp.js").then(p=>p.cp);return{Workbox:e}},[]).then(({Workbox:e})=>new e("/sw.js",{scope:"/",type:"classic"})).catch(e=>{d?.(e)}),!i)return;i.addEventListener("activated",e=>{(e.isUpdate||e.isExternal)&&window.location.reload()}),i.addEventListener("installed",e=>{e.isUpdate||n?.()}),i.register({immediate:r}).then(e=>{c?c("/sw.js",e):s?.(e)}).catch(e=>{d?.(e)})}}return u=m(),f}window.__OPENCHAMBER_RUNTIME_APIS__=w();const v=()=>typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia("(pointer: coarse)").matches,S=()=>{const r=new URLSearchParams(window.location.search).get("surface");if(r==="mobile")return"mobile";if(r==="desktop")return"desktop";const o=Math.min(window.innerWidth||0,window.screen?.width||window.innerWidth||0),n=navigator.maxTouchPoints||0;return o>0&&o<=760&&(n>0||v())&&h()==="new"?"mobile":"desktop"},l=S();window.__OPENCHAMBER_SURFACE__=l;const E=()=>!(!("serviceWorker"in navigator)||!window.isSecureContext||window.location.protocol!=="http:"&&window.location.protocol!=="https:"||document.prerendering||String(document.visibilityState)==="prerender"),P=t=>{let r=!1;const o=()=>{r||E()&&(r=!0,t())},n=()=>{setTimeout(o,0)};document.readyState==="complete"?n():window.addEventListener("load",n,{once:!0}),(document.prerendering||String(document.visibilityState)==="prerender")&&document.addEventListener("visibilitychange",o,{once:!0})},R=()=>{P(()=>{try{g({onRegisterError(t){console.warn("[PWA] service worker registration skipped:",t)}})}catch(t){console.warn("[PWA] service worker registration skipped:",t)}})};l==="mobile"?a(async()=>{const{renderMobileApp:t}=await import("./renderMobileApp-DHWdI195.js");return{renderMobileApp:t}},__vite__mapDeps([0,1,2,3,4,5,6])).then(({renderMobileApp:t})=>{t(window.__OPENCHAMBER_RUNTIME_APIS__??w())}):_().then(()=>a(()=>import("./main-B0CxEOP5.js").then(t=>t.m),__vite__mapDeps([7,1,2,3,4,5,6,8,9])));R();
