@linktr.ee/messaging-react 3.37.0 → 3.37.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/dist/Card-415OfRhw.cjs.map +1 -1
- package/dist/{Card-D4PPD5qa.js → Card-DVMzYquF.js} +11 -8
- package/dist/Card-DVMzYquF.js.map +1 -0
- package/dist/{Card-qS17qnN0.js → Card-DaJtDL7m.js} +15 -6
- package/dist/Card-DaJtDL7m.js.map +1 -0
- package/dist/Card-Dxk_Ggxw.cjs.map +1 -1
- package/dist/LoadingDots-Ct3WmVlT.js.map +1 -1
- package/dist/LoadingDots-D9GGphgM.cjs.map +1 -1
- package/dist/{index-DGmVyxHy.js → index-BOBIiAuD.js} +87 -62
- package/dist/index-BOBIiAuD.js.map +1 -0
- package/dist/index-D7A8U8GQ.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +3 -2
- package/src/components/ActionButton/ActionButton.stories.tsx +0 -2
- package/src/components/ActionButton/ActionButton.test.tsx +60 -55
- package/src/components/ActionButton/index.tsx +13 -14
- package/src/components/AttachmentCard/AttachmentCard.stories.tsx +1 -3
- package/src/components/AttachmentCard/MediaPlayer.tsx +9 -7
- package/src/components/AttachmentCard/index.tsx +6 -2
- package/src/components/Avatar/Avatar.stories.tsx +17 -5
- package/src/components/Avatar/index.tsx +13 -23
- package/src/components/ChannelView.test.tsx +6 -10
- package/src/components/CustomMessage/CustomMessage.stories.tsx +7 -2
- package/src/components/CustomMessage/CustomMessage.test.tsx +5 -3
- package/src/components/CustomMessage/LockedAttachment/LockedAttachment.test.tsx +5 -4
- package/src/components/CustomMessage/LockedAttachment/components/Text/Card.tsx +2 -4
- package/src/components/CustomMessage/LockedAttachment/components/_shared/CardBody.tsx +9 -6
- package/src/components/CustomMessage/LockedAttachment/components/_shared/CardThumbnail.tsx +1 -3
- package/src/components/CustomMessage/LockedAttachment/components/_shared/GalleryThumbnail.tsx +1 -4
- package/src/components/CustomMessage/LockedAttachment/components/_shared/PurchaseStatusBadge.tsx +0 -1
- package/src/components/CustomMessage/LockedAttachment/components/_shared/SingleThumbnail.tsx +1 -4
- package/src/components/CustomMessage/LockedAttachment/components/_shared/SkeletonTextLines.tsx +7 -2
- package/src/components/CustomMessage/LockedAttachment/types.ts +4 -3
- package/src/components/CustomMessage/MessageAttachmentConversations.stories.tsx +89 -86
- package/src/components/CustomMessage/MessageVoteButtons.tsx +4 -1
- package/src/components/CustomMessage/SentMessageDeliveryStatus.test.tsx +13 -10
- package/src/components/CustomMessage/SentMessageDeliveryStatus.tsx +1 -4
- package/src/components/CustomMessage/StreamAttachmentMessage.stories.tsx +4 -4
- package/src/components/CustomMessage/StreamAttachmentMessage.test.tsx +6 -7
- package/src/components/CustomMessage/context.tsx +7 -2
- package/src/components/CustomMessage/index.tsx +1 -4
- package/src/components/CustomMessageInput/CustomMessageInput.stories.tsx +33 -11
- package/src/components/CustomMessageInput/CustomMessageInput.test.tsx +3 -3
- package/src/components/CustomSystemMessage/CustomSystemMessage.test.tsx +6 -9
- package/src/components/CustomTypingIndicator/CustomTypingIndicator.stories.tsx +4 -1
- package/src/components/IconButton/index.tsx +21 -17
- package/src/components/LinkAttachment/LinkAttachment.test.tsx +4 -1
- package/src/components/LinkAttachment/components/_shared/CardCta.tsx +4 -1
- package/src/components/Loading/Loading.stories.tsx +1 -4
- package/src/components/MediaMessage/MediaMessage.stories.tsx +6 -18
- package/src/components/MediaMessage/MediaMessage.test.tsx +30 -16
- package/src/components/MediaMessage/index.tsx +51 -14
- package/src/components/MessageAttachment/Audio/AudioAttachment.stories.tsx +4 -2
- package/src/components/MessageAttachment/File/FileAttachment.stories.tsx +3 -1
- package/src/components/MessageAttachment/Image/ImageAttachment.stories.tsx +15 -4
- package/src/components/MessageAttachment/Image/index.tsx +6 -12
- package/src/components/MessageAttachment/MessageAttachment.test.tsx +59 -27
- package/src/components/MessageAttachment/Pdf/PdfAttachment.stories.tsx +3 -1
- package/src/components/MessageAttachment/Pdf/index.tsx +2 -3
- package/src/components/MessageAttachment/Video/VideoAttachment.stories.tsx +11 -3
- package/src/components/MessageAttachment/Video/index.tsx +9 -14
- package/src/components/MessageAttachment/_shared/CompactDocumentRow.tsx +1 -3
- package/src/components/MessageAttachment/_shared/ImageViewer.tsx +1 -3
- package/src/components/MessageAttachment/_shared/MediaStackGrid.tsx +5 -1
- package/src/components/MessageAttachment/_shared/PdfViewer.tsx +1 -3
- package/src/components/MessageAttachment/_shared/VideoViewer.tsx +1 -3
- package/src/components/MessageAttachment/_shared/fileMeta.test.ts +4 -6
- package/src/components/MessageAttachment/stories/StoryTable.tsx +1 -3
- package/src/components/MessageBubble/MessageBubble.stories.tsx +5 -1
- package/src/components/MessageBubble/MessageBubble.test.tsx +1 -3
- package/src/components/MessageBubble/components/_shared/bubbleTail.tsx +2 -1
- package/src/components/MessagingShell/LoadingState.stories.tsx +0 -1
- package/src/components/RichCard/RichCard.stories.tsx +14 -3
- package/src/components/RichCard/RichCard.test.tsx +16 -4
- package/src/components/RichCard/RichCardBody.tsx +11 -3
- package/src/components/RichCard/RichCardCard.tsx +1 -3
- package/src/components/RichCard/RichCardImages.tsx +2 -4
- package/src/components/SearchInput/SearchInput.stories.tsx +0 -1
- package/src/components/SearchInput/SearchInput.test.tsx +94 -65
- package/src/hooks/useChannelStar.ts +3 -1
- package/src/hooks/useMessaging.ts +4 -4
- package/src/stories/decorators/storyUser.tsx +2 -2
- package/src/stories/mocks.tsx +4 -1
- package/src/styles.css +23 -8
- package/src/types.ts +1 -2
- package/src/utils/cdnImageUrl.test.ts +3 -1
- package/dist/Card-D4PPD5qa.js.map +0 -1
- package/dist/Card-qS17qnN0.js.map +0 -1
- package/dist/index-DGmVyxHy.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Card-Dxk_Ggxw.cjs","sources":["../src/components/CustomMessage/LockedAttachment/components/_shared/CardBody.tsx","../src/components/CustomMessage/LockedAttachment/components/_shared/LockBadge.tsx","../src/components/CustomMessage/LockedAttachment/components/_shared/GalleryThumbnail.tsx","../src/components/CustomMessage/LockedAttachment/components/_shared/SingleThumbnail.tsx","../src/components/CustomMessage/LockedAttachment/components/_shared/CardThumbnail.tsx","../src/components/CustomMessage/LockedAttachment/components/_shared/MediaShell.tsx","../src/components/CustomMessage/LockedAttachment/components/_shared/PreviewToggle.tsx","../src/components/CustomMessage/LockedAttachment/components/_shared/usePreviewToggle.ts","../src/components/CustomMessage/LockedAttachment/components/_shared/useReceivedSource.ts","../src/components/CustomMessage/LockedAttachment/components/Media/CardActions.tsx","../src/components/CustomMessage/LockedAttachment/components/Media/Card.tsx"],"sourcesContent":["import classNames from 'classnames'\nimport React from 'react'\n\nimport { renderTypeIcon } from '../../../../AttachmentCard'\n\nimport type { CardVariant } from './MediaShell'\n\nexport interface CardBodyProps {\n variant: CardVariant\n title?: string\n placeholderTitle?: string\n mimeType: string\n detail?: string\n statusBadge?: React.ReactNode\n action?: React.ReactNode\n /** Overrides the auto-detected type icon (used by Gallery to swap in an `Images` icon). */\n icon?: React.ReactNode\n /** Optional control rendered on the right of the title/status block (e.g. Composer edit pencil). */\n trailingAction?: React.ReactNode\n}\n\n/**\n * Title + status row layout shared by Composer and `LockedAttachment.Media`.\n * Layout matches the Figma `Container > Labels` group (16px h-padding, 12px v-padding,\n * 4px gap between title and status row, 4px gap inside status row).\n */\nconst CardBody: React.FC<CardBodyProps> = ({\n variant,\n title,\n placeholderTitle = 'Attachment title',\n mimeType,\n detail,\n statusBadge,\n action,\n icon,\n trailingAction,\n}) => {\n const isDark = variant === 'dark'\n const displayTitle = title || placeholderTitle\n const titleDimmed = !title\n\n const typeIcon =\n icon ??\n renderTypeIcon(mimeType, {\n className: classNames(\n 'size-5 shrink-0',\n isDark ? 'text-white/55' : 'text-black/55'\n ),\n weight: 'regular',\n })\n\n return (\n <div className=\"px-4 py-3\">\n <div className=\"flex items-end gap-3\">\n <div className=\"flex min-w-0 flex-1 flex-col gap-1\">\n {displayTitle.trim() !== '' && (\n <p\n className={classNames('truncate text-base font-medium leading-6', {\n 'text-black/90': !isDark && !titleDimmed,\n 'text-black/30': !isDark && titleDimmed,\n 'text-white/30': isDark && titleDimmed,\n 'text-white': isDark && !titleDimmed,\n })}\n >\n {displayTitle}\n </p>\n )}\n\n <div className=\"flex flex-wrap items-center gap-1\">\n {typeIcon}\n\n {detail != null && detail !== '' && (\n <span\n className={classNames(\n 'text-xs font-medium',\n isDark ? 'text-white/55' : 'text-black/55'\n )}\n >\n {detail}\n </span>\n )}\n\n {statusBadge}\n </div>\n </div>\n\n {trailingAction && <div className=\"shrink-0\">{trailingAction}</div>}\n </div>\n\n {action}\n </div>\n )\n}\n\nexport default CardBody\n","import { LockOpenIcon, LockSimpleIcon, PlayIcon } from '@phosphor-icons/react'\nimport classNames from 'classnames'\nimport React from 'react'\n\nimport { getSourceType } from '../../../../AttachmentCard'\nimport type { PaymentStatus } from '../../types'\n\nexport interface LockBadgeProps {\n paymentStatus?: PaymentStatus\n mimeType?: string\n /**\n * Overrides the `mimeType`-derived playable check. Lets a caller that\n * already knows per-item playability (e.g. `GalleryThumbnail`, checking a\n * carousel item's own mimeType rather than the card's single `mimeType`)\n * skip re-deriving it.\n */\n isPlayable?: boolean\n /** Whether the item is still locked. Play only ever shows once unlocked —\n * a locked item always shows the lock, even for otherwise-playable media. */\n isLocked: boolean\n}\n\n/**\n * Centered 48x48 lock badge that overlays the thumbnail of any locked attachment.\n * Uses `bg-black/30`. Stays `pointer-events-none` so clicks pass through to\n * the underlying player/toggle; the play state highlights via `group-hover`\n * (same `bg-black/40` as the gallery's prev/next arrows) — the ancestor\n * providing `group` must wrap the actual clickable/hoverable player area.\n *\n * For playable media (video/audio) that's unlocked, the badge shows a play\n * icon instead of a lock — matching the convention used by `GalleryThumbnail`.\n */\nexport const LockBadge: React.FC<LockBadgeProps> = ({\n paymentStatus,\n mimeType,\n isPlayable,\n isLocked,\n}) => {\n const sourceType = mimeType ? getSourceType(mimeType) : undefined\n const resolvedIsPlayable =\n isPlayable ?? (sourceType === 'video' || sourceType === 'audio')\n\n const Icon =\n resolvedIsPlayable && !isLocked\n ? PlayIcon\n : paymentStatus === 'paid'\n ? LockOpenIcon\n : LockSimpleIcon\n return (\n <div className=\"pointer-events-none absolute inset-0 flex items-center justify-center\">\n <div\n className={classNames(\n 'flex size-12 items-center justify-center rounded-full bg-black/30 text-white',\n Icon === PlayIcon && 'group-hover:bg-black/40'\n )}\n >\n <Icon className=\"size-6\" weight=\"fill\" />\n </div>\n </div>\n )\n}\n\nexport default LockBadge\n","import { CaretLeftIcon, CaretRightIcon } from '@phosphor-icons/react'\nimport classNames from 'classnames'\nimport React, { useState } from 'react'\n\nimport { optimizeMessagingAttachmentUrl } from '../../../../../utils/cdnImageUrl'\nimport { AttachmentThumbnail, getSourceType } from '../../../../AttachmentCard'\nimport type {\n LockedAttachmentGalleryItem,\n PaymentStatus,\n} from '../../types'\n\nimport { LockBadge } from './LockBadge'\nimport type { CardVariant } from './MediaShell'\n\nexport interface GalleryThumbnailProps {\n variant: CardVariant\n gallery: LockedAttachmentGalleryItem[]\n title?: string\n /** When true, all items are shown blurred + the locked/play badge is overlaid. */\n showLocked: boolean\n paymentStatus?: PaymentStatus\n /** Top-right slot (e.g. dismiss X on Composer). Rendered inside the thumbnail. */\n topRight?: React.ReactNode\n}\n\nfunction isPlayableItem(item: LockedAttachmentGalleryItem): boolean {\n const sourceType = getSourceType(item.mimeType)\n return sourceType === 'video' || sourceType === 'audio'\n}\n\n/**\n * Mixed-media carousel used by every LockedAttachment card when its `gallery`\n * prop has 2+ items. Matches the \"Gallery\" frames in the Figma design system:\n * 337/386 aspect ratio, prev/next caret buttons, a counter pill, and a center\n * lock / play indicator that swaps based on the current item.\n */\nconst GalleryThumbnail: React.FC<GalleryThumbnailProps> = ({\n variant,\n gallery,\n title,\n showLocked,\n paymentStatus,\n topRight,\n}) => {\n const [index, setIndex] = useState(0)\n const total = gallery.length\n const safeIndex = Math.min(index, total - 1)\n const current = gallery[safeIndex]\n const isVideoItem = isPlayableItem(current)\n const optimizedCurrentThumbnailUrl = optimizeMessagingAttachmentUrl(\n current.thumbnailUrl\n )\n\n // Stop propagation so arrow taps don't bubble up to the outer preview-toggle\n // wrapper on PreviewMediaCard / OwnMediaCard.\n const goPrev = (e: React.MouseEvent) => {\n e.stopPropagation()\n setIndex((i) => Math.max(0, i - 1))\n }\n const goNext = (e: React.MouseEvent) => {\n e.stopPropagation()\n setIndex((i) => Math.min(total - 1, i + 1))\n }\n const atStart = safeIndex === 0\n const atEnd = safeIndex === total - 1\n\n const isDark = variant === 'dark'\n\n // Locked + unlocked render entirely separate trees so the locked state\n // doesn't end up stacking a blurred `<img>` on top of an underlying\n // `AttachmentThumbnail` (whose `bg-white/10` poster shell otherwise\n // shows through as a visible horizontal seam).\n //\n // The locked placeholder is absolutely positioned, so it needs the fixed\n // 337/386 box for height; unlocked content (video, natural-sized image)\n // manages its own height and can expand/shrink per item.\n //\n // The locked branch uses `filter: blur` on a single full-size `<img>`\n // — not `backdrop-filter` — so the rounded corners are clipped\n // normally without any clip-path workarounds (see SingleThumbnail).\n return (\n <div\n className={classNames(\n 'group relative overflow-hidden rounded-t-md',\n showLocked ? 'aspect-[337/386]' : undefined\n )}\n >\n {showLocked ? (\n <div\n className={classNames(\n 'absolute inset-0',\n isDark ? 'bg-white/10' : 'bg-black/5'\n )}\n >\n {current.thumbnailUrl && (\n <img\n src={optimizedCurrentThumbnailUrl ?? current.thumbnailUrl}\n alt=\"\"\n aria-hidden\n draggable={false}\n // `scale-110` hides the fuzzy edge that `filter: blur` leaves\n // around the image bounds.\n className=\"absolute inset-0 h-full w-full scale-110 object-cover blur-[40px]\"\n />\n )}\n </div>\n ) : (\n <AttachmentThumbnail\n key={safeIndex}\n mimeType={current.mimeType}\n sourceUrl={current.sourceUrl}\n thumbnailUrl={current.thumbnailUrl}\n title={title}\n variant={variant}\n mediaPlayerProps={{ autoPlay: true }}\n />\n )}\n\n {/* LOCK while locked. Once unlocked, video/audio autoplays via\n `mediaPlayerProps` and MediaPlayer already has its own inline\n controls, so no separate Play affordance is shown. */}\n {showLocked && (\n <LockBadge\n paymentStatus={paymentStatus}\n isPlayable={isVideoItem}\n isLocked={showLocked}\n />\n )}\n\n {total > 1 && (\n <React.Fragment>\n <button\n type=\"button\"\n onClick={goPrev}\n disabled={atStart}\n aria-label=\"Previous item\"\n className={classNames(\n 'absolute left-3 top-1/2 -translate-y-1/2 flex size-7 items-center justify-center rounded-full bg-black/30 text-white transition-opacity',\n atStart ? 'opacity-40' : 'hover:bg-black/40'\n )}\n >\n <CaretLeftIcon className=\"size-5\" weight=\"bold\" />\n </button>\n <button\n type=\"button\"\n onClick={goNext}\n disabled={atEnd}\n aria-label=\"Next item\"\n className={classNames(\n 'absolute right-3 top-1/2 -translate-y-1/2 flex size-7 items-center justify-center rounded-full bg-black/30 text-white transition-opacity',\n atEnd ? 'opacity-40' : 'hover:bg-black/40'\n )}\n >\n <CaretRightIcon className=\"size-5\" weight=\"bold\" />\n </button>\n\n <div className=\"pointer-events-none absolute bottom-10 left-1/2 flex size-8 -translate-x-1/2 items-center justify-center rounded-full bg-black/30\">\n <span className=\"text-xs font-medium leading-none text-white\">\n {safeIndex + 1}/{total}\n </span>\n </div>\n </React.Fragment>\n )}\n\n {topRight && (\n <div className=\"pointer-events-auto absolute right-3 top-3 z-10\">\n {topRight}\n </div>\n )}\n </div>\n )\n}\n\nexport default GalleryThumbnail\n","import classNames from 'classnames'\nimport React from 'react'\n\nimport { optimizeMessagingAttachmentUrl } from '../../../../../utils/cdnImageUrl'\nimport {\n AttachmentThumbnail,\n renderTypeIcon,\n} from '../../../../AttachmentCard'\nimport type { LockedAttachmentSource, PaymentStatus } from '../../types'\n\nimport { LockBadge } from './LockBadge'\nimport type { CardVariant } from './MediaShell'\n\nexport interface SingleThumbnailProps {\n variant: CardVariant\n mimeType: string\n thumbnailUrl?: string\n title?: string\n /**\n * When provided, the underlying source is shown unblurred (preview / unlocked state).\n * When undefined, the thumbnail is treated as locked: blurred with a central lock badge.\n */\n source?: LockedAttachmentSource\n /**\n * Forces the locked appearance even when a source is provided. Used for the\n * Composer card where the locked treatment is the default and the user toggles\n * a preview in place.\n */\n showLocked: boolean\n paymentStatus?: PaymentStatus\n /** Top-right overlay (e.g. dismiss X on Composer). Rendered inside the thumbnail. */\n topRight?: React.ReactNode\n /** When true, renders the unlocked image with aspect-video + object-contain. */\n containedImage?: boolean\n}\n\n/**\n * Renders the 180px-tall media area for a LockedAttachment card.\n * Handles three visual states:\n * - locked: blurred thumbnail + centered 48px lock badge\n * - preview/paid: clear thumbnail (the underlying source)\n * - empty: type-icon placeholder\n */\nconst SingleThumbnail: React.FC<SingleThumbnailProps> = ({\n variant,\n mimeType,\n thumbnailUrl,\n title,\n source,\n showLocked,\n paymentStatus,\n topRight,\n containedImage = false,\n}) => {\n const effectiveSourceUrl = showLocked ? undefined : source?.sourceUrl\n const effectiveThumbnailUrl = showLocked\n ? thumbnailUrl\n : (source?.thumbnailUrl ?? thumbnailUrl)\n const optimizedThumbnailUrl = optimizeMessagingAttachmentUrl(\n effectiveThumbnailUrl\n )\n\n const isDark = variant === 'dark'\n\n // Locked + unlocked render entirely separate trees so the locked state\n // doesn't end up stacking a blurred `<img>` on top of an underlying\n // `AttachmentThumbnail` (whose `bg-white/10` poster shell otherwise\n // shows through as a visible horizontal seam at the 16:9 boundary).\n //\n // The locked branch uses `filter: blur` on a single full-size `<img>`\n // — not `backdrop-filter` — because `backdrop-filter` paints in its\n // own compositing layer that escapes ancestor `overflow: hidden` on\n // Chrome/Safari and flattens the card's top corners. `filter` is\n // clipped normally, so the rounded corners stay round without any\n // clip-path workarounds.\n return (\n <div className=\"relative overflow-hidden rounded-t-md\">\n {showLocked ? (\n <div\n className={classNames(\n 'relative aspect-video overflow-hidden',\n isDark ? 'bg-white/10' : 'bg-black/5'\n )}\n >\n {effectiveThumbnailUrl ? (\n <img\n src={optimizedThumbnailUrl ?? effectiveThumbnailUrl}\n alt=\"\"\n aria-hidden\n draggable={false}\n // `scale-110` hides the fuzzy semi-transparent edge that\n // `filter: blur` leaves around the image bounds.\n className=\"absolute inset-0 h-full w-full scale-110 object-cover blur-[40px]\"\n />\n ) : (\n <div className=\"absolute inset-0 flex items-center justify-center\">\n {renderTypeIcon(mimeType, {\n className: isDark\n ? 'size-12 text-white/20'\n : 'size-12 text-black/20',\n weight: 'regular',\n })}\n </div>\n )}\n <LockBadge\n paymentStatus={paymentStatus}\n mimeType={mimeType}\n isLocked={showLocked}\n />\n </div>\n ) : (\n <AttachmentThumbnail\n mimeType={mimeType}\n sourceUrl={effectiveSourceUrl}\n thumbnailUrl={effectiveThumbnailUrl}\n title={title}\n variant={variant}\n containedImage={containedImage}\n mediaPlayerProps={\n effectiveSourceUrl\n ? { autoPlay: true, loop: true, controls: true, muted: false }\n : undefined\n }\n />\n )}\n\n {topRight && (\n <div className=\"pointer-events-auto absolute right-3 top-3 z-10\">\n {topRight}\n </div>\n )}\n </div>\n )\n}\n\nexport default SingleThumbnail\n","import { ImagesIcon } from '@phosphor-icons/react'\nimport type React from 'react'\n\nimport type {\n LockedAttachmentGalleryItem,\n LockedAttachmentSource,\n PaymentStatus,\n} from '../../types'\n\nimport GalleryThumbnail from './GalleryThumbnail'\nimport type { CardVariant } from './MediaShell'\nimport SingleThumbnail from './SingleThumbnail'\n\nexport interface CardThumbnailProps {\n variant: CardVariant\n gallery: LockedAttachmentGalleryItem[]\n title?: string\n showLocked: boolean\n paymentStatus?: PaymentStatus\n /** Single-asset props — ignored when the card renders as a gallery. */\n mimeType: string\n thumbnailUrl?: string\n source?: LockedAttachmentSource\n containedImage?: boolean\n /** Top-right overlay (e.g. Composer dismiss X). Rendered inside the thumbnail. */\n topRight?: React.ReactNode\n}\n\n/** True when the card should render as a mixed-media carousel (2+ items). */\nexport const isGalleryCard = (\n gallery: LockedAttachmentGalleryItem[]\n): boolean => gallery.length >= 2\n\n/**\n * The body-row icon a card shows when it renders as a gallery — `CardBody`\n * otherwise auto-detects the icon from `mimeType`. Returned as a ready node so\n * every card shares the same size/tone treatment.\n */\nexport const galleryBodyIcon = (\n variant: CardVariant\n): React.ReactNode => (\n <ImagesIcon\n className={\n variant === 'dark'\n ? 'size-5 shrink-0 text-white/55'\n : 'size-5 shrink-0 text-black/55'\n }\n />\n)\n\n/**\n * Owns the single-vs-gallery thumbnail decision shared by Composer /\n * `LockedAttachment.Media` cards: renders `GalleryThumbnail` for a 2+ item `gallery`,\n * else `SingleThumbnail` for the single asset. Callers pass the superset of\n * props; the unused half is ignored by whichever branch renders.\n */\nconst CardThumbnail: React.FC<CardThumbnailProps> = ({\n variant,\n gallery,\n title,\n showLocked,\n paymentStatus,\n mimeType,\n thumbnailUrl,\n source,\n containedImage,\n topRight,\n}) =>\n isGalleryCard(gallery) ? (\n <GalleryThumbnail\n variant={variant}\n gallery={gallery}\n title={title}\n showLocked={showLocked}\n paymentStatus={paymentStatus}\n topRight={topRight}\n />\n ) : (\n <SingleThumbnail\n variant={variant}\n mimeType={mimeType}\n thumbnailUrl={thumbnailUrl}\n title={title}\n source={source}\n showLocked={showLocked}\n paymentStatus={paymentStatus}\n topRight={topRight}\n containedImage={containedImage}\n />\n )\n\nexport default CardThumbnail\n","import classNames from 'classnames'\nimport React from 'react'\n\nexport type CardVariant = 'dark' | 'light'\n\nexport interface MediaShellProps {\n variant: CardVariant\n children: React.ReactNode\n rootRef?: React.Ref<HTMLDivElement>\n 'data-testid'?: string\n}\n\n/**\n * Outer chrome for every LockedAttachment card.\n * Mirrors the 16px radius treatment from the Figma design system.\n */\nconst MediaShell: React.FC<MediaShellProps> = ({\n variant,\n children,\n rootRef,\n 'data-testid': dataTestId,\n}) => (\n <div\n ref={rootRef}\n data-testid={dataTestId}\n className={classNames(\n 'relative w-[280px] select-none overflow-hidden rounded-md',\n variant === 'dark' ? 'bg-[#1e2330]' : 'bg-white',\n 'shadow-[0_1px_2px_rgba(0,0,0,0.08)]'\n )}\n >\n {children}\n </div>\n)\n\nexport default MediaShell\n","import React from 'react'\n\nexport interface PreviewToggleProps {\n /** Toggles the preview; omit to render `children` with no wrapper at all (nothing to toggle). */\n onToggle: (() => void | Promise<void>) | undefined\n isBusy: boolean\n isPreviewVisible: boolean\n children: React.ReactNode\n}\n\n/**\n * Makes a locked thumbnail clickable to toggle its preview. Uses a\n * `role=\"button\"` div rather than a native `<button>` because the thumbnail\n * it wraps can itself contain interactive children (gallery carousel arrows,\n * a Composer dismiss X) — nesting a real `<button>` around those would\n * produce invalid, inaccessible nested-interactive-element markup.\n */\nconst PreviewToggle: React.FC<PreviewToggleProps> = ({\n onToggle,\n isBusy,\n isPreviewVisible,\n children,\n}) => {\n if (!onToggle) return <React.Fragment>{children}</React.Fragment>\n\n return (\n <div\n role=\"button\"\n tabIndex={isBusy ? -1 : 0}\n aria-label=\"Toggle preview\"\n aria-busy={isBusy}\n aria-pressed={isPreviewVisible}\n aria-disabled={isBusy || undefined}\n onClick={isBusy ? undefined : onToggle}\n onKeyDown={(e) => {\n if (isBusy) return\n // Only handle keys that originate on the wrapper itself, not on\n // inner interactive elements (dismiss X, carousel arrows). Without\n // this guard, pressing Enter/Space on a focused child would bubble\n // up and toggle the preview in addition to activating the child.\n if (e.target !== e.currentTarget) return\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n void onToggle()\n }\n }}\n className={\n !isBusy\n ? 'block w-full cursor-pointer text-left'\n : 'block w-full text-left'\n }\n >\n {children}\n </div>\n )\n}\n\nexport default PreviewToggle\n","import { useCallback, useRef, useState } from 'react'\n\nimport type { LockedAttachmentSource } from '../../types'\n\nexport interface UsePreviewToggleOptions {\n /** Gallery items carry their own per-item sources on the `gallery` prop already, so toggling skips the async fetch entirely. */\n isGallery: boolean\n /**\n * Lazily loads the underlying source; the resolved value is cached in\n * `source` and reused on subsequent toggles.\n */\n onFetchSource?: () => Promise<LockedAttachmentSource | void>\n /** Fired on every toggle tap, before any visibility/fetch logic runs. */\n onPreviewClick?: () => void\n}\n\nexport interface UsePreviewToggleResult {\n source: LockedAttachmentSource | undefined\n isPreviewVisible: boolean\n isLoadingPreview: boolean\n handleToggle: () => Promise<void>\n /**\n * `handleToggle` when the card can actually be previewed (gallery, or a\n * fetch/click handler is wired), else `undefined` — pass straight to\n * `PreviewToggle.onToggle` so a non-previewable card renders no\n * toggle affordance.\n */\n togglePreview: (() => Promise<void>) | undefined\n}\n\n/**\n * Shared preview-toggle state for Composer/Media isMine: flips a locked thumbnail to\n * its unlocked preview, lazily fetching and caching the source on first\n * reveal. Media !isMine doesn't use this — it fetches on scroll-into-view/paid\n * instead of on a toggle tap.\n */\nexport function usePreviewToggle({\n isGallery,\n onFetchSource,\n onPreviewClick,\n}: UsePreviewToggleOptions): UsePreviewToggleResult {\n const [source, setSource] = useState<LockedAttachmentSource | undefined>()\n const [isPreviewVisible, setIsPreviewVisible] = useState(false)\n const [isLoadingPreview, setIsLoadingPreview] = useState(false)\n const fetchingRef = useRef(false)\n\n const handleToggle = useCallback(async () => {\n onPreviewClick?.()\n if (isPreviewVisible) {\n setIsPreviewVisible(false)\n return\n }\n if (isGallery) {\n setIsPreviewVisible(true)\n return\n }\n if (source) {\n setIsPreviewVisible(true)\n return\n }\n if (!onFetchSource) return\n if (fetchingRef.current) return\n fetchingRef.current = true\n setIsLoadingPreview(true)\n try {\n const result = await onFetchSource()\n if (result) {\n setSource(result)\n setIsPreviewVisible(true)\n }\n } finally {\n fetchingRef.current = false\n setIsLoadingPreview(false)\n }\n }, [isPreviewVisible, isGallery, source, onPreviewClick, onFetchSource])\n\n const togglePreview =\n isGallery || onFetchSource != null || onPreviewClick != null\n ? handleToggle\n : undefined\n\n return {\n source,\n isPreviewVisible,\n isLoadingPreview,\n handleToggle,\n togglePreview,\n }\n}\n","/* eslint-disable react-hooks/refs -- pre-existing pattern flagged by the React\n Compiler rules added in eslint-plugin-react-hooks v7; refactoring it is\n out of scope for the lint toolchain upgrade. */\nimport { useCallback, useEffect, useRef, useState } from 'react'\n\nimport type {\n FetchSourceHandler,\n LockedAttachmentSource,\n PaymentStatus,\n} from '../../types'\n\nexport interface UseReceivedSourceOptions {\n paymentStatus?: PaymentStatus\n onFetchSource?: FetchSourceHandler\n /** Called on Unlock click while the card is still unpaid (opens checkout). */\n onUnlockClick?: () => void\n}\n\nexport interface UseReceivedSourceResult {\n source: LockedAttachmentSource | undefined\n /** Attach to the card root so the paid-source auto-fetch can observe it. */\n cardRef: React.RefObject<HTMLDivElement>\n /** Fetches the source when already paid, else defers to `onUnlockClick`. */\n handleUnlockClick: () => void\n}\n\n/**\n * Media !isMine's source-reveal logic: unlike Composer/Media isMine's\n * tap-to-toggle (`usePreviewToggle`), the recipient's card reveals its source\n * by fetching once — on click when already paid, or automatically the first\n * time a paid card scrolls fully into view. The fetch is guarded so it runs\n * at most once in flight.\n */\nexport function useReceivedSource({\n paymentStatus,\n onFetchSource,\n onUnlockClick,\n}: UseReceivedSourceOptions): UseReceivedSourceResult {\n const [source, setSource] = useState<LockedAttachmentSource | undefined>()\n\n const cardRef = useRef<HTMLDivElement>(null)\n const fetchingRef = useRef(false)\n\n const onFetchSourceRef = useRef(onFetchSource)\n onFetchSourceRef.current = onFetchSource\n\n const fetchSource = useCallback(async (): Promise<void> => {\n if (fetchingRef.current) return\n fetchingRef.current = true\n try {\n const result = await onFetchSourceRef.current?.()\n if (result) setSource(result)\n } finally {\n fetchingRef.current = false\n }\n }, [])\n\n const handleUnlockClick = useCallback(() => {\n if (paymentStatus === 'paid') {\n void fetchSource()\n } else {\n onUnlockClick?.()\n }\n }, [paymentStatus, fetchSource, onUnlockClick])\n\n // Auto-fetch the source once the paid card scrolls into view.\n useEffect(() => {\n if (!cardRef.current) return\n if (paymentStatus !== 'paid' || source !== undefined) return\n\n const observer = new IntersectionObserver(\n ([entry]) => {\n if (entry.isIntersecting) {\n void fetchSource()\n observer.disconnect()\n }\n },\n { threshold: 1.0 }\n )\n\n observer.observe(cardRef.current)\n return () => observer.disconnect()\n }, [paymentStatus, source, fetchSource])\n\n return { source, cardRef, handleUnlockClick }\n}\n","import { DownloadSimpleIcon, LockSimpleIcon } from '@phosphor-icons/react'\nimport React from 'react'\n\nimport LoadingDots from '../_shared/LoadingDots'\n\nexport interface ReceivedCardActionsProps {\n /** Whether the card is currently locked. Drives which CTA we render. */\n isLocked: boolean\n /**\n * When unlocked, the URL used as the Download link's `href` (opens in a new\n * tab). When omitted, the Download CTA falls back to a plain `<button>`\n * that just calls `onDownloadClicked` — useful for galleries where the\n * single-source URL doesn't exist.\n */\n sourceUrl?: string\n /** Optional alternate href that takes precedence over `sourceUrl`. */\n redeemUrl?: string\n onUnlockClicked?: () => void\n onDownloadClicked?: () => void\n isUnlocking?: boolean\n}\n\nconst buttonClass =\n 'mt-3 inline-flex h-10 w-full items-center justify-center gap-2 rounded-full bg-[#121110] px-4 text-sm font-medium leading-none text-white hover:bg-[#2a2928]'\n\n/**\n * Renders the primary CTA below the body of a Received card.\n * - Locked + onUnlockClicked → \"Unlock\" button\n * - Unlocked + onDownloadClicked + (redeemUrl || sourceUrl) → \"Download\" link\n * - Unlocked + onDownloadClicked + no URL → \"Download\" button (e.g. gallery)\n * Otherwise renders nothing.\n */\nconst ReceivedCardActions: React.FC<ReceivedCardActionsProps> = ({\n isLocked,\n sourceUrl,\n redeemUrl,\n onUnlockClicked,\n onDownloadClicked,\n isUnlocking = false,\n}) => {\n if (isLocked && onUnlockClicked != null) {\n return (\n <button\n type=\"button\"\n onClick={onUnlockClicked}\n disabled={isUnlocking}\n aria-label={isUnlocking ? 'Unlocking' : 'Unlock'}\n aria-busy={isUnlocking}\n title={isUnlocking ? 'Unlocking' : 'Unlock'}\n className={buttonClass}\n >\n {isUnlocking ? (\n <LoadingDots />\n ) : (\n <React.Fragment>\n <LockSimpleIcon className=\"size-4\" weight=\"fill\" />\n Unlock\n </React.Fragment>\n )}\n </button>\n )\n }\n\n if (!isLocked && onDownloadClicked != null) {\n const href = redeemUrl ?? sourceUrl\n if (href != null) {\n return (\n <a\n href={href}\n aria-label=\"Download\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n onClick={onDownloadClicked}\n className={`${buttonClass} !text-white`}\n >\n <DownloadSimpleIcon className=\"size-4\" weight=\"bold\" />\n Download\n </a>\n )\n }\n\n return (\n <button\n type=\"button\"\n onClick={onDownloadClicked}\n aria-label=\"Download\"\n className={buttonClass}\n >\n <DownloadSimpleIcon className=\"size-4\" weight=\"bold\" />\n Download\n </button>\n )\n }\n\n return null\n}\n\nexport default ReceivedCardActions\n","import { PencilSimpleIcon, XIcon } from '@phosphor-icons/react'\nimport React from 'react'\n\nimport { getSourceType } from '../../../../AttachmentCard'\nimport CardBody from '../_shared/CardBody'\nimport CardThumbnail, {\n galleryBodyIcon,\n isGalleryCard,\n} from '../_shared/CardThumbnail'\nimport MediaShell from '../_shared/MediaShell'\nimport PreviewToggle from '../_shared/PreviewToggle'\nimport PurchaseStatusBadge from '../_shared/PurchaseStatusBadge'\nimport { usePreviewToggle } from '../_shared/usePreviewToggle'\nimport { useReceivedSource } from '../_shared/useReceivedSource'\n\nimport ReceivedCardActions from './CardActions'\nimport type {\n MediaCardDraftProps,\n MediaCardOtherProps,\n MediaCardOwnProps,\n MediaCardPreviewProps,\n MediaCardProps,\n} from './types'\n\nexport type { MediaCardProps } from './types'\n\n/**\n * Media card while still drafting — the locked thumbnail (single or gallery)\n * the composer taps to preview the attachment they're about to send, plus\n * the title/price body with optional dismiss X and edit pencil.\n */\nconst DraftMediaCard: React.FC<MediaCardDraftProps> = ({\n title,\n mimeType = 'application/octet-stream',\n thumbnailUrl,\n detail,\n amountText,\n placeholderTitle,\n placeholderAmountText,\n gallery = [],\n onDismiss,\n onPreviewClick,\n onFetchSource,\n onEditClick,\n}) => {\n const isGallery = isGalleryCard(gallery)\n\n // Gallery is always previewable in the composer because each item's source\n // is already provided up-front via `gallery[*].sourceUrl`.\n const { source, isPreviewVisible, isLoadingPreview, togglePreview } =\n usePreviewToggle({ isGallery, onFetchSource, onPreviewClick })\n\n const showLocked = !isPreviewVisible\n const isBusy = isLoadingPreview\n\n const statusBadge = (\n <React.Fragment>\n <span className=\"text-xs font-medium text-white/55\">•</span>\n <span\n className={\n amountText\n ? 'text-xs font-medium text-white/55'\n : 'text-xs font-medium text-white/30'\n }\n >\n {amountText || placeholderAmountText}\n </span>\n </React.Fragment>\n )\n\n const dismissButton = onDismiss ? (\n <button\n type=\"button\"\n onClick={(e) => {\n // Stop the click from bubbling up into the outer preview-toggle\n // wrapper when both are wired up at the same time.\n e.stopPropagation()\n onDismiss()\n }}\n className=\"flex size-6 items-center justify-center rounded-full bg-[#121110] text-white\"\n aria-label=\"Dismiss attachment\"\n >\n <XIcon className=\"size-3\" weight=\"bold\" />\n </button>\n ) : undefined\n\n const editButton = onEditClick ? (\n <button\n type=\"button\"\n onClick={onEditClick}\n aria-label=\"Edit attachment\"\n className=\"flex size-10 items-center justify-center rounded-full bg-white/10 text-white hover:bg-white/15\"\n >\n <PencilSimpleIcon className=\"size-5\" weight=\"regular\" />\n </button>\n ) : undefined\n\n return (\n <MediaShell variant=\"dark\">\n <PreviewToggle\n onToggle={togglePreview}\n isBusy={isBusy}\n isPreviewVisible={!showLocked}\n >\n <CardThumbnail\n variant=\"dark\"\n gallery={gallery}\n title={title}\n showLocked={showLocked}\n mimeType={mimeType}\n thumbnailUrl={thumbnailUrl}\n source={source}\n topRight={dismissButton}\n />\n </PreviewToggle>\n\n <CardBody\n variant=\"dark\"\n title={title}\n placeholderTitle={placeholderTitle}\n mimeType={mimeType}\n detail={detail}\n statusBadge={statusBadge}\n icon={isGallery ? galleryBodyIcon('dark') : undefined}\n trailingAction={editButton}\n />\n </MediaShell>\n )\n}\n\n/**\n * Static mockup of what the recipient will see before purchase — always\n * locked/blurred (the lock badge renders from `showLocked` alone, no toggle\n * wiring needed), no interactivity, no real content revealed.\n */\nconst PreviewMediaCard: React.FC<MediaCardPreviewProps> = ({\n title,\n mimeType = 'application/octet-stream',\n thumbnailUrl,\n detail,\n amountText,\n placeholderTitle,\n placeholderAmountText,\n gallery = [],\n}) => {\n const isGallery = isGalleryCard(gallery)\n\n const statusBadge = (\n <React.Fragment>\n <span className=\"text-xs font-medium text-black/55\">•</span>\n <span\n className={\n amountText\n ? 'text-xs font-medium text-black/55'\n : 'text-xs font-medium text-black/30'\n }\n >\n {amountText || placeholderAmountText}\n </span>\n </React.Fragment>\n )\n\n return (\n <MediaShell variant=\"light\">\n <CardThumbnail\n variant=\"light\"\n gallery={gallery}\n title={title}\n showLocked\n mimeType={mimeType}\n thumbnailUrl={thumbnailUrl}\n />\n\n <CardBody\n variant=\"light\"\n title={title}\n placeholderTitle={placeholderTitle}\n mimeType={mimeType}\n detail={detail}\n statusBadge={statusBadge}\n icon={isGallery ? galleryBodyIcon('light') : undefined}\n />\n </MediaShell>\n )\n}\n/**\n * The sender's ('mine') view of a paid media attachment: the locked\n * thumbnail (single or gallery) they can tap to preview their own\n * attachment, plus the title/purchase-status body.\n */\nconst OwnMediaCard: React.FC<MediaCardOwnProps> = ({\n title,\n mimeType = 'application/octet-stream',\n thumbnailUrl,\n detail,\n amountText,\n placeholderTitle,\n paymentStatus = 'pending',\n gallery = [],\n onPreviewClick,\n onFetchSource,\n}) => {\n const isGallery = isGalleryCard(gallery)\n\n // Gallery is always previewable for the sender because each item's source\n // is already provided up-front via `gallery[*].sourceUrl`.\n const { source, isPreviewVisible, isLoadingPreview, togglePreview } =\n usePreviewToggle({ isGallery, onFetchSource, onPreviewClick })\n\n const showLocked = !isPreviewVisible\n const isBusy = isLoadingPreview\n\n return (\n <MediaShell variant=\"dark\">\n <PreviewToggle\n onToggle={togglePreview}\n isBusy={isBusy}\n isPreviewVisible={!showLocked}\n >\n <CardThumbnail\n variant=\"dark\"\n gallery={gallery}\n title={title}\n showLocked={showLocked}\n paymentStatus={paymentStatus}\n mimeType={mimeType}\n thumbnailUrl={thumbnailUrl}\n source={source}\n />\n </PreviewToggle>\n\n <CardBody\n variant=\"dark\"\n title={title}\n placeholderTitle={placeholderTitle}\n mimeType={mimeType}\n detail={detail}\n statusBadge={\n <PurchaseStatusBadge\n isMine={true}\n paymentStatus={paymentStatus}\n amountText={amountText}\n />\n }\n icon={isGallery ? galleryBodyIcon('dark') : undefined}\n />\n </MediaShell>\n )\n}\n\n/**\n * The recipient's ('other') view of a paid media attachment: the locked\n * thumbnail (single or gallery) with an Unlock/Download CTA. The source is\n * revealed by fetching once — on click when already paid, or automatically\n * the first time a paid card scrolls into view.\n */\nconst OtherMediaCard: React.FC<MediaCardOtherProps> = ({\n title,\n amountText,\n thumbnailUrl,\n mimeType = 'application/octet-stream',\n detail,\n gallery = [],\n onUnlockClick,\n onFetchSource,\n onDownloadClick,\n paymentStatus,\n isUnlocking = false,\n}) => {\n const isGallery = isGalleryCard(gallery)\n\n const { source, cardRef, handleUnlockClick } = useReceivedSource({\n paymentStatus,\n onFetchSource,\n onUnlockClick,\n })\n\n const effectiveSourceUrl = source?.sourceUrl\n const effectiveRedeemUrl = source?.redeemUrl\n\n // For gallery, the per-item sources are carried by `gallery` itself, so\n // the lock state is driven by paymentStatus rather than the single\n // `effectiveSourceUrl`. Everything else still respects the source fetch.\n const isLocked = isGallery\n ? paymentStatus !== 'paid'\n : effectiveSourceUrl === undefined\n const sourceType = getSourceType(mimeType)\n\n // For gallery, ReceivedCardActions falls back to a plain <button>\n // (no anchor) because the gallery has no single sourceUrl to link to —\n // the per-item sources live on `gallery` itself.\n const actionSourceUrl = isGallery ? undefined : effectiveSourceUrl\n\n return (\n <MediaShell\n variant=\"light\"\n rootRef={cardRef}\n data-testid=\"locked-attachment\"\n >\n <CardThumbnail\n variant=\"light\"\n gallery={gallery}\n title={title}\n showLocked={isLocked}\n paymentStatus={paymentStatus}\n mimeType={mimeType}\n thumbnailUrl={thumbnailUrl}\n source={source}\n containedImage={!isLocked && sourceType === 'document'}\n />\n\n <CardBody\n variant=\"light\"\n title={title}\n mimeType={mimeType}\n detail={detail}\n statusBadge={\n <PurchaseStatusBadge\n isMine={false}\n paymentStatus={paymentStatus}\n amountText={amountText}\n />\n }\n icon={isGallery ? galleryBodyIcon('light') : undefined}\n action={\n <ReceivedCardActions\n isLocked={isLocked}\n isUnlocking={isUnlocking}\n sourceUrl={actionSourceUrl}\n redeemUrl={effectiveRedeemUrl}\n onUnlockClicked={handleUnlockClick}\n onDownloadClicked={onDownloadClick}\n />\n }\n />\n </MediaShell>\n )\n}\n\n/**\n * The card either party sees for a paid media attachment. `isDraft`/`isPreview`\n * select the composer's own drafting view / a static receiver-side mockup;\n * otherwise `isMine` selects the sender's sent view vs. the recipient's\n * unlock/download view.\n */\nconst MediaCard: React.FC<MediaCardProps> = (props) => {\n if (props.isDraft) {\n return <DraftMediaCard {...props} />\n } else if (props.isPreview) {\n return <PreviewMediaCard {...props} />\n } else if (props.isMine) {\n return <OwnMediaCard {...props} />\n } else {\n return <OtherMediaCard {...props} />\n }\n}\n\nexport default MediaCard\n"],"names":["CardBody","variant","title","placeholderTitle","mimeType","detail","statusBadge","action","icon","trailingAction","isDark","displayTitle","titleDimmed","typeIcon","renderTypeIcon","classNames","jsxs","jsx","LockBadge","paymentStatus","isPlayable","isLocked","sourceType","getSourceType","Icon","PlayIcon","LockOpenIcon","LockSimpleIcon","isPlayableItem","item","GalleryThumbnail","gallery","showLocked","topRight","index","setIndex","useState","total","safeIndex","current","isVideoItem","optimizedCurrentThumbnailUrl","optimizeMessagingAttachmentUrl","goPrev","e","i","goNext","atStart","atEnd","AttachmentThumbnail","React","CaretLeftIcon","CaretRightIcon","SingleThumbnail","thumbnailUrl","source","containedImage","effectiveSourceUrl","effectiveThumbnailUrl","optimizedThumbnailUrl","isGalleryCard","galleryBodyIcon","ImagesIcon","CardThumbnail","MediaShell","children","rootRef","dataTestId","PreviewToggle","onToggle","isBusy","isPreviewVisible","usePreviewToggle","isGallery","onFetchSource","onPreviewClick","setSource","setIsPreviewVisible","isLoadingPreview","setIsLoadingPreview","fetchingRef","useRef","handleToggle","useCallback","result","togglePreview","useReceivedSource","onUnlockClick","cardRef","onFetchSourceRef","fetchSource","_a","handleUnlockClick","useEffect","observer","entry","buttonClass","ReceivedCardActions","sourceUrl","redeemUrl","onUnlockClicked","onDownloadClicked","isUnlocking","LoadingDots","href","DownloadSimpleIcon","DraftMediaCard","amountText","placeholderAmountText","onDismiss","onEditClick","dismissButton","XIcon","editButton","PencilSimpleIcon","PreviewMediaCard","OwnMediaCard","PurchaseStatusBadge","OtherMediaCard","onDownloadClick","effectiveRedeemUrl","actionSourceUrl","MediaCard","props"],"mappings":"6QA0BMA,EAAoC,CAAC,CACzC,QAAAC,EACA,MAAAC,EACA,iBAAAC,EAAmB,mBACnB,SAAAC,EACA,OAAAC,EACA,YAAAC,EACA,OAAAC,EACA,KAAAC,EACA,eAAAC,CACF,IAAM,CACJ,MAAMC,EAAST,IAAY,OACrBU,EAAeT,GAASC,EACxBS,EAAc,CAACV,EAEfW,EACJL,GACAM,EAAAA,eAAeV,EAAU,CACvB,UAAWW,EACT,kBACAL,EAAS,gBAAkB,eAAA,EAE7B,OAAQ,SAAA,CACT,EAEH,OACEM,EAAAA,KAAC,MAAA,CAAI,UAAU,YACb,SAAA,CAAAA,EAAAA,KAAC,MAAA,CAAI,UAAU,uBACb,SAAA,CAAAA,EAAAA,KAAC,MAAA,CAAI,UAAU,qCACZ,SAAA,CAAAL,EAAa,SAAW,IACvBM,EAAAA,IAAC,IAAA,CACC,UAAWF,EAAW,2CAA4C,CAChE,gBAAiB,CAACL,GAAU,CAACE,EAC7B,gBAAiB,CAACF,GAAUE,EAC5B,gBAAiBF,GAAUE,EAC3B,aAAcF,GAAU,CAACE,CAAA,CAC1B,EAEA,SAAAD,CAAA,CAAA,EAILK,EAAAA,KAAC,MAAA,CAAI,UAAU,oCACZ,SAAA,CAAAH,EAEAR,GAAU,MAAQA,IAAW,IAC5BY,EAAAA,IAAC,OAAA,CACC,UAAWF,EACT,sBACAL,EAAS,gBAAkB,eAAA,EAG5B,SAAAL,CAAA,C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EACX,gBAAiB5B,EACjB,kBAAmB2B,CAAA,CAAA,CACrB,CAAA,CAEJ,CAAA,CAAA,CAGN,EAQMG,EAAuCC,GACvCA,EAAM,QACD1G,MAACyF,EAAA,CAAgB,GAAGiB,CAAA,CAAO,EACzBA,EAAM,UACR1G,MAACkG,EAAA,CAAkB,GAAGQ,CAAA,CAAO,EAC3BA,EAAM,OACR1G,MAACmG,EAAA,CAAc,GAAGO,CAAA,CAAO,EAEzB1G,MAACqG,EAAA,CAAgB,GAAGK,CAAA,CAAO"}
|
|
1
|
+
{"version":3,"file":"Card-Dxk_Ggxw.cjs","sources":["../src/components/CustomMessage/LockedAttachment/components/_shared/CardBody.tsx","../src/components/CustomMessage/LockedAttachment/components/_shared/LockBadge.tsx","../src/components/CustomMessage/LockedAttachment/components/_shared/GalleryThumbnail.tsx","../src/components/CustomMessage/LockedAttachment/components/_shared/SingleThumbnail.tsx","../src/components/CustomMessage/LockedAttachment/components/_shared/CardThumbnail.tsx","../src/components/CustomMessage/LockedAttachment/components/_shared/MediaShell.tsx","../src/components/CustomMessage/LockedAttachment/components/_shared/PreviewToggle.tsx","../src/components/CustomMessage/LockedAttachment/components/_shared/usePreviewToggle.ts","../src/components/CustomMessage/LockedAttachment/components/_shared/useReceivedSource.ts","../src/components/CustomMessage/LockedAttachment/components/Media/CardActions.tsx","../src/components/CustomMessage/LockedAttachment/components/Media/Card.tsx"],"sourcesContent":["import classNames from 'classnames'\nimport React from 'react'\n\nimport { renderTypeIcon } from '../../../../AttachmentCard'\n\nimport type { CardVariant } from './MediaShell'\n\nexport interface CardBodyProps {\n variant: CardVariant\n title?: string\n placeholderTitle?: string\n mimeType: string\n detail?: string\n statusBadge?: React.ReactNode\n action?: React.ReactNode\n /** Overrides the auto-detected type icon (used by Gallery to swap in an `Images` icon). */\n icon?: React.ReactNode\n /** Optional control rendered on the right of the title/status block (e.g. Composer edit pencil). */\n trailingAction?: React.ReactNode\n}\n\n/**\n * Title + status row layout shared by Composer and `LockedAttachment.Media`.\n * Layout matches the Figma `Container > Labels` group (16px h-padding, 12px v-padding,\n * 4px gap between title and status row, 4px gap inside status row).\n */\nconst CardBody: React.FC<CardBodyProps> = ({\n variant,\n title,\n placeholderTitle = 'Attachment title',\n mimeType,\n detail,\n statusBadge,\n action,\n icon,\n trailingAction,\n}) => {\n const isDark = variant === 'dark'\n const displayTitle = title || placeholderTitle\n const titleDimmed = !title\n\n const typeIcon =\n icon ??\n renderTypeIcon(mimeType, {\n className: classNames(\n 'size-5 shrink-0',\n isDark ? 'text-white/55' : 'text-black/55'\n ),\n weight: 'regular',\n })\n\n return (\n <div className=\"px-4 py-3\">\n <div className=\"flex items-end gap-3\">\n <div className=\"flex min-w-0 flex-1 flex-col gap-1\">\n {displayTitle.trim() !== '' && (\n <p\n className={classNames(\n 'truncate text-base font-medium leading-6',\n {\n 'text-black/90': !isDark && !titleDimmed,\n 'text-black/30': !isDark && titleDimmed,\n 'text-white/30': isDark && titleDimmed,\n 'text-white': isDark && !titleDimmed,\n }\n )}\n >\n {displayTitle}\n </p>\n )}\n\n <div className=\"flex flex-wrap items-center gap-1\">\n {typeIcon}\n\n {detail != null && detail !== '' && (\n <span\n className={classNames(\n 'text-xs font-medium',\n isDark ? 'text-white/55' : 'text-black/55'\n )}\n >\n {detail}\n </span>\n )}\n\n {statusBadge}\n </div>\n </div>\n\n {trailingAction && <div className=\"shrink-0\">{trailingAction}</div>}\n </div>\n\n {action}\n </div>\n )\n}\n\nexport default CardBody\n","import { LockOpenIcon, LockSimpleIcon, PlayIcon } from '@phosphor-icons/react'\nimport classNames from 'classnames'\nimport React from 'react'\n\nimport { getSourceType } from '../../../../AttachmentCard'\nimport type { PaymentStatus } from '../../types'\n\nexport interface LockBadgeProps {\n paymentStatus?: PaymentStatus\n mimeType?: string\n /**\n * Overrides the `mimeType`-derived playable check. Lets a caller that\n * already knows per-item playability (e.g. `GalleryThumbnail`, checking a\n * carousel item's own mimeType rather than the card's single `mimeType`)\n * skip re-deriving it.\n */\n isPlayable?: boolean\n /** Whether the item is still locked. Play only ever shows once unlocked —\n * a locked item always shows the lock, even for otherwise-playable media. */\n isLocked: boolean\n}\n\n/**\n * Centered 48x48 lock badge that overlays the thumbnail of any locked attachment.\n * Uses `bg-black/30`. Stays `pointer-events-none` so clicks pass through to\n * the underlying player/toggle; the play state highlights via `group-hover`\n * (same `bg-black/40` as the gallery's prev/next arrows) — the ancestor\n * providing `group` must wrap the actual clickable/hoverable player area.\n *\n * For playable media (video/audio) that's unlocked, the badge shows a play\n * icon instead of a lock — matching the convention used by `GalleryThumbnail`.\n */\nexport const LockBadge: React.FC<LockBadgeProps> = ({\n paymentStatus,\n mimeType,\n isPlayable,\n isLocked,\n}) => {\n const sourceType = mimeType ? getSourceType(mimeType) : undefined\n const resolvedIsPlayable =\n isPlayable ?? (sourceType === 'video' || sourceType === 'audio')\n\n const Icon =\n resolvedIsPlayable && !isLocked\n ? PlayIcon\n : paymentStatus === 'paid'\n ? LockOpenIcon\n : LockSimpleIcon\n return (\n <div className=\"pointer-events-none absolute inset-0 flex items-center justify-center\">\n <div\n className={classNames(\n 'flex size-12 items-center justify-center rounded-full bg-black/30 text-white',\n Icon === PlayIcon && 'group-hover:bg-black/40'\n )}\n >\n <Icon className=\"size-6\" weight=\"fill\" />\n </div>\n </div>\n )\n}\n\nexport default LockBadge\n","import { CaretLeftIcon, CaretRightIcon } from '@phosphor-icons/react'\nimport classNames from 'classnames'\nimport React, { useState } from 'react'\n\nimport { optimizeMessagingAttachmentUrl } from '../../../../../utils/cdnImageUrl'\nimport { AttachmentThumbnail, getSourceType } from '../../../../AttachmentCard'\nimport type { LockedAttachmentGalleryItem, PaymentStatus } from '../../types'\n\nimport { LockBadge } from './LockBadge'\nimport type { CardVariant } from './MediaShell'\n\nexport interface GalleryThumbnailProps {\n variant: CardVariant\n gallery: LockedAttachmentGalleryItem[]\n title?: string\n /** When true, all items are shown blurred + the locked/play badge is overlaid. */\n showLocked: boolean\n paymentStatus?: PaymentStatus\n /** Top-right slot (e.g. dismiss X on Composer). Rendered inside the thumbnail. */\n topRight?: React.ReactNode\n}\n\nfunction isPlayableItem(item: LockedAttachmentGalleryItem): boolean {\n const sourceType = getSourceType(item.mimeType)\n return sourceType === 'video' || sourceType === 'audio'\n}\n\n/**\n * Mixed-media carousel used by every LockedAttachment card when its `gallery`\n * prop has 2+ items. Matches the \"Gallery\" frames in the Figma design system:\n * 337/386 aspect ratio, prev/next caret buttons, a counter pill, and a center\n * lock / play indicator that swaps based on the current item.\n */\nconst GalleryThumbnail: React.FC<GalleryThumbnailProps> = ({\n variant,\n gallery,\n title,\n showLocked,\n paymentStatus,\n topRight,\n}) => {\n const [index, setIndex] = useState(0)\n const total = gallery.length\n const safeIndex = Math.min(index, total - 1)\n const current = gallery[safeIndex]\n const isVideoItem = isPlayableItem(current)\n const optimizedCurrentThumbnailUrl = optimizeMessagingAttachmentUrl(\n current.thumbnailUrl\n )\n\n // Stop propagation so arrow taps don't bubble up to the outer preview-toggle\n // wrapper on PreviewMediaCard / OwnMediaCard.\n const goPrev = (e: React.MouseEvent) => {\n e.stopPropagation()\n setIndex((i) => Math.max(0, i - 1))\n }\n const goNext = (e: React.MouseEvent) => {\n e.stopPropagation()\n setIndex((i) => Math.min(total - 1, i + 1))\n }\n const atStart = safeIndex === 0\n const atEnd = safeIndex === total - 1\n\n const isDark = variant === 'dark'\n\n // Locked + unlocked render entirely separate trees so the locked state\n // doesn't end up stacking a blurred `<img>` on top of an underlying\n // `AttachmentThumbnail` (whose `bg-white/10` poster shell otherwise\n // shows through as a visible horizontal seam).\n //\n // The locked placeholder is absolutely positioned, so it needs the fixed\n // 337/386 box for height; unlocked content (video, natural-sized image)\n // manages its own height and can expand/shrink per item.\n //\n // The locked branch uses `filter: blur` on a single full-size `<img>`\n // — not `backdrop-filter` — so the rounded corners are clipped\n // normally without any clip-path workarounds (see SingleThumbnail).\n return (\n <div\n className={classNames(\n 'group relative overflow-hidden rounded-t-md',\n showLocked ? 'aspect-[337/386]' : undefined\n )}\n >\n {showLocked ? (\n <div\n className={classNames(\n 'absolute inset-0',\n isDark ? 'bg-white/10' : 'bg-black/5'\n )}\n >\n {current.thumbnailUrl && (\n <img\n src={optimizedCurrentThumbnailUrl ?? current.thumbnailUrl}\n alt=\"\"\n aria-hidden\n draggable={false}\n // `scale-110` hides the fuzzy edge that `filter: blur` leaves\n // around the image bounds.\n className=\"absolute inset-0 h-full w-full scale-110 object-cover blur-[40px]\"\n />\n )}\n </div>\n ) : (\n <AttachmentThumbnail\n key={safeIndex}\n mimeType={current.mimeType}\n sourceUrl={current.sourceUrl}\n thumbnailUrl={current.thumbnailUrl}\n title={title}\n variant={variant}\n mediaPlayerProps={{ autoPlay: true }}\n />\n )}\n\n {/* LOCK while locked. Once unlocked, video/audio autoplays via\n `mediaPlayerProps` and MediaPlayer already has its own inline\n controls, so no separate Play affordance is shown. */}\n {showLocked && (\n <LockBadge\n paymentStatus={paymentStatus}\n isPlayable={isVideoItem}\n isLocked={showLocked}\n />\n )}\n\n {total > 1 && (\n <React.Fragment>\n <button\n type=\"button\"\n onClick={goPrev}\n disabled={atStart}\n aria-label=\"Previous item\"\n className={classNames(\n 'absolute left-3 top-1/2 -translate-y-1/2 flex size-7 items-center justify-center rounded-full bg-black/30 text-white transition-opacity',\n atStart ? 'opacity-40' : 'hover:bg-black/40'\n )}\n >\n <CaretLeftIcon className=\"size-5\" weight=\"bold\" />\n </button>\n <button\n type=\"button\"\n onClick={goNext}\n disabled={atEnd}\n aria-label=\"Next item\"\n className={classNames(\n 'absolute right-3 top-1/2 -translate-y-1/2 flex size-7 items-center justify-center rounded-full bg-black/30 text-white transition-opacity',\n atEnd ? 'opacity-40' : 'hover:bg-black/40'\n )}\n >\n <CaretRightIcon className=\"size-5\" weight=\"bold\" />\n </button>\n\n <div className=\"pointer-events-none absolute bottom-10 left-1/2 flex size-8 -translate-x-1/2 items-center justify-center rounded-full bg-black/30\">\n <span className=\"text-xs font-medium leading-none text-white\">\n {safeIndex + 1}/{total}\n </span>\n </div>\n </React.Fragment>\n )}\n\n {topRight && (\n <div className=\"pointer-events-auto absolute right-3 top-3 z-10\">\n {topRight}\n </div>\n )}\n </div>\n )\n}\n\nexport default GalleryThumbnail\n","import classNames from 'classnames'\nimport React from 'react'\n\nimport { optimizeMessagingAttachmentUrl } from '../../../../../utils/cdnImageUrl'\nimport { AttachmentThumbnail, renderTypeIcon } from '../../../../AttachmentCard'\nimport type { LockedAttachmentSource, PaymentStatus } from '../../types'\n\nimport { LockBadge } from './LockBadge'\nimport type { CardVariant } from './MediaShell'\n\nexport interface SingleThumbnailProps {\n variant: CardVariant\n mimeType: string\n thumbnailUrl?: string\n title?: string\n /**\n * When provided, the underlying source is shown unblurred (preview / unlocked state).\n * When undefined, the thumbnail is treated as locked: blurred with a central lock badge.\n */\n source?: LockedAttachmentSource\n /**\n * Forces the locked appearance even when a source is provided. Used for the\n * Composer card where the locked treatment is the default and the user toggles\n * a preview in place.\n */\n showLocked: boolean\n paymentStatus?: PaymentStatus\n /** Top-right overlay (e.g. dismiss X on Composer). Rendered inside the thumbnail. */\n topRight?: React.ReactNode\n /** When true, renders the unlocked image with aspect-video + object-contain. */\n containedImage?: boolean\n}\n\n/**\n * Renders the 180px-tall media area for a LockedAttachment card.\n * Handles three visual states:\n * - locked: blurred thumbnail + centered 48px lock badge\n * - preview/paid: clear thumbnail (the underlying source)\n * - empty: type-icon placeholder\n */\nconst SingleThumbnail: React.FC<SingleThumbnailProps> = ({\n variant,\n mimeType,\n thumbnailUrl,\n title,\n source,\n showLocked,\n paymentStatus,\n topRight,\n containedImage = false,\n}) => {\n const effectiveSourceUrl = showLocked ? undefined : source?.sourceUrl\n const effectiveThumbnailUrl = showLocked\n ? thumbnailUrl\n : (source?.thumbnailUrl ?? thumbnailUrl)\n const optimizedThumbnailUrl = optimizeMessagingAttachmentUrl(\n effectiveThumbnailUrl\n )\n\n const isDark = variant === 'dark'\n\n // Locked + unlocked render entirely separate trees so the locked state\n // doesn't end up stacking a blurred `<img>` on top of an underlying\n // `AttachmentThumbnail` (whose `bg-white/10` poster shell otherwise\n // shows through as a visible horizontal seam at the 16:9 boundary).\n //\n // The locked branch uses `filter: blur` on a single full-size `<img>`\n // — not `backdrop-filter` — because `backdrop-filter` paints in its\n // own compositing layer that escapes ancestor `overflow: hidden` on\n // Chrome/Safari and flattens the card's top corners. `filter` is\n // clipped normally, so the rounded corners stay round without any\n // clip-path workarounds.\n return (\n <div className=\"relative overflow-hidden rounded-t-md\">\n {showLocked ? (\n <div\n className={classNames(\n 'relative aspect-video overflow-hidden',\n isDark ? 'bg-white/10' : 'bg-black/5'\n )}\n >\n {effectiveThumbnailUrl ? (\n <img\n src={optimizedThumbnailUrl ?? effectiveThumbnailUrl}\n alt=\"\"\n aria-hidden\n draggable={false}\n // `scale-110` hides the fuzzy semi-transparent edge that\n // `filter: blur` leaves around the image bounds.\n className=\"absolute inset-0 h-full w-full scale-110 object-cover blur-[40px]\"\n />\n ) : (\n <div className=\"absolute inset-0 flex items-center justify-center\">\n {renderTypeIcon(mimeType, {\n className: isDark\n ? 'size-12 text-white/20'\n : 'size-12 text-black/20',\n weight: 'regular',\n })}\n </div>\n )}\n <LockBadge\n paymentStatus={paymentStatus}\n mimeType={mimeType}\n isLocked={showLocked}\n />\n </div>\n ) : (\n <AttachmentThumbnail\n mimeType={mimeType}\n sourceUrl={effectiveSourceUrl}\n thumbnailUrl={effectiveThumbnailUrl}\n title={title}\n variant={variant}\n containedImage={containedImage}\n mediaPlayerProps={\n effectiveSourceUrl\n ? { autoPlay: true, loop: true, controls: true, muted: false }\n : undefined\n }\n />\n )}\n\n {topRight && (\n <div className=\"pointer-events-auto absolute right-3 top-3 z-10\">\n {topRight}\n </div>\n )}\n </div>\n )\n}\n\nexport default SingleThumbnail\n","import { ImagesIcon } from '@phosphor-icons/react'\nimport type React from 'react'\n\nimport type {\n LockedAttachmentGalleryItem,\n LockedAttachmentSource,\n PaymentStatus,\n} from '../../types'\n\nimport GalleryThumbnail from './GalleryThumbnail'\nimport type { CardVariant } from './MediaShell'\nimport SingleThumbnail from './SingleThumbnail'\n\nexport interface CardThumbnailProps {\n variant: CardVariant\n gallery: LockedAttachmentGalleryItem[]\n title?: string\n showLocked: boolean\n paymentStatus?: PaymentStatus\n /** Single-asset props — ignored when the card renders as a gallery. */\n mimeType: string\n thumbnailUrl?: string\n source?: LockedAttachmentSource\n containedImage?: boolean\n /** Top-right overlay (e.g. Composer dismiss X). Rendered inside the thumbnail. */\n topRight?: React.ReactNode\n}\n\n/** True when the card should render as a mixed-media carousel (2+ items). */\nexport const isGalleryCard = (\n gallery: LockedAttachmentGalleryItem[]\n): boolean => gallery.length >= 2\n\n/**\n * The body-row icon a card shows when it renders as a gallery — `CardBody`\n * otherwise auto-detects the icon from `mimeType`. Returned as a ready node so\n * every card shares the same size/tone treatment.\n */\nexport const galleryBodyIcon = (variant: CardVariant): React.ReactNode => (\n <ImagesIcon\n className={\n variant === 'dark'\n ? 'size-5 shrink-0 text-white/55'\n : 'size-5 shrink-0 text-black/55'\n }\n />\n)\n\n/**\n * Owns the single-vs-gallery thumbnail decision shared by Composer /\n * `LockedAttachment.Media` cards: renders `GalleryThumbnail` for a 2+ item `gallery`,\n * else `SingleThumbnail` for the single asset. Callers pass the superset of\n * props; the unused half is ignored by whichever branch renders.\n */\nconst CardThumbnail: React.FC<CardThumbnailProps> = ({\n variant,\n gallery,\n title,\n showLocked,\n paymentStatus,\n mimeType,\n thumbnailUrl,\n source,\n containedImage,\n topRight,\n}) =>\n isGalleryCard(gallery) ? (\n <GalleryThumbnail\n variant={variant}\n gallery={gallery}\n title={title}\n showLocked={showLocked}\n paymentStatus={paymentStatus}\n topRight={topRight}\n />\n ) : (\n <SingleThumbnail\n variant={variant}\n mimeType={mimeType}\n thumbnailUrl={thumbnailUrl}\n title={title}\n source={source}\n showLocked={showLocked}\n paymentStatus={paymentStatus}\n topRight={topRight}\n containedImage={containedImage}\n />\n )\n\nexport default CardThumbnail\n","import classNames from 'classnames'\nimport React from 'react'\n\nexport type CardVariant = 'dark' | 'light'\n\nexport interface MediaShellProps {\n variant: CardVariant\n children: React.ReactNode\n rootRef?: React.Ref<HTMLDivElement>\n 'data-testid'?: string\n}\n\n/**\n * Outer chrome for every LockedAttachment card.\n * Mirrors the 16px radius treatment from the Figma design system.\n */\nconst MediaShell: React.FC<MediaShellProps> = ({\n variant,\n children,\n rootRef,\n 'data-testid': dataTestId,\n}) => (\n <div\n ref={rootRef}\n data-testid={dataTestId}\n className={classNames(\n 'relative w-[280px] select-none overflow-hidden rounded-md',\n variant === 'dark' ? 'bg-[#1e2330]' : 'bg-white',\n 'shadow-[0_1px_2px_rgba(0,0,0,0.08)]'\n )}\n >\n {children}\n </div>\n)\n\nexport default MediaShell\n","import React from 'react'\n\nexport interface PreviewToggleProps {\n /** Toggles the preview; omit to render `children` with no wrapper at all (nothing to toggle). */\n onToggle: (() => void | Promise<void>) | undefined\n isBusy: boolean\n isPreviewVisible: boolean\n children: React.ReactNode\n}\n\n/**\n * Makes a locked thumbnail clickable to toggle its preview. Uses a\n * `role=\"button\"` div rather than a native `<button>` because the thumbnail\n * it wraps can itself contain interactive children (gallery carousel arrows,\n * a Composer dismiss X) — nesting a real `<button>` around those would\n * produce invalid, inaccessible nested-interactive-element markup.\n */\nconst PreviewToggle: React.FC<PreviewToggleProps> = ({\n onToggle,\n isBusy,\n isPreviewVisible,\n children,\n}) => {\n if (!onToggle) return <React.Fragment>{children}</React.Fragment>\n\n return (\n <div\n role=\"button\"\n tabIndex={isBusy ? -1 : 0}\n aria-label=\"Toggle preview\"\n aria-busy={isBusy}\n aria-pressed={isPreviewVisible}\n aria-disabled={isBusy || undefined}\n onClick={isBusy ? undefined : onToggle}\n onKeyDown={(e) => {\n if (isBusy) return\n // Only handle keys that originate on the wrapper itself, not on\n // inner interactive elements (dismiss X, carousel arrows). Without\n // this guard, pressing Enter/Space on a focused child would bubble\n // up and toggle the preview in addition to activating the child.\n if (e.target !== e.currentTarget) return\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n void onToggle()\n }\n }}\n className={\n !isBusy\n ? 'block w-full cursor-pointer text-left'\n : 'block w-full text-left'\n }\n >\n {children}\n </div>\n )\n}\n\nexport default PreviewToggle\n","import { useCallback, useRef, useState } from 'react'\n\nimport type { LockedAttachmentSource } from '../../types'\n\nexport interface UsePreviewToggleOptions {\n /** Gallery items carry their own per-item sources on the `gallery` prop already, so toggling skips the async fetch entirely. */\n isGallery: boolean\n /**\n * Lazily loads the underlying source; the resolved value is cached in\n * `source` and reused on subsequent toggles.\n */\n onFetchSource?: () => Promise<LockedAttachmentSource | void>\n /** Fired on every toggle tap, before any visibility/fetch logic runs. */\n onPreviewClick?: () => void\n}\n\nexport interface UsePreviewToggleResult {\n source: LockedAttachmentSource | undefined\n isPreviewVisible: boolean\n isLoadingPreview: boolean\n handleToggle: () => Promise<void>\n /**\n * `handleToggle` when the card can actually be previewed (gallery, or a\n * fetch/click handler is wired), else `undefined` — pass straight to\n * `PreviewToggle.onToggle` so a non-previewable card renders no\n * toggle affordance.\n */\n togglePreview: (() => Promise<void>) | undefined\n}\n\n/**\n * Shared preview-toggle state for Composer/Media isMine: flips a locked thumbnail to\n * its unlocked preview, lazily fetching and caching the source on first\n * reveal. Media !isMine doesn't use this — it fetches on scroll-into-view/paid\n * instead of on a toggle tap.\n */\nexport function usePreviewToggle({\n isGallery,\n onFetchSource,\n onPreviewClick,\n}: UsePreviewToggleOptions): UsePreviewToggleResult {\n const [source, setSource] = useState<LockedAttachmentSource | undefined>()\n const [isPreviewVisible, setIsPreviewVisible] = useState(false)\n const [isLoadingPreview, setIsLoadingPreview] = useState(false)\n const fetchingRef = useRef(false)\n\n const handleToggle = useCallback(async () => {\n onPreviewClick?.()\n if (isPreviewVisible) {\n setIsPreviewVisible(false)\n return\n }\n if (isGallery) {\n setIsPreviewVisible(true)\n return\n }\n if (source) {\n setIsPreviewVisible(true)\n return\n }\n if (!onFetchSource) return\n if (fetchingRef.current) return\n fetchingRef.current = true\n setIsLoadingPreview(true)\n try {\n const result = await onFetchSource()\n if (result) {\n setSource(result)\n setIsPreviewVisible(true)\n }\n } finally {\n fetchingRef.current = false\n setIsLoadingPreview(false)\n }\n }, [isPreviewVisible, isGallery, source, onPreviewClick, onFetchSource])\n\n const togglePreview =\n isGallery || onFetchSource != null || onPreviewClick != null\n ? handleToggle\n : undefined\n\n return {\n source,\n isPreviewVisible,\n isLoadingPreview,\n handleToggle,\n togglePreview,\n }\n}\n","/* eslint-disable react-hooks/refs -- pre-existing pattern flagged by the React\n Compiler rules added in eslint-plugin-react-hooks v7; refactoring it is\n out of scope for the lint toolchain upgrade. */\nimport { useCallback, useEffect, useRef, useState } from 'react'\n\nimport type {\n FetchSourceHandler,\n LockedAttachmentSource,\n PaymentStatus,\n} from '../../types'\n\nexport interface UseReceivedSourceOptions {\n paymentStatus?: PaymentStatus\n onFetchSource?: FetchSourceHandler\n /** Called on Unlock click while the card is still unpaid (opens checkout). */\n onUnlockClick?: () => void\n}\n\nexport interface UseReceivedSourceResult {\n source: LockedAttachmentSource | undefined\n /** Attach to the card root so the paid-source auto-fetch can observe it. */\n cardRef: React.RefObject<HTMLDivElement>\n /** Fetches the source when already paid, else defers to `onUnlockClick`. */\n handleUnlockClick: () => void\n}\n\n/**\n * Media !isMine's source-reveal logic: unlike Composer/Media isMine's\n * tap-to-toggle (`usePreviewToggle`), the recipient's card reveals its source\n * by fetching once — on click when already paid, or automatically the first\n * time a paid card scrolls fully into view. The fetch is guarded so it runs\n * at most once in flight.\n */\nexport function useReceivedSource({\n paymentStatus,\n onFetchSource,\n onUnlockClick,\n}: UseReceivedSourceOptions): UseReceivedSourceResult {\n const [source, setSource] = useState<LockedAttachmentSource | undefined>()\n\n const cardRef = useRef<HTMLDivElement>(null)\n const fetchingRef = useRef(false)\n\n const onFetchSourceRef = useRef(onFetchSource)\n onFetchSourceRef.current = onFetchSource\n\n const fetchSource = useCallback(async (): Promise<void> => {\n if (fetchingRef.current) return\n fetchingRef.current = true\n try {\n const result = await onFetchSourceRef.current?.()\n if (result) setSource(result)\n } finally {\n fetchingRef.current = false\n }\n }, [])\n\n const handleUnlockClick = useCallback(() => {\n if (paymentStatus === 'paid') {\n void fetchSource()\n } else {\n onUnlockClick?.()\n }\n }, [paymentStatus, fetchSource, onUnlockClick])\n\n // Auto-fetch the source once the paid card scrolls into view.\n useEffect(() => {\n if (!cardRef.current) return\n if (paymentStatus !== 'paid' || source !== undefined) return\n\n const observer = new IntersectionObserver(\n ([entry]) => {\n if (entry.isIntersecting) {\n void fetchSource()\n observer.disconnect()\n }\n },\n { threshold: 1.0 }\n )\n\n observer.observe(cardRef.current)\n return () => observer.disconnect()\n }, [paymentStatus, source, fetchSource])\n\n return { source, cardRef, handleUnlockClick }\n}\n","import { DownloadSimpleIcon, LockSimpleIcon } from '@phosphor-icons/react'\nimport React from 'react'\n\nimport LoadingDots from '../_shared/LoadingDots'\n\nexport interface ReceivedCardActionsProps {\n /** Whether the card is currently locked. Drives which CTA we render. */\n isLocked: boolean\n /**\n * When unlocked, the URL used as the Download link's `href` (opens in a new\n * tab). When omitted, the Download CTA falls back to a plain `<button>`\n * that just calls `onDownloadClicked` — useful for galleries where the\n * single-source URL doesn't exist.\n */\n sourceUrl?: string\n /** Optional alternate href that takes precedence over `sourceUrl`. */\n redeemUrl?: string\n onUnlockClicked?: () => void\n onDownloadClicked?: () => void\n isUnlocking?: boolean\n}\n\nconst buttonClass =\n 'mt-3 inline-flex h-10 w-full items-center justify-center gap-2 rounded-full bg-[#121110] px-4 text-sm font-medium leading-none text-white hover:bg-[#2a2928]'\n\n/**\n * Renders the primary CTA below the body of a Received card.\n * - Locked + onUnlockClicked → \"Unlock\" button\n * - Unlocked + onDownloadClicked + (redeemUrl || sourceUrl) → \"Download\" link\n * - Unlocked + onDownloadClicked + no URL → \"Download\" button (e.g. gallery)\n * Otherwise renders nothing.\n */\nconst ReceivedCardActions: React.FC<ReceivedCardActionsProps> = ({\n isLocked,\n sourceUrl,\n redeemUrl,\n onUnlockClicked,\n onDownloadClicked,\n isUnlocking = false,\n}) => {\n if (isLocked && onUnlockClicked != null) {\n return (\n <button\n type=\"button\"\n onClick={onUnlockClicked}\n disabled={isUnlocking}\n aria-label={isUnlocking ? 'Unlocking' : 'Unlock'}\n aria-busy={isUnlocking}\n title={isUnlocking ? 'Unlocking' : 'Unlock'}\n className={buttonClass}\n >\n {isUnlocking ? (\n <LoadingDots />\n ) : (\n <React.Fragment>\n <LockSimpleIcon className=\"size-4\" weight=\"fill\" />\n Unlock\n </React.Fragment>\n )}\n </button>\n )\n }\n\n if (!isLocked && onDownloadClicked != null) {\n const href = redeemUrl ?? sourceUrl\n if (href != null) {\n return (\n <a\n href={href}\n aria-label=\"Download\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n onClick={onDownloadClicked}\n className={`${buttonClass} !text-white`}\n >\n <DownloadSimpleIcon className=\"size-4\" weight=\"bold\" />\n Download\n </a>\n )\n }\n\n return (\n <button\n type=\"button\"\n onClick={onDownloadClicked}\n aria-label=\"Download\"\n className={buttonClass}\n >\n <DownloadSimpleIcon className=\"size-4\" weight=\"bold\" />\n Download\n </button>\n )\n }\n\n return null\n}\n\nexport default ReceivedCardActions\n","import { PencilSimpleIcon, XIcon } from '@phosphor-icons/react'\nimport React from 'react'\n\nimport { getSourceType } from '../../../../AttachmentCard'\nimport CardBody from '../_shared/CardBody'\nimport CardThumbnail, {\n galleryBodyIcon,\n isGalleryCard,\n} from '../_shared/CardThumbnail'\nimport MediaShell from '../_shared/MediaShell'\nimport PreviewToggle from '../_shared/PreviewToggle'\nimport PurchaseStatusBadge from '../_shared/PurchaseStatusBadge'\nimport { usePreviewToggle } from '../_shared/usePreviewToggle'\nimport { useReceivedSource } from '../_shared/useReceivedSource'\n\nimport ReceivedCardActions from './CardActions'\nimport type {\n MediaCardDraftProps,\n MediaCardOtherProps,\n MediaCardOwnProps,\n MediaCardPreviewProps,\n MediaCardProps,\n} from './types'\n\nexport type { MediaCardProps } from './types'\n\n/**\n * Media card while still drafting — the locked thumbnail (single or gallery)\n * the composer taps to preview the attachment they're about to send, plus\n * the title/price body with optional dismiss X and edit pencil.\n */\nconst DraftMediaCard: React.FC<MediaCardDraftProps> = ({\n title,\n mimeType = 'application/octet-stream',\n thumbnailUrl,\n detail,\n amountText,\n placeholderTitle,\n placeholderAmountText,\n gallery = [],\n onDismiss,\n onPreviewClick,\n onFetchSource,\n onEditClick,\n}) => {\n const isGallery = isGalleryCard(gallery)\n\n // Gallery is always previewable in the composer because each item's source\n // is already provided up-front via `gallery[*].sourceUrl`.\n const { source, isPreviewVisible, isLoadingPreview, togglePreview } =\n usePreviewToggle({ isGallery, onFetchSource, onPreviewClick })\n\n const showLocked = !isPreviewVisible\n const isBusy = isLoadingPreview\n\n const statusBadge = (\n <React.Fragment>\n <span className=\"text-xs font-medium text-white/55\">•</span>\n <span\n className={\n amountText\n ? 'text-xs font-medium text-white/55'\n : 'text-xs font-medium text-white/30'\n }\n >\n {amountText || placeholderAmountText}\n </span>\n </React.Fragment>\n )\n\n const dismissButton = onDismiss ? (\n <button\n type=\"button\"\n onClick={(e) => {\n // Stop the click from bubbling up into the outer preview-toggle\n // wrapper when both are wired up at the same time.\n e.stopPropagation()\n onDismiss()\n }}\n className=\"flex size-6 items-center justify-center rounded-full bg-[#121110] text-white\"\n aria-label=\"Dismiss attachment\"\n >\n <XIcon className=\"size-3\" weight=\"bold\" />\n </button>\n ) : undefined\n\n const editButton = onEditClick ? (\n <button\n type=\"button\"\n onClick={onEditClick}\n aria-label=\"Edit attachment\"\n className=\"flex size-10 items-center justify-center rounded-full bg-white/10 text-white hover:bg-white/15\"\n >\n <PencilSimpleIcon className=\"size-5\" weight=\"regular\" />\n </button>\n ) : undefined\n\n return (\n <MediaShell variant=\"dark\">\n <PreviewToggle\n onToggle={togglePreview}\n isBusy={isBusy}\n isPreviewVisible={!showLocked}\n >\n <CardThumbnail\n variant=\"dark\"\n gallery={gallery}\n title={title}\n showLocked={showLocked}\n mimeType={mimeType}\n thumbnailUrl={thumbnailUrl}\n source={source}\n topRight={dismissButton}\n />\n </PreviewToggle>\n\n <CardBody\n variant=\"dark\"\n title={title}\n placeholderTitle={placeholderTitle}\n mimeType={mimeType}\n detail={detail}\n statusBadge={statusBadge}\n icon={isGallery ? galleryBodyIcon('dark') : undefined}\n trailingAction={editButton}\n />\n </MediaShell>\n )\n}\n\n/**\n * Static mockup of what the recipient will see before purchase — always\n * locked/blurred (the lock badge renders from `showLocked` alone, no toggle\n * wiring needed), no interactivity, no real content revealed.\n */\nconst PreviewMediaCard: React.FC<MediaCardPreviewProps> = ({\n title,\n mimeType = 'application/octet-stream',\n thumbnailUrl,\n detail,\n amountText,\n placeholderTitle,\n placeholderAmountText,\n gallery = [],\n}) => {\n const isGallery = isGalleryCard(gallery)\n\n const statusBadge = (\n <React.Fragment>\n <span className=\"text-xs font-medium text-black/55\">•</span>\n <span\n className={\n amountText\n ? 'text-xs font-medium text-black/55'\n : 'text-xs font-medium text-black/30'\n }\n >\n {amountText || placeholderAmountText}\n </span>\n </React.Fragment>\n )\n\n return (\n <MediaShell variant=\"light\">\n <CardThumbnail\n variant=\"light\"\n gallery={gallery}\n title={title}\n showLocked\n mimeType={mimeType}\n thumbnailUrl={thumbnailUrl}\n />\n\n <CardBody\n variant=\"light\"\n title={title}\n placeholderTitle={placeholderTitle}\n mimeType={mimeType}\n detail={detail}\n statusBadge={statusBadge}\n icon={isGallery ? galleryBodyIcon('light') : undefined}\n />\n </MediaShell>\n )\n}\n/**\n * The sender's ('mine') view of a paid media attachment: the locked\n * thumbnail (single or gallery) they can tap to preview their own\n * attachment, plus the title/purchase-status body.\n */\nconst OwnMediaCard: React.FC<MediaCardOwnProps> = ({\n title,\n mimeType = 'application/octet-stream',\n thumbnailUrl,\n detail,\n amountText,\n placeholderTitle,\n paymentStatus = 'pending',\n gallery = [],\n onPreviewClick,\n onFetchSource,\n}) => {\n const isGallery = isGalleryCard(gallery)\n\n // Gallery is always previewable for the sender because each item's source\n // is already provided up-front via `gallery[*].sourceUrl`.\n const { source, isPreviewVisible, isLoadingPreview, togglePreview } =\n usePreviewToggle({ isGallery, onFetchSource, onPreviewClick })\n\n const showLocked = !isPreviewVisible\n const isBusy = isLoadingPreview\n\n return (\n <MediaShell variant=\"dark\">\n <PreviewToggle\n onToggle={togglePreview}\n isBusy={isBusy}\n isPreviewVisible={!showLocked}\n >\n <CardThumbnail\n variant=\"dark\"\n gallery={gallery}\n title={title}\n showLocked={showLocked}\n paymentStatus={paymentStatus}\n mimeType={mimeType}\n thumbnailUrl={thumbnailUrl}\n source={source}\n />\n </PreviewToggle>\n\n <CardBody\n variant=\"dark\"\n title={title}\n placeholderTitle={placeholderTitle}\n mimeType={mimeType}\n detail={detail}\n statusBadge={\n <PurchaseStatusBadge\n isMine={true}\n paymentStatus={paymentStatus}\n amountText={amountText}\n />\n }\n icon={isGallery ? galleryBodyIcon('dark') : undefined}\n />\n </MediaShell>\n )\n}\n\n/**\n * The recipient's ('other') view of a paid media attachment: the locked\n * thumbnail (single or gallery) with an Unlock/Download CTA. The source is\n * revealed by fetching once — on click when already paid, or automatically\n * the first time a paid card scrolls into view.\n */\nconst OtherMediaCard: React.FC<MediaCardOtherProps> = ({\n title,\n amountText,\n thumbnailUrl,\n mimeType = 'application/octet-stream',\n detail,\n gallery = [],\n onUnlockClick,\n onFetchSource,\n onDownloadClick,\n paymentStatus,\n isUnlocking = false,\n}) => {\n const isGallery = isGalleryCard(gallery)\n\n const { source, cardRef, handleUnlockClick } = useReceivedSource({\n paymentStatus,\n onFetchSource,\n onUnlockClick,\n })\n\n const effectiveSourceUrl = source?.sourceUrl\n const effectiveRedeemUrl = source?.redeemUrl\n\n // For gallery, the per-item sources are carried by `gallery` itself, so\n // the lock state is driven by paymentStatus rather than the single\n // `effectiveSourceUrl`. Everything else still respects the source fetch.\n const isLocked = isGallery\n ? paymentStatus !== 'paid'\n : effectiveSourceUrl === undefined\n const sourceType = getSourceType(mimeType)\n\n // For gallery, ReceivedCardActions falls back to a plain <button>\n // (no anchor) because the gallery has no single sourceUrl to link to —\n // the per-item sources live on `gallery` itself.\n const actionSourceUrl = isGallery ? undefined : effectiveSourceUrl\n\n return (\n <MediaShell\n variant=\"light\"\n rootRef={cardRef}\n data-testid=\"locked-attachment\"\n >\n <CardThumbnail\n variant=\"light\"\n gallery={gallery}\n title={title}\n showLocked={isLocked}\n paymentStatus={paymentStatus}\n mimeType={mimeType}\n thumbnailUrl={thumbnailUrl}\n source={source}\n containedImage={!isLocked && sourceType === 'document'}\n />\n\n <CardBody\n variant=\"light\"\n title={title}\n mimeType={mimeType}\n detail={detail}\n statusBadge={\n <PurchaseStatusBadge\n isMine={false}\n paymentStatus={paymentStatus}\n amountText={amountText}\n />\n }\n icon={isGallery ? galleryBodyIcon('light') : undefined}\n action={\n <ReceivedCardActions\n isLocked={isLocked}\n isUnlocking={isUnlocking}\n sourceUrl={actionSourceUrl}\n redeemUrl={effectiveRedeemUrl}\n onUnlockClicked={handleUnlockClick}\n onDownloadClicked={onDownloadClick}\n />\n }\n />\n </MediaShell>\n )\n}\n\n/**\n * The card either party sees for a paid media attachment. `isDraft`/`isPreview`\n * select the composer's own drafting view / a static receiver-side mockup;\n * otherwise `isMine` selects the sender's sent view vs. the recipient's\n * unlock/download view.\n */\nconst MediaCard: React.FC<MediaCardProps> = (props) => {\n if (props.isDraft) {\n return <DraftMediaCard {...props} />\n } else if (props.isPreview) {\n return <PreviewMediaCard {...props} />\n } else if (props.isMine) {\n return <OwnMediaCard {...props} />\n } else {\n return <OtherMediaCard {...props} />\n }\n}\n\nexport default MediaCard\n"],"names":["CardBody","variant","title","placeholderTitle","mimeType","detail","statusBadge","action","icon","trailingAction","isDark","displayTitle","titleDimmed","typeIcon","renderTypeIcon","classNames","jsxs","jsx","LockBadge","paymentStatus","isPlayable","isLocked","sourceType","getSourceType","Icon","PlayIcon","LockOpenIcon","LockSimpleIcon","isPlayableItem","item","GalleryThumbnail","gallery","showLocked","topRight","index","setIndex","useState","total","safeIndex","current","isVideoItem","optimizedCurrentThumbnailUrl","optimizeMessagingAttachmentUrl","goPrev","e","i","goNext","atStart","atEnd","AttachmentThumbnail","React","CaretLeftIcon","CaretRightIcon","SingleThumbnail","thumbnailUrl","source","containedImage","effectiveSourceUrl","effectiveThumbnailUrl","optimizedThumbnailUrl","isGalleryCard","galleryBodyIcon","ImagesIcon","CardThumbnail","MediaShell","children","rootRef","dataTestId","PreviewToggle","onToggle","isBusy","isPreviewVisible","usePreviewToggle","isGallery","onFetchSource","onPreviewClick","setSource","setIsPreviewVisible","isLoadingPreview","setIsLoadingPreview","fetchingRef","useRef","handleToggle","useCallback","result","togglePreview","useReceivedSource","onUnlockClick","cardRef","onFetchSourceRef","fetchSource","_a","handleUnlockClick","useEffect","observer","entry","buttonClass","ReceivedCardActions","sourceUrl","redeemUrl","onUnlockClicked","onDownloadClicked","isUnlocking","LoadingDots","href","DownloadSimpleIcon","DraftMediaCard","amountText","placeholderAmountText","onDismiss","onEditClick","dismissButton","XIcon","editButton","PencilSimpleIcon","PreviewMediaCard","OwnMediaCard","PurchaseStatusBadge","OtherMediaCard","onDownloadClick","effectiveRedeemUrl","actionSourceUrl","MediaCard","props"],"mappings":"6QA0BMA,EAAoC,CAAC,CACzC,QAAAC,EACA,MAAAC,EACA,iBAAAC,EAAmB,mBACnB,SAAAC,EACA,OAAAC,EACA,YAAAC,EACA,OAAAC,EACA,KAAAC,EACA,eAAAC,CACF,IAAM,CACJ,MAAMC,EAAST,IAAY,OACrBU,EAAeT,GAASC,EACxBS,EAAc,CAACV,EAEfW,EACJL,GACAM,EAAAA,eAAeV,EAAU,CACvB,UAAWW,EACT,kBACAL,EAAS,gBAAkB,eAAA,EAE7B,OAAQ,SAAA,CACT,EAEH,OACEM,EAAAA,KAAC,MAAA,CAAI,UAAU,YACb,SAAA,CAAAA,EAAAA,KAAC,MAAA,CAAI,UAAU,uBACb,SAAA,CAAAA,EAAAA,KAAC,MAAA,C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AhC,EACA,MAAA7B,EACA,WAAYmB,EACZ,cAAAF,EACA,SAAAf,EACA,aAAAkD,EACA,OAAAC,EACA,eAAgB,CAAClC,GAAYC,IAAe,UAAA,CAAA,EAG9CL,EAAAA,IAACjB,EAAA,CACC,QAAQ,QACR,MAAAE,EACA,SAAAE,EACA,OAAAC,EACA,YACEY,EAAAA,IAACoG,EAAAA,oBAAA,CACC,OAAQ,GACR,cAAAlG,EACA,WAAAwF,CAAA,CAAA,EAGJ,KAAMlC,EAAYZ,EAAgB,OAAO,EAAI,OAC7C,OACE5C,EAAAA,IAACgF,EAAA,CACC,SAAA5E,EACA,YAAAiF,EACA,UAAWmB,EACX,UAAWD,EACX,gBAAiB5B,EACjB,kBAAmB2B,CAAA,CAAA,CACrB,CAAA,CAEJ,CAAA,CAAA,CAGN,EAQMG,EAAuCC,GACvCA,EAAM,QACD1G,MAACyF,EAAA,CAAgB,GAAGiB,CAAA,CAAO,EACzBA,EAAM,UACR1G,MAACkG,EAAA,CAAkB,GAAGQ,CAAA,CAAO,EAC3BA,EAAM,OACR1G,MAACmG,EAAA,CAAc,GAAGO,CAAA,CAAO,EAEzB1G,MAACqG,EAAA,CAAgB,GAAGK,CAAA,CAAO"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoadingDots-Ct3WmVlT.js","sources":["../src/components/CustomMessage/LockedAttachment/components/_shared/PurchaseStatusBadge.tsx","../src/components/CustomMessage/LockedAttachment/components/_shared/LoadingDots.tsx"],"sourcesContent":["import { CheckCircleIcon } from '@phosphor-icons/react'\nimport classNames from 'classnames'\nimport React from 'react'\n\nimport type { PaymentStatus } from '../../types'\n\nexport interface PurchaseStatusBadgeProps {\n /** 'own' matches the sender's dark/own-message context; 'other' matches the recipient's light/other-message context. */\n isMine: boolean\n /** 'paid' renders the \"Sold\"/\"Purchased\" + checkmark variant; otherwise falls back to plain amount text, or nothing. */\n paymentStatus?: PaymentStatus\n amountText?: string\n}\n\n/**\n * Bullet + amount/label + checkmark row for a paid attachment or message.\n * Shared by `LockedAttachment.Media`/`.Text`'s status badges.\n */\nconst PurchaseStatusBadge: React.FC<PurchaseStatusBadgeProps> = ({\n isMine,\n paymentStatus,\n amountText,\n}) => {\n const labelColour = isMine ? 'text-white/55' : 'text-black/55'\n const successColour = isMine ? 'text-[#34c759]' : 'text-[#008236]'\n if (paymentStatus === 'paid') {\n return (\n <React.Fragment>\n <span className={classNames('text-xs font-medium', labelColour)}>\n •\n </span>\n <span className={classNames('text-xs font-medium', successColour)}>\n {isMine ? 'Sold' : 'Purchased'}\n </span>\n <CheckCircleIcon\n className={classNames('shrink-0 size-3.5', successColour)}\n weight=\"bold\"\n aria-hidden\n />\n </React.Fragment>\n )\n }\n\n if (amountText != null) {\n return (\n <React.Fragment>\n <span className={classNames('text-xs font-medium', labelColour)}>\n •\n </span>\n <span className={classNames('text-xs font-medium', labelColour)}>\n {amountText}\n </span>\n </React.Fragment>\n )\n }\n\n
|
|
1
|
+
{"version":3,"file":"LoadingDots-Ct3WmVlT.js","sources":["../src/components/CustomMessage/LockedAttachment/components/_shared/PurchaseStatusBadge.tsx","../src/components/CustomMessage/LockedAttachment/components/_shared/LoadingDots.tsx"],"sourcesContent":["import { CheckCircleIcon } from '@phosphor-icons/react'\nimport classNames from 'classnames'\nimport React from 'react'\n\nimport type { PaymentStatus } from '../../types'\n\nexport interface PurchaseStatusBadgeProps {\n /** 'own' matches the sender's dark/own-message context; 'other' matches the recipient's light/other-message context. */\n isMine: boolean\n /** 'paid' renders the \"Sold\"/\"Purchased\" + checkmark variant; otherwise falls back to plain amount text, or nothing. */\n paymentStatus?: PaymentStatus\n amountText?: string\n}\n\n/**\n * Bullet + amount/label + checkmark row for a paid attachment or message.\n * Shared by `LockedAttachment.Media`/`.Text`'s status badges.\n */\nconst PurchaseStatusBadge: React.FC<PurchaseStatusBadgeProps> = ({\n isMine,\n paymentStatus,\n amountText,\n}) => {\n const labelColour = isMine ? 'text-white/55' : 'text-black/55'\n const successColour = isMine ? 'text-[#34c759]' : 'text-[#008236]'\n if (paymentStatus === 'paid') {\n return (\n <React.Fragment>\n <span className={classNames('text-xs font-medium', labelColour)}>\n •\n </span>\n <span className={classNames('text-xs font-medium', successColour)}>\n {isMine ? 'Sold' : 'Purchased'}\n </span>\n <CheckCircleIcon\n className={classNames('shrink-0 size-3.5', successColour)}\n weight=\"bold\"\n aria-hidden\n />\n </React.Fragment>\n )\n }\n\n if (amountText != null) {\n return (\n <React.Fragment>\n <span className={classNames('text-xs font-medium', labelColour)}>\n •\n </span>\n <span className={classNames('text-xs font-medium', labelColour)}>\n {amountText}\n </span>\n </React.Fragment>\n )\n }\n\n if (paymentStatus === 'failed' || paymentStatus === 'refunded') {\n return (\n <React.Fragment>\n <span className={classNames('text-xs font-medium', labelColour)}>\n •\n </span>\n <span className={classNames('text-xs font-medium', labelColour)}>\n {paymentStatus === 'failed' ? 'Payment failed' : 'Refunded'}\n </span>\n </React.Fragment>\n )\n }\n\n return null\n}\n\nexport default PurchaseStatusBadge\n","import React from 'react'\n\nconst Dot = ({ cx, index }: { cx: string; index: number }) => (\n <circle cx={cx} cy=\"6.15\" r=\"2.4\" fill=\"currentColor\">\n <animateTransform\n attributeName=\"transform\"\n type=\"translate\"\n values=\"0 0; 0 -2.25; 0 0;\"\n dur=\"900ms\"\n begin={`${120 * index}ms`}\n repeatCount=\"indefinite\"\n />\n </circle>\n)\n\n/**\n * Three bouncing dots, inline-sized for use inside buttons/labels (e.g. the\n * Unlock CTA while a purchase is in flight). Mirrors the typing indicator's\n * animation but uses `currentColor` so it adopts the surrounding text color.\n */\nconst LoadingDots: React.FC<{ className?: string }> = ({ className }) => (\n <svg\n aria-hidden=\"true\"\n className={className}\n viewBox=\"0 0 20 12.3\"\n width=\"20\"\n height=\"13\"\n overflow=\"visible\"\n >\n <Dot cx=\"3\" index={0} />\n <Dot cx=\"10\" index={1} />\n <Dot cx=\"17\" index={2} />\n </svg>\n)\n\nexport default LoadingDots\n"],"names":["PurchaseStatusBadge","isMine","paymentStatus","amountText","labelColour","successColour","jsxs","React","jsx","classNames","CheckCircleIcon","Dot","cx","index","LoadingDots","className"],"mappings":";;;;AAkBA,MAAMA,IAA0D,CAAC;AAAA,EAC/D,QAAAC;AAAA,EACA,eAAAC;AAAA,EACA,YAAAC;AACF,MAAM;AACJ,QAAMC,IAAcH,IAAS,kBAAkB,iBACzCI,IAAgBJ,IAAS,mBAAmB;AAClD,SAAIC,MAAkB,SAElB,gBAAAI,EAACC,EAAM,UAAN,EACC,UAAA;AAAA,IAAA,gBAAAC,EAAC,UAAK,WAAWC,EAAW,uBAAuBL,CAAW,GAAG,UAAA,KAEjE;AAAA,IACA,gBAAAI,EAAC,UAAK,WAAWC,EAAW,uBAAuBJ,CAAa,GAC7D,UAAAJ,IAAS,SAAS,YAAA,CACrB;AAAA,IACA,gBAAAO;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,WAAWD,EAAW,qBAAqBJ,CAAa;AAAA,QACxD,QAAO;AAAA,QACP,eAAW;AAAA,MAAA;AAAA,IAAA;AAAA,EACb,GACF,IAIAF,KAAc,OAEd,gBAAAG,EAACC,EAAM,UAAN,EACC,UAAA;AAAA,IAAA,gBAAAC,EAAC,UAAK,WAAWC,EAAW,uBAAuBL,CAAW,GAAG,UAAA,KAEjE;AAAA,sBACC,QAAA,EAAK,WAAWK,EAAW,uBAAuBL,CAAW,GAC3D,UAAAD,EAAA,CACH;AAAA,EAAA,GACF,IAIAD,MAAkB,YAAYA,MAAkB,aAEhD,gBAAAI,EAACC,EAAM,UAAN,EACC,UAAA;AAAA,IAAA,gBAAAC,EAAC,UAAK,WAAWC,EAAW,uBAAuBL,CAAW,GAAG,UAAA,KAEjE;AAAA,IACA,gBAAAI,EAAC,QAAA,EAAK,WAAWC,EAAW,uBAAuBL,CAAW,GAC3D,UAAAF,MAAkB,WAAW,mBAAmB,WAAA,CACnD;AAAA,EAAA,GACF,IAIG;AACT,GCpEMS,IAAM,CAAC,EAAE,IAAAC,GAAI,OAAAC,QACjB,gBAAAL,EAAC,UAAA,EAAO,IAAAI,GAAQ,IAAG,QAAO,GAAE,OAAM,MAAK,gBACrC,UAAA,gBAAAJ;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,eAAc;AAAA,IACd,MAAK;AAAA,IACL,QAAO;AAAA,IACP,KAAI;AAAA,IACJ,OAAO,GAAG,MAAMK,CAAK;AAAA,IACrB,aAAY;AAAA,EAAA;AACd,GACF,GAQIC,IAAgD,CAAC,EAAE,WAAAC,EAAA,MACvD,gBAAAT;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,eAAY;AAAA,IACZ,WAAAS;AAAA,IACA,SAAQ;AAAA,IACR,OAAM;AAAA,IACN,QAAO;AAAA,IACP,UAAS;AAAA,IAET,UAAA;AAAA,MAAA,gBAAAP,EAACG,GAAA,EAAI,IAAG,KAAI,OAAO,GAAG;AAAA,MACtB,gBAAAH,EAACG,GAAA,EAAI,IAAG,MAAK,OAAO,GAAG;AAAA,MACvB,gBAAAH,EAACG,GAAA,EAAI,IAAG,MAAK,OAAO,EAAA,CAAG;AAAA,IAAA;AAAA,EAAA;AACzB;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoadingDots-D9GGphgM.cjs","sources":["../src/components/CustomMessage/LockedAttachment/components/_shared/PurchaseStatusBadge.tsx","../src/components/CustomMessage/LockedAttachment/components/_shared/LoadingDots.tsx"],"sourcesContent":["import { CheckCircleIcon } from '@phosphor-icons/react'\nimport classNames from 'classnames'\nimport React from 'react'\n\nimport type { PaymentStatus } from '../../types'\n\nexport interface PurchaseStatusBadgeProps {\n /** 'own' matches the sender's dark/own-message context; 'other' matches the recipient's light/other-message context. */\n isMine: boolean\n /** 'paid' renders the \"Sold\"/\"Purchased\" + checkmark variant; otherwise falls back to plain amount text, or nothing. */\n paymentStatus?: PaymentStatus\n amountText?: string\n}\n\n/**\n * Bullet + amount/label + checkmark row for a paid attachment or message.\n * Shared by `LockedAttachment.Media`/`.Text`'s status badges.\n */\nconst PurchaseStatusBadge: React.FC<PurchaseStatusBadgeProps> = ({\n isMine,\n paymentStatus,\n amountText,\n}) => {\n const labelColour = isMine ? 'text-white/55' : 'text-black/55'\n const successColour = isMine ? 'text-[#34c759]' : 'text-[#008236]'\n if (paymentStatus === 'paid') {\n return (\n <React.Fragment>\n <span className={classNames('text-xs font-medium', labelColour)}>\n •\n </span>\n <span className={classNames('text-xs font-medium', successColour)}>\n {isMine ? 'Sold' : 'Purchased'}\n </span>\n <CheckCircleIcon\n className={classNames('shrink-0 size-3.5', successColour)}\n weight=\"bold\"\n aria-hidden\n />\n </React.Fragment>\n )\n }\n\n if (amountText != null) {\n return (\n <React.Fragment>\n <span className={classNames('text-xs font-medium', labelColour)}>\n •\n </span>\n <span className={classNames('text-xs font-medium', labelColour)}>\n {amountText}\n </span>\n </React.Fragment>\n )\n }\n\n
|
|
1
|
+
{"version":3,"file":"LoadingDots-D9GGphgM.cjs","sources":["../src/components/CustomMessage/LockedAttachment/components/_shared/PurchaseStatusBadge.tsx","../src/components/CustomMessage/LockedAttachment/components/_shared/LoadingDots.tsx"],"sourcesContent":["import { CheckCircleIcon } from '@phosphor-icons/react'\nimport classNames from 'classnames'\nimport React from 'react'\n\nimport type { PaymentStatus } from '../../types'\n\nexport interface PurchaseStatusBadgeProps {\n /** 'own' matches the sender's dark/own-message context; 'other' matches the recipient's light/other-message context. */\n isMine: boolean\n /** 'paid' renders the \"Sold\"/\"Purchased\" + checkmark variant; otherwise falls back to plain amount text, or nothing. */\n paymentStatus?: PaymentStatus\n amountText?: string\n}\n\n/**\n * Bullet + amount/label + checkmark row for a paid attachment or message.\n * Shared by `LockedAttachment.Media`/`.Text`'s status badges.\n */\nconst PurchaseStatusBadge: React.FC<PurchaseStatusBadgeProps> = ({\n isMine,\n paymentStatus,\n amountText,\n}) => {\n const labelColour = isMine ? 'text-white/55' : 'text-black/55'\n const successColour = isMine ? 'text-[#34c759]' : 'text-[#008236]'\n if (paymentStatus === 'paid') {\n return (\n <React.Fragment>\n <span className={classNames('text-xs font-medium', labelColour)}>\n •\n </span>\n <span className={classNames('text-xs font-medium', successColour)}>\n {isMine ? 'Sold' : 'Purchased'}\n </span>\n <CheckCircleIcon\n className={classNames('shrink-0 size-3.5', successColour)}\n weight=\"bold\"\n aria-hidden\n />\n </React.Fragment>\n )\n }\n\n if (amountText != null) {\n return (\n <React.Fragment>\n <span className={classNames('text-xs font-medium', labelColour)}>\n •\n </span>\n <span className={classNames('text-xs font-medium', labelColour)}>\n {amountText}\n </span>\n </React.Fragment>\n )\n }\n\n if (paymentStatus === 'failed' || paymentStatus === 'refunded') {\n return (\n <React.Fragment>\n <span className={classNames('text-xs font-medium', labelColour)}>\n •\n </span>\n <span className={classNames('text-xs font-medium', labelColour)}>\n {paymentStatus === 'failed' ? 'Payment failed' : 'Refunded'}\n </span>\n </React.Fragment>\n )\n }\n\n return null\n}\n\nexport default PurchaseStatusBadge\n","import React from 'react'\n\nconst Dot = ({ cx, index }: { cx: string; index: number }) => (\n <circle cx={cx} cy=\"6.15\" r=\"2.4\" fill=\"currentColor\">\n <animateTransform\n attributeName=\"transform\"\n type=\"translate\"\n values=\"0 0; 0 -2.25; 0 0;\"\n dur=\"900ms\"\n begin={`${120 * index}ms`}\n repeatCount=\"indefinite\"\n />\n </circle>\n)\n\n/**\n * Three bouncing dots, inline-sized for use inside buttons/labels (e.g. the\n * Unlock CTA while a purchase is in flight). Mirrors the typing indicator's\n * animation but uses `currentColor` so it adopts the surrounding text color.\n */\nconst LoadingDots: React.FC<{ className?: string }> = ({ className }) => (\n <svg\n aria-hidden=\"true\"\n className={className}\n viewBox=\"0 0 20 12.3\"\n width=\"20\"\n height=\"13\"\n overflow=\"visible\"\n >\n <Dot cx=\"3\" index={0} />\n <Dot cx=\"10\" index={1} />\n <Dot cx=\"17\" index={2} />\n </svg>\n)\n\nexport default LoadingDots\n"],"names":["PurchaseStatusBadge","isMine","paymentStatus","amountText","labelColour","successColour","jsxs","React","jsx","class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,CACd,EACF,EAQIC,EAAgD,CAAC,CAAE,UAAAC,CAAA,IACvDT,EAAAA,KAAC,MAAA,CACC,cAAY,OACZ,UAAAS,EACA,QAAQ,cACR,MAAM,KACN,OAAO,KACP,SAAS,UAET,SAAA,CAAAP,EAAAA,IAACG,EAAA,CAAI,GAAG,IAAI,MAAO,EAAG,EACtBH,EAAAA,IAACG,EAAA,CAAI,GAAG,KAAK,MAAO,EAAG,EACvBH,EAAAA,IAACG,EAAA,CAAI,GAAG,KAAK,MAAO,CAAA,CAAG,CAAA,CAAA,CACzB"}
|
|
@@ -331,14 +331,7 @@ const ye = ({
|
|
|
331
331
|
shape: i = "squircle",
|
|
332
332
|
dmAgentEnabled: l = !1
|
|
333
333
|
}) => {
|
|
334
|
-
const o = Sa(e), d = Ea(e), m = 0.45, u = n < 32 ? Math.round(n * m) : n < 56 ? 14 : n < 120 ? 18 : 36, g = n >= 40 ? 2 : 1, c = i === "circle" ? { borderRadius: "50%" } : { borderRadius: "1rem" }, b = /* @__PURE__ */ s("div", { className: "h-full w-full overflow-hidden", style: c, children: t ? /* @__PURE__ */ s(
|
|
335
|
-
"img",
|
|
336
|
-
{
|
|
337
|
-
src: t,
|
|
338
|
-
alt: "",
|
|
339
|
-
className: "h-full w-full object-cover"
|
|
340
|
-
}
|
|
341
|
-
) : /* @__PURE__ */ s(
|
|
334
|
+
const o = Sa(e), d = Ea(e), m = 0.45, u = n < 32 ? Math.round(n * m) : n < 56 ? 14 : n < 120 ? 18 : 36, g = n >= 40 ? 2 : 1, c = i === "circle" ? { borderRadius: "50%" } : { borderRadius: "1rem" }, b = /* @__PURE__ */ s("div", { className: "h-full w-full overflow-hidden", style: c, children: t ? /* @__PURE__ */ s("img", { src: t, alt: "", className: "h-full w-full object-cover" }) : /* @__PURE__ */ s(
|
|
342
335
|
"div",
|
|
343
336
|
{
|
|
344
337
|
"aria-hidden": "true",
|
|
@@ -352,10 +345,7 @@ const ye = ({
|
|
|
352
345
|
return /* @__PURE__ */ f(
|
|
353
346
|
"div",
|
|
354
347
|
{
|
|
355
|
-
className: k(
|
|
356
|
-
"relative flex-shrink-0",
|
|
357
|
-
a
|
|
358
|
-
),
|
|
348
|
+
className: k("relative flex-shrink-0", a),
|
|
359
349
|
style: {
|
|
360
350
|
"--str-chat__avatar-size": `${n}px`,
|
|
361
351
|
width: `${n}px`,
|
|
@@ -376,10 +366,7 @@ const ye = ({
|
|
|
376
366
|
"div",
|
|
377
367
|
{
|
|
378
368
|
"data-testid": "avatar-ring",
|
|
379
|
-
className: k(
|
|
380
|
-
"h-full w-full",
|
|
381
|
-
"bg-transparent"
|
|
382
|
-
),
|
|
369
|
+
className: k("h-full w-full", "bg-transparent"),
|
|
383
370
|
style: {
|
|
384
371
|
...c,
|
|
385
372
|
...l && {
|
|
@@ -1325,12 +1312,39 @@ const ut = ({ attachment: e, isMyMessage: t }) => {
|
|
|
1325
1312
|
}
|
|
1326
1313
|
) }),
|
|
1327
1314
|
/* @__PURE__ */ f("div", { className: "px-3 pb-3", children: [
|
|
1328
|
-
n && /* @__PURE__ */ s(
|
|
1329
|
-
|
|
1330
|
-
|
|
1315
|
+
n && /* @__PURE__ */ s(
|
|
1316
|
+
"p",
|
|
1317
|
+
{
|
|
1318
|
+
className: `truncate text-[14px] font-medium leading-5 ${Xa(t)}`,
|
|
1319
|
+
children: n
|
|
1320
|
+
}
|
|
1321
|
+
),
|
|
1322
|
+
a && /* @__PURE__ */ s(
|
|
1323
|
+
"p",
|
|
1324
|
+
{
|
|
1325
|
+
className: `truncate text-[12px] leading-4 ${Ka(t)}`,
|
|
1326
|
+
children: a
|
|
1327
|
+
}
|
|
1328
|
+
),
|
|
1329
|
+
d && /* @__PURE__ */ s(
|
|
1330
|
+
"p",
|
|
1331
|
+
{
|
|
1332
|
+
className: `mt-1 truncate text-[12px] leading-4 ${Za(t)}`,
|
|
1333
|
+
children: d
|
|
1334
|
+
}
|
|
1335
|
+
)
|
|
1331
1336
|
] })
|
|
1332
1337
|
] });
|
|
1333
|
-
return d ? /* @__PURE__ */ s(
|
|
1338
|
+
return d ? /* @__PURE__ */ s(
|
|
1339
|
+
"a",
|
|
1340
|
+
{
|
|
1341
|
+
href: d,
|
|
1342
|
+
target: "_blank",
|
|
1343
|
+
rel: "noopener noreferrer",
|
|
1344
|
+
className: "block no-underline",
|
|
1345
|
+
children: m
|
|
1346
|
+
}
|
|
1347
|
+
) : /* @__PURE__ */ s("div", { className: "block", children: m });
|
|
1334
1348
|
};
|
|
1335
1349
|
function Cs(e) {
|
|
1336
1350
|
return e.type === "link" || !!e.og_scrape_url && !e.asset_url;
|
|
@@ -1371,7 +1385,13 @@ const er = ({
|
|
|
1371
1385
|
},
|
|
1372
1386
|
disabled: n,
|
|
1373
1387
|
className: "mt-3 inline-flex h-10 w-full items-center justify-center gap-2 rounded-full bg-[#121110] px-4 text-sm font-medium leading-none text-white hover:bg-[#2a2928] disabled:opacity-70",
|
|
1374
|
-
children: n ? /* @__PURE__ */ s(
|
|
1388
|
+
children: n ? /* @__PURE__ */ s(
|
|
1389
|
+
xe,
|
|
1390
|
+
{
|
|
1391
|
+
className: "size-4 animate-spin text-white",
|
|
1392
|
+
weight: "bold"
|
|
1393
|
+
}
|
|
1394
|
+
) : /* @__PURE__ */ f(z.Fragment, { children: [
|
|
1375
1395
|
/* @__PURE__ */ s(Se, { className: "size-4 text-white", weight: "bold" }),
|
|
1376
1396
|
"Download"
|
|
1377
1397
|
] })
|
|
@@ -1481,8 +1501,19 @@ const Ss = ({
|
|
|
1481
1501
|
{
|
|
1482
1502
|
className: "str-chat__message-bubble",
|
|
1483
1503
|
"data-attachment-bubble": "true",
|
|
1484
|
-
style: {
|
|
1485
|
-
|
|
1504
|
+
style: {
|
|
1505
|
+
padding: 0,
|
|
1506
|
+
borderRadius: 0,
|
|
1507
|
+
overflow: "visible",
|
|
1508
|
+
background: "transparent"
|
|
1509
|
+
},
|
|
1510
|
+
children: n ? /* @__PURE__ */ s("div", { className: dt(t), children: /* @__PURE__ */ s(
|
|
1511
|
+
ut,
|
|
1512
|
+
{
|
|
1513
|
+
attachment: n,
|
|
1514
|
+
isMyMessage: t
|
|
1515
|
+
}
|
|
1516
|
+
) }) : t ? /* @__PURE__ */ s(Ss, { ...a }) : /* @__PURE__ */ s(Es, { ...a })
|
|
1486
1517
|
}
|
|
1487
1518
|
) })
|
|
1488
1519
|
}
|
|
@@ -2337,9 +2368,7 @@ const Nr = ({
|
|
|
2337
2368
|
alt: n.alt,
|
|
2338
2369
|
filename: t && e.length === 1 ? t : t ? `${t} (${a + 1})` : void 0
|
|
2339
2370
|
})), Pr = ({ src: e, alt: t, filename: n, loading: a = "lazy", onClick: r, onDismiss: i }) => {
|
|
2340
|
-
const { viewerOpen: l, viewerIndex: o, handleActivate: d, closeViewer: m } = Me(
|
|
2341
|
-
r
|
|
2342
|
-
);
|
|
2371
|
+
const { viewerOpen: l, viewerIndex: o, handleActivate: d, closeViewer: m } = Me(r);
|
|
2343
2372
|
return /* @__PURE__ */ f("div", { className: "relative w-fit", children: [
|
|
2344
2373
|
/* @__PURE__ */ s(
|
|
2345
2374
|
"button",
|
|
@@ -2402,9 +2431,7 @@ const Nr = ({
|
|
|
2402
2431
|
loading: o = "lazy",
|
|
2403
2432
|
onClick: d
|
|
2404
2433
|
}) => {
|
|
2405
|
-
const m = Or({ src: t, alt: n, items: r }), h = Le(e), { viewerOpen: u, viewerIndex: g, handleActivate: c, closeViewer: b } = Me(
|
|
2406
|
-
d
|
|
2407
|
-
), w = m.length === 1, p = Fr(w ? m[0] : void 0);
|
|
2434
|
+
const m = Or({ src: t, alt: n, items: r }), h = Le(e), { viewerOpen: u, viewerIndex: g, handleActivate: c, closeViewer: b } = Me(d), w = m.length === 1, p = Fr(w ? m[0] : void 0);
|
|
2408
2435
|
if (m.length === 0)
|
|
2409
2436
|
return null;
|
|
2410
2437
|
const x = m.map(
|
|
@@ -2543,9 +2570,7 @@ const Nr = ({
|
|
|
2543
2570
|
onClick: d,
|
|
2544
2571
|
onDismiss: m
|
|
2545
2572
|
}) => {
|
|
2546
|
-
const h = Le(e), u = Gr({ src: t, filename: n, fileSize: a, title: r, items: i }), { viewerOpen: g, viewerIndex: c, handleActivate: b, closeViewer: w } = Me(
|
|
2547
|
-
d
|
|
2548
|
-
), p = e === "composer" && !!m;
|
|
2573
|
+
const h = Le(e), u = Gr({ src: t, filename: n, fileSize: a, title: r, items: i }), { viewerOpen: g, viewerIndex: c, handleActivate: b, closeViewer: w } = Me(d), p = e === "composer" && !!m;
|
|
2549
2574
|
if (u.length === 0)
|
|
2550
2575
|
return null;
|
|
2551
2576
|
const x = u.map((v) => ({
|
|
@@ -2688,9 +2713,7 @@ const Nr = ({
|
|
|
2688
2713
|
preload: n.preload,
|
|
2689
2714
|
filename: t && e.length === 1 ? t : t ? `${t} (${a + 1})` : void 0
|
|
2690
2715
|
})), ei = ({ src: e, poster: t, mimeType: n, filename: a, preload: r, onClick: i, onDismiss: l }) => {
|
|
2691
|
-
const { viewerOpen: o, viewerIndex: d, handleActivate: m, closeViewer: h } = Me(
|
|
2692
|
-
i
|
|
2693
|
-
);
|
|
2716
|
+
const { viewerOpen: o, viewerIndex: d, handleActivate: m, closeViewer: h } = Me(i);
|
|
2694
2717
|
return /* @__PURE__ */ f("div", { className: "relative w-fit", children: [
|
|
2695
2718
|
/* @__PURE__ */ s(
|
|
2696
2719
|
"button",
|
|
@@ -2707,10 +2730,7 @@ const Nr = ({
|
|
|
2707
2730
|
Os,
|
|
2708
2731
|
{
|
|
2709
2732
|
open: o,
|
|
2710
|
-
items: zs(
|
|
2711
|
-
[{ src: e, poster: t, mimeType: n, preload: r }],
|
|
2712
|
-
a
|
|
2713
|
-
),
|
|
2733
|
+
items: zs([{ src: e, poster: t, mimeType: n, preload: r }], a),
|
|
2714
2734
|
initialIndex: d,
|
|
2715
2735
|
onClose: h
|
|
2716
2736
|
}
|
|
@@ -2728,9 +2748,7 @@ const Nr = ({
|
|
|
2728
2748
|
preload: d,
|
|
2729
2749
|
onClick: m
|
|
2730
2750
|
}) => {
|
|
2731
|
-
const h = Qr({ src: t, poster: n, mimeType: a, preload: d, items: i }), u = Le(e), { viewerOpen: g, viewerIndex: c, handleActivate: b, closeViewer: w } = Me(
|
|
2732
|
-
m
|
|
2733
|
-
);
|
|
2751
|
+
const h = Qr({ src: t, poster: n, mimeType: a, preload: d, items: i }), u = Le(e), { viewerOpen: g, viewerIndex: c, handleActivate: b, closeViewer: w } = Me(m);
|
|
2734
2752
|
if (h.length === 0)
|
|
2735
2753
|
return null;
|
|
2736
2754
|
const p = h.map(
|
|
@@ -2803,7 +2821,7 @@ const Nr = ({
|
|
|
2803
2821
|
function ui(e) {
|
|
2804
2822
|
return _e($s)[e] ?? di[e];
|
|
2805
2823
|
}
|
|
2806
|
-
const mi = z.lazy(() => import("./Card-
|
|
2824
|
+
const mi = z.lazy(() => import("./Card-DaJtDL7m.js")), hi = z.lazy(() => import("./Card-DVMzYquF.js")), fi = () => /* @__PURE__ */ s(
|
|
2807
2825
|
"div",
|
|
2808
2826
|
{
|
|
2809
2827
|
className: "w-[280px] min-h-[200px] animate-pulse rounded-md bg-black/[0.06] shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_1px_2px_rgba(0,0,0,0.04),0_8px_32px_rgba(0,0,0,0.1)]",
|
|
@@ -2908,7 +2926,13 @@ const mi = z.lazy(() => import("./Card-qS17qnN0.js")), hi = z.lazy(() => import(
|
|
|
2908
2926
|
"aria-label": "Bad response",
|
|
2909
2927
|
"aria-pressed": e === "down",
|
|
2910
2928
|
"data-tooltip": "Bad response",
|
|
2911
|
-
children: /* @__PURE__ */ s(
|
|
2929
|
+
children: /* @__PURE__ */ s(
|
|
2930
|
+
oa,
|
|
2931
|
+
{
|
|
2932
|
+
size: 16,
|
|
2933
|
+
weight: e === "down" ? "fill" : "regular"
|
|
2934
|
+
}
|
|
2935
|
+
)
|
|
2912
2936
|
}
|
|
2913
2937
|
)
|
|
2914
2938
|
] }), _t = () => {
|
|
@@ -3000,14 +3024,7 @@ const mi = z.lazy(() => import("./Card-qS17qnN0.js")), hi = z.lazy(() => import(
|
|
|
3000
3024
|
);
|
|
3001
3025
|
return m ? /* @__PURE__ */ f("span", { className: "sent-message-status-row", children: [
|
|
3002
3026
|
h,
|
|
3003
|
-
l && /* @__PURE__ */ s(
|
|
3004
|
-
"span",
|
|
3005
|
-
{
|
|
3006
|
-
className: "sent-message-broadcast-separator",
|
|
3007
|
-
"aria-hidden": "true",
|
|
3008
|
-
children: "•"
|
|
3009
|
-
}
|
|
3010
|
-
),
|
|
3027
|
+
l && /* @__PURE__ */ s("span", { className: "sent-message-broadcast-separator", "aria-hidden": "true", children: "•" }),
|
|
3011
3028
|
m
|
|
3012
3029
|
] }) : h;
|
|
3013
3030
|
}, Ci = /^([a-z][a-z0-9+.-]*):/i, Si = /* @__PURE__ */ new Set(["http", "https", "mailto", "tel", "sms"]);
|
|
@@ -4091,13 +4108,7 @@ const Zi = ({
|
|
|
4091
4108
|
},
|
|
4092
4109
|
children: Tt ? /* @__PURE__ */ s(Ze, { message: c, standalone: !0 }) : bi(c) ? /* @__PURE__ */ s("div", { className: "str-chat__message-bubble-wrapper", children: /* @__PURE__ */ f("div", { className: "flex items-center gap-2", children: [
|
|
4093
4110
|
te && F && /* @__PURE__ */ s(F, {}),
|
|
4094
|
-
te ? /* @__PURE__ */ s(
|
|
4095
|
-
Fe,
|
|
4096
|
-
{
|
|
4097
|
-
...Rt,
|
|
4098
|
-
isMine: !0
|
|
4099
|
-
}
|
|
4100
|
-
) : /* @__PURE__ */ s(
|
|
4111
|
+
te ? /* @__PURE__ */ s(Fe, { ...Rt, isMine: !0 }) : /* @__PURE__ */ s(
|
|
4101
4112
|
Fe,
|
|
4102
4113
|
{
|
|
4103
4114
|
...Rt,
|
|
@@ -5578,7 +5589,14 @@ const Ro = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.28px]", L
|
|
|
5578
5589
|
} : h, g = m && (((b = l == null ? void 0 : l[0]) == null ? void 0 : b.variant) ?? "primary") === "secondary", c = /* @__PURE__ */ f("div", { className: "flex min-w-0 flex-1 flex-col gap-[2px]", children: [
|
|
5579
5590
|
o && /* @__PURE__ */ f("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
5580
5591
|
i ? /* @__PURE__ */ s("span", { className: "shrink-0", children: i }) : null,
|
|
5581
|
-
/* @__PURE__ */ s(
|
|
5592
|
+
/* @__PURE__ */ s(
|
|
5593
|
+
"p",
|
|
5594
|
+
{
|
|
5595
|
+
className: k("min-w-0", Ro),
|
|
5596
|
+
style: h,
|
|
5597
|
+
children: n
|
|
5598
|
+
}
|
|
5599
|
+
)
|
|
5582
5600
|
] }),
|
|
5583
5601
|
d && /* @__PURE__ */ s(
|
|
5584
5602
|
"p",
|
|
@@ -5597,7 +5615,14 @@ const Ro = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.28px]", L
|
|
|
5597
5615
|
/* @__PURE__ */ s(os, { surface: e, actions: l, layout: "row" })
|
|
5598
5616
|
] }) : /* @__PURE__ */ f(J, { children: [
|
|
5599
5617
|
c,
|
|
5600
|
-
/* @__PURE__ */ s(
|
|
5618
|
+
/* @__PURE__ */ s(
|
|
5619
|
+
os,
|
|
5620
|
+
{
|
|
5621
|
+
surface: e,
|
|
5622
|
+
actions: l,
|
|
5623
|
+
layout: "stacked"
|
|
5624
|
+
}
|
|
5625
|
+
)
|
|
5601
5626
|
] }) });
|
|
5602
5627
|
}, Do = {
|
|
5603
5628
|
dark: "bg-white/[0.06]",
|
|
@@ -5909,4 +5934,4 @@ export {
|
|
|
5909
5934
|
bs as y,
|
|
5910
5935
|
mt as z
|
|
5911
5936
|
};
|
|
5912
|
-
//# sourceMappingURL=index-
|
|
5937
|
+
//# sourceMappingURL=index-BOBIiAuD.js.map
|