@tap-payments/auth-jsconnect 2.0.32-test → 2.0.32

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 (280) hide show
  1. package/build/@types/app.d.ts +57 -20
  2. package/build/@types/app.js +14 -1
  3. package/build/@types/form.d.ts +17 -10
  4. package/build/api/auth.d.ts +24 -2
  5. package/build/api/auth.js +36 -1
  6. package/build/api/axios.js +2 -2
  7. package/build/api/brand.d.ts +2 -1
  8. package/build/api/brand.js +10 -1
  9. package/build/api/country.d.ts +3 -1
  10. package/build/api/country.js +3 -1
  11. package/build/api/data.d.ts +38 -7
  12. package/build/api/data.js +57 -17
  13. package/build/api/entity.d.ts +28 -5
  14. package/build/api/entity.js +23 -9
  15. package/build/api/firebase.d.ts +1 -1
  16. package/build/api/firebase.js +3 -1
  17. package/build/api/index.d.ts +41 -14
  18. package/build/api/individual.d.ts +76 -19
  19. package/build/api/individual.js +29 -2
  20. package/build/api/lead.d.ts +8 -6
  21. package/build/app/rootReducer.d.ts +1 -1
  22. package/build/app/rootReducer.js +2 -2
  23. package/build/app/settings.d.ts +8 -2
  24. package/build/app/settings.js +29 -12
  25. package/build/app/store.d.ts +3 -3
  26. package/build/assets/locales/ar.json +256 -179
  27. package/build/assets/locales/en.json +188 -104
  28. package/build/components/AnimationFlow/AnimationFlow.d.ts +5 -1
  29. package/build/components/AnimationFlow/AnimationFlow.js +6 -8
  30. package/build/components/AnimationFlow/BottomSheet.d.ts +2 -1
  31. package/build/components/AnimationFlow/BottomSheet.js +4 -3
  32. package/build/components/AnimationFlow/Dialog.d.ts +5 -1
  33. package/build/components/AnimationFlow/Dialog.js +11 -5
  34. package/build/components/ArabicDatePicker/ArabicDatePicker.d.ts +13 -0
  35. package/build/components/ArabicDatePicker/ArabicDatePicker.js +94 -0
  36. package/build/components/ArabicDatePicker/index.d.ts +2 -0
  37. package/build/components/ArabicDatePicker/index.js +2 -0
  38. package/build/components/ArabicDatePicker/style.css +24 -0
  39. package/build/components/FileInput/DragAndDrop.d.ts +10 -1
  40. package/build/components/FileInput/DragAndDrop.js +107 -8
  41. package/build/components/Lottie/Lottie.d.ts +878 -0
  42. package/build/components/Lottie/Lottie.js +58 -0
  43. package/build/components/Lottie/files/pulsating_circle_waves.json +236 -0
  44. package/build/components/Lottie/files/success.json +425 -0
  45. package/build/components/Lottie/index.d.ts +3 -0
  46. package/build/components/Lottie/index.js +3 -0
  47. package/build/components/OTPField/OTPField.d.ts +2 -1
  48. package/build/components/OTPField/OTPField.js +2 -2
  49. package/build/components/OTPTimer/OTPTimer.js +1 -1
  50. package/build/components/ProgressBar/CircularProgressBar.d.ts +14 -0
  51. package/build/components/ProgressBar/CircularProgressBar.js +48 -0
  52. package/build/components/ProgressBar/index.d.ts +2 -0
  53. package/build/components/ProgressBar/index.js +2 -0
  54. package/build/components/RadioLabel/RadioLabel.d.ts +2 -1
  55. package/build/components/RadioLabel/RadioLabel.js +2 -2
  56. package/build/components/SocialMediaGroup/SocialMediaGroup.d.ts +1 -4
  57. package/build/components/SocialMediaGroup/SocialMediaGroup.js +3 -55
  58. package/build/constants/api.d.ts +6 -0
  59. package/build/constants/api.js +14 -1
  60. package/build/constants/app.d.ts +7 -5
  61. package/build/constants/app.js +55 -22
  62. package/build/constants/assets.d.ts +20 -1
  63. package/build/constants/assets.js +27 -8
  64. package/build/constants/dummy.d.ts +1 -1
  65. package/build/constants/dummy.js +2 -2
  66. package/build/constants/validation.d.ts +8 -0
  67. package/build/constants/validation.js +9 -1
  68. package/build/features/app/auth/authStore.d.ts +47 -0
  69. package/build/features/app/auth/authStore.js +265 -0
  70. package/build/features/app/bank/bankStore.d.ts +16 -0
  71. package/build/features/app/bank/bankStore.js +81 -37
  72. package/build/features/app/business/businessStore.d.ts +22 -3
  73. package/build/features/app/business/businessStore.js +430 -290
  74. package/build/features/app/connect/connectStore.d.ts +33 -30
  75. package/build/features/app/connect/connectStore.js +398 -258
  76. package/build/features/app/entity/entityStore.d.ts +5 -0
  77. package/build/features/app/entity/entityStore.js +153 -14
  78. package/build/features/app/individual/individualStore.d.ts +17 -0
  79. package/build/features/app/individual/individualStore.js +167 -83
  80. package/build/features/app/password/passwordStore.js +1 -1
  81. package/build/features/app/tax/taxStore.js +3 -2
  82. package/build/features/auth/Auth.d.ts +10 -0
  83. package/build/features/auth/Auth.js +87 -0
  84. package/build/features/auth/index.d.ts +1 -0
  85. package/build/features/auth/index.js +1 -0
  86. package/build/features/auth/screens/NID/DOB.d.ts +7 -0
  87. package/build/features/auth/screens/NID/DOB.js +47 -0
  88. package/build/features/auth/screens/NID/IDNumber.d.ts +3 -0
  89. package/build/features/auth/screens/NID/IDNumber.js +64 -0
  90. package/build/features/auth/screens/NID/NID.d.ts +5 -0
  91. package/build/features/auth/screens/NID/NID.js +67 -0
  92. package/build/features/auth/screens/NID/TAC.d.ts +3 -0
  93. package/build/features/auth/screens/NID/TAC.js +87 -0
  94. package/build/features/auth/screens/NID/index.d.ts +3 -0
  95. package/build/features/auth/screens/NID/index.js +2 -0
  96. package/build/features/auth/screens/NID/validation.d.ts +27 -0
  97. package/build/features/auth/screens/NID/validation.js +19 -0
  98. package/build/features/auth/screens/OTP/OTP.d.ts +5 -0
  99. package/build/features/auth/screens/OTP/OTP.js +76 -0
  100. package/build/features/{otp/screens/OTPVerify/Verify.d.ts → auth/screens/OTP/OTPInput.d.ts} +0 -0
  101. package/build/features/{otp/screens/OTPVerify → auth/screens/OTP}/OTPInput.js +11 -7
  102. package/build/features/auth/screens/OTP/index.d.ts +3 -0
  103. package/build/features/auth/screens/OTP/index.js +2 -0
  104. package/build/features/{otp/screens/OTPVerify → auth/screens/OTP}/validation.d.ts +0 -0
  105. package/build/features/{otp/screens/OTPVerify → auth/screens/OTP}/validation.js +0 -0
  106. package/build/features/bank/Bank.js +12 -6
  107. package/build/features/bank/screens/BankDetails/BankDetails.js +2 -2
  108. package/build/features/bank/screens/BankDetails/BankStatement.js +41 -8
  109. package/build/features/bank/screens/BankDetails/Beneficiary.js +10 -11
  110. package/build/features/bank/screens/BankDetails/validation.js +2 -2
  111. package/build/features/bank/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +12 -8
  112. package/build/features/business/Business.d.ts +1 -1
  113. package/build/features/business/Business.js +14 -7
  114. package/build/features/business/screens/Activities/Activities.js +1 -6
  115. package/build/features/business/screens/Activities/ActivitiesList.d.ts +37 -1
  116. package/build/features/business/screens/Activities/ActivitiesList.js +51 -12
  117. package/build/features/business/screens/Activities/OperationStartDate.d.ts +15 -1
  118. package/build/features/business/screens/Activities/OperationStartDate.js +21 -2
  119. package/build/features/business/screens/Activities/validation.d.ts +0 -51
  120. package/build/features/business/screens/Activities/validation.js +0 -9
  121. package/build/features/business/screens/BusinessType/BusinessType.js +20 -7
  122. package/build/features/business/screens/BusinessType/EntityName.d.ts +6 -0
  123. package/build/features/business/screens/BusinessType/EntityName.js +56 -0
  124. package/build/features/business/screens/BusinessType/LicenseCertificate.d.ts +6 -0
  125. package/build/features/business/screens/BusinessType/LicenseCertificate.js +76 -0
  126. package/build/features/business/screens/BusinessType/LicenseList.js +24 -7
  127. package/build/features/business/screens/BusinessType/LicenseNumber.js +14 -8
  128. package/build/features/business/screens/BusinessType/LicenseType.d.ts +6 -0
  129. package/build/features/business/screens/BusinessType/LicenseType.js +67 -0
  130. package/build/features/business/screens/BusinessType/validation.d.ts +19 -0
  131. package/build/features/business/screens/BusinessType/validation.js +50 -1
  132. package/build/features/business/screens/CivilID/CivilID.d.ts +5 -0
  133. package/build/features/business/screens/CivilID/CivilID.js +84 -0
  134. package/build/features/business/screens/CivilID/IDNumber.d.ts +7 -0
  135. package/build/features/business/screens/CivilID/IDNumber.js +59 -0
  136. package/build/features/business/screens/CivilID/index.d.ts +3 -0
  137. package/build/features/business/screens/CivilID/index.js +2 -0
  138. package/build/features/business/screens/CivilID/validation.d.ts +8 -0
  139. package/build/features/business/screens/CivilID/validation.js +4 -0
  140. package/build/features/business/screens/Customers/CustomerLocations.d.ts +15 -2
  141. package/build/features/business/screens/Customers/CustomerLocations.js +32 -8
  142. package/build/features/business/screens/Customers/ExpectedCustomers.js +16 -4
  143. package/build/features/business/screens/Customers/ExpectedSalesRange.js +32 -14
  144. package/build/features/business/screens/Customers/RefundPolicy.js +8 -2
  145. package/build/features/business/screens/Customers/TransactionPolicy.js +8 -2
  146. package/build/features/business/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +10 -7
  147. package/build/features/business/screens/Verify/Verify.js +4 -4
  148. package/build/features/business/screens/VerifyPACI/VerifyPACI.d.ts +5 -0
  149. package/build/features/business/screens/VerifyPACI/VerifyPACI.js +157 -0
  150. package/build/features/business/screens/VerifyPACI/VerifyPACILoading.d.ts +5 -0
  151. package/build/features/business/screens/VerifyPACI/VerifyPACILoading.js +22 -0
  152. package/build/features/business/screens/VerifyPACI/VerifyPACISuccess.d.ts +5 -0
  153. package/build/features/business/screens/VerifyPACI/VerifyPACISuccess.js +8 -0
  154. package/build/features/business/screens/VerifyPACI/index.d.ts +3 -0
  155. package/build/features/business/screens/VerifyPACI/index.js +2 -0
  156. package/build/features/connect/Connect.d.ts +2 -1
  157. package/build/features/connect/Connect.js +47 -12
  158. package/build/features/connect/screens/CivilID/CivilID.d.ts +5 -0
  159. package/build/features/connect/screens/CivilID/CivilID.js +98 -0
  160. package/build/features/connect/screens/CivilID/IDNumber.d.ts +7 -0
  161. package/build/features/connect/screens/CivilID/IDNumber.js +59 -0
  162. package/build/features/connect/screens/CivilID/index.d.ts +3 -0
  163. package/build/features/connect/screens/CivilID/index.js +2 -0
  164. package/build/features/connect/screens/CivilID/validation.d.ts +8 -0
  165. package/build/features/connect/screens/CivilID/validation.js +4 -0
  166. package/build/features/connect/screens/Individual/Email.js +11 -3
  167. package/build/features/connect/screens/Individual/Individual.js +27 -14
  168. package/build/features/connect/screens/Merchant/BrandList.js +15 -7
  169. package/build/features/connect/screens/Merchant/BrandName.js +7 -4
  170. package/build/features/connect/screens/Merchant/Merchant.js +47 -50
  171. package/build/features/connect/screens/Merchant/SalesChannels.d.ts +7 -0
  172. package/build/features/connect/screens/Merchant/SalesChannels.js +113 -0
  173. package/build/features/connect/screens/Merchant/SocialMedia.d.ts +1 -4
  174. package/build/features/connect/screens/Merchant/SocialMedia.js +131 -66
  175. package/build/features/connect/screens/Merchant/TAC.js +8 -2
  176. package/build/features/connect/screens/Merchant/validation.d.ts +22 -45
  177. package/build/features/connect/screens/Merchant/validation.js +117 -116
  178. package/build/features/connect/screens/Mobile/Mobile.js +31 -10
  179. package/build/features/connect/screens/NID/NID.js +2 -1
  180. package/build/features/connect/screens/OTP/OTP.js +5 -4
  181. package/build/features/connect/screens/OTP/OTPInput.js +3 -2
  182. package/build/features/connect/screens/VerifyPACI/VerifyPACI.d.ts +5 -0
  183. package/build/features/connect/screens/VerifyPACI/VerifyPACI.js +159 -0
  184. package/build/features/connect/screens/VerifyPACI/VerifyPACILoading.d.ts +5 -0
  185. package/build/features/connect/screens/VerifyPACI/VerifyPACILoading.js +22 -0
  186. package/build/features/connect/screens/VerifyPACI/VerifyPACISuccess.d.ts +5 -0
  187. package/build/features/connect/screens/VerifyPACI/VerifyPACISuccess.js +8 -0
  188. package/build/features/connect/screens/VerifyPACI/index.d.ts +3 -0
  189. package/build/features/connect/screens/VerifyPACI/index.js +2 -0
  190. package/build/features/entity/Entity.d.ts +1 -1
  191. package/build/features/entity/Entity.js +16 -9
  192. package/build/features/entity/screens/EntityInfoConfirm/ActivitiesList.d.ts +54 -0
  193. package/build/features/entity/screens/EntityInfoConfirm/ActivitiesList.js +140 -0
  194. package/build/features/entity/screens/EntityInfoConfirm/EntityInfo.js +52 -2
  195. package/build/features/entity/screens/EntityInfoConfirm/LicenseName.d.ts +5 -0
  196. package/build/features/entity/screens/EntityInfoConfirm/LicenseName.js +17 -0
  197. package/build/features/entity/screens/EntityInfoConfirm/LicenseNumber.d.ts +5 -0
  198. package/build/features/entity/screens/EntityInfoConfirm/LicenseNumber.js +28 -0
  199. package/build/features/entity/screens/EntityInfoConfirm/OperationStartDate.d.ts +6 -0
  200. package/build/features/entity/screens/EntityInfoConfirm/OperationStartDate.js +38 -0
  201. package/build/features/{business/screens/Activities → entity/screens/EntityInfoConfirm}/SalesChannels.d.ts +0 -0
  202. package/build/features/{business/screens/Activities → entity/screens/EntityInfoConfirm}/SalesChannels.js +8 -5
  203. package/build/features/entity/screens/EntityInfoConfirm/validation.d.ts +107 -0
  204. package/build/features/entity/screens/EntityInfoConfirm/validation.js +17 -0
  205. package/build/features/entity/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +6 -5
  206. package/build/features/featuresScreens.d.ts +1 -1
  207. package/build/features/featuresScreens.js +31 -6
  208. package/build/features/individual/Individual.d.ts +1 -1
  209. package/build/features/individual/Individual.js +14 -7
  210. package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +1 -1
  211. package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +15 -3
  212. package/build/features/individual/screens/AdditionalIndividualInfo/Occupation.js +11 -3
  213. package/build/features/individual/screens/AdditionalIndividualInfo/SourceOfIncome.js +2 -2
  214. package/build/features/individual/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +12 -8
  215. package/build/features/individual/screens/Verify/Verify.js +4 -4
  216. package/build/features/password/Password.d.ts +1 -1
  217. package/build/features/password/Password.js +14 -7
  218. package/build/features/password/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +12 -9
  219. package/build/features/shared/Background/Background.d.ts +6 -5
  220. package/build/features/shared/Background/Background.js +16 -5
  221. package/build/features/shared/Button/EmailProvidersButtons.d.ts +2 -1
  222. package/build/features/shared/Button/EmailProvidersButtons.js +7 -2
  223. package/build/features/shared/Button/MobileButton.d.ts +2 -1
  224. package/build/features/shared/Button/MobileButton.js +2 -2
  225. package/build/features/shared/Dialog/CloseDialog.d.ts +11 -0
  226. package/build/features/shared/Dialog/CloseDialog.js +71 -0
  227. package/build/features/shared/Dialog/DialogContainer.d.ts +8 -0
  228. package/build/features/shared/Dialog/DialogContainer.js +56 -0
  229. package/build/features/shared/Dialog/index.d.ts +4 -0
  230. package/build/features/shared/Dialog/index.js +4 -0
  231. package/build/features/shared/Input/Input.d.ts +1 -1
  232. package/build/features/shared/Input/Input.js +2 -2
  233. package/build/features/shared/SuccessScreen/SuccessScreen.js +1 -1
  234. package/build/features/shared/UploadFile/UploadFile.d.ts +9 -3
  235. package/build/features/shared/UploadFile/UploadFile.js +23 -8
  236. package/build/features/signIn/SignIn.d.ts +1 -1
  237. package/build/features/signIn/SignIn.js +14 -6
  238. package/build/features/tax/Tax.d.ts +1 -1
  239. package/build/features/tax/Tax.js +16 -8
  240. package/build/features/tax/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +11 -7
  241. package/build/hooks/index.d.ts +1 -0
  242. package/build/hooks/index.js +1 -0
  243. package/build/hooks/useAppConfig.d.ts +3 -1
  244. package/build/hooks/useAppConfig.js +4 -2
  245. package/build/hooks/useAppDispatch.d.ts +1 -1
  246. package/build/hooks/useErrorListener.js +0 -5
  247. package/build/hooks/useScreen.d.ts +3 -0
  248. package/build/hooks/useScreen.js +14 -0
  249. package/build/index.d.ts +3 -3
  250. package/build/index.js +5 -5
  251. package/build/utils/array.d.ts +13 -1
  252. package/build/utils/array.js +26 -0
  253. package/build/utils/common.d.ts +1 -0
  254. package/build/utils/common.js +3 -0
  255. package/build/utils/device.d.ts +1 -0
  256. package/build/utils/device.js +13 -0
  257. package/build/utils/html.d.ts +1 -0
  258. package/build/utils/html.js +6 -0
  259. package/build/utils/index.d.ts +1 -0
  260. package/build/utils/index.js +1 -0
  261. package/build/utils/locale.js +1 -1
  262. package/build/utils/object.d.ts +1 -0
  263. package/build/utils/object.js +12 -0
  264. package/build/utils/rsa.d.ts +2 -2
  265. package/build/utils/rsa.js +1 -1
  266. package/build/utils/string.d.ts +33 -20
  267. package/build/utils/string.js +71 -1
  268. package/build/utils/validation.d.ts +2 -0
  269. package/build/utils/validation.js +6 -0
  270. package/package.json +129 -128
  271. package/build/features/app/otp/otpStore.d.ts +0 -28
  272. package/build/features/app/otp/otpStore.js +0 -153
  273. package/build/features/otp/OTP.d.ts +0 -7
  274. package/build/features/otp/OTP.js +0 -55
  275. package/build/features/otp/index.d.ts +0 -0
  276. package/build/features/otp/index.js +0 -1
  277. package/build/features/otp/screens/OTPVerify/OTPInput.d.ts +0 -6
  278. package/build/features/otp/screens/OTPVerify/Verify.js +0 -50
  279. package/build/features/otp/screens/OTPVerify/index.d.ts +0 -2
  280. package/build/features/otp/screens/OTPVerify/index.js +0 -2
