@abtnode/blocklet-services 1.17.0-beta-20251105-030013-0c24dbf6 → 1.17.0-beta-20251105-095418-158ab2fa
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/routes/openembed.js +2 -2
- package/api/services/notification/queue.js +2 -1
- package/api/socket/channel/component.js +2 -13
- package/api/socket/channel/did.js +3 -2
- package/dist/assets/{AdapterDayjs-B-b5_b14.js → AdapterDayjs-htke2LNl.js} +1 -1
- package/dist/assets/{Google-CxaAXeb1.js → Google-B9WxJUtm.js} +1 -1
- package/dist/assets/{access-control-C3aWCG0W.js → access-control-DgJq0YVu.js} +1 -1
- package/dist/assets/{add-component-core-CRqEjYc1.js → add-component-core-FPDOn5d-.js} +1 -1
- package/dist/assets/{add-resource-Kud8H4eS.js → add-resource-CAnEMG5A.js} +1 -1
- package/dist/assets/{addon-VZzbFc4Q.js → addon-G4bPvEmK.js} +1 -1
- package/dist/assets/{advanced-DwN5K1Ff.js → advanced-DTlokCHZ.js} +1 -1
- package/dist/assets/{aigne-vtnawws9.js → aigne-BjZDYehb.js} +1 -1
- package/dist/assets/api-Btn0Tp3W.js +1 -0
- package/dist/assets/{appearance-DYn7payW.js → appearance-DCshfg3b.js} +1 -1
- package/dist/assets/{arrow-down.svg-BezS4XZA.js → arrow-down.svg-BoXN8Cjq.js} +1 -1
- package/dist/assets/{audit-logs-ranSELEi.js → audit-logs-Cfw9gRav.js} +1 -1
- package/dist/assets/{authorize-BNjP0AT6.js → authorize-DI1rcoz-.js} +1 -1
- package/dist/assets/{base-chart-CPiuDOeg.js → base-chart-C-Raz4Q-.js} +1 -1
- package/dist/assets/{base32-Cb13w5RY.js → base32-CItnjpyE.js} +1 -1
- package/dist/assets/{bind-account-CjXV1Nno.js → bind-account-VtBGL5sF.js} +1 -1
- package/dist/assets/branding-BYzPtwYl.js +1 -0
- package/dist/assets/{branding-QC85gvgZ.js → branding-Btk6VgyV.js} +1 -1
- package/dist/assets/{branding-yaaSBVab.js → branding-CO3oNUoW.js} +1 -1
- package/dist/assets/{bundle-avatar-4eBexs7E.js → bundle-avatar-BAYDU69t.js} +1 -1
- package/dist/assets/{button-DEB1ikxx.js → button-CkzKmYG4.js} +1 -1
- package/dist/assets/{click-to-copy-D0Tma2zF.js → click-to-copy-CsLNPsrn.js} +1 -1
- package/dist/assets/{cloneDeep-D_w1MBt4.js → cloneDeep-C6qewg0C.js} +1 -1
- package/dist/assets/{complete-DStPKf0Q.js → complete-CbDQw64O.js} +1 -1
- package/dist/assets/{component-CWCG4qb4.js → component-CEmYWuft.js} +27 -27
- package/dist/assets/{config-DdMgBHpi.js → config-CViA6RlS.js} +1 -1
- package/dist/assets/{config-yPiuiId6.js → config-CfREpIK7.js} +4 -4
- package/dist/assets/{config-C7oNdxEU.js → config-D_LUkOvQ.js} +1 -1
- package/dist/assets/{config-navigation-w_sixXn5.js → config-navigation-CVmnq2Za.js} +2 -2
- package/dist/assets/{config-space-CT4_9rp4.js → config-space-BN9fNvaD.js} +1 -1
- package/dist/assets/{confirm-BCfyUWCf.js → confirm--hChwl53.js} +1 -1
- package/dist/assets/{connect-BBC5ABRw.js → connect-BnNTpIRx.js} +1 -1
- package/dist/assets/{connect-BLGYXo3k.js → connect-rjdRHwvZ.js} +1 -1
- package/dist/assets/{connect-to-C7YGs17H.js → connect-to-CNCYeafH.js} +1 -1
- package/dist/assets/{create-passport-svg-CER2V7n5.js → create-passport-svg-BfNP_Pe5.js} +1 -1
- package/dist/assets/{createClass-BTAbWc4O.js → createClass-Dlp37k46.js} +1 -1
- package/dist/assets/{dashboard-D7oMAKNq.js → dashboard-CqmuPBiL.js} +2 -2
- package/dist/assets/{delete-confirm-D-BcbVbX.js → delete-confirm-SqwBqmvx.js} +1 -1
- package/dist/assets/{did-address-CIq-nlk0.js → did-address-C-FrJEjX.js} +1 -1
- package/dist/assets/{domain-CDlbT513.js → domain-B9DVtgww.js} +1 -1
- package/dist/assets/{domain-action-card-CE5CNtpq.js → domain-action-card-DaCaxpEd.js} +1 -1
- package/dist/assets/domains-Dj7ve2R6.js +1 -0
- package/dist/assets/{email-PGVxLLOt.js → email-seqeatFQ.js} +1 -1
- package/dist/assets/engine-vLAk-Yhf.js +1 -0
- package/dist/assets/{exchange-passport-B3E8SgcT.js → exchange-passport-CukrH4JY.js} +1 -1
- package/dist/assets/{form-5Ep-D-hL.js → form-_lqoYi1a.js} +1 -1
- package/dist/assets/{form-text-input-DQaRIPYf.js → form-text-input-BVLvbDRk.js} +1 -1
- package/dist/assets/{fuel-BAcphlwQ.js → fuel-CD3NcrzL.js} +1 -1
- package/dist/assets/{gen-access-key-tmiL6HEK.js → gen-access-key-DDTXd9jQ.js} +1 -1
- package/dist/assets/{gen-simple-access-key-BtZeyFUU.js → gen-simple-access-key-D68oJj6M.js} +1 -1
- package/dist/assets/get-safe-url-7lsBF7fn.js +1 -0
- package/dist/assets/{home-kCW65EFx.js → home-B1gQkqj2.js} +1 -1
- package/dist/assets/{iframe-DXyZAOxC.js → iframe-Rt9N08fO.js} +1 -1
- package/dist/assets/{index-OfvA4Ihw.js → index-7LiseMmY.js} +1 -1
- package/dist/assets/{index-CafgPOrl.js → index-B33z44zS.js} +1 -1
- package/dist/assets/{index-BUUnz9gZ.js → index-BSMmKeb7.js} +1 -1
- package/dist/assets/{index-CRrvw28E.js → index-BUKfqzNn.js} +2 -2
- package/dist/assets/{index-BONnU4i4.js → index-B_8sQ3JF.js} +1 -1
- package/dist/assets/{index-B-kQtv91.js → index-B_p-ZlRg.js} +1 -1
- package/dist/assets/{index-C-_gU_Fe.js → index-BnBCFm-B.js} +1 -1
- package/dist/assets/{index-CWM6CeCJ.js → index-BoFUe2mK.js} +1 -1
- package/dist/assets/index-C5KSScfV.js +62 -0
- package/dist/assets/index-C7rUcEqk.js +281 -0
- package/dist/assets/{index-CvqAqbTY.js → index-CNQwOgkw.js} +129 -131
- package/dist/assets/{index-Cor3Ch2R.js → index-CiL_2yqx.js} +1 -1
- package/dist/assets/{index-CaN6T62E.js → index-Cj0vr9L5.js} +3 -3
- package/dist/assets/{index-BaE8Lb4N.js → index-CoSHRBFV.js} +1 -1
- package/dist/assets/{index-BoYypJBw.js → index-CqfEUbRA.js} +1 -1
- package/dist/assets/{index-BGOAuSiO.js → index-Cy0O7Xbk.js} +1 -1
- package/dist/assets/{index-Cu5G_kkl.js → index-D2pPm2XL.js} +1 -1
- package/dist/assets/{index-C6NMt-mL.js → index-DDcE9RLz.js} +1 -1
- package/dist/assets/{index-BGm4_k5i.js → index-DW2KhjgG.js} +3 -3
- package/dist/assets/{index-DlBn_nkP.js → index-DXAfa2Wy.js} +1 -1
- package/dist/assets/{index-DuUAY6sJ.js → index-DYZ31zFW.js} +1 -1
- package/dist/assets/{index-DwJ0PXgi.js → index-Davx0jNU.js} +1 -1
- package/dist/assets/{index-CNQc5Pv0.js → index-DefuBlsM.js} +3 -3
- package/dist/assets/{index-DWh4QrB6.js → index-Dny0A9QO.js} +1 -1
- package/dist/assets/{index-BBPJehPD.js → index-Dobe7gH8.js} +1 -1
- package/dist/assets/{index-3fEKnvhn.js → index-Dptq3QuB.js} +1 -1
- package/dist/assets/{index-CuHHEyaf.js → index-Dr6wjN6t.js} +1 -1
- package/dist/assets/{index-CPenNsCA.js → index-F6h0q33_.js} +1 -1
- package/dist/assets/{index-BM4g9p9K.js → index-NomqB6Iy.js} +1 -1
- package/dist/assets/{index-Qoz8CAva.js → index-PzyU17RJ.js} +1 -1
- package/dist/assets/{index-CEbaUWs9.js → index-eIIL7Dbu.js} +1 -1
- package/dist/assets/{index-CDeFKxFp.js → index-hNnYH7qN.js} +1 -1
- package/dist/assets/{invitation-Bo7he7gn.js → invitation-DU9TWfqV.js} +1 -1
- package/dist/assets/{invitations-JBUEZ62G.js → invitations-Ba2NPVWc.js} +1 -1
- package/dist/assets/{invite-CDIjLBXY.js → invite-1RHHMgyr.js} +1 -1
- package/dist/assets/{isURL-CwakGHMn.js → isURL-Y0ujM0bz.js} +1 -1
- package/dist/assets/{issue-passport-Bx1Kkdgv.js → issue-passport-BPO1kshR.js} +1 -1
- package/dist/assets/{item-BIsnfFrn.js → item-Bpvmz8Bd.js} +1 -1
- package/dist/assets/{landing-page-Befk8WNO.js → landing-page-BulvnRSe.js} +1 -1
- package/dist/assets/{layout-jQm-DzbI.js → layout-D_C5DhId.js} +1 -1
- package/dist/assets/{list-CGYVFvl-.js → list-D8Zo9p_K.js} +1 -1
- package/dist/assets/{list-DTozzh-_.js → list-DX2LtvWr.js} +1 -1
- package/dist/assets/localization-CEl2BHQ6.js +1 -0
- package/dist/assets/{log-B-igF5Lx.js → log-Dg2GKZXZ.js} +1 -1
- package/dist/assets/logger-DfzQMkJr.js +1 -0
- package/dist/assets/{login-DnEH1TJW.js → login-BTWCRvYJ.js} +1 -1
- package/dist/assets/{login-oauth-callback-D4t1m8CH.js → login-oauth-callback-CDFoJOjd.js} +1 -1
- package/dist/assets/{logo-uploader-BhceTgHW.js → logo-uploader-BpZuvanI.js} +1 -1
- package/dist/assets/{lost-passport-i4tl7Emt.js → lost-passport-B6ybayR_.js} +1 -1
- package/dist/assets/{omit-CigYLGmT.js → omit-hhiOJGRf.js} +1 -1
- package/dist/assets/{open-window-57MP9-Xk.js → open-window-D6kNy2yg.js} +1 -1
- package/dist/assets/{over-due-invoice-payment-ZK0Cmr5s.js → over-due-invoice-payment-CHGvr2Z0.js} +1 -1
- package/dist/assets/{overview-DbZdlDOd.js → overview-BAek0ZGF.js} +1 -1
- package/dist/assets/passport-VSbtMGZD.js +1 -0
- package/dist/assets/{passport-item-ORKJlSS3.js → passport-item-CQosDKrj.js} +1 -1
- package/dist/assets/{permission-CDjTfL1z.js → permission-DRv5lu8C.js} +1 -1
- package/dist/assets/{preferences-COmB9XC_.js → preferences-YCIf2-yU.js} +1 -1
- package/dist/assets/profile-embed-CqWBky7v.js +1 -0
- package/dist/assets/{publish-resource-Dlh13UBC.js → publish-resource-D6Wp3ap3.js} +1 -1
- package/dist/assets/{react-beautiful-dnd.esm-xmMAwjuG.js → react-beautiful-dnd.esm-BpnBYRGA.js} +1 -1
- package/dist/assets/{runtime-DHe0QjJ3.js → runtime-CPW_It_m.js} +1 -1
- package/dist/assets/{sanitize-Bib7lw-G.js → sanitize-BEqBHa8a.js} +1 -1
- package/dist/assets/sdk-FV75eigN.js +1 -0
- package/dist/assets/{security-CfDm5JBm.js → security-BHI66x0I.js} +1 -1
- package/dist/assets/{session-DUnZO0dx.js → session-BHdgPiuA.js} +1 -1
- package/dist/assets/{setup-BF09OVjg.js → setup-BY5-io19.js} +1 -1
- package/dist/assets/{simple-select-DYKnLkk9.js → simple-select-C8Cgeqb3.js} +1 -1
- package/dist/assets/{spaces-BD_IfTnB.js → spaces-D2P0T92S.js} +1 -1
- package/dist/assets/{start-C2pCothU.js → start-H-2gPAoI.js} +1 -1
- package/dist/assets/{starting-progress-j5Gbwbka.js → starting-progress-CFP7GVRR.js} +1 -1
- package/dist/assets/{status-CYWf3uBt.js → status-jLqC3QZb.js} +1 -1
- package/dist/assets/{step-actions-Dbs-BfbR.js → step-actions-Nkx5SefZ.js} +1 -1
- package/dist/assets/{studio-B_wUyHyC.js → studio-BLt_ayp3.js} +1 -1
- package/dist/assets/{switch-control-BUtetd7I.js → switch-control-D0pZJ9KY.js} +1 -1
- package/dist/assets/{table-tips-CS1WAXWA.js → table-tips-CS48YoZT.js} +1 -1
- package/dist/assets/{team-C7pbRoxF.js → team-C5MPkd49.js} +1 -1
- package/dist/assets/{traffic-C6Zltx_D.js → traffic-BiJmK3BW.js} +1 -1
- package/dist/assets/{transfer-EfMEfJCO.js → transfer-DYt9hLKM.js} +1 -1
- package/dist/assets/{unsubscribe-t2-by_s5.js → unsubscribe-C_yXnTRS.js} +1 -1
- package/dist/assets/{use-app-logo-Cn8xa27P.js → use-app-logo-CfvOIvzM.js} +1 -1
- package/dist/assets/{use-window-close-JowHVZZx.js → use-window-close-BdrFSgVx.js} +1 -1
- package/dist/assets/{useAsync-DouUkRB3.js → useAsync-BcVLpt2E.js} +1 -1
- package/dist/assets/{useAsync-BvASW8Y8.js → useAsync-cZ_FPf9k.js} +1 -1
- package/dist/assets/{useAsyncRetry-C8ETjgdm.js → useAsyncRetry-DwwEjrjs.js} +1 -1
- package/dist/assets/{useLocalStorage-DMy4Hcmk.js → useLocalStorage-bqzdy8BQ.js} +1 -1
- package/dist/assets/{user-center-tHuPRrTG.js → user-center-CIAPhQ9z.js} +2 -2
- package/dist/assets/{user-follower-BPuRj5Cd.js → user-follower-D-c0qUho.js} +1 -1
- package/dist/assets/{util-BRJRNQfv.js → util-BX07G81N.js} +1 -1
- package/dist/assets/{util-CZq54ng4.js → util-vP9prM0z.js} +1 -1
- package/dist/assets/{vendor-arcblock-BgUgVGvU.js → vendor-arcblock-DJLIv_Ya.js} +1 -1
- package/dist/assets/{vendor-hooks-OpgB8gyY.js → vendor-hooks-CjESGRlR.js} +1 -1
- package/dist/assets/vendor-utils-cJEl_UEd.js +213 -0
- package/dist/assets/{vendor-ux-CWISwSx6.js → vendor-ux-COKRnqyw.js} +7 -7
- package/dist/assets/{wait-connect-URVrdT7J.js → wait-connect-D0k25Ree.js} +1 -1
- package/dist/assets/{wizard-BnWT5z4g.js → wizard-BRbcz-Dt.js} +1 -1
- package/dist/assets/{wizard-components-DymXOorF.js → wizard-components-DqAvtGJW.js} +1 -1
- package/dist/assets/wrap-locale-CNKsK4k7.js +1 -0
- package/dist/assets/{zh-CfkvICo2.js → zh-D5cerF_C.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/service-worker.js +1 -1
- package/package.json +23 -23
- package/dist/assets/api-BNrHV6cZ.js +0 -1
- package/dist/assets/branding-BEu6Nivw.js +0 -1
- package/dist/assets/domains-CPMJY1aF.js +0 -1
- package/dist/assets/engine-D5u6S-6w.js +0 -1
- package/dist/assets/get-safe-url-BJvKfOW0.js +0 -1
- package/dist/assets/index-BBLMdRjh.js +0 -281
- package/dist/assets/index-C6cUmsAO.js +0 -63
- package/dist/assets/localization-C3RRCpKi.js +0 -1
- package/dist/assets/logger-Hz7uEgBd.js +0 -1
- package/dist/assets/passport-_qL8zXAT.js +0 -1
- package/dist/assets/profile-embed-CYk0Xxk0.js +0 -1
- package/dist/assets/sdk-DP4NQY41.js +0 -1
- package/dist/assets/vendor-utils-ByKYcWuf.js +0 -213
- package/dist/assets/wrap-locale-BkF6rwNU.js +0 -1
|
@@ -1,281 +0,0 @@
|
|
|
1
|
-
import{r as k,t as ao,e as io}from"./vendor-react-Dvs43sk9.js";import{j as o,W as w,D as yn,U as lo,aj as Lr,ak as I,B as co,dT as Rt,O as uo,ai as fo,bV as po,n as Pr,dU as Ir,bW as xt,bc as kt,c0 as mo,z as Ie,aN as ho,Q as Ae,b6 as vn,J as go,Y as bo,bC as xo,$ as yo,R as vo,bD as _t,T as ye,aI as Ar,cb as Ue,a3 as jo,I as it,dV as Co,dW as wo,aX as _e,y as cn,x as dn,M as St,a6 as We,at as he,bq as ko,br as So,am as Lt,b_ as Yn,P as Lo,bX as Po,dM as Io,aO as Ao,aP as To,dX as Eo,dt as Ro,bT as _o,dY as Oo,a5 as Mo}from"./vendor-mui-core-CnXrAOs3.js";import{B as Gn,U as No,au as Do,e as un,K as $o,av as Bo,n as Pt,C as Fo,a as zo}from"./vendor-utils-ByKYcWuf.js";import{a6 as Tr,O as Uo,V as J,H as oe,o as Er,b as ve,j as Rr,$ as Wo,e as qo,n as ae,p as Ot,U as Ho,k as Ko,z as fn,a2 as Yo,h as Go}from"./vendor-ux-CWISwSx6.js";import{B as Vo,b as jn,g as Ye,t as _r,e as Or,D as Zo,c as Xo,h as Qo,a as Jo}from"./vendor-hooks-OpgB8gyY.js";import{B as Mr,o as ea,l as Nr}from"./index-CWM6CeCJ.js";import{aC as ta,c9 as na,cn as ra,_ as de,ci as sa,a3 as pn,o as lt,a1 as Vn,X as oa,v as aa,aM as ia,B as ct,co as la,bU as ca,ac as Dr,c as Oe,b8 as da,a9 as ua,Y as Me,aw as fa,cp as pa}from"./index-CvqAqbTY.js";import{r as ma}from"./index-C6cUmsAO.js";import{v as Zn}from"./index-CPenNsCA.js";import{u as ge}from"./team-C7pbRoxF.js";import{f as le}from"./index-DBs9Ljax.js";import{W as Cn}from"./did-address-CIq-nlk0.js";import{u as De}from"./session-DUnZO0dx.js";import{u as ha,C as nt}from"./index.esm-JPZAjt0x.js";import{S as ga}from"./Google-CxaAXeb1.js";import{P as qe}from"./permission-CDjTfL1z.js";import{C as wn}from"./click-to-copy-D0Tma2zF.js";import{T as $r}from"./index-BBPJehPD.js";import{u as ba}from"./useAsync-DouUkRB3.js";import{v as fe}from"./index-3fEKnvhn.js";import{C as Mt}from"./confirm-BCfyUWCf.js";import{C as Br}from"./revoke.svg-CmffMlcP.js";import{N as xa}from"./index-CEbaUWs9.js";import{i as Fr,a as It,p as zr}from"./util-CZq54ng4.js";import{b as ya}from"./sdk-DP4NQY41.js";import{a as va,U as ja}from"./user-follower-BPuRj5Cd.js";import{I as Ca}from"./invitations-JBUEZ62G.js";import{A as wa}from"./actions-DqoNrBDK.js";import{S as ka}from"./shorten-label-RqvHqcC3.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-BgUgVGvU.js";import"./isURL-CwakGHMn.js";import"./use-app-logo-Cn8xa27P.js";import"./cloneDeep-D_w1MBt4.js";import"./arrow-down.svg-BezS4XZA.js";import"./vendor-mui-x-bJ5idfMH.js";import"./AdapterDayjs-B-b5_b14.js";import"./useAsync-BvASW8Y8.js";import"./base32-Cb13w5RY.js";import"./ua-parser-DP5omx3I.js";import"./use-mobile-maRlSUwU.js";const Ur=e=>k.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",...e},k.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"}),k.createElement("rect",{x:12.5,y:9.375,width:7.5,height:1.875,rx:.9375}),k.createElement("rect",{x:15.3125,y:14.0625,width:7.5,height:1.875,rx:.9375,transform:"rotate(-90 15.3125 14.0625)"})),Wr=e=>k.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",...e},k.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"}),k.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"}),k.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"}),k.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"})),qr=e=>k.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",...e},k.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"}),k.createElement("rect",{x:12.5,y:9.375,width:7.5,height:1.875,rx:.9375})),Sa=e=>k.createElement("svg",{width:18,height:19,viewBox:"0 0 18 19",xmlns:"http://www.w3.org/2000/svg",...e},k.createElement("g",{clipPath:"url(#clip0)"},k.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"})),k.createElement("defs",null,k.createElement("clipPath",{id:"clip0"},k.createElement("rect",{width:18,height:18,transform:"translate(0 0.5)"}))));var Wt={},qt,Xn;function La(){return Xn||(Xn=1,qt=e=>encodeURIComponent(e).replace(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`)),qt}var Ht,Qn;function Pa(){if(Qn)return Ht;Qn=1;var e="%[a-f0-9]{2}",t=new RegExp("("+e+")|([^%]+?)","gi"),n=new RegExp("("+e+")+","gi");function r(a,l){try{return[decodeURIComponent(a.join(""))]}catch{}if(a.length===1)return a;l=l||1;var c=a.slice(0,l),f=a.slice(l);return Array.prototype.concat.call([],r(c),r(f))}function s(a){try{return decodeURIComponent(a)}catch{for(var l=a.match(t)||[],c=1;c<l.length;c++)a=r(l,c).join(""),l=a.match(t)||[];return a}}function i(a){for(var l={"%FE%FF":"��","%FF%FE":"��"},c=n.exec(a);c;){try{l[c[0]]=decodeURIComponent(c[0])}catch{var f=s(c[0]);f!==c[0]&&(l[c[0]]=f)}c=n.exec(a)}l["%C2"]="�";for(var u=Object.keys(l),h=0;h<u.length;h++){var x=u[h];a=a.replace(new RegExp(x,"g"),l[x])}return a}return Ht=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 i(a)}},Ht}var Kt,Jn;function Ia(){return Jn||(Jn=1,Kt=(e,t)=>{if(!(typeof e=="string"&&typeof t=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(t==="")return[e];const n=e.indexOf(t);return n===-1?[e]:[e.slice(0,n),e.slice(n+t.length)]}),Kt}var Yt,er;function Aa(){return er||(er=1,Yt=function(e,t){for(var n={},r=Object.keys(e),s=Array.isArray(t),i=0;i<r.length;i++){var a=r[i],l=e[a];(s?t.indexOf(a)!==-1:t(a,l,e))&&(n[a]=l)}return n}),Yt}var tr;function Ta(){return tr||(tr=1,function(e){const t=La(),n=Pa(),r=Ia(),s=Aa(),i=d=>d==null;function a(d){switch(d.arrayFormat){case"index":return m=>(y,b)=>{const v=y.length;return b===void 0||d.skipNull&&b===null||d.skipEmptyString&&b===""?y:b===null?[...y,[f(m,d),"[",v,"]"].join("")]:[...y,[f(m,d),"[",f(v,d),"]=",f(b,d)].join("")]};case"bracket":return m=>(y,b)=>b===void 0||d.skipNull&&b===null||d.skipEmptyString&&b===""?y:b===null?[...y,[f(m,d),"[]"].join("")]:[...y,[f(m,d),"[]=",f(b,d)].join("")];case"comma":case"separator":return m=>(y,b)=>b==null||b.length===0?y:y.length===0?[[f(m,d),"=",f(b,d)].join("")]:[[y,f(b,d)].join(d.arrayFormatSeparator)];default:return m=>(y,b)=>b===void 0||d.skipNull&&b===null||d.skipEmptyString&&b===""?y:b===null?[...y,f(m,d)]:[...y,[f(m,d),"=",f(b,d)].join("")]}}function l(d){let m;switch(d.arrayFormat){case"index":return(y,b,v)=>{if(m=/\[(\d*)\]$/.exec(y),y=y.replace(/\[\d*\]$/,""),!m){v[y]=b;return}v[y]===void 0&&(v[y]={}),v[y][m[1]]=b};case"bracket":return(y,b,v)=>{if(m=/(\[\])$/.exec(y),y=y.replace(/\[\]$/,""),!m){v[y]=b;return}if(v[y]===void 0){v[y]=[b];return}v[y]=[].concat(v[y],b)};case"comma":case"separator":return(y,b,v)=>{const P=typeof b=="string"&&b.includes(d.arrayFormatSeparator),g=typeof b=="string"&&!P&&u(b,d).includes(d.arrayFormatSeparator);b=g?u(b,d):b;const A=P||g?b.split(d.arrayFormatSeparator).map(T=>u(T,d)):b===null?b:u(b,d);v[y]=A};default:return(y,b,v)=>{if(v[y]===void 0){v[y]=b;return}v[y]=[].concat(v[y],b)}}}function c(d){if(typeof d!="string"||d.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function f(d,m){return m.encode?m.strict?t(d):encodeURIComponent(d):d}function u(d,m){return m.decode?n(d):d}function h(d){return Array.isArray(d)?d.sort():typeof d=="object"?h(Object.keys(d)).sort((m,y)=>Number(m)-Number(y)).map(m=>d[m]):d}function x(d){const m=d.indexOf("#");return m!==-1&&(d=d.slice(0,m)),d}function C(d){let m="";const y=d.indexOf("#");return y!==-1&&(m=d.slice(y)),m}function j(d){d=x(d);const m=d.indexOf("?");return m===-1?"":d.slice(m+1)}function S(d,m){return m.parseNumbers&&!Number.isNaN(Number(d))&&typeof d=="string"&&d.trim()!==""?d=Number(d):m.parseBooleans&&d!==null&&(d.toLowerCase()==="true"||d.toLowerCase()==="false")&&(d=d.toLowerCase()==="true"),d}function p(d,m){m=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},m),c(m.arrayFormatSeparator);const y=l(m),b=Object.create(null);if(typeof d!="string"||(d=d.trim().replace(/^[?#&]/,""),!d))return b;for(const v of d.split("&")){if(v==="")continue;let[P,g]=r(m.decode?v.replace(/\+/g," "):v,"=");g=g===void 0?null:["comma","separator"].includes(m.arrayFormat)?g:u(g,m),y(u(P,m),g,b)}for(const v of Object.keys(b)){const P=b[v];if(typeof P=="object"&&P!==null)for(const g of Object.keys(P))P[g]=S(P[g],m);else b[v]=S(P,m)}return m.sort===!1?b:(m.sort===!0?Object.keys(b).sort():Object.keys(b).sort(m.sort)).reduce((v,P)=>{const g=b[P];return g&&typeof g=="object"&&!Array.isArray(g)?v[P]=h(g):v[P]=g,v},Object.create(null))}e.extract=j,e.parse=p,e.stringify=(d,m)=>{if(!d)return"";m=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},m),c(m.arrayFormatSeparator);const y=g=>m.skipNull&&i(d[g])||m.skipEmptyString&&d[g]==="",b=a(m),v={};for(const g of Object.keys(d))y(g)||(v[g]=d[g]);const P=Object.keys(v);return m.sort!==!1&&P.sort(m.sort),P.map(g=>{const A=d[g];return A===void 0?"":A===null?f(g,m):Array.isArray(A)?A.reduce(b(g),[]).join("&"):f(g,m)+"="+f(A,m)}).filter(g=>g.length>0).join("&")},e.parseUrl=(d,m)=>{m=Object.assign({decode:!0},m);const[y,b]=r(d,"#");return Object.assign({url:y.split("?")[0]||"",query:p(j(d),m)},m&&m.parseFragmentIdentifier&&b?{fragmentIdentifier:u(b,m)}:{})},e.stringifyUrl=(d,m)=>{m=Object.assign({encode:!0,strict:!0},m);const y=x(d.url).split("?")[0]||"",b=e.extract(d.url),v=e.parse(b,{sort:!1}),P=Object.assign(v,d.query);let g=e.stringify(P,m);g&&(g=`?${g}`);let A=C(d.url);return d.fragmentIdentifier&&(A=`#${f(d.fragmentIdentifier,m)}`),`${y}${g}${A}`},e.pick=(d,m,y)=>{y=Object.assign({parseFragmentIdentifier:!0},y);const{url:b,query:v,fragmentIdentifier:P}=e.parseUrl(d,y);return e.stringifyUrl({url:b,query:s(v,m),fragmentIdentifier:P},y)},e.exclude=(d,m,y)=>{const b=Array.isArray(m)?v=>!m.includes(v):(v,P)=>!m(v,P);return e.pick(d,b,y)}}(Wt)),Wt}var Gt=Ta();const rt=ao,Ea={parseNumbers:!1,parseBooleans:!1},Ra={skipNull:!1,skipEmptyString:!1},_a=(e,t)=>{var n,r;const{navigateMode:s="push",parseOptions:i,stringifyOptions:a}={},l=Object.assign(Object.assign({},Ea),i),c=Object.assign(Object.assign({},Ra),a),f=rt.useLocation(),u=(n=rt.useHistory)===null||n===void 0?void 0:n.call(rt),h=(r=rt.useNavigate)===null||r===void 0?void 0:r.call(rt),x=Vo(),C=k.useRef(typeof e=="function"?e():e||{}),j=k.useMemo(()=>Gt.parse(f.search,l),[f.search]),S=k.useMemo(()=>Object.assign(Object.assign({},C.current),j),[j]);return[S,jn(d=>{const m=typeof d=="function"?d(S):d;x(),u&&u[s]({hash:f.hash,search:Gt.stringify(Object.assign(Object.assign({},j),m),c)||"?"},f.state),h&&h({hash:f.hash,search:Gt.stringify(Object.assign(Object.assign({},j),m),c)||"?"},{replace:s==="replace",state:f.state})})]};var Re={},st={},nr;function Oa(){if(nr)return st;nr=1,Object.defineProperty(st,"__esModule",{value:!0}),st.getApplicationWallet=void 0;const e=Tr(),t=ta(),n=Uo(),r=ma(),s={role:e.types.RoleType.ROLE_APPLICATION},i=(a,l,c,f)=>{let u=c||s;const h=(0,n.isEthereumType)((0,n.DidType)(c));if(h?u=(0,t.WalletType)(c):u=(0,t.WalletType)(s),!(0,n.isValid)(a)){let x="";try{return h?x=a.slice(0,66):x=a,(0,t.fromSecretKey)(x,u)}catch(C){throw new Error(`Cannot get blocklet wallet with invalid blocklet did or custom sk: ${C.message}`)}}if(!l)throw new Error("Cannot get blocklet wallet with empty node sk");return(0,r.fromAppDid)(a,l,u,f||0)};return st.getApplicationWallet=i,st}var rr;function Ma(){if(rr)return Re;rr=1;var e=Re&&Re.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(Re,"__esModule",{value:!0}),Re.getBlockletInfo=void 0;const t=e(na),n=Tr(),r=Oa(),s=ra(),i=(a,l,{returnWallet:c=!0}={})=>{if(!a||typeof a!="object"||!Array.isArray(a.environments)||!(0,t.default)(a,"meta.did"))throw new Error("Blocklet state must be an object");const{environments:f=[],configs:u=[]}=a,h=[...u,...f],x=h.find(H=>H.key==="BLOCKLET_APP_DESCRIPTION"),C=h.find(H=>H.key==="BLOCKLET_PASSPORT_COLOR"),j=h.find(H=>H.key==="BLOCKLET_APP_URL"),S=h.find(H=>H.key==="BLOCKLET_APP_TENANT_MODE"),{did:p,version:d}=a.meta,m=(0,s.getDisplayName)(a),y=(0,t.default)(x,"value",a.meta.description),b=(0,t.default)(C,"value","auto"),v=(0,t.default)(j,"value",""),P=(0,t.default)(S,"value","");if(!c)return{did:p,version:d,name:m,description:y,passportColor:b,appUrl:v,secret:"",wallet:null,permanentWallet:null,tenantMode:P};const g=h.find(H=>H.key==="BLOCKLET_APP_SK"),A=h.find(H=>H.key==="BLOCKLET_APP_CHAIN_TYPE")||h.find(H=>H.key==="BLOCKLET_WALLET_TYPE"),T=h.find(H=>H.key==="BLOCKLET_APP_PSK");let _;A&&(A.value==="ethereum"||A.value==="eth")&&(_=A.value);let M=null,O=null;if(g&&g.value)M=(0,r.getApplicationWallet)(g.value,void 0,_),T&&T.value&&T.value!==g.value&&(O=(0,r.getApplicationWallet)(T.value,void 0,_));else{if(!l||typeof l!="string")throw new Error("Node secret key must be a string");A?M=(0,r.getApplicationWallet)(a.meta.did,l,_):M=(0,r.getApplicationWallet)(a.meta.did,l)}const B=a.settings?.session?.salt||"",Y=n.Hasher.SHA3.hash256(Gn.concat([M.secretKey,M.address,B].filter(Boolean).map(H=>Gn.from(H))));return{did:p,version:d,name:m,description:y,passportColor:b,appUrl:v,secret:Y,wallet:M,permanentWallet:O||M,tenantMode:P}};return Re.getBlockletInfo=i,Re}var Na=Ma();const{min:Da,max:$a}=Math,Ne=(e,t=0,n=1)=>Da($a(t,e),n),kn=e=>{e._clipped=!1,e._unclipped=e.slice(0);for(let t=0;t<=3;t++)t<3?((e[t]<0||e[t]>255)&&(e._clipped=!0),e[t]=Ne(e[t],0,255)):t===3&&(e[t]=Ne(e[t],0,1));return e},Hr={};for(let e of["Boolean","Number","String","Function","Array","Date","RegExp","Undefined","Null"])Hr[`[object ${e}]`]=e.toLowerCase();function W(e){return Hr[Object.prototype.toString.call(e)]||"object"}const z=(e,t=null)=>e.length>=3?Array.prototype.slice.call(e):W(e[0])=="object"&&t?t.split("").filter(n=>e[0][n]!==void 0).map(n=>e[0][n]):e[0].slice(0),Ge=e=>{if(e.length<2)return null;const t=e.length-1;return W(e[t])=="string"?e[t].toLowerCase():null},{PI:Nt,min:Kr,max:Yr}=Math,ie=e=>Math.round(e*100)/100,mn=e=>Math.round(e*100)/100,ke=Nt*2,Vt=Nt/3,Ba=Nt/180,Fa=180/Nt;function Gr(e){return[...e.slice(0,3).reverse(),...e.slice(3)]}const F={format:{},autodetect:[]};class L{constructor(...t){const n=this;if(W(t[0])==="object"&&t[0].constructor&&t[0].constructor===this.constructor)return t[0];let r=Ge(t),s=!1;if(!r){s=!0,F.sorted||(F.autodetect=F.autodetect.sort((i,a)=>a.p-i.p),F.sorted=!0);for(let i of F.autodetect)if(r=i.test(...t),r)break}if(F.format[r]){const i=F.format[r].apply(null,s?t:t.slice(0,-1));n._rgb=kn(i)}else throw new Error("unknown format: "+t);n._rgb.length===3&&n._rgb.push(1)}toString(){return W(this.hex)=="function"?this.hex():`[${this._rgb.join(",")}]`}}const za="3.1.2",U=(...e)=>new L(...e);U.version=za;const He={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",laserlemon:"#ffff54",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrod:"#fafad2",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",maroon2:"#7f0000",maroon3:"#b03060",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",purple2:"#7f007f",purple3:"#a020f0",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},Ua=/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,Wa=/^#?([A-Fa-f0-9]{8}|[A-Fa-f0-9]{4})$/,Vr=e=>{if(e.match(Ua)){(e.length===4||e.length===7)&&(e=e.substr(1)),e.length===3&&(e=e.split(""),e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]);const t=parseInt(e,16),n=t>>16,r=t>>8&255,s=t&255;return[n,r,s,1]}if(e.match(Wa)){(e.length===5||e.length===9)&&(e=e.substr(1)),e.length===4&&(e=e.split(""),e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]+e[3]+e[3]);const t=parseInt(e,16),n=t>>24&255,r=t>>16&255,s=t>>8&255,i=Math.round((t&255)/255*100)/100;return[n,r,s,i]}throw new Error(`unknown hex color: ${e}`)},{round:yt}=Math,Zr=(...e)=>{let[t,n,r,s]=z(e,"rgba"),i=Ge(e)||"auto";s===void 0&&(s=1),i==="auto"&&(i=s<1?"rgba":"rgb"),t=yt(t),n=yt(n),r=yt(r);let l="000000"+(t<<16|n<<8|r).toString(16);l=l.substr(l.length-6);let c="0"+yt(s*255).toString(16);switch(c=c.substr(c.length-2),i.toLowerCase()){case"rgba":return`#${l}${c}`;case"argb":return`#${c}${l}`;default:return`#${l}`}};L.prototype.name=function(){const e=Zr(this._rgb,"rgb");for(let t of Object.keys(He))if(He[t]===e)return t.toLowerCase();return e};F.format.named=e=>{if(e=e.toLowerCase(),He[e])return Vr(He[e]);throw new Error("unknown color name: "+e)};F.autodetect.push({p:5,test:(e,...t)=>{if(!t.length&&W(e)==="string"&&He[e.toLowerCase()])return"named"}});L.prototype.alpha=function(e,t=!1){return e!==void 0&&W(e)==="number"?t?(this._rgb[3]=e,this):new L([this._rgb[0],this._rgb[1],this._rgb[2],e],"rgb"):this._rgb[3]};L.prototype.clipped=function(){return this._rgb._clipped||!1};const je={Kn:18,labWhitePoint:"d65",Xn:.95047,Yn:1,Zn:1.08883,kE:216/24389,kKE:8,kK:24389/27,RefWhiteRGB:{X:.95047,Y:1,Z:1.08883},MtxRGB2XYZ:{m00:.4124564390896922,m01:.21267285140562253,m02:.0193338955823293,m10:.357576077643909,m11:.715152155287818,m12:.11919202588130297,m20:.18043748326639894,m21:.07217499330655958,m22:.9503040785363679},MtxXYZ2RGB:{m00:3.2404541621141045,m01:-.9692660305051868,m02:.055643430959114726,m10:-1.5371385127977166,m11:1.8760108454466942,m12:-.2040259135167538,m20:-.498531409556016,m21:.041556017530349834,m22:1.0572251882231791},As:.9414285350000001,Bs:1.040417467,Cs:1.089532651,MtxAdaptMa:{m00:.8951,m01:-.7502,m02:.0389,m10:.2664,m11:1.7135,m12:-.0685,m20:-.1614,m21:.0367,m22:1.0296},MtxAdaptMaI:{m00:.9869929054667123,m01:.43230526972339456,m02:-.008528664575177328,m10:-.14705425642099013,m11:.5183602715367776,m12:.04004282165408487,m20:.15996265166373125,m21:.0492912282128556,m22:.9684866957875502}},qa=new Map([["a",[1.0985,.35585]],["b",[1.0985,.35585]],["c",[.98074,1.18232]],["d50",[.96422,.82521]],["d55",[.95682,.92149]],["d65",[.95047,1.08883]],["e",[1,1,1]],["f2",[.99186,.67393]],["f7",[.95041,1.08747]],["f11",[1.00962,.6435]],["icc",[.96422,.82521]]]);function Se(e){const t=qa.get(String(e).toLowerCase());if(!t)throw new Error("unknown Lab illuminant "+e);je.labWhitePoint=e,je.Xn=t[0],je.Zn=t[1]}function dt(){return je.labWhitePoint}const Sn=(...e)=>{e=z(e,"lab");const[t,n,r]=e,[s,i,a]=Ha(t,n,r),[l,c,f]=Xr(s,i,a);return[l,c,f,e.length>3?e[3]:1]},Ha=(e,t,n)=>{const{kE:r,kK:s,kKE:i,Xn:a,Yn:l,Zn:c}=je,f=(e+16)/116,u=.002*t+f,h=f-.005*n,x=u*u*u,C=h*h*h,j=x>r?x:(116*u-16)/s,S=e>i?Math.pow((e+16)/116,3):e/s,p=C>r?C:(116*h-16)/s,d=j*a,m=S*l,y=p*c;return[d,m,y]},Zt=e=>{const t=Math.sign(e);return e=Math.abs(e),(e<=.0031308?e*12.92:1.055*Math.pow(e,1/2.4)-.055)*t},Xr=(e,t,n)=>{const{MtxAdaptMa:r,MtxAdaptMaI:s,MtxXYZ2RGB:i,RefWhiteRGB:a,Xn:l,Yn:c,Zn:f}=je,u=l*r.m00+c*r.m10+f*r.m20,h=l*r.m01+c*r.m11+f*r.m21,x=l*r.m02+c*r.m12+f*r.m22,C=a.X*r.m00+a.Y*r.m10+a.Z*r.m20,j=a.X*r.m01+a.Y*r.m11+a.Z*r.m21,S=a.X*r.m02+a.Y*r.m12+a.Z*r.m22,p=(e*r.m00+t*r.m10+n*r.m20)*(C/u),d=(e*r.m01+t*r.m11+n*r.m21)*(j/h),m=(e*r.m02+t*r.m12+n*r.m22)*(S/x),y=p*s.m00+d*s.m10+m*s.m20,b=p*s.m01+d*s.m11+m*s.m21,v=p*s.m02+d*s.m12+m*s.m22,P=Zt(y*i.m00+b*i.m10+v*i.m20),g=Zt(y*i.m01+b*i.m11+v*i.m21),A=Zt(y*i.m02+b*i.m12+v*i.m22);return[P*255,g*255,A*255]},Ln=(...e)=>{const[t,n,r,...s]=z(e,"rgb"),[i,a,l]=Qr(t,n,r),[c,f,u]=Ka(i,a,l);return[c,f,u,...s.length>0&&s[0]<1?[s[0]]:[]]};function Ka(e,t,n){const{Xn:r,Yn:s,Zn:i,kE:a,kK:l}=je,c=e/r,f=t/s,u=n/i,h=c>a?Math.pow(c,1/3):(l*c+16)/116,x=f>a?Math.pow(f,1/3):(l*f+16)/116,C=u>a?Math.pow(u,1/3):(l*u+16)/116;return[116*x-16,500*(h-x),200*(x-C)]}function Xt(e){const t=Math.sign(e);return e=Math.abs(e),(e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4))*t}const Qr=(e,t,n)=>{e=Xt(e/255),t=Xt(t/255),n=Xt(n/255);const{MtxRGB2XYZ:r,MtxAdaptMa:s,MtxAdaptMaI:i,Xn:a,Yn:l,Zn:c,As:f,Bs:u,Cs:h}=je;let x=e*r.m00+t*r.m10+n*r.m20,C=e*r.m01+t*r.m11+n*r.m21,j=e*r.m02+t*r.m12+n*r.m22;const S=a*s.m00+l*s.m10+c*s.m20,p=a*s.m01+l*s.m11+c*s.m21,d=a*s.m02+l*s.m12+c*s.m22;let m=x*s.m00+C*s.m10+j*s.m20,y=x*s.m01+C*s.m11+j*s.m21,b=x*s.m02+C*s.m12+j*s.m22;return m*=S/f,y*=p/u,b*=d/h,x=m*i.m00+y*i.m10+b*i.m20,C=m*i.m01+y*i.m11+b*i.m21,j=m*i.m02+y*i.m12+b*i.m22,[x,C,j]};L.prototype.lab=function(){return Ln(this._rgb)};const Ya=(...e)=>new L(...e,"lab");Object.assign(U,{lab:Ya,getLabWhitePoint:dt,setLabWhitePoint:Se});F.format.lab=Sn;F.autodetect.push({p:2,test:(...e)=>{if(e=z(e,"lab"),W(e)==="array"&&e.length===3)return"lab"}});L.prototype.darken=function(e=1){const t=this,n=t.lab();return n[0]-=je.Kn*e,new L(n,"lab").alpha(t.alpha(),!0)};L.prototype.brighten=function(e=1){return this.darken(-e)};L.prototype.darker=L.prototype.darken;L.prototype.brighter=L.prototype.brighten;L.prototype.get=function(e){const[t,n]=e.split("."),r=this[t]();if(n){const s=t.indexOf(n)-(t.substr(0,2)==="ok"?2:0);if(s>-1)return r[s];throw new Error(`unknown channel ${n} in mode ${t}`)}else return r};const{pow:Ga}=Math,Va=1e-7,Za=20;L.prototype.luminance=function(e,t="rgb"){if(e!==void 0&&W(e)==="number"){if(e===0)return new L([0,0,0,this._rgb[3]],"rgb");if(e===1)return new L([255,255,255,this._rgb[3]],"rgb");let n=this.luminance(),r=Za;const s=(a,l)=>{const c=a.interpolate(l,.5,t),f=c.luminance();return Math.abs(e-f)<Va||!r--?c:f>e?s(a,c):s(c,l)},i=(n>e?s(new L([0,0,0]),this):s(this,new L([255,255,255]))).rgb();return new L([...i,this._rgb[3]])}return Xa(...this._rgb.slice(0,3))};const Xa=(e,t,n)=>(e=Qt(e),t=Qt(t),n=Qt(n),.2126*e+.7152*t+.0722*n),Qt=e=>(e/=255,e<=.03928?e/12.92:Ga((e+.055)/1.055,2.4)),te={},Ke=(e,t,n=.5,...r)=>{let s=r[0]||"lrgb";if(!te[s]&&!r.length&&(s=Object.keys(te)[0]),!te[s])throw new Error(`interpolation mode ${s} is not defined`);return W(e)!=="object"&&(e=new L(e)),W(t)!=="object"&&(t=new L(t)),te[s](e,t,n).alpha(e.alpha()+n*(t.alpha()-e.alpha()))};L.prototype.mix=L.prototype.interpolate=function(e,t=.5,...n){return Ke(this,e,t,...n)};L.prototype.premultiply=function(e=!1){const t=this._rgb,n=t[3];return e?(this._rgb=[t[0]*n,t[1]*n,t[2]*n,n],this):new L([t[0]*n,t[1]*n,t[2]*n,n],"rgb")};const{sin:Qa,cos:Ja}=Math,Jr=(...e)=>{let[t,n,r]=z(e,"lch");return isNaN(r)&&(r=0),r=r*Ba,[t,Ja(r)*n,Qa(r)*n]},Pn=(...e)=>{e=z(e,"lch");const[t,n,r]=e,[s,i,a]=Jr(t,n,r),[l,c,f]=Sn(s,i,a);return[l,c,f,e.length>3?e[3]:1]},ei=(...e)=>{const t=Gr(z(e,"hcl"));return Pn(...t)},{sqrt:ti,atan2:ni,round:ri}=Math,es=(...e)=>{const[t,n,r]=z(e,"lab"),s=ti(n*n+r*r);let i=(ni(r,n)*Fa+360)%360;return ri(s*1e4)===0&&(i=Number.NaN),[t,s,i]},In=(...e)=>{const[t,n,r,...s]=z(e,"rgb"),[i,a,l]=Ln(t,n,r),[c,f,u]=es(i,a,l);return[c,f,u,...s.length>0&&s[0]<1?[s[0]]:[]]};L.prototype.lch=function(){return In(this._rgb)};L.prototype.hcl=function(){return Gr(In(this._rgb))};const si=(...e)=>new L(...e,"lch"),oi=(...e)=>new L(...e,"hcl");Object.assign(U,{lch:si,hcl:oi});F.format.lch=Pn;F.format.hcl=ei;["lch","hcl"].forEach(e=>F.autodetect.push({p:2,test:(...t)=>{if(t=z(t,e),W(t)==="array"&&t.length===3)return e}}));L.prototype.saturate=function(e=1){const t=this,n=t.lch();return n[1]+=je.Kn*e,n[1]<0&&(n[1]=0),new L(n,"lch").alpha(t.alpha(),!0)};L.prototype.desaturate=function(e=1){return this.saturate(-e)};L.prototype.set=function(e,t,n=!1){const[r,s]=e.split("."),i=this[r]();if(s){const a=r.indexOf(s)-(r.substr(0,2)==="ok"?2:0);if(a>-1){if(W(t)=="string")switch(t.charAt(0)){case"+":i[a]+=+t;break;case"-":i[a]+=+t;break;case"*":i[a]*=+t.substr(1);break;case"/":i[a]/=+t.substr(1);break;default:i[a]=+t}else if(W(t)==="number")i[a]=t;else throw new Error("unsupported value for Color.set");const l=new L(i,r);return n?(this._rgb=l._rgb,this):l}throw new Error(`unknown channel ${s} in mode ${r}`)}else return i};L.prototype.tint=function(e=.5,...t){return Ke(this,"white",e,...t)};L.prototype.shade=function(e=.5,...t){return Ke(this,"black",e,...t)};const ai=(e,t,n)=>{const r=e._rgb,s=t._rgb;return new L(r[0]+n*(s[0]-r[0]),r[1]+n*(s[1]-r[1]),r[2]+n*(s[2]-r[2]),"rgb")};te.rgb=ai;const{sqrt:Jt,pow:$e}=Math,ii=(e,t,n)=>{const[r,s,i]=e._rgb,[a,l,c]=t._rgb;return new L(Jt($e(r,2)*(1-n)+$e(a,2)*n),Jt($e(s,2)*(1-n)+$e(l,2)*n),Jt($e(i,2)*(1-n)+$e(c,2)*n),"rgb")};te.lrgb=ii;const li=(e,t,n)=>{const r=e.lab(),s=t.lab();return new L(r[0]+n*(s[0]-r[0]),r[1]+n*(s[1]-r[1]),r[2]+n*(s[2]-r[2]),"lab")};te.lab=li;const Ve=(e,t,n,r)=>{let s,i;r==="hsl"?(s=e.hsl(),i=t.hsl()):r==="hsv"?(s=e.hsv(),i=t.hsv()):r==="hcg"?(s=e.hcg(),i=t.hcg()):r==="hsi"?(s=e.hsi(),i=t.hsi()):r==="lch"||r==="hcl"?(r="hcl",s=e.hcl(),i=t.hcl()):r==="oklch"&&(s=e.oklch().reverse(),i=t.oklch().reverse());let a,l,c,f,u,h;(r.substr(0,1)==="h"||r==="oklch")&&([a,c,u]=s,[l,f,h]=i);let x,C,j,S;return!isNaN(a)&&!isNaN(l)?(l>a&&l-a>180?S=l-(a+360):l<a&&a-l>180?S=l+360-a:S=l-a,C=a+n*S):isNaN(a)?isNaN(l)?C=Number.NaN:(C=l,(u==1||u==0)&&r!="hsv"&&(x=f)):(C=a,(h==1||h==0)&&r!="hsv"&&(x=c)),x===void 0&&(x=c+n*(f-c)),j=u+n*(h-u),r==="oklch"?new L([j,x,C],r):new L([C,x,j],r)},ts=(e,t,n)=>Ve(e,t,n,"lch");te.lch=ts;te.hcl=ts;const ci=e=>{if(W(e)=="number"&&e>=0&&e<=16777215){const t=e>>16,n=e>>8&255,r=e&255;return[t,n,r,1]}throw new Error("unknown num color: "+e)},di=(...e)=>{const[t,n,r]=z(e,"rgb");return(t<<16)+(n<<8)+r};L.prototype.num=function(){return di(this._rgb)};const ui=(...e)=>new L(...e,"num");Object.assign(U,{num:ui});F.format.num=ci;F.autodetect.push({p:5,test:(...e)=>{if(e.length===1&&W(e[0])==="number"&&e[0]>=0&&e[0]<=16777215)return"num"}});const fi=(e,t,n)=>{const r=e.num(),s=t.num();return new L(r+n*(s-r),"num")};te.num=fi;const{floor:pi}=Math,mi=(...e)=>{e=z(e,"hcg");let[t,n,r]=e,s,i,a;r=r*255;const l=n*255;if(n===0)s=i=a=r;else{t===360&&(t=0),t>360&&(t-=360),t<0&&(t+=360),t/=60;const c=pi(t),f=t-c,u=r*(1-n),h=u+l*(1-f),x=u+l*f,C=u+l;switch(c){case 0:[s,i,a]=[C,x,u];break;case 1:[s,i,a]=[h,C,u];break;case 2:[s,i,a]=[u,C,x];break;case 3:[s,i,a]=[u,h,C];break;case 4:[s,i,a]=[x,u,C];break;case 5:[s,i,a]=[C,u,h];break}}return[s,i,a,e.length>3?e[3]:1]},hi=(...e)=>{const[t,n,r]=z(e,"rgb"),s=Kr(t,n,r),i=Yr(t,n,r),a=i-s,l=a*100/255,c=s/(255-a)*100;let f;return a===0?f=Number.NaN:(t===i&&(f=(n-r)/a),n===i&&(f=2+(r-t)/a),r===i&&(f=4+(t-n)/a),f*=60,f<0&&(f+=360)),[f,l,c]};L.prototype.hcg=function(){return hi(this._rgb)};const gi=(...e)=>new L(...e,"hcg");U.hcg=gi;F.format.hcg=mi;F.autodetect.push({p:1,test:(...e)=>{if(e=z(e,"hcg"),W(e)==="array"&&e.length===3)return"hcg"}});const bi=(e,t,n)=>Ve(e,t,n,"hcg");te.hcg=bi;const{cos:Be}=Math,xi=(...e)=>{e=z(e,"hsi");let[t,n,r]=e,s,i,a;return isNaN(t)&&(t=0),isNaN(n)&&(n=0),t>360&&(t-=360),t<0&&(t+=360),t/=360,t<1/3?(a=(1-n)/3,s=(1+n*Be(ke*t)/Be(Vt-ke*t))/3,i=1-(a+s)):t<2/3?(t-=1/3,s=(1-n)/3,i=(1+n*Be(ke*t)/Be(Vt-ke*t))/3,a=1-(s+i)):(t-=2/3,i=(1-n)/3,a=(1+n*Be(ke*t)/Be(Vt-ke*t))/3,s=1-(i+a)),s=Ne(r*s*3),i=Ne(r*i*3),a=Ne(r*a*3),[s*255,i*255,a*255,e.length>3?e[3]:1]},{min:yi,sqrt:vi,acos:ji}=Math,Ci=(...e)=>{let[t,n,r]=z(e,"rgb");t/=255,n/=255,r/=255;let s;const i=yi(t,n,r),a=(t+n+r)/3,l=a>0?1-i/a:0;return l===0?s=NaN:(s=(t-n+(t-r))/2,s/=vi((t-n)*(t-n)+(t-r)*(n-r)),s=ji(s),r>n&&(s=ke-s),s/=ke),[s*360,l,a]};L.prototype.hsi=function(){return Ci(this._rgb)};const wi=(...e)=>new L(...e,"hsi");U.hsi=wi;F.format.hsi=xi;F.autodetect.push({p:2,test:(...e)=>{if(e=z(e,"hsi"),W(e)==="array"&&e.length===3)return"hsi"}});const ki=(e,t,n)=>Ve(e,t,n,"hsi");te.hsi=ki;const hn=(...e)=>{e=z(e,"hsl");const[t,n,r]=e;let s,i,a;if(n===0)s=i=a=r*255;else{const l=[0,0,0],c=[0,0,0],f=r<.5?r*(1+n):r+n-r*n,u=2*r-f,h=t/360;l[0]=h+1/3,l[1]=h,l[2]=h-1/3;for(let x=0;x<3;x++)l[x]<0&&(l[x]+=1),l[x]>1&&(l[x]-=1),6*l[x]<1?c[x]=u+(f-u)*6*l[x]:2*l[x]<1?c[x]=f:3*l[x]<2?c[x]=u+(f-u)*(2/3-l[x])*6:c[x]=u;[s,i,a]=[c[0]*255,c[1]*255,c[2]*255]}return e.length>3?[s,i,a,e[3]]:[s,i,a,1]},ns=(...e)=>{e=z(e,"rgba");let[t,n,r]=e;t/=255,n/=255,r/=255;const s=Kr(t,n,r),i=Yr(t,n,r),a=(i+s)/2;let l,c;return i===s?(l=0,c=Number.NaN):l=a<.5?(i-s)/(i+s):(i-s)/(2-i-s),t==i?c=(n-r)/(i-s):n==i?c=2+(r-t)/(i-s):r==i&&(c=4+(t-n)/(i-s)),c*=60,c<0&&(c+=360),e.length>3&&e[3]!==void 0?[c,l,a,e[3]]:[c,l,a]};L.prototype.hsl=function(){return ns(this._rgb)};const Si=(...e)=>new L(...e,"hsl");U.hsl=Si;F.format.hsl=hn;F.autodetect.push({p:2,test:(...e)=>{if(e=z(e,"hsl"),W(e)==="array"&&e.length===3)return"hsl"}});const Li=(e,t,n)=>Ve(e,t,n,"hsl");te.hsl=Li;const{floor:Pi}=Math,Ii=(...e)=>{e=z(e,"hsv");let[t,n,r]=e,s,i,a;if(r*=255,n===0)s=i=a=r;else{t===360&&(t=0),t>360&&(t-=360),t<0&&(t+=360),t/=60;const l=Pi(t),c=t-l,f=r*(1-n),u=r*(1-n*c),h=r*(1-n*(1-c));switch(l){case 0:[s,i,a]=[r,h,f];break;case 1:[s,i,a]=[u,r,f];break;case 2:[s,i,a]=[f,r,h];break;case 3:[s,i,a]=[f,u,r];break;case 4:[s,i,a]=[h,f,r];break;case 5:[s,i,a]=[r,f,u];break}}return[s,i,a,e.length>3?e[3]:1]},{min:Ai,max:Ti}=Math,Ei=(...e)=>{e=z(e,"rgb");let[t,n,r]=e;const s=Ai(t,n,r),i=Ti(t,n,r),a=i-s;let l,c,f;return f=i/255,i===0?(l=Number.NaN,c=0):(c=a/i,t===i&&(l=(n-r)/a),n===i&&(l=2+(r-t)/a),r===i&&(l=4+(t-n)/a),l*=60,l<0&&(l+=360)),[l,c,f]};L.prototype.hsv=function(){return Ei(this._rgb)};const Ri=(...e)=>new L(...e,"hsv");U.hsv=Ri;F.format.hsv=Ii;F.autodetect.push({p:2,test:(...e)=>{if(e=z(e,"hsv"),W(e)==="array"&&e.length===3)return"hsv"}});const _i=(e,t,n)=>Ve(e,t,n,"hsv");te.hsv=_i;function At(e,t){let n=e.length;Array.isArray(e[0])||(e=[e]),Array.isArray(t[0])||(t=t.map(a=>[a]));let r=t[0].length,s=t[0].map((a,l)=>t.map(c=>c[l])),i=e.map(a=>s.map(l=>Array.isArray(a)?a.reduce((c,f,u)=>c+f*(l[u]||0),0):l.reduce((c,f)=>c+f*a,0)));return n===1&&(i=i[0]),r===1?i.map(a=>a[0]):i}const An=(...e)=>{e=z(e,"lab");const[t,n,r,...s]=e,[i,a,l]=Oi([t,n,r]),[c,f,u]=Xr(i,a,l);return[c,f,u,...s.length>0&&s[0]<1?[s[0]]:[]]};function Oi(e){var t=[[1.2268798758459243,-.5578149944602171,.2813910456659647],[-.0405757452148008,1.112286803280317,-.0717110580655164],[-.0763729366746601,-.4214933324022432,1.5869240198367816]],n=[[1,.3963377773761749,.2158037573099136],[1,-.1055613458156586,-.0638541728258133],[1,-.0894841775298119,-1.2914855480194092]],r=At(n,e);return At(t,r.map(s=>s**3))}const Tn=(...e)=>{const[t,n,r,...s]=z(e,"rgb"),i=Qr(t,n,r);return[...Mi(i),...s.length>0&&s[0]<1?[s[0]]:[]]};function Mi(e){const t=[[.819022437996703,.3619062600528904,-.1288737815209879],[.0329836539323885,.9292868615863434,.0361446663506424],[.0481771893596242,.2642395317527308,.6335478284694309]],n=[[.210454268309314,.7936177747023054,-.0040720430116193],[1.9779985324311684,-2.42859224204858,.450593709617411],[.0259040424655478,.7827717124575296,-.8086757549230774]],r=At(t,e);return At(n,r.map(s=>Math.cbrt(s)))}L.prototype.oklab=function(){return Tn(this._rgb)};const Ni=(...e)=>new L(...e,"oklab");Object.assign(U,{oklab:Ni});F.format.oklab=An;F.autodetect.push({p:2,test:(...e)=>{if(e=z(e,"oklab"),W(e)==="array"&&e.length===3)return"oklab"}});const Di=(e,t,n)=>{const r=e.oklab(),s=t.oklab();return new L(r[0]+n*(s[0]-r[0]),r[1]+n*(s[1]-r[1]),r[2]+n*(s[2]-r[2]),"oklab")};te.oklab=Di;const $i=(e,t,n)=>Ve(e,t,n,"oklch");te.oklch=$i;const{pow:en,sqrt:tn,PI:nn,cos:sr,sin:or,atan2:Bi}=Math,Fi=(e,t="lrgb",n=null)=>{const r=e.length;n||(n=Array.from(new Array(r)).map(()=>1));const s=r/n.reduce(function(h,x){return h+x});if(n.forEach((h,x)=>{n[x]*=s}),e=e.map(h=>new L(h)),t==="lrgb")return zi(e,n);const i=e.shift(),a=i.get(t),l=[];let c=0,f=0;for(let h=0;h<a.length;h++)if(a[h]=(a[h]||0)*n[0],l.push(isNaN(a[h])?0:n[0]),t.charAt(h)==="h"&&!isNaN(a[h])){const x=a[h]/180*nn;c+=sr(x)*n[0],f+=or(x)*n[0]}let u=i.alpha()*n[0];e.forEach((h,x)=>{const C=h.get(t);u+=h.alpha()*n[x+1];for(let j=0;j<a.length;j++)if(!isNaN(C[j]))if(l[j]+=n[x+1],t.charAt(j)==="h"){const S=C[j]/180*nn;c+=sr(S)*n[x+1],f+=or(S)*n[x+1]}else a[j]+=C[j]*n[x+1]});for(let h=0;h<a.length;h++)if(t.charAt(h)==="h"){let x=Bi(f/l[h],c/l[h])/nn*180;for(;x<0;)x+=360;for(;x>=360;)x-=360;a[h]=x}else a[h]=a[h]/l[h];return u/=r,new L(a,t).alpha(u>.99999?1:u,!0)},zi=(e,t)=>{const n=e.length,r=[0,0,0,0];for(let s=0;s<e.length;s++){const i=e[s],a=t[s]/n,l=i._rgb;r[0]+=en(l[0],2)*a,r[1]+=en(l[1],2)*a,r[2]+=en(l[2],2)*a,r[3]+=l[3]*a}return r[0]=tn(r[0]),r[1]=tn(r[1]),r[2]=tn(r[2]),r[3]>.9999999&&(r[3]=1),new L(kn(r))},{pow:Ui}=Math;function Tt(e){let t="rgb",n=U("#ccc"),r=0,s=[0,1],i=[],a=[0,0],l=!1,c=[],f=!1,u=0,h=1,x=!1,C={},j=!0,S=1;const p=function(g){if(g=g||["#fff","#000"],g&&W(g)==="string"&&U.brewer&&U.brewer[g.toLowerCase()]&&(g=U.brewer[g.toLowerCase()]),W(g)==="array"){g.length===1&&(g=[g[0],g[0]]),g=g.slice(0);for(let A=0;A<g.length;A++)g[A]=U(g[A]);i.length=0;for(let A=0;A<g.length;A++)i.push(A/(g.length-1))}return v(),c=g},d=function(g){if(l!=null){const A=l.length-1;let T=0;for(;T<A&&g>=l[T];)T++;return T-1}return 0};let m=g=>g,y=g=>g;const b=function(g,A){let T,_;if(A==null&&(A=!1),isNaN(g)||g===null)return n;A?_=g:l&&l.length>2?_=d(g)/(l.length-2):h!==u?_=(g-u)/(h-u):_=1,_=y(_),A||(_=m(_)),S!==1&&(_=Ui(_,S)),_=a[0]+_*(1-a[0]-a[1]),_=Ne(_,0,1);const M=Math.floor(_*1e4);if(j&&C[M])T=C[M];else{if(W(c)==="array")for(let O=0;O<i.length;O++){const B=i[O];if(_<=B){T=c[O];break}if(_>=B&&O===i.length-1){T=c[O];break}if(_>B&&_<i[O+1]){_=(_-B)/(i[O+1]-B),T=U.interpolate(c[O],c[O+1],_,t);break}}else W(c)==="function"&&(T=c(_));j&&(C[M]=T)}return T};var v=()=>C={};p(e);const P=function(g){const A=U(b(g));return f&&A[f]?A[f]():A};return P.classes=function(g){if(g!=null){if(W(g)==="array")l=g,s=[g[0],g[g.length-1]];else{const A=U.analyze(s);g===0?l=[A.min,A.max]:l=U.limits(A,"e",g)}return P}return l},P.domain=function(g){if(!arguments.length)return s;u=g[0],h=g[g.length-1],i=[];const A=c.length;if(g.length===A&&u!==h)for(let T of Array.from(g))i.push((T-u)/(h-u));else{for(let T=0;T<A;T++)i.push(T/(A-1));if(g.length>2){const T=g.map((M,O)=>O/(g.length-1)),_=g.map(M=>(M-u)/(h-u));_.every((M,O)=>T[O]===M)||(y=M=>{if(M<=0||M>=1)return M;let O=0;for(;M>=_[O+1];)O++;const B=(M-_[O])/(_[O+1]-_[O]);return T[O]+B*(T[O+1]-T[O])})}}return s=[u,h],P},P.mode=function(g){return arguments.length?(t=g,v(),P):t},P.range=function(g,A){return p(g),P},P.out=function(g){return f=g,P},P.spread=function(g){return arguments.length?(r=g,P):r},P.correctLightness=function(g){return g==null&&(g=!0),x=g,v(),x?m=function(A){const T=b(0,!0).lab()[0],_=b(1,!0).lab()[0],M=T>_;let O=b(A,!0).lab()[0];const B=T+(_-T)*A;let Y=O-B,H=0,ee=1,ne=20;for(;Math.abs(Y)>.01&&ne-- >0;)(function(){return M&&(Y*=-1),Y<0?(H=A,A+=(ee-A)*.5):(ee=A,A+=(H-A)*.5),O=b(A,!0).lab()[0],Y=O-B})();return A}:m=A=>A,P},P.padding=function(g){return g!=null?(W(g)==="number"&&(g=[g,g]),a=g,P):a},P.colors=function(g,A){arguments.length<2&&(A="hex");let T=[];if(arguments.length===0)T=c.slice(0);else if(g===1)T=[P(.5)];else if(g>1){const _=s[0],M=s[1]-_;T=Wi(0,g).map(O=>P(_+O/(g-1)*M))}else{e=[];let _=[];if(l&&l.length>2)for(let M=1,O=l.length,B=1<=O;B?M<O:M>O;B?M++:M--)_.push((l[M-1]+l[M])*.5);else _=s;T=_.map(M=>P(M))}return U[A]&&(T=T.map(_=>_[A]())),T},P.cache=function(g){return g!=null?(j=g,P):j},P.gamma=function(g){return g!=null?(S=g,P):S},P.nodata=function(g){return g!=null?(n=U(g),P):n},P}function Wi(e,t,n){let r=[],s=e<t,i=t;for(let a=e;s?a<i:a>i;s?a++:a--)r.push(a);return r}const qi=function(e){let t=[1,1];for(let n=1;n<e;n++){let r=[1];for(let s=1;s<=t.length;s++)r[s]=(t[s]||0)+t[s-1];t=r}return t},Hi=function(e){let t,n,r,s;if(e=e.map(i=>new L(i)),e.length===2)[n,r]=e.map(i=>i.lab()),t=function(i){const a=[0,1,2].map(l=>n[l]+i*(r[l]-n[l]));return new L(a,"lab")};else if(e.length===3)[n,r,s]=e.map(i=>i.lab()),t=function(i){const a=[0,1,2].map(l=>(1-i)*(1-i)*n[l]+2*(1-i)*i*r[l]+i*i*s[l]);return new L(a,"lab")};else if(e.length===4){let i;[n,r,s,i]=e.map(a=>a.lab()),t=function(a){const l=[0,1,2].map(c=>(1-a)*(1-a)*(1-a)*n[c]+3*(1-a)*(1-a)*a*r[c]+3*(1-a)*a*a*s[c]+a*a*a*i[c]);return new L(l,"lab")}}else if(e.length>=5){let i,a,l;i=e.map(c=>c.lab()),l=e.length-1,a=qi(l),t=function(c){const f=1-c,u=[0,1,2].map(h=>i.reduce((x,C,j)=>x+a[j]*f**(l-j)*c**j*C[h],0));return new L(u,"lab")}}else throw new RangeError("No point in running bezier with only one color.");return t},Ki=e=>{const t=Hi(e);return t.scale=()=>Tt(t),t},{round:rs}=Math;L.prototype.rgb=function(e=!0){return e===!1?this._rgb.slice(0,3):this._rgb.slice(0,3).map(rs)};L.prototype.rgba=function(e=!0){return this._rgb.slice(0,4).map((t,n)=>n<3?e===!1?t:rs(t):t)};const Yi=(...e)=>new L(...e,"rgb");Object.assign(U,{rgb:Yi});F.format.rgb=(...e)=>{const t=z(e,"rgba");return t[3]===void 0&&(t[3]=1),t};F.autodetect.push({p:3,test:(...e)=>{if(e=z(e,"rgba"),W(e)==="array"&&(e.length===3||e.length===4&&W(e[3])=="number"&&e[3]>=0&&e[3]<=1))return"rgb"}});const me=(e,t,n)=>{if(!me[n])throw new Error("unknown blend mode "+n);return me[n](e,t)},Te=e=>(t,n)=>{const r=U(n).rgb(),s=U(t).rgb();return U.rgb(e(r,s))},Ee=e=>(t,n)=>{const r=[];return r[0]=e(t[0],n[0]),r[1]=e(t[1],n[1]),r[2]=e(t[2],n[2]),r},Gi=e=>e,Vi=(e,t)=>e*t/255,Zi=(e,t)=>e>t?t:e,Xi=(e,t)=>e>t?e:t,Qi=(e,t)=>255*(1-(1-e/255)*(1-t/255)),Ji=(e,t)=>t<128?2*e*t/255:255*(1-2*(1-e/255)*(1-t/255)),el=(e,t)=>255*(1-(1-t/255)/(e/255)),tl=(e,t)=>e===255?255:(e=255*(t/255)/(1-e/255),e>255?255:e);me.normal=Te(Ee(Gi));me.multiply=Te(Ee(Vi));me.screen=Te(Ee(Qi));me.overlay=Te(Ee(Ji));me.darken=Te(Ee(Zi));me.lighten=Te(Ee(Xi));me.dodge=Te(Ee(tl));me.burn=Te(Ee(el));const{pow:nl,sin:rl,cos:sl}=Math;function ol(e=300,t=-1.5,n=1,r=1,s=[0,1]){let i=0,a;W(s)==="array"?a=s[1]-s[0]:(a=0,s=[s,s]);const l=function(c){const f=ke*((e+120)/360+t*c),u=nl(s[0]+a*c,r),x=(i!==0?n[0]+c*i:n)*u*(1-u)/2,C=sl(f),j=rl(f),S=u+x*(-.14861*C+1.78277*j),p=u+x*(-.29227*C-.90649*j),d=u+x*(1.97294*C);return U(kn([S*255,p*255,d*255,1]))};return l.start=function(c){return c==null?e:(e=c,l)},l.rotations=function(c){return c==null?t:(t=c,l)},l.gamma=function(c){return c==null?r:(r=c,l)},l.hue=function(c){return c==null?n:(n=c,W(n)==="array"?(i=n[1]-n[0],i===0&&(n=n[1])):i=0,l)},l.lightness=function(c){return c==null?s:(W(c)==="array"?(s=c,a=c[1]-c[0]):(s=[c,c],a=0),l)},l.scale=()=>U.scale(l),l.hue(n),l}const al="0123456789abcdef",{floor:il,random:ll}=Math,cl=()=>{let e="#";for(let t=0;t<6;t++)e+=al.charAt(il(ll()*16));return new L(e,"hex")},{log:ar,pow:dl,floor:ul,abs:fl}=Math;function ss(e,t=null){const n={min:Number.MAX_VALUE,max:Number.MAX_VALUE*-1,sum:0,values:[],count:0};return W(e)==="object"&&(e=Object.values(e)),e.forEach(r=>{t&&W(r)==="object"&&(r=r[t]),r!=null&&!isNaN(r)&&(n.values.push(r),n.sum+=r,r<n.min&&(n.min=r),r>n.max&&(n.max=r),n.count+=1)}),n.domain=[n.min,n.max],n.limits=(r,s)=>os(n,r,s),n}function os(e,t="equal",n=7){W(e)=="array"&&(e=ss(e));const{min:r,max:s}=e,i=e.values.sort((l,c)=>l-c);if(n===1)return[r,s];const a=[];if(t.substr(0,1)==="c"&&(a.push(r),a.push(s)),t.substr(0,1)==="e"){a.push(r);for(let l=1;l<n;l++)a.push(r+l/n*(s-r));a.push(s)}else if(t.substr(0,1)==="l"){if(r<=0)throw new Error("Logarithmic scales are only possible for values > 0");const l=Math.LOG10E*ar(r),c=Math.LOG10E*ar(s);a.push(r);for(let f=1;f<n;f++)a.push(dl(10,l+f/n*(c-l)));a.push(s)}else if(t.substr(0,1)==="q"){a.push(r);for(let l=1;l<n;l++){const c=(i.length-1)*l/n,f=ul(c);if(f===c)a.push(i[f]);else{const u=c-f;a.push(i[f]*(1-u)+i[f+1]*u)}}a.push(s)}else if(t.substr(0,1)==="k"){let l;const c=i.length,f=new Array(c),u=new Array(n);let h=!0,x=0,C=null;C=[],C.push(r);for(let p=1;p<n;p++)C.push(r+p/n*(s-r));for(C.push(s);h;){for(let d=0;d<n;d++)u[d]=0;for(let d=0;d<c;d++){const m=i[d];let y=Number.MAX_VALUE,b;for(let v=0;v<n;v++){const P=fl(C[v]-m);P<y&&(y=P,b=v),u[b]++,f[d]=b}}const p=new Array(n);for(let d=0;d<n;d++)p[d]=null;for(let d=0;d<c;d++)l=f[d],p[l]===null?p[l]=i[d]:p[l]+=i[d];for(let d=0;d<n;d++)p[d]*=1/u[d];h=!1;for(let d=0;d<n;d++)if(p[d]!==C[d]){h=!0;break}C=p,x++,x>200&&(h=!1)}const j={};for(let p=0;p<n;p++)j[p]=[];for(let p=0;p<c;p++)l=f[p],j[l].push(i[p]);let S=[];for(let p=0;p<n;p++)S.push(j[p][0]),S.push(j[p][j[p].length-1]);S=S.sort((p,d)=>p-d),a.push(S[0]);for(let p=1;p<S.length;p+=2){const d=S[p];!isNaN(d)&&a.indexOf(d)===-1&&a.push(d)}}return a}const pl=(e,t)=>{e=new L(e),t=new L(t);const n=e.luminance(),r=t.luminance();return n>r?(n+.05)/(r+.05):(r+.05)/(n+.05)};/**
|
|
2
|
-
* @license
|
|
3
|
-
*
|
|
4
|
-
* The APCA contrast prediction algorithm is based of the formulas published
|
|
5
|
-
* in the APCA-1.0.98G specification by Myndex. The specification is available at:
|
|
6
|
-
* https://raw.githubusercontent.com/Myndex/apca-w3/master/images/APCAw3_0.1.17_APCA0.0.98G.svg
|
|
7
|
-
*
|
|
8
|
-
* Note that the APCA implementation is still beta, so please update to
|
|
9
|
-
* future versions of chroma.js when they become available.
|
|
10
|
-
*
|
|
11
|
-
* You can read more about the APCA Readability Criterion at
|
|
12
|
-
* https://readtech.org/ARC/
|
|
13
|
-
*/const ir=.027,ml=5e-4,hl=.1,lr=1.14,vt=.022,cr=1.414,gl=(e,t)=>{e=new L(e),t=new L(t),e.alpha()<1&&(e=Ke(t,e,e.alpha(),"rgb"));const n=dr(...e.rgb()),r=dr(...t.rgb()),s=n>=vt?n:n+Math.pow(vt-n,cr),i=r>=vt?r:r+Math.pow(vt-r,cr),a=Math.pow(i,.56)-Math.pow(s,.57),l=Math.pow(i,.65)-Math.pow(s,.62),c=Math.abs(i-s)<ml?0:s<i?a*lr:l*lr;return(Math.abs(c)<hl?0:c>0?c-ir:c+ir)*100};function dr(e,t,n){return .2126729*Math.pow(e/255,2.4)+.7151522*Math.pow(t/255,2.4)+.072175*Math.pow(n/255,2.4)}const{sqrt:we,pow:Z,min:bl,max:xl,atan2:ur,abs:fr,cos:jt,sin:pr,exp:yl,PI:mr}=Math;function vl(e,t,n=1,r=1,s=1){var i=function(ue){return 360*ue/(2*mr)},a=function(ue){return 2*mr*ue/360};e=new L(e),t=new L(t);const[l,c,f]=Array.from(e.lab()),[u,h,x]=Array.from(t.lab()),C=(l+u)/2,j=we(Z(c,2)+Z(f,2)),S=we(Z(h,2)+Z(x,2)),p=(j+S)/2,d=.5*(1-we(Z(p,7)/(Z(p,7)+Z(25,7)))),m=c*(1+d),y=h*(1+d),b=we(Z(m,2)+Z(f,2)),v=we(Z(y,2)+Z(x,2)),P=(b+v)/2,g=i(ur(f,m)),A=i(ur(x,y)),T=g>=0?g:g+360,_=A>=0?A:A+360,M=fr(T-_)>180?(T+_+360)/2:(T+_)/2,O=1-.17*jt(a(M-30))+.24*jt(a(2*M))+.32*jt(a(3*M+6))-.2*jt(a(4*M-63));let B=_-T;B=fr(B)<=180?B:_<=T?B+360:B-360,B=2*we(b*v)*pr(a(B)/2);const Y=u-l,H=v-b,ee=1+.015*Z(C-50,2)/we(20+Z(C-50,2)),ne=1+.045*P,R=1+.015*P*O,D=30*yl(-Z((M-275)/25,2)),be=-(2*we(Z(P,7)/(Z(P,7)+Z(25,7))))*pr(2*a(D)),Je=we(Z(Y/(n*ee),2)+Z(H/(r*ne),2)+Z(B/(s*R),2)+be*(H/(r*ne))*(B/(s*R)));return xl(0,bl(100,Je))}function jl(e,t,n="lab"){e=new L(e),t=new L(t);const r=e.get(n),s=t.get(n);let i=0;for(let a in r){const l=(r[a]||0)-(s[a]||0);i+=l*l}return Math.sqrt(i)}const Cl=(...e)=>{try{return new L(...e),!0}catch{return!1}},wl={cool(){return Tt([U.hsl(180,1,.9),U.hsl(250,.7,.4)])},hot(){return Tt(["#000","#f00","#ff0","#fff"]).mode("rgb")}},gn={OrRd:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"],PuBu:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"],BuPu:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"],Oranges:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"],BuGn:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"],YlOrBr:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"],YlGn:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"],Reds:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"],RdPu:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"],Greens:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"],YlGnBu:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"],Purples:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"],GnBu:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"],Greys:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"],YlOrRd:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"],PuRd:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"],Blues:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"],PuBuGn:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"],Viridis:["#440154","#482777","#3f4a8a","#31678e","#26838f","#1f9d8a","#6cce5a","#b6de2b","#fee825"],Spectral:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],RdYlGn:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],RdBu:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],PiYG:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],PRGn:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],RdYlBu:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],BrBG:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],RdGy:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],PuOr:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],Set2:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"],Accent:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17","#666666"],Set1:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf","#999999"],Set3:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"],Dark2:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"],Paired:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"],Pastel2:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc","#cccccc"],Pastel1:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec","#f2f2f2"]},as=Object.keys(gn),hr=new Map(as.map(e=>[e.toLowerCase(),e])),kl=typeof Proxy=="function"?new Proxy(gn,{get(e,t){const n=t.toLowerCase();if(hr.has(n))return e[hr.get(n)]},getOwnPropertyNames(){return Object.getOwnPropertyNames(as)}}):gn,Sl=(...e)=>{e=z(e,"cmyk");const[t,n,r,s]=e,i=e.length>4?e[4]:1;return s===1?[0,0,0,i]:[t>=1?0:255*(1-t)*(1-s),n>=1?0:255*(1-n)*(1-s),r>=1?0:255*(1-r)*(1-s),i]},{max:gr}=Math,Ll=(...e)=>{let[t,n,r]=z(e,"rgb");t=t/255,n=n/255,r=r/255;const s=1-gr(t,gr(n,r)),i=s<1?1/(1-s):0,a=(1-t-s)*i,l=(1-n-s)*i,c=(1-r-s)*i;return[a,l,c,s]};L.prototype.cmyk=function(){return Ll(this._rgb)};const Pl=(...e)=>new L(...e,"cmyk");Object.assign(U,{cmyk:Pl});F.format.cmyk=Sl;F.autodetect.push({p:2,test:(...e)=>{if(e=z(e,"cmyk"),W(e)==="array"&&e.length===4)return"cmyk"}});const Il=(...e)=>{const t=z(e,"hsla");let n=Ge(e)||"lsa";return t[0]=ie(t[0]||0)+"deg",t[1]=ie(t[1]*100)+"%",t[2]=ie(t[2]*100)+"%",n==="hsla"||t.length>3&&t[3]<1?(t[3]="/ "+(t.length>3?t[3]:1),n="hsla"):t.length=3,`${n.substr(0,3)}(${t.join(" ")})`},Al=(...e)=>{const t=z(e,"lab");let n=Ge(e)||"lab";return t[0]=ie(t[0])+"%",t[1]=ie(t[1]),t[2]=ie(t[2]),n==="laba"||t.length>3&&t[3]<1?t[3]="/ "+(t.length>3?t[3]:1):t.length=3,`lab(${t.join(" ")})`},Tl=(...e)=>{const t=z(e,"lch");let n=Ge(e)||"lab";return t[0]=ie(t[0])+"%",t[1]=ie(t[1]),t[2]=isNaN(t[2])?"none":ie(t[2])+"deg",n==="lcha"||t.length>3&&t[3]<1?t[3]="/ "+(t.length>3?t[3]:1):t.length=3,`lch(${t.join(" ")})`},El=(...e)=>{const t=z(e,"lab");return t[0]=ie(t[0]*100)+"%",t[1]=mn(t[1]),t[2]=mn(t[2]),t.length>3&&t[3]<1?t[3]="/ "+(t.length>3?t[3]:1):t.length=3,`oklab(${t.join(" ")})`},is=(...e)=>{const[t,n,r,...s]=z(e,"rgb"),[i,a,l]=Tn(t,n,r),[c,f,u]=es(i,a,l);return[c,f,u,...s.length>0&&s[0]<1?[s[0]]:[]]},Rl=(...e)=>{const t=z(e,"lch");return t[0]=ie(t[0]*100)+"%",t[1]=mn(t[1]),t[2]=isNaN(t[2])?"none":ie(t[2])+"deg",t.length>3&&t[3]<1?t[3]="/ "+(t.length>3?t[3]:1):t.length=3,`oklch(${t.join(" ")})`},{round:rn}=Math,_l=(...e)=>{const t=z(e,"rgba");let n=Ge(e)||"rgb";if(n.substr(0,3)==="hsl")return Il(ns(t),n);if(n.substr(0,3)==="lab"){const r=dt();Se("d50");const s=Al(Ln(t),n);return Se(r),s}if(n.substr(0,3)==="lch"){const r=dt();Se("d50");const s=Tl(In(t),n);return Se(r),s}return n.substr(0,5)==="oklab"?El(Tn(t)):n.substr(0,5)==="oklch"?Rl(is(t)):(t[0]=rn(t[0]),t[1]=rn(t[1]),t[2]=rn(t[2]),(n==="rgba"||t.length>3&&t[3]<1)&&(t[3]="/ "+(t.length>3?t[3]:1),n="rgba"),`${n.substr(0,3)}(${t.slice(0,n==="rgb"?3:4).join(" ")})`)},ls=(...e)=>{e=z(e,"lch");const[t,n,r,...s]=e,[i,a,l]=Jr(t,n,r),[c,f,u]=An(i,a,l);return[c,f,u,...s.length>0&&s[0]<1?[s[0]]:[]]},Le=/((?:-?\d+)|(?:-?\d+(?:\.\d+)?)%|none)/.source,pe=/((?:-?(?:\d+(?:\.\d*)?|\.\d+)%?)|none)/.source,Et=/((?:-?(?:\d+(?:\.\d*)?|\.\d+)%)|none)/.source,ce=/\s*/.source,Ze=/\s+/.source,En=/\s*,\s*/.source,Dt=/((?:-?(?:\d+(?:\.\d*)?|\.\d+)(?:deg)?)|none)/.source,Xe=/\s*(?:\/\s*((?:[01]|[01]?\.\d+)|\d+(?:\.\d+)?%))?/.source,cs=new RegExp("^rgba?\\("+ce+[Le,Le,Le].join(Ze)+Xe+"\\)$"),ds=new RegExp("^rgb\\("+ce+[Le,Le,Le].join(En)+ce+"\\)$"),us=new RegExp("^rgba\\("+ce+[Le,Le,Le,pe].join(En)+ce+"\\)$"),fs=new RegExp("^hsla?\\("+ce+[Dt,Et,Et].join(Ze)+Xe+"\\)$"),ps=new RegExp("^hsl?\\("+ce+[Dt,Et,Et].join(En)+ce+"\\)$"),ms=/^hsla\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,hs=new RegExp("^lab\\("+ce+[pe,pe,pe].join(Ze)+Xe+"\\)$"),gs=new RegExp("^lch\\("+ce+[pe,pe,Dt].join(Ze)+Xe+"\\)$"),bs=new RegExp("^oklab\\("+ce+[pe,pe,pe].join(Ze)+Xe+"\\)$"),xs=new RegExp("^oklch\\("+ce+[pe,pe,Dt].join(Ze)+Xe+"\\)$"),{round:ys}=Math,Fe=e=>e.map((t,n)=>n<=2?Ne(ys(t),0,255):t),X=(e,t=0,n=100,r=!1)=>(typeof e=="string"&&e.endsWith("%")&&(e=parseFloat(e.substring(0,e.length-1))/100,r?e=t+(e+1)*.5*(n-t):e=t+e*(n-t)),+e),se=(e,t)=>e==="none"?t:e,Rn=e=>{if(e=e.toLowerCase().trim(),e==="transparent")return[0,0,0,0];let t;if(F.format.named)try{return F.format.named(e)}catch{}if((t=e.match(cs))||(t=e.match(ds))){let n=t.slice(1,4);for(let s=0;s<3;s++)n[s]=+X(se(n[s],0),0,255);n=Fe(n);const r=t[4]!==void 0?+X(t[4],0,1):1;return n[3]=r,n}if(t=e.match(us)){const n=t.slice(1,5);for(let r=0;r<4;r++)n[r]=+X(n[r],0,255);return n}if((t=e.match(fs))||(t=e.match(ps))){const n=t.slice(1,4);n[0]=+se(n[0].replace("deg",""),0),n[1]=+X(se(n[1],0),0,100)*.01,n[2]=+X(se(n[2],0),0,100)*.01;const r=Fe(hn(n)),s=t[4]!==void 0?+X(t[4],0,1):1;return r[3]=s,r}if(t=e.match(ms)){const n=t.slice(1,4);n[1]*=.01,n[2]*=.01;const r=hn(n);for(let s=0;s<3;s++)r[s]=ys(r[s]);return r[3]=+t[4],r}if(t=e.match(hs)){const n=t.slice(1,4);n[0]=X(se(n[0],0),0,100),n[1]=X(se(n[1],0),-125,125,!0),n[2]=X(se(n[2],0),-125,125,!0);const r=dt();Se("d50");const s=Fe(Sn(n));Se(r);const i=t[4]!==void 0?+X(t[4],0,1):1;return s[3]=i,s}if(t=e.match(gs)){const n=t.slice(1,4);n[0]=X(n[0],0,100),n[1]=X(se(n[1],0),0,150,!1),n[2]=+se(n[2].replace("deg",""),0);const r=dt();Se("d50");const s=Fe(Pn(n));Se(r);const i=t[4]!==void 0?+X(t[4],0,1):1;return s[3]=i,s}if(t=e.match(bs)){const n=t.slice(1,4);n[0]=X(se(n[0],0),0,1),n[1]=X(se(n[1],0),-.4,.4,!0),n[2]=X(se(n[2],0),-.4,.4,!0);const r=Fe(An(n)),s=t[4]!==void 0?+X(t[4],0,1):1;return r[3]=s,r}if(t=e.match(xs)){const n=t.slice(1,4);n[0]=X(se(n[0],0),0,1),n[1]=X(se(n[1],0),0,.4,!1),n[2]=+se(n[2].replace("deg",""),0);const r=Fe(ls(n)),s=t[4]!==void 0?+X(t[4],0,1):1;return r[3]=s,r}};Rn.test=e=>cs.test(e)||fs.test(e)||hs.test(e)||gs.test(e)||bs.test(e)||xs.test(e)||ds.test(e)||us.test(e)||ps.test(e)||ms.test(e)||e==="transparent";L.prototype.css=function(e){return _l(this._rgb,e)};const Ol=(...e)=>new L(...e,"css");U.css=Ol;F.format.css=Rn;F.autodetect.push({p:5,test:(e,...t)=>{if(!t.length&&W(e)==="string"&&Rn.test(e))return"css"}});F.format.gl=(...e)=>{const t=z(e,"rgba");return t[0]*=255,t[1]*=255,t[2]*=255,t};const Ml=(...e)=>new L(...e,"gl");U.gl=Ml;L.prototype.gl=function(){const e=this._rgb;return[e[0]/255,e[1]/255,e[2]/255,e[3]]};L.prototype.hex=function(e){return Zr(this._rgb,e)};const Nl=(...e)=>new L(...e,"hex");U.hex=Nl;F.format.hex=Vr;F.autodetect.push({p:4,test:(e,...t)=>{if(!t.length&&W(e)==="string"&&[3,4,5,6,7,8,9].indexOf(e.length)>=0)return"hex"}});const{log:Ct}=Math,vs=e=>{const t=e/100;let n,r,s;return t<66?(n=255,r=t<6?0:-155.25485562709179-.44596950469579133*(r=t-2)+104.49216199393888*Ct(r),s=t<20?0:-254.76935184120902+.8274096064007395*(s=t-10)+115.67994401066147*Ct(s)):(n=351.97690566805693+.114206453784165*(n=t-55)-40.25366309332127*Ct(n),r=325.4494125711974+.07943456536662342*(r=t-50)-28.0852963507957*Ct(r),s=255),[n,r,s,1]},{round:Dl}=Math,$l=(...e)=>{const t=z(e,"rgb"),n=t[0],r=t[2];let s=1e3,i=4e4;const a=.4;let l;for(;i-s>a;){l=(i+s)*.5;const c=vs(l);c[2]/c[0]>=r/n?i=l:s=l}return Dl(l)};L.prototype.temp=L.prototype.kelvin=L.prototype.temperature=function(){return $l(this._rgb)};const sn=(...e)=>new L(...e,"temp");Object.assign(U,{temp:sn,kelvin:sn,temperature:sn});F.format.temp=F.format.kelvin=F.format.temperature=vs;L.prototype.oklch=function(){return is(this._rgb)};const Bl=(...e)=>new L(...e,"oklch");Object.assign(U,{oklch:Bl});F.format.oklch=ls;F.autodetect.push({p:2,test:(...e)=>{if(e=z(e,"oklch"),W(e)==="array"&&e.length===3)return"oklch"}});Object.assign(U,{analyze:ss,average:Fi,bezier:Ki,blend:me,brewer:kl,Color:L,colors:He,contrast:pl,contrastAPCA:gl,cubehelix:ol,deltaE:vl,distance:jl,input:F,interpolate:Ke,limits:os,mix:Ke,random:cl,scale:Tt,scales:wl,valid:Cl});const Fl=(e,t)=>{const n=U(e);return t==="dark"?n.brighten(4).hex():n.hex()},zl=(e,t)=>{const n=U(e);return t==="dark"?n.brighten(2).alpha(.4).hex():n.luminance()>.5?n.darken(3).hex():n.brighten(.5).alpha(.25).hex()},Ul=(e,t)=>{const n=U(e);return t==="dark"?n.luminance()>.5?n.darken(2).alpha(.5).hex():n.brighten(1.5).alpha(.35).hex():n.luminance()>.5?n.darken(2.5).hex():n.brighten(2.5).alpha(.25).hex()},Wl=(e,t)=>t==="dark"?"brightness(1.3) contrast(1.2)":"brightness(0.85) contrast(1.2)";var ot={},br;function ql(){return br||(br=1,function(e){var t=ot&&ot.__assign||function(){return(t=Object.assign||function(a){for(var l,c=1,f=arguments.length;c<f;c++)for(var u in l=arguments[c])Object.prototype.hasOwnProperty.call(l,u)&&(a[u]=l[u]);return a}).apply(this,arguments)},n=(Object.defineProperty(e,"__esModule",{value:!0}),{id:"id",parentId:"parentId",dataField:"data",childrenField:"children",throwIfOrphans:!1,rootParentIds:{"":!(e.countNodes=e.arrayToTree=void 0)},nestedIds:!0,assign:!1});function r(a,l){l===void 0&&(l={});for(var c,f=t(t({},n),l),u=[],h={},x=f.throwIfOrphans?new Set:null,C=0,j=a;C<j.length;C++){var S=j[C],p=f.nestedIds?i(S,f.id):S[f.id],d=f.nestedIds?i(S,f.parentId):S[f.parentId];if(f.rootParentIds[p])throw new Error("The item array contains a node whose parentId both exists in another node and is in "+'`rootParentIds` (`itemId`: "'.concat(p,'", `rootParentIds`: ').concat(Object.keys(f.rootParentIds).map(function(m){return'"'.concat(m,'"')}).join(", "),")."));Object.prototype.hasOwnProperty.call(h,p)||(h[p]=((c={})[f.childrenField]=[],c)),x&&x.delete(p),f.dataField?h[p][f.dataField]=S:f.assign?h[p]=Object.assign(S,((c={})[f.childrenField]=h[p][f.childrenField],c)):h[p]=t(t({},S),((S={})[f.childrenField]=h[p][f.childrenField],S)),S=h[p],d==null||f.rootParentIds[d]?u.push(S):(Object.prototype.hasOwnProperty.call(h,d)||(h[d]=((p={})[f.childrenField]=[],p),x&&x.add(d)),h[d][f.childrenField].push(S))}if(x!=null&&x.size)throw new Error("The items array contains orphans that point to the following parentIds: "+"[".concat(Array.from(x),"]. These parentIds do not exist in the items array. Hint: prevent orphans to result ")+"in an error by passing the following option: { throwIfOrphans: false }");if(f.throwIfOrphans&&s(u,f.childrenField)<Object.keys(h).length)throw new Error("The items array contains nodes with a circular parent/child relationship.");return u}function s(a,l){return a.reduce(function(c,f){return c+1+(f[l]&&s(f[l],l))},0)}function i(a,l){return l.split(".").reduce(function(c,f){return c&&c[f]},a)}e.arrayToTree=r,e.countNodes=s}(ot)),ot}var Hl=ql();class _n{constructor({data:t,parent:n,children:r}){this.data=t,this.parent=n,this.children=r||[]}setParent(t){this.parent=t}add(...t){this.children.push(...t),t.forEach(n=>n.setParent(this))}removeChild(t){this.children=this.children.filter(n=>n!==t),t.setParent(void 0)}isLeaf(t){return!t.children?.length}getAllParents(t=!0){const n=[];t&&n.unshift(this);let{parent:r}=this;for(;r;)n.unshift(r),r=r.parent;return n}getAllSiblings(){return this.parent?.children.filter(n=>n!==this)||[]}flatten(t){const n=[],r=s=>{n.push(s),s.children.forEach(r)};return r(this),t||n.shift(),n}clone(){const t=new _n({data:this.data});return t.add(...this.children),t}}class js{constructor(t){this.id=t.id,this.title=t.title,this.description=t.description,this.icon=t.icon,this.type=t.type,this.color=t.color||"#4B5563",this.data=t}getName(t){return t?this?.title:this.title}}class $t extends _n{getName(t){return this.data?.getName?.(t)??""}isSystemLabel(){return this.data?.type==="system"}getFullName(t){return this.getAllParents().slice(1).map(r=>t?r.getName(t):r.data?.title??"").join(" / ")}}const Cs=(e,t)=>e.map(n=>{const r=new $t({data:new js(n.data||{}),parent:t}),s=Cs(n.children||[],r);return r.add(...s),r}),Kl=e=>{const t=Hl.arrayToTree(e||[]),n=new $t({data:{}});return n.add(...Cs(t)),n},Yl=()=>new $t({data:{}});function Gl(e,t,n){return e[t]?.data.getName(n)}function Vl(e,t,n){return e[t]?.getFullName(n)??t}function Zl(e,t){return!!e[t]}function Xl(e,t){return t.map(n=>e[n]).filter(Boolean)}function Ql(e,t,n){return!t||!n(t)?e:No([t,...e]).slice(0,10)}const ws=k.createContext(null),Jl=100;function Bt({children:e}){const{locale:t}=J(),{api:n}=de(),{teamDid:r}=ge(),s=Ye({loading:!0,tree:Yl(),stats:[],labels:[]}),i=async()=>{try{const m=((await n.getTags({input:{teamDid:r,paging:{page:1,pageSize:Jl}}})).tags||[]).map(b=>(b.createdAt&&(b.createdAt=new Date(b.createdAt).getTime()),b.updatedAt&&(b.updatedAt=new Date(b.updatedAt).getTime()),b)),y=Kl(m||[]);s.labels=m,s.loading=!1,s.tree=y}catch(d){console.error(d),s.loading=!1,oe.error(le(d))}};k.useEffect(()=>{i()},[n,r,s]);const a=k.useMemo(()=>s.tree.flatten(),[s.tree]),l=k.useMemo(()=>a.reduce((d,m)=>(d[m.data.id]=m,d),{}),[a]),c=k.useCallback(d=>Gl(l,d,t),[l,t]),f=k.useCallback(d=>Vl(l,d,t),[l,t]),u=k.useCallback(d=>Zl(l,d),[l]),h=k.useCallback(d=>Xl(l,d),[l]),[x=[],C]=_r("recent-label-ids",{defaultValue:[]}),j=k.useCallback(d=>C(Ql(x,d,u)),[x,u,C]),p={...s,flattenedLabels:a,getLabelsByIds:h,getLabelName:c,createLabel:async d=>{try{const m=await n.createTag({input:{teamDid:r,tag:{title:d,color:"#4B5563",slug:d}}}),y=new $t({data:new js(m.tag)});return s.tree.add(y),s.tree=s.tree.clone(),y.data}catch(m){return oe.error(le(m)),null}},getFullLabelName:f,recentLabels:x,addRecentLabel:j,labels:Array.from(s.labels),loading:s.loading,refetch:i};return o.jsx(ws.Provider,{value:p,children:e})}Bt.propTypes={children:w.node.isRequired};function Qe(){return k.useContext(ws)}function Pe({label:e,onDelete:t=void 0,onClick:n=void 0,sx:r=void 0,disabled:s=!1,fullName:i=!0}){const a=yn(),{mode:l}=a.palette,{getFullLabelName:c,getLabelName:f}=Qe(),u=Fl(e.color,l),h=Ul(e.color,l),x=zl(e.color,l),C=Wl(e.color,l),j=[{height:20,borderRadius:.5,fontSize:12,fontWeight:500,color:`${u} !important`,bgcolor:`${h} !important`,borderColor:`${x} !important`,transition:"filter 0.2s",WebkitTextFillColor:`${u} !important`,".MuiChip-deleteIcon":{color:`${u} !important`,cursor:"pointer",transition:"transform 0.3s","&:hover":{transform:"rotate(90deg)"}},".MuiChip-label":{px:.5,maxHeight:20},...n&&!s&&{cursor:"pointer","&:hover":{filter:C}}},...Array.isArray(r)?r:[r]],S=!s&&typeof t=="function",p=!s&&typeof n=="function",d=(y,b)=>{y.stopPropagation(),y.preventDefault(),b?.(e)},m=i?c(e.id):f(e.id);return o.jsx(lo,{label:m||e.title,variant:"outlined",size:"small",...!s&&S&&t&&{onDelete:y=>d(y,t),deleteIcon:o.jsx(Lr,{})},...!s&&p&&{onClick:y=>d(y,n)},sx:j},e.id)}Pe.propTypes={label:w.shape({id:w.string.isRequired,color:w.string.isRequired,title:w.string,slug:w.string}).isRequired,onDelete:w.func,onClick:w.func,sx:w.oneOfType([w.object,w.array]),disabled:w.bool,fullName:w.bool};function ks({...e}){return o.jsx(I,{...e,sx:t=>({[`& .${xt.paper}`]:{width:360,boxShadow:"none",margin:0,color:"inherit",fontSize:13},[`& .${xt.listbox}`]:{bgcolor:t.palette.background.paper,padding:1,[`& .${xt.option}`]:{minHeight:"auto"}},[`&.${xt.popperDisablePortal}`]:{position:"relative"}})})}ks.propTypes={};function ut({value:e=[],onChange:t=void 0,noLabelsText:n=void 0,buttonSx:r=void 0,actions:s=void 0,trigger:i=void 0,multiple:a=!0,updateImmediately:l=!0,excludes:c=[],disabled:f=!1,enableAccessControl:u=!0,disablePortal:h=!1,disableCreate:x=!1}){const{t:C,locale:j}=J(),{session:S}=De(),p=["owner","admin"].includes(S?.user?.role),{flattenedLabels:d,getLabelsByIds:m,loading:y,createLabel:b,recentLabels:v,addRecentLabel:P}=Qe(),[g,A]=k.useState(null),[T,_]=k.useState(""),M=e,O=k.useMemo(()=>m(M),[m,M]),B=k.useMemo(()=>d.some(N=>N.data.getName(j)?.toLowerCase()===T.toLowerCase()),[T,d,j]),Y=k.useMemo(()=>{const N=new Set(c);return d.filter(K=>!N.has(K.data.id))},[d,c]),H=k.useMemo(()=>{const N=new Set(c);return v.filter(K=>!N.has(K))},[v,c]),ee=!!g,ne=ee?"label-picker":void 0,R=N=>N?{bgcolor:K=>`${K.palette.primary.main} !important`,color:K=>`${K.palette.primary.contrastText} !important`,WebkitTextFillColor:K=>`${K.palette.primary.contrastText} !important`}:void 0,D=()=>!u||p,Q=N=>{f||(N.preventDefault(),A(N.currentTarget))},be=()=>{l||t?.(M),_(""),g?.focus(),A(null)},Je=async()=>{const{id:N}=await b(T);a?l&&t([...M,N]):t?.([N])},ue=N=>{a?l&&t(N):(t?.(N.length?[N[N.length-1]]:[]),A(null))};if(y)return null;const Ft=()=>{const N=m(H).filter(D);return N?.length?o.jsxs(I,{component:"li",children:[o.jsx(I,{sx:{mb:.5,fontSize:12,fontWeight:"medium"},children:C("label.recently")}),o.jsx(I,{sx:{display:"flex",flexWrap:"wrap",gap:.75,mb:2},children:N.map(K=>{const re=K.data.id,Ce=e?.includes(re);return o.jsx(Pe,{label:K.data,onClick:()=>ue(Ce?M.filter(et=>et!==re):[...M,re]),sx:{height:24,lineHeight:"24px",".MuiChip-label":{maxHeight:24},...R(Ce)}},re)})})]}):null},ft=N=>o.jsxs(I,{component:"li",children:[o.jsx(I,{sx:{mb:.5,fontSize:12,fontWeight:"medium"},children:C("label.title")}),o.jsx(I,{component:"ul",sx:{display:"flex",flexWrap:"wrap",gap:.75,p:0},children:N.children})]}),pt=()=>o.jsx(po,{open:!0,multiple:!0,inputValue:T,onInputChange:(N,K,re)=>{re==="reset"||re==="blur"||_(K)},onClose:(N,K)=>K==="escape"&&be(),value:O,onChange:(N,K,re)=>{N.preventDefault(),!(N.type==="keydown"&&N.key==="Backspace"&&re==="removeOption")&&(re==="selectOption"&&P(K[K.length-1].data.id),ue(K.map(Ce=>Ce.data.id)))},disableCloseOnSelect:!0,renderTags:()=>null,noOptionsText:n||C("label.noLabels"),groupBy:()=>"x",renderOption:(N,K,{selected:re})=>{if(!D())return null;const Ce=K.data;return k.createElement(I,{component:"li",...N,key:Ce.id,sx:{"&.MuiAutocomplete-option":{p:"0 !important"}}},o.jsx(Pe,{label:Ce,sx:{height:24,lineHeight:"24px",".MuiChip-label":{maxHeight:24},...R(re)}}))},renderGroup:N=>o.jsxs(k.Fragment,{children:[Ft(),ft(N)]},N.key),options:Y,getOptionLabel:N=>N.data.getName(j),renderInput:N=>o.jsx(I,{component:Ir,ref:N.InputProps.ref,inputProps:N.inputProps,autoFocus:!0,placeholder:C("label.filter"),sx:K=>({padding:1,width:"100%",bgcolor:"background.paper","& input":{borderRadius:1,backgroundColor:"background.paper",padding:1,transition:K.transitions.create(["border-color","box-shadow"]),border:`1px solid ${K.palette.divider}`,fontSize:14,"&:focus":{boxShadow:`0px 0px 0px 3px ${Pr(K.palette.primary.light,.4)}`,borderColor:K.palette.primary.light}}})}),slots:{popper:ks}}),mt=()=>o.jsxs(I,{onClick:N=>N.stopPropagation(),children:[p&&T&&!B&&o.jsx(I,{sx:{display:"flex",alignItems:"center",gap:1,width:"100%",height:36,px:2,borderTop:"1px solid",borderColor:"divider",fontSize:14,color:"grey.600",cursor:"pointer"},onClick:Je,children:C("label.createNewLabel",{name:T})}),s]});return o.jsxs(o.Fragment,{children:[o.jsx(I,{onClick:Q,sx:{display:"flex",alignItems:"center"},children:i||o.jsx(co,{disableRipple:!0,"aria-describedby":ne,className:"label-picker-trigger",sx:[N=>({width:"100%",fontSize:13,color:N.palette.mode==="light"?"#586069":"#8b949e",fontWeight:600,"&:hover":{color:N.palette.mode==="light"?"primary.main":"#58a6ff"},"& svg":{width:22,height:22}}),...Array.isArray(r)?r:[r]],children:o.jsx(Rt,{style:{fontSize:14}})})}),o.jsx(uo,{id:ne,open:ee,anchorEl:g,placement:"bottom-start",disablePortal:h,sx:N=>({border:`1px solid ${N.palette.divider}`,boxShadow:`0 8px 24px ${N.palette.mode==="light"?"rgba(149, 157, 165, 0.2)":"rgb(1, 4, 9)"}`,borderRadius:1,width:360,overflow:"hidden",zIndex:N.zIndex.modal,fontSize:13,color:"text.secondary",backgroundColor:"background.paper"}),children:o.jsx(fo,{onClickAway:be,children:o.jsxs(I,{onClick:N=>N.preventDefault(),children:[pt(),!x&&mt()]})})})]})}ut.propTypes={value:w.array,onChange:w.func,noLabelsText:w.string,buttonSx:w.array,actions:w.array,trigger:w.element,multiple:w.bool,updateImmediately:w.bool,excludes:w.array,disabled:w.bool,enableAccessControl:w.bool,disablePortal:w.bool,labels:w.array,disableCreate:w.bool};const ec={".MuiSvgIcon-root":{fontSize:"1.25rem"}};function Ss({sx:e={},...t}){return o.jsx(kt,{variant:"outlined",IconComponent:mo,sx:Er(ec,e),...t})}Ss.propTypes={sx:w.object};function On({value:e=[],onChange:t=()=>{},LabelPickerProps:n={},disabled:r=!1,sx:s=[],compact:i=!0,multiple:a=!0,...l}){const{getLabelsByIds:c,loading:f}=Qe(),u=k.useMemo(()=>c(e),[c,e]),h=e?.length>0,x=[{},...Array.isArray(s)?s:[s]],{t:C}=J(),j=e?.length?"":l.placeholder||C("label.selectLabels"),S=k.useRef(null),p=Or(S),[d,m]=k.useState(99999);return k.useLayoutEffect(()=>{if(i){if(S.current){const{right:y}=S.current.getBoundingClientRect(),b=S.current.querySelectorAll(".MuiChip-root");b&&(Array.from(b).some((P,g)=>P.getBoundingClientRect().right>y?(m(g),!0):!1)||m(99999))}}else m(99999)},[u,p,i]),f?null:o.jsx(ut,{disabled:r,value:e,onChange:t,multiple:a,trigger:o.jsx(Ss,{multiple:a,disabled:r,open:!1,value:h?e:["none"],size:"small",renderValue:()=>h?o.jsx(I,{sx:{...i&&{height:20},mt:-.1,pr:3},children:o.jsx(I,{ref:S,sx:{display:"flex",gap:.5,...!i&&{flexWrap:"wrap"}},children:u.map((y,b)=>{const v=b<d;return o.jsxs(I,{sx:{position:"relative"},children:[b===d&&o.jsx(I,{sx:{display:"inline-flex",...i&&{height:20,lineHeight:"20px"},color:"text.secondary",fontWeight:"bold",fontSize:14},children:`+${e.length-d}`}),o.jsx(Pe,{label:y.data,sx:{visibility:v?"visible":"hidden",pointerEvents:v?"auto":"none"},onDelete:()=>t(e.filter(P=>P!==y.data.id)),disabled:r})]},y.data.id)})})}):o.jsx(I,{sx:{color:"text.secondary",fontSize:14},children:j}),sx:x}),...n})}On.propTypes={value:w.array,onChange:w.func,LabelPickerProps:w.object,disabled:w.bool,sx:w.array,compact:w.bool,multiple:w.bool};function ze({labelPlacement:e="top",sx:t={},...n}){const s=Er({alignItems:"stretch",m:0,".MuiFormControlLabel-label":{fontSize:14,fontWeight:"medium"}},t);return e==="start"&&s.push({justifyContent:"space-between",alignItems:"center"}),o.jsx(vn,{labelPlacement:e,...n,sx:s})}ze.propTypes={labelPlacement:w.oneOf(["top","start"]),sx:w.any};const on=["#4B5563","#1D4ED8","#6D28D9","#BE123C","#B45309","#047857"],xr=e=>{const t=new Option;return t.style.color=e,!!t.style.color};function Ls({open:e=!1,initialValue:t={},onSubmit:n=()=>{},onClose:r=()=>{},...s}){const{t:i}=J(),a=!t?.id,[l,c]=k.useState(null),{control:f,handleSubmit:u,watch:h,setValue:x,reset:C,formState:{isValid:j}}=ha({defaultValues:{id:t?.id||"",slug:t?.slug||"",title:t?.title||"",description:t?.description||"",color:t?.color||on[0],parentId:t?.parentId||""},mode:"onChange"}),S=h();k.useEffect(()=>{C({id:t?.id||"",slug:t?.slug||"",title:t?.title||"",description:t?.description||"",color:t?.color||on[0],parentId:t?.parentId||""})},[t,C]),k.useEffect(()=>{S.title&&a&&x("slug",sa.urlPathFriendly(S.title),{shouldValidate:!0})},[S.title,a,x]);const p=b=>{n({...t,...b})},d=b=>{x("color",b.hex,{shouldValidate:!0})},m={id:S.id,title:S.title,color:S.color},y=!!l;return o.jsx(ve,{open:e,showCloseButton:!0,maxWidth:"lg",title:i(a?"label.create":"label.edit"),actions:o.jsxs(I,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:1,width:"100%"},children:[o.jsx(I,{children:xr(m.color)&&m.title&&o.jsx(Pe,{label:m})}),o.jsxs(I,{sx:{display:"flex",justifyContent:"flex-end",gap:1},children:[o.jsx(Ae,{color:"inherit",variant:"outlined",size:"small",onClick:r,children:i("common.cancel")}),o.jsx(Ae,{type:"submit",color:"primary",variant:"contained",size:"small",onClick:u(p),disabled:!j,children:i(a?"common.create":"common.saveChanges")})]})]}),onClose:r,...s,children:o.jsxs(I,{sx:{width:{xs:1,md:600},display:"flex",flexDirection:"column",gap:1.5},children:[o.jsx(ze,{label:i("label.name"),sx:{width:"100%"},control:o.jsx(nt,{name:"title",control:f,rules:{required:i("label.nameRequired"),minLength:{value:1,message:i("label.nameMinLength")},maxLength:{value:64,message:i("label.nameMaxLength")}},render:({field:b,fieldState:v})=>o.jsx(Ie,{...b,size:"small",fullWidth:!0,error:!!v.error,helperText:v.error?.message})})}),o.jsx(ze,{label:i("label.slug"),sx:{width:"100%"},control:o.jsx(nt,{name:"slug",control:f,rules:{required:i("label.slugRequired"),minLength:{value:1,message:i("label.slugMinLength")},maxLength:{value:128,message:i("label.slugMaxLength")}},render:({field:b,fieldState:v})=>o.jsx(Ie,{...b,size:"small",fullWidth:!0,disabled:!a,error:!!v.error,helperText:v.error?.message})})}),o.jsx(ze,{label:i("label.description"),sx:{width:"100%"},control:o.jsx(nt,{name:"description",control:f,rules:{maxLength:{value:255,message:i("label.descriptionMaxLength")}},render:({field:b,fieldState:v})=>o.jsx(Ie,{...b,size:"small",fullWidth:!0,multiline:!0,rows:3,error:!!v.error,helperText:v.error?.message})})}),o.jsx(ze,{label:i("label.parentLabel"),sx:{width:"100%"},control:o.jsx(nt,{name:"parentId",control:f,render:({field:b})=>o.jsx(On,{value:b.value?[b.value]:[],onChange:v=>b.onChange(v[0]),sx:{width:1},multiple:!1,LabelPickerProps:{excludes:t?.id?[t.id]:[]}})})}),o.jsx(ze,{label:i("label.color"),sx:{width:"100%"},control:o.jsx(nt,{name:"color",control:f,rules:{required:i("label.colorRequired"),validate:b=>xr(b)||i("label.colorInvalid")},render:({field:b,fieldState:v})=>o.jsxs(I,{sx:{position:"relative"},children:[o.jsxs(I,{sx:{display:"flex",alignItems:"center",gap:1},children:[o.jsx(I,{sx:{width:32,height:32,bgcolor:b.value,borderRadius:1,border:1,borderColor:v.error?"error.main":"grey.400",cursor:"pointer"},onClick:P=>c(P.currentTarget)}),v.error&&o.jsx(I,{sx:{color:"error.main",fontSize:"0.75rem"},children:v.error.message})]}),o.jsx(ho,{id:y?"label-color-picker":void 0,anchorEl:l,open:y,onClose:()=>c(null),anchorOrigin:{vertical:"top",horizontal:"center"},transformOrigin:{vertical:"bottom",horizontal:"center"},children:o.jsx(ga,{presetColors:on,color:b.value,onChange:d})})]})})})]})})}Ls.propTypes={open:w.bool,initialValue:w.object,onSubmit:w.func,onClose:w.func};const yr=new WeakMap;let tc=0;function nc(e){if(!e||typeof e!="object")return"weak-key-default";let t=yr.get(e);return t||(t=`weak-key-${tc++}`,yr.set(e,t)),t}function Ps({open:e=!1,title:t=void 0,description:n=void 0,handleOk:r=void 0,handleCancel:s=void 0,okText:i=void 0,okButtonProps:a=void 0,cancelText:l=void 0,cancelButtonProps:c=void 0,actions:f=void 0,...u}){const h=yn(),x=go(h.breakpoints.down("md")),{t:C}=J(),j=()=>k.isValidElement(n)?n:o.jsx(_t,{children:n}),S=k.useMemo(()=>{const p=[o.jsx(Ae,{color:"inherit",variant:"text",onClick:s,...c,children:l||C("common.cancel")||"Cancel"},"cancel"),o.jsx(Ae,{color:"primary",variant:"contained",onClick:r,...a,children:i||C("common.confirm")||"Yes"},"ok")];return f?f(p,s):p},[C,i,l,a,c,f,s,r]);return e?o.jsxs(bo,{fullScreen:x,onClose:s,maxWidth:"md",...u,open:e,children:[t&&o.jsx(xo,{variant:"h4",children:t}),o.jsx(yo,{sx:{minWidth:{xs:"initial",md:400}},children:j()}),o.jsx(vo,{children:S})]}):null}Ps.propTypes={open:w.bool,title:w.string,description:w.string,handleOk:w.func,handleCancel:w.func,okText:w.string,okButtonProps:w.object,cancelText:w.string,cancelButtonProps:w.object,actions:w.func};const Is=k.createContext({}),rc=()=>k.useContext(Is);function As({children:e=null}){const[t,n]=k.useState(!1),[r,s]=k.useState({}),i=k.useRef(void 0),a=()=>{i.current?.(!0),n(!1)},l=()=>{i.current?.(!1),n(!1)},c=u=>(s(u),n(!0),new Promise(h=>{i.current=h})),f=k.useMemo(()=>({open:t,confirm:c}),[t]);return o.jsxs(Is.Provider,{value:f,children:[e,o.jsx(Ps,{...r.dialogProps||{},open:t,onClose:l,title:r.title,description:r.description,okText:r.okText,okButtonProps:r.okButtonProps,cancelText:r.cancelText,cancelButtonProps:r.cancelButtonProps,handleOk:a,handleCancel:l,actions:r.actions})]})}As.propTypes={children:w.node};function Ts({compact:e=!0,labels:t=[],sx:n=[],renderLabel:r=void 0,renderWhenEmpty:s=void 0,prepend:i=void 0,displaySystemLabels:a=!0,onItemClick:l=void 0}){const{getLabelsByIds:c,loading:f}=Qe(),u=k.useRef(null),h=Or(u),[x,C]=k.useState(99999);let j=c(t||[]);if(a||(j=j.filter(p=>p.data.type!=="system")),Zo(()=>{if(!e||!u.current){C(99999);return}const{right:p}=u.current.getBoundingClientRect(),d=u.current.querySelectorAll(".MuiChip-root");Array.from(d).some((m,y)=>m.getBoundingClientRect().right>p-36?(C(y),!0):!1)},[h,e]),f)return null;const S=[{display:"flex",gap:1,width:"100%",alignItems:"center",overflow:"hidden",flexWrap:e?"no-wrap":"wrap"},...Array.isArray(n)?n:[n]];return o.jsxs(I,{sx:S,ref:u,children:[i,j.length===0&&s,j.map((p,d)=>{if(!p)return null;const m=d<x,y=d===x,b=o.jsx(Pe,{label:p.data,onClick:l,sx:{visibility:m?"visible":"hidden",pointerEvents:m?"auto":"none"}},p.data.id),v=r?r(p,b):b;return y?[o.jsx(I,{sx:{display:"inline-flex",...e&&{height:20,lineHeight:"20px"},color:"text.secondary",fontWeight:"bold",fontSize:14},children:`+${j.length-x}`},"overflow-label"),v]:v})]})}Ts.propTypes={compact:w.bool,labels:w.array,sx:w.oneOfType([w.object,w.array]),renderLabel:w.func,renderWhenEmpty:w.func,prepend:w.node,displaySystemLabels:w.bool,onItemClick:w.func};function Es({exclude:e=void 0,onChange:t=void 0}){const[n,r]=k.useState([]),{t:s}=J();return o.jsxs(I,{sx:{minHeight:200},children:[o.jsx(_e,{severity:"info",sx:{mb:2},children:s("label.reassignTip")}),o.jsx(I,{sx:{display:"flex",alignItems:"center",gap:1},children:o.jsx(ut,{value:[n],onChange:i=>{r(i),t?.(i[0])},trigger:o.jsxs(Ae,{color:"inherit",variant:"outlined",startIcon:o.jsx(Rt,{style:{fontSize:14}}),children:[o.jsx(I,{component:"span",sx:{mr:1,whiteSpace:"nowrap"},children:s("label.reassignTo")}),!!n.length&&o.jsx(Ts,{compact:!1,labels:n})]}),multiple:!1,excludes:[e]})})]})}Es.propTypes={exclude:w.string,onChange:w.func};function Mn({onReload:e=()=>{},...t}){const{t:n}=J(),{api:r}=de(),{teamDid:s}=ge(),{confirm:i}=rc(),{labels:a,refetch:l}=Qe(),c=a||[],[f,u]=k.useState(null),[h,x]=k.useState(""),C=c.filter(m=>`${m.id}-${m.title}`.toLowerCase().includes(h.toLowerCase())),j=m=>{f||u({title:"New label",slug:"new-label",parentId:m})},S=m=>{f||u(m)},p=async m=>{const y=Do(m,b=>b);if(f)try{f.id?await r.updateTag({input:{teamDid:s,tag:y}}):await r.createTag({input:{teamDid:s,tag:y}}),oe.success(n("label.saveSuccess")),u(null),l(),e()}catch(b){oe.error(le(b))}},d=async m=>{let y;if(await i({title:n("label.deleteTip",{name:m.title}),description:o.jsxs(I,{sx:{width:540,maxWidth:"100%"},children:[o.jsx(ye,{variant:"body1",children:n("label.deleteDesc",{name:m.title})}),o.jsx(I,{sx:{py:2,color:"grey.800"},children:o.jsx(Bt,{children:o.jsx(Es,{exclude:m.id,onChange:v=>{y=v}})})})]})})){const v={teamDid:s,tag:m};y&&(v.moveTo=y),await r.deleteTag({input:v}).then(()=>{l(),oe.success(n("label.deleteSuccess")),e()}).catch(P=>{oe.error(le(P))})}};return o.jsxs(o.Fragment,{children:[o.jsxs(I,{sx:{display:"flex",flexDirection:"column",gap:2.5},...t,children:[o.jsxs(I,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[o.jsx(ye,{variant:"h3"}),o.jsxs(I,{sx:{display:"flex",alignItems:"center",gap:1},children:[o.jsx(I,{component:Ir,value:h,onChange:m=>x(m.target.value),placeholder:n("label.search"),startAdornment:o.jsx(Ar,{}),sx:m=>({width:300,"& input":{p:1,px:4.5,borderRadius:1,backgroundColor:m.palette.mode==="light"?"#fff":"#0d1117",transition:m.transitions.create(["border-color","box-shadow"]),border:`1px solid ${m.palette.mode==="light"?"#eaecef":"#30363d"}`,fontSize:14,"&:focus":{boxShadow:`0px 0px 0px 3px ${m.palette.mode==="light"?Pr(m.palette.primary.light,.4):"rgb(12, 45, 107)"}`,borderColor:m.palette.mode==="light"?m.palette.primary.light:"#388bfd"}},"& .MuiSvgIcon-root":{position:"absolute",left:8,fontSize:20,color:"grey.700"}})}),o.jsx(Ae,{color:"primary",variant:"contained",startIcon:o.jsx(Ue,{}),sx:{textTransform:"none"},onClick:()=>j(),children:n("label.create")})]})]}),o.jsx(jo,{}),o.jsxs(I,{sx:{display:"flex",flexDirection:"column",gap:1},children:[C.map(m=>o.jsxs(I,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",py:1,px:2,border:1,borderColor:"grey.300",gap:1,borderRadius:1.5},children:[o.jsx(I,{children:o.jsx(I,{sx:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:1},children:o.jsx(I,{sx:{display:"inline-flex",alignItems:"center",gap:1,py:.5,fontSize:14,color:"grey.700",fontWeight:"bold",borderRadius:"4px"},children:o.jsx(Pe,{label:m})})})}),o.jsx(I,{sx:{display:"flex",gap:.5,flex:"0 0 auto"},children:o.jsxs(I,{sx:{display:"flex",gap:.5},children:[o.jsx(it,{color:"inherit",size:"small",sx:{color:"grey.500"},onClick:()=>j(m.id),children:o.jsx(Ue,{sx:{fontSize:20}})}),o.jsx(it,{color:"inherit",size:"small",sx:{color:"grey.500"},onClick:()=>S(m),children:o.jsx(Co,{sx:{fontSize:18}})}),o.jsx(it,{disabled:m.type==="system",size:"small",sx:{color:"error.main"},onClick:()=>d(m),children:o.jsx(wo,{sx:{fontSize:20}})})]})})]},m.id)),C?.length===0&&o.jsx(I,{height:300,children:o.jsx(Rr,{children:n("label.noLabels")})})]})]}),o.jsx(Ls,{open:!!f,onClose:()=>u(null),initialValue:f,onSubmit:p},nc(f))]})}Mn.propTypes={onReload:w.func};function Rs({...e}){return o.jsx(As,{children:o.jsx(Bt,{children:o.jsx(Mn,{...e})})})}Rs.propTypes={...Mn.propTypes};var sc={};function _s({teamDid:e,roles:t=[],apps:n=[],onCancel:r,onSuccess:s,onError:i=()=>{},endpoint:a=""}){const{api:l}=de(),{t:c,locale:f}=J(),u=Ye({loading:!1,error:null,activeStep:0,inviteInfo:null,role:"",remark:"",sourceAppPid:n.length>0?n[0].appPid:null,display:null,passportExpireTime:null,showPicker:!1}),h=async()=>{if(!u.role){u.error=c("team.member.error.passportEmpty");return}if(u.passportExpireTime&&Vn(u.passportExpireTime).isBefore(Vn())){u.error=c("team.passport.customExpireTimeIsInvalid");return}const p=u.remark.trim();u.error=null,u.loading=!0;try{let d=u.sourceAppPid??null;d===e&&(d=null);const m={teamDid:e,role:u.role,remark:p,sourceAppPid:d,passportExpireTime:u.passportExpireTime?u.passportExpireTime.toISOString():""};u.display&&(m.display={type:"url",content:u.display});const{inviteInfo:y}=await l.createMemberInvitation({input:m});u.inviteInfo=y,u.activeStep=1}catch(d){const m=le(d);u.error=m,i(d)}finally{u.loading=!1}},x=t.find(p=>p.name===u.role),C=t.filter(p=>p.name!=="owner"),S=[{body:o.jsxs(I,{sx:{display:"flex",flexDirection:"column",gap:3},children:[n.length>1?o.jsxs(cn,{fullWidth:!0,children:[o.jsx(dn,{children:c("common.sourceApp")}),o.jsx(kt,{value:u.sourceAppPid,onChange:p=>{u.error=null,u.sourceAppPid=p.target.value},fullWidth:!0,label:c("common.passport"),disabled:u.loading,children:n.map(p=>o.jsx(St,{value:p.appPid,children:o.jsxs(I,{sx:{display:"flex",justifyContent:"space-between",gap:2,width:"100%"},children:[o.jsxs(I,{sx:{display:"flex",alignItems:"center",gap:1},children:[o.jsx(Wo,{did:p.appPid,size:28}),p.appName]}),o.jsx(qo,{did:p.appPid,compact:!0,responsive:!1})]})},p.appPid))})]}):null,o.jsxs(cn,{fullWidth:!0,variant:"outlined",children:[o.jsx(dn,{children:c("common.passport")}),o.jsx(kt,{"data-cy":"invite-member-select-role",value:u.role,onChange:p=>{u.error=null,u.role=p.target.value},fullWidth:!0,label:c("common.passport"),disabled:u.loading,onKeyPress:p=>{p.key==="Enter"&&(p.preventDefault(),h())},children:C.map(p=>o.jsx(St,{value:p.name,"data-cy":`invite-member-select-option-${p.name}`,children:o.jsxs(I,{sx:{display:"flex",flexDirection:"column"},children:[o.jsx(ye,{variant:"subtitle1",children:p.title||p.name}),o.jsx(ye,{variant:"caption",sx:{opacity:.7},children:p.description})]})},p.name))})]}),x?.extra?.display==="custom"&&o.jsx(Ie,{label:c("common.display"),type:"url",value:u.display,onChange:p=>{u.error=null,u.display=p.target.value},fullWidth:!0,variant:"outlined",margin:"normal"}),o.jsx(Ie,{label:c("common.remark"),autoComplete:"off",variant:"outlined",fullWidth:!0,value:u.remark,onChange:p=>{u.error=null,u.remark=p.target.value},disabled:u.loading,"data-cy":"invite-member-input-remark"}),o.jsx($r,{value:u.passportExpireTime,onChange:p=>{u.error=null,u.passportExpireTime=p},showError:!1})]}),cancel:c("common.cancel"),confirm:c("team.member.inviteDialog.createInviteLink"),onCancel:r,onConfirm:h},{body:()=>{const p=pn({inviteId:u.inviteInfo?.inviteId,endpoint:a});return o.jsxs("div",{children:[o.jsx(I,{sx:{fontSize:16,fontWeight:"bold"},children:c("team.member.inviteDialog.createSuccessTip",{expireDate:lt(u.inviteInfo?.expireDate,f)})}),o.jsx("div",{style:{marginTop:"40px"}}),o.jsx(wn,{children:p})]})},confirm:c("common.copy"),onConfirm:()=>{const p=pn({inviteId:u.inviteInfo?.inviteId,endpoint:a});if(["1","true"].includes(sc.IS_E2E)){s();return}Xo(p),oe.success(c("common.copied")),s()},cancel:c("common.cancel"),onCancel:r}][u.activeStep];return o.jsxs(ve,{title:c("common.invite"),fullWidth:!0,open:!0,showCloseButton:!1,actions:o.jsxs(o.Fragment,{children:[S.cancel&&o.jsx(ae,{onClick:S.onCancel,color:"inherit",children:S.cancel}),o.jsxs(ae,{onClick:S.onConfirm,color:"primary",disabled:u.loading||!u.role,variant:"contained",autoFocus:!0,children:[u.loading&&o.jsx(We,{size:16}),S.confirm]})]}),children:[o.jsx(_t,{component:"div",children:typeof S.body=="function"?S.body():S.body}),!!u.error&&o.jsx(_e,{severity:"error",sx:{mt:2},children:u.error})]})}_s.propTypes={teamDid:w.string.isRequired,onCancel:w.func.isRequired,onSuccess:w.func.isRequired,onError:w.func,roles:w.array,apps:w.array,endpoint:w.string};function Os({teamDid:e,onCancel:t,onSuccess:n,onError:r=()=>{},endpoint:s=""}){const{api:i,info:a}=de(),{api:l}=k.useContext(oa),[c,f]=k.useState(!1),{t:u,locale:h}=J(),[x,C]=k.useState(""),[j,S]=k.useState(!1),[p,d]=k.useState(0),[m,y]=k.useState(""),[b,v]=k.useState(""),P=!!un(a,"ownerNft.did"),g=ba(async()=>{if(P){const{state:B}=await i.getDelegationState();return B}return{delegated:!0}});if(g.loading)return o.jsx(ve,{title:u("team.transferNode.inviteDialog.title"),fullWidth:!0,open:!0,onClose:t,children:o.jsx("div",{style:{display:"flex",justifyContent:"center"},children:o.jsx(We,{})})});if(g.error)return o.jsx(ve,{title:u("team.transferNode.inviteDialog.title"),fullWidth:!0,open:!0,onClose:t,children:o.jsx(_e,{severity:"error",children:le(g.error)})});const A=async()=>{C(null),f(!0);try{const{inviteInfo:B}=await i.createTransferInvitation({input:{teamDid:e,role:"owner",remark:b.trim()}});y(B),d(M.length-1)}catch(B){const Y=le(B);C(Y),r(B)}finally{f(!1)}},T=()=>{S(!0),d(1)},_=()=>{S(!1),d(0)},M=[{body:o.jsxs(ye,{component:"div",children:[o.jsxs(_e,{severity:"warning",children:[o.jsx(ye,{children:u("team.transferNode.inviteDialog.tips.progress")}),o.jsx(ye,{children:u("team.transferNode.inviteDialog.tips.newOwnerPermissions")})]}),o.jsx(_e,{severity:"warning",children:o.jsx(ye,{children:u("team.transferNode.inviteDialog.tips.revoke")})}),o.jsx("div",{style:{marginTop:20,marginBottom:10}}),o.jsx(Ie,{label:u("common.remark"),autoComplete:"off",variant:"outlined",fullWidth:!0,style:{marginBottom:8},value:b,onChange:B=>{C(null),v(B.target.value)},disabled:c,"data-cy":"transfer-node-input-remark"}),o.jsx("div",{style:{marginTop:20,marginBottom:10}})]}),cancel:u("common.cancel"),confirm:u("team.transferNode.inviteDialog.createInviteLink"),onCancel:t,onConfirm:P&&!un(g,"value.delegated")?T:A},{body:()=>o.jsx(aa,{action:"delegate-transfer-nft",open:j,locale:h,checkFn:l.get,onClose:_,onSuccess:A,checkTimeout:5*60*1e3,webWalletUrl:ia(a),extraParams:{targetDID:a.did},messages:{title:u("team.transferNode.delegateDialog.title"),scan:u("team.transferNode.delegateDialog.scan"),confirm:u("team.transferNode.delegateDialog.confirm"),success:u("team.transferNode.delegateDialog.success")},popup:!0})},{body:()=>{const B=pn({inviteId:m.inviteId,endpoint:s});return o.jsxs("div",{children:[o.jsx(oc,{children:u("team.transferNode.inviteDialog.createSuccessTip",{expireDate:lt(m.expireDate,h)})}),o.jsx("div",{style:{marginTop:"40px"}}),o.jsx(wn,{children:B})]})},confirm:u("common.confirm"),onConfirm:n}],O=M[p];return o.jsxs(ve,{title:u("team.transferNode.inviteDialog.title"),fullWidth:!0,open:!0,showCloseButton:!1,actions:o.jsxs(o.Fragment,{children:[O.cancel&&o.jsx(ae,{onClick:O.onCancel,color:"inherit",children:O.cancel}),o.jsxs(ae,{onClick:O.onConfirm,color:"primary",disabled:c,variant:"contained",autoFocus:!0,children:[c&&o.jsx(We,{size:16}),O.confirm]})]}),children:[o.jsx(_t,{component:"div",children:typeof O.body=="function"?O.body():O.body}),!!x&&o.jsx(_e,{severity:"error",children:x})]})}Os.propTypes={teamDid:w.string.isRequired,onCancel:w.func.isRequired,onSuccess:w.func.isRequired,onError:w.func,endpoint:w.string};const oc=he.div`
|
|
14
|
-
font-size: 16px;
|
|
15
|
-
font-weight: bold;
|
|
16
|
-
`;function bn({passport:e,onDelete:t=null,...n}){return o.jsxs(ac,{...n,children:[e.title||e.name," ",!!t&&o.jsx(Lr,{"data-cy":"delete-issuance",className:"delete",onClick:t})]})}bn.propTypes={passport:w.object.isRequired,onDelete:w.func};const ac=he.span`
|
|
17
|
-
display: inline-flex;
|
|
18
|
-
padding: 2px 8px;
|
|
19
|
-
background: ${e=>e.theme.palette.primary.main};
|
|
20
|
-
border-radius: 100vw;
|
|
21
|
-
font-weight: 400;
|
|
22
|
-
font-size: 12px;
|
|
23
|
-
line-height: 22px;
|
|
24
|
-
color: #fff;
|
|
25
|
-
align-items: center;
|
|
26
|
-
.delete {
|
|
27
|
-
font-size: 1em;
|
|
28
|
-
margin-left: 6px;
|
|
29
|
-
cursor: pointer;
|
|
30
|
-
}
|
|
31
|
-
`;function Ms({issuances:e=[],teamDid:t,onRefresh:n=()=>{}}){const{api:r,inService:s}=de(),{t:i,locale:a}=k.useContext(Ot),[l,c]=k.useState(null),[f,u]=k.useState(!1),{endpoint:h}=ge(),x=async({id:p})=>{if(!f){u(!0);try{await r.deletePassportIssuance({input:{teamDid:t,sessionId:p}}),n()}catch(d){oe.error(d.message)}finally{u(!1),c(null)}}},C=()=>{u(!1),c(null)},j=p=>h?la({id:p.id,endpoint:h}):"";function S({data:p}){return o.jsxs("div",{className:"issuance",children:[o.jsxs(I,{sx:{display:"flex",justifyContent:"space-between"},children:[o.jsx(qe,{permission:s?"":"mutate_team",role:s?ct:[],children:d=>d?o.jsx(bn,{passport:{title:p.title,name:p.name},onDelete:()=>c({title:i("team.passport.issuance.delete.title"),description:i("team.passport.issuance.delete.description",{link:j(p)}),confirm:i("common.delConfirm"),cancel:i("common.cancel"),onConfirm:()=>{x(p)},onCancel:C})}):o.jsx(bn,{passport:{title:p.title,name:p.name}})}),o.jsxs("div",{style:{color:"#999"},children:[i("common.expires"),": ",lt(p.expireDate,a)]})]}),o.jsx(I,{sx:{mt:2},children:o.jsx(wn,{children:j(p)})})]})}return o.jsxs(ic,{children:[e.map(p=>o.jsx(S,{data:p})),l&&o.jsx(Mt,{title:l.title,description:l.description,confirm:l.confirm,cancel:l.cancel,params:l.params,onConfirm:l.onConfirm,onCancel:l.onCancel})]})}const ic=he.div`
|
|
32
|
-
.MuiTableHead-root {
|
|
33
|
-
display: none;
|
|
34
|
-
}
|
|
35
|
-
.issuance {
|
|
36
|
-
padding: 16px 0;
|
|
37
|
-
border-bottom: 1px solid #f0f0f0;
|
|
38
|
-
.MuiTypography-root {
|
|
39
|
-
display: inline-block;
|
|
40
|
-
width: 100%;
|
|
41
|
-
background: #f3f3f3;
|
|
42
|
-
border-radius: 4px;
|
|
43
|
-
padding-top: 6px;
|
|
44
|
-
padding-bottom: 6px;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
`;Ms.propTypes={teamDid:w.string.isRequired,issuances:w.array,onRefresh:w.func};var xe={},vr;function lc(){if(vr)return xe;vr=1,Object.defineProperty(xe,"__esModule",{value:!0}),xe.getPermanentDid=t,xe.getConnectedAccounts=n,xe.getConnectedDids=r,xe.getWallet=s,xe.getWalletDid=i,xe.getSourceProvider=a,xe.getSourceProviders=l;const e=ca();function t(c){return c?.did}function n(c){return c?.connectedAccounts||[]}function r(c){return n(c).map(h=>h.did)}function s(c){return n(c).find(h=>h.provider===e.LOGIN_PROVIDER.WALLET)}function i(c){return s(c)?.did}function a(c){return c?.sourceProvider||e.LOGIN_PROVIDER.WALLET}function l(c){return n(c).map(u=>u.provider)}return xe}var Ns=lc();const cc=he(({children:e,...t})=>o.jsx(Ie,{...t,id:"outlined-basic",variant:"outlined",size:"small",slotProps:{input:{startAdornment:o.jsx(Ar,{})}},children:e}))`
|
|
48
|
-
.MuiOutlinedInput-root {
|
|
49
|
-
color: #999;
|
|
50
|
-
&.MuiInputBase-adornedStart .MuiSvgIcon-root {
|
|
51
|
-
color: #bfbfbf;
|
|
52
|
-
}
|
|
53
|
-
border-radius: 100vw;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
.MuiOutlinedInput-notchedOutline,
|
|
57
|
-
.MuiOutlinedInput-root:hover .MuiOutlinedInput-notchedOutline,
|
|
58
|
-
.Mui-focused .MuiOutlinedInput-notchedOutline {
|
|
59
|
-
border-color: #eee;
|
|
60
|
-
border-width: 1px;
|
|
61
|
-
}
|
|
62
|
-
`,dc=he.div`
|
|
63
|
-
display: flex;
|
|
64
|
-
justify-content: space-between;
|
|
65
|
-
align-items: center;
|
|
66
|
-
font-size: 14px;
|
|
67
|
-
|
|
68
|
-
.right {
|
|
69
|
-
display: flex;
|
|
70
|
-
align-items: center;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
.tabs {
|
|
74
|
-
.MuiButton-root {
|
|
75
|
-
border: none;
|
|
76
|
-
color: #999;
|
|
77
|
-
&.active {
|
|
78
|
-
color: #222;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
@media (max-width: 600px) {
|
|
84
|
-
display: block;
|
|
85
|
-
.right {
|
|
86
|
-
margin-top: 12px;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
`;function Nn({teamDid:e,ownerDid:t,needReceive:n=!0,roles:r=[],onCancel:s,onSuccess:i,onError:a=()=>{},showOwnerPassport:l=!1}){const{api:c}=de(),[f,u]=k.useState(!1),[h,x]=k.useState(""),{t:C}=J(),[j,S]=k.useState(""),[p,d]=k.useState(""),m=Ye({passportExpireTime:null});k.useEffect(()=>{r.length>0&&S(r[0].name)},[]);const y=async()=>{if(!j){x(C("team.member.error.passportEmpty"));return}x(null),u(!0);try{const v={teamDid:e,name:j,ownerDid:t,passportExpireTime:m.passportExpireTime?m.passportExpireTime.toISOString():""};p&&(v.display={type:"url",content:p}),await c.createPassportIssuance({input:v}),i()}catch(v){const P=le(v);x(P),a(v)}finally{u(!1)}},b=r.find(v=>v.name===j);return o.jsxs(ve,{title:C("team.passport.issue"),fullWidth:!0,open:!0,onClick:v=>v.stopPropagation(),onClose:s,disableEscapeKeyDown:!0,PaperProps:{style:{minHeight:"auto"}},actions:o.jsxs(o.Fragment,{children:[o.jsx(ae,{onClick:s,color:"inherit",size:"small",children:C("common.cancel")}),o.jsxs(ae,{onClick:y,color:"primary",size:"small",disabled:f||!j,variant:"contained",autoFocus:!0,"data-cy":"issue-passport-create-btn",children:[f&&o.jsx(We,{size:16}),C(n?"team.passport.issuance.create.title":"oauth.issued")]})]}),children:[o.jsx(_t,{component:"div",children:o.jsxs(I,{sx:{display:"flex",flexDirection:"column",gap:3},children:[o.jsxs(cn,{style:{width:"100%"},variant:"outlined",children:[o.jsx(dn,{children:C("common.passport")}),o.jsx(kt,{"data-cy":"issue-passport-select-passport",value:j,onChange:v=>{x(null),S(v.target.value)},fullWidth:!0,label:C("common.passport"),disabled:f,onKeyPress:v=>{v.key==="Enter"&&(v.preventDefault(),y())},children:r.filter(v=>l||v.name!=="owner").map(v=>o.jsx(St,{value:v.name,"data-cy":`issue-passport-select-option-${v.name}`,children:o.jsxs(I,{sx:{display:"flex",flexDirection:"column"},children:[o.jsx(ye,{variant:"subtitle1",children:v.title||v.name}),o.jsx(ye,{variant:"caption",sx:{opacity:.7},children:v.description})]})},v.name))})]}),b?.extra?.display==="custom"&&o.jsx(Ie,{label:C("common.display"),type:"url",value:p,onChange:v=>d(v.target.value),fullWidth:!0,variant:"outlined",margin:"normal"}),o.jsx($r,{value:m.passportExpireTime,onChange:v=>{m.passportExpireTime=v}})]})}),!!h&&o.jsx(_e,{severity:"error",variant:"icon",children:h})]})}Nn.propTypes={teamDid:w.string.isRequired,ownerDid:w.string.isRequired,needReceive:w.bool,onCancel:w.func.isRequired,onSuccess:w.func.isRequired,onError:w.func,roles:w.array,showOwnerPassport:w.bool};function Ds({passport:e,user:t,color:n,width:r=150,icon:s=null,children:i=null,createPassportSvg:a,...l}){const{t:c,locale:f}=J();return o.jsxs(uc,{display:"flex",alignItems:"center",...l,children:[!!e.display&&o.jsx("div",{className:"passport-item__display",style:{width:r},children:o.jsx(xa,{address:e.id,data:e.display,style:{width:"100%"},imageFilter:typeof r=="number"?{imageFilter:"resize",w:r}:null})}),!e.display&&o.jsx("div",{dangerouslySetInnerHTML:{__html:a({scope:e.scope,role:e.role,title:e.scope==="kyc"?e.name:e.title,issuer:e.issuer&&e.issuer.name,issuerDid:e.issuer&&e.issuer.id,ownerName:t.fullName,ownerDid:t.did,ownerAvatarUrl:t.avatar,revoked:e.revoked,preferredColor:n,width:r,extra:e.scope==="kyc"?{key:"Email",value:e.name}:void 0})}}),o.jsxs("div",{className:"body",children:[o.jsxs(I,{className:"title",sx:{display:"flex",alignItems:"center"},children:[$o(e.title),o.jsxs("div",{className:"status-icons",children:[s,e.revoked&&o.jsx(Br,{})]})]}),e.issuanceDate&&o.jsx(I,{className:"title",sx:{display:"flex",alignItems:"center"},children:c("team.passport.issuanceDate",{date:lt(e.issuanceDate,f)})}),e.expirationDate&&o.jsx(I,{className:"title",sx:{display:"flex",alignItems:"center"},children:c("team.passport.validUntil",{date:lt(e.expirationDate,f)})}),i]})]})}Ds.propTypes={passport:w.any.isRequired,user:w.any.isRequired,color:w.string.isRequired,createPassportSvg:w.func.isRequired,icon:w.any,children:w.any,width:w.number};const uc=he(I)`
|
|
90
|
-
.body {
|
|
91
|
-
padding: 0;
|
|
92
|
-
margin-left: 24px;
|
|
93
|
-
margin-top: 0;
|
|
94
|
-
}
|
|
95
|
-
.title {
|
|
96
|
-
font-weight: 400;
|
|
97
|
-
font-size: 16px;
|
|
98
|
-
line-height: 19px;
|
|
99
|
-
color: ${({theme:e})=>e.palette.text.primary};
|
|
100
|
-
margin-bottom: 8px;
|
|
101
|
-
}
|
|
102
|
-
.tip {
|
|
103
|
-
display: flex;
|
|
104
|
-
align-items: center;
|
|
105
|
-
font-size: 14px;
|
|
106
|
-
margin-top: 6px;
|
|
107
|
-
color: ${({theme:e})=>e.palette.text.secondary};
|
|
108
|
-
}
|
|
109
|
-
.status-icons {
|
|
110
|
-
svg {
|
|
111
|
-
fill: ${({theme:e})=>e.palette.text.secondary};
|
|
112
|
-
height: 1.2em;
|
|
113
|
-
margin-left: 0.4em;
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
`;function xn({action:e,passport:t}){const{t:n}=J(),{roles:r}=ge(),s=r.find(i=>i.name===t.role);return o.jsxs("div",{children:[o.jsx("div",{children:n(e==="enable"?"team.member.enablePassportDescription":"team.member.revokePassportDescription")}),s&&o.jsx(I,{sx:{mt:3,fontWeight:"bold"},children:n("team.member.passportPermissionTitle")}),s&&o.jsx(I,{sx:{mt:1},children:s.description})]})}xn.propTypes={action:w.string.isRequired,passport:w.object.isRequired};function $s({user:e,onCreate:t=()=>{},createPassportSvg:n}){const r=Ye({scope:"passport"}),s=yn(),{t:i}=J(),{session:a}=De(),{roles:l,teamDid:c,teamIssuerDid:f,refresh:u,enablePassportIssuance:h,trustedPassports:x,passportColor:C,blocklet:j}=ge(),{appIdList:S}=Dr(),{api:p,inService:d}=de(),[m,y]=k.useState(!1),[b,v]=k.useState(null),[P,g]=k.useState(!1),[A,T]=k.useState(""),_=[f,...S||[]].filter(Boolean),M=(un(e,"passports")||[]).map(R=>({...R,revoked:R.status===Oe.PASSPORT_STATUS.REVOKED})),O=async R=>{if(!m){y(!0);try{const D=R.status===Oe.PASSPORT_STATUS.REVOKED?"enableUserPassport":"revokeUserPassport";await p[D]({input:{teamDid:c,userDid:e.did,passportId:R.id}}),u()}catch(D){oe.error(le(D))}finally{y(!1),v(null)}}},B=R=>R.status===Oe.PASSPORT_STATUS.REVOKED?v({title:i("team.member.enablePassport"),description:o.jsx(xn,{action:"enable",passport:R}),confirm:i("common.enable"),cancel:i("common.cancel"),onConfirm:()=>{O(R)},onCancel:()=>{y(!1),v(null)},color:"primary"}):v({title:i("team.member.revokePassport"),description:o.jsx(xn,{action:"revoke",passport:R}),confirm:i("common.revoke"),cancel:i("common.cancel"),onConfirm:()=>{O(R)},onCancel:()=>{y(!1),v(null)}}),Y=(R,D)=>e.did===a.user.did&&a.user.passportId&&a.user.passportId===D.id?{revokable:!1,message:i("team.passport.shouldNotDeleteCurrent")}:R?c===D.issuer.id&&D.name==="owner"?{revokable:!1,message:i("team.passport.noPermission")}:{revokable:!0}:{revokable:!1,message:i("team.passport.noPermission")},H=M.filter(R=>r.scope?R.scope===r.scope:!0).filter(R=>!A||R.title.includes(A)||R.name.includes(A)),ee=(R,D)=>D.status===Oe.PASSPORT_STATUS.EXPIRED?o.jsx(ae,{variant:"outlined",disabled:!0,children:i("common.expired")}):Y(R,D).revokable?o.jsxs(ae,{variant:"outlined",color:D.revoked?"primary":"secondary",onClick:()=>B(D),children:[D.revoked?o.jsx(Ue,{style:{fontSize:16,marginRight:4}}):o.jsx(Br,{style:{height:16,marginRight:4}}),D.revoked?i("common.enable"):i("common.revoke")]}):o.jsx(Lt,{title:Y(R,D).message,children:o.jsx(Yn,{style:{color:s.palette.grey[600]}})}),ne=[{label:"All",value:""},{label:"passport",value:"passport"},{label:"kyc",value:"kyc"}];return o.jsxs(fc,{children:[o.jsxs(dc,{children:[o.jsx("div",{className:"left",children:o.jsx(cc,{placeholder:i("team.passport.search"),value:A,onChange:R=>T(R.target.value)})}),o.jsx("div",{className:"right",children:h&&!!e.approved&&o.jsx(qe,{permission:d?"":"mutate_team",role:d?ct:[],children:o.jsxs(ae,{size:"small",variant:"contained",color:"primary","data-cy":"issue-passport",onClick:()=>g(!0),children:[o.jsx(Ue,{style:{fontSize:16,marginRight:4}}),i("team.passport.issue")]})})})]}),o.jsxs(I,{sx:{mt:3},children:[o.jsx(ko,{row:!0,children:ne.map(R=>o.jsx(vn,{value:R.value,control:o.jsx(So,{onChange:()=>{r.scope=R.value},checked:r.scope===R.value,size:"small"}),label:R.label}))}),H.map(R=>o.jsx(qe,{permission:d?"":"mutate_team",role:d?ct:[],children:D=>o.jsxs(I,{className:"passport-item",sx:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[o.jsx(Ds,{passport:R,user:e,color:C,createPassportSvg:n,icon:_.length&&!_.includes(R.issuer.id)?o.jsx(Wr,{}):null,children:!!_.length&&!_.includes(R.issuer.id)&&o.jsxs("div",{className:"tip",children:[R.issuer.id!==f&&!x.some(Q=>Q.issuerDid===R.issuer.id)&&o.jsx(Lt,{title:i("team.passport.notTrustedIssuerTip"),children:o.jsx(I,{component:Yn,style:{fontSize:"1.3em"},sx:{color:"error.main",mr:.5}})}),o.jsx("span",{children:i("team.passport.issueBy",{name:R.issuer.name})})]})}),o.jsx(I,{children:ee(D,R)})]})},R.id)),!H.length&&o.jsx(Rr,{children:i("common.empty")})]}),P&&o.jsx(Nn,{teamDid:c,ownerDid:e.did,needReceive:Ns.getWalletDid(e)===e.did,roles:l,onCancel:()=>g(!1),onSuccess:()=>{t(),g(!1)},showOwnerPassport:j&&!j.settings?.owner}),b&&o.jsx(Mt,{title:b.title,description:b.description,confirm:b.confirm,cancel:b.cancel,params:b.params,onConfirm:b.onConfirm,onCancel:b.onCancel,color:b.color})]})}$s.propTypes={user:w.object.isRequired,createPassportSvg:w.func.isRequired,onCreate:w.func};const fc=he.div`
|
|
117
|
-
.passport-item {
|
|
118
|
-
.MuiButton-outlinedSecondary {
|
|
119
|
-
color: #f16e6e;
|
|
120
|
-
fill: #f16e6e;
|
|
121
|
-
background: #fcf3f3;
|
|
122
|
-
border: 0;
|
|
123
|
-
&:hover {
|
|
124
|
-
border: 0;
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
`,pc=io(Bo);var an,jr;function mc(){if(jr)return an;jr=1;const e=pc,{ROLES:t,PASSPORT_STATUS:n}=da();return an={hasActiveOwnerPassport:i=>(i?.passports||[]).some(a=>a.role===t.OWNER&&a.status===n.VALID),getActivePassports:(i,a=[])=>{const l=c=>c.status!==n.VALID||!a.includes(c.issuer.id)?!1:!(c.expirationDate&&Date.now()>new Date(c.expirationDate).getTime());return e((i.passports||[]).filter(c=>!c.display).filter(l),"name").concat(e((i.passports||[]).filter(c=>c.display).filter(l),"display.content"))}},an}var Bs=mc();function Dn({user:e={},onCancel:t=()=>{},onSuccess:n=()=>{},onError:r=()=>{},children:s=null}){const{api:i,info:a,inService:l}=de(),{session:c}=De(),{teamDid:f,refresh:u}=ge(),{t:h}=J(),[x,C]=k.useState(!1),[j,S]=k.useState(!1),p=()=>S(!0),d=async b=>{const{did:v,approved:P}=b;if(!x){C(!0);try{await i.updateUserApproval({input:{teamDid:f,user:{did:v,approved:!P},options:{includeFederated:!0}}}),S(!1),n(),u()}catch(g){oe.error(le(g)),r()}finally{C(!1)}}},m={title:e.approved?h("team.member.blockAccess"):h("team.member.allowAccess"),description:e.approved?h("team.member.blockAccessDescription"):h("team.member.allowAccessDescription"),confirm:h("common.confirm"),cancel:h("common.cancel"),onConfirm:()=>{d(e)},onCancel:()=>{C(!1),S(!1),t()},color:e.approved?"error":"primary"};let y;return Bs.hasActiveOwnerPassport(e)?y=!1:l?y=!It(c.user,e.did):y=a.nodeOwner&&!Fr(a,e.did)&&!It(c.user,e.did),y?o.jsxs(o.Fragment,{children:[typeof s=="function"?s({can:y,open:p}):s,j?o.jsx(Mt,{title:m.title,description:m.description,confirm:m.confirm,cancel:m.cancel,params:m.params,onConfirm:m.onConfirm,onCancel:m.onCancel,color:m.color}):null]}):null}Dn.propTypes={user:w.object,onSuccess:w.func,onCancel:w.func,onError:w.func,children:w.oneOfType([w.object,w.func])};function Fs({user:e={},onCancel:t=()=>{},onSuccess:n=()=>{},onError:r=()=>{},children:s=null}){const{api:i,info:a,inService:l}=de(),{session:c}=De(),{teamDid:f}=ge(),{t:u}=J(),[h,x]=k.useState(!1),[C,j]=k.useState(!1),S=()=>j(!0),p=async y=>{const{did:b}=y;if(!h){x(!0);try{await i.removeUser({input:{teamDid:f,user:{did:b}}}),j(!1),n(),oe.success(u("team.member.removeUserSuccess")),setTimeout(()=>{window.location.reload()},1e3)}catch(v){oe.error(le(v)),r()}finally{x(!1)}}},d={title:u("team.member.removeUser"),description:u("team.member.removeUserDescription",{did:e.did}),confirm:u("common.confirm"),cancel:u("common.cancel"),onConfirm:()=>{p(e)},onCancel:()=>{x(!1),j(!1),t()},color:"error"};let m;return Bs.hasActiveOwnerPassport(e)?m=!1:l?m=!It(c.user,e.did):m=a.nodeOwner&&!Fr(a,e.did)&&!It(c.user,e.did),m?o.jsxs(o.Fragment,{children:[typeof s=="function"?s({can:m,open:S}):s,C?o.jsx(Mt,{title:d.title,description:d.description,confirm:d.confirm,cancel:d.cancel,params:d.params,onConfirm:d.onConfirm,onCancel:d.onCancel,color:d.color}):null]}):null}Fs.propTypes={user:w.object,onSuccess:w.func,onCancel:w.func,onError:w.func,children:w.oneOfType([w.object,w.func])};function zs({hasPasskey:e=!1}){const{isNodeTeam:t}=ge();return t?o.jsx(ua,{behavior:"only-new",action:"connect",createMode:"connect",createButtonText:e?"Add New Passkey":"Add Passkey",onSuccess:Pt,onError:Pt,dense:!0}):null}zs.propTypes={hasPasskey:w.bool};function Us({user:e,onChangeUser:t=()=>{}}){const n=e.connectedAccounts||[],{t:r}=J(),{session:s}=De(),{disconnectPasskey:i}=s.usePasskey(),a=n.some(l=>l.provider===Me.LOGIN_PROVIDER.PASSKEY&&l.did);return o.jsxs("div",{children:[n.map(l=>o.jsxs("div",{children:[o.jsx(fe,{style:{alignItems:"flex-start",cursor:"pointer"},valueComponent:"div",nameWidth:120,name:l.provider,onClick:()=>{const c=document.getElementById(`account-details-${l.did}`);c&&(c.style.display=c.style.display==="none"?"block":"none")},children:o.jsx(Cn,{did:l.did,showQrcode:!0})},l.did),o.jsxs(Lo,{id:`account-details-${l.did}`,sx:{display:"none",mt:-1,mb:1,pt:1,pl:1,pr:1,boxShadow:"none",border:"1px solid #e0e0e0"},children:[l.did&&o.jsx(fe,{nameWidth:120,name:"DID",children:l.did}),l.pk&&o.jsx(fe,{nameWidth:120,name:"PublicKey",children:l.pk}),l.id&&o.jsx(fe,{nameWidth:120,name:"ID",children:l.id}),l.sub&&o.jsx(fe,{nameWidth:120,name:"Sub",children:l.sub}),l.lastLoginAt&&o.jsx(fe,{nameWidth:120,name:"Last Login",children:l.lastLoginAt}),l.counter&&o.jsx(fe,{nameWidth:120,name:"Counter",children:l.counter}),l.userInfo&&o.jsx(fe,{nameWidth:120,name:"User Info",children:o.jsx("pre",{style:{margin:0,fontSize:12},children:JSON.stringify(l.userInfo,null,2)})}),l.extra&&o.jsx(fe,{nameWidth:120,name:"Extra",children:o.jsx("pre",{style:{margin:0,fontSize:12},children:JSON.stringify(l.extra,null,2)})}),l.provider===Me.LOGIN_PROVIDER.PASSKEY&&o.jsx(Ae,{size:"small",variant:"contained",color:"error",sx:{mb:1},onClick:async()=>{await i({session:s,connectedAccount:l}),await t(e)},children:r("common.disconnect")})]})]},l.did)),o.jsx(zs,{hasPasskey:a})]})}Us.propTypes={user:w.object.isRequired,onChangeUser:w.func};const Ws=k.createContext(null);function qs({children:e}){const{t}=J(),[n,r]=k.useState(!1),s=k.useMemo(()=>o.jsxs(I,{onClick:()=>r(!0),sx:{display:"flex",alignItems:"center",gap:1,width:"100%",height:36,px:2,borderTop:"1px solid",borderColor:"divider",fontSize:14,color:"grey.600",cursor:"pointer",textDecoration:"none"},children:[o.jsx(Rt,{style:{fontSize:14}}),t("label.manage")]}),[t]),i=k.useMemo(()=>({showManageLabels:n,setShowManageLabels:r,labelManageActions:s}),[n,r,s]);return o.jsx(Ws.Provider,{value:i,children:e})}qs.propTypes={children:w.node.isRequired};function Hs(){return k.useContext(Ws)}function Cr({info:e,verified:t}){return o.jsxs(I,{sx:{display:"flex",alignItems:"center"},children:[e,t&&o.jsx(Io,{color:"success",style:{fontSize:16,marginLeft:4}})]})}w.string.isRequired;const at="info";function Ks({userDid:e,onCancel:t,initTab:n=at,createPassportSvg:r,handleChangeLabels:s=()=>{}}){const{api:i,ws:{useSubscription:a},inService:l,info:c}=de(),{session:f}=De(),{roles:u,teamDid:h,isNodeTeam:x,enablePassportIssuance:C}=ge(),{t:j,locale:S}=J(),p=Ye({user:null,issuances:null,tab:n||at}),[d,m]=k.useState(""),[y,b]=k.useState([]),[v,P]=k.useState(!1),{labelManageActions:g}=Hs(),A=k.useMemo(()=>h===c.did,[h,c.did]),T=async(R,D)=>{try{const Q=await i.doBatchQuery({getUser:{input:{teamDid:R,user:{did:D},options:{includeTags:!0}}},getPassportIssuances:{input:{teamDid:R,ownerDid:D}}});Q.getUser.user&&(Q.getUser.user.avatar=zr(Q.getUser.user.avatar,R,l),Q.getUser.user.passports=(Q.getUser.user.passports||[]).filter(be=>be.issuer)),p.user=Q.getUser.user||{},b((p.user?.tags||[]).map(be=>be.id)),p.issuances=Q.getPassportIssuances.list||[]}catch(Q){oe.error(le(Q))}};k.useEffect(()=>{h&&T(h,e)},[e,h]);const _=R=>{R.teamDid===h&&R.user&&R.user.did===e&&T(h,e)};a(Me.TeamEvents.userUpdated,_,[e,h]),k.useEffect(()=>{p.issuances&&!p.issuances.length&&p.tab==="issuances"&&(p.tab=at)},[p.issuances]),k.useEffect(()=>{ya.user.getProfileUrl({did:p.user?.did,locale:S}).then(m)},[p.user?.did,S]);const M=async R=>{await T(h,R.did),p.tab=p.tab||at},O=k.useMemo(()=>p.tab==="userFollowers"?{marginTop:0}:{},[p.tab]),B=()=>(p.user?[{name:j("team.member.name"),value:p.user.fullName},{name:j("common.email"),value:p.user.email?o.jsx(Cr,{info:p.user.email,verified:p.user.emailVerified}):"-"},{name:j("common.phone"),value:p.user.phone?o.jsx(Cr,{info:p.user.phone,verified:p.user.phoneVerified}):"-"},{name:j("team.member.source"),value:o.jsx(I,{sx:{display:"flex",alignItems:"center"},children:Me.PROVIDER_NAME[p.user?.sourceProvider||Oe.USER_TYPE.WALLET]||p.user?.sourceProvider})},{name:j("team.member.allowAccess"),value:p.user.approved?j("common.yes"):j("common.no")},{name:j("common.createdAt"),value:p.user.createdAt?o.jsx(fn,{value:p.user.createdAt,type:"all",locale:S}):"-"},{name:j("team.member.lastLogin"),value:p.user.lastLoginAt?o.jsx(fn,{value:p.user.lastLoginAt,type:"all",locale:S}):"-"},{name:j("team.member.lastLoginIp"),value:p.user.lastLoginIp||""},{name:j("common.remark"),value:p.user.remark||"-"},{name:j("team.invite.inviter"),value:p.user.inviter?o.jsx(Cn,{compact:!0,responsive:!0,did:p.user.inviter,showQrcode:!0}):"-"},{name:j("label.title"),value:o.jsxs(I,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:.5},children:[o.jsx(o.Fragment,{children:p.user.tags.map(D=>o.jsx(Pe,{label:D,onDelete:()=>{i.deleteTagging({input:{teamDid:h,tagging:{tagId:D.id,taggableIds:[p.user.did],taggableType:"user"}}}).then(()=>{T(h,e),s()})}},D.id))}),v&&o.jsx(We,{size:14}),o.jsx(ut,{value:[y],onChange:D=>{b(D),P(!0),i.createTagging({input:{teamDid:h,tagging:{tagId:D[0],taggableIds:[p.user.did],taggableType:"user"}}}).then(()=>{setTimeout(()=>{T(h,e),s(),P(!1)},1e3)})},trigger:o.jsx(it,{color:"inherit",variant:"outlined",children:o.jsx(Rt,{style:{fontSize:14}})}),multiple:!1,excludes:y,actions:g})]})}].filter(Boolean):[]).map(D=>D.name===j("common.did")?o.jsx(fe,{valueComponent:"div",nameWidth:120,name:D.name,nameFormatter:()=>j("common.did"),children:D.value},D.name):o.jsx(fe,{style:{alignItems:"flex-start"},valueComponent:"div",nameWidth:120,name:D.name,children:D.value},D.name)),Y={info:{label:j("common.basicInfo"),value:at,component:B},oauth:{label:j("team.member.connectedAccounts"),value:"oauth",component:()=>o.jsx(Us,{user:p.user,onChangeUser:M})},passports:{label:j("common.passport"),value:"passports",component:()=>o.jsx($s,{user:p.user,teamDid:h,roles:u,createPassportSvg:r,onCreate:()=>{T(h,e).then(()=>{C&&p.issuances&&p.issuances.length&&(p.tab="issuances")})},onRefresh:()=>{T(h,e)}})},issuances:{label:j("team.passport.issuance.pending"),value:"issuances",component:()=>o.jsx(Ms,{issuances:p.issuances||[],teamDid:h,onRefresh:()=>T(h,e)})},userFollowers:{label:j("team.userFollowers.title"),value:"userFollowers",component:()=>o.jsx(I,{className:"user-followers-container",sx:{p:1},children:o.jsx(va,{column:1,user:p.user,teamDid:h,showSocialActions:!1})})}};A&&Object.prototype.hasOwnProperty.call(Y,"userFollowers")&&delete Y.userFollowers;const H=Object.values(Y).map(({label:R,value:D})=>({label:R,value:D})).filter(R=>R.value==="issuances"?C&&p.issuances&&!!p.issuances.length:R.value==="oauth"?x&&f.user?.did===e?!0:(p.user?.connectedAccounts||[]).find(Q=>Q.did!==p.user?.did):!0),ee=Y[p.tab]||Y.info,ne=R=>{p.tab=R};return o.jsx(ve,{title:j("common.member"),onClose:t,open:!0,PaperProps:{style:{maxWidth:632,minHeight:"80vh"}},fullWidth:!0,actions:p.user&&o.jsxs(qe,{permission:l?"":"mutate_team",role:l?ct:[],children:[o.jsx(Dn,{user:p.user,children:({open:R})=>o.jsxs(wr,{onClick:R,children:[p.user.approved?o.jsx(qr,{style:{fontSize:"1.2em",marginRight:"0.4em"}}):o.jsx(Ur,{style:{fontSize:"1.2em",marginRight:"0.4em"}}),p.user.approved?j("team.member.blockAccess"):j("team.member.allowAccess")]})}),o.jsx(Fs,{user:p.user,onSuccess:t,children:({open:R})=>o.jsxs(wr,{onClick:R,children:[o.jsx(Po,{style:{fontSize:"1.2em",marginRight:"0.4em"}}),j("team.member.removeUser")]})})]}),children:o.jsxs(hc,{children:[!p.user&&o.jsx(gc,{children:o.jsx(We,{})}),p.user&&o.jsxs(I,{children:[o.jsxs(I,{sx:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",overflow:"hidden",gap:1,flexWrap:"wrap"},children:[o.jsx(I,{sx:{display:"flex",alignItems:"center",width:300,flexShrink:0,overflow:"hidden"},className:"info",children:o.jsx(Mr,{user:p.user,cardType:Nr.Detailed,infoType:ea.Minimal,avatarSize:48,sx:{padding:0,border:"none"},showDid:!0,didProps:{compact:!0,responsive:!1,showQrcode:!0}})}),!!l&&o.jsx(I,{href:d,target:"_blank",rel:"noreferrer",component:"a",children:o.jsxs(Ae,{variant:"contained",color:"primary","data-cy":"issue-passport",children:[o.jsx(Ho,{icon:"majesticons:open-line",style:{fontSize:16,marginRight:4}}),j("team.member.openProfile")]})})]}),o.jsx(I,{className:"tabs",sx:{mx:3},children:o.jsx(Ko,{tabs:H,current:p.tab,onChange:ne,scrollButtons:"auto"})}),o.jsx(I,{className:"body",style:O,children:o.jsx(ee.component,{})})]})]})})}Ks.propTypes={userDid:w.string.isRequired,onCancel:w.func.isRequired,createPassportSvg:w.func.isRequired,initTab:w.string,handleChangeLabels:w.func};const hc=he.div`
|
|
129
|
-
.info {
|
|
130
|
-
.name {
|
|
131
|
-
font-weight: 400;
|
|
132
|
-
font-size: 18px;
|
|
133
|
-
line-height: 25px;
|
|
134
|
-
color: ${({theme:e})=>e.palette.text.primary};
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
.tabs {
|
|
139
|
-
margin-top: 24px;
|
|
140
|
-
margin-left: 0;
|
|
141
|
-
margin-right: 0;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
.body {
|
|
145
|
-
margin-top: 24px;
|
|
146
|
-
}
|
|
147
|
-
`,gc=he.div`
|
|
148
|
-
flex: 1;
|
|
149
|
-
display: flex;
|
|
150
|
-
justify-content: center;
|
|
151
|
-
align-items: center;
|
|
152
|
-
height: 200px;
|
|
153
|
-
`,wr=he.div`
|
|
154
|
-
flex-shrink: 0;
|
|
155
|
-
width: 50%;
|
|
156
|
-
height: 64px;
|
|
157
|
-
display: flex;
|
|
158
|
-
justify-content: center;
|
|
159
|
-
align-items: center;
|
|
160
|
-
cursor: pointer;
|
|
161
|
-
font-size: 16px;
|
|
162
|
-
position: sticky;
|
|
163
|
-
bottom: 0;
|
|
164
|
-
z-index: 10;
|
|
165
|
-
color: #999;
|
|
166
|
-
fill: #999;
|
|
167
|
-
`;function Ys({type:e,user:t,onIssuePassport:n=()=>{},onRefresh:r=()=>{}}){const{teamDid:s,roles:i}=ge(),{confirmHolder:a,confirmApi:l}=fa(),{t:c}=k.useContext(Ot),[f,u]=k.useState(!1),{api:h}=de(),x=jn(async(C=!1)=>{const j={teamDid:s,userDid:t.did,remove:C};C||(j.appPid=s),await h.logoutUser({input:j})});return o.jsxs(o.Fragment,{children:[a,o.jsx(wa,{"data-cy":"member-actions",actions:[{icon:o.jsx(Ue,{fontSize:"small"}),text:c("team.passport.issue"),"data-cy":"action-issue-passport",onClick:C=>{C.stopPropagation(),u(!0)}},({close:C})=>o.jsx(Dn,{user:t,children:({open:j})=>o.jsxs(St,{dense:!0,onClick:S=>{S.stopPropagation(),C(),j(S)},"data-cy":"action-toggle-block",children:[o.jsx(Ao,{style:{minWidth:24,marginRight:8},children:t.approved?o.jsx(qr,{}):o.jsx(Ur,{})}),o.jsx(To,{primary:t.approved?c("team.member.blockAccess"):c("team.member.allowAccess")})]})},"toggle-approval"),e==="blocklet"&&{icon:o.jsx(Eo,{fontSize:"small"}),text:c("team.member.forceLogout"),onClick:C=>{C.stopPropagation(),l.open({title:c("team.member.forceLogout"),content:C.altKey?c("team.member.forceLogoutRemoveDescription"):c("team.member.forceLogoutDescription"),confirmButtonText:c("common.confirm"),cancelButtonText:c("common.cancel"),onClick:j=>j.stopPropagation(),onConfirm:async()=>{await x(C.altKey),await l.close(),r()}})}}].filter(Boolean)}),f&&o.jsx(Nn,{teamDid:s,ownerDid:t.did,needReceive:Ns.getWalletDid(t)===t.did,roles:i,onCancel:()=>u(!1),onSuccess:()=>{n(),u(!1)}})]})}Ys.propTypes={type:w.oneOf(["server","blocklet"]).isRequired,user:w.object.isRequired,onIssuePassport:w.func,onRefresh:w.func};const ln="$all",kr="$none",Sr="$blocked",wt=(e,t)=>e.find(r=>r.key===t)?.value||0,bc=(e,t)=>{const n=e.passports||[];return n.length?!n.some(r=>t.includes(r.issuer?.id)):!1};function Gs({user:e}){const{t}=k.useContext(Ot),n=Jo(()=>({...e,avatar:`${e.avatar}?imageFilter=resize&w=48&h=48`}),[e]),r=o.jsxs("div",{className:"member-block",children:[o.jsxs("div",{className:"member-avatar",children:[o.jsx(Mr,{user:n,avatarSize:32,cardType:Nr.AvatarOnly,showHoverCard:!1}),!e.approved&&o.jsx("did",{className:"badge-block"}),e.isFromExternal&&o.jsx(Lt,{title:t("team.passport.externalPassport"),children:o.jsx(I,{className:"icon",sx:{ml:1},children:o.jsx(Wr,{})})})]}),o.jsxs("div",{className:"member-meta",children:[o.jsx("div",{className:"member-text",children:o.jsx(ka,{children:e.fullName})}),Array.isArray(e.tags)&&e.tags.length>0&&o.jsx(I,{className:"member-tags",sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:.5,maxWidth:{xs:200,md:"none"}},children:e.tags.map(s=>o.jsx(Pe,{label:s},s.id))})]})]});return e.approved?r:o.jsx(I,{sx:{display:"flex",alignItems:"center"},children:o.jsx(Lt,{title:t("team.member.blockAccessDescription"),children:r})})}Gs.propTypes={user:w.object.isRequired};function $n({type:e,createPassportSvg:t}){const{session:n}=De(),{appIdList:r=[],blocklet:s}=Dr(),{refetch:i}=Qe(),{teamDid:a,invitations:l,teamIssuerDid:c,roles:f,refresh:u,enablePassportIssuance:h,endpoint:x,api:C}=ge(),{showManageLabels:j,setShowManageLabels:S,labelManageActions:p}=Hs(),d=Ye({show:!1,user:null,showAppPid:!1,getUserSessions:Pt}),{api:m,inService:y,ws:{useSubscription:b},info:v}=de(),P=[];if(s){const E=(s.settings?.federated?.sites||[]).find(q=>q.isMaster!==!1),$=(s.settings?.federated?.sites||[]).find(q=>q.appId===s.appDid);if($?.status==="approved"&&P.push({appId:E?.appId,appName:E?.appName,appDescription:E?.appDescription,appLogo:E?.appLogo,appPid:E?.appPid,appUrl:E?.appUrl,version:E?.version,sourceAppPid:E?.appPid,provider:"wallet"}),$)P.push({appId:$?.appId||s.appDid,appName:$?.appName,appDescription:$?.appDescription,appLogo:$?.appLogo,appPid:$?.appPid,appUrl:$?.appUrl,version:$?.version,sourceAppPid:null,provider:"wallet"});else{const q=Na.getBlockletInfo(s,void 0,{returnWallet:!1});P.push({appId:q.did,appName:q.name,appDescription:q.description,appLogo:Fo(q.appUrl,Oe.WELLKNOWN_SERVICE_PATH_PREFIX,"/blocklet/logo"),appPid:s?.appPid,appUrl:q.appUrl,version:q.version,sourceAppPid:null,provider:"wallet"})}}const{t:g,locale:A}=k.useContext(Ot),[T,_]=k.useState(!1),[M,O]=k.useState(!1),[B,Y]=k.useState(!1),[H,ee]=k.useState(!1),[ne,R]=k.useState(!1),[D,Q]=k.useState([]),[be,Je]=k.useState(),[ue,Ft]=k.useState([]),[ft]=_a({did:void 0}),[pt,mt]=k.useState(""),[N,K]=k.useState([]),[re,Ce]=k.useState([]),[et,Vs]=_r("members-filter-labels",[]),Bn=`members-${a}`,Fn=Yo(Bn),[G,tt]=k.useState({role:ln,searchText:Fn.searchText||"",hideBlocked:!1,pageSize:Fn.rowsPerPage||10,page:1}),Zs=k.useMemo(()=>{if(!y)return!1;if(!n?.user)return!0;const E=n?.user?.role,q=(n?.user?.passports||[]).filter(V=>V.role===E);return q.length===0?!0:q.every(V=>V.expirationDate)},[n?.user,y]),zn=k.useCallback(async()=>{if(a===v.did){mt("");return}const E=await pa(s);mt(E)},[s,a,v.did]);Qo(async()=>{if(ft.did){const{user:E}=await C.getUser({did:ft.did});E&&ee(E)}}),k.useEffect(()=>{zn()},[zn]);const ht=(f||[]).map(E=>({name:E.name,title:E.title,num:wt(ue,E.name)}));ht.unshift({name:ln,title:"All Members",num:wt(ue,ln)}),ht.push({name:kr,title:"Other",num:wt(ue,kr)}),ht.push({name:Sr,title:"Blocked",num:wt(ue,Sr)});const gt=()=>{const E={includeTags:!0,includeUserSessions:e==="blocklet"};G.hideBlocked&&(E.approved=!0),E.role=G.role,G.searchText&&(E.search=G.searchText),E.tags=et||[],C.getUsers({query:E,paging:{page:G.page,pageSize:G.pageSize}}).then($=>{R(!1),($.users||[]).forEach(q=>{q.isFromExternal=bc(q,zo(r)?[c]:r),q.avatar=zr(q.avatar,a,y),q.passports=(q.passports||[]).filter(V=>V.issuer)}),Q($.users||[]),Je($.paging.total)}).catch($=>{R(!1),oe.error($.message)})},Un=()=>{R(!0),gt()},Wn=()=>{C.getUsersCountPerRole().then(E=>{Ft(E.counts||[])}).catch(E=>{oe.error(E.message)})},zt=E=>{E.teamDid===a&&(Un(),Wn())};k.useEffect(()=>{Un()},[`${G.hideBlocked}-${G.role}-${G.page}-${G.pageSize}-${G.searchText}-${(et||[]).join(",")}`]),k.useEffect(()=>{Wn()},[]),b(Me.TeamEvents.userUpdated,zt,[G]),b(Me.TeamEvents.userAdded,zt,[G]);const Xs=h,qn=jn((E=!1,$=null,q=!1)=>{if(E){const V=async({page:Ut=1,pageSize:so=10,status:oo}={})=>{const Kn={userDid:$.did,status:oo};return q||(Kn.appPid=a),await m.getUserSessions({input:{teamDid:a,query:Kn,paging:{pageSize:so,page:Ut}}})};d.show=!0,d.user=$,d.showAppPid=q,d.getUserSessions=V}else d.show=!1,d.user=null,d.showAppPid=!1,d.getUserSessions=Pt}),Qs=[{label:g("common.name"),name:"fullName",options:{customBodyRenderLite:E=>{const $=D[E];return o.jsx(I,{"data-cy":`member-name-${$.fullName}`,children:o.jsx(Gs,{user:$})},$.did)}}},{label:g("common.address"),name:"did",options:{customBodyRender:E=>o.jsx(Cn,{size:14,responsive:!1,compact:!0,copyable:!1,did:E})}},{label:g("team.member.lastLogin"),name:"lastLoginAt",options:{customBodyRender:E=>o.jsx(I,{sx:{minWidth:"100px"},children:o.jsx(fn,{value:E,locale:A})})}},{label:g("team.member.lastLoginIp"),name:"lastLoginIp",options:{customBodyRender:E=>E||"-"}},{label:g("team.member.source"),name:"sourceProvider",options:{customBodyRenderLite:E=>{const $=D[E],q=$.sourceProvider||Oe.USER_TYPE.WALLET,V=Me.PROVIDER_NAME[q]||q;return $.sourceAppPid?`${V} (${g("team.member.federated")})`:V}}},e==="blocklet"&&{label:g("team.member.activeUserSessions"),name:"userSessions",options:{customBodyRenderLite:E=>{const $=D[E];return o.jsx(it,{onClick:q=>{q.stopPropagation(),qn(!0,$,q.altKey)},children:o.jsx(Ro,{badgeContent:$?.userSessionsCount,color:$?.userSessionsCount>0?"primary":"default",sx:$?.userSessionsCount>0?{}:{".MuiBadge-badge":{backgroundColor:"grey",color:"white"}},showZero:!0,children:o.jsx(_o,{})})})}}},{label:g("common.actions"),name:"",width:100,align:"center",verticalKeyAlign:"center",options:{customBodyRenderLite:E=>{const $=D[E];return o.jsx(qe,{permission:y?"":"mutate_team",role:y?ct:[],children:o.jsx(Ys,{type:e,user:$,onIssuePassport:()=>ee({...$,initTab:"issuances"}),onRefresh:()=>zt({teamDid:a})})})}}}].filter(Boolean),bt=[];bt.push(o.jsx(On,{value:et||[],onChange:Vs,sx:{maxWidth:300,height:36},LabelPickerProps:{enableAccessControl:!1,actions:p}})),Xs&&(Zs||bt.push(o.jsx(Zn,{variant:"contained",menuButtonProps:{"data-cy":"invite-member-more"},menu:o.jsx(Zn.Item,{variant:"outlined",style:{flexShrink:0},color:"primary",size:"small",onClick:()=>{Y(!0)},children:o.jsxs(I,{sx:{display:"flex",alignItems:"center"},children:[o.jsx(Sa,{style:{height:"1em",marginRight:4}}),g("common.inviting"),l.length?` (${l.length})`:""]})}),children:()=>o.jsxs(ae,{style:{flexShrink:0,marginLeft:16},edge:"end",color:"primary",size:"small","data-cy":"invite-member",onClick:()=>_(!0),children:[o.jsx(Ue,{style:{fontSize:"1.3em",marginRight:4}}),g("team.invite.action")]})})),e==="server"&&bt.push(o.jsx(qe,{role:"owner",children:o.jsxs(ae,{style:{flexShrink:0,marginLeft:16},variant:"contained",edge:"end",color:"error","data-cy":"invite-member",onClick:()=>O(!0),children:[o.jsx(Oo,{style:{fontSize:"1.3em",marginRight:4}}),g("team.transferNode.name")]})})));const Js=E=>{ne||tt($=>({...$,role:E,hideBlocked:!1,searchText:"",page:1}))},eo=E=>{tt($=>({...$,hideBlocked:E,page:1}))},to=({page:E,rowsPerPage:$,searchText:q})=>{G.pageSize!==$?tt(V=>({...V,pageSize:$,page:1})):G.page!==E+1?tt(V=>({...V,page:E+1})):G.searchText!==q&&tt(V=>({...V,searchText:q,page:1}))},Hn=k.useRef(null),no=E=>E.data.length?o.jsx(I,{sx:{display:"flex",alignItems:"center"},children:o.jsx(ut,{value:[re],onChange:$=>{Ce([...re,$[0]]),m.createTagging({input:{teamDid:a,tagging:{tagId:$[0],taggableIds:N,taggableType:"user"}}}).then(()=>{gt(),K([])})},trigger:o.jsx(ae,{className:"resend-btn",color:"primary",variant:"contained",sx:{my:"2px",".MuiButton-startIcon":{mr:"2px"}},onClick:()=>{},children:g("label.actionLabel")}),multiple:!1,actions:p})}):null,ro={sort:!1,download:!1,filter:!1,print:!1,expandableRowsOnClick:!0,onRowClick(E,{dataIndex:$},q){if(Hn.current?.contains(q.target)){const V=D[$];ee(V)}},page:G.page-1,rowsPerPage:G.pageSize,count:be,searchDebounceTime:600,selectableRows:"multiple",filterType:"checkbox",onRowSelectionChange:(E,$,q)=>{const V=q.map(Ut=>D[Ut].did);K(V)},rowsSelected:D.map((E,$)=>N.includes(E.did)?$:null).filter(E=>E!==null),customToolbarSelect:no};return o.jsxs(xc,{children:[o.jsxs(I,{className:"main",sx:{display:"flex",gap:3},children:[o.jsx(I,{className:"left",children:o.jsx(I,{className:"tabs",children:ht.map(E=>o.jsxs(I,{className:`tab ${G.role===E.name?"active":""}`,onClick:()=>Js(E.name),children:[o.jsx("span",{className:"text",children:E.title}),o.jsx(I,{sx:{color:"text.secondary"},children:E.num})]},E.name))})}),o.jsx(I,{ref:Hn,className:"right",sx:{".MuiPaper-root":{flex:0}},children:o.jsx(Go,{className:"main-table",verticalKeyWidth:100,locale:A,durable:Bn,durableKeys:["page","rowsPerPage"],title:o.jsx(I,{className:"table-toolbar-left",sx:{pl:"12px !important"},children:o.jsx(vn,{control:o.jsx(Mo,{sx:{display:"flex !important"},disabled:ne,color:"primary",checked:G.hideBlocked,onChange:E=>eo(E.target.checked)}),label:g("team.member.onlyApprovedMember")})}),data:D,columns:Qs,customButtons:bt,options:ro,loading:ne,onChange:to})})]}),o.jsx(ve,{title:g("common.inviting"),onClose:()=>Y(!1),open:B,maxWidth:"lg",fullWidth:!0,children:o.jsx(Ca,{})}),H&&o.jsx(Ks,{onCancel:()=>ee(null),userDid:H.did,createPassportSvg:t,initTab:H.initTab,handleChangeLabels:()=>gt()}),T&&o.jsx(_s,{teamDid:a,endpoint:pt||x,roles:f,apps:P,onCancel:()=>_(!1),onSuccess:()=>{u(),_(!1)}}),M&&o.jsx(Os,{teamDid:a,endpoint:pt||x,roles:f,onCancel:()=>O(!1),onSuccess:()=>{u(),O(!1)}}),j&&o.jsx(ve,{title:g("label.manage"),onClose:()=>S(!1),open:j,maxWidth:"lg",fullWidth:!0,PaperProps:{style:{height:"80vh"}},children:o.jsx(Rs,{onReload:()=>{gt(),i()}})}),d.show&&o.jsx(ve,{title:o.jsxs("div",{children:[g("common.userSessions"),d.showAppPid?" (Show All)":""]}),onClose:()=>qn(!1),open:d.show,maxWidth:"lg",PaperProps:{style:{minHeight:"80vh"}},fullWidth:!0,children:o.jsx(ja,{showAppPid:d.showAppPid,user:d.user,showAction:!1,showUser:!1,showOffline:!0,getUserSessions:d.getUserSessions})})]})}const xc=he.div`
|
|
168
|
-
.main {
|
|
169
|
-
.left {
|
|
170
|
-
width: 256px;
|
|
171
|
-
flex-shrink: 0;
|
|
172
|
-
|
|
173
|
-
.tabs {
|
|
174
|
-
padding-top: 16px;
|
|
175
|
-
.tab {
|
|
176
|
-
display: flex;
|
|
177
|
-
justify-content: space-between;
|
|
178
|
-
align-items: center;
|
|
179
|
-
padding: 8px 16px;
|
|
180
|
-
transition: background 0.4s;
|
|
181
|
-
|
|
182
|
-
width: 256px;
|
|
183
|
-
height: 36px;
|
|
184
|
-
border-radius: 8px;
|
|
185
|
-
|
|
186
|
-
cursor: pointer;
|
|
187
|
-
user-select: none;
|
|
188
|
-
|
|
189
|
-
&:nth-of-type(n + 2) {
|
|
190
|
-
margin-top: 24px;
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
&.active {
|
|
194
|
-
background-color: ${({theme:e})=>e.palette.grey[100]};
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
&:hover {
|
|
198
|
-
background-color: ${({theme:e})=>e.palette.grey[100]};
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
.text {
|
|
202
|
-
font-weight: 400;
|
|
203
|
-
font-size: 16px;
|
|
204
|
-
line-height: 19px;
|
|
205
|
-
color: ${({theme:e})=>e.palette.text.primary};
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
.badge {
|
|
209
|
-
display: flex;
|
|
210
|
-
flex-shrink: 0;
|
|
211
|
-
justify-content: center;
|
|
212
|
-
align-items: center;
|
|
213
|
-
width: 20px;
|
|
214
|
-
height: 20px;
|
|
215
|
-
border-radius: 100%;
|
|
216
|
-
color: #fff;
|
|
217
|
-
background: #666666;
|
|
218
|
-
font-size: 10px;
|
|
219
|
-
font-weight: 400;
|
|
220
|
-
&.is-rect {
|
|
221
|
-
width: auto;
|
|
222
|
-
border-radius: 8px;
|
|
223
|
-
padding: 0 4px;
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
@media (max-width: ${e=>e.theme.breakpoints.values.md}px) {
|
|
229
|
-
display: none;
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
.right {
|
|
233
|
-
flex: 1;
|
|
234
|
-
overflow: auto;
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
.member-block {
|
|
239
|
-
display: flex;
|
|
240
|
-
justify-content: flex-start;
|
|
241
|
-
align-items: center;
|
|
242
|
-
.member-avatar {
|
|
243
|
-
position: relative;
|
|
244
|
-
display: flex;
|
|
245
|
-
justify-content: center;
|
|
246
|
-
align-items: center;
|
|
247
|
-
}
|
|
248
|
-
.member-meta {
|
|
249
|
-
margin-left: 10px;
|
|
250
|
-
display: flex;
|
|
251
|
-
flex-direction: column;
|
|
252
|
-
justify-content: center;
|
|
253
|
-
align-items: flex-start;
|
|
254
|
-
}
|
|
255
|
-
.badge-block {
|
|
256
|
-
width: 14px;
|
|
257
|
-
height: 14px;
|
|
258
|
-
position: absolute;
|
|
259
|
-
right: -4px;
|
|
260
|
-
top: -4px;
|
|
261
|
-
background: #ff5757;
|
|
262
|
-
border-radius: 100%;
|
|
263
|
-
display: flex;
|
|
264
|
-
align-items: center;
|
|
265
|
-
justify-content: center;
|
|
266
|
-
&::after {
|
|
267
|
-
content: '';
|
|
268
|
-
width: 6px;
|
|
269
|
-
height: 2px;
|
|
270
|
-
background: #fefefe;
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
.table-toolbar-left {
|
|
276
|
-
display: flex;
|
|
277
|
-
justify-content: center;
|
|
278
|
-
align-items: center;
|
|
279
|
-
padding: 7px 0;
|
|
280
|
-
}
|
|
281
|
-
`;$n.propTypes={type:w.oneOf(["server","blocklet"]).isRequired,createPassportSvg:w.func.isRequired};function yc({type:e,createPassportSvg:t}){return o.jsx(Bt,{children:o.jsx(qs,{children:o.jsx($n,{type:e,createPassportSvg:t})})})}yc.propTypes={...$n.propTypes};export{yc as default};
|