try{let e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`839c2d20-18ae-4f16-bad1-58dff847adea`,e._sentryDebugIdIdentifier=`sentry-dbid-839c2d20-18ae-4f16-bad1-58dff847adea`)}catch{}import{o as e}from"./rolldown-runtime-nx40z1zs.js";import{Ag as t,Qh as n,Qm as r,Yh as i,Zm as a,jg as o,op as s,tf as c}from"./entry.client-mpghtlrl.js";import{t as l}from"./guideRouterEnvironmentHooks-h2xlfina.js";var u=t(),d=e(o(),1),f=()=>{let e=(0,u.c)(17),{conversation:t}=a(),o=l(),f;e[0]===t.mutations.createGroup?f=e[1]:(f=t.mutations.createGroup.getActiveUserMutation().getOptions(),e[0]=t.mutations.createGroup,e[1]=f);let{mutate:m}=i(f),[h,g]=(0,d.useState)(),[_,v]=(0,d.useState)(),y;e[2]!==h||e[3]!==t?(y=h?t.queries.groupByClientId.getActiveUserQuery().getOptions({clientId:h}):{queryFn:p,queryKey:[],enabled:!1},e[2]=h,e[3]=t,e[4]=y):y=e[4];let{data:b}=n(y),x=b?.groupId,S,C;e[5]!==x||e[6]!==o||e[7]!==_?(S=()=>{x&&(o({to:s.dialog.guide.chat.groupChat.fullPath,params:{groupId:x},..._}),v(void 0),g(void 0))},C=[x,o,_],e[5]=x,e[6]=o,e[7]=_,e[8]=S,e[9]=C):(S=e[8],C=e[9]),(0,d.useEffect)(S,C);let{trackUserAction:w}=r(),T;e[10]===w?T=e[11]:(T=(e,t,n)=>{w(`ChatInteractionWithCount`,{type:e,wasSuccessful:t,count:n},`Press`)},e[10]=w,e[11]=T);let E=T,D;e[12]!==m||e[13]!==E?(D=(e,t)=>{let n=c();m({createdClientGroupId:n,xuids:e},{onSuccess:()=>{E(`CreateGroup`,!0,e.length),v(t),g(n)},onError:()=>E(`CreateGroup`,!1,e.length)})},e[12]=m,e[13]=E,e[14]=D):D=e[14];let O=D,k;return e[15]===O?k=e[16]:(k={createGroupAndNavigate:O},e[15]=O,e[16]=k),k};function p(){return null}export{f as t};