@@ -12,6 +12,19 @@ export declare const InputLabelStyled: import("@emotion/styled").StyledComponent
12
12
  } & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "key" | keyof React.HTMLAttributes<HTMLSpanElement>> & {
13
13
  ref?: ((instance: HTMLSpanElement | null) => void) | React.RefObject<HTMLSpanElement> | null | undefined;
14
14
  }, keyof import("@mui/material/OverridableComponent").CommonProps | ("border" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "borderColor" | "borderRadius" | "display" | "displayPrint" | "overflow" | "textOverflow" | "visibility" | "whiteSpace" | "flexBasis" | "flexDirection" | "flexWrap" | "justifyContent" | "alignItems" | "alignContent" | "order" | "flex" | "flexGrow" | "flexShrink" | "alignSelf" | "justifyItems" | "justifySelf" | "gap" | "columnGap" | "rowGap" | "gridColumn" | "gridRow" | "gridAutoFlow" | "gridAutoColumns" | "gridAutoRows" | "gridTemplateColumns" | "gridTemplateRows" | "gridTemplateAreas" | "gridArea" | "bgcolor" | "color" | "zIndex" | "position" | "top" | "right" | "bottom" | "left" | "boxShadow" | "width" | "maxWidth" | "minWidth" | "height" | "maxHeight" | "minHeight" | "boxSizing" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "my" | "p" | "pt" | "pr" | "pb" | "pl" | "px" | "py" | "margin" | "marginTop" | "marginRight" | "marginBottom" | "marginLeft" | "marginX" | "marginY" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "paddingX" | "paddingY" | "typography" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "lineHeight" | "textAlign" | "textTransform") | "children" | "sx" | "variant" | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
