import{n as e,s as t}from"./rolldown-runtime-BG2f4sTM.js";import{$ct as n,Br as r,H9 as i,Hr as a,Ir as o,Itt as s,K2 as c,Lr as l,M_t as u,Mft as d,Mvt as f,N_t as p,Nvt as m,O2 as h,O_t as g,P_t as _,Rr as v,Ur as y,Vr as b,W9 as x,Zct as S,g8 as C,idt as w,jft as T,k2 as E,m2 as D,p8 as O,rdt as k,w2 as A,zr as j,ztt as M}from"./app-initial-BHB6SClA.js";function N(e){let t=(0,P.c)(17),{conversationId:i}=e,s=p(T),c=n(`1488233300`),d=u(a,i),f=u(A,i),m=u(r,i),g=_(j)?.[i],y;t[0]!==g||t[1]!==i||t[2]!==d.isEligible||t[3]!==d.reason||t[4]!==c||t[5]!==f||t[6]!==s?(y=()=>{let e=s.get(E,i),t=s.get(h,i),n=l(e,t),r=v(e,t,g);c&&n!=null&&s.set(j,e=>o(e??{},i,n)),w.dispatchMessage(`heartbeat-automation-thread-state-changed`,{threadId:c?i:null,isEligible:c&&d.isEligible,collaborationMode:c?f:null,permissions:c?r:null,reason:c?d.reason:null})},t[0]=g,t[1]=i,t[2]=d.isEligible,t[3]=d.reason,t[4]=c,t[5]=f,t[6]=s,t[7]=y):y=t[7];let b;return t[8]!==g||t[9]!==i||t[10]!==d.isEligible||t[11]!==d.reason||t[12]!==c||t[13]!==m||t[14]!==f||t[15]!==s?(b=[g,i,d.isEligible,d.reason,m,c,f,s],t[8]=g,t[9]=i,t[10]=d.isEligible,t[11]=d.reason,t[12]=c,t[13]=m,t[14]=f,t[15]=s,t[16]=b):b=t[16],(0,F.useEffect)(y,b),null}var P,F,I=e((()=>{P=f(),g(),F=t(m(),1),D(),k(),d(),S(),y(),b()}));function L(e){let t=(0,R.c)(4),{conversationId:n}=e,r=p(O),i,a;return t[0]!==n||t[1]!==r?(i=()=>{let e=!1;return r.watch(t=>{let{get:i}=t,a=i(c,n);a==null||e||(e=!0,x(r,s,{streamRole:a.role}))})},a=[n,r],t[0]=n,t[1]=r,t[2]=i,t[3]=a):(i=t[2],a=t[3]),(0,z.useEffect)(i,a),null}var R,z,B=e((()=>{R=f(),M(),g(),z=t(m(),1),D(),i(),C()}));export{I as i,B as n,N as r,L as t};
//# sourceMappingURL=local-conversation-stream-role-product-event-C7wWoP3M.js.map