@abtnode/webapp 1.16.44-beta-20250526-130644-5e05dc90 → 1.16.44-beta-20250528-003415-7a5e5d90

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 (207) hide show
  1. package/blocklet.js +1 -1
  2. package/blocklet.yml +1 -1
  3. package/dist/assets/{AdapterDayjs-bsD4OAFM.js → AdapterDayjs-jFq0UWbd.js} +1 -1
  4. package/dist/assets/{Add-BYFWsyUF.js → Add-DTqXwW0N.js} +1 -1
  5. package/dist/assets/{ArrowDropDown-b23Ws4Dh.js → ArrowDropDown-0HCdgPxM.js} +1 -1
  6. package/dist/assets/{Autocomplete-Cbi7HzEa.js → Autocomplete-BYtQlJN2.js} +1 -1
  7. package/dist/assets/{Breadcrumbs-C_csYT5C.js → Breadcrumbs-CgmOQ_4k.js} +1 -1
  8. package/dist/assets/{ButtonGroup-BbvSuEoF.js → ButtonGroup-DqXuhqTn.js} +1 -1
  9. package/dist/assets/{CSSTransition-CJ-9QKlG.js → CSSTransition-CSF6lDgV.js} +1 -1
  10. package/dist/assets/{CallMerge-SZDzfJgb.js → CallMerge-BAR1CVFk.js} +1 -1
  11. package/dist/assets/{CardContent-BCodnoZu.js → CardContent-BqJnOH3m.js} +1 -1
  12. package/dist/assets/{ChevronLeft-BCWTA2ES.js → ChevronLeft-CGdwfN-l.js} +1 -1
  13. package/dist/assets/{ChevronRight-B8F_ru7A.js → ChevronRight-Bj9Dx-t_.js} +1 -1
  14. package/dist/assets/{Clear-n1FkleT7.js → Clear-CRBYarsa.js} +1 -1
  15. package/dist/assets/{Close-Cem8y-ph.js → Close-C9PKpEMp.js} +1 -1
  16. package/dist/assets/{Community-stiBX7J2.js → Community-CBnFvaWW.js} +1 -1
  17. package/dist/assets/{Delete-D0GFkYtH.js → Delete-C3LWwjqe.js} +1 -1
  18. package/dist/assets/{Delete-CwKOurFN.js → Delete-DlSWg7eg.js} +1 -1
  19. package/dist/assets/{DeleteOutline-CSi3y8ZI.js → DeleteOutline-5qAShT9Y.js} +1 -1
  20. package/dist/assets/{Done-D3hzYYUk.js → Done-CFH2iz5e.js} +1 -1
  21. package/dist/assets/{Edit-DUZ7gP_b.js → Edit-Co5BQerz.js} +1 -1
  22. package/dist/assets/{ErrorOutline-zzYP4d-G.js → ErrorOutline-QNgelF6z.js} +1 -1
  23. package/dist/assets/{HelpOutline-BtTkcIQl.js → HelpOutline-DeEYOkJi.js} +1 -1
  24. package/dist/assets/{Holiday-CFhQLlq2.js → Holiday-CtZZm1wa.js} +1 -1
  25. package/dist/assets/{Launch-C-pZPEtf.js → Launch-BRFCKSJq.js} +1 -1
  26. package/dist/assets/{Link-DoRwHSx9.js → Link-CXQij6OR.js} +1 -1
  27. package/dist/assets/{ListItemButton-C4nle7Vw.js → ListItemButton-DzUr79Sz.js} +1 -1
  28. package/dist/assets/{ListSubheader-CN5kB_3v.js → ListSubheader-DQqgb2yu.js} +1 -1
  29. package/dist/assets/{LoadingButton-DzOnJ8zq.js → LoadingButton-D2TB2UiI.js} +1 -1
  30. package/dist/assets/{LockIcon-DzCd9ccj.js → LockIcon-BPfDiFv0.js} +1 -1
  31. package/dist/assets/{Meeting-1bsu0vcq.js → Meeting-BKSUCsIc.js} +1 -1
  32. package/dist/assets/{MoreHoriz-DC7IikA2.js → MoreHoriz-Bx_Om50v.js} +1 -1
  33. package/dist/assets/{MoreVert-CrQ5BD1O.js → MoreVert-w75snDQs.js} +1 -1
  34. package/dist/assets/{OffSick-xV6w5rWa.js → OffSick-D6cKjiM0.js} +1 -1
  35. package/dist/assets/{OpenInNew-DeXzob2p.js → OpenInNew-CSKLA26V.js} +1 -1
  36. package/dist/assets/{Public-B575ztUz.js → Public-BhHHVMRE.js} +1 -1
  37. package/dist/assets/{Refresh-2rMRmiq8.js → Refresh-BwkLbOVU.js} +1 -1
  38. package/dist/assets/{SchemaReference.es-Dde3PXx0.js → SchemaReference.es-CokzFsv5.js} +1 -1
  39. package/dist/assets/{Search-DlTi3_X0.js → Search-YHtyGibW.js} +1 -1
  40. package/dist/assets/{Slider-DVwffPl5.js → Slider-IbRqxtbE.js} +1 -1
  41. package/dist/assets/{Stepper-DBIHjo83.js → Stepper-CnVr1egz.js} +1 -1
  42. package/dist/assets/{Switch-Qp41_PVH.js → Switch-Dt84DR0H.js} +1 -1
  43. package/dist/assets/{TableRow-CDB9WIef.js → TableRow-Bvi-hC54.js} +1 -1
  44. package/dist/assets/{TableSearch-C_ybT7kk.js → TableSearch-3PXeI6hz.js} +1 -1
  45. package/dist/assets/{ToggleButtonGroup-C-CIJkUk.js → ToggleButtonGroup-CeXjKQIC.js} +1 -1
  46. package/dist/assets/{Verified-CLm0sUb6.js → Verified-CDTmywG7.js} +1 -1
  47. package/dist/assets/{VerifiedUser-Cz-5rgpe.js → VerifiedUser-CFJTQaF3.js} +1 -1
  48. package/dist/assets/{ViewColumn-Db8V4QN9.js → ViewColumn-lUXnk2yu.js} +1 -1
  49. package/dist/assets/{ViewList-BaTy1Ph1.js → ViewList-DRI2pLPW.js} +1 -1
  50. package/dist/assets/{WorkingRemotely-C_qc4360.js → WorkingRemotely-ny604xCG.js} +1 -1
  51. package/dist/assets/{_createAggregator-CEr_MPC5.js → _createAggregator-ClP6Cm9L.js} +1 -1
  52. package/dist/assets/{actions-DQy4Y2na.js → actions-Bv8xSPmq.js} +1 -1
  53. package/dist/assets/{actions-DveJjfxt.js → actions-CuQoe9ro.js} +1 -1
  54. package/dist/assets/{agreement-DeYzUIM7.js → agreement-lauLYxz3.js} +1 -1
  55. package/dist/assets/api-Bwpwhvmw.js +1 -0
  56. package/dist/assets/{appearance-DbHWwKo-.js → appearance-R6pCalNk.js} +1 -1
  57. package/dist/assets/{audit-logs-DWljSpy4.js → audit-logs-PeOew4LK.js} +1 -1
  58. package/dist/assets/{base-chart-CneSkRrp.js → base-chart-BHYVZ1Je.js} +1 -1
  59. package/dist/assets/{blocklet-BNsbNDuf.js → blocklet-ztLpKfcq.js} +1 -1
  60. package/dist/assets/{brace-fold.es-CHQJKmOH.js → brace-fold.es-D0r7X0ju.js} +1 -1
  61. package/dist/assets/{chain-DZftcLJ3.js → chain-DGcvJwBH.js} +1 -1
  62. package/dist/assets/{click-to-copy-ADdBawgq.js → click-to-copy-C-Mvzzk0.js} +1 -1
  63. package/dist/assets/cloneDeep-CQRRTnm9.js +1 -0
  64. package/dist/assets/{closebrackets.es-DDKcuj7l.js → closebrackets.es-DaqRgn_7.js} +1 -1
  65. package/dist/assets/{codemirror.es-CDd3nIcD.js → codemirror.es-CfIYuCsS.js} +1 -1
  66. package/dist/assets/{collapse-S-vTWAhi.js → collapse-CtX6Q5OE.js} +1 -1
  67. package/dist/assets/{comment.es-BCYde1B6.js → comment.es-Obb_rrHd.js} +1 -1
  68. package/dist/assets/{config-navigation-CNRkvto9.js → config-navigation-d-hkol10.js} +3 -3
  69. package/dist/assets/{connect-to-Dr4HhNJU.js → connect-to-_sVZRdFn.js} +1 -1
  70. package/dist/assets/{delete-confirm-DoYSwIFx.js → delete-confirm-8IsMhNfe.js} +1 -1
  71. package/dist/assets/{detail-B9ggyBgZ.js → detail-uVfu7mmV.js} +3 -3
  72. package/dist/assets/{dialog.es-MsWV9Nfp.js → dialog.es-SmbBknMt.js} +1 -1
  73. package/dist/assets/{domains-B3WgGegI.js → domains-DVbEaFc-.js} +1 -1
  74. package/dist/assets/{download-CCFD10FS.js → download-BhaEzFmY.js} +1 -1
  75. package/dist/assets/emotion-react.browser.esm-C7FmDYVX.js +1 -0
  76. package/dist/assets/{foldgutter.es-Dlj2we2Y.js → foldgutter.es-CnQ7PIpm.js} +1 -1
  77. package/dist/assets/{get-safe-url-DWTB-tRE.js → get-safe-url-BnKD7fjX.js} +1 -1
  78. package/dist/assets/{get-safe-url-h3P_Qh4v.js → get-safe-url-CtJu_FcU.js} +1 -1
  79. package/dist/assets/getValidReactChildren-C169OtBB.js +1 -0
  80. package/dist/assets/{hint.es-Dy1C7k3I.js → hint.es-gkCfoe9H.js} +1 -1
  81. package/dist/assets/{hint.es2-NY7C4sAJ.js → hint.es2-CwjbpV60.js} +1 -1
  82. package/dist/assets/{iframe-Cs_wGN9V.js → iframe-B5FbPH5I.js} +1 -1
  83. package/dist/assets/{index-BoDwKZkr.js → index-B0SCwFpt.js} +1 -1
  84. package/dist/assets/{index-DjfLAu4m.js → index-BBUEHNQ4.js} +1 -1
  85. package/dist/assets/{index-B4oRLjo7.js → index-BGANteup.js} +1 -1
  86. package/dist/assets/{index-BuuM5jo8.js → index-BOob6bmx.js} +5 -5
  87. package/dist/assets/{index-DhUL5M2s.js → index-BPPbe7Ly.js} +1 -1
  88. package/dist/assets/{index-BPpMhVpd.js → index-BPe1hR7R.js} +3 -3
  89. package/dist/assets/{index-e66xJJ-x.js → index-BbonVJKD.js} +116 -116
  90. package/dist/assets/{index-CNOx9gM8.js → index-Bk6_2RlM.js} +1 -1
  91. package/dist/assets/{index-f9QTV2yS.js → index-Bs8cSBPh.js} +1 -1
  92. package/dist/assets/{index-BA0q44b7.js → index-BsFHSz5F.js} +1 -1
  93. package/dist/assets/{index-BIr1sHAt.js → index-C0SfTeU5.js} +1 -1
  94. package/dist/assets/{index-JsgthZUN.js → index-C1Pho2dB.js} +1 -1
  95. package/dist/assets/{index-bbeMAhGa.js → index-CEhsrtIa.js} +1 -1
  96. package/dist/assets/{index-D5xjISzz.js → index-CJxcYJLK.js} +1 -1
  97. package/dist/assets/{index-Btu-tCxx.js → index-CMsTph0_.js} +1 -1
  98. package/dist/assets/{index-1REZAjOu.js → index-CNVBgJcy.js} +1 -1
  99. package/dist/assets/{index-Bt1dFWNc.js → index-CS2M01En.js} +1 -1
  100. package/dist/assets/{index-EWwtp8EM.js → index-CTjLU7vX.js} +1 -1
  101. package/dist/assets/{index-PRwzODZo.js → index-CVOEL3Gp.js} +1 -1
  102. package/dist/assets/{index-rsJnFyyL.js → index-C_84W9Fm.js} +1 -1
  103. package/dist/assets/{index-1k7DvKxH.js → index-CaIW_cPG.js} +1 -1
  104. package/dist/assets/{index-0U-vrSlK.js → index-Cha8AEfb.js} +1 -1
  105. package/dist/assets/{index-1l3rmmE5.js → index-Cotu4R77.js} +1 -1
  106. package/dist/assets/{index-Dx0P0x6J.js → index-CtuwR1sA.js} +1 -1
  107. package/dist/assets/{index-MgaM83zd.js → index-CxHMQs9m.js} +1 -1
  108. package/dist/assets/{index-DM-X6w1C.js → index-CxYFOfNB.js} +1 -1
  109. package/dist/assets/{index-c-0gMptp.js → index-DA6HVDyx.js} +1 -1
  110. package/dist/assets/{index-DjMNpYZS.js → index-DFrfo67i.js} +1 -1
  111. package/dist/assets/{index-Co9nkuve.js → index-DGB-iK2Y.js} +1 -1
  112. package/dist/assets/{index-gkWEdVLt.js → index-DG_FSP3T.js} +1 -1
  113. package/dist/assets/index-DGa0JEU6.js +1 -0
  114. package/dist/assets/index-DJaOwfhS.js +41 -0
  115. package/dist/assets/{index-BI9Br-d5.js → index-DJt958VA.js} +1 -1
  116. package/dist/assets/{index-BTVRLsIg.js → index-DLWDtECG.js} +1 -1
  117. package/dist/assets/{index-CSOOaDVw.js → index-DMWWH-Y9.js} +3 -3
  118. package/dist/assets/{index-DuTpAxAe.js → index-DP9Hxqjf.js} +3 -3
  119. package/dist/assets/{index-Bm4jeiDa.js → index-DUntKj7y.js} +1 -1
  120. package/dist/assets/{index-IViEbtE5.js → index-DmtgaYFg.js} +1 -1
  121. package/dist/assets/{index-CuFXa0mJ.js → index-GIIeTjtx.js} +1 -1
  122. package/dist/assets/{index-BKivhg3S.js → index-IK7f-_29.js} +1 -1
  123. package/dist/assets/{index-7iYq2V4L.js → index-LVdFbQrm.js} +1 -1
  124. package/dist/assets/{index-Cvhm7Tb9.js → index-YV1oiFK2.js} +1 -1
  125. package/dist/assets/{index-Cjt_N1wY.js → index-Z8uAvilC.js} +1 -1
  126. package/dist/assets/{index-CIH-dF5H.js → index-cgrbzc6D.js} +1 -1
  127. package/dist/assets/{index-Vn3yqa3y.js → index-dZUhu4al.js} +1 -1
  128. package/dist/assets/{index-BeEM_0q3.js → index-igL_j9mT.js} +1 -1
  129. package/dist/assets/{index-DuQ11Re2.js → index-oZ9KIv19.js} +1 -1
  130. package/dist/assets/{index-RNqR3FXM.js → index-pKJXF5_b.js} +5 -5
  131. package/dist/assets/{index-_Y4g7Ki7.js → index-zzCN19ij.js} +1 -1
  132. package/dist/assets/{index.esm-BiZwp2sI.js → index.esm-DQhqo8hM.js} +1 -1
  133. package/dist/assets/{info-addon.es-ipFCgBgs.js → info-addon.es-DvIhfDpC.js} +1 -1
  134. package/dist/assets/{info.es-CXZgqePH.js → info.es-Bri-_MhX.js} +1 -1
  135. package/dist/assets/{install-from-url-CSiK3Yao.js → install-from-url-BO7wobBK.js} +1 -1
  136. package/dist/assets/{invitation-D6ia_iSD.js → invitation-oNb4r7x5.js} +1 -1
  137. package/dist/assets/is-path-prefix-equal-Dcl3Dpc2.js +1 -0
  138. package/dist/assets/{item-11xHJrBQ.js → item-BTj4eHCb.js} +1 -1
  139. package/dist/assets/{javascript.es-BOFqQkgH.js → javascript.es-Uakm0f2H.js} +1 -1
  140. package/dist/assets/{jump-to-line.es-Cx_iKetf.js → jump-to-line.es-CK5tO2wK.js} +1 -1
  141. package/dist/assets/{jump.es-UmQ5eqNY.js → jump.es-sXmaNAPB.js} +1 -1
  142. package/dist/assets/{lint.es-CkuzJ0c7.js → lint.es-ph9YB1LC.js} +1 -1
  143. package/dist/assets/{lint.es2-CPQEeICW.js → lint.es2-QoEEHeh3.js} +1 -1
  144. package/dist/assets/{lint.es3-B2trihuW.js → lint.es3-DPm8l1RE.js} +1 -1
  145. package/dist/assets/{list-header-ovy1bk-e.js → list-header-EIjqu6Bb.js} +1 -1
  146. package/dist/assets/{log--8P_TkIi.js → log-D7iyaOA3.js} +1 -1
  147. package/dist/assets/{lottie-react.esm-BWBFsFNg.js → lottie-react.esm--z6GyRUO.js} +1 -1
  148. package/dist/assets/{matchbrackets.es-DnV41gw8.js → matchbrackets.es-BpNRzm5X.js} +1 -1
  149. package/dist/assets/{memory-CLu87brV.js → memory-_Cfdc6eg.js} +1 -1
  150. package/dist/assets/{metric-CgjE4Yze.js → metric-CEHee5mz.js} +1 -1
  151. package/dist/assets/{mode.es-CikDBGfg.js → mode.es-CPqJNtl_.js} +1 -1
  152. package/dist/assets/{mode.es2-C1ydBzoH.js → mode.es2-DSL_TIwg.js} +1 -1
  153. package/dist/assets/{mode.es3-dTgcRvSz.js → mode.es3-DGQgWSc2.js} +1 -1
  154. package/dist/assets/omit-BSmdwFJv.js +1 -0
  155. package/dist/assets/{onlineParser.es-CWgvKSNI.js → onlineParser.es-BrkC1Rxw.js} +1 -1
  156. package/dist/assets/{overview-APoIqy5P.js → overview-D1biLPCD.js} +1 -1
  157. package/dist/assets/{permission-CtZli8Hf.js → permission-CWix4PtW.js} +1 -1
  158. package/dist/assets/{preference-0MD46HXq.js → preference-D99hgSUh.js} +3 -3
  159. package/dist/assets/{raf-schd.esm-CjWurqZc.js → raf-schd.esm-Bg2vGkG6.js} +1 -1
  160. package/dist/assets/refType-zKgXx_ar.js +1 -0
  161. package/dist/assets/{resource-dialog-DtmI53Zf.js → resource-dialog-CCtMXZiw.js} +4 -4
  162. package/dist/assets/{runtime-BjHuHXy7.js → runtime-CUQISXx6.js} +1 -1
  163. package/dist/assets/{schema-DG7Gb1Zp.js → schema-DA-E-9cd.js} +1 -1
  164. package/dist/assets/sdk-C-ut0VQ6.js +1 -0
  165. package/dist/assets/{search.es-sAbvHQqG.js → search.es-vxqs3CoJ.js} +1 -1
  166. package/dist/assets/{searchcursor.es-BiTKqSTz.js → searchcursor.es-BIY3U3Jt.js} +1 -1
  167. package/dist/assets/{service-yH9ZzgNY.js → service-cI5sUn7i.js} +1 -1
  168. package/dist/assets/{shorten-label-w_L-1NYs.js → shorten-label-CrkBaee5.js} +1 -1
  169. package/dist/assets/{show-hint.es-nq7hJT2o.js → show-hint.es-BNALS2hN.js} +1 -1
  170. package/dist/assets/{simple-select-N7r4TYd1.js → simple-select-DHpiGJRj.js} +1 -1
  171. package/dist/assets/{spaces-BTe9w9go.js → spaces-DyBB-5Eg.js} +1 -1
  172. package/dist/assets/{status-DTf_MR_m.js → status-Bs7sjvnO.js} +1 -1
  173. package/dist/assets/{status-DRBez5Qf.js → status-DTKEarT9.js} +1 -1
  174. package/dist/assets/{sublime.es-DZ-Kt_RU.js → sublime.es-B-ZAyGKa.js} +1 -1
  175. package/dist/assets/{switch-control-Cohshryy.js → switch-control-DpFXMKLS.js} +1 -1
  176. package/dist/assets/{table-icons-Bs7Hkb6l.js → table-icons-DU8hTbxC.js} +1 -1
  177. package/dist/assets/{table-tips-BLg1K8Th.js → table-tips-D9nXnglU.js} +1 -1
  178. package/dist/assets/{team-BczhIV16.js → team-8WMHXK3a.js} +1 -1
  179. package/dist/assets/{toLower-PXiIHwDf.js → toLower-OpLhWDaq.js} +1 -1
  180. package/dist/assets/toUpper-B4jRVv5E.js +1 -0
  181. package/dist/assets/{traffic-CoY4yr_p.js → traffic-CRZc451k.js} +1 -1
  182. package/dist/assets/{url-evaluation-DRKjUU7g.js → url-evaluation-CtyhxHau.js} +1 -1
  183. package/dist/assets/{url-join-CM2acrDe.js → url-join-DP1r7KXa.js} +1 -1
  184. package/dist/assets/{use-mobile-D02_HykR.js → use-mobile-7OX4w2nG.js} +1 -1
  185. package/dist/assets/{use-mobile-B7_S05ne.js → use-mobile-iVwM_YK-.js} +1 -1
  186. package/dist/assets/{useAsync-D-2V_lHb.js → useAsync-DtAj-sLJ.js} +1 -1
  187. package/dist/assets/{useAsyncRetry-DYNhhV2W.js → useAsyncRetry-De8O7cnw.js} +1 -1
  188. package/dist/assets/{useLocalStorage-ChdS5XVQ.js → useLocalStorage-Bp8WWQpB.js} +1 -1
  189. package/dist/assets/{useThemeProps-Dk-4jx1U.js → useThemeProps-DmvmZB1-.js} +1 -1
  190. package/dist/assets/{util-wc6KkzlL.js → util-CAGtQj-e.js} +1 -1
  191. package/dist/assets/{wait-container-BIM4llf9.js → wait-container-BdSj3R09.js} +1 -1
  192. package/dist/assets/{withStyles-Dcw4_09o.js → withStyles-B62bDqhH.js} +1 -1
  193. package/dist/assets/{wrap-locale-B6I84qwC.js → wrap-locale-DOaCGmjV.js} +1 -1
  194. package/dist/index.html +1 -1
  195. package/dist/service-worker.js +1 -1
  196. package/package.json +1 -1
  197. package/dist/assets/api-sNy9Buh2.js +0 -1
  198. package/dist/assets/cloneDeep-JEYtEd7F.js +0 -1
  199. package/dist/assets/emotion-react.browser.esm-BsFIkhYD.js +0 -1
  200. package/dist/assets/getValidReactChildren-DTJlyDSN.js +0 -1
  201. package/dist/assets/index-Bnl28jeD.js +0 -41
  202. package/dist/assets/index-CcKekV6p.js +0 -1
  203. package/dist/assets/is-path-prefix-equal-CF4M2MVl.js +0 -1
  204. package/dist/assets/omit-zgah02wK.js +0 -1
  205. package/dist/assets/refType-CrQ6NnaY.js +0 -1
  206. package/dist/assets/sdk-CGbU2sfF.js +0 -1
  207. package/dist/assets/toUpper-Cv02sfIb.js +0 -1
