@abihealth/goapp-react-native 1.13.4

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 (282) hide show
  1. package/CHANGELOG.md +157 -0
  2. package/README.md +3 -0
  3. package/dist/common/animations/Animation.d.ts +10 -0
  4. package/dist/common/animations/Animation.js +38 -0
  5. package/dist/common/animations/FindingAnimation/index.d.ts +2 -0
  6. package/dist/common/animations/FindingAnimation/index.js +20 -0
  7. package/dist/common/animations/FindingAnimation/xml.d.ts +2 -0
  8. package/dist/common/animations/FindingAnimation/xml.js +7 -0
  9. package/dist/common/animations/HorizontalLoadingAnimation/index.d.ts +5 -0
  10. package/dist/common/animations/HorizontalLoadingAnimation/index.js +14 -0
  11. package/dist/common/animations/HorizontalLoadingAnimation/xml.d.ts +1 -0
  12. package/dist/common/animations/HorizontalLoadingAnimation/xml.js +5 -0
  13. package/dist/common/animations/LoadingCircleAnimation/index.d.ts +2 -0
  14. package/dist/common/animations/LoadingCircleAnimation/index.js +24 -0
  15. package/dist/common/animations/LoadingCircleAnimation/xml.d.ts +2 -0
  16. package/dist/common/animations/LoadingCircleAnimation/xml.js +5 -0
  17. package/dist/common/animations/LoadingDotsAnimation/index.d.ts +6 -0
  18. package/dist/common/animations/LoadingDotsAnimation/index.js +17 -0
  19. package/dist/common/animations/LoadingDotsAnimation/xml.d.ts +1 -0
  20. package/dist/common/animations/LoadingDotsAnimation/xml.js +5 -0
  21. package/dist/common/animations/LoadingHeart.d.ts +2 -0
  22. package/dist/common/animations/LoadingHeart.js +92 -0
  23. package/dist/common/api/auth.d.ts +2 -0
  24. package/dist/common/api/auth.js +18 -0
  25. package/dist/common/api/config.d.ts +7 -0
  26. package/dist/common/api/config.js +15 -0
  27. package/dist/common/api/consultation.d.ts +6 -0
  28. package/dist/common/api/consultation.js +80 -0
  29. package/dist/common/api/models/auth.d.ts +8 -0
  30. package/dist/common/api/models/auth.js +2 -0
  31. package/dist/common/api/models/consultation.d.ts +70 -0
  32. package/dist/common/api/models/consultation.js +23 -0
  33. package/dist/common/api/models/region.d.ts +1 -0
  34. package/dist/common/api/models/region.js +2 -0
  35. package/dist/common/api/models/user.d.ts +5 -0
  36. package/dist/common/api/models/user.js +2 -0
  37. package/dist/common/api/models/websocket.d.ts +6 -0
  38. package/dist/common/api/models/websocket.js +2 -0
  39. package/dist/common/api/user.d.ts +2 -0
  40. package/dist/common/api/user.js +10 -0
  41. package/dist/common/api/websocket.d.ts +6 -0
  42. package/dist/common/api/websocket.js +66 -0
  43. package/dist/common/assets/background-pattern.png +0 -0
  44. package/dist/common/components/ActionSheet.d.ts +6 -0
  45. package/dist/common/components/ActionSheet.js +43 -0
  46. package/dist/common/components/AnswerScreen/Card.d.ts +8 -0
  47. package/dist/common/components/AnswerScreen/Card.js +76 -0
  48. package/dist/common/components/AnswerScreen/CloseConsultationActionSheet.d.ts +2 -0
  49. package/dist/common/components/AnswerScreen/CloseConsultationActionSheet.js +109 -0
  50. package/dist/common/components/AnswerScreen/DeliveryAddressCard.d.ts +5 -0
  51. package/dist/common/components/AnswerScreen/DeliveryAddressCard.js +39 -0
  52. package/dist/common/components/AnswerScreen/PrescriptionCard/PrescriptionCardHeader.d.ts +5 -0
  53. package/dist/common/components/AnswerScreen/PrescriptionCard/PrescriptionCardHeader.js +79 -0
  54. package/dist/common/components/AnswerScreen/PrescriptionCard/index.d.ts +5 -0
  55. package/dist/common/components/AnswerScreen/PrescriptionCard/index.js +46 -0
  56. package/dist/common/components/AnswerScreen/Summary.d.ts +5 -0
  57. package/dist/common/components/AnswerScreen/Summary.js +49 -0
  58. package/dist/common/components/BackgroundPattern.d.ts +2 -0
  59. package/dist/common/components/BackgroundPattern.js +19 -0
  60. package/dist/common/components/Button.d.ts +14 -0
  61. package/dist/common/components/Button.js +124 -0
  62. package/dist/common/components/CancelConsultationButton.d.ts +2 -0
  63. package/dist/common/components/CancelConsultationButton.js +107 -0
  64. package/dist/common/components/Card.d.ts +2 -0
  65. package/dist/common/components/Card.js +13 -0
  66. package/dist/common/components/Checkbox.d.ts +7 -0
  67. package/dist/common/components/Checkbox.js +75 -0
  68. package/dist/common/components/DateInput.d.ts +8 -0
  69. package/dist/common/components/DateInput.js +76 -0
  70. package/dist/common/components/DoctorProfileCard.d.ts +8 -0
  71. package/dist/common/components/DoctorProfileCard.js +128 -0
  72. package/dist/common/components/FadeIn.d.ts +8 -0
  73. package/dist/common/components/FadeIn.js +66 -0
  74. package/dist/common/components/FormControl.d.ts +8 -0
  75. package/dist/common/components/FormControl.js +40 -0
  76. package/dist/common/components/FormWrapper.d.ts +11 -0
  77. package/dist/common/components/FormWrapper.js +46 -0
  78. package/dist/common/components/Header.d.ts +10 -0
  79. package/dist/common/components/Header.js +109 -0
  80. package/dist/common/components/Input.d.ts +8 -0
  81. package/dist/common/components/Input.js +74 -0
  82. package/dist/common/components/Modal/AttachmentPreviewModal.d.ts +9 -0
  83. package/dist/common/components/Modal/AttachmentPreviewModal.js +68 -0
  84. package/dist/common/components/Modal/CancelModal.d.ts +9 -0
  85. package/dist/common/components/Modal/CancelModal.js +16 -0
  86. package/dist/common/components/Modal/CloseConsultationModal.d.ts +9 -0
  87. package/dist/common/components/Modal/CloseConsultationModal.js +16 -0
  88. package/dist/common/components/Modal/DoctorProfileModal.d.ts +8 -0
  89. package/dist/common/components/Modal/DoctorProfileModal.js +47 -0
  90. package/dist/common/components/Modal/ModalHeader.d.ts +7 -0
  91. package/dist/common/components/Modal/ModalHeader.js +40 -0
  92. package/dist/common/components/Modal/TwoOptionsModal.d.ts +14 -0
  93. package/dist/common/components/Modal/TwoOptionsModal.js +58 -0
  94. package/dist/common/components/Modal/index.d.ts +7 -0
  95. package/dist/common/components/Modal/index.js +57 -0
  96. package/dist/common/components/PhoneInput.d.ts +11 -0
  97. package/dist/common/components/PhoneInput.js +81 -0
  98. package/dist/common/components/Reminder.d.ts +7 -0
  99. package/dist/common/components/Reminder.js +214 -0
  100. package/dist/common/components/ScreenWrapper.d.ts +12 -0
  101. package/dist/common/components/ScreenWrapper.js +46 -0
  102. package/dist/common/components/Select.d.ts +17 -0
  103. package/dist/common/components/Select.js +132 -0
  104. package/dist/common/components/Slide.d.ts +13 -0
  105. package/dist/common/components/Slide.js +83 -0
  106. package/dist/common/components/SlideUp.d.ts +8 -0
  107. package/dist/common/components/SlideUp.js +69 -0
  108. package/dist/common/components/Text.d.ts +22 -0
  109. package/dist/common/components/Text.js +130 -0
  110. package/dist/common/contexts/ConsultationContext.d.ts +22 -0
  111. package/dist/common/contexts/ConsultationContext.js +215 -0
  112. package/dist/common/contexts/FormContext.d.ts +25 -0
  113. package/dist/common/contexts/FormContext.js +55 -0
  114. package/dist/common/contexts/ThemeContext.d.ts +13 -0
  115. package/dist/common/contexts/ThemeContext.js +18 -0
  116. package/dist/common/hooks/useConsultation.d.ts +13 -0
  117. package/dist/common/hooks/useConsultation.js +166 -0
  118. package/dist/common/hooks/useForm.d.ts +10 -0
  119. package/dist/common/hooks/useForm.js +107 -0
  120. package/dist/common/hooks/useHeader.d.ts +4 -0
  121. package/dist/common/hooks/useHeader.js +10 -0
  122. package/dist/common/hooks/useTheme.d.ts +2 -0
  123. package/dist/common/hooks/useTheme.js +26 -0
  124. package/dist/common/hooks/useUser.d.ts +4 -0
  125. package/dist/common/hooks/useUser.js +10 -0
  126. package/dist/common/icons/AbiLogoIcon.d.ts +2 -0
  127. package/dist/common/icons/AbiLogoIcon.js +53 -0
  128. package/dist/common/icons/BackArrowIcon.d.ts +2 -0
  129. package/dist/common/icons/BackArrowIcon.js +49 -0
  130. package/dist/common/icons/CalendarIcon.d.ts +3 -0
  131. package/dist/common/icons/CalendarIcon.js +43 -0
  132. package/dist/common/icons/CheckSuccessIcon.d.ts +3 -0
  133. package/dist/common/icons/CheckSuccessIcon.js +47 -0
  134. package/dist/common/icons/CloseIcon.d.ts +5 -0
  135. package/dist/common/icons/CloseIcon.js +51 -0
  136. package/dist/common/icons/DoctorIcon.d.ts +3 -0
  137. package/dist/common/icons/DoctorIcon.js +48 -0
  138. package/dist/common/icons/DoctorImagePlaceholderIcon.d.ts +5 -0
  139. package/dist/common/icons/DoctorImagePlaceholderIcon.js +64 -0
  140. package/dist/common/icons/DropdownIcon.d.ts +3 -0
  141. package/dist/common/icons/DropdownIcon.js +41 -0
  142. package/dist/common/icons/ExitIcon.d.ts +2 -0
  143. package/dist/common/icons/ExitIcon.js +58 -0
  144. package/dist/common/icons/InfoIcon.d.ts +2 -0
  145. package/dist/common/icons/InfoIcon.js +49 -0
  146. package/dist/common/icons/KoCircleIcon.d.ts +3 -0
  147. package/dist/common/icons/KoCircleIcon.js +42 -0
  148. package/dist/common/icons/MotorbikeIcon.d.ts +2 -0
  149. package/dist/common/icons/MotorbikeIcon.js +65 -0
  150. package/dist/common/icons/NoCaseFoundIcon.d.ts +3 -0
  151. package/dist/common/icons/NoCaseFoundIcon.js +55 -0
  152. package/dist/common/icons/PdfDownloadIcon.d.ts +2 -0
  153. package/dist/common/icons/PdfDownloadIcon.js +58 -0
  154. package/dist/common/icons/PdfIcon.d.ts +2 -0
  155. package/dist/common/icons/PdfIcon.js +50 -0
  156. package/dist/common/icons/PersonIcon.d.ts +3 -0
  157. package/dist/common/icons/PersonIcon.js +45 -0
  158. package/dist/common/icons/PillsIcon.d.ts +2 -0
  159. package/dist/common/icons/PillsIcon.js +52 -0
  160. package/dist/common/icons/PlaneIcon.d.ts +5 -0
  161. package/dist/common/icons/PlaneIcon.js +48 -0
  162. package/dist/common/icons/RatingIcon.d.ts +2 -0
  163. package/dist/common/icons/RatingIcon.js +53 -0
  164. package/dist/common/icons/StarIcon.d.ts +4 -0
  165. package/dist/common/icons/StarIcon.js +57 -0
  166. package/dist/common/icons/TextConsultationIcon.d.ts +4 -0
  167. package/dist/common/icons/TextConsultationIcon.js +53 -0
  168. package/dist/common/icons/TrashIcon.d.ts +2 -0
  169. package/dist/common/icons/TrashIcon.js +49 -0
  170. package/dist/common/icons/VideoConsultationIcon.d.ts +4 -0
  171. package/dist/common/icons/VideoConsultationIcon.js +50 -0
  172. package/dist/common/index.d.ts +57 -0
  173. package/dist/common/index.js +114 -0
  174. package/dist/common/locale/i18n.d.ts +5 -0
  175. package/dist/common/locale/i18n.js +79 -0
  176. package/dist/common/locale/translations/ar-AE.base.json +604 -0
  177. package/dist/common/locale/translations/ar-LB.base.json +604 -0
  178. package/dist/common/locale/translations/bg.base.json +488 -0
  179. package/dist/common/locale/translations/cs.base.json +499 -0
  180. package/dist/common/locale/translations/en.base.json +923 -0
  181. package/dist/common/locale/translations/es-MX.base.json +827 -0
  182. package/dist/common/locale/translations/es.base.json +827 -0
  183. package/dist/common/locale/translations/fr.base.json +605 -0
  184. package/dist/common/locale/translations/hu.base.json +488 -0
  185. package/dist/common/locale/translations/pl.base.json +487 -0
  186. package/dist/common/locale/translations/ro.base.json +501 -0
  187. package/dist/common/locale/translations/ru.base.json +603 -0
  188. package/dist/common/locale/translations/sk.base.json +535 -0
  189. package/dist/common/locale/translations/zh-HK.base.json +349 -0
  190. package/dist/common/locale/translations/zh-SG.base.json +603 -0
  191. package/dist/common/locale/translations/zh-TW.base.json +873 -0
  192. package/dist/common/screens/AnswerScreen.d.ts +11 -0
  193. package/dist/common/screens/AnswerScreen.js +101 -0
  194. package/dist/common/screens/MatchScreen.d.ts +5 -0
  195. package/dist/common/screens/MatchScreen.js +36 -0
  196. package/dist/common/screens/MatchingScreen.d.ts +2 -0
  197. package/dist/common/screens/MatchingScreen.js +41 -0
  198. package/dist/common/screens/NoConsultationFoundScreen.d.ts +2 -0
  199. package/dist/common/screens/NoConsultationFoundScreen.js +34 -0
  200. package/dist/common/screens/PreparingSummaryScreen.d.ts +5 -0
  201. package/dist/common/screens/PreparingSummaryScreen.js +35 -0
  202. package/dist/common/screens/RatingScreen.d.ts +2 -0
  203. package/dist/common/screens/RatingScreen.js +198 -0
  204. package/dist/common/screens/index.d.ts +3 -0
  205. package/dist/common/screens/index.js +29 -0
  206. package/dist/common/types/consultation.d.ts +93 -0
  207. package/dist/common/types/consultation.js +41 -0
  208. package/dist/common/types/deliveryAddress.d.ts +18 -0
  209. package/dist/common/types/deliveryAddress.js +11 -0
  210. package/dist/common/types/events.d.ts +13 -0
  211. package/dist/common/types/events.js +15 -0
  212. package/dist/common/types/prescription.d.ts +52 -0
  213. package/dist/common/types/prescription.js +31 -0
  214. package/dist/common/types/professional.d.ts +14 -0
  215. package/dist/common/types/professional.js +2 -0
  216. package/dist/common/types/theme.d.ts +82 -0
  217. package/dist/common/types/theme.js +58 -0
  218. package/dist/common/types/user.d.ts +10 -0
  219. package/dist/common/types/user.js +2 -0
  220. package/dist/common/utils/platform.d.ts +3 -0
  221. package/dist/common/utils/platform.js +7 -0
  222. package/dist/common/utils/professional.d.ts +2 -0
  223. package/dist/common/utils/professional.js +12 -0
  224. package/dist/common/utils/zod.d.ts +5 -0
  225. package/dist/common/utils/zod.js +19 -0
  226. package/dist/index.d.ts +65 -0
  227. package/dist/index.js +133 -0
  228. package/dist/video-consultations/animations/CallingAnimation/index.d.ts +2 -0
  229. package/dist/video-consultations/animations/CallingAnimation/index.js +17 -0
  230. package/dist/video-consultations/animations/CallingAnimation/xml.d.ts +2 -0
  231. package/dist/video-consultations/animations/CallingAnimation/xml.js +5 -0
  232. package/dist/video-consultations/api/models/video.d.ts +10 -0
  233. package/dist/video-consultations/api/models/video.js +2 -0
  234. package/dist/video-consultations/api/video.d.ts +3 -0
  235. package/dist/video-consultations/api/video.js +12 -0
  236. package/dist/video-consultations/components/AgoraWrapper/components/BaseRenderUsers.d.ts +12 -0
  237. package/dist/video-consultations/components/AgoraWrapper/components/BaseRenderUsers.js +174 -0
  238. package/dist/video-consultations/components/AgoraWrapper/components/BtnControls.d.ts +14 -0
  239. package/dist/video-consultations/components/AgoraWrapper/components/BtnControls.js +55 -0
  240. package/dist/video-consultations/components/AgoraWrapper/components/ui/index.d.ts +14 -0
  241. package/dist/video-consultations/components/AgoraWrapper/components/ui/index.js +100 -0
  242. package/dist/video-consultations/components/AgoraWrapper/index.d.ts +8 -0
  243. package/dist/video-consultations/components/AgoraWrapper/index.js +173 -0
  244. package/dist/video-consultations/components/Modal/EndVideoCallModal.d.ts +8 -0
  245. package/dist/video-consultations/components/Modal/EndVideoCallModal.js +15 -0
  246. package/dist/video-consultations/components/VideoConsultation.d.ts +7 -0
  247. package/dist/video-consultations/components/VideoConsultation.js +42 -0
  248. package/dist/video-consultations/helpers/eventHandler.d.ts +14 -0
  249. package/dist/video-consultations/helpers/eventHandler.js +61 -0
  250. package/dist/video-consultations/hooks/useInitRtcEngine.d.ts +15 -0
  251. package/dist/video-consultations/hooks/useInitRtcEngine.js +194 -0
  252. package/dist/video-consultations/icons/EndVideoCallIcon.d.ts +2 -0
  253. package/dist/video-consultations/icons/EndVideoCallIcon.js +51 -0
  254. package/dist/video-consultations/icons/HangUpIcon.d.ts +3 -0
  255. package/dist/video-consultations/icons/HangUpIcon.js +41 -0
  256. package/dist/video-consultations/icons/MicroOffIcon.d.ts +7 -0
  257. package/dist/video-consultations/icons/MicroOffIcon.js +47 -0
  258. package/dist/video-consultations/icons/MicroOnIcon.d.ts +3 -0
  259. package/dist/video-consultations/icons/MicroOnIcon.js +42 -0
  260. package/dist/video-consultations/icons/PersonIcon.d.ts +3 -0
  261. package/dist/video-consultations/icons/PersonIcon.js +45 -0
  262. package/dist/video-consultations/icons/SwitchCameraIcon.d.ts +3 -0
  263. package/dist/video-consultations/icons/SwitchCameraIcon.js +41 -0
  264. package/dist/video-consultations/icons/VideoOffIcon.d.ts +5 -0
  265. package/dist/video-consultations/icons/VideoOffIcon.js +44 -0
  266. package/dist/video-consultations/icons/VideoOnIcon.d.ts +3 -0
  267. package/dist/video-consultations/icons/VideoOnIcon.js +41 -0
  268. package/dist/video-consultations/index.d.ts +10 -0
  269. package/dist/video-consultations/index.js +24 -0
  270. package/dist/video-consultations/screens/DeliveryAddressScreen.d.ts +2 -0
  271. package/dist/video-consultations/screens/DeliveryAddressScreen.js +84 -0
  272. package/dist/video-consultations/screens/EndingVideoScreen.d.ts +5 -0
  273. package/dist/video-consultations/screens/EndingVideoScreen.js +27 -0
  274. package/dist/video-consultations/screens/JoinVideoCallScreen.d.ts +5 -0
  275. package/dist/video-consultations/screens/JoinVideoCallScreen.js +108 -0
  276. package/dist/video-consultations/screens/ProcessingPrescriptionScreen.d.ts +2 -0
  277. package/dist/video-consultations/screens/ProcessingPrescriptionScreen.js +32 -0
  278. package/dist/video-consultations/screens/VideoCallScreen.d.ts +3 -0
  279. package/dist/video-consultations/screens/VideoCallScreen.js +77 -0
  280. package/dist/video-consultations/utils/permission.d.ts +14 -0
  281. package/dist/video-consultations/utils/permission.js +97 -0
  282. package/package.json +58 -0
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getXml = void 0;
4
+ var getXml = function (colors) { return "<svg\n xmlns=\"http://www.w3.org/2000/svg\"\n xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n preserveAspectRatio=\"xMidYMid meet\"\n width=\"400\"\n height=\"400\"\n viewBox=\"0 0 400 400\"\n style=\"width: 100%; height: 100%\"\n>\n <defs>\n <animate\n repeatCount=\"indefinite\"\n dur=\"6s\"\n begin=\"0s\"\n xlink:href=\"#_R_G_L_3_G\"\n fill=\"freeze\"\n attributeName=\"opacity\"\n from=\"1\"\n to=\"0\"\n keyTimes=\"0;0.5;0.8333333;1\"\n values=\"1;1;0;0\"\n keySplines=\"0.167 0.167 0.833 0.833;0.167 0.167 0.833 0.833;0 0 0 0\"\n calcMode=\"spline\"\n />\n <animateTransform\n repeatCount=\"indefinite\"\n dur=\"6s\"\n begin=\"0s\"\n xlink:href=\"#_R_G_L_3_G\"\n fill=\"freeze\"\n attributeName=\"transform\"\n from=\"0 0\"\n to=\"6.8 6.8\"\n type=\"scale\"\n additive=\"sum\"\n keyTimes=\"0;0.5;0.8333333;1\"\n values=\"0 0;0 0;6.8 6.8;6.8 6.8\"\n keySplines=\"0.001 0 0.223 1;0.001 0 0.223 1;0 0 0 0\"\n calcMode=\"spline\"\n />\n <animateTransform\n repeatCount=\"indefinite\"\n dur=\"6s\"\n begin=\"0s\"\n xlink:href=\"#_R_G_L_3_G\"\n fill=\"freeze\"\n attributeName=\"transform\"\n from=\"17.537 -16.537\"\n to=\"17.537 -16.537\"\n type=\"translate\"\n additive=\"sum\"\n keyTimes=\"0;1\"\n values=\"17.537 -16.537;17.537 -16.537\"\n keySplines=\"0 0 1 1\"\n calcMode=\"spline\"\n />\n <animate\n repeatCount=\"indefinite\"\n dur=\"6s\"\n begin=\"0s\"\n xlink:href=\"#_R_G_L_3_G_M\"\n fill=\"freeze\"\n attributeName=\"opacity\"\n from=\"0\"\n to=\"0\"\n keyTimes=\"0;0.5;0.5000007;0.8333333;0.8333333;1\"\n values=\"0;0;1;1;0;0\"\n keySplines=\"0 0 0 0;0 0 0 0;0 0 0 0;0 0 0 0;0 0 0 0\"\n calcMode=\"spline\"\n />\n <animate\n repeatCount=\"indefinite\"\n dur=\"6s\"\n begin=\"0s\"\n xlink:href=\"#_R_G_L_2_G\"\n fill=\"freeze\"\n attributeName=\"opacity\"\n from=\"1\"\n to=\"0\"\n keyTimes=\"0;0.2466667;0.58;1\"\n values=\"1;1;0;0\"\n keySplines=\"0.167 0.167 0.833 0.833;0.167 0.167 0.833 0.833;0 0 0 0\"\n calcMode=\"spline\"\n />\n <animateTransform\n repeatCount=\"indefinite\"\n dur=\"6s\"\n begin=\"0s\"\n xlink:href=\"#_R_G_L_2_G\"\n fill=\"freeze\"\n attributeName=\"transform\"\n from=\"0 0\"\n to=\"6.8 6.8\"\n type=\"scale\"\n additive=\"sum\"\n keyTimes=\"0;0.2466667;0.58;1\"\n values=\"0 0;0 0;6.8 6.8;6.8 6.8\"\n keySplines=\"0.001 0 0.223 1;0.001 0 0.223 1;0 0 0 0\"\n calcMode=\"spline\"\n />\n <animateTransform\n repeatCount=\"indefinite\"\n dur=\"6s\"\n begin=\"0s\"\n xlink:href=\"#_R_G_L_2_G\"\n fill=\"freeze\"\n attributeName=\"transform\"\n from=\"17.537 -16.537\"\n to=\"17.537 -16.537\"\n type=\"translate\"\n additive=\"sum\"\n keyTimes=\"0;1\"\n values=\"17.537 -16.537;17.537 -16.537\"\n keySplines=\"0 0 1 1\"\n calcMode=\"spline\"\n />\n <animate\n repeatCount=\"indefinite\"\n dur=\"6s\"\n begin=\"0s\"\n xlink:href=\"#_R_G_L_2_G_M\"\n fill=\"freeze\"\n attributeName=\"opacity\"\n from=\"0\"\n to=\"0\"\n keyTimes=\"0;0.2466667;0.2466673;0.58;0.58;1\"\n values=\"0;0;1;1;0;0\"\n keySplines=\"0 0 0 0;0 0 0 0;0 0 0 0;0 0 0 0;0 0 0 0\"\n calcMode=\"spline\"\n />\n <animate\n repeatCount=\"indefinite\"\n dur=\"6s\"\n begin=\"0s\"\n xlink:href=\"#_R_G_L_1_G\"\n fill=\"freeze\"\n attributeName=\"opacity\"\n from=\"1\"\n to=\"0\"\n keyTimes=\"0;0.3333333;1\"\n values=\"1;0;0\"\n keySplines=\"0.167 0.167 0.833 0.833;0 0 0 0\"\n calcMode=\"spline\"\n />\n <animateTransform\n repeatCount=\"indefinite\"\n dur=\"6s\"\n begin=\"0s\"\n xlink:href=\"#_R_G_L_1_G\"\n fill=\"freeze\"\n attributeName=\"transform\"\n from=\"0 0\"\n to=\"6.8 6.8\"\n type=\"scale\"\n additive=\"sum\"\n keyTimes=\"0;0.3333333;1\"\n values=\"0 0;6.8 6.8;6.8 6.8\"\n keySplines=\"0.001 0 0.223 0.989;0 0 0 0\"\n calcMode=\"spline\"\n />\n <animateTransform\n repeatCount=\"indefinite\"\n dur=\"6s\"\n begin=\"0s\"\n xlink:href=\"#_R_G_L_1_G\"\n fill=\"freeze\"\n attributeName=\"transform\"\n from=\"17.537 -16.537\"\n to=\"17.537 -16.537\"\n type=\"translate\"\n additive=\"sum\"\n keyTimes=\"0;1\"\n values=\"17.537 -16.537;17.537 -16.537\"\n keySplines=\"0 0 1 1\"\n calcMode=\"spline\"\n />\n <animate\n repeatCount=\"indefinite\"\n dur=\"6s\"\n begin=\"0s\"\n xlink:href=\"#_R_G_L_1_G_M\"\n fill=\"freeze\"\n attributeName=\"opacity\"\n from=\"1\"\n to=\"0\"\n keyTimes=\"0;0.3333333;0.3333333;1\"\n values=\"1;1;0;0\"\n keySplines=\"0 0 0 0;0 0 0 0;0 0 0 0\"\n calcMode=\"spline\"\n />\n <animate attributeType=\"XML\" attributeName=\"opacity\" dur=\"6s\" from=\"0\" to=\"1\" xlink:href=\"#time_group\" />\n </defs>\n <g id=\"_R_G\">\n <g id=\"_R_G_L_3_G_M\">\n <g id=\"_R_G_L_3_G\" transform=\" translate(200, 200)\">\n <path\n id=\"_R_G_L_3_G_D_0_P_0\"\n stroke=\"".concat(colors.rating, "\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n fill=\"none\"\n stroke-width=\"5\"\n stroke-opacity=\"1\"\n d=\" M-17.54 -3 C-28.33,-3 -37.07,5.75 -37.07,16.54 C-37.07,27.33 -28.33,36.07 -17.54,36.07 C-6.75,36.07 2,27.33 2,16.54 C2,5.75 -6.75,-3 -17.54,-3z \"\n />\n </g>\n </g>\n <g id=\"_R_G_L_2_G_M\">\n <g id=\"_R_G_L_2_G\" transform=\" translate(200, 200)\">\n <path\n id=\"_R_G_L_2_G_D_0_P_0\"\n stroke=\"").concat(colors.rating, "\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n fill=\"none\"\n stroke-width=\"5\"\n stroke-opacity=\"1\"\n d=\" M-17.54 -3 C-28.33,-3 -37.07,5.75 -37.07,16.54 C-37.07,27.33 -28.33,36.07 -17.54,36.07 C-6.75,36.07 2,27.33 2,16.54 C2,5.75 -6.75,-3 -17.54,-3z \"\n />\n </g>\n </g>\n <g id=\"_R_G_L_1_G_M\">\n <g id=\"_R_G_L_1_G\" transform=\" translate(200, 200)\">\n <path\n id=\"_R_G_L_1_G_D_0_P_0\"\n stroke=\"").concat(colors.rating, "\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n fill=\"none\"\n stroke-width=\"5\"\n stroke-opacity=\"1\"\n d=\" M-17.54 -3 C-28.33,-3 -37.07,5.75 -37.07,16.54 C-37.07,27.33 -28.33,36.07 -17.54,36.07 C-6.75,36.07 2,27.33 2,16.54 C2,5.75 -6.75,-3 -17.54,-3z \"\n />\n </g>\n </g>\n <g id=\"_R_G_L_0_G\" transform=\" translate(200, 200) scale(1.2, 1.2) translate(-49.5, -55.5)\">\n <path\n id=\"_R_G_L_0_G_D_0_P_0\"\n fill=").concat(colors.background, "\n fill-opacity=\"1\"\n fill-rule=\"nonzero\"\n d=\" M49.5 7.5 C76.01,7.5 97.5,28.99 97.5,55.5 C97.5,82.01 76.01,103.5 49.5,103.5 C22.99,103.5 1.5,82.01 1.5,55.5 C1.5,28.99 22.99,7.5 49.5,7.5z \"\n />\n <path\n id=\"_R_G_L_0_G_D_1_P_0\"\n fill=\"").concat(colors.primaryDark, "\"\n fill-opacity=\"1\"\n fill-rule=\"nonzero\"\n d=\" M29.78 35.49 C29.78,46.65 38.83,63.43 49.99,63.43 C61.15,63.43 70.19,46.65 70.19,35.49 C70.19,24.33 61.15,15.29 49.99,15.29 C38.83,15.29 29.78,24.33 29.78,35.49z \"\n />\n <path\n id=\"_R_G_L_0_G_D_2_P_0\"\n fill=\"").concat(colors.primaryDark, "\"\n fill-opacity=\"1\"\n fill-rule=\"nonzero\"\n d=\" M73.17 77.65 C74.67,77.65 75.89,76.43 75.89,74.93 C75.89,73.42 74.67,72.2 73.17,72.2 C71.66,72.2 70.44,73.42 70.44,74.93 C70.44,76.43 71.66,77.65 73.17,77.65z \"\n />\n <path\n id=\"_R_G_L_0_G_D_3_P_0\"\n fill=\"").concat(colors.primaryDark, "\"\n fill-opacity=\"1\"\n fill-rule=\"nonzero\"\n d=\" M73.16 62.64 C73.93,64.44 74.38,66.63 74.49,69.17 C77.11,69.78 79.07,72.12 79.07,74.93 C79.07,78.18 76.43,80.83 73.17,80.83 C69.91,80.83 67.26,78.18 67.26,74.93 C67.26,72.16 69.19,69.83 71.76,69.2 C71.65,66.68 71.05,62.84 68.58,60.94 C67.32,60.61 66.02,60.38 64.69,60.26 C64.59,64.68 49.99,75.58 49.99,75.58 C49.99,75.58 35.37,64.68 35.27,60.26 C33.8,60.39 32.36,60.66 30.97,61.05 C29.17,62.48 28.24,65.13 28.19,69 C28.72,69.3 29.15,69.78 29.41,70.35 C31.35,71.27 33.07,73.2 34.38,75.94 C34.6,76.4 34.63,76.93 34.47,77.4 C35.25,79.43 35.7,81.64 35.7,83.5 C35.7,86.1 35.7,88.57 32.86,89.2 C32.56,89.46 32.17,89.59 31.77,89.59 C31.77,89.59 29.87,89.59 29.87,89.59 C28.92,89.59 28.14,88.82 28.14,87.87 C28.14,87.87 28.15,87.8 28.15,87.8 C28.18,86.89 28.95,86.15 29.87,86.15 C29.87,86.15 31.77,86.15 31.77,86.15 C31.96,86.15 32.15,86.18 32.33,86.24 C32.45,86.21 32.49,86.18 32.49,86.18 C32.7,85.81 32.7,84.25 32.7,83.5 C32.7,81.99 32.32,80.17 31.66,78.47 C31.31,78.28 31.03,77.98 30.86,77.63 C29.71,75.22 28.15,73.66 26.88,73.66 C25.58,73.66 23.94,75.34 22.79,77.84 C22.6,78.25 22.28,78.58 21.87,78.78 C21.28,80.4 20.95,82.07 20.95,83.5 C20.95,84.13 20.95,85.8 21.19,86.19 C21.19,86.19 21.24,86.22 21.39,86.26 C21.59,86.18 21.8,86.14 22.01,86.14 C22.01,86.14 23.91,86.14 23.91,86.14 C24.8,86.14 25.54,86.82 25.63,87.7 C25.63,87.7 25.64,87.8 25.64,87.8 C25.64,88.82 24.86,89.6 23.91,89.6 C23.91,89.6 22.01,89.6 22.01,89.6 C21.63,89.6 21.27,89.47 20.97,89.24 C19.88,89.04 19.12,88.56 18.63,87.78 C18.05,86.84 17.94,85.6 17.94,83.5 C17.94,81.66 18.37,79.54 19.14,77.51 C19.02,77.08 19.06,76.63 19.25,76.22 C20.06,74.46 21.08,72.95 22.21,71.86 C22.83,71.27 23.5,70.79 24.2,70.43 C24.46,69.82 24.91,69.32 25.47,69 C25.5,66.58 25.87,64.49 26.56,62.77 C19.17,66.51 13.98,77.3 12.76,86.39 C21.57,96.85 34.75,103.5 49.49,103.5 C64.96,103.5 78.72,96.17 87.5,84.8 C86.45,75.9 80.44,66.23 73.16,62.64z \"\n />\n </g>\n </g>\n <g id=\"time_group\" />\n</svg>\n"); };
5
+ exports.getXml = getXml;
@@ -0,0 +1,10 @@
1
+ export interface VideoToken {
2
+ token: string;
3
+ channel?: string;
4
+ uid: number;
5
+ appId?: string;
6
+ }
7
+ export interface HangOutRequest {
8
+ consultationId: string;
9
+ room: string;
10
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,3 @@
1
+ import { ConsultationResponse } from '../../common/api/models/consultation';
2
+ import { HangOutRequest } from './models/video';
3
+ export declare const hangOutVideocall: (body: HangOutRequest) => Promise<ConsultationResponse>;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.hangOutVideocall = void 0;
7
+ var axios_1 = __importDefault(require("axios"));
8
+ var HANGOUT_URL = "/video-consultation/hangout";
9
+ var hangOutVideocall = function (body) {
10
+ return axios_1.default.patch(HANGOUT_URL, body).then(function (response) { return response === null || response === void 0 ? void 0 : response.data; });
11
+ };
12
+ exports.hangOutVideocall = hangOutVideocall;
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ export interface BaseRenderUsersProps {
3
+ startPreview?: boolean;
4
+ joinChannelSuccess: boolean;
5
+ remoteUsers: number[];
6
+ localVideoMuted?: boolean;
7
+ remoteVideoMuted?: boolean;
8
+ remoteAudioMuted?: boolean;
9
+ }
10
+ export declare const BaseRenderUsers: (props: BaseRenderUsersProps) => React.JSX.Element;
11
+ declare const _default: React.MemoExoticComponent<(props: BaseRenderUsersProps) => React.JSX.Element>;
12
+ export default _default;
@@ -0,0 +1,174 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ var __importDefault = (this && this.__importDefault) || function (mod) {
36
+ return (mod && mod.__esModule) ? mod : { "default": mod };
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.BaseRenderUsers = void 0;
40
+ var react_1 = __importStar(require("react"));
41
+ var react_native_1 = require("react-native");
42
+ var react_native_agora_1 = require("react-native-agora");
43
+ var index_1 = require("../../../../common/index");
44
+ var MicroOffIcon_1 = __importDefault(require("../../../icons/MicroOffIcon"));
45
+ var PersonIcon_1 = __importDefault(require("../../../icons/PersonIcon"));
46
+ var VideoOffIcon_1 = __importDefault(require("../../../icons/VideoOffIcon"));
47
+ var ui_1 = require("./ui");
48
+ var MutedIndicatorsContainer = function (_a) {
49
+ var muted = _a.muted, isLocalUser = _a.isLocalUser;
50
+ var theme = (0, index_1.useTheme)();
51
+ var styles = getStyles(theme);
52
+ return (<react_native_1.View style={styles.mutedIndicatorsContainer}>
53
+ {muted.audio && (<react_native_1.View style={isLocalUser ? styles.mutedIconSmall : styles.mutedIconLarge}>
54
+ <MicroOffIcon_1.default size={isLocalUser ? 10 : 25} color={isLocalUser ? theme.colors.black : theme.colors.white}/>
55
+ </react_native_1.View>)}
56
+ {muted.video && !isLocalUser && (<react_native_1.View style={styles.mutedIconLarge}>
57
+ <VideoOffIcon_1.default size={25}/>
58
+ </react_native_1.View>)}
59
+ </react_native_1.View>);
60
+ };
61
+ var BaseRenderUsers = function (props) {
62
+ var theme = (0, index_1.useTheme)();
63
+ var styles = getStyles(theme);
64
+ var startPreview = props.startPreview, joinChannelSuccess = props.joinChannelSuccess, remoteUsers = props.remoteUsers, _a = props.localVideoMuted, localVideoMuted = _a === void 0 ? false : _a, _b = props.remoteVideoMuted, remoteVideoMuted = _b === void 0 ? false : _b, _c = props.remoteAudioMuted, remoteAudioMuted = _c === void 0 ? false : _c;
65
+ var showLargeVideo = function (user) { return (user.uid === 0 && !remoteUsers.length) || (remoteUsers.length && user.uid !== 0); };
66
+ var renderUser = function (user) {
67
+ var video = renderVideo(user);
68
+ if (showLargeVideo(user)) {
69
+ return video;
70
+ }
71
+ return <ui_1.AgoraCard key={"".concat(user.uid, " - ").concat(user.sourceType)}>{!localVideoMuted ? <>{video}</> : undefined}</ui_1.AgoraCard>;
72
+ };
73
+ var renderVideo = function (user) { return (<react_native_agora_1.RtcSurfaceView style={showLargeVideo(user) ? styles.videoLarge : styles.videoSmall} zOrderMediaOverlay={user.uid === 0 && !!remoteUsers.length} canvas={user}/>); };
74
+ var renderVideoUser = function (muted, uid, sourceType) {
75
+ if (muted === void 0) { muted = { video: false, audio: false }; }
76
+ if (uid === void 0) { uid = 0; }
77
+ if (sourceType === void 0) { sourceType = react_native_agora_1.VideoSourceType.VideoSourceCamera; }
78
+ var isLocalUser = uid === 0;
79
+ return !muted.video ? (<>
80
+ <MutedIndicatorsContainer muted={muted} isLocalUser={isLocalUser}/>
81
+ {renderUser({
82
+ uid: uid,
83
+ sourceType: sourceType
84
+ })}
85
+ </>) : (<react_native_1.View style={[styles.mutedWrapper, isLocalUser ? { backgroundColor: theme.colors.white } : {}]}>
86
+ <MutedIndicatorsContainer muted={muted} isLocalUser={isLocalUser}/>
87
+ <react_native_1.View style={styles.userIconContainer}>{isLocalUser ? <PersonIcon_1.default /> : <index_1.DoctorIcon />}</react_native_1.View>
88
+ </react_native_1.View>);
89
+ };
90
+ if (!startPreview && !joinChannelSuccess) {
91
+ return null;
92
+ }
93
+ return (<>
94
+ {remoteUsers.length === 0
95
+ ? renderVideoUser({ video: localVideoMuted })
96
+ : renderVideoUser({ video: remoteVideoMuted, audio: remoteAudioMuted }, remoteUsers[0], react_native_agora_1.VideoSourceType.VideoSourceRemote)}
97
+ {!!remoteUsers.length && (<ui_1.AgoraList style={styles.videoContainer} numColumns={undefined} horizontal={true} data={remoteUsers} renderItem={function () { return renderVideoUser({ video: localVideoMuted }); }}/>)}
98
+ </>);
99
+ };
100
+ exports.BaseRenderUsers = BaseRenderUsers;
101
+ exports.default = (0, react_1.memo)(exports.BaseRenderUsers);
102
+ var getStyles = function (_a) {
103
+ var colors = _a.colors, spacing = _a.spacing, borderRadius = _a.borderRadius;
104
+ return react_native_1.StyleSheet.create({
105
+ mutedWrapper: {
106
+ width: '100%',
107
+ height: '100%',
108
+ minWidth: 100,
109
+ minHeight: 150,
110
+ alignItems: 'center',
111
+ justifyContent: 'center',
112
+ zIndex: 999
113
+ },
114
+ userIconContainer: {
115
+ width: 100,
116
+ height: 110,
117
+ position: 'absolute',
118
+ alignSelf: 'center',
119
+ justifyContent: 'center',
120
+ alignContent: 'center',
121
+ alignItems: 'center',
122
+ margin: 'auto',
123
+ display: 'flex'
124
+ },
125
+ mutedIconLarge: {
126
+ width: 40,
127
+ height: 40,
128
+ borderRadius: borderRadius.full,
129
+ backgroundColor: colors.darkGray,
130
+ alignContent: 'center',
131
+ justifyContent: 'center',
132
+ alignItems: 'center',
133
+ marginLeft: spacing.sm,
134
+ zIndex: 9999
135
+ },
136
+ mutedIconSmall: {
137
+ backgroundColor: colors.gray,
138
+ width: 20,
139
+ height: 20,
140
+ borderRadius: borderRadius.full,
141
+ alignContent: 'center',
142
+ justifyContent: 'center',
143
+ alignItems: 'center',
144
+ zIndex: 9999
145
+ },
146
+ mutedIndicatorsContainer: {
147
+ position: 'absolute',
148
+ flexDirection: 'row',
149
+ top: spacing.sm,
150
+ right: spacing.sm
151
+ },
152
+ videoLarge: {
153
+ flex: 1,
154
+ width: '100%',
155
+ minWidth: 320,
156
+ minHeight: 65
157
+ },
158
+ videoSmall: {
159
+ width: 100,
160
+ height: 150,
161
+ backgroundColor: colors.white,
162
+ borderRadius: borderRadius.sm
163
+ },
164
+ videoContainer: {
165
+ position: 'absolute',
166
+ bottom: 100,
167
+ right: 10,
168
+ padding: 0,
169
+ margin: 0,
170
+ zIndex: 7000,
171
+ borderRadius: borderRadius.sm
172
+ }
173
+ });
174
+ };
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ interface BtnControlsProps {
3
+ remoteUsers: number[];
4
+ muteLocalAudioStream: boolean;
5
+ muteLocalVideoStream: boolean;
6
+ controlActions: {
7
+ switchCamera: () => void;
8
+ localAudioStream: () => void;
9
+ localVideoStream: () => void;
10
+ endCall: () => void;
11
+ };
12
+ }
13
+ export declare const BtnControls: ({ controlActions, remoteUsers, muteLocalAudioStream, muteLocalVideoStream }: BtnControlsProps) => React.JSX.Element;
14
+ export default BtnControls;
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.BtnControls = void 0;
7
+ var index_1 = require("../../../../common/index");
8
+ var react_1 = __importDefault(require("react"));
9
+ var react_native_1 = require("react-native");
10
+ var HangUpIcon_1 = __importDefault(require("../../../icons/HangUpIcon"));
11
+ var MicroOffIcon_1 = __importDefault(require("../../../icons/MicroOffIcon"));
12
+ var MicroOnIcon_1 = __importDefault(require("../../../icons/MicroOnIcon"));
13
+ var SwitchCameraIcon_1 = __importDefault(require("../../../icons/SwitchCameraIcon"));
14
+ var VideoOffIcon_1 = __importDefault(require("../../../icons/VideoOffIcon"));
15
+ var VideoOnIcon_1 = __importDefault(require("../../../icons/VideoOnIcon"));
16
+ var ui_1 = require("./ui");
17
+ var BtnControls = function (_a) {
18
+ var _b, _c;
19
+ var controlActions = _a.controlActions, remoteUsers = _a.remoteUsers, muteLocalAudioStream = _a.muteLocalAudioStream, muteLocalVideoStream = _a.muteLocalVideoStream;
20
+ var theme = (0, index_1.useTheme)();
21
+ var styles = getStyles(theme);
22
+ return (<react_native_1.View style={[styles.btnContainer, theme.shadows.soft]}>
23
+ <react_native_1.View style={styles.btnContent}>
24
+ <ui_1.VideoCallButton icon={muteLocalAudioStream ? <MicroOffIcon_1.default /> : <MicroOnIcon_1.default />} name={'audiomute'} onPress={controlActions.localAudioStream} isMuted={muteLocalAudioStream}/>
25
+ <ui_1.VideoCallButton icon={muteLocalVideoStream ? <VideoOffIcon_1.default /> : <VideoOnIcon_1.default />} name={'videomute'} onPress={controlActions.localVideoStream} isMuted={muteLocalVideoStream}/>
26
+ <ui_1.VideoCallButton disabled={!remoteUsers.length} icon={<SwitchCameraIcon_1.default />} name={'switchCamera'} onPress={controlActions.switchCamera}/>
27
+ <ui_1.VideoCallButton customStyle={[styles.endCall, (_c = (_b = theme.components) === null || _b === void 0 ? void 0 : _b.videoCall) === null || _c === void 0 ? void 0 : _c.endCall]} icon={<HangUpIcon_1.default />} name={'endCall'} onPress={controlActions.endCall}/>
28
+ </react_native_1.View>
29
+ </react_native_1.View>);
30
+ };
31
+ exports.BtnControls = BtnControls;
32
+ exports.default = exports.BtnControls;
33
+ var getStyles = function (_a) {
34
+ var colors = _a.colors, spacing = _a.spacing, borderRadius = _a.borderRadius;
35
+ return react_native_1.StyleSheet.create({
36
+ endCall: {
37
+ borderRadius: borderRadius.full,
38
+ backgroundColor: colors.warning
39
+ },
40
+ btnContainer: {
41
+ backgroundColor: colors.white,
42
+ bottom: spacing.sm,
43
+ paddingVertical: spacing.xs,
44
+ justifyContent: 'space-between',
45
+ height: 70,
46
+ flexDirection: 'row',
47
+ alignSelf: 'center',
48
+ borderRadius: borderRadius.full
49
+ },
50
+ btnContent: {
51
+ flexDirection: 'row',
52
+ justifyContent: 'space-evenly'
53
+ }
54
+ });
55
+ };
@@ -0,0 +1,14 @@
1
+ import React, { PropsWithChildren, ReactNode } from 'react';
2
+ import { FlatListProps, StyleProp, ViewStyle } from 'react-native';
3
+ export { RtcSurfaceView } from 'react-native-agora';
4
+ interface VideoCallButtonProps {
5
+ disabled?: boolean;
6
+ icon: ReactNode;
7
+ isMuted?: boolean;
8
+ name: string;
9
+ customStyle?: StyleProp<ViewStyle>;
10
+ onPress: () => void;
11
+ }
12
+ export declare const VideoCallButton: (props: VideoCallButtonProps) => React.JSX.Element;
13
+ export declare function AgoraList<T>(props: FlatListProps<T>): React.JSX.Element;
14
+ export declare const AgoraCard: ({ children }: PropsWithChildren<{}>) => React.JSX.Element;
@@ -0,0 +1,100 @@
1
+ "use strict";
2
+ var __rest = (this && this.__rest) || function (s, e) {
3
+ var t = {};
4
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
13
+ var __importDefault = (this && this.__importDefault) || function (mod) {
14
+ return (mod && mod.__esModule) ? mod : { "default": mod };
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.AgoraCard = exports.VideoCallButton = exports.RtcSurfaceView = void 0;
18
+ exports.AgoraList = AgoraList;
19
+ var index_1 = require("../../../../../common/index");
20
+ var react_1 = __importDefault(require("react"));
21
+ var react_native_1 = require("react-native");
22
+ var react_native_agora_1 = require("react-native-agora");
23
+ Object.defineProperty(exports, "RtcSurfaceView", { enumerable: true, get: function () { return react_native_agora_1.RtcSurfaceView; } });
24
+ var VideoCallButton = function (props) {
25
+ var theme = (0, index_1.useTheme)();
26
+ var styles = getStyles(theme);
27
+ var _a = props.disabled, disabled = _a === void 0 ? false : _a, icon = props.icon, _b = props.isMuted, isMuted = _b === void 0 ? false : _b, _c = props.customStyle, customStyle = _c === void 0 ? {} : _c;
28
+ return (<react_native_1.TouchableOpacity style={styles.buttonPress} disabled={disabled} onPress={props.onPress}>
29
+ <react_native_1.View style={[styles.buttonControl, customStyle, theme.shadows.soft, isMuted ? { opacity: 0.3 } : {}]}>{icon}</react_native_1.View>
30
+ </react_native_1.TouchableOpacity>);
31
+ };
32
+ exports.VideoCallButton = VideoCallButton;
33
+ function AgoraList(props) {
34
+ var theme = (0, index_1.useTheme)();
35
+ var styles = getStyles(theme);
36
+ var renderItem = props.renderItem, others = __rest(props, ["renderItem"]);
37
+ return (<react_native_1.FlatList numColumns={1} {...others} renderItem={function (_a) {
38
+ var item = _a.item, index = _a.index, separators = _a.separators;
39
+ return <react_native_1.View style={styles.smallElement}>{renderItem ? renderItem({ item: item, index: index, separators: separators }) : undefined}</react_native_1.View>;
40
+ }}/>);
41
+ }
42
+ var AgoraCard = function (_a) {
43
+ var children = _a.children;
44
+ var theme = (0, index_1.useTheme)();
45
+ var styles = getStyles(theme);
46
+ return (<react_native_1.View style={[styles.listItem]}>
47
+ <react_native_1.View style={styles.cardContent}>{children}</react_native_1.View>
48
+ </react_native_1.View>);
49
+ };
50
+ exports.AgoraCard = AgoraCard;
51
+ var getStyles = function (_a) {
52
+ var colors = _a.colors, spacing = _a.spacing, borderRadius = _a.borderRadius, fontSize = _a.fontSize;
53
+ return react_native_1.StyleSheet.create({
54
+ buttonPress: {
55
+ marginHorizontal: spacing.xs
56
+ },
57
+ buttonControl: {
58
+ borderRadius: borderRadius.full,
59
+ width: 54,
60
+ height: 54,
61
+ backgroundColor: colors.primary,
62
+ color: colors.white,
63
+ borderWidth: 0,
64
+ alignItems: 'center',
65
+ justifyContent: 'center'
66
+ },
67
+ buttonIcon: {
68
+ width: 36,
69
+ height: 36,
70
+ tintColor: colors.white
71
+ },
72
+ cardContent: {
73
+ position: 'absolute',
74
+ top: 0,
75
+ left: 0,
76
+ minWidth: 100
77
+ },
78
+ timer: {
79
+ fontSize: fontSize.h2,
80
+ alignSelf: 'center',
81
+ paddingHorizontal: spacing.xs,
82
+ alignContent: 'center',
83
+ alignItems: 'center',
84
+ color: colors.white
85
+ },
86
+ smallElement: {
87
+ flexDirection: 'row',
88
+ padding: 0
89
+ },
90
+ listItem: {
91
+ backgroundColor: colors.gray,
92
+ padding: 0,
93
+ zIndex: 1000,
94
+ width: 100,
95
+ height: 150,
96
+ margin: 1,
97
+ borderRadius: borderRadius.sm
98
+ }
99
+ });
100
+ };
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { VideoToken } from '../../api/models/video';
3
+ interface AgoraWrapperProps {
4
+ rtcProps: VideoToken;
5
+ rtcCallbacks?: any;
6
+ }
7
+ export declare const AgoraWrapper: ({ rtcProps, rtcCallbacks }: AgoraWrapperProps) => React.JSX.Element;
8
+ export default AgoraWrapper;
@@ -0,0 +1,173 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ var __importDefault = (this && this.__importDefault) || function (mod) {
36
+ return (mod && mod.__esModule) ? mod : { "default": mod };
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.AgoraWrapper = void 0;
40
+ var index_1 = require("../../../common/index");
41
+ var react_1 = __importStar(require("react"));
42
+ var react_native_1 = require("react-native");
43
+ var react_native_agora_1 = require("react-native-agora");
44
+ var useInitRtcEngine_1 = __importDefault(require("../../hooks/useInitRtcEngine"));
45
+ var BaseRenderUsers_1 = __importDefault(require("./components/BaseRenderUsers"));
46
+ var BtnControls_1 = __importDefault(require("./components/BtnControls"));
47
+ var AgoraWrapper = function (_a) {
48
+ var rtcProps = _a.rtcProps, rtcCallbacks = _a.rtcCallbacks;
49
+ var _b = (0, react_1.useState)(false), muteLocalAudioStream = _b[0], setMuteLocalAudioStream = _b[1];
50
+ var _c = (0, react_1.useState)(false), muteLocalVideoStream = _c[0], setMuteLocalVideoStream = _c[1];
51
+ var _d = (0, react_1.useState)(false), remoteVideoMuted = _d[0], setRemoteVideoMuted = _d[1];
52
+ var _e = (0, react_1.useState)(false), remoteAudioMuted = _e[0], setRemoteAudioMuted = _e[1];
53
+ var _f = (0, useInitRtcEngine_1.default)(rtcProps, true), channelId = _f.channelId, token = _f.token, uid = _f.uid, joinChannelSuccess = _f.joinChannelSuccess, remoteUsers = _f.remoteUsers, startPreview = _f.startPreview, engine = _f.engine, setRemoteUsers = _f.setRemoteUsers;
54
+ var joinChannel = function () {
55
+ if (!channelId) {
56
+ console.error('channelId is invalid');
57
+ return;
58
+ }
59
+ if (uid < 0) {
60
+ console.error('uid is invalid');
61
+ return;
62
+ }
63
+ engine.current.joinChannel(token, channelId, uid, {
64
+ clientRoleType: react_native_agora_1.ClientRoleType.ClientRoleBroadcaster
65
+ });
66
+ };
67
+ var _switchCamera = function () {
68
+ engine.current.switchCamera();
69
+ };
70
+ var _muteLocalAudioStream = function () {
71
+ engine.current.muteLocalAudioStream(true);
72
+ setMuteLocalAudioStream(true);
73
+ };
74
+ var unmuteLocalAudioStream = function () {
75
+ engine.current.muteLocalAudioStream(false);
76
+ setMuteLocalAudioStream(false);
77
+ };
78
+ var _muteLocalVideoStream = function () {
79
+ engine.current.muteLocalVideoStream(true);
80
+ setMuteLocalVideoStream(true);
81
+ };
82
+ var unmuteLocalVideoStream = function () {
83
+ engine.current.muteLocalVideoStream(false);
84
+ setMuteLocalVideoStream(false);
85
+ };
86
+ var leaveChannel = function () {
87
+ engine.current.leaveChannel();
88
+ };
89
+ var onUserOffline = (0, react_1.useCallback)(function (connection, remoteUid, reason) {
90
+ console.info('onUserOffline', 'connection', connection, 'remoteUid', remoteUid, 'reason', reason);
91
+ setRemoteVideoMuted(true);
92
+ if (connection.channelId === channelId && (connection.localUid === uid || uid === 0)) {
93
+ setRemoteUsers(function (prev) {
94
+ if (prev === undefined)
95
+ return [];
96
+ return prev.filter(function (value) { return value !== remoteUid; });
97
+ });
98
+ }
99
+ }, [channelId, uid]);
100
+ (0, react_1.useEffect)(function () {
101
+ engine.current.addListener('onVideoDeviceStateChanged', function (deviceId, deviceType, deviceState) {
102
+ console.info('onVideoDeviceStateChanged', 'deviceId', deviceId, 'deviceType', deviceType, 'deviceState', deviceState);
103
+ });
104
+ engine.current.addListener('onLocalVideoStateChanged', function (source, state, error) {
105
+ console.info('onLocalVideoStateChanged', 'source', source, 'state', state, 'error', error);
106
+ });
107
+ engine.current.addListener('onLocalAudioStateChanged', function (connection, state, error) {
108
+ console.info('onLocalAudioStateChanged', 'connection', connection, 'state', state, 'error', error);
109
+ });
110
+ engine.current.addListener('onUserMuteVideo', function (connection, remoteUid, muted) {
111
+ console.info('onUserMuteVideo', 'connection', connection, 'remoteUid', remoteUid, 'muted', muted);
112
+ setRemoteVideoMuted(muted);
113
+ });
114
+ engine.current.addListener('onUserMuteAudio', function (connection, remoteUid, muted) {
115
+ console.info('onUserMuteAudio', 'connection', connection, 'remoteUid', remoteUid, 'muted', muted);
116
+ setRemoteAudioMuted(muted);
117
+ });
118
+ engine.current.addListener('onUserJoined', function () {
119
+ var _a;
120
+ (_a = rtcCallbacks === null || rtcCallbacks === void 0 ? void 0 : rtcCallbacks.userJoined) === null || _a === void 0 ? void 0 : _a.call(rtcCallbacks);
121
+ });
122
+ engine.current.addListener('onUserOffline', onUserOffline);
123
+ var engineCopy = engine.current;
124
+ return function () {
125
+ engineCopy.removeAllListeners();
126
+ };
127
+ }, [engine, onUserOffline]);
128
+ (0, react_1.useEffect)(function () {
129
+ console.info('startPreview', startPreview, channelId);
130
+ if (startPreview && channelId) {
131
+ console.info('joinChannel');
132
+ joinChannel();
133
+ }
134
+ }, [startPreview, channelId]);
135
+ (0, react_1.useEffect)(function () {
136
+ return function () {
137
+ engine.current.removeAllListeners();
138
+ engine.current.leaveChannel();
139
+ };
140
+ }, []);
141
+ return (<react_native_1.KeyboardAvoidingView style={[styles.fullSize, { width: '100%', minHeight: 450, flex: 1 }]} behavior={index_1.isIOS ? 'padding' : 'height'}>
142
+ <react_native_1.View style={styles.fullSize} pointerEvents={'box-none'}>
143
+ <BaseRenderUsers_1.default startPreview={startPreview} joinChannelSuccess={joinChannelSuccess} remoteUsers={remoteUsers} localVideoMuted={muteLocalVideoStream} remoteVideoMuted={remoteVideoMuted} remoteAudioMuted={remoteAudioMuted}/>
144
+ </react_native_1.View>
145
+
146
+ <react_native_1.View style={styles.float} pointerEvents={'box-none'}>
147
+ <BtnControls_1.default muteLocalAudioStream={muteLocalAudioStream} muteLocalVideoStream={muteLocalVideoStream} remoteUsers={remoteUsers} controlActions={{
148
+ switchCamera: _switchCamera,
149
+ localAudioStream: muteLocalAudioStream ? unmuteLocalAudioStream : _muteLocalAudioStream,
150
+ localVideoStream: muteLocalVideoStream ? unmuteLocalVideoStream : _muteLocalVideoStream,
151
+ endCall: function () {
152
+ leaveChannel();
153
+ rtcCallbacks === null || rtcCallbacks === void 0 ? void 0 : rtcCallbacks.endCall();
154
+ }
155
+ }}/>
156
+ </react_native_1.View>
157
+ </react_native_1.KeyboardAvoidingView>);
158
+ };
159
+ exports.AgoraWrapper = AgoraWrapper;
160
+ exports.default = exports.AgoraWrapper;
161
+ var styles = react_native_1.StyleSheet.create({
162
+ fullSize: {
163
+ flex: 1
164
+ },
165
+ float: {
166
+ width: '100%',
167
+ position: 'absolute',
168
+ bottom: 0,
169
+ alignItems: 'center',
170
+ justifyContent: 'center',
171
+ zIndex: 1000
172
+ }
173
+ });
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ interface EndVideoCallModalProps {
3
+ onConfirm?: () => void;
4
+ onCancel?: () => void;
5
+ visible: boolean;
6
+ }
7
+ export declare const EndVideoCallModal: ({ onConfirm, onCancel, visible }: EndVideoCallModalProps) => React.JSX.Element;
8
+ export {};
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.EndVideoCallModal = void 0;
7
+ var react_1 = __importDefault(require("react"));
8
+ var index_1 = require("../../../common/index");
9
+ var EndVideoCallIcon_1 = require("../../icons/EndVideoCallIcon");
10
+ var EndVideoCallModal = function (_a) {
11
+ var onConfirm = _a.onConfirm, onCancel = _a.onCancel, visible = _a.visible;
12
+ var t = (0, index_1.useTranslation)().t;
13
+ return (<index_1.TwoOptionsModal visible={visible} onConfirm={onConfirm} onCancel={onCancel} icon={<EndVideoCallIcon_1.EndVideoCallIcon />} text={t('general.consultation.modal.finish_video_call')} confirmText={t('button.yes')} cancelText={t('button.no')}/>);
14
+ };
15
+ exports.EndVideoCallModal = EndVideoCallModal;