@abtnode/blocklet-services 1.16.41-beta-20250318-123609-b48bb2d7 → 1.16.41-beta-20250319-034744-5c62f533

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 (148) hide show
  1. package/api/libs/open-graph/index.js +21 -11
  2. package/api/libs/open-graph/template.js +42 -2
  3. package/api/services/auth/connect/receive-transfer-app-owner.js +15 -3
  4. package/dist/assets/{ArrowDropDown-Do4OWmCn.js → ArrowDropDown-ydRfHJ2x.js} +1 -1
  5. package/dist/assets/{CheckCircle-DDHElFhm.js → CheckCircle-DgSwRUf8.js} +1 -1
  6. package/dist/assets/{ChevronLeft-CLfrYODg.js → ChevronLeft-CqDoHwdJ.js} +1 -1
  7. package/dist/assets/{ChevronRight-OJJ2SUEU.js → ChevronRight-Bpkf9aqI.js} +1 -1
  8. package/dist/assets/{DeleteOutline-C954mj84.js → DeleteOutline-D4DYIaUj.js} +1 -1
  9. package/dist/assets/{Done-BXwXbLQs.js → Done-B8c93MpP.js} +1 -1
  10. package/dist/assets/{Download-OmIe8_8C.js → Download-DANYdeZR.js} +1 -1
  11. package/dist/assets/{Error-CXMTbOyQ.js → Error-wKO1hXtU.js} +1 -1
  12. package/dist/assets/{ExpandLess-xJAJmJam.js → ExpandLess-BqrBuxL9.js} +1 -1
  13. package/dist/assets/{Google-jC4aGgA_.js → Google-CBPWeaVC.js} +4 -4
  14. package/dist/assets/{InfoOutlined-Dto4CBtr.js → InfoOutlined-HP5LuELQ.js} +1 -1
  15. package/dist/assets/{Launch-Do09YVNX.js → Launch-XvyEoGhF.js} +1 -1
  16. package/dist/assets/{LaunchOutlined-DyT6-6Gt.js → LaunchOutlined-BfbVRiJT.js} +1 -1
  17. package/dist/assets/{MoreHoriz-CU3bPiks.js → MoreHoriz-Cv3BqpRU.js} +1 -1
  18. package/dist/assets/{PlayArrow-DsdnOq2p.js → PlayArrow-DI84Lay5.js} +1 -1
  19. package/dist/assets/{ViewList-B2mYqtoR.js → ViewList-DLzG9ldE.js} +1 -1
  20. package/dist/assets/{access-control-BWBOA4g6.js → access-control-DyHt8ppX.js} +1 -1
  21. package/dist/assets/{actions-4OuC0GHy.js → actions-CBPbCBQc.js} +1 -1
  22. package/dist/assets/add-component-core-DOdhiJes.js +765 -0
  23. package/dist/assets/add-resource-CGPM0kPR.js +1 -0
  24. package/dist/assets/{addon-D4YcNftH.js → addon-bbJfiLal.js} +1 -1
  25. package/dist/assets/{analytics-BZzzJZSo.js → analytics-BRjS4mY-.js} +1 -1
  26. package/dist/assets/api-CvDkueg1.js +1 -0
  27. package/dist/assets/{ar-BVbwKJY8.js → ar-A7PXaQSB.js} +1 -1
  28. package/dist/assets/{audit-logs-JO59CyGM.js → audit-logs-D1W37Cj4.js} +1 -1
  29. package/dist/assets/{base32-BjPUfmet.js → base32-gJJTbpiB.js} +1 -1
  30. package/dist/assets/{branding-CR1e2n6E.js → branding-DR3Jnq-d.js} +2 -2
  31. package/dist/assets/{bundle-avatar-Chdo4m6E.js → bundle-avatar-Eqwd2qUG.js} +1 -1
  32. package/dist/assets/{button-BSP6Y6OJ.js → button-BqyvGZC-.js} +1 -1
  33. package/dist/assets/{click-to-copy-fQS5t8fq.js → click-to-copy-Dc16fHKA.js} +1 -1
  34. package/dist/assets/{complete--VG1kQVy.js → complete-BzSPyjUA.js} +1 -1
  35. package/dist/assets/{component-DfQn7Awf.js → component--_f-xKi7.js} +1 -1
  36. package/dist/assets/{config-C-1jeE31.js → config-BDpdqYom.js} +1 -1
  37. package/dist/assets/{config-mzUmZpxy.js → config-C3tQWDAE.js} +1 -1
  38. package/dist/assets/config-navigation-BrXS6Zm4.js +29 -0
  39. package/dist/assets/{config-space-6wpekLZ1.js → config-space-BZu4nd7t.js} +1 -1
  40. package/dist/assets/{confirm-CVR4a5FI.js → confirm-CCmbVvGp.js} +1 -1
  41. package/dist/assets/{connect-DG6frz_Q.js → connect-Bgm2clKz.js} +1 -1
  42. package/dist/assets/{connect-D_mrUgoL.js → connect-C1EdscR7.js} +1 -1
  43. package/dist/assets/{connect-to-BhxyRPHq.js → connect-to-CAjdR1Vi.js} +1 -1
  44. package/dist/assets/{dashboard-DE28EHHN.js → dashboard-C2dbiNOp.js} +3 -3
  45. package/dist/assets/{de-nWUnqN3q.js → de-DQLOqs4x.js} +1 -1
  46. package/dist/assets/{delete-confirm-CCY-Xpk5.js → delete-confirm-CVo1ye7X.js} +1 -1
  47. package/dist/assets/{did-address-Dx-4WAXQ.js → did-address-DIKoCoBp.js} +1 -1
  48. package/dist/assets/{domain-DHb1Ps_o.js → domain-BQkRhwGe.js} +1 -1
  49. package/dist/assets/{domain-action-card-BNfDBQhX.js → domain-action-card-Dlgq4rsm.js} +1 -1
  50. package/dist/assets/domains-DaOwHgX-.js +1 -0
  51. package/dist/assets/{email-B20szkwm.js → email-BHF0jLjs.js} +1 -1
  52. package/dist/assets/{es-C7damQG2.js → es-Wyib4tkS.js} +1 -1
  53. package/dist/assets/{exchange-passport-DbZWgurv.js → exchange-passport-C6TpmUyM.js} +1 -1
  54. package/dist/assets/{form-text-input-BTiyCo4F.js → form-text-input-C8x5debf.js} +1 -1
  55. package/dist/assets/{fr-D3MUmftb.js → fr-CTdi8lPh.js} +1 -1
  56. package/dist/assets/{fuel-SLm_JOs-.js → fuel-DQMzXBHQ.js} +1 -1
  57. package/dist/assets/{fullpage-50xw6Dda.js → fullpage-kiX9qo3H.js} +1 -1
  58. package/dist/assets/{get-safe-url-C42wIqi-.js → get-safe-url-BvS0hy8W.js} +1 -1
  59. package/dist/assets/{get-safe-url-Cn4KEro2.js → get-safe-url-CXJBjnNj.js} +1 -1
  60. package/dist/assets/{hi-DLH2NuCr.js → hi-Dk3MVpw6.js} +1 -1
  61. package/dist/assets/{home-CUlFLl78.js → home-CfRR-l78.js} +1 -1
  62. package/dist/assets/{id-C_OpwsKG.js → id-BqyOVEFD.js} +1 -1
  63. package/dist/assets/{iframe-BfxIVBTL.js → iframe-C0FAfo1V.js} +1 -1
  64. package/dist/assets/{index-CKGdCheG.js → index-BL64rJ3g.js} +1 -1
  65. package/dist/assets/{index-DNxvGCUa.js → index-BVjGveR4.js} +1 -1
  66. package/dist/assets/{index-xfe9Dcxz.js → index-BsMTGy4m.js} +1 -1
  67. package/dist/assets/{index-DOilqSvA.js → index-Bv_udrJr.js} +1 -1
  68. package/dist/assets/{index-Do_PTy2g.js → index-CYdNDqQ1.js} +8 -8
  69. package/dist/assets/{index-CbiypPHS.js → index-CmyG8bip.js} +1 -1
  70. package/dist/assets/{index-mkd7rmEP.js → index-D2qwAqco.js} +1 -1
  71. package/dist/assets/{index-F9fg_Rq5.js → index-D5rqbUOM.js} +1 -1
  72. package/dist/assets/{index-CPUTxynZ.js → index-D8WxMgot.js} +14 -14
  73. package/dist/assets/{index-D3BxoukB.js → index-DJJGXGi6.js} +1 -1
  74. package/dist/assets/{index-D_zMGAKU.js → index-DQKEK30u.js} +1 -1
  75. package/dist/assets/{index-BFV3n5Hy.js → index-Dal_0cM6.js} +1 -1
  76. package/dist/assets/{index-CyTMvqg2.js → index-Db8S8FOW.js} +1 -1
  77. package/dist/assets/{index-B6Y7SW3z.js → index-DojJOk-8.js} +1 -1
  78. package/dist/assets/index-Dv43WFu_.js +220 -0
  79. package/dist/assets/{index-DI6dvNrm.js → index-Hc4fe8tE.js} +1 -1
  80. package/dist/assets/{index-BCtCJuih.js → index-KP4WZslk.js} +1 -1
  81. package/dist/assets/{invitation-BuB1-TxL.js → invitation-CDtK_Uyv.js} +1 -1
  82. package/dist/assets/{invite-C8_Fxnwn.js → invite-DSQnWK9o.js} +1 -1
  83. package/dist/assets/{issue-passport-BjcOuQDv.js → issue-passport-Bb_7kKPQ.js} +1 -1
  84. package/dist/assets/{item-3tNefK7M.js → item-C1U0HVPR.js} +1 -1
  85. package/dist/assets/{ja-rh-7J19i.js → ja-BIiN349J.js} +1 -1
  86. package/dist/assets/{ko-DxXSLIu1.js → ko-D9z_sjE3.js} +1 -1
  87. package/dist/assets/{layout-ceT4Awul.js → layout-Bkn9nC3f.js} +1 -1
  88. package/dist/assets/{list-BaQMMWrO.js → list-BIXoIHH2.js} +2 -1
  89. package/dist/assets/localization-Cf41fenL.js +1 -0
  90. package/dist/assets/{log-CNHqg8uo.js → log-CuiY798z.js} +1 -1
  91. package/dist/assets/{login-DXKAfWij.js → login-Ds2aHi-M.js} +1 -1
  92. package/dist/assets/{login-oauth-callback-20hVf_bH.js → login-oauth-callback-DAKHXtVv.js} +1 -1
  93. package/dist/assets/{logo-uploader-Dh1aL_OF.js → logo-uploader-DQCS5qZW.js} +3 -3
  94. package/dist/assets/{lost-passport-CZEU6dJY.js → lost-passport-DdbK0_Yc.js} +1 -1
  95. package/dist/assets/{omit-BySqlv7K.js → omit-DVwO9e3E.js} +1 -1
  96. package/dist/assets/{open-window-D4nELhWH.js → open-window-yeboX1Ru.js} +1 -1
  97. package/dist/assets/{overview-xXsfHZEs.js → overview-DFNGZZos.js} +1 -1
  98. package/dist/assets/{page-header-C2MPWR-H.js → page-header-DyeTxe1U.js} +1 -1
  99. package/dist/assets/{permission-DXzAY72t.js → permission-ZvUR5Tj-.js} +1 -1
  100. package/dist/assets/{preferences-D2Jg5k10.js → preferences-Dx29Tgc2.js} +1 -1
  101. package/dist/assets/{profile-embed-BDQR5OIg.js → profile-embed-C_yYlnVt.js} +1 -1
  102. package/dist/assets/{pt-q0ZSfFth.js → pt-DbNy95wU.js} +1 -1
  103. package/dist/assets/publish-resource-CPSJ7Gd2.js +1 -0
  104. package/dist/assets/{react-beautiful-dnd.esm-Z01y4hUy.js → react-beautiful-dnd.esm-DcDZ_Ghe.js} +1 -1
  105. package/dist/assets/{relative-time-wZZM9yTU.js → relative-time-xM8Zc84I.js} +1 -1
  106. package/dist/assets/{ru-CK3mPXUk.js → ru-BEliZjDL.js} +1 -1
  107. package/dist/assets/sdk-CVa22Xgm.js +1 -0
  108. package/dist/assets/{session-BcGa2Lwu.js → session-CD9NaM-v.js} +1 -1
  109. package/dist/assets/setup-CkUck5w6.js +19 -0
  110. package/dist/assets/{start-nMBbzJog.js → start-CRCAeTDI.js} +1 -1
  111. package/dist/assets/{status-CW8cLZwc.js → status-D8ugfvVU.js} +1 -1
  112. package/dist/assets/{step-actions-D4sVdJ5W.js → step-actions-C83ykph7.js} +1 -1
  113. package/dist/assets/{studio-oozJB1Q3.js → studio-Cb_GlvSi.js} +1 -1
  114. package/dist/assets/{switch-control-G4nR-MQG.js → switch-control-CJ1duVKM.js} +1 -1
  115. package/dist/assets/{th-DBezSIJU.js → th-KPXdcBJ0.js} +1 -1
  116. package/dist/assets/{traffic-ChHSyQUx.js → traffic-DjeUj5sV.js} +1 -1
  117. package/dist/assets/{transfer-AGCuXVp7.js → transfer-B_MO7Mf7.js} +1 -1
  118. package/dist/assets/{unsubscribe-D2HmFcyp.js → unsubscribe-ajBobtwD.js} +1 -1
  119. package/dist/assets/{useAsync-CDzQ0uN6.js → useAsync-D2OhgEkV.js} +1 -1
  120. package/dist/assets/{useAsyncRetry-CcF3e_P6.js → useAsyncRetry-CEJwVPZ6.js} +1 -1
  121. package/dist/assets/{useLocalStorage-Nwt6lPBi.js → useLocalStorage-CtbpqE0c.js} +1 -1
  122. package/dist/assets/{user-center-Q-dkmQTy.js → user-center-D62gRjAl.js} +1 -1
  123. package/dist/assets/{util-DfhJqpch.js → util-CohOBosL.js} +1 -1
  124. package/dist/assets/{util-ChHwCleX.js → util-CzgwETtC.js} +1 -1
  125. package/dist/assets/{vendor-arcblock-BkdpkIRL.js → vendor-arcblock-E5QJEgSK.js} +1 -1
  126. package/dist/assets/{vendor-hooks-DbRTDIFw.js → vendor-hooks-CYyfK9g3.js} +1 -1
  127. package/dist/assets/{vendor-utils-DJ1bmiuG.js → vendor-utils-CbeKtci8.js} +1 -1
  128. package/dist/assets/{vendor-ux-did-connect-BUS40ceY.js → vendor-ux-did-connect-D75Zatzm.js} +44 -44
  129. package/dist/assets/{vi-hjA0ec5w.js → vi-ChkGdSKU.js} +1 -1
  130. package/dist/assets/wrap-locale-lZatlhee.js +1 -0
  131. package/dist/assets/{zh-BIwal6DF.js → zh-DDAGRLEd.js} +1 -1
  132. package/dist/assets/{zh-tw-Bj9DYpoo.js → zh-tw-DIWT2k6_.js} +1 -1
  133. package/dist/images/banner.png +0 -0
  134. package/dist/index.html +5 -5
  135. package/dist/service-worker.js +1 -1
  136. package/package.json +28 -28
  137. package/dist/assets/add-component-core-BJzkE6_k.js +0 -765
  138. package/dist/assets/add-resource-CFUb5VgO.js +0 -1
  139. package/dist/assets/api-D2GjOmnt.js +0 -1
  140. package/dist/assets/cloneDeep-SKWOTeUJ.js +0 -1
  141. package/dist/assets/config-navigation-Dm_JpS-L.js +0 -26
  142. package/dist/assets/domains-CO5BsFN8.js +0 -1
  143. package/dist/assets/index-Bm1Z6vIr.js +0 -220
  144. package/dist/assets/localization-UtRmFKb1.js +0 -1
  145. package/dist/assets/publish-resource-DDV8cXFW.js +0 -1
  146. package/dist/assets/sdk-msG4TyIo.js +0 -1
  147. package/dist/assets/setup-C9iZjtRd.js +0 -19
  148. package/dist/assets/wrap-locale-DnXm9Rv3.js +0 -1