@@ -1,4 +1,4 @@
1
- import{C}from"./codemirror.es-CDd3nIcD.js";import"./show-hint.es-nq7hJT2o.js";import{R as a,C as m,g as A,i as F,T as fe,S as Te,a as ge,I as Ee,G as H,b as O,d as me,e as ve,f as Se,h as ye,j as Ie,D as E,v as De,p as Fe,k as w,l as Ne,m as P,n as z,K as Y,o as be,q as _e,r as Ae}from"./index-RNqR3FXM.js";import{P as ke,C as Q}from"./Range.es-DaV7MD2W.js";import{o as Oe}from"./onlineParser.es-CWgvKSNI.js";import{S as J,T as K,a as $}from"./introspection.es-CPJcz6nz.js";import"./index-e66xJJ-x.js";var Me=Object.defineProperty,T=(t,r)=>Me(t,"name",{value:r,configurable:!0});function W(t){let r;return j(t,i=>{switch(i.kind){case"Query":case"ShortQuery":case"Mutation":case"Subscription":case"FragmentDefinition":r=i;break}}),r}T(W,"getDefinitionState");function V(t,r,i){return i===J.name&&t.getQueryType()===r?J:i===K.name&&t.getQueryType()===r?K:i===$.name&&F(r)?$:"getFields"in r?r.getFields()[i]:null}T(V,"getFieldDef");function j(t,r){const i=[];let n=t;for(;n!=null&&n.kind;)i.push(n),n=n.prevState;for(let e=i.length-1;e>=0;e--)r(i[e])}T(j,"forEachState");function N(t){const r=Object.keys(t),i=r.length,n=new Array(i);for(let e=0;e<i;++e)n[e]=t[r[e]];return n}T(N,"objectValues");function I(t,r){return X(r,G(t.string))}T(I,"hintList");function X(t,r){if(!r)return h(t,n=>!n.isDeprecated);const i=t.map(n=>({proximity:Z(G(n.label),r),entry:n}));return h(h(i,n=>n.proximity<=2),n=>!n.entry.isDeprecated).sort((n,e)=>(n.entry.isDeprecated?1:0)-(e.entry.isDeprecated?1:0)||n.proximity-e.proximity||n.entry.label.length-e.entry.label.length).map(n=>n.entry)}T(X,"filterAndSortList");function h(t,r){const i=t.filter(r);return i.length===0?t:i}T(h,"filterNonEmpty");function G(t){return t.toLowerCase().replace(/\W/g,"")}T(G,"normalizeText");function Z(t,r){let i=q(r,t);return t.length>r.length&&(i-=t.length-r.length-1,i+=t.indexOf(r)===0?0:.5),i}T(Z,"getProximity");function q(t,r){let i,n;const e=[],l=t.length,o=r.length;for(i=0;i<=l;i++)e[i]=[i];for(n=1;n<=o;n++)e[0][n]=n;for(i=1;i<=l;i++)for(n=1;n<=o;n++){const u=t[i-1]===r[n-1]?0:1;e[i][n]=Math.min(e[i-1][n]+1,e[i][n-1]+1,e[i-1][n-1]+u),i>1&&n>1&&t[i-1]===r[n-2]&&t[i-2]===r[n-1]&&(e[i][n]=Math.min(e[i][n],e[i-2][n-2]+u))}return e[l][o]}T(q,"lexicalDistance");const ee={command:"editor.action.triggerSuggest",title:"Suggestions"},Le=T(t=>{const r=[];if(t)try{De(Fe(t),{FragmentDefinition(i){r.push(i)}})}catch{return[]}return r},"collectFragmentDefs");function ne(t,r,i,n,e,l){var o;const u=Object.assign(Object.assign({},l),{schema:t}),s=n||ue(r,i),c=s.state.kind==="Invalid"?s.state.prevState:s.state;if(!c)return[];const p=c.kind,g=c.step,S=pe(t,s.state);if(p===a.DOCUMENT)return I(s,[{label:"query",kind:m.Function},{label:"mutation",kind:m.Function},{label:"subscription",kind:m.Function},{label:"fragment",kind:m.Function},{label:"{",kind:m.Constructor}]);if(p===a.IMPLEMENTS||p===a.NAMED_TYPE&&((o=c.prevState)===null||o===void 0?void 0:o.kind)===a.IMPLEMENTS)return re(s,c,t,r,S);if(p===a.SELECTION_SET||p===a.FIELD||p===a.ALIASED_FIELD)return te(s,S,u);if(p===a.ARGUMENTS||p===a.ARGUMENT&&g===0){const d=S.argDefs;if(d)return I(s,d.map(f=>{var v;return{label:f.name,insertText:f.name+": ",command:ee,detail:String(f.type),documentation:(v=f.description)!==null&&v!==void 0?v:void 0,kind:m.Variable,type:f.type}}))}if((p===a.OBJECT_VALUE||p===a.OBJECT_FIELD&&g===0)&&S.objectFieldDefs){const d=N(S.objectFieldDefs),f=p===a.OBJECT_VALUE?m.Value:m.Field;return I(s,d.map(v=>{var D;return{label:v.name,detail:String(v.type),documentation:(D=v.description)!==null&&D!==void 0?D:void 0,kind:f,type:v.type}}))}if(p===a.ENUM_VALUE||p===a.LIST_VALUE&&g===1||p===a.OBJECT_FIELD&&g===2||p===a.ARGUMENT&&g===2)return ie(s,S,r,t);if(p===a.VARIABLE&&g===1){const d=A(S.inputType),f=B(r,t,s);return I(s,f.filter(v=>v.detail===(d==null?void 0:d.name)))}return p===a.TYPE_CONDITION&&g===1||p===a.NAMED_TYPE&&c.prevState!=null&&c.prevState.kind===a.TYPE_CONDITION?ae(s,S,t):p===a.FRAGMENT_SPREAD&&g===1?oe(s,S,t,r,Array.isArray(e)?e:Le(e)):p===a.VARIABLE_DEFINITION&&g===2||p===a.LIST_TYPE&&g===1||p===a.NAMED_TYPE&&c.prevState&&(c.prevState.kind===a.VARIABLE_DEFINITION||c.prevState.kind===a.LIST_TYPE||c.prevState.kind===a.NON_NULL_TYPE)?le(s,t):p===a.DIRECTIVE?ce(s,c,t):[]}T(ne,"getAutocompleteSuggestions");const R=` {
1
+ import{C}from"./codemirror.es-CfIYuCsS.js";import"./show-hint.es-BNALS2hN.js";import{R as a,C as m,g as A,i as F,T as fe,S as Te,a as ge,I as Ee,G as H,b as O,d as me,e as ve,f as Se,h as ye,j as Ie,D as E,v as De,p as Fe,k as w,l as Ne,m as P,n as z,K as Y,o as be,q as _e,r as Ae}from"./index-pKJXF5_b.js";import{P as ke,C as Q}from"./Range.es-DaV7MD2W.js";import{o as Oe}from"./onlineParser.es-BrkC1Rxw.js";import{S as J,T as K,a as $}from"./introspection.es-CPJcz6nz.js";import"./index-BbonVJKD.js";var Me=Object.defineProperty,T=(t,r)=>Me(t,"name",{value:r,configurable:!0});function W(t){let r;return j(t,i=>{switch(i.kind){case"Query":case"ShortQuery":case"Mutation":case"Subscription":case"FragmentDefinition":r=i;break}}),r}T(W,"getDefinitionState");function V(t,r,i){return i===J.name&&t.getQueryType()===r?J:i===K.name&&t.getQueryType()===r?K:i===$.name&&F(r)?$:"getFields"in r?r.getFields()[i]:null}T(V,"getFieldDef");function j(t,r){const i=[];let n=t;for(;n!=null&&n.kind;)i.push(n),n=n.prevState;for(let e=i.length-1;e>=0;e--)r(i[e])}T(j,"forEachState");function N(t){const r=Object.keys(t),i=r.length,n=new Array(i);for(let e=0;e<i;++e)n[e]=t[r[e]];return n}T(N,"objectValues");function I(t,r){return X(r,G(t.string))}T(I,"hintList");function X(t,r){if(!r)return h(t,n=>!n.isDeprecated);const i=t.map(n=>({proximity:Z(G(n.label),r),entry:n}));return h(h(i,n=>n.proximity<=2),n=>!n.entry.isDeprecated).sort((n,e)=>(n.entry.isDeprecated?1:0)-(e.entry.isDeprecated?1:0)||n.proximity-e.proximity||n.entry.label.length-e.entry.label.length).map(n=>n.entry)}T(X,"filterAndSortList");function h(t,r){const i=t.filter(r);return i.length===0?t:i}T(h,"filterNonEmpty");function G(t){return t.toLowerCase().replace(/\W/g,"")}T(G,"normalizeText");function Z(t,r){let i=q(r,t);return t.length>r.length&&(i-=t.length-r.length-1,i+=t.indexOf(r)===0?0:.5),i}T(Z,"getProximity");function q(t,r){let i,n;const e=[],l=t.length,o=r.length;for(i=0;i<=l;i++)e[i]=[i];for(n=1;n<=o;n++)e[0][n]=n;for(i=1;i<=l;i++)for(n=1;n<=o;n++){const u=t[i-1]===r[n-1]?0:1;e[i][n]=Math.min(e[i-1][n]+1,e[i][n-1]+1,e[i-1][n-1]+u),i>1&&n>1&&t[i-1]===r[n-2]&&t[i-2]===r[n-1]&&(e[i][n]=Math.min(e[i][n],e[i-2][n-2]+u))}return e[l][o]}T(q,"lexicalDistance");const ee={command:"editor.action.triggerSuggest",title:"Suggestions"},Le=T(t=>{const r=[];if(t)try{De(Fe(t),{FragmentDefinition(i){r.push(i)}})}catch{return[]}return r},"collectFragmentDefs");function ne(t,r,i,n,e,l){var o;const u=Object.assign(Object.assign({},l),{schema:t}),s=n||ue(r,i),c=s.state.kind==="Invalid"?s.state.prevState:s.state;if(!c)return[];const p=c.kind,g=c.step,S=pe(t,s.state);if(p===a.DOCUMENT)return I(s,[{label:"query",kind:m.Function},{label:"mutation",kind:m.Function},{label:"subscription",kind:m.Function},{label:"fragment",kind:m.Function},{label:"{",kind:m.Constructor}]);if(p===a.IMPLEMENTS||p===a.NAMED_TYPE&&((o=c.prevState)===null||o===void 0?void 0:o.kind)===a.IMPLEMENTS)return re(s,c,t,r,S);if(p===a.SELECTION_SET||p===a.FIELD||p===a.ALIASED_FIELD)return te(s,S,u);if(p===a.ARGUMENTS||p===a.ARGUMENT&&g===0){const d=S.argDefs;if(d)return I(s,d.map(f=>{var v;return{label:f.name,insertText:f.name+": ",command:ee,detail:String(f.type),documentation:(v=f.description)!==null&&v!==void 0?v:void 0,kind:m.Variable,type:f.type}}))}if((p===a.OBJECT_VALUE||p===a.OBJECT_FIELD&&g===0)&&S.objectFieldDefs){const d=N(S.objectFieldDefs),f=p===a.OBJECT_VALUE?m.Value:m.Field;return I(s,d.map(v=>{var D;return{label:v.name,detail:String(v.type),documentation:(D=v.description)!==null&&D!==void 0?D:void 0,kind:f,type:v.type}}))}if(p===a.ENUM_VALUE||p===a.LIST_VALUE&&g===1||p===a.OBJECT_FIELD&&g===2||p===a.ARGUMENT&&g===2)return ie(s,S,r,t);if(p===a.VARIABLE&&g===1){const d=A(S.inputType),f=B(r,t,s);return I(s,f.filter(v=>v.detail===(d==null?void 0:d.name)))}return p===a.TYPE_CONDITION&&g===1||p===a.NAMED_TYPE&&c.prevState!=null&&c.prevState.kind===a.TYPE_CONDITION?ae(s,S,t):p===a.FRAGMENT_SPREAD&&g===1?oe(s,S,t,r,Array.isArray(e)?e:Le(e)):p===a.VARIABLE_DEFINITION&&g===2||p===a.LIST_TYPE&&g===1||p===a.NAMED_TYPE&&c.prevState&&(c.prevState.kind===a.VARIABLE_DEFINITION||c.prevState.kind===a.LIST_TYPE||c.prevState.kind===a.NON_NULL_TYPE)?le(s,t):p===a.DIRECTIVE?ce(s,c,t):[]}T(ne,"getAutocompleteSuggestions");const R=` {
2
2
  $1
3
3
  }`,Ce=T(t=>{const r=t.type;return F(r)||w(r)&&F(r.ofType)||Ne(r)&&(F(r.ofType)||w(r.ofType)&&F(r.ofType.ofType))?R:null},"getInsertText");function te(t,r,i){var n;if(r.parentType){const e=r.parentType;let l=[];return"getFields"in e&&(l=N(e.getFields())),F(e)&&l.push(fe),e===((n=i==null?void 0:i.schema)===null||n===void 0?void 0:n.getQueryType())&&l.push(Te,ge),I(t,l.map((o,u)=>{var s;const c={sortText:String(u)+o.name,label:o.name,detail:String(o.type),documentation:(s=o.description)!==null&&s!==void 0?s:void 0,deprecated:!!o.deprecationReason,isDeprecated:!!o.deprecationReason,deprecationReason:o.deprecationReason,kind:m.Field,type:o.type},p=Ce(o);return p&&(c.insertText=o.name+p,c.insertTextFormat=Ee.Snippet,c.command=ee),c}))}return[]}T(te,"getSuggestionsForFieldNames");function ie(t,r,i,n){const e=A(r.inputType),l=B(i,n,t).filter(o=>o.detail===e.name);if(e instanceof H){const o=e.getValues();return I(t,o.map(u=>{var s;return{label:u.name,detail:String(e),documentation:(s=u.description)!==null&&s!==void 0?s:void 0,deprecated:!!u.deprecationReason,isDeprecated:!!u.deprecationReason,deprecationReason:u.deprecationReason,kind:m.EnumMember,type:e}}).concat(l))}else if(e===O)return I(t,l.concat([{label:"true",detail:String(O),documentation:"Not false.",kind:m.Variable,type:O},{label:"false",detail:String(O),documentation:"Not true.",kind:m.Variable,type:O}]));return l}T(ie,"getSuggestionsForInputValues");function re(t,r,i,n,e){if(r.needsSeparator)return[];const l=i.getTypeMap(),o=N(l).filter(me),u=o.map(({name:d})=>d),s=new Set;M(n,(d,f)=>{var v,D,_,b,y;if(f.name&&(f.kind===a.INTERFACE_DEF&&!u.includes(f.name)&&s.add(f.name),f.kind===a.NAMED_TYPE&&((v=f.prevState)===null||v===void 0?void 0:v.kind)===a.IMPLEMENTS)){if(e.interfaceDef){if((D=e.interfaceDef)===null||D===void 0?void 0:D.getInterfaces().find(({name:x})=>x===f.name))return;const U=i.getType(f.name),k=(_=e.interfaceDef)===null||_===void 0?void 0:_.toConfig();e.interfaceDef=new P(Object.assign(Object.assign({},k),{interfaces:[...k.interfaces,U||new P({name:f.name,fields:{}})]}))}else if(e.objectTypeDef){if((b=e.objectTypeDef)===null||b===void 0?void 0:b.getInterfaces().find(({name:x})=>x===f.name))return;const U=i.getType(f.name),k=(y=e.objectTypeDef)===null||y===void 0?void 0:y.toConfig();e.objectTypeDef=new z(Object.assign(Object.assign({},k),{interfaces:[...k.interfaces,U||new P({name:f.name,fields:{}})]}))}}});const c=e.interfaceDef||e.objectTypeDef,g=((c==null?void 0:c.getInterfaces())||[]).map(({name:d})=>d),S=o.concat([...s].map(d=>({name:d}))).filter(({name:d})=>d!==(c==null?void 0:c.name)&&!g.includes(d));return I(t,S.map(d=>{const f={label:d.name,kind:m.Interface,type:d};return d!=null&&d.description&&(f.documentation=d.description),f}))}T(re,"getSuggestionsForImplements");function ae(t,r,i,n){let e;if(r.parentType)if(ve(r.parentType)){const l=Se(r.parentType),o=i.getPossibleTypes(l),u=Object.create(null);o.forEach(s=>{s.getInterfaces().forEach(c=>{u[c.name]=c})}),e=o.concat(N(u))}else e=[r.parentType];else{const l=i.getTypeMap();e=N(l).filter(F)}return I(t,e.map(l=>{const o=A(l);return{label:String(l),documentation:(o==null?void 0:o.description)||"",kind:m.Field}}))}T(ae,"getSuggestionsForFragmentTypeConditions");function oe(t,r,i,n,e){if(!n)return[];const l=i.getTypeMap(),o=W(t.state),u=se(n);e&&e.length>0&&u.push(...e);const s=u.filter(c=>l[c.typeCondition.name.value]&&!(o&&o.kind===a.FRAGMENT_DEFINITION&&o.name===c.name.value)&&F(r.parentType)&&F(l[c.typeCondition.name.value])&&ye(i,r.parentType,l[c.typeCondition.name.value]));return I(t,s.map(c=>({label:c.name.value,detail:String(l[c.typeCondition.name.value]),documentation:`fragment ${c.name.value} on ${c.typeCondition.name.value}`,kind:m.Field,type:l[c.typeCondition.name.value]})))}T(oe,"getSuggestionsForFragmentSpread");const Re=T((t,r)=>{var i,n,e,l,o,u,s,c,p,g;if(((i=t.prevState)===null||i===void 0?void 0:i.kind)===r)return t.prevState;if(((e=(n=t.prevState)===null||n===void 0?void 0:n.prevState)===null||e===void 0?void 0:e.kind)===r)return t.prevState.prevState;if(((u=(o=(l=t.prevState)===null||l===void 0?void 0:l.prevState)===null||o===void 0?void 0:o.prevState)===null||u===void 0?void 0:u.kind)===r)return t.prevState.prevState.prevState;if(((g=(p=(c=(s=t.prevState)===null||s===void 0?void 0:s.prevState)===null||c===void 0?void 0:c.prevState)===null||p===void 0?void 0:p.prevState)===null||g===void 0?void 0:g.kind)===r)return t.prevState.prevState.prevState.prevState},"getParentDefinition");function B(t,r,i){let n=null,e;const l=Object.create({});return M(t,(o,u)=>{if((u==null?void 0:u.kind)===a.VARIABLE&&u.name&&(n=u.name),(u==null?void 0:u.kind)===a.NAMED_TYPE&&n){const s=Re(u,a.TYPE);s!=null&&s.type&&(e=r.getType(s==null?void 0:s.type))}n&&e&&(l[n]||(l[n]={detail:e.toString(),insertText:i.string==="$"?n:"$"+n,label:n,type:e,kind:m.Variable},n=null,e=null))}),N(l)}T(B,"getVariableCompletions");function se(t){const r=[];return M(t,(i,n)=>{n.kind===a.FRAGMENT_DEFINITION&&n.name&&n.type&&r.push({kind:a.FRAGMENT_DEFINITION,name:{kind:Y.NAME,value:n.name},selectionSet:{kind:a.SELECTION_SET,selections:[]},typeCondition:{kind:a.NAMED_TYPE,name:{kind:Y.NAME,value:n.type}}})}),r}T(se,"getFragmentDefinitions");function le(t,r,i){const n=r.getTypeMap(),e=N(n).filter(Ie);return I(t,e.map(l=>({label:l.name,documentation:l.description,kind:m.Variable})))}T(le,"getSuggestionsForVariableDefinition");function ce(t,r,i,n){var e;if(!((e=r.prevState)===null||e===void 0)&&e.kind){const l=i.getDirectives().filter(o=>de(r.prevState,o));return I(t,l.map(o=>({label:o.name,documentation:o.description||"",kind:m.Function})))}return[]}T(ce,"getSuggestionsForDirective");function ue(t,r){let i=null,n=null,e=null;const l=M(t,(o,u,s,c)=>{if(c===r.line&&o.getCurrentPosition()>=r.character)return i=s,n=Object.assign({},u),e=o.current(),"BREAK"});return{start:l.start,end:l.end,string:e||l.string,state:n||l.state,style:i||l.style}}T(ue,"getTokenAtPosition");function M(t,r){const i=t.split(`