15
+ export declare const BaseLabelStyled: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material/styles").Theme> & {
16
+ align?: "right" | "left" | "inherit" | "center" | "justify" | undefined;
17
+ children?: React.ReactNode;
18
+ classes?: Partial<import("@mui/material").TypographyClasses> | undefined;
19
+ gutterBottom?: boolean | undefined;
20
+ noWrap?: boolean | undefined;
21
+ paragraph?: boolean | undefined;
22
+ sx?: import("@mui/material/styles").SxProps<import("@mui/material/styles").Theme> | undefined;
23
+ variant?: "button" | "caption" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "inherit" | "overline" | "subtitle1" | "subtitle2" | "body1" | "body2" | undefined;
24
+ variantMapping?: Partial<Record<"button" | "caption" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "inherit" | "overline" | "subtitle1" | "subtitle2" | "body1" | "body2", string>> | undefined;
25
+ } & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "key" | keyof React.HTMLAttributes<HTMLSpanElement>> & {
26
+ ref?: ((instance: HTMLSpanElement | null) => void) | React.RefObject<HTMLSpanElement> | null | undefined;
27
+ }, keyof import("@mui/material/OverridableComponent").CommonProps | ("border" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "borderColor" | "borderRadius" | "display" | "displayPrint" | "overflow" | "textOverflow" | "visibility" | "whiteSpace" | "flexBasis" | "flexDirection" | "flexWrap" | "justifyContent" | "alignItems" | "alignContent" | "order" | "flex" | "flexGrow" | "flexShrink" | "alignSelf" | "justifyItems" | "justifySelf" | "gap" | "columnGap" | "rowGap" | "gridColumn" | "gridRow" | "gridAutoFlow" | "gridAutoColumns" | "gridAutoRows" | "gridTemplateColumns" | "gridTemplateRows" | "gridTemplateAreas" | "gridArea" | "bgcolor" | "color" | "zIndex" | "position" | "top" | "right" | "bottom" | "left" | "boxShadow" | "width" | "maxWidth" | "minWidth" | "height" | "maxHeight" | "minHeight" | "boxSizing" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "my" | "p" | "pt" | "pr" | "pb" | "pl" | "px" | "py" | "margin" | "marginTop" | "marginRight" | "marginBottom" | "marginLeft" | "marginX" | "marginY" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "paddingX" | "paddingY" | "typography" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "lineHeight" | "textAlign" | "textTransform") | "children" | "sx" | "variant" | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
15
28
  export declare const InputStyled: import("@emotion/styled").StyledComponent<Pick<import("../../../../components/Input").InputProps, "name" | "type" | "className" | "style" | "classes" | "color" | "margin" | "translate" | "slot" | "title" | "ref" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "sx" | "size" | "disabled" | "error" | "components" | "componentsProps" | "value" | "autoFocus" | "fullWidth" | "required" | "rows" | "inputProps" | "inputRef" | "readOnly" | "autoComplete" | "disableInjectingGlobalStyles" | "endAdornment" | "inputComponent" | "multiline" | "renderSuffix" | "maxRows" | "minRows" | "startAdornment" | "disableUnderline" | "onEnterPressed" | "warningMessage"> & {
16
29
  placeholder?: string | undefined;
17
30
  hide?: boolean | undefined;
@@ -35,7 +48,7 @@ export declare const NameContainer: import("@emotion/styled").StyledComponent<im
35
48
  export declare const CheckIconStyled: import("@emotion/styled").StyledComponent<{
36
49
  children?: React.ReactNode;
37
50
  classes?: Partial<import("@mui/material").SvgIconClasses> | undefined;
38
- color?: "inherit" | "disabled" | "error" | "info" | "primary" | "secondary" | "action" | "success" | "warning" | undefined;
51
+ color?: "inherit" | "disabled" | "error" | "success" | "info" | "primary" | "secondary" | "action" | "warning" | undefined;
39
52
  fontSize?: "small" | "inherit" | "medium" | "large" | undefined;
40
53
  htmlColor?: string | undefined;
41
54
  inheritViewBox?: boolean | undefined;
@@ -49,7 +62,7 @@ export declare const CheckIconStyled: import("@emotion/styled").StyledComponent<
49
62
  export declare const RemainingCheck: import("@emotion/styled").StyledComponent<{
50
63
  children?: React.ReactNode;
51
64
  classes?: Partial<import("@mui/material").SvgIconClasses> | undefined;
52
- color?: "inherit" | "disabled" | "error" | "info" | "primary" | "secondary" | "action" | "success" | "warning" | undefined;
65
+ color?: "inherit" | "disabled" | "error" | "success" | "info" | "primary" | "secondary" | "action" | "warning" | undefined;
53
66
  fontSize?: "small" | "inherit" | "medium" | "large" | undefined;
54
67
  htmlColor?: string | undefined;
55
68
  inheritViewBox?: boolean | undefined;
@@ -20,7 +20,7 @@ var __rest = (this && this.__rest) || function (s, e) {
20
20
  }
21
21
  return t;
22
22
  };
23
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
23
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
24
24
  import * as React from 'react';
25
25
  import Box from '@mui/material/Box';
26
26
  import { useTranslation } from 'react-i18next';
@@ -31,14 +31,21 @@ import Collapse from '../../../../components/Collapse';
31
31
  import CheckIcon from '@mui/icons-material/Check';
32
32
  import ExpandIcon from '../../../../components/ExpandIcon';
33
33
  import Input from '../../../../components/Input';
34
+ import Tooltip from '../../../../components/Tooltip';
34
35
  import SimpleList from '../../../../components/SimpleList';
35
36
  import { ScreenContainer } from '../../../shared/Containers';
36
37
  import { useLanguage, useAppSelector, useAppDispatch } from '../../../../hooks';
37
38
  import { businessSelector, clearError } from '../../../app/business/businessStore';
39
+ import Search from '../../../../features/shared/Search';
40
+ import { InfoIconStyled, InfoOutlinedIconStyled, LabelContainerStyled } from '../Activities/ActivitiesList';
38
41
  export var InputLabelStyled = styled(Text)(function (_a) {
39
42
  var theme = _a.theme;
40
43
  return (__assign({ margin: theme.spacing(2.5, 2.5, 1.5, 2.5), color: alpha(theme.palette.text.primary, 0.4) }, theme.typography.caption));
41
44
  });
45
+ export var BaseLabelStyled = styled(Text)(function (_a) {
46
+ var theme = _a.theme;
47
+ return (__assign({ color: alpha(theme.palette.text.primary, 0.4) }, theme.typography.caption));
48
+ });
42
49
  export var InputStyled = styled(Input)(function (_a) {
43
50
  var theme = _a.theme;
44
51
  return ({
@@ -81,6 +88,7 @@ var customerLocations = function (_a) {
81
88
  var dispatch = useAppDispatch();
82
89
  var customerLocationsControl = useController({ name: 'customerLocations', control: control });
83
90
  var _d = useAppSelector(businessSelector), data = _d.data, error = _d.error;
91
+ var _e = React.useState(false), isHovered = _e[0], setIsHovered = _e[1];
84
92
  var activitiesData = data.activitiesData;
85
93
  var response = activitiesData.responseBody;
86
94
  var onOpenList = function (event) {
@@ -89,9 +97,12 @@ var customerLocations = function (_a) {
89
97
  (_a = rest.onListOpen) === null || _a === void 0 ? void 0 : _a.call(rest);
90
98
  };
91
99
  var onCloseList = function () {
92
- var _a;
100
+ var _a, _b;
93
101
  setAnchorEl(null);
94
102
  (_a = rest.onListClose) === null || _a === void 0 ? void 0 : _a.call(rest);
103
+ if (((_b = response === null || response === void 0 ? void 0 : response.customerBases) === null || _b === void 0 ? void 0 : _b.length) > 0) {
104
+ setCustomerLocationsList(response === null || response === void 0 ? void 0 : response.customerBases);
105
+ }
95
106
  };
96
107
  React.useEffect(function () {
97
108
  var _a;
@@ -106,15 +117,28 @@ var customerLocations = function (_a) {
106
117
  };
107
118
  var onSelectItem = function (customerLocations) {
108
119
  onCloseList();
109
- var remaining = customerLocationsList.filter(function (location) { return location.id <= customerLocations.id; });
120
+ var checked = customerLocationsList.filter(function (location) { return (location === null || location === void 0 ? void 0 : location.code) === customerLocations.code; });
121
+ if (customerLocations.code === 'regional')
122
+ customerLocationsControl.field.onChange(checked.concat(customerLocationsList.filter(function (location) { return (location === null || location === void 0 ? void 0 : location.code) === 'local'; })));
123
+ else if (customerLocations.code === 'global')
124
+ customerLocationsControl.field.onChange(checked.concat(customerLocationsList.filter(function (location) { return (location === null || location === void 0 ? void 0 : location.code) != customerLocations.code; })));
125
+ else if (customerLocations.code === 'local')
126
+ customerLocationsControl.field.onChange(checked);
110
127
  if (error)
111
128
  dispatch(clearError());
112
- customerLocationsControl.field.onChange(remaining);
129
+ };
130
+ var handleSearch = function (value) {
131
+ var _a;
132
+ var filteredList = (_a = response === null || response === void 0 ? void 0 : response.customerBases) === null || _a === void 0 ? void 0 : _a.filter(function (location) {
133
+ return location.name.en.toLowerCase().startsWith(value.toLowerCase()) ||
134
+ location.name.ar.toLowerCase().startsWith(value.toLowerCase());
135
+ });
136
+ setCustomerLocationsList(filteredList);
113
137
  };
114
138
  var customerLocationsValue = customerLocationsControl.field.value;
115
- var customerLocationSelected = customerLocationsValue[customerLocationsValue.length - 1];
116
- return (_jsx(Collapse, __assign({ in: rest.show }, { children: _jsxs(ScreenContainer, { children: [_jsx(InputLabelStyled, { children: t('select_customer_base') }), _jsx(InputStyled, { readOnly: true, value: isAr ? customerLocationSelected === null || customerLocationSelected === void 0 ? void 0 : customerLocationSelected.name_ar : customerLocationSelected === null || customerLocationSelected === void 0 ? void 0 : customerLocationSelected.name_en, onClick: !!anchorEl ? function () { return onCloseList(); } : onOpenList, endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }) }), _jsx(Collapse, __assign({ in: !!anchorEl, timeout: 300 }, { children: _jsx(SimpleListStyled, { searchKeyPath: 'name', list: customerLocationsList, placeholder: 'choose_customer_base', onSelectItem: onSelectItem, renderItem: function (item) {
117
- return (_jsxs(_Fragment, { children: [_jsx(Box, __assign({ display: 'flex' }, { children: _jsx(NameContainer, __assign({ isSelected: (item === null || item === void 0 ? void 0 : item.id) === (customerLocationsValue === null || customerLocationsValue === void 0 ? void 0 : customerLocationsValue.id) }, { children: isAr ? item.name_ar : item.name_en })) })), item.id === (customerLocationSelected === null || customerLocationSelected === void 0 ? void 0 : customerLocationSelected.id) && _jsx(CheckIconStyled, {}), checkRemainingCondition(item) && item.id != (customerLocationSelected === null || customerLocationSelected === void 0 ? void 0 : customerLocationSelected.id) && _jsx(RemainingCheck, {})] }));
118
- } }) }))] }) })));
139
+ var customerLocationSelected = customerLocationsValue === null || customerLocationsValue === void 0 ? void 0 : customerLocationsValue[0];
140
+ return (_jsx(Collapse, __assign({ in: rest.show }, { children: _jsxs(ScreenContainer, { children: [_jsxs(LabelContainerStyled, { children: [_jsx(BaseLabelStyled, { children: t('select_customer_base') }), _jsx(Tooltip, __assign({ title: t('customer_base_name_hint'), onMouseOver: function () { return setIsHovered(true); }, onMouseLeave: function () { return setIsHovered(false); }, onTouchStartCapture: function () { return setIsHovered(true); } }, { children: isHovered ? _jsx(InfoIconStyled, {}) : _jsx(InfoOutlinedIconStyled, {}) }))] }), _jsx(InputStyled, { readOnly: true, placeholder: t('choose_expected_sales'), value: isAr ? customerLocationSelected === null || customerLocationSelected === void 0 ? void 0 : customerLocationSelected.name.ar : customerLocationSelected === null || customerLocationSelected === void 0 ? void 0 : customerLocationSelected.name.en, onClick: !!anchorEl ? function () { return onCloseList(); } : onOpenList, endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }) }), _jsxs(Collapse, __assign({ in: !!anchorEl, timeout: 300 }, { children: [_jsx(Search, { onSearchValue: handleSearch }), _jsx(SimpleListStyled, { searchKeyPath: 'name.en', list: customerLocationsList, placeholder: 'choose_customer_base', onSelectItem: onSelectItem, renderItem: function (item) {
141
+ return (_jsxs(_Fragment, { children: [_jsx(Box, __assign({ display: 'flex' }, { children: _jsx(NameContainer, __assign({ isSelected: (item === null || item === void 0 ? void 0 : item.id) === (customerLocationsValue === null || customerLocationsValue === void 0 ? void 0 : customerLocationsValue.id) }, { children: isAr ? item.name.ar : item.name.en })) })), item.id === (customerLocationSelected === null || customerLocationSelected === void 0 ? void 0 : customerLocationSelected.id) && _jsx(CheckIconStyled, {}), checkRemainingCondition(item) && item.id != (customerLocationSelected === null || customerLocationSelected === void 0 ? void 0 : customerLocationSelected.id) && _jsx(RemainingCheck, {})] }));
142
+ } })] }))] }) })));
119
143
  };
120
144
  export default React.memo(customerLocations);
@@ -33,6 +33,7 @@ import ExpandIcon from '../../../../components/ExpandIcon';
33
33
  import { ScreenContainer } from '../../../shared/Containers';
34
34
  import { CheckIconStyled, InputLabelStyled, InputStyled, NameContainer } from './CustomerLocations';
35
35
  import { businessSelector, clearError } from '../../../app/business/businessStore';
36
+ import Search from '../../../../features/shared/Search';
36
37
  var ListItemContainer = styled(Box)(function (_a) {
37
38
  var theme = _a.theme;
38
39
  return ({
@@ -61,9 +62,12 @@ var ExpectedCustomers = function (_a) {
61
62
  (_a = rest.onListOpen) === null || _a === void 0 ? void 0 : _a.call(rest);
62
63
  };
63
64
  var onCloseList = function () {
64
- var _a;
65
+ var _a, _b;
65
66
  setAnchorEl(null);
66
67
  (_a = rest.onListClose) === null || _a === void 0 ? void 0 : _a.call(rest);
68
+ if (((_b = response === null || response === void 0 ? void 0 : response.expectedCustomerSales) === null || _b === void 0 ? void 0 : _b.length) > 0) {
69
+ setExpectedCustomersList(response === null || response === void 0 ? void 0 : response.expectedCustomerSales);
70
+ }
67
71
  };
68
72
  React.useEffect(function () {
69
73
  var _a;
@@ -77,10 +81,18 @@ var ExpectedCustomers = function (_a) {
77
81
  dispatch(clearError());
78
82
  onCloseList();
79
83
  };
84
+ var handleSearch = function (value) {
85
+ var _a;
86
+ var filteredList = (_a = response === null || response === void 0 ? void 0 : response.expectedCustomerSales) === null || _a === void 0 ? void 0 : _a.filter(function (customer) {
87
+ return customer.name.en.toLowerCase().startsWith(value.toLowerCase()) ||
88
+ customer.name.ar.toLowerCase().startsWith(value.toLowerCase());
89
+ });
90
+ setExpectedCustomersList(filteredList);
91
+ };
80
92
  var expectedCustomersValue = expectedCustomerControl.field.value;
81
93
  var expectedCustomersSelected = expectedCustomersValue;
82
- return (_jsx(Collapse, __assign({ in: rest.show }, { children: _jsxs(ScreenContainer, { children: [_jsx(InputLabelStyled, { children: t('expected_customers_to_serve') }), _jsx(InputStyled, { readOnly: true, value: isAr ? expectedCustomersSelected === null || expectedCustomersSelected === void 0 ? void 0 : expectedCustomersSelected.name_ar : expectedCustomersSelected === null || expectedCustomersSelected === void 0 ? void 0 : expectedCustomersSelected.name_en, onClick: !!anchorEl ? function () { return onCloseList(); } : onOpenList, endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }) }), _jsx(Collapse, __assign({ in: !!anchorEl, timeout: 300 }, { children: _jsx(SimpleListStyled, { searchKeyPath: 'name', list: expectedCustomersList, onSelectItem: onSelectItem, renderItem: function (item) {
83
- return (_jsxs(_Fragment, { children: [_jsx(ListItemContainer, { children: _jsx(NameContainer, __assign({ isSelected: (item === null || item === void 0 ? void 0 : item.id) === (expectedCustomersValue === null || expectedCustomersValue === void 0 ? void 0 : expectedCustomersValue.id) }, { children: isAr ? item.name_ar : item.name_en })) }), item.id === (expectedCustomersSelected === null || expectedCustomersSelected === void 0 ? void 0 : expectedCustomersSelected.id) && _jsx(CheckIconStyled, {})] }));
84
- } }) }))] }) })));
94
+ return (_jsx(Collapse, __assign({ in: rest.show }, { children: _jsxs(ScreenContainer, { children: [_jsx(InputLabelStyled, { children: t('expected_customers_to_serve') }), _jsx(InputStyled, { readOnly: true, placeholder: t('choose_expected_sales'), value: isAr ? expectedCustomersSelected === null || expectedCustomersSelected === void 0 ? void 0 : expectedCustomersSelected.name.ar : expectedCustomersSelected === null || expectedCustomersSelected === void 0 ? void 0 : expectedCustomersSelected.name.en, onClick: !!anchorEl ? function () { return onCloseList(); } : onOpenList, endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }) }), _jsxs(Collapse, __assign({ in: !!anchorEl, timeout: 300 }, { children: [_jsx(Search, { onSearchValue: handleSearch }), _jsx(SimpleListStyled, { searchKeyPath: 'name', list: expectedCustomersList, onSelectItem: onSelectItem, renderItem: function (item) {
95
+ return (_jsxs(_Fragment, { children: [_jsx(ListItemContainer, { children: _jsx(NameContainer, __assign({ isSelected: (item === null || item === void 0 ? void 0 : item.id) === (expectedCustomersValue === null || expectedCustomersValue === void 0 ? void 0 : expectedCustomersValue.id) }, { children: isAr ? item.name.ar : item.name.en })) }), item.id === (expectedCustomersSelected === null || expectedCustomersSelected === void 0 ? void 0 : expectedCustomersSelected.id) && _jsx(CheckIconStyled, {})] }));
96
+ } })] }))] }) })));
85
97
  };
86
98
  export default ExpectedCustomers;
@@ -23,6 +23,7 @@ import { businessSelector, clearError } from '../../../app/business/businessStor
23
23
  import { isExist } from '../../../../utils';
24
24
  import { ScreenContainer } from '../../../shared/Containers';
25
25
  import { InputLabelStyled, CheckIconStyled, InputStyled, NameContainer } from './CustomerLocations';
26
+ import Search from '../../../../features/shared/Search';
26
27
  var ListItem = styled(Box)(function (_a) {
27
28
  var theme = _a.theme;
28
29
  return ({
@@ -65,6 +66,9 @@ var ExpectedSalesRange = function (_a) {
65
66
  setAnchorEl(null);
66
67
  onListClose === null || onListClose === void 0 ? void 0 : onListClose();
67
68
  handleCloseSubMenu();
69
+ if ((expectedSales === null || expectedSales === void 0 ? void 0 : expectedSales.length) > 0) {
70
+ setExpectedSalesRangeList(expectedSales);
71
+ }
68
72
  };
69
73
  var handleOpenSubMenu = function (index) {
70
74
  if (subIndex === index)
@@ -86,24 +90,38 @@ var ExpectedSalesRange = function (_a) {
86
90
  dispatch(clearError());
87
91
  expectedSaleControl.field.onChange(expectedSalesRange);
88
92
  };
93
+ var handleSearch = function (value) {
94
+ var filteredList = expectedSales === null || expectedSales === void 0 ? void 0 : expectedSales.filter(function (salesRange) {
95
+ var _a, _b, _c;
96
+ return salesRange.name.en.toLowerCase().includes(value.toLowerCase()) ||
97
+ salesRange.name.en.toLowerCase().replace(',', '').includes(value.toLowerCase()) ||
98
+ salesRange.name.ar.toLowerCase().includes(value.toLowerCase()) ||
99
+ ((_a = salesRange.sub) === null || _a === void 0 ? void 0 : _a.find(function (obj) { return obj.name.en.toLowerCase().includes(value.toLowerCase()); })) ||
100
+ ((_b = salesRange.sub) === null || _b === void 0 ? void 0 : _b.find(function (obj) {
101
+ return obj.name.en.toLowerCase().replace(',', '').includes(value.toLowerCase());
102
+ })) ||
103
+ ((_c = salesRange.sub) === null || _c === void 0 ? void 0 : _c.find(function (obj) { return obj.name.ar.toLowerCase().includes(value.toLowerCase()); }));
104
+ });
105
+ setExpectedSalesRangeList(filteredList);
106
+ };
89
107
  React.useEffect(function () {
90
108
  var item = isExist(expectedSales || [], expectedSalesRangeValue === null || expectedSalesRangeValue === void 0 ? void 0 : expectedSalesRangeValue.id);
91
109
  if (item)
92
110
  setSubIndex(item.id);
93
111
  }, [anchorEl, expectedSalesRangeValue]);
94
- return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, { children: [_jsx(InputLabelStyled, { children: t('expected_sales_yearly') }), _jsx(InputStyled, { readOnly: true, value: (isAr ? expectedSalesRangeValue === null || expectedSalesRangeValue === void 0 ? void 0 : expectedSalesRangeValue.name_ar : expectedSalesRangeValue === null || expectedSalesRangeValue === void 0 ? void 0 : expectedSalesRangeValue.name_en) || '', onClick: !!anchorEl ? handleCloseMainMenu : handleOpenMainMenu, placeholder: t('choose_expected_sales'), endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }) }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleListStyled, { sx: { maxHeight: '350px', paddingTop: 0 }, list: expectedSalesRangeList, listItemProps: { sx: { padding: 0 } }, onSelectItem: function (item) {
95
- var isOnlyOneItem = !item.sub || item.sub.length === 1;
96
- if (isOnlyOneItem)
97
- onSelectItem(item);
98
- else
99
- handleOpenSubMenu(item.id);
100
- }, renderItem: function (item) {
101
- var _a;
102
- var isOnlyOneItem = !item.sub || ((_a = item.sub) === null || _a === void 0 ? void 0 : _a.length) === 1;
103
- var showCheck = item.id === (expectedSalesRangeValue === null || expectedSalesRangeValue === void 0 ? void 0 : expectedSalesRangeValue.id) && isOnlyOneItem;
104
- return (_jsxs(ListItemContainer, { children: [_jsxs(ListItem, __assign({ sx: __assign({ bgcolor: 'rgb(196 184 184 / 8%)', borderBottom: '1px solid rgba(227, 232, 238, 0.8)' }, (isOnlyOneItem && { bgcolor: 'inherit', borderBottom: 'none' })) }, { children: [_jsx(NameContainer, __assign({ isSelected: item.id === (expectedSalesRangeValue === null || expectedSalesRangeValue === void 0 ? void 0 : expectedSalesRangeValue.id), sx: __assign({}, (isOnlyOneItem && { paddingInlineStart: '5px' })) }, { children: isAr ? item.name_ar : item.name_en })), showCheck ? _jsx(CheckIconStyled, {}) : !isOnlyOneItem && _jsx(ExpandIcon, { anchorEl: subIndex === item.id })] })), _jsx(Collapse, __assign({ in: item.id === subIndex && !isOnlyOneItem }, { children: _jsx(SimpleListStyled, { sx: { pt: 0, pb: 0 }, list: (!isOnlyOneItem && item.sub) || [], onSelectItem: onSelectItem, listItemProps: { sx: { padding: 0, '&:last-child': { paddingBottom: 0 } } }, renderItem: function (item, idx) {
105
- return (_jsxs(ListItem, __assign({ sx: { mt: idx === 0 ? 1 : 0 } }, { children: [_jsx(NameContainer, __assign({ isSelected: item.id === (expectedSalesRangeValue === null || expectedSalesRangeValue === void 0 ? void 0 : expectedSalesRangeValue.id) }, { children: isAr ? item.name_ar : item.name_en })), item.id === (expectedSalesRangeValue === null || expectedSalesRangeValue === void 0 ? void 0 : expectedSalesRangeValue.id) && _jsx(CheckIconStyled, {})] })));
106
- } }) }))] }));
107
- } }) }))] }) })));
112
+ return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, { children: [_jsx(InputLabelStyled, { children: t('expected_sales_yearly') }), _jsx(InputStyled, { readOnly: true, value: (isAr ? expectedSalesRangeValue === null || expectedSalesRangeValue === void 0 ? void 0 : expectedSalesRangeValue.name.ar : expectedSalesRangeValue === null || expectedSalesRangeValue === void 0 ? void 0 : expectedSalesRangeValue.name.en) || '', onClick: !!anchorEl ? handleCloseMainMenu : handleOpenMainMenu, placeholder: t('choose_expected_sales'), endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }) }), _jsxs(Collapse, __assign({ in: !!anchorEl }, { children: [_jsx(Search, { onSearchValue: handleSearch }), _jsx(SimpleListStyled, { sx: { maxHeight: '350px', paddingTop: 0 }, list: expectedSalesRangeList, listItemProps: { sx: { padding: 0 } }, onSelectItem: function (item) {
113
+ var isOnlyOneItem = !item.sub || item.sub.length === 1;
114
+ if (isOnlyOneItem)
115
+ onSelectItem(item);
116
+ else
117
+ handleOpenSubMenu(item.id);
118
+ }, renderItem: function (item) {
119
+ var _a;
120
+ var isOnlyOneItem = !item.sub || ((_a = item.sub) === null || _a === void 0 ? void 0 : _a.length) === 1;
121
+ var showCheck = item.id === (expectedSalesRangeValue === null || expectedSalesRangeValue === void 0 ? void 0 : expectedSalesRangeValue.id) && isOnlyOneItem;
122
+ return (_jsxs(ListItemContainer, { children: [_jsxs(ListItem, __assign({ sx: __assign({ bgcolor: 'rgb(196 184 184 / 8%)', borderBottom: '1px solid rgba(227, 232, 238, 0.8)' }, (isOnlyOneItem && { bgcolor: 'inherit', borderBottom: 'none' })) }, { children: [_jsx(NameContainer, __assign({ isSelected: item.id === (expectedSalesRangeValue === null || expectedSalesRangeValue === void 0 ? void 0 : expectedSalesRangeValue.id), sx: __assign({}, (isOnlyOneItem && { paddingInlineStart: '5px' })) }, { children: isAr ? item.name.ar : item.name.en })), showCheck ? _jsx(CheckIconStyled, {}) : !isOnlyOneItem && _jsx(ExpandIcon, { anchorEl: subIndex === item.id })] })), _jsx(Collapse, __assign({ in: item.id === subIndex && !isOnlyOneItem }, { children: _jsx(SimpleListStyled, { sx: { pt: 0, pb: 0 }, list: (!isOnlyOneItem && item.sub) || [], onSelectItem: onSelectItem, listItemProps: { sx: { padding: 0, '&:last-child': { paddingBottom: 0 } } }, renderItem: function (item, idx) {
123
+ return (_jsxs(ListItem, __assign({ sx: { mt: idx === 0 ? 1 : 0 } }, { children: [_jsx(NameContainer, __assign({ isSelected: item.id === (expectedSalesRangeValue === null || expectedSalesRangeValue === void 0 ? void 0 : expectedSalesRangeValue.id) }, { children: isAr ? item.name.ar : item.name.en })), item.id === (expectedSalesRangeValue === null || expectedSalesRangeValue === void 0 ? void 0 : expectedSalesRangeValue.id) && _jsx(CheckIconStyled, {})] })));
124
+ } }) }))] }));
125
+ } })] }))] }) })));
108
126
  };
