import{a as e,n as t,t as n}from"./jsx-runtime-CutOxEx1.js";import"./src-nEMn5Fcu.js";import{t as r}from"./client-DBCWmf5H.js";import{t as i}from"./runtimeTheme-Cf77mCZn.js";import{t as a}from"./SideComparePanel-4yqA6FWb.js";var o=e(t(),1),s=e(r(),1),c=n();function l(){return o.useEffect(()=>{i(`light`);let e=globalThis?.chrome?.runtime,t=globalThis?.chrome?.tabs;if(!e?.connect)return;let n=()=>{try{return String(e?.lastError?.message||``).trim()}catch{return``}},r=!1,a=null;try{a=e.connect({name:`SIDE_PANEL_STATE`}),n()}catch{n();return}if(!a)return;let o=()=>{r=!0,n()};try{a.onDisconnect?.addListener?.(o)}catch{}let s=()=>{try{t?.query?.({active:!0,currentWindow:!0},e=>{if(n()||r)return;let t=Number(e?.[0]?.id||0);if(t>0)try{a.postMessage({type:`SIDE_PANEL_ACTIVE`,tabId:t}),n()}catch{n()}})}catch{n()}};s();let c=()=>s();try{t?.onActivated?.addListener?.(c)}catch{}try{t?.onUpdated?.addListener?.(c)}catch{}return()=>{r=!0;try{t?.onActivated?.removeListener?.(c)}catch{}try{t?.onUpdated?.removeListener?.(c)}catch{}try{a.onDisconnect?.removeListener?.(o)}catch{}try{a.disconnect()}catch{}n()}},[]),(0,c.jsx)(a,{})}s.createRoot(document.getElementById(`root`)).render((0,c.jsx)(o.StrictMode,{children:(0,c.jsx)(l,{})}));