4
4
  `),n=Oe();let e=n.startState(),l="",o=new Q("");for(let u=0;u<i.length;u++){for(o=new Q(i[u]);!o.eol()&&(l=n.token(o,e),r(o,e,l,u)!=="BREAK"););r(o,e,l,u),e.kind||(e=n.startState())}return{start:o.getStartOfToken(),end:o.getCurrentPosition(),string:o.current(),state:e,style:l}}T(M,"runOnlineParser");function de(t,r){var i;if(!t||!t.kind)return!1;const n=t.kind,e=r.locations;switch(n){case a.QUERY:return e.indexOf(E.QUERY)!==-1;case a.MUTATION:return e.indexOf(E.MUTATION)!==-1;case a.SUBSCRIPTION:return e.indexOf(E.SUBSCRIPTION)!==-1;case a.FIELD:case a.ALIASED_FIELD:return e.indexOf(E.FIELD)!==-1;case a.FRAGMENT_DEFINITION:return e.indexOf(E.FRAGMENT_DEFINITION)!==-1;case a.FRAGMENT_SPREAD:return e.indexOf(E.FRAGMENT_SPREAD)!==-1;case a.INLINE_FRAGMENT:return e.indexOf(E.INLINE_FRAGMENT)!==-1;case a.SCHEMA_DEF:return e.indexOf(E.SCHEMA)!==-1;case a.SCALAR_DEF:return e.indexOf(E.SCALAR)!==-1;case a.OBJECT_TYPE_DEF:return e.indexOf(E.OBJECT)!==-1;case a.FIELD_DEF:return e.indexOf(E.FIELD_DEFINITION)!==-1;case a.INTERFACE_DEF:return e.indexOf(E.INTERFACE)!==-1;case a.UNION_DEF:return e.indexOf(E.UNION)!==-1;case a.ENUM_DEF:return e.indexOf(E.ENUM)!==-1;case a.ENUM_VALUE:return e.indexOf(E.ENUM_VALUE)!==-1;case a.INPUT_DEF:return e.indexOf(E.INPUT_OBJECT)!==-1;case a.INPUT_VALUE_DEF:switch((i=t.prevState)===null||i===void 0?void 0:i.kind){case a.ARGUMENTS_DEF:return e.indexOf(E.ARGUMENT_DEFINITION)!==-1;case a.INPUT_DEF:return e.indexOf(E.INPUT_FIELD_DEFINITION)!==-1}}return!1}T(de,"canUseDirective");function pe(t,r){let i,n,e,l,o,u,s,c,p,g,S;return j(r,d=>{var f;switch(d.kind){case a.QUERY:case"ShortQuery":g=t.getQueryType();break;case a.MUTATION:g=t.getMutationType();break;case a.SUBSCRIPTION:g=t.getSubscriptionType();break;case a.INLINE_FRAGMENT:case a.FRAGMENT_DEFINITION:d.type&&(g=t.getType(d.type));break;case a.FIELD:case a.ALIASED_FIELD:{!g||!d.name?o=null:(o=p?V(t,p,d.name):null,g=o?o.type:null);break}case a.SELECTION_SET:p=A(g);break;case a.DIRECTIVE:e=d.name?t.getDirective(d.name):null;break;case a.INTERFACE_DEF:d.name&&(s=null,S=new P({name:d.name,interfaces:[],fields:{}}));break;case a.OBJECT_TYPE_DEF:d.name&&(S=null,s=new z({name:d.name,interfaces:[],fields:{}}));break;case a.ARGUMENTS:{if(!d.prevState)n=null;else switch(d.prevState.kind){case a.FIELD:n=o&&o.args;break;case a.DIRECTIVE:n=e&&e.args;break;case a.ALIASED_FIELD:{const y=(f=d.prevState)===null||f===void 0?void 0:f.name;if(!y){n=null;break}const L=p?V(t,p,y):null;if(!L){n=null;break}n=L.args;break}default:n=null;break}break}case a.ARGUMENT:if(n){for(let y=0;y<n.length;y++)if(n[y].name===d.name){i=n[y];break}}u=i==null?void 0:i.type;break;case a.ENUM_VALUE:const v=A(u);l=v instanceof H?v.getValues().find(y=>y.value===d.name):null;break;case a.LIST_VALUE:const D=_e(u);u=D instanceof Ae?D.ofType:null;break;case a.OBJECT_VALUE:const _=A(u);c=_ instanceof be?_.getFields():null;break;case a.OBJECT_FIELD:const b=d.name&&c?c[d.name]:null;u=b==null?void 0:b.type;break;case a.NAMED_TYPE:d.name&&(g=t.getType(d.name));break}}),{argDef:i,argDefs:n,directiveDef:e,enumValue:l,fieldDef:o,inputType:u,objectFieldDefs:c,parentType:p,type:g,interfaceDef:S,objectTypeDef:s}}T(pe,"getTypeInfo");C.registerHelper("hint","graphql",(t,r)=>{const i=r.schema;if(!i)return;const n=t.getCursor(),e=t.getTokenAt(n),l=e.type!==null&&/"|\w/.test(e.string[0])?e.start:e.end,o=new ke(n.line,l),s={list:ne(i,t.getValue(),o,e,r.externalFragments).map(c=>({text:c.label,type:c.type,description:c.documentation,isDeprecated:c.isDeprecated,deprecationReason:c.deprecationReason})),from:{line:n.line,ch:l},to:{line:n.line,ch:e.end}};return s!=null&&s.list&&s.list.length>0&&(s.from=C.Pos(s.from.line,s.from.ch),s.to=C.Pos(s.to.line,s.to.ch),C.signal(t,"hasCompletion",t,s,e)),s});
@@ -1 +1 @@
1
- import{C as u}from"./codemirror.es-CDd3nIcD.js";import{f as j}from"./forEachState.es-D8bf0zSr.js";import{g,o as b,G as O,b as d,q as N,r as D}from"./index-RNqR3FXM.js";import"./index-e66xJJ-x.js";var M=Object.defineProperty,p=(r,n)=>M(r,"name",{value:n,configurable:!0});function f(r,n,t){const i=x(t,m(n.string));if(!i)return;const e=n.type!==null&&/"|\w/.test(n.string[0])?n.start:n.end;return{list:i,from:{line:r.line,ch:e},to:{line:r.line,ch:n.end}}}p(f,"hintList");function x(r,n){if(!n)return y(r,l=>!l.isDeprecated);const t=r.map(l=>({proximity:T(m(l.text),n),entry:l}));return y(y(t,l=>l.proximity<=2),l=>!l.entry.isDeprecated).sort((l,o)=>(l.entry.isDeprecated?1:0)-(o.entry.isDeprecated?1:0)||l.proximity-o.proximity||l.entry.text.length-o.entry.text.length).map(l=>l.entry)}p(x,"filterAndSortList");function y(r,n){const t=r.filter(n);return t.length===0?r:t}p(y,"filterNonEmpty");function m(r){return r.toLowerCase().replace(/\W/g,"")}p(m,"normalizeText");function T(r,n){let t=v(n,r);return r.length>n.length&&(t-=r.length-n.length-1,t+=r.indexOf(n)===0?0:.5),t}p(T,"getProximity");function v(r,n){let t,i;const e=[],l=r.length,o=n.length;for(t=0;t<=l;t++)e[t]=[t];for(i=1;i<=o;i++)e[0][i]=i;for(t=1;t<=l;t++)for(i=1;i<=o;i++){const c=r[t-1]===n[i-1]?0:1;e[t][i]=Math.min(e[t-1][i]+1,e[t][i-1]+1,e[t-1][i-1]+c),t>1&&i>1&&r[t-1]===n[i-2]&&r[t-2]===n[i-1]&&(e[t][i]=Math.min(e[t][i],e[t-2][i-2]+c))}return e[l][o]}p(v,"lexicalDistance");u.registerHelper("hint","graphql-variables",(r,n)=>{const t=r.getCursor(),i=r.getTokenAt(t),e=L(t,i,n);return e!=null&&e.list&&e.list.length>0&&(e.from=u.Pos(e.from.line,e.from.ch),e.to=u.Pos(e.to.line,e.to.ch),u.signal(r,"hasCompletion",r,e,i)),e});function L(r,n,t){const i=n.state.kind==="Invalid"?n.state.prevState:n.state,e=i.kind,l=i.step;if(e==="Document"&&l===0)return f(r,n,[{text:"{"}]);const o=t.variableToType;if(!o)return;const c=V(o,n.state);if(e==="Document"||e==="Variable"&&l===0){const a=Object.keys(o);return f(r,n,a.map(s=>({text:`"${s}": `,type:o[s]})))}if((e==="ObjectValue"||e==="ObjectField"&&l===0)&&c.fields){const a=Object.keys(c.fields).map(s=>c.fields[s]);return f(r,n,a.map(s=>({text:`"${s.name}": `,type:s.type,description:s.description})))}if(e==="StringValue"||e==="NumberValue"||e==="BooleanValue"||e==="NullValue"||e==="ListValue"&&l===1||e==="ObjectField"&&l===2||e==="Variable"&&l===2){const a=c.type?g(c.type):void 0;if(a instanceof b)return f(r,n,[{text:"{"}]);if(a instanceof O){const s=a.getValues();return f(r,n,s.map(h=>({text:`"${h.name}"`,type:a,description:h.description})))}else if(a===d)return f(r,n,[{text:"true",type:d,description:"Not false."},{text:"false",type:d,description:"Not true."}])}}p(L,"getVariablesHint");function V(r,n){const t={type:null,fields:null};return j(n,i=>{if(i.kind==="Variable")t.type=r[i.name];else if(i.kind==="ListValue"){const e=t.type?N(t.type):void 0;t.type=e instanceof D?e.ofType:null}else if(i.kind==="ObjectValue"){const e=t.type?g(t.type):void 0;t.fields=e instanceof b?e.getFields():null}else if(i.kind==="ObjectField"){const e=i.name&&t.fields?t.fields[i.name]:null;t.type=e==null?void 0:e.type}}),t}p(V,"getTypeInfo");
1
+ import{C as u}from"./codemirror.es-CfIYuCsS.js";import{f as j}from"./forEachState.es-D8bf0zSr.js";import{g,o as b,G as O,b as d,q as N,r as D}from"./index-pKJXF5_b.js";import"./index-BbonVJKD.js";var M=Object.defineProperty,p=(r,n)=>M(r,"name",{value:n,configurable:!0});function f(r,n,t){const i=x(t,m(n.string));if(!i)return;const e=n.type!==null&&/"|\w/.test(n.string[0])?n.start:n.end;return{list:i,from:{line:r.line,ch:e},to:{line:r.line,ch:n.end}}}p(f,"hintList");function x(r,n){if(!n)return y(r,l=>!l.isDeprecated);const t=r.map(l=>({proximity:T(m(l.text),n),entry:l}));return y(y(t,l=>l.proximity<=2),l=>!l.entry.isDeprecated).sort((l,o)=>(l.entry.isDeprecated?1:0)-(o.entry.isDeprecated?1:0)||l.proximity-o.proximity||l.entry.text.length-o.entry.text.length).map(l=>l.entry)}p(x,"filterAndSortList");function y(r,n){const t=r.filter(n);return t.length===0?r:t}p(y,"filterNonEmpty");function m(r){return r.toLowerCase().replace(/\W/g,"")}p(m,"normalizeText");function T(r,n){let t=v(n,r);return r.length>n.length&&(t-=r.length-n.length-1,t+=r.indexOf(n)===0?0:.5),t}p(T,"getProximity");function v(r,n){let t,i;const e=[],l=r.length,o=n.length;for(t=0;t<=l;t++)e[t]=[t];for(i=1;i<=o;i++)e[0][i]=i;for(t=1;t<=l;t++)for(i=1;i<=o;i++){const c=r[t-1]===n[i-1]?0:1;e[t][i]=Math.min(e[t-1][i]+1,e[t][i-1]+1,e[t-1][i-1]+c),t>1&&i>1&&r[t-1]===n[i-2]&&r[t-2]===n[i-1]&&(e[t][i]=Math.min(e[t][i],e[t-2][i-2]+c))}return e[l][o]}p(v,"lexicalDistance");u.registerHelper("hint","graphql-variables",(r,n)=>{const t=r.getCursor(),i=r.getTokenAt(t),e=L(t,i,n);return e!=null&&e.list&&e.list.length>0&&(e.from=u.Pos(e.from.line,e.from.ch),e.to=u.Pos(e.to.line,e.to.ch),u.signal(r,"hasCompletion",r,e,i)),e});function L(r,n,t){const i=n.state.kind==="Invalid"?n.state.prevState:n.state,e=i.kind,l=i.step;if(e==="Document"&&l===0)return f(r,n,[{text:"{"}]);const o=t.variableToType;if(!o)return;const c=V(o,n.state);if(e==="Document"||e==="Variable"&&l===0){const a=Object.keys(o);return f(r,n,a.map(s=>({text:`"${s}": `,type:o[s]})))}if((e==="ObjectValue"||e==="ObjectField"&&l===0)&&c.fields){const a=Object.keys(c.fields).map(s=>c.fields[s]);return f(r,n,a.map(s=>({text:`"${s.name}": `,type:s.type,description:s.description})))}if(e==="StringValue"||e==="NumberValue"||e==="BooleanValue"||e==="NullValue"||e==="ListValue"&&l===1||e==="ObjectField"&&l===2||e==="Variable"&&l===2){const a=c.type?g(c.type):void 0;if(a instanceof b)return f(r,n,[{text:"{"}]);if(a instanceof O){const s=a.getValues();return f(r,n,s.map(h=>({text:`"${h.name}"`,type:a,description:h.description})))}else if(a===d)return f(r,n,[{text:"true",type:d,description:"Not false."},{text:"false",type:d,description:"Not true."}])}}p(L,"getVariablesHint");function V(r,n){const t={type:null,fields:null};return j(n,i=>{if(i.kind==="Variable")t.type=r[i.name];else if(i.kind==="ListValue"){const e=t.type?N(t.type):void 0;t.type=e instanceof D?e.ofType:null}else if(i.kind==="ObjectValue"){const e=t.type?g(t.type):void 0;t.fields=e instanceof b?e.getFields():null}else if(i.kind==="ObjectField"){const e=i.name&&t.fields?t.fields[i.name]:null;t.type=e==null?void 0:e.type}}),t}p(V,"getTypeInfo");
@@ -1 +1 @@
1
- import{i5 as x,bh as E}from"./index-e66xJJ-x.js";const L=({url:r,allowFullScreen:o,position:a,display:i,height:u,width:c,overflow:y,styles:f,onLoad:p,onMouseOver:b,onMouseOut:w,scrolling:d,id:m,frameBorder:n,ariaHidden:O,sandbox:s,allow:j,className:h,title:g,ariaLabel:k,ariaLabelledby:I,name:P,target:v,loading:A,importance:F,referrerpolicy:M,allowpaymentrequest:S,src:$,key:q})=>{const t=x({src:$||r,target:v||null,style:{position:a||null,display:i||"initial",overflow:y||null},scrolling:d||null,allowpaymentrequest:S||null,importance:F||null,sandbox:s&&[...s].join(" ")||null,loading:A||null,styles:f||null,name:P||null,className:h||null,allowFullScreen:"allowFullScreen",referrerpolicy:M||null,title:g||null,allow:j||null,id:m||null,"aria-labelledby":I||null,"aria-hidden":O||null,"aria-label":k||null,width:c||null,height:u||null,onLoad:p||null,onMouseOver:b||null,onMouseOut:w||null,key:q||"iframe"});let l=Object.create(null);for(let e of Object.keys(t))t[e]!=null&&(l[e]=t[e]);for(let e of Object.keys(l.style))l.style[e]==null&&delete l.style[e];if(l.styles)for(let e of Object.keys(l.styles))l.styles.hasOwnProperty(e)&&(l.style[e]=l.styles[e]),Object.keys(l.styles).pop()==e&&delete l.styles;if(o)if("allow"in l){const e=l.allow.replace("fullscreen","");l.allow=`fullscreen ${e.trim()}`.trim()}else l.allow="fullscreen";return n>=0&&(l.style.hasOwnProperty("border")||(l.style.border=n)),E.createElement("iframe",Object.assign({},l))},R=L;export{R as I};
1
+ import{i5 as x,bh as E}from"./index-BbonVJKD.js";const L=({url:r,allowFullScreen:o,position:a,display:i,height:u,width:c,overflow:y,styles:f,onLoad:p,onMouseOver:b,onMouseOut:w,scrolling:d,id:m,frameBorder:n,ariaHidden:O,sandbox:s,allow:j,className:h,title:g,ariaLabel:k,ariaLabelledby:I,name:P,target:v,loading:A,importance:F,referrerpolicy:M,allowpaymentrequest:S,src:$,key:q})=>{const t=x({src:$||r,target:v||null,style:{position:a||null,display:i||"initial",overflow:y||null},scrolling:d||null,allowpaymentrequest:S||null,importance:F||null,sandbox:s&&[...s].join(" ")||null,loading:A||null,styles:f||null,name:P||null,className:h||null,allowFullScreen:"allowFullScreen",referrerpolicy:M||null,title:g||null,allow:j||null,id:m||null,"aria-labelledby":I||null,"aria-hidden":O||null,"aria-label":k||null,width:c||null,height:u||null,onLoad:p||null,onMouseOver:b||null,onMouseOut:w||null,key:q||"iframe"});let l=Object.create(null);for(let e of Object.keys(t))t[e]!=null&&(l[e]=t[e]);for(let e of Object.keys(l.style))l.style[e]==null&&delete l.style[e];if(l.styles)for(let e of Object.keys(l.styles))l.styles.hasOwnProperty(e)&&(l.style[e]=l.styles[e]),Object.keys(l.styles).pop()==e&&delete l.styles;if(o)if("allow"in l){const e=l.allow.replace("fullscreen","");l.allow=`fullscreen ${e.trim()}`.trim()}else l.allow="fullscreen";return n>=0&&(l.style.hasOwnProperty("border")||(l.style.border=n)),E.createElement("iframe",Object.assign({},l))},R=L;export{R as I};
@@ -1,4 +1,4 @@
1
- import{bX as createSvgIcon,j as jsxRuntimeExports,r as reactExports,P as PropTypes,bl as getDefaultExportFromCjs,n as newStyled,E as useMediaQuery,fF as Skeleton,cS as Img,$ as default_1$1,aB as Tooltip,eo as Button,k as Typography,C as CircularProgress,b8 as styled,al as useTheme,fe as isObject,dA as deepmerge,dS as StyledEngineProvider,dT as ThemeProvider,fG as ThemeProvider$1,fH as HeaderAddons,fI as Hidden,Y as Center,aP as requireCreateSvgIcon,aQ as interopRequireDefaultExports,fJ as Check,d8 as commonjsGlobal,cF as Buffer,bh as React,fi as noop,bC as __vitePreload,dq as styled$1}from"./index-e66xJJ-x.js";import{j as joinUrl}from"./url-join-CM2acrDe.js";import{C as CloseIcon}from"./Close-Cem8y-ph.js";const PriorityHigh=createSvgIcon([jsxRuntimeExports.jsx("circle",{cx:"12",cy:"19",r:"2"},"0"),jsxRuntimeExports.jsx("path",{d:"M10 3h4v12h-4z"},"1")],"PriorityHigh"),StepContext=reactExports.createContext(),{Provider}=StepContext,matchPath=(i,s,a=window.location.pathname.replace(/\/$/,"/"))=>i?s?i===a:new RegExp(i).test(a):!1;function StepProvider({children:i,steps:s,mode:a}){const[o,u]=reactExports.useState("");!o&&s.length&&u(s[0].key);const S=s.map(T=>T.children?[{key:T.key,hasChild:!0},T.children.map(O=>({parentKey:T.key,key:O.key}))]:{key:T.key}).flat(1/0),P=S.filter(T=>!T.hasChild),C=T=>{let O;const D=S.findIndex(H=>H.key===o?(O=H.parentKey,!0):!1);if(O===T)return"current";const L=S.findIndex(H=>H.key===T);if(L!==-1){if(L===D)return"current";if(L<D)return"before"}return"after"};function E(T){u(T)}function _(T){if(typeof T=="function"){const O=T(P.findIndex(D=>D.key===o));u(P[O].key)}else u(P[T].key)}const I=P.findIndex(T=>T.key===o);reactExports.useEffect(()=>{if(a==="history"){let T="";s.some(O=>O.children&&O.children.length?O.children.some(D=>matchPath(D.path,D.exact)?(T=D.key,!0):!1):matchPath(O.path,O.exact)?(T=O.key,!0):!1),T&&u(T)}return()=>{}},[s,a]);const j={steps:s,totalStepsCount:P.length,getStepStatus:C,setActiveStepByKey:E,setActiveStepByIndex:_,activeStep:I,canBackToStep:T=>a==="memory"&&I!==0&&T<I};return jsxRuntimeExports.jsx(Provider,{value:j,children:i})}function useStepContext(){return reactExports.useContext(StepContext)}StepProvider.propTypes={children:PropTypes.any.isRequired,steps:PropTypes.array.isRequired,mode:PropTypes.string};StepProvider.defaultProps={mode:"history"};var has=Object.prototype.hasOwnProperty,toString=Object.prototype.toString;function isEmpty(i){if(i==null)return!0;if(typeof i=="boolean")return!1;if(typeof i=="number")return i===0;if(typeof i=="string"||typeof i=="function"||Array.isArray(i))return i.length===0;if(i instanceof Error)return i.message==="";if(i.toString==toString)switch(i.toString()){case"[object File]":case"[object Map]":case"[object Set]":return i.size===0;case"[object Object]":{for(var s in i)if(has.call(i,s))return!1;return!0}}return!1}var lib=isEmpty;const isEmpty$1=getDefaultExportFromCjs(lib),defaultBlockletLogo=""+new URL("blocklet-default-logo-Bspnu_ws.png",import.meta.url).href,translations={en:{optional:"Optional",defaultNavSubTitle:"Launching"},zh:{optional:"可选",defaultNavSubTitle:"启动"}},getTranslations=i=>translations[i]?translations[i]:translations.en,getLaunchingText=i=>i==="zh"?"启动":"Launching",getBlockletDisplayName=i=>(i==null?void 0:i.title)||(i==null?void 0:i.name)||"";function AppHeader({blockletMeta:i,subTitle:s,logoUrl:a,locale:o,navLogo:u,loading:S}){const P=useMediaQuery(j=>j.breakpoints.down("md")),C=P?18:48,E=reactExports.useRef(null),[_,I]=reactExports.useState("");return reactExports.useEffect(()=>{E.current&&E.current.offsetHeight>34&&(_===""?I("middle"):_==="middle"&&I("small"))},[_]),jsxRuntimeExports.jsxs(Container$2,{className:_==="small"?"center-mode":"",children:[P?jsxRuntimeExports.jsx("div",{className:"app-icon",children:u}):jsxRuntimeExports.jsxs("div",{className:"app-icon",children:[S&&jsxRuntimeExports.jsx(AppIconSkeleton,{blockletSize:C,isMobile:P}),!S&&jsxRuntimeExports.jsx(AppIcon,{blockletSize:C,logoUrl:a})]}),jsxRuntimeExports.jsxs("div",{className:"header-title",children:[P&&s&&jsxRuntimeExports.jsx("div",{className:"header-title-sub",children:s}),jsxRuntimeExports.jsxs("div",{className:"app-name-content",children:[!P&&jsxRuntimeExports.jsx("div",{className:"launching-context",children:s||getLaunchingText(o)}),jsxRuntimeExports.jsx("div",{className:`header-title-name ${_==="middle"||_==="small"?"middle-size":""}`,ref:E,children:jsxRuntimeExports.jsx(AppTitle,{logoUrl:a,isMobile:P,blockletMeta:i,blockletSize:C,loading:S})})]})]})]})}AppHeader.propTypes={blockletMeta:PropTypes.object,subTitle:PropTypes.any,logoUrl:PropTypes.string,locale:PropTypes.string,navLogo:PropTypes.any,loading:PropTypes.bool};AppHeader.defaultProps={subTitle:"",logoUrl:"",locale:"",navLogo:"",loading:!1,blockletMeta:{}};function AppIconSkeleton({blockletSize:i,isMobile:s}){return s?jsxRuntimeExports.jsx(Skeleton,{variant:"rectangular",width:100,height:16,alt:"icon",style:{marginTop:4}}):jsxRuntimeExports.jsx(Skeleton,{variant:"rectangular",width:i,height:i})}function AppIcon({logoUrl:i,blockletSize:s}){return jsxRuntimeExports.jsx(Img,{width:s,height:s,src:i,alt:"blocklet icon",fallback:defaultBlockletLogo,style:{verticalAlign:"text-bottom"}},`layout-app-icon-${i}`)}function AppTitle({isMobile:i,logoUrl:s,blockletMeta:a,blockletSize:o,loading:u}){const S=getBlockletDisplayName(a);return u?jsxRuntimeExports.jsx(Skeleton,{variant:"rectangular",width:100,height:16,alt:"icon",style:{marginTop:4}}):isEmpty$1(a)?jsxRuntimeExports.jsx(Skeleton,{variant:"rectangular",animation:!1,width:100,height:16,alt:"icon",style:{marginTop:4}}):i?jsxRuntimeExports.jsxs(MobileTitleStyle,{children:[jsxRuntimeExports.jsx(AppIcon,{blockletSize:o,logoUrl:s}),jsxRuntimeExports.jsx("span",{className:"ellipsis-title",children:getBlockletDisplayName(a)})]}):jsxRuntimeExports.jsx(AppLink,{className:"app-link",target:"_blank",href:joinUrl((a==null?void 0:a.registryUrl)||"",`/blocklets/${a==null?void 0:a.did}`),title:S,children:S})}const MobileTitleStyle=newStyled.div`
1
+ import{bX as createSvgIcon,j as jsxRuntimeExports,r as reactExports,P as PropTypes,bl as getDefaultExportFromCjs,n as newStyled,E as useMediaQuery,fF as Skeleton,cS as Img,$ as default_1$1,aB as Tooltip,eo as Button,k as Typography,C as CircularProgress,b8 as styled,al as useTheme,fe as isObject,dA as deepmerge,dS as StyledEngineProvider,dT as ThemeProvider,fG as ThemeProvider$1,fH as HeaderAddons,fI as Hidden,Y as Center,aP as requireCreateSvgIcon,aQ as interopRequireDefaultExports,fJ as Check,d8 as commonjsGlobal,cF as Buffer,bh as React,fi as noop,bC as __vitePreload,dq as styled$1}from"./index-BbonVJKD.js";import{j as joinUrl}from"./url-join-DP1r7KXa.js";import{C as CloseIcon}from"./Close-C9PKpEMp.js";const PriorityHigh=createSvgIcon([jsxRuntimeExports.jsx("circle",{cx:"12",cy:"19",r:"2"},"0"),jsxRuntimeExports.jsx("path",{d:"M10 3h4v12h-4z"},"1")],"PriorityHigh"),StepContext=reactExports.createContext(),{Provider}=StepContext,matchPath=(i,s,a=window.location.pathname.replace(/\/$/,"/"))=>i?s?i===a:new RegExp(i).test(a):!1;function StepProvider({children:i,steps:s,mode:a}){const[o,u]=reactExports.useState("");!o&&s.length&&u(s[0].key);const S=s.map(T=>T.children?[{key:T.key,hasChild:!0},T.children.map(O=>({parentKey:T.key,key:O.key}))]:{key:T.key}).flat(1/0),P=S.filter(T=>!T.hasChild),C=T=>{let O;const D=S.findIndex(H=>H.key===o?(O=H.parentKey,!0):!1);if(O===T)return"current";const L=S.findIndex(H=>H.key===T);if(L!==-1){if(L===D)return"current";if(L<D)return"before"}return"after"};function E(T){u(T)}function _(T){if(typeof T=="function"){const O=T(P.findIndex(D=>D.key===o));u(P[O].key)}else u(P[T].key)}const I=P.findIndex(T=>T.key===o);reactExports.useEffect(()=>{if(a==="history"){let T="";s.some(O=>O.children&&O.children.length?O.children.some(D=>matchPath(D.path,D.exact)?(T=D.key,!0):!1):matchPath(O.path,O.exact)?(T=O.key,!0):!1),T&&u(T)}return()=>{}},[s,a]);const j={steps:s,totalStepsCount:P.length,getStepStatus:C,setActiveStepByKey:E,setActiveStepByIndex:_,activeStep:I,canBackToStep:T=>a==="memory"&&I!==0&&T<I};return jsxRuntimeExports.jsx(Provider,{value:j,children:i})}function useStepContext(){return reactExports.useContext(StepContext)}StepProvider.propTypes={children:PropTypes.any.isRequired,steps:PropTypes.array.isRequired,mode:PropTypes.string};StepProvider.defaultProps={mode:"history"};var has=Object.prototype.hasOwnProperty,toString=Object.prototype.toString;function isEmpty(i){if(i==null)return!0;if(typeof i=="boolean")return!1;if(typeof i=="number")return i===0;if(typeof i=="string"||typeof i=="function"||Array.isArray(i))return i.length===0;if(i instanceof Error)return i.message==="";if(i.toString==toString)switch(i.toString()){case"[object File]":case"[object Map]":case"[object Set]":return i.size===0;case"[object Object]":{for(var s in i)if(has.call(i,s))return!1;return!0}}return!1}var lib=isEmpty;const isEmpty$1=getDefaultExportFromCjs(lib),defaultBlockletLogo=""+new URL("blocklet-default-logo-Bspnu_ws.png",import.meta.url).href,translations={en:{optional:"Optional",defaultNavSubTitle:"Launching"},zh:{optional:"可选",defaultNavSubTitle:"启动"}},getTranslations=i=>translations[i]?translations[i]:translations.en,getLaunchingText=i=>i==="zh"?"启动":"Launching",getBlockletDisplayName=i=>(i==null?void 0:i.title)||(i==null?void 0:i.name)||"";function AppHeader({blockletMeta:i,subTitle:s,logoUrl:a,locale:o,navLogo:u,loading:S}){const P=useMediaQuery(j=>j.breakpoints.down("md")),C=P?18:48,E=reactExports.useRef(null),[_,I]=reactExports.useState("");return reactExports.useEffect(()=>{E.current&&E.current.offsetHeight>34&&(_===""?I("middle"):_==="middle"&&I("small"))},[_]),jsxRuntimeExports.jsxs(Container$2,{className:_==="small"?"center-mode":"",children:[P?jsxRuntimeExports.jsx("div",{className:"app-icon",children:u}):jsxRuntimeExports.jsxs("div",{className:"app-icon",children:[S&&jsxRuntimeExports.jsx(AppIconSkeleton,{blockletSize:C,isMobile:P}),!S&&jsxRuntimeExports.jsx(AppIcon,{blockletSize:C,logoUrl:a})]}),jsxRuntimeExports.jsxs("div",{className:"header-title",children:[P&&s&&jsxRuntimeExports.jsx("div",{className:"header-title-sub",children:s}),jsxRuntimeExports.jsxs("div",{className:"app-name-content",children:[!P&&jsxRuntimeExports.jsx("div",{className:"launching-context",children:s||getLaunchingText(o)}),jsxRuntimeExports.jsx("div",{className:`header-title-name ${_==="middle"||_==="small"?"middle-size":""}`,ref:E,children:jsxRuntimeExports.jsx(AppTitle,{logoUrl:a,isMobile:P,blockletMeta:i,blockletSize:C,loading:S})})]})]})]})}AppHeader.propTypes={blockletMeta:PropTypes.object,subTitle:PropTypes.any,logoUrl:PropTypes.string,locale:PropTypes.string,navLogo:PropTypes.any,loading:PropTypes.bool};AppHeader.defaultProps={subTitle:"",logoUrl:"",locale:"",navLogo:"",loading:!1,blockletMeta:{}};function AppIconSkeleton({blockletSize:i,isMobile:s}){return s?jsxRuntimeExports.jsx(Skeleton,{variant:"rectangular",width:100,height:16,alt:"icon",style:{marginTop:4}}):jsxRuntimeExports.jsx(Skeleton,{variant:"rectangular",width:i,height:i})}function AppIcon({logoUrl:i,blockletSize:s}){return jsxRuntimeExports.jsx(Img,{width:s,height:s,src:i,alt:"blocklet icon",fallback:defaultBlockletLogo,style:{verticalAlign:"text-bottom"}},`layout-app-icon-${i}`)}function AppTitle({isMobile:i,logoUrl:s,blockletMeta:a,blockletSize:o,loading:u}){const S=getBlockletDisplayName(a);return u?jsxRuntimeExports.jsx(Skeleton,{variant:"rectangular",width:100,height:16,alt:"icon",style:{marginTop:4}}):isEmpty$1(a)?jsxRuntimeExports.jsx(Skeleton,{variant:"rectangular",animation:!1,width:100,height:16,alt:"icon",style:{marginTop:4}}):i?jsxRuntimeExports.jsxs(MobileTitleStyle,{children:[jsxRuntimeExports.jsx(AppIcon,{blockletSize:o,logoUrl:s}),jsxRuntimeExports.jsx("span",{className:"ellipsis-title",children:getBlockletDisplayName(a)})]}):jsxRuntimeExports.jsx(AppLink,{className:"app-link",target:"_blank",href:joinUrl((a==null?void 0:a.registryUrl)||"",`/blocklets/${a==null?void 0:a.did}`),title:S,children:S})}const MobileTitleStyle=newStyled.div`
2
2
  .ellipsis-title {
3
3
  flex: 1;
4
4
  position: absolute;
@@ -1,4 +1,4 @@
1
- import{r as o,Q as d,j as e,eo as c,ba as I,ea as M,fj as b,fk as E,fi as P,dq as p,fl as S}from"./index-e66xJJ-x.js";import{B as z}from"./ButtonGroup-BbvSuEoF.js";function A(r){const{size:u="medium",color:s="primary",menu:a=[],children:i=null,variant:m="contained",onClick:f=P,menuButtonProps:x={},...h}=r,[j,l]=o.useState(!1),n=o.useRef(null),g=Array.isArray(a)?a.map((t,C)=>o.isValidElement(t)?t:o.createElement(d,{...t,key:C})):a,y=()=>{l(t=>!t)},k=t=>{n.current&&n.current.contains(t.target)||l(!1)},B=t=>{t.target.closest(".MuiMenuItem-root")&&l(!1)};return e.jsxs(e.Fragment,{children:[e.jsxs(L,{variant:m,size:u,color:s,ref:n,...h,children:[typeof i=="function"?i():e.jsx(c,{onClick:f,color:s,children:i}),e.jsx(c,{onClick:y,color:s,...x,"aria-label":"more functions",children:e.jsx(I,{})})]}),e.jsx(w,{open:j,anchorEl:n.current,placement:"bottom-end",disablePortal:!1,children:e.jsx(M,{children:e.jsx(b,{onClickAway:k,children:e.jsx(E,{onClick:B,children:g})})})})]})}A.Item=d;const L=p(z)`
1
+ import{r as o,Q as d,j as e,eo as c,ba as I,ea as M,fj as b,fk as E,fi as P,dq as p,fl as S}from"./index-BbonVJKD.js";import{B as z}from"./ButtonGroup-DqXuhqTn.js";function A(r){const{size:u="medium",color:s="primary",menu:a=[],children:i=null,variant:m="contained",onClick:f=P,menuButtonProps:x={},...h}=r,[j,l]=o.useState(!1),n=o.useRef(null),g=Array.isArray(a)?a.map((t,C)=>o.isValidElement(t)?t:o.createElement(d,{...t,key:C})):a,y=()=>{l(t=>!t)},k=t=>{n.current&&n.current.contains(t.target)||l(!1)},B=t=>{t.target.closest(".MuiMenuItem-root")&&l(!1)};return e.jsxs(e.Fragment,{children:[e.jsxs(L,{variant:m,size:u,color:s,ref:n,...h,children:[typeof i=="function"?i():e.jsx(c,{onClick:f,color:s,children:i}),e.jsx(c,{onClick:y,color:s,...x,"aria-label":"more functions",children:e.jsx(I,{})})]}),e.jsx(w,{open:j,anchorEl:n.current,placement:"bottom-end",disablePortal:!1,children:e.jsx(M,{children:e.jsx(b,{onClickAway:k,children:e.jsx(E,{onClick:B,children:g})})})})]})}A.Item=d;const L=p(z)`
2
2
  > .MuiButtonBase-root:last-of-type {
3
3
  min-width: 2em;
4
4
  padding-left: 0;
@@ -1 +1 @@
1
- import{dq as s,P as c,j as t,aY as e}from"./index-e66xJJ-x.js";import{S as l}from"./Switch-Qp41_PVH.js";const r=s(i=>t.jsx(l,{focusVisibleClassName:".Mui-focusVisible",disableRipple:!0,...i}))(({theme:i})=>({width:42,height:26,padding:0,"& .MuiSwitch-switchBase":{padding:0,margin:2,transitionDuration:"300ms","&.Mui-checked":{transform:"translateX(16px)",color:"#fff","& + .MuiSwitch-track":{backgroundColor:i.palette.primary.main,opacity:1,border:0},"&.Mui-disabled + .MuiSwitch-track":{opacity:.5}},"&.Mui-focusVisible .MuiSwitch-thumb":{color:i.palette.primary.main,border:"6px solid #fff"},"&.Mui-disabled .MuiSwitch-thumb":{color:i.palette.mode==="light"?i.palette.grey[100]:i.palette.grey[600]},"&.Mui-disabled + .MuiSwitch-track":{opacity:i.palette.mode==="light"?.7:.3}},"& .MuiSwitch-thumb":{boxSizing:"border-box",width:22,height:22},"& .MuiSwitch-track":{borderRadius:26/2,backgroundColor:i.palette.grey[200],opacity:1,transition:i.transitions.create(["background-color"],{duration:500})}}));function a({labelProps:i,...o}){return i?t.jsx(e,{control:t.jsx(r,{...o}),...i}):t.jsx(r,{...o})}a.propTypes={labelProps:c.object};a.defaultProps={labelProps:null};export{a as S};
1
+ import{dq as s,P as c,j as t,aY as e}from"./index-BbonVJKD.js";import{S as l}from"./Switch-Dt84DR0H.js";const r=s(i=>t.jsx(l,{focusVisibleClassName:".Mui-focusVisible",disableRipple:!0,...i}))(({theme:i})=>({width:42,height:26,padding:0,"& .MuiSwitch-switchBase":{padding:0,margin:2,transitionDuration:"300ms","&.Mui-checked":{transform:"translateX(16px)",color:"#fff","& + .MuiSwitch-track":{backgroundColor:i.palette.primary.main,opacity:1,border:0},"&.Mui-disabled + .MuiSwitch-track":{opacity:.5}},"&.Mui-focusVisible .MuiSwitch-thumb":{color:i.palette.primary.main,border:"6px solid #fff"},"&.Mui-disabled .MuiSwitch-thumb":{color:i.palette.mode==="light"?i.palette.grey[100]:i.palette.grey[600]},"&.Mui-disabled + .MuiSwitch-track":{opacity:i.palette.mode==="light"?.7:.3}},"& .MuiSwitch-thumb":{boxSizing:"border-box",width:22,height:22},"& .MuiSwitch-track":{borderRadius:26/2,backgroundColor:i.palette.grey[200],opacity:1,transition:i.transitions.create(["background-color"],{duration:500})}}));function a({labelProps:i,...o}){return i?t.jsx(e,{control:t.jsx(r,{...o}),...i}):t.jsx(r,{...o})}a.propTypes={labelProps:c.object};a.defaultProps={labelProps:null};export{a as S};
@@ -1,4 +1,4 @@
1
- import{bq as St,r as x,bD as J,bi as $,y as V,A as L,j as e,P as d,T as Ct,aP as Xe,aQ as Ze,aw as Nt,h as ne,aB as wt,k as G,K as v,m as X,ei as _e,N as Be,kI as et,bn as Ee,aY as De,U as Ae,eo as we,b7 as Ge,b5 as Oe,C as tt,n as re,f as st,dA as nt,aT as Le,W as Tt,av as at,kJ as it,B as Pe,kK as ot,fZ as Se,bt as rt,ai as fe,fe as Rt,ax as It,G as Ye,kL as Et,kM as Dt,D as lt,kN as At,kO as Ot,kP as Lt,kQ as Pt,R as kt,by as ct,O as Ft,S as _t,Q as Qe,J as Bt,kR as zt,a4 as Wt}from"./index-e66xJJ-x.js";import{l as Mt,D as dt,g as qt}from"./index-CIH-dF5H.js";import{a as ze,c as Kt}from"./actions-DQy4Y2na.js";import{B as $t}from"./index-Bnl28jeD.js";import{S as xe}from"./shorten-label-w_L-1NYs.js";import{I as ut}from"./index-JsgthZUN.js";import{T as Ut}from"./index-CNOx9gM8.js";import{d as Ht}from"./Refresh-2rMRmiq8.js";import{D as Vt,g as Gt}from"./traffic-CoY4yr_p.js";import{u as Yt}from"./use-mobile-B7_S05ne.js";import"./TableRow-CDB9WIef.js";import"./useThemeProps-Dk-4jx1U.js";import"./emotion-react.browser.esm-BsFIkhYD.js";import"./ViewColumn-Db8V4QN9.js";import"./Search-DlTi3_X0.js";import"./Clear-n1FkleT7.js";import"./Delete-D0GFkYtH.js";import"./index-f9QTV2yS.js";import"./MoreVert-CrQ5BD1O.js";import"./TableSearch-C_ybT7kk.js";import"./useLocalStorage-ChdS5XVQ.js";import"./get-safe-url-h3P_Qh4v.js";import"./ButtonGroup-BbvSuEoF.js";import"./getValidReactChildren-DTJlyDSN.js";import"./url-evaluation-DRKjUU7g.js";import"./permission-CtZli8Hf.js";import"./index.esm-BiZwp2sI.js";import"./collapse-S-vTWAhi.js";import"./blocklet-BNsbNDuf.js";import"./Switch-Qp41_PVH.js";import"./iframe-Cs_wGN9V.js";import"./ChevronLeft-BCWTA2ES.js";import"./ChevronRight-B8F_ru7A.js";import"./index-_Y4g7Ki7.js";import"./base-chart-CneSkRrp.js";import"./index-MgaM83zd.js";import"./AdapterDayjs-bsD4OAFM.js";import"./CSSTransition-CJ-9QKlG.js";import"./refType-CrQ6NnaY.js";const pt=x.createContext({}),{Provider:Qt,Consumer:pn}=pt;function Jt({children:t,blocklet:s=""}){const{api:n,inService:o,ws:{useSubscription:r}}=St(),[l,b]=x.useState([]),[u,D]=x.useState({total:0,pageSize:20,pageCount:0,page:1}),f=J(()=>{var p;return(p=s.meta)==null?void 0:p.did},[s]),[C,N]=x.useState([]),[B,z]=x.useState({}),E=J(()=>l.length?new Set(l.map(p=>p.id)):new Set,[l]),Y=async({page:p=1,pageSize:S=20,...A}={})=>{if(!f)return[];try{const w={paging:{page:p,pageSize:S},...A,teamDid:f,dateRange:A.dateRange?[$(A.dateRange[0]).toISOString(),$(A.dateRange[1]).toISOString()]:void 0},{dids:O,..._}=w;let Z="";O&&O.includes("system")&&(Z="system");const W=O?O.filter(le=>le!=="system"):[],ae={..._,source:Z,componentDids:W},se=await n.getNotificationSendLog({input:ae});return z(ae),b(se.list),D(se.paging),se.list}catch(w){return V.error(w.message),[]}},k=async()=>{const p=await n.getNotificationComponents({input:{teamDid:f}});N(p.componentDids)},P=x.useCallback(p=>{const S=s.children.find(A=>{var w;return((w=A.meta)==null?void 0:w.did)===p});if(S)return S.ancestors=[s],S},[s]),I=async({notificationId:p,receivers:S,channels:A,...w})=>{await n.resendNotification({input:{teamDid:f,notificationId:p,receivers:S,channels:A.map(O=>O==="wallet"?L.NOTIFICATION_SEND_CHANNEL.WALLET:O==="pushKit"?L.NOTIFICATION_SEND_CHANNEL.PUSH:O),...w}})},U=x.useCallback(async p=>(await n.getUser({input:{teamDid:f,user:{did:p}}})).user,[n,f]),Q=x.useCallback(async({page:p=1,pageSize:S=20,...A}={})=>{try{const w={paging:{page:p,pageSize:S},...A,userName:A.searchText||"",teamDid:f,dateRange:A.dateRange?[$(A.dateRange[0]).toISOString(),$(A.dateRange[1]).toISOString()]:void 0};return await n.getReceivers({input:w})}catch(w){throw V.error(w.message),w}},[n,f]);x.useEffect(()=>{f&&k()},[f]),r(L.EVENTS.NOTIFICATION_BLOCKLET_UPDATE,p=>{E.has(p.notificationId)&&Y(B)},[E,B]),r(L.EVENTS.NOTIFICATION_BLOCKLET_CREATE,p=>{E.has(p.id)||Y(B)},[E,B]);const te={fetch:Y,data:l,paging:u,blocklet:s,getComponent:P,resendNotification:I,getUser:U,componentDids:C,getReceivers:Q,inService:o,teamDid:f};return e.jsx(Qt,{value:{notificationRecords:te},children:t})}function We(){const{notificationRecords:t}=x.useContext(pt);return t}be.propTypes={severity:d.oneOf(Object.values(["info","success","error","warning"])).isRequired};const Xt={info:"primary",success:"success",error:"error",warning:"warning"};function be({severity:t="info"}){return e.jsx(Ct,{type:Xt[t],children:t})}var Me={},Zt=Ze;Object.defineProperty(Me,"__esModule",{value:!0});var ft=Me.default=void 0,es=Zt(Xe()),ts=e;ft=Me.default=(0,es.default)((0,ts.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 qe={},ss=Ze;Object.defineProperty(qe,"__esModule",{value:!0});var mt=qe.default=void 0,ns=ss(Xe()),as=e;mt=qe.default=(0,ns.default)((0,as.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");const is=(t,s,n="")=>{if(!n||!s)return"";switch(n){case L.NOTIFICATION_SEND_FAILED_REASON.USER_DISABLED:return t("notification.sendStatus.reason.disabled",{channel:s});case L.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_UNAVAILABLE:return t("notification.sendStatus.reason.unavailable",{channel:s});case L.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_DISABLED:return t("notification.sendStatus.reason.notSent",{channel:s});case L.NOTIFICATION_SEND_FAILED_REASON.NOT_ONLINE:return t("notification.sendStatus.reason.offline");default:return n}};function ht(t,s,n={}){const{status:o,updatedAt:r,reason:l="",channel:b="wallet"}=n,u=r?t("notification.sendStatus.sentTime",{date:Nt(r,s)}):"",D=is(t,b,l);return o===L.NOTIFICATION_SEND_STATUS.FAILED?{status:"failed",title:t("notification.sendStatus.failed"),sentTime:u,reason:D}:o===L.NOTIFICATION_SEND_STATUS.SENT?{status:"success",title:t("notification.sendStatus.success"),sentTime:u}:{status:"pending",title:t("notification.sendStatus.pending"),reason:D,sentTime:u}}const ke={pending:"#aaaaaa",success:"#34BE74",failed:"#D0021B"},Fe=["wallet","pushKit","email"],Je=["info","success","error","warning"],gt=t=>{var n,o;const{settings:s}=t;return(o=(n=s==null?void 0:s.notification)==null?void 0:n.email)==null?void 0:o.enabled},xt=t=>{var n,o;const{settings:s}=t;return(o=(n=s==null?void 0:s.notification)==null?void 0:n.pushKit)==null?void 0:o.enabled},os=(t,s)=>{const n=ne(s,"extra.notifications.email",!0);return{available:gt(t),enabled:n}},rs=(t,s)=>{const n=ne(s,"extra.notifications.push",!0);return{available:xt(t),enabled:n}},ls=t=>({enabled:ne(t,"extra.notifications.wallet",!0)}),cs=t=>({enabled:ne(t,"extra.webhooks",[]).length>0}),ye=(t=3)=>new Promise(s=>{setTimeout(()=>{s()},t*1e3)}),ds=(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})}]:[],ve=(t=[])=>{const s=$().startOf("day");return t.filter(n=>$(n.sendAt).isSame(s,"day")).length},us=(t,s="")=>{if(s&&Fe.includes(s)){const l=`${s}SendRecord`,b=ne(t,l,[]);return ve(b)}const n=ne(t,"webhook",{}),o=Object.keys(n??{})??[];if(s&&o.includes(s)){const l=n[s]??[];return ve(l)}const r={};return Fe.forEach(l=>{const b=`${l}SendRecord`,u=ne(t,b,[]),D=ve(u);r[l]=D}),o.length>0&&o.forEach(l=>{const b=n[l]??[],u=ve(b);r[l]=u}),r},Ce=(t,s,n)=>{if(!Array.isArray(t))throw new Error("Invalid filterList or index");return t[n].splice(s,1),t},Ne=(t,s)=>{if(!Array.isArray(s))throw new Error("filters must be an array");return s.length?!s.includes(t):!1},ps=t=>{switch(t){case L.NOTIFICATION_SEND_CHANNEL.WALLET:return"Wallet";case L.NOTIFICATION_SEND_CHANNEL.PUSH:return"Push Kit";case L.NOTIFICATION_SEND_CHANNEL.EMAIL:return"Email";case L.NOTIFICATION_SEND_CHANNEL.WEBHOOK:return"Webhook";default:return""}},bt=()=>({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 ee({config:t,enableTooltip:s=!0,showTitle:n=!1,children:o}){const{status:r,title:l="",sentTime:b="",reason:u=""}=t,D=[l,u].filter(Boolean).join(", ");return e.jsx(wt,{title:s?e.jsxs(e.Fragment,{children:[e.jsx(G,{color:"inherit",sx:{fontSize:12},children:D}),e.jsx("span",{children:b})]}):null,arrow:!0,placement:"top",children:e.jsxs(v,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsxs(v,{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center",children:[e.jsx(v,{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:ke[r],style:{opacity:.15}}),e.jsx(v,{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:ke[r]})]}),e.jsx(G,{color:"inherit",sx:{fontSize:12},children:n?l:o})]})})}ee.propTypes={config:d.object.isRequired,enableTooltip:d.bool,showTitle:d.bool,children:d.node};ee.defaultProps={enableTooltip:!0,showTitle:!1,children:null};me.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};me.defaultProps={onDelete:()=>{}};function me({list:t,label:s,onDelete:n}){const{t:o,locale:r}=X();return e.jsxs(v,{display:"flex",gap:1,alignItems:"center",children:[e.jsxs(G,{children:[s,": "]}),t.map(l=>{const b=ht(o,r,{status:l});return e.jsx(_e,{size:"small",label:e.jsx(v,{display:"flex",alignItems:"center",sx:{gap:"4px"},children:e.jsx(ee,{config:b,enableTooltip:!1,children:b.title})}),onDelete:u=>n(u,l)},l)})]})}Ke.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 Ke({filterList:t,onChange:s,index:n,column:o,filterValues:r,label:l,renderLabel:b}){return e.jsxs(Be,{className:"filter-container",children:[e.jsx(et,{component:"legend",children:l}),e.jsx(Ee,{row:!0,children:r.map(u=>e.jsx(De,{control:e.jsx(Ae,{checked:t[n].indexOf(u.value??u)>-1,onChange:D=>{const f=[...t];D.target.checked?f[n]=[...f[n],u.value??u]:f[n]=f[n].filter(C=>C!==(u.value??u)),s(f[n],n,o)},name:u.value??u}),label:e.jsx("span",{style:{display:"flex",alignItems:"center"},children:b(u)})},u.value??u))})]})}function Ie(t){return e.jsx(Ke,{...t,renderLabel:s=>e.jsx(ee,{enableTooltip:!1,config:{status:s.status},children:s.label})})}pe.propTypes={status:d.number.isRequired,updatedAt:d.string.isRequired,reason:d.string,channel:d.string,onResend:d.func};function pe({status:t,updatedAt:s,reason:n="",channel:o="wallet",onResend:r}){const{t:l,locale:b}=X(),u=ht(l,b,{status:t,updatedAt:s,reason:n,channel:o});return e.jsxs(v,{display:"flex",alignItems:"center",gap:1,children:[e.jsx(ee,{config:u,showTitle:!0}),u.status!=="success"&&e.jsx(we,{className:"resend-btn",size:"small",startIcon:e.jsx(ze,{}),sx:{fontSize:12,color:"rgba(0, 0, 0, 0.87)",fontWeight:400,".MuiButton-startIcon":{mr:"2px"}},onClick:r,children:l("notification.resend")})]})}$e.propTypes={value:d.array.isRequired,onChange:d.func};function $e({value:t,onChange:s}){const{locale:n}=X(),o=$().toDate(),[r,l]=x.useState(null),b=x.useCallback(f=>{l(r?null:f.currentTarget)},[r]),u=!!r,D=x.useCallback(f=>{if(!f.startDate||!f.endDate){V.error("Please select a date range");return}if($(f.startDate).isAfter(f.endDate)||!$(f.startDate).isValid()||!$(f.endDate).isValid()){V.error("Invalid date range");return}s([f.startDate,f.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(we,{onClick:b,variant:"outlined",size:"small",color:"inherit",children:[Ge(t[0],n)," - ",Ge(t[1],n)]})}),e.jsx(Oe,{open:u,anchorEl:r,onClose:()=>{l(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:e.jsx(Vt,{open:!0,maxDate:o,initialDateRange:{startDate:t[0],endDate:t[1]},toggle:b,definedRanges:Gt(o),onChange:D})})]})}Ue.propTypes={itemComponent:d.elementType.isRequired};function Ue({itemComponent:t,...s}){var r;const{t:n}=X();return!((r=s==null?void 0:s.filterList)!=null&&r.filter(l=>l.length).length)?null:e.jsxs(v,{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(Mt.TableFilterList,{...s,ItemComponent:t})})]})}function Te({label:t,onDelete:s,canDelete:n=()=>!0,...o}){const r=s&&typeof s=="function"?s:void 0;let l=!0;return n&&typeof n=="function"&&(l=n({label:t,...o})),e.jsx(_e,{label:t,variant:"outlined",...r&&l?{onDelete:r}:{}})}Te.propTypes={label:d.string.isRequired,onDelete:d.func,canDelete:d.func};Te.defaultProps={canDelete:()=>!0};const fs=[{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}];He.propTypes={loading:d.bool,onCancel:d.func,onConfirm:d.func};He.defaultProps={loading:!1,onCancel:()=>{},onConfirm:()=>{}};function He({loading:t=!1,onCancel:s,onConfirm:n}){const{t:o}=X(),[r,l]=x.useState(fs),[b,u]=x.useState(!0),D=(C,N)=>{N.checked=C.target.checked;const B=r.map(z=>({...z,checked:z.value===N.value?N.checked:z.checked}));l(B)},f=C=>{C.stopPropagation(),n({channels:r.filter(N=>N.checked).map(N=>N.value),isResendFailedOnly:b})};return e.jsxs(v,{className:"resend-config",sx:{padding:"16px 24px"},children:[e.jsx(G,{variant:"body1",component:"div",className:"check-title",sx:{fontWeight:700,mb:1},children:o("notification.config")}),e.jsx(v,{className:"choose-channel",children:e.jsxs(Be,{component:"fieldset",variant:"standard",children:[e.jsx(et,{component:"legend",children:o("notification.selectChannels")}),e.jsx(Ee,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:1},children:r.map(C=>e.jsx(De,{control:e.jsx(Ae,{checked:C.checked,onChange:N=>D(N,C),name:C.value}),label:C.label},C.value))})]})}),e.jsx(v,{className:"resend-config-footer",children:e.jsx(Ee,{children:e.jsx(De,{control:e.jsx(Ae,{checked:b,onChange:C=>u(C.target.checked)}),label:o("notification.resendFailedOnly")})})}),e.jsxs(v,{display:"flex",justifyContent:"flex-end",gap:1,className:"resend-config-footer-tip",children:[e.jsx(we,{onClick:C=>{C.stopPropagation(),s()},color:"inherit",children:o("common.cancel")}),e.jsxs(we,{onClick:f,color:"primary",disabled:t,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[t&&e.jsx(tt,{size:16}),o("common.confirm")]})]})]})}jt.propTypes={notificationId:d.string.isRequired,handleResend:d.func,resending:d.bool};function jt({notificationId:t,handleResend:s,resending:n=!1}){const{t:o,locale:r}=X(),l=st(),b=x.useMemo(()=>nt(l,bt()),[l]),{getReceivers:u,inService:D,teamDid:f,getUser:C,blocklet:N}=We(),[B,z]=x.useState(!1),[E,Y]=x.useState([]),k=Le({anchorEl:null,position:null}),P=Le({anchorEl:null,position:null}),[I,U]=x.useState(null),[Q,te]=x.useState({total:0,pageSize:10,pageCount:0,page:1}),[p,S]=x.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[$().subtract(1,"month").startOf("day").toDate(),$().endOf("day").toDate()]}),[A,w]=x.useState([]),O=[{label:o("notification.sendStatus.pending"),value:0,status:"pending"},{label:o("notification.sendStatus.success"),value:1,status:"success"},{label:o("notification.sendStatus.failed"),value:2,status:"failed"}],_=async()=>{if(!B&&t)try{z(!0);const a=await u({notificationId:t,...p}),i=a.list.map(c=>({...c,receiverUser:{...c.receiverUser,avatar:rt(c.receiverUser.avatar,f,D)}}));Y(i),te(a.paging),z(!1)}catch(a){V.error(a.message),z(!1)}};x.useEffect(()=>{_()},[p]);const Z=a=>{a.stopPropagation();const i=a.currentTarget;P.anchorEl=i;const c=i.getBoundingClientRect();P.position={top:c.top+window.scrollY,left:c.left+window.scrollX}},W=a=>a.data.length?e.jsx("div",{style:{display:"flex",alignItems:"center",padding:"10px"},children:e.jsx(Pe,{className:"resend-btn",size:"small",color:"primary",variant:"contained",startIcon:e.jsx(ze,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:Z,children:o("notification.resend")})}):null,ae={sort:!1,download:!1,print:!1,selectableRows:"multiple",searchPlaceholder:o("common.search"),searchAlwaysOpen:!1,filterType:"checkbox",searchDebounceTime:300,page:Q.page-1,rowsPerPage:Q.pageSize,count:Q.total,searchText:p.searchText,tableBodyMaxHeight:"calc(80vh - 260px)",rowsSelected:A,onRowSelectionChange:(a,i)=>{w(i.map(c=>c.dataIndex))},customToolbarSelect:W},se=({page:a,rowsPerPage:i,searchText:c,filterList:y})=>{const[,F=[],K=[],q=[]]=y;p.pageSize!==i?S(M=>({...M,pageSize:i,page:1})):p.page!==a+1?S(M=>({...M,page:a+1})):p.searchText!==c?S(M=>({...M,searchText:c,page:1})):fe(F,p.walletSendStatus)?fe(K,p.pushKitSendStatus)?fe(q,p.emailSendStatus)||S(M=>({...M,emailSendStatus:q,page:1})):S(M=>({...M,pushKitSendStatus:K,page:1})):S(M=>({...M,walletSendStatus:F,page:1}))},le=x.useCallback(async(a,i)=>{if(!i)return!1;const c=await C(i);return c?a==="wallet"?ls(c):a==="email"?os(N,c):a==="pushKit"?rs(N,c):a==="webhook"?cs(c):!0:!1},[C,N]),je=x.useCallback(a=>ds(o,a),[o]),ce=()=>{k.anchorEl=null,k.position=null,U(null)},de=()=>{P.anchorEl=null,P.position=null},ue=async(a,i,c=!0,y="")=>{if(!(!i.length||!a.length))try{s(a,i,c,y),P.anchorEl||(await ye(.5),ce())}catch(F){console.error("handleResend error",{error:F})}},h=async({channels:a,isResendFailedOnly:i})=>{const c=A.map(y=>E[y].receiver);await ue(a,c,i),await ye(.5),de(),w([])},m=async(a,i=[],c=!0)=>{try{await ue(["webhook"],[a.receiver],c,i)}catch(y){V.error(y.response?y.response.statusText:y.message)}},g=async(a,i,c,y=[],F=!0)=>{if(a.stopPropagation(),us(i,c)>=4){V.warning(o("notification.resendLimit"));return}if(!Fe.includes(c)){await m(i,y,F);return}if(a){const q=a.currentTarget,M=q.getBoundingClientRect();k.anchorEl=q,k.position={top:M.top+window.scrollY,left:M.left+window.scrollX}}U({channel:c});try{const q=await le(c,i.receiver);await ye(1),U({channel:c,result:q}),(typeof q=="boolean"&&q||Rt(q)&&Object.values(q).every(M=>!!M))&&(await s([c],[i.receiver],F),P.anchorEl||(await ye(.5),ce()))}catch(q){V.error(q.message)}},j=a=>{S(i=>({...i,dateRange:a,page:1}))},T=(a,i,c,y)=>{a.stopPropagation();const F=c.filter(K=>K!==i);S(K=>({...K,[y]:F,page:1}))},R=J(()=>[{label:o("notification.receiver"),name:"receiver",width:200,options:{filter:!1,customBodyRenderLite:a=>{const{receiverUser:i,receiver:c}=E[a];return i?e.jsxs(v,{"data-cy":`member-name-${i.fullName}`,display:"flex",alignItems:"center",gap:1,justifyContent:"flex-start",children:[e.jsx(at,{src:`${i.avatar}?imageFilter=resize&w=48&h=48`,size:32,did:c,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),e.jsx(xe,{children:i.fullName})]},c):e.jsx(Tt,{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:p.walletSendStatus??[],customFilterListOptions:{render:a=>e.jsx(me,{list:a,label:"Wallet",onDelete:(i,c)=>{i.stopPropagation(),T(i,c,R[1].options.filterList,"walletSendStatus")}}),update:Ce},filterOptions:{names:O,fullWidth:!0,logic:Ne,display:(a,i,c,y)=>e.jsx(Ie,{label:"Wallet",filterList:a,onChange:i,index:c,column:y,filterValues:O})},customBodyRenderLite:a=>{const{walletSendStatus:i,walletSendAt:c,walletSendFailedReason:y}=E[a];return e.jsx(pe,{status:i,updatedAt:c,reason:y,channel:"wallet",onResend:F=>g(F,E[a],"wallet",[],!1)})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:a=>{const{pushKitSendStatus:i,pushKitSendAt:c,pushKitSendFailedReason:y}=E[a];return e.jsx(pe,{status:i,updatedAt:c,reason:y,channel:"pushkit",onResend:F=>g(F,E[a],"pushKit",[],!1)})},filter:!0,filterType:"custom",filterList:p.pushKitSendStatus??[],customFilterListOptions:{render:a=>e.jsx(me,{list:a,label:"Push Kit",onDelete:(i,c)=>{i.stopPropagation(),T(i,c,R[2].options.filterList,"pushKitSendStatus")}}),update:Ce},filterOptions:{names:O,fullWidth:!0,logic:Ne,display:(a,i,c,y)=>e.jsx(Ie,{label:"Push Kit",filterList:a,onChange:i,index:c,column:y,filterValues:O})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:a=>{const{emailSendStatus:i,emailSendAt:c,emailSendFailedReason:y}=E[a];return e.jsx(pe,{status:i,updatedAt:c,reason:y,channel:"email",onResend:F=>g(F,E[a],"email",[],!1)})},filter:!0,filterType:"custom",filterList:p.emailSendStatus??[],customFilterListOptions:{render:a=>e.jsx(me,{list:a,label:"Email",onDelete:(i,c)=>{i.stopPropagation(),T(i,c,R[3].options.filterList,"emailSendStatus")}}),update:Ce},filterOptions:{names:O,fullWidth:!0,logic:Ne,display:(a,i,c,y)=>e.jsx(Ie,{label:"Email",filterList:a,onChange:i,index:c,column:y,filterValues:O})}}},{label:"Webhook",name:"webhook",width:200,options:{filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:a=>{const{webhook:i}=E[a];if(!i)return null;const c=Object.entries(i)[0];if(!c)return null;const[y,F]=c,K=F[0];return e.jsx(v,{display:"flex",flexDirection:"column",gap:1,children:e.jsxs(v,{className:"webhook-item",fontSize:12,children:[e.jsx(xe,{maxLength:30,children:y},y),e.jsx(pe,{status:K.status,updatedAt:K.sendAt,reason:K.failedReason,channel:"webhook",onResend:q=>g(q,E[a],"webhook",[y],!1)})]},y)})}}},{label:o("common.createdAt"),name:"createdAt",width:100,options:{filter:!1,customBodyRenderLite:a=>{const{createdAt:i}=E[a];return e.jsx(it,{value:i,locale:r,shouldUpdate:!0})}}}],[E,r,p,o]),H=[e.jsx($e,{value:p.dateRange,onChange:j},"date-picker"),e.jsx(Pe,{variant:"contained",size:"small",color:"primary",loading:B,startIcon:e.jsx(Ht,{}),onClick:()=>_(),sx:{".MuiButton-startIcon":{mr:"2px"}},style:{marginLeft:8},children:o("common.refresh")},"refresh")];return e.jsx(v,{sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:e.jsx(hs,{children:e.jsxs(ot,{theme:b,children:[e.jsx(dt,{className:"receivers-table",locale:r,loading:B,columns:R,data:E,onChange:se,options:ae,customButtons:H,components:{TableFilterList:a=>e.jsx(Ue,{...a,itemComponent:i=>e.jsx(Te,{...i,canDelete:()=>!1})})}}),k.anchorEl&&e.jsx(Oe,{open:!!k.anchorEl,anchorReference:"anchorPosition",anchorPosition:k.position,onClose:ce,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs(gs,{children:[e.jsxs(G,{variant:"body1",component:"div",className:"check-title",children:[I==null?void 0:I.channel," Checking"]}),e.jsx(v,{display:"flex",flexDirection:"column",sx:{gap:"4px"},children:je(I==null?void 0:I.channel).map(a=>{var F,K;const{type:i,pass:c,fail:y}=a;return!(I!=null&&I.result)||(F=I==null?void 0:I.result)!=null&&F[i]?e.jsxs(G,{variant:"body1",component:"div",className:"check-item",display:"flex",alignItems:"center",sx:{gap:"4px",color:(K=I==null?void 0:I.result)!=null&&K[i]?Se.success.main:"inherit"},children:[I!=null&&I.result?e.jsx(ft,{}):e.jsx(tt,{size:12,sx:{color:Se.primary.main}}),e.jsx("span",{children:c})]},i):e.jsxs(G,{variant:"body1",component:"div",display:"flex",alignItems:"center",className:"check-item",sx:{gap:"4px",color:Se.error.main},children:[e.jsx(mt,{}),e.jsx("span",{children:y})]},i)})})]})}),P.anchorEl&&e.jsx(Oe,{open:!!P.anchorEl,anchorReference:"anchorPosition",anchorPosition:P.position,onClose:de,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsx(He,{loading:n,onCancel:de,onConfirm:h})})]})})})}const ms=x.memo(jt),hs=re.div`
1
+ import{bq as St,r as x,bD as Q,bi as $,y as V,A as L,j as e,P as d,T as Ct,aP as Xe,aQ as Ze,aw as Nt,h as ne,aB as wt,k as G,K as v,m as X,ei as _e,N as Be,kF as et,bn as Ee,aY as De,U as Ae,eo as we,b7 as Ge,b5 as Oe,C as tt,n as re,f as st,dA as nt,aT as Le,W as Tt,av as at,kG as it,B as ke,kH as ot,fZ as Se,bt as rt,ai as fe,fe as Rt,ax as It,G as Ye,kI as Et,kJ as Dt,D as lt,kK as At,kL as Ot,kM as Lt,kN as kt,R as Pt,by as ct,O as Ft,S as _t,Q as Je,J as Bt,kO as zt,a4 as Wt}from"./index-BbonVJKD.js";import{l as Mt,D as dt,g as qt}from"./index-cgrbzc6D.js";import{a as ze,c as Kt}from"./actions-Bv8xSPmq.js";import{B as $t}from"./index-DJaOwfhS.js";import{S as xe}from"./shorten-label-CrkBaee5.js";import{I as ut}from"./index-C1Pho2dB.js";import{T as Ht}from"./index-Bk6_2RlM.js";import{d as Ut}from"./Refresh-BwkLbOVU.js";import{D as Vt,g as Gt}from"./traffic-CRZc451k.js";import{u as Yt}from"./use-mobile-iVwM_YK-.js";import"./TableRow-Bvi-hC54.js";import"./useThemeProps-DmvmZB1-.js";import"./emotion-react.browser.esm-C7FmDYVX.js";import"./ViewColumn-lUXnk2yu.js";import"./Search-YHtyGibW.js";import"./Clear-CRBYarsa.js";import"./Delete-C3LWwjqe.js";import"./index-Bs8cSBPh.js";import"./MoreVert-w75snDQs.js";import"./TableSearch-3PXeI6hz.js";import"./useLocalStorage-Bp8WWQpB.js";import"./get-safe-url-CtJu_FcU.js";import"./ButtonGroup-DqXuhqTn.js";import"./getValidReactChildren-C169OtBB.js";import"./url-evaluation-CtyhxHau.js";import"./permission-CWix4PtW.js";import"./index.esm-DQhqo8hM.js";import"./collapse-CtX6Q5OE.js";import"./blocklet-ztLpKfcq.js";import"./Switch-Dt84DR0H.js";import"./iframe-B5FbPH5I.js";import"./ChevronLeft-CGdwfN-l.js";import"./ChevronRight-Bj9Dx-t_.js";import"./index-zzCN19ij.js";import"./base-chart-BHYVZ1Je.js";import"./index-CxHMQs9m.js";import"./AdapterDayjs-jFq0UWbd.js";import"./CSSTransition-CSF6lDgV.js";import"./refType-zKgXx_ar.js";const pt=x.createContext({}),{Provider:Jt,Consumer:pn}=pt;function Qt({children:t,blocklet:s=""}){const{api:n,inService:o,ws:{useSubscription:r}}=St(),[l,b]=x.useState([]),[u,D]=x.useState({total:0,pageSize:20,pageCount:0,page:1}),f=Q(()=>{var p;return(p=s.meta)==null?void 0:p.did},[s]),[C,N]=x.useState([]),[B,z]=x.useState({}),E=Q(()=>l.length?new Set(l.map(p=>p.id)):new Set,[l]),Y=async({page:p=1,pageSize:S=20,...A}={})=>{if(!f)return[];try{const w={paging:{page:p,pageSize:S},...A,teamDid:f,dateRange:A.dateRange?[$(A.dateRange[0]).toISOString(),$(A.dateRange[1]).toISOString()]:void 0},{dids:O,..._}=w;let Z="";O&&O.includes("system")&&(Z="system");const W=O?O.filter(le=>le!=="system"):[],ae={..._,source:Z,componentDids:W},se=await n.getNotificationSendLog({input:ae});return z(ae),b(se.list),D(se.paging),se.list}catch(w){return V.error(w.message),[]}},P=async()=>{const p=await n.getNotificationComponents({input:{teamDid:f}});N(p.componentDids)},k=x.useCallback(p=>{const S=s.children.find(A=>{var w;return((w=A.meta)==null?void 0:w.did)===p});if(S)return S.ancestors=[s],S},[s]),I=async({notificationId:p,receivers:S,channels:A,...w})=>{await n.resendNotification({input:{teamDid:f,notificationId:p,receivers:S,channels:A.map(O=>O==="wallet"?L.NOTIFICATION_SEND_CHANNEL.WALLET:O==="pushKit"?L.NOTIFICATION_SEND_CHANNEL.PUSH:O),...w}})},H=x.useCallback(async p=>(await n.getUser({input:{teamDid:f,user:{did:p}}})).user,[n,f]),J=x.useCallback(async({page:p=1,pageSize:S=20,...A}={})=>{try{const w={paging:{page:p,pageSize:S},...A,userName:A.searchText||"",teamDid:f,dateRange:A.dateRange?[$(A.dateRange[0]).toISOString(),$(A.dateRange[1]).toISOString()]:void 0};return await n.getReceivers({input:w})}catch(w){throw V.error(w.message),w}},[n,f]);x.useEffect(()=>{f&&P()},[f]),r(L.EVENTS.NOTIFICATION_BLOCKLET_UPDATE,p=>{E.has(p.notificationId)&&Y(B)},[E,B]),r(L.EVENTS.NOTIFICATION_BLOCKLET_CREATE,p=>{E.has(p.id)||Y(B)},[E,B]);const te={fetch:Y,data:l,paging:u,blocklet:s,getComponent:k,resendNotification:I,getUser:H,componentDids:C,getReceivers:J,inService:o,teamDid:f};return e.jsx(Jt,{value:{notificationRecords:te},children:t})}function We(){const{notificationRecords:t}=x.useContext(pt);return t}be.propTypes={severity:d.oneOf(Object.values(["info","success","error","warning"])).isRequired};const Xt={info:"primary",success:"success",error:"error",warning:"warning"};function be({severity:t="info"}){return e.jsx(Ct,{type:Xt[t],children:t})}var Me={},Zt=Ze;Object.defineProperty(Me,"__esModule",{value:!0});var ft=Me.default=void 0,es=Zt(Xe()),ts=e;ft=Me.default=(0,es.default)((0,ts.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 qe={},ss=Ze;Object.defineProperty(qe,"__esModule",{value:!0});var mt=qe.default=void 0,ns=ss(Xe()),as=e;mt=qe.default=(0,ns.default)((0,as.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");const is=(t,s,n="")=>{if(!n||!s)return"";switch(n){case L.NOTIFICATION_SEND_FAILED_REASON.USER_DISABLED:return t("notification.sendStatus.reason.disabled",{channel:s});case L.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_UNAVAILABLE:return t("notification.sendStatus.reason.unavailable",{channel:s});case L.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_DISABLED:return t("notification.sendStatus.reason.notSent",{channel:s});case L.NOTIFICATION_SEND_FAILED_REASON.NOT_ONLINE:return t("notification.sendStatus.reason.offline");default:return n}};function ht(t,s,n={}){const{status:o,updatedAt:r,reason:l="",channel:b="wallet"}=n,u=r?t("notification.sendStatus.sentTime",{date:Nt(r,s)}):"",D=is(t,b,l);return o===L.NOTIFICATION_SEND_STATUS.FAILED?{status:"failed",title:t("notification.sendStatus.failed"),sentTime:u,reason:D}:o===L.NOTIFICATION_SEND_STATUS.SENT?{status:"success",title:t("notification.sendStatus.success"),sentTime:u}:{status:"pending",title:t("notification.sendStatus.pending"),reason:D,sentTime:u}}const Pe={pending:"#aaaaaa",success:"#34BE74",failed:"#D0021B"},Fe=["wallet","pushKit","email"],Qe=["info","success","error","warning"],gt=t=>{var n,o;const{settings:s}=t;return(o=(n=s==null?void 0:s.notification)==null?void 0:n.email)==null?void 0:o.enabled},xt=t=>{var n,o;const{settings:s}=t;return(o=(n=s==null?void 0:s.notification)==null?void 0:n.pushKit)==null?void 0:o.enabled},os=(t,s)=>{const n=ne(s,"extra.notifications.email",!0);return{available:gt(t),enabled:n}},rs=(t,s)=>{const n=ne(s,"extra.notifications.push",!0);return{available:xt(t),enabled:n}},ls=t=>({enabled:ne(t,"extra.notifications.wallet",!0)}),cs=t=>({enabled:ne(t,"extra.webhooks",[]).length>0}),ye=(t=3)=>new Promise(s=>{setTimeout(()=>{s()},t*1e3)}),ds=(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})}]:[],ve=(t=[])=>{const s=$().startOf("day");return t.filter(n=>$(n.sendAt).isSame(s,"day")).length},us=(t,s="")=>{if(s&&Fe.includes(s)){const l=`${s}SendRecord`,b=ne(t,l,[]);return ve(b)}const n=ne(t,"webhook",{}),o=Object.keys(n??{})??[];if(s&&o.includes(s)){const l=n[s]??[];return ve(l)}const r={};return Fe.forEach(l=>{const b=`${l}SendRecord`,u=ne(t,b,[]),D=ve(u);r[l]=D}),o.length>0&&o.forEach(l=>{const b=n[l]??[],u=ve(b);r[l]=u}),r},Ce=(t,s,n)=>{if(!Array.isArray(t))throw new Error("Invalid filterList or index");return t[n].splice(s,1),t},Ne=(t,s)=>{if(!Array.isArray(s))throw new Error("filters must be an array");return s.length?!s.includes(t):!1},ps=t=>{switch(t){case L.NOTIFICATION_SEND_CHANNEL.WALLET:return"Wallet";case L.NOTIFICATION_SEND_CHANNEL.PUSH:return"Push Kit";case L.NOTIFICATION_SEND_CHANNEL.EMAIL:return"Email";case L.NOTIFICATION_SEND_CHANNEL.WEBHOOK:return"Webhook";default:return""}},bt=()=>({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 ee({config:t,enableTooltip:s=!0,showTitle:n=!1,children:o}){const{status:r,title:l="",sentTime:b="",reason:u=""}=t,D=[l,u].filter(Boolean).join(", ");return e.jsx(wt,{title:s?e.jsxs(e.Fragment,{children:[e.jsx(G,{color:"inherit",sx:{fontSize:12},children:D}),e.jsx("span",{children:b})]}):null,arrow:!0,placement:"top",children:e.jsxs(v,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsxs(v,{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center",children:[e.jsx(v,{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:Pe[r],style:{opacity:.15}}),e.jsx(v,{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:Pe[r]})]}),e.jsx(G,{color:"inherit",sx:{fontSize:12},children:n?l:o})]})})}ee.propTypes={config:d.object.isRequired,enableTooltip:d.bool,showTitle:d.bool,children:d.node};ee.defaultProps={enableTooltip:!0,showTitle:!1,children:null};me.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};me.defaultProps={onDelete:()=>{}};function me({list:t,label:s,onDelete:n}){const{t:o,locale:r}=X();return e.jsxs(v,{display:"flex",gap:1,alignItems:"center",children:[e.jsxs(G,{children:[s,": "]}),t.map(l=>{const b=ht(o,r,{status:l});return e.jsx(_e,{size:"small",label:e.jsx(v,{display:"flex",alignItems:"center",sx:{gap:"4px"},children:e.jsx(ee,{config:b,enableTooltip:!1,children:b.title})}),onDelete:u=>n(u,l)},l)})]})}Ke.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 Ke({filterList:t,onChange:s,index:n,column:o,filterValues:r,label:l,renderLabel:b}){return e.jsxs(Be,{className:"filter-container",children:[e.jsx(et,{component:"legend",children:l}),e.jsx(Ee,{row:!0,children:r.map(u=>e.jsx(De,{control:e.jsx(Ae,{checked:t[n].indexOf(u.value??u)>-1,onChange:D=>{const f=[...t];D.target.checked?f[n]=[...f[n],u.value??u]:f[n]=f[n].filter(C=>C!==(u.value??u)),s(f[n],n,o)},name:u.value??u}),label:e.jsx("span",{style:{display:"flex",alignItems:"center"},children:b(u)})},u.value??u))})]})}function Ie(t){return e.jsx(Ke,{...t,renderLabel:s=>e.jsx(ee,{enableTooltip:!1,config:{status:s.status},children:s.label})})}pe.propTypes={status:d.number.isRequired,updatedAt:d.string.isRequired,reason:d.string,channel:d.string,onResend:d.func};function pe({status:t,updatedAt:s,reason:n="",channel:o="wallet",onResend:r}){const{t:l,locale:b}=X(),u=ht(l,b,{status:t,updatedAt:s,reason:n,channel:o});return e.jsxs(v,{display:"flex",alignItems:"center",gap:1,children:[e.jsx(ee,{config:u,showTitle:!0}),u.status!=="success"&&e.jsx(we,{className:"resend-btn",size:"small",startIcon:e.jsx(ze,{}),sx:{fontSize:12,color:"rgba(0, 0, 0, 0.87)",fontWeight:400,".MuiButton-startIcon":{mr:"2px"}},onClick:r,children:l("notification.resend")})]})}$e.propTypes={value:d.array.isRequired,onChange:d.func};function $e({value:t,onChange:s}){const{locale:n}=X(),o=$().toDate(),[r,l]=x.useState(null),b=x.useCallback(f=>{l(r?null:f.currentTarget)},[r]),u=!!r,D=x.useCallback(f=>{if(!f.startDate||!f.endDate){V.error("Please select a date range");return}if($(f.startDate).isAfter(f.endDate)||!$(f.startDate).isValid()||!$(f.endDate).isValid()){V.error("Invalid date range");return}s([f.startDate,f.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(we,{onClick:b,variant:"outlined",size:"small",color:"inherit",children:[Ge(t[0],n)," - ",Ge(t[1],n)]})}),e.jsx(Oe,{open:u,anchorEl:r,onClose:()=>{l(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:e.jsx(Vt,{open:!0,maxDate:o,initialDateRange:{startDate:t[0],endDate:t[1]},toggle:b,definedRanges:Gt(o),onChange:D})})]})}He.propTypes={itemComponent:d.elementType.isRequired};function He({itemComponent:t,...s}){var r;const{t:n}=X();return!((r=s==null?void 0:s.filterList)!=null&&r.filter(l=>l.length).length)?null:e.jsxs(v,{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(Mt.TableFilterList,{...s,ItemComponent:t})})]})}function Te({label:t,onDelete:s,canDelete:n=()=>!0,...o}){const r=s&&typeof s=="function"?s:void 0;let l=!0;return n&&typeof n=="function"&&(l=n({label:t,...o})),e.jsx(_e,{label:t,variant:"outlined",...r&&l?{onDelete:r}:{}})}Te.propTypes={label:d.string.isRequired,onDelete:d.func,canDelete:d.func};Te.defaultProps={canDelete:()=>!0};const fs=[{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}];Ue.propTypes={loading:d.bool,onCancel:d.func,onConfirm:d.func};Ue.defaultProps={loading:!1,onCancel:()=>{},onConfirm:()=>{}};function Ue({loading:t=!1,onCancel:s,onConfirm:n}){const{t:o}=X(),[r,l]=x.useState(fs),[b,u]=x.useState(!0),D=(C,N)=>{N.checked=C.target.checked;const B=r.map(z=>({...z,checked:z.value===N.value?N.checked:z.checked}));l(B)},f=C=>{C.stopPropagation(),n({channels:r.filter(N=>N.checked).map(N=>N.value),isResendFailedOnly:b})};return e.jsxs(v,{className:"resend-config",sx:{padding:"16px 24px"},children:[e.jsx(G,{variant:"body1",component:"div",className:"check-title",sx:{fontWeight:700,mb:1},children:o("notification.config")}),e.jsx(v,{className:"choose-channel",children:e.jsxs(Be,{component:"fieldset",variant:"standard",children:[e.jsx(et,{component:"legend",children:o("notification.selectChannels")}),e.jsx(Ee,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:1},children:r.map(C=>e.jsx(De,{control:e.jsx(Ae,{checked:C.checked,onChange:N=>D(N,C),name:C.value}),label:C.label},C.value))})]})}),e.jsx(v,{className:"resend-config-footer",children:e.jsx(Ee,{children:e.jsx(De,{control:e.jsx(Ae,{checked:b,onChange:C=>u(C.target.checked)}),label:o("notification.resendFailedOnly")})})}),e.jsxs(v,{display:"flex",justifyContent:"flex-end",gap:1,className:"resend-config-footer-tip",children:[e.jsx(we,{onClick:C=>{C.stopPropagation(),s()},color:"inherit",children:o("common.cancel")}),e.jsxs(we,{onClick:f,color:"primary",disabled:t,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[t&&e.jsx(tt,{size:16}),o("common.confirm")]})]})]})}jt.propTypes={notificationId:d.string.isRequired,handleResend:d.func,resending:d.bool};function jt({notificationId:t,handleResend:s,resending:n=!1}){const{t:o,locale:r}=X(),l=st(),b=x.useMemo(()=>nt(l,bt()),[l]),{getReceivers:u,inService:D,teamDid:f,getUser:C,blocklet:N}=We(),[B,z]=x.useState(!1),[E,Y]=x.useState([]),P=Le({anchorEl:null,position:null}),k=Le({anchorEl:null,position:null}),[I,H]=x.useState(null),[J,te]=x.useState({total:0,pageSize:10,pageCount:0,page:1}),[p,S]=x.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[$().subtract(1,"month").startOf("day").toDate(),$().endOf("day").toDate()]}),[A,w]=x.useState([]),O=[{label:o("notification.sendStatus.pending"),value:0,status:"pending"},{label:o("notification.sendStatus.success"),value:1,status:"success"},{label:o("notification.sendStatus.failed"),value:2,status:"failed"}],_=async()=>{if(!B&&t)try{z(!0);const a=await u({notificationId:t,...p}),i=a.list.map(c=>({...c,receiverUser:{...c.receiverUser,avatar:rt(c.receiverUser.avatar,f,D)}}));Y(i),te(a.paging),z(!1)}catch(a){V.error(a.message),z(!1)}};x.useEffect(()=>{_()},[p]);const Z=a=>{a.stopPropagation();const i=a.currentTarget;k.anchorEl=i;const c=i.getBoundingClientRect();k.position={top:c.top+window.scrollY,left:c.left+window.scrollX}},W=a=>a.data.length?e.jsx("div",{style:{display:"flex",alignItems:"center",padding:"10px"},children:e.jsx(ke,{className:"resend-btn",size:"small",color:"primary",variant:"contained",startIcon:e.jsx(ze,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:Z,children:o("notification.resend")})}):null,ae={sort:!1,download:!1,print:!1,selectableRows:"multiple",searchPlaceholder:o("common.search"),searchAlwaysOpen:!1,filterType:"checkbox",searchDebounceTime:300,page:J.page-1,rowsPerPage:J.pageSize,count:J.total,searchText:p.searchText,tableBodyMaxHeight:"calc(80vh - 260px)",rowsSelected:A,onRowSelectionChange:(a,i)=>{w(i.map(c=>c.dataIndex))},customToolbarSelect:W},se=({page:a,rowsPerPage:i,searchText:c,filterList:y})=>{const[,F=[],K=[],q=[]]=y;p.pageSize!==i?S(M=>({...M,pageSize:i,page:1})):p.page!==a+1?S(M=>({...M,page:a+1})):p.searchText!==c?S(M=>({...M,searchText:c,page:1})):fe(F,p.walletSendStatus)?fe(K,p.pushKitSendStatus)?fe(q,p.emailSendStatus)||S(M=>({...M,emailSendStatus:q,page:1})):S(M=>({...M,pushKitSendStatus:K,page:1})):S(M=>({...M,walletSendStatus:F,page:1}))},le=x.useCallback(async(a,i)=>{if(!i)return!1;const c=await C(i);return c?a==="wallet"?ls(c):a==="email"?os(N,c):a==="pushKit"?rs(N,c):a==="webhook"?cs(c):!0:!1},[C,N]),je=x.useCallback(a=>ds(o,a),[o]),ce=()=>{P.anchorEl=null,P.position=null,H(null)},de=()=>{k.anchorEl=null,k.position=null},ue=async(a,i,c=!0,y="")=>{if(!(!i.length||!a.length))try{s(a,i,c,y),k.anchorEl||(await ye(.5),ce())}catch(F){console.error("handleResend error",{error:F})}},h=async({channels:a,isResendFailedOnly:i})=>{const c=A.map(y=>E[y].receiver);await ue(a,c,i),await ye(.5),de(),w([])},m=async(a,i=[],c=!0)=>{try{await ue(["webhook"],[a.receiver],c,i)}catch(y){V.error(y.response?y.response.statusText:y.message)}},g=async(a,i,c,y=[],F=!0)=>{if(a.stopPropagation(),us(i,c)>=4){V.warning(o("notification.resendLimit"));return}if(!Fe.includes(c)){await m(i,y,F);return}if(a){const q=a.currentTarget,M=q.getBoundingClientRect();P.anchorEl=q,P.position={top:M.top+window.scrollY,left:M.left+window.scrollX}}H({channel:c});try{const q=await le(c,i.receiver);await ye(1),H({channel:c,result:q}),(typeof q=="boolean"&&q||Rt(q)&&Object.values(q).every(M=>!!M))&&(await s([c],[i.receiver],F),k.anchorEl||(await ye(.5),ce()))}catch(q){V.error(q.message)}},j=a=>{S(i=>({...i,dateRange:a,page:1}))},T=(a,i,c,y)=>{a.stopPropagation();const F=c.filter(K=>K!==i);S(K=>({...K,[y]:F,page:1}))},R=Q(()=>[{label:o("notification.receiver"),name:"receiver",width:200,options:{filter:!1,customBodyRenderLite:a=>{const{receiverUser:i,receiver:c}=E[a];return i?e.jsxs(v,{"data-cy":`member-name-${i.fullName}`,display:"flex",alignItems:"center",gap:1,justifyContent:"flex-start",children:[e.jsx(at,{src:`${i.avatar}?imageFilter=resize&w=48&h=48`,size:32,did:c,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),e.jsx(xe,{children:i.fullName})]},c):e.jsx(Tt,{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:p.walletSendStatus??[],customFilterListOptions:{render:a=>e.jsx(me,{list:a,label:"Wallet",onDelete:(i,c)=>{i.stopPropagation(),T(i,c,R[1].options.filterList,"walletSendStatus")}}),update:Ce},filterOptions:{names:O,fullWidth:!0,logic:Ne,display:(a,i,c,y)=>e.jsx(Ie,{label:"Wallet",filterList:a,onChange:i,index:c,column:y,filterValues:O})},customBodyRenderLite:a=>{const{walletSendStatus:i,walletSendAt:c,walletSendFailedReason:y}=E[a];return e.jsx(pe,{status:i,updatedAt:c,reason:y,channel:"wallet",onResend:F=>g(F,E[a],"wallet",[],!1)})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:a=>{const{pushKitSendStatus:i,pushKitSendAt:c,pushKitSendFailedReason:y}=E[a];return e.jsx(pe,{status:i,updatedAt:c,reason:y,channel:"pushkit",onResend:F=>g(F,E[a],"pushKit",[],!1)})},filter:!0,filterType:"custom",filterList:p.pushKitSendStatus??[],customFilterListOptions:{render:a=>e.jsx(me,{list:a,label:"Push Kit",onDelete:(i,c)=>{i.stopPropagation(),T(i,c,R[2].options.filterList,"pushKitSendStatus")}}),update:Ce},filterOptions:{names:O,fullWidth:!0,logic:Ne,display:(a,i,c,y)=>e.jsx(Ie,{label:"Push Kit",filterList:a,onChange:i,index:c,column:y,filterValues:O})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:a=>{const{emailSendStatus:i,emailSendAt:c,emailSendFailedReason:y}=E[a];return e.jsx(pe,{status:i,updatedAt:c,reason:y,channel:"email",onResend:F=>g(F,E[a],"email",[],!1)})},filter:!0,filterType:"custom",filterList:p.emailSendStatus??[],customFilterListOptions:{render:a=>e.jsx(me,{list:a,label:"Email",onDelete:(i,c)=>{i.stopPropagation(),T(i,c,R[3].options.filterList,"emailSendStatus")}}),update:Ce},filterOptions:{names:O,fullWidth:!0,logic:Ne,display:(a,i,c,y)=>e.jsx(Ie,{label:"Email",filterList:a,onChange:i,index:c,column:y,filterValues:O})}}},{label:"Webhook",name:"webhook",width:200,options:{filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:a=>{const{webhook:i}=E[a];if(!i)return null;const c=Object.entries(i)[0];if(!c)return null;const[y,F]=c,K=F[0];return e.jsx(v,{display:"flex",flexDirection:"column",gap:1,children:e.jsxs(v,{className:"webhook-item",fontSize:12,children:[e.jsx(xe,{maxLength:30,children:y},y),e.jsx(pe,{status:K.status,updatedAt:K.sendAt,reason:K.failedReason,channel:"webhook",onResend:q=>g(q,E[a],"webhook",[y],!1)})]},y)})}}},{label:o("common.createdAt"),name:"createdAt",width:100,options:{filter:!1,customBodyRenderLite:a=>{const{createdAt:i}=E[a];return e.jsx(it,{value:i,locale:r,shouldUpdate:!0})}}}],[E,r,p,o]),U=[e.jsx($e,{value:p.dateRange,onChange:j},"date-picker"),e.jsx(ke,{variant:"contained",size:"small",color:"primary",loading:B,startIcon:e.jsx(Ut,{}),onClick:()=>_(),sx:{".MuiButton-startIcon":{mr:"2px"}},style:{marginLeft:8},children:o("common.refresh")},"refresh")];return e.jsx(v,{sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:e.jsx(hs,{children:e.jsxs(ot,{theme:b,children:[e.jsx(dt,{className:"receivers-table",locale:r,loading:B,columns:R,data:E,onChange:se,options:ae,customButtons:U,components:{TableFilterList:a=>e.jsx(He,{...a,itemComponent:i=>e.jsx(Te,{...i,canDelete:()=>!1})})}}),P.anchorEl&&e.jsx(Oe,{open:!!P.anchorEl,anchorReference:"anchorPosition",anchorPosition:P.position,onClose:ce,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs(gs,{children:[e.jsxs(G,{variant:"body1",component:"div",className:"check-title",children:[I==null?void 0:I.channel," Checking"]}),e.jsx(v,{display:"flex",flexDirection:"column",sx:{gap:"4px"},children:je(I==null?void 0:I.channel).map(a=>{var F,K;const{type:i,pass:c,fail:y}=a;return!(I!=null&&I.result)||(F=I==null?void 0:I.result)!=null&&F[i]?e.jsxs(G,{variant:"body1",component:"div",className:"check-item",display:"flex",alignItems:"center",sx:{gap:"4px",color:(K=I==null?void 0:I.result)!=null&&K[i]?Se.success.main:"inherit"},children:[I!=null&&I.result?e.jsx(ft,{}):e.jsx(tt,{size:12,sx:{color:Se.primary.main}}),e.jsx("span",{children:c})]},i):e.jsxs(G,{variant:"body1",component:"div",display:"flex",alignItems:"center",className:"check-item",sx:{gap:"4px",color:Se.error.main},children:[e.jsx(mt,{}),e.jsx("span",{children:y})]},i)})})]})}),k.anchorEl&&e.jsx(Oe,{open:!!k.anchorEl,anchorReference:"anchorPosition",anchorPosition:k.position,onClose:de,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsx(Ue,{loading:n,onCancel:de,onConfirm:h})})]})})})}const ms=x.memo(jt),hs=re.div`
2
2
  td.MuiTableCell-footer {
3
3
  border: none !important;
4
4
  }
@@ -27,7 +27,7 @@ import{bq as St,r as x,bD as J,bi as $,y as V,A as L,j as e,P as d,T as Ct,aP as
27
27
  }
28
28
  font-size: 12px;
29
29
  }
30
- `,he=t=>t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${(t/1e3).toFixed(1)}K`:t;function xs(t){const{wallet:s,push:n,email:o,webhook:r}=t;return[{name:"Wallet",value:e.jsx(ie,{item:s})},{name:"Push",value:e.jsx(ie,{item:n})},{name:"Email",value:e.jsx(ie,{item:o})},...r.total>0?[{name:"Webhook",value:e.jsx(ie,{item:r,isWebhook:!0})}]:[]]}function bs(t,s,n){const{wallet:o,push:r,email:l,webhook:b}=t;return[{name:"Wallet",value:e.jsx(oe,{loading:n,channel:L.NOTIFICATION_SEND_CHANNEL.WALLET,item:o,onResend:s})},{name:"Push",value:e.jsx(oe,{loading:n,channel:L.NOTIFICATION_SEND_CHANNEL.PUSH,item:r,onResend:s})},{name:"Email",value:e.jsx(oe,{loading:n,channel:L.NOTIFICATION_SEND_CHANNEL.EMAIL,item:l,onResend:s})},...b.total>0?[{name:"Webhook",value:e.jsx(oe,{loading:n,channel:L.NOTIFICATION_SEND_CHANNEL.WEBHOOK,item:b,isWebhook:!0,onResend:s})}]:[]]}Re.propTypes={statistics:d.object.isRequired,onResend:d.func,mode:d.oneOf(["simple","detail"]),resending:d.bool};Re.defaultProps={mode:"simple",onResend:()=>{},resending:!1};ie.propTypes={item:d.object.isRequired,isWebhook:d.bool};ie.defaultProps={isWebhook:!1};function ie({item:t,isWebhook:s=!1}){const{t:n}=X(),o=s?t.success.length:t.success,r=t.total,l=o===r?"success":"failed";return e.jsx(v,{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:2,children:e.jsx(v,{display:"flex",alignItems:"center",gap:1,children:e.jsxs(ee,{config:{status:l},enableTooltip:!1,children:[he(o)," / ",he(r)," ",n("notification.sendStatus.success")]})})})}oe.propTypes={item:d.object.isRequired,isWebhook:d.bool,channel:d.string,onResend:d.func,loading:d.bool};oe.defaultProps={isWebhook:!1,channel:L.NOTIFICATION_SEND_CHANNEL.WALLET,onResend:()=>{},loading:!1};function oe({channel:t,item:s,isWebhook:n=!1,onResend:o,loading:r}){const{t:l}=X(),{success:b,failed:u,pending:D}=s,f=ps(t),C=n?b.length:b,N=n?u.length:u,B=n?D.length:D,z=async P=>{P.stopPropagation();const I=n?[...new Set([...b,...u].map(U=>U))]:[];await o([t],[],!0,I)},E=C+N,Y=E>0?C/E*100:0,k=E>0?N/E*100:0;return e.jsxs(js,{successRatio:Y,failedRatio:k,children:[e.jsxs(G,{variant:"h6",children:[f," (",s.total,")"]}),e.jsxs(G,{variant:"body1",sx:{mb:2},children:[e.jsx("span",{style:{color:ke.success,fontWeight:600,fontSize:24},children:he(C)}),e.jsx("small",{style:{paddingLeft:4},children:l("notification.sendStatus.success")})]}),e.jsxs(v,{className:"unsent-area",children:[e.jsxs(v,{children:[e.jsxs(ee,{config:{status:"failed"},enableTooltip:!1,children:[he(N)," ",l("notification.sendStatus.failed")]}),e.jsxs(ee,{config:{status:"pending"},enableTooltip:!1,children:[he(B)," ",l("notification.sendStatus.pending")]})]}),N>0&&e.jsx(v,{className:"resend-btn",children:e.jsx(Pe,{size:"small",color:"primary",loading:r,variant:"contained",startIcon:e.jsx(ze,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:z,children:l("notification.resend")})})]})]})}function Re({statistics:t,mode:s="simple",onResend:n,resending:o}){const r=J(()=>s==="simple"?xs(t):bs(t,n,o),[t,s]);return s==="simple"?e.jsx("div",{children:r.map(l=>e.jsx(ut,{style:{alignItems:"flex-start",marginBottom:s==="simple"?0:16},valueComponent:"div",nameWidth:100,name:l.name,children:l.value},l.name))}):e.jsx(Ye,{container:!0,spacing:2,children:r.map(l=>e.jsx(Ye,{item:!0,md:4,sm:6,xs:12,children:l.value},l.name))})}const js=re(v)`
30
+ `,he=t=>t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${(t/1e3).toFixed(1)}K`:t;function xs(t){const{wallet:s,push:n,email:o,webhook:r}=t;return[{name:"Wallet",value:e.jsx(ie,{item:s})},{name:"Push",value:e.jsx(ie,{item:n})},{name:"Email",value:e.jsx(ie,{item:o})},...r.total>0?[{name:"Webhook",value:e.jsx(ie,{item:r,isWebhook:!0})}]:[]]}function bs(t,s,n){const{wallet:o,push:r,email:l,webhook:b}=t;return[{name:"Wallet",value:e.jsx(oe,{loading:n,channel:L.NOTIFICATION_SEND_CHANNEL.WALLET,item:o,onResend:s})},{name:"Push",value:e.jsx(oe,{loading:n,channel:L.NOTIFICATION_SEND_CHANNEL.PUSH,item:r,onResend:s})},{name:"Email",value:e.jsx(oe,{loading:n,channel:L.NOTIFICATION_SEND_CHANNEL.EMAIL,item:l,onResend:s})},...b.total>0?[{name:"Webhook",value:e.jsx(oe,{loading:n,channel:L.NOTIFICATION_SEND_CHANNEL.WEBHOOK,item:b,isWebhook:!0,onResend:s})}]:[]]}Re.propTypes={statistics:d.object.isRequired,onResend:d.func,mode:d.oneOf(["simple","detail"]),resending:d.bool};Re.defaultProps={mode:"simple",onResend:()=>{},resending:!1};ie.propTypes={item:d.object.isRequired,isWebhook:d.bool};ie.defaultProps={isWebhook:!1};function ie({item:t,isWebhook:s=!1}){const{t:n}=X(),o=s?t.success.length:t.success,r=t.total,l=o===r?"success":"failed";return e.jsx(v,{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:2,children:e.jsx(v,{display:"flex",alignItems:"center",gap:1,children:e.jsxs(ee,{config:{status:l},enableTooltip:!1,children:[he(o)," / ",he(r)," ",n("notification.sendStatus.success")]})})})}oe.propTypes={item:d.object.isRequired,isWebhook:d.bool,channel:d.string,onResend:d.func,loading:d.bool};oe.defaultProps={isWebhook:!1,channel:L.NOTIFICATION_SEND_CHANNEL.WALLET,onResend:()=>{},loading:!1};function oe({channel:t,item:s,isWebhook:n=!1,onResend:o,loading:r}){const{t:l}=X(),{success:b,failed:u,pending:D}=s,f=ps(t),C=n?b.length:b,N=n?u.length:u,B=n?D.length:D,z=async k=>{k.stopPropagation();const I=n?[...new Set([...b,...u].map(H=>H))]:[];await o([t],[],!0,I)},E=C+N,Y=E>0?C/E*100:0,P=E>0?N/E*100:0;return e.jsxs(js,{successRatio:Y,failedRatio:P,children:[e.jsxs(G,{variant:"h6",children:[f," (",s.total,")"]}),e.jsxs(G,{variant:"body1",sx:{mb:2},children:[e.jsx("span",{style:{color:Pe.success,fontWeight:600,fontSize:24},children:he(C)}),e.jsx("small",{style:{paddingLeft:4},children:l("notification.sendStatus.success")})]}),e.jsxs(v,{className:"unsent-area",children:[e.jsxs(v,{children:[e.jsxs(ee,{config:{status:"failed"},enableTooltip:!1,children:[he(N)," ",l("notification.sendStatus.failed")]}),e.jsxs(ee,{config:{status:"pending"},enableTooltip:!1,children:[he(B)," ",l("notification.sendStatus.pending")]})]}),N>0&&e.jsx(v,{className:"resend-btn",children:e.jsx(ke,{size:"small",color:"primary",loading:r,variant:"contained",startIcon:e.jsx(ze,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:z,children:l("notification.resend")})})]})]})}function Re({statistics:t,mode:s="simple",onResend:n,resending:o}){const r=Q(()=>s==="simple"?xs(t):bs(t,n,o),[t,s]);return s==="simple"?e.jsx("div",{children:r.map(l=>e.jsx(ut,{style:{alignItems:"flex-start",marginBottom:s==="simple"?0:16},valueComponent:"div",nameWidth:100,name:l.name,children:l.value},l.name))}):e.jsx(Ye,{container:!0,spacing:2,children:r.map(l=>e.jsx(Ye,{item:!0,md:4,sm:6,xs:12,children:l.value},l.name))})}const js=re(v)`
31
31
  display: flex;
32
32
  flex-direction: column;
33
33
  align-items: flex-start;
@@ -45,7 +45,7 @@ import{bq as St,r as x,bD as J,bi as $,y as V,A as L,j as e,P as d,T as Ct,aP as
45
45
  bottom: 0;
46
46
  }
47
47
  }
48
- `;yt.propTypes={notification:d.object.isRequired,onCancel:d.func,blocklet:d.object.isRequired,tab:d.string};function yt({notification:t,onCancel:s=()=>{},blocklet:n,tab:o="info"}){const{t:r,locale:l}=X(),{getComponent:b,resendNotification:u}=We(),[D,f]=x.useState(!1),C=J(()=>b(t.componentDid)||n,[n,t.componentDid]),N=Le({tab:o||"info"}),B=x.useCallback(async(p,S,A=!0,w=[])=>{var Z;if(!p.length||!t.id)return;const O=S.length>0?S:(Z=t==null?void 0:t.receivers)==null?void 0:Z.map(W=>W.receiver);if(!O.length)return;let _=[...p];if(_.includes(L.NOTIFICATION_SEND_CHANNEL.PUSH)&&!xt(n)&&(V.warning(r("notification.sendStatus.reason.unavailable",{channel:"Push Kit"})),_=_.filter(W=>W!==L.NOTIFICATION_SEND_CHANNEL.PUSH)),_.includes(L.NOTIFICATION_SEND_CHANNEL.EMAIL)&&!gt(n)&&(V.warning(r("notification.sendStatus.reason.unavailable",{channel:"Email"})),_=_.filter(W=>W!==L.NOTIFICATION_SEND_CHANNEL.EMAIL)),!!_.length)try{f(!0),await u({notificationId:t.id,receivers:O,channels:_,resendFailedOnly:A,..._.includes("webhook")&&w.length?{webhookUrls:w}:{}}),V.success("Message has been sent!")}catch(W){console.error("handleResend error",{error:W}),V.error(W.response?W.response.statusText:W.message)}finally{f(!1)}},[n,t.id,t==null?void 0:t.receivers,u,r]),z=J(()=>Et(t),[t]),E=J(()=>Dt(t),[t]),Y=J(()=>z?t==null?void 0:t.actorInfo:[],[t]),k=J(()=>{var p;return(n==null?void 0:n.did)||((p=n==null?void 0:n.meta)==null?void 0:p.did)||""},[n]);function P(){return[{name:r("notification.from"),value:z&&E?e.jsx(At,{actors:Y,teamDid:k,size:32,showName:!0}):e.jsx(Ot,{size:32,blocklet:C,showName:!0,hideDot:!0})},{name:r("notification.notificationTitle"),value:e.jsx(xe,{maxLength:50,children:t.title})},{name:r("notification.body"),value:z?e.jsx(Lt,{notification:t,blocklet:n}):e.jsx(Pt,{notification:t,rows:0})},{name:r("notification.severity"),value:e.jsx(be,{severity:t.severity})},{name:r("notification.createdAt"),value:e.jsx(kt,{value:t.createdAt,locale:l,shouldUpdate:!0,type:"all"})}].map(S=>e.jsx(ut,{style:{alignItems:"flex-start"},valueComponent:"div",nameWidth:120,name:S.name,children:S.value},S.name))}const I={info:{label:r("common.basicInfo"),value:"info",component:P},receivers:{label:r("notification.receiver"),value:"receivers"},statistics:{label:r("notification.statistics"),value:"statistics"}},U=Object.values(I).map(({label:p,value:S})=>({label:p,value:S})),Q=I[N.tab]||I.info,te=p=>{N.tab=p};return e.jsx(lt,{title:r("notification.notificationDetails"),fullWidth:!0,maxWidth:"lg",onClose:()=>{N.tab="info",s()},open:!0,actionsPosition:"left",sx:{".ux-dialog_header":{paddingBottom:0},".MuiDialogContent-root":{paddingTop:0}},children:e.jsxs(vs,{children:[e.jsx(v,{mx:3,className:"tabs",children:e.jsx(Ut,{tabs:U,current:N.tab,onChange:te,scrollButtons:"auto"})}),e.jsxs("div",{className:"body",children:[N.tab==="receivers"&&e.jsx(ms,{notificationId:t.id,resending:D,handleResend:B}),N.tab==="statistics"&&e.jsx(Re,{statistics:t.statistics,mode:"detail",resending:D,onResend:B}),N.tab==="info"&&e.jsx(Q.component,{})]})]})})}const ys=x.memo(yt),vs=re.div`
48
+ `;yt.propTypes={notification:d.object.isRequired,onCancel:d.func,blocklet:d.object.isRequired,tab:d.string};function yt({notification:t,onCancel:s=()=>{},blocklet:n,tab:o="info"}){const{t:r,locale:l}=X(),{getComponent:b,resendNotification:u}=We(),[D,f]=x.useState(!1),C=Q(()=>b(t.componentDid)||n,[n,t.componentDid]),N=Le({tab:o||"info"}),B=x.useCallback(async(p,S,A=!0,w=[])=>{var Z;if(!p.length||!t.id)return;const O=S.length>0?S:(Z=t==null?void 0:t.receivers)==null?void 0:Z.map(W=>W.receiver);if(!O.length)return;let _=[...p];if(_.includes(L.NOTIFICATION_SEND_CHANNEL.PUSH)&&!xt(n)&&(V.warning(r("notification.sendStatus.reason.unavailable",{channel:"Push Kit"})),_=_.filter(W=>W!==L.NOTIFICATION_SEND_CHANNEL.PUSH)),_.includes(L.NOTIFICATION_SEND_CHANNEL.EMAIL)&&!gt(n)&&(V.warning(r("notification.sendStatus.reason.unavailable",{channel:"Email"})),_=_.filter(W=>W!==L.NOTIFICATION_SEND_CHANNEL.EMAIL)),!!_.length)try{f(!0),await u({notificationId:t.id,receivers:O,channels:_,resendFailedOnly:A,..._.includes("webhook")&&w.length?{webhookUrls:w}:{}}),V.success("Message has been sent!")}catch(W){console.error("handleResend error",{error:W}),V.error(W.response?W.response.statusText:W.message)}finally{f(!1)}},[n,t.id,t==null?void 0:t.receivers,u,r]),z=Q(()=>Et(t),[t]),E=Q(()=>Dt(t),[t]),Y=Q(()=>z?t==null?void 0:t.actorInfo:[],[t]),P=Q(()=>{var p;return(n==null?void 0:n.did)||((p=n==null?void 0:n.meta)==null?void 0:p.did)||""},[n]);function k(){return[{name:r("notification.from"),value:z&&E?e.jsx(At,{actors:Y,teamDid:P,size:32,showName:!0}):e.jsx(Ot,{size:32,blocklet:C,showName:!0,hideDot:!0})},{name:r("notification.notificationTitle"),value:e.jsx(xe,{maxLength:50,children:t.title})},{name:r("notification.body"),value:z?e.jsx(Lt,{notification:t,blocklet:n}):e.jsx(kt,{notification:t,rows:0})},{name:r("notification.severity"),value:e.jsx(be,{severity:t.severity})},{name:r("notification.createdAt"),value:e.jsx(Pt,{value:t.createdAt,locale:l,shouldUpdate:!0,type:"all"})}].map(S=>e.jsx(ut,{style:{alignItems:"flex-start"},valueComponent:"div",nameWidth:120,name:S.name,children:S.value},S.name))}const I={info:{label:r("common.basicInfo"),value:"info",component:k},receivers:{label:r("notification.receiver"),value:"receivers"},statistics:{label:r("notification.statistics"),value:"statistics"}},H=Object.values(I).map(({label:p,value:S})=>({label:p,value:S})),J=I[N.tab]||I.info,te=p=>{N.tab=p};return e.jsx(lt,{title:r("notification.notificationDetails"),fullWidth:!0,maxWidth:"lg",onClose:()=>{N.tab="info",s()},open:!0,actionsPosition:"left",sx:{".ux-dialog_header":{paddingBottom:0},".MuiDialogContent-root":{paddingTop:0}},children:e.jsxs(vs,{children:[e.jsx(v,{mx:3,className:"tabs",children:e.jsx(Ht,{tabs:H,current:N.tab,onChange:te,scrollButtons:"auto"})}),e.jsxs("div",{className:"body",children:[N.tab==="receivers"&&e.jsx(ms,{notificationId:t.id,resending:D,handleResend:B}),N.tab==="statistics"&&e.jsx(Re,{statistics:t.statistics,mode:"detail",resending:D,onResend:B}),N.tab==="info"&&e.jsx(J.component,{})]})]})})}const ys=x.memo(yt),vs=re.div`
49
49
  & > .notification-row {
50
50
  padding: 0;
51
51
  }
@@ -92,7 +92,7 @@ import{bq as St,r as x,bD as J,bi as $,y as V,A as L,j as e,P as d,T as Ct,aP as
92
92
  overflow: hidden;
93
93
  text-overflow: ellipsis;
94
94
  }
95
- `;function ge({blocklet:t,label:s}){var n;return e.jsx(Ss,{children:t?e.jsxs(e.Fragment,{children:[e.jsx(ct,{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})})}Ve.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};Ve.defaultProps={onDelete:()=>{}};function Ve({list:t,label:s,onDelete:n}){return e.jsxs(v,{display:"flex",gap:1,alignItems:"center",children:[e.jsxs(G,{children:[s,": "]}),t.map(o=>e.jsx(_e,{size:"small",label:e.jsx(v,{display:"flex",alignItems:"center",sx:{gap:"4px"},children:e.jsx(be,{severity:o})}),onDelete:r=>n(r,o)},o))]})}function Cs(t){return e.jsx(Ke,{...t,renderLabel:s=>e.jsx(be,{severity:s})})}function Ns({customTableButtons:t}){var ue;const{t:s,locale:n}=X(),o=st(),r=x.useMemo(()=>nt(o,bt()),[o]),[l,b]=x.useState(!1),{data:u,paging:D,blocklet:f,fetch:C,getComponent:N,componentDids:B,inService:z,teamDid:E}=We(),Y=x.useRef(null),[k,P]=x.useState(null),[I,U]=x.useState("info"),Q=Yt(),[te,p]=x.useState(!1),S=`notification-records-${(ue=f.meta)==null?void 0:ue.did}`,A=qt(S),[w,O]=x.useState({pageSize:A.rowsPerPage||10,page:A.page?A.page+1:1,dids:A.dids||[],dateRange:A.dateRange||[$().subtract(1,"month").startOf("day").toDate(),$().endOf("day").toDate()]}),_=J(()=>{if(!f.children||!f.children.length)return[];const h=[];return f.children.forEach(m=>{var j;const g=m.did||((j=m.meta)==null?void 0:j.did);B.includes(g)&&(m.ancestors=[f],h.push(m))}),h},[B,f]),Z=async h=>{try{b(!0),await C(h),b(!1)}finally{b(!1)}};x.useEffect(()=>{Z(w)},[w]),x.useEffect(()=>{const h=u.find(m=>m.id===(k==null?void 0:k.id));k&&h&&P({...h})},[u]);const W=(h,m,g,j)=>{h.stopPropagation();const T=g.filter(R=>R!==m);O(R=>({...R,[j]:T,page:1}))},ae=({page:h,rowsPerPage:m,filterList:g})=>{const[j=[],,,,T=[]]=g;w.pageSize!==m?O(R=>({...R,pageSize:m,page:1})):w.page!==h+1?O(R=>({...R,page:h+1})):fe(w.dids,j)?fe(w.severities,T)||O(R=>({...R,severities:T,page:1})):O(R=>({...R,dids:j,page:1}))},se=x.useCallback(()=>{P(null),U("info")},[]),le=x.useCallback(()=>{C(w)},[C,w]),je=[{label:s("notification.from"),name:"sender",width:400,options:{filter:!0,filterType:"custom",customFilterListOptions:{render:h=>h.map((m,g)=>{var T;if(m==="system")return e.jsx("span",{children:s("notification.system")},`system-${g}`);const j=_.find(R=>{var a;return(R.did||((a=R.meta)==null?void 0:a.did))===m});return e.jsx(ge,{blocklet:j,label:(j==null?void 0:j.title)||((T=j==null?void 0:j.meta)==null?void 0:T.title)},m)}),update:(h,m,g)=>(h[g].splice(m,1),h)},filterOptions:{names:_,logic:(h,m)=>m.length?!m.includes(h):!1,display:(h,m,g,j)=>e.jsxs(Be,{style:{width:"380px"},children:[e.jsx(Ft,{id:"demo-simple-select-label",style:{background:"#ffffff"},children:"Sender"}),e.jsxs(_t,{multiple:!0,value:h[g],renderValue:T=>e.jsx(v,{display:"flex",gap:1,alignItems:"center",style:{overflow:"hidden",textOverflow:"ellipsis"},children:T.map(R=>{var a;if(R==="system")return e.jsx("span",{children:s("notification.system")},R);const H=_.find(i=>{var y;return(i.did||((y=i.meta)==null?void 0:y.did))===R});return e.jsx(ge,{blocklet:H,label:(H==null?void 0:H.title)||((a=H==null?void 0:H.meta)==null?void 0:a.title)},R)})}),onChange:T=>{h[g]=T.target.value,m(h[g],g,j)},children:[e.jsx(Qe,{value:"system",children:s("notification.system")}),_.map(T=>{var H,a;const R=T.did||((H=T.meta)==null?void 0:H.did);return e.jsx(Qe,{value:R,children:e.jsx(ge,{blocklet:T,label:T.title||((a=T.meta)==null?void 0:a.title)})},R)})]})]})},customBodyRenderLite:h=>{var j,T;const m=u[h],g=N(m.componentDid);return e.jsxs(v,{display:"flex",alignItems:"center",gap:1,children:[g?e.jsx(ct,{size:32,blocklet:g,ancestors:g.ancestors??[]}):e.jsx(Bt,{blocklet:f,size:32}),e.jsx(xe,{maxLength:50,children:((j=g==null?void 0:g.meta)==null?void 0:j.title)||((T=f==null?void 0:f.meta)==null?void 0:T.title)})]})}}},{label:s("notification.receiver"),name:"receivers",width:300,options:{filter:!1,customBodyRenderLite:h=>{const m=u[h],{receivers:g}=m;return e.jsx(zt,{total:g.length,renderSurplus:j=>j<100?e.jsxs("span",{children:["+",j]}):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:j=>{j.stopPropagation(),P(m),U("receivers")},children:g.map(j=>{const{receiverUser:T}=j,R=rt(T.avatar,E,z);return e.jsx(at,{alt:T.fullName,src:`${R}?imageFilter=resize&w=48&h=48`,size:32,did:j.receiver,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}},j.receiver)})})}}},{label:s("notification.statistics"),name:"statistics",width:400,options:{filter:!1,customBodyRenderLite:h=>{const m=u[h];return e.jsx(v,{onClick:g=>{g.stopPropagation(),P(m),U("statistics")},children:e.jsx(Re,{statistics:m.statistics})})}}},{label:s("notification.notificationPreview"),name:"data",options:{filter:!1,customBodyRenderLite:h=>{const m=u[h];return e.jsx(xe,{maxLength:50,children:m.title})}}},{label:s("notification.severity"),name:"severity",width:200,options:{setCellProps:()=>({className:"severity-cell"}),customBodyRenderLite:h=>{const m=u[h];return e.jsx(be,{severity:m.severity})},filter:!0,filterType:"custom",filterList:w.severities??[],customFilterListOptions:{render:h=>e.jsx(Ve,{list:h,label:s("notification.severity"),onDelete:(m,g)=>{m.stopPropagation(),W(m,g,je[4].options.filterList,"severities")}}),update:Ce},filterOptions:{names:Je,fullWidth:!0,logic:Ne,display:(h,m,g,j)=>e.jsx(Cs,{label:s("notification.severity"),filterList:h,onChange:m,index:g,column:j,filterValues:Je})}}},{label:s("common.createdAt"),name:"createdAt",width:300,options:{filter:!1,customBodyRenderLite:h=>{const{createdAt:m}=u[h];return e.jsx(it,{value:m,locale:n,shouldUpdate:!0})}}}],ce=h=>{O(m=>({...m,dateRange:h,page:1}))},de=[e.jsxs(v,{display:"flex",alignItems:"center",gap:1.5,children:[e.jsx(Wt,{onClick:()=>p(!0),sx:{p:Q?0:void 0},children:e.jsx(Kt,{})},"settings"),Q?e.jsx(G,{children:s("common.setting")}):null]}),...t||[]];return e.jsxs(v,{ref:Y,sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:[e.jsx(ws,{children:e.jsx(ot,{theme:r,children:e.jsx(dt,{className:"main-table",verticalKeyWidth:100,loading:l,locale:n,columns:je,data:u,durable:S,onChange:ae,options:{sort:!1,download:!1,print:!1,search:!1,expandableRowsOnClick:!0,page:D.page-1,rowsPerPage:D.pageSize,count:D.total,...A,onRowClick:(h,{dataIndex:m})=>{P(u[m])}},customPreButtons:[e.jsx($e,{value:w.dateRange,onChange:ce})],customButtons:de,components:{TableFilterList:h=>e.jsx(Ue,{...h,itemComponent:m=>e.jsx(Te,{...m,canDelete:g=>{var T;const j=(T=g==null?void 0:g.columnNames)==null?void 0:T[(g==null?void 0:g.index)||0];return(j==null?void 0:j.name)==="sender"}})})}})})}),k&&e.jsx(ys,{refresh:le,onCancel:se,notification:k,blocklet:f,tab:I}),e.jsx(lt,{title:`${s("common.notification")} ${s("common.setting")}`,fullWidth:!0,maxWidth:"md",open:te,onClose:()=>p(!1),PaperProps:{style:{minHeight:"500px"}},children:e.jsx(v,{sx:{mt:"-16px",overflowY:"hidden"},children:e.jsx($t,{})})})]})}const ws=re.div`
95
+ `;function ge({blocklet:t,label:s}){var n;return e.jsx(Ss,{children:t?e.jsxs(e.Fragment,{children:[e.jsx(ct,{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})})}Ve.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};Ve.defaultProps={onDelete:()=>{}};function Ve({list:t,label:s,onDelete:n}){return e.jsxs(v,{display:"flex",gap:1,alignItems:"center",children:[e.jsxs(G,{children:[s,": "]}),t.map(o=>e.jsx(_e,{size:"small",label:e.jsx(v,{display:"flex",alignItems:"center",sx:{gap:"4px"},children:e.jsx(be,{severity:o})}),onDelete:r=>n(r,o)},o))]})}function Cs(t){return e.jsx(Ke,{...t,renderLabel:s=>e.jsx(be,{severity:s})})}function Ns({customTableButtons:t}){var ue;const{t:s,locale:n}=X(),o=st(),r=x.useMemo(()=>nt(o,bt()),[o]),[l,b]=x.useState(!1),{data:u,paging:D,blocklet:f,fetch:C,getComponent:N,componentDids:B,inService:z,teamDid:E}=We(),Y=x.useRef(null),[P,k]=x.useState(null),[I,H]=x.useState("info"),J=Yt(),[te,p]=x.useState(!1),S=`notification-records-${(ue=f.meta)==null?void 0:ue.did}`,A=qt(S),[w,O]=x.useState({pageSize:A.rowsPerPage||10,page:A.page?A.page+1:1,dids:A.dids||[],dateRange:A.dateRange||[$().subtract(1,"month").startOf("day").toDate(),$().endOf("day").toDate()]}),_=Q(()=>{if(!f.children||!f.children.length)return[];const h=[];return f.children.forEach(m=>{var j;const g=m.did||((j=m.meta)==null?void 0:j.did);B.includes(g)&&(m.ancestors=[f],h.push(m))}),h},[B,f]),Z=async h=>{try{b(!0),await C(h),b(!1)}finally{b(!1)}};x.useEffect(()=>{Z(w)},[w]),x.useEffect(()=>{const h=u.find(m=>m.id===(P==null?void 0:P.id));P&&h&&k({...h})},[u]);const W=(h,m,g,j)=>{h.stopPropagation();const T=g.filter(R=>R!==m);O(R=>({...R,[j]:T,page:1}))},ae=({page:h,rowsPerPage:m,filterList:g})=>{const[j=[],,,,T=[]]=g;w.pageSize!==m?O(R=>({...R,pageSize:m,page:1})):w.page!==h+1?O(R=>({...R,page:h+1})):fe(w.dids,j)?fe(w.severities,T)||O(R=>({...R,severities:T,page:1})):O(R=>({...R,dids:j,page:1}))},se=x.useCallback(()=>{k(null),H("info")},[]),le=x.useCallback(()=>{C(w)},[C,w]),je=[{label:s("notification.from"),name:"sender",width:400,options:{filter:!0,filterType:"custom",customFilterListOptions:{render:h=>h.map((m,g)=>{var T;if(m==="system")return e.jsx("span",{children:s("notification.system")},`system-${g}`);const j=_.find(R=>{var a;return(R.did||((a=R.meta)==null?void 0:a.did))===m});return e.jsx(ge,{blocklet:j,label:(j==null?void 0:j.title)||((T=j==null?void 0:j.meta)==null?void 0:T.title)},m)}),update:(h,m,g)=>(h[g].splice(m,1),h)},filterOptions:{names:_,logic:(h,m)=>m.length?!m.includes(h):!1,display:(h,m,g,j)=>e.jsxs(Be,{style:{width:"380px"},children:[e.jsx(Ft,{id:"demo-simple-select-label",style:{background:"#ffffff"},children:"Sender"}),e.jsxs(_t,{multiple:!0,value:h[g],renderValue:T=>e.jsx(v,{display:"flex",gap:1,alignItems:"center",style:{overflow:"hidden",textOverflow:"ellipsis"},children:T.map(R=>{var a;if(R==="system")return e.jsx("span",{children:s("notification.system")},R);const U=_.find(i=>{var y;return(i.did||((y=i.meta)==null?void 0:y.did))===R});return e.jsx(ge,{blocklet:U,label:(U==null?void 0:U.title)||((a=U==null?void 0:U.meta)==null?void 0:a.title)},R)})}),onChange:T=>{h[g]=T.target.value,m(h[g],g,j)},children:[e.jsx(Je,{value:"system",children:s("notification.system")}),_.map(T=>{var U,a;const R=T.did||((U=T.meta)==null?void 0:U.did);return e.jsx(Je,{value:R,children:e.jsx(ge,{blocklet:T,label:T.title||((a=T.meta)==null?void 0:a.title)})},R)})]})]})},customBodyRenderLite:h=>{var j,T;const m=u[h],g=N(m.componentDid);return e.jsxs(v,{display:"flex",alignItems:"center",gap:1,children:[g?e.jsx(ct,{size:32,blocklet:g,ancestors:g.ancestors??[]}):e.jsx(Bt,{blocklet:f,size:32}),e.jsx(xe,{maxLength:50,children:((j=g==null?void 0:g.meta)==null?void 0:j.title)||((T=f==null?void 0:f.meta)==null?void 0:T.title)})]})}}},{label:s("notification.receiver"),name:"receivers",width:300,options:{filter:!1,customBodyRenderLite:h=>{const m=u[h],{receivers:g}=m;return e.jsx(zt,{total:g.length,renderSurplus:j=>j<100?e.jsxs("span",{children:["+",j]}):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:j=>{j.stopPropagation(),k(m),H("receivers")},children:g.map(j=>{const{receiverUser:T}=j,R=rt(T.avatar,E,z);return e.jsx(at,{alt:T.fullName,src:`${R}?imageFilter=resize&w=48&h=48`,size:32,did:j.receiver,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}},j.receiver)})})}}},{label:s("notification.statistics"),name:"statistics",width:400,options:{filter:!1,customBodyRenderLite:h=>{const m=u[h];return e.jsx(v,{onClick:g=>{g.stopPropagation(),k(m),H("statistics")},children:e.jsx(Re,{statistics:m.statistics})})}}},{label:s("notification.notificationPreview"),name:"data",options:{filter:!1,customBodyRenderLite:h=>{const m=u[h];return e.jsx(xe,{maxLength:50,children:m.title})}}},{label:s("notification.severity"),name:"severity",width:200,options:{setCellProps:()=>({className:"severity-cell"}),customBodyRenderLite:h=>{const m=u[h];return e.jsx(be,{severity:m.severity})},filter:!0,filterType:"custom",filterList:w.severities??[],customFilterListOptions:{render:h=>e.jsx(Ve,{list:h,label:s("notification.severity"),onDelete:(m,g)=>{m.stopPropagation(),W(m,g,je[4].options.filterList,"severities")}}),update:Ce},filterOptions:{names:Qe,fullWidth:!0,logic:Ne,display:(h,m,g,j)=>e.jsx(Cs,{label:s("notification.severity"),filterList:h,onChange:m,index:g,column:j,filterValues:Qe})}}},{label:s("common.createdAt"),name:"createdAt",width:300,options:{filter:!1,customBodyRenderLite:h=>{const{createdAt:m}=u[h];return e.jsx(it,{value:m,locale:n,shouldUpdate:!0})}}}],ce=h=>{O(m=>({...m,dateRange:h,page:1}))},de=[e.jsxs(v,{display:"flex",alignItems:"center",gap:1.5,children:[e.jsx(Wt,{onClick:()=>p(!0),sx:{p:J?0:void 0},children:e.jsx(Kt,{})},"settings"),J?e.jsx(G,{children:s("common.setting")}):null]}),...t||[]];return e.jsxs(v,{ref:Y,sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:[e.jsx(ws,{children:e.jsx(ot,{theme:r,children:e.jsx(dt,{className:"main-table",verticalKeyWidth:100,loading:l,locale:n,columns:je,data:u,durable:S,onChange:ae,options:{sort:!1,download:!1,print:!1,search:!1,expandableRowsOnClick:!0,page:D.page-1,rowsPerPage:D.pageSize,count:D.total,...A,onRowClick:(h,{dataIndex:m})=>{k(u[m])}},customPreButtons:[e.jsx($e,{value:w.dateRange,onChange:ce})],customButtons:de,components:{TableFilterList:h=>e.jsx(He,{...h,itemComponent:m=>e.jsx(Te,{...m,canDelete:g=>{var T;const j=(T=g==null?void 0:g.columnNames)==null?void 0:T[(g==null?void 0:g.index)||0];return(j==null?void 0:j.name)==="sender"}})})}})})}),P&&e.jsx(ys,{refresh:le,onCancel:se,notification:P,blocklet:f,tab:I}),e.jsx(lt,{title:`${s("common.notification")} ${s("common.setting")}`,fullWidth:!0,maxWidth:"md",open:te,onClose:()=>p(!1),PaperProps:{style:{minHeight:"500px"}},children:e.jsx(v,{sx:{mt:"-16px",overflowY:"hidden"},children:e.jsx($t,{})})})]})}const ws=re.div`
96
96
  td.MuiTableCell-footer {
97
97
  border: none !important;
98
98
  }
@@ -110,4 +110,4 @@ import{bq as St,r as x,bD as J,bi as $,y as V,A as L,j as e,P as d,T as Ct,aP as
110
110
  .custom-toobar-btns {
111
111
  gap: 4px;
112
112
  }
113
- `;vt.propTypes={blocklet:d.object.isRequired,customTableButtons:d.array};vt.defaultProps={customTableButtons:[]};function vt({blocklet:t={},customTableButtons:s}){return e.jsx(Jt,{blocklet:t,children:e.jsx(Ns,{customTableButtons:s})})}export{vt as default};
113
+ `;vt.propTypes={blocklet:d.object.isRequired,customTableButtons:d.array};vt.defaultProps={customTableButtons:[]};function vt({blocklet:t={},customTableButtons:s}){return e.jsx(Qt,{blocklet:t,children:e.jsx(Ns,{customTableButtons:s})})}export{vt as default};
@@ -1 +1 @@
1
- import{r as o,e,j as t,n}from"./index-e66xJJ-x.js";import{R as r}from"./index-D5xjISzz.js";function i(){const{t:s}=o.useContext(e);return t.jsx(a,{style:{paddingTop:"25vh"},children:t.jsx(r,{status:"404",description:s("noMatch.desc"),style:{backgroundColor:"transparent"}})})}const a=n.main``;export{i as default};
1
+ import{r as o,e,j as t,n}from"./index-BbonVJKD.js";import{R as r}from"./index-CJxcYJLK.js";function i(){const{t:s}=o.useContext(e);return t.jsx(a,{style:{paddingTop:"25vh"},children:t.jsx(r,{status:"404",description:s("noMatch.desc"),style:{backgroundColor:"transparent"}})})}const a=n.main``;export{i as default};
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-Bt1dFWNc.js","./index-e66xJJ-x.js","./index-2qex5JRJ.css"])))=>i.map(i=>d[i]);
2
- import{r as p,cv as F,c6 as X,cw as H,cx as q,aP as G,aQ as O,j as s,n as E,P as j,E as Q,aT as V,e as J,cy as K,v as _,K as x,cz as Y,W as Z,B as I,bc as ee,k as M,cA as $,g as te,cB as se,bC as ae,cC as oe,cD as ne,u as re,w as ie,ap as ce,bA as le,af as pe}from"./index-e66xJJ-x.js";import{d as de}from"./ViewList-BaTy1Ph1.js";import{d as ue}from"./Done-D3hzYYUk.js";import{N as me}from"./index-BTVRLsIg.js";import{w as fe}from"./wrap-locale-B6I84qwC.js";import{g as he}from"./get-safe-url-h3P_Qh4v.js";import{S as xe,a as ge,b as ve}from"./Stepper-DBIHjo83.js";import"./emotion-react.browser.esm-BsFIkhYD.js";var P=function(t){if(!t)return 0;var r=q(t).valueOf()-Date.now();return r<0?0:r},be=function(t){return{days:Math.floor(t/864e5),hours:Math.floor(t/36e5)%24,minutes:Math.floor(t/6e4)%60,seconds:Math.floor(t/1e3)%60,milliseconds:Math.floor(t)%1e3}},we=function(t){t===void 0&&(t={});var r=t||{},l=r.leftTime,i=r.targetDate,d=r.interval,v=d===void 0?1e3:d,b=r.onEnd,g=p.useMemo(function(){return F(l)&&l>0?Date.now()+l:void 0},[l]),a="leftTime"in t?g:i,m=X(p.useState(function(){return P(a)}),2),f=m[0],u=m[1],o=H(b);p.useEffect(function(){if(!a){u(0);return}u(P(a));var w=setInterval(function(){var n,c=P(a);u(c),c===0&&(clearInterval(w),(n=o.current)===null||n===void 0||n.call(o))},v);return function(){return clearInterval(w)}},[a,v]);var y=p.useMemo(function(){return be(f)},[f]);return[f,y]},k={},ye=O;Object.defineProperty(k,"__esModule",{value:!0});var R=k.default=void 0,je=ye(G()),Se=s;R=k.default=(0,je.default)((0,Se.jsx)("path",{d:"M19 9h-4V3H9v6H5l7 7zM5 18v2h14v-2z"}),"GetApp");function T({list:t,width:r,height:l,cardSpace:i,onSelect:d,defaultIndex:v}){const[b,g]=p.useState(0),[a,m]=p.useState(0),f=p.useRef(null),u=n=>{if(n<0||n>t.length-1)return;g(n);const c=f.current.clientWidth;m(n*(r+i)-(c-r)/2+i*.5),d(n)};p.useEffect(()=>{u(v);const n=c=>c.preventDefault();f.current.addEventListener("touchmove",n,{passive:!1})},[]);let o;const y=n=>{o=n.touches[0].clientX},w=n=>{const c=n.changedTouches[0],S=o-c.clientX;Math.abs(S)>60&&(S>0?u(b+1):u(b-1))};return s.jsx(Pe,{ref:f,onTouchStart:y,onTouchEnd:w,children:s.jsx("div",{className:"card-container",style:{transform:`translate(${-a}px, 0)`},children:t.map((n,c)=>s.jsx("div",{className:`card-item ${c===b?"selected":""}`,style:{width:r,height:l,margin:i/2},onClick:()=>u(c),children:n.display?s.jsx("div",{className:"card-content",children:s.jsx(me,{data:n.display,style:{width:"100%",height:"100%"}})}):s.jsx("div",{className:"card-content",dangerouslySetInnerHTML:{__html:n.src}})},n.id))})})}const Pe=E.div`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-CS2M01En.js","./index-BbonVJKD.js","./index-2qex5JRJ.css"])))=>i.map(i=>d[i]);
2
+ import{r as p,cv as F,c6 as X,cw as H,cx as q,aP as G,aQ as O,j as s,n as E,P as j,E as Q,aT as V,e as J,cy as K,v as _,K as x,cz as Y,W as Z,B as I,bc as ee,k as M,cA as $,g as te,cB as se,bC as ae,cC as oe,cD as ne,u as re,w as ie,ap as ce,bA as le,af as pe}from"./index-BbonVJKD.js";import{d as de}from"./ViewList-DRI2pLPW.js";import{d as ue}from"./Done-CFH2iz5e.js";import{N as me}from"./index-DLWDtECG.js";import{w as fe}from"./wrap-locale-DOaCGmjV.js";import{g as he}from"./get-safe-url-CtJu_FcU.js";import{S as xe,a as ge,b as ve}from"./Stepper-CnVr1egz.js";import"./emotion-react.browser.esm-C7FmDYVX.js";var P=function(t){if(!t)return 0;var r=q(t).valueOf()-Date.now();return r<0?0:r},be=function(t){return{days:Math.floor(t/864e5),hours:Math.floor(t/36e5)%24,minutes:Math.floor(t/6e4)%60,seconds:Math.floor(t/1e3)%60,milliseconds:Math.floor(t)%1e3}},we=function(t){t===void 0&&(t={});var r=t||{},l=r.leftTime,i=r.targetDate,d=r.interval,v=d===void 0?1e3:d,b=r.onEnd,g=p.useMemo(function(){return F(l)&&l>0?Date.now()+l:void 0},[l]),a="leftTime"in t?g:i,m=X(p.useState(function(){return P(a)}),2),f=m[0],u=m[1],o=H(b);p.useEffect(function(){if(!a){u(0);return}u(P(a));var w=setInterval(function(){var n,c=P(a);u(c),c===0&&(clearInterval(w),(n=o.current)===null||n===void 0||n.call(o))},v);return function(){return clearInterval(w)}},[a,v]);var y=p.useMemo(function(){return be(f)},[f]);return[f,y]},k={},ye=O;Object.defineProperty(k,"__esModule",{value:!0});var R=k.default=void 0,je=ye(G()),Se=s;R=k.default=(0,je.default)((0,Se.jsx)("path",{d:"M19 9h-4V3H9v6H5l7 7zM5 18v2h14v-2z"}),"GetApp");function T({list:t,width:r,height:l,cardSpace:i,onSelect:d,defaultIndex:v}){const[b,g]=p.useState(0),[a,m]=p.useState(0),f=p.useRef(null),u=n=>{if(n<0||n>t.length-1)return;g(n);const c=f.current.clientWidth;m(n*(r+i)-(c-r)/2+i*.5),d(n)};p.useEffect(()=>{u(v);const n=c=>c.preventDefault();f.current.addEventListener("touchmove",n,{passive:!1})},[]);let o;const y=n=>{o=n.touches[0].clientX},w=n=>{const c=n.changedTouches[0],S=o-c.clientX;Math.abs(S)>60&&(S>0?u(b+1):u(b-1))};return s.jsx(Pe,{ref:f,onTouchStart:y,onTouchEnd:w,children:s.jsx("div",{className:"card-container",style:{transform:`translate(${-a}px, 0)`},children:t.map((n,c)=>s.jsx("div",{className:`card-item ${c===b?"selected":""}`,style:{width:r,height:l,margin:i/2},onClick:()=>u(c),children:n.display?s.jsx("div",{className:"card-content",children:s.jsx(me,{data:n.display,style:{width:"100%",height:"100%"}})}):s.jsx("div",{className:"card-content",dangerouslySetInnerHTML:{__html:n.src}})},n.id))})})}const Pe=E.div`
3
3
  overflow: hidden;
4
4
  mask-image: linear-gradient(to left, transparent, black 3%, black 97%, transparent);
5
5
  overflow: hidden;
@@ -33,7 +33,7 @@ import{r as p,cv as F,c6 as X,cw as H,cx as q,aP as G,aQ as O,j as s,n as E,P as
33
33
  }
34
34
  }
35
35
  }
36
- `;T.propTypes={list:j.array,width:j.number,height:j.number,cardSpace:j.number,onSelect:j.func,defaultIndex:j.number};T.defaultProps={list:"",width:300,height:400,cardSpace:40,onSelect:()=>{},defaultIndex:0};function ke({icon:t,active:r,completed:l}){const i={1:s.jsx(de,{className:"step-icon"}),2:s.jsx(R,{className:"step-icon"}),3:s.jsx(ue,{className:"step-icon"})},d=["step-icon-w"];return r&&d.push("step-icon-w--active"),l&&d.push("step-icon-w--completed"),s.jsx("div",{className:d.join(" "),children:i[String(t)]})}function Te({SessionContext:t,webWalletUrl:r,createPassportSvg:l,passportColor:i,onLogin:d}){const{api:v,session:b}=p.useContext(t),g=Q(e=>e.breakpoints.down("sm")),a=V({user:null,passport:null,success:!1,activeStep:0}),m=p.useRef({sessionToken:"",refreshToken:""}),{setPassportId:f,clearPassportId:u}=ne(),{t:o,locale:y}=p.useContext(J),{wallet:w}=K(),[n,c]=p.useState(0),{searchParams:S}=new URL(window.location.href),C=()=>{a.activeStep++},W=e=>{a.user=e.user},A=()=>{C()},z=(e,h)=>{e!=null&&e.passportId&&f(e.passportId),e!=null&&e.sessionToken&&(m.current.sessionToken=h(e.sessionToken)),e!=null&&e.refreshToken&&(m.current.refreshToken=h(e.refreshToken)),a.success=!0,C()},U=async()=>{try{await b.logout()}catch(e){console.warn(e)}},D=async()=>{if(w&&$()){ae(()=>import("./index-Bt1dFWNc.js").then(h=>h.i),__vite__mapDeps([0,1,2]),import.meta.url).then(h=>{h.call("arcClosePage")});return}await U(),oe(d)&&d({sessionToken:m.current.sessionToken,refreshToken:m.current.refreshToken});const e=S.get("redirect");if(e){window.location.replace(he(e));return}u(),window.location.replace("/")},B=e=>{a.passport=e.target.value},[N]=we({leftTime:n,onEnd:()=>{D()}}),L=[{label:o("lostPassport.recoverPassport"),content:()=>a.user?s.jsxs(x,{className:"select-passport",children:[s.jsxs(x,{my:1,display:"flex",alignItems:"center",className:"user-info",children:[s.jsx(Y,{src:a.user.avatar,style:{width:48,height:48,backgroundColor:"transparent",marginRight:16}}),s.jsxs(x,{children:[s.jsx(x,{className:"name",children:a.user.fullName}),s.jsx(x,{className:"did",mt:1,children:s.jsx(Z,{responsive:!g,compact:g,did:a.user.did})})]})]}),s.jsx("div",{children:s.jsx(T,{width:g?180:230,height:g?240:306,cardSpace:24,list:a.user.passportTypes.map(e=>({src:l({scope:e.scope,role:e.role,title:e.scope==="kyc"?e.name:e.title,issuer:e.issuer.name,issuerDid:e.issuer.id,ownerDid:a.user.did,ownerName:a.user.fullName,ownerAvatarUrl:a.user.avatar,preferredColor:i||"auto",extra:e.scope==="kyc"?{key:"Email",value:e.name}:void 0}),name:e.title,id:e.id,display:e.display})),onSelect:e=>B({target:{value:a.user.passportTypes[e].id}}),defaultIndex:0})}),s.jsx(x,{textAlign:"center",children:s.jsx(I,{variant:"contained",color:"primary",onClick:()=>A(),disabled:!a.passport,children:o("common.next")})})]}):s.jsx(_,{popup:!0,open:!0,hideCloseButton:!0,className:"connect",action:"lost-passport-list",forceConnected:!1,autoConnect:!1,checkFn:v.get,checkTimeout:10*60*1e3,webWalletUrl:r,onSuccess:W,locale:y,messages:{title:o("lostPassport.recoverDialog.title"),scan:o("lostPassport.recoverDialog.scan"),confirm:o("lostPassport.recoverDialog.confirm"),success:o("lostPassport.recoverDialog.success")}})},{label:o("lostPassport.receivePassport"),content:()=>{var h;const e={receiverDid:a.user.did,passportId:a.passport,teamDid:((h=window==null?void 0:window.blocklet)==null?void 0:h.did)||""};return s.jsx(_,{popup:!0,open:!0,hideCloseButton:!0,className:"connect",action:"lost-passport-issue",checkFn:v.get,checkTimeout:10*60*1e3,webWalletUrl:r,onSuccess:z,locale:y,messages:{title:`${o("lostPassport.receiveDialog.title")}`,scan:o("lostPassport.receiveDialog.scan"),confirm:o("lostPassport.receiveDialog.confirm"),success:o("lostPassport.receiveDialog.success")},extraParams:e})}},{label:o("common.complete"),content:()=>(n===0&&c(3e3),s.jsxs(x,{textAlign:"center",children:[s.jsx(x,{mb:3,color:"success.main",children:s.jsx(ee,{style:{fontSize:60}})}),s.jsx(M,{component:"p",variant:"body1",className:"subheader",children:o("issuePassport.dialog.success")}),s.jsx(M,{component:"p",variant:"body2",color:"gray",children:w&&$()?o("issuePassport.dialog.autoClose",{seconds:Math.round(N/1e3)}):o("issuePassport.dialog.autoJump",{seconds:Math.round(N/1e3)})}),s.jsx(I,{style:{marginTop:40},variant:"contained",color:"primary",onClick:D,children:o("issuePassport.dialog.loginWithPassport")})]}))}];return s.jsx(Ce,{children:s.jsxs("div",{className:"stepper",children:[s.jsx(xe,{className:"stepper-progress",alternativeLabel:!0,activeStep:a.activeStep,children:L.map(({label:e})=>s.jsx(ge,{children:s.jsx(ve,{StepIconComponent:ke,children:e})},e))}),s.jsx("div",{className:"stepper-content",children:L[a.activeStep].content()}),!a.success&&s.jsx(x,{textAlign:"center",fontSize:12,children:s.jsx(te,{href:"/",sx:{color:"#4598FA",textDecoration:"none"},children:o("lostPassport.return")})})]})})}const Ce=E(se)`
36
+ `;T.propTypes={list:j.array,width:j.number,height:j.number,cardSpace:j.number,onSelect:j.func,defaultIndex:j.number};T.defaultProps={list:"",width:300,height:400,cardSpace:40,onSelect:()=>{},defaultIndex:0};function ke({icon:t,active:r,completed:l}){const i={1:s.jsx(de,{className:"step-icon"}),2:s.jsx(R,{className:"step-icon"}),3:s.jsx(ue,{className:"step-icon"})},d=["step-icon-w"];return r&&d.push("step-icon-w--active"),l&&d.push("step-icon-w--completed"),s.jsx("div",{className:d.join(" "),children:i[String(t)]})}function Te({SessionContext:t,webWalletUrl:r,createPassportSvg:l,passportColor:i,onLogin:d}){const{api:v,session:b}=p.useContext(t),g=Q(e=>e.breakpoints.down("sm")),a=V({user:null,passport:null,success:!1,activeStep:0}),m=p.useRef({sessionToken:"",refreshToken:""}),{setPassportId:f,clearPassportId:u}=ne(),{t:o,locale:y}=p.useContext(J),{wallet:w}=K(),[n,c]=p.useState(0),{searchParams:S}=new URL(window.location.href),C=()=>{a.activeStep++},W=e=>{a.user=e.user},A=()=>{C()},z=(e,h)=>{e!=null&&e.passportId&&f(e.passportId),e!=null&&e.sessionToken&&(m.current.sessionToken=h(e.sessionToken)),e!=null&&e.refreshToken&&(m.current.refreshToken=h(e.refreshToken)),a.success=!0,C()},U=async()=>{try{await b.logout()}catch(e){console.warn(e)}},D=async()=>{if(w&&$()){ae(()=>import("./index-CS2M01En.js").then(h=>h.i),__vite__mapDeps([0,1,2]),import.meta.url).then(h=>{h.call("arcClosePage")});return}await U(),oe(d)&&d({sessionToken:m.current.sessionToken,refreshToken:m.current.refreshToken});const e=S.get("redirect");if(e){window.location.replace(he(e));return}u(),window.location.replace("/")},B=e=>{a.passport=e.target.value},[N]=we({leftTime:n,onEnd:()=>{D()}}),L=[{label:o("lostPassport.recoverPassport"),content:()=>a.user?s.jsxs(x,{className:"select-passport",children:[s.jsxs(x,{my:1,display:"flex",alignItems:"center",className:"user-info",children:[s.jsx(Y,{src:a.user.avatar,style:{width:48,height:48,backgroundColor:"transparent",marginRight:16}}),s.jsxs(x,{children:[s.jsx(x,{className:"name",children:a.user.fullName}),s.jsx(x,{className:"did",mt:1,children:s.jsx(Z,{responsive:!g,compact:g,did:a.user.did})})]})]}),s.jsx("div",{children:s.jsx(T,{width:g?180:230,height:g?240:306,cardSpace:24,list:a.user.passportTypes.map(e=>({src:l({scope:e.scope,role:e.role,title:e.scope==="kyc"?e.name:e.title,issuer:e.issuer.name,issuerDid:e.issuer.id,ownerDid:a.user.did,ownerName:a.user.fullName,ownerAvatarUrl:a.user.avatar,preferredColor:i||"auto",extra:e.scope==="kyc"?{key:"Email",value:e.name}:void 0}),name:e.title,id:e.id,display:e.display})),onSelect:e=>B({target:{value:a.user.passportTypes[e].id}}),defaultIndex:0})}),s.jsx(x,{textAlign:"center",children:s.jsx(I,{variant:"contained",color:"primary",onClick:()=>A(),disabled:!a.passport,children:o("common.next")})})]}):s.jsx(_,{popup:!0,open:!0,hideCloseButton:!0,className:"connect",action:"lost-passport-list",forceConnected:!1,autoConnect:!1,checkFn:v.get,checkTimeout:10*60*1e3,webWalletUrl:r,onSuccess:W,locale:y,messages:{title:o("lostPassport.recoverDialog.title"),scan:o("lostPassport.recoverDialog.scan"),confirm:o("lostPassport.recoverDialog.confirm"),success:o("lostPassport.recoverDialog.success")}})},{label:o("lostPassport.receivePassport"),content:()=>{var h;const e={receiverDid:a.user.did,passportId:a.passport,teamDid:((h=window==null?void 0:window.blocklet)==null?void 0:h.did)||""};return s.jsx(_,{popup:!0,open:!0,hideCloseButton:!0,className:"connect",action:"lost-passport-issue",checkFn:v.get,checkTimeout:10*60*1e3,webWalletUrl:r,onSuccess:z,locale:y,messages:{title:`${o("lostPassport.receiveDialog.title")}`,scan:o("lostPassport.receiveDialog.scan"),confirm:o("lostPassport.receiveDialog.confirm"),success:o("lostPassport.receiveDialog.success")},extraParams:e})}},{label:o("common.complete"),content:()=>(n===0&&c(3e3),s.jsxs(x,{textAlign:"center",children:[s.jsx(x,{mb:3,color:"success.main",children:s.jsx(ee,{style:{fontSize:60}})}),s.jsx(M,{component:"p",variant:"body1",className:"subheader",children:o("issuePassport.dialog.success")}),s.jsx(M,{component:"p",variant:"body2",color:"gray",children:w&&$()?o("issuePassport.dialog.autoClose",{seconds:Math.round(N/1e3)}):o("issuePassport.dialog.autoJump",{seconds:Math.round(N/1e3)})}),s.jsx(I,{style:{marginTop:40},variant:"contained",color:"primary",onClick:D,children:o("issuePassport.dialog.loginWithPassport")})]}))}];return s.jsx(Ce,{children:s.jsxs("div",{className:"stepper",children:[s.jsx(xe,{className:"stepper-progress",alternativeLabel:!0,activeStep:a.activeStep,children:L.map(({label:e})=>s.jsx(ge,{children:s.jsx(ve,{StepIconComponent:ke,children:e})},e))}),s.jsx("div",{className:"stepper-content",children:L[a.activeStep].content()}),!a.success&&s.jsx(x,{textAlign:"center",fontSize:12,children:s.jsx(te,{href:"/",sx:{color:"#4598FA",textDecoration:"none"},children:o("lostPassport.return")})})]})})}const Ce=E(se)`
37
37
  padding-top: 46px;
38
38
  padding-bottom: 46px;
39
39
  height: 100%;