@marktiderman/genesis-chat 0.2.0 → 0.2.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 +82 -7
- package/dist/{chunk-5D5A7I4Q.js → chunk-A4YJX7KT.js} +130 -16
- package/dist/chunk-A4YJX7KT.js.map +1 -0
- package/dist/chunk-AZS3HNLM.js +30 -0
- package/dist/chunk-AZS3HNLM.js.map +1 -0
- package/dist/{chunk-7S6HYNWW.js → chunk-GBJ3YI4E.js} +72 -5
- package/dist/chunk-GBJ3YI4E.js.map +1 -0
- package/dist/{chunk-PZTOY2LY.js → chunk-JU2FAPBI.js} +46 -13
- package/dist/chunk-JU2FAPBI.js.map +1 -0
- package/dist/{client-DMa2j7kz.d.ts → client-DUIG1hum.d.ts} +36 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +2 -2
- package/dist/native.d.ts +36 -7
- package/dist/native.js +239 -116
- package/dist/native.js.map +1 -1
- package/dist/{outbox-B0y3phE0.d.ts → outbox-B9NAWQ58.d.ts} +74 -6
- package/dist/push.d.ts +2 -2
- package/dist/react.d.ts +48 -21
- package/dist/react.js +3 -3
- package/dist/server.d.ts +43 -2
- package/dist/server.js +115 -15
- package/dist/server.js.map +1 -1
- package/dist/{thread-DWXHKPdw.d.ts → thread-oPra7pkW.d.ts} +1 -1
- package/dist/web.d.ts +31 -11
- package/dist/web.js +97 -48
- package/dist/web.js.map +1 -1
- package/migrations/0003_genesis_chat_search_threads.sql +85 -0
- package/migrations/tests/0002_genesis_chat_coaching.test.sql +7 -3
- package/migrations/tests/0003_genesis_chat_search_threads.test.sql +50 -0
- package/package.json +7 -3
- package/src/__tests__/coaching-core.test.ts +3 -1
- package/src/__tests__/coaching-react.test.tsx +73 -2
- package/src/__tests__/coaching-web.test.tsx +78 -6
- package/src/__tests__/fake-xhr.ts +54 -0
- package/src/__tests__/outbox-hosted.test.ts +269 -0
- package/src/__tests__/review-279.test.ts +41 -0
- package/src/__tests__/review-fixes-web.test.tsx +13 -10
- package/src/__tests__/server-fake-video.test.ts +81 -0
- package/src/__tests__/server-fakes.ts +7 -1
- package/src/__tests__/server-safety.test.ts +17 -4
- package/src/__tests__/web.test.tsx +16 -0
- package/src/core/client.ts +28 -2
- package/src/core/outbox.ts +222 -16
- package/src/core/transfer.ts +71 -0
- package/src/core/types.ts +17 -0
- package/src/index.ts +1 -0
- package/src/native/__tests__/emoji.test.tsx +16 -0
- package/src/native/__tests__/organise-screens.test.tsx +80 -0
- package/src/native/__tests__/video-media.test.tsx +81 -4
- package/src/native/attachment-cards.tsx +22 -6
- package/src/native/inbox-screen.tsx +12 -6
- package/src/native/index.ts +2 -2
- package/src/native/message-actions-sheet.tsx +10 -5
- package/src/native/message-bubble.tsx +3 -11
- package/src/native/modules.ts +2 -0
- package/src/native/schedule-sheet.tsx +23 -9
- package/src/native/search-screen.tsx +26 -5
- package/src/native/thread-screen.tsx +30 -3
- package/src/native/topics.tsx +70 -15
- package/src/native/video-player.tsx +46 -6
- package/src/native/video-recorder.tsx +6 -3
- package/src/native/voice-player.tsx +18 -0
- package/src/react/index.tsx +103 -19
- package/src/react/previews.ts +51 -0
- package/src/server/fake-video.ts +171 -0
- package/src/server/index.ts +1 -0
- package/src/web/attachments.tsx +6 -6
- package/src/web/bubble.tsx +22 -0
- package/src/web/inbox.tsx +7 -6
- package/src/web/memory-client.ts +11 -3
- package/src/web/panel.tsx +2 -2
- package/src/web/schedule.tsx +14 -2
- package/src/web/thread.tsx +36 -8
- package/src/web/video.tsx +28 -34
- package/dist/chunk-5D5A7I4Q.js.map +0 -1
- package/dist/chunk-7S6HYNWW.js.map +0 -1
- package/dist/chunk-PZTOY2LY.js.map +0 -1
package/dist/native.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/native/organise-copy.ts","../src/native/copy.ts","../src/native/context.tsx","../src/native/media-colors.ts","../src/native/attachment-cards.tsx","../src/native/link-preview.tsx","../src/native/voice-player.tsx","../src/native/video-player.tsx","../src/native/media.tsx","../src/native/moderation.tsx","../src/native/message-bubble.tsx","../src/native/inbox-screen.tsx","../src/native/modules.ts","../src/native/video-recorder-state.ts","../src/native/video-recorder.tsx","../src/native/video-upload.ts","../src/native/video-upload-tray.tsx","../src/native/composer-state.ts","../src/native/schedule-sheet.tsx","../src/native/availability.tsx","../src/native/icon-button.tsx","../src/native/topics.tsx","../src/native/use-jump.ts","../src/native/emoji-data.ts","../src/native/emoji.ts","../src/native/emoji-picker.tsx","../src/native/recorder-machine.ts","../src/native/use-voice-recorder.ts","../src/native/composer.tsx","../src/native/use-composer.ts","../src/native/access-error.tsx","../src/native/photo-viewer.tsx","../src/native/actions.ts","../src/native/message-actions-sheet.tsx","../src/native/rows.ts","../src/native/thread-screen.tsx","../src/native/stack-options.ts","../src/native/start-sheet.tsx","../src/native/auto-retry.ts","../src/native/tus.ts","../src/native/broadcast-sheet.tsx","../src/native/search-screen.tsx"],"names":["jsx","Linking","useThemeRoles","jsxs","View","NativeText","useMemo","Pressable","NativeIcon","controls","useSyncExternalStore","useEffect","active","useState","useRef","NativeImage","index","useWindowDimensions","PanResponder","NativeAvatar","useCallback","NativeButton","AccessibilityInfo","parsed","Fragment","useToast","loaded","NativeDatePicker","NativeTimePicker","NativeSheet","NativeListItem","seq","NativeEmptyState","memo","EmojiCell","dispatch","paste","notice","ScrollView","Animated","FlatList","useReducedMotion","Platform","SafeAreaView","NativeSkeleton","AppState","exact","refuse","NativeSheetScrollView","NativeInlineAlert","NativeTextarea","NativeSearchBar"],"mappings":";;;;;;;;;;;;;;;AAyGO,IAAM,gBAAA,GAAqC;AAAA,EAChD,MAAA,EAAQ,QAAA;AAAA,EACR,QAAA,EAAU,KAAA;AAAA,EACV,WAAA,EAAa,QAAA;AAAA,EACb,YAAA,EAAc,eAAA;AAAA,EACd,QAAA,EAAU,WAAA;AAAA,EACV,WAAA,EAAa,cAAA;AAAA,EACb,UAAA,EAAY,aAAA;AAAA,EACZ,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E,SAAS,IACtE,QAAA,kBAAAG,IAAAA,CAACC,IAAAA,EAAA,EAAK,KAAA,EAAO,EAAE,aAAA,EAAe,KAAA,EAAO,UAAA,EAAY,QAAA,EAAU,GAAA,EAAK,CAAA,EAAE,EAChE,QAAA,EAAA;AAAA,oCAAAJ,GAAAA,CAACQ,YAAA,EAAW,IAAA,EAAK,OAAM,IAAA,EAAM,EAAA,EAAI,KAAA,EAAO,MAAA,CAAO,cAAA,EAAgB,CAAA;AAAA,oCAC/DR,GAAAA,CAACK,UAAAA,EAAA,EAAW,MAAA,EAAO,SAAA,EAAU,KAAA,EAAO,EAAE,KAAA,EAAO,MAAA,CAAO,cAAA,EAAe,EAChE,eAAK,UAAA,EACR;AAAA,mBAAA,EACF,GACF,CAAA,GACE,IAAA;AAAA,kCACJL,GAAAA,CAACI,IAAAA,EAAA,EAAK,OAAO,EAAE,IAAA,EAAM,CAAA,EAAE,EACrB,0BAAAJ,GAAAA,CAAC,aAAA,EAAA,EAAc,OAAA,EAAS,CAAA,CAAE,SAAS,CAAA,EACrC;AAAA,iBAAA,EACF;AAAA;AAAA;AAAA,WACF;AAAA,QAEJ;AAAA;AAAA;AACF,GAAA,EAEJ,CAAA;AAEJ","file":"native.js","sourcesContent":["/**\n * @feat:chat\n * The words of chat's organising features on native (topics, scheduled send, availability,\n * broadcast, search, moderation), part of `ChatNativeCopy`, so an app overrides them the same\n * way (`ChatNativeProvider copy`). `{name}`, `{count}`, `{when}` and `{query}` are filled in.\n */\nexport interface ChatOrganiseCopy {\n // Topics\n topics: string;\n topicAll: string;\n topicClosed: string;\n topicOptions: string;\n topicNew: string;\n topicRename: string;\n topicClose: string;\n topicReopen: string;\n topicName: string;\n topicNamePlaceholder: string;\n topicAdd: string;\n topicSave: string;\n topicExists: string;\n topicClosedNotice: string;\n topicPlaceholder: string;\n topicClosedDone: string;\n topicReopenedDone: string;\n // Scheduled send\n schedule: string;\n scheduleTitle: string;\n scheduleHint: string;\n schedulePick: string;\n scheduleDate: string;\n scheduleTime: string;\n scheduleConfirm: string;\n scheduleOutOfRange: string;\n scheduledFor: string;\n scheduleFailed: string;\n scheduleNoFiles: string;\n scheduledCount: string;\n scheduledCountOne: string;\n scheduledTitle: string;\n scheduledEmpty: string;\n scheduledEmptyBody: string;\n scheduledCancel: string;\n /** On a scheduled message that couldn't be sent. */\n scheduledRemove: string;\n scheduledCancelled: string;\n scheduledCouldntSend: string;\n // Availability\n availabilityTitle: string;\n awayMessage: string;\n awayMessagePlaceholder: string;\n awayUntil: string;\n awayUntilOn: string;\n imBack: string;\n workingHours: string;\n workingHoursOn: string;\n workingHoursHint: string;\n workingDay: string;\n notWorking: string;\n hoursFrom: string;\n hoursTo: string;\n hoursSameTime: string;\n timeZone: string;\n timeZoneSearch: string;\n availabilitySave: string;\n availabilitySaved: string;\n // Broadcast\n broadcastTitle: string;\n broadcastExplainer: string;\n broadcastMessage: string;\n broadcastPlaceholder: string;\n broadcastTo: string;\n broadcastFilter: string;\n broadcastSelectAll: string;\n broadcastClear: string;\n broadcastPickSome: string;\n broadcastPicked: string;\n broadcastPickedOne: string;\n broadcastSend: string;\n broadcastSendTo: string;\n broadcastSent: string;\n broadcastSentOne: string;\n broadcastSentSome: string;\n broadcastNoMatches: string;\n broadcastNoConversations: string;\n // Search\n search: string;\n searchPlaceholder: string;\n searchThreadPlaceholder: string;\n searchHint: string;\n searchNoResults: string;\n searchNoResultsBody: string;\n searchResults: string;\n searchResultsOne: string;\n searchIn: string;\n transcript: string;\n messageGone: string;\n /** Said by VoiceOver when a jump lands. */\n jumpedTo: string;\n // Moderation\n moderationHidden: string;\n moderationHiddenMine: string;\n moderationFlagged: string;\n}\n\nexport const chatOrganiseCopy: ChatOrganiseCopy = {\n topics: \"Topics\",\n topicAll: \"All\",\n topicClosed: \"Closed\",\n topicOptions: \"Topic options\",\n topicNew: \"New topic\",\n topicRename: \"Rename topic\",\n topicClose: \"Close topic\",\n topicReopen: \"Reopen topic\",\n topicName: \"Name\",\n topicNamePlaceholder: \"Week 1: Habits\",\n topicAdd: \"Add topic\",\n topicSave: \"Save\",\n topicExists: \"There's already a topic with that name.\",\n topicClosedNotice: \"This topic is closed.\",\n topicPlaceholder: \"Message #{name}\",\n topicClosedDone: \"Closed {name}\",\n topicReopenedDone: \"Reopened {name}\",\n schedule: \"Schedule message\",\n scheduleTitle: \"Schedule message\",\n scheduleHint: \"It sends at this time, in your time zone, as if you'd sent it then.\",\n schedulePick: \"Pick a date and time\",\n scheduleDate: \"Date\",\n scheduleTime: \"Time\",\n scheduleConfirm: \"Schedule\",\n scheduleOutOfRange: \"Pick a time from a minute to a year from now.\",\n scheduledFor: \"Scheduled for {when}\",\n scheduleFailed: \"Couldn't schedule it\",\n scheduleNoFiles: \"Photos and files can't be scheduled yet. Send them now, or remove them to schedule the text.\",\n scheduledCount: \"{count} scheduled messages\",\n scheduledCountOne: \"1 scheduled message\",\n scheduledTitle: \"Scheduled\",\n scheduledEmpty: \"Nothing scheduled\",\n scheduledEmptyBody: \"Touch and hold Send to schedule a message.\",\n scheduledCancel: \"Cancel\",\n scheduledRemove: \"Remove\",\n scheduledCancelled: \"Scheduled message cancelled\",\n scheduledCouldntSend: \"Couldn't send\",\n availabilityTitle: \"Availability\",\n awayMessage: \"Away message\",\n awayMessagePlaceholder: \"Back Monday. For anything urgent, call the office.\",\n awayUntil: \"Away until\",\n awayUntilOn: \"Set an end\",\n imBack: \"I'm back\",\n workingHours: \"Working hours\",\n workingHoursOn: \"Tell people when you usually reply\",\n workingHoursHint: \"An end before the start runs past midnight.\",\n workingDay: \"Working on {name}\",\n notWorking: \"Not working\",\n hoursFrom: \"{name} from\",\n hoursTo: \"{name} to\",\n hoursSameTime: \"A day's start and end can't be the same time.\",\n timeZone: \"Time zone\",\n timeZoneSearch: \"Search time zones\",\n availabilitySave: \"Save\",\n availabilitySaved: \"Availability saved\",\n broadcastTitle: \"Broadcast\",\n broadcastExplainer: \"Each person gets this in their own conversation with you, so replies come back to you privately. No one sees who else got it.\",\n broadcastMessage: \"Message\",\n broadcastPlaceholder: \"Write once, send to everyone you pick\",\n broadcastTo: \"Send to\",\n broadcastFilter: \"Filter\",\n broadcastSelectAll: \"Select all\",\n broadcastClear: \"Clear\",\n broadcastPickSome: \"Pick who gets it\",\n broadcastPicked: \"{count} conversations\",\n broadcastPickedOne: \"1 conversation\",\n broadcastSend: \"Send\",\n broadcastSendTo: \"Send to {count}\",\n broadcastSent: \"Sent to {count} conversations\",\n broadcastSentOne: \"Sent to 1 conversation\",\n broadcastSentSome: \"Sent to {count} of {total}. You can't post in the others.\",\n broadcastNoMatches: \"No matches\",\n broadcastNoConversations: \"No conversations yet\",\n search: \"Search\",\n searchPlaceholder: \"Search messages\",\n searchThreadPlaceholder: \"Search this conversation\",\n searchHint: \"Type at least two letters.\",\n searchNoResults: \"No results\",\n searchNoResultsBody: \"Nothing matches “{query}”.\",\n searchResults: \"{count} results\",\n searchResultsOne: \"1 result\",\n searchIn: \"in {name}\",\n transcript: \"Transcript\",\n messageGone: \"That message isn't here any more\",\n jumpedTo: \"Message from {name}: {text}\",\n moderationHidden: \"Hidden by moderation\",\n moderationHiddenMine: \"Hidden by moderation. Only you can see it.\",\n moderationFlagged: \"Flagged\",\n};\n","/**\n * @feat:chat\n * Every word the native chat screens say, in one catalog an app can override\n * (translate, rename \"Message\" to \"Note\"). `{name}` and `{count}` are filled in.\n */\nimport { chatOrganiseCopy, type ChatOrganiseCopy } from \"./organise-copy\";\n\n/** Topics, scheduled send, availability, broadcast, search and moderation are in `ChatOrganiseCopy`. */\nexport interface ChatNativeCopy extends ChatOrganiseCopy {\n inboxTitle: string;\n inboxEmptyTitle: string;\n inboxEmptyBody: string;\n inboxErrorTitle: string;\n startConversation: string;\n startConversationTitle: string;\n untitled: string;\n you: string;\n someone: string;\n youPrefix: string;\n mentionedYou: string;\n markRead: string;\n pin: string;\n unpin: string;\n archive: string;\n threadEmptyTitle: string;\n threadEmptyBody: string;\n loadEarlier: string;\n newMessages: string;\n placeholder: string;\n send: string;\n attach: string;\n attachLibrary: string;\n attachCamera: string;\n attachPaste: string;\n removeAttachment: string;\n replyingTo: string;\n cancelReply: string;\n cantPost: string;\n /** Your role in a conversation couldn't be read (offline): with Retry. */\n accessError: string;\n cantPostAdmins: string;\n cantPostClosed: string;\n recordVoice: string;\n recordHint: string;\n slideToCancel: string;\n releaseToCancel: string;\n lockedHint: string;\n stopAndSend: string;\n cancelRecording: string;\n micDenied: string;\n tooShort: string;\n /** A recording whose stop failed or left no file. */\n recordingFailed: string;\n /** A recording ended by a call, Siri, another app or the app leaving the screen. */\n recordingInterrupted: string;\n play: string;\n /** The bubble's VoiceOver actions on a voice note. */\n playVoice: string;\n pauseVoice: string;\n changeSpeed: string;\n /** The bubble's VoiceOver action for the nth of several photos. */\n openPhotoN: string;\n pause: string;\n speed: string;\n voiceMessage: string;\n voice: string;\n photo: string;\n file: string;\n video: string;\n /** Video messages (recorder, upload, player), link previews and app attachment cards. */\n recordVideo: string;\n recordVideoHint: string;\n startVideo: string;\n stopVideo: string;\n flipCamera: string;\n closeRecorder: string;\n cameraDenied: string;\n openSettings: string;\n cameraFailed: string;\n videoTooShort: string;\n /** \"0:12 of 2:00\", the recorder's timer. */\n videoElapsed: string;\n videoUploading: string;\n videoUploadFailed: string;\n videoOffline: string;\n videoForbidden: string;\n videoCantPlay: string;\n /** A take that the camera didn't hand over. */\n videoTakeFailed: string;\n tryAgain: string;\n cancelUpload: string;\n videoProcessing: string;\n videoFailed: string;\n playVideo: string;\n pauseVideo: string;\n mute: string;\n unmute: string;\n fullScreen: string;\n /** \"Video, 0:42\". */\n videoMessage: string;\n /** A link preview card's label: \"{title}, {site}\". */\n linkPreview: string;\n openLink: string;\n /** The bubble's VoiceOver action for its link preview. */\n openLinkAction: string;\n attachmentCard: string;\n openImage: string;\n closeViewer: string;\n photoOf: string;\n sharePhoto: string;\n savePhoto: string;\n photoSaved: string;\n photosDenied: string;\n viewerHint: string;\n sending: string;\n notSent: string;\n retry: string;\n /** On a message whose file didn't survive a relaunch: pick it again. */\n attachAgain: string;\n discard: string;\n deleted: string;\n edited: string;\n react: string;\n /** The long-press sheet's \"+\": every emoji. */\n moreReactions: string;\n addEmoji: string;\n emojiPicker: string;\n searchEmoji: string;\n noEmoji: string;\n recentEmoji: string;\n emojiSmileys: string;\n emojiPeople: string;\n emojiNature: string;\n emojiFood: string;\n emojiTravel: string;\n emojiActivities: string;\n emojiObjects: string;\n emojiSymbols: string;\n emojiFlags: string;\n reply: string;\n copy: string;\n copied: string;\n delete: string;\n deleteConfirm: string;\n cancel: string;\n actionFailed: string;\n messageActions: string;\n reactions: string;\n tooLarge: string;\n notAllowedType: string;\n tooMany: string;\n}\n\nexport const chatNativeCopy: ChatNativeCopy = {\n ...chatOrganiseCopy,\n inboxTitle: \"Messages\",\n inboxEmptyTitle: \"No conversations yet\",\n inboxEmptyBody: \"When someone messages you, or you start a conversation, it shows up here.\",\n inboxErrorTitle: \"Couldn't load your messages\",\n startConversation: \"New message\",\n startConversationTitle: \"Message someone\",\n untitled: \"Conversation\",\n you: \"You\",\n someone: \"Someone\",\n youPrefix: \"You: \",\n mentionedYou: \"Mentioned you\",\n markRead: \"Mark read\",\n pin: \"Pin\",\n unpin: \"Unpin\",\n archive: \"Archive\",\n threadEmptyTitle: \"No messages yet\",\n threadEmptyBody: \"Say hello below.\",\n loadEarlier: \"Load earlier messages\",\n newMessages: \"New messages\",\n placeholder: \"Message\",\n send: \"Send\",\n attach: \"Add a photo or file\",\n attachLibrary: \"Photo library\",\n attachCamera: \"Take a photo\",\n attachPaste: \"Paste picture\",\n removeAttachment: \"Remove {name}\",\n replyingTo: \"Replying to {name}\",\n cancelReply: \"Cancel reply\",\n cantPost: \"You can't post in this conversation.\",\n accessError: \"This conversation couldn't be loaded. Check your connection and try again.\",\n cantPostAdmins: \"Only admins can post here.\",\n cantPostClosed: \"This conversation is closed.\",\n recordVoice: \"Record a voice message\",\n recordHint: \"Hold to record, slide left to cancel, slide up to lock.\",\n slideToCancel: \"‹ Slide to cancel\",\n releaseToCancel: \"Release to cancel\",\n lockedHint: \"Recording. Tap send when you're done.\",\n stopAndSend: \"Send voice message\",\n cancelRecording: \"Delete recording\",\n micDenied: \"Turn on the microphone for this app in Settings to record.\",\n tooShort: \"Hold to record a voice message.\",\n recordingFailed: \"The voice message couldn't be saved. Try recording it again.\",\n recordingInterrupted: \"Recording stopped, so it wasn't sent. Hold to record again.\",\n play: \"Play\",\n playVoice: \"Play voice message\",\n pauseVoice: \"Pause voice message\",\n changeSpeed: \"Change playback speed\",\n openPhotoN: \"Open photo {n}\",\n pause: \"Pause\",\n speed: \"Playback speed {rate}\",\n voiceMessage: \"Voice message, {duration}\",\n voice: \"Voice message\",\n photo: \"Photo\",\n file: \"File\",\n video: \"Video\",\n recordVideo: \"Record a video\",\n recordVideoHint: \"Tap to start and tap again to send, or hold and let go to send.\",\n startVideo: \"Start recording\",\n stopVideo: \"Stop and send\",\n flipCamera: \"Switch camera\",\n closeRecorder: \"Close the camera\",\n cameraDenied: \"Turn on the camera and microphone for this app in Settings to record a video.\",\n openSettings: \"Open Settings\",\n cameraFailed: \"The camera couldn't start.\",\n videoTooShort: \"That was too short to send. Hold longer, or tap to start and tap again to stop.\",\n videoElapsed: \"{elapsed} of {limit}\",\n videoUploading: \"Sending video, {percent}%\",\n videoUploadFailed: \"The video didn't send.\",\n videoOffline: \"The video didn't send. Check your connection and retry.\",\n videoForbidden: \"You can't post in this conversation.\",\n videoCantPlay: \"This video can't play right now.\",\n videoTakeFailed: \"That take didn't record. Try again.\",\n tryAgain: \"Try again\",\n cancelUpload: \"Cancel video\",\n videoProcessing: \"Processing video\",\n videoFailed: \"This video couldn't be processed.\",\n playVideo: \"Play video\",\n pauseVideo: \"Pause video\",\n mute: \"Mute\",\n unmute: \"Unmute\",\n fullScreen: \"Full screen\",\n videoMessage: \"Video, {duration}\",\n linkPreview: \"{title}, {site}\",\n openLink: \"Opens the link\",\n openLinkAction: \"Open link\",\n attachmentCard: \"{title}, {subtitle}\",\n openImage: \"Open photo\",\n closeViewer: \"Close\",\n photoOf: \"Photo {n} of {count}\",\n sharePhoto: \"Share photo\",\n savePhoto: \"Save to Photos\",\n photoSaved: \"Saved to Photos\",\n photosDenied: \"Allow this app to add to Photos in Settings to save.\",\n viewerHint: \"Swipe up or down for the next or previous photo.\",\n sending: \"Sending\",\n notSent: \"Not sent\",\n retry: \"Retry\",\n attachAgain: \"Attach again\",\n discard: \"Delete\",\n deleted: \"Message deleted\",\n edited: \"edited\",\n react: \"React with {emoji}\",\n moreReactions: \"More reactions\",\n addEmoji: \"Add emoji\",\n emojiPicker: \"Emoji\",\n searchEmoji: \"Search emoji\",\n noEmoji: \"No emoji found\",\n recentEmoji: \"Recent\",\n emojiSmileys: \"Smileys and emotion\",\n emojiPeople: \"People and body\",\n emojiNature: \"Animals and nature\",\n emojiFood: \"Food and drink\",\n emojiTravel: \"Travel and places\",\n emojiActivities: \"Activities\",\n emojiObjects: \"Objects\",\n emojiSymbols: \"Symbols\",\n emojiFlags: \"Flags\",\n reply: \"Reply\",\n copy: \"Copy\",\n copied: \"Copied\",\n delete: \"Delete\",\n deleteConfirm: \"Delete this message for everyone?\",\n cancel: \"Cancel\",\n actionFailed: \"That didn't work\",\n messageActions: \"Message actions\",\n reactions: \"{count} reactions\",\n tooLarge: \"{name} is too large to send.\",\n notAllowedType: \"{name} can't be sent.\",\n tooMany: \"At most {count} attachments in one message.\",\n};\n\nexport type ChatNativeCopyOverrides = Partial<ChatNativeCopy>;\n\nexport function resolveChatCopy(overrides?: ChatNativeCopyOverrides): ChatNativeCopy {\n return overrides ? { ...chatNativeCopy, ...overrides } : chatNativeCopy;\n}\n\n/** `fill(\"Replying to {name}\", { name: \"Sam\" })`. */\nexport function fill(text: string, values: Record<string, string | number>): string {\n return text.replace(/\\{(\\w+)\\}/g, (m, k: string) => (k in values ? String(values[k]) : m));\n}\n","/**\n * @feat:chat\n * What the native screens share: the native modules the app passed, the copy,\n * and how to name and picture a person (the chat schema stores user ids only;\n * names and avatars are the app's, from its own profiles: `ChatProvider\n * loadPeople`, read through `usePeople`, or `getPerson` here, which wins).\n */\nimport { createContext, useContext, useMemo, type ReactNode } from \"react\";\nimport { usePeople } from \"../react/index\";\nimport { resolveChatCopy, type ChatNativeCopy, type ChatNativeCopyOverrides } from \"./copy\";\nimport type { ChatNativeModules } from \"./modules\";\n\nexport interface ChatPerson {\n name: string;\n avatarUrl?: string | null;\n}\n\nexport interface ChatNativeContextValue {\n modules: ChatNativeModules;\n copy: ChatNativeCopy;\n /** A person's name and picture, or undefined while it isn't known. */\n person(userId: string | null | undefined): ChatPerson | undefined;\n}\n\nconst EMPTY_MODULES: ChatNativeModules = Object.freeze({});\nconst DEFAULT: ChatNativeContextValue = { modules: EMPTY_MODULES, copy: resolveChatCopy(), person: () => undefined };\nconst Context = createContext<ChatNativeContextValue>(DEFAULT);\n\nexport interface ChatNativeProviderProps {\n /** Define at module scope: a new object every render re-renders every chat screen. */\n modules?: ChatNativeModules;\n copy?: ChatNativeCopyOverrides;\n /** Names and avatars the app already has; wins over `ChatProvider loadPeople`. */\n getPerson?: (userId: string) => ChatPerson | undefined;\n children: ReactNode;\n}\n\n/** Inside `ChatProvider` (from `/react`). Optional: without it there are no native extras and people are \"Someone\". */\nexport function ChatNativeProvider({ modules = EMPTY_MODULES, copy, getPerson, children }: ChatNativeProviderProps) {\n const value = useMemo<ChatNativeContextValue>(\n () => ({ modules, copy: resolveChatCopy(copy), person: (id) => (id && getPerson ? getPerson(id) : undefined) }),\n [modules, copy, getPerson],\n );\n return <Context.Provider value={value}>{children}</Context.Provider>;\n}\n\nexport function useChatNative(): ChatNativeContextValue {\n return useContext(Context);\n}\n\n/**\n * Below it, `person()` also knows these people, fetched in one batch through\n * `ChatProvider loadPeople` (a screen wraps its rows in it with the ids it shows).\n */\nexport function ChatPeopleScope({ userIds, children }: { userIds: readonly (string | null | undefined)[]; children: ReactNode }) {\n const parent = useContext(Context);\n const people = usePeople(userIds as (string | null | undefined)[]);\n const value = useMemo<ChatNativeContextValue>(\n () => ({ ...parent, person: (id) => parent.person(id) ?? (id ? people[id] : undefined) }),\n [parent, people],\n );\n return <Context.Provider value={value}>{children}</Context.Provider>;\n}\n\n/** \"SA\" for \"Sam Altman\", \"S\" for \"sam\". */\nexport function initials(name: string | undefined): string {\n const parts = (name ?? \"\").trim().split(/\\s+/).filter(Boolean);\n if (parts.length === 0) return \"?\";\n return ((parts[0]![0] ?? \"\") + (parts.length > 1 ? (parts[parts.length - 1]![0] ?? \"\") : \"\")).toUpperCase();\n}\n","/**\n * @feat:chat\n * Colors over a camera feed or a video frame, the same in light and dark mode: the picture\n * behind them is what it is, so the theme roles (which follow the scheme) don't apply. Genesis\n * has no \"on media\" role yet; these are the one place chat names them.\n */\nexport const ON_MEDIA = \"#ffffff\";\nexport const MEDIA_BACKDROP = \"#000000\";\nexport const MEDIA_FRAME = \"#111111\";\n/** Behind controls and labels laid over a picture. */\nexport const MEDIA_SCRIM = \"rgba(0,0,0,0.5)\";\nexport const MEDIA_SCRIM_LIGHT = \"rgba(0,0,0,0.35)\";\n/** A tint-bubble card's fill, over the tint. */\nexport const ON_TINT_FILL = \"rgba(255,255,255,0.16)\";\nexport const ON_TINT_FILL_STRONG = \"rgba(255,255,255,0.2)\";\n","/**\n * @feat:chat\n * Cards for the app's own attachment kinds (`ChatProvider attachmentKinds`: a form to fill, a\n * check-in to answer): an icon, the title and subtitle the kind gives, and one button. The\n * button runs the kind's `onPress`; else the app's `onOpenAttachment` (open the form in the\n * app's own screen); else its `href`, when it is https. The bubble offers the same button as\n * a VoiceOver action (`cardAction`), since an accessible bubble hides what is inside it.\n */\nimport { Linking, View } from \"react-native\";\nimport { NativeButton, NativeIcon, NativeText } from \"@marktiderman/genesis-ui-native/components\";\nimport { useThemeRoles } from \"@marktiderman/genesis-ui-native/hooks\";\nimport type { ChatAttachment, ChatMessage } from \"../core/types\";\nimport type { ChatAttachmentKind } from \"../react/index\";\nimport { fill } from \"./copy\";\nimport { useChatNative } from \"./context\";\nimport { ON_TINT_FILL, ON_TINT_FILL_STRONG } from \"./media-colors\";\n\nexport type OpenAttachment = (attachment: ChatAttachment, message: ChatMessage) => void;\n\n/** A message's attachments split into the app's cards and the rest (photos, voice, video, files). */\nexport function splitCardAttachments<T extends { kind: string }>(attachments: readonly T[], kinds: Record<string, ChatAttachmentKind> | undefined): { cards: T[]; rest: T[] } {\n if (!kinds) return { cards: [], rest: [...attachments] };\n const cards: T[] = [];\n const rest: T[] = [];\n for (const a of attachments) (Object.prototype.hasOwnProperty.call(kinds, a.kind) ? cards : rest).push(a);\n return { cards, rest };\n}\n\n/**\n * A link a card may open by itself: https only. A kind's href is often built from what another\n * person sent, so any other scheme (tel:, sms:, another app's links) goes through the app's own\n * `onOpenAttachment` or the kind's `onPress` instead.\n */\nexport function isOpenableHref(href: string | null | undefined): href is string {\n if (!href) return false;\n try {\n const u = new URL(href);\n return u.protocol === \"https:\" && Boolean(u.hostname);\n } catch {\n return false;\n }\n}\n\n/** What a card does: the kind's own handler, else the app's, else an https href; null without a button. */\nexport function cardAction(kind: ChatAttachmentKind | undefined, attachment: ChatAttachment, message: ChatMessage, onOpenAttachment?: OpenAttachment): { label: string; run: () => void } | null {\n let action: ReturnType<NonNullable<ChatAttachmentKind[\"action\"]>> = null;\n try {\n action = kind?.action?.(attachment);\n } catch {\n return null;\n }\n if (!action?.label) return null;\n const href = isOpenableHref(action.href) ? action.href : null;\n const onPress = action.onPress;\n const run = onPress ? onPress : onOpenAttachment ? () => onOpenAttachment(attachment, message) : href ? () => void Linking.openURL(href).catch(() => undefined) : null;\n return run ? { label: action.label, run } : null;\n}\n\nexport interface ChatAttachmentCardProps {\n attachment: ChatAttachment;\n message: ChatMessage;\n kind: ChatAttachmentKind;\n mine?: boolean;\n onOpenAttachment?: OpenAttachment;\n testID?: string;\n}\n\nexport function ChatAttachmentCard({ attachment, message, kind, mine = false, onOpenAttachment, testID = \"chat-attachment-card\" }: ChatAttachmentCardProps) {\n const { copy } = useChatNative();\n const colors = useThemeRoles();\n let title = \"\";\n let subtitle: string | null | undefined = null;\n try {\n title = kind.title(attachment);\n subtitle = kind.subtitle?.(attachment);\n } catch (e) {\n // An app's kind that throws shows as a plain card, and says so in development.\n if (typeof __DEV__ !== \"undefined\" && __DEV__) console.warn(`[genesis-chat] attachment kind \"${attachment.kind}\" threw:`, e);\n }\n title = title || attachment.name || attachment.kind;\n const action = cardAction(kind, attachment, message, onOpenAttachment);\n const fg = mine ? \"text-primary-foreground\" : undefined;\n return (\n <View\n testID={testID}\n style={{ flexDirection: \"row\", alignItems: \"center\", gap: 10, padding: 10, borderRadius: 12, minWidth: 220, backgroundColor: mine ? ON_TINT_FILL : colors.groupedBackground }}\n >\n <View\n accessible\n accessibilityLabel={subtitle ? fill(copy.attachmentCard, { title, subtitle }) : title}\n style={{ flexDirection: \"row\", alignItems: \"center\", gap: 10, flex: 1 }}\n >\n <View style={{ width: 40, height: 40, borderRadius: 10, alignItems: \"center\", justifyContent: \"center\", backgroundColor: mine ? ON_TINT_FILL_STRONG : colors.fill }}>\n <NativeIcon name=\"file\" size={20} color={mine ? colors.surface : colors.tint} />\n </View>\n <View style={{ flex: 1, minWidth: 0 }}>\n <NativeText numberOfLines={1} className={fg} style={mine ? { fontWeight: \"600\", fontSize: 15 } : { fontWeight: \"600\", fontSize: 15, color: colors.label }}>\n {title}\n </NativeText>\n {subtitle ? (\n <NativeText preset=\"caption\" numberOfLines={1} className={fg} style={mine ? { opacity: 0.85 } : { color: colors.secondaryLabel }}>\n {subtitle}\n </NativeText>\n ) : null}\n </View>\n </View>\n {action ? (\n <NativeButton testID={`${testID}-action`} variant={mine ? \"secondary\" : \"default\"} onPress={action.run}>\n {action.label}\n </NativeButton>\n ) : null}\n </View>\n );\n}\n\ndeclare const __DEV__: boolean | undefined;\n","/**\n * @feat:chat\n * A link's preview under its message, from `useLinkPreviews`: the site, the title and the\n * description, all plain text the server fetched (Open Graph, never HTML). Tap to open: in an\n * in-app browser with `modules.webBrowser` (expo-web-browser), else the system's (`Linking`).\n * Only https links. The image shows only when the app turns on `linkPreviewImages`: fetching\n * a page's og:image from the phone tells that site the reader's address, so by default the\n * card has none and nothing is fetched. The thread screen reads that switch from `ChatProvider\n * linkPreviewImages` once the provider has it (the chat owner's change); until then it is off.\n */\nimport { Linking, Pressable, View } from \"react-native\";\nimport { NativeImage, NativeText } from \"@marktiderman/genesis-ui-native/components\";\nimport { useThemeRoles } from \"@marktiderman/genesis-ui-native/hooks\";\nimport { extractLinks, isHttpsUrl } from \"../core/extras\";\nimport type { ChatLinkPreview, ChatMessage } from \"../core/types\";\nimport { fill } from \"./copy\";\nimport { useChatNative } from \"./context\";\nimport { ON_TINT_FILL } from \"./media-colors\";\nimport type { WebBrowserLike } from \"./modules\";\n\n/** The site a link is on, without `www.`. */\nexport function linkHost(url: string): string {\n try {\n return new URL(url).hostname.replace(/^www\\./, \"\");\n } catch {\n return url;\n }\n}\n\n/** The preview a bubble shows: the first one the server fetched for a link in its text, https only. */\nexport function previewToShow(previews: readonly ChatLinkPreview[] | undefined): ChatLinkPreview | null {\n return previews?.find((p) => p.status === \"ok\" && isHttpsUrl(p.url)) ?? null;\n}\n\n/** The messages to ask previews for: shown (not deleted, not hidden by moderation), with a link. */\nexport function linkPreviewIds(messages: readonly ChatMessage[]): string[] {\n return messages.filter((m) => !m.deletedAt && m.moderation !== \"hidden\" && extractLinks(m.body).length > 0).map((m) => m.id);\n}\n\n/** Opens a link from chat: https only, in the in-app browser when there is one. */\nexport async function openChatLink(url: string, webBrowser?: WebBrowserLike): Promise<boolean> {\n if (!isHttpsUrl(url)) return false;\n try {\n if (webBrowser) await webBrowser.openBrowserAsync(url);\n else await Linking.openURL(url);\n return true;\n } catch {\n return false;\n }\n}\n\nexport interface ChatLinkPreviewCardProps {\n preview: ChatLinkPreview;\n /** On the tint bubble. */\n mine?: boolean;\n /** Show the og:image. Off by default: fetching it tells the site the reader's address. */\n images?: boolean;\n testID?: string;\n}\n\nexport function ChatLinkPreviewCard({ preview, mine = false, images = false, testID = \"chat-link-preview\" }: ChatLinkPreviewCardProps) {\n const { copy, modules } = useChatNative();\n const colors = useThemeRoles();\n if (preview.status !== \"ok\" || !isHttpsUrl(preview.url)) return null;\n const host = linkHost(preview.url);\n const site = preview.siteName?.trim() || host;\n const title = preview.title?.trim() || host;\n const image = images && isHttpsUrl(preview.imageUrl) ? preview.imageUrl : null;\n const fg = mine ? \"text-primary-foreground\" : undefined;\n return (\n <Pressable\n testID={testID}\n accessibilityRole=\"link\"\n accessibilityLabel={fill(copy.linkPreview, { title, site })}\n accessibilityHint={copy.openLink}\n onPress={() => void openChatLink(preview.url, modules.webBrowser)}\n style={{\n marginTop: 2,\n borderLeftWidth: 3,\n borderLeftColor: mine ? colors.surface : colors.tint,\n borderRadius: 10,\n overflow: \"hidden\",\n backgroundColor: mine ? ON_TINT_FILL : colors.groupedBackground,\n }}\n >\n {image ? (\n <NativeImage testID={`${testID}-image`} src={image} width={240} height={126} contentFit=\"cover\" />\n ) : null}\n <View style={{ paddingHorizontal: 10, paddingVertical: 8, gap: 2 }}>\n <NativeText preset=\"caption\" numberOfLines={1} className={fg} style={mine ? { opacity: 0.8 } : { color: colors.secondaryLabel }}>\n {site}\n </NativeText>\n <NativeText numberOfLines={2} className={fg} style={mine ? { fontWeight: \"600\", fontSize: 15 } : { fontWeight: \"600\", fontSize: 15, color: colors.label }}>\n {title}\n </NativeText>\n {preview.description ? (\n <NativeText preset=\"caption\" numberOfLines={2} className={fg} style={mine ? { opacity: 0.85 } : { color: colors.secondaryLabel }}>\n {preview.description}\n </NativeText>\n ) : null}\n </View>\n </Pressable>\n );\n}\n","/**\n * @feat:chat\n * A voice note in a bubble: play and pause, its waveform (drawn before the\n * audio loads), drag across it to scrub, 1x / 1.5x / 2x, and the time. One\n * voice note plays at a time: starting one pauses the one playing. Each one\n * also answers `toggleVoiceNote` / `cycleVoiceNoteRate` by its id, which the\n * bubble's VoiceOver actions call (an accessible bubble hides its children).\n */\nimport { useEffect, useMemo, useRef, useState, useSyncExternalStore } from \"react\";\nimport { PanResponder, Pressable, View, type LayoutChangeEvent } from \"react-native\";\nimport { NativeIcon, NativeText } from \"@marktiderman/genesis-ui-native/components\";\nimport { useThemeRoles } from \"@marktiderman/genesis-ui-native/hooks\";\nimport { formatDuration, nextPlaybackRate } from \"../core/media\";\nimport { fill } from \"./copy\";\nimport { useChatNative } from \"./context\";\nimport type { ExpoAudioLike } from \"./modules\";\n\n// ---- One at a time --------------------------------------------------------\n\nlet active: { id: string; pause: () => void } | null = null;\nconst playbackListeners = new Set<() => void>();\nconst notifyPlayback = () => playbackListeners.forEach((l) => l());\n\n/** Called when a voice note starts: pauses whichever other one was playing. */\nexport function claimPlayback(id: string, pause: () => void): void {\n if (active && active.id !== id) {\n try {\n active.pause();\n } catch {\n // A player already gone has nothing to pause.\n }\n }\n active = { id, pause };\n notifyPlayback();\n}\n\n/** Called when a voice note stops or unmounts. */\nexport function releasePlayback(id: string): void {\n if (active?.id === id) {\n active = null;\n notifyPlayback();\n }\n}\n\nconst subscribePlayback = (l: () => void) => {\n playbackListeners.add(l);\n return () => void playbackListeners.delete(l);\n};\n\n/** Which of these voice notes is playing, or null (re-renders only when that answer changes). */\nexport function usePlayingVoiceNote(ids: readonly string[]): string | null {\n const key = ids.join(\"|\");\n return useSyncExternalStore(\n subscribePlayback,\n () => (active && key.split(\"|\").includes(active.id) ? active.id : null),\n () => null,\n );\n}\n\n// ---- Controls by id, for the bubble's accessibility actions -----------------\n\ninterface VoiceNoteControls {\n toggle: () => void;\n cycleRate: () => void;\n}\n\n// Every mounted player per id (one attachment can show in the timeline and in its thread): the newest answers.\nconst controls = new Map<string, VoiceNoteControls[]>();\nconst controlsFor = (id: string) => controls.get(id)?.at(-1);\n\n/** Plays or pauses the voice note with this id; false when none with it is on screen with playback. */\nexport function toggleVoiceNote(id: string): boolean {\n const c = controlsFor(id);\n c?.toggle();\n return Boolean(c);\n}\n\n/** Moves the voice note with this id to its next speed; false when none is on screen with playback. */\nexport function cycleVoiceNoteRate(id: string): boolean {\n const c = controlsFor(id);\n c?.cycleRate();\n return Boolean(c);\n}\n\n/** The playing voice note's id, for tests. */\nexport function activePlaybackId(): string | null {\n return active?.id ?? null;\n}\n\n/** Where a finger at `x` across a waveform `width` wide puts the playhead, in seconds. */\nexport function scrubSeconds(x: number, width: number, durationSec: number): number {\n if (width <= 0 || durationSec <= 0) return 0;\n return Math.max(0, Math.min(1, x / width)) * durationSec;\n}\n\nconst BAR_WIDTH = 3;\nconst BAR_GAP = 2;\n\n/** How many bars fit across `width` points, one bar plus a gap each; never fewer than one. */\nexport function barsThatFit(width: number): number {\n if (!(width > 0)) return 1;\n return Math.max(1, Math.floor((width + BAR_GAP) / (BAR_WIDTH + BAR_GAP)));\n}\n\n/** Bars 0–1 from stored peaks (0–100), resampled to `count`; flat when there are none. */\nexport function waveformBars(peaks: readonly number[] | null | undefined, count = 32): number[] {\n if (!peaks || peaks.length === 0) return new Array(count).fill(0.08);\n return Array.from({ length: count }, (_, i) => {\n const v = peaks[Math.min(peaks.length - 1, Math.floor((i * peaks.length) / count))] ?? 0;\n return Math.max(0.08, Math.min(1, v / 100));\n });\n}\n\nexport interface VoiceNotePlayerProps {\n /** Stable id (the attachment's), for one-at-a-time. */\n id: string;\n /** A signed URL or a local file URI; null while it is fetched. */\n uri: string | null;\n durationMs: number | null;\n waveform: number[] | null;\n /** On the tint bubble: draw in its foreground. */\n mine?: boolean;\n testID?: string;\n}\n\nexport function VoiceNotePlayer(props: VoiceNotePlayerProps) {\n const { modules } = useChatNative();\n if (!modules.audio) return <StaticVoiceNote {...props} />;\n return <AudioVoiceNote {...props} audio={modules.audio} />;\n}\n\n/** Without expo-audio: the waveform and duration, no playback. */\nfunction StaticVoiceNote({ durationMs, waveform, mine, testID }: VoiceNotePlayerProps) {\n const { copy } = useChatNative();\n const colors = useThemeRoles();\n const duration = formatDuration(durationMs);\n return (\n <View testID={testID} accessible accessibilityLabel={fill(copy.voiceMessage, { duration })} style={{ flexDirection: \"row\", alignItems: \"center\", gap: 8, minHeight: 44 }}>\n <Bars bars={waveformBars(waveform, 24)} progress={0} mine={mine} colors={colors} />\n <NativeText className={mine ? \"text-primary-foreground\" : undefined} style={{ fontSize: 13, fontVariant: [\"tabular-nums\"] }}>\n {duration}\n </NativeText>\n </View>\n );\n}\n\nfunction AudioVoiceNote({ id, uri, durationMs, waveform, mine, testID, audio }: VoiceNotePlayerProps & { audio: ExpoAudioLike }) {\n const { copy } = useChatNative();\n const colors = useThemeRoles();\n const source = useMemo(() => (uri ? { uri } : null), [uri]);\n const player = audio.useAudioPlayer(source, { updateInterval: 100 });\n const status = audio.useAudioPlayerStatus(player);\n const [scrubbing, setScrubbing] = useState<number | null>(null);\n const width = useRef(0);\n // As many bars as the waveform's slot holds, so they never run under the time and speed.\n const [barCount, setBarCount] = useState(0);\n\n // Unmounted (scrolled away, screen closed): it no longer holds the one playback slot.\n useEffect(() => () => releasePlayback(id), [id]);\n useEffect(() => {\n if (status.didJustFinish) releasePlayback(id);\n }, [status.didJustFinish, id]);\n\n const durationSec = status.duration > 0 ? status.duration : (durationMs ?? 0) / 1000;\n const position = scrubbing ?? status.currentTime;\n const progress = durationSec > 0 ? Math.min(1, position / durationSec) : 0;\n const rate = status.playbackRate || 1;\n\n const pause = () => {\n player.pause();\n releasePlayback(id);\n };\n const toggle = () => {\n if (status.playing) return pause();\n claimPlayback(id, () => player.pause());\n if (status.didJustFinish || (durationSec > 0 && status.currentTime >= durationSec - 0.05)) void player.seekTo(0);\n player.play();\n };\n const seek = (seconds: number) => void player.seekTo(Math.max(0, Math.min(durationSec, seconds)));\n const cycleRate = () => player.setPlaybackRate(nextPlaybackRate(rate));\n\n // The bubble's VoiceOver actions reach this player by its id.\n const handles = useRef({ toggle, cycleRate });\n handles.current = { toggle, cycleRate };\n useEffect(() => {\n const entry: VoiceNoteControls = { toggle: () => handles.current.toggle(), cycleRate: () => handles.current.cycleRate() };\n controls.set(id, [...(controls.get(id) ?? []), entry]);\n return () => {\n const rest = (controls.get(id) ?? []).filter((e) => e !== entry);\n if (rest.length) controls.set(id, rest);\n else controls.delete(id);\n };\n }, [id]);\n\n const latest = useRef({ durationSec, seek });\n latest.current = { durationSec, seek };\n const responder = useMemo(\n () =>\n PanResponder.create({\n // Only a sideways drag scrubs, so a scroll that starts on a voice note still scrolls.\n onMoveShouldSetPanResponder: (_e, g) => Math.abs(g.dx) > 6 && Math.abs(g.dx) > Math.abs(g.dy) * 1.5,\n onPanResponderTerminationRequest: () => false,\n onPanResponderGrant: (e) => setScrubbing(scrubSeconds(e.nativeEvent.locationX, width.current, latest.current.durationSec)),\n onPanResponderMove: (e) => setScrubbing(scrubSeconds(e.nativeEvent.locationX, width.current, latest.current.durationSec)),\n onPanResponderRelease: (e) => {\n latest.current.seek(scrubSeconds(e.nativeEvent.locationX, width.current, latest.current.durationSec));\n setScrubbing(null);\n },\n onPanResponderTerminate: () => setScrubbing(null),\n }),\n [],\n );\n\n const fg = mine ? \"text-primary-foreground\" : undefined;\n const shown = formatDuration((status.playing || position > 0 ? position : durationSec) * 1000);\n return (\n <View testID={testID} style={{ flexDirection: \"row\", alignItems: \"center\", gap: 6, minWidth: 240 }}>\n <Pressable\n testID={testID ? `${testID}-play` : undefined}\n accessibilityRole=\"button\"\n accessibilityLabel={status.playing ? copy.pause : copy.play}\n onPress={toggle}\n disabled={!uri}\n hitSlop={4}\n style={{ width: 44, height: 44, alignItems: \"center\", justifyContent: \"center\", opacity: uri ? 1 : 0.5 }}\n >\n <NativeIcon name={status.playing ? \"pause\" : \"play\"} size={22} color={mine ? colors.surface : colors.tint} />\n </Pressable>\n <View\n testID={testID ? `${testID}-wave` : undefined}\n accessible\n accessibilityRole=\"adjustable\"\n accessibilityLabel={fill(copy.voiceMessage, { duration: formatDuration(durationSec * 1000) })}\n accessibilityValue={{ text: `${formatDuration(position * 1000)} / ${formatDuration(durationSec * 1000)}` }}\n accessibilityActions={[{ name: \"increment\" }, { name: \"decrement\" }]}\n onAccessibilityAction={(e) => seek(status.currentTime + (e.nativeEvent.actionName === \"increment\" ? 5 : -5))}\n onLayout={(e: LayoutChangeEvent) => {\n width.current = e.nativeEvent.layout.width;\n setBarCount(barsThatFit(e.nativeEvent.layout.width));\n }}\n style={{ flex: 1, minWidth: 0, height: 44, justifyContent: \"center\", overflow: \"hidden\" }}\n {...responder.panHandlers}\n >\n {barCount > 0 ? <Bars bars={waveformBars(waveform, barCount)} progress={progress} mine={mine} colors={colors} /> : null}\n </View>\n <NativeText className={fg} style={{ fontSize: 13, minWidth: 36, fontVariant: [\"tabular-nums\"] }}>\n {shown}\n </NativeText>\n <Pressable\n testID={testID ? `${testID}-rate` : undefined}\n accessibilityRole=\"button\"\n accessibilityLabel={fill(copy.speed, { rate: `${rate}x` })}\n onPress={cycleRate}\n hitSlop={8}\n style={{ minWidth: 44, height: 44, alignItems: \"center\", justifyContent: \"center\" }}\n >\n <NativeText className={fg} style={{ fontSize: 13, fontWeight: \"600\" }}>{`${rate}×`}</NativeText>\n </Pressable>\n </View>\n );\n}\n\nfunction Bars({ bars, progress, mine, colors }: { bars: number[]; progress: number; mine?: boolean; colors: ReturnType<typeof useThemeRoles> }) {\n // On the tint bubble the bars are the surface color, the unplayed part faded.\n const played = mine ? colors.surface : colors.tint;\n const rest = mine ? colors.surface : colors.tertiaryLabel;\n return (\n <View pointerEvents=\"none\" style={{ flexDirection: \"row\", alignItems: \"center\", gap: BAR_GAP, height: 28, overflow: \"hidden\" }}>\n {bars.map((h, i) => (\n <View\n key={i}\n style={{\n width: BAR_WIDTH,\n borderRadius: BAR_WIDTH / 2,\n height: Math.max(3, Math.round(h * 28)),\n backgroundColor: (i + 0.5) / bars.length <= progress ? played : rest,\n opacity: mine && (i + 0.5) / bars.length > progress ? 0.45 : 1,\n }}\n />\n ))}\n </View>\n );\n}\n","/**\n * @feat:chat\n * A video in a bubble, on expo-video (`modules.video`): its poster (Mux's thumbnail, the\n * attachment's poster, or a plain frame) with the duration and a play button; tap to play,\n * then pause, mute, 1x / 1.5x / 2x and full screen. A Mux video streams as HLS from its\n * playback id; a stored one plays from its signed link (or, while it uploads, from the\n * phone). Until Mux has processed it, it says so. One plays at a time, voice notes included:\n * it takes the same playback slot (`claimPlayback`), so starting it pauses a voice note and\n * the other way round. The bubble's VoiceOver actions reach it by id (`toggleVideo`).\n */\nimport { useEffect, useMemo, useRef, useState, useSyncExternalStore } from \"react\";\nimport { ActivityIndicator, Pressable, View, useWindowDimensions } from \"react-native\";\nimport { NativeIcon, NativeImage, NativeText } from \"@marktiderman/genesis-ui-native/components\";\nimport { useThemeRoles } from \"@marktiderman/genesis-ui-native/hooks\";\nimport { formatDuration, nextPlaybackRate } from \"../core/media\";\nimport { fill } from \"./copy\";\nimport { useChatNative } from \"./context\";\nimport { MEDIA_FRAME, MEDIA_SCRIM, MEDIA_SCRIM_LIGHT, ON_MEDIA } from \"./media-colors\";\nimport type { ExpoVideoLike, VideoPlayerLike, VideoViewHandleLike } from \"./modules\";\nimport { claimPlayback, releasePlayback } from \"./voice-player\";\n\nexport const muxStreamUrl = (playbackId: string) => `https://stream.mux.com/${encodeURIComponent(playbackId)}.m3u8`;\nexport const muxPosterUrl = (playbackId: string, width = 480) => `https://image.mux.com/${encodeURIComponent(playbackId)}/thumbnail.jpg?width=${width}`;\n\nexport interface ChatVideoPlayerProps {\n /** Stable id (the attachment's), for one-at-a-time and the bubble's actions. */\n id: string;\n /** A stored video's signed link, or the file on the phone while it uploads. */\n uri: string | null;\n /** Mux's playback id: streamed as HLS. */\n playbackId?: string | null;\n /** The attachment's poster (a signed link). */\n posterUri?: string | null;\n provider?: string | null;\n status?: \"pending\" | \"ready\" | \"failed\" | null;\n durationMs: number | null;\n width?: number | null;\n height?: number | null;\n /** Still uploading from this phone. */\n uploading?: boolean;\n testID?: string;\n}\n\nexport type ChatVideoState = \"failed\" | \"processing\" | \"loading\" | \"playable\";\n\n/** What the player can show: a hosted video waits for its provider, a stored one for its link. */\nexport function videoState(p: Pick<ChatVideoPlayerProps, \"uri\" | \"playbackId\" | \"provider\" | \"status\">): ChatVideoState {\n if (p.status === \"failed\") return \"failed\";\n if (p.playbackId) return \"playable\";\n if (p.provider && p.provider !== \"storage\" && p.provider !== \"external\") return p.uri ? \"playable\" : \"processing\";\n return p.uri ? \"playable\" : \"loading\";\n}\n\n/** What expo-video loads: HLS for a playback id, else the file. */\nexport function videoSource(p: Pick<ChatVideoPlayerProps, \"uri\" | \"playbackId\">): { uri: string; contentType: \"hls\" | \"auto\" } | null {\n if (p.playbackId) return { uri: muxStreamUrl(p.playbackId), contentType: \"hls\" };\n return p.uri ? { uri: p.uri, contentType: \"auto\" } : null;\n}\n\n// ---- Controls by id, for the bubble's accessibility actions -----------------\n\ninterface VideoControls {\n toggle: () => void;\n fullScreen: () => void;\n mute: () => void;\n rate: () => void;\n}\nconst controls = new Map<string, VideoControls[]>();\nconst playingIds = new Set<string>();\nconst playingListeners = new Set<() => void>();\nconst setPlayingId = (id: string, on: boolean) => {\n if (playingIds.has(id) === on) return;\n if (on) playingIds.add(id);\n else playingIds.delete(id);\n playingListeners.forEach((l) => l());\n};\nconst subscribePlaying = (l: () => void) => {\n playingListeners.add(l);\n return () => void playingListeners.delete(l);\n};\n\n/** Which of these videos is playing, or null (re-renders only when that answer changes). */\nexport function usePlayingVideo(ids: readonly string[]): string | null {\n const key = ids.join(\"|\");\n return useSyncExternalStore(\n subscribePlaying,\n () => key.split(\"|\").find((id) => id && playingIds.has(id)) ?? null,\n () => null,\n );\n}\n\n/** Mutes or unmutes the video with this id while it plays. */\nexport function toggleVideoMute(id: string): boolean {\n const c = controls.get(id)?.at(-1);\n c?.mute();\n return Boolean(c);\n}\n\n/** Moves the playing video with this id to its next speed. */\nexport function cycleVideoRate(id: string): boolean {\n const c = controls.get(id)?.at(-1);\n c?.rate();\n return Boolean(c);\n}\n\n/** Plays or pauses the video with this id; false when none with it is on screen. */\nexport function toggleVideo(id: string): boolean {\n const c = controls.get(id)?.at(-1);\n c?.toggle();\n return Boolean(c);\n}\n\n/** Opens the video with this id full screen (starting it); false when none is on screen. */\nexport function fullScreenVideo(id: string): boolean {\n const c = controls.get(id)?.at(-1);\n c?.fullScreen();\n return Boolean(c);\n}\n\n/** Whether the video with this id is playing. */\nexport function isVideoPlaying(id: string): boolean {\n return playingIds.has(id);\n}\n\nfunction useRegister(id: string, handles: React.MutableRefObject<VideoControls>) {\n useEffect(() => {\n const entry: VideoControls = {\n toggle: () => handles.current.toggle(),\n fullScreen: () => handles.current.fullScreen(),\n mute: () => handles.current.mute(),\n rate: () => handles.current.rate(),\n };\n controls.set(id, [...(controls.get(id) ?? []), entry]);\n return () => {\n const rest = (controls.get(id) ?? []).filter((e) => e !== entry);\n if (rest.length) controls.set(id, rest);\n else controls.delete(id);\n };\n }, [id, handles]);\n}\n\n/** The bubble's video. Renders nothing without `modules.video` (the bubble shows a row instead). */\nexport function ChatVideoPlayer(props: ChatVideoPlayerProps) {\n const { modules, copy } = useChatNative();\n const colors = useThemeRoles();\n const { width: screen } = useWindowDimensions();\n const [active, setActive] = useState(false);\n const [fullOnStart, setFullOnStart] = useState(false);\n const testID = props.testID ?? `chat-video-${props.id}`;\n const state = videoState(props);\n const source = useMemo(() => videoSource(props), [props.uri, props.playbackId]); // eslint-disable-line react-hooks/exhaustive-deps\n\n const [broken, setBroken] = useState(false);\n const handles = useRef<VideoControls>({ toggle: () => undefined, fullScreen: () => undefined, mute: () => undefined, rate: () => undefined });\n handles.current = {\n toggle: () => state === \"playable\" && setActive(true),\n fullScreen: () => {\n if (state !== \"playable\") return;\n setFullOnStart(true);\n setActive(true);\n },\n mute: () => undefined,\n rate: () => undefined,\n };\n useRegister(props.id, handles);\n\n if (!modules.video) return null;\n const w = Math.min(240, Math.round(screen * 0.62));\n const ratio = props.width && props.height ? props.width / props.height : 3 / 4;\n const h = Math.round(Math.max(140, Math.min(w * 1.5, w / ratio)));\n const duration = props.durationMs ? formatDuration(props.durationMs) : null;\n const box = { width: w, height: h, borderRadius: 14, overflow: \"hidden\" as const, backgroundColor: MEDIA_FRAME };\n\n if (state === \"failed\" || state === \"processing\" || broken) {\n const text = broken ? copy.videoCantPlay : state === \"failed\" ? copy.videoFailed : copy.videoProcessing;\n return (\n <View\n testID={`${testID}-${broken ? \"broken\" : state}`}\n accessible\n accessibilityLabel={text}\n accessibilityLiveRegion=\"polite\"\n style={[box, { alignItems: \"center\", justifyContent: \"center\", gap: 8, padding: 12, backgroundColor: colors.fill }]}\n >\n {state === \"processing\" && !broken ? <ActivityIndicator color={colors.secondaryLabel as string} /> : <NativeIcon name=\"video\" size={24} color={colors.secondaryLabel} />}\n <NativeText preset=\"caption\" style={{ color: colors.secondaryLabel, textAlign: \"center\" }}>\n {text}\n </NativeText>\n </View>\n );\n }\n\n if (active && source) {\n return (\n <ActiveVideo\n {...props}\n video={modules.video}\n source={source}\n style={box}\n fullOnStart={fullOnStart}\n onFullStarted={() => setFullOnStart(false)}\n onBroken={() => setBroken(true)}\n handles={handles}\n testID={testID}\n />\n );\n }\n\n const poster = props.posterUri ?? (props.playbackId ? muxPosterUrl(props.playbackId) : null);\n return (\n <Pressable\n testID={`${testID}-poster`}\n accessibilityRole=\"button\"\n accessibilityLabel={duration ? fill(copy.videoMessage, { duration }) : copy.video}\n accessibilityHint={copy.playVideo}\n accessibilityState={{ disabled: state !== \"playable\", busy: props.uploading }}\n disabled={state !== \"playable\"}\n onPress={() => setActive(true)}\n style={box}\n >\n {poster ? <NativeImage src={poster} width={w} height={h} contentFit=\"cover\" recyclingKey={props.id} /> : null}\n <View style={{ position: \"absolute\", top: 0, left: 0, right: 0, bottom: 0, alignItems: \"center\", justifyContent: \"center\" }}>\n {state === \"loading\" || props.uploading ? (\n <ActivityIndicator color={ON_MEDIA} />\n ) : (\n <View style={{ width: 52, height: 52, borderRadius: 26, backgroundColor: MEDIA_SCRIM, alignItems: \"center\", justifyContent: \"center\" }}>\n <NativeIcon name=\"play\" size={24} color={ON_MEDIA} />\n </View>\n )}\n </View>\n {duration ? (\n <View style={{ position: \"absolute\", left: 8, bottom: 8, paddingHorizontal: 6, paddingVertical: 2, borderRadius: 8, backgroundColor: MEDIA_SCRIM }}>\n <NativeText style={{ color: ON_MEDIA, fontSize: 12, fontVariant: [\"tabular-nums\"] }}>{duration}</NativeText>\n </View>\n ) : null}\n </Pressable>\n );\n}\n\nfunction ActiveVideo({\n id,\n video,\n source,\n style,\n fullOnStart,\n onFullStarted,\n onBroken,\n handles,\n testID,\n}: ChatVideoPlayerProps & {\n onBroken: () => void;\n video: ExpoVideoLike;\n source: { uri: string; contentType: \"hls\" | \"auto\" };\n style: Record<string, unknown>;\n fullOnStart: boolean;\n onFullStarted: () => void;\n handles: React.MutableRefObject<VideoControls>;\n testID: string;\n}) {\n const { copy } = useChatNative();\n const player: VideoPlayerLike = video.useVideoPlayer(source, (p) => {\n p.play();\n });\n const viewRef = useRef<VideoViewHandleLike | null>(null);\n const latestBroken = useRef(onBroken);\n latestBroken.current = onBroken;\n const [playing, setPlaying] = useState(true);\n const [muted, setMuted] = useState(false);\n const [rate, setRate] = useState(1);\n const ended = useRef(false);\n\n useEffect(() => {\n claimPlayback(id, () => player.pause());\n setPlayingId(id, true);\n const subs = [\n player.addListener(\"playingChange\", ((payload: { isPlaying: boolean }) => {\n setPlaying(payload.isPlaying);\n setPlayingId(id, payload.isPlaying);\n if (payload.isPlaying) {\n ended.current = false;\n claimPlayback(id, () => player.pause());\n } else {\n releasePlayback(id);\n }\n }) as (payload: never) => void),\n player.addListener(\"playToEnd\", (() => {\n ended.current = true;\n }) as (payload: never) => void),\n // A stream that won't load (gone, refused, offline) says so instead of staying black.\n player.addListener(\"statusChange\", ((payload: { status: string }) => {\n if (payload.status === \"error\") latestBroken.current();\n }) as (payload: never) => void),\n ];\n return () => {\n subs.forEach((s) => s.remove());\n setPlayingId(id, false);\n releasePlayback(id);\n };\n }, [id, player]);\n\n useEffect(() => {\n if (!fullOnStart) return;\n onFullStarted();\n void viewRef.current?.enterFullscreen().catch(() => undefined);\n }, [fullOnStart, onFullStarted]);\n\n const toggle = () => {\n if (playing) return player.pause();\n if (ended.current) player.currentTime = 0;\n player.play();\n };\n const fullScreen = () => void viewRef.current?.enterFullscreen().catch(() => undefined);\n const toggleMute = () => {\n player.muted = !muted;\n setMuted(!muted);\n };\n const cycleRate = () => {\n const next = nextPlaybackRate(rate);\n player.playbackRate = next;\n setRate(next);\n };\n handles.current = { toggle, fullScreen, mute: toggleMute, rate: cycleRate };\n const { VideoView } = video;\n return (\n <View testID={`${testID}-active`} style={style}>\n <VideoView ref={viewRef} player={player} nativeControls={false} contentFit=\"cover\" allowsPictureInPicture={false} style={{ width: \"100%\", height: \"100%\" }} testID={`${testID}-view`} />\n <Pressable\n testID={`${testID}-surface`}\n accessibilityRole=\"button\"\n accessibilityLabel={playing ? copy.pauseVideo : copy.playVideo}\n onPress={toggle}\n style={{ position: \"absolute\", top: 0, left: 0, right: 0, bottom: 44, alignItems: \"center\", justifyContent: \"center\" }}\n >\n {!playing ? (\n <View style={{ width: 52, height: 52, borderRadius: 26, backgroundColor: MEDIA_SCRIM, alignItems: \"center\", justifyContent: \"center\" }}>\n <NativeIcon name=\"play\" size={24} color={ON_MEDIA} />\n </View>\n ) : null}\n </Pressable>\n <View style={{ position: \"absolute\", left: 0, right: 0, bottom: 0, height: 44, flexDirection: \"row\", alignItems: \"center\", justifyContent: \"space-between\", paddingHorizontal: 2, backgroundColor: MEDIA_SCRIM_LIGHT }}>\n <Control testID={`${testID}-play`} label={playing ? copy.pauseVideo : copy.playVideo} onPress={toggle} icon={playing ? \"pause\" : \"play\"} />\n <Control testID={`${testID}-mute`} label={muted ? copy.unmute : copy.mute} onPress={toggleMute} icon={muted ? \"volume-off\" : \"volume\"} />\n <Pressable\n testID={`${testID}-rate`}\n accessibilityRole=\"button\"\n accessibilityLabel={fill(copy.speed, { rate: `${rate}x` })}\n onPress={cycleRate}\n style={{ minWidth: 44, height: 44, alignItems: \"center\", justifyContent: \"center\" }}\n >\n <NativeText style={{ color: ON_MEDIA, fontSize: 13, fontWeight: \"600\", fontVariant: [\"tabular-nums\"] }}>{`${rate}x`}</NativeText>\n </Pressable>\n <Control testID={`${testID}-fullscreen`} label={copy.fullScreen} onPress={fullScreen} icon=\"expand\" />\n </View>\n </View>\n );\n}\n\nfunction Control({ icon, label, onPress, selected, testID }: { icon: \"play\" | \"pause\" | \"volume\" | \"volume-off\" | \"expand\"; label: string; onPress: () => void; selected?: boolean; testID: string }) {\n return (\n <Pressable\n testID={testID}\n accessibilityRole=\"button\"\n accessibilityLabel={label}\n accessibilityState={selected === undefined ? undefined : { selected }}\n onPress={onPress}\n style={{ width: 44, height: 44, alignItems: \"center\", justifyContent: \"center\" }}\n >\n <NativeIcon name={icon} size={20} color={ON_MEDIA} />\n </Pressable>\n );\n}\n","/**\n * @feat:chat\n * Pictures and files in a message: photos as a grid of NativeImage (expo-image\n * when the app gave it) over signed links from `useFileUrls`, a local preview\n * while one still uploads, a tap opening the full-screen viewer (photo-viewer.tsx); voice notes\n * as VoiceNotePlayer; other files as a row with their name.\n */\nimport { Pressable, View, useWindowDimensions } from \"react-native\";\nimport { NativeIcon, NativeImage, NativeText } from \"@marktiderman/genesis-ui-native/components\";\nimport { useThemeRoles } from \"@marktiderman/genesis-ui-native/hooks\";\nimport { formatDuration } from \"../core/media\";\nimport type { AttachmentInput, ChatAttachment } from \"../core/types\";\nimport { useChatNative } from \"./context\";\nimport { ChatVideoPlayer } from \"./video-player\";\nimport { VoiceNotePlayer } from \"./voice-player\";\n\n/** An attachment as the bubble draws it: from the server, or still on the phone. */\nexport interface BubbleAttachment {\n key: string;\n kind: string;\n /** What to show now: a signed URL, or the local preview. */\n uri: string | null;\n name: string | null;\n width: number | null;\n height: number | null;\n durationMs: number | null;\n waveform: number[] | null;\n thumbhash: string | null;\n /** A hosted video: who hosts it, its playback id once processed, and whether it is ready. */\n provider?: string | null;\n playbackId?: string | null;\n status?: \"pending\" | \"ready\" | \"failed\" | null;\n posterUri?: string | null;\n /** Still on its way from this phone. */\n uploading?: boolean;\n}\n\nexport function fromServer(a: ChatAttachment, urls: Record<string, string>): BubbleAttachment {\n return {\n key: a.id,\n kind: a.kind,\n uri: (a.path ? urls[a.path] : null) ?? a.url ?? null,\n name: a.name,\n width: a.width,\n height: a.height,\n durationMs: a.durationMs,\n waveform: a.waveform,\n thumbhash: a.thumbhash,\n provider: a.provider,\n playbackId: a.playbackId,\n status: a.status,\n posterUri: a.posterPath ? (urls[a.posterPath] ?? null) : null,\n };\n}\n\nexport function fromPending(\n clientId: string,\n index: number,\n file: { name: string; contentType: string; meta?: Partial<AttachmentInput> },\n preview: string | undefined,\n): BubbleAttachment {\n const kind = file.meta?.kind ?? (file.contentType.startsWith(\"image/\") ? \"image\" : file.contentType.startsWith(\"audio/\") ? \"voice\" : \"file\");\n return {\n key: `${clientId}:${index}`,\n kind,\n uri: preview ?? null,\n name: file.name,\n width: file.meta?.width ?? null,\n height: file.meta?.height ?? null,\n durationMs: file.meta?.durationMs ?? null,\n waveform: file.meta?.waveform ?? null,\n thumbhash: null,\n provider: file.meta?.provider ?? null,\n uploading: true,\n };\n}\n\n/** An attachment a pending message already carries (a hosted video, uploaded before it was queued). */\nexport function fromPendingInput(clientId: string, index: number, a: AttachmentInput): BubbleAttachment {\n return {\n key: `${clientId}:input:${index}`,\n kind: a.kind,\n uri: a.url ?? null,\n name: a.name ?? null,\n width: a.width ?? null,\n height: a.height ?? null,\n durationMs: a.durationMs ?? null,\n waveform: a.waveform ?? null,\n thumbhash: a.thumbhash ?? null,\n provider: a.provider ?? null,\n status: a.status ?? null,\n };\n}\n\n/** The paths a set of messages needs signed links for. */\nexport function attachmentPaths(attachments: readonly ChatAttachment[]): string[] {\n const out: string[] = [];\n for (const a of attachments) {\n if (a.path && a.provider === \"storage\") out.push(a.path);\n if (a.posterPath) out.push(a.posterPath);\n }\n return out;\n}\n\nexport interface AttachmentsProps {\n attachments: BubbleAttachment[];\n mine: boolean;\n onOpenImage?: (uri: string, alt: string) => void;\n testID: string;\n}\n\nexport function MessageAttachments({ attachments, mine, onOpenImage, testID }: AttachmentsProps) {\n const { copy, modules } = useChatNative();\n const colors = useThemeRoles();\n const { width: screen } = useWindowDimensions();\n const images = attachments.filter((a) => a.kind === \"image\");\n const others = attachments.filter((a) => a.kind !== \"image\");\n const max = Math.min(260, Math.round(screen * 0.66));\n return (\n <View style={{ gap: 6 }}>\n {images.length ? (\n <View style={{ flexDirection: \"row\", flexWrap: \"wrap\", gap: 4, maxWidth: max, justifyContent: mine ? \"flex-end\" : \"flex-start\" }}>\n {images.map((a, i) => {\n const single = images.length === 1;\n const ratio = a.width && a.height ? a.width / a.height : 1;\n const w = single ? max : Math.floor((max - 4) / 2);\n const h = single ? Math.round(Math.max(120, Math.min(max * 1.3, w / ratio))) : w;\n const alt = a.name ? `${copy.photo}, ${a.name}` : copy.photo;\n return (\n <Pressable\n key={a.key}\n testID={`${testID}-image-${i}`}\n accessibilityRole=\"imagebutton\"\n accessibilityLabel={alt}\n accessibilityHint={copy.openImage}\n disabled={!a.uri || !onOpenImage}\n onPress={() => a.uri && onOpenImage?.(a.uri, alt)}\n style={{ borderRadius: 14, overflow: \"hidden\" }}\n >\n {a.uri ? (\n <NativeImage src={a.uri} width={w} height={h} placeholder={a.thumbhash ? { thumbhash: a.thumbhash } : undefined} recyclingKey={a.key} />\n ) : (\n <View style={{ width: w, height: h, backgroundColor: colors.fill }} />\n )}\n </Pressable>\n );\n })}\n </View>\n ) : null}\n {others.map((a, i) =>\n a.kind === \"voice\" ? (\n <VoiceNotePlayer key={a.key} id={a.key} uri={a.uri} durationMs={a.durationMs} waveform={a.waveform} mine={mine} testID={`${testID}-voice-${i}`} />\n ) : a.kind === \"video\" && modules.video ? (\n <ChatVideoPlayer\n key={a.key}\n id={a.key}\n uri={a.uri}\n playbackId={a.playbackId}\n posterUri={a.posterUri}\n provider={a.provider}\n status={a.status}\n durationMs={a.durationMs}\n width={a.width}\n height={a.height}\n uploading={a.uploading}\n testID={`${testID}-video-${i}`}\n />\n ) : (\n <View\n key={a.key}\n testID={`${testID}-file-${i}`}\n accessible\n accessibilityLabel={`${a.kind === \"video\" ? copy.video : copy.file}, ${a.name ?? \"\"}${a.durationMs ? `, ${formatDuration(a.durationMs)}` : \"\"}`}\n style={{ flexDirection: \"row\", alignItems: \"center\", gap: 8, minHeight: 44 }}\n >\n <NativeIcon name={a.kind === \"video\" ? \"play\" : \"file\"} size={20} color={mine ? colors.surface : colors.secondaryLabel} />\n <NativeText numberOfLines={1} className={mine ? \"text-primary-foreground\" : undefined} style={{ flexShrink: 1, fontSize: 15 }}>\n {a.name ?? (a.kind === \"video\" ? copy.video : copy.file)}\n </NativeText>\n </View>\n ),\n )}\n </View>\n );\n}\n\n// ChatMediaViewer (one picture) is in photo-viewer.tsx, over the full-screen ChatPhotoViewer.\n","/**\n * @feat:chat\n * What moderation said about a message, in its bubble. A hidden message reaches only its sender\n * and the conversation's observers: the sender sees it dimmed with \"Hidden by moderation. Only\n * you can see it.\"; an observer sees a \"Hidden by moderation\" marker. A flagged message is seen\n * by everyone; observers see a quiet \"Flagged\" marker. The same rules as the web's bubble.\n */\nimport { View } from \"react-native\";\nimport { NativeIcon, NativeText } from \"@marktiderman/genesis-ui-native/components\";\nimport { useThemeRoles } from \"@marktiderman/genesis-ui-native/hooks\";\nimport type { ChatMessage } from \"../core/types\";\nimport { useChatNative } from \"./context\";\n\nexport type ModerationNote = \"hidden-mine\" | \"hidden\" | \"flagged\";\n\n/** The note a bubble shows, or null. Deleted messages carry none. */\nexport function moderationNote(message: Pick<ChatMessage, \"moderation\" | \"deletedAt\"> | null | undefined, opts: { mine: boolean; observer: boolean }): ModerationNote | null {\n if (!message || message.deletedAt) return null;\n if (message.moderation === \"hidden\") return opts.mine && !opts.observer ? \"hidden-mine\" : \"hidden\";\n if (message.moderation === \"flagged\" && opts.observer) return \"flagged\";\n return null;\n}\n\n/** The note's words (for the bubble's accessibility label too). */\nexport function moderationText(note: ModerationNote, copy: { moderationHidden: string; moderationHiddenMine: string; moderationFlagged: string }): string {\n return note === \"hidden-mine\" ? copy.moderationHiddenMine : note === \"hidden\" ? copy.moderationHidden : copy.moderationFlagged;\n}\n\nexport function ModerationMarker({ note, mine, testID }: { note: ModerationNote; mine: boolean; testID?: string }) {\n const { copy } = useChatNative();\n const colors = useThemeRoles();\n const color = note === \"flagged\" ? colors.secondaryLabel : colors.destructive;\n // On your own bubble (the tint), in the bubble's own text color, as its body is.\n return (\n <View testID={testID} style={{ flexDirection: \"row\", alignItems: \"center\", gap: 4 }}>\n {mine ? null : <NativeIcon name={note === \"flagged\" ? \"warning\" : \"lock\"} size={12} color={color} />}\n <NativeText preset=\"caption\" className={mine ? \"text-primary-foreground\" : undefined} style={mine ? { fontWeight: \"600\", flexShrink: 1 } : { color, fontWeight: \"600\", flexShrink: 1 }}>\n {moderationText(note, copy)}\n </NativeText>\n </View>\n );\n}\n","/**\n * @feat:chat\n * One message row: mine on the trailing side in the tint, theirs on surface;\n * in a group, the sender's name over the first of a run and their avatar\n * beside the last. A reply shows what it answers; reactions sit under the\n * bubble; a message still sending is faded, and one that failed says so with\n * Retry and Delete. Long press opens the actions; swipe right to reply. Both\n * are also VoiceOver / TalkBack actions, so nothing needs a gesture. The\n * bubble is one accessible element (its parts would otherwise be read one by\n * one), which hides the controls inside it, so it carries theirs as actions\n * too: play or pause a voice note and change its speed, open each photo.\n */\nimport { memo, useMemo, useRef } from \"react\";\nimport { Animated, PanResponder, Pressable, View } from \"react-native\";\nimport { NativeAvatar, NativeText } from \"@marktiderman/genesis-ui-native/components\";\nimport { useThemeRoles } from \"@marktiderman/genesis-ui-native/hooks\";\nimport { previewText, summarizeReactions } from \"../core/thread\";\nimport type { ChatLinkPreview, ChatMessage, PendingFile } from \"../core/types\";\nimport type { ChatAttachmentKind } from \"../react/index\";\nimport { cardAction, ChatAttachmentCard, splitCardAttachments, type OpenAttachment } from \"./attachment-cards\";\nimport { ChatLinkPreviewCard, linkHost, openChatLink } from \"./link-preview\";\nimport { cycleVideoRate, fullScreenVideo, toggleVideo, toggleVideoMute, usePlayingVideo } from \"./video-player\";\nimport { fill } from \"./copy\";\nimport { initials, useChatNative } from \"./context\";\nimport { fromPending, fromPendingInput, fromServer, MessageAttachments, type BubbleAttachment } from \"./media\";\nimport { ModerationMarker, moderationNote, moderationText } from \"./moderation\";\nimport { cycleVoiceNoteRate, toggleVoiceNote, usePlayingVoiceNote } from \"./voice-player\";\nimport type { ThreadRow } from \"./rows\";\n\ntype MessageRow = Extract<ThreadRow, { type: \"message\" }>;\n\nexport interface MessageBubbleProps {\n row: MessageRow;\n me: string;\n /** Signed links by storage path. */\n urls: Record<string, string>;\n /** The message this one replies to, when it is loaded. */\n repliedTo?: ChatMessage | null;\n /** Avatars sit in a column when the conversation is a group. */\n group: boolean;\n reducedMotion: boolean;\n onLongPress?: (message: ChatMessage) => void;\n onReply?: (message: ChatMessage) => void;\n onRetry?: (clientId: string) => void;\n onDiscard?: (clientId: string) => void;\n /** A failed message whose files didn't survive a relaunch: pick them again (`useConversation().reattach`). */\n onReattach?: (clientId: string, files: readonly PendingFile[]) => void;\n onToggleReaction?: (message: ChatMessage, emoji: string, on: boolean) => void;\n onOpenImage?: (uri: string, alt: string) => void;\n /** The swipe crossed the reply line (for a haptic). */\n onSwipeReply?: () => void;\n /** You observe this conversation: moderation's markers show (hidden, flagged). */\n observer?: boolean;\n /** Drawn highlighted for a moment (the message a search result opened). */\n highlighted?: boolean;\n /** The preview of a link in its text (`useLinkPreviews`, `previewToShow`). */\n linkPreview?: ChatLinkPreview | null;\n /** Show link previews' images (off by default; the thread screen passes `ChatProvider linkPreviewImages`). */\n linkPreviewImages?: boolean;\n /** The app's own attachment kinds, drawn as cards (`ChatProvider attachmentKinds`). */\n attachmentKinds?: Record<string, ChatAttachmentKind>;\n /** A card's button, when its kind gives no `onPress` of its own. */\n onOpenAttachment?: OpenAttachment;\n testID: string;\n}\n\nconst SWIPE_REPLY = 56;\nconst SWIPE_MAX = 80;\n\nexport function formatClock(iso: string): string {\n return new Date(iso).toLocaleTimeString(undefined, { hour: \"numeric\", minute: \"2-digit\" });\n}\n\n/** Mentions written `@[Name](user:<id>)` read as `@Name`. */\nexport function displayBody(body: string): string {\n return body.replace(/@\\[([^\\]]+)\\]\\(user:[0-9a-f-]{36}\\)/gi, \"@$1\");\n}\n\nfunction MessageBubbleImpl(props: MessageBubbleProps) {\n const { row, me, urls, repliedTo, group, reducedMotion, testID } = props;\n const { copy, person, modules } = useChatNative();\n const colors = useThemeRoles();\n const { item, mine } = row;\n const message = item.type === \"message\" ? item.message : null;\n const pending = item.type === \"pending\" ? item.pending : null;\n\n const body = message ? (message.deletedAt ? \"\" : message.body) : (pending?.input.body ?? \"\");\n const createdAt = message?.createdAt ?? pending!.createdAt;\n const failed = pending?.status === \"failed\";\n // Its files are gone (bytes not kept between launches): Retry can't send it, picking them again can.\n const lost = failed && (pending?.files ?? []).some((f) => f.lost);\n const sending = pending?.status === \"sending\";\n const sender = person(row.senderId);\n const senderName = mine ? copy.you : (sender?.name ?? \"\");\n\n const kinds = props.attachmentKinds;\n const { cards, rest: plain } = useMemo(\n () => splitCardAttachments(message && !message.deletedAt ? message.attachments : [], kinds),\n [message, kinds],\n );\n const attachments: BubbleAttachment[] = useMemo(() => {\n if (message) return message.deletedAt ? [] : plain.map((a) => fromServer(a, urls));\n // What it already carries (a hosted video) comes first, as the outbox sends it.\n return [\n ...(pending?.input.attachments ?? []).map((a, i) => fromPendingInput(pending!.clientId, i, a)),\n ...(pending?.files ?? []).map((f, i) => fromPending(pending!.clientId, i, f, pending!.previews?.[i])),\n ];\n }, [message, pending, urls, plain]);\n const preview = message && !message.deletedAt && message.moderation !== \"hidden\" ? (props.linkPreview ?? null) : null;\n\n // The controls the accessible bubble hides, as its own actions.\n const voices = attachments.filter((a) => a.kind === \"voice\" && a.uri && modules.audio);\n const photos = attachments.filter((a) => a.kind === \"image\" && a.uri && props.onOpenImage);\n const videos = attachments.filter((a) => a.kind === \"video\" && modules.video && (a.uri || a.playbackId));\n const playingVideo = usePlayingVideo(videos.map((a) => a.key));\n const cardActions = message ? cards.map((a) => cardAction(kinds?.[a.kind], a, message, props.onOpenAttachment)) : [];\n const playingVoice = usePlayingVoiceNote(voices.map((a) => a.key));\n\n // ---- Swipe to reply ----\n const x = useRef(new Animated.Value(0)).current;\n const latest = useRef(props);\n latest.current = props;\n const crossed = useRef(false);\n const responder = useMemo(\n () =>\n PanResponder.create({\n onMoveShouldSetPanResponder: (_e, g) => g.dx > 12 && Math.abs(g.dx) > Math.abs(g.dy) * 2,\n onPanResponderMove: (_e, g) => {\n const dx = Math.max(0, Math.min(SWIPE_MAX, g.dx));\n x.setValue(dx);\n const over = dx >= SWIPE_REPLY;\n if (over && !crossed.current) latest.current.onSwipeReply?.();\n crossed.current = over;\n },\n onPanResponderRelease: (_e, g) => {\n const m = latest.current.row.item.type === \"message\" ? latest.current.row.item.message : null;\n if (g.dx >= SWIPE_REPLY && m) latest.current.onReply?.(m);\n crossed.current = false;\n if (latest.current.reducedMotion) x.setValue(0);\n else Animated.spring(x, { toValue: 0, useNativeDriver: true, bounciness: 4 }).start();\n },\n onPanResponderTerminate: () => {\n crossed.current = false;\n x.setValue(0);\n },\n }),\n [x],\n );\n\n if (message?.kind === \"system\") {\n return (\n <View testID={testID} style={{ alignItems: \"center\", paddingVertical: 6, paddingHorizontal: 24 }}>\n <NativeText preset=\"caption\" style={{ color: colors.secondaryLabel, textAlign: \"center\" }}>\n {displayBody(message.body)}\n </NativeText>\n </View>\n );\n }\n\n const canSwipe = Boolean(message && !message.deletedAt && props.onReply);\n const reactions = message ? summarizeReactions(message, me) : [];\n const time = formatClock(createdAt);\n const moderation = moderationNote(message, { mine, observer: Boolean(props.observer) });\n const statusText = failed ? copy.notSent : sending ? copy.sending : null;\n const label = [\n senderName,\n message?.deletedAt ? copy.deleted : displayBody(body),\n attachments.map((a) => (a.kind === \"image\" ? copy.photo : a.kind === \"voice\" ? copy.voice : a.kind === \"video\" ? copy.video : copy.file)).join(\", \"),\n cards.map((a) => cardTitle(kinds?.[a.kind], a)).join(\", \"),\n preview ? fill(copy.linkPreview, { title: preview.title?.trim() || linkHost(preview.url), site: preview.siteName?.trim() || linkHost(preview.url) }) : null,\n time,\n message?.editedAt ? copy.edited : null,\n statusText,\n moderation ? moderationText(moderation, copy) : null,\n reactions.length ? fill(copy.reactions, { count: reactions.reduce((n, r) => n + r.count, 0) }) : null,\n ]\n .filter(Boolean)\n .join(\", \");\n\n const actions = [\n ...voices.flatMap((a, i) => [\n { name: `voice-${i}`, label: playingVoice === a.key ? copy.pauseVoice : copy.playVoice },\n { name: `voice-rate-${i}`, label: copy.changeSpeed },\n ]),\n ...photos.map((_, i) => ({ name: `photo-${i}`, label: photos.length > 1 ? fill(copy.openPhotoN, { n: i + 1 }) : copy.openImage })),\n ...videos.flatMap((a, i) => [\n { name: `video-${i}`, label: playingVideo === a.key ? copy.pauseVideo : copy.playVideo },\n // Mute and speed reach the player that is playing.\n ...(playingVideo === a.key ? [{ name: `video-mute-${i}`, label: copy.mute }, { name: `video-rate-${i}`, label: copy.changeSpeed }] : []),\n { name: `video-full-${i}`, label: copy.fullScreen },\n ]),\n ...cardActions.flatMap((c, i) => (c ? [{ name: `card-${i}`, label: c.label }] : [])),\n ...(preview ? [{ name: \"open-link\", label: copy.openLinkAction }] : []),\n ...(message && props.onReply && !message.deletedAt ? [{ name: \"reply\", label: copy.reply }] : []),\n ...(message && props.onLongPress && !message.deletedAt ? [{ name: \"actions\", label: copy.messageActions }] : []),\n ...(failed && !lost && props.onRetry ? [{ name: \"retry\", label: copy.retry }] : []),\n ...(lost && props.onReattach ? [{ name: \"reattach\", label: copy.attachAgain }] : []),\n ...(failed && props.onDiscard ? [{ name: \"discard\", label: copy.discard }] : []),\n ];\n const onAction = (name: string) => {\n const media = /^(voice-rate|voice|photo|video-full|video-mute|video-rate|video|card)-(\\d+)$/.exec(name);\n if (media) {\n const i = Number(media[2]);\n if (media[1] === \"card\") cardActions[i]?.run();\n else if (media[1] === \"video-mute\" && videos[i]) toggleVideoMute(videos[i].key);\n else if (media[1] === \"video-rate\" && videos[i]) cycleVideoRate(videos[i].key);\n else if (media[1] === \"video\" && videos[i]) toggleVideo(videos[i].key);\n else if (media[1] === \"video-full\" && videos[i]) fullScreenVideo(videos[i].key);\n else if (media[1] === \"voice\" && voices[i]) toggleVoiceNote(voices[i].key);\n else if (media[1] === \"voice-rate\" && voices[i]) cycleVoiceNoteRate(voices[i].key);\n else if (media[1] === \"photo\" && photos[i]?.uri) props.onOpenImage?.(photos[i].uri, photos[i].name ? `${copy.photo}, ${photos[i].name}` : copy.photo);\n return;\n }\n if (name === \"open-link\" && preview) void openChatLink(preview.url, modules.webBrowser);\n else if (name === \"reply\" && message) props.onReply?.(message);\n else if (name === \"actions\" && message) props.onLongPress?.(message);\n else if (name === \"retry\" && pending) props.onRetry?.(pending.clientId);\n else if (name === \"reattach\" && pending) props.onReattach?.(pending.clientId, pending.files ?? []);\n else if (name === \"discard\" && pending) props.onDiscard?.(pending.clientId);\n };\n\n const quote = message?.replyToId ?? pending?.input.replyToId ?? null;\n const quoted = quote && repliedTo ? repliedTo : null;\n const bubbleColor = mine ? colors.tint : colors.surface;\n const fg = mine ? \"text-primary-foreground\" : undefined;\n const textStyle = mine ? { fontSize: 17, lineHeight: 22 } : { fontSize: 17, lineHeight: 22, color: colors.label };\n\n return (\n <View testID={testID} style={{ paddingHorizontal: 8, paddingTop: row.groupStart ? 8 : 2, backgroundColor: props.highlighted ? colors.fill : undefined }}>\n {row.showName && sender?.name ? (\n <NativeText preset=\"caption\" style={{ marginLeft: group ? 48 : 12, marginBottom: 2, color: colors.secondaryLabel }}>\n {sender.name}\n </NativeText>\n ) : null}\n <View style={{ flexDirection: \"row\", alignItems: \"flex-end\", justifyContent: mine ? \"flex-end\" : \"flex-start\" }}>\n {group && !mine ? (\n <View style={{ width: 40, alignItems: \"flex-start\" }}>\n {row.showAvatar ? <NativeAvatar size={32} src={sender?.avatarUrl ?? null} fallback={initials(sender?.name)} alt={sender?.name} recyclingKey={row.senderId ?? undefined} /> : null}\n </View>\n ) : null}\n <Animated.View\n style={{ maxWidth: \"80%\", transform: [{ translateX: x }] }}\n {...(canSwipe ? responder.panHandlers : {})}\n >\n <Pressable\n testID={`${testID}-bubble`}\n accessible\n accessibilityLabel={label}\n accessibilityHint={failed ? copy.retry : undefined}\n accessibilityActions={actions}\n onAccessibilityAction={(e) => onAction(e.nativeEvent.actionName)}\n onLongPress={message && !message.deletedAt ? () => props.onLongPress?.(message) : undefined}\n delayLongPress={350}\n style={{\n paddingHorizontal: attachments.length && !body ? 4 : 12,\n paddingVertical: attachments.length && !body ? 4 : 8,\n borderRadius: 18,\n backgroundColor: bubbleColor,\n opacity: sending ? 0.6 : moderation === \"hidden-mine\" ? 0.7 : 1,\n gap: 4,\n }}\n >\n {quote ? (\n <View\n testID={`${testID}-quote`}\n style={{ borderLeftWidth: 3, borderLeftColor: mine ? colors.surface : colors.tint, paddingLeft: 8, paddingVertical: 2, opacity: 0.85 }}\n >\n <NativeText preset=\"caption\" className={fg} style={mine ? { fontWeight: \"600\" } : { fontWeight: \"600\", color: colors.secondaryLabel }}>\n {quoted ? (quoted.senderId === me ? copy.you : (person(quoted.senderId)?.name ?? \"\")) : \"\"}\n </NativeText>\n <NativeText preset=\"caption\" numberOfLines={2} className={fg} style={mine ? undefined : { color: colors.secondaryLabel }}>\n {quoted ? previewText(quoted.body, quoted.attachments[0]?.kind, Boolean(quoted.deletedAt)) : \"…\"}\n </NativeText>\n </View>\n ) : null}\n {attachments.length ? <MessageAttachments attachments={attachments} mine={mine} onOpenImage={props.onOpenImage} testID={testID} /> : null}\n {message && cards.length\n ? cards.map((a, i) => (\n <ChatAttachmentCard key={a.id} attachment={a} message={message} kind={kinds![a.kind]!} mine={mine} onOpenAttachment={props.onOpenAttachment} testID={`${testID}-card-${i}`} />\n ))\n : null}\n {message?.deletedAt ? (\n <NativeText className={fg} style={[textStyle, { fontStyle: \"italic\", opacity: 0.7 }]}>\n {copy.deleted}\n </NativeText>\n ) : body ? (\n <NativeText className={fg} style={[textStyle, attachments.length ? { paddingHorizontal: 8, paddingBottom: 4 } : null]}>\n {displayBody(body)}\n </NativeText>\n ) : null}\n {moderation ? <ModerationMarker note={moderation} mine={mine} testID={`${testID}-moderation`} /> : null}\n {preview ? <ChatLinkPreviewCard preview={preview} mine={mine} images={props.linkPreviewImages} testID={`${testID}-preview`} /> : null}\n </Pressable>\n </Animated.View>\n </View>\n {reactions.length ? (\n <View style={{ flexDirection: \"row\", flexWrap: \"wrap\", gap: 4, marginTop: 2, justifyContent: mine ? \"flex-end\" : \"flex-start\", marginLeft: group && !mine ? 40 : 0 }}>\n {reactions.map((r) => (\n <Pressable\n key={r.emoji}\n testID={`${testID}-reaction-${r.emoji}`}\n accessibilityRole=\"button\"\n accessibilityState={{ selected: r.mine }}\n accessibilityLabel={`${r.emoji} ${r.count}`}\n disabled={!message || !props.onToggleReaction}\n onPress={() => message && props.onToggleReaction?.(message, r.emoji, !r.mine)}\n hitSlop={6}\n style={{\n flexDirection: \"row\",\n alignItems: \"center\",\n gap: 4,\n minHeight: 32,\n paddingHorizontal: 10,\n borderRadius: 16,\n backgroundColor: r.mine ? colors.fill : colors.surface,\n borderWidth: r.mine ? 1 : 0,\n borderColor: colors.tint,\n }}\n >\n <NativeText style={{ fontSize: 15 }}>{r.emoji}</NativeText>\n <NativeText preset=\"caption\" style={{ color: colors.secondaryLabel }}>\n {String(r.count)}\n </NativeText>\n </Pressable>\n ))}\n </View>\n ) : null}\n {row.groupEnd || failed ? (\n <View style={{ flexDirection: \"row\", justifyContent: mine ? \"flex-end\" : \"flex-start\", alignItems: \"center\", gap: 4, marginTop: 2, marginLeft: group && !mine ? 52 : 12, marginRight: 12 }}>\n {failed ? (\n <>\n <NativeText testID={`${testID}-failed`} preset=\"caption\" style={{ color: colors.destructive }}>\n {pending?.error ?? copy.notSent}\n </NativeText>\n {lost ? (\n props.onReattach ? (\n <SmallAction testID={`${testID}-reattach`} label={copy.attachAgain} onPress={() => props.onReattach?.(pending!.clientId, pending!.files ?? [])} color={colors.tint} />\n ) : null\n ) : (\n <SmallAction testID={`${testID}-retry`} label={copy.retry} onPress={() => props.onRetry?.(pending!.clientId)} color={colors.tint} />\n )}\n <SmallAction testID={`${testID}-discard`} label={copy.discard} onPress={() => props.onDiscard?.(pending!.clientId)} color={colors.destructive} />\n </>\n ) : (\n <NativeText preset=\"caption\" style={{ color: colors.tertiaryLabel }}>\n {[time, message?.editedAt ? copy.edited : null, sending ? copy.sending : null].filter(Boolean).join(\" · \")}\n </NativeText>\n )}\n </View>\n ) : null}\n </View>\n );\n}\n\nfunction SmallAction({ label, onPress, color, testID }: { label: string; onPress: () => void; color: unknown; testID: string }) {\n return (\n <Pressable testID={testID} accessibilityRole=\"button\" accessibilityLabel={label} onPress={onPress} style={{ minHeight: 44, minWidth: 44, paddingHorizontal: 8, alignItems: \"center\", justifyContent: \"center\" }}>\n <NativeText preset=\"label\" style={{ color: color as string }}>\n {label}\n </NativeText>\n </Pressable>\n );\n}\n\n/** A card's title for the bubble's label (an app kind that throws reads as its name). */\nfunction cardTitle(kind: ChatAttachmentKind | undefined, a: ChatMessage[\"attachments\"][number]): string {\n try {\n return kind?.title(a) || a.name || a.kind;\n } catch {\n return a.name || a.kind;\n }\n}\n\nexport const MessageBubble = memo(MessageBubbleImpl);\n","/**\n * @feat:chat\n * Your conversations on genesis-ui-native's InboxPage: each with its avatar,\n * unread count, last message and time; pull to refresh; an empty state that\n * offers to start a conversation; Mark read, Pin and Archive on swipe, long\n * press and as accessibility actions. Under the navigator's large title\n * (`getInboxPageStackOptions`).\n */\nimport { useCallback, useMemo, useState } from \"react\";\nimport { NativeAvatar } from \"@marktiderman/genesis-ui-native/components\";\nimport { InboxPage, type InboxItem, type InboxPageProps } from \"@marktiderman/genesis-ui-native/layouts\";\nimport { previewText } from \"../core/thread\";\nimport type { ChatInboxItem } from \"../core/types\";\nimport { chatKeys, useChat, useInbox, usePeople } from \"../react/index\";\nimport { useQueryClient } from \"@tanstack/react-query\";\nimport type { ChatNativeCopy } from \"./copy\";\nimport { initials, useChatNative, type ChatPerson } from \"./context\";\nimport { displayBody } from \"./message-bubble\";\n\nexport interface ChatInboxScreenProps {\n /** Opens a conversation (`router.push(chatPath(id))`). */\n onOpen: (conversationId: string) => void;\n /** Starts one (opens your people picker, or `ChatStartSheet`). Shows the empty state's button. */\n onStart?: () => void;\n /** One kind only. */\n kind?: string;\n /** Only these kinds. */\n kinds?: string[];\n /** Every kind but these (`[\"support\"]` keeps support tickets out of a messages inbox). */\n excludeKinds?: string[];\n archived?: boolean;\n /** Passed to InboxPage (a header, a section title, slots). */\n pageProps?: Partial<Omit<InboxPageProps, \"items\">>;\n testID?: string;\n}\n\n/** An inbox row from a conversation. Exported for apps that build their own list. */\nexport function inboxRow(\n item: ChatInboxItem,\n ctx: { me: string; copy: ChatNativeCopy; person: (id: string | null) => ChatPerson | undefined },\n): Omit<InboxItem, \"onPress\" | \"swipeActions\"> {\n const other = item.otherUserId ? ctx.person(item.otherUserId) : undefined;\n const title = item.title ?? other?.name ?? ctx.copy.untitled;\n const last = item.lastMessage;\n const text = last ? previewText(displayBody(last.body), last.attachment, last.deleted) : \"\";\n const preview = last && text && last.senderId === ctx.me && last.kind !== \"system\" ? `${ctx.copy.youPrefix}${text}` : text;\n return {\n id: item.conversationId,\n title,\n preview: preview || undefined,\n timestamp: item.lastMessageAt ?? undefined,\n unread: item.unread > 0,\n unreadCount: item.unread,\n meta: item.mentioned ? ctx.copy.mentionedYou : undefined,\n avatar: <NativeAvatar size={40} src={other?.avatarUrl ?? null} fallback={initials(title)} alt={title} recyclingKey={item.conversationId} />,\n };\n}\n\nexport function ChatInboxScreen({ onOpen, onStart, kind, kinds, excludeKinds, archived, pageProps, testID = \"chat-inbox\" }: ChatInboxScreenProps) {\n const { client, userId } = useChat();\n const queryClient = useQueryClient();\n const { copy, person: known } = useChatNative();\n const inbox = useInbox({ kind, kinds, excludeKinds, archived });\n // The other person in each direct conversation, fetched in one batch (ChatProvider loadPeople).\n const others = useMemo(() => inbox.items.map((i) => i.otherUserId), [inbox.items]);\n const people = usePeople(others);\n const person = useCallback((id: string | null | undefined) => known(id) ?? (id ? people[id] : undefined), [known, people]);\n const [refreshing, setRefreshing] = useState(false);\n\n const refresh = useCallback(async () => {\n setRefreshing(true);\n try {\n await inbox.refetch();\n } finally {\n setRefreshing(false);\n }\n }, [inbox]);\n\n const settle = useCallback(() => {\n void queryClient.invalidateQueries({ queryKey: [\"genesis-chat\", \"inbox\"] });\n void queryClient.invalidateQueries({ queryKey: chatKeys.unread() });\n }, [queryClient]);\n\n const items: InboxItem[] = inbox.items.map((item) => ({\n ...inboxRow(item, { me: userId, copy, person }),\n onPress: () => onOpen(item.conversationId),\n swipeActions: [\n ...(item.unread > 0 ? [{ id: \"read\", label: copy.markRead, onPress: () => void client.markRead(item.conversationId).then(settle, settle) }] : []),\n {\n id: \"pin\",\n label: item.pinned ? copy.unpin : copy.pin,\n onPress: () => void client.setMySettings(item.conversationId, { pinned: !item.pinned }).then(settle, settle),\n },\n ...(item.archived\n ? []\n : [{ id: \"archive\", label: copy.archive, onPress: () => void client.setMySettings(item.conversationId, { archived: true }).then(settle, settle) }]),\n ],\n }));\n\n return (\n <InboxPage\n testID={testID}\n items={items}\n loading={inbox.isLoading}\n error={Boolean(inbox.error)}\n errorTitle={copy.inboxErrorTitle}\n refreshing={refreshing}\n onRefresh={refresh}\n emptyTitle={copy.inboxEmptyTitle}\n emptyBody={copy.inboxEmptyBody}\n emptyActionLabel={onStart ? copy.startConversation : undefined}\n onEmptyAction={onStart}\n {...pageProps}\n />\n );\n}\n","/**\n * @feat:chat\n * The native modules chat can use, as the shapes it needs. The app passes the\n * real ones (each an optional peer); chat never imports them, so it builds and\n * runs without any of them, and the tests pass fakes:\n *\n * import * as Audio from \"expo-audio\"; // voice notes\n * import * as ImagePicker from \"expo-image-picker\"; // photos and videos\n * import * as Haptics from \"expo-haptics\"; // send and record\n * import * as Clipboard from \"expo-clipboard\"; // copy, paste a picture\n * import { KeyboardAvoidingView } from \"react-native-keyboard-controller\";\n * import AsyncStorage from \"@react-native-async-storage/async-storage\"; // drafts\n * import * as Sharing from \"expo-sharing\"; // share a photo\n * import * as MediaLibrary from \"expo-media-library\"; // save a photo\n * import NetInfo from \"@react-native-community/netinfo\"; // retry when back online\n * import * as Camera from \"expo-camera\"; // video messages\n * import * as Video from \"expo-video\"; // video playback\n * import * as WebBrowser from \"expo-web-browser\"; // link previews\n *\n * FlashList and expo-image come from GenesisNativeApp's `modules` (genesis-ui-native's\n * GenesisModulesProvider), the same objects every Genesis list and image uses.\n * The shapes follow the SDK 58 packages' own type declarations.\n */\nimport type { ComponentType, ReactNode } from \"react\";\n\n/** `RecorderState` from expo-audio (`recorder.getStatus()`). */\nexport interface RecorderStateLike {\n isRecording: boolean;\n durationMillis: number;\n /** dB, about -160…0, when `isMeteringEnabled`. */\n metering?: number;\n url: string | null;\n}\n\n/** `AudioRecorder` from expo-audio. */\nexport interface AudioRecorderLike {\n prepareToRecordAsync(options?: Record<string, unknown>): Promise<void>;\n record(): void;\n stop(): Promise<void>;\n getStatus(): RecorderStateLike;\n uri: string | null;\n}\n\n/** `AudioStatus` from expo-audio (`useAudioPlayerStatus`). Seconds. */\nexport interface AudioStatusLike {\n currentTime: number;\n duration: number;\n playing: boolean;\n didJustFinish: boolean;\n isLoaded: boolean;\n playbackRate: number;\n}\n\n/** `AudioPlayer` from expo-audio. */\nexport interface AudioPlayerLike {\n play(): void;\n pause(): void;\n seekTo(seconds: number): Promise<void>;\n setPlaybackRate(rate: number): void;\n}\n\n/** `import * as Audio from \"expo-audio\"` (SDK 58). */\nexport interface ExpoAudioLike {\n useAudioRecorder(options: Record<string, unknown>): AudioRecorderLike;\n useAudioPlayer(source: { uri: string } | null, options?: { updateInterval?: number }): AudioPlayerLike;\n useAudioPlayerStatus(player: AudioPlayerLike): AudioStatusLike;\n RecordingPresets: { HIGH_QUALITY: Record<string, unknown> };\n requestRecordingPermissionsAsync(): Promise<{ granted: boolean; canAskAgain?: boolean }>;\n setAudioModeAsync(mode: { allowsRecording?: boolean; playsInSilentMode?: boolean }): Promise<void>;\n}\n\n/** One picked file (`ImagePickerAsset`). */\nexport interface PickedAssetLike {\n uri: string;\n width?: number;\n height?: number;\n fileName?: string | null;\n fileSize?: number;\n mimeType?: string;\n /** Milliseconds, for a video. */\n duration?: number | null;\n type?: string | null;\n}\n\nexport interface PickerResultLike {\n canceled: boolean;\n assets: PickedAssetLike[] | null;\n}\n\n/** `import * as ImagePicker from \"expo-image-picker\"`. */\nexport interface ImagePickerLike {\n launchImageLibraryAsync(options?: Record<string, unknown>): Promise<PickerResultLike>;\n launchCameraAsync?(options?: Record<string, unknown>): Promise<PickerResultLike>;\n requestCameraPermissionsAsync?(): Promise<{ granted: boolean }>;\n}\n\n/** `import * as Haptics from \"expo-haptics\"`. */\nexport interface HapticsLike {\n impactAsync(style?: never): Promise<void>;\n selectionAsync(): Promise<void>;\n notificationAsync(type?: never): Promise<void>;\n ImpactFeedbackStyle: { Light: unknown; Medium: unknown };\n NotificationFeedbackType: { Success: unknown; Warning: unknown; Error: unknown };\n}\n\n/** `import * as Clipboard from \"expo-clipboard\"`. */\nexport interface ClipboardLike {\n setStringAsync(text: string): Promise<boolean>;\n hasImageAsync?(): Promise<boolean>;\n /** `data` is a data URI (`data:image/png;base64,…`). */\n getImageAsync?(options: { format: \"png\" | \"jpeg\" }): Promise<{ data: string; size: { width: number; height: number } } | null>;\n}\n\n/** react-native-keyboard-controller's `KeyboardAvoidingView` (needs its `KeyboardProvider`, which GenesisNativeApp mounts). */\nexport type KeyboardAvoidingLike = ComponentType<{\n behavior?: \"height\" | \"padding\" | \"position\" | \"translate-with-padding\";\n keyboardVerticalOffset?: number;\n style?: unknown;\n children?: ReactNode;\n testID?: string;\n}>;\n\n/** Where drafts wait: AsyncStorage, or MMKV's async adapter. */\nexport interface DraftStorageLike {\n getItem(key: string): Promise<string | null>;\n setItem(key: string, value: string): Promise<void>;\n removeItem(key: string): Promise<void>;\n /** For `clearDrafts` on sign-out. */\n getAllKeys?(): Promise<readonly string[]>;\n multiRemove?(keys: readonly string[]): Promise<void>;\n}\n\n/** `import * as Sharing from \"expo-sharing\"`: the system share sheet for a file on the phone. */\nexport interface SharingLike {\n isAvailableAsync(): Promise<boolean>;\n shareAsync(url: string, options?: { mimeType?: string; UTI?: string; dialogTitle?: string }): Promise<void>;\n}\n\n/** `import * as MediaLibrary from \"expo-media-library\"`: save to Photos (asks for add-only access). */\nexport interface MediaLibraryLike {\n requestPermissionsAsync(writeOnly?: boolean): Promise<{ granted: boolean }>;\n saveToLibraryAsync(localUri: string): Promise<void>;\n}\n\n/** `NetInfo` from @react-native-community/netinfo: tells chat when the connection comes back. */\nexport interface NetInfoLike {\n addEventListener(listener: (state: { isConnected: boolean | null; isInternetReachable?: boolean | null }) => void): () => void;\n}\n\n/** A permission answer from expo-camera (`PermissionResponse`). */\nexport interface PermissionLike {\n granted: boolean;\n canAskAgain?: boolean;\n}\n\n/** The `ref` of expo-camera's `CameraView`. */\nexport interface CameraViewHandleLike {\n /** Resolves with the file when `stopRecording` is called, the limit is reached or the preview stops. */\n recordAsync(options?: { maxDuration?: number; maxFileSize?: number; codec?: string }): Promise<{ uri: string } | undefined>;\n stopRecording(): void;\n}\n\n/** `import * as Camera from \"expo-camera\"` (SDK 58): `CameraView` and the permission requests on `Camera`. */\nexport interface ExpoCameraLike {\n CameraView: ComponentType<{\n ref?: unknown;\n style?: unknown;\n facing?: \"front\" | \"back\";\n mode?: \"picture\" | \"video\";\n mirror?: boolean;\n mute?: boolean;\n videoQuality?: \"2160p\" | \"1080p\" | \"720p\" | \"480p\" | \"4:3\";\n onCameraReady?: () => void;\n onMountError?: (event: { message: string }) => void;\n testID?: string;\n }>;\n Camera: {\n requestCameraPermissionsAsync(): Promise<PermissionLike>;\n requestMicrophonePermissionsAsync(): Promise<PermissionLike>;\n };\n}\n\n/** `VideoPlayer` from expo-video. */\nexport interface VideoPlayerLike {\n play(): void;\n pause(): void;\n muted: boolean;\n playing: boolean;\n playbackRate: number;\n currentTime: number;\n addListener(event: \"playingChange\" | \"statusChange\" | \"playToEnd\", listener: (payload: never) => void): { remove(): void };\n}\n\n/** `import * as Video from \"expo-video\"` (SDK 58). */\nexport interface ExpoVideoLike {\n useVideoPlayer(source: { uri: string; contentType?: \"auto\" | \"progressive\" | \"hls\" } | null, setup?: (player: VideoPlayerLike) => void): VideoPlayerLike;\n VideoView: ComponentType<{\n ref?: unknown;\n player: VideoPlayerLike;\n style?: unknown;\n contentFit?: \"contain\" | \"cover\" | \"fill\";\n nativeControls?: boolean;\n allowsPictureInPicture?: boolean;\n testID?: string;\n }>;\n}\n\n/** The `ref` of expo-video's `VideoView`. */\nexport interface VideoViewHandleLike {\n enterFullscreen(): Promise<void>;\n}\n\n/** `import * as WebBrowser from \"expo-web-browser\"`: links open in an in-app browser. */\nexport interface WebBrowserLike {\n openBrowserAsync(url: string, options?: Record<string, unknown>): Promise<unknown>;\n}\n\n/** An open file read a chunk at a time (expo-file-system's `new File(uri).open()`), as `createTusUpload` takes. */\nexport interface ChunkFileLike {\n size: number;\n read(offset: number, length: number): Promise<ArrayBuffer | Uint8Array>;\n close?(): void;\n}\n\n/** Each optional: without one its feature is hidden (no mic without audio, no attach without a picker). */\nexport interface ChatNativeModules {\n audio?: ExpoAudioLike;\n imagePicker?: ImagePickerLike;\n haptics?: HapticsLike;\n clipboard?: ClipboardLike;\n keyboardAvoidingView?: KeyboardAvoidingLike;\n drafts?: DraftStorageLike;\n /** Share in the photo viewer (with `downloadFile` for photos not on the phone). */\n sharing?: SharingLike;\n /** Save in the photo viewer (with `downloadFile`). */\n mediaLibrary?: MediaLibraryLike;\n /**\n * Copies a photo from its signed link to the phone and returns the file:// URI, for sharing\n * and saving (expo-file-system: `(await File.downloadFileAsync(url, Paths.cache, { idempotent: true })).uri`).\n */\n downloadFile?: (url: string) => Promise<string>;\n /** Unsent messages are retried when the connection comes back (`ChatAutoRetry`). */\n netInfo?: NetInfoLike;\n /** Video messages recorded in the thread. Without it there is no video button. */\n camera?: ExpoCameraLike;\n /** Video playback (HLS and files) in the bubble. Without it a video shows as a row with its name. */\n video?: ExpoVideoLike;\n /** Where links from previews open; without it, the system browser (`Linking`). */\n webBrowser?: WebBrowserLike;\n /** Reads a recording a chunk at a time for a hosted upload; without it the file is read whole. */\n openFile?: (uri: string) => Promise<ChunkFileLike> | ChunkFileLike;\n}\n\nexport type HapticEvent = \"send\" | \"record-start\" | \"record-lock\" | \"record-cancel\" | \"select\" | \"error\";\n\n/** Plays a haptic when the app gave expo-haptics; never throws. */\nexport function haptic(haptics: HapticsLike | undefined, event: HapticEvent): void {\n if (!haptics) return;\n try {\n const style = (s: unknown) => s as never;\n const p =\n event === \"send\" || event === \"record-lock\"\n ? haptics.impactAsync(style(haptics.ImpactFeedbackStyle.Light))\n : event === \"record-start\"\n ? haptics.impactAsync(style(haptics.ImpactFeedbackStyle.Medium))\n : event === \"select\"\n ? haptics.selectionAsync()\n : haptics.notificationAsync(\n style(event === \"error\" ? haptics.NotificationFeedbackType.Error : haptics.NotificationFeedbackType.Warning),\n );\n void p?.catch?.(() => undefined);\n } catch {\n // A haptic is never worth an error.\n }\n}\n","/**\n * @feat:chat\n * The video recorder's rules, without React or the camera, so they are tested\n * directly. One button does both gestures: a tap starts a recording that a\n * second tap stops (what VoiceOver and TalkBack do too), and a hold records\n * until the finger lifts. Stopping sends; Cancel throws the take away. The\n * camera flips only between takes (expo-camera stops a recording that flips).\n * A take the camera doesn't hand over is only that take: the camera stays\n * ready. A camera that fails to start offers Try again.\n */\n\nexport type VideoRecorderPhase = \"asking\" | \"denied\" | \"starting\" | \"ready\" | \"recording\" | \"stopping\" | \"failed\";\n\nexport interface VideoRecorderState {\n phase: VideoRecorderPhase;\n facing: \"front\" | \"back\";\n /** When recording began (ms, the clock the events carry). */\n startedAt: number;\n elapsedMs: number;\n /** \"hold\": a finger is down and lifting it stops; \"tap\": recording hands-free until the next tap. */\n gesture: \"hold\" | \"tap\" | \"stop-on-release\" | null;\n /** The take is to be thrown away when the camera hands it over. */\n discard: boolean;\n notice: \"too-short\" | \"take-failed\" | null;\n /** Bumped by Try again after the camera failed: the camera view starts over. */\n cameraKey: number;\n}\n\nexport type VideoRecorderEvent =\n | { type: \"permissions\"; granted: boolean }\n | { type: \"camera-ready\" }\n | { type: \"camera-failed\" }\n | { type: \"press\"; at: number }\n | { type: \"release\"; at: number }\n | { type: \"tick\"; at: number }\n | { type: \"recorded\"; at: number; uri: string | null }\n | { type: \"flip\" }\n | { type: \"retry\" }\n | { type: \"cancel\" };\n\nexport type VideoRecorderEffect =\n | { type: \"start\" }\n | { type: \"stop\" }\n | { type: \"send\"; uri: string; durationMs: number }\n | { type: \"close\" }\n | { type: \"haptic\"; event: \"record-start\" | \"send\" | \"record-cancel\" | \"error\" };\n\nexport interface VideoRecorderConfig {\n limitMs: number;\n /** A press held this long is a hold; shorter is a tap. */\n holdMs?: number;\n /** Shorter takes aren't sent. */\n minMs?: number;\n}\n\nexport const VIDEO_HOLD_MS = 350;\nexport const VIDEO_MIN_MS = 1000;\n\nexport const initialVideoRecorder = (facing: \"front\" | \"back\" = \"front\"): VideoRecorderState => ({\n phase: \"asking\",\n facing,\n startedAt: 0,\n elapsedMs: 0,\n gesture: null,\n discard: false,\n notice: null,\n cameraKey: 0,\n});\n\ntype Step = { state: VideoRecorderState; effects: VideoRecorderEffect[] };\n\nexport function videoRecorderStep(state: VideoRecorderState, event: VideoRecorderEvent, config: VideoRecorderConfig): Step {\n const holdMs = config.holdMs ?? VIDEO_HOLD_MS;\n const minMs = config.minMs ?? VIDEO_MIN_MS;\n const same = { state, effects: [] as VideoRecorderEffect[] };\n const stop = (s: VideoRecorderState): Step => ({ state: { ...s, phase: \"stopping\", gesture: null }, effects: [{ type: \"stop\" }] });\n\n switch (event.type) {\n case \"permissions\":\n if (state.phase !== \"asking\") return same;\n return { state: { ...state, phase: event.granted ? \"starting\" : \"denied\" }, effects: [] };\n case \"camera-ready\":\n return state.phase === \"starting\" ? { state: { ...state, phase: \"ready\" }, effects: [] } : same;\n case \"camera-failed\":\n return state.phase === \"starting\" || state.phase === \"ready\" ? { state: { ...state, phase: \"failed\" }, effects: [{ type: \"haptic\", event: \"error\" }] } : same;\n case \"press\":\n if (state.phase === \"ready\") {\n return {\n state: { ...state, phase: \"recording\", startedAt: event.at, elapsedMs: 0, gesture: \"hold\", discard: false, notice: null },\n effects: [{ type: \"start\" }, { type: \"haptic\", event: \"record-start\" }],\n };\n }\n if (state.phase === \"recording\" && state.gesture === \"tap\") return { state: { ...state, gesture: \"stop-on-release\" }, effects: [] };\n return same;\n case \"release\":\n if (state.phase !== \"recording\") return same;\n if (state.gesture === \"hold\") return event.at - state.startedAt >= holdMs ? stop(state) : { state: { ...state, gesture: \"tap\" }, effects: [] };\n if (state.gesture === \"stop-on-release\") return stop(state);\n return same;\n case \"tick\":\n if (state.phase !== \"recording\") return same;\n {\n const elapsedMs = Math.max(0, event.at - state.startedAt);\n // The camera stops at the limit too (maxDuration); this keeps the button in step.\n if (elapsedMs >= config.limitMs) return stop({ ...state, elapsedMs: config.limitMs });\n return { state: { ...state, elapsedMs }, effects: [] };\n }\n case \"recorded\": {\n if (state.phase !== \"recording\" && state.phase !== \"stopping\") return same;\n const durationMs = Math.min(config.limitMs, Math.max(0, event.at - state.startedAt));\n const base: VideoRecorderState = { ...state, phase: \"ready\", gesture: null, elapsedMs: 0, discard: false };\n if (state.discard) return { state: base, effects: [{ type: \"close\" }] };\n // Too short first: a take stopped straight after it started often leaves no file at all.\n if (durationMs < minMs) return { state: { ...base, notice: \"too-short\" }, effects: [{ type: \"haptic\", event: \"record-cancel\" }] };\n // The camera is still there; only this take is lost.\n if (!event.uri) return { state: { ...base, notice: \"take-failed\" }, effects: [{ type: \"haptic\", event: \"error\" }] };\n return { state: base, effects: [{ type: \"send\", uri: event.uri, durationMs }, { type: \"haptic\", event: \"send\" }, { type: \"close\" }] };\n }\n case \"flip\":\n if (state.phase === \"recording\" || state.phase === \"stopping\") return same;\n // The preview restarts on the other camera: wait for it (the screen also gives it a moment).\n return { state: { ...state, facing: state.facing === \"front\" ? \"back\" : \"front\", phase: state.phase === \"ready\" ? \"starting\" : state.phase, notice: null }, effects: [] };\n case \"retry\":\n return state.phase === \"failed\" ? { state: { ...state, phase: \"starting\", cameraKey: state.cameraKey + 1, notice: null }, effects: [] } : same;\n case \"cancel\":\n if (state.phase === \"recording\") {\n return { state: { ...state, phase: \"stopping\", gesture: null, discard: true }, effects: [{ type: \"stop\" }, { type: \"haptic\", event: \"record-cancel\" }] };\n }\n if (state.phase === \"stopping\") return { state: { ...state, discard: true }, effects: [] };\n return { state, effects: [{ type: \"close\" }] };\n }\n}\n\n/** The kind of file a recording is, from its URI: .mov on iOS, .mp4 on Android. */\nexport function recordingType(uri: string): { contentType: string; ext: string } {\n const ext = /\\.([a-z0-9]+)(?:\\?|#|$)/i.exec(uri)?.[1]?.toLowerCase() ?? \"mp4\";\n if (ext === \"mov\") return { contentType: \"video/quicktime\", ext };\n if (ext === \"webm\") return { contentType: \"video/webm\", ext };\n return { contentType: \"video/mp4\", ext: \"mp4\" };\n}\n","/**\n * @feat:chat\n * Async video messages, recorded in the thread: a full-screen camera (expo-camera, passed as\n * `modules.camera`), one button to tap or hold, the time against the role's limit, flip\n * between takes, and close to throw a take away. Stopping sends: the recording is handed to\n * `onRecorded`, which the thread screen sends (`videoUploads`). Asks for the camera and the\n * microphone when it opens; refused, it says how to turn them on.\n */\nimport { useCallback, useEffect, useRef, useState } from \"react\";\nimport { AccessibilityInfo, Linking, Modal, Pressable, View } from \"react-native\";\nimport { SafeAreaView } from \"react-native-safe-area-context\";\nimport { NativeButton, NativeIcon, NativeText } from \"@marktiderman/genesis-ui-native/components\";\nimport { useThemeRoles } from \"@marktiderman/genesis-ui-native/hooks\";\nimport { formatDuration } from \"../core/media\";\nimport { fill } from \"./copy\";\nimport { useChatNative } from \"./context\";\nimport { MEDIA_BACKDROP, MEDIA_SCRIM, ON_MEDIA } from \"./media-colors\";\nimport { haptic, type CameraViewHandleLike, type ExpoCameraLike } from \"./modules\";\nimport type { RecordedVideo } from \"./video-upload\";\nimport { initialVideoRecorder, recordingType, videoRecorderStep, type VideoRecorderEffect, type VideoRecorderEvent, type VideoRecorderState } from \"./video-recorder-state\";\n\nexport interface ChatVideoRecorderProps {\n open: boolean;\n onClose: () => void;\n /** The role's limit (`recordingLimitMs(role)`). */\n limitMs: number;\n /** A take began: the moment to mint the upload, so the bytes can go as soon as it stops. */\n onStart?: () => void;\n /** About every second while recording (to tell the others: `signalRecordingVideo`). */\n onTick?: () => void;\n onRecorded: (video: RecordedVideo) => void;\n /** For tests: the clock. */\n now?: () => number;\n testID?: string;\n}\n\n/** Renders nothing without `modules.camera`. */\nexport function ChatVideoRecorder(props: ChatVideoRecorderProps) {\n const { modules } = useChatNative();\n const camera = modules.camera;\n if (!camera) return null;\n const testID = props.testID ?? \"chat-video-recorder\";\n return (\n <Modal visible={props.open} animationType=\"slide\" presentationStyle=\"fullScreen\" onRequestClose={props.onClose} testID={testID}>\n {props.open ? <RecorderBody {...props} camera={camera} testID={testID} /> : null}\n </Modal>\n );\n}\n\nfunction RecorderBody({ camera, onClose, limitMs, onStart, onTick, onRecorded, now = Date.now, testID }: ChatVideoRecorderProps & { camera: ExpoCameraLike; testID: string }) {\n const { copy, modules } = useChatNative();\n const colors = useThemeRoles();\n const [state, setState] = useState<VideoRecorderState>(() => initialVideoRecorder());\n const stateRef = useRef(state);\n const cameraRef = useRef<CameraViewHandleLike | null>(null);\n const alive = useRef(true);\n const latest = useRef({ onClose, onStart, onTick, onRecorded, limitMs, now });\n latest.current = { onClose, onStart, onTick, onRecorded, limitMs, now };\n\n const dispatch = useCallback(\n (event: VideoRecorderEvent) => {\n if (!alive.current) return;\n const step = videoRecorderStep(stateRef.current, event, { limitMs: latest.current.limitMs });\n stateRef.current = step.state;\n setState(step.state);\n step.effects.forEach(run);\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [],\n );\n\n function run(effect: VideoRecorderEffect) {\n const l = latest.current;\n switch (effect.type) {\n case \"start\": {\n l.onStart?.();\n const cam = cameraRef.current;\n if (!cam) return dispatch({ type: \"recorded\", at: l.now(), uri: null });\n cam\n .recordAsync({ maxDuration: Math.ceil(l.limitMs / 1000) })\n .then((r) => dispatch({ type: \"recorded\", at: latest.current.now(), uri: r?.uri ?? null }))\n .catch(() => dispatch({ type: \"recorded\", at: latest.current.now(), uri: null }));\n return;\n }\n case \"stop\":\n try {\n cameraRef.current?.stopRecording();\n } catch {\n dispatch({ type: \"recorded\", at: l.now(), uri: null });\n }\n return;\n case \"send\": {\n const { contentType, ext } = recordingType(effect.uri);\n l.onRecorded({ uri: effect.uri, durationMs: effect.durationMs, contentType, name: `video-${Math.round(l.now())}.${ext}` });\n return;\n }\n case \"close\":\n l.onClose();\n return;\n case \"haptic\":\n haptic(modules.haptics, effect.event);\n return;\n }\n }\n\n // Camera and microphone, asked for when the recorder opens.\n useEffect(() => {\n alive.current = true;\n void Promise.all([camera.Camera.requestCameraPermissionsAsync(), camera.Camera.requestMicrophonePermissionsAsync()])\n .then(([cam, mic]) => dispatch({ type: \"permissions\", granted: Boolean(cam?.granted && mic?.granted) }))\n .catch(() => dispatch({ type: \"permissions\", granted: false }));\n return () => {\n // Closed mid-take (Android back, the app's navigation): the take is thrown away.\n if (stateRef.current.phase === \"recording\" || stateRef.current.phase === \"stopping\") {\n try {\n cameraRef.current?.stopRecording();\n } catch {\n // Already stopped.\n }\n }\n alive.current = false;\n };\n }, [camera, dispatch]);\n\n // The timer, and the others told about once a second.\n const recording = state.phase === \"recording\";\n useEffect(() => {\n if (!recording) return;\n let ticks = 0;\n const id = setInterval(() => {\n dispatch({ type: \"tick\", at: latest.current.now() });\n if (ticks++ % 4 === 0) latest.current.onTick?.();\n }, 250);\n return () => clearInterval(id);\n }, [recording, dispatch]);\n\n // The preview says when it's ready (at open, after a flip, after Try again); a camera that never\n // says so gets the button anyway after a moment, and a take that can't record says that.\n const starting = state.phase === \"starting\";\n useEffect(() => {\n if (!starting) return;\n const id = setTimeout(() => dispatch({ type: \"camera-ready\" }), 1500);\n return () => clearTimeout(id);\n }, [starting, state.facing, state.cameraKey, dispatch]);\n\n // Said out loud on iOS too (a live region is Android only).\n const noticeText = state.notice === \"too-short\" ? copy.videoTooShort : state.notice === \"take-failed\" ? copy.videoTakeFailed : null;\n const blockedText = state.phase === \"denied\" ? copy.cameraDenied : state.phase === \"failed\" ? copy.cameraFailed : null;\n useEffect(() => {\n const text = noticeText ?? blockedText;\n if (text) AccessibilityInfo?.announceForAccessibility?.(text);\n }, [noticeText, blockedText]);\n\n const { CameraView } = camera;\n const blocked = state.phase === \"denied\" || state.phase === \"failed\";\n const canRecord = state.phase === \"ready\" || recording;\n const stopping = state.phase === \"stopping\";\n\n return (\n <View testID={`${testID}-body`} style={{ flex: 1, backgroundColor: MEDIA_BACKDROP }}>\n {state.phase !== \"asking\" && state.phase !== \"denied\" ? (\n <CameraView\n key={state.cameraKey}\n ref={cameraRef}\n testID={`${testID}-camera`}\n style={{ position: \"absolute\", top: 0, left: 0, right: 0, bottom: 0 }}\n facing={state.facing}\n mode=\"video\"\n videoQuality=\"720p\"\n onCameraReady={() => dispatch({ type: \"camera-ready\" })}\n onMountError={() => dispatch({ type: \"camera-failed\" })}\n />\n ) : null}\n <SafeAreaView edges={[\"top\", \"bottom\", \"left\", \"right\"]} style={{ flex: 1, justifyContent: \"space-between\" }}>\n <View style={{ flexDirection: \"row\", alignItems: \"center\", justifyContent: \"space-between\", paddingHorizontal: 8, paddingTop: 4 }}>\n <Pressable\n testID={`${testID}-close`}\n accessibilityRole=\"button\"\n accessibilityLabel={copy.closeRecorder}\n onPress={() => dispatch({ type: \"cancel\" })}\n style={{ width: 44, height: 44, alignItems: \"center\", justifyContent: \"center\" }}\n >\n <NativeIcon name=\"close\" size={24} color={ON_MEDIA} />\n </Pressable>\n {canRecord || stopping ? (\n <View\n testID={`${testID}-time`}\n accessible\n accessibilityLabel={fill(copy.videoElapsed, { elapsed: formatDuration(state.elapsedMs), limit: formatDuration(limitMs) })}\n style={{ flexDirection: \"row\", alignItems: \"center\", gap: 6, paddingHorizontal: 10, paddingVertical: 4, borderRadius: 14, backgroundColor: MEDIA_SCRIM }}\n >\n {recording ? <View style={{ width: 8, height: 8, borderRadius: 4, backgroundColor: colors.destructive }} /> : null}\n <NativeText style={{ color: ON_MEDIA, fontVariant: [\"tabular-nums\"], fontSize: 15 }}>\n {fill(copy.videoElapsed, { elapsed: formatDuration(state.elapsedMs), limit: formatDuration(limitMs) })}\n </NativeText>\n </View>\n ) : null}\n <View style={{ width: 44 }} />\n </View>\n\n {blocked ? (\n <View testID={`${testID}-${state.phase}`} accessibilityLiveRegion=\"polite\" style={{ paddingHorizontal: 32, gap: 16, alignItems: \"center\" }}>\n <NativeIcon name=\"camera\" size={40} color={ON_MEDIA} />\n <NativeText style={{ color: ON_MEDIA, textAlign: \"center\", fontSize: 17 }}>{state.phase === \"denied\" ? copy.cameraDenied : copy.cameraFailed}</NativeText>\n {state.phase === \"denied\" ? (\n <NativeButton testID={`${testID}-settings`} variant=\"secondary\" onPress={() => void Linking?.openSettings?.()}>\n {copy.openSettings}\n </NativeButton>\n ) : (\n <NativeButton testID={`${testID}-retry`} variant=\"secondary\" onPress={() => dispatch({ type: \"retry\" })}>\n {copy.tryAgain}\n </NativeButton>\n )}\n </View>\n ) : null}\n\n <View style={{ paddingBottom: 16, gap: 12, alignItems: \"center\" }}>\n {state.notice ? (\n <NativeText testID={`${testID}-notice`} accessibilityLiveRegion=\"polite\" style={{ color: ON_MEDIA, textAlign: \"center\", paddingHorizontal: 24 }}>\n {noticeText}\n </NativeText>\n ) : null}\n {!blocked ? (\n <View style={{ flexDirection: \"row\", alignItems: \"center\", justifyContent: \"center\", width: \"100%\" }}>\n <View style={{ flex: 1 }} />\n <Pressable\n testID={`${testID}-record`}\n accessibilityRole=\"button\"\n accessibilityLabel={recording ? copy.stopVideo : copy.startVideo}\n accessibilityHint={recording ? undefined : copy.recordVideoHint}\n accessibilityState={{ disabled: !canRecord, busy: stopping }}\n // A screen reader's double tap is a tap: it starts hands-free, and the next one stops.\n accessibilityActions={canRecord ? [{ name: \"activate\" }] : []}\n onAccessibilityAction={(e) => {\n if (e.nativeEvent.actionName !== \"activate\") return;\n const at = latest.current.now();\n dispatch({ type: \"press\", at });\n dispatch({ type: \"release\", at });\n }}\n disabled={!canRecord}\n onPressIn={() => dispatch({ type: \"press\", at: latest.current.now() })}\n onPressOut={() => dispatch({ type: \"release\", at: latest.current.now() })}\n style={{ width: 84, height: 84, borderRadius: 42, borderWidth: 5, borderColor: ON_MEDIA, alignItems: \"center\", justifyContent: \"center\", opacity: canRecord ? 1 : 0.5 }}\n >\n <View style={recording ? { width: 30, height: 30, borderRadius: 6, backgroundColor: colors.destructive } : { width: 64, height: 64, borderRadius: 32, backgroundColor: colors.destructive }} />\n </Pressable>\n <View style={{ flex: 1, alignItems: \"center\" }}>\n <Pressable\n testID={`${testID}-flip`}\n accessibilityRole=\"button\"\n accessibilityLabel={copy.flipCamera}\n accessibilityState={{ disabled: recording || stopping }}\n disabled={recording || stopping}\n onPress={() => dispatch({ type: \"flip\" })}\n style={{ width: 48, height: 48, borderRadius: 24, alignItems: \"center\", justifyContent: \"center\", backgroundColor: MEDIA_SCRIM, opacity: recording || stopping ? 0.4 : 1 }}\n >\n <NativeIcon name=\"camera-flip\" size={24} color={ON_MEDIA} />\n </Pressable>\n </View>\n </View>\n ) : null}\n {!blocked && !recording ? (\n <NativeText preset=\"caption\" style={{ color: ON_MEDIA, opacity: 0.85, textAlign: \"center\", paddingHorizontal: 24 }}>\n {copy.recordVideoHint}\n </NativeText>\n ) : null}\n </View>\n </SafeAreaView>\n </View>\n );\n}\n","/**\n * @feat:chat\n * Sending a recorded video. With `ChatProvider videoUpload` (Mux direct uploads) the\n * recording goes to the URL the server mints, in chunks, resumably: each chunk is a PUT with\n * `Content-Range`, the server answers 308 with how much it has, and after a dropped\n * connection the next attempt asks (`Content-Range: bytes * /total`) and carries on from there.\n * That is the resumable protocol Mux direct uploads speak (Google Cloud Storage's, the one\n * Mux's UpChunk uses); it is not TUS, so `createTusUpload` doesn't apply. Once the bytes are\n * there, the message is sent through the outbox with `{ kind: \"video\", provider, providerId,\n * status: \"pending\" }` (the server minted the passthrough; the client sends no attachment id),\n * and Mux's webhook marks it ready. Without `videoUpload`, the recording goes through the\n * outbox as a file, to storage, like a picked video.\n *\n * The upload is minted when recording starts (`prepare`), so the bytes can go the moment the\n * recording stops: expo-camera hands over the file only then, so it can't stream while it\n * records. Uploads in flight live here, outside any screen, keyed by conversation: leaving the\n * thread doesn't stop one, and coming back shows it.\n */\nimport { useSyncExternalStore } from \"react\";\nimport { ChatError } from \"../core/client\";\nimport type { LocalFile } from \"../core/outbox\";\nimport type { AttachmentInput, SendInput } from \"../core/types\";\nimport type { ChatVideoUpload } from \"../react/index\";\nimport type { ChunkFileLike } from \"./modules\";\n\n/** 8 MiB: a multiple of 256 KiB, as resumable uploads require for every chunk but the last. */\nexport const VIDEO_CHUNK_BYTES = 8 * 1024 * 1024;\n\n/** What an upload reads: a file a chunk at a time, or bytes in memory. */\nexport interface ByteSource {\n size: number;\n read(from: number, to: number): Promise<ArrayBuffer>;\n close(): void;\n}\n\nconst exact = (bytes: ArrayBuffer | Uint8Array): ArrayBuffer =>\n bytes instanceof ArrayBuffer ? bytes : (bytes.buffer.slice(bytes.byteOffset, bytes.byteOffset + bytes.byteLength) as ArrayBuffer);\n\n/** Opens a file URI for upload: in chunks with `openFile` (expo-file-system), else read whole through fetch. */\nexport async function fileSource(uri: string, openFile?: (uri: string) => Promise<ChunkFileLike> | ChunkFileLike, doFetch: typeof fetch = fetch): Promise<ByteSource> {\n if (openFile) {\n const handle = await openFile(uri);\n if (!Number.isFinite(handle.size) || handle.size <= 0) {\n try {\n handle.close?.();\n } catch {\n // Already closed.\n }\n throw new ChatError(\"The recording is empty\", \"22023\", \"upload\");\n }\n return {\n size: handle.size,\n read: async (from, to) => {\n const bytes = exact(await handle.read(from, to - from));\n if (bytes.byteLength !== to - from) throw new ChatError(\"The recording changed while it was sent\", \"22023\", \"upload\");\n return bytes;\n },\n close: () => {\n try {\n handle.close?.();\n } catch {\n // Already closed.\n }\n },\n };\n }\n const buffer = await (await doFetch(uri)).arrayBuffer();\n if (buffer.byteLength === 0) throw new ChatError(\"The recording is empty\", \"22023\", \"upload\");\n return { size: buffer.byteLength, read: async (from, to) => buffer.slice(from, to), close: () => undefined };\n}\n\nexport interface ChunkedPutOptions {\n url: string;\n contentType: string;\n source: ByteSource;\n fetch?: typeof fetch;\n chunkBytes?: number;\n /** Network failures retried per chunk before it fails (the person can Retry). Default 4. */\n retries?: number;\n /** Bytes the server has, after each chunk. */\n onProgress?: (sent: number, total: number) => void;\n /** Stops between requests (Cancel). */\n isCancelled?: () => boolean;\n /** Ask the server where it is before sending anything (a Retry of an upload that got partway). */\n resume?: boolean;\n /** For tests. */\n sleep?: (ms: number) => Promise<void>;\n}\n\nconst DONE = new Set([200, 201, 202, 204]);\nconst transient = (status: number) => status === 0 || status === 408 || status === 429 || status >= 500;\n\n/** The next byte the server wants, from a 308's `Range: bytes=0-N` (none: it has nothing yet). */\nexport function nextOffset(range: string | null | undefined): number {\n const m = /bytes=(\\d+)-(\\d+)/.exec(range ?? \"\");\n return m ? Number(m[2]) + 1 : 0;\n}\n\n/** Uploads `source` to a resumable upload URL, a chunk at a time. Resolves once the server has every byte. */\nexport async function chunkedPut(options: ChunkedPutOptions): Promise<void> {\n const doFetch = options.fetch ?? fetch;\n const chunk = options.chunkBytes ?? VIDEO_CHUNK_BYTES;\n const retries = options.retries ?? 4;\n const sleep = options.sleep ?? ((ms: number) => new Promise<void>((r) => setTimeout(r, ms)));\n const total = options.source.size;\n if (chunk % (256 * 1024) !== 0 && chunk < total) throw new ChatError(\"Chunks must be a multiple of 256 KiB\", \"22023\", \"upload\");\n const cancelled = () => {\n if (options.isCancelled?.()) throw new ChatError(\"Cancelled\", \"57014\", \"upload\");\n };\n\n /** Where the server is: a status query (an empty PUT). null when it has everything. */\n const ask = async (): Promise<number | null> => {\n const res = await doFetch(options.url, { method: \"PUT\", headers: { \"content-range\": `bytes */${total}` } });\n if (DONE.has(res.status)) return null;\n if (res.status === 308) return nextOffset(res.headers.get(\"range\"));\n return refuse(res);\n };\n\n let offset = 0;\n if (options.resume) {\n cancelled();\n const at = await withRetry(ask);\n if (at === null) return void options.onProgress?.(total, total);\n offset = at;\n }\n options.onProgress?.(offset, total);\n // Failures since the server last moved forward: a 308 that keeps nothing new counts too, so a\n // server that never advances ends in an error, not a loop.\n let stalls = 0;\n const stall = async (message: string) => {\n stalls++;\n if (stalls > retries) throw new ChatError(message, undefined, \"upload\");\n await sleep(Math.min(8000, 500 * 2 ** (stalls - 1)));\n cancelled();\n };\n while (offset < total) {\n cancelled();\n const from = offset;\n const to = Math.min(total, from + chunk);\n const body = await options.source.read(from, to);\n let res: Response | null = null;\n try {\n res = await doFetch(options.url, {\n method: \"PUT\",\n headers: { \"content-type\": options.contentType, \"content-range\": `bytes ${from}-${to - 1}/${total}` },\n body,\n });\n } catch {\n res = null;\n }\n if (res && DONE.has(res.status)) {\n // \"Complete\" before the last byte: the server took a part as the whole (a plain PUT URL).\n if (to < total) throw new ChatError(\"The upload server kept only part of the video\", \"22023\", \"upload\");\n offset = total;\n } else if (res?.status === 308) {\n const next = nextOffset(res.headers.get(\"range\"));\n if (next > from) {\n offset = next;\n stalls = 0;\n } else {\n await stall(\"The video upload is out of step\");\n }\n } else if (res && !transient(res.status)) {\n return refuse(res);\n } else {\n // A dropped connection or a server hiccup: wait, ask where it is, and go on from there.\n await stall(\"Not sent. Check your connection.\");\n try {\n const at = await ask();\n if (at === null) offset = total;\n else if (at > from) {\n offset = at;\n stalls = 0;\n }\n } catch (e) {\n if (e instanceof ChatError && !e.transient) throw e;\n }\n }\n options.onProgress?.(offset, total);\n }\n\n async function withRetry<T>(run: () => Promise<T>): Promise<T> {\n let last: unknown;\n for (let attempt = 0; attempt <= retries; attempt++) {\n try {\n return await run();\n } catch (e) {\n last = e;\n if (e instanceof ChatError && !e.transient) throw e;\n if (attempt < retries) await sleep(Math.min(8000, 500 * 2 ** attempt));\n cancelled();\n }\n }\n throw last instanceof ChatError ? last : new ChatError(\"Not sent. Check your connection.\", undefined, \"upload\");\n }\n}\n\nasync function refuse(res: Response): Promise<never> {\n const text = await res.text().catch(() => \"\");\n // 404 / 410: the upload URL expired or was used up; a new one is minted on Retry.\n const code = res.status === 404 || res.status === 410 ? \"P0002\" : res.status === 401 || res.status === 403 ? \"42501\" : transient(res.status) ? undefined : \"22023\";\n throw new ChatError(text.slice(0, 200) || `The video didn't upload (${res.status})`, code, \"upload\");\n}\n\n// ── Uploads in flight ─────────────────────────────────────────────────────────\n\n/** A recording as the recorder hands it over. */\nexport interface RecordedVideo {\n uri: string;\n name: string;\n contentType: string;\n durationMs: number;\n}\n\nexport type VideoUploadStatus = \"uploading\" | \"failed\";\n\n/** Why a video didn't go: the tray words it (`copy`); `detail` is the error, for logs. */\nexport type VideoUploadError = \"offline\" | \"forbidden\" | \"failed\";\n\n/** One video on its way, shown in the thread above the composer until its message is queued. */\nexport interface VideoUploadTask {\n id: string;\n conversationId: string;\n /** Whose it is: the tray shows only the signed-in person's. */\n userId: string | null;\n video: RecordedVideo;\n status: VideoUploadStatus;\n /** 0 to 1. */\n progress: number;\n error: VideoUploadError | null;\n detail: string | null;\n}\n\n/** The outbox's send (`useChat().outbox.send`): the message goes in the conversation's order. */\nexport type OutboxSend = (input: Omit<SendInput, \"clientId\"> & { clientId?: string }, files?: LocalFile[]) => Promise<string>;\n\nexport type MintedUpload = { url: string; providerId: string; provider: \"mux\" };\n\nexport interface StartVideoInput {\n conversationId: string;\n userId?: string | null;\n video: RecordedVideo;\n /** What goes with it: a reply, a thread, a topic. */\n extra?: Omit<SendInput, \"conversationId\" | \"clientId\" | \"attachments\" | \"body\">;\n send: OutboxSend;\n videoUpload?: ChatVideoUpload;\n /** The upload minted when recording started. */\n prepared?: Promise<MintedUpload> | null;\n openFile?: (uri: string) => Promise<ChunkFileLike> | ChunkFileLike;\n fetch?: typeof fetch;\n chunkBytes?: number;\n sleep?: (ms: number) => Promise<void>;\n}\n\n/** The video as a file the outbox uploads to storage (without `videoUpload`). */\nexport function recordedVideoFile(video: RecordedVideo): LocalFile {\n return { data: video.uri, name: video.name, contentType: video.contentType, previewUrl: video.uri, meta: { kind: \"video\", durationMs: video.durationMs } };\n}\n\ninterface Internal {\n task: VideoUploadTask;\n input: StartVideoInput;\n upload: MintedUpload | null;\n bytes: number | null;\n /** Bytes went to `upload`: a Retry asks the server where it is first. */\n started: boolean;\n /** Every byte is there: a Retry only sends the message. */\n uploaded: boolean;\n cancelled: boolean;\n}\n\nfunction errorKind(e: unknown): VideoUploadError {\n if (e instanceof ChatError) return e.forbidden ? \"forbidden\" : e.transient ? \"offline\" : \"failed\";\n return e instanceof TypeError ? \"offline\" : \"failed\";\n}\n\nexport function createVideoUploads(newId: () => string = () => `${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`) {\n const tasks = new Map<string, Internal>();\n const listeners = new Set<() => void>();\n let snapshot: VideoUploadTask[] = [];\n const emit = () => {\n snapshot = [...tasks.values()].map((t) => t.task);\n listeners.forEach((l) => l());\n };\n const update = (t: Internal, patch: Partial<VideoUploadTask>) => {\n if (!tasks.has(t.task.id)) return;\n t.task = { ...t.task, ...patch };\n emit();\n };\n const finish = (t: Internal) => {\n tasks.delete(t.task.id);\n emit();\n };\n\n async function upload(t: Internal, videoUpload: ChatVideoUpload) {\n const { input } = t;\n if (!t.upload) {\n const prepared = input.prepared;\n // A minted upload is used once, whatever happens to it.\n t.input = { ...input, prepared: null };\n t.upload = await (prepared ?? videoUpload.create(input.conversationId));\n }\n if (t.cancelled) return;\n const source = await fileSource(input.video.uri, input.openFile, input.fetch);\n try {\n t.bytes = source.size;\n const resume = t.started;\n t.started = true;\n await chunkedPut({\n url: t.upload.url,\n contentType: input.video.contentType,\n source,\n fetch: input.fetch,\n chunkBytes: input.chunkBytes,\n sleep: input.sleep,\n resume,\n isCancelled: () => t.cancelled,\n onProgress: (sent, total) => update(t, { progress: total ? sent / total : 0 }),\n });\n } finally {\n source.close();\n }\n t.uploaded = true;\n }\n\n async function run(t: Internal) {\n const { input } = t;\n const { video } = input;\n if (!input.videoUpload) {\n // To storage, through the outbox (its pending bubble shows the upload).\n await input.send({ ...input.extra, conversationId: input.conversationId, body: \"\" }, [recordedVideoFile(video)]);\n return finish(t);\n }\n if (!t.uploaded) {\n try {\n await upload(t, input.videoUpload);\n } catch (e) {\n // A minted upload that expired before it was used: mint a fresh one, once, without asking.\n if (!(e instanceof ChatError && e.code === \"P0002\") || t.cancelled) throw e;\n t.upload = null;\n t.started = false;\n await upload(t, input.videoUpload);\n }\n }\n if (t.cancelled || !t.upload) return;\n const attachment: AttachmentInput = {\n kind: \"video\",\n provider: t.upload.provider,\n providerId: t.upload.providerId,\n status: \"pending\",\n name: video.name,\n mime: video.contentType,\n bytes: t.bytes ?? undefined,\n durationMs: Math.round(video.durationMs),\n };\n // Queued in the outbox, it shows in the thread as a pending video; then the tray lets it go.\n await input.send({ ...input.extra, conversationId: input.conversationId, body: \"\", attachments: [attachment] });\n finish(t);\n }\n\n function go(t: Internal) {\n update(t, { status: \"uploading\", error: null, detail: null });\n run(t).catch((e: unknown) => {\n if (t.cancelled) return;\n // An upload URL that is gone: Retry mints a new one and starts over.\n if (e instanceof ChatError && e.code === \"P0002\") {\n t.upload = null;\n t.started = false;\n }\n update(t, { status: \"failed\", error: errorKind(e), detail: e instanceof Error ? e.message : String(e) });\n });\n }\n\n return {\n /** Starts sending a recording. Returns the task's id. */\n start(input: StartVideoInput): string {\n const id = newId();\n const t: Internal = {\n task: { id, conversationId: input.conversationId, userId: input.userId ?? null, video: input.video, status: \"uploading\", progress: 0, error: null, detail: null },\n input,\n upload: null,\n bytes: null,\n started: false,\n uploaded: false,\n cancelled: false,\n };\n tasks.set(id, t);\n emit();\n go(t);\n return id;\n },\n retry(id: string) {\n const t = tasks.get(id);\n if (t && t.task.status === \"failed\") go(t);\n },\n /** Stops it and forgets it (an upload Mux never receives expires on its own). */\n cancel(id: string) {\n const t = tasks.get(id);\n if (!t) return;\n t.cancelled = true;\n finish(t);\n },\n /** Stops and forgets every one (call it on sign-out, beside `clearOutbox`). */\n cancelAll() {\n for (const t of tasks.values()) t.cancelled = true;\n tasks.clear();\n emit();\n },\n list(conversationId?: string): VideoUploadTask[] {\n return conversationId ? snapshot.filter((t) => t.conversationId === conversationId) : snapshot;\n },\n subscribe(listener: () => void) {\n listeners.add(listener);\n return () => void listeners.delete(listener);\n },\n snapshot: () => snapshot,\n };\n}\n\nexport type VideoUploads = ReturnType<typeof createVideoUploads>;\n\n/** The app's uploads in flight (one for the app; the thread screen reads it). */\nexport const videoUploads: VideoUploads = createVideoUploads();\n\nconst EMPTY: VideoUploadTask[] = [];\n\n/** The signed-in person's videos on their way to this conversation, live. */\nexport function useVideoUploads(conversationId: string, userId: string | null = null, store: VideoUploads = videoUploads): VideoUploadTask[] {\n const all = useSyncExternalStore(store.subscribe, store.snapshot, () => EMPTY);\n const mine = (t: VideoUploadTask) => t.conversationId === conversationId && (userId === null || t.userId === null || t.userId === userId);\n return all.some(mine) ? all.filter(mine) : EMPTY;\n}\n","/**\n * @feat:chat\n * Videos on their way, above the composer: how far each upload has got, and, when one\n * fails, why, with Retry (it resumes where it stopped) and Cancel. Once a video's bytes are\n * all there, its message joins the outbox and shows in the thread like any other.\n */\nimport { useEffect, useRef } from \"react\";\nimport { AccessibilityInfo, Pressable, View } from \"react-native\";\nimport { NativeIcon, NativeProgress, NativeText } from \"@marktiderman/genesis-ui-native/components\";\nimport { useThemeRoles } from \"@marktiderman/genesis-ui-native/hooks\";\nimport { fill } from \"./copy\";\nimport { useChatNative } from \"./context\";\nimport { useVideoUploads, videoUploads as defaultUploads, type VideoUploads } from \"./video-upload\";\n\nexport interface VideoUploadTrayProps {\n conversationId: string;\n /** The signed-in person: the tray shows only their uploads. */\n userId?: string | null;\n uploads?: VideoUploads;\n testID?: string;\n}\n\nexport function VideoUploadTray({ conversationId, userId = null, uploads = defaultUploads, testID = \"chat-video-uploads\" }: VideoUploadTrayProps) {\n const { copy } = useChatNative();\n const colors = useThemeRoles();\n const tasks = useVideoUploads(conversationId, userId, uploads);\n const why = (t: (typeof tasks)[number]) => (t.error === \"offline\" ? copy.videoOffline : t.error === \"forbidden\" ? copy.videoForbidden : copy.videoUploadFailed);\n // A failure is said once, on both platforms (a live region is Android only, and would read every percent).\n const told = useRef(new Set<string>());\n const failedNow = tasks.filter((t) => t.status === \"failed\").map((t) => t.id).join(\",\");\n useEffect(() => {\n for (const t of tasks) {\n if (t.status === \"failed\" && !told.current.has(t.id)) {\n told.current.add(t.id);\n AccessibilityInfo?.announceForAccessibility?.(why(t));\n }\n if (t.status !== \"failed\") told.current.delete(t.id);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [failedNow]);\n if (!tasks.length) return null;\n return (\n <View testID={testID} style={{ paddingHorizontal: 12, paddingTop: 6, gap: 6, backgroundColor: colors.groupedBackground }}>\n {tasks.map((t) => {\n const percent = Math.round(t.progress * 100);\n const failed = t.status === \"failed\";\n return (\n <View key={t.id} testID={`${testID}-${t.id}`} style={{ flexDirection: \"row\", alignItems: \"center\", gap: 8, padding: 8, borderRadius: 12, backgroundColor: colors.surface }}>\n <NativeIcon name=\"video\" size={20} color={failed ? colors.destructive : colors.tint} />\n <View\n style={{ flex: 1, gap: 4 }}\n accessible\n accessibilityRole={failed ? \"alert\" : \"progressbar\"}\n accessibilityLabel={failed ? why(t) : fill(copy.videoUploading, { percent })}\n accessibilityValue={failed ? undefined : { min: 0, max: 100, now: percent }}\n >\n <NativeText testID={`${testID}-${t.id}-text`} preset=\"caption\" numberOfLines={2} style={{ color: failed ? colors.destructive : colors.label }}>\n {failed ? why(t) : fill(copy.videoUploading, { percent })}\n </NativeText>\n {failed ? null : <NativeProgress value={percent} testID={`${testID}-${t.id}-progress`} />}\n </View>\n {failed ? (\n <Pressable testID={`${testID}-${t.id}-retry`} accessibilityRole=\"button\" accessibilityLabel={copy.retry} onPress={() => uploads.retry(t.id)} style={{ minHeight: 44, minWidth: 44, paddingHorizontal: 8, alignItems: \"center\", justifyContent: \"center\" }}>\n <NativeText preset=\"label\" style={{ color: colors.tint }}>\n {copy.retry}\n </NativeText>\n </Pressable>\n ) : null}\n <Pressable testID={`${testID}-${t.id}-cancel`} accessibilityRole=\"button\" accessibilityLabel={copy.cancelUpload} onPress={() => uploads.cancel(t.id)} style={{ width: 44, height: 44, alignItems: \"center\", justifyContent: \"center\" }}>\n <NativeIcon name=\"close\" size={18} color={colors.secondaryLabel} />\n </Pressable>\n </View>\n );\n })}\n </View>\n );\n}\n","/**\n * @feat:chat\n * The composer as plain state, so it is the same in every screen and tested\n * without a phone: the text, the files waiting to go, what it replies to, why\n * it can't post, what a send hands the outbox, and the draft kept per thread.\n */\nimport { CHAT_LIMITS, attachmentKindFor, fileExtension, isAllowedExtension } from \"../core/media\";\nimport { parseMentions } from \"../core/thread\";\nimport type { LocalFile } from \"../core/outbox\";\nimport type { ChatConversation, ChatMessage, ChatRole } from \"../core/types\";\nimport { fill, type ChatNativeCopy } from \"./copy\";\nimport type { DraftStorageLike, PickedAssetLike } from \"./modules\";\n\n/** A file in the composer, shown as a thumbnail until it is sent. */\nexport interface ComposerAttachment {\n /** Stable for keys and removal. */\n key: string;\n file: LocalFile;\n}\n\nexport interface ReplyTarget {\n messageId: string;\n /** Who wrote it, as shown (\"Sam\", \"You\"). */\n name: string;\n /** A one-line preview. */\n preview: string;\n}\n\nexport interface ComposerState {\n text: string;\n attachments: ComposerAttachment[];\n replyTo: ReplyTarget | null;\n /** The last thing that couldn't be added (\"x.svg can't be sent\"). Cleared by the next change. */\n notice: string | null;\n}\n\nexport const emptyComposer: ComposerState = { text: \"\", attachments: [], replyTo: null, notice: null };\n\nexport type ComposerAction =\n | { type: \"text\"; text: string }\n /** `tooMany` is what to say when the files don't all fit (copy.tooMany). */\n | { type: \"add\"; attachments: ComposerAttachment[]; notice?: string | null; tooMany?: string }\n | { type: \"remove\"; key: string }\n | { type: \"reply\"; to: ReplyTarget | null }\n | { type: \"restore\"; draft: ComposerDraft }\n /** Another conversation (or thread) opened in the same composer: start empty. */\n | { type: \"reset\" }\n | { type: \"sent\" };\n\nexport function composerReducer(state: ComposerState, action: ComposerAction): ComposerState {\n switch (action.type) {\n case \"text\":\n return { ...state, text: action.text.slice(0, CHAT_LIMITS.bodyChars), notice: null };\n case \"add\": {\n const room = CHAT_LIMITS.attachmentsPerMessage - state.attachments.length;\n const added = action.attachments.slice(0, Math.max(0, room));\n const overflow = action.attachments.length > added.length;\n return {\n ...state,\n attachments: [...state.attachments, ...added],\n notice: overflow ? (action.tooMany ?? action.notice ?? null) : (action.notice ?? null),\n };\n }\n case \"remove\":\n return { ...state, attachments: state.attachments.filter((a) => a.key !== action.key), notice: null };\n case \"reply\":\n return { ...state, replyTo: action.to };\n case \"restore\":\n // A draft never replaces what was typed meanwhile.\n if (state.text || state.attachments.length) return state;\n return { ...state, text: action.draft.text, replyTo: action.draft.replyTo ?? null };\n case \"reset\":\n case \"sent\":\n return emptyComposer;\n }\n}\n\n/** Something to send: text that isn't blank, or a file. */\nexport function canSend(state: ComposerState, canPost: boolean): boolean {\n return canPost && (state.text.trim().length > 0 || state.attachments.length > 0);\n}\n\n/**\n * Why this person can't post here, for the disabled composer; null when they can.\n * `canPost` is the server's answer (null while it loads, which disables quietly).\n */\nexport function composerDisabledReason(\n canPost: boolean | null,\n conversation: Pick<ChatConversation, \"settings\" | \"status\" | \"archivedAt\"> | null,\n role: ChatRole | null,\n copy: Pick<ChatNativeCopy, \"cantPost\" | \"cantPostAdmins\" | \"cantPostClosed\">,\n): string | null {\n if (canPost !== false) return null;\n if (conversation?.status === \"closed\" || conversation?.status === \"solved\" || conversation?.archivedAt) return copy.cantPostClosed;\n if (conversation?.settings?.who_posts === \"admins\" && role !== \"owner\" && role !== \"admin\") return copy.cantPostAdmins;\n return copy.cantPost;\n}\n\n/** What `useConversation().send` takes: the input and the files. */\nexport function toSend(state: ComposerState): { input: { body: string; replyToId: string | null; mentions: string[] }; files: LocalFile[] } {\n const body = state.text.trim();\n return {\n input: { body, replyToId: state.replyTo?.messageId ?? null, mentions: parseMentions(body) },\n files: state.attachments.map((a) => a.file),\n };\n}\n\n/** A reply target from a message. */\nexport function replyTargetFor(message: ChatMessage, name: string, preview: string): ReplyTarget {\n return { messageId: message.id, name, preview };\n}\n\nlet seq = 0;\nconst nextKey = () => `a${Date.now().toString(36)}${(seq++).toString(36)}`;\n\n/**\n * Picked photos and videos as files to send, with what was refused and why:\n * a type the bucket won't take, a file over the limit.\n */\nexport function filesFromAssets(\n assets: readonly PickedAssetLike[],\n copy: Pick<ChatNativeCopy, \"tooLarge\" | \"notAllowedType\" | \"photo\" | \"video\">,\n): { attachments: ComposerAttachment[]; notice: string | null } {\n const attachments: ComposerAttachment[] = [];\n let notice: string | null = null;\n for (const asset of assets) {\n const video = asset.type === \"video\" || (asset.mimeType ?? \"\").startsWith(\"video/\");\n const contentType = asset.mimeType ?? (video ? \"video/mp4\" : \"image/jpeg\");\n const fallbackName = `${video ? \"video\" : \"photo\"}.${video ? \"mp4\" : \"jpg\"}`;\n const name = asset.fileName ?? (asset.uri.split(\"/\").pop() || fallbackName);\n const ext = fileExtension(name, contentType);\n if (!isAllowedExtension(ext)) {\n notice = fill(copy.notAllowedType, { name });\n continue;\n }\n const limit = video ? CHAT_LIMITS.videoBytes : CHAT_LIMITS.fileBytes;\n if (asset.fileSize != null && asset.fileSize > limit) {\n notice = fill(copy.tooLarge, { name });\n continue;\n }\n attachments.push({\n key: nextKey(),\n file: {\n data: asset.uri,\n name,\n contentType,\n previewUrl: asset.uri,\n meta: {\n kind: attachmentKindFor(contentType),\n width: asset.width || undefined,\n height: asset.height || undefined,\n bytes: asset.fileSize ?? undefined,\n durationMs: video && asset.duration ? Math.round(asset.duration) : undefined,\n },\n },\n });\n }\n return { attachments, notice };\n}\n\n/** A pasted picture (a data URI from the clipboard) as a file to send. */\nexport function fileFromDataUri(dataUri: string, size?: { width: number; height: number }): ComposerAttachment | null {\n const m = /^data:([^;,]+);base64,(.*)$/s.exec(dataUri);\n if (!m) return null;\n const contentType = m[1]!.toLowerCase();\n const ext = fileExtension(\"\", contentType);\n if (!contentType.startsWith(\"image/\") || !isAllowedExtension(ext)) return null;\n const bytes = base64ToBytes(m[2]!);\n return {\n key: nextKey(),\n file: {\n data: bytes.buffer as ArrayBuffer,\n name: `pasted.${ext}`,\n contentType,\n previewUrl: dataUri,\n meta: { kind: \"image\", width: size?.width, height: size?.height, bytes: bytes.byteLength },\n },\n };\n}\n\nconst B64 = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\n\n/** Base64 to bytes without `atob` (not on every Hermes build). */\nexport function base64ToBytes(b64: string): Uint8Array {\n const clean = b64.replace(/[^A-Za-z0-9+/]/g, \"\");\n const out = new Uint8Array(Math.floor((clean.length * 3) / 4));\n let o = 0;\n for (let i = 0; i < clean.length; i += 4) {\n const n =\n (B64.indexOf(clean[i]!) << 18) |\n (B64.indexOf(clean[i + 1] ?? \"A\") << 12) |\n ((i + 2 < clean.length ? B64.indexOf(clean[i + 2]!) : 0) << 6) |\n (i + 3 < clean.length ? B64.indexOf(clean[i + 3]!) : 0);\n if (o < out.length) out[o++] = (n >> 16) & 255;\n if (i + 2 < clean.length && o < out.length) out[o++] = (n >> 8) & 255;\n if (i + 3 < clean.length && o < out.length) out[o++] = n & 255;\n }\n return out;\n}\n\n// ---- Drafts ---------------------------------------------------------------\n\n/** What a draft keeps: the text and what it replies to (never the files, which may be gone by then). */\nexport interface ComposerDraft {\n text: string;\n replyTo?: ReplyTarget | null;\n}\n\nconst DRAFT_PREFIX = \"genesis-chat:drafts:\";\n/** Drafts saved before they were kept per person: no one's, so any sign-out clears them. */\nconst LEGACY_DRAFT_PREFIX = \"genesis-chat:draft:\";\n\n/**\n * One draft per signed-in person, per conversation, and per thread within it.\n * The person comes first, so `clearDrafts` can find all of theirs on sign-out,\n * and a second login on the phone never sees the first one's drafts.\n */\nexport function draftKey(userId: string, conversationId: string, threadRootId?: string | null): string {\n return `${DRAFT_PREFIX}${userId}:${conversationId}${threadRootId ? `:${threadRootId}` : \"\"}`;\n}\n\n/**\n * Removes drafts from the phone: one person's (`clearDrafts(storage, userId)`,\n * on sign-out), or everyone's but one (`{ except: userId }`, on sign-in, which\n * also covers a session that ended while the app was closed). Drafts saved\n * before drafts were kept per person go either way. Needs the storage's\n * `getAllKeys` (AsyncStorage has it); without it, it reports that through\n * `onError` and removes nothing. Never throws. Returns how many it removed.\n */\nexport async function clearDrafts(storage: DraftStorageLike, who: string | { except: string }, onError?: (error: unknown) => void): Promise<number> {\n try {\n if (typeof storage.getAllKeys !== \"function\") {\n onError?.(new Error(\"chat drafts: the draft storage has no getAllKeys, so drafts weren't cleared\"));\n return 0;\n }\n const goes = (k: string) =>\n k.startsWith(LEGACY_DRAFT_PREFIX) ||\n (k.startsWith(DRAFT_PREFIX) && (typeof who === \"string\" ? k.startsWith(`${DRAFT_PREFIX}${who}:`) : !k.startsWith(`${DRAFT_PREFIX}${who.except}:`)));\n const keys = (await storage.getAllKeys()).filter(goes);\n if (keys.length === 0) return 0;\n if (typeof storage.multiRemove === \"function\") await storage.multiRemove(keys);\n else await Promise.all(keys.map((k) => storage.removeItem(k)));\n return keys.length;\n } catch (error) {\n onError?.(error);\n return 0;\n }\n}\n\nexport function memoryDraftStorage(): DraftStorageLike {\n const map = new Map<string, string>();\n return {\n getItem: async (k) => map.get(k) ?? null,\n setItem: async (k, v) => void map.set(k, v),\n removeItem: async (k) => void map.delete(k),\n getAllKeys: async () => [...map.keys()],\n };\n}\n\nexport async function loadDraft(storage: DraftStorageLike, key: string): Promise<ComposerDraft | null> {\n try {\n const raw = await storage.getItem(key);\n if (!raw) return null;\n const parsed = JSON.parse(raw) as ComposerDraft;\n return typeof parsed?.text === \"string\" ? parsed : null;\n } catch {\n return null;\n }\n}\n\n/**\n * Saves the draft a moment after typing stops (and at once on `flush`); an\n * empty composer removes it. Storage errors are swallowed: a draft is a nicety.\n */\nexport function createDraftSaver(storage: DraftStorageLike, key: string, delayMs = 400) {\n let timer: ReturnType<typeof setTimeout> | null = null;\n let latest: ComposerDraft | null = null;\n const write = () => {\n timer = null;\n const d = latest;\n if (!d) return;\n const p = d.text.trim() || d.replyTo ? storage.setItem(key, JSON.stringify(d)) : storage.removeItem(key);\n void p.catch(() => undefined);\n };\n return {\n save(draft: ComposerDraft) {\n latest = draft;\n if (timer) clearTimeout(timer);\n timer = setTimeout(write, delayMs);\n },\n flush() {\n if (timer) clearTimeout(timer);\n write();\n },\n clear() {\n if (timer) clearTimeout(timer);\n timer = null;\n latest = null;\n void storage.removeItem(key).catch(() => undefined);\n },\n };\n}\n","/**\n * @feat:chat\n * Scheduled send on native. `ChatScheduleSheet`: tomorrow 9 AM, Monday 9 AM, or a date and time\n * you pick (genesis-ui-native's NativeDatePicker and NativeTimePicker, which draw\n * @react-native-community/datetimepicker, or @expo/ui's picker passed as GenesisNativeApp's\n * `modules.datePicker`; without either the time reads as text and the quick picks still work).\n * `ChatScheduledList`: your messages waiting to go, each with Cancel. `ChatScheduledBar`: \"2\n * scheduled messages\" over the composer, opening that list. The thread opens the sheet when Send\n * is touched and held. The same rules as the web's `ChatScheduleMenu` and `ChatScheduledList`.\n */\nimport { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\nimport { Pressable, View } from \"react-native\";\nimport {\n NativeButton,\n NativeDatePicker,\n NativeEmptyState,\n NativeIcon,\n NativeListItem,\n NativeSheet,\n NativeSkeleton,\n NativeText,\n NativeTimePicker,\n useToast,\n} from \"@marktiderman/genesis-ui-native/components\";\nimport { useThemeRoles } from \"@marktiderman/genesis-ui-native/hooks\";\nimport { isSchedulable, scheduleLabel, scheduleQuickPicks } from \"../core/extras\";\nimport { previewText } from \"../core/thread\";\nimport type { ScheduleInput, ScheduledMessage } from \"../core/types\";\nimport { useScheduled } from \"../react/index\";\nimport { toSend, type ComposerState } from \"./composer-state\";\nimport { haptic } from \"./modules\";\nimport type { ChatComposerHandle } from \"./use-composer\";\nimport { fill } from \"./copy\";\nimport { useChatNative } from \"./context\";\nimport { displayBody } from \"./message-bubble\";\n\n/** An hour from now, on the next five minutes: where the custom picker starts. */\nexport function defaultScheduleAt(now: Date = new Date()): Date {\n const d = new Date(now.getTime() + 60 * 60_000);\n d.setSeconds(0, 0);\n d.setMinutes(Math.ceil(d.getMinutes() / 5) * 5);\n return d;\n}\n\n/** `base` on the day of `day` (its time kept). */\nexport function withDay(base: Date, day: Date): Date {\n const d = new Date(base);\n d.setFullYear(day.getFullYear(), day.getMonth(), day.getDate());\n return d;\n}\n\n/** `base` at the time of `time` (its day kept). */\nexport function withTime(base: Date, time: Date): Date {\n const d = new Date(base);\n d.setHours(time.getHours(), time.getMinutes(), 0, 0);\n return d;\n}\n\n/**\n * What the composer holds, as a message to schedule, or why it can't be: nothing to send, or\n * files (a native file is a URI, and `useScheduled` uploads bytes only).\n */\nexport function scheduleInputFrom(\n state: ComposerState,\n opts: { conversationId: string; topic?: string | null; at: Date },\n): { input: Omit<ScheduleInput, \"clientId\"> } | { error: \"empty\" | \"files\" } {\n const { input, files } = toSend(state);\n if (files.length) return { error: \"files\" };\n if (!input.body) return { error: \"empty\" };\n return { input: { conversationId: opts.conversationId, body: input.body, mentions: input.mentions, replyToId: input.replyToId, topic: opts.topic ?? null, sendAt: opts.at } };\n}\n\n/**\n * Scheduled send from a thread's composer: `request` (Send held) checks there's text and no\n * files and opens the sheet; `scheduleAt` schedules what's written, then empties the composer\n * if it still holds just that. Pass `enabled: false` where scheduling isn't offered.\n */\nexport function useScheduleSend(opts: { conversationId: string; topic?: string | null; composer: ChatComposerHandle; enabled: boolean }) {\n const { copy, modules } = useChatNative();\n const toast = useToast();\n const { schedule } = useScheduled(opts.conversationId, { enabled: opts.enabled });\n const [open, setOpen] = useState(false);\n const latest = useRef(opts);\n latest.current = opts;\n\n const request = useCallback(() => {\n const check = scheduleInputFrom(latest.current.composer.state, { conversationId: latest.current.conversationId, at: new Date() });\n if (\"error\" in check) {\n if (check.error === \"files\") toast.show({ title: copy.scheduleNoFiles, variant: \"destructive\" });\n return;\n }\n haptic(modules.haptics, \"select\");\n setOpen(true);\n }, [toast, copy.scheduleNoFiles, modules.haptics]);\n\n const scheduleAt = useCallback(\n async (at: Date) => {\n const { composer, conversationId, topic } = latest.current;\n const made = scheduleInputFrom(composer.state, { conversationId, topic, at });\n if (\"error\" in made) return;\n try {\n await schedule(made.input);\n // More may have been typed while it saved: only what was scheduled is cleared.\n const now = latest.current.composer;\n if (now.state.text.trim() === made.input.body) now.take();\n haptic(modules.haptics, \"send\");\n toast.show({ title: fill(copy.scheduledFor, { when: scheduleLabel(at) }), variant: \"success\", duration: 2000 });\n } catch (e) {\n haptic(modules.haptics, \"error\");\n toast.show({ title: e instanceof Error && e.message ? e.message : copy.scheduleFailed, variant: \"destructive\" });\n }\n },\n [schedule, modules.haptics, toast, copy.scheduledFor, copy.scheduleFailed],\n );\n\n return { open, setOpen, request, scheduleAt };\n}\n\nexport interface ChatScheduleSheetProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n /** The time chosen; the sheet closes first. */\n onSchedule: (at: Date) => void;\n /** For tests and demos. */\n now?: Date;\n testID?: string;\n}\n\nexport function ChatScheduleSheet({ open, onOpenChange, onSchedule, now, testID = \"chat-schedule\" }: ChatScheduleSheetProps) {\n const { copy } = useChatNative();\n const colors = useThemeRoles();\n const clock = now ?? new Date();\n const picks = useMemo(() => scheduleQuickPicks(now ?? new Date()), [now, open]); // eslint-disable-line react-hooks/exhaustive-deps\n const [custom, setCustom] = useState(false);\n const [at, setAt] = useState(() => defaultScheduleAt(clock));\n // Each opening starts again: the quick picks, and an hour from now for a custom time.\n useEffect(() => {\n if (!open) return;\n setCustom(false);\n setAt(defaultScheduleAt(now ?? new Date()));\n }, [open]); // eslint-disable-line react-hooks/exhaustive-deps\n const ok = isSchedulable(at, clock);\n\n const choose = (when: Date) => {\n onOpenChange(false);\n setCustom(false);\n onSchedule(when);\n };\n\n return (\n <NativeSheet\n open={open}\n onOpenChange={onOpenChange}\n testID={testID}\n >\n <View style={{ paddingVertical: 8 }}>\n <View style={{ paddingHorizontal: 16, paddingBottom: 8, gap: 4 }}>\n <NativeText preset=\"h4\" accessibilityRole=\"header\">\n {copy.scheduleTitle}\n </NativeText>\n <NativeText preset=\"caption\" style={{ color: colors.secondaryLabel }}>\n {copy.scheduleHint}\n </NativeText>\n </View>\n {custom ? (\n <View style={{ paddingHorizontal: 16, gap: 12 }} testID={`${testID}-custom`}>\n <View style={{ flexDirection: \"row\", alignItems: \"center\", justifyContent: \"space-between\", gap: 12, minHeight: 44 }}>\n <NativeText preset=\"body\">{copy.scheduleDate}</NativeText>\n <NativeDatePicker testID={`${testID}-date`} value={at} onChange={(d) => setAt((x) => withDay(x, d))} />\n </View>\n <View style={{ flexDirection: \"row\", alignItems: \"center\", justifyContent: \"space-between\", gap: 12, minHeight: 44 }}>\n <NativeText preset=\"body\">{copy.scheduleTime}</NativeText>\n <NativeTimePicker testID={`${testID}-time`} value={at} onChange={(d) => setAt((x) => withTime(x, d))} />\n </View>\n <NativeText testID={`${testID}-when`} preset=\"caption\" accessibilityLiveRegion=\"polite\" style={{ color: ok ? colors.secondaryLabel : colors.destructive }}>\n {ok ? scheduleLabel(at, clock) : copy.scheduleOutOfRange}\n </NativeText>\n <NativeButton testID={`${testID}-confirm`} onPress={() => ok && choose(at)} disabled={!ok}>\n {copy.scheduleConfirm}\n </NativeButton>\n </View>\n ) : (\n <View>\n {picks.map((p, i) => (\n <NativeListItem key={p.label} testID={`${testID}-pick-${i}`} title={p.label} leading={<NativeIcon name=\"clock\" />} onPress={() => choose(p.at)} />\n ))}\n <NativeListItem testID={`${testID}-pick-custom`} title={copy.schedulePick} leading={<NativeIcon name=\"calendar\" />} showChevron onPress={() => setCustom(true)} />\n </View>\n )}\n </View>\n </NativeSheet>\n );\n}\n\nexport interface ChatScheduledListProps {\n /** One conversation's; all of yours without it. */\n conversationId?: string | null;\n /** Names a conversation in the all-conversations list. */\n conversationTitle?: (conversationId: string) => string;\n testID?: string;\n}\n\n/** Your scheduled messages, soonest first, each with when it goes and Cancel. */\nexport function ChatScheduledList({ conversationId, conversationTitle, testID = \"chat-scheduled\" }: ChatScheduledListProps) {\n const { copy } = useChatNative();\n const toast = useToast();\n const { items, isLoading, cancel } = useScheduled(conversationId);\n if (isLoading) {\n return (\n <View testID={`${testID}-loading`} style={{ padding: 16, gap: 8 }}>\n <NativeSkeleton height={44} className=\"w-full\" />\n <NativeSkeleton height={44} className=\"w-full\" />\n </View>\n );\n }\n if (items.length === 0) return <NativeEmptyState variant=\"first-run\" title={copy.scheduledEmpty} body={copy.scheduledEmptyBody} testID={`${testID}-empty`} />;\n return (\n <View testID={testID} accessibilityLabel={copy.scheduledTitle}>\n {items.map((s) => (\n <ScheduledRow\n key={s.id}\n item={s}\n where={!conversationId && conversationTitle ? conversationTitle(s.conversationId) : null}\n onCancel={() =>\n void cancel(s.id).then(\n () => toast.show({ title: copy.scheduledCancelled, variant: \"success\", duration: 1500 }),\n () => toast.show({ title: copy.actionFailed, variant: \"destructive\" }),\n )\n }\n testID={`${testID}-item-${s.id}`}\n />\n ))}\n </View>\n );\n}\n\nfunction ScheduledRow({ item, where, onCancel, testID }: { item: ScheduledMessage; where: string | null; onCancel: () => void; testID: string }) {\n const { copy } = useChatNative();\n const colors = useThemeRoles();\n const failed = item.status === \"failed\";\n const when = failed ? copy.scheduledCouldntSend : scheduleLabel(item.sendAt);\n const text = previewText(displayBody(item.body), item.attachments[0]?.kind ?? null);\n return (\n <View testID={testID} style={{ flexDirection: \"row\", alignItems: \"center\", gap: 12, paddingLeft: 16, paddingRight: 4, paddingVertical: 8, minHeight: 56 }}>\n <NativeIcon name={failed ? \"warning\" : \"clock\"} size={18} color={failed ? colors.destructive : colors.secondaryLabel} />\n <View style={{ flex: 1, gap: 2 }} accessible accessibilityLabel={[when, where, text, item.error].filter(Boolean).join(\", \")}>\n <NativeText preset=\"caption\" style={{ color: failed ? colors.destructive : colors.secondaryLabel, fontWeight: \"600\" }}>\n {where ? `${when} · ${where}` : when}\n </NativeText>\n <NativeText preset=\"body-sm\" numberOfLines={2}>\n {text}\n </NativeText>\n {item.error ? (\n <NativeText preset=\"caption\" style={{ color: colors.destructive }}>\n {item.error}\n </NativeText>\n ) : null}\n </View>\n {item.status === \"scheduled\" || failed ? (\n // A failed one can't be sent again, but it can be removed (cancel_scheduled takes it).\n <Pressable\n testID={`${testID}-cancel`}\n accessibilityRole=\"button\"\n accessibilityLabel={failed ? `${copy.scheduledRemove}, ${text}` : `${copy.scheduledCancel}, ${fill(copy.scheduledFor, { when })}`}\n onPress={onCancel}\n style={{ minHeight: 44, minWidth: 44, paddingHorizontal: 12, alignItems: \"center\", justifyContent: \"center\" }}\n >\n <NativeText preset=\"label\" style={{ color: colors.destructive }}>\n {failed ? copy.scheduledRemove : copy.scheduledCancel}\n </NativeText>\n </Pressable>\n ) : null}\n </View>\n );\n}\n\nexport interface ChatScheduledBarProps {\n conversationId: string;\n testID?: string;\n}\n\n/** \"2 scheduled messages\" over the composer when there are any, opening their list. */\nexport function ChatScheduledBar({ conversationId, testID = \"chat-scheduled-bar\" }: ChatScheduledBarProps) {\n const { copy } = useChatNative();\n const colors = useThemeRoles();\n const { items } = useScheduled(conversationId);\n const [open, setOpen] = useState(false);\n if (items.length === 0) return null;\n const label = items.length === 1 ? copy.scheduledCountOne : fill(copy.scheduledCount, { count: items.length });\n return (\n <>\n <Pressable\n testID={testID}\n accessibilityRole=\"button\"\n accessibilityLabel={label}\n onPress={() => setOpen(true)}\n style={{ flexDirection: \"row\", alignItems: \"center\", gap: 6, minHeight: 44, paddingHorizontal: 16, backgroundColor: colors.groupedBackground }}\n >\n <NativeIcon name=\"clock\" size={15} color={colors.secondaryLabel} />\n <NativeText preset=\"caption\" style={{ color: colors.secondaryLabel, fontWeight: \"600\" }}>\n {label}\n </NativeText>\n </Pressable>\n <NativeSheet open={open} onOpenChange={setOpen} testID={`${testID}-sheet`}>\n <View style={{ paddingVertical: 8 }}>\n <NativeText preset=\"h4\" accessibilityRole=\"header\" style={{ paddingHorizontal: 16, paddingBottom: 4 }}>\n {copy.scheduledTitle}\n </NativeText>\n <ChatScheduledList conversationId={conversationId} testID={`${testID}-list`} />\n </View>\n </NativeSheet>\n </>\n );\n}\n","/**\n * @feat:chat\n * Availability on native. `useAwayLine` and `ChatAwayLine`: the line a thread shows under its\n * header when the other person is away or outside their hours (\"Mark replies Mon–Fri, 9–5\n * (Eastern)\", \"Away until Monday: Back Monday\"; in a group, \"Sam and Lee are away\"), refreshed\n * each minute so it comes and goes with their hours. `ChatAvailabilityScreen`: your own away\n * message and its end, working hours per weekday and the time zone they're read in, for a\n * Settings route. The same rules as the web's `ChatAwayBanner` and `ChatAvailabilitySettings`.\n */\nimport { useEffect, useMemo, useState, type ReactNode } from \"react\";\nimport { View } from \"react-native\";\nimport {\n NativeButton,\n NativeCombobox,\n NativeDatePicker,\n NativeIcon,\n NativeSwitch,\n NativeText,\n NativeTextarea,\n NativeTimePicker,\n useToast,\n} from \"@marktiderman/genesis-ui-native/components\";\nimport { SettingsSubPage } from \"@marktiderman/genesis-ui-native/layouts\";\nimport { useThemeRoles } from \"@marktiderman/genesis-ui-native/hooks\";\nimport { WEEKDAYS, awaySummary, minutesOf } from \"../core/availability\";\nimport type { AvailabilityInput, ChatAvailability, ChatMember, Weekday, WorkingHours } from \"../core/types\";\nimport { useAvailability } from \"../react/index\";\nimport { fill } from \"./copy\";\nimport { useChatNative } from \"./context\";\nimport { withDay, withTime } from \"./schedule-sheet\";\n\n/** Ticks once a minute, so a line that depends on the clock keeps up with it. */\nfunction useMinute(): Date {\n const [now, setNow] = useState(() => new Date());\n useEffect(() => {\n const t = setInterval(() => setNow(new Date()), 60_000);\n return () => clearInterval(t);\n }, []);\n return now;\n}\n\n/**\n * The away line for a conversation, or null when everyone is around: the other person in a\n * two-person conversation; in a group, everyone (but you) away or outside their hours.\n */\nexport function awayLineFor(\n members: readonly Pick<ChatMember, \"userId\" | \"role\">[],\n me: string,\n forUser: (userId: string) => ChatAvailability | null,\n nameOf: (userId: string) => string,\n now: Date = new Date(),\n): string | null {\n const ids = members.filter((m) => m.userId !== me && m.role !== \"observer\").map((m) => m.userId);\n const people = ids.flatMap((id) => {\n const a = forUser(id);\n return a ? [{ availability: a, name: nameOf(id) }] : [];\n });\n return awaySummary(people, { now });\n}\n\n/** `awayLineFor` over the conversation's members, live (`useAvailability`), re-read each minute. */\nexport function useAwayLine(conversationId: string | null | undefined, members: readonly Pick<ChatMember, \"userId\" | \"role\">[], me: string, nameOf: (userId: string) => string): string | null {\n const { forUser, members: list } = useAvailability(conversationId);\n const now = useMinute();\n return useMemo(() => (list.length ? awayLineFor(members, me, forUser, nameOf, now) : null), [list, members, me, forUser, nameOf, now]);\n}\n\nexport interface ChatAwayLineProps {\n text: string | null;\n testID?: string;\n}\n\n/** The away line, as a quiet strip under the header; nothing when `text` is null. */\nexport function ChatAwayLine({ text, testID = \"chat-away-line\" }: ChatAwayLineProps) {\n const colors = useThemeRoles();\n if (!text) return null;\n return (\n <View\n testID={testID}\n accessible\n accessibilityRole=\"text\"\n accessibilityLabel={text}\n accessibilityLiveRegion=\"polite\"\n style={{ flexDirection: \"row\", alignItems: \"center\", gap: 8, paddingHorizontal: 16, paddingVertical: 8, backgroundColor: colors.fill }}\n >\n <NativeIcon name=\"clock\" size={15} color={colors.secondaryLabel} />\n <NativeText preset=\"caption\" style={{ flex: 1, color: colors.secondaryLabel }}>\n {text}\n </NativeText>\n </View>\n );\n}\n\n// ── Your availability ─────────────────────────────────────────────────────────\n\nexport interface DayHours {\n on: boolean;\n from: string;\n to: string;\n}\n\nexport type WeekHours = Record<Weekday, DayHours>;\n\n/** Monday to Friday, 9 to 5: where a first setup starts. */\nexport function defaultWeek(): WeekHours {\n return Object.fromEntries(WEEKDAYS.map((d) => [d, { on: d !== \"sat\" && d !== \"sun\", from: \"09:00\", to: \"17:00\" }])) as WeekHours;\n}\n\n/** Each day's first range from saved hours (a day with none is off). */\nexport function weekFromHours(hours: WorkingHours | null | undefined): WeekHours {\n if (!hours) return defaultWeek();\n return Object.fromEntries(\n WEEKDAYS.map((d) => {\n const first = hours[d]?.[0];\n return [d, first ? { on: true, from: first[0], to: first[1] } : { on: false, from: \"09:00\", to: \"17:00\" }];\n }),\n ) as WeekHours;\n}\n\n/** The hours to save: each day that's on, its range first, then any extra ranges saved elsewhere. */\nexport function hoursFromWeek(week: WeekHours, saved: WorkingHours | null | undefined): WorkingHours {\n return Object.fromEntries(\n WEEKDAYS.filter((d) => week[d].on).map((d) => [d, [[week[d].from, week[d].to] as [string, string], ...(saved?.[d] ?? []).slice(1)]]),\n );\n}\n\n/** A day that's on with the same start and end (the database refuses it). */\nexport function sameTimeDays(week: WeekHours): Weekday[] {\n return WEEKDAYS.filter((d) => week[d].on && week[d].from === week[d].to);\n}\n\n/** \"09:30\" as a Date today at that time (for a time picker), and back. */\nexport function clockToDate(hhmm: string, base: Date = new Date()): Date {\n const m = minutesOf(hhmm) ?? 9 * 60;\n const d = new Date(base);\n d.setHours(Math.floor(m / 60) % 24, m % 60, 0, 0);\n return d;\n}\nexport function dateToClock(d: Date): string {\n return `${String(d.getHours()).padStart(2, \"0\")}:${String(d.getMinutes()).padStart(2, \"0\")}`;\n}\n\nexport interface AvailabilityForm {\n message: string;\n until: Date | null;\n zone: string;\n useHours: boolean;\n week: WeekHours;\n}\n\nexport function formFrom(mine: ChatAvailability | null, deviceZone: string): AvailabilityForm {\n return {\n message: mine?.awayMessage ?? \"\",\n until: mine?.awayUntil ? new Date(mine.awayUntil) : null,\n zone: mine?.timeZone ?? deviceZone,\n useHours: Boolean(mine?.hours && Object.keys(mine.hours).length),\n week: weekFromHours(mine?.hours),\n };\n}\n\n/** What `setAvailability` gets from the form. */\nexport function availabilityInput(form: AvailabilityForm, saved: ChatAvailability | null): AvailabilityInput {\n return {\n awayMessage: form.message.trim() || null,\n awayUntil: form.until ? form.until.toISOString() : null,\n timeZone: form.zone,\n hours: form.useHours ? hoursFromWeek(form.week, saved?.hours) : null,\n };\n}\n\nconst FALLBACK_ZONES = [\n \"UTC\", \"America/New_York\", \"America/Chicago\", \"America/Denver\", \"America/Los_Angeles\", \"America/Toronto\", \"America/Sao_Paulo\",\n \"Europe/London\", \"Europe/Paris\", \"Europe/Berlin\", \"Africa/Johannesburg\", \"Asia/Dubai\", \"Asia/Kolkata\", \"Asia/Singapore\",\n \"Asia/Tokyo\", \"Australia/Sydney\", \"Pacific/Auckland\",\n];\n\n/** Every IANA zone the engine knows (Hermes has `Intl.supportedValuesOf`), else a short list. */\nexport function timeZones(): string[] {\n const intl = Intl as unknown as { supportedValuesOf?: (key: string) => string[] };\n try {\n const all = intl.supportedValuesOf?.(\"timeZone\");\n if (all?.length) return all.includes(\"UTC\") ? all : [\"UTC\", ...all];\n } catch {\n // an older engine\n }\n return FALLBACK_ZONES;\n}\n\nexport function deviceTimeZone(): string {\n try {\n return Intl.DateTimeFormat().resolvedOptions().timeZone || \"UTC\";\n } catch {\n return \"UTC\";\n }\n}\n\nconst DAY_NAMES: Record<Weekday, string> = { mon: \"Monday\", tue: \"Tuesday\", wed: \"Wednesday\", thu: \"Thursday\", fri: \"Friday\", sat: \"Saturday\", sun: \"Sunday\" };\n\n/** A weekday's name in the device's language (`mon` → \"Monday\"). */\nfunction dayName(d: Weekday, locale?: string): string {\n // 2024-01-01 was a Monday.\n const date = new Date(2024, 0, 1 + WEEKDAYS.indexOf(d));\n try {\n return date.toLocaleDateString(locale, { weekday: \"long\" });\n } catch {\n return DAY_NAMES[d];\n }\n}\n\nexport interface ChatAvailabilityScreenProps {\n /** Called after a save (go back, say). */\n onSaved?: () => void;\n testID?: string;\n}\n\n/**\n * Your availability, as a Settings sub-page: an away message and, optionally, until when;\n * working hours per weekday (one range a day here; extra ranges saved elsewhere are kept for\n * the days you don't turn off); the time zone they're read in. Save at the bottom.\n */\nexport function ChatAvailabilityScreen({ onSaved, testID = \"chat-availability\" }: ChatAvailabilityScreenProps) {\n const { copy } = useChatNative();\n const colors = useThemeRoles();\n const toast = useToast();\n const { mine, mineLoading, setMine } = useAvailability();\n const zones = useMemo(() => timeZones(), []);\n const [form, setForm] = useState<AvailabilityForm>(() => formFrom(null, deviceTimeZone()));\n const [loaded, setLoaded] = useState(false);\n const [busy, setBusy] = useState(false);\n\n useEffect(() => {\n if (mineLoading || loaded) return;\n setForm(formFrom(mine, deviceTimeZone()));\n setLoaded(true);\n }, [mine, mineLoading, loaded]);\n\n const zoneOptions = useMemo(() => {\n const list = zones.includes(form.zone) ? zones : [form.zone, ...zones];\n return list.map((z) => ({ value: z, label: z.replace(/_/g, \" \") }));\n }, [zones, form.zone]);\n\n // A moment while yours is read (cached after the first time): the form fills in once it's here.\n if (mineLoading || !loaded) {\n return (\n <SettingsSubPage testID={testID}>\n <View testID={`${testID}-loading`} accessibilityState={{ busy: true }} />\n </SettingsSubPage>\n );\n }\n\n const bad = form.useHours ? sameTimeDays(form.week) : [];\n const set = (patch: Partial<AvailabilityForm>) => setForm((f) => ({ ...f, ...patch }));\n const setDay = (d: Weekday, patch: Partial<DayHours>) => setForm((f) => ({ ...f, week: { ...f.week, [d]: { ...f.week[d], ...patch } } }));\n\n const save = async () => {\n if (bad.length) return;\n setBusy(true);\n try {\n await setMine(availabilityInput(form, mine));\n toast.show({ title: copy.availabilitySaved, variant: \"success\", duration: 1500 });\n onSaved?.();\n } catch (e) {\n toast.show({ title: e instanceof Error ? e.message : copy.actionFailed, variant: \"destructive\" });\n } finally {\n setBusy(false);\n }\n };\n\n const tomorrow = () => {\n const d = new Date();\n d.setDate(d.getDate() + 1);\n d.setHours(9, 0, 0, 0);\n return d;\n };\n\n return (\n <SettingsSubPage testID={testID}>\n <View style={{ gap: 8 }}>\n <Section title={copy.awayMessage} />\n <NativeTextarea\n testID={`${testID}-message`}\n accessibilityLabel={copy.awayMessage}\n value={form.message}\n onChangeText={(message) => set({ message })}\n maxLength={280}\n placeholder={copy.awayMessagePlaceholder}\n rows={3}\n />\n <Row label={copy.awayUntilOn}>\n <NativeSwitch testID={`${testID}-until-on`} accessibilityLabel={copy.awayUntilOn} checked={form.until !== null} onCheckedChange={(on) => set({ until: on ? tomorrow() : null })} />\n </Row>\n {form.until ? (\n <Row label={copy.awayUntil}>\n <View style={{ flexDirection: \"row\", gap: 8 }}>\n <NativeDatePicker testID={`${testID}-until-date`} value={form.until} onChange={(d) => set({ until: withDay(form.until!, d) })} />\n <NativeTimePicker testID={`${testID}-until-time`} value={form.until} onChange={(d) => set({ until: withTime(form.until!, d) })} />\n </View>\n </Row>\n ) : null}\n {form.message || form.until ? (\n <View style={{ alignItems: \"flex-start\" }}>\n <NativeButton testID={`${testID}-back`} variant=\"ghost\" onPress={() => set({ message: \"\", until: null })}>\n {copy.imBack}\n </NativeButton>\n </View>\n ) : null}\n </View>\n\n <View style={{ gap: 8 }}>\n <Section title={copy.workingHours} />\n <Row label={copy.workingHoursOn}>\n <NativeSwitch testID={`${testID}-hours-on`} accessibilityLabel={copy.workingHoursOn} checked={form.useHours} onCheckedChange={(useHours) => set({ useHours })} />\n </Row>\n {form.useHours ? (\n <View accessibilityLabel={copy.workingHours} style={{ gap: 4 }}>\n {WEEKDAYS.map((d) => {\n const name = dayName(d);\n const day = form.week[d];\n return (\n <View key={d} testID={`${testID}-day-${d}`} style={{ flexDirection: \"row\", flexWrap: \"wrap\", alignItems: \"center\", gap: 8, minHeight: 44 }}>\n <NativeSwitch testID={`${testID}-day-${d}-on`} accessibilityLabel={fill(copy.workingDay, { name })} checked={day.on} onCheckedChange={(on) => setDay(d, { on })} />\n <NativeText preset=\"body\" style={{ minWidth: 96, color: day.on ? colors.label : colors.secondaryLabel }}>\n {name}\n </NativeText>\n {day.on ? (\n <View style={{ flexDirection: \"row\", alignItems: \"center\", gap: 4 }}>\n <NativeTimePicker testID={`${testID}-day-${d}-from`} value={clockToDate(day.from)} onChange={(t) => setDay(d, { from: dateToClock(t) })} />\n <NativeText accessibilityElementsHidden importantForAccessibility=\"no\">–</NativeText>\n <NativeTimePicker testID={`${testID}-day-${d}-to`} value={clockToDate(day.to)} onChange={(t) => setDay(d, { to: dateToClock(t) })} />\n </View>\n ) : (\n <NativeText preset=\"caption\" style={{ color: colors.secondaryLabel }}>\n {copy.notWorking}\n </NativeText>\n )}\n </View>\n );\n })}\n <NativeText testID={`${testID}-hours-hint`} preset=\"caption\" accessibilityLiveRegion=\"polite\" style={{ color: bad.length ? colors.destructive : colors.secondaryLabel }}>\n {bad.length ? copy.hoursSameTime : copy.workingHoursHint}\n </NativeText>\n </View>\n ) : null}\n </View>\n\n <View style={{ gap: 8 }}>\n <Section title={copy.timeZone} />\n <NativeCombobox testID={`${testID}-zone`} options={zoneOptions} value={form.zone} onChange={(zone) => set({ zone })} placeholder={copy.timeZoneSearch} />\n </View>\n\n <NativeButton testID={`${testID}-save`} onPress={() => void save()} loading={busy} disabled={bad.length > 0}>\n {copy.availabilitySave}\n </NativeButton>\n </SettingsSubPage>\n );\n}\n\nfunction Section({ title }: { title: string }) {\n const colors = useThemeRoles();\n return (\n <NativeText preset=\"label\" accessibilityRole=\"header\" style={{ color: colors.secondaryLabel, textTransform: \"uppercase\", letterSpacing: 0.5, marginTop: 8 }}>\n {title}\n </NativeText>\n );\n}\n\nfunction Row({ label, children }: { label: string; children: ReactNode }) {\n return (\n <View style={{ flexDirection: \"row\", flexWrap: \"wrap\", alignItems: \"center\", justifyContent: \"space-between\", gap: 8, minHeight: 44 }}>\n <NativeText preset=\"body\" style={{ flexShrink: 1 }}>\n {label}\n </NativeText>\n {children}\n </View>\n );\n}\n","/**\n * @feat:chat\n * A 44-point icon button (a header's Search, the topic bar's options): genesis-ui-native's\n * NativeIcon in a Pressable with its label, for VoiceOver and TalkBack.\n */\nimport { Pressable } from \"react-native\";\nimport { NativeIcon, type NativeIconName } from \"@marktiderman/genesis-ui-native/components\";\nimport { useThemeRoles } from \"@marktiderman/genesis-ui-native/hooks\";\n\nexport interface ChatIconButtonProps {\n icon: NativeIconName;\n /** Read by screen readers (the button has no text). */\n label: string;\n onPress: () => void;\n onLongPress?: () => void;\n disabled?: boolean;\n /** The theme's tint by default. */\n color?: unknown;\n size?: number;\n testID?: string;\n}\n\nexport function ChatIconButton({ icon, label, onPress, onLongPress, disabled = false, color, size = 22, testID }: ChatIconButtonProps) {\n const colors = useThemeRoles();\n return (\n <Pressable\n testID={testID}\n accessibilityRole=\"button\"\n accessibilityLabel={label}\n accessibilityState={{ disabled }}\n disabled={disabled}\n onPress={onPress}\n onLongPress={onLongPress}\n hitSlop={4}\n style={{ minWidth: 44, minHeight: 44, alignItems: \"center\", justifyContent: \"center\", opacity: disabled ? 0.4 : 1 }}\n >\n <NativeIcon name={icon} size={size} color={(color ?? colors.tint) as string} />\n </Pressable>\n );\n}\n","/**\n * @feat:chat\n * The topic bar on native: \"All\" and each of a conversation's topics as single-choice chips in a\n * row that scrolls sideways, a lock on closed ones, and, for owners and admins, an options button\n * that adds a topic and renames, closes or reopens the one shown (one sheet: the menu, then the\n * name field). `ChatThreadScreen` shows it when the conversation has topics, and reads the\n * messages of the topic chosen. The same rules as the web's `ChatTopicBar`.\n */\nimport { useState } from \"react\";\nimport { ScrollView, View } from \"react-native\";\nimport { NativeButton, NativeChip, NativeChipGroup, NativeIcon, NativeInput, NativeListItem, NativeSheet, NativeText, useToast } from \"@marktiderman/genesis-ui-native/components\";\nimport { useThemeRoles } from \"@marktiderman/genesis-ui-native/hooks\";\nimport { topicKey } from \"../core/extras\";\nimport type { ChatRole, ChatTopic, TopicInput } from \"../core/types\";\nimport { fill } from \"./copy\";\nimport { useChatNative } from \"./context\";\nimport { ChatIconButton } from \"./icon-button\";\n\nconst ALL = \"__all__\";\n\n/** Owners and admins add, rename, close and reopen topics. */\nexport function canManageTopics(role: ChatRole | null | undefined): boolean {\n return role === \"owner\" || role === \"admin\";\n}\n\n/** A closed topic takes posts only from owners, admins and observers. */\nexport function topicClosedFor(topic: ChatTopic | null | undefined, role: ChatRole | null | undefined): boolean {\n return Boolean(topic?.closedAt) && role !== \"owner\" && role !== \"admin\" && role !== \"observer\";\n}\n\nexport type TopicMenuAction = \"new\" | \"rename\" | \"close\" | \"reopen\";\n\n/** What the options sheet offers: always New; Rename and Close or Reopen when a topic is shown. */\nexport function topicMenuFor(current: ChatTopic | null | undefined): TopicMenuAction[] {\n if (!current) return [\"new\"];\n return [\"new\", \"rename\", current.closedAt ? \"reopen\" : \"close\"];\n}\n\n/**\n * Checks a topic's name: its key, or why it can't be saved. Renaming keeps the key (messages\n * carry it), so only a new topic can clash with another's key.\n */\nexport function checkTopicName(title: string, topics: readonly ChatTopic[], renaming?: string | null): { key: string } | { error: \"empty\" | \"exists\" } {\n const name = title.trim();\n if (!name) return { error: \"empty\" };\n if (renaming) return { key: renaming };\n const key = topicKey(name);\n return topics.some((t) => t.topic === key) ? { error: \"exists\" } : { key };\n}\n\nexport interface ChatTopicBarProps {\n topics: ChatTopic[];\n /** The topic shown; null for \"All\". */\n value: string | null;\n onValueChange: (topic: string | null) => void;\n /** Owners and admins (`canManageTopics(role)`): the options button. */\n canManage?: boolean;\n /** Saves a topic (`useTopics().setTopic`). */\n onSetTopic?: (topic: string, input: TopicInput) => Promise<void>;\n testID?: string;\n}\n\ntype SheetState = { step: \"menu\" } | { step: \"name\"; renaming: string | null };\n\nexport function ChatTopicBar({ topics, value, onValueChange, canManage = false, onSetTopic, testID = \"chat-topics\" }: ChatTopicBarProps) {\n const { copy } = useChatNative();\n const colors = useThemeRoles();\n const toast = useToast();\n const [sheet, setSheet] = useState<SheetState | null>(null);\n const [title, setTitle] = useState(\"\");\n const [busy, setBusy] = useState(false);\n const [error, setError] = useState<string | null>(null);\n const current = value ? (topics.find((t) => t.topic === value) ?? null) : null;\n\n const close = () => {\n if (busy) return;\n setSheet(null);\n setError(null);\n };\n\n const run = async (action: TopicMenuAction) => {\n if (action === \"new\" || action === \"rename\") {\n setTitle(action === \"rename\" ? (current?.title ?? \"\") : \"\");\n setError(null);\n setSheet({ step: \"name\", renaming: action === \"rename\" ? (current?.topic ?? null) : null });\n return;\n }\n if (!current || !onSetTopic) return;\n setSheet(null);\n try {\n await onSetTopic(current.topic, { closed: action === \"close\" });\n toast.show({ title: fill(action === \"close\" ? copy.topicClosedDone : copy.topicReopenedDone, { name: current.title }), variant: \"success\", duration: 1500 });\n } catch (e) {\n toast.show({ title: e instanceof Error ? e.message : copy.actionFailed, variant: \"destructive\" });\n }\n };\n\n const save = async (renaming: string | null) => {\n if (!onSetTopic) return;\n const checked = checkTopicName(title, topics, renaming);\n if (\"error\" in checked) {\n setError(checked.error === \"exists\" ? copy.topicExists : null);\n return;\n }\n setBusy(true);\n try {\n await onSetTopic(checked.key, renaming ? { title: title.trim() } : { title: title.trim(), position: topics.length });\n setSheet(null);\n setTitle(\"\");\n if (!renaming) onValueChange(checked.key);\n } catch (e) {\n setError(e instanceof Error ? e.message : copy.actionFailed);\n } finally {\n setBusy(false);\n }\n };\n\n return (\n <View testID={testID} style={{ flexDirection: \"row\", alignItems: \"center\", backgroundColor: colors.groupedBackground, paddingLeft: 8 }}>\n <ScrollView horizontal showsHorizontalScrollIndicator={false} accessibilityLabel={copy.topics} contentContainerStyle={{ paddingVertical: 4, paddingRight: 8 }} style={{ flex: 1 }}>\n <NativeChipGroup mode=\"single\" value={value ?? ALL} onChange={(v) => onValueChange(v === ALL ? null : (v as string))} className=\"flex-nowrap\" testID={`${testID}-group`}>\n <NativeChip value={ALL} testID={`${testID}-all`}>\n {copy.topicAll}\n </NativeChip>\n {topics.map((t) => (\n <NativeChip key={t.topic} value={t.topic} testID={`${testID}-${t.topic}`}>\n <View style={{ flexDirection: \"row\", alignItems: \"center\", gap: 4 }}>\n {t.closedAt ? <NativeIcon name=\"lock\" size={13} color={colors.secondaryLabel} label={copy.topicClosed} /> : null}\n <NativeText preset=\"body-sm\" numberOfLines={1} style={{ maxWidth: 180, fontWeight: value === t.topic ? \"600\" : \"400\", color: value === t.topic ? colors.tint : colors.label }}>\n {t.title}\n </NativeText>\n </View>\n </NativeChip>\n ))}\n </NativeChipGroup>\n </ScrollView>\n {canManage && onSetTopic ? <ChatIconButton testID={`${testID}-menu`} icon=\"more\" label={copy.topicOptions} onPress={() => setSheet({ step: \"menu\" })} /> : null}\n <NativeSheet open={sheet !== null} onOpenChange={(o) => (o ? undefined : close())} testID={`${testID}-sheet`}>\n {sheet?.step === \"name\" ? (\n <View style={{ padding: 16, gap: 12 }}>\n <NativeText preset=\"h4\" accessibilityRole=\"header\">\n {sheet.renaming ? copy.topicRename : copy.topicNew}\n </NativeText>\n <NativeInput\n testID={`${testID}-name`}\n label={copy.topicName}\n value={title}\n onChangeText={(v) => {\n setTitle(v);\n setError(null);\n }}\n placeholder={copy.topicNamePlaceholder}\n maxLength={160}\n autoFocus\n returnKeyType=\"done\"\n onSubmitEditing={() => void save(sheet.renaming)}\n error={error ?? undefined}\n />\n <NativeButton testID={`${testID}-save`} onPress={() => void save(sheet.renaming)} loading={busy} disabled={!title.trim()}>\n {sheet.renaming ? copy.topicSave : copy.topicAdd}\n </NativeButton>\n </View>\n ) : (\n <View>\n {topicMenuFor(current).map((action) => (\n <NativeListItem\n key={action}\n testID={`${testID}-${action}`}\n title={action === \"new\" ? copy.topicNew : action === \"rename\" ? copy.topicRename : action === \"close\" ? copy.topicClose : copy.topicReopen}\n leading={<NativeIcon name={action === \"new\" ? \"plus\" : action === \"rename\" ? \"edit\" : \"lock\"} />}\n onPress={() => void run(action)}\n />\n ))}\n </View>\n )}\n </NativeSheet>\n </View>\n );\n}\n","/**\n * @feat:chat\n * Going to one message in a thread (a search result, a pinned message): earlier pages load until\n * it is held (`useConversation().loadUntil(seq)`), then the list scrolls to it and it is\n * highlighted for two seconds. A message that can't be found (deleted, or out of reach) says so.\n */\nimport { useCallback, useEffect, useRef, useState } from \"react\";\nimport type { ThreadRow } from \"./rows\";\n\nexport interface JumpTarget {\n messageId: string;\n seq?: number;\n}\n\n/** The row a message is drawn in, or -1. */\nexport function rowIndexOf(rows: readonly ThreadRow[], messageId: string): number {\n return rows.findIndex((r) => r.type === \"message\" && r.item.type === \"message\" && r.item.message.id === messageId);\n}\n\nexport interface UseJumpOptions {\n /** What to go to; a new target (another id or seq) starts again. */\n target: JumpTarget | null | undefined;\n rows: readonly ThreadRow[];\n /** The thread's first page is still loading. */\n loading: boolean;\n has: (messageId: string) => boolean;\n loadUntil: (seq: number) => Promise<boolean>;\n /** Scroll the list to this row (centred); the message id, for a retry once rows have moved. */\n scrollTo: (index: number, messageId: string) => void;\n /** Called before loading or scrolling (stop following the bottom). */\n onStart?: () => void;\n /** It was scrolled to (say so to VoiceOver). */\n onLanded?: (messageId: string) => void;\n /** It isn't there any more (go back to where the thread was). */\n onGone: () => void;\n onError: (e: unknown) => void;\n}\n\ntype Pending = JumpTarget & { phase: \"new\" | \"loading\" | \"loaded\" };\n\nexport function useJumpToMessage({ target, rows, loading, has, loadUntil, scrollTo, onStart, onLanded, onGone, onError }: UseJumpOptions) {\n const [pending, setPending] = useState<Pending | null>(target ? { ...target, phase: \"new\" } : null);\n const [highlightedId, setHighlightedId] = useState<string | null>(null);\n useEffect(() => {\n if (target) setPending({ ...target, phase: \"new\" });\n }, [target?.messageId, target?.seq]); // eslint-disable-line react-hooks/exhaustive-deps\n\n const latest = useRef({ rows, scrollTo, onStart, onLanded, onGone, onError });\n latest.current = { rows, scrollTo, onStart, onLanded, onGone, onError };\n const timer = useRef<ReturnType<typeof setTimeout> | null>(null);\n useEffect(() => () => {\n if (timer.current) clearTimeout(timer.current);\n }, []);\n\n const go = useCallback((messageId: string) => {\n const index = rowIndexOf(latest.current.rows, messageId);\n if (index < 0) return;\n latest.current.onStart?.();\n latest.current.scrollTo(index, messageId);\n latest.current.onLanded?.(messageId);\n setHighlightedId(messageId);\n if (timer.current) clearTimeout(timer.current);\n timer.current = setTimeout(() => setHighlightedId((h) => (h === messageId ? null : h)), 2000);\n }, []);\n\n useEffect(() => {\n if (!pending || loading) return;\n const { messageId, seq, phase } = pending;\n if (has(messageId)) {\n setPending(null);\n go(messageId);\n return;\n }\n if (phase === \"loading\") return;\n if (phase === \"loaded\" || seq == null) {\n setPending(null);\n latest.current.onGone();\n return;\n }\n latest.current.onStart?.();\n setPending({ messageId, seq, phase: \"loading\" });\n const settle = () => setPending((p) => (p && p.messageId === messageId ? { ...p, phase: \"loaded\" } : p));\n void loadUntil(seq).then(settle, (e) => {\n latest.current.onError(e);\n // Not found after all: the \"loaded\" step says so and puts the thread back.\n settle();\n });\n }, [pending, loading, has, loadUntil, go]);\n\n return { highlightedId, jumping: pending !== null };\n}\n","/**\n * @feat:chat\n * Generated by scripts/build-emoji-data.mjs from emojibase-data 16.0.3 (MIT,\n * https://github.com/milesj/emojibase). Don't edit: run the script.\n *\n * Each group is one string, a line per emoji: the emoji, its label and its search tags,\n * separated by tabs. Bundled, never fetched.\n */\nexport const EMOJI_DATA_SOURCE = \"emojibase-data@16.0.3, Emoji 15.0 and earlier\";\n\nexport const EMOJI_GROUP_DATA = {\n smileys: \"😀\\tgrinning face\\tcheerful cheery grin\\n😃\\tgrinning face with big eyes\\tawesome grin happy\\n😄\\tgrinning face with smiling eyes\\teye grin happy\\n😁\\tbeaming face with smiling eyes\\teye grin grinning\\n😆\\tgrinning squinting face\\tclosed eyes haha\\n😅\\tgrinning face with sweat\\tcold dejected excited\\n🤣\\trolling on the floor laughing\\tcrying face funny\\n😂\\tface with tears of joy\\tcrying feels funny\\n🙂\\tslightly smiling face\\thappy smile\\n🙃\\tupside-down face\\thehe smile upside-down\\n🫠\\tmelting face\\tdisappear dissolve embarrassed\\n😉\\twinking face\\tflirt heartbreaker sexy\\n😊\\tsmiling face with smiling eyes\\tblush eye glad\\n😇\\tsmiling face with halo\\tangel angelic angels\\n🥰\\tsmiling face with hearts\\t3 adore crush\\n😍\\tsmiling face with heart-eyes\\t143 bae eye\\n🤩\\tstar-struck\\texcited eyes face\\n😘\\tface blowing a kiss\\tadorbs bae flirt\\n😗\\tkissing face\\t143 date dating\\n☺️\\tsmiling face\\thappy outlined relaxed\\n😚\\tkissing face with closed eyes\\t143 bae blush\\n😙\\tkissing face with smiling eyes\\t143 closed date\\n🥲\\tsmiling face with tear\\tglad grateful happy\\n😋\\tface savoring food\\tdelicious eat full\\n😛\\tface with tongue\\tawesome cool nice\\n😜\\twinking face with tongue\\tcrazy epic eye\\n🤪\\tzany face\\tcrazy eye eyes\\n😝\\tsquinting face with tongue\\tclosed eye eyes\\n🤑\\tmoney-mouth face\\tmoney-mouth paid\\n🤗\\tsmiling face with open hands\\thug hugging\\n🤭\\tface with hand over mouth\\tgiggle giggling oops\\n🫢\\tface with open eyes and hand over mouth\\tamazement awe disbelief\\n🫣\\tface with peeking eye\\tcaptivated embarrass hide\\n🤫\\tshushing face\\tquiet shh shush\\n🤔\\tthinking face\\tchin consider hmm\\n🫡\\tsaluting face\\tgood luck ma’am\\n🤐\\tzipper-mouth face\\tkeep quiet secret\\n🤨\\tface with raised eyebrow\\tdisapproval disbelief distrust\\n😐\\tneutral face\\tawkward blank deadpan\\n😑\\texpressionless face\\tawkward dead fine\\n😶\\tface without mouth\\tawkward blank expressionless\\n🫥\\tdotted line face\\tdepressed disappear hidden\\n😶🌫️\\tface in clouds\\tabsentminded fog head\\n😏\\tsmirking face\\tboss dapper flirt\\n😒\\tunamused face\\t... bored fine\\n🙄\\tface with rolling eyes\\teyeroll shade ugh\\n😬\\tgrimacing face\\tawk awkward dentist\\n😮💨\\tface exhaling\\tblow blowing exhale\\n🤥\\tlying face\\tliar lie pinocchio\\n🫨\\tshaking face\\tcrazy daze earthquake\\n😌\\trelieved face\\tcalm peace relief\\n😔\\tpensive face\\tawful bored dejected\\n😪\\tsleepy face\\tcrying good night\\n🤤\\tdrooling face\\t\\n😴\\tsleeping face\\tbed bedtime good\\n😷\\tface with medical mask\\tcold dentist dermatologist\\n🤒\\tface with thermometer\\till sick\\n🤕\\tface with head-bandage\\thead-bandage hurt injury\\n🤢\\tnauseated face\\tgross nasty sick\\n🤮\\tface vomiting\\tbarf ew gross\\n🤧\\tsneezing face\\tfever flu gesundheit\\n🥵\\thot face\\tdying feverish heat\\n🥶\\tcold face\\tblue blue-faced freezing\\n🥴\\twoozy face\\tdizzy drunk eyes\\n😵\\tface with crossed-out eyes\\tcrossed-out dead dizzy\\n😵💫\\tface with spiral eyes\\tconfused dizzy hypnotized\\n🤯\\texploding head\\tblown explode mind\\n🤠\\tcowboy hat face\\tcowgirl\\n🥳\\tpartying face\\tbday birthday celebrate\\n🥸\\tdisguised face\\tdisguise eyebrow glasses\\n😎\\tsmiling face with sunglasses\\tawesome beach bright\\n🤓\\tnerd face\\tbrainy clever expert\\n🧐\\tface with monocle\\tclassy fancy rich\\n😕\\tconfused face\\tbefuddled confusing dunno\\n🫤\\tface with diagonal mouth\\tconfused confusion disappointed\\n😟\\tworried face\\tanxious butterflies nerves\\n🙁\\tslightly frowning face\\tfrown sad\\n☹️\\tfrowning face\\tfrown sad\\n😮\\tface with open mouth\\tbelieve forgot omg\\n😯\\thushed face\\tepic omg stunned\\n😲\\tastonished face\\tcost no omg\\n😳\\tflushed face\\tamazed awkward crazy\\n🥺\\tpleading face\\tbegging big eyes\\n🥹\\tface holding back tears\\tadmiration aww cry\\n😦\\tfrowning face with open mouth\\tcaught frown guard\\n😧\\tanguished face\\tforgot scared scary\\n😨\\tfearful face\\tafraid anxious blame\\n😰\\tanxious face with sweat\\tblue cold eek\\n😥\\tsad but relieved face\\tanxious call close\\n😢\\tcrying face\\tawful cry feels\\n😭\\tloudly crying face\\tbawling cry sad\\n😱\\tface screaming in fear\\tepic fearful munch\\n😖\\tconfounded face\\tannoyed confused cringe\\n😣\\tpersevering face\\tconcentrate concentration focus\\n😞\\tdisappointed face\\tawful blame dejected\\n😓\\tdowncast face with sweat\\tclose cold feels\\n😩\\tweary face\\tcrying fail feels\\n😫\\ttired face\\tcost feels nap\\n🥱\\tyawning face\\tbedtime bored goodnight\\n😤\\tface with steam from nose\\tanger angry feels\\n😡\\tenraged face\\tanger angry feels\\n😠\\tangry face\\tanger blame feels\\n🤬\\tface with symbols on mouth\\tcensor cursing cussing\\n😈\\tsmiling face with horns\\tdemon devil evil\\n👿\\tangry face with horns\\tdemon devil evil\\n💀\\tskull\\tbody dead death\\n☠️\\tskull and crossbones\\tbone dead death\\n💩\\tpile of poo\\tbs comic doo\\n🤡\\tclown face\\t\\n👹\\togre\\tcreature devil face\\n👺\\tgoblin\\tangry creature face\\n👻\\tghost\\tboo creature excited\\n👽\\talien\\tcreature extraterrestrial face\\n👾\\talien monster\\tcreature extraterrestrial face\\n🤖\\trobot\\tface monster\\n😺\\tgrinning cat\\tanimal face mouth\\n😸\\tgrinning cat with smiling eyes\\tanimal eye face\\n😹\\tcat with tears of joy\\tanimal face laugh\\n😻\\tsmiling cat with heart-eyes\\tanimal eye face\\n😼\\tcat with wry smile\\tanimal face ironic\\n😽\\tkissing cat\\tanimal closed eye\\n🙀\\tweary cat\\tanimal face oh\\n😿\\tcrying cat\\tanimal cry face\\n😾\\tpouting cat\\tanimal face\\n🙈\\tsee-no-evil monkey\\tembarrassed face forbidden\\n🙉\\thear-no-evil monkey\\tanimal ears face\\n🙊\\tspeak-no-evil monkey\\tanimal face forbidden\\n💌\\tlove letter\\theart mail romance\\n💘\\theart with arrow\\t143 adorbs cupid\\n💝\\theart with ribbon\\t143 anniversary emotion\\n💖\\tsparkling heart\\t143 emotion excited\\n💗\\tgrowing heart\\t143 emotion excited\\n💓\\tbeating heart\\t143 cardio emotion\\n💞\\trevolving hearts\\t143 adorbs anniversary\\n💕\\ttwo hearts\\t143 anniversary date\\n💟\\theart decoration\\t143 emotion hearth\\n❣️\\theart exclamation\\theavy mark punctuation\\n💔\\tbroken heart\\tbreak crushed emotion\\n❤️🔥\\theart on fire\\tburn love lust\\n❤️🩹\\tmending heart\\thealthier improving recovering\\n❤️\\tred heart\\temotion love\\n🩷\\tpink heart\\t143 adorable cute\\n🧡\\torange heart\\t143\\n💛\\tyellow heart\\t143 cardiac emotion\\n💚\\tgreen heart\\t143 emotion ily\\n💙\\tblue heart\\t143 emotion ily\\n🩵\\tlight blue heart\\t143 cute cyan\\n💜\\tpurple heart\\t143 bestest emotion\\n🤎\\tbrown heart\\t143\\n🖤\\tblack heart\\tevil wicked\\n🩶\\tgrey heart\\t143 emotion gray\\n🤍\\twhite heart\\t143\\n💋\\tkiss mark\\tdating emotion heart\\n💯\\thundred points\\t100 a+ agree\\n💢\\tanger symbol\\tangry comic mad\\n💥\\tcollision\\tbomb boom collide\\n💫\\tdizzy\\tcomic shining shooting\\n💦\\tsweat droplets\\tcomic drip droplet\\n💨\\tdashing away\\tcloud comic dash\\n🕳️\\thole\\t\\n💬\\tspeech balloon\\tbubble comic dialog\\n👁️🗨️\\teye in speech bubble\\tballoon witness\\n🗨️\\tleft speech bubble\\tballoon dialog\\n🗯️\\tright anger bubble\\tangry balloon mad\\n💭\\tthought balloon\\tbubble cartoon cloud\\n💤\\tZZZ\\tcomic good goodnight\",\n people: \"👋\\twaving hand\\tbye cya g2g\\n🤚\\traised back of hand\\tbackhand\\n🖐️\\thand with fingers splayed\\tfinger raised stop\\n✋\\traised hand\\t5 five high\\n🖖\\tvulcan salute\\tfinger hand hands\\n🫱\\trightwards hand\\thandshake hold reach\\n🫲\\tleftwards hand\\thandshake hold left\\n🫳\\tpalm down hand\\tdismiss drop dropped\\n🫴\\tpalm up hand\\tbeckon catch come\\n🫷\\tleftwards pushing hand\\tblock five halt\\n🫸\\trightwards pushing hand\\tblock five halt\\n👌\\tOK hand\\tawesome bet dope\\n🤌\\tpinched fingers\\tgesture hand hold\\n🤏\\tpinching hand\\tamount bit fingers\\n✌️\\tvictory hand\\tpeace v\\n🤞\\tcrossed fingers\\tcross finger hand\\n🫰\\thand with index finger and thumb crossed\\t<3 expensive heart\\n🤟\\tlove-you gesture\\tfingers hand ily\\n🤘\\tsign of the horns\\tfinger hand rock-on\\n🤙\\tcall me hand\\thang loose shaka\\n👈\\tbackhand index pointing left\\tfinger hand point\\n👉\\tbackhand index pointing right\\tfinger hand point\\n👆\\tbackhand index pointing up\\tfinger hand point\\n🖕\\tmiddle finger\\thand\\n👇\\tbackhand index pointing down\\tfinger hand point\\n☝️\\tindex pointing up\\tfinger hand point\\n🫵\\tindex pointing at the viewer\\tfinger hand poke\\n👍\\tthumbs up\\t+1 good hand\\n👎\\tthumbs down\\t-1 bad dislike\\n✊\\traised fist\\tclenched hand punch\\n👊\\toncoming fist\\tabsolutely agree boom\\n🤛\\tleft-facing fist\\tleft-facing leftwards\\n🤜\\tright-facing fist\\tright-facing rightwards\\n👏\\tclapping hands\\tapplause approval awesome\\n🙌\\traising hands\\tcelebration gesture hand\\n🫶\\theart hands\\t<3 love you\\n👐\\topen hands\\thand hug jazz\\n🤲\\tpalms up together\\tcupped dua hands\\n🤝\\thandshake\\tagreement deal hand\\n🙏\\tfolded hands\\tappreciate ask beg\\n✍️\\twriting hand\\twrite\\n💅\\tnail polish\\tbored care cosmetics\\n🤳\\tselfie\\tcamera phone\\n💪\\tflexed biceps\\tarm beast bench\\n🦾\\tmechanical arm\\taccessibility prosthetic\\n🦿\\tmechanical leg\\taccessibility prosthetic\\n🦵\\tleg\\tbent foot kick\\n🦶\\tfoot\\tankle feet kick\\n👂\\tear\\tbody ears hear\\n🦻\\tear with hearing aid\\taccessibility hard\\n👃\\tnose\\tbody noses nosey\\n🧠\\tbrain\\tintelligent smart\\n🫀\\tanatomical heart\\tbeat cardiology heartbeat\\n🫁\\tlungs\\tbreath breathe exhalation\\n🦷\\ttooth\\tdentist pearly teeth\\n🦴\\tbone\\tbones dog skeleton\\n👀\\teyes\\tbody eye face\\n👁️\\teye\\t1 body one\\n👅\\ttongue\\tbody lick slurp\\n👄\\tmouth\\tbeauty body kiss\\n🫦\\tbiting lip\\tanxious bite fear\\n👶\\tbaby\\tbabies children goo\\n🧒\\tchild\\tbright-eyed grandchild kid\\n👦\\tboy\\tbright-eyed child grandson\\n👧\\tgirl\\tbright-eyed child daughter\\n🧑\\tperson\\tadult\\n👱\\tperson: blond hair\\tblond-haired human\\n👨\\tman\\tadult bro\\n🧔\\tperson: beard\\tbearded whiskers\\n🧔♂️\\tman: beard\\tbearded whiskers\\n🧔♀️\\twoman: beard\\tbearded whiskers\\n👨🦰\\tman: red hair\\tadult bro red hair\\n👨🦱\\tman: curly hair\\tadult bro curly hair\\n👨🦳\\tman: white hair\\tadult bro white hair\\n👨🦲\\tman: bald\\tadult bro\\n👩\\twoman\\tadult lady\\n👩🦰\\twoman: red hair\\tadult lady red hair\\n🧑🦰\\tperson: red hair\\tadult red hair\\n👩🦱\\twoman: curly hair\\tadult curly hair lady\\n🧑🦱\\tperson: curly hair\\tadult curly hair\\n👩🦳\\twoman: white hair\\tadult lady white hair\\n🧑🦳\\tperson: white hair\\tadult white hair\\n👩🦲\\twoman: bald\\tadult lady\\n🧑🦲\\tperson: bald\\tadult\\n👱♀️\\twoman: blond hair\\tblond-haired blonde\\n👱♂️\\tman: blond hair\\tblond-haired\\n🧓\\tolder person\\tadult elderly grandparent\\n👴\\told man\\tadult bald elderly\\n👵\\told woman\\tadult elderly grandma\\n🙍\\tperson frowning\\tannoyed disappointed disgruntled\\n🙍♂️\\tman frowning\\tannoyed disappointed disgruntled\\n🙍♀️\\twoman frowning\\tannoyed disappointed disgruntled\\n🙎\\tperson pouting\\tdisappointed downtrodden frown\\n🙎♂️\\tman pouting\\tdisappointed downtrodden frown\\n🙎♀️\\twoman pouting\\tdisappointed downtrodden frown\\n🙅\\tperson gesturing NO\\tforbidden gesture hand\\n🙅♂️\\tman gesturing NO\\tforbidden gesture hand\\n🙅♀️\\twoman gesturing NO\\tforbidden gesture hand\\n🙆\\tperson gesturing OK\\texercise gesture hand\\n🙆♂️\\tman gesturing OK\\texercise gesture hand\\n🙆♀️\\twoman gesturing OK\\texercise gesture hand\\n💁\\tperson tipping hand\\tfetch flick flip\\n💁♂️\\tman tipping hand\\tfetch flick flip\\n💁♀️\\twoman tipping hand\\tfetch flick flip\\n🙋\\tperson raising hand\\tgesture here know\\n🙋♂️\\tman raising hand\\tgesture here know\\n🙋♀️\\twoman raising hand\\tgesture here know\\n🧏\\tdeaf person\\taccessibility ear gesture\\n🧏♂️\\tdeaf man\\taccessibility ear gesture\\n🧏♀️\\tdeaf woman\\taccessibility ear gesture\\n🙇\\tperson bowing\\tapology ask beg\\n🙇♂️\\tman bowing\\tapology ask beg\\n🙇♀️\\twoman bowing\\tapology ask beg\\n🤦\\tperson facepalming\\tagain bewilder disbelief\\n🤦♂️\\tman facepalming\\tagain bewilder disbelief\\n🤦♀️\\twoman facepalming\\tagain bewilder disbelief\\n🤷\\tperson shrugging\\tdoubt dunno guess\\n🤷♂️\\tman shrugging\\tdoubt dunno guess\\n🤷♀️\\twoman shrugging\\tdoubt dunno guess\\n🧑⚕️\\thealth worker\\tdoctor healthcare nurse\\n👨⚕️\\tman health worker\\tdoctor healthcare nurse\\n👩⚕️\\twoman health worker\\tdoctor healthcare nurse\\n🧑🎓\\tstudent\\tgraduate\\n👨🎓\\tman student\\tgraduate\\n👩🎓\\twoman student\\tgraduate\\n🧑🏫\\tteacher\\tinstructor lecturer professor\\n👨🏫\\tman teacher\\tinstructor lecturer professor\\n👩🏫\\twoman teacher\\tinstructor lecturer professor\\n🧑⚖️\\tjudge\\tjustice law scales\\n👨⚖️\\tman judge\\tjustice law scales\\n👩⚖️\\twoman judge\\tjustice law scales\\n🧑🌾\\tfarmer\\tgardener rancher\\n👨🌾\\tman farmer\\tgardener rancher\\n👩🌾\\twoman farmer\\tgardener rancher\\n🧑🍳\\tcook\\tchef\\n👨🍳\\tman cook\\tchef\\n👩🍳\\twoman cook\\tchef\\n🧑🔧\\tmechanic\\telectrician plumber tradesperson\\n👨🔧\\tman mechanic\\telectrician plumber tradesperson\\n👩🔧\\twoman mechanic\\telectrician plumber tradesperson\\n🧑🏭\\tfactory worker\\tassembly industrial\\n👨🏭\\tman factory worker\\tassembly industrial\\n👩🏭\\twoman factory worker\\tassembly industrial\\n🧑💼\\toffice worker\\tarchitect business manager\\n👨💼\\tman office worker\\tarchitect business manager\\n👩💼\\twoman office worker\\tarchitect business manager\\n🧑🔬\\tscientist\\tbiologist chemist engineer\\n👨🔬\\tman scientist\\tbiologist chemist engineer\\n👩🔬\\twoman scientist\\tbiologist chemist engineer\\n🧑💻\\ttechnologist\\tcoder computer developer\\n👨💻\\tman technologist\\tcoder computer developer\\n👩💻\\twoman technologist\\tcoder computer developer\\n🧑🎤\\tsinger\\tactor entertainer rock\\n👨🎤\\tman singer\\tactor entertainer rock\\n👩🎤\\twoman singer\\tactor entertainer rock\\n🧑🎨\\tartist\\tpalette\\n👨🎨\\tman artist\\tpalette\\n👩🎨\\twoman artist\\tpalette\\n🧑✈️\\tpilot\\tplane\\n👨✈️\\tman pilot\\tplane\\n👩✈️\\twoman pilot\\tplane\\n🧑🚀\\tastronaut\\trocket space\\n👨🚀\\tman astronaut\\trocket space\\n👩🚀\\twoman astronaut\\trocket space\\n🧑🚒\\tfirefighter\\tfire firetruck\\n👨🚒\\tman firefighter\\tfire firetruck\\n👩🚒\\twoman firefighter\\tfire firetruck\\n👮\\tpolice officer\\tapprehend arrest citation\\n👮♂️\\tman police officer\\tapprehend arrest citation\\n👮♀️\\twoman police officer\\tapprehend arrest citation\\n🕵️\\tdetective\\tsleuth spy\\n🕵️♂️\\tman detective\\tsleuth spy\\n🕵️♀️\\twoman detective\\tsleuth spy\\n💂\\tguard\\tbuckingham helmet london\\n💂♂️\\tman guard\\tbuckingham helmet london\\n💂♀️\\twoman guard\\tbuckingham helmet london\\n🥷\\tninja\\tassassin fight fighter\\n👷\\tconstruction worker\\tbuild fix hardhat\\n👷♂️\\tman construction worker\\tbuild fix hardhat\\n👷♀️\\twoman construction worker\\tbuild fix hardhat\\n🫅\\tperson with crown\\tmonarch noble regal\\n🤴\\tprince\\tcrown fairy fairytale\\n👸\\tprincess\\tcrown fairy fairytale\\n👳\\tperson wearing turban\\t\\n👳♂️\\tman wearing turban\\t\\n👳♀️\\twoman wearing turban\\t\\n👲\\tperson with skullcap\\tcap chinese gua\\n🧕\\twoman with headscarf\\tbandana head hijab\\n🤵\\tperson in tuxedo\\tformal wedding\\n🤵♂️\\tman in tuxedo\\tformal groom wedding\\n🤵♀️\\twoman in tuxedo\\tformal wedding\\n👰\\tperson with veil\\twedding\\n👰♂️\\tman with veil\\twedding\\n👰♀️\\twoman with veil\\tbride wedding\\n🤰\\tpregnant woman\\t\\n🫃\\tpregnant man\\tbelly bloated full\\n🫄\\tpregnant person\\tbelly bloated full\\n🤱\\tbreast-feeding\\tbaby mom mother\\n👩🍼\\twoman feeding baby\\tfeed mom mother\\n👨🍼\\tman feeding baby\\tdad father feed\\n🧑🍼\\tperson feeding baby\\tfeed nanny newborn\\n👼\\tbaby angel\\tchurch face fairy\\n🎅\\tSanta Claus\\tcelebration christmas fairy\\n🤶\\tMrs. Claus\\tcelebration christmas fairy\\n🧑🎄\\tMx Claus\\tcelebration christmas fairy\\n🦸\\tsuperhero\\tgood hero superpower\\n🦸♂️\\tman superhero\\tgood hero superpower\\n🦸♀️\\twoman superhero\\tgood hero heroine\\n🦹\\tsupervillain\\tbad criminal evil\\n🦹♂️\\tman supervillain\\tbad criminal evil\\n🦹♀️\\twoman supervillain\\tbad criminal evil\\n🧙\\tmage\\tfantasy magic play\\n🧙♂️\\tman mage\\tfantasy magic play\\n🧙♀️\\twoman mage\\tfantasy magic play\\n🧚\\tfairy\\tfairytale fantasy myth\\n🧚♂️\\tman fairy\\tfairytale fantasy myth\\n🧚♀️\\twoman fairy\\tfairytale fantasy myth\\n🧛\\tvampire\\tblood dracula fangs\\n🧛♂️\\tman vampire\\tblood fangs halloween\\n🧛♀️\\twoman vampire\\tblood fangs halloween\\n🧜\\tmerperson\\tcreature fairytale folklore\\n🧜♂️\\tmerman\\tcreature fairytale folklore\\n🧜♀️\\tmermaid\\tcreature fairytale folklore\\n🧝\\telf\\telves enchantment fantasy\\n🧝♂️\\tman elf\\telves enchantment fantasy\\n🧝♀️\\twoman elf\\telves enchantment fantasy\\n🧞\\tgenie\\tdjinn fantasy jinn\\n🧞♂️\\tman genie\\tdjinn fantasy jinn\\n🧞♀️\\twoman genie\\tdjinn fantasy jinn\\n🧟\\tzombie\\tapocalypse dead halloween\\n🧟♂️\\tman zombie\\tapocalypse dead halloween\\n🧟♀️\\twoman zombie\\tapocalypse dead halloween\\n🧌\\ttroll\\tfairy fantasy monster\\n💆\\tperson getting massage\\tface headache relax\\n💆♂️\\tman getting massage\\tface headache relax\\n💆♀️\\twoman getting massage\\tface headache relax\\n💇\\tperson getting haircut\\tbarber beauty chop\\n💇♂️\\tman getting haircut\\tbarber beauty chop\\n💇♀️\\twoman getting haircut\\tbarber beauty chop\\n🚶\\tperson walking\\tamble gait hike\\n🚶♂️\\tman walking\\tamble gait hike\\n🚶♀️\\twoman walking\\tamble gait hike\\n🧍\\tperson standing\\tstand\\n🧍♂️\\tman standing\\tstand\\n🧍♀️\\twoman standing\\tstand\\n🧎\\tperson kneeling\\tkneel knees\\n🧎♂️\\tman kneeling\\tkneel knees\\n🧎♀️\\twoman kneeling\\tkneel knees\\n🧑🦯\\tperson with white cane\\taccessibility blind probing\\n👨🦯\\tman with white cane\\taccessibility blind probing\\n👩🦯\\twoman with white cane\\taccessibility blind probing\\n🧑🦼\\tperson in motorized wheelchair\\taccessibility\\n👨🦼\\tman in motorized wheelchair\\taccessibility\\n👩🦼\\twoman in motorized wheelchair\\taccessibility\\n🧑🦽\\tperson in manual wheelchair\\taccessibility\\n👨🦽\\tman in manual wheelchair\\taccessibility\\n👩🦽\\twoman in manual wheelchair\\taccessibility\\n🏃\\tperson running\\tfast hurry marathon\\n🏃♂️\\tman running\\tfast hurry marathon\\n🏃♀️\\twoman running\\tfast hurry marathon\\n💃\\twoman dancing\\tdance dancer elegant\\n🕺\\tman dancing\\tdance dancer elegant\\n🕴️\\tperson in suit levitating\\tbusiness\\n👯\\tpeople with bunny ears\\tbestie bff counterpart\\n👯♂️\\tmen with bunny ears\\tbestie bff counterpart\\n👯♀️\\twomen with bunny ears\\tbestie bff counterpart\\n🧖\\tperson in steamy room\\tday luxurious pamper\\n🧖♂️\\tman in steamy room\\tday luxurious pamper\\n🧖♀️\\twoman in steamy room\\tday luxurious pamper\\n🧗\\tperson climbing\\tclimb climber mountain\\n🧗♂️\\tman climbing\\tclimb climber mountain\\n🧗♀️\\twoman climbing\\tclimb climber mountain\\n🤺\\tperson fencing\\tfencer sword\\n🏇\\thorse racing\\tjockey racehorse riding\\n⛷️\\tskier\\tski snow\\n🏂\\tsnowboarder\\tski snow snowboard\\n🏌️\\tperson golfing\\tball birdie caddy\\n🏌️♂️\\tman golfing\\tball birdie caddy\\n🏌️♀️\\twoman golfing\\tball birdie caddy\\n🏄\\tperson surfing\\tbeach ocean sport\\n🏄♂️\\tman surfing\\tbeach ocean sport\\n🏄♀️\\twoman surfing\\tbeach ocean person\\n🚣\\tperson rowing boat\\tcanoe cruise fishing\\n🚣♂️\\tman rowing boat\\tcanoe cruise fishing\\n🚣♀️\\twoman rowing boat\\tcanoe cruise fishing\\n🏊\\tperson swimming\\tfreestyle sport swim\\n🏊♂️\\tman swimming\\tfreestyle sport swim\\n🏊♀️\\twoman swimming\\tfreestyle man sport\\n⛹️\\tperson bouncing ball\\tathletic basketball championship\\n⛹️♂️\\tman bouncing ball\\tathletic basketball championship\\n⛹️♀️\\twoman bouncing ball\\tathletic basketball championship\\n🏋️\\tperson lifting weights\\tbarbell bodybuilder deadlift\\n🏋️♂️\\tman lifting weights\\tbarbell bodybuilder deadlift\\n🏋️♀️\\twoman lifting weights\\tbarbell bodybuilder deadlift\\n🚴\\tperson biking\\tbicycle bicyclist bike\\n🚴♂️\\tman biking\\tbicycle bicyclist bike\\n🚴♀️\\twoman biking\\tbicycle bicyclist bike\\n🚵\\tperson mountain biking\\tbicycle bicyclist bike\\n🚵♂️\\tman mountain biking\\tbicycle bicyclist bike\\n🚵♀️\\twoman mountain biking\\tbicycle bicyclist bike\\n🤸\\tperson cartwheeling\\tactive cartwheel excited\\n🤸♂️\\tman cartwheeling\\tactive cartwheel excited\\n🤸♀️\\twoman cartwheeling\\tactive cartwheel excited\\n🤼\\tpeople wrestling\\tcombat duel grapple\\n🤼♂️\\tmen wrestling\\tcombat duel grapple\\n🤼♀️\\twomen wrestling\\tcombat duel grapple\\n🤽\\tperson playing water polo\\tsport swimming waterpolo\\n🤽♂️\\tman playing water polo\\tsport swimming waterpolo\\n🤽♀️\\twoman playing water polo\\tsport swimming waterpolo\\n🤾\\tperson playing handball\\tathletics ball catch\\n🤾♂️\\tman playing handball\\tathletics ball catch\\n🤾♀️\\twoman playing handball\\tathletics ball catch\\n🤹\\tperson juggling\\tact balance balancing\\n🤹♂️\\tman juggling\\tact balance balancing\\n🤹♀️\\twoman juggling\\tact balance balancing\\n🧘\\tperson in lotus position\\tcross legged legs\\n🧘♂️\\tman in lotus position\\tcross legged legs\\n🧘♀️\\twoman in lotus position\\tcross legged legs\\n🛀\\tperson taking bath\\tbathtub tub\\n🛌\\tperson in bed\\tbedtime good goodnight\\n🧑🤝🧑\\tpeople holding hands\\tbae bestie bff\\n👭\\twomen holding hands\\tbae bestie bff\\n👫\\twoman and man holding hands\\tbae bestie bff\\n👬\\tmen holding hands\\tbae bestie bff\\n💏\\tkiss\\tanniversary babe bae\\n👩❤️💋👨\\tkiss: woman, man\\tanniversary babe bae\\n👨❤️💋👨\\tkiss: man, man\\tanniversary babe bae\\n👩❤️💋👩\\tkiss: woman, woman\\tanniversary babe bae\\n💑\\tcouple with heart\\tanniversary babe bae\\n👩❤️👨\\tcouple with heart: woman, man\\tanniversary babe bae\\n👨❤️👨\\tcouple with heart: man, man\\tanniversary babe bae\\n👩❤️👩\\tcouple with heart: woman, woman\\tanniversary babe bae\\n👨👩👦\\tfamily: man, woman, boy\\tchild\\n👨👩👧\\tfamily: man, woman, girl\\tchild\\n👨👩👧👦\\tfamily: man, woman, girl, boy\\tchild\\n👨👩👦👦\\tfamily: man, woman, boy, boy\\tchild\\n👨👩👧👧\\tfamily: man, woman, girl, girl\\tchild\\n👨👨👦\\tfamily: man, man, boy\\tchild\\n👨👨👧\\tfamily: man, man, girl\\tchild\\n👨👨👧👦\\tfamily: man, man, girl, boy\\tchild\\n👨👨👦👦\\tfamily: man, man, boy, boy\\tchild\\n👨👨👧👧\\tfamily: man, man, girl, girl\\tchild\\n👩👩👦\\tfamily: woman, woman, boy\\tchild\\n👩👩👧\\tfamily: woman, woman, girl\\tchild\\n👩👩👧👦\\tfamily: woman, woman, girl, boy\\tchild\\n👩👩👦👦\\tfamily: woman, woman, boy, boy\\tchild\\n👩👩👧👧\\tfamily: woman, woman, girl, girl\\tchild\\n👨👦\\tfamily: man, boy\\tchild\\n👨👦👦\\tfamily: man, boy, boy\\tchild\\n👨👧\\tfamily: man, girl\\tchild\\n👨👧👦\\tfamily: man, girl, boy\\tchild\\n👨👧👧\\tfamily: man, girl, girl\\tchild\\n👩👦\\tfamily: woman, boy\\tchild\\n👩👦👦\\tfamily: woman, boy, boy\\tchild\\n👩👧\\tfamily: woman, girl\\tchild\\n👩👧👦\\tfamily: woman, girl, boy\\tchild\\n👩👧👧\\tfamily: woman, girl, girl\\tchild\\n🗣️\\tspeaking head\\tface silhouette speak\\n👤\\tbust in silhouette\\tmysterious shadow\\n👥\\tbusts in silhouette\\tbff bust everyone\\n🫂\\tpeople hugging\\tcomfort embrace farewell\\n👪\\tfamily\\tchild\\n👣\\tfootprints\\tbarefoot clothing footprint\",\n nature: \"🐵\\tmonkey face\\tanimal banana\\n🐒\\tmonkey\\tanimal banana\\n🦍\\tgorilla\\tanimal\\n🦧\\torangutan\\tanimal ape monkey\\n🐶\\tdog face\\tadorbs animal pet\\n🐕\\tdog\\tanimal animals dogs\\n🦮\\tguide dog\\taccessibility animal blind\\n🐕🦺\\tservice dog\\taccessibility animal assistance\\n🐩\\tpoodle\\tanimal dog fluffy\\n🐺\\twolf\\tanimal face\\n🦊\\tfox\\tanimal face\\n🦝\\traccoon\\tanimal curious sly\\n🐱\\tcat face\\tanimal kitten kitty\\n🐈\\tcat\\tanimal animals cats\\n🐈⬛\\tblack cat\\tanimal feline halloween\\n🦁\\tlion\\talpha animal face\\n🐯\\ttiger face\\tanimal big cat\\n🐅\\ttiger\\tanimal big cat\\n🐆\\tleopard\\tanimal big cat\\n🐴\\thorse face\\tanimal dressage equine\\n🫎\\tmoose\\talces animal antlers\\n🫏\\tdonkey\\tanimal ass burro\\n🐎\\thorse\\tanimal equestrian farm\\n🦄\\tunicorn\\tface\\n🦓\\tzebra\\tanimal stripe\\n🦌\\tdeer\\tanimal\\n🦬\\tbison\\tanimal buffalo herd\\n🐮\\tcow face\\tanimal farm milk\\n🐂\\tox\\tanimal animals bull\\n🐃\\twater buffalo\\tanimal zoo\\n🐄\\tcow\\tanimal animals farm\\n🐷\\tpig face\\tanimal bacon farm\\n🐖\\tpig\\tanimal bacon farm\\n🐗\\tboar\\tanimal pig\\n🐽\\tpig nose\\tanimal face farm\\n🐏\\tram\\tanimal aries horns\\n🐑\\tewe\\tanimal baa farm\\n🐐\\tgoat\\tanimal capricorn farm\\n🐪\\tcamel\\tanimal desert dromedary\\n🐫\\ttwo-hump camel\\tanimal bactrian desert\\n🦙\\tllama\\talpaca animal guanaco\\n🦒\\tgiraffe\\tanimal spots\\n🐘\\telephant\\tanimal\\n🦣\\tmammoth\\tanimal extinction large\\n🦏\\trhinoceros\\tanimal\\n🦛\\thippopotamus\\tanimal hippo\\n🐭\\tmouse face\\tanimal\\n🐁\\tmouse\\tanimal animals\\n🐀\\trat\\tanimal\\n🐹\\thamster\\tanimal face pet\\n🐰\\trabbit face\\tanimal bunny pet\\n🐇\\trabbit\\tanimal bunny pet\\n🐿️\\tchipmunk\\tanimal squirrel\\n🦫\\tbeaver\\tanimal dam teeth\\n🦔\\thedgehog\\tanimal spiny\\n🦇\\tbat\\tanimal vampire\\n🐻\\tbear\\tanimal face grizzly\\n🐻❄️\\tpolar bear\\tanimal arctic white\\n🐨\\tkoala\\tanimal australia bear\\n🐼\\tpanda\\tanimal bamboo face\\n🦥\\tsloth\\tlazy slow\\n🦦\\totter\\tanimal fishing playful\\n🦨\\tskunk\\tanimal stink\\n🦘\\tkangaroo\\tanimal joey jump\\n🦡\\tbadger\\tanimal honey pester\\n🐾\\tpaw prints\\tfeet paws print\\n🦃\\tturkey\\tbird gobble thanksgiving\\n🐔\\tchicken\\tanimal bird ornithology\\n🐓\\trooster\\tanimal bird ornithology\\n🐣\\thatching chick\\tanimal baby bird\\n🐤\\tbaby chick\\tanimal bird ornithology\\n🐥\\tfront-facing baby chick\\tanimal bird front-facing\\n🐦\\tbird\\tanimal ornithology\\n🐧\\tpenguin\\tanimal antarctica bird\\n🕊️\\tdove\\tbird fly ornithology\\n🦅\\teagle\\tanimal bird ornithology\\n🦆\\tduck\\tanimal bird ornithology\\n🦢\\tswan\\tanimal bird cygnet\\n🦉\\towl\\tanimal bird ornithology\\n🦤\\tdodo\\tanimal bird extinction\\n🪶\\tfeather\\tbird flight light\\n🦩\\tflamingo\\tanimal bird flamboyant\\n🦚\\tpeacock\\tanimal bird colorful\\n🦜\\tparrot\\tanimal bird ornithology\\n🪽\\twing\\tangelic ascend aviation\\n🐦⬛\\tblack bird\\tanimal beak caw\\n🪿\\tgoose\\tanimal bird duck\\n🐸\\tfrog\\tanimal face\\n🐊\\tcrocodile\\tanimal zoo\\n🐢\\tturtle\\tanimal terrapin tortoise\\n🦎\\tlizard\\tanimal reptile\\n🐍\\tsnake\\tanimal bearer ophiuchus\\n🐲\\tdragon face\\tanimal fairy fairytale\\n🐉\\tdragon\\tanimal fairy fairytale\\n🦕\\tsauropod\\tbrachiosaurus brontosaurus dinosaur\\n🦖\\tT-Rex\\tdinosaur t-rex tyrannosaurus\\n🐳\\tspouting whale\\tanimal beach face\\n🐋\\twhale\\tanimal beach ocean\\n🐬\\tdolphin\\tanimal beach flipper\\n🦭\\tseal\\tanimal lion ocean\\n🐟\\tfish\\tanimal dinner fishes\\n🐠\\ttropical fish\\tanimal fishes\\n🐡\\tblowfish\\tanimal fish\\n🦈\\tshark\\tanimal fish\\n🐙\\toctopus\\tanimal creature ocean\\n🐚\\tspiral shell\\tanimal beach conch\\n🪸\\tcoral\\tchange climate ocean\\n🪼\\tjellyfish\\tanimal aquarium burn\\n🦀\\tcrab\\tcancer zodiac\\n🦞\\tlobster\\tanimal bisque claws\\n🦐\\tshrimp\\tfood shellfish small\\n🦑\\tsquid\\tanimal food mollusk\\n🦪\\toyster\\tdiving pearl\\n🐌\\tsnail\\tanimal escargot garden\\n🦋\\tbutterfly\\tinsect pretty\\n🐛\\tbug\\tanimal garden insect\\n🐜\\tant\\tanimal garden insect\\n🐝\\thoneybee\\tanimal bee bumblebee\\n🪲\\tbeetle\\tanimal bug insect\\n🐞\\tlady beetle\\tanimal garden insect\\n🦗\\tcricket\\tanimal bug grasshopper\\n🪳\\tcockroach\\tanimal insect pest\\n🕷️\\tspider\\tanimal insect\\n🕸️\\tspider web\\t\\n🦂\\tscorpion\\tscorpio scorpius zodiac\\n🦟\\tmosquito\\tbite disease fever\\n🪰\\tfly\\tanimal disease insect\\n🪱\\tworm\\tanimal annelid earthworm\\n🦠\\tmicrobe\\tamoeba bacteria science\\n💐\\tbouquet\\tanniversary birthday date\\n🌸\\tcherry blossom\\tflower plant spring\\n💮\\twhite flower\\t\\n🪷\\tlotus\\tbeauty buddhism calm\\n🏵️\\trosette\\tplant\\n🌹\\trose\\tbeauty elegant flower\\n🥀\\twilted flower\\tdying\\n🌺\\thibiscus\\tflower plant\\n🌻\\tsunflower\\tflower outdoors plant\\n🌼\\tblossom\\tbuttercup dandelion flower\\n🌷\\ttulip\\tblossom flower growth\\n🪻\\thyacinth\\tbloom bluebonnet flower\\n🌱\\tseedling\\tplant sapling sprout\\n🪴\\tpotted plant\\tdecor grow house\\n🌲\\tevergreen tree\\tchristmas forest pine\\n🌳\\tdeciduous tree\\tforest green habitat\\n🌴\\tpalm tree\\tbeach plant tropical\\n🌵\\tcactus\\tdesert drought nature\\n🌾\\tsheaf of rice\\tear grain grains\\n🌿\\therb\\tleaf plant\\n☘️\\tshamrock\\tirish plant\\n🍀\\tfour leaf clover\\t4 four-leaf irish\\n🍁\\tmaple leaf\\tfalling\\n🍂\\tfallen leaf\\tautumn fall falling\\n🍃\\tleaf fluttering in wind\\tblow flutter\\n🪹\\tempty nest\\tbranch home nesting\\n🪺\\tnest with eggs\\tbird branch egg\\n🍄\\tmushroom\\tfungus toadstool\",\n food: \"🍇\\tgrapes\\tdionysus fruit grape\\n🍈\\tmelon\\tcantaloupe fruit\\n🍉\\twatermelon\\tfruit\\n🍊\\ttangerine\\tc citrus fruit\\n🍋\\tlemon\\tcitrus fruit sour\\n🍌\\tbanana\\tfruit potassium\\n🍍\\tpineapple\\tcolada fruit pina\\n🥭\\tmango\\tfood fruit tropical\\n🍎\\tred apple\\tdiet food fruit\\n🍏\\tgreen apple\\tfruit\\n🍐\\tpear\\tfruit\\n🍑\\tpeach\\tfruit\\n🍒\\tcherries\\tberries cherry fruit\\n🍓\\tstrawberry\\tberry fruit\\n🫐\\tblueberries\\tberries berry bilberry\\n🥝\\tkiwi fruit\\tfood\\n🍅\\ttomato\\tfood fruit vegetable\\n🫒\\tolive\\tfood\\n🥥\\tcoconut\\tcolada palm piña\\n🥑\\tavocado\\tfood fruit\\n🍆\\teggplant\\taubergine vegetable\\n🥔\\tpotato\\tfood vegetable\\n🥕\\tcarrot\\tfood vegetable\\n🌽\\tear of corn\\tcrops farm maize\\n🌶️\\thot pepper\\t\\n🫑\\tbell pepper\\tcapsicum food vegetable\\n🥒\\tcucumber\\tfood pickle vegetable\\n🥬\\tleafy green\\tbok burgers cabbage\\n🥦\\tbroccoli\\tcabbage wild\\n🧄\\tgarlic\\tflavoring\\n🧅\\tonion\\tflavoring\\n🥜\\tpeanuts\\tfood nut peanut\\n🫘\\tbeans\\tfood kidney legume\\n🌰\\tchestnut\\talmond plant\\n🫚\\tginger root\\tbeer health herb\\n🫛\\tpea pod\\tbeans beanstalk edamame\\n🍞\\tbread\\tcarbs food grain\\n🥐\\tcroissant\\tbread breakfast crescent\\n🥖\\tbaguette bread\\tfood french\\n🫓\\tflatbread\\tarepa bread food\\n🥨\\tpretzel\\tconvoluted twisted\\n🥯\\tbagel\\tbakery bread breakfast\\n🥞\\tpancakes\\tbreakfast crêpe food\\n🧇\\twaffle\\tbreakfast indecisive iron\\n🧀\\tcheese wedge\\t\\n🍖\\tmeat on bone\\t\\n🍗\\tpoultry leg\\tbone chicken drumstick\\n🥩\\tcut of meat\\tchop lambchop porkchop\\n🥓\\tbacon\\tbreakfast food meat\\n🍔\\thamburger\\tburger eat fast\\n🍟\\tfrench fries\\tfast food\\n🍕\\tpizza\\tcheese food hungry\\n🌭\\thot dog\\tfrankfurter hotdog sausage\\n🥪\\tsandwich\\tbread\\n🌮\\ttaco\\tmexican\\n🌯\\tburrito\\tmexican wrap\\n🫔\\ttamale\\tfood mexican pamonha\\n🥙\\tstuffed flatbread\\tfalafel food gyro\\n🧆\\tfalafel\\tchickpea meatball\\n🥚\\tegg\\tbreakfast food\\n🍳\\tcooking\\tbreakfast easy egg\\n🥘\\tshallow pan of food\\tcasserole paella\\n🍲\\tpot of food\\tsoup stew\\n🫕\\tfondue\\tcheese chocolate food\\n🥣\\tbowl with spoon\\tbreakfast cereal congee\\n🥗\\tgreen salad\\tfood\\n🍿\\tpopcorn\\tcorn movie pop\\n🧈\\tbutter\\tdairy\\n🧂\\tsalt\\tcondiment flavor mad\\n🥫\\tcanned food\\tcan\\n🍱\\tbento box\\tfood\\n🍘\\trice cracker\\tfood\\n🍙\\trice ball\\tfood japanese\\n🍚\\tcooked rice\\tfood\\n🍛\\tcurry rice\\tfood\\n🍜\\tsteaming bowl\\tchopsticks food noodle\\n🍝\\tspaghetti\\tfood meatballs pasta\\n🍠\\troasted sweet potato\\tfood\\n🍢\\toden\\tfood kebab restaurant\\n🍣\\tsushi\\tfood\\n🍤\\tfried shrimp\\tprawn tempura\\n🍥\\tfish cake with swirl\\tfood pastry restaurant\\n🥮\\tmoon cake\\tautumn festival yuèbǐng\\n🍡\\tdango\\tdessert japanese skewer\\n🥟\\tdumpling\\tempanada gyōza jiaozi\\n🥠\\tfortune cookie\\tprophecy\\n🥡\\ttakeout box\\tchopsticks delivery food\\n🍦\\tsoft ice cream\\tdessert food icecream\\n🍧\\tshaved ice\\tdessert restaurant sweet\\n🍨\\tice cream\\tdessert food restaurant\\n🍩\\tdoughnut\\tbreakfast dessert donut\\n🍪\\tcookie\\tchip chocolate dessert\\n🎂\\tbirthday cake\\tbday celebration dessert\\n🍰\\tshortcake\\tcake dessert pastry\\n🧁\\tcupcake\\tbakery dessert sprinkles\\n🥧\\tpie\\tapple filling fruit\\n🍫\\tchocolate bar\\tcandy dessert halloween\\n🍬\\tcandy\\tcavities dessert halloween\\n🍭\\tlollipop\\tcandy dessert food\\n🍮\\tcustard\\tdessert pudding sweet\\n🍯\\thoney pot\\tbarrel bear food\\n🍼\\tbaby bottle\\tbabies birth born\\n🥛\\tglass of milk\\tdrink\\n☕\\thot beverage\\tcafe caffeine chai\\n🫖\\tteapot\\tbrew drink food\\n🍵\\tteacup without handle\\tbeverage cup drink\\n🍶\\tsake\\tbar beverage bottle\\n🍾\\tbottle with popping cork\\tbar drink\\n🍷\\twine glass\\talcohol bar beverage\\n🍸\\tcocktail glass\\talcohol bar booze\\n🍹\\ttropical drink\\talcohol bar booze\\n🍺\\tbeer mug\\talcohol ale bar\\n🍻\\tclinking beer mugs\\talcohol bar booze\\n🥂\\tclinking glasses\\tcelebrate clink drink\\n🥃\\ttumbler glass\\tliquor scotch shot\\n🫗\\tpouring liquid\\taccident drink empty\\n🥤\\tcup with straw\\tdrink juice malt\\n🧋\\tbubble tea\\tboba food milk\\n🧃\\tbeverage box\\tjuice straw sweet\\n🧉\\tmate\\tdrink\\n🧊\\tice\\tcold cube iceberg\\n🥢\\tchopsticks\\thashi jeotgarak kuaizi\\n🍽️\\tfork and knife with plate\\tcooking dinner eat\\n🍴\\tfork and knife\\tbreakfast breaky cooking\\n🥄\\tspoon\\teat tableware\\n🔪\\tkitchen knife\\tchef cooking hocho\\n🫙\\tjar\\tcondiment container empty\\n🏺\\tamphora\\taquarius cooking drink\",\n travel: \"🌍\\tglobe showing Europe-Africa\\tearth europe-africa world\\n🌎\\tglobe showing Americas\\tearth world\\n🌏\\tglobe showing Asia-Australia\\tasia-australia earth world\\n🌐\\tglobe with meridians\\tearth internet web\\n🗺️\\tworld map\\t\\n🗾\\tmap of Japan\\t\\n🧭\\tcompass\\tdirection magnetic navigation\\n🏔️\\tsnow-capped mountain\\tcold snow-capped\\n⛰️\\tmountain\\t\\n🌋\\tvolcano\\teruption mountain nature\\n🗻\\tmount fuji\\tmountain nature\\n🏕️\\tcamping\\t\\n🏖️\\tbeach with umbrella\\t\\n🏜️\\tdesert\\t\\n🏝️\\tdesert island\\t\\n🏞️\\tnational park\\t\\n🏟️\\tstadium\\t\\n🏛️\\tclassical building\\t\\n🏗️\\tbuilding construction\\tcrane\\n🧱\\tbrick\\tbricks clay mortar\\n🪨\\trock\\tboulder heavy solid\\n🪵\\twood\\tlog lumber timber\\n🛖\\thut\\thome house roundhouse\\n🏘️\\thouses\\thouse\\n🏚️\\tderelict house\\thome\\n🏠\\thouse\\tbuilding country heart\\n🏡\\thouse with garden\\tbuilding country heart\\n🏢\\toffice building\\tcity cubical job\\n🏣\\tJapanese post office\\tbuilding\\n🏤\\tpost office\\tbuilding european\\n🏥\\thospital\\tbuilding doctor medicine\\n🏦\\tbank\\tbuilding\\n🏨\\thotel\\tbuilding\\n🏩\\tlove hotel\\tbuilding\\n🏪\\tconvenience store\\t24 building hours\\n🏫\\tschool\\tbuilding\\n🏬\\tdepartment store\\tbuilding\\n🏭\\tfactory\\tbuilding\\n🏯\\tJapanese castle\\tbuilding\\n🏰\\tcastle\\tbuilding european\\n💒\\twedding\\tchapel hitched nuptials\\n🗼\\tTokyo tower\\t\\n🗽\\tStatue of Liberty\\tnew ny nyc\\n⛪\\tchurch\\tbless chapel christian\\n🕌\\tmosque\\tislam masjid muslim\\n🛕\\thindu temple\\t\\n🕍\\tsynagogue\\tjew jewish judaism\\n⛩️\\tshinto shrine\\treligion\\n🕋\\tkaaba\\thajj islam muslim\\n⛲\\tfountain\\t\\n⛺\\ttent\\tcamping\\n🌁\\tfoggy\\tfog\\n🌃\\tnight with stars\\tstar\\n🏙️\\tcityscape\\tcity\\n🌄\\tsunrise over mountains\\tmorning sun\\n🌅\\tsunrise\\tmorning nature sun\\n🌆\\tcityscape at dusk\\tbuilding city evening\\n🌇\\tsunset\\tbuilding dusk sun\\n🌉\\tbridge at night\\t\\n♨️\\thot springs\\thotsprings steaming\\n🎠\\tcarousel horse\\tentertainment\\n🛝\\tplayground slide\\tamusement park play\\n🎡\\tferris wheel\\tamusement park theme\\n🎢\\troller coaster\\tamusement park theme\\n💈\\tbarber pole\\tcut fresh haircut\\n🎪\\tcircus tent\\t\\n🚂\\tlocomotive\\tcaboose engine railway\\n🚃\\trailway car\\telectric train tram\\n🚄\\thigh-speed train\\thigh-speed railway shinkansen\\n🚅\\tbullet train\\thigh-speed nose railway\\n🚆\\ttrain\\tarrived choo railway\\n🚇\\tmetro\\tsubway travel\\n🚈\\tlight rail\\tarrived monorail railway\\n🚉\\tstation\\trailway train\\n🚊\\ttram\\ttrolleybus\\n🚝\\tmonorail\\tvehicle\\n🚞\\tmountain railway\\tcar trip\\n🚋\\ttram car\\tbus trolley trolleybus\\n🚌\\tbus\\tschool vehicle\\n🚍\\toncoming bus\\tcars\\n🚎\\ttrolleybus\\tbus tram trolley\\n🚐\\tminibus\\tbus drive van\\n🚑\\tambulance\\temergency vehicle\\n🚒\\tfire engine\\ttruck\\n🚓\\tpolice car\\t5–0 cops patrol\\n🚔\\toncoming police car\\t\\n🚕\\ttaxi\\tcab cabbie car\\n🚖\\toncoming taxi\\tcab cabbie cars\\n🚗\\tautomobile\\tcar driving vehicle\\n🚘\\toncoming automobile\\tcar cars drove\\n🚙\\tsport utility vehicle\\tcar drive recreational\\n🛻\\tpickup truck\\tautomobile car flatbed\\n🚚\\tdelivery truck\\tcar drive vehicle\\n🚛\\tarticulated lorry\\tcar drive move\\n🚜\\ttractor\\tvehicle\\n🏎️\\tracing car\\tzoom\\n🏍️\\tmotorcycle\\tracing\\n🛵\\tmotor scooter\\t\\n🦽\\tmanual wheelchair\\taccessibility\\n🦼\\tmotorized wheelchair\\taccessibility\\n🛺\\tauto rickshaw\\ttuk\\n🚲\\tbicycle\\tbike class cycle\\n🛴\\tkick scooter\\t\\n🛹\\tskateboard\\tboard skate skater\\n🛼\\troller skate\\tblades skates sport\\n🚏\\tbus stop\\tbusstop\\n🛣️\\tmotorway\\thighway road\\n🛤️\\trailway track\\ttrain\\n🛢️\\toil drum\\t\\n⛽\\tfuel pump\\tdiesel fuelpump gas\\n🛞\\twheel\\tcar circle tire\\n🚨\\tpolice car light\\talarm alert beacon\\n🚥\\thorizontal traffic light\\tintersection signal stop\\n🚦\\tvertical traffic light\\tdrove intersection signal\\n🛑\\tstop sign\\toctagonal\\n🚧\\tconstruction\\tbarrier\\n⚓\\tanchor\\tship tool\\n🛟\\tring buoy\\tfloat life lifesaver\\n⛵\\tsailboat\\tboat resort sailing\\n🛶\\tcanoe\\tboat\\n🚤\\tspeedboat\\tbillionaire boat lake\\n🛳️\\tpassenger ship\\t\\n⛴️\\tferry\\tboat passenger\\n🛥️\\tmotor boat\\tmotorboat\\n🚢\\tship\\tboat passenger travel\\n✈️\\tairplane\\taeroplane fly flying\\n🛩️\\tsmall airplane\\taeroplane plane\\n🛫\\tairplane departure\\taeroplane check-in departures\\n🛬\\tairplane arrival\\taeroplane arrivals arriving\\n🪂\\tparachute\\thang-glide parasail skydive\\n💺\\tseat\\tchair\\n🚁\\thelicopter\\tcopter roflcopter travel\\n🚟\\tsuspension railway\\t\\n🚠\\tmountain cableway\\tcable gondola lift\\n🚡\\taerial tramway\\tcable car gondola\\n🛰️\\tsatellite\\tspace\\n🚀\\trocket\\tlaunch rockets space\\n🛸\\tflying saucer\\taliens extra terrestrial\\n🛎️\\tbellhop bell\\thotel\\n🧳\\tluggage\\tbag packing roller\\n⌛\\thourglass done\\tsand time timer\\n⏳\\thourglass not done\\tflowing hours sand\\n⌚\\twatch\\tclock time\\n⏰\\talarm clock\\thours hrs late\\n⏱️\\tstopwatch\\tclock time\\n⏲️\\ttimer clock\\t\\n🕰️\\tmantelpiece clock\\ttime\\n🕛\\ttwelve o’clock\\t12 12:00 o’clock\\n🕧\\ttwelve-thirty\\t12 12:30 30\\n🕐\\tone o’clock\\t1 1:00 o’clock\\n🕜\\tone-thirty\\t1 1:30 30\\n🕑\\ttwo o’clock\\t2 2:00 o’clock\\n🕝\\ttwo-thirty\\t2 2:30 30\\n🕒\\tthree o’clock\\t3 3:00 o’clock\\n🕞\\tthree-thirty\\t3 30 3:30\\n🕓\\tfour o’clock\\t4 4:00 o’clock\\n🕟\\tfour-thirty\\t30 4 4:30\\n🕔\\tfive o’clock\\t5 5:00 o’clock\\n🕠\\tfive-thirty\\t30 5 5:30\\n🕕\\tsix o’clock\\t6 6:00 o’clock\\n🕡\\tsix-thirty\\t30 6 6:30\\n🕖\\tseven o’clock\\t0 7 7:00\\n🕢\\tseven-thirty\\t30 7 7:30\\n🕗\\teight o’clock\\t8 8:00 o’clock\\n🕣\\teight-thirty\\t30 8 8:30\\n🕘\\tnine o’clock\\t9 9:00 o’clock\\n🕤\\tnine-thirty\\t30 9 9:30\\n🕙\\tten o’clock\\t0 10 10:00\\n🕥\\tten-thirty\\t10 10:30 30\\n🕚\\televen o’clock\\t11 11:00 o’clock\\n🕦\\televen-thirty\\t11 11:30 30\\n🌑\\tnew moon\\tdark space\\n🌒\\twaxing crescent moon\\tdreams space\\n🌓\\tfirst quarter moon\\tspace\\n🌔\\twaxing gibbous moon\\tspace\\n🌕\\tfull moon\\tspace\\n🌖\\twaning gibbous moon\\tspace\\n🌗\\tlast quarter moon\\tspace\\n🌘\\twaning crescent moon\\tspace\\n🌙\\tcrescent moon\\tramadan space\\n🌚\\tnew moon face\\tspace\\n🌛\\tfirst quarter moon face\\tspace\\n🌜\\tlast quarter moon face\\tdreams\\n🌡️\\tthermometer\\tweather\\n☀️\\tsun\\tbright rays space\\n🌝\\tfull moon face\\tbright\\n🌞\\tsun with face\\tbeach bright day\\n🪐\\tringed planet\\tsaturn saturnine\\n⭐\\tstar\\tastronomy medium stars\\n🌟\\tglowing star\\tglittery glow night\\n🌠\\tshooting star\\tfalling night space\\n🌌\\tmilky way\\tspace\\n☁️\\tcloud\\tweather\\n⛅\\tsun behind cloud\\tcloudy weather\\n⛈️\\tcloud with lightning and rain\\tthunder thunderstorm\\n🌤️\\tsun behind small cloud\\tweather\\n🌥️\\tsun behind large cloud\\tweather\\n🌦️\\tsun behind rain cloud\\tweather\\n🌧️\\tcloud with rain\\tweather\\n🌨️\\tcloud with snow\\tcold weather\\n🌩️\\tcloud with lightning\\tweather\\n🌪️\\ttornado\\tcloud weather whirlwind\\n🌫️\\tfog\\tcloud weather\\n🌬️\\twind face\\tblow cloud\\n🌀\\tcyclone\\tdizzy hurricane twister\\n🌈\\trainbow\\tgay genderqueer glbt\\n🌂\\tclosed umbrella\\tclothing rain\\n☂️\\tumbrella\\tclothing rain\\n☔\\tumbrella with rain drops\\tclothing drop weather\\n⛱️\\tumbrella on ground\\train sun\\n⚡\\thigh voltage\\tdanger electric electricity\\n❄️\\tsnowflake\\tcold snow weather\\n☃️\\tsnowman\\tcold man snow\\n⛄\\tsnowman without snow\\tcold man\\n☄️\\tcomet\\tspace\\n🔥\\tfire\\taf burn flame\\n💧\\tdroplet\\tcold comic drop\\n🌊\\twater wave\\tnature ocean surf\",\n activities: \"🎃\\tjack-o-lantern\\tcelebration halloween pumpkin\\n🎄\\tChristmas tree\\tcelebration\\n🎆\\tfireworks\\tboom celebration entertainment\\n🎇\\tsparkler\\tboom celebration fireworks\\n🧨\\tfirecracker\\tdynamite explosive fire\\n✨\\tsparkles\\t* magic sparkle\\n🎈\\tballoon\\tbirthday celebrate celebration\\n🎉\\tparty popper\\tawesome birthday celebrate\\n🎊\\tconfetti ball\\tcelebrate celebration party\\n🎋\\ttanabata tree\\tbanner celebration japanese\\n🎍\\tpine decoration\\tbamboo celebration japanese\\n🎎\\tJapanese dolls\\tcelebration doll festival\\n🎏\\tcarp streamer\\tcelebration\\n🎐\\twind chime\\tbell celebration\\n🎑\\tmoon viewing ceremony\\tcelebration\\n🧧\\tred envelope\\tgift good hóngbāo\\n🎀\\tribbon\\tcelebration\\n🎁\\twrapped gift\\tbirthday bow box\\n🎗️\\treminder ribbon\\tcelebration\\n🎟️\\tadmission tickets\\tticket\\n🎫\\tticket\\tadmission stub\\n🎖️\\tmilitary medal\\taward celebration\\n🏆\\ttrophy\\tchampion champs prize\\n🏅\\tsports medal\\taward gold winner\\n🥇\\t1st place medal\\tfirst gold\\n🥈\\t2nd place medal\\tsecond silver\\n🥉\\t3rd place medal\\tbronze third\\n⚽\\tsoccer ball\\tfootball futbol sport\\n⚾\\tbaseball\\tball sport\\n🥎\\tsoftball\\tball glove sports\\n🏀\\tbasketball\\tball hoop sport\\n🏐\\tvolleyball\\tball game\\n🏈\\tamerican football\\tball bowl sport\\n🏉\\trugby football\\tball sport\\n🎾\\ttennis\\tball racquet sport\\n🥏\\tflying disc\\tultimate\\n🎳\\tbowling\\tball game sport\\n🏏\\tcricket game\\tball bat\\n🏑\\tfield hockey\\tball game stick\\n🏒\\tice hockey\\tgame puck stick\\n🥍\\tlacrosse\\tball goal sports\\n🏓\\tping pong\\tball bat game\\n🏸\\tbadminton\\tbirdie game racquet\\n🥊\\tboxing glove\\t\\n🥋\\tmartial arts uniform\\tjudo karate taekwondo\\n🥅\\tgoal net\\t\\n⛳\\tflag in hole\\tgolf sport\\n⛸️\\tice skate\\tskating\\n🎣\\tfishing pole\\tentertainment fish sport\\n🤿\\tdiving mask\\tscuba snorkeling\\n🎽\\trunning shirt\\tathletics sash\\n🎿\\tskis\\tski snow sport\\n🛷\\tsled\\tluge sledge sleigh\\n🥌\\tcurling stone\\tgame rock\\n🎯\\tbullseye\\tbull dart direct\\n🪀\\tyo-yo\\tfluctuate toy\\n🪁\\tkite\\tfly soar\\n🔫\\twater pistol\\tgun handgun revolver\\n🎱\\tpool 8 ball\\t8ball billiard eight\\n🔮\\tcrystal ball\\tfairy fairytale fantasy\\n🪄\\tmagic wand\\tmagician witch wizard\\n🎮\\tvideo game\\tcontroller entertainment\\n🕹️\\tjoystick\\tgame video videogame\\n🎰\\tslot machine\\tcasino gamble gambling\\n🎲\\tgame die\\tdice entertainment\\n🧩\\tpuzzle piece\\tclue interlocking jigsaw\\n🧸\\tteddy bear\\tplaything plush stuffed\\n🪅\\tpiñata\\tcandy celebrate celebration\\n🪩\\tmirror ball\\tdance disco glitter\\n🪆\\tnesting dolls\\tbabooshka baboushka babushka\\n♠️\\tspade suit\\tcard game\\n♥️\\theart suit\\tcard emotion game\\n♦️\\tdiamond suit\\tcard game\\n♣️\\tclub suit\\tcard clubs game\\n♟️\\tchess pawn\\tdupe expendable\\n🃏\\tjoker\\tcard game wildcard\\n🀄\\tmahjong red dragon\\tgame\\n🎴\\tflower playing cards\\tcard game japanese\\n🎭\\tperforming arts\\tactor actress art\\n🖼️\\tframed picture\\tart frame museum\\n🎨\\tartist palette\\tart artsy arty\\n🧵\\tthread\\tneedle sewing spool\\n🪡\\tsewing needle\\tembroidery sew stitches\\n🧶\\tyarn\\tball crochet knit\\n🪢\\tknot\\tcord rope tangled\",\n objects: \"👓\\tglasses\\tclothing eye eyeglasses\\n🕶️\\tsunglasses\\tdark eye eyewear\\n🥽\\tgoggles\\tdive eye protection\\n🥼\\tlab coat\\tclothes doctor dr\\n🦺\\tsafety vest\\temergency\\n👔\\tnecktie\\tclothing employed serious\\n👕\\tt-shirt\\tblue casual clothes\\n👖\\tjeans\\tblue casual clothes\\n🧣\\tscarf\\tbundle cold neck\\n🧤\\tgloves\\thand\\n🧥\\tcoat\\tbrr bundle cold\\n🧦\\tsocks\\tstocking\\n👗\\tdress\\tclothes clothing dressed\\n👘\\tkimono\\tclothing comfortable\\n🥻\\tsari\\tclothing dress\\n🩱\\tone-piece swimsuit\\tbathing one-piece suit\\n🩲\\tbriefs\\tbathing one-piece suit\\n🩳\\tshorts\\tbathing pants suit\\n👙\\tbikini\\tbathing beach clothing\\n👚\\twoman’s clothes\\tblouse clothing collar\\n🪭\\tfolding hand fan\\tclack clap cool\\n👛\\tpurse\\tclothes clothing coin\\n👜\\thandbag\\tbag clothes clothing\\n👝\\tclutch bag\\tclothes clothing dress\\n🛍️\\tshopping bags\\tbag hotel\\n🎒\\tbackpack\\tbackpacking bag bookbag\\n🩴\\tthong sandal\\tbeach flip flop\\n👞\\tman’s shoe\\tbrown clothes clothing\\n👟\\trunning shoe\\tathletic clothes clothing\\n🥾\\thiking boot\\tbackpacking brown camping\\n🥿\\tflat shoe\\tballet comfy flats\\n👠\\thigh-heeled shoe\\tclothes clothing dress\\n👡\\twoman’s sandal\\tclothing shoe woman’s\\n🩰\\tballet shoes\\tdance\\n👢\\twoman’s boot\\tclothes clothing dress\\n🪮\\thair pick\\tafro comb groom\\n👑\\tcrown\\tclothing family king\\n👒\\twoman’s hat\\tclothes clothing garden\\n🎩\\ttop hat\\tclothes clothing fancy\\n🎓\\tgraduation cap\\tcelebration clothing education\\n🧢\\tbilled cap\\tbaseball bent dad\\n🪖\\tmilitary helmet\\tarmy soldier war\\n⛑️\\trescue worker’s helmet\\taid cross face\\n📿\\tprayer beads\\tclothing necklace religion\\n💄\\tlipstick\\tcosmetics date makeup\\n💍\\tring\\tdiamond engaged engagement\\n💎\\tgem stone\\tdiamond engagement jewel\\n🔇\\tmuted speaker\\tmute quiet silent\\n🔈\\tspeaker low volume\\tsoft sound\\n🔉\\tspeaker medium volume\\tsound\\n🔊\\tspeaker high volume\\tloud music sound\\n📢\\tloudspeaker\\taddress communication loud\\n📣\\tmegaphone\\tcheering sound\\n📯\\tpostal horn\\tpost\\n🔔\\tbell\\tbreak church sound\\n🔕\\tbell with slash\\tforbidden mute no\\n🎼\\tmusical score\\tmusic note\\n🎵\\tmusical note\\tmusic sound\\n🎶\\tmusical notes\\tmusic note sound\\n🎙️\\tstudio microphone\\tmic music\\n🎚️\\tlevel slider\\tmusic\\n🎛️\\tcontrol knobs\\tmusic\\n🎤\\tmicrophone\\tkaraoke mic music\\n🎧\\theadphone\\tearbud sound\\n📻\\tradio\\tentertainment tbt video\\n🎷\\tsaxophone\\tinstrument music sax\\n🪗\\taccordion\\tbox concertina instrument\\n🎸\\tguitar\\tinstrument music strat\\n🎹\\tmusical keyboard\\tinstrument music piano\\n🎺\\ttrumpet\\tinstrument music\\n🎻\\tviolin\\tinstrument music\\n🪕\\tbanjo\\tmusic stringed\\n🥁\\tdrum\\tdrumsticks music\\n🪘\\tlong drum\\tbeat conga instrument\\n🪇\\tmaracas\\tcha dance instrument\\n🪈\\tflute\\tband fife flautist\\n📱\\tmobile phone\\tcell communication telephone\\n📲\\tmobile phone with arrow\\tbuild call cell\\n☎️\\ttelephone\\tphone\\n📞\\ttelephone receiver\\tcommunication phone voip\\n📟\\tpager\\tcommunication\\n📠\\tfax machine\\tcommunication\\n🔋\\tbattery\\t\\n🪫\\tlow battery\\tdrained electronic energy\\n🔌\\telectric plug\\telectricity\\n💻\\tlaptop\\tcomputer office pc\\n🖥️\\tdesktop computer\\tmonitor\\n🖨️\\tprinter\\tcomputer\\n⌨️\\tkeyboard\\tcomputer\\n🖱️\\tcomputer mouse\\t\\n🖲️\\ttrackball\\tcomputer\\n💽\\tcomputer disk\\tminidisk optical\\n💾\\tfloppy disk\\tcomputer\\n💿\\toptical disk\\tblu-ray cd computer\\n📀\\tdvd\\tblu-ray cd computer\\n🧮\\tabacus\\tcalculation calculator\\n🎥\\tmovie camera\\tbollywood cinema film\\n🎞️\\tfilm frames\\tcinema movie\\n📽️\\tfilm projector\\tcinema movie video\\n🎬\\tclapper board\\taction movie\\n📺\\ttelevision\\ttv video\\n📷\\tcamera\\tphoto selfie snap\\n📸\\tcamera with flash\\tvideo\\n📹\\tvideo camera\\tcamcorder tbt\\n📼\\tvideocassette\\told school tape\\n🔍\\tmagnifying glass tilted left\\tlab left-pointing science\\n🔎\\tmagnifying glass tilted right\\tcontact lab right-pointing\\n🕯️\\tcandle\\tlight\\n💡\\tlight bulb\\tcomic electric idea\\n🔦\\tflashlight\\telectric light tool\\n🏮\\tred paper lantern\\tbar light restaurant\\n🪔\\tdiya lamp\\tlight oil\\n📔\\tnotebook with decorative cover\\tbook decorated education\\n📕\\tclosed book\\teducation\\n📖\\topen book\\teducation fantasy knowledge\\n📗\\tgreen book\\teducation fantasy library\\n📘\\tblue book\\teducation fantasy library\\n📙\\torange book\\teducation fantasy library\\n📚\\tbooks\\tbook education fantasy\\n📓\\tnotebook\\t\\n📒\\tledger\\tnotebook\\n📃\\tpage with curl\\tdocument paper\\n📜\\tscroll\\tpaper\\n📄\\tpage facing up\\tdocument paper\\n📰\\tnewspaper\\tcommunication news paper\\n🗞️\\trolled-up newspaper\\tnews paper rolled-up\\n📑\\tbookmark tabs\\tmark marker\\n🔖\\tbookmark\\tmark\\n🏷️\\tlabel\\ttag\\n💰\\tmoney bag\\tbank bet billion\\n🪙\\tcoin\\tdollar euro gold\\n💴\\tyen banknote\\tbank bill currency\\n💵\\tdollar banknote\\tbank bill currency\\n💶\\teuro banknote\\t100 bank bill\\n💷\\tpound banknote\\tbank bill billion\\n💸\\tmoney with wings\\tbank banknote bill\\n💳\\tcredit card\\tbank cash charge\\n🧾\\treceipt\\taccounting bookkeeping evidence\\n💹\\tchart increasing with yen\\tbank currency graph\\n✉️\\tenvelope\\te-mail email letter\\n📧\\te-mail\\temail letter\\n📨\\tincoming envelope\\tdelivering e-mail email\\n📩\\tenvelope with arrow\\tcommunication down e-mail\\n📤\\toutbox tray\\tbox email letter\\n📥\\tinbox tray\\tbox email letter\\n📦\\tpackage\\tbox communication delivery\\n📫\\tclosed mailbox with raised flag\\tcommunication mail postbox\\n📪\\tclosed mailbox with lowered flag\\tmail postbox\\n📬\\topen mailbox with raised flag\\tmail postbox\\n📭\\topen mailbox with lowered flag\\tmail postbox\\n📮\\tpostbox\\tmail mailbox\\n🗳️\\tballot box with ballot\\t\\n✏️\\tpencil\\t\\n✒️\\tblack nib\\tpen\\n🖋️\\tfountain pen\\t\\n🖊️\\tpen\\tballpoint\\n🖌️\\tpaintbrush\\tpainting\\n🖍️\\tcrayon\\t\\n📝\\tmemo\\tcommunication media notes\\n💼\\tbriefcase\\toffice\\n📁\\tfile folder\\t\\n📂\\topen file folder\\t\\n🗂️\\tcard index dividers\\t\\n📅\\tcalendar\\tdate\\n📆\\ttear-off calendar\\ttear-off\\n🗒️\\tspiral notepad\\tnote pad\\n🗓️\\tspiral calendar\\tpad\\n📇\\tcard index\\told rolodex school\\n📈\\tchart increasing\\tdata graph growth\\n📉\\tchart decreasing\\tdata down downward\\n📊\\tbar chart\\tdata graph\\n📋\\tclipboard\\tdo list notes\\n📌\\tpushpin\\tcollage pin\\n📍\\tround pushpin\\tlocation map pin\\n📎\\tpaperclip\\t\\n🖇️\\tlinked paperclips\\tlink paperclip\\n📏\\tstraight ruler\\tangle edge math\\n📐\\ttriangular ruler\\tangle math rule\\n✂️\\tscissors\\tcut cutting paper\\n🗃️\\tcard file box\\t\\n🗄️\\tfile cabinet\\tfiling paper\\n🗑️\\twastebasket\\tcan garbage trash\\n🔒\\tlocked\\tclosed lock private\\n🔓\\tunlocked\\tcracked lock open\\n🔏\\tlocked with pen\\tink lock nib\\n🔐\\tlocked with key\\tbike closed lock\\n🔑\\tkey\\tkeys lock major\\n🗝️\\told key\\tclue lock\\n🔨\\thammer\\thome improvement repairs\\n🪓\\taxe\\tax chop hatchet\\n⛏️\\tpick\\thammer mining tool\\n⚒️\\thammer and pick\\ttool\\n🛠️\\thammer and wrench\\tspanner tool\\n🗡️\\tdagger\\tknife weapon\\n⚔️\\tcrossed swords\\tweapon\\n💣\\tbomb\\tboom comic dangerous\\n🪃\\tboomerang\\trebound repercussion weapon\\n🏹\\tbow and arrow\\tarcher archery sagittarius\\n🛡️\\tshield\\tweapon\\n🪚\\tcarpentry saw\\tcarpenter cut lumber\\n🔧\\twrench\\thome improvement spanner\\n🪛\\tscrewdriver\\tflathead handy screw\\n🔩\\tnut and bolt\\thome improvement tool\\n⚙️\\tgear\\tcog cogwheel tool\\n🗜️\\tclamp\\tcompress tool vice\\n⚖️\\tbalance scale\\tjustice libra scales\\n🦯\\twhite cane\\taccessibility blind probing\\n🔗\\tlink\\tlinks\\n⛓️\\tchains\\tchain\\n🪝\\thook\\tcatch crook curve\\n🧰\\ttoolbox\\tbox chest mechanic\\n🧲\\tmagnet\\tattraction horseshoe magnetic\\n🪜\\tladder\\tclimb rung step\\n⚗️\\talembic\\tchemistry tool\\n🧪\\ttest tube\\tchemist chemistry experiment\\n🧫\\tpetri dish\\tbacteria biologist biology\\n🧬\\tdna\\tbiologist evolution gene\\n🔬\\tmicroscope\\texperiment lab science\\n🔭\\ttelescope\\tcontact extraterrestrial science\\n📡\\tsatellite antenna\\taliens contact dish\\n💉\\tsyringe\\tdoctor flu medicine\\n🩸\\tdrop of blood\\tbleed donation injury\\n💊\\tpill\\tdoctor drugs medicated\\n🩹\\tadhesive bandage\\t\\n🩼\\tcrutch\\taid cane disability\\n🩺\\tstethoscope\\tdoctor heart medicine\\n🩻\\tx-ray\\tbones doctor medical\\n🚪\\tdoor\\tback closet front\\n🛗\\televator\\taccessibility hoist lift\\n🪞\\tmirror\\tmakeup reflection reflector\\n🪟\\twindow\\tair frame fresh\\n🛏️\\tbed\\thotel sleep\\n🛋️\\tcouch and lamp\\thotel\\n🪑\\tchair\\tseat sit\\n🚽\\ttoilet\\tbathroom\\n🪠\\tplunger\\tcup force plumber\\n🚿\\tshower\\twater\\n🛁\\tbathtub\\tbath\\n🪤\\tmouse trap\\tbait cheese lure\\n🪒\\trazor\\tsharp shave\\n🧴\\tlotion bottle\\tmoisturizer shampoo sunscreen\\n🧷\\tsafety pin\\tdiaper punk rock\\n🧹\\tbroom\\tcleaning sweeping witch\\n🧺\\tbasket\\tfarming laundry picnic\\n🧻\\troll of paper\\ttoilet towels\\n🪣\\tbucket\\tcask pail vat\\n🧼\\tsoap\\tbar bathing clean\\n🫧\\tbubbles\\tbubble burp clean\\n🪥\\ttoothbrush\\tbathroom brush clean\\n🧽\\tsponge\\tabsorbing cleaning porous\\n🧯\\tfire extinguisher\\textinguish quench\\n🛒\\tshopping cart\\ttrolley\\n🚬\\tcigarette\\tsmoking\\n⚰️\\tcoffin\\tdead death vampire\\n🪦\\theadstone\\tcemetery dead grave\\n⚱️\\tfuneral urn\\tashes death\\n🧿\\tnazar amulet\\tbead blue charm\\n🪬\\thamsa\\tamulet fatima fortune\\n🗿\\tmoai\\tface moyai statue\\n🪧\\tplacard\\tcard demonstration notice\\n🪪\\tidentification card\\tcredentials document id\",\n symbols: \"🏧\\tATM sign\\tautomated bank cash\\n🚮\\tlitter in bin sign\\tlitterbin\\n🚰\\tpotable water\\tdrinking\\n♿\\twheelchair symbol\\taccess handicap\\n🚹\\tmen’s room\\tbathroom lavatory man\\n🚺\\twomen’s room\\tbathroom lavatory restroom\\n🚻\\trestroom\\tbathroom lavatory toilet\\n🚼\\tbaby symbol\\tchanging\\n🚾\\twater closet\\tbathroom lavatory restroom\\n🛂\\tpassport control\\t\\n🛃\\tcustoms\\tpacking\\n🛄\\tbaggage claim\\tarrived bags case\\n🛅\\tleft luggage\\tbaggage case locker\\n⚠️\\twarning\\tcaution\\n🚸\\tchildren crossing\\tchild pedestrian traffic\\n⛔\\tno entry\\tdo fail forbidden\\n🚫\\tprohibited\\tentry forbidden no\\n🚳\\tno bicycles\\tbicycle bike forbidden\\n🚭\\tno smoking\\tforbidden not prohibited\\n🚯\\tno littering\\tforbidden litter not\\n🚱\\tnon-potable water\\tdry non-drinking non-potable\\n🚷\\tno pedestrians\\tforbidden not pedestrian\\n📵\\tno mobile phones\\tcell forbidden not\\n🔞\\tno one under eighteen\\t18 age forbidden\\n☢️\\tradioactive\\tsign\\n☣️\\tbiohazard\\tsign\\n⬆️\\tup arrow\\tcardinal direction north\\n↗️\\tup-right arrow\\tdirection intercardinal northeast\\n➡️\\tright arrow\\tcardinal direction east\\n↘️\\tdown-right arrow\\tdirection down-right intercardinal\\n⬇️\\tdown arrow\\tcardinal direction south\\n↙️\\tdown-left arrow\\tdirection down-left intercardinal\\n⬅️\\tleft arrow\\tcardinal direction west\\n↖️\\tup-left arrow\\tdirection intercardinal northwest\\n↕️\\tup-down arrow\\tup-down\\n↔️\\tleft-right arrow\\tleft-right\\n↩️\\tright arrow curving left\\t\\n↪️\\tleft arrow curving right\\t\\n⤴️\\tright arrow curving up\\t\\n⤵️\\tright arrow curving down\\t\\n🔃\\tclockwise vertical arrows\\tarrow refresh reload\\n🔄\\tcounterclockwise arrows button\\tagain anticlockwise arrow\\n🔙\\tBACK arrow\\t\\n🔚\\tEND arrow\\t\\n🔛\\tON! arrow\\tmark on!\\n🔜\\tSOON arrow\\tbrb omw\\n🔝\\tTOP arrow\\thomie up\\n🛐\\tplace of worship\\tpray religion\\n⚛️\\tatom symbol\\tatheist\\n🕉️\\tom\\thindu religion\\n✡️\\tstar of David\\tjew jewish judaism\\n☸️\\twheel of dharma\\tbuddhist religion\\n☯️\\tyin yang\\tdifficult lives religion\\n✝️\\tlatin cross\\tchrist christian religion\\n☦️\\torthodox cross\\tchristian religion\\n☪️\\tstar and crescent\\tislam muslim ramadan\\n☮️\\tpeace symbol\\thealing peaceful\\n🕎\\tmenorah\\tcandelabrum candlestick hanukkah\\n🔯\\tdotted six-pointed star\\tfortune jewish judaism\\n🪯\\tkhanda\\tdeg fateh khalsa\\n♈\\tAries\\thoroscope ram zodiac\\n♉\\tTaurus\\tbull horoscope ox\\n♊\\tGemini\\thoroscope twins zodiac\\n♋\\tCancer\\tcrab horoscope zodiac\\n♌\\tLeo\\thoroscope lion zodiac\\n♍\\tVirgo\\thoroscope zodiac\\n♎\\tLibra\\tbalance horoscope justice\\n♏\\tScorpio\\thoroscope scorpion scorpius\\n♐\\tSagittarius\\tarcher horoscope zodiac\\n♑\\tCapricorn\\tgoat horoscope zodiac\\n♒\\tAquarius\\tbearer horoscope water\\n♓\\tPisces\\tfish horoscope zodiac\\n⛎\\tOphiuchus\\tbearer serpent snake\\n🔀\\tshuffle tracks button\\tarrow crossed\\n🔁\\trepeat button\\tarrow clockwise\\n🔂\\trepeat single button\\tarrow clockwise once\\n▶️\\tplay button\\tarrow right triangle\\n⏩\\tfast-forward button\\tarrow double fast-forward\\n⏭️\\tnext track button\\tarrow scene triangle\\n⏯️\\tplay or pause button\\tarrow right triangle\\n◀️\\treverse button\\tarrow left triangle\\n⏪\\tfast reverse button\\tarrow double rewind\\n⏮️\\tlast track button\\tarrow previous scene\\n🔼\\tupwards button\\tarrow red up\\n⏫\\tfast up button\\tarrow double\\n🔽\\tdownwards button\\tarrow down red\\n⏬\\tfast down button\\tarrow double\\n⏸️\\tpause button\\tbar double vertical\\n⏹️\\tstop button\\tsquare\\n⏺️\\trecord button\\tcircle\\n⏏️\\teject button\\t\\n🎦\\tcinema\\tcamera film movie\\n🔅\\tdim button\\tbrightness low\\n🔆\\tbright button\\tbrightness light\\n📶\\tantenna bars\\tbar cell communication\\n🛜\\twireless\\tbroadband computer connectivity\\n📳\\tvibration mode\\tcell communication mobile\\n📴\\tmobile phone off\\tcell telephone\\n♀️\\tfemale sign\\twoman\\n♂️\\tmale sign\\tman\\n⚧️\\ttransgender symbol\\t\\n✖️\\tmultiply\\tcancel multiplication sign\\n➕\\tplus\\t+\\n➖\\tminus\\t- heavy math\\n➗\\tdivide\\tdivision heavy math\\n🟰\\theavy equals sign\\tanswer equal equality\\n♾️\\tinfinity\\tforever unbounded universal\\n‼️\\tdouble exclamation mark\\t! !! bangbang\\n⁉️\\texclamation question mark\\t! !? ?\\n❓\\tred question mark\\t? punctuation\\n❔\\twhite question mark\\t? outlined punctuation\\n❕\\twhite exclamation mark\\t! outlined punctuation\\n❗\\tred exclamation mark\\t! punctuation\\n〰️\\twavy dash\\tpunctuation\\n💱\\tcurrency exchange\\tbank money\\n💲\\theavy dollar sign\\tbillion cash charge\\n⚕️\\tmedical symbol\\taesculapius medicine staff\\n♻️\\trecycling symbol\\trecycle\\n⚜️\\tfleur-de-lis\\tknights\\n🔱\\ttrident emblem\\tanchor poseidon ship\\n📛\\tname badge\\t\\n🔰\\tJapanese symbol for beginner\\tchevron green leaf\\n⭕\\thollow red circle\\theavy large o\\n✅\\tcheck mark button\\tchecked checkmark complete\\n☑️\\tcheck box with check\\tballot checked done\\n✔️\\tcheck mark\\tchecked checkmark done\\n❌\\tcross mark\\tcancel multiplication multiply\\n❎\\tcross mark button\\tmultiplication multiply square\\n➰\\tcurly loop\\tcurl\\n➿\\tdouble curly loop\\tcurl\\n〽️\\tpart alternation mark\\t\\n✳️\\teight-spoked asterisk\\t* eight-spoked\\n✴️\\teight-pointed star\\t* eight-pointed\\n❇️\\tsparkle\\t*\\n©️\\tcopyright\\tc\\n®️\\tregistered\\tr\\n™️\\ttrade mark\\ttm trademark\\n#️⃣\\tkeycap: #\\t\\n*️⃣\\tkeycap: *\\t\\n0️⃣\\tkeycap: 0\\t\\n1️⃣\\tkeycap: 1\\t\\n2️⃣\\tkeycap: 2\\t\\n3️⃣\\tkeycap: 3\\t\\n4️⃣\\tkeycap: 4\\t\\n5️⃣\\tkeycap: 5\\t\\n6️⃣\\tkeycap: 6\\t\\n7️⃣\\tkeycap: 7\\t\\n8️⃣\\tkeycap: 8\\t\\n9️⃣\\tkeycap: 9\\t\\n🔟\\tkeycap: 10\\t\\n🔠\\tinput latin uppercase\\tabcd letters\\n🔡\\tinput latin lowercase\\tabcd letters\\n🔢\\tinput numbers\\t1234\\n🔣\\tinput symbols\\t% & ♪\\n🔤\\tinput latin letters\\tabc alphabet\\n🅰️\\tA button (blood type)\\t\\n🆎\\tAB button (blood type)\\t\\n🅱️\\tB button (blood type)\\t\\n🆑\\tCL button\\t\\n🆒\\tCOOL button\\t\\n🆓\\tFREE button\\t\\nℹ️\\tinformation\\ti\\n🆔\\tID button\\tidentity\\nⓂ️\\tcircled M\\tcircle\\n🆕\\tNEW button\\t\\n🆖\\tNG button\\t\\n🅾️\\tO button (blood type)\\t\\n🆗\\tOK button\\tokay\\n🅿️\\tP button\\tparking\\n🆘\\tSOS button\\thelp\\n🆙\\tUP! button\\tmark up!\\n🆚\\tVS button\\tversus\\n🈁\\tJapanese “here” button\\tkatakana\\n🈂️\\tJapanese “service charge” button\\tkatakana\\n🈷️\\tJapanese “monthly amount” button\\tideograph\\n🈶\\tJapanese “not free of charge” button\\tideograph\\n🈯\\tJapanese “reserved” button\\tideograph\\n🉐\\tJapanese “bargain” button\\tideograph\\n🈹\\tJapanese “discount” button\\tideograph\\n🈚\\tJapanese “free of charge” button\\tideograph\\n🈲\\tJapanese “prohibited” button\\tideograph\\n🉑\\tJapanese “acceptable” button\\tideograph\\n🈸\\tJapanese “application” button\\tideograph\\n🈴\\tJapanese “passing grade” button\\tideograph\\n🈳\\tJapanese “vacancy” button\\tideograph\\n㊗️\\tJapanese “congratulations” button\\tideograph\\n㊙️\\tJapanese “secret” button\\tideograph\\n🈺\\tJapanese “open for business” button\\tideograph\\n🈵\\tJapanese “no vacancy” button\\tideograph\\n🔴\\tred circle\\tgeometric\\n🟠\\torange circle\\t\\n🟡\\tyellow circle\\t\\n🟢\\tgreen circle\\t\\n🔵\\tblue circle\\tgeometric\\n🟣\\tpurple circle\\t\\n🟤\\tbrown circle\\t\\n⚫\\tblack circle\\tgeometric\\n⚪\\twhite circle\\tgeometric\\n🟥\\tred square\\tcard penalty\\n🟧\\torange square\\t\\n🟨\\tyellow square\\tcard penalty\\n🟩\\tgreen square\\t\\n🟦\\tblue square\\t\\n🟪\\tpurple square\\t\\n🟫\\tbrown square\\t\\n⬛\\tblack large square\\tgeometric\\n⬜\\twhite large square\\tgeometric\\n◼️\\tblack medium square\\tgeometric\\n◻️\\twhite medium square\\tgeometric\\n◾\\tblack medium-small square\\tgeometric medium-small\\n◽\\twhite medium-small square\\tgeometric medium-small\\n▪️\\tblack small square\\tgeometric\\n▫️\\twhite small square\\tgeometric\\n🔶\\tlarge orange diamond\\tgeometric\\n🔷\\tlarge blue diamond\\tgeometric\\n🔸\\tsmall orange diamond\\tgeometric\\n🔹\\tsmall blue diamond\\tgeometric\\n🔺\\tred triangle pointed up\\tgeometric\\n🔻\\tred triangle pointed down\\tgeometric\\n💠\\tdiamond with a dot\\tcomic geometric\\n🔘\\tradio button\\tgeometric\\n🔳\\twhite square button\\tgeometric outlined\\n🔲\\tblack square button\\tgeometric\",\n flags: \"🏁\\tchequered flag\\tcheckered finish flags\\n🚩\\ttriangular flag\\tconstruction golf post\\n🎌\\tcrossed flags\\tcelebration cross japanese\\n🏴\\tblack flag\\twaving\\n🏳️\\twhite flag\\twaving\\n🏳️🌈\\trainbow flag\\tbisexual gay genderqueer\\n🏳️⚧️\\ttransgender flag\\tblue light pink\\n🏴☠️\\tpirate flag\\tjolly plunder roger\\n🇦🇨\\tflag: Ascension Island\\tAC\\n🇦🇩\\tflag: Andorra\\tAD\\n🇦🇪\\tflag: United Arab Emirates\\tAE\\n🇦🇫\\tflag: Afghanistan\\tAF\\n🇦🇬\\tflag: Antigua & Barbuda\\tAG\\n🇦🇮\\tflag: Anguilla\\tAI\\n🇦🇱\\tflag: Albania\\tAL\\n🇦🇲\\tflag: Armenia\\tAM\\n🇦🇴\\tflag: Angola\\tAO\\n🇦🇶\\tflag: Antarctica\\tAQ\\n🇦🇷\\tflag: Argentina\\tAR\\n🇦🇸\\tflag: American Samoa\\tAS\\n🇦🇹\\tflag: Austria\\tAT\\n🇦🇺\\tflag: Australia\\tAU\\n🇦🇼\\tflag: Aruba\\tAW\\n🇦🇽\\tflag: Åland Islands\\tAX\\n🇦🇿\\tflag: Azerbaijan\\tAZ\\n🇧🇦\\tflag: Bosnia & Herzegovina\\tBA\\n🇧🇧\\tflag: Barbados\\tBB\\n🇧🇩\\tflag: Bangladesh\\tBD\\n🇧🇪\\tflag: Belgium\\tBE\\n🇧🇫\\tflag: Burkina Faso\\tBF\\n🇧🇬\\tflag: Bulgaria\\tBG\\n🇧🇭\\tflag: Bahrain\\tBH\\n🇧🇮\\tflag: Burundi\\tBI\\n🇧🇯\\tflag: Benin\\tBJ\\n🇧🇱\\tflag: St. Barthélemy\\tBL\\n🇧🇲\\tflag: Bermuda\\tBM\\n🇧🇳\\tflag: Brunei\\tBN\\n🇧🇴\\tflag: Bolivia\\tBO\\n🇧🇶\\tflag: Caribbean Netherlands\\tBQ\\n🇧🇷\\tflag: Brazil\\tBR\\n🇧🇸\\tflag: Bahamas\\tBS\\n🇧🇹\\tflag: Bhutan\\tBT\\n🇧🇻\\tflag: Bouvet Island\\tBV\\n🇧🇼\\tflag: Botswana\\tBW\\n🇧🇾\\tflag: Belarus\\tBY\\n🇧🇿\\tflag: Belize\\tBZ\\n🇨🇦\\tflag: Canada\\tCA\\n🇨🇨\\tflag: Cocos (Keeling) Islands\\tCC\\n🇨🇩\\tflag: Congo - Kinshasa\\tCD\\n🇨🇫\\tflag: Central African Republic\\tCF\\n🇨🇬\\tflag: Congo - Brazzaville\\tCG\\n🇨🇭\\tflag: Switzerland\\tCH\\n🇨🇮\\tflag: Côte d’Ivoire\\tCI\\n🇨🇰\\tflag: Cook Islands\\tCK\\n🇨🇱\\tflag: Chile\\tCL\\n🇨🇲\\tflag: Cameroon\\tCM\\n🇨🇳\\tflag: China\\tCN\\n🇨🇴\\tflag: Colombia\\tCO\\n🇨🇵\\tflag: Clipperton Island\\tCP\\n🇨🇷\\tflag: Costa Rica\\tCR\\n🇨🇺\\tflag: Cuba\\tCU\\n🇨🇻\\tflag: Cape Verde\\tCV\\n🇨🇼\\tflag: Curaçao\\tCW\\n🇨🇽\\tflag: Christmas Island\\tCX\\n🇨🇾\\tflag: Cyprus\\tCY\\n🇨🇿\\tflag: Czechia\\tCZ\\n🇩🇪\\tflag: Germany\\tDE\\n🇩🇬\\tflag: Diego Garcia\\tDG\\n🇩🇯\\tflag: Djibouti\\tDJ\\n🇩🇰\\tflag: Denmark\\tDK\\n🇩🇲\\tflag: Dominica\\tDM\\n🇩🇴\\tflag: Dominican Republic\\tDO\\n🇩🇿\\tflag: Algeria\\tDZ\\n🇪🇦\\tflag: Ceuta & Melilla\\tEA\\n🇪🇨\\tflag: Ecuador\\tEC\\n🇪🇪\\tflag: Estonia\\tEE\\n🇪🇬\\tflag: Egypt\\tEG\\n🇪🇭\\tflag: Western Sahara\\tEH\\n🇪🇷\\tflag: Eritrea\\tER\\n🇪🇸\\tflag: Spain\\tES\\n🇪🇹\\tflag: Ethiopia\\tET\\n🇪🇺\\tflag: European Union\\tEU\\n🇫🇮\\tflag: Finland\\tFI\\n🇫🇯\\tflag: Fiji\\tFJ\\n🇫🇰\\tflag: Falkland Islands\\tFK\\n🇫🇲\\tflag: Micronesia\\tFM\\n🇫🇴\\tflag: Faroe Islands\\tFO\\n🇫🇷\\tflag: France\\tFR\\n🇬🇦\\tflag: Gabon\\tGA\\n🇬🇧\\tflag: United Kingdom\\tGB\\n🇬🇩\\tflag: Grenada\\tGD\\n🇬🇪\\tflag: Georgia\\tGE\\n🇬🇫\\tflag: French Guiana\\tGF\\n🇬🇬\\tflag: Guernsey\\tGG\\n🇬🇭\\tflag: Ghana\\tGH\\n🇬🇮\\tflag: Gibraltar\\tGI\\n🇬🇱\\tflag: Greenland\\tGL\\n🇬🇲\\tflag: Gambia\\tGM\\n🇬🇳\\tflag: Guinea\\tGN\\n🇬🇵\\tflag: Guadeloupe\\tGP\\n🇬🇶\\tflag: Equatorial Guinea\\tGQ\\n🇬🇷\\tflag: Greece\\tGR\\n🇬🇸\\tflag: South Georgia & South Sandwich Islands\\tGS\\n🇬🇹\\tflag: Guatemala\\tGT\\n🇬🇺\\tflag: Guam\\tGU\\n🇬🇼\\tflag: Guinea-Bissau\\tGW\\n🇬🇾\\tflag: Guyana\\tGY\\n🇭🇰\\tflag: Hong Kong SAR China\\tHK\\n🇭🇲\\tflag: Heard & McDonald Islands\\tHM\\n🇭🇳\\tflag: Honduras\\tHN\\n🇭🇷\\tflag: Croatia\\tHR\\n🇭🇹\\tflag: Haiti\\tHT\\n🇭🇺\\tflag: Hungary\\tHU\\n🇮🇨\\tflag: Canary Islands\\tIC\\n🇮🇩\\tflag: Indonesia\\tID\\n🇮🇪\\tflag: Ireland\\tIE\\n🇮🇱\\tflag: Israel\\tIL\\n🇮🇲\\tflag: Isle of Man\\tIM\\n🇮🇳\\tflag: India\\tIN\\n🇮🇴\\tflag: British Indian Ocean Territory\\tIO\\n🇮🇶\\tflag: Iraq\\tIQ\\n🇮🇷\\tflag: Iran\\tIR\\n🇮🇸\\tflag: Iceland\\tIS\\n🇮🇹\\tflag: Italy\\tIT\\n🇯🇪\\tflag: Jersey\\tJE\\n🇯🇲\\tflag: Jamaica\\tJM\\n🇯🇴\\tflag: Jordan\\tJO\\n🇯🇵\\tflag: Japan\\tJP\\n🇰🇪\\tflag: Kenya\\tKE\\n🇰🇬\\tflag: Kyrgyzstan\\tKG\\n🇰🇭\\tflag: Cambodia\\tKH\\n🇰🇮\\tflag: Kiribati\\tKI\\n🇰🇲\\tflag: Comoros\\tKM\\n🇰🇳\\tflag: St. Kitts & Nevis\\tKN\\n🇰🇵\\tflag: North Korea\\tKP\\n🇰🇷\\tflag: South Korea\\tKR\\n🇰🇼\\tflag: Kuwait\\tKW\\n🇰🇾\\tflag: Cayman Islands\\tKY\\n🇰🇿\\tflag: Kazakhstan\\tKZ\\n🇱🇦\\tflag: Laos\\tLA\\n🇱🇧\\tflag: Lebanon\\tLB\\n🇱🇨\\tflag: St. Lucia\\tLC\\n🇱🇮\\tflag: Liechtenstein\\tLI\\n🇱🇰\\tflag: Sri Lanka\\tLK\\n🇱🇷\\tflag: Liberia\\tLR\\n🇱🇸\\tflag: Lesotho\\tLS\\n🇱🇹\\tflag: Lithuania\\tLT\\n🇱🇺\\tflag: Luxembourg\\tLU\\n🇱🇻\\tflag: Latvia\\tLV\\n🇱🇾\\tflag: Libya\\tLY\\n🇲🇦\\tflag: Morocco\\tMA\\n🇲🇨\\tflag: Monaco\\tMC\\n🇲🇩\\tflag: Moldova\\tMD\\n🇲🇪\\tflag: Montenegro\\tME\\n🇲🇫\\tflag: St. Martin\\tMF\\n🇲🇬\\tflag: Madagascar\\tMG\\n🇲🇭\\tflag: Marshall Islands\\tMH\\n🇲🇰\\tflag: North Macedonia\\tMK\\n🇲🇱\\tflag: Mali\\tML\\n🇲🇲\\tflag: Myanmar (Burma)\\tMM\\n🇲🇳\\tflag: Mongolia\\tMN\\n🇲🇴\\tflag: Macao SAR China\\tMO\\n🇲🇵\\tflag: Northern Mariana Islands\\tMP\\n🇲🇶\\tflag: Martinique\\tMQ\\n🇲🇷\\tflag: Mauritania\\tMR\\n🇲🇸\\tflag: Montserrat\\tMS\\n🇲🇹\\tflag: Malta\\tMT\\n🇲🇺\\tflag: Mauritius\\tMU\\n🇲🇻\\tflag: Maldives\\tMV\\n🇲🇼\\tflag: Malawi\\tMW\\n🇲🇽\\tflag: Mexico\\tMX\\n🇲🇾\\tflag: Malaysia\\tMY\\n🇲🇿\\tflag: Mozambique\\tMZ\\n🇳🇦\\tflag: Namibia\\tNA\\n🇳🇨\\tflag: New Caledonia\\tNC\\n🇳🇪\\tflag: Niger\\tNE\\n🇳🇫\\tflag: Norfolk Island\\tNF\\n🇳🇬\\tflag: Nigeria\\tNG\\n🇳🇮\\tflag: Nicaragua\\tNI\\n🇳🇱\\tflag: Netherlands\\tNL\\n🇳🇴\\tflag: Norway\\tNO\\n🇳🇵\\tflag: Nepal\\tNP\\n🇳🇷\\tflag: Nauru\\tNR\\n🇳🇺\\tflag: Niue\\tNU\\n🇳🇿\\tflag: New Zealand\\tNZ\\n🇴🇲\\tflag: Oman\\tOM\\n🇵🇦\\tflag: Panama\\tPA\\n🇵🇪\\tflag: Peru\\tPE\\n🇵🇫\\tflag: French Polynesia\\tPF\\n🇵🇬\\tflag: Papua New Guinea\\tPG\\n🇵🇭\\tflag: Philippines\\tPH\\n🇵🇰\\tflag: Pakistan\\tPK\\n🇵🇱\\tflag: Poland\\tPL\\n🇵🇲\\tflag: St. Pierre & Miquelon\\tPM\\n🇵🇳\\tflag: Pitcairn Islands\\tPN\\n🇵🇷\\tflag: Puerto Rico\\tPR\\n🇵🇸\\tflag: Palestinian Territories\\tPS\\n🇵🇹\\tflag: Portugal\\tPT\\n🇵🇼\\tflag: Palau\\tPW\\n🇵🇾\\tflag: Paraguay\\tPY\\n🇶🇦\\tflag: Qatar\\tQA\\n🇷🇪\\tflag: Réunion\\tRE\\n🇷🇴\\tflag: Romania\\tRO\\n🇷🇸\\tflag: Serbia\\tRS\\n🇷🇺\\tflag: Russia\\tRU\\n🇷🇼\\tflag: Rwanda\\tRW\\n🇸🇦\\tflag: Saudi Arabia\\tSA\\n🇸🇧\\tflag: Solomon Islands\\tSB\\n🇸🇨\\tflag: Seychelles\\tSC\\n🇸🇩\\tflag: Sudan\\tSD\\n🇸🇪\\tflag: Sweden\\tSE\\n🇸🇬\\tflag: Singapore\\tSG\\n🇸🇭\\tflag: St. Helena\\tSH\\n🇸🇮\\tflag: Slovenia\\tSI\\n🇸🇯\\tflag: Svalbard & Jan Mayen\\tSJ\\n🇸🇰\\tflag: Slovakia\\tSK\\n🇸🇱\\tflag: Sierra Leone\\tSL\\n🇸🇲\\tflag: San Marino\\tSM\\n🇸🇳\\tflag: Senegal\\tSN\\n🇸🇴\\tflag: Somalia\\tSO\\n🇸🇷\\tflag: Suriname\\tSR\\n🇸🇸\\tflag: South Sudan\\tSS\\n🇸🇹\\tflag: São Tomé & Príncipe\\tST\\n🇸🇻\\tflag: El Salvador\\tSV\\n🇸🇽\\tflag: Sint Maarten\\tSX\\n🇸🇾\\tflag: Syria\\tSY\\n🇸🇿\\tflag: Eswatini\\tSZ\\n🇹🇦\\tflag: Tristan da Cunha\\tTA\\n🇹🇨\\tflag: Turks & Caicos Islands\\tTC\\n🇹🇩\\tflag: Chad\\tTD\\n🇹🇫\\tflag: French Southern Territories\\tTF\\n🇹🇬\\tflag: Togo\\tTG\\n🇹🇭\\tflag: Thailand\\tTH\\n🇹🇯\\tflag: Tajikistan\\tTJ\\n🇹🇰\\tflag: Tokelau\\tTK\\n🇹🇱\\tflag: Timor-Leste\\tTL\\n🇹🇲\\tflag: Turkmenistan\\tTM\\n🇹🇳\\tflag: Tunisia\\tTN\\n🇹🇴\\tflag: Tonga\\tTO\\n🇹🇷\\tflag: Türkiye\\tTR\\n🇹🇹\\tflag: Trinidad & Tobago\\tTT\\n🇹🇻\\tflag: Tuvalu\\tTV\\n🇹🇼\\tflag: Taiwan\\tTW\\n🇹🇿\\tflag: Tanzania\\tTZ\\n🇺🇦\\tflag: Ukraine\\tUA\\n🇺🇬\\tflag: Uganda\\tUG\\n🇺🇲\\tflag: U.S. Outlying Islands\\tUM\\n🇺🇳\\tflag: United Nations\\tUN\\n🇺🇸\\tflag: United States\\tUS\\n🇺🇾\\tflag: Uruguay\\tUY\\n🇺🇿\\tflag: Uzbekistan\\tUZ\\n🇻🇦\\tflag: Vatican City\\tVA\\n🇻🇨\\tflag: St. Vincent & Grenadines\\tVC\\n🇻🇪\\tflag: Venezuela\\tVE\\n🇻🇬\\tflag: British Virgin Islands\\tVG\\n🇻🇮\\tflag: U.S. Virgin Islands\\tVI\\n🇻🇳\\tflag: Vietnam\\tVN\\n🇻🇺\\tflag: Vanuatu\\tVU\\n🇼🇫\\tflag: Wallis & Futuna\\tWF\\n🇼🇸\\tflag: Samoa\\tWS\\n🇽🇰\\tflag: Kosovo\\tXK\\n🇾🇪\\tflag: Yemen\\tYE\\n🇾🇹\\tflag: Mayotte\\tYT\\n🇿🇦\\tflag: South Africa\\tZA\\n🇿🇲\\tflag: Zambia\\tZM\\n🇿🇼\\tflag: Zimbabwe\\tZW\\n🏴\\tflag: England\\tgbeng\\n🏴\\tflag: Scotland\\tgbsct\\n🏴\\tflag: Wales\\tgbwls\",\n} as const;\n","/**\n * @feat:chat\n * The emoji picker's logic, without React: the bundled emoji by category\n * (`emoji-data.ts`, generated, never fetched), search over their labels and\n * tags, and the person's recent emoji, kept with their drafts (so signing out\n * clears them with the drafts, through `clearDrafts`).\n */\nimport { draftKey } from \"./composer-state\";\nimport { EMOJI_GROUP_DATA } from \"./emoji-data\";\nimport type { DraftStorageLike } from \"./modules\";\n\nexport type EmojiCategoryId = keyof typeof EMOJI_GROUP_DATA;\n\nexport interface EmojiEntry {\n emoji: string;\n label: string;\n /** Search words beyond the label. */\n tags: string;\n}\n\n/** The categories in the order the picker shows them, each with the emoji its tab shows. */\nexport const EMOJI_CATEGORIES: readonly { id: EmojiCategoryId; icon: string }[] = [\n { id: \"smileys\", icon: \"😀\" },\n { id: \"people\", icon: \"👋\" },\n { id: \"nature\", icon: \"🐻\" },\n { id: \"food\", icon: \"🍔\" },\n { id: \"travel\", icon: \"🚗\" },\n { id: \"activities\", icon: \"⚽\" },\n { id: \"objects\", icon: \"💡\" },\n { id: \"symbols\", icon: \"❤️\" },\n { id: \"flags\", icon: \"🏳️\" },\n];\n\nconst parsed = new Map<EmojiCategoryId, EmojiEntry[]>();\n\n/** One category's emoji, parsed the first time it's asked for. */\nexport function emojiInCategory(id: EmojiCategoryId): readonly EmojiEntry[] {\n let list = parsed.get(id);\n if (!list) {\n list = EMOJI_GROUP_DATA[id].split(\"\\n\").map((line) => {\n const [emoji = \"\", label = \"\", tags = \"\"] = line.split(\"\\t\");\n return { emoji, label, tags };\n });\n parsed.set(id, list);\n }\n return list;\n}\n\nlet index: Map<string, EmojiEntry> | null = null;\nfunction byEmoji(): Map<string, EmojiEntry> {\n if (!index) {\n index = new Map();\n for (const c of EMOJI_CATEGORIES) for (const e of emojiInCategory(c.id)) index.set(e.emoji, e);\n }\n return index;\n}\n\n/** An emoji's entry (its label for screen readers), or a bare one for an emoji the data doesn't have. */\nexport function emojiEntry(emoji: string): EmojiEntry {\n return byEmoji().get(emoji) ?? { emoji, label: emoji, tags: \"\" };\n}\n\n/**\n * Emoji whose label or tags have a word starting with every word of the query, those whose\n * label starts with the query first. \"thumbs up\" finds 👍, \"heart\" every heart, \"gri\" 😀.\n */\nexport function searchEmoji(query: string, limit = 120): EmojiEntry[] {\n const words = query.toLowerCase().trim().split(/\\s+/).filter(Boolean);\n if (words.length === 0) return [];\n const whole = words.join(\" \");\n const first: EmojiEntry[] = [];\n const rest: EmojiEntry[] = [];\n for (const e of byEmoji().values()) {\n const label = e.label.toLowerCase();\n const hay = `${label} ${e.tags.toLowerCase()}`.split(/[^\\p{L}\\p{N}]+/u);\n if (!words.every((w) => hay.some((h) => h.startsWith(w)))) continue;\n (label.startsWith(whole) ? first : rest).push(e);\n }\n return [...first, ...rest].slice(0, limit);\n}\n\n/** How many recent emoji the picker keeps. */\nexport const RECENT_EMOJI_MAX = 24;\n\n/** `emoji` first, once, the oldest dropped past `max`. */\nexport function pushRecentEmoji(recents: readonly string[], emoji: string, max = RECENT_EMOJI_MAX): string[] {\n return [emoji, ...recents.filter((e) => e !== emoji)].slice(0, max);\n}\n\n/** Where a person's recent emoji are kept: under their drafts' prefix, so `clearDrafts` removes them too. */\nexport function recentEmojiKey(userId: string): string {\n return draftKey(userId, \"~recent-emoji\");\n}\n\nexport async function loadRecentEmoji(storage: DraftStorageLike, userId: string): Promise<string[]> {\n try {\n const raw = await storage.getItem(recentEmojiKey(userId));\n const list: unknown = raw ? JSON.parse(raw) : [];\n return Array.isArray(list) ? list.filter((e): e is string => typeof e === \"string\" && e.length > 0).slice(0, RECENT_EMOJI_MAX) : [];\n } catch {\n return [];\n }\n}\n\nexport async function saveRecentEmoji(storage: DraftStorageLike, userId: string, recents: readonly string[]): Promise<void> {\n try {\n await storage.setItem(recentEmojiKey(userId), JSON.stringify(recents.slice(0, RECENT_EMOJI_MAX)));\n } catch {\n // Recents are a convenience: losing them is not worth an error.\n }\n}\n\n/** Puts `insert` in place of the selected text (or at the cursor), and where the cursor goes after it. */\nexport function insertAtSelection(text: string, selection: { start: number; end: number } | null, insert: string): { text: string; cursor: number } {\n const start = Math.max(0, Math.min(selection?.start ?? text.length, text.length));\n const end = Math.max(start, Math.min(selection?.end ?? start, text.length));\n return { text: text.slice(0, start) + insert + text.slice(end), cursor: start + insert.length };\n}\n","/**\n * @feat:chat\n * The full emoji picker on genesis-ui-native: a search bar, a row of\n * category tabs (Recent first once there are any), and a grid of emoji.\n * Every emoji is bundled (`emoji-data.ts`) and drawn by the system font:\n * opening it fetches nothing. Recent emoji are kept per person with their\n * drafts (`modules.drafts`), so signing out clears them.\n *\n * `ChatEmojiPicker` is the content, for a sheet of your own (the long-press\n * sheet's \"+\" swaps it in); `ChatEmojiPickerSheet` is it in a NativeSheet\n * (the composer's emoji button).\n */\nimport { memo, useCallback, useEffect, useMemo, useRef, useState } from \"react\";\nimport { FlatList, Pressable, View, useWindowDimensions } from \"react-native\";\nimport { NativeEmptyState, NativeIcon, NativeSearchBar, NativeSheet, NativeText } from \"@marktiderman/genesis-ui-native/components\";\nimport { useThemeRoles } from \"@marktiderman/genesis-ui-native/hooks\";\nimport type { ChatNativeCopy } from \"./copy\";\nimport { useChatNative } from \"./context\";\nimport { EMOJI_CATEGORIES, emojiEntry, emojiInCategory, loadRecentEmoji, pushRecentEmoji, saveRecentEmoji, searchEmoji, type EmojiCategoryId, type EmojiEntry } from \"./emoji\";\n\nexport interface ChatEmojiPickerProps {\n onSelect: (emoji: string) => void;\n /** The signed-in person, whose recent emoji are kept (with `modules.drafts`). Without it, none are kept. */\n userId?: string | null;\n /** Points tall for the grid. Default about 40% of the window. */\n height?: number;\n testID?: string;\n}\n\ntype Tab = EmojiCategoryId | \"recent\";\n\nconst CATEGORY_COPY: Record<EmojiCategoryId, keyof ChatNativeCopy> = {\n smileys: \"emojiSmileys\",\n people: \"emojiPeople\",\n nature: \"emojiNature\",\n food: \"emojiFood\",\n travel: \"emojiTravel\",\n activities: \"emojiActivities\",\n objects: \"emojiObjects\",\n symbols: \"emojiSymbols\",\n flags: \"emojiFlags\",\n};\n\nconst CELL = 44;\n\n// Recents read once per person per launch, then kept here as they change.\nconst recentCache = new Map<string, string[]>();\n\n// Whose stored recents were read this launch (and merged into the cache).\nconst loaded = new Set<string>();\n\n/** Forgets the recent emoji held in memory (one person's, or everyone's): call it on sign-out, with `clearDrafts`. */\nexport function forgetRecentEmoji(userId?: string): void {\n if (userId) {\n recentCache.delete(userId);\n loaded.delete(userId);\n } else {\n recentCache.clear();\n loaded.clear();\n }\n}\n\nexport function ChatEmojiPicker({ onSelect, userId = null, height, testID = \"chat-emoji-picker\" }: ChatEmojiPickerProps) {\n const { modules, copy } = useChatNative();\n const colors = useThemeRoles();\n const { width: windowWidth, height: windowHeight } = useWindowDimensions();\n // Its own width once laid out (a sheet's padding), the window's until then.\n const [width, setWidth] = useState(windowWidth);\n const [query, setQuery] = useState(\"\");\n const [recents, setRecents] = useState<string[]>(() => (userId ? (recentCache.get(userId) ?? []) : []));\n const [tab, setTab] = useState<Tab>(recents.length ? \"recent\" : \"smileys\");\n const storage = modules.drafts;\n\n useEffect(() => {\n if (!userId || !storage || loaded.has(userId)) return;\n loaded.add(userId);\n let live = true;\n void loadRecentEmoji(storage, userId).then((stored) => {\n // Picked while it loaded: those come first, and the merged list is what's kept.\n const picked = recentCache.get(userId) ?? [];\n const list = picked.reduceRight((acc, e) => pushRecentEmoji(acc, e), stored);\n recentCache.set(userId, list);\n if (picked.length) void saveRecentEmoji(storage, userId, list);\n if (!live || list.length === 0) return;\n setRecents(list);\n setTab((t) => (t === \"smileys\" ? \"recent\" : t));\n });\n return () => {\n live = false;\n };\n }, [userId, storage]);\n\n const columns = Math.max(6, Math.floor(width / CELL));\n const gridHeight = height ?? Math.round(windowHeight * 0.4);\n const searching = query.trim().length > 0;\n const data: readonly EmojiEntry[] = useMemo(() => {\n if (searching) return searchEmoji(query);\n if (tab === \"recent\") return recents.map(emojiEntry);\n return emojiInCategory(tab);\n }, [searching, query, tab, recents]);\n\n const listRef = useRef<{ scrollToOffset?: (o: { offset: number; animated: boolean }) => void } | null>(null);\n const choose = useCallback(\n (emoji: string) => {\n onSelect(emoji);\n if (!userId) return;\n const next = pushRecentEmoji(recentCache.get(userId) ?? [], emoji);\n // Kept for next time; the grid on screen doesn't reorder under the finger.\n recentCache.set(userId, next);\n if (storage) void saveRecentEmoji(storage, userId, next);\n },\n [onSelect, userId, storage],\n );\n // The columns share the width, so the grid fills it edge to edge.\n const cellWidth = Math.floor(width / columns);\n const renderItem = useCallback(\n ({ item }: { item: EmojiEntry }) => <EmojiCell entry={item} width={cellWidth} onPress={choose} testID={`${testID}-emoji-${item.emoji}`} />,\n [choose, testID, cellWidth],\n );\n\n const tabs: { id: Tab; label: string; icon: string | null }[] = [\n ...(recents.length ? [{ id: \"recent\" as const, label: copy.recentEmoji, icon: null }] : []),\n ...EMOJI_CATEGORIES.map((c) => ({ id: c.id, label: copy[CATEGORY_COPY[c.id]] as string, icon: c.icon })),\n ];\n const heading = searching ? null : (tabs.find((t) => t.id === tab)?.label ?? null);\n\n return (\n <View testID={testID} style={{ gap: 8 }} onLayout={(e) => e.nativeEvent.layout.width > 0 && setWidth(e.nativeEvent.layout.width)}>\n <NativeSearchBar value={query} onChange={setQuery} placeholder={copy.searchEmoji} cancelLabel={copy.cancel} testID={`${testID}-search`} />\n {searching ? null : (\n <View accessibilityRole=\"tablist\" testID={`${testID}-tabs`} style={{ flexDirection: \"row\", justifyContent: \"space-between\" }}>\n {tabs.map((t) => {\n const on = t.id === tab;\n return (\n <Pressable\n key={t.id}\n testID={`${testID}-tab-${t.id}`}\n accessibilityRole=\"tab\"\n accessibilityLabel={t.label}\n accessibilityState={{ selected: on }}\n onPress={() => {\n setTab(t.id);\n listRef.current?.scrollToOffset?.({ offset: 0, animated: false });\n }}\n style={{ minWidth: 36, height: 44, flexGrow: 1, alignItems: \"center\", justifyContent: \"center\", borderRadius: 10, backgroundColor: on ? colors.fill : undefined }}\n >\n {t.icon ? (\n <NativeText style={{ fontSize: 20, lineHeight: 26, opacity: on ? 1 : 0.55 }}>{t.icon}</NativeText>\n ) : (\n <NativeIcon name=\"clock\" size={20} color={on ? colors.label : colors.secondaryLabel} />\n )}\n </Pressable>\n );\n })}\n </View>\n )}\n {heading ? (\n <NativeText preset=\"caption\" accessibilityRole=\"header\" style={{ color: colors.secondaryLabel, fontWeight: \"600\", paddingHorizontal: 4 }}>\n {heading}\n </NativeText>\n ) : null}\n <View style={{ height: gridHeight }}>\n {data.length === 0 ? (\n <NativeEmptyState variant=\"no-results\" title={copy.noEmoji} testID={`${testID}-empty`} />\n ) : (\n <FlatList\n ref={listRef as never}\n key={columns}\n testID={`${testID}-grid`}\n data={data as EmojiEntry[]}\n numColumns={columns}\n keyExtractor={(e) => e.emoji}\n renderItem={renderItem}\n keyboardShouldPersistTaps=\"handled\"\n keyboardDismissMode=\"on-drag\"\n initialNumToRender={columns * 8}\n // With numColumns, FlatList lays out rows: the index here is a row's.\n getItemLayout={(_d, row) => ({ length: CELL, offset: CELL * row, index: row })}\n />\n )}\n </View>\n </View>\n );\n}\n\nconst EmojiCell = memo(function EmojiCell({ entry, width, onPress, testID }: { entry: EmojiEntry; width: number; onPress: (emoji: string) => void; testID: string }) {\n return (\n <Pressable\n testID={testID}\n accessibilityRole=\"button\"\n accessibilityLabel={entry.label}\n onPress={() => onPress(entry.emoji)}\n style={{ width: Math.max(CELL, width), height: CELL, alignItems: \"center\", justifyContent: \"center\" }}\n >\n {/* A line height of its own: the text preset's is a body line's and clips a 28pt glyph. */}\n <NativeText style={{ fontSize: 28, lineHeight: 36 }} accessible={false}>\n {entry.emoji}\n </NativeText>\n </Pressable>\n );\n});\n\nexport interface ChatEmojiPickerSheetProps extends Omit<ChatEmojiPickerProps, \"onSelect\"> {\n open: boolean;\n onClose: () => void;\n /** An emoji was chosen. The sheet stays open, for another. */\n onSelect: (emoji: string) => void;\n}\n\n/** The picker in a sheet, with a title and Done. */\nexport function ChatEmojiPickerSheet({ open, onClose, onSelect, testID = \"chat-emoji-sheet\", ...rest }: ChatEmojiPickerSheetProps) {\n const { copy } = useChatNative();\n const colors = useThemeRoles();\n return (\n <NativeSheet open={open} onOpenChange={(o) => (o ? undefined : onClose())} testID={testID}>\n <View style={{ gap: 4, paddingHorizontal: 16 }}>\n <View style={{ flexDirection: \"row\", alignItems: \"center\", justifyContent: \"space-between\", minHeight: 44 }}>\n <NativeText preset=\"h4\" accessibilityRole=\"header\">\n {copy.emojiPicker}\n </NativeText>\n <Pressable testID={`${testID}-done`} accessibilityRole=\"button\" accessibilityLabel={copy.closeViewer} onPress={onClose} style={{ minWidth: 44, minHeight: 44, alignItems: \"center\", justifyContent: \"center\" }}>\n <NativeIcon name=\"close\" size={22} color={colors.secondaryLabel} />\n </Pressable>\n </View>\n {open ? <ChatEmojiPicker onSelect={onSelect} testID={`${testID}-picker`} {...rest} /> : null}\n </View>\n </NativeSheet>\n );\n}\n","/**\n * @feat:chat\n * The voice recorder as a state machine, apart from expo-audio so it can be\n * tested: hold the mic to record, slide left to cancel, slide up to lock and\n * record hands-free, release (or tap send when locked) to send. A recording\n * shorter than `minMs` is dropped, and one that reaches the role's limit is\n * sent. Each step returns the effects the hook carries out.\n */\nimport type { HapticEvent } from \"./modules\";\n\nexport type RecorderPhase = \"idle\" | \"starting\" | \"recording\" | \"finishing\";\n\nexport type RecorderNotice = \"denied\" | \"too-short\" | \"error\" | \"interrupted\";\n\nexport interface RecorderState {\n phase: RecorderPhase;\n /** Hands-free: released without stopping. */\n locked: boolean;\n /** The finger has slid far enough left that letting go cancels. */\n cancelArmed: boolean;\n /** Let go while the microphone was still starting. */\n releasedEarly: boolean;\n durationMs: number;\n /** Level readings (dB) since the start, for the live waveform and the sent one. */\n levels: number[];\n /**\n * Why the last attempt ended without a voice note: \"denied\" (no microphone), \"too-short\",\n * \"error\" (the recording couldn't be saved), \"interrupted\" (a call, Siri, another app or the\n * app going to the background took the microphone; what was recorded is thrown away).\n */\n notice: RecorderNotice | null;\n}\n\nexport const idleRecorder: RecorderState = {\n phase: \"idle\",\n locked: false,\n cancelArmed: false,\n releasedEarly: false,\n durationMs: 0,\n levels: [],\n notice: null,\n};\n\nexport type RecorderEvent =\n | { type: \"press\" }\n | { type: \"ready\" }\n | { type: \"failed\"; reason: \"denied\" | \"error\" }\n | { type: \"move\"; dx: number; dy: number }\n | { type: \"release\" }\n | { type: \"send\" }\n | { type: \"cancel\" }\n | { type: \"tick\"; durationMs: number; meteringDb?: number }\n /** Something else took the microphone (a call, Siri, the app went to the background). */\n | { type: \"interrupted\" }\n /** The stop is done: `ok` false when no voice note came of it (the stop threw, no file). */\n | { type: \"finished\"; ok?: boolean };\n\nexport type RecorderEffect =\n | { type: \"prepare\" }\n | { type: \"record\" }\n /** Stop and send what was recorded. */\n | { type: \"finish\" }\n /** Stop and throw it away. */\n | { type: \"discard\" }\n | { type: \"haptic\"; event: HapticEvent }\n /** Tell the others you are recording. */\n | { type: \"signal\" };\n\nexport interface RecorderConfig {\n /** The longest recording (recordingLimitMs(role)). */\n limitMs: number;\n /** Shorter than this is a tap, not a voice note. Default 700 ms. */\n minMs?: number;\n /** Points left that cancel. Default 120. */\n cancelDistance?: number;\n /** Points up that lock. Default 80. */\n lockDistance?: number;\n /** Most level readings kept (one every ~100 ms). Default 3000 (5 minutes). */\n maxLevels?: number;\n}\n\nexport interface Step {\n state: RecorderState;\n effects: RecorderEffect[];\n}\n\nconst stay = (state: RecorderState): Step => ({ state, effects: [] });\n\nexport function recorderStep(state: RecorderState, event: RecorderEvent, config: RecorderConfig): Step {\n const minMs = config.minMs ?? 700;\n const cancelDistance = config.cancelDistance ?? 120;\n const lockDistance = config.lockDistance ?? 80;\n const maxLevels = config.maxLevels ?? 3000;\n\n switch (event.type) {\n case \"press\":\n if (state.phase !== \"idle\") return stay(state);\n return { state: { ...idleRecorder, phase: \"starting\" }, effects: [{ type: \"prepare\" }] };\n\n case \"ready\":\n // A prepare that finished after its attempt was cancelled: let the microphone go.\n if (state.phase !== \"starting\") return { state, effects: [{ type: \"discard\" }] };\n if (state.releasedEarly) {\n return { state: { ...idleRecorder, notice: \"too-short\" }, effects: [{ type: \"discard\" }] };\n }\n return {\n state: { ...state, phase: \"recording\" },\n effects: [{ type: \"record\" }, { type: \"haptic\", event: \"record-start\" }, { type: \"signal\" }],\n };\n\n case \"failed\":\n if (state.phase === \"idle\") return stay(state);\n return { state: { ...idleRecorder, notice: event.reason }, effects: [{ type: \"discard\" }, { type: \"haptic\", event: \"error\" }] };\n\n case \"move\": {\n if (state.phase !== \"recording\" || state.locked) return stay(state);\n if (event.dx <= -cancelDistance) {\n return { state: idleRecorder, effects: [{ type: \"discard\" }, { type: \"haptic\", event: \"record-cancel\" }] };\n }\n if (event.dy <= -lockDistance) {\n return { state: { ...state, locked: true, cancelArmed: false }, effects: [{ type: \"haptic\", event: \"record-lock\" }] };\n }\n const cancelArmed = event.dx <= -cancelDistance / 2;\n return cancelArmed === state.cancelArmed ? stay(state) : stay({ ...state, cancelArmed });\n }\n\n case \"release\":\n if (state.phase === \"starting\") return stay({ ...state, releasedEarly: true });\n if (state.phase !== \"recording\" || state.locked) return stay(state);\n if (state.cancelArmed) {\n return { state: idleRecorder, effects: [{ type: \"discard\" }, { type: \"haptic\", event: \"record-cancel\" }] };\n }\n if (state.durationMs < minMs) {\n return { state: { ...idleRecorder, notice: \"too-short\" }, effects: [{ type: \"discard\" }] };\n }\n return { state: { ...state, phase: \"finishing\" }, effects: [{ type: \"finish\" }, { type: \"haptic\", event: \"send\" }] };\n\n case \"send\":\n if (state.phase !== \"recording\") return stay(state);\n if (state.durationMs < minMs) {\n return { state: { ...idleRecorder, notice: \"too-short\" }, effects: [{ type: \"discard\" }] };\n }\n return { state: { ...state, phase: \"finishing\" }, effects: [{ type: \"finish\" }, { type: \"haptic\", event: \"send\" }] };\n\n case \"cancel\":\n if (state.phase === \"idle\" || state.phase === \"finishing\") return stay(state);\n return { state: idleRecorder, effects: [{ type: \"discard\" }, { type: \"haptic\", event: \"record-cancel\" }] };\n\n case \"interrupted\":\n // Never sent on its own: the person didn't say send. A stop already under way finishes.\n if (state.phase === \"idle\" || state.phase === \"finishing\") return stay(state);\n return { state: { ...idleRecorder, notice: \"interrupted\" }, effects: [{ type: \"discard\" }, { type: \"haptic\", event: \"error\" }] };\n\n case \"tick\": {\n if (state.phase !== \"recording\") return stay(state);\n const levels =\n event.meteringDb === undefined ? state.levels : [...state.levels, event.meteringDb].slice(-maxLevels);\n const next = { ...state, durationMs: event.durationMs, levels };\n if (event.durationMs >= config.limitMs) {\n return { state: { ...next, phase: \"finishing\" }, effects: [{ type: \"finish\" }, { type: \"haptic\", event: \"send\" }] };\n }\n return { state: next, effects: [{ type: \"signal\" }] };\n }\n\n case \"finished\":\n if (event.ok === false) return { state: { ...idleRecorder, notice: \"error\" }, effects: [{ type: \"haptic\", event: \"error\" }] };\n return stay(idleRecorder);\n }\n}\n\n/** The last `count` levels as bar heights 0–1, for the live waveform while recording. */\nexport function liveBars(levelsDb: readonly number[], count = 32): number[] {\n const recent = levelsDb.slice(-count);\n const bars = recent.map((db) => (Number.isFinite(db) ? Math.max(0, Math.min(1, (Math.max(-60, db) + 60) / 60)) : 0));\n return [...new Array(Math.max(0, count - bars.length)).fill(0), ...bars];\n}\n","/**\n * @feat:chat\n * The recorder machine on expo-audio: asks for the microphone, records with\n * metering on, reads the level every 100 ms for the live waveform (and to tell\n * the others you are recording), and hands back a voice note as a LocalFile\n * whose meta carries its duration and waveform, ready for `send`.\n *\n * Interruptions end the attempt cleanly, with a notice: the app going to the\n * background, or the recorder stopping on its own (a phone call, Siri, another\n * app taking the microphone) or its status no longer reading. A stop that fails\n * or leaves no file says so. Leaving the screen while a stop is under way lets\n * that stop finish and send what was recorded.\n */\nimport { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\nimport { AppState } from \"react-native\";\nimport { waveformFromMetering } from \"../core/media\";\nimport type { LocalFile } from \"../core/outbox\";\nimport { haptic, type ExpoAudioLike, type HapticsLike } from \"./modules\";\nimport { idleRecorder, recorderStep, type RecorderConfig, type RecorderEffect, type RecorderEvent, type RecorderState } from \"./recorder-machine\";\n\nexport interface UseVoiceRecorderOptions extends Omit<RecorderConfig, \"limitMs\"> {\n limitMs: number;\n onRecorded: (file: LocalFile) => void;\n /** `useConversation().signalRecording` (throttled there). */\n signalRecording?: () => void;\n haptics?: HapticsLike;\n /** How often the level is read. Default 100 ms. */\n intervalMs?: number;\n}\n\n/** Reads in a row that show the recorder stopped (or can't be read) before it counts as interrupted. */\nexport const RECORDER_STALL_READS = 3;\n/** Reads after `record()` that may pass before the recorder says it is recording; then the attempt failed. */\nexport const RECORDER_START_READS = 10;\n\n/** The voice note a finished recording becomes. */\nexport function voiceNoteFile(uri: string, durationMs: number, levelsDb: readonly number[]): LocalFile {\n return {\n data: uri,\n name: \"voice.m4a\",\n contentType: \"audio/mp4\",\n meta: { kind: \"voice\", durationMs: Math.round(durationMs), waveform: waveformFromMetering([...levelsDb]) },\n };\n}\n\nexport function useVoiceRecorder(audio: ExpoAudioLike, options: UseVoiceRecorderOptions) {\n const recorder = audio.useAudioRecorder(useMemo(() => ({ ...audio.RecordingPresets.HIGH_QUALITY, isMeteringEnabled: true }), [audio]));\n const [state, setState] = useState<RecorderState>(idleRecorder);\n const stateRef = useRef(state);\n const latest = useRef(options);\n latest.current = options;\n const timer = useRef<ReturnType<typeof setInterval> | null>(null);\n const recording = useRef(false);\n // A stop (finish) under way: unmounting leaves it to finish rather than stopping twice.\n const stopping = useRef(false);\n // Each press is an attempt; an async step that finishes after its attempt ended is dropped.\n const attempt = useRef(0);\n const mounted = useRef(true);\n\n const stopTimer = () => {\n if (timer.current) clearInterval(timer.current);\n timer.current = null;\n };\n\n // Never throws: letting the microphone go is best effort.\n const releaseAudio = () => {\n try {\n void Promise.resolve(audio.setAudioModeAsync({ allowsRecording: false })).catch(() => undefined);\n } catch {\n // The audio module is already gone.\n }\n };\n\n const dispatchRef = useRef<(event: RecorderEvent) => void>(() => undefined);\n\n const run = useCallback(\n (effect: RecorderEffect, after: RecorderState) => {\n const dispatch = dispatchRef.current;\n switch (effect.type) {\n case \"prepare\": {\n const mine = ++attempt.current;\n const current = () => mounted.current && attempt.current === mine && stateRef.current.phase === \"starting\";\n void (async () => {\n try {\n const permission = await audio.requestRecordingPermissionsAsync();\n if (!current()) return;\n if (!permission.granted) return dispatch({ type: \"failed\", reason: \"denied\" });\n await audio.setAudioModeAsync({ allowsRecording: true, playsInSilentMode: true });\n if (!current()) return releaseAudio();\n await recorder.prepareToRecordAsync();\n if (!current()) return releaseAudio();\n dispatch({ type: \"ready\" });\n } catch {\n if (current()) dispatch({ type: \"failed\", reason: \"error\" });\n else releaseAudio();\n }\n })();\n return;\n }\n case \"record\": {\n try {\n recorder.record();\n } catch {\n dispatch({ type: \"failed\", reason: \"error\" });\n return;\n }\n recording.current = true;\n stopTimer();\n // Reads in a row where the recorder had stopped by itself or couldn't be read: a few\n // mean something else has the microphone, and the attempt ends instead of freezing.\n let stalled = 0;\n let sawRecording = false;\n let reads = 0;\n timer.current = setInterval(() => {\n reads++;\n let s: ReturnType<typeof recorder.getStatus> | null = null;\n try {\n s = recorder.getStatus();\n } catch {\n s = null;\n }\n if (s && s.isRecording) sawRecording = true;\n // Before the first read that says recording, a stopped recorder is still starting.\n const bad = !s || (sawRecording && !s.isRecording);\n stalled = bad ? stalled + 1 : 0;\n if (stalled >= RECORDER_STALL_READS) return dispatch({ type: \"interrupted\" });\n // record() that never started (the microphone was taken before it began): not a frozen 0:00.\n if (!sawRecording && reads >= RECORDER_START_READS) return dispatch({ type: \"failed\", reason: \"error\" });\n if (s && !bad) dispatch({ type: \"tick\", durationMs: s.durationMillis, meteringDb: s.metering });\n }, latest.current.intervalMs ?? 100);\n return;\n }\n case \"finish\":\n stopTimer();\n stopping.current = true;\n void (async () => {\n let ok = false;\n const read = <T,>(get: () => T): T | null => {\n try {\n return get();\n } catch {\n return null;\n }\n };\n try {\n const status = recorder.getStatus();\n // Known before the stop (from prepare): the native recorder may be released while it stops.\n const before = read(() => recorder.uri) ?? status.url;\n await recorder.stop();\n const uri = read(() => recorder.uri) ?? before;\n const durationMs = Math.max(after.durationMs, status.durationMillis || 0);\n if (uri) {\n latest.current.onRecorded(voiceNoteFile(uri, durationMs, after.levels));\n ok = true;\n }\n } catch {\n // Nothing usable was recorded: the notice says so.\n } finally {\n recording.current = false;\n stopping.current = false;\n releaseAudio();\n dispatch({ type: \"finished\", ok });\n }\n })();\n return;\n case \"discard\":\n attempt.current++;\n stopTimer();\n if (recording.current && !stopping.current) {\n recording.current = false;\n void recorder.stop().catch(() => undefined);\n }\n releaseAudio();\n return;\n case \"haptic\":\n haptic(latest.current.haptics, effect.event);\n return;\n case \"signal\":\n latest.current.signalRecording?.();\n return;\n }\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [audio, recorder],\n );\n\n const dispatch = useCallback(\n (event: RecorderEvent) => {\n if (!mounted.current) return;\n const { limitMs, minMs, cancelDistance, lockDistance, maxLevels } = latest.current;\n const step = recorderStep(stateRef.current, event, { limitMs, minMs, cancelDistance, lockDistance, maxLevels });\n if (step.state !== stateRef.current) {\n stateRef.current = step.state;\n setState(step.state);\n }\n for (const effect of step.effects) run(effect, step.state);\n },\n [run],\n );\n dispatchRef.current = dispatch;\n\n // Leaving the screen mid-recording throws the recording away; a stop under way finishes and sends.\n useEffect(() => {\n mounted.current = true;\n return () => {\n mounted.current = false;\n attempt.current++;\n stateRef.current = idleRecorder;\n stopTimer();\n if (stopping.current) return;\n if (recording.current) {\n recording.current = false;\n try {\n void recorder.stop().catch(() => undefined);\n } catch {\n // The recorder is already gone.\n }\n }\n releaseAudio();\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [recorder]);\n\n // The app going to the background ends a recording (iOS takes the microphone from a backgrounded\n // app). Only once recording: Android reports the microphone permission dialog as the background.\n useEffect(() => {\n const sub = AppState?.addEventListener?.(\"change\", (next) => {\n if (next === \"background\" && stateRef.current.phase === \"recording\") dispatchRef.current({ type: \"interrupted\" });\n });\n return () => sub?.remove?.();\n }, []);\n\n return { state, dispatch };\n}\n","/**\n * @feat:chat\n * The composer: a field that grows with its text, photos and videos from the\n * library or camera and a pasted picture (attached as thumbnails), what the\n * message replies to, Send with a haptic, and, with expo-audio, the mic: hold\n * to record, slide left to cancel, slide up to lock and record hands-free.\n * The emoji button opens the full picker, which types where the cursor is.\n * With `onRecordVideo`, a camera button opens the video recorder. When the\n * person can't post, it says why instead of taking input.\n */\nimport { useEffect, useMemo, useRef, useState } from \"react\";\nimport { PanResponder, Pressable, ScrollView, TextInput, View } from \"react-native\";\nimport { NativeIcon, NativeImage, NativeListItem, NativeSheet, NativeText } from \"@marktiderman/genesis-ui-native/components\";\nimport { useThemeRoles } from \"@marktiderman/genesis-ui-native/hooks\";\nimport { CHAT_LIMITS, formatDuration, recordingLimitMs } from \"../core/media\";\nimport type { LocalFile } from \"../core/outbox\";\nimport type { ChatRole } from \"../core/types\";\nimport { canSend, fileFromDataUri, filesFromAssets, toSend } from \"./composer-state\";\nimport { fill } from \"./copy\";\nimport { useChatNative } from \"./context\";\nimport { insertAtSelection } from \"./emoji\";\nimport { ChatEmojiPickerSheet } from \"./emoji-picker\";\nimport { haptic, type ExpoAudioLike } from \"./modules\";\nimport { liveBars } from \"./recorder-machine\";\nimport type { ChatComposerHandle } from \"./use-composer\";\nimport { useVoiceRecorder } from \"./use-voice-recorder\";\n\nexport interface ChatComposerProps {\n composer: ChatComposerHandle;\n /** null while it loads. */\n canPost: boolean | null;\n /** Why not, when `canPost` is false (`composerDisabledReason`). */\n disabledReason: string | null;\n role: ChatRole | null;\n onSend: (payload: ReturnType<typeof toSend>) => void;\n signalTyping?: () => void;\n signalRecording?: () => void;\n /** The signed-in person (`useChat().userId`), whose recent emoji the picker keeps. */\n userId?: string | null;\n /** Touch and hold Send (or VoiceOver's action on it) to schedule what's written (`ChatScheduleSheet`). */\n onSchedule?: () => void;\n /** The field's placeholder (\"Message #Week 1\" in a topic). */\n placeholder?: string;\n /** Opens the video recorder (`ChatVideoRecorder`); with it, a camera button sits beside attach. */\n onRecordVideo?: () => void;\n testID?: string;\n}\n\nexport function ChatComposer(props: ChatComposerProps) {\n const { modules } = useChatNative();\n if (props.canPost === false) return <DisabledComposer reason={props.disabledReason} testID={props.testID ?? \"chat-composer\"} />;\n return modules.audio ? <ComposerWithVoice {...props} audio={modules.audio} /> : <ComposerBody {...props} voice={null} />;\n}\n\nfunction DisabledComposer({ reason, testID }: { reason: string | null; testID: string }) {\n const colors = useThemeRoles();\n const { copy } = useChatNative();\n return (\n <View testID={`${testID}-disabled`} accessible accessibilityRole=\"text\" style={{ padding: 16, alignItems: \"center\", backgroundColor: colors.groupedBackground }}>\n <NativeText preset=\"body-sm\" style={{ color: colors.secondaryLabel, textAlign: \"center\" }}>\n {reason ?? copy.cantPost}\n </NativeText>\n </View>\n );\n}\n\ntype Voice = ReturnType<typeof useVoiceRecorder>;\n\nfunction ComposerWithVoice(props: ChatComposerProps & { audio: ExpoAudioLike }) {\n const { modules } = useChatNative();\n const { composer, role, onSend } = props;\n // What the note replies to is taken when recording starts: the composer may change before it lands.\n const replyAtStart = useRef<string | null>(null);\n const voice = useVoiceRecorder(props.audio, {\n limitMs: recordingLimitMs(role),\n haptics: modules.haptics,\n signalRecording: props.signalRecording,\n // A voice note goes on its own, with what it replied to when recording started.\n onRecorded: (file: LocalFile) => {\n const replyToId = replyAtStart.current;\n replyAtStart.current = null;\n onSend({ input: { body: \"\", replyToId, mentions: [] }, files: [file] });\n if (replyToId && composer.state.replyTo?.messageId === replyToId) composer.setReply(null);\n },\n });\n const phase = voice.state.phase;\n useEffect(() => {\n if (phase === \"starting\") replyAtStart.current = composer.state.replyTo?.messageId ?? null;\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [phase]);\n return <ComposerBody {...props} voice={voice} />;\n}\n\nfunction ComposerBody({ composer, canPost, onSend, signalTyping, onRecordVideo, onSchedule, placeholder, voice, userId, testID = \"chat-composer\" }: ChatComposerProps & { voice: Voice | null }) {\n const { modules, copy } = useChatNative();\n const colors = useThemeRoles();\n const { state, dispatch } = composer;\n const [attachOpen, setAttachOpen] = useState(false);\n const [canPaste, setCanPaste] = useState(false);\n const [emojiOpen, setEmojiOpen] = useState(false);\n // Where the cursor is, so an emoji from the picker goes there.\n const selection = useRef<{ start: number; end: number } | null>(null);\n // The text as last typed or inserted: two picks before a re-render both land.\n const latestText = useRef(state.text);\n latestText.current = state.text;\n const insertEmoji = (emoji: string) => {\n const next = insertAtSelection(latestText.current, selection.current, emoji);\n latestText.current = next.text;\n selection.current = { start: next.cursor, end: next.cursor };\n dispatch({ type: \"text\", text: next.text });\n signalTyping?.();\n };\n const ready = canPost === true;\n const sendable = canSend(state, ready);\n const recording = voice && voice.state.phase !== \"idle\";\n const voiceNotice = voice?.state.phase === \"idle\" ? voice.state.notice : null;\n const notice =\n state.notice ??\n (voiceNotice === \"denied\" ? copy.micDenied : voiceNotice === \"too-short\" ? copy.tooShort : voiceNotice === \"error\" ? copy.recordingFailed : voiceNotice === \"interrupted\" ? copy.recordingInterrupted : null);\n\n const send = () => {\n if (!sendable) return;\n const payload = composer.take();\n if (!payload) return;\n haptic(modules.haptics, \"send\");\n onSend(payload);\n };\n\n const openAttach = async () => {\n let paste = false;\n try {\n paste = Boolean(await modules.clipboard?.hasImageAsync?.());\n } catch {\n paste = false;\n }\n setCanPaste(paste);\n // One source: straight to the picker, no sheet in between.\n if (!paste && !modules.imagePicker?.launchCameraAsync && modules.imagePicker) return pick(\"library\", false);\n setAttachOpen(true);\n };\n\n const remaining = CHAT_LIMITS.attachmentsPerMessage - state.attachments.length;\n // The picker opens once the sheet has gone: iOS won't present one modal while another is dismissing.\n const afterSheet = () => new Promise<void>((resolve) => setTimeout(resolve, 800));\n const pick = async (from: \"library\" | \"camera\", fromSheet = true) => {\n setAttachOpen(false);\n const picker = modules.imagePicker;\n if (!picker) return;\n if (fromSheet) await afterSheet();\n try {\n if (from === \"camera\") {\n const permission = await picker.requestCameraPermissionsAsync?.();\n if (permission && !permission.granted) return;\n }\n const result =\n from === \"camera\"\n ? await picker.launchCameraAsync?.({ mediaTypes: [\"images\", \"videos\"], quality: 0.8 })\n : await picker.launchImageLibraryAsync({ mediaTypes: [\"images\", \"videos\"], allowsMultipleSelection: true, selectionLimit: Math.max(1, remaining), quality: 0.8 });\n if (!result || result.canceled || !result.assets?.length) return;\n const { attachments, notice } = filesFromAssets(result.assets, copy);\n dispatch({ type: \"add\", attachments, notice, tooMany: fill(copy.tooMany, { count: CHAT_LIMITS.attachmentsPerMessage }) });\n } catch {\n haptic(modules.haptics, \"error\");\n }\n };\n\n const paste = async () => {\n setAttachOpen(false);\n try {\n const image = await modules.clipboard?.getImageAsync?.({ format: \"png\" });\n const attachment = image ? fileFromDataUri(image.data, image.size) : null;\n if (attachment) dispatch({ type: \"add\", attachments: [attachment], tooMany: fill(copy.tooMany, { count: CHAT_LIMITS.attachmentsPerMessage }) });\n } catch {\n haptic(modules.haptics, \"error\");\n }\n };\n\n return (\n <View testID={testID} style={{ backgroundColor: colors.groupedBackground, paddingHorizontal: 8, paddingTop: 6, paddingBottom: 6, gap: 6 }}>\n {notice ? (\n <NativeText testID={`${testID}-notice`} accessibilityLiveRegion=\"polite\" preset=\"caption\" style={{ color: colors.destructive, paddingHorizontal: 8 }}>\n {notice}\n </NativeText>\n ) : null}\n {state.replyTo ? (\n <View testID={`${testID}-reply`} style={{ flexDirection: \"row\", alignItems: \"center\", paddingLeft: 12, borderLeftWidth: 3, borderLeftColor: colors.tint, marginHorizontal: 4 }}>\n <View style={{ flex: 1 }}>\n <NativeText preset=\"caption\" style={{ color: colors.tint, fontWeight: \"600\" }}>\n {fill(copy.replyingTo, { name: state.replyTo.name })}\n </NativeText>\n <NativeText preset=\"caption\" numberOfLines={1} style={{ color: colors.secondaryLabel }}>\n {state.replyTo.preview}\n </NativeText>\n </View>\n <IconButton testID={`${testID}-reply-cancel`} icon=\"close\" label={copy.cancelReply} onPress={() => composer.setReply(null)} color={colors.secondaryLabel} />\n </View>\n ) : null}\n {state.attachments.length ? (\n <ScrollView horizontal showsHorizontalScrollIndicator={false} testID={`${testID}-attachments`} contentContainerStyle={{ gap: 8, paddingHorizontal: 4 }}>\n {state.attachments.map((a) => (\n <View key={a.key} testID={`${testID}-attachment-${a.key}`} style={{ width: 64, height: 64 }}>\n {a.file.previewUrl && (a.file.meta?.kind ?? \"image\") === \"image\" ? (\n <NativeImage src={a.file.previewUrl} width={64} height={64} className=\"rounded-xl\" alt={a.file.name} />\n ) : (\n <View style={{ width: 64, height: 64, borderRadius: 12, backgroundColor: colors.fill, alignItems: \"center\", justifyContent: \"center\" }}>\n <NativeIcon name={a.file.contentType.startsWith(\"video/\") ? \"play\" : \"file\"} size={22} />\n </View>\n )}\n <Pressable\n testID={`${testID}-attachment-${a.key}-remove`}\n accessibilityRole=\"button\"\n accessibilityLabel={fill(copy.removeAttachment, { name: a.file.name })}\n onPress={() => dispatch({ type: \"remove\", key: a.key })}\n hitSlop={12}\n style={{ position: \"absolute\", top: -6, right: -6, width: 24, height: 24, borderRadius: 12, backgroundColor: colors.label, alignItems: \"center\", justifyContent: \"center\" }}\n >\n <NativeIcon name=\"close\" size={14} color={colors.surface} />\n </Pressable>\n </View>\n ))}\n </ScrollView>\n ) : null}\n <View style={{ flexDirection: \"row\", alignItems: \"flex-end\", gap: 4 }}>\n {recording && voice ? (\n <RecordingBar voice={voice} testID={testID} />\n ) : (\n <>\n {modules.imagePicker || modules.clipboard?.getImageAsync ? (\n <IconButton testID={`${testID}-attach`} icon=\"plus\" label={copy.attach} onPress={() => void openAttach()} color={colors.tint} disabled={!ready} />\n ) : null}\n {onRecordVideo ? (\n <IconButton testID={`${testID}-video`} icon=\"video\" label={copy.recordVideo} onPress={onRecordVideo} color={colors.tint} disabled={!ready} />\n ) : null}\n <TextInput\n testID={`${testID}-input`}\n value={state.text}\n onChangeText={(text) => {\n dispatch({ type: \"text\", text });\n if (text) signalTyping?.();\n }}\n onSelectionChange={(e) => {\n selection.current = e.nativeEvent.selection;\n }}\n placeholder={placeholder ?? copy.placeholder}\n placeholderTextColor={colors.tertiaryLabel as string}\n accessibilityLabel={placeholder ?? copy.placeholder}\n editable={ready}\n multiline\n maxLength={CHAT_LIMITS.bodyChars}\n style={{\n flex: 1,\n minHeight: 40,\n maxHeight: 140,\n paddingHorizontal: 14,\n paddingTop: 10,\n paddingBottom: 10,\n borderRadius: 20,\n fontSize: 17,\n color: colors.label as string,\n backgroundColor: colors.surface,\n }}\n />\n <IconButton testID={`${testID}-emoji`} icon=\"smile\" label={copy.addEmoji} onPress={() => setEmojiOpen(true)} color={colors.secondaryLabel} disabled={!ready} />\n </>\n )}\n {sendable && !recording ? (\n <IconButton testID={`${testID}-send`} icon=\"arrow-up\" label={copy.send} onPress={send} onLongPress={onSchedule} longPressLabel={onSchedule ? copy.schedule : undefined} filled color={colors.tint} />\n ) : voice ? (\n <MicButton voice={voice} testID={testID} disabled={!ready} />\n ) : (\n <IconButton testID={`${testID}-send`} icon=\"arrow-up\" label={copy.send} onPress={send} filled color={colors.tint} disabled />\n )}\n </View>\n <ChatEmojiPickerSheet open={emojiOpen} onClose={() => setEmojiOpen(false)} onSelect={insertEmoji} userId={userId} testID={`${testID}-emoji-sheet`} />\n <NativeSheet open={attachOpen} onOpenChange={setAttachOpen} testID={`${testID}-attach-sheet`}>\n <View>\n {modules.imagePicker ? (\n <NativeListItem testID={`${testID}-attach-library`} title={copy.attachLibrary} leading={<NativeIcon name=\"image\" />} onPress={() => void pick(\"library\")} />\n ) : null}\n {modules.imagePicker?.launchCameraAsync ? (\n <NativeListItem testID={`${testID}-attach-camera`} title={copy.attachCamera} leading={<NativeIcon name=\"camera\" />} onPress={() => void pick(\"camera\")} />\n ) : null}\n {canPaste ? (\n <NativeListItem testID={`${testID}-attach-paste`} title={copy.attachPaste} leading={<NativeIcon name=\"copy\" />} onPress={() => void paste()} />\n ) : null}\n </View>\n </NativeSheet>\n </View>\n );\n}\n\nfunction IconButton({\n icon,\n label,\n onPress,\n color,\n filled = false,\n disabled = false,\n onLongPress,\n longPressLabel,\n testID,\n}: {\n icon: \"plus\" | \"arrow-up\" | \"close\" | \"trash\" | \"mic\" | \"video\" | \"smile\";\n label: string;\n onPress: () => void;\n onLongPress?: () => void;\n /** The long press as a VoiceOver / TalkBack action. */\n longPressLabel?: string;\n color: unknown;\n filled?: boolean;\n disabled?: boolean;\n testID: string;\n}) {\n const colors = useThemeRoles();\n return (\n <Pressable\n testID={testID}\n accessibilityRole=\"button\"\n accessibilityLabel={label}\n accessibilityState={{ disabled }}\n disabled={disabled}\n onPress={onPress}\n onLongPress={onLongPress}\n delayLongPress={onLongPress ? 400 : undefined}\n accessibilityActions={onLongPress && longPressLabel ? [{ name: \"longpress\", label: longPressLabel }] : undefined}\n onAccessibilityAction={onLongPress ? (e) => e.nativeEvent.actionName === \"longpress\" && onLongPress() : undefined}\n style={{ width: 44, height: 44, alignItems: \"center\", justifyContent: \"center\", opacity: disabled ? 0.4 : 1 }}\n >\n {filled ? (\n <View style={{ width: 34, height: 34, borderRadius: 17, backgroundColor: color as string, alignItems: \"center\", justifyContent: \"center\" }}>\n <NativeIcon name={icon} size={18} color={colors.surface} weight=\"semibold\" />\n </View>\n ) : (\n <NativeIcon name={icon} size={24} color={color as string} />\n )}\n </Pressable>\n );\n}\n\n/**\n * Hold to record. While held, the finger's movement slides to cancel or up to lock; locked, the\n * same button stops and sends. It stays one view throughout: swapping in another button while\n * the finger that locked is still down left the touch with a responder that no longer existed,\n * and the next tap anywhere on the screen did nothing.\n */\nfunction MicButton({ voice, disabled, testID }: { voice: Voice; disabled: boolean; testID: string }) {\n const { copy } = useChatNative();\n const colors = useThemeRoles();\n const { state, dispatch } = voice;\n const latest = useRef(dispatch);\n latest.current = dispatch;\n const locked = state.phase === \"recording\" && state.locked;\n const lockedNow = useRef(locked);\n lockedNow.current = locked;\n // VoiceOver and TalkBack can't hold and slide: a double tap starts a locked (hands-free) recording.\n const lockWhenReady = useRef(false);\n useEffect(() => {\n if (state.phase === \"recording\" && lockWhenReady.current) {\n lockWhenReady.current = false;\n dispatch({ type: \"move\", dx: 0, dy: -10_000 });\n }\n if (state.phase === \"idle\") lockWhenReady.current = false;\n }, [state.phase, dispatch]);\n\n const responder = useMemo(() => {\n // A touch that began on the locked button is a tap on Send, not a new hold.\n let tapToSend = false;\n return PanResponder.create({\n onStartShouldSetPanResponder: () => true,\n onMoveShouldSetPanResponder: () => true,\n onPanResponderTerminationRequest: () => false,\n onPanResponderGrant: () => {\n tapToSend = lockedNow.current;\n if (!tapToSend) latest.current({ type: \"press\" });\n },\n onPanResponderMove: (_e, g) => {\n if (!tapToSend) latest.current({ type: \"move\", dx: g.dx, dy: g.dy });\n },\n onPanResponderRelease: () => latest.current({ type: tapToSend ? \"send\" : \"release\" }),\n onPanResponderTerminate: () => {\n if (!tapToSend) latest.current({ type: \"cancel\" });\n },\n });\n }, []);\n\n const holding = !locked && (state.phase === \"starting\" || state.phase === \"recording\");\n return (\n <View style={{ alignItems: \"center\" }}>\n {holding ? (\n <View testID={`${testID}-lock-hint`} pointerEvents=\"none\" style={{ position: \"absolute\", bottom: 52, width: 36, height: 56, borderRadius: 18, backgroundColor: colors.surface, alignItems: \"center\", justifyContent: \"flex-start\", paddingTop: 8 }}>\n <NativeIcon name=\"lock\" size={16} color={colors.secondaryLabel} />\n <NativeIcon name=\"chevron-up\" size={14} color={colors.tertiaryLabel} />\n </View>\n ) : null}\n <View\n testID={locked ? `${testID}-voice-send` : `${testID}-mic`}\n accessible\n accessibilityRole=\"button\"\n accessibilityLabel={locked ? copy.stopAndSend : copy.recordVoice}\n accessibilityHint={locked ? undefined : copy.recordHint}\n accessibilityState={{ disabled }}\n accessibilityActions={disabled ? [] : [{ name: \"activate\" }]}\n onAccessibilityAction={(e) => {\n if (e.nativeEvent.actionName !== \"activate\") return;\n if (locked) return dispatch({ type: \"send\" });\n if (state.phase !== \"idle\") return;\n lockWhenReady.current = true;\n dispatch({ type: \"press\" });\n }}\n style={{ width: 44, height: 44, alignItems: \"center\", justifyContent: \"center\", opacity: disabled ? 0.4 : 1, transform: [{ scale: holding ? 1.25 : 1 }] }}\n {...(disabled ? {} : responder.panHandlers)}\n >\n <View style={{ width: 34, height: 34, borderRadius: 17, alignItems: \"center\", justifyContent: \"center\", backgroundColor: locked ? colors.tint : holding ? colors.destructive : \"transparent\" }}>\n <NativeIcon name={locked ? \"arrow-up\" : \"mic\"} size={locked || holding ? 18 : 24} color={locked || holding ? colors.surface : colors.tint} weight={locked ? \"semibold\" : undefined} />\n </View>\n </View>\n </View>\n );\n}\n\n/** While recording: the time, the live waveform, and slide-to-cancel (or, locked, Delete). */\nfunction RecordingBar({ voice, testID }: { voice: Voice; testID: string }) {\n const { copy } = useChatNative();\n const colors = useThemeRoles();\n const { state, dispatch } = voice;\n const bars = liveBars(state.levels, 28);\n return (\n <View testID={`${testID}-recording`} accessibilityLiveRegion=\"polite\" style={{ flex: 1, minHeight: 44, flexDirection: \"row\", alignItems: \"center\", gap: 8, paddingLeft: 4 }}>\n {state.locked ? (\n <IconButton testID={`${testID}-voice-cancel`} icon=\"trash\" label={copy.cancelRecording} onPress={() => dispatch({ type: \"cancel\" })} color={colors.destructive} />\n ) : (\n <View style={{ width: 10, height: 10, borderRadius: 5, backgroundColor: colors.destructive, marginLeft: 8 }} />\n )}\n <NativeText testID={`${testID}-recording-time`} style={{ fontVariant: [\"tabular-nums\"], color: colors.label, minWidth: 40 }}>\n {formatDuration(state.durationMs)}\n </NativeText>\n <View testID={`${testID}-recording-wave`} style={{ flex: 1, flexDirection: \"row\", alignItems: \"center\", gap: 2, height: 28, overflow: \"hidden\" }}>\n {bars.map((h, i) => (\n <View key={i} style={{ width: 3, borderRadius: 1.5, height: Math.max(3, Math.round(h * 28)), backgroundColor: colors.destructive }} />\n ))}\n </View>\n {state.locked ? (\n <View accessible accessibilityLabel={copy.lockedHint}>\n <NativeIcon name=\"lock\" size={16} color={colors.secondaryLabel} />\n </View>\n ) : (\n <NativeText preset=\"caption\" style={{ color: state.cancelArmed ? colors.destructive : colors.secondaryLabel }}>\n {state.cancelArmed ? copy.releaseToCancel : copy.slideToCancel}\n </NativeText>\n )}\n </View>\n );\n}\n","/**\n * @feat:chat\n * The composer's state for one thread, with its draft (per signed-in person):\n * restored when the thread opens, saved a moment after typing stops and when\n * the screen closes or moves to another thread, cleared on send. The thread screen owns it, so a swipe or the long-press\n * sheet can set what the next message replies to.\n */\nimport { useCallback, useEffect, useMemo, useReducer, useRef, useState } from \"react\";\nimport { composerReducer, createDraftSaver, draftKey, emptyComposer, loadDraft, memoryDraftStorage, toSend, type ComposerAction, type ComposerState, type ReplyTarget } from \"./composer-state\";\nimport { useChatNative } from \"./context\";\n\nconst memoryDrafts = memoryDraftStorage();\n\n/** `userId` is the signed-in person's (`useChat().userId`): drafts are kept per person. */\nexport function useChatComposer(conversationId: string, threadRootId: string | null | undefined, userId: string) {\n const { modules } = useChatNative();\n const storage = modules.drafts ?? memoryDrafts;\n const key = draftKey(userId, conversationId, threadRootId);\n const [state, dispatch] = useReducer(composerReducer, emptyComposer);\n const saver = useMemo(() => createDraftSaver(storage, key), [storage, key]);\n const restored = useRef<string | null>(null);\n // The key the state belongs to. Another conversation in the same screen starts empty, so one\n // thread's text, reply or files never show, save or send in the next (the draft flushed for the\n // old key first, in the cleanup below).\n // Kept in state, not a ref written during render (React's \"storing information from previous\n // renders\"): a render React drops would leave a ref on the new key with the reset never applied.\n const [stateKey, setStateKey] = useState(key);\n if (stateKey !== key) {\n setStateKey(key);\n dispatch({ type: \"reset\" });\n }\n\n useEffect(() => {\n let live = true;\n restored.current = null;\n void loadDraft(storage, key).then((draft) => {\n if (!live) return;\n if (draft) dispatch({ type: \"restore\", draft });\n // Only this key's own load: a late answer for a thread left behind must not stop this one saving.\n restored.current = key;\n });\n return () => {\n live = false;\n saver.flush();\n };\n }, [storage, key, saver]);\n\n useEffect(() => {\n // Don't overwrite the stored draft with the empty state before it has been read.\n if (restored.current !== key) return;\n saver.save({ text: state.text, replyTo: state.replyTo });\n }, [state.text, state.replyTo, saver, key]);\n\n const setReply = useCallback((to: ReplyTarget | null) => dispatch({ type: \"reply\", to }), []);\n\n // A second tap before the re-render must not send the same message again.\n const taken = useRef<ComposerState | null>(null);\n /** What to send (null when this state was already sent), and empties the composer and its draft. */\n const take = useCallback(() => {\n if (taken.current === state) return null;\n taken.current = state;\n const payload = toSend(state);\n dispatch({ type: \"sent\" });\n saver.clear();\n return payload;\n }, [state, saver]);\n\n return { state, dispatch: dispatch as (action: ComposerAction) => void, setReply, take };\n}\n\nexport type ChatComposerHandle = ReturnType<typeof useChatComposer>;\n","/**\n * @feat:chat\n * In the composer's place when your role in a conversation couldn't be read\n * (offline, a server hiccup): what happened and Retry\n * (`useConversation().refetchAccess`), instead of waiting quietly forever or\n * saying you can't post.\n */\nimport { View } from \"react-native\";\nimport { NativeButton, NativeInlineAlert } from \"@marktiderman/genesis-ui-native/components\";\nimport { useThemeRoles } from \"@marktiderman/genesis-ui-native/hooks\";\nimport { useChatNative } from \"./context\";\n\nexport interface ChatAccessErrorProps {\n onRetry: () => void;\n /** A retry is under way. */\n retrying?: boolean;\n testID?: string;\n}\n\nexport function ChatAccessError({ onRetry, retrying = false, testID = \"chat-access-error\" }: ChatAccessErrorProps) {\n const { copy } = useChatNative();\n const colors = useThemeRoles();\n return (\n <View testID={testID} style={{ padding: 12, gap: 10, backgroundColor: colors.groupedBackground }}>\n <NativeInlineAlert variant=\"warning\" description={copy.accessError} testID={`${testID}-alert`} />\n <NativeButton variant=\"outline\" size=\"lg\" onPress={onRetry} loading={retrying} testID={`${testID}-retry`}>\n {copy.retry}\n </NativeButton>\n </View>\n );\n}\n","/**\n * @feat:chat\n * The photo viewer: a message's photos full screen on black\n * (NativeFullScreenModal), swiped left and right, pinched or double-tapped\n * to zoom, swiped down (or Close) to leave. Share and Save show when the app\n * passed expo-sharing or expo-media-library (with `downloadFile` for photos\n * that are only a signed link).\n *\n * No gesture library: on iOS each photo is a zooming ScrollView (the\n * system's own pinch, and a pull down past the edge closes); on Android a\n * PanResponder pinches, pans and drags down. With VoiceOver or TalkBack the\n * pager is adjustable (swipe up or down for the next or previous photo).\n */\nimport { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\nimport {\n Animated,\n FlatList,\n PanResponder,\n Platform,\n Pressable,\n ScrollView,\n View,\n useWindowDimensions,\n type GestureResponderEvent,\n type NativeScrollEvent,\n type NativeSyntheticEvent,\n} from \"react-native\";\nimport { useSafeAreaInsets } from \"react-native-safe-area-context\";\nimport { FULL_SCREEN_DARK, NativeFullScreenModal, NativeIcon, NativeImage, NativeText, type NativeIconName } from \"@marktiderman/genesis-ui-native/components\";\nimport { useReducedMotion } from \"@marktiderman/genesis-ui-native/hooks\";\nimport type { ChatMessage } from \"../core/types\";\nimport { fill } from \"./copy\";\nimport { useChatNative } from \"./context\";\nimport { fromServer, type BubbleAttachment } from \"./media\";\nimport { haptic } from \"./modules\";\n\nexport interface ChatPhoto {\n key: string;\n /** A signed link or a file on the phone. */\n uri: string;\n /** What a screen reader says for it. */\n alt: string;\n}\n\nexport interface ChatPhotoViewerProps {\n /** The photos to page through; null closes the viewer. */\n photos: readonly ChatPhoto[] | null;\n /** The one to open at. Default the first. */\n initialIndex?: number;\n onClose: () => void;\n testID?: string;\n}\n\n/** Points pulled down (or dragged, on Android) that close the viewer on release. */\nexport const DISMISS_DISTANCE = 110;\n/** Or a quick flick down, in points per millisecond. */\nexport const DISMISS_VELOCITY = 1.1;\nexport const MAX_ZOOM = 4;\n\n/** Whether a drag down that ended here closes the viewer. */\nexport function shouldDismiss(dy: number, vy: number): boolean {\n return dy > DISMISS_DISTANCE || (dy > 24 && vy > DISMISS_VELOCITY);\n}\n\n/** The zoom a pinch has reached: from where it started, by how far the fingers spread. */\nexport function pinchScale(startScale: number, startDistance: number, distance: number): number {\n if (startDistance <= 0) return startScale;\n return Math.min(MAX_ZOOM, Math.max(0.8, startScale * (distance / startDistance)));\n}\n\n/** Points between two touches. */\nexport function touchDistance(touches: readonly { pageX: number; pageY: number }[]): number {\n const [a, b] = touches;\n if (!a || !b) return 0;\n return Math.hypot(a.pageX - b.pageX, a.pageY - b.pageY);\n}\n\n/** How far a zoomed photo may pan before an edge shows, per axis. */\nexport function panLimit(scale: number, size: number): number {\n return Math.max(0, ((scale - 1) * size) / 2);\n}\n\n/** A file already on the phone, which shares and saves without a download. */\nexport function isLocalUri(uri: string): boolean {\n return /^(file|ph|content|assets-library):/.test(uri);\n}\n\nconst clamp = (v: number, limit: number) => Math.max(-limit, Math.min(limit, v));\n// Between two `onPress`es (each fires on release): a quick double tap measured 330ms apart on iOS.\nexport const DOUBLE_TAP_MS = 400;\n\nexport function ChatPhotoViewer({ photos, initialIndex = 0, onClose, testID = \"chat-photo-viewer\" }: ChatPhotoViewerProps) {\n const open = photos !== null && photos.length > 0;\n return (\n <NativeFullScreenModal open={open} onOpenChange={(o) => (o ? undefined : onClose())} tone=\"none\" testID={testID}>\n {open ? <ViewerBody photos={photos} initialIndex={Math.min(Math.max(0, initialIndex), photos.length - 1)} onClose={onClose} testID={testID} /> : null}\n </NativeFullScreenModal>\n );\n}\n\nfunction ViewerBody({ photos, initialIndex, onClose, testID }: { photos: readonly ChatPhoto[]; initialIndex: number; onClose: () => void; testID: string }) {\n const { copy, modules } = useChatNative();\n const { width, height } = useWindowDimensions();\n const insets = useSafeAreaInsets();\n const reducedMotion = useReducedMotion();\n const [index, setIndex] = useState(initialIndex);\n const [zoomed, setZoomed] = useState(false);\n const [chrome, setChrome] = useState(true);\n const [busy, setBusy] = useState(false);\n const [notice, setNotice] = useState<string | null>(null);\n const backdrop = useRef(new Animated.Value(1)).current;\n const listRef = useRef<FlatList<ChatPhoto> | null>(null);\n const photo = photos[index] ?? photos[0]!;\n const many = photos.length > 1;\n\n useEffect(() => {\n if (!notice) return;\n const t = setTimeout(() => setNotice(null), 2500);\n return () => clearTimeout(t);\n }, [notice]);\n\n const goTo = useCallback(\n (i: number) => {\n if (i < 0 || i >= photos.length) return;\n setIndex(i);\n setZoomed(false);\n listRef.current?.scrollToIndex?.({ index: i, animated: !reducedMotion });\n },\n [photos.length, reducedMotion],\n );\n\n const onMomentumEnd = useCallback(\n (e: NativeSyntheticEvent<NativeScrollEvent>) => {\n const i = Math.round(e.nativeEvent.contentOffset.x / Math.max(1, width));\n if (i !== index && i >= 0 && i < photos.length) {\n setIndex(i);\n setZoomed(false);\n }\n },\n [width, index, photos.length],\n );\n\n // A copy on the phone for sharing and saving: a local file as is, a signed link through downloadFile.\n const local = async (uri: string) => (isLocalUri(uri) ? uri : modules.downloadFile ? modules.downloadFile(uri) : null);\n const reachable = Boolean(modules.downloadFile) || photos.every((p) => isLocalUri(p.uri));\n const canShare = Boolean(modules.sharing) && reachable;\n const canSave = Boolean(modules.mediaLibrary) && reachable;\n\n const run = async (what: \"share\" | \"save\") => {\n if (busy) return;\n setBusy(true);\n try {\n if (what === \"save\") {\n const lib = modules.mediaLibrary!;\n const permission = await lib.requestPermissionsAsync(true);\n if (!permission.granted) {\n setNotice(copy.photosDenied);\n return;\n }\n const file = await local(photo.uri);\n if (!file) throw new Error(\"no copy on the phone\");\n await lib.saveToLibraryAsync(file);\n haptic(modules.haptics, \"send\");\n setNotice(copy.photoSaved);\n } else {\n const sharing = modules.sharing!;\n if (!(await sharing.isAvailableAsync())) throw new Error(\"sharing unavailable\");\n const file = await local(photo.uri);\n if (!file) throw new Error(\"no copy on the phone\");\n await sharing.shareAsync(file, { dialogTitle: copy.sharePhoto });\n }\n } catch {\n haptic(modules.haptics, \"error\");\n setNotice(copy.actionFailed);\n } finally {\n setBusy(false);\n }\n };\n\n const toggleChrome = useCallback(() => setChrome((c) => !c), []);\n const onPull = useCallback((dy: number) => backdrop.setValue(Math.max(0.35, 1 - Math.max(0, dy) / 400)), [backdrop]);\n const renderItem = useCallback(\n ({ item, index: i }: { item: ChatPhoto; index: number }) => (\n <ZoomablePhoto\n photo={item}\n width={width}\n height={height}\n active={i === index}\n onZoomChange={setZoomed}\n onPull={onPull}\n onDismiss={onClose}\n onTap={toggleChrome}\n testID={`${testID}-photo-${i}`}\n />\n ),\n [width, height, index, onPull, onClose, toggleChrome, testID],\n );\n\n const counter = many ? fill(copy.photoOf, { n: index + 1, count: photos.length }) : null;\n return (\n <View style={{ flex: 1 }}>\n <Animated.View pointerEvents=\"none\" style={{ position: \"absolute\", top: 0, right: 0, bottom: 0, left: 0, backgroundColor: FULL_SCREEN_DARK, opacity: backdrop }} />\n <View\n style={{ flex: 1 }}\n accessible\n accessibilityRole=\"adjustable\"\n accessibilityLabel={photo.alt}\n accessibilityValue={counter ? { text: counter } : undefined}\n accessibilityHint={many ? copy.viewerHint : undefined}\n accessibilityActions={many ? [{ name: \"increment\" }, { name: \"decrement\" }] : []}\n onAccessibilityAction={(e) => {\n if (e.nativeEvent.actionName === \"increment\") goTo(index + 1);\n if (e.nativeEvent.actionName === \"decrement\") goTo(index - 1);\n }}\n testID={`${testID}-pager`}\n >\n <FlatList\n ref={listRef}\n testID={`${testID}-list`}\n data={photos as ChatPhoto[]}\n horizontal\n pagingEnabled\n scrollEnabled={many && !zoomed}\n showsHorizontalScrollIndicator={false}\n initialScrollIndex={initialIndex}\n getItemLayout={(_d, i) => ({ length: width, offset: width * i, index: i })}\n keyExtractor={(p) => p.key}\n renderItem={renderItem}\n onMomentumScrollEnd={onMomentumEnd}\n extraData={index}\n windowSize={3}\n initialNumToRender={1}\n />\n </View>\n {chrome ? (\n <View pointerEvents=\"box-none\" style={{ position: \"absolute\", top: insets.top, left: 0, right: 0, flexDirection: \"row\", alignItems: \"center\", gap: 8, paddingHorizontal: 8, minHeight: 52 }}>\n <ViewerButton icon=\"close\" label={copy.closeViewer} onPress={onClose} testID={`${testID}-close`} />\n <View style={{ flex: 1, alignItems: \"center\" }}>\n {counter ? (\n <NativeText testID={`${testID}-counter`} accessibilityLiveRegion=\"polite\" style={{ color: \"#FFFFFF\", fontWeight: \"600\", fontVariant: [\"tabular-nums\"] }}>\n {counter}\n </NativeText>\n ) : null}\n </View>\n {canSave ? <ViewerButton icon=\"download\" label={copy.savePhoto} onPress={() => void run(\"save\")} disabled={busy} testID={`${testID}-save`} /> : null}\n {canShare ? <ViewerButton icon=\"share\" label={copy.sharePhoto} onPress={() => void run(\"share\")} disabled={busy} testID={`${testID}-share`} /> : null}\n {!canSave && !canShare ? <View style={{ width: 44 }} /> : null}\n </View>\n ) : null}\n {notice ? (\n <View pointerEvents=\"none\" style={{ position: \"absolute\", left: 24, right: 24, bottom: insets.bottom + 24, alignItems: \"center\" }}>\n <View accessibilityLiveRegion=\"assertive\" testID={`${testID}-notice`} style={{ backgroundColor: \"rgba(40,40,40,0.92)\", borderRadius: 14, paddingHorizontal: 16, paddingVertical: 10 }}>\n <NativeText style={{ color: \"#FFFFFF\", textAlign: \"center\" }}>{notice}</NativeText>\n </View>\n </View>\n ) : null}\n </View>\n );\n}\n\nfunction ViewerButton({ icon, label, onPress, disabled = false, testID }: { icon: NativeIconName; label: string; onPress: () => void; disabled?: boolean; testID: string }) {\n return (\n <Pressable\n testID={testID}\n accessibilityRole=\"button\"\n accessibilityLabel={label}\n accessibilityState={{ disabled }}\n disabled={disabled}\n onPress={onPress}\n hitSlop={6}\n style={{ width: 44, height: 44, borderRadius: 22, alignItems: \"center\", justifyContent: \"center\", backgroundColor: \"rgba(0,0,0,0.45)\", opacity: disabled ? 0.5 : 1 }}\n >\n <NativeIcon name={icon} size={22} color=\"#FFFFFF\" />\n </Pressable>\n );\n}\n\ninterface ZoomableProps {\n photo: ChatPhoto;\n width: number;\n height: number;\n /** The page on screen: another page resets its zoom. */\n active: boolean;\n onZoomChange: (zoomed: boolean) => void;\n /** How far it's pulled down, for the backdrop's fade. */\n onPull: (dy: number) => void;\n onDismiss: () => void;\n onTap: () => void;\n testID: string;\n}\n\nfunction ZoomablePhoto(props: ZoomableProps) {\n return Platform.OS === \"ios\" ? <ZoomableIos {...props} /> : <ZoomablePan {...props} />;\n}\n\n/** The photo itself, contained, on a transparent background so the backdrop's fade shows. */\nfunction Photo({ photo, width, height, testID }: { photo: ChatPhoto; width: number; height: number; testID: string }) {\n return <NativeImage src={photo.uri} alt={photo.alt} width={width} height={height} contentFit=\"contain\" className=\"bg-transparent\" testID={testID} />;\n}\n\n/** A tap that waits to see whether it's the first half of a double tap. */\nfunction useTaps(onSingle: () => void, onDouble: (e: { locationX: number; locationY: number }) => void) {\n const last = useRef(0);\n const timer = useRef<ReturnType<typeof setTimeout> | null>(null);\n useEffect(\n () => () => {\n if (timer.current) clearTimeout(timer.current);\n },\n [],\n );\n return (e: GestureResponderEvent) => {\n const now = Date.now();\n const at = { locationX: e.nativeEvent?.locationX ?? 0, locationY: e.nativeEvent?.locationY ?? 0 };\n if (now - last.current < DOUBLE_TAP_MS) {\n last.current = 0;\n if (timer.current) clearTimeout(timer.current);\n onDouble(at);\n return;\n }\n last.current = now;\n timer.current = setTimeout(onSingle, DOUBLE_TAP_MS);\n };\n}\n\ntype ZoomRect = { x: number; y: number; width: number; height: number };\ntype ZoomScrollView = ScrollView & { scrollResponderZoomTo?: (rect: ZoomRect & { animated?: boolean }, animated?: boolean) => void };\n\n/**\n * Zooms to a rect. React Native 0.88 drops `rect.animated` and animates per the deprecated second\n * argument (ScrollView.js `scrollResponderZoomTo`), so both are given: the rect's keeps it from\n * warning, the second is the one it uses.\n */\nfunction zoomTo(view: ZoomScrollView | null, rect: ZoomRect, animated: boolean) {\n view?.scrollResponderZoomTo?.({ ...rect, animated }, animated);\n}\n\n/** iOS: the system's zooming scroll view; at full size, a pull down past the top closes. */\nfunction ZoomableIos({ photo, width, height, active, onZoomChange, onPull, onDismiss, onTap, testID }: ZoomableProps) {\n const ref = useRef<ZoomScrollView | null>(null);\n const scale = useRef(1);\n const reducedMotion = useReducedMotion();\n useEffect(() => {\n if (!active && scale.current > 1.01) {\n zoomTo(ref.current, { x: 0, y: 0, width, height }, false);\n scale.current = 1;\n }\n }, [active, width, height]);\n const tap = useTaps(onTap, (at) => {\n if (scale.current > 1.01) return zoomTo(ref.current, { x: 0, y: 0, width, height }, !reducedMotion);\n const w = width / 2.5;\n const h = height / 2.5;\n zoomTo(ref.current, { x: at.locationX - w / 2, y: at.locationY - h / 2, width: w, height: h }, !reducedMotion);\n });\n return (\n <ScrollView\n ref={ref as never}\n testID={testID}\n style={{ width, height }}\n contentContainerStyle={{ width, height }}\n maximumZoomScale={MAX_ZOOM}\n minimumZoomScale={1}\n bouncesZoom\n centerContent\n alwaysBounceVertical\n showsHorizontalScrollIndicator={false}\n showsVerticalScrollIndicator={false}\n scrollEventThrottle={16}\n onScroll={(e) => {\n const z = e.nativeEvent.zoomScale ?? 1;\n if (z > 1.01 !== scale.current > 1.01) onZoomChange(z > 1.01);\n scale.current = z;\n if (z <= 1.01) onPull(-e.nativeEvent.contentOffset.y);\n }}\n onScrollEndDrag={(e) => {\n if (scale.current > 1.01) return;\n // iOS reports the release velocity in points per millisecond, negative while pulling down.\n if (shouldDismiss(-e.nativeEvent.contentOffset.y, -(e.nativeEvent.velocity?.y ?? 0))) onDismiss();\n else onPull(0);\n }}\n >\n <Pressable accessible={false} onPress={tap} style={{ width, height }}>\n <Photo photo={photo} width={width} height={height} testID={`${testID}-image`} />\n </Pressable>\n </ScrollView>\n );\n}\n\n/** Android (no zooming ScrollView): two fingers pinch, one pans a zoomed photo or drags it down to close. */\nfunction ZoomablePan({ photo, width, height, active, onZoomChange, onPull, onDismiss, onTap, testID }: ZoomableProps) {\n const reducedMotion = useReducedMotion();\n const scale = useRef(new Animated.Value(1)).current;\n const tx = useRef(new Animated.Value(0)).current;\n const ty = useRef(new Animated.Value(0)).current;\n const s = useRef({ scale: 1, x: 0, y: 0, startScale: 1, startDistance: 0, startX: 0, startY: 0, pinching: false, dragging: false });\n\n const settle = useCallback(\n (to: { scale: number; x: number; y: number }) => {\n s.current.scale = to.scale;\n s.current.x = to.x;\n s.current.y = to.y;\n onZoomChange(to.scale > 1.01);\n if (reducedMotion) {\n scale.setValue(to.scale);\n tx.setValue(to.x);\n ty.setValue(to.y);\n return;\n }\n Animated.parallel([\n Animated.spring(scale, { toValue: to.scale, useNativeDriver: true }),\n Animated.spring(tx, { toValue: to.x, useNativeDriver: true }),\n Animated.spring(ty, { toValue: to.y, useNativeDriver: true }),\n ]).start();\n },\n [reducedMotion, onZoomChange, scale, tx, ty],\n );\n useEffect(() => {\n if (!active && s.current.scale > 1.01) settle({ scale: 1, x: 0, y: 0 });\n }, [active, settle]);\n\n const tap = useTaps(onTap, (at) => {\n if (s.current.scale > 1.01) return settle({ scale: 1, x: 0, y: 0 });\n const z = 2.5;\n settle({ scale: z, x: clamp((width / 2 - at.locationX) * (z - 1), panLimit(z, width)), y: clamp((height / 2 - at.locationY) * (z - 1), panLimit(z, height)) });\n });\n\n const responder = useMemo(\n () =>\n PanResponder.create({\n onStartShouldSetPanResponder: () => false,\n onMoveShouldSetPanResponder: (e, g) => e.nativeEvent.touches.length >= 2 || s.current.scale > 1.01 || (g.dy > 8 && Math.abs(g.dy) > Math.abs(g.dx) * 1.5),\n onPanResponderTerminationRequest: () => false,\n onPanResponderGrant: (e) => {\n const st = s.current;\n st.pinching = e.nativeEvent.touches.length >= 2;\n st.dragging = !st.pinching && st.scale <= 1.01;\n st.startScale = st.scale;\n st.startDistance = touchDistance(e.nativeEvent.touches);\n st.startX = st.x;\n st.startY = st.y;\n },\n onPanResponderMove: (e, g) => {\n const st = s.current;\n const touches = e.nativeEvent.touches;\n if (touches.length >= 2) {\n if (!st.pinching) {\n st.pinching = true;\n st.dragging = false;\n st.startScale = st.scale;\n st.startDistance = touchDistance(touches);\n }\n st.scale = pinchScale(st.startScale, st.startDistance, touchDistance(touches));\n scale.setValue(st.scale);\n return;\n }\n if (st.dragging) {\n st.y = Math.max(0, g.dy);\n ty.setValue(st.y);\n onPull(st.y);\n return;\n }\n if (st.scale > 1.01) {\n st.x = clamp(st.startX + g.dx, panLimit(st.scale, width));\n st.y = clamp(st.startY + g.dy, panLimit(st.scale, height));\n tx.setValue(st.x);\n ty.setValue(st.y);\n }\n },\n onPanResponderRelease: (_e, g) => {\n const st = s.current;\n if (st.dragging) {\n st.dragging = false;\n if (shouldDismiss(g.dy, g.vy)) return onDismiss();\n onPull(0);\n return settle({ scale: 1, x: 0, y: 0 });\n }\n st.pinching = false;\n const z = Math.max(1, st.scale);\n settle({ scale: z, x: clamp(st.x, panLimit(z, width)), y: clamp(st.y, panLimit(z, height)) });\n },\n onPanResponderTerminate: () => {\n onPull(0);\n settle({ scale: Math.max(1, s.current.scale), x: 0, y: 0 });\n },\n }),\n [width, height, onPull, onDismiss, settle, scale, tx, ty],\n );\n\n return (\n <View testID={testID} style={{ width, height, overflow: \"hidden\" }} {...responder.panHandlers}>\n <Animated.View style={{ width, height, transform: [{ translateX: tx }, { translateY: ty }, { scale }] }}>\n <Pressable accessible={false} onPress={tap} style={{ width, height }}>\n <Photo photo={photo} width={width} height={height} testID={`${testID}-image`} />\n </Pressable>\n </Animated.View>\n </View>\n );\n}\n\n/**\n * The photos of the message a tapped photo belongs to, and where it is among them, for\n * `ChatPhotoViewer`: swiping goes through that message's photos. A photo in no message\n * (one still sending, shown from the phone) opens alone.\n */\nexport function galleryFor(\n messages: readonly ChatMessage[],\n urls: Record<string, string>,\n uri: string,\n alt: string,\n label: (a: BubbleAttachment) => string,\n): { photos: ChatPhoto[]; index: number } {\n for (const m of messages) {\n const images = m.attachments.filter((a) => a.kind === \"image\").map((a) => fromServer(a, urls));\n if (!images.some((a) => a.uri === uri)) continue;\n const photos = images.filter((a): a is BubbleAttachment & { uri: string } => Boolean(a.uri)).map((a) => ({ key: a.key, uri: a.uri, alt: label(a) }));\n return { photos, index: Math.max(0, photos.findIndex((p) => p.uri === uri)) };\n }\n return { photos: [{ key: uri, uri, alt }], index: 0 };\n}\n\nexport interface ChatMediaViewerProps {\n /** The picture to show; null closes the viewer. */\n image: { uri: string; alt: string } | null;\n onClose: () => void;\n testID?: string;\n}\n\n/** One picture in the full-screen viewer (`ChatPhotoViewer` pages through several). */\nexport function ChatMediaViewer({ image, onClose, testID = \"chat-media-viewer\" }: ChatMediaViewerProps) {\n const photos = useMemo(() => (image ? [{ key: image.uri, uri: image.uri, alt: image.alt }] : null), [image]);\n return <ChatPhotoViewer photos={photos} onClose={onClose} testID={testID} />;\n}\n","/**\n * @feat:chat\n * Which actions a message offers this person, from the same rules migration\n * 0001 enforces (react and reply need can_post; pin follows\n * useConversation().canPin: an owner or admin, or a member of a two-person\n * kind; delete needs the sender, an owner or\n * admin, or an observer who may post). The server stays the judge: an action\n * it refuses shows a toast.\n */\nimport type { ChatMessage, ChatRole } from \"../core/types\";\n\nexport type MessageActionId = \"reply\" | \"copy\" | \"pin\" | \"unpin\" | \"delete\";\n\n/** The quick reactions on the long-press sheet. */\nexport const QUICK_REACTIONS = [\"👍\", \"❤️\", \"😂\", \"😮\", \"😢\", \"🙏\"] as const;\n\nexport interface MessageActionContext {\n me: string;\n role: ChatRole | null;\n canPost: boolean;\n pinned: boolean;\n /** May pin here (`useConversation().canPin`: an owner or admin, or a member of a two-person kind). */\n canPin: boolean;\n /** Copy needs expo-clipboard. */\n canCopy: boolean;\n}\n\nexport function canReactTo(message: ChatMessage, ctx: Pick<MessageActionContext, \"canPost\">): boolean {\n return ctx.canPost && !message.deletedAt && message.kind === \"text\";\n}\n\nexport function messageActionsFor(message: ChatMessage, ctx: MessageActionContext): MessageActionId[] {\n if (message.deletedAt || message.kind === \"system\") return [];\n const out: MessageActionId[] = [];\n if (ctx.canPost) out.push(\"reply\");\n if (ctx.canCopy && message.body.trim()) out.push(\"copy\");\n const admin = ctx.role === \"owner\" || ctx.role === \"admin\";\n if (message.visibility === \"everyone\" && ctx.canPin) out.push(ctx.pinned ? \"unpin\" : \"pin\");\n const own = message.senderId === ctx.me && ctx.role !== null;\n if (own || admin || (ctx.role === \"observer\" && ctx.canPost)) out.push(\"delete\");\n return out;\n}\n","/**\n * @feat:chat\n * The long-press sheet: a row of quick reactions and \"+\" for every emoji\n * (the picker takes the sheet's place), then Reply, Copy, Pin or\n * Unpin, and Delete (confirmed), offered per `messageActionsFor`. Each runs\n * through `useMessageActions`; a refusal from the server is a toast.\n */\nimport { useEffect, useState } from \"react\";\nimport { Alert, Pressable, View } from \"react-native\";\nimport { NativeIcon, NativeListItem, NativeSheet, NativeText, type NativeIconName } from \"@marktiderman/genesis-ui-native/components\";\nimport { useThemeRoles } from \"@marktiderman/genesis-ui-native/hooks\";\nimport { previewText, summarizeReactions } from \"../core/thread\";\nimport type { ChatMessage } from \"../core/types\";\nimport { QUICK_REACTIONS, canReactTo, messageActionsFor, type MessageActionContext, type MessageActionId } from \"./actions\";\nimport { fill } from \"./copy\";\nimport { useChatNative } from \"./context\";\nimport { ChatEmojiPicker } from \"./emoji-picker\";\n\nexport interface MessageActionsSheetProps {\n message: ChatMessage | null;\n context: MessageActionContext;\n onClose: () => void;\n onReact: (message: ChatMessage, emoji: string, on: boolean) => void;\n onAction: (message: ChatMessage, action: MessageActionId) => void;\n testID?: string;\n}\n\nconst ICONS: Record<MessageActionId, NativeIconName> = { reply: \"reply\", copy: \"copy\", pin: \"pin\", unpin: \"pin\", delete: \"trash\" };\n\nexport function MessageActionsSheet({ message, context, onClose, onReact, onAction, testID = \"chat-message-actions\" }: MessageActionsSheetProps) {\n const { copy } = useChatNative();\n const colors = useThemeRoles();\n const actions = message ? messageActionsFor(message, context) : [];\n const mineReactions = new Set(message ? summarizeReactions(message, context.me).filter((r) => r.mine).map((r) => r.emoji) : []);\n const labels: Record<MessageActionId, string> = { reply: copy.reply, copy: copy.copy, pin: copy.pin, unpin: copy.unpin, delete: copy.delete };\n // \"+\" swaps the sheet's content for the full picker (iOS can't present a second sheet over this one).\n const [picking, setPicking] = useState(false);\n useEffect(() => {\n if (!message) setPicking(false);\n }, [message]);\n\n const run = (action: MessageActionId) => {\n if (!message) return;\n if (action === \"delete\") {\n Alert.alert(copy.deleteConfirm, undefined, [\n { text: copy.delete, style: \"destructive\", onPress: () => onAction(message, \"delete\") },\n { text: copy.cancel, style: \"cancel\" },\n ]);\n onClose();\n return;\n }\n onClose();\n onAction(message, action);\n };\n\n return (\n <NativeSheet open={message !== null} onOpenChange={(open) => (open ? undefined : onClose())} testID={testID}>\n {message && picking ? (\n <View style={{ paddingHorizontal: 16 }}>\n <ChatEmojiPicker\n userId={context.me}\n testID={`${testID}-picker`}\n onSelect={(emoji) => {\n onClose();\n onReact(message, emoji, !mineReactions.has(emoji));\n }}\n />\n </View>\n ) : message ? (\n <View style={{ gap: 12, paddingBottom: 8, paddingHorizontal: 16 }}>\n <NativeText numberOfLines={2} preset=\"body-sm\" style={{ color: colors.secondaryLabel, paddingHorizontal: 4 }}>\n {previewText(message.body, message.attachments[0]?.kind, Boolean(message.deletedAt))}\n </NativeText>\n {canReactTo(message, context) ? (\n <View accessibilityRole=\"toolbar\" style={{ flexDirection: \"row\", justifyContent: \"space-between\" }}>\n {QUICK_REACTIONS.map((emoji) => {\n const on = mineReactions.has(emoji);\n return (\n <Pressable\n key={emoji}\n testID={`${testID}-react-${emoji}`}\n accessibilityRole=\"button\"\n accessibilityState={{ selected: on }}\n accessibilityLabel={fill(copy.react, { emoji })}\n onPress={() => {\n onClose();\n onReact(message, emoji, !on);\n }}\n style={{ width: 48, height: 48, borderRadius: 24, alignItems: \"center\", justifyContent: \"center\", backgroundColor: on ? colors.fill : undefined }}\n >\n <NativeText style={{ fontSize: 26, lineHeight: 34 }}>{emoji}</NativeText>\n </Pressable>\n );\n })}\n <Pressable\n testID={`${testID}-react-more`}\n accessibilityRole=\"button\"\n accessibilityLabel={copy.moreReactions}\n onPress={() => setPicking(true)}\n style={{ width: 48, height: 48, borderRadius: 24, alignItems: \"center\", justifyContent: \"center\", backgroundColor: colors.fill }}\n >\n <NativeIcon name=\"plus\" size={22} color={colors.secondaryLabel} />\n </Pressable>\n </View>\n ) : null}\n <View>\n {actions.map((action) => (\n <NativeListItem\n key={action}\n testID={`${testID}-${action}`}\n title={labels[action]}\n leading={<NativeIcon name={ICONS[action]} size={20} color={action === \"delete\" ? colors.destructive : colors.label} />}\n onPress={() => run(action)}\n />\n ))}\n </View>\n </View>\n ) : null}\n </NativeSheet>\n );\n}\n","/**\n * @feat:chat\n * The thread as rows for the list: day separators, the \"New messages\" line,\n * and each message with where its group of one sender starts and ends (the\n * name goes over the first, the avatar beside the last, in a group\n * conversation). Oldest first, top to bottom: the order the thread's list\n * shows and VoiceOver reads (a day's heading and the \"New messages\" line\n * before the messages they head).\n * A row is keyed by the message's client id, so a message that lands keeps\n * its row.\n */\nimport { dayLabel, startsDay, startsGroup, itemSender, itemTime, type ThreadItem } from \"../core/thread\";\n\nexport type ThreadRow =\n | { type: \"day\"; key: string; label: string }\n | { type: \"unread\"; key: string }\n | {\n type: \"message\";\n key: string;\n item: ThreadItem;\n mine: boolean;\n senderId: string | null;\n groupStart: boolean;\n groupEnd: boolean;\n /** Over the first of a run, in a group, for someone else's. */\n showName: boolean;\n /** Beside the last of a run, in a group, for someone else's. */\n showAvatar: boolean;\n };\n\nexport interface BuildRowsOptions {\n me: string;\n firstUnreadId?: string | null;\n /** More than two people: names and avatars show. */\n group: boolean;\n now?: Date;\n locale?: string;\n}\n\nexport function rowKey(item: ThreadItem): string {\n return `c:${item.type === \"message\" ? item.message.clientId : item.pending.clientId}`;\n}\n\n/** Oldest first. */\nexport function buildThreadRows(items: ThreadItem[], options: BuildRowsOptions): ThreadRow[] {\n const { me, firstUnreadId, group, now = new Date(), locale } = options;\n const rows: ThreadRow[] = [];\n for (let i = 0; i < items.length; i++) {\n const item = items[i]!;\n if (startsDay(items, i)) rows.push({ type: \"day\", key: `d:${rowKey(item)}`, label: dayLabel(itemTime(item), now, locale) });\n if (item.type === \"message\" && item.message.id === firstUnreadId) rows.push({ type: \"unread\", key: \"unread\" });\n const senderId = itemSender(item);\n const mine = item.type === \"pending\" || senderId === me;\n const system = item.type === \"message\" && item.message.kind === \"system\";\n const groupStart = startsGroup(items, i) || (item.type === \"message\" && item.message.id === firstUnreadId);\n const nextItem = items[i + 1];\n const groupEnd = !nextItem || startsGroup(items, i + 1) || (nextItem.type === \"message\" && nextItem.message.id === firstUnreadId);\n rows.push({\n type: \"message\",\n key: rowKey(item),\n item,\n mine,\n senderId,\n groupStart,\n groupEnd,\n showName: group && !mine && !system && groupStart,\n showAvatar: group && !mine && !system && groupEnd,\n });\n }\n return rows;\n}\n\n/**\n * Newest first, for an inverted list (its first row sits at the bottom). The\n * thread screen no longer uses it: VoiceOver reads an inverted list's rows\n * newest first, each day's heading after its messages.\n * @deprecated Use `buildThreadRows` in a list that isn't inverted.\n */\nexport function invertedRows(items: ThreadItem[], options: BuildRowsOptions): ThreadRow[] {\n return buildThreadRows(items, options).reverse();\n}\n","/**\n * @feat:chat\n * One conversation: a list oldest first, top to bottom, the order it reads in\n * with VoiceOver (FlashList's bottom-anchored chat mode when the app gave it,\n * else FlatList), that opens at the newest message, follows new ones while\n * you are at the bottom, goes to the bottom when you send, and keeps its\n * place while earlier ones load at the top; day separators, the \"New messages\" line,\n * grouped bubbles with names and avatars in groups, who is typing or\n * recording, retry and delete on a send that failed, the long-press sheet and\n * swipe to reply, a message's photos in the full-screen viewer, and the composer above\n * the keyboard (or, when your role couldn't be read, Retry). Render it as the screen's only content, under the\n * navigator's header with `useChatThreadStackOptions` (an opaque bar).\n *\n * Not inverted: FlashList 2 keeps the first visible row in place when rows\n * change and only follows new rows at the bottom (`autoscrollToBottomThreshold`;\n * it declares `autoscrollToTopThreshold` but never reads it), so in an inverted list a new message\n * at index 0 was pushed under the composer. Inverted, VoiceOver also read\n * each day's heading after its messages.\n *\n * Organising: a topic bar when the conversation has topics (the list shows the topic chosen; a\n * closed one takes no posts from members), the away line under the header, scheduled send\n * (touch and hold Send) with the thread's scheduled messages over the composer, `jumpTo` a\n * message (a search result), and moderation's markers.\n */\nimport { useCallback, useEffect, useMemo, useRef, useState, type ComponentType } from \"react\";\nimport { AccessibilityInfo, FlatList, KeyboardAvoidingView, Platform, Pressable, View, type LayoutChangeEvent, type NativeScrollEvent, type NativeSyntheticEvent } from \"react-native\";\nimport { SafeAreaView } from \"react-native-safe-area-context\";\nimport { NativeEmptyState, NativeSkeleton, NativeText, useGenesisModules, useToast } from \"@marktiderman/genesis-ui-native/components\";\nimport { useReducedMotion, useThemeRoles } from \"@marktiderman/genesis-ui-native/hooks\";\nimport { activityLine, previewText } from \"../core/thread\";\nimport type { ChatMessage, PendingFile } from \"../core/types\";\nimport { useChat, useConversation, useFileUrls, useLinkPreviews, useMessageActions, usePeople, usePins, useTopics } from \"../react/index\";\nimport { recordingLimitMs } from \"../core/media\";\nimport type { OpenAttachment } from \"./attachment-cards\";\nimport { linkPreviewIds, previewToShow } from \"./link-preview\";\nimport { ChatVideoRecorder } from \"./video-recorder\";\nimport { VideoUploadTray } from \"./video-upload-tray\";\nimport { videoUploads, type MintedUpload, type RecordedVideo } from \"./video-upload\";\nimport { ChatAwayLine, useAwayLine } from \"./availability\";\nimport { fill } from \"./copy\";\nimport { ChatScheduledBar, ChatScheduleSheet, useScheduleSend } from \"./schedule-sheet\";\nimport { canManageTopics, ChatTopicBar, topicClosedFor } from \"./topics\";\nimport { rowIndexOf, useJumpToMessage, type JumpTarget } from \"./use-jump\";\nimport type { MessageActionId } from \"./actions\";\nimport { ChatComposer } from \"./composer\";\nimport { composerDisabledReason, filesFromAssets, replyTargetFor } from \"./composer-state\";\nimport { ChatPeopleScope, useChatNative } from \"./context\";\nimport { useChatComposer } from \"./use-composer\";\nimport { ChatAccessError } from \"./access-error\";\nimport { attachmentPaths } from \"./media\";\nimport { ChatPhotoViewer, galleryFor, type ChatPhoto } from \"./photo-viewer\";\nimport { MessageActionsSheet } from \"./message-actions-sheet\";\nimport { displayBody, MessageBubble } from \"./message-bubble\";\nimport { haptic } from \"./modules\";\nimport { buildThreadRows, type ThreadRow } from \"./rows\";\n\n/** How long an upload minted for a thrown-away take is kept for the next one. */\nconst PREPARED_UPLOAD_MS = 20 * 60_000;\n\nexport interface ChatThreadScreenProps {\n conversationId: string;\n /** One thread's replies instead of the main timeline. */\n threadRootId?: string | null;\n /**\n * Points from the top of the screen to the top of this view, for keeping the composer above the\n * keyboard. Measured from the screen's own position when left out (under an opaque header it is\n * the header's bottom).\n */\n keyboardVerticalOffset?: number;\n /** Open at this message (a search result's `messageId` and `seq`): earlier pages load until it is held. */\n jumpTo?: JumpTarget | null;\n /** Only this topic's messages, with no topic bar. */\n topic?: string;\n /** Show the topic bar before the first topic exists, so an owner or admin can add one. */\n showTopics?: boolean;\n /** Scheduled send (touch and hold Send) and the scheduled list. Default true. */\n scheduling?: boolean;\n /** The away line under the header. Default true. */\n availability?: boolean;\n /** An app attachment card's button (a form, a check-in), when its kind gives no `onPress`. */\n onOpenAttachment?: OpenAttachment;\n testID?: string;\n}\n\n/** The list props chat passes; FlashList v2 and FlatList both take them. */\ninterface ChatListProps {\n ref?: unknown;\n data: readonly ThreadRow[];\n renderItem: (info: { item: ThreadRow; index: number }) => React.ReactElement | null;\n keyExtractor: (row: ThreadRow) => string;\n getItemType?: (row: ThreadRow) => string;\n inverted?: boolean;\n onStartReached?: () => void;\n onStartReachedThreshold?: number;\n ListHeaderComponent?: React.ReactElement | null;\n ListFooterComponent?: React.ReactElement | null;\n keyboardShouldPersistTaps?: \"handled\";\n keyboardDismissMode?: \"interactive\" | \"on-drag\";\n contentContainerStyle?: Record<string, unknown>;\n maintainVisibleContentPosition?: Record<string, unknown>;\n onScroll?: (e: NativeSyntheticEvent<NativeScrollEvent>) => void;\n scrollEventThrottle?: number;\n onContentSizeChange?: (width: number, height: number) => void;\n onLayout?: (e: LayoutChangeEvent) => void;\n extraData?: unknown;\n onScrollToIndexFailed?: (info: { index: number; averageItemLength: number }) => void;\n testID?: string;\n}\n\n/** Points from the bottom that still count as \"at the bottom\" (FlatList, which follows by hand). */\nexport const AT_BOTTOM_POINTS = 120;\n\n/**\n * How the thread's list is set up, oldest first and not inverted. FlashList:\n * its chat mode (opens at the bottom, follows new rows while within a fifth of\n * a screen of it, keeps the first visible row in place when earlier ones load\n * at the top). FlatList: keeps its place when earlier rows load at the top;\n * the screen follows new rows itself (`followsByHand`).\n */\nexport function threadListMode(flash: boolean, reducedMotion: boolean): { followsByHand: boolean; maintainVisibleContentPosition: Record<string, unknown> } {\n if (flash) {\n return {\n followsByHand: false,\n maintainVisibleContentPosition: { startRenderingFromBottom: true, autoscrollToBottomThreshold: 0.2, animateAutoScrollToBottom: !reducedMotion },\n };\n }\n return { followsByHand: true, maintainVisibleContentPosition: { minIndexForVisible: 0 } };\n}\n\n/** Whether a scroll position is at (or near) the bottom of its content. */\nexport function nearBottom(m: { contentOffset: { y: number }; contentSize: { height: number }; layoutMeasurement: { height: number } }, slack = AT_BOTTOM_POINTS): boolean {\n return m.contentOffset.y + m.layoutMeasurement.height >= m.contentSize.height - slack;\n}\n\nexport function ChatThreadScreen(props: ChatThreadScreenProps) {\n const { conversationId, threadRootId = null, keyboardVerticalOffset, onOpenAttachment, jumpTo, topic: topicProp, showTopics = false, scheduling = true, availability = true, testID = \"chat-thread\" } = props;\n const chat = useChat();\n const { userId, videoUpload, attachmentKinds, outbox } = chat;\n // Off unless the app turns it on: an og:image fetched from the phone tells its site who reads it.\n const linkPreviewImages = (chat as { linkPreviewImages?: boolean }).linkPreviewImages === true;\n const topicsState = useTopics(threadRootId ? null : conversationId);\n const [chosenTopic, setChosenTopic] = useState<string | null>(null);\n // Another conversation in this screen starts in All.\n const [topicFor, setTopicFor] = useState(conversationId);\n if (topicFor !== conversationId) {\n setTopicFor(conversationId);\n setChosenTopic(null);\n }\n // A message to go to is looked for in All, not in the topic shown.\n const [jumpedFor, setJumpedFor] = useState(jumpTo);\n if (jumpTo !== jumpedFor) {\n setJumpedFor(jumpTo);\n if (jumpTo) setChosenTopic(null);\n }\n const topic = topicProp ?? chosenTopic ?? undefined;\n const conv = useConversation(conversationId, { threadRootId: threadRootId ?? undefined, topic });\n const pins = usePins(conversationId);\n const messageActions = useMessageActions();\n const { modules, copy, person } = useChatNative();\n const toast = useToast();\n const colors = useThemeRoles();\n const reducedMotion = useReducedMotion();\n const genesis = useGenesisModules();\n const List = (genesis.list ?? FlatList) as unknown as ComponentType<ChatListProps>;\n const mode = threadListMode(Boolean(genesis.list), reducedMotion);\n const listRef = useRef<{\n scrollToEnd?: (o?: { animated?: boolean }) => void;\n scrollToIndex?: (o: { index: number; animated?: boolean; viewPosition?: number }) => void;\n scrollToOffset?: (o: { offset: number; animated?: boolean }) => void;\n } | null>(null);\n // FlatList follows by hand: at the bottom (or not yet scrolled), new rows and a shorter list keep it there.\n const atBottom = useRef(true);\n // FlatList opens at the top and is moved to the bottom a frame later: until it has been, the top\n // isn't \"reached\" (it would load an earlier page on every open).\n const placed = useRef(!mode.followsByHand);\n const toBottom = useCallback(\n (animated: boolean) => {\n const go = (a: boolean) => listRef.current?.scrollToEnd?.({ animated: a && !reducedMotion });\n requestAnimationFrame(() => {\n go(animated);\n placed.current = true;\n });\n // Once more after the new row has its size (FlashList measures it after the first pass).\n if (animated) setTimeout(() => go(true), 180);\n },\n [reducedMotion],\n );\n const composer = useChatComposer(conversationId, threadRootId, userId);\n const { setReply } = composer;\n const [actionsFor, setActionsFor] = useState<ChatMessage | null>(null);\n const [viewer, setViewer] = useState<{ photos: ChatPhoto[]; index: number } | null>(null);\n const [retryingAccess, setRetryingAccess] = useState(false);\n // Where this screen starts on the window: the keyboard offset when the app gives none.\n const rootRef = useRef<{ measureInWindow?: (callback: (x: number, y: number) => void) => void } | null>(null);\n const [measuredTop, setMeasuredTop] = useState(0);\n const measureTop = useCallback(() => {\n rootRef.current?.measureInWindow?.((_x: number, y: number) => {\n if (Number.isFinite(y)) setMeasuredTop(Math.max(0, Math.round(y)));\n });\n }, []);\n\n // Names and avatars show for more than two people: the kind's rule once it is read, else the member count.\n const group = conv.kind ? conv.kind.maxMembers !== 2 : conv.members.length > 2;\n const peopleIds = useMemo(\n () => [...conv.members.map((m) => m.userId), ...conv.messages.map((m) => m.senderId)],\n [conv.members, conv.messages],\n );\n\n const rows = useMemo(() => buildThreadRows(conv.items, { me: userId, firstUnreadId: conv.firstUnreadId, group }), [conv.items, userId, conv.firstUnreadId, group]);\n const paths = useMemo(() => conv.items.flatMap((i) => (i.type === \"message\" ? attachmentPaths(i.message.attachments) : [])), [conv.items]);\n const urls = useFileUrls(paths);\n const byId = useMemo(() => new Map(conv.messages.map((m) => [m.id, m])), [conv.messages]);\n const linkIds = useMemo(() => linkPreviewIds(conv.messages), [conv.messages]);\n const previews = useLinkPreviews(linkIds);\n const people = usePeople(peopleIds);\n const nameOf = useCallback(\n (id: string | null) => (id === userId ? copy.you : ((person(id) ?? (id ? people[id] : undefined))?.name ?? copy.someone)),\n [userId, copy, person, people],\n );\n\n const fail = useCallback(() => {\n haptic(modules.haptics, \"error\");\n toast.show({ title: copy.actionFailed, variant: \"destructive\" });\n }, [modules.haptics, toast, copy.actionFailed]);\n\n const reply = useCallback(\n (m: ChatMessage) => {\n setReply(replyTargetFor(m, nameOf(m.senderId), previewText(displayBody(m.body), m.attachments[0]?.kind, Boolean(m.deletedAt))));\n },\n [setReply, nameOf],\n );\n\n const onAction = useCallback(\n (m: ChatMessage, action: MessageActionId) => {\n switch (action) {\n case \"reply\":\n return reply(m);\n case \"copy\":\n void modules.clipboard\n ?.setStringAsync(displayBody(m.body))\n .then(() => toast.show({ title: copy.copied, variant: \"success\", duration: 1500 }))\n .catch(fail);\n return;\n case \"pin\":\n case \"unpin\":\n void messageActions.pin(m, action === \"pin\").catch(fail);\n return;\n case \"delete\":\n void messageActions.remove(m).catch(fail);\n return;\n }\n },\n [reply, modules.clipboard, toast, copy.copied, fail, messageActions],\n );\n\n const react = useCallback(\n (m: ChatMessage, emoji: string, on: boolean) => {\n haptic(modules.haptics, \"select\");\n void messageActions.react(m, emoji, on).catch(fail);\n },\n [modules.haptics, fail, messageActions],\n );\n\n // Stable handlers, so MessageBubble's memo holds while someone types or a row elsewhere changes.\n const { retry, discard, canPost: allowed } = conv;\n const onLongPress = useCallback(\n (message: ChatMessage) => {\n haptic(modules.haptics, \"select\");\n setActionsFor(message);\n },\n [modules.haptics],\n );\n const onSwipeReply = useCallback(() => haptic(modules.haptics, \"select\"), [modules.haptics]);\n const onRetry = useCallback((clientId: string) => void retry(clientId), [retry]);\n const onDiscard = useCallback((clientId: string) => void discard(clientId), [discard]);\n // Read when a photo is tapped, so the handler stays stable for MessageBubble's memo.\n const forGallery = useRef({ messages: conv.messages, urls });\n forGallery.current = { messages: conv.messages, urls };\n const onOpenImage = useCallback(\n (uri: string, alt: string) => {\n const { messages, urls: signed } = forGallery.current;\n setViewer(galleryFor(messages, signed, uri, alt, (a) => (a.name ? `${copy.photo}, ${a.name}` : copy.photo)));\n },\n [copy.photo],\n );\n // Files that didn't survive a relaunch: photos and videos can be picked again; anything else can only be deleted.\n const { reattach } = conv;\n const picker = modules.imagePicker;\n const onReattach = useCallback(\n async (clientId: string, files: readonly PendingFile[]) => {\n if (!picker) return;\n try {\n // Only the slots that were lost: reattach fills those and keeps the rest.\n const lostCount = Math.max(1, files.filter((f) => f.lost).length);\n const result = await picker.launchImageLibraryAsync({ mediaTypes: [\"images\", \"videos\"], allowsMultipleSelection: lostCount > 1, selectionLimit: lostCount, quality: 0.8 });\n if (!result || result.canceled || !result.assets?.length) return;\n const { attachments, notice } = filesFromAssets(result.assets, copy);\n if (notice) toast.show({ title: notice, variant: \"destructive\" });\n if (attachments.length) await reattach(clientId, attachments.map((a) => a.file));\n } catch {\n fail();\n }\n },\n [picker, copy, toast, reattach, fail],\n );\n const observer = conv.role === \"observer\";\n const { loadUntil } = conv;\n // The message being gone to, for FlatList's retry once it has measured that far (by id: rows may have moved).\n const jumpingTo = useRef<{ id: string; tries: number } | null>(null);\n const retryTimer = useRef<ReturnType<typeof setTimeout> | null>(null);\n useEffect(() => () => {\n if (retryTimer.current) clearTimeout(retryTimer.current);\n }, []);\n const rowsNow = useRef(rows);\n rowsNow.current = rows;\n const { highlightedId, jumping } = useJumpToMessage({\n target: jumpTo,\n rows,\n loading: conv.isLoading,\n has: useCallback((id: string) => byId.has(id), [byId]),\n loadUntil,\n scrollTo: (index, id) => {\n jumpingTo.current = { id, tries: 0 };\n requestAnimationFrame(() => listRef.current?.scrollToIndex?.({ index, animated: !reducedMotion, viewPosition: 0.5 }));\n },\n onStart: () => {\n atBottom.current = false;\n placed.current = true;\n },\n onLanded: (id) => {\n const m = byId.get(id);\n if (m) AccessibilityInfo.announceForAccessibility?.(fill(copy.jumpedTo, { name: nameOf(m.senderId), text: previewText(displayBody(m.body), m.attachments[0]?.kind, Boolean(m.deletedAt)) }));\n },\n onGone: () => {\n toast.show({ title: copy.messageGone });\n // Back to where the thread opens: the newest messages.\n atBottom.current = true;\n toBottom(false);\n },\n onError: fail,\n });\n const reattachable = useCallback((files: readonly PendingFile[]) => files.every((f) => !f.lost || f.kind === \"image\" || f.kind === \"video\"), []);\n\n const renderItem = useCallback(\n ({ item: row }: { item: ThreadRow }) => {\n if (row.type === \"day\") return <DaySeparator label={row.label} testID={`${testID}-day-${row.key}`} />;\n if (row.type === \"unread\") return <UnreadDivider label={copy.newMessages} testID={`${testID}-unread`} />;\n const m = row.item.type === \"message\" ? row.item.message : null;\n const replyTo = m?.replyToId ?? (row.item.type === \"pending\" ? row.item.pending.input.replyToId : null);\n return (\n <MessageBubble\n row={row}\n me={userId}\n urls={urls}\n repliedTo={replyTo ? byId.get(replyTo) : null}\n group={group}\n reducedMotion={reducedMotion}\n onLongPress={onLongPress}\n onReply={allowed ? reply : undefined}\n onSwipeReply={onSwipeReply}\n onRetry={onRetry}\n onDiscard={onDiscard}\n onReattach={picker && row.item.type === \"pending\" && reattachable(row.item.pending.files ?? []) ? onReattach : undefined}\n onToggleReaction={allowed ? react : undefined}\n onOpenImage={onOpenImage}\n observer={observer}\n highlighted={Boolean(m && m.id === highlightedId)}\n linkPreview={m ? previewToShow(previews[m.id]) : null}\n linkPreviewImages={linkPreviewImages}\n attachmentKinds={attachmentKinds}\n onOpenAttachment={onOpenAttachment}\n testID={`${testID}-message-${m?.id ?? row.key}`}\n />\n );\n },\n [testID, copy.newMessages, userId, urls, byId, group, reducedMotion, onLongPress, allowed, reply, onSwipeReply, onRetry, onDiscard, react, onOpenImage, picker, reattachable, onReattach, previews, linkPreviewImages, attachmentKinds, onOpenAttachment, observer, highlightedId],\n );\n\n // ---- Video messages ----\n const [videoOpen, setVideoOpen] = useState(false);\n // Minted when a take starts, so its bytes go the moment it stops. Kept for the next take when this\n // one is thrown away, but only for this conversation and only while it is fresh (Mux's direct\n // uploads expire; the uploader mints another if one has).\n const preparedVideo = useRef<{ conversationId: string; at: number; upload: Promise<MintedUpload> } | null>(null);\n const takePrepared = useCallback(() => {\n const p = preparedVideo.current;\n preparedVideo.current = null;\n return p && p.conversationId === conversationId && Date.now() - p.at < PREPARED_UPLOAD_MS ? p.upload : null;\n }, [conversationId]);\n const onVideoStart = useCallback(() => {\n if (!videoUpload) return;\n const before = preparedVideo.current;\n const kept = takePrepared();\n const upload = kept ?? videoUpload.create(conversationId);\n upload.catch(() => {\n if (preparedVideo.current?.upload === upload) preparedVideo.current = null;\n });\n preparedVideo.current = { conversationId, at: kept && before ? before.at : Date.now(), upload };\n }, [videoUpload, conversationId, takePrepared]);\n const replyNow = composer.state.replyTo?.messageId ?? null;\n const onVideoRecorded = useCallback(\n (video: RecordedVideo) => {\n videoUploads.start({ conversationId, userId, video, extra: { replyToId: replyNow, threadRootId }, send: outbox.send, videoUpload, prepared: takePrepared(), openFile: modules.openFile });\n if (replyNow) setReply(null);\n atBottom.current = true;\n toBottom(true);\n },\n [conversationId, userId, replyNow, threadRootId, outbox, videoUpload, takePrepared, modules.openFile, setReply, toBottom],\n );\n\n const activity = activityLine(conv.activity, (id) => nameOf(id));\n // Unknown while access loads: the composer waits quietly instead of saying you can't post. A\n // read that failed (and no role known from before) offers Retry in the composer's place.\n const topics = topicsState.topics;\n const currentTopic = topic ? (topics.find((t) => t.topic === topic) ?? null) : null;\n const topicClosed = topicClosedFor(currentTopic, conv.role);\n const showTopicBar = !threadRootId && topicProp === undefined && (topics.length > 0 || (showTopics && canManageTopics(conv.role)));\n const canPost = topicClosed ? false : conv.accessLoading ? null : conv.canPost;\n const disabledReason = topicClosed ? copy.topicClosedNotice : composerDisabledReason(canPost, conv.conversation, conv.role, copy);\n const awayLine = useAwayLine(availability ? conversationId : null, conv.members, userId, nameOf);\n // Scheduled send: not in a reply thread (a scheduled message has no thread).\n const canSchedule = scheduling && !threadRootId && canPost === true;\n const schedule = useScheduleSend({ conversationId, topic: topic ?? null, composer, enabled: scheduling && !threadRootId });\n const accessFailed = Boolean(conv.accessError) && conv.role === null && !conv.accessLoading;\n const { refetchAccess } = conv;\n const retryAccess = useCallback(() => {\n setRetryingAccess(true);\n void Promise.resolve(refetchAccess()).finally(() => setRetryingAccess(false));\n }, [refetchAccess]);\n const KeyboardAvoiding = (modules.keyboardAvoidingView ?? KeyboardAvoidingView) as ComponentType<Record<string, unknown>>;\n const offset = keyboardVerticalOffset ?? measuredTop;\n const keyboardProps = modules.keyboardAvoidingView\n ? { behavior: \"translate-with-padding\", keyboardVerticalOffset: offset }\n : { behavior: Platform.OS === \"ios\" ? \"padding\" : undefined, keyboardVerticalOffset: offset };\n\n const empty = !conv.isLoading && rows.length === 0;\n return (\n <ChatPeopleScope userIds={peopleIds}>\n <SafeAreaView ref={rootRef as never} onLayout={measureTop} testID={testID} edges={[\"left\", \"right\", \"bottom\"]} style={{ flex: 1, backgroundColor: colors.groupedBackground }}>\n <KeyboardAvoiding style={{ flex: 1 }} {...keyboardProps}>\n {showTopicBar ? (\n <ChatTopicBar topics={topics} value={topic ?? null} onValueChange={setChosenTopic} canManage={canManageTopics(conv.role)} onSetTopic={topicsState.setTopic} testID={`${testID}-topics`} />\n ) : null}\n <ChatAwayLine text={awayLine} testID={`${testID}-away`} />\n <View style={{ flex: 1 }}>\n {conv.isLoading ? (\n <LoadingThread testID={`${testID}-loading`} />\n ) : empty ? (\n <View style={{ flex: 1, justifyContent: \"center\" }}>\n <NativeEmptyState variant=\"first-run\" title={copy.threadEmptyTitle} body={copy.threadEmptyBody} testID={`${testID}-empty`} />\n </View>\n ) : (\n <List\n ref={listRef}\n testID={`${testID}-list`}\n data={rows}\n renderItem={renderItem}\n keyExtractor={(row) => row.key}\n getItemType={(row) => (row.type === \"message\" ? (row.mine ? \"mine\" : \"theirs\") : row.type)}\n onStartReached={() => {\n // Not while going to a message: its pages are loading, and new rows would move it.\n if (placed.current && !jumping && conv.hasEarlier && !conv.loadingEarlier) void conv.loadEarlier();\n }}\n onStartReachedThreshold={0.5}\n keyboardShouldPersistTaps=\"handled\"\n keyboardDismissMode=\"interactive\"\n contentContainerStyle={{ paddingVertical: 8 }}\n maintainVisibleContentPosition={mode.maintainVisibleContentPosition}\n extraData={highlightedId}\n onScrollToIndexFailed={({ index, averageItemLength }) => {\n // FlatList hasn't measured that far up yet: get near it, then try again (three times at most).\n listRef.current?.scrollToOffset?.({ offset: Math.max(0, index * averageItemLength - 200), animated: false });\n const target = jumpingTo.current;\n if (!target || target.tries >= 3) return;\n target.tries += 1;\n if (retryTimer.current) clearTimeout(retryTimer.current);\n retryTimer.current = setTimeout(() => {\n const at = rowIndexOf(rowsNow.current, target.id);\n if (at >= 0) listRef.current?.scrollToIndex?.({ index: at, animated: !reducedMotion, viewPosition: 0.5 });\n }, 250);\n }}\n {...(mode.followsByHand\n ? {\n scrollEventThrottle: 32,\n onScroll: (e: NativeSyntheticEvent<NativeScrollEvent>) => {\n atBottom.current = nearBottom(e.nativeEvent);\n },\n onContentSizeChange: () => {\n if (atBottom.current) toBottom(false);\n },\n onLayout: () => {\n if (atBottom.current) toBottom(false);\n },\n }\n : {})}\n ListHeaderComponent={\n conv.hasEarlier ? (\n <EarlierAnchor loading={conv.loadingEarlier} label={copy.loadEarlier} onPress={() => void conv.loadEarlier()} testID={`${testID}-earlier`} />\n ) : null\n }\n ListFooterComponent={activity ? <ActivityLine text={activity} testID={`${testID}-activity`} /> : null}\n />\n )}\n </View>\n {scheduling && !threadRootId ? <ChatScheduledBar conversationId={conversationId} testID={`${testID}-scheduled`} /> : null}\n <VideoUploadTray conversationId={conversationId} userId={userId} testID={`${testID}-video-uploads`} />\n {accessFailed ? (\n <ChatAccessError onRetry={retryAccess} retrying={retryingAccess} testID={`${testID}-access-error`} />\n ) : (\n <ChatComposer\n composer={composer}\n userId={userId}\n placeholder={currentTopic ? fill(copy.topicPlaceholder, { name: currentTopic.title }) : undefined}\n onSchedule={canSchedule ? schedule.request : undefined}\n canPost={canPost}\n disabledReason={disabledReason}\n role={conv.role}\n onSend={({ input, files }) => {\n void conv.send(input, files).catch(fail);\n // What you send is what you look at next, wherever the list was.\n atBottom.current = true;\n toBottom(true);\n }}\n signalTyping={conv.signalTyping}\n signalRecording={conv.signalRecording}\n onRecordVideo={modules.camera ? () => setVideoOpen(true) : undefined}\n testID={`${testID}-composer`}\n />\n )}\n </KeyboardAvoiding>\n <MessageActionsSheet\n message={actionsFor}\n context={{ me: userId, role: conv.role, canPost: conv.canPost, pinned: actionsFor ? pins.includes(actionsFor.id) : false, canPin: conv.canPin, canCopy: Boolean(modules.clipboard) }}\n onClose={() => setActionsFor(null)}\n onReact={react}\n onAction={onAction}\n testID={`${testID}-actions`}\n />\n <ChatPhotoViewer photos={viewer?.photos ?? null} initialIndex={viewer?.index} onClose={() => setViewer(null)} testID={`${testID}-viewer`} />\n {canSchedule ? <ChatScheduleSheet open={schedule.open} onOpenChange={schedule.setOpen} onSchedule={(at) => void schedule.scheduleAt(at)} testID={`${testID}-schedule`} /> : null}\n <ChatVideoRecorder\n open={videoOpen}\n onClose={() => setVideoOpen(false)}\n limitMs={recordingLimitMs(conv.role)}\n onStart={onVideoStart}\n onTick={conv.signalRecordingVideo}\n onRecorded={onVideoRecorded}\n testID={`${testID}-video-recorder`}\n />\n </SafeAreaView>\n </ChatPeopleScope>\n );\n}\n\nfunction DaySeparator({ label, testID }: { label: string; testID: string }) {\n const colors = useThemeRoles();\n return (\n <View testID={testID} accessibilityRole=\"header\" style={{ alignItems: \"center\", paddingVertical: 10 }}>\n <NativeText preset=\"caption\" style={{ color: colors.secondaryLabel, fontWeight: \"600\" }}>\n {label}\n </NativeText>\n </View>\n );\n}\n\nfunction UnreadDivider({ label, testID }: { label: string; testID: string }) {\n const colors = useThemeRoles();\n return (\n <View testID={testID} accessible accessibilityLabel={label} style={{ flexDirection: \"row\", alignItems: \"center\", gap: 8, paddingHorizontal: 16, paddingVertical: 8 }}>\n <View style={{ flex: 1, height: 1, backgroundColor: colors.tint }} />\n <NativeText preset=\"caption\" style={{ color: colors.tint, fontWeight: \"600\" }}>\n {label}\n </NativeText>\n <View style={{ flex: 1, height: 1, backgroundColor: colors.tint }} />\n </View>\n );\n}\n\nfunction ActivityLine({ text, testID }: { text: string; testID: string }) {\n const colors = useThemeRoles();\n return (\n <View testID={testID} accessibilityLiveRegion=\"polite\" style={{ paddingHorizontal: 20, paddingVertical: 6 }}>\n <NativeText preset=\"caption\" style={{ color: colors.secondaryLabel, fontStyle: \"italic\" }}>\n {text}\n </NativeText>\n </View>\n );\n}\n\nfunction EarlierAnchor({ loading, label, onPress, testID }: { loading: boolean; label: string; onPress: () => void; testID: string }) {\n const colors = useThemeRoles();\n return (\n <View style={{ alignItems: \"center\", paddingVertical: 12 }}>\n {loading ? (\n <View testID={`${testID}-loading`} style={{ gap: 8, alignItems: \"center\" }}>\n <NativeSkeleton width={180} height={14} />\n <NativeSkeleton width={120} height={14} />\n </View>\n ) : (\n <Pressable testID={testID} accessibilityRole=\"button\" accessibilityLabel={label} onPress={onPress} style={{ minHeight: 44, justifyContent: \"center\", paddingHorizontal: 16 }}>\n <NativeText preset=\"label\" style={{ color: colors.tint }}>\n {label}\n </NativeText>\n </Pressable>\n )}\n </View>\n );\n}\n\nfunction LoadingThread({ testID }: { testID: string }) {\n return (\n <View testID={testID} style={{ flex: 1, justifyContent: \"flex-end\", padding: 16, gap: 10 }}>\n <NativeSkeleton width={200} height={36} className=\"rounded-2xl\" />\n <View style={{ alignItems: \"flex-end\" }}>\n <NativeSkeleton width={160} height={36} className=\"rounded-2xl\" />\n </View>\n <NativeSkeleton width={240} height={36} className=\"rounded-2xl\" />\n </View>\n );\n}\n","/**\n * @feat:chat\n * `<Stack.Screen options>` for a screen that renders `ChatThreadScreen`.\n *\n * The bar is opaque. It was made so while the thread was an inverted list\n * (`transform: scaleY(-1)` on the scroll view), which it no longer is; it\n * stays opaque until a see-through bar is checked over the upright list. On\n * iOS 26 and later the navigation bar is see-through and draws a scroll\n * edge effect over the content scroll view under it; UIKit lays that effect\n * out in the flipped scroll view's own coordinates, so once the thread is\n * long enough to reach the bar the whole list renders blurred. An opaque bar\n * keeps the screen's content below it: nothing scrolls under the bar, and no\n * edge effect is drawn over the flipped list. Seen on iOS 27 with FlashList\n * and with FlatList.\n */\nimport type { ColorValue } from \"react-native\";\nimport { getThreadPageStackOptions, type ScreenHeaderProps } from \"@marktiderman/genesis-ui-native/layouts\";\nimport { useThemeRoles } from \"@marktiderman/genesis-ui-native/hooks\";\n\nexport type ChatThreadStackOptionsProps = ScreenHeaderProps & { headerTitle?: string };\n\n/** The thread's header options with an opaque bar in `background` (the thread's own background). */\nexport function chatThreadStackOptions(props: ChatThreadStackOptionsProps, background: ColorValue): Record<string, unknown> {\n return getThreadPageStackOptions({\n ...props,\n // Large titles collapse into the content scroll view, which is the flipped list here.\n large: false,\n headerOptions: { headerTransparent: false, headerStyle: { backgroundColor: background }, ...props.headerOptions },\n });\n}\n\n/** `chatThreadStackOptions` in the theme's grouped background, the color `ChatThreadScreen` draws. */\nexport function useChatThreadStackOptions(props: ChatThreadStackOptionsProps): Record<string, unknown> {\n const colors = useThemeRoles();\n return chatThreadStackOptions(props, colors.groupedBackground);\n}\n","/**\n * @feat:chat\n * Starting a conversation: a header button, and a sheet listing the people\n * the app says you may message (its own query; the kind's start check decides\n * on the server). Picking someone starts the conversation, or finds the one\n * you already have, and opens it.\n */\nimport { useState } from \"react\";\nimport { Pressable, View } from \"react-native\";\nimport { NativeAvatar, NativeIcon, NativeListItem, NativeSheet, NativeSheetScrollView, NativeText, useToast } from \"@marktiderman/genesis-ui-native/components\";\nimport { useThemeRoles } from \"@marktiderman/genesis-ui-native/hooks\";\nimport { useStartConversation } from \"../react/index\";\nimport { initials, useChatNative } from \"./context\";\n\nexport interface ChatStartPerson {\n userId: string;\n name: string;\n avatarUrl?: string | null;\n /** A second line (\"Coach\", \"Team\"). */\n subtitle?: string;\n}\n\nexport interface ChatStartSheetProps {\n open: boolean;\n onClose: () => void;\n people: ChatStartPerson[];\n /** Default `direct`. */\n kind?: string;\n onStarted: (conversationId: string) => void;\n testID?: string;\n}\n\nexport function ChatStartSheet({ open, onClose, people, kind = \"direct\", onStarted, testID = \"chat-start\" }: ChatStartSheetProps) {\n const { copy } = useChatNative();\n const colors = useThemeRoles();\n const start = useStartConversation();\n const toast = useToast();\n const [busy, setBusy] = useState<string | null>(null);\n\n const pick = async (person: ChatStartPerson) => {\n if (busy) return;\n setBusy(person.userId);\n try {\n const id = await start(kind, [person.userId]);\n onClose();\n onStarted(id);\n } catch {\n toast.show({ title: copy.actionFailed, variant: \"destructive\" });\n } finally {\n setBusy(null);\n }\n };\n\n return (\n <NativeSheet open={open} onOpenChange={(o) => (o ? undefined : onClose())} testID={testID}>\n <NativeText preset=\"h4\" accessibilityRole=\"header\" style={{ paddingHorizontal: 4, paddingBottom: 8, color: colors.label }}>\n {copy.startConversationTitle}\n </NativeText>\n <NativeSheetScrollView>\n <View>\n {people.map((p) => (\n <NativeListItem\n key={p.userId}\n testID={`${testID}-person-${p.userId}`}\n title={p.name}\n subtitle={p.subtitle}\n leading={<NativeAvatar size={36} src={p.avatarUrl ?? null} fallback={initials(p.name)} alt={p.name} />}\n disabled={busy !== null}\n onPress={() => void pick(p)}\n />\n ))}\n </View>\n </NativeSheetScrollView>\n </NativeSheet>\n );\n}\n\n/** A 44pt compose button for the inbox's header (`headerRight`). */\nexport function ChatStartButton({ onPress, testID = \"chat-start-button\" }: { onPress: () => void; testID?: string }) {\n const { copy } = useChatNative();\n const colors = useThemeRoles();\n return (\n <Pressable testID={testID} accessibilityRole=\"button\" accessibilityLabel={copy.startConversation} onPress={onPress} hitSlop={6} style={{ width: 44, height: 44, alignItems: \"center\", justifyContent: \"center\" }}>\n <NativeIcon name=\"compose\" size={22} color={colors.tint} />\n </Pressable>\n );\n}\n","/**\n * @feat:chat\n * Retries unsent messages when there's a chance they'll go now: the app\n * coming back to the front (AppState \"active\") and, with NetInfo\n * (`modules.netInfo`), the connection coming back, through\n * `useChat().retryAll()`, which resends what failed for a reason that may\n * pass and leaves alone what the server refused (`permanent`: not allowed,\n * bad data) and messages whose files are gone. Mount it once under\n * ChatProvider and ChatNativeProvider: `<ChatAutoRetry />`.\n */\nimport { useEffect, useRef } from \"react\";\nimport { AppState } from \"react-native\";\nimport { useChat } from \"../react/index\";\nimport { useChatNative } from \"./context\";\nimport type { NetInfoLike } from \"./modules\";\n\n/** React Native's `AppState`, as the hook uses it. */\nexport interface AppStateLike {\n currentState: string | null;\n addEventListener(type: \"change\", listener: (state: string) => void): { remove(): void };\n}\n\nexport interface ChatAutoRetryOptions {\n /** Default `modules.netInfo`. */\n netInfo?: NetInfoLike;\n /** Default React Native's AppState. */\n appState?: AppStateLike;\n}\n\n/** Whether a NetInfo state is online: unknown counts as online, so only a real \"offline\" waits. */\nexport function isOnline(state: { isConnected: boolean | null; isInternetReachable?: boolean | null }): boolean {\n return state.isConnected !== false && state.isInternetReachable !== false;\n}\n\nexport function useChatAutoRetry({ netInfo, appState }: ChatAutoRetryOptions = {}): void {\n const { retryAll } = useChat();\n const { modules } = useChatNative();\n const net = netInfo ?? modules.netInfo;\n const app = appState ?? (AppState as unknown as AppStateLike | undefined);\n // The latest retryAll, so a changing queue doesn't resubscribe.\n const retry = useRef(retryAll);\n retry.current = retryAll;\n\n useEffect(() => {\n const go = () => void retry.current().catch(() => undefined);\n let last = app?.currentState ?? null;\n const sub = app?.addEventListener?.(\"change\", (next) => {\n if (next === \"active\" && last !== \"active\") go();\n last = next;\n });\n // Only a change from offline to online: NetInfo also reports the current state on subscribing.\n let wasOnline: boolean | null = null;\n const unsubscribe = net?.addEventListener((state) => {\n const online = isOnline(state);\n if (online && wasOnline === false) go();\n wasOnline = online;\n });\n return () => {\n sub?.remove();\n unsubscribe?.();\n };\n }, [net, app]);\n}\n\n/** `useChatAutoRetry` as a component, for a provider tree. */\nexport function ChatAutoRetry(props: ChatAutoRetryOptions) {\n useChatAutoRetry(props);\n return null;\n}\n","/**\n * @feat:chat\n * Resumable uploads for the native outbox: Supabase Storage's TUS endpoint\n * (`/storage/v1/upload/resumable`), with the person's own token, so storage's\n * row level security (genesis_chat.can_upload) judges each file as it does a\n * plain upload. A dropped connection resumes from the last chunk the server\n * has (HEAD for the offset), within the session; a retry of the same file\n * reuses its path, so the message's attachment never points at a second copy.\n * A file on the phone is read one chunk at a time when the app gives\n * `openFile` (a 100 MB video never sits whole in memory); without it, it is\n * read whole. A create the server refuses as already there (409) counts as\n * done only when the object is really there.\n *\n * <ChatProvider upload={createTusUpload({ supabaseUrl, userId, getAccessToken })} …>\n *\n * The path is `<conversation>/<uploader>/<uuid>.<ext>`, as `send_message`\n * expects; the upload finishes before the send (the outbox orders that).\n */\nimport { CHAT_BUCKET, ChatError } from \"../core/client\";\nimport { fileExtension, isAllowedExtension, randomId } from \"../core/media\";\nimport type { LocalFile } from \"../core/outbox\";\n\n/** Supabase requires 6 MB chunks for TUS (every chunk but the last). */\nexport const TUS_CHUNK_BYTES = 6 * 1024 * 1024;\n\nexport interface TusUploadOptions {\n /** The project URL (`https://<ref>.supabase.co`, or the local stack's). */\n supabaseUrl: string;\n /** The signed-in user's id (auth.users), the second folder of the path. */\n userId: string | (() => string);\n /** The signed-in user's access token (`(await supabase.auth.getSession()).data.session?.access_token`). */\n getAccessToken: () => Promise<string | null | undefined>;\n /** The publishable key, sent as `apikey` (the API gateway asks for it on hosted projects). */\n apikey?: string;\n /**\n * Opens a file URI for reading one chunk at a time (expo-file-system's `new File(uri).open()`),\n * so a big video is never read whole into memory. Without it, `readFile` reads the whole file.\n */\n openFile?: (uri: string) => Promise<TusFileHandle> | TusFileHandle;\n /** Reads a file URI into bytes, whole: used without `openFile`. Default `fetch(uri).arrayBuffer()`. */\n readFile?: (uri: string) => Promise<ArrayBuffer>;\n fetch?: typeof fetch;\n chunkBytes?: number;\n /** Network failures retried per chunk before the send fails (it can be retried). Default 3. */\n retries?: number;\n /** A uuid for each file's name. Default core's `randomId` (crypto.randomUUID where there is one, else getRandomValues). */\n newId?: () => string;\n bucket?: string;\n}\n\n/** An open file, read a chunk at a time. */\nexport interface TusFileHandle {\n /** Bytes in the file. */\n size: number;\n /** Up to `length` bytes from `offset`. */\n read(offset: number, length: number): Promise<ArrayBuffer | Uint8Array>;\n close?(): void;\n}\n\n/** What upload reads its bytes from: the file in chunks, or bytes already in memory. */\ninterface Source {\n size: number;\n read(from: number, to: number): Promise<ArrayBuffer>;\n close(): void;\n}\n\nconst exact = (bytes: ArrayBuffer | Uint8Array): ArrayBuffer =>\n bytes instanceof ArrayBuffer ? bytes : (bytes.buffer.slice(bytes.byteOffset, bytes.byteOffset + bytes.byteLength) as ArrayBuffer);\n\nconst inMemory = (buffer: ArrayBuffer): Source => ({ size: buffer.byteLength, read: async (from, to) => buffer.slice(from, to), close: () => undefined });\n\ninterface UploadRecord {\n path: string;\n location?: string;\n done?: boolean;\n}\n\n/** Base64 of a UTF-8 string, for TUS's Upload-Metadata (no `btoa`, which isn't on every Hermes build). */\nexport function base64Utf8(text: string): string {\n const bytes = new TextEncoder().encode(text);\n const A = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\n let out = \"\";\n for (let i = 0; i < bytes.length; i += 3) {\n const n = (bytes[i]! << 16) | ((bytes[i + 1] ?? 0) << 8) | (bytes[i + 2] ?? 0);\n out += A[(n >> 18) & 63]! + A[(n >> 12) & 63]! + (i + 1 < bytes.length ? A[(n >> 6) & 63]! : \"=\") + (i + 2 < bytes.length ? A[n & 63]! : \"=\");\n }\n return out;\n}\n\nconst transientStatus = (status: number) => status === 0 || status === 408 || status === 429 || status >= 500;\n\nexport function createTusUpload(options: TusUploadOptions): (conversationId: string, file: LocalFile) => Promise<string> {\n const doFetch = options.fetch ?? fetch;\n const chunk = options.chunkBytes ?? TUS_CHUNK_BYTES;\n const retries = options.retries ?? 3;\n const bucket = options.bucket ?? CHAT_BUCKET;\n const endpoint = `${options.supabaseUrl.replace(/\\/+$/, \"\")}/storage/v1/upload/resumable`;\n const newId = options.newId ?? randomId;\n const readFile = options.readFile ?? (async (uri: string) => (await doFetch(uri)).arrayBuffer());\n // By file object: a retry of the same message in this session resumes it. Two messages never\n // share an object, so deleting one never breaks the other.\n const byFile = new WeakMap<LocalFile, UploadRecord>();\n\n async function headers(extra: Record<string, string> = {}) {\n const token = await options.getAccessToken();\n if (!token) throw new ChatError(\"Sign in to send files\", \"42501\", \"upload\");\n return {\n authorization: `Bearer ${token}`,\n ...(options.apikey ? { apikey: options.apikey } : {}),\n \"tus-resumable\": \"1.0.0\",\n ...extra,\n };\n }\n\n async function sourceOf(file: LocalFile): Promise<Source> {\n const data = file.data;\n if (typeof data === \"string\") {\n if (!options.openFile) return inMemory(await readFile(data));\n const handle = await options.openFile(data);\n if (!Number.isFinite(handle.size) || handle.size <= 0) {\n try {\n handle.close?.();\n } catch {\n // Already closed.\n }\n throw new ChatError(`${file.name} can't be read on this device`, \"22023\", \"upload\");\n }\n return {\n size: handle.size,\n read: async (from, to) => {\n const bytes = await handle.read(from, to - from).catch((e: unknown) => {\n throw new ChatError(`${file.name} can't be read on this device${e instanceof Error ? `: ${e.message}` : \"\"}`, \"22023\", \"upload\");\n });\n // A short read would send a hole in the file: fail instead.\n if (bytes.byteLength !== to - from) throw new ChatError(`${file.name} changed while it was sent`, \"22023\", \"upload\");\n return exact(bytes);\n },\n close: () => {\n try {\n handle.close?.();\n } catch {\n // Already closed.\n }\n },\n };\n }\n if (data instanceof ArrayBuffer) return inMemory(data);\n return { size: data.size, read: (from, to) => data.slice(from, to).arrayBuffer(), close: () => undefined };\n }\n\n /**\n * Whether the object is really in the bucket (a 409 on create says so, and may be wrong).\n * Storage answers a missing object with 400 (or 404); a refusal is a refusal, anything else is\n * asked again.\n */\n async function objectExists(path: string): Promise<boolean> {\n const base = options.supabaseUrl.replace(/\\/+$/, \"\");\n const encoded = path.split(\"/\").map(encodeURIComponent).join(\"/\");\n const res = await doFetch(`${base}/storage/v1/object/authenticated/${bucket}/${encoded}`, { method: \"HEAD\", headers: await headers() });\n if (res.ok) return true;\n if (res.status === 400 || res.status === 404) return false;\n return refuse(res, \"upload\");\n }\n\n async function withRetry<T>(op: string, run: () => Promise<T>): Promise<T> {\n let last: unknown;\n for (let attempt = 0; attempt <= retries; attempt++) {\n try {\n return await run();\n } catch (e) {\n last = e;\n if (e instanceof ChatError && !e.transient) throw e;\n await new Promise((r) => setTimeout(r, Math.min(4000, 250 * 2 ** attempt)));\n }\n }\n throw last instanceof ChatError ? last : new ChatError(last instanceof Error ? last.message : String(last), undefined, op);\n }\n\n const refuse = async (res: Response, op: string): Promise<never> => {\n const text = await res.text().catch(() => \"\");\n // A network-ish status is transient (no code); the rest are refusals.\n throw new ChatError(text || `Upload failed (${res.status})`, transientStatus(res.status) ? undefined : res.status === 403 || res.status === 401 ? \"42501\" : \"22023\", op);\n };\n\n async function upload(conversationId: string, file: LocalFile): Promise<string> {\n const ext = fileExtension(file.name, file.contentType);\n if (!isAllowedExtension(ext)) throw new ChatError(`Files of type .${ext} can't be sent`, \"22023\", \"upload\");\n let record = byFile.get(file);\n if (!record) {\n const userId = typeof options.userId === \"function\" ? options.userId() : options.userId;\n record = { path: `${conversationId}/${userId}/${newId()}.${ext}` };\n }\n byFile.set(file, record);\n if (record.done) return record.path;\n\n const source = await sourceOf(file);\n try {\n return await send(file, record, source);\n } finally {\n source.close();\n }\n };\n\n async function send(file: LocalFile, rec: UploadRecord, source: Source): Promise<string> {\n const length = source.size;\n\n // Create the upload (once), or find how far an earlier attempt got.\n let offset = 0;\n if (rec.location) {\n offset = await withRetry(\"upload\", async () => {\n const res = await doFetch(rec.location!, { method: \"HEAD\", headers: await headers() });\n if (res.status === 404 || res.status === 410) {\n rec.location = undefined;\n return 0;\n }\n if (!res.ok) return refuse(res, \"upload\");\n return Number(res.headers.get(\"upload-offset\") ?? 0);\n });\n }\n // A 409 at a path whose object isn't there (another upload of it never finished): one new path.\n let fresh = false;\n while (!rec.location) {\n const metadata = [\n `bucketName ${base64Utf8(bucket)}`,\n `objectName ${base64Utf8(rec.path)}`,\n `contentType ${base64Utf8(file.contentType)}`,\n `cacheControl ${base64Utf8(\"3600\")}`,\n ].join(\",\");\n const created = await withRetry(\"upload\", async () => {\n const res = await doFetch(endpoint, {\n method: \"POST\",\n headers: await headers({ \"upload-length\": String(length), \"upload-metadata\": metadata, \"x-upsert\": \"false\" }),\n });\n // Already there, says the server: an earlier attempt finished but its answer was lost, or\n // another upload of this path is under way. Only the object itself settles which.\n if (res.status === 409) return (await objectExists(rec.path)) ? \"done\" : \"conflict\";\n if (res.status !== 201) return refuse(res, \"upload\");\n const location = res.headers.get(\"location\");\n if (!location) throw new ChatError(\"The upload server gave no location\", \"22023\", \"upload\");\n return new URL(location, endpoint).toString();\n });\n if (created === \"done\") {\n rec.done = true;\n return rec.path;\n }\n if (created === \"conflict\") {\n if (fresh) throw new ChatError(\"The upload is out of step\", undefined, \"upload\");\n fresh = true;\n rec.path = `${rec.path.slice(0, rec.path.lastIndexOf(\"/\") + 1)}${newId()}.${rec.path.slice(rec.path.lastIndexOf(\".\") + 1)}`;\n continue;\n }\n rec.location = created;\n offset = 0;\n }\n\n while (offset < length) {\n const from = offset;\n const body = await source.read(from, Math.min(length, from + chunk));\n offset = await withRetry(\"upload\", async () => {\n const res = await doFetch(rec.location!, {\n method: \"PATCH\",\n headers: await headers({ \"upload-offset\": String(from), \"content-type\": \"application/offset+octet-stream\" }),\n body,\n });\n if (res.status === 409) {\n // Out of step (an earlier chunk did land): ask where the server is.\n const head = await doFetch(rec.location!, { method: \"HEAD\", headers: await headers() });\n const at = Number(head.headers.get(\"upload-offset\"));\n // No answer: a transient failure, so the backoff applies before the next try.\n if (!head.ok || !Number.isFinite(at) || at === from) throw new ChatError(\"The upload is out of step\", undefined, \"upload\");\n return at;\n }\n if (res.status !== 204 && !res.ok) return refuse(res, \"upload\");\n return Number(res.headers.get(\"upload-offset\") ?? from + body.byteLength);\n });\n }\n rec.done = true;\n return rec.path;\n }\n\n return upload;\n}\n","/**\n * @feat:chat\n * `ChatBroadcastSheet`: write one message and send it into many of your conversations at once\n * (each person's own conversation with you), so each gets it on their own and their reply comes\n * back to you privately. Pick conversations from the inbox (filter, select all), then send. Show\n * it only to the people your app lets broadcast; the database still checks each conversation\n * (`can_post`) and says how many it reached. The same rules as the web's `ChatBroadcast`.\n */\nimport { useMemo, useState } from \"react\";\nimport { Pressable, View } from \"react-native\";\nimport {\n NativeAvatar,\n NativeButton,\n NativeCheckbox,\n NativeEmptyState,\n NativeInlineAlert,\n NativeSearchBar,\n NativeSheet,\n NativeSheetScrollView,\n NativeSkeleton,\n NativeText,\n NativeTextarea,\n useToast,\n} from \"@marktiderman/genesis-ui-native/components\";\nimport { useThemeRoles } from \"@marktiderman/genesis-ui-native/hooks\";\nimport { CHAT_LIMITS } from \"../core/media\";\nimport type { ChatInboxItem } from \"../core/types\";\nimport { useBroadcast, useInbox, usePeople } from \"../react/index\";\nimport { fill } from \"./copy\";\nimport { initials, useChatNative, type ChatPerson } from \"./context\";\n\n/** What a broadcast's toast says: all reached, one, or some of them. */\nexport function broadcastOutcome(sent: number, picked: number, copy: { broadcastSent: string; broadcastSentOne: string; broadcastSentSome: string }): { title: string; partial: boolean } {\n if (sent < picked) return { title: fill(copy.broadcastSentSome, { count: sent, total: picked }), partial: true };\n return { title: sent === 1 ? copy.broadcastSentOne : fill(copy.broadcastSent, { count: sent }), partial: false };\n}\n\n/** Rows to pick from: the filter's, named as the inbox names them, in name order, matching the query. */\nexport function broadcastRows(\n items: readonly ChatInboxItem[],\n opts: { filter?: (item: ChatInboxItem) => boolean; person: (id: string | null) => ChatPerson | undefined; untitled: string; query?: string },\n): { item: ChatInboxItem; title: string; avatarUrl: string | null }[] {\n const q = opts.query?.trim().toLowerCase() ?? \"\";\n return items\n .filter((i) => !i.archived && (opts.filter ? opts.filter(i) : true))\n .map((i) => {\n const other = i.otherUserId ? opts.person(i.otherUserId) : undefined;\n return { item: i, title: i.title ?? other?.name ?? opts.untitled, avatarUrl: other?.avatarUrl ?? null };\n })\n .filter((r) => !q || r.title.toLowerCase().includes(q))\n .sort((a, b) => a.title.localeCompare(b.title));\n}\n\nexport interface ChatBroadcastSheetProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n /** Only this kind of conversation (`direct`, say). */\n kind?: string;\n /** Which inbox rows may be picked; every one by default. */\n filter?: (item: ChatInboxItem) => boolean;\n /** Called with how many it went to, after a send. */\n onSent?: (sent: number, picked: number) => void;\n testID?: string;\n}\n\nexport function ChatBroadcastSheet({ open, onOpenChange, kind, filter, onSent, testID = \"chat-broadcast\" }: ChatBroadcastSheetProps) {\n const { copy, person: known } = useChatNative();\n const colors = useThemeRoles();\n const toast = useToast();\n const inbox = useInbox({ kind, limit: 200 });\n const { send, sending } = useBroadcast();\n const people = usePeople(useMemo(() => inbox.items.map((i) => i.otherUserId), [inbox.items]));\n const person = (id: string | null) => known(id) ?? (id ? people[id] : undefined);\n const [picked, setPicked] = useState<Set<string>>(new Set());\n const [text, setText] = useState(\"\");\n const [q, setQ] = useState(\"\");\n\n const all = broadcastRows(inbox.items, { filter, person, untitled: copy.untitled });\n const shown = broadcastRows(inbox.items, { filter, person, untitled: copy.untitled, query: q });\n const allShown = shown.length > 0 && shown.every((r) => picked.has(r.item.conversationId));\n\n const toggle = (id: string) =>\n setPicked((p) => {\n const next = new Set(p);\n if (next.has(id)) next.delete(id);\n else next.add(id);\n return next;\n });\n\n const submit = async () => {\n const body = text.trim();\n if (!body || picked.size === 0 || sending) return;\n try {\n const ids = await send([...picked], body);\n const outcome = broadcastOutcome(ids.length, picked.size, copy);\n toast.show({ title: outcome.title, variant: outcome.partial ? \"default\" : \"success\" });\n onSent?.(ids.length, picked.size);\n setText(\"\");\n setPicked(new Set());\n onOpenChange(false);\n } catch (e) {\n toast.show({ title: e instanceof Error ? e.message : copy.actionFailed, variant: \"destructive\" });\n }\n };\n\n const count = picked.size === 0 ? copy.broadcastPickSome : picked.size === 1 ? copy.broadcastPickedOne : fill(copy.broadcastPicked, { count: picked.size });\n return (\n <NativeSheet open={open} onOpenChange={onOpenChange} snapPoints={[\"90%\"]} testID={testID}>\n <NativeSheetScrollView keyboardShouldPersistTaps=\"handled\" contentContainerStyle={{ padding: 16, gap: 12 }}>\n <NativeText preset=\"h4\" accessibilityRole=\"header\">\n {copy.broadcastTitle}\n </NativeText>\n <NativeInlineAlert variant=\"info\" description={copy.broadcastExplainer} testID={`${testID}-explainer`} />\n <NativeTextarea\n testID={`${testID}-text`}\n label={copy.broadcastMessage}\n accessibilityLabel={copy.broadcastMessage}\n value={text}\n onChangeText={setText}\n maxLength={CHAT_LIMITS.bodyChars}\n placeholder={copy.broadcastPlaceholder}\n rows={4}\n />\n <View style={{ flexDirection: \"row\", alignItems: \"center\", justifyContent: \"space-between\", gap: 8 }}>\n <NativeText preset=\"label\" accessibilityRole=\"header\">\n {copy.broadcastTo}\n </NativeText>\n <NativeButton\n testID={`${testID}-all`}\n variant=\"ghost\"\n size=\"sm\"\n disabled={shown.length === 0}\n onPress={() =>\n setPicked((p) => {\n const next = new Set(p);\n for (const r of shown) {\n if (allShown) next.delete(r.item.conversationId);\n else next.add(r.item.conversationId);\n }\n return next;\n })\n }\n >\n {allShown ? copy.broadcastClear : copy.broadcastSelectAll}\n </NativeButton>\n </View>\n <NativeSearchBar testID={`${testID}-filter`} value={q} onChange={setQ} placeholder={copy.broadcastFilter} showCancel={false} />\n {inbox.isLoading ? (\n <View testID={`${testID}-loading`} style={{ gap: 8 }}>\n <NativeSkeleton height={44} className=\"w-full\" />\n <NativeSkeleton height={44} className=\"w-full\" />\n </View>\n ) : shown.length === 0 ? (\n <NativeEmptyState variant=\"no-results\" title={all.length ? copy.broadcastNoMatches : copy.broadcastNoConversations} testID={`${testID}-empty`} />\n ) : (\n <View testID={`${testID}-list`} style={{ borderRadius: 12, overflow: \"hidden\", backgroundColor: colors.surface }}>\n {shown.map(({ item, title, avatarUrl }) => {\n const on = picked.has(item.conversationId);\n return (\n <Pressable\n key={item.conversationId}\n testID={`${testID}-row-${item.conversationId}`}\n accessibilityRole=\"checkbox\"\n accessibilityLabel={title}\n accessibilityState={{ checked: on }}\n onPress={() => toggle(item.conversationId)}\n style={{ flexDirection: \"row\", alignItems: \"center\", gap: 12, minHeight: 52, paddingHorizontal: 12, paddingVertical: 6 }}\n >\n <View pointerEvents=\"none\" accessibilityElementsHidden importantForAccessibility=\"no-hide-descendants\">\n <NativeCheckbox checked={on} />\n </View>\n <NativeAvatar size={32} src={avatarUrl} fallback={initials(title)} alt={title} recyclingKey={item.conversationId} />\n <NativeText preset=\"body\" numberOfLines={1} style={{ flex: 1 }}>\n {title}\n </NativeText>\n </Pressable>\n );\n })}\n </View>\n )}\n <View style={{ flexDirection: \"row\", alignItems: \"center\", justifyContent: \"space-between\", gap: 12, paddingTop: 4 }}>\n <NativeText testID={`${testID}-count`} preset=\"body-sm\" accessibilityLiveRegion=\"polite\" style={{ flex: 1, color: colors.secondaryLabel }}>\n {count}\n </NativeText>\n <NativeButton testID={`${testID}-send`} onPress={() => void submit()} loading={sending} disabled={!text.trim() || picked.size === 0}>\n {picked.size > 1 ? fill(copy.broadcastSendTo, { count: picked.size }) : copy.broadcastSend}\n </NativeButton>\n </View>\n </NativeSheetScrollView>\n </NativeSheet>\n );\n}\n\n","/**\n * @feat:chat\n * `ChatSearchScreen`: a search field and its results, across all your conversations or in one.\n * Each result says who, when and (across conversations) where, with the snippet's matched words\n * highlighted, and a Transcript badge when it was found in a voice note's or video's transcript.\n * Tapping one calls `onOpen`, which the app uses to open the thread at that message\n * (`ChatThreadScreen jumpTo`, which loads earlier pages until it is there). The same rules as\n * the web's `ChatSearch`.\n */\nimport { useCallback, useEffect, useMemo, useState } from \"react\";\nimport { AccessibilityInfo, FlatList, Pressable, View } from \"react-native\";\nimport { SafeAreaView } from \"react-native-safe-area-context\";\nimport { NativeBadge, NativeEmptyState, NativeIcon, NativeSearchBar, NativeSkeleton, NativeText } from \"@marktiderman/genesis-ui-native/components\";\nimport { formatInboxTime } from \"@marktiderman/genesis-ui-native/layouts\";\nimport { useThemeRoles } from \"@marktiderman/genesis-ui-native/hooks\";\nimport { snippetParts } from \"../core/extras\";\nimport type { ChatSearchHit } from \"../core/types\";\nimport { useChat, useInbox, usePeople, useSearch } from \"../react/index\";\nimport { fill } from \"./copy\";\nimport { useChatNative } from \"./context\";\n\n/** A snippet with its « » marks drawn highlighted, inside one Text (so it wraps as one). */\nexport function SearchSnippet({ snippet, numberOfLines = 2, testID }: { snippet: string; numberOfLines?: number; testID?: string }) {\n const colors = useThemeRoles();\n return (\n <NativeText testID={testID} preset=\"body-sm\" numberOfLines={numberOfLines}>\n {snippetParts(snippet).map((p, i) =>\n p.match ? (\n <NativeText key={i} preset=\"body-sm\" style={{ fontWeight: \"700\", color: colors.label, backgroundColor: colors.fill }}>\n {p.text}\n </NativeText>\n ) : (\n <NativeText key={i} preset=\"body-sm\" style={{ color: colors.secondaryLabel }}>\n {p.text}\n </NativeText>\n ),\n )}\n </NativeText>\n );\n}\n\n/** The snippet without its marks, for a screen reader. */\nexport function snippetText(snippet: string): string {\n return snippetParts(snippet)\n .map((p) => p.text)\n .join(\"\");\n}\n\nexport interface ChatSearchScreenProps {\n /** Search one conversation; all of yours without it. */\n conversationId?: string | null;\n /** Called with the chosen result (open the thread at it). */\n onOpen: (hit: ChatSearchHit) => void;\n /** Names a conversation on results across conversations; the inbox's names by default. */\n conversationTitle?: (conversationId: string) => string;\n debounceMs?: number;\n /** The clock, for tests. */\n now?: () => Date;\n testID?: string;\n}\n\nexport function ChatSearchScreen({ conversationId, onOpen, conversationTitle, debounceMs, now = () => new Date(), testID = \"chat-search\" }: ChatSearchScreenProps) {\n const { copy, person: known } = useChatNative();\n const { userId } = useChat();\n const colors = useThemeRoles();\n const [value, setValue] = useState(\"\");\n const { hits, query, isSearching } = useSearch(value, { conversationId, debounceMs });\n // Names for \"in …\" across conversations, as the inbox shows them (one read, cached with it).\n const inbox = useInbox({});\n const ids = useMemo(() => [...hits.map((h) => h.senderId), ...inbox.items.map((i) => i.otherUserId)], [hits, inbox.items]);\n const people = usePeople(ids);\n const nameOf = useCallback(\n (id: string | null) => (id === userId ? copy.you : ((known(id) ?? (id ? people[id] : undefined))?.name ?? copy.someone)),\n [userId, copy, known, people],\n );\n const titleOf = useCallback(\n (id: string) => {\n if (conversationTitle) return conversationTitle(id);\n const item = inbox.items.find((i) => i.conversationId === id);\n return item?.title ?? (item?.otherUserId ? nameOf(item.otherUserId) : copy.untitled);\n },\n [conversationTitle, inbox.items, nameOf, copy.untitled],\n );\n\n const short = value.trim().length < 2;\n const announce = short || isSearching ? \"\" : hits.length === 0 ? copy.searchNoResults : hits.length === 1 ? copy.searchResultsOne : fill(copy.searchResults, { count: hits.length });\n // How many results, said once they settle (VoiceOver and TalkBack).\n useEffect(() => {\n if (announce) AccessibilityInfo.announceForAccessibility?.(announce);\n }, [announce]);\n return (\n <SafeAreaView testID={testID} edges={[\"left\", \"right\"]} style={{ flex: 1, backgroundColor: colors.groupedBackground }}>\n <View style={{ paddingHorizontal: 16, paddingVertical: 8 }}>\n <NativeSearchBar\n testID={`${testID}-field`}\n value={value}\n onChange={setValue}\n placeholder={conversationId ? copy.searchThreadPlaceholder : copy.searchPlaceholder}\n cancelLabel={copy.cancel}\n showCancel={false}\n />\n </View>\n {short ? (\n <NativeText preset=\"caption\" style={{ paddingHorizontal: 20, color: colors.secondaryLabel }} testID={`${testID}-hint`}>\n {copy.searchHint}\n </NativeText>\n ) : isSearching && hits.length === 0 ? (\n <View testID={`${testID}-loading`} style={{ padding: 16, gap: 10 }}>\n <NativeSkeleton height={52} className=\"w-full\" />\n <NativeSkeleton height={52} className=\"w-full\" />\n </View>\n ) : hits.length === 0 ? (\n <NativeEmptyState variant=\"no-results\" title={copy.searchNoResults} body={fill(copy.searchNoResultsBody, { query })} testID={`${testID}-empty`} />\n ) : (\n <FlatList\n testID={`${testID}-results`}\n data={hits}\n keyExtractor={(h) => `${h.messageId}:${h.inTranscript}`}\n keyboardShouldPersistTaps=\"handled\"\n keyboardDismissMode=\"on-drag\"\n renderItem={({ item: h }) => {\n const who = nameOf(h.senderId);\n const where = conversationId ? null : fill(copy.searchIn, { name: titleOf(h.conversationId) });\n const when = formatInboxTime(new Date(h.createdAt), now());\n return (\n <Pressable\n testID={`${testID}-hit-${h.messageId}`}\n accessibilityRole=\"button\"\n accessibilityLabel={[who, where, when, h.inTranscript ? copy.transcript : null, snippetText(h.snippet)].filter(Boolean).join(\", \")}\n onPress={() => onOpen(h)}\n style={({ pressed }: { pressed: boolean }) => ({ minHeight: 56, paddingHorizontal: 16, paddingVertical: 10, gap: 4, backgroundColor: pressed ? colors.fill : \"transparent\" })}\n >\n <View style={{ flexDirection: \"row\", alignItems: \"center\", gap: 6 }}>\n <NativeText preset=\"label\" numberOfLines={1} style={{ flexShrink: 1 }}>\n {who}\n </NativeText>\n {where ? (\n <NativeText preset=\"caption\" numberOfLines={1} style={{ flexShrink: 1, color: colors.secondaryLabel }}>\n {where}\n </NativeText>\n ) : null}\n <NativeText preset=\"caption\" style={{ marginLeft: \"auto\", color: colors.tertiaryLabel }}>\n {when}\n </NativeText>\n </View>\n <View style={{ flexDirection: \"row\", alignItems: \"flex-start\", gap: 6 }}>\n {h.inTranscript ? (\n <NativeBadge variant=\"muted\" testID={`${testID}-transcript-${h.messageId}`}>\n <View style={{ flexDirection: \"row\", alignItems: \"center\", gap: 3 }}>\n <NativeIcon name=\"mic\" size={11} color={colors.secondaryLabel} />\n <NativeText preset=\"caption\" style={{ color: colors.secondaryLabel }}>\n {copy.transcript}\n </NativeText>\n </View>\n </NativeBadge>\n ) : null}\n <View style={{ flex: 1 }}>\n <SearchSnippet snippet={h.snippet} />\n </View>\n </View>\n </Pressable>\n );\n }}\n />\n )}\n </SafeAreaView>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/native/organise-copy.ts","../src/native/copy.ts","../src/native/context.tsx","../src/native/media-colors.ts","../src/native/attachment-cards.tsx","../src/native/link-preview.tsx","../src/native/voice-player.tsx","../src/native/video-player.tsx","../src/native/media.tsx","../src/native/moderation.tsx","../src/native/message-bubble.tsx","../src/native/inbox-screen.tsx","../src/native/modules.ts","../src/native/video-recorder-state.ts","../src/native/video-recorder.tsx","../src/native/video-upload.ts","../src/native/video-upload-tray.tsx","../src/native/composer-state.ts","../src/native/schedule-sheet.tsx","../src/native/availability.tsx","../src/native/icon-button.tsx","../src/native/topics.tsx","../src/native/use-jump.ts","../src/native/emoji-data.ts","../src/native/emoji.ts","../src/native/emoji-picker.tsx","../src/native/recorder-machine.ts","../src/native/use-voice-recorder.ts","../src/native/composer.tsx","../src/native/use-composer.ts","../src/native/access-error.tsx","../src/native/photo-viewer.tsx","../src/native/actions.ts","../src/native/message-actions-sheet.tsx","../src/native/rows.ts","../src/native/thread-screen.tsx","../src/native/stack-options.ts","../src/native/start-sheet.tsx","../src/native/auto-retry.ts","../src/native/tus.ts","../src/native/broadcast-sheet.tsx","../src/native/search-screen.tsx"],"names":["jsx","Linking","useThemeRoles","jsxs","View","NativeText","useMemo","Pressable","NativeIcon","controls","useSyncExternalStore","useEffect","active","useState","useRef","NativeImage","index","useWindowDimensions","PanResponder","NativeAvatar","useCallback","NativeButton","AccessibilityInfo","parsed","Fragment","useToast","loaded","NativeDatePicker","NativeTimePicker","NativeSheet","NativeListItem","seq","NativeEmptyState","memo","EmojiCell","dispatch","AppState","paste","notice","ScrollView","useSafeAreaInsets","Animated","FlatList","useReducedMotion","Platform","NativeSkeleton","exact","refuse","NativeSheetScrollView","NativeInlineAlert","NativeTextarea","NativeSearchBar","SafeAreaView"],"mappings":";;;;;;;;;;;;;;;;;AAyGO,IAAM,gBAAA,GAAqC;AAAA,EAChD,MAAA,EAAQ,QAAA;AAAA,EACR,QAAA,EAAU,KAAA;AAAA,EACV,WAAA,EAAa,QAAA;AAAA,EACb,YAAA,EAAc,eAAA;AAAA,EACd,QAAA,EAAU,WAAA;AAAA,EACV,WAAA,EAAa,cAAA;AAAA,EACb,UAAA,EAAY,aAAA;AAAA,EACZ,WAAA,EAAa,cAAA;AAAA,EACb,SAAA,EAAW,MAAA;AAAA,EACX,oBAAA,EAAsB,gBAAA;AAAA,EACtB,QAAA,EAAU,WAAA;AAAA,EACV,SAAA,EAAW,MAAA;AAAA,EACX,WAAA,EAAa,yCAAA;AAAA,EACb,iBAAA,EAAmB,uBAAA;AAAA,EACnB,gBAAA,EAAkB,iBAAA;AAAA,EAClB,eAAA,EAAiB,eAAA;AAAA,EACjB,iBAAA,EAAmB,iBAAA;AAAA,EACnB,QAAA,EAAU,kBAAA;AAAA,EACV,aAAA,EAAe,kBAAA;AAAA,EACf,YAAA,EAAc,qEAAA;AAAA,EACd,YAAA,EAAc,sBAAA;AAAA,EACd,YAAA,EAAc,MAAA;AAAA,EACd,YAAA,EAAc,MAAA;AAAA,EACd,eAAA,EAAiB,UAAA;AAAA,EACjB,kBAAA,EAAoB,+CAAA;AAAA,EACpB,YAAA,EAAc,sBAAA;AAAA,EACd,cAAA,EAAgB,sBAAA;AAAA,EAChB,eAAA,EAAiB,8FAAA;AAAA,EACjB,cAAA,EAAgB,4BAAA;AAAA,EAChB,iBAAA,EAAmB,qBAAA;AAAA,EACnB,cAAA,EAAgB,WAAA;AAAA,EAChB,cAAA,EAAgB,mBAAA;AAAA,EAChB,kBAAA,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eAAA,EAAiB,EAAA,EAAI,GAAA,EAAK,CAAA,EAAG,eAAA,EAAiB,OAAA,GAAU,MAAA,CAAO,OAAO,aAAA,EAAc;AAAA,MAElI;AAAA;AAAA,GACH;AAEJ","file":"native.js","sourcesContent":["/**\n * @feat:chat\n * The words of chat's organising features on native (topics, scheduled send, availability,\n * broadcast, search, moderation), part of `ChatNativeCopy`, so an app overrides them the same\n * way (`ChatNativeProvider copy`). `{name}`, `{count}`, `{when}` and `{query}` are filled in.\n */\nexport interface ChatOrganiseCopy {\n // Topics\n topics: string;\n topicAll: string;\n topicClosed: string;\n topicOptions: string;\n topicNew: string;\n topicRename: string;\n topicClose: string;\n topicReopen: string;\n topicName: string;\n topicNamePlaceholder: string;\n topicAdd: string;\n topicSave: string;\n topicExists: string;\n topicClosedNotice: string;\n topicPlaceholder: string;\n topicClosedDone: string;\n topicReopenedDone: string;\n // Scheduled send\n schedule: string;\n scheduleTitle: string;\n scheduleHint: string;\n schedulePick: string;\n scheduleDate: string;\n scheduleTime: string;\n scheduleConfirm: string;\n scheduleOutOfRange: string;\n scheduledFor: string;\n scheduleFailed: string;\n scheduleNoFiles: string;\n scheduledCount: string;\n scheduledCountOne: string;\n scheduledTitle: string;\n scheduledEmpty: string;\n scheduledEmptyBody: string;\n scheduledCancel: string;\n /** On a scheduled message that couldn't be sent. */\n scheduledRemove: string;\n scheduledCancelled: string;\n scheduledCouldntSend: string;\n // Availability\n availabilityTitle: string;\n awayMessage: string;\n awayMessagePlaceholder: string;\n awayUntil: string;\n awayUntilOn: string;\n imBack: string;\n workingHours: string;\n workingHoursOn: string;\n workingHoursHint: string;\n workingDay: string;\n notWorking: string;\n hoursFrom: string;\n hoursTo: string;\n hoursSameTime: string;\n timeZone: string;\n timeZoneSearch: string;\n availabilitySave: string;\n availabilitySaved: string;\n // Broadcast\n broadcastTitle: string;\n broadcastExplainer: string;\n broadcastMessage: string;\n broadcastPlaceholder: string;\n broadcastTo: string;\n broadcastFilter: string;\n broadcastSelectAll: string;\n broadcastClear: string;\n broadcastPickSome: string;\n broadcastPicked: string;\n broadcastPickedOne: string;\n broadcastSend: string;\n broadcastSendTo: string;\n broadcastSent: string;\n broadcastSentOne: string;\n broadcastSentSome: string;\n broadcastNoMatches: string;\n broadcastNoConversations: string;\n // Search\n search: string;\n searchPlaceholder: string;\n searchThreadPlaceholder: string;\n searchHint: string;\n searchNoResults: string;\n searchNoResultsBody: string;\n searchResults: string;\n searchResultsOne: string;\n searchIn: string;\n transcript: string;\n messageGone: string;\n /** Said by VoiceOver when a jump lands. */\n jumpedTo: string;\n // Moderation\n moderationHidden: string;\n moderationHiddenMine: string;\n moderationFlagged: string;\n}\n\nexport const chatOrganiseCopy: ChatOrganiseCopy = {\n topics: \"Topics\",\n topicAll: \"All\",\n topicClosed: \"Closed\",\n topicOptions: \"Topic options\",\n topicNew: \"New topic\",\n topicRename: \"Rename topic\",\n topicClose: \"Close topic\",\n topicReopen: \"Reopen topic\",\n topicName: \"Name\",\n topicNamePlaceholder: \"Week 1: Habits\",\n topicAdd: \"Add topic\",\n topicSave: \"Save\",\n topicExists: \"There's already a topic with that name.\",\n topicClosedNotice: \"This topic is closed.\",\n topicPlaceholder: \"Message #{name}\",\n topicClosedDone: \"Closed {name}\",\n topicReopenedDone: \"Reopened {name}\",\n schedule: \"Schedule message\",\n scheduleTitle: \"Schedule message\",\n scheduleHint: \"It sends at this time, in your time zone, as if you'd sent it then.\",\n schedulePick: \"Pick a date and time\",\n scheduleDate: \"Date\",\n scheduleTime: \"Time\",\n scheduleConfirm: \"Schedule\",\n scheduleOutOfRange: \"Pick a time from a minute to a year from now.\",\n scheduledFor: \"Scheduled for {when}\",\n scheduleFailed: \"Couldn't schedule it\",\n scheduleNoFiles: \"Photos and files can't be scheduled yet. Send them now, or remove them to schedule the text.\",\n scheduledCount: \"{count} scheduled messages\",\n scheduledCountOne: \"1 scheduled message\",\n scheduledTitle: \"Scheduled\",\n scheduledEmpty: \"Nothing scheduled\",\n scheduledEmptyBody: \"Touch and hold Send to schedule a message.\",\n scheduledCancel: \"Cancel\",\n scheduledRemove: \"Remove\",\n scheduledCancelled: \"Scheduled message cancelled\",\n scheduledCouldntSend: \"Couldn't send\",\n availabilityTitle: \"Availability\",\n awayMessage: \"Away message\",\n awayMessagePlaceholder: \"Back Monday. For anything urgent, call the office.\",\n awayUntil: \"Away until\",\n awayUntilOn: \"Set an end\",\n imBack: \"I'm back\",\n workingHours: \"Working hours\",\n workingHoursOn: \"Tell people when you usually reply\",\n workingHoursHint: \"An end before the start runs past midnight.\",\n workingDay: \"Working on {name}\",\n notWorking: \"Not working\",\n hoursFrom: \"{name} from\",\n hoursTo: \"{name} to\",\n hoursSameTime: \"A day's start and end can't be the same time.\",\n timeZone: \"Time zone\",\n timeZoneSearch: \"Search time zones\",\n availabilitySave: \"Save\",\n availabilitySaved: \"Availability saved\",\n broadcastTitle: \"Broadcast\",\n broadcastExplainer: \"Each person gets this in their own conversation with you, so replies come back to you privately. No one sees who else got it.\",\n broadcastMessage: \"Message\",\n broadcastPlaceholder: \"Write once, send to everyone you pick\",\n broadcastTo: \"Send to\",\n broadcastFilter: \"Filter\",\n broadcastSelectAll: \"Select all\",\n broadcastClear: \"Clear\",\n broadcastPickSome: \"Pick who gets it\",\n broadcastPicked: \"{count} conversations\",\n broadcastPickedOne: \"1 conversation\",\n broadcastSend: \"Send\",\n broadcastSendTo: \"Send to {count}\",\n broadcastSent: \"Sent to {count} conversations\",\n broadcastSentOne: \"Sent to 1 conversation\",\n broadcastSentSome: \"Sent to {count} of {total}. You can't post in the others.\",\n broadcastNoMatches: \"No matches\",\n broadcastNoConversations: \"No conversations yet\",\n search: \"Search\",\n searchPlaceholder: \"Search messages\",\n searchThreadPlaceholder: \"Search this conversation\",\n searchHint: \"Type at least two letters.\",\n searchNoResults: \"No results\",\n searchNoResultsBody: \"Nothing matches “{query}”.\",\n searchResults: \"{count} results\",\n searchResultsOne: \"1 result\",\n searchIn: \"in {name}\",\n transcript: \"Transcript\",\n messageGone: \"That message isn't here any more\",\n jumpedTo: \"Message from {name}: {text}\",\n moderationHidden: \"Hidden by moderation\",\n moderationHiddenMine: \"Hidden by moderation. Only you can see it.\",\n moderationFlagged: \"Flagged\",\n};\n","/**\n * @feat:chat\n * Every word the native chat screens say, in one catalog an app can override\n * (translate, rename \"Message\" to \"Note\"). `{name}` and `{count}` are filled in.\n */\nimport { chatOrganiseCopy, type ChatOrganiseCopy } from \"./organise-copy\";\n\n/** Topics, scheduled send, availability, broadcast, search and moderation are in `ChatOrganiseCopy`. */\nexport interface ChatNativeCopy extends ChatOrganiseCopy {\n inboxTitle: string;\n inboxEmptyTitle: string;\n inboxEmptyBody: string;\n inboxErrorTitle: string;\n startConversation: string;\n startConversationTitle: string;\n untitled: string;\n you: string;\n someone: string;\n youPrefix: string;\n mentionedYou: string;\n markRead: string;\n pin: string;\n unpin: string;\n archive: string;\n threadEmptyTitle: string;\n threadEmptyBody: string;\n loadEarlier: string;\n newMessages: string;\n placeholder: string;\n send: string;\n attach: string;\n attachLibrary: string;\n attachCamera: string;\n attachPaste: string;\n removeAttachment: string;\n replyingTo: string;\n cancelReply: string;\n cantPost: string;\n /** Your role in a conversation couldn't be read (offline): with Retry. */\n accessError: string;\n cantPostAdmins: string;\n cantPostClosed: string;\n recordVoice: string;\n recordHint: string;\n slideToCancel: string;\n releaseToCancel: string;\n lockedHint: string;\n stopAndSend: string;\n cancelRecording: string;\n micDenied: string;\n tooShort: string;\n /** A recording whose stop failed or left no file. */\n recordingFailed: string;\n /** A recording ended by a call, Siri, another app or the app leaving the screen. */\n recordingInterrupted: string;\n play: string;\n /** The bubble's VoiceOver actions on a voice note. */\n playVoice: string;\n pauseVoice: string;\n changeSpeed: string;\n /** The bubble's VoiceOver action for the nth of several photos. */\n openPhotoN: string;\n pause: string;\n speed: string;\n voiceMessage: string;\n voice: string;\n photo: string;\n file: string;\n video: string;\n /** Video messages (recorder, upload, player), link previews and app attachment cards. */\n recordVideo: string;\n recordVideoHint: string;\n startVideo: string;\n stopVideo: string;\n flipCamera: string;\n closeRecorder: string;\n cameraDenied: string;\n openSettings: string;\n cameraFailed: string;\n videoTooShort: string;\n /** \"0:12 of 2:00\", the recorder's timer. */\n videoElapsed: string;\n videoUploading: string;\n videoUploadFailed: string;\n videoOffline: string;\n videoForbidden: string;\n videoCantPlay: string;\n /** A take that the camera didn't hand over. */\n videoTakeFailed: string;\n tryAgain: string;\n cancelUpload: string;\n videoProcessing: string;\n videoFailed: string;\n playVideo: string;\n pauseVideo: string;\n mute: string;\n unmute: string;\n fullScreen: string;\n /** \"Video, 0:42\". */\n videoMessage: string;\n /** A link preview card's label: \"{title}, {site}\". */\n linkPreview: string;\n openLink: string;\n /** The bubble's VoiceOver action for its link preview. */\n openLinkAction: string;\n attachmentCard: string;\n openImage: string;\n closeViewer: string;\n photoOf: string;\n sharePhoto: string;\n savePhoto: string;\n photoSaved: string;\n photosDenied: string;\n viewerHint: string;\n sending: string;\n notSent: string;\n retry: string;\n /** On a message whose file didn't survive a relaunch: pick it again. */\n attachAgain: string;\n discard: string;\n deleted: string;\n edited: string;\n react: string;\n /** The long-press sheet's \"+\": every emoji. */\n moreReactions: string;\n addEmoji: string;\n emojiPicker: string;\n searchEmoji: string;\n noEmoji: string;\n recentEmoji: string;\n emojiSmileys: string;\n emojiPeople: string;\n emojiNature: string;\n emojiFood: string;\n emojiTravel: string;\n emojiActivities: string;\n emojiObjects: string;\n emojiSymbols: string;\n emojiFlags: string;\n reply: string;\n copy: string;\n copied: string;\n delete: string;\n deleteConfirm: string;\n cancel: string;\n actionFailed: string;\n messageActions: string;\n reactions: string;\n tooLarge: string;\n notAllowedType: string;\n tooMany: string;\n}\n\nexport const chatNativeCopy: ChatNativeCopy = {\n ...chatOrganiseCopy,\n inboxTitle: \"Messages\",\n inboxEmptyTitle: \"No conversations yet\",\n inboxEmptyBody: \"When someone messages you, or you start a conversation, it shows up here.\",\n inboxErrorTitle: \"Couldn't load your messages\",\n startConversation: \"New message\",\n startConversationTitle: \"Message someone\",\n untitled: \"Conversation\",\n you: \"You\",\n someone: \"Someone\",\n youPrefix: \"You: \",\n mentionedYou: \"Mentioned you\",\n markRead: \"Mark read\",\n pin: \"Pin\",\n unpin: \"Unpin\",\n archive: \"Archive\",\n threadEmptyTitle: \"No messages yet\",\n threadEmptyBody: \"Say hello below.\",\n loadEarlier: \"Load earlier messages\",\n newMessages: \"New messages\",\n placeholder: \"Message\",\n send: \"Send\",\n attach: \"Add a photo or file\",\n attachLibrary: \"Photo library\",\n attachCamera: \"Take a photo\",\n attachPaste: \"Paste picture\",\n removeAttachment: \"Remove {name}\",\n replyingTo: \"Replying to {name}\",\n cancelReply: \"Cancel reply\",\n cantPost: \"You can't post in this conversation.\",\n accessError: \"This conversation couldn't be loaded. Check your connection and try again.\",\n cantPostAdmins: \"Only admins can post here.\",\n cantPostClosed: \"This conversation is closed.\",\n recordVoice: \"Record a voice message\",\n recordHint: \"Hold to record, slide left to cancel, slide up to lock.\",\n slideToCancel: \"‹ Slide to cancel\",\n releaseToCancel: \"Release to cancel\",\n lockedHint: \"Recording. Tap send when you're done.\",\n stopAndSend: \"Send voice message\",\n cancelRecording: \"Delete recording\",\n micDenied: \"Turn on the microphone for this app in Settings to record.\",\n tooShort: \"Hold to record a voice message.\",\n recordingFailed: \"The voice message couldn't be saved. Try recording it again.\",\n recordingInterrupted: \"Recording stopped, so it wasn't sent. Hold to record again.\",\n play: \"Play\",\n playVoice: \"Play voice message\",\n pauseVoice: \"Pause voice message\",\n changeSpeed: \"Change playback speed\",\n openPhotoN: \"Open photo {n}\",\n pause: \"Pause\",\n speed: \"Playback speed {rate}\",\n voiceMessage: \"Voice message, {duration}\",\n voice: \"Voice message\",\n photo: \"Photo\",\n file: \"File\",\n video: \"Video\",\n recordVideo: \"Record a video\",\n recordVideoHint: \"Tap to start and tap again to send, or hold and let go to send.\",\n startVideo: \"Start recording\",\n stopVideo: \"Stop and send\",\n flipCamera: \"Switch camera\",\n closeRecorder: \"Close the camera\",\n cameraDenied: \"Turn on the camera and microphone for this app in Settings to record a video.\",\n openSettings: \"Open Settings\",\n cameraFailed: \"The camera couldn't start.\",\n videoTooShort: \"That was too short to send. Hold longer, or tap to start and tap again to stop.\",\n videoElapsed: \"{elapsed} of {limit}\",\n videoUploading: \"Sending video, {percent}%\",\n videoUploadFailed: \"The video didn't send.\",\n videoOffline: \"The video didn't send. Check your connection and retry.\",\n videoForbidden: \"You can't post in this conversation.\",\n videoCantPlay: \"This video can't play right now.\",\n videoTakeFailed: \"That take didn't record. Try again.\",\n tryAgain: \"Try again\",\n cancelUpload: \"Cancel video\",\n videoProcessing: \"Processing video\",\n videoFailed: \"This video couldn't be processed.\",\n playVideo: \"Play video\",\n pauseVideo: \"Pause video\",\n mute: \"Mute\",\n unmute: \"Unmute\",\n fullScreen: \"Full screen\",\n videoMessage: \"Video, {duration}\",\n linkPreview: \"{title}, {site}\",\n openLink: \"Opens the link\",\n openLinkAction: \"Open link\",\n attachmentCard: \"{title}, {subtitle}\",\n openImage: \"Open photo\",\n closeViewer: \"Close\",\n photoOf: \"Photo {n} of {count}\",\n sharePhoto: \"Share photo\",\n savePhoto: \"Save to Photos\",\n photoSaved: \"Saved to Photos\",\n photosDenied: \"Allow this app to add to Photos in Settings to save.\",\n viewerHint: \"Swipe up or down for the next or previous photo.\",\n sending: \"Sending\",\n notSent: \"Not sent\",\n retry: \"Retry\",\n attachAgain: \"Attach again\",\n discard: \"Delete\",\n deleted: \"Message deleted\",\n edited: \"edited\",\n react: \"React with {emoji}\",\n moreReactions: \"More reactions\",\n addEmoji: \"Add emoji\",\n emojiPicker: \"Emoji\",\n searchEmoji: \"Search emoji\",\n noEmoji: \"No emoji found\",\n recentEmoji: \"Recent\",\n emojiSmileys: \"Smileys and emotion\",\n emojiPeople: \"People and body\",\n emojiNature: \"Animals and nature\",\n emojiFood: \"Food and drink\",\n emojiTravel: \"Travel and places\",\n emojiActivities: \"Activities\",\n emojiObjects: \"Objects\",\n emojiSymbols: \"Symbols\",\n emojiFlags: \"Flags\",\n reply: \"Reply\",\n copy: \"Copy\",\n copied: \"Copied\",\n delete: \"Delete\",\n deleteConfirm: \"Delete this message for everyone?\",\n cancel: \"Cancel\",\n actionFailed: \"That didn't work\",\n messageActions: \"Message actions\",\n reactions: \"{count} reactions\",\n tooLarge: \"{name} is too large to send.\",\n notAllowedType: \"{name} can't be sent.\",\n tooMany: \"At most {count} attachments in one message.\",\n};\n\nexport type ChatNativeCopyOverrides = Partial<ChatNativeCopy>;\n\nexport function resolveChatCopy(overrides?: ChatNativeCopyOverrides): ChatNativeCopy {\n return overrides ? { ...chatNativeCopy, ...overrides } : chatNativeCopy;\n}\n\n/** `fill(\"Replying to {name}\", { name: \"Sam\" })`. */\nexport function fill(text: string, values: Record<string, string | number>): string {\n return text.replace(/\\{(\\w+)\\}/g, (m, k: string) => (k in values ? String(values[k]) : m));\n}\n","/**\n * @feat:chat\n * What the native screens share: the native modules the app passed, the copy,\n * and how to name and picture a person (the chat schema stores user ids only;\n * names and avatars are the app's, from its own profiles: `ChatProvider\n * loadPeople`, read through `usePeople`, or `getPerson` here, which wins).\n */\nimport { createContext, useContext, useMemo, type ReactNode } from \"react\";\nimport { usePeople } from \"../react/index\";\nimport { resolveChatCopy, type ChatNativeCopy, type ChatNativeCopyOverrides } from \"./copy\";\nimport type { ChatNativeModules } from \"./modules\";\n\nexport interface ChatPerson {\n name: string;\n avatarUrl?: string | null;\n}\n\nexport interface ChatNativeContextValue {\n modules: ChatNativeModules;\n copy: ChatNativeCopy;\n /** A person's name and picture, or undefined while it isn't known. */\n person(userId: string | null | undefined): ChatPerson | undefined;\n}\n\nconst EMPTY_MODULES: ChatNativeModules = Object.freeze({});\nconst DEFAULT: ChatNativeContextValue = { modules: EMPTY_MODULES, copy: resolveChatCopy(), person: () => undefined };\nconst Context = createContext<ChatNativeContextValue>(DEFAULT);\n\nexport interface ChatNativeProviderProps {\n /** Define at module scope: a new object every render re-renders every chat screen. */\n modules?: ChatNativeModules;\n copy?: ChatNativeCopyOverrides;\n /** Names and avatars the app already has; wins over `ChatProvider loadPeople`. */\n getPerson?: (userId: string) => ChatPerson | undefined;\n children: ReactNode;\n}\n\n/** Inside `ChatProvider` (from `/react`). Optional: without it there are no native extras and people are \"Someone\". */\nexport function ChatNativeProvider({ modules = EMPTY_MODULES, copy, getPerson, children }: ChatNativeProviderProps) {\n const value = useMemo<ChatNativeContextValue>(\n () => ({ modules, copy: resolveChatCopy(copy), person: (id) => (id && getPerson ? getPerson(id) : undefined) }),\n [modules, copy, getPerson],\n );\n return <Context.Provider value={value}>{children}</Context.Provider>;\n}\n\nexport function useChatNative(): ChatNativeContextValue {\n return useContext(Context);\n}\n\n/**\n * Below it, `person()` also knows these people, fetched in one batch through\n * `ChatProvider loadPeople` (a screen wraps its rows in it with the ids it shows).\n */\nexport function ChatPeopleScope({ userIds, children }: { userIds: readonly (string | null | undefined)[]; children: ReactNode }) {\n const parent = useContext(Context);\n const people = usePeople(userIds as (string | null | undefined)[]);\n const value = useMemo<ChatNativeContextValue>(\n () => ({ ...parent, person: (id) => parent.person(id) ?? (id ? people[id] : undefined) }),\n [parent, people],\n );\n return <Context.Provider value={value}>{children}</Context.Provider>;\n}\n\n/** \"SA\" for \"Sam Altman\", \"S\" for \"sam\". */\nexport function initials(name: string | undefined): string {\n const parts = (name ?? \"\").trim().split(/\\s+/).filter(Boolean);\n if (parts.length === 0) return \"?\";\n return ((parts[0]![0] ?? \"\") + (parts.length > 1 ? (parts[parts.length - 1]![0] ?? \"\") : \"\")).toUpperCase();\n}\n","/**\n * @feat:chat\n * Colors over a camera feed or a video frame, the same in light and dark mode: the picture\n * behind them is what it is, so the theme roles (which follow the scheme) don't apply. Genesis\n * has no \"on media\" role yet; these are the one place chat names them.\n */\nexport const ON_MEDIA = \"#ffffff\";\nexport const MEDIA_BACKDROP = \"#000000\";\nexport const MEDIA_FRAME = \"#111111\";\n/** Behind controls and labels laid over a picture. */\nexport const MEDIA_SCRIM = \"rgba(0,0,0,0.5)\";\nexport const MEDIA_SCRIM_LIGHT = \"rgba(0,0,0,0.35)\";\n/** A tint-bubble card's fill, over the tint. */\nexport const ON_TINT_FILL = \"rgba(255,255,255,0.16)\";\nexport const ON_TINT_FILL_STRONG = \"rgba(255,255,255,0.2)\";\n","/**\n * @feat:chat\n * Cards for the app's own attachment kinds (`ChatProvider attachmentKinds`: a form to fill, a\n * check-in to answer): an icon, the title and subtitle the kind gives, and one button. The\n * button runs the kind's `onPress`; else the app's `onOpenAttachment` (open the form in the\n * app's own screen); else its `href`, when it is https. The bubble offers the same button as\n * a VoiceOver action (`cardAction`), since an accessible bubble hides what is inside it.\n *\n * The kind's `title`, `subtitle` and `action` get a second argument, `{ mine }` (`ChatCardContext`):\n * true on the sender's own card, so a kind can drop its button there (you don't answer your own\n * check-in). Previews (the inbox, the long-press sheet) name a card by its kind's `label`, else\n * its title, not \"Attachment\".\n */\nimport { Linking, View } from \"react-native\";\nimport { NativeButton, NativeIcon, NativeText } from \"@marktiderman/genesis-ui-native/components\";\nimport { useThemeRoles } from \"@marktiderman/genesis-ui-native/hooks\";\nimport type { ChatAttachment, ChatMessage } from \"../core/types\";\nimport type { ChatAttachmentKind, ChatCardContext } from \"../react/index\";\nimport { attachmentPreview, callAttachmentKind as call, cardTitle, messagePreview } from \"../react/previews\";\n\nexport type { ChatCardContext };\nexport { attachmentPreview, cardTitle, messagePreview };\nimport { fill } from \"./copy\";\nimport { useChatNative } from \"./context\";\nimport { ON_TINT_FILL, ON_TINT_FILL_STRONG } from \"./media-colors\";\n\nexport type OpenAttachment = (attachment: ChatAttachment, message: ChatMessage) => void;\n\n/** A message's attachments split into the app's cards and the rest (photos, voice, video, files). */\nexport function splitCardAttachments<T extends { kind: string }>(attachments: readonly T[], kinds: Record<string, ChatAttachmentKind> | undefined): { cards: T[]; rest: T[] } {\n if (!kinds) return { cards: [], rest: [...attachments] };\n const cards: T[] = [];\n const rest: T[] = [];\n for (const a of attachments) (Object.prototype.hasOwnProperty.call(kinds, a.kind) ? cards : rest).push(a);\n return { cards, rest };\n}\n\n/**\n * A link a card may open by itself: https only. A kind's href is often built from what another\n * person sent, so any other scheme (tel:, sms:, another app's links) goes through the app's own\n * `onOpenAttachment` or the kind's `onPress` instead.\n */\nexport function isOpenableHref(href: string | null | undefined): href is string {\n if (!href) return false;\n try {\n const u = new URL(href);\n return u.protocol === \"https:\" && Boolean(u.hostname);\n } catch {\n return false;\n }\n}\n\n/** What a card does: the kind's own handler, else the app's, else an https href; null without a button. */\nexport function cardAction(\n kind: ChatAttachmentKind | undefined,\n attachment: ChatAttachment,\n message: ChatMessage,\n onOpenAttachment?: OpenAttachment,\n ctx: ChatCardContext = { mine: false },\n): { label: string; run: () => void } | null {\n let action: ReturnType<NonNullable<ChatAttachmentKind[\"action\"]>> = null;\n try {\n action = call(kind, \"action\", attachment, ctx);\n } catch {\n return null;\n }\n if (!action?.label) return null;\n const href = isOpenableHref(action.href) ? action.href : null;\n const onPress = action.onPress;\n const run = onPress ? onPress : onOpenAttachment ? () => onOpenAttachment(attachment, message) : href ? () => void Linking.openURL(href).catch(() => undefined) : null;\n return run ? { label: action.label, run } : null;\n}\n\nexport interface ChatAttachmentCardProps {\n attachment: ChatAttachment;\n message: ChatMessage;\n kind: ChatAttachmentKind;\n mine?: boolean;\n onOpenAttachment?: OpenAttachment;\n testID?: string;\n}\n\nexport function ChatAttachmentCard({ attachment, message, kind, mine = false, onOpenAttachment, testID = \"chat-attachment-card\" }: ChatAttachmentCardProps) {\n const { copy } = useChatNative();\n const colors = useThemeRoles();\n let title = \"\";\n let subtitle: string | null | undefined = null;\n const ctx: ChatCardContext = { mine };\n try {\n title = call(kind, \"title\", attachment, ctx) ?? \"\";\n subtitle = call(kind, \"subtitle\", attachment, ctx);\n } catch (e) {\n // An app's kind that throws shows as a plain card, and says so in development.\n if (typeof __DEV__ !== \"undefined\" && __DEV__) console.warn(`[genesis-chat] attachment kind \"${attachment.kind}\" threw:`, e);\n }\n title = title || attachment.name || attachment.kind;\n const action = cardAction(kind, attachment, message, onOpenAttachment, ctx);\n const fg = mine ? \"text-primary-foreground\" : undefined;\n return (\n <View\n testID={testID}\n style={{ flexDirection: \"row\", alignItems: \"center\", gap: 10, padding: 10, borderRadius: 12, minWidth: 220, backgroundColor: mine ? ON_TINT_FILL : colors.groupedBackground }}\n >\n <View\n accessible\n accessibilityLabel={subtitle ? fill(copy.attachmentCard, { title, subtitle }) : title}\n style={{ flexDirection: \"row\", alignItems: \"center\", gap: 10, flex: 1 }}\n >\n <View style={{ width: 40, height: 40, borderRadius: 10, alignItems: \"center\", justifyContent: \"center\", backgroundColor: mine ? ON_TINT_FILL_STRONG : colors.fill }}>\n <NativeIcon name=\"file\" size={20} color={mine ? colors.surface : colors.tint} />\n </View>\n <View style={{ flex: 1, minWidth: 0 }}>\n <NativeText numberOfLines={1} className={fg} style={mine ? { fontWeight: \"600\", fontSize: 15 } : { fontWeight: \"600\", fontSize: 15, color: colors.label }}>\n {title}\n </NativeText>\n {subtitle ? (\n <NativeText preset=\"caption\" numberOfLines={1} className={fg} style={mine ? { opacity: 0.85 } : { color: colors.secondaryLabel }}>\n {subtitle}\n </NativeText>\n ) : null}\n </View>\n </View>\n {action ? (\n <NativeButton testID={`${testID}-action`} variant={mine ? \"secondary\" : \"default\"} onPress={action.run}>\n {action.label}\n </NativeButton>\n ) : null}\n </View>\n );\n}\n\ndeclare const __DEV__: boolean | undefined;\n","/**\n * @feat:chat\n * A link's preview under its message, from `useLinkPreviews`: the site, the title and the\n * description, all plain text the server fetched (Open Graph, never HTML). Tap to open: in an\n * in-app browser with `modules.webBrowser` (expo-web-browser), else the system's (`Linking`).\n * Only https links. The image shows only when the app turns on `linkPreviewImages`: fetching\n * a page's og:image from the phone tells that site the reader's address, so by default the\n * card has none and nothing is fetched. The thread screen reads that switch from `ChatProvider\n * linkPreviewImages` once the provider has it (the chat owner's change); until then it is off.\n */\nimport { Linking, Pressable, View } from \"react-native\";\nimport { NativeImage, NativeText } from \"@marktiderman/genesis-ui-native/components\";\nimport { useThemeRoles } from \"@marktiderman/genesis-ui-native/hooks\";\nimport { extractLinks, isHttpsUrl } from \"../core/extras\";\nimport type { ChatLinkPreview, ChatMessage } from \"../core/types\";\nimport { fill } from \"./copy\";\nimport { useChatNative } from \"./context\";\nimport { ON_TINT_FILL } from \"./media-colors\";\nimport type { WebBrowserLike } from \"./modules\";\n\n/** The site a link is on, without `www.`. */\nexport function linkHost(url: string): string {\n try {\n return new URL(url).hostname.replace(/^www\\./, \"\");\n } catch {\n return url;\n }\n}\n\n/** The preview a bubble shows: the first one the server fetched for a link in its text, https only. */\nexport function previewToShow(previews: readonly ChatLinkPreview[] | undefined): ChatLinkPreview | null {\n return previews?.find((p) => p.status === \"ok\" && isHttpsUrl(p.url)) ?? null;\n}\n\n/** The messages to ask previews for: shown (not deleted, not hidden by moderation), with a link. */\nexport function linkPreviewIds(messages: readonly ChatMessage[]): string[] {\n return messages.filter((m) => !m.deletedAt && m.moderation !== \"hidden\" && extractLinks(m.body).length > 0).map((m) => m.id);\n}\n\n/** Opens a link from chat: https only, in the in-app browser when there is one. */\nexport async function openChatLink(url: string, webBrowser?: WebBrowserLike): Promise<boolean> {\n if (!isHttpsUrl(url)) return false;\n try {\n if (webBrowser) await webBrowser.openBrowserAsync(url);\n else await Linking.openURL(url);\n return true;\n } catch {\n return false;\n }\n}\n\nexport interface ChatLinkPreviewCardProps {\n preview: ChatLinkPreview;\n /** On the tint bubble. */\n mine?: boolean;\n /** Show the og:image. Off by default: fetching it tells the site the reader's address. */\n images?: boolean;\n testID?: string;\n}\n\nexport function ChatLinkPreviewCard({ preview, mine = false, images = false, testID = \"chat-link-preview\" }: ChatLinkPreviewCardProps) {\n const { copy, modules } = useChatNative();\n const colors = useThemeRoles();\n if (preview.status !== \"ok\" || !isHttpsUrl(preview.url)) return null;\n const host = linkHost(preview.url);\n const site = preview.siteName?.trim() || host;\n const title = preview.title?.trim() || host;\n const image = images && isHttpsUrl(preview.imageUrl) ? preview.imageUrl : null;\n const fg = mine ? \"text-primary-foreground\" : undefined;\n return (\n <Pressable\n testID={testID}\n accessibilityRole=\"link\"\n accessibilityLabel={fill(copy.linkPreview, { title, site })}\n accessibilityHint={copy.openLink}\n onPress={() => void openChatLink(preview.url, modules.webBrowser)}\n style={{\n marginTop: 2,\n borderLeftWidth: 3,\n borderLeftColor: mine ? colors.surface : colors.tint,\n borderRadius: 10,\n overflow: \"hidden\",\n backgroundColor: mine ? ON_TINT_FILL : colors.groupedBackground,\n }}\n >\n {image ? (\n <NativeImage testID={`${testID}-image`} src={image} width={240} height={126} contentFit=\"cover\" />\n ) : null}\n <View style={{ paddingHorizontal: 10, paddingVertical: 8, gap: 2 }}>\n <NativeText preset=\"caption\" numberOfLines={1} className={fg} style={mine ? { opacity: 0.8 } : { color: colors.secondaryLabel }}>\n {site}\n </NativeText>\n <NativeText numberOfLines={2} className={fg} style={mine ? { fontWeight: \"600\", fontSize: 15 } : { fontWeight: \"600\", fontSize: 15, color: colors.label }}>\n {title}\n </NativeText>\n {preview.description ? (\n <NativeText preset=\"caption\" numberOfLines={2} className={fg} style={mine ? { opacity: 0.85 } : { color: colors.secondaryLabel }}>\n {preview.description}\n </NativeText>\n ) : null}\n </View>\n </Pressable>\n );\n}\n","/**\n * @feat:chat\n * A voice note in a bubble: play and pause, its waveform (drawn before the\n * audio loads), drag across it to scrub, 1x / 1.5x / 2x, and the time. One\n * voice note plays at a time: starting one pauses the one playing. Each one\n * also answers `toggleVoiceNote` / `cycleVoiceNoteRate` by its id, which the\n * bubble's VoiceOver actions call (an accessible bubble hides its children).\n */\nimport { useEffect, useMemo, useRef, useState, useSyncExternalStore } from \"react\";\nimport { PanResponder, Pressable, View, type LayoutChangeEvent } from \"react-native\";\nimport { NativeIcon, NativeText } from \"@marktiderman/genesis-ui-native/components\";\nimport { useThemeRoles } from \"@marktiderman/genesis-ui-native/hooks\";\nimport { formatDuration, nextPlaybackRate } from \"../core/media\";\nimport { fill } from \"./copy\";\nimport { useChatNative } from \"./context\";\nimport type { ExpoAudioLike } from \"./modules\";\n\n// ---- One at a time --------------------------------------------------------\n\nlet active: { id: string; pause: () => void } | null = null;\nconst playbackListeners = new Set<() => void>();\nconst notifyPlayback = () => playbackListeners.forEach((l) => l());\n\n/** Called when a voice note starts: pauses whichever other one was playing. */\nexport function claimPlayback(id: string, pause: () => void): void {\n if (active && active.id !== id) {\n try {\n active.pause();\n } catch {\n // A player already gone has nothing to pause.\n }\n }\n active = { id, pause };\n notifyPlayback();\n}\n\n/** Called when a voice note stops or unmounts. */\nexport function releasePlayback(id: string): void {\n if (active?.id === id) {\n active = null;\n notifyPlayback();\n }\n}\n\nconst subscribePlayback = (l: () => void) => {\n playbackListeners.add(l);\n return () => void playbackListeners.delete(l);\n};\n\n/** Which of these voice notes is playing, or null (re-renders only when that answer changes). */\nexport function usePlayingVoiceNote(ids: readonly string[]): string | null {\n const key = ids.join(\"|\");\n return useSyncExternalStore(\n subscribePlayback,\n () => (active && key.split(\"|\").includes(active.id) ? active.id : null),\n () => null,\n );\n}\n\n// ---- Controls by id, for the bubble's accessibility actions -----------------\n\ninterface VoiceNoteControls {\n toggle: () => void;\n cycleRate: () => void;\n}\n\n// Every mounted player per id (one attachment can show in the timeline and in its thread): the newest answers.\nconst controls = new Map<string, VoiceNoteControls[]>();\nconst controlsFor = (id: string) => controls.get(id)?.at(-1);\n\n/** Plays or pauses the voice note with this id; false when none with it is on screen with playback. */\nexport function toggleVoiceNote(id: string): boolean {\n const c = controlsFor(id);\n c?.toggle();\n return Boolean(c);\n}\n\n/** Moves the voice note with this id to its next speed; false when none is on screen with playback. */\nexport function cycleVoiceNoteRate(id: string): boolean {\n const c = controlsFor(id);\n c?.cycleRate();\n return Boolean(c);\n}\n\n/**\n * Pauses the voice note or video playing, if any; with `ids` (or a test of an id), only when it\n * is one of them (a screen's own attachments). For a screen losing focus: a tab switch keeps it mounted, so its\n * player would play on. Returns whether one was paused.\n */\nexport function pauseChatPlayback(ids?: Iterable<string> | ((id: string) => boolean)): boolean {\n if (!active) return false;\n if (typeof ids === \"function\" ? !ids(active.id) : ids && !new Set(ids).has(active.id)) return false;\n const { id, pause } = active;\n try {\n pause();\n } catch {\n // A player already gone has nothing to pause.\n }\n releasePlayback(id);\n return true;\n}\n\n/** The playing voice note's id, for tests. */\nexport function activePlaybackId(): string | null {\n return active?.id ?? null;\n}\n\n/** Where a finger at `x` across a waveform `width` wide puts the playhead, in seconds. */\nexport function scrubSeconds(x: number, width: number, durationSec: number): number {\n if (width <= 0 || durationSec <= 0) return 0;\n return Math.max(0, Math.min(1, x / width)) * durationSec;\n}\n\nconst BAR_WIDTH = 3;\nconst BAR_GAP = 2;\n\n/** How many bars fit across `width` points, one bar plus a gap each; never fewer than one. */\nexport function barsThatFit(width: number): number {\n if (!(width > 0)) return 1;\n return Math.max(1, Math.floor((width + BAR_GAP) / (BAR_WIDTH + BAR_GAP)));\n}\n\n/** Bars 0–1 from stored peaks (0–100), resampled to `count`; flat when there are none. */\nexport function waveformBars(peaks: readonly number[] | null | undefined, count = 32): number[] {\n if (!peaks || peaks.length === 0) return new Array(count).fill(0.08);\n return Array.from({ length: count }, (_, i) => {\n const v = peaks[Math.min(peaks.length - 1, Math.floor((i * peaks.length) / count))] ?? 0;\n return Math.max(0.08, Math.min(1, v / 100));\n });\n}\n\nexport interface VoiceNotePlayerProps {\n /** Stable id (the attachment's), for one-at-a-time. */\n id: string;\n /** A signed URL or a local file URI; null while it is fetched. */\n uri: string | null;\n durationMs: number | null;\n waveform: number[] | null;\n /** On the tint bubble: draw in its foreground. */\n mine?: boolean;\n testID?: string;\n}\n\nexport function VoiceNotePlayer(props: VoiceNotePlayerProps) {\n const { modules } = useChatNative();\n if (!modules.audio) return <StaticVoiceNote {...props} />;\n return <AudioVoiceNote {...props} audio={modules.audio} />;\n}\n\n/** Without expo-audio: the waveform and duration, no playback. */\nfunction StaticVoiceNote({ durationMs, waveform, mine, testID }: VoiceNotePlayerProps) {\n const { copy } = useChatNative();\n const colors = useThemeRoles();\n const duration = formatDuration(durationMs);\n return (\n <View testID={testID} accessible accessibilityLabel={fill(copy.voiceMessage, { duration })} style={{ flexDirection: \"row\", alignItems: \"center\", gap: 8, minHeight: 44 }}>\n <Bars bars={waveformBars(waveform, 24)} progress={0} mine={mine} colors={colors} />\n <NativeText className={mine ? \"text-primary-foreground\" : undefined} style={{ fontSize: 13, fontVariant: [\"tabular-nums\"] }}>\n {duration}\n </NativeText>\n </View>\n );\n}\n\nfunction AudioVoiceNote({ id, uri, durationMs, waveform, mine, testID, audio }: VoiceNotePlayerProps & { audio: ExpoAudioLike }) {\n const { copy } = useChatNative();\n const colors = useThemeRoles();\n const source = useMemo(() => (uri ? { uri } : null), [uri]);\n const player = audio.useAudioPlayer(source, { updateInterval: 100 });\n const status = audio.useAudioPlayerStatus(player);\n const [scrubbing, setScrubbing] = useState<number | null>(null);\n const width = useRef(0);\n // As many bars as the waveform's slot holds, so they never run under the time and speed.\n const [barCount, setBarCount] = useState(0);\n\n // Unmounted (scrolled away, screen closed): it no longer holds the one playback slot.\n useEffect(() => () => releasePlayback(id), [id]);\n useEffect(() => {\n if (status.didJustFinish) releasePlayback(id);\n }, [status.didJustFinish, id]);\n\n const durationSec = status.duration > 0 ? status.duration : (durationMs ?? 0) / 1000;\n const position = scrubbing ?? status.currentTime;\n const progress = durationSec > 0 ? Math.min(1, position / durationSec) : 0;\n const rate = status.playbackRate || 1;\n\n const pause = () => {\n player.pause();\n releasePlayback(id);\n };\n const toggle = () => {\n if (status.playing) return pause();\n claimPlayback(id, () => player.pause());\n if (status.didJustFinish || (durationSec > 0 && status.currentTime >= durationSec - 0.05)) void player.seekTo(0);\n player.play();\n };\n const seek = (seconds: number) => void player.seekTo(Math.max(0, Math.min(durationSec, seconds)));\n const cycleRate = () => player.setPlaybackRate(nextPlaybackRate(rate));\n\n // The bubble's VoiceOver actions reach this player by its id.\n const handles = useRef({ toggle, cycleRate });\n handles.current = { toggle, cycleRate };\n useEffect(() => {\n const entry: VoiceNoteControls = { toggle: () => handles.current.toggle(), cycleRate: () => handles.current.cycleRate() };\n controls.set(id, [...(controls.get(id) ?? []), entry]);\n return () => {\n const rest = (controls.get(id) ?? []).filter((e) => e !== entry);\n if (rest.length) controls.set(id, rest);\n else controls.delete(id);\n };\n }, [id]);\n\n const latest = useRef({ durationSec, seek });\n latest.current = { durationSec, seek };\n const responder = useMemo(\n () =>\n PanResponder.create({\n // Only a sideways drag scrubs, so a scroll that starts on a voice note still scrolls.\n onMoveShouldSetPanResponder: (_e, g) => Math.abs(g.dx) > 6 && Math.abs(g.dx) > Math.abs(g.dy) * 1.5,\n onPanResponderTerminationRequest: () => false,\n onPanResponderGrant: (e) => setScrubbing(scrubSeconds(e.nativeEvent.locationX, width.current, latest.current.durationSec)),\n onPanResponderMove: (e) => setScrubbing(scrubSeconds(e.nativeEvent.locationX, width.current, latest.current.durationSec)),\n onPanResponderRelease: (e) => {\n latest.current.seek(scrubSeconds(e.nativeEvent.locationX, width.current, latest.current.durationSec));\n setScrubbing(null);\n },\n onPanResponderTerminate: () => setScrubbing(null),\n }),\n [],\n );\n\n const fg = mine ? \"text-primary-foreground\" : undefined;\n const shown = formatDuration((status.playing || position > 0 ? position : durationSec) * 1000);\n return (\n <View testID={testID} style={{ flexDirection: \"row\", alignItems: \"center\", gap: 6, minWidth: 240 }}>\n <Pressable\n testID={testID ? `${testID}-play` : undefined}\n accessibilityRole=\"button\"\n accessibilityLabel={status.playing ? copy.pause : copy.play}\n onPress={toggle}\n disabled={!uri}\n hitSlop={4}\n style={{ width: 44, height: 44, alignItems: \"center\", justifyContent: \"center\", opacity: uri ? 1 : 0.5 }}\n >\n <NativeIcon name={status.playing ? \"pause\" : \"play\"} size={22} color={mine ? colors.surface : colors.tint} />\n </Pressable>\n <View\n testID={testID ? `${testID}-wave` : undefined}\n accessible\n accessibilityRole=\"adjustable\"\n accessibilityLabel={fill(copy.voiceMessage, { duration: formatDuration(durationSec * 1000) })}\n accessibilityValue={{ text: `${formatDuration(position * 1000)} / ${formatDuration(durationSec * 1000)}` }}\n accessibilityActions={[{ name: \"increment\" }, { name: \"decrement\" }]}\n onAccessibilityAction={(e) => seek(status.currentTime + (e.nativeEvent.actionName === \"increment\" ? 5 : -5))}\n onLayout={(e: LayoutChangeEvent) => {\n width.current = e.nativeEvent.layout.width;\n setBarCount(barsThatFit(e.nativeEvent.layout.width));\n }}\n style={{ flex: 1, minWidth: 0, height: 44, justifyContent: \"center\", overflow: \"hidden\" }}\n {...responder.panHandlers}\n >\n {barCount > 0 ? <Bars bars={waveformBars(waveform, barCount)} progress={progress} mine={mine} colors={colors} /> : null}\n </View>\n <NativeText className={fg} style={{ fontSize: 13, minWidth: 36, fontVariant: [\"tabular-nums\"] }}>\n {shown}\n </NativeText>\n <Pressable\n testID={testID ? `${testID}-rate` : undefined}\n accessibilityRole=\"button\"\n accessibilityLabel={fill(copy.speed, { rate: `${rate}x` })}\n onPress={cycleRate}\n hitSlop={8}\n style={{ minWidth: 44, height: 44, alignItems: \"center\", justifyContent: \"center\" }}\n >\n <NativeText className={fg} style={{ fontSize: 13, fontWeight: \"600\" }}>{`${rate}×`}</NativeText>\n </Pressable>\n </View>\n );\n}\n\nfunction Bars({ bars, progress, mine, colors }: { bars: number[]; progress: number; mine?: boolean; colors: ReturnType<typeof useThemeRoles> }) {\n // On the tint bubble the bars are the surface color, the unplayed part faded.\n const played = mine ? colors.surface : colors.tint;\n const rest = mine ? colors.surface : colors.tertiaryLabel;\n return (\n <View pointerEvents=\"none\" style={{ flexDirection: \"row\", alignItems: \"center\", gap: BAR_GAP, height: 28, overflow: \"hidden\" }}>\n {bars.map((h, i) => (\n <View\n key={i}\n style={{\n width: BAR_WIDTH,\n borderRadius: BAR_WIDTH / 2,\n height: Math.max(3, Math.round(h * 28)),\n backgroundColor: (i + 0.5) / bars.length <= progress ? played : rest,\n opacity: mine && (i + 0.5) / bars.length > progress ? 0.45 : 1,\n }}\n />\n ))}\n </View>\n );\n}\n","/**\n * @feat:chat\n * A video in a bubble, on expo-video (`modules.video`): its poster (Mux's thumbnail, the\n * attachment's poster, or a plain frame) with the duration and a play button; tap to play,\n * then pause, mute, 1x / 1.5x / 2x and full screen. A Mux video streams as HLS from its\n * playback id; a stored one plays from its signed link (or, while it uploads, from the\n * phone). Until Mux has processed it, it says so. One plays at a time, voice notes included:\n * it takes the same playback slot (`claimPlayback`), so starting it pauses a voice note and\n * the other way round. The bubble's VoiceOver actions reach it by id (`toggleVideo`). It pauses\n * when the app goes to the background and when it unmounts; the thread pauses it when the\n * screen loses focus (`ChatThreadScreen focused`), since a tab switch keeps the screen mounted.\n */\nimport { useEffect, useMemo, useRef, useState, useSyncExternalStore } from \"react\";\nimport { ActivityIndicator, AppState, Pressable, View, useWindowDimensions } from \"react-native\";\nimport { NativeIcon, NativeImage, NativeText } from \"@marktiderman/genesis-ui-native/components\";\nimport { useThemeRoles } from \"@marktiderman/genesis-ui-native/hooks\";\nimport { formatDuration, nextPlaybackRate } from \"../core/media\";\nimport { fill } from \"./copy\";\nimport { useChatNative } from \"./context\";\nimport { MEDIA_FRAME, MEDIA_SCRIM, MEDIA_SCRIM_LIGHT, ON_MEDIA } from \"./media-colors\";\nimport type { ExpoVideoLike, VideoPlayerLike, VideoViewHandleLike } from \"./modules\";\nimport { claimPlayback, releasePlayback } from \"./voice-player\";\n\nexport const muxStreamUrl = (playbackId: string) => `https://stream.mux.com/${encodeURIComponent(playbackId)}.m3u8`;\nexport const muxPosterUrl = (playbackId: string, width = 480) => `https://image.mux.com/${encodeURIComponent(playbackId)}/thumbnail.jpg?width=${width}`;\n\nexport interface ChatVideoPlayerProps {\n /** Stable id (the attachment's), for one-at-a-time and the bubble's actions. */\n id: string;\n /** A stored video's signed link, or the file on the phone while it uploads. */\n uri: string | null;\n /** Mux's playback id: streamed as HLS. */\n playbackId?: string | null;\n /** The attachment's poster (a signed link). */\n posterUri?: string | null;\n provider?: string | null;\n status?: \"pending\" | \"ready\" | \"failed\" | null;\n durationMs: number | null;\n width?: number | null;\n height?: number | null;\n /** Still uploading from this phone. */\n uploading?: boolean;\n testID?: string;\n}\n\nexport type ChatVideoState = \"failed\" | \"processing\" | \"loading\" | \"playable\";\n\n/** What the player can show: a hosted video waits for its provider, a stored one for its link. */\nexport function videoState(p: Pick<ChatVideoPlayerProps, \"uri\" | \"playbackId\" | \"provider\" | \"status\">): ChatVideoState {\n if (p.status === \"failed\") return \"failed\";\n if (p.playbackId) return \"playable\";\n if (p.provider && p.provider !== \"storage\" && p.provider !== \"external\") return p.uri ? \"playable\" : \"processing\";\n return p.uri ? \"playable\" : \"loading\";\n}\n\n/** What expo-video loads: HLS for a playback id, else the file. */\nexport function videoSource(p: Pick<ChatVideoPlayerProps, \"uri\" | \"playbackId\">): { uri: string; contentType: \"hls\" | \"auto\" } | null {\n if (p.playbackId) return { uri: muxStreamUrl(p.playbackId), contentType: \"hls\" };\n return p.uri ? { uri: p.uri, contentType: \"auto\" } : null;\n}\n\n// ---- Controls by id, for the bubble's accessibility actions -----------------\n\ninterface VideoControls {\n toggle: () => void;\n fullScreen: () => void;\n mute: () => void;\n rate: () => void;\n}\nconst controls = new Map<string, VideoControls[]>();\nconst playingIds = new Set<string>();\nconst playingListeners = new Set<() => void>();\nconst setPlayingId = (id: string, on: boolean) => {\n if (playingIds.has(id) === on) return;\n if (on) playingIds.add(id);\n else playingIds.delete(id);\n playingListeners.forEach((l) => l());\n};\nconst subscribePlaying = (l: () => void) => {\n playingListeners.add(l);\n return () => void playingListeners.delete(l);\n};\n\n/** Which of these videos is playing, or null (re-renders only when that answer changes). */\nexport function usePlayingVideo(ids: readonly string[]): string | null {\n const key = ids.join(\"|\");\n return useSyncExternalStore(\n subscribePlaying,\n () => key.split(\"|\").find((id) => id && playingIds.has(id)) ?? null,\n () => null,\n );\n}\n\n/** Mutes or unmutes the video with this id while it plays. */\nexport function toggleVideoMute(id: string): boolean {\n const c = controls.get(id)?.at(-1);\n c?.mute();\n return Boolean(c);\n}\n\n/** Moves the playing video with this id to its next speed. */\nexport function cycleVideoRate(id: string): boolean {\n const c = controls.get(id)?.at(-1);\n c?.rate();\n return Boolean(c);\n}\n\n/** Plays or pauses the video with this id; false when none with it is on screen. */\nexport function toggleVideo(id: string): boolean {\n const c = controls.get(id)?.at(-1);\n c?.toggle();\n return Boolean(c);\n}\n\n/** Opens the video with this id full screen (starting it); false when none is on screen. */\nexport function fullScreenVideo(id: string): boolean {\n const c = controls.get(id)?.at(-1);\n c?.fullScreen();\n return Boolean(c);\n}\n\n/** Whether the video with this id is playing. */\nexport function isVideoPlaying(id: string): boolean {\n return playingIds.has(id);\n}\n\nfunction useRegister(id: string, handles: React.MutableRefObject<VideoControls>) {\n useEffect(() => {\n const entry: VideoControls = {\n toggle: () => handles.current.toggle(),\n fullScreen: () => handles.current.fullScreen(),\n mute: () => handles.current.mute(),\n rate: () => handles.current.rate(),\n };\n controls.set(id, [...(controls.get(id) ?? []), entry]);\n return () => {\n const rest = (controls.get(id) ?? []).filter((e) => e !== entry);\n if (rest.length) controls.set(id, rest);\n else controls.delete(id);\n };\n }, [id, handles]);\n}\n\n/** The bubble's video. Renders nothing without `modules.video` (the bubble shows a row instead). */\nexport function ChatVideoPlayer(props: ChatVideoPlayerProps) {\n const { modules, copy } = useChatNative();\n const colors = useThemeRoles();\n const { width: screen } = useWindowDimensions();\n const [active, setActive] = useState(false);\n const [fullOnStart, setFullOnStart] = useState(false);\n const testID = props.testID ?? `chat-video-${props.id}`;\n const state = videoState(props);\n const source = useMemo(() => videoSource(props), [props.uri, props.playbackId]); // eslint-disable-line react-hooks/exhaustive-deps\n\n const [broken, setBroken] = useState(false);\n const handles = useRef<VideoControls>({ toggle: () => undefined, fullScreen: () => undefined, mute: () => undefined, rate: () => undefined });\n handles.current = {\n toggle: () => state === \"playable\" && setActive(true),\n fullScreen: () => {\n if (state !== \"playable\") return;\n setFullOnStart(true);\n setActive(true);\n },\n mute: () => undefined,\n rate: () => undefined,\n };\n useRegister(props.id, handles);\n\n if (!modules.video) return null;\n const w = Math.min(240, Math.round(screen * 0.62));\n const ratio = props.width && props.height ? props.width / props.height : 3 / 4;\n const h = Math.round(Math.max(140, Math.min(w * 1.5, w / ratio)));\n const duration = props.durationMs ? formatDuration(props.durationMs) : null;\n const box = { width: w, height: h, borderRadius: 14, overflow: \"hidden\" as const, backgroundColor: MEDIA_FRAME };\n\n if (state === \"failed\" || state === \"processing\" || broken) {\n const text = broken ? copy.videoCantPlay : state === \"failed\" ? copy.videoFailed : copy.videoProcessing;\n return (\n <View\n testID={`${testID}-${broken ? \"broken\" : state}`}\n accessible\n accessibilityLabel={text}\n accessibilityLiveRegion=\"polite\"\n style={[box, { alignItems: \"center\", justifyContent: \"center\", gap: 8, padding: 12, backgroundColor: colors.fill }]}\n >\n {state === \"processing\" && !broken ? <ActivityIndicator color={colors.secondaryLabel as string} /> : <NativeIcon name=\"video\" size={24} color={colors.secondaryLabel} />}\n <NativeText preset=\"caption\" style={{ color: colors.secondaryLabel, textAlign: \"center\" }}>\n {text}\n </NativeText>\n </View>\n );\n }\n\n if (active && source) {\n return (\n <ActiveVideo\n {...props}\n video={modules.video}\n source={source}\n style={box}\n fullOnStart={fullOnStart}\n onFullStarted={() => setFullOnStart(false)}\n onBroken={() => setBroken(true)}\n handles={handles}\n testID={testID}\n />\n );\n }\n\n const poster = props.posterUri ?? (props.playbackId ? muxPosterUrl(props.playbackId) : null);\n return (\n <Pressable\n testID={`${testID}-poster`}\n accessibilityRole=\"button\"\n accessibilityLabel={duration ? fill(copy.videoMessage, { duration }) : copy.video}\n accessibilityHint={copy.playVideo}\n accessibilityState={{ disabled: state !== \"playable\", busy: props.uploading }}\n disabled={state !== \"playable\"}\n onPress={() => setActive(true)}\n style={box}\n >\n {poster ? <NativeImage src={poster} width={w} height={h} contentFit=\"cover\" recyclingKey={props.id} /> : null}\n <View style={{ position: \"absolute\", top: 0, left: 0, right: 0, bottom: 0, alignItems: \"center\", justifyContent: \"center\" }}>\n {state === \"loading\" || props.uploading ? (\n <ActivityIndicator color={ON_MEDIA} />\n ) : (\n <View style={{ width: 52, height: 52, borderRadius: 26, backgroundColor: MEDIA_SCRIM, alignItems: \"center\", justifyContent: \"center\" }}>\n <NativeIcon name=\"play\" size={24} color={ON_MEDIA} />\n </View>\n )}\n </View>\n {duration ? (\n <View style={{ position: \"absolute\", left: 8, bottom: 8, paddingHorizontal: 6, paddingVertical: 2, borderRadius: 8, backgroundColor: MEDIA_SCRIM }}>\n <NativeText style={{ color: ON_MEDIA, fontSize: 12, fontVariant: [\"tabular-nums\"] }}>{duration}</NativeText>\n </View>\n ) : null}\n </Pressable>\n );\n}\n\nfunction ActiveVideo({\n id,\n video,\n source,\n style,\n fullOnStart,\n onFullStarted,\n onBroken,\n handles,\n testID,\n}: ChatVideoPlayerProps & {\n onBroken: () => void;\n video: ExpoVideoLike;\n source: { uri: string; contentType: \"hls\" | \"auto\" };\n style: Record<string, unknown>;\n fullOnStart: boolean;\n onFullStarted: () => void;\n handles: React.MutableRefObject<VideoControls>;\n testID: string;\n}) {\n const { copy } = useChatNative();\n const player: VideoPlayerLike = video.useVideoPlayer(source, (p) => {\n p.play();\n });\n const viewRef = useRef<VideoViewHandleLike | null>(null);\n const latestBroken = useRef(onBroken);\n latestBroken.current = onBroken;\n const [playing, setPlaying] = useState(true);\n const [muted, setMuted] = useState(false);\n const [rate, setRate] = useState(1);\n const ended = useRef(false);\n // Full screen on Android is another activity: the app reads as backgrounded while it shows.\n const fullScreenOpen = useRef(false);\n const setUp = useRef(false);\n\n useEffect(() => {\n // The first time, the player was just told to play; set up again (a remount that keeps the\n // player), it says for itself whether it plays.\n const now = setUp.current ? Boolean(player.playing) : true;\n setUp.current = true;\n setPlaying(now);\n setPlayingId(id, now);\n if (now) claimPlayback(id, () => player.pause());\n const subs = [\n player.addListener(\"playingChange\", ((payload: { isPlaying: boolean }) => {\n setPlaying(payload.isPlaying);\n setPlayingId(id, payload.isPlaying);\n if (payload.isPlaying) {\n ended.current = false;\n claimPlayback(id, () => player.pause());\n } else {\n releasePlayback(id);\n }\n }) as (payload: never) => void),\n player.addListener(\"playToEnd\", (() => {\n ended.current = true;\n }) as (payload: never) => void),\n // A stream that won't load (gone, refused, offline) says so instead of staying black.\n player.addListener(\"statusChange\", ((payload: { status: string }) => {\n if (payload.status === \"error\") latestBroken.current();\n }) as (payload: never) => void),\n ];\n // Not on in the background: a video plays only while you can see it (full screen aside).\n const appSub = AppState?.addEventListener?.(\"change\", (next: string) => {\n if (next === \"background\" && !fullScreenOpen.current) {\n try {\n player.pause();\n } catch {\n // A player already released has nothing to pause.\n }\n }\n });\n return () => {\n subs.forEach((s) => s.remove());\n appSub?.remove?.();\n try {\n player.pause();\n } catch {\n // Released with the view: nothing left to pause.\n }\n setPlayingId(id, false);\n releasePlayback(id);\n };\n }, [id, player]);\n\n useEffect(() => {\n if (!fullOnStart) return;\n onFullStarted();\n void viewRef.current?.enterFullscreen().catch(() => undefined);\n }, [fullOnStart, onFullStarted]);\n\n const toggle = () => {\n if (playing) return player.pause();\n if (ended.current) player.currentTime = 0;\n player.play();\n };\n const fullScreen = () => void viewRef.current?.enterFullscreen().catch(() => undefined);\n const toggleMute = () => {\n player.muted = !muted;\n setMuted(!muted);\n };\n const cycleRate = () => {\n const next = nextPlaybackRate(rate);\n player.playbackRate = next;\n setRate(next);\n };\n handles.current = { toggle, fullScreen, mute: toggleMute, rate: cycleRate };\n const { VideoView } = video;\n return (\n <View testID={`${testID}-active`} style={style}>\n <VideoView\n ref={viewRef}\n player={player}\n nativeControls={false}\n contentFit=\"cover\"\n allowsPictureInPicture={false}\n onFullscreenEnter={() => {\n fullScreenOpen.current = true;\n }}\n onFullscreenExit={() => {\n fullScreenOpen.current = false;\n }}\n style={{ width: \"100%\", height: \"100%\" }}\n testID={`${testID}-view`}\n />\n <Pressable\n testID={`${testID}-surface`}\n accessibilityRole=\"button\"\n accessibilityLabel={playing ? copy.pauseVideo : copy.playVideo}\n onPress={toggle}\n style={{ position: \"absolute\", top: 0, left: 0, right: 0, bottom: 44, alignItems: \"center\", justifyContent: \"center\" }}\n >\n {!playing ? (\n <View style={{ width: 52, height: 52, borderRadius: 26, backgroundColor: MEDIA_SCRIM, alignItems: \"center\", justifyContent: \"center\" }}>\n <NativeIcon name=\"play\" size={24} color={ON_MEDIA} />\n </View>\n ) : null}\n </Pressable>\n <View style={{ position: \"absolute\", left: 0, right: 0, bottom: 0, height: 44, flexDirection: \"row\", alignItems: \"center\", justifyContent: \"space-between\", paddingHorizontal: 2, backgroundColor: MEDIA_SCRIM_LIGHT }}>\n <Control testID={`${testID}-play`} label={playing ? copy.pauseVideo : copy.playVideo} onPress={toggle} icon={playing ? \"pause\" : \"play\"} />\n <Control testID={`${testID}-mute`} label={muted ? copy.unmute : copy.mute} onPress={toggleMute} icon={muted ? \"volume-off\" : \"volume\"} />\n <Pressable\n testID={`${testID}-rate`}\n accessibilityRole=\"button\"\n accessibilityLabel={fill(copy.speed, { rate: `${rate}x` })}\n onPress={cycleRate}\n style={{ minWidth: 44, height: 44, alignItems: \"center\", justifyContent: \"center\" }}\n >\n <NativeText style={{ color: ON_MEDIA, fontSize: 13, fontWeight: \"600\", fontVariant: [\"tabular-nums\"] }}>{`${rate}x`}</NativeText>\n </Pressable>\n <Control testID={`${testID}-fullscreen`} label={copy.fullScreen} onPress={fullScreen} icon=\"expand\" />\n </View>\n </View>\n );\n}\n\nfunction Control({ icon, label, onPress, selected, testID }: { icon: \"play\" | \"pause\" | \"volume\" | \"volume-off\" | \"expand\"; label: string; onPress: () => void; selected?: boolean; testID: string }) {\n return (\n <Pressable\n testID={testID}\n accessibilityRole=\"button\"\n accessibilityLabel={label}\n accessibilityState={selected === undefined ? undefined : { selected }}\n onPress={onPress}\n style={{ width: 44, height: 44, alignItems: \"center\", justifyContent: \"center\" }}\n >\n <NativeIcon name={icon} size={20} color={ON_MEDIA} />\n </Pressable>\n );\n}\n","/**\n * @feat:chat\n * Pictures and files in a message: photos as a grid of NativeImage (expo-image\n * when the app gave it) over signed links from `useFileUrls`, a local preview\n * while one still uploads, a tap opening the full-screen viewer (photo-viewer.tsx); voice notes\n * as VoiceNotePlayer; other files as a row with their name.\n */\nimport { Pressable, View, useWindowDimensions } from \"react-native\";\nimport { NativeIcon, NativeImage, NativeText } from \"@marktiderman/genesis-ui-native/components\";\nimport { useThemeRoles } from \"@marktiderman/genesis-ui-native/hooks\";\nimport { formatDuration } from \"../core/media\";\nimport type { AttachmentInput, ChatAttachment } from \"../core/types\";\nimport { useChatNative } from \"./context\";\nimport { ChatVideoPlayer } from \"./video-player\";\nimport { VoiceNotePlayer } from \"./voice-player\";\n\n/** An attachment as the bubble draws it: from the server, or still on the phone. */\nexport interface BubbleAttachment {\n key: string;\n kind: string;\n /** What to show now: a signed URL, or the local preview. */\n uri: string | null;\n name: string | null;\n width: number | null;\n height: number | null;\n durationMs: number | null;\n waveform: number[] | null;\n thumbhash: string | null;\n /** A hosted video: who hosts it, its playback id once processed, and whether it is ready. */\n provider?: string | null;\n playbackId?: string | null;\n status?: \"pending\" | \"ready\" | \"failed\" | null;\n posterUri?: string | null;\n /** Still on its way from this phone. */\n uploading?: boolean;\n}\n\nexport function fromServer(a: ChatAttachment, urls: Record<string, string>): BubbleAttachment {\n return {\n key: a.id,\n kind: a.kind,\n uri: (a.path ? urls[a.path] : null) ?? a.url ?? null,\n name: a.name,\n width: a.width,\n height: a.height,\n durationMs: a.durationMs,\n waveform: a.waveform,\n thumbhash: a.thumbhash,\n provider: a.provider,\n playbackId: a.playbackId,\n status: a.status,\n posterUri: a.posterPath ? (urls[a.posterPath] ?? null) : null,\n };\n}\n\nexport function fromPending(\n clientId: string,\n index: number,\n file: { name: string; contentType: string; meta?: Partial<AttachmentInput> },\n preview: string | undefined,\n): BubbleAttachment {\n const kind = file.meta?.kind ?? (file.contentType.startsWith(\"image/\") ? \"image\" : file.contentType.startsWith(\"audio/\") ? \"voice\" : \"file\");\n return {\n key: `${clientId}:${index}`,\n kind,\n uri: preview ?? null,\n name: file.name,\n width: file.meta?.width ?? null,\n height: file.meta?.height ?? null,\n durationMs: file.meta?.durationMs ?? null,\n waveform: file.meta?.waveform ?? null,\n thumbhash: null,\n provider: file.meta?.provider ?? null,\n uploading: true,\n };\n}\n\n/** An attachment a pending message already carries (a hosted video, uploaded before it was queued). */\nexport function fromPendingInput(clientId: string, index: number, a: AttachmentInput): BubbleAttachment {\n return {\n key: `${clientId}:input:${index}`,\n kind: a.kind,\n uri: a.url ?? null,\n name: a.name ?? null,\n width: a.width ?? null,\n height: a.height ?? null,\n durationMs: a.durationMs ?? null,\n waveform: a.waveform ?? null,\n thumbhash: a.thumbhash ?? null,\n provider: a.provider ?? null,\n status: a.status ?? null,\n };\n}\n\n/** The paths a set of messages needs signed links for. */\nexport function attachmentPaths(attachments: readonly ChatAttachment[]): string[] {\n const out: string[] = [];\n for (const a of attachments) {\n if (a.path && a.provider === \"storage\") out.push(a.path);\n if (a.posterPath) out.push(a.posterPath);\n }\n return out;\n}\n\nexport interface AttachmentsProps {\n attachments: BubbleAttachment[];\n mine: boolean;\n onOpenImage?: (uri: string, alt: string) => void;\n testID: string;\n}\n\nexport function MessageAttachments({ attachments, mine, onOpenImage, testID }: AttachmentsProps) {\n const { copy, modules } = useChatNative();\n const colors = useThemeRoles();\n const { width: screen } = useWindowDimensions();\n const images = attachments.filter((a) => a.kind === \"image\");\n const others = attachments.filter((a) => a.kind !== \"image\");\n const max = Math.min(260, Math.round(screen * 0.66));\n return (\n <View style={{ gap: 6 }}>\n {images.length ? (\n <View style={{ flexDirection: \"row\", flexWrap: \"wrap\", gap: 4, maxWidth: max, justifyContent: mine ? \"flex-end\" : \"flex-start\" }}>\n {images.map((a, i) => {\n const single = images.length === 1;\n const ratio = a.width && a.height ? a.width / a.height : 1;\n const w = single ? max : Math.floor((max - 4) / 2);\n const h = single ? Math.round(Math.max(120, Math.min(max * 1.3, w / ratio))) : w;\n const alt = a.name ? `${copy.photo}, ${a.name}` : copy.photo;\n return (\n <Pressable\n key={a.key}\n testID={`${testID}-image-${i}`}\n accessibilityRole=\"imagebutton\"\n accessibilityLabel={alt}\n accessibilityHint={copy.openImage}\n disabled={!a.uri || !onOpenImage}\n onPress={() => a.uri && onOpenImage?.(a.uri, alt)}\n style={{ borderRadius: 14, overflow: \"hidden\" }}\n >\n {a.uri ? (\n <NativeImage src={a.uri} width={w} height={h} placeholder={a.thumbhash ? { thumbhash: a.thumbhash } : undefined} recyclingKey={a.key} />\n ) : (\n <View style={{ width: w, height: h, backgroundColor: colors.fill }} />\n )}\n </Pressable>\n );\n })}\n </View>\n ) : null}\n {others.map((a, i) =>\n a.kind === \"voice\" ? (\n <VoiceNotePlayer key={a.key} id={a.key} uri={a.uri} durationMs={a.durationMs} waveform={a.waveform} mine={mine} testID={`${testID}-voice-${i}`} />\n ) : a.kind === \"video\" && modules.video ? (\n <ChatVideoPlayer\n key={a.key}\n id={a.key}\n uri={a.uri}\n playbackId={a.playbackId}\n posterUri={a.posterUri}\n provider={a.provider}\n status={a.status}\n durationMs={a.durationMs}\n width={a.width}\n height={a.height}\n uploading={a.uploading}\n testID={`${testID}-video-${i}`}\n />\n ) : (\n <View\n key={a.key}\n testID={`${testID}-file-${i}`}\n accessible\n accessibilityLabel={`${a.kind === \"video\" ? copy.video : copy.file}, ${a.name ?? \"\"}${a.durationMs ? `, ${formatDuration(a.durationMs)}` : \"\"}`}\n style={{ flexDirection: \"row\", alignItems: \"center\", gap: 8, minHeight: 44 }}\n >\n <NativeIcon name={a.kind === \"video\" ? \"play\" : \"file\"} size={20} color={mine ? colors.surface : colors.secondaryLabel} />\n <NativeText numberOfLines={1} className={mine ? \"text-primary-foreground\" : undefined} style={{ flexShrink: 1, fontSize: 15 }}>\n {a.name ?? (a.kind === \"video\" ? copy.video : copy.file)}\n </NativeText>\n </View>\n ),\n )}\n </View>\n );\n}\n\n// ChatMediaViewer (one picture) is in photo-viewer.tsx, over the full-screen ChatPhotoViewer.\n","/**\n * @feat:chat\n * What moderation said about a message, in its bubble. A hidden message reaches only its sender\n * and the conversation's observers: the sender sees it dimmed with \"Hidden by moderation. Only\n * you can see it.\"; an observer sees a \"Hidden by moderation\" marker. A flagged message is seen\n * by everyone; observers see a quiet \"Flagged\" marker. The same rules as the web's bubble.\n */\nimport { View } from \"react-native\";\nimport { NativeIcon, NativeText } from \"@marktiderman/genesis-ui-native/components\";\nimport { useThemeRoles } from \"@marktiderman/genesis-ui-native/hooks\";\nimport type { ChatMessage } from \"../core/types\";\nimport { useChatNative } from \"./context\";\n\nexport type ModerationNote = \"hidden-mine\" | \"hidden\" | \"flagged\";\n\n/** The note a bubble shows, or null. Deleted messages carry none. */\nexport function moderationNote(message: Pick<ChatMessage, \"moderation\" | \"deletedAt\"> | null | undefined, opts: { mine: boolean; observer: boolean }): ModerationNote | null {\n if (!message || message.deletedAt) return null;\n if (message.moderation === \"hidden\") return opts.mine && !opts.observer ? \"hidden-mine\" : \"hidden\";\n if (message.moderation === \"flagged\" && opts.observer) return \"flagged\";\n return null;\n}\n\n/** The note's words (for the bubble's accessibility label too). */\nexport function moderationText(note: ModerationNote, copy: { moderationHidden: string; moderationHiddenMine: string; moderationFlagged: string }): string {\n return note === \"hidden-mine\" ? copy.moderationHiddenMine : note === \"hidden\" ? copy.moderationHidden : copy.moderationFlagged;\n}\n\nexport function ModerationMarker({ note, mine, testID }: { note: ModerationNote; mine: boolean; testID?: string }) {\n const { copy } = useChatNative();\n const colors = useThemeRoles();\n const color = note === \"flagged\" ? colors.secondaryLabel : colors.destructive;\n // On your own bubble (the tint), in the bubble's own text color, as its body is.\n return (\n <View testID={testID} style={{ flexDirection: \"row\", alignItems: \"center\", gap: 4 }}>\n {mine ? null : <NativeIcon name={note === \"flagged\" ? \"warning\" : \"lock\"} size={12} color={color} />}\n <NativeText preset=\"caption\" className={mine ? \"text-primary-foreground\" : undefined} style={mine ? { fontWeight: \"600\", flexShrink: 1 } : { color, fontWeight: \"600\", flexShrink: 1 }}>\n {moderationText(note, copy)}\n </NativeText>\n </View>\n );\n}\n","/**\n * @feat:chat\n * One message row: mine on the trailing side in the tint, theirs on surface;\n * in a group, the sender's name over the first of a run and their avatar\n * beside the last. A reply shows what it answers; reactions sit under the\n * bubble; a message still sending is faded, and one that failed says so with\n * Retry and Delete. Long press opens the actions; swipe right to reply. Both\n * are also VoiceOver / TalkBack actions, so nothing needs a gesture. The\n * bubble is one accessible element (its parts would otherwise be read one by\n * one), which hides the controls inside it, so it carries theirs as actions\n * too: play or pause a voice note and change its speed, open each photo.\n */\nimport { memo, useMemo, useRef } from \"react\";\nimport { Animated, PanResponder, Pressable, View } from \"react-native\";\nimport { NativeAvatar, NativeText } from \"@marktiderman/genesis-ui-native/components\";\nimport { useThemeRoles } from \"@marktiderman/genesis-ui-native/hooks\";\nimport { previewText, summarizeReactions } from \"../core/thread\";\nimport type { ChatLinkPreview, ChatMessage, PendingFile } from \"../core/types\";\nimport type { ChatAttachmentKind } from \"../react/index\";\nimport { cardAction, cardTitle, ChatAttachmentCard, splitCardAttachments, type OpenAttachment } from \"./attachment-cards\";\nimport { ChatLinkPreviewCard, linkHost, openChatLink } from \"./link-preview\";\nimport { cycleVideoRate, fullScreenVideo, toggleVideo, toggleVideoMute, usePlayingVideo } from \"./video-player\";\nimport { fill } from \"./copy\";\nimport { initials, useChatNative } from \"./context\";\nimport { fromPending, fromPendingInput, fromServer, MessageAttachments, type BubbleAttachment } from \"./media\";\nimport { ModerationMarker, moderationNote, moderationText } from \"./moderation\";\nimport { cycleVoiceNoteRate, toggleVoiceNote, usePlayingVoiceNote } from \"./voice-player\";\nimport type { ThreadRow } from \"./rows\";\n\ntype MessageRow = Extract<ThreadRow, { type: \"message\" }>;\n\nexport interface MessageBubbleProps {\n row: MessageRow;\n me: string;\n /** Signed links by storage path. */\n urls: Record<string, string>;\n /** The message this one replies to, when it is loaded. */\n repliedTo?: ChatMessage | null;\n /** Avatars sit in a column when the conversation is a group. */\n group: boolean;\n reducedMotion: boolean;\n onLongPress?: (message: ChatMessage) => void;\n onReply?: (message: ChatMessage) => void;\n onRetry?: (clientId: string) => void;\n onDiscard?: (clientId: string) => void;\n /** A failed message whose files didn't survive a relaunch: pick them again (`useConversation().reattach`). */\n onReattach?: (clientId: string, files: readonly PendingFile[]) => void;\n onToggleReaction?: (message: ChatMessage, emoji: string, on: boolean) => void;\n onOpenImage?: (uri: string, alt: string) => void;\n /** The swipe crossed the reply line (for a haptic). */\n onSwipeReply?: () => void;\n /** You observe this conversation: moderation's markers show (hidden, flagged). */\n observer?: boolean;\n /** Drawn highlighted for a moment (the message a search result opened). */\n highlighted?: boolean;\n /** The preview of a link in its text (`useLinkPreviews`, `previewToShow`). */\n linkPreview?: ChatLinkPreview | null;\n /** Show link previews' images (off by default; the thread screen passes `ChatProvider linkPreviewImages`). */\n linkPreviewImages?: boolean;\n /** The app's own attachment kinds, drawn as cards (`ChatProvider attachmentKinds`). */\n attachmentKinds?: Record<string, ChatAttachmentKind>;\n /** A card's button, when its kind gives no `onPress` of its own. */\n onOpenAttachment?: OpenAttachment;\n testID: string;\n}\n\nconst SWIPE_REPLY = 56;\nconst SWIPE_MAX = 80;\n\nexport function formatClock(iso: string): string {\n return new Date(iso).toLocaleTimeString(undefined, { hour: \"numeric\", minute: \"2-digit\" });\n}\n\n/** Mentions written `@[Name](user:<id>)` read as `@Name`. */\nexport function displayBody(body: string): string {\n return body.replace(/@\\[([^\\]]+)\\]\\(user:[0-9a-f-]{36}\\)/gi, \"@$1\");\n}\n\nfunction MessageBubbleImpl(props: MessageBubbleProps) {\n const { row, me, urls, repliedTo, group, reducedMotion, testID } = props;\n const { copy, person, modules } = useChatNative();\n const colors = useThemeRoles();\n const { item, mine } = row;\n const message = item.type === \"message\" ? item.message : null;\n const pending = item.type === \"pending\" ? item.pending : null;\n\n const body = message ? (message.deletedAt ? \"\" : message.body) : (pending?.input.body ?? \"\");\n const createdAt = message?.createdAt ?? pending!.createdAt;\n const failed = pending?.status === \"failed\";\n // Its files are gone (bytes not kept between launches): Retry can't send it, picking them again can.\n const lost = failed && (pending?.files ?? []).some((f) => f.lost);\n const sending = pending?.status === \"sending\";\n const sender = person(row.senderId);\n const senderName = mine ? copy.you : (sender?.name ?? \"\");\n\n const kinds = props.attachmentKinds;\n const { cards, rest: plain } = useMemo(\n () => splitCardAttachments(message && !message.deletedAt ? message.attachments : [], kinds),\n [message, kinds],\n );\n const attachments: BubbleAttachment[] = useMemo(() => {\n if (message) return message.deletedAt ? [] : plain.map((a) => fromServer(a, urls));\n // What it already carries (a hosted video) comes first, as the outbox sends it.\n return [\n ...(pending?.input.attachments ?? []).map((a, i) => fromPendingInput(pending!.clientId, i, a)),\n ...(pending?.files ?? []).map((f, i) => fromPending(pending!.clientId, i, f, pending!.previews?.[i])),\n ];\n }, [message, pending, urls, plain]);\n const preview = message && !message.deletedAt && message.moderation !== \"hidden\" ? (props.linkPreview ?? null) : null;\n\n // The controls the accessible bubble hides, as its own actions.\n const voices = attachments.filter((a) => a.kind === \"voice\" && a.uri && modules.audio);\n const photos = attachments.filter((a) => a.kind === \"image\" && a.uri && props.onOpenImage);\n const videos = attachments.filter((a) => a.kind === \"video\" && modules.video && (a.uri || a.playbackId));\n const playingVideo = usePlayingVideo(videos.map((a) => a.key));\n const cardActions = message ? cards.map((a) => cardAction(kinds?.[a.kind], a, message, props.onOpenAttachment, { mine })) : [];\n const playingVoice = usePlayingVoiceNote(voices.map((a) => a.key));\n\n // ---- Swipe to reply ----\n const x = useRef(new Animated.Value(0)).current;\n const latest = useRef(props);\n latest.current = props;\n const crossed = useRef(false);\n const responder = useMemo(\n () =>\n PanResponder.create({\n onMoveShouldSetPanResponder: (_e, g) => g.dx > 12 && Math.abs(g.dx) > Math.abs(g.dy) * 2,\n onPanResponderMove: (_e, g) => {\n const dx = Math.max(0, Math.min(SWIPE_MAX, g.dx));\n x.setValue(dx);\n const over = dx >= SWIPE_REPLY;\n if (over && !crossed.current) latest.current.onSwipeReply?.();\n crossed.current = over;\n },\n onPanResponderRelease: (_e, g) => {\n const m = latest.current.row.item.type === \"message\" ? latest.current.row.item.message : null;\n if (g.dx >= SWIPE_REPLY && m) latest.current.onReply?.(m);\n crossed.current = false;\n if (latest.current.reducedMotion) x.setValue(0);\n else Animated.spring(x, { toValue: 0, useNativeDriver: true, bounciness: 4 }).start();\n },\n onPanResponderTerminate: () => {\n crossed.current = false;\n x.setValue(0);\n },\n }),\n [x],\n );\n\n if (message?.kind === \"system\") {\n return (\n <View testID={testID} style={{ alignItems: \"center\", paddingVertical: 6, paddingHorizontal: 24 }}>\n <NativeText preset=\"caption\" style={{ color: colors.secondaryLabel, textAlign: \"center\" }}>\n {displayBody(message.body)}\n </NativeText>\n </View>\n );\n }\n\n const canSwipe = Boolean(message && !message.deletedAt && props.onReply);\n const reactions = message ? summarizeReactions(message, me) : [];\n const time = formatClock(createdAt);\n const moderation = moderationNote(message, { mine, observer: Boolean(props.observer) });\n const statusText = failed ? copy.notSent : sending ? copy.sending : null;\n const label = [\n senderName,\n message?.deletedAt ? copy.deleted : displayBody(body),\n attachments.map((a) => (a.kind === \"image\" ? copy.photo : a.kind === \"voice\" ? copy.voice : a.kind === \"video\" ? copy.video : copy.file)).join(\", \"),\n cards.map((a) => cardTitle(kinds?.[a.kind], a, { mine })).join(\", \"),\n preview ? fill(copy.linkPreview, { title: preview.title?.trim() || linkHost(preview.url), site: preview.siteName?.trim() || linkHost(preview.url) }) : null,\n time,\n message?.editedAt ? copy.edited : null,\n statusText,\n moderation ? moderationText(moderation, copy) : null,\n reactions.length ? fill(copy.reactions, { count: reactions.reduce((n, r) => n + r.count, 0) }) : null,\n ]\n .filter(Boolean)\n .join(\", \");\n\n const actions = [\n ...voices.flatMap((a, i) => [\n { name: `voice-${i}`, label: playingVoice === a.key ? copy.pauseVoice : copy.playVoice },\n { name: `voice-rate-${i}`, label: copy.changeSpeed },\n ]),\n ...photos.map((_, i) => ({ name: `photo-${i}`, label: photos.length > 1 ? fill(copy.openPhotoN, { n: i + 1 }) : copy.openImage })),\n ...videos.flatMap((a, i) => [\n { name: `video-${i}`, label: playingVideo === a.key ? copy.pauseVideo : copy.playVideo },\n // Mute and speed reach the player that is playing.\n ...(playingVideo === a.key ? [{ name: `video-mute-${i}`, label: copy.mute }, { name: `video-rate-${i}`, label: copy.changeSpeed }] : []),\n { name: `video-full-${i}`, label: copy.fullScreen },\n ]),\n ...cardActions.flatMap((c, i) => (c ? [{ name: `card-${i}`, label: c.label }] : [])),\n ...(preview ? [{ name: \"open-link\", label: copy.openLinkAction }] : []),\n ...(message && props.onReply && !message.deletedAt ? [{ name: \"reply\", label: copy.reply }] : []),\n ...(message && props.onLongPress && !message.deletedAt ? [{ name: \"actions\", label: copy.messageActions }] : []),\n ...(failed && !lost && props.onRetry ? [{ name: \"retry\", label: copy.retry }] : []),\n ...(lost && props.onReattach ? [{ name: \"reattach\", label: copy.attachAgain }] : []),\n ...(failed && props.onDiscard ? [{ name: \"discard\", label: copy.discard }] : []),\n ];\n const onAction = (name: string) => {\n const media = /^(voice-rate|voice|photo|video-full|video-mute|video-rate|video|card)-(\\d+)$/.exec(name);\n if (media) {\n const i = Number(media[2]);\n if (media[1] === \"card\") cardActions[i]?.run();\n else if (media[1] === \"video-mute\" && videos[i]) toggleVideoMute(videos[i].key);\n else if (media[1] === \"video-rate\" && videos[i]) cycleVideoRate(videos[i].key);\n else if (media[1] === \"video\" && videos[i]) toggleVideo(videos[i].key);\n else if (media[1] === \"video-full\" && videos[i]) fullScreenVideo(videos[i].key);\n else if (media[1] === \"voice\" && voices[i]) toggleVoiceNote(voices[i].key);\n else if (media[1] === \"voice-rate\" && voices[i]) cycleVoiceNoteRate(voices[i].key);\n else if (media[1] === \"photo\" && photos[i]?.uri) props.onOpenImage?.(photos[i].uri, photos[i].name ? `${copy.photo}, ${photos[i].name}` : copy.photo);\n return;\n }\n if (name === \"open-link\" && preview) void openChatLink(preview.url, modules.webBrowser);\n else if (name === \"reply\" && message) props.onReply?.(message);\n else if (name === \"actions\" && message) props.onLongPress?.(message);\n else if (name === \"retry\" && pending) props.onRetry?.(pending.clientId);\n else if (name === \"reattach\" && pending) props.onReattach?.(pending.clientId, pending.files ?? []);\n else if (name === \"discard\" && pending) props.onDiscard?.(pending.clientId);\n };\n\n const quote = message?.replyToId ?? pending?.input.replyToId ?? null;\n const quoted = quote && repliedTo ? repliedTo : null;\n const bubbleColor = mine ? colors.tint : colors.surface;\n const fg = mine ? \"text-primary-foreground\" : undefined;\n const textStyle = mine ? { fontSize: 17, lineHeight: 22 } : { fontSize: 17, lineHeight: 22, color: colors.label };\n\n return (\n <View testID={testID} style={{ paddingHorizontal: 8, paddingTop: row.groupStart ? 8 : 2, backgroundColor: props.highlighted ? colors.fill : undefined }}>\n {row.showName && sender?.name ? (\n <NativeText preset=\"caption\" style={{ marginLeft: group ? 48 : 12, marginBottom: 2, color: colors.secondaryLabel }}>\n {sender.name}\n </NativeText>\n ) : null}\n <View style={{ flexDirection: \"row\", alignItems: \"flex-end\", justifyContent: mine ? \"flex-end\" : \"flex-start\" }}>\n {group && !mine ? (\n <View style={{ width: 40, alignItems: \"flex-start\" }}>\n {row.showAvatar ? <NativeAvatar size={32} src={sender?.avatarUrl ?? null} fallback={initials(sender?.name)} alt={sender?.name} recyclingKey={row.senderId ?? undefined} /> : null}\n </View>\n ) : null}\n <Animated.View\n style={{ maxWidth: \"80%\", transform: [{ translateX: x }] }}\n {...(canSwipe ? responder.panHandlers : {})}\n >\n <Pressable\n testID={`${testID}-bubble`}\n accessible\n accessibilityLabel={label}\n accessibilityHint={failed ? copy.retry : undefined}\n accessibilityActions={actions}\n onAccessibilityAction={(e) => onAction(e.nativeEvent.actionName)}\n onLongPress={message && !message.deletedAt ? () => props.onLongPress?.(message) : undefined}\n delayLongPress={350}\n style={{\n paddingHorizontal: attachments.length && !body ? 4 : 12,\n paddingVertical: attachments.length && !body ? 4 : 8,\n borderRadius: 18,\n backgroundColor: bubbleColor,\n opacity: sending ? 0.6 : moderation === \"hidden-mine\" ? 0.7 : 1,\n gap: 4,\n }}\n >\n {quote ? (\n <View\n testID={`${testID}-quote`}\n style={{ borderLeftWidth: 3, borderLeftColor: mine ? colors.surface : colors.tint, paddingLeft: 8, paddingVertical: 2, opacity: 0.85 }}\n >\n <NativeText preset=\"caption\" className={fg} style={mine ? { fontWeight: \"600\" } : { fontWeight: \"600\", color: colors.secondaryLabel }}>\n {quoted ? (quoted.senderId === me ? copy.you : (person(quoted.senderId)?.name ?? \"\")) : \"\"}\n </NativeText>\n <NativeText preset=\"caption\" numberOfLines={2} className={fg} style={mine ? undefined : { color: colors.secondaryLabel }}>\n {quoted ? previewText(quoted.body, quoted.attachments[0]?.kind, Boolean(quoted.deletedAt)) : \"…\"}\n </NativeText>\n </View>\n ) : null}\n {attachments.length ? <MessageAttachments attachments={attachments} mine={mine} onOpenImage={props.onOpenImage} testID={testID} /> : null}\n {message && cards.length\n ? cards.map((a, i) => (\n <ChatAttachmentCard key={a.id} attachment={a} message={message} kind={kinds![a.kind]!} mine={mine} onOpenAttachment={props.onOpenAttachment} testID={`${testID}-card-${i}`} />\n ))\n : null}\n {message?.deletedAt ? (\n <NativeText className={fg} style={[textStyle, { fontStyle: \"italic\", opacity: 0.7 }]}>\n {copy.deleted}\n </NativeText>\n ) : body ? (\n <NativeText className={fg} style={[textStyle, attachments.length ? { paddingHorizontal: 8, paddingBottom: 4 } : null]}>\n {displayBody(body)}\n </NativeText>\n ) : null}\n {moderation ? <ModerationMarker note={moderation} mine={mine} testID={`${testID}-moderation`} /> : null}\n {preview ? <ChatLinkPreviewCard preview={preview} mine={mine} images={props.linkPreviewImages} testID={`${testID}-preview`} /> : null}\n </Pressable>\n </Animated.View>\n </View>\n {reactions.length ? (\n <View style={{ flexDirection: \"row\", flexWrap: \"wrap\", gap: 4, marginTop: 2, justifyContent: mine ? \"flex-end\" : \"flex-start\", marginLeft: group && !mine ? 40 : 0 }}>\n {reactions.map((r) => (\n <Pressable\n key={r.emoji}\n testID={`${testID}-reaction-${r.emoji}`}\n accessibilityRole=\"button\"\n accessibilityState={{ selected: r.mine }}\n accessibilityLabel={`${r.emoji} ${r.count}`}\n disabled={!message || !props.onToggleReaction}\n onPress={() => message && props.onToggleReaction?.(message, r.emoji, !r.mine)}\n hitSlop={6}\n style={{\n flexDirection: \"row\",\n alignItems: \"center\",\n gap: 4,\n minHeight: 32,\n paddingHorizontal: 10,\n borderRadius: 16,\n backgroundColor: r.mine ? colors.fill : colors.surface,\n borderWidth: r.mine ? 1 : 0,\n borderColor: colors.tint,\n }}\n >\n <NativeText style={{ fontSize: 15 }}>{r.emoji}</NativeText>\n <NativeText preset=\"caption\" style={{ color: colors.secondaryLabel }}>\n {String(r.count)}\n </NativeText>\n </Pressable>\n ))}\n </View>\n ) : null}\n {row.groupEnd || failed ? (\n <View style={{ flexDirection: \"row\", justifyContent: mine ? \"flex-end\" : \"flex-start\", alignItems: \"center\", gap: 4, marginTop: 2, marginLeft: group && !mine ? 52 : 12, marginRight: 12 }}>\n {failed ? (\n <>\n <NativeText testID={`${testID}-failed`} preset=\"caption\" style={{ color: colors.destructive }}>\n {pending?.error ?? copy.notSent}\n </NativeText>\n {lost ? (\n props.onReattach ? (\n <SmallAction testID={`${testID}-reattach`} label={copy.attachAgain} onPress={() => props.onReattach?.(pending!.clientId, pending!.files ?? [])} color={colors.tint} />\n ) : null\n ) : (\n <SmallAction testID={`${testID}-retry`} label={copy.retry} onPress={() => props.onRetry?.(pending!.clientId)} color={colors.tint} />\n )}\n <SmallAction testID={`${testID}-discard`} label={copy.discard} onPress={() => props.onDiscard?.(pending!.clientId)} color={colors.destructive} />\n </>\n ) : (\n <NativeText preset=\"caption\" style={{ color: colors.tertiaryLabel }}>\n {[time, message?.editedAt ? copy.edited : null, sending ? copy.sending : null].filter(Boolean).join(\" · \")}\n </NativeText>\n )}\n </View>\n ) : null}\n </View>\n );\n}\n\nfunction SmallAction({ label, onPress, color, testID }: { label: string; onPress: () => void; color: unknown; testID: string }) {\n return (\n <Pressable testID={testID} accessibilityRole=\"button\" accessibilityLabel={label} onPress={onPress} style={{ minHeight: 44, minWidth: 44, paddingHorizontal: 8, alignItems: \"center\", justifyContent: \"center\" }}>\n <NativeText preset=\"label\" style={{ color: color as string }}>\n {label}\n </NativeText>\n </Pressable>\n );\n}\n\n\nexport const MessageBubble = memo(MessageBubbleImpl);\n","/**\n * @feat:chat\n * Your conversations on genesis-ui-native's InboxPage: each with its avatar,\n * unread count, last message and time; pull to refresh; an empty state that\n * offers to start a conversation; Mark read, Pin and Archive on swipe, long\n * press and as accessibility actions. Under the navigator's large title\n * (`getInboxPageStackOptions`).\n */\nimport { useCallback, useMemo, useState } from \"react\";\nimport { NativeAvatar } from \"@marktiderman/genesis-ui-native/components\";\nimport { InboxPage, type InboxItem, type InboxPageProps } from \"@marktiderman/genesis-ui-native/layouts\";\nimport type { ChatInboxItem } from \"../core/types\";\nimport { chatKeys, useChat, useInbox, usePeople, type ChatAttachmentKind } from \"../react/index\";\nimport { attachmentPreview } from \"./attachment-cards\";\nimport { useQueryClient } from \"@tanstack/react-query\";\nimport type { ChatNativeCopy } from \"./copy\";\nimport { initials, useChatNative, type ChatPerson } from \"./context\";\nimport { displayBody } from \"./message-bubble\";\n\nexport interface ChatInboxScreenProps {\n /** Opens a conversation (`router.push(chatPath(id))`). */\n onOpen: (conversationId: string) => void;\n /** Starts one (opens your people picker, or `ChatStartSheet`). Shows the empty state's button. */\n onStart?: () => void;\n /** One kind only. */\n kind?: string;\n /** Only these kinds. */\n kinds?: string[];\n /** Every kind but these (`[\"support\"]` keeps support tickets out of a messages inbox). */\n excludeKinds?: string[];\n archived?: boolean;\n /** Passed to InboxPage (a header, a section title, slots). */\n pageProps?: Partial<Omit<InboxPageProps, \"items\">>;\n testID?: string;\n}\n\n/** An inbox row from a conversation. Exported for apps that build their own list. */\nexport function inboxRow(\n item: ChatInboxItem,\n ctx: {\n me: string;\n copy: ChatNativeCopy;\n person: (id: string | null) => ChatPerson | undefined;\n /** The app's attachment kinds: a last message that is a card reads as its title (\"Check-in\"). */\n kinds?: Record<string, ChatAttachmentKind>;\n },\n): Omit<InboxItem, \"onPress\" | \"swipeActions\"> {\n const other = item.otherUserId ? ctx.person(item.otherUserId) : undefined;\n const title = item.title ?? other?.name ?? ctx.copy.untitled;\n const last = item.lastMessage;\n const text = last ? attachmentPreview(displayBody(last.body), last.attachment, ctx.kinds, last.deleted) : \"\";\n const preview = last && text && last.senderId === ctx.me && last.kind !== \"system\" ? `${ctx.copy.youPrefix}${text}` : text;\n return {\n id: item.conversationId,\n title,\n preview: preview || undefined,\n timestamp: item.lastMessageAt ?? undefined,\n unread: item.unread > 0,\n unreadCount: item.unread,\n meta: item.mentioned ? ctx.copy.mentionedYou : undefined,\n avatar: <NativeAvatar size={40} src={other?.avatarUrl ?? null} fallback={initials(title)} alt={title} recyclingKey={item.conversationId} />,\n };\n}\n\nexport function ChatInboxScreen({ onOpen, onStart, kind, kinds, excludeKinds, archived, pageProps, testID = \"chat-inbox\" }: ChatInboxScreenProps) {\n const { client, userId, attachmentKinds } = useChat();\n const queryClient = useQueryClient();\n const { copy, person: known } = useChatNative();\n const inbox = useInbox({ kind, kinds, excludeKinds, archived });\n // The other person in each direct conversation, fetched in one batch (ChatProvider loadPeople).\n const others = useMemo(() => inbox.items.map((i) => i.otherUserId), [inbox.items]);\n const people = usePeople(others);\n const person = useCallback((id: string | null | undefined) => known(id) ?? (id ? people[id] : undefined), [known, people]);\n const [refreshing, setRefreshing] = useState(false);\n\n const refresh = useCallback(async () => {\n setRefreshing(true);\n try {\n await inbox.refetch();\n } finally {\n setRefreshing(false);\n }\n }, [inbox]);\n\n const settle = useCallback(() => {\n void queryClient.invalidateQueries({ queryKey: [\"genesis-chat\", \"inbox\"] });\n void queryClient.invalidateQueries({ queryKey: chatKeys.unread() });\n }, [queryClient]);\n\n const items: InboxItem[] = inbox.items.map((item) => ({\n ...inboxRow(item, { me: userId, copy, person, kinds: attachmentKinds }),\n onPress: () => onOpen(item.conversationId),\n swipeActions: [\n ...(item.unread > 0 ? [{ id: \"read\", label: copy.markRead, onPress: () => void client.markRead(item.conversationId).then(settle, settle) }] : []),\n {\n id: \"pin\",\n label: item.pinned ? copy.unpin : copy.pin,\n onPress: () => void client.setMySettings(item.conversationId, { pinned: !item.pinned }).then(settle, settle),\n },\n ...(item.archived\n ? []\n : [{ id: \"archive\", label: copy.archive, onPress: () => void client.setMySettings(item.conversationId, { archived: true }).then(settle, settle) }]),\n ],\n }));\n\n return (\n <InboxPage\n testID={testID}\n items={items}\n loading={inbox.isLoading}\n error={Boolean(inbox.error)}\n errorTitle={copy.inboxErrorTitle}\n refreshing={refreshing}\n onRefresh={refresh}\n emptyTitle={copy.inboxEmptyTitle}\n emptyBody={copy.inboxEmptyBody}\n emptyActionLabel={onStart ? copy.startConversation : undefined}\n onEmptyAction={onStart}\n {...pageProps}\n />\n );\n}\n","/**\n * @feat:chat\n * The native modules chat can use, as the shapes it needs. The app passes the\n * real ones (each an optional peer); chat never imports them, so it builds and\n * runs without any of them, and the tests pass fakes:\n *\n * import * as Audio from \"expo-audio\"; // voice notes\n * import * as ImagePicker from \"expo-image-picker\"; // photos and videos\n * import * as Haptics from \"expo-haptics\"; // send and record\n * import * as Clipboard from \"expo-clipboard\"; // copy, paste a picture\n * import { KeyboardAvoidingView } from \"react-native-keyboard-controller\";\n * import AsyncStorage from \"@react-native-async-storage/async-storage\"; // drafts\n * import * as Sharing from \"expo-sharing\"; // share a photo\n * import * as MediaLibrary from \"expo-media-library\"; // save a photo\n * import NetInfo from \"@react-native-community/netinfo\"; // retry when back online\n * import * as Camera from \"expo-camera\"; // video messages\n * import * as Video from \"expo-video\"; // video playback\n * import * as WebBrowser from \"expo-web-browser\"; // link previews\n *\n * FlashList and expo-image come from GenesisNativeApp's `modules` (genesis-ui-native's\n * GenesisModulesProvider), the same objects every Genesis list and image uses.\n * The shapes follow the SDK 58 packages' own type declarations.\n */\nimport type { ComponentType, ReactNode } from \"react\";\n\n/** `RecorderState` from expo-audio (`recorder.getStatus()`). */\nexport interface RecorderStateLike {\n isRecording: boolean;\n durationMillis: number;\n /** dB, about -160…0, when `isMeteringEnabled`. */\n metering?: number;\n url: string | null;\n}\n\n/** `AudioRecorder` from expo-audio. */\nexport interface AudioRecorderLike {\n prepareToRecordAsync(options?: Record<string, unknown>): Promise<void>;\n record(): void;\n stop(): Promise<void>;\n getStatus(): RecorderStateLike;\n uri: string | null;\n}\n\n/** `AudioStatus` from expo-audio (`useAudioPlayerStatus`). Seconds. */\nexport interface AudioStatusLike {\n currentTime: number;\n duration: number;\n playing: boolean;\n didJustFinish: boolean;\n isLoaded: boolean;\n playbackRate: number;\n}\n\n/** `AudioPlayer` from expo-audio. */\nexport interface AudioPlayerLike {\n play(): void;\n pause(): void;\n seekTo(seconds: number): Promise<void>;\n setPlaybackRate(rate: number): void;\n}\n\n/** `import * as Audio from \"expo-audio\"` (SDK 58). */\nexport interface ExpoAudioLike {\n useAudioRecorder(options: Record<string, unknown>): AudioRecorderLike;\n useAudioPlayer(source: { uri: string } | null, options?: { updateInterval?: number }): AudioPlayerLike;\n useAudioPlayerStatus(player: AudioPlayerLike): AudioStatusLike;\n RecordingPresets: { HIGH_QUALITY: Record<string, unknown> };\n requestRecordingPermissionsAsync(): Promise<{ granted: boolean; canAskAgain?: boolean }>;\n setAudioModeAsync(mode: { allowsRecording?: boolean; playsInSilentMode?: boolean }): Promise<void>;\n}\n\n/** One picked file (`ImagePickerAsset`). */\nexport interface PickedAssetLike {\n uri: string;\n width?: number;\n height?: number;\n fileName?: string | null;\n fileSize?: number;\n mimeType?: string;\n /** Milliseconds, for a video. */\n duration?: number | null;\n type?: string | null;\n}\n\nexport interface PickerResultLike {\n canceled: boolean;\n assets: PickedAssetLike[] | null;\n}\n\n/** `import * as ImagePicker from \"expo-image-picker\"`. */\nexport interface ImagePickerLike {\n launchImageLibraryAsync(options?: Record<string, unknown>): Promise<PickerResultLike>;\n launchCameraAsync?(options?: Record<string, unknown>): Promise<PickerResultLike>;\n requestCameraPermissionsAsync?(): Promise<{ granted: boolean }>;\n}\n\n/** `import * as Haptics from \"expo-haptics\"`. */\nexport interface HapticsLike {\n impactAsync(style?: never): Promise<void>;\n selectionAsync(): Promise<void>;\n notificationAsync(type?: never): Promise<void>;\n ImpactFeedbackStyle: { Light: unknown; Medium: unknown };\n NotificationFeedbackType: { Success: unknown; Warning: unknown; Error: unknown };\n}\n\n/** `import * as Clipboard from \"expo-clipboard\"`. */\nexport interface ClipboardLike {\n setStringAsync(text: string): Promise<boolean>;\n hasImageAsync?(): Promise<boolean>;\n /** `data` is a data URI (`data:image/png;base64,…`). */\n getImageAsync?(options: { format: \"png\" | \"jpeg\" }): Promise<{ data: string; size: { width: number; height: number } } | null>;\n}\n\n/** react-native-keyboard-controller's `KeyboardAvoidingView` (needs its `KeyboardProvider`, which GenesisNativeApp mounts). */\nexport type KeyboardAvoidingLike = ComponentType<{\n behavior?: \"height\" | \"padding\" | \"position\" | \"translate-with-padding\";\n keyboardVerticalOffset?: number;\n style?: unknown;\n children?: ReactNode;\n testID?: string;\n}>;\n\n/** Where drafts wait: AsyncStorage, or MMKV's async adapter. */\nexport interface DraftStorageLike {\n getItem(key: string): Promise<string | null>;\n setItem(key: string, value: string): Promise<void>;\n removeItem(key: string): Promise<void>;\n /** For `clearDrafts` on sign-out. */\n getAllKeys?(): Promise<readonly string[]>;\n multiRemove?(keys: readonly string[]): Promise<void>;\n}\n\n/** `import * as Sharing from \"expo-sharing\"`: the system share sheet for a file on the phone. */\nexport interface SharingLike {\n isAvailableAsync(): Promise<boolean>;\n shareAsync(url: string, options?: { mimeType?: string; UTI?: string; dialogTitle?: string }): Promise<void>;\n}\n\n/** `import * as MediaLibrary from \"expo-media-library\"`: save to Photos (asks for add-only access). */\nexport interface MediaLibraryLike {\n requestPermissionsAsync(writeOnly?: boolean): Promise<{ granted: boolean }>;\n saveToLibraryAsync(localUri: string): Promise<void>;\n}\n\n/** `NetInfo` from @react-native-community/netinfo: tells chat when the connection comes back. */\nexport interface NetInfoLike {\n addEventListener(listener: (state: { isConnected: boolean | null; isInternetReachable?: boolean | null }) => void): () => void;\n}\n\n/** A permission answer from expo-camera (`PermissionResponse`). */\nexport interface PermissionLike {\n granted: boolean;\n canAskAgain?: boolean;\n}\n\n/** The `ref` of expo-camera's `CameraView`. */\nexport interface CameraViewHandleLike {\n /** Resolves with the file when `stopRecording` is called, the limit is reached or the preview stops. */\n recordAsync(options?: { maxDuration?: number; maxFileSize?: number; codec?: string }): Promise<{ uri: string } | undefined>;\n stopRecording(): void;\n}\n\n/** `import * as Camera from \"expo-camera\"` (SDK 58): `CameraView` and the permission requests on `Camera`. */\nexport interface ExpoCameraLike {\n CameraView: ComponentType<{\n ref?: unknown;\n style?: unknown;\n facing?: \"front\" | \"back\";\n mode?: \"picture\" | \"video\";\n mirror?: boolean;\n mute?: boolean;\n videoQuality?: \"2160p\" | \"1080p\" | \"720p\" | \"480p\" | \"4:3\";\n onCameraReady?: () => void;\n onMountError?: (event: { message: string }) => void;\n testID?: string;\n }>;\n Camera: {\n requestCameraPermissionsAsync(): Promise<PermissionLike>;\n requestMicrophonePermissionsAsync(): Promise<PermissionLike>;\n };\n}\n\n/** `VideoPlayer` from expo-video. */\nexport interface VideoPlayerLike {\n play(): void;\n pause(): void;\n muted: boolean;\n playing: boolean;\n playbackRate: number;\n currentTime: number;\n addListener(event: \"playingChange\" | \"statusChange\" | \"playToEnd\", listener: (payload: never) => void): { remove(): void };\n}\n\n/** `import * as Video from \"expo-video\"` (SDK 58). */\nexport interface ExpoVideoLike {\n useVideoPlayer(source: { uri: string; contentType?: \"auto\" | \"progressive\" | \"hls\" } | null, setup?: (player: VideoPlayerLike) => void): VideoPlayerLike;\n VideoView: ComponentType<{\n ref?: unknown;\n player: VideoPlayerLike;\n style?: unknown;\n contentFit?: \"contain\" | \"cover\" | \"fill\";\n nativeControls?: boolean;\n allowsPictureInPicture?: boolean;\n onFullscreenEnter?: () => void;\n onFullscreenExit?: () => void;\n testID?: string;\n }>;\n}\n\n/** The `ref` of expo-video's `VideoView`. */\nexport interface VideoViewHandleLike {\n enterFullscreen(): Promise<void>;\n}\n\n/** `import * as WebBrowser from \"expo-web-browser\"`: links open in an in-app browser. */\nexport interface WebBrowserLike {\n openBrowserAsync(url: string, options?: Record<string, unknown>): Promise<unknown>;\n}\n\n/** An open file read a chunk at a time (expo-file-system's `new File(uri).open()`), as `createTusUpload` takes. */\nexport interface ChunkFileLike {\n size: number;\n read(offset: number, length: number): Promise<ArrayBuffer | Uint8Array>;\n close?(): void;\n}\n\n/** Each optional: without one its feature is hidden (no mic without audio, no attach without a picker). */\nexport interface ChatNativeModules {\n audio?: ExpoAudioLike;\n imagePicker?: ImagePickerLike;\n haptics?: HapticsLike;\n clipboard?: ClipboardLike;\n keyboardAvoidingView?: KeyboardAvoidingLike;\n drafts?: DraftStorageLike;\n /** Share in the photo viewer (with `downloadFile` for photos not on the phone). */\n sharing?: SharingLike;\n /** Save in the photo viewer (with `downloadFile`). */\n mediaLibrary?: MediaLibraryLike;\n /**\n * Copies a photo from its signed link to the phone and returns the file:// URI, for sharing\n * and saving (expo-file-system: `(await File.downloadFileAsync(url, Paths.cache, { idempotent: true })).uri`).\n */\n downloadFile?: (url: string) => Promise<string>;\n /** Unsent messages are retried when the connection comes back (`ChatAutoRetry`). */\n netInfo?: NetInfoLike;\n /** Video messages recorded in the thread. Without it there is no video button. */\n camera?: ExpoCameraLike;\n /** Video playback (HLS and files) in the bubble. Without it a video shows as a row with its name. */\n video?: ExpoVideoLike;\n /** Where links from previews open; without it, the system browser (`Linking`). */\n webBrowser?: WebBrowserLike;\n /** Reads a recording a chunk at a time for a hosted upload; without it the file is read whole. */\n openFile?: (uri: string) => Promise<ChunkFileLike> | ChunkFileLike;\n}\n\nexport type HapticEvent = \"send\" | \"record-start\" | \"record-lock\" | \"record-cancel\" | \"select\" | \"error\";\n\n/** Plays a haptic when the app gave expo-haptics; never throws. */\nexport function haptic(haptics: HapticsLike | undefined, event: HapticEvent): void {\n if (!haptics) return;\n try {\n const style = (s: unknown) => s as never;\n const p =\n event === \"send\" || event === \"record-lock\"\n ? haptics.impactAsync(style(haptics.ImpactFeedbackStyle.Light))\n : event === \"record-start\"\n ? haptics.impactAsync(style(haptics.ImpactFeedbackStyle.Medium))\n : event === \"select\"\n ? haptics.selectionAsync()\n : haptics.notificationAsync(\n style(event === \"error\" ? haptics.NotificationFeedbackType.Error : haptics.NotificationFeedbackType.Warning),\n );\n void p?.catch?.(() => undefined);\n } catch {\n // A haptic is never worth an error.\n }\n}\n","/**\n * @feat:chat\n * The video recorder's rules, without React or the camera, so they are tested\n * directly. One button does both gestures: a tap starts a recording that a\n * second tap stops (what VoiceOver and TalkBack do too), and a hold records\n * until the finger lifts. Stopping sends; Cancel throws the take away. The\n * camera flips only between takes (expo-camera stops a recording that flips).\n * A take the camera doesn't hand over is only that take: the camera stays\n * ready. A camera that fails to start offers Try again.\n */\n\nexport type VideoRecorderPhase = \"asking\" | \"denied\" | \"starting\" | \"ready\" | \"recording\" | \"stopping\" | \"failed\";\n\nexport interface VideoRecorderState {\n phase: VideoRecorderPhase;\n facing: \"front\" | \"back\";\n /** When recording began (ms, the clock the events carry). */\n startedAt: number;\n elapsedMs: number;\n /** \"hold\": a finger is down and lifting it stops; \"tap\": recording hands-free until the next tap. */\n gesture: \"hold\" | \"tap\" | \"stop-on-release\" | null;\n /** The take is to be thrown away when the camera hands it over. */\n discard: boolean;\n notice: \"too-short\" | \"take-failed\" | null;\n /** Bumped by Try again after the camera failed: the camera view starts over. */\n cameraKey: number;\n}\n\nexport type VideoRecorderEvent =\n | { type: \"permissions\"; granted: boolean }\n | { type: \"camera-ready\" }\n | { type: \"camera-failed\" }\n | { type: \"press\"; at: number }\n | { type: \"release\"; at: number }\n | { type: \"tick\"; at: number }\n | { type: \"recorded\"; at: number; uri: string | null }\n | { type: \"flip\" }\n | { type: \"retry\" }\n | { type: \"cancel\" };\n\nexport type VideoRecorderEffect =\n | { type: \"start\" }\n | { type: \"stop\" }\n | { type: \"send\"; uri: string; durationMs: number }\n | { type: \"close\" }\n | { type: \"haptic\"; event: \"record-start\" | \"send\" | \"record-cancel\" | \"error\" };\n\nexport interface VideoRecorderConfig {\n limitMs: number;\n /** A press held this long is a hold; shorter is a tap. */\n holdMs?: number;\n /** Shorter takes aren't sent. */\n minMs?: number;\n}\n\nexport const VIDEO_HOLD_MS = 350;\nexport const VIDEO_MIN_MS = 1000;\n\nexport const initialVideoRecorder = (facing: \"front\" | \"back\" = \"front\"): VideoRecorderState => ({\n phase: \"asking\",\n facing,\n startedAt: 0,\n elapsedMs: 0,\n gesture: null,\n discard: false,\n notice: null,\n cameraKey: 0,\n});\n\ntype Step = { state: VideoRecorderState; effects: VideoRecorderEffect[] };\n\nexport function videoRecorderStep(state: VideoRecorderState, event: VideoRecorderEvent, config: VideoRecorderConfig): Step {\n const holdMs = config.holdMs ?? VIDEO_HOLD_MS;\n const minMs = config.minMs ?? VIDEO_MIN_MS;\n const same = { state, effects: [] as VideoRecorderEffect[] };\n const stop = (s: VideoRecorderState): Step => ({ state: { ...s, phase: \"stopping\", gesture: null }, effects: [{ type: \"stop\" }] });\n\n switch (event.type) {\n case \"permissions\":\n if (state.phase !== \"asking\") return same;\n return { state: { ...state, phase: event.granted ? \"starting\" : \"denied\" }, effects: [] };\n case \"camera-ready\":\n return state.phase === \"starting\" ? { state: { ...state, phase: \"ready\" }, effects: [] } : same;\n case \"camera-failed\":\n return state.phase === \"starting\" || state.phase === \"ready\" ? { state: { ...state, phase: \"failed\" }, effects: [{ type: \"haptic\", event: \"error\" }] } : same;\n case \"press\":\n if (state.phase === \"ready\") {\n return {\n state: { ...state, phase: \"recording\", startedAt: event.at, elapsedMs: 0, gesture: \"hold\", discard: false, notice: null },\n effects: [{ type: \"start\" }, { type: \"haptic\", event: \"record-start\" }],\n };\n }\n if (state.phase === \"recording\" && state.gesture === \"tap\") return { state: { ...state, gesture: \"stop-on-release\" }, effects: [] };\n return same;\n case \"release\":\n if (state.phase !== \"recording\") return same;\n if (state.gesture === \"hold\") return event.at - state.startedAt >= holdMs ? stop(state) : { state: { ...state, gesture: \"tap\" }, effects: [] };\n if (state.gesture === \"stop-on-release\") return stop(state);\n return same;\n case \"tick\":\n if (state.phase !== \"recording\") return same;\n {\n const elapsedMs = Math.max(0, event.at - state.startedAt);\n // The camera stops at the limit too (maxDuration); this keeps the button in step.\n if (elapsedMs >= config.limitMs) return stop({ ...state, elapsedMs: config.limitMs });\n return { state: { ...state, elapsedMs }, effects: [] };\n }\n case \"recorded\": {\n if (state.phase !== \"recording\" && state.phase !== \"stopping\") return same;\n const durationMs = Math.min(config.limitMs, Math.max(0, event.at - state.startedAt));\n const base: VideoRecorderState = { ...state, phase: \"ready\", gesture: null, elapsedMs: 0, discard: false };\n if (state.discard) return { state: base, effects: [{ type: \"close\" }] };\n // Too short first: a take stopped straight after it started often leaves no file at all.\n if (durationMs < minMs) return { state: { ...base, notice: \"too-short\" }, effects: [{ type: \"haptic\", event: \"record-cancel\" }] };\n // The camera is still there; only this take is lost.\n if (!event.uri) return { state: { ...base, notice: \"take-failed\" }, effects: [{ type: \"haptic\", event: \"error\" }] };\n return { state: base, effects: [{ type: \"send\", uri: event.uri, durationMs }, { type: \"haptic\", event: \"send\" }, { type: \"close\" }] };\n }\n case \"flip\":\n if (state.phase === \"recording\" || state.phase === \"stopping\") return same;\n // The preview restarts on the other camera: wait for it (the screen also gives it a moment).\n return { state: { ...state, facing: state.facing === \"front\" ? \"back\" : \"front\", phase: state.phase === \"ready\" ? \"starting\" : state.phase, notice: null }, effects: [] };\n case \"retry\":\n return state.phase === \"failed\" ? { state: { ...state, phase: \"starting\", cameraKey: state.cameraKey + 1, notice: null }, effects: [] } : same;\n case \"cancel\":\n if (state.phase === \"recording\") {\n return { state: { ...state, phase: \"stopping\", gesture: null, discard: true }, effects: [{ type: \"stop\" }, { type: \"haptic\", event: \"record-cancel\" }] };\n }\n if (state.phase === \"stopping\") return { state: { ...state, discard: true }, effects: [] };\n return { state, effects: [{ type: \"close\" }] };\n }\n}\n\n/** The kind of file a recording is, from its URI: .mov on iOS, .mp4 on Android. */\nexport function recordingType(uri: string): { contentType: string; ext: string } {\n const ext = /\\.([a-z0-9]+)(?:\\?|#|$)/i.exec(uri)?.[1]?.toLowerCase() ?? \"mp4\";\n if (ext === \"mov\") return { contentType: \"video/quicktime\", ext };\n if (ext === \"webm\") return { contentType: \"video/webm\", ext };\n return { contentType: \"video/mp4\", ext: \"mp4\" };\n}\n","/**\n * @feat:chat\n * Async video messages, recorded in the thread: a full-screen camera (expo-camera, passed as\n * `modules.camera`), one button to tap or hold, the time against the role's limit, flip\n * between takes, and close to throw a take away. Stopping sends: the recording is handed to\n * `onRecorded`, which the thread screen sends (`videoUploads`). Asks for the camera and the\n * microphone when it opens; refused, it says how to turn them on.\n */\nimport { useCallback, useEffect, useRef, useState } from \"react\";\nimport { AccessibilityInfo, Linking, Modal, Pressable, View } from \"react-native\";\nimport { useSafeAreaInsets } from \"react-native-safe-area-context\";\nimport { NativeButton, NativeIcon, NativeText } from \"@marktiderman/genesis-ui-native/components\";\nimport { useThemeRoles } from \"@marktiderman/genesis-ui-native/hooks\";\nimport { formatDuration } from \"../core/media\";\nimport { fill } from \"./copy\";\nimport { useChatNative } from \"./context\";\nimport { MEDIA_BACKDROP, MEDIA_SCRIM, ON_MEDIA } from \"./media-colors\";\nimport { haptic, type CameraViewHandleLike, type ExpoCameraLike } from \"./modules\";\nimport type { RecordedVideo } from \"./video-upload\";\nimport { initialVideoRecorder, recordingType, videoRecorderStep, type VideoRecorderEffect, type VideoRecorderEvent, type VideoRecorderState } from \"./video-recorder-state\";\n\nexport interface ChatVideoRecorderProps {\n open: boolean;\n onClose: () => void;\n /** The role's limit (`recordingLimitMs(role)`). */\n limitMs: number;\n /** A take began: the moment to mint the upload, so the bytes can go as soon as it stops. */\n onStart?: () => void;\n /** About every second while recording (to tell the others: `signalRecordingVideo`). */\n onTick?: () => void;\n onRecorded: (video: RecordedVideo) => void;\n /** For tests: the clock. */\n now?: () => number;\n testID?: string;\n}\n\n/** Renders nothing without `modules.camera`. */\nexport function ChatVideoRecorder(props: ChatVideoRecorderProps) {\n const { modules } = useChatNative();\n const camera = modules.camera;\n if (!camera) return null;\n const testID = props.testID ?? \"chat-video-recorder\";\n return (\n <Modal visible={props.open} animationType=\"slide\" presentationStyle=\"fullScreen\" onRequestClose={props.onClose} testID={testID}>\n {props.open ? <RecorderBody {...props} camera={camera} testID={testID} /> : null}\n </Modal>\n );\n}\n\nfunction RecorderBody({ camera, onClose, limitMs, onStart, onTick, onRecorded, now = Date.now, testID }: ChatVideoRecorderProps & { camera: ExpoCameraLike; testID: string }) {\n const { copy, modules } = useChatNative();\n // The app's insets, as padding: a SafeAreaView inside the full-screen Modal measured none on\n // iOS 27, which put Close and the timer under the status bar (the photo viewer does the same).\n const insets = useSafeAreaInsets();\n const colors = useThemeRoles();\n const [state, setState] = useState<VideoRecorderState>(() => initialVideoRecorder());\n const stateRef = useRef(state);\n const cameraRef = useRef<CameraViewHandleLike | null>(null);\n const alive = useRef(true);\n const latest = useRef({ onClose, onStart, onTick, onRecorded, limitMs, now });\n latest.current = { onClose, onStart, onTick, onRecorded, limitMs, now };\n\n const dispatch = useCallback(\n (event: VideoRecorderEvent) => {\n if (!alive.current) return;\n const step = videoRecorderStep(stateRef.current, event, { limitMs: latest.current.limitMs });\n stateRef.current = step.state;\n setState(step.state);\n step.effects.forEach(run);\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [],\n );\n\n function run(effect: VideoRecorderEffect) {\n const l = latest.current;\n switch (effect.type) {\n case \"start\": {\n l.onStart?.();\n const cam = cameraRef.current;\n if (!cam) return dispatch({ type: \"recorded\", at: l.now(), uri: null });\n cam\n .recordAsync({ maxDuration: Math.ceil(l.limitMs / 1000) })\n .then((r) => dispatch({ type: \"recorded\", at: latest.current.now(), uri: r?.uri ?? null }))\n .catch(() => dispatch({ type: \"recorded\", at: latest.current.now(), uri: null }));\n return;\n }\n case \"stop\":\n try {\n cameraRef.current?.stopRecording();\n } catch {\n dispatch({ type: \"recorded\", at: l.now(), uri: null });\n }\n return;\n case \"send\": {\n const { contentType, ext } = recordingType(effect.uri);\n l.onRecorded({ uri: effect.uri, durationMs: effect.durationMs, contentType, name: `video-${Math.round(l.now())}.${ext}` });\n return;\n }\n case \"close\":\n l.onClose();\n return;\n case \"haptic\":\n haptic(modules.haptics, effect.event);\n return;\n }\n }\n\n // Camera and microphone, asked for when the recorder opens.\n useEffect(() => {\n alive.current = true;\n void Promise.all([camera.Camera.requestCameraPermissionsAsync(), camera.Camera.requestMicrophonePermissionsAsync()])\n .then(([cam, mic]) => dispatch({ type: \"permissions\", granted: Boolean(cam?.granted && mic?.granted) }))\n .catch(() => dispatch({ type: \"permissions\", granted: false }));\n return () => {\n // Closed mid-take (Android back, the app's navigation): the take is thrown away.\n if (stateRef.current.phase === \"recording\" || stateRef.current.phase === \"stopping\") {\n try {\n cameraRef.current?.stopRecording();\n } catch {\n // Already stopped.\n }\n }\n alive.current = false;\n };\n }, [camera, dispatch]);\n\n // The timer, and the others told about once a second.\n const recording = state.phase === \"recording\";\n useEffect(() => {\n if (!recording) return;\n let ticks = 0;\n const id = setInterval(() => {\n dispatch({ type: \"tick\", at: latest.current.now() });\n if (ticks++ % 4 === 0) latest.current.onTick?.();\n }, 250);\n return () => clearInterval(id);\n }, [recording, dispatch]);\n\n // The preview says when it's ready (at open, after a flip, after Try again); a camera that never\n // says so gets the button anyway after a moment, and a take that can't record says that.\n const starting = state.phase === \"starting\";\n useEffect(() => {\n if (!starting) return;\n const id = setTimeout(() => dispatch({ type: \"camera-ready\" }), 1500);\n return () => clearTimeout(id);\n }, [starting, state.facing, state.cameraKey, dispatch]);\n\n // Said out loud on iOS too (a live region is Android only).\n const noticeText = state.notice === \"too-short\" ? copy.videoTooShort : state.notice === \"take-failed\" ? copy.videoTakeFailed : null;\n const blockedText = state.phase === \"denied\" ? copy.cameraDenied : state.phase === \"failed\" ? copy.cameraFailed : null;\n useEffect(() => {\n const text = noticeText ?? blockedText;\n if (text) AccessibilityInfo?.announceForAccessibility?.(text);\n }, [noticeText, blockedText]);\n\n const { CameraView } = camera;\n const blocked = state.phase === \"denied\" || state.phase === \"failed\";\n const canRecord = state.phase === \"ready\" || recording;\n const stopping = state.phase === \"stopping\";\n\n return (\n <View testID={`${testID}-body`} style={{ flex: 1, backgroundColor: MEDIA_BACKDROP }}>\n {state.phase !== \"asking\" && state.phase !== \"denied\" ? (\n <CameraView\n key={state.cameraKey}\n ref={cameraRef}\n testID={`${testID}-camera`}\n style={{ position: \"absolute\", top: 0, left: 0, right: 0, bottom: 0 }}\n facing={state.facing}\n mode=\"video\"\n videoQuality=\"720p\"\n onCameraReady={() => dispatch({ type: \"camera-ready\" })}\n onMountError={() => dispatch({ type: \"camera-failed\" })}\n />\n ) : null}\n <View style={{ flex: 1, justifyContent: \"space-between\", paddingTop: insets.top, paddingBottom: insets.bottom, paddingLeft: insets.left, paddingRight: insets.right }}>\n <View style={{ flexDirection: \"row\", alignItems: \"center\", justifyContent: \"space-between\", paddingHorizontal: 8, paddingTop: 4 }}>\n <Pressable\n testID={`${testID}-close`}\n accessibilityRole=\"button\"\n accessibilityLabel={copy.closeRecorder}\n onPress={() => dispatch({ type: \"cancel\" })}\n style={{ width: 44, height: 44, alignItems: \"center\", justifyContent: \"center\" }}\n >\n <NativeIcon name=\"close\" size={24} color={ON_MEDIA} />\n </Pressable>\n {canRecord || stopping ? (\n <View\n testID={`${testID}-time`}\n accessible\n accessibilityLabel={fill(copy.videoElapsed, { elapsed: formatDuration(state.elapsedMs), limit: formatDuration(limitMs) })}\n style={{ flexDirection: \"row\", alignItems: \"center\", gap: 6, paddingHorizontal: 10, paddingVertical: 4, borderRadius: 14, backgroundColor: MEDIA_SCRIM }}\n >\n {recording ? <View style={{ width: 8, height: 8, borderRadius: 4, backgroundColor: colors.destructive }} /> : null}\n <NativeText style={{ color: ON_MEDIA, fontVariant: [\"tabular-nums\"], fontSize: 15 }}>\n {fill(copy.videoElapsed, { elapsed: formatDuration(state.elapsedMs), limit: formatDuration(limitMs) })}\n </NativeText>\n </View>\n ) : null}\n <View style={{ width: 44 }} />\n </View>\n\n {blocked ? (\n <View testID={`${testID}-${state.phase}`} accessibilityLiveRegion=\"polite\" style={{ paddingHorizontal: 32, gap: 16, alignItems: \"center\" }}>\n <NativeIcon name=\"camera\" size={40} color={ON_MEDIA} />\n <NativeText style={{ color: ON_MEDIA, textAlign: \"center\", fontSize: 17 }}>{state.phase === \"denied\" ? copy.cameraDenied : copy.cameraFailed}</NativeText>\n {state.phase === \"denied\" ? (\n <NativeButton testID={`${testID}-settings`} variant=\"secondary\" onPress={() => void Linking?.openSettings?.()}>\n {copy.openSettings}\n </NativeButton>\n ) : (\n <NativeButton testID={`${testID}-retry`} variant=\"secondary\" onPress={() => dispatch({ type: \"retry\" })}>\n {copy.tryAgain}\n </NativeButton>\n )}\n </View>\n ) : null}\n\n <View style={{ paddingBottom: 16, gap: 12, alignItems: \"center\" }}>\n {state.notice ? (\n <NativeText testID={`${testID}-notice`} accessibilityLiveRegion=\"polite\" style={{ color: ON_MEDIA, textAlign: \"center\", paddingHorizontal: 24 }}>\n {noticeText}\n </NativeText>\n ) : null}\n {!blocked ? (\n <View style={{ flexDirection: \"row\", alignItems: \"center\", justifyContent: \"center\", width: \"100%\" }}>\n <View style={{ flex: 1 }} />\n <Pressable\n testID={`${testID}-record`}\n accessibilityRole=\"button\"\n accessibilityLabel={recording ? copy.stopVideo : copy.startVideo}\n accessibilityHint={recording ? undefined : copy.recordVideoHint}\n accessibilityState={{ disabled: !canRecord, busy: stopping }}\n // A screen reader's double tap is a tap: it starts hands-free, and the next one stops.\n accessibilityActions={canRecord ? [{ name: \"activate\" }] : []}\n onAccessibilityAction={(e) => {\n if (e.nativeEvent.actionName !== \"activate\") return;\n const at = latest.current.now();\n dispatch({ type: \"press\", at });\n dispatch({ type: \"release\", at });\n }}\n disabled={!canRecord}\n onPressIn={() => dispatch({ type: \"press\", at: latest.current.now() })}\n onPressOut={() => dispatch({ type: \"release\", at: latest.current.now() })}\n style={{ width: 84, height: 84, borderRadius: 42, borderWidth: 5, borderColor: ON_MEDIA, alignItems: \"center\", justifyContent: \"center\", opacity: canRecord ? 1 : 0.5 }}\n >\n <View style={recording ? { width: 30, height: 30, borderRadius: 6, backgroundColor: colors.destructive } : { width: 64, height: 64, borderRadius: 32, backgroundColor: colors.destructive }} />\n </Pressable>\n <View style={{ flex: 1, alignItems: \"center\" }}>\n <Pressable\n testID={`${testID}-flip`}\n accessibilityRole=\"button\"\n accessibilityLabel={copy.flipCamera}\n accessibilityState={{ disabled: recording || stopping }}\n disabled={recording || stopping}\n onPress={() => dispatch({ type: \"flip\" })}\n style={{ width: 48, height: 48, borderRadius: 24, alignItems: \"center\", justifyContent: \"center\", backgroundColor: MEDIA_SCRIM, opacity: recording || stopping ? 0.4 : 1 }}\n >\n <NativeIcon name=\"camera-flip\" size={24} color={ON_MEDIA} />\n </Pressable>\n </View>\n </View>\n ) : null}\n {!blocked && !recording ? (\n <NativeText preset=\"caption\" style={{ color: ON_MEDIA, opacity: 0.85, textAlign: \"center\", paddingHorizontal: 24 }}>\n {copy.recordVideoHint}\n </NativeText>\n ) : null}\n </View>\n </View>\n </View>\n );\n}\n","/**\n * @feat:chat\n * Sending a recorded video. With `ChatProvider videoUpload` (Mux direct uploads) the\n * recording goes to the URL the server mints, in chunks, resumably: each chunk is a PUT with\n * `Content-Range`, the server answers 308 with how much it has, and after a dropped\n * connection the next attempt asks (`Content-Range: bytes * /total`) and carries on from there.\n * That is the resumable protocol Mux direct uploads speak (Google Cloud Storage's, the one\n * Mux's UpChunk uses); it is not TUS, so `createTusUpload` doesn't apply. Once the bytes are\n * there, the message is sent through the outbox with `{ kind: \"video\", provider, providerId,\n * status: \"pending\" }` (the server minted the passthrough; the client sends no attachment id),\n * and Mux's webhook marks it ready. Without `videoUpload`, the recording goes through the\n * outbox as a file, to storage, like a picked video.\n *\n * The upload is minted when recording starts (`prepare`), so the bytes can go the moment the\n * recording stops: expo-camera hands over the file only then, so it can't stream while it\n * records. Uploads in flight live here, outside any screen, keyed by conversation: leaving the\n * thread doesn't stop one, and coming back shows it.\n */\nimport { useSyncExternalStore } from \"react\";\nimport { ChatError } from \"../core/client\";\nimport type { LocalFile } from \"../core/outbox\";\nimport type { AttachmentInput, SendInput } from \"../core/types\";\nimport type { ChatVideoUpload } from \"../react/index\";\nimport type { ChunkFileLike } from \"./modules\";\n\n/** 8 MiB: a multiple of 256 KiB, as resumable uploads require for every chunk but the last. */\nexport const VIDEO_CHUNK_BYTES = 8 * 1024 * 1024;\n\n/** What an upload reads: a file a chunk at a time, or bytes in memory. */\nexport interface ByteSource {\n size: number;\n read(from: number, to: number): Promise<ArrayBuffer>;\n close(): void;\n}\n\nconst exact = (bytes: ArrayBuffer | Uint8Array): ArrayBuffer =>\n bytes instanceof ArrayBuffer ? bytes : (bytes.buffer.slice(bytes.byteOffset, bytes.byteOffset + bytes.byteLength) as ArrayBuffer);\n\n/** Opens a file URI for upload: in chunks with `openFile` (expo-file-system), else read whole through fetch. */\nexport async function fileSource(uri: string, openFile?: (uri: string) => Promise<ChunkFileLike> | ChunkFileLike, doFetch: typeof fetch = fetch): Promise<ByteSource> {\n if (openFile) {\n const handle = await openFile(uri);\n if (!Number.isFinite(handle.size) || handle.size <= 0) {\n try {\n handle.close?.();\n } catch {\n // Already closed.\n }\n throw new ChatError(\"The recording is empty\", \"22023\", \"upload\");\n }\n return {\n size: handle.size,\n read: async (from, to) => {\n const bytes = exact(await handle.read(from, to - from));\n if (bytes.byteLength !== to - from) throw new ChatError(\"The recording changed while it was sent\", \"22023\", \"upload\");\n return bytes;\n },\n close: () => {\n try {\n handle.close?.();\n } catch {\n // Already closed.\n }\n },\n };\n }\n const buffer = await (await doFetch(uri)).arrayBuffer();\n if (buffer.byteLength === 0) throw new ChatError(\"The recording is empty\", \"22023\", \"upload\");\n return { size: buffer.byteLength, read: async (from, to) => buffer.slice(from, to), close: () => undefined };\n}\n\nexport interface ChunkedPutOptions {\n url: string;\n contentType: string;\n source: ByteSource;\n fetch?: typeof fetch;\n chunkBytes?: number;\n /** Network failures retried per chunk before it fails (the person can Retry). Default 4. */\n retries?: number;\n /** Bytes the server has, after each chunk. */\n onProgress?: (sent: number, total: number) => void;\n /** Stops between requests (Cancel). */\n isCancelled?: () => boolean;\n /** Ask the server where it is before sending anything (a Retry of an upload that got partway). */\n resume?: boolean;\n /** For tests. */\n sleep?: (ms: number) => Promise<void>;\n}\n\nconst DONE = new Set([200, 201, 202, 204]);\nconst transient = (status: number) => status === 0 || status === 408 || status === 429 || status >= 500;\n\n/** The next byte the server wants, from a 308's `Range: bytes=0-N` (none: it has nothing yet). */\nexport function nextOffset(range: string | null | undefined): number {\n const m = /bytes=(\\d+)-(\\d+)/.exec(range ?? \"\");\n return m ? Number(m[2]) + 1 : 0;\n}\n\n/** Uploads `source` to a resumable upload URL, a chunk at a time. Resolves once the server has every byte. */\nexport async function chunkedPut(options: ChunkedPutOptions): Promise<void> {\n const doFetch = options.fetch ?? fetch;\n const chunk = options.chunkBytes ?? VIDEO_CHUNK_BYTES;\n const retries = options.retries ?? 4;\n const sleep = options.sleep ?? ((ms: number) => new Promise<void>((r) => setTimeout(r, ms)));\n const total = options.source.size;\n if (chunk % (256 * 1024) !== 0 && chunk < total) throw new ChatError(\"Chunks must be a multiple of 256 KiB\", \"22023\", \"upload\");\n const cancelled = () => {\n if (options.isCancelled?.()) throw new ChatError(\"Cancelled\", \"57014\", \"upload\");\n };\n\n /** Where the server is: a status query (an empty PUT). null when it has everything. */\n const ask = async (): Promise<number | null> => {\n const res = await doFetch(options.url, { method: \"PUT\", headers: { \"content-range\": `bytes */${total}` } });\n if (DONE.has(res.status)) return null;\n if (res.status === 308) return nextOffset(res.headers.get(\"range\"));\n return refuse(res);\n };\n\n let offset = 0;\n if (options.resume) {\n cancelled();\n const at = await withRetry(ask);\n if (at === null) return void options.onProgress?.(total, total);\n offset = at;\n }\n options.onProgress?.(offset, total);\n // Failures since the server last moved forward: a 308 that keeps nothing new counts too, so a\n // server that never advances ends in an error, not a loop.\n let stalls = 0;\n const stall = async (message: string) => {\n stalls++;\n if (stalls > retries) throw new ChatError(message, undefined, \"upload\");\n await sleep(Math.min(8000, 500 * 2 ** (stalls - 1)));\n cancelled();\n };\n while (offset < total) {\n cancelled();\n const from = offset;\n const to = Math.min(total, from + chunk);\n const body = await options.source.read(from, to);\n let res: Response | null = null;\n try {\n res = await doFetch(options.url, {\n method: \"PUT\",\n headers: { \"content-type\": options.contentType, \"content-range\": `bytes ${from}-${to - 1}/${total}` },\n body,\n });\n } catch {\n res = null;\n }\n if (res && DONE.has(res.status)) {\n // \"Complete\" before the last byte: the server took a part as the whole (a plain PUT URL).\n if (to < total) throw new ChatError(\"The upload server kept only part of the video\", \"22023\", \"upload\");\n offset = total;\n } else if (res?.status === 308) {\n const next = nextOffset(res.headers.get(\"range\"));\n if (next > from) {\n offset = next;\n stalls = 0;\n } else {\n await stall(\"The video upload is out of step\");\n }\n } else if (res && !transient(res.status)) {\n return refuse(res);\n } else {\n // A dropped connection or a server hiccup: wait, ask where it is, and go on from there.\n await stall(\"Not sent. Check your connection.\");\n try {\n const at = await ask();\n if (at === null) offset = total;\n else if (at > from) {\n offset = at;\n stalls = 0;\n }\n } catch (e) {\n if (e instanceof ChatError && !e.transient) throw e;\n }\n }\n options.onProgress?.(offset, total);\n }\n\n async function withRetry<T>(run: () => Promise<T>): Promise<T> {\n let last: unknown;\n for (let attempt = 0; attempt <= retries; attempt++) {\n try {\n return await run();\n } catch (e) {\n last = e;\n if (e instanceof ChatError && !e.transient) throw e;\n if (attempt < retries) await sleep(Math.min(8000, 500 * 2 ** attempt));\n cancelled();\n }\n }\n throw last instanceof ChatError ? last : new ChatError(\"Not sent. Check your connection.\", undefined, \"upload\");\n }\n}\n\nasync function refuse(res: Response): Promise<never> {\n const text = await res.text().catch(() => \"\");\n // 404 / 410: the upload URL expired or was used up; a new one is minted on Retry.\n const code = res.status === 404 || res.status === 410 ? \"P0002\" : res.status === 401 || res.status === 403 ? \"42501\" : transient(res.status) ? undefined : \"22023\";\n throw new ChatError(text.slice(0, 200) || `The video didn't upload (${res.status})`, code, \"upload\");\n}\n\n// ── Uploads in flight ─────────────────────────────────────────────────────────\n\n/** A recording as the recorder hands it over. */\nexport interface RecordedVideo {\n uri: string;\n name: string;\n contentType: string;\n durationMs: number;\n}\n\nexport type VideoUploadStatus = \"uploading\" | \"failed\";\n\n/** Why a video didn't go: the tray words it (`copy`); `detail` is the error, for logs. */\nexport type VideoUploadError = \"offline\" | \"forbidden\" | \"failed\";\n\n/** One video on its way, shown in the thread above the composer until its message is queued. */\nexport interface VideoUploadTask {\n id: string;\n conversationId: string;\n /** Whose it is: the tray shows only the signed-in person's. */\n userId: string | null;\n video: RecordedVideo;\n status: VideoUploadStatus;\n /** 0 to 1. */\n progress: number;\n error: VideoUploadError | null;\n detail: string | null;\n}\n\n/** The outbox's send (`useChat().outbox.send`): the message goes in the conversation's order. */\nexport type OutboxSend = (input: Omit<SendInput, \"clientId\"> & { clientId?: string }, files?: LocalFile[]) => Promise<string>;\n\nexport type MintedUpload = { url: string; providerId: string; provider: \"mux\" };\n\nexport interface StartVideoInput {\n conversationId: string;\n userId?: string | null;\n video: RecordedVideo;\n /** What goes with it: a reply, a thread, a topic. */\n extra?: Omit<SendInput, \"conversationId\" | \"clientId\" | \"attachments\" | \"body\">;\n send: OutboxSend;\n videoUpload?: ChatVideoUpload;\n /** The upload minted when recording started. */\n prepared?: Promise<MintedUpload> | null;\n openFile?: (uri: string) => Promise<ChunkFileLike> | ChunkFileLike;\n fetch?: typeof fetch;\n chunkBytes?: number;\n sleep?: (ms: number) => Promise<void>;\n}\n\n/** The video as a file the outbox uploads to storage (without `videoUpload`). */\nexport function recordedVideoFile(video: RecordedVideo): LocalFile {\n return { data: video.uri, name: video.name, contentType: video.contentType, previewUrl: video.uri, meta: { kind: \"video\", durationMs: video.durationMs } };\n}\n\ninterface Internal {\n task: VideoUploadTask;\n input: StartVideoInput;\n upload: MintedUpload | null;\n bytes: number | null;\n /** Bytes went to `upload`: a Retry asks the server where it is first. */\n started: boolean;\n /** Every byte is there: a Retry only sends the message. */\n uploaded: boolean;\n cancelled: boolean;\n}\n\nfunction errorKind(e: unknown): VideoUploadError {\n if (e instanceof ChatError) return e.forbidden ? \"forbidden\" : e.transient ? \"offline\" : \"failed\";\n return e instanceof TypeError ? \"offline\" : \"failed\";\n}\n\nexport function createVideoUploads(newId: () => string = () => `${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`) {\n const tasks = new Map<string, Internal>();\n const listeners = new Set<() => void>();\n let snapshot: VideoUploadTask[] = [];\n const emit = () => {\n snapshot = [...tasks.values()].map((t) => t.task);\n listeners.forEach((l) => l());\n };\n const update = (t: Internal, patch: Partial<VideoUploadTask>) => {\n if (!tasks.has(t.task.id)) return;\n t.task = { ...t.task, ...patch };\n emit();\n };\n const finish = (t: Internal) => {\n tasks.delete(t.task.id);\n emit();\n };\n\n async function upload(t: Internal, videoUpload: ChatVideoUpload) {\n const { input } = t;\n if (!t.upload) {\n const prepared = input.prepared;\n // A minted upload is used once, whatever happens to it.\n t.input = { ...input, prepared: null };\n t.upload = await (prepared ?? videoUpload.create(input.conversationId));\n }\n if (t.cancelled) return;\n const source = await fileSource(input.video.uri, input.openFile, input.fetch);\n try {\n t.bytes = source.size;\n const resume = t.started;\n t.started = true;\n await chunkedPut({\n url: t.upload.url,\n contentType: input.video.contentType,\n source,\n fetch: input.fetch,\n chunkBytes: input.chunkBytes,\n sleep: input.sleep,\n resume,\n isCancelled: () => t.cancelled,\n onProgress: (sent, total) => update(t, { progress: total ? sent / total : 0 }),\n });\n } finally {\n source.close();\n }\n t.uploaded = true;\n }\n\n async function run(t: Internal) {\n const { input } = t;\n const { video } = input;\n if (!input.videoUpload) {\n // To storage, through the outbox (its pending bubble shows the upload).\n await input.send({ ...input.extra, conversationId: input.conversationId, body: \"\" }, [recordedVideoFile(video)]);\n return finish(t);\n }\n if (!t.uploaded) {\n try {\n await upload(t, input.videoUpload);\n } catch (e) {\n // A minted upload that expired before it was used: mint a fresh one, once, without asking.\n if (!(e instanceof ChatError && e.code === \"P0002\") || t.cancelled) throw e;\n t.upload = null;\n t.started = false;\n await upload(t, input.videoUpload);\n }\n }\n if (t.cancelled || !t.upload) return;\n const attachment: AttachmentInput = {\n kind: \"video\",\n provider: t.upload.provider,\n providerId: t.upload.providerId,\n status: \"pending\",\n name: video.name,\n mime: video.contentType,\n bytes: t.bytes ?? undefined,\n durationMs: Math.round(video.durationMs),\n };\n // Queued in the outbox, it shows in the thread as a pending video; then the tray lets it go.\n await input.send({ ...input.extra, conversationId: input.conversationId, body: \"\", attachments: [attachment] });\n finish(t);\n }\n\n function go(t: Internal) {\n update(t, { status: \"uploading\", error: null, detail: null });\n run(t).catch((e: unknown) => {\n if (t.cancelled) return;\n // An upload URL that is gone: Retry mints a new one and starts over.\n if (e instanceof ChatError && e.code === \"P0002\") {\n t.upload = null;\n t.started = false;\n }\n update(t, { status: \"failed\", error: errorKind(e), detail: e instanceof Error ? e.message : String(e) });\n });\n }\n\n return {\n /** Starts sending a recording. Returns the task's id. */\n start(input: StartVideoInput): string {\n const id = newId();\n const t: Internal = {\n task: { id, conversationId: input.conversationId, userId: input.userId ?? null, video: input.video, status: \"uploading\", progress: 0, error: null, detail: null },\n input,\n upload: null,\n bytes: null,\n started: false,\n uploaded: false,\n cancelled: false,\n };\n tasks.set(id, t);\n emit();\n go(t);\n return id;\n },\n retry(id: string) {\n const t = tasks.get(id);\n if (t && t.task.status === \"failed\") go(t);\n },\n /** Stops it and forgets it (an upload Mux never receives expires on its own). */\n cancel(id: string) {\n const t = tasks.get(id);\n if (!t) return;\n t.cancelled = true;\n finish(t);\n },\n /** Stops and forgets every one (call it on sign-out, beside `clearOutbox`). */\n cancelAll() {\n for (const t of tasks.values()) t.cancelled = true;\n tasks.clear();\n emit();\n },\n list(conversationId?: string): VideoUploadTask[] {\n return conversationId ? snapshot.filter((t) => t.conversationId === conversationId) : snapshot;\n },\n subscribe(listener: () => void) {\n listeners.add(listener);\n return () => void listeners.delete(listener);\n },\n snapshot: () => snapshot,\n };\n}\n\nexport type VideoUploads = ReturnType<typeof createVideoUploads>;\n\n/** The app's uploads in flight (one for the app; the thread screen reads it). */\nexport const videoUploads: VideoUploads = createVideoUploads();\n\nconst EMPTY: VideoUploadTask[] = [];\n\n/** The signed-in person's videos on their way to this conversation, live. */\nexport function useVideoUploads(conversationId: string, userId: string | null = null, store: VideoUploads = videoUploads): VideoUploadTask[] {\n const all = useSyncExternalStore(store.subscribe, store.snapshot, () => EMPTY);\n const mine = (t: VideoUploadTask) => t.conversationId === conversationId && (userId === null || t.userId === null || t.userId === userId);\n return all.some(mine) ? all.filter(mine) : EMPTY;\n}\n","/**\n * @feat:chat\n * Videos on their way, above the composer: how far each upload has got, and, when one\n * fails, why, with Retry (it resumes where it stopped) and Cancel. Once a video's bytes are\n * all there, its message joins the outbox and shows in the thread like any other.\n */\nimport { useEffect, useRef } from \"react\";\nimport { AccessibilityInfo, Pressable, View } from \"react-native\";\nimport { NativeIcon, NativeProgress, NativeText } from \"@marktiderman/genesis-ui-native/components\";\nimport { useThemeRoles } from \"@marktiderman/genesis-ui-native/hooks\";\nimport { fill } from \"./copy\";\nimport { useChatNative } from \"./context\";\nimport { useVideoUploads, videoUploads as defaultUploads, type VideoUploads } from \"./video-upload\";\n\nexport interface VideoUploadTrayProps {\n conversationId: string;\n /** The signed-in person: the tray shows only their uploads. */\n userId?: string | null;\n uploads?: VideoUploads;\n testID?: string;\n}\n\nexport function VideoUploadTray({ conversationId, userId = null, uploads = defaultUploads, testID = \"chat-video-uploads\" }: VideoUploadTrayProps) {\n const { copy } = useChatNative();\n const colors = useThemeRoles();\n const tasks = useVideoUploads(conversationId, userId, uploads);\n const why = (t: (typeof tasks)[number]) => (t.error === \"offline\" ? copy.videoOffline : t.error === \"forbidden\" ? copy.videoForbidden : copy.videoUploadFailed);\n // A failure is said once, on both platforms (a live region is Android only, and would read every percent).\n const told = useRef(new Set<string>());\n const failedNow = tasks.filter((t) => t.status === \"failed\").map((t) => t.id).join(\",\");\n useEffect(() => {\n for (const t of tasks) {\n if (t.status === \"failed\" && !told.current.has(t.id)) {\n told.current.add(t.id);\n AccessibilityInfo?.announceForAccessibility?.(why(t));\n }\n if (t.status !== \"failed\") told.current.delete(t.id);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [failedNow]);\n if (!tasks.length) return null;\n return (\n <View testID={testID} style={{ paddingHorizontal: 12, paddingTop: 6, gap: 6, backgroundColor: colors.groupedBackground }}>\n {tasks.map((t) => {\n const percent = Math.round(t.progress * 100);\n const failed = t.status === \"failed\";\n return (\n <View key={t.id} testID={`${testID}-${t.id}`} style={{ flexDirection: \"row\", alignItems: \"center\", gap: 8, padding: 8, borderRadius: 12, backgroundColor: colors.surface }}>\n <NativeIcon name=\"video\" size={20} color={failed ? colors.destructive : colors.tint} />\n <View\n style={{ flex: 1, gap: 4 }}\n accessible\n accessibilityRole={failed ? \"alert\" : \"progressbar\"}\n accessibilityLabel={failed ? why(t) : fill(copy.videoUploading, { percent })}\n accessibilityValue={failed ? undefined : { min: 0, max: 100, now: percent }}\n >\n <NativeText testID={`${testID}-${t.id}-text`} preset=\"caption\" numberOfLines={2} style={{ color: failed ? colors.destructive : colors.label }}>\n {failed ? why(t) : fill(copy.videoUploading, { percent })}\n </NativeText>\n {failed ? null : <NativeProgress value={percent} testID={`${testID}-${t.id}-progress`} />}\n </View>\n {failed ? (\n <Pressable testID={`${testID}-${t.id}-retry`} accessibilityRole=\"button\" accessibilityLabel={copy.retry} onPress={() => uploads.retry(t.id)} style={{ minHeight: 44, minWidth: 44, paddingHorizontal: 8, alignItems: \"center\", justifyContent: \"center\" }}>\n <NativeText preset=\"label\" style={{ color: colors.tint }}>\n {copy.retry}\n </NativeText>\n </Pressable>\n ) : null}\n <Pressable testID={`${testID}-${t.id}-cancel`} accessibilityRole=\"button\" accessibilityLabel={copy.cancelUpload} onPress={() => uploads.cancel(t.id)} style={{ width: 44, height: 44, alignItems: \"center\", justifyContent: \"center\" }}>\n <NativeIcon name=\"close\" size={18} color={colors.secondaryLabel} />\n </Pressable>\n </View>\n );\n })}\n </View>\n );\n}\n","/**\n * @feat:chat\n * The composer as plain state, so it is the same in every screen and tested\n * without a phone: the text, the files waiting to go, what it replies to, why\n * it can't post, what a send hands the outbox, and the draft kept per thread.\n */\nimport { CHAT_LIMITS, attachmentKindFor, fileExtension, isAllowedExtension } from \"../core/media\";\nimport { parseMentions } from \"../core/thread\";\nimport type { LocalFile } from \"../core/outbox\";\nimport type { ChatConversation, ChatMessage, ChatRole } from \"../core/types\";\nimport { fill, type ChatNativeCopy } from \"./copy\";\nimport type { DraftStorageLike, PickedAssetLike } from \"./modules\";\n\n/** A file in the composer, shown as a thumbnail until it is sent. */\nexport interface ComposerAttachment {\n /** Stable for keys and removal. */\n key: string;\n file: LocalFile;\n}\n\nexport interface ReplyTarget {\n messageId: string;\n /** Who wrote it, as shown (\"Sam\", \"You\"). */\n name: string;\n /** A one-line preview. */\n preview: string;\n}\n\nexport interface ComposerState {\n text: string;\n attachments: ComposerAttachment[];\n replyTo: ReplyTarget | null;\n /** The last thing that couldn't be added (\"x.svg can't be sent\"). Cleared by the next change. */\n notice: string | null;\n}\n\nexport const emptyComposer: ComposerState = { text: \"\", attachments: [], replyTo: null, notice: null };\n\nexport type ComposerAction =\n | { type: \"text\"; text: string }\n /** `tooMany` is what to say when the files don't all fit (copy.tooMany). */\n | { type: \"add\"; attachments: ComposerAttachment[]; notice?: string | null; tooMany?: string }\n | { type: \"remove\"; key: string }\n | { type: \"reply\"; to: ReplyTarget | null }\n | { type: \"restore\"; draft: ComposerDraft }\n /** Another conversation (or thread) opened in the same composer: start empty. */\n | { type: \"reset\" }\n | { type: \"sent\" };\n\nexport function composerReducer(state: ComposerState, action: ComposerAction): ComposerState {\n switch (action.type) {\n case \"text\":\n return { ...state, text: action.text.slice(0, CHAT_LIMITS.bodyChars), notice: null };\n case \"add\": {\n const room = CHAT_LIMITS.attachmentsPerMessage - state.attachments.length;\n const added = action.attachments.slice(0, Math.max(0, room));\n const overflow = action.attachments.length > added.length;\n return {\n ...state,\n attachments: [...state.attachments, ...added],\n notice: overflow ? (action.tooMany ?? action.notice ?? null) : (action.notice ?? null),\n };\n }\n case \"remove\":\n return { ...state, attachments: state.attachments.filter((a) => a.key !== action.key), notice: null };\n case \"reply\":\n return { ...state, replyTo: action.to };\n case \"restore\":\n // A draft never replaces what was typed meanwhile.\n if (state.text || state.attachments.length) return state;\n return { ...state, text: action.draft.text, replyTo: action.draft.replyTo ?? null };\n case \"reset\":\n case \"sent\":\n return emptyComposer;\n }\n}\n\n/** Something to send: text that isn't blank, or a file. */\nexport function canSend(state: ComposerState, canPost: boolean): boolean {\n return canPost && (state.text.trim().length > 0 || state.attachments.length > 0);\n}\n\n/**\n * Why this person can't post here, for the disabled composer; null when they can.\n * `canPost` is the server's answer (null while it loads, which disables quietly).\n */\nexport function composerDisabledReason(\n canPost: boolean | null,\n conversation: Pick<ChatConversation, \"settings\" | \"status\" | \"archivedAt\"> | null,\n role: ChatRole | null,\n copy: Pick<ChatNativeCopy, \"cantPost\" | \"cantPostAdmins\" | \"cantPostClosed\">,\n): string | null {\n if (canPost !== false) return null;\n if (conversation?.status === \"closed\" || conversation?.status === \"solved\" || conversation?.archivedAt) return copy.cantPostClosed;\n if (conversation?.settings?.who_posts === \"admins\" && role !== \"owner\" && role !== \"admin\") return copy.cantPostAdmins;\n return copy.cantPost;\n}\n\n/** What `useConversation().send` takes: the input and the files. */\nexport function toSend(state: ComposerState): { input: { body: string; replyToId: string | null; mentions: string[] }; files: LocalFile[] } {\n const body = state.text.trim();\n return {\n input: { body, replyToId: state.replyTo?.messageId ?? null, mentions: parseMentions(body) },\n files: state.attachments.map((a) => a.file),\n };\n}\n\n/** A reply target from a message. */\nexport function replyTargetFor(message: ChatMessage, name: string, preview: string): ReplyTarget {\n return { messageId: message.id, name, preview };\n}\n\nlet seq = 0;\nconst nextKey = () => `a${Date.now().toString(36)}${(seq++).toString(36)}`;\n\n/**\n * Picked photos and videos as files to send, with what was refused and why:\n * a type the bucket won't take, a file over the limit.\n */\nexport function filesFromAssets(\n assets: readonly PickedAssetLike[],\n copy: Pick<ChatNativeCopy, \"tooLarge\" | \"notAllowedType\" | \"photo\" | \"video\">,\n): { attachments: ComposerAttachment[]; notice: string | null } {\n const attachments: ComposerAttachment[] = [];\n let notice: string | null = null;\n for (const asset of assets) {\n const video = asset.type === \"video\" || (asset.mimeType ?? \"\").startsWith(\"video/\");\n const contentType = asset.mimeType ?? (video ? \"video/mp4\" : \"image/jpeg\");\n const fallbackName = `${video ? \"video\" : \"photo\"}.${video ? \"mp4\" : \"jpg\"}`;\n const name = asset.fileName ?? (asset.uri.split(\"/\").pop() || fallbackName);\n const ext = fileExtension(name, contentType);\n if (!isAllowedExtension(ext)) {\n notice = fill(copy.notAllowedType, { name });\n continue;\n }\n const limit = video ? CHAT_LIMITS.videoBytes : CHAT_LIMITS.fileBytes;\n if (asset.fileSize != null && asset.fileSize > limit) {\n notice = fill(copy.tooLarge, { name });\n continue;\n }\n attachments.push({\n key: nextKey(),\n file: {\n data: asset.uri,\n name,\n contentType,\n previewUrl: asset.uri,\n meta: {\n kind: attachmentKindFor(contentType),\n width: asset.width || undefined,\n height: asset.height || undefined,\n bytes: asset.fileSize ?? undefined,\n durationMs: video && asset.duration ? Math.round(asset.duration) : undefined,\n },\n },\n });\n }\n return { attachments, notice };\n}\n\n/** A pasted picture (a data URI from the clipboard) as a file to send. */\nexport function fileFromDataUri(dataUri: string, size?: { width: number; height: number }): ComposerAttachment | null {\n const m = /^data:([^;,]+);base64,(.*)$/s.exec(dataUri);\n if (!m) return null;\n const contentType = m[1]!.toLowerCase();\n const ext = fileExtension(\"\", contentType);\n if (!contentType.startsWith(\"image/\") || !isAllowedExtension(ext)) return null;\n const bytes = base64ToBytes(m[2]!);\n return {\n key: nextKey(),\n file: {\n data: bytes.buffer as ArrayBuffer,\n name: `pasted.${ext}`,\n contentType,\n previewUrl: dataUri,\n meta: { kind: \"image\", width: size?.width, height: size?.height, bytes: bytes.byteLength },\n },\n };\n}\n\nconst B64 = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\n\n/** Base64 to bytes without `atob` (not on every Hermes build). */\nexport function base64ToBytes(b64: string): Uint8Array {\n const clean = b64.replace(/[^A-Za-z0-9+/]/g, \"\");\n const out = new Uint8Array(Math.floor((clean.length * 3) / 4));\n let o = 0;\n for (let i = 0; i < clean.length; i += 4) {\n const n =\n (B64.indexOf(clean[i]!) << 18) |\n (B64.indexOf(clean[i + 1] ?? \"A\") << 12) |\n ((i + 2 < clean.length ? B64.indexOf(clean[i + 2]!) : 0) << 6) |\n (i + 3 < clean.length ? B64.indexOf(clean[i + 3]!) : 0);\n if (o < out.length) out[o++] = (n >> 16) & 255;\n if (i + 2 < clean.length && o < out.length) out[o++] = (n >> 8) & 255;\n if (i + 3 < clean.length && o < out.length) out[o++] = n & 255;\n }\n return out;\n}\n\n// ---- Drafts ---------------------------------------------------------------\n\n/** What a draft keeps: the text and what it replies to (never the files, which may be gone by then). */\nexport interface ComposerDraft {\n text: string;\n replyTo?: ReplyTarget | null;\n}\n\nconst DRAFT_PREFIX = \"genesis-chat:drafts:\";\n/** Drafts saved before they were kept per person: no one's, so any sign-out clears them. */\nconst LEGACY_DRAFT_PREFIX = \"genesis-chat:draft:\";\n\n/**\n * One draft per signed-in person, per conversation, and per thread within it.\n * The person comes first, so `clearDrafts` can find all of theirs on sign-out,\n * and a second login on the phone never sees the first one's drafts.\n */\nexport function draftKey(userId: string, conversationId: string, threadRootId?: string | null): string {\n return `${DRAFT_PREFIX}${userId}:${conversationId}${threadRootId ? `:${threadRootId}` : \"\"}`;\n}\n\n/**\n * Removes drafts from the phone: one person's (`clearDrafts(storage, userId)`,\n * on sign-out), or everyone's but one (`{ except: userId }`, on sign-in, which\n * also covers a session that ended while the app was closed). Drafts saved\n * before drafts were kept per person go either way. Needs the storage's\n * `getAllKeys` (AsyncStorage has it); without it, it reports that through\n * `onError` and removes nothing. Never throws. Returns how many it removed.\n */\nexport async function clearDrafts(storage: DraftStorageLike, who: string | { except: string }, onError?: (error: unknown) => void): Promise<number> {\n try {\n if (typeof storage.getAllKeys !== \"function\") {\n onError?.(new Error(\"chat drafts: the draft storage has no getAllKeys, so drafts weren't cleared\"));\n return 0;\n }\n const goes = (k: string) =>\n k.startsWith(LEGACY_DRAFT_PREFIX) ||\n (k.startsWith(DRAFT_PREFIX) && (typeof who === \"string\" ? k.startsWith(`${DRAFT_PREFIX}${who}:`) : !k.startsWith(`${DRAFT_PREFIX}${who.except}:`)));\n const keys = (await storage.getAllKeys()).filter(goes);\n if (keys.length === 0) return 0;\n if (typeof storage.multiRemove === \"function\") await storage.multiRemove(keys);\n else await Promise.all(keys.map((k) => storage.removeItem(k)));\n return keys.length;\n } catch (error) {\n onError?.(error);\n return 0;\n }\n}\n\nexport function memoryDraftStorage(): DraftStorageLike {\n const map = new Map<string, string>();\n return {\n getItem: async (k) => map.get(k) ?? null,\n setItem: async (k, v) => void map.set(k, v),\n removeItem: async (k) => void map.delete(k),\n getAllKeys: async () => [...map.keys()],\n };\n}\n\nexport async function loadDraft(storage: DraftStorageLike, key: string): Promise<ComposerDraft | null> {\n try {\n const raw = await storage.getItem(key);\n if (!raw) return null;\n const parsed = JSON.parse(raw) as ComposerDraft;\n return typeof parsed?.text === \"string\" ? parsed : null;\n } catch {\n return null;\n }\n}\n\n/**\n * Saves the draft a moment after typing stops (and at once on `flush`); an\n * empty composer removes it. Storage errors are swallowed: a draft is a nicety.\n */\nexport function createDraftSaver(storage: DraftStorageLike, key: string, delayMs = 400) {\n let timer: ReturnType<typeof setTimeout> | null = null;\n let latest: ComposerDraft | null = null;\n const write = () => {\n timer = null;\n const d = latest;\n if (!d) return;\n const p = d.text.trim() || d.replyTo ? storage.setItem(key, JSON.stringify(d)) : storage.removeItem(key);\n void p.catch(() => undefined);\n };\n return {\n save(draft: ComposerDraft) {\n latest = draft;\n if (timer) clearTimeout(timer);\n timer = setTimeout(write, delayMs);\n },\n flush() {\n if (timer) clearTimeout(timer);\n write();\n },\n clear() {\n if (timer) clearTimeout(timer);\n timer = null;\n latest = null;\n void storage.removeItem(key).catch(() => undefined);\n },\n };\n}\n","/**\n * @feat:chat\n * Scheduled send on native. `ChatScheduleSheet`: tomorrow 9 AM, Monday 9 AM, or a date and time\n * you pick (genesis-ui-native's NativeDatePicker and NativeTimePicker, which draw\n * @react-native-community/datetimepicker, or @expo/ui's picker passed as GenesisNativeApp's\n * `modules.datePicker`; without either the time reads as text and the quick picks still work).\n * `ChatScheduledList`: your messages waiting to go, each with Cancel. `ChatScheduledBar`: \"2\n * scheduled messages\" over the composer, opening that list. The thread opens the sheet when Send\n * is touched and held. The same rules as the web's `ChatScheduleMenu` and `ChatScheduledList`.\n */\nimport { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\nimport { Pressable, View } from \"react-native\";\nimport {\n NativeButton,\n NativeDatePicker,\n NativeEmptyState,\n NativeIcon,\n NativeListItem,\n NativeSheet,\n NativeSkeleton,\n NativeText,\n NativeTimePicker,\n useToast,\n} from \"@marktiderman/genesis-ui-native/components\";\nimport { useThemeRoles } from \"@marktiderman/genesis-ui-native/hooks\";\nimport { isSchedulable, scheduleLabel, scheduleQuickPicks } from \"../core/extras\";\nimport type { ScheduleInput, ScheduledMessage } from \"../core/types\";\nimport { useChat, useScheduled, type ChatAttachmentKind } from \"../react/index\";\nimport { attachmentPreview } from \"./attachment-cards\";\nimport { toSend, type ComposerState } from \"./composer-state\";\nimport { haptic } from \"./modules\";\nimport type { ChatComposerHandle } from \"./use-composer\";\nimport { fill } from \"./copy\";\nimport { useChatNative } from \"./context\";\nimport { displayBody } from \"./message-bubble\";\n\n/** An hour from now, on the next five minutes: where the custom picker starts. */\nexport function defaultScheduleAt(now: Date = new Date()): Date {\n const d = new Date(now.getTime() + 60 * 60_000);\n d.setSeconds(0, 0);\n d.setMinutes(Math.ceil(d.getMinutes() / 5) * 5);\n return d;\n}\n\n/** `base` on the day of `day` (its time kept). */\nexport function withDay(base: Date, day: Date): Date {\n const d = new Date(base);\n d.setFullYear(day.getFullYear(), day.getMonth(), day.getDate());\n return d;\n}\n\n/** `base` at the time of `time` (its day kept). */\nexport function withTime(base: Date, time: Date): Date {\n const d = new Date(base);\n d.setHours(time.getHours(), time.getMinutes(), 0, 0);\n return d;\n}\n\n/**\n * What the composer holds, as a message to schedule, or why it can't be: nothing to send, or\n * files (a native file is a URI, and `useScheduled` uploads bytes only).\n */\nexport function scheduleInputFrom(\n state: ComposerState,\n opts: { conversationId: string; topic?: string | null; at: Date },\n): { input: Omit<ScheduleInput, \"clientId\"> } | { error: \"empty\" | \"files\" } {\n const { input, files } = toSend(state);\n if (files.length) return { error: \"files\" };\n if (!input.body) return { error: \"empty\" };\n return { input: { conversationId: opts.conversationId, body: input.body, mentions: input.mentions, replyToId: input.replyToId, topic: opts.topic ?? null, sendAt: opts.at } };\n}\n\n/**\n * Scheduled send from a thread's composer: `request` (Send held) checks there's text and no\n * files and opens the sheet; `scheduleAt` schedules what's written, then empties the composer\n * if it still holds just that. Pass `enabled: false` where scheduling isn't offered.\n */\nexport function useScheduleSend(opts: { conversationId: string; topic?: string | null; composer: ChatComposerHandle; enabled: boolean }) {\n const { copy, modules } = useChatNative();\n const toast = useToast();\n const { schedule } = useScheduled(opts.conversationId, { enabled: opts.enabled });\n const [open, setOpen] = useState(false);\n const latest = useRef(opts);\n latest.current = opts;\n\n const request = useCallback(() => {\n const check = scheduleInputFrom(latest.current.composer.state, { conversationId: latest.current.conversationId, at: new Date() });\n if (\"error\" in check) {\n if (check.error === \"files\") toast.show({ title: copy.scheduleNoFiles, variant: \"destructive\" });\n return;\n }\n haptic(modules.haptics, \"select\");\n setOpen(true);\n }, [toast, copy.scheduleNoFiles, modules.haptics]);\n\n const scheduleAt = useCallback(\n async (at: Date) => {\n const { composer, conversationId, topic } = latest.current;\n const made = scheduleInputFrom(composer.state, { conversationId, topic, at });\n if (\"error\" in made) return;\n try {\n await schedule(made.input);\n // More may have been typed while it saved: only what was scheduled is cleared.\n const now = latest.current.composer;\n if (now.state.text.trim() === made.input.body) now.take();\n haptic(modules.haptics, \"send\");\n toast.show({ title: fill(copy.scheduledFor, { when: scheduleLabel(at) }), variant: \"success\", duration: 2000 });\n } catch (e) {\n haptic(modules.haptics, \"error\");\n toast.show({ title: e instanceof Error && e.message ? e.message : copy.scheduleFailed, variant: \"destructive\" });\n }\n },\n [schedule, modules.haptics, toast, copy.scheduledFor, copy.scheduleFailed],\n );\n\n return { open, setOpen, request, scheduleAt };\n}\n\nexport interface ChatScheduleSheetProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n /** The time chosen; the sheet closes first. */\n onSchedule: (at: Date) => void;\n /** For tests and demos. */\n now?: Date;\n testID?: string;\n}\n\nexport function ChatScheduleSheet({ open, onOpenChange, onSchedule, now, testID = \"chat-schedule\" }: ChatScheduleSheetProps) {\n const { copy } = useChatNative();\n const colors = useThemeRoles();\n const clock = now ?? new Date();\n const picks = useMemo(() => scheduleQuickPicks(now ?? new Date()), [now, open]); // eslint-disable-line react-hooks/exhaustive-deps\n const [custom, setCustom] = useState(false);\n const [at, setAt] = useState(() => defaultScheduleAt(clock));\n // Each opening starts again: the quick picks, and an hour from now for a custom time.\n useEffect(() => {\n if (!open) return;\n setCustom(false);\n setAt(defaultScheduleAt(now ?? new Date()));\n }, [open]); // eslint-disable-line react-hooks/exhaustive-deps\n const ok = isSchedulable(at, clock);\n\n const choose = (when: Date) => {\n onOpenChange(false);\n setCustom(false);\n onSchedule(when);\n };\n\n return (\n <NativeSheet open={open} onOpenChange={onOpenChange} fitContent testID={testID}>\n <View style={{ paddingVertical: 8 }}>\n <View style={{ paddingHorizontal: 16, paddingBottom: 8, gap: 4 }}>\n <NativeText preset=\"h4\" accessibilityRole=\"header\">\n {copy.scheduleTitle}\n </NativeText>\n <NativeText preset=\"caption\" style={{ color: colors.secondaryLabel }}>\n {copy.scheduleHint}\n </NativeText>\n </View>\n {custom ? (\n <View style={{ paddingHorizontal: 16, gap: 12 }} testID={`${testID}-custom`}>\n <View style={{ flexDirection: \"row\", alignItems: \"center\", justifyContent: \"space-between\", gap: 12, minHeight: 44 }}>\n <NativeText preset=\"body\">{copy.scheduleDate}</NativeText>\n <NativeDatePicker testID={`${testID}-date`} value={at} onChange={(d) => setAt((x) => withDay(x, d))} />\n </View>\n <View style={{ flexDirection: \"row\", alignItems: \"center\", justifyContent: \"space-between\", gap: 12, minHeight: 44 }}>\n <NativeText preset=\"body\">{copy.scheduleTime}</NativeText>\n <NativeTimePicker testID={`${testID}-time`} value={at} onChange={(d) => setAt((x) => withTime(x, d))} />\n </View>\n <NativeText testID={`${testID}-when`} preset=\"caption\" accessibilityLiveRegion=\"polite\" style={{ color: ok ? colors.secondaryLabel : colors.destructive }}>\n {ok ? scheduleLabel(at, clock) : copy.scheduleOutOfRange}\n </NativeText>\n <NativeButton testID={`${testID}-confirm`} onPress={() => ok && choose(at)} disabled={!ok}>\n {copy.scheduleConfirm}\n </NativeButton>\n </View>\n ) : (\n <View>\n {picks.map((p, i) => (\n <NativeListItem key={p.label} testID={`${testID}-pick-${i}`} title={p.label} leading={<NativeIcon name=\"clock\" />} onPress={() => choose(p.at)} />\n ))}\n <NativeListItem testID={`${testID}-pick-custom`} title={copy.schedulePick} leading={<NativeIcon name=\"calendar\" />} showChevron onPress={() => setCustom(true)} />\n </View>\n )}\n </View>\n </NativeSheet>\n );\n}\n\nexport interface ChatScheduledListProps {\n /** One conversation's; all of yours without it. */\n conversationId?: string | null;\n /** Names a conversation in the all-conversations list. */\n conversationTitle?: (conversationId: string) => string;\n testID?: string;\n}\n\n/** Your scheduled messages, soonest first, each with when it goes and Cancel. */\nexport function ChatScheduledList({ conversationId, conversationTitle, testID = \"chat-scheduled\" }: ChatScheduledListProps) {\n const { copy } = useChatNative();\n const toast = useToast();\n const { items, isLoading, cancel } = useScheduled(conversationId);\n if (isLoading) {\n return (\n <View testID={`${testID}-loading`} style={{ padding: 16, gap: 8 }}>\n <NativeSkeleton height={44} className=\"w-full\" />\n <NativeSkeleton height={44} className=\"w-full\" />\n </View>\n );\n }\n if (items.length === 0) return <NativeEmptyState variant=\"first-run\" title={copy.scheduledEmpty} body={copy.scheduledEmptyBody} testID={`${testID}-empty`} />;\n return (\n <View testID={testID} accessibilityLabel={copy.scheduledTitle}>\n {items.map((s) => (\n <ScheduledRow\n key={s.id}\n item={s}\n where={!conversationId && conversationTitle ? conversationTitle(s.conversationId) : null}\n onCancel={() =>\n void cancel(s.id).then(\n () => toast.show({ title: copy.scheduledCancelled, variant: \"success\", duration: 1500 }),\n () => toast.show({ title: copy.actionFailed, variant: \"destructive\" }),\n )\n }\n testID={`${testID}-item-${s.id}`}\n />\n ))}\n </View>\n );\n}\n\n/**\n * Cancel's (or Remove's) label on a scheduled row: the message's text as well as its time, so\n * each row's button says which message it takes back.\n */\nexport function scheduledActionLabel(\n item: ScheduledMessage,\n copy: Pick<ReturnType<typeof useChatNative>[\"copy\"], \"scheduledCancel\" | \"scheduledRemove\" | \"scheduledFor\">,\n kinds?: Record<string, ChatAttachmentKind>,\n): string {\n const text = attachmentPreview(displayBody(item.body), item.attachments[0]?.kind ?? null, kinds);\n // Cut by character, not UTF-16 unit, so an emoji isn't split.\n const chars = Array.from(text);\n const short = chars.length > 60 ? `${chars.slice(0, 59).join(\"\")}…` : text;\n if (item.status === \"failed\") return [copy.scheduledRemove, short].filter(Boolean).join(\", \");\n return [copy.scheduledCancel, short, fill(copy.scheduledFor, { when: scheduleLabel(item.sendAt) })].filter(Boolean).join(\", \");\n}\n\nfunction ScheduledRow({ item, where, onCancel, testID }: { item: ScheduledMessage; where: string | null; onCancel: () => void; testID: string }) {\n const { copy } = useChatNative();\n const colors = useThemeRoles();\n const { attachmentKinds } = useChat();\n const failed = item.status === \"failed\";\n const when = failed ? copy.scheduledCouldntSend : scheduleLabel(item.sendAt);\n const text = attachmentPreview(displayBody(item.body), item.attachments[0]?.kind ?? null, attachmentKinds);\n return (\n <View testID={testID} style={{ flexDirection: \"row\", alignItems: \"center\", gap: 12, paddingLeft: 16, paddingRight: 4, paddingVertical: 8, minHeight: 56 }}>\n <NativeIcon name={failed ? \"warning\" : \"clock\"} size={18} color={failed ? colors.destructive : colors.secondaryLabel} />\n <View style={{ flex: 1, gap: 2 }} accessible accessibilityLabel={[when, where, text, item.error].filter(Boolean).join(\", \")}>\n <NativeText preset=\"caption\" style={{ color: failed ? colors.destructive : colors.secondaryLabel, fontWeight: \"600\" }}>\n {where ? `${when} · ${where}` : when}\n </NativeText>\n <NativeText preset=\"body-sm\" numberOfLines={2}>\n {text}\n </NativeText>\n {item.error ? (\n <NativeText preset=\"caption\" style={{ color: colors.destructive }}>\n {item.error}\n </NativeText>\n ) : null}\n </View>\n {item.status === \"scheduled\" || failed ? (\n // A failed one can't be sent again, but it can be removed (cancel_scheduled takes it).\n <Pressable\n testID={`${testID}-cancel`}\n accessibilityRole=\"button\"\n accessibilityLabel={scheduledActionLabel(item, copy, attachmentKinds)}\n onPress={onCancel}\n style={{ minHeight: 44, minWidth: 44, paddingHorizontal: 12, alignItems: \"center\", justifyContent: \"center\" }}\n >\n <NativeText preset=\"label\" style={{ color: colors.destructive }}>\n {failed ? copy.scheduledRemove : copy.scheduledCancel}\n </NativeText>\n </Pressable>\n ) : null}\n </View>\n );\n}\n\nexport interface ChatScheduledBarProps {\n conversationId: string;\n testID?: string;\n}\n\n/** \"2 scheduled messages\" over the composer when there are any, opening their list. */\nexport function ChatScheduledBar({ conversationId, testID = \"chat-scheduled-bar\" }: ChatScheduledBarProps) {\n const { copy } = useChatNative();\n const colors = useThemeRoles();\n const { items } = useScheduled(conversationId);\n const [open, setOpen] = useState(false);\n if (items.length === 0) return null;\n const label = items.length === 1 ? copy.scheduledCountOne : fill(copy.scheduledCount, { count: items.length });\n return (\n <>\n <Pressable\n testID={testID}\n accessibilityRole=\"button\"\n accessibilityLabel={label}\n onPress={() => setOpen(true)}\n style={{ flexDirection: \"row\", alignItems: \"center\", gap: 6, minHeight: 44, paddingHorizontal: 16, backgroundColor: colors.groupedBackground }}\n >\n <NativeIcon name=\"clock\" size={15} color={colors.secondaryLabel} />\n <NativeText preset=\"caption\" style={{ color: colors.secondaryLabel, fontWeight: \"600\" }}>\n {label}\n </NativeText>\n </Pressable>\n <NativeSheet open={open} onOpenChange={setOpen} testID={`${testID}-sheet`}>\n <View style={{ paddingVertical: 8 }}>\n <NativeText preset=\"h4\" accessibilityRole=\"header\" style={{ paddingHorizontal: 16, paddingBottom: 4 }}>\n {copy.scheduledTitle}\n </NativeText>\n <ChatScheduledList conversationId={conversationId} testID={`${testID}-list`} />\n </View>\n </NativeSheet>\n </>\n );\n}\n","/**\n * @feat:chat\n * Availability on native. `useAwayLine` and `ChatAwayLine`: the line a thread shows under its\n * header when the other person is away or outside their hours (\"Mark replies Mon–Fri, 9–5\n * (Eastern)\", \"Away until Monday: Back Monday\"; in a group, \"Sam and Lee are away\"), refreshed\n * each minute so it comes and goes with their hours. `ChatAvailabilityScreen`: your own away\n * message and its end, working hours per weekday and the time zone they're read in, for a\n * Settings route. The same rules as the web's `ChatAwayBanner` and `ChatAvailabilitySettings`.\n */\nimport { useEffect, useMemo, useState, type ReactNode } from \"react\";\nimport { View } from \"react-native\";\nimport {\n NativeButton,\n NativeCombobox,\n NativeDatePicker,\n NativeIcon,\n NativeSwitch,\n NativeText,\n NativeTextarea,\n NativeTimePicker,\n useToast,\n} from \"@marktiderman/genesis-ui-native/components\";\nimport { SettingsSubPage } from \"@marktiderman/genesis-ui-native/layouts\";\nimport { useThemeRoles } from \"@marktiderman/genesis-ui-native/hooks\";\nimport { WEEKDAYS, awaySummary, minutesOf } from \"../core/availability\";\nimport type { AvailabilityInput, ChatAvailability, ChatMember, Weekday, WorkingHours } from \"../core/types\";\nimport { useAvailability } from \"../react/index\";\nimport { fill } from \"./copy\";\nimport { useChatNative } from \"./context\";\nimport { withDay, withTime } from \"./schedule-sheet\";\n\n/** Ticks once a minute, so a line that depends on the clock keeps up with it. */\nfunction useMinute(): Date {\n const [now, setNow] = useState(() => new Date());\n useEffect(() => {\n const t = setInterval(() => setNow(new Date()), 60_000);\n return () => clearInterval(t);\n }, []);\n return now;\n}\n\n/**\n * The away line for a conversation, or null when everyone is around: the other person in a\n * two-person conversation; in a group, everyone (but you) away or outside their hours.\n */\nexport function awayLineFor(\n members: readonly Pick<ChatMember, \"userId\" | \"role\">[],\n me: string,\n forUser: (userId: string) => ChatAvailability | null,\n nameOf: (userId: string) => string,\n now: Date = new Date(),\n): string | null {\n const ids = members.filter((m) => m.userId !== me && m.role !== \"observer\").map((m) => m.userId);\n const people = ids.flatMap((id) => {\n const a = forUser(id);\n return a ? [{ availability: a, name: nameOf(id) }] : [];\n });\n return awaySummary(people, { now });\n}\n\n/** `awayLineFor` over the conversation's members, live (`useAvailability`), re-read each minute. */\nexport function useAwayLine(conversationId: string | null | undefined, members: readonly Pick<ChatMember, \"userId\" | \"role\">[], me: string, nameOf: (userId: string) => string): string | null {\n const { forUser, members: list } = useAvailability(conversationId);\n const now = useMinute();\n return useMemo(() => (list.length ? awayLineFor(members, me, forUser, nameOf, now) : null), [list, members, me, forUser, nameOf, now]);\n}\n\nexport interface ChatAwayLineProps {\n text: string | null;\n testID?: string;\n}\n\n/** The away line, as a quiet strip under the header; nothing when `text` is null. */\nexport function ChatAwayLine({ text, testID = \"chat-away-line\" }: ChatAwayLineProps) {\n const colors = useThemeRoles();\n if (!text) return null;\n return (\n <View\n testID={testID}\n accessible\n accessibilityRole=\"text\"\n accessibilityLabel={text}\n accessibilityLiveRegion=\"polite\"\n style={{ flexDirection: \"row\", alignItems: \"center\", gap: 8, paddingHorizontal: 16, paddingVertical: 8, backgroundColor: colors.fill }}\n >\n <NativeIcon name=\"clock\" size={15} color={colors.secondaryLabel} />\n <NativeText preset=\"caption\" style={{ flex: 1, color: colors.secondaryLabel }}>\n {text}\n </NativeText>\n </View>\n );\n}\n\n// ── Your availability ─────────────────────────────────────────────────────────\n\nexport interface DayHours {\n on: boolean;\n from: string;\n to: string;\n}\n\nexport type WeekHours = Record<Weekday, DayHours>;\n\n/** Monday to Friday, 9 to 5: where a first setup starts. */\nexport function defaultWeek(): WeekHours {\n return Object.fromEntries(WEEKDAYS.map((d) => [d, { on: d !== \"sat\" && d !== \"sun\", from: \"09:00\", to: \"17:00\" }])) as WeekHours;\n}\n\n/** Each day's first range from saved hours (a day with none is off). */\nexport function weekFromHours(hours: WorkingHours | null | undefined): WeekHours {\n if (!hours) return defaultWeek();\n return Object.fromEntries(\n WEEKDAYS.map((d) => {\n const first = hours[d]?.[0];\n return [d, first ? { on: true, from: first[0], to: first[1] } : { on: false, from: \"09:00\", to: \"17:00\" }];\n }),\n ) as WeekHours;\n}\n\n/** The hours to save: each day that's on, its range first, then any extra ranges saved elsewhere. */\nexport function hoursFromWeek(week: WeekHours, saved: WorkingHours | null | undefined): WorkingHours {\n return Object.fromEntries(\n WEEKDAYS.filter((d) => week[d].on).map((d) => [d, [[week[d].from, week[d].to] as [string, string], ...(saved?.[d] ?? []).slice(1)]]),\n );\n}\n\n/** A day that's on with the same start and end (the database refuses it). */\nexport function sameTimeDays(week: WeekHours): Weekday[] {\n return WEEKDAYS.filter((d) => week[d].on && week[d].from === week[d].to);\n}\n\n/** \"09:30\" as a Date today at that time (for a time picker), and back. */\nexport function clockToDate(hhmm: string, base: Date = new Date()): Date {\n const m = minutesOf(hhmm) ?? 9 * 60;\n const d = new Date(base);\n d.setHours(Math.floor(m / 60) % 24, m % 60, 0, 0);\n return d;\n}\nexport function dateToClock(d: Date): string {\n return `${String(d.getHours()).padStart(2, \"0\")}:${String(d.getMinutes()).padStart(2, \"0\")}`;\n}\n\nexport interface AvailabilityForm {\n message: string;\n until: Date | null;\n zone: string;\n useHours: boolean;\n week: WeekHours;\n}\n\nexport function formFrom(mine: ChatAvailability | null, deviceZone: string): AvailabilityForm {\n return {\n message: mine?.awayMessage ?? \"\",\n until: mine?.awayUntil ? new Date(mine.awayUntil) : null,\n zone: mine?.timeZone ?? deviceZone,\n useHours: Boolean(mine?.hours && Object.keys(mine.hours).length),\n week: weekFromHours(mine?.hours),\n };\n}\n\n/** What `setAvailability` gets from the form. */\nexport function availabilityInput(form: AvailabilityForm, saved: ChatAvailability | null): AvailabilityInput {\n return {\n awayMessage: form.message.trim() || null,\n awayUntil: form.until ? form.until.toISOString() : null,\n timeZone: form.zone,\n hours: form.useHours ? hoursFromWeek(form.week, saved?.hours) : null,\n };\n}\n\nconst FALLBACK_ZONES = [\n \"UTC\", \"America/New_York\", \"America/Chicago\", \"America/Denver\", \"America/Los_Angeles\", \"America/Toronto\", \"America/Sao_Paulo\",\n \"Europe/London\", \"Europe/Paris\", \"Europe/Berlin\", \"Africa/Johannesburg\", \"Asia/Dubai\", \"Asia/Kolkata\", \"Asia/Singapore\",\n \"Asia/Tokyo\", \"Australia/Sydney\", \"Pacific/Auckland\",\n];\n\n/** Every IANA zone the engine knows (Hermes has `Intl.supportedValuesOf`), else a short list. */\nexport function timeZones(): string[] {\n const intl = Intl as unknown as { supportedValuesOf?: (key: string) => string[] };\n try {\n const all = intl.supportedValuesOf?.(\"timeZone\");\n if (all?.length) return all.includes(\"UTC\") ? all : [\"UTC\", ...all];\n } catch {\n // an older engine\n }\n return FALLBACK_ZONES;\n}\n\nexport function deviceTimeZone(): string {\n try {\n return Intl.DateTimeFormat().resolvedOptions().timeZone || \"UTC\";\n } catch {\n return \"UTC\";\n }\n}\n\nconst DAY_NAMES: Record<Weekday, string> = { mon: \"Monday\", tue: \"Tuesday\", wed: \"Wednesday\", thu: \"Thursday\", fri: \"Friday\", sat: \"Saturday\", sun: \"Sunday\" };\n\n/** A weekday's name in the device's language (`mon` → \"Monday\"). */\nfunction dayName(d: Weekday, locale?: string): string {\n // 2024-01-01 was a Monday.\n const date = new Date(2024, 0, 1 + WEEKDAYS.indexOf(d));\n try {\n return date.toLocaleDateString(locale, { weekday: \"long\" });\n } catch {\n return DAY_NAMES[d];\n }\n}\n\nexport interface ChatAvailabilityScreenProps {\n /** Called after a save (go back, say). */\n onSaved?: () => void;\n testID?: string;\n}\n\n/**\n * Your availability, as a Settings sub-page: an away message and, optionally, until when;\n * working hours per weekday (one range a day here; extra ranges saved elsewhere are kept for\n * the days you don't turn off); the time zone they're read in. Save at the bottom.\n */\nexport function ChatAvailabilityScreen({ onSaved, testID = \"chat-availability\" }: ChatAvailabilityScreenProps) {\n const { copy } = useChatNative();\n const colors = useThemeRoles();\n const toast = useToast();\n const { mine, mineLoading, setMine } = useAvailability();\n const zones = useMemo(() => timeZones(), []);\n const [form, setForm] = useState<AvailabilityForm>(() => formFrom(null, deviceTimeZone()));\n const [loaded, setLoaded] = useState(false);\n const [busy, setBusy] = useState(false);\n\n useEffect(() => {\n if (mineLoading || loaded) return;\n setForm(formFrom(mine, deviceTimeZone()));\n setLoaded(true);\n }, [mine, mineLoading, loaded]);\n\n const zoneOptions = useMemo(() => {\n const list = zones.includes(form.zone) ? zones : [form.zone, ...zones];\n return list.map((z) => ({ value: z, label: z.replace(/_/g, \" \") }));\n }, [zones, form.zone]);\n\n // A moment while yours is read (cached after the first time): the form fills in once it's here.\n if (mineLoading || !loaded) {\n return (\n <SettingsSubPage testID={testID}>\n <View testID={`${testID}-loading`} accessibilityState={{ busy: true }} />\n </SettingsSubPage>\n );\n }\n\n const bad = form.useHours ? sameTimeDays(form.week) : [];\n const set = (patch: Partial<AvailabilityForm>) => setForm((f) => ({ ...f, ...patch }));\n const setDay = (d: Weekday, patch: Partial<DayHours>) => setForm((f) => ({ ...f, week: { ...f.week, [d]: { ...f.week[d], ...patch } } }));\n\n const save = async () => {\n if (bad.length) return;\n setBusy(true);\n try {\n await setMine(availabilityInput(form, mine));\n toast.show({ title: copy.availabilitySaved, variant: \"success\", duration: 1500 });\n onSaved?.();\n } catch (e) {\n toast.show({ title: e instanceof Error ? e.message : copy.actionFailed, variant: \"destructive\" });\n } finally {\n setBusy(false);\n }\n };\n\n const tomorrow = () => {\n const d = new Date();\n d.setDate(d.getDate() + 1);\n d.setHours(9, 0, 0, 0);\n return d;\n };\n\n return (\n <SettingsSubPage testID={testID}>\n <View style={{ gap: 8 }}>\n <Section title={copy.awayMessage} />\n <NativeTextarea\n testID={`${testID}-message`}\n accessibilityLabel={copy.awayMessage}\n value={form.message}\n onChangeText={(message) => set({ message })}\n maxLength={280}\n placeholder={copy.awayMessagePlaceholder}\n rows={3}\n />\n <Row label={copy.awayUntilOn}>\n <NativeSwitch testID={`${testID}-until-on`} accessibilityLabel={copy.awayUntilOn} checked={form.until !== null} onCheckedChange={(on) => set({ until: on ? tomorrow() : null })} />\n </Row>\n {form.until ? (\n <Row label={copy.awayUntil}>\n <View style={{ flexDirection: \"row\", gap: 8 }}>\n <NativeDatePicker testID={`${testID}-until-date`} value={form.until} onChange={(d) => set({ until: withDay(form.until!, d) })} />\n <NativeTimePicker testID={`${testID}-until-time`} value={form.until} onChange={(d) => set({ until: withTime(form.until!, d) })} />\n </View>\n </Row>\n ) : null}\n {form.message || form.until ? (\n <View style={{ alignItems: \"flex-start\" }}>\n <NativeButton testID={`${testID}-back`} variant=\"ghost\" onPress={() => set({ message: \"\", until: null })}>\n {copy.imBack}\n </NativeButton>\n </View>\n ) : null}\n </View>\n\n <View style={{ gap: 8 }}>\n <Section title={copy.workingHours} />\n <Row label={copy.workingHoursOn}>\n <NativeSwitch testID={`${testID}-hours-on`} accessibilityLabel={copy.workingHoursOn} checked={form.useHours} onCheckedChange={(useHours) => set({ useHours })} />\n </Row>\n {form.useHours ? (\n <View accessibilityLabel={copy.workingHours} style={{ gap: 4 }}>\n {WEEKDAYS.map((d) => {\n const name = dayName(d);\n const day = form.week[d];\n return (\n <View key={d} testID={`${testID}-day-${d}`} style={{ flexDirection: \"row\", flexWrap: \"wrap\", alignItems: \"center\", gap: 8, minHeight: 44 }}>\n <NativeSwitch testID={`${testID}-day-${d}-on`} accessibilityLabel={fill(copy.workingDay, { name })} checked={day.on} onCheckedChange={(on) => setDay(d, { on })} />\n <NativeText preset=\"body\" style={{ minWidth: 96, color: day.on ? colors.label : colors.secondaryLabel }}>\n {name}\n </NativeText>\n {day.on ? (\n <View style={{ flexDirection: \"row\", alignItems: \"center\", gap: 4 }}>\n <NativeTimePicker testID={`${testID}-day-${d}-from`} value={clockToDate(day.from)} onChange={(t) => setDay(d, { from: dateToClock(t) })} />\n <NativeText accessibilityElementsHidden importantForAccessibility=\"no\">–</NativeText>\n <NativeTimePicker testID={`${testID}-day-${d}-to`} value={clockToDate(day.to)} onChange={(t) => setDay(d, { to: dateToClock(t) })} />\n </View>\n ) : (\n <NativeText preset=\"caption\" style={{ color: colors.secondaryLabel }}>\n {copy.notWorking}\n </NativeText>\n )}\n </View>\n );\n })}\n <NativeText testID={`${testID}-hours-hint`} preset=\"caption\" accessibilityLiveRegion=\"polite\" style={{ color: bad.length ? colors.destructive : colors.secondaryLabel }}>\n {bad.length ? copy.hoursSameTime : copy.workingHoursHint}\n </NativeText>\n </View>\n ) : null}\n </View>\n\n <View style={{ gap: 8 }}>\n <Section title={copy.timeZone} />\n <NativeCombobox testID={`${testID}-zone`} options={zoneOptions} value={form.zone} onChange={(zone) => set({ zone })} placeholder={copy.timeZoneSearch} />\n </View>\n\n <NativeButton testID={`${testID}-save`} onPress={() => void save()} loading={busy} disabled={bad.length > 0}>\n {copy.availabilitySave}\n </NativeButton>\n </SettingsSubPage>\n );\n}\n\nfunction Section({ title }: { title: string }) {\n const colors = useThemeRoles();\n return (\n <NativeText preset=\"label\" accessibilityRole=\"header\" style={{ color: colors.secondaryLabel, textTransform: \"uppercase\", letterSpacing: 0.5, marginTop: 8 }}>\n {title}\n </NativeText>\n );\n}\n\nfunction Row({ label, children }: { label: string; children: ReactNode }) {\n return (\n <View style={{ flexDirection: \"row\", flexWrap: \"wrap\", alignItems: \"center\", justifyContent: \"space-between\", gap: 8, minHeight: 44 }}>\n <NativeText preset=\"body\" style={{ flexShrink: 1 }}>\n {label}\n </NativeText>\n {children}\n </View>\n );\n}\n","/**\n * @feat:chat\n * A 44-point icon button (a header's Search, the topic bar's options): genesis-ui-native's\n * NativeIcon in a Pressable with its label, for VoiceOver and TalkBack.\n */\nimport { Pressable } from \"react-native\";\nimport { NativeIcon, type NativeIconName } from \"@marktiderman/genesis-ui-native/components\";\nimport { useThemeRoles } from \"@marktiderman/genesis-ui-native/hooks\";\n\nexport interface ChatIconButtonProps {\n icon: NativeIconName;\n /** Read by screen readers (the button has no text). */\n label: string;\n onPress: () => void;\n onLongPress?: () => void;\n disabled?: boolean;\n /** The theme's tint by default. */\n color?: unknown;\n size?: number;\n testID?: string;\n}\n\nexport function ChatIconButton({ icon, label, onPress, onLongPress, disabled = false, color, size = 22, testID }: ChatIconButtonProps) {\n const colors = useThemeRoles();\n return (\n <Pressable\n testID={testID}\n accessibilityRole=\"button\"\n accessibilityLabel={label}\n accessibilityState={{ disabled }}\n disabled={disabled}\n onPress={onPress}\n onLongPress={onLongPress}\n hitSlop={4}\n style={{ minWidth: 44, minHeight: 44, alignItems: \"center\", justifyContent: \"center\", opacity: disabled ? 0.4 : 1 }}\n >\n <NativeIcon name={icon} size={size} color={(color ?? colors.tint) as string} />\n </Pressable>\n );\n}\n","/**\n * @feat:chat\n * The topic bar on native: \"All\" and each of a conversation's topics as single-choice chips in a\n * row that scrolls sideways, a lock on closed ones, and, for owners and admins, an options button\n * that adds a topic and renames, closes or reopens the one shown (one sheet: the menu, then the\n * name field). `ChatThreadScreen` shows it when the conversation has topics, and reads the\n * messages of the topic chosen. The same rules as the web's `ChatTopicBar`.\n */\nimport { useCallback, useEffect, useRef, useState } from \"react\";\nimport { ScrollView, View, type LayoutChangeEvent } from \"react-native\";\nimport { NativeButton, NativeChip, NativeChipGroup, NativeIcon, NativeInput, NativeListItem, NativeSheet, NativeText, useToast } from \"@marktiderman/genesis-ui-native/components\";\nimport { useThemeRoles } from \"@marktiderman/genesis-ui-native/hooks\";\nimport { topicKey } from \"../core/extras\";\nimport type { ChatRole, ChatTopic, TopicInput } from \"../core/types\";\nimport { fill } from \"./copy\";\nimport { useChatNative } from \"./context\";\nimport { ChatIconButton } from \"./icon-button\";\n\nconst ALL = \"__all__\";\n\n/** Owners and admins add, rename, close and reopen topics. */\nexport function canManageTopics(role: ChatRole | null | undefined): boolean {\n return role === \"owner\" || role === \"admin\";\n}\n\n/** A closed topic takes posts only from owners, admins and observers. */\nexport function topicClosedFor(topic: ChatTopic | null | undefined, role: ChatRole | null | undefined): boolean {\n return Boolean(topic?.closedAt) && role !== \"owner\" && role !== \"admin\" && role !== \"observer\";\n}\n\nexport type TopicMenuAction = \"new\" | \"rename\" | \"close\" | \"reopen\";\n\n/** What the options sheet offers: always New; Rename and Close or Reopen when a topic is shown. */\nexport function topicMenuFor(current: ChatTopic | null | undefined): TopicMenuAction[] {\n if (!current) return [\"new\"];\n return [\"new\", \"rename\", current.closedAt ? \"reopen\" : \"close\"];\n}\n\n/**\n * Checks a topic's name: its key, or why it can't be saved. Renaming keeps the key (messages\n * carry it), so only a new topic can clash with another's key.\n */\nexport function checkTopicName(title: string, topics: readonly ChatTopic[], renaming?: string | null): { key: string } | { error: \"empty\" | \"exists\" } {\n const name = title.trim();\n if (!name) return { error: \"empty\" };\n if (renaming) return { key: renaming };\n const key = topicKey(name);\n return topics.some((t) => t.topic === key) ? { error: \"exists\" } : { key };\n}\n\n/**\n * Where the bar scrolls to so a chip shows whole (with `margin` to spare), or null when it already\n * does: a chip past the right edge comes in from the right, one before the left from the left.\n */\nexport function scrollToShow(chip: { x: number; width: number }, view: { offset: number; width: number }, margin = 8): number | null {\n if (view.width <= 0) return null;\n if (chip.x - margin < view.offset) return Math.max(0, chip.x - margin);\n if (chip.x + chip.width + margin > view.offset + view.width) return Math.max(0, chip.x + chip.width + margin - view.width);\n return null;\n}\n\nexport interface ChatTopicBarProps {\n topics: ChatTopic[];\n /** The topic shown; null for \"All\". */\n value: string | null;\n onValueChange: (topic: string | null) => void;\n /** Owners and admins (`canManageTopics(role)`): the options button. */\n canManage?: boolean;\n /** Saves a topic (`useTopics().setTopic`). */\n onSetTopic?: (topic: string, input: TopicInput) => Promise<void>;\n testID?: string;\n}\n\ntype SheetState = { step: \"menu\" } | { step: \"name\"; renaming: string | null };\n\nexport function ChatTopicBar({ topics, value, onValueChange, canManage = false, onSetTopic, testID = \"chat-topics\" }: ChatTopicBarProps) {\n const { copy } = useChatNative();\n const colors = useThemeRoles();\n const toast = useToast();\n const [sheet, setSheet] = useState<SheetState | null>(null);\n const [title, setTitle] = useState(\"\");\n const [busy, setBusy] = useState(false);\n const [error, setError] = useState<string | null>(null);\n const current = value ? (topics.find((t) => t.topic === value) ?? null) : null;\n\n // The chosen chip is scrolled into view: a topic just added sits at the end, past the edge.\n const scrollRef = useRef<{ scrollTo?: (o: { x: number; animated?: boolean }) => void } | null>(null);\n const chips = useRef(new Map<string, { x: number; width: number }>());\n const view = useRef({ offset: 0, width: 0 });\n const reveal = useCallback((key: string | null) => {\n const chip = chips.current.get(key ?? ALL);\n if (!chip) return;\n const to = scrollToShow(chip, view.current);\n if (to === null) return;\n view.current.offset = to;\n scrollRef.current?.scrollTo?.({ x: to, animated: true });\n }, []);\n const latestValue = useRef(value);\n latestValue.current = value;\n useEffect(() => reveal(value), [value, reveal]);\n const trackOffset = (e: { nativeEvent: { contentOffset: { x: number } } }) => {\n view.current.offset = e.nativeEvent.contentOffset.x;\n };\n const onChipLayout = (key: string) => (e: LayoutChangeEvent) => {\n const { x, width } = e.nativeEvent.layout;\n chips.current.set(key, { x, width });\n // A new topic is chosen before its chip exists: it is shown once the chip has its place.\n if (key === (latestValue.current ?? ALL)) reveal(latestValue.current);\n };\n\n const close = () => {\n if (busy) return;\n setSheet(null);\n setError(null);\n };\n\n const run = async (action: TopicMenuAction) => {\n if (action === \"new\" || action === \"rename\") {\n setTitle(action === \"rename\" ? (current?.title ?? \"\") : \"\");\n setError(null);\n setSheet({ step: \"name\", renaming: action === \"rename\" ? (current?.topic ?? null) : null });\n return;\n }\n if (!current || !onSetTopic) return;\n setSheet(null);\n try {\n await onSetTopic(current.topic, { closed: action === \"close\" });\n toast.show({ title: fill(action === \"close\" ? copy.topicClosedDone : copy.topicReopenedDone, { name: current.title }), variant: \"success\", duration: 1500 });\n } catch (e) {\n toast.show({ title: e instanceof Error ? e.message : copy.actionFailed, variant: \"destructive\" });\n }\n };\n\n const save = async (renaming: string | null) => {\n if (!onSetTopic) return;\n const checked = checkTopicName(title, topics, renaming);\n if (\"error\" in checked) {\n setError(checked.error === \"exists\" ? copy.topicExists : null);\n return;\n }\n setBusy(true);\n try {\n await onSetTopic(checked.key, renaming ? { title: title.trim() } : { title: title.trim(), position: topics.length });\n setSheet(null);\n setTitle(\"\");\n if (!renaming) onValueChange(checked.key);\n } catch (e) {\n setError(e instanceof Error ? e.message : copy.actionFailed);\n } finally {\n setBusy(false);\n }\n };\n\n return (\n <View testID={testID} style={{ flexDirection: \"row\", alignItems: \"center\", backgroundColor: colors.groupedBackground, paddingLeft: 8 }}>\n <ScrollView\n ref={scrollRef as never}\n horizontal\n showsHorizontalScrollIndicator={false}\n accessibilityLabel={copy.topics}\n contentContainerStyle={{ paddingVertical: 4, paddingRight: 8 }}\n style={{ flex: 1 }}\n onLayout={(e: LayoutChangeEvent) => {\n view.current.width = e.nativeEvent.layout.width;\n reveal(latestValue.current);\n }}\n onScroll={trackOffset}\n onScrollEndDrag={trackOffset}\n onMomentumScrollEnd={trackOffset}\n scrollEventThrottle={64}\n >\n <NativeChipGroup mode=\"single\" value={value ?? ALL} onChange={(v) => onValueChange(v === ALL ? null : (v as string))} className=\"flex-nowrap\" testID={`${testID}-group`}>\n <View onLayout={onChipLayout(ALL)}>\n <NativeChip value={ALL} testID={`${testID}-all`}>\n {copy.topicAll}\n </NativeChip>\n </View>\n {topics.map((t) => (\n <View key={t.topic} onLayout={onChipLayout(t.topic)}>\n <NativeChip value={t.topic} testID={`${testID}-${t.topic}`}>\n <View style={{ flexDirection: \"row\", alignItems: \"center\", gap: 4 }}>\n {t.closedAt ? <NativeIcon name=\"lock\" size={13} color={colors.secondaryLabel} label={copy.topicClosed} /> : null}\n <NativeText preset=\"body-sm\" numberOfLines={1} style={{ maxWidth: 180, fontWeight: value === t.topic ? \"600\" : \"400\", color: value === t.topic ? colors.tint : colors.label }}>\n {t.title}\n </NativeText>\n </View>\n </NativeChip>\n </View>\n ))}\n </NativeChipGroup>\n </ScrollView>\n {canManage && onSetTopic ? <ChatIconButton testID={`${testID}-menu`} icon=\"more\" label={copy.topicOptions} onPress={() => setSheet({ step: \"menu\" })} /> : null}\n <NativeSheet open={sheet !== null} onOpenChange={(o) => (o ? undefined : close())} fitContent testID={`${testID}-sheet`}>\n {sheet?.step === \"name\" ? (\n <View style={{ padding: 16, gap: 12 }}>\n <NativeText preset=\"h4\" accessibilityRole=\"header\">\n {sheet.renaming ? copy.topicRename : copy.topicNew}\n </NativeText>\n <NativeInput\n testID={`${testID}-name`}\n label={copy.topicName}\n value={title}\n onChangeText={(v) => {\n setTitle(v);\n setError(null);\n }}\n placeholder={copy.topicNamePlaceholder}\n maxLength={160}\n autoFocus\n returnKeyType=\"done\"\n onSubmitEditing={() => void save(sheet.renaming)}\n error={error ?? undefined}\n />\n <NativeButton testID={`${testID}-save`} onPress={() => void save(sheet.renaming)} loading={busy} disabled={!title.trim()}>\n {sheet.renaming ? copy.topicSave : copy.topicAdd}\n </NativeButton>\n </View>\n ) : (\n <View>\n {topicMenuFor(current).map((action) => (\n <NativeListItem\n key={action}\n testID={`${testID}-${action}`}\n title={action === \"new\" ? copy.topicNew : action === \"rename\" ? copy.topicRename : action === \"close\" ? copy.topicClose : copy.topicReopen}\n leading={<NativeIcon name={action === \"new\" ? \"plus\" : action === \"rename\" ? \"edit\" : \"lock\"} />}\n onPress={() => void run(action)}\n />\n ))}\n </View>\n )}\n </NativeSheet>\n </View>\n );\n}\n","/**\n * @feat:chat\n * Going to one message in a thread (a search result, a pinned message): earlier pages load until\n * it is held (`useConversation().loadUntil(seq)`), then the list scrolls to it and it is\n * highlighted for two seconds. A message that can't be found (deleted, or out of reach) says so.\n */\nimport { useCallback, useEffect, useRef, useState } from \"react\";\nimport type { ThreadRow } from \"./rows\";\n\nexport interface JumpTarget {\n messageId: string;\n seq?: number;\n}\n\n/** The row a message is drawn in, or -1. */\nexport function rowIndexOf(rows: readonly ThreadRow[], messageId: string): number {\n return rows.findIndex((r) => r.type === \"message\" && r.item.type === \"message\" && r.item.message.id === messageId);\n}\n\nexport interface UseJumpOptions {\n /** What to go to; a new target (another id or seq) starts again. */\n target: JumpTarget | null | undefined;\n rows: readonly ThreadRow[];\n /** The thread's first page is still loading. */\n loading: boolean;\n has: (messageId: string) => boolean;\n loadUntil: (seq: number) => Promise<boolean>;\n /** Scroll the list to this row (centred); the message id, for a retry once rows have moved. */\n scrollTo: (index: number, messageId: string) => void;\n /** Called before loading or scrolling (stop following the bottom). */\n onStart?: () => void;\n /** It was scrolled to (say so to VoiceOver). */\n onLanded?: (messageId: string) => void;\n /** It isn't there any more (go back to where the thread was). */\n onGone: () => void;\n onError: (e: unknown) => void;\n}\n\ntype Pending = JumpTarget & { phase: \"new\" | \"loading\" | \"loaded\" };\n\nexport function useJumpToMessage({ target, rows, loading, has, loadUntil, scrollTo, onStart, onLanded, onGone, onError }: UseJumpOptions) {\n const [pending, setPending] = useState<Pending | null>(target ? { ...target, phase: \"new\" } : null);\n const [highlightedId, setHighlightedId] = useState<string | null>(null);\n useEffect(() => {\n if (target) setPending({ ...target, phase: \"new\" });\n }, [target?.messageId, target?.seq]); // eslint-disable-line react-hooks/exhaustive-deps\n\n const latest = useRef({ rows, scrollTo, onStart, onLanded, onGone, onError });\n latest.current = { rows, scrollTo, onStart, onLanded, onGone, onError };\n const timer = useRef<ReturnType<typeof setTimeout> | null>(null);\n useEffect(() => () => {\n if (timer.current) clearTimeout(timer.current);\n }, []);\n\n const go = useCallback((messageId: string) => {\n const index = rowIndexOf(latest.current.rows, messageId);\n if (index < 0) return;\n latest.current.onStart?.();\n latest.current.scrollTo(index, messageId);\n latest.current.onLanded?.(messageId);\n setHighlightedId(messageId);\n if (timer.current) clearTimeout(timer.current);\n timer.current = setTimeout(() => setHighlightedId((h) => (h === messageId ? null : h)), 2000);\n }, []);\n\n useEffect(() => {\n if (!pending || loading) return;\n const { messageId, seq, phase } = pending;\n if (has(messageId)) {\n setPending(null);\n go(messageId);\n return;\n }\n if (phase === \"loading\") return;\n if (phase === \"loaded\" || seq == null) {\n setPending(null);\n latest.current.onGone();\n return;\n }\n latest.current.onStart?.();\n setPending({ messageId, seq, phase: \"loading\" });\n const settle = () => setPending((p) => (p && p.messageId === messageId ? { ...p, phase: \"loaded\" } : p));\n void loadUntil(seq).then(settle, (e) => {\n latest.current.onError(e);\n // Not found after all: the \"loaded\" step says so and puts the thread back.\n settle();\n });\n }, [pending, loading, has, loadUntil, go]);\n\n return { highlightedId, jumping: pending !== null };\n}\n","/**\n * @feat:chat\n * Generated by scripts/build-emoji-data.mjs from emojibase-data 16.0.3 (MIT,\n * https://github.com/milesj/emojibase). Don't edit: run the script.\n *\n * Each group is one string, a line per emoji: the emoji, its label and its search tags,\n * separated by tabs. Bundled, never fetched.\n */\nexport const EMOJI_DATA_SOURCE = \"emojibase-data@16.0.3, Emoji 15.0 and earlier\";\n\nexport const EMOJI_GROUP_DATA = {\n smileys: \"😀\\tgrinning face\\tcheerful cheery grin\\n😃\\tgrinning face with big eyes\\tawesome grin happy\\n😄\\tgrinning face with smiling eyes\\teye grin happy\\n😁\\tbeaming face with smiling eyes\\teye grin grinning\\n😆\\tgrinning squinting face\\tclosed eyes haha\\n😅\\tgrinning face with sweat\\tcold dejected excited\\n🤣\\trolling on the floor laughing\\tcrying face funny\\n😂\\tface with tears of joy\\tcrying feels funny\\n🙂\\tslightly smiling face\\thappy smile\\n🙃\\tupside-down face\\thehe smile upside-down\\n🫠\\tmelting face\\tdisappear dissolve embarrassed\\n😉\\twinking face\\tflirt heartbreaker sexy\\n😊\\tsmiling face with smiling eyes\\tblush eye glad\\n😇\\tsmiling face with halo\\tangel angelic angels\\n🥰\\tsmiling face with hearts\\t3 adore crush\\n😍\\tsmiling face with heart-eyes\\t143 bae eye\\n🤩\\tstar-struck\\texcited eyes face\\n😘\\tface blowing a kiss\\tadorbs bae flirt\\n😗\\tkissing face\\t143 date dating\\n☺️\\tsmiling face\\thappy outlined relaxed\\n😚\\tkissing face with closed eyes\\t143 bae blush\\n😙\\tkissing face with smiling eyes\\t143 closed date\\n🥲\\tsmiling face with tear\\tglad grateful happy\\n😋\\tface savoring food\\tdelicious eat full\\n😛\\tface with tongue\\tawesome cool nice\\n😜\\twinking face with tongue\\tcrazy epic eye\\n🤪\\tzany face\\tcrazy eye eyes\\n😝\\tsquinting face with tongue\\tclosed eye eyes\\n🤑\\tmoney-mouth face\\tmoney-mouth paid\\n🤗\\tsmiling face with open hands\\thug hugging\\n🤭\\tface with hand over mouth\\tgiggle giggling oops\\n🫢\\tface with open eyes and hand over mouth\\tamazement awe disbelief\\n🫣\\tface with peeking eye\\tcaptivated embarrass hide\\n🤫\\tshushing face\\tquiet shh shush\\n🤔\\tthinking face\\tchin consider hmm\\n🫡\\tsaluting face\\tgood luck ma’am\\n🤐\\tzipper-mouth face\\tkeep quiet secret\\n🤨\\tface with raised eyebrow\\tdisapproval disbelief distrust\\n😐\\tneutral face\\tawkward blank deadpan\\n😑\\texpressionless face\\tawkward dead fine\\n😶\\tface without mouth\\tawkward blank expressionless\\n🫥\\tdotted line face\\tdepressed disappear hidden\\n😶🌫️\\tface in clouds\\tabsentminded fog head\\n😏\\tsmirking face\\tboss dapper flirt\\n😒\\tunamused face\\t... bored fine\\n🙄\\tface with rolling eyes\\teyeroll shade ugh\\n😬\\tgrimacing face\\tawk awkward dentist\\n😮💨\\tface exhaling\\tblow blowing exhale\\n🤥\\tlying face\\tliar lie pinocchio\\n🫨\\tshaking face\\tcrazy daze earthquake\\n😌\\trelieved face\\tcalm peace relief\\n😔\\tpensive face\\tawful bored dejected\\n😪\\tsleepy face\\tcrying good night\\n🤤\\tdrooling face\\t\\n😴\\tsleeping face\\tbed bedtime good\\n😷\\tface with medical mask\\tcold dentist dermatologist\\n🤒\\tface with thermometer\\till sick\\n🤕\\tface with head-bandage\\thead-bandage hurt injury\\n🤢\\tnauseated face\\tgross nasty sick\\n🤮\\tface vomiting\\tbarf ew gross\\n🤧\\tsneezing face\\tfever flu gesundheit\\n🥵\\thot face\\tdying feverish heat\\n🥶\\tcold face\\tblue blue-faced freezing\\n🥴\\twoozy face\\tdizzy drunk eyes\\n😵\\tface with crossed-out eyes\\tcrossed-out dead dizzy\\n😵💫\\tface with spiral eyes\\tconfused dizzy hypnotized\\n🤯\\texploding head\\tblown explode mind\\n🤠\\tcowboy hat face\\tcowgirl\\n🥳\\tpartying face\\tbday birthday celebrate\\n🥸\\tdisguised face\\tdisguise eyebrow glasses\\n😎\\tsmiling face with sunglasses\\tawesome beach bright\\n🤓\\tnerd face\\tbrainy clever expert\\n🧐\\tface with monocle\\tclassy fancy rich\\n😕\\tconfused face\\tbefuddled confusing dunno\\n🫤\\tface with diagonal mouth\\tconfused confusion disappointed\\n😟\\tworried face\\tanxious butterflies nerves\\n🙁\\tslightly frowning face\\tfrown sad\\n☹️\\tfrowning face\\tfrown sad\\n😮\\tface with open mouth\\tbelieve forgot omg\\n😯\\thushed face\\tepic omg stunned\\n😲\\tastonished face\\tcost no omg\\n😳\\tflushed face\\tamazed awkward crazy\\n🥺\\tpleading face\\tbegging big eyes\\n🥹\\tface holding back tears\\tadmiration aww cry\\n😦\\tfrowning face with open mouth\\tcaught frown guard\\n😧\\tanguished face\\tforgot scared scary\\n😨\\tfearful face\\tafraid anxious blame\\n😰\\tanxious face with sweat\\tblue cold eek\\n😥\\tsad but relieved face\\tanxious call close\\n😢\\tcrying face\\tawful cry feels\\n😭\\tloudly crying face\\tbawling cry sad\\n😱\\tface screaming in fear\\tepic fearful munch\\n😖\\tconfounded face\\tannoyed confused cringe\\n😣\\tpersevering face\\tconcentrate concentration focus\\n😞\\tdisappointed face\\tawful blame dejected\\n😓\\tdowncast face with sweat\\tclose cold feels\\n😩\\tweary face\\tcrying fail feels\\n😫\\ttired face\\tcost feels nap\\n🥱\\tyawning face\\tbedtime bored goodnight\\n😤\\tface with steam from nose\\tanger angry feels\\n😡\\tenraged face\\tanger angry feels\\n😠\\tangry face\\tanger blame feels\\n🤬\\tface with symbols on mouth\\tcensor cursing cussing\\n😈\\tsmiling face with horns\\tdemon devil evil\\n👿\\tangry face with horns\\tdemon devil evil\\n💀\\tskull\\tbody dead death\\n☠️\\tskull and crossbones\\tbone dead death\\n💩\\tpile of poo\\tbs comic doo\\n🤡\\tclown face\\t\\n👹\\togre\\tcreature devil face\\n👺\\tgoblin\\tangry creature face\\n👻\\tghost\\tboo creature excited\\n👽\\talien\\tcreature extraterrestrial face\\n👾\\talien monster\\tcreature extraterrestrial face\\n🤖\\trobot\\tface monster\\n😺\\tgrinning cat\\tanimal face mouth\\n😸\\tgrinning cat with smiling eyes\\tanimal eye face\\n😹\\tcat with tears of joy\\tanimal face laugh\\n😻\\tsmiling cat with heart-eyes\\tanimal eye face\\n😼\\tcat with wry smile\\tanimal face ironic\\n😽\\tkissing cat\\tanimal closed eye\\n🙀\\tweary cat\\tanimal face oh\\n😿\\tcrying cat\\tanimal cry face\\n😾\\tpouting cat\\tanimal face\\n🙈\\tsee-no-evil monkey\\tembarrassed face forbidden\\n🙉\\thear-no-evil monkey\\tanimal ears face\\n🙊\\tspeak-no-evil monkey\\tanimal face forbidden\\n💌\\tlove letter\\theart mail romance\\n💘\\theart with arrow\\t143 adorbs cupid\\n💝\\theart with ribbon\\t143 anniversary emotion\\n💖\\tsparkling heart\\t143 emotion excited\\n💗\\tgrowing heart\\t143 emotion excited\\n💓\\tbeating heart\\t143 cardio emotion\\n💞\\trevolving hearts\\t143 adorbs anniversary\\n💕\\ttwo hearts\\t143 anniversary date\\n💟\\theart decoration\\t143 emotion hearth\\n❣️\\theart exclamation\\theavy mark punctuation\\n💔\\tbroken heart\\tbreak crushed emotion\\n❤️🔥\\theart on fire\\tburn love lust\\n❤️🩹\\tmending heart\\thealthier improving recovering\\n❤️\\tred heart\\temotion love\\n🩷\\tpink heart\\t143 adorable cute\\n🧡\\torange heart\\t143\\n💛\\tyellow heart\\t143 cardiac emotion\\n💚\\tgreen heart\\t143 emotion ily\\n💙\\tblue heart\\t143 emotion ily\\n🩵\\tlight blue heart\\t143 cute cyan\\n💜\\tpurple heart\\t143 bestest emotion\\n🤎\\tbrown heart\\t143\\n🖤\\tblack heart\\tevil wicked\\n🩶\\tgrey heart\\t143 emotion gray\\n🤍\\twhite heart\\t143\\n💋\\tkiss mark\\tdating emotion heart\\n💯\\thundred points\\t100 a+ agree\\n💢\\tanger symbol\\tangry comic mad\\n💥\\tcollision\\tbomb boom collide\\n💫\\tdizzy\\tcomic shining shooting\\n💦\\tsweat droplets\\tcomic drip droplet\\n💨\\tdashing away\\tcloud comic dash\\n🕳️\\thole\\t\\n💬\\tspeech balloon\\tbubble comic dialog\\n👁️🗨️\\teye in speech bubble\\tballoon witness\\n🗨️\\tleft speech bubble\\tballoon dialog\\n🗯️\\tright anger bubble\\tangry balloon mad\\n💭\\tthought balloon\\tbubble cartoon cloud\\n💤\\tZZZ\\tcomic good goodnight\",\n people: \"👋\\twaving hand\\tbye cya g2g\\n🤚\\traised back of hand\\tbackhand\\n🖐️\\thand with fingers splayed\\tfinger raised stop\\n✋\\traised hand\\t5 five high\\n🖖\\tvulcan salute\\tfinger hand hands\\n🫱\\trightwards hand\\thandshake hold reach\\n🫲\\tleftwards hand\\thandshake hold left\\n🫳\\tpalm down hand\\tdismiss drop dropped\\n🫴\\tpalm up hand\\tbeckon catch come\\n🫷\\tleftwards pushing hand\\tblock five halt\\n🫸\\trightwards pushing hand\\tblock five halt\\n👌\\tOK hand\\tawesome bet dope\\n🤌\\tpinched fingers\\tgesture hand hold\\n🤏\\tpinching hand\\tamount bit fingers\\n✌️\\tvictory hand\\tpeace v\\n🤞\\tcrossed fingers\\tcross finger hand\\n🫰\\thand with index finger and thumb crossed\\t<3 expensive heart\\n🤟\\tlove-you gesture\\tfingers hand ily\\n🤘\\tsign of the horns\\tfinger hand rock-on\\n🤙\\tcall me hand\\thang loose shaka\\n👈\\tbackhand index pointing left\\tfinger hand point\\n👉\\tbackhand index pointing right\\tfinger hand point\\n👆\\tbackhand index pointing up\\tfinger hand point\\n🖕\\tmiddle finger\\thand\\n👇\\tbackhand index pointing down\\tfinger hand point\\n☝️\\tindex pointing up\\tfinger hand point\\n🫵\\tindex pointing at the viewer\\tfinger hand poke\\n👍\\tthumbs up\\t+1 good hand\\n👎\\tthumbs down\\t-1 bad dislike\\n✊\\traised fist\\tclenched hand punch\\n👊\\toncoming fist\\tabsolutely agree boom\\n🤛\\tleft-facing fist\\tleft-facing leftwards\\n🤜\\tright-facing fist\\tright-facing rightwards\\n👏\\tclapping hands\\tapplause approval awesome\\n🙌\\traising hands\\tcelebration gesture hand\\n🫶\\theart hands\\t<3 love you\\n👐\\topen hands\\thand hug jazz\\n🤲\\tpalms up together\\tcupped dua hands\\n🤝\\thandshake\\tagreement deal hand\\n🙏\\tfolded hands\\tappreciate ask beg\\n✍️\\twriting hand\\twrite\\n💅\\tnail polish\\tbored care cosmetics\\n🤳\\tselfie\\tcamera phone\\n💪\\tflexed biceps\\tarm beast bench\\n🦾\\tmechanical arm\\taccessibility prosthetic\\n🦿\\tmechanical leg\\taccessibility prosthetic\\n🦵\\tleg\\tbent foot kick\\n🦶\\tfoot\\tankle feet kick\\n👂\\tear\\tbody ears hear\\n🦻\\tear with hearing aid\\taccessibility hard\\n👃\\tnose\\tbody noses nosey\\n🧠\\tbrain\\tintelligent smart\\n🫀\\tanatomical heart\\tbeat cardiology heartbeat\\n🫁\\tlungs\\tbreath breathe exhalation\\n🦷\\ttooth\\tdentist pearly teeth\\n🦴\\tbone\\tbones dog skeleton\\n👀\\teyes\\tbody eye face\\n👁️\\teye\\t1 body one\\n👅\\ttongue\\tbody lick slurp\\n👄\\tmouth\\tbeauty body kiss\\n🫦\\tbiting lip\\tanxious bite fear\\n👶\\tbaby\\tbabies children goo\\n🧒\\tchild\\tbright-eyed grandchild kid\\n👦\\tboy\\tbright-eyed child grandson\\n👧\\tgirl\\tbright-eyed child daughter\\n🧑\\tperson\\tadult\\n👱\\tperson: blond hair\\tblond-haired human\\n👨\\tman\\tadult bro\\n🧔\\tperson: beard\\tbearded whiskers\\n🧔♂️\\tman: beard\\tbearded whiskers\\n🧔♀️\\twoman: beard\\tbearded whiskers\\n👨🦰\\tman: red hair\\tadult bro red hair\\n👨🦱\\tman: curly hair\\tadult bro curly hair\\n👨🦳\\tman: white hair\\tadult bro white hair\\n👨🦲\\tman: bald\\tadult bro\\n👩\\twoman\\tadult lady\\n👩🦰\\twoman: red hair\\tadult lady red hair\\n🧑🦰\\tperson: red hair\\tadult red hair\\n👩🦱\\twoman: curly hair\\tadult curly hair lady\\n🧑🦱\\tperson: curly hair\\tadult curly hair\\n👩🦳\\twoman: white hair\\tadult lady white hair\\n🧑🦳\\tperson: white hair\\tadult white hair\\n👩🦲\\twoman: bald\\tadult lady\\n🧑🦲\\tperson: bald\\tadult\\n👱♀️\\twoman: blond hair\\tblond-haired blonde\\n👱♂️\\tman: blond hair\\tblond-haired\\n🧓\\tolder person\\tadult elderly grandparent\\n👴\\told man\\tadult bald elderly\\n👵\\told woman\\tadult elderly grandma\\n🙍\\tperson frowning\\tannoyed disappointed disgruntled\\n🙍♂️\\tman frowning\\tannoyed disappointed disgruntled\\n🙍♀️\\twoman frowning\\tannoyed disappointed disgruntled\\n🙎\\tperson pouting\\tdisappointed downtrodden frown\\n🙎♂️\\tman pouting\\tdisappointed downtrodden frown\\n🙎♀️\\twoman pouting\\tdisappointed downtrodden frown\\n🙅\\tperson gesturing NO\\tforbidden gesture hand\\n🙅♂️\\tman gesturing NO\\tforbidden gesture hand\\n🙅♀️\\twoman gesturing NO\\tforbidden gesture hand\\n🙆\\tperson gesturing OK\\texercise gesture hand\\n🙆♂️\\tman gesturing OK\\texercise gesture hand\\n🙆♀️\\twoman gesturing OK\\texercise gesture hand\\n💁\\tperson tipping hand\\tfetch flick flip\\n💁♂️\\tman tipping hand\\tfetch flick flip\\n💁♀️\\twoman tipping hand\\tfetch flick flip\\n🙋\\tperson raising hand\\tgesture here know\\n🙋♂️\\tman raising hand\\tgesture here know\\n🙋♀️\\twoman raising hand\\tgesture here know\\n🧏\\tdeaf person\\taccessibility ear gesture\\n🧏♂️\\tdeaf man\\taccessibility ear gesture\\n🧏♀️\\tdeaf woman\\taccessibility ear gesture\\n🙇\\tperson bowing\\tapology ask beg\\n🙇♂️\\tman bowing\\tapology ask beg\\n🙇♀️\\twoman bowing\\tapology ask beg\\n🤦\\tperson facepalming\\tagain bewilder disbelief\\n🤦♂️\\tman facepalming\\tagain bewilder disbelief\\n🤦♀️\\twoman facepalming\\tagain bewilder disbelief\\n🤷\\tperson shrugging\\tdoubt dunno guess\\n🤷♂️\\tman shrugging\\tdoubt dunno guess\\n🤷♀️\\twoman shrugging\\tdoubt dunno guess\\n🧑⚕️\\thealth worker\\tdoctor healthcare nurse\\n👨⚕️\\tman health worker\\tdoctor healthcare nurse\\n👩⚕️\\twoman health worker\\tdoctor healthcare nurse\\n🧑🎓\\tstudent\\tgraduate\\n👨🎓\\tman student\\tgraduate\\n👩🎓\\twoman student\\tgraduate\\n🧑🏫\\tteacher\\tinstructor lecturer professor\\n👨🏫\\tman teacher\\tinstructor lecturer professor\\n👩🏫\\twoman teacher\\tinstructor lecturer professor\\n🧑⚖️\\tjudge\\tjustice law scales\\n👨⚖️\\tman judge\\tjustice law scales\\n👩⚖️\\twoman judge\\tjustice law scales\\n🧑🌾\\tfarmer\\tgardener rancher\\n👨🌾\\tman farmer\\tgardener rancher\\n👩🌾\\twoman farmer\\tgardener rancher\\n🧑🍳\\tcook\\tchef\\n👨🍳\\tman cook\\tchef\\n👩🍳\\twoman cook\\tchef\\n🧑🔧\\tmechanic\\telectrician plumber tradesperson\\n👨🔧\\tman mechanic\\telectrician plumber tradesperson\\n👩🔧\\twoman mechanic\\telectrician plumber tradesperson\\n🧑🏭\\tfactory worker\\tassembly industrial\\n👨🏭\\tman factory worker\\tassembly industrial\\n👩🏭\\twoman factory worker\\tassembly industrial\\n🧑💼\\toffice worker\\tarchitect business manager\\n👨💼\\tman office worker\\tarchitect business manager\\n👩💼\\twoman office worker\\tarchitect business manager\\n🧑🔬\\tscientist\\tbiologist chemist engineer\\n👨🔬\\tman scientist\\tbiologist chemist engineer\\n👩🔬\\twoman scientist\\tbiologist chemist engineer\\n🧑💻\\ttechnologist\\tcoder computer developer\\n👨💻\\tman technologist\\tcoder computer developer\\n👩💻\\twoman technologist\\tcoder computer developer\\n🧑🎤\\tsinger\\tactor entertainer rock\\n👨🎤\\tman singer\\tactor entertainer rock\\n👩🎤\\twoman singer\\tactor entertainer rock\\n🧑🎨\\tartist\\tpalette\\n👨🎨\\tman artist\\tpalette\\n👩🎨\\twoman artist\\tpalette\\n🧑✈️\\tpilot\\tplane\\n👨✈️\\tman pilot\\tplane\\n👩✈️\\twoman pilot\\tplane\\n🧑🚀\\tastronaut\\trocket space\\n👨🚀\\tman astronaut\\trocket space\\n👩🚀\\twoman astronaut\\trocket space\\n🧑🚒\\tfirefighter\\tfire firetruck\\n👨🚒\\tman firefighter\\tfire firetruck\\n👩🚒\\twoman firefighter\\tfire firetruck\\n👮\\tpolice officer\\tapprehend arrest citation\\n👮♂️\\tman police officer\\tapprehend arrest citation\\n👮♀️\\twoman police officer\\tapprehend arrest citation\\n🕵️\\tdetective\\tsleuth spy\\n🕵️♂️\\tman detective\\tsleuth spy\\n🕵️♀️\\twoman detective\\tsleuth spy\\n💂\\tguard\\tbuckingham helmet london\\n💂♂️\\tman guard\\tbuckingham helmet london\\n💂♀️\\twoman guard\\tbuckingham helmet london\\n🥷\\tninja\\tassassin fight fighter\\n👷\\tconstruction worker\\tbuild fix hardhat\\n👷♂️\\tman construction worker\\tbuild fix hardhat\\n👷♀️\\twoman construction worker\\tbuild fix hardhat\\n🫅\\tperson with crown\\tmonarch noble regal\\n🤴\\tprince\\tcrown fairy fairytale\\n👸\\tprincess\\tcrown fairy fairytale\\n👳\\tperson wearing turban\\t\\n👳♂️\\tman wearing turban\\t\\n👳♀️\\twoman wearing turban\\t\\n👲\\tperson with skullcap\\tcap chinese gua\\n🧕\\twoman with headscarf\\tbandana head hijab\\n🤵\\tperson in tuxedo\\tformal wedding\\n🤵♂️\\tman in tuxedo\\tformal groom wedding\\n🤵♀️\\twoman in tuxedo\\tformal wedding\\n👰\\tperson with veil\\twedding\\n👰♂️\\tman with veil\\twedding\\n👰♀️\\twoman with veil\\tbride wedding\\n🤰\\tpregnant woman\\t\\n🫃\\tpregnant man\\tbelly bloated full\\n🫄\\tpregnant person\\tbelly bloated full\\n🤱\\tbreast-feeding\\tbaby mom mother\\n👩🍼\\twoman feeding baby\\tfeed mom mother\\n👨🍼\\tman feeding baby\\tdad father feed\\n🧑🍼\\tperson feeding baby\\tfeed nanny newborn\\n👼\\tbaby angel\\tchurch face fairy\\n🎅\\tSanta Claus\\tcelebration christmas fairy\\n🤶\\tMrs. Claus\\tcelebration christmas fairy\\n🧑🎄\\tMx Claus\\tcelebration christmas fairy\\n🦸\\tsuperhero\\tgood hero superpower\\n🦸♂️\\tman superhero\\tgood hero superpower\\n🦸♀️\\twoman superhero\\tgood hero heroine\\n🦹\\tsupervillain\\tbad criminal evil\\n🦹♂️\\tman supervillain\\tbad criminal evil\\n🦹♀️\\twoman supervillain\\tbad criminal evil\\n🧙\\tmage\\tfantasy magic play\\n🧙♂️\\tman mage\\tfantasy magic play\\n🧙♀️\\twoman mage\\tfantasy magic play\\n🧚\\tfairy\\tfairytale fantasy myth\\n🧚♂️\\tman fairy\\tfairytale fantasy myth\\n🧚♀️\\twoman fairy\\tfairytale fantasy myth\\n🧛\\tvampire\\tblood dracula fangs\\n🧛♂️\\tman vampire\\tblood fangs halloween\\n🧛♀️\\twoman vampire\\tblood fangs halloween\\n🧜\\tmerperson\\tcreature fairytale folklore\\n🧜♂️\\tmerman\\tcreature fairytale folklore\\n🧜♀️\\tmermaid\\tcreature fairytale folklore\\n🧝\\telf\\telves enchantment fantasy\\n🧝♂️\\tman elf\\telves enchantment fantasy\\n🧝♀️\\twoman elf\\telves enchantment fantasy\\n🧞\\tgenie\\tdjinn fantasy jinn\\n🧞♂️\\tman genie\\tdjinn fantasy jinn\\n🧞♀️\\twoman genie\\tdjinn fantasy jinn\\n🧟\\tzombie\\tapocalypse dead halloween\\n🧟♂️\\tman zombie\\tapocalypse dead halloween\\n🧟♀️\\twoman zombie\\tapocalypse dead halloween\\n🧌\\ttroll\\tfairy fantasy monster\\n💆\\tperson getting massage\\tface headache relax\\n💆♂️\\tman getting massage\\tface headache relax\\n💆♀️\\twoman getting massage\\tface headache relax\\n💇\\tperson getting haircut\\tbarber beauty chop\\n💇♂️\\tman getting haircut\\tbarber beauty chop\\n💇♀️\\twoman getting haircut\\tbarber beauty chop\\n🚶\\tperson walking\\tamble gait hike\\n🚶♂️\\tman walking\\tamble gait hike\\n🚶♀️\\twoman walking\\tamble gait hike\\n🧍\\tperson standing\\tstand\\n🧍♂️\\tman standing\\tstand\\n🧍♀️\\twoman standing\\tstand\\n🧎\\tperson kneeling\\tkneel knees\\n🧎♂️\\tman kneeling\\tkneel knees\\n🧎♀️\\twoman kneeling\\tkneel knees\\n🧑🦯\\tperson with white cane\\taccessibility blind probing\\n👨🦯\\tman with white cane\\taccessibility blind probing\\n👩🦯\\twoman with white cane\\taccessibility blind probing\\n🧑🦼\\tperson in motorized wheelchair\\taccessibility\\n👨🦼\\tman in motorized wheelchair\\taccessibility\\n👩🦼\\twoman in motorized wheelchair\\taccessibility\\n🧑🦽\\tperson in manual wheelchair\\taccessibility\\n👨🦽\\tman in manual wheelchair\\taccessibility\\n👩🦽\\twoman in manual wheelchair\\taccessibility\\n🏃\\tperson running\\tfast hurry marathon\\n🏃♂️\\tman running\\tfast hurry marathon\\n🏃♀️\\twoman running\\tfast hurry marathon\\n💃\\twoman dancing\\tdance dancer elegant\\n🕺\\tman dancing\\tdance dancer elegant\\n🕴️\\tperson in suit levitating\\tbusiness\\n👯\\tpeople with bunny ears\\tbestie bff counterpart\\n👯♂️\\tmen with bunny ears\\tbestie bff counterpart\\n👯♀️\\twomen with bunny ears\\tbestie bff counterpart\\n🧖\\tperson in steamy room\\tday luxurious pamper\\n🧖♂️\\tman in steamy room\\tday luxurious pamper\\n🧖♀️\\twoman in steamy room\\tday luxurious pamper\\n🧗\\tperson climbing\\tclimb climber mountain\\n🧗♂️\\tman climbing\\tclimb climber mountain\\n🧗♀️\\twoman climbing\\tclimb climber mountain\\n🤺\\tperson fencing\\tfencer sword\\n🏇\\thorse racing\\tjockey racehorse riding\\n⛷️\\tskier\\tski snow\\n🏂\\tsnowboarder\\tski snow snowboard\\n🏌️\\tperson golfing\\tball birdie caddy\\n🏌️♂️\\tman golfing\\tball birdie caddy\\n🏌️♀️\\twoman golfing\\tball birdie caddy\\n🏄\\tperson surfing\\tbeach ocean sport\\n🏄♂️\\tman surfing\\tbeach ocean sport\\n🏄♀️\\twoman surfing\\tbeach ocean person\\n🚣\\tperson rowing boat\\tcanoe cruise fishing\\n🚣♂️\\tman rowing boat\\tcanoe cruise fishing\\n🚣♀️\\twoman rowing boat\\tcanoe cruise fishing\\n🏊\\tperson swimming\\tfreestyle sport swim\\n🏊♂️\\tman swimming\\tfreestyle sport swim\\n🏊♀️\\twoman swimming\\tfreestyle man sport\\n⛹️\\tperson bouncing ball\\tathletic basketball championship\\n⛹️♂️\\tman bouncing ball\\tathletic basketball championship\\n⛹️♀️\\twoman bouncing ball\\tathletic basketball championship\\n🏋️\\tperson lifting weights\\tbarbell bodybuilder deadlift\\n🏋️♂️\\tman lifting weights\\tbarbell bodybuilder deadlift\\n🏋️♀️\\twoman lifting weights\\tbarbell bodybuilder deadlift\\n🚴\\tperson biking\\tbicycle bicyclist bike\\n🚴♂️\\tman biking\\tbicycle bicyclist bike\\n🚴♀️\\twoman biking\\tbicycle bicyclist bike\\n🚵\\tperson mountain biking\\tbicycle bicyclist bike\\n🚵♂️\\tman mountain biking\\tbicycle bicyclist bike\\n🚵♀️\\twoman mountain biking\\tbicycle bicyclist bike\\n🤸\\tperson cartwheeling\\tactive cartwheel excited\\n🤸♂️\\tman cartwheeling\\tactive cartwheel excited\\n🤸♀️\\twoman cartwheeling\\tactive cartwheel excited\\n🤼\\tpeople wrestling\\tcombat duel grapple\\n🤼♂️\\tmen wrestling\\tcombat duel grapple\\n🤼♀️\\twomen wrestling\\tcombat duel grapple\\n🤽\\tperson playing water polo\\tsport swimming waterpolo\\n🤽♂️\\tman playing water polo\\tsport swimming waterpolo\\n🤽♀️\\twoman playing water polo\\tsport swimming waterpolo\\n🤾\\tperson playing handball\\tathletics ball catch\\n🤾♂️\\tman playing handball\\tathletics ball catch\\n🤾♀️\\twoman playing handball\\tathletics ball catch\\n🤹\\tperson juggling\\tact balance balancing\\n🤹♂️\\tman juggling\\tact balance balancing\\n🤹♀️\\twoman juggling\\tact balance balancing\\n🧘\\tperson in lotus position\\tcross legged legs\\n🧘♂️\\tman in lotus position\\tcross legged legs\\n🧘♀️\\twoman in lotus position\\tcross legged legs\\n🛀\\tperson taking bath\\tbathtub tub\\n🛌\\tperson in bed\\tbedtime good goodnight\\n🧑🤝🧑\\tpeople holding hands\\tbae bestie bff\\n👭\\twomen holding hands\\tbae bestie bff\\n👫\\twoman and man holding hands\\tbae bestie bff\\n👬\\tmen holding hands\\tbae bestie bff\\n💏\\tkiss\\tanniversary babe bae\\n👩❤️💋👨\\tkiss: woman, man\\tanniversary babe bae\\n👨❤️💋👨\\tkiss: man, man\\tanniversary babe bae\\n👩❤️💋👩\\tkiss: woman, woman\\tanniversary babe bae\\n💑\\tcouple with heart\\tanniversary babe bae\\n👩❤️👨\\tcouple with heart: woman, man\\tanniversary babe bae\\n👨❤️👨\\tcouple with heart: man, man\\tanniversary babe bae\\n👩❤️👩\\tcouple with heart: woman, woman\\tanniversary babe bae\\n👨👩👦\\tfamily: man, woman, boy\\tchild\\n👨👩👧\\tfamily: man, woman, girl\\tchild\\n👨👩👧👦\\tfamily: man, woman, girl, boy\\tchild\\n👨👩👦👦\\tfamily: man, woman, boy, boy\\tchild\\n👨👩👧👧\\tfamily: man, woman, girl, girl\\tchild\\n👨👨👦\\tfamily: man, man, boy\\tchild\\n👨👨👧\\tfamily: man, man, girl\\tchild\\n👨👨👧👦\\tfamily: man, man, girl, boy\\tchild\\n👨👨👦👦\\tfamily: man, man, boy, boy\\tchild\\n👨👨👧👧\\tfamily: man, man, girl, girl\\tchild\\n👩👩👦\\tfamily: woman, woman, boy\\tchild\\n👩👩👧\\tfamily: woman, woman, girl\\tchild\\n👩👩👧👦\\tfamily: woman, woman, girl, boy\\tchild\\n👩👩👦👦\\tfamily: woman, woman, boy, boy\\tchild\\n👩👩👧👧\\tfamily: woman, woman, girl, girl\\tchild\\n👨👦\\tfamily: man, boy\\tchild\\n👨👦👦\\tfamily: man, boy, boy\\tchild\\n👨👧\\tfamily: man, girl\\tchild\\n👨👧👦\\tfamily: man, girl, boy\\tchild\\n👨👧👧\\tfamily: man, girl, girl\\tchild\\n👩👦\\tfamily: woman, boy\\tchild\\n👩👦👦\\tfamily: woman, boy, boy\\tchild\\n👩👧\\tfamily: woman, girl\\tchild\\n👩👧👦\\tfamily: woman, girl, boy\\tchild\\n👩👧👧\\tfamily: woman, girl, girl\\tchild\\n🗣️\\tspeaking head\\tface silhouette speak\\n👤\\tbust in silhouette\\tmysterious shadow\\n👥\\tbusts in silhouette\\tbff bust everyone\\n🫂\\tpeople hugging\\tcomfort embrace farewell\\n👪\\tfamily\\tchild\\n👣\\tfootprints\\tbarefoot clothing footprint\",\n nature: \"🐵\\tmonkey face\\tanimal banana\\n🐒\\tmonkey\\tanimal banana\\n🦍\\tgorilla\\tanimal\\n🦧\\torangutan\\tanimal ape monkey\\n🐶\\tdog face\\tadorbs animal pet\\n🐕\\tdog\\tanimal animals dogs\\n🦮\\tguide dog\\taccessibility animal blind\\n🐕🦺\\tservice dog\\taccessibility animal assistance\\n🐩\\tpoodle\\tanimal dog fluffy\\n🐺\\twolf\\tanimal face\\n🦊\\tfox\\tanimal face\\n🦝\\traccoon\\tanimal curious sly\\n🐱\\tcat face\\tanimal kitten kitty\\n🐈\\tcat\\tanimal animals cats\\n🐈⬛\\tblack cat\\tanimal feline halloween\\n🦁\\tlion\\talpha animal face\\n🐯\\ttiger face\\tanimal big cat\\n🐅\\ttiger\\tanimal big cat\\n🐆\\tleopard\\tanimal big cat\\n🐴\\thorse face\\tanimal dressage equine\\n🫎\\tmoose\\talces animal antlers\\n🫏\\tdonkey\\tanimal ass burro\\n🐎\\thorse\\tanimal equestrian farm\\n🦄\\tunicorn\\tface\\n🦓\\tzebra\\tanimal stripe\\n🦌\\tdeer\\tanimal\\n🦬\\tbison\\tanimal buffalo herd\\n🐮\\tcow face\\tanimal farm milk\\n🐂\\tox\\tanimal animals bull\\n🐃\\twater buffalo\\tanimal zoo\\n🐄\\tcow\\tanimal animals farm\\n🐷\\tpig face\\tanimal bacon farm\\n🐖\\tpig\\tanimal bacon farm\\n🐗\\tboar\\tanimal pig\\n🐽\\tpig nose\\tanimal face farm\\n🐏\\tram\\tanimal aries horns\\n🐑\\tewe\\tanimal baa farm\\n🐐\\tgoat\\tanimal capricorn farm\\n🐪\\tcamel\\tanimal desert dromedary\\n🐫\\ttwo-hump camel\\tanimal bactrian desert\\n🦙\\tllama\\talpaca animal guanaco\\n🦒\\tgiraffe\\tanimal spots\\n🐘\\telephant\\tanimal\\n🦣\\tmammoth\\tanimal extinction large\\n🦏\\trhinoceros\\tanimal\\n🦛\\thippopotamus\\tanimal hippo\\n🐭\\tmouse face\\tanimal\\n🐁\\tmouse\\tanimal animals\\n🐀\\trat\\tanimal\\n🐹\\thamster\\tanimal face pet\\n🐰\\trabbit face\\tanimal bunny pet\\n🐇\\trabbit\\tanimal bunny pet\\n🐿️\\tchipmunk\\tanimal squirrel\\n🦫\\tbeaver\\tanimal dam teeth\\n🦔\\thedgehog\\tanimal spiny\\n🦇\\tbat\\tanimal vampire\\n🐻\\tbear\\tanimal face grizzly\\n🐻❄️\\tpolar bear\\tanimal arctic white\\n🐨\\tkoala\\tanimal australia bear\\n🐼\\tpanda\\tanimal bamboo face\\n🦥\\tsloth\\tlazy slow\\n🦦\\totter\\tanimal fishing playful\\n🦨\\tskunk\\tanimal stink\\n🦘\\tkangaroo\\tanimal joey jump\\n🦡\\tbadger\\tanimal honey pester\\n🐾\\tpaw prints\\tfeet paws print\\n🦃\\tturkey\\tbird gobble thanksgiving\\n🐔\\tchicken\\tanimal bird ornithology\\n🐓\\trooster\\tanimal bird ornithology\\n🐣\\thatching chick\\tanimal baby bird\\n🐤\\tbaby chick\\tanimal bird ornithology\\n🐥\\tfront-facing baby chick\\tanimal bird front-facing\\n🐦\\tbird\\tanimal ornithology\\n🐧\\tpenguin\\tanimal antarctica bird\\n🕊️\\tdove\\tbird fly ornithology\\n🦅\\teagle\\tanimal bird ornithology\\n🦆\\tduck\\tanimal bird ornithology\\n🦢\\tswan\\tanimal bird cygnet\\n🦉\\towl\\tanimal bird ornithology\\n🦤\\tdodo\\tanimal bird extinction\\n🪶\\tfeather\\tbird flight light\\n🦩\\tflamingo\\tanimal bird flamboyant\\n🦚\\tpeacock\\tanimal bird colorful\\n🦜\\tparrot\\tanimal bird ornithology\\n🪽\\twing\\tangelic ascend aviation\\n🐦⬛\\tblack bird\\tanimal beak caw\\n🪿\\tgoose\\tanimal bird duck\\n🐸\\tfrog\\tanimal face\\n🐊\\tcrocodile\\tanimal zoo\\n🐢\\tturtle\\tanimal terrapin tortoise\\n🦎\\tlizard\\tanimal reptile\\n🐍\\tsnake\\tanimal bearer ophiuchus\\n🐲\\tdragon face\\tanimal fairy fairytale\\n🐉\\tdragon\\tanimal fairy fairytale\\n🦕\\tsauropod\\tbrachiosaurus brontosaurus dinosaur\\n🦖\\tT-Rex\\tdinosaur t-rex tyrannosaurus\\n🐳\\tspouting whale\\tanimal beach face\\n🐋\\twhale\\tanimal beach ocean\\n🐬\\tdolphin\\tanimal beach flipper\\n🦭\\tseal\\tanimal lion ocean\\n🐟\\tfish\\tanimal dinner fishes\\n🐠\\ttropical fish\\tanimal fishes\\n🐡\\tblowfish\\tanimal fish\\n🦈\\tshark\\tanimal fish\\n🐙\\toctopus\\tanimal creature ocean\\n🐚\\tspiral shell\\tanimal beach conch\\n🪸\\tcoral\\tchange climate ocean\\n🪼\\tjellyfish\\tanimal aquarium burn\\n🦀\\tcrab\\tcancer zodiac\\n🦞\\tlobster\\tanimal bisque claws\\n🦐\\tshrimp\\tfood shellfish small\\n🦑\\tsquid\\tanimal food mollusk\\n🦪\\toyster\\tdiving pearl\\n🐌\\tsnail\\tanimal escargot garden\\n🦋\\tbutterfly\\tinsect pretty\\n🐛\\tbug\\tanimal garden insect\\n🐜\\tant\\tanimal garden insect\\n🐝\\thoneybee\\tanimal bee bumblebee\\n🪲\\tbeetle\\tanimal bug insect\\n🐞\\tlady beetle\\tanimal garden insect\\n🦗\\tcricket\\tanimal bug grasshopper\\n🪳\\tcockroach\\tanimal insect pest\\n🕷️\\tspider\\tanimal insect\\n🕸️\\tspider web\\t\\n🦂\\tscorpion\\tscorpio scorpius zodiac\\n🦟\\tmosquito\\tbite disease fever\\n🪰\\tfly\\tanimal disease insect\\n🪱\\tworm\\tanimal annelid earthworm\\n🦠\\tmicrobe\\tamoeba bacteria science\\n💐\\tbouquet\\tanniversary birthday date\\n🌸\\tcherry blossom\\tflower plant spring\\n💮\\twhite flower\\t\\n🪷\\tlotus\\tbeauty buddhism calm\\n🏵️\\trosette\\tplant\\n🌹\\trose\\tbeauty elegant flower\\n🥀\\twilted flower\\tdying\\n🌺\\thibiscus\\tflower plant\\n🌻\\tsunflower\\tflower outdoors plant\\n🌼\\tblossom\\tbuttercup dandelion flower\\n🌷\\ttulip\\tblossom flower growth\\n🪻\\thyacinth\\tbloom bluebonnet flower\\n🌱\\tseedling\\tplant sapling sprout\\n🪴\\tpotted plant\\tdecor grow house\\n🌲\\tevergreen tree\\tchristmas forest pine\\n🌳\\tdeciduous tree\\tforest green habitat\\n🌴\\tpalm tree\\tbeach plant tropical\\n🌵\\tcactus\\tdesert drought nature\\n🌾\\tsheaf of rice\\tear grain grains\\n🌿\\therb\\tleaf plant\\n☘️\\tshamrock\\tirish plant\\n🍀\\tfour leaf clover\\t4 four-leaf irish\\n🍁\\tmaple leaf\\tfalling\\n🍂\\tfallen leaf\\tautumn fall falling\\n🍃\\tleaf fluttering in wind\\tblow flutter\\n🪹\\tempty nest\\tbranch home nesting\\n🪺\\tnest with eggs\\tbird branch egg\\n🍄\\tmushroom\\tfungus toadstool\",\n food: \"🍇\\tgrapes\\tdionysus fruit grape\\n🍈\\tmelon\\tcantaloupe fruit\\n🍉\\twatermelon\\tfruit\\n🍊\\ttangerine\\tc citrus fruit\\n🍋\\tlemon\\tcitrus fruit sour\\n🍌\\tbanana\\tfruit potassium\\n🍍\\tpineapple\\tcolada fruit pina\\n🥭\\tmango\\tfood fruit tropical\\n🍎\\tred apple\\tdiet food fruit\\n🍏\\tgreen apple\\tfruit\\n🍐\\tpear\\tfruit\\n🍑\\tpeach\\tfruit\\n🍒\\tcherries\\tberries cherry fruit\\n🍓\\tstrawberry\\tberry fruit\\n🫐\\tblueberries\\tberries berry bilberry\\n🥝\\tkiwi fruit\\tfood\\n🍅\\ttomato\\tfood fruit vegetable\\n🫒\\tolive\\tfood\\n🥥\\tcoconut\\tcolada palm piña\\n🥑\\tavocado\\tfood fruit\\n🍆\\teggplant\\taubergine vegetable\\n🥔\\tpotato\\tfood vegetable\\n🥕\\tcarrot\\tfood vegetable\\n🌽\\tear of corn\\tcrops farm maize\\n🌶️\\thot pepper\\t\\n🫑\\tbell pepper\\tcapsicum food vegetable\\n🥒\\tcucumber\\tfood pickle vegetable\\n🥬\\tleafy green\\tbok burgers cabbage\\n🥦\\tbroccoli\\tcabbage wild\\n🧄\\tgarlic\\tflavoring\\n🧅\\tonion\\tflavoring\\n🥜\\tpeanuts\\tfood nut peanut\\n🫘\\tbeans\\tfood kidney legume\\n🌰\\tchestnut\\talmond plant\\n🫚\\tginger root\\tbeer health herb\\n🫛\\tpea pod\\tbeans beanstalk edamame\\n🍞\\tbread\\tcarbs food grain\\n🥐\\tcroissant\\tbread breakfast crescent\\n🥖\\tbaguette bread\\tfood french\\n🫓\\tflatbread\\tarepa bread food\\n🥨\\tpretzel\\tconvoluted twisted\\n🥯\\tbagel\\tbakery bread breakfast\\n🥞\\tpancakes\\tbreakfast crêpe food\\n🧇\\twaffle\\tbreakfast indecisive iron\\n🧀\\tcheese wedge\\t\\n🍖\\tmeat on bone\\t\\n🍗\\tpoultry leg\\tbone chicken drumstick\\n🥩\\tcut of meat\\tchop lambchop porkchop\\n🥓\\tbacon\\tbreakfast food meat\\n🍔\\thamburger\\tburger eat fast\\n🍟\\tfrench fries\\tfast food\\n🍕\\tpizza\\tcheese food hungry\\n🌭\\thot dog\\tfrankfurter hotdog sausage\\n🥪\\tsandwich\\tbread\\n🌮\\ttaco\\tmexican\\n🌯\\tburrito\\tmexican wrap\\n🫔\\ttamale\\tfood mexican pamonha\\n🥙\\tstuffed flatbread\\tfalafel food gyro\\n🧆\\tfalafel\\tchickpea meatball\\n🥚\\tegg\\tbreakfast food\\n🍳\\tcooking\\tbreakfast easy egg\\n🥘\\tshallow pan of food\\tcasserole paella\\n🍲\\tpot of food\\tsoup stew\\n🫕\\tfondue\\tcheese chocolate food\\n🥣\\tbowl with spoon\\tbreakfast cereal congee\\n🥗\\tgreen salad\\tfood\\n🍿\\tpopcorn\\tcorn movie pop\\n🧈\\tbutter\\tdairy\\n🧂\\tsalt\\tcondiment flavor mad\\n🥫\\tcanned food\\tcan\\n🍱\\tbento box\\tfood\\n🍘\\trice cracker\\tfood\\n🍙\\trice ball\\tfood japanese\\n🍚\\tcooked rice\\tfood\\n🍛\\tcurry rice\\tfood\\n🍜\\tsteaming bowl\\tchopsticks food noodle\\n🍝\\tspaghetti\\tfood meatballs pasta\\n🍠\\troasted sweet potato\\tfood\\n🍢\\toden\\tfood kebab restaurant\\n🍣\\tsushi\\tfood\\n🍤\\tfried shrimp\\tprawn tempura\\n🍥\\tfish cake with swirl\\tfood pastry restaurant\\n🥮\\tmoon cake\\tautumn festival yuèbǐng\\n🍡\\tdango\\tdessert japanese skewer\\n🥟\\tdumpling\\tempanada gyōza jiaozi\\n🥠\\tfortune cookie\\tprophecy\\n🥡\\ttakeout box\\tchopsticks delivery food\\n🍦\\tsoft ice cream\\tdessert food icecream\\n🍧\\tshaved ice\\tdessert restaurant sweet\\n🍨\\tice cream\\tdessert food restaurant\\n🍩\\tdoughnut\\tbreakfast dessert donut\\n🍪\\tcookie\\tchip chocolate dessert\\n🎂\\tbirthday cake\\tbday celebration dessert\\n🍰\\tshortcake\\tcake dessert pastry\\n🧁\\tcupcake\\tbakery dessert sprinkles\\n🥧\\tpie\\tapple filling fruit\\n🍫\\tchocolate bar\\tcandy dessert halloween\\n🍬\\tcandy\\tcavities dessert halloween\\n🍭\\tlollipop\\tcandy dessert food\\n🍮\\tcustard\\tdessert pudding sweet\\n🍯\\thoney pot\\tbarrel bear food\\n🍼\\tbaby bottle\\tbabies birth born\\n🥛\\tglass of milk\\tdrink\\n☕\\thot beverage\\tcafe caffeine chai\\n🫖\\tteapot\\tbrew drink food\\n🍵\\tteacup without handle\\tbeverage cup drink\\n🍶\\tsake\\tbar beverage bottle\\n🍾\\tbottle with popping cork\\tbar drink\\n🍷\\twine glass\\talcohol bar beverage\\n🍸\\tcocktail glass\\talcohol bar booze\\n🍹\\ttropical drink\\talcohol bar booze\\n🍺\\tbeer mug\\talcohol ale bar\\n🍻\\tclinking beer mugs\\talcohol bar booze\\n🥂\\tclinking glasses\\tcelebrate clink drink\\n🥃\\ttumbler glass\\tliquor scotch shot\\n🫗\\tpouring liquid\\taccident drink empty\\n🥤\\tcup with straw\\tdrink juice malt\\n🧋\\tbubble tea\\tboba food milk\\n🧃\\tbeverage box\\tjuice straw sweet\\n🧉\\tmate\\tdrink\\n🧊\\tice\\tcold cube iceberg\\n🥢\\tchopsticks\\thashi jeotgarak kuaizi\\n🍽️\\tfork and knife with plate\\tcooking dinner eat\\n🍴\\tfork and knife\\tbreakfast breaky cooking\\n🥄\\tspoon\\teat tableware\\n🔪\\tkitchen knife\\tchef cooking hocho\\n🫙\\tjar\\tcondiment container empty\\n🏺\\tamphora\\taquarius cooking drink\",\n travel: \"🌍\\tglobe showing Europe-Africa\\tearth europe-africa world\\n🌎\\tglobe showing Americas\\tearth world\\n🌏\\tglobe showing Asia-Australia\\tasia-australia earth world\\n🌐\\tglobe with meridians\\tearth internet web\\n🗺️\\tworld map\\t\\n🗾\\tmap of Japan\\t\\n🧭\\tcompass\\tdirection magnetic navigation\\n🏔️\\tsnow-capped mountain\\tcold snow-capped\\n⛰️\\tmountain\\t\\n🌋\\tvolcano\\teruption mountain nature\\n🗻\\tmount fuji\\tmountain nature\\n🏕️\\tcamping\\t\\n🏖️\\tbeach with umbrella\\t\\n🏜️\\tdesert\\t\\n🏝️\\tdesert island\\t\\n🏞️\\tnational park\\t\\n🏟️\\tstadium\\t\\n🏛️\\tclassical building\\t\\n🏗️\\tbuilding construction\\tcrane\\n🧱\\tbrick\\tbricks clay mortar\\n🪨\\trock\\tboulder heavy solid\\n🪵\\twood\\tlog lumber timber\\n🛖\\thut\\thome house roundhouse\\n🏘️\\thouses\\thouse\\n🏚️\\tderelict house\\thome\\n🏠\\thouse\\tbuilding country heart\\n🏡\\thouse with garden\\tbuilding country heart\\n🏢\\toffice building\\tcity cubical job\\n🏣\\tJapanese post office\\tbuilding\\n🏤\\tpost office\\tbuilding european\\n🏥\\thospital\\tbuilding doctor medicine\\n🏦\\tbank\\tbuilding\\n🏨\\thotel\\tbuilding\\n🏩\\tlove hotel\\tbuilding\\n🏪\\tconvenience store\\t24 building hours\\n🏫\\tschool\\tbuilding\\n🏬\\tdepartment store\\tbuilding\\n🏭\\tfactory\\tbuilding\\n🏯\\tJapanese castle\\tbuilding\\n🏰\\tcastle\\tbuilding european\\n💒\\twedding\\tchapel hitched nuptials\\n🗼\\tTokyo tower\\t\\n🗽\\tStatue of Liberty\\tnew ny nyc\\n⛪\\tchurch\\tbless chapel christian\\n🕌\\tmosque\\tislam masjid muslim\\n🛕\\thindu temple\\t\\n🕍\\tsynagogue\\tjew jewish judaism\\n⛩️\\tshinto shrine\\treligion\\n🕋\\tkaaba\\thajj islam muslim\\n⛲\\tfountain\\t\\n⛺\\ttent\\tcamping\\n🌁\\tfoggy\\tfog\\n🌃\\tnight with stars\\tstar\\n🏙️\\tcityscape\\tcity\\n🌄\\tsunrise over mountains\\tmorning sun\\n🌅\\tsunrise\\tmorning nature sun\\n🌆\\tcityscape at dusk\\tbuilding city evening\\n🌇\\tsunset\\tbuilding dusk sun\\n🌉\\tbridge at night\\t\\n♨️\\thot springs\\thotsprings steaming\\n🎠\\tcarousel horse\\tentertainment\\n🛝\\tplayground slide\\tamusement park play\\n🎡\\tferris wheel\\tamusement park theme\\n🎢\\troller coaster\\tamusement park theme\\n💈\\tbarber pole\\tcut fresh haircut\\n🎪\\tcircus tent\\t\\n🚂\\tlocomotive\\tcaboose engine railway\\n🚃\\trailway car\\telectric train tram\\n🚄\\thigh-speed train\\thigh-speed railway shinkansen\\n🚅\\tbullet train\\thigh-speed nose railway\\n🚆\\ttrain\\tarrived choo railway\\n🚇\\tmetro\\tsubway travel\\n🚈\\tlight rail\\tarrived monorail railway\\n🚉\\tstation\\trailway train\\n🚊\\ttram\\ttrolleybus\\n🚝\\tmonorail\\tvehicle\\n🚞\\tmountain railway\\tcar trip\\n🚋\\ttram car\\tbus trolley trolleybus\\n🚌\\tbus\\tschool vehicle\\n🚍\\toncoming bus\\tcars\\n🚎\\ttrolleybus\\tbus tram trolley\\n🚐\\tminibus\\tbus drive van\\n🚑\\tambulance\\temergency vehicle\\n🚒\\tfire engine\\ttruck\\n🚓\\tpolice car\\t5–0 cops patrol\\n🚔\\toncoming police car\\t\\n🚕\\ttaxi\\tcab cabbie car\\n🚖\\toncoming taxi\\tcab cabbie cars\\n🚗\\tautomobile\\tcar driving vehicle\\n🚘\\toncoming automobile\\tcar cars drove\\n🚙\\tsport utility vehicle\\tcar drive recreational\\n🛻\\tpickup truck\\tautomobile car flatbed\\n🚚\\tdelivery truck\\tcar drive vehicle\\n🚛\\tarticulated lorry\\tcar drive move\\n🚜\\ttractor\\tvehicle\\n🏎️\\tracing car\\tzoom\\n🏍️\\tmotorcycle\\tracing\\n🛵\\tmotor scooter\\t\\n🦽\\tmanual wheelchair\\taccessibility\\n🦼\\tmotorized wheelchair\\taccessibility\\n🛺\\tauto rickshaw\\ttuk\\n🚲\\tbicycle\\tbike class cycle\\n🛴\\tkick scooter\\t\\n🛹\\tskateboard\\tboard skate skater\\n🛼\\troller skate\\tblades skates sport\\n🚏\\tbus stop\\tbusstop\\n🛣️\\tmotorway\\thighway road\\n🛤️\\trailway track\\ttrain\\n🛢️\\toil drum\\t\\n⛽\\tfuel pump\\tdiesel fuelpump gas\\n🛞\\twheel\\tcar circle tire\\n🚨\\tpolice car light\\talarm alert beacon\\n🚥\\thorizontal traffic light\\tintersection signal stop\\n🚦\\tvertical traffic light\\tdrove intersection signal\\n🛑\\tstop sign\\toctagonal\\n🚧\\tconstruction\\tbarrier\\n⚓\\tanchor\\tship tool\\n🛟\\tring buoy\\tfloat life lifesaver\\n⛵\\tsailboat\\tboat resort sailing\\n🛶\\tcanoe\\tboat\\n🚤\\tspeedboat\\tbillionaire boat lake\\n🛳️\\tpassenger ship\\t\\n⛴️\\tferry\\tboat passenger\\n🛥️\\tmotor boat\\tmotorboat\\n🚢\\tship\\tboat passenger travel\\n✈️\\tairplane\\taeroplane fly flying\\n🛩️\\tsmall airplane\\taeroplane plane\\n🛫\\tairplane departure\\taeroplane check-in departures\\n🛬\\tairplane arrival\\taeroplane arrivals arriving\\n🪂\\tparachute\\thang-glide parasail skydive\\n💺\\tseat\\tchair\\n🚁\\thelicopter\\tcopter roflcopter travel\\n🚟\\tsuspension railway\\t\\n🚠\\tmountain cableway\\tcable gondola lift\\n🚡\\taerial tramway\\tcable car gondola\\n🛰️\\tsatellite\\tspace\\n🚀\\trocket\\tlaunch rockets space\\n🛸\\tflying saucer\\taliens extra terrestrial\\n🛎️\\tbellhop bell\\thotel\\n🧳\\tluggage\\tbag packing roller\\n⌛\\thourglass done\\tsand time timer\\n⏳\\thourglass not done\\tflowing hours sand\\n⌚\\twatch\\tclock time\\n⏰\\talarm clock\\thours hrs late\\n⏱️\\tstopwatch\\tclock time\\n⏲️\\ttimer clock\\t\\n🕰️\\tmantelpiece clock\\ttime\\n🕛\\ttwelve o’clock\\t12 12:00 o’clock\\n🕧\\ttwelve-thirty\\t12 12:30 30\\n🕐\\tone o’clock\\t1 1:00 o’clock\\n🕜\\tone-thirty\\t1 1:30 30\\n🕑\\ttwo o’clock\\t2 2:00 o’clock\\n🕝\\ttwo-thirty\\t2 2:30 30\\n🕒\\tthree o’clock\\t3 3:00 o’clock\\n🕞\\tthree-thirty\\t3 30 3:30\\n🕓\\tfour o’clock\\t4 4:00 o’clock\\n🕟\\tfour-thirty\\t30 4 4:30\\n🕔\\tfive o’clock\\t5 5:00 o’clock\\n🕠\\tfive-thirty\\t30 5 5:30\\n🕕\\tsix o’clock\\t6 6:00 o’clock\\n🕡\\tsix-thirty\\t30 6 6:30\\n🕖\\tseven o’clock\\t0 7 7:00\\n🕢\\tseven-thirty\\t30 7 7:30\\n🕗\\teight o’clock\\t8 8:00 o’clock\\n🕣\\teight-thirty\\t30 8 8:30\\n🕘\\tnine o’clock\\t9 9:00 o’clock\\n🕤\\tnine-thirty\\t30 9 9:30\\n🕙\\tten o’clock\\t0 10 10:00\\n🕥\\tten-thirty\\t10 10:30 30\\n🕚\\televen o’clock\\t11 11:00 o’clock\\n🕦\\televen-thirty\\t11 11:30 30\\n🌑\\tnew moon\\tdark space\\n🌒\\twaxing crescent moon\\tdreams space\\n🌓\\tfirst quarter moon\\tspace\\n🌔\\twaxing gibbous moon\\tspace\\n🌕\\tfull moon\\tspace\\n🌖\\twaning gibbous moon\\tspace\\n🌗\\tlast quarter moon\\tspace\\n🌘\\twaning crescent moon\\tspace\\n🌙\\tcrescent moon\\tramadan space\\n🌚\\tnew moon face\\tspace\\n🌛\\tfirst quarter moon face\\tspace\\n🌜\\tlast quarter moon face\\tdreams\\n🌡️\\tthermometer\\tweather\\n☀️\\tsun\\tbright rays space\\n🌝\\tfull moon face\\tbright\\n🌞\\tsun with face\\tbeach bright day\\n🪐\\tringed planet\\tsaturn saturnine\\n⭐\\tstar\\tastronomy medium stars\\n🌟\\tglowing star\\tglittery glow night\\n🌠\\tshooting star\\tfalling night space\\n🌌\\tmilky way\\tspace\\n☁️\\tcloud\\tweather\\n⛅\\tsun behind cloud\\tcloudy weather\\n⛈️\\tcloud with lightning and rain\\tthunder thunderstorm\\n🌤️\\tsun behind small cloud\\tweather\\n🌥️\\tsun behind large cloud\\tweather\\n🌦️\\tsun behind rain cloud\\tweather\\n🌧️\\tcloud with rain\\tweather\\n🌨️\\tcloud with snow\\tcold weather\\n🌩️\\tcloud with lightning\\tweather\\n🌪️\\ttornado\\tcloud weather whirlwind\\n🌫️\\tfog\\tcloud weather\\n🌬️\\twind face\\tblow cloud\\n🌀\\tcyclone\\tdizzy hurricane twister\\n🌈\\trainbow\\tgay genderqueer glbt\\n🌂\\tclosed umbrella\\tclothing rain\\n☂️\\tumbrella\\tclothing rain\\n☔\\tumbrella with rain drops\\tclothing drop weather\\n⛱️\\tumbrella on ground\\train sun\\n⚡\\thigh voltage\\tdanger electric electricity\\n❄️\\tsnowflake\\tcold snow weather\\n☃️\\tsnowman\\tcold man snow\\n⛄\\tsnowman without snow\\tcold man\\n☄️\\tcomet\\tspace\\n🔥\\tfire\\taf burn flame\\n💧\\tdroplet\\tcold comic drop\\n🌊\\twater wave\\tnature ocean surf\",\n activities: \"🎃\\tjack-o-lantern\\tcelebration halloween pumpkin\\n🎄\\tChristmas tree\\tcelebration\\n🎆\\tfireworks\\tboom celebration entertainment\\n🎇\\tsparkler\\tboom celebration fireworks\\n🧨\\tfirecracker\\tdynamite explosive fire\\n✨\\tsparkles\\t* magic sparkle\\n🎈\\tballoon\\tbirthday celebrate celebration\\n🎉\\tparty popper\\tawesome birthday celebrate\\n🎊\\tconfetti ball\\tcelebrate celebration party\\n🎋\\ttanabata tree\\tbanner celebration japanese\\n🎍\\tpine decoration\\tbamboo celebration japanese\\n🎎\\tJapanese dolls\\tcelebration doll festival\\n🎏\\tcarp streamer\\tcelebration\\n🎐\\twind chime\\tbell celebration\\n🎑\\tmoon viewing ceremony\\tcelebration\\n🧧\\tred envelope\\tgift good hóngbāo\\n🎀\\tribbon\\tcelebration\\n🎁\\twrapped gift\\tbirthday bow box\\n🎗️\\treminder ribbon\\tcelebration\\n🎟️\\tadmission tickets\\tticket\\n🎫\\tticket\\tadmission stub\\n🎖️\\tmilitary medal\\taward celebration\\n🏆\\ttrophy\\tchampion champs prize\\n🏅\\tsports medal\\taward gold winner\\n🥇\\t1st place medal\\tfirst gold\\n🥈\\t2nd place medal\\tsecond silver\\n🥉\\t3rd place medal\\tbronze third\\n⚽\\tsoccer ball\\tfootball futbol sport\\n⚾\\tbaseball\\tball sport\\n🥎\\tsoftball\\tball glove sports\\n🏀\\tbasketball\\tball hoop sport\\n🏐\\tvolleyball\\tball game\\n🏈\\tamerican football\\tball bowl sport\\n🏉\\trugby football\\tball sport\\n🎾\\ttennis\\tball racquet sport\\n🥏\\tflying disc\\tultimate\\n🎳\\tbowling\\tball game sport\\n🏏\\tcricket game\\tball bat\\n🏑\\tfield hockey\\tball game stick\\n🏒\\tice hockey\\tgame puck stick\\n🥍\\tlacrosse\\tball goal sports\\n🏓\\tping pong\\tball bat game\\n🏸\\tbadminton\\tbirdie game racquet\\n🥊\\tboxing glove\\t\\n🥋\\tmartial arts uniform\\tjudo karate taekwondo\\n🥅\\tgoal net\\t\\n⛳\\tflag in hole\\tgolf sport\\n⛸️\\tice skate\\tskating\\n🎣\\tfishing pole\\tentertainment fish sport\\n🤿\\tdiving mask\\tscuba snorkeling\\n🎽\\trunning shirt\\tathletics sash\\n🎿\\tskis\\tski snow sport\\n🛷\\tsled\\tluge sledge sleigh\\n🥌\\tcurling stone\\tgame rock\\n🎯\\tbullseye\\tbull dart direct\\n🪀\\tyo-yo\\tfluctuate toy\\n🪁\\tkite\\tfly soar\\n🔫\\twater pistol\\tgun handgun revolver\\n🎱\\tpool 8 ball\\t8ball billiard eight\\n🔮\\tcrystal ball\\tfairy fairytale fantasy\\n🪄\\tmagic wand\\tmagician witch wizard\\n🎮\\tvideo game\\tcontroller entertainment\\n🕹️\\tjoystick\\tgame video videogame\\n🎰\\tslot machine\\tcasino gamble gambling\\n🎲\\tgame die\\tdice entertainment\\n🧩\\tpuzzle piece\\tclue interlocking jigsaw\\n🧸\\tteddy bear\\tplaything plush stuffed\\n🪅\\tpiñata\\tcandy celebrate celebration\\n🪩\\tmirror ball\\tdance disco glitter\\n🪆\\tnesting dolls\\tbabooshka baboushka babushka\\n♠️\\tspade suit\\tcard game\\n♥️\\theart suit\\tcard emotion game\\n♦️\\tdiamond suit\\tcard game\\n♣️\\tclub suit\\tcard clubs game\\n♟️\\tchess pawn\\tdupe expendable\\n🃏\\tjoker\\tcard game wildcard\\n🀄\\tmahjong red dragon\\tgame\\n🎴\\tflower playing cards\\tcard game japanese\\n🎭\\tperforming arts\\tactor actress art\\n🖼️\\tframed picture\\tart frame museum\\n🎨\\tartist palette\\tart artsy arty\\n🧵\\tthread\\tneedle sewing spool\\n🪡\\tsewing needle\\tembroidery sew stitches\\n🧶\\tyarn\\tball crochet knit\\n🪢\\tknot\\tcord rope tangled\",\n objects: \"👓\\tglasses\\tclothing eye eyeglasses\\n🕶️\\tsunglasses\\tdark eye eyewear\\n🥽\\tgoggles\\tdive eye protection\\n🥼\\tlab coat\\tclothes doctor dr\\n🦺\\tsafety vest\\temergency\\n👔\\tnecktie\\tclothing employed serious\\n👕\\tt-shirt\\tblue casual clothes\\n👖\\tjeans\\tblue casual clothes\\n🧣\\tscarf\\tbundle cold neck\\n🧤\\tgloves\\thand\\n🧥\\tcoat\\tbrr bundle cold\\n🧦\\tsocks\\tstocking\\n👗\\tdress\\tclothes clothing dressed\\n👘\\tkimono\\tclothing comfortable\\n🥻\\tsari\\tclothing dress\\n🩱\\tone-piece swimsuit\\tbathing one-piece suit\\n🩲\\tbriefs\\tbathing one-piece suit\\n🩳\\tshorts\\tbathing pants suit\\n👙\\tbikini\\tbathing beach clothing\\n👚\\twoman’s clothes\\tblouse clothing collar\\n🪭\\tfolding hand fan\\tclack clap cool\\n👛\\tpurse\\tclothes clothing coin\\n👜\\thandbag\\tbag clothes clothing\\n👝\\tclutch bag\\tclothes clothing dress\\n🛍️\\tshopping bags\\tbag hotel\\n🎒\\tbackpack\\tbackpacking bag bookbag\\n🩴\\tthong sandal\\tbeach flip flop\\n👞\\tman’s shoe\\tbrown clothes clothing\\n👟\\trunning shoe\\tathletic clothes clothing\\n🥾\\thiking boot\\tbackpacking brown camping\\n🥿\\tflat shoe\\tballet comfy flats\\n👠\\thigh-heeled shoe\\tclothes clothing dress\\n👡\\twoman’s sandal\\tclothing shoe woman’s\\n🩰\\tballet shoes\\tdance\\n👢\\twoman’s boot\\tclothes clothing dress\\n🪮\\thair pick\\tafro comb groom\\n👑\\tcrown\\tclothing family king\\n👒\\twoman’s hat\\tclothes clothing garden\\n🎩\\ttop hat\\tclothes clothing fancy\\n🎓\\tgraduation cap\\tcelebration clothing education\\n🧢\\tbilled cap\\tbaseball bent dad\\n🪖\\tmilitary helmet\\tarmy soldier war\\n⛑️\\trescue worker’s helmet\\taid cross face\\n📿\\tprayer beads\\tclothing necklace religion\\n💄\\tlipstick\\tcosmetics date makeup\\n💍\\tring\\tdiamond engaged engagement\\n💎\\tgem stone\\tdiamond engagement jewel\\n🔇\\tmuted speaker\\tmute quiet silent\\n🔈\\tspeaker low volume\\tsoft sound\\n🔉\\tspeaker medium volume\\tsound\\n🔊\\tspeaker high volume\\tloud music sound\\n📢\\tloudspeaker\\taddress communication loud\\n📣\\tmegaphone\\tcheering sound\\n📯\\tpostal horn\\tpost\\n🔔\\tbell\\tbreak church sound\\n🔕\\tbell with slash\\tforbidden mute no\\n🎼\\tmusical score\\tmusic note\\n🎵\\tmusical note\\tmusic sound\\n🎶\\tmusical notes\\tmusic note sound\\n🎙️\\tstudio microphone\\tmic music\\n🎚️\\tlevel slider\\tmusic\\n🎛️\\tcontrol knobs\\tmusic\\n🎤\\tmicrophone\\tkaraoke mic music\\n🎧\\theadphone\\tearbud sound\\n📻\\tradio\\tentertainment tbt video\\n🎷\\tsaxophone\\tinstrument music sax\\n🪗\\taccordion\\tbox concertina instrument\\n🎸\\tguitar\\tinstrument music strat\\n🎹\\tmusical keyboard\\tinstrument music piano\\n🎺\\ttrumpet\\tinstrument music\\n🎻\\tviolin\\tinstrument music\\n🪕\\tbanjo\\tmusic stringed\\n🥁\\tdrum\\tdrumsticks music\\n🪘\\tlong drum\\tbeat conga instrument\\n🪇\\tmaracas\\tcha dance instrument\\n🪈\\tflute\\tband fife flautist\\n📱\\tmobile phone\\tcell communication telephone\\n📲\\tmobile phone with arrow\\tbuild call cell\\n☎️\\ttelephone\\tphone\\n📞\\ttelephone receiver\\tcommunication phone voip\\n📟\\tpager\\tcommunication\\n📠\\tfax machine\\tcommunication\\n🔋\\tbattery\\t\\n🪫\\tlow battery\\tdrained electronic energy\\n🔌\\telectric plug\\telectricity\\n💻\\tlaptop\\tcomputer office pc\\n🖥️\\tdesktop computer\\tmonitor\\n🖨️\\tprinter\\tcomputer\\n⌨️\\tkeyboard\\tcomputer\\n🖱️\\tcomputer mouse\\t\\n🖲️\\ttrackball\\tcomputer\\n💽\\tcomputer disk\\tminidisk optical\\n💾\\tfloppy disk\\tcomputer\\n💿\\toptical disk\\tblu-ray cd computer\\n📀\\tdvd\\tblu-ray cd computer\\n🧮\\tabacus\\tcalculation calculator\\n🎥\\tmovie camera\\tbollywood cinema film\\n🎞️\\tfilm frames\\tcinema movie\\n📽️\\tfilm projector\\tcinema movie video\\n🎬\\tclapper board\\taction movie\\n📺\\ttelevision\\ttv video\\n📷\\tcamera\\tphoto selfie snap\\n📸\\tcamera with flash\\tvideo\\n📹\\tvideo camera\\tcamcorder tbt\\n📼\\tvideocassette\\told school tape\\n🔍\\tmagnifying glass tilted left\\tlab left-pointing science\\n🔎\\tmagnifying glass tilted right\\tcontact lab right-pointing\\n🕯️\\tcandle\\tlight\\n💡\\tlight bulb\\tcomic electric idea\\n🔦\\tflashlight\\telectric light tool\\n🏮\\tred paper lantern\\tbar light restaurant\\n🪔\\tdiya lamp\\tlight oil\\n📔\\tnotebook with decorative cover\\tbook decorated education\\n📕\\tclosed book\\teducation\\n📖\\topen book\\teducation fantasy knowledge\\n📗\\tgreen book\\teducation fantasy library\\n📘\\tblue book\\teducation fantasy library\\n📙\\torange book\\teducation fantasy library\\n📚\\tbooks\\tbook education fantasy\\n📓\\tnotebook\\t\\n📒\\tledger\\tnotebook\\n📃\\tpage with curl\\tdocument paper\\n📜\\tscroll\\tpaper\\n📄\\tpage facing up\\tdocument paper\\n📰\\tnewspaper\\tcommunication news paper\\n🗞️\\trolled-up newspaper\\tnews paper rolled-up\\n📑\\tbookmark tabs\\tmark marker\\n🔖\\tbookmark\\tmark\\n🏷️\\tlabel\\ttag\\n💰\\tmoney bag\\tbank bet billion\\n🪙\\tcoin\\tdollar euro gold\\n💴\\tyen banknote\\tbank bill currency\\n💵\\tdollar banknote\\tbank bill currency\\n💶\\teuro banknote\\t100 bank bill\\n💷\\tpound banknote\\tbank bill billion\\n💸\\tmoney with wings\\tbank banknote bill\\n💳\\tcredit card\\tbank cash charge\\n🧾\\treceipt\\taccounting bookkeeping evidence\\n💹\\tchart increasing with yen\\tbank currency graph\\n✉️\\tenvelope\\te-mail email letter\\n📧\\te-mail\\temail letter\\n📨\\tincoming envelope\\tdelivering e-mail email\\n📩\\tenvelope with arrow\\tcommunication down e-mail\\n📤\\toutbox tray\\tbox email letter\\n📥\\tinbox tray\\tbox email letter\\n📦\\tpackage\\tbox communication delivery\\n📫\\tclosed mailbox with raised flag\\tcommunication mail postbox\\n📪\\tclosed mailbox with lowered flag\\tmail postbox\\n📬\\topen mailbox with raised flag\\tmail postbox\\n📭\\topen mailbox with lowered flag\\tmail postbox\\n📮\\tpostbox\\tmail mailbox\\n🗳️\\tballot box with ballot\\t\\n✏️\\tpencil\\t\\n✒️\\tblack nib\\tpen\\n🖋️\\tfountain pen\\t\\n🖊️\\tpen\\tballpoint\\n🖌️\\tpaintbrush\\tpainting\\n🖍️\\tcrayon\\t\\n📝\\tmemo\\tcommunication media notes\\n💼\\tbriefcase\\toffice\\n📁\\tfile folder\\t\\n📂\\topen file folder\\t\\n🗂️\\tcard index dividers\\t\\n📅\\tcalendar\\tdate\\n📆\\ttear-off calendar\\ttear-off\\n🗒️\\tspiral notepad\\tnote pad\\n🗓️\\tspiral calendar\\tpad\\n📇\\tcard index\\told rolodex school\\n📈\\tchart increasing\\tdata graph growth\\n📉\\tchart decreasing\\tdata down downward\\n📊\\tbar chart\\tdata graph\\n📋\\tclipboard\\tdo list notes\\n📌\\tpushpin\\tcollage pin\\n📍\\tround pushpin\\tlocation map pin\\n📎\\tpaperclip\\t\\n🖇️\\tlinked paperclips\\tlink paperclip\\n📏\\tstraight ruler\\tangle edge math\\n📐\\ttriangular ruler\\tangle math rule\\n✂️\\tscissors\\tcut cutting paper\\n🗃️\\tcard file box\\t\\n🗄️\\tfile cabinet\\tfiling paper\\n🗑️\\twastebasket\\tcan garbage trash\\n🔒\\tlocked\\tclosed lock private\\n🔓\\tunlocked\\tcracked lock open\\n🔏\\tlocked with pen\\tink lock nib\\n🔐\\tlocked with key\\tbike closed lock\\n🔑\\tkey\\tkeys lock major\\n🗝️\\told key\\tclue lock\\n🔨\\thammer\\thome improvement repairs\\n🪓\\taxe\\tax chop hatchet\\n⛏️\\tpick\\thammer mining tool\\n⚒️\\thammer and pick\\ttool\\n🛠️\\thammer and wrench\\tspanner tool\\n🗡️\\tdagger\\tknife weapon\\n⚔️\\tcrossed swords\\tweapon\\n💣\\tbomb\\tboom comic dangerous\\n🪃\\tboomerang\\trebound repercussion weapon\\n🏹\\tbow and arrow\\tarcher archery sagittarius\\n🛡️\\tshield\\tweapon\\n🪚\\tcarpentry saw\\tcarpenter cut lumber\\n🔧\\twrench\\thome improvement spanner\\n🪛\\tscrewdriver\\tflathead handy screw\\n🔩\\tnut and bolt\\thome improvement tool\\n⚙️\\tgear\\tcog cogwheel tool\\n🗜️\\tclamp\\tcompress tool vice\\n⚖️\\tbalance scale\\tjustice libra scales\\n🦯\\twhite cane\\taccessibility blind probing\\n🔗\\tlink\\tlinks\\n⛓️\\tchains\\tchain\\n🪝\\thook\\tcatch crook curve\\n🧰\\ttoolbox\\tbox chest mechanic\\n🧲\\tmagnet\\tattraction horseshoe magnetic\\n🪜\\tladder\\tclimb rung step\\n⚗️\\talembic\\tchemistry tool\\n🧪\\ttest tube\\tchemist chemistry experiment\\n🧫\\tpetri dish\\tbacteria biologist biology\\n🧬\\tdna\\tbiologist evolution gene\\n🔬\\tmicroscope\\texperiment lab science\\n🔭\\ttelescope\\tcontact extraterrestrial science\\n📡\\tsatellite antenna\\taliens contact dish\\n💉\\tsyringe\\tdoctor flu medicine\\n🩸\\tdrop of blood\\tbleed donation injury\\n💊\\tpill\\tdoctor drugs medicated\\n🩹\\tadhesive bandage\\t\\n🩼\\tcrutch\\taid cane disability\\n🩺\\tstethoscope\\tdoctor heart medicine\\n🩻\\tx-ray\\tbones doctor medical\\n🚪\\tdoor\\tback closet front\\n🛗\\televator\\taccessibility hoist lift\\n🪞\\tmirror\\tmakeup reflection reflector\\n🪟\\twindow\\tair frame fresh\\n🛏️\\tbed\\thotel sleep\\n🛋️\\tcouch and lamp\\thotel\\n🪑\\tchair\\tseat sit\\n🚽\\ttoilet\\tbathroom\\n🪠\\tplunger\\tcup force plumber\\n🚿\\tshower\\twater\\n🛁\\tbathtub\\tbath\\n🪤\\tmouse trap\\tbait cheese lure\\n🪒\\trazor\\tsharp shave\\n🧴\\tlotion bottle\\tmoisturizer shampoo sunscreen\\n🧷\\tsafety pin\\tdiaper punk rock\\n🧹\\tbroom\\tcleaning sweeping witch\\n🧺\\tbasket\\tfarming laundry picnic\\n🧻\\troll of paper\\ttoilet towels\\n🪣\\tbucket\\tcask pail vat\\n🧼\\tsoap\\tbar bathing clean\\n🫧\\tbubbles\\tbubble burp clean\\n🪥\\ttoothbrush\\tbathroom brush clean\\n🧽\\tsponge\\tabsorbing cleaning porous\\n🧯\\tfire extinguisher\\textinguish quench\\n🛒\\tshopping cart\\ttrolley\\n🚬\\tcigarette\\tsmoking\\n⚰️\\tcoffin\\tdead death vampire\\n🪦\\theadstone\\tcemetery dead grave\\n⚱️\\tfuneral urn\\tashes death\\n🧿\\tnazar amulet\\tbead blue charm\\n🪬\\thamsa\\tamulet fatima fortune\\n🗿\\tmoai\\tface moyai statue\\n🪧\\tplacard\\tcard demonstration notice\\n🪪\\tidentification card\\tcredentials document id\",\n symbols: \"🏧\\tATM sign\\tautomated bank cash\\n🚮\\tlitter in bin sign\\tlitterbin\\n🚰\\tpotable water\\tdrinking\\n♿\\twheelchair symbol\\taccess handicap\\n🚹\\tmen’s room\\tbathroom lavatory man\\n🚺\\twomen’s room\\tbathroom lavatory restroom\\n🚻\\trestroom\\tbathroom lavatory toilet\\n🚼\\tbaby symbol\\tchanging\\n🚾\\twater closet\\tbathroom lavatory restroom\\n🛂\\tpassport control\\t\\n🛃\\tcustoms\\tpacking\\n🛄\\tbaggage claim\\tarrived bags case\\n🛅\\tleft luggage\\tbaggage case locker\\n⚠️\\twarning\\tcaution\\n🚸\\tchildren crossing\\tchild pedestrian traffic\\n⛔\\tno entry\\tdo fail forbidden\\n🚫\\tprohibited\\tentry forbidden no\\n🚳\\tno bicycles\\tbicycle bike forbidden\\n🚭\\tno smoking\\tforbidden not prohibited\\n🚯\\tno littering\\tforbidden litter not\\n🚱\\tnon-potable water\\tdry non-drinking non-potable\\n🚷\\tno pedestrians\\tforbidden not pedestrian\\n📵\\tno mobile phones\\tcell forbidden not\\n🔞\\tno one under eighteen\\t18 age forbidden\\n☢️\\tradioactive\\tsign\\n☣️\\tbiohazard\\tsign\\n⬆️\\tup arrow\\tcardinal direction north\\n↗️\\tup-right arrow\\tdirection intercardinal northeast\\n➡️\\tright arrow\\tcardinal direction east\\n↘️\\tdown-right arrow\\tdirection down-right intercardinal\\n⬇️\\tdown arrow\\tcardinal direction south\\n↙️\\tdown-left arrow\\tdirection down-left intercardinal\\n⬅️\\tleft arrow\\tcardinal direction west\\n↖️\\tup-left arrow\\tdirection intercardinal northwest\\n↕️\\tup-down arrow\\tup-down\\n↔️\\tleft-right arrow\\tleft-right\\n↩️\\tright arrow curving left\\t\\n↪️\\tleft arrow curving right\\t\\n⤴️\\tright arrow curving up\\t\\n⤵️\\tright arrow curving down\\t\\n🔃\\tclockwise vertical arrows\\tarrow refresh reload\\n🔄\\tcounterclockwise arrows button\\tagain anticlockwise arrow\\n🔙\\tBACK arrow\\t\\n🔚\\tEND arrow\\t\\n🔛\\tON! arrow\\tmark on!\\n🔜\\tSOON arrow\\tbrb omw\\n🔝\\tTOP arrow\\thomie up\\n🛐\\tplace of worship\\tpray religion\\n⚛️\\tatom symbol\\tatheist\\n🕉️\\tom\\thindu religion\\n✡️\\tstar of David\\tjew jewish judaism\\n☸️\\twheel of dharma\\tbuddhist religion\\n☯️\\tyin yang\\tdifficult lives religion\\n✝️\\tlatin cross\\tchrist christian religion\\n☦️\\torthodox cross\\tchristian religion\\n☪️\\tstar and crescent\\tislam muslim ramadan\\n☮️\\tpeace symbol\\thealing peaceful\\n🕎\\tmenorah\\tcandelabrum candlestick hanukkah\\n🔯\\tdotted six-pointed star\\tfortune jewish judaism\\n🪯\\tkhanda\\tdeg fateh khalsa\\n♈\\tAries\\thoroscope ram zodiac\\n♉\\tTaurus\\tbull horoscope ox\\n♊\\tGemini\\thoroscope twins zodiac\\n♋\\tCancer\\tcrab horoscope zodiac\\n♌\\tLeo\\thoroscope lion zodiac\\n♍\\tVirgo\\thoroscope zodiac\\n♎\\tLibra\\tbalance horoscope justice\\n♏\\tScorpio\\thoroscope scorpion scorpius\\n♐\\tSagittarius\\tarcher horoscope zodiac\\n♑\\tCapricorn\\tgoat horoscope zodiac\\n♒\\tAquarius\\tbearer horoscope water\\n♓\\tPisces\\tfish horoscope zodiac\\n⛎\\tOphiuchus\\tbearer serpent snake\\n🔀\\tshuffle tracks button\\tarrow crossed\\n🔁\\trepeat button\\tarrow clockwise\\n🔂\\trepeat single button\\tarrow clockwise once\\n▶️\\tplay button\\tarrow right triangle\\n⏩\\tfast-forward button\\tarrow double fast-forward\\n⏭️\\tnext track button\\tarrow scene triangle\\n⏯️\\tplay or pause button\\tarrow right triangle\\n◀️\\treverse button\\tarrow left triangle\\n⏪\\tfast reverse button\\tarrow double rewind\\n⏮️\\tlast track button\\tarrow previous scene\\n🔼\\tupwards button\\tarrow red up\\n⏫\\tfast up button\\tarrow double\\n🔽\\tdownwards button\\tarrow down red\\n⏬\\tfast down button\\tarrow double\\n⏸️\\tpause button\\tbar double vertical\\n⏹️\\tstop button\\tsquare\\n⏺️\\trecord button\\tcircle\\n⏏️\\teject button\\t\\n🎦\\tcinema\\tcamera film movie\\n🔅\\tdim button\\tbrightness low\\n🔆\\tbright button\\tbrightness light\\n📶\\tantenna bars\\tbar cell communication\\n🛜\\twireless\\tbroadband computer connectivity\\n📳\\tvibration mode\\tcell communication mobile\\n📴\\tmobile phone off\\tcell telephone\\n♀️\\tfemale sign\\twoman\\n♂️\\tmale sign\\tman\\n⚧️\\ttransgender symbol\\t\\n✖️\\tmultiply\\tcancel multiplication sign\\n➕\\tplus\\t+\\n➖\\tminus\\t- heavy math\\n➗\\tdivide\\tdivision heavy math\\n🟰\\theavy equals sign\\tanswer equal equality\\n♾️\\tinfinity\\tforever unbounded universal\\n‼️\\tdouble exclamation mark\\t! !! bangbang\\n⁉️\\texclamation question mark\\t! !? ?\\n❓\\tred question mark\\t? punctuation\\n❔\\twhite question mark\\t? outlined punctuation\\n❕\\twhite exclamation mark\\t! outlined punctuation\\n❗\\tred exclamation mark\\t! punctuation\\n〰️\\twavy dash\\tpunctuation\\n💱\\tcurrency exchange\\tbank money\\n💲\\theavy dollar sign\\tbillion cash charge\\n⚕️\\tmedical symbol\\taesculapius medicine staff\\n♻️\\trecycling symbol\\trecycle\\n⚜️\\tfleur-de-lis\\tknights\\n🔱\\ttrident emblem\\tanchor poseidon ship\\n📛\\tname badge\\t\\n🔰\\tJapanese symbol for beginner\\tchevron green leaf\\n⭕\\thollow red circle\\theavy large o\\n✅\\tcheck mark button\\tchecked checkmark complete\\n☑️\\tcheck box with check\\tballot checked done\\n✔️\\tcheck mark\\tchecked checkmark done\\n❌\\tcross mark\\tcancel multiplication multiply\\n❎\\tcross mark button\\tmultiplication multiply square\\n➰\\tcurly loop\\tcurl\\n➿\\tdouble curly loop\\tcurl\\n〽️\\tpart alternation mark\\t\\n✳️\\teight-spoked asterisk\\t* eight-spoked\\n✴️\\teight-pointed star\\t* eight-pointed\\n❇️\\tsparkle\\t*\\n©️\\tcopyright\\tc\\n®️\\tregistered\\tr\\n™️\\ttrade mark\\ttm trademark\\n#️⃣\\tkeycap: #\\t\\n*️⃣\\tkeycap: *\\t\\n0️⃣\\tkeycap: 0\\t\\n1️⃣\\tkeycap: 1\\t\\n2️⃣\\tkeycap: 2\\t\\n3️⃣\\tkeycap: 3\\t\\n4️⃣\\tkeycap: 4\\t\\n5️⃣\\tkeycap: 5\\t\\n6️⃣\\tkeycap: 6\\t\\n7️⃣\\tkeycap: 7\\t\\n8️⃣\\tkeycap: 8\\t\\n9️⃣\\tkeycap: 9\\t\\n🔟\\tkeycap: 10\\t\\n🔠\\tinput latin uppercase\\tabcd letters\\n🔡\\tinput latin lowercase\\tabcd letters\\n🔢\\tinput numbers\\t1234\\n🔣\\tinput symbols\\t% & ♪\\n🔤\\tinput latin letters\\tabc alphabet\\n🅰️\\tA button (blood type)\\t\\n🆎\\tAB button (blood type)\\t\\n🅱️\\tB button (blood type)\\t\\n🆑\\tCL button\\t\\n🆒\\tCOOL button\\t\\n🆓\\tFREE button\\t\\nℹ️\\tinformation\\ti\\n🆔\\tID button\\tidentity\\nⓂ️\\tcircled M\\tcircle\\n🆕\\tNEW button\\t\\n🆖\\tNG button\\t\\n🅾️\\tO button (blood type)\\t\\n🆗\\tOK button\\tokay\\n🅿️\\tP button\\tparking\\n🆘\\tSOS button\\thelp\\n🆙\\tUP! button\\tmark up!\\n🆚\\tVS button\\tversus\\n🈁\\tJapanese “here” button\\tkatakana\\n🈂️\\tJapanese “service charge” button\\tkatakana\\n🈷️\\tJapanese “monthly amount” button\\tideograph\\n🈶\\tJapanese “not free of charge” button\\tideograph\\n🈯\\tJapanese “reserved” button\\tideograph\\n🉐\\tJapanese “bargain” button\\tideograph\\n🈹\\tJapanese “discount” button\\tideograph\\n🈚\\tJapanese “free of charge” button\\tideograph\\n🈲\\tJapanese “prohibited” button\\tideograph\\n🉑\\tJapanese “acceptable” button\\tideograph\\n🈸\\tJapanese “application” button\\tideograph\\n🈴\\tJapanese “passing grade” button\\tideograph\\n🈳\\tJapanese “vacancy” button\\tideograph\\n㊗️\\tJapanese “congratulations” button\\tideograph\\n㊙️\\tJapanese “secret” button\\tideograph\\n🈺\\tJapanese “open for business” button\\tideograph\\n🈵\\tJapanese “no vacancy” button\\tideograph\\n🔴\\tred circle\\tgeometric\\n🟠\\torange circle\\t\\n🟡\\tyellow circle\\t\\n🟢\\tgreen circle\\t\\n🔵\\tblue circle\\tgeometric\\n🟣\\tpurple circle\\t\\n🟤\\tbrown circle\\t\\n⚫\\tblack circle\\tgeometric\\n⚪\\twhite circle\\tgeometric\\n🟥\\tred square\\tcard penalty\\n🟧\\torange square\\t\\n🟨\\tyellow square\\tcard penalty\\n🟩\\tgreen square\\t\\n🟦\\tblue square\\t\\n🟪\\tpurple square\\t\\n🟫\\tbrown square\\t\\n⬛\\tblack large square\\tgeometric\\n⬜\\twhite large square\\tgeometric\\n◼️\\tblack medium square\\tgeometric\\n◻️\\twhite medium square\\tgeometric\\n◾\\tblack medium-small square\\tgeometric medium-small\\n◽\\twhite medium-small square\\tgeometric medium-small\\n▪️\\tblack small square\\tgeometric\\n▫️\\twhite small square\\tgeometric\\n🔶\\tlarge orange diamond\\tgeometric\\n🔷\\tlarge blue diamond\\tgeometric\\n🔸\\tsmall orange diamond\\tgeometric\\n🔹\\tsmall blue diamond\\tgeometric\\n🔺\\tred triangle pointed up\\tgeometric\\n🔻\\tred triangle pointed down\\tgeometric\\n💠\\tdiamond with a dot\\tcomic geometric\\n🔘\\tradio button\\tgeometric\\n🔳\\twhite square button\\tgeometric outlined\\n🔲\\tblack square button\\tgeometric\",\n flags: \"🏁\\tchequered flag\\tcheckered finish flags\\n🚩\\ttriangular flag\\tconstruction golf post\\n🎌\\tcrossed flags\\tcelebration cross japanese\\n🏴\\tblack flag\\twaving\\n🏳️\\twhite flag\\twaving\\n🏳️🌈\\trainbow flag\\tbisexual gay genderqueer\\n🏳️⚧️\\ttransgender flag\\tblue light pink\\n🏴☠️\\tpirate flag\\tjolly plunder roger\\n🇦🇨\\tflag: Ascension Island\\tAC\\n🇦🇩\\tflag: Andorra\\tAD\\n🇦🇪\\tflag: United Arab Emirates\\tAE\\n🇦🇫\\tflag: Afghanistan\\tAF\\n🇦🇬\\tflag: Antigua & Barbuda\\tAG\\n🇦🇮\\tflag: Anguilla\\tAI\\n🇦🇱\\tflag: Albania\\tAL\\n🇦🇲\\tflag: Armenia\\tAM\\n🇦🇴\\tflag: Angola\\tAO\\n🇦🇶\\tflag: Antarctica\\tAQ\\n🇦🇷\\tflag: Argentina\\tAR\\n🇦🇸\\tflag: American Samoa\\tAS\\n🇦🇹\\tflag: Austria\\tAT\\n🇦🇺\\tflag: Australia\\tAU\\n🇦🇼\\tflag: Aruba\\tAW\\n🇦🇽\\tflag: Åland Islands\\tAX\\n🇦🇿\\tflag: Azerbaijan\\tAZ\\n🇧🇦\\tflag: Bosnia & Herzegovina\\tBA\\n🇧🇧\\tflag: Barbados\\tBB\\n🇧🇩\\tflag: Bangladesh\\tBD\\n🇧🇪\\tflag: Belgium\\tBE\\n🇧🇫\\tflag: Burkina Faso\\tBF\\n🇧🇬\\tflag: Bulgaria\\tBG\\n🇧🇭\\tflag: Bahrain\\tBH\\n🇧🇮\\tflag: Burundi\\tBI\\n🇧🇯\\tflag: Benin\\tBJ\\n🇧🇱\\tflag: St. Barthélemy\\tBL\\n🇧🇲\\tflag: Bermuda\\tBM\\n🇧🇳\\tflag: Brunei\\tBN\\n🇧🇴\\tflag: Bolivia\\tBO\\n🇧🇶\\tflag: Caribbean Netherlands\\tBQ\\n🇧🇷\\tflag: Brazil\\tBR\\n🇧🇸\\tflag: Bahamas\\tBS\\n🇧🇹\\tflag: Bhutan\\tBT\\n🇧🇻\\tflag: Bouvet Island\\tBV\\n🇧🇼\\tflag: Botswana\\tBW\\n🇧🇾\\tflag: Belarus\\tBY\\n🇧🇿\\tflag: Belize\\tBZ\\n🇨🇦\\tflag: Canada\\tCA\\n🇨🇨\\tflag: Cocos (Keeling) Islands\\tCC\\n🇨🇩\\tflag: Congo - Kinshasa\\tCD\\n🇨🇫\\tflag: Central African Republic\\tCF\\n🇨🇬\\tflag: Congo - Brazzaville\\tCG\\n🇨🇭\\tflag: Switzerland\\tCH\\n🇨🇮\\tflag: Côte d’Ivoire\\tCI\\n🇨🇰\\tflag: Cook Islands\\tCK\\n🇨🇱\\tflag: Chile\\tCL\\n🇨🇲\\tflag: Cameroon\\tCM\\n🇨🇳\\tflag: China\\tCN\\n🇨🇴\\tflag: Colombia\\tCO\\n🇨🇵\\tflag: Clipperton Island\\tCP\\n🇨🇷\\tflag: Costa Rica\\tCR\\n🇨🇺\\tflag: Cuba\\tCU\\n🇨🇻\\tflag: Cape Verde\\tCV\\n🇨🇼\\tflag: Curaçao\\tCW\\n🇨🇽\\tflag: Christmas Island\\tCX\\n🇨🇾\\tflag: Cyprus\\tCY\\n🇨🇿\\tflag: Czechia\\tCZ\\n🇩🇪\\tflag: Germany\\tDE\\n🇩🇬\\tflag: Diego Garcia\\tDG\\n🇩🇯\\tflag: Djibouti\\tDJ\\n🇩🇰\\tflag: Denmark\\tDK\\n🇩🇲\\tflag: Dominica\\tDM\\n🇩🇴\\tflag: Dominican Republic\\tDO\\n🇩🇿\\tflag: Algeria\\tDZ\\n🇪🇦\\tflag: Ceuta & Melilla\\tEA\\n🇪🇨\\tflag: Ecuador\\tEC\\n🇪🇪\\tflag: Estonia\\tEE\\n🇪🇬\\tflag: Egypt\\tEG\\n🇪🇭\\tflag: Western Sahara\\tEH\\n🇪🇷\\tflag: Eritrea\\tER\\n🇪🇸\\tflag: Spain\\tES\\n🇪🇹\\tflag: Ethiopia\\tET\\n🇪🇺\\tflag: European Union\\tEU\\n🇫🇮\\tflag: Finland\\tFI\\n🇫🇯\\tflag: Fiji\\tFJ\\n🇫🇰\\tflag: Falkland Islands\\tFK\\n🇫🇲\\tflag: Micronesia\\tFM\\n🇫🇴\\tflag: Faroe Islands\\tFO\\n🇫🇷\\tflag: France\\tFR\\n🇬🇦\\tflag: Gabon\\tGA\\n🇬🇧\\tflag: United Kingdom\\tGB\\n🇬🇩\\tflag: Grenada\\tGD\\n🇬🇪\\tflag: Georgia\\tGE\\n🇬🇫\\tflag: French Guiana\\tGF\\n🇬🇬\\tflag: Guernsey\\tGG\\n🇬🇭\\tflag: Ghana\\tGH\\n🇬🇮\\tflag: Gibraltar\\tGI\\n🇬🇱\\tflag: Greenland\\tGL\\n🇬🇲\\tflag: Gambia\\tGM\\n🇬🇳\\tflag: Guinea\\tGN\\n🇬🇵\\tflag: Guadeloupe\\tGP\\n🇬🇶\\tflag: Equatorial Guinea\\tGQ\\n🇬🇷\\tflag: Greece\\tGR\\n🇬🇸\\tflag: South Georgia & South Sandwich Islands\\tGS\\n🇬🇹\\tflag: Guatemala\\tGT\\n🇬🇺\\tflag: Guam\\tGU\\n🇬🇼\\tflag: Guinea-Bissau\\tGW\\n🇬🇾\\tflag: Guyana\\tGY\\n🇭🇰\\tflag: Hong Kong SAR China\\tHK\\n🇭🇲\\tflag: Heard & McDonald Islands\\tHM\\n🇭🇳\\tflag: Honduras\\tHN\\n🇭🇷\\tflag: Croatia\\tHR\\n🇭🇹\\tflag: Haiti\\tHT\\n🇭🇺\\tflag: Hungary\\tHU\\n🇮🇨\\tflag: Canary Islands\\tIC\\n🇮🇩\\tflag: Indonesia\\tID\\n🇮🇪\\tflag: Ireland\\tIE\\n🇮🇱\\tflag: Israel\\tIL\\n🇮🇲\\tflag: Isle of Man\\tIM\\n🇮🇳\\tflag: India\\tIN\\n🇮🇴\\tflag: British Indian Ocean Territory\\tIO\\n🇮🇶\\tflag: Iraq\\tIQ\\n🇮🇷\\tflag: Iran\\tIR\\n🇮🇸\\tflag: Iceland\\tIS\\n🇮🇹\\tflag: Italy\\tIT\\n🇯🇪\\tflag: Jersey\\tJE\\n🇯🇲\\tflag: Jamaica\\tJM\\n🇯🇴\\tflag: Jordan\\tJO\\n🇯🇵\\tflag: Japan\\tJP\\n🇰🇪\\tflag: Kenya\\tKE\\n🇰🇬\\tflag: Kyrgyzstan\\tKG\\n🇰🇭\\tflag: Cambodia\\tKH\\n🇰🇮\\tflag: Kiribati\\tKI\\n🇰🇲\\tflag: Comoros\\tKM\\n🇰🇳\\tflag: St. Kitts & Nevis\\tKN\\n🇰🇵\\tflag: North Korea\\tKP\\n🇰🇷\\tflag: South Korea\\tKR\\n🇰🇼\\tflag: Kuwait\\tKW\\n🇰🇾\\tflag: Cayman Islands\\tKY\\n🇰🇿\\tflag: Kazakhstan\\tKZ\\n🇱🇦\\tflag: Laos\\tLA\\n🇱🇧\\tflag: Lebanon\\tLB\\n🇱🇨\\tflag: St. Lucia\\tLC\\n🇱🇮\\tflag: Liechtenstein\\tLI\\n🇱🇰\\tflag: Sri Lanka\\tLK\\n🇱🇷\\tflag: Liberia\\tLR\\n🇱🇸\\tflag: Lesotho\\tLS\\n🇱🇹\\tflag: Lithuania\\tLT\\n🇱🇺\\tflag: Luxembourg\\tLU\\n🇱🇻\\tflag: Latvia\\tLV\\n🇱🇾\\tflag: Libya\\tLY\\n🇲🇦\\tflag: Morocco\\tMA\\n🇲🇨\\tflag: Monaco\\tMC\\n🇲🇩\\tflag: Moldova\\tMD\\n🇲🇪\\tflag: Montenegro\\tME\\n🇲🇫\\tflag: St. Martin\\tMF\\n🇲🇬\\tflag: Madagascar\\tMG\\n🇲🇭\\tflag: Marshall Islands\\tMH\\n🇲🇰\\tflag: North Macedonia\\tMK\\n🇲🇱\\tflag: Mali\\tML\\n🇲🇲\\tflag: Myanmar (Burma)\\tMM\\n🇲🇳\\tflag: Mongolia\\tMN\\n🇲🇴\\tflag: Macao SAR China\\tMO\\n🇲🇵\\tflag: Northern Mariana Islands\\tMP\\n🇲🇶\\tflag: Martinique\\tMQ\\n🇲🇷\\tflag: Mauritania\\tMR\\n🇲🇸\\tflag: Montserrat\\tMS\\n🇲🇹\\tflag: Malta\\tMT\\n🇲🇺\\tflag: Mauritius\\tMU\\n🇲🇻\\tflag: Maldives\\tMV\\n🇲🇼\\tflag: Malawi\\tMW\\n🇲🇽\\tflag: Mexico\\tMX\\n🇲🇾\\tflag: Malaysia\\tMY\\n🇲🇿\\tflag: Mozambique\\tMZ\\n🇳🇦\\tflag: Namibia\\tNA\\n🇳🇨\\tflag: New Caledonia\\tNC\\n🇳🇪\\tflag: Niger\\tNE\\n🇳🇫\\tflag: Norfolk Island\\tNF\\n🇳🇬\\tflag: Nigeria\\tNG\\n🇳🇮\\tflag: Nicaragua\\tNI\\n🇳🇱\\tflag: Netherlands\\tNL\\n🇳🇴\\tflag: Norway\\tNO\\n🇳🇵\\tflag: Nepal\\tNP\\n🇳🇷\\tflag: Nauru\\tNR\\n🇳🇺\\tflag: Niue\\tNU\\n🇳🇿\\tflag: New Zealand\\tNZ\\n🇴🇲\\tflag: Oman\\tOM\\n🇵🇦\\tflag: Panama\\tPA\\n🇵🇪\\tflag: Peru\\tPE\\n🇵🇫\\tflag: French Polynesia\\tPF\\n🇵🇬\\tflag: Papua New Guinea\\tPG\\n🇵🇭\\tflag: Philippines\\tPH\\n🇵🇰\\tflag: Pakistan\\tPK\\n🇵🇱\\tflag: Poland\\tPL\\n🇵🇲\\tflag: St. Pierre & Miquelon\\tPM\\n🇵🇳\\tflag: Pitcairn Islands\\tPN\\n🇵🇷\\tflag: Puerto Rico\\tPR\\n🇵🇸\\tflag: Palestinian Territories\\tPS\\n🇵🇹\\tflag: Portugal\\tPT\\n🇵🇼\\tflag: Palau\\tPW\\n🇵🇾\\tflag: Paraguay\\tPY\\n🇶🇦\\tflag: Qatar\\tQA\\n🇷🇪\\tflag: Réunion\\tRE\\n🇷🇴\\tflag: Romania\\tRO\\n🇷🇸\\tflag: Serbia\\tRS\\n🇷🇺\\tflag: Russia\\tRU\\n🇷🇼\\tflag: Rwanda\\tRW\\n🇸🇦\\tflag: Saudi Arabia\\tSA\\n🇸🇧\\tflag: Solomon Islands\\tSB\\n🇸🇨\\tflag: Seychelles\\tSC\\n🇸🇩\\tflag: Sudan\\tSD\\n🇸🇪\\tflag: Sweden\\tSE\\n🇸🇬\\tflag: Singapore\\tSG\\n🇸🇭\\tflag: St. Helena\\tSH\\n🇸🇮\\tflag: Slovenia\\tSI\\n🇸🇯\\tflag: Svalbard & Jan Mayen\\tSJ\\n🇸🇰\\tflag: Slovakia\\tSK\\n🇸🇱\\tflag: Sierra Leone\\tSL\\n🇸🇲\\tflag: San Marino\\tSM\\n🇸🇳\\tflag: Senegal\\tSN\\n🇸🇴\\tflag: Somalia\\tSO\\n🇸🇷\\tflag: Suriname\\tSR\\n🇸🇸\\tflag: South Sudan\\tSS\\n🇸🇹\\tflag: São Tomé & Príncipe\\tST\\n🇸🇻\\tflag: El Salvador\\tSV\\n🇸🇽\\tflag: Sint Maarten\\tSX\\n🇸🇾\\tflag: Syria\\tSY\\n🇸🇿\\tflag: Eswatini\\tSZ\\n🇹🇦\\tflag: Tristan da Cunha\\tTA\\n🇹🇨\\tflag: Turks & Caicos Islands\\tTC\\n🇹🇩\\tflag: Chad\\tTD\\n🇹🇫\\tflag: French Southern Territories\\tTF\\n🇹🇬\\tflag: Togo\\tTG\\n🇹🇭\\tflag: Thailand\\tTH\\n🇹🇯\\tflag: Tajikistan\\tTJ\\n🇹🇰\\tflag: Tokelau\\tTK\\n🇹🇱\\tflag: Timor-Leste\\tTL\\n🇹🇲\\tflag: Turkmenistan\\tTM\\n🇹🇳\\tflag: Tunisia\\tTN\\n🇹🇴\\tflag: Tonga\\tTO\\n🇹🇷\\tflag: Türkiye\\tTR\\n🇹🇹\\tflag: Trinidad & Tobago\\tTT\\n🇹🇻\\tflag: Tuvalu\\tTV\\n🇹🇼\\tflag: Taiwan\\tTW\\n🇹🇿\\tflag: Tanzania\\tTZ\\n🇺🇦\\tflag: Ukraine\\tUA\\n🇺🇬\\tflag: Uganda\\tUG\\n🇺🇲\\tflag: U.S. Outlying Islands\\tUM\\n🇺🇳\\tflag: United Nations\\tUN\\n🇺🇸\\tflag: United States\\tUS\\n🇺🇾\\tflag: Uruguay\\tUY\\n🇺🇿\\tflag: Uzbekistan\\tUZ\\n🇻🇦\\tflag: Vatican City\\tVA\\n🇻🇨\\tflag: St. Vincent & Grenadines\\tVC\\n🇻🇪\\tflag: Venezuela\\tVE\\n🇻🇬\\tflag: British Virgin Islands\\tVG\\n🇻🇮\\tflag: U.S. Virgin Islands\\tVI\\n🇻🇳\\tflag: Vietnam\\tVN\\n🇻🇺\\tflag: Vanuatu\\tVU\\n🇼🇫\\tflag: Wallis & Futuna\\tWF\\n🇼🇸\\tflag: Samoa\\tWS\\n🇽🇰\\tflag: Kosovo\\tXK\\n🇾🇪\\tflag: Yemen\\tYE\\n🇾🇹\\tflag: Mayotte\\tYT\\n🇿🇦\\tflag: South Africa\\tZA\\n🇿🇲\\tflag: Zambia\\tZM\\n🇿🇼\\tflag: Zimbabwe\\tZW\\n🏴\\tflag: England\\tgbeng\\n🏴\\tflag: Scotland\\tgbsct\\n🏴\\tflag: Wales\\tgbwls\",\n} as const;\n","/**\n * @feat:chat\n * The emoji picker's logic, without React: the bundled emoji by category\n * (`emoji-data.ts`, generated, never fetched), search over their labels and\n * tags, and the person's recent emoji, kept with their drafts (so signing out\n * clears them with the drafts, through `clearDrafts`).\n */\nimport { draftKey } from \"./composer-state\";\nimport { EMOJI_GROUP_DATA } from \"./emoji-data\";\nimport type { DraftStorageLike } from \"./modules\";\n\nexport type EmojiCategoryId = keyof typeof EMOJI_GROUP_DATA;\n\nexport interface EmojiEntry {\n emoji: string;\n label: string;\n /** Search words beyond the label. */\n tags: string;\n}\n\n/** The categories in the order the picker shows them, each with the emoji its tab shows. */\nexport const EMOJI_CATEGORIES: readonly { id: EmojiCategoryId; icon: string }[] = [\n { id: \"smileys\", icon: \"😀\" },\n { id: \"people\", icon: \"👋\" },\n { id: \"nature\", icon: \"🐻\" },\n { id: \"food\", icon: \"🍔\" },\n { id: \"travel\", icon: \"🚗\" },\n { id: \"activities\", icon: \"⚽\" },\n { id: \"objects\", icon: \"💡\" },\n { id: \"symbols\", icon: \"❤️\" },\n { id: \"flags\", icon: \"🏳️\" },\n];\n\nconst parsed = new Map<EmojiCategoryId, EmojiEntry[]>();\n\n/** One category's emoji, parsed the first time it's asked for. */\nexport function emojiInCategory(id: EmojiCategoryId): readonly EmojiEntry[] {\n let list = parsed.get(id);\n if (!list) {\n list = EMOJI_GROUP_DATA[id].split(\"\\n\").map((line) => {\n const [emoji = \"\", label = \"\", tags = \"\"] = line.split(\"\\t\");\n return { emoji, label, tags };\n });\n parsed.set(id, list);\n }\n return list;\n}\n\nlet index: Map<string, EmojiEntry> | null = null;\nfunction byEmoji(): Map<string, EmojiEntry> {\n if (!index) {\n index = new Map();\n for (const c of EMOJI_CATEGORIES) for (const e of emojiInCategory(c.id)) index.set(e.emoji, e);\n }\n return index;\n}\n\n/** An emoji's entry (its label for screen readers), or a bare one for an emoji the data doesn't have. */\nexport function emojiEntry(emoji: string): EmojiEntry {\n return byEmoji().get(emoji) ?? { emoji, label: emoji, tags: \"\" };\n}\n\n/**\n * Emoji whose label or tags have a word starting with every word of the query, those whose\n * label starts with the query first. \"thumbs up\" finds 👍, \"heart\" every heart, \"gri\" 😀.\n */\nexport function searchEmoji(query: string, limit = 120): EmojiEntry[] {\n const words = query.toLowerCase().trim().split(/\\s+/).filter(Boolean);\n if (words.length === 0) return [];\n const whole = words.join(\" \");\n const first: EmojiEntry[] = [];\n const rest: EmojiEntry[] = [];\n for (const e of byEmoji().values()) {\n const label = e.label.toLowerCase();\n const hay = `${label} ${e.tags.toLowerCase()}`.split(/[^\\p{L}\\p{N}]+/u);\n if (!words.every((w) => hay.some((h) => h.startsWith(w)))) continue;\n (label.startsWith(whole) ? first : rest).push(e);\n }\n return [...first, ...rest].slice(0, limit);\n}\n\n/** How many recent emoji the picker keeps. */\nexport const RECENT_EMOJI_MAX = 24;\n\n/** `emoji` first, once, the oldest dropped past `max`. */\nexport function pushRecentEmoji(recents: readonly string[], emoji: string, max = RECENT_EMOJI_MAX): string[] {\n return [emoji, ...recents.filter((e) => e !== emoji)].slice(0, max);\n}\n\n/** Where a person's recent emoji are kept: under their drafts' prefix, so `clearDrafts` removes them too. */\nexport function recentEmojiKey(userId: string): string {\n return draftKey(userId, \"~recent-emoji\");\n}\n\nexport async function loadRecentEmoji(storage: DraftStorageLike, userId: string): Promise<string[]> {\n try {\n const raw = await storage.getItem(recentEmojiKey(userId));\n const list: unknown = raw ? JSON.parse(raw) : [];\n return Array.isArray(list) ? list.filter((e): e is string => typeof e === \"string\" && e.length > 0).slice(0, RECENT_EMOJI_MAX) : [];\n } catch {\n return [];\n }\n}\n\nexport async function saveRecentEmoji(storage: DraftStorageLike, userId: string, recents: readonly string[]): Promise<void> {\n try {\n await storage.setItem(recentEmojiKey(userId), JSON.stringify(recents.slice(0, RECENT_EMOJI_MAX)));\n } catch {\n // Recents are a convenience: losing them is not worth an error.\n }\n}\n\n/** Puts `insert` in place of the selected text (or at the cursor), and where the cursor goes after it. */\nexport function insertAtSelection(text: string, selection: { start: number; end: number } | null, insert: string): { text: string; cursor: number } {\n const start = Math.max(0, Math.min(selection?.start ?? text.length, text.length));\n const end = Math.max(start, Math.min(selection?.end ?? start, text.length));\n return { text: text.slice(0, start) + insert + text.slice(end), cursor: start + insert.length };\n}\n","/**\n * @feat:chat\n * The full emoji picker on genesis-ui-native: a search bar, a row of\n * category tabs (Recent first once there are any), and a grid of emoji.\n * Every emoji is bundled (`emoji-data.ts`) and drawn by the system font:\n * opening it fetches nothing. Recent emoji are kept per person with their\n * drafts (`modules.drafts`), so signing out clears them.\n *\n * `ChatEmojiPicker` is the content, for a sheet of your own (the long-press\n * sheet's \"+\" swaps it in); `ChatEmojiPickerSheet` is it in a NativeSheet\n * (the composer's emoji button).\n */\nimport { memo, useCallback, useEffect, useMemo, useRef, useState } from \"react\";\nimport { FlatList, Pressable, View, useWindowDimensions } from \"react-native\";\nimport { NativeEmptyState, NativeIcon, NativeSearchBar, NativeSheet, NativeText } from \"@marktiderman/genesis-ui-native/components\";\nimport { useThemeRoles } from \"@marktiderman/genesis-ui-native/hooks\";\nimport type { ChatNativeCopy } from \"./copy\";\nimport { useChatNative } from \"./context\";\nimport { EMOJI_CATEGORIES, emojiEntry, emojiInCategory, loadRecentEmoji, pushRecentEmoji, saveRecentEmoji, searchEmoji, type EmojiCategoryId, type EmojiEntry } from \"./emoji\";\n\nexport interface ChatEmojiPickerProps {\n onSelect: (emoji: string) => void;\n /** The signed-in person, whose recent emoji are kept (with `modules.drafts`). Without it, none are kept. */\n userId?: string | null;\n /** Points tall for the grid. Default about 40% of the window. */\n height?: number;\n testID?: string;\n}\n\ntype Tab = EmojiCategoryId | \"recent\";\n\nconst CATEGORY_COPY: Record<EmojiCategoryId, keyof ChatNativeCopy> = {\n smileys: \"emojiSmileys\",\n people: \"emojiPeople\",\n nature: \"emojiNature\",\n food: \"emojiFood\",\n travel: \"emojiTravel\",\n activities: \"emojiActivities\",\n objects: \"emojiObjects\",\n symbols: \"emojiSymbols\",\n flags: \"emojiFlags\",\n};\n\nconst CELL = 44;\n\n// Recents read once per person per launch, then kept here as they change.\nconst recentCache = new Map<string, string[]>();\n\n// Whose stored recents were read this launch (and merged into the cache).\nconst loaded = new Set<string>();\n\n/** Forgets the recent emoji held in memory (one person's, or everyone's): call it on sign-out, with `clearDrafts`. */\nexport function forgetRecentEmoji(userId?: string): void {\n if (userId) {\n recentCache.delete(userId);\n loaded.delete(userId);\n } else {\n recentCache.clear();\n loaded.clear();\n }\n}\n\nexport function ChatEmojiPicker({ onSelect, userId = null, height, testID = \"chat-emoji-picker\" }: ChatEmojiPickerProps) {\n const { modules, copy } = useChatNative();\n const colors = useThemeRoles();\n const { width: windowWidth, height: windowHeight } = useWindowDimensions();\n // Its own width once laid out (a sheet's padding), the window's until then.\n const [width, setWidth] = useState(windowWidth);\n const [query, setQuery] = useState(\"\");\n const [recents, setRecents] = useState<string[]>(() => (userId ? (recentCache.get(userId) ?? []) : []));\n const [tab, setTab] = useState<Tab>(recents.length ? \"recent\" : \"smileys\");\n const storage = modules.drafts;\n\n useEffect(() => {\n if (!userId || !storage || loaded.has(userId)) return;\n loaded.add(userId);\n let live = true;\n void loadRecentEmoji(storage, userId).then((stored) => {\n // Picked while it loaded: those come first, and the merged list is what's kept.\n const picked = recentCache.get(userId) ?? [];\n const list = picked.reduceRight((acc, e) => pushRecentEmoji(acc, e), stored);\n recentCache.set(userId, list);\n if (picked.length) void saveRecentEmoji(storage, userId, list);\n if (!live || list.length === 0) return;\n setRecents(list);\n setTab((t) => (t === \"smileys\" ? \"recent\" : t));\n });\n return () => {\n live = false;\n };\n }, [userId, storage]);\n\n const columns = Math.max(6, Math.floor(width / CELL));\n const gridHeight = height ?? Math.round(windowHeight * 0.4);\n const searching = query.trim().length > 0;\n const data: readonly EmojiEntry[] = useMemo(() => {\n if (searching) return searchEmoji(query);\n if (tab === \"recent\") return recents.map(emojiEntry);\n return emojiInCategory(tab);\n }, [searching, query, tab, recents]);\n\n const listRef = useRef<{ scrollToOffset?: (o: { offset: number; animated: boolean }) => void } | null>(null);\n const choose = useCallback(\n (emoji: string) => {\n onSelect(emoji);\n if (!userId) return;\n const next = pushRecentEmoji(recentCache.get(userId) ?? [], emoji);\n // Kept for next time; the grid on screen doesn't reorder under the finger.\n recentCache.set(userId, next);\n if (storage) void saveRecentEmoji(storage, userId, next);\n },\n [onSelect, userId, storage],\n );\n // The columns share the width, so the grid fills it edge to edge.\n const cellWidth = Math.floor(width / columns);\n const renderItem = useCallback(\n ({ item }: { item: EmojiEntry }) => <EmojiCell entry={item} width={cellWidth} onPress={choose} testID={`${testID}-emoji-${item.emoji}`} />,\n [choose, testID, cellWidth],\n );\n\n const tabs: { id: Tab; label: string; icon: string | null }[] = [\n ...(recents.length ? [{ id: \"recent\" as const, label: copy.recentEmoji, icon: null }] : []),\n ...EMOJI_CATEGORIES.map((c) => ({ id: c.id, label: copy[CATEGORY_COPY[c.id]] as string, icon: c.icon })),\n ];\n const heading = searching ? null : (tabs.find((t) => t.id === tab)?.label ?? null);\n\n return (\n <View testID={testID} style={{ gap: 8 }} onLayout={(e) => e.nativeEvent.layout.width > 0 && setWidth(e.nativeEvent.layout.width)}>\n <NativeSearchBar value={query} onChange={setQuery} placeholder={copy.searchEmoji} cancelLabel={copy.cancel} testID={`${testID}-search`} />\n {searching ? null : (\n <View accessibilityRole=\"tablist\" testID={`${testID}-tabs`} style={{ flexDirection: \"row\", justifyContent: \"space-between\" }}>\n {tabs.map((t) => {\n const on = t.id === tab;\n return (\n <Pressable\n key={t.id}\n testID={`${testID}-tab-${t.id}`}\n accessibilityRole=\"tab\"\n accessibilityLabel={t.label}\n accessibilityState={{ selected: on }}\n onPress={() => {\n setTab(t.id);\n listRef.current?.scrollToOffset?.({ offset: 0, animated: false });\n }}\n style={{ minWidth: 36, height: 44, flexGrow: 1, alignItems: \"center\", justifyContent: \"center\", borderRadius: 10, backgroundColor: on ? colors.fill : undefined }}\n >\n {t.icon ? (\n <NativeText style={{ fontSize: 20, lineHeight: 26, opacity: on ? 1 : 0.55 }}>{t.icon}</NativeText>\n ) : (\n <NativeIcon name=\"clock\" size={20} color={on ? colors.label : colors.secondaryLabel} />\n )}\n </Pressable>\n );\n })}\n </View>\n )}\n {heading ? (\n <NativeText preset=\"caption\" accessibilityRole=\"header\" style={{ color: colors.secondaryLabel, fontWeight: \"600\", paddingHorizontal: 4 }}>\n {heading}\n </NativeText>\n ) : null}\n <View style={{ height: gridHeight }}>\n {data.length === 0 ? (\n <NativeEmptyState variant=\"no-results\" title={copy.noEmoji} testID={`${testID}-empty`} />\n ) : (\n <FlatList\n ref={listRef as never}\n key={columns}\n testID={`${testID}-grid`}\n data={data as EmojiEntry[]}\n numColumns={columns}\n keyExtractor={(e) => e.emoji}\n renderItem={renderItem}\n keyboardShouldPersistTaps=\"handled\"\n keyboardDismissMode=\"on-drag\"\n initialNumToRender={columns * 8}\n // With numColumns, FlatList lays out rows: the index here is a row's.\n getItemLayout={(_d, row) => ({ length: CELL, offset: CELL * row, index: row })}\n />\n )}\n </View>\n </View>\n );\n}\n\nconst EmojiCell = memo(function EmojiCell({ entry, width, onPress, testID }: { entry: EmojiEntry; width: number; onPress: (emoji: string) => void; testID: string }) {\n return (\n <Pressable\n testID={testID}\n accessibilityRole=\"button\"\n accessibilityLabel={entry.label}\n onPress={() => onPress(entry.emoji)}\n style={{ width: Math.max(CELL, width), height: CELL, alignItems: \"center\", justifyContent: \"center\" }}\n >\n {/* A line height of its own: the text preset's is a body line's and clips a 28pt glyph. */}\n <NativeText style={{ fontSize: 28, lineHeight: 36 }} accessible={false}>\n {entry.emoji}\n </NativeText>\n </Pressable>\n );\n});\n\nexport interface ChatEmojiPickerSheetProps extends Omit<ChatEmojiPickerProps, \"onSelect\"> {\n open: boolean;\n onClose: () => void;\n /** An emoji was chosen. The sheet stays open, for another. */\n onSelect: (emoji: string) => void;\n}\n\n/** The picker in a sheet, with a title and Done. */\nexport function ChatEmojiPickerSheet({ open, onClose, onSelect, testID = \"chat-emoji-sheet\", ...rest }: ChatEmojiPickerSheetProps) {\n const { copy } = useChatNative();\n const colors = useThemeRoles();\n return (\n <NativeSheet open={open} onOpenChange={(o) => (o ? undefined : onClose())} testID={testID}>\n <View style={{ gap: 4, paddingHorizontal: 16 }}>\n <View style={{ flexDirection: \"row\", alignItems: \"center\", justifyContent: \"space-between\", minHeight: 44 }}>\n <NativeText preset=\"h4\" accessibilityRole=\"header\">\n {copy.emojiPicker}\n </NativeText>\n <Pressable testID={`${testID}-done`} accessibilityRole=\"button\" accessibilityLabel={copy.closeViewer} onPress={onClose} style={{ minWidth: 44, minHeight: 44, alignItems: \"center\", justifyContent: \"center\" }}>\n <NativeIcon name=\"close\" size={22} color={colors.secondaryLabel} />\n </Pressable>\n </View>\n {open ? <ChatEmojiPicker onSelect={onSelect} testID={`${testID}-picker`} {...rest} /> : null}\n </View>\n </NativeSheet>\n );\n}\n","/**\n * @feat:chat\n * The voice recorder as a state machine, apart from expo-audio so it can be\n * tested: hold the mic to record, slide left to cancel, slide up to lock and\n * record hands-free, release (or tap send when locked) to send. A recording\n * shorter than `minMs` is dropped, and one that reaches the role's limit is\n * sent. Each step returns the effects the hook carries out.\n */\nimport type { HapticEvent } from \"./modules\";\n\nexport type RecorderPhase = \"idle\" | \"starting\" | \"recording\" | \"finishing\";\n\nexport type RecorderNotice = \"denied\" | \"too-short\" | \"error\" | \"interrupted\";\n\nexport interface RecorderState {\n phase: RecorderPhase;\n /** Hands-free: released without stopping. */\n locked: boolean;\n /** The finger has slid far enough left that letting go cancels. */\n cancelArmed: boolean;\n /** Let go while the microphone was still starting. */\n releasedEarly: boolean;\n durationMs: number;\n /** Level readings (dB) since the start, for the live waveform and the sent one. */\n levels: number[];\n /**\n * Why the last attempt ended without a voice note: \"denied\" (no microphone), \"too-short\",\n * \"error\" (the recording couldn't be saved), \"interrupted\" (a call, Siri, another app or the\n * app going to the background took the microphone; what was recorded is thrown away).\n */\n notice: RecorderNotice | null;\n}\n\nexport const idleRecorder: RecorderState = {\n phase: \"idle\",\n locked: false,\n cancelArmed: false,\n releasedEarly: false,\n durationMs: 0,\n levels: [],\n notice: null,\n};\n\nexport type RecorderEvent =\n | { type: \"press\" }\n | { type: \"ready\" }\n | { type: \"failed\"; reason: \"denied\" | \"error\" }\n | { type: \"move\"; dx: number; dy: number }\n | { type: \"release\" }\n | { type: \"send\" }\n | { type: \"cancel\" }\n | { type: \"tick\"; durationMs: number; meteringDb?: number }\n /** Something else took the microphone (a call, Siri, the app went to the background). */\n | { type: \"interrupted\" }\n /** The stop is done: `ok` false when no voice note came of it (the stop threw, no file). */\n | { type: \"finished\"; ok?: boolean };\n\nexport type RecorderEffect =\n | { type: \"prepare\" }\n | { type: \"record\" }\n /** Stop and send what was recorded. */\n | { type: \"finish\" }\n /** Stop and throw it away. */\n | { type: \"discard\" }\n | { type: \"haptic\"; event: HapticEvent }\n /** Tell the others you are recording. */\n | { type: \"signal\" };\n\nexport interface RecorderConfig {\n /** The longest recording (recordingLimitMs(role)). */\n limitMs: number;\n /** Shorter than this is a tap, not a voice note. Default 700 ms. */\n minMs?: number;\n /** Points left that cancel. Default 120. */\n cancelDistance?: number;\n /** Points up that lock. Default 80. */\n lockDistance?: number;\n /** Most level readings kept (one every ~100 ms). Default 3000 (5 minutes). */\n maxLevels?: number;\n}\n\nexport interface Step {\n state: RecorderState;\n effects: RecorderEffect[];\n}\n\nconst stay = (state: RecorderState): Step => ({ state, effects: [] });\n\nexport function recorderStep(state: RecorderState, event: RecorderEvent, config: RecorderConfig): Step {\n const minMs = config.minMs ?? 700;\n const cancelDistance = config.cancelDistance ?? 120;\n const lockDistance = config.lockDistance ?? 80;\n const maxLevels = config.maxLevels ?? 3000;\n\n switch (event.type) {\n case \"press\":\n if (state.phase !== \"idle\") return stay(state);\n return { state: { ...idleRecorder, phase: \"starting\" }, effects: [{ type: \"prepare\" }] };\n\n case \"ready\":\n // A prepare that finished after its attempt was cancelled: let the microphone go.\n if (state.phase !== \"starting\") return { state, effects: [{ type: \"discard\" }] };\n if (state.releasedEarly) {\n return { state: { ...idleRecorder, notice: \"too-short\" }, effects: [{ type: \"discard\" }] };\n }\n return {\n state: { ...state, phase: \"recording\" },\n effects: [{ type: \"record\" }, { type: \"haptic\", event: \"record-start\" }, { type: \"signal\" }],\n };\n\n case \"failed\":\n if (state.phase === \"idle\") return stay(state);\n return { state: { ...idleRecorder, notice: event.reason }, effects: [{ type: \"discard\" }, { type: \"haptic\", event: \"error\" }] };\n\n case \"move\": {\n if (state.phase !== \"recording\" || state.locked) return stay(state);\n if (event.dx <= -cancelDistance) {\n return { state: idleRecorder, effects: [{ type: \"discard\" }, { type: \"haptic\", event: \"record-cancel\" }] };\n }\n if (event.dy <= -lockDistance) {\n return { state: { ...state, locked: true, cancelArmed: false }, effects: [{ type: \"haptic\", event: \"record-lock\" }] };\n }\n const cancelArmed = event.dx <= -cancelDistance / 2;\n return cancelArmed === state.cancelArmed ? stay(state) : stay({ ...state, cancelArmed });\n }\n\n case \"release\":\n if (state.phase === \"starting\") return stay({ ...state, releasedEarly: true });\n if (state.phase !== \"recording\" || state.locked) return stay(state);\n if (state.cancelArmed) {\n return { state: idleRecorder, effects: [{ type: \"discard\" }, { type: \"haptic\", event: \"record-cancel\" }] };\n }\n if (state.durationMs < minMs) {\n return { state: { ...idleRecorder, notice: \"too-short\" }, effects: [{ type: \"discard\" }] };\n }\n return { state: { ...state, phase: \"finishing\" }, effects: [{ type: \"finish\" }, { type: \"haptic\", event: \"send\" }] };\n\n case \"send\":\n if (state.phase !== \"recording\") return stay(state);\n if (state.durationMs < minMs) {\n return { state: { ...idleRecorder, notice: \"too-short\" }, effects: [{ type: \"discard\" }] };\n }\n return { state: { ...state, phase: \"finishing\" }, effects: [{ type: \"finish\" }, { type: \"haptic\", event: \"send\" }] };\n\n case \"cancel\":\n if (state.phase === \"idle\" || state.phase === \"finishing\") return stay(state);\n return { state: idleRecorder, effects: [{ type: \"discard\" }, { type: \"haptic\", event: \"record-cancel\" }] };\n\n case \"interrupted\":\n // Never sent on its own: the person didn't say send. A stop already under way finishes.\n if (state.phase === \"idle\" || state.phase === \"finishing\") return stay(state);\n return { state: { ...idleRecorder, notice: \"interrupted\" }, effects: [{ type: \"discard\" }, { type: \"haptic\", event: \"error\" }] };\n\n case \"tick\": {\n if (state.phase !== \"recording\") return stay(state);\n const levels =\n event.meteringDb === undefined ? state.levels : [...state.levels, event.meteringDb].slice(-maxLevels);\n const next = { ...state, durationMs: event.durationMs, levels };\n if (event.durationMs >= config.limitMs) {\n return { state: { ...next, phase: \"finishing\" }, effects: [{ type: \"finish\" }, { type: \"haptic\", event: \"send\" }] };\n }\n return { state: next, effects: [{ type: \"signal\" }] };\n }\n\n case \"finished\":\n if (event.ok === false) return { state: { ...idleRecorder, notice: \"error\" }, effects: [{ type: \"haptic\", event: \"error\" }] };\n return stay(idleRecorder);\n }\n}\n\n/** The last `count` levels as bar heights 0–1, for the live waveform while recording. */\nexport function liveBars(levelsDb: readonly number[], count = 32): number[] {\n const recent = levelsDb.slice(-count);\n const bars = recent.map((db) => (Number.isFinite(db) ? Math.max(0, Math.min(1, (Math.max(-60, db) + 60) / 60)) : 0));\n return [...new Array(Math.max(0, count - bars.length)).fill(0), ...bars];\n}\n","/**\n * @feat:chat\n * The recorder machine on expo-audio: asks for the microphone, records with\n * metering on, reads the level every 100 ms for the live waveform (and to tell\n * the others you are recording), and hands back a voice note as a LocalFile\n * whose meta carries its duration and waveform, ready for `send`.\n *\n * Interruptions end the attempt cleanly, with a notice: the app going to the\n * background, or the recorder stopping on its own (a phone call, Siri, another\n * app taking the microphone) or its status no longer reading. A stop that fails\n * or leaves no file says so. Leaving the screen while a stop is under way lets\n * that stop finish and send what was recorded.\n */\nimport { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\nimport { AppState } from \"react-native\";\nimport { waveformFromMetering } from \"../core/media\";\nimport type { LocalFile } from \"../core/outbox\";\nimport { haptic, type ExpoAudioLike, type HapticsLike } from \"./modules\";\nimport { idleRecorder, recorderStep, type RecorderConfig, type RecorderEffect, type RecorderEvent, type RecorderState } from \"./recorder-machine\";\n\nexport interface UseVoiceRecorderOptions extends Omit<RecorderConfig, \"limitMs\"> {\n limitMs: number;\n onRecorded: (file: LocalFile) => void;\n /** `useConversation().signalRecording` (throttled there). */\n signalRecording?: () => void;\n haptics?: HapticsLike;\n /** How often the level is read. Default 100 ms. */\n intervalMs?: number;\n}\n\n/** Reads in a row that show the recorder stopped (or can't be read) before it counts as interrupted. */\nexport const RECORDER_STALL_READS = 3;\n/** Reads after `record()` that may pass before the recorder says it is recording; then the attempt failed. */\nexport const RECORDER_START_READS = 10;\n\n/** The voice note a finished recording becomes. */\nexport function voiceNoteFile(uri: string, durationMs: number, levelsDb: readonly number[]): LocalFile {\n return {\n data: uri,\n name: \"voice.m4a\",\n contentType: \"audio/mp4\",\n meta: { kind: \"voice\", durationMs: Math.round(durationMs), waveform: waveformFromMetering([...levelsDb]) },\n };\n}\n\nexport function useVoiceRecorder(audio: ExpoAudioLike, options: UseVoiceRecorderOptions) {\n const recorder = audio.useAudioRecorder(useMemo(() => ({ ...audio.RecordingPresets.HIGH_QUALITY, isMeteringEnabled: true }), [audio]));\n const [state, setState] = useState<RecorderState>(idleRecorder);\n const stateRef = useRef(state);\n const latest = useRef(options);\n latest.current = options;\n const timer = useRef<ReturnType<typeof setInterval> | null>(null);\n const recording = useRef(false);\n // A stop (finish) under way: unmounting leaves it to finish rather than stopping twice.\n const stopping = useRef(false);\n // Each press is an attempt; an async step that finishes after its attempt ended is dropped.\n const attempt = useRef(0);\n const mounted = useRef(true);\n\n const stopTimer = () => {\n if (timer.current) clearInterval(timer.current);\n timer.current = null;\n };\n\n // Never throws: letting the microphone go is best effort.\n const releaseAudio = () => {\n try {\n void Promise.resolve(audio.setAudioModeAsync({ allowsRecording: false })).catch(() => undefined);\n } catch {\n // The audio module is already gone.\n }\n };\n\n const dispatchRef = useRef<(event: RecorderEvent) => void>(() => undefined);\n\n const run = useCallback(\n (effect: RecorderEffect, after: RecorderState) => {\n const dispatch = dispatchRef.current;\n switch (effect.type) {\n case \"prepare\": {\n const mine = ++attempt.current;\n const current = () => mounted.current && attempt.current === mine && stateRef.current.phase === \"starting\";\n void (async () => {\n try {\n const permission = await audio.requestRecordingPermissionsAsync();\n if (!current()) return;\n if (!permission.granted) return dispatch({ type: \"failed\", reason: \"denied\" });\n await audio.setAudioModeAsync({ allowsRecording: true, playsInSilentMode: true });\n if (!current()) return releaseAudio();\n await recorder.prepareToRecordAsync();\n if (!current()) return releaseAudio();\n dispatch({ type: \"ready\" });\n } catch {\n if (current()) dispatch({ type: \"failed\", reason: \"error\" });\n else releaseAudio();\n }\n })();\n return;\n }\n case \"record\": {\n try {\n recorder.record();\n } catch {\n dispatch({ type: \"failed\", reason: \"error\" });\n return;\n }\n recording.current = true;\n stopTimer();\n // Reads in a row where the recorder had stopped by itself or couldn't be read: a few\n // mean something else has the microphone, and the attempt ends instead of freezing.\n let stalled = 0;\n let sawRecording = false;\n let reads = 0;\n timer.current = setInterval(() => {\n reads++;\n let s: ReturnType<typeof recorder.getStatus> | null = null;\n try {\n s = recorder.getStatus();\n } catch {\n s = null;\n }\n if (s && s.isRecording) sawRecording = true;\n // Before the first read that says recording, a stopped recorder is still starting.\n const bad = !s || (sawRecording && !s.isRecording);\n stalled = bad ? stalled + 1 : 0;\n if (stalled >= RECORDER_STALL_READS) return dispatch({ type: \"interrupted\" });\n // record() that never started (the microphone was taken before it began): not a frozen 0:00.\n if (!sawRecording && reads >= RECORDER_START_READS) return dispatch({ type: \"failed\", reason: \"error\" });\n if (s && !bad) dispatch({ type: \"tick\", durationMs: s.durationMillis, meteringDb: s.metering });\n }, latest.current.intervalMs ?? 100);\n return;\n }\n case \"finish\":\n stopTimer();\n stopping.current = true;\n void (async () => {\n let ok = false;\n const read = <T,>(get: () => T): T | null => {\n try {\n return get();\n } catch {\n return null;\n }\n };\n try {\n const status = recorder.getStatus();\n // Known before the stop (from prepare): the native recorder may be released while it stops.\n const before = read(() => recorder.uri) ?? status.url;\n await recorder.stop();\n const uri = read(() => recorder.uri) ?? before;\n const durationMs = Math.max(after.durationMs, status.durationMillis || 0);\n if (uri) {\n latest.current.onRecorded(voiceNoteFile(uri, durationMs, after.levels));\n ok = true;\n }\n } catch {\n // Nothing usable was recorded: the notice says so.\n } finally {\n recording.current = false;\n stopping.current = false;\n releaseAudio();\n dispatch({ type: \"finished\", ok });\n }\n })();\n return;\n case \"discard\":\n attempt.current++;\n stopTimer();\n if (recording.current && !stopping.current) {\n recording.current = false;\n void recorder.stop().catch(() => undefined);\n }\n releaseAudio();\n return;\n case \"haptic\":\n haptic(latest.current.haptics, effect.event);\n return;\n case \"signal\":\n latest.current.signalRecording?.();\n return;\n }\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [audio, recorder],\n );\n\n const dispatch = useCallback(\n (event: RecorderEvent) => {\n if (!mounted.current) return;\n const { limitMs, minMs, cancelDistance, lockDistance, maxLevels } = latest.current;\n const step = recorderStep(stateRef.current, event, { limitMs, minMs, cancelDistance, lockDistance, maxLevels });\n if (step.state !== stateRef.current) {\n stateRef.current = step.state;\n setState(step.state);\n }\n for (const effect of step.effects) run(effect, step.state);\n },\n [run],\n );\n dispatchRef.current = dispatch;\n\n // Leaving the screen mid-recording throws the recording away; a stop under way finishes and sends.\n useEffect(() => {\n mounted.current = true;\n return () => {\n mounted.current = false;\n attempt.current++;\n stateRef.current = idleRecorder;\n stopTimer();\n if (stopping.current) return;\n if (recording.current) {\n recording.current = false;\n try {\n void recorder.stop().catch(() => undefined);\n } catch {\n // The recorder is already gone.\n }\n }\n releaseAudio();\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [recorder]);\n\n // The app going to the background ends a recording (iOS takes the microphone from a backgrounded\n // app). Only once recording: Android reports the microphone permission dialog as the background.\n useEffect(() => {\n const sub = AppState?.addEventListener?.(\"change\", (next) => {\n if (next === \"background\" && stateRef.current.phase === \"recording\") dispatchRef.current({ type: \"interrupted\" });\n });\n return () => sub?.remove?.();\n }, []);\n\n return { state, dispatch };\n}\n","/**\n * @feat:chat\n * The composer: a field that grows with its text, photos and videos from the\n * library or camera and a pasted picture (attached as thumbnails), what the\n * message replies to, Send with a haptic, and, with expo-audio, the mic: hold\n * to record, slide left to cancel, slide up to lock and record hands-free.\n * The emoji button opens the full picker, which types where the cursor is.\n * With `onRecordVideo`, a camera button opens the video recorder. When the\n * person can't post, it says why instead of taking input.\n */\nimport { useEffect, useMemo, useRef, useState } from \"react\";\nimport { PanResponder, Pressable, ScrollView, TextInput, View } from \"react-native\";\nimport { NativeIcon, NativeImage, NativeListItem, NativeSheet, NativeText } from \"@marktiderman/genesis-ui-native/components\";\nimport { useThemeRoles } from \"@marktiderman/genesis-ui-native/hooks\";\nimport { CHAT_LIMITS, formatDuration, recordingLimitMs } from \"../core/media\";\nimport type { LocalFile } from \"../core/outbox\";\nimport type { ChatRole } from \"../core/types\";\nimport { canSend, fileFromDataUri, filesFromAssets, toSend } from \"./composer-state\";\nimport { fill } from \"./copy\";\nimport { useChatNative } from \"./context\";\nimport { insertAtSelection } from \"./emoji\";\nimport { ChatEmojiPickerSheet } from \"./emoji-picker\";\nimport { haptic, type ExpoAudioLike } from \"./modules\";\nimport { liveBars } from \"./recorder-machine\";\nimport type { ChatComposerHandle } from \"./use-composer\";\nimport { useVoiceRecorder } from \"./use-voice-recorder\";\n\nexport interface ChatComposerProps {\n composer: ChatComposerHandle;\n /** null while it loads. */\n canPost: boolean | null;\n /** Why not, when `canPost` is false (`composerDisabledReason`). */\n disabledReason: string | null;\n role: ChatRole | null;\n onSend: (payload: ReturnType<typeof toSend>) => void;\n signalTyping?: () => void;\n signalRecording?: () => void;\n /** The signed-in person (`useChat().userId`), whose recent emoji the picker keeps. */\n userId?: string | null;\n /** Touch and hold Send (or VoiceOver's action on it) to schedule what's written (`ChatScheduleSheet`). */\n onSchedule?: () => void;\n /** The field's placeholder (\"Message #Week 1\" in a topic). */\n placeholder?: string;\n /** Opens the video recorder (`ChatVideoRecorder`); with it, a camera button sits beside attach. */\n onRecordVideo?: () => void;\n testID?: string;\n}\n\nexport function ChatComposer(props: ChatComposerProps) {\n const { modules } = useChatNative();\n if (props.canPost === false) return <DisabledComposer reason={props.disabledReason} testID={props.testID ?? \"chat-composer\"} />;\n return modules.audio ? <ComposerWithVoice {...props} audio={modules.audio} /> : <ComposerBody {...props} voice={null} />;\n}\n\nfunction DisabledComposer({ reason, testID }: { reason: string | null; testID: string }) {\n const colors = useThemeRoles();\n const { copy } = useChatNative();\n return (\n <View testID={`${testID}-disabled`} accessible accessibilityRole=\"text\" style={{ padding: 16, alignItems: \"center\", backgroundColor: colors.groupedBackground }}>\n <NativeText preset=\"body-sm\" style={{ color: colors.secondaryLabel, textAlign: \"center\" }}>\n {reason ?? copy.cantPost}\n </NativeText>\n </View>\n );\n}\n\ntype Voice = ReturnType<typeof useVoiceRecorder>;\n\nfunction ComposerWithVoice(props: ChatComposerProps & { audio: ExpoAudioLike }) {\n const { modules } = useChatNative();\n const { composer, role, onSend } = props;\n // What the note replies to is taken when recording starts: the composer may change before it lands.\n const replyAtStart = useRef<string | null>(null);\n const voice = useVoiceRecorder(props.audio, {\n limitMs: recordingLimitMs(role),\n haptics: modules.haptics,\n signalRecording: props.signalRecording,\n // A voice note goes on its own, with what it replied to when recording started.\n onRecorded: (file: LocalFile) => {\n const replyToId = replyAtStart.current;\n replyAtStart.current = null;\n onSend({ input: { body: \"\", replyToId, mentions: [] }, files: [file] });\n if (replyToId && composer.state.replyTo?.messageId === replyToId) composer.setReply(null);\n },\n });\n const phase = voice.state.phase;\n useEffect(() => {\n if (phase === \"starting\") replyAtStart.current = composer.state.replyTo?.messageId ?? null;\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [phase]);\n return <ComposerBody {...props} voice={voice} />;\n}\n\nfunction ComposerBody({ composer, canPost, onSend, signalTyping, onRecordVideo, onSchedule, placeholder, voice, userId, testID = \"chat-composer\" }: ChatComposerProps & { voice: Voice | null }) {\n const { modules, copy } = useChatNative();\n const colors = useThemeRoles();\n const { state, dispatch } = composer;\n const [attachOpen, setAttachOpen] = useState(false);\n const [canPaste, setCanPaste] = useState(false);\n const [emojiOpen, setEmojiOpen] = useState(false);\n // Where the cursor is, so an emoji from the picker goes there.\n const selection = useRef<{ start: number; end: number } | null>(null);\n // The text as last typed or inserted: two picks before a re-render both land.\n const latestText = useRef(state.text);\n latestText.current = state.text;\n const insertEmoji = (emoji: string) => {\n const next = insertAtSelection(latestText.current, selection.current, emoji);\n latestText.current = next.text;\n selection.current = { start: next.cursor, end: next.cursor };\n dispatch({ type: \"text\", text: next.text });\n signalTyping?.();\n };\n const ready = canPost === true;\n const sendable = canSend(state, ready);\n const recording = voice && voice.state.phase !== \"idle\";\n const voiceNotice = voice?.state.phase === \"idle\" ? voice.state.notice : null;\n const notice =\n state.notice ??\n (voiceNotice === \"denied\" ? copy.micDenied : voiceNotice === \"too-short\" ? copy.tooShort : voiceNotice === \"error\" ? copy.recordingFailed : voiceNotice === \"interrupted\" ? copy.recordingInterrupted : null);\n\n const send = () => {\n if (!sendable) return;\n const payload = composer.take();\n if (!payload) return;\n haptic(modules.haptics, \"send\");\n onSend(payload);\n };\n\n const openAttach = async () => {\n let paste = false;\n try {\n paste = Boolean(await modules.clipboard?.hasImageAsync?.());\n } catch {\n paste = false;\n }\n setCanPaste(paste);\n // One source: straight to the picker, no sheet in between.\n if (!paste && !modules.imagePicker?.launchCameraAsync && modules.imagePicker) return pick(\"library\", false);\n setAttachOpen(true);\n };\n\n const remaining = CHAT_LIMITS.attachmentsPerMessage - state.attachments.length;\n // The picker opens once the sheet has gone: iOS won't present one modal while another is dismissing.\n const afterSheet = () => new Promise<void>((resolve) => setTimeout(resolve, 800));\n const pick = async (from: \"library\" | \"camera\", fromSheet = true) => {\n setAttachOpen(false);\n const picker = modules.imagePicker;\n if (!picker) return;\n if (fromSheet) await afterSheet();\n try {\n if (from === \"camera\") {\n const permission = await picker.requestCameraPermissionsAsync?.();\n if (permission && !permission.granted) return;\n }\n const result =\n from === \"camera\"\n ? await picker.launchCameraAsync?.({ mediaTypes: [\"images\", \"videos\"], quality: 0.8 })\n : await picker.launchImageLibraryAsync({ mediaTypes: [\"images\", \"videos\"], allowsMultipleSelection: true, selectionLimit: Math.max(1, remaining), quality: 0.8 });\n if (!result || result.canceled || !result.assets?.length) return;\n const { attachments, notice } = filesFromAssets(result.assets, copy);\n dispatch({ type: \"add\", attachments, notice, tooMany: fill(copy.tooMany, { count: CHAT_LIMITS.attachmentsPerMessage }) });\n } catch {\n haptic(modules.haptics, \"error\");\n }\n };\n\n const paste = async () => {\n setAttachOpen(false);\n try {\n const image = await modules.clipboard?.getImageAsync?.({ format: \"png\" });\n const attachment = image ? fileFromDataUri(image.data, image.size) : null;\n if (attachment) dispatch({ type: \"add\", attachments: [attachment], tooMany: fill(copy.tooMany, { count: CHAT_LIMITS.attachmentsPerMessage }) });\n } catch {\n haptic(modules.haptics, \"error\");\n }\n };\n\n return (\n <View testID={testID} style={{ backgroundColor: colors.groupedBackground, paddingHorizontal: 8, paddingTop: 6, paddingBottom: 6, gap: 6 }}>\n {notice ? (\n <NativeText testID={`${testID}-notice`} accessibilityLiveRegion=\"polite\" preset=\"caption\" style={{ color: colors.destructive, paddingHorizontal: 8 }}>\n {notice}\n </NativeText>\n ) : null}\n {state.replyTo ? (\n <View testID={`${testID}-reply`} style={{ flexDirection: \"row\", alignItems: \"center\", paddingLeft: 12, borderLeftWidth: 3, borderLeftColor: colors.tint, marginHorizontal: 4 }}>\n <View style={{ flex: 1 }}>\n <NativeText preset=\"caption\" style={{ color: colors.tint, fontWeight: \"600\" }}>\n {fill(copy.replyingTo, { name: state.replyTo.name })}\n </NativeText>\n <NativeText preset=\"caption\" numberOfLines={1} style={{ color: colors.secondaryLabel }}>\n {state.replyTo.preview}\n </NativeText>\n </View>\n <IconButton testID={`${testID}-reply-cancel`} icon=\"close\" label={copy.cancelReply} onPress={() => composer.setReply(null)} color={colors.secondaryLabel} />\n </View>\n ) : null}\n {state.attachments.length ? (\n <ScrollView horizontal showsHorizontalScrollIndicator={false} testID={`${testID}-attachments`} contentContainerStyle={{ gap: 8, paddingHorizontal: 4 }}>\n {state.attachments.map((a) => (\n <View key={a.key} testID={`${testID}-attachment-${a.key}`} style={{ width: 64, height: 64 }}>\n {a.file.previewUrl && (a.file.meta?.kind ?? \"image\") === \"image\" ? (\n <NativeImage src={a.file.previewUrl} width={64} height={64} className=\"rounded-xl\" alt={a.file.name} />\n ) : (\n <View style={{ width: 64, height: 64, borderRadius: 12, backgroundColor: colors.fill, alignItems: \"center\", justifyContent: \"center\" }}>\n <NativeIcon name={a.file.contentType.startsWith(\"video/\") ? \"play\" : \"file\"} size={22} />\n </View>\n )}\n <Pressable\n testID={`${testID}-attachment-${a.key}-remove`}\n accessibilityRole=\"button\"\n accessibilityLabel={fill(copy.removeAttachment, { name: a.file.name })}\n onPress={() => dispatch({ type: \"remove\", key: a.key })}\n hitSlop={12}\n style={{ position: \"absolute\", top: -6, right: -6, width: 24, height: 24, borderRadius: 12, backgroundColor: colors.label, alignItems: \"center\", justifyContent: \"center\" }}\n >\n <NativeIcon name=\"close\" size={14} color={colors.surface} />\n </Pressable>\n </View>\n ))}\n </ScrollView>\n ) : null}\n <View style={{ flexDirection: \"row\", alignItems: \"flex-end\", gap: 4 }}>\n {recording && voice ? (\n <RecordingBar voice={voice} testID={testID} />\n ) : (\n <>\n {modules.imagePicker || modules.clipboard?.getImageAsync ? (\n <IconButton testID={`${testID}-attach`} icon=\"plus\" label={copy.attach} onPress={() => void openAttach()} color={colors.tint} disabled={!ready} />\n ) : null}\n {onRecordVideo ? (\n <IconButton testID={`${testID}-video`} icon=\"video\" label={copy.recordVideo} onPress={onRecordVideo} color={colors.tint} disabled={!ready} />\n ) : null}\n <TextInput\n testID={`${testID}-input`}\n value={state.text}\n onChangeText={(text) => {\n dispatch({ type: \"text\", text });\n if (text) signalTyping?.();\n }}\n onSelectionChange={(e) => {\n selection.current = e.nativeEvent.selection;\n }}\n placeholder={placeholder ?? copy.placeholder}\n placeholderTextColor={colors.tertiaryLabel as string}\n accessibilityLabel={placeholder ?? copy.placeholder}\n editable={ready}\n multiline\n maxLength={CHAT_LIMITS.bodyChars}\n style={{\n flex: 1,\n minHeight: 40,\n maxHeight: 140,\n paddingHorizontal: 14,\n paddingTop: 10,\n paddingBottom: 10,\n borderRadius: 20,\n fontSize: 17,\n color: colors.label as string,\n backgroundColor: colors.surface,\n }}\n />\n <IconButton testID={`${testID}-emoji`} icon=\"smile\" label={copy.addEmoji} onPress={() => setEmojiOpen(true)} color={colors.secondaryLabel} disabled={!ready} />\n </>\n )}\n {sendable && !recording ? (\n <IconButton testID={`${testID}-send`} icon=\"arrow-up\" label={copy.send} onPress={send} onLongPress={onSchedule} longPressLabel={onSchedule ? copy.schedule : undefined} filled color={colors.tint} />\n ) : voice ? (\n <MicButton voice={voice} testID={testID} disabled={!ready} />\n ) : (\n <IconButton testID={`${testID}-send`} icon=\"arrow-up\" label={copy.send} onPress={send} filled color={colors.tint} disabled />\n )}\n </View>\n <ChatEmojiPickerSheet open={emojiOpen} onClose={() => setEmojiOpen(false)} onSelect={insertEmoji} userId={userId} testID={`${testID}-emoji-sheet`} />\n <NativeSheet open={attachOpen} onOpenChange={setAttachOpen} testID={`${testID}-attach-sheet`}>\n <View>\n {modules.imagePicker ? (\n <NativeListItem testID={`${testID}-attach-library`} title={copy.attachLibrary} leading={<NativeIcon name=\"image\" />} onPress={() => void pick(\"library\")} />\n ) : null}\n {modules.imagePicker?.launchCameraAsync ? (\n <NativeListItem testID={`${testID}-attach-camera`} title={copy.attachCamera} leading={<NativeIcon name=\"camera\" />} onPress={() => void pick(\"camera\")} />\n ) : null}\n {canPaste ? (\n <NativeListItem testID={`${testID}-attach-paste`} title={copy.attachPaste} leading={<NativeIcon name=\"copy\" />} onPress={() => void paste()} />\n ) : null}\n </View>\n </NativeSheet>\n </View>\n );\n}\n\nfunction IconButton({\n icon,\n label,\n onPress,\n color,\n filled = false,\n disabled = false,\n onLongPress,\n longPressLabel,\n testID,\n}: {\n icon: \"plus\" | \"arrow-up\" | \"close\" | \"trash\" | \"mic\" | \"video\" | \"smile\";\n label: string;\n onPress: () => void;\n onLongPress?: () => void;\n /** The long press as a VoiceOver / TalkBack action. */\n longPressLabel?: string;\n color: unknown;\n filled?: boolean;\n disabled?: boolean;\n testID: string;\n}) {\n const colors = useThemeRoles();\n return (\n <Pressable\n testID={testID}\n accessibilityRole=\"button\"\n accessibilityLabel={label}\n accessibilityState={{ disabled }}\n disabled={disabled}\n onPress={onPress}\n onLongPress={onLongPress}\n delayLongPress={onLongPress ? 400 : undefined}\n accessibilityActions={onLongPress && longPressLabel ? [{ name: \"longpress\", label: longPressLabel }] : undefined}\n onAccessibilityAction={onLongPress ? (e) => e.nativeEvent.actionName === \"longpress\" && onLongPress() : undefined}\n style={{ width: 44, height: 44, alignItems: \"center\", justifyContent: \"center\", opacity: disabled ? 0.4 : 1 }}\n >\n {filled ? (\n <View style={{ width: 34, height: 34, borderRadius: 17, backgroundColor: color as string, alignItems: \"center\", justifyContent: \"center\" }}>\n <NativeIcon name={icon} size={18} color={colors.surface} weight=\"semibold\" />\n </View>\n ) : (\n <NativeIcon name={icon} size={24} color={color as string} />\n )}\n </Pressable>\n );\n}\n\n/**\n * Hold to record. While held, the finger's movement slides to cancel or up to lock; locked, the\n * same button stops and sends. It stays one view throughout: swapping in another button while\n * the finger that locked is still down left the touch with a responder that no longer existed,\n * and the next tap anywhere on the screen did nothing.\n */\nfunction MicButton({ voice, disabled, testID }: { voice: Voice; disabled: boolean; testID: string }) {\n const { copy } = useChatNative();\n const colors = useThemeRoles();\n const { state, dispatch } = voice;\n const latest = useRef(dispatch);\n latest.current = dispatch;\n const locked = state.phase === \"recording\" && state.locked;\n const lockedNow = useRef(locked);\n lockedNow.current = locked;\n // VoiceOver and TalkBack can't hold and slide: a double tap starts a locked (hands-free) recording.\n const lockWhenReady = useRef(false);\n useEffect(() => {\n if (state.phase === \"recording\" && lockWhenReady.current) {\n lockWhenReady.current = false;\n dispatch({ type: \"move\", dx: 0, dy: -10_000 });\n }\n if (state.phase === \"idle\") lockWhenReady.current = false;\n }, [state.phase, dispatch]);\n\n const responder = useMemo(() => {\n // A touch that began on the locked button is a tap on Send, not a new hold.\n let tapToSend = false;\n return PanResponder.create({\n onStartShouldSetPanResponder: () => true,\n onMoveShouldSetPanResponder: () => true,\n onPanResponderTerminationRequest: () => false,\n onPanResponderGrant: () => {\n tapToSend = lockedNow.current;\n if (!tapToSend) latest.current({ type: \"press\" });\n },\n onPanResponderMove: (_e, g) => {\n if (!tapToSend) latest.current({ type: \"move\", dx: g.dx, dy: g.dy });\n },\n onPanResponderRelease: () => latest.current({ type: tapToSend ? \"send\" : \"release\" }),\n onPanResponderTerminate: () => {\n if (!tapToSend) latest.current({ type: \"cancel\" });\n },\n });\n }, []);\n\n const holding = !locked && (state.phase === \"starting\" || state.phase === \"recording\");\n return (\n <View style={{ alignItems: \"center\" }}>\n {holding ? (\n <View testID={`${testID}-lock-hint`} pointerEvents=\"none\" style={{ position: \"absolute\", bottom: 52, width: 36, height: 56, borderRadius: 18, backgroundColor: colors.surface, alignItems: \"center\", justifyContent: \"flex-start\", paddingTop: 8 }}>\n <NativeIcon name=\"lock\" size={16} color={colors.secondaryLabel} />\n <NativeIcon name=\"chevron-up\" size={14} color={colors.tertiaryLabel} />\n </View>\n ) : null}\n <View\n testID={locked ? `${testID}-voice-send` : `${testID}-mic`}\n accessible\n accessibilityRole=\"button\"\n accessibilityLabel={locked ? copy.stopAndSend : copy.recordVoice}\n accessibilityHint={locked ? undefined : copy.recordHint}\n accessibilityState={{ disabled }}\n accessibilityActions={disabled ? [] : [{ name: \"activate\" }]}\n onAccessibilityAction={(e) => {\n if (e.nativeEvent.actionName !== \"activate\") return;\n if (locked) return dispatch({ type: \"send\" });\n if (state.phase !== \"idle\") return;\n lockWhenReady.current = true;\n dispatch({ type: \"press\" });\n }}\n style={{ width: 44, height: 44, alignItems: \"center\", justifyContent: \"center\", opacity: disabled ? 0.4 : 1, transform: [{ scale: holding ? 1.25 : 1 }] }}\n {...(disabled ? {} : responder.panHandlers)}\n >\n <View style={{ width: 34, height: 34, borderRadius: 17, alignItems: \"center\", justifyContent: \"center\", backgroundColor: locked ? colors.tint : holding ? colors.destructive : \"transparent\" }}>\n <NativeIcon name={locked ? \"arrow-up\" : \"mic\"} size={locked || holding ? 18 : 24} color={locked || holding ? colors.surface : colors.tint} weight={locked ? \"semibold\" : undefined} />\n </View>\n </View>\n </View>\n );\n}\n\n/** While recording: the time, the live waveform, and slide-to-cancel (or, locked, Delete). */\nfunction RecordingBar({ voice, testID }: { voice: Voice; testID: string }) {\n const { copy } = useChatNative();\n const colors = useThemeRoles();\n const { state, dispatch } = voice;\n const bars = liveBars(state.levels, 28);\n return (\n <View testID={`${testID}-recording`} accessibilityLiveRegion=\"polite\" style={{ flex: 1, minHeight: 44, flexDirection: \"row\", alignItems: \"center\", gap: 8, paddingLeft: 4 }}>\n {state.locked ? (\n <IconButton testID={`${testID}-voice-cancel`} icon=\"trash\" label={copy.cancelRecording} onPress={() => dispatch({ type: \"cancel\" })} color={colors.destructive} />\n ) : (\n <View style={{ width: 10, height: 10, borderRadius: 5, backgroundColor: colors.destructive, marginLeft: 8 }} />\n )}\n <NativeText testID={`${testID}-recording-time`} style={{ fontVariant: [\"tabular-nums\"], color: colors.label, minWidth: 40 }}>\n {formatDuration(state.durationMs)}\n </NativeText>\n <View testID={`${testID}-recording-wave`} style={{ flex: 1, flexDirection: \"row\", alignItems: \"center\", gap: 2, height: 28, overflow: \"hidden\" }}>\n {bars.map((h, i) => (\n <View key={i} style={{ width: 3, borderRadius: 1.5, height: Math.max(3, Math.round(h * 28)), backgroundColor: colors.destructive }} />\n ))}\n </View>\n {state.locked ? (\n <View accessible accessibilityLabel={copy.lockedHint}>\n <NativeIcon name=\"lock\" size={16} color={colors.secondaryLabel} />\n </View>\n ) : (\n <NativeText preset=\"caption\" style={{ color: state.cancelArmed ? colors.destructive : colors.secondaryLabel }}>\n {state.cancelArmed ? copy.releaseToCancel : copy.slideToCancel}\n </NativeText>\n )}\n </View>\n );\n}\n","/**\n * @feat:chat\n * The composer's state for one thread, with its draft (per signed-in person):\n * restored when the thread opens, saved a moment after typing stops and when\n * the screen closes or moves to another thread, cleared on send. The thread screen owns it, so a swipe or the long-press\n * sheet can set what the next message replies to.\n */\nimport { useCallback, useEffect, useMemo, useReducer, useRef, useState } from \"react\";\nimport { composerReducer, createDraftSaver, draftKey, emptyComposer, loadDraft, memoryDraftStorage, toSend, type ComposerAction, type ComposerState, type ReplyTarget } from \"./composer-state\";\nimport { useChatNative } from \"./context\";\n\nconst memoryDrafts = memoryDraftStorage();\n\n/** `userId` is the signed-in person's (`useChat().userId`): drafts are kept per person. */\nexport function useChatComposer(conversationId: string, threadRootId: string | null | undefined, userId: string) {\n const { modules } = useChatNative();\n const storage = modules.drafts ?? memoryDrafts;\n const key = draftKey(userId, conversationId, threadRootId);\n const [state, dispatch] = useReducer(composerReducer, emptyComposer);\n const saver = useMemo(() => createDraftSaver(storage, key), [storage, key]);\n const restored = useRef<string | null>(null);\n // The key the state belongs to. Another conversation in the same screen starts empty, so one\n // thread's text, reply or files never show, save or send in the next (the draft flushed for the\n // old key first, in the cleanup below).\n // Kept in state, not a ref written during render (React's \"storing information from previous\n // renders\"): a render React drops would leave a ref on the new key with the reset never applied.\n const [stateKey, setStateKey] = useState(key);\n if (stateKey !== key) {\n setStateKey(key);\n dispatch({ type: \"reset\" });\n }\n\n useEffect(() => {\n let live = true;\n restored.current = null;\n void loadDraft(storage, key).then((draft) => {\n if (!live) return;\n if (draft) dispatch({ type: \"restore\", draft });\n // Only this key's own load: a late answer for a thread left behind must not stop this one saving.\n restored.current = key;\n });\n return () => {\n live = false;\n saver.flush();\n };\n }, [storage, key, saver]);\n\n useEffect(() => {\n // Don't overwrite the stored draft with the empty state before it has been read.\n if (restored.current !== key) return;\n saver.save({ text: state.text, replyTo: state.replyTo });\n }, [state.text, state.replyTo, saver, key]);\n\n const setReply = useCallback((to: ReplyTarget | null) => dispatch({ type: \"reply\", to }), []);\n\n // A second tap before the re-render must not send the same message again.\n const taken = useRef<ComposerState | null>(null);\n /** What to send (null when this state was already sent), and empties the composer and its draft. */\n const take = useCallback(() => {\n if (taken.current === state) return null;\n taken.current = state;\n const payload = toSend(state);\n dispatch({ type: \"sent\" });\n saver.clear();\n return payload;\n }, [state, saver]);\n\n return { state, dispatch: dispatch as (action: ComposerAction) => void, setReply, take };\n}\n\nexport type ChatComposerHandle = ReturnType<typeof useChatComposer>;\n","/**\n * @feat:chat\n * In the composer's place when your role in a conversation couldn't be read\n * (offline, a server hiccup): what happened and Retry\n * (`useConversation().refetchAccess`), instead of waiting quietly forever or\n * saying you can't post.\n */\nimport { View } from \"react-native\";\nimport { NativeButton, NativeInlineAlert } from \"@marktiderman/genesis-ui-native/components\";\nimport { useThemeRoles } from \"@marktiderman/genesis-ui-native/hooks\";\nimport { useChatNative } from \"./context\";\n\nexport interface ChatAccessErrorProps {\n onRetry: () => void;\n /** A retry is under way. */\n retrying?: boolean;\n testID?: string;\n}\n\nexport function ChatAccessError({ onRetry, retrying = false, testID = \"chat-access-error\" }: ChatAccessErrorProps) {\n const { copy } = useChatNative();\n const colors = useThemeRoles();\n return (\n <View testID={testID} style={{ padding: 12, gap: 10, backgroundColor: colors.groupedBackground }}>\n <NativeInlineAlert variant=\"warning\" description={copy.accessError} testID={`${testID}-alert`} />\n <NativeButton variant=\"outline\" size=\"lg\" onPress={onRetry} loading={retrying} testID={`${testID}-retry`}>\n {copy.retry}\n </NativeButton>\n </View>\n );\n}\n","/**\n * @feat:chat\n * The photo viewer: a message's photos full screen on black\n * (NativeFullScreenModal), swiped left and right, pinched or double-tapped\n * to zoom, swiped down (or Close) to leave. Share and Save show when the app\n * passed expo-sharing or expo-media-library (with `downloadFile` for photos\n * that are only a signed link).\n *\n * No gesture library: on iOS each photo is a zooming ScrollView (the\n * system's own pinch, and a pull down past the edge closes); on Android a\n * PanResponder pinches, pans and drags down. With VoiceOver or TalkBack the\n * pager is adjustable (swipe up or down for the next or previous photo).\n */\nimport { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\nimport {\n Animated,\n FlatList,\n PanResponder,\n Platform,\n Pressable,\n ScrollView,\n View,\n useWindowDimensions,\n type GestureResponderEvent,\n type NativeScrollEvent,\n type NativeSyntheticEvent,\n} from \"react-native\";\nimport { useSafeAreaInsets } from \"react-native-safe-area-context\";\nimport { FULL_SCREEN_DARK, NativeFullScreenModal, NativeIcon, NativeImage, NativeText, type NativeIconName } from \"@marktiderman/genesis-ui-native/components\";\nimport { useReducedMotion } from \"@marktiderman/genesis-ui-native/hooks\";\nimport type { ChatMessage } from \"../core/types\";\nimport { fill } from \"./copy\";\nimport { useChatNative } from \"./context\";\nimport { fromServer, type BubbleAttachment } from \"./media\";\nimport { haptic } from \"./modules\";\n\nexport interface ChatPhoto {\n key: string;\n /** A signed link or a file on the phone. */\n uri: string;\n /** What a screen reader says for it. */\n alt: string;\n}\n\nexport interface ChatPhotoViewerProps {\n /** The photos to page through; null closes the viewer. */\n photos: readonly ChatPhoto[] | null;\n /** The one to open at. Default the first. */\n initialIndex?: number;\n onClose: () => void;\n testID?: string;\n}\n\n/** Points pulled down (or dragged, on Android) that close the viewer on release. */\nexport const DISMISS_DISTANCE = 110;\n/** Or a quick flick down, in points per millisecond. */\nexport const DISMISS_VELOCITY = 1.1;\nexport const MAX_ZOOM = 4;\n\n/** Whether a drag down that ended here closes the viewer. */\nexport function shouldDismiss(dy: number, vy: number): boolean {\n return dy > DISMISS_DISTANCE || (dy > 24 && vy > DISMISS_VELOCITY);\n}\n\n/** The zoom a pinch has reached: from where it started, by how far the fingers spread. */\nexport function pinchScale(startScale: number, startDistance: number, distance: number): number {\n if (startDistance <= 0) return startScale;\n return Math.min(MAX_ZOOM, Math.max(0.8, startScale * (distance / startDistance)));\n}\n\n/** Points between two touches. */\nexport function touchDistance(touches: readonly { pageX: number; pageY: number }[]): number {\n const [a, b] = touches;\n if (!a || !b) return 0;\n return Math.hypot(a.pageX - b.pageX, a.pageY - b.pageY);\n}\n\n/** How far a zoomed photo may pan before an edge shows, per axis. */\nexport function panLimit(scale: number, size: number): number {\n return Math.max(0, ((scale - 1) * size) / 2);\n}\n\n/** A file already on the phone, which shares and saves without a download. */\nexport function isLocalUri(uri: string): boolean {\n return /^(file|ph|content|assets-library):/.test(uri);\n}\n\nconst clamp = (v: number, limit: number) => Math.max(-limit, Math.min(limit, v));\n// Between two `onPress`es (each fires on release): a quick double tap measured 330ms apart on iOS.\nexport const DOUBLE_TAP_MS = 400;\n\nexport function ChatPhotoViewer({ photos, initialIndex = 0, onClose, testID = \"chat-photo-viewer\" }: ChatPhotoViewerProps) {\n const open = photos !== null && photos.length > 0;\n return (\n <NativeFullScreenModal open={open} onOpenChange={(o) => (o ? undefined : onClose())} tone=\"none\" testID={testID}>\n {open ? <ViewerBody photos={photos} initialIndex={Math.min(Math.max(0, initialIndex), photos.length - 1)} onClose={onClose} testID={testID} /> : null}\n </NativeFullScreenModal>\n );\n}\n\nfunction ViewerBody({ photos, initialIndex, onClose, testID }: { photos: readonly ChatPhoto[]; initialIndex: number; onClose: () => void; testID: string }) {\n const { copy, modules } = useChatNative();\n const { width, height } = useWindowDimensions();\n const insets = useSafeAreaInsets();\n const reducedMotion = useReducedMotion();\n const [index, setIndex] = useState(initialIndex);\n const [zoomed, setZoomed] = useState(false);\n const [chrome, setChrome] = useState(true);\n const [busy, setBusy] = useState(false);\n const [notice, setNotice] = useState<string | null>(null);\n const backdrop = useRef(new Animated.Value(1)).current;\n const listRef = useRef<FlatList<ChatPhoto> | null>(null);\n const photo = photos[index] ?? photos[0]!;\n const many = photos.length > 1;\n\n useEffect(() => {\n if (!notice) return;\n const t = setTimeout(() => setNotice(null), 2500);\n return () => clearTimeout(t);\n }, [notice]);\n\n const goTo = useCallback(\n (i: number) => {\n if (i < 0 || i >= photos.length) return;\n setIndex(i);\n setZoomed(false);\n listRef.current?.scrollToIndex?.({ index: i, animated: !reducedMotion });\n },\n [photos.length, reducedMotion],\n );\n\n const onMomentumEnd = useCallback(\n (e: NativeSyntheticEvent<NativeScrollEvent>) => {\n const i = Math.round(e.nativeEvent.contentOffset.x / Math.max(1, width));\n if (i !== index && i >= 0 && i < photos.length) {\n setIndex(i);\n setZoomed(false);\n }\n },\n [width, index, photos.length],\n );\n\n // A copy on the phone for sharing and saving: a local file as is, a signed link through downloadFile.\n const local = async (uri: string) => (isLocalUri(uri) ? uri : modules.downloadFile ? modules.downloadFile(uri) : null);\n const reachable = Boolean(modules.downloadFile) || photos.every((p) => isLocalUri(p.uri));\n const canShare = Boolean(modules.sharing) && reachable;\n const canSave = Boolean(modules.mediaLibrary) && reachable;\n\n const run = async (what: \"share\" | \"save\") => {\n if (busy) return;\n setBusy(true);\n try {\n if (what === \"save\") {\n const lib = modules.mediaLibrary!;\n const permission = await lib.requestPermissionsAsync(true);\n if (!permission.granted) {\n setNotice(copy.photosDenied);\n return;\n }\n const file = await local(photo.uri);\n if (!file) throw new Error(\"no copy on the phone\");\n await lib.saveToLibraryAsync(file);\n haptic(modules.haptics, \"send\");\n setNotice(copy.photoSaved);\n } else {\n const sharing = modules.sharing!;\n if (!(await sharing.isAvailableAsync())) throw new Error(\"sharing unavailable\");\n const file = await local(photo.uri);\n if (!file) throw new Error(\"no copy on the phone\");\n await sharing.shareAsync(file, { dialogTitle: copy.sharePhoto });\n }\n } catch {\n haptic(modules.haptics, \"error\");\n setNotice(copy.actionFailed);\n } finally {\n setBusy(false);\n }\n };\n\n const toggleChrome = useCallback(() => setChrome((c) => !c), []);\n const onPull = useCallback((dy: number) => backdrop.setValue(Math.max(0.35, 1 - Math.max(0, dy) / 400)), [backdrop]);\n const renderItem = useCallback(\n ({ item, index: i }: { item: ChatPhoto; index: number }) => (\n <ZoomablePhoto\n photo={item}\n width={width}\n height={height}\n active={i === index}\n onZoomChange={setZoomed}\n onPull={onPull}\n onDismiss={onClose}\n onTap={toggleChrome}\n testID={`${testID}-photo-${i}`}\n />\n ),\n [width, height, index, onPull, onClose, toggleChrome, testID],\n );\n\n const counter = many ? fill(copy.photoOf, { n: index + 1, count: photos.length }) : null;\n return (\n <View style={{ flex: 1 }}>\n <Animated.View pointerEvents=\"none\" style={{ position: \"absolute\", top: 0, right: 0, bottom: 0, left: 0, backgroundColor: FULL_SCREEN_DARK, opacity: backdrop }} />\n <View\n style={{ flex: 1 }}\n accessible\n accessibilityRole=\"adjustable\"\n accessibilityLabel={photo.alt}\n accessibilityValue={counter ? { text: counter } : undefined}\n accessibilityHint={many ? copy.viewerHint : undefined}\n accessibilityActions={many ? [{ name: \"increment\" }, { name: \"decrement\" }] : []}\n onAccessibilityAction={(e) => {\n if (e.nativeEvent.actionName === \"increment\") goTo(index + 1);\n if (e.nativeEvent.actionName === \"decrement\") goTo(index - 1);\n }}\n testID={`${testID}-pager`}\n >\n <FlatList\n ref={listRef}\n testID={`${testID}-list`}\n data={photos as ChatPhoto[]}\n horizontal\n pagingEnabled\n scrollEnabled={many && !zoomed}\n showsHorizontalScrollIndicator={false}\n initialScrollIndex={initialIndex}\n getItemLayout={(_d, i) => ({ length: width, offset: width * i, index: i })}\n keyExtractor={(p) => p.key}\n renderItem={renderItem}\n onMomentumScrollEnd={onMomentumEnd}\n extraData={index}\n windowSize={3}\n initialNumToRender={1}\n />\n </View>\n {chrome ? (\n <View pointerEvents=\"box-none\" style={{ position: \"absolute\", top: insets.top, left: 0, right: 0, flexDirection: \"row\", alignItems: \"center\", gap: 8, paddingHorizontal: 8, minHeight: 52 }}>\n <ViewerButton icon=\"close\" label={copy.closeViewer} onPress={onClose} testID={`${testID}-close`} />\n <View style={{ flex: 1, alignItems: \"center\" }}>\n {counter ? (\n <NativeText testID={`${testID}-counter`} accessibilityLiveRegion=\"polite\" style={{ color: \"#FFFFFF\", fontWeight: \"600\", fontVariant: [\"tabular-nums\"] }}>\n {counter}\n </NativeText>\n ) : null}\n </View>\n {canSave ? <ViewerButton icon=\"download\" label={copy.savePhoto} onPress={() => void run(\"save\")} disabled={busy} testID={`${testID}-save`} /> : null}\n {canShare ? <ViewerButton icon=\"share\" label={copy.sharePhoto} onPress={() => void run(\"share\")} disabled={busy} testID={`${testID}-share`} /> : null}\n {!canSave && !canShare ? <View style={{ width: 44 }} /> : null}\n </View>\n ) : null}\n {notice ? (\n <View pointerEvents=\"none\" style={{ position: \"absolute\", left: 24, right: 24, bottom: insets.bottom + 24, alignItems: \"center\" }}>\n <View accessibilityLiveRegion=\"assertive\" testID={`${testID}-notice`} style={{ backgroundColor: \"rgba(40,40,40,0.92)\", borderRadius: 14, paddingHorizontal: 16, paddingVertical: 10 }}>\n <NativeText style={{ color: \"#FFFFFF\", textAlign: \"center\" }}>{notice}</NativeText>\n </View>\n </View>\n ) : null}\n </View>\n );\n}\n\nfunction ViewerButton({ icon, label, onPress, disabled = false, testID }: { icon: NativeIconName; label: string; onPress: () => void; disabled?: boolean; testID: string }) {\n return (\n <Pressable\n testID={testID}\n accessibilityRole=\"button\"\n accessibilityLabel={label}\n accessibilityState={{ disabled }}\n disabled={disabled}\n onPress={onPress}\n hitSlop={6}\n style={{ width: 44, height: 44, borderRadius: 22, alignItems: \"center\", justifyContent: \"center\", backgroundColor: \"rgba(0,0,0,0.45)\", opacity: disabled ? 0.5 : 1 }}\n >\n <NativeIcon name={icon} size={22} color=\"#FFFFFF\" />\n </Pressable>\n );\n}\n\ninterface ZoomableProps {\n photo: ChatPhoto;\n width: number;\n height: number;\n /** The page on screen: another page resets its zoom. */\n active: boolean;\n onZoomChange: (zoomed: boolean) => void;\n /** How far it's pulled down, for the backdrop's fade. */\n onPull: (dy: number) => void;\n onDismiss: () => void;\n onTap: () => void;\n testID: string;\n}\n\nfunction ZoomablePhoto(props: ZoomableProps) {\n return Platform.OS === \"ios\" ? <ZoomableIos {...props} /> : <ZoomablePan {...props} />;\n}\n\n/** The photo itself, contained, on a transparent background so the backdrop's fade shows. */\nfunction Photo({ photo, width, height, testID }: { photo: ChatPhoto; width: number; height: number; testID: string }) {\n return <NativeImage src={photo.uri} alt={photo.alt} width={width} height={height} contentFit=\"contain\" className=\"bg-transparent\" testID={testID} />;\n}\n\n/** A tap that waits to see whether it's the first half of a double tap. */\nfunction useTaps(onSingle: () => void, onDouble: (e: { locationX: number; locationY: number }) => void) {\n const last = useRef(0);\n const timer = useRef<ReturnType<typeof setTimeout> | null>(null);\n useEffect(\n () => () => {\n if (timer.current) clearTimeout(timer.current);\n },\n [],\n );\n return (e: GestureResponderEvent) => {\n const now = Date.now();\n const at = { locationX: e.nativeEvent?.locationX ?? 0, locationY: e.nativeEvent?.locationY ?? 0 };\n if (now - last.current < DOUBLE_TAP_MS) {\n last.current = 0;\n if (timer.current) clearTimeout(timer.current);\n onDouble(at);\n return;\n }\n last.current = now;\n timer.current = setTimeout(onSingle, DOUBLE_TAP_MS);\n };\n}\n\ntype ZoomRect = { x: number; y: number; width: number; height: number };\ntype ZoomScrollView = ScrollView & { scrollResponderZoomTo?: (rect: ZoomRect & { animated?: boolean }, animated?: boolean) => void };\n\n/**\n * Zooms to a rect. React Native 0.88 drops `rect.animated` and animates per the deprecated second\n * argument (ScrollView.js `scrollResponderZoomTo`), so both are given: the rect's keeps it from\n * warning, the second is the one it uses.\n */\nfunction zoomTo(view: ZoomScrollView | null, rect: ZoomRect, animated: boolean) {\n view?.scrollResponderZoomTo?.({ ...rect, animated }, animated);\n}\n\n/** iOS: the system's zooming scroll view; at full size, a pull down past the top closes. */\nfunction ZoomableIos({ photo, width, height, active, onZoomChange, onPull, onDismiss, onTap, testID }: ZoomableProps) {\n const ref = useRef<ZoomScrollView | null>(null);\n const scale = useRef(1);\n const reducedMotion = useReducedMotion();\n useEffect(() => {\n if (!active && scale.current > 1.01) {\n zoomTo(ref.current, { x: 0, y: 0, width, height }, false);\n scale.current = 1;\n }\n }, [active, width, height]);\n const tap = useTaps(onTap, (at) => {\n if (scale.current > 1.01) return zoomTo(ref.current, { x: 0, y: 0, width, height }, !reducedMotion);\n const w = width / 2.5;\n const h = height / 2.5;\n zoomTo(ref.current, { x: at.locationX - w / 2, y: at.locationY - h / 2, width: w, height: h }, !reducedMotion);\n });\n return (\n <ScrollView\n ref={ref as never}\n testID={testID}\n style={{ width, height }}\n contentContainerStyle={{ width, height }}\n maximumZoomScale={MAX_ZOOM}\n minimumZoomScale={1}\n bouncesZoom\n centerContent\n alwaysBounceVertical\n showsHorizontalScrollIndicator={false}\n showsVerticalScrollIndicator={false}\n scrollEventThrottle={16}\n onScroll={(e) => {\n const z = e.nativeEvent.zoomScale ?? 1;\n if (z > 1.01 !== scale.current > 1.01) onZoomChange(z > 1.01);\n scale.current = z;\n if (z <= 1.01) onPull(-e.nativeEvent.contentOffset.y);\n }}\n onScrollEndDrag={(e) => {\n if (scale.current > 1.01) return;\n // iOS reports the release velocity in points per millisecond, negative while pulling down.\n if (shouldDismiss(-e.nativeEvent.contentOffset.y, -(e.nativeEvent.velocity?.y ?? 0))) onDismiss();\n else onPull(0);\n }}\n >\n <Pressable accessible={false} onPress={tap} style={{ width, height }}>\n <Photo photo={photo} width={width} height={height} testID={`${testID}-image`} />\n </Pressable>\n </ScrollView>\n );\n}\n\n/** Android (no zooming ScrollView): two fingers pinch, one pans a zoomed photo or drags it down to close. */\nfunction ZoomablePan({ photo, width, height, active, onZoomChange, onPull, onDismiss, onTap, testID }: ZoomableProps) {\n const reducedMotion = useReducedMotion();\n const scale = useRef(new Animated.Value(1)).current;\n const tx = useRef(new Animated.Value(0)).current;\n const ty = useRef(new Animated.Value(0)).current;\n const s = useRef({ scale: 1, x: 0, y: 0, startScale: 1, startDistance: 0, startX: 0, startY: 0, pinching: false, dragging: false });\n\n const settle = useCallback(\n (to: { scale: number; x: number; y: number }) => {\n s.current.scale = to.scale;\n s.current.x = to.x;\n s.current.y = to.y;\n onZoomChange(to.scale > 1.01);\n if (reducedMotion) {\n scale.setValue(to.scale);\n tx.setValue(to.x);\n ty.setValue(to.y);\n return;\n }\n Animated.parallel([\n Animated.spring(scale, { toValue: to.scale, useNativeDriver: true }),\n Animated.spring(tx, { toValue: to.x, useNativeDriver: true }),\n Animated.spring(ty, { toValue: to.y, useNativeDriver: true }),\n ]).start();\n },\n [reducedMotion, onZoomChange, scale, tx, ty],\n );\n useEffect(() => {\n if (!active && s.current.scale > 1.01) settle({ scale: 1, x: 0, y: 0 });\n }, [active, settle]);\n\n const tap = useTaps(onTap, (at) => {\n if (s.current.scale > 1.01) return settle({ scale: 1, x: 0, y: 0 });\n const z = 2.5;\n settle({ scale: z, x: clamp((width / 2 - at.locationX) * (z - 1), panLimit(z, width)), y: clamp((height / 2 - at.locationY) * (z - 1), panLimit(z, height)) });\n });\n\n const responder = useMemo(\n () =>\n PanResponder.create({\n onStartShouldSetPanResponder: () => false,\n onMoveShouldSetPanResponder: (e, g) => e.nativeEvent.touches.length >= 2 || s.current.scale > 1.01 || (g.dy > 8 && Math.abs(g.dy) > Math.abs(g.dx) * 1.5),\n onPanResponderTerminationRequest: () => false,\n onPanResponderGrant: (e) => {\n const st = s.current;\n st.pinching = e.nativeEvent.touches.length >= 2;\n st.dragging = !st.pinching && st.scale <= 1.01;\n st.startScale = st.scale;\n st.startDistance = touchDistance(e.nativeEvent.touches);\n st.startX = st.x;\n st.startY = st.y;\n },\n onPanResponderMove: (e, g) => {\n const st = s.current;\n const touches = e.nativeEvent.touches;\n if (touches.length >= 2) {\n if (!st.pinching) {\n st.pinching = true;\n st.dragging = false;\n st.startScale = st.scale;\n st.startDistance = touchDistance(touches);\n }\n st.scale = pinchScale(st.startScale, st.startDistance, touchDistance(touches));\n scale.setValue(st.scale);\n return;\n }\n if (st.dragging) {\n st.y = Math.max(0, g.dy);\n ty.setValue(st.y);\n onPull(st.y);\n return;\n }\n if (st.scale > 1.01) {\n st.x = clamp(st.startX + g.dx, panLimit(st.scale, width));\n st.y = clamp(st.startY + g.dy, panLimit(st.scale, height));\n tx.setValue(st.x);\n ty.setValue(st.y);\n }\n },\n onPanResponderRelease: (_e, g) => {\n const st = s.current;\n if (st.dragging) {\n st.dragging = false;\n if (shouldDismiss(g.dy, g.vy)) return onDismiss();\n onPull(0);\n return settle({ scale: 1, x: 0, y: 0 });\n }\n st.pinching = false;\n const z = Math.max(1, st.scale);\n settle({ scale: z, x: clamp(st.x, panLimit(z, width)), y: clamp(st.y, panLimit(z, height)) });\n },\n onPanResponderTerminate: () => {\n onPull(0);\n settle({ scale: Math.max(1, s.current.scale), x: 0, y: 0 });\n },\n }),\n [width, height, onPull, onDismiss, settle, scale, tx, ty],\n );\n\n return (\n <View testID={testID} style={{ width, height, overflow: \"hidden\" }} {...responder.panHandlers}>\n <Animated.View style={{ width, height, transform: [{ translateX: tx }, { translateY: ty }, { scale }] }}>\n <Pressable accessible={false} onPress={tap} style={{ width, height }}>\n <Photo photo={photo} width={width} height={height} testID={`${testID}-image`} />\n </Pressable>\n </Animated.View>\n </View>\n );\n}\n\n/**\n * The photos of the message a tapped photo belongs to, and where it is among them, for\n * `ChatPhotoViewer`: swiping goes through that message's photos. A photo in no message\n * (one still sending, shown from the phone) opens alone.\n */\nexport function galleryFor(\n messages: readonly ChatMessage[],\n urls: Record<string, string>,\n uri: string,\n alt: string,\n label: (a: BubbleAttachment) => string,\n): { photos: ChatPhoto[]; index: number } {\n for (const m of messages) {\n const images = m.attachments.filter((a) => a.kind === \"image\").map((a) => fromServer(a, urls));\n if (!images.some((a) => a.uri === uri)) continue;\n const photos = images.filter((a): a is BubbleAttachment & { uri: string } => Boolean(a.uri)).map((a) => ({ key: a.key, uri: a.uri, alt: label(a) }));\n return { photos, index: Math.max(0, photos.findIndex((p) => p.uri === uri)) };\n }\n return { photos: [{ key: uri, uri, alt }], index: 0 };\n}\n\nexport interface ChatMediaViewerProps {\n /** The picture to show; null closes the viewer. */\n image: { uri: string; alt: string } | null;\n onClose: () => void;\n testID?: string;\n}\n\n/** One picture in the full-screen viewer (`ChatPhotoViewer` pages through several). */\nexport function ChatMediaViewer({ image, onClose, testID = \"chat-media-viewer\" }: ChatMediaViewerProps) {\n const photos = useMemo(() => (image ? [{ key: image.uri, uri: image.uri, alt: image.alt }] : null), [image]);\n return <ChatPhotoViewer photos={photos} onClose={onClose} testID={testID} />;\n}\n","/**\n * @feat:chat\n * Which actions a message offers this person, from the same rules migration\n * 0001 enforces (react and reply need can_post; pin follows\n * useConversation().canPin: an owner or admin, or a member of a two-person\n * kind; delete needs the sender, an owner or\n * admin, or an observer who may post). The server stays the judge: an action\n * it refuses shows a toast.\n */\nimport type { ChatMessage, ChatRole } from \"../core/types\";\n\nexport type MessageActionId = \"reply\" | \"copy\" | \"pin\" | \"unpin\" | \"delete\";\n\n/** The quick reactions on the long-press sheet. */\nexport const QUICK_REACTIONS = [\"👍\", \"❤️\", \"😂\", \"😮\", \"😢\", \"🙏\"] as const;\n\nexport interface MessageActionContext {\n me: string;\n role: ChatRole | null;\n canPost: boolean;\n pinned: boolean;\n /** May pin here (`useConversation().canPin`: an owner or admin, or a member of a two-person kind). */\n canPin: boolean;\n /** Copy needs expo-clipboard. */\n canCopy: boolean;\n}\n\nexport function canReactTo(message: ChatMessage, ctx: Pick<MessageActionContext, \"canPost\">): boolean {\n return ctx.canPost && !message.deletedAt && message.kind === \"text\";\n}\n\nexport function messageActionsFor(message: ChatMessage, ctx: MessageActionContext): MessageActionId[] {\n if (message.deletedAt || message.kind === \"system\") return [];\n const out: MessageActionId[] = [];\n if (ctx.canPost) out.push(\"reply\");\n if (ctx.canCopy && message.body.trim()) out.push(\"copy\");\n const admin = ctx.role === \"owner\" || ctx.role === \"admin\";\n if (message.visibility === \"everyone\" && ctx.canPin) out.push(ctx.pinned ? \"unpin\" : \"pin\");\n const own = message.senderId === ctx.me && ctx.role !== null;\n if (own || admin || (ctx.role === \"observer\" && ctx.canPost)) out.push(\"delete\");\n return out;\n}\n","/**\n * @feat:chat\n * The long-press sheet: a row of quick reactions and \"+\" for every emoji\n * (the picker takes the sheet's place), then Reply, Copy, Pin or\n * Unpin, and Delete (confirmed), offered per `messageActionsFor`. Each runs\n * through `useMessageActions`; a refusal from the server is a toast.\n */\nimport { useEffect, useState } from \"react\";\nimport { Alert, Pressable, View } from \"react-native\";\nimport { NativeIcon, NativeListItem, NativeSheet, NativeText, type NativeIconName } from \"@marktiderman/genesis-ui-native/components\";\nimport { useThemeRoles } from \"@marktiderman/genesis-ui-native/hooks\";\nimport { summarizeReactions } from \"../core/thread\";\nimport type { ChatAttachmentKind } from \"../react/index\";\nimport { messagePreview } from \"./attachment-cards\";\nimport type { ChatMessage } from \"../core/types\";\nimport { QUICK_REACTIONS, canReactTo, messageActionsFor, type MessageActionContext, type MessageActionId } from \"./actions\";\nimport { fill } from \"./copy\";\nimport { useChatNative } from \"./context\";\nimport { ChatEmojiPicker } from \"./emoji-picker\";\n\nexport interface MessageActionsSheetProps {\n message: ChatMessage | null;\n context: MessageActionContext;\n onClose: () => void;\n onReact: (message: ChatMessage, emoji: string, on: boolean) => void;\n onAction: (message: ChatMessage, action: MessageActionId) => void;\n /** The app's attachment kinds (`ChatProvider attachmentKinds`): the caption names a card by its title. */\n attachmentKinds?: Record<string, ChatAttachmentKind>;\n testID?: string;\n}\n\nconst ICONS: Record<MessageActionId, NativeIconName> = { reply: \"reply\", copy: \"copy\", pin: \"pin\", unpin: \"pin\", delete: \"trash\" };\n\nexport function MessageActionsSheet({ message, context, onClose, onReact, onAction, attachmentKinds, testID = \"chat-message-actions\" }: MessageActionsSheetProps) {\n const { copy } = useChatNative();\n const colors = useThemeRoles();\n const actions = message ? messageActionsFor(message, context) : [];\n const mineReactions = new Set(message ? summarizeReactions(message, context.me).filter((r) => r.mine).map((r) => r.emoji) : []);\n const labels: Record<MessageActionId, string> = { reply: copy.reply, copy: copy.copy, pin: copy.pin, unpin: copy.unpin, delete: copy.delete };\n // \"+\" swaps the sheet's content for the full picker (iOS can't present a second sheet over this one).\n const [picking, setPicking] = useState(false);\n useEffect(() => {\n if (!message) setPicking(false);\n }, [message]);\n\n const run = (action: MessageActionId) => {\n if (!message) return;\n if (action === \"delete\") {\n Alert.alert(copy.deleteConfirm, undefined, [\n { text: copy.delete, style: \"destructive\", onPress: () => onAction(message, \"delete\") },\n { text: copy.cancel, style: \"cancel\" },\n ]);\n onClose();\n return;\n }\n onClose();\n onAction(message, action);\n };\n\n return (\n <NativeSheet open={message !== null} onOpenChange={(open) => (open ? undefined : onClose())} testID={testID}>\n {message && picking ? (\n <View style={{ paddingHorizontal: 16 }}>\n <ChatEmojiPicker\n userId={context.me}\n testID={`${testID}-picker`}\n onSelect={(emoji) => {\n onClose();\n onReact(message, emoji, !mineReactions.has(emoji));\n }}\n />\n </View>\n ) : message ? (\n // Room at the top: the iOS page sheet has no grabber, and its rounded corner clipped the caption.\n <View style={{ gap: 12, paddingTop: 20, paddingBottom: 8, paddingHorizontal: 16 }}>\n <NativeText testID={`${testID}-caption`} numberOfLines={2} preset=\"body-sm\" style={{ color: colors.secondaryLabel, paddingHorizontal: 4 }}>\n {messagePreview(message, attachmentKinds)}\n </NativeText>\n {canReactTo(message, context) ? (\n <View accessibilityRole=\"toolbar\" style={{ flexDirection: \"row\", justifyContent: \"space-between\" }}>\n {QUICK_REACTIONS.map((emoji) => {\n const on = mineReactions.has(emoji);\n return (\n <Pressable\n key={emoji}\n testID={`${testID}-react-${emoji}`}\n accessibilityRole=\"button\"\n accessibilityState={{ selected: on }}\n accessibilityLabel={fill(copy.react, { emoji })}\n onPress={() => {\n onClose();\n onReact(message, emoji, !on);\n }}\n style={{ width: 48, height: 48, borderRadius: 24, alignItems: \"center\", justifyContent: \"center\", backgroundColor: on ? colors.fill : undefined }}\n >\n <NativeText style={{ fontSize: 26, lineHeight: 34 }}>{emoji}</NativeText>\n </Pressable>\n );\n })}\n <Pressable\n testID={`${testID}-react-more`}\n accessibilityRole=\"button\"\n accessibilityLabel={copy.moreReactions}\n onPress={() => setPicking(true)}\n style={{ width: 48, height: 48, borderRadius: 24, alignItems: \"center\", justifyContent: \"center\", backgroundColor: colors.fill }}\n >\n <NativeIcon name=\"plus\" size={22} color={colors.secondaryLabel} />\n </Pressable>\n </View>\n ) : null}\n <View>\n {actions.map((action) => (\n <NativeListItem\n key={action}\n testID={`${testID}-${action}`}\n title={labels[action]}\n leading={<NativeIcon name={ICONS[action]} size={20} color={action === \"delete\" ? colors.destructive : colors.label} />}\n onPress={() => run(action)}\n />\n ))}\n </View>\n </View>\n ) : null}\n </NativeSheet>\n );\n}\n","/**\n * @feat:chat\n * The thread as rows for the list: day separators, the \"New messages\" line,\n * and each message with where its group of one sender starts and ends (the\n * name goes over the first, the avatar beside the last, in a group\n * conversation). Oldest first, top to bottom: the order the thread's list\n * shows and VoiceOver reads (a day's heading and the \"New messages\" line\n * before the messages they head).\n * A row is keyed by the message's client id, so a message that lands keeps\n * its row.\n */\nimport { dayLabel, startsDay, startsGroup, itemSender, itemTime, type ThreadItem } from \"../core/thread\";\n\nexport type ThreadRow =\n | { type: \"day\"; key: string; label: string }\n | { type: \"unread\"; key: string }\n | {\n type: \"message\";\n key: string;\n item: ThreadItem;\n mine: boolean;\n senderId: string | null;\n groupStart: boolean;\n groupEnd: boolean;\n /** Over the first of a run, in a group, for someone else's. */\n showName: boolean;\n /** Beside the last of a run, in a group, for someone else's. */\n showAvatar: boolean;\n };\n\nexport interface BuildRowsOptions {\n me: string;\n firstUnreadId?: string | null;\n /** More than two people: names and avatars show. */\n group: boolean;\n now?: Date;\n locale?: string;\n}\n\nexport function rowKey(item: ThreadItem): string {\n return `c:${item.type === \"message\" ? item.message.clientId : item.pending.clientId}`;\n}\n\n/** Oldest first. */\nexport function buildThreadRows(items: ThreadItem[], options: BuildRowsOptions): ThreadRow[] {\n const { me, firstUnreadId, group, now = new Date(), locale } = options;\n const rows: ThreadRow[] = [];\n for (let i = 0; i < items.length; i++) {\n const item = items[i]!;\n if (startsDay(items, i)) rows.push({ type: \"day\", key: `d:${rowKey(item)}`, label: dayLabel(itemTime(item), now, locale) });\n if (item.type === \"message\" && item.message.id === firstUnreadId) rows.push({ type: \"unread\", key: \"unread\" });\n const senderId = itemSender(item);\n const mine = item.type === \"pending\" || senderId === me;\n const system = item.type === \"message\" && item.message.kind === \"system\";\n const groupStart = startsGroup(items, i) || (item.type === \"message\" && item.message.id === firstUnreadId);\n const nextItem = items[i + 1];\n const groupEnd = !nextItem || startsGroup(items, i + 1) || (nextItem.type === \"message\" && nextItem.message.id === firstUnreadId);\n rows.push({\n type: \"message\",\n key: rowKey(item),\n item,\n mine,\n senderId,\n groupStart,\n groupEnd,\n showName: group && !mine && !system && groupStart,\n showAvatar: group && !mine && !system && groupEnd,\n });\n }\n return rows;\n}\n\n/**\n * Newest first, for an inverted list (its first row sits at the bottom). The\n * thread screen no longer uses it: VoiceOver reads an inverted list's rows\n * newest first, each day's heading after its messages.\n * @deprecated Use `buildThreadRows` in a list that isn't inverted.\n */\nexport function invertedRows(items: ThreadItem[], options: BuildRowsOptions): ThreadRow[] {\n return buildThreadRows(items, options).reverse();\n}\n","/**\n * @feat:chat\n * One conversation: a list oldest first, top to bottom, the order it reads in\n * with VoiceOver (FlashList's bottom-anchored chat mode when the app gave it,\n * else FlatList), that opens at the newest message, follows new ones while\n * you are at the bottom, goes to the bottom when you send, and keeps its\n * place while earlier ones load at the top; day separators, the \"New messages\" line,\n * grouped bubbles with names and avatars in groups, who is typing or\n * recording, retry and delete on a send that failed, the long-press sheet and\n * swipe to reply, a message's photos in the full-screen viewer, and the composer above\n * the keyboard (or, when your role couldn't be read, Retry). Render it as the screen's only content, under the\n * navigator's header with `useChatThreadStackOptions` (an opaque bar).\n *\n * Not inverted: FlashList 2 keeps the first visible row in place when rows\n * change and only follows new rows at the bottom (`autoscrollToBottomThreshold`;\n * it declares `autoscrollToTopThreshold` but never reads it), so in an inverted list a new message\n * at index 0 was pushed under the composer. Inverted, VoiceOver also read\n * each day's heading after its messages.\n *\n * Organising: a topic bar when the conversation has topics (the list shows the topic chosen; a\n * closed one takes no posts from members), the away line under the header, scheduled send\n * (touch and hold Send) with the thread's scheduled messages over the composer, `jumpTo` a\n * message (a search result), and moderation's markers.\n */\nimport { useCallback, useEffect, useMemo, useRef, useState, type ComponentType } from \"react\";\nimport { AccessibilityInfo, FlatList, KeyboardAvoidingView, Platform, Pressable, View, type LayoutChangeEvent, type NativeScrollEvent, type NativeSyntheticEvent } from \"react-native\";\nimport { SafeAreaView } from \"react-native-safe-area-context\";\nimport { NativeEmptyState, NativeSkeleton, NativeText, useGenesisModules, useToast } from \"@marktiderman/genesis-ui-native/components\";\nimport { useReducedMotion, useThemeRoles } from \"@marktiderman/genesis-ui-native/hooks\";\nimport { activityLine, previewText } from \"../core/thread\";\nimport type { ChatMessage, PendingFile } from \"../core/types\";\nimport { useChat, useConversation, useFileUrls, useLinkPreviews, useMessageActions, usePeople, usePins, useTopics } from \"../react/index\";\nimport { recordingLimitMs } from \"../core/media\";\nimport type { OpenAttachment } from \"./attachment-cards\";\nimport { linkPreviewIds, previewToShow } from \"./link-preview\";\nimport { ChatVideoRecorder } from \"./video-recorder\";\nimport { VideoUploadTray } from \"./video-upload-tray\";\nimport { videoUploads, type MintedUpload, type RecordedVideo } from \"./video-upload\";\nimport { ChatAwayLine, useAwayLine } from \"./availability\";\nimport { fill } from \"./copy\";\nimport { ChatScheduledBar, ChatScheduleSheet, useScheduleSend } from \"./schedule-sheet\";\nimport { canManageTopics, ChatTopicBar, topicClosedFor } from \"./topics\";\nimport { rowIndexOf, useJumpToMessage, type JumpTarget } from \"./use-jump\";\nimport type { MessageActionId } from \"./actions\";\nimport { ChatComposer } from \"./composer\";\nimport { composerDisabledReason, filesFromAssets, replyTargetFor } from \"./composer-state\";\nimport { ChatPeopleScope, useChatNative } from \"./context\";\nimport { useChatComposer } from \"./use-composer\";\nimport { ChatAccessError } from \"./access-error\";\nimport { attachmentPaths } from \"./media\";\nimport { ChatPhotoViewer, galleryFor, type ChatPhoto } from \"./photo-viewer\";\nimport { MessageActionsSheet } from \"./message-actions-sheet\";\nimport { displayBody, MessageBubble } from \"./message-bubble\";\nimport { haptic } from \"./modules\";\nimport { pauseChatPlayback } from \"./voice-player\";\nimport { buildThreadRows, type ThreadRow } from \"./rows\";\n\n/** How long an upload minted for a thrown-away take is kept for the next one. */\nconst PREPARED_UPLOAD_MS = 20 * 60_000;\n\nexport interface ChatThreadScreenProps {\n conversationId: string;\n /** One thread's replies instead of the main timeline. */\n threadRootId?: string | null;\n /**\n * Points from the top of the screen to the top of this view, for keeping the composer above the\n * keyboard. Measured from the screen's own position when left out (under an opaque header it is\n * the header's bottom).\n */\n keyboardVerticalOffset?: number;\n /** Open at this message (a search result's `messageId` and `seq`): earlier pages load until it is held. */\n jumpTo?: JumpTarget | null;\n /** Only this topic's messages, with no topic bar. */\n topic?: string;\n /** Show the topic bar before the first topic exists, so an owner or admin can add one. */\n showTopics?: boolean;\n /** Scheduled send (touch and hold Send) and the scheduled list. Default true. */\n scheduling?: boolean;\n /** The away line under the header. Default true. */\n availability?: boolean;\n /** An app attachment card's button (a form, a check-in), when its kind gives no `onPress`. */\n onOpenAttachment?: OpenAttachment;\n /**\n * Whether the screen is the one shown (the navigator's `useIsFocused()`). When it turns false a\n * video or voice note of this thread that is playing pauses: switching tab keeps the screen\n * mounted. Default true.\n */\n focused?: boolean;\n testID?: string;\n}\n\n/** The list props chat passes; FlashList v2 and FlatList both take them. */\ninterface ChatListProps {\n ref?: unknown;\n data: readonly ThreadRow[];\n renderItem: (info: { item: ThreadRow; index: number }) => React.ReactElement | null;\n keyExtractor: (row: ThreadRow) => string;\n getItemType?: (row: ThreadRow) => string;\n inverted?: boolean;\n onStartReached?: () => void;\n onStartReachedThreshold?: number;\n ListHeaderComponent?: React.ReactElement | null;\n ListFooterComponent?: React.ReactElement | null;\n keyboardShouldPersistTaps?: \"handled\";\n keyboardDismissMode?: \"interactive\" | \"on-drag\";\n contentContainerStyle?: Record<string, unknown>;\n maintainVisibleContentPosition?: Record<string, unknown>;\n onScroll?: (e: NativeSyntheticEvent<NativeScrollEvent>) => void;\n scrollEventThrottle?: number;\n onContentSizeChange?: (width: number, height: number) => void;\n onLayout?: (e: LayoutChangeEvent) => void;\n extraData?: unknown;\n onScrollToIndexFailed?: (info: { index: number; averageItemLength: number }) => void;\n testID?: string;\n}\n\n/** Points from the bottom that still count as \"at the bottom\" (FlatList, which follows by hand). */\nexport const AT_BOTTOM_POINTS = 120;\n\n/**\n * How the thread's list is set up, oldest first and not inverted. FlashList:\n * its chat mode (opens at the bottom, follows new rows while within a fifth of\n * a screen of it, keeps the first visible row in place when earlier ones load\n * at the top). FlatList: keeps its place when earlier rows load at the top;\n * the screen follows new rows itself (`followsByHand`).\n */\nexport function threadListMode(flash: boolean, reducedMotion: boolean): { followsByHand: boolean; maintainVisibleContentPosition: Record<string, unknown> } {\n if (flash) {\n return {\n followsByHand: false,\n maintainVisibleContentPosition: { startRenderingFromBottom: true, autoscrollToBottomThreshold: 0.2, animateAutoScrollToBottom: !reducedMotion },\n };\n }\n return { followsByHand: true, maintainVisibleContentPosition: { minIndexForVisible: 0 } };\n}\n\n/** Whether a scroll position is at (or near) the bottom of its content. */\nexport function nearBottom(m: { contentOffset: { y: number }; contentSize: { height: number }; layoutMeasurement: { height: number } }, slack = AT_BOTTOM_POINTS): boolean {\n return m.contentOffset.y + m.layoutMeasurement.height >= m.contentSize.height - slack;\n}\n\nexport function ChatThreadScreen(props: ChatThreadScreenProps) {\n const { conversationId, threadRootId = null, keyboardVerticalOffset, onOpenAttachment, jumpTo, topic: topicProp, showTopics = false, scheduling = true, availability = true, focused = true, testID = \"chat-thread\" } = props;\n const chat = useChat();\n const { userId, videoUpload, attachmentKinds, outbox } = chat;\n // Off unless the app turns it on: an og:image fetched from the phone tells its site who reads it.\n const linkPreviewImages = (chat as { linkPreviewImages?: boolean }).linkPreviewImages === true;\n const topicsState = useTopics(threadRootId ? null : conversationId);\n const [chosenTopic, setChosenTopic] = useState<string | null>(null);\n // Another conversation in this screen starts in All.\n const [topicFor, setTopicFor] = useState(conversationId);\n if (topicFor !== conversationId) {\n setTopicFor(conversationId);\n setChosenTopic(null);\n }\n // A message to go to is looked for in All, not in the topic shown.\n const [jumpedFor, setJumpedFor] = useState(jumpTo);\n if (jumpTo !== jumpedFor) {\n setJumpedFor(jumpTo);\n if (jumpTo) setChosenTopic(null);\n }\n const topic = topicProp ?? chosenTopic ?? undefined;\n const conv = useConversation(conversationId, { threadRootId: threadRootId ?? undefined, topic });\n const pins = usePins(conversationId);\n const messageActions = useMessageActions();\n const { modules, copy, person } = useChatNative();\n const toast = useToast();\n const colors = useThemeRoles();\n const reducedMotion = useReducedMotion();\n const genesis = useGenesisModules();\n const List = (genesis.list ?? FlatList) as unknown as ComponentType<ChatListProps>;\n const mode = threadListMode(Boolean(genesis.list), reducedMotion);\n const listRef = useRef<{\n scrollToEnd?: (o?: { animated?: boolean }) => void;\n scrollToIndex?: (o: { index: number; animated?: boolean; viewPosition?: number }) => void;\n scrollToOffset?: (o: { offset: number; animated?: boolean }) => void;\n } | null>(null);\n // FlatList follows by hand: at the bottom (or not yet scrolled), new rows and a shorter list keep it there.\n const atBottom = useRef(true);\n // FlatList opens at the top and is moved to the bottom a frame later: until it has been, the top\n // isn't \"reached\" (it would load an earlier page on every open).\n const placed = useRef(!mode.followsByHand);\n const toBottom = useCallback(\n (animated: boolean) => {\n const go = (a: boolean) => listRef.current?.scrollToEnd?.({ animated: a && !reducedMotion });\n requestAnimationFrame(() => {\n go(animated);\n placed.current = true;\n });\n // Once more after the new row has its size (FlashList measures it after the first pass).\n if (animated) setTimeout(() => go(true), 180);\n },\n [reducedMotion],\n );\n const composer = useChatComposer(conversationId, threadRootId, userId);\n const { setReply } = composer;\n const [actionsFor, setActionsFor] = useState<ChatMessage | null>(null);\n const [viewer, setViewer] = useState<{ photos: ChatPhoto[]; index: number } | null>(null);\n const [retryingAccess, setRetryingAccess] = useState(false);\n // Where this screen starts on the window: the keyboard offset when the app gives none.\n const rootRef = useRef<{ measureInWindow?: (callback: (x: number, y: number) => void) => void } | null>(null);\n const [measuredTop, setMeasuredTop] = useState(0);\n const measureTop = useCallback(() => {\n rootRef.current?.measureInWindow?.((_x: number, y: number) => {\n if (Number.isFinite(y)) setMeasuredTop(Math.max(0, Math.round(y)));\n });\n }, []);\n\n // Names and avatars show for more than two people: the kind's rule once it is read, else the member count.\n const group = conv.kind ? conv.kind.maxMembers !== 2 : conv.members.length > 2;\n const peopleIds = useMemo(\n () => [...conv.members.map((m) => m.userId), ...conv.messages.map((m) => m.senderId)],\n [conv.members, conv.messages],\n );\n\n const rows = useMemo(() => buildThreadRows(conv.items, { me: userId, firstUnreadId: conv.firstUnreadId, group }), [conv.items, userId, conv.firstUnreadId, group]);\n const paths = useMemo(() => conv.items.flatMap((i) => (i.type === \"message\" ? attachmentPaths(i.message.attachments) : [])), [conv.items]);\n const urls = useFileUrls(paths);\n // Out of sight (another tab, a screen pushed over it): what this thread is playing pauses.\n // Players are keyed by attachment id, or `<clientId>:…` while the message is still sending.\n const itemsNow = useRef(conv.items);\n itemsNow.current = conv.items;\n useEffect(() => {\n if (focused) return;\n pauseChatPlayback((id) =>\n itemsNow.current.some((i) => (i.type === \"message\" ? i.message.attachments.some((a) => a.id === id) : i.type === \"pending\" && id.startsWith(`${i.pending.clientId}:`))),\n );\n }, [focused]);\n const byId = useMemo(() => new Map(conv.messages.map((m) => [m.id, m])), [conv.messages]);\n const linkIds = useMemo(() => linkPreviewIds(conv.messages), [conv.messages]);\n const previews = useLinkPreviews(linkIds);\n const people = usePeople(peopleIds);\n const nameOf = useCallback(\n (id: string | null) => (id === userId ? copy.you : ((person(id) ?? (id ? people[id] : undefined))?.name ?? copy.someone)),\n [userId, copy, person, people],\n );\n\n const fail = useCallback(() => {\n haptic(modules.haptics, \"error\");\n toast.show({ title: copy.actionFailed, variant: \"destructive\" });\n }, [modules.haptics, toast, copy.actionFailed]);\n\n const reply = useCallback(\n (m: ChatMessage) => {\n setReply(replyTargetFor(m, nameOf(m.senderId), previewText(displayBody(m.body), m.attachments[0]?.kind, Boolean(m.deletedAt))));\n },\n [setReply, nameOf],\n );\n\n const onAction = useCallback(\n (m: ChatMessage, action: MessageActionId) => {\n switch (action) {\n case \"reply\":\n return reply(m);\n case \"copy\":\n void modules.clipboard\n ?.setStringAsync(displayBody(m.body))\n .then(() => toast.show({ title: copy.copied, variant: \"success\", duration: 1500 }))\n .catch(fail);\n return;\n case \"pin\":\n case \"unpin\":\n void messageActions.pin(m, action === \"pin\").catch(fail);\n return;\n case \"delete\":\n void messageActions.remove(m).catch(fail);\n return;\n }\n },\n [reply, modules.clipboard, toast, copy.copied, fail, messageActions],\n );\n\n const react = useCallback(\n (m: ChatMessage, emoji: string, on: boolean) => {\n haptic(modules.haptics, \"select\");\n void messageActions.react(m, emoji, on).catch(fail);\n },\n [modules.haptics, fail, messageActions],\n );\n\n // Stable handlers, so MessageBubble's memo holds while someone types or a row elsewhere changes.\n const { retry, discard, canPost: allowed } = conv;\n const onLongPress = useCallback(\n (message: ChatMessage) => {\n haptic(modules.haptics, \"select\");\n setActionsFor(message);\n },\n [modules.haptics],\n );\n const onSwipeReply = useCallback(() => haptic(modules.haptics, \"select\"), [modules.haptics]);\n const onRetry = useCallback((clientId: string) => void retry(clientId), [retry]);\n const onDiscard = useCallback((clientId: string) => void discard(clientId), [discard]);\n // Read when a photo is tapped, so the handler stays stable for MessageBubble's memo.\n const forGallery = useRef({ messages: conv.messages, urls });\n forGallery.current = { messages: conv.messages, urls };\n const onOpenImage = useCallback(\n (uri: string, alt: string) => {\n const { messages, urls: signed } = forGallery.current;\n setViewer(galleryFor(messages, signed, uri, alt, (a) => (a.name ? `${copy.photo}, ${a.name}` : copy.photo)));\n },\n [copy.photo],\n );\n // Files that didn't survive a relaunch: photos and videos can be picked again; anything else can only be deleted.\n const { reattach } = conv;\n const picker = modules.imagePicker;\n const onReattach = useCallback(\n async (clientId: string, files: readonly PendingFile[]) => {\n if (!picker) return;\n try {\n // Only the slots that were lost: reattach fills those and keeps the rest.\n const lostCount = Math.max(1, files.filter((f) => f.lost).length);\n const result = await picker.launchImageLibraryAsync({ mediaTypes: [\"images\", \"videos\"], allowsMultipleSelection: lostCount > 1, selectionLimit: lostCount, quality: 0.8 });\n if (!result || result.canceled || !result.assets?.length) return;\n const { attachments, notice } = filesFromAssets(result.assets, copy);\n if (notice) toast.show({ title: notice, variant: \"destructive\" });\n if (attachments.length) await reattach(clientId, attachments.map((a) => a.file));\n } catch {\n fail();\n }\n },\n [picker, copy, toast, reattach, fail],\n );\n const observer = conv.role === \"observer\";\n const { loadUntil } = conv;\n // The message being gone to, for FlatList's retry once it has measured that far (by id: rows may have moved).\n const jumpingTo = useRef<{ id: string; tries: number } | null>(null);\n const retryTimer = useRef<ReturnType<typeof setTimeout> | null>(null);\n useEffect(() => () => {\n if (retryTimer.current) clearTimeout(retryTimer.current);\n }, []);\n const rowsNow = useRef(rows);\n rowsNow.current = rows;\n const { highlightedId, jumping } = useJumpToMessage({\n target: jumpTo,\n rows,\n loading: conv.isLoading,\n has: useCallback((id: string) => byId.has(id), [byId]),\n loadUntil,\n scrollTo: (index, id) => {\n jumpingTo.current = { id, tries: 0 };\n const scroll = (at: number) => listRef.current?.scrollToIndex?.({ index: at, animated: !reducedMotion, viewPosition: 0.5 });\n requestAnimationFrame(() => scroll(index));\n // Once more after the first layout: with the message already loaded (the thread was opened\n // before), the jump runs on the first frame, and FlashList's start-at-the-bottom placement,\n // which comes after it, would win and leave the thread at the bottom.\n if (retryTimer.current) clearTimeout(retryTimer.current);\n retryTimer.current = setTimeout(() => {\n const at = rowIndexOf(rowsNow.current, id);\n if (at >= 0) scroll(at);\n }, 250);\n },\n onStart: () => {\n atBottom.current = false;\n placed.current = true;\n },\n onLanded: (id) => {\n const m = byId.get(id);\n if (m) AccessibilityInfo.announceForAccessibility?.(fill(copy.jumpedTo, { name: nameOf(m.senderId), text: previewText(displayBody(m.body), m.attachments[0]?.kind, Boolean(m.deletedAt)) }));\n },\n onGone: () => {\n toast.show({ title: copy.messageGone });\n // Back to where the thread opens: the newest messages.\n atBottom.current = true;\n toBottom(false);\n },\n onError: fail,\n });\n const reattachable = useCallback((files: readonly PendingFile[]) => files.every((f) => !f.lost || f.kind === \"image\" || f.kind === \"video\"), []);\n\n const renderItem = useCallback(\n ({ item: row }: { item: ThreadRow }) => {\n if (row.type === \"day\") return <DaySeparator label={row.label} testID={`${testID}-day-${row.key}`} />;\n if (row.type === \"unread\") return <UnreadDivider label={copy.newMessages} testID={`${testID}-unread`} />;\n const m = row.item.type === \"message\" ? row.item.message : null;\n const replyTo = m?.replyToId ?? (row.item.type === \"pending\" ? row.item.pending.input.replyToId : null);\n return (\n <MessageBubble\n row={row}\n me={userId}\n urls={urls}\n repliedTo={replyTo ? byId.get(replyTo) : null}\n group={group}\n reducedMotion={reducedMotion}\n onLongPress={onLongPress}\n onReply={allowed ? reply : undefined}\n onSwipeReply={onSwipeReply}\n onRetry={onRetry}\n onDiscard={onDiscard}\n onReattach={picker && row.item.type === \"pending\" && reattachable(row.item.pending.files ?? []) ? onReattach : undefined}\n onToggleReaction={allowed ? react : undefined}\n onOpenImage={onOpenImage}\n observer={observer}\n highlighted={Boolean(m && m.id === highlightedId)}\n linkPreview={m ? previewToShow(previews[m.id]) : null}\n linkPreviewImages={linkPreviewImages}\n attachmentKinds={attachmentKinds}\n onOpenAttachment={onOpenAttachment}\n testID={`${testID}-message-${m?.id ?? row.key}`}\n />\n );\n },\n [testID, copy.newMessages, userId, urls, byId, group, reducedMotion, onLongPress, allowed, reply, onSwipeReply, onRetry, onDiscard, react, onOpenImage, picker, reattachable, onReattach, previews, linkPreviewImages, attachmentKinds, onOpenAttachment, observer, highlightedId],\n );\n\n // ---- Video messages ----\n const [videoOpen, setVideoOpen] = useState(false);\n // Minted when a take starts, so its bytes go the moment it stops. Kept for the next take when this\n // one is thrown away, but only for this conversation and only while it is fresh (Mux's direct\n // uploads expire; the uploader mints another if one has).\n const preparedVideo = useRef<{ conversationId: string; at: number; upload: Promise<MintedUpload> } | null>(null);\n const takePrepared = useCallback(() => {\n const p = preparedVideo.current;\n preparedVideo.current = null;\n return p && p.conversationId === conversationId && Date.now() - p.at < PREPARED_UPLOAD_MS ? p.upload : null;\n }, [conversationId]);\n const onVideoStart = useCallback(() => {\n if (!videoUpload) return;\n const before = preparedVideo.current;\n const kept = takePrepared();\n const upload = kept ?? videoUpload.create(conversationId);\n upload.catch(() => {\n if (preparedVideo.current?.upload === upload) preparedVideo.current = null;\n });\n preparedVideo.current = { conversationId, at: kept && before ? before.at : Date.now(), upload };\n }, [videoUpload, conversationId, takePrepared]);\n const replyNow = composer.state.replyTo?.messageId ?? null;\n const onVideoRecorded = useCallback(\n (video: RecordedVideo) => {\n videoUploads.start({ conversationId, userId, video, extra: { replyToId: replyNow, threadRootId }, send: outbox.send, videoUpload, prepared: takePrepared(), openFile: modules.openFile });\n if (replyNow) setReply(null);\n atBottom.current = true;\n toBottom(true);\n },\n [conversationId, userId, replyNow, threadRootId, outbox, videoUpload, takePrepared, modules.openFile, setReply, toBottom],\n );\n\n const activity = activityLine(conv.activity, (id) => nameOf(id));\n // Unknown while access loads: the composer waits quietly instead of saying you can't post. A\n // read that failed (and no role known from before) offers Retry in the composer's place.\n const topics = topicsState.topics;\n const currentTopic = topic ? (topics.find((t) => t.topic === topic) ?? null) : null;\n const topicClosed = topicClosedFor(currentTopic, conv.role);\n const showTopicBar = !threadRootId && topicProp === undefined && (topics.length > 0 || (showTopics && canManageTopics(conv.role)));\n const canPost = topicClosed ? false : conv.accessLoading ? null : conv.canPost;\n const disabledReason = topicClosed ? copy.topicClosedNotice : composerDisabledReason(canPost, conv.conversation, conv.role, copy);\n const awayLine = useAwayLine(availability ? conversationId : null, conv.members, userId, nameOf);\n // Scheduled send: not in a reply thread (a scheduled message has no thread).\n const canSchedule = scheduling && !threadRootId && canPost === true;\n const schedule = useScheduleSend({ conversationId, topic: topic ?? null, composer, enabled: scheduling && !threadRootId });\n const accessFailed = Boolean(conv.accessError) && conv.role === null && !conv.accessLoading;\n const { refetchAccess } = conv;\n const retryAccess = useCallback(() => {\n setRetryingAccess(true);\n void Promise.resolve(refetchAccess()).finally(() => setRetryingAccess(false));\n }, [refetchAccess]);\n const KeyboardAvoiding = (modules.keyboardAvoidingView ?? KeyboardAvoidingView) as ComponentType<Record<string, unknown>>;\n const offset = keyboardVerticalOffset ?? measuredTop;\n const keyboardProps = modules.keyboardAvoidingView\n ? { behavior: \"translate-with-padding\", keyboardVerticalOffset: offset }\n : { behavior: Platform.OS === \"ios\" ? \"padding\" : undefined, keyboardVerticalOffset: offset };\n\n const empty = !conv.isLoading && rows.length === 0;\n return (\n <ChatPeopleScope userIds={peopleIds}>\n <SafeAreaView ref={rootRef as never} onLayout={measureTop} testID={testID} edges={[\"left\", \"right\", \"bottom\"]} style={{ flex: 1, backgroundColor: colors.groupedBackground }}>\n <KeyboardAvoiding style={{ flex: 1 }} {...keyboardProps}>\n {showTopicBar ? (\n <ChatTopicBar topics={topics} value={topic ?? null} onValueChange={setChosenTopic} canManage={canManageTopics(conv.role)} onSetTopic={topicsState.setTopic} testID={`${testID}-topics`} />\n ) : null}\n <ChatAwayLine text={awayLine} testID={`${testID}-away`} />\n <View style={{ flex: 1 }}>\n {conv.isLoading ? (\n <LoadingThread testID={`${testID}-loading`} />\n ) : empty ? (\n <View style={{ flex: 1, justifyContent: \"center\" }}>\n <NativeEmptyState variant=\"first-run\" title={copy.threadEmptyTitle} body={currentTopic?.closedAt ? copy.topicClosedNotice : copy.threadEmptyBody} testID={`${testID}-empty`} />\n </View>\n ) : (\n <List\n ref={listRef}\n testID={`${testID}-list`}\n data={rows}\n renderItem={renderItem}\n keyExtractor={(row) => row.key}\n getItemType={(row) => (row.type === \"message\" ? (row.mine ? \"mine\" : \"theirs\") : row.type)}\n onStartReached={() => {\n // Not while going to a message: its pages are loading, and new rows would move it.\n if (placed.current && !jumping && conv.hasEarlier && !conv.loadingEarlier) void conv.loadEarlier();\n }}\n onStartReachedThreshold={0.5}\n keyboardShouldPersistTaps=\"handled\"\n keyboardDismissMode=\"interactive\"\n contentContainerStyle={{ paddingVertical: 8 }}\n maintainVisibleContentPosition={mode.maintainVisibleContentPosition}\n extraData={highlightedId}\n onScrollToIndexFailed={({ index, averageItemLength }) => {\n // FlatList hasn't measured that far up yet: get near it, then try again (three times at most).\n listRef.current?.scrollToOffset?.({ offset: Math.max(0, index * averageItemLength - 200), animated: false });\n const target = jumpingTo.current;\n if (!target || target.tries >= 3) return;\n target.tries += 1;\n if (retryTimer.current) clearTimeout(retryTimer.current);\n retryTimer.current = setTimeout(() => {\n const at = rowIndexOf(rowsNow.current, target.id);\n if (at >= 0) listRef.current?.scrollToIndex?.({ index: at, animated: !reducedMotion, viewPosition: 0.5 });\n }, 250);\n }}\n {...(mode.followsByHand\n ? {\n scrollEventThrottle: 32,\n onScroll: (e: NativeSyntheticEvent<NativeScrollEvent>) => {\n atBottom.current = nearBottom(e.nativeEvent);\n },\n onContentSizeChange: () => {\n if (atBottom.current) toBottom(false);\n },\n onLayout: () => {\n if (atBottom.current) toBottom(false);\n },\n }\n : {})}\n ListHeaderComponent={\n conv.hasEarlier ? (\n <EarlierAnchor loading={conv.loadingEarlier} label={copy.loadEarlier} onPress={() => void conv.loadEarlier()} testID={`${testID}-earlier`} />\n ) : null\n }\n ListFooterComponent={activity ? <ActivityLine text={activity} testID={`${testID}-activity`} /> : null}\n />\n )}\n </View>\n {scheduling && !threadRootId ? <ChatScheduledBar conversationId={conversationId} testID={`${testID}-scheduled`} /> : null}\n <VideoUploadTray conversationId={conversationId} userId={userId} testID={`${testID}-video-uploads`} />\n {accessFailed ? (\n <ChatAccessError onRetry={retryAccess} retrying={retryingAccess} testID={`${testID}-access-error`} />\n ) : (\n <ChatComposer\n composer={composer}\n userId={userId}\n placeholder={currentTopic ? fill(copy.topicPlaceholder, { name: currentTopic.title }) : undefined}\n onSchedule={canSchedule ? schedule.request : undefined}\n canPost={canPost}\n disabledReason={disabledReason}\n role={conv.role}\n onSend={({ input, files }) => {\n void conv.send(input, files).catch(fail);\n // What you send is what you look at next, wherever the list was.\n atBottom.current = true;\n toBottom(true);\n }}\n signalTyping={conv.signalTyping}\n signalRecording={conv.signalRecording}\n onRecordVideo={modules.camera ? () => setVideoOpen(true) : undefined}\n testID={`${testID}-composer`}\n />\n )}\n </KeyboardAvoiding>\n <MessageActionsSheet\n message={actionsFor}\n context={{ me: userId, role: conv.role, canPost: conv.canPost, pinned: actionsFor ? pins.includes(actionsFor.id) : false, canPin: conv.canPin, canCopy: Boolean(modules.clipboard) }}\n onClose={() => setActionsFor(null)}\n onReact={react}\n onAction={onAction}\n attachmentKinds={attachmentKinds}\n testID={`${testID}-actions`}\n />\n <ChatPhotoViewer photos={viewer?.photos ?? null} initialIndex={viewer?.index} onClose={() => setViewer(null)} testID={`${testID}-viewer`} />\n {canSchedule ? <ChatScheduleSheet open={schedule.open} onOpenChange={schedule.setOpen} onSchedule={(at) => void schedule.scheduleAt(at)} testID={`${testID}-schedule`} /> : null}\n <ChatVideoRecorder\n open={videoOpen}\n onClose={() => setVideoOpen(false)}\n limitMs={recordingLimitMs(conv.role)}\n onStart={onVideoStart}\n onTick={conv.signalRecordingVideo}\n onRecorded={onVideoRecorded}\n testID={`${testID}-video-recorder`}\n />\n </SafeAreaView>\n </ChatPeopleScope>\n );\n}\n\nfunction DaySeparator({ label, testID }: { label: string; testID: string }) {\n const colors = useThemeRoles();\n return (\n <View testID={testID} accessibilityRole=\"header\" style={{ alignItems: \"center\", paddingVertical: 10 }}>\n <NativeText preset=\"caption\" style={{ color: colors.secondaryLabel, fontWeight: \"600\" }}>\n {label}\n </NativeText>\n </View>\n );\n}\n\nfunction UnreadDivider({ label, testID }: { label: string; testID: string }) {\n const colors = useThemeRoles();\n return (\n <View testID={testID} accessible accessibilityLabel={label} style={{ flexDirection: \"row\", alignItems: \"center\", gap: 8, paddingHorizontal: 16, paddingVertical: 8 }}>\n <View style={{ flex: 1, height: 1, backgroundColor: colors.tint }} />\n <NativeText preset=\"caption\" style={{ color: colors.tint, fontWeight: \"600\" }}>\n {label}\n </NativeText>\n <View style={{ flex: 1, height: 1, backgroundColor: colors.tint }} />\n </View>\n );\n}\n\nfunction ActivityLine({ text, testID }: { text: string; testID: string }) {\n const colors = useThemeRoles();\n return (\n <View testID={testID} accessibilityLiveRegion=\"polite\" style={{ paddingHorizontal: 20, paddingVertical: 6 }}>\n <NativeText preset=\"caption\" style={{ color: colors.secondaryLabel, fontStyle: \"italic\" }}>\n {text}\n </NativeText>\n </View>\n );\n}\n\nfunction EarlierAnchor({ loading, label, onPress, testID }: { loading: boolean; label: string; onPress: () => void; testID: string }) {\n const colors = useThemeRoles();\n return (\n <View style={{ alignItems: \"center\", paddingVertical: 12 }}>\n {loading ? (\n <View testID={`${testID}-loading`} style={{ gap: 8, alignItems: \"center\" }}>\n <NativeSkeleton width={180} height={14} />\n <NativeSkeleton width={120} height={14} />\n </View>\n ) : (\n <Pressable testID={testID} accessibilityRole=\"button\" accessibilityLabel={label} onPress={onPress} style={{ minHeight: 44, justifyContent: \"center\", paddingHorizontal: 16 }}>\n <NativeText preset=\"label\" style={{ color: colors.tint }}>\n {label}\n </NativeText>\n </Pressable>\n )}\n </View>\n );\n}\n\nfunction LoadingThread({ testID }: { testID: string }) {\n return (\n <View testID={testID} style={{ flex: 1, justifyContent: \"flex-end\", padding: 16, gap: 10 }}>\n <NativeSkeleton width={200} height={36} className=\"rounded-2xl\" />\n <View style={{ alignItems: \"flex-end\" }}>\n <NativeSkeleton width={160} height={36} className=\"rounded-2xl\" />\n </View>\n <NativeSkeleton width={240} height={36} className=\"rounded-2xl\" />\n </View>\n );\n}\n","/**\n * @feat:chat\n * `<Stack.Screen options>` for a screen that renders `ChatThreadScreen`.\n *\n * The bar is opaque. It was made so while the thread was an inverted list\n * (`transform: scaleY(-1)` on the scroll view), which it no longer is; it\n * stays opaque until a see-through bar is checked over the upright list. On\n * iOS 26 and later the navigation bar is see-through and draws a scroll\n * edge effect over the content scroll view under it; UIKit lays that effect\n * out in the flipped scroll view's own coordinates, so once the thread is\n * long enough to reach the bar the whole list renders blurred. An opaque bar\n * keeps the screen's content below it: nothing scrolls under the bar, and no\n * edge effect is drawn over the flipped list. Seen on iOS 27 with FlashList\n * and with FlatList.\n */\nimport type { ColorValue } from \"react-native\";\nimport { getThreadPageStackOptions, type ScreenHeaderProps } from \"@marktiderman/genesis-ui-native/layouts\";\nimport { useThemeRoles } from \"@marktiderman/genesis-ui-native/hooks\";\n\nexport type ChatThreadStackOptionsProps = ScreenHeaderProps & { headerTitle?: string };\n\n/** The thread's header options with an opaque bar in `background` (the thread's own background). */\nexport function chatThreadStackOptions(props: ChatThreadStackOptionsProps, background: ColorValue): Record<string, unknown> {\n return getThreadPageStackOptions({\n ...props,\n // Large titles collapse into the content scroll view, which is the flipped list here.\n large: false,\n headerOptions: { headerTransparent: false, headerStyle: { backgroundColor: background }, ...props.headerOptions },\n });\n}\n\n/** `chatThreadStackOptions` in the theme's grouped background, the color `ChatThreadScreen` draws. */\nexport function useChatThreadStackOptions(props: ChatThreadStackOptionsProps): Record<string, unknown> {\n const colors = useThemeRoles();\n return chatThreadStackOptions(props, colors.groupedBackground);\n}\n","/**\n * @feat:chat\n * Starting a conversation: a header button, and a sheet listing the people\n * the app says you may message (its own query; the kind's start check decides\n * on the server). Picking someone starts the conversation, or finds the one\n * you already have, and opens it.\n */\nimport { useState } from \"react\";\nimport { Pressable, View } from \"react-native\";\nimport { NativeAvatar, NativeIcon, NativeListItem, NativeSheet, NativeSheetScrollView, NativeText, useToast } from \"@marktiderman/genesis-ui-native/components\";\nimport { useThemeRoles } from \"@marktiderman/genesis-ui-native/hooks\";\nimport { useStartConversation } from \"../react/index\";\nimport { initials, useChatNative } from \"./context\";\n\nexport interface ChatStartPerson {\n userId: string;\n name: string;\n avatarUrl?: string | null;\n /** A second line (\"Coach\", \"Team\"). */\n subtitle?: string;\n}\n\nexport interface ChatStartSheetProps {\n open: boolean;\n onClose: () => void;\n people: ChatStartPerson[];\n /** Default `direct`. */\n kind?: string;\n onStarted: (conversationId: string) => void;\n testID?: string;\n}\n\nexport function ChatStartSheet({ open, onClose, people, kind = \"direct\", onStarted, testID = \"chat-start\" }: ChatStartSheetProps) {\n const { copy } = useChatNative();\n const colors = useThemeRoles();\n const start = useStartConversation();\n const toast = useToast();\n const [busy, setBusy] = useState<string | null>(null);\n\n const pick = async (person: ChatStartPerson) => {\n if (busy) return;\n setBusy(person.userId);\n try {\n const id = await start(kind, [person.userId]);\n onClose();\n onStarted(id);\n } catch {\n toast.show({ title: copy.actionFailed, variant: \"destructive\" });\n } finally {\n setBusy(null);\n }\n };\n\n return (\n <NativeSheet open={open} onOpenChange={(o) => (o ? undefined : onClose())} testID={testID}>\n <NativeText preset=\"h4\" accessibilityRole=\"header\" style={{ paddingHorizontal: 4, paddingBottom: 8, color: colors.label }}>\n {copy.startConversationTitle}\n </NativeText>\n <NativeSheetScrollView>\n <View>\n {people.map((p) => (\n <NativeListItem\n key={p.userId}\n testID={`${testID}-person-${p.userId}`}\n title={p.name}\n subtitle={p.subtitle}\n leading={<NativeAvatar size={36} src={p.avatarUrl ?? null} fallback={initials(p.name)} alt={p.name} />}\n disabled={busy !== null}\n onPress={() => void pick(p)}\n />\n ))}\n </View>\n </NativeSheetScrollView>\n </NativeSheet>\n );\n}\n\n/** A 44pt compose button for the inbox's header (`headerRight`). */\nexport function ChatStartButton({ onPress, testID = \"chat-start-button\" }: { onPress: () => void; testID?: string }) {\n const { copy } = useChatNative();\n const colors = useThemeRoles();\n return (\n <Pressable testID={testID} accessibilityRole=\"button\" accessibilityLabel={copy.startConversation} onPress={onPress} hitSlop={6} style={{ width: 44, height: 44, alignItems: \"center\", justifyContent: \"center\" }}>\n <NativeIcon name=\"compose\" size={22} color={colors.tint} />\n </Pressable>\n );\n}\n","/**\n * @feat:chat\n * Retries unsent messages when there's a chance they'll go now: the app\n * coming back to the front (AppState \"active\") and, with NetInfo\n * (`modules.netInfo`), the connection coming back, through\n * `useChat().retryAll()`, which resends what failed for a reason that may\n * pass and leaves alone what the server refused (`permanent`: not allowed,\n * bad data) and messages whose files are gone. Mount it once under\n * ChatProvider and ChatNativeProvider: `<ChatAutoRetry />`.\n */\nimport { useEffect, useRef } from \"react\";\nimport { AppState } from \"react-native\";\nimport { useChat } from \"../react/index\";\nimport { useChatNative } from \"./context\";\nimport type { NetInfoLike } from \"./modules\";\n\n/** React Native's `AppState`, as the hook uses it. */\nexport interface AppStateLike {\n currentState: string | null;\n addEventListener(type: \"change\", listener: (state: string) => void): { remove(): void };\n}\n\nexport interface ChatAutoRetryOptions {\n /** Default `modules.netInfo`. */\n netInfo?: NetInfoLike;\n /** Default React Native's AppState. */\n appState?: AppStateLike;\n}\n\n/** Whether a NetInfo state is online: unknown counts as online, so only a real \"offline\" waits. */\nexport function isOnline(state: { isConnected: boolean | null; isInternetReachable?: boolean | null }): boolean {\n return state.isConnected !== false && state.isInternetReachable !== false;\n}\n\nexport function useChatAutoRetry({ netInfo, appState }: ChatAutoRetryOptions = {}): void {\n const { retryAll } = useChat();\n const { modules } = useChatNative();\n const net = netInfo ?? modules.netInfo;\n const app = appState ?? (AppState as unknown as AppStateLike | undefined);\n // The latest retryAll, so a changing queue doesn't resubscribe.\n const retry = useRef(retryAll);\n retry.current = retryAll;\n\n useEffect(() => {\n const go = () => void retry.current().catch(() => undefined);\n let last = app?.currentState ?? null;\n const sub = app?.addEventListener?.(\"change\", (next) => {\n if (next === \"active\" && last !== \"active\") go();\n last = next;\n });\n // Only a change from offline to online: NetInfo also reports the current state on subscribing.\n let wasOnline: boolean | null = null;\n const unsubscribe = net?.addEventListener((state) => {\n const online = isOnline(state);\n if (online && wasOnline === false) go();\n wasOnline = online;\n });\n return () => {\n sub?.remove();\n unsubscribe?.();\n };\n }, [net, app]);\n}\n\n/** `useChatAutoRetry` as a component, for a provider tree. */\nexport function ChatAutoRetry(props: ChatAutoRetryOptions) {\n useChatAutoRetry(props);\n return null;\n}\n","/**\n * @feat:chat\n * Resumable uploads for the native outbox: Supabase Storage's TUS endpoint\n * (`/storage/v1/upload/resumable`), with the person's own token, so storage's\n * row level security (genesis_chat.can_upload) judges each file as it does a\n * plain upload. A dropped connection resumes from the last chunk the server\n * has (HEAD for the offset), within the session; a retry of the same file\n * reuses its path, so the message's attachment never points at a second copy.\n * A file on the phone is read one chunk at a time when the app gives\n * `openFile` (a 100 MB video never sits whole in memory); without it, it is\n * read whole. A create the server refuses as already there (409) counts as\n * done only when the object is really there.\n *\n * <ChatProvider upload={createTusUpload({ supabaseUrl, userId, getAccessToken })} …>\n *\n * The path is `<conversation>/<uploader>/<uuid>.<ext>`, as `send_message`\n * expects; the upload finishes before the send (the outbox orders that).\n */\nimport { CHAT_BUCKET, ChatError } from \"../core/client\";\nimport { fileExtension, isAllowedExtension, randomId } from \"../core/media\";\nimport type { LocalFile } from \"../core/outbox\";\n\n/** Supabase requires 6 MB chunks for TUS (every chunk but the last). */\nexport const TUS_CHUNK_BYTES = 6 * 1024 * 1024;\n\nexport interface TusUploadOptions {\n /** The project URL (`https://<ref>.supabase.co`, or the local stack's). */\n supabaseUrl: string;\n /** The signed-in user's id (auth.users), the second folder of the path. */\n userId: string | (() => string);\n /** The signed-in user's access token (`(await supabase.auth.getSession()).data.session?.access_token`). */\n getAccessToken: () => Promise<string | null | undefined>;\n /** The publishable key, sent as `apikey` (the API gateway asks for it on hosted projects). */\n apikey?: string;\n /**\n * Opens a file URI for reading one chunk at a time (expo-file-system's `new File(uri).open()`),\n * so a big video is never read whole into memory. Without it, `readFile` reads the whole file.\n */\n openFile?: (uri: string) => Promise<TusFileHandle> | TusFileHandle;\n /** Reads a file URI into bytes, whole: used without `openFile`. Default `fetch(uri).arrayBuffer()`. */\n readFile?: (uri: string) => Promise<ArrayBuffer>;\n fetch?: typeof fetch;\n chunkBytes?: number;\n /** Network failures retried per chunk before the send fails (it can be retried). Default 3. */\n retries?: number;\n /** A uuid for each file's name. Default core's `randomId` (crypto.randomUUID where there is one, else getRandomValues). */\n newId?: () => string;\n bucket?: string;\n}\n\n/** An open file, read a chunk at a time. */\nexport interface TusFileHandle {\n /** Bytes in the file. */\n size: number;\n /** Up to `length` bytes from `offset`. */\n read(offset: number, length: number): Promise<ArrayBuffer | Uint8Array>;\n close?(): void;\n}\n\n/** What upload reads its bytes from: the file in chunks, or bytes already in memory. */\ninterface Source {\n size: number;\n read(from: number, to: number): Promise<ArrayBuffer>;\n close(): void;\n}\n\nconst exact = (bytes: ArrayBuffer | Uint8Array): ArrayBuffer =>\n bytes instanceof ArrayBuffer ? bytes : (bytes.buffer.slice(bytes.byteOffset, bytes.byteOffset + bytes.byteLength) as ArrayBuffer);\n\nconst inMemory = (buffer: ArrayBuffer): Source => ({ size: buffer.byteLength, read: async (from, to) => buffer.slice(from, to), close: () => undefined });\n\ninterface UploadRecord {\n path: string;\n location?: string;\n done?: boolean;\n}\n\n/** Base64 of a UTF-8 string, for TUS's Upload-Metadata (no `btoa`, which isn't on every Hermes build). */\nexport function base64Utf8(text: string): string {\n const bytes = new TextEncoder().encode(text);\n const A = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\n let out = \"\";\n for (let i = 0; i < bytes.length; i += 3) {\n const n = (bytes[i]! << 16) | ((bytes[i + 1] ?? 0) << 8) | (bytes[i + 2] ?? 0);\n out += A[(n >> 18) & 63]! + A[(n >> 12) & 63]! + (i + 1 < bytes.length ? A[(n >> 6) & 63]! : \"=\") + (i + 2 < bytes.length ? A[n & 63]! : \"=\");\n }\n return out;\n}\n\nconst transientStatus = (status: number) => status === 0 || status === 408 || status === 429 || status >= 500;\n\nexport function createTusUpload(options: TusUploadOptions): (conversationId: string, file: LocalFile) => Promise<string> {\n const doFetch = options.fetch ?? fetch;\n const chunk = options.chunkBytes ?? TUS_CHUNK_BYTES;\n const retries = options.retries ?? 3;\n const bucket = options.bucket ?? CHAT_BUCKET;\n const endpoint = `${options.supabaseUrl.replace(/\\/+$/, \"\")}/storage/v1/upload/resumable`;\n const newId = options.newId ?? randomId;\n const readFile = options.readFile ?? (async (uri: string) => (await doFetch(uri)).arrayBuffer());\n // By file object: a retry of the same message in this session resumes it. Two messages never\n // share an object, so deleting one never breaks the other.\n const byFile = new WeakMap<LocalFile, UploadRecord>();\n\n async function headers(extra: Record<string, string> = {}) {\n const token = await options.getAccessToken();\n if (!token) throw new ChatError(\"Sign in to send files\", \"42501\", \"upload\");\n return {\n authorization: `Bearer ${token}`,\n ...(options.apikey ? { apikey: options.apikey } : {}),\n \"tus-resumable\": \"1.0.0\",\n ...extra,\n };\n }\n\n async function sourceOf(file: LocalFile): Promise<Source> {\n const data = file.data;\n if (typeof data === \"string\") {\n if (!options.openFile) return inMemory(await readFile(data));\n const handle = await options.openFile(data);\n if (!Number.isFinite(handle.size) || handle.size <= 0) {\n try {\n handle.close?.();\n } catch {\n // Already closed.\n }\n throw new ChatError(`${file.name} can't be read on this device`, \"22023\", \"upload\");\n }\n return {\n size: handle.size,\n read: async (from, to) => {\n const bytes = await handle.read(from, to - from).catch((e: unknown) => {\n throw new ChatError(`${file.name} can't be read on this device${e instanceof Error ? `: ${e.message}` : \"\"}`, \"22023\", \"upload\");\n });\n // A short read would send a hole in the file: fail instead.\n if (bytes.byteLength !== to - from) throw new ChatError(`${file.name} changed while it was sent`, \"22023\", \"upload\");\n return exact(bytes);\n },\n close: () => {\n try {\n handle.close?.();\n } catch {\n // Already closed.\n }\n },\n };\n }\n if (data instanceof ArrayBuffer) return inMemory(data);\n return { size: data.size, read: (from, to) => data.slice(from, to).arrayBuffer(), close: () => undefined };\n }\n\n /**\n * Whether the object is really in the bucket (a 409 on create says so, and may be wrong).\n * Storage answers a missing object with 400 (or 404); a refusal is a refusal, anything else is\n * asked again.\n */\n async function objectExists(path: string): Promise<boolean> {\n const base = options.supabaseUrl.replace(/\\/+$/, \"\");\n const encoded = path.split(\"/\").map(encodeURIComponent).join(\"/\");\n const res = await doFetch(`${base}/storage/v1/object/authenticated/${bucket}/${encoded}`, { method: \"HEAD\", headers: await headers() });\n if (res.ok) return true;\n if (res.status === 400 || res.status === 404) return false;\n return refuse(res, \"upload\");\n }\n\n async function withRetry<T>(op: string, run: () => Promise<T>): Promise<T> {\n let last: unknown;\n for (let attempt = 0; attempt <= retries; attempt++) {\n try {\n return await run();\n } catch (e) {\n last = e;\n if (e instanceof ChatError && !e.transient) throw e;\n await new Promise((r) => setTimeout(r, Math.min(4000, 250 * 2 ** attempt)));\n }\n }\n throw last instanceof ChatError ? last : new ChatError(last instanceof Error ? last.message : String(last), undefined, op);\n }\n\n const refuse = async (res: Response, op: string): Promise<never> => {\n const text = await res.text().catch(() => \"\");\n // A network-ish status is transient (no code); the rest are refusals.\n throw new ChatError(text || `Upload failed (${res.status})`, transientStatus(res.status) ? undefined : res.status === 403 || res.status === 401 ? \"42501\" : \"22023\", op);\n };\n\n async function upload(conversationId: string, file: LocalFile): Promise<string> {\n const ext = fileExtension(file.name, file.contentType);\n if (!isAllowedExtension(ext)) throw new ChatError(`Files of type .${ext} can't be sent`, \"22023\", \"upload\");\n let record = byFile.get(file);\n if (!record) {\n const userId = typeof options.userId === \"function\" ? options.userId() : options.userId;\n record = { path: `${conversationId}/${userId}/${newId()}.${ext}` };\n }\n byFile.set(file, record);\n if (record.done) return record.path;\n\n const source = await sourceOf(file);\n try {\n return await send(file, record, source);\n } finally {\n source.close();\n }\n };\n\n async function send(file: LocalFile, rec: UploadRecord, source: Source): Promise<string> {\n const length = source.size;\n\n // Create the upload (once), or find how far an earlier attempt got.\n let offset = 0;\n if (rec.location) {\n offset = await withRetry(\"upload\", async () => {\n const res = await doFetch(rec.location!, { method: \"HEAD\", headers: await headers() });\n if (res.status === 404 || res.status === 410) {\n rec.location = undefined;\n return 0;\n }\n if (!res.ok) return refuse(res, \"upload\");\n return Number(res.headers.get(\"upload-offset\") ?? 0);\n });\n }\n // A 409 at a path whose object isn't there (another upload of it never finished): one new path.\n let fresh = false;\n while (!rec.location) {\n const metadata = [\n `bucketName ${base64Utf8(bucket)}`,\n `objectName ${base64Utf8(rec.path)}`,\n `contentType ${base64Utf8(file.contentType)}`,\n `cacheControl ${base64Utf8(\"3600\")}`,\n ].join(\",\");\n const created = await withRetry(\"upload\", async () => {\n const res = await doFetch(endpoint, {\n method: \"POST\",\n headers: await headers({ \"upload-length\": String(length), \"upload-metadata\": metadata, \"x-upsert\": \"false\" }),\n });\n // Already there, says the server: an earlier attempt finished but its answer was lost, or\n // another upload of this path is under way. Only the object itself settles which.\n if (res.status === 409) return (await objectExists(rec.path)) ? \"done\" : \"conflict\";\n if (res.status !== 201) return refuse(res, \"upload\");\n const location = res.headers.get(\"location\");\n if (!location) throw new ChatError(\"The upload server gave no location\", \"22023\", \"upload\");\n return new URL(location, endpoint).toString();\n });\n if (created === \"done\") {\n rec.done = true;\n return rec.path;\n }\n if (created === \"conflict\") {\n if (fresh) throw new ChatError(\"The upload is out of step\", undefined, \"upload\");\n fresh = true;\n rec.path = `${rec.path.slice(0, rec.path.lastIndexOf(\"/\") + 1)}${newId()}.${rec.path.slice(rec.path.lastIndexOf(\".\") + 1)}`;\n continue;\n }\n rec.location = created;\n offset = 0;\n }\n\n while (offset < length) {\n const from = offset;\n const body = await source.read(from, Math.min(length, from + chunk));\n offset = await withRetry(\"upload\", async () => {\n const res = await doFetch(rec.location!, {\n method: \"PATCH\",\n headers: await headers({ \"upload-offset\": String(from), \"content-type\": \"application/offset+octet-stream\" }),\n body,\n });\n if (res.status === 409) {\n // Out of step (an earlier chunk did land): ask where the server is.\n const head = await doFetch(rec.location!, { method: \"HEAD\", headers: await headers() });\n const at = Number(head.headers.get(\"upload-offset\"));\n // No answer: a transient failure, so the backoff applies before the next try.\n if (!head.ok || !Number.isFinite(at) || at === from) throw new ChatError(\"The upload is out of step\", undefined, \"upload\");\n return at;\n }\n if (res.status !== 204 && !res.ok) return refuse(res, \"upload\");\n return Number(res.headers.get(\"upload-offset\") ?? from + body.byteLength);\n });\n }\n rec.done = true;\n return rec.path;\n }\n\n return upload;\n}\n","/**\n * @feat:chat\n * `ChatBroadcastSheet`: write one message and send it into many of your conversations at once\n * (each person's own conversation with you), so each gets it on their own and their reply comes\n * back to you privately. Pick conversations from the inbox (filter, select all), then send. Show\n * it only to the people your app lets broadcast; the database still checks each conversation\n * (`can_post`) and says how many it reached. The same rules as the web's `ChatBroadcast`.\n */\nimport { useMemo, useState } from \"react\";\nimport { Pressable, View } from \"react-native\";\nimport {\n NativeAvatar,\n NativeButton,\n NativeCheckbox,\n NativeEmptyState,\n NativeInlineAlert,\n NativeSearchBar,\n NativeSheet,\n NativeSheetScrollView,\n NativeSkeleton,\n NativeText,\n NativeTextarea,\n useToast,\n} from \"@marktiderman/genesis-ui-native/components\";\nimport { useThemeRoles } from \"@marktiderman/genesis-ui-native/hooks\";\nimport { CHAT_LIMITS } from \"../core/media\";\nimport type { ChatInboxItem } from \"../core/types\";\nimport { useBroadcast, useInbox, usePeople } from \"../react/index\";\nimport { fill } from \"./copy\";\nimport { initials, useChatNative, type ChatPerson } from \"./context\";\n\n/** What a broadcast's toast says: all reached, one, or some of them. */\nexport function broadcastOutcome(sent: number, picked: number, copy: { broadcastSent: string; broadcastSentOne: string; broadcastSentSome: string }): { title: string; partial: boolean } {\n if (sent < picked) return { title: fill(copy.broadcastSentSome, { count: sent, total: picked }), partial: true };\n return { title: sent === 1 ? copy.broadcastSentOne : fill(copy.broadcastSent, { count: sent }), partial: false };\n}\n\n/** Rows to pick from: the filter's, named as the inbox names them, in name order, matching the query. */\nexport function broadcastRows(\n items: readonly ChatInboxItem[],\n opts: { filter?: (item: ChatInboxItem) => boolean; person: (id: string | null) => ChatPerson | undefined; untitled: string; query?: string },\n): { item: ChatInboxItem; title: string; avatarUrl: string | null }[] {\n const q = opts.query?.trim().toLowerCase() ?? \"\";\n return items\n .filter((i) => !i.archived && (opts.filter ? opts.filter(i) : true))\n .map((i) => {\n const other = i.otherUserId ? opts.person(i.otherUserId) : undefined;\n return { item: i, title: i.title ?? other?.name ?? opts.untitled, avatarUrl: other?.avatarUrl ?? null };\n })\n .filter((r) => !q || r.title.toLowerCase().includes(q))\n .sort((a, b) => a.title.localeCompare(b.title));\n}\n\nexport interface ChatBroadcastSheetProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n /** Only this kind of conversation (`direct`, say). */\n kind?: string;\n /** Which inbox rows may be picked; every one by default. */\n filter?: (item: ChatInboxItem) => boolean;\n /** Called with how many it went to, after a send. */\n onSent?: (sent: number, picked: number) => void;\n testID?: string;\n}\n\nexport function ChatBroadcastSheet({ open, onOpenChange, kind, filter, onSent, testID = \"chat-broadcast\" }: ChatBroadcastSheetProps) {\n const { copy, person: known } = useChatNative();\n const colors = useThemeRoles();\n const toast = useToast();\n const inbox = useInbox({ kind, limit: 200 });\n const { send, sending } = useBroadcast();\n const people = usePeople(useMemo(() => inbox.items.map((i) => i.otherUserId), [inbox.items]));\n const person = (id: string | null) => known(id) ?? (id ? people[id] : undefined);\n const [picked, setPicked] = useState<Set<string>>(new Set());\n const [text, setText] = useState(\"\");\n const [q, setQ] = useState(\"\");\n\n const all = broadcastRows(inbox.items, { filter, person, untitled: copy.untitled });\n const shown = broadcastRows(inbox.items, { filter, person, untitled: copy.untitled, query: q });\n const allShown = shown.length > 0 && shown.every((r) => picked.has(r.item.conversationId));\n\n const toggle = (id: string) =>\n setPicked((p) => {\n const next = new Set(p);\n if (next.has(id)) next.delete(id);\n else next.add(id);\n return next;\n });\n\n const submit = async () => {\n const body = text.trim();\n if (!body || picked.size === 0 || sending) return;\n try {\n const ids = await send([...picked], body);\n const outcome = broadcastOutcome(ids.length, picked.size, copy);\n toast.show({ title: outcome.title, variant: outcome.partial ? \"default\" : \"success\" });\n onSent?.(ids.length, picked.size);\n setText(\"\");\n setPicked(new Set());\n onOpenChange(false);\n } catch (e) {\n toast.show({ title: e instanceof Error ? e.message : copy.actionFailed, variant: \"destructive\" });\n }\n };\n\n const count = picked.size === 0 ? copy.broadcastPickSome : picked.size === 1 ? copy.broadcastPickedOne : fill(copy.broadcastPicked, { count: picked.size });\n return (\n <NativeSheet open={open} onOpenChange={onOpenChange} snapPoints={[\"90%\"]} testID={testID}>\n <NativeSheetScrollView keyboardShouldPersistTaps=\"handled\" contentContainerStyle={{ padding: 16, gap: 12 }}>\n <NativeText preset=\"h4\" accessibilityRole=\"header\">\n {copy.broadcastTitle}\n </NativeText>\n <NativeInlineAlert variant=\"info\" description={copy.broadcastExplainer} testID={`${testID}-explainer`} />\n <NativeTextarea\n testID={`${testID}-text`}\n label={copy.broadcastMessage}\n accessibilityLabel={copy.broadcastMessage}\n value={text}\n onChangeText={setText}\n maxLength={CHAT_LIMITS.bodyChars}\n placeholder={copy.broadcastPlaceholder}\n rows={4}\n />\n <View style={{ flexDirection: \"row\", alignItems: \"center\", justifyContent: \"space-between\", gap: 8 }}>\n <NativeText preset=\"label\" accessibilityRole=\"header\">\n {copy.broadcastTo}\n </NativeText>\n <NativeButton\n testID={`${testID}-all`}\n variant=\"ghost\"\n size=\"sm\"\n disabled={shown.length === 0}\n onPress={() =>\n setPicked((p) => {\n const next = new Set(p);\n for (const r of shown) {\n if (allShown) next.delete(r.item.conversationId);\n else next.add(r.item.conversationId);\n }\n return next;\n })\n }\n >\n {allShown ? copy.broadcastClear : copy.broadcastSelectAll}\n </NativeButton>\n </View>\n <NativeSearchBar testID={`${testID}-filter`} value={q} onChange={setQ} placeholder={copy.broadcastFilter} showCancel={false} />\n {inbox.isLoading ? (\n <View testID={`${testID}-loading`} style={{ gap: 8 }}>\n <NativeSkeleton height={44} className=\"w-full\" />\n <NativeSkeleton height={44} className=\"w-full\" />\n </View>\n ) : shown.length === 0 ? (\n <NativeEmptyState variant=\"no-results\" title={all.length ? copy.broadcastNoMatches : copy.broadcastNoConversations} testID={`${testID}-empty`} />\n ) : (\n <View testID={`${testID}-list`} style={{ borderRadius: 12, overflow: \"hidden\", backgroundColor: colors.surface }}>\n {shown.map(({ item, title, avatarUrl }) => {\n const on = picked.has(item.conversationId);\n return (\n <Pressable\n key={item.conversationId}\n testID={`${testID}-row-${item.conversationId}`}\n accessibilityRole=\"checkbox\"\n accessibilityLabel={title}\n accessibilityState={{ checked: on }}\n onPress={() => toggle(item.conversationId)}\n style={{ flexDirection: \"row\", alignItems: \"center\", gap: 12, minHeight: 52, paddingHorizontal: 12, paddingVertical: 6 }}\n >\n <View pointerEvents=\"none\" accessibilityElementsHidden importantForAccessibility=\"no-hide-descendants\">\n <NativeCheckbox checked={on} />\n </View>\n <NativeAvatar size={32} src={avatarUrl} fallback={initials(title)} alt={title} recyclingKey={item.conversationId} />\n <NativeText preset=\"body\" numberOfLines={1} style={{ flex: 1 }}>\n {title}\n </NativeText>\n </Pressable>\n );\n })}\n </View>\n )}\n <View style={{ flexDirection: \"row\", alignItems: \"center\", justifyContent: \"space-between\", gap: 12, paddingTop: 4 }}>\n <NativeText testID={`${testID}-count`} preset=\"body-sm\" accessibilityLiveRegion=\"polite\" style={{ flex: 1, color: colors.secondaryLabel }}>\n {count}\n </NativeText>\n <NativeButton testID={`${testID}-send`} onPress={() => void submit()} loading={sending} disabled={!text.trim() || picked.size === 0}>\n {picked.size > 1 ? fill(copy.broadcastSendTo, { count: picked.size }) : copy.broadcastSend}\n </NativeButton>\n </View>\n </NativeSheetScrollView>\n </NativeSheet>\n );\n}\n\n","/**\n * @feat:chat\n * `ChatSearchScreen`: a search field and its results, across all your conversations or in one.\n * Each result says who, when and (across conversations) where, with the snippet's matched words\n * highlighted, and a Transcript badge when it was found in a voice note's or video's transcript.\n * Tapping one calls `onOpen`, which the app uses to open the thread at that message\n * (`ChatThreadScreen jumpTo`, which loads earlier pages until it is there). The same rules as\n * the web's `ChatSearch`.\n */\nimport { useCallback, useEffect, useMemo, useState, type ReactNode } from \"react\";\nimport { AccessibilityInfo, FlatList, Pressable, View } from \"react-native\";\nimport { SafeAreaView } from \"react-native-safe-area-context\";\nimport { NativeBadge, NativeEmptyState, NativeIcon, NativeSearchBar, NativeSkeleton, NativeText } from \"@marktiderman/genesis-ui-native/components\";\nimport { formatInboxTime } from \"@marktiderman/genesis-ui-native/layouts\";\nimport { useThemeRoles } from \"@marktiderman/genesis-ui-native/hooks\";\nimport { snippetParts } from \"../core/extras\";\nimport type { ChatSearchHit } from \"../core/types\";\nimport { useChat, useInbox, usePeople, useSearch } from \"../react/index\";\nimport { fill } from \"./copy\";\nimport { useChatNative } from \"./context\";\n\n/** A snippet with its « » marks drawn highlighted, inside one Text (so it wraps as one). */\nexport function SearchSnippet({ snippet, numberOfLines = 2, testID }: { snippet: string; numberOfLines?: number; testID?: string }) {\n const colors = useThemeRoles();\n return (\n <NativeText testID={testID} preset=\"body-sm\" numberOfLines={numberOfLines}>\n {snippetParts(snippet).map((p, i) =>\n p.match ? (\n <NativeText key={i} preset=\"body-sm\" style={{ fontWeight: \"700\", color: colors.label, backgroundColor: colors.fill }}>\n {p.text}\n </NativeText>\n ) : (\n <NativeText key={i} preset=\"body-sm\" style={{ color: colors.secondaryLabel }}>\n {p.text}\n </NativeText>\n ),\n )}\n </NativeText>\n );\n}\n\n/** The snippet without its marks, for a screen reader. */\nexport function snippetText(snippet: string): string {\n return snippetParts(snippet)\n .map((p) => p.text)\n .join(\"\");\n}\n\nexport interface ChatSearchScreenProps {\n /** Search one conversation; all of yours without it. */\n conversationId?: string | null;\n /** Called with the chosen result (open the thread at it). */\n onOpen: (hit: ChatSearchHit) => void;\n /** Names a conversation on results across conversations; the inbox's names by default. */\n conversationTitle?: (conversationId: string) => string;\n debounceMs?: number;\n /** The clock, for tests. */\n now?: () => Date;\n testID?: string;\n}\n\nexport function ChatSearchScreen({ conversationId, onOpen, conversationTitle, debounceMs, now = () => new Date(), testID = \"chat-search\" }: ChatSearchScreenProps) {\n const { copy, person: known } = useChatNative();\n const { userId } = useChat();\n const colors = useThemeRoles();\n const [value, setValue] = useState(\"\");\n const { hits, query, isSearching } = useSearch(value, { conversationId, debounceMs });\n // Names for \"in …\" across conversations, as the inbox shows them (one read, cached with it).\n const inbox = useInbox({});\n const ids = useMemo(() => [...hits.map((h) => h.senderId), ...inbox.items.map((i) => i.otherUserId)], [hits, inbox.items]);\n const people = usePeople(ids);\n const nameOf = useCallback(\n (id: string | null) => (id === userId ? copy.you : ((known(id) ?? (id ? people[id] : undefined))?.name ?? copy.someone)),\n [userId, copy, known, people],\n );\n const titleOf = useCallback(\n (id: string) => {\n if (conversationTitle) return conversationTitle(id);\n const item = inbox.items.find((i) => i.conversationId === id);\n return item?.title ?? (item?.otherUserId ? nameOf(item.otherUserId) : copy.untitled);\n },\n [conversationTitle, inbox.items, nameOf, copy.untitled],\n );\n\n const short = value.trim().length < 2;\n const announce = short || isSearching ? \"\" : hits.length === 0 ? copy.searchNoResults : hits.length === 1 ? copy.searchResultsOne : fill(copy.searchResults, { count: hits.length });\n // How many results, said once they settle (VoiceOver and TalkBack).\n useEffect(() => {\n if (announce) AccessibilityInfo.announceForAccessibility?.(announce);\n }, [announce]);\n return (\n <SafeAreaView testID={testID} edges={[\"left\", \"right\"]} style={{ flex: 1, backgroundColor: colors.groupedBackground }}>\n <View style={{ paddingHorizontal: 16, paddingVertical: 8 }}>\n <NativeSearchBar\n testID={`${testID}-field`}\n value={value}\n onChange={setValue}\n placeholder={conversationId ? copy.searchThreadPlaceholder : copy.searchPlaceholder}\n cancelLabel={copy.cancel}\n showCancel={false}\n />\n </View>\n {short ? (\n <NativeText preset=\"caption\" style={{ paddingHorizontal: 20, color: colors.secondaryLabel }} testID={`${testID}-hint`}>\n {copy.searchHint}\n </NativeText>\n ) : isSearching && hits.length === 0 ? (\n <View testID={`${testID}-loading`} style={{ padding: 16, gap: 10 }}>\n <NativeSkeleton height={52} className=\"w-full\" />\n <NativeSkeleton height={52} className=\"w-full\" />\n </View>\n ) : hits.length === 0 ? (\n <NativeEmptyState variant=\"no-results\" title={copy.searchNoResults} body={fill(copy.searchNoResultsBody, { query })} testID={`${testID}-empty`} />\n ) : (\n <FlatList\n testID={`${testID}-results`}\n data={hits}\n keyExtractor={(h) => `${h.messageId}:${h.inTranscript}`}\n keyboardShouldPersistTaps=\"handled\"\n keyboardDismissMode=\"on-drag\"\n renderItem={({ item: h }) => {\n const who = nameOf(h.senderId);\n const where = conversationId ? null : fill(copy.searchIn, { name: titleOf(h.conversationId) });\n const when = formatInboxTime(new Date(h.createdAt), now());\n return (\n <HitRow\n testID={`${testID}-hit-${h.messageId}`}\n accessibilityLabel={[who, where, when, h.inTranscript ? copy.transcript : null, snippetText(h.snippet)].filter(Boolean).join(\", \")}\n onPress={() => onOpen(h)}\n >\n <View style={{ flexDirection: \"row\", alignItems: \"center\", gap: 6 }}>\n <NativeText preset=\"label\" numberOfLines={1} style={{ flexShrink: 1 }}>\n {who}\n </NativeText>\n {where ? (\n <NativeText preset=\"caption\" numberOfLines={1} style={{ flexShrink: 1, color: colors.secondaryLabel }}>\n {where}\n </NativeText>\n ) : null}\n <NativeText preset=\"caption\" style={{ marginLeft: \"auto\", color: colors.tertiaryLabel }}>\n {when}\n </NativeText>\n </View>\n <View style={{ flexDirection: \"row\", alignItems: \"flex-start\", gap: 6 }}>\n {h.inTranscript ? (\n <NativeBadge variant=\"muted\" testID={`${testID}-transcript-${h.messageId}`}>\n <View style={{ flexDirection: \"row\", alignItems: \"center\", gap: 3 }}>\n <NativeIcon name=\"mic\" size={11} color={colors.secondaryLabel} />\n <NativeText preset=\"caption\" style={{ color: colors.secondaryLabel }}>\n {copy.transcript}\n </NativeText>\n </View>\n </NativeBadge>\n ) : null}\n <View style={{ flex: 1 }}>\n <SearchSnippet snippet={h.snippet} />\n </View>\n </View>\n </HitRow>\n );\n }}\n />\n )}\n </SafeAreaView>\n );\n}\n\n/**\n * One result's row. A static style, with the pressed state kept here: with a `style` function\n * the row's padding wasn't applied in the starter on iOS 27 (the name and time touched the\n * screen's edges).\n */\nfunction HitRow({ testID, accessibilityLabel, onPress, children }: { testID: string; accessibilityLabel: string; onPress: () => void; children: ReactNode }) {\n const colors = useThemeRoles();\n const [pressed, setPressed] = useState(false);\n return (\n <Pressable\n testID={testID}\n accessibilityRole=\"button\"\n accessibilityLabel={accessibilityLabel}\n onPress={onPress}\n onPressIn={() => setPressed(true)}\n onPressOut={() => setPressed(false)}\n style={{ minHeight: 56, paddingHorizontal: 16, paddingVertical: 10, gap: 4, backgroundColor: pressed ? colors.fill : \"transparent\" }}\n >\n {children}\n </Pressable>\n );\n}\n"]}
|