Skip to content

Enlarge pet activity balloon#7

Open
moonixt wants to merge 1 commit into
am-will:mainfrom
moonixt:main
Open

Enlarge pet activity balloon#7
moonixt wants to merge 1 commit into
am-will:mainfrom
moonixt:main

Conversation

@moonixt
Copy link
Copy Markdown

@moonixt moonixt commented May 2, 2026

@codex check the changes and resume

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c71b64f46b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@@ -1,2 +1,2 @@
import{s as e}from"./chunk-Bj-mKKzh.js";import{t}from"./react-BE0_fAZJ.js";import"./react-dom-BJ7hbTs6.js";import{t as n}from"./compiler-runtime-DaX1MIGd.js";import{_r as r,d as i}from"./vscode-api-Cq49c5Gl.js";import{M as a,Mt as o,dt as s,fr as c,pt as l}from"./app-server-manager-signals-B_sRWyjv.js";import{v as u}from"./codex-api-BrPxtxx7.js";import{t as d}from"./jsx-runtime-lEsnPbkx.js";import"./path-browserify-Chh2Zpai.js";import"./quote-cmd-oSxnEoQp.js";import{n as f,r as p}from"./message-bus-B_NkFI1i.js";import"./lib-D__qph_N.js";import{n as m,r as h,s as ee}from"./lib-BLZT-hpR.js";import"./statsig-gate-signal-D9LyAapF.js";import"./global-settings-D25jzi7K.js";import"./config-queries-C-qINdQW.js";import{o as g}from"./statsig-Dkgqty0N.js";import"./remote-connection-visibility-CohAyMKM.js";import{c as _}from"./app-server-manager-hooks-DEjiw62x.js";import"./persisted-signal-DdRKzKeP.js";import"./use-auth-C02AaUWN.js";import"./use-global-state-BskHB3H6.js";import{t as v}from"./clsx-C6dNMzYU.js";import{t as y}from"./button-CHLNjOGa.js";import{t as b}from"./spinner-0yJ08A3N.js";import{p as x,t as S}from"./proxy-DJsdifOb.js";import{a as C,n as w,r as T,t as E}from"./codex-avatar-3zmt6SG-.js";import"./_baseOrderBy-CREa02-B.js";import"./Combination-Bo00uhPV.js";import"./tooltip-dismiss-Dv-H1M90.js";import{t as D}from"./chevron-right-D-FrOwG7.js";import{t as O}from"./tooltip-97cpGmUj.js";import"./invalidate-queries-and-broadcast-aIUy1AGh.js";import{n as k,t as A}from"./warning-ljXs70iv.js";import{t as j}from"./x-D4MeO337.js";import"./request-DwX4Jn67.js";import{t as M}from"./chevron-oKKYr5lm.js";import{t as N}from"./clock-B9OrnZ-c.js";import{t as te}from"./create-resize-observer-D_RcpYfu.js";import{t as P}from"./is-subagent-conversation-CZmW3Qt-.js";import{t as F}from"./check-circle-filled-B-2NDdS-.js";import{t as I}from"./use-floating-window-pointer-interactivity-BZT8RRB7.js";var L=n(),R=e(t(),1),z=1600,ne=100,B=320;function V(e){return{screenX:e.screenX,screenY:e.screenY,timeMs:e.timeStamp}}function H(e,t){return e.hasMoved?W(U([...e.samples,t])):null}function U(e){let t=e.at(-1);return t==null?e:e.filter(e=>t.timeMs-e.timeMs<=ne)}function W(e){let t=e.at(-1);if(t==null)return null;let n=e.find(e=>t.timeMs-e.timeMs>16);if(n==null)return null;let r=(t.timeMs-n.timeMs)/1e3;if(r<=0)return null;let i={x:(t.screenX-n.screenX)/r,y:(t.screenY-n.screenY)/r},a=Math.hypot(i.x,i.y);if(a<B)return null;if(a<=1600)return i;let o=z/a;return{x:i.x*o,y:i.y*o}}var G=d();function K(e){let t=(0,L.c)(20),{ariaLabel:n,assetRef:r,className:i,notificationBadge:a,onContextMenu:o,spritesheetUrl:s,state:c,transientState:l}=e,u=c===void 0?`idle`:c,[d,f]=(0,R.useState)(!1),p=C(),m=l??(d?`jumping`:u),h=a!=null,ee;n!=null&&(ee=h?`group`:`img`);let g;t[0]===i?g=t[1]:(g=v(`relative flex size-20 cursor-interaction items-center justify-center active:cursor-grabbing`,i),t[0]=i,t[1]=g);let _=n==null&&!h?!0:void 0,y,b;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(y=()=>{f(!0)},b=()=>{f(!1)},t[2]=y,t[3]=b):(y=t[2],b=t[3]);let x;t[4]!==r||t[5]!==m||t[6]!==s?(x=(0,G.jsx)(E,{assetRef:r,className:`relative z-10`,spritesheetUrl:s,state:m}),t[4]=r,t[5]=m,t[6]=s,t[7]=x):x=t[7];let w;t[8]!==h||t[9]!==a||t[10]!==p?(w=h?(0,G.jsx)(S.button,{type:`button`,animate:{opacity:1,scale:1,y:0},"aria-label":a.ariaLabel,className:v(`no-drag absolute top-0 right-0 z-20 flex cursor-interaction items-center justify-center rounded-full border border-token-border/60 text-xs leading-none font-medium shadow-sm focus-visible:ring-2 focus-visible:ring-token-focus-border focus-visible:outline-none`,a.isIconOnly?`size-7 p-0`:`min-h-7 min-w-7 px-2 py-1`),"data-testid":`avatar-overlay-notification-badge`,initial:{opacity:0,scale:p?1:.7,y:p?0:3},onClick:a.onClick,style:{backgroundColor:a.backgroundColor,color:a.foregroundColor},transition:p?{duration:0}:{damping:20,mass:.7,stiffness:420,type:`spring`},whileHover:p?void 0:{scale:1.06},whileTap:p?void 0:{scale:.94},children:a.content}):null,t[8]=h,t[9]=a,t[10]=p,t[11]=w):w=t[11];let T;return t[12]!==n||t[13]!==o||t[14]!==ee||t[15]!==g||t[16]!==_||t[17]!==x||t[18]!==w?(T=(0,G.jsxs)(`div`,{className:g,"data-avatar-mascot":`true`,"data-testid":`avatar-mascot-button`,"aria-hidden":_,"aria-label":n,role:ee,onContextMenu:o,onPointerEnter:y,onPointerLeave:b,children:[x,w]}),t[12]=n,t[13]=o,t[14]=ee,t[15]=g,t[16]=_,t[17]=x,t[18]=w,t[19]=T):T=t[19],T}function re(e){return e.map(e=>[e.id,e.title,e.body??``,e.level,e.isLoading?`loading`:`done`,e.action?.path??``].join(``)).join(`\0`)}var q=h({running:{id:`avatarOverlay.statusRunning`,defaultMessage:`Running`,description:`Status label shown for a loading notification`},runningFallbackBody:{id:`avatarOverlay.statusRunningSubtitle`,defaultMessage:`Thinking`,description:`Fallback body shown for a loading notification when no richer activity text is available`},waiting:{id:`avatarOverlay.statusWaiting`,defaultMessage:`Needs input`,description:`Status label shown for a notification waiting on user input`},review:{id:`avatarOverlay.statusReview`,defaultMessage:`Ready`,description:`Status label shown for a notification with unread completed output`},failed:{id:`avatarOverlay.statusFailed`,defaultMessage:`Blocked`,description:`Status label shown for a notification that failed`},info:{id:`avatarOverlay.statusInfo`,defaultMessage:`Info`,description:`Status label shown for an informational notification`}}),J={badgeBackgroundColor:`var(--color-token-activity-bar-badge-background)`,badgeForegroundColor:`var(--color-token-activity-bar-badge-foreground)`,fallbackBodyMessage:q.info,iconClassName:`icon-xs shrink-0 text-token-text-secondary`,iconType:`clock`,labelMessage:q.info,mascotState:`idle`};function ie(e){if(e==null)return J;if(e.isLoading)return{badgeBackgroundColor:`var(--color-token-activity-bar-badge-background)`,badgeForegroundColor:`var(--color-token-activity-bar-badge-foreground)`,fallbackBodyMessage:q.runningFallbackBody,iconClassName:`icon-xs shrink-0 text-token-text-secondary`,iconType:`spinner`,labelMessage:q.running,mascotState:`running`};switch(e.level){case`warning`:return{badgeBackgroundColor:`var(--color-token-editor-warning-foreground)`,badgeForegroundColor:`var(--color-token-bg-primary)`,fallbackBodyMessage:q.waiting,iconClassName:`icon-xs shrink-0 text-token-editor-warning-foreground`,iconType:`clock`,labelMessage:q.waiting,mascotState:`waiting`};case`danger`:return{badgeBackgroundColor:`var(--color-token-error-foreground)`,badgeForegroundColor:`var(--color-token-bg-primary)`,fallbackBodyMessage:q.failed,iconClassName:`icon-xs shrink-0 text-token-error-foreground`,iconType:`warning`,labelMessage:q.failed,mascotState:`failed`};case`success`:return{badgeBackgroundColor:`var(--color-token-charts-green)`,badgeForegroundColor:`var(--color-token-bg-primary)`,fallbackBodyMessage:q.review,iconClassName:`icon-xs shrink-0 text-token-charts-green`,iconType:`check-circle`,labelMessage:q.review,mascotState:`review`};case`info`:return J}}var Y=h({calledTool:{id:`avatarOverlay.session.calledTool`,defaultMessage:`Called tool`,description:`Avatar overlay activity subtitle for a completed generic tool call`},calledToolName:{id:`avatarOverlay.session.calledToolName`,defaultMessage:`Called {toolName}`,description:`Avatar overlay activity subtitle for a completed named tool call`},callingTool:{id:`avatarOverlay.session.callingTool`,defaultMessage:`Calling tool`,description:`Avatar overlay activity subtitle for a running generic tool call`},callingToolName:{id:`avatarOverlay.session.callingToolName`,defaultMessage:`Calling {toolName}`,description:`Avatar overlay activity subtitle for a running named tool call`},editedFiles:{id:`avatarOverlay.session.editedFiles`,defaultMessage:`Edited {fileCount, plural, one {# file} other {# files}}`,description:`Avatar overlay activity subtitle for completed file edits`},editingFiles:{id:`avatarOverlay.session.editingFiles`,defaultMessage:`Editing {fileCount, plural, one {# file} other {# files}}`,description:`Avatar overlay activity subtitle for running file edits`},listedFiles:{id:`avatarOverlay.session.listedFiles`,defaultMessage:`Listed files`,description:`Avatar overlay activity subtitle for a completed file listing command`},listingFiles:{id:`avatarOverlay.session.listingFiles`,defaultMessage:`Listing files`,description:`Avatar overlay activity subtitle for a running file listing command`},newThread:{id:`avatarOverlay.session.newThread`,defaultMessage:`New chat`,description:`Avatar overlay fallback title for a thread without a generated title`},ranCommand:{id:`avatarOverlay.session.ranCommand`,defaultMessage:`Ran command`,description:`Avatar overlay activity subtitle for a completed shell command`},readFile:{id:`avatarOverlay.session.readFile`,defaultMessage:`Read {fileName}`,description:`Avatar overlay activity subtitle for a completed file read`},readingFile:{id:`avatarOverlay.session.readingFile`,defaultMessage:`Reading {fileName}`,description:`Avatar overlay activity subtitle for a running file read`},runningCommand:{id:`avatarOverlay.session.runningCommand`,defaultMessage:`Running command`,description:`Avatar overlay activity subtitle for a running shell command`},searchedFiles:{id:`avatarOverlay.session.searchedFiles`,defaultMessage:`Searched files`,description:`Avatar overlay activity subtitle for a completed file search command without a query`},searchedQuery:{id:`avatarOverlay.session.searchedQuery`,defaultMessage:`Searched "{query}"`,description:`Avatar overlay activity subtitle for a completed search with a query`},searchedWeb:{id:`avatarOverlay.session.searchedWeb`,defaultMessage:`Searched web`,description:`Avatar overlay activity subtitle for a completed web search`},searchingFiles:{id:`avatarOverlay.session.searchingFiles`,defaultMessage:`Searching files`,description:`Avatar overlay activity subtitle for a running file search command without a query`},searchingQuery:{id:`avatarOverlay.session.searchingQuery`,defaultMessage:`Searching "{query}"`,description:`Avatar overlay activity subtitle for a running search with a query`}});function ae({intl:e,localConversations:t,remoteTasks:n}){let r=[],i=new Set;for(let n of t){let t=oe(n,e);t==null||i.has(t.key)||(i.add(t.key),r.push(t))}for(let t of n){let n=se(t,e);i.has(n.key)||(i.add(n.key),r.push(n))}return r}function oe(e,t){if(P(e))return null;let n=e.hostId??i,r=n===i?`local`:`remote-host`;return{actionPath:`/local/`+e.id,hostId:n,key:r+`:`+n+`:`+e.id,localConversationId:e.id,source:r,status:ue(e),subtitle:ce(e,t),title:s(e)??t.formatMessage(Y.newThread),turnKey:String(e.turns.length),updatedAtMs:e.updatedAt}}function se(e,t){let n=(e.updated_at??e.created_at??0)*1e3;return{actionPath:`/remote/`+e.id,hostId:null,key:`cloud:`+e.id,localConversationId:null,source:`cloud`,status:de(e),subtitle:null,title:e.title?.trim()||t.formatMessage(Y.newThread),turnKey:e.task_status_display?.latest_turn_status_display?.turn_id??null,updatedAtMs:n}}function ce(e,t){return X(e.turns.at(-1)?.items??[],t)}function X(e,t){for(let t=e.length-1;t>=0;--t){let n=e[t];if(n?.type===`reasoning`)for(let e=n.summary.length-1;e>=0;--e){let t=Z(n.summary[e]);if(t!=null)return t}if(n?.type===`agentMessage`){let e=Z(n.text);if(e!=null)return e}}for(let n=e.length-1;n>=0;--n){let r=le(e[n],t);if(r!=null)return r}return null}function le(e,t){if(e==null)return null;if(e.type===`commandExecution`){let n=e.commandActions.at(-1),r=e.status===`inProgress`;if(n==null)return r?t.formatMessage(Y.runningCommand):t.formatMessage(Y.ranCommand);switch(n.type){case`read`:return r?t.formatMessage(Y.readingFile,{fileName:n.name}):t.formatMessage(Y.readFile,{fileName:n.name});case`listFiles`:return r?t.formatMessage(Y.listingFiles):t.formatMessage(Y.listedFiles);case`search`:{let e=Z(n.query??``);return e==null?r?t.formatMessage(Y.searchingFiles):t.formatMessage(Y.searchedFiles):r?t.formatMessage(Y.searchingQuery,{query:e}):t.formatMessage(Y.searchedQuery,{query:e})}case`unknown`:return r?t.formatMessage(Y.runningCommand):t.formatMessage(Y.ranCommand)}}if(e.type===`fileChange`){let n=e.changes.length;return e.status===`inProgress`?t.formatMessage(Y.editingFiles,{fileCount:n}):t.formatMessage(Y.editedFiles,{fileCount:n})}if(e.type===`mcpToolCall`){let n=e.status===`inProgress`,r=Z(e.tool.replace(/[_-]+/g,` `));return r==null?n?t.formatMessage(Y.callingTool):t.formatMessage(Y.calledTool):n?t.formatMessage(Y.callingToolName,{toolName:r}):t.formatMessage(Y.calledToolName,{toolName:r})}if(e.type===`webSearch`){let n=Z(e.query);return n==null?t.formatMessage(Y.searchedWeb):t.formatMessage(Y.searchedQuery,{query:n})}return null}function Z(e){let t=l(e).replace(/\r?\n+/g,` `).replace(/^\s{0,3}#{1,6}\s+/g,``).replace(/\*\*([^*]+)\*\*/g,`$1`).replace(/__([^_]+)__/g,`$1`).replace(/`([^`]+)`/g,`$1`).replace(/\*([^*]+)\*/g,`$1`).replace(/_([^_]+)_/g,`$1`).replace(/\s+/g,` `).trim();return t.length>0?t:null}function ue(e){let t=e.resumeState===`needs_resume`?e.threadRuntimeStatus:null,n=e.resumeState===`needs_resume`?t?.type===`active`:e.resumeState===`resuming`||e.turns.at(-1)?.status===`inProgress`,r=e.resumeState===`needs_resume`?t?.type===`active`&&t.activeFlags.includes(`waitingOnUserInput`):e.requests.some(e=>e.method===`item/tool/requestUserInput`),i=e.resumeState===`needs_resume`?t?.type===`systemError`:e.turns.at(-1)?.status===`failed`;return o(e)||r?`waiting`:i?`failed`:n?`running`:e.hasUnreadTurn?`review`:`idle`}function de(e){if(e.archived)return`idle`;let t=e.task_status_display?.latest_turn_status_display?.turn_status;return t===`failed`||t===`cancelled`?`failed`:t===`in_progress`||t===`pending`?`running`:e.has_unread_turn?`review`:`idle`}var Q=h({mascotLabel:{id:`petOverlay.mascotLabel`,defaultMessage:`{petName} pet`,description:`Accessible label for the floating Codex pet`},openNotification:{id:`avatarOverlay.openNotification`,defaultMessage:`Open notification`,description:`Accessible label for an actionable row in the floating avatar notification tray`},dismissNotification:{id:`avatarOverlay.dismissNotification`,defaultMessage:`Dismiss {title}`,description:`Accessible label for dismissing a notification in the floating avatar notification tray`},dismissNotificationTooltip:{id:`avatarOverlay.dismissNotificationTooltip`,defaultMessage:`Dismiss`,description:`Tooltip for the icon button that dismisses a floating avatar notification`},replyNotification:{id:`avatarOverlay.replyNotification`,defaultMessage:`Reply to {title}`,description:`Accessible label for replying to a floating avatar notification`},replyNotificationButton:{id:`avatarOverlay.replyNotificationButton`,defaultMessage:`Reply`,description:`Compact button label for replying to a floating avatar notification`},sendNotificationReply:{id:`avatarOverlay.sendNotificationReply`,defaultMessage:`Send reply to {title}`,description:`Accessible label for submitting a floating avatar notification reply`},notificationReplyPlaceholder:{id:`avatarOverlay.notificationReplyPlaceholder`,defaultMessage:`Reply`,description:`Placeholder for the one-line floating avatar notification reply input`},notificationReplyError:{id:`avatarOverlay.notificationReplyError`,defaultMessage:`Unable to send reply`,description:`Compact error shown when a floating avatar notification reply fails`},expandNotification:{id:`avatarOverlay.expandNotification`,defaultMessage:`Expand {title}`,description:`Accessible label for expanding a floating avatar notification row`},collapseNotification:{id:`avatarOverlay.collapseNotification`,defaultMessage:`Collapse {title}`,description:`Accessible label for collapsing a floating avatar notification row`},expandNotificationTooltip:{id:`avatarOverlay.expandNotificationTooltip`,defaultMessage:`Expand`,description:`Tooltip for the icon button that expands a floating avatar notification`},collapseNotificationTooltip:{id:`avatarOverlay.collapseNotificationTooltip`,defaultMessage:`Collapse`,description:`Tooltip for the icon button that collapses a floating avatar notification`},collapseNotificationTray:{id:`avatarOverlay.collapseNotificationTray`,defaultMessage:`Collapse activity`,description:`Accessible label and tooltip for the button that collapses the floating avatar activity tray`},notificationList:{id:`avatarOverlay.notificationList`,defaultMessage:`Activity notifications`,description:`Accessible label for the scrollable list of floating avatar notifications`},latestNotifications:{id:`avatarOverlay.latestNotifications`,defaultMessage:`Latest`,description:`Label for the button that scrolls the floating avatar activity list back to the newest notifications`},showLatestNotifications:{id:`avatarOverlay.showLatestNotifications`,defaultMessage:`Show latest activity`,description:`Accessible label for the button that scrolls the floating avatar activity list back to the newest notifications`},showOlderNotifications:{id:`avatarOverlay.showOlderNotifications`,defaultMessage:`Show {count, plural, one {# older activity item} other {# older activity items}}`,description:`Accessible label for the button that scrolls the floating avatar activity list toward older notifications`},olderNotificationCount:{id:`avatarOverlay.olderNotificationCount`,defaultMessage:`{count, plural, one {# more} other {# more}}`,description:`Label for the button that shows there are more floating avatar activity notifications below`},compactOlderNotificationCount:{id:`avatarOverlay.compactOlderNotificationCount`,defaultMessage:`+{count}`,description:`Compact label for the edge button that shows hidden floating avatar activity notifications`}}),fe=2,$=2,pe=.035,me=32,he=512,ge=1,_e=`group no-drag absolute left-1/2 z-10 flex h-5 cursor-interaction items-center justify-center gap-0.5 rounded-full border border-token-border bg-token-main-surface-primary px-2 text-[10px] leading-none font-medium text-token-text-secondary shadow-[0px_5px_10px_-7px_rgba(0,0,0,0.22)] backdrop-blur hover:text-token-foreground hover:shadow-[0px_7px_14px_-9px_rgba(0,0,0,0.26)] focus-visible:ring-1 focus-visible:ring-token-focus-border focus-visible:outline-none forced-colors:bg-[Canvas]`,ve=`!bg-token-main-surface-primary enabled:hover:!bg-[color-mix(in_srgb,var(--color-token-main-surface-primary)_94%,var(--color-token-foreground))]`;function ye(e){let t=(0,L.c)(62),{avatar:n,avatarMenuItems:r,interactiveRegionRef:i,isDragging:a,isNotificationTrayOpen:o,layout:s,mascotDragState:c,notifications:l,onLostPointerCapture:u,onCloseNotificationTray:d,onPointerCancel:f,onPointerDown:p,onPointerMove:m,onPointerUp:h,onDismissNotification:g,onRunNotificationAction:_,onNotificationReplyEditorActiveChange:y,onSubmitNotificationReply:b,onOpenNotificationTray:x}=e,w=a===void 0?!1:a,T=o===void 0?!0:o,E=ee(),D=C(),O;t[0]===l[0]?O=t[1]:(O=ie(l[0]),t[0]=l[0],t[1]=O);let A=O,j=l.length>0,N=j&&T,te=s.placement.startsWith(`top`),P=s.placement.endsWith(`end`),F=s.tray==null?void 0:Math.max(0,s.tray.height),I=`${te?`bottom`:`top`} ${P?`right`:`left`}`,R;if(N){let e;t[2]===E?e=t[3]:(e=E.formatMessage(Q.collapseNotificationTray),t[2]=E,t[3]=e);let n;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,G.jsx)(M,{className:`icon-xs opacity-80`}),t[4]=n):n=t[4];let r;t[5]!==d||t[6]!==e?(r={ariaLabel:e,backgroundColor:`var(--color-token-bg-primary)`,content:n,foregroundColor:`var(--color-token-text-secondary)`,isIconOnly:!0,onClick:d},t[5]=d,t[6]=e,t[7]=r):r=t[7],R=r}else if(j){let e;t[8]!==E||t[9]!==l.length?(e=E.formatMessage({id:`avatarOverlay.toggleNotificationTray`,defaultMessage:`Open activity tray, {count, plural, one {# item} other {# items}}`,description:`Accessible label for the floating avatar activity count button`},{count:l.length}),t[8]=E,t[9]=l.length,t[10]=e):e=t[10];let n;t[11]!==l.length||t[12]!==x||t[13]!==A.badgeBackgroundColor||t[14]!==A.badgeForegroundColor||t[15]!==e?(n={ariaLabel:e,backgroundColor:A.badgeBackgroundColor,content:l.length,foregroundColor:A.badgeForegroundColor,onClick:x},t[11]=l.length,t[12]=x,t[13]=A.badgeBackgroundColor,t[14]=A.badgeForegroundColor,t[15]=e,t[16]=n):n=t[16],R=n}let z;t[17]!==j||t[18]!==N||t[19]!==s.tray||t[20]!==l||t[21]!==g||t[22]!==y||t[23]!==_||t[24]!==b||t[25]!==D||t[26]!==F||t[27]!==I?(z=j?(0,G.jsx)(`div`,{"aria-hidden":N?void 0:!0,"data-avatar-overlay-hit-region":`notification-tray`,inert:!N,className:`absolute cursor-interaction text-sm text-token-foreground`,style:{height:s.tray?.height,left:s.tray?.left,pointerEvents:N?void 0:`none`,top:s.tray?.top,visibility:s.tray==null?`hidden`:void 0,width:s.tray?.width},children:(0,G.jsxs)(S.div,{animate:{opacity:N?1:0,scale:N||D?1:.97,y:N||D?0:8},className:`relative overflow-hidden [corner-shape:superellipse(1.5)]`,"data-avatar-overlay-size":`notification-tray`,initial:!1,style:{maxHeight:F,transformOrigin:I},transition:D?{duration:0}:{damping:26,mass:.8,stiffness:360,type:`spring`},children:[(0,G.jsx)(`div`,{className:`h-0 overflow-hidden`,"data-avatar-overlay-size":`notification-tray-header`}),(0,G.jsx)(`div`,{children:(0,G.jsx)(be,{isNotificationTrayVisible:N,notifications:l,prefersReducedMotion:!!D,trayMaxHeight:F,onDismissNotification:g,onRunNotificationAction:_,onNotificationReplyEditorActiveChange:y,onSubmitNotificationReply:b})})]})}):null,t[17]=j,t[18]=N,t[19]=s.tray,t[20]=l,t[21]=g,t[22]=y,t[23]=_,t[24]=b,t[25]=D,t[26]=F,t[27]=I,t[28]=z):z=t[28];let ne=w?`scale-95 transition-transform`:`transition-none`,B;t[29]===ne?B=t[30]:(B=v(`absolute duration-[160ms] ease-out [@media(prefers-reduced-motion:reduce)]:transition-none`,ne),t[29]=ne,t[30]=B);let V;t[31]!==s.mascot.height||t[32]!==s.mascot.left||t[33]!==s.mascot.top||t[34]!==s.mascot.width?(V={height:s.mascot.height,left:s.mascot.left,top:s.mascot.top,width:s.mascot.width},t[31]=s.mascot.height,t[32]=s.mascot.left,t[33]=s.mascot.top,t[34]=s.mascot.width,t[35]=V):V=t[35];let H;t[36]!==n.displayName||t[37]!==E?(H=E.formatMessage(Q.mascotLabel,{petName:n.displayName}),t[36]=n.displayName,t[37]=E,t[38]=H):H=t[38];let U;t[39]!==n.assetRef||t[40]!==n.spritesheetUrl||t[41]!==c||t[42]!==R||t[43]!==A.mascotState||t[44]!==H?(U=(0,G.jsx)(K,{ariaLabel:H,assetRef:n.assetRef,spritesheetUrl:n.spritesheetUrl,notificationBadge:R,state:A.mascotState,transientState:c}),t[39]=n.assetRef,t[40]=n.spritesheetUrl,t[41]=c,t[42]=R,t[43]=A.mascotState,t[44]=H,t[45]=U):U=t[45];let W;t[46]!==B||t[47]!==V||t[48]!==U?(W=(0,G.jsx)(`div`,{"data-avatar-overlay-hit-region":`mascot`,className:B,style:V,children:U}),t[46]=B,t[47]=V,t[48]=U,t[49]=W):W=t[49];let re;t[50]!==r||t[51]!==W?(re=(0,G.jsx)(k,{items:r,children:W}),t[50]=r,t[51]=W,t[52]=re):re=t[52];let q;return t[53]!==i||t[54]!==u||t[55]!==f||t[56]!==p||t[57]!==m||t[58]!==h||t[59]!==re||t[60]!==z?(q=(0,G.jsx)(`main`,{className:`relative h-screen w-screen overflow-hidden bg-transparent`,children:(0,G.jsxs)(`section`,{ref:i,"data-avatar-overlay-content-frame":`true`,className:`relative h-full w-full cursor-grab active:cursor-grabbing`,onLostPointerCapture:u,onPointerCancel:f,onPointerDown:p,onPointerMove:m,onPointerUp:h,children:[z,re]})}),t[53]=i,t[54]=u,t[55]=f,t[56]=p,t[57]=m,t[58]=h,t[59]=re,t[60]=z,t[61]=q):q=t[61],q}function be(e){let t=(0,L.c)(66),{isNotificationTrayVisible:n,notifications:r,onDismissNotification:i,onNotificationReplyEditorActiveChange:a,onRunNotificationAction:o,onSubmitNotificationReply:s,prefersReducedMotion:c,trayMaxHeight:l}=e,u=ee(),d=(0,R.useRef)(null),f;t[0]===r?f=t[1]:(f=re(r),t[0]=r,t[1]=f);let m=f,h=r.length>fe,g=Math.max(0,r.length-fe),_;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(_={hasLatestNotificationsAbove:!1,hiddenOlderNotificationCount:0},t[2]=_):_=t[2];let[y,b]=(0,R.useState)(_),[C,w]=(0,R.useState)(null),T=(0,R.useRef)(null),E;t[3]!==r||t[4]!==C?(E=r.some(e=>e.id===C)?C:null,t[3]=r,t[4]=C,t[5]=E):E=t[5];let D=E,O=D!=null&&n,k,A;t[6]!==O||t[7]!==a?(k=()=>{if(O)return a?.(!0),()=>{a?.(!1)}},A=[O,a],t[6]=O,t[7]=a,t[8]=k,t[9]=A):(k=t[8],A=t[9]),(0,R.useEffect)(k,A);let j,M;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(j=()=>{T.current?.focus()},M=[],t[10]=j,t[11]=M):(j=t[10],M=t[11]),p(`avatar-overlay-keyboard-interaction-ready`,j,M);let N=Math.min(y.hiddenOlderNotificationCount,g),te=h&&y.hasLatestNotificationsAbove,P=h&&N>0,F;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(F=e=>{b(t=>{let n=Te(e);return Ee(t,n)?t:n})},t[12]=F):F=t[12];let I=F,z;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(z=e=>{d.current=e,e!=null&&I(e)},t[13]=z):z=t[13];let ne=z,B;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(B=()=>{let e=d.current;e!=null&&I(e)},t[14]=B):B=t[14];let V;t[15]!==m||t[16]!==l?(V=[m,l,I],t[15]=m,t[16]=l,t[17]=V):V=t[17],(0,R.useLayoutEffect)(B,V);let H;t[18]===c?H=t[19]:(H=()=>{let e=d.current;e!=null&&(e.scrollTo({behavior:c?`auto`:`smooth`,top:0}),b(Te(e,0)))},t[18]=c,t[19]=H);let U=H,W;t[20]!==N||t[21]!==c?(W=()=>{let e=d.current;if(e==null)return;let t=Ce(e,N);e.scrollTo({behavior:c?`auto`:`smooth`,top:t}),b(Te(e,t))},t[20]=N,t[21]=c,t[22]=W):W=t[22];let K=W,q;t[23]!==te||t[24]!==c||t[25]!==U?(q=te?(0,G.jsx)(xe,{prefersReducedMotion:c,onClick:U},`latest`):null,t[23]=te,t[24]=c,t[25]=U,t[26]=q):q=t[26];let J;t[27]===q?J=t[28]:(J=(0,G.jsx)(x,{children:q}),t[27]=q,t[28]=J);let ie=n?1:0,Y=n||c?0:3,ae;t[29]!==ie||t[30]!==Y?(ae={opacity:ie,y:Y},t[29]=ie,t[30]=Y,t[31]=ae):ae=t[31];let oe;t[32]===u?oe=t[33]:(oe=u.formatMessage(Q.notificationList),t[32]=u,t[33]=oe);let se=h&&`snap-y snap-mandatory`,ce;t[34]===se?ce=t[35]:(ce=v(`vertical-scroll-fade-mask scrollbar-on-hover flex flex-col gap-1.5 overflow-y-auto px-1.5 pt-1 pb-0 [--edge-fade-distance:0.75rem]`,se),t[34]=se,t[35]=ce);let X;t[36]===l?X=t[37]:(X={maxHeight:l},t[36]=l,t[37]=X);let le;t[38]===c?le=t[39]:(le=c?{duration:0}:{duration:.16,ease:`easeOut`},t[38]=c,t[39]=le);let Z;t[40]===Symbol.for(`react.memo_cache_sentinel`)?(Z=e=>{let t=Te(e.currentTarget);b(e=>Ee(e,t)?e:t)},t[40]=Z):Z=t[40];let ue;t[41]!==D||t[42]!==r||t[43]!==i||t[44]!==o||t[45]!==s||t[46]!==c?(ue=r.map((e,t)=>(0,G.jsx)(we,{isReplying:D===e.id,notification:e,notificationIndex:t,onCloseReply:()=>{w(t=>t===e.id?null:t)},onDismissNotification:i,onOpenReply:()=>{w(e.id)},onRunNotificationAction:o,onSubmitNotificationReply:s,prefersReducedMotion:c,replyInputRef:T},e.id)),t[41]=D,t[42]=r,t[43]=i,t[44]=o,t[45]=s,t[46]=c,t[47]=ue):ue=t[47];let de;t[48]!==ae||t[49]!==oe||t[50]!==ce||t[51]!==X||t[52]!==le||t[53]!==ue?(de=(0,G.jsx)(S.div,{ref:ne,animate:ae,"aria-label":oe,className:ce,"data-avatar-overlay-size":`notification-tray-list`,role:`list`,style:X,initial:!1,transition:le,onScroll:Z,children:ue}),t[48]=ae,t[49]=oe,t[50]=ce,t[51]=X,t[52]=le,t[53]=ue,t[54]=de):de=t[54];let $;t[55]!==P||t[56]!==N||t[57]!==c||t[58]!==K?($=P?(0,G.jsx)(Se,{count:N,prefersReducedMotion:c,onClick:K},`older`):null,t[55]=P,t[56]=N,t[57]=c,t[58]=K,t[59]=$):$=t[59];let pe;t[60]===$?pe=t[61]:(pe=(0,G.jsx)(x,{children:$}),t[60]=$,t[61]=pe);let me;return t[62]!==J||t[63]!==de||t[64]!==pe?(me=(0,G.jsxs)(`div`,{className:`relative`,children:[J,de,pe]}),t[62]=J,t[63]=de,t[64]=pe,t[65]=me):me=t[65],me}function xe(e){let t=(0,L.c)(28),{onClick:n,prefersReducedMotion:r}=e,i=ee(),a;t[0]===i?a=t[1]:(a=i.formatMessage(Q.showLatestNotifications),t[0]=i,t[1]=a);let o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o={opacity:1,scale:1,x:`-50%`},t[2]=o):o=t[2];let s=r?1:.96,c;t[3]===s?c=t[4]:(c={opacity:0,scale:s,x:`-50%`},t[3]=s,t[4]=c);let l=r?1:.96,u;t[5]===l?u=t[6]:(u={opacity:0,scale:l,x:`-50%`},t[5]=l,t[6]=u);let d;t[7]===r?d=t[8]:(d=r?{duration:0}:{duration:.14,ease:`easeOut`},t[7]=r,t[8]=d);let f;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(f=v(_e,`top-1 min-w-12`),t[9]=f):f=t[9];let p;t[10]===r?p=t[11]:(p=r?void 0:{scale:1.03},t[10]=r,t[11]=p);let m;t[12]===r?m=t[13]:(m=r?void 0:{scale:.96},t[12]=r,t[13]=m);let h;t[14]===i?h=t[15]:(h=i.formatMessage(Q.latestNotifications),t[14]=i,t[15]=h);let g;t[16]===h?g=t[17]:(g=(0,G.jsx)(`span`,{children:h}),t[16]=h,t[17]=g);let _;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,G.jsx)(D,{className:`icon-2xs hidden -rotate-90 opacity-70 group-hover:block group-focus:block`}),t[18]=_):_=t[18];let y;return t[19]!==n||t[20]!==a||t[21]!==m||t[22]!==g||t[23]!==c||t[24]!==u||t[25]!==d||t[26]!==p?(y=(0,G.jsxs)(S.button,{type:`button`,"aria-label":a,"data-avatar-overlay-hit-region":`notification-scroll-control`,animate:o,exit:c,initial:u,transition:d,className:f,whileHover:p,whileTap:m,onClick:n,children:[g,_]}),t[19]=n,t[20]=a,t[21]=m,t[22]=g,t[23]=c,t[24]=u,t[25]=d,t[26]=p,t[27]=y):y=t[27],y}function Se(e){let t=(0,L.c)(36),{count:n,onClick:r,prefersReducedMotion:i}=e,a=ee(),o;t[0]!==n||t[1]!==a?(o=a.formatMessage(Q.showOlderNotifications,{count:n}),t[0]=n,t[1]=a,t[2]=o):o=t[2];let s;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(s={opacity:1,scale:1,x:`-50%`},t[3]=s):s=t[3];let c=i?1:.96,l;t[4]===c?l=t[5]:(l={opacity:0,scale:c,x:`-50%`},t[4]=c,t[5]=l);let u=i?1:.96,d;t[6]===u?d=t[7]:(d={opacity:0,scale:u,x:`-50%`},t[6]=u,t[7]=d);let f;t[8]===i?f=t[9]:(f=i?{duration:0}:{duration:.14,ease:`easeOut`},t[8]=i,t[9]=f);let p;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(p=v(_e,`bottom-1 min-w-9`),t[10]=p):p=t[10];let m;t[11]===i?m=t[12]:(m=i?void 0:{scale:1.03},t[11]=i,t[12]=m);let h;t[13]===i?h=t[14]:(h=i?void 0:{scale:.96},t[13]=i,t[14]=h);let g;t[15]!==n||t[16]!==a?(g=a.formatMessage(Q.compactOlderNotificationCount,{count:n}),t[15]=n,t[16]=a,t[17]=g):g=t[17];let _;t[18]===g?_=t[19]:(_=(0,G.jsx)(`span`,{className:`group-hover:hidden group-focus:hidden`,children:g}),t[18]=g,t[19]=_);let y;t[20]!==n||t[21]!==a?(y=a.formatMessage(Q.olderNotificationCount,{count:n}),t[20]=n,t[21]=a,t[22]=y):y=t[22];let b;t[23]===y?b=t[24]:(b=(0,G.jsx)(`span`,{className:`hidden group-hover:inline group-focus:inline`,children:y}),t[23]=y,t[24]=b);let x;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,G.jsx)(D,{className:`icon-2xs hidden rotate-90 opacity-70 group-hover:block group-focus:block`}),t[25]=x):x=t[25];let C;return t[26]!==r||t[27]!==o||t[28]!==h||t[29]!==_||t[30]!==b||t[31]!==l||t[32]!==d||t[33]!==f||t[34]!==m?(C=(0,G.jsxs)(S.button,{type:`button`,"aria-label":o,"data-avatar-overlay-hit-region":`notification-scroll-control`,animate:s,exit:l,initial:d,transition:f,className:p,whileHover:m,whileTap:h,onClick:r,children:[_,b,x]}),t[26]=r,t[27]=o,t[28]=h,t[29]=_,t[30]=b,t[31]=l,t[32]=d,t[33]=f,t[34]=m,t[35]=C):C=t[35],C}function Ce(e,t){if(t<=fe)return e.scrollHeight;let n=Ae(e);return n[Me(n,je(e,n))+fe]?.offsetTop??e.scrollHeight}function we({isReplying:e,notification:t,notificationIndex:n,onDismissNotification:i,onCloseReply:o,onOpenReply:s,onRunNotificationAction:c,onSubmitNotificationReply:l,prefersReducedMotion:u,replyInputRef:d}){let f=ee(),p=r(a,t.source===`local`?t.localConversationId:null),m=p==null?null:X(p.items,f),h=ie(t),g=f.formatMessage(h.labelMessage),_=m??t.body??f.formatMessage(h.fallbackBodyMessage),b=_.replace(/[.?!]+$/,``),x=_===g?g:`${g}. ${b}`,C=t.action==null?`${t.title}. ${x}`:`${t.title}. ${x}. ${f.formatMessage(Q.openNotification)}`,w=t.action!=null,[T,E]=(0,R.useState)(!1),[k,A]=(0,R.useState)(!1),[M,N]=(0,R.useState)(``),[P,F]=(0,R.useState)(null),[I,L]=(0,R.useState)(!1),[z,ne]=(0,R.useState)(0),B=(0,R.useRef)(void 0),V=(0,R.useCallback)(e=>{if(B.current?.(),B.current=void 0,e==null)return;let t=()=>{let t=e.scrollHeight;ne(e=>e===t?e:t)};t(),B.current=te({axis:`height`,target:e,onChange:t})},[]),H=z>me+ge,U=H&&T&&!e,W=t.replyTarget!=null&&l!=null,K=M.trim(),re=u?{duration:0}:{duration:I?.2:.28,ease:[.16,1,.3,1]},q=async e=>{if(e.preventDefault(),e.stopPropagation(),!(!W||K.length===0||k)){A(!0),F(null);try{await l(t,K),N(``),o()}catch{F(f.formatMessage(Q.notificationReplyError))}finally{A(!1)}}};return(0,G.jsx)(S.div,{animate:{opacity:1,y:0},initial:{opacity:0,y:u?0:4},role:`listitem`,className:`group no-drag relative w-full snap-start scroll-mt-2 text-left`,transition:u?{duration:0}:{delay:Math.min(n,3)*pe,duration:.18,ease:`easeOut`},onBlurCapture:e=>{let t=e.relatedTarget;t instanceof Node&&e.currentTarget.contains(t)||L(!1)},onFocusCapture:()=>{L(!0)},onPointerEnter:()=>{L(!0)},onPointerLeave:()=>{L(!1)},children:(0,G.jsxs)(`div`,{className:v(`relative z-[1] overflow-hidden rounded-[18px] border border-token-border/60 bg-token-main-surface-primary shadow-[inset_0_1px_0_rgba(255,255,255,0.42),inset_0_-1px_0_rgba(0,0,0,0.08)] backdrop-blur-xl forced-colors:bg-[Canvas]`,w&&`transition-[background-color,border-color,box-shadow] duration-200 ease-[cubic-bezier(0.16,1,0.3,1)] hover:border-token-border/80 hover:bg-token-main-surface-primary hover:shadow-[inset_0_1px_0_rgba(255,255,255,0.52),inset_0_-1px_0_rgba(0,0,0,0.1)] motion-reduce:transition-none`),children:[(0,G.jsxs)(S.div,{role:w?`button`:void 0,className:v(`block w-full min-w-0 px-3 py-1.5 text-left focus-visible:outline-token-focus focus-visible:outline focus-visible:outline-offset-[-2px]`,w?`cursor-interaction`:`cursor-default`),tabIndex:w?0:void 0,transition:u?{duration:0}:{duration:.12,ease:`easeOut`},whileTap:w&&!u?{scale:.995}:void 0,"aria-label":w?C:void 0,onClick:()=>{w&&c?.(t)},onKeyDown:e=>{!w||e.key!==`Enter`&&e.key!==` `||(e.preventDefault(),c?.(t))},children:[(0,G.jsx)(`span`,{className:`flex min-w-0 items-center pr-7`,children:(0,G.jsx)(`span`,{className:`text-size-chat min-w-0 truncate leading-[17px] font-semibold text-token-foreground`,children:t.title})}),(0,G.jsx)(S.div,{animate:{maxHeight:U?he:me},className:v(`text-size-chat-sm mt-0.5 overflow-hidden leading-4 text-token-foreground`,U?`whitespace-pre-wrap`:`line-clamp-2`),initial:!1,transition:u?{duration:0}:{duration:.18,ease:`easeOut`},children:_})]}),(0,G.jsx)(`div`,{ref:V,"aria-hidden":`true`,className:`text-size-chat-sm pointer-events-none invisible absolute inset-x-3 top-0 -z-10 leading-4 whitespace-pre-wrap`,children:_}),(0,G.jsx)(`span`,{className:v(`pointer-events-none absolute top-1 right-1 z-0 flex size-6 items-center justify-center opacity-100`,H&&I&&`opacity-0 transition-opacity duration-150 motion-reduce:transition-none`),children:Ne(h)}),H?(0,G.jsx)(S.div,{animate:{opacity:I?1:0,x:I?0:6},className:v(`absolute top-1 right-1 z-10`,I?`pointer-events-auto`:`pointer-events-none`),"data-avatar-overlay-control":`expand`,initial:!1,transition:re,children:(0,G.jsx)(O,{align:`end`,side:`top`,tooltipContent:f.formatMessage(T?Q.collapseNotificationTooltip:Q.expandNotificationTooltip),children:(0,G.jsx)(y,{className:v(`size-6`,ve),color:`ghost`,size:`icon`,"aria-expanded":T,"aria-label":f.formatMessage(T?Q.collapseNotification:Q.expandNotification,{title:t.title}),onClick:()=>{E(e=>!e)},children:(0,G.jsx)(S.span,{animate:{rotate:T?90:0},transition:u?{duration:0}:{duration:.12,ease:`easeOut`},children:(0,G.jsx)(D,{className:`icon-xs`})})})})}):null,W&&!e?(0,G.jsx)(S.div,{animate:{opacity:I?1:0,x:I?0:6},className:v(`no-drag absolute right-2 bottom-1 z-10`,I?`pointer-events-auto`:`pointer-events-none`),"data-avatar-overlay-control":`reply`,initial:!1,transition:re,children:(0,G.jsx)(`div`,{className:`flex justify-end pb-1`,children:(0,G.jsx)(y,{className:v(`h-5 px-2 text-xs leading-none text-token-foreground shadow-[0px_5px_10px_-7px_rgba(0,0,0,0.22)]`,ve),color:`outline`,size:`default`,"aria-label":f.formatMessage(Q.replyNotification,{title:t.title}),onClick:e=>{e.stopPropagation(),F(null),N(``),s(),L(!0)},onPointerDown:e=>{e.stopPropagation()},children:f.formatMessage(Q.replyNotificationButton)})})}):null,e?(0,G.jsxs)(S.form,{className:`no-drag mx-3 mb-2 border-t border-token-border/60 pt-2`,animate:{opacity:1,y:0},initial:{opacity:0,y:u?0:-2},transition:u?{duration:0}:{duration:.16,ease:`easeOut`},onClick:e=>{e.stopPropagation()},onPointerDown:e=>{e.stopPropagation()},onSubmit:e=>{q(e)},children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,G.jsx)(`input`,{ref:d,className:`text-size-chat-sm h-6 min-w-0 flex-1 rounded-md border border-token-border bg-token-main-surface-primary px-2 text-token-foreground outline-none placeholder:text-token-text-tertiary focus:border-token-focus-border`,"aria-label":f.formatMessage(Q.replyNotification,{title:t.title}),autoFocus:!0,placeholder:f.formatMessage(Q.notificationReplyPlaceholder),value:M,onChange:e=>{N(e.currentTarget.value),F(null)},onKeyDown:e=>{e.key!==`Escape`||k||(e.stopPropagation(),o(),F(null))}}),(0,G.jsx)(y,{className:`h-6 px-2 text-xs`,color:`primary`,size:`default`,type:`submit`,"aria-label":f.formatMessage(Q.sendNotificationReply,{title:t.title}),disabled:K.length===0||k,loading:k,children:f.formatMessage(Q.replyNotificationButton)})]}),P==null?null:(0,G.jsx)(`div`,{className:`mt-1 text-[11px] leading-4 text-token-error-foreground`,role:`alert`,children:P})]}):null,i?(0,G.jsx)(S.div,{animate:{opacity:I?1:0,x:I?0:-6},className:v(`absolute top-1 left-1 z-20`,I?`pointer-events-auto`:`pointer-events-none`),"data-avatar-overlay-control":`dismiss`,initial:!1,transition:re,children:(0,G.jsx)(O,{align:`start`,side:`top`,tooltipContent:f.formatMessage(Q.dismissNotificationTooltip),children:(0,G.jsx)(y,{className:v(`[&>svg]:!icon-xs size-6 shadow-[0px_5px_10px_-7px_rgba(0,0,0,0.22)] enabled:hover:!text-token-foreground`,ve),color:`outline`,size:`icon`,"aria-label":f.formatMessage(Q.dismissNotification,{title:t.title}),onClick:()=>{i(t)},children:(0,G.jsx)(j,{className:`icon-xs`})})})}):null]})})}function Te(e,t=e.scrollTop){if(!Oe(e))return{hasLatestNotificationsAbove:!1,hiddenOlderNotificationCount:0};if(De(e,t))return{hasLatestNotificationsAbove:!0,hiddenOlderNotificationCount:0};let n=Ae(e),r=je(e,n,t);return{hasLatestNotificationsAbove:t>$,hiddenOlderNotificationCount:ke(e,n,r)}}function Ee(e,t){return e.hasLatestNotificationsAbove===t.hasLatestNotificationsAbove&&e.hiddenOlderNotificationCount===t.hiddenOlderNotificationCount}function De(e,t=e.scrollTop){let n=Math.max(0,e.scrollHeight-e.clientHeight);return Oe(e)&&t>=n-$}function Oe(e){return e.scrollHeight>e.clientHeight+$}function ke(e,t,n){let r=n+e.clientHeight-$;return t.filter(e=>e.offsetTop+e.offsetHeight>r).length}function Ae(e){return Array.from(e.children).filter(e=>e instanceof HTMLElement)}function je(e,t,n=e.scrollTop){return n+(t[0]?.offsetTop??0)+$}function Me(e,t){let n=0;for(let r=0;r<e.length;r+=1)e[r].offsetTop<=t&&(n=r);return n}function Ne(e){switch(e.iconType){case`check-circle`:return(0,G.jsx)(F,{className:e.iconClassName});case`clock`:return(0,G.jsx)(N,{className:e.iconClassName});case`spinner`:return(0,G.jsx)(b,{className:e.iconClassName});case`warning`:return(0,G.jsx)(A,{className:e.iconClassName})}}var Pe=180*1e3,Fe=3600*1e3,Ie=1440*60*1e3,Le=10080*60*1e3;function Re({dismissedNotificationTurnKeys:e,nowMs:t=Date.now(),sessions:n}){let r=[],i=null;for(let a of n){let n=ze(a,t);n!=null&&e?.get(n.notification.id)!==n.notification.turnKey&&(n.expiresAtMs!=null&&(i==null||n.expiresAtMs<i)&&(i=n.expiresAtMs),r.push(n))}return{nextThreadNotificationExpiresAtMs:i,notifications:r.sort(He).map(e=>e.notification)}}function ze(e,t){if(e.status===`idle`)return null;let n=Be(e.status,e.updatedAtMs);return n!=null&&t>=n?null:{expiresAtMs:n,key:e.key,notification:{action:{path:e.actionPath},body:e.subtitle,expiresAtMs:n,id:e.key,isLoading:e.status===`running`,level:Ve(e.status),localConversationId:e.localConversationId,replyTarget:e.localConversationId==null?null:{conversationId:e.localConversationId},source:e.source,title:e.title,turnKey:e.turnKey,updatedAtMs:e.updatedAtMs},notificationPriority:Ue(e.status),updatedAtMs:e.updatedAtMs}}function Be(e,t){switch(e){case`running`:return t+Pe;case`failed`:return t+Fe;case`waiting`:return t+Ie;case`review`:return t+Le;case`idle`:return null}}function Ve(e){switch(e){case`waiting`:return`warning`;case`failed`:return`danger`;case`running`:return`info`;case`review`:return`success`;case`idle`:return`info`}}function He(e,t){let n=e.notificationPriority-t.notificationPriority;if(n!==0)return n;let r=t.updatedAtMs-e.updatedAtMs;return r===0?e.key.localeCompare(t.key):r}function Ue(e){switch(e){case`waiting`:return 0;case`failed`:return 1;case`review`:return 2;case`running`:return 3;case`idle`:return 4}}var We=15e3,Ge=4,Ke=[`[data-avatar-overlay-hit-region]`,`[data-avatar-mascot='true']`],qe=`.codex-avatar-root`,Je=`[data-avatar-overlay-size='notification-tray']`,Ye=`[data-avatar-overlay-size='notification-tray-header']`,Xe=`[data-avatar-overlay-size='notification-tray-list']`,Ze={mascot:{left:244,top:191,width:112,height:121},placement:`top-end`,tray:{left:80,top:56,width:276,height:131},viewport:{width:356,height:320}};function Qe(){let e=(0,L.c)(2);if(!g(`2679188970`)){let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,G.jsx)(G.Fragment,{}),e[0]=t):t=e[0],t}let t;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,G.jsx)($e,{}),e[1]=t):t=e[1],t}function $e(){let e=(0,L.c)(46),t=ee(),{avatarOptions:n}=w(),{selectedAvatar:r}=T(n),[i,a]=(0,R.useState)(Ze),[o,s]=(0,R.useState)(null),[c,l]=(0,R.useState)(!0),[d,h]=(0,R.useState)(!1),[g,v]=(0,R.useState)(lt),[y,b]=(0,R.useState)(ct),{data:x,refetch:S}=_(),C=x===void 0?[]:x,E;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(E={taskFilter:`current`,limit:20},e[0]=E):E=e[0];let{data:D,refetch:O}=u(E),k=ae({intl:t,localConversations:C,remoteTasks:D===void 0?[]:D}),{nextThreadNotificationExpiresAtMs:A,notifications:j}=Re({dismissedNotificationTurnKeys:g,nowMs:y,sessions:k}),M=re(j),N=k.some(st),te=k.some(ot),P=(0,R.useRef)(null),F=(0,R.useRef)(null),z=(0,R.useRef)(null),ne;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(ne={interactiveRegionRef:F,isPaused:()=>P.current!=null,onInteractiveChange:at,regionElementSelectors:Ke},e[1]=ne):ne=e[1],I(ne);let B;e[2]!==c||e[3]!==j.length?(B=()=>{let e=dt(F.current);if(e==null)return;let t={...e,isTrayVisible:c&&j.length>0};ht(z.current,t)||(z.current=t,f.dispatchMessage(`avatar-overlay-element-size-changed`,{isTrayVisible:t.isTrayVisible,mascot:t.mascot,tray:t.tray}))},e[2]=c,e[3]=j.length,e[4]=B):B=e[4];let W=B,K;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(K=(e,t)=>{let{releaseSample:n,shouldOpenMainWindow:r}=t,i=P.current;if(i==null||i.pointerId!==e)return;P.current=null,h(!1),s(null);let a=n==null?null:H(i,n);F.current?.hasPointerCapture?.(e)&&F.current.releasePointerCapture?.(e),r&&i.startedOnMascot&&!i.hasMoved&&f.dispatchMessage(`open-current-main-window`,{}),f.dispatchMessage(`avatar-overlay-drag-end`,{}),a!=null&&f.dispatchMessage(`avatar-overlay-drag-release`,{velocityX:a.x,velocityY:a.y})},e[5]=K):K=e[5];let q=K,J;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(J=e=>{e.button!==0||!(e.target instanceof Element)||e.target.closest(`.no-drag`)!=null||(e.preventDefault(),e.currentTarget.setPointerCapture?.(e.pointerId),P.current={startedOnMascot:e.target.closest(`[data-avatar-mascot="true"]`)!=null,hasMoved:!1,pointerId:e.pointerId,samples:[V(e)],screenX:e.screenX,screenY:e.screenY},f.dispatchMessage(`avatar-overlay-drag-start`,{pointerWindowX:e.clientX,pointerWindowY:e.clientY}),h(!0),s(null))},e[6]=J):J=e[6];let ie=J,Y;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(Y=e=>{let t=P.current;if(t==null||t.pointerId!==e.pointerId)return;let n=V(e);t.samples=U([...t.samples,n]);let r=n.screenX-t.screenX,i=n.screenY-t.screenY;Math.abs(r)<Ge&&Math.abs(i)<Ge||(t.hasMoved=!0,t.screenX=n.screenX,t.screenY=n.screenY,s(e=>ut({currentDragState:e,deltaX:r})),f.dispatchMessage(`avatar-overlay-drag-move`,{}))},e[7]=Y):Y=e[7];let oe=Y,se;e[8]===Symbol.for(`react.memo_cache_sentinel`)?(se=e=>{q(e.pointerId,{releaseSample:V(e),shouldOpenMainWindow:!0})},e[8]=se):se=e[8];let ce=se,X;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(X=e=>{q(e.pointerId,{shouldOpenMainWindow:!1})},e[9]=X):X=e[9];let le=X,Z;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(Z=e=>{q(e.pointerId,{shouldOpenMainWindow:!1})},e[10]=Z):Z=e[10];let ue=Z,de=it,Q;e[11]===Symbol.for(`react.memo_cache_sentinel`)?(Q=e=>{v(t=>{if(t.get(e.id)===e.turnKey)return t;let n=new Map(t);return n.set(e.id,e.turnKey),n})},e[11]=Q):Q=e[11];let fe=Q,$=rt,pe=nt,me,he;e[12]===Symbol.for(`react.memo_cache_sentinel`)?(me=e=>{let{layout:t}=e;a(t)},he=[],e[12]=me,e[13]=he):(me=e[12],he=e[13]),p(`avatar-overlay-layout-changed`,me,he);let ge,_e;e[14]===Symbol.for(`react.memo_cache_sentinel`)?(ge=()=>{let e=e=>{q(e.pointerId,{releaseSample:V(e),shouldOpenMainWindow:!0})},t=e=>{q(e.pointerId,{shouldOpenMainWindow:!1})};return window.addEventListener(`pointerup`,e),window.addEventListener(`pointercancel`,t),()=>{window.removeEventListener(`pointerup`,e),window.removeEventListener(`pointercancel`,t)}},_e=[q],e[14]=ge,e[15]=_e):(ge=e[14],_e=e[15]),(0,R.useEffect)(ge,_e);let ve;e[16]===W?ve=e[17]:(ve=()=>{let e=null,t=()=>{e??=window.requestAnimationFrame(()=>{e=null,W()})},n=new ResizeObserver(t),r=F.current;if(r!=null){n.observe(r);for(let e of r.querySelectorAll(`${qe}, ${Je}`))n.observe(e)}return window.addEventListener(`resize`,t),t(),()=>{e!=null&&window.cancelAnimationFrame(e),n.disconnect(),window.removeEventListener(`resize`,t)}},e[16]=W,e[17]=ve);let be;e[18]!==M||e[19]!==W||e[20]!==r.id?(be=[W,r.id,M],e[18]=M,e[19]=W,e[20]=r.id,e[21]=be):be=e[21],(0,R.useLayoutEffect)(ve,be);let xe;e[22]===W?xe=e[23]:(xe=()=>{W()},e[22]=W,e[23]=xe);let Se;e[24]!==c||e[25]!==M||e[26]!==W||e[27]!==r.id?(Se=[c,W,r.id,M],e[24]=c,e[25]=M,e[26]=W,e[27]=r.id,e[28]=Se):Se=e[28],(0,R.useLayoutEffect)(xe,Se);let Ce,we;e[29]!==N||e[30]!==te||e[31]!==A||e[32]!==S||e[33]!==O?(Ce=()=>{let e=N||te;if(!e&&A==null)return;let t=We,n=e;if(A!=null){let e=Math.max(0,A-Date.now());e<We&&(t=e,n=!1)}let r=window.setTimeout(()=>{b(tt),n&&(N&&S(),te&&O())},t);return()=>{window.clearTimeout(r)}},we=[N,te,A,S,O],e[29]=N,e[30]=te,e[31]=A,e[32]=S,e[33]=O,e[34]=Ce,e[35]=we):(Ce=e[34],we=e[35]),(0,R.useEffect)(Ce,we);let Te;e[36]===Symbol.for(`react.memo_cache_sentinel`)?(Te=[{id:`close-avatar`,message:m({id:`petOverlay.closePet`,defaultMessage:`Close pet`,description:`Context menu item that closes the floating Codex pet`}),onSelect:et}],e[36]=Te):Te=e[36];let Ee;e[37]===Symbol.for(`react.memo_cache_sentinel`)?(Ee=()=>{l(!1)},e[37]=Ee):Ee=e[37];let De;e[38]===Symbol.for(`react.memo_cache_sentinel`)?(De=()=>{l(!0)},e[38]=De):De=e[38];let Oe;return e[39]!==d||e[40]!==c||e[41]!==i||e[42]!==o||e[43]!==j||e[44]!==r?(Oe=(0,G.jsx)(ye,{avatar:r,avatarMenuItems:Te,interactiveRegionRef:F,isDragging:d,isNotificationTrayOpen:c,layout:i,mascotDragState:o,notifications:j,onCloseNotificationTray:Ee,onLostPointerCapture:ue,onPointerCancel:le,onPointerDown:ie,onPointerMove:oe,onPointerUp:ce,onDismissNotification:fe,onNotificationReplyEditorActiveChange:pe,onRunNotificationAction:de,onSubmitNotificationReply:$,onOpenNotificationTray:De}),e[39]=d,e[40]=c,e[41]=i,e[42]=o,e[43]=j,e[44]=r,e[45]=Oe):Oe=e[45],Oe}function et(){f.dispatchMessage(`avatar-overlay-open`,{})}function tt(e){return Math.max(Date.now(),e+1)}function nt(e){f.dispatchMessage(`avatar-overlay-keyboard-interaction-changed`,{isInteractive:e})}async function rt(e,t){if(e.replyTarget==null)return;let n=t.trim();n.length!==0&&await c(`send-follow-up-message`,{conversationId:e.replyTarget.conversationId,prompt:n})}function it(e){e.action!=null&&f.dispatchMessage(`open-in-main-window`,{path:e.action.path})}function at(e){f.dispatchMessage(`avatar-overlay-pointer-interaction-changed`,{isInteractive:e})}function ot(e){return e.source===`cloud`&&e.status===`running`}function st(e){return e.source!==`cloud`&&e.status===`running`}function ct(){return Date.now()}function lt(){return new Map}function ut({currentDragState:e,deltaX:t}){return t>=Ge?`running-right`:t<=-Ge?`running-left`:e}function dt(e){if(e==null)return null;let t=ft(e.querySelector(qe)),n=ft(e.querySelector(Je));return t==null?null:{mascot:t,tray:n}}function ft(e){if(e==null||_t(e))return null;let t=e.getBoundingClientRect();return t.width<=0||t.height<=0?null:{width:Math.ceil(pt(e,t)),height:Math.ceil(mt(e,t))}}function pt(e,t){return e.matches(Je)&&e.offsetWidth>0?e.offsetWidth:t.width}function mt(e,t){if(!e.matches(Je))return t.height;let n=e.querySelector(Ye),r=e.querySelector(Xe);return n==null||r==null?t.height:n.getBoundingClientRect().height+r.scrollHeight}function ht(e,t){return e!=null&&e.isTrayVisible===t.isTrayVisible&&e.mascot.width===t.mascot.width&&e.mascot.height===t.mascot.height&&gt(e.tray,t.tray)}function gt(e,t){return e===t||e!=null&&t!=null&&e.width===t.width&&e.height===t.height}function _t(e){return window.getComputedStyle(e).display===`none`}export{Qe as AvatarOverlayPage};
import{s as e}from"./chunk-Bj-mKKzh.js";import{t}from"./react-BE0_fAZJ.js";import"./react-dom-BJ7hbTs6.js";import{t as n}from"./compiler-runtime-DaX1MIGd.js";import{_r as r,d as i}from"./vscode-api-Cq49c5Gl.js";import{M as a,Mt as o,dt as s,fr as c,pt as l}from"./app-server-manager-signals-B_sRWyjv.js";import{v as u}from"./codex-api-BrPxtxx7.js";import{t as d}from"./jsx-runtime-lEsnPbkx.js";import"./path-browserify-Chh2Zpai.js";import"./quote-cmd-oSxnEoQp.js";import{n as f,r as p}from"./message-bus-B_NkFI1i.js";import"./lib-D__qph_N.js";import{n as m,r as h,s as ee}from"./lib-BLZT-hpR.js";import"./statsig-gate-signal-D9LyAapF.js";import"./global-settings-D25jzi7K.js";import"./config-queries-C-qINdQW.js";import{o as g}from"./statsig-Dkgqty0N.js";import"./remote-connection-visibility-CohAyMKM.js";import{c as _}from"./app-server-manager-hooks-DEjiw62x.js";import"./persisted-signal-DdRKzKeP.js";import"./use-auth-C02AaUWN.js";import"./use-global-state-BskHB3H6.js";import{t as v}from"./clsx-C6dNMzYU.js";import{t as y}from"./button-CHLNjOGa.js";import{t as b}from"./spinner-0yJ08A3N.js";import{p as x,t as S}from"./proxy-DJsdifOb.js";import{a as C,n as w,r as T,t as E}from"./codex-avatar-3zmt6SG-.js";import"./_baseOrderBy-CREa02-B.js";import"./Combination-Bo00uhPV.js";import"./tooltip-dismiss-Dv-H1M90.js";import{t as D}from"./chevron-right-D-FrOwG7.js";import{t as O}from"./tooltip-97cpGmUj.js";import"./invalidate-queries-and-broadcast-aIUy1AGh.js";import{n as k,t as A}from"./warning-ljXs70iv.js";import{t as j}from"./x-D4MeO337.js";import"./request-DwX4Jn67.js";import{t as M}from"./chevron-oKKYr5lm.js";import{t as N}from"./clock-B9OrnZ-c.js";import{t as te}from"./create-resize-observer-D_RcpYfu.js";import{t as P}from"./is-subagent-conversation-CZmW3Qt-.js";import{t as F}from"./check-circle-filled-B-2NDdS-.js";import{t as I}from"./use-floating-window-pointer-interactivity-BZT8RRB7.js";var L=n(),R=e(t(),1),z=1600,ne=100,B=320;function V(e){return{screenX:e.screenX,screenY:e.screenY,timeMs:e.timeStamp}}function H(e,t){return e.hasMoved?W(U([...e.samples,t])):null}function U(e){let t=e.at(-1);return t==null?e:e.filter(e=>t.timeMs-e.timeMs<=ne)}function W(e){let t=e.at(-1);if(t==null)return null;let n=e.find(e=>t.timeMs-e.timeMs>16);if(n==null)return null;let r=(t.timeMs-n.timeMs)/1e3;if(r<=0)return null;let i={x:(t.screenX-n.screenX)/r,y:(t.screenY-n.screenY)/r},a=Math.hypot(i.x,i.y);if(a<B)return null;if(a<=1600)return i;let o=z/a;return{x:i.x*o,y:i.y*o}}var G=d();function K(e){let t=(0,L.c)(20),{ariaLabel:n,assetRef:r,className:i,notificationBadge:a,onContextMenu:o,spritesheetUrl:s,state:c,transientState:l}=e,u=c===void 0?`idle`:c,[d,f]=(0,R.useState)(!1),p=C(),m=l??(d?`jumping`:u),h=a!=null,ee;n!=null&&(ee=h?`group`:`img`);let g;t[0]===i?g=t[1]:(g=v(`relative flex size-20 cursor-interaction items-center justify-center active:cursor-grabbing`,i),t[0]=i,t[1]=g);let _=n==null&&!h?!0:void 0,y,b;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(y=()=>{f(!0)},b=()=>{f(!1)},t[2]=y,t[3]=b):(y=t[2],b=t[3]);let x;t[4]!==r||t[5]!==m||t[6]!==s?(x=(0,G.jsx)(E,{assetRef:r,className:`relative z-10`,spritesheetUrl:s,state:m}),t[4]=r,t[5]=m,t[6]=s,t[7]=x):x=t[7];let w;t[8]!==h||t[9]!==a||t[10]!==p?(w=h?(0,G.jsx)(S.button,{type:`button`,animate:{opacity:1,scale:1,y:0},"aria-label":a.ariaLabel,className:v(`no-drag absolute top-0 right-0 z-20 flex cursor-interaction items-center justify-center rounded-full border border-token-border/60 text-xs leading-none font-medium shadow-sm focus-visible:ring-2 focus-visible:ring-token-focus-border focus-visible:outline-none`,a.isIconOnly?`size-7 p-0`:`min-h-7 min-w-7 px-2 py-1`),"data-testid":`avatar-overlay-notification-badge`,initial:{opacity:0,scale:p?1:.7,y:p?0:3},onClick:a.onClick,style:{backgroundColor:a.backgroundColor,color:a.foregroundColor},transition:p?{duration:0}:{damping:20,mass:.7,stiffness:420,type:`spring`},whileHover:p?void 0:{scale:1.06},whileTap:p?void 0:{scale:.94},children:a.content}):null,t[8]=h,t[9]=a,t[10]=p,t[11]=w):w=t[11];let T;return t[12]!==n||t[13]!==o||t[14]!==ee||t[15]!==g||t[16]!==_||t[17]!==x||t[18]!==w?(T=(0,G.jsxs)(`div`,{className:g,"data-avatar-mascot":`true`,"data-testid":`avatar-mascot-button`,"aria-hidden":_,"aria-label":n,role:ee,onContextMenu:o,onPointerEnter:y,onPointerLeave:b,children:[x,w]}),t[12]=n,t[13]=o,t[14]=ee,t[15]=g,t[16]=_,t[17]=x,t[18]=w,t[19]=T):T=t[19],T}function re(e){return e.map(e=>[e.id,e.title,e.body??``,e.level,e.isLoading?`loading`:`done`,e.action?.path??``].join(``)).join(`\0`)}var q=h({running:{id:`avatarOverlay.statusRunning`,defaultMessage:`Running`,description:`Status label shown for a loading notification`},runningFallbackBody:{id:`avatarOverlay.statusRunningSubtitle`,defaultMessage:`Thinking`,description:`Fallback body shown for a loading notification when no richer activity text is available`},waiting:{id:`avatarOverlay.statusWaiting`,defaultMessage:`Needs input`,description:`Status label shown for a notification waiting on user input`},review:{id:`avatarOverlay.statusReview`,defaultMessage:`Ready`,description:`Status label shown for a notification with unread completed output`},failed:{id:`avatarOverlay.statusFailed`,defaultMessage:`Blocked`,description:`Status label shown for a notification that failed`},info:{id:`avatarOverlay.statusInfo`,defaultMessage:`Info`,description:`Status label shown for an informational notification`}}),J={badgeBackgroundColor:`var(--color-token-activity-bar-badge-background)`,badgeForegroundColor:`var(--color-token-activity-bar-badge-foreground)`,fallbackBodyMessage:q.info,iconClassName:`icon-xs shrink-0 text-token-text-secondary`,iconType:`clock`,labelMessage:q.info,mascotState:`idle`};function ie(e){if(e==null)return J;if(e.isLoading)return{badgeBackgroundColor:`var(--color-token-activity-bar-badge-background)`,badgeForegroundColor:`var(--color-token-activity-bar-badge-foreground)`,fallbackBodyMessage:q.runningFallbackBody,iconClassName:`icon-xs shrink-0 text-token-text-secondary`,iconType:`spinner`,labelMessage:q.running,mascotState:`running`};switch(e.level){case`warning`:return{badgeBackgroundColor:`var(--color-token-editor-warning-foreground)`,badgeForegroundColor:`var(--color-token-bg-primary)`,fallbackBodyMessage:q.waiting,iconClassName:`icon-xs shrink-0 text-token-editor-warning-foreground`,iconType:`clock`,labelMessage:q.waiting,mascotState:`waiting`};case`danger`:return{badgeBackgroundColor:`var(--color-token-error-foreground)`,badgeForegroundColor:`var(--color-token-bg-primary)`,fallbackBodyMessage:q.failed,iconClassName:`icon-xs shrink-0 text-token-error-foreground`,iconType:`warning`,labelMessage:q.failed,mascotState:`failed`};case`success`:return{badgeBackgroundColor:`var(--color-token-charts-green)`,badgeForegroundColor:`var(--color-token-bg-primary)`,fallbackBodyMessage:q.review,iconClassName:`icon-xs shrink-0 text-token-charts-green`,iconType:`check-circle`,labelMessage:q.review,mascotState:`review`};case`info`:return J}}var Y=h({calledTool:{id:`avatarOverlay.session.calledTool`,defaultMessage:`Called tool`,description:`Avatar overlay activity subtitle for a completed generic tool call`},calledToolName:{id:`avatarOverlay.session.calledToolName`,defaultMessage:`Called {toolName}`,description:`Avatar overlay activity subtitle for a completed named tool call`},callingTool:{id:`avatarOverlay.session.callingTool`,defaultMessage:`Calling tool`,description:`Avatar overlay activity subtitle for a running generic tool call`},callingToolName:{id:`avatarOverlay.session.callingToolName`,defaultMessage:`Calling {toolName}`,description:`Avatar overlay activity subtitle for a running named tool call`},editedFiles:{id:`avatarOverlay.session.editedFiles`,defaultMessage:`Edited {fileCount, plural, one {# file} other {# files}}`,description:`Avatar overlay activity subtitle for completed file edits`},editingFiles:{id:`avatarOverlay.session.editingFiles`,defaultMessage:`Editing {fileCount, plural, one {# file} other {# files}}`,description:`Avatar overlay activity subtitle for running file edits`},listedFiles:{id:`avatarOverlay.session.listedFiles`,defaultMessage:`Listed files`,description:`Avatar overlay activity subtitle for a completed file listing command`},listingFiles:{id:`avatarOverlay.session.listingFiles`,defaultMessage:`Listing files`,description:`Avatar overlay activity subtitle for a running file listing command`},newThread:{id:`avatarOverlay.session.newThread`,defaultMessage:`New chat`,description:`Avatar overlay fallback title for a thread without a generated title`},ranCommand:{id:`avatarOverlay.session.ranCommand`,defaultMessage:`Ran command`,description:`Avatar overlay activity subtitle for a completed shell command`},readFile:{id:`avatarOverlay.session.readFile`,defaultMessage:`Read {fileName}`,description:`Avatar overlay activity subtitle for a completed file read`},readingFile:{id:`avatarOverlay.session.readingFile`,defaultMessage:`Reading {fileName}`,description:`Avatar overlay activity subtitle for a running file read`},runningCommand:{id:`avatarOverlay.session.runningCommand`,defaultMessage:`Running command`,description:`Avatar overlay activity subtitle for a running shell command`},searchedFiles:{id:`avatarOverlay.session.searchedFiles`,defaultMessage:`Searched files`,description:`Avatar overlay activity subtitle for a completed file search command without a query`},searchedQuery:{id:`avatarOverlay.session.searchedQuery`,defaultMessage:`Searched "{query}"`,description:`Avatar overlay activity subtitle for a completed search with a query`},searchedWeb:{id:`avatarOverlay.session.searchedWeb`,defaultMessage:`Searched web`,description:`Avatar overlay activity subtitle for a completed web search`},searchingFiles:{id:`avatarOverlay.session.searchingFiles`,defaultMessage:`Searching files`,description:`Avatar overlay activity subtitle for a running file search command without a query`},searchingQuery:{id:`avatarOverlay.session.searchingQuery`,defaultMessage:`Searching "{query}"`,description:`Avatar overlay activity subtitle for a running search with a query`}});function ae({intl:e,localConversations:t,remoteTasks:n}){let r=[],i=new Set;for(let n of t){let t=oe(n,e);t==null||i.has(t.key)||(i.add(t.key),r.push(t))}for(let t of n){let n=se(t,e);i.has(n.key)||(i.add(n.key),r.push(n))}return r}function oe(e,t){if(P(e))return null;let n=e.hostId??i,r=n===i?`local`:`remote-host`;return{actionPath:`/local/`+e.id,hostId:n,key:r+`:`+n+`:`+e.id,localConversationId:e.id,source:r,status:ue(e),subtitle:ce(e,t),title:s(e)??t.formatMessage(Y.newThread),turnKey:String(e.turns.length),updatedAtMs:e.updatedAt}}function se(e,t){let n=(e.updated_at??e.created_at??0)*1e3;return{actionPath:`/remote/`+e.id,hostId:null,key:`cloud:`+e.id,localConversationId:null,source:`cloud`,status:de(e),subtitle:null,title:e.title?.trim()||t.formatMessage(Y.newThread),turnKey:e.task_status_display?.latest_turn_status_display?.turn_id??null,updatedAtMs:n}}function ce(e,t){return X(e.turns.at(-1)?.items??[],t)}function X(e,t){for(let t=e.length-1;t>=0;--t){let n=e[t];if(n?.type===`reasoning`)for(let e=n.summary.length-1;e>=0;--e){let t=Z(n.summary[e]);if(t!=null)return t}if(n?.type===`agentMessage`){let e=Z(n.text);if(e!=null)return e}}for(let n=e.length-1;n>=0;--n){let r=le(e[n],t);if(r!=null)return r}return null}function le(e,t){if(e==null)return null;if(e.type===`commandExecution`){let n=e.commandActions.at(-1),r=e.status===`inProgress`;if(n==null)return r?t.formatMessage(Y.runningCommand):t.formatMessage(Y.ranCommand);switch(n.type){case`read`:return r?t.formatMessage(Y.readingFile,{fileName:n.name}):t.formatMessage(Y.readFile,{fileName:n.name});case`listFiles`:return r?t.formatMessage(Y.listingFiles):t.formatMessage(Y.listedFiles);case`search`:{let e=Z(n.query??``);return e==null?r?t.formatMessage(Y.searchingFiles):t.formatMessage(Y.searchedFiles):r?t.formatMessage(Y.searchingQuery,{query:e}):t.formatMessage(Y.searchedQuery,{query:e})}case`unknown`:return r?t.formatMessage(Y.runningCommand):t.formatMessage(Y.ranCommand)}}if(e.type===`fileChange`){let n=e.changes.length;return e.status===`inProgress`?t.formatMessage(Y.editingFiles,{fileCount:n}):t.formatMessage(Y.editedFiles,{fileCount:n})}if(e.type===`mcpToolCall`){let n=e.status===`inProgress`,r=Z(e.tool.replace(/[_-]+/g,` `));return r==null?n?t.formatMessage(Y.callingTool):t.formatMessage(Y.calledTool):n?t.formatMessage(Y.callingToolName,{toolName:r}):t.formatMessage(Y.calledToolName,{toolName:r})}if(e.type===`webSearch`){let n=Z(e.query);return n==null?t.formatMessage(Y.searchedWeb):t.formatMessage(Y.searchedQuery,{query:n})}return null}function Z(e){let t=l(e).replace(/\r?\n+/g,` `).replace(/^\s{0,3}#{1,6}\s+/g,``).replace(/\*\*([^*]+)\*\*/g,`$1`).replace(/__([^_]+)__/g,`$1`).replace(/`([^`]+)`/g,`$1`).replace(/\*([^*]+)\*/g,`$1`).replace(/_([^_]+)_/g,`$1`).replace(/\s+/g,` `).trim();return t.length>0?t:null}function ue(e){let t=e.resumeState===`needs_resume`?e.threadRuntimeStatus:null,n=e.resumeState===`needs_resume`?t?.type===`active`:e.resumeState===`resuming`||e.turns.at(-1)?.status===`inProgress`,r=e.resumeState===`needs_resume`?t?.type===`active`&&t.activeFlags.includes(`waitingOnUserInput`):e.requests.some(e=>e.method===`item/tool/requestUserInput`),i=e.resumeState===`needs_resume`?t?.type===`systemError`:e.turns.at(-1)?.status===`failed`;return o(e)||r?`waiting`:i?`failed`:n?`running`:e.hasUnreadTurn?`review`:`idle`}function de(e){if(e.archived)return`idle`;let t=e.task_status_display?.latest_turn_status_display?.turn_status;return t===`failed`||t===`cancelled`?`failed`:t===`in_progress`||t===`pending`?`running`:e.has_unread_turn?`review`:`idle`}var Q=h({mascotLabel:{id:`petOverlay.mascotLabel`,defaultMessage:`{petName} pet`,description:`Accessible label for the floating Codex pet`},openNotification:{id:`avatarOverlay.openNotification`,defaultMessage:`Open notification`,description:`Accessible label for an actionable row in the floating avatar notification tray`},dismissNotification:{id:`avatarOverlay.dismissNotification`,defaultMessage:`Dismiss {title}`,description:`Accessible label for dismissing a notification in the floating avatar notification tray`},dismissNotificationTooltip:{id:`avatarOverlay.dismissNotificationTooltip`,defaultMessage:`Dismiss`,description:`Tooltip for the icon button that dismisses a floating avatar notification`},replyNotification:{id:`avatarOverlay.replyNotification`,defaultMessage:`Reply to {title}`,description:`Accessible label for replying to a floating avatar notification`},replyNotificationButton:{id:`avatarOverlay.replyNotificationButton`,defaultMessage:`Reply`,description:`Compact button label for replying to a floating avatar notification`},sendNotificationReply:{id:`avatarOverlay.sendNotificationReply`,defaultMessage:`Send reply to {title}`,description:`Accessible label for submitting a floating avatar notification reply`},notificationReplyPlaceholder:{id:`avatarOverlay.notificationReplyPlaceholder`,defaultMessage:`Reply`,description:`Placeholder for the one-line floating avatar notification reply input`},notificationReplyError:{id:`avatarOverlay.notificationReplyError`,defaultMessage:`Unable to send reply`,description:`Compact error shown when a floating avatar notification reply fails`},expandNotification:{id:`avatarOverlay.expandNotification`,defaultMessage:`Expand {title}`,description:`Accessible label for expanding a floating avatar notification row`},collapseNotification:{id:`avatarOverlay.collapseNotification`,defaultMessage:`Collapse {title}`,description:`Accessible label for collapsing a floating avatar notification row`},expandNotificationTooltip:{id:`avatarOverlay.expandNotificationTooltip`,defaultMessage:`Expand`,description:`Tooltip for the icon button that expands a floating avatar notification`},collapseNotificationTooltip:{id:`avatarOverlay.collapseNotificationTooltip`,defaultMessage:`Collapse`,description:`Tooltip for the icon button that collapses a floating avatar notification`},collapseNotificationTray:{id:`avatarOverlay.collapseNotificationTray`,defaultMessage:`Collapse activity`,description:`Accessible label and tooltip for the button that collapses the floating avatar activity tray`},notificationList:{id:`avatarOverlay.notificationList`,defaultMessage:`Activity notifications`,description:`Accessible label for the scrollable list of floating avatar notifications`},latestNotifications:{id:`avatarOverlay.latestNotifications`,defaultMessage:`Latest`,description:`Label for the button that scrolls the floating avatar activity list back to the newest notifications`},showLatestNotifications:{id:`avatarOverlay.showLatestNotifications`,defaultMessage:`Show latest activity`,description:`Accessible label for the button that scrolls the floating avatar activity list back to the newest notifications`},showOlderNotifications:{id:`avatarOverlay.showOlderNotifications`,defaultMessage:`Show {count, plural, one {# older activity item} other {# older activity items}}`,description:`Accessible label for the button that scrolls the floating avatar activity list toward older notifications`},olderNotificationCount:{id:`avatarOverlay.olderNotificationCount`,defaultMessage:`{count, plural, one {# more} other {# more}}`,description:`Label for the button that shows there are more floating avatar activity notifications below`},compactOlderNotificationCount:{id:`avatarOverlay.compactOlderNotificationCount`,defaultMessage:`+{count}`,description:`Compact label for the edge button that shows hidden floating avatar activity notifications`}}),fe=2,$=2,pe=.035,me=240,he=900,ge=1,_e=`group no-drag absolute left-1/2 z-10 flex h-5 cursor-interaction items-center justify-center gap-0.5 rounded-full border border-token-border bg-token-main-surface-primary px-2 text-[10px] leading-none font-medium text-token-text-secondary shadow-[0px_5px_10px_-7px_rgba(0,0,0,0.22)] backdrop-blur hover:text-token-foreground hover:shadow-[0px_7px_14px_-9px_rgba(0,0,0,0.26)] focus-visible:ring-1 focus-visible:ring-token-focus-border focus-visible:outline-none forced-colors:bg-[Canvas]`,ve=`!bg-token-main-surface-primary enabled:hover:!bg-[color-mix(in_srgb,var(--color-token-main-surface-primary)_94%,var(--color-token-foreground))]`;function ye(e){let t=(0,L.c)(62),{avatar:n,avatarMenuItems:r,interactiveRegionRef:i,isDragging:a,isNotificationTrayOpen:o,layout:s,mascotDragState:c,notifications:l,onLostPointerCapture:u,onCloseNotificationTray:d,onPointerCancel:f,onPointerDown:p,onPointerMove:m,onPointerUp:h,onDismissNotification:g,onRunNotificationAction:_,onNotificationReplyEditorActiveChange:y,onSubmitNotificationReply:b,onOpenNotificationTray:x}=e,w=a===void 0?!1:a,T=o===void 0?!0:o,E=ee(),D=C(),O;t[0]===l[0]?O=t[1]:(O=ie(l[0]),t[0]=l[0],t[1]=O);let A=O,j=l.length>0,N=j&&T,te=s.placement.startsWith(`top`),P=s.placement.endsWith(`end`),F=s.tray==null?void 0:Math.max(0,s.tray.height),I=`${te?`bottom`:`top`} ${P?`right`:`left`}`,R;if(N){let e;t[2]===E?e=t[3]:(e=E.formatMessage(Q.collapseNotificationTray),t[2]=E,t[3]=e);let n;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,G.jsx)(M,{className:`icon-xs opacity-80`}),t[4]=n):n=t[4];let r;t[5]!==d||t[6]!==e?(r={ariaLabel:e,backgroundColor:`var(--color-token-bg-primary)`,content:n,foregroundColor:`var(--color-token-text-secondary)`,isIconOnly:!0,onClick:d},t[5]=d,t[6]=e,t[7]=r):r=t[7],R=r}else if(j){let e;t[8]!==E||t[9]!==l.length?(e=E.formatMessage({id:`avatarOverlay.toggleNotificationTray`,defaultMessage:`Open activity tray, {count, plural, one {# item} other {# items}}`,description:`Accessible label for the floating avatar activity count button`},{count:l.length}),t[8]=E,t[9]=l.length,t[10]=e):e=t[10];let n;t[11]!==l.length||t[12]!==x||t[13]!==A.badgeBackgroundColor||t[14]!==A.badgeForegroundColor||t[15]!==e?(n={ariaLabel:e,backgroundColor:A.badgeBackgroundColor,content:l.length,foregroundColor:A.badgeForegroundColor,onClick:x},t[11]=l.length,t[12]=x,t[13]=A.badgeBackgroundColor,t[14]=A.badgeForegroundColor,t[15]=e,t[16]=n):n=t[16],R=n}let z;t[17]!==j||t[18]!==N||t[19]!==s.tray||t[20]!==l||t[21]!==g||t[22]!==y||t[23]!==_||t[24]!==b||t[25]!==D||t[26]!==F||t[27]!==I?(z=j?(0,G.jsx)(`div`,{"aria-hidden":N?void 0:!0,"data-avatar-overlay-hit-region":`notification-tray`,inert:!N,className:`absolute cursor-interaction text-sm text-token-foreground`,style:{height:s.tray?.height,left:s.tray?.left,pointerEvents:N?void 0:`none`,top:s.tray?.top,visibility:s.tray==null?`hidden`:void 0,width:s.tray?.width},children:(0,G.jsxs)(S.div,{animate:{opacity:N?1:0,scale:N||D?1:.97,y:N||D?0:8},className:`relative min-w-[560px] overflow-hidden [corner-shape:superellipse(1.5)]`,"data-avatar-overlay-size":`notification-tray`,initial:!1,style:{maxHeight:F,transformOrigin:I},transition:D?{duration:0}:{damping:26,mass:.8,stiffness:360,type:`spring`},children:[(0,G.jsx)(`div`,{className:`h-0 overflow-hidden`,"data-avatar-overlay-size":`notification-tray-header`}),(0,G.jsx)(`div`,{children:(0,G.jsx)(be,{isNotificationTrayVisible:N,notifications:l,prefersReducedMotion:!!D,trayMaxHeight:F,onDismissNotification:g,onRunNotificationAction:_,onNotificationReplyEditorActiveChange:y,onSubmitNotificationReply:b})})]})}):null,t[17]=j,t[18]=N,t[19]=s.tray,t[20]=l,t[21]=g,t[22]=y,t[23]=_,t[24]=b,t[25]=D,t[26]=F,t[27]=I,t[28]=z):z=t[28];let ne=w?`scale-95 transition-transform`:`transition-none`,B;t[29]===ne?B=t[30]:(B=v(`absolute duration-[160ms] ease-out [@media(prefers-reduced-motion:reduce)]:transition-none`,ne),t[29]=ne,t[30]=B);let V;t[31]!==s.mascot.height||t[32]!==s.mascot.left||t[33]!==s.mascot.top||t[34]!==s.mascot.width?(V={height:s.mascot.height,left:s.mascot.left,top:s.mascot.top,width:s.mascot.width},t[31]=s.mascot.height,t[32]=s.mascot.left,t[33]=s.mascot.top,t[34]=s.mascot.width,t[35]=V):V=t[35];let H;t[36]!==n.displayName||t[37]!==E?(H=E.formatMessage(Q.mascotLabel,{petName:n.displayName}),t[36]=n.displayName,t[37]=E,t[38]=H):H=t[38];let U;t[39]!==n.assetRef||t[40]!==n.spritesheetUrl||t[41]!==c||t[42]!==R||t[43]!==A.mascotState||t[44]!==H?(U=(0,G.jsx)(K,{ariaLabel:H,assetRef:n.assetRef,spritesheetUrl:n.spritesheetUrl,notificationBadge:R,state:A.mascotState,transientState:c}),t[39]=n.assetRef,t[40]=n.spritesheetUrl,t[41]=c,t[42]=R,t[43]=A.mascotState,t[44]=H,t[45]=U):U=t[45];let W;t[46]!==B||t[47]!==V||t[48]!==U?(W=(0,G.jsx)(`div`,{"data-avatar-overlay-hit-region":`mascot`,className:B,style:V,children:U}),t[46]=B,t[47]=V,t[48]=U,t[49]=W):W=t[49];let re;t[50]!==r||t[51]!==W?(re=(0,G.jsx)(k,{items:r,children:W}),t[50]=r,t[51]=W,t[52]=re):re=t[52];let q;return t[53]!==i||t[54]!==u||t[55]!==f||t[56]!==p||t[57]!==m||t[58]!==h||t[59]!==re||t[60]!==z?(q=(0,G.jsx)(`main`,{className:`relative h-screen w-screen overflow-hidden bg-transparent`,children:(0,G.jsxs)(`section`,{ref:i,"data-avatar-overlay-content-frame":`true`,className:`relative h-full w-full cursor-grab active:cursor-grabbing`,onLostPointerCapture:u,onPointerCancel:f,onPointerDown:p,onPointerMove:m,onPointerUp:h,children:[z,re]})}),t[53]=i,t[54]=u,t[55]=f,t[56]=p,t[57]=m,t[58]=h,t[59]=re,t[60]=z,t[61]=q):q=t[61],q}function be(e){let t=(0,L.c)(66),{isNotificationTrayVisible:n,notifications:r,onDismissNotification:i,onNotificationReplyEditorActiveChange:a,onRunNotificationAction:o,onSubmitNotificationReply:s,prefersReducedMotion:c,trayMaxHeight:l}=e,u=ee(),d=(0,R.useRef)(null),f;t[0]===r?f=t[1]:(f=re(r),t[0]=r,t[1]=f);let m=f,h=r.length>fe,g=Math.max(0,r.length-fe),_;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(_={hasLatestNotificationsAbove:!1,hiddenOlderNotificationCount:0},t[2]=_):_=t[2];let[y,b]=(0,R.useState)(_),[C,w]=(0,R.useState)(null),T=(0,R.useRef)(null),E;t[3]!==r||t[4]!==C?(E=r.some(e=>e.id===C)?C:null,t[3]=r,t[4]=C,t[5]=E):E=t[5];let D=E,O=D!=null&&n,k,A;t[6]!==O||t[7]!==a?(k=()=>{if(O)return a?.(!0),()=>{a?.(!1)}},A=[O,a],t[6]=O,t[7]=a,t[8]=k,t[9]=A):(k=t[8],A=t[9]),(0,R.useEffect)(k,A);let j,M;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(j=()=>{T.current?.focus()},M=[],t[10]=j,t[11]=M):(j=t[10],M=t[11]),p(`avatar-overlay-keyboard-interaction-ready`,j,M);let N=Math.min(y.hiddenOlderNotificationCount,g),te=h&&y.hasLatestNotificationsAbove,P=h&&N>0,F;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(F=e=>{b(t=>{let n=Te(e);return Ee(t,n)?t:n})},t[12]=F):F=t[12];let I=F,z;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(z=e=>{d.current=e,e!=null&&I(e)},t[13]=z):z=t[13];let ne=z,B;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(B=()=>{let e=d.current;e!=null&&I(e)},t[14]=B):B=t[14];let V;t[15]!==m||t[16]!==l?(V=[m,l,I],t[15]=m,t[16]=l,t[17]=V):V=t[17],(0,R.useLayoutEffect)(B,V);let H;t[18]===c?H=t[19]:(H=()=>{let e=d.current;e!=null&&(e.scrollTo({behavior:c?`auto`:`smooth`,top:0}),b(Te(e,0)))},t[18]=c,t[19]=H);let U=H,W;t[20]!==N||t[21]!==c?(W=()=>{let e=d.current;if(e==null)return;let t=Ce(e,N);e.scrollTo({behavior:c?`auto`:`smooth`,top:t}),b(Te(e,t))},t[20]=N,t[21]=c,t[22]=W):W=t[22];let K=W,q;t[23]!==te||t[24]!==c||t[25]!==U?(q=te?(0,G.jsx)(xe,{prefersReducedMotion:c,onClick:U},`latest`):null,t[23]=te,t[24]=c,t[25]=U,t[26]=q):q=t[26];let J;t[27]===q?J=t[28]:(J=(0,G.jsx)(x,{children:q}),t[27]=q,t[28]=J);let ie=n?1:0,Y=n||c?0:3,ae;t[29]!==ie||t[30]!==Y?(ae={opacity:ie,y:Y},t[29]=ie,t[30]=Y,t[31]=ae):ae=t[31];let oe;t[32]===u?oe=t[33]:(oe=u.formatMessage(Q.notificationList),t[32]=u,t[33]=oe);let se=h&&`snap-y snap-mandatory`,ce;t[34]===se?ce=t[35]:(ce=v(`vertical-scroll-fade-mask scrollbar-on-hover flex flex-col gap-1.5 overflow-y-auto px-1.5 pt-1 pb-0 [--edge-fade-distance:0.75rem]`,se),t[34]=se,t[35]=ce);let X;t[36]===l?X=t[37]:(X={maxHeight:l},t[36]=l,t[37]=X);let le;t[38]===c?le=t[39]:(le=c?{duration:0}:{duration:.16,ease:`easeOut`},t[38]=c,t[39]=le);let Z;t[40]===Symbol.for(`react.memo_cache_sentinel`)?(Z=e=>{let t=Te(e.currentTarget);b(e=>Ee(e,t)?e:t)},t[40]=Z):Z=t[40];let ue;t[41]!==D||t[42]!==r||t[43]!==i||t[44]!==o||t[45]!==s||t[46]!==c?(ue=r.map((e,t)=>(0,G.jsx)(we,{isReplying:D===e.id,notification:e,notificationIndex:t,onCloseReply:()=>{w(t=>t===e.id?null:t)},onDismissNotification:i,onOpenReply:()=>{w(e.id)},onRunNotificationAction:o,onSubmitNotificationReply:s,prefersReducedMotion:c,replyInputRef:T},e.id)),t[41]=D,t[42]=r,t[43]=i,t[44]=o,t[45]=s,t[46]=c,t[47]=ue):ue=t[47];let de;t[48]!==ae||t[49]!==oe||t[50]!==ce||t[51]!==X||t[52]!==le||t[53]!==ue?(de=(0,G.jsx)(S.div,{ref:ne,animate:ae,"aria-label":oe,className:ce,"data-avatar-overlay-size":`notification-tray-list`,role:`list`,style:X,initial:!1,transition:le,onScroll:Z,children:ue}),t[48]=ae,t[49]=oe,t[50]=ce,t[51]=X,t[52]=le,t[53]=ue,t[54]=de):de=t[54];let $;t[55]!==P||t[56]!==N||t[57]!==c||t[58]!==K?($=P?(0,G.jsx)(Se,{count:N,prefersReducedMotion:c,onClick:K},`older`):null,t[55]=P,t[56]=N,t[57]=c,t[58]=K,t[59]=$):$=t[59];let pe;t[60]===$?pe=t[61]:(pe=(0,G.jsx)(x,{children:$}),t[60]=$,t[61]=pe);let me;return t[62]!==J||t[63]!==de||t[64]!==pe?(me=(0,G.jsxs)(`div`,{className:`relative`,children:[J,de,pe]}),t[62]=J,t[63]=de,t[64]=pe,t[65]=me):me=t[65],me}function xe(e){let t=(0,L.c)(28),{onClick:n,prefersReducedMotion:r}=e,i=ee(),a;t[0]===i?a=t[1]:(a=i.formatMessage(Q.showLatestNotifications),t[0]=i,t[1]=a);let o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o={opacity:1,scale:1,x:`-50%`},t[2]=o):o=t[2];let s=r?1:.96,c;t[3]===s?c=t[4]:(c={opacity:0,scale:s,x:`-50%`},t[3]=s,t[4]=c);let l=r?1:.96,u;t[5]===l?u=t[6]:(u={opacity:0,scale:l,x:`-50%`},t[5]=l,t[6]=u);let d;t[7]===r?d=t[8]:(d=r?{duration:0}:{duration:.14,ease:`easeOut`},t[7]=r,t[8]=d);let f;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(f=v(_e,`top-1 min-w-12`),t[9]=f):f=t[9];let p;t[10]===r?p=t[11]:(p=r?void 0:{scale:1.03},t[10]=r,t[11]=p);let m;t[12]===r?m=t[13]:(m=r?void 0:{scale:.96},t[12]=r,t[13]=m);let h;t[14]===i?h=t[15]:(h=i.formatMessage(Q.latestNotifications),t[14]=i,t[15]=h);let g;t[16]===h?g=t[17]:(g=(0,G.jsx)(`span`,{children:h}),t[16]=h,t[17]=g);let _;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,G.jsx)(D,{className:`icon-2xs hidden -rotate-90 opacity-70 group-hover:block group-focus:block`}),t[18]=_):_=t[18];let y;return t[19]!==n||t[20]!==a||t[21]!==m||t[22]!==g||t[23]!==c||t[24]!==u||t[25]!==d||t[26]!==p?(y=(0,G.jsxs)(S.button,{type:`button`,"aria-label":a,"data-avatar-overlay-hit-region":`notification-scroll-control`,animate:o,exit:c,initial:u,transition:d,className:f,whileHover:p,whileTap:m,onClick:n,children:[g,_]}),t[19]=n,t[20]=a,t[21]=m,t[22]=g,t[23]=c,t[24]=u,t[25]=d,t[26]=p,t[27]=y):y=t[27],y}function Se(e){let t=(0,L.c)(36),{count:n,onClick:r,prefersReducedMotion:i}=e,a=ee(),o;t[0]!==n||t[1]!==a?(o=a.formatMessage(Q.showOlderNotifications,{count:n}),t[0]=n,t[1]=a,t[2]=o):o=t[2];let s;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(s={opacity:1,scale:1,x:`-50%`},t[3]=s):s=t[3];let c=i?1:.96,l;t[4]===c?l=t[5]:(l={opacity:0,scale:c,x:`-50%`},t[4]=c,t[5]=l);let u=i?1:.96,d;t[6]===u?d=t[7]:(d={opacity:0,scale:u,x:`-50%`},t[6]=u,t[7]=d);let f;t[8]===i?f=t[9]:(f=i?{duration:0}:{duration:.14,ease:`easeOut`},t[8]=i,t[9]=f);let p;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(p=v(_e,`bottom-1 min-w-9`),t[10]=p):p=t[10];let m;t[11]===i?m=t[12]:(m=i?void 0:{scale:1.03},t[11]=i,t[12]=m);let h;t[13]===i?h=t[14]:(h=i?void 0:{scale:.96},t[13]=i,t[14]=h);let g;t[15]!==n||t[16]!==a?(g=a.formatMessage(Q.compactOlderNotificationCount,{count:n}),t[15]=n,t[16]=a,t[17]=g):g=t[17];let _;t[18]===g?_=t[19]:(_=(0,G.jsx)(`span`,{className:`group-hover:hidden group-focus:hidden`,children:g}),t[18]=g,t[19]=_);let y;t[20]!==n||t[21]!==a?(y=a.formatMessage(Q.olderNotificationCount,{count:n}),t[20]=n,t[21]=a,t[22]=y):y=t[22];let b;t[23]===y?b=t[24]:(b=(0,G.jsx)(`span`,{className:`hidden group-hover:inline group-focus:inline`,children:y}),t[23]=y,t[24]=b);let x;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,G.jsx)(D,{className:`icon-2xs hidden rotate-90 opacity-70 group-hover:block group-focus:block`}),t[25]=x):x=t[25];let C;return t[26]!==r||t[27]!==o||t[28]!==h||t[29]!==_||t[30]!==b||t[31]!==l||t[32]!==d||t[33]!==f||t[34]!==m?(C=(0,G.jsxs)(S.button,{type:`button`,"aria-label":o,"data-avatar-overlay-hit-region":`notification-scroll-control`,animate:s,exit:l,initial:d,transition:f,className:p,whileHover:m,whileTap:h,onClick:r,children:[_,b,x]}),t[26]=r,t[27]=o,t[28]=h,t[29]=_,t[30]=b,t[31]=l,t[32]=d,t[33]=f,t[34]=m,t[35]=C):C=t[35],C}function Ce(e,t){if(t<=fe)return e.scrollHeight;let n=Ae(e);return n[Me(n,je(e,n))+fe]?.offsetTop??e.scrollHeight}function we({isReplying:e,notification:t,notificationIndex:n,onDismissNotification:i,onCloseReply:o,onOpenReply:s,onRunNotificationAction:c,onSubmitNotificationReply:l,prefersReducedMotion:u,replyInputRef:d}){let f=ee(),p=r(a,t.source===`local`?t.localConversationId:null),m=p==null?null:X(p.items,f),h=ie(t),g=f.formatMessage(h.labelMessage),_=m??t.body??f.formatMessage(h.fallbackBodyMessage),b=_.replace(/[.?!]+$/,``),x=_===g?g:`${g}. ${b}`,C=t.action==null?`${t.title}. ${x}`:`${t.title}. ${x}. ${f.formatMessage(Q.openNotification)}`,w=t.action!=null,[T,E]=(0,R.useState)(!1),[k,A]=(0,R.useState)(!1),[M,N]=(0,R.useState)(``),[P,F]=(0,R.useState)(null),[I,L]=(0,R.useState)(!1),[z,ne]=(0,R.useState)(0),B=(0,R.useRef)(void 0),V=(0,R.useCallback)(e=>{if(B.current?.(),B.current=void 0,e==null)return;let t=()=>{let t=e.scrollHeight;ne(e=>e===t?e:t)};t(),B.current=te({axis:`height`,target:e,onChange:t})},[]),H=z>me+ge,U=H&&T&&!e,W=t.replyTarget!=null&&l!=null,K=M.trim(),re=u?{duration:0}:{duration:I?.2:.28,ease:[.16,1,.3,1]},q=async e=>{if(e.preventDefault(),e.stopPropagation(),!(!W||K.length===0||k)){A(!0),F(null);try{await l(t,K),N(``),o()}catch{F(f.formatMessage(Q.notificationReplyError))}finally{A(!1)}}};return(0,G.jsx)(S.div,{animate:{opacity:1,y:0},initial:{opacity:0,y:u?0:4},role:`listitem`,className:`group no-drag relative w-full snap-start scroll-mt-2 text-left`,transition:u?{duration:0}:{delay:Math.min(n,3)*pe,duration:.18,ease:`easeOut`},onBlurCapture:e=>{let t=e.relatedTarget;t instanceof Node&&e.currentTarget.contains(t)||L(!1)},onFocusCapture:()=>{L(!0)},onPointerEnter:()=>{L(!0)},onPointerLeave:()=>{L(!1)},children:(0,G.jsxs)(`div`,{className:v(`relative z-[1] overflow-hidden rounded-[18px] border border-token-border/60 bg-token-main-surface-primary shadow-[inset_0_1px_0_rgba(255,255,255,0.42),inset_0_-1px_0_rgba(0,0,0,0.08)] backdrop-blur-xl forced-colors:bg-[Canvas]`,w&&`transition-[background-color,border-color,box-shadow] duration-200 ease-[cubic-bezier(0.16,1,0.3,1)] hover:border-token-border/80 hover:bg-token-main-surface-primary hover:shadow-[inset_0_1px_0_rgba(255,255,255,0.52),inset_0_-1px_0_rgba(0,0,0,0.1)] motion-reduce:transition-none`),children:[(0,G.jsxs)(S.div,{role:w?`button`:void 0,className:v(`block w-full min-w-0 px-5 py-3 text-left focus-visible:outline-token-focus focus-visible:outline focus-visible:outline-offset-[-2px]`,w?`cursor-interaction`:`cursor-default`),tabIndex:w?0:void 0,transition:u?{duration:0}:{duration:.12,ease:`easeOut`},whileTap:w&&!u?{scale:.995}:void 0,"aria-label":w?C:void 0,onClick:()=>{w&&c?.(t)},onKeyDown:e=>{!w||e.key!==`Enter`&&e.key!==` `||(e.preventDefault(),c?.(t))},children:[(0,G.jsx)(`span`,{className:`flex min-w-0 items-center pr-7`,children:(0,G.jsx)(`span`,{className:`text-size-chat min-w-0 truncate leading-[17px] font-semibold text-token-foreground`,children:t.title})}),(0,G.jsx)(S.div,{animate:{maxHeight:U?he:me},className:v(`text-size-chat-sm mt-0.5 overflow-hidden leading-4 text-token-foreground`,U?`whitespace-pre-wrap`:`whitespace-pre-wrap`),initial:!1,transition:u?{duration:0}:{duration:.18,ease:`easeOut`},children:_})]}),(0,G.jsx)(`div`,{ref:V,"aria-hidden":`true`,className:`text-size-chat-sm pointer-events-none invisible absolute inset-x-3 top-0 -z-10 leading-4 whitespace-pre-wrap`,children:_}),(0,G.jsx)(`span`,{className:v(`pointer-events-none absolute top-1 right-1 z-0 flex size-6 items-center justify-center opacity-100`,H&&I&&`opacity-0 transition-opacity duration-150 motion-reduce:transition-none`),children:Ne(h)}),H?(0,G.jsx)(S.div,{animate:{opacity:I?1:0,x:I?0:6},className:v(`absolute top-1 right-1 z-10`,I?`pointer-events-auto`:`pointer-events-none`),"data-avatar-overlay-control":`expand`,initial:!1,transition:re,children:(0,G.jsx)(O,{align:`end`,side:`top`,tooltipContent:f.formatMessage(T?Q.collapseNotificationTooltip:Q.expandNotificationTooltip),children:(0,G.jsx)(y,{className:v(`size-6`,ve),color:`ghost`,size:`icon`,"aria-expanded":T,"aria-label":f.formatMessage(T?Q.collapseNotification:Q.expandNotification,{title:t.title}),onClick:()=>{E(e=>!e)},children:(0,G.jsx)(S.span,{animate:{rotate:T?90:0},transition:u?{duration:0}:{duration:.12,ease:`easeOut`},children:(0,G.jsx)(D,{className:`icon-xs`})})})})}):null,W&&!e?(0,G.jsx)(S.div,{animate:{opacity:I?1:0,x:I?0:6},className:v(`no-drag absolute right-2 bottom-1 z-10`,I?`pointer-events-auto`:`pointer-events-none`),"data-avatar-overlay-control":`reply`,initial:!1,transition:re,children:(0,G.jsx)(`div`,{className:`flex justify-end pb-1`,children:(0,G.jsx)(y,{className:v(`h-5 px-2 text-xs leading-none text-token-foreground shadow-[0px_5px_10px_-7px_rgba(0,0,0,0.22)]`,ve),color:`outline`,size:`default`,"aria-label":f.formatMessage(Q.replyNotification,{title:t.title}),onClick:e=>{e.stopPropagation(),F(null),N(``),s(),L(!0)},onPointerDown:e=>{e.stopPropagation()},children:f.formatMessage(Q.replyNotificationButton)})})}):null,e?(0,G.jsxs)(S.form,{className:`no-drag mx-3 mb-2 border-t border-token-border/60 pt-2`,animate:{opacity:1,y:0},initial:{opacity:0,y:u?0:-2},transition:u?{duration:0}:{duration:.16,ease:`easeOut`},onClick:e=>{e.stopPropagation()},onPointerDown:e=>{e.stopPropagation()},onSubmit:e=>{q(e)},children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,G.jsx)(`input`,{ref:d,className:`text-size-chat-sm h-6 min-w-0 flex-1 rounded-md border border-token-border bg-token-main-surface-primary px-2 text-token-foreground outline-none placeholder:text-token-text-tertiary focus:border-token-focus-border`,"aria-label":f.formatMessage(Q.replyNotification,{title:t.title}),autoFocus:!0,placeholder:f.formatMessage(Q.notificationReplyPlaceholder),value:M,onChange:e=>{N(e.currentTarget.value),F(null)},onKeyDown:e=>{e.key!==`Escape`||k||(e.stopPropagation(),o(),F(null))}}),(0,G.jsx)(y,{className:`h-6 px-2 text-xs`,color:`primary`,size:`default`,type:`submit`,"aria-label":f.formatMessage(Q.sendNotificationReply,{title:t.title}),disabled:K.length===0||k,loading:k,children:f.formatMessage(Q.replyNotificationButton)})]}),P==null?null:(0,G.jsx)(`div`,{className:`mt-1 text-[11px] leading-4 text-token-error-foreground`,role:`alert`,children:P})]}):null,i?(0,G.jsx)(S.div,{animate:{opacity:I?1:0,x:I?0:-6},className:v(`absolute top-1 left-1 z-20`,I?`pointer-events-auto`:`pointer-events-none`),"data-avatar-overlay-control":`dismiss`,initial:!1,transition:re,children:(0,G.jsx)(O,{align:`start`,side:`top`,tooltipContent:f.formatMessage(Q.dismissNotificationTooltip),children:(0,G.jsx)(y,{className:v(`[&>svg]:!icon-xs size-6 shadow-[0px_5px_10px_-7px_rgba(0,0,0,0.22)] enabled:hover:!text-token-foreground`,ve),color:`outline`,size:`icon`,"aria-label":f.formatMessage(Q.dismissNotification,{title:t.title}),onClick:()=>{i(t)},children:(0,G.jsx)(j,{className:`icon-xs`})})})}):null]})})}function Te(e,t=e.scrollTop){if(!Oe(e))return{hasLatestNotificationsAbove:!1,hiddenOlderNotificationCount:0};if(De(e,t))return{hasLatestNotificationsAbove:!0,hiddenOlderNotificationCount:0};let n=Ae(e),r=je(e,n,t);return{hasLatestNotificationsAbove:t>$,hiddenOlderNotificationCount:ke(e,n,r)}}function Ee(e,t){return e.hasLatestNotificationsAbove===t.hasLatestNotificationsAbove&&e.hiddenOlderNotificationCount===t.hiddenOlderNotificationCount}function De(e,t=e.scrollTop){let n=Math.max(0,e.scrollHeight-e.clientHeight);return Oe(e)&&t>=n-$}function Oe(e){return e.scrollHeight>e.clientHeight+$}function ke(e,t,n){let r=n+e.clientHeight-$;return t.filter(e=>e.offsetTop+e.offsetHeight>r).length}function Ae(e){return Array.from(e.children).filter(e=>e instanceof HTMLElement)}function je(e,t,n=e.scrollTop){return n+(t[0]?.offsetTop??0)+$}function Me(e,t){let n=0;for(let r=0;r<e.length;r+=1)e[r].offsetTop<=t&&(n=r);return n}function Ne(e){switch(e.iconType){case`check-circle`:return(0,G.jsx)(F,{className:e.iconClassName});case`clock`:return(0,G.jsx)(N,{className:e.iconClassName});case`spinner`:return(0,G.jsx)(b,{className:e.iconClassName});case`warning`:return(0,G.jsx)(A,{className:e.iconClassName})}}var Pe=180*1e3,Fe=3600*1e3,Ie=1440*60*1e3,Le=10080*60*1e3;function Re({dismissedNotificationTurnKeys:e,nowMs:t=Date.now(),sessions:n}){let r=[],i=null;for(let a of n){let n=ze(a,t);n!=null&&e?.get(n.notification.id)!==n.notification.turnKey&&(n.expiresAtMs!=null&&(i==null||n.expiresAtMs<i)&&(i=n.expiresAtMs),r.push(n))}return{nextThreadNotificationExpiresAtMs:i,notifications:r.sort(He).map(e=>e.notification)}}function ze(e,t){if(e.status===`idle`)return null;let n=Be(e.status,e.updatedAtMs);return n!=null&&t>=n?null:{expiresAtMs:n,key:e.key,notification:{action:{path:e.actionPath},body:e.subtitle,expiresAtMs:n,id:e.key,isLoading:e.status===`running`,level:Ve(e.status),localConversationId:e.localConversationId,replyTarget:e.localConversationId==null?null:{conversationId:e.localConversationId},source:e.source,title:e.title,turnKey:e.turnKey,updatedAtMs:e.updatedAtMs},notificationPriority:Ue(e.status),updatedAtMs:e.updatedAtMs}}function Be(e,t){switch(e){case`running`:return t+Pe;case`failed`:return t+Fe;case`waiting`:return t+Ie;case`review`:return t+Le;case`idle`:return null}}function Ve(e){switch(e){case`waiting`:return`warning`;case`failed`:return`danger`;case`running`:return`info`;case`review`:return`success`;case`idle`:return`info`}}function He(e,t){let n=e.notificationPriority-t.notificationPriority;if(n!==0)return n;let r=t.updatedAtMs-e.updatedAtMs;return r===0?e.key.localeCompare(t.key):r}function Ue(e){switch(e){case`waiting`:return 0;case`failed`:return 1;case`review`:return 2;case`running`:return 3;case`idle`:return 4}}var We=15e3,Ge=4,Ke=[`[data-avatar-overlay-hit-region]`,`[data-avatar-mascot='true']`],qe=`.codex-avatar-root`,Je=`[data-avatar-overlay-size='notification-tray']`,Ye=`[data-avatar-overlay-size='notification-tray-header']`,Xe=`[data-avatar-overlay-size='notification-tray-list']`,Ze={mascot:{left:244,top:191,width:112,height:121},placement:`top-end`,tray:{left:16,top:24,width:560,height:320},viewport:{width:600,height:460}};function Qe(){let e=(0,L.c)(2);if(!g(`2679188970`)){let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,G.jsx)(G.Fragment,{}),e[0]=t):t=e[0],t}let t;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,G.jsx)($e,{}),e[1]=t):t=e[1],t}function $e(){let e=(0,L.c)(46),t=ee(),{avatarOptions:n}=w(),{selectedAvatar:r}=T(n),[i,a]=(0,R.useState)(Ze),[o,s]=(0,R.useState)(null),[c,l]=(0,R.useState)(!0),[d,h]=(0,R.useState)(!1),[g,v]=(0,R.useState)(lt),[y,b]=(0,R.useState)(ct),{data:x,refetch:S}=_(),C=x===void 0?[]:x,E;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(E={taskFilter:`current`,limit:20},e[0]=E):E=e[0];let{data:D,refetch:O}=u(E),k=ae({intl:t,localConversations:C,remoteTasks:D===void 0?[]:D}),{nextThreadNotificationExpiresAtMs:A,notifications:j}=Re({dismissedNotificationTurnKeys:g,nowMs:y,sessions:k}),M=re(j),N=k.some(st),te=k.some(ot),P=(0,R.useRef)(null),F=(0,R.useRef)(null),z=(0,R.useRef)(null),ne;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(ne={interactiveRegionRef:F,isPaused:()=>P.current!=null,onInteractiveChange:at,regionElementSelectors:Ke},e[1]=ne):ne=e[1],I(ne);let B;e[2]!==c||e[3]!==j.length?(B=()=>{let e=dt(F.current);if(e==null)return;let t={...e,isTrayVisible:c&&j.length>0};ht(z.current,t)||(z.current=t,f.dispatchMessage(`avatar-overlay-element-size-changed`,{isTrayVisible:t.isTrayVisible,mascot:t.mascot,tray:t.tray}))},e[2]=c,e[3]=j.length,e[4]=B):B=e[4];let W=B,K;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(K=(e,t)=>{let{releaseSample:n,shouldOpenMainWindow:r}=t,i=P.current;if(i==null||i.pointerId!==e)return;P.current=null,h(!1),s(null);let a=n==null?null:H(i,n);F.current?.hasPointerCapture?.(e)&&F.current.releasePointerCapture?.(e),r&&i.startedOnMascot&&!i.hasMoved&&f.dispatchMessage(`open-current-main-window`,{}),f.dispatchMessage(`avatar-overlay-drag-end`,{}),a!=null&&f.dispatchMessage(`avatar-overlay-drag-release`,{velocityX:a.x,velocityY:a.y})},e[5]=K):K=e[5];let q=K,J;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(J=e=>{e.button!==0||!(e.target instanceof Element)||e.target.closest(`.no-drag`)!=null||(e.preventDefault(),e.currentTarget.setPointerCapture?.(e.pointerId),P.current={startedOnMascot:e.target.closest(`[data-avatar-mascot="true"]`)!=null,hasMoved:!1,pointerId:e.pointerId,samples:[V(e)],screenX:e.screenX,screenY:e.screenY},f.dispatchMessage(`avatar-overlay-drag-start`,{pointerWindowX:e.clientX,pointerWindowY:e.clientY}),h(!0),s(null))},e[6]=J):J=e[6];let ie=J,Y;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(Y=e=>{let t=P.current;if(t==null||t.pointerId!==e.pointerId)return;let n=V(e);t.samples=U([...t.samples,n]);let r=n.screenX-t.screenX,i=n.screenY-t.screenY;Math.abs(r)<Ge&&Math.abs(i)<Ge||(t.hasMoved=!0,t.screenX=n.screenX,t.screenY=n.screenY,s(e=>ut({currentDragState:e,deltaX:r})),f.dispatchMessage(`avatar-overlay-drag-move`,{}))},e[7]=Y):Y=e[7];let oe=Y,se;e[8]===Symbol.for(`react.memo_cache_sentinel`)?(se=e=>{q(e.pointerId,{releaseSample:V(e),shouldOpenMainWindow:!0})},e[8]=se):se=e[8];let ce=se,X;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(X=e=>{q(e.pointerId,{shouldOpenMainWindow:!1})},e[9]=X):X=e[9];let le=X,Z;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(Z=e=>{q(e.pointerId,{shouldOpenMainWindow:!1})},e[10]=Z):Z=e[10];let ue=Z,de=it,Q;e[11]===Symbol.for(`react.memo_cache_sentinel`)?(Q=e=>{v(t=>{if(t.get(e.id)===e.turnKey)return t;let n=new Map(t);return n.set(e.id,e.turnKey),n})},e[11]=Q):Q=e[11];let fe=Q,$=rt,pe=nt,me,he;e[12]===Symbol.for(`react.memo_cache_sentinel`)?(me=e=>{let{layout:t}=e;a(t)},he=[],e[12]=me,e[13]=he):(me=e[12],he=e[13]),p(`avatar-overlay-layout-changed`,me,he);let ge,_e;e[14]===Symbol.for(`react.memo_cache_sentinel`)?(ge=()=>{let e=e=>{q(e.pointerId,{releaseSample:V(e),shouldOpenMainWindow:!0})},t=e=>{q(e.pointerId,{shouldOpenMainWindow:!1})};return window.addEventListener(`pointerup`,e),window.addEventListener(`pointercancel`,t),()=>{window.removeEventListener(`pointerup`,e),window.removeEventListener(`pointercancel`,t)}},_e=[q],e[14]=ge,e[15]=_e):(ge=e[14],_e=e[15]),(0,R.useEffect)(ge,_e);let ve;e[16]===W?ve=e[17]:(ve=()=>{let e=null,t=()=>{e??=window.requestAnimationFrame(()=>{e=null,W()})},n=new ResizeObserver(t),r=F.current;if(r!=null){n.observe(r);for(let e of r.querySelectorAll(`${qe}, ${Je}`))n.observe(e)}return window.addEventListener(`resize`,t),t(),()=>{e!=null&&window.cancelAnimationFrame(e),n.disconnect(),window.removeEventListener(`resize`,t)}},e[16]=W,e[17]=ve);let be;e[18]!==M||e[19]!==W||e[20]!==r.id?(be=[W,r.id,M],e[18]=M,e[19]=W,e[20]=r.id,e[21]=be):be=e[21],(0,R.useLayoutEffect)(ve,be);let xe;e[22]===W?xe=e[23]:(xe=()=>{W()},e[22]=W,e[23]=xe);let Se;e[24]!==c||e[25]!==M||e[26]!==W||e[27]!==r.id?(Se=[c,W,r.id,M],e[24]=c,e[25]=M,e[26]=W,e[27]=r.id,e[28]=Se):Se=e[28],(0,R.useLayoutEffect)(xe,Se);let Ce,we;e[29]!==N||e[30]!==te||e[31]!==A||e[32]!==S||e[33]!==O?(Ce=()=>{let e=N||te;if(!e&&A==null)return;let t=We,n=e;if(A!=null){let e=Math.max(0,A-Date.now());e<We&&(t=e,n=!1)}let r=window.setTimeout(()=>{b(tt),n&&(N&&S(),te&&O())},t);return()=>{window.clearTimeout(r)}},we=[N,te,A,S,O],e[29]=N,e[30]=te,e[31]=A,e[32]=S,e[33]=O,e[34]=Ce,e[35]=we):(Ce=e[34],we=e[35]),(0,R.useEffect)(Ce,we);let Te;e[36]===Symbol.for(`react.memo_cache_sentinel`)?(Te=[{id:`close-avatar`,message:m({id:`petOverlay.closePet`,defaultMessage:`Close pet`,description:`Context menu item that closes the floating Codex pet`}),onSelect:et}],e[36]=Te):Te=e[36];let Ee;e[37]===Symbol.for(`react.memo_cache_sentinel`)?(Ee=()=>{l(!1)},e[37]=Ee):Ee=e[37];let De;e[38]===Symbol.for(`react.memo_cache_sentinel`)?(De=()=>{l(!0)},e[38]=De):De=e[38];let Oe;return e[39]!==d||e[40]!==c||e[41]!==i||e[42]!==o||e[43]!==j||e[44]!==r?(Oe=(0,G.jsx)(ye,{avatar:r,avatarMenuItems:Te,interactiveRegionRef:F,isDragging:d,isNotificationTrayOpen:c,layout:i,mascotDragState:o,notifications:j,onCloseNotificationTray:Ee,onLostPointerCapture:ue,onPointerCancel:le,onPointerDown:ie,onPointerMove:oe,onPointerUp:ce,onDismissNotification:fe,onNotificationReplyEditorActiveChange:pe,onRunNotificationAction:de,onSubmitNotificationReply:$,onOpenNotificationTray:De}),e[39]=d,e[40]=c,e[41]=i,e[42]=o,e[43]=j,e[44]=r,e[45]=Oe):Oe=e[45],Oe}function et(){f.dispatchMessage(`avatar-overlay-open`,{})}function tt(e){return Math.max(Date.now(),e+1)}function nt(e){f.dispatchMessage(`avatar-overlay-keyboard-interaction-changed`,{isInteractive:e})}async function rt(e,t){if(e.replyTarget==null)return;let n=t.trim();n.length!==0&&await c(`send-follow-up-message`,{conversationId:e.replyTarget.conversationId,prompt:n})}function it(e){e.action!=null&&f.dispatchMessage(`open-in-main-window`,{path:e.action.path})}function at(e){f.dispatchMessage(`avatar-overlay-pointer-interaction-changed`,{isInteractive:e})}function ot(e){return e.source===`cloud`&&e.status===`running`}function st(e){return e.source!==`cloud`&&e.status===`running`}function ct(){return Date.now()}function lt(){return new Map}function ut({currentDragState:e,deltaX:t}){return t>=Ge?`running-right`:t<=-Ge?`running-left`:e}function dt(e){if(e==null)return null;let t=ft(e.querySelector(qe)),n=ft(e.querySelector(Je));return t==null?null:{mascot:t,tray:n}}function ft(e){if(e==null||_t(e))return null;let t=e.getBoundingClientRect();return t.width<=0||t.height<=0?null:{width:Math.ceil(pt(e,t)),height:Math.ceil(mt(e,t))}}function pt(e,t){return e.matches(Je)&&e.offsetWidth>0?e.offsetWidth:t.width}function mt(e,t){if(!e.matches(Je))return t.height;let n=e.querySelector(Ye),r=e.querySelector(Xe);return n==null||r==null?t.height:n.getBoundingClientRect().height+r.scrollHeight}function ht(e,t){return e!=null&&e.isTrayVisible===t.isTrayVisible&&e.mascot.width===t.mascot.width&&e.mascot.height===t.mascot.height&&gt(e.tray,t.tray)}function gt(e,t){return e===t||e!=null&&t!=null&&e.width===t.width&&e.height===t.height}function _t(e){return window.getComputedStyle(e).display===`none`}export{Qe as AvatarOverlayPage};
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep overflow measurement width aligned with card padding

The overflow detection now measures text in a hidden element with inset-x-3 while the visible notification body was widened to px-5, so the measurement column is wider than the rendered column. In cases where wrapping at the narrower rendered width pushes the body above me (240px), z can still be computed below the threshold, which suppresses the expand control even though the visible text is clipped by maxHeight. This makes some long activity messages impossible to fully read.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant