{#if (!isOpen || isMinimized) && position} {@const winWidth = windowDimensions.width || (typeof window !== 'undefined' ? window.innerWidth : 0)} {@const winHeight = windowDimensions.height || (typeof window !== 'undefined' ? window.innerHeight : 0)} {@const bottomPos = `${Math.max(0, winHeight - position.y - 72)}px`} {@const rightPos = `${Math.max(0, winWidth - position.x - 72)}px`} {/if} {#if isOpen && !isMinimized && position} {@const winWidth = windowDimensions.width || (typeof window !== 'undefined' ? window.innerWidth : 0)} {@const winHeight = windowDimensions.height || (typeof window !== 'undefined' ? window.innerHeight : 0)} {@const bottomPos = `${Math.max(0, winHeight - position.y - windowSize.height)}px`} {@const rightPos = `${Math.max(0, winWidth - position.x - windowSize.width)}px`}

{#if avatarUrlDoUsuario()} {currentUser?.data?.nome {:else} {/if}
Mensagens

{#if !activeConversation} {:else} {/if}
handleResizeStart(e, 'n')} onkeydown={(e) => e.key === 'Enter' && handleResizeStart(e, 'n')} style="border-radius: 24px 24px 0 0;" >
handleResizeStart(e, 's')} onkeydown={(e) => e.key === 'Enter' && handleResizeStart(e, 's')} style="border-radius: 0 0 24px 24px;" >
handleResizeStart(e, 'w')} onkeydown={(e) => e.key === 'Enter' && handleResizeStart(e, 'w')} style="border-radius: 24px 0 0 24px;" >
handleResizeStart(e, 'e')} onkeydown={(e) => e.key === 'Enter' && handleResizeStart(e, 'e')} style="border-radius: 0 24px 24px 0;" >
handleResizeStart(e, 'nw')} onkeydown={(e) => e.key === 'Enter' && handleResizeStart(e, 'nw')} style="border-radius: 24px 0 0 0;" >
handleResizeStart(e, 'ne')} onkeydown={(e) => e.key === 'Enter' && handleResizeStart(e, 'ne')} style="border-radius: 0 24px 0 0;" >
handleResizeStart(e, 'sw')} onkeydown={(e) => e.key === 'Enter' && handleResizeStart(e, 'sw')} style="border-radius: 0 0 0 24px;" >
handleResizeStart(e, 'se')} onkeydown={(e) => e.key === 'Enter' && handleResizeStart(e, 'se')} style="border-radius: 0 0 24px 0;" >
{/if} {#if showGlobalNotificationPopup && globalNotificationMessage} {@const notificationMsg = globalNotificationMessage}
{ const conversaIdToOpen = notificationMsg?.conversaId; showGlobalNotificationPopup = false; globalNotificationMessage = null; if (globalNotificationTimeout) { clearTimeout(globalNotificationTimeout); } // Abrir chat e conversa ao clicar if (conversaIdToOpen) { abrirChat(); abrirConversa(conversaIdToOpen as Id<'conversas'>); } }} onkeydown={(e) => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); const conversaIdToOpen = notificationMsg?.conversaId; showGlobalNotificationPopup = false; globalNotificationMessage = null; if (globalNotificationTimeout) { clearTimeout(globalNotificationTimeout); } if (conversaIdToOpen) { abrirChat(); abrirConversa(conversaIdToOpen as Id<'conversas'>); } } }} >

Nova mensagem de {notificationMsg.remetente}

{notificationMsg.conteudo}

Clique para abrir

{/if}