109
127
  export default ExpectedSalesRange;
@@ -20,8 +20,10 @@ import { useController, useFormContext } from 'react-hook-form';
20
20
  import Text from '../../../../components/Text';
21
21
  import Link from '@mui/material/Link';
22
22
  import Warning from '../../../../components/Warning';
23
- import { EXTERNAL_LINKS } from '../../../../constants';
23
+ import { EXTERNAL_LINKS, TAP_WEBSITE } from '../../../../constants';
24
24
  import { ScreenContainer } from '../../../shared/Containers';
25
+ import { settingsSelector } from '../../../../app/settings';
26
+ import { useAppSelector } from '../../../../hooks';
25
27
  export var ContainerStyled = styled(Box)(function (_a) {
26
28
  var theme = _a.theme;
27
29
  return ({
@@ -67,12 +69,16 @@ var RefundPolicy = function () {
67
69
  var t = useTranslation().t;
68
70
  var isAr = useLanguage().isAr;
69
71
  var control = useFormContext().control;
72
+ var settingsData = useAppSelector(settingsSelector).data;
70
73
  var refundControl = useController({ control: control, name: 'refundPolicy' });
71
74
  var refundChecked = refundControl.field.value;
72
75
  var warningMessage = (_a = refundControl.fieldState.error) === null || _a === void 0 ? void 0 : _a.message;
76
+ var countryCode = settingsData.businessCountry.iso2.toLowerCase();
73
77
  var handleRefundCheckedChange = function (event, checked) {
74
78
  refundControl.field.onChange(checked);
75
79
  };
76
- return (_jsxs(ScreenContainer, __assign({ sx: { mt: 2.75 } }, { children: [_jsxs(ContainerStyled, { children: [_jsx(CheckboxStyled, { disableRipple: true, disableFocusRipple: true, focusRipple: false, checked: refundChecked, onChange: handleRefundCheckedChange }), _jsxs(TextStyled, { children: [t('agree_on_refund_policy'), _jsx(LinkStyled, __assign({ href: isAr ? EXTERNAL_LINKS.REFUND_AR : EXTERNAL_LINKS.REFUND_EN, target: '_blank', underline: 'always' }, { children: t('refund_policy_compliance') }))] })] }), _jsx(CollapseStyled, __assign({ in: !!warningMessage }, { children: _jsx(Warning, __assign({ warningType: 'alert' }, { children: warningMessage && t(warningMessage) })) }))] })));
80
+ return (_jsxs(ScreenContainer, __assign({ sx: { mt: 2.75 } }, { children: [_jsxs(ContainerStyled, { children: [_jsx(CheckboxStyled, { disableRipple: true, disableFocusRipple: true, focusRipple: false, checked: refundChecked, onChange: handleRefundCheckedChange }), _jsxs(TextStyled, { children: [t('agree_on_refund_policy'), _jsx(LinkStyled, __assign({ href: isAr
81
+ ? TAP_WEBSITE + countryCode + EXTERNAL_LINKS.REFUND_AR
82
+ : TAP_WEBSITE + countryCode + EXTERNAL_LINKS.REFUND_EN, target: '_blank', underline: 'always' }, { children: t('refund_policy_compliance') }))] })] }), _jsx(CollapseStyled, __assign({ in: !!warningMessage }, { children: _jsx(Warning, __assign({ warningType: 'alert' }, { children: warningMessage && t(warningMessage) })) }))] })));
77
83
  };
78
84
  export default RefundPolicy;
@@ -16,9 +16,11 @@ import { useTranslation } from 'react-i18next';
16
16
  import { useLanguage } from '../../../../hooks';
17
17
  import { useController, useFormContext } from 'react-hook-form';
18
18
  import Warning from '../../../../components/Warning';
19
- import { EXTERNAL_LINKS } from '../../../../constants';
19
+ import { EXTERNAL_LINKS, TAP_WEBSITE } from '../../../../constants';
20
20
  import { ContainerStyled, CheckboxStyled, TextStyled, LinkStyled } from './RefundPolicy';
21
21
  import { ScreenContainer } from '../../../shared/Containers';
22
+ import { settingsSelector } from '../../../../app/settings';
23
+ import { useAppSelector } from '../../../../hooks';
22
24
  var CollapseStyled = styled(Collapse)(function () { return ({
23
25
  width: '100%'
24
26
  }); });
@@ -27,12 +29,16 @@ var TransactionPolicy = function () {
27
29
  var t = useTranslation().t;
28
30
  var isAr = useLanguage().isAr;
29
31
  var control = useFormContext().control;
32
+ var settingsData = useAppSelector(settingsSelector).data;
30
33
  var transactionControl = useController({ control: control, name: 'transactionPolicy' });
31
34
  var transactionChecked = transactionControl.field.value;
32
35
  var warningMessage = (_a = transactionControl.fieldState.error) === null || _a === void 0 ? void 0 : _a.message;
36
+ var countryCode = settingsData.businessCountry.iso2.toLowerCase();
33
37
  var handleTransactionCheckedChange = function (event, checked) {
34
38
  transactionControl.field.onChange(checked);
35
39
  };
36
- return (_jsxs(ScreenContainer, { children: [_jsxs(ContainerStyled, { children: [_jsx(CheckboxStyled, { disableRipple: true, disableFocusRipple: true, focusRipple: false, checked: transactionChecked, onChange: handleTransactionCheckedChange }), _jsxs(TextStyled, { children: [t('agree_on_chargeback_policy'), _jsx(LinkStyled, __assign({ href: isAr ? EXTERNAL_LINKS.TRANSACTION_AR : EXTERNAL_LINKS.TRANSACTION_EN, target: '_blank', underline: 'always' }, { children: t('chargeback_policy') }))] })] }), _jsx(CollapseStyled, __assign({ in: !!warningMessage }, { children: _jsx(Warning, __assign({ warningType: 'alert' }, { children: warningMessage && t(warningMessage) })) }))] }));
40
+ return (_jsxs(ScreenContainer, { children: [_jsxs(ContainerStyled, { children: [_jsx(CheckboxStyled, { disableRipple: true, disableFocusRipple: true, focusRipple: false, checked: transactionChecked, onChange: handleTransactionCheckedChange }), _jsxs(TextStyled, { children: [t('agree_on_chargeback_policy'), _jsx(LinkStyled, __assign({ href: isAr
41
+ ? TAP_WEBSITE + countryCode + EXTERNAL_LINKS.TRANSACTION_AR
42
+ : TAP_WEBSITE + countryCode + EXTERNAL_LINKS.TRANSACTION_EN, target: '_blank', underline: 'always' }, { children: t('chargeback_policy') }))] })] }), _jsx(CollapseStyled, __assign({ in: !!warningMessage }, { children: _jsx(Warning, __assign({ warningType: 'alert' }, { children: warningMessage && t(warningMessage) })) }))] }));
37
43
  };
38
44
  export default TransactionPolicy;
@@ -17,7 +17,7 @@ import { FlowsButtons } from '../../../shared/Button';
17
17
  import { ICONS_NAMES, PASSWORD_OPERATION_TYPE } from '../../../../constants';
18
18
  import { useAppSelector, useLanguage } from '../../../../hooks';
19
19
  import { businessSelector } from '../../../app/business/businessStore';
20
- import { getResetFlowUrl, showLastFour } from '../../../../utils';
20
+ import { concatenateObjectValues, getResetFlowUrl, showLastFour } from '../../../../utils';
21
21
  import Box from '@mui/material/Box';
22
22
  import Text from '../../../../components/Text';
23
23
  import Container from '../../../shared/Containers/ScreenContainer';
@@ -44,13 +44,16 @@ var ButtonGroupStyled = styled(Box)(function (_a) {
44
44
  });
45
45
  });
46
46
  var SuccessWithFlowButtons = function () {
47
- var _a, _b, _c;
47
+ var _a, _b, _c, _d;
48
48
  var t = useTranslation().t;
49
49
  var isAr = useLanguage().isAr;
50
50
  var data = useAppSelector(businessSelector).data;
51
- var _d = data.verify.responseBody || {}, flows = _d.flows, nameObj = _d.name, entity = _d.entity, brand = _d.brand, bank = _d.bank_account, merchant = _d.merchant, identification_id = _d.identification_id;
52
- var _e = useState([]), buttons = _e[0], setButtons = _e[1];
53
- var username = ((nameObj === null || nameObj === void 0 ? void 0 : nameObj.first) || '') + ' ' + ((nameObj === null || nameObj === void 0 ? void 0 : nameObj.last) || '');
51
+ var _e = data.verify.responseBody || {}, flows = _e.flows, nameObj = _e.name, entity = _e.entity, brand = _e.brand, bank = _e.bank_account, merchant = _e.merchant, identification = _e.identification;
52
+ var _f = useState([]), buttons = _f[0], setButtons = _f[1];
53
+ var _g = nameObj || {}, en = _g.en, ar = _g.ar;
54
+ var username = isAr
55
+ ? concatenateObjectValues(ar || en, ['first', 'last'])
56
+ : concatenateObjectValues(en, ['first', 'last']);
54
57
  var licenseNumber = ((_a = entity === null || entity === void 0 ? void 0 : entity.license) === null || _a === void 0 ? void 0 : _a.number) || '';
55
58
  var bankName = (bank === null || bank === void 0 ? void 0 : bank.bank_name) || t('bank');
56
59
  var iban = showLastFour((bank === null || bank === void 0 ? void 0 : bank.iban) || '');
@@ -58,9 +61,9 @@ var SuccessWithFlowButtons = function () {
58
61
  var brandName = (isAr ? (_b = brand === null || brand === void 0 ? void 0 : brand.name) === null || _b === void 0 ? void 0 : _b.ar : (_c = brand === null || brand === void 0 ? void 0 : brand.name) === null || _c === void 0 ? void 0 : _c.en) || '';
59
62
  var isAcceptance = merchant === null || merchant === void 0 ? void 0 : merchant.is_acceptance_allowed;
60
63
  var isPayout = merchant === null || merchant === void 0 ? void 0 : merchant.is_payout_allowed;
61
- var maskedId = !!identification_id ? " ".concat(t('masking_symbols')).concat(identification_id) : '';
64
+ var maskedId = !!(identification === null || identification === void 0 ? void 0 : identification.id) ? " ".concat(t('masking_symbols')).concat((_d = identification === null || identification === void 0 ? void 0 : identification.id) === null || _d === void 0 ? void 0 : _d.slice(-2)) : '';
62
65
  var settings = useAppSelector(settingsSelector);
63
- var _f = data.verify.responseBody || { contact: {}, board_id: '' }, contact = _f.contact, board_id = _f.board_id, board_info_id = _f.board_info_id;
66
+ var _h = data.verify.responseBody || { contact: {}, board_id: '' }, contact = _h.contact, board_id = _h.board_id, board_info_id = _h.board_info_id;
64
67
  var email = (contact || { email: '' }).email;
65
68
  var url = getResetFlowUrl('/password', settings.data.language, PASSWORD_OPERATION_TYPE.RESET_PASSWORD, board_id, board_info_id);
66
69
  var reMapFlowData = function (flows) {
@@ -47,9 +47,9 @@ var FormStyled = styled(Form)(function () { return ({
47
47
  flexDirection: 'column'
48
48
  }); });
49
49
  var VerifyNumber = function (_a) {
50
- var _b, _c, _d;
50
+ var _b, _c;
51
51
  var dispatch = useAppDispatch();
52
- var _e = useAppSelector(businessSelector), data = _e.data, loading = _e.loading, error = _e.error;
52
+ var _d = useAppSelector(businessSelector), data = _d.data, loading = _d.loading, error = _d.error;
53
53
  var methods = useForm({
54
54
  resolver: yupResolver(OTPValidation),
55
55
  defaultValues: data.otpData,
@@ -57,8 +57,8 @@ var VerifyNumber = function (_a) {
57
57
  });
58
58
  var t = useTranslation().t;
59
59
  var isAr = useLanguage().isAr;
60
- var _f = React.useState(false), resendLoading = _f[0], setResendLoading = _f[1];
61
- var phone = (_d = (_c = (_b = data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.contact) === null || _c === void 0 ? void 0 : _c.phone) === null || _d === void 0 ? void 0 : _d.number;
60
+ var _e = React.useState(false), resendLoading = _e[0], setResendLoading = _e[1];
61
+ var phone = (_c = (_b = data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.verification_by) === null || _c === void 0 ? void 0 : _c.sent_to;
62
62
  React.useEffect(function () {
63
63
  if (error && methods.formState.isValid && phone)
64
64
  dispatch(clearError());
@@ -0,0 +1,5 @@
1
+ import * as React from 'react';
2
+ export interface VerifyPACIProps {
3
+ }
4
+ declare const _default: React.MemoExoticComponent<() => JSX.Element>;
5
+ export default _default;
@@ -0,0 +1,157 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
13
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
14
+ return new (P || (P = Promise))(function (resolve, reject) {
15
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
16
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
17
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
18
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
19
+ });
20
+ };
21
+ var __generator = (this && this.__generator) || function (thisArg, body) {
22
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
23
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
24
+ function verb(n) { return function (v) { return step([n, v]); }; }
25
+ function step(op) {
26
+ if (f) throw new TypeError("Generator is already executing.");
27
+ while (_) try {
28
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
29
+ if (y = 0, t) op = [op[0] & 2, t.value];
30
+ switch (op[0]) {
31
+ case 0: case 1: t = op; break;
32
+ case 4: _.label++; return { value: op[1], done: false };
33
+ case 5: _.label++; y = op[1]; op = [0]; continue;
34
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
35
+ default:
36
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
37
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
38
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
39
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
40
+ if (t[2]) _.ops.pop();
41
+ _.trys.pop(); continue;
42
+ }
43
+ op = body.call(thisArg, _);
44
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
45
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
46
+ }
47
+ };
48
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
49
+ import * as React from 'react';
50
+ import Box from '@mui/material/Box/Box';
51
+ import { styled } from '@mui/material/styles';
52
+ import { useTranslation } from 'react-i18next';
53
+ import Text from '../../../../components/Text';
54
+ import { businessSelector, verifyPACI as verifyPACIFun } from '../../../app/business/businessStore';
55
+ import { handlePrevScreenStep } from '../../../../app/settings';
56
+ import { ScreenContainer } from '../../../shared/Containers';
57
+ import { MobileButton } from '../../../shared/Button';
58
+ import { useAppDispatch, useAppSelector } from '../../../../hooks';
59
+ import { mobileOS, sleep } from '../../../../utils';
60
+ import VerifyPACILoading from './VerifyPACILoading';
61
+ import VerifyPACISuccess from './VerifyPACISuccess';
62
+ var VerifyPACITitleContainerStyled = styled(Box)(function (_a) {
63
+ var theme = _a.theme;
64
+ return ({
65
+ direction: theme.direction,
66
+ borderRadius: theme.spacing(0, 0, 1.25, 1.25),
67
+ display: 'flex',
68
+ flexDirection: 'column',
69
+ alignItems: 'center',
70
+ marginBottom: theme.spacing(2.5)
71
+ });
72
+ });
73
+ var VerifyPACITitleStyled = styled(Text)(function (_a) {
74
+ var theme = _a.theme;
75
+ return (__assign(__assign({}, theme.typography.body1), { color: theme.palette.text.primary, fontWeight: theme.typography.fontWeightBold, marginBlock: theme.spacing(1.75), marginInline: theme.spacing(2.5), lineHeight: 1.75, whiteSpace: 'pre-line' }));
76
+ });
77
+ var VerifyPACISubTitleStyled = styled(Text)(function (_a) {
78
+ var theme = _a.theme;
79
+ return (__assign(__assign({}, theme.typography.body1), { color: theme.palette.text.primary, fontWeight: theme.typography.fontWeightMedium, marginBlock: theme.spacing(1.75), marginInline: theme.spacing(2.5), lineHeight: 1.75, whiteSpace: 'pre-line', textAlign: 'center' }));
80
+ });
81
+ var Container = styled(Box)(function (_a) {
82
+ var theme = _a.theme;
83
+ return ({
84
+ position: 'relative',
85
+ display: 'flex',
86
+ justifyContent: 'center',
87
+ alignItems: 'center',
88
+ maxHeight: '300px'
89
+ });
90
+ });
91
+ var BackButton = styled('button')(function (_a) {
92
+ var theme = _a.theme;
93
+ return ({
94
+ cursor: 'pointer',
95
+ height: 44,
96
+ appearance: 'none',
97
+ background: 'none',
98
+ pointerEvents: 'auto',
99
+ border: 'none',
100
+ color: theme.palette.primary.main,
101
+ fontSize: theme.typography.body1.fontSize,
102
+ fontWeight: theme.typography.fontWeightMedium,
103
+ textTransform: 'capitalize',
104
+ '&:hover': {
105
+ backgroundColor: 'transparent'
106
+ }
107
+ });
108
+ });
109
+ var VerifyPACI = function () {
110
+ var _a = React.useState(false), success = _a[0], setSuccess = _a[1];
111
+ var _b = React.useState(false), isReady = _b[0], setIsReady = _b[1];
112
+ var dispatch = useAppDispatch();
113
+ var data = useAppSelector(businessSelector).data;
114
+ var responseBody = data.civilIdData.responseBody;
115
+ var t = useTranslation().t;
116
+ var onSuccess = function () { return __awaiter(void 0, void 0, void 0, function () {
117
+ return __generator(this, function (_a) {
118
+ switch (_a.label) {
119
+ case 0:
120
+ setSuccess(true);
121
+ return [4, sleep(2000)];
122
+ case 1:
123
+ _a.sent();
124
+ return [2];
125
+ }
126
+ });
127
+ }); };
128
+ React.useEffect(function () {
129
+ if (responseBody) {
130
+ setIsReady(true);
131
+ }
132
+ }, [responseBody]);
133
+ React.useEffect(function () {
134
+ if (!isReady)
135
+ return;
136
+ var promise = dispatch(verifyPACIFun({ onSuccess: onSuccess }));
137
+ return function () {
138
+ promise === null || promise === void 0 ? void 0 : promise.abort();
139
+ };
140
+ }, [isReady]);
141
+ var onRedirect = React.useCallback(function () {
142
+ if (os === 'Android') {
143
+ window.open(responseBody === null || responseBody === void 0 ? void 0 : responseBody.app_url_android, '_blank');
144
+ }
145
+ if (os === 'iOS') {
146
+ window.open(responseBody === null || responseBody === void 0 ? void 0 : responseBody.app_url_ios, '_blank');
147
+ }
148
+ }, [responseBody]);
149
+ var onBack = React.useCallback(function () {
150
+ dispatch(handlePrevScreenStep());
151
+ }, []);
152
+ var os = React.useMemo(function () { return mobileOS(); }, []);
153
+ var isAndroid = React.useMemo(function () { return os === 'Android' && (responseBody === null || responseBody === void 0 ? void 0 : responseBody.app_url_ios); }, [os, responseBody]);
154
+ var isIOS = React.useMemo(function () { return os === 'iOS' && (responseBody === null || responseBody === void 0 ? void 0 : responseBody.app_url_ios); }, [os, responseBody]);
155
+ return (_jsxs(ScreenContainer, __assign({ sx: { mb: 2.5 } }, { children: [_jsxs(VerifyPACITitleContainerStyled, { children: [_jsx(Container, { children: success ? _jsx(VerifyPACISuccess, {}) : _jsx(VerifyPACILoading, {}) }), _jsx(VerifyPACITitleStyled, { children: t('authenticate_kuwait_mobile_title') }), _jsx(VerifyPACISubTitleStyled, { children: t('authenticate_kuwait_mobile_description') })] }), (isAndroid || isIOS) && (_jsx(MobileButton, __assign({ onClick: onRedirect, hideIcon: true }, { children: t('Open Kuwait Mobile ID') }))), _jsx(BackButton, __assign({ onClick: onBack }, { children: t('back') }))] })));
156
+ };
157
+ export default React.memo(VerifyPACI);
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ interface VerifyPACILoadingProps {
3
+ }
4
+ declare const _default: React.NamedExoticComponent<VerifyPACILoadingProps>;
5
+ export default _default;
@@ -0,0 +1,22 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { memo } from 'react';
3
+ import { styled } from '@mui/material/styles';
4
+ import LottieFile, { LottieAnimationFiles } from '../../../../components/Lottie';
5
+ import { ICONS_NAMES } from '../../../../constants';
6
+ import Icon from '../../../../components/Icon';
7
+ var IconStyled = styled(Icon)(function (_a) {
8
+ var theme = _a.theme;
9
+ return ({
10
+ position: 'absolute',
11
+ top: '50%',
12
+ left: '50%',
13
+ transform: 'translate(-50%, -50%)',
14
+ width: 64,
15
+ height: 64
16
+ });
17
+ });
18
+ var VerifyPACILoading = function () {
19
+ return (_jsxs(_Fragment, { children: [_jsx(LottieFile, { file: LottieAnimationFiles.pulsating_circle_waves, width: '90%' }), _jsx(IconStyled, { src: ICONS_NAMES.PACI_VERIFY_ICON })] }));
20
+ };
21
+ VerifyPACILoading.defaultProps = {};
22
+ export default memo(VerifyPACILoading);