movius-chats 1.0.0

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.
Files changed (150) hide show
  1. package/README.md +249 -0
  2. package/lib/commonjs/assets/Icons/ArrowBack2RoundedIcon.js +2 -0
  3. package/lib/commonjs/assets/Icons/ArrowBack2RoundedIcon.js.map +1 -0
  4. package/lib/commonjs/assets/Icons/CameraIcon.js +2 -0
  5. package/lib/commonjs/assets/Icons/CameraIcon.js.map +1 -0
  6. package/lib/commonjs/assets/Icons/CheckAllIcon.js +2 -0
  7. package/lib/commonjs/assets/Icons/CheckAllIcon.js.map +1 -0
  8. package/lib/commonjs/assets/Icons/CheckIcon.js +2 -0
  9. package/lib/commonjs/assets/Icons/CheckIcon.js.map +1 -0
  10. package/lib/commonjs/assets/Icons/EmojiFunnySquareIcon.js +2 -0
  11. package/lib/commonjs/assets/Icons/EmojiFunnySquareIcon.js.map +1 -0
  12. package/lib/commonjs/assets/Icons/LoadingIcon.js +2 -0
  13. package/lib/commonjs/assets/Icons/LoadingIcon.js.map +1 -0
  14. package/lib/commonjs/assets/Icons/MicrophoneIcon.js +2 -0
  15. package/lib/commonjs/assets/Icons/MicrophoneIcon.js.map +1 -0
  16. package/lib/commonjs/assets/Icons/PaperClipIcon.js +2 -0
  17. package/lib/commonjs/assets/Icons/PaperClipIcon.js.map +1 -0
  18. package/lib/commonjs/assets/Icons/PaperPlaneIcon.js +2 -0
  19. package/lib/commonjs/assets/Icons/PaperPlaneIcon.js.map +1 -0
  20. package/lib/commonjs/assets/Icons/PauseIcon.js +2 -0
  21. package/lib/commonjs/assets/Icons/PauseIcon.js.map +1 -0
  22. package/lib/commonjs/assets/Icons/PlayIcon.js +2 -0
  23. package/lib/commonjs/assets/Icons/PlayIcon.js.map +1 -0
  24. package/lib/commonjs/assets/Icons/XIcon.js +2 -0
  25. package/lib/commonjs/assets/Icons/XIcon.js.map +1 -0
  26. package/lib/commonjs/components/AudioPlayer/AudioPlayer.js +2 -0
  27. package/lib/commonjs/components/AudioPlayer/AudioPlayer.js.map +1 -0
  28. package/lib/commonjs/components/ChatBubble/ChatBubble.js +2 -0
  29. package/lib/commonjs/components/ChatBubble/ChatBubble.js.map +1 -0
  30. package/lib/commonjs/components/ChatBubble/MessageContent.js +2 -0
  31. package/lib/commonjs/components/ChatBubble/MessageContent.js.map +1 -0
  32. package/lib/commonjs/components/ChatBubble/MessageStatus.js +2 -0
  33. package/lib/commonjs/components/ChatBubble/MessageStatus.js.map +1 -0
  34. package/lib/commonjs/components/ChatInput/ChatInput.js +2 -0
  35. package/lib/commonjs/components/ChatInput/ChatInput.js.map +1 -0
  36. package/lib/commonjs/components/MediaViewer/MediaViewer.js +2 -0
  37. package/lib/commonjs/components/MediaViewer/MediaViewer.js.map +1 -0
  38. package/lib/commonjs/components/TypingComponent/TypingIndicator.js +2 -0
  39. package/lib/commonjs/components/TypingComponent/TypingIndicator.js.map +1 -0
  40. package/lib/commonjs/context/AudioContext.js +2 -0
  41. package/lib/commonjs/context/AudioContext.js.map +1 -0
  42. package/lib/commonjs/context/ChatContext.js +2 -0
  43. package/lib/commonjs/context/ChatContext.js.map +1 -0
  44. package/lib/commonjs/index.js +2 -0
  45. package/lib/commonjs/index.js.map +1 -0
  46. package/lib/commonjs/utils/datefunc.js +2 -0
  47. package/lib/commonjs/utils/datefunc.js.map +1 -0
  48. package/lib/module/assets/Icons/ArrowBack2RoundedIcon.js +2 -0
  49. package/lib/module/assets/Icons/ArrowBack2RoundedIcon.js.map +1 -0
  50. package/lib/module/assets/Icons/CameraIcon.js +2 -0
  51. package/lib/module/assets/Icons/CameraIcon.js.map +1 -0
  52. package/lib/module/assets/Icons/CheckAllIcon.js +2 -0
  53. package/lib/module/assets/Icons/CheckAllIcon.js.map +1 -0
  54. package/lib/module/assets/Icons/CheckIcon.js +2 -0
  55. package/lib/module/assets/Icons/CheckIcon.js.map +1 -0
  56. package/lib/module/assets/Icons/EmojiFunnySquareIcon.js +2 -0
  57. package/lib/module/assets/Icons/EmojiFunnySquareIcon.js.map +1 -0
  58. package/lib/module/assets/Icons/LoadingIcon.js +2 -0
  59. package/lib/module/assets/Icons/LoadingIcon.js.map +1 -0
  60. package/lib/module/assets/Icons/MicrophoneIcon.js +2 -0
  61. package/lib/module/assets/Icons/MicrophoneIcon.js.map +1 -0
  62. package/lib/module/assets/Icons/PaperClipIcon.js +2 -0
  63. package/lib/module/assets/Icons/PaperClipIcon.js.map +1 -0
  64. package/lib/module/assets/Icons/PaperPlaneIcon.js +2 -0
  65. package/lib/module/assets/Icons/PaperPlaneIcon.js.map +1 -0
  66. package/lib/module/assets/Icons/PauseIcon.js +2 -0
  67. package/lib/module/assets/Icons/PauseIcon.js.map +1 -0
  68. package/lib/module/assets/Icons/PlayIcon.js +2 -0
  69. package/lib/module/assets/Icons/PlayIcon.js.map +1 -0
  70. package/lib/module/assets/Icons/XIcon.js +2 -0
  71. package/lib/module/assets/Icons/XIcon.js.map +1 -0
  72. package/lib/module/components/AudioPlayer/AudioPlayer.js +2 -0
  73. package/lib/module/components/AudioPlayer/AudioPlayer.js.map +1 -0
  74. package/lib/module/components/ChatBubble/ChatBubble.js +2 -0
  75. package/lib/module/components/ChatBubble/ChatBubble.js.map +1 -0
  76. package/lib/module/components/ChatBubble/MessageContent.js +2 -0
  77. package/lib/module/components/ChatBubble/MessageContent.js.map +1 -0
  78. package/lib/module/components/ChatBubble/MessageStatus.js +2 -0
  79. package/lib/module/components/ChatBubble/MessageStatus.js.map +1 -0
  80. package/lib/module/components/ChatInput/ChatInput.js +2 -0
  81. package/lib/module/components/ChatInput/ChatInput.js.map +1 -0
  82. package/lib/module/components/MediaViewer/MediaViewer.js +2 -0
  83. package/lib/module/components/MediaViewer/MediaViewer.js.map +1 -0
  84. package/lib/module/components/TypingComponent/TypingIndicator.js +2 -0
  85. package/lib/module/components/TypingComponent/TypingIndicator.js.map +1 -0
  86. package/lib/module/context/AudioContext.js +2 -0
  87. package/lib/module/context/AudioContext.js.map +1 -0
  88. package/lib/module/context/ChatContext.js +2 -0
  89. package/lib/module/context/ChatContext.js.map +1 -0
  90. package/lib/module/index.js +2 -0
  91. package/lib/module/index.js.map +1 -0
  92. package/lib/module/utils/datefunc.js +2 -0
  93. package/lib/module/utils/datefunc.js.map +1 -0
  94. package/lib/typescript/assets/Icons/ArrowBack2RoundedIcon.d.ts +5 -0
  95. package/lib/typescript/assets/Icons/CameraIcon.d.ts +5 -0
  96. package/lib/typescript/assets/Icons/CheckAllIcon.d.ts +4 -0
  97. package/lib/typescript/assets/Icons/CheckIcon.d.ts +4 -0
  98. package/lib/typescript/assets/Icons/EmojiFunnySquareIcon.d.ts +5 -0
  99. package/lib/typescript/assets/Icons/LoadingIcon.d.ts +4 -0
  100. package/lib/typescript/assets/Icons/MicrophoneIcon.d.ts +5 -0
  101. package/lib/typescript/assets/Icons/PaperClipIcon.d.ts +5 -0
  102. package/lib/typescript/assets/Icons/PaperPlaneIcon.d.ts +5 -0
  103. package/lib/typescript/assets/Icons/PauseIcon.d.ts +5 -0
  104. package/lib/typescript/assets/Icons/PlayIcon.d.ts +5 -0
  105. package/lib/typescript/assets/Icons/XIcon.d.ts +4 -0
  106. package/lib/typescript/components/AudioPlayer/AudioPlayer.d.ts +4 -0
  107. package/lib/typescript/components/AudioPlayer/types.d.ts +5 -0
  108. package/lib/typescript/components/ChatBubble/ChatBubble.d.ts +4 -0
  109. package/lib/typescript/components/ChatBubble/MessageContent.d.ts +4 -0
  110. package/lib/typescript/components/ChatBubble/MessageStatus.d.ts +4 -0
  111. package/lib/typescript/components/ChatBubble/types.d.ts +18 -0
  112. package/lib/typescript/components/ChatInput/ChatInput.d.ts +4 -0
  113. package/lib/typescript/components/ChatInput/types.d.ts +20 -0
  114. package/lib/typescript/components/MediaViewer/MediaViewer.d.ts +4 -0
  115. package/lib/typescript/components/MediaViewer/types.d.ts +5 -0
  116. package/lib/typescript/components/TypingComponent/TypingIndicator.d.ts +11 -0
  117. package/lib/typescript/context/AudioContext.d.ts +10 -0
  118. package/lib/typescript/context/ChatContext.d.ts +19 -0
  119. package/lib/typescript/index.d.ts +4 -0
  120. package/lib/typescript/types/index.d.ts +85 -0
  121. package/lib/typescript/utils/datefunc.d.ts +1 -0
  122. package/package.json +93 -0
  123. package/src/assets/Icons/ArrowBack2RoundedIcon.tsx +25 -0
  124. package/src/assets/Icons/CameraIcon.tsx +20 -0
  125. package/src/assets/Icons/CheckAllIcon.tsx +13 -0
  126. package/src/assets/Icons/CheckIcon.tsx +11 -0
  127. package/src/assets/Icons/EmojiFunnySquareIcon.tsx +41 -0
  128. package/src/assets/Icons/LoadingIcon.tsx +15 -0
  129. package/src/assets/Icons/MicrophoneIcon.tsx +24 -0
  130. package/src/assets/Icons/PaperClipIcon.tsx +17 -0
  131. package/src/assets/Icons/PaperPlaneIcon.tsx +24 -0
  132. package/src/assets/Icons/PauseIcon.tsx +21 -0
  133. package/src/assets/Icons/PlayIcon.tsx +20 -0
  134. package/src/assets/Icons/XIcon.tsx +20 -0
  135. package/src/components/AudioPlayer/AudioPlayer.tsx +259 -0
  136. package/src/components/AudioPlayer/types.ts +5 -0
  137. package/src/components/ChatBubble/ChatBubble.tsx +137 -0
  138. package/src/components/ChatBubble/MessageContent.tsx +143 -0
  139. package/src/components/ChatBubble/MessageStatus.tsx +68 -0
  140. package/src/components/ChatBubble/types.ts +21 -0
  141. package/src/components/ChatInput/ChatInput.tsx +207 -0
  142. package/src/components/ChatInput/types.ts +22 -0
  143. package/src/components/MediaViewer/MediaViewer.tsx +101 -0
  144. package/src/components/MediaViewer/types.ts +5 -0
  145. package/src/components/TypingComponent/TypingIndicator.tsx +119 -0
  146. package/src/context/AudioContext.tsx +30 -0
  147. package/src/context/ChatContext.tsx +40 -0
  148. package/src/index.tsx +103 -0
  149. package/src/types/index.ts +94 -0
  150. package/src/utils/datefunc.ts +5 -0
