@abtnode/blocklet-services 1.16.52-beta-20250912-112002-e3499e9c → 1.16.52-beta-20250916-025146-35d976f4
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/dashboard/index.js +24 -6
- package/api/services/notification/blocklet-events-notifier.js +2 -2
- package/api/services/notification/queue.js +9 -9
- package/dist/assets/{access-control-Cv9mJe55.js → access-control-CXa4XdTR.js} +1 -1
- package/dist/assets/{add-component-core-ETZM-c0n.js → add-component-core-C8Wvhlwd.js} +1 -1
- package/dist/assets/{add-resource-CefrvxMv.js → add-resource-CKVcDfq1.js} +1 -1
- package/dist/assets/{addon-CdW1jH1F.js → addon-CGYbwnAQ.js} +1 -1
- package/dist/assets/{advanced-BalF9O34.js → advanced-BHQ085Rc.js} +1 -1
- package/dist/assets/{aigne-BqpFNqN9.js → aigne-CSzB6EAi.js} +1 -1
- package/dist/assets/{appearance-CiCcnDqj.js → appearance-wlMh61hK.js} +1 -1
- package/dist/assets/{arrow-down.svg-C3DZxwUV.js → arrow-down.svg-2NUXhc9M.js} +1 -1
- package/dist/assets/{audit-logs-BiFwhSvl.js → audit-logs-OiH-ZCCu.js} +1 -1
- package/dist/assets/{authorize-FiuAZHUA.js → authorize-C1p1aX84.js} +1 -1
- package/dist/assets/{base32-Ccz4U5Ob.js → base32-Bs5DmmgZ.js} +1 -1
- package/dist/assets/{bind-account-BR2YWYwk.js → bind-account-CnWbtI8I.js} +1 -1
- package/dist/assets/{branding-DiGxInL8.js → branding-Bk8D93gd.js} +2 -2
- package/dist/assets/{branding-Cq_kEjOF.js → branding-BnhQzGq_.js} +1 -1
- package/dist/assets/{branding-B7YBinhB.js → branding-C1lgysY6.js} +1 -1
- package/dist/assets/{bundle-avatar-D8QkKBVi.js → bundle-avatar-CF-8YjIk.js} +1 -1
- package/dist/assets/{complete-uOY3lczm.js → complete-C_JNPzD5.js} +1 -1
- package/dist/assets/{component-CMw-pVd2.js → component-IFve4dXC.js} +3 -3
- package/dist/assets/{config-DIuLHS8J.js → config-BPieGs6J.js} +1 -1
- package/dist/assets/{config-T8EypEzR.js → config-CKpqEH5r.js} +1 -1
- package/dist/assets/{config-C7Wu3S5C.js → config-DBzwJyqc.js} +1 -1
- package/dist/assets/{config-navigation-CQlAn_Fg.js → config-navigation-pmywYpni.js} +3 -3
- package/dist/assets/{config-space-BVmSIh3O.js → config-space-Da0MmMPn.js} +1 -1
- package/dist/assets/{confirm-BAs5EAFg.js → confirm-BSaR4_fO.js} +1 -1
- package/dist/assets/{connect-BPVdZurv.js → connect-9m4Nmfes.js} +1 -1
- package/dist/assets/{connect-NnsibVv5.js → connect-BuRk8HoH.js} +1 -1
- package/dist/assets/{connect-to-D2kVCXUW.js → connect-to-DhIpK6hj.js} +1 -1
- package/dist/assets/{dashboard-CpCxXsDT.js → dashboard-DgmOVZgS.js} +3 -3
- package/dist/assets/{delete-confirm-ARBINDJj.js → delete-confirm-BR2z4Ljn.js} +1 -1
- package/dist/assets/{domain-B6x4146t.js → domain-CkwVqsGZ.js} +1 -1
- package/dist/assets/{domain-action-card-CVS3TpUQ.js → domain-action-card-DmX4ipuD.js} +1 -1
- package/dist/assets/{domains-BfVUABUm.js → domains-IK6JBOMk.js} +1 -1
- package/dist/assets/{email-o5PQki4m.js → email-C7dt-OoA.js} +1 -1
- package/dist/assets/engine-B4t4bO94.js +1 -0
- package/dist/assets/{exchange-passport-BIcDPCdx.js → exchange-passport-BlpeYXD-.js} +1 -1
- package/dist/assets/{form-DeTq6JLt.js → form-BoRGzdQH.js} +1 -1
- package/dist/assets/{fuel-CYXB7lNo.js → fuel-DPqYXNcT.js} +1 -1
- package/dist/assets/{gen-access-key-CK6ABJ7d.js → gen-access-key-DTf8XM_B.js} +1 -1
- package/dist/assets/{gen-simple-access-key-DSfDrkH_.js → gen-simple-access-key-BHpsJW1z.js} +1 -1
- package/dist/assets/{get-safe-url-C_gWJx9x.js → get-safe-url-C5Vpma4S.js} +1 -1
- package/dist/assets/{hdkey-CRIeweuD.js → hdkey-iF7Zd5Mt.js} +1 -1
- package/dist/assets/{home-keIz_0pz.js → home-Bq8Kaby6.js} +1 -1
- package/dist/assets/{iframe-7-UjiotN.js → iframe-BZdurKlN.js} +1 -1
- package/dist/assets/{index-DwFmgPTz.js → index-0r-rUxmD.js} +1 -1
- package/dist/assets/{index-CndEvJBJ.js → index-6k6hDX7K.js} +4 -4
- package/dist/assets/{index-DX_0Aq5L.js → index-BE6_aQqm.js} +1 -1
- package/dist/assets/{index-x_ddpRFT.js → index-BJftyOWK.js} +1 -1
- package/dist/assets/{index-74AbVj6G.js → index-BTbAsTsB.js} +1 -1
- package/dist/assets/{index-DWKcHcSX.js → index-BcOGe7jx.js} +1 -1
- package/dist/assets/{index-IfDPTJfj.js → index-BioPPNyR.js} +1 -1
- package/dist/assets/{index-2WK89lpX.js → index-BxgIheOv.js} +1 -1
- package/dist/assets/{index-C9c1djN6.js → index-C7WNgxRc.js} +1 -1
- package/dist/assets/{index-IbUh2bsl.js → index-C91ORskB.js} +1 -1
- package/dist/assets/{index-EyN3xjNK.js → index-CvK2LB0C.js} +3 -3
- package/dist/assets/{index-8j3VjBVi.js → index-Cw5ltvNg.js} +1 -1
- package/dist/assets/{index-BOhhZADu.js → index-D0zr5fnU.js} +4 -4
- package/dist/assets/{index-ClW80nSf.js → index-DGBu1iXZ.js} +1 -1
- package/dist/assets/{index-6ZWzS1uw.js → index-DIzco3bK.js} +1 -1
- package/dist/assets/{index-B0NAcL5r.js → index-DVNnjX93.js} +1 -1
- package/dist/assets/{index-DxR3NtV9.js → index-DlbJhxX4.js} +1 -1
- package/dist/assets/{index-DCk5kGsh.js → index-DtDqVnOd.js} +1 -1
- package/dist/assets/{index-BNPLpp0r.js → index-DzHxtRuX.js} +1 -1
- package/dist/assets/{index-B65XBOLV.js → index-VRhIKoNb.js} +1 -1
- package/dist/assets/{index-CsmgTpTJ.js → index-ZScchkNG.js} +1 -1
- package/dist/assets/{index-BMBJylNT.js → index-klWBrV7H.js} +1 -1
- package/dist/assets/{index-CjxZFYCF.js → index-ptPisY0K.js} +1 -1
- package/dist/assets/{invitation-BY2PtFvw.js → invitation-BbSlWYAY.js} +1 -1
- package/dist/assets/{invite-Cr9pbzvJ.js → invite-DKkAcNxp.js} +1 -1
- package/dist/assets/{isURL-CfmrW_0C.js → isURL-BOLVWN6q.js} +1 -1
- package/dist/assets/{issue-passport-D97rQRNT.js → issue-passport-kvrsHOXO.js} +1 -1
- package/dist/assets/{item-C1_2OTms.js → item-CRpPGQS5.js} +1 -1
- package/dist/assets/{landing-page-BoP0vrKb.js → landing-page-Bb2t2ubc.js} +1 -1
- package/dist/assets/{layout-BakYeqaY.js → layout-O4FRf5d2.js} +1 -1
- package/dist/assets/{list-DTe8sKwq.js → list-BeJAd6oJ.js} +3 -3
- package/dist/assets/{list-Bfj_fOi0.js → list-BmwWshfg.js} +1 -1
- package/dist/assets/{localization-DcpcwZBX.js → localization-EdFO66I_.js} +1 -1
- package/dist/assets/{log-BLHTF_kk.js → log-DwbFr2nR.js} +1 -1
- package/dist/assets/{login-PJHIZpiF.js → login-D2_PE9lX.js} +1 -1
- package/dist/assets/{login-oauth-callback-BjziPtPn.js → login-oauth-callback-BQNBl6bZ.js} +1 -1
- package/dist/assets/{logo-uploader-DNn2MCLm.js → logo-uploader-vRfbxowv.js} +2 -2
- package/dist/assets/{lost-passport-ChRfu4fx.js → lost-passport-pY1dhWDO.js} +1 -1
- package/dist/assets/{open-window-BRoSM1sQ.js → open-window-C0eYx4_v.js} +1 -1
- package/dist/assets/{over-due-invoice-payment-nX6ANuRm.js → over-due-invoice-payment-OBj9thMb.js} +1 -1
- package/dist/assets/{overview-CLlEtBem.js → overview-Rpt1OYCM.js} +1 -1
- package/dist/assets/{passport-item-BbcSxETN.js → passport-item-Bq1c8VJl.js} +1 -1
- package/dist/assets/{permission-D4s1M96M.js → permission-Doi0-9cF.js} +1 -1
- package/dist/assets/{preferences-B-KNknmh.js → preferences-zYe_BxLJ.js} +1 -1
- package/dist/assets/{profile-embed-0Ro9kKTX.js → profile-embed-BqOWDoBR.js} +1 -1
- package/dist/assets/{publish-resource-1jZoHwxW.js → publish-resource-CnXtK3LB.js} +1 -1
- package/dist/assets/{runtime-DiVv_EHB.js → runtime-DjdnpZoh.js} +1 -1
- package/dist/assets/sdk-ChXfsb2q.js +1 -0
- package/dist/assets/{security-Cmd-bjYK.js → security-Bdj-FYH4.js} +1 -1
- package/dist/assets/{session-BrZcMmG5.js → session-D-9YOhAy.js} +1 -1
- package/dist/assets/{setup-BVolXtjE.js → setup-CYAJarl4.js} +1 -1
- package/dist/assets/{spaces-CHljP8tP.js → spaces-Cq_dfNLt.js} +1 -1
- package/dist/assets/{start-CYrTYI-f.js → start-EO_1F43S.js} +1 -1
- package/dist/assets/{status--5cDGjcC.js → status-DJWbsb5u.js} +1 -1
- package/dist/assets/{step-actions-CqrWvcHB.js → step-actions-C91dncKW.js} +1 -1
- package/dist/assets/{studio-BsPkV54q.js → studio-B3QjabKr.js} +1 -1
- package/dist/assets/{team-DSjEanO-.js → team-RDmDo4cZ.js} +1 -1
- package/dist/assets/{traffic-mRcZHvLN.js → traffic-BUIhb2HS.js} +1 -1
- package/dist/assets/{transfer-CuD5trOJ.js → transfer-Dfbnhl7y.js} +1 -1
- package/dist/assets/{unsubscribe-yhkp0l4C.js → unsubscribe-Xjc5jAJO.js} +1 -1
- package/dist/assets/{use-app-logo-BZU1I0dB.js → use-app-logo-DesKuFha.js} +1 -1
- package/dist/assets/{user-center-5ESBGQA5.js → user-center-DdBnHKdX.js} +3 -3
- package/dist/assets/{user-follower-B6mKehgT.js → user-follower-DuL1BMYz.js} +1 -1
- package/dist/assets/{user-sessions-DN6scq-_.js → user-sessions-SImh8rHV.js} +1 -1
- package/dist/assets/{util-HCACAM-i.js → util-BlUZ4Q2D.js} +1 -1
- package/dist/assets/{util-BXcTwFDD.js → util-CHZLxs1T.js} +1 -1
- package/dist/assets/{wait-connect-CbVia-91.js → wait-connect-zz_yxj4x.js} +1 -1
- package/dist/assets/{wizard-B_NDaiA9.js → wizard-CRrvtL2U.js} +1 -1
- package/dist/assets/{wizard-components-DsmO8JXs.js → wizard-components-CR8h5HCI.js} +2 -2
- package/dist/assets/{wrap-locale-CScOhszz.js → wrap-locale-BraEpa0W.js} +1 -1
- package/dist/assets/{zh-C2gGkXmP.js → zh-DQDxmpdl.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/service-worker.js +1 -1
- package/package.json +24 -24
- package/dist/assets/engine-Coh-wnMb.js +0 -1
- package/dist/assets/sdk-DqccdvPq.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,ak as u,D as C,P as y}from"./vendor-mui-core-CmD-NPnl.js";import{r as c}from"./vendor-react-Dvs43sk9.js";import{aP as j,aQ as w,aR as b,aS as P,aT as A}from"./index-
|
|
1
|
+
import{j as e,ak as u,D as C,P as y}from"./vendor-mui-core-CmD-NPnl.js";import{r as c}from"./vendor-react-Dvs43sk9.js";import{aP as j,aQ as w,aR as b,aS as P,aT as A}from"./index-6k6hDX7K.js";import{C as m,$ as D}from"./vendor-ux-ESjuHpb6.js";var t=(r=>(r.AvatarOnly="AvatarOnly",r.Detailed="Detailed",r))(t||{}),h=(r=>(r.Minimal="Minimal",r.Basic="Basic",r))(h||{});function R(r){const{user:a,infoType:i,avatarSize:s=48,shouldShowHoverCard:n=!1,renderCardContent:o,...p}=r;return e.jsx(j,{user:a,avatarSize:s,shouldShowHoverCard:n,renderCardContent:o,...p})}function T({...r}){const{user:a,avatarSize:i=40,renderCustomContent:s,infoType:n=h.Minimal,renderFields:o,popupRenderFields:p,...l}=r;return e.jsxs(u,{sx:{display:"flex",flexDirection:"column",width:"100%",flex:1,height:"100%"},children:[e.jsx(w,{user:a,avatarSize:i,...l}),n===h.Basic&&e.jsx(b,{user:a,renderFields:o}),e.jsx(u,{className:"user-card__footer",children:s&&e.jsx(u,{sx:{mt:1.5},children:s()})})]})}function v({...r}){return e.jsx(T,{...r})}function z({children:r,sx:a={}}){const i=C();return e.jsx(u,{sx:m({p:2,backgroundColor:i.palette.background.paper,border:"1px solid",borderColor:"divider",borderRadius:1,maxWidth:500,minWidth:320,display:"flex"},a||null),children:r})}function F({children:r,cardType:a=t.Detailed,variant:i="box",containerRef:s=void 0,sx:n={}}){const o={minWidth:320,p:2,borderRadius:1,...a===t.Detailed?{border:"1px solid",borderColor:"divider"}:{}};return i==="paper"?e.jsx(y,{ref:s,elevation:0,sx:o,children:r}):e.jsx(u,{ref:s,sx:m(o,{display:"flex",alignItems:a===t.AvatarOnly?"center":"flex-start",gap:2},n||null),children:r})}function O(r){const{cardType:a=t.Detailed,showHoverCard:i}=r,s=i!==void 0?i:a===t.AvatarOnly,n=c.useRef(null),[o,p]=c.useState(()=>r.user||null);c.useEffect(()=>{let d=!0;return r.user?p(r.user):r.did&&P(r.did)&&!r.user&&A(r.did).then(x=>{d&&p(x||{fullName:"Anonymous",did:r.did,avatar:""})}),()=>{d=!1}},[r.did,r.user]);const l=c.useMemo(()=>{if(!o)return null;const{avatar:d="",...x}=o;if(d){const S=d.split("?")[1]||"";return{...x,avatar:S?d:`${d}?imageFilter=resize&w=48&h=48`}}return o},[o]);if(!l)return e.jsx(D,{did:r.did,size:r.avatarSize,useProxyFallback:!0,...r.avatarProps});const f=()=>e.jsx(z,{sx:r.popupSx,children:e.jsx(v,{...r,shouldShowHoverCard:!1,user:l,avatarProps:r.popupAvatarProps,shortenLabelProps:r.popupShortenLabelProps||r.shortenLabelProps,renderFields:r.popupRenderFields,renderName:r.popupRenderName,infoType:r.popupInfoType||r.infoType,didProps:r.popupDidProps||r.didProps,showDid:r.popupShowDid||r.showDid,showSocialActions:r.popupShowSocialActions===void 0?r.showSocialActions:r.popupShowSocialActions})});return a===t.AvatarOnly?e.jsx(R,{...r,shouldShowHoverCard:s,renderCardContent:f,user:l}):e.jsx(F,{containerRef:n,cardType:a,sx:r.sx,children:e.jsx(v,{...r,shouldShowHoverCard:s,renderCardContent:f,user:l})})}export{O as B,t as l,h as o};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as y,t as fr,g as hr,e as gr}from"./vendor-react-Dvs43sk9.js";import{j as e,ak as O,y as Me,x as _e,bb as We,M as Ce,T as X,z as pe,bC as Ze,aX as ie,a6 as ae,W as b,at as z,aj as xr,aI as yr,D as vr,cf as je,bp as br,b6 as Pt,bq as Cr,am as fe,bZ as dt,P as jr,Q as It,bW as Sr,ds as wr,ch as kr,aO as Pr,aP as Ir,dt as Tr,I as Er,dn as Ar,bL as Dr,du as Rr,a5 as Lr}from"./vendor-mui-core-CmD-NPnl.js";import{B as qe,e as $e,K as Or,ad as Nr,n as ut,C as Ur,a as Fr}from"./vendor-utils-DQK0pEML.js";import{T as Z,$ as Br,J as Mr,H as Y,F as re,D as $,G as ge,O as Tt,ab as _r,L as Wr,a6 as ze,ac as Et,ai as qr}from"./vendor-ux-ESjuHpb6.js";import{bd as Qe,aA as At,av as $r,aB as zr,bS as Hr,bT as Kr,Z as K,bU as Se,p as he,ap as He,W as Vr,v as Zr,aM as Qr,B as ne,bV as Yr,bW as Gr,a8 as Dt,c as te,b9 as Xr,a5 as Jr,X as se,bX as Rt,ar as es,aZ as Lt,bY as ts}from"./index-CndEvJBJ.js";import{B as Ot,o as rs,l as Nt}from"./index-DX_0Aq5L.js";import{x as ss,b as Ye,g as ke,c as ns,h as os,a as is}from"./vendor-hooks-DLNZ8kxG.js";import{C as Ut,P as as}from"./user-sessions-DN6scq-_.js";import{r as ls}from"./hdkey-CRIeweuD.js";import{W as Ft}from"./dashboard-CpCxXsDT.js";import{W as Ge}from"./did-address-D6qV21Cc.js";import{u as Q}from"./team-DSjEanO-.js";import{u as le}from"./session-BrZcMmG5.js";import{P as J}from"./permission-D4s1M96M.js";import{C as Pe}from"./click-to-copy-BWrdBff2.js";import{T as Bt}from"./index-DxR3NtV9.js";import{f as ee}from"./index-DBs9Ljax.js";import{u as cs}from"./useAsync-DZevTxbv.js";import{v as H}from"./index-1BANSka2.js";import{C as xe}from"./confirm-BAs5EAFg.js";import{N as ds}from"./index-B65XBOLV.js";import{i as Mt,a as we,p as _t}from"./util-BXcTwFDD.js";import{b as us}from"./sdk-DqccdvPq.js";import{U as ms}from"./user-follower-B6mKehgT.js";import{A as ps}from"./actions-CL4xTGOh.js";import{S as fs}from"./shorten-label-Cbu8wo9m.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-C-xQV6LY.js";import"./useLocalStorage-vyIYLydJ.js";import"./get-safe-url-C_gWJx9x.js";import"./useAsyncRetry-6TjWJyO6.js";import"./useAsync-CNAYLnLm.js";import"./useSetState-DFuQZPPV.js";import"./index-2WK89lpX.js";import"./over-due-invoice-payment-nX6ANuRm.js";import"./use-mobile-CQ7Tw4aD.js";import"./isURL-CfmrW_0C.js";import"./use-app-logo-BZU1I0dB.js";import"./arrow-down.svg-C3DZxwUV.js";import"./vendor-mui-x--K2rEM1j.js";import"./AdapterDayjs-CRMDLq6K.js";import"./base32-Ccz4U5Ob.js";import"./use-mobile-D93Bk2Ru.js";const Wt=t=>y.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",...t},y.createElement("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"}),y.createElement("rect",{x:12.5,y:9.375,width:7.5,height:1.875,rx:.9375}),y.createElement("rect",{x:15.3125,y:14.0625,width:7.5,height:1.875,rx:.9375,transform:"rotate(-90 15.3125 14.0625)"})),qt=t=>y.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",...t},y.createElement("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"}),y.createElement("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"}),y.createElement("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"}),y.createElement("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"})),$t=t=>y.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",...t},y.createElement("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"}),y.createElement("rect",{x:12.5,y:9.375,width:7.5,height:1.875,rx:.9375})),hs=t=>y.createElement("svg",{width:18,height:19,viewBox:"0 0 18 19",xmlns:"http://www.w3.org/2000/svg",...t},y.createElement("g",{clipPath:"url(#clip0)"},y.createElement("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"})),y.createElement("defs",null,y.createElement("clipPath",{id:"clip0"},y.createElement("rect",{width:18,height:18,transform:"translate(0 0.5)"}))));var Ee={},Ae,mt;function gs(){return mt||(mt=1,Ae=t=>encodeURIComponent(t).replace(/[!'()*]/g,m=>`%${m.charCodeAt(0).toString(16).toUpperCase()}`)),Ae}var De,pt;function xs(){if(pt)return De;pt=1;var t="%[a-f0-9]{2}",m=new RegExp("("+t+")|([^%]+?)","gi"),p=new RegExp("("+t+")+","gi");function v(a,i){try{return[decodeURIComponent(a.join(""))]}catch{}if(a.length===1)return a;i=i||1;var o=a.slice(0,i),h=a.slice(i);return Array.prototype.concat.call([],v(o),v(h))}function C(a){try{return decodeURIComponent(a)}catch{for(var i=a.match(m)||[],o=1;o<i.length;o++)a=v(i,o).join(""),i=a.match(m)||[];return a}}function x(a){for(var i={"%FE%FF":"��","%FF%FE":"��"},o=p.exec(a);o;){try{i[o[0]]=decodeURIComponent(o[0])}catch{var h=C(o[0]);h!==o[0]&&(i[o[0]]=h)}o=p.exec(a)}i["%C2"]="�";for(var n=Object.keys(i),S=0;S<n.length;S++){var P=n[S];a=a.replace(new RegExp(P,"g"),i[P])}return a}return De=function(a){if(typeof a!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof a+"`");try{return a=a.replace(/\+/g," "),decodeURIComponent(a)}catch{return x(a)}},De}var Re,ft;function ys(){return ft||(ft=1,Re=(t,m)=>{if(!(typeof t=="string"&&typeof m=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(m==="")return[t];const p=t.indexOf(m);return p===-1?[t]:[t.slice(0,p),t.slice(p+m.length)]}),Re}var Le,ht;function vs(){return ht||(ht=1,Le=function(t,m){for(var p={},v=Object.keys(t),C=Array.isArray(m),x=0;x<v.length;x++){var a=v[x],i=t[a];(C?m.indexOf(a)!==-1:m(a,i,t))&&(p[a]=i)}return p}),Le}var gt;function bs(){return gt||(gt=1,function(t){const m=gs(),p=xs(),v=ys(),C=vs(),x=r=>r==null;function a(r){switch(r.arrayFormat){case"index":return s=>(d,l)=>{const u=d.length;return l===void 0||r.skipNull&&l===null||r.skipEmptyString&&l===""?d:l===null?[...d,[h(s,r),"[",u,"]"].join("")]:[...d,[h(s,r),"[",h(u,r),"]=",h(l,r)].join("")]};case"bracket":return s=>(d,l)=>l===void 0||r.skipNull&&l===null||r.skipEmptyString&&l===""?d:l===null?[...d,[h(s,r),"[]"].join("")]:[...d,[h(s,r),"[]=",h(l,r)].join("")];case"comma":case"separator":return s=>(d,l)=>l==null||l.length===0?d:d.length===0?[[h(s,r),"=",h(l,r)].join("")]:[[d,h(l,r)].join(r.arrayFormatSeparator)];default:return s=>(d,l)=>l===void 0||r.skipNull&&l===null||r.skipEmptyString&&l===""?d:l===null?[...d,h(s,r)]:[...d,[h(s,r),"=",h(l,r)].join("")]}}function i(r){let s;switch(r.arrayFormat){case"index":return(d,l,u)=>{if(s=/\[(\d*)\]$/.exec(d),d=d.replace(/\[\d*\]$/,""),!s){u[d]=l;return}u[d]===void 0&&(u[d]={}),u[d][s[1]]=l};case"bracket":return(d,l,u)=>{if(s=/(\[\])$/.exec(d),d=d.replace(/\[\]$/,""),!s){u[d]=l;return}if(u[d]===void 0){u[d]=[l];return}u[d]=[].concat(u[d],l)};case"comma":case"separator":return(d,l,u)=>{const T=typeof l=="string"&&l.includes(r.arrayFormatSeparator),w=typeof l=="string"&&!T&&n(l,r).includes(r.arrayFormatSeparator);l=w?n(l,r):l;const R=T||w?l.split(r.arrayFormatSeparator).map(M=>n(M,r)):l===null?l:n(l,r);u[d]=R};default:return(d,l,u)=>{if(u[d]===void 0){u[d]=l;return}u[d]=[].concat(u[d],l)}}}function o(r){if(typeof r!="string"||r.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function h(r,s){return s.encode?s.strict?m(r):encodeURIComponent(r):r}function n(r,s){return s.decode?p(r):r}function S(r){return Array.isArray(r)?r.sort():typeof r=="object"?S(Object.keys(r)).sort((s,d)=>Number(s)-Number(d)).map(s=>r[s]):r}function P(r){const s=r.indexOf("#");return s!==-1&&(r=r.slice(0,s)),r}function g(r){let s="";const d=r.indexOf("#");return d!==-1&&(s=r.slice(d)),s}function k(r){r=P(r);const s=r.indexOf("?");return s===-1?"":r.slice(s+1)}function c(r,s){return s.parseNumbers&&!Number.isNaN(Number(r))&&typeof r=="string"&&r.trim()!==""?r=Number(r):s.parseBooleans&&r!==null&&(r.toLowerCase()==="true"||r.toLowerCase()==="false")&&(r=r.toLowerCase()==="true"),r}function f(r,s){s=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},s),o(s.arrayFormatSeparator);const d=i(s),l=Object.create(null);if(typeof r!="string"||(r=r.trim().replace(/^[?#&]/,""),!r))return l;for(const u of r.split("&")){if(u==="")continue;let[T,w]=v(s.decode?u.replace(/\+/g," "):u,"=");w=w===void 0?null:["comma","separator"].includes(s.arrayFormat)?w:n(w,s),d(n(T,s),w,l)}for(const u of Object.keys(l)){const T=l[u];if(typeof T=="object"&&T!==null)for(const w of Object.keys(T))T[w]=c(T[w],s);else l[u]=c(T,s)}return s.sort===!1?l:(s.sort===!0?Object.keys(l).sort():Object.keys(l).sort(s.sort)).reduce((u,T)=>{const w=l[T];return w&&typeof w=="object"&&!Array.isArray(w)?u[T]=S(w):u[T]=w,u},Object.create(null))}t.extract=k,t.parse=f,t.stringify=(r,s)=>{if(!r)return"";s=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},s),o(s.arrayFormatSeparator);const d=w=>s.skipNull&&x(r[w])||s.skipEmptyString&&r[w]==="",l=a(s),u={};for(const w of Object.keys(r))d(w)||(u[w]=r[w]);const T=Object.keys(u);return s.sort!==!1&&T.sort(s.sort),T.map(w=>{const R=r[w];return R===void 0?"":R===null?h(w,s):Array.isArray(R)?R.reduce(l(w),[]).join("&"):h(w,s)+"="+h(R,s)}).filter(w=>w.length>0).join("&")},t.parseUrl=(r,s)=>{s=Object.assign({decode:!0},s);const[d,l]=v(r,"#");return Object.assign({url:d.split("?")[0]||"",query:f(k(r),s)},s&&s.parseFragmentIdentifier&&l?{fragmentIdentifier:n(l,s)}:{})},t.stringifyUrl=(r,s)=>{s=Object.assign({encode:!0,strict:!0},s);const d=P(r.url).split("?")[0]||"",l=t.extract(r.url),u=t.parse(l,{sort:!1}),T=Object.assign(u,r.query);let w=t.stringify(T,s);w&&(w=`?${w}`);let R=g(r.url);return r.fragmentIdentifier&&(R=`#${h(r.fragmentIdentifier,s)}`),`${d}${w}${R}`},t.pick=(r,s,d)=>{d=Object.assign({parseFragmentIdentifier:!0},d);const{url:l,query:u,fragmentIdentifier:T}=t.parseUrl(r,d);return t.stringifyUrl({url:l,query:C(u,s),fragmentIdentifier:T},d)},t.exclude=(r,s,d)=>{const l=Array.isArray(s)?u=>!s.includes(u):(u,T)=>!s(u,T);return t.pick(r,l,d)}}(Ee)),Ee}var Oe=bs();const de=fr,Cs={parseNumbers:!1,parseBooleans:!1},js={skipNull:!1,skipEmptyString:!1},Ss=(t,m)=>{var p,v;const{navigateMode:C="push",parseOptions:x,stringifyOptions:a}={},i=Object.assign(Object.assign({},Cs),x),o=Object.assign(Object.assign({},js),a),h=de.useLocation(),n=(p=de.useHistory)===null||p===void 0?void 0:p.call(de),S=(v=de.useNavigate)===null||v===void 0?void 0:v.call(de),P=ss(),g=y.useRef(typeof t=="function"?t():t||{}),k=y.useMemo(()=>Oe.parse(h.search,i),[h.search]),c=y.useMemo(()=>Object.assign(Object.assign({},g.current),k),[k]);return[c,Ye(r=>{const s=typeof r=="function"?r(c):r;P(),n&&n[C]({hash:h.hash,search:Oe.stringify(Object.assign(Object.assign({},k),s),o)||"?"},h.state),S&&S({hash:h.hash,search:Oe.stringify(Object.assign(Object.assign({},k),s),o)||"?"},{replace:C==="replace",state:h.state})})]};var Ne,xt;function ws(){if(xt)return Ne;xt=1;const t=ls(),m=Qe(),{fromSecretKey:p,WalletType:v}=At(),{isHexStrict:C,toHex:x,toBuffer:a,stripHexPrefix:i}=$r(),{types:o}=m;return Ne={fromAppDid:(n,S,P={role:o.RoleType.ROLE_ACCOUNT},g=0)=>{if(!S)throw new Error("Cannot get user wallet with empty root sk");const k=m.Hasher.SHA3.hash256(a(n)),c=i(k).slice(0,16),f=c.slice(0,8),r=c.slice(8,16),s=parseInt(+`0x${f}`,10)&2147483647,d=parseInt(+`0x${r}`,10)&2147483647,l=i(C(S)?S:x(S)),u=t.fromMasterSeed(qe.from(l,"hex")),T=`m/44'/260'/${s}'/${d}'/${g}`,w=u.derive(T),R=v(P),{pk:M=o.KeyType.ED25519}=R;let F;return M===o.KeyType.ED25519?F=m.Signer.Ed25519.genKeyPair("hex",w.privateKey).secretKey:F=x(w.privateKey),M===o.KeyType.ETHEREUM&&(F=F.slice(0,66)),p(F,R)}},Ne}var Ue,yt;function ks(){if(yt)return Ue;yt=1;const t=Qe(),m=At(),p=zr(),v=ws(),C={role:t.types.RoleType.ROLE_APPLICATION};return Ue=(a,i,o,h)=>{let n=o||C;const S=(0,p.isEthereumType)((0,p.DidType)(o));if(S?n=(0,m.WalletType)(o):n=(0,m.WalletType)(C),!(0,p.isValid)(a)){let P="";try{return S?P=a.slice(0,66):P=a,(0,m.fromSecretKey)(P,n)}catch(g){throw new Error(`Cannot get blocklet wallet with invalid blocklet did or custom sk: ${g.message}`)}}if(!i)throw new Error("Cannot get blocklet wallet with empty node sk");return(0,v.fromAppDid)(a,i,n,h||0)},Ue}var ue,vt;function Ps(){if(vt)return ue;vt=1;var t=ue&&ue.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};const m=t(Hr),p=Qe(),v=t(ks()),C=Kr();return ue=(a,i,{returnWallet:o=!0}={})=>{if(!a||typeof a!="object"||!Array.isArray(a.environments)||!(0,m.default)(a,"meta.did"))throw new Error("Blocklet state must be an object");const{environments:h,configs:n=[]}=a,S=[...n,...h],P=S.find(N=>N.key==="BLOCKLET_APP_DESCRIPTION"),g=S.find(N=>N.key==="BLOCKLET_PASSPORT_COLOR"),k=S.find(N=>N.key==="BLOCKLET_APP_URL"),c=S.find(N=>N.key==="BLOCKLET_APP_TENANT_MODE"),{did:f,version:r}=a.meta,s=(0,C.getDisplayName)(a),d=(0,m.default)(P,"value",a.meta.description),l=(0,m.default)(g,"value","auto"),u=(0,m.default)(k,"value",""),T=(0,m.default)(c,"value","");if(!o)return{did:f,version:r,name:s,description:d,passportColor:l,appUrl:u,secret:"",wallet:null,permanentWallet:null,tenantMode:T};const w=S.find(N=>N.key==="BLOCKLET_APP_SK"),R=S.find(N=>N.key==="BLOCKLET_APP_CHAIN_TYPE")||S.find(N=>N.key==="BLOCKLET_WALLET_TYPE"),M=S.find(N=>N.key==="BLOCKLET_APP_PSK");let F;R&&(R.value==="ethereum"||R.value==="eth")&&(F=R.value);let W=null,E=null;if(w&&w.value)W=(0,v.default)(w.value,void 0,F),M&&M.value&&M.value!==w.value&&(E=(0,v.default)(M.value,void 0,F));else{if(!i||typeof i!="string")throw new Error("Node secret key must be a string");R?W=(0,v.default)(a.meta.did,i,F):W=(0,v.default)(a.meta.did,i)}const D=a.settings?.session?.salt||"",U=p.Hasher.SHA3.hash256(qe.concat([W.secretKey,W.address,D].filter(Boolean).map(N=>qe.from(N))));return{did:f,version:r,name:s,description:d,passportColor:l,appUrl:u,secret:U,wallet:W,permanentWallet:E||W,tenantMode:T}},ue}var Is=Ps();const Ts=hr(Is);var Es={};function zt({teamDid:t,roles:m=[],apps:p=[],onCancel:v,onSuccess:C,onError:x=()=>{},endpoint:a=""}){const{api:i}=K(),{t:o,locale:h}=Z(),n=ke({loading:!1,error:null,activeStep:0,inviteInfo:null,role:"",remark:"",sourceAppPid:p.length>0?p[0].appPid:null,display:null,passportExpireTime:null,showPicker:!1}),S=async()=>{if(!n.role){n.error=o("team.member.error.passportEmpty");return}if(n.passportExpireTime&&He(n.passportExpireTime).isBefore(He())){n.error=o("team.passport.customExpireTimeIsInvalid");return}const f=n.remark.trim();n.error=null,n.loading=!0;try{let r=n.sourceAppPid??null;r===t&&(r=null);const s={teamDid:t,role:n.role,remark:f,sourceAppPid:r,passportExpireTime:n.passportExpireTime?n.passportExpireTime.toISOString():""};n.display&&(s.display={type:"url",content:n.display});const{inviteInfo:d}=await i.createMemberInvitation({input:s});n.inviteInfo=d,n.activeStep=1}catch(r){const s=ee(r);n.error=s,x(r)}finally{n.loading=!1}},P=m.find(f=>f.name===n.role),g=m.filter(f=>f.name!=="owner"),c=[{body:e.jsxs(O,{sx:{display:"flex",flexDirection:"column",gap:3},children:[p.length>1?e.jsxs(Me,{fullWidth:!0,children:[e.jsx(_e,{children:o("common.sourceApp")}),e.jsx(We,{value:n.sourceAppPid,onChange:f=>{n.error=null,n.sourceAppPid=f.target.value},fullWidth:!0,label:o("common.passport"),disabled:n.loading,children:p.map(f=>e.jsx(Ce,{value:f.appPid,children:e.jsxs(O,{sx:{display:"flex",justifyContent:"space-between",gap:2,width:"100%"},children:[e.jsxs(O,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(Br,{did:f.appPid,size:28}),f.appName]}),e.jsx(Mr,{did:f.appPid,compact:!0,responsive:!1})]})},f.appPid))})]}):null,e.jsxs(Me,{fullWidth:!0,variant:"outlined",children:[e.jsx(_e,{children:o("common.passport")}),e.jsx(We,{"data-cy":"invite-member-select-role",value:n.role,onChange:f=>{n.error=null,n.role=f.target.value},fullWidth:!0,label:o("common.passport"),disabled:n.loading,onKeyPress:f=>{f.key==="Enter"&&(f.preventDefault(),S())},children:g.map(f=>e.jsx(Ce,{value:f.name,"data-cy":`invite-member-select-option-${f.name}`,children:e.jsxs(O,{sx:{display:"flex",flexDirection:"column"},children:[e.jsx(X,{variant:"subtitle1",children:f.title||f.name}),e.jsx(X,{variant:"caption",sx:{opacity:.7},children:f.description})]})},f.name))})]}),P?.extra?.display==="custom"&&e.jsx(pe,{label:o("common.display"),type:"url",value:n.display,onChange:f=>{n.error=null,n.display=f.target.value},fullWidth:!0,variant:"outlined",margin:"normal"}),e.jsx(pe,{label:o("common.remark"),autoComplete:"off",variant:"outlined",fullWidth:!0,value:n.remark,onChange:f=>{n.error=null,n.remark=f.target.value},disabled:n.loading,"data-cy":"invite-member-input-remark"}),e.jsx(Bt,{value:n.passportExpireTime,onChange:f=>{n.error=null,n.passportExpireTime=f},showError:!1})]}),cancel:o("common.cancel"),confirm:o("team.member.inviteDialog.createInviteLink"),onCancel:v,onConfirm:S},{body:()=>{const f=Se({inviteId:n.inviteInfo?.inviteId,endpoint:a});return e.jsxs("div",{children:[e.jsx(O,{sx:{fontSize:16,fontWeight:"bold"},children:o("team.member.inviteDialog.createSuccessTip",{expireDate:he(n.inviteInfo?.expireDate,h)})}),e.jsx("div",{style:{marginTop:"40px"}}),e.jsx(Pe,{children:f})]})},confirm:o("common.copy"),onConfirm:()=>{const f=Se({inviteId:n.inviteInfo?.inviteId,endpoint:a});if(["1","true"].includes(Es.IS_E2E)){C();return}ns(f),Y.success(o("common.copied")),C()},cancel:o("common.cancel"),onCancel:v}][n.activeStep];return e.jsxs(re,{title:o("common.invite"),fullWidth:!0,open:!0,showCloseButton:!1,actions:e.jsxs(e.Fragment,{children:[c.cancel&&e.jsx($,{onClick:c.onCancel,color:"inherit",children:c.cancel}),e.jsxs($,{onClick:c.onConfirm,color:"primary",disabled:n.loading||!n.role,variant:"contained",autoFocus:!0,children:[n.loading&&e.jsx(ae,{size:16}),c.confirm]})]}),children:[e.jsx(Ze,{component:"div",children:typeof c.body=="function"?c.body():c.body}),!!n.error&&e.jsx(ie,{severity:"error",sx:{mt:2},children:n.error})]})}zt.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};function Ht({teamDid:t,onCancel:m,onSuccess:p,onError:v=()=>{},endpoint:C=""}){const{api:x,info:a}=K(),{api:i}=y.useContext(Vr),[o,h]=y.useState(!1),{t:n,locale:S}=Z(),[P,g]=y.useState(""),[k,c]=y.useState(!1),[f,r]=y.useState(0),[s,d]=y.useState(""),[l,u]=y.useState(""),T=!!$e(a,"ownerNft.did"),w=cs(async()=>{if(T){const{state:D}=await x.getDelegationState();return D}return{delegated:!0}});if(w.loading)return e.jsx(re,{title:n("team.transferNode.inviteDialog.title"),fullWidth:!0,open:!0,onClose:m,children:e.jsx("div",{style:{display:"flex",justifyContent:"center"},children:e.jsx(ae,{})})});if(w.error)return e.jsx(re,{title:n("team.transferNode.inviteDialog.title"),fullWidth:!0,open:!0,onClose:m,children:e.jsx(ie,{severity:"error",children:ee(w.error)})});const R=async()=>{g(null),h(!0);try{const{inviteInfo:D}=await x.createTransferInvitation({input:{teamDid:t,role:"owner",remark:l.trim()}});d(D),r(W.length-1)}catch(D){const U=ee(D);g(U),v(D)}finally{h(!1)}},M=()=>{c(!0),r(1)},F=()=>{c(!1),r(0)},W=[{body:e.jsxs(X,{component:"div",children:[e.jsxs(ie,{severity:"warning",children:[e.jsx(X,{children:n("team.transferNode.inviteDialog.tips.progress")}),e.jsx(X,{children:n("team.transferNode.inviteDialog.tips.newOwnerPermissions")})]}),e.jsx(ie,{severity:"warning",children:e.jsx(X,{children:n("team.transferNode.inviteDialog.tips.revoke")})}),e.jsx("div",{style:{marginTop:20,marginBottom:10}}),e.jsx(pe,{label:n("common.remark"),autoComplete:"off",variant:"outlined",fullWidth:!0,style:{marginBottom:8},value:l,onChange:D=>{g(null),u(D.target.value)},disabled:o,"data-cy":"transfer-node-input-remark"}),e.jsx("div",{style:{marginTop:20,marginBottom:10}})]}),cancel:n("common.cancel"),confirm:n("team.transferNode.inviteDialog.createInviteLink"),onCancel:m,onConfirm:T&&!$e(w,"value.delegated")?M:R},{body:()=>e.jsx(Zr,{action:"delegate-transfer-nft",open:k,locale:S,checkFn:i.get,onClose:F,onSuccess:R,checkTimeout:5*60*1e3,webWalletUrl:Qr(a),extraParams:{targetDID:a.did},messages:{title:n("team.transferNode.delegateDialog.title"),scan:n("team.transferNode.delegateDialog.scan"),confirm:n("team.transferNode.delegateDialog.confirm"),success:n("team.transferNode.delegateDialog.success")},popup:!0})},{body:()=>{const D=Se({inviteId:s.inviteId,endpoint:C});return e.jsxs("div",{children:[e.jsx(As,{children:n("team.transferNode.inviteDialog.createSuccessTip",{expireDate:he(s.expireDate,S)})}),e.jsx("div",{style:{marginTop:"40px"}}),e.jsx(Pe,{children:D})]})},confirm:n("common.confirm"),onConfirm:p}],E=W[f];return e.jsxs(re,{title:n("team.transferNode.inviteDialog.title"),fullWidth:!0,open:!0,showCloseButton:!1,actions:e.jsxs(e.Fragment,{children:[E.cancel&&e.jsx($,{onClick:E.onCancel,color:"inherit",children:E.cancel}),e.jsxs($,{onClick:E.onConfirm,color:"primary",disabled:o,variant:"contained",autoFocus:!0,children:[o&&e.jsx(ae,{size:16}),E.confirm]})]}),children:[e.jsx(Ze,{component:"div",children:typeof E.body=="function"?E.body():E.body}),!!P&&e.jsx(ie,{severity:"error",children:P})]})}Ht.propTypes={teamDid:b.string.isRequired,onCancel:b.func.isRequired,onSuccess:b.func.isRequired,onError:b.func,endpoint:b.string};const As=z.div`
|
|
1
|
+
import{r as y,t as fr,g as hr,e as gr}from"./vendor-react-Dvs43sk9.js";import{j as e,ak as O,y as Me,x as _e,bb as We,M as Ce,T as X,z as pe,bC as Ze,aX as ie,a6 as ae,W as b,at as z,aj as xr,aI as yr,D as vr,cf as je,bp as br,b6 as Pt,bq as Cr,am as fe,bZ as dt,P as jr,Q as It,bW as Sr,ds as wr,ch as kr,aO as Pr,aP as Ir,dt as Tr,I as Er,dn as Ar,bL as Dr,du as Rr,a5 as Lr}from"./vendor-mui-core-CmD-NPnl.js";import{B as qe,e as $e,K as Or,ad as Nr,n as ut,C as Ur,a as Fr}from"./vendor-utils-DQK0pEML.js";import{T as Z,$ as Br,J as Mr,H as Y,F as re,D as $,G as ge,O as Tt,ab as _r,L as Wr,a6 as ze,ac as Et,ai as qr}from"./vendor-ux-ESjuHpb6.js";import{bd as Qe,aA as At,av as $r,aB as zr,bS as Hr,bT as Kr,Z as K,bU as Se,p as he,ap as He,W as Vr,v as Zr,aM as Qr,B as ne,bV as Yr,bW as Gr,a8 as Dt,c as te,b9 as Xr,a5 as Jr,X as se,bX as Rt,ar as es,aZ as Lt,bY as ts}from"./index-6k6hDX7K.js";import{B as Ot,o as rs,l as Nt}from"./index-BE6_aQqm.js";import{x as ss,b as Ye,g as ke,c as ns,h as os,a as is}from"./vendor-hooks-DLNZ8kxG.js";import{C as Ut,P as as}from"./user-sessions-SImh8rHV.js";import{r as ls}from"./hdkey-iF7Zd5Mt.js";import{W as Ft}from"./dashboard-DgmOVZgS.js";import{W as Ge}from"./did-address-D6qV21Cc.js";import{u as Q}from"./team-RDmDo4cZ.js";import{u as le}from"./session-D-9YOhAy.js";import{P as J}from"./permission-Doi0-9cF.js";import{C as Pe}from"./click-to-copy-BWrdBff2.js";import{T as Bt}from"./index-DlbJhxX4.js";import{f as ee}from"./index-DBs9Ljax.js";import{u as cs}from"./useAsync-DZevTxbv.js";import{v as H}from"./index-1BANSka2.js";import{C as xe}from"./confirm-BSaR4_fO.js";import{N as ds}from"./index-VRhIKoNb.js";import{i as Mt,a as we,p as _t}from"./util-CHZLxs1T.js";import{b as us}from"./sdk-ChXfsb2q.js";import{U as ms}from"./user-follower-DuL1BMYz.js";import{A as ps}from"./actions-CL4xTGOh.js";import{S as fs}from"./shorten-label-Cbu8wo9m.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-C-xQV6LY.js";import"./useLocalStorage-vyIYLydJ.js";import"./get-safe-url-C5Vpma4S.js";import"./useAsyncRetry-6TjWJyO6.js";import"./useAsync-CNAYLnLm.js";import"./useSetState-DFuQZPPV.js";import"./index-BxgIheOv.js";import"./over-due-invoice-payment-OBj9thMb.js";import"./use-mobile-CQ7Tw4aD.js";import"./isURL-BOLVWN6q.js";import"./use-app-logo-DesKuFha.js";import"./arrow-down.svg-2NUXhc9M.js";import"./vendor-mui-x--K2rEM1j.js";import"./AdapterDayjs-CRMDLq6K.js";import"./base32-Bs5DmmgZ.js";import"./use-mobile-D93Bk2Ru.js";const Wt=t=>y.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",...t},y.createElement("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"}),y.createElement("rect",{x:12.5,y:9.375,width:7.5,height:1.875,rx:.9375}),y.createElement("rect",{x:15.3125,y:14.0625,width:7.5,height:1.875,rx:.9375,transform:"rotate(-90 15.3125 14.0625)"})),qt=t=>y.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",...t},y.createElement("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"}),y.createElement("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"}),y.createElement("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"}),y.createElement("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"})),$t=t=>y.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",...t},y.createElement("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"}),y.createElement("rect",{x:12.5,y:9.375,width:7.5,height:1.875,rx:.9375})),hs=t=>y.createElement("svg",{width:18,height:19,viewBox:"0 0 18 19",xmlns:"http://www.w3.org/2000/svg",...t},y.createElement("g",{clipPath:"url(#clip0)"},y.createElement("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"})),y.createElement("defs",null,y.createElement("clipPath",{id:"clip0"},y.createElement("rect",{width:18,height:18,transform:"translate(0 0.5)"}))));var Ee={},Ae,mt;function gs(){return mt||(mt=1,Ae=t=>encodeURIComponent(t).replace(/[!'()*]/g,m=>`%${m.charCodeAt(0).toString(16).toUpperCase()}`)),Ae}var De,pt;function xs(){if(pt)return De;pt=1;var t="%[a-f0-9]{2}",m=new RegExp("("+t+")|([^%]+?)","gi"),p=new RegExp("("+t+")+","gi");function v(a,i){try{return[decodeURIComponent(a.join(""))]}catch{}if(a.length===1)return a;i=i||1;var o=a.slice(0,i),h=a.slice(i);return Array.prototype.concat.call([],v(o),v(h))}function C(a){try{return decodeURIComponent(a)}catch{for(var i=a.match(m)||[],o=1;o<i.length;o++)a=v(i,o).join(""),i=a.match(m)||[];return a}}function x(a){for(var i={"%FE%FF":"��","%FF%FE":"��"},o=p.exec(a);o;){try{i[o[0]]=decodeURIComponent(o[0])}catch{var h=C(o[0]);h!==o[0]&&(i[o[0]]=h)}o=p.exec(a)}i["%C2"]="�";for(var n=Object.keys(i),S=0;S<n.length;S++){var P=n[S];a=a.replace(new RegExp(P,"g"),i[P])}return a}return De=function(a){if(typeof a!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof a+"`");try{return a=a.replace(/\+/g," "),decodeURIComponent(a)}catch{return x(a)}},De}var Re,ft;function ys(){return ft||(ft=1,Re=(t,m)=>{if(!(typeof t=="string"&&typeof m=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(m==="")return[t];const p=t.indexOf(m);return p===-1?[t]:[t.slice(0,p),t.slice(p+m.length)]}),Re}var Le,ht;function vs(){return ht||(ht=1,Le=function(t,m){for(var p={},v=Object.keys(t),C=Array.isArray(m),x=0;x<v.length;x++){var a=v[x],i=t[a];(C?m.indexOf(a)!==-1:m(a,i,t))&&(p[a]=i)}return p}),Le}var gt;function bs(){return gt||(gt=1,function(t){const m=gs(),p=xs(),v=ys(),C=vs(),x=r=>r==null;function a(r){switch(r.arrayFormat){case"index":return s=>(d,l)=>{const u=d.length;return l===void 0||r.skipNull&&l===null||r.skipEmptyString&&l===""?d:l===null?[...d,[h(s,r),"[",u,"]"].join("")]:[...d,[h(s,r),"[",h(u,r),"]=",h(l,r)].join("")]};case"bracket":return s=>(d,l)=>l===void 0||r.skipNull&&l===null||r.skipEmptyString&&l===""?d:l===null?[...d,[h(s,r),"[]"].join("")]:[...d,[h(s,r),"[]=",h(l,r)].join("")];case"comma":case"separator":return s=>(d,l)=>l==null||l.length===0?d:d.length===0?[[h(s,r),"=",h(l,r)].join("")]:[[d,h(l,r)].join(r.arrayFormatSeparator)];default:return s=>(d,l)=>l===void 0||r.skipNull&&l===null||r.skipEmptyString&&l===""?d:l===null?[...d,h(s,r)]:[...d,[h(s,r),"=",h(l,r)].join("")]}}function i(r){let s;switch(r.arrayFormat){case"index":return(d,l,u)=>{if(s=/\[(\d*)\]$/.exec(d),d=d.replace(/\[\d*\]$/,""),!s){u[d]=l;return}u[d]===void 0&&(u[d]={}),u[d][s[1]]=l};case"bracket":return(d,l,u)=>{if(s=/(\[\])$/.exec(d),d=d.replace(/\[\]$/,""),!s){u[d]=l;return}if(u[d]===void 0){u[d]=[l];return}u[d]=[].concat(u[d],l)};case"comma":case"separator":return(d,l,u)=>{const T=typeof l=="string"&&l.includes(r.arrayFormatSeparator),w=typeof l=="string"&&!T&&n(l,r).includes(r.arrayFormatSeparator);l=w?n(l,r):l;const R=T||w?l.split(r.arrayFormatSeparator).map(M=>n(M,r)):l===null?l:n(l,r);u[d]=R};default:return(d,l,u)=>{if(u[d]===void 0){u[d]=l;return}u[d]=[].concat(u[d],l)}}}function o(r){if(typeof r!="string"||r.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function h(r,s){return s.encode?s.strict?m(r):encodeURIComponent(r):r}function n(r,s){return s.decode?p(r):r}function S(r){return Array.isArray(r)?r.sort():typeof r=="object"?S(Object.keys(r)).sort((s,d)=>Number(s)-Number(d)).map(s=>r[s]):r}function P(r){const s=r.indexOf("#");return s!==-1&&(r=r.slice(0,s)),r}function g(r){let s="";const d=r.indexOf("#");return d!==-1&&(s=r.slice(d)),s}function k(r){r=P(r);const s=r.indexOf("?");return s===-1?"":r.slice(s+1)}function c(r,s){return s.parseNumbers&&!Number.isNaN(Number(r))&&typeof r=="string"&&r.trim()!==""?r=Number(r):s.parseBooleans&&r!==null&&(r.toLowerCase()==="true"||r.toLowerCase()==="false")&&(r=r.toLowerCase()==="true"),r}function f(r,s){s=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},s),o(s.arrayFormatSeparator);const d=i(s),l=Object.create(null);if(typeof r!="string"||(r=r.trim().replace(/^[?#&]/,""),!r))return l;for(const u of r.split("&")){if(u==="")continue;let[T,w]=v(s.decode?u.replace(/\+/g," "):u,"=");w=w===void 0?null:["comma","separator"].includes(s.arrayFormat)?w:n(w,s),d(n(T,s),w,l)}for(const u of Object.keys(l)){const T=l[u];if(typeof T=="object"&&T!==null)for(const w of Object.keys(T))T[w]=c(T[w],s);else l[u]=c(T,s)}return s.sort===!1?l:(s.sort===!0?Object.keys(l).sort():Object.keys(l).sort(s.sort)).reduce((u,T)=>{const w=l[T];return w&&typeof w=="object"&&!Array.isArray(w)?u[T]=S(w):u[T]=w,u},Object.create(null))}t.extract=k,t.parse=f,t.stringify=(r,s)=>{if(!r)return"";s=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},s),o(s.arrayFormatSeparator);const d=w=>s.skipNull&&x(r[w])||s.skipEmptyString&&r[w]==="",l=a(s),u={};for(const w of Object.keys(r))d(w)||(u[w]=r[w]);const T=Object.keys(u);return s.sort!==!1&&T.sort(s.sort),T.map(w=>{const R=r[w];return R===void 0?"":R===null?h(w,s):Array.isArray(R)?R.reduce(l(w),[]).join("&"):h(w,s)+"="+h(R,s)}).filter(w=>w.length>0).join("&")},t.parseUrl=(r,s)=>{s=Object.assign({decode:!0},s);const[d,l]=v(r,"#");return Object.assign({url:d.split("?")[0]||"",query:f(k(r),s)},s&&s.parseFragmentIdentifier&&l?{fragmentIdentifier:n(l,s)}:{})},t.stringifyUrl=(r,s)=>{s=Object.assign({encode:!0,strict:!0},s);const d=P(r.url).split("?")[0]||"",l=t.extract(r.url),u=t.parse(l,{sort:!1}),T=Object.assign(u,r.query);let w=t.stringify(T,s);w&&(w=`?${w}`);let R=g(r.url);return r.fragmentIdentifier&&(R=`#${h(r.fragmentIdentifier,s)}`),`${d}${w}${R}`},t.pick=(r,s,d)=>{d=Object.assign({parseFragmentIdentifier:!0},d);const{url:l,query:u,fragmentIdentifier:T}=t.parseUrl(r,d);return t.stringifyUrl({url:l,query:C(u,s),fragmentIdentifier:T},d)},t.exclude=(r,s,d)=>{const l=Array.isArray(s)?u=>!s.includes(u):(u,T)=>!s(u,T);return t.pick(r,l,d)}}(Ee)),Ee}var Oe=bs();const de=fr,Cs={parseNumbers:!1,parseBooleans:!1},js={skipNull:!1,skipEmptyString:!1},Ss=(t,m)=>{var p,v;const{navigateMode:C="push",parseOptions:x,stringifyOptions:a}={},i=Object.assign(Object.assign({},Cs),x),o=Object.assign(Object.assign({},js),a),h=de.useLocation(),n=(p=de.useHistory)===null||p===void 0?void 0:p.call(de),S=(v=de.useNavigate)===null||v===void 0?void 0:v.call(de),P=ss(),g=y.useRef(typeof t=="function"?t():t||{}),k=y.useMemo(()=>Oe.parse(h.search,i),[h.search]),c=y.useMemo(()=>Object.assign(Object.assign({},g.current),k),[k]);return[c,Ye(r=>{const s=typeof r=="function"?r(c):r;P(),n&&n[C]({hash:h.hash,search:Oe.stringify(Object.assign(Object.assign({},k),s),o)||"?"},h.state),S&&S({hash:h.hash,search:Oe.stringify(Object.assign(Object.assign({},k),s),o)||"?"},{replace:C==="replace",state:h.state})})]};var Ne,xt;function ws(){if(xt)return Ne;xt=1;const t=ls(),m=Qe(),{fromSecretKey:p,WalletType:v}=At(),{isHexStrict:C,toHex:x,toBuffer:a,stripHexPrefix:i}=$r(),{types:o}=m;return Ne={fromAppDid:(n,S,P={role:o.RoleType.ROLE_ACCOUNT},g=0)=>{if(!S)throw new Error("Cannot get user wallet with empty root sk");const k=m.Hasher.SHA3.hash256(a(n)),c=i(k).slice(0,16),f=c.slice(0,8),r=c.slice(8,16),s=parseInt(+`0x${f}`,10)&2147483647,d=parseInt(+`0x${r}`,10)&2147483647,l=i(C(S)?S:x(S)),u=t.fromMasterSeed(qe.from(l,"hex")),T=`m/44'/260'/${s}'/${d}'/${g}`,w=u.derive(T),R=v(P),{pk:M=o.KeyType.ED25519}=R;let F;return M===o.KeyType.ED25519?F=m.Signer.Ed25519.genKeyPair("hex",w.privateKey).secretKey:F=x(w.privateKey),M===o.KeyType.ETHEREUM&&(F=F.slice(0,66)),p(F,R)}},Ne}var Ue,yt;function ks(){if(yt)return Ue;yt=1;const t=Qe(),m=At(),p=zr(),v=ws(),C={role:t.types.RoleType.ROLE_APPLICATION};return Ue=(a,i,o,h)=>{let n=o||C;const S=(0,p.isEthereumType)((0,p.DidType)(o));if(S?n=(0,m.WalletType)(o):n=(0,m.WalletType)(C),!(0,p.isValid)(a)){let P="";try{return S?P=a.slice(0,66):P=a,(0,m.fromSecretKey)(P,n)}catch(g){throw new Error(`Cannot get blocklet wallet with invalid blocklet did or custom sk: ${g.message}`)}}if(!i)throw new Error("Cannot get blocklet wallet with empty node sk");return(0,v.fromAppDid)(a,i,n,h||0)},Ue}var ue,vt;function Ps(){if(vt)return ue;vt=1;var t=ue&&ue.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};const m=t(Hr),p=Qe(),v=t(ks()),C=Kr();return ue=(a,i,{returnWallet:o=!0}={})=>{if(!a||typeof a!="object"||!Array.isArray(a.environments)||!(0,m.default)(a,"meta.did"))throw new Error("Blocklet state must be an object");const{environments:h,configs:n=[]}=a,S=[...n,...h],P=S.find(N=>N.key==="BLOCKLET_APP_DESCRIPTION"),g=S.find(N=>N.key==="BLOCKLET_PASSPORT_COLOR"),k=S.find(N=>N.key==="BLOCKLET_APP_URL"),c=S.find(N=>N.key==="BLOCKLET_APP_TENANT_MODE"),{did:f,version:r}=a.meta,s=(0,C.getDisplayName)(a),d=(0,m.default)(P,"value",a.meta.description),l=(0,m.default)(g,"value","auto"),u=(0,m.default)(k,"value",""),T=(0,m.default)(c,"value","");if(!o)return{did:f,version:r,name:s,description:d,passportColor:l,appUrl:u,secret:"",wallet:null,permanentWallet:null,tenantMode:T};const w=S.find(N=>N.key==="BLOCKLET_APP_SK"),R=S.find(N=>N.key==="BLOCKLET_APP_CHAIN_TYPE")||S.find(N=>N.key==="BLOCKLET_WALLET_TYPE"),M=S.find(N=>N.key==="BLOCKLET_APP_PSK");let F;R&&(R.value==="ethereum"||R.value==="eth")&&(F=R.value);let W=null,E=null;if(w&&w.value)W=(0,v.default)(w.value,void 0,F),M&&M.value&&M.value!==w.value&&(E=(0,v.default)(M.value,void 0,F));else{if(!i||typeof i!="string")throw new Error("Node secret key must be a string");R?W=(0,v.default)(a.meta.did,i,F):W=(0,v.default)(a.meta.did,i)}const D=a.settings?.session?.salt||"",U=p.Hasher.SHA3.hash256(qe.concat([W.secretKey,W.address,D].filter(Boolean).map(N=>qe.from(N))));return{did:f,version:r,name:s,description:d,passportColor:l,appUrl:u,secret:U,wallet:W,permanentWallet:E||W,tenantMode:T}},ue}var Is=Ps();const Ts=hr(Is);var Es={};function zt({teamDid:t,roles:m=[],apps:p=[],onCancel:v,onSuccess:C,onError:x=()=>{},endpoint:a=""}){const{api:i}=K(),{t:o,locale:h}=Z(),n=ke({loading:!1,error:null,activeStep:0,inviteInfo:null,role:"",remark:"",sourceAppPid:p.length>0?p[0].appPid:null,display:null,passportExpireTime:null,showPicker:!1}),S=async()=>{if(!n.role){n.error=o("team.member.error.passportEmpty");return}if(n.passportExpireTime&&He(n.passportExpireTime).isBefore(He())){n.error=o("team.passport.customExpireTimeIsInvalid");return}const f=n.remark.trim();n.error=null,n.loading=!0;try{let r=n.sourceAppPid??null;r===t&&(r=null);const s={teamDid:t,role:n.role,remark:f,sourceAppPid:r,passportExpireTime:n.passportExpireTime?n.passportExpireTime.toISOString():""};n.display&&(s.display={type:"url",content:n.display});const{inviteInfo:d}=await i.createMemberInvitation({input:s});n.inviteInfo=d,n.activeStep=1}catch(r){const s=ee(r);n.error=s,x(r)}finally{n.loading=!1}},P=m.find(f=>f.name===n.role),g=m.filter(f=>f.name!=="owner"),c=[{body:e.jsxs(O,{sx:{display:"flex",flexDirection:"column",gap:3},children:[p.length>1?e.jsxs(Me,{fullWidth:!0,children:[e.jsx(_e,{children:o("common.sourceApp")}),e.jsx(We,{value:n.sourceAppPid,onChange:f=>{n.error=null,n.sourceAppPid=f.target.value},fullWidth:!0,label:o("common.passport"),disabled:n.loading,children:p.map(f=>e.jsx(Ce,{value:f.appPid,children:e.jsxs(O,{sx:{display:"flex",justifyContent:"space-between",gap:2,width:"100%"},children:[e.jsxs(O,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(Br,{did:f.appPid,size:28}),f.appName]}),e.jsx(Mr,{did:f.appPid,compact:!0,responsive:!1})]})},f.appPid))})]}):null,e.jsxs(Me,{fullWidth:!0,variant:"outlined",children:[e.jsx(_e,{children:o("common.passport")}),e.jsx(We,{"data-cy":"invite-member-select-role",value:n.role,onChange:f=>{n.error=null,n.role=f.target.value},fullWidth:!0,label:o("common.passport"),disabled:n.loading,onKeyPress:f=>{f.key==="Enter"&&(f.preventDefault(),S())},children:g.map(f=>e.jsx(Ce,{value:f.name,"data-cy":`invite-member-select-option-${f.name}`,children:e.jsxs(O,{sx:{display:"flex",flexDirection:"column"},children:[e.jsx(X,{variant:"subtitle1",children:f.title||f.name}),e.jsx(X,{variant:"caption",sx:{opacity:.7},children:f.description})]})},f.name))})]}),P?.extra?.display==="custom"&&e.jsx(pe,{label:o("common.display"),type:"url",value:n.display,onChange:f=>{n.error=null,n.display=f.target.value},fullWidth:!0,variant:"outlined",margin:"normal"}),e.jsx(pe,{label:o("common.remark"),autoComplete:"off",variant:"outlined",fullWidth:!0,value:n.remark,onChange:f=>{n.error=null,n.remark=f.target.value},disabled:n.loading,"data-cy":"invite-member-input-remark"}),e.jsx(Bt,{value:n.passportExpireTime,onChange:f=>{n.error=null,n.passportExpireTime=f},showError:!1})]}),cancel:o("common.cancel"),confirm:o("team.member.inviteDialog.createInviteLink"),onCancel:v,onConfirm:S},{body:()=>{const f=Se({inviteId:n.inviteInfo?.inviteId,endpoint:a});return e.jsxs("div",{children:[e.jsx(O,{sx:{fontSize:16,fontWeight:"bold"},children:o("team.member.inviteDialog.createSuccessTip",{expireDate:he(n.inviteInfo?.expireDate,h)})}),e.jsx("div",{style:{marginTop:"40px"}}),e.jsx(Pe,{children:f})]})},confirm:o("common.copy"),onConfirm:()=>{const f=Se({inviteId:n.inviteInfo?.inviteId,endpoint:a});if(["1","true"].includes(Es.IS_E2E)){C();return}ns(f),Y.success(o("common.copied")),C()},cancel:o("common.cancel"),onCancel:v}][n.activeStep];return e.jsxs(re,{title:o("common.invite"),fullWidth:!0,open:!0,showCloseButton:!1,actions:e.jsxs(e.Fragment,{children:[c.cancel&&e.jsx($,{onClick:c.onCancel,color:"inherit",children:c.cancel}),e.jsxs($,{onClick:c.onConfirm,color:"primary",disabled:n.loading||!n.role,variant:"contained",autoFocus:!0,children:[n.loading&&e.jsx(ae,{size:16}),c.confirm]})]}),children:[e.jsx(Ze,{component:"div",children:typeof c.body=="function"?c.body():c.body}),!!n.error&&e.jsx(ie,{severity:"error",sx:{mt:2},children:n.error})]})}zt.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};function Ht({teamDid:t,onCancel:m,onSuccess:p,onError:v=()=>{},endpoint:C=""}){const{api:x,info:a}=K(),{api:i}=y.useContext(Vr),[o,h]=y.useState(!1),{t:n,locale:S}=Z(),[P,g]=y.useState(""),[k,c]=y.useState(!1),[f,r]=y.useState(0),[s,d]=y.useState(""),[l,u]=y.useState(""),T=!!$e(a,"ownerNft.did"),w=cs(async()=>{if(T){const{state:D}=await x.getDelegationState();return D}return{delegated:!0}});if(w.loading)return e.jsx(re,{title:n("team.transferNode.inviteDialog.title"),fullWidth:!0,open:!0,onClose:m,children:e.jsx("div",{style:{display:"flex",justifyContent:"center"},children:e.jsx(ae,{})})});if(w.error)return e.jsx(re,{title:n("team.transferNode.inviteDialog.title"),fullWidth:!0,open:!0,onClose:m,children:e.jsx(ie,{severity:"error",children:ee(w.error)})});const R=async()=>{g(null),h(!0);try{const{inviteInfo:D}=await x.createTransferInvitation({input:{teamDid:t,role:"owner",remark:l.trim()}});d(D),r(W.length-1)}catch(D){const U=ee(D);g(U),v(D)}finally{h(!1)}},M=()=>{c(!0),r(1)},F=()=>{c(!1),r(0)},W=[{body:e.jsxs(X,{component:"div",children:[e.jsxs(ie,{severity:"warning",children:[e.jsx(X,{children:n("team.transferNode.inviteDialog.tips.progress")}),e.jsx(X,{children:n("team.transferNode.inviteDialog.tips.newOwnerPermissions")})]}),e.jsx(ie,{severity:"warning",children:e.jsx(X,{children:n("team.transferNode.inviteDialog.tips.revoke")})}),e.jsx("div",{style:{marginTop:20,marginBottom:10}}),e.jsx(pe,{label:n("common.remark"),autoComplete:"off",variant:"outlined",fullWidth:!0,style:{marginBottom:8},value:l,onChange:D=>{g(null),u(D.target.value)},disabled:o,"data-cy":"transfer-node-input-remark"}),e.jsx("div",{style:{marginTop:20,marginBottom:10}})]}),cancel:n("common.cancel"),confirm:n("team.transferNode.inviteDialog.createInviteLink"),onCancel:m,onConfirm:T&&!$e(w,"value.delegated")?M:R},{body:()=>e.jsx(Zr,{action:"delegate-transfer-nft",open:k,locale:S,checkFn:i.get,onClose:F,onSuccess:R,checkTimeout:5*60*1e3,webWalletUrl:Qr(a),extraParams:{targetDID:a.did},messages:{title:n("team.transferNode.delegateDialog.title"),scan:n("team.transferNode.delegateDialog.scan"),confirm:n("team.transferNode.delegateDialog.confirm"),success:n("team.transferNode.delegateDialog.success")},popup:!0})},{body:()=>{const D=Se({inviteId:s.inviteId,endpoint:C});return e.jsxs("div",{children:[e.jsx(As,{children:n("team.transferNode.inviteDialog.createSuccessTip",{expireDate:he(s.expireDate,S)})}),e.jsx("div",{style:{marginTop:"40px"}}),e.jsx(Pe,{children:D})]})},confirm:n("common.confirm"),onConfirm:p}],E=W[f];return e.jsxs(re,{title:n("team.transferNode.inviteDialog.title"),fullWidth:!0,open:!0,showCloseButton:!1,actions:e.jsxs(e.Fragment,{children:[E.cancel&&e.jsx($,{onClick:E.onCancel,color:"inherit",children:E.cancel}),e.jsxs($,{onClick:E.onConfirm,color:"primary",disabled:o,variant:"contained",autoFocus:!0,children:[o&&e.jsx(ae,{size:16}),E.confirm]})]}),children:[e.jsx(Ze,{component:"div",children:typeof E.body=="function"?E.body():E.body}),!!P&&e.jsx(ie,{severity:"error",children:P})]})}Ht.propTypes={teamDid:b.string.isRequired,onCancel:b.func.isRequired,onSuccess:b.func.isRequired,onError:b.func,endpoint:b.string};const As=z.div`
|
|
2
2
|
font-size: 16px;
|
|
3
3
|
font-weight: bold;
|
|
4
4
|
`;function Ke({passport:t,onDelete:m=null,...p}){return e.jsxs(Ds,{...p,children:[t.title||t.name," ",!!m&&e.jsx(xr,{"data-cy":"delete-issuance",className:"delete",onClick:m})]})}Ke.propTypes={passport:b.object.isRequired,onDelete:b.func};const Ds=z.span`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/lottie-react.esm-M5fKy3fg.js","assets/vendor-react-Dvs43sk9.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{j as B,ak as z,T as pe,z as gt,y as ht,bb as dt,M as Ct,Q as Me,at as ce,ar as lt,ch as xt,dp as Et,dq as Rt,I as yt,dr as mt,D as bt,c1 as le,aj as wt,a6 as vt}from"./vendor-mui-core-CmD-NPnl.js";import{r as oe,p as Ve,g as It}from"./vendor-react-Dvs43sk9.js";import{w as St,g as Ze,u as Lt,j as Bt,e as Tt,k as _t}from"./vendor-hooks-DLNZ8kxG.js";import{a8 as Ht,R as Ot,_ as he,ax as ct}from"./vendor-ux-ESjuHpb6.js";import{ac as Nt}from"./vendor-utils-DQK0pEML.js";import{mediaKitApi as Qt}from"./index-EyN3xjNK.js";import{r as De}from"./index-BPy8_fa2.js";import"./lottie-web-4koyQiv_.js";import"./index-CndEvJBJ.js";import"./vendor-arcblock-C-xQV6LY.js";import"./index-DRYJ0xIl.js";const ft=oe.createContext({}),pt=()=>oe.useContext(ft);function qt({children:h,restrictions:f,i18n:w,theme:R}){const[x,b]=St({loading:!1}),n=t=>b(a=>({...a,loading:t})),e=oe.useMemo(()=>({...x,onLoading:n,restrictions:f,i18n:w}),[x]);return B.jsx(Ht,{theme:R,children:B.jsx(ft.Provider,{value:e,children:h})})}const Wt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAAEsCAYAAAB5fY51AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAskSURBVHgB7d3RcdTIGoZhcSJYMoAMIAIgAiACIALIwBCBIQIgA4jAkAEZQAYmAx+6iqnjM+vxjD3qX/qk56niYm92wYve6W790ty5+GMACPCfASCEYAExBAuIIVhADMECYggWEEOwgBiCBcQQLCCGYAExBAuIIVhADMECYggWEEOwgBiCBcQQLCCGYAExBAuIIVhADMECYggWEEOwgBiCBcQQLCCGYAExBAuIIVhADMECYggWEEOwgBiCBcQQLCCGYAExBAuIIVhADMECYggWEEOwgBiCBcQQLCCGYAExBAuIIVhADMECYggWEEOwgBiCBcQQLCCGYAExBAuIIVhADMECYggWEEOwgBiCBcQQLCCGYAExBAuIIVhADMECYggWEEOwgBiCBcQQLCCGYAExBAuIIVhADMECYggWEEOwgBiCBcQQLCCGYAExBAuIIVhADMECYggWEEOwgBiCBcQQLCCGYAExBAuIIVhADMECYghWsG/fvg137twp+/X8+fOhh9+/f5f9GdrPjFyCFezz589DpXaxt7iM7Z9//hkeP348VPj69etALsEK9uXLl6FSi1WvSL5+/Xqo8OnTpy7RpYZghZrqwusVybbCaiut3trPzCorl2CFqt4ObrRt4Y8fP4axtVi9fPlyqNBiTybBCvTr169JD497rVCePn06VOh1Fkd/ghVo6i3N+/fvhx7atvDBgwdDhQ8fPgzkEaxAvYJxqLY66bXCe/bs2VDBtjCTYIVpoWhbwqn1WqFU3S2celvN7QhWmKkO27eZyWIKghWmevZqFzNZTEGwgsztAjOTRTXBCjKX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fOQSCNYOVXcHHzx4sKjZq10qZ7J6nQNV3fH0RtvdBOsK7S981eFn5XZpSu0MyEzWYcxk7SZYV6h879VaXt5WeXBtJmu5BOsKVZ9u7S//GraDG5WjG0uYyeLfBGtL+2Qze9VH5cH1EmaybAv/TbC2VH6yLXW6/TqVj+qYyVoewbqkcvaqPTe4xvcfVT6qYyZreQTrksol+NLezHCoykd1zGQtj2BdUnV3sB20r3E7uFEVLDNZyyNYf1XOXq39e+gqZ8/MZC2LYP1VOXu1truD2yof1TGTtSyC9VfVp9jS38xwKDNZhzOT9T+CNdTOXlWdfcxd5aM6ZrKWQ7CG2k+wtd4d3Fb9qI6ZrGVYfbCq33u1pkdx9qncFprJWobVB6tyqb32w/ZtlfNMZrKWYfXB8maGaVWd6ZnJWgZfVQ/EcOgOxBAsIIZgATEEC4ghWEAMwQJiCBYQQ7CAGIIFxBAsIIZgATEEC4ghWEAMwQJiCBYQQ7CAGIIFxBAsIIZgATEEC4ghWEAMwQJiCBYQQ7CAGIIFxBAsIIZgATEEC4ghWEAMwQJiCBYQQ7CAGIIFxBAsIIZgATEEC4ghWEAMwQJiCBYQQ7CAGIIFxBAsIIZgATEEC4ghWEAMwQJiCBYQQ7CAGIIFxBAsIIZgATEEC4ghWEAMwQJiCBYQQ7CAGIIFxBAsIIZgATEEC4ghWEAMwQJiCBYQQ7CAGIIFxBAsIIZgATEEC4ghWEAMwQJiCBYQQ7CAGIIFxBAsIIZgATEEC4ghWEAMwQJiCBYQQ7CAGIIFxBAsIIZgATEEC4ghWECM/wKc/Y0zpWLfuAAAAABJRU5ErkJggg==",Mt="/.well-known/service/static/assets/bedrock-yFRPpe__.png",Zt="/.well-known/service/static/assets/deepseek-C3x42pq3.png",Dt="/.well-known/service/static/assets/doubao-yPqHSkLx.png",Gt="/.well-known/service/static/assets/gemini-DffKpc81.png",jt="/.well-known/service/static/assets/google-DT1VSJ0m.png",Vt="/.well-known/service/static/assets/ideogram-REIjy0Er.png",kt="/.well-known/service/static/assets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AtIQLCANwQLSECwgDcEC0hAsIA3BAtIQLCANwQLSECwgDcEC0hAsIA3BAtIQLCANwQLSECwgDcEC0hAsIA3BAtIQLCANwQLSECwgDcEC0hAsIA3BAtIQLCANwQLSECwgDcEC0hAsIA3BAtIQLCANwQLSECwgDcEC0hAsIA3BAtIQLCANwQLSECwgDcEC0hAsIA3BAtIQLCANwQLSECwgDcEC0hAsIA3BAtIQLCANwQLSECwgDcEC0hAsIA3BAtIQLCANwQLSECwgDcEC0hAsIA3BAtIQLCANwQLSECwgDcEC0hAsIA3BAtIQLCANwQLSECwgDcEC0vgXkv5P8wQTb/sAAAAASUVORK5CYII=",Pt="/.well-known/service/static/assets/poe-B588TgZu.png",Ut="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAAEsCAYAAAB5fY51AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAA1dSURBVHgB7d3tbRXXFgbg8dX9T1wBoQPSQejAVBBTgXEFSSogqQBcgdMBdAAdkA6gg3O9kCwhX3POfO5Za+Z5JCdSZBIfO+f1Xnve2XN2uNMBFPCfDqAIgQWUIbCAMgQWUIbAAsoQWEAZAgsoQ2ABZQgsoAyBBZQhsIAyBBZQhsACyhBYQBkCCyhDYAFlCCygDIEFlCGwgDIEFlCGwALKEFhAGQILKENgAWUILKAMgQWUIbCAMgQWUIbAAsoQWEAZAgsoQ2ABZQgsoAyBBZQhsIAyBBZQhsACyhBYQBkCCyhDYAFlCCygDIEFlCGwgDIEFlCGwALKEFhAGQILKENgAWUILKAMgQWUIbCAMgQWUIbAAsoQWEAZAgsoQ2ABZQgsoAyBBZQhsIAyBBZQhsACyhBYQBkCCyhDYAFlCCygDIEFlCGw2J1///23e/bsWXd2drb6x6tXrzr6Ozvc6WBHXrx40X348KFb288//9y9f//+29/pxwqLXfnzzz9ThFV48+aNsBrICovduB8FM7i6uur++uuvjmEEFrsRYRWhtbZYVX3+/LljOCMhuxCjY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pClzR6roaWCUwueNQismVVrs4+1hxb8kvtYag3jCKwZxRsn0yi49JsiUws+vu9z7xnaeM9HYM0k0xOMozPVKjiztODvR0Mt+G0TWDPJMgq2bqVnasH3OVGV2gTWDDK12aON3nrFowVPKwJrokz3ts3RZh9riy14e1j5CKyJ4s2R5cbmtQudmVrwc/wSWfK1eFDrOAJrgnhTZBk/1hgFH8rUgo/RMM4gy8rqbRyBNVKmNvvV1VWq5nmWryXL6pf5CKyRMrXZs5xkei/LaKgFvz0Ca4S9tNnHylR1mNKC10bPR2ANtLc2+1jZWvBGw20QWAPstc0+VqYWfJxNRn0Ca4C9ttnHynSDdLTgs5z+GlwlHOfscKcDKMAKCyhDYAFlCCygDIEFlCGwgDIEFlCGwALKEFhAGQILKENgAWUILKAMgQWUIbCAMgQWUIbAAsoQWEAZAgsoQ2ABZQgsoAyBBZQhsIAyBBZQhsACyhBYQBkCCyhDYAFlCCygDIEFlCGwgDIEFlCGwALKEFhAGQILKENgAWUILKAMgQWUIbCAMgQWUIbAAsoQWEAZAgsoQ2ABZQgsoAyBBZQhsIAyBBZQhsACyhBYQBkCCyhDYAFlCCygDIEFlCGwgDIEFlCGwALKEFhAGQILKENgAWUILKAMgQWUIbCAMgQWUIbAAsoQWEAZAgsoQ2ABZQgsoIz/AWP7oZ6cDDZCAAAAAElFTkSuQmCC",ge={anthropic:Wt,bedrock:Mt,deepseek:Zt,doubao:Dt,gemini:Gt,google:jt,ideogram:Vt,ollama:kt,openai:Ft,openrouter:Yt,poe:Pt,xai:Ut},ke={width:16,height:16,borderRadius:"2px",objectFit:"contain",backgroundColor:"transparent"};function Kt({onSubmit:h,models:f}){const{loading:w,i18n:R}=pt(),x=Ze({model:"",prompt:"",number:1}),b=()=>{const t=JSON.parse(JSON.stringify(x));Object.values(x).every(E=>!!E)&&h(t)},{run:n}=Lt(b,{wait:500}),e=oe.useMemo(()=>{const t=JSON.parse(JSON.stringify(x));return Object.values(t).some(a=>!a)},[JSON.stringify(x)]);return B.jsxs(zt,{onSubmit:t=>t.preventDefault(),children:[B.jsxs(z,{sx:{flex:1,height:"100%",overflow:"hidden",flexDirection:"column",display:"flex",mt:2,gap:2},children:[B.jsxs(z,{sx:{mx:2,display:"flex",flexDirection:"column",gap:1},children:[B.jsx(pe,{gutterBottom:!0,className:"title label",sx:{color:"text.primary"},children:R("aiImagePrompt")}),B.jsx(gt,{sx:{width:1},size:"small",type:"text",required:!0,placeholder:R("aiImagePromptTip"),multiline:!0,minRows:5,maxRows:6,value:x.prompt??"",onChange:t=>{t.stopPropagation(),x.prompt=t.target.value},slotProps:{htmlInput:{maxLength:1e3}}})]}),B.jsxs(z,{sx:{px:2,display:"flex",flexDirection:"column",gap:1},children:[B.jsx(pe,{gutterBottom:!0,className:"title label",sx:{color:"text.primary"},children:`${R("aiImageModel")}`}),B.jsx(ht,{fullWidth:!0,size:"small",children:B.jsx(dt,{sx:{width:1},value:x.model,onChange:t=>{x.number=1,x.model=t.target.value},MenuProps:{disablePortal:!0},renderValue:t=>{const a=f.find(i=>`${i.provider}/${i.model}`===t);return a?B.jsxs(z,{sx:{display:"flex",alignItems:"center",gap:1},children:[ge[a.provider]&&B.jsx(z,{component:"img",src:ge[a.provider],alt:a.provider,style:ke}),B.jsx(pe,{variant:"body2",children:a.model})]}):t},children:f.map(t=>B.jsx(Ct,{value:`${t.provider}/${t.model}`,children:B.jsxs(z,{sx:{display:"flex",alignItems:"center",gap:1,width:"100%"},children:[ge[t.provider]&&B.jsx(z,{component:"img",src:ge[t.provider],alt:t.provider,style:ke}),B.jsx(pe,{variant:"body2",sx:{flex:1},children:t.model})]})},`${t.provider}/${t.model}`))})})]})]}),B.jsx(Me,{sx:{m:2,transition:"all 0.3s"},className:"submit-ai",variant:"contained",onClick:n,disabled:w||e,children:R(w?"aiImageGenerating":"aiImageGenerate")},w?"loading-submit":"submit")]})}const zt=ce(z)`
|
|
2
|
+
import{j as B,ak as z,T as pe,z as gt,y as ht,bb as dt,M as Ct,Q as Me,at as ce,ar as lt,ch as xt,dp as Et,dq as Rt,I as yt,dr as mt,D as bt,c1 as le,aj as wt,a6 as vt}from"./vendor-mui-core-CmD-NPnl.js";import{r as oe,p as Ve,g as It}from"./vendor-react-Dvs43sk9.js";import{w as St,g as Ze,u as Lt,j as Bt,e as Tt,k as _t}from"./vendor-hooks-DLNZ8kxG.js";import{a8 as Ht,R as Ot,_ as he,ax as ct}from"./vendor-ux-ESjuHpb6.js";import{ac as Nt}from"./vendor-utils-DQK0pEML.js";import{mediaKitApi as Qt}from"./index-CvK2LB0C.js";import{r as De}from"./index-BPy8_fa2.js";import"./lottie-web-4koyQiv_.js";import"./index-6k6hDX7K.js";import"./vendor-arcblock-C-xQV6LY.js";import"./index-DRYJ0xIl.js";const ft=oe.createContext({}),pt=()=>oe.useContext(ft);function qt({children:h,restrictions:f,i18n:w,theme:R}){const[x,b]=St({loading:!1}),n=t=>b(a=>({...a,loading:t})),e=oe.useMemo(()=>({...x,onLoading:n,restrictions:f,i18n:w}),[x]);return B.jsx(Ht,{theme:R,children:B.jsx(ft.Provider,{value:e,children:h})})}const Wt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAAEsCAYAAAB5fY51AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAskSURBVHgB7d3RcdTIGoZhcSJYMoAMIAIgAiACIALIwBCBIQIgA4jAkAEZQAYmAx+6iqnjM+vxjD3qX/qk56niYm92wYve6W790ty5+GMACPCfASCEYAExBAuIIVhADMECYggWEEOwgBiCBcQQLCCGYAExBAuIIVhADMECYggWEEOwgBiCBcQQLCCGYAExBAuIIVhADMECYggWEEOwgBiCBcQQLCCGYAExBAuIIVhADMECYggWEEOwgBiCBcQQLCCGYAExBAuIIVhADMECYggWEEOwgBiCBcQQLCCGYAExBAuIIVhADMECYggWEEOwgBiCBcQQLCCGYAExBAuIIVhADMECYggWEEOwgBiCBcQQLCCGYAExBAuIIVhADMECYggWEEOwg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ZgATEEC4ghWEAMwQJiCBYQQ7CAGIIFxBAsIIZgATEEC4ghWEAMwQJiCBYQQ7CAGIIFxBAsIIZgATEEC4ghWEAMwQJiCBYQQ7CAGIIFxBAsIIZgATEEC4ghWEAMwQJiCBYQQ7CAGIIFxBAsIIZgATEEC4ghWECM/wKc/Y0zpWLfuAAAAABJRU5ErkJggg==",Mt="/.well-known/service/static/assets/bedrock-yFRPpe__.png",Zt="/.well-known/service/static/assets/deepseek-C3x42pq3.png",Dt="/.well-known/service/static/assets/doubao-yPqHSkLx.png",Gt="/.well-known/service/static/assets/gemini-DffKpc81.png",jt="/.well-known/service/static/assets/google-DT1VSJ0m.png",Vt="/.well-known/service/static/assets/ideogram-REIjy0Er.png",kt="/.well-known/service/static/assets/ollama-C7MZn2d_.png",Ft="/.well-known/service/static/assets/openai-DlpqJdrb.png",Yt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAAEsCAYAAAB5fY51AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAA0dSURBVHgB7d1Nb1XXucDxlahAogQUUi6VSG+iQCT7CmJyS0FB5WYQRreT209wP1w7yqhpB3QSKrUgEYWQFkIlLCW4aTASxrGRbRryIqX7OXBSILzY2Od4P2v9ftIRBKkDv5x/13r23us89V2nACTwdAFIQrCANAQLSEOwgDQEC0hDsIA0BAtIQ7CANAQLSEOwgDQEC0hDsIA0BAtIQ7CANAQLSEOwgDQEC0hDsIA0BAtIQ7CANAQLSEOwgDQEC0hDsIA0BAtIQ7CANAQLSEOwgDQEC0hDsIA0BAtIQ7CANAQLSEOwgDQEC0hDsIA0BAtIQ7CANAQLSEOwgDQEC0hDsIA0BAtIQ7CANAQLSEOwgDQEC0hDsIA0BAtIQ7CANAQLSEOwgDQEC0hDsIA0BAtIQ7CANAQLSEOwgDQEC0hDsIA0BAtIQ7CANAQLSEOwgDQEC0hDsIA0BAtIQ7CANAQLSEOwgDQEC0hDsI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IbAAsoQWEAZAgsoQ2ABZQgsoIz/AWP7oZ6cDDZCAAAAAElFTkSuQmCC",ge={anthropic:Wt,bedrock:Mt,deepseek:Zt,doubao:Dt,gemini:Gt,google:jt,ideogram:Vt,ollama:kt,openai:Ft,openrouter:Yt,poe:Pt,xai:Ut},ke={width:16,height:16,borderRadius:"2px",objectFit:"contain",backgroundColor:"transparent"};function Kt({onSubmit:h,models:f}){const{loading:w,i18n:R}=pt(),x=Ze({model:"",prompt:"",number:1}),b=()=>{const t=JSON.parse(JSON.stringify(x));Object.values(x).every(E=>!!E)&&h(t)},{run:n}=Lt(b,{wait:500}),e=oe.useMemo(()=>{const t=JSON.parse(JSON.stringify(x));return Object.values(t).some(a=>!a)},[JSON.stringify(x)]);return B.jsxs(zt,{onSubmit:t=>t.preventDefault(),children:[B.jsxs(z,{sx:{flex:1,height:"100%",overflow:"hidden",flexDirection:"column",display:"flex",mt:2,gap:2},children:[B.jsxs(z,{sx:{mx:2,display:"flex",flexDirection:"column",gap:1},children:[B.jsx(pe,{gutterBottom:!0,className:"title label",sx:{color:"text.primary"},children:R("aiImagePrompt")}),B.jsx(gt,{sx:{width:1},size:"small",type:"text",required:!0,placeholder:R("aiImagePromptTip"),multiline:!0,minRows:5,maxRows:6,value:x.prompt??"",onChange:t=>{t.stopPropagation(),x.prompt=t.target.value},slotProps:{htmlInput:{maxLength:1e3}}})]}),B.jsxs(z,{sx:{px:2,display:"flex",flexDirection:"column",gap:1},children:[B.jsx(pe,{gutterBottom:!0,className:"title label",sx:{color:"text.primary"},children:`${R("aiImageModel")}`}),B.jsx(ht,{fullWidth:!0,size:"small",children:B.jsx(dt,{sx:{width:1},value:x.model,onChange:t=>{x.number=1,x.model=t.target.value},MenuProps:{disablePortal:!0},renderValue:t=>{const a=f.find(i=>`${i.provider}/${i.model}`===t);return a?B.jsxs(z,{sx:{display:"flex",alignItems:"center",gap:1},children:[ge[a.provider]&&B.jsx(z,{component:"img",src:ge[a.provider],alt:a.provider,style:ke}),B.jsx(pe,{variant:"body2",children:a.model})]}):t},children:f.map(t=>B.jsx(Ct,{value:`${t.provider}/${t.model}`,children:B.jsxs(z,{sx:{display:"flex",alignItems:"center",gap:1,width:"100%"},children:[ge[t.provider]&&B.jsx(z,{component:"img",src:ge[t.provider],alt:t.provider,style:ke}),B.jsx(pe,{variant:"body2",sx:{flex:1},children:t.model})]})},`${t.provider}/${t.model}`))})})]})]}),B.jsx(Me,{sx:{m:2,transition:"all 0.3s"},className:"submit-ai",variant:"contained",onClick:n,disabled:w||e,children:R(w?"aiImageGenerating":"aiImageGenerate")},w?"loading-submit":"submit")]})}const zt=ce(z)`
|
|
3
3
|
display: flex;
|
|
4
4
|
flex-direction: column;
|
|
5
5
|
height: 100%;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as C,g as Me,a as ut}from"./vendor-react-Dvs43sk9.js";import{g as mt,k as re}from"./vendor-hooks-DLNZ8kxG.js";import{j as e,ak as g,at as q,b1 as ee,a6 as M,aX as _e,am as Y,cs as ft,U as xt,T as E,a3 as ht,W as T,z as $,M as ae,I as W,cC as $e,cf as me,A as gt,x as Oe,c2 as We,c3 as X,bv as qe,F as He,bC as yt,b6 as jt,a5 as vt,J as Ct,Q as bt,bb as St,s as Tt}from"./vendor-mui-core-CmD-NPnl.js";import{T as F,F as H,L as wt,ac as fe,a6 as le,H as R,D as L,O as xe,aa as Ue,al as Dt,E as Ie,a9 as It,ai as Pt}from"./vendor-ux-ESjuHpb6.js";import{Z as k,p as Rt,ap as Ge,c as U,B as J,a8 as kt,aK as At,f as Ft,X as Nt,ar as se,be as Ve,bf as Lt,bi as Ke}from"./index-
|
|
1
|
+
import{r as C,g as Me,a as ut}from"./vendor-react-Dvs43sk9.js";import{g as mt,k as re}from"./vendor-hooks-DLNZ8kxG.js";import{j as e,ak as g,at as q,b1 as ee,a6 as M,aX as _e,am as Y,cs as ft,U as xt,T as E,a3 as ht,W as T,z as $,M as ae,I as W,cC as $e,cf as me,A as gt,x as Oe,c2 as We,c3 as X,bv as qe,F as He,bC as yt,b6 as jt,a5 as vt,J as Ct,Q as bt,bb as St,s as Tt}from"./vendor-mui-core-CmD-NPnl.js";import{T as F,F as H,L as wt,ac as fe,a6 as le,H as R,D as L,O as xe,aa as Ue,al as Dt,E as Ie,a9 as It,ai as Pt}from"./vendor-ux-ESjuHpb6.js";import{Z as k,p as Rt,ap as Ge,c as U,B as J,a8 as kt,aK as At,f as Ft,X as Nt,ar as se,be as Ve,bf as Lt,bi as Ke}from"./index-6k6hDX7K.js";import{W as he}from"./did-address-D6qV21Cc.js";import{u as _}from"./team-RDmDo4cZ.js";import{r as ge,a as ye,b as je,c as Ye,d as ne,e as Bt,u as zt,f as Et}from"./passport-item-Bq1c8VJl.js";import{p as Ze}from"./util-CHZLxs1T.js";import{u as Mt}from"./use-mobile-D93Bk2Ru.js";import{v as Q}from"./index-BUKvf-Yt.js";import{w as G,P as Je}from"./permission-Doi0-9cF.js";import{C as _t}from"./Google-Co0ES_Ef.js";import{A as $t}from"./vendor-arcblock-C-xQV6LY.js";import{G as Z,$ as Ot,H as Wt}from"./vendor-utils-DQK0pEML.js";import{e as oe}from"./edit.svg-DycWG9v3.js";import{C as ve}from"./confirm-BSaR4_fO.js";import{L as Qe}from"./list-header-CoFZp82R.js";import{f as te}from"./index-DBs9Ljax.js";import{u as qt}from"./useSetState-DFuQZPPV.js";import{C as Ht}from"./lock.svg-COUP8tyO.js";import"./lottie-web-4koyQiv_.js";import"./session-D-9YOhAy.js";import"./isURL-BOLVWN6q.js";import"./use-app-logo-DesKuFha.js";import"./index-BE6_aQqm.js";import"./base32-Bs5DmmgZ.js";import"./cloneDeep-sSKmkjV3.js";const ie=u=>C.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...u},C.createElement("path",{d:"M8.4375 4.3125H8.25C8.35313 4.3125 8.4375 4.22812 8.4375 4.125V4.3125H15.5625V4.125C15.5625 4.22812 15.6469 4.3125 15.75 4.3125H15.5625V6H17.25V4.125C17.25 3.29766 16.5773 2.625 15.75 2.625H8.25C7.42266 2.625 6.75 3.29766 6.75 4.125V6H8.4375V4.3125ZM20.25 6H3.75C3.33516 6 3 6.33516 3 6.75V7.5C3 7.60313 3.08437 7.6875 3.1875 7.6875H4.60312L5.18203 19.9453C5.21953 20.7445 5.88047 21.375 6.67969 21.375H17.3203C18.1219 21.375 18.7805 20.7469 18.818 19.9453L19.3969 7.6875H20.8125C20.9156 7.6875 21 7.60313 21 7.5V6.75C21 6.33516 20.6648 6 20.25 6ZM17.1398 19.6875H6.86016L6.29297 7.6875H17.707L17.1398 19.6875Z"})),Pe="info";function Xe({createPassportSvg:u,passport:o,onCancel:i,onSwitchPassport:p=()=>{}}){const{t:m}=F(),l=mt({tab:Pe}),h={info:{label:m("common.basicInfo"),value:Pe,component:()=>e.jsx(et,{passport:o,createPassportSvg:u})},logs:{label:m("common.logs"),value:"logs",component:()=>e.jsx(rt,{passport:o})},related:{label:m("team.passport.related"),value:"related",component:()=>e.jsx(at,{passport:o,onSwitchPassport:p})}},a=Object.values(h).map(({label:r,value:t})=>({label:r,value:t})).filter(r=>r.value==="related"?o.parentDid:!0),f=h[l.tab]||h.info,s=r=>{l.tab=r};return e.jsx(H,{title:m("common.passport"),onClose:i,open:!0,PaperProps:{style:{maxWidth:800,minHeight:"80vh"}},fullWidth:!0,children:e.jsxs(Ut,{children:[e.jsx(g,{className:"tabs",children:e.jsx(wt,{tabs:a,current:l.tab,onChange:s,scrollButtons:"auto"})}),e.jsx(g,{className:"body",children:e.jsx(f.component,{})})]})})}Xe.propTypes={createPassportSvg:T.func.isRequired,passport:T.object.isRequired,onCancel:T.func.isRequired,onSwitchPassport:T.func};const Ut=q(g)`
|
|
2
2
|
margin-top: -16px;
|
|
3
3
|
|
|
4
4
|
.tabs {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as Wt,r as v}from"./vendor-react-Dvs43sk9.js";import{j as e,ak as y,z as Z,b6 as me,be as Ke,y as V,am as ut,c_ as Bt,bm as Kt,at as ae,b1 as mt,W as h,T as ee,U as Ge,c$ as pt,b5 as qe,a5 as Me,Q as Fe,d0 as Je,aN as Ue,a6 as ft,D as ht,d1 as qt,ad as xt,d2 as Mt,d3 as Ut,c1 as st,n as Ht,x as $t,bb as Vt,M as it,cv as Gt,I as Jt,d4 as Yt}from"./vendor-mui-core-CmD-NPnl.js";import{A as gt,J as Xt,C as Zt,e as le,F as Qt,a3 as je}from"./vendor-utils-DQK0pEML.js";import{T as te,H as M,D as ce,G as en,L as bt,al as tn,aK as nn,y as jt,$ as vt,ac as yt,aL as Ae,F as St,a6 as sn,ai as an}from"./vendor-ux-ESjuHpb6.js";import{aF as rn,Z as Ye,a8 as Ct,aZ as wt,M as _e,c as _,ap as Q,p as on,aO as at}from"./index-CndEvJBJ.js";import{g as ye,b as $,a as se}from"./vendor-hooks-DLNZ8kxG.js";import{u as Rt,C as Y}from"./index.esm-JPZAjt0x.js";import{i as He}from"./isURL-CfmrW_0C.js";import{S as X}from"./section-CndbjVtx.js";import{A as ln,a as cn,b as dn}from"./collapse-GMtfQlRs.js";import{S as Se}from"./shorten-label-Cbu8wo9m.js";import{v as Tt}from"./index-1BANSka2.js";import{R as Nt,A as un,S as mn,a as pn,B as fn}from"./list-Bfj_fOi0.js";import{j as hn,c as xn,N as gn}from"./team-DSjEanO-.js";import{W as bn}from"./did-address-D6qV21Cc.js";import{p as It}from"./util-BXcTwFDD.js";import{D as jn,g as vn}from"./traffic-mRcZHvLN.js";import{B as Et}from"./bundle-avatar-D8QkKBVi.js";import{u as yn}from"./use-mobile-D93Bk2Ru.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-C-xQV6LY.js";import"./required-B2SKELXR.js";import"./server-logo-notext.svg-CKQB0tIp.js";import"./index-DX_0Aq5L.js";import"./session-BrZcMmG5.js";import"./use-app-logo-BZU1I0dB.js";import"./base32-Ccz4U5Ob.js";import"./useAsyncRetry-6TjWJyO6.js";import"./useAsync-CNAYLnLm.js";import"./iframe-7-UjiotN.js";import"./index-CGdAaiDX.js";import"./index-DBs9Ljax.js";import"./base-chart-BntWHeFy.js";import"./index-DO9UDa6G.js";import"./vendor-mui-x--K2rEM1j.js";import"./AdapterDayjs-CRMDLq6K.js";var Te={exports:{}},Ne={exports:{}},Ie={exports:{}},rt;function Sn(){return rt||(rt=1,function(n,s){Object.defineProperty(s,"__esModule",{value:!0}),s.default=t;function t(r){return r==null}n.exports=s.default,n.exports.default=s.default}(Ie,Ie.exports)),Ie.exports}var ot;function Cn(){return ot||(ot=1,function(n,s){Object.defineProperty(s,"__esModule",{value:!0}),s.default=u;var t=o(rn()),r=o(Sn());function o(p){return p&&p.__esModule?p:{default:p}}var l=/^(?:[-+]?(?:0|[1-9][0-9]*))$/,b=/^[-+]?[0-9]+$/;function u(p,i){(0,t.default)(p),i=i||{};var N=i.allow_leading_zeroes===!1?l:b,I=!i.hasOwnProperty("min")||(0,r.default)(i.min)||p>=i.min,S=!i.hasOwnProperty("max")||(0,r.default)(i.max)||p<=i.max,j=!i.hasOwnProperty("lt")||(0,r.default)(i.lt)||p<i.lt,E=!i.hasOwnProperty("gt")||(0,r.default)(i.gt)||p>i.gt;return N.test(p)&&I&&S&&j&&E}n.exports=s.default,n.exports.default=s.default}(Ne,Ne.exports)),Ne.exports}var lt;function wn(){return lt||(lt=1,function(n,s){Object.defineProperty(s,"__esModule",{value:!0}),s.default=o;var t=r(Cn());function r(l){return l&&l.__esModule?l:{default:l}}function o(l){return(0,t.default)(l,{allow_leading_zeroes:!1,min:0,max:65535})}n.exports=s.default,n.exports.default=s.default}(Te,Te.exports)),Te.exports}var Rn=wn();const Tn=Wt(Rn),ze={enabled:!1,secure:!1,from:"",host:"",port:"",user:"",password:"",companyName:"",companyLink:"",companyAddress:"",supportEmail:""};function Nn(){const{api:n}=Ye(),{blocklet:s}=Ct(),{t}=te(),{confirmApi:r,confirmHolder:o}=wt(),l=s?.meta?.did,b=Object.assign({...ze},s?.settings?.notification?.email||{}),{handleSubmit:u,control:p,formState:i,watch:N,reset:I}=Rt({defaultValues:gt(b,Object.keys(ze))}),S=ye({testReceiver:"",testReceiverError:""}),j=N("enabled"),E=$(async(a,T,O=!0)=>{try{const{blocklet:D}=await n.configNotification({input:{did:l,notification:JSON.stringify({email:a})}}),re=Object.assign({...ze},D?.settings?.notification?.email||{});I(re),O&&M.success(t("oauth.saveSuccess"))}catch(D){if(O)M.error(D.message||t("oauth.saveFailed"));else throw D}}),G=$(async(a,T,O)=>{try{i.isDirty&&await E(a,T,!1),await n.sendEmail({input:{did:l,receiver:O,email:JSON.stringify({body:"Your SMTP configuration is correct!",title:"Test email",type:"notification",attachments:[{type:"link",data:{url:"https://community.arcblock.io",title:"Community",image:"https://community.arcblock.io/.well-known/service/blocklet/logo-rect-dark",utm:{campaign:"test-campaign"}}}],utm:{content:"test-email-button"}})}}),M.success(t("notification.email.testSuccess"))}catch(D){M.error(D.message||t("notification.email.testfailed"))}}),z=$((a,T)=>{S.testReceiver=localStorage.getItem("test-receiver")||"",S.testReceiverError="",r.open({title:t("notification.email.testSendEmail"),content:()=>e.jsx(y,{sx:{width:"300px"},children:e.jsx(Z,{sx:{mt:1},fullWidth:!0,name:"testReceiver",label:t("notification.email.inputTestReceiver"),value:S.testReceiver,onChange:O=>{S.testReceiver=O.target.value},error:!!S.testReceiverError,helperText:S.testReceiverError||" "})}),confirmButtonText:t("common.confirm"),cancelButtonText:t("common.cancel"),async onConfirm(O){const D=S.testReceiver?.trim();if(!D){S.testReceiverError=t("notification.email.receiverRequired");return}if(!_e(D)){S.testReceiverError=t("notification.email.receiverInvalid");return}S.testReceiverError="",await G(a,T,D),O()}})}),F=$(a=>{const T=a?.trim();return T?_e(T)?!0:t("notification.email.fromInvalid"):t("notification.email.fromRequired")}),B=$(a=>{const T=a?.trim();return T?He(T,{require_host:!1,protocols:[]})?!0:t("notification.email.hostInvalid"):t("notification.email.hostRequired")}),w=$(a=>a?Tn(a)?!0:t("notification.email.portInvalid"):t("notification.email.portRequired")),K=$(a=>a?.trim()?!0:t("notification.email.userRequired")),q=$(a=>a?.trim()?!0:t("notification.email.passwordRequired")),f=$(a=>a?.trim()&&!He(a,{protocols:["http","https"],require_protocol:!0})?t("notification.email.linkInvalid"):!0),R=$(a=>a?.trim()&&!_e(a)?t("notification.email.emailInvalid"):!0),C=$(()=>!0);return e.jsxs(y,{children:[e.jsxs(In,{component:"form",onSubmit:u(E),disabled:!0,sx:{".section-left":{width:"160px"}},children:[e.jsx(X,{title:t("notification.email.enable"),my:2.5,children:e.jsx(Y,{name:"enabled",control:p,render:({field:a})=>e.jsx(me,{control:e.jsx(Ke,{checked:a.value,...a})})})}),e.jsx(X,{title:t("notification.email.from"),children:e.jsx(Y,{name:"from",control:p,rules:{validate:j?F:C},render:({field:a})=>e.jsx(V,{fullWidth:!0,children:e.jsx(Z,{...a,size:"small",required:!0,label:t("notification.email.from"),error:!!i.errors[a.name],helperText:i.errors[a.name]?.message||" ",disabled:!j})})})}),e.jsx(X,{title:t("notification.email.host"),children:e.jsx(Y,{name:"host",control:p,rules:{validate:j?B:C},render:({field:a})=>e.jsx(V,{fullWidth:!0,children:e.jsx(Z,{...a,size:"small",required:!0,error:!!i.errors[a.name],label:t("notification.email.host"),helperText:i.errors[a.name]?.message||" ",disabled:!j})})})}),e.jsx(X,{title:t("notification.email.port"),children:e.jsx(Y,{name:"port",control:p,rules:{validate:j?w:C},render:({field:a})=>e.jsx(V,{fullWidth:!0,children:e.jsx(Z,{...a,size:"small",required:!0,type:"number",error:!!i.errors[a.name],label:t("notification.email.port"),helperText:i.errors[a.name]?.message||" ",disabled:!j})})})}),e.jsx(X,{title:t("notification.email.user"),children:e.jsx(Y,{name:"user",control:p,rules:{validate:j?K:C},render:({field:a})=>e.jsx(V,{fullWidth:!0,children:e.jsx(Z,{...a,size:"small",required:!0,error:!!i.errors[a.name],label:t("notification.email.user"),helperText:i.errors[a.name]?.message||" ",disabled:!j})})})}),e.jsx(X,{title:t("notification.email.password"),children:e.jsx(Y,{name:"password",control:p,rules:{validate:j?q:C},render:({field:a})=>e.jsx(V,{fullWidth:!0,children:e.jsx(Z,{...a,size:"small",required:!0,type:"password",error:!!i.errors[a.name],label:t("notification.email.password"),helperText:i.errors[a.name]?.message||" ",disabled:!j})})})}),e.jsx(X,{title:t("notification.email.secure"),children:e.jsx(Y,{name:"secure",control:p,rules:{validate:C},render:({field:a})=>e.jsx(V,{fullWidth:!0,children:e.jsx(me,{control:e.jsx(Ke,{checked:a.value,...a,disabled:!j})})})})}),e.jsxs(ln,{children:[e.jsxs(cn,{expandIcon:e.jsx(Kt,{fontSize:"small"}),"aria-controls":"panel1-content",id:"panel1-header",children:[t("notification.email.signature"),e.jsx(ut,{title:t("notification.email.signatureTooltip"),children:e.jsx(Bt,{fontSize:"small",sx:{ml:1,cursor:"help"}})})]}),e.jsxs(dn,{children:[e.jsx(X,{title:t("notification.email.companyName"),children:e.jsx(Y,{name:"companyName",control:p,rules:{validate:C},render:({field:a})=>e.jsx(V,{fullWidth:!0,children:e.jsx(Z,{...a,size:"small",error:!!i.errors[a.name],label:t("notification.email.companyName"),helperText:i.errors[a.name]?.message||" ",disabled:!j})})})}),e.jsx(X,{title:t("notification.email.companyLink"),children:e.jsx(Y,{name:"companyLink",control:p,rules:{validate:j?f:C},render:({field:a})=>e.jsx(V,{fullWidth:!0,children:e.jsx(Z,{...a,size:"small",error:!!i.errors[a.name],label:t("notification.email.companyLink"),helperText:i.errors[a.name]?.message||" ",disabled:!j})})})}),e.jsx(X,{title:t("notification.email.companyAddress"),children:e.jsx(Y,{name:"companyAddress",control:p,rules:{validate:C},render:({field:a})=>e.jsx(V,{fullWidth:!0,children:e.jsx(Z,{...a,size:"small",error:!!i.errors[a.name],label:t("notification.email.companyAddress"),helperText:i.errors[a.name]?.message||" ",disabled:!j})})})}),e.jsx(X,{title:t("notification.email.supportEmail"),children:e.jsx(Y,{name:"supportEmail",control:p,rules:{validate:j?R:C},render:({field:a})=>e.jsx(V,{fullWidth:!0,children:e.jsx(Z,{...a,size:"small",type:"email",error:!!i.errors[a.name],label:t("notification.email.supportEmail"),helperText:i.errors[a.name]?.message||" ",disabled:!j})})})})]})]}),e.jsxs(y,{sx:{display:"flex",justifyContent:"flex-end",gap:2,mt:3},children:[e.jsx(ce,{variant:"outlined",color:"warning",onClick:u(z),disabled:!j,children:t("oauth.runTest")}),e.jsx(ce,{type:"submit",variant:"contained",disabled:!i.isDirty,children:t("oauth.save")})]})]}),o]})}const In=ae(mt)``,We={enabled:!1,endpoint:"",did:void 0,pushPath:void 0};function En(){const{api:n}=Ye(),{blocklet:s}=Ct(),{t}=te(),{confirmApi:r,confirmHolder:o}=wt(),l=s?.meta?.did,b=Object.assign({...We},s?.settings?.notification?.pushKit||{}),{handleSubmit:u,control:p,formState:i,watch:N,reset:I}=Rt({defaultValues:gt(b,Object.keys(We))}),S=ye({testReceiver:"",testReceiverError:""}),j=N("enabled"),E=$(async(w,K,q=!0)=>{try{const{blocklet:f}=await n.configNotification({input:{did:l,notification:JSON.stringify({pushKit:w})}}),R=Object.assign({...We},f?.settings?.notification?.pushKit||{});I(R),q&&M.success(t("oauth.saveSuccess"))}catch(f){if(q)M.error(f.message||t("oauth.saveFailed"));else throw f}}),G=$(async(w,K)=>{try{i.isDirty&&await E(w,K,!1);const q=(s?.configs||[]).find(C=>C.key==="BLOCKLET_APP_URL")?.value,f=Xt(Zt(q,_.WELLKNOWN_SERVICE_PATH_PREFIX,"/blocklet/logo"),{v:s?.meta?.version,t:new Date(s?.updatedAt||0).getTime()}),R={type:"passthrough",passthroughType:"messageStatus",data:{message:{title:"Test push-kit notification",body:"This is message from push-kit config test",sender:{did:s?.appDid,fullName:s?.meta?.title,avatar:f}}}};await n.sendPush({input:{did:l,receiver:S.testReceiver,notification:JSON.stringify(R)}}),M.success(t("notification.pushKit.testSuccess"))}catch(q){M.error(q.message||t("notification.pushKit.testfailed"))}}),z=$((w,K)=>{S.testReceiverError="",r.open({title:t("notification.pushKit.testSend"),content:()=>e.jsx(y,{sx:{width:"450px",maxWidth:"100%"},children:e.jsx(Z,{sx:{mt:1},fullWidth:!0,name:"testReceiver",label:t("notification.pushKit.inputTestReceiver"),value:S.testReceiver,onChange:q=>{S.testReceiver=q.target.value},error:!!S.testReceiverError,helperText:S.testReceiverError||" "})}),confirmButtonText:t("common.confirm"),cancelButtonText:t("common.cancel"),async onConfirm(q){if(!S.testReceiver?.trim()){S.testReceiverError=t("notification.pushKit.receiverRequired");return}S.testReceiverError="",await G(w,K),q()}})}),F=$(w=>{const K=w?.trim();return K?He(K)?!0:t("notification.pushKit.endpointInvalid"):t("notification.pushKit.endpointRequired")}),B=$(()=>!0);return e.jsxs(y,{children:[e.jsxs(kn,{component:"form",onSubmit:u(E),disabled:!0,sx:{".section-left":{width:"160px"}},children:[e.jsx(X,{title:t("notification.pushKit.enable"),my:2.5,children:e.jsx(Y,{name:"enabled",control:p,render:({field:w})=>e.jsx(me,{control:e.jsx(Ke,{checked:w.value,...w})})})}),e.jsx(X,{title:t("notification.pushKit.endpoint"),children:e.jsx(Y,{name:"endpoint",control:p,rules:{validate:j?F:B},render:({field:w})=>e.jsx(V,{fullWidth:!0,children:e.jsx(Z,{...w,size:"small",required:!0,label:t("notification.pushKit.endpoint"),error:!!i.errors[w.name],helperText:i.errors[w.name]?.message||" ",disabled:!j})})})}),e.jsxs(X,{title:t("notification.pushKit.customOptions"),children:[e.jsx(Y,{name:"did",control:p,render:({field:w})=>e.jsx(V,{fullWidth:!0,children:e.jsx(Z,{...w,size:"small",label:t("notification.pushKit.did"),error:!!i.errors[w.name],helperText:i.errors[w.name]?.message||" ",disabled:!j})})}),e.jsx(Y,{name:"pushPath",control:p,render:({field:w})=>e.jsx(V,{fullWidth:!0,children:e.jsx(Z,{...w,size:"small",label:t("notification.pushKit.pushPath"),error:!!i.errors[w.name],helperText:i.errors[w.name]?.message||" ",disabled:!j})})})]}),e.jsxs(y,{sx:{display:"flex",justifyContent:"flex-end",gap:2,mt:3},children:[e.jsx(ce,{variant:"outlined",color:"warning",onClick:u(z),disabled:!j,children:t("oauth.runTest")}),e.jsx(ce,{type:"submit",variant:"contained",disabled:!i.isDirty,children:t("oauth.save")})]})]}),o]})}const kn=ae(mt)``,ct=[{label:e.jsx(y,{sx:{textAlign:"center",width:"100%"},children:"Email"}),value:"email"},{label:e.jsx(y,{sx:{textAlign:"center",width:"100%"},children:"Push Kit"}),value:"pushKit"}];function An(){const[n,s]=v.useState(ct[0].value),{locale:t}=v.useContext(en),r=se(()=>({email:e.jsx(Nn,{}),pushKit:e.jsx(En,{})}),[t]),o=v.useMemo(()=>({padding:"10px 0"}),[]);return e.jsxs(y,{children:[e.jsx(bt,{tabs:ct,current:n,onChange:s}),e.jsx(y,{style:o,children:r[n]})]})}const kt=v.createContext({}),{Provider:On,Consumer:Ws}=kt;function Dn({children:n,blocklet:s=""}){const{api:t,inService:r,ws:{useSubscription:o}}=Ye(),[l,b]=v.useState([]),[u,p]=v.useState({total:0,pageSize:20,pageCount:0,page:1}),i=se(()=>s.meta?.did,[s]),[N,I]=v.useState([]),[S,j]=v.useState({}),E=se(()=>l.length?new Set(l.map(f=>f.id)):new Set,[l]),G=async({page:f=1,pageSize:R=20,...C}={})=>{if(!i)return[];try{const a={paging:{page:f,pageSize:R},...C,teamDid:i,dateRange:C.dateRange?[Q(C.dateRange[0]).toISOString(),Q(C.dateRange[1]).toISOString()]:void 0},{dids:T,...O}=a;let D="";T&&T.includes("system")&&(D="system");const re=T?T.filter(pe=>pe!=="system"):[],ue={...O,source:D,componentDids:re},oe=await t.getNotificationSendLog({input:ue});return j(ue),b(oe.list),p(oe.paging),oe.list}catch(a){return M.error(a.message),[]}},z=async()=>{const f=await t.getNotificationComponents({input:{teamDid:i}});I(f.componentDids)},F=v.useCallback(f=>{const R=s.children.find(C=>C.meta?.did===f);if(R)return R.ancestors=[s],R},[s]),B=async({notificationId:f,receivers:R,channels:C,...a})=>{await t.resendNotification({input:{teamDid:i,notificationId:f,receivers:R,channels:C.map(T=>T==="wallet"?_.NOTIFICATION_SEND_CHANNEL.WALLET:T==="pushKit"?_.NOTIFICATION_SEND_CHANNEL.PUSH:T),...a}})},w=v.useCallback(async f=>(await t.getUser({input:{teamDid:i,user:{did:f}}})).user,[t,i]),K=v.useCallback(async({page:f=1,pageSize:R=20,...C}={})=>{try{const a={paging:{page:f,pageSize:R},...C,userName:C.searchText||"",teamDid:i,dateRange:C.dateRange?[Q(C.dateRange[0]).toISOString(),Q(C.dateRange[1]).toISOString()]:void 0};return await t.getReceivers({input:a})}catch(a){throw M.error(a.message),a}},[t,i]);v.useEffect(()=>{i&&z()},[i]),o(_.EVENTS.NOTIFICATION_BLOCKLET_UPDATE,f=>{E.has(f.notificationId)&&G(S)},[E,S]),o(_.EVENTS.NOTIFICATION_BLOCKLET_CREATE,f=>{E.has(f.id)||G(S)},[E,S]);const q={fetch:G,data:l,paging:u,blocklet:s,getComponent:F,resendNotification:B,getUser:w,componentDids:N,getReceivers:K,inService:r,teamDid:i};return e.jsx(On,{value:{notificationRecords:q},children:n})}function Xe(){const{notificationRecords:n}=v.useContext(kt);return n}Ce.propTypes={severity:h.oneOf(Object.values(["info","success","error","warning"])).isRequired};const Ln={info:"primary",success:"success",error:"error",warning:"warning"};function Ce({severity:n="info"}){return e.jsx(tn,{type:Ln[n],children:n})}const Pn=(n,s,t="")=>{if(!t||!s)return"";switch(t){case _.NOTIFICATION_SEND_FAILED_REASON.USER_DISABLED:return n("notification.sendStatus.reason.disabled",{channel:s});case _.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_UNAVAILABLE:return n("notification.sendStatus.reason.unavailable",{channel:s});case _.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_DISABLED:return n("notification.sendStatus.reason.notSent",{channel:s});case _.NOTIFICATION_SEND_FAILED_REASON.NOT_ONLINE:return n("notification.sendStatus.reason.offline");default:return t}};function At(n,s,t={}){const{status:r,updatedAt:o,reason:l="",channel:b="wallet"}=t,u=o?n("notification.sendStatus.sentTime",{date:on(o,s)}):"",p=Pn(n,b,l);return r===_.NOTIFICATION_SEND_STATUS.FAILED?{status:"failed",title:n("notification.sendStatus.failed"),sentTime:u,reason:p}:r===_.NOTIFICATION_SEND_STATUS.SENT?{status:"success",title:n("notification.sendStatus.success"),sentTime:u}:{status:"pending",title:n("notification.sendStatus.pending"),reason:p,sentTime:u}}const $e={pending:"#aaaaaa",success:"#34BE74",failed:"#D0021B"},Ve=["wallet","pushKit","email"],dt=["info","success","error","warning"],Ot=n=>{const{settings:s}=n;return s?.notification?.email?.enabled},Dt=n=>{const{settings:s}=n;return s?.notification?.pushKit?.enabled},Fn=(n,s)=>{const t=le(s,"extra.notifications.email",!0);return{available:Ot(n),enabled:t}},_n=(n,s)=>{const t=le(s,"extra.notifications.push",!0);return{available:Dt(n),enabled:t}},zn=n=>({enabled:le(n,"extra.notifications.wallet",!0)}),Wn=n=>({enabled:le(n,"extra.webhooks",[]).length>0}),Ee=(n=3)=>new Promise(s=>{setTimeout(()=>{s()},n*1e3)}),Bn=(n,s)=>s==="wallet"||s==="webhook"?[{channel:s,type:"enabled",pass:n("notification.sendStatus.reason.enabled",{channel:s}),fail:n("notification.sendStatus.reason.disabled",{channel:s})}]:s==="pushKit"||s==="email"?[{channel:s,type:"available",pass:n("notification.sendStatus.reason.available",{channel:s}),fail:n("notification.sendStatus.reason.unavailable",{channel:s})},{channel:s,type:"enabled",pass:n("notification.sendStatus.reason.enabled",{channel:s}),fail:n("notification.sendStatus.reason.disabled",{channel:s})}]:[],ke=(n=[])=>{const s=Q().startOf("day");return n.filter(t=>Q(t.sendAt).isSame(s,"day")).length},Kn=(n,s="")=>{if(s&&Ve.includes(s)){const l=`${s}SendRecord`,b=le(n,l,[]);return ke(b)}const t=le(n,"webhook",{}),r=Object.keys(t??{})??[];if(s&&r.includes(s)){const l=t[s]??[];return ke(l)}const o={};return Ve.forEach(l=>{const b=`${l}SendRecord`,u=le(n,b,[]),p=ke(u);o[l]=p}),r.length>0&&r.forEach(l=>{const b=t[l]??[],u=ke(b);o[l]=u}),o},Oe=(n,s,t)=>{if(!Array.isArray(n))throw new Error("Invalid filterList or index");return n[t].splice(s,1),n},De=(n,s)=>{if(!Array.isArray(s))throw new Error("filters must be an array");return s.length?!s.includes(n):!1},qn=n=>{switch(n){case _.NOTIFICATION_SEND_CHANNEL.WALLET:return"Wallet";case _.NOTIFICATION_SEND_CHANNEL.PUSH:return"Push Kit";case _.NOTIFICATION_SEND_CHANNEL.EMAIL:return"Email";case _.NOTIFICATION_SEND_CHANNEL.WEBHOOK:return"Webhook";default:return""}},Lt=()=>({components:{MUIDataTableFilter:{styleOverrides:{header:{marginBottom:0,p:{margin:0}},root:{"& .MuiGrid-container":{marginTop:0,"& .MuiGrid-item":{paddingTop:0}}}}},MuiPopover:{styleOverrides:{root:{"&.MuiPopover-root":{"& .MuiPaper-root:has(.filter-container)":{width:"420px"}}}}}}});function de({config:n,enableTooltip:s=!0,showTitle:t=!1,children:r=null}){const{status:o,title:l="",sentTime:b="",reason:u=""}=n,p=[l,u].filter(Boolean).join(", ");return e.jsx(ut,{title:s?e.jsxs(e.Fragment,{children:[e.jsx(ee,{color:"inherit",sx:{fontSize:12},children:p}),e.jsx("span",{children:b})]}):null,arrow:!0,placement:"top",children:e.jsxs(y,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsxs(y,{sx:{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center"},children:[e.jsx(y,{style:{opacity:.15},sx:{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:$e[o]}}),e.jsx(y,{sx:{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:$e[o]}})]}),e.jsx(ee,{color:"inherit",sx:{fontSize:12},children:t?l:r})]})})}de.propTypes={config:h.object.isRequired,enableTooltip:h.bool,showTitle:h.bool,children:h.node};Le.propTypes={list:h.array.isRequired,label:h.string.isRequired,onDelete:h.func};function Le({list:n,label:s,onDelete:t=()=>{}}){const{t:r,locale:o}=te();return e.jsxs(y,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsxs(ee,{children:[s,": "]}),n.map(l=>{const b=At(r,o,{status:l});return e.jsx(Ge,{size:"small",label:e.jsx(y,{sx:{display:"flex",alignItems:"center",gap:"4px"},children:e.jsx(de,{config:b,enableTooltip:!1,children:b.title})}),onDelete:u=>t(u,l)},l)})]})}Ze.propTypes={filterList:h.array.isRequired,onChange:h.func.isRequired,index:h.number.isRequired,column:h.object.isRequired,filterValues:h.array.isRequired,label:h.string.isRequired,renderLabel:h.func.isRequired};function Ze({filterList:n,onChange:s,index:t,column:r,filterValues:o,label:l,renderLabel:b}){return e.jsxs(V,{className:"filter-container",children:[e.jsx(pt,{component:"legend",children:l}),e.jsx(qe,{row:!0,children:o.map(u=>e.jsx(me,{control:e.jsx(Me,{checked:n[t].indexOf(u.value??u)>-1,onChange:p=>{const i=[...n];p.target.checked?i[t]=[...i[t],u.value??u]:i[t]=i[t].filter(N=>N!==(u.value??u)),s(i[t],t,r)},name:u.value??u}),label:e.jsx("span",{style:{display:"flex",alignItems:"center"},children:b(u)})},u.value??u))})]})}function Be(n){return e.jsx(Ze,{...n,renderLabel:s=>e.jsx(de,{enableTooltip:!1,config:{status:s.status},children:s.label})})}xe.propTypes={status:h.number.isRequired,updatedAt:h.string.isRequired,reason:h.string,channel:h.string,onResend:h.func};function xe({status:n,updatedAt:s,reason:t="",channel:r="wallet",onResend:o}){const{t:l,locale:b}=te(),u=At(l,b,{status:n,updatedAt:s,reason:t,channel:r});return e.jsxs(y,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(de,{config:u,showTitle:!0}),u.status!=="success"&&e.jsx(Fe,{className:"resend-btn",size:"small",startIcon:e.jsx(Je,{}),sx:{fontSize:12,color:"rgba(0, 0, 0, 0.87)",fontWeight:400,".MuiButton-startIcon":{mr:"2px"}},onClick:o,children:l("notification.resend")})]})}Qe.propTypes={value:h.array.isRequired,onChange:h.func};function Qe({value:n,onChange:s}){const{locale:t}=te(),r=Q().toDate(),[o,l]=v.useState(null),b=v.useCallback(i=>{l(o?null:i.currentTarget)},[o]),u=!!o,p=v.useCallback(i=>{if(!i.startDate||!i.endDate){M.error("Please select a date range");return}if(Q(i.startDate).isAfter(i.endDate)||!Q(i.startDate).isValid()||!Q(i.endDate).isValid()){M.error("Invalid date range");return}s([i.startDate,i.endDate]),l(null)},[s]);return e.jsxs("div",{children:[e.jsx(ee,{component:"div",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},sx:{mb:0},children:e.jsxs(Fe,{onClick:b,variant:"outlined",size:"small",color:"inherit",children:[at(n[0],t)," - ",at(n[1],t)]})}),e.jsx(Ue,{open:u,anchorEl:o,onClose:()=>{l(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:e.jsx(jn,{open:!0,maxDate:r,initialDateRange:{startDate:n[0],endDate:n[1]},toggle:b,definedRanges:vn(r),onChange:p})})]})}et.propTypes={itemComponent:h.elementType.isRequired};function et({itemComponent:n,...s}){const{t}=te();return!s?.filterList?.filter(o=>o.length).length?null:e.jsxs(y,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsx("div",{className:"toolbar-filter-title",children:t("notification.filter")}),e.jsx("div",{className:"toolbar-filter-content",children:e.jsx(nn.TableFilterList,{...s,ItemComponent:n})})]})}function tt({label:n,onDelete:s,canDelete:t=()=>!0,...r}){const o=s&&typeof s=="function"?s:void 0;let l=!0;return t&&typeof t=="function"&&(l=t({label:n,...r})),e.jsx(Ge,{label:n,variant:"outlined",...o&&l?{onDelete:o}:{}})}tt.propTypes={label:h.string.isRequired,onDelete:h.func,canDelete:h.func};const Mn=[{label:"Wallet",value:"app",checked:!0},{label:"Email",value:"email",checked:!0},{label:"Push Kit",value:"push",checked:!0},{label:"Webhook",value:"webhook",checked:!0}];Pt.propTypes={loading:h.bool,onCancel:h.func,onConfirm:h.func};function Pt({loading:n=!1,onCancel:s=()=>{},onConfirm:t=()=>{}}){const{t:r}=te(),[o,l]=v.useState(Mn),[b,u]=v.useState(!0),p=(N,I)=>{I.checked=N.target.checked;const S=o.map(j=>({...j,checked:j.value===I.value?I.checked:j.checked}));l(S)},i=N=>{N.stopPropagation(),t({channels:o.filter(I=>I.checked).map(I=>I.value),isResendFailedOnly:b})};return e.jsxs(y,{className:"resend-config",sx:{padding:"16px 24px"},children:[e.jsx(ee,{variant:"body1",component:"div",className:"check-title",sx:{fontWeight:700,mb:1},children:r("notification.config")}),e.jsx(y,{className:"choose-channel",children:e.jsxs(V,{component:"fieldset",variant:"standard",children:[e.jsx(pt,{component:"legend",children:r("notification.selectChannels")}),e.jsx(qe,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:1},children:o.map(N=>e.jsx(me,{control:e.jsx(Me,{checked:N.checked,onChange:I=>p(I,N),name:N.value}),label:N.label},N.value))})]})}),e.jsx(y,{className:"resend-config-footer",children:e.jsx(qe,{children:e.jsx(me,{control:e.jsx(Me,{checked:b,onChange:N=>u(N.target.checked)}),label:r("notification.resendFailedOnly")})})}),e.jsxs(y,{className:"resend-config-footer-tip",sx:{display:"flex",justifyContent:"flex-end",gap:1},children:[e.jsx(Fe,{onClick:N=>{N.stopPropagation(),s()},color:"inherit",children:r("common.cancel")}),e.jsxs(Fe,{onClick:i,color:"primary",disabled:n,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[n&&e.jsx(ft,{size:16}),r("common.confirm")]})]})]})}Ft.propTypes={notificationId:h.string.isRequired,handleResend:h.func,resending:h.bool};function Ft({notificationId:n,handleResend:s,resending:t=!1}){const{t:r,locale:o}=te(),l=ht(),b=v.useMemo(()=>jt(l,Lt()),[l]),{getReceivers:u,inService:p,teamDid:i,getUser:N,blocklet:I}=Xe(),[S,j]=v.useState(!1),[E,G]=v.useState([]),z=ye({anchorEl:null,position:null}),F=ye({anchorEl:null,position:null}),[B,w]=v.useState(null),[K,q]=v.useState({total:0,pageSize:10,pageCount:0,page:1}),[f,R]=v.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[Q().subtract(1,"month").startOf("day").toDate(),Q().endOf("day").toDate()]}),[C,a]=v.useState([]),T=[{label:r("notification.sendStatus.pending"),value:0,status:"pending"},{label:r("notification.sendStatus.success"),value:1,status:"success"},{label:r("notification.sendStatus.failed"),value:2,status:"failed"}],O=async()=>{if(!S&&n)try{j(!0);const c=await u({notificationId:n,...f}),d=c.list.map(m=>({...m,receiverUser:{...m.receiverUser,avatar:It(m.receiverUser.avatar,i,p)}}));G(d),q(c.paging),j(!1)}catch(c){M.error(c.message),j(!1)}};v.useEffect(()=>{O()},[f]);const D=c=>{c.stopPropagation();const d=c.currentTarget;F.anchorEl=d;const m=d.getBoundingClientRect();F.position={top:m.top+window.scrollY,left:m.left+window.scrollX}},re=c=>c.data.length?e.jsx("div",{style:{display:"flex",alignItems:"center",padding:"10px"},children:e.jsx(ce,{className:"resend-btn",size:"small",color:"primary",variant:"contained",startIcon:e.jsx(Je,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:D,children:r("notification.resend")})}):null,ue={sort:!1,download:!1,print:!1,selectableRows:"multiple",searchPlaceholder:r("common.search"),searchAlwaysOpen:!1,filterType:"checkbox",searchDebounceTime:300,page:K.page-1,rowsPerPage:K.pageSize,count:K.total,searchText:f.searchText,tableBodyMaxHeight:"calc(80vh - 260px)",rowsSelected:C,onRowSelectionChange:(c,d)=>{a(d.map(m=>m.dataIndex))},customToolbarSelect:re},oe=({page:c,rowsPerPage:d,searchText:m,filterList:A})=>{const[,U=[],ne=[],J=[]]=A;f.pageSize!==d?R(H=>({...H,pageSize:d,page:1})):f.page!==c+1?R(H=>({...H,page:c+1})):f.searchText!==m?R(H=>({...H,searchText:m,page:1})):je(U,f.walletSendStatus)?je(ne,f.pushKitSendStatus)?je(J,f.emailSendStatus)||R(H=>({...H,emailSendStatus:J,page:1})):R(H=>({...H,pushKitSendStatus:ne,page:1})):R(H=>({...H,walletSendStatus:U,page:1}))},pe=v.useCallback(async(c,d)=>{if(!d)return!1;const m=await N(d);return m?c==="wallet"?zn(m):c==="email"?Fn(I,m):c==="pushKit"?_n(I,m):c==="webhook"?Wn(m):!0:!1},[N,I]),we=v.useCallback(c=>Bn(r,c),[r]),fe=()=>{z.anchorEl=null,z.position=null,w(null)},he=()=>{F.anchorEl=null,F.position=null},g=async(c,d,m=!0,A="")=>{if(!(!d.length||!c.length))try{s(c,d,m,A),F.anchorEl||(await Ee(.5),fe())}catch(U){console.error("handleResend error",{error:U})}},x=async({channels:c,isResendFailedOnly:d})=>{const m=C.map(A=>E[A].receiver);await g(c,m,d),await Ee(.5),he(),a([])},k=async(c,d=[],m=!0)=>{try{await g(["webhook"],[c.receiver],m,d)}catch(A){M.error(A.response?A.response.statusText:A.message)}},L=async(c,d,m,A=[],U=!0)=>{if(c.stopPropagation(),Kn(d,m)>=4){M.warning(r("notification.resendLimit"));return}if(!Ve.includes(m)){await k(d,A,U);return}if(c){const J=c.currentTarget,H=J.getBoundingClientRect();z.anchorEl=J,z.position={top:H.top+window.scrollY,left:H.left+window.scrollX}}w({channel:m});try{const J=await pe(m,d.receiver);await Ee(1),w({channel:m,result:J}),(typeof J=="boolean"&&J||Qt(J)&&Object.values(J).every(H=>!!H))&&(await s([m],[d.receiver],U),F.anchorEl||(await Ee(.5),fe()))}catch(J){M.error(J.message)}},W=c=>{R(d=>({...d,dateRange:c,page:1}))},P=(c,d,m,A)=>{c.stopPropagation();const U=m.filter(ne=>ne!==d);R(ne=>({...ne,[A]:U,page:1}))},ie=se(()=>[{label:r("notification.receiver"),name:"receiver",width:200,options:{filter:!1,customBodyRenderLite:c=>{const{receiverUser:d,receiver:m}=E[c];return d?e.jsxs(y,{"data-cy":`member-name-${d.fullName}`,sx:{display:"flex",alignItems:"center",gap:1,justifyContent:"flex-start"},children:[e.jsx(vt,{src:`${d.avatar}?imageFilter=resize&w=48&h=48`,size:32,did:m,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),e.jsx(Se,{children:d.fullName})]},m):e.jsx(bn,{size:14,responsive:!1,compact:!0,copyable:!1,did:m})}}},{label:"Wallet",name:"walletSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),filter:!0,filterType:"custom",filterList:f.walletSendStatus??[],customFilterListOptions:{render:c=>e.jsx(Le,{list:c,label:"Wallet",onDelete:(d,m)=>{d.stopPropagation(),P(d,m,ie[1].options.filterList,"walletSendStatus")}}),update:Oe},filterOptions:{names:T,fullWidth:!0,logic:De,display:(c,d,m,A)=>e.jsx(Be,{label:"Wallet",filterList:c,onChange:d,index:m,column:A,filterValues:T})},customBodyRenderLite:c=>{const{walletSendStatus:d,walletSendAt:m,walletSendFailedReason:A}=E[c];return e.jsx(xe,{status:d,updatedAt:m,reason:A,channel:"wallet",onResend:U=>L(U,E[c],"wallet",[],!1)})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:c=>{const{pushKitSendStatus:d,pushKitSendAt:m,pushKitSendFailedReason:A}=E[c];return e.jsx(xe,{status:d,updatedAt:m,reason:A,channel:"pushkit",onResend:U=>L(U,E[c],"pushKit",[],!1)})},filter:!0,filterType:"custom",filterList:f.pushKitSendStatus??[],customFilterListOptions:{render:c=>e.jsx(Le,{list:c,label:"Push Kit",onDelete:(d,m)=>{d.stopPropagation(),P(d,m,ie[2].options.filterList,"pushKitSendStatus")}}),update:Oe},filterOptions:{names:T,fullWidth:!0,logic:De,display:(c,d,m,A)=>e.jsx(Be,{label:"Push Kit",filterList:c,onChange:d,index:m,column:A,filterValues:T})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:c=>{const{emailSendStatus:d,emailSendAt:m,emailSendFailedReason:A}=E[c];return e.jsx(xe,{status:d,updatedAt:m,reason:A,channel:"email",onResend:U=>L(U,E[c],"email",[],!1)})},filter:!0,filterType:"custom",filterList:f.emailSendStatus??[],customFilterListOptions:{render:c=>e.jsx(Le,{list:c,label:"Email",onDelete:(d,m)=>{d.stopPropagation(),P(d,m,ie[3].options.filterList,"emailSendStatus")}}),update:Oe},filterOptions:{names:T,fullWidth:!0,logic:De,display:(c,d,m,A)=>e.jsx(Be,{label:"Email",filterList:c,onChange:d,index:m,column:A,filterValues:T})}}},{label:"Webhook",name:"webhook",width:200,options:{filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:c=>{const{webhook:d}=E[c];if(!d)return null;const m=Object.entries(d)[0];if(!m)return null;const[A,U]=m,ne=U[0];return e.jsx(y,{sx:{display:"flex",flexDirection:"column",gap:1},children:e.jsxs(y,{className:"webhook-item",sx:{fontSize:12},children:[e.jsx(Se,{maxLength:30,children:A},A),e.jsx(xe,{status:ne.status,updatedAt:ne.sendAt,reason:ne.failedReason,channel:"webhook",onResend:J=>L(J,E[c],"webhook",[A],!1)})]},A)})}}},{label:r("common.createdAt"),name:"createdAt",width:100,options:{filter:!1,customBodyRenderLite:c=>{const{createdAt:d}=E[c];return e.jsx(Nt,{value:d,locale:o,shouldUpdate:!0})}}}],[E,o,f,r]),Re=[e.jsx(Qe,{value:f.dateRange,onChange:W},"date-picker"),e.jsx(ce,{variant:"contained",size:"small",color:"primary",loading:S,startIcon:e.jsx(qt,{}),onClick:()=>O(),sx:{".MuiButton-startIcon":{mr:"2px"}},style:{marginLeft:8},children:r("common.refresh")},"refresh")];return e.jsx(y,{sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:e.jsx(Hn,{children:e.jsxs(xt,{theme:b,children:[e.jsx(yt,{className:"receivers-table",locale:o,loading:S,columns:ie,data:E,onChange:oe,options:ue,customButtons:Re,components:{TableFilterList:c=>e.jsx(et,{...c,itemComponent:d=>e.jsx(tt,{...d,canDelete:()=>!1})})}}),z.anchorEl&&e.jsx(Ue,{open:!!z.anchorEl,anchorReference:"anchorPosition",anchorPosition:z.position,onClose:fe,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs($n,{children:[e.jsxs(ee,{variant:"body1",component:"div",className:"check-title",children:[B?.channel," Checking"]}),e.jsx(y,{sx:{display:"flex",flexDirection:"column",gap:"4px"},children:we(B?.channel).map(c=>{const{type:d,pass:m,fail:A}=c;return!B?.result||B?.result?.[d]?e.jsxs(ee,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:B?.result?.[d]?Ae.success.main:"inherit"},children:[B?.result?e.jsx(Mt,{}):e.jsx(ft,{size:12,sx:{color:Ae.primary.main}}),e.jsx("span",{children:m})]},d):e.jsxs(ee,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:Ae.error.main},children:[e.jsx(Ut,{}),e.jsx("span",{children:A})]},d)})})]})}),F.anchorEl&&e.jsx(Ue,{open:!!F.anchorEl,anchorReference:"anchorPosition",anchorPosition:F.position,onClose:he,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsx(Pt,{loading:t,onCancel:he,onConfirm:x})})]})})})}const Un=v.memo(Ft),Hn=ae.div`
|
|
1
|
+
import{g as Wt,r as v}from"./vendor-react-Dvs43sk9.js";import{j as e,ak as y,z as Z,b6 as me,be as Ke,y as V,am as ut,c_ as Bt,bm as Kt,at as ae,b1 as mt,W as h,T as ee,U as Ge,c$ as pt,b5 as qe,a5 as Me,Q as Fe,d0 as Je,aN as Ue,a6 as ft,D as ht,d1 as qt,ad as xt,d2 as Mt,d3 as Ut,c1 as st,n as Ht,x as $t,bb as Vt,M as it,cv as Gt,I as Jt,d4 as Yt}from"./vendor-mui-core-CmD-NPnl.js";import{A as gt,J as Xt,C as Zt,e as le,F as Qt,a3 as je}from"./vendor-utils-DQK0pEML.js";import{T as te,H as M,D as ce,G as en,L as bt,al as tn,aK as nn,y as jt,$ as vt,ac as yt,aL as Ae,F as St,a6 as sn,ai as an}from"./vendor-ux-ESjuHpb6.js";import{aF as rn,Z as Ye,a8 as Ct,aZ as wt,M as _e,c as _,ap as Q,p as on,aO as at}from"./index-6k6hDX7K.js";import{g as ye,b as $,a as se}from"./vendor-hooks-DLNZ8kxG.js";import{u as Rt,C as Y}from"./index.esm-JPZAjt0x.js";import{i as He}from"./isURL-BOLVWN6q.js";import{S as X}from"./section-CndbjVtx.js";import{A as ln,a as cn,b as dn}from"./collapse-GMtfQlRs.js";import{S as Se}from"./shorten-label-Cbu8wo9m.js";import{v as Tt}from"./index-1BANSka2.js";import{R as Nt,A as un,S as mn,a as pn,B as fn}from"./list-BmwWshfg.js";import{j as hn,c as xn,N as gn}from"./team-RDmDo4cZ.js";import{W as bn}from"./did-address-D6qV21Cc.js";import{p as It}from"./util-CHZLxs1T.js";import{D as jn,g as vn}from"./traffic-BUIhb2HS.js";import{B as Et}from"./bundle-avatar-CF-8YjIk.js";import{u as yn}from"./use-mobile-D93Bk2Ru.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-C-xQV6LY.js";import"./required-B2SKELXR.js";import"./server-logo-notext.svg-CKQB0tIp.js";import"./index-BE6_aQqm.js";import"./session-D-9YOhAy.js";import"./use-app-logo-DesKuFha.js";import"./base32-Bs5DmmgZ.js";import"./useAsyncRetry-6TjWJyO6.js";import"./useAsync-CNAYLnLm.js";import"./iframe-BZdurKlN.js";import"./index-CGdAaiDX.js";import"./index-DBs9Ljax.js";import"./base-chart-BntWHeFy.js";import"./index-DO9UDa6G.js";import"./vendor-mui-x--K2rEM1j.js";import"./AdapterDayjs-CRMDLq6K.js";var Te={exports:{}},Ne={exports:{}},Ie={exports:{}},rt;function Sn(){return rt||(rt=1,function(n,s){Object.defineProperty(s,"__esModule",{value:!0}),s.default=t;function t(r){return r==null}n.exports=s.default,n.exports.default=s.default}(Ie,Ie.exports)),Ie.exports}var ot;function Cn(){return ot||(ot=1,function(n,s){Object.defineProperty(s,"__esModule",{value:!0}),s.default=u;var t=o(rn()),r=o(Sn());function o(p){return p&&p.__esModule?p:{default:p}}var l=/^(?:[-+]?(?:0|[1-9][0-9]*))$/,b=/^[-+]?[0-9]+$/;function u(p,i){(0,t.default)(p),i=i||{};var N=i.allow_leading_zeroes===!1?l:b,I=!i.hasOwnProperty("min")||(0,r.default)(i.min)||p>=i.min,S=!i.hasOwnProperty("max")||(0,r.default)(i.max)||p<=i.max,j=!i.hasOwnProperty("lt")||(0,r.default)(i.lt)||p<i.lt,E=!i.hasOwnProperty("gt")||(0,r.default)(i.gt)||p>i.gt;return N.test(p)&&I&&S&&j&&E}n.exports=s.default,n.exports.default=s.default}(Ne,Ne.exports)),Ne.exports}var lt;function wn(){return lt||(lt=1,function(n,s){Object.defineProperty(s,"__esModule",{value:!0}),s.default=o;var t=r(Cn());function r(l){return l&&l.__esModule?l:{default:l}}function o(l){return(0,t.default)(l,{allow_leading_zeroes:!1,min:0,max:65535})}n.exports=s.default,n.exports.default=s.default}(Te,Te.exports)),Te.exports}var Rn=wn();const Tn=Wt(Rn),ze={enabled:!1,secure:!1,from:"",host:"",port:"",user:"",password:"",companyName:"",companyLink:"",companyAddress:"",supportEmail:""};function Nn(){const{api:n}=Ye(),{blocklet:s}=Ct(),{t}=te(),{confirmApi:r,confirmHolder:o}=wt(),l=s?.meta?.did,b=Object.assign({...ze},s?.settings?.notification?.email||{}),{handleSubmit:u,control:p,formState:i,watch:N,reset:I}=Rt({defaultValues:gt(b,Object.keys(ze))}),S=ye({testReceiver:"",testReceiverError:""}),j=N("enabled"),E=$(async(a,T,O=!0)=>{try{const{blocklet:D}=await n.configNotification({input:{did:l,notification:JSON.stringify({email:a})}}),re=Object.assign({...ze},D?.settings?.notification?.email||{});I(re),O&&M.success(t("oauth.saveSuccess"))}catch(D){if(O)M.error(D.message||t("oauth.saveFailed"));else throw D}}),G=$(async(a,T,O)=>{try{i.isDirty&&await E(a,T,!1),await n.sendEmail({input:{did:l,receiver:O,email:JSON.stringify({body:"Your SMTP configuration is correct!",title:"Test email",type:"notification",attachments:[{type:"link",data:{url:"https://community.arcblock.io",title:"Community",image:"https://community.arcblock.io/.well-known/service/blocklet/logo-rect-dark",utm:{campaign:"test-campaign"}}}],utm:{content:"test-email-button"}})}}),M.success(t("notification.email.testSuccess"))}catch(D){M.error(D.message||t("notification.email.testfailed"))}}),z=$((a,T)=>{S.testReceiver=localStorage.getItem("test-receiver")||"",S.testReceiverError="",r.open({title:t("notification.email.testSendEmail"),content:()=>e.jsx(y,{sx:{width:"300px"},children:e.jsx(Z,{sx:{mt:1},fullWidth:!0,name:"testReceiver",label:t("notification.email.inputTestReceiver"),value:S.testReceiver,onChange:O=>{S.testReceiver=O.target.value},error:!!S.testReceiverError,helperText:S.testReceiverError||" "})}),confirmButtonText:t("common.confirm"),cancelButtonText:t("common.cancel"),async onConfirm(O){const D=S.testReceiver?.trim();if(!D){S.testReceiverError=t("notification.email.receiverRequired");return}if(!_e(D)){S.testReceiverError=t("notification.email.receiverInvalid");return}S.testReceiverError="",await G(a,T,D),O()}})}),F=$(a=>{const T=a?.trim();return T?_e(T)?!0:t("notification.email.fromInvalid"):t("notification.email.fromRequired")}),B=$(a=>{const T=a?.trim();return T?He(T,{require_host:!1,protocols:[]})?!0:t("notification.email.hostInvalid"):t("notification.email.hostRequired")}),w=$(a=>a?Tn(a)?!0:t("notification.email.portInvalid"):t("notification.email.portRequired")),K=$(a=>a?.trim()?!0:t("notification.email.userRequired")),q=$(a=>a?.trim()?!0:t("notification.email.passwordRequired")),f=$(a=>a?.trim()&&!He(a,{protocols:["http","https"],require_protocol:!0})?t("notification.email.linkInvalid"):!0),R=$(a=>a?.trim()&&!_e(a)?t("notification.email.emailInvalid"):!0),C=$(()=>!0);return e.jsxs(y,{children:[e.jsxs(In,{component:"form",onSubmit:u(E),disabled:!0,sx:{".section-left":{width:"160px"}},children:[e.jsx(X,{title:t("notification.email.enable"),my:2.5,children:e.jsx(Y,{name:"enabled",control:p,render:({field:a})=>e.jsx(me,{control:e.jsx(Ke,{checked:a.value,...a})})})}),e.jsx(X,{title:t("notification.email.from"),children:e.jsx(Y,{name:"from",control:p,rules:{validate:j?F:C},render:({field:a})=>e.jsx(V,{fullWidth:!0,children:e.jsx(Z,{...a,size:"small",required:!0,label:t("notification.email.from"),error:!!i.errors[a.name],helperText:i.errors[a.name]?.message||" ",disabled:!j})})})}),e.jsx(X,{title:t("notification.email.host"),children:e.jsx(Y,{name:"host",control:p,rules:{validate:j?B:C},render:({field:a})=>e.jsx(V,{fullWidth:!0,children:e.jsx(Z,{...a,size:"small",required:!0,error:!!i.errors[a.name],label:t("notification.email.host"),helperText:i.errors[a.name]?.message||" ",disabled:!j})})})}),e.jsx(X,{title:t("notification.email.port"),children:e.jsx(Y,{name:"port",control:p,rules:{validate:j?w:C},render:({field:a})=>e.jsx(V,{fullWidth:!0,children:e.jsx(Z,{...a,size:"small",required:!0,type:"number",error:!!i.errors[a.name],label:t("notification.email.port"),helperText:i.errors[a.name]?.message||" ",disabled:!j})})})}),e.jsx(X,{title:t("notification.email.user"),children:e.jsx(Y,{name:"user",control:p,rules:{validate:j?K:C},render:({field:a})=>e.jsx(V,{fullWidth:!0,children:e.jsx(Z,{...a,size:"small",required:!0,error:!!i.errors[a.name],label:t("notification.email.user"),helperText:i.errors[a.name]?.message||" ",disabled:!j})})})}),e.jsx(X,{title:t("notification.email.password"),children:e.jsx(Y,{name:"password",control:p,rules:{validate:j?q:C},render:({field:a})=>e.jsx(V,{fullWidth:!0,children:e.jsx(Z,{...a,size:"small",required:!0,type:"password",error:!!i.errors[a.name],label:t("notification.email.password"),helperText:i.errors[a.name]?.message||" ",disabled:!j})})})}),e.jsx(X,{title:t("notification.email.secure"),children:e.jsx(Y,{name:"secure",control:p,rules:{validate:C},render:({field:a})=>e.jsx(V,{fullWidth:!0,children:e.jsx(me,{control:e.jsx(Ke,{checked:a.value,...a,disabled:!j})})})})}),e.jsxs(ln,{children:[e.jsxs(cn,{expandIcon:e.jsx(Kt,{fontSize:"small"}),"aria-controls":"panel1-content",id:"panel1-header",children:[t("notification.email.signature"),e.jsx(ut,{title:t("notification.email.signatureTooltip"),children:e.jsx(Bt,{fontSize:"small",sx:{ml:1,cursor:"help"}})})]}),e.jsxs(dn,{children:[e.jsx(X,{title:t("notification.email.companyName"),children:e.jsx(Y,{name:"companyName",control:p,rules:{validate:C},render:({field:a})=>e.jsx(V,{fullWidth:!0,children:e.jsx(Z,{...a,size:"small",error:!!i.errors[a.name],label:t("notification.email.companyName"),helperText:i.errors[a.name]?.message||" ",disabled:!j})})})}),e.jsx(X,{title:t("notification.email.companyLink"),children:e.jsx(Y,{name:"companyLink",control:p,rules:{validate:j?f:C},render:({field:a})=>e.jsx(V,{fullWidth:!0,children:e.jsx(Z,{...a,size:"small",error:!!i.errors[a.name],label:t("notification.email.companyLink"),helperText:i.errors[a.name]?.message||" ",disabled:!j})})})}),e.jsx(X,{title:t("notification.email.companyAddress"),children:e.jsx(Y,{name:"companyAddress",control:p,rules:{validate:C},render:({field:a})=>e.jsx(V,{fullWidth:!0,children:e.jsx(Z,{...a,size:"small",error:!!i.errors[a.name],label:t("notification.email.companyAddress"),helperText:i.errors[a.name]?.message||" ",disabled:!j})})})}),e.jsx(X,{title:t("notification.email.supportEmail"),children:e.jsx(Y,{name:"supportEmail",control:p,rules:{validate:j?R:C},render:({field:a})=>e.jsx(V,{fullWidth:!0,children:e.jsx(Z,{...a,size:"small",type:"email",error:!!i.errors[a.name],label:t("notification.email.supportEmail"),helperText:i.errors[a.name]?.message||" ",disabled:!j})})})})]})]}),e.jsxs(y,{sx:{display:"flex",justifyContent:"flex-end",gap:2,mt:3},children:[e.jsx(ce,{variant:"outlined",color:"warning",onClick:u(z),disabled:!j,children:t("oauth.runTest")}),e.jsx(ce,{type:"submit",variant:"contained",disabled:!i.isDirty,children:t("oauth.save")})]})]}),o]})}const In=ae(mt)``,We={enabled:!1,endpoint:"",did:void 0,pushPath:void 0};function En(){const{api:n}=Ye(),{blocklet:s}=Ct(),{t}=te(),{confirmApi:r,confirmHolder:o}=wt(),l=s?.meta?.did,b=Object.assign({...We},s?.settings?.notification?.pushKit||{}),{handleSubmit:u,control:p,formState:i,watch:N,reset:I}=Rt({defaultValues:gt(b,Object.keys(We))}),S=ye({testReceiver:"",testReceiverError:""}),j=N("enabled"),E=$(async(w,K,q=!0)=>{try{const{blocklet:f}=await n.configNotification({input:{did:l,notification:JSON.stringify({pushKit:w})}}),R=Object.assign({...We},f?.settings?.notification?.pushKit||{});I(R),q&&M.success(t("oauth.saveSuccess"))}catch(f){if(q)M.error(f.message||t("oauth.saveFailed"));else throw f}}),G=$(async(w,K)=>{try{i.isDirty&&await E(w,K,!1);const q=(s?.configs||[]).find(C=>C.key==="BLOCKLET_APP_URL")?.value,f=Xt(Zt(q,_.WELLKNOWN_SERVICE_PATH_PREFIX,"/blocklet/logo"),{v:s?.meta?.version,t:new Date(s?.updatedAt||0).getTime()}),R={type:"passthrough",passthroughType:"messageStatus",data:{message:{title:"Test push-kit notification",body:"This is message from push-kit config test",sender:{did:s?.appDid,fullName:s?.meta?.title,avatar:f}}}};await n.sendPush({input:{did:l,receiver:S.testReceiver,notification:JSON.stringify(R)}}),M.success(t("notification.pushKit.testSuccess"))}catch(q){M.error(q.message||t("notification.pushKit.testfailed"))}}),z=$((w,K)=>{S.testReceiverError="",r.open({title:t("notification.pushKit.testSend"),content:()=>e.jsx(y,{sx:{width:"450px",maxWidth:"100%"},children:e.jsx(Z,{sx:{mt:1},fullWidth:!0,name:"testReceiver",label:t("notification.pushKit.inputTestReceiver"),value:S.testReceiver,onChange:q=>{S.testReceiver=q.target.value},error:!!S.testReceiverError,helperText:S.testReceiverError||" "})}),confirmButtonText:t("common.confirm"),cancelButtonText:t("common.cancel"),async onConfirm(q){if(!S.testReceiver?.trim()){S.testReceiverError=t("notification.pushKit.receiverRequired");return}S.testReceiverError="",await G(w,K),q()}})}),F=$(w=>{const K=w?.trim();return K?He(K)?!0:t("notification.pushKit.endpointInvalid"):t("notification.pushKit.endpointRequired")}),B=$(()=>!0);return e.jsxs(y,{children:[e.jsxs(kn,{component:"form",onSubmit:u(E),disabled:!0,sx:{".section-left":{width:"160px"}},children:[e.jsx(X,{title:t("notification.pushKit.enable"),my:2.5,children:e.jsx(Y,{name:"enabled",control:p,render:({field:w})=>e.jsx(me,{control:e.jsx(Ke,{checked:w.value,...w})})})}),e.jsx(X,{title:t("notification.pushKit.endpoint"),children:e.jsx(Y,{name:"endpoint",control:p,rules:{validate:j?F:B},render:({field:w})=>e.jsx(V,{fullWidth:!0,children:e.jsx(Z,{...w,size:"small",required:!0,label:t("notification.pushKit.endpoint"),error:!!i.errors[w.name],helperText:i.errors[w.name]?.message||" ",disabled:!j})})})}),e.jsxs(X,{title:t("notification.pushKit.customOptions"),children:[e.jsx(Y,{name:"did",control:p,render:({field:w})=>e.jsx(V,{fullWidth:!0,children:e.jsx(Z,{...w,size:"small",label:t("notification.pushKit.did"),error:!!i.errors[w.name],helperText:i.errors[w.name]?.message||" ",disabled:!j})})}),e.jsx(Y,{name:"pushPath",control:p,render:({field:w})=>e.jsx(V,{fullWidth:!0,children:e.jsx(Z,{...w,size:"small",label:t("notification.pushKit.pushPath"),error:!!i.errors[w.name],helperText:i.errors[w.name]?.message||" ",disabled:!j})})})]}),e.jsxs(y,{sx:{display:"flex",justifyContent:"flex-end",gap:2,mt:3},children:[e.jsx(ce,{variant:"outlined",color:"warning",onClick:u(z),disabled:!j,children:t("oauth.runTest")}),e.jsx(ce,{type:"submit",variant:"contained",disabled:!i.isDirty,children:t("oauth.save")})]})]}),o]})}const kn=ae(mt)``,ct=[{label:e.jsx(y,{sx:{textAlign:"center",width:"100%"},children:"Email"}),value:"email"},{label:e.jsx(y,{sx:{textAlign:"center",width:"100%"},children:"Push Kit"}),value:"pushKit"}];function An(){const[n,s]=v.useState(ct[0].value),{locale:t}=v.useContext(en),r=se(()=>({email:e.jsx(Nn,{}),pushKit:e.jsx(En,{})}),[t]),o=v.useMemo(()=>({padding:"10px 0"}),[]);return e.jsxs(y,{children:[e.jsx(bt,{tabs:ct,current:n,onChange:s}),e.jsx(y,{style:o,children:r[n]})]})}const kt=v.createContext({}),{Provider:On,Consumer:Ws}=kt;function Dn({children:n,blocklet:s=""}){const{api:t,inService:r,ws:{useSubscription:o}}=Ye(),[l,b]=v.useState([]),[u,p]=v.useState({total:0,pageSize:20,pageCount:0,page:1}),i=se(()=>s.meta?.did,[s]),[N,I]=v.useState([]),[S,j]=v.useState({}),E=se(()=>l.length?new Set(l.map(f=>f.id)):new Set,[l]),G=async({page:f=1,pageSize:R=20,...C}={})=>{if(!i)return[];try{const a={paging:{page:f,pageSize:R},...C,teamDid:i,dateRange:C.dateRange?[Q(C.dateRange[0]).toISOString(),Q(C.dateRange[1]).toISOString()]:void 0},{dids:T,...O}=a;let D="";T&&T.includes("system")&&(D="system");const re=T?T.filter(pe=>pe!=="system"):[],ue={...O,source:D,componentDids:re},oe=await t.getNotificationSendLog({input:ue});return j(ue),b(oe.list),p(oe.paging),oe.list}catch(a){return M.error(a.message),[]}},z=async()=>{const f=await t.getNotificationComponents({input:{teamDid:i}});I(f.componentDids)},F=v.useCallback(f=>{const R=s.children.find(C=>C.meta?.did===f);if(R)return R.ancestors=[s],R},[s]),B=async({notificationId:f,receivers:R,channels:C,...a})=>{await t.resendNotification({input:{teamDid:i,notificationId:f,receivers:R,channels:C.map(T=>T==="wallet"?_.NOTIFICATION_SEND_CHANNEL.WALLET:T==="pushKit"?_.NOTIFICATION_SEND_CHANNEL.PUSH:T),...a}})},w=v.useCallback(async f=>(await t.getUser({input:{teamDid:i,user:{did:f},options:{enableConnectedAccount:!0}}})).user,[t,i]),K=v.useCallback(async({page:f=1,pageSize:R=20,...C}={})=>{try{const a={paging:{page:f,pageSize:R},...C,userName:C.searchText||"",teamDid:i,dateRange:C.dateRange?[Q(C.dateRange[0]).toISOString(),Q(C.dateRange[1]).toISOString()]:void 0};return await t.getReceivers({input:a})}catch(a){throw M.error(a.message),a}},[t,i]);v.useEffect(()=>{i&&z()},[i]),o(_.EVENTS.NOTIFICATION_BLOCKLET_UPDATE,f=>{E.has(f.notificationId)&&G(S)},[E,S]),o(_.EVENTS.NOTIFICATION_BLOCKLET_CREATE,f=>{E.has(f.id)||G(S)},[E,S]);const q={fetch:G,data:l,paging:u,blocklet:s,getComponent:F,resendNotification:B,getUser:w,componentDids:N,getReceivers:K,inService:r,teamDid:i};return e.jsx(On,{value:{notificationRecords:q},children:n})}function Xe(){const{notificationRecords:n}=v.useContext(kt);return n}Ce.propTypes={severity:h.oneOf(Object.values(["info","success","error","warning"])).isRequired};const Ln={info:"primary",success:"success",error:"error",warning:"warning"};function Ce({severity:n="info"}){return e.jsx(tn,{type:Ln[n],children:n})}const Pn=(n,s,t="")=>{if(!t||!s)return"";switch(t){case _.NOTIFICATION_SEND_FAILED_REASON.USER_DISABLED:return n("notification.sendStatus.reason.disabled",{channel:s});case _.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_UNAVAILABLE:return n("notification.sendStatus.reason.unavailable",{channel:s});case _.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_DISABLED:return n("notification.sendStatus.reason.notSent",{channel:s});case _.NOTIFICATION_SEND_FAILED_REASON.NOT_ONLINE:return n("notification.sendStatus.reason.offline");default:return t}};function At(n,s,t={}){const{status:r,updatedAt:o,reason:l="",channel:b="wallet"}=t,u=o?n("notification.sendStatus.sentTime",{date:on(o,s)}):"",p=Pn(n,b,l);return r===_.NOTIFICATION_SEND_STATUS.FAILED?{status:"failed",title:n("notification.sendStatus.failed"),sentTime:u,reason:p}:r===_.NOTIFICATION_SEND_STATUS.SENT?{status:"success",title:n("notification.sendStatus.success"),sentTime:u}:{status:"pending",title:n("notification.sendStatus.pending"),reason:p,sentTime:u}}const $e={pending:"#aaaaaa",success:"#34BE74",failed:"#D0021B"},Ve=["wallet","pushKit","email"],dt=["info","success","error","warning"],Ot=n=>{const{settings:s}=n;return s?.notification?.email?.enabled},Dt=n=>{const{settings:s}=n;return s?.notification?.pushKit?.enabled},Fn=(n,s)=>{const t=le(s,"extra.notifications.email",!0);return{available:Ot(n),enabled:t}},_n=(n,s)=>{const t=le(s,"extra.notifications.push",!0);return{available:Dt(n),enabled:t}},zn=n=>({enabled:le(n,"extra.notifications.wallet",!0)}),Wn=n=>({enabled:le(n,"extra.webhooks",[]).length>0}),Ee=(n=3)=>new Promise(s=>{setTimeout(()=>{s()},n*1e3)}),Bn=(n,s)=>s==="wallet"||s==="webhook"?[{channel:s,type:"enabled",pass:n("notification.sendStatus.reason.enabled",{channel:s}),fail:n("notification.sendStatus.reason.disabled",{channel:s})}]:s==="pushKit"||s==="email"?[{channel:s,type:"available",pass:n("notification.sendStatus.reason.available",{channel:s}),fail:n("notification.sendStatus.reason.unavailable",{channel:s})},{channel:s,type:"enabled",pass:n("notification.sendStatus.reason.enabled",{channel:s}),fail:n("notification.sendStatus.reason.disabled",{channel:s})}]:[],ke=(n=[])=>{const s=Q().startOf("day");return n.filter(t=>Q(t.sendAt).isSame(s,"day")).length},Kn=(n,s="")=>{if(s&&Ve.includes(s)){const l=`${s}SendRecord`,b=le(n,l,[]);return ke(b)}const t=le(n,"webhook",{}),r=Object.keys(t??{})??[];if(s&&r.includes(s)){const l=t[s]??[];return ke(l)}const o={};return Ve.forEach(l=>{const b=`${l}SendRecord`,u=le(n,b,[]),p=ke(u);o[l]=p}),r.length>0&&r.forEach(l=>{const b=t[l]??[],u=ke(b);o[l]=u}),o},Oe=(n,s,t)=>{if(!Array.isArray(n))throw new Error("Invalid filterList or index");return n[t].splice(s,1),n},De=(n,s)=>{if(!Array.isArray(s))throw new Error("filters must be an array");return s.length?!s.includes(n):!1},qn=n=>{switch(n){case _.NOTIFICATION_SEND_CHANNEL.WALLET:return"Wallet";case _.NOTIFICATION_SEND_CHANNEL.PUSH:return"Push Kit";case _.NOTIFICATION_SEND_CHANNEL.EMAIL:return"Email";case _.NOTIFICATION_SEND_CHANNEL.WEBHOOK:return"Webhook";default:return""}},Lt=()=>({components:{MUIDataTableFilter:{styleOverrides:{header:{marginBottom:0,p:{margin:0}},root:{"& .MuiGrid-container":{marginTop:0,"& .MuiGrid-item":{paddingTop:0}}}}},MuiPopover:{styleOverrides:{root:{"&.MuiPopover-root":{"& .MuiPaper-root:has(.filter-container)":{width:"420px"}}}}}}});function de({config:n,enableTooltip:s=!0,showTitle:t=!1,children:r=null}){const{status:o,title:l="",sentTime:b="",reason:u=""}=n,p=[l,u].filter(Boolean).join(", ");return e.jsx(ut,{title:s?e.jsxs(e.Fragment,{children:[e.jsx(ee,{color:"inherit",sx:{fontSize:12},children:p}),e.jsx("span",{children:b})]}):null,arrow:!0,placement:"top",children:e.jsxs(y,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsxs(y,{sx:{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center"},children:[e.jsx(y,{style:{opacity:.15},sx:{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:$e[o]}}),e.jsx(y,{sx:{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:$e[o]}})]}),e.jsx(ee,{color:"inherit",sx:{fontSize:12},children:t?l:r})]})})}de.propTypes={config:h.object.isRequired,enableTooltip:h.bool,showTitle:h.bool,children:h.node};Le.propTypes={list:h.array.isRequired,label:h.string.isRequired,onDelete:h.func};function Le({list:n,label:s,onDelete:t=()=>{}}){const{t:r,locale:o}=te();return e.jsxs(y,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsxs(ee,{children:[s,": "]}),n.map(l=>{const b=At(r,o,{status:l});return e.jsx(Ge,{size:"small",label:e.jsx(y,{sx:{display:"flex",alignItems:"center",gap:"4px"},children:e.jsx(de,{config:b,enableTooltip:!1,children:b.title})}),onDelete:u=>t(u,l)},l)})]})}Ze.propTypes={filterList:h.array.isRequired,onChange:h.func.isRequired,index:h.number.isRequired,column:h.object.isRequired,filterValues:h.array.isRequired,label:h.string.isRequired,renderLabel:h.func.isRequired};function Ze({filterList:n,onChange:s,index:t,column:r,filterValues:o,label:l,renderLabel:b}){return e.jsxs(V,{className:"filter-container",children:[e.jsx(pt,{component:"legend",children:l}),e.jsx(qe,{row:!0,children:o.map(u=>e.jsx(me,{control:e.jsx(Me,{checked:n[t].indexOf(u.value??u)>-1,onChange:p=>{const i=[...n];p.target.checked?i[t]=[...i[t],u.value??u]:i[t]=i[t].filter(N=>N!==(u.value??u)),s(i[t],t,r)},name:u.value??u}),label:e.jsx("span",{style:{display:"flex",alignItems:"center"},children:b(u)})},u.value??u))})]})}function Be(n){return e.jsx(Ze,{...n,renderLabel:s=>e.jsx(de,{enableTooltip:!1,config:{status:s.status},children:s.label})})}xe.propTypes={status:h.number.isRequired,updatedAt:h.string.isRequired,reason:h.string,channel:h.string,onResend:h.func};function xe({status:n,updatedAt:s,reason:t="",channel:r="wallet",onResend:o}){const{t:l,locale:b}=te(),u=At(l,b,{status:n,updatedAt:s,reason:t,channel:r});return e.jsxs(y,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(de,{config:u,showTitle:!0}),u.status!=="success"&&e.jsx(Fe,{className:"resend-btn",size:"small",startIcon:e.jsx(Je,{}),sx:{fontSize:12,color:"rgba(0, 0, 0, 0.87)",fontWeight:400,".MuiButton-startIcon":{mr:"2px"}},onClick:o,children:l("notification.resend")})]})}Qe.propTypes={value:h.array.isRequired,onChange:h.func};function Qe({value:n,onChange:s}){const{locale:t}=te(),r=Q().toDate(),[o,l]=v.useState(null),b=v.useCallback(i=>{l(o?null:i.currentTarget)},[o]),u=!!o,p=v.useCallback(i=>{if(!i.startDate||!i.endDate){M.error("Please select a date range");return}if(Q(i.startDate).isAfter(i.endDate)||!Q(i.startDate).isValid()||!Q(i.endDate).isValid()){M.error("Invalid date range");return}s([i.startDate,i.endDate]),l(null)},[s]);return e.jsxs("div",{children:[e.jsx(ee,{component:"div",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},sx:{mb:0},children:e.jsxs(Fe,{onClick:b,variant:"outlined",size:"small",color:"inherit",children:[at(n[0],t)," - ",at(n[1],t)]})}),e.jsx(Ue,{open:u,anchorEl:o,onClose:()=>{l(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:e.jsx(jn,{open:!0,maxDate:r,initialDateRange:{startDate:n[0],endDate:n[1]},toggle:b,definedRanges:vn(r),onChange:p})})]})}et.propTypes={itemComponent:h.elementType.isRequired};function et({itemComponent:n,...s}){const{t}=te();return!s?.filterList?.filter(o=>o.length).length?null:e.jsxs(y,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsx("div",{className:"toolbar-filter-title",children:t("notification.filter")}),e.jsx("div",{className:"toolbar-filter-content",children:e.jsx(nn.TableFilterList,{...s,ItemComponent:n})})]})}function tt({label:n,onDelete:s,canDelete:t=()=>!0,...r}){const o=s&&typeof s=="function"?s:void 0;let l=!0;return t&&typeof t=="function"&&(l=t({label:n,...r})),e.jsx(Ge,{label:n,variant:"outlined",...o&&l?{onDelete:o}:{}})}tt.propTypes={label:h.string.isRequired,onDelete:h.func,canDelete:h.func};const Mn=[{label:"Wallet",value:"app",checked:!0},{label:"Email",value:"email",checked:!0},{label:"Push Kit",value:"push",checked:!0},{label:"Webhook",value:"webhook",checked:!0}];Pt.propTypes={loading:h.bool,onCancel:h.func,onConfirm:h.func};function Pt({loading:n=!1,onCancel:s=()=>{},onConfirm:t=()=>{}}){const{t:r}=te(),[o,l]=v.useState(Mn),[b,u]=v.useState(!0),p=(N,I)=>{I.checked=N.target.checked;const S=o.map(j=>({...j,checked:j.value===I.value?I.checked:j.checked}));l(S)},i=N=>{N.stopPropagation(),t({channels:o.filter(I=>I.checked).map(I=>I.value),isResendFailedOnly:b})};return e.jsxs(y,{className:"resend-config",sx:{padding:"16px 24px"},children:[e.jsx(ee,{variant:"body1",component:"div",className:"check-title",sx:{fontWeight:700,mb:1},children:r("notification.config")}),e.jsx(y,{className:"choose-channel",children:e.jsxs(V,{component:"fieldset",variant:"standard",children:[e.jsx(pt,{component:"legend",children:r("notification.selectChannels")}),e.jsx(qe,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:1},children:o.map(N=>e.jsx(me,{control:e.jsx(Me,{checked:N.checked,onChange:I=>p(I,N),name:N.value}),label:N.label},N.value))})]})}),e.jsx(y,{className:"resend-config-footer",children:e.jsx(qe,{children:e.jsx(me,{control:e.jsx(Me,{checked:b,onChange:N=>u(N.target.checked)}),label:r("notification.resendFailedOnly")})})}),e.jsxs(y,{className:"resend-config-footer-tip",sx:{display:"flex",justifyContent:"flex-end",gap:1},children:[e.jsx(Fe,{onClick:N=>{N.stopPropagation(),s()},color:"inherit",children:r("common.cancel")}),e.jsxs(Fe,{onClick:i,color:"primary",disabled:n,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[n&&e.jsx(ft,{size:16}),r("common.confirm")]})]})]})}Ft.propTypes={notificationId:h.string.isRequired,handleResend:h.func,resending:h.bool};function Ft({notificationId:n,handleResend:s,resending:t=!1}){const{t:r,locale:o}=te(),l=ht(),b=v.useMemo(()=>jt(l,Lt()),[l]),{getReceivers:u,inService:p,teamDid:i,getUser:N,blocklet:I}=Xe(),[S,j]=v.useState(!1),[E,G]=v.useState([]),z=ye({anchorEl:null,position:null}),F=ye({anchorEl:null,position:null}),[B,w]=v.useState(null),[K,q]=v.useState({total:0,pageSize:10,pageCount:0,page:1}),[f,R]=v.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[Q().subtract(1,"month").startOf("day").toDate(),Q().endOf("day").toDate()]}),[C,a]=v.useState([]),T=[{label:r("notification.sendStatus.pending"),value:0,status:"pending"},{label:r("notification.sendStatus.success"),value:1,status:"success"},{label:r("notification.sendStatus.failed"),value:2,status:"failed"}],O=async()=>{if(!S&&n)try{j(!0);const c=await u({notificationId:n,...f}),d=c.list.map(m=>({...m,receiverUser:{...m.receiverUser,avatar:It(m.receiverUser.avatar,i,p)}}));G(d),q(c.paging),j(!1)}catch(c){M.error(c.message),j(!1)}};v.useEffect(()=>{O()},[f]);const D=c=>{c.stopPropagation();const d=c.currentTarget;F.anchorEl=d;const m=d.getBoundingClientRect();F.position={top:m.top+window.scrollY,left:m.left+window.scrollX}},re=c=>c.data.length?e.jsx("div",{style:{display:"flex",alignItems:"center",padding:"10px"},children:e.jsx(ce,{className:"resend-btn",size:"small",color:"primary",variant:"contained",startIcon:e.jsx(Je,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:D,children:r("notification.resend")})}):null,ue={sort:!1,download:!1,print:!1,selectableRows:"multiple",searchPlaceholder:r("common.search"),searchAlwaysOpen:!1,filterType:"checkbox",searchDebounceTime:300,page:K.page-1,rowsPerPage:K.pageSize,count:K.total,searchText:f.searchText,tableBodyMaxHeight:"calc(80vh - 260px)",rowsSelected:C,onRowSelectionChange:(c,d)=>{a(d.map(m=>m.dataIndex))},customToolbarSelect:re},oe=({page:c,rowsPerPage:d,searchText:m,filterList:A})=>{const[,U=[],ne=[],J=[]]=A;f.pageSize!==d?R(H=>({...H,pageSize:d,page:1})):f.page!==c+1?R(H=>({...H,page:c+1})):f.searchText!==m?R(H=>({...H,searchText:m,page:1})):je(U,f.walletSendStatus)?je(ne,f.pushKitSendStatus)?je(J,f.emailSendStatus)||R(H=>({...H,emailSendStatus:J,page:1})):R(H=>({...H,pushKitSendStatus:ne,page:1})):R(H=>({...H,walletSendStatus:U,page:1}))},pe=v.useCallback(async(c,d)=>{if(!d)return!1;const m=await N(d);return m?c==="wallet"?zn(m):c==="email"?Fn(I,m):c==="pushKit"?_n(I,m):c==="webhook"?Wn(m):!0:!1},[N,I]),we=v.useCallback(c=>Bn(r,c),[r]),fe=()=>{z.anchorEl=null,z.position=null,w(null)},he=()=>{F.anchorEl=null,F.position=null},g=async(c,d,m=!0,A="")=>{if(!(!d.length||!c.length))try{s(c,d,m,A),F.anchorEl||(await Ee(.5),fe())}catch(U){console.error("handleResend error",{error:U})}},x=async({channels:c,isResendFailedOnly:d})=>{const m=C.map(A=>E[A].receiver);await g(c,m,d),await Ee(.5),he(),a([])},k=async(c,d=[],m=!0)=>{try{await g(["webhook"],[c.receiver],m,d)}catch(A){M.error(A.response?A.response.statusText:A.message)}},L=async(c,d,m,A=[],U=!0)=>{if(c.stopPropagation(),Kn(d,m)>=4){M.warning(r("notification.resendLimit"));return}if(!Ve.includes(m)){await k(d,A,U);return}if(c){const J=c.currentTarget,H=J.getBoundingClientRect();z.anchorEl=J,z.position={top:H.top+window.scrollY,left:H.left+window.scrollX}}w({channel:m});try{const J=await pe(m,d.receiver);await Ee(1),w({channel:m,result:J}),(typeof J=="boolean"&&J||Qt(J)&&Object.values(J).every(H=>!!H))&&(await s([m],[d.receiver],U),F.anchorEl||(await Ee(.5),fe()))}catch(J){M.error(J.message)}},W=c=>{R(d=>({...d,dateRange:c,page:1}))},P=(c,d,m,A)=>{c.stopPropagation();const U=m.filter(ne=>ne!==d);R(ne=>({...ne,[A]:U,page:1}))},ie=se(()=>[{label:r("notification.receiver"),name:"receiver",width:200,options:{filter:!1,customBodyRenderLite:c=>{const{receiverUser:d,receiver:m}=E[c];return d?e.jsxs(y,{"data-cy":`member-name-${d.fullName}`,sx:{display:"flex",alignItems:"center",gap:1,justifyContent:"flex-start"},children:[e.jsx(vt,{src:`${d.avatar}?imageFilter=resize&w=48&h=48`,size:32,did:m,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),e.jsx(Se,{children:d.fullName})]},m):e.jsx(bn,{size:14,responsive:!1,compact:!0,copyable:!1,did:m})}}},{label:"Wallet",name:"walletSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),filter:!0,filterType:"custom",filterList:f.walletSendStatus??[],customFilterListOptions:{render:c=>e.jsx(Le,{list:c,label:"Wallet",onDelete:(d,m)=>{d.stopPropagation(),P(d,m,ie[1].options.filterList,"walletSendStatus")}}),update:Oe},filterOptions:{names:T,fullWidth:!0,logic:De,display:(c,d,m,A)=>e.jsx(Be,{label:"Wallet",filterList:c,onChange:d,index:m,column:A,filterValues:T})},customBodyRenderLite:c=>{const{walletSendStatus:d,walletSendAt:m,walletSendFailedReason:A}=E[c];return e.jsx(xe,{status:d,updatedAt:m,reason:A,channel:"wallet",onResend:U=>L(U,E[c],"wallet",[],!1)})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:c=>{const{pushKitSendStatus:d,pushKitSendAt:m,pushKitSendFailedReason:A}=E[c];return e.jsx(xe,{status:d,updatedAt:m,reason:A,channel:"pushkit",onResend:U=>L(U,E[c],"pushKit",[],!1)})},filter:!0,filterType:"custom",filterList:f.pushKitSendStatus??[],customFilterListOptions:{render:c=>e.jsx(Le,{list:c,label:"Push Kit",onDelete:(d,m)=>{d.stopPropagation(),P(d,m,ie[2].options.filterList,"pushKitSendStatus")}}),update:Oe},filterOptions:{names:T,fullWidth:!0,logic:De,display:(c,d,m,A)=>e.jsx(Be,{label:"Push Kit",filterList:c,onChange:d,index:m,column:A,filterValues:T})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:c=>{const{emailSendStatus:d,emailSendAt:m,emailSendFailedReason:A}=E[c];return e.jsx(xe,{status:d,updatedAt:m,reason:A,channel:"email",onResend:U=>L(U,E[c],"email",[],!1)})},filter:!0,filterType:"custom",filterList:f.emailSendStatus??[],customFilterListOptions:{render:c=>e.jsx(Le,{list:c,label:"Email",onDelete:(d,m)=>{d.stopPropagation(),P(d,m,ie[3].options.filterList,"emailSendStatus")}}),update:Oe},filterOptions:{names:T,fullWidth:!0,logic:De,display:(c,d,m,A)=>e.jsx(Be,{label:"Email",filterList:c,onChange:d,index:m,column:A,filterValues:T})}}},{label:"Webhook",name:"webhook",width:200,options:{filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:c=>{const{webhook:d}=E[c];if(!d)return null;const m=Object.entries(d)[0];if(!m)return null;const[A,U]=m,ne=U[0];return e.jsx(y,{sx:{display:"flex",flexDirection:"column",gap:1},children:e.jsxs(y,{className:"webhook-item",sx:{fontSize:12},children:[e.jsx(Se,{maxLength:30,children:A},A),e.jsx(xe,{status:ne.status,updatedAt:ne.sendAt,reason:ne.failedReason,channel:"webhook",onResend:J=>L(J,E[c],"webhook",[A],!1)})]},A)})}}},{label:r("common.createdAt"),name:"createdAt",width:100,options:{filter:!1,customBodyRenderLite:c=>{const{createdAt:d}=E[c];return e.jsx(Nt,{value:d,locale:o,shouldUpdate:!0})}}}],[E,o,f,r]),Re=[e.jsx(Qe,{value:f.dateRange,onChange:W},"date-picker"),e.jsx(ce,{variant:"contained",size:"small",color:"primary",loading:S,startIcon:e.jsx(qt,{}),onClick:()=>O(),sx:{".MuiButton-startIcon":{mr:"2px"}},style:{marginLeft:8},children:r("common.refresh")},"refresh")];return e.jsx(y,{sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:e.jsx(Hn,{children:e.jsxs(xt,{theme:b,children:[e.jsx(yt,{className:"receivers-table",locale:o,loading:S,columns:ie,data:E,onChange:oe,options:ue,customButtons:Re,components:{TableFilterList:c=>e.jsx(et,{...c,itemComponent:d=>e.jsx(tt,{...d,canDelete:()=>!1})})}}),z.anchorEl&&e.jsx(Ue,{open:!!z.anchorEl,anchorReference:"anchorPosition",anchorPosition:z.position,onClose:fe,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs($n,{children:[e.jsxs(ee,{variant:"body1",component:"div",className:"check-title",children:[B?.channel," Checking"]}),e.jsx(y,{sx:{display:"flex",flexDirection:"column",gap:"4px"},children:we(B?.channel).map(c=>{const{type:d,pass:m,fail:A}=c;return!B?.result||B?.result?.[d]?e.jsxs(ee,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:B?.result?.[d]?Ae.success.main:"inherit"},children:[B?.result?e.jsx(Mt,{}):e.jsx(ft,{size:12,sx:{color:Ae.primary.main}}),e.jsx("span",{children:m})]},d):e.jsxs(ee,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:Ae.error.main},children:[e.jsx(Ut,{}),e.jsx("span",{children:A})]},d)})})]})}),F.anchorEl&&e.jsx(Ue,{open:!!F.anchorEl,anchorReference:"anchorPosition",anchorPosition:F.position,onClose:he,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsx(Pt,{loading:t,onCancel:he,onConfirm:x})})]})})})}const Un=v.memo(Ft),Hn=ae.div`
|
|
2
2
|
td.MuiTableCell-footer {
|
|
3
3
|
border: none !important;
|
|
4
4
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as a,D as M,T as _,cb as T,Q as W,cc as X,aV as q,ak as h,cd as Y,aU as Z,av as B,f as C,b_ as J,ce as K}from"./vendor-mui-core-CmD-NPnl.js";import{r as d,k as L,L as z,n as ee,o as ae}from"./vendor-react-Dvs43sk9.js";import{H as E,aX as te}from"./index-
|
|
1
|
+
import{j as a,D as M,T as _,cb as T,Q as W,cc as X,aV as q,ak as h,cd as Y,aU as Z,av as B,f as C,b_ as J,ce as K}from"./vendor-mui-core-CmD-NPnl.js";import{r as d,k as L,L as z,n as ee,o as ae}from"./vendor-react-Dvs43sk9.js";import{H as E,aX as te}from"./index-6k6hDX7K.js";import{e as ie}from"./vendor-hooks-DLNZ8kxG.js";import{M as re,l as m,ag as A,ah as S}from"./vendor-ux-ESjuHpb6.js";import{z as oe}from"./vendor-arcblock-C-xQV6LY.js";const H=d.createContext(null),se=e=>{const i=d.use(H);return d.useLayoutEffect(()=>{},[]),i};function le({children:e=void 0,...i}){const[t,r]=d.useState({inFullPage:!1,showToggleButton:!1,headerVisibleInFullPage:!0,footerVisibleInFullPage:!1,sidebarVisibleInFullPage:!1}),s=()=>{r(o=>({...o,inFullPage:!o.inFullPage}))},l=d.useMemo(()=>({...t,headerVisible:!t.inFullPage||t.headerVisibleInFullPage,footerVisible:!t.inFullPage||t.footerVisibleInFullPage,sidebarVisible:!t.inFullPage||t.sidebarVisibleInFullPage,toggleFullPage:s,configure:o=>r(n=>({...n,...o}))}),[t]);return a.jsx(H,{value:l,...i,children:e})}function ne({name:e,size:i=36,alt:t="",color:r="#000000",prefix:s="/images",showBadge:l=!1,style:o={},...n}){const c=`${s}/${e}-${r.replace(/^#/,"")}.png`;return a.jsxs(de,{style:{width:i,height:i},children:[a.jsx(re,{width:i,height:i,alt:t||e,src:c,style:Object.assign({width:i},o),...n}),l&&a.jsx("i",{className:"badge-point"})]})}const de=m("div")`
|
|
2
2
|
position: relative;
|
|
3
3
|
.badge-point {
|
|
4
4
|
position: absolute;
|