@abtnode/webapp 1.17.3-beta-20251123-232619-53258789 → 1.17.3-beta-20251126-121502-d0926972

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 (189) hide show
  1. package/blocklet.js +1 -1
  2. package/blocklet.yml +1 -1
  3. package/dist/assets/{AdapterDayjs-GSjt4DIz.js → AdapterDayjs-BjSFvDvr.js} +1 -1
  4. package/dist/assets/{Add-bw7LExYi.js → Add-BmZCIl-_.js} +1 -1
  5. package/dist/assets/ArrowDropDown-DAMbspww.js +1 -0
  6. package/dist/assets/{Autocomplete-C7pwOgja.js → Autocomplete-kBTyvXut.js} +1 -1
  7. package/dist/assets/{Breadcrumbs-01Zoyowa.js → Breadcrumbs-DbJOP5vy.js} +1 -1
  8. package/dist/assets/{ButtonGroup-CvkZLM_A.js → ButtonGroup-BlhSVfK3.js} +1 -1
  9. package/dist/assets/{CSSTransition-CUGJUBZa.js → CSSTransition-Cyc7snYy.js} +1 -1
  10. package/dist/assets/{CallMerge-1Wa1naTP.js → CallMerge-CKPqdgb2.js} +1 -1
  11. package/dist/assets/{CardContent-Bp9dBuHI.js → CardContent-CJq0LG9T.js} +1 -1
  12. package/dist/assets/{ChevronLeft-iV8RZK9l.js → ChevronLeft-B42HGuyE.js} +1 -1
  13. package/dist/assets/{ChevronRight-rhEdYh7r.js → ChevronRight-BLRImDEd.js} +1 -1
  14. package/dist/assets/{Clear-TsHHhjv8.js → Clear-BoRiznJI.js} +1 -1
  15. package/dist/assets/{DeleteOutline-CutnF8U7.js → DeleteOutline-_XfCv5J6.js} +1 -1
  16. package/dist/assets/{Done-8bsZuZu5.js → Done-b5-rnBrk.js} +1 -1
  17. package/dist/assets/{Edit-CW607hdk.js → Edit-DGAlfiQv.js} +1 -1
  18. package/dist/assets/{ErrorOutline-BVlSjT51.js → ErrorOutline-DevVxMhb.js} +1 -1
  19. package/dist/assets/{FilterList-BVOOp-qX.js → FilterList-tXxMVwM9.js} +1 -1
  20. package/dist/assets/{Google-D0deGelc.js → Google-MSCLr2Nf.js} +1 -1
  21. package/dist/assets/{HelpOutline-B2x2uyvQ.js → HelpOutline-DIH3coQJ.js} +1 -1
  22. package/dist/assets/{KeyboardArrowDown-BDLR_mDt.js → KeyboardArrowDown-DDe3llHj.js} +1 -1
  23. package/dist/assets/{Launch-BhpfIjR4.js → Launch-DZ6lDDzp.js} +1 -1
  24. package/dist/assets/{Link-D6g1Xkkg.js → Link-CQj5KcJh.js} +1 -1
  25. package/dist/assets/{ListItemButton-DBhd8Se9.js → ListItemButton-BJq_k_rp.js} +1 -1
  26. package/dist/assets/{ListSubheader-U4UKs_5o.js → ListSubheader-BO55OpFe.js} +1 -1
  27. package/dist/assets/{LoadingButton-Bg4ihiHh.js → LoadingButton-Bw73z7Kp.js} +1 -1
  28. package/dist/assets/{MoreVert-LlVBp8Yl.js → MoreVert-CykMlsrj.js} +1 -1
  29. package/dist/assets/{OpenInNew-BBMfbtyT.js → OpenInNew-D8CczU9i.js} +1 -1
  30. package/dist/assets/{Refresh-DwCMTrBg.js → Refresh-BClPDZOR.js} +1 -1
  31. package/dist/assets/{Search-DV0DmDJh.js → Search-BrXfrk6s.js} +1 -1
  32. package/dist/assets/{Stepper-DHEo1TwM.js → Stepper-Clv2yUpj.js} +1 -1
  33. package/dist/assets/{Switch-BV_bJmtO.js → Switch-btQlV2VF.js} +1 -1
  34. package/dist/assets/{TableSearch-Dw0n59eL.js → TableSearch-BkWoZDH8.js} +1 -1
  35. package/dist/assets/{ToggleButtonGroup-DsgagStl.js → ToggleButtonGroup-BBbP2Jx0.js} +1 -1
  36. package/dist/assets/{UnfoldMore-OHiBiV6d.js → UnfoldMore-RJlxkooV.js} +1 -1
  37. package/dist/assets/{Verified-8SqBajcm.js → Verified-l0Y44mJl.js} +1 -1
  38. package/dist/assets/{VerifiedUser-Yl48fJHl.js → VerifiedUser-agBH4B6_.js} +1 -1
  39. package/dist/assets/{ViewList-Dlfa9YjE.js → ViewList-DqVhCHtG.js} +1 -1
  40. package/dist/assets/{_createAggregator-C9kdvL4F.js → _createAggregator-D2uXgg5x.js} +1 -1
  41. package/dist/assets/{actions-Cd1V0QXL.js → actions-BPQhtNul.js} +1 -1
  42. package/dist/assets/{actions-B8C-PCI5.js → actions-DOkacRyd.js} +1 -1
  43. package/dist/assets/{agreement-BUveUzQO.js → agreement-peew__AK.js} +1 -1
  44. package/dist/assets/api-BEwC7jzb.js +1 -0
  45. package/dist/assets/{appearance-DJ340BPT.js → appearance-Nhx9Kmv1.js} +1 -1
  46. package/dist/assets/{audit-logs-Budxmero.js → audit-logs-BlbUuwN_.js} +2 -2
  47. package/dist/assets/{base-chart-B0G5PbEt.js → base-chart-CzLW1tBo.js} +1 -1
  48. package/dist/assets/{blocklet-B_gm4lmi.js → blocklet-DooKd_sI.js} +1 -1
  49. package/dist/assets/chain-EI4hm_8e.js +6 -0
  50. package/dist/assets/{click-to-copy-C9rtZDLS.js → click-to-copy-BYLhYz_K.js} +1 -1
  51. package/dist/assets/cloneDeep-F6LuuTz3.js +1 -0
  52. package/dist/assets/{collapse-CXW4uktq.js → collapse-CmeTRdrT.js} +1 -1
  53. package/dist/assets/{config-navigation-XP4WQgYo.js → config-navigation-SDiPbeiK.js} +46 -46
  54. package/dist/assets/connect-to-DxqW5HVH.js +30 -0
  55. package/dist/assets/{cssMode--X9ZnCcB.js → cssMode-U50M1_i-.js} +1 -1
  56. package/dist/assets/{delete-confirm-H64HwgQW.js → delete-confirm-B_mXlLTh.js} +1 -1
  57. package/dist/assets/{depsEqual-DnLesJI5.js → depsEqual-CI7FeWZW.js} +1 -1
  58. package/dist/assets/{detail-BJu2Du0C.js → detail-B_ewDRP9.js} +3 -3
  59. package/dist/assets/{domains-dlolWlOv.js → domains-DWWQ8C3v.js} +1 -1
  60. package/dist/assets/{download-BfgyvMjJ.js → download-Jmt9jl6E.js} +1 -1
  61. package/dist/assets/{edit.svg-MioFY6RL.js → edit.svg-DOKf0NKv.js} +1 -1
  62. package/dist/assets/emotion-cache.browser.esm-CKIgFJwY.js +1 -0
  63. package/dist/assets/engine-PA5Hlqhs.js +1 -0
  64. package/dist/assets/{freemarker2-DaUACayH.js → freemarker2-wCdJg_1P.js} +1 -1
  65. package/dist/assets/{get-safe-url-BdtvVcQw.js → get-safe-url-mJazyUZj.js} +1 -1
  66. package/dist/assets/getValidReactChildren-C2GpPG5h.js +1 -0
  67. package/dist/assets/{graphqlMode-Cs4xUrf4.js → graphqlMode-r_xp5vcq.js} +2 -2
  68. package/dist/assets/{handlebars-TT0L6RLX.js → handlebars-CmQCPbdG.js} +1 -1
  69. package/dist/assets/{html-lavZKcN0.js → html-DYkdCzxq.js} +1 -1
  70. package/dist/assets/{html-title-BPny9upB.js → html-title-x1db95S1.js} +1 -1
  71. package/dist/assets/{htmlMode-DMFwjMOD.js → htmlMode-B2_nCAdZ.js} +1 -1
  72. package/dist/assets/{iframe-1S7jkX6i.js → iframe-BBrwuPrb.js} +1 -1
  73. package/dist/assets/{index-CW1fjR9h.js → index-8dobedE4.js} +1 -1
  74. package/dist/assets/{index-ndtAmeV1.js → index-9oTGqHiK.js} +9 -9
  75. package/dist/assets/{index-DaZkwaiO.js → index-B1zRPZ23.js} +1 -1
  76. package/dist/assets/{index-DRoFAJB5.js → index-B3mxPYvg.js} +1 -1
  77. package/dist/assets/{index-tjFbkwkg.js → index-B6WuMj55.js} +1 -1
  78. package/dist/assets/{index-cO6bb6Pk.js → index-B7vOpBED.js} +9 -9
  79. package/dist/assets/index-B8pH5JDj.js +1 -0
  80. package/dist/assets/{index-COSOS45R.js → index-BD7DDM8N.js} +1 -1
  81. package/dist/assets/{index-Br_vN976.js → index-BDfVLYgm.js} +1 -1
  82. package/dist/assets/{index-Fv7F4t_Q.js → index-BGAQvWoz.js} +1 -1
  83. package/dist/assets/{index-BHJmOQ7h.js → index-BJY_2WX8.js} +1 -1
  84. package/dist/assets/{index-QV6ZlHUk.js → index-BKe-qavD.js} +1 -1
  85. package/dist/assets/{index-G3qQEhRl.js → index-BNYZMueI.js} +1 -1
  86. package/dist/assets/{index-DtM0eWbB.js → index-BX3e3-Yl.js} +1 -1
  87. package/dist/assets/{index-kPygeO6n.js → index-Bexo5RVe.js} +1 -1
  88. package/dist/assets/{index-Dahvz4_C.js → index-Bf9Tsnzp.js} +1 -1
  89. package/dist/assets/{index-CapJ9GZ2.js → index-Bge0nxkS.js} +1 -1
  90. package/dist/assets/{index-cfZQGoxy.js → index-Bsv4O26i.js} +3 -3
  91. package/dist/assets/{index-Dgm8R3_G.js → index-BvQcTKRh.js} +1 -1
  92. package/dist/assets/{index-CvjKujEe.js → index-BwyiJPiC.js} +1 -1
  93. package/dist/assets/{index-DBElf0v4.js → index-C6cKgXcg.js} +1 -1
  94. package/dist/assets/{index-B6RQPS53.js → index-C6nj_8zr.js} +1 -1
  95. package/dist/assets/{index-DymefoL_.js → index-CCR0588i.js} +1 -1
  96. package/dist/assets/{index-B5g8M7OB.js → index-CMGLmPFR.js} +2 -2
  97. package/dist/assets/{index-CZoo5V2P.js → index-CNWl5k-n.js} +28 -27
  98. package/dist/assets/{index-C4c7H09E.js → index-Ca1VB0fP.js} +1 -1
  99. package/dist/assets/{index-DMIRBD0M.js → index-Cs2sn0We.js} +2 -2
  100. package/dist/assets/{index-qaEYO3ku.js → index-CsRtSmIh.js} +1 -1
  101. package/dist/assets/{index-BMTfpek5.js → index-CvM9vyEK.js} +1 -1
  102. package/dist/assets/{index-H_wq9PgB.js → index-D0h_Lxum.js} +1 -1
  103. package/dist/assets/{index-aiNsIJH9.js → index-D1rJ129A.js} +1 -1
  104. package/dist/assets/{index-DEi5xwZC.js → index-DMGtaArc.js} +3 -3
  105. package/dist/assets/{index-GpQ_N20f.js → index-DSwwhtGQ.js} +1 -1
  106. package/dist/assets/{index-DV2yUsDM.js → index-DWhhB9Hi.js} +1 -1
  107. package/dist/assets/{index-CAy_ntFG.js → index-DYWrZZLV.js} +1 -1
  108. package/dist/assets/{index-ClxFOl_D.js → index-DlRSxwJY.js} +3 -3
  109. package/dist/assets/{index-Dc9GzuOJ.js → index-MQfB--7g.js} +1 -1
  110. package/dist/assets/{index-BAFeziwg.js → index-Q3-b6N6x.js} +1 -1
  111. package/dist/assets/{index-CAeA1Cvc.js → index-bHYz6L_6.js} +4 -4
  112. package/dist/assets/{index-Cel7tx4n.js → index-cW_e6AnH.js} +3 -3
  113. package/dist/assets/{index-D2OqQrAZ.js → index-ccBUb-g_.js} +1 -1
  114. package/dist/assets/{index-DTKSzDFU.js → index-eIb8MZiw.js} +1 -1
  115. package/dist/assets/{index-UKgFVupi.js → index-l0ejZk6e.js} +160 -157
  116. package/dist/assets/{index-CDH7LNvM.js → index-m0BJnU58.js} +1 -1
  117. package/dist/assets/{index-CxOhjmog.js → index-sHP8LVQG.js} +1 -1
  118. package/dist/assets/{index-0KDfyThN.js → index-tY4NTQdt.js} +1 -1
  119. package/dist/assets/{index.esm-C1D-vjtU.js → index.esm-CmfVZ8uo.js} +1 -1
  120. package/dist/assets/{install-from-url-DsCL99L1.js → install-from-url-DKaI4Rhw.js} +1 -1
  121. package/dist/assets/{invitation-tfEd0Lsr.js → invitation-BP2qXMkU.js} +1 -1
  122. package/dist/assets/{is-path-prefix-equal-Bvg8FYDR.js → is-path-prefix-equal-D367I16F.js} +1 -1
  123. package/dist/assets/{item-8U44hoCJ.js → item-C6-NqxXS.js} +9 -9
  124. package/dist/assets/{javascript-Be40gNv5.js → javascript-C8IdANXc.js} +1 -1
  125. package/dist/assets/{jsonMode-kLgPrjXr.js → jsonMode-7RTtLpT6.js} +1 -1
  126. package/dist/assets/{liquid-HxAxWFbN.js → liquid-CF0mRQ0b.js} +1 -1
  127. package/dist/assets/{list-header-CRu61Gzq.js → list-header-DnPG8RQK.js} +1 -1
  128. package/dist/assets/{lock.svg-B1POA68X.js → lock.svg-DIpUz3_T.js} +1 -1
  129. package/dist/assets/{log-C2U5MC50.js → log-CLLKDcVS.js} +1 -1
  130. package/dist/assets/{lottie-react.esm-C_wSYvC1.js → lottie-react.esm-BzADuacJ.js} +1 -1
  131. package/dist/assets/{mdx-BMPssTWP.js → mdx-393D49gD.js} +1 -1
  132. package/dist/assets/{memory-CucrqTb6.js → memory-BiZfGzaA.js} +1 -1
  133. package/dist/assets/{metric-CB5i39mr.js → metric-DQF3F8Ee.js} +1 -1
  134. package/dist/assets/omit-B8z6Iws2.js +1 -0
  135. package/dist/assets/{overview-BXVI29QP.js → overview-CCLYGiqE.js} +1 -1
  136. package/dist/assets/{permission-rweAJL4g.js → permission-CB_zs2G4.js} +1 -1
  137. package/dist/assets/{preference-gJ6ZF2Q4.js → preference-2qHeMKaE.js} +3 -3
  138. package/dist/assets/{python-BkToxfo1.js → python-DeXJ9-sq.js} +1 -1
  139. package/dist/assets/{raf-schd.esm-B9wpp0Qh.js → raf-schd.esm-gP-_XKJP.js} +1 -1
  140. package/dist/assets/{razor-wuUYkLrt.js → razor-D15rTZli.js} +1 -1
  141. package/dist/assets/{rotate-session-key-C8ucpOl_.js → rotate-session-key-BqAzAxv_.js} +1 -1
  142. package/dist/assets/{runtime-i_b0U5XU.js → runtime-Cf5aBcfV.js} +1 -1
  143. package/dist/assets/schema-DVKja_3K.js +1 -0
  144. package/dist/assets/sdk-D_BY3a8P.js +1 -0
  145. package/dist/assets/{service-CUx_uRl4.js → service-pECpZ6Fv.js} +1 -1
  146. package/dist/assets/{shorten-label-jgxOPsCZ.js → shorten-label-5tBjSQXq.js} +1 -1
  147. package/dist/assets/{simple-select-UnH3V90L.js → simple-select-DCNot1u5.js} +1 -1
  148. package/dist/assets/{spaces-C6mZH1kT.js → spaces-1p_UMor_.js} +1 -1
  149. package/dist/assets/{status-DL1Ex6i2.js → status-DyTELFmb.js} +1 -1
  150. package/dist/assets/{status-DDW9dFZ_.js → status-Xk2ZLYz1.js} +1 -1
  151. package/dist/assets/{switch-control-BIC-Nwu_.js → switch-control-DBKg8KSu.js} +1 -1
  152. package/dist/assets/{table-icons-B9tXAbnj.js → table-icons-DfjWu9CY.js} +1 -1
  153. package/dist/assets/{team-BpXTeXX3.js → team-DHZ07Mee.js} +1 -1
  154. package/dist/assets/{toLower-C-8MuvP9.js → toLower-ylIkvfVr.js} +1 -1
  155. package/dist/assets/toUpper-D9lAXG2I.js +1 -0
  156. package/dist/assets/{traffic-BEQzO7xQ.js → traffic-BlWSHfOP.js} +1 -1
  157. package/dist/assets/{tsMode-Dzl7y3L0.js → tsMode-BbObiMoD.js} +1 -1
  158. package/dist/assets/{typescript-B_dz3gG0.js → typescript-Cuj7nGhN.js} +1 -1
  159. package/dist/assets/{url-evaluation-DuQYeVhL.js → url-evaluation-DAoEPnuZ.js} +1 -1
  160. package/dist/assets/{url-join-cDXJRDHX.js → url-join-CNIVoOP5.js} +1 -1
  161. package/dist/assets/{use-mobile-CMTzn3M3.js → use-mobile-B06ZsBLv.js} +1 -1
  162. package/dist/assets/{use-mobile-HM6iZFZe.js → use-mobile-DRLSkCfk.js} +1 -1
  163. package/dist/assets/{useAsync-C6Eg4w89.js → useAsync-C_IdsZLT.js} +1 -1
  164. package/dist/assets/{useAsyncRetry-DAHR7IMw.js → useAsyncRetry-AD_J4c2Y.js} +1 -1
  165. package/dist/assets/{useLocalStorage-1RvhLwwW.js → useLocalStorage-CaDSR1Wc.js} +1 -1
  166. package/dist/assets/{useThemeProps-SIspLYj0.js → useThemeProps-DAtqRnvX.js} +1 -1
  167. package/dist/assets/{util-CQwua2ce.js → util-B5JRPt0_.js} +1 -1
  168. package/dist/assets/{wait-container-DH8upE6T.js → wait-container-D08poArP.js} +1 -1
  169. package/dist/assets/{without-wallet-BW1Rplxh.js → without-wallet-Cq0jHe0-.js} +1 -1
  170. package/dist/assets/wrap-locale-fe2iWyZX.js +1 -0
  171. package/dist/assets/{xml-Bw3uqPST.js → xml-yaEsWuy9.js} +1 -1
  172. package/dist/assets/{yaml-Bs3RMjTY.js → yaml-B2xGL9-8.js} +1 -1
  173. package/dist/index.html +1 -1
  174. package/dist/service-worker.js +1 -1
  175. package/package.json +1 -1
  176. package/dist/assets/ArrowDropDown-DFxrtTfG.js +0 -1
  177. package/dist/assets/api-q4yep6BX.js +0 -1
  178. package/dist/assets/chain-Cq8v0ndB.js +0 -6
  179. package/dist/assets/cloneDeep-B_sIbdyU.js +0 -1
  180. package/dist/assets/connect-to-CyrO6atx.js +0 -29
  181. package/dist/assets/emotion-cache.browser.esm-F-H2n_Vz.js +0 -1
  182. package/dist/assets/engine-DeV5utCO.js +0 -1
  183. package/dist/assets/getValidReactChildren-BMWRE_Nn.js +0 -1
  184. package/dist/assets/index-CnRp8oF4.js +0 -1
  185. package/dist/assets/omit-Dmt7cKLM.js +0 -1
  186. package/dist/assets/schema-C8k5AIF2.js +0 -1
  187. package/dist/assets/sdk-CXtYA3ry.js +0 -1
  188. package/dist/assets/toUpper-DqUeOG5c.js +0 -1
  189. package/dist/assets/wrap-locale-BOO0hut3.js +0 -1