@@ -0,0 +1,2 @@
1
+ "use strict";var e=require("react"),r=require("react/jsx-runtime");const t=e.createContext(void 0);exports.AudioProvider=({children:u})=>{const[i,n]=e.useState(null);return r.jsx(t.Provider,{value:{currentlyPlayingId:i,setCurrentlyPlayingId:n},children:u})},exports.useAudio=()=>{const r=e.useContext(t);if(!r)throw new Error("useAudio must be used within an AudioProvider");return r};
2
+ //# sourceMappingURL=AudioContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AudioContext.js","sources":["../../../src/context/AudioContext.tsx"],"sourcesContent":["import React, { createContext, useContext, useState } from \"react\";\n\ninterface AudioContextType {\n currentlyPlayingId: string | null;\n setCurrentlyPlayingId: (id: string | null) => void;\n}\n\nconst AudioContext = createContext<AudioContextType | undefined>(undefined);\n\nexport const AudioProvider: React.FC<{ children: React.ReactNode }> = ({\n children,\n}) => {\n const [currentlyPlayingId, setCurrentlyPlayingId] = useState<string | null>(\n null\n );\n\n return (\n <AudioContext.Provider value={{ currentlyPlayingId, setCurrentlyPlayingId }}>\n {children}\n </AudioContext.Provider>\n );\n};\n\nexport const useAudio = () => {\n const context = useContext(AudioContext);\n if (!context) {\n throw new Error(\"useAudio must be used within an AudioProvider\");\n }\n return context;\n};"],"names":["AudioContext","createContext","undefined","AudioProvider","children","currentlyPlayingId","setCurrentlyPlayingId","useState","_jsx","jsx","Provider","value","useAudio","context","useContext","Error"],"mappings":"mEAOA,MAAMA,EAAeC,EAAaA,mBAA+BC,yBAEKC,EACpEC,eAEA,MAAOC,EAAoBC,GAAyBC,EAAAA,SAClD,MAGF,OACEC,EAAAC,IAACT,EAAaU,SAAQ,CAACC,MAAO,CAAEN,qBAAoBC,yBAAwBF,SACzEA,GACqB,mBAIJQ,KACtB,MAAMC,EAAUC,EAAUA,WAACd,GAC3B,IAAKa,EACH,MAAM,IAAIE,MAAM,iDAElB,OAAOF,CAAO"}
@@ -0,0 +1,2 @@
1
+ "use strict";var e=require("react"),t=require("react/jsx-runtime");const r=e.createContext(void 0);exports.ChatProvider=({children:i,...s})=>{const[o,a]=e.useState({imageUrl:"",videoUrl:""}),[n,u]=e.useState(!1);return t.jsx(r.Provider,{value:{...s,mediaUrl:o,setMediaUrl:a,isVideoPlaying:n,setIsVideoPlaying:u},children:i})},exports.useChatContext=()=>{const t=e.useContext(r);if(!t)throw new Error("useChatContext must be used within a ChatProvider");return t};
2
+ //# sourceMappingURL=ChatContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChatContext.js","sources":["../../../src/context/ChatContext.tsx"],"sourcesContent":["import React, { createContext, useContext, useState } from \"react\";\nimport { ChatScreenProps } from \"../types\";\n\ninterface ChatContextType extends ChatScreenProps {\n mediaUrl: { imageUrl: string; videoUrl: string };\n setMediaUrl: (url: { imageUrl: string; videoUrl: string }) => void;\n isVideoPlaying: boolean;\n setIsVideoPlaying: (playing: boolean) => void;\n}\n\nconst ChatContext = createContext<ChatContextType | undefined>(undefined);\n\nexport const ChatProvider: React.FC<\n ChatScreenProps & { children: React.ReactNode }\n> = ({ children, ...props }) => {\n const [mediaUrl, setMediaUrl] = useState({ imageUrl: \"\", videoUrl: \"\" });\n const [isVideoPlaying, setIsVideoPlaying] = useState(false);\n\n return (\n <ChatContext.Provider\n value={{\n ...props,\n mediaUrl,\n setMediaUrl,\n isVideoPlaying,\n setIsVideoPlaying,\n }}\n >\n {children}\n </ChatContext.Provider>\n );\n};\n\nexport const useChatContext = () => {\n const context = useContext(ChatContext);\n if (!context) {\n throw new Error(\"useChatContext must be used within a ChatProvider\");\n }\n return context;\n};\n"],"names":["ChatContext","createContext","undefined","ChatProvider","children","props","mediaUrl","setMediaUrl","useState","imageUrl","videoUrl","isVideoPlaying","setIsVideoPlaying","_jsx","jsx","Provider","value","useChatContext","context","useContext","Error"],"mappings":"mEAUA,MAAMA,EAAcC,EAAaA,mBAA8BC,wBAI3DC,EAAGC,cAAaC,MAClB,MAAOC,EAAUC,GAAeC,WAAS,CAAEC,SAAU,GAAIC,SAAU,MAC5DC,EAAgBC,GAAqBJ,EAAAA,UAAS,GAErD,OACEK,EAAAC,IAACd,EAAYe,SAAQ,CACnBC,MAAO,IACFX,EACHC,WACAC,cACAI,iBACAC,qBACAR,SAEDA,GACoB,yBAIGa,KAC5B,MAAMC,EAAUC,EAAUA,WAACnB,GAC3B,IAAKkB,EACH,MAAM,IAAIE,MAAM,qDAElB,OAAOF,CAAO"}
@@ -0,0 +1,2 @@
1
+ "use strict";require("react");var e=require("react-native"),n=require("twrnc"),r=require("./components/ChatBubble/ChatBubble.js"),t=require("./components/ChatInput/ChatInput.js"),o=require("./components/MediaViewer/MediaViewer.js"),s=require("./components/TypingComponent/TypingIndicator.js"),i=require("./context/AudioContext.js"),a=require("./context/ChatContext.js"),d=require("react/jsx-runtime");const c=()=>{const{messages:i,currentUserId:c,onMessageLongPress:u,mediaUrl:m,setMediaUrl:C,setIsVideoPlaying:l,typingUsers:p,onSendMessage:I,onTypingStart:g,onTypingEnd:x,onAttachmentPress:h,onAudioRecordEnd:j,onAudioRecordStart:U,onCameraPress:y,renderCustomInput:q,CustomEmojiIcon:A,CustomAttachmentIcon:S,CustomCameraIcon:v,CustomMicrophoneIcon:P,CustomSendIcon:M}=a.useChatContext();return d.jsxs(e.View,{style:n`flex-1 px-2 pb-4 gap-2 relative`,children:[d.jsx(e.FlatList,{data:i,keyExtractor:e=>e.id,renderItem:({item:e,index:n})=>d.jsx(r,{message:e,isCurrentUser:e.senderId===c,onLongPress:()=>u?.(e),isFirstInSequence:n===i.length-1||i[n+1]?.senderId!==e.senderId}),ListHeaderComponent:d.jsx(s.TypingIndicator,{typingUsers:p||[],currentUserId:c}),showsVerticalScrollIndicator:!1,inverted:!0}),q?q():d.jsx(t,{onSendMessage:I,onTypingStart:g,onTypingEnd:x,onAttachmentPress:h,onAudioRecordEnd:j,onAudioRecordStart:U,onCameraPress:y,CustomEmojiIcon:A,CustomAttachmentIcon:S,CustomCameraIcon:v,CustomMicrophoneIcon:P,CustomSendIcon:M}),d.jsx(o,{imageUrl:m.imageUrl,videoUrl:m.videoUrl,onClose:()=>{C({imageUrl:"",videoUrl:""}),l(!1)}})]})};module.exports=e=>d.jsx(i.AudioProvider,{children:d.jsx(a.ChatProvider,{...e,children:d.jsx(c,{})})});
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../src/index.tsx"],"sourcesContent":["import React from 'react';\nimport { FlatList, View } from 'react-native';\nimport tw from 'twrnc';\nimport ChatBubble from './components/ChatBubble/ChatBubble';\nimport ChatInput from './components/ChatInput/ChatInput';\nimport MediaViewer from './components/MediaViewer/MediaViewer';\nimport { TypingIndicator } from './components/TypingComponent/TypingIndicator';\nimport { AudioProvider } from './context/AudioContext';\nimport { ChatProvider, useChatContext } from './context/ChatContext';\nimport { ChatScreenProps } from './types';\n\nconst ChatScreenContent = () => {\n const {\n messages,\n currentUserId,\n onMessageLongPress,\n mediaUrl,\n setMediaUrl,\n setIsVideoPlaying,\n typingUsers,\n onSendMessage,\n onTypingStart,\n onTypingEnd,\n onAttachmentPress,\n onAudioRecordEnd,\n onAudioRecordStart,\n onCameraPress,\n renderCustomInput,\n CustomEmojiIcon,\n CustomAttachmentIcon,\n CustomCameraIcon,\n CustomMicrophoneIcon,\n CustomSendIcon,\n } = useChatContext();\n\n return (\n <View style={tw`flex-1 px-2 pb-4 gap-2 relative`}>\n <FlatList\n data={messages}\n keyExtractor={(item) => item.id}\n renderItem={({ item, index }) => (\n <ChatBubble\n message={item}\n isCurrentUser={item.senderId === currentUserId}\n onLongPress={() => onMessageLongPress?.(item)}\n isFirstInSequence={\n index === messages.length - 1 ||\n messages[index + 1]?.senderId !== item.senderId\n }\n />\n )}\n ListHeaderComponent={\n <TypingIndicator\n typingUsers={typingUsers || []}\n currentUserId={currentUserId}\n />\n }\n showsVerticalScrollIndicator={false}\n inverted\n />\n\n {renderCustomInput ? (\n renderCustomInput()\n ) : (\n <ChatInput\n onSendMessage={onSendMessage}\n onTypingStart={onTypingStart}\n onTypingEnd={onTypingEnd}\n onAttachmentPress={onAttachmentPress}\n onAudioRecordEnd={onAudioRecordEnd}\n onAudioRecordStart={onAudioRecordStart}\n onCameraPress={onCameraPress}\n CustomEmojiIcon={CustomEmojiIcon}\n CustomAttachmentIcon={CustomAttachmentIcon}\n CustomCameraIcon={CustomCameraIcon}\n CustomMicrophoneIcon={CustomMicrophoneIcon}\n CustomSendIcon={CustomSendIcon}\n />\n )}\n\n <MediaViewer\n imageUrl={mediaUrl.imageUrl}\n videoUrl={mediaUrl.videoUrl}\n onClose={() => {\n setMediaUrl({ imageUrl: '', videoUrl: '' });\n setIsVideoPlaying(false);\n }}\n />\n </View>\n );\n};\n\nconst ChatScreen: React.FC<ChatScreenProps> = (props) => {\n return (\n <AudioProvider>\n <ChatProvider {...props}>\n <ChatScreenContent />\n </ChatProvider>\n </AudioProvider>\n );\n};\n\nexport default ChatScreen;\n"],"names":["ChatScreenContent","messages","currentUserId","onMessageLongPress","mediaUrl","setMediaUrl","setIsVideoPlaying","typingUsers","onSendMessage","onTypingStart","onTypingEnd","onAttachmentPress","onAudioRecordEnd","onAudioRecordStart","onCameraPress","renderCustomInput","CustomEmojiIcon","CustomAttachmentIcon","CustomCameraIcon","CustomMicrophoneIcon","CustomSendIcon","useChatContext","_jsxs","View","style","tw","children","_jsx","jsx","FlatList","data","keyExtractor","item","id","renderItem","index","ChatBubble","message","isCurrentUser","senderId","onLongPress","isFirstInSequence","length","ListHeaderComponent","TypingIndicator","showsVerticalScrollIndicator","inverted","ChatInput","MediaViewer","imageUrl","videoUrl","onClose","props","AudioProvider","ChatProvider"],"mappings":"iZAWA,MAAMA,EAAoBA,KACxB,MAAMC,SACJA,EAAQC,cACRA,EAAaC,mBACbA,EAAkBC,SAClBA,EAAQC,YACRA,EAAWC,kBACXA,EAAiBC,YACjBA,EAAWC,cACXA,EAAaC,cACbA,EAAaC,YACbA,EAAWC,kBACXA,EAAiBC,iBACjBA,EAAgBC,mBAChBA,EAAkBC,cAClBA,EAAaC,kBACbA,EAAiBC,gBACjBA,EAAeC,qBACfA,EAAoBC,iBACpBA,EAAgBC,qBAChBA,EAAoBC,eACpBA,GACEC,mBAEJ,OACEC,EAAAA,KAACC,EAAAA,KAAI,CAACC,MAAOC,CAAE,kCAAkCC,SAAA,CAC/CC,EAAAC,IAACC,WAAQ,CACPC,KAAM7B,EACN8B,aAAeC,GAASA,EAAKC,GAC7BC,WAAYA,EAAGF,OAAMG,WACnBR,EAAAA,IAACS,EAAU,CACTC,QAASL,EACTM,cAAeN,EAAKO,WAAarC,EACjCsC,YAAaA,IAAMrC,IAAqB6B,GACxCS,kBACEN,IAAUlC,EAASyC,OAAS,GAC5BzC,EAASkC,EAAQ,IAAII,WAAaP,EAAKO,WAI7CI,oBACEhB,EAAAC,IAACgB,kBAAe,CACdrC,YAAaA,GAAe,GAC5BL,cAAeA,IAGnB2C,8BAA8B,EAC9BC,UAAQ,IAGT/B,EACCA,IAEAY,EAAAA,IAACoB,EAAS,CACRvC,cAAeA,EACfC,cAAeA,EACfC,YAAaA,EACbC,kBAAmBA,EACnBC,iBAAkBA,EAClBC,mBAAoBA,EACpBC,cAAeA,EACfE,gBAAiBA,EACjBC,qBAAsBA,EACtBC,iBAAkBA,EAClBC,qBAAsBA,EACtBC,eAAgBA,IAIpBO,EAAAC,IAACoB,EAAW,CACVC,SAAU7C,EAAS6C,SACnBC,SAAU9C,EAAS8C,SACnBC,QAASA,KACP9C,EAAY,CAAE4C,SAAU,GAAIC,SAAU,KACtC5C,GAAkB,EAAM,MAGvB,iBAIoC8C,GAE3CzB,EAAAA,IAAC0B,EAAAA,cAAa,CAAA3B,SACZC,EAAAC,IAAC0B,eAAY,IAAKF,EAAK1B,SACrBC,EAAAA,IAAC3B,EAAmB,CAAA"}
@@ -0,0 +1,2 @@
1
+ "use strict";exports.formatDuration=t=>{const o=Math.floor(t/60),r=Math.floor(t%60);return`${o}:${r<10?"0":""}${r}`};
2
+ //# sourceMappingURL=datefunc.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"datefunc.js","sources":["../../../src/utils/datefunc.ts"],"sourcesContent":[" export const formatDuration = (time: number) => {\n const minutes = Math.floor(time / 60);\n const seconds = Math.floor(time % 60);\n return `${minutes}:${seconds < 10 ? \"0\" : \"\"}${seconds}`;\n };"],"names":["time","minutes","Math","floor","seconds"],"mappings":"oCAAgCA,IAC5B,MAAMC,EAAUC,KAAKC,MAAMH,EAAO,IAC5BI,EAAUF,KAAKC,MAAMH,EAAO,IAClC,MAAO,GAAGC,KAAWG,EAAU,GAAK,IAAM,KAAKA,GAAS"}
@@ -0,0 +1,2 @@
1
+ import e,{Path as o}from"react-native-svg";import{jsx as r}from"react/jsx-runtime";const t=({style:t,color:i})=>r(e,{style:t,fill:i,viewBox:"0 0 48 48",children:r(o,{fillRule:"evenodd",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"4",d:"M8 9.115c0-1.82 2.235-2.694 3.47-1.356l29.432 31.884c1.182 1.282.273 3.357-1.47 3.357H10a2 2 0 0 1-2-2z",clipRule:"evenodd"})});export{t as ArrowBack2RoundedIcon};
2
+ //# sourceMappingURL=ArrowBack2RoundedIcon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ArrowBack2RoundedIcon.js","sources":["../../../../src/assets/Icons/ArrowBack2RoundedIcon.tsx"],"sourcesContent":["\nimport { ViewStyle } from \"react-native\";\nimport Svg, { Path } from \"react-native-svg\";\n\nexport const ArrowBack2RoundedIcon = ({\n style,\n color,\n}: {\n style?: ViewStyle;\n color?: string;\n}) => {\n return (\n <Svg style={style} fill={color} viewBox=\"0 0 48 48\">\n <Path\n fillRule=\"evenodd\"\n stroke=\"currentColor\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth=\"4\"\n d=\"M8 9.115c0-1.82 2.235-2.694 3.47-1.356l29.432 31.884c1.182 1.282.273 3.357-1.47 3.357H10a2 2 0 0 1-2-2z\"\n clipRule=\"evenodd\"\n ></Path>\n </Svg>\n );\n};\n"],"names":["ArrowBack2RoundedIcon","style","color","_jsx","Svg","fill","viewBox","children","Path","fillRule","stroke","strokeLinecap","strokeLinejoin","strokeWidth","d","clipRule"],"mappings":"mFAIO,MAAMA,EAAwBA,EACnCC,QACAC,WAMEC,EAACC,EAAG,CAACH,MAAOA,EAAOI,KAAMH,EAAOI,QAAQ,YAAWC,SACjDJ,EAACK,EAAI,CACHC,SAAS,UACTC,OAAO,eACPC,cAAc,QACdC,eAAe,QACfC,YAAY,IACZC,EAAE,0GACFC,SAAS"}
@@ -0,0 +1,2 @@
1
+ import{Svg as c,G as r,Circle as e,Path as o}from"react-native-svg";import{jsx as t,jsxs as i}from"react/jsx-runtime";const s=({style:s,color:n})=>t(c,{style:s,viewBox:"0 0 24 24",children:i(r,{fill:"none",strokeWidth:"1.5",stroke:n,children:[t(e,{cx:"12",cy:"13",r:"3"}),t(o,{d:"M9.778 21h4.444c3.121 0 4.682 0 5.803-.735a4.4 4.4 0 0 0 1.226-1.204c.749-1.1.749-2.633.749-5.697s0-4.597-.749-5.697a4.4 4.4 0 0 0-1.226-1.204c-.72-.473-1.622-.642-3.003-.702c-.659 0-1.226-.49-1.355-1.125A2.064 2.064 0 0 0 13.634 3h-3.268c-.988 0-1.839.685-2.033 1.636c-.129.635-.696 1.125-1.355 1.125c-1.38.06-2.282.23-3.003.702A4.4 4.4 0 0 0 2.75 7.667C2 8.767 2 10.299 2 13.364s0 4.596.749 5.697c.324.476.74.885 1.226 1.204C5.096 21 6.657 21 9.778 21Z"}),t(o,{strokeLinecap:"round",d:"M19 10h-1"})]})});export{s as CameraIcon};
2
+ //# sourceMappingURL=CameraIcon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CameraIcon.js","sources":["../../../../src/assets/Icons/CameraIcon.tsx"],"sourcesContent":["import { ViewStyle } from \"react-native\";\nimport { Circle, G, Path, Svg } from \"react-native-svg\";\n\nexport const CameraIcon = ({\n style,\n color\n}: {\n style?: ViewStyle;\n color?: string;\n}) => {\n return (\n <Svg style={style} viewBox=\"0 0 24 24\">\n <G fill=\"none\" strokeWidth=\"1.5\" stroke={color}>\n <Circle cx=\"12\" cy=\"13\" r=\"3\"></Circle>\n <Path d=\"M9.778 21h4.444c3.121 0 4.682 0 5.803-.735a4.4 4.4 0 0 0 1.226-1.204c.749-1.1.749-2.633.749-5.697s0-4.597-.749-5.697a4.4 4.4 0 0 0-1.226-1.204c-.72-.473-1.622-.642-3.003-.702c-.659 0-1.226-.49-1.355-1.125A2.064 2.064 0 0 0 13.634 3h-3.268c-.988 0-1.839.685-2.033 1.636c-.129.635-.696 1.125-1.355 1.125c-1.38.06-2.282.23-3.003.702A4.4 4.4 0 0 0 2.75 7.667C2 8.767 2 10.299 2 13.364s0 4.596.749 5.697c.324.476.74.885 1.226 1.204C5.096 21 6.657 21 9.778 21Z\"></Path>\n <Path strokeLinecap=\"round\" d=\"M19 10h-1\"></Path>\n </G>\n </Svg>\n );\n};\n"],"names":["CameraIcon","style","color","_jsx","Svg","viewBox","children","_jsxs","G","fill","strokeWidth","stroke","Circle","cx","cy","r","Path","d","strokeLinecap"],"mappings":"sHAGO,MAAMA,EAAaA,EACxBC,QACAC,WAMEC,EAACC,EAAG,CAACH,MAAOA,EAAOI,QAAQ,YAAWC,SACpCC,EAACC,EAAC,CAACC,KAAK,OAAOC,YAAY,MAAMC,OAAQT,EAAMI,SAAA,CAC7CH,EAACS,EAAM,CAACC,GAAG,KAAKC,GAAG,KAAKC,EAAE,MAC1BZ,EAACa,EAAI,CAACC,EAAE,2cACRd,EAACa,EAAI,CAACE,cAAc,QAAQD,EAAE"}
@@ -0,0 +1,2 @@
1
+ import t,{Path as e}from"react-native-svg";import{jsx as l}from"react/jsx-runtime";const r=({style:r})=>l(t,{style:r,viewBox:"0 0 24 24",children:l(e,{d:"M.41 13.41L6 19l1.41-1.42L1.83 12m20.41-6.42L11.66 16.17L7.5 12l-1.43 1.41L11.66 19l12-12M18 7l-1.41-1.42l-6.35 6.35l1.42 1.41z"})});export{r as CheckAllIcon};
2
+ //# sourceMappingURL=CheckAllIcon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CheckAllIcon.js","sources":["../../../../src/assets/Icons/CheckAllIcon.tsx"],"sourcesContent":["\nimport { ViewStyle } from \"react-native\";\nimport Svg, { Path } from \"react-native-svg\";\n\nexport const CheckAllIcon = ({ style }: { style?: ViewStyle }) => {\n return (\n <Svg style={style} viewBox=\"0 0 24 24\">\n <Path\n d=\"M.41 13.41L6 19l1.41-1.42L1.83 12m20.41-6.42L11.66 16.17L7.5 12l-1.43 1.41L11.66 19l12-12M18 7l-1.41-1.42l-6.35 6.35l1.42 1.41z\"\n ></Path>\n </Svg>\n );\n};\n"],"names":["CheckAllIcon","style","_jsx","Svg","viewBox","children","Path","d"],"mappings":"mFAIO,MAAMA,EAAeA,EAAGC,WAE3BC,EAACC,EAAG,CAACF,MAAOA,EAAOG,QAAQ,YAAWC,SACpCH,EAACI,EAAI,CACHC,EAAE"}
@@ -0,0 +1,2 @@
1
+ import t,{Path as e}from"react-native-svg";import{jsx as r}from"react/jsx-runtime";const o=({style:o})=>r(t,{style:o,viewBox:"0 0 24 24",children:r(e,{d:"m9.55 18l-5.7-5.7l1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"})});export{o as CheckIcon};
2
+ //# sourceMappingURL=CheckIcon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CheckIcon.js","sources":["../../../../src/assets/Icons/CheckIcon.tsx"],"sourcesContent":["\nimport { ViewStyle } from \"react-native\";\nimport Svg, { Path } from \"react-native-svg\";\n\nexport const CheckIcon = ({ style }: { style?: ViewStyle }) => {\n return (\n <Svg style={style} viewBox=\"0 0 24 24\">\n <Path d=\"m9.55 18l-5.7-5.7l1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z\"></Path>\n </Svg>\n );\n};\n"],"names":["CheckIcon","style","_jsx","Svg","viewBox","children","Path","d"],"mappings":"mFAIO,MAAMA,EAAYA,EAAGC,WAExBC,EAACC,EAAG,CAACF,MAAOA,EAAOG,QAAQ,YAAWC,SACpCH,EAACI,EAAI,CAACC,EAAE"}
@@ -0,0 +1,2 @@
1
+ import r,{G as t,Path as o,Ellipse as e}from"react-native-svg";import{jsx as c,jsxs as s}from"react/jsx-runtime";const l=({style:l,color:i})=>c(r,{style:l,viewBox:"0 0 24 24",children:s(t,{fill:"none",stroke:i,children:[c(o,{strokeLinecap:"round",strokeWidth:"1.5",d:"M8.913 15.934c1.258.315 2.685.315 4.122-.07s2.673-1.099 3.605-2.001"}),c(e,{cx:"14.509",cy:"9.774",fill:"currentColor",rx:"1",ry:"1.5",transform:"rotate(-15 14.51 9.774)"}),c(e,{cx:"8.714",cy:"11.328",fill:"currentColor",rx:"1",ry:"1.5",transform:"rotate(-15 8.714 11.328)"}),c(o,{strokeWidth:"1.5",d:"M3.204 14.357c-1.112-4.147-1.667-6.22-.724-7.853s3.016-2.19 7.163-3.3c4.147-1.112 6.22-1.667 7.853-.724s2.19 3.016 3.3 7.163c1.111 4.147 1.667 6.22.724 7.853s-3.016 2.19-7.163 3.3c-4.147 1.111-6.22 1.667-7.853.724s-2.19-3.016-3.3-7.163Z"}),c(o,{strokeWidth:"1.5",d:"m13 16l.478.974a1.5 1.5 0 1 0 2.693-1.322l-.46-.935"})]})});export{l as EmojiFunnySquareIcon};
2
+ //# sourceMappingURL=EmojiFunnySquareIcon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EmojiFunnySquareIcon.js","sources":["../../../../src/assets/Icons/EmojiFunnySquareIcon.tsx"],"sourcesContent":["\nimport { ViewStyle } from \"react-native\";\nimport Svg, { Ellipse, G, Path } from \"react-native-svg\";\n\nexport const EmojiFunnySquareIcon = ({ style ,color}: { style?: ViewStyle,color?: string }) => {\n return (\n <Svg style={style} viewBox=\"0 0 24 24\">\n <G fill=\"none\" stroke={color}>\n <Path\n strokeLinecap=\"round\"\n strokeWidth=\"1.5\"\n d=\"M8.913 15.934c1.258.315 2.685.315 4.122-.07s2.673-1.099 3.605-2.001\"\n ></Path>\n <Ellipse\n cx=\"14.509\"\n cy=\"9.774\"\n fill=\"currentColor\"\n rx=\"1\"\n ry=\"1.5\"\n transform=\"rotate(-15 14.51 9.774)\"\n ></Ellipse>\n <Ellipse\n cx=\"8.714\"\n cy=\"11.328\"\n fill=\"currentColor\"\n rx=\"1\"\n ry=\"1.5\"\n transform=\"rotate(-15 8.714 11.328)\"\n ></Ellipse>\n <Path\n strokeWidth=\"1.5\"\n d=\"M3.204 14.357c-1.112-4.147-1.667-6.22-.724-7.853s3.016-2.19 7.163-3.3c4.147-1.112 6.22-1.667 7.853-.724s2.19 3.016 3.3 7.163c1.111 4.147 1.667 6.22.724 7.853s-3.016 2.19-7.163 3.3c-4.147 1.111-6.22 1.667-7.853.724s-2.19-3.016-3.3-7.163Z\"\n ></Path>\n <Path\n strokeWidth=\"1.5\"\n d=\"m13 16l.478.974a1.5 1.5 0 1 0 2.693-1.322l-.46-.935\"\n ></Path>\n </G>\n </Svg>\n );\n};\n"],"names":["EmojiFunnySquareIcon","style","color","_jsx","Svg","viewBox","children","_jsxs","G","fill","stroke","Path","strokeLinecap","strokeWidth","d","Ellipse","cx","cy","rx","ry","transform"],"mappings":"iHAIO,MAAMA,EAAuBA,EAAGC,QAAOC,WAE1CC,EAACC,EAAG,CAACH,MAAOA,EAAOI,QAAQ,YAAWC,SACpCC,EAACC,EAAC,CAACC,KAAK,OAAOC,OAAQR,EAAMI,SAAA,CAC3BH,EAACQ,EAAI,CACHC,cAAc,QACdC,YAAY,MACZC,EAAE,wEAEJX,EAACY,EAAO,CACNC,GAAG,SACHC,GAAG,QACHR,KAAK,eACLS,GAAG,IACHC,GAAG,MACHC,UAAU,4BAEZjB,EAACY,EAAO,CACNC,GAAG,QACHC,GAAG,SACHR,KAAK,eACLS,GAAG,IACHC,GAAG,MACHC,UAAU,6BAEZjB,EAACQ,EAAI,CACHE,YAAY,MACZC,EAAE,iPAEJX,EAACQ,EAAI,CACHE,YAAY,MACZC,EAAE"}
@@ -0,0 +1,2 @@
1
+ import c,{Path as t}from"react-native-svg";import{jsx as e}from"react/jsx-runtime";const r=({style:r})=>e(c,{style:r,viewBox:"0 0 1024 1024",children:e(t,{d:"M988 548c-19.9 0-36-16.1-36-36c0-59.4-11.6-117-34.6-171.3a440.5 440.5 0 0 0-94.3-139.9a437.7 437.7 0 0 0-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150s83.9 101.8 109.7 162.7c26.7 63.1 40.2 130.2 40.2 199.3c.1 19.9-16 36-35.9 36"})});export{r as LoadingIcon};
2
+ //# sourceMappingURL=LoadingIcon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LoadingIcon.js","sources":["../../../../src/assets/Icons/LoadingIcon.tsx"],"sourcesContent":["import { ViewStyle } from \"react-native\";\nimport Svg, { Path } from \"react-native-svg\";\n\nexport const LoadingIcon = ({ style }: { style?: ViewStyle }) => {\n return (\n <Svg\n style={style}\n viewBox=\"0 0 1024 1024\"\n >\n <Path\n d=\"M988 548c-19.9 0-36-16.1-36-36c0-59.4-11.6-117-34.6-171.3a440.5 440.5 0 0 0-94.3-139.9a437.7 437.7 0 0 0-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150s83.9 101.8 109.7 162.7c26.7 63.1 40.2 130.2 40.2 199.3c.1 19.9-16 36-35.9 36\"\n ></Path>\n </Svg>\n );\n};\n"],"names":["LoadingIcon","style","_jsx","Svg","viewBox","children","Path","d"],"mappings":"mFAGO,MAAMA,EAAcA,EAAGC,WAE1BC,EAACC,EAAG,CACHF,MAAOA,EACNG,QAAQ,gBAAeC,SAEvBH,EAACI,EAAI,CACHC,EAAE"}
@@ -0,0 +1,2 @@
1
+ import e,{G as o,Path as r}from"react-native-svg";import{jsx as t,jsxs as i}from"react/jsx-runtime";const m=({style:m,color:a})=>t(e,{style:m,viewBox:"0 0 24 24",children:i(o,{fill:"none",strokeWidth:"1.5",stroke:a,children:[t(r,{d:"M7 8a5 5 0 0 1 10 0v3a5 5 0 0 1-10 0z"}),t(r,{strokeLinecap:"round",d:"M13.5 8H17m-3.5 3H17M7 8h2m-2 3h2m11-1v1a8 8 0 0 1-8 8m-8-9v1a8 8 0 0 0 8 8m0 0v3",opacity:".5"})]})});export{m as MicrophoneIcon};
2
+ //# sourceMappingURL=MicrophoneIcon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MicrophoneIcon.js","sources":["../../../../src/assets/Icons/MicrophoneIcon.tsx"],"sourcesContent":["\nimport { ViewStyle } from \"react-native\";\nimport Svg, { G, Path } from \"react-native-svg\";\n\nexport const MicrophoneIcon = ({\n style,\n color,\n}: {\n style?: ViewStyle;\n color?: string;\n}) => {\n return (\n <Svg style={style} viewBox=\"0 0 24 24\">\n <G fill=\"none\" strokeWidth=\"1.5\" stroke={color}>\n <Path d=\"M7 8a5 5 0 0 1 10 0v3a5 5 0 0 1-10 0z\"></Path>\n <Path\n strokeLinecap=\"round\"\n d=\"M13.5 8H17m-3.5 3H17M7 8h2m-2 3h2m11-1v1a8 8 0 0 1-8 8m-8-9v1a8 8 0 0 0 8 8m0 0v3\"\n opacity=\".5\"\n ></Path>\n </G>\n </Svg>\n );\n};\n"],"names":["MicrophoneIcon","style","color","_jsx","Svg","viewBox","children","_jsxs","G","fill","strokeWidth","stroke","Path","d","strokeLinecap","opacity"],"mappings":"oGAIO,MAAMA,EAAiBA,EAC5BC,QACAC,WAMEC,EAACC,EAAG,CAACH,MAAOA,EAAOI,QAAQ,YAAWC,SACpCC,EAACC,EAAC,CAACC,KAAK,OAAOC,YAAY,MAAMC,OAAQT,EAAMI,SAAA,CAC7CH,EAACS,EAAI,CAACC,EAAE,0CACRV,EAACS,EAAI,CACHE,cAAc,QACdD,EAAE,oFACFE,QAAQ"}
@@ -0,0 +1,2 @@
1
+ import t,{Path as q}from"react-native-svg";import{jsx as r}from"react/jsx-runtime";const e=({style:e,color:o})=>r(t,{style:e,fill:o,viewBox:"0 0 24 24",children:r(q,{d:"M17.346 15.539q0 2.271-1.565 3.866T11.952 21t-3.838-1.595t-1.576-3.867v-8.73q0-1.587 1.092-2.697Q8.72 3 10.308 3t2.678 1.11t1.091 2.698v8.269q0 .88-.615 1.517q-.614.637-1.498.637t-1.52-.627t-.636-1.527V6.769h1v8.308q0 .479.327.816q.328.338.807.338t.807-.338t.328-.816V6.789q-.006-1.166-.802-1.977Q11.48 4 10.308 4q-1.163 0-1.966.821q-.804.821-.804 1.987v8.73q-.005 1.853 1.283 3.157Q10.11 20 11.96 20q1.823 0 3.1-1.305t1.287-3.156v-8.77h1z"})});export{e as PaperClipIcon};
2
+ //# sourceMappingURL=PaperClipIcon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PaperClipIcon.js","sources":["../../../../src/assets/Icons/PaperClipIcon.tsx"],"sourcesContent":["\nimport { ViewStyle } from \"react-native\";\nimport Svg, { Path } from \"react-native-svg\";\n\nexport const PaperClipIcon = ({\n style,\n color,\n}: {\n style?: ViewStyle;\n color?: string;\n}) => {\n return (\n <Svg style={style} fill={color} viewBox=\"0 0 24 24\">\n <Path d=\"M17.346 15.539q0 2.271-1.565 3.866T11.952 21t-3.838-1.595t-1.576-3.867v-8.73q0-1.587 1.092-2.697Q8.72 3 10.308 3t2.678 1.11t1.091 2.698v8.269q0 .88-.615 1.517q-.614.637-1.498.637t-1.52-.627t-.636-1.527V6.769h1v8.308q0 .479.327.816q.328.338.807.338t.807-.338t.328-.816V6.789q-.006-1.166-.802-1.977Q11.48 4 10.308 4q-1.163 0-1.966.821q-.804.821-.804 1.987v8.73q-.005 1.853 1.283 3.157Q10.11 20 11.96 20q1.823 0 3.1-1.305t1.287-3.156v-8.77h1z\"></Path>\n </Svg>\n );\n};\n"],"names":["PaperClipIcon","style","color","_jsx","Svg","fill","viewBox","children","Path","d"],"mappings":"mFAIO,MAAMA,EAAgBA,EAC3BC,QACAC,WAMEC,EAACC,EAAG,CAACH,MAAOA,EAAOI,KAAMH,EAAOI,QAAQ,YAAWC,SACjDJ,EAACK,EAAI,CAACC,EAAE"}
@@ -0,0 +1,2 @@
1
+ import c,{G as e,Path as o}from"react-native-svg";import{jsx as r,jsxs as t}from"react/jsx-runtime";const i=({style:i,color:l})=>r(c,{style:i,viewBox:"0 0 24 24",children:t(e,{fill:"none",strokeWidth:"1.5",stroke:l,children:[r(o,{d:"m18.636 15.67l1.716-5.15c1.5-4.498 2.25-6.747 1.062-7.934s-3.436-.438-7.935 1.062L8.33 5.364C4.7 6.574 2.885 7.18 2.37 8.067a2.72 2.72 0 0 0 0 2.73c.515.888 2.33 1.493 5.96 2.704c.584.194.875.291 1.119.454c.236.158.439.361.597.597c.163.244.26.535.454 1.118c1.21 3.63 1.816 5.446 2.703 5.962a2.72 2.72 0 0 0 2.731 0c.887-.516 1.492-2.331 2.703-5.962Z"}),r(o,{strokeLinecap:"round",d:"m17.79 6.21l-4.211 4.165",opacity:".5"})]})});export{i as PaperPlaneIcon};
2
+ //# sourceMappingURL=PaperPlaneIcon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PaperPlaneIcon.js","sources":["../../../../src/assets/Icons/PaperPlaneIcon.tsx"],"sourcesContent":["import { ViewStyle } from \"react-native\";\n\nimport Svg, { G, Path } from \"react-native-svg\";\n\nexport const PaperPlaneIcon = ({\n style,\n color,\n}: {\n style?: ViewStyle;\n color?: string;\n}) => {\n return (\n <Svg style={style} viewBox=\"0 0 24 24\">\n <G fill=\"none\" strokeWidth=\"1.5\" stroke={color}>\n <Path d=\"m18.636 15.67l1.716-5.15c1.5-4.498 2.25-6.747 1.062-7.934s-3.436-.438-7.935 1.062L8.33 5.364C4.7 6.574 2.885 7.18 2.37 8.067a2.72 2.72 0 0 0 0 2.73c.515.888 2.33 1.493 5.96 2.704c.584.194.875.291 1.119.454c.236.158.439.361.597.597c.163.244.26.535.454 1.118c1.21 3.63 1.816 5.446 2.703 5.962a2.72 2.72 0 0 0 2.731 0c.887-.516 1.492-2.331 2.703-5.962Z\"></Path>\n <Path\n strokeLinecap=\"round\"\n d=\"m17.79 6.21l-4.211 4.165\"\n opacity=\".5\"\n ></Path>\n </G>\n </Svg>\n );\n};\n"],"names":["PaperPlaneIcon","style","color","_jsx","Svg","viewBox","children","_jsxs","G","fill","strokeWidth","stroke","Path","d","strokeLinecap","opacity"],"mappings":"oGAIO,MAAMA,EAAiBA,EAC5BC,QACAC,WAMEC,EAACC,EAAG,CAACH,MAAOA,EAAOI,QAAQ,YAAWC,SACpCC,EAACC,EAAC,CAACC,KAAK,OAAOC,YAAY,MAAMC,OAAQT,EAAMI,SAAA,CAC7CH,EAACS,EAAI,CAACC,EAAE,kWACRV,EAACS,EAAI,CACHE,cAAc,QACdD,EAAE,2BACFE,QAAQ"}
@@ -0,0 +1,2 @@
1
+ import e,{Path as l}from"react-native-svg";import{jsx as o}from"react/jsx-runtime";const r=({style:r,color:t})=>o(e,{style:r,viewBox:"0 0 15 15",children:o(l,{fill:t,fillRule:"evenodd",d:"M6.05 2.75a.55.55 0 0 0-1.1 0v9.5a.55.55 0 0 0 1.1 0zm4 0a.55.55 0 0 0-1.1 0v9.5a.55.55 0 0 0 1.1 0z",clipRule:"evenodd"})});export{r as PauseIcon};
2
+ //# sourceMappingURL=PauseIcon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PauseIcon.js","sources":["../../../../src/assets/Icons/PauseIcon.tsx"],"sourcesContent":["import { ViewStyle } from \"react-native\";\nimport Svg, { Path } from \"react-native-svg\";\n\nexport const PauseIcon = ({\n style,\n color,\n}: {\n style?: ViewStyle;\n color?: string;\n}) => {\n return (\n <Svg style={style} viewBox=\"0 0 15 15\">\n <Path\n fill={color}\n fillRule=\"evenodd\"\n d=\"M6.05 2.75a.55.55 0 0 0-1.1 0v9.5a.55.55 0 0 0 1.1 0zm4 0a.55.55 0 0 0-1.1 0v9.5a.55.55 0 0 0 1.1 0z\"\n clipRule=\"evenodd\"\n ></Path>\n </Svg>\n );\n};\n"],"names":["PauseIcon","style","color","_jsx","Svg","viewBox","children","Path","fill","fillRule","d","clipRule"],"mappings":"mFAGO,MAAMA,EAAYA,EACvBC,QACAC,WAMEC,EAACC,EAAG,CAACH,MAAOA,EAAOI,QAAQ,YAAWC,SACpCH,EAACI,EAAI,CACHC,KAAMN,EACNO,SAAS,UACTC,EAAE,uGACFC,SAAS"}
@@ -0,0 +1,2 @@
1
+ import t,{Path as r}from"react-native-svg";import{jsx as e}from"react/jsx-runtime";const o=({style:o,color:l})=>e(t,{style:o,viewBox:"0 0 24 24",children:e(r,{fill:l,d:"M8 17.175V6.825q0-.425.3-.713t.7-.287q.125 0 .263.037t.262.113l8.15 5.175q.225.15.338.375t.112.475t-.112.475t-.338.375l-8.15 5.175q-.125.075-.262.113T9 18.175q-.4 0-.7-.288t-.3-.712"})});export{o as PlayIcon};
2
+ //# sourceMappingURL=PlayIcon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PlayIcon.js","sources":["../../../../src/assets/Icons/PlayIcon.tsx"],"sourcesContent":["import { ViewStyle } from \"react-native\";\n\nimport Svg, { Path } from \"react-native-svg\";\n\nexport const PlayIcon = ({\n style,\n color,\n}: {\n style?: ViewStyle;\n color?: string;\n}) => {\n return (\n <Svg style={style} viewBox=\"0 0 24 24\">\n <Path\n fill={color}\n d=\"M8 17.175V6.825q0-.425.3-.713t.7-.287q.125 0 .263.037t.262.113l8.15 5.175q.225.15.338.375t.112.475t-.112.475t-.338.375l-8.15 5.175q-.125.075-.262.113T9 18.175q-.4 0-.7-.288t-.3-.712\"\n ></Path>\n </Svg>\n );\n};\n"],"names":["PlayIcon","style","color","_jsx","Svg","viewBox","children","Path","fill","d"],"mappings":"mFAIO,MAAMA,EAAWA,EACtBC,QACAC,WAMEC,EAACC,EAAG,CAACH,MAAOA,EAAOI,QAAQ,YAAWC,SACpCH,EAACI,EAAI,CACHC,KAAMN,EACNO,EAAE"}
@@ -0,0 +1,2 @@
1
+ import{Svg as r,Line as e}from"react-native-svg";import t from"twrnc";import{jsxs as o,jsx as n}from"react/jsx-runtime";function i({style:i}){return o(r,{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:t.style("feather feather-x",i),children:[n(e,{x1:"18",y1:"6",x2:"6",y2:"18"}),n(e,{x1:"6",y1:"6",x2:"18",y2:"18"})]})}export{i as XIcon};
2
+ //# sourceMappingURL=XIcon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"XIcon.js","sources":["../../../../src/assets/Icons/XIcon.tsx"],"sourcesContent":["import { ViewStyle } from \"react-native\";\nimport { Line, Svg } from \"react-native-svg\";\nimport tw from \"twrnc\"; // assuming you're using twrnc for styling\n\nexport function XIcon({ style }: { style?: ViewStyle }) {\n return (\n <Svg\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={tw.style(\"feather feather-x\", style)} \n >\n <Line x1=\"18\" y1=\"6\" x2=\"6\" y2=\"18\"></Line>\n <Line x1=\"6\" y1=\"6\" x2=\"18\" y2=\"18\"></Line>\n </Svg>\n );\n}\n"],"names":["XIcon","style","_jsxs","Svg","viewBox","fill","stroke","strokeWidth","strokeLinecap","strokeLinejoin","tw","children","_jsx","Line","x1","y1","x2","y2"],"mappings":"wHAIO,SAASA,GAAMC,MAAEA,IACtB,OACEC,EAACC,EAAG,CACFC,QAAQ,YACRC,KAAK,OACLC,OAAO,eACPC,YAAY,IACZC,cAAc,QACdC,eAAe,QACfR,MAAOS,EAAGT,MAAM,oBAAqBA,GAAOU,SAAA,CAE5CC,EAACC,EAAI,CAACC,GAAG,KAAKC,GAAG,IAAIC,GAAG,IAAIC,GAAG,OAC/BL,EAACC,EAAI,CAACC,GAAG,IAAIC,GAAG,IAAIC,GAAG,KAAKC,GAAG,SAGrC"}
@@ -0,0 +1,2 @@
1
+ import e,{useState as t,useRef as o,useEffect as r}from"react";import{PanResponder as n,View as s,Pressable as a,Text as l}from"react-native";import i,{useSharedValue as u,withSpring as c,useAnimatedStyle as d}from"react-native-reanimated";import A from"react-native-sound";import m from"twrnc";import{PauseIcon as p}from"../../assets/Icons/PauseIcon.js";import{PlayIcon as y}from"../../assets/Icons/PlayIcon.js";import{useAudio as C}from"../../context/AudioContext.js";import{useChatContext as h}from"../../context/ChatContext.js";import{formatDuration as v}from"../../utils/datefunc.js";import{jsxs as f,jsx as g}from"react/jsx-runtime";const P={code:"function AudioPlayerTsx1(){const{knobPosition}=this.__closure;return{transform:[{translateX:knobPosition.value}]};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/AudioPlayer/AudioPlayer.tsx",sourceMap:'{"version":3,"names":["AudioPlayerTsx1","knobPosition","__closure","transform","translateX","value"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/AudioPlayer/AudioPlayer.tsx"],"mappings":"AAoIyC,SAAAA,eAAMA,CAAA,QAAAC,YAAA,OAAAC,SAAA,CAC3C,MAAO,CACLC,SAAS,CAAE,CAAC,CAAEC,UAAU,CAAEH,YAAY,CAACI,KAAM,CAAC,CAChD,CAAC,CACH","ignoreList":[]}',version:"3.16.7"},w=({audioUrl:e,audioId:w,isVideoPlaying:S})=>{const{theme:x,CustomPlayIcon:b,CustomPauseIcon:I}=h(),{currentlyPlayingId:_,setCurrentlyPlayingId:k}=C(),[M,N]=t(null),[R,D]=t(!1),[E,j]=t(0),[T,X]=t(0),[H,O]=t(!1),B=o(null),L=o(0),U=o(0),Y=o(0),K=u(0);r((()=>{let t=!0;const o=new A(e,"",(e=>{!e&&t&&X(o.getDuration())}));return N(o),()=>{t=!1,o&&(o.pause(),o.release())}}),[e]),r((()=>{_&&_!==w&&R&&M&&(M.pause(),D(!1),j(0),K.value=0)}),[_,w,R,M]),r((()=>{let e;return R&&M&&!H&&(e=setInterval((()=>{M.getCurrentTime((e=>{if("number"==typeof e&&!isNaN(e)&&(j(e),L.current>0&&T>0)){const t=e/T*L.current;isNaN(t)||(K.value=c(t,{damping:15,stiffness:100}))}}))}),100)),()=>{e&&clearInterval(e)}}),[R,M,H,T]);const V=n.create({onStartShouldSetPanResponder:()=>!0,onMoveShouldSetPanResponder:()=>!0,onPanResponderGrant:e=>{O(!0),Y.current=e.nativeEvent.pageX-K.value},onPanResponderMove:e=>{if(L.current>0){const t=e.nativeEvent.pageX-Y.current,o=Math.max(0,Math.min(t,L.current));K.value=o;const r=o/L.current*T;isNaN(r)||j(r)}},onPanResponderRelease:()=>{if(O(!1),M&&L.current>0){const e=K.value/L.current*T;isNaN(e)||M.setCurrentTime(e)}},onPanResponderTerminate:()=>{O(!1)}}),z=d(function(){const e=[new global.Error,-2,-27],t=function(){return{transform:[{translateX:K.value}]}};return t.__closure={knobPosition:K},t.__workletHash=1935336866997,t.__initData=P,t.__stackDetails=e,t}());return r((()=>{S&&R&&M&&M.pause((()=>{D(!1),k(null)}))}),[S]),f(s,{style:m`rounded-lg w-56`,children:[f(s,{style:m`flex-row items-center gap-2 px-2 pt-2`,children:[g(a,{onPress:()=>{M&&(R?M.pause((()=>{D(!1),k(null)})):(k(w),M.play((e=>{e&&(D(!1),j(0),K.value=c(0),k(null))})),D(!0)))},style:[m`bg-black/40 rounded-full p-2`,x?.messageStyle?.audioPlayButtonStyle],children:R?I?g(I,{}):g(p,{style:m.style("h-6 w-6"),color:x?.colors?.audioPauseIconColor||"white"}):b?g(b,{}):g(y,{style:m.style("h-6 w-6"),color:x?.colors?.audioPlayIconColor||"white"})}),f(s,{ref:B,onLayout:e=>{const{width:t}=e.nativeEvent.layout;L.current=t,B.current?.measure(((e,t,o,r,n)=>{U.current=n}))},style:[m`relative h-1 bg-zinc-400 rounded overflow-visible w-[75%]`,x?.messageStyle?.progressBarStyle],children:[g(s,{style:[m`absolute h-full bg-slate-200`,{width:(T>0?E/T*100:0)+"%"},x?.messageStyle?.activeProgressBarStyle]}),g(i.View,{...V.panHandlers,style:[z,{position:"absolute",top:-6,width:16,height:16,borderRadius:8,backgroundColor:"white",shadowColor:"#000",shadowOffset:{width:0,height:2},shadowOpacity:.25,shadowRadius:3.84,elevation:5},{...x?.messageStyle?.audioKnobStyle}]})]})]}),g(s,{style:m`px-4 py-1`,children:g(l,{style:[m`text-xs text-gray-500`,x?.messageStyle?.audioDurationStyle],children:isNaN(E)?"0:00":v(E)})})]})};var S=e.memo(w);export{S as default};
2
+ //# sourceMappingURL=AudioPlayer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AudioPlayer.js","sources":["../../../../src/components/AudioPlayer/AudioPlayer.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState } from 'react';\nimport { PanResponder, Pressable, Text, View } from 'react-native';\nimport Animated, {\n useAnimatedStyle,\n useSharedValue,\n withSpring,\n} from 'react-native-reanimated';\nimport Sound from 'react-native-sound';\nimport tw from 'twrnc';\nimport { PauseIcon } from '../../assets/Icons/PauseIcon';\nimport { PlayIcon } from '../../assets/Icons/PlayIcon';\nimport { useAudio } from '../../context/AudioContext';\nimport { useChatContext } from '../../context/ChatContext';\nimport { formatDuration } from '../../utils/datefunc';\nimport { AudioPlayerProps } from './types';\n\nconst AudioPlayer: React.FC<AudioPlayerProps> = ({\n audioUrl,\n audioId,\n isVideoPlaying,\n}) => {\n const { theme, CustomPlayIcon, CustomPauseIcon } = useChatContext();\n const { currentlyPlayingId, setCurrentlyPlayingId } = useAudio();\n const [sound, setSound] = useState<Sound | null>(null);\n const [isPlaying, setIsPlaying] = useState(false);\n const [currentTime, setCurrentTime] = useState(0);\n const [duration, setDuration] = useState(0);\n const [isDragging, setIsDragging] = useState(false);\n const progressRef = useRef<View>(null);\n const progressWidth = useRef(0);\n const progressX = useRef(0);\n const startX = useRef(0);\n const knobPosition = useSharedValue(0);\n\n // Initialize sound\n useEffect(() => {\n let mounted = true;\n const newSound = new Sound(audioUrl, '', (error) => {\n if (!error && mounted) {\n setDuration(newSound.getDuration());\n }\n });\n setSound(newSound);\n\n return () => {\n mounted = false;\n if (newSound) {\n newSound.pause();\n newSound.release();\n }\n };\n }, [audioUrl]);\n\n // Handle stopping playback when another audio starts\n useEffect(() => {\n if (\n currentlyPlayingId &&\n currentlyPlayingId !== audioId &&\n isPlaying &&\n sound\n ) {\n sound.pause();\n setIsPlaying(false);\n setCurrentTime(0);\n knobPosition.value = 0;\n }\n }, [currentlyPlayingId, audioId, isPlaying, sound]);\n\n // Update progress\n useEffect(() => {\n let interval: ReturnType<typeof setInterval>;\n if (isPlaying && sound && !isDragging) {\n interval = setInterval(() => {\n sound.getCurrentTime((seconds) => {\n if (typeof seconds === 'number' && !isNaN(seconds)) {\n setCurrentTime(seconds);\n if (progressWidth.current > 0 && duration > 0) {\n const progress = (seconds / duration) * progressWidth.current;\n if (!isNaN(progress)) {\n knobPosition.value = withSpring(progress, {\n damping: 15,\n stiffness: 100,\n });\n }\n }\n }\n });\n }, 100);\n }\n return () => {\n if (interval) clearInterval(interval);\n };\n }, [isPlaying, sound, isDragging, duration]);\n\n const panResponder = PanResponder.create({\n onStartShouldSetPanResponder: () => true,\n onMoveShouldSetPanResponder: () => true,\n onPanResponderGrant: (evt) => {\n setIsDragging(true);\n startX.current = evt.nativeEvent.pageX - knobPosition.value;\n },\n onPanResponderMove: (evt) => {\n if (progressWidth.current > 0) {\n const newPosition = evt.nativeEvent.pageX - startX.current;\n const boundedPosition = Math.max(\n 0,\n Math.min(newPosition, progressWidth.current)\n );\n knobPosition.value = boundedPosition;\n\n const percentage = boundedPosition / progressWidth.current;\n const newTime = percentage * duration;\n if (!isNaN(newTime)) {\n setCurrentTime(newTime);\n }\n }\n },\n onPanResponderRelease: () => {\n setIsDragging(false);\n if (sound && progressWidth.current > 0) {\n const percentage = knobPosition.value / progressWidth.current;\n const newTime = percentage * duration;\n if (!isNaN(newTime)) {\n sound.setCurrentTime(newTime);\n }\n }\n },\n onPanResponderTerminate: () => {\n setIsDragging(false);\n },\n });\n\n const animatedStyle = useAnimatedStyle(() => {\n return {\n transform: [{ translateX: knobPosition.value }],\n };\n });\n\n const togglePlay = () => {\n if (!sound) return;\n\n if (isPlaying) {\n sound.pause(() => {\n setIsPlaying(false);\n setCurrentlyPlayingId(null);\n });\n } else {\n setCurrentlyPlayingId(audioId);\n sound.play((success) => {\n if (success) {\n setIsPlaying(false);\n setCurrentTime(0);\n knobPosition.value = withSpring(0);\n setCurrentlyPlayingId(null);\n }\n });\n setIsPlaying(true);\n }\n };\n\n // Stop audio when video starts playing\n useEffect(() => {\n if (isVideoPlaying && isPlaying && sound) {\n sound.pause(() => {\n setIsPlaying(false);\n setCurrentlyPlayingId(null);\n });\n }\n }, [isVideoPlaying]);\n\n return (\n <View style={tw`rounded-lg w-56`}>\n <View style={tw`flex-row items-center gap-2 px-2 pt-2`}>\n <Pressable\n onPress={togglePlay}\n style={[\n tw`bg-black/40 rounded-full p-2`,\n theme?.messageStyle?.audioPlayButtonStyle,\n ]}\n >\n {isPlaying ? (\n CustomPauseIcon ? (\n <CustomPauseIcon />\n ) : (\n <PauseIcon\n style={tw.style('h-6 w-6')}\n color={theme?.colors?.audioPauseIconColor || 'white'}\n />\n )\n ) : CustomPlayIcon ? (\n <CustomPlayIcon />\n ) : (\n <PlayIcon\n style={tw.style('h-6 w-6')}\n color={theme?.colors?.audioPlayIconColor || 'white'}\n />\n )}\n </Pressable>\n\n <View\n ref={progressRef}\n onLayout={(e) => {\n const { width } = e.nativeEvent.layout;\n progressWidth.current = width;\n progressRef.current?.measure((_, __, ___, ____, pageX) => {\n progressX.current = pageX;\n });\n }}\n style={[\n tw`relative h-1 bg-zinc-400 rounded overflow-visible w-[75%]`,\n theme?.messageStyle?.progressBarStyle,\n ]}\n >\n <View\n style={[\n tw`absolute h-full bg-slate-200`,\n {\n width: `${duration > 0 ? (currentTime / duration) * 100 : 0}%`,\n },\n theme?.messageStyle?.activeProgressBarStyle,\n ]}\n />\n <Animated.View\n {...panResponder.panHandlers}\n style={[\n animatedStyle,\n {\n position: 'absolute',\n top: -6,\n width: 16,\n height: 16,\n borderRadius: 8,\n backgroundColor: 'white',\n shadowColor: '#000',\n shadowOffset: { width: 0, height: 2 },\n shadowOpacity: 0.25,\n shadowRadius: 3.84,\n elevation: 5,\n },\n { ...theme?.messageStyle?.audioKnobStyle },\n ]}\n />\n </View>\n </View>\n <View style={tw`px-4 py-1`}>\n <Text\n style={[\n tw`text-xs text-gray-500`,\n theme?.messageStyle?.audioDurationStyle,\n ]}\n >\n {!isNaN(currentTime) ? formatDuration(currentTime) : '0:00'}\n </Text>\n </View>\n </View>\n );\n};\n\nexport default React.memo(AudioPlayer);\n"],"names":["_worklet_1935336866997_init_data","code","location","sourceMap","version","AudioPlayer","audioUrl","audioId","isVideoPlaying","theme","CustomPlayIcon","CustomPauseIcon","useChatContext","currentlyPlayingId","setCurrentlyPlayingId","useAudio","sound","setSound","useState","isPlaying","setIsPlaying","currentTime","setCurrentTime","duration","setDuration","isDragging","setIsDragging","progressRef","useRef","progressWidth","progressX","startX","knobPosition","useSharedValue","useEffect","mounted","newSound","Sound","error","getDuration","pause","release","value","interval","setInterval","getCurrentTime","seconds","isNaN","current","progress","withSpring","damping","stiffness","clearInterval","panResponder","PanResponder","create","onStartShouldSetPanResponder","onMoveShouldSetPanResponder","onPanResponderGrant","evt","nativeEvent","pageX","onPanResponderMove","newPosition","boundedPosition","Math","max","min","newTime","onPanResponderRelease","onPanResponderTerminate","animatedStyle","useAnimatedStyle","_e","global","Error","AudioPlayerTsx1","transform","translateX","__closure","__workletHash","__initData","__stackDetails","_jsxs","View","style","tw","children","_jsx","Pressable","onPress","togglePlay","play","success","messageStyle","audioPlayButtonStyle","PauseIcon","color","colors","audioPauseIconColor","PlayIcon","audioPlayIconColor","ref","onLayout","e","width","layout","measure","_","__","___","____","progressBarStyle","activeProgressBarStyle","Animated","panHandlers","position","top","height","borderRadius","backgroundColor","shadowColor","shadowOffset","shadowOpacity","shadowRadius","elevation","audioKnobStyle","Text","audioDurationStyle","formatDuration","AudioPlayer$1","React","memo"],"mappings":"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"}
@@ -0,0 +1,2 @@
1
+ import e from"react";import{Pressable as t,View as r,Image as s,Text as o}from"react-native";import l from"twrnc";import{ArrowBack2RoundedIcon as a}from"../../assets/Icons/ArrowBack2RoundedIcon.js";import{useChatContext as i}from"../../context/ChatContext.js";import n from"./MessageContent.js";import d from"./MessageStatus.js";import{jsxs as m,jsx as u,Fragment as c}from"react/jsx-runtime";const b=({message:e,isCurrentUser:b,isFirstInSequence:g,onLongPress:f})=>{const{theme:h,showAvatars:y,showUserNames:p,showBubbleTail:x,setMediaUrl:v,setIsVideoPlaying:w,isVideoPlaying:S}=i();return m(t,{onLongPress:f,style:[l`px-2 my-1 max-w-[75%] relative`,b?l`self-end mr-3`:l`self-start ml-9`,g?b?l`bg-green-500 rounded-tr-none`:l`bg-white rounded-tl-none`:b?l`bg-green-500`:l`bg-white`,{borderRadius:8,...b?h?.bubbleStyle?.sent:h?.bubbleStyle?.received}],children:[!b&&g&&y&&m(c,{children:[u(r,{style:l`absolute w-6 h-6 rounded-full top-0 -left-9 flex-row items-center`,children:e.senderAvatar?u(s,{source:{uri:e.senderAvatar},style:[l`w-full h-full rounded-full`,h?.bubbleStyle?.avatarImageStyle],resizeMode:"cover"}):u(o,{style:[l`text-sm text-black font-semibold capitalize rounded-full bg-zinc-300 w-full h-full text-center pt-0.5`,h?.bubbleStyle?.avatarTextStyle],children:e.senderName?.charAt(0)})}),p&&e.senderName&&u(o,{style:[l`text-sm text-black font-semibold mt-1 capitalize`,h?.bubbleStyle?.userNameStyle],children:e.senderName})]}),g&&x&&u(a,{style:l.style("absolute -top-1 w-6 h-6",b?"-right-3.5":"-left-3.5 mt-[1.25px]",{transform:[{rotate:b?"90deg":"180deg"}]}),color:b?`${h?.colors?.sentMessageTailColor||"rgba(34, 197, 94,1)"}`:`${h?.colors?.receivedMessageTailColor||"white"}`}),u(n,{message:e,isCurrentUser:b,isFirstInSequence:g,onMediaPress:(e,t)=>{v({imageUrl:"image"===e?t:"",videoUrl:"video"===e?t:""}),"video"===e&&w(!0)},isVideoPlaying:S}),u(d,{time:e.time,status:b?e.status:void 0,isCurrentUser:b,hasText:!!e.text,hasAudio:!!e.audio})]})};var g=e.memo(b);export{g as default};
2
+ //# sourceMappingURL=ChatBubble.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChatBubble.js","sources":["../../../../src/components/ChatBubble/ChatBubble.tsx"],"sourcesContent":["import React from 'react';\nimport { Image, Pressable, Text, View } from 'react-native';\nimport tw from 'twrnc';\nimport { ArrowBack2RoundedIcon } from '../../assets/Icons/ArrowBack2RoundedIcon';\nimport { useChatContext } from '../../context/ChatContext';\nimport MessageContent from './MessageContent';\nimport MessageStatus from './MessageStatus';\nimport { ChatBubbleProps } from './types';\n\nconst ChatBubble: React.FC<ChatBubbleProps> = ({\n message,\n isCurrentUser,\n isFirstInSequence,\n onLongPress,\n}) => {\n const {\n theme,\n showAvatars,\n showUserNames,\n showBubbleTail,\n setMediaUrl,\n setIsVideoPlaying,\n isVideoPlaying,\n } = useChatContext();\n\n const handleMediaPress = (type: 'image' | 'video', url: string) => {\n setMediaUrl({\n imageUrl: type === 'image' ? url : '',\n videoUrl: type === 'video' ? url : '',\n });\n if (type === 'video') {\n setIsVideoPlaying(true);\n }\n };\n\n return (\n <Pressable\n onLongPress={onLongPress}\n style={[\n tw`px-2 my-1 max-w-[75%] relative`,\n isCurrentUser ? tw`self-end mr-3` : tw`self-start ml-9`,\n isFirstInSequence\n ? isCurrentUser\n ? tw`bg-green-500 rounded-tr-none`\n : tw`bg-white rounded-tl-none`\n : isCurrentUser\n ? tw`bg-green-500`\n : tw`bg-white`,\n {\n borderRadius: 8,\n ...(isCurrentUser\n ? theme?.bubbleStyle?.sent\n : theme?.bubbleStyle?.received),\n },\n ]}\n >\n {/* Avatar & Sender Name for Group Chat */}\n {!isCurrentUser && isFirstInSequence && showAvatars && (\n <>\n <View\n style={tw`absolute w-6 h-6 rounded-full top-0 -left-9 flex-row items-center`}\n >\n {message.senderAvatar ? (\n <Image\n source={{ uri: message.senderAvatar }}\n style={[\n tw`w-full h-full rounded-full`,\n theme?.bubbleStyle?.avatarImageStyle,\n ]}\n resizeMode=\"cover\"\n />\n ) : (\n <Text\n style={[\n tw`text-sm text-black font-semibold capitalize rounded-full bg-zinc-300 w-full h-full text-center pt-0.5`,\n theme?.bubbleStyle?.avatarTextStyle,\n ]}\n >\n {message.senderName?.charAt(0)}\n </Text>\n )}\n </View>\n {showUserNames && message.senderName && (\n <Text\n style={[\n tw`text-sm text-black font-semibold mt-1 capitalize`,\n theme?.bubbleStyle?.userNameStyle,\n ]}\n >\n {message.senderName}\n </Text>\n )}\n </>\n )}\n\n {/* Bubble Tail */}\n {isFirstInSequence && showBubbleTail && (\n <ArrowBack2RoundedIcon\n style={tw.style(\n 'absolute -top-1 w-6 h-6',\n isCurrentUser ? '-right-3.5' : '-left-3.5 mt-[1.25px]',\n {\n transform: [{ rotate: isCurrentUser ? '90deg' : '180deg' }],\n }\n )}\n color={\n isCurrentUser\n ? `${\n theme?.colors?.sentMessageTailColor || 'rgba(34, 197, 94,1)'\n }`\n : `${theme?.colors?.receivedMessageTailColor || 'white'}`\n }\n />\n )}\n\n {/* Message Content */}\n <MessageContent\n message={message}\n isCurrentUser={isCurrentUser}\n isFirstInSequence={isFirstInSequence}\n onMediaPress={handleMediaPress}\n isVideoPlaying={isVideoPlaying}\n />\n\n {/* Message Status */}\n <MessageStatus\n time={message.time}\n status={isCurrentUser ? message.status : undefined}\n isCurrentUser={isCurrentUser}\n hasText={!!message.text}\n hasAudio={!!message.audio}\n />\n </Pressable>\n );\n};\n\nexport default React.memo(ChatBubble);\n"],"names":["ChatBubble","message","isCurrentUser","isFirstInSequence","onLongPress","theme","showAvatars","showUserNames","showBubbleTail","setMediaUrl","setIsVideoPlaying","isVideoPlaying","useChatContext","_jsxs","Pressable","style","tw","borderRadius","bubbleStyle","sent","received","children","_Fragment","_jsx","View","senderAvatar","Image","source","uri","avatarImageStyle","resizeMode","Text","avatarTextStyle","senderName","charAt","userNameStyle","ArrowBack2RoundedIcon","transform","rotate","color","colors","sentMessageTailColor","receivedMessageTailColor","MessageContent","onMediaPress","handleMediaPress","type","url","imageUrl","videoUrl","MessageStatus","time","status","undefined","hasText","text","hasAudio","audio","ChatBubble$1","React","memo"],"mappings":"yYASA,MAAMA,EAAwCA,EAC5CC,UACAC,gBACAC,oBACAC,kBAEA,MAAMC,MACJA,EAAKC,YACLA,EAAWC,cACXA,EAAaC,eACbA,EAAcC,YACdA,EAAWC,kBACXA,EAAiBC,eACjBA,GACEC,IAYJ,OACEC,EAACC,EAAS,CACRV,YAAaA,EACbW,MAAO,CACLC,CAAE,iCACFd,EAAgBc,CAAE,gBAAkBA,CAAE,kBACtCb,EACID,EACEc,CAAE,+BACFA,CAAE,2BACJd,EACEc,CAAE,eACFA,CAAE,WACR,CACEC,aAAc,KACVf,EACAG,GAAOa,aAAaC,KACpBd,GAAOa,aAAaE,WAE1BC,SAAA,EAGAnB,GAAiBC,GAAqBG,GACtCO,EAAAS,EAAA,CAAAD,SAAA,CACEE,EAACC,EAAI,CACHT,MAAOC,CAAE,oEAAoEK,SAE5EpB,EAAQwB,aACPF,EAACG,EAAK,CACJC,OAAQ,CAAEC,IAAK3B,EAAQwB,cACvBV,MAAO,CACLC,CAAE,6BACFX,GAAOa,aAAaW,kBAEtBC,WAAW,UAGbP,EAACQ,EAAI,CACHhB,MAAO,CACLC,CAAE,wGACFX,GAAOa,aAAac,iBACpBX,SAEDpB,EAAQgC,YAAYC,OAAO,OAIjC3B,GAAiBN,EAAQgC,YACxBV,EAACQ,EAAI,CACHhB,MAAO,CACLC,CAAE,mDACFX,GAAOa,aAAaiB,eACpBd,SAEDpB,EAAQgC,gBAOhB9B,GAAqBK,GACpBe,EAACa,EAAqB,CACpBrB,MAAOC,EAAGD,MACR,0BACAb,EAAgB,aAAe,wBAC/B,CACEmC,UAAW,CAAC,CAAEC,OAAQpC,EAAgB,QAAU,aAGpDqC,MACErC,EACI,GACEG,GAAOmC,QAAQC,sBAAwB,wBAEzC,GAAGpC,GAAOmC,QAAQE,0BAA4B,YAMxDnB,EAACoB,EAAc,CACb1C,QAASA,EACTC,cAAeA,EACfC,kBAAmBA,EACnByC,aA/FmBC,CAACC,EAAyBC,KACjDtC,EAAY,CACVuC,SAAmB,UAATF,EAAmBC,EAAM,GACnCE,SAAmB,UAATH,EAAmBC,EAAM,KAExB,UAATD,GACFpC,GAAkB,EACpB,EAyFIC,eAAgBA,IAIlBY,EAAC2B,EAAa,CACZC,KAAMlD,EAAQkD,KACdC,OAAQlD,EAAgBD,EAAQmD,YAASC,EACzCnD,cAAeA,EACfoD,UAAWrD,EAAQsD,KACnBC,WAAYvD,EAAQwD,UAEZ,EAIhB,IAAAC,EAAeC,EAAMC,KAAK5D"}
@@ -0,0 +1,2 @@
1
+ import e from"react";import{View as t,Pressable as o,Image as r,Text as i}from"react-native";import s from"react-native-video";import l from"twrnc";import{LoadingIcon as a}from"../../assets/Icons/LoadingIcon.js";import{PlayIcon as d}from"../../assets/Icons/PlayIcon.js";import{useChatContext as n}from"../../context/ChatContext.js";import{formatDuration as u}from"../../utils/datefunc.js";import c from"../AudioPlayer/AudioPlayer.js";import{jsxs as m,jsx as y,Fragment as f}from"react/jsx-runtime";const h=({message:h,onMediaPress:b,isVideoPlaying:p})=>{const{theme:g,showMessageStatus:w,CustomPlayIcon:x,renderCustomVideoBubbleError:v}=n(),j=e.useRef(null),[P,I]=e.useState(0),[S,k]=e.useState(!1),[C,B]=e.useState(!1);return m(t,{children:[h.image&&y(o,{onPress:()=>b("image",h.image),style:l`w-60 h-80 my-2`,children:y(r,{source:{uri:h.image},style:l`w-full h-full object-contain rounded-lg`})}),h.video&&m(o,{onPress:()=>b("video",h.video),style:l`w-60 h-80 my-2 justify-center items-center`,disabled:S,children:[y(s,{source:{uri:h.video},ref:j,paused:!0,style:{width:"100%",height:"100%",borderRadius:8,position:"relative"},resizeMode:"cover",onLoadStart:()=>{k(!0),B(!1)},onLoad:e=>{I(e.duration),k(!1)},onBuffer:({isBuffering:e})=>k(e),onError:()=>{B(!0),k(!1)}}),S?y(t,{style:l`absolute inset-0 flex items-center justify-center bg-black/40 rounded-full`,children:y(a,{style:l.style("h-12 w-12 fill-white animate-spin")})}):C?v?v():y(t,{style:l`absolute inset-0 flex items-center justify-center bg-red-500/60 p-2`,children:y(i,{style:l`text-white font-bold`,children:"Failed to load video"})}):m(f,{children:[y(t,{style:l`absolute bg-black/40 rounded-full`,children:x?y(x,{}):y(d,{style:l.style("h-16 w-16"),color:g?.colors?.audioPlayIconColor||"white"})}),y(t,{style:l`absolute bottom-2 left-2 bg-black/50 px-2 py-1 rounded-md`,children:y(i,{style:l`text-white text-xs font-semibold`,children:u(P)})})]})]}),h.audio&&y(t,{style:l`my-2`,children:y(c,{audioUrl:h.audio,audioId:h.id,isVideoPlaying:p})}),h.text&&y(i,{style:[l`text-gray-800 pt-1`,w?l`pb-0`:l`pb-2`,{wordBreak:"break-word",overflowWrap:"break-word"},g?.messageStyle?.textStyle],children:h.text})]})};var b=e.memo(h);export{b as default};
2
+ //# sourceMappingURL=MessageContent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MessageContent.js","sources":["../../../../src/components/ChatBubble/MessageContent.tsx"],"sourcesContent":["import React from 'react';\nimport { Image, Pressable, Text, View } from 'react-native';\nimport Video, { VideoRef } from 'react-native-video';\nimport tw from 'twrnc';\nimport { LoadingIcon } from '../../assets/Icons/LoadingIcon';\nimport { PlayIcon } from '../../assets/Icons/PlayIcon';\nimport { useChatContext } from '../../context/ChatContext';\nimport { formatDuration } from '../../utils/datefunc';\nimport AudioPlayer from '../AudioPlayer/AudioPlayer';\nimport { MessageContentProps } from './types';\n\nconst MessageContent: React.FC<MessageContentProps> = ({\n message,\n onMediaPress,\n isVideoPlaying,\n}) => {\n const {\n theme,\n showMessageStatus,\n CustomPlayIcon,\n renderCustomVideoBubbleError,\n } = useChatContext();\n const videoRef = React.useRef<VideoRef>(null);\n const [duration, setDuration] = React.useState(0);\n const [videoIsLoading, setVideoIsLoading] = React.useState(false);\n const [videoHasError, setVideoHasError] = React.useState(false);\n\n return (\n <View>\n {message.image && (\n <Pressable\n onPress={() => onMediaPress('image', message.image as string)}\n style={tw`w-60 h-80 my-2`}\n >\n <Image\n source={{ uri: message.image }}\n style={tw`w-full h-full object-contain rounded-lg`}\n />\n </Pressable>\n )}\n\n {message.video && (\n <Pressable\n onPress={() => onMediaPress('video', message.video as string)}\n style={tw`w-60 h-80 my-2 justify-center items-center`}\n disabled={videoIsLoading}\n >\n <Video\n source={{ uri: message.video }}\n ref={videoRef}\n paused={true}\n style={{\n width: '100%',\n height: '100%',\n borderRadius: 8,\n position: 'relative',\n }}\n resizeMode=\"cover\"\n onLoadStart={() => {\n setVideoIsLoading(true);\n setVideoHasError(false);\n }}\n onLoad={(data) => {\n setDuration(data.duration);\n setVideoIsLoading(false);\n }}\n onBuffer={({ isBuffering }) => setVideoIsLoading(isBuffering)}\n onError={() => {\n setVideoHasError(true);\n setVideoIsLoading(false);\n }}\n />\n {videoIsLoading ? (\n <View\n style={tw`absolute inset-0 flex items-center justify-center bg-black/40 rounded-full`}\n >\n <LoadingIcon\n style={tw.style('h-12 w-12 fill-white animate-spin')}\n />\n </View>\n ) : videoHasError ? (\n renderCustomVideoBubbleError ? (\n renderCustomVideoBubbleError()\n ) : (\n <View\n style={tw`absolute inset-0 flex items-center justify-center bg-red-500/60 p-2`}\n >\n <Text style={tw`text-white font-bold`}>\n Failed to load video\n </Text>\n </View>\n )\n ) : (\n <>\n <View style={tw`absolute bg-black/40 rounded-full`}>\n {CustomPlayIcon ? (\n <CustomPlayIcon />\n ) : (\n <PlayIcon\n style={tw.style('h-16 w-16')}\n color={theme?.colors?.audioPlayIconColor || 'white'}\n />\n )}\n </View>\n <View\n style={tw`absolute bottom-2 left-2 bg-black/50 px-2 py-1 rounded-md`}\n >\n <Text style={tw`text-white text-xs font-semibold`}>\n {formatDuration(duration)}\n </Text>\n </View>\n </>\n )}\n </Pressable>\n )}\n\n {message.audio && (\n <View style={tw`my-2`}>\n <AudioPlayer\n audioUrl={message.audio}\n audioId={message.id}\n isVideoPlaying={isVideoPlaying as boolean}\n />\n </View>\n )}\n\n {message.text && (\n <Text\n style={[\n tw`text-gray-800 pt-1`,\n showMessageStatus ? tw`pb-0` : tw`pb-2`,\n { wordBreak: 'break-word', overflowWrap: 'break-word' },\n theme?.messageStyle?.textStyle,\n ]}\n >\n {message.text}\n </Text>\n )}\n </View>\n );\n};\n\nexport default React.memo(MessageContent);\n"],"names":["MessageContent","message","onMediaPress","isVideoPlaying","theme","showMessageStatus","CustomPlayIcon","renderCustomVideoBubbleError","useChatContext","videoRef","React","useRef","duration","setDuration","useState","videoIsLoading","setVideoIsLoading","videoHasError","setVideoHasError","_jsxs","View","children","image","_jsx","Pressable","onPress","style","tw","Image","source","uri","video","disabled","Video","ref","paused","width","height","borderRadius","position","resizeMode","onLoadStart","onLoad","data","onBuffer","isBuffering","onError","LoadingIcon","Text","_Fragment","PlayIcon","color","colors","audioPlayIconColor","formatDuration","audio","AudioPlayer","audioUrl","audioId","id","text","wordBreak","overflowWrap","messageStyle","textStyle","MessageContent$1","memo"],"mappings":"kfAWA,MAAMA,EAAgDA,EACpDC,UACAC,eACAC,qBAEA,MAAMC,MACJA,EAAKC,kBACLA,EAAiBC,eACjBA,EAAcC,6BACdA,GACEC,IACEC,EAAWC,EAAMC,OAAiB,OACjCC,EAAUC,GAAeH,EAAMI,SAAS,IACxCC,EAAgBC,GAAqBN,EAAMI,UAAS,IACpDG,EAAeC,GAAoBR,EAAMI,UAAS,GAEzD,OACEK,EAACC,EAAI,CAAAC,UACFpB,EAAQqB,OACPC,EAACC,EAAS,CACRC,QAASA,IAAMvB,EAAa,QAASD,EAAQqB,OAC7CI,MAAOC,CAAE,iBAAiBN,SAE1BE,EAACK,EAAK,CACJC,OAAQ,CAAEC,IAAK7B,EAAQqB,OACvBI,MAAOC,CAAE,8CAKd1B,EAAQ8B,OACPZ,EAACK,EAAS,CACRC,QAASA,IAAMvB,EAAa,QAASD,EAAQ8B,OAC7CL,MAAOC,CAAE,6CACTK,SAAUjB,EAAeM,SAAA,CAEzBE,EAACU,EAAK,CACJJ,OAAQ,CAAEC,IAAK7B,EAAQ8B,OACvBG,IAAKzB,EACL0B,QAAQ,EACRT,MAAO,CACLU,MAAO,OACPC,OAAQ,OACRC,aAAc,EACdC,SAAU,YAEZC,WAAW,QACXC,YAAaA,KACXzB,GAAkB,GAClBE,GAAiB,EAAM,EAEzBwB,OAASC,IACP9B,EAAY8B,EAAK/B,UACjBI,GAAkB,EAAM,EAE1B4B,SAAUA,EAAGC,iBAAkB7B,EAAkB6B,GACjDC,QAASA,KACP5B,GAAiB,GACjBF,GAAkB,EAAM,IAG3BD,EACCQ,EAACH,EAAI,CACHM,MAAOC,CAAE,6EAA6EN,SAEtFE,EAACwB,EAAW,CACVrB,MAAOC,EAAGD,MAAM,yCAGlBT,EACFV,EACEA,IAEAgB,EAACH,EAAI,CACHM,MAAOC,CAAE,sEAAsEN,SAE/EE,EAACyB,EAAI,CAACtB,MAAOC,CAAE,uBAAuBN,SAAC,2BAM3CF,EAAA8B,EAAA,CAAA5B,SAAA,CACEE,EAACH,EAAI,CAACM,MAAOC,CAAE,oCAAoCN,SAChDf,EACCiB,EAACjB,EAAc,CAAA,GAEfiB,EAAC2B,EAAQ,CACPxB,MAAOC,EAAGD,MAAM,aAChByB,MAAO/C,GAAOgD,QAAQC,oBAAsB,YAIlD9B,EAACH,EAAI,CACHM,MAAOC,CAAE,4DAA4DN,SAErEE,EAACyB,EAAI,CAACtB,MAAOC,CAAE,mCAAmCN,SAC/CiC,EAAe1C,aAQ3BX,EAAQsD,OACPhC,EAACH,EAAI,CAACM,MAAOC,CAAE,OAAON,SACpBE,EAACiC,EAAW,CACVC,SAAUxD,EAAQsD,MAClBG,QAASzD,EAAQ0D,GACjBxD,eAAgBA,MAKrBF,EAAQ2D,MACPrC,EAACyB,EAAI,CACHtB,MAAO,CACLC,CAAE,qBACFtB,EAAoBsB,CAAE,OAASA,CAAE,OACjC,CAAEkC,UAAW,aAAcC,aAAc,cACzC1D,GAAO2D,cAAcC,WACrB3C,SAEDpB,EAAQ2D,SAGR,EAIX,IAAAK,EAAevD,EAAMwD,KAAKlE"}
@@ -0,0 +1,2 @@
1
+ import t from"react";import{View as e,Text as s}from"react-native";import o from"twrnc";import{CheckAllIcon as r}from"../../assets/Icons/CheckAllIcon.js";import{CheckIcon as l}from"../../assets/Icons/CheckIcon.js";import{useChatContext as i}from"../../context/ChatContext.js";import{jsx as m,Fragment as c,jsxs as a}from"react/jsx-runtime";const n=({time:t,status:n,isCurrentUser:h,hasText:p,hasAudio:f})=>{const{theme:y,showMessageStatus:d}=i();return m(c,{children:d&&a(e,{style:[o`flex-row items-center`,p?o`justify-end pb-1 ml-4`:f?o`absolute right-3 bottom-3`:o`absolute right-3 bottom-4 bg-black/50 px-2 py-1 rounded-md`],children:[m(s,{style:[o`text-xs`,{color:p||f?y?.colors?.timestamp||"rgba(107, 114, 128, 0.7)":"white"}],children:t}),h&&a(e,{style:o`ml-1 flex-row items-center`,children:["sent"===n&&m(l,{style:o.style("fill-[#6B7280] h-4 w-4",{opacity:.7})}),"delivered"===n&&m(r,{style:o.style("fill-[#6B7280] h-4 w-4",{opacity:.7})}),"read"===n&&m(r,{style:o.style("fill-[#3B82F6] h-4 w-4",{opacity:.9})})]})]})})};var h=t.memo(n);export{h as default};
2
+ //# sourceMappingURL=MessageStatus.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MessageStatus.js","sources":["../../../../src/components/ChatBubble/MessageStatus.tsx"],"sourcesContent":["import React from 'react';\nimport { Text, View } from 'react-native';\nimport tw from 'twrnc';\nimport { CheckAllIcon } from '../../assets/Icons/CheckAllIcon';\nimport { CheckIcon } from '../../assets/Icons/CheckIcon';\nimport { useChatContext } from '../../context/ChatContext';\nimport { MessageStatusProps } from './types';\n\nconst MessageStatus: React.FC<MessageStatusProps> = ({\n time,\n status,\n isCurrentUser,\n hasText,\n hasAudio,\n}) => {\n const { theme, showMessageStatus } = useChatContext();\n return (\n <>\n {showMessageStatus && (\n <View\n style={[\n tw`flex-row items-center`,\n hasText\n ? tw`justify-end pb-1 ml-4`\n : hasAudio\n ? tw`absolute right-3 bottom-3`\n : tw`absolute right-3 bottom-4 bg-black/50 px-2 py-1 rounded-md`,\n ]}\n >\n <Text\n style={[\n tw`text-xs`,\n {\n color:\n hasText || hasAudio\n ? theme?.colors?.timestamp || 'rgba(107, 114, 128, 0.7)'\n : 'white',\n },\n ]}\n >\n {time}\n </Text>\n {isCurrentUser && (\n <View style={tw`ml-1 flex-row items-center`}>\n {status === 'sent' && (\n <CheckIcon\n style={tw.style('fill-[#6B7280] h-4 w-4', { opacity: 0.7 })}\n />\n )}\n {status === 'delivered' && (\n <CheckAllIcon\n style={tw.style('fill-[#6B7280] h-4 w-4', { opacity: 0.7 })}\n />\n )}\n {status === 'read' && (\n <CheckAllIcon\n style={tw.style('fill-[#3B82F6] h-4 w-4', { opacity: 0.9 })}\n />\n )}\n </View>\n )}\n </View>\n )}\n </>\n );\n};\n\nexport default React.memo(MessageStatus);\n"],"names":["MessageStatus","time","status","isCurrentUser","hasText","hasAudio","theme","showMessageStatus","useChatContext","_jsx","_Fragment","children","_jsxs","View","style","tw","Text","color","colors","timestamp","CheckIcon","opacity","CheckAllIcon","MessageStatus$1","React","memo"],"mappings":"oVAQA,MAAMA,EAA8CA,EAClDC,OACAC,SACAC,gBACAC,UACAC,eAEA,MAAMC,MAAEA,EAAKC,kBAAEA,GAAsBC,IACrC,OACEC,EAAAC,EAAA,CAAAC,SACGJ,GACCK,EAACC,EAAI,CACHC,MAAO,CACLC,CAAE,wBACFX,EACIW,CAAE,wBACFV,EACEU,CAAE,4BACFA,CAAE,8DACRJ,SAAA,CAEFF,EAACO,EAAI,CACHF,MAAO,CACLC,CAAE,UACF,CACEE,MACEb,GAAWC,EACPC,GAAOY,QAAQC,WAAa,2BAC5B,UAERR,SAEDV,IAEFE,GACCS,EAACC,EAAI,CAACC,MAAOC,CAAE,6BAA6BJ,UAC9B,SAAXT,GACCO,EAACW,EAAS,CACRN,MAAOC,EAAGD,MAAM,yBAA0B,CAAEO,QAAS,OAG7C,cAAXnB,GACCO,EAACa,EAAY,CACXR,MAAOC,EAAGD,MAAM,yBAA0B,CAAEO,QAAS,OAG7C,SAAXnB,GACCO,EAACa,EAAY,CACXR,MAAOC,EAAGD,MAAM,yBAA0B,CAAEO,QAAS,cAOhE,EAIP,IAAAE,EAAeC,EAAMC,KAAKzB"}
@@ -0,0 +1,2 @@
1
+ import{CameraIcon as e}from"../../assets/Icons/CameraIcon.js";import{EmojiFunnySquareIcon as o}from"../../assets/Icons/EmojiFunnySquareIcon.js";import{MicrophoneIcon as t}from"../../assets/Icons/MicrophoneIcon.js";import{PaperClipIcon as n}from"../../assets/Icons/PaperClipIcon.js";import{PaperPlaneIcon as s}from"../../assets/Icons/PaperPlaneIcon.js";import r,{useState as i,useCallback as l,useEffect as c}from"react";import{Platform as a,View as m,Pressable as h,TextInput as p}from"react-native";import{useChatContext as u}from"../../context/ChatContext.js";import d from"twrnc";import{jsxs as g,jsx as y}from"react/jsx-runtime";const C="ios"===a.OS?32:30,I=({onSendMessage:r,onTypingStart:I,onTypingEnd:x,onAttachmentPress:S,onCameraPress:f,onAudioRecordStart:w,onAudioRecordEnd:b,CustomEmojiIcon:j,CustomAttachmentIcon:M,CustomCameraIcon:P,CustomSendIcon:O,CustomMicrophoneIcon:A})=>{const[E,v]=i(""),[B,T]=i({height:C,isMultiline:!1}),{theme:R,currentUserId:z,showEmojiButton:H,showAttachmentsButton:V,showCameraButton:q,showVoiceRecordButton:F,placeholder:L}=u(),U=l((e=>{const o=Math.min(Math.max(e.nativeEvent.contentSize.height,C),118);T({height:o,isMultiline:o>C})}),[]),k=l((()=>{E.trim()&&(r({text:E.trim(),senderId:z}),v(""),T({height:C,isMultiline:!1}))}),[E,r,z]);return c((()=>{E.trim()?I?.():x?.()}),[E,I,x]),g(m,{style:[d`flex-row gap-2`,R?.inputStyles?.inputSectionContainerStyle],children:[g(m,{style:[d`flex-1 bg-white px-3.5 gap-1 flex-row justify-between`,B.isMultiline?d`rounded-3xl items-end`:d`rounded-full items-center`,R?.inputStyles?.inputContainerStyle],children:[H&&y(h,{children:j?y(j,{}):y(o,{style:d.style(""+("ios"===a.OS?"h-6 w-6":"w-7 h-7"),B.isMultiline?"pb-14":"pb-0"),color:R?.colors?.inputsIconsColor||"rgba(0,0,0,0.7)"})}),y(p,{value:E,onChangeText:v,placeholder:L||"Message",style:[d`bg-transparent flex-1 pl-2 my-3`,"ios"===a.OS?d`text-[17px]`:d`text-[16px]`,{minHeight:C,maxHeight:118}],placeholderTextColor:R?.colors?.placeholderTextColor||"rgba(0, 0, 0, 0.4)",multiline:!0,textAlignVertical:"center",onContentSizeChange:U}),g(m,{style:[d`gap-4 flex-row`,B.isMultiline?d`pb-4`:d`pb-0`],children:[V&&y(h,{onPress:S,children:M?y(M,{}):y(n,{style:d.style("ios"===a.OS?"h-6 w-6":"w-7 h-7"),color:R?.colors?.inputsIconsColor||"rgba(0,0,0,0.7)"})}),q&&!E.trim()&&y(h,{onPress:f,children:P?y(P,{}):y(e,{style:d.style("ios"===a.OS?"h-6 w-6":"w-7 h-7"),color:R?.colors?.inputsIconsColor||"rgba(0,0,0,0.7)"})})]})]}),y(h,{style:[d`p-2 rounded-full bg-green-600 justify-center items-center`,{height:"ios"===a.OS?50:48,width:"ios"===a.OS?50:48,...R?.inputStyles?.sendButtonStyle}],onPress:E.trim()?k:w,onLongPress:w,onPressOut:b,children:E.trim()?O?y(O,{}):y(s,{style:d.style("h-6 w-6"),color:R?.colors?.sendIconsColor||"rgba(255,255,255,0.7)"}):F?A?y(A,{}):y(t,{style:d.style("h-8 w-8"),color:R?.colors?.sendIconsColor||"rgba(255,255,255,0.7)"}):O?y(O,{}):y(s,{style:d.style("h-6 w-6"),color:R?.colors?.sendIconsColor||"rgba(255,255,255,0.7)"})})]})};var x=r.memo(I);export{x as default};
2
+ //# sourceMappingURL=ChatInput.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChatInput.js","sources":["../../../../src/components/ChatInput/ChatInput.tsx"],"sourcesContent":["import { CameraIcon } from \"../../assets/Icons/CameraIcon\";\nimport { EmojiFunnySquareIcon } from \"../../assets/Icons/EmojiFunnySquareIcon\";\nimport { MicrophoneIcon } from \"../../assets/Icons/MicrophoneIcon\";\nimport { PaperClipIcon } from \"../../assets/Icons/PaperClipIcon\";\nimport { PaperPlaneIcon } from \"../../assets/Icons/PaperPlaneIcon\";\nimport React, { useCallback, useEffect, useState } from \"react\";\nimport { Platform, Pressable, TextInput, View } from \"react-native\";\nimport { useChatContext } from \"../../context/ChatContext\";\nimport { ChatInputProps, InputHeightState } from \"./types\";\nimport tw from 'twrnc';\n\nconst MIN_INPUT_HEIGHT = Platform.OS === \"ios\" ? 32 : 30;\nconst MAX_INPUT_HEIGHT = 118;\n\nconst ChatInput: React.FC<ChatInputProps> = ({\n onSendMessage,\n onTypingStart,\n onTypingEnd,\n onAttachmentPress,\n onCameraPress,\n onAudioRecordStart,\n onAudioRecordEnd,\n CustomEmojiIcon,\n CustomAttachmentIcon,\n CustomCameraIcon,\n CustomSendIcon,\n CustomMicrophoneIcon,\n}) => {\n const [inputText, setInputText] = useState(\"\");\n const [inputHeight, setInputHeight] = useState<InputHeightState>({\n height: MIN_INPUT_HEIGHT,\n isMultiline: false,\n });\n const {\n theme,\n currentUserId,\n showEmojiButton,\n showAttachmentsButton,\n showCameraButton,\n showVoiceRecordButton,\n placeholder,\n } = useChatContext();\n\n const handleContentSizeChange = useCallback(\n (event: { nativeEvent: { contentSize: { height: number } } }) => {\n const newHeight = Math.min(\n Math.max(event.nativeEvent.contentSize.height, MIN_INPUT_HEIGHT),\n MAX_INPUT_HEIGHT\n );\n setInputHeight({\n height: newHeight,\n isMultiline: newHeight > MIN_INPUT_HEIGHT,\n });\n },\n []\n );\n\n const handleSendMessage = useCallback(() => {\n if (inputText.trim()) {\n onSendMessage({\n text: inputText.trim(),\n senderId: currentUserId,\n });\n setInputText(\"\");\n setInputHeight({ height: MIN_INPUT_HEIGHT, isMultiline: false });\n }\n }, [inputText, onSendMessage, currentUserId]);\n\n useEffect(() => {\n if (inputText.trim()) {\n onTypingStart?.();\n } else {\n onTypingEnd?.();\n }\n }, [inputText, onTypingStart, onTypingEnd]);\n\n return (\n <View\n style={[\n tw`flex-row gap-2`,\n theme?.inputStyles?.inputSectionContainerStyle,\n ]}\n >\n <View\n style={[\n tw`flex-1 bg-white px-3.5 gap-1 flex-row justify-between`,\n inputHeight.isMultiline\n ? tw`rounded-3xl items-end`\n : tw`rounded-full items-center`,\n theme?.inputStyles?.inputContainerStyle,\n ]}\n >\n {showEmojiButton && (\n <Pressable>\n {CustomEmojiIcon ? (\n <CustomEmojiIcon />\n ) : (\n <EmojiFunnySquareIcon\n style={tw.style(\n `${Platform.OS === 'ios' ? 'h-6 w-6' : 'w-7 h-7'}`,\n inputHeight.isMultiline ? 'pb-14' : 'pb-0'\n )}\n color={theme?.colors?.inputsIconsColor || 'rgba(0,0,0,0.7)'}\n />\n )}\n </Pressable>\n )}\n\n <TextInput\n value={inputText}\n onChangeText={setInputText}\n placeholder={placeholder || 'Message'}\n style={[\n tw`bg-transparent flex-1 pl-2 my-3`,\n Platform.OS === 'ios' ? tw`text-[17px]` : tw`text-[16px]`,\n { minHeight: MIN_INPUT_HEIGHT, maxHeight: MAX_INPUT_HEIGHT },\n ]}\n placeholderTextColor={\n theme?.colors?.placeholderTextColor || 'rgba(0, 0, 0, 0.4)'\n }\n multiline\n textAlignVertical=\"center\"\n onContentSizeChange={handleContentSizeChange}\n />\n\n <View\n style={[\n tw`gap-4 flex-row`,\n inputHeight.isMultiline ? tw`pb-4` : tw`pb-0`,\n ]}\n >\n {showAttachmentsButton && (\n <Pressable onPress={onAttachmentPress}>\n {CustomAttachmentIcon ? (\n <CustomAttachmentIcon />\n ) : (\n <PaperClipIcon\n style={tw.style(\n Platform.OS === 'ios' ? 'h-6 w-6' : 'w-7 h-7'\n )}\n color={theme?.colors?.inputsIconsColor || 'rgba(0,0,0,0.7)'}\n />\n )}\n </Pressable>\n )}\n {showCameraButton && !inputText.trim() && (\n <Pressable onPress={onCameraPress}>\n {CustomCameraIcon ? (\n <CustomCameraIcon />\n ) : (\n <CameraIcon\n style={tw.style(\n Platform.OS === 'ios' ? 'h-6 w-6' : 'w-7 h-7'\n )}\n color={theme?.colors?.inputsIconsColor || 'rgba(0,0,0,0.7)'}\n />\n )}\n </Pressable>\n )}\n </View>\n </View>\n\n <Pressable\n style={[\n tw`p-2 rounded-full bg-green-600 justify-center items-center`,\n {\n height: Platform.OS === 'ios' ? 50 : 48,\n width: Platform.OS === 'ios' ? 50 : 48,\n ...theme?.inputStyles?.sendButtonStyle,\n },\n ]}\n onPress={inputText.trim() ? handleSendMessage : onAudioRecordStart}\n onLongPress={onAudioRecordStart}\n onPressOut={onAudioRecordEnd}\n >\n {inputText.trim() ? (\n CustomSendIcon ? (\n <CustomSendIcon />\n ) : (\n <PaperPlaneIcon\n style={tw.style('h-6 w-6')}\n color={theme?.colors?.sendIconsColor || 'rgba(255,255,255,0.7)'}\n />\n )\n ) : showVoiceRecordButton ? (\n CustomMicrophoneIcon ? (\n <CustomMicrophoneIcon />\n ) : (\n <MicrophoneIcon\n style={tw.style('h-8 w-8')}\n color={theme?.colors?.sendIconsColor || 'rgba(255,255,255,0.7)'}\n />\n )\n ) : CustomSendIcon ? (\n <CustomSendIcon />\n ) : (\n <PaperPlaneIcon\n style={tw.style('h-6 w-6')}\n color={theme?.colors?.sendIconsColor || 'rgba(255,255,255,0.7)'}\n />\n )}\n </Pressable>\n </View>\n );\n};\n\nexport default React.memo(ChatInput);\n"],"names":["MIN_INPUT_HEIGHT","Platform","OS","ChatInput","onSendMessage","onTypingStart","onTypingEnd","onAttachmentPress","onCameraPress","onAudioRecordStart","onAudioRecordEnd","CustomEmojiIcon","CustomAttachmentIcon","CustomCameraIcon","CustomSendIcon","CustomMicrophoneIcon","inputText","setInputText","useState","inputHeight","setInputHeight","height","isMultiline","theme","currentUserId","showEmojiButton","showAttachmentsButton","showCameraButton","showVoiceRecordButton","placeholder","useChatContext","handleContentSizeChange","useCallback","event","newHeight","Math","min","max","nativeEvent","contentSize","handleSendMessage","trim","text","senderId","useEffect","_jsxs","View","style","tw","inputStyles","inputSectionContainerStyle","children","inputContainerStyle","_jsx","Pressable","EmojiFunnySquareIcon","color","colors","inputsIconsColor","TextInput","value","onChangeText","minHeight","maxHeight","placeholderTextColor","multiline","textAlignVertical","onContentSizeChange","onPress","PaperClipIcon","CameraIcon","width","sendButtonStyle","onLongPress","onPressOut","PaperPlaneIcon","sendIconsColor","MicrophoneIcon","ChatInput$1","React","memo"],"mappings":"ynBAWA,MAAMA,EAAmC,QAAhBC,EAASC,GAAe,GAAK,GAGhDC,EAAsCA,EAC1CC,gBACAC,gBACAC,cACAC,oBACAC,gBACAC,qBACAC,mBACAC,kBACAC,uBACAC,mBACAC,iBACAC,2BAEA,MAAOC,EAAWC,GAAgBC,EAAS,KACpCC,EAAaC,GAAkBF,EAA2B,CAC/DG,OAAQrB,EACRsB,aAAa,KAETC,MACJA,EAAKC,cACLA,EAAaC,gBACbA,EAAeC,sBACfA,EAAqBC,iBACrBA,EAAgBC,sBAChBA,EAAqBC,YACrBA,GACEC,IAEEC,EAA0BC,GAC7BC,IACC,MAAMC,EAAYC,KAAKC,IACrBD,KAAKE,IAAIJ,EAAMK,YAAYC,YAAYlB,OAAQrB,GAlC9B,KAqCnBoB,EAAe,CACbC,OAAQa,EACRZ,YAAaY,EAAYlC,GACzB,GAEJ,IAGIwC,EAAoBR,GAAY,KAChChB,EAAUyB,SACZrC,EAAc,CACZsC,KAAM1B,EAAUyB,OAChBE,SAAUnB,IAEZP,EAAa,IACbG,EAAe,CAAEC,OAAQrB,EAAkBsB,aAAa,IAC1D,GACC,CAACN,EAAWZ,EAAeoB,IAU9B,OARAoB,GAAU,KACJ5B,EAAUyB,OACZpC,MAEAC,KACF,GACC,CAACU,EAAWX,EAAeC,IAG5BuC,EAACC,EAAI,CACHC,MAAO,CACLC,CAAE,iBACFzB,GAAO0B,aAAaC,4BACpBC,SAAA,CAEFN,EAACC,EAAI,CACHC,MAAO,CACLC,CAAE,wDACF7B,EAAYG,YACR0B,CAAE,wBACFA,CAAE,4BACNzB,GAAO0B,aAAaG,qBACpBD,SAED1B,CAAAA,GACC4B,EAACC,EAAS,CAAAH,SACPxC,EACC0C,EAAC1C,EAAe,CAAA,GAEhB0C,EAACE,EAAoB,CACnBR,MAAOC,EAAGD,MACR,IAAmB,QAAhB9C,EAASC,GAAe,UAAY,WACvCiB,EAAYG,YAAc,QAAU,QAEtCkC,MAAOjC,GAAOkC,QAAQC,kBAAoB,sBAMlDL,EAACM,EAAS,CACRC,MAAO5C,EACP6C,aAAc5C,EACdY,YAAaA,GAAe,UAC5BkB,MAAO,CACLC,CAAE,kCACc,QAAhB/C,EAASC,GAAe8C,CAAE,cAAgBA,CAAE,cAC5C,CAAEc,UAAW9D,EAAkB+D,UAvGlB,MAyGfC,qBACEzC,GAAOkC,QAAQO,sBAAwB,qBAEzCC,WAAS,EACTC,kBAAkB,SAClBC,oBAAqBpC,IAGvBc,EAACC,EAAI,CACHC,MAAO,CACLC,CAAE,iBACF7B,EAAYG,YAAc0B,CAAE,OAASA,CAAE,QACvCG,SAEDzB,CAAAA,GACC2B,EAACC,EAAS,CAACc,QAAS7D,EAAkB4C,SACnCvC,EACCyC,EAACzC,EAAoB,CAAA,GAErByC,EAACgB,EAAa,CACZtB,MAAOC,EAAGD,MACQ,QAAhB9C,EAASC,GAAe,UAAY,WAEtCsD,MAAOjC,GAAOkC,QAAQC,kBAAoB,sBAKjD/B,IAAqBX,EAAUyB,QAC9BY,EAACC,EAAS,CAACc,QAAS5D,EAAc2C,SAC/BtC,EACCwC,EAACxC,EAAgB,CAAA,GAEjBwC,EAACiB,EAAU,CACTvB,MAAOC,EAAGD,MACQ,QAAhB9C,EAASC,GAAe,UAAY,WAEtCsD,MAAOjC,GAAOkC,QAAQC,kBAAoB,4BAQtDL,EAACC,EAAS,CACRP,MAAO,CACLC,CAAE,4DACF,CACE3B,OAAwB,QAAhBpB,EAASC,GAAe,GAAK,GACrCqE,MAAuB,QAAhBtE,EAASC,GAAe,GAAK,MACjCqB,GAAO0B,aAAauB,kBAG3BJ,QAASpD,EAAUyB,OAASD,EAAoB/B,EAChDgE,YAAahE,EACbiE,WAAYhE,EAAiByC,SAE5BnC,EAAUyB,OACT3B,EACEuC,EAACvC,EAAc,CAAE,GAEjBuC,EAACsB,EAAc,CACb5B,MAAOC,EAAGD,MAAM,WAChBS,MAAOjC,GAAOkC,QAAQmB,gBAAkB,0BAG1ChD,EACFb,EACEsC,EAACtC,EAAsB,IAEvBsC,EAACwB,EAAc,CACb9B,MAAOC,EAAGD,MAAM,WAChBS,MAAOjC,GAAOkC,QAAQmB,gBAAkB,0BAG1C9D,EACFuC,EAACvC,EAAc,CAAA,GAEfuC,EAACsB,EAAc,CACb5B,MAAOC,EAAGD,MAAM,WAChBS,MAAOjC,GAAOkC,QAAQmB,gBAAkB,8BAIzC,EAIX,IAAAE,EAAeC,EAAMC,KAAK7E"}
@@ -0,0 +1,2 @@
1
+ import{LoadingIcon as e}from"../../assets/Icons/LoadingIcon.js";import{XIcon as t}from"../../assets/Icons/XIcon.js";import r,{useRef as o,useState as i}from"react";import{Modal as n,View as l,Pressable as s,Text as a}from"react-native";import c from"react-native-image-zoom-viewer";import d from"react-native-video";import m from"twrnc";import{jsx as u,jsxs as f,Fragment as h}from"react/jsx-runtime";const b=({imageUrl:r,videoUrl:b,onClose:p})=>{const g=o(null),[y,v]=i(!1),[w,x]=i(!1);return r||b?u(n,{visible:!!r||!!b,transparent:!0,children:f(l,{style:m`top-0 bottom-0 left-0 right-0 bg-black/80 flex-1 absolute`,children:[u(s,{onPress:p,style:m`absolute right-4 top-4 p-2 rounded-full bg-slate-100/70 z-10`,children:u(t,{style:m`h-8 w-8 stroke-black`})}),r&&u(c,{imageUrls:[{url:r}],enableSwipeDown:!0,onSwipeDown:p,backgroundColor:"rgba(0,0,0,0.8)",enableImageZoom:!0,onSave:()=>r,renderIndicator:()=>u(h,{})}),b&&f(l,{style:m`justify-center items-center`,children:[u(d,{source:{uri:b},ref:g,shutterColor:"transparent",controls:!0,style:{width:"100%",height:"100%",borderRadius:8,position:"relative",marginHorizontal:48},controlsStyles:{hideSettingButton:!1,hideNext:!0,hidePrevious:!0},resizeMode:"contain",onLoadStart:()=>{v(!0),x(!1)},onLoad:()=>v(!1),onBuffer:({isBuffering:e})=>v(e),onError:()=>{x(!0),v(!1)}}),y&&u(l,{style:m`absolute inset-0 flex items-center justify-center bg-black/40 rounded-full`,children:u(e,{style:m.style("h-12 w-12 fill-white animate-spin")})}),w&&u(l,{style:m`absolute inset-0 flex items-center justify-center bg-red-500/60 p-2`,children:u(a,{style:m`text-white font-bold`,children:"Failed to load video"})})]})]})}):null};var p=r.memo(b);export{p as default};
2
+ //# sourceMappingURL=MediaViewer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MediaViewer.js","sources":["../../../../src/components/MediaViewer/MediaViewer.tsx"],"sourcesContent":["import { LoadingIcon } from '../../assets/Icons/LoadingIcon';\nimport { XIcon } from '../../assets/Icons/XIcon';\nimport React, { useRef, useState } from 'react';\nimport { Modal, Pressable, Text, View } from 'react-native';\nimport ImageViewer from 'react-native-image-zoom-viewer';\nimport Video, { VideoRef } from 'react-native-video';\nimport tw from 'twrnc';\nimport { MediaViewerProps } from './types';\n\nconst MediaViewer: React.FC<MediaViewerProps> = ({\n imageUrl,\n videoUrl,\n onClose,\n}) => {\n const videoRef = useRef<VideoRef>(null);\n const [videoIsLoading, setVideoIsLoading] = useState(false);\n const [videoHasError, setVideoHasError] = useState(false);\n\n if (!imageUrl && !videoUrl) return null;\n\n return (\n <Modal visible={!!imageUrl || !!videoUrl} transparent={true}>\n <View\n style={tw`top-0 bottom-0 left-0 right-0 bg-black/80 flex-1 absolute`}\n >\n <Pressable\n onPress={onClose}\n style={tw`absolute right-4 top-4 p-2 rounded-full bg-slate-100/70 z-10`}\n >\n <XIcon style={tw`h-8 w-8 stroke-black`} />\n </Pressable>\n\n {imageUrl && (\n <ImageViewer\n imageUrls={[{ url: imageUrl }]}\n enableSwipeDown\n onSwipeDown={onClose}\n backgroundColor=\"rgba(0,0,0,0.8)\"\n enableImageZoom\n onSave={() => imageUrl}\n renderIndicator={() => <></>}\n />\n )}\n\n {videoUrl && (\n <View style={tw`justify-center items-center`}>\n <Video\n source={{ uri: videoUrl }}\n ref={videoRef}\n shutterColor=\"transparent\"\n controls={true}\n style={{\n width: '100%',\n height: '100%',\n borderRadius: 8,\n position: 'relative',\n marginHorizontal: 48,\n }}\n controlsStyles={{\n hideSettingButton: false,\n hideNext: true,\n hidePrevious: true,\n }}\n resizeMode=\"contain\"\n onLoadStart={() => {\n setVideoIsLoading(true);\n setVideoHasError(false);\n }}\n onLoad={() => setVideoIsLoading(false)}\n onBuffer={({ isBuffering }) => setVideoIsLoading(isBuffering)}\n onError={() => {\n setVideoHasError(true);\n setVideoIsLoading(false);\n }}\n />\n {videoIsLoading && (\n <View\n style={tw`absolute inset-0 flex items-center justify-center bg-black/40 rounded-full`}\n >\n <LoadingIcon\n style={tw.style('h-12 w-12 fill-white animate-spin')}\n />\n </View>\n )}\n {videoHasError && (\n <View\n style={tw`absolute inset-0 flex items-center justify-center bg-red-500/60 p-2`}\n >\n <Text style={tw`text-white font-bold`}>\n Failed to load video\n </Text>\n </View>\n )}\n </View>\n )}\n </View>\n </Modal>\n );\n};\n\nexport default React.memo(MediaViewer);\n"],"names":["MediaViewer","imageUrl","videoUrl","onClose","videoRef","useRef","videoIsLoading","setVideoIsLoading","useState","videoHasError","setVideoHasError","_jsx","Modal","visible","transparent","children","_jsxs","View","style","tw","Pressable","onPress","XIcon","ImageViewer","imageUrls","url","enableSwipeDown","onSwipeDown","backgroundColor","enableImageZoom","onSave","renderIndicator","_Fragment","Video","source","uri","ref","shutterColor","controls","width","height","borderRadius","position","marginHorizontal","controlsStyles","hideSettingButton","hideNext","hidePrevious","resizeMode","onLoadStart","onLoad","onBuffer","isBuffering","onError","LoadingIcon","Text","MediaViewer$1","React","memo"],"mappings":"iZASA,MAAMA,EAA0CA,EAC9CC,WACAC,WACAC,cAEA,MAAMC,EAAWC,EAAiB,OAC3BC,EAAgBC,GAAqBC,GAAS,IAC9CC,EAAeC,GAAoBF,GAAS,GAEnD,OAAKP,GAAaC,EAGhBS,EAACC,EAAK,CAACC,UAAWZ,KAAcC,EAAUY,aAAa,EAAKC,SAC1DC,EAACC,EAAI,CACHC,MAAOC,CAAE,4DAA4DJ,SAAA,CAErEJ,EAACS,EAAS,CACRC,QAASlB,EACTe,MAAOC,CAAE,+DAA+DJ,SAExEJ,EAACW,EAAK,CAACJ,MAAOC,CAAE,2BAGjBlB,GACCU,EAACY,EAAW,CACVC,UAAW,CAAC,CAAEC,IAAKxB,IACnByB,iBAAe,EACfC,YAAaxB,EACbyB,gBAAgB,kBAChBC,iBAAe,EACfC,OAAQA,IAAM7B,EACd8B,gBAAiBA,IAAMpB,EAAAqB,EAAI,CAAA,KAI9B9B,GACCc,EAACC,EAAI,CAACC,MAAOC,CAAE,8BAA8BJ,SAAA,CAC3CJ,EAACsB,EAAK,CACJC,OAAQ,CAAEC,IAAKjC,GACfkC,IAAKhC,EACLiC,aAAa,cACbC,UAAU,EACVpB,MAAO,CACLqB,MAAO,OACPC,OAAQ,OACRC,aAAc,EACdC,SAAU,WACVC,iBAAkB,IAEpBC,eAAgB,CACdC,mBAAmB,EACnBC,UAAU,EACVC,cAAc,GAEhBC,WAAW,UACXC,YAAaA,KACX1C,GAAkB,GAClBG,GAAiB,EAAM,EAEzBwC,OAAQA,IAAM3C,GAAkB,GAChC4C,SAAUA,EAAGC,iBAAkB7C,EAAkB6C,GACjDC,QAASA,KACP3C,GAAiB,GACjBH,GAAkB,EAAM,IAG3BD,GACCK,EAACM,EAAI,CACHC,MAAOC,CAAE,6EAA6EJ,SAEtFJ,EAAC2C,EAAW,CACVpC,MAAOC,EAAGD,MAAM,yCAIrBT,GACCE,EAACM,EAAI,CACHC,MAAOC,CAAE,sEAAsEJ,SAE/EJ,EAAC4C,EAAI,CAACrC,MAAOC,CAAE,uBAAuBJ,SAAC,mCAtElB,IA8EzB,EAIZ,IAAAyC,EAAeC,EAAMC,KAAK1D"}
@@ -0,0 +1,2 @@
1
+ import{View as e,Image as t,Text as l}from"react-native";import r from"twrnc";import{ArrowBack2RoundedIcon as n}from"../../assets/Icons/ArrowBack2RoundedIcon.js";import{useChatContext as i}from"../../context/ChatContext.js";import{jsxs as o,jsx as s}from"react/jsx-runtime";const a=({typingUsers:a,currentUserId:c})=>{const{theme:d,showAvatars:y,renderCustomTyping:u,showBubbleTail:m}=i(),f=a.filter((e=>e.id!==c));if(!f.length)return null;const h=f.slice(0,2),b=f.length-2;return o(e,{style:r`my-1 max-w-[75%] self-start flex-row`,children:[y&&o(e,{style:r`flex-row`,children:[h.map(((n,i)=>s(e,{style:[r`bg-gray-400 w-6 h-6 rounded-full items-center`,{marginLeft:i>0?-10:0,zIndex:h.length+i}],children:n.avatar?s(t,{source:{uri:n.avatar},style:[r`w-full h-full object-cover rounded-full`,d?.bubbleStyle?.avatarImageStyle]}):s(l,{style:[r`text-sm text-black font-semibold capitalize rounded-full bg-zinc-300 w-full h-full text-center pt-0.5`,d?.bubbleStyle?.avatarTextStyle],children:n.name?.charAt(0)})},n.id))),b>0&&s(e,{style:[r`bg-gray-400 w-6 h-6 rounded-full items-center justify-center`,{marginLeft:-10,zIndex:3},{...d?.bubbleStyle?.additionalTypingUsersContainerStyle}],children:o(l,{style:[r`text-white text-xs font-semibold`,d?.bubbleStyle?.additionalTypingUsersTextStyle],children:["+",b]})})]}),m&&s(n,{style:r.style("w-6 h-6 fill-white mt-[1.25px]",{transform:[{rotate:"180deg"},{translateX:6}]}),color:`${d?.colors?.receivedMessageTailColor||"white"}`}),s(e,{style:[r`px-2 my-1 bg-white rounded-tl-none rounded-lg`,d?.bubbleStyle?.typingContainerStyle],children:u?u():s(e,{style:r`flex-row items-center py-3 px-2 justify-center`,children:s(l,{style:r`text-gray-600`,children:"Typing..."})})})]})};export{a as TypingIndicator};
2
+ //# sourceMappingURL=TypingIndicator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TypingIndicator.js","sources":["../../../../src/components/TypingComponent/TypingIndicator.tsx"],"sourcesContent":["import { Image, Text, View } from 'react-native';\nimport tw from 'twrnc';\nimport { ArrowBack2RoundedIcon } from '../../assets/Icons/ArrowBack2RoundedIcon';\nimport { useChatContext } from '../../context/ChatContext';\n\nexport interface TypingUser {\n id: string;\n avatar: string;\n name: string;\n}\n\ninterface TypingIndicatorProps {\n typingUsers: TypingUser[];\n currentUserId: string;\n}\n\nexport const TypingIndicator = ({\n typingUsers,\n currentUserId,\n}: TypingIndicatorProps) => {\n const { theme, showAvatars, renderCustomTyping, showBubbleTail } =\n useChatContext();\n\n const otherTypingUsers = typingUsers.filter(\n (user) => user.id !== currentUserId\n );\n\n if (!otherTypingUsers.length) return null;\n\n const displayedUsers = otherTypingUsers.slice(0, 2);\n const additionalUsers = otherTypingUsers.length - 2;\n\n return (\n <View style={tw`my-1 max-w-[75%] self-start flex-row`}>\n {showAvatars && (\n <View style={tw`flex-row`}>\n {displayedUsers.map((user, index) => (\n <View\n key={user.id}\n style={[\n tw`bg-gray-400 w-6 h-6 rounded-full items-center`,\n {\n marginLeft: index > 0 ? -10 : 0,\n zIndex: displayedUsers.length + index,\n },\n ]}\n >\n {user.avatar ? (\n <Image\n source={{ uri: user.avatar }}\n style={[\n tw`w-full h-full object-cover rounded-full`,\n theme?.bubbleStyle?.avatarImageStyle,\n ]}\n />\n ) : (\n <Text\n style={[\n tw`text-sm text-black font-semibold capitalize rounded-full bg-zinc-300 w-full h-full text-center pt-0.5`,\n theme?.bubbleStyle?.avatarTextStyle,\n ]}\n >\n {user.name?.charAt(0)}\n </Text>\n )}\n </View>\n ))}\n {additionalUsers > 0 && (\n <View\n style={[\n tw`bg-gray-400 w-6 h-6 rounded-full items-center justify-center`,\n {\n marginLeft: -10,\n zIndex: 3,\n },\n { ...theme?.bubbleStyle?.additionalTypingUsersContainerStyle },\n ]}\n >\n <Text\n style={[\n tw`text-white text-xs font-semibold`,\n theme?.bubbleStyle?.additionalTypingUsersTextStyle,\n ]}\n >\n +{additionalUsers}\n </Text>\n </View>\n )}\n </View>\n )}\n {showBubbleTail && (\n <ArrowBack2RoundedIcon\n style={tw.style(\n 'w-6 h-6 fill-white mt-[1.25px]', \n {\n transform: [{ rotate: '180deg' }, { translateX: 6 }],\n }\n )}\n color={`${theme?.colors?.receivedMessageTailColor || 'white'}`}\n />\n )}\n\n <View\n style={[\n tw`px-2 my-1 bg-white rounded-tl-none rounded-lg`,\n theme?.bubbleStyle?.typingContainerStyle,\n ]}\n >\n {renderCustomTyping ? (\n renderCustomTyping()\n ) : (\n <View style={tw`flex-row items-center py-3 px-2 justify-center`}>\n <Text style={tw`text-gray-600`}>Typing...</Text>\n </View>\n )}\n </View>\n </View>\n );\n};\n"],"names":["TypingIndicator","typingUsers","currentUserId","theme","showAvatars","renderCustomTyping","showBubbleTail","useChatContext","otherTypingUsers","filter","user","id","length","displayedUsers","slice","additionalUsers","_jsxs","View","style","tw","children","map","index","_jsx","marginLeft","zIndex","avatar","Image","source","uri","bubbleStyle","avatarImageStyle","Text","avatarTextStyle","name","charAt","additionalTypingUsersContainerStyle","additionalTypingUsersTextStyle","ArrowBack2RoundedIcon","transform","rotate","translateX","color","colors","receivedMessageTailColor","typingContainerStyle"],"mappings":"kRAgBO,MAAMA,EAAkBA,EAC7BC,cACAC,oBAEA,MAAMC,MAAEA,EAAKC,YAAEA,EAAWC,mBAAEA,EAAkBC,eAAEA,GAC9CC,IAEIC,EAAmBP,EAAYQ,QAClCC,GAASA,EAAKC,KAAOT,IAGxB,IAAKM,EAAiBI,OAAQ,OAAO,KAErC,MAAMC,EAAiBL,EAAiBM,MAAM,EAAG,GAC3CC,EAAkBP,EAAiBI,OAAS,EAElD,OACEI,EAACC,EAAI,CAACC,MAAOC,CAAE,uCAAuCC,SACnDhB,CAAAA,GACCY,EAACC,EAAI,CAACC,MAAOC,CAAE,WAAWC,SACvBP,CAAAA,EAAeQ,KAAI,CAACX,EAAMY,IACzBC,EAACN,EAAI,CAEHC,MAAO,CACLC,CAAE,gDACF,CACEK,WAAYF,EAAQ,GAAI,GAAM,EAC9BG,OAAQZ,EAAeD,OAASU,IAElCF,SAEDV,EAAKgB,OACJH,EAACI,EAAK,CACJC,OAAQ,CAAEC,IAAKnB,EAAKgB,QACpBR,MAAO,CACLC,CAAE,0CACFhB,GAAO2B,aAAaC,oBAIxBR,EAACS,EAAI,CACHd,MAAO,CACLC,CAAE,wGACFhB,GAAO2B,aAAaG,iBACpBb,SAEDV,EAAKwB,MAAMC,OAAO,MAxBlBzB,EAAKC,MA6BbI,EAAkB,GACjBQ,EAACN,EAAI,CACHC,MAAO,CACLC,CAAE,+DACF,CACEK,YAAe,GACfC,OAAQ,GAEV,IAAKtB,GAAO2B,aAAaM,sCACzBhB,SAEFJ,EAACgB,EAAI,CACHd,MAAO,CACLC,CAAE,mCACFhB,GAAO2B,aAAaO,gCACpBjB,SAAA,CACH,IACGL,UAMXT,GACCiB,EAACe,EAAqB,CACpBpB,MAAOC,EAAGD,MACR,iCACA,CACEqB,UAAW,CAAC,CAAEC,OAAQ,UAAY,CAAEC,WAAY,MAGpDC,MAAO,GAAGvC,GAAOwC,QAAQC,0BAA4B,YAIzDrB,EAACN,EAAI,CACHC,MAAO,CACLC,CAAE,gDACFhB,GAAO2B,aAAae,sBACpBzB,SAEDf,EACCA,IAEAkB,EAACN,EAAI,CAACC,MAAOC,CAAE,iDAAiDC,SAC9DG,EAACS,EAAI,CAACd,MAAOC,CAAE,gBAAgBC,SAAC,oBAIjC"}
@@ -0,0 +1,2 @@
1
+ import{useState as r,createContext as e,useContext as t}from"react";import{jsx as n}from"react/jsx-runtime";const i=e(void 0),o=({children:e})=>{const[t,o]=r(null);return n(i.Provider,{value:{currentlyPlayingId:t,setCurrentlyPlayingId:o},children:e})},u=()=>{const r=t(i);if(!r)throw new Error("useAudio must be used within an AudioProvider");return r};export{o as AudioProvider,u as useAudio};
2
+ //# sourceMappingURL=AudioContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AudioContext.js","sources":["../../../src/context/AudioContext.tsx"],"sourcesContent":["import React, { createContext, useContext, useState } from \"react\";\n\ninterface AudioContextType {\n currentlyPlayingId: string | null;\n setCurrentlyPlayingId: (id: string | null) => void;\n}\n\nconst AudioContext = createContext<AudioContextType | undefined>(undefined);\n\nexport const AudioProvider: React.FC<{ children: React.ReactNode }> = ({\n children,\n}) => {\n const [currentlyPlayingId, setCurrentlyPlayingId] = useState<string | null>(\n null\n );\n\n return (\n <AudioContext.Provider value={{ currentlyPlayingId, setCurrentlyPlayingId }}>\n {children}\n </AudioContext.Provider>\n );\n};\n\nexport const useAudio = () => {\n const context = useContext(AudioContext);\n if (!context) {\n throw new Error(\"useAudio must be used within an AudioProvider\");\n }\n return context;\n};"],"names":["AudioContext","createContext","undefined","AudioProvider","children","currentlyPlayingId","setCurrentlyPlayingId","useState","_jsx","Provider","value","useAudio","context","useContext","Error"],"mappings":"4GAOA,MAAMA,EAAeC,OAA4CC,GAEpDC,EAAyDA,EACpEC,eAEA,MAAOC,EAAoBC,GAAyBC,EAClD,MAGF,OACEC,EAACR,EAAaS,SAAQ,CAACC,MAAO,CAAEL,qBAAoBC,yBAAwBF,SACzEA,GACqB,EAIfO,EAAWA,KACtB,MAAMC,EAAUC,EAAWb,GAC3B,IAAKY,EACH,MAAM,IAAIE,MAAM,iDAElB,OAAOF,CAAO"}
@@ -0,0 +1,2 @@
1
+ import{useState as r,createContext as e,useContext as i}from"react";import{jsx as t}from"react/jsx-runtime";const o=e(void 0),n=({children:e,...i})=>{const[n,a]=r({imageUrl:"",videoUrl:""}),[d,s]=r(!1);return t(o.Provider,{value:{...i,mediaUrl:n,setMediaUrl:a,isVideoPlaying:d,setIsVideoPlaying:s},children:e})},a=()=>{const r=i(o);if(!r)throw new Error("useChatContext must be used within a ChatProvider");return r};export{n as ChatProvider,a as useChatContext};
2
+ //# sourceMappingURL=ChatContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChatContext.js","sources":["../../../src/context/ChatContext.tsx"],"sourcesContent":["import React, { createContext, useContext, useState } from \"react\";\nimport { ChatScreenProps } from \"../types\";\n\ninterface ChatContextType extends ChatScreenProps {\n mediaUrl: { imageUrl: string; videoUrl: string };\n setMediaUrl: (url: { imageUrl: string; videoUrl: string }) => void;\n isVideoPlaying: boolean;\n setIsVideoPlaying: (playing: boolean) => void;\n}\n\nconst ChatContext = createContext<ChatContextType | undefined>(undefined);\n\nexport const ChatProvider: React.FC<\n ChatScreenProps & { children: React.ReactNode }\n> = ({ children, ...props }) => {\n const [mediaUrl, setMediaUrl] = useState({ imageUrl: \"\", videoUrl: \"\" });\n const [isVideoPlaying, setIsVideoPlaying] = useState(false);\n\n return (\n <ChatContext.Provider\n value={{\n ...props,\n mediaUrl,\n setMediaUrl,\n isVideoPlaying,\n setIsVideoPlaying,\n }}\n >\n {children}\n </ChatContext.Provider>\n );\n};\n\nexport const useChatContext = () => {\n const context = useContext(ChatContext);\n if (!context) {\n throw new Error(\"useChatContext must be used within a ChatProvider\");\n }\n return context;\n};\n"],"names":["ChatContext","createContext","undefined","ChatProvider","children","props","mediaUrl","setMediaUrl","useState","imageUrl","videoUrl","isVideoPlaying","setIsVideoPlaying","_jsx","Provider","value","useChatContext","context","useContext","Error"],"mappings":"4GAUA,MAAMA,EAAcC,OAA2CC,GAElDC,EAETA,EAAGC,cAAaC,MAClB,MAAOC,EAAUC,GAAeC,EAAS,CAAEC,SAAU,GAAIC,SAAU,MAC5DC,EAAgBC,GAAqBJ,GAAS,GAErD,OACEK,EAACb,EAAYc,SAAQ,CACnBC,MAAO,IACFV,EACHC,WACAC,cACAI,iBACAC,qBACAR,SAEDA,GACoB,EAIdY,EAAiBA,KAC5B,MAAMC,EAAUC,EAAWlB,GAC3B,IAAKiB,EACH,MAAM,IAAIE,MAAM,qDAElB,OAAOF,CAAO"}
@@ -0,0 +1,2 @@
1
+ import"react";import{View as e,FlatList as o}from"react-native";import n from"twrnc";import t from"./components/ChatBubble/ChatBubble.js";import r from"./components/ChatInput/ChatInput.js";import s from"./components/MediaViewer/MediaViewer.js";import{TypingIndicator as i}from"./components/TypingComponent/TypingIndicator.js";import{AudioProvider as m}from"./context/AudioContext.js";import{ChatProvider as a,useChatContext as d}from"./context/ChatContext.js";import{jsx as c,jsxs as p}from"react/jsx-runtime";const u=()=>{const{messages:m,currentUserId:a,onMessageLongPress:u,mediaUrl:C,setMediaUrl:l,setIsVideoPlaying:I,typingUsers:g,onSendMessage:h,onTypingStart:U,onTypingEnd:f,onAttachmentPress:y,onAudioRecordEnd:x,onAudioRecordStart:S,onCameraPress:j,renderCustomInput:A,CustomEmojiIcon:M,CustomAttachmentIcon:E,CustomCameraIcon:P,CustomMicrophoneIcon:v,CustomSendIcon:T}=d();return p(e,{style:n`flex-1 px-2 pb-4 gap-2 relative`,children:[c(o,{data:m,keyExtractor:e=>e.id,renderItem:({item:e,index:o})=>c(t,{message:e,isCurrentUser:e.senderId===a,onLongPress:()=>u?.(e),isFirstInSequence:o===m.length-1||m[o+1]?.senderId!==e.senderId}),ListHeaderComponent:c(i,{typingUsers:g||[],currentUserId:a}),showsVerticalScrollIndicator:!1,inverted:!0}),A?A():c(r,{onSendMessage:h,onTypingStart:U,onTypingEnd:f,onAttachmentPress:y,onAudioRecordEnd:x,onAudioRecordStart:S,onCameraPress:j,CustomEmojiIcon:M,CustomAttachmentIcon:E,CustomCameraIcon:P,CustomMicrophoneIcon:v,CustomSendIcon:T}),c(s,{imageUrl:C.imageUrl,videoUrl:C.videoUrl,onClose:()=>{l({imageUrl:"",videoUrl:""}),I(!1)}})]})},C=e=>c(m,{children:c(a,{...e,children:c(u,{})})});export{C as default};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../src/index.tsx"],"sourcesContent":["import React from 'react';\nimport { FlatList, View } from 'react-native';\nimport tw from 'twrnc';\nimport ChatBubble from './components/ChatBubble/ChatBubble';\nimport ChatInput from './components/ChatInput/ChatInput';\nimport MediaViewer from './components/MediaViewer/MediaViewer';\nimport { TypingIndicator } from './components/TypingComponent/TypingIndicator';\nimport { AudioProvider } from './context/AudioContext';\nimport { ChatProvider, useChatContext } from './context/ChatContext';\nimport { ChatScreenProps } from './types';\n\nconst ChatScreenContent = () => {\n const {\n messages,\n currentUserId,\n onMessageLongPress,\n mediaUrl,\n setMediaUrl,\n setIsVideoPlaying,\n typingUsers,\n onSendMessage,\n onTypingStart,\n onTypingEnd,\n onAttachmentPress,\n onAudioRecordEnd,\n onAudioRecordStart,\n onCameraPress,\n renderCustomInput,\n CustomEmojiIcon,\n CustomAttachmentIcon,\n CustomCameraIcon,\n CustomMicrophoneIcon,\n CustomSendIcon,\n } = useChatContext();\n\n return (\n <View style={tw`flex-1 px-2 pb-4 gap-2 relative`}>\n <FlatList\n data={messages}\n keyExtractor={(item) => item.id}\n renderItem={({ item, index }) => (\n <ChatBubble\n message={item}\n isCurrentUser={item.senderId === currentUserId}\n onLongPress={() => onMessageLongPress?.(item)}\n isFirstInSequence={\n index === messages.length - 1 ||\n messages[index + 1]?.senderId !== item.senderId\n }\n />\n )}\n ListHeaderComponent={\n <TypingIndicator\n typingUsers={typingUsers || []}\n currentUserId={currentUserId}\n />\n }\n showsVerticalScrollIndicator={false}\n inverted\n />\n\n {renderCustomInput ? (\n renderCustomInput()\n ) : (\n <ChatInput\n onSendMessage={onSendMessage}\n onTypingStart={onTypingStart}\n onTypingEnd={onTypingEnd}\n onAttachmentPress={onAttachmentPress}\n onAudioRecordEnd={onAudioRecordEnd}\n onAudioRecordStart={onAudioRecordStart}\n onCameraPress={onCameraPress}\n CustomEmojiIcon={CustomEmojiIcon}\n CustomAttachmentIcon={CustomAttachmentIcon}\n CustomCameraIcon={CustomCameraIcon}\n CustomMicrophoneIcon={CustomMicrophoneIcon}\n CustomSendIcon={CustomSendIcon}\n />\n )}\n\n <MediaViewer\n imageUrl={mediaUrl.imageUrl}\n videoUrl={mediaUrl.videoUrl}\n onClose={() => {\n setMediaUrl({ imageUrl: '', videoUrl: '' });\n setIsVideoPlaying(false);\n }}\n />\n </View>\n );\n};\n\nconst ChatScreen: React.FC<ChatScreenProps> = (props) => {\n return (\n <AudioProvider>\n <ChatProvider {...props}>\n <ChatScreenContent />\n </ChatProvider>\n </AudioProvider>\n );\n};\n\nexport default ChatScreen;\n"],"names":["ChatScreenContent","messages","currentUserId","onMessageLongPress","mediaUrl","setMediaUrl","setIsVideoPlaying","typingUsers","onSendMessage","onTypingStart","onTypingEnd","onAttachmentPress","onAudioRecordEnd","onAudioRecordStart","onCameraPress","renderCustomInput","CustomEmojiIcon","CustomAttachmentIcon","CustomCameraIcon","CustomMicrophoneIcon","CustomSendIcon","useChatContext","_jsxs","View","style","tw","children","_jsx","FlatList","data","keyExtractor","item","id","renderItem","index","ChatBubble","message","isCurrentUser","senderId","onLongPress","isFirstInSequence","length","ListHeaderComponent","TypingIndicator","showsVerticalScrollIndicator","inverted","ChatInput","MediaViewer","imageUrl","videoUrl","onClose","ChatScreen","props","AudioProvider","ChatProvider"],"mappings":"8fAWA,MAAMA,EAAoBA,KACxB,MAAMC,SACJA,EAAQC,cACRA,EAAaC,mBACbA,EAAkBC,SAClBA,EAAQC,YACRA,EAAWC,kBACXA,EAAiBC,YACjBA,EAAWC,cACXA,EAAaC,cACbA,EAAaC,YACbA,EAAWC,kBACXA,EAAiBC,iBACjBA,EAAgBC,mBAChBA,EAAkBC,cAClBA,EAAaC,kBACbA,EAAiBC,gBACjBA,EAAeC,qBACfA,EAAoBC,iBACpBA,EAAgBC,qBAChBA,EAAoBC,eACpBA,GACEC,IAEJ,OACEC,EAACC,EAAI,CAACC,MAAOC,CAAE,kCAAkCC,SAAA,CAC/CC,EAACC,EAAQ,CACPC,KAAM5B,EACN6B,aAAeC,GAASA,EAAKC,GAC7BC,WAAYA,EAAGF,OAAMG,WACnBP,EAACQ,EAAU,CACTC,QAASL,EACTM,cAAeN,EAAKO,WAAapC,EACjCqC,YAAaA,IAAMpC,IAAqB4B,GACxCS,kBACEN,IAAUjC,EAASwC,OAAS,GAC5BxC,EAASiC,EAAQ,IAAII,WAAaP,EAAKO,WAI7CI,oBACEf,EAACgB,EAAe,CACdpC,YAAaA,GAAe,GAC5BL,cAAeA,IAGnB0C,8BAA8B,EAC9BC,UAAQ,IAGT9B,EACCA,IAEAY,EAACmB,EAAS,CACRtC,cAAeA,EACfC,cAAeA,EACfC,YAAaA,EACbC,kBAAmBA,EACnBC,iBAAkBA,EAClBC,mBAAoBA,EACpBC,cAAeA,EACfE,gBAAiBA,EACjBC,qBAAsBA,EACtBC,iBAAkBA,EAClBC,qBAAsBA,EACtBC,eAAgBA,IAIpBO,EAACoB,EAAW,CACVC,SAAU5C,EAAS4C,SACnBC,SAAU7C,EAAS6C,SACnBC,QAASA,KACP7C,EAAY,CAAE2C,SAAU,GAAIC,SAAU,KACtC3C,GAAkB,EAAM,MAGvB,EAIL6C,EAAyCC,GAE3CzB,EAAC0B,EAAa,CAAA3B,SACZC,EAAC2B,EAAY,IAAKF,EAAK1B,SACrBC,EAAC3B,EAAmB,CAAA"}
@@ -0,0 +1,2 @@
1
+ const o=o=>{const t=Math.floor(o/60),r=Math.floor(o%60);return`${t}:${r<10?"0":""}${r}`};export{o as formatDuration};
2
+ //# sourceMappingURL=datefunc.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"datefunc.js","sources":["../../../src/utils/datefunc.ts"],"sourcesContent":[" export const formatDuration = (time: number) => {\n const minutes = Math.floor(time / 60);\n const seconds = Math.floor(time % 60);\n return `${minutes}:${seconds < 10 ? \"0\" : \"\"}${seconds}`;\n };"],"names":["formatDuration","time","minutes","Math","floor","seconds"],"mappings":"AAAcA,MAAAA,EAAkBC,IAC5B,MAAMC,EAAUC,KAAKC,MAAMH,EAAO,IAC5BI,EAAUF,KAAKC,MAAMH,EAAO,IAClC,MAAO,GAAGC,KAAWG,EAAU,GAAK,IAAM,KAAKA,GAAS"}
@@ -0,0 +1,5 @@
1
+ import { ViewStyle } from "react-native";
2
+ export declare const ArrowBack2RoundedIcon: ({ style, color, }: {
3
+ style?: ViewStyle;
4
+ color?: string;
5
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { ViewStyle } from "react-native";
2
+ export declare const CameraIcon: ({ style, color }: {
3
+ style?: ViewStyle;
4
+ color?: string;
5
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,4 @@
1
+ import { ViewStyle } from "react-native";
2
+ export declare const CheckAllIcon: ({ style }: {
3
+ style?: ViewStyle;
4
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,4 @@
1
+ import { ViewStyle } from "react-native";
2
+ export declare const CheckIcon: ({ style }: {
3
+ style?: ViewStyle;
4
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { ViewStyle } from "react-native";
2
+ export declare const EmojiFunnySquareIcon: ({ style, color }: {
3
+ style?: ViewStyle;
4
+ color?: string;
5
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,4 @@
1
+ import { ViewStyle } from "react-native";
2
+ export declare const LoadingIcon: ({ style }: {
3
+ style?: ViewStyle;
4
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { ViewStyle } from "react-native";
2
+ export declare const MicrophoneIcon: ({ style, color, }: {
3
+ style?: ViewStyle;
4
+ color?: string;
5
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { ViewStyle } from "react-native";
2
+ export declare const PaperClipIcon: ({ style, color, }: {
3
+ style?: ViewStyle;
4
+ color?: string;
5
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { ViewStyle } from "react-native";
2
+ export declare const PaperPlaneIcon: ({ style, color, }: {
3
+ style?: ViewStyle;
4
+ color?: string;
5
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { ViewStyle } from "react-native";
2
+ export declare const PauseIcon: ({ style, color, }: {
3
+ style?: ViewStyle;
4
+ color?: string;
5
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { ViewStyle } from "react-native";
2
+ export declare const PlayIcon: ({ style, color, }: {
3
+ style?: ViewStyle;
4
+ color?: string;
5
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,4 @@
1
+ import { ViewStyle } from "react-native";
2
+ export declare function XIcon({ style }: {
3
+ style?: ViewStyle;
4
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { AudioPlayerProps } from './types';
3
+ declare const _default: React.NamedExoticComponent<AudioPlayerProps>;
4
+ export default _default;