@@ -1,4 +1,4 @@
1
- import{r as U,e as Tt,g as Dn,a as Xe,f as Ma}from"./vendor-react-DoD83n6N.js";import{a1 as Y,j as h,E as H,a9 as kr,P as Ca,b$ as ps,bP as Sa,M as Q,a3 as F,A as En,I as Ge,a2 as _t,bl as ji,x as Ke,T as at,bn as ue,bO as Gt,br as ka,ac as Oa,ad as dt,K as Ri,ak as Nr,bd as bt,bo as it,bj as ae,c0 as $a,e as Yt,Z as Mi,a4 as Ve,c1 as Pa,c2 as Ta,c3 as Aa,c4 as et,bU as ot,c5 as Ci,c6 as Ln,c7 as Bn,c8 as Ia,c9 as Si,ca as qa,cb as Da,b0 as ht,cc as Ea,cd as La,ce as Ba,cf as Na,cg as Fa,ch as za,ci as Wa,cj as Ha,ck as Ua,cl as Va,cm as Ka,cn as Fr,bE as Ja,C as Ga,bM as Za,bz as ki,bA as Oi}from"./vendor-mui-core-O22FPGM4.js";import{I as Ya}from"./iframe-BfxIVBTL.js";import{r as Xa,as as Qa,G as wt,w as eo,x as Mr,a0 as to,c as ms,A as Zt,n as Ye,at as ro,y as no,O as zr,au as so,av as gs,K as $i,F as xt,J as Pi}from"./vendor-utils-DJ1bmiuG.js";import{r as pt,f as vs,u as Ue,B as de,V as Z,am as Ti,n as io,ak as Rt,bE as ao,a as oo,aj as ft,p as pe,P as ys,aX as lt,a1 as Xt,X as Ai,aq as Nn,bF as lo,bG as co,j as Dr,i as be,bH as uo,bI as fo,a8 as ho,a9 as po,a7 as mo,aZ as bs,bJ as $n,bK as go,bL as vo,a2 as Wr,_ as yo}from"./vendor-ux-did-connect-BUS40ceY.js";import{t as Ii,a as rt,u as z,f as jt,c as bo,l as Cr,k as qi}from"./vendor-hooks-DbRTDIFw.js";import{A as Di,d as xs}from"./config-mzUmZpxy.js";import{F as xo,d as _o}from"./form-text-input-BTiyCo4F.js";import{d as _s}from"./ChevronRight-OJJ2SUEU.js";import{y as Ei,z as wo,B as jo,C as Ro,i as ws,h as js,r as Mo,n as Rs}from"./vendor-arcblock-BkdpkIRL.js";import{z as De,C as Je,f as Li,av as Co,m as So,au as ko,v as Ms,h as He,O as Oo,Q as $o}from"./index-Do_PTy2g.js";import{B as Po}from"./bundle-avatar-Chdo4m6E.js";import{u as To,B as Ao}from"./index-xfe9Dcxz.js";import{d as Io}from"./Done-BXwXbLQs.js";import{F as qo,R as Do,L as Et}from"./logo-uploader-Dh1aL_OF.js";import{w as Bi,P as Eo}from"./permission-DXzAY72t.js";import{C as Fn}from"./confirm-CVR4a5FI.js";import{f as Sr}from"./format-error-LAoTjvJe.js";import{_ as Lo}from"./useSetState-BL3ktMon.js";import{u as Ni}from"./session-BcGa2Lwu.js";import{C as Bo}from"./click-to-copy-fQS5t8fq.js";import{u as Hr,a as No}from"./dashboard-DE28EHHN.js";import{I as Fi}from"./index-F9fg_Rq5.js";import{W as Fo}from"./did-address-Dx-4WAXQ.js";import{V as zo,K as Wo}from"./status-CW8cLZwc.js";import{u as ct,C as G,a as Cs}from"./index.esm-CWepf7I_.js";import{S as Ur}from"./switch-control-G4nR-MQG.js";import{b as Ho}from"./base32-BjPUfmet.js";import{S as hn}from"./simple-select-ZyzPurqn.js";import"./lottie-web-B6s7dDoL.js";import"./EditIcon-SYuT6kHe.js";import"./ArrowDropDown-Do4OWmCn.js";import"./index-tUQxVYYQ.js";import"./useLocalStorage-Nwt6lPBi.js";import"./PlayArrow-DsdnOq2p.js";import"./get-safe-url-C42wIqi-.js";import"./useAsyncRetry-CcF3e_P6.js";import"./useAsync-CDzQ0uN6.js";import"./InfoOutlined-Dto4CBtr.js";import"./omit-BySqlv7K.js";var zn={},Uo=Y;Object.defineProperty(zn,"__esModule",{value:!0});var zi=zn.default=void 0,Vo=Uo(pt()),Ko=h;zi=zn.default=(0,Vo.default)((0,Ko.jsx)("path",{d:"M3 18c0 .55.45 1 1 1h5v-2H4c-.55 0-1 .45-1 1M3 6c0 .55.45 1 1 1h9V5H4c-.55 0-1 .45-1 1m10 14v-1h7c.55 0 1-.45 1-1s-.45-1-1-1h-7v-1c0-.55-.45-1-1-1s-1 .45-1 1v4c0 .55.45 1 1 1s1-.45 1-1M7 10v1H4c-.55 0-1 .45-1 1s.45 1 1 1h3v1c0 .55.45 1 1 1s1-.45 1-1v-4c0-.55-.45-1-1-1s-1 .45-1 1m14 2c0-.55-.45-1-1-1h-9v2h9c.55 0 1-.45 1-1m-5-3c.55 0 1-.45 1-1V7h3c.55 0 1-.45 1-1s-.45-1-1-1h-3V4c0-.55-.45-1-1-1s-1 .45-1 1v4c0 .55.45 1 1 1"}),"TuneRounded");var Wn={},Jo=Y;Object.defineProperty(Wn,"__esModule",{value:!0});var Wi=Wn.default=void 0,Go=Jo(pt()),Zo=h;Wi=Wn.default=(0,Go.default)((0,Zo.jsx)("path",{d:"M21 10h-8.35C11.83 7.67 9.61 6 7 6c-3.31 0-6 2.69-6 6s2.69 6 6 6c2.61 0 4.83-1.67 5.65-4H13l2 2 2-2 2 2 4-4.04zM7 15c-1.65 0-3-1.35-3-3s1.35-3 3-3 3 1.35 3 3-1.35 3-3 3"}),"Key");var Hn={},Yo=Y;Object.defineProperty(Hn,"__esModule",{value:!0});var Hi=Hn.default=void 0,Xo=Yo(pt()),Qo=h;Hi=Hn.default=(0,Xo.default)((0,Qo.jsx)("path",{d:"M11 7 9.6 8.4l2.6 2.6H2v2h10.2l-2.6 2.6L11 17l5-5zm9 12h-8v2h8c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2h-8v2h8z"}),"Login");var Un={},el=Y;Object.defineProperty(Un,"__esModule",{value:!0});var Ui=Un.default=void 0,tl=el(pt()),rl=h;Ui=Un.default=(0,tl.default)((0,rl.jsx)("path",{d:"M12 22c1.1 0 2-.9 2-2h-4c0 1.1.9 2 2 2m6-6v-5c0-3.07-1.63-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.64 5.36 6 7.92 6 11v5l-2 2v1h16v-1zm-2 1H8v-6c0-2.48 1.51-4.5 4-4.5s4 2.02 4 4.5z"}),"NotificationsNone");const nl={width:24,height:24,body:'<path fill="currentColor" d="M4.975 15q-.425 0-.7-.288T4 14q0-.425.288-.713T5 13h14.025q.425 0 .7.288T20 14q0 .425-.288.713T19 15H4.975Zm0 4q-.425 0-.7-.288T4 18q0-.425.288-.713T5 17h14.025q.425 0 .7.288T20 18q0 .425-.288.713T19 19H4.975Zm0-8q-.425 0-.7-.288T4 10q0-.425.288-.713T5 9h14.025q.425 0 .7.288T20 10q0 .425-.288.713T19 11H4.975Zm0-4q-.425 0-.7-.288T4 6q0-.425.288-.713T5 5h14.025q.425 0 .7.288T20 6q0 .425-.288.713T19 7H4.975Z"/>'},sl=nl;var Vn={},il=Y;Object.defineProperty(Vn,"__esModule",{value:!0});var Vi=Vn.default=void 0,al=il(pt()),ol=h;Vi=Vn.default=(0,al.default)((0,ol.jsx)("path",{d:"M16 13c3.09-2.81 6-5.44 6-7.7C22 3.45 20.55 2 18.7 2c-1.04 0-2.05.49-2.7 1.25C15.34 2.49 14.34 2 13.3 2 11.45 2 10 3.45 10 5.3c0 2.26 2.91 4.89 6 7.7m-2.7-9c.44 0 .89.21 1.18.55L16 6.34l1.52-1.79c.29-.34.74-.55 1.18-.55.74 0 1.3.56 1.3 1.3 0 1.12-2.04 3.17-4 4.99-1.96-1.82-4-3.88-4-4.99 0-.74.56-1.3 1.3-1.3M19 16h-2c0-1.2-.75-2.28-1.87-2.7L8.97 11H1v11h6v-1.44l7 1.94 8-2.5v-1c0-1.66-1.34-3-3-3M3 20v-7h2v7zm10.97.41L7 18.48V13h1.61l5.82 2.17c.34.13.57.46.57.83 0 0-1.99-.05-2.3-.15l-2.38-.79-.63 1.9 2.38.79c.51.17 1.04.26 1.58.26H19c.39 0 .74.23.9.56z"}),"VolunteerActivismOutlined");var Kn={},ll=Y;Object.defineProperty(Kn,"__esModule",{value:!0});var Jn=Kn.default=void 0,cl=ll(pt()),Ss=h;Jn=Kn.default=(0,cl.default)([(0,Ss.jsx)("path",{d:"M21 7.28V5c0-1.1-.9-2-2-2H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-2.28c.59-.35 1-.98 1-1.72V9c0-.74-.41-1.37-1-1.72M20 9v6h-7V9zM5 19V5h14v2h-6c-1.1 0-2 .9-2 2v6c0 1.1.9 2 2 2h6v2z"},"0"),(0,Ss.jsx)("circle",{cx:"16",cy:"12",r:"1.5"},"1")],"AccountBalanceWalletOutlined");function Gn({label:v,disabled:T,required:O,initialValue:S,onChange:P,style:u,onSubmit:R,triggers:r,options:g,formatterBeforeSubmit:m,helperText:f,placeholder:e,renderImage:n,renderLabel:a,filterKeys:i,noEmpty:s,...p}){const[o,t]=U.useState(!1),[c,y]=U.useState(!1),[x,C]=U.useState(""),M=U.useRef(null),[d,b]=U.useState(S),[_,A]=U.useState(d),N=U.useMemo(()=>{if(!g)return{};const D={};return g.forEach(L=>{D[L.code]=L}),D},[g]),$=()=>{if(!g)return[];if(!x)return g.map(L=>L.code);const D=new RegExp(x.toLowerCase());return g.filter(L=>{var B;for(let I=0;I<i.length;I++){const j=i[I];if(D.test((B=L[j])==null?void 0:B.toLowerCase()))return!0}return!1}).map(L=>L.code)},l=async()=>{y(!0);try{await R(typeof m=="function"?m(_):_)===!1?A(d):s&&!_.length?(A(S),b(S)):(A(_),b(_))}catch{A(d)}finally{y(!1),t(!1)}},w=(D,L)=>{if(!Array.isArray(L)){A([]),P([]);return}const B=L.filter(I=>N[I]);if(!B.length){A([]),P([]);return}A(B),P(B)},k=D=>{D.stopPropagation(),t(!0),setTimeout(()=>{if(M.current){const L=M.current.querySelector("input");L&&L.focus()}},500)},q=o?h.jsx(Sa,{ref:M,options:g,value:_,onChange:w,inputValue:x,onInputChange:(D,L)=>{C(L)},PopperComponent:dl,fullWidth:!0,multiple:!0,variant:"outlined",margin:"dense",filterOptions:$,getOptionLabel:D=>{var L;return(L=N[D])==null?void 0:L.name},renderInput:D=>h.jsx(Q,{...D,label:"",placeholder:e}),renderOption:(D,L)=>{var I;const B=_.indexOf(L)!==-1;return U.createElement(ul,{component:"li",...D,key:L},n(N[L]||{}),h.jsx(F,{sx:{"& > img":{mr:2,flexShrink:0}},style:{flex:1,fontWeight:B?"700":"normal"},children:a(L,N[L])||((I=N[L])==null?void 0:I.name)}),h.jsx(F,{component:vs,sx:{opacity:.5,width:18,height:18},style:{visibility:B?"visible":"hidden"}}))},...p}):h.jsx(F,{px:1,className:"form-item-input slot",onClick:k,style:{whiteSpace:"pre-wrap",cursor:"text"},children:_.filter(D=>g.some(L=>L.code===D)).map(D=>h.jsx(En,{label:g.find(L=>L.code===D).name,style:{marginRight:8},size:"small"},D))});return h.jsx(qo,{className:"form",style:u,children:h.jsxs(F,{className:"form-item",children:[h.jsxs(F,{className:"form-item-label",children:[v,O&&h.jsx(Do,{})]}),h.jsxs(F,{className:"form-item-body",children:[h.jsx(F,{className:"form-item-input",children:q}),h.jsx(F,{className:"form-item-action",children:o?h.jsxs(h.Fragment,{children:[h.jsx(Ge,{"data-cy":"schema-form-item-confirm",onClick:l,disabled:T||c,size:"large",children:c?h.jsx(_t,{size:24}):h.jsx(Io,{})}),h.jsx(Ge,{"data-cy":"schema-form-item-cancel",onClick:()=>{A(d),t(!1)},disabled:T||c,size:"large",children:h.jsx(vs,{})})]}):null})]}),o&&f&&h.jsx(ji,{children:f})]})})}Gn.propTypes={style:H.object,onSubmit:H.func,onChange:H.func,label:H.string,initialValue:H.string,required:H.bool,disabled:H.bool,triggers:H.array,options:H.array,helperText:H.string,formatterBeforeSubmit:H.func,placeholder:H.string,renderImage:H.func,filterKeys:H.arrayOf(H.string),noEmpty:H.bool,renderLabel:H.func};Gn.defaultProps={style:{},onSubmit:()=>{},onChange:()=>{},label:"",initialValue:"",required:!1,disabled:!1,triggers:[],options:[],helperText:"",formatterBeforeSubmit:v=>v.join(","),placeholder:"",filterKeys:["name"],renderImage:()=>null,renderLabel:(v,T)=>"",noEmpty:!1};const ul=kr.div`
1
+ import{r as U,e as Tt,g as Dn,a as Xe,f as Ma}from"./vendor-react-DoD83n6N.js";import{a1 as Y,j as h,E as H,a9 as kr,P as Ca,b$ as ps,bP as Sa,M as Q,a3 as F,A as En,I as Ge,a2 as _t,bl as ji,x as Ke,T as at,bn as ue,bO as Gt,br as ka,ac as Oa,ad as dt,K as Ri,ak as Nr,bd as bt,bo as it,bj as ae,c0 as $a,e as Yt,Z as Mi,a4 as Ve,c1 as Pa,c2 as Ta,c3 as Aa,c4 as et,bU as ot,c5 as Ci,c6 as Ln,c7 as Bn,c8 as Ia,c9 as Si,ca as qa,cb as Da,b0 as ht,cc as Ea,cd as La,ce as Ba,cf as Na,cg as Fa,ch as za,ci as Wa,cj as Ha,ck as Ua,cl as Va,cm as Ka,cn as Fr,bE as Ja,C as Ga,bM as Za,bz as ki,bA as Oi}from"./vendor-mui-core-O22FPGM4.js";import{I as Ya}from"./iframe-C0FAfo1V.js";import{r as Xa,as as Qa,G as wt,w as eo,x as Mr,a0 as to,c as ms,A as Zt,n as Ye,at as ro,y as no,O as zr,au as so,av as gs,K as $i,F as xt,J as Pi}from"./vendor-utils-CbeKtci8.js";import{r as pt,f as vs,u as Ue,B as de,V as Z,am as Ti,n as io,ak as Rt,bE as ao,a as oo,aj as ft,p as pe,P as ys,aX as lt,a1 as Xt,X as Ai,aq as Nn,bF as lo,bG as co,j as Dr,i as be,bH as uo,bI as fo,a8 as ho,a9 as po,a7 as mo,aZ as bs,bJ as $n,bK as go,bL as vo,a2 as Wr,_ as yo}from"./vendor-ux-did-connect-D75Zatzm.js";import{t as Ii,a as rt,u as z,f as jt,c as bo,l as Cr,k as qi}from"./vendor-hooks-CYyfK9g3.js";import{A as Di,d as xs}from"./config-C3tQWDAE.js";import{F as xo,d as _o}from"./form-text-input-C8x5debf.js";import{d as _s}from"./ChevronRight-Bpkf9aqI.js";import{y as Ei,z as wo,B as jo,C as Ro,i as ws,h as js,r as Mo,n as Rs}from"./vendor-arcblock-E5QJEgSK.js";import{z as De,C as Je,f as Li,av as Co,m as So,au as ko,v as Ms,h as He,O as Oo,Q as $o}from"./index-CYdNDqQ1.js";import{B as Po}from"./bundle-avatar-Eqwd2qUG.js";import{u as To,B as Ao}from"./index-BsMTGy4m.js";import{d as Io}from"./Done-B8c93MpP.js";import{F as qo,R as Do,L as Et}from"./logo-uploader-DQCS5qZW.js";import{w as Bi,P as Eo}from"./permission-ZvUR5Tj-.js";import{C as Fn}from"./confirm-CCmbVvGp.js";import{f as Sr}from"./format-error-LAoTjvJe.js";import{_ as Lo}from"./useSetState-BL3ktMon.js";import{u as Ni}from"./session-CD9NaM-v.js";import{C as Bo}from"./click-to-copy-Dc16fHKA.js";import{u as Hr,a as No}from"./dashboard-C2dbiNOp.js";import{I as Fi}from"./index-D5rqbUOM.js";import{W as Fo}from"./did-address-DIKoCoBp.js";import{V as zo,K as Wo}from"./status-D8ugfvVU.js";import{u as ct,C as G,a as Cs}from"./index.esm-CWepf7I_.js";import{S as Ur}from"./switch-control-CJ1duVKM.js";import{b as Ho}from"./base32-gJJTbpiB.js";import{S as hn}from"./simple-select-ZyzPurqn.js";import"./lottie-web-B6s7dDoL.js";import"./EditIcon-SYuT6kHe.js";import"./ArrowDropDown-ydRfHJ2x.js";import"./index-tUQxVYYQ.js";import"./useLocalStorage-CtbpqE0c.js";import"./PlayArrow-DI84Lay5.js";import"./get-safe-url-BvS0hy8W.js";import"./useAsyncRetry-CEJwVPZ6.js";import"./useAsync-D2OhgEkV.js";import"./InfoOutlined-HP5LuELQ.js";import"./omit-DVwO9e3E.js";var zn={},Uo=Y;Object.defineProperty(zn,"__esModule",{value:!0});var zi=zn.default=void 0,Vo=Uo(pt()),Ko=h;zi=zn.default=(0,Vo.default)((0,Ko.jsx)("path",{d:"M3 18c0 .55.45 1 1 1h5v-2H4c-.55 0-1 .45-1 1M3 6c0 .55.45 1 1 1h9V5H4c-.55 0-1 .45-1 1m10 14v-1h7c.55 0 1-.45 1-1s-.45-1-1-1h-7v-1c0-.55-.45-1-1-1s-1 .45-1 1v4c0 .55.45 1 1 1s1-.45 1-1M7 10v1H4c-.55 0-1 .45-1 1s.45 1 1 1h3v1c0 .55.45 1 1 1s1-.45 1-1v-4c0-.55-.45-1-1-1s-1 .45-1 1m14 2c0-.55-.45-1-1-1h-9v2h9c.55 0 1-.45 1-1m-5-3c.55 0 1-.45 1-1V7h3c.55 0 1-.45 1-1s-.45-1-1-1h-3V4c0-.55-.45-1-1-1s-1 .45-1 1v4c0 .55.45 1 1 1"}),"TuneRounded");var Wn={},Jo=Y;Object.defineProperty(Wn,"__esModule",{value:!0});var Wi=Wn.default=void 0,Go=Jo(pt()),Zo=h;Wi=Wn.default=(0,Go.default)((0,Zo.jsx)("path",{d:"M21 10h-8.35C11.83 7.67 9.61 6 7 6c-3.31 0-6 2.69-6 6s2.69 6 6 6c2.61 0 4.83-1.67 5.65-4H13l2 2 2-2 2 2 4-4.04zM7 15c-1.65 0-3-1.35-3-3s1.35-3 3-3 3 1.35 3 3-1.35 3-3 3"}),"Key");var Hn={},Yo=Y;Object.defineProperty(Hn,"__esModule",{value:!0});var Hi=Hn.default=void 0,Xo=Yo(pt()),Qo=h;Hi=Hn.default=(0,Xo.default)((0,Qo.jsx)("path",{d:"M11 7 9.6 8.4l2.6 2.6H2v2h10.2l-2.6 2.6L11 17l5-5zm9 12h-8v2h8c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2h-8v2h8z"}),"Login");var Un={},el=Y;Object.defineProperty(Un,"__esModule",{value:!0});var Ui=Un.default=void 0,tl=el(pt()),rl=h;Ui=Un.default=(0,tl.default)((0,rl.jsx)("path",{d:"M12 22c1.1 0 2-.9 2-2h-4c0 1.1.9 2 2 2m6-6v-5c0-3.07-1.63-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.64 5.36 6 7.92 6 11v5l-2 2v1h16v-1zm-2 1H8v-6c0-2.48 1.51-4.5 4-4.5s4 2.02 4 4.5z"}),"NotificationsNone");const nl={width:24,height:24,body:'<path fill="currentColor" d="M4.975 15q-.425 0-.7-.288T4 14q0-.425.288-.713T5 13h14.025q.425 0 .7.288T20 14q0 .425-.288.713T19 15H4.975Zm0 4q-.425 0-.7-.288T4 18q0-.425.288-.713T5 17h14.025q.425 0 .7.288T20 18q0 .425-.288.713T19 19H4.975Zm0-8q-.425 0-.7-.288T4 10q0-.425.288-.713T5 9h14.025q.425 0 .7.288T20 10q0 .425-.288.713T19 11H4.975Zm0-4q-.425 0-.7-.288T4 6q0-.425.288-.713T5 5h14.025q.425 0 .7.288T20 6q0 .425-.288.713T19 7H4.975Z"/>'},sl=nl;var Vn={},il=Y;Object.defineProperty(Vn,"__esModule",{value:!0});var Vi=Vn.default=void 0,al=il(pt()),ol=h;Vi=Vn.default=(0,al.default)((0,ol.jsx)("path",{d:"M16 13c3.09-2.81 6-5.44 6-7.7C22 3.45 20.55 2 18.7 2c-1.04 0-2.05.49-2.7 1.25C15.34 2.49 14.34 2 13.3 2 11.45 2 10 3.45 10 5.3c0 2.26 2.91 4.89 6 7.7m-2.7-9c.44 0 .89.21 1.18.55L16 6.34l1.52-1.79c.29-.34.74-.55 1.18-.55.74 0 1.3.56 1.3 1.3 0 1.12-2.04 3.17-4 4.99-1.96-1.82-4-3.88-4-4.99 0-.74.56-1.3 1.3-1.3M19 16h-2c0-1.2-.75-2.28-1.87-2.7L8.97 11H1v11h6v-1.44l7 1.94 8-2.5v-1c0-1.66-1.34-3-3-3M3 20v-7h2v7zm10.97.41L7 18.48V13h1.61l5.82 2.17c.34.13.57.46.57.83 0 0-1.99-.05-2.3-.15l-2.38-.79-.63 1.9 2.38.79c.51.17 1.04.26 1.58.26H19c.39 0 .74.23.9.56z"}),"VolunteerActivismOutlined");var Kn={},ll=Y;Object.defineProperty(Kn,"__esModule",{value:!0});var Jn=Kn.default=void 0,cl=ll(pt()),Ss=h;Jn=Kn.default=(0,cl.default)([(0,Ss.jsx)("path",{d:"M21 7.28V5c0-1.1-.9-2-2-2H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-2.28c.59-.35 1-.98 1-1.72V9c0-.74-.41-1.37-1-1.72M20 9v6h-7V9zM5 19V5h14v2h-6c-1.1 0-2 .9-2 2v6c0 1.1.9 2 2 2h6v2z"},"0"),(0,Ss.jsx)("circle",{cx:"16",cy:"12",r:"1.5"},"1")],"AccountBalanceWalletOutlined");function Gn({label:v,disabled:T,required:O,initialValue:S,onChange:P,style:u,onSubmit:R,triggers:r,options:g,formatterBeforeSubmit:m,helperText:f,placeholder:e,renderImage:n,renderLabel:a,filterKeys:i,noEmpty:s,...p}){const[o,t]=U.useState(!1),[c,y]=U.useState(!1),[x,C]=U.useState(""),M=U.useRef(null),[d,b]=U.useState(S),[_,A]=U.useState(d),N=U.useMemo(()=>{if(!g)return{};const D={};return g.forEach(L=>{D[L.code]=L}),D},[g]),$=()=>{if(!g)return[];if(!x)return g.map(L=>L.code);const D=new RegExp(x.toLowerCase());return g.filter(L=>{var B;for(let I=0;I<i.length;I++){const j=i[I];if(D.test((B=L[j])==null?void 0:B.toLowerCase()))return!0}return!1}).map(L=>L.code)},l=async()=>{y(!0);try{await R(typeof m=="function"?m(_):_)===!1?A(d):s&&!_.length?(A(S),b(S)):(A(_),b(_))}catch{A(d)}finally{y(!1),t(!1)}},w=(D,L)=>{if(!Array.isArray(L)){A([]),P([]);return}const B=L.filter(I=>N[I]);if(!B.length){A([]),P([]);return}A(B),P(B)},k=D=>{D.stopPropagation(),t(!0),setTimeout(()=>{if(M.current){const L=M.current.querySelector("input");L&&L.focus()}},500)},q=o?h.jsx(Sa,{ref:M,options:g,value:_,onChange:w,inputValue:x,onInputChange:(D,L)=>{C(L)},PopperComponent:dl,fullWidth:!0,multiple:!0,variant:"outlined",margin:"dense",filterOptions:$,getOptionLabel:D=>{var L;return(L=N[D])==null?void 0:L.name},renderInput:D=>h.jsx(Q,{...D,label:"",placeholder:e}),renderOption:(D,L)=>{var I;const B=_.indexOf(L)!==-1;return U.createElement(ul,{component:"li",...D,key:L},n(N[L]||{}),h.jsx(F,{sx:{"& > img":{mr:2,flexShrink:0}},style:{flex:1,fontWeight:B?"700":"normal"},children:a(L,N[L])||((I=N[L])==null?void 0:I.name)}),h.jsx(F,{component:vs,sx:{opacity:.5,width:18,height:18},style:{visibility:B?"visible":"hidden"}}))},...p}):h.jsx(F,{px:1,className:"form-item-input slot",onClick:k,style:{whiteSpace:"pre-wrap",cursor:"text"},children:_.filter(D=>g.some(L=>L.code===D)).map(D=>h.jsx(En,{label:g.find(L=>L.code===D).name,style:{marginRight:8},size:"small"},D))});return h.jsx(qo,{className:"form",style:u,children:h.jsxs(F,{className:"form-item",children:[h.jsxs(F,{className:"form-item-label",children:[v,O&&h.jsx(Do,{})]}),h.jsxs(F,{className:"form-item-body",children:[h.jsx(F,{className:"form-item-input",children:q}),h.jsx(F,{className:"form-item-action",children:o?h.jsxs(h.Fragment,{children:[h.jsx(Ge,{"data-cy":"schema-form-item-confirm",onClick:l,disabled:T||c,size:"large",children:c?h.jsx(_t,{size:24}):h.jsx(Io,{})}),h.jsx(Ge,{"data-cy":"schema-form-item-cancel",onClick:()=>{A(d),t(!1)},disabled:T||c,size:"large",children:h.jsx(vs,{})})]}):null})]}),o&&f&&h.jsx(ji,{children:f})]})})}Gn.propTypes={style:H.object,onSubmit:H.func,onChange:H.func,label:H.string,initialValue:H.string,required:H.bool,disabled:H.bool,triggers:H.array,options:H.array,helperText:H.string,formatterBeforeSubmit:H.func,placeholder:H.string,renderImage:H.func,filterKeys:H.arrayOf(H.string),noEmpty:H.bool,renderLabel:H.func};Gn.defaultProps={style:{},onSubmit:()=>{},onChange:()=>{},label:"",initialValue:"",required:!1,disabled:!1,triggers:[],options:[],helperText:"",formatterBeforeSubmit:v=>v.join(","),placeholder:"",filterKeys:["name"],renderImage:()=>null,renderLabel:(v,T)=>"",noEmpty:!1};const ul=kr.div`
2
2
  display: flex;
