@abtnode/blocklet-services 1.16.41-beta-20250331-010247-966fcfb0 → 1.16.42-beta-20250402-131159-7647e64d

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 (251) hide show
  1. package/api/emails/_templates/verify-code-body.js +4 -4
  2. package/api/routes/blocklet.js +1 -1
  3. package/api/routes/oauth.js +56 -270
  4. package/api/routes/user-session.js +1 -1
  5. package/api/routes/user.js +247 -254
  6. package/api/services/notification/queue.js +9 -1
  7. package/api/socket/util.js +1 -4
  8. package/api/util/federated.js +1 -1
  9. package/api/util/user-util.js +298 -0
  10. package/dist/assets/{ArrowDropDown-odHjNJIs.js → ArrowDropDown-B6RijoMg.js} +1 -1
  11. package/dist/assets/{CheckCircle-BqOSvJMp.js → CheckCircle-Bme_BHSe.js} +1 -1
  12. package/dist/assets/{ChevronLeft-Dv7rlUf5.js → ChevronLeft-CDiNoyQS.js} +1 -1
  13. package/dist/assets/{ChevronRight-CWeJn1iz.js → ChevronRight-DyMxK2ti.js} +1 -1
  14. package/dist/assets/{DeleteOutline-Cr-TyrUV.js → DeleteOutline-C5oIt-tc.js} +1 -1
  15. package/dist/assets/{Done-C1TA1wbA.js → Done-uAJ8-whC.js} +1 -1
  16. package/dist/assets/{Download-DxhnUTM_.js → Download-CAwoUjYq.js} +1 -1
  17. package/dist/assets/{Error-pXXvJFxN.js → Error-J1wFafzM.js} +1 -1
  18. package/dist/assets/{ExpandLess-Dc_dI20M.js → ExpandLess-B0AhRxh8.js} +1 -1
  19. package/dist/assets/{Google-DNUuYFIA.js → Google-blbcHt2R.js} +1 -1
  20. package/dist/assets/{InfoOutlined-CEUhR4DY.js → InfoOutlined-BjH1JBg3.js} +1 -1
  21. package/dist/assets/{Launch-BUTOr3cR.js → Launch-DJqhcPtC.js} +1 -1
  22. package/dist/assets/{LaunchOutlined-QHq-RUJt.js → LaunchOutlined-CzBae9mQ.js} +1 -1
  23. package/dist/assets/{MoreHoriz-D1SOL47a.js → MoreHoriz-Dd-9O1iw.js} +1 -1
  24. package/dist/assets/{PlayArrow-D7cGSxeN.js → PlayArrow-BEPk9nzV.js} +1 -1
  25. package/dist/assets/{ViewList-vu1qOJ6P.js → ViewList-CNnrIxVS.js} +1 -1
  26. package/dist/assets/{access-control-CpxcJItK.js → access-control-PfmU_lzC.js} +1 -1
  27. package/dist/assets/{actions-4oGfCMlR.js → actions-pYJdaWX5.js} +1 -1
  28. package/dist/assets/{add-component-core-CE0nArG4.js → add-component-core-CgEuYlWv.js} +31 -31
  29. package/dist/assets/{add-resource-BYM4JwzE.js → add-resource-Dw_ZKqq3.js} +1 -1
  30. package/dist/assets/{addon-B9bb2bvM.js → addon-BqlSMpSy.js} +1 -1
  31. package/dist/assets/{analytics-BXLe73MI.js → analytics-DLD8w-rR.js} +2 -2
  32. package/dist/assets/api-0KF6Hg7c.js +1 -0
  33. package/dist/assets/appearance-DyZRbR6W.js +1 -0
  34. package/dist/assets/ar-HpV-sy4C.js +3 -0
  35. package/dist/assets/{audit-logs-D8H5E0fC.js → audit-logs-BFKcADf-.js} +2 -2
  36. package/dist/assets/base32-C0ClYUu9.js +1 -0
  37. package/dist/assets/{branding-BW1rhy8d.js → branding-8XaHoIBD.js} +2 -2
  38. package/dist/assets/{bundle-avatar-DHwmIozH.js → bundle-avatar-BYZp7KRE.js} +1 -1
  39. package/dist/assets/{button-CNnuiac8.js → button-K0-gOTcS.js} +1 -1
  40. package/dist/assets/{click-to-copy-B0HMuCN_.js → click-to-copy-BfRimSvL.js} +1 -1
  41. package/dist/assets/{complete-BNf0-iqY.js → complete-1MMVAc2H.js} +1 -1
  42. package/dist/assets/{component-1r0VSsqq.js → component-BZKPS6he.js} +3 -3
  43. package/dist/assets/{config-BeD5_8kr.js → config-DRS6lRly.js} +1 -1
  44. package/dist/assets/{config-CqHmZdZv.js → config-DtYY5NrA.js} +1 -1
  45. package/dist/assets/{config-navigation-DtN0_qFZ.js → config-navigation-BHoOsyWp.js} +5 -5
  46. package/dist/assets/{config-space-DlwZewcm.js → config-space-DxdlQBdo.js} +1 -1
  47. package/dist/assets/{confirm-DmMN-34s.js → confirm-C57Q7ZWM.js} +1 -1
  48. package/dist/assets/{connect-CC9dcVMV.js → connect-PChwPX8g.js} +1 -1
  49. package/dist/assets/connect-p9koIBBk.js +1 -0
  50. package/dist/assets/{connect-to-CzffwD9G.js → connect-to-QLfyUtYC.js} +1 -1
  51. package/dist/assets/{dashboard-C_Q4TjPa.js → dashboard-Di0Efjh1.js} +4 -4
  52. package/dist/assets/de-zgFs6Kvs.js +3 -0
  53. package/dist/assets/{delete-confirm-BTaU_6Kx.js → delete-confirm-L9JNVh3W.js} +1 -1
  54. package/dist/assets/{did-address-BC-0j4Pt.js → did-address-Bz2Y86pP.js} +1 -1
  55. package/dist/assets/{domain-action-card-DwQ7Q8wY.js → domain-action-card-Bovam4dU.js} +2 -2
  56. package/dist/assets/domain-fVU92lIu.js +9 -0
  57. package/dist/assets/domains-Cs6tdpUa.js +1 -0
  58. package/dist/assets/{email-mj0bVFDS.js → email-SVI5bjle.js} +2 -2
  59. package/dist/assets/es-CmwByMO0.js +3 -0
  60. package/dist/assets/exchange-passport-B3N7KRar.js +1 -0
  61. package/dist/assets/{form-text-input-BYF6lVnE.js → form-text-input-Cp0lmtAk.js} +2 -2
  62. package/dist/assets/fr-CLYepc9p.js +3 -0
  63. package/dist/assets/{fuel-D-kOZuF6.js → fuel-DT6O2ymR.js} +1 -1
  64. package/dist/assets/{get-safe-url-BKl2A9x2.js → get-safe-url-CJRwqFgD.js} +1 -1
  65. package/dist/assets/{get-safe-url-QFq5JNoE.js → get-safe-url-DLBNTOpr.js} +1 -1
  66. package/dist/assets/hi-CSSYN7n8.js +1 -0
  67. package/dist/assets/{home-CpnMpXiw.js → home-CQ7SI4ml.js} +1 -1
  68. package/dist/assets/id-C5CwopKG.js +3 -0
  69. package/dist/assets/{iframe-B9mCpo4I.js → iframe-DPBwIvsP.js} +1 -1
  70. package/dist/assets/{index-gTQQ3SoE.js → index-8I2oAbEz.js} +9 -9
  71. package/dist/assets/index-B5HkvoQC.js +4 -0
  72. package/dist/assets/{index-CmKAznDh.js → index-BYkIfvmH.js} +4 -4
  73. package/dist/assets/index-B_pl8AF-.js +11 -0
  74. package/dist/assets/{index-B4Q2DAdn.js → index-Bg3m8iJ-.js} +11 -11
  75. package/dist/assets/{index-BZvVDfZ4.js → index-Bhnq0cVQ.js} +1 -1
  76. package/dist/assets/{index-C44fECmB.js → index-BzblYn_P.js} +2 -2
  77. package/dist/assets/index-C9qItKIC.js +138 -0
  78. package/dist/assets/{index-Ct7s2LPI.js → index-CAFqxbeJ.js} +3 -3
  79. package/dist/assets/{index-u-lA6P_E.js → index-CLIxjSVZ.js} +1 -1
  80. package/dist/assets/{index-BJ2lJo7L.js → index-Cdm81c0H.js} +42 -42
  81. package/dist/assets/index-DAE7cdom.js +2 -0
  82. package/dist/assets/{index-DQ_RzIwU.js → index-DGkTgpZy.js} +1 -1
  83. package/dist/assets/{index-BsUr7wGb.js → index-DZAi-K_N.js} +47 -47
  84. package/dist/assets/{index-gcSQTx25.js → index-Db6WuAj_.js} +1 -1
  85. package/dist/assets/index-RSW2vc0s.js +2 -0
  86. package/dist/assets/{index-CJCg9yIK.js → index-RuFDBiVt.js} +1 -1
  87. package/dist/assets/{index-79U1RPaq.js → index-bIuZaDHS.js} +1 -1
  88. package/dist/assets/{index-CGK3FEjY.js → index-kAPvimmq.js} +2 -2
  89. package/dist/assets/{invitation-B8Qx_pFq.js → invitation-DG6QrvdE.js} +8 -7
  90. package/dist/assets/invite-CYIssZ1G.js +1 -0
  91. package/dist/assets/issue-passport-Cft19VvI.js +1 -0
  92. package/dist/assets/{item-BSGXym2I.js → item-at_gI9OW.js} +1 -1
  93. package/dist/assets/ja-BPVyKlMZ.js +3 -0
  94. package/dist/assets/ko-DGmHCGCI.js +3 -0
  95. package/dist/assets/landing-page-CXo1fefz.js +1 -0
  96. package/dist/assets/{layout-BqhTD729.js → layout-ChcSB0Y2.js} +1 -1
  97. package/dist/assets/list-DcSgz3EU.js +211 -0
  98. package/dist/assets/localization-DXf17X8p.js +1 -0
  99. package/dist/assets/{log-o_Cadt8j.js → log-D7ImQrI7.js} +1 -1
  100. package/dist/assets/{login-BQozrLDm.js → login-B9xuIjhY.js} +1 -1
  101. package/dist/assets/{login-oauth-callback-D7lIww1c.js → login-oauth-callback-BoFezOw0.js} +1 -1
  102. package/dist/assets/{logo-uploader-CUQ3aWZJ.js → logo-uploader-Bzpld3yG.js} +3 -3
  103. package/dist/assets/{lost-passport-DkETH2Lu.js → lost-passport-j4coS07J.js} +3 -3
  104. package/dist/assets/{omit-DZNQhOf-.js → omit-BXVmqD4a.js} +1 -1
  105. package/dist/assets/{open-window-BOl-kTC2.js → open-window-B8cxsAbD.js} +1 -1
  106. package/dist/assets/{overview-Bxm05EH6.js → overview-C9x4HKRi.js} +1 -1
  107. package/dist/assets/{page-header-Dm1v9v5q.js → page-header-YN9FqnGT.js} +1 -1
  108. package/dist/assets/{permission-B5jnw9r2.js → permission-CTDKdktZ.js} +1 -1
  109. package/dist/assets/{preferences-uri2RXdB.js → preferences-DM6b-Vr4.js} +1 -1
  110. package/dist/assets/{profile-embed-DnIQcD-H.js → profile-embed-8sjLgVfn.js} +1 -1
  111. package/dist/assets/pt-u5ojPOFS.js +1 -0
  112. package/dist/assets/publish-resource-BJIce778.js +1 -0
  113. package/dist/assets/{react-beautiful-dnd.esm-B9MfX9Xl.js → react-beautiful-dnd.esm-CkNk1XBJ.js} +4 -4
  114. package/dist/assets/{relative-time-RQnsWZQc.js → relative-time-BCARyhz6.js} +1 -1
  115. package/dist/assets/roboto-cyrillic-400-normal-DAIM1_dR.woff2 +0 -0
  116. package/dist/assets/roboto-cyrillic-400-normal-Dry59Hjn.woff +0 -0
  117. package/dist/assets/roboto-cyrillic-500-normal-CsCirF4J.woff +0 -0
  118. package/dist/assets/roboto-cyrillic-500-normal-hCeO1jFL.woff2 +0 -0
  119. package/dist/assets/roboto-cyrillic-700-normal-CB1Rmiii.woff +0 -0
  120. package/dist/assets/roboto-cyrillic-700-normal-CzEIZVQR.woff2 +0 -0
  121. package/dist/assets/roboto-cyrillic-ext-400-normal-BxX1-eA_.woff +0 -0
  122. package/dist/assets/roboto-cyrillic-ext-400-normal-DzMWdK87.woff2 +0 -0
  123. package/dist/assets/roboto-cyrillic-ext-500-normal-B7rQpwPu.woff2 +0 -0
  124. package/dist/assets/roboto-cyrillic-ext-500-normal-ElvJfk8V.woff +0 -0
  125. package/dist/assets/roboto-cyrillic-ext-700-normal-CIu0AXX2.woff +0 -0
  126. package/dist/assets/roboto-cyrillic-ext-700-normal-D_fA0fHY.woff2 +0 -0
  127. package/dist/assets/roboto-greek-400-normal-CAI06USH.woff +0 -0
  128. package/dist/assets/roboto-greek-400-normal-jFM2czAU.woff2 +0 -0
  129. package/dist/assets/roboto-greek-500-normal-BJMS0heP.woff2 +0 -0
  130. package/dist/assets/roboto-greek-500-normal-D8eQD5zT.woff +0 -0
  131. package/dist/assets/roboto-greek-700-normal-DCrt6r9F.woff +0 -0
  132. package/dist/assets/roboto-greek-700-normal-DpKAje7q.woff2 +0 -0
  133. package/dist/assets/roboto-latin-400-normal-551zQQ7R.woff +0 -0
  134. package/dist/assets/roboto-latin-400-normal-CNwBRw8h.woff2 +0 -0
  135. package/dist/assets/roboto-latin-500-normal-CkrA1NAy.woff2 +0 -0
  136. package/dist/assets/roboto-latin-500-normal-_8jDuD7w.woff +0 -0
  137. package/dist/assets/roboto-latin-700-normal-CTLkNcF_.woff +0 -0
  138. package/dist/assets/roboto-latin-700-normal-DZr4b_KL.woff2 +0 -0
  139. package/dist/assets/roboto-latin-ext-400-normal-ZYmyxeOy.woff2 +0 -0
  140. package/dist/assets/roboto-latin-ext-400-normal-uRIBRJt5.woff +0 -0
  141. package/dist/assets/roboto-latin-ext-500-normal-C_ARlJGk.woff2 +0 -0
  142. package/dist/assets/roboto-latin-ext-500-normal-eJ10kk0m.woff +0 -0
  143. package/dist/assets/roboto-latin-ext-700-normal-BNPgmEQS.woff2 +0 -0
  144. package/dist/assets/roboto-latin-ext-700-normal-Cnx4FGpK.woff +0 -0
  145. package/dist/assets/roboto-math-400-normal-B3wgz80t.woff2 +0 -0
  146. package/dist/assets/roboto-math-400-normal-DHrwdhE6.woff +0 -0
  147. package/dist/assets/roboto-math-500-normal-CFNaIMFC.woff2 +0 -0
  148. package/dist/assets/roboto-math-500-normal-CetgDdIa.woff +0 -0
  149. package/dist/assets/roboto-math-700-normal-CpTCM92H.woff +0 -0
  150. package/dist/assets/roboto-math-700-normal-xbpggnJp.woff2 +0 -0
  151. package/dist/assets/roboto-symbols-400-normal-bG5rsNFs.woff +0 -0
  152. package/dist/assets/roboto-symbols-400-normal-fF1SLJBj.woff2 +0 -0
  153. package/dist/assets/roboto-symbols-500-normal-BXFTxrNR.woff2 +0 -0
  154. package/dist/assets/roboto-symbols-500-normal-toKUCDph.woff +0 -0
  155. package/dist/assets/roboto-symbols-700-normal-B2QKVW64.woff +0 -0
  156. package/dist/assets/roboto-symbols-700-normal-DKkQdRpM.woff2 +0 -0
  157. package/dist/assets/roboto-vietnamese-400-normal-CDDxGrUb.woff2 +0 -0
  158. package/dist/assets/roboto-vietnamese-400-normal-DgufTq8s.woff +0 -0
  159. package/dist/assets/roboto-vietnamese-500-normal-Dw5heWgq.woff +0 -0
  160. package/dist/assets/roboto-vietnamese-500-normal-HYpufUYk.woff2 +0 -0
  161. package/dist/assets/roboto-vietnamese-700-normal-BFWtvCOj.woff2 +0 -0
  162. package/dist/assets/roboto-vietnamese-700-normal-ChAl_rRV.woff +0 -0
  163. package/dist/assets/ru-DBl90RHJ.js +1 -0
  164. package/dist/assets/sdk-DbmS8LqQ.js +1 -0
  165. package/dist/assets/session-BaYtKD4f.js +1 -0
  166. package/dist/assets/{setup-7Gq9K_8k.js → setup-BtUUdr-p.js} +3 -3
  167. package/dist/assets/{start-BSUY3DBl.js → start-CdXw9NWC.js} +1 -1
  168. package/dist/assets/{status-C52-BFuY.js → status-B6cew_GQ.js} +1 -1
  169. package/dist/assets/{step-actions-CA74dwgt.js → step-actions-D-RgRm8H.js} +1 -1
  170. package/dist/assets/{studio-CAnZfyBM.js → studio-KYZUr4tT.js} +1 -1
  171. package/dist/assets/{switch-control-BBlLGjaH.js → switch-control-CpOzvDua.js} +1 -1
  172. package/dist/assets/th-CbjesoRG.js +1 -0
  173. package/dist/assets/{traffic-CJDIGmp5.js → traffic-CvAD-wB3.js} +1 -1
  174. package/dist/assets/transfer-BSgBIknw.js +16 -0
  175. package/dist/assets/{unsubscribe-afXXIHEf.js → unsubscribe-I8S6Tbwg.js} +1 -1
  176. package/dist/assets/{useAsync-DM8qaMe4.js → useAsync-Cq0wbMuR.js} +1 -1
  177. package/dist/assets/{useAsyncRetry-B7SbzXVI.js → useAsyncRetry-BNLrNsx3.js} +1 -1
  178. package/dist/assets/{useLocalStorage-Dd4pybDP.js → useLocalStorage-Cligjpwl.js} +1 -1
  179. package/dist/assets/user-center-C1k0oYvY.js +67 -0
  180. package/dist/assets/{util-C_BCTHfw.js → util-BFBz0dr8.js} +1 -1
  181. package/dist/assets/{util-YyWTpLT7.js → util-COcKIr8L.js} +1 -1
  182. package/dist/assets/vendor-arcblock-krD2mwVA.js +1598 -0
  183. package/dist/assets/{vendor-hooks-sw5wvnca.js → vendor-hooks-BdjOQw7q.js} +1 -1
  184. package/dist/assets/vendor-utils-BbDUMsIF.js +11 -0
  185. package/dist/assets/vendor-ux-did-connect-BDmhBveY.css +1 -0
  186. package/dist/assets/vendor-ux-did-connect-YqGDzQ2U.js +1843 -0
  187. package/dist/assets/vi-xat6Zv0n.js +1 -0
  188. package/dist/assets/wrap-locale-BCL-ID0T.js +1 -0
  189. package/dist/assets/zh-BgH3IZTD.js +4 -0
  190. package/dist/assets/zh-tw-UWzs9p3g.js +3 -0
  191. package/dist/images/all-done.png +0 -0
  192. package/dist/index.html +6 -6
  193. package/dist/service-worker.js +1 -1
  194. package/package.json +37 -39
  195. package/dist/assets/api-D9Yi7Zdr.js +0 -1
  196. package/dist/assets/appearance-DX7SoW1u.js +0 -1
  197. package/dist/assets/ar-2k9jaPIk.js +0 -3
  198. package/dist/assets/base32-BNpDT-6Q.js +0 -1
  199. package/dist/assets/connect-BfSOEYV-.js +0 -1
  200. package/dist/assets/de-B9cLhykn.js +0 -3
  201. package/dist/assets/domain-CLMRXecU.js +0 -9
  202. package/dist/assets/domains-DF7TtN5q.js +0 -1
  203. package/dist/assets/es-BoQohonz.js +0 -3
  204. package/dist/assets/exchange-passport--DeUPzbW.js +0 -1
  205. package/dist/assets/fr-doSYAOrt.js +0 -3
  206. package/dist/assets/fullpage-DO8Hcbkl.js +0 -1
  207. package/dist/assets/hi-B_BwhpD8.js +0 -1
  208. package/dist/assets/id-BgYIZCvk.js +0 -3
  209. package/dist/assets/index-BVOYP6aR.js +0 -11
  210. package/dist/assets/index-DqC2o5PB.js +0 -4
  211. package/dist/assets/index-DyTFEgKr.js +0 -1
  212. package/dist/assets/index-eCY24sH9.js +0 -137
  213. package/dist/assets/inter-latin-300-normal-CvRFFuZy.woff2 +0 -0
  214. package/dist/assets/inter-latin-300-normal-ORCTF8i-.woff +0 -0
  215. package/dist/assets/inter-latin-400-normal-BOOGhInR.woff2 +0 -0
  216. package/dist/assets/inter-latin-400-normal-gitzw0hO.woff +0 -0
  217. package/dist/assets/inter-latin-500-normal-D2bGa7uu.woff2 +0 -0
  218. package/dist/assets/inter-latin-500-normal-deR1Tlfd.woff +0 -0
  219. package/dist/assets/inter-latin-700-normal-B8MtJ_2k.woff +0 -0
  220. package/dist/assets/inter-latin-700-normal-Sckx8rpT.woff2 +0 -0
  221. package/dist/assets/inter-latin-ext-300-normal-C2kLfG2J.woff2 +0 -0
  222. package/dist/assets/inter-latin-ext-300-normal-n8Ps4oXY.woff +0 -0
  223. package/dist/assets/inter-latin-ext-400-normal-C1t-h-pH.woff +0 -0
  224. package/dist/assets/inter-latin-ext-400-normal-hnt3BR84.woff2 +0 -0
  225. package/dist/assets/inter-latin-ext-500-normal-CIS2RHJS.woff2 +0 -0
  226. package/dist/assets/inter-latin-ext-500-normal-UMdmhHu2.woff +0 -0
  227. package/dist/assets/inter-latin-ext-700-normal-6V9MnIL5.woff +0 -0
  228. package/dist/assets/inter-latin-ext-700-normal-CzikT_rs.woff2 +0 -0
  229. package/dist/assets/invite-BBaF_vyc.js +0 -1
  230. package/dist/assets/issue-passport-DC-ly7xg.js +0 -1
  231. package/dist/assets/ja-FMMLI8YD.js +0 -3
  232. package/dist/assets/ko-C0kmRXYE.js +0 -3
  233. package/dist/assets/list-BHs8uNT5.js +0 -200
  234. package/dist/assets/localization-daPAWMzR.js +0 -1
  235. package/dist/assets/login-bg-Cbfh9Uc2.png +0 -0
  236. package/dist/assets/pt-C2UJZK-O.js +0 -1
  237. package/dist/assets/publish-resource-V53U1NNv.js +0 -1
  238. package/dist/assets/ru-DDA5s4-r.js +0 -1
  239. package/dist/assets/sdk-BKSsfgrc.js +0 -1
  240. package/dist/assets/session-6ZeN-aF2.js +0 -1
  241. package/dist/assets/th-DmqOUn4C.js +0 -1
  242. package/dist/assets/transfer-cG2e24sz.js +0 -16
  243. package/dist/assets/user-center-T8Xw464s.js +0 -67
  244. package/dist/assets/vendor-arcblock-DvaaLvvM.js +0 -2361
  245. package/dist/assets/vendor-utils-DR57WNxP.js +0 -11
  246. package/dist/assets/vendor-ux-did-connect-Bciw9Ypu.js +0 -1077
  247. package/dist/assets/vendor-ux-did-connect-DhgPdlEj.css +0 -1
  248. package/dist/assets/vi-Cf__CtPD.js +0 -1
  249. package/dist/assets/wrap-locale-CX50Vz0w.js +0 -1
  250. package/dist/assets/zh-NXspK2yu.js +0 -4
  251. package/dist/assets/zh-tw-DYYDVX5I.js +0 -3