@@ -1,4 +1,4 @@
1
- import{aF as Ge,j as e,bn as gt,r as g,bC as Q,bf as H,H as q,aH as D,g as xt,o as d,h as ee,at as bt,ay as jt,K as C,T as U,V as X,eO as Fe,O as Pe,ik as Ye,bj as Te,aU as Ie,R as Ee,dI as Ne,b3 as qe,b1 as Ae,C as Qe,f as Xe,f0 as Je,aP as De,W as yt,as as Ze,il as et,v as Oe,f2 as tt,bq as je,fI as st,dC as St,s as ie,af as pe,G as Ue,au as vt,im as Ct,io as Nt,$ as nt,ip as wt,iq as Rt,ir as Tt,is as It,N as Et,bx as it,E as At,J as Dt,P as Ot,S as Lt,Q as $e,it as kt,a3 as Ft}from"./index-UKgFVupi.js";import{d as Pt,H as at,g as _t}from"./index-QV6ZlHUk.js";import{R as _e,S as Bt}from"./actions-B8C-PCI5.js";import{B as zt}from"./index-CDH7LNvM.js";import{S as me}from"./shorten-label-jgxOPsCZ.js";import{v as ot}from"./index-BMTfpek5.js";import{T as Wt}from"./html-title-BPny9upB.js";import{R as Mt}from"./Refresh-DwCMTrBg.js";import{D as Kt,g as Ht}from"./traffic-BEQzO7xQ.js";import{u as qt}from"./use-mobile-CMTzn3M3.js";import"./FilterList-BVOOp-qX.js";import"./CSSTransition-CUGJUBZa.js";import"./emotion-cache.browser.esm-F-H2n_Vz.js";import"./index-CvjKujEe.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-DnLesJI5.js";import"./index-DaZkwaiO.js";import"./TableSearch-Dw0n59eL.js";import"./Search-DV0DmDJh.js";import"./Clear-TsHHhjv8.js";import"./MoreVert-LlVBp8Yl.js";import"./useLocalStorage-1RvhLwwW.js";import"./url-evaluation-DuQYeVhL.js";import"./get-safe-url-BdtvVcQw.js";import"./ButtonGroup-CvkZLM_A.js";import"./getValidReactChildren-BMWRE_Nn.js";import"./permission-rweAJL4g.js";import"./index.esm-C1D-vjtU.js";import"./collapse-CXW4uktq.js";import"./blocklet-B_gm4lmi.js";import"./Switch-BV_bJmtO.js";import"./iframe-1S7jkX6i.js";import"./ChevronLeft-iV8RZK9l.js";import"./ChevronRight-rhEdYh7r.js";import"./index-DBii9-f-.js";import"./base-chart-B0G5PbEt.js";import"./index-CAy_ntFG.js";import"./AdapterDayjs-GSjt4DIz.js";import"./useThemeProps-SIspLYj0.js";import"./visuallyHidden-Dan1xhjv.js";const Ut=Ge(e.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"})),$t=Ge(e.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"})),rt=g.createContext({}),{Provider:Vt,Consumer:on}=rt;function Gt({children:t,blocklet:s=""}){const{api:n,inService:r,ws:{useSubscription:o}}=gt(),[l,x]=g.useState([]),[f,y]=g.useState({total:0,pageSize:20,pageCount:0,page:1}),h=Q(()=>s.meta?.did,[s]),[b,S]=g.useState([]),[B,_]=g.useState({}),R=Q(()=>l.length?new Set(l.map(m=>m.id)):new Set,[l]),$=async({page:m=1,pageSize:N=20,...O}={})=>{if(!h)return[];try{const A={paging:{page:m,pageSize:N},...O,teamDid:h,dateRange:O.dateRange?[H(O.dateRange[0]).toISOString(),H(O.dateRange[1]).toISOString()]:void 0},{dids:w,...L}=A;let P="";w&&w.includes("system")&&(P="system");const ae=w?w.filter(oe=>oe!=="system"):[],se={...L,source:P,componentDids:ae},Z=await n.getNotificationSendLog({input:se});return _(se),x(Z.list),y(Z.paging),Z.list}catch(A){return q.error(A.message),[]}},M=async()=>{const m=await n.getNotificationComponents({input:{teamDid:h}});S(m.componentDids)},k=g.useCallback(m=>{const N=s.children.find(O=>O.meta?.did===m);if(N)return N.ancestors=[s],N},[s]),F=async({notificationId:m,receivers:N,channels:O,...A})=>{await n.resendNotification({input:{teamDid:h,notificationId:m,receivers:N,channels:O.map(w=>w==="wallet"?D.NOTIFICATION_SEND_CHANNEL.WALLET:w==="pushKit"?D.NOTIFICATION_SEND_CHANNEL.PUSH:w),...A}})},V=g.useCallback(async m=>(await n.getUser({input:{teamDid:h,user:{did:m},options:{enableConnectedAccount:!0}}})).user,[n,h]),G=g.useCallback(async({page:m=1,pageSize:N=20,...O}={})=>{try{const A={paging:{page:m,pageSize:N},...O,userName:O.searchText||"",teamDid:h,dateRange:O.dateRange?[H(O.dateRange[0]).toISOString(),H(O.dateRange[1]).toISOString()]:void 0};return await n.getReceivers({input:A})}catch(A){throw q.error(A.message),A}},[n,h]);g.useEffect(()=>{h&&M()},[h]),o(D.EVENTS.NOTIFICATION_BLOCKLET_UPDATE,m=>{R.has(m.notificationId)&&$(B)},[R,B]),o(D.EVENTS.NOTIFICATION_BLOCKLET_CREATE,m=>{R.has(m.id)||$(B)},[R,B]);const J={fetch:$,data:l,paging:f,blocklet:s,getComponent:k,resendNotification:F,getUser:V,componentDids:b,getReceivers:G,inService:r,teamDid:h};return e.jsx(Vt,{value:{notificationRecords:J},children:t})}function Be(){const{notificationRecords:t}=g.useContext(rt);return t}he.propTypes={severity:d.oneOf(Object.values(["info","success","error","warning"])).isRequired};const Yt={info:"primary",success:"success",error:"error",warning:"warning"};function he({severity:t="info"}){return e.jsx(xt,{type:Yt[t],children:t})}const Qt=(t,s,n="")=>{if(!n||!s)return"";switch(n){case D.NOTIFICATION_SEND_FAILED_REASON.USER_DISABLED:return t("notification.sendStatus.reason.disabled",{channel:s});case D.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_UNAVAILABLE:return t("notification.sendStatus.reason.unavailable",{channel:s});case D.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_DISABLED:return t("notification.sendStatus.reason.notSent",{channel:s});case D.NOTIFICATION_SEND_FAILED_REASON.NOT_ONLINE:return t("notification.sendStatus.reason.offline");default:return n}};function lt(t,s,n={}){const{status:r,updatedAt:o,reason:l="",channel:x="wallet"}=n,f=o?t("notification.sendStatus.sentTime",{date:bt(o,s)}):"",y=Qt(t,x,l);return r===D.NOTIFICATION_SEND_STATUS.FAILED?{status:"failed",title:t("notification.sendStatus.failed"),sentTime:f,reason:y}:r===D.NOTIFICATION_SEND_STATUS.SENT?{status:"success",title:t("notification.sendStatus.success"),sentTime:f}:{status:"pending",title:t("notification.sendStatus.pending"),reason:y,sentTime:f}}const Le={pending:"#aaaaaa",success:"#34BE74",failed:"#D0021B"},ke=["wallet","pushKit","email"],Ve=["info","success","error","warning"],ct=t=>{const{settings:s}=t;return s?.notification?.email?.enabled},dt=t=>{const{settings:s}=t;return s?.notification?.pushKit?.enabled},Xt=(t,s)=>{const n=ee(s,"extra.notifications.email",!0);return{available:ct(t),enabled:n}},Jt=(t,s)=>{const n=ee(s,"extra.notifications.push",!0);return{available:dt(t),enabled:n}},Zt=t=>({enabled:ee(t,"extra.notifications.wallet",!0)}),es=t=>({enabled:ee(t,"extra.webhooks",[]).length>0}),xe=(t=3)=>new Promise(s=>{setTimeout(()=>{s()},t*1e3)}),ts=(t,s)=>s==="wallet"||s==="webhook"?[{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:s==="pushKit"||s==="email"?[{channel:s,type:"available",pass:t("notification.sendStatus.reason.available",{channel:s}),fail:t("notification.sendStatus.reason.unavailable",{channel:s})},{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:[],be=(t=[])=>{const s=H().startOf("day");return t.filter(n=>H(n.sendAt).isSame(s,"day")).length},ss=(t,s="")=>{if(s&&ke.includes(s)){const l=`${s}SendRecord`,x=ee(t,l,[]);return be(x)}const n=ee(t,"webhook",{}),r=Object.keys(n??{})??[];if(s&&r.includes(s)){const l=n[s]??[];return be(l)}const o={};return ke.forEach(l=>{const x=`${l}SendRecord`,f=ee(t,x,[]),y=be(f);o[l]=y}),r.length>0&&r.forEach(l=>{const x=n[l]??[],f=be(x);o[l]=f}),o},ye=(t,s,n)=>{if(!Array.isArray(t))throw new Error("Invalid filterList or index");return t[n].splice(s,1),t},Se=(t,s)=>{if(!Array.isArray(s))throw new Error("filters must be an array");return s.length?!s.includes(t):!1},ns=t=>{switch(t){case D.NOTIFICATION_SEND_CHANNEL.WALLET:return"Wallet";case D.NOTIFICATION_SEND_CHANNEL.PUSH:return"Push Kit";case D.NOTIFICATION_SEND_CHANNEL.EMAIL:return"Email";case D.NOTIFICATION_SEND_CHANNEL.WEBHOOK:return"Webhook";default:return""}},ut=()=>({components:{MUIDataTableFilter:{styleOverrides:{header:{marginBottom:0,p:{margin:0}},root:{"& .MuiGrid-container":{marginTop:0,"& .MuiGrid-item":{paddingTop:0}}}}},MuiPopover:{styleOverrides:{root:{"&.MuiPopover-root":{"& .MuiPaper-root:has(.filter-container)":{width:"420px"}}}}}}});function te({config:t,enableTooltip:s=!0,showTitle:n=!1,children:r=null}){const{status:o,title:l="",sentTime:x="",reason:f=""}=t,y=[l,f].filter(Boolean).join(", ");return e.jsx(jt,{title:s?e.jsxs(e.Fragment,{children:[e.jsx(U,{color:"inherit",sx:{fontSize:12},children:y}),e.jsx("span",{children:x})]}):null,arrow:!0,placement:"top",children:e.jsxs(C,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsxs(C,{sx:{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center"},children:[e.jsx(C,{style:{opacity:.15},sx:{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:Le[o]}}),e.jsx(C,{sx:{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:Le[o]}})]}),e.jsx(U,{color:"inherit",sx:{fontSize:12},children:n?l:r})]})})}te.propTypes={config:d.object.isRequired,enableTooltip:d.bool,showTitle:d.bool,children:d.node};ve.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};function ve({list:t,label:s,onDelete:n=()=>{}}){const{t:r,locale:o}=X();return e.jsxs(C,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsxs(U,{children:[s,": "]}),t.map(l=>{const x=lt(r,o,{status:l});return e.jsx(Fe,{size:"small",label:e.jsx(C,{sx:{display:"flex",alignItems:"center",gap:"4px"},children:e.jsx(te,{config:x,enableTooltip:!1,children:x.title})}),onDelete:f=>n(f,l)},l)})]})}ze.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 ze({filterList:t,onChange:s,index:n,column:r,filterValues:o,label:l,renderLabel:x}){return e.jsxs(Pe,{className:"filter-container",children:[e.jsx(Ye,{component:"legend",children:l}),e.jsx(Te,{row:!0,children:o.map(f=>e.jsx(Ie,{control:e.jsx(Ee,{checked:t[n].indexOf(f.value??f)>-1,onChange:y=>{const h=[...t];y.target.checked?h[n]=[...h[n],f.value??f]:h[n]=h[n].filter(b=>b!==(f.value??f)),s(h[n],n,r)},name:f.value??f}),label:e.jsx("span",{style:{display:"flex",alignItems:"center"},children:x(f)})},f.value??f))})]})}function Re(t){return e.jsx(ze,{...t,renderLabel:s=>e.jsx(te,{enableTooltip:!1,config:{status:s.status},children:s.label})})}ce.propTypes={status:d.number.isRequired,updatedAt:d.string.isRequired,reason:d.string,channel:d.string,onResend:d.func};function ce({status:t,updatedAt:s,reason:n="",channel:r="wallet",onResend:o}){const{t:l,locale:x}=X(),f=lt(l,x,{status:t,updatedAt:s,reason:n,channel:r});return e.jsxs(C,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(te,{config:f,showTitle:!0}),f.status!=="success"&&e.jsx(Ne,{className:"resend-btn",size:"small",startIcon:e.jsx(_e,{}),sx:{fontSize:12,color:"rgba(0, 0, 0, 0.87)",fontWeight:400,".MuiButton-startIcon":{mr:"2px"}},onClick:o,children:l("notification.resend")})]})}We.propTypes={value:d.array.isRequired,onChange:d.func};function We({value:t,onChange:s}){const{locale:n}=X(),r=H().toDate(),[o,l]=g.useState(null),x=g.useCallback(h=>{l(o?null:h.currentTarget)},[o]),f=!!o,y=g.useCallback(h=>{if(!h.startDate||!h.endDate){q.error("Please select a date range");return}if(H(h.startDate).isAfter(h.endDate)||!H(h.startDate).isValid()||!H(h.endDate).isValid()){q.error("Invalid date range");return}s([h.startDate,h.endDate]),l(null)},[s]);return e.jsxs("div",{children:[e.jsx(U,{component:"div",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},sx:{mb:0},children:e.jsxs(Ne,{onClick:x,variant:"outlined",size:"small",color:"inherit",children:[qe(t[0],n)," - ",qe(t[1],n)]})}),e.jsx(Ae,{open:f,anchorEl:o,onClose:()=>{l(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:e.jsx(Kt,{open:!0,maxDate:r,initialDateRange:{startDate:t[0],endDate:t[1]},toggle:x,definedRanges:Ht(r),onChange:y})})]})}Me.propTypes={itemComponent:d.elementType.isRequired};function Me({itemComponent:t,...s}){const{t:n}=X();return!s?.filterList?.filter(o=>o.length).length?null:e.jsxs(C,{sx:{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(Pt.TableFilterList,{...s,ItemComponent:t})})]})}function Ke({label:t,onDelete:s,canDelete:n=()=>!0,...r}){const o=s&&typeof s=="function"?s:void 0;let l=!0;return n&&typeof n=="function"&&(l=n({label:t,...r})),e.jsx(Fe,{label:t,variant:"outlined",...o&&l?{onDelete:o}:{}})}Ke.propTypes={label:d.string.isRequired,onDelete:d.func,canDelete:d.func};const is=[{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}];pt.propTypes={loading:d.bool,onCancel:d.func,onConfirm:d.func};function pt({loading:t=!1,onCancel:s=()=>{},onConfirm:n=()=>{}}){const{t:r}=X(),[o,l]=g.useState(is),[x,f]=g.useState(!0),y=(b,S)=>{S.checked=b.target.checked;const B=o.map(_=>({..._,checked:_.value===S.value?S.checked:_.checked}));l(B)},h=b=>{b.stopPropagation(),n({channels:o.filter(S=>S.checked).map(S=>S.value),isResendFailedOnly:x})};return e.jsxs(C,{className:"resend-config",sx:{padding:"16px 24px"},children:[e.jsx(U,{variant:"body1",component:"div",className:"check-title",sx:{fontWeight:700,mb:1},children:r("notification.config")}),e.jsx(C,{className:"choose-channel",children:e.jsxs(Pe,{component:"fieldset",variant:"standard",children:[e.jsx(Ye,{component:"legend",children:r("notification.selectChannels")}),e.jsx(Te,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:1},children:o.map(b=>e.jsx(Ie,{control:e.jsx(Ee,{checked:b.checked,onChange:S=>y(S,b),name:b.value}),label:b.label},b.value))})]})}),e.jsx(C,{className:"resend-config-footer",children:e.jsx(Te,{children:e.jsx(Ie,{control:e.jsx(Ee,{checked:x,onChange:b=>f(b.target.checked)}),label:r("notification.resendFailedOnly")})})}),e.jsxs(C,{className:"resend-config-footer-tip",sx:{display:"flex",justifyContent:"flex-end",gap:1},children:[e.jsx(Ne,{onClick:b=>{b.stopPropagation(),s()},color:"inherit",children:r("common.cancel")}),e.jsxs(Ne,{onClick:h,color:"primary",disabled:t,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[t&&e.jsx(Qe,{size:16}),r("common.confirm")]})]})]})}ft.propTypes={notificationId:d.string.isRequired,handleResend:d.func,resending:d.bool};function ft({notificationId:t,handleResend:s,resending:n=!1}){const{t:r,locale:o}=X(),l=Xe(),x=g.useMemo(()=>Je(l,ut()),[l]),{getReceivers:f,inService:y,teamDid:h,getUser:b,blocklet:S}=Be(),[B,_]=g.useState(!1),[R,$]=g.useState([]),M=De({anchorEl:null,position:null}),k=De({anchorEl:null,position:null}),[F,V]=g.useState(null),[G,J]=g.useState({total:0,pageSize:10,pageCount:0,page:1}),[m,N]=g.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[H().subtract(1,"month").startOf("day").toDate(),H().endOf("day").toDate()]}),[O,A]=g.useState([]),w=[{label:r("notification.sendStatus.pending"),value:0,status:"pending"},{label:r("notification.sendStatus.success"),value:1,status:"success"},{label:r("notification.sendStatus.failed"),value:2,status:"failed"}],L=async()=>{if(!B&&t)try{_(!0);const i=await f({notificationId:t,...m}),a=i.list.map(c=>({...c,receiverUser:{...c.receiverUser,avatar:st(c.receiverUser.avatar,h,y)}}));$(a),J(i.paging),_(!1)}catch(i){q.error(i.message),_(!1)}};g.useEffect(()=>{L()},[m]);const P=i=>{i.stopPropagation();const a=i.currentTarget;k.anchorEl=a;const c=a.getBoundingClientRect();k.position={top:c.top+window.scrollY,left:c.left+window.scrollX}},ae=i=>i.data.length?e.jsx("div",{style:{display:"flex",alignItems:"center",padding:"10px"},children:e.jsx(Oe,{className:"resend-btn",size:"small",color:"primary",variant:"contained",startIcon:e.jsx(_e,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:P,children:r("notification.resend")})}):null,se={sort:!1,download:!1,print:!1,selectableRows:"multiple",searchPlaceholder:r("common.search"),searchAlwaysOpen:!1,filterType:"checkbox",searchDebounceTime:300,page:G.page-1,rowsPerPage:G.pageSize,count:G.total,searchText:m.searchText,tableBodyMaxHeight:"calc(80vh - 260px)",rowsSelected:O,onRowSelectionChange:(i,a)=>{A(a.map(c=>c.dataIndex))},customToolbarSelect:ae},Z=({page:i,rowsPerPage:a,searchText:c,filterList:v})=>{const[,z=[],Y=[],K=[]]=v;m.pageSize!==a?N(W=>({...W,pageSize:a,page:1})):m.page!==i+1?N(W=>({...W,page:i+1})):m.searchText!==c?N(W=>({...W,searchText:c,page:1})):pe(z,m.walletSendStatus)?pe(Y,m.pushKitSendStatus)?pe(K,m.emailSendStatus)||N(W=>({...W,emailSendStatus:K,page:1})):N(W=>({...W,pushKitSendStatus:Y,page:1})):N(W=>({...W,walletSendStatus:z,page:1}))},oe=g.useCallback(async(i,a)=>{if(!a)return!1;const c=await b(a);return c?i==="wallet"?Zt(c):i==="email"?Xt(S,c):i==="pushKit"?Jt(S,c):i==="webhook"?es(c):!0:!1},[b,S]),we=g.useCallback(i=>ts(r,i),[r]),ne=()=>{M.anchorEl=null,M.position=null,V(null)},re=()=>{k.anchorEl=null,k.position=null},ge=async(i,a,c=!0,v="")=>{if(!(!a.length||!i.length))try{s(i,a,c,v),k.anchorEl||(await xe(.5),ne())}catch(z){console.error("handleResend error",{error:z})}},p=async({channels:i,isResendFailedOnly:a})=>{const c=O.map(v=>R[v].receiver);await ge(i,c,a),await xe(.5),re(),A([])},u=async(i,a=[],c=!0)=>{try{await ge(["webhook"],[i.receiver],c,a)}catch(v){q.error(v.response?v.response.statusText:v.message)}},j=async(i,a,c,v=[],z=!0)=>{if(i.stopPropagation(),ss(a,c)>=4){q.warning(r("notification.resendLimit"));return}if(!ke.includes(c)){await u(a,v,z);return}if(i){const K=i.currentTarget,W=K.getBoundingClientRect();M.anchorEl=K,M.position={top:W.top+window.scrollY,left:W.left+window.scrollX}}V({channel:c});try{const K=await oe(c,a.receiver);await xe(1),V({channel:c,result:K}),(typeof K=="boolean"&&K||St(K)&&Object.values(K).every(W=>!!W))&&(await s([c],[a.receiver],z),k.anchorEl||(await xe(.5),ne()))}catch(K){q.error(K.message)}},I=i=>{N(a=>({...a,dateRange:i,page:1}))},E=(i,a,c,v)=>{i.stopPropagation();const z=c.filter(Y=>Y!==a);N(Y=>({...Y,[v]:z,page:1}))},T=Q(()=>[{label:r("notification.receiver"),name:"receiver",width:200,options:{filter:!1,customBodyRenderLite:i=>{const{receiverUser:a,receiver:c}=R[i];return a?e.jsxs(C,{"data-cy":`member-name-${a.fullName}`,sx:{display:"flex",alignItems:"center",gap:1,justifyContent:"flex-start"},children:[e.jsx(Ze,{src:`${a.avatar}?imageFilter=resize&w=48&h=48`,size:32,did:c,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),e.jsx(me,{children:a.fullName})]},c):e.jsx(yt,{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:m.walletSendStatus??[],customFilterListOptions:{render:i=>e.jsx(ve,{list:i,label:"Wallet",onDelete:(a,c)=>{a.stopPropagation(),E(a,c,T[1].options.filterList,"walletSendStatus")}}),update:ye},filterOptions:{names:w,fullWidth:!0,logic:Se,display:(i,a,c,v)=>e.jsx(Re,{label:"Wallet",filterList:i,onChange:a,index:c,column:v,filterValues:w})},customBodyRenderLite:i=>{const{walletSendStatus:a,walletSendAt:c,walletSendFailedReason:v}=R[i];return e.jsx(ce,{status:a,updatedAt:c,reason:v,channel:"wallet",onResend:z=>j(z,R[i],"wallet",[],!1)})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{pushKitSendStatus:a,pushKitSendAt:c,pushKitSendFailedReason:v}=R[i];return e.jsx(ce,{status:a,updatedAt:c,reason:v,channel:"pushkit",onResend:z=>j(z,R[i],"pushKit",[],!1)})},filter:!0,filterType:"custom",filterList:m.pushKitSendStatus??[],customFilterListOptions:{render:i=>e.jsx(ve,{list:i,label:"Push Kit",onDelete:(a,c)=>{a.stopPropagation(),E(a,c,T[2].options.filterList,"pushKitSendStatus")}}),update:ye},filterOptions:{names:w,fullWidth:!0,logic:Se,display:(i,a,c,v)=>e.jsx(Re,{label:"Push Kit",filterList:i,onChange:a,index:c,column:v,filterValues:w})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{emailSendStatus:a,emailSendAt:c,emailSendFailedReason:v}=R[i];return e.jsx(ce,{status:a,updatedAt:c,reason:v,channel:"email",onResend:z=>j(z,R[i],"email",[],!1)})},filter:!0,filterType:"custom",filterList:m.emailSendStatus??[],customFilterListOptions:{render:i=>e.jsx(ve,{list:i,label:"Email",onDelete:(a,c)=>{a.stopPropagation(),E(a,c,T[3].options.filterList,"emailSendStatus")}}),update:ye},filterOptions:{names:w,fullWidth:!0,logic:Se,display:(i,a,c,v)=>e.jsx(Re,{label:"Email",filterList:i,onChange:a,index:c,column:v,filterValues:w})}}},{label:"Webhook",name:"webhook",width:200,options:{filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{webhook:a}=R[i];if(!a)return null;const c=Object.entries(a)[0];if(!c)return null;const[v,z]=c,Y=z[0];return e.jsx(C,{sx:{display:"flex",flexDirection:"column",gap:1},children:e.jsxs(C,{className:"webhook-item",sx:{fontSize:12},children:[e.jsx(me,{maxLength:30,children:v},v),e.jsx(ce,{status:Y.status,updatedAt:Y.sendAt,reason:Y.failedReason,channel:"webhook",onResend:K=>j(K,R[i],"webhook",[v],!1)})]},v)})}}},{label:r("common.createdAt"),name:"createdAt",width:100,options:{filter:!1,customBodyRenderLite:i=>{const{createdAt:a}=R[i];return e.jsx(et,{value:a,locale:o,shouldUpdate:!0})}}}],[R,o,m,r]),le=[e.jsx(We,{value:m.dateRange,onChange:I},"date-picker"),e.jsx(Oe,{variant:"contained",size:"small",color:"primary",loading:B,startIcon:e.jsx(Mt,{}),onClick:()=>L(),sx:{".MuiButton-startIcon":{mr:"2px"}},style:{marginLeft:8},children:r("common.refresh")},"refresh")];return e.jsx(C,{sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:e.jsx(os,{children:e.jsxs(tt,{theme:x,children:[e.jsx(at,{className:"receivers-table",locale:o,loading:B,columns:T,data:R,onChange:Z,options:se,customButtons:le,components:{TableFilterList:i=>e.jsx(Me,{...i,itemComponent:a=>e.jsx(Ke,{...a,canDelete:()=>!1})})}}),M.anchorEl&&e.jsx(Ae,{open:!!M.anchorEl,anchorReference:"anchorPosition",anchorPosition:M.position,onClose:ne,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs(rs,{children:[e.jsxs(U,{variant:"body1",component:"div",className:"check-title",children:[F?.channel," Checking"]}),e.jsx(C,{sx:{display:"flex",flexDirection:"column",gap:"4px"},children:we(F?.channel).map(i=>{const{type:a,pass:c,fail:v}=i;return!F?.result||F?.result?.[a]?e.jsxs(U,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:F?.result?.[a]?je.success.main:"inherit"},children:[F?.result?e.jsx($t,{}):e.jsx(Qe,{size:12,sx:{color:je.primary.main}}),e.jsx("span",{children:c})]},a):e.jsxs(U,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:je.error.main},children:[e.jsx(Ut,{}),e.jsx("span",{children:v})]},a)})})]})}),k.anchorEl&&e.jsx(Ae,{open:!!k.anchorEl,anchorReference:"anchorPosition",anchorPosition:k.position,onClose:re,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsx(pt,{loading:n,onCancel:re,onConfirm:p})})]})})})}const as=g.memo(ft),os=ie.div`
1
+ import{aF as Ge,j as e,bn as gt,r as g,bC as J,bf as H,H as q,aH as D,g as xt,o as d,h as ee,at as bt,ay as jt,K as C,T as U,V as Q,eO as Fe,O as Pe,io as Ye,bj as Te,aU as Ie,R as Ee,dI as Ne,b3 as qe,b1 as Ae,C as Je,f as Qe,f0 as Xe,aP as De,W as yt,as as Ze,ip as et,v as Oe,f2 as tt,bq as je,fJ as st,dC as St,s as ie,af as pe,G as Ue,au as vt,iq as Ct,ir as Nt,$ as nt,is as wt,it as Rt,iu as Tt,iv as It,N as Et,bx as it,E as At,J as Dt,P as Ot,S as Lt,Q as $e,iw as kt,a3 as Ft}from"./index-l0ejZk6e.js";import{d as Pt,H as at,g as _t}from"./index-BKe-qavD.js";import{R as _e,S as Bt}from"./actions-DOkacRyd.js";import{B as zt}from"./index-m0BJnU58.js";import{S as me}from"./shorten-label-5tBjSQXq.js";import{v as ot}from"./index-CvM9vyEK.js";import{T as Wt}from"./html-title-x1db95S1.js";import{R as Mt}from"./Refresh-BClPDZOR.js";import{D as Kt,g as Ht}from"./traffic-BlWSHfOP.js";import{u as qt}from"./use-mobile-B06ZsBLv.js";import"./FilterList-tXxMVwM9.js";import"./CSSTransition-Cyc7snYy.js";import"./emotion-cache.browser.esm-CKIgFJwY.js";import"./index-BwyiJPiC.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-CI7FeWZW.js";import"./index-B1zRPZ23.js";import"./TableSearch-BkWoZDH8.js";import"./Search-BrXfrk6s.js";import"./Clear-BoRiznJI.js";import"./MoreVert-CykMlsrj.js";import"./useLocalStorage-CaDSR1Wc.js";import"./url-evaluation-DAoEPnuZ.js";import"./get-safe-url-mJazyUZj.js";import"./ButtonGroup-BlhSVfK3.js";import"./getValidReactChildren-C2GpPG5h.js";import"./permission-CB_zs2G4.js";import"./index.esm-CmfVZ8uo.js";import"./collapse-CmeTRdrT.js";import"./blocklet-DooKd_sI.js";import"./Switch-btQlV2VF.js";import"./iframe-BBrwuPrb.js";import"./ChevronLeft-B42HGuyE.js";import"./ChevronRight-BLRImDEd.js";import"./index-DBii9-f-.js";import"./base-chart-CzLW1tBo.js";import"./index-DYWrZZLV.js";import"./AdapterDayjs-BjSFvDvr.js";import"./useThemeProps-DAtqRnvX.js";import"./visuallyHidden-Dan1xhjv.js";const Ut=Ge(e.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"})),$t=Ge(e.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"})),rt=g.createContext({}),{Provider:Vt,Consumer:on}=rt;function Gt({children:t,blocklet:s=""}){const{api:n,inService:r,ws:{useSubscription:o}}=gt(),[l,x]=g.useState([]),[f,y]=g.useState({total:0,pageSize:20,pageCount:0,page:1}),h=J(()=>s.meta?.did,[s]),[b,S]=g.useState([]),[B,_]=g.useState({}),R=J(()=>l.length?new Set(l.map(m=>m.id)):new Set,[l]),$=async({page:m=1,pageSize:N=20,...O}={})=>{if(!h)return[];try{const A={paging:{page:m,pageSize:N},...O,teamDid:h,dateRange:O.dateRange?[H(O.dateRange[0]).toISOString(),H(O.dateRange[1]).toISOString()]:void 0},{dids:w,...L}=A;let P="";w&&w.includes("system")&&(P="system");const ae=w?w.filter(oe=>oe!=="system"):[],se={...L,source:P,componentDids:ae},Z=await n.getNotificationSendLog({input:se});return _(se),x(Z.list),y(Z.paging),Z.list}catch(A){return q.error(A.message),[]}},M=async()=>{const m=await n.getNotificationComponents({input:{teamDid:h}});S(m.componentDids)},k=g.useCallback(m=>{const N=s.children.find(O=>O.meta?.did===m);if(N)return N.ancestors=[s],N},[s]),F=async({notificationId:m,receivers:N,channels:O,...A})=>{await n.resendNotification({input:{teamDid:h,notificationId:m,receivers:N,channels:O.map(w=>w==="wallet"?D.NOTIFICATION_SEND_CHANNEL.WALLET:w==="pushKit"?D.NOTIFICATION_SEND_CHANNEL.PUSH:w),...A}})},V=g.useCallback(async m=>(await n.getUser({input:{teamDid:h,user:{did:m},options:{enableConnectedAccount:!0}}})).user,[n,h]),G=g.useCallback(async({page:m=1,pageSize:N=20,...O}={})=>{try{const A={paging:{page:m,pageSize:N},...O,userName:O.searchText||"",teamDid:h,dateRange:O.dateRange?[H(O.dateRange[0]).toISOString(),H(O.dateRange[1]).toISOString()]:void 0};return await n.getReceivers({input:A})}catch(A){throw q.error(A.message),A}},[n,h]);g.useEffect(()=>{h&&M()},[h]),o(D.EVENTS.NOTIFICATION_BLOCKLET_UPDATE,m=>{R.has(m.notificationId)&&$(B)},[R,B]),o(D.EVENTS.NOTIFICATION_BLOCKLET_CREATE,m=>{R.has(m.id)||$(B)},[R,B]);const X={fetch:$,data:l,paging:f,blocklet:s,getComponent:k,resendNotification:F,getUser:V,componentDids:b,getReceivers:G,inService:r,teamDid:h};return e.jsx(Vt,{value:{notificationRecords:X},children:t})}function Be(){const{notificationRecords:t}=g.useContext(rt);return t}he.propTypes={severity:d.oneOf(Object.values(["info","success","error","warning"])).isRequired};const Yt={info:"primary",success:"success",error:"error",warning:"warning"};function he({severity:t="info"}){return e.jsx(xt,{type:Yt[t],children:t})}const Jt=(t,s,n="")=>{if(!n||!s)return"";switch(n){case D.NOTIFICATION_SEND_FAILED_REASON.USER_DISABLED:return t("notification.sendStatus.reason.disabled",{channel:s});case D.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_UNAVAILABLE:return t("notification.sendStatus.reason.unavailable",{channel:s});case D.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_DISABLED:return t("notification.sendStatus.reason.notSent",{channel:s});case D.NOTIFICATION_SEND_FAILED_REASON.NOT_ONLINE:return t("notification.sendStatus.reason.offline");default:return n}};function lt(t,s,n={}){const{status:r,updatedAt:o,reason:l="",channel:x="wallet"}=n,f=o?t("notification.sendStatus.sentTime",{date:bt(o,s)}):"",y=Jt(t,x,l);return r===D.NOTIFICATION_SEND_STATUS.FAILED?{status:"failed",title:t("notification.sendStatus.failed"),sentTime:f,reason:y}:r===D.NOTIFICATION_SEND_STATUS.SENT?{status:"success",title:t("notification.sendStatus.success"),sentTime:f}:{status:"pending",title:t("notification.sendStatus.pending"),reason:y,sentTime:f}}const Le={pending:"#aaaaaa",success:"#34BE74",failed:"#D0021B"},ke=["wallet","pushKit","email"],Ve=["info","success","error","warning"],ct=t=>{const{settings:s}=t;return s?.notification?.email?.enabled},dt=t=>{const{settings:s}=t;return s?.notification?.pushKit?.enabled},Qt=(t,s)=>{const n=ee(s,"extra.notifications.email",!0);return{available:ct(t),enabled:n}},Xt=(t,s)=>{const n=ee(s,"extra.notifications.push",!0);return{available:dt(t),enabled:n}},Zt=t=>({enabled:ee(t,"extra.notifications.wallet",!0)}),es=t=>({enabled:ee(t,"extra.webhooks",[]).length>0}),xe=(t=3)=>new Promise(s=>{setTimeout(()=>{s()},t*1e3)}),ts=(t,s)=>s==="wallet"||s==="webhook"?[{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:s==="pushKit"||s==="email"?[{channel:s,type:"available",pass:t("notification.sendStatus.reason.available",{channel:s}),fail:t("notification.sendStatus.reason.unavailable",{channel:s})},{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:[],be=(t=[])=>{const s=H().startOf("day");return t.filter(n=>H(n.sendAt).isSame(s,"day")).length},ss=(t,s="")=>{if(s&&ke.includes(s)){const l=`${s}SendRecord`,x=ee(t,l,[]);return be(x)}const n=ee(t,"webhook",{}),r=Object.keys(n??{})??[];if(s&&r.includes(s)){const l=n[s]??[];return be(l)}const o={};return ke.forEach(l=>{const x=`${l}SendRecord`,f=ee(t,x,[]),y=be(f);o[l]=y}),r.length>0&&r.forEach(l=>{const x=n[l]??[],f=be(x);o[l]=f}),o},ye=(t,s,n)=>{if(!Array.isArray(t))throw new Error("Invalid filterList or index");return t[n].splice(s,1),t},Se=(t,s)=>{if(!Array.isArray(s))throw new Error("filters must be an array");return s.length?!s.includes(t):!1},ns=t=>{switch(t){case D.NOTIFICATION_SEND_CHANNEL.WALLET:return"Wallet";case D.NOTIFICATION_SEND_CHANNEL.PUSH:return"Push Kit";case D.NOTIFICATION_SEND_CHANNEL.EMAIL:return"Email";case D.NOTIFICATION_SEND_CHANNEL.WEBHOOK:return"Webhook";default:return""}},ut=()=>({components:{MUIDataTableFilter:{styleOverrides:{header:{marginBottom:0,p:{margin:0}},root:{"& .MuiGrid-container":{marginTop:0,"& .MuiGrid-item":{paddingTop:0}}}}},MuiPopover:{styleOverrides:{root:{"&.MuiPopover-root":{"& .MuiPaper-root:has(.filter-container)":{width:"420px"}}}}}}});function te({config:t,enableTooltip:s=!0,showTitle:n=!1,children:r=null}){const{status:o,title:l="",sentTime:x="",reason:f=""}=t,y=[l,f].filter(Boolean).join(", ");return e.jsx(jt,{title:s?e.jsxs(e.Fragment,{children:[e.jsx(U,{color:"inherit",sx:{fontSize:12},children:y}),e.jsx("span",{children:x})]}):null,arrow:!0,placement:"top",children:e.jsxs(C,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsxs(C,{sx:{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center"},children:[e.jsx(C,{style:{opacity:.15},sx:{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:Le[o]}}),e.jsx(C,{sx:{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:Le[o]}})]}),e.jsx(U,{color:"inherit",sx:{fontSize:12},children:n?l:r})]})})}te.propTypes={config:d.object.isRequired,enableTooltip:d.bool,showTitle:d.bool,children:d.node};ve.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};function ve({list:t,label:s,onDelete:n=()=>{}}){const{t:r,locale:o}=Q();return e.jsxs(C,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsxs(U,{children:[s,": "]}),t.map(l=>{const x=lt(r,o,{status:l});return e.jsx(Fe,{size:"small",label:e.jsx(C,{sx:{display:"flex",alignItems:"center",gap:"4px"},children:e.jsx(te,{config:x,enableTooltip:!1,children:x.title})}),onDelete:f=>n(f,l)},l)})]})}ze.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 ze({filterList:t,onChange:s,index:n,column:r,filterValues:o,label:l,renderLabel:x}){return e.jsxs(Pe,{className:"filter-container",children:[e.jsx(Ye,{component:"legend",children:l}),e.jsx(Te,{row:!0,children:o.map(f=>e.jsx(Ie,{control:e.jsx(Ee,{checked:t[n].indexOf(f.value??f)>-1,onChange:y=>{const h=[...t];y.target.checked?h[n]=[...h[n],f.value??f]:h[n]=h[n].filter(b=>b!==(f.value??f)),s(h[n],n,r)},name:f.value??f}),label:e.jsx("span",{style:{display:"flex",alignItems:"center"},children:x(f)})},f.value??f))})]})}function Re(t){return e.jsx(ze,{...t,renderLabel:s=>e.jsx(te,{enableTooltip:!1,config:{status:s.status},children:s.label})})}ce.propTypes={status:d.number.isRequired,updatedAt:d.string.isRequired,reason:d.string,channel:d.string,onResend:d.func};function ce({status:t,updatedAt:s,reason:n="",channel:r="wallet",onResend:o}){const{t:l,locale:x}=Q(),f=lt(l,x,{status:t,updatedAt:s,reason:n,channel:r});return e.jsxs(C,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(te,{config:f,showTitle:!0}),f.status!=="success"&&e.jsx(Ne,{className:"resend-btn",size:"small",startIcon:e.jsx(_e,{}),sx:{fontSize:12,color:"rgba(0, 0, 0, 0.87)",fontWeight:400,".MuiButton-startIcon":{mr:"2px"}},onClick:o,children:l("notification.resend")})]})}We.propTypes={value:d.array.isRequired,onChange:d.func};function We({value:t,onChange:s}){const{locale:n}=Q(),r=H().toDate(),[o,l]=g.useState(null),x=g.useCallback(h=>{l(o?null:h.currentTarget)},[o]),f=!!o,y=g.useCallback(h=>{if(!h.startDate||!h.endDate){q.error("Please select a date range");return}if(H(h.startDate).isAfter(h.endDate)||!H(h.startDate).isValid()||!H(h.endDate).isValid()){q.error("Invalid date range");return}s([h.startDate,h.endDate]),l(null)},[s]);return e.jsxs("div",{children:[e.jsx(U,{component:"div",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},sx:{mb:0},children:e.jsxs(Ne,{onClick:x,variant:"outlined",size:"small",color:"inherit",children:[qe(t[0],n)," - ",qe(t[1],n)]})}),e.jsx(Ae,{open:f,anchorEl:o,onClose:()=>{l(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:e.jsx(Kt,{open:!0,maxDate:r,initialDateRange:{startDate:t[0],endDate:t[1]},toggle:x,definedRanges:Ht(r),onChange:y})})]})}Me.propTypes={itemComponent:d.elementType.isRequired};function Me({itemComponent:t,...s}){const{t:n}=Q();return!s?.filterList?.filter(o=>o.length).length?null:e.jsxs(C,{sx:{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(Pt.TableFilterList,{...s,ItemComponent:t})})]})}function Ke({label:t,onDelete:s,canDelete:n=()=>!0,...r}){const o=s&&typeof s=="function"?s:void 0;let l=!0;return n&&typeof n=="function"&&(l=n({label:t,...r})),e.jsx(Fe,{label:t,variant:"outlined",...o&&l?{onDelete:o}:{}})}Ke.propTypes={label:d.string.isRequired,onDelete:d.func,canDelete:d.func};const is=[{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}];pt.propTypes={loading:d.bool,onCancel:d.func,onConfirm:d.func};function pt({loading:t=!1,onCancel:s=()=>{},onConfirm:n=()=>{}}){const{t:r}=Q(),[o,l]=g.useState(is),[x,f]=g.useState(!0),y=(b,S)=>{S.checked=b.target.checked;const B=o.map(_=>({..._,checked:_.value===S.value?S.checked:_.checked}));l(B)},h=b=>{b.stopPropagation(),n({channels:o.filter(S=>S.checked).map(S=>S.value),isResendFailedOnly:x})};return e.jsxs(C,{className:"resend-config",sx:{padding:"16px 24px"},children:[e.jsx(U,{variant:"body1",component:"div",className:"check-title",sx:{fontWeight:700,mb:1},children:r("notification.config")}),e.jsx(C,{className:"choose-channel",children:e.jsxs(Pe,{component:"fieldset",variant:"standard",children:[e.jsx(Ye,{component:"legend",children:r("notification.selectChannels")}),e.jsx(Te,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:1},children:o.map(b=>e.jsx(Ie,{control:e.jsx(Ee,{checked:b.checked,onChange:S=>y(S,b),name:b.value}),label:b.label},b.value))})]})}),e.jsx(C,{className:"resend-config-footer",children:e.jsx(Te,{children:e.jsx(Ie,{control:e.jsx(Ee,{checked:x,onChange:b=>f(b.target.checked)}),label:r("notification.resendFailedOnly")})})}),e.jsxs(C,{className:"resend-config-footer-tip",sx:{display:"flex",justifyContent:"flex-end",gap:1},children:[e.jsx(Ne,{onClick:b=>{b.stopPropagation(),s()},color:"inherit",children:r("common.cancel")}),e.jsxs(Ne,{onClick:h,color:"primary",disabled:t,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[t&&e.jsx(Je,{size:16}),r("common.confirm")]})]})]})}ft.propTypes={notificationId:d.string.isRequired,handleResend:d.func,resending:d.bool};function ft({notificationId:t,handleResend:s,resending:n=!1}){const{t:r,locale:o}=Q(),l=Qe(),x=g.useMemo(()=>Xe(l,ut()),[l]),{getReceivers:f,inService:y,teamDid:h,getUser:b,blocklet:S}=Be(),[B,_]=g.useState(!1),[R,$]=g.useState([]),M=De({anchorEl:null,position:null}),k=De({anchorEl:null,position:null}),[F,V]=g.useState(null),[G,X]=g.useState({total:0,pageSize:10,pageCount:0,page:1}),[m,N]=g.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[H().subtract(1,"month").startOf("day").toDate(),H().endOf("day").toDate()]}),[O,A]=g.useState([]),w=[{label:r("notification.sendStatus.pending"),value:0,status:"pending"},{label:r("notification.sendStatus.success"),value:1,status:"success"},{label:r("notification.sendStatus.failed"),value:2,status:"failed"}],L=async()=>{if(!B&&t)try{_(!0);const i=await f({notificationId:t,...m}),a=i.list.map(c=>({...c,receiverUser:{...c.receiverUser,avatar:st(c.receiverUser.avatar,h,y)}}));$(a),X(i.paging),_(!1)}catch(i){q.error(i.message),_(!1)}};g.useEffect(()=>{L()},[m]);const P=i=>{i.stopPropagation();const a=i.currentTarget;k.anchorEl=a;const c=a.getBoundingClientRect();k.position={top:c.top+window.scrollY,left:c.left+window.scrollX}},ae=i=>i.data.length?e.jsx("div",{style:{display:"flex",alignItems:"center",padding:"10px"},children:e.jsx(Oe,{className:"resend-btn",size:"small",color:"primary",variant:"contained",startIcon:e.jsx(_e,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:P,children:r("notification.resend")})}):null,se={sort:!1,download:!1,print:!1,selectableRows:"multiple",searchPlaceholder:r("common.search"),searchAlwaysOpen:!1,filterType:"checkbox",searchDebounceTime:300,page:G.page-1,rowsPerPage:G.pageSize,count:G.total,searchText:m.searchText,tableBodyMaxHeight:"calc(80vh - 260px)",rowsSelected:O,onRowSelectionChange:(i,a)=>{A(a.map(c=>c.dataIndex))},customToolbarSelect:ae},Z=({page:i,rowsPerPage:a,searchText:c,filterList:v})=>{const[,z=[],Y=[],K=[]]=v;m.pageSize!==a?N(W=>({...W,pageSize:a,page:1})):m.page!==i+1?N(W=>({...W,page:i+1})):m.searchText!==c?N(W=>({...W,searchText:c,page:1})):pe(z,m.walletSendStatus)?pe(Y,m.pushKitSendStatus)?pe(K,m.emailSendStatus)||N(W=>({...W,emailSendStatus:K,page:1})):N(W=>({...W,pushKitSendStatus:Y,page:1})):N(W=>({...W,walletSendStatus:z,page:1}))},oe=g.useCallback(async(i,a)=>{if(!a)return!1;const c=await b(a);return c?i==="wallet"?Zt(c):i==="email"?Qt(S,c):i==="pushKit"?Xt(S,c):i==="webhook"?es(c):!0:!1},[b,S]),we=g.useCallback(i=>ts(r,i),[r]),ne=()=>{M.anchorEl=null,M.position=null,V(null)},re=()=>{k.anchorEl=null,k.position=null},ge=async(i,a,c=!0,v="")=>{if(!(!a.length||!i.length))try{s(i,a,c,v),k.anchorEl||(await xe(.5),ne())}catch(z){console.error("handleResend error",{error:z})}},p=async({channels:i,isResendFailedOnly:a})=>{const c=O.map(v=>R[v].receiver);await ge(i,c,a),await xe(.5),re(),A([])},u=async(i,a=[],c=!0)=>{try{await ge(["webhook"],[i.receiver],c,a)}catch(v){q.error(v.response?v.response.statusText:v.message)}},j=async(i,a,c,v=[],z=!0)=>{if(i.stopPropagation(),ss(a,c)>=4){q.warning(r("notification.resendLimit"));return}if(!ke.includes(c)){await u(a,v,z);return}if(i){const K=i.currentTarget,W=K.getBoundingClientRect();M.anchorEl=K,M.position={top:W.top+window.scrollY,left:W.left+window.scrollX}}V({channel:c});try{const K=await oe(c,a.receiver);await xe(1),V({channel:c,result:K}),(typeof K=="boolean"&&K||St(K)&&Object.values(K).every(W=>!!W))&&(await s([c],[a.receiver],z),k.anchorEl||(await xe(.5),ne()))}catch(K){q.error(K.message)}},I=i=>{N(a=>({...a,dateRange:i,page:1}))},E=(i,a,c,v)=>{i.stopPropagation();const z=c.filter(Y=>Y!==a);N(Y=>({...Y,[v]:z,page:1}))},T=J(()=>[{label:r("notification.receiver"),name:"receiver",width:200,options:{filter:!1,customBodyRenderLite:i=>{const{receiverUser:a,receiver:c}=R[i];return a?e.jsxs(C,{"data-cy":`member-name-${a.fullName}`,sx:{display:"flex",alignItems:"center",gap:1,justifyContent:"flex-start"},children:[e.jsx(Ze,{src:`${a.avatar}?imageFilter=resize&w=48&h=48`,size:32,did:c,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),e.jsx(me,{children:a.fullName})]},c):e.jsx(yt,{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:m.walletSendStatus??[],customFilterListOptions:{render:i=>e.jsx(ve,{list:i,label:"Wallet",onDelete:(a,c)=>{a.stopPropagation(),E(a,c,T[1].options.filterList,"walletSendStatus")}}),update:ye},filterOptions:{names:w,fullWidth:!0,logic:Se,display:(i,a,c,v)=>e.jsx(Re,{label:"Wallet",filterList:i,onChange:a,index:c,column:v,filterValues:w})},customBodyRenderLite:i=>{const{walletSendStatus:a,walletSendAt:c,walletSendFailedReason:v}=R[i];return e.jsx(ce,{status:a,updatedAt:c,reason:v,channel:"wallet",onResend:z=>j(z,R[i],"wallet",[],!1)})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{pushKitSendStatus:a,pushKitSendAt:c,pushKitSendFailedReason:v}=R[i];return e.jsx(ce,{status:a,updatedAt:c,reason:v,channel:"pushkit",onResend:z=>j(z,R[i],"pushKit",[],!1)})},filter:!0,filterType:"custom",filterList:m.pushKitSendStatus??[],customFilterListOptions:{render:i=>e.jsx(ve,{list:i,label:"Push Kit",onDelete:(a,c)=>{a.stopPropagation(),E(a,c,T[2].options.filterList,"pushKitSendStatus")}}),update:ye},filterOptions:{names:w,fullWidth:!0,logic:Se,display:(i,a,c,v)=>e.jsx(Re,{label:"Push Kit",filterList:i,onChange:a,index:c,column:v,filterValues:w})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{emailSendStatus:a,emailSendAt:c,emailSendFailedReason:v}=R[i];return e.jsx(ce,{status:a,updatedAt:c,reason:v,channel:"email",onResend:z=>j(z,R[i],"email",[],!1)})},filter:!0,filterType:"custom",filterList:m.emailSendStatus??[],customFilterListOptions:{render:i=>e.jsx(ve,{list:i,label:"Email",onDelete:(a,c)=>{a.stopPropagation(),E(a,c,T[3].options.filterList,"emailSendStatus")}}),update:ye},filterOptions:{names:w,fullWidth:!0,logic:Se,display:(i,a,c,v)=>e.jsx(Re,{label:"Email",filterList:i,onChange:a,index:c,column:v,filterValues:w})}}},{label:"Webhook",name:"webhook",width:200,options:{filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{webhook:a}=R[i];if(!a)return null;const c=Object.entries(a)[0];if(!c)return null;const[v,z]=c,Y=z[0];return e.jsx(C,{sx:{display:"flex",flexDirection:"column",gap:1},children:e.jsxs(C,{className:"webhook-item",sx:{fontSize:12},children:[e.jsx(me,{maxLength:30,children:v},v),e.jsx(ce,{status:Y.status,updatedAt:Y.sendAt,reason:Y.failedReason,channel:"webhook",onResend:K=>j(K,R[i],"webhook",[v],!1)})]},v)})}}},{label:r("common.createdAt"),name:"createdAt",width:100,options:{filter:!1,customBodyRenderLite:i=>{const{createdAt:a}=R[i];return e.jsx(et,{value:a,locale:o,shouldUpdate:!0})}}}],[R,o,m,r]),le=[e.jsx(We,{value:m.dateRange,onChange:I},"date-picker"),e.jsx(Oe,{variant:"contained",size:"small",color:"primary",loading:B,startIcon:e.jsx(Mt,{}),onClick:()=>L(),sx:{".MuiButton-startIcon":{mr:"2px"}},style:{marginLeft:8},children:r("common.refresh")},"refresh")];return e.jsx(C,{sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:e.jsx(os,{children:e.jsxs(tt,{theme:x,children:[e.jsx(at,{className:"receivers-table",locale:o,loading:B,columns:T,data:R,onChange:Z,options:se,customButtons:le,components:{TableFilterList:i=>e.jsx(Me,{...i,itemComponent:a=>e.jsx(Ke,{...a,canDelete:()=>!1})})}}),M.anchorEl&&e.jsx(Ae,{open:!!M.anchorEl,anchorReference:"anchorPosition",anchorPosition:M.position,onClose:ne,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs(rs,{children:[e.jsxs(U,{variant:"body1",component:"div",className:"check-title",children:[F?.channel," Checking"]}),e.jsx(C,{sx:{display:"flex",flexDirection:"column",gap:"4px"},children:we(F?.channel).map(i=>{const{type:a,pass:c,fail:v}=i;return!F?.result||F?.result?.[a]?e.jsxs(U,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:F?.result?.[a]?je.success.main:"inherit"},children:[F?.result?e.jsx($t,{}):e.jsx(Je,{size:12,sx:{color:je.primary.main}}),e.jsx("span",{children:c})]},a):e.jsxs(U,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:je.error.main},children:[e.jsx(Ut,{}),e.jsx("span",{children:v})]},a)})})]})}),k.anchorEl&&e.jsx(Ae,{open:!!k.anchorEl,anchorReference:"anchorPosition",anchorPosition:k.position,onClose:re,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsx(pt,{loading:n,onCancel:re,onConfirm:p})})]})})})}const as=g.memo(ft),os=ie.div`
2
2
  td.MuiTableCell-footer {
3
3
  border: none !important;
4
4
  }
@@ -27,7 +27,7 @@ import{aF as Ge,j as e,bn as gt,r as g,bC as Q,bf as H,H as q,aH as D,g as xt,o
27
27
  }
28
28
  font-size: 12px;
29
29
  }
30
- `,fe=t=>t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${(t/1e3).toFixed(1)}K`:t;function ls(t){const{wallet:s,push:n,email:r,webhook:o}=t;return[{name:"Wallet",value:e.jsx(de,{item:s})},{name:"Push",value:e.jsx(de,{item:n})},{name:"Email",value:e.jsx(de,{item:r})},...o.total>0?[{name:"Webhook",value:e.jsx(de,{item:o,isWebhook:!0})}]:[]]}function cs(t,s,n){const{wallet:r,push:o,email:l,webhook:x}=t;return[{name:"Wallet",value:e.jsx(ue,{loading:n,channel:D.NOTIFICATION_SEND_CHANNEL.WALLET,item:r,onResend:s})},{name:"Push",value:e.jsx(ue,{loading:n,channel:D.NOTIFICATION_SEND_CHANNEL.PUSH,item:o,onResend:s})},{name:"Email",value:e.jsx(ue,{loading:n,channel:D.NOTIFICATION_SEND_CHANNEL.EMAIL,item:l,onResend:s})},...x.total>0?[{name:"Webhook",value:e.jsx(ue,{loading:n,channel:D.NOTIFICATION_SEND_CHANNEL.WEBHOOK,item:x,isWebhook:!0,onResend:s})}]:[]]}He.propTypes={statistics:d.object.isRequired,onResend:d.func,mode:d.oneOf(["simple","detail"]),resending:d.bool};de.propTypes={item:d.object.isRequired,isWebhook:d.bool};function de({item:t,isWebhook:s=!1}){const{t:n}=X(),r=s?t.success.length:t.success,o=t.total,l=r===o?"success":"failed";return e.jsx(C,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:2},children:e.jsx(C,{sx:{display:"flex",alignItems:"center",gap:1},children:e.jsxs(te,{config:{status:l},enableTooltip:!1,children:[fe(r)," / ",fe(o)," ",n("notification.sendStatus.success")]})})})}ue.propTypes={item:d.object.isRequired,isWebhook:d.bool,channel:d.string,onResend:d.func,loading:d.bool};function ue({channel:t=D.NOTIFICATION_SEND_CHANNEL.WALLET,item:s,isWebhook:n=!1,onResend:r=()=>{},loading:o=!1}){const{t:l}=X(),{success:x,failed:f,pending:y}=s,h=ns(t),b=n?x.length:x,S=n?f.length:f,B=n?y.length:y,_=async k=>{k.stopPropagation();const F=n?[...new Set([...x,...f].map(V=>V))]:[];await r([t],[],!0,F)},R=b+S,$=R>0?b/R*100:0,M=R>0?S/R*100:0;return e.jsxs(ds,{successRatio:$,failedRatio:M,children:[e.jsxs(U,{variant:"h6",children:[h," (",s.total,")"]}),e.jsxs(U,{variant:"body1",sx:{mb:2},children:[e.jsx("span",{style:{color:Le.success,fontWeight:600,fontSize:24},children:fe(b)}),e.jsx("small",{style:{paddingLeft:4},children:l("notification.sendStatus.success")})]}),e.jsxs(C,{className:"unsent-area",children:[e.jsxs(C,{children:[e.jsxs(te,{config:{status:"failed"},enableTooltip:!1,children:[fe(S)," ",l("notification.sendStatus.failed")]}),e.jsxs(te,{config:{status:"pending"},enableTooltip:!1,children:[fe(B)," ",l("notification.sendStatus.pending")]})]}),S>0&&e.jsx(C,{className:"resend-btn",children:e.jsx(Oe,{size:"small",color:"primary",loading:o,variant:"contained",startIcon:e.jsx(_e,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:_,children:l("notification.resend")})})]})]})}function He({statistics:t,mode:s="simple",onResend:n=()=>{},resending:r=!1}){const o=Q(()=>s==="simple"?ls(t):cs(t,n,r),[t,s]);return s==="simple"?e.jsx("div",{children:o.map(l=>e.jsx(ot,{style:{alignItems:"flex-start",marginBottom:s==="simple"?0:16},valueComponent:"div",nameWidth:100,name:l.name,children:l.value},l.name))}):e.jsx(Ue,{container:!0,spacing:2,children:o.map(l=>e.jsx(Ue,{size:{md:4,sm:6,xs:12},children:l.value},l.name))})}const ds=ie(C)`
30
+ `,fe=t=>t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${(t/1e3).toFixed(1)}K`:t;function ls(t){const{wallet:s,push:n,email:r,webhook:o}=t;return[{name:"Wallet",value:e.jsx(de,{item:s})},{name:"Push",value:e.jsx(de,{item:n})},{name:"Email",value:e.jsx(de,{item:r})},...o.total>0?[{name:"Webhook",value:e.jsx(de,{item:o,isWebhook:!0})}]:[]]}function cs(t,s,n){const{wallet:r,push:o,email:l,webhook:x}=t;return[{name:"Wallet",value:e.jsx(ue,{loading:n,channel:D.NOTIFICATION_SEND_CHANNEL.WALLET,item:r,onResend:s})},{name:"Push",value:e.jsx(ue,{loading:n,channel:D.NOTIFICATION_SEND_CHANNEL.PUSH,item:o,onResend:s})},{name:"Email",value:e.jsx(ue,{loading:n,channel:D.NOTIFICATION_SEND_CHANNEL.EMAIL,item:l,onResend:s})},...x.total>0?[{name:"Webhook",value:e.jsx(ue,{loading:n,channel:D.NOTIFICATION_SEND_CHANNEL.WEBHOOK,item:x,isWebhook:!0,onResend:s})}]:[]]}He.propTypes={statistics:d.object.isRequired,onResend:d.func,mode:d.oneOf(["simple","detail"]),resending:d.bool};de.propTypes={item:d.object.isRequired,isWebhook:d.bool};function de({item:t,isWebhook:s=!1}){const{t:n}=Q(),r=s?t.success.length:t.success,o=t.total,l=r===o?"success":"failed";return e.jsx(C,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:2},children:e.jsx(C,{sx:{display:"flex",alignItems:"center",gap:1},children:e.jsxs(te,{config:{status:l},enableTooltip:!1,children:[fe(r)," / ",fe(o)," ",n("notification.sendStatus.success")]})})})}ue.propTypes={item:d.object.isRequired,isWebhook:d.bool,channel:d.string,onResend:d.func,loading:d.bool};function ue({channel:t=D.NOTIFICATION_SEND_CHANNEL.WALLET,item:s,isWebhook:n=!1,onResend:r=()=>{},loading:o=!1}){const{t:l}=Q(),{success:x,failed:f,pending:y}=s,h=ns(t),b=n?x.length:x,S=n?f.length:f,B=n?y.length:y,_=async k=>{k.stopPropagation();const F=n?[...new Set([...x,...f].map(V=>V))]:[];await r([t],[],!0,F)},R=b+S,$=R>0?b/R*100:0,M=R>0?S/R*100:0;return e.jsxs(ds,{successRatio:$,failedRatio:M,children:[e.jsxs(U,{variant:"h6",children:[h," (",s.total,")"]}),e.jsxs(U,{variant:"body1",sx:{mb:2},children:[e.jsx("span",{style:{color:Le.success,fontWeight:600,fontSize:24},children:fe(b)}),e.jsx("small",{style:{paddingLeft:4},children:l("notification.sendStatus.success")})]}),e.jsxs(C,{className:"unsent-area",children:[e.jsxs(C,{children:[e.jsxs(te,{config:{status:"failed"},enableTooltip:!1,children:[fe(S)," ",l("notification.sendStatus.failed")]}),e.jsxs(te,{config:{status:"pending"},enableTooltip:!1,children:[fe(B)," ",l("notification.sendStatus.pending")]})]}),S>0&&e.jsx(C,{className:"resend-btn",children:e.jsx(Oe,{size:"small",color:"primary",loading:o,variant:"contained",startIcon:e.jsx(_e,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:_,children:l("notification.resend")})})]})]})}function He({statistics:t,mode:s="simple",onResend:n=()=>{},resending:r=!1}){const o=J(()=>s==="simple"?ls(t):cs(t,n,r),[t,s]);return s==="simple"?e.jsx("div",{children:o.map(l=>e.jsx(ot,{style:{alignItems:"flex-start",marginBottom:s==="simple"?0:16},valueComponent:"div",nameWidth:100,name:l.name,children:l.value},l.name))}):e.jsx(Ue,{container:!0,spacing:2,children:o.map(l=>e.jsx(Ue,{size:{md:4,sm:6,xs:12},children:l.value},l.name))})}const ds=ie(C)`
31
31
  display: flex;
32
32
  flex-direction: column;
33
33
  align-items: flex-start;
@@ -45,7 +45,7 @@ import{aF as Ge,j as e,bn as gt,r as g,bC as Q,bf as H,H as q,aH as D,g as xt,o
45
45
  bottom: 0;
46
46
  }
47
47
  }
48
- `;mt.propTypes={notification:d.object.isRequired,onCancel:d.func,blocklet:d.object.isRequired,tab:d.string};function mt({notification:t,onCancel:s=()=>{},blocklet:n,tab:r="info"}){const{t:o,locale:l}=X(),{getComponent:x,resendNotification:f}=Be(),[y,h]=g.useState(!1),b=Q(()=>x(t.componentDid)||n,[n,t.componentDid]),S=De({tab:r||"info"}),B=g.useCallback(async(m,N,O=!0,A=[])=>{if(!m.length||!t.id)return;const w=N.length>0?N:t?.receivers?.map(P=>P.receiver);if(!w.length)return;let L=[...m];if(L.includes(D.NOTIFICATION_SEND_CHANNEL.PUSH)&&!dt(n)&&(q.warning(o("notification.sendStatus.reason.unavailable",{channel:"Push Kit"})),L=L.filter(P=>P!==D.NOTIFICATION_SEND_CHANNEL.PUSH)),L.includes(D.NOTIFICATION_SEND_CHANNEL.EMAIL)&&!ct(n)&&(q.warning(o("notification.sendStatus.reason.unavailable",{channel:"Email"})),L=L.filter(P=>P!==D.NOTIFICATION_SEND_CHANNEL.EMAIL)),!!L.length)try{h(!0),await f({notificationId:t.id,receivers:w,channels:L,resendFailedOnly:O,...L.includes("webhook")&&A.length?{webhookUrls:A}:{}}),q.success("Message has been sent!")}catch(P){console.error("handleResend error",{error:P}),q.error(P.response?P.response.statusText:P.message)}finally{h(!1)}},[n,t.id,t?.receivers,f,o]),_=Q(()=>Ct(t),[t]),R=Q(()=>Nt(t),[t]),$=Q(()=>_?t?.actorInfo:[],[t]),M=Q(()=>n?.did||n?.meta?.did||"",[n]);function k(){return[{name:o("notification.from"),value:_&&R?e.jsx(wt,{actors:$,teamDid:M,size:32,showName:!0}):e.jsx(Rt,{size:32,blocklet:b,showName:!0,hideDot:!0})},{name:o("notification.notificationTitle"),value:e.jsx(me,{maxLength:50,children:t.title})},{name:o("notification.body"),value:_?e.jsx(Tt,{notification:t,blocklet:n}):e.jsx(It,{notification:t,rows:0})},{name:o("notification.severity"),value:e.jsx(he,{severity:t.severity})},{name:o("notification.createdAt"),value:e.jsx(Et,{value:t.createdAt,locale:l,shouldUpdate:!0,type:"all"})}].map(N=>e.jsx(ot,{style:{alignItems:"flex-start"},valueComponent:"div",nameWidth:120,name:N.name,children:N.value},N.name))}const F={info:{label:o("common.basicInfo"),value:"info",component:k},receivers:{label:o("notification.receiver"),value:"receivers"},statistics:{label:o("notification.statistics"),value:"statistics"}},V=Object.values(F).map(({label:m,value:N})=>({label:m,value:N})),G=F[S.tab]||F.info,J=m=>{S.tab=m};return e.jsx(nt,{title:o("notification.notificationDetails"),fullWidth:!0,maxWidth:"lg",onClose:()=>{S.tab="info",s()},open:!0,actionsPosition:"left",sx:{".ux-dialog_header":{paddingBottom:0},".MuiDialogContent-root":{paddingTop:0}},children:e.jsxs(ps,{children:[e.jsx(C,{className:"tabs",sx:{mx:3},children:e.jsx(Wt,{tabs:V,current:S.tab,onChange:J,scrollButtons:"auto"})}),e.jsxs("div",{className:"body",children:[S.tab==="receivers"&&e.jsx(as,{notificationId:t.id,resending:y,handleResend:B}),S.tab==="statistics"&&e.jsx(He,{statistics:t.statistics,mode:"detail",resending:y,onResend:B}),S.tab==="info"&&e.jsx(G.component,{})]})]})})}const us=g.memo(mt),ps=ie.div`
48
+ `;mt.propTypes={notification:d.object.isRequired,onCancel:d.func,blocklet:d.object.isRequired,tab:d.string};function mt({notification:t,onCancel:s=()=>{},blocklet:n,tab:r="info"}){const{t:o,locale:l}=Q(),{getComponent:x,resendNotification:f}=Be(),[y,h]=g.useState(!1),b=J(()=>x(t.componentDid)||n,[n,t.componentDid]),S=De({tab:r||"info"}),B=g.useCallback(async(m,N,O=!0,A=[])=>{if(!m.length||!t.id)return;const w=N.length>0?N:t?.receivers?.map(P=>P.receiver);if(!w.length)return;let L=[...m];if(L.includes(D.NOTIFICATION_SEND_CHANNEL.PUSH)&&!dt(n)&&(q.warning(o("notification.sendStatus.reason.unavailable",{channel:"Push Kit"})),L=L.filter(P=>P!==D.NOTIFICATION_SEND_CHANNEL.PUSH)),L.includes(D.NOTIFICATION_SEND_CHANNEL.EMAIL)&&!ct(n)&&(q.warning(o("notification.sendStatus.reason.unavailable",{channel:"Email"})),L=L.filter(P=>P!==D.NOTIFICATION_SEND_CHANNEL.EMAIL)),!!L.length)try{h(!0),await f({notificationId:t.id,receivers:w,channels:L,resendFailedOnly:O,...L.includes("webhook")&&A.length?{webhookUrls:A}:{}}),q.success("Message has been sent!")}catch(P){console.error("handleResend error",{error:P}),q.error(P.response?P.response.statusText:P.message)}finally{h(!1)}},[n,t.id,t?.receivers,f,o]),_=J(()=>Ct(t),[t]),R=J(()=>Nt(t),[t]),$=J(()=>_?t?.actorInfo:[],[t]),M=J(()=>n?.did||n?.meta?.did||"",[n]);function k(){return[{name:o("notification.from"),value:_&&R?e.jsx(wt,{actors:$,teamDid:M,size:32,showName:!0}):e.jsx(Rt,{size:32,blocklet:b,showName:!0,hideDot:!0})},{name:o("notification.notificationTitle"),value:e.jsx(me,{maxLength:50,children:t.title})},{name:o("notification.body"),value:_?e.jsx(Tt,{notification:t,blocklet:n}):e.jsx(It,{notification:t,rows:0})},{name:o("notification.severity"),value:e.jsx(he,{severity:t.severity})},{name:o("notification.createdAt"),value:e.jsx(Et,{value:t.createdAt,locale:l,shouldUpdate:!0,type:"all"})}].map(N=>e.jsx(ot,{style:{alignItems:"flex-start"},valueComponent:"div",nameWidth:120,name:N.name,children:N.value},N.name))}const F={info:{label:o("common.basicInfo"),value:"info",component:k},receivers:{label:o("notification.receiver"),value:"receivers"},statistics:{label:o("notification.statistics"),value:"statistics"}},V=Object.values(F).map(({label:m,value:N})=>({label:m,value:N})),G=F[S.tab]||F.info,X=m=>{S.tab=m};return e.jsx(nt,{title:o("notification.notificationDetails"),fullWidth:!0,maxWidth:"lg",onClose:()=>{S.tab="info",s()},open:!0,actionsPosition:"left",sx:{".ux-dialog_header":{paddingBottom:0},".MuiDialogContent-root":{paddingTop:0}},children:e.jsxs(ps,{children:[e.jsx(C,{className:"tabs",sx:{mx:3},children:e.jsx(Wt,{tabs:V,current:S.tab,onChange:X,scrollButtons:"auto"})}),e.jsxs("div",{className:"body",children:[S.tab==="receivers"&&e.jsx(as,{notificationId:t.id,resending:y,handleResend:B}),S.tab==="statistics"&&e.jsx(He,{statistics:t.statistics,mode:"detail",resending:y,onResend:B}),S.tab==="info"&&e.jsx(G.component,{})]})]})})}const us=g.memo(mt),ps=ie.div`
49
49
  & > .notification-row {
50
50
  padding: 0;
51
51
  }
@@ -92,7 +92,7 @@ import{aF as Ge,j as e,bn as gt,r as g,bC as Q,bf as H,H as q,aH as D,g as xt,o
92
92
  overflow: hidden;
93
93
  text-overflow: ellipsis;
94
94
  }
95
- `;function Ce({blocklet:t=null,label:s=""}){return e.jsx(fs,{children:t?e.jsxs(e.Fragment,{children:[e.jsx(it,{size:24,blocklet:t,ancestors:t.ancestors}),e.jsx("span",{className:"name",children:t.title||t.meta?.title})]}):e.jsx("span",{className:"name",children:s})})}ht.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};function ht({list:t,label:s,onDelete:n=()=>{}}){return e.jsxs(C,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsxs(U,{children:[s,": "]}),t.map(r=>e.jsx(Fe,{size:"small",label:e.jsx(C,{sx:{display:"flex",alignItems:"center",gap:"4px"},children:e.jsx(he,{severity:r})}),onDelete:o=>n(o,r)},r))]})}function ms(t){return e.jsx(ze,{...t,renderLabel:s=>e.jsx(he,{severity:s})})}function hs({customTableButtons:t}){const{t:s,locale:n}=X(),r=Xe(),o=At(r.breakpoints.down("sm")),l=g.useMemo(()=>Je(r,ut()),[r]),[x,f]=g.useState(!1),{data:y,paging:h,blocklet:b,fetch:S,getComponent:B,componentDids:_,inService:R,teamDid:$}=Be(),M=g.useRef(null),[k,F]=g.useState(null),[V,G]=g.useState("info"),J=qt(),[m,N]=g.useState(!1),O=`notification-records-${b.meta?.did}`,A=_t(O),[w,L]=g.useState({pageSize:A.rowsPerPage||10,page:A.page?A.page+1:1,dids:A.dids||[],dateRange:A.dateRange||[H().subtract(1,"month").startOf("day").toDate(),H().endOf("day").toDate()]}),P=Q(()=>{if(!b.children||!b.children.length)return[];const p=[];return b.children.forEach(u=>{const j=u.did||u.meta?.did;_.includes(j)&&(u.ancestors=[b],p.push(u))}),p},[_,b]),ae=async p=>{try{f(!0),await S(p),f(!1)}finally{f(!1)}};g.useEffect(()=>{ae(w)},[w]),g.useEffect(()=>{const p=y.find(u=>u.id===k?.id);k&&p&&F({...p})},[y]);const se=(p,u,j,I)=>{p.stopPropagation();const E=j.filter(T=>T!==u);L(T=>({...T,[I]:E,page:1}))},Z=({page:p,rowsPerPage:u,filterList:j})=>{const[I=[],,,,E=[]]=j;w.pageSize!==u?L(T=>({...T,pageSize:u,page:1})):w.page!==p+1?L(T=>({...T,page:p+1})):pe(w.dids,I)?pe(w.severities,E)||L(T=>({...T,severities:E,page:1})):L(T=>({...T,dids:I,page:1}))},oe=g.useCallback(()=>{F(null),G("info")},[]),we=g.useCallback(()=>{S(w)},[S,w]),ne=[{label:s("notification.from"),name:"sender",width:400,options:{filter:!0,filterType:"custom",customFilterListOptions:{render:p=>p.map((u,j)=>{if(u==="system")return e.jsx("span",{children:s("notification.system")},`system-${j}`);const I=P.find(E=>(E.did||E.meta?.did)===u);return e.jsx(Ce,{blocklet:I,label:I?.title||I?.meta?.title},u)}),update:(p,u,j)=>(p[j].splice(u,1),p)},filterOptions:{names:P,logic:(p,u)=>u.length?!u.includes(p):!1,display:(p,u,j,I)=>e.jsxs(Pe,{style:{width:"380px"},children:[e.jsx(Ot,{id:"demo-simple-select-label",style:{background:"#ffffff"},children:"Sender"}),e.jsxs(Lt,{multiple:!0,value:p[j],renderValue:E=>e.jsx(C,{style:{overflow:"hidden",textOverflow:"ellipsis"},sx:{display:"flex",gap:1,alignItems:"center"},children:E.map(T=>{if(T==="system")return e.jsx("span",{children:s("notification.system")},T);const le=P.find(i=>(i.did||i.meta?.did)===T);return e.jsx(Ce,{blocklet:le,label:le?.title||le?.meta?.title},T)})}),onChange:E=>{p[j]=E.target.value,u(p[j],j,I)},children:[e.jsx($e,{value:"system",children:s("notification.system")}),P.map(E=>{const T=E.did||E.meta?.did;return e.jsx($e,{value:T,children:e.jsx(Ce,{blocklet:E,label:E.title||E.meta?.title})},T)})]})]})},customBodyRenderLite:p=>{const u=y[p],j=B(u.componentDid);return e.jsxs(C,{sx:{display:"flex",alignItems:"center",gap:1},children:[j?e.jsx(it,{size:32,blocklet:j,ancestors:j.ancestors??[]}):e.jsx(Dt,{blocklet:b,size:32}),e.jsx(me,{maxLength:50,children:j?.meta?.title||b?.meta?.title})]})}}},{label:s("notification.receiver"),name:"receivers",width:300,options:{filter:!1,customBodyRenderLite:p=>{const u=y[p],{receivers:j}=u;return e.jsx(kt,{total:j.length,renderSurplus:I=>I<100?e.jsxs("span",{children:["+",I]}):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:I=>{I.stopPropagation(),F(u),G("receivers")},children:j.map(I=>{const{receiverUser:E}=I,T=st(E.avatar,$,R);return e.jsx(Ze,{alt:E.fullName,src:`${T}?imageFilter=resize&w=48&h=48`,size:32,did:I.receiver,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}},I.receiver)})})}}},{label:s("notification.statistics"),name:"statistics",width:400,options:{filter:!1,customBodyRenderLite:p=>{const u=y[p];return e.jsx(C,{onClick:j=>{j.stopPropagation(),F(u),G("statistics")},children:e.jsx(He,{statistics:u.statistics})})}}},{label:s("notification.notificationPreview"),name:"data",options:{filter:!1,customBodyRenderLite:p=>{const u=y[p];return e.jsx(me,{maxLength:50,children:u.title})}}},{label:s("notification.severity"),name:"severity",width:200,options:{setCellProps:()=>({className:"severity-cell"}),customBodyRenderLite:p=>{const u=y[p];return e.jsx(he,{severity:u.severity})},filter:!0,filterType:"custom",filterList:w.severities??[],customFilterListOptions:{render:p=>e.jsx(ht,{list:p,label:s("notification.severity"),onDelete:(u,j)=>{u.stopPropagation(),se(u,j,ne[4].options.filterList,"severities")}}),update:ye},filterOptions:{names:Ve,fullWidth:!0,logic:Se,display:(p,u,j,I)=>e.jsx(ms,{label:s("notification.severity"),filterList:p,onChange:u,index:j,column:I,filterValues:Ve})}}},{label:s("common.createdAt"),name:"createdAt",width:300,options:{filter:!1,customBodyRenderLite:p=>{const{createdAt:u}=y[p];return e.jsx(et,{value:u,locale:n,shouldUpdate:!0})}}}],re=p=>{L(u=>({...u,dateRange:p,page:1}))},ge=[e.jsxs(C,{sx:{display:"flex",alignItems:"center",gap:1.5},children:[e.jsx(Ft,{onClick:()=>N(!0),sx:{p:J?0:void 0},children:e.jsx(Bt,{})},"settings"),J?e.jsx(U,{children:s("common.setting")}):null]}),...t||[]];return e.jsxs(C,{ref:M,sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:[e.jsx(gs,{isBreakpointsDownSm:o,children:e.jsx(tt,{theme:l,children:e.jsx(at,{className:"main-table",verticalKeyWidth:100,loading:x,locale:n,columns:ne,data:y,durable:O,onChange:Z,options:{sort:!1,download:!1,print:!1,search:!1,expandableRowsOnClick:!0,page:h.page-1,rowsPerPage:h.pageSize,count:h.total,...A,onRowClick:(p,{dataIndex:u})=>{F(y[u])}},title:e.jsx(We,{value:w.dateRange,onChange:re}),customButtons:ge,components:{TableFilterList:p=>e.jsx(Me,{...p,itemComponent:u=>e.jsx(Ke,{...u,canDelete:j=>j?.columnNames?.[j?.index||0]?.name==="sender"})})}})})}),k&&e.jsx(us,{refresh:we,onCancel:oe,notification:k,blocklet:b,tab:V}),e.jsx(nt,{title:`${s("common.notification")} ${s("common.setting")}`,fullWidth:!0,maxWidth:"md",open:m,onClose:()=>N(!1),PaperProps:{style:{minHeight:"500px"}},children:e.jsx(C,{sx:{mt:"-16px",overflowY:"hidden"},children:e.jsx(zt,{})})})]})}const gs=ie.div`
95
+ `;function Ce({blocklet:t=null,label:s=""}){return e.jsx(fs,{children:t?e.jsxs(e.Fragment,{children:[e.jsx(it,{size:24,blocklet:t,ancestors:t.ancestors}),e.jsx("span",{className:"name",children:t.title||t.meta?.title})]}):e.jsx("span",{className:"name",children:s})})}ht.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};function ht({list:t,label:s,onDelete:n=()=>{}}){return e.jsxs(C,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsxs(U,{children:[s,": "]}),t.map(r=>e.jsx(Fe,{size:"small",label:e.jsx(C,{sx:{display:"flex",alignItems:"center",gap:"4px"},children:e.jsx(he,{severity:r})}),onDelete:o=>n(o,r)},r))]})}function ms(t){return e.jsx(ze,{...t,renderLabel:s=>e.jsx(he,{severity:s})})}function hs({customTableButtons:t}){const{t:s,locale:n}=Q(),r=Qe(),o=At(r.breakpoints.down("sm")),l=g.useMemo(()=>Xe(r,ut()),[r]),[x,f]=g.useState(!1),{data:y,paging:h,blocklet:b,fetch:S,getComponent:B,componentDids:_,inService:R,teamDid:$}=Be(),M=g.useRef(null),[k,F]=g.useState(null),[V,G]=g.useState("info"),X=qt(),[m,N]=g.useState(!1),O=`notification-records-${b.meta?.did}`,A=_t(O),[w,L]=g.useState({pageSize:A.rowsPerPage||10,page:A.page?A.page+1:1,dids:A.dids||[],dateRange:A.dateRange||[H().subtract(1,"month").startOf("day").toDate(),H().endOf("day").toDate()]}),P=J(()=>{if(!b.children||!b.children.length)return[];const p=[];return b.children.forEach(u=>{const j=u.did||u.meta?.did;_.includes(j)&&(u.ancestors=[b],p.push(u))}),p},[_,b]),ae=async p=>{try{f(!0),await S(p),f(!1)}finally{f(!1)}};g.useEffect(()=>{ae(w)},[w]),g.useEffect(()=>{const p=y.find(u=>u.id===k?.id);k&&p&&F({...p})},[y]);const se=(p,u,j,I)=>{p.stopPropagation();const E=j.filter(T=>T!==u);L(T=>({...T,[I]:E,page:1}))},Z=({page:p,rowsPerPage:u,filterList:j})=>{const[I=[],,,,E=[]]=j;w.pageSize!==u?L(T=>({...T,pageSize:u,page:1})):w.page!==p+1?L(T=>({...T,page:p+1})):pe(w.dids,I)?pe(w.severities,E)||L(T=>({...T,severities:E,page:1})):L(T=>({...T,dids:I,page:1}))},oe=g.useCallback(()=>{F(null),G("info")},[]),we=g.useCallback(()=>{S(w)},[S,w]),ne=[{label:s("notification.from"),name:"sender",width:400,options:{filter:!0,filterType:"custom",customFilterListOptions:{render:p=>p.map((u,j)=>{if(u==="system")return e.jsx("span",{children:s("notification.system")},`system-${j}`);const I=P.find(E=>(E.did||E.meta?.did)===u);return e.jsx(Ce,{blocklet:I,label:I?.title||I?.meta?.title},u)}),update:(p,u,j)=>(p[j].splice(u,1),p)},filterOptions:{names:P,logic:(p,u)=>u.length?!u.includes(p):!1,display:(p,u,j,I)=>e.jsxs(Pe,{style:{width:"380px"},children:[e.jsx(Ot,{id:"demo-simple-select-label",style:{background:"#ffffff"},children:"Sender"}),e.jsxs(Lt,{multiple:!0,value:p[j],renderValue:E=>e.jsx(C,{style:{overflow:"hidden",textOverflow:"ellipsis"},sx:{display:"flex",gap:1,alignItems:"center"},children:E.map(T=>{if(T==="system")return e.jsx("span",{children:s("notification.system")},T);const le=P.find(i=>(i.did||i.meta?.did)===T);return e.jsx(Ce,{blocklet:le,label:le?.title||le?.meta?.title},T)})}),onChange:E=>{p[j]=E.target.value,u(p[j],j,I)},children:[e.jsx($e,{value:"system",children:s("notification.system")}),P.map(E=>{const T=E.did||E.meta?.did;return e.jsx($e,{value:T,children:e.jsx(Ce,{blocklet:E,label:E.title||E.meta?.title})},T)})]})]})},customBodyRenderLite:p=>{const u=y[p],j=B(u.componentDid);return e.jsxs(C,{sx:{display:"flex",alignItems:"center",gap:1},children:[j?e.jsx(it,{size:32,blocklet:j,ancestors:j.ancestors??[]}):e.jsx(Dt,{blocklet:b,size:32}),e.jsx(me,{maxLength:50,children:j?.meta?.title||b?.meta?.title})]})}}},{label:s("notification.receiver"),name:"receivers",width:300,options:{filter:!1,customBodyRenderLite:p=>{const u=y[p],{receivers:j}=u;return e.jsx(kt,{total:j.length,renderSurplus:I=>I<100?e.jsxs("span",{children:["+",I]}):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:I=>{I.stopPropagation(),F(u),G("receivers")},children:j.map(I=>{const{receiverUser:E}=I,T=st(E.avatar,$,R);return e.jsx(Ze,{alt:E.fullName,src:`${T}?imageFilter=resize&w=48&h=48`,size:32,did:I.receiver,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}},I.receiver)})})}}},{label:s("notification.statistics"),name:"statistics",width:400,options:{filter:!1,customBodyRenderLite:p=>{const u=y[p];return e.jsx(C,{onClick:j=>{j.stopPropagation(),F(u),G("statistics")},children:e.jsx(He,{statistics:u.statistics})})}}},{label:s("notification.notificationPreview"),name:"data",options:{filter:!1,customBodyRenderLite:p=>{const u=y[p];return e.jsx(me,{maxLength:50,children:u.title})}}},{label:s("notification.severity"),name:"severity",width:200,options:{setCellProps:()=>({className:"severity-cell"}),customBodyRenderLite:p=>{const u=y[p];return e.jsx(he,{severity:u.severity})},filter:!0,filterType:"custom",filterList:w.severities??[],customFilterListOptions:{render:p=>e.jsx(ht,{list:p,label:s("notification.severity"),onDelete:(u,j)=>{u.stopPropagation(),se(u,j,ne[4].options.filterList,"severities")}}),update:ye},filterOptions:{names:Ve,fullWidth:!0,logic:Se,display:(p,u,j,I)=>e.jsx(ms,{label:s("notification.severity"),filterList:p,onChange:u,index:j,column:I,filterValues:Ve})}}},{label:s("common.createdAt"),name:"createdAt",width:300,options:{filter:!1,customBodyRenderLite:p=>{const{createdAt:u}=y[p];return e.jsx(et,{value:u,locale:n,shouldUpdate:!0})}}}],re=p=>{L(u=>({...u,dateRange:p,page:1}))},ge=[e.jsxs(C,{sx:{display:"flex",alignItems:"center",gap:1.5},children:[e.jsx(Ft,{onClick:()=>N(!0),sx:{p:X?0:void 0},children:e.jsx(Bt,{})},"settings"),X?e.jsx(U,{children:s("common.setting")}):null]}),...t||[]];return e.jsxs(C,{ref:M,sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:[e.jsx(gs,{isBreakpointsDownSm:o,children:e.jsx(tt,{theme:l,children:e.jsx(at,{className:"main-table",verticalKeyWidth:100,loading:x,locale:n,columns:ne,data:y,durable:O,onChange:Z,options:{sort:!1,download:!1,print:!1,search:!1,expandableRowsOnClick:!0,page:h.page-1,rowsPerPage:h.pageSize,count:h.total,...A,onRowClick:(p,{dataIndex:u})=>{F(y[u])}},title:e.jsx(We,{value:w.dateRange,onChange:re}),customButtons:ge,components:{TableFilterList:p=>e.jsx(Me,{...p,itemComponent:u=>e.jsx(Ke,{...u,canDelete:j=>j?.columnNames?.[j?.index||0]?.name==="sender"})})}})})}),k&&e.jsx(us,{refresh:we,onCancel:oe,notification:k,blocklet:b,tab:V}),e.jsx(nt,{title:`${s("common.notification")} ${s("common.setting")}`,fullWidth:!0,maxWidth:"md",open:m,onClose:()=>N(!1),PaperProps:{style:{minHeight:"500px"}},children:e.jsx(C,{sx:{mt:"-16px",overflowY:"hidden"},children:e.jsx(zt,{})})})]})}const gs=ie.div`
96
96
  td.MuiTableCell-footer {
97
97
  border: none !important;
98
98
  }
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-ClxFOl_D.js","./index-UKgFVupi.js","./index-DGkT7afN.css","./url-join-cDXJRDHX.js","./index-COSOS45R.js","./_createAggregator-C9kdvL4F.js","./depsEqual-DnLesJI5.js","./index-Fv7F4t_Q.js","./index-DRYJ0xIl.js","./toUpper-DqUeOG5c.js","./index-B5LvOF-F.css"])))=>i.map(i=>d[i]);
2
- import{aF as Fe,j as t,ds as _s,gz as Ss,iw as Es,V as ce,bn as ge,K as U,ay as ve,H as G,o as x,f as gt,r as R,p as je,bE as st,b as Ce,i as Z,U as On,bD as ft,X as ye,ix as ks,t as xe,s as oe,a3 as me,aV as lo,T as le,$ as Yt,dH as mt,y as Ee,b8 as Rs,bI as Ps,aH as W,b1 as Ts,gn as Is,go as Ds,C as be,f5 as co,hv as $n,x as Bs,aw as Gt,w as Os,iy as Us,iz as Ns,v as Be,iA as Ls,Y as As,_ as Ms,iB as uo,bo as po,Q as Ne,f7 as zs,f2 as Fs,aA as qs,aB as $s,bk as Ws,aC as Hs,aD as fe,aO as Gs,cR as Ks,S as Vs,eO as ar,bi as Ys,h as Zs,dw as It,iC as Qs,f_ as fo,iD as Js,iE as Xs,ez as pe,iF as mo,dF as ei,iG as ti,ha as ni,fO as ri,iH as oi,cI as lr,hq as Wn,au as si,dI as Zt,dp as Me,bu as ii,bv as cr,z as ho,cu as ai,G as ze,aP as dr,gj as go,cv as Ke,h6 as li,bC as kt,cn as ur,hy as ci,fn as pr,bg as di,L as xt,E as xo,bm as ui,Z as pi,M as Rt,aZ as Hn,iI as fi,a_ as Le,az as fr,cP as mi,ac as it,aM as yo,bW as Gn,cA as hi,iJ as gi,b9 as xi,A as vo,aU as Un,g as yi,aS as ut,N as pn,W as vi,bF as Co,aJ as Ci,bx as bo,aR as bi,fe as mr,g6 as hr,g7 as gr,R as xr,cO as ji,g8 as wi,bV as _i,iK as Si}from"./index-UKgFVupi.js";import{y as Ei}from"./index-DaZkwaiO.js";import{a as ki,c as Ri,d as Pi,u as Kn,R as Ti}from"./actions-B8C-PCI5.js";import{S as Ii}from"./switch-control-BIC-Nwu_.js";import{u as De}from"./blocklet-B_gm4lmi.js";import{P as Nn,w as Qt}from"./permission-rweAJL4g.js";import{E as jo}from"./Edit-CW607hdk.js";import{T as Di,M as Bi,t as Oi}from"./table-icons-B9tXAbnj.js";import{s as Ui,F as wo,L as Ni,I as Li,a as Pt,S as Ai,B as Mi}from"./preference-gJ6ZF2Q4.js";import{C as yr}from"./click-to-copy-C9rtZDLS.js";import{v as fn}from"./index-DV2yUsDM.js";import{A as zi}from"./Add-bw7LExYi.js";import{A as Jt}from"./Link-D6g1Xkkg.js";import{C as Fi,c as qi,b as $i,f as _o,A as Wi,_ as Hi,a as Gi,e as Ki,d as So,s as Vi,L as Yi,u as Zi,g as Qi,S as Ji}from"./item-8U44hoCJ.js";import{T as Xi,L as ea,a as Ln,u as vr,W as ta,P as na}from"./index-aiNsIJH9.js";import{e as Eo}from"./engine-DeV5utCO.js";import{u as ra,C as oa,D as sa,a as ia,b as aa}from"./connect-to-CyrO6atx.js";import{C as la,u as ca,A as da}from"./agreement-BUveUzQO.js";import{A as ua,a as pa,b as fa,c as ma,R as ot,S as dt}from"./collapse-CXW4uktq.js";import{D as ko}from"./Done-8bsZuZu5.js";import{C as ha}from"./Google-D0deGelc.js";import{I as Ro,f as ga,a as xa,B as ya}from"./install-from-url-DsCL99L1.js";import{a as Cr}from"./api-q4yep6BX.js";import{v as Po,e as va,a as Kt}from"./util-CQwua2ce.js";import{u as To}from"./use-mobile-CMTzn3M3.js";import{A as Ca}from"./ArrowDropDown-DFxrtTfG.js";import{u as ba}from"./useLocalStorage-1RvhLwwW.js";import{r as Xt}from"./index-COSOS45R.js";import{b as en}from"./without-wallet-BW1Rplxh.js";import{E as Vn}from"./ErrorOutline-BVlSjT51.js";import{H as ja}from"./HelpOutline-B2x2uyvQ.js";import{C as wa}from"./lock.svg-B1POA68X.js";import{D as tn,R as _a,a as br}from"./url-evaluation-DuQYeVhL.js";import{L as Io}from"./Launch-BhpfIjR4.js";import{D as Sa}from"./delete-confirm-H64HwgQW.js";import{W as ht,B as An,m as Ea}from"./status-DL1Ex6i2.js";import{A as Do}from"./actions-Cd1V0QXL.js";import{v as mn}from"./index-BMTfpek5.js";import{t as ka}from"./toUpper-DqUeOG5c.js";import{S as Ra}from"./Switch-BV_bJmtO.js";import{a as Pa}from"./team-BpXTeXX3.js";import"./MoreVert-LlVBp8Yl.js";import"./get-safe-url-BdtvVcQw.js";import"./ButtonGroup-CvkZLM_A.js";import"./getValidReactChildren-BMWRE_Nn.js";import"./FilterList-BVOOp-qX.js";import"./CSSTransition-CUGJUBZa.js";import"./emotion-cache.browser.esm-F-H2n_Vz.js";import"./index-DBii9-f-.js";import"./typeof-QjJsDpFa.js";import"./raf-schd.esm-B9wpp0Qh.js";import"./redux-DfszZyTl.js";import"./useThemeProps-SIspLYj0.js";import"./html-title-BPny9upB.js";import"./Clear-TsHHhjv8.js";import"./ChevronRight-rhEdYh7r.js";import"./ChevronLeft-iV8RZK9l.js";import"./Search-DV0DmDJh.js";import"./omit-Dmt7cKLM.js";import"./edit.svg-MioFY6RL.js";import"./index-Fv7F4t_Q.js";import"./iframe-1S7jkX6i.js";import"./index-Br_vN976.js";import"./KeyboardArrowDown-BDLR_mDt.js";import"./Autocomplete-C7pwOgja.js";import"./ListSubheader-U4UKs_5o.js";import"./Verified-8SqBajcm.js";import"./VerifiedUser-Yl48fJHl.js";import"./DeleteOutline-CutnF8U7.js";import"./url-join-cDXJRDHX.js";import"./index-BojVbZw0.js";import"./spaces-C6mZH1kT.js";import"./OpenInNew-BBMfbtyT.js";import"./index-DRYJ0xIl.js";import"./index-DTKSzDFU.js";import"./decode-DPztD6kB.js";import"./cloneDeep-B_sIbdyU.js";import"./ListItemButton-DBhd8Se9.js";import"./Stepper-DHEo1TwM.js";import"./is-path-prefix-equal-Bvg8FYDR.js";const Ta=Fe(t.jsx("path",{d:"m4 12 1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8z"})),Ia=Fe(t.jsx("path",{d:"m19 8-4 4h3c0 3.31-2.69 6-6 6-1.01 0-1.97-.25-2.8-.7l-1.46 1.46C8.97 19.54 10.43 20 12 20c4.42 0 8-3.58 8-8h3zM6 12c0-3.31 2.69-6 6-6 1.01 0 1.97.25 2.8.7l1.46-1.46C15.03 4.46 13.57 4 12 4c-4.42 0-8 3.58-8 8H1l4 4 4-4z"})),Bo=Fe(t.jsx("path",{d:"M22 5.18 10.59 16.6l-4.24-4.24 1.41-1.41 2.83 2.83 10-10zm-2.21 5.04c.13.57.21 1.17.21 1.78 0 4.42-3.58 8-8 8s-8-3.58-8-8 3.58-8 8-8c1.58 0 3.04.46 4.28 1.25l1.44-1.44C16.1 2.67 14.13 2 12 2 6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10c0-1.19-.22-2.33-.6-3.39z"})),Da=Fe(t.jsx("path",{d:"M14.17 5 19 9.83V19H5V5zm0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V9.83c0-.53-.21-1.04-.59-1.41l-4.83-4.83c-.37-.38-.88-.59-1.41-.59M7 15h10v2H7zm0-4h10v2H7zm0-4h7v2H7z"})),Oo=Fe(t.jsx("path",{d:"M3 17v2h6v-2zM3 5v2h10V5zm10 16v-2h8v-2h-8v-2h-2v6zM7 9v2H3v2h4v2h2V9zm14 4v-2H11v2zm-6-4h2V7h4V5h-4V3h-2z"})),Ba=Fe(t.jsx("path",{d:"M21 10.12h-6.78l2.74-2.82c-2.73-2.7-7.15-2.8-9.88-.1-2.73 2.71-2.73 7.08 0 9.79s7.15 2.71 9.88 0C18.32 15.65 19 14.08 19 12.1h2c0 1.98-.88 4.55-2.64 6.29-3.51 3.48-9.21 3.48-12.72 0-3.5-3.47-3.53-9.11-.02-12.58s9.14-3.47 12.65 0L21 3zM12.5 8v4.25l3.5 2.08-.72 1.21L11 13V8z"})),Oa=Fe(t.jsx("path",{d:"M5 20h14v-2H5zm0-10h4v6h6v-6h4l-7-7z"})),Ua=Fe(t.jsx("path",{d:"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5M12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5m0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3"})),Na=Fe(t.jsx("path",{d:"M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7M2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2m4.31-.78 3.15 3.15.02-.16c0-1.66-1.34-3-3-3z"}));function jr(e,n){var r={};return n=_s(n),Ss(e,function(i,a,o){Es(r,a,n(i,a,o))}),r}function Uo({children:e=null,...n}){const{t:r}=ce(),{api:i}=ge(),{blocklet:a}=De(),o=a?.settings?.autoCheckUpdate,f=async l=>{await i.updateAutoCheckUpdate({input:{did:a.meta.did,autoCheckUpdate:l}})},c=async()=>{try{const l=!o?.enabled;await f({enabled:l}),G.success(r(l?"storage.spaces.autoCheckUpdate.enabled":"storage.spaces.autoCheckUpdate.disabled"))}catch(l){G.error(l.message)}},d=!!o?.enabled;return t.jsxs(U,{sx:{display:"flex",flexDirection:"row",alignItems:"center"},children:[e,t.jsx(ve,{title:r("storage.spaces.autoCheckUpdate.title"),arrow:!0,placement:"right",children:t.jsx("div",{children:t.jsx(Ii,{checked:d,onChange:c,name:"enableWelcomePage",style:{...n.style,zoom:.8}})})})]})}Uo.propTypes={children:x.any};function wr(e){function n({sx:r,...i}){return t.jsx(e,{...i,sx:{color:"text.primary",...r}})}return n}const La={...jr(Oi,wr),...jr(ki,wr)},Aa=(e,n)=>{let{description:r}=e;return(Object.values(Ce.CHAIN_PROP_MAP).includes(e.key)||Z.isEnvShareable(e))&&(r?r=`${r} (${n("blocklet.config.sharedToAllComponents")})`:r=n("blocklet.config.sharedToAllComponents")),r&&t.jsx("div",{style:{marginLeft:12},children:r})},hn=(e,n,r=[])=>!r?.length&&!e.custom&&!["CHAIN_ID","CHAIN_HOST"].includes(e.key)&&!n.meta.environments.find(i=>i.name===e.key)&&n.children.every(i=>!i.meta.environments.find(a=>a.name===e.key))?!0:e.custom,_r=e=>[Ce.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(e)?!0:!(e.startsWith("BLOCKLET_")||e.startsWith("COMPONENT_")),gn=e=>[Ce.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(e)===!1;function No({blocklet:e,ancestors:n=[]}){const r=ge(),{palette:i}=gt(),{inService:a}=r,{t:o}=R.useContext(je),f=[...n.map(s=>s.meta.did),e.meta.did],c=()=>G.success(o("blocklet.config.changedTip")),d=s=>hn(s,e,n);if(st(e.status)||e.status==="unknown"&&st(e.status))return null;const l=s=>new Promise(async(h,b)=>{if(!s.key.trim()||!s.value.trim()){G.error(o("blocklet.config.environment.keyValueRequired")),b();return}if(_r(s.key)===!1){G.error(o("blocklet.config.environment.invalidKey")),b();return}s.custom=gn(s.key);try{const P=await r.api.configBlocklet({input:{did:f,configs:[s]}});c(P.blocklet),h()}catch(P){G.error(ye(P)),b()}}),y=(s,h)=>new Promise(async(b,P)=>{if(s.required&&(!s.key.trim()||!s.value.trim())){G.error(o("blocklet.config.environment.keyValueRequired")),P();return}if(_r(s.key)===!1){G.error(o("blocklet.config.environment.invalidKey")),P();return}if(s.key===Ce.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE){const M=ks(s);if(M){G.error(M),P();return}}const k=[{...s,value:s.secure&&s.value==="__encrypted__"?"":s.value}];if(s.key!==h.key){if(!hn(s,e,n)){G.error("Only key of custom env can be changed"),P();return}k.push({key:h.key,custom:gn(s.key)})}try{const M=await r.api.configBlocklet({input:{did:f,configs:k}});c(M.blocklet),b()}catch(M){G.error(ye(M)),P()}}),p=s=>new Promise(async(h,b)=>{if(s.required){G.error(o("blocklet.config.environment.deleteForbidden")),b();return}if(!hn(s,e,n)){G.error(o("environmentTips.deleteForbidden")),b();return}try{const P=await r.api.configBlocklet({input:{did:f,configs:[{key:s.key,custom:gn(s.key)}]}});c(P.blocklet),h()}catch(P){G.error(ye(P)),b()}}),C=(e.configs||[]).filter(s=>!Ce.BLOCKLET_CONFIGURABLE_KEY[s.key]||[Ce.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(s.key)),m=Z.getSharedConfigObj(n[0],e),v=Z.getComponentMissingConfigs(e,n[0]),j=C.map(s=>({...s,value:Object.values(Ce.CHAIN_PROP_MAP).includes(s.key)&&Object.keys(m).includes(s.key)?m[s.key]:m[s.key]||s.value})),w=j.some(s=>s.key&&s.key.startsWith("BWA_")),E={onRowAdd:l,onRowUpdate:y,onRowDelete:p,isDeletable:d},u=()=>[{title:o("common.key"),field:"key",initialEditValue:"",width:"30%",render:s=>t.jsx(yr,{value:s.value,style:{color:s.required&&!s.value?i.error.main:i.text.primary,fontWeight:s.required?"bold":"normal"},children:s.key}),editComponent:s=>{const{value:h,rowData:b,onChange:P}=s;return t.jsx(Sr,{children:t.jsx(xe,{fullWidth:!0,size:"small",value:Ui.escapeTag(h),onChange:k=>P(k.target.value),variant:"outlined",label:"Key",placeholder:o("blocklet.config.environment.key"),margin:"dense",autoFocus:!0,slotProps:{input:{readOnly:d(b)===!1}}})})}},{title:o("common.value"),field:"value",initialEditValue:"",width:"calc((100% - (96px + 30%)) / 1)",render:s=>s.value?s.secure?"******":t.jsx(yr,{unstyled:!0,value:s.value,style:{wordBreak:"break-all"},children:s.value}):null,editComponent:s=>{const{value:h,rowData:b,onChange:P}=s;return t.jsxs(Sr,{children:[t.jsx(xe,{fullWidth:!0,size:"small",value:h==="__encrypted__"?"":h,onChange:k=>P(k.target.value),variant:"outlined",label:o("common.value"),placeholder:o("blocklet.config.environment.value"),margin:"dense"}),Aa(b,o)]})}}];return t.jsxs(Ma,{children:[!!v.length&&t.jsx(On,{severity:"error",style:{marginTop:24},children:o("blocklet.config.missingRequired")}),w&&t.jsx(On,{severity:"info",children:o("blocklet.config.environment.tip")}),t.jsx(Nn,{permission:a?"":"mutate_blocklets",role:a?ft:[],children:s=>t.jsx(Di,{className:"config-table",children:t.jsx(Bi,{title:t.jsx(U,{sx:{fontWeight:"bold"},children:o("common.environments")}),columns:u(),icons:La,options:{emptyRowsWhenPaging:!1,actionsColumnIndex:-1,tableLayout:"auto",maxBodyHeight:"100%",paging:!1,search:!1,actionsCellStyle:{padding:"0",textAlign:"right",width:"80px"}},localization:{header:{actions:o("common.actions")},body:{emptyDataSourceMessage:o("common.noData"),editRow:{deleteText:o("environmentTips.delete")}}},data:j,editable:s?E:{}})})})]})}No.propTypes={blocklet:x.object.isRequired,ancestors:x.array};const Ma=oe.div`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-DlRSxwJY.js","./index-l0ejZk6e.js","./index-DGkT7afN.css","./url-join-CNIVoOP5.js","./index-BD7DDM8N.js","./_createAggregator-D2uXgg5x.js","./depsEqual-CI7FeWZW.js","./index-BGAQvWoz.js","./index-DRYJ0xIl.js","./toUpper-D9lAXG2I.js","./index-B5LvOF-F.css"])))=>i.map(i=>d[i]);
2
+ import{aF as Fe,j as t,ds as _s,gA as Ss,iz as Es,V as ce,bn as ge,K as U,ay as ve,H as G,o as x,f as gt,r as R,p as je,bE as st,b as Ce,i as Z,U as On,bD as ft,X as ye,iA as ks,t as xe,s as oe,a3 as me,aV as lo,T as le,$ as Yt,dH as mt,y as Ee,b8 as Rs,bI as Ps,aH as W,b1 as Ts,go as Is,gp as Ds,C as be,f5 as co,hw as $n,x as Bs,aw as Gt,w as Os,iB as Us,iC as Ns,v as Be,iD as Ls,Y as As,_ as Ms,iE as uo,bo as po,Q as Ne,f8 as zs,f2 as Fs,aA as qs,aB as $s,bk as Ws,aC as Hs,aD as fe,aO as Gs,cR as Ks,S as Vs,eO as ar,bi as Ys,h as Zs,dw as It,iF as Qs,f$ as fo,iG as Js,iH as Xs,ez as pe,iI as mo,dF as ei,iJ as ti,hb as ni,fP as ri,iK as oi,cI as lr,hr as Wn,au as si,dI as Zt,dp as Me,bu as ii,bv as cr,z as ho,cu as ai,G as ze,aP as dr,gk as go,cv as Ke,h7 as li,bC as kt,cn as ur,hz as ci,fo as pr,bg as di,L as xt,E as xo,bm as ui,Z as pi,M as Rt,aZ as Hn,iL as fi,a_ as Le,az as fr,cP as mi,ac as it,aM as yo,bW as Gn,cA as hi,iM as gi,b9 as xi,A as vo,aU as Un,g as yi,aS as ut,N as pn,W as vi,bF as Co,aJ as Ci,bx as bo,aR as bi,ff as mr,g7 as hr,g8 as gr,R as xr,cO as ji,g9 as wi,bV as _i,iN as Si}from"./index-l0ejZk6e.js";import{y as Ei}from"./index-B1zRPZ23.js";import{a as ki,c as Ri,d as Pi,u as Kn,R as Ti}from"./actions-DOkacRyd.js";import{S as Ii}from"./switch-control-DBKg8KSu.js";import{u as De}from"./blocklet-DooKd_sI.js";import{P as Nn,w as Qt}from"./permission-CB_zs2G4.js";import{E as jo}from"./Edit-DGAlfiQv.js";import{T as Di,M as Bi,t as Oi}from"./table-icons-DfjWu9CY.js";import{s as Ui,F as wo,L as Ni,I as Li,a as Pt,S as Ai,B as Mi}from"./preference-2qHeMKaE.js";import{C as yr}from"./click-to-copy-BYLhYz_K.js";import{v as fn}from"./index-DWhhB9Hi.js";import{A as zi}from"./Add-BmZCIl-_.js";import{A as Jt}from"./Link-CQj5KcJh.js";import{C as Fi,c as qi,b as $i,f as _o,A as Wi,_ as Hi,a as Gi,e as Ki,d as So,s as Vi,L as Yi,u as Zi,g as Qi,S as Ji}from"./item-C6-NqxXS.js";import{T as Xi,L as ea,a as Ln,u as vr,W as ta,P as na}from"./index-D1rJ129A.js";import{e as Eo}from"./engine-PA5Hlqhs.js";import{u as ra,C as oa,D as sa,a as ia,b as aa}from"./connect-to-DxqW5HVH.js";import{C as la,u as ca,A as da}from"./agreement-peew__AK.js";import{A as ua,a as pa,b as fa,c as ma,R as ot,S as dt}from"./collapse-CmeTRdrT.js";import{D as ko}from"./Done-b5-rnBrk.js";import{C as ha}from"./Google-MSCLr2Nf.js";import{I as Ro,f as ga,a as xa,B as ya}from"./install-from-url-DKaI4Rhw.js";import{a as Cr}from"./api-BEwC7jzb.js";import{v as Po,e as va,a as Kt}from"./util-B5JRPt0_.js";import{u as To}from"./use-mobile-B06ZsBLv.js";import{A as Ca}from"./ArrowDropDown-DAMbspww.js";import{u as ba}from"./useLocalStorage-CaDSR1Wc.js";import{r as Xt}from"./index-BD7DDM8N.js";import{b as en}from"./without-wallet-Cq0jHe0-.js";import{E as Vn}from"./ErrorOutline-DevVxMhb.js";import{H as ja}from"./HelpOutline-DIH3coQJ.js";import{C as wa}from"./lock.svg-DIpUz3_T.js";import{D as tn,R as _a,a as br}from"./url-evaluation-DAoEPnuZ.js";import{L as Io}from"./Launch-DZ6lDDzp.js";import{D as Sa}from"./delete-confirm-B_mXlLTh.js";import{W as ht,B as An,m as Ea}from"./status-DyTELFmb.js";import{A as Do}from"./actions-BPQhtNul.js";import{v as mn}from"./index-CvM9vyEK.js";import{t as ka}from"./toUpper-D9lAXG2I.js";import{S as Ra}from"./Switch-btQlV2VF.js";import{a as Pa}from"./team-DHZ07Mee.js";import"./MoreVert-CykMlsrj.js";import"./get-safe-url-mJazyUZj.js";import"./ButtonGroup-BlhSVfK3.js";import"./getValidReactChildren-C2GpPG5h.js";import"./FilterList-tXxMVwM9.js";import"./CSSTransition-Cyc7snYy.js";import"./emotion-cache.browser.esm-CKIgFJwY.js";import"./index-DBii9-f-.js";import"./typeof-QjJsDpFa.js";import"./raf-schd.esm-gP-_XKJP.js";import"./redux-DfszZyTl.js";import"./useThemeProps-DAtqRnvX.js";import"./html-title-x1db95S1.js";import"./Clear-BoRiznJI.js";import"./ChevronRight-BLRImDEd.js";import"./ChevronLeft-B42HGuyE.js";import"./Search-BrXfrk6s.js";import"./omit-B8z6Iws2.js";import"./edit.svg-DOKf0NKv.js";import"./index-BGAQvWoz.js";import"./iframe-BBrwuPrb.js";import"./index-BDfVLYgm.js";import"./KeyboardArrowDown-DDe3llHj.js";import"./Autocomplete-kBTyvXut.js";import"./ListSubheader-BO55OpFe.js";import"./Verified-l0Y44mJl.js";import"./VerifiedUser-agBH4B6_.js";import"./DeleteOutline-_XfCv5J6.js";import"./url-join-CNIVoOP5.js";import"./index-BojVbZw0.js";import"./spaces-1p_UMor_.js";import"./OpenInNew-D8CczU9i.js";import"./index-DRYJ0xIl.js";import"./index-eIb8MZiw.js";import"./decode-DPztD6kB.js";import"./cloneDeep-F6LuuTz3.js";import"./ListItemButton-BJq_k_rp.js";import"./Stepper-Clv2yUpj.js";import"./is-path-prefix-equal-D367I16F.js";const Ta=Fe(t.jsx("path",{d:"m4 12 1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8z"})),Ia=Fe(t.jsx("path",{d:"m19 8-4 4h3c0 3.31-2.69 6-6 6-1.01 0-1.97-.25-2.8-.7l-1.46 1.46C8.97 19.54 10.43 20 12 20c4.42 0 8-3.58 8-8h3zM6 12c0-3.31 2.69-6 6-6 1.01 0 1.97.25 2.8.7l1.46-1.46C15.03 4.46 13.57 4 12 4c-4.42 0-8 3.58-8 8H1l4 4 4-4z"})),Bo=Fe(t.jsx("path",{d:"M22 5.18 10.59 16.6l-4.24-4.24 1.41-1.41 2.83 2.83 10-10zm-2.21 5.04c.13.57.21 1.17.21 1.78 0 4.42-3.58 8-8 8s-8-3.58-8-8 3.58-8 8-8c1.58 0 3.04.46 4.28 1.25l1.44-1.44C16.1 2.67 14.13 2 12 2 6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10c0-1.19-.22-2.33-.6-3.39z"})),Da=Fe(t.jsx("path",{d:"M14.17 5 19 9.83V19H5V5zm0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V9.83c0-.53-.21-1.04-.59-1.41l-4.83-4.83c-.37-.38-.88-.59-1.41-.59M7 15h10v2H7zm0-4h10v2H7zm0-4h7v2H7z"})),Oo=Fe(t.jsx("path",{d:"M3 17v2h6v-2zM3 5v2h10V5zm10 16v-2h8v-2h-8v-2h-2v6zM7 9v2H3v2h4v2h2V9zm14 4v-2H11v2zm-6-4h2V7h4V5h-4V3h-2z"})),Ba=Fe(t.jsx("path",{d:"M21 10.12h-6.78l2.74-2.82c-2.73-2.7-7.15-2.8-9.88-.1-2.73 2.71-2.73 7.08 0 9.79s7.15 2.71 9.88 0C18.32 15.65 19 14.08 19 12.1h2c0 1.98-.88 4.55-2.64 6.29-3.51 3.48-9.21 3.48-12.72 0-3.5-3.47-3.53-9.11-.02-12.58s9.14-3.47 12.65 0L21 3zM12.5 8v4.25l3.5 2.08-.72 1.21L11 13V8z"})),Oa=Fe(t.jsx("path",{d:"M5 20h14v-2H5zm0-10h4v6h6v-6h4l-7-7z"})),Ua=Fe(t.jsx("path",{d:"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5M12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5m0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3"})),Na=Fe(t.jsx("path",{d:"M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7M2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2m4.31-.78 3.15 3.15.02-.16c0-1.66-1.34-3-3-3z"}));function jr(e,n){var r={};return n=_s(n),Ss(e,function(i,a,o){Es(r,a,n(i,a,o))}),r}function Uo({children:e=null,...n}){const{t:r}=ce(),{api:i}=ge(),{blocklet:a}=De(),o=a?.settings?.autoCheckUpdate,f=async l=>{await i.updateAutoCheckUpdate({input:{did:a.meta.did,autoCheckUpdate:l}})},c=async()=>{try{const l=!o?.enabled;await f({enabled:l}),G.success(r(l?"storage.spaces.autoCheckUpdate.enabled":"storage.spaces.autoCheckUpdate.disabled"))}catch(l){G.error(l.message)}},d=!!o?.enabled;return t.jsxs(U,{sx:{display:"flex",flexDirection:"row",alignItems:"center"},children:[e,t.jsx(ve,{title:r("storage.spaces.autoCheckUpdate.title"),arrow:!0,placement:"right",children:t.jsx("div",{children:t.jsx(Ii,{checked:d,onChange:c,name:"enableWelcomePage",style:{...n.style,zoom:.8}})})})]})}Uo.propTypes={children:x.any};function wr(e){function n({sx:r,...i}){return t.jsx(e,{...i,sx:{color:"text.primary",...r}})}return n}const La={...jr(Oi,wr),...jr(ki,wr)},Aa=(e,n)=>{let{description:r}=e;return(Object.values(Ce.CHAIN_PROP_MAP).includes(e.key)||Z.isEnvShareable(e))&&(r?r=`${r} (${n("blocklet.config.sharedToAllComponents")})`:r=n("blocklet.config.sharedToAllComponents")),r&&t.jsx("div",{style:{marginLeft:12},children:r})},hn=(e,n,r=[])=>!r?.length&&!e.custom&&!["CHAIN_ID","CHAIN_HOST"].includes(e.key)&&!n.meta.environments.find(i=>i.name===e.key)&&n.children.every(i=>!i.meta.environments.find(a=>a.name===e.key))?!0:e.custom,_r=e=>[Ce.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(e)?!0:!(e.startsWith("BLOCKLET_")||e.startsWith("COMPONENT_")),gn=e=>[Ce.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(e)===!1;function No({blocklet:e,ancestors:n=[]}){const r=ge(),{palette:i}=gt(),{inService:a}=r,{t:o}=R.useContext(je),f=[...n.map(s=>s.meta.did),e.meta.did],c=()=>G.success(o("blocklet.config.changedTip")),d=s=>hn(s,e,n);if(st(e.status)||e.status==="unknown"&&st(e.status))return null;const l=s=>new Promise(async(h,b)=>{if(!s.key.trim()||!s.value.trim()){G.error(o("blocklet.config.environment.keyValueRequired")),b();return}if(_r(s.key)===!1){G.error(o("blocklet.config.environment.invalidKey")),b();return}s.custom=gn(s.key);try{const P=await r.api.configBlocklet({input:{did:f,configs:[s]}});c(P.blocklet),h()}catch(P){G.error(ye(P)),b()}}),y=(s,h)=>new Promise(async(b,P)=>{if(s.required&&(!s.key.trim()||!s.value.trim())){G.error(o("blocklet.config.environment.keyValueRequired")),P();return}if(_r(s.key)===!1){G.error(o("blocklet.config.environment.invalidKey")),P();return}if(s.key===Ce.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE){const M=ks(s);if(M){G.error(M),P();return}}const k=[{...s,value:s.secure&&s.value==="__encrypted__"?"":s.value}];if(s.key!==h.key){if(!hn(s,e,n)){G.error("Only key of custom env can be changed"),P();return}k.push({key:h.key,custom:gn(s.key)})}try{const M=await r.api.configBlocklet({input:{did:f,configs:k}});c(M.blocklet),b()}catch(M){G.error(ye(M)),P()}}),p=s=>new Promise(async(h,b)=>{if(s.required){G.error(o("blocklet.config.environment.deleteForbidden")),b();return}if(!hn(s,e,n)){G.error(o("environmentTips.deleteForbidden")),b();return}try{const P=await r.api.configBlocklet({input:{did:f,configs:[{key:s.key,custom:gn(s.key)}]}});c(P.blocklet),h()}catch(P){G.error(ye(P)),b()}}),C=(e.configs||[]).filter(s=>!Ce.BLOCKLET_CONFIGURABLE_KEY[s.key]||[Ce.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(s.key)),m=Z.getSharedConfigObj(n[0],e),v=Z.getComponentMissingConfigs(e,n[0]),j=C.map(s=>({...s,value:Object.values(Ce.CHAIN_PROP_MAP).includes(s.key)&&Object.keys(m).includes(s.key)?m[s.key]:m[s.key]||s.value})),w=j.some(s=>s.key&&s.key.startsWith("BWA_")),E={onRowAdd:l,onRowUpdate:y,onRowDelete:p,isDeletable:d},u=()=>[{title:o("common.key"),field:"key",initialEditValue:"",width:"30%",render:s=>t.jsx(yr,{value:s.value,style:{color:s.required&&!s.value?i.error.main:i.text.primary,fontWeight:s.required?"bold":"normal"},children:s.key}),editComponent:s=>{const{value:h,rowData:b,onChange:P}=s;return t.jsx(Sr,{children:t.jsx(xe,{fullWidth:!0,size:"small",value:Ui.escapeTag(h),onChange:k=>P(k.target.value),variant:"outlined",label:"Key",placeholder:o("blocklet.config.environment.key"),margin:"dense",autoFocus:!0,slotProps:{input:{readOnly:d(b)===!1}}})})}},{title:o("common.value"),field:"value",initialEditValue:"",width:"calc((100% - (96px + 30%)) / 1)",render:s=>s.value?s.secure?"******":t.jsx(yr,{unstyled:!0,value:s.value,style:{wordBreak:"break-all"},children:s.value}):null,editComponent:s=>{const{value:h,rowData:b,onChange:P}=s;return t.jsxs(Sr,{children:[t.jsx(xe,{fullWidth:!0,size:"small",value:h==="__encrypted__"?"":h,onChange:k=>P(k.target.value),variant:"outlined",label:o("common.value"),placeholder:o("blocklet.config.environment.value"),margin:"dense"}),Aa(b,o)]})}}];return t.jsxs(Ma,{children:[!!v.length&&t.jsx(On,{severity:"error",style:{marginTop:24},children:o("blocklet.config.missingRequired")}),w&&t.jsx(On,{severity:"info",children:o("blocklet.config.environment.tip")}),t.jsx(Nn,{permission:a?"":"mutate_blocklets",role:a?ft:[],children:s=>t.jsx(Di,{className:"config-table",children:t.jsx(Bi,{title:t.jsx(U,{sx:{fontWeight:"bold"},children:o("common.environments")}),columns:u(),icons:La,options:{emptyRowsWhenPaging:!1,actionsColumnIndex:-1,tableLayout:"auto",maxBodyHeight:"100%",paging:!1,search:!1,actionsCellStyle:{padding:"0",textAlign:"right",width:"80px"}},localization:{header:{actions:o("common.actions")},body:{emptyDataSourceMessage:o("common.noData"),editRow:{deleteText:o("environmentTips.delete")}}},data:j,editable:s?E:{}})})})]})}No.propTypes={blocklet:x.object.isRequired,ancestors:x.array};const Ma=oe.div`
3
3
  .config-table {
4
4
  margin-bottom: 24px;
5
5
  position: relative;
@@ -66,7 +66,7 @@ import{aF as Fe,j as t,ds as _s,gz as Ss,iw as Es,V as ce,bn as ge,K as U,ay as
66
66
  .ux-dialog_closeButton {
67
67
  margin: 0;
68
68
  }
69
- `,Fa=R.lazy(()=>Ps(()=>import("./index-ClxFOl_D.js").then(e=>e.i),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10]),import.meta.url).then(e=>({default:e.Uploader}))),qa="/blocklet/component/upload",Er=[".html",".htm",".tgz",".zip"],$a=Number(window.env?.MAX_UPLOAD_FILE_SIZE)||W.MAX_UPLOAD_FILE_SIZE,Wa=$a*1024*1024;function Lo({did:e,prefix:n,headers:r=()=>({}),onUploaded:i=mt,open:a=!1,onClose:o=mt}){const{t:f,locale:c}=ce(),d=R.useRef(null),l=R.useCallback(y=>{const{status:p,data:C}=y;if(p===200){i(C);return}G.error(f("blocklet.component.addComponentTip.uploadFailed"))},[i,f]);return R.useEffect(()=>{a?d.current?.open():d.current?.close()},[a]),t.jsx(Ha,{id:`component-uploader-${e}`,children:t.jsx(Fa,{ref:d,locale:c,popup:!0,onUploadFinish:l,plugins:[],onClose:o,installerProps:{disabled:!0},apiPathProps:{uploader:Ee(n,qa,e),disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:Er,maxFileSize:Wa,maxNumberOfFiles:1}},tusProps:{headers:r},dashboardProps:{note:f("blocklet.component.addComponentTip.allowedFileTypes",{types:Er.map(y=>y.replace(".","")).join(", ")})}})},`component-uploader-${e}`)}Lo.propTypes={did:x.string.isRequired,prefix:x.string.isRequired,open:x.bool,headers:x.func,onUploaded:x.func,onClose:x.func};const Ha=Rs(U)`
69
+ `,Fa=R.lazy(()=>Ps(()=>import("./index-DlRSxwJY.js").then(e=>e.i),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10]),import.meta.url).then(e=>({default:e.Uploader}))),qa="/blocklet/component/upload",Er=[".html",".htm",".tgz",".zip"],$a=Number(window.env?.MAX_UPLOAD_FILE_SIZE)||W.MAX_UPLOAD_FILE_SIZE,Wa=$a*1024*1024;function Lo({did:e,prefix:n,headers:r=()=>({}),onUploaded:i=mt,open:a=!1,onClose:o=mt}){const{t:f,locale:c}=ce(),d=R.useRef(null),l=R.useCallback(y=>{const{status:p,data:C}=y;if(p===200){i(C);return}G.error(f("blocklet.component.addComponentTip.uploadFailed"))},[i,f]);return R.useEffect(()=>{a?d.current?.open():d.current?.close()},[a]),t.jsx(Ha,{id:`component-uploader-${e}`,children:t.jsx(Fa,{ref:d,locale:c,popup:!0,onUploadFinish:l,plugins:[],onClose:o,installerProps:{disabled:!0},apiPathProps:{uploader:Ee(n,qa,e),disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:Er,maxFileSize:Wa,maxNumberOfFiles:1}},tusProps:{headers:r},dashboardProps:{note:f("blocklet.component.addComponentTip.allowedFileTypes",{types:Er.map(y=>y.replace(".","")).join(", ")})}})},`component-uploader-${e}`)}Lo.propTypes={did:x.string.isRequired,prefix:x.string.isRequired,open:x.bool,headers:x.func,onUploaded:x.func,onClose:x.func};const Ha=Rs(U)`
70
70
  .uploader-wrapper {
71
71
  display: inline-flex;
72
72
  position: relative;
@@ -1,4 +1,4 @@
1
- import{u as k,j as o,C as N,ax as W,cX as b,A as U,V as E,cM as _,r,aW as D,h as d,y as x,ak as P,ae as R,w as O,aH as A,x as $,aw as H,bA as K,s as M}from"./index-UKgFVupi.js";import{I as V}from"./invitation-tfEd0Lsr.js";import"./index-CapJ9GZ2.js";import"./index-CxOhjmog.js";import"./emotion-cache.browser.esm-F-H2n_Vz.js";import"./sdk-CXtYA3ry.js";import"./wrap-locale-BOO0hut3.js";import"./index-GpQ_N20f.js";function X(h){const{api:i,session:p}=W(),{info:s}=k(),c=b(),v=U(),{t:l,locale:m}=E(),{encryptKey:y,decrypt:C}=_(),[I,g]=r.useState(!1),f=r.useMemo(()=>new URLSearchParams(c.search).get("inviteId"),[c]),a=D(async()=>{if(!f)return null;let e;const{data:n}=await i.get("/api/invitation",{params:{inviteId:f}}),t=!!d(s,"ownerNft.did")&&n.role.name==="owner";if(t){const u=new URL(window.location.href);u.pathname=x(P(),"/api/did/invite/token"),u.searchParams.set("_ek_",y),u.searchParams.set("inviteId",f);const{data:F}=await i.get(u.href);e=F}return{invitation:n,nextWorkflow:e,needReceiveNFT:t}}),L=r.useCallback(()=>{g(!0)},[]),S=r.useCallback(()=>{if(a.error)throw a.error;return a.value.invitation},[a]),w=r.useCallback(async e=>{e&&(Object.prototype.hasOwnProperty.call(e,"encrypted")&&!e.encrypted?R(e.sessionToken):R(C(e.sessionToken)));const n=new URLSearchParams(c.search);n.delete("inviteId");const t=n.toString();await p.refresh(),v(`/${t&&`?${t}`}`,{replace:!0})},[c,v,p]);if(a.loading)return o.jsx(N,{});const T=()=>{const e=new URL(window.location.href);e.pathname=x(P(),"/api/did/invite/status"),e.searchParams.set("_t_",a.value.nextWorkflow.token),e.searchParams.set("locale",m);const n=setInterval(async()=>{const{data:t}=await i.get(e.href);t.status==="succeed"&&(clearInterval(n),p.updateConnectedInfo(t),w(t))},2e3)},j=()=>{g(!1)};return o.jsxs(z,{className:"page-invite",children:[d(a,"value.needReceiveNFT")&&o.jsx(O,{action:"login",popup:!0,className:"connect",open:I,locale:m,baseUrl:s.launcher.url,checkFn:H.create({baseURL:s.launcher.url}).get,onSuccess:T,onClose:j,checkTimeout:5*60*1e3,webWalletUrl:$(s),extraParams:{nw:d(a,"value.nextWorkflow.url")},messages:{title:l("invite.transferNFTDialog.title",{name:s.name}),scan:l("invite.transferNFTDialog.scan"),confirm:l("invite.transferNFTDialog.confirm"),success:l("invite.transferNFTDialog.success")},prefix:`${A.WELLKNOWN_SERVICE_PATH_PREFIX}/api/did`}),o.jsx(V,{...h,getDataFn:S,createPassportSvg:e=>K(e,s),checkFn:i.get,onLoginSuccess:w,passportColor:"default",onReceive:d(a,"value.needReceiveNFT")?L:null})]})}const z=M.div`
1
+ import{u as k,j as o,C as N,ax as W,cX as b,A as U,V as E,cM as _,r,aW as D,h as d,y as x,ak as P,ae as R,w as O,aH as A,x as $,aw as H,bA as K,s as M}from"./index-l0ejZk6e.js";import{I as V}from"./invitation-BP2qXMkU.js";import"./index-Bge0nxkS.js";import"./index-sHP8LVQG.js";import"./emotion-cache.browser.esm-CKIgFJwY.js";import"./sdk-D_BY3a8P.js";import"./wrap-locale-fe2iWyZX.js";import"./index-DSwwhtGQ.js";function X(h){const{api:i,session:p}=W(),{info:s}=k(),c=b(),v=U(),{t:l,locale:m}=E(),{encryptKey:y,decrypt:C}=_(),[I,g]=r.useState(!1),f=r.useMemo(()=>new URLSearchParams(c.search).get("inviteId"),[c]),a=D(async()=>{if(!f)return null;let e;const{data:n}=await i.get("/api/invitation",{params:{inviteId:f}}),t=!!d(s,"ownerNft.did")&&n.role.name==="owner";if(t){const u=new URL(window.location.href);u.pathname=x(P(),"/api/did/invite/token"),u.searchParams.set("_ek_",y),u.searchParams.set("inviteId",f);const{data:F}=await i.get(u.href);e=F}return{invitation:n,nextWorkflow:e,needReceiveNFT:t}}),L=r.useCallback(()=>{g(!0)},[]),S=r.useCallback(()=>{if(a.error)throw a.error;return a.value.invitation},[a]),w=r.useCallback(async e=>{e&&(Object.prototype.hasOwnProperty.call(e,"encrypted")&&!e.encrypted?R(e.sessionToken):R(C(e.sessionToken)));const n=new URLSearchParams(c.search);n.delete("inviteId");const t=n.toString();await p.refresh(),v(`/${t&&`?${t}`}`,{replace:!0})},[c,v,p]);if(a.loading)return o.jsx(N,{});const T=()=>{const e=new URL(window.location.href);e.pathname=x(P(),"/api/did/invite/status"),e.searchParams.set("_t_",a.value.nextWorkflow.token),e.searchParams.set("locale",m);const n=setInterval(async()=>{const{data:t}=await i.get(e.href);t.status==="succeed"&&(clearInterval(n),p.updateConnectedInfo(t),w(t))},2e3)},j=()=>{g(!1)};return o.jsxs(z,{className:"page-invite",children:[d(a,"value.needReceiveNFT")&&o.jsx(O,{action:"login",popup:!0,className:"connect",open:I,locale:m,baseUrl:s.launcher.url,checkFn:H.create({baseURL:s.launcher.url}).get,onSuccess:T,onClose:j,checkTimeout:5*60*1e3,webWalletUrl:$(s),extraParams:{nw:d(a,"value.nextWorkflow.url")},messages:{title:l("invite.transferNFTDialog.title",{name:s.name}),scan:l("invite.transferNFTDialog.scan"),confirm:l("invite.transferNFTDialog.confirm"),success:l("invite.transferNFTDialog.success")},prefix:`${A.WELLKNOWN_SERVICE_PATH_PREFIX}/api/did`}),o.jsx(V,{...h,getDataFn:S,createPassportSvg:e=>K(e,s),checkFn:i.get,onLoginSuccess:w,passportColor:"default",onReceive:d(a,"value.needReceiveNFT")?L:null})]})}const z=M.div`
2
2
  width: 100vw;
3
3
  height: 100%;
4
4
  min-height: 100vh;