3
3
  justify-content: space-between;
4
4
  align-items: center;
@@ -1 +1 @@
1
- import{p as b}from"./vendor-utils-DJ1bmiuG.js";function c(o){if(typeof o!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(o))}function A(o,e){for(var r="",i=0,l=-1,t=0,n,f=0;f<=o.length;++f){if(f<o.length)n=o.charCodeAt(f);else{if(n===47)break;n=47}if(n===47){if(!(l===f-1||t===1))if(l!==f-1&&t===2){if(r.length<2||i!==2||r.charCodeAt(r.length-1)!==46||r.charCodeAt(r.length-2)!==46){if(r.length>2){var s=r.lastIndexOf("/");if(s!==r.length-1){s===-1?(r="",i=0):(r=r.slice(0,s),i=r.length-1-r.lastIndexOf("/")),l=f,t=0;continue}}else if(r.length===2||r.length===1){r="",i=0,l=f,t=0;continue}}e&&(r.length>0?r+="/..":r="..",i=2)}else r.length>0?r+="/"+o.slice(l+1,f):r=o.slice(l+1,f),i=f-l-1;l=f,t=0}else n===46&&t!==-1?++t:t=-1}return r}function h(o,e){var r=e.dir||e.root,i=e.base||(e.name||"")+(e.ext||"");return r?r===e.root?r+i:r+o+i:i}var g={resolve:function(){for(var e="",r=!1,i,l=arguments.length-1;l>=-1&&!r;l--){var t;l>=0?t=arguments[l]:(i===void 0&&(i=b.cwd()),t=i),c(t),t.length!==0&&(e=t+"/"+e,r=t.charCodeAt(0)===47)}return e=A(e,!r),r?e.length>0?"/"+e:"/":e.length>0?e:"."},normalize:function(e){if(c(e),e.length===0)return".";var r=e.charCodeAt(0)===47,i=e.charCodeAt(e.length-1)===47;return e=A(e,!r),e.length===0&&!r&&(e="."),e.length>0&&i&&(e+="/"),r?"/"+e:e},isAbsolute:function(e){return c(e),e.length>0&&e.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var e,r=0;r<arguments.length;++r){var i=arguments[r];c(i),i.length>0&&(e===void 0?e=i:e+="/"+i)}return e===void 0?".":g.normalize(e)},relative:function(e,r){if(c(e),c(r),e===r||(e=g.resolve(e),r=g.resolve(r),e===r))return"";for(var i=1;i<e.length&&e.charCodeAt(i)===47;++i);for(var l=e.length,t=l-i,n=1;n<r.length&&r.charCodeAt(n)===47;++n);for(var f=r.length,s=f-n,v=t<s?t:s,u=-1,a=0;a<=v;++a){if(a===v){if(s>v){if(r.charCodeAt(n+a)===47)return r.slice(n+a+1);if(a===0)return r.slice(n+a)}else t>v&&(e.charCodeAt(i+a)===47?u=a:a===0&&(u=0));break}var m=e.charCodeAt(i+a),C=r.charCodeAt(n+a);if(m!==C)break;m===47&&(u=a)}var d="";for(a=i+u+1;a<=l;++a)(a===l||e.charCodeAt(a)===47)&&(d.length===0?d+="..":d+="/..");return d.length>0?d+r.slice(n+u):(n+=u,r.charCodeAt(n)===47&&++n,r.slice(n))},_makeLong:function(e){return e},dirname:function(e){if(c(e),e.length===0)return".";for(var r=e.charCodeAt(0),i=r===47,l=-1,t=!0,n=e.length-1;n>=1;--n)if(r=e.charCodeAt(n),r===47){if(!t){l=n;break}}else t=!1;return l===-1?i?"/":".":i&&l===1?"//":e.slice(0,l)},basename:function(e,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');c(e);var i=0,l=-1,t=!0,n;if(r!==void 0&&r.length>0&&r.length<=e.length){if(r.length===e.length&&r===e)return"";var f=r.length-1,s=-1;for(n=e.length-1;n>=0;--n){var v=e.charCodeAt(n);if(v===47){if(!t){i=n+1;break}}else s===-1&&(t=!1,s=n+1),f>=0&&(v===r.charCodeAt(f)?--f===-1&&(l=n):(f=-1,l=s))}return i===l?l=s:l===-1&&(l=e.length),e.slice(i,l)}else{for(n=e.length-1;n>=0;--n)if(e.charCodeAt(n)===47){if(!t){i=n+1;break}}else l===-1&&(t=!1,l=n+1);return l===-1?"":e.slice(i,l)}},extname:function(e){c(e);for(var r=-1,i=0,l=-1,t=!0,n=0,f=e.length-1;f>=0;--f){var s=e.charCodeAt(f);if(s===47){if(!t){i=f+1;break}continue}l===-1&&(t=!1,l=f+1),s===46?r===-1?r=f:n!==1&&(n=1):r!==-1&&(n=-1)}return r===-1||l===-1||n===0||n===1&&r===l-1&&r===i+1?"":e.slice(r,l)},format:function(e){if(e===null||typeof e!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return h("/",e)},parse:function(e){c(e);var r={root:"",dir:"",base:"",ext:"",name:""};if(e.length===0)return r;var i=e.charCodeAt(0),l=i===47,t;l?(r.root="/",t=1):t=0;for(var n=-1,f=0,s=-1,v=!0,u=e.length-1,a=0;u>=t;--u){if(i=e.charCodeAt(u),i===47){if(!v){f=u+1;break}continue}s===-1&&(v=!1,s=u+1),i===46?n===-1?n=u:a!==1&&(a=1):n!==-1&&(a=-1)}return n===-1||s===-1||a===0||a===1&&n===s-1&&n===f+1?s!==-1&&(f===0&&l?r.base=r.name=e.slice(1,s):r.base=r.name=e.slice(f,s)):(f===0&&l?(r.name=e.slice(1,n),r.base=e.slice(1,s)):(r.name=e.slice(f,n),r.base=e.slice(f,s)),r.ext=e.slice(n,s)),f>0?r.dir=e.slice(0,f-1):l&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};g.posix=g;var y=g;export{y as p};
1
+ import{p as b}from"./vendor-utils-CbeKtci8.js";function c(o){if(typeof o!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(o))}function A(o,e){for(var r="",i=0,l=-1,t=0,n,f=0;f<=o.length;++f){if(f<o.length)n=o.charCodeAt(f);else{if(n===47)break;n=47}if(n===47){if(!(l===f-1||t===1))if(l!==f-1&&t===2){if(r.length<2||i!==2||r.charCodeAt(r.length-1)!==46||r.charCodeAt(r.length-2)!==46){if(r.length>2){var s=r.lastIndexOf("/");if(s!==r.length-1){s===-1?(r="",i=0):(r=r.slice(0,s),i=r.length-1-r.lastIndexOf("/")),l=f,t=0;continue}}else if(r.length===2||r.length===1){r="",i=0,l=f,t=0;continue}}e&&(r.length>0?r+="/..":r="..",i=2)}else r.length>0?r+="/"+o.slice(l+1,f):r=o.slice(l+1,f),i=f-l-1;l=f,t=0}else n===46&&t!==-1?++t:t=-1}return r}function h(o,e){var r=e.dir||e.root,i=e.base||(e.name||"")+(e.ext||"");return r?r===e.root?r+i:r+o+i:i}var g={resolve:function(){for(var e="",r=!1,i,l=arguments.length-1;l>=-1&&!r;l--){var t;l>=0?t=arguments[l]:(i===void 0&&(i=b.cwd()),t=i),c(t),t.length!==0&&(e=t+"/"+e,r=t.charCodeAt(0)===47)}return e=A(e,!r),r?e.length>0?"/"+e:"/":e.length>0?e:"."},normalize:function(e){if(c(e),e.length===0)return".";var r=e.charCodeAt(0)===47,i=e.charCodeAt(e.length-1)===47;return e=A(e,!r),e.length===0&&!r&&(e="."),e.length>0&&i&&(e+="/"),r?"/"+e:e},isAbsolute:function(e){return c(e),e.length>0&&e.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var e,r=0;r<arguments.length;++r){var i=arguments[r];c(i),i.length>0&&(e===void 0?e=i:e+="/"+i)}return e===void 0?".":g.normalize(e)},relative:function(e,r){if(c(e),c(r),e===r||(e=g.resolve(e),r=g.resolve(r),e===r))return"";for(var i=1;i<e.length&&e.charCodeAt(i)===47;++i);for(var l=e.length,t=l-i,n=1;n<r.length&&r.charCodeAt(n)===47;++n);for(var f=r.length,s=f-n,v=t<s?t:s,u=-1,a=0;a<=v;++a){if(a===v){if(s>v){if(r.charCodeAt(n+a)===47)return r.slice(n+a+1);if(a===0)return r.slice(n+a)}else t>v&&(e.charCodeAt(i+a)===47?u=a:a===0&&(u=0));break}var m=e.charCodeAt(i+a),C=r.charCodeAt(n+a);if(m!==C)break;m===47&&(u=a)}var d="";for(a=i+u+1;a<=l;++a)(a===l||e.charCodeAt(a)===47)&&(d.length===0?d+="..":d+="/..");return d.length>0?d+r.slice(n+u):(n+=u,r.charCodeAt(n)===47&&++n,r.slice(n))},_makeLong:function(e){return e},dirname:function(e){if(c(e),e.length===0)return".";for(var r=e.charCodeAt(0),i=r===47,l=-1,t=!0,n=e.length-1;n>=1;--n)if(r=e.charCodeAt(n),r===47){if(!t){l=n;break}}else t=!1;return l===-1?i?"/":".":i&&l===1?"//":e.slice(0,l)},basename:function(e,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');c(e);var i=0,l=-1,t=!0,n;if(r!==void 0&&r.length>0&&r.length<=e.length){if(r.length===e.length&&r===e)return"";var f=r.length-1,s=-1;for(n=e.length-1;n>=0;--n){var v=e.charCodeAt(n);if(v===47){if(!t){i=n+1;break}}else s===-1&&(t=!1,s=n+1),f>=0&&(v===r.charCodeAt(f)?--f===-1&&(l=n):(f=-1,l=s))}return i===l?l=s:l===-1&&(l=e.length),e.slice(i,l)}else{for(n=e.length-1;n>=0;--n)if(e.charCodeAt(n)===47){if(!t){i=n+1;break}}else l===-1&&(t=!1,l=n+1);return l===-1?"":e.slice(i,l)}},extname:function(e){c(e);for(var r=-1,i=0,l=-1,t=!0,n=0,f=e.length-1;f>=0;--f){var s=e.charCodeAt(f);if(s===47){if(!t){i=f+1;break}continue}l===-1&&(t=!1,l=f+1),s===46?r===-1?r=f:n!==1&&(n=1):r!==-1&&(n=-1)}return r===-1||l===-1||n===0||n===1&&r===l-1&&r===i+1?"":e.slice(r,l)},format:function(e){if(e===null||typeof e!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return h("/",e)},parse:function(e){c(e);var r={root:"",dir:"",base:"",ext:"",name:""};if(e.length===0)return r;var i=e.charCodeAt(0),l=i===47,t;l?(r.root="/",t=1):t=0;for(var n=-1,f=0,s=-1,v=!0,u=e.length-1,a=0;u>=t;--u){if(i=e.charCodeAt(u),i===47){if(!v){f=u+1;break}continue}s===-1&&(v=!1,s=u+1),i===46?n===-1?n=u:a!==1&&(a=1):n!==-1&&(a=-1)}return n===-1||s===-1||a===0||a===1&&n===s-1&&n===f+1?s!==-1&&(f===0&&l?r.base=r.name=e.slice(1,s):r.base=r.name=e.slice(f,s)):(f===0&&l?(r.name=e.slice(1,n),r.base=e.slice(1,s)):(r.name=e.slice(f,n),r.base=e.slice(f,s)),r.ext=e.slice(n,s)),f>0?r.dir=e.slice(0,f-1):l&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};g.posix=g;var y=g;export{y as p};
@@ -1,4 +1,4 @@
1
- import{j as t,a2 as h,a3 as c,E as d,a9 as g}from"./vendor-mui-core-O22FPGM4.js";import{r as y}from"./vendor-react-DoD83n6N.js";import{aX as v,C as w,B as m}from"./vendor-ux-did-connect-BUS40ceY.js";import{P}from"./page-header-C2MPWR-H.js";import{C as E}from"./index-Do_PTy2g.js";import{u as T}from"./config-space-6wpekLZ1.js";import{C as B,D,a as N}from"./connect-to-BhxyRPHq.js";import{S as u}from"./step-actions-D4sVdJ5W.js";import{S as b}from"./layout-ceT4Awul.js";import"./vendor-utils-DJ1bmiuG.js";import"./vendor-hooks-DbRTDIFw.js";import"./lottie-web-B6s7dDoL.js";import"./vendor-arcblock-BkdpkIRL.js";import"./api-D2GjOmnt.js";import"./DeleteOutline-C954mj84.js";import"./format-error-LAoTjvJe.js";import"./content-layout--DV54O6i.js";function l({onNext:a,onPrevious:x}){var n,r,p;const{t:i}=y.useContext(v),{blocklet:e}=E(),{spaceGateway:f,settingStorageEndpoint:C,updateSpaceGateway:j,hasStorageEndpoint:S,loading:o,storageEndpoint:s}=T();return o?t.jsx(w,{relative:"parent",children:t.jsx(h,{})}):t.jsxs(G,{children:[t.jsx("div",{className:"header",children:t.jsx(P,{title:i("setup.didSpace.title"),subTitle:i("setup.didSpace.subTitle"),onClickBack:x})}),t.jsx(c,{sx:{width:"100%",maxWidth:"720px"},children:S?t.jsx(B,{spaceGateway:f,settingStorageEndpoint:C}):t.jsx(D,{})}),((n=e==null?void 0:e.capabilities)==null?void 0:n.didSpace)&&t.jsx(c,{display:"flex",alignItems:"center",justifyContent:"center",paddingTop:"24px",children:t.jsx(N,{onConnect:j,storageEndpoint:s})}),((r=e==null?void 0:e.capabilities)==null?void 0:r.didSpace)==="required"&&t.jsx(u,{mt:8,children:t.jsx(m,{loading:o,variant:"contained",disabled:o||!s,onClick:()=>a(),children:i("setup.continue")})}),((p=e==null?void 0:e.capabilities)==null?void 0:p.didSpace)==="optional"&&t.jsx(u,{blocklet:e,onStartNow:()=>a("complete"),children:t.jsx(m,{className:"start-now",loading:o,variant:"contained",disabled:o,onClick:()=>a(),children:i(s?"setup.continue":"setup.skip")})})]})}l.propTypes={onNext:d.func,onPrevious:d.func};l.defaultProps={onNext:()=>{},onPrevious:()=>{}};const G=g(b)`
1
+ import{j as t,a2 as h,a3 as c,E as d,a9 as g}from"./vendor-mui-core-O22FPGM4.js";import{r as y}from"./vendor-react-DoD83n6N.js";import{aX as v,C as w,B as m}from"./vendor-ux-did-connect-D75Zatzm.js";import{P}from"./page-header-DyeTxe1U.js";import{C as E}from"./index-CYdNDqQ1.js";import{u as T}from"./config-space-BZu4nd7t.js";import{C as B,D,a as N}from"./connect-to-CAjdR1Vi.js";import{S as u}from"./step-actions-C83ykph7.js";import{S as b}from"./layout-Bkn9nC3f.js";import"./vendor-utils-CbeKtci8.js";import"./vendor-hooks-CYyfK9g3.js";import"./lottie-web-B6s7dDoL.js";import"./vendor-arcblock-E5QJEgSK.js";import"./api-CvDkueg1.js";import"./DeleteOutline-D4DYIaUj.js";import"./format-error-LAoTjvJe.js";import"./content-layout--DV54O6i.js";function l({onNext:a,onPrevious:x}){var n,r,p;const{t:i}=y.useContext(v),{blocklet:e}=E(),{spaceGateway:f,settingStorageEndpoint:C,updateSpaceGateway:j,hasStorageEndpoint:S,loading:o,storageEndpoint:s}=T();return o?t.jsx(w,{relative:"parent",children:t.jsx(h,{})}):t.jsxs(G,{children:[t.jsx("div",{className:"header",children:t.jsx(P,{title:i("setup.didSpace.title"),subTitle:i("setup.didSpace.subTitle"),onClickBack:x})}),t.jsx(c,{sx:{width:"100%",maxWidth:"720px"},children:S?t.jsx(B,{spaceGateway:f,settingStorageEndpoint:C}):t.jsx(D,{})}),((n=e==null?void 0:e.capabilities)==null?void 0:n.didSpace)&&t.jsx(c,{display:"flex",alignItems:"center",justifyContent:"center",paddingTop:"24px",children:t.jsx(N,{onConnect:j,storageEndpoint:s})}),((r=e==null?void 0:e.capabilities)==null?void 0:r.didSpace)==="required"&&t.jsx(u,{mt:8,children:t.jsx(m,{loading:o,variant:"contained",disabled:o||!s,onClick:()=>a(),children:i("setup.continue")})}),((p=e==null?void 0:e.capabilities)==null?void 0:p.didSpace)==="optional"&&t.jsx(u,{blocklet:e,onStartNow:()=>a("complete"),children:t.jsx(m,{className:"start-now",loading:o,variant:"contained",disabled:o,onClick:()=>a(),children:i(s?"setup.continue":"setup.skip")})})]})}l.propTypes={onNext:d.func,onPrevious:d.func};l.defaultProps={onNext:()=>{},onPrevious:()=>{}};const G=g(b)`
2
2
  height: 100%;
3
3
  overflow-y: auto;
4
4
  `;export{l as default};
@@ -1,4 +1,4 @@
1
- import{u as q,V as z,bK as K,i as be,X as fe,a2 as ge,bC as je}from"./vendor-ux-did-connect-BUS40ceY.js";import{w as ye,l as de,j as we}from"./vendor-hooks-DbRTDIFw.js";import{r as C,b as X}from"./vendor-react-DoD83n6N.js";import{d as Z}from"./InfoOutlined-Dto4CBtr.js";import{z as N,C as ce,G as ke}from"./index-Do_PTy2g.js";import{u as F}from"./dashboard-DE28EHHN.js";import{E as o,j as e,D as ve,ab as Ee,r as Ce,a3 as f,M as ie,T as S,a2 as U,ac as ee,y as Te,x as B,bn as le,bO as V,a4 as A,L as G,z as Q,bg as Se,A as O,I as _,C as Re,bl as Ie,ad as P,cG as Me,ak as Pe,bd as Y,bk as De,b1 as We,cH as ze,cI as Ae,b2 as Oe,af as $e,bS as qe,s as pe,t as Le,cJ as Be,cK as He,cL as Ne,cM as Fe,cN as Ue}from"./vendor-mui-core-O22FPGM4.js";import{u as _e,C as J}from"./index.esm-CWepf7I_.js";import{n as Ke}from"./vendor-arcblock-BkdpkIRL.js";import{d as Ve}from"./ExpandLess-xJAJmJam.js";import{y as ue,w as Ye,x as Je}from"./vendor-utils-DJ1bmiuG.js";import{C as Ge}from"./confirm-CVR4a5FI.js";import{A as Qe}from"./actions-4OuC0GHy.js";import"./lottie-web-B6s7dDoL.js";import"./useLocalStorage-Nwt6lPBi.js";import"./PlayArrow-DsdnOq2p.js";import"./get-safe-url-C42wIqi-.js";import"./format-error-LAoTjvJe.js";import"./index-xfe9Dcxz.js";import"./session-BcGa2Lwu.js";import"./useAsyncRetry-CcF3e_P6.js";import"./useAsync-CDzQ0uN6.js";import"./useSetState-BL3ktMon.js";import"./MoreHoriz-CU3bPiks.js";const Xe=t=>{var j,y;const[d,c]=C.useState(null),[a,b]=C.useState(!t),[R,p]=C.useState(null),{blocklet:n}=ce(),l=(y=(j=n==null?void 0:n.site)==null?void 0:j.domainAliases[0])==null?void 0:y.value,v=C.useMemo(()=>{const h={};return d&&(d.sources.forEach(r=>{h[r.did]={source:r,events:[],count:0}}),d.events.forEach(r=>{h[r.source]&&(h[r.source].events.push(r),h[r.source].count+=1)})),h},[d]),T=async()=>{try{if(b(!0),!l)return;const r=await(await fetch(`https://${l}/.well-known/service/openevent.json`)).json();c(r),p(null)}catch(h){p(h instanceof Error?h:new Error(String(h)))}finally{b(!1)}};return C.useEffect(()=>{T()},[l]),{openEvent:d,setOpenEvent:c,eventsBySource:v,loading:a,error:R,loadData:T}};function te({eventsBySource:t,selectedEvents:d,setSelectedEvents:c,error:a}){const{t:b}=q(),[R,p]=C.useState({}),n=C.useMemo(()=>{const r={};return Object.entries(t).forEach(([w,{events:g}])=>{const E=g.filter(u=>d[`${u.type}-${u.source}`]).length;r[w]=E}),r},[t,d]),l=C.useMemo(()=>Object.values(n).reduce((r,w)=>r+w,0),[n]),v=C.useMemo(()=>Object.values(t).reduce((r,{events:w})=>r+w.length,0),[t]),T=(r,w)=>{w.stopPropagation(),p({...R,[r]:!R[r]})},j=r=>{const w=`${r.type}-${r.source}`;c(g=>({...g,[w]:!g[w]}))},y=(r,w)=>{const g={};r.forEach(E=>{const u=`${E.type}-${E.source}`;g[u]=!w}),c(E=>({...E,...g}))},h=r=>{const w={};Object.values(t).forEach(({events:g})=>{g.forEach(E=>{const u=`${E.type}-${E.source}`;w[u]=r.target.checked})}),c(w)};return e.jsxs(f,{sx:{width:"100%"},children:[e.jsxs(f,{sx:{display:"flex",alignItems:"center",mb:1,mt:1},children:[e.jsx(le,{control:e.jsx(V,{onChange:h,checked:l>0&&l===v}),label:e.jsxs(f,{sx:{display:"flex",alignItems:"center",cursor:"pointer"},children:[b("webhookEndpoint.selectAllEvents"),e.jsx(f,{sx:{display:"flex",alignItems:"center"},children:e.jsx(A,{title:b("webhookEndpoint.selectAllEventsTooltip"),placement:"right",children:e.jsx(Z,{fontSize:"small",sx:{ml:.5,cursor:"help"}})})})]}),sx:{m:0}}),l>0&&e.jsx(S,{variant:"body2",color:"primary",sx:{ml:"auto"},children:b("webhookEndpoint.selectedEventsCount",{count:l})})]}),e.jsx(f,{sx:{maxHeight:"50vh",overflow:"auto"},children:e.jsx(G,{disablePadding:!0,sx:{border:"1px solid #e0e0e0",borderRadius:"4px"},children:Object.entries(t).map(([r,{source:w,events:g,count:E}],u)=>{const M=n[r]>0,i=n[r]===g.length&&g.length>0,x=R[r];return e.jsxs(X.Fragment,{children:[e.jsx(Q,{sx:{borderBottom:u<Object.keys(t).length-1?"1px solid #f0f0f0":"none",px:2,py:1.5,"&:hover":{bgcolor:"rgba(0, 0, 0, 0.02)"}},children:e.jsxs(f,{sx:{display:"flex",width:"100%",justifyContent:"space-between",alignItems:"center"},onClick:s=>{s.target.closest(".MuiFormControlLabel-root")||T(r,s)},children:[e.jsx(f,{sx:{display:"flex",alignItems:"center"},children:g.length>0&&e.jsx(le,{control:e.jsx(V,{checked:i,indeterminate:M&&!i,onChange:s=>{s.stopPropagation(),y(g,i)}}),label:e.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:1},children:[w.logo&&e.jsx(Se,{src:w.logo,sx:{width:24,height:24}}),e.jsx(f,{children:w.title||r}),M&&e.jsx(O,{label:b("webhookEndpoint.selectedCount",{count:n[r]}),size:"small",sx:{mt:"2px",height:"20px",fontSize:"12px",bgcolor:s=>`${s.palette.primary.main}20`,color:"primary.main",fontWeight:500}})]}),sx:{m:0,"& .MuiFormControlLabel-label":{flex:1}}})}),e.jsxs(f,{sx:{display:"flex",alignItems:"center"},children:[e.jsx(S,{variant:"body2",color:"text.secondary",sx:{mr:1},children:b("webhookEndpoint.eventsCount",{count:E})}),g.length>0&&e.jsx(_,{size:"small",edge:"end",children:x?e.jsx(Ve,{}):e.jsx(Ke,{})})]})]})}),g.length>0&&e.jsx(Re,{in:x,timeout:"auto",unmountOnExit:!0,children:e.jsx(G,{disablePadding:!0,sx:{pl:2,pr:2,py:1,bgcolor:"rgba(0, 0, 0, 0.01)"},children:g.map(s=>{const m=`${s.type}-${s.source}`,k=!!d[m];return e.jsx(Q,{dense:!0,sx:{py:.75},onClick:()=>j(s),children:e.jsxs(f,{sx:{display:"flex",alignItems:"flex-start",width:"100%"},children:[e.jsx(V,{checked:k,sx:{mr:1}}),e.jsxs(f,{children:[e.jsx(S,{variant:"body1",sx:{cursor:"pointer"},children:s.type}),e.jsx(S,{variant:"caption",color:"text.disabled",sx:{display:"block",cursor:"pointer"},children:s.description})]})]})},m)})})})]},r)})})}),a&&e.jsx(Ie,{error:!0,sx:{mt:1},children:a})]})}te.propTypes={eventsBySource:o.objectOf(o.shape({source:o.shape({did:o.string.isRequired,title:o.string,description:o.string,version:o.string,logo:o.string}).isRequired,events:o.arrayOf(o.shape({type:o.string.isRequired,description:o.string.isRequired,source:o.string.isRequired})).isRequired,count:o.number.isRequired})).isRequired,selectedEvents:o.objectOf(o.bool).isRequired,setSelectedEvents:o.func.isRequired,error:o.string};te.defaultProps={error:null};function oe({id:t,url:d,description:c,enabledEvents:a,onSubmit:b,onClose:R}){var s;const{t:p}=q(),[n,l]=C.useState({}),{teamDid:v}=F(),{api:T}=N(),{loading:j,error:y,eventsBySource:h}=Xe(),{control:r,handleSubmit:w,formState:{errors:g},reset:E,setValue:u,trigger:M}=_e({defaultValues:{url:"",description:""}});C.useEffect(()=>{const m=Object.values(n).some(k=>k);u("selectedEvents",m?"valid":""),M("selectedEvents")},[n,u,M]);const i=()=>{l({}),E(),R()},x=async m=>{const k=Object.keys(n).filter(I=>n[I]),D={url:m.url,description:m.description,enabledEvents:k.map(I=>{const[$,L]=I.split("-");return!$||!L?null:{type:$,source:L}}).filter(Boolean)};try{if(t){const I=await T.updateWebhookEndpoint({input:{teamDid:v,id:t,data:D}});z.success(`${p("webhookEndpoint.updateWebhook")} ${p("webhookEndpoint.success")}`),b(I)}else{const I=await T.createWebhookEndpoint({input:{teamDid:v,input:D}});z.success(`${p("webhookEndpoint.createWebhook")} ${p("webhookEndpoint.success")}`),b(I)}}catch(I){z.error(I==null?void 0:I.message)}i()};return C.useEffect(()=>{E({url:d,description:c}),l(a.reduce((m,k)=>(m[`${k.type}-${k.source}`]=!0,m),{}))},[E,l,d,c,a]),e.jsx(ve,{open:!0,onClose:i,maxWidth:"lg",fullWidth:!0,sx:{"& .MuiDialog-paper":{minHeight:600}},children:e.jsxs("form",{onSubmit:w(x),children:[e.jsx(Ee,{children:p(t?"webhookEndpoint.editWebhookTitle":"webhookEndpoint.createWebhookTitle")}),e.jsx(Ce,{children:e.jsxs(f,{sx:{display:"flex",flexDirection:"column",gap:2,mt:2},children:[e.jsx(J,{name:"url",control:r,rules:{required:p("webhookEndpoint.validation.urlRequired"),pattern:{value:/^(http|https):\/\/[^ "]+$/,message:p("webhookEndpoint.validation.urlInvalid")}},render:({field:m})=>{var k;return e.jsx(ie,{...m,label:p("webhookEndpoint.url.label"),fullWidth:!0,error:!!g.url,helperText:(k=g.url)==null?void 0:k.message})}}),e.jsx(J,{name:"description",control:r,rules:{required:p("webhookEndpoint.validation.descriptionRequired")},render:({field:m})=>{var k;return e.jsx(ie,{...m,label:p("webhookEndpoint.description.label"),fullWidth:!0,multiline:!0,minRows:2,maxRows:4,error:!!g.description,helperText:(k=g.description)==null?void 0:k.message})}}),e.jsx(J,{name:"selectedEvents",control:r,rules:{required:p("webhookEndpoint.validation.eventRequired")},render:({field:m})=>e.jsx("input",{type:"hidden",...m})}),!j&&h&&Object.keys(h).length>0&&e.jsx(te,{eventsBySource:h,selectedEvents:n,setSelectedEvents:l,error:(s=g.selectedEvents)==null?void 0:s.message}),!j&&(!h||Object.keys(h).length===0)&&e.jsx(S,{color:"text.secondary",children:p("webhookEndpoint.noAvailableEvents")}),j&&e.jsx(f,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"500px",width:"100%"},children:e.jsx(U,{size:20})}),y&&e.jsx(ee,{severity:"error",children:p("webhookEndpoint.loadingError",{message:y==null?void 0:y.message})})]})}),e.jsxs(Te,{sx:{p:"8px 24px 24px"},children:[e.jsx(B,{onClick:i,children:p("common.cancel")}),e.jsx(B,{type:"submit",variant:"contained",color:"primary",children:p(t?"webhookEndpoint.updateWebhook":"webhookEndpoint.saveWebhook")})]})]})})}oe.propTypes={onSubmit:o.func.isRequired,id:o.string,url:o.string,description:o.string,enabledEvents:o.arrayOf(o.shape({type:o.string.isRequired,source:o.string.isRequired})),onClose:o.func};oe.defaultProps={id:null,url:"",description:"",enabledEvents:[],onClose:()=>{}};function he(t){switch(t){case"enabled":return"success";case"disabled":default:return"default"}}const Ze=(t="en")=>t==="tw"?"zh":t;function H(t,d="YYYY-MM-DD HH:mm:ss",c="en"){return t?ke(t).locale(Ze(c)).format(d):"-"}function et(t){return typeof t=="number"?!1:ue(t)}function tt(t){return t>=200&&t<300}function W(t){const d=et(t.value);return e.jsxs(e.Fragment,{children:[e.jsxs(P,{direction:"column",alignItems:"flex-start",children:[e.jsxs(S,{component:"div",variant:"body1",mb:1,color:"text.primary",sx:{fontWeight:500},children:[t.label,!!t.tip&&e.jsx(A,{title:t.tip,children:e.jsx(Me,{fontSize:"small"})})]}),e.jsx(S,{component:"div",variant:"body1",color:d?"text.disabled":"text.secondary",sx:{width:"100%",minHeight:"24px"},children:d?"-":t.value})]}),t.divider&&e.jsx(Pe,{orientation:"vertical",flexItem:!0})]})}W.propTypes={label:o.oneOfType([o.string,o.node]).isRequired,value:o.oneOfType([o.string,o.node]).isRequired,tip:o.oneOfType([o.string,o.node]),divider:o.bool};W.defaultProps={tip:"",divider:!1};function ne(t){return e.jsxs(P,{className:"section-header",direction:"row",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:1,sx:{mb:t.mb,mt:t.mt,pb:1},children:[e.jsx(S,{variant:"h3",sx:{fontSize:{xs:"18px",md:"1.09375rem"}},component:"div",children:t.title}),t.children]})}ne.propTypes={title:o.oneOfType([o.string,o.node]).isRequired,children:o.node,mb:o.number,mt:o.number};ne.defaultProps={children:null,mb:1.5,mt:1.5};const ot={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6H6a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-6m-7 1l9-9m-5 0h5v5"/>'},nt=t=>{const d={};return t.forEach(c=>{var b;const a=new Date(c.createdAt).toLocaleDateString();d[a]||(d[a]=[]),(b=d[a])==null||b.push(c)}),d};function se({eventId:t,webhookEndpointId:d,event:c}){const{api:a}=N(),{t:b}=q(),{teamDid:R}=F(),{blocklet:p}=ce(),{data:n,loadMore:l,loadingMore:v,loading:T}=ye(u=>{const i=u?Math.ceil(u.list.length/15)+1:1;return a.getWebhookAttempts({input:{teamDid:R,input:{eventId:t,webhookId:d},paging:{page:i,pageSize:15}}})},{reloadDeps:[t,d]}),j=(n==null?void 0:n.list)||[],[y,h]=C.useState(null),r=nt(j);C.useEffect(()=>{!y&&(n!=null&&n.list.length)&&h(n.list[0])},[n==null?void 0:n.list.length,y]);const w=u=>{h(u)};if(T)return e.jsx(U,{});const g=n&&n.list.length<n.paging.total,E=u=>{var M,i,x,s,m;if(u.responseBody&&((M=u.responseBody)!=null&&M.sessionId)&&((i=u.responseBody)!=null&&i.projectId)&&((x=u.responseBody)!=null&&x.agentId)){const k=(m=(s=p==null?void 0:p.site)==null?void 0:s.domainAliases[0])==null?void 0:m.value,D=(p.children||[]).find($=>{var L;return((L=$==null?void 0:$.meta)==null?void 0:L.name)==="ai-studio"}),I=Ye(Je(`https://${k}`,(D==null?void 0:D.mountPoint)||"","projects",u.responseBody.projectId,"logs/main"),{sessionId:u.responseBody.sessionId,agentId:u.responseBody.agentId});return e.jsx(_,{sx:{fontSize:20},onClick:()=>window.open(I,"_blank"),children:e.jsx(f,{component:be,icon:ot})})}return null};return e.jsxs(Y,{container:!0,spacing:{xs:0,md:1},sx:{height:1},children:[e.jsx(Y,{item:!0,xs:12,md:4,height:1,children:ue(Object.keys(r))?e.jsx(S,{color:"text.secondary",children:b("webhookEndpoint.waitingForEvents")}):e.jsxs(e.Fragment,{children:[e.jsx(G,{sx:{maxHeight:"calc(100% - 40px)",py:0,overflowY:"auto"},children:Object.entries(r).map(([u,M])=>e.jsxs(X.Fragment,{children:[e.jsx(De,{children:u}),M.map(i=>e.jsxs(Q,{sx:{cursor:"pointer"},onClick:()=>w(i),selected:y===i,secondaryAction:e.jsx(S,{color:"text.secondary",children:H(i.createdAt,"HH:mm:ss")}),children:[e.jsx(We,{sx:{minWidth:0,mr:1.5},children:tt(i.responseStatus)===!1?e.jsx(ze,{color:"error"}):e.jsx(Ae,{color:"success"})}),e.jsx(Oe,{primary:e.jsx(S,{color:"text.primary",children:i.event.type})})]},i.id))]},u))}),g&&e.jsx(f,{display:"flex",justifyContent:"center",alignItems:"center",width:1,children:e.jsx(B,{variant:"text",type:"button",color:"inherit",onClick:l,disabled:v,sx:{color:u=>u.palette.text.disabled},children:b(v?"webhookEndpoint.loadingMore":"webhookEndpoint.loadMore")})})]})}),e.jsxs(Y,{item:!0,xs:12,md:8,height:1,children:[y&&e.jsxs(P,{height:1,overflow:"auto",direction:"column",spacing:2,sx:{pl:{xs:0,md:1},mt:{xs:2,md:0},borderLeft:{xs:"none"}},children:[e.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(S,{variant:"h6",children:t?y.endpoint.url:y.event.type}),e.jsx(f,{children:E(y)})]}),e.jsxs(f,{children:[e.jsxs(S,{variant:"h6",children:[b("webhookEndpoint.response")," (",y.responseStatus,")"]}),e.jsx(K,{language:"json",children:JSON.stringify(y.responseBody,null,2)})]}),e.jsxs(f,{children:[e.jsx(P,{direction:"row",alignItems:"center",spacing:1,children:e.jsx(S,{variant:"h6",children:b("webhookEndpoint.request")})}),e.jsx(K,{language:"json",sx:{margin:0},children:JSON.stringify(y.event,null,2)})]})]}),(n==null?void 0:n.list.length)===0&&c&&e.jsxs(f,{children:[e.jsx(P,{direction:"row",alignItems:"center",spacing:1,children:e.jsx(S,{variant:"h6",children:b("webhookEndpoint.eventData")})}),e.jsx(K,{language:"json",sx:{margin:0},children:JSON.stringify(c.data,null,2)})]})]})]})}se.propTypes={eventId:o.string,webhookEndpointId:o.string,event:o.shape({type:o.string,data:o.object,request:o.object,requestInfo:o.object})};se.defaultProps={eventId:"",webhookEndpointId:"",event:null};function xe({id:t,onClose:d}){var v,T,j,y;const{t:c}=q(),{api:a}=N(),{teamDid:b}=F(),{loading:R,error:p,data:n}=de(()=>a.getWebhookEndpoint({input:{teamDid:b,id:t}})),l=n==null?void 0:n.data;return p?e.jsx(ee,{severity:"error",children:p.message}):R||!l?e.jsx(f,{display:"flex",justifyContent:"center",alignItems:"center",height:1,width:1,children:e.jsx(U,{})}):e.jsxs(st,{direction:"column",sx:{height:{xs:"auto",md:1}},children:[e.jsxs(f,{children:[e.jsxs(P,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[e.jsx(P,{flex:1,width:0,children:e.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(S,{variant:"h5",fontWeight:600,sx:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},children:l.description}),e.jsx(A,{title:l.url,children:e.jsx(Z,{sx:{fontSize:"16px",marginTop:"2px"}})})]})}),e.jsx(P,{direction:"row",alignItems:"center",children:e.jsx(_,{edge:"end",color:"inherit",onClick:d,children:e.jsx(qe,{})})})]}),e.jsx(f,{mt:2,children:e.jsxs(P,{className:"section-body",direction:{xs:"column",md:"row"},spacing:{xs:1,md:3},justifyContent:"flex-start",flexWrap:"wrap",sx:{pt:2,mt:2,borderTop:"1px solid #eee"},children:[e.jsx(W,{label:c("common.status"),value:e.jsx(O,{size:"small",variant:"filled",label:l.status,color:he(l.status),sx:{borderRadius:"4px",lineHeight:"20px",textTransform:"capitalize"}}),divider:!0}),e.jsx(W,{label:c("webhookEndpoint.listen"),value:e.jsx(A,{arrow:!0,title:e.jsx("ul",{style:{padding:0,margin:0},children:l.enabledEvents.map(h=>e.jsx("li",{style:{fontSize:"0.7875rem"},children:h==null?void 0:h.type},h))}),children:e.jsx(O,{size:"small",variant:"filled",label:c("webhookEndpoint.eventsCount",{count:l.enabledEvents.length}),sx:{borderRadius:"4px",lineHeight:"20px",textTransform:"capitalize"}})}),divider:!0}),e.jsx(W,{label:c("webhookEndpoint.version"),value:l.apiVersion,divider:!0}),e.jsx(W,{label:c("common.createdAt"),value:H(l.createdAt),divider:!0}),e.jsx(W,{label:c("common.updatedAt"),value:H(l.updatedAt),divider:!0}),e.jsx(W,{label:c("common.createdBy"),value:e.jsx(A,{arrow:!0,title:(v=l.createUser)==null?void 0:v.did,children:e.jsx(O,{size:"small",variant:"filled",label:(T=l.createUser)==null?void 0:T.fullName,sx:{borderRadius:"4px",lineHeight:"20px",textTransform:"capitalize"}})}),divider:!0}),e.jsx(W,{label:c("common.updatedBy"),value:e.jsx(A,{arrow:!0,title:(j=l.updateUser)==null?void 0:j.did,children:e.jsx(O,{size:"small",variant:"filled",label:(y=l.updateUser)==null?void 0:y.fullName,sx:{borderRadius:"4px",lineHeight:"20px",textTransform:"capitalize"}})})})]})})]}),e.jsxs(P,{className:"section",flex:1,height:0,overflow:"hidden",children:[e.jsx(ne,{title:c("webhookEndpoint.attempts"),mb:0,mt:4}),e.jsx(P,{height:0,flex:1,overflow:"hidden",children:e.jsx(se,{webhookEndpointId:l.id})})]})]})}xe.propTypes={id:o.string.isRequired,onClose:o.func.isRequired};const st=pe(P)``;function me({open:t,onClose:d,id:c}){return e.jsx($e,{anchor:"right",open:t,onClose:d,PaperProps:{sx:{width:"90vw",maxWidth:"1200px"}},children:e.jsx(f,{sx:{height:"100vh",p:3},children:e.jsx(xe,{id:c,onClose:d})})})}me.propTypes={open:o.bool.isRequired,onClose:o.func.isRequired,id:o.string.isRequired};function ae(){return null}const re=X.memo(({options:t,columns:d,toolbar:c=!0,footer:a=!0,hasRowLink:b=!1,emptyNodeText:R="",...p})=>{const{locale:n}=q(),l=Le(j=>j.breakpoints.down("md")),v={print:!1,download:!1,filter:!1,selectableRows:"none",rowsPerPage:l?5:10,rowsPerPageOptions:[5,10,20,50,100],searchDebounceTime:300,tableBodyHeight:"100%",loading:!0},T={};return c||(T.TableToolbar=ae),a||(T.TableFooter=ae),e.jsx(rt,{locale:n,options:{...v,...t},columns:(d||[]).map(j=>(j.options=j.options||{},j.options.filter=j.options.filter||!1,j.options.sort=j.options.sort||!1,j)),emptyNode:e.jsx(fe,{children:R}),...p,components:T,hasRowLink:b,isMobile:l})});re.propTypes={options:o.object,columns:o.array,toolbar:o.bool,footer:o.bool,hasRowLink:o.bool,emptyNodeText:o.node,durable:o.string,durableKeys:o.array,data:o.array,loading:o.bool,onChange:o.func,title:o.node,components:o.object};re.defaultProps={options:{},columns:[],toolbar:!0,footer:!0,hasRowLink:!1,emptyNodeText:null,durable:"",durableKeys:[],data:[],loading:!1,onChange:()=>{},title:null,components:{}};const rt=pe(ge)`
1
+ import{u as q,V as z,bK as K,i as be,X as fe,a2 as ge,bC as je}from"./vendor-ux-did-connect-D75Zatzm.js";import{w as ye,l as de,j as we}from"./vendor-hooks-CYyfK9g3.js";import{r as C,b as X}from"./vendor-react-DoD83n6N.js";import{d as Z}from"./InfoOutlined-HP5LuELQ.js";import{z as N,C as ce,G as ke}from"./index-CYdNDqQ1.js";import{u as F}from"./dashboard-C2dbiNOp.js";import{E as o,j as e,D as ve,ab as Ee,r as Ce,a3 as f,M as ie,T as S,a2 as U,ac as ee,y as Te,x as B,bn as le,bO as V,a4 as A,L as G,z as Q,bg as Se,A as O,I as _,C as Re,bl as Ie,ad as P,cG as Me,ak as Pe,bd as Y,bk as De,b1 as We,cH as ze,cI as Ae,b2 as Oe,af as $e,bS as qe,s as pe,t as Le,cJ as Be,cK as He,cL as Ne,cM as Fe,cN as Ue}from"./vendor-mui-core-O22FPGM4.js";import{u as _e,C as J}from"./index.esm-CWepf7I_.js";import{n as Ke}from"./vendor-arcblock-E5QJEgSK.js";import{d as Ve}from"./ExpandLess-BqrBuxL9.js";import{y as ue,w as Ye,x as Je}from"./vendor-utils-CbeKtci8.js";import{C as Ge}from"./confirm-CCmbVvGp.js";import{A as Qe}from"./actions-CBPbCBQc.js";import"./lottie-web-B6s7dDoL.js";import"./useLocalStorage-CtbpqE0c.js";import"./PlayArrow-DI84Lay5.js";import"./get-safe-url-BvS0hy8W.js";import"./format-error-LAoTjvJe.js";import"./index-BsMTGy4m.js";import"./session-CD9NaM-v.js";import"./useAsyncRetry-CEJwVPZ6.js";import"./useAsync-D2OhgEkV.js";import"./useSetState-BL3ktMon.js";import"./MoreHoriz-Cv3BqpRU.js";const Xe=t=>{var j,y;const[d,c]=C.useState(null),[a,b]=C.useState(!t),[R,p]=C.useState(null),{blocklet:n}=ce(),l=(y=(j=n==null?void 0:n.site)==null?void 0:j.domainAliases[0])==null?void 0:y.value,v=C.useMemo(()=>{const h={};return d&&(d.sources.forEach(r=>{h[r.did]={source:r,events:[],count:0}}),d.events.forEach(r=>{h[r.source]&&(h[r.source].events.push(r),h[r.source].count+=1)})),h},[d]),T=async()=>{try{if(b(!0),!l)return;const r=await(await fetch(`https://${l}/.well-known/service/openevent.json`)).json();c(r),p(null)}catch(h){p(h instanceof Error?h:new Error(String(h)))}finally{b(!1)}};return C.useEffect(()=>{T()},[l]),{openEvent:d,setOpenEvent:c,eventsBySource:v,loading:a,error:R,loadData:T}};function te({eventsBySource:t,selectedEvents:d,setSelectedEvents:c,error:a}){const{t:b}=q(),[R,p]=C.useState({}),n=C.useMemo(()=>{const r={};return Object.entries(t).forEach(([w,{events:g}])=>{const E=g.filter(u=>d[`${u.type}-${u.source}`]).length;r[w]=E}),r},[t,d]),l=C.useMemo(()=>Object.values(n).reduce((r,w)=>r+w,0),[n]),v=C.useMemo(()=>Object.values(t).reduce((r,{events:w})=>r+w.length,0),[t]),T=(r,w)=>{w.stopPropagation(),p({...R,[r]:!R[r]})},j=r=>{const w=`${r.type}-${r.source}`;c(g=>({...g,[w]:!g[w]}))},y=(r,w)=>{const g={};r.forEach(E=>{const u=`${E.type}-${E.source}`;g[u]=!w}),c(E=>({...E,...g}))},h=r=>{const w={};Object.values(t).forEach(({events:g})=>{g.forEach(E=>{const u=`${E.type}-${E.source}`;w[u]=r.target.checked})}),c(w)};return e.jsxs(f,{sx:{width:"100%"},children:[e.jsxs(f,{sx:{display:"flex",alignItems:"center",mb:1,mt:1},children:[e.jsx(le,{control:e.jsx(V,{onChange:h,checked:l>0&&l===v}),label:e.jsxs(f,{sx:{display:"flex",alignItems:"center",cursor:"pointer"},children:[b("webhookEndpoint.selectAllEvents"),e.jsx(f,{sx:{display:"flex",alignItems:"center"},children:e.jsx(A,{title:b("webhookEndpoint.selectAllEventsTooltip"),placement:"right",children:e.jsx(Z,{fontSize:"small",sx:{ml:.5,cursor:"help"}})})})]}),sx:{m:0}}),l>0&&e.jsx(S,{variant:"body2",color:"primary",sx:{ml:"auto"},children:b("webhookEndpoint.selectedEventsCount",{count:l})})]}),e.jsx(f,{sx:{maxHeight:"50vh",overflow:"auto"},children:e.jsx(G,{disablePadding:!0,sx:{border:"1px solid #e0e0e0",borderRadius:"4px"},children:Object.entries(t).map(([r,{source:w,events:g,count:E}],u)=>{const M=n[r]>0,i=n[r]===g.length&&g.length>0,x=R[r];return e.jsxs(X.Fragment,{children:[e.jsx(Q,{sx:{borderBottom:u<Object.keys(t).length-1?"1px solid #f0f0f0":"none",px:2,py:1.5,"&:hover":{bgcolor:"rgba(0, 0, 0, 0.02)"}},children:e.jsxs(f,{sx:{display:"flex",width:"100%",justifyContent:"space-between",alignItems:"center"},onClick:s=>{s.target.closest(".MuiFormControlLabel-root")||T(r,s)},children:[e.jsx(f,{sx:{display:"flex",alignItems:"center"},children:g.length>0&&e.jsx(le,{control:e.jsx(V,{checked:i,indeterminate:M&&!i,onChange:s=>{s.stopPropagation(),y(g,i)}}),label:e.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:1},children:[w.logo&&e.jsx(Se,{src:w.logo,sx:{width:24,height:24}}),e.jsx(f,{children:w.title||r}),M&&e.jsx(O,{label:b("webhookEndpoint.selectedCount",{count:n[r]}),size:"small",sx:{mt:"2px",height:"20px",fontSize:"12px",bgcolor:s=>`${s.palette.primary.main}20`,color:"primary.main",fontWeight:500}})]}),sx:{m:0,"& .MuiFormControlLabel-label":{flex:1}}})}),e.jsxs(f,{sx:{display:"flex",alignItems:"center"},children:[e.jsx(S,{variant:"body2",color:"text.secondary",sx:{mr:1},children:b("webhookEndpoint.eventsCount",{count:E})}),g.length>0&&e.jsx(_,{size:"small",edge:"end",children:x?e.jsx(Ve,{}):e.jsx(Ke,{})})]})]})}),g.length>0&&e.jsx(Re,{in:x,timeout:"auto",unmountOnExit:!0,children:e.jsx(G,{disablePadding:!0,sx:{pl:2,pr:2,py:1,bgcolor:"rgba(0, 0, 0, 0.01)"},children:g.map(s=>{const m=`${s.type}-${s.source}`,k=!!d[m];return e.jsx(Q,{dense:!0,sx:{py:.75},onClick:()=>j(s),children:e.jsxs(f,{sx:{display:"flex",alignItems:"flex-start",width:"100%"},children:[e.jsx(V,{checked:k,sx:{mr:1}}),e.jsxs(f,{children:[e.jsx(S,{variant:"body1",sx:{cursor:"pointer"},children:s.type}),e.jsx(S,{variant:"caption",color:"text.disabled",sx:{display:"block",cursor:"pointer"},children:s.description})]})]})},m)})})})]},r)})})}),a&&e.jsx(Ie,{error:!0,sx:{mt:1},children:a})]})}te.propTypes={eventsBySource:o.objectOf(o.shape({source:o.shape({did:o.string.isRequired,title:o.string,description:o.string,version:o.string,logo:o.string}).isRequired,events:o.arrayOf(o.shape({type:o.string.isRequired,description:o.string.isRequired,source:o.string.isRequired})).isRequired,count:o.number.isRequired})).isRequired,selectedEvents:o.objectOf(o.bool).isRequired,setSelectedEvents:o.func.isRequired,error:o.string};te.defaultProps={error:null};function oe({id:t,url:d,description:c,enabledEvents:a,onSubmit:b,onClose:R}){var s;const{t:p}=q(),[n,l]=C.useState({}),{teamDid:v}=F(),{api:T}=N(),{loading:j,error:y,eventsBySource:h}=Xe(),{control:r,handleSubmit:w,formState:{errors:g},reset:E,setValue:u,trigger:M}=_e({defaultValues:{url:"",description:""}});C.useEffect(()=>{const m=Object.values(n).some(k=>k);u("selectedEvents",m?"valid":""),M("selectedEvents")},[n,u,M]);const i=()=>{l({}),E(),R()},x=async m=>{const k=Object.keys(n).filter(I=>n[I]),D={url:m.url,description:m.description,enabledEvents:k.map(I=>{const[$,L]=I.split("-");return!$||!L?null:{type:$,source:L}}).filter(Boolean)};try{if(t){const I=await T.updateWebhookEndpoint({input:{teamDid:v,id:t,data:D}});z.success(`${p("webhookEndpoint.updateWebhook")} ${p("webhookEndpoint.success")}`),b(I)}else{const I=await T.createWebhookEndpoint({input:{teamDid:v,input:D}});z.success(`${p("webhookEndpoint.createWebhook")} ${p("webhookEndpoint.success")}`),b(I)}}catch(I){z.error(I==null?void 0:I.message)}i()};return C.useEffect(()=>{E({url:d,description:c}),l(a.reduce((m,k)=>(m[`${k.type}-${k.source}`]=!0,m),{}))},[E,l,d,c,a]),e.jsx(ve,{open:!0,onClose:i,maxWidth:"lg",fullWidth:!0,sx:{"& .MuiDialog-paper":{minHeight:600}},children:e.jsxs("form",{onSubmit:w(x),children:[e.jsx(Ee,{children:p(t?"webhookEndpoint.editWebhookTitle":"webhookEndpoint.createWebhookTitle")}),e.jsx(Ce,{children:e.jsxs(f,{sx:{display:"flex",flexDirection:"column",gap:2,mt:2},children:[e.jsx(J,{name:"url",control:r,rules:{required:p("webhookEndpoint.validation.urlRequired"),pattern:{value:/^(http|https):\/\/[^ "]+$/,message:p("webhookEndpoint.validation.urlInvalid")}},render:({field:m})=>{var k;return e.jsx(ie,{...m,label:p("webhookEndpoint.url.label"),fullWidth:!0,error:!!g.url,helperText:(k=g.url)==null?void 0:k.message})}}),e.jsx(J,{name:"description",control:r,rules:{required:p("webhookEndpoint.validation.descriptionRequired")},render:({field:m})=>{var k;return e.jsx(ie,{...m,label:p("webhookEndpoint.description.label"),fullWidth:!0,multiline:!0,minRows:2,maxRows:4,error:!!g.description,helperText:(k=g.description)==null?void 0:k.message})}}),e.jsx(J,{name:"selectedEvents",control:r,rules:{required:p("webhookEndpoint.validation.eventRequired")},render:({field:m})=>e.jsx("input",{type:"hidden",...m})}),!j&&h&&Object.keys(h).length>0&&e.jsx(te,{eventsBySource:h,selectedEvents:n,setSelectedEvents:l,error:(s=g.selectedEvents)==null?void 0:s.message}),!j&&(!h||Object.keys(h).length===0)&&e.jsx(S,{color:"text.secondary",children:p("webhookEndpoint.noAvailableEvents")}),j&&e.jsx(f,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"500px",width:"100%"},children:e.jsx(U,{size:20})}),y&&e.jsx(ee,{severity:"error",children:p("webhookEndpoint.loadingError",{message:y==null?void 0:y.message})})]})}),e.jsxs(Te,{sx:{p:"8px 24px 24px"},children:[e.jsx(B,{onClick:i,children:p("common.cancel")}),e.jsx(B,{type:"submit",variant:"contained",color:"primary",children:p(t?"webhookEndpoint.updateWebhook":"webhookEndpoint.saveWebhook")})]})]})})}oe.propTypes={onSubmit:o.func.isRequired,id:o.string,url:o.string,description:o.string,enabledEvents:o.arrayOf(o.shape({type:o.string.isRequired,source:o.string.isRequired})),onClose:o.func};oe.defaultProps={id:null,url:"",description:"",enabledEvents:[],onClose:()=>{}};function he(t){switch(t){case"enabled":return"success";case"disabled":default:return"default"}}const Ze=(t="en")=>t==="tw"?"zh":t;function H(t,d="YYYY-MM-DD HH:mm:ss",c="en"){return t?ke(t).locale(Ze(c)).format(d):"-"}function et(t){return typeof t=="number"?!1:ue(t)}function tt(t){return t>=200&&t<300}function W(t){const d=et(t.value);return e.jsxs(e.Fragment,{children:[e.jsxs(P,{direction:"column",alignItems:"flex-start",children:[e.jsxs(S,{component:"div",variant:"body1",mb:1,color:"text.primary",sx:{fontWeight:500},children:[t.label,!!t.tip&&e.jsx(A,{title:t.tip,children:e.jsx(Me,{fontSize:"small"})})]}),e.jsx(S,{component:"div",variant:"body1",color:d?"text.disabled":"text.secondary",sx:{width:"100%",minHeight:"24px"},children:d?"-":t.value})]}),t.divider&&e.jsx(Pe,{orientation:"vertical",flexItem:!0})]})}W.propTypes={label:o.oneOfType([o.string,o.node]).isRequired,value:o.oneOfType([o.string,o.node]).isRequired,tip:o.oneOfType([o.string,o.node]),divider:o.bool};W.defaultProps={tip:"",divider:!1};function ne(t){return e.jsxs(P,{className:"section-header",direction:"row",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:1,sx:{mb:t.mb,mt:t.mt,pb:1},children:[e.jsx(S,{variant:"h3",sx:{fontSize:{xs:"18px",md:"1.09375rem"}},component:"div",children:t.title}),t.children]})}ne.propTypes={title:o.oneOfType([o.string,o.node]).isRequired,children:o.node,mb:o.number,mt:o.number};ne.defaultProps={children:null,mb:1.5,mt:1.5};const ot={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6H6a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-6m-7 1l9-9m-5 0h5v5"/>'},nt=t=>{const d={};return t.forEach(c=>{var b;const a=new Date(c.createdAt).toLocaleDateString();d[a]||(d[a]=[]),(b=d[a])==null||b.push(c)}),d};function se({eventId:t,webhookEndpointId:d,event:c}){const{api:a}=N(),{t:b}=q(),{teamDid:R}=F(),{blocklet:p}=ce(),{data:n,loadMore:l,loadingMore:v,loading:T}=ye(u=>{const i=u?Math.ceil(u.list.length/15)+1:1;return a.getWebhookAttempts({input:{teamDid:R,input:{eventId:t,webhookId:d},paging:{page:i,pageSize:15}}})},{reloadDeps:[t,d]}),j=(n==null?void 0:n.list)||[],[y,h]=C.useState(null),r=nt(j);C.useEffect(()=>{!y&&(n!=null&&n.list.length)&&h(n.list[0])},[n==null?void 0:n.list.length,y]);const w=u=>{h(u)};if(T)return e.jsx(U,{});const g=n&&n.list.length<n.paging.total,E=u=>{var M,i,x,s,m;if(u.responseBody&&((M=u.responseBody)!=null&&M.sessionId)&&((i=u.responseBody)!=null&&i.projectId)&&((x=u.responseBody)!=null&&x.agentId)){const k=(m=(s=p==null?void 0:p.site)==null?void 0:s.domainAliases[0])==null?void 0:m.value,D=(p.children||[]).find($=>{var L;return((L=$==null?void 0:$.meta)==null?void 0:L.name)==="ai-studio"}),I=Ye(Je(`https://${k}`,(D==null?void 0:D.mountPoint)||"","projects",u.responseBody.projectId,"logs/main"),{sessionId:u.responseBody.sessionId,agentId:u.responseBody.agentId});return e.jsx(_,{sx:{fontSize:20},onClick:()=>window.open(I,"_blank"),children:e.jsx(f,{component:be,icon:ot})})}return null};return e.jsxs(Y,{container:!0,spacing:{xs:0,md:1},sx:{height:1},children:[e.jsx(Y,{item:!0,xs:12,md:4,height:1,children:ue(Object.keys(r))?e.jsx(S,{color:"text.secondary",children:b("webhookEndpoint.waitingForEvents")}):e.jsxs(e.Fragment,{children:[e.jsx(G,{sx:{maxHeight:"calc(100% - 40px)",py:0,overflowY:"auto"},children:Object.entries(r).map(([u,M])=>e.jsxs(X.Fragment,{children:[e.jsx(De,{children:u}),M.map(i=>e.jsxs(Q,{sx:{cursor:"pointer"},onClick:()=>w(i),selected:y===i,secondaryAction:e.jsx(S,{color:"text.secondary",children:H(i.createdAt,"HH:mm:ss")}),children:[e.jsx(We,{sx:{minWidth:0,mr:1.5},children:tt(i.responseStatus)===!1?e.jsx(ze,{color:"error"}):e.jsx(Ae,{color:"success"})}),e.jsx(Oe,{primary:e.jsx(S,{color:"text.primary",children:i.event.type})})]},i.id))]},u))}),g&&e.jsx(f,{display:"flex",justifyContent:"center",alignItems:"center",width:1,children:e.jsx(B,{variant:"text",type:"button",color:"inherit",onClick:l,disabled:v,sx:{color:u=>u.palette.text.disabled},children:b(v?"webhookEndpoint.loadingMore":"webhookEndpoint.loadMore")})})]})}),e.jsxs(Y,{item:!0,xs:12,md:8,height:1,children:[y&&e.jsxs(P,{height:1,overflow:"auto",direction:"column",spacing:2,sx:{pl:{xs:0,md:1},mt:{xs:2,md:0},borderLeft:{xs:"none"}},children:[e.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(S,{variant:"h6",children:t?y.endpoint.url:y.event.type}),e.jsx(f,{children:E(y)})]}),e.jsxs(f,{children:[e.jsxs(S,{variant:"h6",children:[b("webhookEndpoint.response")," (",y.responseStatus,")"]}),e.jsx(K,{language:"json",children:JSON.stringify(y.responseBody,null,2)})]}),e.jsxs(f,{children:[e.jsx(P,{direction:"row",alignItems:"center",spacing:1,children:e.jsx(S,{variant:"h6",children:b("webhookEndpoint.request")})}),e.jsx(K,{language:"json",sx:{margin:0},children:JSON.stringify(y.event,null,2)})]})]}),(n==null?void 0:n.list.length)===0&&c&&e.jsxs(f,{children:[e.jsx(P,{direction:"row",alignItems:"center",spacing:1,children:e.jsx(S,{variant:"h6",children:b("webhookEndpoint.eventData")})}),e.jsx(K,{language:"json",sx:{margin:0},children:JSON.stringify(c.data,null,2)})]})]})]})}se.propTypes={eventId:o.string,webhookEndpointId:o.string,event:o.shape({type:o.string,data:o.object,request:o.object,requestInfo:o.object})};se.defaultProps={eventId:"",webhookEndpointId:"",event:null};function xe({id:t,onClose:d}){var v,T,j,y;const{t:c}=q(),{api:a}=N(),{teamDid:b}=F(),{loading:R,error:p,data:n}=de(()=>a.getWebhookEndpoint({input:{teamDid:b,id:t}})),l=n==null?void 0:n.data;return p?e.jsx(ee,{severity:"error",children:p.message}):R||!l?e.jsx(f,{display:"flex",justifyContent:"center",alignItems:"center",height:1,width:1,children:e.jsx(U,{})}):e.jsxs(st,{direction:"column",sx:{height:{xs:"auto",md:1}},children:[e.jsxs(f,{children:[e.jsxs(P,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[e.jsx(P,{flex:1,width:0,children:e.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(S,{variant:"h5",fontWeight:600,sx:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},children:l.description}),e.jsx(A,{title:l.url,children:e.jsx(Z,{sx:{fontSize:"16px",marginTop:"2px"}})})]})}),e.jsx(P,{direction:"row",alignItems:"center",children:e.jsx(_,{edge:"end",color:"inherit",onClick:d,children:e.jsx(qe,{})})})]}),e.jsx(f,{mt:2,children:e.jsxs(P,{className:"section-body",direction:{xs:"column",md:"row"},spacing:{xs:1,md:3},justifyContent:"flex-start",flexWrap:"wrap",sx:{pt:2,mt:2,borderTop:"1px solid #eee"},children:[e.jsx(W,{label:c("common.status"),value:e.jsx(O,{size:"small",variant:"filled",label:l.status,color:he(l.status),sx:{borderRadius:"4px",lineHeight:"20px",textTransform:"capitalize"}}),divider:!0}),e.jsx(W,{label:c("webhookEndpoint.listen"),value:e.jsx(A,{arrow:!0,title:e.jsx("ul",{style:{padding:0,margin:0},children:l.enabledEvents.map(h=>e.jsx("li",{style:{fontSize:"0.7875rem"},children:h==null?void 0:h.type},h))}),children:e.jsx(O,{size:"small",variant:"filled",label:c("webhookEndpoint.eventsCount",{count:l.enabledEvents.length}),sx:{borderRadius:"4px",lineHeight:"20px",textTransform:"capitalize"}})}),divider:!0}),e.jsx(W,{label:c("webhookEndpoint.version"),value:l.apiVersion,divider:!0}),e.jsx(W,{label:c("common.createdAt"),value:H(l.createdAt),divider:!0}),e.jsx(W,{label:c("common.updatedAt"),value:H(l.updatedAt),divider:!0}),e.jsx(W,{label:c("common.createdBy"),value:e.jsx(A,{arrow:!0,title:(v=l.createUser)==null?void 0:v.did,children:e.jsx(O,{size:"small",variant:"filled",label:(T=l.createUser)==null?void 0:T.fullName,sx:{borderRadius:"4px",lineHeight:"20px",textTransform:"capitalize"}})}),divider:!0}),e.jsx(W,{label:c("common.updatedBy"),value:e.jsx(A,{arrow:!0,title:(j=l.updateUser)==null?void 0:j.did,children:e.jsx(O,{size:"small",variant:"filled",label:(y=l.updateUser)==null?void 0:y.fullName,sx:{borderRadius:"4px",lineHeight:"20px",textTransform:"capitalize"}})})})]})})]}),e.jsxs(P,{className:"section",flex:1,height:0,overflow:"hidden",children:[e.jsx(ne,{title:c("webhookEndpoint.attempts"),mb:0,mt:4}),e.jsx(P,{height:0,flex:1,overflow:"hidden",children:e.jsx(se,{webhookEndpointId:l.id})})]})]})}xe.propTypes={id:o.string.isRequired,onClose:o.func.isRequired};const st=pe(P)``;function me({open:t,onClose:d,id:c}){return e.jsx($e,{anchor:"right",open:t,onClose:d,PaperProps:{sx:{width:"90vw",maxWidth:"1200px"}},children:e.jsx(f,{sx:{height:"100vh",p:3},children:e.jsx(xe,{id:c,onClose:d})})})}me.propTypes={open:o.bool.isRequired,onClose:o.func.isRequired,id:o.string.isRequired};function ae(){return null}const re=X.memo(({options:t,columns:d,toolbar:c=!0,footer:a=!0,hasRowLink:b=!1,emptyNodeText:R="",...p})=>{const{locale:n}=q(),l=Le(j=>j.breakpoints.down("md")),v={print:!1,download:!1,filter:!1,selectableRows:"none",rowsPerPage:l?5:10,rowsPerPageOptions:[5,10,20,50,100],searchDebounceTime:300,tableBodyHeight:"100%",loading:!0},T={};return c||(T.TableToolbar=ae),a||(T.TableFooter=ae),e.jsx(rt,{locale:n,options:{...v,...t},columns:(d||[]).map(j=>(j.options=j.options||{},j.options.filter=j.options.filter||!1,j.options.sort=j.options.sort||!1,j)),emptyNode:e.jsx(fe,{children:R}),...p,components:T,hasRowLink:b,isMobile:l})});re.propTypes={options:o.object,columns:o.array,toolbar:o.bool,footer:o.bool,hasRowLink:o.bool,emptyNodeText:o.node,durable:o.string,durableKeys:o.array,data:o.array,loading:o.bool,onChange:o.func,title:o.node,components:o.object};re.defaultProps={options:{},columns:[],toolbar:!0,footer:!0,hasRowLink:!1,emptyNodeText:null,durable:"",durableKeys:[],data:[],loading:!1,onChange:()=>{},title:null,components:{}};const rt=pe(ge)`
2
2
  .MuiPaper-root {
3
3
  border-radius: 8px;
4
4
  overflow: hidden;
@@ -1,4 +1,4 @@
1
- import{g as w}from"./vendor-react-DoD83n6N.js";import{ae as b}from"./index-Do_PTy2g.js";var x=(n,t=1,e)=>{if(e={indent:" ",includeEmptyLines:!1,...e},typeof n!="string")throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof n}\``);if(typeof t!="number")throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof t}\``);if(typeof e.indent!="string")throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof e.indent}\``);if(t===0)return n;const r=e.includeEmptyLines?/^/gm:/^(?!\s*$)/gm;return n.replace(r,e.indent.repeat(t))};const m=b,E=/\s+at.*(?:\(|\s)(.*)\)?/,$=/^(?:(?:(?:node|(?:internal\/[\w/]*|.*node_modules\/(?:babel-polyfill|pirates)\/.*)?\w+)\.js:\d+:\d+)|native)/,j=typeof m.homedir>"u"?"":m.homedir();var v=(n,t)=>(t=Object.assign({pretty:!1},t),n.replace(/\\/g,"/").split(`
1
+ import{g as w}from"./vendor-react-DoD83n6N.js";import{ae as b}from"./index-CYdNDqQ1.js";var x=(n,t=1,e)=>{if(e={indent:" ",includeEmptyLines:!1,...e},typeof n!="string")throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof n}\``);if(typeof t!="number")throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof t}\``);if(typeof e.indent!="string")throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof e.indent}\``);if(t===0)return n;const r=e.includeEmptyLines?/^/gm:/^(?!\s*$)/gm;return n.replace(r,e.indent.repeat(t))};const m=b,E=/\s+at.*(?:\(|\s)(.*)\)?/,$=/^(?:(?:(?:node|(?:internal\/[\w/]*|.*node_modules\/(?:babel-polyfill|pirates)\/.*)?\w+)\.js:\d+:\d+)|native)/,j=typeof m.homedir>"u"?"":m.homedir();var v=(n,t)=>(t=Object.assign({pretty:!1},t),n.replace(/\\/g,"/").split(`
2
2
  `).filter(e=>{const r=e.match(E);if(r===null||!r[1])return!0;const a=r[1];return a.includes(".app/Contents/Resources/electron.asar")||a.includes(".app/Contents/Resources/default_app.asar")?!1:!$.test(a)}).filter(e=>e.trim()!=="").map(e=>t.pretty?e.replace(E,(r,a)=>r.replace(a,a.replace(j,"~"))):e).join(`
3
3
  `));const A=x,S=v,I=n=>n.replace(/\s+at .*aggregate-error\/index.js:\d+:\d+\)?/g,"");let k=class extends Error{constructor(t){if(!Array.isArray(t))throw new TypeError(`Expected input to be an Array, got ${typeof t}`);t=[...t].map(r=>r instanceof Error?r:r!==null&&typeof r=="object"?Object.assign(new Error(r.message),r):new Error(r));let e=t.map(r=>typeof r.stack=="string"?I(S(r.stack)):String(r)).join(`
4
4
  `);e=`