@@ -1,4 +1,4 @@
1
- import{r as v}from"./vendor-react-DoD83n6N.js";import{j as e,E as d,a2 as Fe,R as bt,a5 as vt,T as G,a4 as N,A as ke,bl as _e,cq as et,bL as Te,bp as Ie,bM as De,x as Se,b2 as Ee,a3 as tt,aa as oe,W as st,bf as Xe,bo as jt,bk as yt,ak as Je,bR as St}from"./vendor-mui-core-DxqV1NVn.js";import{c as se,av as ce,A as Ct}from"./vendor-utils-DR57WNxP.js";import{W as V,p as F,b1 as Nt,r as Be,u as X,bO as wt,V as nt,B as Ae,a3 as at,be as ve,ak as Rt,aq as Tt,bD as It}from"./vendor-ux-did-connect-Bciw9Ypu.js";import{A as Dt,v as U,m as Et,I as Qe}from"./index-BsUr7wGb.js";import{f as ee,a as Oe}from"./vendor-hooks-sw5wvnca.js";import{S as fe}from"./shorten-label-DkFTGSoy.js";import{I as it}from"./index-BZvVDfZ4.js";import{A as At,S as Ot,a as Lt,b as Pt}from"./list-BHs8uNT5.js";import{R as ze}from"./relative-time-RQnsWZQc.js";import{b as We}from"./dashboard-C_Q4TjPa.js";import{W as Ft}from"./did-address-BC-0j4Pt.js";import{p as ot}from"./util-YyWTpLT7.js";import{D as kt,g as _t}from"./traffic-CJDIGmp5.js";import{i as Bt,B as zt}from"./index-DyTFEgKr.js";import{B as rt}from"./bundle-avatar-DHwmIozH.js";import"./lottie-web-B6s7dDoL.js";import"./vendor-arcblock-DvaaLvvM.js";import"./index-D_wVtHmh.js";import"./InfoOutlined-CEUhR4DY.js";import"./CheckCircle-BqOSvJMp.js";import"./useLocalStorage-Dd4pybDP.js";import"./confirm-DmMN-34s.js";import"./format-error-LAoTjvJe.js";import"./PlayArrow-D7cGSxeN.js";import"./get-safe-url-QFq5JNoE.js";import"./session-6ZeN-aF2.js";import"./useAsyncRetry-B7SbzXVI.js";import"./useAsync-DM8qaMe4.js";import"./useSetState-BL3ktMon.js";import"./base32-BNpDT-6Q.js";import"./iframe-B9mCpo4I.js";import"./LaunchOutlined-QHq-RUJt.js";import"./ChevronLeft-Dv7rlUf5.js";import"./ChevronRight-CWeJn1iz.js";import"./index-BMSA5TdD.js";import"./vendor-mui-x-BjL1xCkk.js";const lt=v.createContext({}),{Provider:Wt,Consumer:nn}=lt;function Mt({children:t,blocklet:s=""}){const{api:n,inService:i}=Dt(),[a,l]=v.useState([]),[p,f]=v.useState({total:0,pageSize:20,pageCount:0,page:1}),j=ee(()=>{var R;return(R=s.meta)==null?void 0:R.did},[s]),[y,w]=v.useState([]),C=async({page:R=1,pageSize:T=20,...b}={})=>{if(!j)return[];try{const x={paging:{page:R,pageSize:T},...b,teamDid:j,dateRange:b.dateRange?[U(b.dateRange[0]).toISOString(),U(b.dateRange[1]).toISOString()]:void 0},{dids:P,...Z}=x;let K="";P.includes("system")&&(K="system");const J=P.filter(Q=>Q!=="system"),B=await n.getNotificationSendLog({input:{...Z,source:K,componentDids:J}});return l(B.list),f(B.paging),B.list}catch(x){return V.error(x.message),[]}},A=async()=>{const R=await n.getNotificationComponents({input:{teamDid:j}});w(R.componentDids)},L=v.useCallback(R=>{const T=s.children.find(b=>{var x;return((x=b.meta)==null?void 0:x.did)===R});if(T)return T.ancestors=[s],T},[s]),O=async({notificationId:R,receivers:T,channels:b,...x})=>{await n.resendNotification({input:{teamDid:j,notificationId:R,receivers:T,channels:b.map(P=>P==="wallet"?F.NOTIFICATION_SEND_CHANNEL.WALLET:P==="pushKit"?F.NOTIFICATION_SEND_CHANNEL.PUSH:P),...x}})},_=v.useCallback(async R=>(await n.getUser({input:{teamDid:j,user:{did:R}}})).user,[n,j]),I=v.useCallback(async({page:R=1,pageSize:T=20,...b}={})=>{try{const x={paging:{page:R,pageSize:T},...b,userName:b.searchText||"",teamDid:j,dateRange:b.dateRange?[U(b.dateRange[0]).toISOString(),U(b.dateRange[1]).toISOString()]:void 0};return await n.getReceivers({input:x})}catch(x){throw V.error(x.message),x}},[n,j]);v.useEffect(()=>{j&&A()},[j]);const q={fetch:C,data:a,paging:p,blocklet:s,getComponent:L,resendNotification:O,getUser:_,componentDids:y,getReceivers:I,inService:i,teamDid:j};return e.jsx(Wt,{value:{notificationRecords:q},children:t})}function Me(){const{notificationRecords:t}=v.useContext(lt);return t}me.propTypes={severity:d.oneOf(Object.values(["info","success","error","warning"])).isRequired};const qt={info:"primary",success:"success",error:"error",warning:"warning"};function me({severity:t="info"}){return e.jsx(Nt,{type:qt[t],children:t})}var qe={},Kt=Fe;Object.defineProperty(qe,"__esModule",{value:!0});var ct=qe.default=void 0,Ht=Kt(Be()),$t=e;ct=qe.default=(0,Ht.default)((0,$t.jsx)("path",{d:"M16.59 7.58 10 14.17l-3.59-3.58L5 12l5 5 8-8zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"}),"CheckCircleOutline");var Ke={},Ut=Fe;Object.defineProperty(Ke,"__esModule",{value:!0});var dt=Ke.default=void 0,Vt=Ut(Be()),Gt=e;dt=Ke.default=(0,Vt.default)((0,Gt.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2M4 12c0-4.42 3.58-8 8-8 1.85 0 3.55.63 4.9 1.69L5.69 16.9C4.63 15.55 4 13.85 4 12m8 8c-1.85 0-3.55-.63-4.9-1.69L18.31 7.1C19.37 8.45 20 10.15 20 12c0 4.42-3.58 8-8 8"}),"Block");var He={},Yt=Fe;Object.defineProperty(He,"__esModule",{value:!0});var ut=He.default=void 0,Xt=Yt(Be()),Jt=e;ut=He.default=(0,Xt.default)((0,Jt.jsx)("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z"}),"Refresh");const Qt=(t,s,n="")=>{if(!n||!s)return"";switch(n){case F.NOTIFICATION_SEND_FAILED_REASON.USER_DISABLED:return t("notification.sendStatus.reason.disabled",{channel:s});case F.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_UNAVAILABLE:return t("notification.sendStatus.reason.unavailable",{channel:s});case F.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_DISABLED:return t("notification.sendStatus.reason.notSent",{channel:s});case F.NOTIFICATION_SEND_FAILED_REASON.NOT_ONLINE:return t("notification.sendStatus.reason.offline");default:return n}};function pt(t,s,n={}){const{status:i,updatedAt:a,reason:l="",channel:p="wallet"}=n,f=a?t("notification.sendStatus.sentTime",{date:Et(a,s)}):"",j=Qt(t,p,l);return i===F.NOTIFICATION_SEND_STATUS.FAILED?{status:"failed",title:t("notification.sendStatus.failed"),sentTime:f,reason:j}:i===F.NOTIFICATION_SEND_STATUS.SENT?{status:"success",title:t("notification.sendStatus.success"),sentTime:f}:{status:"pending",title:t("notification.sendStatus.pending"),reason:j,sentTime:f}}const Le={pending:"#aaaaaa",success:"#34BE74",failed:"#D0021B"},Pe=["wallet","pushKit","email"],Ze=["info","success","error","warning"],ft=t=>{var n,i;const{settings:s}=t;return(i=(n=s==null?void 0:s.notification)==null?void 0:n.email)==null?void 0:i.enabled},mt=t=>{var n,i;const{settings:s}=t;return(i=(n=s==null?void 0:s.notification)==null?void 0:n.pushKit)==null?void 0:i.enabled},Zt=(t,s)=>{const n=se(s,"extra.notifications.email",!0);return{available:ft(t),enabled:n}},es=(t,s)=>{const n=se(s,"extra.notifications.push",!0);return{available:mt(t),enabled:n}},ts=t=>({enabled:se(t,"extra.notifications.wallet",!0)}),ss=t=>({enabled:se(t,"extra.webhooks",[]).length>0}),xe=(t=3)=>new Promise(s=>{setTimeout(()=>{s()},t*1e3)}),ns=(t,s)=>s==="wallet"||s==="webhook"?[{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:s==="pushKit"||s==="email"?[{channel:s,type:"available",pass:t("notification.sendStatus.reason.available",{channel:s}),fail:t("notification.sendStatus.reason.unavailable",{channel:s})},{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:[],be=(t=[])=>{const s=U().startOf("day");return t.filter(n=>U(n.sendAt).isSame(s,"day")).length},as=(t,s="")=>{if(s&&Pe.includes(s)){const l=`${s}SendRecord`,p=se(t,l,[]);return be(p)}const n=se(t,"webhook",{}),i=Object.keys(n??{})??[];if(s&&i.includes(s)){const l=n[s]??[];return be(l)}const a={};return Pe.forEach(l=>{const p=`${l}SendRecord`,f=se(t,p,[]),j=be(f);a[l]=j}),i.length>0&&i.forEach(l=>{const p=n[l]??[],f=be(p);a[l]=f}),a},je=(t,s,n)=>{if(!Array.isArray(t))throw new Error("Invalid filterList or index");return t[n].splice(s,1),t},ye=(t,s)=>{if(!Array.isArray(s))throw new Error("filters must be an array");return s.length?!s.includes(t):!1},is=t=>{switch(t){case F.NOTIFICATION_SEND_CHANNEL.WALLET:return"Wallet";case F.NOTIFICATION_SEND_CHANNEL.PUSH:return"Push Kit";case F.NOTIFICATION_SEND_CHANNEL.EMAIL:return"Email";case F.NOTIFICATION_SEND_CHANNEL.WEBHOOK:return"Webhook";default:return""}},ht=()=>bt({typography:{fontSize:14,button:{textTransform:"none"}},palette:{primary:{main:"#1DC1C7",contrastText:"#fff"},secondary:{main:"#030712",contrastText:"#fff"},storeSecondary:{main:"#EBFEFF",contrastText:"#fff"},divider:"#F4F4F5"},components:{MUIDataTableFilter:{styleOverrides:{header:{marginBottom:0,p:{margin:0}},root:{"& .MuiGrid-container":{marginTop:0,"& .MuiGrid-item":{paddingTop:0}}}}},MuiPopover:{styleOverrides:{root:{"&.MuiPopover-root":{"& .MuiPaper-root:has(.filter-container)":{width:"420px"}}}}}}});function te({config:t,enableTooltip:s=!0,showTitle:n=!1,children:i}){const{status:a,title:l="",sentTime:p="",reason:f=""}=t,j=[l,f].filter(Boolean).join(", ");return e.jsx(vt,{title:s?e.jsxs(e.Fragment,{children:[e.jsx(G,{color:"inherit",sx:{fontSize:12},children:j}),e.jsx("span",{children:p})]}):null,arrow:!0,placement:"top",children:e.jsxs(N,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsxs(N,{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center",children:[e.jsx(N,{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:Le[a],style:{opacity:.15}}),e.jsx(N,{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:Le[a]})]}),e.jsx(G,{color:"inherit",sx:{fontSize:12},children:n?l:i})]})})}te.propTypes={config:d.object.isRequired,enableTooltip:d.bool,showTitle:d.bool,children:d.node};te.defaultProps={enableTooltip:!0,showTitle:!1,children:null};de.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};de.defaultProps={onDelete:()=>{}};function de({list:t,label:s,onDelete:n}){const{t:i,locale:a}=X();return e.jsxs(N,{display:"flex",gap:1,alignItems:"center",children:[e.jsxs(G,{children:[s,": "]}),t.map(l=>{const p=pt(i,a,{status:l});return e.jsx(ke,{size:"small",label:e.jsx(N,{display:"flex",alignItems:"center",sx:{gap:"4px"},children:e.jsx(te,{config:p,enableTooltip:!1,children:p.title})}),onDelete:f=>n(f,l)},l)})]})}$e.propTypes={filterList:d.array.isRequired,onChange:d.func.isRequired,index:d.number.isRequired,column:d.object.isRequired,filterValues:d.array.isRequired,label:d.string.isRequired,renderLabel:d.func.isRequired};function $e({filterList:t,onChange:s,index:n,column:i,filterValues:a,label:l,renderLabel:p}){return e.jsxs(_e,{className:"filter-container",children:[e.jsx(et,{component:"legend",children:l}),e.jsx(Te,{row:!0,children:a.map(f=>e.jsx(Ie,{control:e.jsx(De,{checked:t[n].indexOf(f.value??f)>-1,onChange:j=>{const y=[...t];j.target.checked?y[n]=[...y[n],f.value??f]:y[n]=y[n].filter(w=>w!==(f.value??f)),s(y[n],n,i)},name:f.value??f}),label:e.jsx("span",{style:{display:"flex",alignItems:"center"},children:p(f)})},f.value??f))})]})}function Re(t){return e.jsx($e,{...t,renderLabel:s=>e.jsx(te,{enableTooltip:!1,config:{status:s.status},children:s.label})})}le.propTypes={status:d.number.isRequired,updatedAt:d.string.isRequired,reason:d.string,channel:d.string,onResend:d.func};function le({status:t,updatedAt:s,reason:n="",channel:i="wallet",onResend:a}){const{t:l,locale:p}=X(),f=pt(l,p,{status:t,updatedAt:s,reason:n,channel:i});return e.jsxs(N,{display:"flex",alignItems:"center",gap:1,children:[e.jsx(te,{config:f,showTitle:!0}),f.status!=="success"&&e.jsx(Se,{className:"resend-btn",size:"small",startIcon:e.jsx(We,{}),sx:{fontSize:12,color:"rgba(0, 0, 0, 0.87)",fontWeight:400,".MuiButton-startIcon":{mr:"2px"}},onClick:a,children:l("notification.resend")})]})}Ue.propTypes={value:d.array.isRequired,onChange:d.func};function Ue({value:t,onChange:s}){const{locale:n}=X(),i=U().toDate(),[a,l]=v.useState(null),p=v.useCallback(y=>{l(a?null:y.currentTarget)},[a]),f=!!a,j=v.useCallback(y=>{if(!y.startDate||!y.endDate){V.error("Please select a date range");return}if(U(y.startDate).isAfter(y.endDate)||!U(y.startDate).isValid()||!U(y.endDate).isValid()){V.error("Invalid date range");return}s([y.startDate,y.endDate]),l(null)},[s]);return e.jsxs("div",{children:[e.jsx(G,{component:"div",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},mb:0,children:e.jsxs(Se,{onClick:p,variant:"outlined",size:"small",color:"inherit",children:[Qe(t[0],n)," - ",Qe(t[1],n)]})}),e.jsx(Ee,{open:f,anchorEl:a,onClose:()=>{l(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:e.jsx(kt,{open:!0,maxDate:i,initialDateRange:{startDate:t[0],endDate:t[1]},toggle:p,definedRanges:_t(i),onChange:j})})]})}Ve.propTypes={itemComponent:d.elementType.isRequired};function Ve({itemComponent:t,...s}){var a;const{t:n}=X();return!((a=s==null?void 0:s.filterList)!=null&&a.filter(l=>l.length).length)?null:e.jsxs(N,{display:"flex",gap:1,alignItems:"center",children:[e.jsx("div",{className:"toolbar-filter-title",children:n("notification.filter")}),e.jsx("div",{className:"toolbar-filter-content",children:e.jsx(wt.TableFilterList,{...s,ItemComponent:t})})]})}function Ce({label:t,onDelete:s,canDelete:n=()=>!0,...i}){const a=s&&typeof s=="function"?s:void 0;let l=!0;return n&&typeof n=="function"&&(l=n({label:t,...i})),e.jsx(ke,{label:t,variant:"outlined",...a&&l?{onDelete:a}:{}})}Ce.propTypes={label:d.string.isRequired,onDelete:d.func,canDelete:d.func};Ce.defaultProps={canDelete:()=>!0};const os=[{label:"Wallet",value:"app",checked:!0},{label:"Email",value:"email",checked:!0},{label:"Push Kit",value:"push",checked:!0},{label:"Webhook",value:"webhook",checked:!0}];Ge.propTypes={loading:d.bool,onCancel:d.func,onConfirm:d.func};Ge.defaultProps={loading:!1,onCancel:()=>{},onConfirm:()=>{}};function Ge({loading:t=!1,onCancel:s,onConfirm:n}){const{t:i}=X(),[a,l]=v.useState(os),[p,f]=v.useState(!0),j=(w,C)=>{C.checked=w.target.checked;const A=a.map(L=>({...L,checked:L.value===C.value?C.checked:L.checked}));l(A)},y=w=>{w.stopPropagation(),n({channels:a.filter(C=>C.checked).map(C=>C.value),isResendFailedOnly:p})};return e.jsxs(N,{className:"resend-config",sx:{padding:"16px 24px"},children:[e.jsx(G,{variant:"body1",component:"div",className:"check-title",sx:{fontWeight:700,mb:1},children:i("notification.config")}),e.jsx(N,{className:"choose-channel",children:e.jsxs(_e,{component:"fieldset",variant:"standard",children:[e.jsx(et,{component:"legend",children:i("notification.selectChannels")}),e.jsx(Te,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:1},children:a.map(w=>e.jsx(Ie,{control:e.jsx(De,{checked:w.checked,onChange:C=>j(C,w),name:w.value}),label:w.label},w.value))})]})}),e.jsx(N,{className:"resend-config-footer",children:e.jsx(Te,{children:e.jsx(Ie,{control:e.jsx(De,{checked:p,onChange:w=>f(w.target.checked)}),label:i("notification.resendFailedOnly")})})}),e.jsxs(N,{display:"flex",justifyContent:"flex-end",gap:1,className:"resend-config-footer-tip",children:[e.jsx(Se,{onClick:w=>{w.stopPropagation(),s()},color:"inherit",children:i("common.cancel")}),e.jsxs(Se,{onClick:y,color:"primary",disabled:t,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[t&&e.jsx(tt,{size:16}),i("common.confirm")]})]})]})}gt.propTypes={notificationId:d.string.isRequired,handleResend:d.func,resending:d.bool};function gt({notificationId:t,handleResend:s,resending:n=!1}){const{t:i,locale:a}=X(),{getReceivers:l,inService:p,teamDid:f,getUser:j,blocklet:y}=Me(),[w,C]=v.useState(!1),[A,L]=v.useState([]),O=Oe({anchorEl:null,position:null}),_=Oe({anchorEl:null,position:null}),[I,q]=v.useState(null),[R,T]=v.useState({total:0,pageSize:10,pageCount:0,page:1}),[b,x]=v.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[U().subtract(1,"month").startOf("day").toDate(),U().endOf("day").toDate()]}),[P,Z]=v.useState([]),K=[{label:i("notification.sendStatus.pending"),value:0,status:"pending"},{label:i("notification.sendStatus.success"),value:1,status:"success"},{label:i("notification.sendStatus.failed"),value:2,status:"failed"}],J=async()=>{if(!w&&t)try{C(!0);const o=await l({notificationId:t,...b}),r=o.list.map(c=>({...c,receiverUser:{...c.receiverUser,avatar:ot(c.receiverUser.avatar,f,p)}}));L(r),T(o.paging),C(!1)}catch(o){V.error(o.message),C(!1)}};v.useEffect(()=>{J()},[b]);const B=o=>{o.stopPropagation();const r=o.currentTarget;_.anchorEl=r;const c=r.getBoundingClientRect();_.position={top:c.top+window.scrollY,left:c.left+window.scrollX}},Q=o=>o.data.length?e.jsx("div",{style:{display:"flex",alignItems:"center",padding:"10px"},children:e.jsx(Ae,{className:"resend-btn",size:"small",color:"primary",variant:"contained",startIcon:e.jsx(We,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:B,children:i("notification.resend")})}):null,H={sort:!1,download:!1,print:!1,selectableRows:"multiple",searchPlaceholder:i("common.search"),searchAlwaysOpen:!1,filterType:"checkbox",searchDebounceTime:300,page:R.page-1,rowsPerPage:R.pageSize,count:R.total,searchText:b.searchText,tableBodyMaxHeight:"calc(80vh - 260px)",rowsSelected:P,onRowSelectionChange:(o,r)=>{Z(r.map(c=>c.dataIndex))},customToolbarSelect:Q},we=({page:o,rowsPerPage:r,searchText:c,filterList:S})=>{const[,k=[],$=[],M=[]]=S;b.pageSize!==r?x(W=>({...W,pageSize:r,page:1})):b.page!==o+1?x(W=>({...W,page:o+1})):b.searchText!==c?x(W=>({...W,searchText:c,page:1})):ce(k,b.walletSendStatus)?ce($,b.pushKitSendStatus)?ce(M,b.emailSendStatus)||x(W=>({...W,emailSendStatus:M,page:1})):x(W=>({...W,pushKitSendStatus:$,page:1})):x(W=>({...W,walletSendStatus:k,page:1}))},he=v.useCallback(async(o,r)=>{if(!r)return!1;const c=await j(r);return c?o==="wallet"?ts(c):o==="email"?Zt(y,c):o==="pushKit"?es(y,c):o==="webhook"?ss(c):!0:!1},[j,y]),h=v.useCallback(o=>ns(i,o),[i]),u=()=>{O.anchorEl=null,O.position=null,q(null)},m=()=>{_.anchorEl=null,_.position=null},g=async(o,r,c=!0,S="")=>{if(!(!r.length||!o.length))try{s(o,r,c,S),_.anchorEl||(await xe(.5),u())}catch(k){console.error("handleResend error",{error:k})}},D=async({channels:o,isResendFailedOnly:r})=>{const c=P.map(S=>A[S].receiver);await g(o,c,r),await xe(.5),m(),Z([])},E=async(o,r=[],c=!0)=>{try{await g(["webhook"],[o.receiver],c,r)}catch(S){V.error(S.response?S.response.statusText:S.message)}},z=async(o,r,c,S=[],k=!0)=>{if(o.stopPropagation(),as(r,c)>=4){V.warning(i("notification.resendLimit"));return}if(!Pe.includes(c)){await E(r,S,k);return}if(o){const M=o.currentTarget,W=M.getBoundingClientRect();O.anchorEl=M,O.position={top:W.top+window.scrollY,left:W.left+window.scrollX}}q({channel:c});try{const M=await he(c,r.receiver);await xe(1),q({channel:c,result:M}),(typeof M=="boolean"&&M||Ct(M)&&Object.values(M).every(W=>!!W))&&(await s([c],[r.receiver],k),_.anchorEl||(await xe(.5),u()))}catch(M){V.error(M.message)}},Y=o=>{x(r=>({...r,dateRange:o,page:1}))},ne=(o,r,c,S)=>{o.stopPropagation();const k=c.filter($=>$!==r);x($=>({...$,[S]:k,page:1}))},re=ee(()=>[{label:i("notification.receiver"),name:"receiver",width:200,options:{filter:!1,customBodyRenderLite:o=>{const{receiverUser:r,receiver:c}=A[o];return r?e.jsxs(N,{"data-cy":`member-name-${r.fullName}`,display:"flex",alignItems:"center",gap:1,justifyContent:"flex-start",children:[e.jsx(nt,{src:`${r.avatar}?imageFilter=resize&w=48&h=48`,size:32,did:c,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),e.jsx(fe,{children:r.fullName})]},c):e.jsx(Ft,{size:14,responsive:!1,compact:!0,copyable:!1,did:c})}}},{label:"Wallet",name:"walletSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),filter:!0,filterType:"custom",filterList:b.walletSendStatus??[],customFilterListOptions:{render:o=>e.jsx(de,{list:o,label:"Wallet",onDelete:(r,c)=>{r.stopPropagation(),ne(r,c,re[1].options.filterList,"walletSendStatus")}}),update:je},filterOptions:{names:K,fullWidth:!0,logic:ye,display:(o,r,c,S)=>e.jsx(Re,{label:"Wallet",filterList:o,onChange:r,index:c,column:S,filterValues:K})},customBodyRenderLite:o=>{const{walletSendStatus:r,walletSendAt:c,walletSendFailedReason:S}=A[o];return e.jsx(le,{status:r,updatedAt:c,reason:S,channel:"wallet",onResend:k=>z(k,A[o],"wallet",[],!1)})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:o=>{const{pushKitSendStatus:r,pushKitSendAt:c,pushKitSendFailedReason:S}=A[o];return e.jsx(le,{status:r,updatedAt:c,reason:S,channel:"pushkit",onResend:k=>z(k,A[o],"pushKit",[],!1)})},filter:!0,filterType:"custom",filterList:b.pushKitSendStatus??[],customFilterListOptions:{render:o=>e.jsx(de,{list:o,label:"Push Kit",onDelete:(r,c)=>{r.stopPropagation(),ne(r,c,re[2].options.filterList,"pushKitSendStatus")}}),update:je},filterOptions:{names:K,fullWidth:!0,logic:ye,display:(o,r,c,S)=>e.jsx(Re,{label:"Push Kit",filterList:o,onChange:r,index:c,column:S,filterValues:K})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:o=>{const{emailSendStatus:r,emailSendAt:c,emailSendFailedReason:S}=A[o];return e.jsx(le,{status:r,updatedAt:c,reason:S,channel:"email",onResend:k=>z(k,A[o],"email",[],!1)})},filter:!0,filterType:"custom",filterList:b.emailSendStatus??[],customFilterListOptions:{render:o=>e.jsx(de,{list:o,label:"Email",onDelete:(r,c)=>{r.stopPropagation(),ne(r,c,re[3].options.filterList,"emailSendStatus")}}),update:je},filterOptions:{names:K,fullWidth:!0,logic:ye,display:(o,r,c,S)=>e.jsx(Re,{label:"Email",filterList:o,onChange:r,index:c,column:S,filterValues:K})}}},{label:"Webhook",name:"webhook",width:200,options:{filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:o=>{const{webhook:r}=A[o];if(!r)return null;const c=Object.entries(r)[0];if(!c)return null;const[S,k]=c,$=k[0];return e.jsx(N,{display:"flex",flexDirection:"column",gap:1,children:e.jsxs(N,{className:"webhook-item",fontSize:12,children:[e.jsx(fe,{maxLength:30,children:S},S),e.jsx(le,{status:$.status,updatedAt:$.sendAt,reason:$.failedReason,channel:"webhook",onResend:M=>z(M,A[o],"webhook",[S],!1)})]},S)})}}},{label:i("common.createdAt"),name:"createdAt",width:100,options:{filter:!1,customBodyRenderLite:o=>{const{createdAt:r}=A[o];return e.jsx(ze,{value:r,locale:a,shouldUpdate:!0})}}}],[A,a,b,i]),ge=[e.jsx(Ue,{value:b.dateRange,onChange:Y},"date-picker"),e.jsx(Ae,{variant:"contained",size:"small",color:"primary",loading:w,startIcon:e.jsx(ut,{}),onClick:()=>J(),sx:{".MuiButton-startIcon":{mr:"2px"}},style:{marginLeft:8},children:i("common.refresh")},"refresh")];return e.jsx(N,{sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:e.jsx(ls,{children:e.jsxs(st,{theme:ht(),children:[e.jsx(at,{className:"receivers-table",locale:a,loading:w,columns:re,data:A,onChange:we,options:H,customButtons:ge,components:{TableFilterList:o=>e.jsx(Ve,{...o,itemComponent:r=>e.jsx(Ce,{...r,canDelete:()=>!1})})}}),O.anchorEl&&e.jsx(Ee,{open:!!O.anchorEl,anchorReference:"anchorPosition",anchorPosition:O.position,onClose:u,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs(cs,{children:[e.jsxs(G,{variant:"body1",component:"div",className:"check-title",children:[I==null?void 0:I.channel," Checking"]}),e.jsx(N,{display:"flex",flexDirection:"column",sx:{gap:"4px"},children:h(I==null?void 0:I.channel).map(o=>{var k,$;const{type:r,pass:c,fail:S}=o;return!(I!=null&&I.result)||(k=I==null?void 0:I.result)!=null&&k[r]?e.jsxs(G,{variant:"body1",component:"div",className:"check-item",display:"flex",alignItems:"center",sx:{gap:"4px",color:($=I==null?void 0:I.result)!=null&&$[r]?ve.success.main:"inherit"},children:[I!=null&&I.result?e.jsx(ct,{}):e.jsx(tt,{size:12,sx:{color:ve.primary.main}}),e.jsx("span",{children:c})]},r):e.jsxs(G,{variant:"body1",component:"div",display:"flex",alignItems:"center",className:"check-item",sx:{gap:"4px",color:ve.error.main},children:[e.jsx(dt,{}),e.jsx("span",{children:S})]},r)})})]})}),_.anchorEl&&e.jsx(Ee,{open:!!_.anchorEl,anchorReference:"anchorPosition",anchorPosition:_.position,onClose:m,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsx(Ge,{loading:n,onCancel:m,onConfirm:D})})]})})})}const rs=v.memo(gt),ls=oe.div`
1
+ import{r as v}from"./vendor-react-DoD83n6N.js";import{j as e,E as d,a2 as Fe,R as bt,a5 as vt,T as G,a4 as N,A as ke,bl as _e,cq as et,bL as Te,bp as Ie,bM as De,x as Se,b2 as Ee,a3 as tt,aa as oe,W as st,bf as Xe,bo as jt,bk as yt,ak as Je,bR as St}from"./vendor-mui-core-DxqV1NVn.js";import{c as se,av as ce,A as Ct}from"./vendor-utils-BbDUMsIF.js";import{W as V,m as F,bn as Nt,r as Be,u as X,c9 as wt,V as nt,B as Ae,a3 as at,bE as ve,aG as Rt,aM as Tt,b$ as It}from"./vendor-ux-did-connect-YqGDzQ2U.js";import{A as Dt,v as U,m as Et,I as Qe}from"./index-DZAi-K_N.js";import{f as ee,a as Le}from"./vendor-hooks-BdjOQw7q.js";import{S as fe}from"./shorten-label-DkFTGSoy.js";import{I as it}from"./index-Bhnq0cVQ.js";import{A as At,S as Lt,a as Ot,b as Pt}from"./list-DcSgz3EU.js";import{R as ze}from"./relative-time-BCARyhz6.js";import{b as We}from"./dashboard-Di0Efjh1.js";import{W as Ft}from"./did-address-Bz2Y86pP.js";import{p as ot}from"./util-COcKIr8L.js";import{D as kt,g as _t}from"./traffic-CvAD-wB3.js";import{i as Bt,B as zt}from"./index-DAE7cdom.js";import{B as rt}from"./bundle-avatar-BYZp7KRE.js";import"./lottie-web-B6s7dDoL.js";import"./vendor-arcblock-krD2mwVA.js";import"./index-D_wVtHmh.js";import"./InfoOutlined-BjH1JBg3.js";import"./CheckCircle-Bme_BHSe.js";import"./useLocalStorage-Cligjpwl.js";import"./confirm-C57Q7ZWM.js";import"./format-error-LAoTjvJe.js";import"./PlayArrow-BEPk9nzV.js";import"./get-safe-url-DLBNTOpr.js";import"./session-BaYtKD4f.js";import"./useAsyncRetry-BNLrNsx3.js";import"./useAsync-Cq0wbMuR.js";import"./useSetState-BL3ktMon.js";import"./base32-C0ClYUu9.js";import"./iframe-DPBwIvsP.js";import"./LaunchOutlined-CzBae9mQ.js";import"./ChevronLeft-CDiNoyQS.js";import"./ChevronRight-DyMxK2ti.js";import"./index-BMSA5TdD.js";import"./vendor-mui-x-BjL1xCkk.js";const lt=v.createContext({}),{Provider:Wt,Consumer:nn}=lt;function Mt({children:t,blocklet:s=""}){const{api:n,inService:i}=Dt(),[a,l]=v.useState([]),[p,f]=v.useState({total:0,pageSize:20,pageCount:0,page:1}),j=ee(()=>{var R;return(R=s.meta)==null?void 0:R.did},[s]),[y,w]=v.useState([]),C=async({page:R=1,pageSize:T=20,...b}={})=>{if(!j)return[];try{const x={paging:{page:R,pageSize:T},...b,teamDid:j,dateRange:b.dateRange?[U(b.dateRange[0]).toISOString(),U(b.dateRange[1]).toISOString()]:void 0},{dids:P,...Z}=x;let K="";P.includes("system")&&(K="system");const J=P.filter(Q=>Q!=="system"),B=await n.getNotificationSendLog({input:{...Z,source:K,componentDids:J}});return l(B.list),f(B.paging),B.list}catch(x){return V.error(x.message),[]}},A=async()=>{const R=await n.getNotificationComponents({input:{teamDid:j}});w(R.componentDids)},O=v.useCallback(R=>{const T=s.children.find(b=>{var x;return((x=b.meta)==null?void 0:x.did)===R});if(T)return T.ancestors=[s],T},[s]),L=async({notificationId:R,receivers:T,channels:b,...x})=>{await n.resendNotification({input:{teamDid:j,notificationId:R,receivers:T,channels:b.map(P=>P==="wallet"?F.NOTIFICATION_SEND_CHANNEL.WALLET:P==="pushKit"?F.NOTIFICATION_SEND_CHANNEL.PUSH:P),...x}})},_=v.useCallback(async R=>(await n.getUser({input:{teamDid:j,user:{did:R}}})).user,[n,j]),I=v.useCallback(async({page:R=1,pageSize:T=20,...b}={})=>{try{const x={paging:{page:R,pageSize:T},...b,userName:b.searchText||"",teamDid:j,dateRange:b.dateRange?[U(b.dateRange[0]).toISOString(),U(b.dateRange[1]).toISOString()]:void 0};return await n.getReceivers({input:x})}catch(x){throw V.error(x.message),x}},[n,j]);v.useEffect(()=>{j&&A()},[j]);const q={fetch:C,data:a,paging:p,blocklet:s,getComponent:O,resendNotification:L,getUser:_,componentDids:y,getReceivers:I,inService:i,teamDid:j};return e.jsx(Wt,{value:{notificationRecords:q},children:t})}function Me(){const{notificationRecords:t}=v.useContext(lt);return t}me.propTypes={severity:d.oneOf(Object.values(["info","success","error","warning"])).isRequired};const qt={info:"primary",success:"success",error:"error",warning:"warning"};function me({severity:t="info"}){return e.jsx(Nt,{type:qt[t],children:t})}var qe={},Kt=Fe;Object.defineProperty(qe,"__esModule",{value:!0});var ct=qe.default=void 0,$t=Kt(Be()),Ht=e;ct=qe.default=(0,$t.default)((0,Ht.jsx)("path",{d:"M16.59 7.58 10 14.17l-3.59-3.58L5 12l5 5 8-8zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"}),"CheckCircleOutline");var Ke={},Ut=Fe;Object.defineProperty(Ke,"__esModule",{value:!0});var dt=Ke.default=void 0,Vt=Ut(Be()),Gt=e;dt=Ke.default=(0,Vt.default)((0,Gt.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2M4 12c0-4.42 3.58-8 8-8 1.85 0 3.55.63 4.9 1.69L5.69 16.9C4.63 15.55 4 13.85 4 12m8 8c-1.85 0-3.55-.63-4.9-1.69L18.31 7.1C19.37 8.45 20 10.15 20 12c0 4.42-3.58 8-8 8"}),"Block");var $e={},Yt=Fe;Object.defineProperty($e,"__esModule",{value:!0});var ut=$e.default=void 0,Xt=Yt(Be()),Jt=e;ut=$e.default=(0,Xt.default)((0,Jt.jsx)("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z"}),"Refresh");const Qt=(t,s,n="")=>{if(!n||!s)return"";switch(n){case F.NOTIFICATION_SEND_FAILED_REASON.USER_DISABLED:return t("notification.sendStatus.reason.disabled",{channel:s});case F.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_UNAVAILABLE:return t("notification.sendStatus.reason.unavailable",{channel:s});case F.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_DISABLED:return t("notification.sendStatus.reason.notSent",{channel:s});case F.NOTIFICATION_SEND_FAILED_REASON.NOT_ONLINE:return t("notification.sendStatus.reason.offline");default:return n}};function pt(t,s,n={}){const{status:i,updatedAt:a,reason:l="",channel:p="wallet"}=n,f=a?t("notification.sendStatus.sentTime",{date:Et(a,s)}):"",j=Qt(t,p,l);return i===F.NOTIFICATION_SEND_STATUS.FAILED?{status:"failed",title:t("notification.sendStatus.failed"),sentTime:f,reason:j}:i===F.NOTIFICATION_SEND_STATUS.SENT?{status:"success",title:t("notification.sendStatus.success"),sentTime:f}:{status:"pending",title:t("notification.sendStatus.pending"),reason:j,sentTime:f}}const Oe={pending:"#aaaaaa",success:"#34BE74",failed:"#D0021B"},Pe=["wallet","pushKit","email"],Ze=["info","success","error","warning"],ft=t=>{var n,i;const{settings:s}=t;return(i=(n=s==null?void 0:s.notification)==null?void 0:n.email)==null?void 0:i.enabled},mt=t=>{var n,i;const{settings:s}=t;return(i=(n=s==null?void 0:s.notification)==null?void 0:n.pushKit)==null?void 0:i.enabled},Zt=(t,s)=>{const n=se(s,"extra.notifications.email",!0);return{available:ft(t),enabled:n}},es=(t,s)=>{const n=se(s,"extra.notifications.push",!0);return{available:mt(t),enabled:n}},ts=t=>({enabled:se(t,"extra.notifications.wallet",!0)}),ss=t=>({enabled:se(t,"extra.webhooks",[]).length>0}),xe=(t=3)=>new Promise(s=>{setTimeout(()=>{s()},t*1e3)}),ns=(t,s)=>s==="wallet"||s==="webhook"?[{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:s==="pushKit"||s==="email"?[{channel:s,type:"available",pass:t("notification.sendStatus.reason.available",{channel:s}),fail:t("notification.sendStatus.reason.unavailable",{channel:s})},{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:[],be=(t=[])=>{const s=U().startOf("day");return t.filter(n=>U(n.sendAt).isSame(s,"day")).length},as=(t,s="")=>{if(s&&Pe.includes(s)){const l=`${s}SendRecord`,p=se(t,l,[]);return be(p)}const n=se(t,"webhook",{}),i=Object.keys(n??{})??[];if(s&&i.includes(s)){const l=n[s]??[];return be(l)}const a={};return Pe.forEach(l=>{const p=`${l}SendRecord`,f=se(t,p,[]),j=be(f);a[l]=j}),i.length>0&&i.forEach(l=>{const p=n[l]??[],f=be(p);a[l]=f}),a},je=(t,s,n)=>{if(!Array.isArray(t))throw new Error("Invalid filterList or index");return t[n].splice(s,1),t},ye=(t,s)=>{if(!Array.isArray(s))throw new Error("filters must be an array");return s.length?!s.includes(t):!1},is=t=>{switch(t){case F.NOTIFICATION_SEND_CHANNEL.WALLET:return"Wallet";case F.NOTIFICATION_SEND_CHANNEL.PUSH:return"Push Kit";case F.NOTIFICATION_SEND_CHANNEL.EMAIL:return"Email";case F.NOTIFICATION_SEND_CHANNEL.WEBHOOK:return"Webhook";default:return""}},ht=()=>bt({typography:{fontSize:14,button:{textTransform:"none"}},palette:{primary:{main:"#1DC1C7",contrastText:"#fff"},secondary:{main:"#030712",contrastText:"#fff"},storeSecondary:{main:"#EBFEFF",contrastText:"#fff"},divider:"#F4F4F5"},components:{MUIDataTableFilter:{styleOverrides:{header:{marginBottom:0,p:{margin:0}},root:{"& .MuiGrid-container":{marginTop:0,"& .MuiGrid-item":{paddingTop:0}}}}},MuiPopover:{styleOverrides:{root:{"&.MuiPopover-root":{"& .MuiPaper-root:has(.filter-container)":{width:"420px"}}}}}}});function te({config:t,enableTooltip:s=!0,showTitle:n=!1,children:i}){const{status:a,title:l="",sentTime:p="",reason:f=""}=t,j=[l,f].filter(Boolean).join(", ");return e.jsx(vt,{title:s?e.jsxs(e.Fragment,{children:[e.jsx(G,{color:"inherit",sx:{fontSize:12},children:j}),e.jsx("span",{children:p})]}):null,arrow:!0,placement:"top",children:e.jsxs(N,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsxs(N,{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center",children:[e.jsx(N,{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:Oe[a],style:{opacity:.15}}),e.jsx(N,{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:Oe[a]})]}),e.jsx(G,{color:"inherit",sx:{fontSize:12},children:n?l:i})]})})}te.propTypes={config:d.object.isRequired,enableTooltip:d.bool,showTitle:d.bool,children:d.node};te.defaultProps={enableTooltip:!0,showTitle:!1,children:null};de.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};de.defaultProps={onDelete:()=>{}};function de({list:t,label:s,onDelete:n}){const{t:i,locale:a}=X();return e.jsxs(N,{display:"flex",gap:1,alignItems:"center",children:[e.jsxs(G,{children:[s,": "]}),t.map(l=>{const p=pt(i,a,{status:l});return e.jsx(ke,{size:"small",label:e.jsx(N,{display:"flex",alignItems:"center",sx:{gap:"4px"},children:e.jsx(te,{config:p,enableTooltip:!1,children:p.title})}),onDelete:f=>n(f,l)},l)})]})}He.propTypes={filterList:d.array.isRequired,onChange:d.func.isRequired,index:d.number.isRequired,column:d.object.isRequired,filterValues:d.array.isRequired,label:d.string.isRequired,renderLabel:d.func.isRequired};function He({filterList:t,onChange:s,index:n,column:i,filterValues:a,label:l,renderLabel:p}){return e.jsxs(_e,{className:"filter-container",children:[e.jsx(et,{component:"legend",children:l}),e.jsx(Te,{row:!0,children:a.map(f=>e.jsx(Ie,{control:e.jsx(De,{checked:t[n].indexOf(f.value??f)>-1,onChange:j=>{const y=[...t];j.target.checked?y[n]=[...y[n],f.value??f]:y[n]=y[n].filter(w=>w!==(f.value??f)),s(y[n],n,i)},name:f.value??f}),label:e.jsx("span",{style:{display:"flex",alignItems:"center"},children:p(f)})},f.value??f))})]})}function Re(t){return e.jsx(He,{...t,renderLabel:s=>e.jsx(te,{enableTooltip:!1,config:{status:s.status},children:s.label})})}le.propTypes={status:d.number.isRequired,updatedAt:d.string.isRequired,reason:d.string,channel:d.string,onResend:d.func};function le({status:t,updatedAt:s,reason:n="",channel:i="wallet",onResend:a}){const{t:l,locale:p}=X(),f=pt(l,p,{status:t,updatedAt:s,reason:n,channel:i});return e.jsxs(N,{display:"flex",alignItems:"center",gap:1,children:[e.jsx(te,{config:f,showTitle:!0}),f.status!=="success"&&e.jsx(Se,{className:"resend-btn",size:"small",startIcon:e.jsx(We,{}),sx:{fontSize:12,color:"rgba(0, 0, 0, 0.87)",fontWeight:400,".MuiButton-startIcon":{mr:"2px"}},onClick:a,children:l("notification.resend")})]})}Ue.propTypes={value:d.array.isRequired,onChange:d.func};function Ue({value:t,onChange:s}){const{locale:n}=X(),i=U().toDate(),[a,l]=v.useState(null),p=v.useCallback(y=>{l(a?null:y.currentTarget)},[a]),f=!!a,j=v.useCallback(y=>{if(!y.startDate||!y.endDate){V.error("Please select a date range");return}if(U(y.startDate).isAfter(y.endDate)||!U(y.startDate).isValid()||!U(y.endDate).isValid()){V.error("Invalid date range");return}s([y.startDate,y.endDate]),l(null)},[s]);return e.jsxs("div",{children:[e.jsx(G,{component:"div",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},mb:0,children:e.jsxs(Se,{onClick:p,variant:"outlined",size:"small",color:"inherit",children:[Qe(t[0],n)," - ",Qe(t[1],n)]})}),e.jsx(Ee,{open:f,anchorEl:a,onClose:()=>{l(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:e.jsx(kt,{open:!0,maxDate:i,initialDateRange:{startDate:t[0],endDate:t[1]},toggle:p,definedRanges:_t(i),onChange:j})})]})}Ve.propTypes={itemComponent:d.elementType.isRequired};function Ve({itemComponent:t,...s}){var a;const{t:n}=X();return!((a=s==null?void 0:s.filterList)!=null&&a.filter(l=>l.length).length)?null:e.jsxs(N,{display:"flex",gap:1,alignItems:"center",children:[e.jsx("div",{className:"toolbar-filter-title",children:n("notification.filter")}),e.jsx("div",{className:"toolbar-filter-content",children:e.jsx(wt.TableFilterList,{...s,ItemComponent:t})})]})}function Ce({label:t,onDelete:s,canDelete:n=()=>!0,...i}){const a=s&&typeof s=="function"?s:void 0;let l=!0;return n&&typeof n=="function"&&(l=n({label:t,...i})),e.jsx(ke,{label:t,variant:"outlined",...a&&l?{onDelete:a}:{}})}Ce.propTypes={label:d.string.isRequired,onDelete:d.func,canDelete:d.func};Ce.defaultProps={canDelete:()=>!0};const os=[{label:"Wallet",value:"app",checked:!0},{label:"Email",value:"email",checked:!0},{label:"Push Kit",value:"push",checked:!0},{label:"Webhook",value:"webhook",checked:!0}];Ge.propTypes={loading:d.bool,onCancel:d.func,onConfirm:d.func};Ge.defaultProps={loading:!1,onCancel:()=>{},onConfirm:()=>{}};function Ge({loading:t=!1,onCancel:s,onConfirm:n}){const{t:i}=X(),[a,l]=v.useState(os),[p,f]=v.useState(!0),j=(w,C)=>{C.checked=w.target.checked;const A=a.map(O=>({...O,checked:O.value===C.value?C.checked:O.checked}));l(A)},y=w=>{w.stopPropagation(),n({channels:a.filter(C=>C.checked).map(C=>C.value),isResendFailedOnly:p})};return e.jsxs(N,{className:"resend-config",sx:{padding:"16px 24px"},children:[e.jsx(G,{variant:"body1",component:"div",className:"check-title",sx:{fontWeight:700,mb:1},children:i("notification.config")}),e.jsx(N,{className:"choose-channel",children:e.jsxs(_e,{component:"fieldset",variant:"standard",children:[e.jsx(et,{component:"legend",children:i("notification.selectChannels")}),e.jsx(Te,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:1},children:a.map(w=>e.jsx(Ie,{control:e.jsx(De,{checked:w.checked,onChange:C=>j(C,w),name:w.value}),label:w.label},w.value))})]})}),e.jsx(N,{className:"resend-config-footer",children:e.jsx(Te,{children:e.jsx(Ie,{control:e.jsx(De,{checked:p,onChange:w=>f(w.target.checked)}),label:i("notification.resendFailedOnly")})})}),e.jsxs(N,{display:"flex",justifyContent:"flex-end",gap:1,className:"resend-config-footer-tip",children:[e.jsx(Se,{onClick:w=>{w.stopPropagation(),s()},color:"inherit",children:i("common.cancel")}),e.jsxs(Se,{onClick:y,color:"primary",disabled:t,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[t&&e.jsx(tt,{size:16}),i("common.confirm")]})]})]})}gt.propTypes={notificationId:d.string.isRequired,handleResend:d.func,resending:d.bool};function gt({notificationId:t,handleResend:s,resending:n=!1}){const{t:i,locale:a}=X(),{getReceivers:l,inService:p,teamDid:f,getUser:j,blocklet:y}=Me(),[w,C]=v.useState(!1),[A,O]=v.useState([]),L=Le({anchorEl:null,position:null}),_=Le({anchorEl:null,position:null}),[I,q]=v.useState(null),[R,T]=v.useState({total:0,pageSize:10,pageCount:0,page:1}),[b,x]=v.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[U().subtract(1,"month").startOf("day").toDate(),U().endOf("day").toDate()]}),[P,Z]=v.useState([]),K=[{label:i("notification.sendStatus.pending"),value:0,status:"pending"},{label:i("notification.sendStatus.success"),value:1,status:"success"},{label:i("notification.sendStatus.failed"),value:2,status:"failed"}],J=async()=>{if(!w&&t)try{C(!0);const o=await l({notificationId:t,...b}),r=o.list.map(c=>({...c,receiverUser:{...c.receiverUser,avatar:ot(c.receiverUser.avatar,f,p)}}));O(r),T(o.paging),C(!1)}catch(o){V.error(o.message),C(!1)}};v.useEffect(()=>{J()},[b]);const B=o=>{o.stopPropagation();const r=o.currentTarget;_.anchorEl=r;const c=r.getBoundingClientRect();_.position={top:c.top+window.scrollY,left:c.left+window.scrollX}},Q=o=>o.data.length?e.jsx("div",{style:{display:"flex",alignItems:"center",padding:"10px"},children:e.jsx(Ae,{className:"resend-btn",size:"small",color:"primary",variant:"contained",startIcon:e.jsx(We,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:B,children:i("notification.resend")})}):null,$={sort:!1,download:!1,print:!1,selectableRows:"multiple",searchPlaceholder:i("common.search"),searchAlwaysOpen:!1,filterType:"checkbox",searchDebounceTime:300,page:R.page-1,rowsPerPage:R.pageSize,count:R.total,searchText:b.searchText,tableBodyMaxHeight:"calc(80vh - 260px)",rowsSelected:P,onRowSelectionChange:(o,r)=>{Z(r.map(c=>c.dataIndex))},customToolbarSelect:Q},we=({page:o,rowsPerPage:r,searchText:c,filterList:S})=>{const[,k=[],H=[],M=[]]=S;b.pageSize!==r?x(W=>({...W,pageSize:r,page:1})):b.page!==o+1?x(W=>({...W,page:o+1})):b.searchText!==c?x(W=>({...W,searchText:c,page:1})):ce(k,b.walletSendStatus)?ce(H,b.pushKitSendStatus)?ce(M,b.emailSendStatus)||x(W=>({...W,emailSendStatus:M,page:1})):x(W=>({...W,pushKitSendStatus:H,page:1})):x(W=>({...W,walletSendStatus:k,page:1}))},he=v.useCallback(async(o,r)=>{if(!r)return!1;const c=await j(r);return c?o==="wallet"?ts(c):o==="email"?Zt(y,c):o==="pushKit"?es(y,c):o==="webhook"?ss(c):!0:!1},[j,y]),h=v.useCallback(o=>ns(i,o),[i]),u=()=>{L.anchorEl=null,L.position=null,q(null)},m=()=>{_.anchorEl=null,_.position=null},g=async(o,r,c=!0,S="")=>{if(!(!r.length||!o.length))try{s(o,r,c,S),_.anchorEl||(await xe(.5),u())}catch(k){console.error("handleResend error",{error:k})}},D=async({channels:o,isResendFailedOnly:r})=>{const c=P.map(S=>A[S].receiver);await g(o,c,r),await xe(.5),m(),Z([])},E=async(o,r=[],c=!0)=>{try{await g(["webhook"],[o.receiver],c,r)}catch(S){V.error(S.response?S.response.statusText:S.message)}},z=async(o,r,c,S=[],k=!0)=>{if(o.stopPropagation(),as(r,c)>=4){V.warning(i("notification.resendLimit"));return}if(!Pe.includes(c)){await E(r,S,k);return}if(o){const M=o.currentTarget,W=M.getBoundingClientRect();L.anchorEl=M,L.position={top:W.top+window.scrollY,left:W.left+window.scrollX}}q({channel:c});try{const M=await he(c,r.receiver);await xe(1),q({channel:c,result:M}),(typeof M=="boolean"&&M||Ct(M)&&Object.values(M).every(W=>!!W))&&(await s([c],[r.receiver],k),_.anchorEl||(await xe(.5),u()))}catch(M){V.error(M.message)}},Y=o=>{x(r=>({...r,dateRange:o,page:1}))},ne=(o,r,c,S)=>{o.stopPropagation();const k=c.filter(H=>H!==r);x(H=>({...H,[S]:k,page:1}))},re=ee(()=>[{label:i("notification.receiver"),name:"receiver",width:200,options:{filter:!1,customBodyRenderLite:o=>{const{receiverUser:r,receiver:c}=A[o];return r?e.jsxs(N,{"data-cy":`member-name-${r.fullName}`,display:"flex",alignItems:"center",gap:1,justifyContent:"flex-start",children:[e.jsx(nt,{src:`${r.avatar}?imageFilter=resize&w=48&h=48`,size:32,did:c,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),e.jsx(fe,{children:r.fullName})]},c):e.jsx(Ft,{size:14,responsive:!1,compact:!0,copyable:!1,did:c})}}},{label:"Wallet",name:"walletSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),filter:!0,filterType:"custom",filterList:b.walletSendStatus??[],customFilterListOptions:{render:o=>e.jsx(de,{list:o,label:"Wallet",onDelete:(r,c)=>{r.stopPropagation(),ne(r,c,re[1].options.filterList,"walletSendStatus")}}),update:je},filterOptions:{names:K,fullWidth:!0,logic:ye,display:(o,r,c,S)=>e.jsx(Re,{label:"Wallet",filterList:o,onChange:r,index:c,column:S,filterValues:K})},customBodyRenderLite:o=>{const{walletSendStatus:r,walletSendAt:c,walletSendFailedReason:S}=A[o];return e.jsx(le,{status:r,updatedAt:c,reason:S,channel:"wallet",onResend:k=>z(k,A[o],"wallet",[],!1)})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:o=>{const{pushKitSendStatus:r,pushKitSendAt:c,pushKitSendFailedReason:S}=A[o];return e.jsx(le,{status:r,updatedAt:c,reason:S,channel:"pushkit",onResend:k=>z(k,A[o],"pushKit",[],!1)})},filter:!0,filterType:"custom",filterList:b.pushKitSendStatus??[],customFilterListOptions:{render:o=>e.jsx(de,{list:o,label:"Push Kit",onDelete:(r,c)=>{r.stopPropagation(),ne(r,c,re[2].options.filterList,"pushKitSendStatus")}}),update:je},filterOptions:{names:K,fullWidth:!0,logic:ye,display:(o,r,c,S)=>e.jsx(Re,{label:"Push Kit",filterList:o,onChange:r,index:c,column:S,filterValues:K})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:o=>{const{emailSendStatus:r,emailSendAt:c,emailSendFailedReason:S}=A[o];return e.jsx(le,{status:r,updatedAt:c,reason:S,channel:"email",onResend:k=>z(k,A[o],"email",[],!1)})},filter:!0,filterType:"custom",filterList:b.emailSendStatus??[],customFilterListOptions:{render:o=>e.jsx(de,{list:o,label:"Email",onDelete:(r,c)=>{r.stopPropagation(),ne(r,c,re[3].options.filterList,"emailSendStatus")}}),update:je},filterOptions:{names:K,fullWidth:!0,logic:ye,display:(o,r,c,S)=>e.jsx(Re,{label:"Email",filterList:o,onChange:r,index:c,column:S,filterValues:K})}}},{label:"Webhook",name:"webhook",width:200,options:{filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:o=>{const{webhook:r}=A[o];if(!r)return null;const c=Object.entries(r)[0];if(!c)return null;const[S,k]=c,H=k[0];return e.jsx(N,{display:"flex",flexDirection:"column",gap:1,children:e.jsxs(N,{className:"webhook-item",fontSize:12,children:[e.jsx(fe,{maxLength:30,children:S},S),e.jsx(le,{status:H.status,updatedAt:H.sendAt,reason:H.failedReason,channel:"webhook",onResend:M=>z(M,A[o],"webhook",[S],!1)})]},S)})}}},{label:i("common.createdAt"),name:"createdAt",width:100,options:{filter:!1,customBodyRenderLite:o=>{const{createdAt:r}=A[o];return e.jsx(ze,{value:r,locale:a,shouldUpdate:!0})}}}],[A,a,b,i]),ge=[e.jsx(Ue,{value:b.dateRange,onChange:Y},"date-picker"),e.jsx(Ae,{variant:"contained",size:"small",color:"primary",loading:w,startIcon:e.jsx(ut,{}),onClick:()=>J(),sx:{".MuiButton-startIcon":{mr:"2px"}},style:{marginLeft:8},children:i("common.refresh")},"refresh")];return e.jsx(N,{sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:e.jsx(ls,{children:e.jsxs(st,{theme:ht(),children:[e.jsx(at,{className:"receivers-table",locale:a,loading:w,columns:re,data:A,onChange:we,options:$,customButtons:ge,components:{TableFilterList:o=>e.jsx(Ve,{...o,itemComponent:r=>e.jsx(Ce,{...r,canDelete:()=>!1})})}}),L.anchorEl&&e.jsx(Ee,{open:!!L.anchorEl,anchorReference:"anchorPosition",anchorPosition:L.position,onClose:u,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs(cs,{children:[e.jsxs(G,{variant:"body1",component:"div",className:"check-title",children:[I==null?void 0:I.channel," Checking"]}),e.jsx(N,{display:"flex",flexDirection:"column",sx:{gap:"4px"},children:h(I==null?void 0:I.channel).map(o=>{var k,H;const{type:r,pass:c,fail:S}=o;return!(I!=null&&I.result)||(k=I==null?void 0:I.result)!=null&&k[r]?e.jsxs(G,{variant:"body1",component:"div",className:"check-item",display:"flex",alignItems:"center",sx:{gap:"4px",color:(H=I==null?void 0:I.result)!=null&&H[r]?ve.success.main:"inherit"},children:[I!=null&&I.result?e.jsx(ct,{}):e.jsx(tt,{size:12,sx:{color:ve.primary.main}}),e.jsx("span",{children:c})]},r):e.jsxs(G,{variant:"body1",component:"div",display:"flex",alignItems:"center",className:"check-item",sx:{gap:"4px",color:ve.error.main},children:[e.jsx(dt,{}),e.jsx("span",{children:S})]},r)})})]})}),_.anchorEl&&e.jsx(Ee,{open:!!_.anchorEl,anchorReference:"anchorPosition",anchorPosition:_.position,onClose:m,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsx(Ge,{loading:n,onCancel:m,onConfirm:D})})]})})})}const rs=v.memo(gt),ls=oe.div`
2
2
  td.MuiTableCell-footer {
3
3
  border: none !important;
4
4
  }
@@ -27,7 +27,7 @@ import{r as v}from"./vendor-react-DoD83n6N.js";import{j as e,E as d,a2 as Fe,R a
27
27
  }
28
28
  font-size: 12px;
29
29
  }
30
- `,ue=t=>t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${(t/1e3).toFixed(1)}K`:t;function ds(t){const{wallet:s,push:n,email:i,webhook:a}=t;return[{name:"Wallet",value:e.jsx(ae,{item:s})},{name:"Push",value:e.jsx(ae,{item:n})},{name:"Email",value:e.jsx(ae,{item:i})},...a.total>0?[{name:"Webhook",value:e.jsx(ae,{item:a,isWebhook:!0})}]:[]]}function us(t,s,n){const{wallet:i,push:a,email:l,webhook:p}=t;return[{name:"Wallet",value:e.jsx(ie,{loading:n,channel:F.NOTIFICATION_SEND_CHANNEL.WALLET,item:i,onResend:s})},{name:"Push",value:e.jsx(ie,{loading:n,channel:F.NOTIFICATION_SEND_CHANNEL.PUSH,item:a,onResend:s})},{name:"Email",value:e.jsx(ie,{loading:n,channel:F.NOTIFICATION_SEND_CHANNEL.EMAIL,item:l,onResend:s})},...p.total>0?[{name:"Webhook",value:e.jsx(ie,{loading:n,channel:F.NOTIFICATION_SEND_CHANNEL.WEBHOOK,item:p,isWebhook:!0,onResend:s})}]:[]]}Ne.propTypes={statistics:d.object.isRequired,onResend:d.func,mode:d.oneOf(["simple","detail"]),resending:d.bool};Ne.defaultProps={mode:"simple",onResend:()=>{},resending:!1};ae.propTypes={item:d.object.isRequired,isWebhook:d.bool};ae.defaultProps={isWebhook:!1};function ae({item:t,isWebhook:s=!1}){const{t:n}=X(),i=s?t.success.length:t.success,a=t.total,l=i===a?"success":"failed";return e.jsx(N,{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:2,children:e.jsx(N,{display:"flex",alignItems:"center",gap:1,children:e.jsxs(te,{config:{status:l},enableTooltip:!1,children:[ue(i)," / ",ue(a)," ",n("notification.sendStatus.success")]})})})}ie.propTypes={item:d.object.isRequired,isWebhook:d.bool,channel:d.string,onResend:d.func,loading:d.bool};ie.defaultProps={isWebhook:!1,channel:F.NOTIFICATION_SEND_CHANNEL.WALLET,onResend:()=>{},loading:!1};function ie({channel:t,item:s,isWebhook:n=!1,onResend:i,loading:a}){const{t:l}=X(),{success:p,failed:f,pending:j}=s,y=is(t),w=n?p.length:p,C=n?f.length:f,A=n?j.length:j,L=async q=>{q.stopPropagation();const R=n?[...new Set([...p,...f].map(T=>T))]:[];await i([t],[],!0,R)},O=w+C,_=O>0?w/O*100:0,I=O>0?C/O*100:0;return e.jsxs(ps,{successRatio:_,failedRatio:I,children:[e.jsxs(G,{variant:"h6",children:[y," (",s.total,")"]}),e.jsxs(G,{variant:"body1",sx:{mb:2},children:[e.jsx("span",{style:{color:Le.success,fontWeight:600,fontSize:24},children:ue(w)}),e.jsx("small",{style:{paddingLeft:4},children:l("notification.sendStatus.success")})]}),e.jsxs(N,{className:"unsent-area",children:[e.jsxs(N,{children:[e.jsxs(te,{config:{status:"failed"},enableTooltip:!1,children:[ue(C)," ",l("notification.sendStatus.failed")]}),e.jsxs(te,{config:{status:"pending"},enableTooltip:!1,children:[ue(A)," ",l("notification.sendStatus.pending")]})]}),C>0&&e.jsx(N,{className:"resend-btn",children:e.jsx(Ae,{size:"small",color:"primary",loading:a,variant:"contained",startIcon:e.jsx(We,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:L,children:l("notification.resend")})})]})]})}function Ne({statistics:t,mode:s="simple",onResend:n,resending:i}){const a=ee(()=>s==="simple"?ds(t):us(t,n,i),[t,s]);return s==="simple"?e.jsx("div",{children:a.map(l=>e.jsx(it,{style:{alignItems:"flex-start",marginBottom:s==="simple"?0:16},valueComponent:"div",nameWidth:100,name:l.name,children:l.value},l.name))}):e.jsx(Xe,{container:!0,spacing:2,children:a.map(l=>e.jsx(Xe,{item:!0,md:4,sm:6,xs:12,children:l.value},l.name))})}const ps=oe(N)`
30
+ `,ue=t=>t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${(t/1e3).toFixed(1)}K`:t;function ds(t){const{wallet:s,push:n,email:i,webhook:a}=t;return[{name:"Wallet",value:e.jsx(ae,{item:s})},{name:"Push",value:e.jsx(ae,{item:n})},{name:"Email",value:e.jsx(ae,{item:i})},...a.total>0?[{name:"Webhook",value:e.jsx(ae,{item:a,isWebhook:!0})}]:[]]}function us(t,s,n){const{wallet:i,push:a,email:l,webhook:p}=t;return[{name:"Wallet",value:e.jsx(ie,{loading:n,channel:F.NOTIFICATION_SEND_CHANNEL.WALLET,item:i,onResend:s})},{name:"Push",value:e.jsx(ie,{loading:n,channel:F.NOTIFICATION_SEND_CHANNEL.PUSH,item:a,onResend:s})},{name:"Email",value:e.jsx(ie,{loading:n,channel:F.NOTIFICATION_SEND_CHANNEL.EMAIL,item:l,onResend:s})},...p.total>0?[{name:"Webhook",value:e.jsx(ie,{loading:n,channel:F.NOTIFICATION_SEND_CHANNEL.WEBHOOK,item:p,isWebhook:!0,onResend:s})}]:[]]}Ne.propTypes={statistics:d.object.isRequired,onResend:d.func,mode:d.oneOf(["simple","detail"]),resending:d.bool};Ne.defaultProps={mode:"simple",onResend:()=>{},resending:!1};ae.propTypes={item:d.object.isRequired,isWebhook:d.bool};ae.defaultProps={isWebhook:!1};function ae({item:t,isWebhook:s=!1}){const{t:n}=X(),i=s?t.success.length:t.success,a=t.total,l=i===a?"success":"failed";return e.jsx(N,{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:2,children:e.jsx(N,{display:"flex",alignItems:"center",gap:1,children:e.jsxs(te,{config:{status:l},enableTooltip:!1,children:[ue(i)," / ",ue(a)," ",n("notification.sendStatus.success")]})})})}ie.propTypes={item:d.object.isRequired,isWebhook:d.bool,channel:d.string,onResend:d.func,loading:d.bool};ie.defaultProps={isWebhook:!1,channel:F.NOTIFICATION_SEND_CHANNEL.WALLET,onResend:()=>{},loading:!1};function ie({channel:t,item:s,isWebhook:n=!1,onResend:i,loading:a}){const{t:l}=X(),{success:p,failed:f,pending:j}=s,y=is(t),w=n?p.length:p,C=n?f.length:f,A=n?j.length:j,O=async q=>{q.stopPropagation();const R=n?[...new Set([...p,...f].map(T=>T))]:[];await i([t],[],!0,R)},L=w+C,_=L>0?w/L*100:0,I=L>0?C/L*100:0;return e.jsxs(ps,{successRatio:_,failedRatio:I,children:[e.jsxs(G,{variant:"h6",children:[y," (",s.total,")"]}),e.jsxs(G,{variant:"body1",sx:{mb:2},children:[e.jsx("span",{style:{color:Oe.success,fontWeight:600,fontSize:24},children:ue(w)}),e.jsx("small",{style:{paddingLeft:4},children:l("notification.sendStatus.success")})]}),e.jsxs(N,{className:"unsent-area",children:[e.jsxs(N,{children:[e.jsxs(te,{config:{status:"failed"},enableTooltip:!1,children:[ue(C)," ",l("notification.sendStatus.failed")]}),e.jsxs(te,{config:{status:"pending"},enableTooltip:!1,children:[ue(A)," ",l("notification.sendStatus.pending")]})]}),C>0&&e.jsx(N,{className:"resend-btn",children:e.jsx(Ae,{size:"small",color:"primary",loading:a,variant:"contained",startIcon:e.jsx(We,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:O,children:l("notification.resend")})})]})]})}function Ne({statistics:t,mode:s="simple",onResend:n,resending:i}){const a=ee(()=>s==="simple"?ds(t):us(t,n,i),[t,s]);return s==="simple"?e.jsx("div",{children:a.map(l=>e.jsx(it,{style:{alignItems:"flex-start",marginBottom:s==="simple"?0:16},valueComponent:"div",nameWidth:100,name:l.name,children:l.value},l.name))}):e.jsx(Xe,{container:!0,spacing:2,children:a.map(l=>e.jsx(Xe,{item:!0,md:4,sm:6,xs:12,children:l.value},l.name))})}const ps=oe(N)`
31
31
  display: flex;
32
32
  flex-direction: column;
33
33
  align-items: flex-start;
@@ -45,7 +45,7 @@ import{r as v}from"./vendor-react-DoD83n6N.js";import{j as e,E as d,a2 as Fe,R a
45
45
  bottom: 0;
46
46
  }
47
47
  }
48
- `;xt.propTypes={notification:d.object.isRequired,onCancel:d.func,blocklet:d.object.isRequired,tab:d.string};function xt({notification:t,onCancel:s=()=>{},blocklet:n,tab:i="info"}){const{t:a,locale:l}=X(),{getComponent:p,resendNotification:f}=Me(),[j,y]=v.useState(!1),w=ee(()=>p(t.componentDid)||n,[n,t.componentDid]),C=Oe({tab:i||"info"}),A=v.useCallback(async(x,P,Z=!0,K=[])=>{var Q;if(!x.length||!t.id)return;const J=P.length>0?P:(Q=t==null?void 0:t.receivers)==null?void 0:Q.map(H=>H.receiver);if(!J.length)return;let B=[...x];if(B.includes(F.NOTIFICATION_SEND_CHANNEL.PUSH)&&!mt(n)&&(V.warning(a("notification.sendStatus.reason.unavailable",{channel:"Push Kit"})),B=B.filter(H=>H!==F.NOTIFICATION_SEND_CHANNEL.PUSH)),B.includes(F.NOTIFICATION_SEND_CHANNEL.EMAIL)&&!ft(n)&&(V.warning(a("notification.sendStatus.reason.unavailable",{channel:"Email"})),B=B.filter(H=>H!==F.NOTIFICATION_SEND_CHANNEL.EMAIL)),!!B.length)try{y(!0),await f({notificationId:t.id,receivers:J,channels:B,resendFailedOnly:Z,...B.includes("webhook")&&K.length?{webhookUrls:K}:{}}),V.success("Message has been sent!")}catch(H){console.error("handleResend error",{error:H}),V.error(H.response?H.response.statusText:H.message)}finally{y(!1)}},[n,t.id,t==null?void 0:t.receivers,f,a]),L=ee(()=>Bt(t),[t]),O=ee(()=>L?t==null?void 0:t.actorInfo:[],[t]),_=ee(()=>{var x;return(n==null?void 0:n.did)||((x=n==null?void 0:n.meta)==null?void 0:x.did)||""},[n]);function I(){return[{name:a("notification.from"),value:L?e.jsx(At,{actors:O,teamDid:_,size:32,showName:!0}):e.jsx(Ot,{size:32,blocklet:w,showName:!0,hideDot:!0})},{name:a("notification.notificationTitle"),value:e.jsx(fe,{maxLength:50,children:t.title})},{name:a("notification.body"),value:L?e.jsx(Lt,{notification:t,blocklet:n}):e.jsx(Pt,{notification:t,rows:0})},{name:a("notification.severity"),value:e.jsx(me,{severity:t.severity})},{name:a("notification.createdAt"),value:e.jsx(ze,{value:t.createdAt,locale:l,shouldUpdate:!0})}].map(P=>e.jsx(it,{style:{alignItems:"flex-start"},valueComponent:"div",nameWidth:120,name:P.name,children:P.value},P.name))}const q={info:{label:a("common.basicInfo"),value:"info",component:I},receivers:{label:a("notification.receiver"),value:"receivers"},statistics:{label:a("notification.statistics"),value:"statistics"}},R=Object.values(q).map(({label:x,value:P})=>({label:x,value:P})),T=q[C.tab]||q.info,b=x=>{C.tab=x};return e.jsx(Rt,{title:a("notification.notificationDetails"),fullWidth:!0,maxWidth:"lg",onClose:()=>{C.tab="info",s()},open:!0,actionsPosition:"left",sx:{".ux-dialog_header":{paddingBottom:0},".MuiDialogContent-root":{paddingTop:0}},children:e.jsxs(ms,{children:[e.jsx(N,{mx:3,className:"tabs",children:e.jsx(Tt,{tabs:R,current:C.tab,onChange:b,scrollButtons:"auto"})}),e.jsxs("div",{className:"body",children:[C.tab==="receivers"&&e.jsx(rs,{notificationId:t.id,resending:j,handleResend:A}),C.tab==="statistics"&&e.jsx(Ne,{statistics:t.statistics,mode:"detail",resending:j,onResend:A}),C.tab==="info"&&e.jsx(T.component,{})]})]})})}const fs=v.memo(xt),ms=oe.div`
48
+ `;xt.propTypes={notification:d.object.isRequired,onCancel:d.func,blocklet:d.object.isRequired,tab:d.string};function xt({notification:t,onCancel:s=()=>{},blocklet:n,tab:i="info"}){const{t:a,locale:l}=X(),{getComponent:p,resendNotification:f}=Me(),[j,y]=v.useState(!1),w=ee(()=>p(t.componentDid)||n,[n,t.componentDid]),C=Le({tab:i||"info"}),A=v.useCallback(async(x,P,Z=!0,K=[])=>{var Q;if(!x.length||!t.id)return;const J=P.length>0?P:(Q=t==null?void 0:t.receivers)==null?void 0:Q.map($=>$.receiver);if(!J.length)return;let B=[...x];if(B.includes(F.NOTIFICATION_SEND_CHANNEL.PUSH)&&!mt(n)&&(V.warning(a("notification.sendStatus.reason.unavailable",{channel:"Push Kit"})),B=B.filter($=>$!==F.NOTIFICATION_SEND_CHANNEL.PUSH)),B.includes(F.NOTIFICATION_SEND_CHANNEL.EMAIL)&&!ft(n)&&(V.warning(a("notification.sendStatus.reason.unavailable",{channel:"Email"})),B=B.filter($=>$!==F.NOTIFICATION_SEND_CHANNEL.EMAIL)),!!B.length)try{y(!0),await f({notificationId:t.id,receivers:J,channels:B,resendFailedOnly:Z,...B.includes("webhook")&&K.length?{webhookUrls:K}:{}}),V.success("Message has been sent!")}catch($){console.error("handleResend error",{error:$}),V.error($.response?$.response.statusText:$.message)}finally{y(!1)}},[n,t.id,t==null?void 0:t.receivers,f,a]),O=ee(()=>Bt(t),[t]),L=ee(()=>O?t==null?void 0:t.actorInfo:[],[t]),_=ee(()=>{var x;return(n==null?void 0:n.did)||((x=n==null?void 0:n.meta)==null?void 0:x.did)||""},[n]);function I(){return[{name:a("notification.from"),value:O?e.jsx(At,{actors:L,teamDid:_,size:32,showName:!0}):e.jsx(Lt,{size:32,blocklet:w,showName:!0,hideDot:!0})},{name:a("notification.notificationTitle"),value:e.jsx(fe,{maxLength:50,children:t.title})},{name:a("notification.body"),value:O?e.jsx(Ot,{notification:t,blocklet:n}):e.jsx(Pt,{notification:t,rows:0})},{name:a("notification.severity"),value:e.jsx(me,{severity:t.severity})},{name:a("notification.createdAt"),value:e.jsx(ze,{value:t.createdAt,locale:l,shouldUpdate:!0})}].map(P=>e.jsx(it,{style:{alignItems:"flex-start"},valueComponent:"div",nameWidth:120,name:P.name,children:P.value},P.name))}const q={info:{label:a("common.basicInfo"),value:"info",component:I},receivers:{label:a("notification.receiver"),value:"receivers"},statistics:{label:a("notification.statistics"),value:"statistics"}},R=Object.values(q).map(({label:x,value:P})=>({label:x,value:P})),T=q[C.tab]||q.info,b=x=>{C.tab=x};return e.jsx(Rt,{title:a("notification.notificationDetails"),fullWidth:!0,maxWidth:"lg",onClose:()=>{C.tab="info",s()},open:!0,actionsPosition:"left",sx:{".ux-dialog_header":{paddingBottom:0},".MuiDialogContent-root":{paddingTop:0}},children:e.jsxs(ms,{children:[e.jsx(N,{mx:3,className:"tabs",children:e.jsx(Tt,{tabs:R,current:C.tab,onChange:b,scrollButtons:"auto"})}),e.jsxs("div",{className:"body",children:[C.tab==="receivers"&&e.jsx(rs,{notificationId:t.id,resending:j,handleResend:A}),C.tab==="statistics"&&e.jsx(Ne,{statistics:t.statistics,mode:"detail",resending:j,onResend:A}),C.tab==="info"&&e.jsx(T.component,{})]})]})})}const fs=v.memo(xt),ms=oe.div`
49
49
  & > .notification-row {
50
50
  padding: 0;
51
51
  }
@@ -92,7 +92,7 @@ import{r as v}from"./vendor-react-DoD83n6N.js";import{j as e,E as d,a2 as Fe,R a
92
92
  overflow: hidden;
93
93
  text-overflow: ellipsis;
94
94
  }
95
- `;function pe({blocklet:t,label:s}){var n;return e.jsx(hs,{children:t?e.jsxs(e.Fragment,{children:[e.jsx(rt,{size:24,blocklet:t,ancestors:t.ancestors}),e.jsx("span",{className:"name",children:t.title||((n=t.meta)==null?void 0:n.title)})]}):e.jsx("span",{className:"name",children:s})})}Ye.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};Ye.defaultProps={onDelete:()=>{}};function Ye({list:t,label:s,onDelete:n}){return e.jsxs(N,{display:"flex",gap:1,alignItems:"center",children:[e.jsxs(G,{children:[s,": "]}),t.map(i=>e.jsx(ke,{size:"small",label:e.jsx(N,{display:"flex",alignItems:"center",sx:{gap:"4px"},children:e.jsx(me,{severity:i})}),onDelete:a=>n(a,i)},i))]})}function gs(t){return e.jsx($e,{...t,renderLabel:s=>e.jsx(me,{severity:s})})}function xs(){var he;const{t,locale:s}=X(),[n,i]=v.useState(!1),{data:a,paging:l,blocklet:p,fetch:f,getComponent:j,componentDids:y,inService:w,teamDid:C}=Me(),A=v.useRef(null),[L,O]=v.useState(null),[_,I]=v.useState("info"),q=`notification-records-${(he=p.meta)==null?void 0:he.did}`,R=It(q),[T,b]=v.useState({pageSize:R.rowsPerPage||10,page:R.page?R.page+1:1,dids:R.dids||[],dateRange:R.dateRange||[U().subtract(1,"month").startOf("day").toDate(),U().endOf("day").toDate()]}),x=ee(()=>{if(!p.children||!p.children.length)return[];const h=[];return p.children.forEach(u=>{var g;const m=u.did||((g=u.meta)==null?void 0:g.did);y.includes(m)&&(u.ancestors=[p],h.push(u))}),h},[y,p]),P=v.useCallback(async()=>{try{i(!0),await f(T),i(!1)}finally{i(!1)}},[f,T]);v.useEffect(()=>{P()},[]),v.useEffect(()=>{const h=setInterval(()=>{document.visibilityState==="visible"&&f(T).then(u=>{const m=u.find(g=>g.id===(L==null?void 0:L.id));L&&m&&O({...m})})},3e3);return()=>clearInterval(h)},[T,L]);const Z=(h,u,m,g)=>{h.stopPropagation();const D=m.filter(E=>E!==u);b(E=>({...E,[g]:D,page:1}))},K=({page:h,rowsPerPage:u,filterList:m})=>{const[g=[],,,,D=[]]=m;T.pageSize!==u?b(E=>({...E,pageSize:u,page:1})):T.page!==h+1?b(E=>({...E,page:h+1})):ce(T.dids,g)?ce(T.severities,D)||b(E=>({...E,severities:D,page:1})):b(E=>({...E,dids:g,page:1}))},J=v.useCallback(()=>{O(null),I("info")},[]),B=v.useCallback(()=>{f(T)},[f,T]),Q=[{label:t("notification.from"),name:"sender",width:400,options:{filter:!0,filterType:"custom",customFilterListOptions:{render:h=>h.map((u,m)=>{var D;if(u==="system")return e.jsx("span",{children:t("notification.system")},`system-${m}`);const g=x.find(E=>{var Y;return(E.did||((Y=E.meta)==null?void 0:Y.did))===u});return e.jsx(pe,{blocklet:g,label:(g==null?void 0:g.title)||((D=g==null?void 0:g.meta)==null?void 0:D.title)},u)}),update:(h,u,m)=>(h[m].splice(u,1),h)},filterOptions:{names:x,logic:(h,u)=>u.length?!u.includes(h):!1,display:(h,u,m,g)=>e.jsxs(_e,{style:{width:"380px"},children:[e.jsx(jt,{id:"demo-simple-select-label",style:{background:"#ffffff"},children:"Sender"}),e.jsxs(yt,{multiple:!0,value:h[m],renderValue:D=>e.jsx(N,{display:"flex",gap:1,alignItems:"center",style:{overflow:"hidden",textOverflow:"ellipsis"},children:D.map(E=>{var Y;if(E==="system")return e.jsx("span",{children:t("notification.system")},E);const z=x.find(ne=>{var ge;return(ne.did||((ge=ne.meta)==null?void 0:ge.did))===E});return e.jsx(pe,{blocklet:z,label:(z==null?void 0:z.title)||((Y=z==null?void 0:z.meta)==null?void 0:Y.title)},E)})}),onChange:D=>{h[m]=D.target.value,u(h[m],m,g)},children:[e.jsx(Je,{value:"system",children:t("notification.system")}),x.map(D=>{var z,Y;const E=D.did||((z=D.meta)==null?void 0:z.did);return e.jsx(Je,{value:E,children:e.jsx(pe,{blocklet:D,label:D.title||((Y=D.meta)==null?void 0:Y.title)})},E)})]})]})},customBodyRenderLite:h=>{var g,D;const u=a[h],m=j(u.componentDid);return e.jsxs(N,{display:"flex",alignItems:"center",gap:1,children:[m?e.jsx(rt,{size:32,blocklet:m,ancestors:m.ancestors??[]}):e.jsx(zt,{blocklet:p,size:32}),e.jsx(fe,{maxLength:50,children:((g=m==null?void 0:m.meta)==null?void 0:g.title)||((D=p==null?void 0:p.meta)==null?void 0:D.title)})]})}}},{label:t("notification.receiver"),name:"receivers",width:300,options:{filter:!1,customBodyRenderLite:h=>{const u=a[h],{receivers:m}=u;return e.jsx(St,{total:m.length,renderSurplus:g=>g<100?e.jsxs("span",{children:["+",g]}):e.jsx("span",{children:"99+"}),max:3,sx:{justifyContent:"flex-end",height:"32px",".MuiAvatar-root":{width:"32px",height:"32px",fontSize:"12px",border:0,zIndex:2}},onClick:g=>{g.stopPropagation(),O(u),I("receivers")},children:m.map(g=>{const{receiverUser:D}=g,E=ot(D.avatar,C,w);return e.jsx(nt,{alt:D.fullName,src:`${E}?imageFilter=resize&w=48&h=48`,size:32,did:g.receiver,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}},g.receiver)})})}}},{label:t("notification.statistics"),name:"statistics",width:400,options:{filter:!1,customBodyRenderLite:h=>{const u=a[h];return e.jsx(N,{onClick:m=>{m.stopPropagation(),O(u),I("statistics")},children:e.jsx(Ne,{statistics:u.statistics})})}}},{label:t("notification.notificationPreview"),name:"data",options:{filter:!1,customBodyRenderLite:h=>{const u=a[h];return e.jsx(fe,{maxLength:50,children:u.title})}}},{label:t("notification.severity"),name:"severity",width:200,options:{setCellProps:()=>({className:"severity-cell"}),customBodyRenderLite:h=>{const u=a[h];return e.jsx(me,{severity:u.severity})},filter:!0,filterType:"custom",filterList:T.severities??[],customFilterListOptions:{render:h=>e.jsx(Ye,{list:h,label:t("notification.severity"),onDelete:(u,m)=>{u.stopPropagation(),Z(u,m,Q[4].options.filterList,"severities")}}),update:je},filterOptions:{names:Ze,fullWidth:!0,logic:ye,display:(h,u,m,g)=>e.jsx(gs,{label:t("notification.severity"),filterList:h,onChange:u,index:m,column:g,filterValues:Ze})}}},{label:t("common.createdAt"),name:"createdAt",width:300,options:{filter:!1,customBodyRenderLite:h=>{const{createdAt:u}=a[h];return e.jsx(ze,{value:u,locale:s,shouldUpdate:!0})}}}],H=h=>{b(u=>({...u,dateRange:h,page:1}))},we=[e.jsx(Ue,{value:T.dateRange,onChange:H})];return e.jsxs(N,{ref:A,sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:[e.jsx(bs,{children:e.jsx(st,{theme:ht(),children:e.jsx(at,{className:"main-data",verticalKeyWidth:100,loading:n,locale:s,columns:Q,data:a,durable:q,onChange:K,options:{sort:!1,download:!1,print:!1,search:!1,expandableRowsOnClick:!0,page:l.page-1,rowsPerPage:l.pageSize,count:l.total,...R,onRowClick:(h,{dataIndex:u})=>{O(a[u])}},customButtons:we,components:{TableFilterList:h=>e.jsx(Ve,{...h,itemComponent:u=>e.jsx(Ce,{...u,canDelete:m=>{var D;const g=(D=m==null?void 0:m.columnNames)==null?void 0:D[(m==null?void 0:m.index)||0];return(g==null?void 0:g.name)==="sender"}})})}})})}),L&&e.jsx(fs,{refresh:B,onCancel:J,notification:L,blocklet:p,tab:_})]})}const bs=oe.div`
95
+ `;function pe({blocklet:t,label:s}){var n;return e.jsx(hs,{children:t?e.jsxs(e.Fragment,{children:[e.jsx(rt,{size:24,blocklet:t,ancestors:t.ancestors}),e.jsx("span",{className:"name",children:t.title||((n=t.meta)==null?void 0:n.title)})]}):e.jsx("span",{className:"name",children:s})})}Ye.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};Ye.defaultProps={onDelete:()=>{}};function Ye({list:t,label:s,onDelete:n}){return e.jsxs(N,{display:"flex",gap:1,alignItems:"center",children:[e.jsxs(G,{children:[s,": "]}),t.map(i=>e.jsx(ke,{size:"small",label:e.jsx(N,{display:"flex",alignItems:"center",sx:{gap:"4px"},children:e.jsx(me,{severity:i})}),onDelete:a=>n(a,i)},i))]})}function gs(t){return e.jsx(He,{...t,renderLabel:s=>e.jsx(me,{severity:s})})}function xs(){var he;const{t,locale:s}=X(),[n,i]=v.useState(!1),{data:a,paging:l,blocklet:p,fetch:f,getComponent:j,componentDids:y,inService:w,teamDid:C}=Me(),A=v.useRef(null),[O,L]=v.useState(null),[_,I]=v.useState("info"),q=`notification-records-${(he=p.meta)==null?void 0:he.did}`,R=It(q),[T,b]=v.useState({pageSize:R.rowsPerPage||10,page:R.page?R.page+1:1,dids:R.dids||[],dateRange:R.dateRange||[U().subtract(1,"month").startOf("day").toDate(),U().endOf("day").toDate()]}),x=ee(()=>{if(!p.children||!p.children.length)return[];const h=[];return p.children.forEach(u=>{var g;const m=u.did||((g=u.meta)==null?void 0:g.did);y.includes(m)&&(u.ancestors=[p],h.push(u))}),h},[y,p]),P=v.useCallback(async()=>{try{i(!0),await f(T),i(!1)}finally{i(!1)}},[f,T]);v.useEffect(()=>{P()},[]),v.useEffect(()=>{const h=setInterval(()=>{document.visibilityState==="visible"&&f(T).then(u=>{const m=u.find(g=>g.id===(O==null?void 0:O.id));O&&m&&L({...m})})},3e3);return()=>clearInterval(h)},[T,O]);const Z=(h,u,m,g)=>{h.stopPropagation();const D=m.filter(E=>E!==u);b(E=>({...E,[g]:D,page:1}))},K=({page:h,rowsPerPage:u,filterList:m})=>{const[g=[],,,,D=[]]=m;T.pageSize!==u?b(E=>({...E,pageSize:u,page:1})):T.page!==h+1?b(E=>({...E,page:h+1})):ce(T.dids,g)?ce(T.severities,D)||b(E=>({...E,severities:D,page:1})):b(E=>({...E,dids:g,page:1}))},J=v.useCallback(()=>{L(null),I("info")},[]),B=v.useCallback(()=>{f(T)},[f,T]),Q=[{label:t("notification.from"),name:"sender",width:400,options:{filter:!0,filterType:"custom",customFilterListOptions:{render:h=>h.map((u,m)=>{var D;if(u==="system")return e.jsx("span",{children:t("notification.system")},`system-${m}`);const g=x.find(E=>{var Y;return(E.did||((Y=E.meta)==null?void 0:Y.did))===u});return e.jsx(pe,{blocklet:g,label:(g==null?void 0:g.title)||((D=g==null?void 0:g.meta)==null?void 0:D.title)},u)}),update:(h,u,m)=>(h[m].splice(u,1),h)},filterOptions:{names:x,logic:(h,u)=>u.length?!u.includes(h):!1,display:(h,u,m,g)=>e.jsxs(_e,{style:{width:"380px"},children:[e.jsx(jt,{id:"demo-simple-select-label",style:{background:"#ffffff"},children:"Sender"}),e.jsxs(yt,{multiple:!0,value:h[m],renderValue:D=>e.jsx(N,{display:"flex",gap:1,alignItems:"center",style:{overflow:"hidden",textOverflow:"ellipsis"},children:D.map(E=>{var Y;if(E==="system")return e.jsx("span",{children:t("notification.system")},E);const z=x.find(ne=>{var ge;return(ne.did||((ge=ne.meta)==null?void 0:ge.did))===E});return e.jsx(pe,{blocklet:z,label:(z==null?void 0:z.title)||((Y=z==null?void 0:z.meta)==null?void 0:Y.title)},E)})}),onChange:D=>{h[m]=D.target.value,u(h[m],m,g)},children:[e.jsx(Je,{value:"system",children:t("notification.system")}),x.map(D=>{var z,Y;const E=D.did||((z=D.meta)==null?void 0:z.did);return e.jsx(Je,{value:E,children:e.jsx(pe,{blocklet:D,label:D.title||((Y=D.meta)==null?void 0:Y.title)})},E)})]})]})},customBodyRenderLite:h=>{var g,D;const u=a[h],m=j(u.componentDid);return e.jsxs(N,{display:"flex",alignItems:"center",gap:1,children:[m?e.jsx(rt,{size:32,blocklet:m,ancestors:m.ancestors??[]}):e.jsx(zt,{blocklet:p,size:32}),e.jsx(fe,{maxLength:50,children:((g=m==null?void 0:m.meta)==null?void 0:g.title)||((D=p==null?void 0:p.meta)==null?void 0:D.title)})]})}}},{label:t("notification.receiver"),name:"receivers",width:300,options:{filter:!1,customBodyRenderLite:h=>{const u=a[h],{receivers:m}=u;return e.jsx(St,{total:m.length,renderSurplus:g=>g<100?e.jsxs("span",{children:["+",g]}):e.jsx("span",{children:"99+"}),max:3,sx:{justifyContent:"flex-end",height:"32px",".MuiAvatar-root":{width:"32px",height:"32px",fontSize:"12px",border:0,zIndex:2}},onClick:g=>{g.stopPropagation(),L(u),I("receivers")},children:m.map(g=>{const{receiverUser:D}=g,E=ot(D.avatar,C,w);return e.jsx(nt,{alt:D.fullName,src:`${E}?imageFilter=resize&w=48&h=48`,size:32,did:g.receiver,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}},g.receiver)})})}}},{label:t("notification.statistics"),name:"statistics",width:400,options:{filter:!1,customBodyRenderLite:h=>{const u=a[h];return e.jsx(N,{onClick:m=>{m.stopPropagation(),L(u),I("statistics")},children:e.jsx(Ne,{statistics:u.statistics})})}}},{label:t("notification.notificationPreview"),name:"data",options:{filter:!1,customBodyRenderLite:h=>{const u=a[h];return e.jsx(fe,{maxLength:50,children:u.title})}}},{label:t("notification.severity"),name:"severity",width:200,options:{setCellProps:()=>({className:"severity-cell"}),customBodyRenderLite:h=>{const u=a[h];return e.jsx(me,{severity:u.severity})},filter:!0,filterType:"custom",filterList:T.severities??[],customFilterListOptions:{render:h=>e.jsx(Ye,{list:h,label:t("notification.severity"),onDelete:(u,m)=>{u.stopPropagation(),Z(u,m,Q[4].options.filterList,"severities")}}),update:je},filterOptions:{names:Ze,fullWidth:!0,logic:ye,display:(h,u,m,g)=>e.jsx(gs,{label:t("notification.severity"),filterList:h,onChange:u,index:m,column:g,filterValues:Ze})}}},{label:t("common.createdAt"),name:"createdAt",width:300,options:{filter:!1,customBodyRenderLite:h=>{const{createdAt:u}=a[h];return e.jsx(ze,{value:u,locale:s,shouldUpdate:!0})}}}],$=h=>{b(u=>({...u,dateRange:h,page:1}))},we=[e.jsx(Ue,{value:T.dateRange,onChange:$})];return e.jsxs(N,{ref:A,sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:[e.jsx(bs,{children:e.jsx(st,{theme:ht(),children:e.jsx(at,{className:"main-data",verticalKeyWidth:100,loading:n,locale:s,columns:Q,data:a,durable:q,onChange:K,options:{sort:!1,download:!1,print:!1,search:!1,expandableRowsOnClick:!0,page:l.page-1,rowsPerPage:l.pageSize,count:l.total,...R,onRowClick:(h,{dataIndex:u})=>{L(a[u])}},customButtons:we,components:{TableFilterList:h=>e.jsx(Ve,{...h,itemComponent:u=>e.jsx(Ce,{...u,canDelete:m=>{var D;const g=(D=m==null?void 0:m.columnNames)==null?void 0:D[(m==null?void 0:m.index)||0];return(g==null?void 0:g.name)==="sender"}})})}})})}),O&&e.jsx(fs,{refresh:B,onCancel:J,notification:O,blocklet:p,tab:_})]})}const bs=oe.div`
96
96
  td.MuiTableCell-footer {
97
97
  border: none !important;
98
98
  }
@@ -0,0 +1,11 @@
1
+ import{r as d}from"./vendor-react-DoD83n6N.js";import{E as l,j as n,a4 as g,b2 as G,M as H,I as O,a3 as U,bW as Y,aa as J}from"./vendor-mui-core-DxqV1NVn.js";import{bj as Q,b3 as Z,d as v}from"./vendor-ux-did-connect-YqGDzQ2U.js";import{d as ee}from"./Done-uAJ8-whC.js";import{C as te}from"./Google-blbcHt2R.js";import{aa as ne,f as re}from"./index-DZAi-K_N.js";import{R as oe,F as se,L as ie}from"./logo-uploader-Bzpld3yG.js";const S={description:l.string,editing:l.bool,onChange:l.func,required:l.bool,value:l.any,componentProps:l.object,render:l.func,renderFormItem:l.func};function _({editing:r,value:o,onChange:a}){const[c,u]=d.useState(!1),m=d.useRef(),p=d.useRef(o);d.useEffect(()=>{let s=null;return r&&(s=setTimeout(()=>{u(!0)},50)),()=>{clearTimeout(s)}},[r]);const b=s=>{p.current=s,a(s)},k=()=>{u(!1),a(p.current)},C=n.jsx(g,{className:"form-item-input slot",px:1,children:n.jsxs(g,{display:"flex",alignItems:"center",children:[o,o!=="auto"&&n.jsx("div",{style:{marginLeft:4,backgroundColor:o,width:"1em",height:"1em",borderRadius:"0.2em"}})]})}),f=n.jsxs(g,{display:"flex",flexGrow:1,alignItems:"center",height:"40px",onKeyDown:k,children:[n.jsx(g,{display:"flex",alignItems:"center",onClick:()=>u(!0),children:n.jsx("div",{ref:m,style:{flexShrink:0,marginLeft:"8px",backgroundColor:o,width:"32px",height:"32px",boxSizing:"border-box",borderRadius:"8px",border:"1px solid #eee",cursor:o==="auto"?"default":"pointer"}})}),n.jsx(G,{open:c,anchorEl:m.current,onClose:()=>u(!1),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},children:n.jsx(te,{color:o,onChange:s=>b(s.hex)})})]});return r?f:C}_.propTypes=S;function D({editing:r,description:o,value:a,onChange:c,componentProps:u,...m}){const{placeholder:p}=u,b=d.useRef(a),{t:k}=d.useContext(Q),C=s=>{s.key==="Enter"&&c(b.current,"confirm")},f=s=>{b.current=s,c(s)};return r?n.jsx(H,{style:{flex:1},fullWidth:!0,value:a,onChange:s=>{s.persist(),f(s.target.value)},autoFocus:!0,size:"small",variant:"outlined",placeholder:o||p,onKeyDown:C,...m}):n.jsx(g,{px:1,className:"form-item-input slot",children:a||n.jsx("span",{className:"placeholder",children:k("common.requiredInputPlaceholder",{name:o||p})})})}D.propTypes=S;D.defaultProps={componentProps:{}};function T({editing:r,value:o,onChange:a,componentProps:c,...u}){const{blocklet:m}=c,p=o==="auto"?Z.getPassportColorFromDid(m.appDid):o;return n.jsxs(g,{display:"flex",alignItems:"center",children:[n.jsx("div",{style:{width:96,marginRight:12},dangerouslySetInnerHTML:{__html:ne({title:"Owner",issuer:re.getDisplayName(m),issuerDid:m.appDid,ownerName:"Your Name",ownerDid:m.appDid,preferredColor:o||"auto"})}}),n.jsx(_,{...u,editing:r,value:r?p:o,onChange:a,componentProps:c})]})}T.propTypes={...S,componentProps:l.shape({blocklet:l.object.isRequired}).isRequired};T.defaultProps={};const ae=Y`
2
+ 0%, 100% {
3
+ transform: scale(1) translateX(0);
4
+ }
5
+ 50% {
6
+ transform: scale(1.05) translateX(-3px);
7
+ }
8
+ 25%, 75% {
9
+ transform: scale(1.1) translateX(3px);
10
+ }
11
+ `,le={input:D,color:_,passport:T,uploader:r=>n.jsx(ie,{...r.componentProps})};function ce(r,{editing:o=!1}){const{componentType:a="input",render:c,renderFormItem:u}=r;return o&&u?u:!o&&c?c:le[a==null?void 0:a.toLowerCase()]}function z({schema:r,loading:o,value:a,defaultValue:c,onChange:u,style:m,disabled:p}){const b=Object.prototype.toString.call(a)==="[object Object]",[k,C]=d.useState([]),[f,s]=d.useState(b?a:c),V=d.useMemo(()=>r.length===1,[r]),h=d.useCallback(e=>k.find(t=>t.key===e),[k]);d.useEffect(()=>{var e;V&&((e=r[0])!=null&&e.required)&&C([{key:r[0].key,editing:!0,initialValue:c[r[0].key]}])},[r,V,c]);const I=d.useCallback(e=>{C(t=>t.find(i=>i.key===e.key)?t.map(i=>i.key===e.key?e:{...i}):[e].concat(t))},[]),P=d.useCallback((e,t,x)=>{const{key:i,secure:w}=e,y=h(i)??{...e};y.editing=!0;const R=f[i]!==t;y.edited=t&&y.initialValue!==t,y.initialValue=c[i];const j={...f,[i]:t};R&&s(j),u({[i]:t},{allValues:j,action:x,currentItem:e}),x==="confirm"&&w&&s({...f,[i]:"__encrypted__"}),x==="confirm"&&(y.initialValue=f[i]),["confirm","cancel"].includes(x)&&(y.editing=!1,y.edited=!1),I(y)},[c,f,u,I,h]);function K(e,{editing:t=!1}){const{key:x}=e,i=b?a[x]:f[x];return i==="__encrypted__"?t?"":"******":i}const F=d.useCallback(e=>{const t=h(e.key);t&&P(e,t.initialValue,"cancel")},[h,P]),q=d.useCallback(e=>{const t=h(e.key);!t||!t.edited||(t.shaking=!0,I(t),setTimeout(()=>{t.shaking=!1,I(t)},500))},[h,I]),B=d.useCallback(e=>{const t=h(e.key);!t||!t.edited?F(e):q(e)},[h,q,F]);return n.jsx(de,{className:"form",style:m,children:r==null?void 0:r.map(e=>{const{key:t,description:x,required:i,solo:w=!1,hidden:y=!1,componentProps:L={},skipButtonDisabled:R=!1}=e;if(y)return null;const j=h(t),{editing:E,shaking:M}=j??{},N=K(e,{editing:E}),W=ce(e,{editing:E}),X={inputProps:{"data-cy":"schema-form-item-component"},key:t,description:x,editing:E,value:N,onChange:($,A="change")=>P(e,$,A),componentProps:L,skipButtonDisabled:R,onBlur:()=>B(e)};return n.jsxs(g,{className:"form-item",children:[!w&&n.jsxs(g,{className:"form-item-label",style:{color:i&&!N?"#ff0000":"#333"},children:[x,i&&n.jsx(oe,{})]}),n.jsxs(g,{className:"form-item-body",children:[n.jsx(g,{className:"form-item-input","data-cy":"schema-form-item-edit",sx:{textAlign:w?"center":"left"},style:{cursor:"text"},onClick:()=>{p||j!=null&&j.edited||R||P(e,f[t],"edit")},children:n.jsx(W,{...X})}),!w&&n.jsx(g,{className:"form-item-action",style:{marginLeft:0},children:E?n.jsxs(n.Fragment,{children:[j.edited?n.jsx(O,{"data-cy":"schema-form-item-confirm",onClick:()=>{P(e,N,"confirm")},disabled:p||o,sx:{animation:M?`${ae} 0.5s linear`:"none"},style:{paddingRight:4},size:"large",children:o?n.jsx(U,{size:24}):n.jsx(ee,{})}):null,n.jsx(O,{"data-cy":"schema-form-item-cancel",onClick:()=>F(e),style:{paddingLeft:j.edited?4:8},disabled:p||o,size:"large",children:n.jsx(v,{})})]}):null})]})]},t)})})}z.propTypes={schema:l.array.isRequired,loading:l.bool,onChange:l.func.isRequired,value:l.object,defaultValue:l.object,style:l.object,disabled:l.bool};z.defaultProps={loading:!1,value:void 0,defaultValue:{},style:{},disabled:!1};const de=J(se)``;export{z as S};