import{n as e,s as t}from"./rolldown-runtime-BG2f4sTM.js";import{Dvt as n,Eut as r,Ilt as i,Mvt as a,Nvt as o,Rft as s,Rlt as c,Tut as l,Vft as u,Wft as d,Ydt as f,b1 as p,bft as m,dft as h,xft as g,y1 as _}from"./app-initial-BHB6SClA.js";function v(e){let t=(0,y.c)(59),{className:n,autoFocusSelected:a,value:o,onValueChange:s,onSelectedAutoFocus:c,onTransitionComplete:l,disabled:f}=e,p=a===void 0?!1:a,g=f===void 0?!1:f,_=d(),v=r(),w=o===`chat`?`0%`:`100%`,T;t[0]!==p||t[1]!==w||t[2]!==v||t[3]!==o?(T=()=>!p||v?{x:w}:{x:o===`chat`?`100%`:`0%`},t[0]=p,t[1]=w,t[2]=v,t[3]=o,t[4]=T):T=t[4];let[E]=(0,b.useState)(T),D;t[5]===n?D=t[6]:(D=m(`relative isolate inline-grid h-8 shrink-0 grid-cols-2 gap-0 rounded-full p-0.5 select-none extension:h-7`,n),t[5]=n,t[6]=D);let O;t[7]===_?O=t[8]:(O=_.formatMessage({id:`composer.home.modeToggle.ariaLabel`,defaultMessage:`Composer mode`,description:`Accessible label for the toggle that switches the Home composer between Work and Chat modes`}),t[7]=_,t[8]=O);let k;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,x.jsx)(`span`,{className:`pointer-events-none absolute inset-x-0.5 top-1/2 z-0 h-8 -translate-y-1/2 rounded-full bg-token-side-bar-background dark:brightness-75 electron:dark:bg-token-button-foreground electron:dark:brightness-100`,"aria-hidden":`true`}),t[9]=k):k=t[9];let A;t[10]===w?A=t[11]:(A={x:w},t[10]=w,t[11]=A);let j;t[12]===v?j=t[13]:(j=v?{duration:0}:C,t[12]=v,t[13]=j);let M;t[14]!==E||t[15]!==l||t[16]!==A||t[17]!==j?(M=(0,x.jsx)(h.span,{animate:A,className:`pointer-events-none relative z-10 col-start-1 row-start-1 -my-[3px] rounded-full bg-token-input-background/90 shadow-md ring-[0.5px] ring-token-border backdrop-blur-lg electron:dark:bg-token-dropdown-background`,initial:E,transition:j,"aria-hidden":`true`,onAnimationComplete:l}),t[14]=E,t[15]=l,t[16]=A,t[17]=j,t[18]=M):M=t[18];let N;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,x.jsx)(u,{id:`composer.home.modeToggle.chat.tooltip`,defaultMessage:`Ask questions and explore ideas`,description:`Concise tooltip for the Chat option in the Home composer mode toggle. It explains that Chat is for asking questions and exploring ideas.`}),t[19]=N):N=t[19];let P=p&&o===`chat`,F=o===`chat`?`text-token-text-primary`:`text-token-text-tertiary hover:text-token-text-primary`,I;t[20]===F?I=t[21]:(I=m(S,`col-start-1 row-start-1`,F),t[20]=F,t[21]=I);let L=o===`chat`,R=p&&o===`chat`?c:void 0,z;t[22]!==s||t[23]!==o?(z=()=>{o!==`chat`&&s(`chat`)},t[22]=s,t[23]=o,t[24]=z):z=t[24];let B;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,x.jsx)(u,{id:`composer.home.modeToggle.chat`,defaultMessage:`Chat`,description:`Label for Chat mode in the Home composer mode toggle`}),t[25]=B):B=t[25];let V;t[26]!==g||t[27]!==P||t[28]!==I||t[29]!==L||t[30]!==R||t[31]!==z?(V=(0,x.jsx)(`button`,{autoFocus:P,className:I,type:`button`,"aria-pressed":L,disabled:g,onFocus:R,onClick:z,children:B}),t[26]=g,t[27]=P,t[28]=I,t[29]=L,t[30]=R,t[31]=z,t[32]=V):V=t[32];let H;t[33]!==g||t[34]!==V?(H=(0,x.jsx)(i,{disabled:g,tooltipContent:N,children:V}),t[33]=g,t[34]=V,t[35]=H):H=t[35];let U;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,x.jsx)(u,{id:`composer.home.modeToggle.work.tooltip`,defaultMessage:`Get tasks done with your files and apps`,description:`Concise tooltip for the Work option in the Home composer mode toggle. It explains that Work can complete tasks using the user's files and apps.`}),t[36]=U):U=t[36];let W=p&&o===`work`,G=o===`work`?`text-token-text-primary`:`text-token-text-tertiary hover:text-token-text-primary`,K;t[37]===G?K=t[38]:(K=m(S,`col-start-2 row-start-1`,G),t[37]=G,t[38]=K);let q=o===`work`,J=p&&o===`work`?c:void 0,Y;t[39]!==s||t[40]!==o?(Y=()=>{o!==`work`&&s(`work`)},t[39]=s,t[40]=o,t[41]=Y):Y=t[41];let X;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(X=(0,x.jsx)(u,{id:`composer.home.modeToggle.work`,defaultMessage:`Work`,description:`Label for Work mode in the Home composer mode toggle`}),t[42]=X):X=t[42];let Z;t[43]!==g||t[44]!==W||t[45]!==K||t[46]!==q||t[47]!==J||t[48]!==Y?(Z=(0,x.jsx)(`button`,{autoFocus:W,className:K,type:`button`,"aria-pressed":q,disabled:g,onFocus:J,onClick:Y,children:X}),t[43]=g,t[44]=W,t[45]=K,t[46]=q,t[47]=J,t[48]=Y,t[49]=Z):Z=t[49];let Q;t[50]!==g||t[51]!==Z?(Q=(0,x.jsx)(i,{disabled:g,tooltipContent:U,children:Z}),t[50]=g,t[51]=Z,t[52]=Q):Q=t[52];let $;return t[53]!==H||t[54]!==Q||t[55]!==D||t[56]!==O||t[57]!==M?($=(0,x.jsxs)(`div`,{className:D,role:`group`,"aria-label":O,children:[k,M,H,Q]}),t[53]=H,t[54]=Q,t[55]=D,t[56]=O,t[57]=M,t[58]=$):$=t[58],$}var y,b,x,S,C;e((()=>{y=a(),g(),f(),b=t(o(),1),s(),c(),l(),p(),x=n(),S=`cursor-interaction relative z-10 inline-flex h-full min-w-0 items-center justify-center whitespace-nowrap rounded-full px-7.5 text-sm font-medium extension:px-2.5 disabled:cursor-not-allowed disabled:opacity-40`,C={duration:300/1e3,ease:_}}))();export{v as HomeComposerModeToggle};
//# sourceMappingURL=home-composer-mode-toggle-CgZSTsCs.js.map