@abtnode/blocklet-services 1.16.44-beta-20250520-104453-912ed737 → 1.16.44-beta-20250524-065731-c62fd374
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.
- package/api/services/mcp/server.js +18 -3
- package/dist/assets/{AdapterDayjs-Bck9Dv3l.js → AdapterDayjs-DnsMePpQ.js} +1 -1
- package/dist/assets/{ArrowDropDown-BleCy3ti.js → ArrowDropDown-Dzy2X1bv.js} +1 -1
- package/dist/assets/{CheckCircle-XrJDG94y.js → CheckCircle-DA1-Q3VQ.js} +1 -1
- package/dist/assets/{ChevronLeft-BlDLI-Qo.js → ChevronLeft-C7-bj_BM.js} +1 -1
- package/dist/assets/{ChevronRight-DkPaON7R.js → ChevronRight-CA18V4hg.js} +1 -1
- package/dist/assets/{Community-BCL2L7ib.js → Community-BnAsVqMr.js} +1 -1
- package/dist/assets/{DeleteOutline-Cj7UhBbF.js → DeleteOutline-DIXSGJ49.js} +1 -1
- package/dist/assets/{Done-UEZFWnHj.js → Done-BHbsILFJ.js} +1 -1
- package/dist/assets/{Download-CsoZ8yOi.js → Download-CmhNaqwS.js} +1 -1
- package/dist/assets/{Edit-Bj4m2hpD.js → Edit-CNRD5aKM.js} +1 -1
- package/dist/assets/{EditIcon-Dffk7mPL.js → EditIcon-8BXW1OHp.js} +1 -1
- package/dist/assets/{Email-CdSNK0eA.js → Email-BirbvqZ3.js} +1 -1
- package/dist/assets/{Error-BwUoSWOt.js → Error-DDQf7Wzw.js} +1 -1
- package/dist/assets/{ExpandLess-CjIzahHO.js → ExpandLess-D15nWpBQ.js} +1 -1
- package/dist/assets/{Google-BON6upKi.js → Google-BEEvQjkX.js} +1 -1
- package/dist/assets/{Holiday-enHMZqEf.js → Holiday-C4KRd5t6.js} +1 -1
- package/dist/assets/Home-C8za96Ud.js +1 -0
- package/dist/assets/{InfoOutlined-uoMMChNE.js → InfoOutlined-Cxpk0UTX.js} +1 -1
- package/dist/assets/{Launch-rj4Kr2rA.js → Launch-CKr_eo1b.js} +1 -1
- package/dist/assets/{LaunchOutlined-0gUfY-5D.js → LaunchOutlined-Drryv7vp.js} +1 -1
- package/dist/assets/{Location-By12Z3Te.js → Location-DxPzfR_p.js} +1 -1
- package/dist/assets/{LockIcon-98CKEIBe.js → LockIcon-DFb6sSpT.js} +1 -1
- package/dist/assets/{Meeting-CLeFWDkY.js → Meeting-DCL_ygud.js} +1 -1
- package/dist/assets/{MoreHoriz-3SNxR36h.js → MoreHoriz-CKCGMlB8.js} +1 -1
- package/dist/assets/{OffSick-dUm363rs.js → OffSick-DvgkmCUP.js} +1 -1
- package/dist/assets/{Phone--BSu-btI.js → Phone-BkOMNOMO.js} +1 -1
- package/dist/assets/{PlayArrow-BHO_DqT2.js → PlayArrow-CrmMAssx.js} +1 -1
- package/dist/assets/{QuestionMarkCircle-DTf-Tya5.js → QuestionMarkCircle-DTGyWFVS.js} +1 -1
- package/dist/assets/{Timezone-YZ0dMUEr.js → Timezone-D91Of94T.js} +1 -1
- package/dist/assets/{TuneOutlined-BvtfOd23.js → TuneOutlined-Dp4gMD_8.js} +1 -1
- package/dist/assets/{ViewList-BvucdDXZ.js → ViewList-ByzGtByR.js} +1 -1
- package/dist/assets/{WorkingRemotely-BX7rgbEY.js → WorkingRemotely-CpchWcXV.js} +1 -1
- package/dist/assets/{access-control-C9ZsDLlM.js → access-control-CHRw2bbp.js} +1 -1
- package/dist/assets/{actions-BWSNMC_c.js → actions-XNIU_ion.js} +1 -1
- package/dist/assets/{add-component-core-Dd9KPcvp.js → add-component-core-eEjKF53n.js} +33 -33
- package/dist/assets/{add-resource-BHmsfuUO.js → add-resource-W-ML3m5q.js} +1 -1
- package/dist/assets/{addon-CaGk2PdY.js → addon-DGwzoD-f.js} +1 -1
- package/dist/assets/{advanced-DlILcrRl.js → advanced-CPhRkaAJ.js} +2 -2
- package/dist/assets/appearance-Bgtb4-LE.js +1 -0
- package/dist/assets/ar-CHiV3Onz.js +1 -0
- package/dist/assets/{ar-C_INBNFD.js → ar-T0OvMFDJ.js} +2 -2
- package/dist/assets/{audit-logs-DfXh1JQZ.js → audit-logs-DCTnwVQT.js} +3 -3
- package/dist/assets/authorize-0cAl16_K.js +1 -0
- package/dist/assets/base-chart-D6qRW4Yg.js +1 -0
- package/dist/assets/{base32-BnPQ4q4v.js → base32-DEQDAhbh.js} +1 -1
- package/dist/assets/branding-6OsQw5QJ.js +40 -0
- package/dist/assets/{branding-CbgACClH.js → branding-Bv8Tk-Am.js} +1 -1
- package/dist/assets/bundle-avatar-WoSDDX0E.js +1 -0
- package/dist/assets/button-D7WVH4Bm.js +1 -0
- package/dist/assets/click-to-copy-DsH0RQVg.js +1 -0
- package/dist/assets/{collapse-iOiHn4dy.js → collapse-DRHShQoZ.js} +1 -1
- package/dist/assets/complete-BJLGhmnP.js +39 -0
- package/dist/assets/{component-amc-22MQ.js → component-BFi7evus.js} +2 -2
- package/dist/assets/{config-D3UduD_R.js → config-BfjiZ8-q.js} +2 -2
- package/dist/assets/{config-B_jIm01w.js → config-C77UXU2G.js} +1 -1
- package/dist/assets/{config-navigation-PoVJgHNU.js → config-navigation-BkfKynqT.js} +6 -6
- package/dist/assets/config-space-DID86BbB.js +1 -0
- package/dist/assets/{confirm-DaR0Yx39.js → confirm-BnRcXvxs.js} +1 -1
- package/dist/assets/connect-DJCBGsCy.js +1 -0
- package/dist/assets/connect-DyhNsjIB.js +5 -0
- package/dist/assets/connect-to-BYS6M9JU.js +1 -0
- package/dist/assets/{content-layout--sy9JlYZ.js → content-layout-fV4nyVb5.js} +1 -1
- package/dist/assets/dark-animation-DhFa8I7D.js +1 -0
- package/dist/assets/dashboard-RTzIKcnI.js +239 -0
- package/dist/assets/de-BWtUXhCw.js +1 -0
- package/dist/assets/{de-EYXdEi3Y.js → de-WYW4JJdA.js} +2 -2
- package/dist/assets/default-animation-DARmPWCI.js +1 -0
- package/dist/assets/{delete-confirm-DHB0S_Co.js → delete-confirm-2yiel8lV.js} +1 -1
- package/dist/assets/{did-address-mv0Qw7hC.js → did-address-2a_50VlM.js} +1 -1
- package/dist/assets/domain-B7QeQ3KX.js +9 -0
- package/dist/assets/domain-action-card-CLEjpu-P.js +28 -0
- package/dist/assets/domains-Bu0iN_az.js +1 -0
- package/dist/assets/dot-itVN8XTt.js +7 -0
- package/dist/assets/{email-DiuMAA8U.js → email-9sDMxuoB.js} +2 -2
- package/dist/assets/{empty-spinner-BZw_ShnT.js → empty-spinner-BdaCO6xq.js} +1 -1
- package/dist/assets/es-B6GuFK3b.js +1 -0
- package/dist/assets/{es-3jqVamM8.js → es-DaHPJdAX.js} +2 -2
- package/dist/assets/{exchange-passport-Bcw--2wm.js → exchange-passport-CzmhafoN.js} +1 -1
- package/dist/assets/fr-DjhyyiEi.js +1 -0
- package/dist/assets/{fr-CUcR-yNv.js → fr-Sdn9hi8k.js} +2 -2
- package/dist/assets/{fuel-BitXgq2D.js → fuel-D_QIEw1n.js} +1 -1
- package/dist/assets/gen-access-key-BmDWpAif.js +2 -0
- package/dist/assets/get-safe-url-BdFxF8pA.js +1 -0
- package/dist/assets/get-safe-url-DfW-qoLB.js +1 -0
- package/dist/assets/hi-CtKbt1J4.js +1 -0
- package/dist/assets/{hi-DNldhMTl.js → hi-dJuR0lt2.js} +2 -2
- package/dist/assets/{home-jh95SgT7.js → home-DtVAZY8s.js} +1 -1
- package/dist/assets/id-CCuL3FP-.js +1 -0
- package/dist/assets/{id-CmSIFhX-.js → id-DuYS34H0.js} +2 -2
- package/dist/assets/{iframe-BlPuY8Pu.js → iframe-dmrNn49R.js} +1 -1
- package/dist/assets/{index-CleFkLt8.js → index-B4CzEaVv.js} +1 -1
- package/dist/assets/{index-CZOVduSH.js → index-B4rUFDP9.js} +1 -1
- package/dist/assets/{index-YuW8IExe.js → index-B6g_NzxF.js} +22 -22
- package/dist/assets/index-BctwEFbW.js +55 -0
- package/dist/assets/index-Bhwq-PC6.js +284 -0
- package/dist/assets/{index-BdH_4Yfe.js → index-BmXcRfZR.js} +1 -1
- package/dist/assets/index-Bw-rbXJI.js +6 -0
- package/dist/assets/index-C2wxmxz2.js +1 -0
- package/dist/assets/{index-DYlN9Brg.js → index-C5N0NjEs.js} +12 -12
- package/dist/assets/{index-Bv8sds6g.js → index-CBALX7k4.js} +1 -1
- package/dist/assets/{index-Bi-YrbEk.js → index-CGHej0Ek.js} +4 -4
- package/dist/assets/index-CT4keHaK.js +1 -0
- package/dist/assets/index-CtxraYdM.js +113 -0
- package/dist/assets/{index-C849wD9b.js → index-D2uDBC1o.js} +1 -1
- package/dist/assets/{index-CqRVUIz0.js → index-D45FqXMt.js} +3 -3
- package/dist/assets/{index-BWshat_T.js → index-DBBjaba5.js} +7 -7
- package/dist/assets/{index-hjv3dFXZ.js → index-DLdz4ykT.js} +1 -1
- package/dist/assets/{index-Cgdb1aGn.js → index-DdKYu9HL.js} +10 -10
- package/dist/assets/index-Dq_lSUqL.js +1 -0
- package/dist/assets/{index-D3Od1Ju7.js → index-DtsBFtZP.js} +9 -9
- package/dist/assets/{index-C0w1ugDi.js → index-J3Tqz9ZT.js} +1 -1
- package/dist/assets/{index-DbsXFWms.js → index-RsjqbOR7.js} +1 -1
- package/dist/assets/{index-BXkKeWVW.js → index-Z_7QgoWt.js} +2 -2
- package/dist/assets/{index-CmQOzzP8.js → index-iB7JyXwh.js} +1 -1
- package/dist/assets/index-iphP5FWX.js +10 -0
- package/dist/assets/{invitation-BtuI3wbb.js → invitation-DG9MWQbS.js} +5 -5
- package/dist/assets/invite-DLCj8sz9.js +1 -0
- package/dist/assets/{issue-passport-DGinrMdr.js → issue-passport-BWxVIA89.js} +1 -1
- package/dist/assets/item-CUEEdtq7.js +2 -0
- package/dist/assets/ja-ACgKScTi.js +1 -0
- package/dist/assets/{ja-D-vAGmH7.js → ja-Dh60q0r5.js} +2 -2
- package/dist/assets/{ko-DpdamIdS.js → ko-CoqvBZUf.js} +2 -2
- package/dist/assets/ko-gvJH4zFR.js +1 -0
- package/dist/assets/{landing-page-D_TLvQ3s.js → landing-page-DErP-951.js} +1 -1
- package/dist/assets/{launch-result-message-Eea5FZDm.js → launch-result-message-FuvJDCvp.js} +1 -1
- package/dist/assets/{layout-0pbi4f6l.js → layout-BpHPXY7v.js} +1 -1
- package/dist/assets/{list-C_1TcitB.js → list-95F7XaG9.js} +6 -6
- package/dist/assets/list-TUiipUoi.js +2 -0
- package/dist/assets/{list-header-DNFbdM3a.js → list-header-xt282ZMS.js} +1 -1
- package/dist/assets/localization-Dale72UG.js +1 -0
- package/dist/assets/{log-DnUF9orj.js → log-aS7wDHYq.js} +1 -1
- package/dist/assets/logger-DRlJhYNs.js +1 -0
- package/dist/assets/{login-Boq_S2S7.js → login-BEhRbdo1.js} +1 -1
- package/dist/assets/{login-oauth-callback-CuSXnq1m.js → login-oauth-callback-T6cLlJXo.js} +1 -1
- package/dist/assets/{logo-uploader-DtAT8iaJ.js → logo-uploader-CLz5RPTu.js} +5 -5
- package/dist/assets/lost-passport-C2TUuANu.js +168 -0
- package/dist/assets/{open-window-DXP1LoPD.js → open-window-xER4N-kf.js} +1 -1
- package/dist/assets/{overview-DHcHPq6g.js → overview-CSLXBT0F.js} +2 -2
- package/dist/assets/{page-header-PO_g4wSK.js → page-header-IRqa6Qvs.js} +1 -1
- package/dist/assets/{passport-item-NMGbWwTG.js → passport-item-hLzOrz7-.js} +1 -1
- package/dist/assets/{permission-BfddnDBs.js → permission-BkpeOUF9.js} +1 -1
- package/dist/assets/preferences-CaXn4vHX.js +1 -0
- package/dist/assets/profile-embed-DP-NpR-H.js +1 -0
- package/dist/assets/{pt-CEcOQeEC.js → pt-DCcbs0d0.js} +2 -2
- package/dist/assets/pt-DzswFIpl.js +1 -0
- package/dist/assets/publish-resource-BImGOxGu.js +1 -0
- package/dist/assets/{react-beautiful-dnd.esm-0e7VDGmi.js → react-beautiful-dnd.esm-CXMxXaUW.js} +1 -1
- package/dist/assets/ru-EZJWVu3M.js +1 -0
- package/dist/assets/{ru-83xhwzPD.js → ru-WYTV5VzH.js} +2 -2
- package/dist/assets/runtime-BdS45sOH.js +1 -0
- package/dist/assets/sdk-DeUOtvaE.js +1 -0
- package/dist/assets/{section-C1TPQFRq.js → section-BB6hVmdO.js} +1 -1
- package/dist/assets/{security-BuN2nUoZ.js → security-bFZAakv0.js} +4 -4
- package/dist/assets/{session-DUt5rVEy.js → session-E0e-X6-a.js} +1 -1
- package/dist/assets/setup-DMmxE-ov.js +30 -0
- package/dist/assets/{shorten-label-Bf7YQUd6.js → shorten-label-DPIZ5X7v.js} +1 -1
- package/dist/assets/{simple-select-DwWEI_ZU.js → simple-select-CN3fsa56.js} +1 -1
- package/dist/assets/slicedToArray-DmqXMnHT.js +2 -0
- package/dist/assets/{spaces-MprwX1Iq.js → spaces-BKlIkPYo.js} +1 -1
- package/dist/assets/start-BXBhW0EF.js +187 -0
- package/dist/assets/{starting-progress-BJCVRFkE.js → starting-progress-CyKicFZc.js} +1 -1
- package/dist/assets/{status-Bo92foK0.js → status-CIwF9IiE.js} +1 -1
- package/dist/assets/{step-actions-D__rjlW_.js → step-actions-Cy_Wn9XZ.js} +1 -1
- package/dist/assets/{studio-kVKG7W3n.js → studio-BSiEg8xP.js} +1 -1
- package/dist/assets/{switch-control-BgwZFVCJ.js → switch-control-DzZXz9Ks.js} +1 -1
- package/dist/assets/{table-tips-nPiIcvAy.js → table-tips-BP0JTpDH.js} +1 -1
- package/dist/assets/th-Bn3Ch7SK.js +1 -0
- package/dist/assets/{th-BQLlyW1N.js → th-Da4lMKTX.js} +2 -2
- package/dist/assets/traffic-Bz2-5BjC.js +1 -0
- package/dist/assets/{transfer-U9z5JNMl.js → transfer-CZ88q7e8.js} +1 -1
- package/dist/assets/{unsubscribe-BmAshFCd.js → unsubscribe-Dc0yE6SM.js} +1 -1
- package/dist/assets/{use-blocklet-logo-3VH4RBTr.js → use-blocklet-logo-DeL5Lmpn.js} +1 -1
- package/dist/assets/{use-mobile-JEGQfLZ2.js → use-mobile-BAa0wi8o.js} +1 -1
- package/dist/assets/{use-mobile-ZAS6Si4t.js → use-mobile-C21X4TYN.js} +1 -1
- package/dist/assets/use-server-logo-CxuMvwKh.js +1 -0
- package/dist/assets/useAsync-510ntT1B.js +1 -0
- package/dist/assets/{useLocalStorage-DotMjDUB.js → useLocalStorage-DvcK7KsP.js} +1 -1
- package/dist/assets/{user-center-8aoMSkJ_.js → user-center-3TxDrG6m.js} +15 -14
- package/dist/assets/{util-CiTimo-i.js → util-IzAdTupy.js} +1 -1
- package/dist/assets/{util-CuK9uaNS.js → util-KGAW0YJ4.js} +1 -1
- package/dist/assets/{vendor-arcblock-Ca95GLVH.js → vendor-arcblock-CUb0jDdY.js} +86 -86
- package/dist/assets/{vendor-hooks-DpwFseeF.js → vendor-hooks-BgUTpb6X.js} +1 -1
- package/dist/assets/{vendor-mui-core-Bh-qMRq3.js → vendor-mui-core-BV2FUxWJ.js} +22 -22
- package/dist/assets/{vendor-mui-x-CQTjfcpn.js → vendor-mui-x-Bo-XOtzq.js} +1 -1
- package/dist/assets/{vendor-ux-did-connect-D0L9YnHn.js → vendor-ux-did-connect-DprdyYny.js} +148 -148
- package/dist/assets/{vi-DgWAr6FA.js → vi-BxzaqoH9.js} +2 -2
- package/dist/assets/vi-CgnGroV4.js +1 -0
- package/dist/assets/wrap-locale-BjqARXGJ.js +1 -0
- package/dist/assets/zh-BWgwGxeZ.js +1 -0
- package/dist/assets/{zh-BL80PoOh.js → zh-Do6onry4.js} +2 -2
- package/dist/assets/{zh-tw-Dg5z1DFE.js → zh-tw-BNgoHsYW.js} +2 -2
- package/dist/assets/zh-tw-Ciod1pFs.js +1 -0
- package/dist/images/mcp/claude.webp +0 -0
- package/dist/images/mcp/cline.png +0 -0
- package/dist/images/mcp/cursor.png +0 -0
- package/dist/images/mcp/default.png +0 -0
- package/dist/images/mcp/enconvo.png +0 -0
- package/dist/images/mcp/roocline.png +0 -0
- package/dist/images/mcp/windsurf.png +0 -0
- package/dist/images/mcp/witsy.png +0 -0
- package/dist/index.html +5 -5
- package/dist/service-worker.js +1 -1
- package/package.json +34 -34
- package/dist/assets/ServerLogo-CEsILJl5.js +0 -1
- package/dist/assets/appearance-D1sGjeMk.js +0 -1
- package/dist/assets/ar-BRKjvO8p.js +0 -1
- package/dist/assets/authorize-mEHpiCQH.js +0 -1
- package/dist/assets/branding-BHziMdwk.js +0 -40
- package/dist/assets/bundle-avatar-D7QQIJpo.js +0 -1
- package/dist/assets/button-DXOAf3Np.js +0 -1
- package/dist/assets/click-to-copy-DtGgy9Ua.js +0 -1
- package/dist/assets/complete-CKdswLjZ.js +0 -39
- package/dist/assets/config-space-D-DWHYER.js +0 -1
- package/dist/assets/connect-CVfkW49h.js +0 -1
- package/dist/assets/connect-CvEHPjqh.js +0 -5
- package/dist/assets/connect-to-DrhAN5Nn.js +0 -1
- package/dist/assets/dashboard-B_QqB4aw.js +0 -239
- package/dist/assets/de-D3cg0t9f.js +0 -1
- package/dist/assets/domain-BR9srj-p.js +0 -9
- package/dist/assets/domain-action-card-DtwNOaxH.js +0 -28
- package/dist/assets/domains-Bg_t1pz-.js +0 -1
- package/dist/assets/dot-D3X4DSlo.js +0 -7
- package/dist/assets/es-DPjqApVE.js +0 -1
- package/dist/assets/fr-Dscs9WsP.js +0 -1
- package/dist/assets/gen-access-key-CrHniwdW.js +0 -2
- package/dist/assets/get-safe-url-BRocR2aJ.js +0 -1
- package/dist/assets/get-safe-url-DYtntqqo.js +0 -1
- package/dist/assets/hi-B8D3j6bs.js +0 -1
- package/dist/assets/id-DWMMQI0G.js +0 -1
- package/dist/assets/index-BDcuaL48.js +0 -113
- package/dist/assets/index-BO7CJLK3.js +0 -284
- package/dist/assets/index-B_y3Xcdb.js +0 -55
- package/dist/assets/index-D0TzEmpA.js +0 -6
- package/dist/assets/index-DO4zGWKz.js +0 -1
- package/dist/assets/index-RDZtjGNC.js +0 -1
- package/dist/assets/index-c0hdujdn.js +0 -10
- package/dist/assets/invite-CelTXbxx.js +0 -1
- package/dist/assets/item-BhN-qZd_.js +0 -2
- package/dist/assets/ja-3LoBq68U.js +0 -1
- package/dist/assets/ko-B2dxwXDl.js +0 -1
- package/dist/assets/list-DKIkIMue.js +0 -2
- package/dist/assets/localization-CpjVJ6VE.js +0 -1
- package/dist/assets/logger-jMgD3u5g.js +0 -1
- package/dist/assets/lost-passport-DuJeKcGu.js +0 -168
- package/dist/assets/preferences-Nt4L8Zgv.js +0 -1
- package/dist/assets/profile-embed-C9nHKFrf.js +0 -1
- package/dist/assets/pt-eei1_Z4R.js +0 -1
- package/dist/assets/publish-resource-BL83FldI.js +0 -1
- package/dist/assets/ru-ZKgT6XdU.js +0 -1
- package/dist/assets/runtime-FDEoUn52.js +0 -1
- package/dist/assets/sdk-CytUSheP.js +0 -1
- package/dist/assets/setup-BB0XLqW9.js +0 -30
- package/dist/assets/slicedToArray-BSaY8ui4.js +0 -2
- package/dist/assets/start-C7CIzLBY.js +0 -187
- package/dist/assets/th-CG5eLRZo.js +0 -1
- package/dist/assets/traffic-Cd92p-Xb.js +0 -35
- package/dist/assets/useAsync-CDjYBiwf.js +0 -1
- package/dist/assets/useAsync-dC0jHVWO.js +0 -1
- package/dist/assets/vi-CoZs3B42.js +0 -1
- package/dist/assets/wrap-locale-QBHz1ECC.js +0 -1
- package/dist/assets/zh-CgkeS2I3.js +0 -1
- package/dist/assets/zh-tw-CuakNRcW.js +0 -1
|
@@ -1,284 +0,0 @@
|
|
|
1
|
-
import{r as P,t as hn,g as xn,e as Ct,a as yn}from"./vendor-react-DEoibe3W.js";import{a9 as Et,j as e,aa as E,bo as Ue,br as Be,bn as Fe,q as be,T as Z,O as de,ab as oe,bx as ze,ak as re,H as b,ah as z,e as vn,ad as Ce,w as bn,y as Ot,b4 as Cn,b5 as jn,I as Sn,bh as wn,bs as Pn,bR as kn}from"./vendor-mui-core-Bh-qMRq3.js";import{B as jt,e as $e,$ as In,ay as Tn,n as St,A as Dn,b as An}from"./vendor-utils-rHXShPKm.js";import{r as Nt,aI as _t,bx as Rn,h as Ln,a as V,X as En,W as On,ak as te,B as M,e as Nn,am as _n,d as Un,b1 as pe,Y as X,bn as Bn,j as Y,_ as Ut,ag as Fn,I as $n,aq as Wn,V as We,b3 as Mn,a5 as Bt,a4 as Ft,bt as zn}from"./vendor-ux-did-connect-D0L9YnHn.js";import{c as Q,a as qn,Y as $t,O as je,I as Hn,Z as Vn}from"./vendor-arcblock-Ca95GLVH.js";import{d as Kn}from"./ViewList-BvucdDXZ.js";import{a0 as Zn,f as Yn,A as H,av as qe,l as me,a1 as Qn,T as ne,aw as Gn,D as Wt,ax as Mt,v as Xn,b as Jn}from"./index-YuW8IExe.js";import{U as zt,C as qt,I as es}from"./index-c0hdujdn.js";import{k as ts,u as He,a as Ve,m as ns,f as ss}from"./vendor-hooks-DpwFseeF.js";import{l as rs}from"./index-DYlN9Brg.js";import{u as K,d as wt,W as Ht}from"./dashboard-B_QqB4aw.js";import{W as Ke}from"./did-address-mv0Qw7hC.js";import{P as G}from"./permission-BfddnDBs.js";import{C as ke}from"./click-to-copy-DtGgy9Ua.js";import{T as Vt}from"./index-CleFkLt8.js";import{f as J}from"./index-8eXqqyHQ.js";import{u as os}from"./useAsync-dC0jHVWO.js";import{I as q}from"./index-Bv8sds6g.js";import{d as is}from"./DeleteOutline-Cj7UhBbF.js";import{C as ue}from"./confirm-DaR0Yx39.js";import{u as fe}from"./session-DUt5rVEy.js";import{i as Kt,a as Se,p as Zt}from"./util-CiTimo-i.js";import{b as as}from"./sdk-CytUSheP.js";import{A as ls}from"./actions-BWSNMC_c.js";import{S as cs}from"./shorten-label-Bf7YQUd6.js";import"./lottie-web-jYmAQWuC.js";import"./Phone--BSu-btI.js";import"./Location-By12Z3Te.js";import"./Email-CdSNK0eA.js";import"./Timezone-YZ0dMUEr.js";import"./useLocalStorage-DotMjDUB.js";import"./PlayArrow-BHO_DqT2.js";import"./get-safe-url-DYtntqqo.js";import"./use-blocklet-logo-3VH4RBTr.js";import"./InfoOutlined-uoMMChNE.js";import"./dot-D3X4DSlo.js";import"./useAsync-CDjYBiwf.js";import"./useSetState-CWq0AVWn.js";import"./use-mobile-JEGQfLZ2.js";import"./vendor-mui-x-CQTjfcpn.js";import"./AdapterDayjs-Bck9Dv3l.js";import"./base32-BnPQ4q4v.js";import"./MoreHoriz-3SNxR36h.js";var Ze={},ds=Et;Object.defineProperty(Ze,"__esModule",{value:!0});var Yt=Ze.default=void 0,ms=ds(Nt()),ps=e;Yt=Ze.default=(0,ms.default)((0,ps.jsx)("path",{d:"M12 4V1L8 5l4 4V6c3.31 0 6 2.69 6 6 0 1.01-.25 1.97-.7 2.8l1.46 1.46C19.54 15.03 20 13.57 20 12c0-4.42-3.58-8-8-8m0 14c-3.31 0-6-2.69-6-6 0-1.01.25-1.97.7-2.8L5.24 7.74C4.46 8.97 4 10.43 4 12c0 4.42 3.58 8 8 8v3l4-4-4-4z"}),"Loop");var Ye=function(t){return e.jsxs("svg",{...t,children:[e.jsx("g",{clipPath:"url(#clip0)",children:e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.99997 1.59778C8.19071 1.59778 7.39961 1.83775 6.72673 2.28736C6.05385 2.73697 5.5294 3.37601 5.21971 4.12367C4.91001 4.87134 4.82898 5.69405 4.98686 6.48777C5.14474 7.28149 5.53444 8.01056 6.10668 8.5828C6.67892 9.15504 7.408 9.54474 8.20172 9.70262C8.99544 9.8605 9.81815 9.77947 10.5658 9.46978C11.3135 9.16009 11.9525 8.63564 12.4021 7.96276C12.8517 7.28987 13.0917 6.49878 13.0917 5.68951C13.0917 4.60432 12.6606 3.56357 11.8933 2.79622C11.1259 2.02887 10.0852 1.59778 8.99997 1.59778ZM7.27426 3.9638C7.73195 3.50611 8.35271 3.24899 8.99997 3.24899C9.48266 3.24899 9.95452 3.39212 10.3559 3.66029C10.7572 3.92846 11.07 4.30962 11.2547 4.75556C11.4394 5.20151 11.4878 5.69222 11.3936 6.16563C11.2994 6.63905 11.067 7.07391 10.7257 7.41522C10.3844 7.75654 9.94951 7.98897 9.4761 8.08314C9.00268 8.17731 8.51197 8.12898 8.06603 7.94426C7.62008 7.75954 7.23892 7.44674 6.97075 7.04539C6.70258 6.64405 6.55945 6.1722 6.55945 5.68951C6.55945 5.04224 6.81658 4.42149 7.27426 3.9638ZM7.36691 10.3075C6.28172 10.3075 5.24097 10.7385 4.47362 11.5059C3.70627 12.2732 3.27518 13.314 3.27518 14.3992V17.121C3.27518 17.2763 3.4011 17.4022 3.55643 17.4022H4.64514C4.80047 17.4022 4.92639 17.2763 4.92639 17.121V14.3992C4.92639 13.7519 5.18351 13.1312 5.6412 12.6735C6.09889 12.2158 6.71964 11.9587 7.36691 11.9587H10.633C10.9535 11.9587 11.2709 12.0218 11.567 12.1444C11.8631 12.2671 12.1321 12.4469 12.3588 12.6735C12.5854 12.9001 12.7651 13.1691 12.8878 13.4652C13.0104 13.7613 13.0736 14.0787 13.0736 14.3992V17.121C13.0736 17.2763 13.1995 17.4022 13.3548 17.4022H14.4435C14.5989 17.4022 14.7248 17.2763 14.7248 17.121V14.3992C14.7248 13.314 14.2937 12.2732 13.5263 11.5059C12.759 10.7385 11.7182 10.3075 10.633 10.3075H7.36691Z"})}),e.jsx("defs",{children:e.jsx("clipPath",{id:"clip0",children:e.jsx("rect",{width:"18",height:"18",transform:"translate(0 0.5)"})})})]})};Ye.defaultProps={width:"18",height:"19",viewBox:"0 0 18 19",xmlns:"http://www.w3.org/2000/svg"};Ye.displayName="person";const us=Ye;var Qe=function(t){return e.jsxs("svg",{...t,children:[e.jsx("path",{d:"M1.25 2.7087C1.25 2.24826 1.62326 1.875 2.0837 1.875H14.339C14.7995 1.875 15.1727 2.24826 15.1727 2.7087V9.31574C15.1727 9.77618 14.7995 10.1494 14.339 10.1494C13.8786 10.1494 13.5053 9.77618 13.5053 9.31574V3.54239H2.91739V16.7565H6.53772H8.34788H9.32435C9.78479 16.7565 10.158 17.1297 10.158 17.5902C10.158 18.0506 9.78479 18.4239 9.32435 18.4239H8.34788H2.0837C1.62326 18.4239 1.25 18.0506 1.25 17.5902V2.7087Z"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.21129 7.91935C7.70481 7.91935 7.29422 8.32993 7.29422 8.83641C7.29422 9.34289 7.70481 9.75348 8.21129 9.75348C8.71777 9.75348 9.12836 9.34289 9.12836 8.83641C9.12836 8.32993 8.71777 7.91935 8.21129 7.91935ZM5.62683 8.83641C5.62683 7.40905 6.78393 6.25195 8.21129 6.25195C9.63865 6.25195 10.7957 7.40905 10.7957 8.83641C10.7957 10.2638 9.63865 11.4209 8.21129 11.4209C6.78393 11.4209 5.62683 10.2638 5.62683 8.83641Z"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.62683 13.2133C5.62683 12.7529 6.00009 12.3796 6.46053 12.3796H9.96205C10.4225 12.3796 10.7957 12.7529 10.7957 13.2133C10.7957 13.6737 10.4225 14.047 9.96205 14.047H6.46053C6.00009 14.047 5.62683 13.6737 5.62683 13.2133Z"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.6406 11.3125C15.8547 11.3125 16.0503 11.434 16.145 11.626L17.1779 13.7184L19.4876 14.056C19.6994 14.087 19.8753 14.2355 19.9413 14.4391C20.0074 14.6427 19.9521 14.8662 19.7987 15.0156L18.1279 16.643L18.5222 18.9421C18.5584 19.1532 18.4716 19.3665 18.2984 19.4923C18.1252 19.6182 17.8955 19.6347 17.706 19.5351L15.6406 18.4489L13.5753 19.5351C13.3858 19.6347 13.1561 19.6182 12.9829 19.4923C12.8096 19.3665 12.7229 19.1532 12.7591 18.9421L13.1534 16.643L11.4825 15.0156C11.3292 14.8662 11.2739 14.6427 11.3399 14.4391C11.406 14.2355 11.5818 14.087 11.7937 14.056L14.1034 13.7184L15.1362 11.626C15.231 11.434 15.4265 11.3125 15.6406 11.3125ZM15.6406 13.1458L14.9815 14.4813C14.8996 14.6471 14.7414 14.7621 14.5584 14.7889L13.0835 15.0044L14.1503 16.0435C14.283 16.1727 14.3435 16.359 14.3122 16.5416L14.0606 18.0088L15.3788 17.3155C15.5427 17.2293 15.7386 17.2293 15.9025 17.3155L17.2207 18.0088L16.969 16.5416C16.9377 16.359 16.9983 16.1727 17.131 16.0435L18.1978 15.0044L16.7229 14.7889C16.5399 14.7621 16.3817 14.6471 16.2998 14.4813L15.6406 13.1458Z"})]})};Qe.defaultProps={width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"};Qe.displayName="external-issuer";const Qt=Qe;var ve={},fs=t=>encodeURIComponent(t).replace(/[!'()*]/g,r=>`%${r.charCodeAt(0).toString(16).toUpperCase()}`),Gt="%[a-f0-9]{2}",Pt=new RegExp("("+Gt+")|([^%]+?)","gi"),kt=new RegExp("("+Gt+")+","gi");function Me(t,r){try{return[decodeURIComponent(t.join(""))]}catch{}if(t.length===1)return t;r=r||1;var l=t.slice(0,r),u=t.slice(r);return Array.prototype.concat.call([],Me(l),Me(u))}function gs(t){try{return decodeURIComponent(t)}catch{for(var r=t.match(Pt)||[],l=1;l<r.length;l++)t=Me(r,l).join(""),r=t.match(Pt)||[];return t}}function hs(t){for(var r={"%FE%FF":"��","%FF%FE":"��"},l=kt.exec(t);l;){try{r[l[0]]=decodeURIComponent(l[0])}catch{var u=gs(l[0]);u!==l[0]&&(r[l[0]]=u)}l=kt.exec(t)}r["%C2"]="�";for(var m=Object.keys(r),g=0;g<m.length;g++){var w=m[g];t=t.replace(new RegExp(w,"g"),r[w])}return t}var xs=function(t){if(typeof t!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof t+"`");try{return t=t.replace(/\+/g," "),decodeURIComponent(t)}catch{return hs(t)}},ys=(t,r)=>{if(!(typeof t=="string"&&typeof r=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(r==="")return[t];const l=t.indexOf(r);return l===-1?[t]:[t.slice(0,l),t.slice(l+r.length)]},vs=function(t,r){for(var l={},u=Object.keys(t),m=Array.isArray(r),g=0;g<u.length;g++){var w=u[g],p=t[w];(m?r.indexOf(w)!==-1:r(w,p,t))&&(l[w]=p)}return l};(function(t){const r=fs,l=xs,u=ys,m=vs,g=n=>n==null;function w(n){switch(n.arrayFormat){case"index":return s=>(a,c)=>{const x=a.length;return c===void 0||n.skipNull&&c===null||n.skipEmptyString&&c===""?a:c===null?[...a,[h(s,n),"[",x,"]"].join("")]:[...a,[h(s,n),"[",h(x,n),"]=",h(c,n)].join("")]};case"bracket":return s=>(a,c)=>c===void 0||n.skipNull&&c===null||n.skipEmptyString&&c===""?a:c===null?[...a,[h(s,n),"[]"].join("")]:[...a,[h(s,n),"[]=",h(c,n)].join("")];case"comma":case"separator":return s=>(a,c)=>c==null||c.length===0?a:a.length===0?[[h(s,n),"=",h(c,n)].join("")]:[[a,h(c,n)].join(n.arrayFormatSeparator)];default:return s=>(a,c)=>c===void 0||n.skipNull&&c===null||n.skipEmptyString&&c===""?a:c===null?[...a,h(s,n)]:[...a,[h(s,n),"=",h(c,n)].join("")]}}function p(n){let s;switch(n.arrayFormat){case"index":return(a,c,x)=>{if(s=/\[(\d*)\]$/.exec(a),a=a.replace(/\[\d*\]$/,""),!s){x[a]=c;return}x[a]===void 0&&(x[a]={}),x[a][s[1]]=c};case"bracket":return(a,c,x)=>{if(s=/(\[\])$/.exec(a),a=a.replace(/\[\]$/,""),!s){x[a]=c;return}if(x[a]===void 0){x[a]=[c];return}x[a]=[].concat(x[a],c)};case"comma":case"separator":return(a,c,x)=>{const v=typeof c=="string"&&c.includes(n.arrayFormatSeparator),S=typeof c=="string"&&!v&&i(c,n).includes(n.arrayFormatSeparator);c=S?i(c,n):c;const U=v||S?c.split(n.arrayFormatSeparator).map(F=>i(F,n)):c===null?c:i(c,n);x[a]=U};default:return(a,c,x)=>{if(x[a]===void 0){x[a]=c;return}x[a]=[].concat(x[a],c)}}}function y(n){if(typeof n!="string"||n.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function h(n,s){return s.encode?s.strict?r(n):encodeURIComponent(n):n}function i(n,s){return s.decode?l(n):n}function I(n){return Array.isArray(n)?n.sort():typeof n=="object"?I(Object.keys(n)).sort((s,a)=>Number(s)-Number(a)).map(s=>n[s]):n}function j(n){const s=n.indexOf("#");return s!==-1&&(n=n.slice(0,s)),n}function k(n){let s="";const a=n.indexOf("#");return a!==-1&&(s=n.slice(a)),s}function o(n){n=j(n);const s=n.indexOf("?");return s===-1?"":n.slice(s+1)}function T(n,s){return s.parseNumbers&&!Number.isNaN(Number(n))&&typeof n=="string"&&n.trim()!==""?n=Number(n):s.parseBooleans&&n!==null&&(n.toLowerCase()==="true"||n.toLowerCase()==="false")&&(n=n.toLowerCase()==="true"),n}function d(n,s){s=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},s),y(s.arrayFormatSeparator);const a=p(s),c=Object.create(null);if(typeof n!="string"||(n=n.trim().replace(/^[?#&]/,""),!n))return c;for(const x of n.split("&")){if(x==="")continue;let[v,S]=u(s.decode?x.replace(/\+/g," "):x,"=");S=S===void 0?null:["comma","separator"].includes(s.arrayFormat)?S:i(S,s),a(i(v,s),S,c)}for(const x of Object.keys(c)){const v=c[x];if(typeof v=="object"&&v!==null)for(const S of Object.keys(v))v[S]=T(v[S],s);else c[x]=T(v,s)}return s.sort===!1?c:(s.sort===!0?Object.keys(c).sort():Object.keys(c).sort(s.sort)).reduce((x,v)=>{const S=c[v];return S&&typeof S=="object"&&!Array.isArray(S)?x[v]=I(S):x[v]=S,x},Object.create(null))}t.extract=o,t.parse=d,t.stringify=(n,s)=>{if(!n)return"";s=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},s),y(s.arrayFormatSeparator);const a=S=>s.skipNull&&g(n[S])||s.skipEmptyString&&n[S]==="",c=w(s),x={};for(const S of Object.keys(n))a(S)||(x[S]=n[S]);const v=Object.keys(x);return s.sort!==!1&&v.sort(s.sort),v.map(S=>{const U=n[S];return U===void 0?"":U===null?h(S,s):Array.isArray(U)?U.reduce(c(S),[]).join("&"):h(S,s)+"="+h(U,s)}).filter(S=>S.length>0).join("&")},t.parseUrl=(n,s)=>{s=Object.assign({decode:!0},s);const[a,c]=u(n,"#");return Object.assign({url:a.split("?")[0]||"",query:d(o(n),s)},s&&s.parseFragmentIdentifier&&c?{fragmentIdentifier:i(c,s)}:{})},t.stringifyUrl=(n,s)=>{s=Object.assign({encode:!0,strict:!0},s);const a=j(n.url).split("?")[0]||"",c=t.extract(n.url),x=t.parse(c,{sort:!1}),v=Object.assign(x,n.query);let S=t.stringify(v,s);S&&(S=`?${S}`);let U=k(n.url);return n.fragmentIdentifier&&(U=`#${h(n.fragmentIdentifier,s)}`),`${a}${S}${U}`},t.pick=(n,s,a)=>{a=Object.assign({parseFragmentIdentifier:!0},a);const{url:c,query:x,fragmentIdentifier:v}=t.parseUrl(n,a);return t.stringifyUrl({url:c,query:m(x,s),fragmentIdentifier:v},a)},t.exclude=(n,s,a)=>{const c=Array.isArray(s)?x=>!s.includes(x):(x,v)=>!s(x,v);return t.pick(n,c,a)}})(ve);const ae=hn,bs={parseNumbers:!1,parseBooleans:!1},Cs={skipNull:!1,skipEmptyString:!1},js=(t,r)=>{var l,u;const{navigateMode:m="push",parseOptions:g,stringifyOptions:w}={},p=Object.assign(Object.assign({},bs),g),y=Object.assign(Object.assign({},Cs),w),h=ae.useLocation(),i=(l=ae.useHistory)===null||l===void 0?void 0:l.call(ae),I=(u=ae.useNavigate)===null||u===void 0?void 0:u.call(ae),j=ts(),k=P.useRef(typeof t=="function"?t():t||{}),o=P.useMemo(()=>ve.parse(h.search,p),[h.search]),T=P.useMemo(()=>Object.assign(Object.assign({},k.current),o),[o]);return[T,He(n=>{const s=typeof n=="function"?n(T):n;j(),i&&i[m]({hash:h.hash,search:ve.stringify(Object.assign(Object.assign({},o),s),y)||"?"},h.state),I&&I({hash:h.hash,search:ve.stringify(Object.assign(Object.assign({},o),s),y)||"?"},{replace:m==="replace",state:h.state})})]},Ss=js,ws=_t,Oe=Rn,Ne=Ln,Ps=rs,It={role:ws.types.RoleType.ROLE_APPLICATION},ks=(t,r,l,u)=>{let m=l||It;const g=(0,Ne.isEthereumType)((0,Ne.DidType)(l));if(g?m=(0,Oe.WalletType)(l):m=(0,Oe.WalletType)(It),!(0,Ne.isValid)(t)){let w="";try{return g?w=t.slice(0,66):w=t,(0,Oe.fromSecretKey)(w,m)}catch(p){throw new Error(`Cannot get blocklet wallet with invalid blocklet did or custom sk: ${p.message}`)}}if(!r)throw new Error("Cannot get blocklet wallet with empty node sk");return(0,Ps.fromAppDid)(t,r,m,u||0)};var Is=ks,Xt=Ct&&Ct.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};const le=Xt(Zn),Ts=_t,xe=Xt(Is),Ds=Yn,As=(t,r,{returnWallet:l=!0}={})=>{var F,A;if(!t||typeof t!="object"||!Array.isArray(t.environments)||!(0,le.default)(t,"meta.did"))throw new Error("Blocklet state must be an object");const{environments:u,configs:m=[]}=t,g=[...m,...u],w=g.find(D=>D.key==="BLOCKLET_APP_DESCRIPTION"),p=g.find(D=>D.key==="BLOCKLET_PASSPORT_COLOR"),y=g.find(D=>D.key==="BLOCKLET_APP_URL"),h=g.find(D=>D.key==="BLOCKLET_APP_TENANT_MODE"),{did:i,version:I}=t.meta,j=(0,Ds.getDisplayName)(t),k=(0,le.default)(w,"value",t.meta.description),o=(0,le.default)(p,"value","auto"),T=(0,le.default)(y,"value",""),d=(0,le.default)(h,"value","");if(!l)return{did:i,version:I,name:j,description:k,passportColor:o,appUrl:T,secret:"",wallet:null,permanentWallet:null,tenantMode:d};const n=g.find(D=>D.key==="BLOCKLET_APP_SK"),s=g.find(D=>D.key==="BLOCKLET_APP_CHAIN_TYPE")||g.find(D=>D.key==="BLOCKLET_WALLET_TYPE"),a=g.find(D=>D.key==="BLOCKLET_APP_PSK");let c;s&&(s.value==="ethereum"||s.value==="eth")&&(c=s.value);let x=null,v=null;if(n&&n.value)x=(0,xe.default)(n.value,void 0,c),a&&a.value&&a.value!==n.value&&(v=(0,xe.default)(a.value,void 0,c));else{if(!r||typeof r!="string")throw new Error("Node secret key must be a string");s?x=(0,xe.default)(t.meta.did,r,c):x=(0,xe.default)(t.meta.did,r)}const S=((A=(F=t.settings)==null?void 0:F.session)==null?void 0:A.salt)||"",U=Ts.Hasher.SHA3.hash256(jt.concat([x.secretKey,x.address,S].filter(Boolean).map(D=>jt.from(D))));return{did:i,version:I,name:j,description:k,passportColor:o,appUrl:T,secret:U,wallet:x,permanentWallet:v||x,tenantMode:d}};var Rs=As;const Ls=xn(Rs);function Ge({teamDid:t,roles:r,apps:l,onCancel:u,onSuccess:m,onError:g,endpoint:w}){var T;const{api:p}=H(),{t:y,locale:h}=V(),i=Ve({loading:!1,error:null,activeStep:0,inviteInfo:null,role:"",remark:"",sourceAppPid:l.length>0?l[0].appPid:null,display:null,passportExpireTime:null,showPicker:!1}),I=async()=>{if(!i.role){i.error=y("team.member.error.passportEmpty");return}const d=i.remark.trim();i.error=null,i.loading=!0;try{let n=i.sourceAppPid??null;n===t&&(n=null);const s={teamDid:t,role:i.role,remark:d,sourceAppPid:n,passportExpireTime:i.passportExpireTime?i.passportExpireTime.toISOString():""};i.display&&(s.display={type:"url",content:i.display});const{inviteInfo:a}=await p.createMemberInvitation({input:s});i.inviteInfo=a,i.activeStep=1}catch(n){const s=J(n);i.error=s,g(n)}finally{i.loading=!1}},j=r.find(d=>d.name===i.role),o=[{body:e.jsxs(E,{sx:{display:"flex",flexDirection:"column",gap:3},children:[l.length>1?e.jsxs(Ue,{fullWidth:!0,children:[e.jsx(Be,{children:y("common.sourceApp")}),e.jsx(Fe,{value:i.sourceAppPid,onChange:d=>{i.error=null,i.sourceAppPid=d.target.value},fullWidth:!0,label:y("common.passport"),disabled:i.loading,children:l.map(d=>e.jsx(be,{value:d.appPid,children:e.jsxs(E,{sx:{display:"flex",justifyContent:"space-between",gap:2,width:"100%"},children:[e.jsxs(E,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(En,{did:d.appPid,size:28}),d.appName]}),e.jsx(On,{did:d.appPid,compact:!0,responsive:!1})]})},d.appPid))})]}):null,e.jsxs(Ue,{fullWidth:!0,variant:"outlined",children:[e.jsx(Be,{children:y("common.passport")}),e.jsx(Fe,{"data-cy":"invite-member-select-role",value:i.role,onChange:d=>{i.error=null,i.role=d.target.value},fullWidth:!0,label:y("common.passport"),disabled:i.loading,onKeyPress:d=>{d.key==="Enter"&&(d.preventDefault(),I())},children:r.filter(d=>d.name!=="owner").map(d=>e.jsx(be,{value:d.name,"data-cy":`invite-member-select-option-${d.name}`,children:e.jsxs(E,{sx:{display:"flex",flexDirection:"column"},children:[e.jsx(Z,{variant:"subtitle1",children:d.title||d.name}),e.jsx(Z,{variant:"caption",sx:{opacity:.7},children:d.description})]})},d.name))})]}),((T=j==null?void 0:j.extra)==null?void 0:T.display)==="custom"&&e.jsx(de,{label:y("common.display"),type:"url",value:i.display,onChange:d=>{i.error=null,i.display=d.target.value},fullWidth:!0,variant:"outlined",margin:"normal"}),e.jsx(de,{label:y("common.remark"),autoComplete:"off",variant:"outlined",fullWidth:!0,value:i.remark,onChange:d=>{i.error=null,i.remark=d.target.value},disabled:i.loading,"data-cy":"invite-member-input-remark"}),e.jsx(Vt,{value:i.passportExpireTime,onChange:d=>{i.passportExpireTime=d}})]}),cancel:y("common.cancel"),confirm:y("team.member.inviteDialog.createInviteLink"),onCancel:u,onConfirm:I},{body:()=>{var n,s;const d=qe({inviteId:(n=i.inviteInfo)==null?void 0:n.inviteId,endpoint:w});return e.jsxs("div",{children:[e.jsx(E,{sx:{fontSize:16,fontWeight:"bold"},children:y("team.member.inviteDialog.createSuccessTip",{expireDate:me((s=i.inviteInfo)==null?void 0:s.expireDate,h)})}),e.jsx("div",{style:{marginTop:"40px"}}),e.jsx(ke,{children:d})]})},confirm:y("common.confirm"),onConfirm:m}][i.activeStep];return e.jsxs(te,{title:y("common.invite"),fullWidth:!0,open:!0,showCloseButton:!1,actions:e.jsxs(e.Fragment,{children:[o.cancel&&e.jsx(M,{onClick:o.onCancel,color:"inherit",children:o.cancel}),e.jsxs(M,{onClick:o.onConfirm,color:"primary",disabled:i.loading||!i.role,variant:"contained",autoFocus:!0,children:[i.loading&&e.jsx(oe,{size:16}),o.confirm]})]}),children:[e.jsx(ze,{component:"div",children:typeof o.body=="function"?o.body():o.body}),!!i.error&&e.jsx(re,{severity:"error",variant:"icon",children:i.error})]})}Ge.propTypes={teamDid:b.string.isRequired,onCancel:b.func.isRequired,onSuccess:b.func.isRequired,onError:b.func,roles:b.array,apps:b.array,endpoint:b.string};Ge.defaultProps={onError:()=>{},roles:[],apps:[],endpoint:""};function Xe({teamDid:t,onCancel:r,onSuccess:l,onError:u,endpoint:m}){const{api:g,info:w}=H(),{api:p}=P.useContext(Nn),[y,h]=P.useState(!1),{t:i,locale:I}=V(),[j,k]=P.useState(""),[o,T]=P.useState(!1),[d,n]=P.useState(0),[s,a]=P.useState(""),[c,x]=P.useState(""),v=!!$e(w,"ownerNft.did"),S=os(async()=>{if(v){const{state:R}=await g.getDelegationState();return R}return{delegated:!0}});if(S.loading)return e.jsx(te,{title:i("team.transferNode.inviteDialog.title"),fullWidth:!0,open:!0,onClose:r,children:e.jsx("div",{style:{display:"flex",justifyContent:"center"},children:e.jsx(oe,{})})});if(S.error)return e.jsx(te,{title:i("team.transferNode.inviteDialog.title"),fullWidth:!0,open:!0,onClose:r,children:e.jsx(re,{severity:"error",variant:"icon",children:J(S.error)})});const U=async()=>{k(null),h(!0);try{const{inviteInfo:R}=await g.createTransferInvitation({input:{teamDid:t,role:"owner",remark:c.trim()}});a(R),n(D.length-1)}catch(R){const W=J(R);k(W),u(R)}finally{h(!1)}},F=()=>{T(!0),n(1)},A=()=>{T(!1),n(0)},D=[{body:e.jsxs(Z,{component:"div",children:[e.jsxs(re,{severity:"warning",children:[e.jsx(Z,{children:i("team.transferNode.inviteDialog.tips.progress")}),e.jsx(Z,{children:i("team.transferNode.inviteDialog.tips.newOwnerPermissions")})]}),e.jsx(re,{severity:"warning",children:e.jsx(Z,{children:i("team.transferNode.inviteDialog.tips.revoke")})}),e.jsx("div",{style:{marginTop:20,marginBottom:10}}),e.jsx(de,{label:i("common.remark"),autoComplete:"off",variant:"outlined",fullWidth:!0,style:{marginBottom:8},value:c,onChange:R=>{k(null),x(R.target.value)},disabled:y,"data-cy":"transfer-node-input-remark"}),e.jsx("div",{style:{marginTop:20,marginBottom:10}})]}),cancel:i("common.cancel"),confirm:i("team.transferNode.inviteDialog.createInviteLink"),onCancel:r,onConfirm:v&&!$e(S,"value.delegated")?F:U},{body:()=>e.jsx(_n,{action:"delegate-transfer-nft",open:o,locale:I,checkFn:p.get,onClose:A,onSuccess:U,checkTimeout:5*60*1e3,webWalletUrl:Qn(w),extraParams:{targetDID:w.did},messages:{title:i("team.transferNode.delegateDialog.title"),scan:i("team.transferNode.delegateDialog.scan"),confirm:i("team.transferNode.delegateDialog.confirm"),success:i("team.transferNode.delegateDialog.success")},popup:!0})},{body:()=>{const R=qe({inviteId:s.inviteId,endpoint:m});return e.jsxs("div",{children:[e.jsx(Es,{children:i("team.transferNode.inviteDialog.createSuccessTip",{expireDate:me(s.expireDate,I)})}),e.jsx("div",{style:{marginTop:"40px"}}),e.jsx(ke,{children:R})]})},confirm:i("common.confirm"),onConfirm:l}],O=D[d];return e.jsxs(te,{title:i("team.transferNode.inviteDialog.title"),fullWidth:!0,open:!0,showCloseButton:!1,actions:e.jsxs(e.Fragment,{children:[O.cancel&&e.jsx(M,{onClick:O.onCancel,color:"inherit",children:O.cancel}),e.jsxs(M,{onClick:O.onConfirm,color:"primary",disabled:y,variant:"contained",autoFocus:!0,children:[y&&e.jsx(oe,{size:16}),O.confirm]})]}),children:[e.jsx(ze,{component:"div",children:typeof O.body=="function"?O.body():O.body}),!!j&&e.jsx(re,{severity:"error",variant:"icon",children:j})]})}Xe.propTypes={teamDid:b.string.isRequired,onCancel:b.func.isRequired,onSuccess:b.func.isRequired,onError:b.func,endpoint:b.string};Xe.defaultProps={onError:()=>{},endpoint:""};const Es=z.div`
|
|
2
|
-
font-size: 16px;
|
|
3
|
-
font-weight: bold;
|
|
4
|
-
`;var Je=function(t){return e.jsxs("svg",{...t,children:[e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.88619 1.875C5.0541 1.875 4.24071 2.12174 3.54885 2.58402C2.857 3.0463 2.31777 3.70336 1.99934 4.47211C1.68092 5.24085 1.5976 6.08676 1.75994 6.90285C1.92227 7.71895 2.32295 8.46858 2.91133 9.05695C3.4997 9.64532 4.24933 10.046 5.06543 10.2083C5.88152 10.3707 6.72743 10.2874 7.49617 9.96893C8.26492 9.65051 8.92198 9.11128 9.38426 8.41942C9.84654 7.72757 10.0933 6.91417 10.0933 6.08209C10.0933 4.9663 9.65003 3.89621 8.86105 3.10723C8.07207 2.31825 7.00198 1.875 5.88619 1.875ZM4.11182 4.30773C4.58242 3.83714 5.22067 3.57276 5.88619 3.57276C6.38249 3.57276 6.86764 3.71993 7.2803 3.99566C7.69295 4.27139 8.01458 4.66329 8.20451 5.12181C8.39443 5.58033 8.44413 6.08487 8.3473 6.57164C8.25048 7.0584 8.01149 7.50552 7.66055 7.85645C7.30962 8.20739 6.8625 8.44638 6.37574 8.5432C5.88897 8.64003 5.38443 8.59033 4.92591 8.40041C4.46739 8.21048 4.07549 7.88885 3.79976 7.4762C3.52403 7.06354 3.37686 6.57839 3.37686 6.08209C3.37686 5.41657 3.64123 4.77832 4.11182 4.30773ZM4.20709 10.8302C3.0913 10.8302 2.02121 11.2735 1.23223 12.0624C0.443246 12.8514 0 13.9215 0 15.0373V17.8358C0 17.9955 0.12947 18.125 0.289179 18.125H1.40858C1.56829 18.125 1.69776 17.9955 1.69776 17.8358V15.0373C1.69776 14.3718 1.96214 13.7335 2.43273 13.2629C2.90332 12.7924 3.54157 12.528 4.20709 12.528H7.5653C7.89483 12.528 8.22113 12.5929 8.52558 12.719C8.83002 12.8451 9.10665 13.0299 9.33966 13.2629C9.57267 13.496 9.75751 13.7726 9.88361 14.077C10.0097 14.3815 10.0746 14.7078 10.0746 15.0373V17.8358C10.0746 17.9955 10.2041 18.125 10.3638 18.125H11.4832C11.6429 18.125 11.7724 17.9955 11.7724 17.8358V15.0373C11.7724 13.9215 11.3291 12.8514 10.5402 12.0624C9.75118 11.2735 8.68109 10.8302 7.5653 10.8302H4.20709Z"}),e.jsx("rect",{x:"12.5",y:"9.375",width:"7.5",height:"1.875",rx:"0.9375"})]})};Je.defaultProps={width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"};Je.displayName="forbid-login";const Jt=Je;var et=function(t){return e.jsxs("svg",{...t,children:[e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.88619 1.875C5.0541 1.875 4.24071 2.12174 3.54885 2.58402C2.857 3.0463 2.31777 3.70336 1.99934 4.47211C1.68092 5.24085 1.5976 6.08676 1.75994 6.90285C1.92227 7.71895 2.32295 8.46858 2.91133 9.05695C3.4997 9.64532 4.24933 10.046 5.06543 10.2083C5.88152 10.3707 6.72743 10.2874 7.49617 9.96893C8.26492 9.65051 8.92198 9.11128 9.38426 8.41942C9.84654 7.72757 10.0933 6.91417 10.0933 6.08209C10.0933 4.9663 9.65003 3.89621 8.86105 3.10723C8.07207 2.31825 7.00198 1.875 5.88619 1.875ZM4.11182 4.30773C4.58242 3.83714 5.22067 3.57276 5.88619 3.57276C6.38249 3.57276 6.86764 3.71993 7.2803 3.99566C7.69295 4.27139 8.01458 4.66329 8.20451 5.12181C8.39443 5.58033 8.44413 6.08487 8.3473 6.57164C8.25048 7.0584 8.01149 7.50552 7.66055 7.85645C7.30962 8.20739 6.8625 8.44638 6.37574 8.5432C5.88897 8.64003 5.38443 8.59033 4.92591 8.40041C4.46739 8.21048 4.07549 7.88885 3.79976 7.4762C3.52403 7.06354 3.37686 6.57839 3.37686 6.08209C3.37686 5.41657 3.64123 4.77832 4.11182 4.30773ZM4.20709 10.8302C3.0913 10.8302 2.02121 11.2735 1.23223 12.0624C0.443246 12.8514 0 13.9215 0 15.0373V17.8358C0 17.9955 0.12947 18.125 0.289179 18.125H1.40858C1.56829 18.125 1.69776 17.9955 1.69776 17.8358V15.0373C1.69776 14.3718 1.96214 13.7335 2.43273 13.2629C2.90332 12.7924 3.54157 12.528 4.20709 12.528H7.5653C7.89483 12.528 8.22113 12.5929 8.52558 12.719C8.83002 12.8451 9.10665 13.0299 9.33966 13.2629C9.57267 13.496 9.75751 13.7726 9.88361 14.077C10.0097 14.3815 10.0746 14.7078 10.0746 15.0373V17.8358C10.0746 17.9955 10.2041 18.125 10.3638 18.125H11.4832C11.6429 18.125 11.7724 17.9955 11.7724 17.8358V15.0373C11.7724 13.9215 11.3291 12.8514 10.5402 12.0624C9.75118 11.2735 8.68109 10.8302 7.5653 10.8302H4.20709Z"}),e.jsx("rect",{x:"12.5",y:"9.375",width:"7.5",height:"1.875",rx:"0.9375"}),e.jsx("rect",{x:"15.3125",y:"14.0625",width:"7.5",height:"1.875",rx:"0.9375",transform:"rotate(-90 15.3125 14.0625)"})]})};et.defaultProps={width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"};et.displayName="allow-login";const en=et;function we(t){const{passport:r,onDelete:l,...u}=t;return e.jsxs(Os,{...u,children:[r.title||r.name," ",!!l&&e.jsx(Un,{"data-cy":"delete-issuance",className:"delete",onClick:l})]})}we.propTypes={passport:b.object.isRequired,onDelete:b.func};we.defaultProps={onDelete:null};const Os=z.span`
|
|
5
|
-
display: inline-flex;
|
|
6
|
-
padding: 2px 8px;
|
|
7
|
-
background: ${t=>t.theme.palette.primary.main};
|
|
8
|
-
border-radius: 100vw;
|
|
9
|
-
font-weight: 400;
|
|
10
|
-
font-size: 12px;
|
|
11
|
-
line-height: 22px;
|
|
12
|
-
color: #fff;
|
|
13
|
-
align-items: center;
|
|
14
|
-
.delete {
|
|
15
|
-
font-size: 1em;
|
|
16
|
-
margin-left: 6px;
|
|
17
|
-
cursor: pointer;
|
|
18
|
-
}
|
|
19
|
-
`;function tt({issuances:t,teamDid:r,onRefresh:l}){const{api:u,inService:m}=H(),{t:g,locale:w}=P.useContext(pe),[p,y]=P.useState(null),[h,i]=P.useState(!1),{endpoint:I}=K(),j=async({id:d})=>{if(!h){i(!0);try{await u.deletePassportIssuance({input:{teamDid:r,sessionId:d}}),l()}catch(n){X.error(n.message)}finally{i(!1),y(null)}}},k=()=>{i(!1),y(null)},o=d=>I?Gn({id:d.id,endpoint:I}):"";function T({data:d}){return e.jsxs("div",{className:"issuance",children:[e.jsxs(E,{display:"flex",justifyContent:"space-between",children:[e.jsx(G,{permission:m?"":"mutate_team",role:m?ne:[],children:n=>n?e.jsx(we,{passport:{title:d.title,name:d.name},onDelete:()=>y({title:g("team.passport.issuance.delete.title"),description:g("team.passport.issuance.delete.description",{link:o(d)}),confirm:g("common.delConfirm"),cancel:g("common.cancel"),onConfirm:()=>{j(d)},onCancel:k})}):e.jsx(we,{passport:{title:d.title,name:d.name}})}),e.jsxs("div",{style:{color:"#999"},children:[g("common.expires"),": ",me(d.expireDate,w)]})]}),e.jsx(E,{mt:2,children:e.jsx(ke,{children:o(d)})})]})}return e.jsxs(Ns,{children:[t.map(d=>e.jsx(T,{data:d})),p&&e.jsx(ue,{title:p.title,description:p.description,confirm:p.confirm,cancel:p.cancel,params:p.params,onConfirm:p.onConfirm,onCancel:p.onCancel})]})}const Ns=z.div`
|
|
20
|
-
.MuiTableHead-root {
|
|
21
|
-
display: none;
|
|
22
|
-
}
|
|
23
|
-
.issuance {
|
|
24
|
-
padding: 16px 0;
|
|
25
|
-
border-bottom: 1px solid #f0f0f0;
|
|
26
|
-
.MuiTypography-root {
|
|
27
|
-
display: inline-block;
|
|
28
|
-
width: 100%;
|
|
29
|
-
background: #f3f3f3;
|
|
30
|
-
border-radius: 4px;
|
|
31
|
-
padding-top: 6px;
|
|
32
|
-
padding-bottom: 6px;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
`;tt.propTypes={teamDid:b.string.isRequired,issuances:b.array,onRefresh:b.func};tt.defaultProps={issuances:[],onRefresh:()=>{}};var ee={};Object.defineProperty(ee,"__esModule",{value:!0});ee.getPermanentDid=_s;ee.getConnectedAccounts=Ie;ee.getConnectedDids=Us;ee.getWallet=sn;var tn=ee.getWalletDid=Bs;ee.getSourceProvider=Fs;ee.getSourceProviders=$s;const nn=Q;function _s(t){return t==null?void 0:t.did}function Ie(t){return(t==null?void 0:t.connectedAccounts)||[]}function Us(t){return Ie(t).map(u=>u.did)}function sn(t){return Ie(t).find(u=>u.provider===nn.LOGIN_PROVIDER.WALLET)}function Bs(t){const r=sn(t);return r==null?void 0:r.did}function Fs(t){return(t==null?void 0:t.sourceProvider)||nn.LOGIN_PROVIDER.WALLET}function $s(t){return Ie(t).map(l=>l.provider)}const Ws=z(({children:t,...r})=>e.jsx(de,{...r,id:"outlined-basic",variant:"outlined",InputProps:{startAdornment:e.jsx(Bn,{})},size:"small",children:t}))`
|
|
36
|
-
.MuiOutlinedInput-root {
|
|
37
|
-
color: #999;
|
|
38
|
-
&.MuiInputBase-adornedStart .MuiSvgIcon-root {
|
|
39
|
-
color: #bfbfbf;
|
|
40
|
-
}
|
|
41
|
-
opacity: 1;
|
|
42
|
-
border-radius: 36px;
|
|
43
|
-
background: #f8f8f8;
|
|
44
|
-
padding-left: 16px;
|
|
45
|
-
input {
|
|
46
|
-
padding-left: 8px;
|
|
47
|
-
font-weight: bold;
|
|
48
|
-
&::placeholder {
|
|
49
|
-
opacity: 1;
|
|
50
|
-
color: #bfbfbf;
|
|
51
|
-
}
|
|
52
|
-
padding-top: 8.5px;
|
|
53
|
-
padding-bottom: 8.5px;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
.MuiOutlinedInput-notchedOutline,
|
|
58
|
-
.MuiOutlinedInput-root:hover .MuiOutlinedInput-notchedOutline,
|
|
59
|
-
.Mui-focused .MuiOutlinedInput-notchedOutline {
|
|
60
|
-
border-color: #eee;
|
|
61
|
-
border-width: 1px;
|
|
62
|
-
}
|
|
63
|
-
`,Ms=Ws,zs=z.div`
|
|
64
|
-
display: flex;
|
|
65
|
-
justify-content: space-between;
|
|
66
|
-
align-items: center;
|
|
67
|
-
font-size: 14px;
|
|
68
|
-
|
|
69
|
-
.right {
|
|
70
|
-
display: flex;
|
|
71
|
-
align-items: center;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
.tabs {
|
|
75
|
-
.MuiButton-root {
|
|
76
|
-
border: none;
|
|
77
|
-
color: #999;
|
|
78
|
-
&.active {
|
|
79
|
-
color: #222;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
@media (max-width: 600px) {
|
|
85
|
-
display: block;
|
|
86
|
-
.right {
|
|
87
|
-
margin-top: 12px;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
`,qs=zs;function Te({teamDid:t,ownerDid:r,needReceive:l,roles:u,onCancel:m,onSuccess:g,onError:w,showOwnerPassport:p}){var x;const{api:y}=H(),[h,i]=P.useState(!1),[I,j]=P.useState(""),{t:k}=V(),[o,T]=P.useState(""),[d,n]=P.useState(""),s=Ve({passportExpireTime:null});P.useEffect(()=>{u.length>0&&T(u[0].name)},[]);const a=async()=>{if(!o){j(k("team.member.error.passportEmpty"));return}j(null),i(!0);try{const v={teamDid:t,name:o,ownerDid:r,passportExpireTime:s.passportExpireTime?s.passportExpireTime.toISOString():""};d&&(v.display={type:"url",content:d}),await y.createPassportIssuance({input:v}),g()}catch(v){const S=J(v);j(S),w(v)}finally{i(!1)}},c=u.find(v=>v.name===o);return e.jsxs(te,{title:k("team.passport.issue"),fullWidth:!0,open:!0,onClick:v=>v.stopPropagation(),onClose:m,disableEscapeKeyDown:!0,PaperProps:{style:{minHeight:"auto"}},actions:e.jsxs(e.Fragment,{children:[e.jsx(M,{onClick:m,color:"inherit",size:"small",children:k("common.cancel")}),e.jsxs(M,{onClick:a,color:"primary",size:"small",disabled:h||!o,variant:"contained",autoFocus:!0,"data-cy":"issue-passport-create-btn",children:[h&&e.jsx(oe,{size:16}),k(l?"team.passport.issuance.create.title":"oauth.issued")]})]}),children:[e.jsx(ze,{component:"div",children:e.jsxs(E,{sx:{display:"flex",flexDirection:"column",gap:3},children:[e.jsxs(Ue,{style:{width:"100%"},variant:"outlined",children:[e.jsx(Be,{children:k("common.passport")}),e.jsx(Fe,{"data-cy":"issue-passport-select-passport",value:o,onChange:v=>{j(null),T(v.target.value)},fullWidth:!0,label:k("common.passport"),disabled:h,onKeyPress:v=>{v.key==="Enter"&&(v.preventDefault(),a())},children:u.filter(v=>p||v.name!=="owner").map(v=>e.jsx(be,{value:v.name,"data-cy":`issue-passport-select-option-${v.name}`,children:e.jsxs(E,{sx:{display:"flex",flexDirection:"column"},children:[e.jsx(Z,{variant:"subtitle1",children:v.title||v.name}),e.jsx(Z,{variant:"caption",sx:{opacity:.7},children:v.description})]})},v.name))})]}),((x=c==null?void 0:c.extra)==null?void 0:x.display)==="custom"&&e.jsx(de,{label:k("common.display"),type:"url",value:d,onChange:v=>n(v.target.value),fullWidth:!0,variant:"outlined",margin:"normal"}),e.jsx(Vt,{value:s.passportExpireTime,onChange:v=>{s.passportExpireTime=v}})]})}),!!I&&e.jsx(re,{severity:"error",variant:"icon",children:I})]})}Te.propTypes={teamDid:b.string.isRequired,ownerDid:b.string.isRequired,needReceive:b.bool,onCancel:b.func.isRequired,onSuccess:b.func.isRequired,onError:b.func,roles:b.array,showOwnerPassport:b.bool};Te.defaultProps={onError:()=>{},roles:[],showOwnerPassport:!1,needReceive:!0};function nt({passport:t,user:r,color:l,width:u,icon:m,children:g,createPassportSvg:w,...p}){const{t:y,locale:h}=V();return e.jsxs(Hs,{display:"flex",alignItems:"center",...p,children:[!!t.display&&e.jsx("div",{className:"passport-item__display",style:{width:u},children:e.jsx(qn,{address:t.id,data:t.display,style:{width:"100%"},imageFilter:typeof u=="number"?{imageFilter:"resize",w:u}:null})}),!t.display&&e.jsx("div",{dangerouslySetInnerHTML:{__html:w({scope:t.scope,role:t.role,title:t.scope==="kyc"?t.name:t.title,issuer:t.issuer&&t.issuer.name,issuerDid:t.issuer&&t.issuer.id,ownerName:r.fullName,ownerDid:r.did,ownerAvatarUrl:r.avatar,revoked:t.revoked,preferredColor:l,width:u,extra:t.scope==="kyc"?{key:"Email",value:t.name}:void 0})}}),e.jsxs("div",{className:"body",children:[e.jsxs(E,{className:"title",display:"flex",alignItems:"center",children:[In(t.title),e.jsxs("div",{className:"status-icons",children:[m,t.revoked&&e.jsx($t,{})]})]}),t.issuanceDate&&e.jsx(E,{className:"title",display:"flex",alignItems:"center",children:y("team.passport.issuanceDate",{date:me(t.issuanceDate,h)})}),t.expirationDate&&e.jsx(E,{className:"title",display:"flex",alignItems:"center",children:y("team.passport.validUntil",{date:me(t.expirationDate,h)})}),g]})]})}nt.propTypes={passport:b.any.isRequired,user:b.any.isRequired,color:b.string.isRequired,createPassportSvg:b.func.isRequired,icon:b.any,children:b.any,width:b.number};nt.defaultProps={icon:null,children:null,width:150};const Hs=z(E)`
|
|
91
|
-
.body {
|
|
92
|
-
padding: 0;
|
|
93
|
-
margin-left: 24px;
|
|
94
|
-
margin-top: 0;
|
|
95
|
-
}
|
|
96
|
-
.title {
|
|
97
|
-
font-weight: 400;
|
|
98
|
-
font-size: 16px;
|
|
99
|
-
line-height: 19px;
|
|
100
|
-
color: ${({theme:t})=>t.palette.text.primary};
|
|
101
|
-
margin-bottom: 8px;
|
|
102
|
-
}
|
|
103
|
-
.tip {
|
|
104
|
-
display: flex;
|
|
105
|
-
align-items: center;
|
|
106
|
-
font-size: 14px;
|
|
107
|
-
margin-top: 6px;
|
|
108
|
-
color: ${({theme:t})=>t.palette.text.secondary};
|
|
109
|
-
}
|
|
110
|
-
.status-icons {
|
|
111
|
-
svg {
|
|
112
|
-
fill: ${({theme:t})=>t.palette.text.secondary};
|
|
113
|
-
height: 1.2em;
|
|
114
|
-
margin-left: 0.4em;
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
`;function Pe({action:t,passport:r}){const{t:l}=V(),{roles:u}=K(),m=u.find(g=>g.name===r.role);return e.jsxs("div",{children:[e.jsx("div",{children:l(t==="enable"?"team.member.enablePassportDescription":"team.member.revokePassportDescription")}),m&&e.jsx(E,{mt:3,fontWeight:"bold",children:l("team.member.passportPermissionTitle")}),m&&e.jsx(E,{mt:1,children:m.description})]})}Pe.propTypes={action:b.string.isRequired,passport:b.object.isRequired};Pe.defaultProps={};function st({user:t,onCreate:r,createPassportSvg:l}){var ge;const u=vn(),{t:m}=V(),{session:g}=fe(),{roles:w,teamDid:p,teamIssuerDid:y,refresh:h,enablePassportIssuance:i,trustedPassports:I,passportColor:j,blocklet:k}=K(),{appIdList:o}=Wt(),{api:T,inService:d}=H(),[n,s]=P.useState(!1),[a,c]=P.useState(null),[x,v]=P.useState(!1),[S,U]=P.useState(""),F=[y,...o||[]].filter(Boolean),A=($e(t,"passports")||[]).map(L=>({...L,revoked:L.status===Y.PASSPORT_STATUS.REVOKED})),D=async L=>{if(!n){s(!0);try{const _=L.status===Y.PASSPORT_STATUS.REVOKED?"enableUserPassport":"revokeUserPassport";await T[_]({input:{teamDid:p,userDid:t.did,passportId:L.id}}),h()}catch(_){X.error(J(_))}finally{s(!1),c(null)}}},O=L=>L.status===Y.PASSPORT_STATUS.REVOKED?c({title:m("team.member.enablePassport"),description:e.jsx(Pe,{action:"enable",passport:L}),confirm:m("common.enable"),cancel:m("common.cancel"),onConfirm:()=>{D(L)},onCancel:()=>{s(!1),c(null)},color:"primary"}):c({title:m("team.member.revokePassport"),description:e.jsx(Pe,{action:"revoke",passport:L}),confirm:m("common.revoke"),cancel:m("common.cancel"),onConfirm:()=>{D(L)},onCancel:()=>{s(!1),c(null)}}),R=(L,_)=>t.did===g.user.did&&g.user.passportId&&g.user.passportId===_.id?{revokable:!1,message:m("team.passport.shouldNotDeleteCurrent")}:L?p===_.issuer.id&&_.name==="owner"?{revokable:!1,message:m("team.passport.noPermission")}:{revokable:!0}:{revokable:!1,message:m("team.passport.noPermission")},W=A.filter(L=>!S||L.title.includes(S)||L.name.includes(S)),se=(L,_)=>_.status===Y.PASSPORT_STATUS.EXPIRED?e.jsx(M,{variant:"outlined",disabled:!0,children:m("common.expired")}):R(L,_).revokable?e.jsxs(M,{variant:"outlined",color:_.revoked?"primary":"secondary",onClick:()=>O(_),children:[_.revoked?e.jsx(je,{style:{fontSize:16,marginRight:4}}):e.jsx($t,{style:{height:16,marginRight:4}}),_.revoked?m("common.enable"):m("common.revoke")]}):e.jsx(Ce,{title:R(L,_).message,children:e.jsx(wt,{style:{color:u.palette.grey[600]}})});return e.jsxs(Vs,{children:[e.jsxs(qs,{children:[e.jsx("div",{className:"left",children:e.jsx(Ms,{placeholder:m("team.passport.search"),value:S,onChange:L=>U(L.target.value)})}),e.jsx("div",{className:"right",children:i&&!!t.approved&&e.jsx(G,{permission:d?"":"mutate_team",role:d?ne:[],children:e.jsxs(M,{variant:"contained",color:"primary","data-cy":"issue-passport",onClick:()=>v(!0),children:[e.jsx(je,{style:{fontSize:16,marginRight:4}}),m("team.passport.issue")]})})})]}),e.jsxs(E,{children:[W.map(L=>e.jsx(G,{permission:d?"":"mutate_team",role:d?ne:[],children:_=>e.jsxs(E,{className:"passport-item",display:"flex",justifyContent:"space-between",alignItems:"center",mt:3,children:[e.jsx(nt,{passport:L,user:t,color:j,createPassportSvg:l,icon:F.length&&!F.includes(L.issuer.id)?e.jsx(Qt,{}):null,children:!!F.length&&!F.includes(L.issuer.id)&&e.jsxs("div",{className:"tip",children:[L.issuer.id!==y&&!I.some(Ae=>Ae.issuerDid===L.issuer.id)&&e.jsx(Ce,{title:m("team.passport.notTrustedIssuerTip"),children:e.jsx(E,{component:wt,style:{fontSize:"1.3em"},color:"error.main",mr:.5})}),e.jsx("span",{children:m("team.passport.issueBy",{name:L.issuer.name})})]})}),e.jsx(E,{children:se(_,L)})]})},L.id)),!W.length&&e.jsx(Ut,{children:m("common.empty")})]}),x&&e.jsx(Te,{teamDid:p,ownerDid:t.did,needReceive:tn(t)===t.did,roles:w,onCancel:()=>v(!1),onSuccess:()=>{r(),v(!1)},showOwnerPassport:k&&!((ge=k.settings)!=null&&ge.owner)}),a&&e.jsx(ue,{title:a.title,description:a.description,confirm:a.confirm,cancel:a.cancel,params:a.params,onConfirm:a.onConfirm,onCancel:a.onCancel,color:a.color})]})}st.propTypes={user:b.object.isRequired,createPassportSvg:b.func.isRequired,onCreate:b.func};st.defaultProps={onCreate:()=>{}};const Vs=z.div`
|
|
118
|
-
.passport-item {
|
|
119
|
-
.MuiButton-outlinedSecondary {
|
|
120
|
-
color: #f16e6e;
|
|
121
|
-
fill: #f16e6e;
|
|
122
|
-
background: #fcf3f3;
|
|
123
|
-
border: 0;
|
|
124
|
-
&:hover {
|
|
125
|
-
border: 0;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
`,Ks=yn(Tn),Tt=Ks,{ROLES:Zs,PASSPORT_STATUS:rn}=Y,Ys=t=>((t==null?void 0:t.passports)||[]).some(r=>r.role===Zs.OWNER&&r.status===rn.VALID),Qs=(t,r=[])=>{const l=u=>u.status!==rn.VALID||!r.includes(u.issuer.id)?!1:!(u.expirationDate&&Date.now()>new Date(u.expirationDate).getTime());return Tt((t.passports||[]).filter(u=>!u.display).filter(l),"name").concat(Tt((t.passports||[]).filter(u=>u.display).filter(l),"display.content"))};var on={hasActiveOwnerPassport:Ys,getActivePassports:Qs};function De({user:t,onCancel:r,onSuccess:l,onError:u,children:m}){const{api:g,info:w,inService:p}=H(),{session:y}=fe(),{teamDid:h,refresh:i}=K(),{t:I}=V(),[j,k]=P.useState(!1),[o,T]=P.useState(!1),d=()=>T(!0),n=async c=>{const{did:x,approved:v}=c;if(!j){k(!0);try{await g.updateUserApproval({input:{teamDid:h,user:{did:x,approved:!v}}}),T(!1),l(),i()}catch(S){X.error(J(S)),u()}finally{k(!1)}}},s={title:t.approved?I("team.member.blockAccess"):I("team.member.allowAccess"),description:t.approved?I("team.member.blockAccessDescription"):I("team.member.allowAccessDescription"),confirm:I("common.confirm"),cancel:I("common.cancel"),onConfirm:()=>{n(t)},onCancel:()=>{k(!1),T(!1),r()},color:t.approved?"error":"primary"};let a;return on.hasActiveOwnerPassport(t)?a=!1:p?a=!Se(y.user,t.did):a=w.nodeOwner&&!Kt(w,t.did)&&!Se(y.user,t.did),a?e.jsxs(e.Fragment,{children:[typeof m=="function"?m({can:a,open:d}):m,o?e.jsx(ue,{title:s.title,description:s.description,confirm:s.confirm,cancel:s.cancel,params:s.params,onConfirm:s.onConfirm,onCancel:s.onCancel,color:s.color}):null]}):null}De.propTypes={user:b.object,onSuccess:b.func,onCancel:b.func,onError:b.func,children:b.oneOfType([b.object,b.func])};De.defaultProps={user:{},onSuccess:()=>{},onCancel:()=>{},onError:()=>{},children:null};function rt({user:t,onCancel:r,onSuccess:l,onError:u,children:m}){const{api:g,info:w,inService:p}=H(),{session:y}=fe(),{teamDid:h}=K(),{t:i}=V(),[I,j]=P.useState(!1),[k,o]=P.useState(!1),T=()=>o(!0),d=async a=>{const{did:c}=a;if(!I){j(!0);try{await g.removeUser({input:{teamDid:h,user:{did:c}}}),o(!1),l(),X.success(i("team.member.removeUserSuccess")),setTimeout(()=>{window.location.reload()},1e3)}catch(x){X.error(J(x)),u()}finally{j(!1)}}},n={title:i("team.member.removeUser"),description:i("team.member.removeUserDescription",{did:t.did}),confirm:i("common.confirm"),cancel:i("common.cancel"),onConfirm:()=>{d(t)},onCancel:()=>{j(!1),o(!1),r()},color:"error"};let s;return on.hasActiveOwnerPassport(t)?s=!1:p?s=!Se(y.user,t.did):s=w.nodeOwner&&!Kt(w,t.did)&&!Se(y.user,t.did),s?e.jsxs(e.Fragment,{children:[typeof m=="function"?m({can:s,open:T}):m,k?e.jsx(ue,{title:n.title,description:n.description,confirm:n.confirm,cancel:n.cancel,params:n.params,onConfirm:n.onConfirm,onCancel:n.onCancel,color:n.color}):null]}):null}rt.propTypes={user:b.object,onSuccess:b.func,onCancel:b.func,onError:b.func,children:b.oneOfType([b.object,b.func])};rt.defaultProps={user:{},onSuccess:()=>{},onCancel:()=>{},onError:()=>{},children:null};function ot({hasPasskey:t}){const{isNodeTeam:r}=K();return r?e.jsx(Fn,{behavior:"only-new",action:"connect",createMode:"connect",createButtonText:t?"Add New Passkey":"Add Passkey",onSuccess:St,onError:St,dense:!0}):null}ot.propTypes={hasPasskey:b.bool};ot.defaultProps={hasPasskey:!1};function it({user:t,onChangeUser:r}){const l=t.connectedAccounts||[],{t:u}=V(),{session:m}=fe(),{disconnectPasskey:g}=m.usePasskey(),w=l.some(p=>p.provider===Q.LOGIN_PROVIDER.PASSKEY&&p.did);return e.jsxs("div",{children:[l.map(p=>e.jsxs("div",{children:[e.jsx(q,{style:{alignItems:"flex-start",cursor:"pointer"},valueComponent:"div",nameWidth:120,name:p.provider,onClick:()=>{const y=document.getElementById(`account-details-${p.did}`);y&&(y.style.display=y.style.display==="none"?"block":"none")},children:e.jsx(Ke,{did:p.did,showQrcode:!0})},p.did),e.jsxs(bn,{id:`account-details-${p.did}`,sx:{display:"none",mt:-1,mb:1,pt:1,pl:1,pr:1,boxShadow:"none",border:"1px solid #e0e0e0"},children:[p.did&&e.jsx(q,{nameWidth:120,name:"DID",children:p.did}),p.pk&&e.jsx(q,{nameWidth:120,name:"PublicKey",children:p.pk}),p.id&&e.jsx(q,{nameWidth:120,name:"ID",children:p.id}),p.sub&&e.jsx(q,{nameWidth:120,name:"Sub",children:p.sub}),p.lastLoginAt&&e.jsx(q,{nameWidth:120,name:"Last Login",children:p.lastLoginAt}),p.counter&&e.jsx(q,{nameWidth:120,name:"Counter",children:p.counter}),p.userInfo&&e.jsx(q,{nameWidth:120,name:"User Info",children:e.jsx("pre",{style:{margin:0,fontSize:12},children:JSON.stringify(p.userInfo,null,2)})}),p.extra&&e.jsx(q,{nameWidth:120,name:"Extra",children:e.jsx("pre",{style:{margin:0,fontSize:12},children:JSON.stringify(p.extra,null,2)})}),p.provider===Q.LOGIN_PROVIDER.PASSKEY&&e.jsx(Ot,{size:"small",variant:"contained",color:"error",sx:{mb:1},onClick:async()=>{await g({session:m,connectedAccount:p}),await r(t)},children:u("common.disconnect")})]})]},p.did)),e.jsx(ot,{hasPasskey:w})]})}it.propTypes={user:b.object.isRequired,onChangeUser:b.func};it.defaultProps={onChangeUser:()=>{}};function Dt({info:t,verified:r}){return e.jsxs(E,{display:"flex",alignItems:"center",children:[t,r&&e.jsx(Hn,{color:"success",style:{fontSize:16,marginLeft:4}})]})}b.string.isRequired;const ce="info";function at({userDid:t,onCancel:r,initTab:l,createPassportSvg:u}){var F;const{api:m,ws:{useSubscription:g},inService:w}=H(),{session:p}=fe(),{roles:y,teamDid:h,isNodeTeam:i,enablePassportIssuance:I}=K(),{t:j,locale:k}=V(),o=Ve({user:null,issuances:null,tab:l||ce}),[T,d]=P.useState(""),n=async(A,D)=>{try{const O=await m.doBatchQuery({getUser:{input:{teamDid:A,user:{did:D},options:{includeTags:!0}}},getPassportIssuances:{input:{teamDid:A,ownerDid:D}}});O.getUser.user&&(O.getUser.user.avatar=Zt(O.getUser.user.avatar,A,w),O.getUser.user.passports=(O.getUser.user.passports||[]).filter(R=>R.issuer)),o.user=O.getUser.user||{},o.issuances=O.getPassportIssuances.list||[]}catch(O){X.error(J(O))}};P.useEffect(()=>{h&&n(h,t)},[t,h]);const s=A=>{A.teamDid===h&&A.user&&A.user.did===t&&n(h,t)};g(Q.TeamEvents.userUpdated,s,[t,h]),P.useEffect(()=>{o.issuances&&!o.issuances.length&&o.tab==="issuances"&&(o.tab=ce)},[o.issuances]),P.useEffect(()=>{var A;as.user.getProfileUrl({did:(A=o.user)==null?void 0:A.did,locale:k}).then(d)},[(F=o.user)==null?void 0:F.did,k]);const a=async A=>{await n(h,A.did),o.tab=o.tab||ce},c=()=>{var D,O;return(o.user?[{name:j("team.member.name"),value:o.user.fullName},{name:j("common.email"),value:o.user.email?e.jsx(Dt,{info:o.user.email,verified:o.user.emailVerified}):"-"},{name:j("common.phone"),value:o.user.phone?e.jsx(Dt,{info:o.user.phone,verified:o.user.phoneVerified}):"-"},{name:j("team.member.source"),value:e.jsx(E,{display:"flex",alignItems:"center",children:Q.PROVIDER_NAME[((D=o.user)==null?void 0:D.sourceProvider)||Y.USER_TYPE.WALLET]||((O=o.user)==null?void 0:O.sourceProvider)})},{name:j("team.member.allowAccess"),value:o.user.approved?j("common.yes"):j("common.no")},{name:j("common.createdAt"),value:o.user.createdAt?e.jsx(We,{value:o.user.createdAt,type:"all",locale:k}):"-"},{name:j("team.member.lastLogin"),value:o.user.lastLoginAt?e.jsx(We,{value:o.user.lastLoginAt,type:"all",locale:k}):"-"},{name:j("team.member.lastLoginIp"),value:o.user.lastLoginIp||""},{name:j("common.remark"),value:o.user.remark||"-"},{name:j("team.invite.inviter"),value:o.user.inviter?e.jsx(Ke,{compact:!0,responsive:!0,did:o.user.inviter,showQrcode:!0}):"-"},Array.isArray(o.user.tags)&&o.user.tags.length>0?{name:j("common.tags"),value:o.user.tags.map(R=>e.jsx(Ht,{style:{background:R.color,color:Mt(R.color),marginRight:4},children:R.title},R.id))}:null].filter(Boolean):[]).map(R=>R.name===j("common.did")?e.jsx(q,{valueComponent:"div",nameWidth:120,name:R.name,nameFormatter:()=>j("common.did"),children:R.value},R.name):e.jsx(q,{style:{alignItems:"flex-start"},valueComponent:"div",nameWidth:120,name:R.name,children:R.value},R.name))},x={info:{label:j("common.basicInfo"),value:ce,component:c},oauth:{label:j("team.member.connectedAccounts"),value:"oauth",component:()=>e.jsx(it,{user:o.user,onChangeUser:a})},passports:{label:j("common.passport"),value:"passports",component:()=>e.jsx(st,{user:o.user,teamDid:h,roles:y,createPassportSvg:u,onCreate:()=>{n(h,t).then(()=>{I&&o.issuances&&o.issuances.length&&(o.tab="issuances")})},onRefresh:()=>{n(h,t)}})},issuances:{label:j("team.passport.issuance.pending"),value:"issuances",component:()=>e.jsx(tt,{issuances:o.issuances||[],teamDid:h,onRefresh:()=>n(h,t)})}},v=Object.values(x).map(({label:A,value:D})=>({label:A,value:D})).filter(A=>{var D,O;return A.value==="issuances"?I&&o.issuances&&!!o.issuances.length:A.value==="oauth"?i&&((D=p.user)==null?void 0:D.did)===t?!0:(((O=o.user)==null?void 0:O.connectedAccounts)||[]).find(W=>{var se;return W.did!==((se=o.user)==null?void 0:se.did)}):!0}),S=x[o.tab]||x.info,U=A=>{o.tab=A};return e.jsx(te,{title:j("common.member"),onClose:r,open:!0,PaperProps:{style:{maxWidth:632,minHeight:"80vh"}},fullWidth:!0,actions:o.user&&e.jsxs(G,{permission:w?"":"mutate_team",role:w?ne:[],children:[e.jsx(De,{user:o.user,children:({open:A})=>e.jsxs(At,{onClick:A,children:[o.user.approved?e.jsx(Jt,{style:{fontSize:"1.2em",marginRight:"0.4em"}}):e.jsx(en,{style:{fontSize:"1.2em",marginRight:"0.4em"}}),o.user.approved?j("team.member.blockAccess"):j("team.member.allowAccess")]})}),e.jsx(rt,{user:o.user,onSuccess:r,children:({open:A})=>e.jsxs(At,{onClick:A,children:[e.jsx(is,{style:{fontSize:"1.2em",marginRight:"0.4em"}}),j("team.member.removeUser")]})})]}),children:e.jsxs(Gs,{children:[!o.user&&e.jsx(Xs,{children:e.jsx(oe,{})}),o.user&&e.jsxs("div",{children:[e.jsxs(E,{sx:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",overflow:"hidden"},children:[e.jsx(E,{sx:{display:"flex",alignItems:"center",width:"100%",overflow:"hidden"},className:"info",children:e.jsx(zt,{user:o.user,cardType:qt.Detailed,infoType:es.Minimal,avatarSize:48,sx:{padding:0,border:"none"},showDid:!0,didProps:{compact:!0,responsive:!1,showQrcode:!0}})}),!!w&&e.jsx(E,{href:T,target:"_blank",rel:"noreferrer",component:"a",sx:{flexShrink:0},children:e.jsxs(Ot,{variant:"contained",color:"primary","data-cy":"issue-passport",children:[e.jsx($n,{icon:"majesticons:open-line",style:{fontSize:16,marginRight:4}}),j("team.member.openProfile")]})})]}),e.jsx(E,{mx:3,className:"tabs",children:e.jsx(Wn,{tabs:v,current:o.tab,onChange:U,scrollButtons:"auto"})}),e.jsx("div",{className:"body",children:e.jsx(S.component,{})})]})]})})}at.propTypes={userDid:b.string.isRequired,onCancel:b.func.isRequired,createPassportSvg:b.func.isRequired,initTab:b.string};at.defaultProps={initTab:ce};const Gs=z.div`
|
|
130
|
-
.info {
|
|
131
|
-
.name {
|
|
132
|
-
font-weight: 400;
|
|
133
|
-
font-size: 18px;
|
|
134
|
-
line-height: 25px;
|
|
135
|
-
color: ${({theme:t})=>t.palette.text.primary};
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
.tabs {
|
|
140
|
-
margin-top: 24px;
|
|
141
|
-
margin-left: 0;
|
|
142
|
-
margin-right: 0;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
.body {
|
|
146
|
-
margin-top: 24px;
|
|
147
|
-
}
|
|
148
|
-
`,Xs=z.div`
|
|
149
|
-
flex: 1;
|
|
150
|
-
display: flex;
|
|
151
|
-
justify-content: center;
|
|
152
|
-
align-items: center;
|
|
153
|
-
height: 200px;
|
|
154
|
-
`,At=z.div`
|
|
155
|
-
flex-shrink: 0;
|
|
156
|
-
width: 50%;
|
|
157
|
-
height: 64px;
|
|
158
|
-
display: flex;
|
|
159
|
-
justify-content: center;
|
|
160
|
-
align-items: center;
|
|
161
|
-
cursor: pointer;
|
|
162
|
-
font-size: 16px;
|
|
163
|
-
position: sticky;
|
|
164
|
-
bottom: 0;
|
|
165
|
-
z-index: 10;
|
|
166
|
-
color: #999;
|
|
167
|
-
fill: #999;
|
|
168
|
-
`;function lt(){const{api:t,inService:r}=H(),{t:l,locale:u}=P.useContext(pe),{teamDid:m,invitations:g,refresh:w,endpoint:p}=K(),[y,h]=P.useState(null),[i,I]=P.useState(!1),j=async({inviteId:d})=>{if(!i){I(!0);try{await t.deleteInvitation({input:{teamDid:m,inviteId:d}}),w(),await Jn(800)}catch(n){console.error(n)}finally{I(!1),h(null)}}},k=()=>{I(!1),h(null)},o=d=>p?qe({inviteId:d.inviteId,endpoint:p}):"",T=[{label:l("team.inviting.link"),name:"inviteId",options:{sort:!1,customBodyRenderLite:d=>{const n=g[d];return p?e.jsx(ke,{children:o(n)}):e.jsx(oe,{size:16})}}},{label:l("common.role"),name:"role",widtn:70,options:{sort:!1,customBodyRender:d=>d||"--"}},{label:l("common.remark"),name:"remark",options:{sort:!1,customBodyRender:d=>d||"--"}},{label:l("team.inviting.inviter"),name:"inviter.fullName",options:{sort:!1,customBodyRender:(d,{rowIndex:n})=>{var a;const s=g[n];return(a=s==null?void 0:s.inviter)==null?void 0:a.fullName}}},{label:l("common.expires"),name:"expireDate",options:{sort:!1,customBodyRender:d=>e.jsx(E,{children:Xn(d).format("YYYY-MM-DD HH:mm")})}},{label:l("common.actions"),name:"",width:100,align:"center",options:{sort:!1,customBodyRenderLite:d=>{const n=g[d];return e.jsx(G,{permission:r?"":"mutate_team",role:r?ne:[],children:e.jsxs(M,{onClick:()=>h({title:l("team.inviting.delete.title"),description:l("team.inviting.delete.description",{link:o(n)}),confirm:l("common.delConfirm"),cancel:l("common.cancel"),onConfirm:()=>j(n),onCancel:k}),size:"small",color:"error",variant:"text",children:[e.jsx(Mn,{style:{fontSize:"1.2em"}}),l("common.delete")]})})}}}];return e.jsxs(Js,{children:[g.length?e.jsx(Bt,{locale:u,data:[...g],columns:T,verticalKeyWidth:100,options:{download:!1,filter:!1,print:!1,search:!1,viewColumns:!1}}):e.jsx(Ut,{sx:{minHeight:200},children:l("common.empty")}),y&&e.jsx(ue,{title:y.title,description:y.description,confirm:y.confirm,cancel:y.cancel,params:y.params,onConfirm:y.onConfirm,onCancel:y.onCancel})]})}const Js=z.div`
|
|
169
|
-
margin-top: -20px;
|
|
170
|
-
`;lt.propTypes={};lt.defaultProps={};var ct={},er=Et;Object.defineProperty(ct,"__esModule",{value:!0});var an=ct.default=void 0,tr=er(Nt()),nr=e;an=ct.default=(0,tr.default)((0,nr.jsx)("path",{d:"m17 7-1.41 1.41L18.17 11H8v2h10.17l-2.58 2.58L17 17l5-5zM4 5h8V3H4c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h8v-2H4z"}),"Logout");function dt({type:t,user:r,onIssuePassport:l,onRefresh:u}){const{teamDid:m,roles:g}=K(),{confirmHolder:w,confirmApi:p}=Ft(),{t:y}=P.useContext(pe),[h,i]=P.useState(!1),{api:I}=H(),j=He(async()=>{await I.logoutUser({input:{teamDid:m,appPid:m,userDid:r.did}})});return e.jsxs(e.Fragment,{children:[w,e.jsx(ls,{"data-cy":"member-actions",actions:[{icon:e.jsx(je,{fontSize:"small"}),text:y("team.passport.issue"),"data-cy":"action-issue-passport",onClick:k=>{k.stopPropagation(),i(!0)}},({close:k})=>e.jsx(De,{user:r,children:({open:o})=>e.jsxs(be,{dense:!0,onClick:T=>{T.stopPropagation(),k(),o(T)},"data-cy":"action-toggle-block",children:[e.jsx(Cn,{style:{minWidth:24,marginRight:8},children:r.approved?e.jsx(Jt,{}):e.jsx(en,{})}),e.jsx(jn,{primary:r.approved?y("team.member.blockAccess"):y("team.member.allowAccess")})]})},"toggle-approval"),t==="blocklet"&&{icon:e.jsx(an,{fontSize:"small"}),text:y("team.member.forceLogout"),onClick:k=>{k.stopPropagation(),p.open({title:y("team.member.forceLogout"),content:y("team.member.forceLogoutDescription"),confirmButtonText:y("common.confirm"),cancelButtonText:y("common.cancel"),onClick:o=>o.stopPropagation(),onConfirm:async()=>{await j(),await p.close(),u()}})}}].filter(Boolean)}),h&&e.jsx(Te,{teamDid:m,ownerDid:r.did,needReceive:tn(r)===r.did,roles:g,onCancel:()=>i(!1),onSuccess:()=>{l(),i(!1)}})]})}dt.propTypes={type:b.oneOf(["server","blocklet"]).isRequired,user:b.object.isRequired,onIssuePassport:b.func,onRefresh:b.func};dt.defaultProps={onIssuePassport:()=>{},onRefresh:()=>{}};const _e="$all",Rt="$none",Lt="$blocked",ye=(t,r)=>{const l=t.find(u=>u.key===r);return(l==null?void 0:l.value)||0},sr=(t,r)=>{const l=t.passports||[];return l.length?!l.some(u=>{var m;return r.includes((m=u.issuer)==null?void 0:m.id)}):!1};function ln({user:t}){const{t:r}=P.useContext(pe),l=ss(()=>({...t,avatar:`${t.avatar}?imageFilter=resize&w=48&h=48`}),[t]),u=e.jsxs("div",{className:"member-block",children:[e.jsxs("div",{className:"member-avatar",children:[e.jsx(zt,{user:l,avatarSize:32,cardType:qt.AvatarOnly,showHoverCard:!1}),!t.approved&&e.jsx("did",{className:"badge-block"}),t.isFromExternal&&e.jsx(Ce,{title:r("team.passport.externalPassport"),children:e.jsx(E,{ml:1,className:"icon",children:e.jsx(Qt,{})})})]}),e.jsxs("div",{className:"member-meta",children:[e.jsx("div",{className:"member-text",children:e.jsx(cs,{children:t.fullName})}),Array.isArray(t.tags)&&t.tags.length>0&&e.jsx("div",{className:"member-tags",children:t.tags.map(m=>e.jsx(Ht,{style:{background:m.color,color:Mt(m.color),marginRight:4},children:m.title},m.id))})]})]});return t.approved?u:e.jsx(E,{display:"flex",alignItems:"center",children:e.jsx(Ce,{title:r("team.member.blockAccessDescription"),children:u})})}ln.propTypes={user:b.object.isRequired};function rr({type:t,createPassportSvg:r}){var xt,yt,vt,bt;const{confirmApi:l,confirmHolder:u}=Ft({sx:{".MuiDialog-paper":{borderRadius:2,maxWidth:1e3},".ux-dialog_title":{fontWeight:600},".ux-dialog_closeButton":{p:1},".MuiDialogActions-root":{display:{xs:"none",md:"flex"}}}}),{appIdList:m=[],blocklet:g}=Wt(),{teamDid:w,invitations:p,teamIssuerDid:y,roles:h,refresh:i,enablePassportIssuance:I,endpoint:j,api:k}=K(),{api:o,inService:T,ws:{useSubscription:d}}=H(),n=[];if(g){const f=(((yt=(xt=g.settings)==null?void 0:xt.federated)==null?void 0:yt.sites)||[]).find(N=>N.isMaster!==!1),C=(((bt=(vt=g.settings)==null?void 0:vt.federated)==null?void 0:bt.sites)||[]).find(N=>N.appId===g.appDid);if((C==null?void 0:C.status)==="approved"&&n.push({appId:f==null?void 0:f.appId,appName:f==null?void 0:f.appName,appDescription:f==null?void 0:f.appDescription,appLogo:f==null?void 0:f.appLogo,appPid:f==null?void 0:f.appPid,appUrl:f==null?void 0:f.appUrl,version:f==null?void 0:f.version,sourceAppPid:f==null?void 0:f.appPid,provider:"wallet"}),C)n.push({appId:(C==null?void 0:C.appId)||g.appDid,appName:C==null?void 0:C.appName,appDescription:C==null?void 0:C.appDescription,appLogo:C==null?void 0:C.appLogo,appPid:C==null?void 0:C.appPid,appUrl:C==null?void 0:C.appUrl,version:C==null?void 0:C.version,sourceAppPid:null,provider:"wallet"});else{const N=Ls(g,void 0,{returnWallet:!1});n.push({appId:N.did,appName:N.name,appDescription:N.description,appLogo:Dn(N.appUrl,Y.WELLKNOWN_SERVICE_PATH_PREFIX,"/blocklet/logo"),appPid:g==null?void 0:g.appPid,appUrl:N.appUrl,version:N.version,sourceAppPid:null,provider:"wallet"})}}const{t:s,locale:a}=P.useContext(pe),[c,x]=P.useState(!1),[v,S]=P.useState(!1),[U,F]=P.useState(!1),[A,D]=P.useState(!1),[O,R]=P.useState(!1),[W,se]=P.useState([]),[ge,L]=P.useState(),[_,Ae]=P.useState([]),[mt]=Ss({did:void 0}),pt=`members-${w}`,ut=zn(pt),[B,ie]=P.useState({role:_e,searchText:ut.searchText||"",hideBlocked:!1,pageSize:ut.rowsPerPage||10,page:1});ns(async()=>{if(mt.did){const{user:f}=await k.getUser({did:mt.did});f&&D(f)}});const he=(h||[]).map(f=>({name:f.name,title:f.title,num:ye(_,f.name)}));he.unshift({name:_e,title:"All Members",num:ye(_,_e)}),he.push({name:Rt,title:"Other",num:ye(_,Rt)}),he.push({name:Lt,title:"Blocked",num:ye(_,Lt)});const ft=()=>{const f={includeTags:!0,includeUserSessions:t==="blocklet"};B.hideBlocked&&(f.approved=!0),f.role=B.role,B.searchText&&(f.search=B.searchText),R(!0),k.getUsers({query:f,paging:{page:B.page,pageSize:B.pageSize}}).then(C=>{R(!1),(C.users||[]).forEach(N=>{N.isFromExternal=sr(N,An(m)?[y]:m),N.avatar=Zt(N.avatar,w,T),N.passports=(N.passports||[]).filter($=>$.issuer)}),se(C.users||[]),L(C.paging.total)}).catch(C=>{R(!1),X.error(C.message)})},gt=()=>{k.getUsersCountPerRole().then(f=>{Ae(f.counts||[])}).catch(f=>{X.error(f.message)})},Re=f=>{f.teamDid===w&&(ft(),gt())};P.useEffect(()=>{ft()},[`${B.hideBlocked}-${B.role}-${B.page}-${B.pageSize}-${B.searchText}`]),P.useEffect(()=>{gt()},[]),d(Q.TeamEvents.userUpdated,Re,[B]),d(Q.TeamEvents.userAdded,Re,[B]);const cn=I,dn=He(f=>{const C=async({page:N=1,pageSize:$=10,status:Ee}={})=>await o.getUserSessions({input:{teamDid:w,query:{userDid:f.did,appPid:w,status:Ee},paging:{pageSize:$,page:N}}});l.open({title:"User Sessions",content:e.jsx(Vn,{user:f,showAction:!1,showUser:!1,showOffline:!0,getUserSessions:C}),onConfirm(){l.close()},confirmButtonText:s("common.close"),showCancelButton:!1})}),mn=[{label:s("common.name"),name:"fullName",options:{customBodyRenderLite:f=>{const C=W[f];return e.jsx("div",{"data-cy":`member-name-${C.fullName}`,children:e.jsx(ln,{user:C})},C.did)}}},{label:s("common.address"),name:"did",options:{customBodyRender:f=>e.jsx(Ke,{size:14,responsive:!1,compact:!0,copyable:!1,did:f})}},{label:s("team.member.lastLogin"),name:"lastLoginAt",options:{customBodyRender:f=>e.jsx(E,{sx:{minWidth:"100px"},children:e.jsx(We,{value:f,locale:a})})}},{label:s("team.member.lastLoginIp"),name:"lastLoginIp",options:{customBodyRender:f=>f||"-"}},{label:s("team.member.source"),name:"sourceProvider",options:{customBodyRenderLite:f=>{const C=W[f],N=C.sourceProvider||Y.USER_TYPE.WALLET,$=Q.PROVIDER_NAME[N]||N;return C.sourceAppPid?`${$} (${s("team.member.federated")})`:$}}},t==="blocklet"&&{label:s("team.member.activeUserSessions"),name:"userSessions",options:{customBodyRenderLite:f=>{const C=W[f];return e.jsx(Sn,{onClick:N=>{N.stopPropagation(),dn(C)},children:e.jsx(wn,{badgeContent:C==null?void 0:C.userSessionsCount,color:(C==null?void 0:C.userSessionsCount)>0?"primary":"default",sx:(C==null?void 0:C.userSessionsCount)>0?{}:{".MuiBadge-badge":{backgroundColor:"grey",color:"white"}},showZero:!0,children:e.jsx(Kn,{})})})}}},{label:s("common.actions"),name:"",width:100,align:"center",verticalKeyAlign:"center",options:{customBodyRenderLite:f=>{const C=W[f];return e.jsx(G,{permission:T?"":"mutate_team",role:T?ne:[],children:e.jsx(dt,{type:t,user:C,onIssuePassport:()=>D({...C,initTab:"issuances"}),onRefresh:()=>Re({teamDid:w})})})}}}].filter(Boolean),Le=[];cn&&(Le.push(e.jsxs(M,{variant:"outlined",style:{flexShrink:0,marginRight:16},color:"primary",size:"small",onClick:()=>{F(!0)},children:[e.jsx(us,{style:{height:"1em",marginRight:4}}),s("common.inviting"),p.length?` (${p.length})`:""]}),e.jsx(G,{permission:T?"":"mutate_team",role:T?ne:[],children:e.jsxs(M,{style:{flexShrink:0,marginRight:16},variant:"contained",edge:"end",color:"primary",size:"small","data-cy":"invite-member",onClick:()=>x(!0),children:[e.jsx(je,{style:{fontSize:"1.3em",marginRight:4}}),s("team.invite.action")]})})),t==="server"&&Le.push(e.jsx(G,{role:"owner",children:e.jsxs(M,{style:{flexShrink:0},variant:"contained",edge:"end",color:"error",size:"small","data-cy":"invite-member",onClick:()=>S(!0),children:[e.jsx(Yt,{style:{fontSize:"1.3em",marginRight:4}}),s("team.transferNode.name")]})})));const pn=f=>{O||ie(C=>({...C,role:f,hideBlocked:!1,searchText:"",page:1}))},un=f=>{ie(C=>({...C,hideBlocked:f,page:1}))},fn=({page:f,rowsPerPage:C,searchText:N})=>{B.pageSize!==C?ie($=>({...$,pageSize:C,page:1})):B.page!==f+1?ie($=>({...$,page:f+1})):B.searchText!==N&&ie($=>({...$,searchText:N,page:1}))},ht=P.useRef(null),gn={sort:!1,download:!1,filter:!1,print:!1,expandableRowsOnClick:!0,onRowClick(f,{dataIndex:C},N){var $;if(($=ht.current)!=null&&$.contains(N.target)){const Ee=W[C];D(Ee)}},page:B.page-1,rowsPerPage:B.pageSize,count:ge,searchDebounceTime:600};return e.jsxs(or,{children:[u,e.jsxs(E,{className:"main",display:"flex",gap:3,children:[e.jsx("div",{className:"left",children:e.jsx("div",{className:"tabs",children:he.map(f=>e.jsxs("div",{className:`tab ${B.role===f.name?"active":""}`,onClick:()=>pn(f.name),children:[e.jsx("span",{className:"text",children:f.title}),e.jsx(E,{sx:{color:"text.secondary"},children:f.num})]},f.name))})}),e.jsx("div",{ref:ht,className:"right",children:e.jsx(Bt,{className:"main-table",verticalKeyWidth:100,locale:a,durable:pt,durableKeys:["page","rowsPerPage"],title:e.jsx("div",{className:"table-toolbar-left",children:e.jsx(Pn,{control:e.jsx(kn,{sx:{display:"flex !important"},disabled:O,color:"primary",checked:B.hideBlocked,onChange:f=>un(f.target.checked)}),label:s("team.member.onlyApprovedMember")})}),data:W,columns:mn,customButtons:Le,options:gn,loading:O,onChange:fn})})]}),e.jsx(te,{title:s("common.inviting"),onClose:()=>F(!1),open:U,maxWidth:"lg",fullWidth:!0,children:e.jsx(lt,{})}),A&&e.jsx(at,{onCancel:()=>D(null),userDid:A.did,createPassportSvg:r,initTab:A.initTab}),c&&e.jsx(Ge,{teamDid:w,endpoint:j,roles:h,apps:n,onCancel:()=>x(!1),onSuccess:()=>{i(),x(!1)}}),v&&e.jsx(Xe,{teamDid:w,endpoint:j,roles:h,onCancel:()=>S(!1),onSuccess:()=>{i(),S(!1)}})]})}const or=z.div`
|
|
171
|
-
.main {
|
|
172
|
-
.left {
|
|
173
|
-
width: 256px;
|
|
174
|
-
flex-shrink: 0;
|
|
175
|
-
|
|
176
|
-
.tabs {
|
|
177
|
-
padding-top: 16px;
|
|
178
|
-
.tab {
|
|
179
|
-
display: flex;
|
|
180
|
-
justify-content: space-between;
|
|
181
|
-
align-items: center;
|
|
182
|
-
padding: 8px 16px;
|
|
183
|
-
transition: background 0.4s;
|
|
184
|
-
|
|
185
|
-
width: 256px;
|
|
186
|
-
height: 36px;
|
|
187
|
-
border-radius: 8px;
|
|
188
|
-
|
|
189
|
-
cursor: pointer;
|
|
190
|
-
user-select: none;
|
|
191
|
-
|
|
192
|
-
&:nth-child(n + 2) {
|
|
193
|
-
margin-top: 24px;
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
&.active {
|
|
197
|
-
background-color: ${({theme:t})=>t.palette.grey[100]};
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
&:hover {
|
|
201
|
-
background-color: ${({theme:t})=>t.palette.grey[100]};
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
.text {
|
|
205
|
-
font-weight: 400;
|
|
206
|
-
font-size: 16px;
|
|
207
|
-
line-height: 19px;
|
|
208
|
-
color: ${({theme:t})=>t.palette.text.primary};
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
.badge {
|
|
212
|
-
display: flex;
|
|
213
|
-
flex-shrink: 0;
|
|
214
|
-
justify-content: center;
|
|
215
|
-
align-items: center;
|
|
216
|
-
width: 20px;
|
|
217
|
-
height: 20px;
|
|
218
|
-
border-radius: 100%;
|
|
219
|
-
color: #fff;
|
|
220
|
-
background: #666666;
|
|
221
|
-
font-size: 10px;
|
|
222
|
-
font-weight: 400;
|
|
223
|
-
&.is-rect {
|
|
224
|
-
width: auto;
|
|
225
|
-
border-radius: 8px;
|
|
226
|
-
padding: 0 4px;
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
@media (max-width: ${t=>t.theme.breakpoints.values.md}px) {
|
|
232
|
-
display: none;
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
.right {
|
|
236
|
-
flex: 1;
|
|
237
|
-
overflow: auto;
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
.member-block {
|
|
242
|
-
display: flex;
|
|
243
|
-
justify-content: flex-start;
|
|
244
|
-
align-items: center;
|
|
245
|
-
.member-avatar {
|
|
246
|
-
position: relative;
|
|
247
|
-
display: flex;
|
|
248
|
-
justify-content: center;
|
|
249
|
-
align-items: center;
|
|
250
|
-
}
|
|
251
|
-
.member-meta {
|
|
252
|
-
margin-left: 10px;
|
|
253
|
-
display: flex;
|
|
254
|
-
flex-direction: column;
|
|
255
|
-
justify-content: center;
|
|
256
|
-
align-items: flex-start;
|
|
257
|
-
}
|
|
258
|
-
.badge-block {
|
|
259
|
-
width: 14px;
|
|
260
|
-
height: 14px;
|
|
261
|
-
position: absolute;
|
|
262
|
-
right: -4px;
|
|
263
|
-
top: -4px;
|
|
264
|
-
background: #ff5757;
|
|
265
|
-
border-radius: 100%;
|
|
266
|
-
display: flex;
|
|
267
|
-
align-items: center;
|
|
268
|
-
justify-content: center;
|
|
269
|
-
&::after {
|
|
270
|
-
content: '';
|
|
271
|
-
width: 6px;
|
|
272
|
-
height: 2px;
|
|
273
|
-
background: #fefefe;
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
.table-toolbar-left {
|
|
279
|
-
display: flex;
|
|
280
|
-
justify-content: center;
|
|
281
|
-
align-items: center;
|
|
282
|
-
padding: 7px 0;
|
|
283
|
-
}
|
|
284
|
-
`;rr.propTypes={type:b.oneOf(["server","blocklet"]).isRequired,createPassportSvg:b.func.isRequired};export{rr as default};
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import{a as se,Y as U,b$ as Me,c0 as $e,I as K,bZ as Ve,b_ as He,ab as Ne,aa as Je,c1 as Ke,b3 as De,j as he,r as Pe,b1 as G,c2 as xe,ak as ge,B as z,bM as Ge,a4 as Ze,c3 as Ye,a5 as Xe,a1 as Qe,_ as et,aq as Ce}from"./vendor-ux-did-connect-D0L9YnHn.js";import{u as p,a as ae,f as te,c as tt}from"./vendor-hooks-DpwFseeF.js";import{r as A}from"./vendor-react-DEoibe3W.js";import{j as e,aa as u,bs as _,bo as E,O,y as V,H as N,T as ne,I as oe,X as ie,ah as Oe,al as $,cI as nt,a9 as Be,e as je,ab as fe,a7 as ze,ad as st,be as at}from"./vendor-mui-core-Bh-qMRq3.js";import{a9 as rt,O as qe,W as ot,c as it}from"./vendor-arcblock-Ca95GLVH.js";import{J as X,a8 as lt,c as Fe,D as dt,n as Y,aJ as ct,A as ut,b as mt}from"./vendor-utils-rHXShPKm.js";import{A as J,D as H,ay as re,az as L,aH as Re}from"./index-YuW8IExe.js";import{S as le}from"./switch-control-BgwZFVCJ.js";import{S as D}from"./section-C1TPQFRq.js";import{K as pt}from"./keyboard-arrow-down-rounded-DadBVmpO.js";import{I as ht}from"./index-Bv8sds6g.js";import{b as xt}from"./base32-BnPQ4q4v.js";import{u as ft}from"./use-mobile-ZAS6Si4t.js";import"./lottie-web-jYmAQWuC.js";const de={enabled:!1,domain:"",clientId:"",clientSecret:""};function gt(){var v,S,i;const{api:j}=J(),{blocklet:o}=H(),{t:n}=se(),s=(v=o==null?void 0:o.meta)==null?void 0:v.did,w=Object.assign({...de},((i=(S=o==null?void 0:o.settings)==null?void 0:S.oauth)==null?void 0:i.auth0)||{}),{handleSubmit:t,control:f,formState:d,watch:h,reset:l}=re({defaultValues:X(w,Object.keys(de))}),c=h("enabled"),k=p(async r=>{var T,a;try{const{blocklet:b}=await j.configOAuth({input:{did:s,oauth:JSON.stringify({auth0:r})}}),m=Object.assign({...de},((a=(T=b==null?void 0:b.settings)==null?void 0:T.oauth)==null?void 0:a.auth0)||{});l(m),U.success(n("oauth.saveSuccess"))}catch(b){U.error(b.message||n("oauth.saveFailed"))}}),I=p(r=>r!=null&&r.trim()?!0:n("oauth.auth0.domainDescription")),x=p(r=>r!=null&&r.trim()?!0:n("oauth.auth0.clientIdDescription")),g=p(r=>r!=null&&r.trim()?!0:n("oauth.auth0.clientSecretDescription")),y=p(()=>!0);return e.jsx(u,{children:e.jsxs("form",{onSubmit:t(k),disabled:!0,children:[e.jsx(D,{title:n("oauth.auth0.enable"),mb:2.5,children:e.jsx(L,{name:"enabled",control:f,render:({field:r})=>e.jsx(_,{control:e.jsx(le,{sx:{ml:1},checked:r.value,...r})})})}),e.jsx(D,{title:n("oauth.auth0.domain"),children:e.jsx(L,{name:"domain",control:f,rules:{validate:c?I:y},render:({field:r})=>{var T;return e.jsx(E,{fullWidth:!0,children:e.jsx(O,{...r,size:"small",label:n("oauth.auth0.domain"),error:!!d.errors[r.name],helperText:((T=d.errors[r.name])==null?void 0:T.message)||" ",disabled:!c})})}})}),e.jsx(D,{title:n("oauth.auth0.clientId"),children:e.jsx(L,{name:"clientId",control:f,rules:{validate:c?x:y},render:({field:r})=>{var T;return e.jsx(E,{fullWidth:!0,children:e.jsx(O,{...r,size:"small",label:n("oauth.auth0.clientId"),error:!!d.errors[r.name],helperText:((T=d.errors[r.name])==null?void 0:T.message)||" ",disabled:!c})})}})}),e.jsx(D,{title:n("oauth.auth0.clientSecret"),children:e.jsx(L,{name:"clientSecret",control:f,rules:{validate:c?g:y},render:({field:r})=>{var T;return e.jsx(E,{fullWidth:!0,children:e.jsx(O,{...r,size:"small",type:"password",label:n("oauth.auth0.clientSecret"),error:!!d.errors[r.name],helperText:((T=d.errors[r.name])==null?void 0:T.message)||" ",disabled:!c})})}})}),e.jsx(V,{type:"submit",variant:"contained",onSubmit:t(k),disabled:!d.isDirty,children:n("oauth.save")})]})})}const ce={enabled:!1,clientId:"",clientSecret:""};function jt(){var y,v,S;const{api:j}=J(),{blocklet:o}=H(),{t:n}=se(),s=(y=o==null?void 0:o.meta)==null?void 0:y.did,w=Object.assign({...ce},((S=(v=o==null?void 0:o.settings)==null?void 0:v.oauth)==null?void 0:S.github)||{}),{handleSubmit:t,control:f,formState:d,watch:h,reset:l}=re({defaultValues:X(w,Object.keys(ce))}),c=h("enabled"),k=p(async i=>{var r,T;try{const{blocklet:a}=await j.configOAuth({input:{did:s,oauth:JSON.stringify({github:i})}}),b=Object.assign({...ce},((T=(r=a==null?void 0:a.settings)==null?void 0:r.oauth)==null?void 0:T.github)||{});l(b),U.success(n("oauth.saveSuccess"))}catch(a){U.error(a.message||n("oauth.saveFailed"))}}),I=p(i=>i!=null&&i.trim()?!0:n("oauth.github.clientIdDescription")),x=p(i=>i!=null&&i.trim()?!0:n("oauth.github.clientSecretDescription")),g=p(()=>!0);return e.jsx(u,{children:e.jsxs("form",{onSubmit:t(k),disabled:!0,children:[e.jsx(D,{title:n("oauth.github.enable"),mb:2.5,children:e.jsx(L,{name:"enabled",control:f,render:({field:i})=>e.jsx(_,{control:e.jsx(le,{sx:{ml:1},checked:i.value,...i})})})}),e.jsx(D,{title:n("oauth.github.clientId"),children:e.jsx(L,{name:"clientId",control:f,rules:{validate:c?I:g},render:({field:i})=>{var r;return e.jsx(E,{fullWidth:!0,children:e.jsx(O,{...i,size:"small",label:n("oauth.github.clientId"),error:!!d.errors[i.name],helperText:((r=d.errors[i.name])==null?void 0:r.message)||" ",disabled:!c})})}})}),e.jsx(D,{title:n("oauth.github.clientSecret"),children:e.jsx(L,{name:"clientSecret",control:f,rules:{validate:c?x:g},render:({field:i})=>{var r;return e.jsx(E,{fullWidth:!0,children:e.jsx(O,{...i,size:"small",type:"password",label:n("oauth.github.clientSecret"),error:!!d.errors[i.name],helperText:((r=d.errors[i.name])==null?void 0:r.message)||" ",disabled:!c})})}})}),e.jsx(V,{type:"submit",variant:"contained",onSubmit:t(k),disabled:!d.isDirty,children:n("oauth.save")})]})})}const ue={enabled:!1,clientId:"",clientSecret:""};function bt(){var y,v,S;const{api:j}=J(),{blocklet:o}=H(),{t:n}=se(),s=(y=o==null?void 0:o.meta)==null?void 0:y.did,w=Object.assign({...ue},((S=(v=o==null?void 0:o.settings)==null?void 0:v.oauth)==null?void 0:S.google)||{}),{handleSubmit:t,control:f,formState:d,watch:h,reset:l}=re({defaultValues:X(w,Object.keys(ue))}),c=h("enabled"),k=p(async i=>{var r,T;try{const{blocklet:a}=await j.configOAuth({input:{did:s,oauth:JSON.stringify({google:i})}}),b=Object.assign({...ue},((T=(r=a==null?void 0:a.settings)==null?void 0:r.oauth)==null?void 0:T.google)||{});l(b),U.success(n("oauth.saveSuccess"))}catch(a){U.error(a.message||n("oauth.saveFailed"))}}),I=p(i=>i!=null&&i.trim()?!0:n("oauth.google.clientIdDescription")),x=p(i=>i!=null&&i.trim()?!0:n("oauth.google.clientSecretDescription")),g=p(()=>!0);return e.jsx(u,{children:e.jsxs("form",{onSubmit:t(k),disabled:!0,children:[e.jsx(D,{title:n("oauth.google.enable"),mb:2.5,children:e.jsx(L,{name:"enabled",control:f,render:({field:i})=>e.jsx(_,{control:e.jsx(le,{sx:{ml:1},checked:i.value,...i})})})}),e.jsx(D,{title:n("oauth.google.clientId"),children:e.jsx(L,{name:"clientId",control:f,rules:{validate:c?I:g},render:({field:i})=>{var r;return e.jsx(E,{fullWidth:!0,children:e.jsx(O,{...i,size:"small",label:n("oauth.google.clientId"),error:!!d.errors[i.name],helperText:((r=d.errors[i.name])==null?void 0:r.message)||" ",disabled:!c})})}})}),e.jsx(D,{title:n("oauth.google.clientSecret"),children:e.jsx(L,{name:"clientSecret",control:f,rules:{validate:c?x:g},render:({field:i})=>{var r;return e.jsx(E,{fullWidth:!0,children:e.jsx(O,{...i,size:"small",type:"password",label:n("oauth.google.clientSecret"),error:!!d.errors[i.name],helperText:((r=d.errors[i.name])==null?void 0:r.message)||" ",disabled:!c})})}})}),e.jsx(V,{type:"submit",variant:"contained",onSubmit:t(k),disabled:!d.isDirty,children:n("oauth.save")})]})})}const me={enabled:!1,teamId:"",serviceId:"",keyId:"",authKey:"",bundleId:""};function vt(){var i,r,T;const{api:j}=J(),{blocklet:o}=H(),{t:n}=se(),s=(i=o==null?void 0:o.meta)==null?void 0:i.did,w=Object.assign({...me},((T=(r=o==null?void 0:o.settings)==null?void 0:r.oauth)==null?void 0:T.apple)||{}),{handleSubmit:t,control:f,formState:d,watch:h,reset:l}=re({defaultValues:X(w,Object.keys(me))}),c=h("enabled"),k=p(async a=>{var b,m;try{const{blocklet:R}=await j.configOAuth({input:{did:s,oauth:JSON.stringify({apple:a})}}),P=Object.assign({...me},((m=(b=R==null?void 0:R.settings)==null?void 0:b.oauth)==null?void 0:m.apple)||{});l(P),U.success(n("oauth.saveSuccess"))}catch(R){U.error(R.message||n("oauth.saveFailed"))}}),I=p(a=>a!=null&&a.trim()?!0:n("oauth.apple.teamIdDescription")),x=p(a=>a!=null&&a.trim()?!0:n("oauth.apple.serviceIdDescription")),g=p(a=>a!=null&&a.trim()?!0:n("oauth.apple.keyIdDescription")),y=p(a=>a!=null&&a.trim()?!0:n("oauth.apple.authKeyDescription")),v=p(a=>a!=null&&a.trim()?!0:n("oauth.apple.bundleIdDescription")),S=p(()=>!0);return e.jsx(u,{children:e.jsxs("form",{onSubmit:t(k),disabled:!0,children:[e.jsx(D,{title:n("oauth.apple.enable"),mb:2.5,children:e.jsx(L,{name:"enabled",control:f,render:({field:a})=>e.jsx(_,{control:e.jsx(le,{sx:{ml:1},checked:a.value,...a})})})}),e.jsx(D,{title:n("oauth.apple.teamId"),children:e.jsx(L,{name:"teamId",control:f,rules:{validate:c?I:S},render:({field:a})=>{var b;return e.jsx(E,{fullWidth:!0,children:e.jsx(O,{...a,size:"small",label:n("oauth.apple.teamId"),error:!!d.errors[a.name],helperText:((b=d.errors[a.name])==null?void 0:b.message)||" ",disabled:!c})})}})}),e.jsx(D,{title:n("oauth.apple.bundleId"),children:e.jsx(L,{name:"bundleId",control:f,rules:{validate:c?v:S},render:({field:a})=>{var b;return e.jsx(E,{fullWidth:!0,children:e.jsx(O,{...a,size:"small",label:n("oauth.apple.bundleId"),error:!!d.errors[a.name],helperText:((b=d.errors[a.name])==null?void 0:b.message)||" ",disabled:!c})})}})}),e.jsx(D,{title:n("oauth.apple.serviceId"),children:e.jsx(L,{name:"serviceId",control:f,rules:{validate:c?x:S},render:({field:a})=>{var b;return e.jsx(E,{fullWidth:!0,children:e.jsx(O,{...a,size:"small",label:n("oauth.apple.serviceId"),error:!!d.errors[a.name],helperText:((b=d.errors[a.name])==null?void 0:b.message)||" ",disabled:!c})})}})}),e.jsx(D,{title:n("oauth.apple.keyId"),children:e.jsx(L,{name:"keyId",control:f,rules:{validate:c?g:S},render:({field:a})=>{var b;return e.jsx(E,{fullWidth:!0,children:e.jsx(O,{...a,size:"small",label:n("oauth.apple.keyId"),error:!!d.errors[a.name],helperText:((b=d.errors[a.name])==null?void 0:b.message)||" ",disabled:!c})})}})}),e.jsx(D,{title:n("oauth.apple.authKey"),children:e.jsx(L,{name:"authKey",control:f,rules:{validate:c?y:S},render:({field:a})=>{var b;return e.jsx(E,{fullWidth:!0,children:e.jsx(O,{...a,size:"small",type:"password",label:n("oauth.apple.authKey"),multiline:!0,rows:4,error:!!d.errors[a.name],helperText:((b=d.errors[a.name])==null?void 0:b.message)||" ",disabled:!c})})}})}),e.jsx(V,{type:"submit",variant:"contained",onSubmit:t(k),disabled:!d.isDirty,children:n("oauth.save")})]})})}const yt={width:24,height:24,body:'<path fill="currentColor" d="M9 20q-.825 0-1.413-.588T7 18q0-.825.588-1.413T9 16q.825 0 1.413.588T11 18q0 .825-.588 1.413T9 20Zm6 0q-.825 0-1.413-.588T13 18q0-.825.588-1.413T15 16q.825 0 1.413.588T17 18q0 .825-.588 1.413T15 20Zm-6-6q-.825 0-1.413-.588T7 12q0-.825.588-1.413T9 10q.825 0 1.413.588T11 12q0 .825-.588 1.413T9 14Zm6 0q-.825 0-1.413-.588T13 12q0-.825.588-1.413T15 10q.825 0 1.413.588T17 12q0 .825-.588 1.413T15 14ZM9 8q-.825 0-1.413-.588T7 6q0-.825.588-1.413T9 4q.825 0 1.413.588T11 6q0 .825-.588 1.413T9 8Zm6 0q-.825 0-1.413-.588T13 6q0-.825.588-1.413T15 4q.825 0 1.413.588T17 6q0 .825-.588 1.413T15 8Z"/>'};function be({title:j,id:o,children:n,index:s,onMove:w,defaultExpand:t,onEnd:f}){const[d,h]=A.useState(t),l=A.useRef(null),c=A.useRef(null),[{handlerId:k},I]=Me({accept:"dragItem",collect(S){return{handlerId:S.getHandlerId()}},hover(S,i){var M,Q;if(!l.current)return;const r=S.index,T=s;if(r===T)return;const a=(M=l.current)==null?void 0:M.getBoundingClientRect(),b=(Q=c.current)==null?void 0:Q.getBoundingClientRect(),m=(b.bottom-b.top)/2,P=i.getClientOffset().y-a.top;r<T&&P<m||r>T&&P>m||(w(r,T),S.index=T)}}),[{isDragging:x},g]=$e({item:{index:s,type:"dragItem"},collect:S=>({isDragging:S.isDragging()}),end:f});g(c),I(l);const y=x?.5:1,v=p(S=>{S.preventDefault(),S.stopPropagation(),h(!d)});return e.jsxs(u,{ref:l,children:[e.jsxs(u,{sx:{cursor:"pointer","&:hover":{backgroundColor:"grey.100"}},ref:c,"data-handler-id":k,children:[e.jsxs(u,{sx:{py:2,px:1,opacity:y,display:"flex",alignItems:"center",gap:.5},draggable:!1,onClick:v,children:[e.jsx(u,{sx:{pointerEvents:"auto",cursor:"grab","&:active":{cursor:"grabbing"},fontSize:0,color:"text.hint","&:hover":{color:"text.secondary"}},children:e.jsx(K,{fontSize:20,icon:yt})}),e.jsx(ne,{sx:{flex:1},children:j}),e.jsx(oe,{size:"small",sx:{pointerEvents:"auto",transform:d?"":"rotate(180deg)",transition:"transform 0.3s ease"},children:e.jsx(K,{icon:pt,style:{transform:"scale(1.5)"}})})]}),e.jsx(ie,{})]}),e.jsx(u,{sx:{pl:4,py:2.5,display:d?"block":"none"},children:n})]})}be.propTypes={title:N.string.isRequired,id:N.string.isRequired,children:N.node.isRequired,index:N.number.isRequired,onMove:N.func.isRequired,onEnd:N.func.isRequired,defaultExpand:N.bool};be.defaultProps={defaultExpand:!1};const St=[{name:"github",title:"GitHub",icon:e.jsx(K,{icon:rt}),component:e.jsx(jt,{})},{name:"google",title:"Google",icon:e.jsx(K,{icon:Ne}),component:e.jsx(bt,{})},{name:"apple",title:"Apple",icon:e.jsx(K,{icon:Je}),component:e.jsx(vt,{})},{name:"auth0",title:"Auth0",icon:e.jsx(K,{icon:Ke}),component:e.jsx(gt,{})}],wt=["github","google","apple","auth0"];function kt(){var k,I;const{api:j}=J(),{blocklet:o}=H(),n=(k=o==null?void 0:o.meta)==null?void 0:k.did,s=((I=o==null?void 0:o.settings)==null?void 0:I.oauth)||{},w=Object.keys(s).sort((x,g)=>{var y,v,S;return((y=s[x])==null?void 0:y.order)!==void 0&&((v=s[g])==null?void 0:v.order)!==void 0?s[x].order-s[g].order:((S=s[x])==null?void 0:S.order)!==void 0?-1:1});for(const x of wt)w.includes(x)||w.push(x);const t=ae(w.reduce((x,g,y)=>Object.assign(x,{[g]:y}),{})),f=te(()=>{const x=[...St];return x.sort((g,y)=>t[g.name]-t[y.name]),x},[t.auth0,t.github,t.google]),d={};typeof window<"u"&&(d.context=window);const h=p(async x=>{const g={};Object.keys(x).forEach(y=>{g[y]={order:x[y]}}),await j.configOAuth({input:{did:n,oauth:JSON.stringify(g)}})}),l=p((x,g)=>{const y=f[x],v=f[g];t[y.name]=g,t[v.name]=x}),c=p(async()=>{await h(t)});return e.jsx(u,{sx:{".section-left":{width:"160px"}},children:e.jsx(Ve,{backend:He,...d,children:f.map((x,g)=>e.jsx(be,{index:g,id:x.name,title:x.title,icon:x.icon,onMove:l,onEnd:c,defaultExpand:x.enabled,children:x.component},x.name))})})}const Z={ttl:he.SESSION_TTL,cacheTtl:he.SESSION_CACHE_TTL,email:{enabled:!1,requireVerified:!1,requireUnique:!1,trustOauthProviders:!1,trustedIssuers:[],enableDomainBlackList:!1,domainBlackList:[],enableDomainWhiteList:!1,domainWhiteList:[]},phone:{enabled:!1,requireVerified:!1,requireUnique:!1,regionBlackList:[],trustedIssuers:[]}};function W(j){return e.jsx(ot,{...j,sx:{transform:"scale(0.75)"}})}function pe(j,o=!1){const n=o?j.ttl*86400:j.ttl/86400;return{...j,ttl:n}}function Tt(){var a,b;const{api:j}=J(),{blocklet:o}=H(),n=(a=o==null?void 0:o.meta)==null?void 0:a.did,s=lt({},Z,((b=o==null?void 0:o.settings)==null?void 0:b.session)||{});Fe(s.ttl)&&(s.ttl=Z.ttl),Fe(s.cacheTtl)&&(s.cacheTtl=Z.cacheTtl),s.phone||(s.phone=Z.phone),s.email||(s.email=Z.email);const{handleSubmit:w,control:t,formState:f,reset:d,watch:h}=re({defaultValues:X(pe(s),["ttl","cacheTtl","email","phone"])}),{t:l}=se(),c=h("email.enabled"),k=h("phone.enabled"),I=h("email.enableDomainBlackList"),x=h("email.enableDomainWhiteList"),{fields:g,append:y,remove:v}=Re({control:t,name:"email.domainBlackList"}),{fields:S,append:i,remove:r}=Re({control:t,name:"email.domainWhiteList"}),T=p(async m=>{var R;try{const{blocklet:P}=await j.updateAppSessionConfig({input:{did:n,config:dt(pe(m,!0),["phone"])}}),M=Object.assign({},Z,X(((R=P==null?void 0:P.settings)==null?void 0:R.session)||{},["ttl","cacheTtl","email","phone"]));d(pe(M)),U.success(l("common.configSuccess"))}catch(P){U.error(P.message)}});return e.jsx(It,{onSubmit:w(T),children:e.jsxs($,{direction:"column",gap:6,children:[e.jsxs(u,{children:[e.jsxs(u,{children:[e.jsx(ne,{variant:"h6",fontWeight:600,children:l("blocklet.config.session.profile")}),e.jsx(u,{component:ie,my:3})]}),e.jsxs($,{gap:2,children:[e.jsx(D,{title:l("blocklet.config.session.fullNameEnabled"),sectionLeftSx:{width:"600px"},children:e.jsx(u,{sx:{alignSelf:"flex-start"},children:e.jsx(W,{disabled:!0,checked:!0})})}),e.jsx(D,{title:l("blocklet.config.session.avatarEnabled"),sectionLeftSx:{width:"600px"},children:e.jsx(u,{sx:{alignSelf:"flex-start"},children:e.jsx(W,{disabled:!0,checked:!0})})}),e.jsx(D,{title:l("blocklet.config.session.emailEnabled"),sectionLeftSx:{width:"600px"},children:e.jsx(u,{sx:{alignSelf:"flex-start"},children:e.jsx(L,{name:"email.enabled",control:t,render:({field:m})=>e.jsx(W,{...m,checked:m.value})})})}),c&&e.jsxs($,{direction:"column",ml:2,children:[e.jsx(D,{title:l("blocklet.config.session.emailRequireVerified"),sectionLeftSx:{width:"600px"},children:e.jsx(u,{sx:{alignSelf:"flex-start"},children:e.jsx(L,{name:"email.requireVerified",control:t,render:({field:m})=>e.jsx(_,{sx:{mt:1},control:e.jsx(W,{...m,checked:m.value})})})})}),e.jsx(D,{title:l("blocklet.config.session.emailRequireUnique"),sectionLeftSx:{width:"600px"},children:e.jsx(u,{sx:{alignSelf:"flex-start"},children:e.jsx(L,{name:"email.requireUnique",control:t,render:({field:m})=>e.jsx(_,{sx:{mt:1},control:e.jsx(W,{...m,checked:m.value})})})})}),e.jsx(D,{title:l("blocklet.config.session.emailTrustOauthProviders"),sectionLeftSx:{width:"600px"},children:e.jsx(u,{sx:{alignSelf:"flex-start"},children:e.jsx(L,{name:"email.trustOauthProviders",control:t,render:({field:m})=>e.jsx(_,{sx:{mt:1},control:e.jsx(W,{...m,checked:m.value})})})})}),e.jsx(D,{title:l("blocklet.config.session.enableDomainBlackList"),sectionLeftSx:{width:"600px"},children:e.jsx(u,{sx:{alignSelf:"flex-start"},children:e.jsx(L,{name:"email.enableDomainBlackList",control:t,render:({field:m})=>e.jsx(_,{sx:{mt:1},control:e.jsx(W,{...m,checked:m.value})})})})}),I&&e.jsxs(u,{children:[g.map((m,R)=>e.jsxs($,{direction:"row",alignItems:"center",my:1,maxWidth:"720px",children:[e.jsx(L,{name:`email.domainBlackList.${R}`,control:t,render:P=>e.jsx(O,{...P.field,size:"small",fullWidth:!0})}),e.jsx(oe,{onClick:()=>v(R),children:e.jsx(De,{})})]},m.id)),e.jsx(V,{startIcon:e.jsx(qe,{}),onClick:()=>y(""),children:l("blocklet.config.session.addDomain")})]}),e.jsx(D,{title:l("blocklet.config.session.enableDomainWhiteList"),sectionLeftSx:{width:"600px"},children:e.jsx(u,{sx:{alignSelf:"flex-start"},children:e.jsx(L,{name:"email.enableDomainWhiteList",control:t,render:({field:m})=>e.jsx(_,{sx:{mt:1},control:e.jsx(W,{...m,checked:m.value})})})})}),x&&e.jsxs(u,{children:[S.map((m,R)=>e.jsxs($,{direction:"row",alignItems:"center",my:1,maxWidth:"720px",children:[e.jsx(L,{name:`email.domainWhiteList.${R}`,control:t,render:P=>e.jsx(O,{...P.field,size:"small",fullWidth:!0})}),e.jsx(oe,{onClick:()=>r(R),children:e.jsx(De,{})})]},m.id)),e.jsx(V,{startIcon:e.jsx(qe,{}),onClick:()=>i(""),children:l("blocklet.config.session.addDomain")})]})]}),e.jsxs(u,{sx:{display:"none"},children:[e.jsx(D,{title:l("blocklet.config.session.phoneEnabled"),sectionLeftSx:{width:"600px"},children:e.jsx(u,{sx:{alignSelf:"flex-start"},children:e.jsx(L,{name:"phone.enabled",control:t,disabled:!0,render:({field:m})=>e.jsx(_,{sx:{mt:1},control:e.jsx(W,{...m,checked:m.value})})})})}),k&&e.jsxs($,{direction:"column",ml:2,mt:1,children:[e.jsx(D,{title:l("blocklet.config.session.phoneRequireVerified"),sectionLeftSx:{width:"600px"},children:e.jsx(u,{sx:{alignSelf:"flex-start"},children:e.jsx(L,{name:"phone.requireVerified",control:t,render:({field:m})=>e.jsx(_,{control:e.jsx(W,{...m,checked:m.value})})})})}),e.jsx(D,{title:l("blocklet.config.session.phoneRequireUnique"),sectionLeftSx:{width:"600px"},children:e.jsx(u,{sx:{alignSelf:"flex-start"},children:e.jsx(L,{name:"phone.requireUnique",control:t,render:({field:m})=>e.jsx(_,{control:e.jsx(W,{...m,checked:m.value})})})})})]})]})]})]}),e.jsxs(u,{children:[e.jsx(ne,{variant:"h6",fontWeight:600,children:l("blocklet.config.session.period")}),e.jsx(u,{component:ie,my:3}),e.jsx($,{direction:"column",spacing:2,children:e.jsx(L,{name:"ttl",control:t,rules:{min:1,max:30},render:({field:m})=>e.jsx(E,{fullWidth:!0,sx:{mb:2},children:e.jsx(D,{title:l("blocklet.config.session.ttl",{day:m.value}),sectionLeftSx:{width:"600px"},children:e.jsx(u,{sx:{width:"100%",maxWidth:500,px:1.5},children:e.jsx(nt,{...m,defaultValue:7,step:1,marks:[{value:1,label:l("blocklet.config.session.day",{day:1})},{value:7,label:l("blocklet.config.session.days",{day:7})},{value:14,label:l("blocklet.config.session.days",{day:14})},{value:21,label:l("blocklet.config.session.days",{day:21})},{value:30,label:l("blocklet.config.session.days",{day:30})}],min:1,max:30,valueLabelDisplay:"auto"})})})})})})]}),e.jsx(u,{children:e.jsx(V,{type:"submit",variant:"contained",disabled:!f.isDirty,children:l("oauth.save")})})]})})}const It=Oe.form`
|
|
2
|
-
max-width: 1536px;
|
|
3
|
-
|
|
4
|
-
.advanced-config {
|
|
5
|
-
border: 0;
|
|
6
|
-
padding: 0;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
.config-form {
|
|
10
|
-
flex-grow: 1;
|
|
11
|
-
overflow-y: auto;
|
|
12
|
-
will-change: transform;
|
|
13
|
-
|
|
14
|
-
&:first-child {
|
|
15
|
-
margin: 0;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
${j=>j.theme.breakpoints.down("md")} {
|
|
19
|
-
width: 100%;
|
|
20
|
-
flex-shrink: 0;
|
|
21
|
-
padding: 0 24px;
|
|
22
|
-
transform: translate(0, 0);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.config-item {
|
|
27
|
-
display: flex;
|
|
28
|
-
align-items: center;
|
|
29
|
-
justify-content: space-between;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
.config-desc {
|
|
33
|
-
font-weight: normal;
|
|
34
|
-
font-size: 12px;
|
|
35
|
-
color: #666;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.form-item {
|
|
39
|
-
margin-top: 0;
|
|
40
|
-
}
|
|
41
|
-
`;var ve={},Lt=Be;Object.defineProperty(ve,"__esModule",{value:!0});var Ee=ve.default=void 0,Dt=Lt(Pe()),Ae=e;Ee=ve.default=(0,Dt.default)([(0,Ae.jsx)("path",{d:"M19 5v14H5V5zm0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2"},"0"),(0,Ae.jsx)("path",{d:"M14 17H7v-2h7zm3-4H7v-2h10zm0-4H7V7h10z"},"1")],"ArticleOutlined");var ye={},Ct=Be;Object.defineProperty(ye,"__esModule",{value:!0});var Se=ye.default=void 0,qt=Ct(Pe()),Ft=e;Se=ye.default=(0,qt.default)((0,Ft.jsx)("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2m4.24 16L12 15.45 7.77 18l1.12-4.81-3.73-3.23 4.92-.42L12 5l1.92 4.53 4.92.42-3.73 3.23z"}),"Stars");const Rt={width:24,height:24,body:'<path fill="currentColor" d="M6 12.05q0 1.125.425 2.188T7.75 16.2l.25.25V15q0-.425.288-.713T9 14q.425 0 .713.288T10 15v4q0 .425-.288.713T9 20H5q-.425 0-.713-.288T4 19q0-.425.288-.713T5 18h1.75l-.4-.35q-1.3-1.15-1.825-2.625T4 12.05Q4 9.7 5.2 7.787T8.425 4.85q.35-.2.738-.025t.512.575q.125.375-.013.75t-.487.575q-1.45.8-2.313 2.213T6 12.05Zm12-.1q0-1.125-.425-2.187T16.25 7.8L16 7.55V9q0 .425-.288.713T15 10q-.425 0-.713-.288T14 9V5q0-.425.288-.713T15 4h4q.425 0 .713.288T20 5q0 .425-.288.713T19 6h-1.75l.4.35q1.225 1.225 1.788 2.663T20 11.95q0 2.35-1.2 4.263t-3.225 2.937q-.35.2-.737.025t-.513-.575q-.125-.375.013-.75t.487-.575q1.45-.8 2.313-2.212T18 11.95Z"/>'},{DEFAULT_IP_DOMAIN_SUFFIX:At,SLOT_FOR_IP_DNS_SITE:Pt,DEFAULT_DID_DOMAIN:Ot}=he,{encode:Ue}=xt,Bt=j=>`${Ue(j.meta.did)}-${Pt}.${At}`,zt=({did:j,didDomain:o=Ot})=>`${Ue(j)}.${o}`;var Et={getIpDnsDomainForBlocklet:Bt,getDidDomainForBlocklet:zt};const Ut=A.forwardRef((j,o)=>{var v,S;const{t:n}=A.useContext(G),{blocklet:s}=H(),{api:w}=J(),t=ae({loadingReject:!1,loadingApprove:!1,mode:"view",show:!1,data:{},callback:Y}),f=je(),d=((S=(v=f==null?void 0:f.transitions)==null?void 0:v.duration)==null?void 0:S.leavingScreen)||300,h=p(()=>{t.mode="view",t.data={},t.callback=Y}),l=p(()=>{t.show=!1,setTimeout(()=>{h()},d)}),c=p(i=>{t.mode="view",t.show=!0,t.data=i}),k=p((i,r=Y)=>{t.mode="approve",t.show=!0,t.data=i,t.callback=r});A.useImperativeHandle(o,()=>({open:c,close:l,approve:k}),[c,l,k]);const I=te(()=>{if(!t.show)return[];t.data.migratedFrom=[t.data.appId,t.data.appPid];const i=["appName","appLogo","appId","appPid","migratedFrom","appDescription","appUrl","version","appliedAt","status","serverId","serverVersion"];return t.data.isMaster!==!1&&ct(i,"appliedAt","status"),i.map(r=>{const T=n(`federated.info.${r}`);let a=t.data[r];if(r==="appName"&&t.data.isMaster&&(a=e.jsxs(u,{children:[e.jsx(ze,{component:Se}),a]})),["appId","appPid","serverId"].includes(r)&&(a=e.jsx(xe,{children:a})),["appUrl"].includes(r)&&(a=e.jsx(u,{component:"a",href:a,target:"_blank",children:a})),["appLogo"].includes(r)){const b=ut(`https://${Et.getDidDomainForBlocklet({did:t.data.appPid})}`,"/.well-known/service/blocklet/logo");try{const m=new URL(b);m.searchParams.set("imageFilter","resize"),m.searchParams.set("w","80"),m.searchParams.set("h","80"),a=e.jsx("img",{src:m.href,width:"60",height:"60",alt:t.data.appName})}catch{a=e.jsx("img",{src:b,width:"60",height:"60",alt:t.data.appName})}}return r==="status"&&(a=a&&n(`federated.status.${a}`)),r==="migratedFrom"&&(a=(t.data.migratedFrom||[]).filter(R=>![t.data.appId,t.data.appPid].includes(R)).map(R=>e.jsx(xe,{children:R}))),mt(a)&&(a="-"),{name:T,value:a}})},[t.data]),x=t.mode==="approve",g=p(async()=>{try{t.loadingReject=!0,await w.auditFederatedLogin({input:{memberPid:t.data.appPid,did:s.appPid,status:"rejected"}}),l(),t==null||t.callback(!1)}finally{t.loadingReject=!1}}),y=p(async()=>{try{t.loadingApprove=!0,await w.auditFederatedLogin({input:{memberPid:t.data.appPid,did:s.appPid,status:"approved"}}),l(),t==null||t.callback(!0)}finally{t.loadingApprove=!1}});return e.jsx(ge,{open:t.show,title:n(x?"federated.approveToJoinLogin":"federated.siteDetail"),onClose:l,actions:x?e.jsxs(e.Fragment,{children:[e.jsxs(V,{color:"error",variant:"contained",onClick:g,disabled:t.loadingReject,children:[t.loadingReject?e.jsx(fe,{size:16,color:"grey"}):null,n("common.reject")]}),e.jsxs(V,{variant:"contained",onClick:y,disabled:t.loadingApprove,children:[t.loadingApprove?e.jsx(fe,{size:16,color:"grey"}):null,n("common.approve")]})]}):e.jsx(V,{variant:"outlined",onClick:l,children:n("common.close")}),children:I.map(i=>e.jsx(ht,{style:{alignItems:"flex-start"},valueComponent:"div",nameWidth:180,name:i.name,children:i.value},i.name))})}),_e=A.forwardRef((j,o)=>{var c,k;const n=je(),s=((k=(c=n==null?void 0:n.transitions)==null?void 0:c.duration)==null?void 0:k.leavingScreen)||300,{t:w}=A.useContext(G),t=ae({show:!1,data:{link:""}}),f=p(()=>{t.data.link=""}),d=p(()=>{t.show=!1,setTimeout(()=>{f()},s)}),h=p(({link:I})=>{t.show=!0,t.data.link=I});A.useImperativeHandle(o,()=>({open:h,close:d}),[h,d]);const l=p(()=>{tt(t.data.link),d()});return e.jsxs(ge,{open:t.show,title:w("federated.joinFederatedLogin"),onClose:d,PaperProps:{style:{minHeight:"unset"}},actions:e.jsx(z,{color:"primary",autoFocus:!0,variant:"contained",onClick:l,children:w("common.copyAndClose")}),children:[e.jsx(u,{mb:1,children:w("federated.inviteJoinFederatedLoginDescription")}),e.jsx(u,{sx:{"& .copy-button":{display:"none !important"}},children:e.jsx(Ge,{language:"shell",style:{marginBottom:0},children:t.data.link})})]})});function we({mode:j}){var Q,ke,Te,Ie,Le;const o=A.useRef(null),n=A.useRef(null),{t:s,locale:w}=A.useContext(G),{blocklet:t,actions:{refreshBlocklet:f}}=H(),{confirmApi:d,confirmHolder:h}=Ze(),{api:l}=J(),c=((Q=t.settings.federated)==null?void 0:Q.sites)||[],k=((ke=t.settings.federated)==null?void 0:ke.config)||{},I=k.isMaster!==!1,x=c.find(C=>C.appPid===t.appPid),g=ae({loadingSync:!1}),y=p(C=>{var q;(q=n.current)==null||q.open(C)}),v=p(C=>{var q;(q=n.current)==null||q.approve(C,f)}),S=p(C=>{d.open({title:s("federated.removeFederatedLogin"),content:s("federated.removeFederatedLoginDescription"),confirmButtonText:s("common.confirm"),cancelButtonText:s("common.cancel"),confirmButtonProps:{color:"error"},async onConfirm(q){await l.quitFederatedLogin({input:{did:t.appPid,targetDid:C.appPid}}),q()}})}),i=p(C=>{d.open({title:s("federated.disableFederatedLogin"),content:s("federated.disableFederatedLoginDescription"),confirmButtonText:s("common.confirm"),cancelButtonText:s("common.cancel"),confirmButtonProps:{color:"error"},async onConfirm(q){await l.auditFederatedLogin({input:{memberPid:C.appPid,did:t.appPid,status:"revoked"}}),q()}})}),r=p(C=>{d.open({title:s("federated.enableFederatedLogin"),content:s("federated.enableFederatedLoginDescription"),confirmButtonText:s("common.confirm"),cancelButtonText:s("common.cancel"),async onConfirm(q){await l.auditFederatedLogin({input:{memberPid:C.appPid,did:t.appPid,status:"approved"}}),q()}})}),T=te(()=>{const C=[{label:s("common.name"),name:"appName",options:{customBodyRenderLite:q=>{const F=c[q],ee=F.isMaster!==!1;return e.jsx(u,{display:"inline-block",children:e.jsxs(u,{component:"a",display:"flex",alignItems:"center",href:F.appUrl,target:"_blank",onClick:B=>{B.stopPropagation()},children:[ee&&e.jsx(ze,{component:Se,style:{marginRight:"4px"}}),F.appName]})})}}},{label:s("common.did"),name:"appId",options:{customBodyRenderLite:q=>{const F=c[q];return e.jsx(xe,{children:F.appId})}}},{label:s("common.status"),name:"status",options:{customBodyRenderLite:q=>{const F=c[q],ee=F.isMaster!==!1;return e.jsx(u,{children:ee?"-":s(`federated.status.${F.status}`)})}}}];return I&&C.push({label:s("common.actions"),name:"actions",options:{customBodyRenderLite:q=>{const F=c[q],ee=F.isMaster!==!1;return e.jsx(u,{display:"flex",gap:1,children:ee?e.jsxs(e.Fragment,{children:[F.status==="rejected"&&e.jsx(z,{variant:"contained",color:"error",size:"small",onClick:B=>{B.stopPropagation()},children:s("federated.status.rejected")}),F.status==="revoked"&&e.jsx(z,{variant:"contained",color:"secondary",size:"small",onClick:B=>{B.stopPropagation()},children:s("federated.status.revoked")})]}):e.jsxs(e.Fragment,{children:[e.jsx(z,{variant:"contained",color:"error",size:"small",onClick:B=>{B.stopPropagation(),S(F)},children:s("federated.quitMember")},"quiteSite"),F.status==="pending"&&e.jsx(z,{variant:"contained",color:"primary",size:"small",onClick:B=>{B.stopPropagation(),v(F)},children:s("federated.status.pending")},"auditSite"),F.status==="approved"&&e.jsx(z,{variant:"contained",color:"error",size:"small",onClick:B=>{B.stopPropagation(),i(F)},style:{whiteSpace:"nowrap"},children:s("federated.revoke")},"revokeSite"),F.status==="revoked"&&e.jsx(z,{variant:"contained",color:"warning",size:"small",onClick:B=>{B.stopPropagation(),r(F)},style:{whiteSpace:"nowrap"},children:s("federated.approve")},"approveSite")]})})}}}),C},[k.appId,c,I,s]),a=te(()=>({sort:!0,download:!1,filter:!1,print:!1,expandableRowsOnClick:!0,onRowClick(C,{dataIndex:q}){const F=c[q];y(F)}}),[]),b=p(()=>{var q;const C=t.environments.find(F=>F.key===it.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_URL);C!=null&&C.value?(q=o.current)==null||q.open({link:C.value}):U.error(s("federated.failedToGetFederatedLoginLink"))},[(Le=(Ie=(Te=t.site)==null?void 0:Te.domainAliases)==null?void 0:Ie[0])==null?void 0:Le.href]),m=p(()=>{d.open({title:s("federated.quitFederatedLogin"),content:s("federated.quitFederatedLoginDescription"),confirmButtonText:s("common.confirm"),cancelButtonText:s("common.cancel"),confirmButtonProps:{color:"error"},async onConfirm(C){await l.quitFederatedLogin({input:{did:t.appPid}}),C()}})}),R=p(()=>{d.open({title:s("federated.disbandFederatedLogin"),content:s("federated.disbandFederatedLoginDescription"),confirmButtonText:s("common.confirm"),cancelButtonText:s("common.cancel"),confirmButtonProps:{color:"error"},async onConfirm(C){await l.disbandFederatedLogin({input:{did:t.appPid}}),C()}})}),P=p(async()=>{try{g.loadingSync=!0,await Promise.all([await l.syncFederatedConfig({input:{did:t.appPid}}),Ye(500)]),U.success(s("common.succeeded"))}finally{g.loadingSync=!1}}),M=[];return x.status!=="pending"&&M.push(e.jsx(st,{title:s("federated.syncConfig"),children:e.jsx(oe,{size:"small",onClick:P,disabled:g.loadingSync,sx:[{"@keyframes spin":{from:{transform:"rotate(0deg)"},to:{transform:"rotate(360deg)"}}},g.loadingSync?{animation:"spin 1s linear infinite"}:{}],children:e.jsx(K,{icon:Rt,style:{fontSize:24}})},"syncConfig")})),j==="master"?(M.push(e.jsx(z,{size:"small",variant:"contained",onClick:b,sx:{ml:1},children:s("federated.inviteJoinFederatedLogin")},"inviteJoinFederatedLogin")),M.push(e.jsx(z,{color:"error",size:"small",variant:"contained",onClick:R,sx:{ml:1},children:s("federated.disbandFederatedLogin")},"disbandFederatedLogin"))):M.push(e.jsx(z,{size:"small",variant:"contained",color:"error",onClick:m,sx:{ml:1},children:s("federated.quitFederatedLogin")},"quitFederatedLogin")),e.jsxs(e.Fragment,{children:[e.jsx(Xe,{className:"main-table",locale:w,data:c,columns:T,customButtons:M,title:e.jsx(u,{className:"table-toolbar-left",children:s("oauth.federated")}),options:a}),h,e.jsx(_e,{ref:o}),e.jsx(Ut,{ref:n})]})}we.propTypes={mode:N.oneOf(["member","master"])};we.defaultProps={mode:"member"};const _t=A.forwardRef((j,o)=>{var g,y;const{t:n}=A.useContext(G),{api:s}=J(),{blocklet:w}=H(),t=w==null?void 0:w.appPid,f=je(),d=((y=(g=f==null?void 0:f.transitions)==null?void 0:g.duration)==null?void 0:y.leavingScreen)||300,h=ae({loading:!1,show:!1,appUrl:"",appUrlError:"",callback:Y}),l=p(()=>{h.appUrl="",h.appUrlError="",h.callback=Y}),c=p(()=>{h.show=!1,setTimeout(()=>{l()},d)}),k=p((v=Y)=>{h.show=!0,h.callback=v});A.useImperativeHandle(o,()=>({open:k,close:c}),[k,c]);const I=p(v=>{if(!v)throw new Error(n("federated.federatedJoinAppUrlRequired"));if(!Qe(v))throw new Error(n("federated.federatedJoinAppUrlInvalid"))}),x=p(async()=>{try{I(h.appUrl),h.loading=!0;const v=await s.joinFederatedLogin({input:{did:t,appUrl:h.appUrl}});h.show=!1,c(),h==null||h.callback(v)}catch(v){h.appUrlError=v.message}finally{h.loading=!1}});return e.jsxs(ge,{open:h.show,title:n("federated.joinFederatedLogin"),onClose:c,PaperProps:{style:{minHeight:"unset"}},actions:e.jsxs(z,{color:"primary",autoFocus:!0,variant:"contained",onClick:x,disabled:h.loading,children:[h.loading?e.jsx(fe,{size:16,sx:{mr:1},color:"grey"}):null,n("common.confirm")]}),children:[e.jsx(u,{mb:1,children:n("federated.joinFederatedLoginDescription")}),e.jsx(O,{fullWidth:!0,variant:"outlined",margin:"dense",placeholder:n("federated.federatedJoinAppUrl"),label:n("federated.federatedJoinAppUrl"),value:h.appUrl,error:!!h.appUrlError,helperText:h.appUrlError||"eg: https://www.arcblock.io",onChange:v=>{h.appUrl=v.target.value}})]})});function Wt(){const{t:j}=A.useContext(G);return e.jsxs($,{direction:"row",spacing:2,alignItems:"flex-start",p:2,children:[e.jsx(Ee,{fontSize:"large",color:"primary"}),e.jsxs(u,{children:[e.jsx(ne,{variant:"h6",gutterBottom:!0,children:j("federated.title")}),e.jsx(ne,{variant:"body2",color:"text.secondary",children:j("federated.description")}),e.jsx(at,{href:"https://www.arcblock.io/blog/zh/did-connect-federated-login-support",underline:"hover",variant:"body2",color:"primary",target:"_blank",sx:{display:"inline-flex",alignItems:"center",mt:1},children:j("federated.link")})]})]})}function Mt(){var d,h,l,c,k;const j=A.useRef(null),o=A.useRef(null),{t:n}=A.useContext(G),{blocklet:s,actions:{refreshBlocklet:w}}=H(),t=p(()=>{var x,g,y,v;const I=(y=(g=(x=s.site)==null?void 0:x.domainAliases)==null?void 0:g[0])==null?void 0:y.href;if(I)try{const S=new URL(I);(v=j.current)==null||v.open({link:S.origin})}catch{U.error(n("federated.failedToGetFederatedLoginLink"))}},[(l=(h=(d=s.site)==null?void 0:d.domainAliases)==null?void 0:h[0])==null?void 0:l.href]),f=p(()=>{var I;(I=o.current)==null||I.open(()=>{w()})});if(((c=s.settings.federated)==null?void 0:c.sites.length)>0){const I=((k=s.settings.federated)==null?void 0:k.config.isMaster)!==!1;return e.jsx(we,{mode:I?"master":"member"})}return e.jsxs(e.Fragment,{children:[e.jsx(u,{display:"flex",flexDirection:"column",gap:2,justifyContent:"center",alignItems:"center",minHeight:"200px",children:e.jsxs(u,{sx:{maxWidth:400,borderRadius:2,border:"1px solid",borderColor:"divider"},children:[e.jsx(Wt,{}),e.jsx(ie,{sx:{width:1}}),e.jsxs($,{width:1,p:2,gap:1.5,children:[e.jsx(z,{variant:"contained",onClick:t,sx:{width:1},children:n("federated.inviteJoinFederatedLogin")}),e.jsx(z,{variant:"outlined",onClick:f,sx:{width:1},children:n("federated.joinFederatedLogin")})]})]})}),e.jsx(_e,{ref:j}),e.jsx(_t,{ref:o})]})}function We({orientation:j="horizontal"}){const{t:o}=A.useContext(G),n=ft({key:"lg"}),s=[{label:e.jsx(u,{textAlign:"center",width:"100%",children:o("oauth.commonSettings")}),value:"settings"},{label:e.jsx(u,{textAlign:"center",width:"100%",children:o("oauth.federated")}),value:"federated"},{label:e.jsx(u,{textAlign:"center",width:"100%",children:o("oauth.oauth")}),value:"oauth"},{label:e.jsx(u,{textAlign:"center",width:"100%",children:o("oauth.moreLogin")}),value:"more"}],[w,t]=A.useState(s[0].value),f=te(()=>({oauth:e.jsx(kt,{}),federated:e.jsx(Mt,{}),more:e.jsx(et,{children:o("oauth.comingSoon")}),settings:e.jsx(Tt,{})}),[o]);return j==="vertical"?e.jsx($t,{children:e.jsxs($,{direction:{md:"column",lg:"row"},gap:2,children:[e.jsx(u,{sx:{minWidth:"240px",flexShrink:0},children:e.jsx(Ce,{tabs:s,current:w,orientation:n?"horizontal":"vertical",onChange:t,sx:{borderRight:n?0:1,height:"100%",borderColor:"divider"}})}),e.jsx(u,{sx:{flexGrow:1,minWidth:0},children:e.jsx(u,{maxWidth:"1200px",children:f[w]})})]})}):e.jsxs(u,{children:[e.jsx(Ce,{tabs:s,current:w,onChange:t}),e.jsx(u,{marginTop:"10px",children:f[w]})]})}We.propTypes={orientation:N.oneOf(["horizontal","vertical"])};We.defaultProps={orientation:"horizontal"};const $t=Oe.div`
|
|
42
|
-
.MuiTab-root {
|
|
43
|
-
text-align: left;
|
|
44
|
-
align-items: flex-start;
|
|
45
|
-
font-weight: normal;
|
|
46
|
-
|
|
47
|
-
div {
|
|
48
|
-
text-align: left;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
.Mui-selected {
|
|
53
|
-
font-weight: bold;
|
|
54
|
-
}
|
|
55
|
-
`;export{We as default};
|