import{s as e}from"./chunk-Bj-mKKzh.js";import{ci as t,qr as n}from"./src-BOCweS1p.js";import{n as r,t as i}from"./jsx-runtime-CiQ1k8xo.js";import"./react-dom-CvzHKZGB.js";import{I as a,lt as o}from"./vscode-api-DjORcpSo.js";import"./persisted-signal-CweW-bgN.js";import{n as s}from"./window-zoom-context-CSPQZGcc.js";import"./route-scope-CLteRG86.js";import"./setting-storage-CwKZnsvR.js";import"./reduced-motion-preference-Bd5_3c7y.js";import{a as c,i as l}from"./app-shell-state-Dskh7Hih.js";import{n as u,s as d}from"./app-shell-tab-controller-cnh2C4j9.js";import{t as f}from"./browser-sidebar-manager-BtbIv4P0.js";import{t as p}from"./browser-sidebar-retained-webview-Bk8mrLmX.js";var m=o(),h=e(r(),1),g=i();function _(e){let n=(0,m.c)(19),{browserUseTabIdsKey:r,conversationId:i}=e,o=a(u.activeTab$),s=a(c),f=a(l),p,_;n[0]===f?(p=n[1],_=n[2]):(p=e=>f.on(`change`,e),_=()=>f.get(),n[0]=f,n[1]=p,n[2]=_);let b=(0,h.useSyncExternalStore)(p,_,v),x;n[3]!==o||n[4]!==i?(x=d(o,i),n[3]=o,n[4]=i,n[5]=x):x=n[5];let S=x,C=S!=null&&(s||b>0),w,T;if(n[6]!==S||n[7]!==r||n[8]!==i||n[9]!==C){T=Symbol.for(`react.early_return_sentinel`);bb0:{let e;n[12]!==S||n[13]!==C?(e=e=>!C||e!==S,n[12]=S,n[13]=C,n[14]=e):e=n[14];let a=r.split(`\0`).filter(e);if(a.length===0){T=null;break bb0}let o;n[15]===i?o=n[16]:(o=e=>(0,g.jsx)(y,{browserTabId:t(e),conversationId:i},e),n[15]=i,n[16]=o),w=a.map(o)}n[6]=S,n[7]=r,n[8]=i,n[9]=C,n[10]=w,n[11]=T}else w=n[10],T=n[11];if(T!==Symbol.for(`react.early_return_sentinel`))return T;let E;return n[17]===w?E=n[18]:(E=(0,g.jsx)(g.Fragment,{children:w}),n[17]=w,n[18]=E),E}function v(){return 0}function y(e){let t=(0,m.c)(8),{browserTabId:r,conversationId:i}=e,a=s(),o=(0,h.useRef)(null),c;t[0]!==r||t[1]!==i?(c=()=>f.getSnapshot(i,r),t[0]=r,t[1]=i,t[2]=c):c=t[2];let l=(0,h.useSyncExternalStore)(x,c,b);if(l?.tabType!==n.WEB)return null;let u=l.url.length===0?`about:blank`:l.url,d;return t[3]!==r||t[4]!==i||t[5]!==u||t[6]!==a?(d=(0,g.jsx)(p,{bounds:null,browserTabId:r,conversationId:i,initialUrl:u,isVisible:!1,scale:1,webviewRef:o,windowZoom:a}),t[3]=r,t[4]=i,t[5]=u,t[6]=a,t[7]=d):d=t[7],d}function b(){return null}function x(e){return f.subscribe(e)}export{_ as HiddenBrowserUseWebviewHost};
//# sourceMappingURL=browser-sidebar-hidden-browser-use-webview-host-CwP2aj9n.js.map