{"version":3,"file":"ChannelListItemActionButtons.defaults.mjs","names":[],"sources":["../../../../src/components/ChannelListItem/ChannelListItemActionButtons.defaults.tsx"],"sourcesContent":["import {\n  type ComponentPropsWithoutRef,\n  type ComponentPropsWithRef,\n  forwardRef,\n  useMemo,\n  useRef,\n  useState,\n} from 'react';\n\nimport {\n  useChatContext,\n  useComponentContextIcons,\n  useTranslationContext,\n} from '../../context';\nimport { useChannelMembershipState, useChannelMembersState } from '../ChannelList';\nimport { useChannelListItemContext } from './ChannelListItem';\nimport { Button } from '../Button';\nimport { useIsChannelMuted } from './hooks/useIsChannelMuted';\nimport {\n  ContextMenuButton,\n  useContextMenuContext,\n  useDialogIsOpen,\n  useDialogOnNearestManager,\n} from '../Dialog';\nimport { useNotificationApi } from '../Notifications';\nimport { ChannelListItemActionButtons } from './ChannelListItemActionButtons';\n\ntype ChannelActionBehavior = {\n  /** Toggle state of the action; omitted for one-shot actions such as leave. */\n  'aria-pressed'?: boolean;\n  title: string;\n  toggle: () => Promise<void>;\n};\n\n// The core actions call the API and report the result. The placement wrappers below own the busy\n// and menu-close behavior.\nconst useMuteAction = (): ChannelActionBehavior => {\n  const { addNotification } = useNotificationApi();\n  const { channel } = useChannelListItemContext();\n  const { t } = useTranslationContext();\n  const { muted: isMuted } = useIsChannelMuted(channel);\n\n  const toggle = async () => {\n    try {\n      if (isMuted) {\n        await channel.unmute();\n        addNotification({\n          context: { channel },\n          emitter: ChannelListItemActionButtons.name,\n          message: t('common.channelUnmuted.text', 'Channel unmuted'),\n          severity: 'success',\n          type: 'api:channel:unmute:success',\n        });\n      } else {\n        await channel.mute();\n        addNotification({\n          context: { channel },\n          emitter: ChannelListItemActionButtons.name,\n          message: t('common.channelMuted.text', 'Channel muted'),\n          severity: 'success',\n          type: 'api:channel:mute:success',\n        });\n      }\n    } catch (error) {\n      addNotification({\n        context: { channel },\n        emitter: ChannelListItemActionButtons.name,\n        error: error instanceof Error ? error : new Error('An unknown error occurred'),\n        message: t(\n          'channelListItem.failedUpdateChannelMute.text',\n          'Failed to update channel mute status',\n        ),\n        severity: 'error',\n        type: 'api:channel:mute:failed',\n      });\n    }\n  };\n\n  return {\n    'aria-pressed': isMuted,\n    title: isMuted ? t('common.unmute.title', 'Unmute') : t('common.mute.title', 'Mute'),\n    toggle,\n  };\n};\n\nconst useArchiveAction = (): ChannelActionBehavior => {\n  const { channel } = useChannelListItemContext();\n  const { addNotification } = useNotificationApi();\n  const membership = useChannelMembershipState(channel);\n  const { t } = useTranslationContext();\n\n  const toggle = async () => {\n    try {\n      if (membership.archived_at != null) {\n        await channel.unarchive();\n        addNotification({\n          context: { channel },\n          emitter: ChannelListItemActionButtons.name,\n          message: t('channelListItem.channelUnarchived.text', 'Channel unarchived'),\n          severity: 'success',\n          type: 'api:channel:unarchive:success',\n        });\n      } else {\n        await channel.archive();\n        addNotification({\n          context: { channel },\n          emitter: ChannelListItemActionButtons.name,\n          message: t('channelListItem.channelArchived.text', 'Channel archived'),\n          severity: 'success',\n          type: 'api:channel:archive:success',\n        });\n      }\n    } catch (error) {\n      addNotification({\n        context: { channel },\n        emitter: ChannelListItemActionButtons.name,\n        error: error instanceof Error ? error : new Error('An unknown error occurred'),\n        message: t(\n          'channelListItem.failedUpdateChannelArchive.text',\n          'Failed to update channel archive status',\n        ),\n        severity: 'error',\n        type: 'api:channel:archive:failed',\n      });\n    }\n  };\n\n  return {\n    'aria-pressed': membership.archived_at != null,\n    title:\n      membership.archived_at != null\n        ? t('channelListItem.unarchive.title', 'Unarchive')\n        : t('channelListItem.archive.title', 'Archive'),\n    toggle,\n  };\n};\n\n// Quick (hover/focus-revealed) action button. Busy state uses `aria-disabled` and `aria-busy`, not\n// `disabled`, which would blur the button and collapse its hover-revealed row.\nconst useQuickActionButtonProps = ({\n  'aria-pressed': ariaPressed,\n  title,\n  toggle,\n}: ChannelActionBehavior) => {\n  // A ref latch flips synchronously, so two clicks in the same tick cannot both call `toggle()`;\n  // the `aria-*` state only guards after the rerender, too late for non-idempotent actions.\n  const inProgressRef = useRef(false);\n  const [inProgress, setInProgress] = useState(false);\n\n  return {\n    'aria-busy': inProgress || undefined,\n    'aria-disabled': inProgress || undefined,\n    'aria-pressed': ariaPressed,\n    onClick: async (e: React.MouseEvent<HTMLButtonElement>) => {\n      e.stopPropagation();\n      if (inProgressRef.current) return;\n      inProgressRef.current = true;\n      try {\n        setInProgress(true);\n        await toggle();\n      } finally {\n        inProgressRef.current = false;\n        setInProgress(false);\n      }\n    },\n    title,\n  } satisfies ComponentPropsWithoutRef<'button'>;\n};\n\n// Dropdown menu item: activating closes the menu, which returns focus to the toggle, and runs the\n// action in the background, so the item needs no busy state.\n//\n// The action runs on the next animation frame, after the close commits. The open menu is an\n// aria-modal dialog with its own `AriaLiveOutlet` (the root outlet is inert meanwhile), so a\n// notification raised synchronously can land in that outlet as it unmounts and never be spoken.\nconst useDropdownActionButtonProps = ({\n  'aria-pressed': ariaPressed,\n  title,\n  toggle,\n}: ChannelActionBehavior) => {\n  const { closeMenu } = useContextMenuContext();\n\n  return {\n    'aria-pressed': ariaPressed,\n    onClick: (e: React.MouseEvent<HTMLButtonElement>) => {\n      e.stopPropagation();\n      closeMenu();\n      requestAnimationFrame(() => void toggle());\n    },\n    title,\n  } satisfies ComponentPropsWithoutRef<'button'>;\n};\n\n// Blocks or unblocks the other member of a DM.\nconst useBanAction = (): ChannelActionBehavior => {\n  const { client } = useChatContext();\n  const { addNotification } = useNotificationApi();\n  const { t } = useTranslationContext();\n  const { channel } = useChannelListItemContext();\n  const members = useChannelMembersState(channel);\n  const isUserBanned = Object.values(members || {}).some(\n    (member) => member.user?.id !== client.userID && member.banned,\n  );\n\n  const toggle = async () => {\n    try {\n      const otherUserId = Object.keys(channel.state.members).find(\n        // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n        (userId) => userId !== client.userID!,\n      );\n      if (!otherUserId) return;\n      if (isUserBanned) {\n        await channel.unbanUser(otherUserId);\n        addNotification({\n          context: { channel },\n          emitter: ChannelListItemActionButtons.name,\n          message: t('common.userUnblocked.text', 'User unblocked'),\n          severity: 'success',\n          type: 'api:user:unban:success',\n        });\n      } else {\n        await channel.banUser(otherUserId, {});\n        addNotification({\n          context: { channel },\n          emitter: ChannelListItemActionButtons.name,\n          message: t('common.userBlocked.text', 'User blocked'),\n          severity: 'success',\n          type: 'api:user:ban:success',\n        });\n      }\n    } catch (error) {\n      addNotification({\n        context: { channel },\n        emitter: ChannelListItemActionButtons.name,\n        error: error instanceof Error ? error : new Error('An unknown error occurred'),\n        message: t('channelListItem.failedBlockUser.text', 'Failed to block user'),\n        severity: 'error',\n        type: 'api:user:ban:failed',\n      });\n    }\n  };\n\n  return {\n    'aria-pressed': isUserBanned,\n    title: isUserBanned\n      ? t('channelListItem.unblockUser.title', 'Unblock User')\n      : t('common.blockUser.title', 'Block User'),\n    toggle,\n  };\n};\n\n// One-shot, so it returns no `aria-pressed`.\nconst useLeaveAction = (): ChannelActionBehavior => {\n  const { t } = useTranslationContext();\n  const { channel } = useChannelListItemContext();\n  const { client } = useChatContext();\n  const { addNotification } = useNotificationApi();\n\n  const toggle = async () => {\n    try {\n      // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n      await channel.removeMembers({ members: [client.userID!] });\n      addNotification({\n        context: { channel },\n        emitter: ChannelListItemActionButtons.name,\n        message: t('common.leftChannel.text', 'Left channel'),\n        severity: 'success',\n        type: 'api:channel:leave:success',\n      });\n    } catch (error) {\n      addNotification({\n        context: { channel },\n        emitter: ChannelListItemActionButtons.name,\n        error: error instanceof Error ? error : new Error('An unknown error occurred'),\n        message: t('common.failedLeaveChannel.text', 'Failed to leave channel'),\n        severity: 'error',\n        type: 'api:channel:leave:failed',\n      });\n    }\n  };\n\n  return { title: t('channelListItem.leaveChannel.title', 'Leave Channel'), toggle };\n};\n\nconst usePinAction = (): ChannelActionBehavior => {\n  const { t } = useTranslationContext();\n  const { addNotification } = useNotificationApi();\n  const { channel } = useChannelListItemContext();\n  const membership = useChannelMembershipState(channel);\n\n  const toggle = async () => {\n    try {\n      if (membership.pinned_at != null) {\n        await channel.unpin();\n        addNotification({\n          context: { channel },\n          emitter: ChannelListItemActionButtons.name,\n          message: t('channelListItem.channelUnpinned.text', 'Channel unpinned'),\n          severity: 'success',\n          type: 'api:channel:unpin:success',\n        });\n      } else {\n        await channel.pin();\n        addNotification({\n          context: { channel },\n          emitter: ChannelListItemActionButtons.name,\n          message: t('channelListItem.channelPinned.text', 'Channel pinned'),\n          severity: 'success',\n          type: 'api:channel:pin:success',\n        });\n      }\n    } catch (error) {\n      addNotification({\n        context: { channel },\n        emitter: ChannelListItemActionButtons.name,\n        error: error instanceof Error ? error : new Error('An unknown error occurred'),\n        message: t(\n          'channelListItem.failedUpdateChannelPinned.text',\n          'Failed to update channel pinned status',\n        ),\n        severity: 'error',\n        type: 'api:channel:pin:failed',\n      });\n    }\n  };\n\n  return {\n    'aria-pressed': membership.pinned_at != null,\n    title:\n      membership.pinned_at != null\n        ? t('common.unpin.title', 'Unpin')\n        : t('common.pin.title', 'Pin'),\n    toggle,\n  };\n};\n\ntype ChannelActionItem =\n  | (({ placement: 'quick' } | { placement: 'dropdown' }) & {\n      type: string;\n      Component: React.ComponentType;\n    })\n  | {\n      placement: 'quick-dropdown-toggle';\n      Component: React.ComponentType<ComponentPropsWithRef<'button'>>;\n    };\n\nconst defaultComponents = {\n  dropdown: {\n    Archive() {\n      const { IconArchive } = useComponentContextIcons();\n      const behaviorProps = useDropdownActionButtonProps(useArchiveAction());\n\n      return (\n        <ContextMenuButton\n          aria-label={behaviorProps.title}\n          data-testid='dropdown-action-archive'\n          Icon={IconArchive}\n          {...behaviorProps}\n        >\n          {behaviorProps.title}\n        </ContextMenuButton>\n      );\n    },\n    Ban() {\n      const { IconNoSign } = useComponentContextIcons();\n      const behaviorProps = useDropdownActionButtonProps(useBanAction());\n\n      return (\n        <ContextMenuButton\n          aria-label={behaviorProps.title}\n          data-testid='dropdown-action-ban'\n          Icon={IconNoSign}\n          {...behaviorProps}\n        >\n          {behaviorProps.title}\n        </ContextMenuButton>\n      );\n    },\n    Leave() {\n      const { IconLeave } = useComponentContextIcons();\n      const behaviorProps = useDropdownActionButtonProps(useLeaveAction());\n\n      return (\n        <ContextMenuButton\n          aria-label={behaviorProps.title}\n          data-testid='dropdown-action-leave'\n          Icon={IconLeave}\n          variant='destructive'\n          {...behaviorProps}\n        >\n          {behaviorProps.title}\n        </ContextMenuButton>\n      );\n    },\n    Mute() {\n      const { IconMute } = useComponentContextIcons();\n      const behaviorProps = useDropdownActionButtonProps(useMuteAction());\n\n      return (\n        <ContextMenuButton\n          aria-label={behaviorProps.title}\n          data-testid='dropdown-action-mute'\n          Icon={IconMute}\n          {...behaviorProps}\n        >\n          {behaviorProps.title}\n        </ContextMenuButton>\n      );\n    },\n    Pin() {\n      const { IconPin } = useComponentContextIcons();\n      const behaviorProps = useDropdownActionButtonProps(usePinAction());\n\n      return (\n        <ContextMenuButton\n          aria-label={behaviorProps.title}\n          data-testid='dropdown-action-pin'\n          Icon={IconPin}\n          {...behaviorProps}\n        >\n          {behaviorProps.title}\n        </ContextMenuButton>\n      );\n    },\n  },\n  quick: {\n    Archive() {\n      const { IconArchive } = useComponentContextIcons();\n      const behaviorProps = useQuickActionButtonProps(useArchiveAction());\n\n      return (\n        <Button\n          appearance='ghost'\n          aria-label={behaviorProps.title}\n          circular\n          data-testid='quick-action-archive'\n          size='sm'\n          variant='secondary'\n          {...behaviorProps}\n        >\n          <IconArchive />\n        </Button>\n      );\n    },\n    Mute() {\n      const { IconMute } = useComponentContextIcons();\n      const behaviorProps = useQuickActionButtonProps(useMuteAction());\n\n      return (\n        <Button\n          appearance='ghost'\n          aria-label={behaviorProps.title}\n          circular\n          data-testid='quick-action-mute'\n          size='sm'\n          variant='secondary'\n          {...behaviorProps}\n        >\n          <IconMute />\n        </Button>\n      );\n    },\n  },\n  QuickDropdownToggle: forwardRef<HTMLButtonElement>((_, ref) => {\n    const { IconMore } = useComponentContextIcons();\n    const { channel } = useChannelListItemContext();\n    const { t } = useTranslationContext();\n\n    const dialogId = ChannelListItemActionButtons.getDialogId({\n      // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n      channelId: channel.id!,\n    });\n    const { dialog, dialogManager } = useDialogOnNearestManager({ id: dialogId });\n    const dialogIsOpen = useDialogIsOpen(dialogId, dialogManager?.id);\n\n    return (\n      <Button\n        appearance='ghost'\n        aria-expanded={dialogIsOpen}\n        aria-label={t(\n          'channelListItem.openChannelActionsMenu.ariaLabel',\n          'Open Channel Actions Menu',\n        )}\n        aria-pressed={dialogIsOpen}\n        circular\n        data-testid='channel-list-item-dropdown-toggle'\n        onClick={(e) => {\n          e.stopPropagation();\n\n          dialog.toggle();\n        }}\n        ref={ref}\n        size='sm'\n        variant='secondary'\n      >\n        <IconMore />\n      </Button>\n    );\n  }),\n};\n\ndefaultComponents.QuickDropdownToggle.displayName = 'QuickDropdownToggle';\n\nexport const defaultChannelActionSet: ChannelActionItem[] = [\n  {\n    Component: defaultComponents.QuickDropdownToggle,\n    placement: 'quick-dropdown-toggle',\n  },\n  {\n    Component: defaultComponents.quick.Mute,\n    placement: 'quick',\n    type: 'mute',\n  },\n  {\n    Component: defaultComponents.dropdown.Archive,\n    placement: 'dropdown',\n    type: 'archive',\n  },\n  {\n    Component: defaultComponents.dropdown.Ban,\n    placement: 'dropdown',\n    type: 'ban',\n  },\n  {\n    Component: defaultComponents.dropdown.Pin,\n    placement: 'dropdown',\n    type: 'pin',\n  },\n  {\n    Component: defaultComponents.dropdown.Leave,\n    placement: 'dropdown',\n    type: 'leave',\n  },\n];\n\nexport const useBaseChannelActionSetFilter = (channelActionSet: ChannelActionItem[]) => {\n  const { channel } = useChannelListItemContext();\n  const membership = useChannelMembershipState(channel);\n  const memberCount = channel.data?.member_count ?? 0;\n  const connectedUserIsMember = typeof membership.user !== 'undefined';\n  const isDirectMessageChannel = connectedUserIsMember && memberCount === 2;\n\n  const ownCapabilities = channel.data?.own_capabilities;\n\n  return useMemo(() => {\n    const filtered = channelActionSet.filter((action) => {\n      if (action.placement === 'quick-dropdown-toggle') return true;\n\n      switch (action.type) {\n        case 'archive':\n          return connectedUserIsMember;\n        case 'mute':\n          return ownCapabilities?.includes('mute-channel');\n        case 'ban':\n          return (\n            isDirectMessageChannel && ownCapabilities?.includes('ban-channel-members')\n          );\n        case 'leave':\n          return ownCapabilities?.includes('leave-channel');\n        case 'pin':\n          return connectedUserIsMember;\n        default:\n          return true;\n      }\n    });\n\n    return filtered;\n  }, [channelActionSet, connectedUserIsMember, ownCapabilities, isDirectMessageChannel]);\n};\n"],"mappings":";;;;;;;;;;;;;;;AAoCA,IAAM,sBAA6C;CACjD,MAAM,EAAE,oBAAoB,mBAAmB;CAC/C,MAAM,EAAE,YAAY,0BAA0B;CAC9C,MAAM,EAAE,MAAM,sBAAsB;CACpC,MAAM,EAAE,OAAO,YAAY,kBAAkB,OAAO;CAEpD,MAAM,SAAS,YAAY;EACzB,IAAI;GACF,IAAI,SAAS;IACX,MAAM,QAAQ,OAAO;IACrB,gBAAgB;KACd,SAAS,EAAE,QAAQ;KACnB,SAAS,6BAA6B;KACtC,SAAS,EAAE,8BAA8B,iBAAiB;KAC1D,UAAU;KACV,MAAM;IACR,CAAC;GACH,OAAO;IACL,MAAM,QAAQ,KAAK;IACnB,gBAAgB;KACd,SAAS,EAAE,QAAQ;KACnB,SAAS,6BAA6B;KACtC,SAAS,EAAE,4BAA4B,eAAe;KACtD,UAAU;KACV,MAAM;IACR,CAAC;GACH;EACF,SAAS,OAAO;GACd,gBAAgB;IACd,SAAS,EAAE,QAAQ;IACnB,SAAS,6BAA6B;IACtC,OAAO,iBAAiB,QAAQ,wBAAQ,IAAI,MAAM,2BAA2B;IAC7E,SAAS,EACP,gDACA,sCACF;IACA,UAAU;IACV,MAAM;GACR,CAAC;EACH;CACF;CAEA,OAAO;EACL,gBAAgB;EAChB,OAAO,UAAU,EAAE,uBAAuB,QAAQ,IAAI,EAAE,qBAAqB,MAAM;EACnF;CACF;AACF;AA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