@abtnode/webapp 1.16.45-beta-20250630-024910-24ef8c24 → 1.16.45-beta-20250630-233332-04c2bd6f
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/blocklet.js +1 -1
- package/blocklet.yml +1 -1
- package/dist/assets/{AdapterDayjs-BLLKfYiI.js → AdapterDayjs-BHlyhiPJ.js} +1 -1
- package/dist/assets/{Add-BVWbq3cG.js → Add-CKZvwomV.js} +1 -1
- package/dist/assets/{ArrowDropDown-ne3bM_Jg.js → ArrowDropDown-CTqTvgvP.js} +1 -1
- package/dist/assets/{Autocomplete-CkTshmb5.js → Autocomplete-BSy3e1ZV.js} +1 -1
- package/dist/assets/{Breadcrumbs-DhLLsWLK.js → Breadcrumbs-Dx36e97U.js} +1 -1
- package/dist/assets/{ButtonGroup-BVpxfmxe.js → ButtonGroup-Cv9T_ybJ.js} +1 -1
- package/dist/assets/{CSSTransition-W0nvNM-W.js → CSSTransition-D_ivveoB.js} +1 -1
- package/dist/assets/{CallMerge-Bj9l8yA0.js → CallMerge-1pQL6_dZ.js} +1 -1
- package/dist/assets/{CardContent-6Zxnd1pt.js → CardContent-Bht0UPSu.js} +1 -1
- package/dist/assets/{ChevronLeft-BYG5wavx.js → ChevronLeft-DlyVdCfr.js} +1 -1
- package/dist/assets/{ChevronRight-DMCQWR-9.js → ChevronRight-DoFFwAxz.js} +1 -1
- package/dist/assets/{Clear-D_9cXytM.js → Clear-h2RSseCa.js} +1 -1
- package/dist/assets/{Close-Pgfa3TO6.js → Close-L6Q6a3RE.js} +1 -1
- package/dist/assets/{Community-CRpBq74w.js → Community-OIzGuElq.js} +1 -1
- package/dist/assets/{Delete-DmSssFpY.js → Delete-DSwbRjGm.js} +1 -1
- package/dist/assets/{DeleteOutline-DRNLR9y7.js → DeleteOutline-BbkjMdAN.js} +1 -1
- package/dist/assets/{Done-B13j0VZG.js → Done-B9t-lcQ7.js} +1 -1
- package/dist/assets/{Edit-CheQvE1d.js → Edit-B7OHuMt8.js} +1 -1
- package/dist/assets/{ErrorOutline-CSTCrXXN.js → ErrorOutline-Dj5RjmYU.js} +1 -1
- package/dist/assets/{HelpOutline-BoQhPL02.js → HelpOutline-BFcbReM4.js} +1 -1
- package/dist/assets/{Holiday-OAdFki18.js → Holiday-DLceWWRW.js} +1 -1
- package/dist/assets/{Launch-D_WpKovx.js → Launch-BZfUR2wT.js} +1 -1
- package/dist/assets/{Link-C8h2XRwG.js → Link-CkeMp94q.js} +1 -1
- package/dist/assets/{ListItemButton-DD_v2iCZ.js → ListItemButton-D3dXwiba.js} +1 -1
- package/dist/assets/{ListSubheader-C5v2mm8b.js → ListSubheader-OdrZyzwN.js} +1 -1
- package/dist/assets/{LoadingButton-tRr47UnA.js → LoadingButton-BfU5BygV.js} +1 -1
- package/dist/assets/{LockIcon-C1fHdS5t.js → LockIcon-tb1yw67V.js} +1 -1
- package/dist/assets/{Meeting-BfpFLvCf.js → Meeting-Bl59MmZs.js} +1 -1
- package/dist/assets/{MoreHoriz-DsbeJTxh.js → MoreHoriz-BREqCusY.js} +1 -1
- package/dist/assets/{MoreVert-BAMY4knD.js → MoreVert-6SZ5-4Oc.js} +1 -1
- package/dist/assets/{OffSick-DtrRE0R4.js → OffSick-D_SYzKwE.js} +1 -1
- package/dist/assets/{OpenInNew-i69UfT5i.js → OpenInNew-DJezkARI.js} +1 -1
- package/dist/assets/{Public-CVzkpCXA.js → Public-Cgg-rE8P.js} +1 -1
- package/dist/assets/{Refresh-BaWfmwoN.js → Refresh-CToXYqtZ.js} +1 -1
- package/dist/assets/{SchemaReference.es--YL7flxa.js → SchemaReference.es-DON6qWUb.js} +1 -1
- package/dist/assets/{Search--E9n9O1E.js → Search-BWsSz0TZ.js} +1 -1
- package/dist/assets/{Slider-0msbOAE-.js → Slider-qd584sGN.js} +1 -1
- package/dist/assets/{Stepper-CH7hAe1O.js → Stepper-D5qb4eez.js} +1 -1
- package/dist/assets/{Switch-BJwf5ceb.js → Switch-B5mZ5gaW.js} +1 -1
- package/dist/assets/{TableRow-Blprpgh0.js → TableRow-Cm_wAjgF.js} +1 -1
- package/dist/assets/{TableSearch-jwWcMcmv.js → TableSearch-CbLOqG0x.js} +1 -1
- package/dist/assets/{ToggleButtonGroup--k0S5SsC.js → ToggleButtonGroup-BsAN6BnK.js} +1 -1
- package/dist/assets/{Verified-C0PvivLo.js → Verified-FiZjuwhy.js} +1 -1
- package/dist/assets/{VerifiedUser-CL646Ek5.js → VerifiedUser-CzSXnLhU.js} +1 -1
- package/dist/assets/{ViewColumn-BapDz7iW.js → ViewColumn-B1nkIYjz.js} +1 -1
- package/dist/assets/{ViewList-Dk8IoszY.js → ViewList-COZmXWce.js} +1 -1
- package/dist/assets/{WorkingRemotely-BEVNIhgO.js → WorkingRemotely-DwhCL9h1.js} +1 -1
- package/dist/assets/{_createAggregator-P2JOu3CO.js → _createAggregator-BdCza_P-.js} +1 -1
- package/dist/assets/{actions-B1_nu8vo.js → actions-BTcKDonC.js} +1 -1
- package/dist/assets/{actions-BP2ClATn.js → actions-Bvcwob0t.js} +1 -1
- package/dist/assets/{agreement-yxrIlkuz.js → agreement-EANMw4mp.js} +1 -1
- package/dist/assets/api-BJ-yIghe.js +1 -0
- package/dist/assets/{appearance-9huYXZXF.js → appearance-CZSOZlgx.js} +1 -1
- package/dist/assets/{audit-logs-BRYpi6Xi.js → audit-logs-vOsLrHtf.js} +1 -1
- package/dist/assets/{base-chart-BgHr2sw6.js → base-chart-DMVk_dMy.js} +1 -1
- package/dist/assets/{blocklet-CPAxSvIz.js → blocklet-DfNwfvjT.js} +1 -1
- package/dist/assets/{brace-fold.es-WbMhWVim.js → brace-fold.es-CESAnWUV.js} +1 -1
- package/dist/assets/{chain-56ZtWjYO.js → chain-DaWBsVEZ.js} +1 -1
- package/dist/assets/{click-to-copy-D1iXJHKS.js → click-to-copy-Bx0WCh-p.js} +1 -1
- package/dist/assets/cloneDeep-CvMji3zz.js +1 -0
- package/dist/assets/{closebrackets.es-C-Rz5Bf6.js → closebrackets.es-C817QEGa.js} +1 -1
- package/dist/assets/{codemirror.es-BJNxIChi.js → codemirror.es-gmfriNw8.js} +1 -1
- package/dist/assets/{collapse-DDN2E1dI.js → collapse-Ds1jlCkQ.js} +1 -1
- package/dist/assets/{comment.es-HNBjewoI.js → comment.es-DO9iblZv.js} +1 -1
- package/dist/assets/{config-navigation-Bn7KKQfH.js → config-navigation-DmriUtLF.js} +3 -3
- package/dist/assets/{connect-to-gUeeLOJv.js → connect-to-8NfHLbgD.js} +1 -1
- package/dist/assets/{delete-confirm-DSAA7ROU.js → delete-confirm-BbG1Njy7.js} +1 -1
- package/dist/assets/{detail-D_EQ0ZbU.js → detail-Bwjs-FKS.js} +3 -3
- package/dist/assets/{dialog.es-D0sbGrsI.js → dialog.es-DunCYlTS.js} +1 -1
- package/dist/assets/{domains-Dgvglcai.js → domains-3lFyCckU.js} +1 -1
- package/dist/assets/{download-BY7fzLnz.js → download-DhL2-FKU.js} +1 -1
- package/dist/assets/emotion-react.browser.esm-CH16KKaA.js +1 -0
- package/dist/assets/{foldgutter.es-9hEiyVTc.js → foldgutter.es-Caubyucg.js} +1 -1
- package/dist/assets/{get-safe-url-CNBKUnSh.js → get-safe-url-CIlQ_jPL.js} +1 -1
- package/dist/assets/{get-safe-url-P6A_Ruhz.js → get-safe-url-DdRvX178.js} +1 -1
- package/dist/assets/getValidReactChildren-Ds2y77el.js +1 -0
- package/dist/assets/{hint.es-B5wxstsV.js → hint.es-CruRhaN-.js} +1 -1
- package/dist/assets/{hint.es2-xDGsoJI9.js → hint.es2-DQ7u-Cnl.js} +1 -1
- package/dist/assets/{iframe-Cb4eAId6.js → iframe-CoA6LAJN.js} +1 -1
- package/dist/assets/{index-gE5md_vb.js → index-6QG0eJbd.js} +1 -1
- package/dist/assets/{index-CwgnMewz.js → index-B3guyKGC.js} +1 -1
- package/dist/assets/{index-AURPWKpp.js → index-B77QTgjk.js} +1 -1
- package/dist/assets/{index-DV_Y6g5I.js → index-BCBJCT1W.js} +1 -1
- package/dist/assets/{index-NDcAY1VU.js → index-BI05or-g.js} +1 -1
- package/dist/assets/{index-CMK70DfJ.js → index-BJcQfMN9.js} +1 -1
- package/dist/assets/{index-Dz4Wt9_z.js → index-BRwxtxxr.js} +1 -1
- package/dist/assets/{index-BrhHzrec.js → index-BVFznPvg.js} +1 -1
- package/dist/assets/{index-BrHzFWdY.js → index-BXLWgGxr.js} +1 -1
- package/dist/assets/{index-D9Lnr2pF.js → index-BXZ_Sepb.js} +1 -1
- package/dist/assets/{index-D_17kArk.js → index-Bd9sXNp9.js} +1 -1
- package/dist/assets/{index-BUgKJph9.js → index-BdgxyWV7.js} +1 -1
- package/dist/assets/{index-CC4O0ytJ.js → index-C5kA3CHn.js} +1 -1
- package/dist/assets/{index-BJ6_e_05.js → index-C6SovgLi.js} +3 -3
- package/dist/assets/{index-fQo5Ya2Z.js → index-CHE9ROUg.js} +1 -1
- package/dist/assets/{index-Dftx17o7.js → index-CIbq35qJ.js} +1 -1
- package/dist/assets/{index-DtHvk8jF.js → index-CJ2iy25m.js} +1 -1
- package/dist/assets/{index-D1pStVEE.js → index-CKT_pMKI.js} +1 -1
- package/dist/assets/{index-BStdxycA.js → index-CKzGu37_.js} +1 -1
- package/dist/assets/{index-OyGBJ3_y.js → index-CMclvolP.js} +1 -1
- package/dist/assets/{index-DjrrwepA.js → index-COTljNoO.js} +1 -1
- package/dist/assets/{index-_KFAQh0f.js → index-CPbeDmEg.js} +1 -1
- package/dist/assets/{index-LSDsoYSO.js → index-CVGZhJsl.js} +1 -1
- package/dist/assets/{index-Cpp27b72.js → index-C_KkIIIE.js} +1 -1
- package/dist/assets/{index-BbBhNeKh.js → index-C_tSdokL.js} +1 -1
- package/dist/assets/{index-CZV27bp2.js → index-CdkvSBOv.js} +3 -3
- package/dist/assets/{index-DySitdBx.js → index-D-VVWMa1.js} +1 -1
- package/dist/assets/{index-DFYQOPh8.js → index-D0_0NC6P.js} +1 -1
- package/dist/assets/{index-BmROMgh0.js → index-DAf-iI_f.js} +3 -3
- package/dist/assets/{index-CZ4ZJqi2.js → index-DDknB2BQ.js} +5 -5
- package/dist/assets/{index-C6Izz9No.js → index-DMUuXkl-.js} +2 -2
- package/dist/assets/{index-DbmHElt1.js → index-DPATNeV7.js} +1 -1
- package/dist/assets/{index-BJh5ubZu.js → index-DRrTj2G2.js} +1 -1
- package/dist/assets/{index-CkjaiqX3.js → index-DZdK0rK2.js} +1 -1
- package/dist/assets/{index-DyZgZOmW.js → index-DerOS-xf.js} +1 -1
- package/dist/assets/index-Dhf9-L3G.js +1 -0
- package/dist/assets/{index-DahCIi0O.js → index-DtQKM-2h.js} +1 -1
- package/dist/assets/{index-DC9xEwcp.js → index-Dw2CfFb3.js} +1 -1
- package/dist/assets/{index-BSXcaNTS.js → index-Dymg9lqV.js} +1 -1
- package/dist/assets/{index-DgFZqRZ8.js → index-IyfTJp8i.js} +1 -1
- package/dist/assets/{index-C6pg-LcE.js → index-MHcWBGOV.js} +1 -1
- package/dist/assets/{index-8q40O-7w.js → index-Myd8Qh5l.js} +1 -1
- package/dist/assets/{index-XnCKkv5i.js → index-OGZG8xfM.js} +1 -1
- package/dist/assets/{index-CF5KyBKJ.js → index-Z8_Ea0J-.js} +1 -1
- package/dist/assets/{index-D_HV8Z5P.js → index-e8rMD6ce.js} +1 -1
- package/dist/assets/{index-BkHlq1lh.js → index-nWbwSxF7.js} +3 -3
- package/dist/assets/{index-DYl86Rhy.js → index-qDvx2LXA.js} +1 -1
- package/dist/assets/{index.esm-BKQxKid3.js → index.esm-CBxLPn81.js} +1 -1
- package/dist/assets/{info-addon.es-njnSsaN8.js → info-addon.es-BuNfOlP_.js} +1 -1
- package/dist/assets/{info.es-CK0-2M8L.js → info.es-BT9LKStO.js} +1 -1
- package/dist/assets/{install-from-url-BxsfwyuB.js → install-from-url-BjMqGDXD.js} +1 -1
- package/dist/assets/{invitation-Dy26pV3p.js → invitation-OOnB1MnQ.js} +1 -1
- package/dist/assets/is-path-prefix-equal-DWu51fPZ.js +1 -0
- package/dist/assets/{item-GhBGVVVW.js → item-D_npg1xG.js} +1 -1
- package/dist/assets/{javascript.es-DC6TymIg.js → javascript.es-DoVgWSqA.js} +1 -1
- package/dist/assets/{jump-to-line.es-BCxJkWPP.js → jump-to-line.es-Ki36SaHt.js} +1 -1
- package/dist/assets/{jump.es-BobOCfl4.js → jump.es-BQrn6url.js} +1 -1
- package/dist/assets/{lint.es-DpU9tcYu.js → lint.es-DuK-tdYT.js} +1 -1
- package/dist/assets/{lint.es2-D4m8zvmF.js → lint.es2-BqlbRgHH.js} +1 -1
- package/dist/assets/{lint.es3-DI432prj.js → lint.es3-BSjWl5oo.js} +1 -1
- package/dist/assets/{list-header-Vnt3xfaU.js → list-header-I7ATqJra.js} +1 -1
- package/dist/assets/{log-wP1GfM4n.js → log-CQlLgXdp.js} +1 -1
- package/dist/assets/{lottie-react.esm-37CFPyuW.js → lottie-react.esm-CbT2RfxS.js} +1 -1
- package/dist/assets/{matchbrackets.es-BBmsNsCT.js → matchbrackets.es-Bjw4wGxG.js} +1 -1
- package/dist/assets/{memory-DioB05aG.js → memory-tq4C79oI.js} +1 -1
- package/dist/assets/{metric-B40GYWCj.js → metric-x46WB9O0.js} +1 -1
- package/dist/assets/{mode.es-D9aSpR_G.js → mode.es-mTcaUWXB.js} +1 -1
- package/dist/assets/{mode.es2-qaT1q5PJ.js → mode.es2-jKnc5kyz.js} +1 -1
- package/dist/assets/{mode.es3-F_nRYBrv.js → mode.es3-N6hg3bf1.js} +1 -1
- package/dist/assets/omit-DEm0zn3R.js +1 -0
- package/dist/assets/{onlineParser.es-MRv98OV7.js → onlineParser.es-B1S8nTp7.js} +1 -1
- package/dist/assets/{overview-CDdJyzBm.js → overview-YkRHSame.js} +1 -1
- package/dist/assets/{permission-h2Mie7R_.js → permission-BrGI8BrM.js} +1 -1
- package/dist/assets/{preference-BoukVJNS.js → preference-C3tBNpJ3.js} +4 -4
- package/dist/assets/{raf-schd.esm-lyZe_MLj.js → raf-schd.esm-BlF__8ph.js} +1 -1
- package/dist/assets/refType-BK4ojMi7.js +1 -0
- package/dist/assets/{resource-dialog-C4zmx3k7.js → resource-dialog-CroWtX8l.js} +4 -4
- package/dist/assets/{runtime-TMYd6jSU.js → runtime-BfH0pVsh.js} +1 -1
- package/dist/assets/sdk-B0fHGxCR.js +1 -0
- package/dist/assets/{search.es-CSnJU1OC.js → search.es-DPfw_MLi.js} +1 -1
- package/dist/assets/{searchcursor.es-Ck43PcqM.js → searchcursor.es-BeD7-C_W.js} +1 -1
- package/dist/assets/{service-Jn14v9Qy.js → service-BUPvoyUe.js} +1 -1
- package/dist/assets/{shorten-label-D4HQkind.js → shorten-label-Dkc-R7Pf.js} +1 -1
- package/dist/assets/{show-hint.es-DG97VqqG.js → show-hint.es-BY6EKf_p.js} +1 -1
- package/dist/assets/{simple-select-Bj5jAnRF.js → simple-select-oRYcfFfP.js} +1 -1
- package/dist/assets/{spaces-Cu-7CWUs.js → spaces-B_XtvGWM.js} +1 -1
- package/dist/assets/{status-D9FD3H9a.js → status-BYq6QPRF.js} +1 -1
- package/dist/assets/{status-TrPzrseV.js → status-FCdb54YV.js} +1 -1
- package/dist/assets/{sublime.es-D1igTCA9.js → sublime.es-CaTcUGtb.js} +1 -1
- package/dist/assets/{switch-control-CD3FrJIj.js → switch-control-BkMzTiNZ.js} +1 -1
- package/dist/assets/{table-icons-CexR6BP4.js → table-icons-BWE8DLba.js} +1 -1
- package/dist/assets/{team-D-oi6CUU.js → team-DXOr-ygw.js} +1 -1
- package/dist/assets/{toLower-BEHeFOeZ.js → toLower-lEcIAc-C.js} +1 -1
- package/dist/assets/toUpper-Z-pEvLY8.js +1 -0
- package/dist/assets/{traffic-BNw_hUMg.js → traffic-Baaukshm.js} +1 -1
- package/dist/assets/{url-evaluation-1fghsAUh.js → url-evaluation-D2uxzb5w.js} +1 -1
- package/dist/assets/{url-join-BqAR6NcU.js → url-join-DU6UdRf1.js} +1 -1
- package/dist/assets/{use-mobile-CaTlJeOV.js → use-mobile-BknAfbf7.js} +1 -1
- package/dist/assets/{use-mobile-BsssLiyX.js → use-mobile-hZxK6-uz.js} +1 -1
- package/dist/assets/{useAsync-Bp4AJMSF.js → useAsync-CbClB-AN.js} +1 -1
- package/dist/assets/{useAsyncRetry-By0_Waxi.js → useAsyncRetry-foiApHTO.js} +1 -1
- package/dist/assets/{useLocalStorage-CptlIDth.js → useLocalStorage-rbap7GBn.js} +1 -1
- package/dist/assets/{useThemeProps-D_kbBiom.js → useThemeProps-CWjJ-DWG.js} +1 -1
- package/dist/assets/{util-BO0XP_iE.js → util-DMr4hgRJ.js} +1 -1
- package/dist/assets/{wait-container-t8SFcQLe.js → wait-container-5RrJBT1J.js} +1 -1
- package/dist/assets/{withStyles-357xB96Z.js → withStyles-DD62sUmT.js} +1 -1
- package/dist/assets/{without-wallet-BH2vteYj.js → without-wallet-MfTWOoXr.js} +1 -1
- package/dist/assets/{wrap-locale-BHn2Bnsl.js → wrap-locale-Cm4YHFCT.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/service-worker.js +1 -1
- package/package.json +1 -1
- package/dist/assets/api-C91R2vN_.js +0 -1
- package/dist/assets/cloneDeep-DciNVKm5.js +0 -1
- package/dist/assets/emotion-react.browser.esm-CRwHqkji.js +0 -1
- package/dist/assets/getValidReactChildren-BvOfvno3.js +0 -1
- package/dist/assets/index-DhHQOa0s.js +0 -1
- package/dist/assets/is-path-prefix-equal-KwvbiEVE.js +0 -1
- package/dist/assets/omit-BS9XV_gA.js +0 -1
- package/dist/assets/refType-DXPWPdNY.js +0 -1
- package/dist/assets/sdk-DdkQ3E0T.js +0 -1
- package/dist/assets/toUpper-Cjc9aTZN.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{C}from"./codemirror.es-
|
|
1
|
+
import{C}from"./codemirror.es-gmfriNw8.js";import"./show-hint.es-BY6EKf_p.js";import{R as a,C as m,g as A,i as F,T as fe,S as Te,a as ge,I as Ee,G as H,b as O,d as me,e as ve,f as Se,h as ye,j as Ie,D as E,v as De,p as Fe,k as w,l as Ne,m as P,n as z,K as Y,o as be,q as _e,r as Ae}from"./index-DDknB2BQ.js";import{P as ke,C as Q}from"./Range.es-DaV7MD2W.js";import{o as Oe}from"./onlineParser.es-B1S8nTp7.js";import{S as J,T as K,a as $}from"./introspection.es-CPJcz6nz.js";import"./index-DMUuXkl-.js";var Me=Object.defineProperty,T=(t,r)=>Me(t,"name",{value:r,configurable:!0});function W(t){let r;return j(t,i=>{switch(i.kind){case"Query":case"ShortQuery":case"Mutation":case"Subscription":case"FragmentDefinition":r=i;break}}),r}T(W,"getDefinitionState");function V(t,r,i){return i===J.name&&t.getQueryType()===r?J:i===K.name&&t.getQueryType()===r?K:i===$.name&&F(r)?$:"getFields"in r?r.getFields()[i]:null}T(V,"getFieldDef");function j(t,r){const i=[];let n=t;for(;n!=null&&n.kind;)i.push(n),n=n.prevState;for(let e=i.length-1;e>=0;e--)r(i[e])}T(j,"forEachState");function N(t){const r=Object.keys(t),i=r.length,n=new Array(i);for(let e=0;e<i;++e)n[e]=t[r[e]];return n}T(N,"objectValues");function I(t,r){return X(r,G(t.string))}T(I,"hintList");function X(t,r){if(!r)return h(t,n=>!n.isDeprecated);const i=t.map(n=>({proximity:Z(G(n.label),r),entry:n}));return h(h(i,n=>n.proximity<=2),n=>!n.entry.isDeprecated).sort((n,e)=>(n.entry.isDeprecated?1:0)-(e.entry.isDeprecated?1:0)||n.proximity-e.proximity||n.entry.label.length-e.entry.label.length).map(n=>n.entry)}T(X,"filterAndSortList");function h(t,r){const i=t.filter(r);return i.length===0?t:i}T(h,"filterNonEmpty");function G(t){return t.toLowerCase().replace(/\W/g,"")}T(G,"normalizeText");function Z(t,r){let i=q(r,t);return t.length>r.length&&(i-=t.length-r.length-1,i+=t.indexOf(r)===0?0:.5),i}T(Z,"getProximity");function q(t,r){let i,n;const e=[],l=t.length,o=r.length;for(i=0;i<=l;i++)e[i]=[i];for(n=1;n<=o;n++)e[0][n]=n;for(i=1;i<=l;i++)for(n=1;n<=o;n++){const u=t[i-1]===r[n-1]?0:1;e[i][n]=Math.min(e[i-1][n]+1,e[i][n-1]+1,e[i-1][n-1]+u),i>1&&n>1&&t[i-1]===r[n-2]&&t[i-2]===r[n-1]&&(e[i][n]=Math.min(e[i][n],e[i-2][n-2]+u))}return e[l][o]}T(q,"lexicalDistance");const ee={command:"editor.action.triggerSuggest",title:"Suggestions"},Le=T(t=>{const r=[];if(t)try{De(Fe(t),{FragmentDefinition(i){r.push(i)}})}catch{return[]}return r},"collectFragmentDefs");function ne(t,r,i,n,e,l){var o;const u=Object.assign(Object.assign({},l),{schema:t}),s=n||ue(r,i),c=s.state.kind==="Invalid"?s.state.prevState:s.state;if(!c)return[];const p=c.kind,g=c.step,S=pe(t,s.state);if(p===a.DOCUMENT)return I(s,[{label:"query",kind:m.Function},{label:"mutation",kind:m.Function},{label:"subscription",kind:m.Function},{label:"fragment",kind:m.Function},{label:"{",kind:m.Constructor}]);if(p===a.IMPLEMENTS||p===a.NAMED_TYPE&&((o=c.prevState)===null||o===void 0?void 0:o.kind)===a.IMPLEMENTS)return re(s,c,t,r,S);if(p===a.SELECTION_SET||p===a.FIELD||p===a.ALIASED_FIELD)return te(s,S,u);if(p===a.ARGUMENTS||p===a.ARGUMENT&&g===0){const d=S.argDefs;if(d)return I(s,d.map(f=>{var v;return{label:f.name,insertText:f.name+": ",command:ee,detail:String(f.type),documentation:(v=f.description)!==null&&v!==void 0?v:void 0,kind:m.Variable,type:f.type}}))}if((p===a.OBJECT_VALUE||p===a.OBJECT_FIELD&&g===0)&&S.objectFieldDefs){const d=N(S.objectFieldDefs),f=p===a.OBJECT_VALUE?m.Value:m.Field;return I(s,d.map(v=>{var D;return{label:v.name,detail:String(v.type),documentation:(D=v.description)!==null&&D!==void 0?D:void 0,kind:f,type:v.type}}))}if(p===a.ENUM_VALUE||p===a.LIST_VALUE&&g===1||p===a.OBJECT_FIELD&&g===2||p===a.ARGUMENT&&g===2)return ie(s,S,r,t);if(p===a.VARIABLE&&g===1){const d=A(S.inputType),f=B(r,t,s);return I(s,f.filter(v=>v.detail===(d==null?void 0:d.name)))}return p===a.TYPE_CONDITION&&g===1||p===a.NAMED_TYPE&&c.prevState!=null&&c.prevState.kind===a.TYPE_CONDITION?ae(s,S,t):p===a.FRAGMENT_SPREAD&&g===1?oe(s,S,t,r,Array.isArray(e)?e:Le(e)):p===a.VARIABLE_DEFINITION&&g===2||p===a.LIST_TYPE&&g===1||p===a.NAMED_TYPE&&c.prevState&&(c.prevState.kind===a.VARIABLE_DEFINITION||c.prevState.kind===a.LIST_TYPE||c.prevState.kind===a.NON_NULL_TYPE)?le(s,t):p===a.DIRECTIVE?ce(s,c,t):[]}T(ne,"getAutocompleteSuggestions");const R=` {
|
|
2
2
|
$1
|
|
3
3
|
}`,Ce=T(t=>{const r=t.type;return F(r)||w(r)&&F(r.ofType)||Ne(r)&&(F(r.ofType)||w(r.ofType)&&F(r.ofType.ofType))?R:null},"getInsertText");function te(t,r,i){var n;if(r.parentType){const e=r.parentType;let l=[];return"getFields"in e&&(l=N(e.getFields())),F(e)&&l.push(fe),e===((n=i==null?void 0:i.schema)===null||n===void 0?void 0:n.getQueryType())&&l.push(Te,ge),I(t,l.map((o,u)=>{var s;const c={sortText:String(u)+o.name,label:o.name,detail:String(o.type),documentation:(s=o.description)!==null&&s!==void 0?s:void 0,deprecated:!!o.deprecationReason,isDeprecated:!!o.deprecationReason,deprecationReason:o.deprecationReason,kind:m.Field,type:o.type},p=Ce(o);return p&&(c.insertText=o.name+p,c.insertTextFormat=Ee.Snippet,c.command=ee),c}))}return[]}T(te,"getSuggestionsForFieldNames");function ie(t,r,i,n){const e=A(r.inputType),l=B(i,n,t).filter(o=>o.detail===e.name);if(e instanceof H){const o=e.getValues();return I(t,o.map(u=>{var s;return{label:u.name,detail:String(e),documentation:(s=u.description)!==null&&s!==void 0?s:void 0,deprecated:!!u.deprecationReason,isDeprecated:!!u.deprecationReason,deprecationReason:u.deprecationReason,kind:m.EnumMember,type:e}}).concat(l))}else if(e===O)return I(t,l.concat([{label:"true",detail:String(O),documentation:"Not false.",kind:m.Variable,type:O},{label:"false",detail:String(O),documentation:"Not true.",kind:m.Variable,type:O}]));return l}T(ie,"getSuggestionsForInputValues");function re(t,r,i,n,e){if(r.needsSeparator)return[];const l=i.getTypeMap(),o=N(l).filter(me),u=o.map(({name:d})=>d),s=new Set;M(n,(d,f)=>{var v,D,_,b,y;if(f.name&&(f.kind===a.INTERFACE_DEF&&!u.includes(f.name)&&s.add(f.name),f.kind===a.NAMED_TYPE&&((v=f.prevState)===null||v===void 0?void 0:v.kind)===a.IMPLEMENTS)){if(e.interfaceDef){if((D=e.interfaceDef)===null||D===void 0?void 0:D.getInterfaces().find(({name:x})=>x===f.name))return;const U=i.getType(f.name),k=(_=e.interfaceDef)===null||_===void 0?void 0:_.toConfig();e.interfaceDef=new P(Object.assign(Object.assign({},k),{interfaces:[...k.interfaces,U||new P({name:f.name,fields:{}})]}))}else if(e.objectTypeDef){if((b=e.objectTypeDef)===null||b===void 0?void 0:b.getInterfaces().find(({name:x})=>x===f.name))return;const U=i.getType(f.name),k=(y=e.objectTypeDef)===null||y===void 0?void 0:y.toConfig();e.objectTypeDef=new z(Object.assign(Object.assign({},k),{interfaces:[...k.interfaces,U||new P({name:f.name,fields:{}})]}))}}});const c=e.interfaceDef||e.objectTypeDef,g=((c==null?void 0:c.getInterfaces())||[]).map(({name:d})=>d),S=o.concat([...s].map(d=>({name:d}))).filter(({name:d})=>d!==(c==null?void 0:c.name)&&!g.includes(d));return I(t,S.map(d=>{const f={label:d.name,kind:m.Interface,type:d};return d!=null&&d.description&&(f.documentation=d.description),f}))}T(re,"getSuggestionsForImplements");function ae(t,r,i,n){let e;if(r.parentType)if(ve(r.parentType)){const l=Se(r.parentType),o=i.getPossibleTypes(l),u=Object.create(null);o.forEach(s=>{s.getInterfaces().forEach(c=>{u[c.name]=c})}),e=o.concat(N(u))}else e=[r.parentType];else{const l=i.getTypeMap();e=N(l).filter(F)}return I(t,e.map(l=>{const o=A(l);return{label:String(l),documentation:(o==null?void 0:o.description)||"",kind:m.Field}}))}T(ae,"getSuggestionsForFragmentTypeConditions");function oe(t,r,i,n,e){if(!n)return[];const l=i.getTypeMap(),o=W(t.state),u=se(n);e&&e.length>0&&u.push(...e);const s=u.filter(c=>l[c.typeCondition.name.value]&&!(o&&o.kind===a.FRAGMENT_DEFINITION&&o.name===c.name.value)&&F(r.parentType)&&F(l[c.typeCondition.name.value])&&ye(i,r.parentType,l[c.typeCondition.name.value]));return I(t,s.map(c=>({label:c.name.value,detail:String(l[c.typeCondition.name.value]),documentation:`fragment ${c.name.value} on ${c.typeCondition.name.value}`,kind:m.Field,type:l[c.typeCondition.name.value]})))}T(oe,"getSuggestionsForFragmentSpread");const Re=T((t,r)=>{var i,n,e,l,o,u,s,c,p,g;if(((i=t.prevState)===null||i===void 0?void 0:i.kind)===r)return t.prevState;if(((e=(n=t.prevState)===null||n===void 0?void 0:n.prevState)===null||e===void 0?void 0:e.kind)===r)return t.prevState.prevState;if(((u=(o=(l=t.prevState)===null||l===void 0?void 0:l.prevState)===null||o===void 0?void 0:o.prevState)===null||u===void 0?void 0:u.kind)===r)return t.prevState.prevState.prevState;if(((g=(p=(c=(s=t.prevState)===null||s===void 0?void 0:s.prevState)===null||c===void 0?void 0:c.prevState)===null||p===void 0?void 0:p.prevState)===null||g===void 0?void 0:g.kind)===r)return t.prevState.prevState.prevState.prevState},"getParentDefinition");function B(t,r,i){let n=null,e;const l=Object.create({});return M(t,(o,u)=>{if((u==null?void 0:u.kind)===a.VARIABLE&&u.name&&(n=u.name),(u==null?void 0:u.kind)===a.NAMED_TYPE&&n){const s=Re(u,a.TYPE);s!=null&&s.type&&(e=r.getType(s==null?void 0:s.type))}n&&e&&(l[n]||(l[n]={detail:e.toString(),insertText:i.string==="$"?n:"$"+n,label:n,type:e,kind:m.Variable},n=null,e=null))}),N(l)}T(B,"getVariableCompletions");function se(t){const r=[];return M(t,(i,n)=>{n.kind===a.FRAGMENT_DEFINITION&&n.name&&n.type&&r.push({kind:a.FRAGMENT_DEFINITION,name:{kind:Y.NAME,value:n.name},selectionSet:{kind:a.SELECTION_SET,selections:[]},typeCondition:{kind:a.NAMED_TYPE,name:{kind:Y.NAME,value:n.type}}})}),r}T(se,"getFragmentDefinitions");function le(t,r,i){const n=r.getTypeMap(),e=N(n).filter(Ie);return I(t,e.map(l=>({label:l.name,documentation:l.description,kind:m.Variable})))}T(le,"getSuggestionsForVariableDefinition");function ce(t,r,i,n){var e;if(!((e=r.prevState)===null||e===void 0)&&e.kind){const l=i.getDirectives().filter(o=>de(r.prevState,o));return I(t,l.map(o=>({label:o.name,documentation:o.description||"",kind:m.Function})))}return[]}T(ce,"getSuggestionsForDirective");function ue(t,r){let i=null,n=null,e=null;const l=M(t,(o,u,s,c)=>{if(c===r.line&&o.getCurrentPosition()>=r.character)return i=s,n=Object.assign({},u),e=o.current(),"BREAK"});return{start:l.start,end:l.end,string:e||l.string,state:n||l.state,style:i||l.style}}T(ue,"getTokenAtPosition");function M(t,r){const i=t.split(`
|
|
4
4
|
`),n=Oe();let e=n.startState(),l="",o=new Q("");for(let u=0;u<i.length;u++){for(o=new Q(i[u]);!o.eol()&&(l=n.token(o,e),r(o,e,l,u)!=="BREAK"););r(o,e,l,u),e.kind||(e=n.startState())}return{start:o.getStartOfToken(),end:o.getCurrentPosition(),string:o.current(),state:e,style:l}}T(M,"runOnlineParser");function de(t,r){var i;if(!t||!t.kind)return!1;const n=t.kind,e=r.locations;switch(n){case a.QUERY:return e.indexOf(E.QUERY)!==-1;case a.MUTATION:return e.indexOf(E.MUTATION)!==-1;case a.SUBSCRIPTION:return e.indexOf(E.SUBSCRIPTION)!==-1;case a.FIELD:case a.ALIASED_FIELD:return e.indexOf(E.FIELD)!==-1;case a.FRAGMENT_DEFINITION:return e.indexOf(E.FRAGMENT_DEFINITION)!==-1;case a.FRAGMENT_SPREAD:return e.indexOf(E.FRAGMENT_SPREAD)!==-1;case a.INLINE_FRAGMENT:return e.indexOf(E.INLINE_FRAGMENT)!==-1;case a.SCHEMA_DEF:return e.indexOf(E.SCHEMA)!==-1;case a.SCALAR_DEF:return e.indexOf(E.SCALAR)!==-1;case a.OBJECT_TYPE_DEF:return e.indexOf(E.OBJECT)!==-1;case a.FIELD_DEF:return e.indexOf(E.FIELD_DEFINITION)!==-1;case a.INTERFACE_DEF:return e.indexOf(E.INTERFACE)!==-1;case a.UNION_DEF:return e.indexOf(E.UNION)!==-1;case a.ENUM_DEF:return e.indexOf(E.ENUM)!==-1;case a.ENUM_VALUE:return e.indexOf(E.ENUM_VALUE)!==-1;case a.INPUT_DEF:return e.indexOf(E.INPUT_OBJECT)!==-1;case a.INPUT_VALUE_DEF:switch((i=t.prevState)===null||i===void 0?void 0:i.kind){case a.ARGUMENTS_DEF:return e.indexOf(E.ARGUMENT_DEFINITION)!==-1;case a.INPUT_DEF:return e.indexOf(E.INPUT_FIELD_DEFINITION)!==-1}}return!1}T(de,"canUseDirective");function pe(t,r){let i,n,e,l,o,u,s,c,p,g,S;return j(r,d=>{var f;switch(d.kind){case a.QUERY:case"ShortQuery":g=t.getQueryType();break;case a.MUTATION:g=t.getMutationType();break;case a.SUBSCRIPTION:g=t.getSubscriptionType();break;case a.INLINE_FRAGMENT:case a.FRAGMENT_DEFINITION:d.type&&(g=t.getType(d.type));break;case a.FIELD:case a.ALIASED_FIELD:{!g||!d.name?o=null:(o=p?V(t,p,d.name):null,g=o?o.type:null);break}case a.SELECTION_SET:p=A(g);break;case a.DIRECTIVE:e=d.name?t.getDirective(d.name):null;break;case a.INTERFACE_DEF:d.name&&(s=null,S=new P({name:d.name,interfaces:[],fields:{}}));break;case a.OBJECT_TYPE_DEF:d.name&&(S=null,s=new z({name:d.name,interfaces:[],fields:{}}));break;case a.ARGUMENTS:{if(!d.prevState)n=null;else switch(d.prevState.kind){case a.FIELD:n=o&&o.args;break;case a.DIRECTIVE:n=e&&e.args;break;case a.ALIASED_FIELD:{const y=(f=d.prevState)===null||f===void 0?void 0:f.name;if(!y){n=null;break}const L=p?V(t,p,y):null;if(!L){n=null;break}n=L.args;break}default:n=null;break}break}case a.ARGUMENT:if(n){for(let y=0;y<n.length;y++)if(n[y].name===d.name){i=n[y];break}}u=i==null?void 0:i.type;break;case a.ENUM_VALUE:const v=A(u);l=v instanceof H?v.getValues().find(y=>y.value===d.name):null;break;case a.LIST_VALUE:const D=_e(u);u=D instanceof Ae?D.ofType:null;break;case a.OBJECT_VALUE:const _=A(u);c=_ instanceof be?_.getFields():null;break;case a.OBJECT_FIELD:const b=d.name&&c?c[d.name]:null;u=b==null?void 0:b.type;break;case a.NAMED_TYPE:d.name&&(g=t.getType(d.name));break}}),{argDef:i,argDefs:n,directiveDef:e,enumValue:l,fieldDef:o,inputType:u,objectFieldDefs:c,parentType:p,type:g,interfaceDef:S,objectTypeDef:s}}T(pe,"getTypeInfo");C.registerHelper("hint","graphql",(t,r)=>{const i=r.schema;if(!i)return;const n=t.getCursor(),e=t.getTokenAt(n),l=e.type!==null&&/"|\w/.test(e.string[0])?e.start:e.end,o=new ke(n.line,l),s={list:ne(i,t.getValue(),o,e,r.externalFragments).map(c=>({text:c.label,type:c.type,description:c.documentation,isDeprecated:c.isDeprecated,deprecationReason:c.deprecationReason})),from:{line:n.line,ch:l},to:{line:n.line,ch:e.end}};return s!=null&&s.list&&s.list.length>0&&(s.from=C.Pos(s.from.line,s.from.ch),s.to=C.Pos(s.to.line,s.to.ch),C.signal(t,"hasCompletion",t,s,e)),s});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as u}from"./codemirror.es-
|
|
1
|
+
import{C as u}from"./codemirror.es-gmfriNw8.js";import{f as j}from"./forEachState.es-D8bf0zSr.js";import{g,o as b,G as O,b as d,q as N,r as D}from"./index-DDknB2BQ.js";import"./index-DMUuXkl-.js";var M=Object.defineProperty,p=(r,n)=>M(r,"name",{value:n,configurable:!0});function f(r,n,t){const i=x(t,m(n.string));if(!i)return;const e=n.type!==null&&/"|\w/.test(n.string[0])?n.start:n.end;return{list:i,from:{line:r.line,ch:e},to:{line:r.line,ch:n.end}}}p(f,"hintList");function x(r,n){if(!n)return y(r,l=>!l.isDeprecated);const t=r.map(l=>({proximity:T(m(l.text),n),entry:l}));return y(y(t,l=>l.proximity<=2),l=>!l.entry.isDeprecated).sort((l,o)=>(l.entry.isDeprecated?1:0)-(o.entry.isDeprecated?1:0)||l.proximity-o.proximity||l.entry.text.length-o.entry.text.length).map(l=>l.entry)}p(x,"filterAndSortList");function y(r,n){const t=r.filter(n);return t.length===0?r:t}p(y,"filterNonEmpty");function m(r){return r.toLowerCase().replace(/\W/g,"")}p(m,"normalizeText");function T(r,n){let t=v(n,r);return r.length>n.length&&(t-=r.length-n.length-1,t+=r.indexOf(n)===0?0:.5),t}p(T,"getProximity");function v(r,n){let t,i;const e=[],l=r.length,o=n.length;for(t=0;t<=l;t++)e[t]=[t];for(i=1;i<=o;i++)e[0][i]=i;for(t=1;t<=l;t++)for(i=1;i<=o;i++){const c=r[t-1]===n[i-1]?0:1;e[t][i]=Math.min(e[t-1][i]+1,e[t][i-1]+1,e[t-1][i-1]+c),t>1&&i>1&&r[t-1]===n[i-2]&&r[t-2]===n[i-1]&&(e[t][i]=Math.min(e[t][i],e[t-2][i-2]+c))}return e[l][o]}p(v,"lexicalDistance");u.registerHelper("hint","graphql-variables",(r,n)=>{const t=r.getCursor(),i=r.getTokenAt(t),e=L(t,i,n);return e!=null&&e.list&&e.list.length>0&&(e.from=u.Pos(e.from.line,e.from.ch),e.to=u.Pos(e.to.line,e.to.ch),u.signal(r,"hasCompletion",r,e,i)),e});function L(r,n,t){const i=n.state.kind==="Invalid"?n.state.prevState:n.state,e=i.kind,l=i.step;if(e==="Document"&&l===0)return f(r,n,[{text:"{"}]);const o=t.variableToType;if(!o)return;const c=V(o,n.state);if(e==="Document"||e==="Variable"&&l===0){const a=Object.keys(o);return f(r,n,a.map(s=>({text:`"${s}": `,type:o[s]})))}if((e==="ObjectValue"||e==="ObjectField"&&l===0)&&c.fields){const a=Object.keys(c.fields).map(s=>c.fields[s]);return f(r,n,a.map(s=>({text:`"${s.name}": `,type:s.type,description:s.description})))}if(e==="StringValue"||e==="NumberValue"||e==="BooleanValue"||e==="NullValue"||e==="ListValue"&&l===1||e==="ObjectField"&&l===2||e==="Variable"&&l===2){const a=c.type?g(c.type):void 0;if(a instanceof b)return f(r,n,[{text:"{"}]);if(a instanceof O){const s=a.getValues();return f(r,n,s.map(h=>({text:`"${h.name}"`,type:a,description:h.description})))}else if(a===d)return f(r,n,[{text:"true",type:d,description:"Not false."},{text:"false",type:d,description:"Not true."}])}}p(L,"getVariablesHint");function V(r,n){const t={type:null,fields:null};return j(n,i=>{if(i.kind==="Variable")t.type=r[i.name];else if(i.kind==="ListValue"){const e=t.type?N(t.type):void 0;t.type=e instanceof D?e.ofType:null}else if(i.kind==="ObjectValue"){const e=t.type?g(t.type):void 0;t.fields=e instanceof b?e.getFields():null}else if(i.kind==="ObjectField"){const e=i.name&&t.fields?t.fields[i.name]:null;t.type=e==null?void 0:e.type}}),t}p(V,"getTypeInfo");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i9 as x,bi as E}from"./index-
|
|
1
|
+
import{i9 as x,bi as E}from"./index-DMUuXkl-.js";const L=({url:r,allowFullScreen:o,position:a,display:i,height:u,width:c,overflow:y,styles:f,onLoad:p,onMouseOver:b,onMouseOut:w,scrolling:d,id:m,frameBorder:n,ariaHidden:O,sandbox:s,allow:j,className:g,title:h,ariaLabel:k,ariaLabelledby:I,name:P,target:v,loading:A,importance:F,referrerpolicy:M,allowpaymentrequest:S,src:$,key:q})=>{const t=x({src:$||r,target:v||null,style:{position:a||null,display:i||"initial",overflow:y||null},scrolling:d||null,allowpaymentrequest:S||null,importance:F||null,sandbox:s&&[...s].join(" ")||null,loading:A||null,styles:f||null,name:P||null,className:g||null,allowFullScreen:"allowFullScreen",referrerpolicy:M||null,title:h||null,allow:j||null,id:m||null,"aria-labelledby":I||null,"aria-hidden":O||null,"aria-label":k||null,width:c||null,height:u||null,onLoad:p||null,onMouseOver:b||null,onMouseOut:w||null,key:q||"iframe"});let l=Object.create(null);for(let e of Object.keys(t))t[e]!=null&&(l[e]=t[e]);for(let e of Object.keys(l.style))l.style[e]==null&&delete l.style[e];if(l.styles)for(let e of Object.keys(l.styles))l.styles.hasOwnProperty(e)&&(l.style[e]=l.styles[e]),Object.keys(l.styles).pop()==e&&delete l.styles;if(o)if("allow"in l){const e=l.allow.replace("fullscreen","");l.allow=`fullscreen ${e.trim()}`.trim()}else l.allow="fullscreen";return n>=0&&(l.style.hasOwnProperty("border")||(l.style.border=n)),E.createElement("iframe",Object.assign({},l))},R=L;export{R as I};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{br as St,r as x,bD as X,bj as U,A as V,F as L,j as e,P as d,T as Ct,aQ as Je,aR as Ze,ax as Nt,h as ne,aC as wt,k as G,N as v,m as J,ej as _e,Q as Be,kJ as et,bo as Ee,aZ as De,X as Ae,ep as we,b8 as Ge,b6 as Oe,C as tt,n as re,f as st,dB as nt,aU as Le,W as Tt,aw as at,kK as it,B as ke,kL as ot,g3 as Se,gk as rt,aj as fe,ff as Rt,ay as It,G as Ye,kM as Et,kN as Dt,D as lt,kO as At,kP as Ot,kQ as Lt,kR as kt,R as Pt,bx as ct,S as Ft,U as _t,V as Qe,M as Bt,kS as zt,a5 as Wt}from"./index-C6Izz9No.js";import{l as Mt,D as dt,g as qt}from"./index-DahCIi0O.js";import{a as ze,c as Kt}from"./actions-B1_nu8vo.js";import{B as Ut}from"./index-LSDsoYSO.js";import{S as xe}from"./shorten-label-D4HQkind.js";import{I as ut}from"./index-DgFZqRZ8.js";import{T as $t}from"./index-CMK70DfJ.js";import{d as Ht}from"./Refresh-BaWfmwoN.js";import{D as Vt,g as Gt}from"./traffic-BNw_hUMg.js";import{u as Yt}from"./use-mobile-BsssLiyX.js";import"./TableRow-Blprpgh0.js";import"./useThemeProps-D_kbBiom.js";import"./emotion-react.browser.esm-CRwHqkji.js";import"./ViewColumn-BapDz7iW.js";import"./Search--E9n9O1E.js";import"./Clear-D_9cXytM.js";import"./Delete-DmSssFpY.js";import"./index-CF5KyBKJ.js";import"./MoreVert-BAMY4knD.js";import"./TableSearch-jwWcMcmv.js";import"./useLocalStorage-CptlIDth.js";import"./get-safe-url-P6A_Ruhz.js";import"./ButtonGroup-BVpxfmxe.js";import"./getValidReactChildren-BvOfvno3.js";import"./url-evaluation-1fghsAUh.js";import"./permission-h2Mie7R_.js";import"./index.esm-BKQxKid3.js";import"./collapse-DDN2E1dI.js";import"./blocklet-CPAxSvIz.js";import"./Switch-BJwf5ceb.js";import"./iframe-Cb4eAId6.js";import"./ChevronLeft-BYG5wavx.js";import"./ChevronRight-DMCQWR-9.js";import"./index-CkjaiqX3.js";import"./base-chart-BgHr2sw6.js";import"./index-DFYQOPh8.js";import"./AdapterDayjs-BLLKfYiI.js";import"./CSSTransition-W0nvNM-W.js";import"./refType-DXPWPdNY.js";const pt=x.createContext({}),{Provider:Qt,Consumer:pn}=pt;function Xt({children:t,blocklet:s=""}){const{api:n,inService:o,ws:{useSubscription:r}}=St(),[l,b]=x.useState([]),[u,D]=x.useState({total:0,pageSize:20,pageCount:0,page:1}),f=X(()=>{var p;return(p=s.meta)==null?void 0:p.did},[s]),[C,N]=x.useState([]),[B,z]=x.useState({}),E=X(()=>l.length?new Set(l.map(p=>p.id)):new Set,[l]),Y=async({page:p=1,pageSize:S=20,...A}={})=>{if(!f)return[];try{const w={paging:{page:p,pageSize:S},...A,teamDid:f,dateRange:A.dateRange?[U(A.dateRange[0]).toISOString(),U(A.dateRange[1]).toISOString()]:void 0},{dids:O,..._}=w;let Z="";O&&O.includes("system")&&(Z="system");const W=O?O.filter(le=>le!=="system"):[],ae={..._,source:Z,componentDids:W},se=await n.getNotificationSendLog({input:ae});return z(ae),b(se.list),D(se.paging),se.list}catch(w){return V.error(w.message),[]}},P=async()=>{const p=await n.getNotificationComponents({input:{teamDid:f}});N(p.componentDids)},k=x.useCallback(p=>{const S=s.children.find(A=>{var w;return((w=A.meta)==null?void 0:w.did)===p});if(S)return S.ancestors=[s],S},[s]),I=async({notificationId:p,receivers:S,channels:A,...w})=>{await n.resendNotification({input:{teamDid:f,notificationId:p,receivers:S,channels:A.map(O=>O==="wallet"?L.NOTIFICATION_SEND_CHANNEL.WALLET:O==="pushKit"?L.NOTIFICATION_SEND_CHANNEL.PUSH:O),...w}})},$=x.useCallback(async p=>(await n.getUser({input:{teamDid:f,user:{did:p}}})).user,[n,f]),Q=x.useCallback(async({page:p=1,pageSize:S=20,...A}={})=>{try{const w={paging:{page:p,pageSize:S},...A,userName:A.searchText||"",teamDid:f,dateRange:A.dateRange?[U(A.dateRange[0]).toISOString(),U(A.dateRange[1]).toISOString()]:void 0};return await n.getReceivers({input:w})}catch(w){throw V.error(w.message),w}},[n,f]);x.useEffect(()=>{f&&P()},[f]),r(L.EVENTS.NOTIFICATION_BLOCKLET_UPDATE,p=>{E.has(p.notificationId)&&Y(B)},[E,B]),r(L.EVENTS.NOTIFICATION_BLOCKLET_CREATE,p=>{E.has(p.id)||Y(B)},[E,B]);const te={fetch:Y,data:l,paging:u,blocklet:s,getComponent:k,resendNotification:I,getUser:$,componentDids:C,getReceivers:Q,inService:o,teamDid:f};return e.jsx(Qt,{value:{notificationRecords:te},children:t})}function We(){const{notificationRecords:t}=x.useContext(pt);return t}be.propTypes={severity:d.oneOf(Object.values(["info","success","error","warning"])).isRequired};const Jt={info:"primary",success:"success",error:"error",warning:"warning"};function be({severity:t="info"}){return e.jsx(Ct,{type:Jt[t],children:t})}var Me={},Zt=Ze;Object.defineProperty(Me,"__esModule",{value:!0});var ft=Me.default=void 0,es=Zt(Je()),ts=e;ft=Me.default=(0,es.default)((0,ts.jsx)("path",{d:"M16.59 7.58 10 14.17l-3.59-3.58L5 12l5 5 8-8zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"}),"CheckCircleOutline");var qe={},ss=Ze;Object.defineProperty(qe,"__esModule",{value:!0});var mt=qe.default=void 0,ns=ss(Je()),as=e;mt=qe.default=(0,ns.default)((0,as.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2M4 12c0-4.42 3.58-8 8-8 1.85 0 3.55.63 4.9 1.69L5.69 16.9C4.63 15.55 4 13.85 4 12m8 8c-1.85 0-3.55-.63-4.9-1.69L18.31 7.1C19.37 8.45 20 10.15 20 12c0 4.42-3.58 8-8 8"}),"Block");const is=(t,s,n="")=>{if(!n||!s)return"";switch(n){case L.NOTIFICATION_SEND_FAILED_REASON.USER_DISABLED:return t("notification.sendStatus.reason.disabled",{channel:s});case L.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_UNAVAILABLE:return t("notification.sendStatus.reason.unavailable",{channel:s});case L.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_DISABLED:return t("notification.sendStatus.reason.notSent",{channel:s});case L.NOTIFICATION_SEND_FAILED_REASON.NOT_ONLINE:return t("notification.sendStatus.reason.offline");default:return n}};function ht(t,s,n={}){const{status:o,updatedAt:r,reason:l="",channel:b="wallet"}=n,u=r?t("notification.sendStatus.sentTime",{date:Nt(r,s)}):"",D=is(t,b,l);return o===L.NOTIFICATION_SEND_STATUS.FAILED?{status:"failed",title:t("notification.sendStatus.failed"),sentTime:u,reason:D}:o===L.NOTIFICATION_SEND_STATUS.SENT?{status:"success",title:t("notification.sendStatus.success"),sentTime:u}:{status:"pending",title:t("notification.sendStatus.pending"),reason:D,sentTime:u}}const Pe={pending:"#aaaaaa",success:"#34BE74",failed:"#D0021B"},Fe=["wallet","pushKit","email"],Xe=["info","success","error","warning"],gt=t=>{var n,o;const{settings:s}=t;return(o=(n=s==null?void 0:s.notification)==null?void 0:n.email)==null?void 0:o.enabled},xt=t=>{var n,o;const{settings:s}=t;return(o=(n=s==null?void 0:s.notification)==null?void 0:n.pushKit)==null?void 0:o.enabled},os=(t,s)=>{const n=ne(s,"extra.notifications.email",!0);return{available:gt(t),enabled:n}},rs=(t,s)=>{const n=ne(s,"extra.notifications.push",!0);return{available:xt(t),enabled:n}},ls=t=>({enabled:ne(t,"extra.notifications.wallet",!0)}),cs=t=>({enabled:ne(t,"extra.webhooks",[]).length>0}),ye=(t=3)=>new Promise(s=>{setTimeout(()=>{s()},t*1e3)}),ds=(t,s)=>s==="wallet"||s==="webhook"?[{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:s==="pushKit"||s==="email"?[{channel:s,type:"available",pass:t("notification.sendStatus.reason.available",{channel:s}),fail:t("notification.sendStatus.reason.unavailable",{channel:s})},{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:[],ve=(t=[])=>{const s=U().startOf("day");return t.filter(n=>U(n.sendAt).isSame(s,"day")).length},us=(t,s="")=>{if(s&&Fe.includes(s)){const l=`${s}SendRecord`,b=ne(t,l,[]);return ve(b)}const n=ne(t,"webhook",{}),o=Object.keys(n??{})??[];if(s&&o.includes(s)){const l=n[s]??[];return ve(l)}const r={};return Fe.forEach(l=>{const b=`${l}SendRecord`,u=ne(t,b,[]),D=ve(u);r[l]=D}),o.length>0&&o.forEach(l=>{const b=n[l]??[],u=ve(b);r[l]=u}),r},Ce=(t,s,n)=>{if(!Array.isArray(t))throw new Error("Invalid filterList or index");return t[n].splice(s,1),t},Ne=(t,s)=>{if(!Array.isArray(s))throw new Error("filters must be an array");return s.length?!s.includes(t):!1},ps=t=>{switch(t){case L.NOTIFICATION_SEND_CHANNEL.WALLET:return"Wallet";case L.NOTIFICATION_SEND_CHANNEL.PUSH:return"Push Kit";case L.NOTIFICATION_SEND_CHANNEL.EMAIL:return"Email";case L.NOTIFICATION_SEND_CHANNEL.WEBHOOK:return"Webhook";default:return""}},bt=()=>({components:{MUIDataTableFilter:{styleOverrides:{header:{marginBottom:0,p:{margin:0}},root:{"& .MuiGrid-container":{marginTop:0,"& .MuiGrid-item":{paddingTop:0}}}}},MuiPopover:{styleOverrides:{root:{"&.MuiPopover-root":{"& .MuiPaper-root:has(.filter-container)":{width:"420px"}}}}}}});function ee({config:t,enableTooltip:s=!0,showTitle:n=!1,children:o}){const{status:r,title:l="",sentTime:b="",reason:u=""}=t,D=[l,u].filter(Boolean).join(", ");return e.jsx(wt,{title:s?e.jsxs(e.Fragment,{children:[e.jsx(G,{color:"inherit",sx:{fontSize:12},children:D}),e.jsx("span",{children:b})]}):null,arrow:!0,placement:"top",children:e.jsxs(v,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsxs(v,{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center",children:[e.jsx(v,{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:Pe[r],style:{opacity:.15}}),e.jsx(v,{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:Pe[r]})]}),e.jsx(G,{color:"inherit",sx:{fontSize:12},children:n?l:o})]})})}ee.propTypes={config:d.object.isRequired,enableTooltip:d.bool,showTitle:d.bool,children:d.node};ee.defaultProps={enableTooltip:!0,showTitle:!1,children:null};me.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};me.defaultProps={onDelete:()=>{}};function me({list:t,label:s,onDelete:n}){const{t:o,locale:r}=J();return e.jsxs(v,{display:"flex",gap:1,alignItems:"center",children:[e.jsxs(G,{children:[s,": "]}),t.map(l=>{const b=ht(o,r,{status:l});return e.jsx(_e,{size:"small",label:e.jsx(v,{display:"flex",alignItems:"center",sx:{gap:"4px"},children:e.jsx(ee,{config:b,enableTooltip:!1,children:b.title})}),onDelete:u=>n(u,l)},l)})]})}Ke.propTypes={filterList:d.array.isRequired,onChange:d.func.isRequired,index:d.number.isRequired,column:d.object.isRequired,filterValues:d.array.isRequired,label:d.string.isRequired,renderLabel:d.func.isRequired};function Ke({filterList:t,onChange:s,index:n,column:o,filterValues:r,label:l,renderLabel:b}){return e.jsxs(Be,{className:"filter-container",children:[e.jsx(et,{component:"legend",children:l}),e.jsx(Ee,{row:!0,children:r.map(u=>e.jsx(De,{control:e.jsx(Ae,{checked:t[n].indexOf(u.value??u)>-1,onChange:D=>{const f=[...t];D.target.checked?f[n]=[...f[n],u.value??u]:f[n]=f[n].filter(C=>C!==(u.value??u)),s(f[n],n,o)},name:u.value??u}),label:e.jsx("span",{style:{display:"flex",alignItems:"center"},children:b(u)})},u.value??u))})]})}function Ie(t){return e.jsx(Ke,{...t,renderLabel:s=>e.jsx(ee,{enableTooltip:!1,config:{status:s.status},children:s.label})})}pe.propTypes={status:d.number.isRequired,updatedAt:d.string.isRequired,reason:d.string,channel:d.string,onResend:d.func};function pe({status:t,updatedAt:s,reason:n="",channel:o="wallet",onResend:r}){const{t:l,locale:b}=J(),u=ht(l,b,{status:t,updatedAt:s,reason:n,channel:o});return e.jsxs(v,{display:"flex",alignItems:"center",gap:1,children:[e.jsx(ee,{config:u,showTitle:!0}),u.status!=="success"&&e.jsx(we,{className:"resend-btn",size:"small",startIcon:e.jsx(ze,{}),sx:{fontSize:12,color:"rgba(0, 0, 0, 0.87)",fontWeight:400,".MuiButton-startIcon":{mr:"2px"}},onClick:r,children:l("notification.resend")})]})}Ue.propTypes={value:d.array.isRequired,onChange:d.func};function Ue({value:t,onChange:s}){const{locale:n}=J(),o=U().toDate(),[r,l]=x.useState(null),b=x.useCallback(f=>{l(r?null:f.currentTarget)},[r]),u=!!r,D=x.useCallback(f=>{if(!f.startDate||!f.endDate){V.error("Please select a date range");return}if(U(f.startDate).isAfter(f.endDate)||!U(f.startDate).isValid()||!U(f.endDate).isValid()){V.error("Invalid date range");return}s([f.startDate,f.endDate]),l(null)},[s]);return e.jsxs("div",{children:[e.jsx(G,{component:"div",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},mb:0,children:e.jsxs(we,{onClick:b,variant:"outlined",size:"small",color:"inherit",children:[Ge(t[0],n)," - ",Ge(t[1],n)]})}),e.jsx(Oe,{open:u,anchorEl:r,onClose:()=>{l(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:e.jsx(Vt,{open:!0,maxDate:o,initialDateRange:{startDate:t[0],endDate:t[1]},toggle:b,definedRanges:Gt(o),onChange:D})})]})}$e.propTypes={itemComponent:d.elementType.isRequired};function $e({itemComponent:t,...s}){var r;const{t:n}=J();return!((r=s==null?void 0:s.filterList)!=null&&r.filter(l=>l.length).length)?null:e.jsxs(v,{display:"flex",gap:1,alignItems:"center",children:[e.jsx("div",{className:"toolbar-filter-title",children:n("notification.filter")}),e.jsx("div",{className:"toolbar-filter-content",children:e.jsx(Mt.TableFilterList,{...s,ItemComponent:t})})]})}function Te({label:t,onDelete:s,canDelete:n=()=>!0,...o}){const r=s&&typeof s=="function"?s:void 0;let l=!0;return n&&typeof n=="function"&&(l=n({label:t,...o})),e.jsx(_e,{label:t,variant:"outlined",...r&&l?{onDelete:r}:{}})}Te.propTypes={label:d.string.isRequired,onDelete:d.func,canDelete:d.func};Te.defaultProps={canDelete:()=>!0};const fs=[{label:"Wallet",value:"app",checked:!0},{label:"Email",value:"email",checked:!0},{label:"Push Kit",value:"push",checked:!0},{label:"Webhook",value:"webhook",checked:!0}];He.propTypes={loading:d.bool,onCancel:d.func,onConfirm:d.func};He.defaultProps={loading:!1,onCancel:()=>{},onConfirm:()=>{}};function He({loading:t=!1,onCancel:s,onConfirm:n}){const{t:o}=J(),[r,l]=x.useState(fs),[b,u]=x.useState(!0),D=(C,N)=>{N.checked=C.target.checked;const B=r.map(z=>({...z,checked:z.value===N.value?N.checked:z.checked}));l(B)},f=C=>{C.stopPropagation(),n({channels:r.filter(N=>N.checked).map(N=>N.value),isResendFailedOnly:b})};return e.jsxs(v,{className:"resend-config",sx:{padding:"16px 24px"},children:[e.jsx(G,{variant:"body1",component:"div",className:"check-title",sx:{fontWeight:700,mb:1},children:o("notification.config")}),e.jsx(v,{className:"choose-channel",children:e.jsxs(Be,{component:"fieldset",variant:"standard",children:[e.jsx(et,{component:"legend",children:o("notification.selectChannels")}),e.jsx(Ee,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:1},children:r.map(C=>e.jsx(De,{control:e.jsx(Ae,{checked:C.checked,onChange:N=>D(N,C),name:C.value}),label:C.label},C.value))})]})}),e.jsx(v,{className:"resend-config-footer",children:e.jsx(Ee,{children:e.jsx(De,{control:e.jsx(Ae,{checked:b,onChange:C=>u(C.target.checked)}),label:o("notification.resendFailedOnly")})})}),e.jsxs(v,{display:"flex",justifyContent:"flex-end",gap:1,className:"resend-config-footer-tip",children:[e.jsx(we,{onClick:C=>{C.stopPropagation(),s()},color:"inherit",children:o("common.cancel")}),e.jsxs(we,{onClick:f,color:"primary",disabled:t,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[t&&e.jsx(tt,{size:16}),o("common.confirm")]})]})]})}jt.propTypes={notificationId:d.string.isRequired,handleResend:d.func,resending:d.bool};function jt({notificationId:t,handleResend:s,resending:n=!1}){const{t:o,locale:r}=J(),l=st(),b=x.useMemo(()=>nt(l,bt()),[l]),{getReceivers:u,inService:D,teamDid:f,getUser:C,blocklet:N}=We(),[B,z]=x.useState(!1),[E,Y]=x.useState([]),P=Le({anchorEl:null,position:null}),k=Le({anchorEl:null,position:null}),[I,$]=x.useState(null),[Q,te]=x.useState({total:0,pageSize:10,pageCount:0,page:1}),[p,S]=x.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[U().subtract(1,"month").startOf("day").toDate(),U().endOf("day").toDate()]}),[A,w]=x.useState([]),O=[{label:o("notification.sendStatus.pending"),value:0,status:"pending"},{label:o("notification.sendStatus.success"),value:1,status:"success"},{label:o("notification.sendStatus.failed"),value:2,status:"failed"}],_=async()=>{if(!B&&t)try{z(!0);const a=await u({notificationId:t,...p}),i=a.list.map(c=>({...c,receiverUser:{...c.receiverUser,avatar:rt(c.receiverUser.avatar,f,D)}}));Y(i),te(a.paging),z(!1)}catch(a){V.error(a.message),z(!1)}};x.useEffect(()=>{_()},[p]);const Z=a=>{a.stopPropagation();const i=a.currentTarget;k.anchorEl=i;const c=i.getBoundingClientRect();k.position={top:c.top+window.scrollY,left:c.left+window.scrollX}},W=a=>a.data.length?e.jsx("div",{style:{display:"flex",alignItems:"center",padding:"10px"},children:e.jsx(ke,{className:"resend-btn",size:"small",color:"primary",variant:"contained",startIcon:e.jsx(ze,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:Z,children:o("notification.resend")})}):null,ae={sort:!1,download:!1,print:!1,selectableRows:"multiple",searchPlaceholder:o("common.search"),searchAlwaysOpen:!1,filterType:"checkbox",searchDebounceTime:300,page:Q.page-1,rowsPerPage:Q.pageSize,count:Q.total,searchText:p.searchText,tableBodyMaxHeight:"calc(80vh - 260px)",rowsSelected:A,onRowSelectionChange:(a,i)=>{w(i.map(c=>c.dataIndex))},customToolbarSelect:W},se=({page:a,rowsPerPage:i,searchText:c,filterList:y})=>{const[,F=[],K=[],q=[]]=y;p.pageSize!==i?S(M=>({...M,pageSize:i,page:1})):p.page!==a+1?S(M=>({...M,page:a+1})):p.searchText!==c?S(M=>({...M,searchText:c,page:1})):fe(F,p.walletSendStatus)?fe(K,p.pushKitSendStatus)?fe(q,p.emailSendStatus)||S(M=>({...M,emailSendStatus:q,page:1})):S(M=>({...M,pushKitSendStatus:K,page:1})):S(M=>({...M,walletSendStatus:F,page:1}))},le=x.useCallback(async(a,i)=>{if(!i)return!1;const c=await C(i);return c?a==="wallet"?ls(c):a==="email"?os(N,c):a==="pushKit"?rs(N,c):a==="webhook"?cs(c):!0:!1},[C,N]),je=x.useCallback(a=>ds(o,a),[o]),ce=()=>{P.anchorEl=null,P.position=null,$(null)},de=()=>{k.anchorEl=null,k.position=null},ue=async(a,i,c=!0,y="")=>{if(!(!i.length||!a.length))try{s(a,i,c,y),k.anchorEl||(await ye(.5),ce())}catch(F){console.error("handleResend error",{error:F})}},h=async({channels:a,isResendFailedOnly:i})=>{const c=A.map(y=>E[y].receiver);await ue(a,c,i),await ye(.5),de(),w([])},m=async(a,i=[],c=!0)=>{try{await ue(["webhook"],[a.receiver],c,i)}catch(y){V.error(y.response?y.response.statusText:y.message)}},g=async(a,i,c,y=[],F=!0)=>{if(a.stopPropagation(),us(i,c)>=4){V.warning(o("notification.resendLimit"));return}if(!Fe.includes(c)){await m(i,y,F);return}if(a){const q=a.currentTarget,M=q.getBoundingClientRect();P.anchorEl=q,P.position={top:M.top+window.scrollY,left:M.left+window.scrollX}}$({channel:c});try{const q=await le(c,i.receiver);await ye(1),$({channel:c,result:q}),(typeof q=="boolean"&&q||Rt(q)&&Object.values(q).every(M=>!!M))&&(await s([c],[i.receiver],F),k.anchorEl||(await ye(.5),ce()))}catch(q){V.error(q.message)}},j=a=>{S(i=>({...i,dateRange:a,page:1}))},T=(a,i,c,y)=>{a.stopPropagation();const F=c.filter(K=>K!==i);S(K=>({...K,[y]:F,page:1}))},R=X(()=>[{label:o("notification.receiver"),name:"receiver",width:200,options:{filter:!1,customBodyRenderLite:a=>{const{receiverUser:i,receiver:c}=E[a];return i?e.jsxs(v,{"data-cy":`member-name-${i.fullName}`,display:"flex",alignItems:"center",gap:1,justifyContent:"flex-start",children:[e.jsx(at,{src:`${i.avatar}?imageFilter=resize&w=48&h=48`,size:32,did:c,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),e.jsx(xe,{children:i.fullName})]},c):e.jsx(Tt,{size:14,responsive:!1,compact:!0,copyable:!1,did:c})}}},{label:"Wallet",name:"walletSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),filter:!0,filterType:"custom",filterList:p.walletSendStatus??[],customFilterListOptions:{render:a=>e.jsx(me,{list:a,label:"Wallet",onDelete:(i,c)=>{i.stopPropagation(),T(i,c,R[1].options.filterList,"walletSendStatus")}}),update:Ce},filterOptions:{names:O,fullWidth:!0,logic:Ne,display:(a,i,c,y)=>e.jsx(Ie,{label:"Wallet",filterList:a,onChange:i,index:c,column:y,filterValues:O})},customBodyRenderLite:a=>{const{walletSendStatus:i,walletSendAt:c,walletSendFailedReason:y}=E[a];return e.jsx(pe,{status:i,updatedAt:c,reason:y,channel:"wallet",onResend:F=>g(F,E[a],"wallet",[],!1)})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:a=>{const{pushKitSendStatus:i,pushKitSendAt:c,pushKitSendFailedReason:y}=E[a];return e.jsx(pe,{status:i,updatedAt:c,reason:y,channel:"pushkit",onResend:F=>g(F,E[a],"pushKit",[],!1)})},filter:!0,filterType:"custom",filterList:p.pushKitSendStatus??[],customFilterListOptions:{render:a=>e.jsx(me,{list:a,label:"Push Kit",onDelete:(i,c)=>{i.stopPropagation(),T(i,c,R[2].options.filterList,"pushKitSendStatus")}}),update:Ce},filterOptions:{names:O,fullWidth:!0,logic:Ne,display:(a,i,c,y)=>e.jsx(Ie,{label:"Push Kit",filterList:a,onChange:i,index:c,column:y,filterValues:O})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:a=>{const{emailSendStatus:i,emailSendAt:c,emailSendFailedReason:y}=E[a];return e.jsx(pe,{status:i,updatedAt:c,reason:y,channel:"email",onResend:F=>g(F,E[a],"email",[],!1)})},filter:!0,filterType:"custom",filterList:p.emailSendStatus??[],customFilterListOptions:{render:a=>e.jsx(me,{list:a,label:"Email",onDelete:(i,c)=>{i.stopPropagation(),T(i,c,R[3].options.filterList,"emailSendStatus")}}),update:Ce},filterOptions:{names:O,fullWidth:!0,logic:Ne,display:(a,i,c,y)=>e.jsx(Ie,{label:"Email",filterList:a,onChange:i,index:c,column:y,filterValues:O})}}},{label:"Webhook",name:"webhook",width:200,options:{filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:a=>{const{webhook:i}=E[a];if(!i)return null;const c=Object.entries(i)[0];if(!c)return null;const[y,F]=c,K=F[0];return e.jsx(v,{display:"flex",flexDirection:"column",gap:1,children:e.jsxs(v,{className:"webhook-item",fontSize:12,children:[e.jsx(xe,{maxLength:30,children:y},y),e.jsx(pe,{status:K.status,updatedAt:K.sendAt,reason:K.failedReason,channel:"webhook",onResend:q=>g(q,E[a],"webhook",[y],!1)})]},y)})}}},{label:o("common.createdAt"),name:"createdAt",width:100,options:{filter:!1,customBodyRenderLite:a=>{const{createdAt:i}=E[a];return e.jsx(it,{value:i,locale:r,shouldUpdate:!0})}}}],[E,r,p,o]),H=[e.jsx(Ue,{value:p.dateRange,onChange:j},"date-picker"),e.jsx(ke,{variant:"contained",size:"small",color:"primary",loading:B,startIcon:e.jsx(Ht,{}),onClick:()=>_(),sx:{".MuiButton-startIcon":{mr:"2px"}},style:{marginLeft:8},children:o("common.refresh")},"refresh")];return e.jsx(v,{sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:e.jsx(hs,{children:e.jsxs(ot,{theme:b,children:[e.jsx(dt,{className:"receivers-table",locale:r,loading:B,columns:R,data:E,onChange:se,options:ae,customButtons:H,components:{TableFilterList:a=>e.jsx($e,{...a,itemComponent:i=>e.jsx(Te,{...i,canDelete:()=>!1})})}}),P.anchorEl&&e.jsx(Oe,{open:!!P.anchorEl,anchorReference:"anchorPosition",anchorPosition:P.position,onClose:ce,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs(gs,{children:[e.jsxs(G,{variant:"body1",component:"div",className:"check-title",children:[I==null?void 0:I.channel," Checking"]}),e.jsx(v,{display:"flex",flexDirection:"column",sx:{gap:"4px"},children:je(I==null?void 0:I.channel).map(a=>{var F,K;const{type:i,pass:c,fail:y}=a;return!(I!=null&&I.result)||(F=I==null?void 0:I.result)!=null&&F[i]?e.jsxs(G,{variant:"body1",component:"div",className:"check-item",display:"flex",alignItems:"center",sx:{gap:"4px",color:(K=I==null?void 0:I.result)!=null&&K[i]?Se.success.main:"inherit"},children:[I!=null&&I.result?e.jsx(ft,{}):e.jsx(tt,{size:12,sx:{color:Se.primary.main}}),e.jsx("span",{children:c})]},i):e.jsxs(G,{variant:"body1",component:"div",display:"flex",alignItems:"center",className:"check-item",sx:{gap:"4px",color:Se.error.main},children:[e.jsx(mt,{}),e.jsx("span",{children:y})]},i)})})]})}),k.anchorEl&&e.jsx(Oe,{open:!!k.anchorEl,anchorReference:"anchorPosition",anchorPosition:k.position,onClose:de,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsx(He,{loading:n,onCancel:de,onConfirm:h})})]})})})}const ms=x.memo(jt),hs=re.div`
|
|
1
|
+
import{br as St,r as x,bD as X,bj as U,A as V,F as L,j as e,P as d,T as Ct,aQ as Je,aR as Ze,ax as Nt,h as ne,aC as wt,k as G,N as v,m as J,ej as _e,Q as Be,kJ as et,bo as Ee,aZ as De,X as Ae,ep as we,b8 as Ge,b6 as Oe,C as tt,n as re,f as st,dB as nt,aU as Le,W as Tt,aw as at,kK as it,B as ke,kL as ot,g3 as Se,gk as rt,aj as fe,ff as Rt,ay as It,G as Ye,kM as Et,kN as Dt,D as lt,kO as At,kP as Ot,kQ as Lt,kR as kt,R as Pt,bx as ct,S as Ft,U as _t,V as Qe,M as Bt,kS as zt,a5 as Wt}from"./index-DMUuXkl-.js";import{l as Mt,D as dt,g as qt}from"./index-DtQKM-2h.js";import{a as ze,c as Kt}from"./actions-BTcKDonC.js";import{B as Ut}from"./index-CVGZhJsl.js";import{S as xe}from"./shorten-label-Dkc-R7Pf.js";import{I as ut}from"./index-IyfTJp8i.js";import{T as $t}from"./index-BJcQfMN9.js";import{d as Ht}from"./Refresh-CToXYqtZ.js";import{D as Vt,g as Gt}from"./traffic-Baaukshm.js";import{u as Yt}from"./use-mobile-hZxK6-uz.js";import"./TableRow-Cm_wAjgF.js";import"./useThemeProps-CWjJ-DWG.js";import"./emotion-react.browser.esm-CH16KKaA.js";import"./ViewColumn-B1nkIYjz.js";import"./Search-BWsSz0TZ.js";import"./Clear-h2RSseCa.js";import"./Delete-DSwbRjGm.js";import"./index-Z8_Ea0J-.js";import"./MoreVert-6SZ5-4Oc.js";import"./TableSearch-CbLOqG0x.js";import"./useLocalStorage-rbap7GBn.js";import"./get-safe-url-DdRvX178.js";import"./ButtonGroup-Cv9T_ybJ.js";import"./getValidReactChildren-Ds2y77el.js";import"./url-evaluation-D2uxzb5w.js";import"./permission-BrGI8BrM.js";import"./index.esm-CBxLPn81.js";import"./collapse-Ds1jlCkQ.js";import"./blocklet-DfNwfvjT.js";import"./Switch-B5mZ5gaW.js";import"./iframe-CoA6LAJN.js";import"./ChevronLeft-DlyVdCfr.js";import"./ChevronRight-DoFFwAxz.js";import"./index-DZdK0rK2.js";import"./base-chart-DMVk_dMy.js";import"./index-D0_0NC6P.js";import"./AdapterDayjs-BHlyhiPJ.js";import"./CSSTransition-D_ivveoB.js";import"./refType-BK4ojMi7.js";const pt=x.createContext({}),{Provider:Qt,Consumer:pn}=pt;function Xt({children:t,blocklet:s=""}){const{api:n,inService:o,ws:{useSubscription:r}}=St(),[l,b]=x.useState([]),[u,D]=x.useState({total:0,pageSize:20,pageCount:0,page:1}),f=X(()=>{var p;return(p=s.meta)==null?void 0:p.did},[s]),[C,N]=x.useState([]),[B,z]=x.useState({}),E=X(()=>l.length?new Set(l.map(p=>p.id)):new Set,[l]),Y=async({page:p=1,pageSize:S=20,...A}={})=>{if(!f)return[];try{const w={paging:{page:p,pageSize:S},...A,teamDid:f,dateRange:A.dateRange?[U(A.dateRange[0]).toISOString(),U(A.dateRange[1]).toISOString()]:void 0},{dids:O,..._}=w;let Z="";O&&O.includes("system")&&(Z="system");const W=O?O.filter(le=>le!=="system"):[],ae={..._,source:Z,componentDids:W},se=await n.getNotificationSendLog({input:ae});return z(ae),b(se.list),D(se.paging),se.list}catch(w){return V.error(w.message),[]}},P=async()=>{const p=await n.getNotificationComponents({input:{teamDid:f}});N(p.componentDids)},k=x.useCallback(p=>{const S=s.children.find(A=>{var w;return((w=A.meta)==null?void 0:w.did)===p});if(S)return S.ancestors=[s],S},[s]),I=async({notificationId:p,receivers:S,channels:A,...w})=>{await n.resendNotification({input:{teamDid:f,notificationId:p,receivers:S,channels:A.map(O=>O==="wallet"?L.NOTIFICATION_SEND_CHANNEL.WALLET:O==="pushKit"?L.NOTIFICATION_SEND_CHANNEL.PUSH:O),...w}})},$=x.useCallback(async p=>(await n.getUser({input:{teamDid:f,user:{did:p}}})).user,[n,f]),Q=x.useCallback(async({page:p=1,pageSize:S=20,...A}={})=>{try{const w={paging:{page:p,pageSize:S},...A,userName:A.searchText||"",teamDid:f,dateRange:A.dateRange?[U(A.dateRange[0]).toISOString(),U(A.dateRange[1]).toISOString()]:void 0};return await n.getReceivers({input:w})}catch(w){throw V.error(w.message),w}},[n,f]);x.useEffect(()=>{f&&P()},[f]),r(L.EVENTS.NOTIFICATION_BLOCKLET_UPDATE,p=>{E.has(p.notificationId)&&Y(B)},[E,B]),r(L.EVENTS.NOTIFICATION_BLOCKLET_CREATE,p=>{E.has(p.id)||Y(B)},[E,B]);const te={fetch:Y,data:l,paging:u,blocklet:s,getComponent:k,resendNotification:I,getUser:$,componentDids:C,getReceivers:Q,inService:o,teamDid:f};return e.jsx(Qt,{value:{notificationRecords:te},children:t})}function We(){const{notificationRecords:t}=x.useContext(pt);return t}be.propTypes={severity:d.oneOf(Object.values(["info","success","error","warning"])).isRequired};const Jt={info:"primary",success:"success",error:"error",warning:"warning"};function be({severity:t="info"}){return e.jsx(Ct,{type:Jt[t],children:t})}var Me={},Zt=Ze;Object.defineProperty(Me,"__esModule",{value:!0});var ft=Me.default=void 0,es=Zt(Je()),ts=e;ft=Me.default=(0,es.default)((0,ts.jsx)("path",{d:"M16.59 7.58 10 14.17l-3.59-3.58L5 12l5 5 8-8zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"}),"CheckCircleOutline");var qe={},ss=Ze;Object.defineProperty(qe,"__esModule",{value:!0});var mt=qe.default=void 0,ns=ss(Je()),as=e;mt=qe.default=(0,ns.default)((0,as.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2M4 12c0-4.42 3.58-8 8-8 1.85 0 3.55.63 4.9 1.69L5.69 16.9C4.63 15.55 4 13.85 4 12m8 8c-1.85 0-3.55-.63-4.9-1.69L18.31 7.1C19.37 8.45 20 10.15 20 12c0 4.42-3.58 8-8 8"}),"Block");const is=(t,s,n="")=>{if(!n||!s)return"";switch(n){case L.NOTIFICATION_SEND_FAILED_REASON.USER_DISABLED:return t("notification.sendStatus.reason.disabled",{channel:s});case L.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_UNAVAILABLE:return t("notification.sendStatus.reason.unavailable",{channel:s});case L.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_DISABLED:return t("notification.sendStatus.reason.notSent",{channel:s});case L.NOTIFICATION_SEND_FAILED_REASON.NOT_ONLINE:return t("notification.sendStatus.reason.offline");default:return n}};function ht(t,s,n={}){const{status:o,updatedAt:r,reason:l="",channel:b="wallet"}=n,u=r?t("notification.sendStatus.sentTime",{date:Nt(r,s)}):"",D=is(t,b,l);return o===L.NOTIFICATION_SEND_STATUS.FAILED?{status:"failed",title:t("notification.sendStatus.failed"),sentTime:u,reason:D}:o===L.NOTIFICATION_SEND_STATUS.SENT?{status:"success",title:t("notification.sendStatus.success"),sentTime:u}:{status:"pending",title:t("notification.sendStatus.pending"),reason:D,sentTime:u}}const Pe={pending:"#aaaaaa",success:"#34BE74",failed:"#D0021B"},Fe=["wallet","pushKit","email"],Xe=["info","success","error","warning"],gt=t=>{var n,o;const{settings:s}=t;return(o=(n=s==null?void 0:s.notification)==null?void 0:n.email)==null?void 0:o.enabled},xt=t=>{var n,o;const{settings:s}=t;return(o=(n=s==null?void 0:s.notification)==null?void 0:n.pushKit)==null?void 0:o.enabled},os=(t,s)=>{const n=ne(s,"extra.notifications.email",!0);return{available:gt(t),enabled:n}},rs=(t,s)=>{const n=ne(s,"extra.notifications.push",!0);return{available:xt(t),enabled:n}},ls=t=>({enabled:ne(t,"extra.notifications.wallet",!0)}),cs=t=>({enabled:ne(t,"extra.webhooks",[]).length>0}),ye=(t=3)=>new Promise(s=>{setTimeout(()=>{s()},t*1e3)}),ds=(t,s)=>s==="wallet"||s==="webhook"?[{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:s==="pushKit"||s==="email"?[{channel:s,type:"available",pass:t("notification.sendStatus.reason.available",{channel:s}),fail:t("notification.sendStatus.reason.unavailable",{channel:s})},{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:[],ve=(t=[])=>{const s=U().startOf("day");return t.filter(n=>U(n.sendAt).isSame(s,"day")).length},us=(t,s="")=>{if(s&&Fe.includes(s)){const l=`${s}SendRecord`,b=ne(t,l,[]);return ve(b)}const n=ne(t,"webhook",{}),o=Object.keys(n??{})??[];if(s&&o.includes(s)){const l=n[s]??[];return ve(l)}const r={};return Fe.forEach(l=>{const b=`${l}SendRecord`,u=ne(t,b,[]),D=ve(u);r[l]=D}),o.length>0&&o.forEach(l=>{const b=n[l]??[],u=ve(b);r[l]=u}),r},Ce=(t,s,n)=>{if(!Array.isArray(t))throw new Error("Invalid filterList or index");return t[n].splice(s,1),t},Ne=(t,s)=>{if(!Array.isArray(s))throw new Error("filters must be an array");return s.length?!s.includes(t):!1},ps=t=>{switch(t){case L.NOTIFICATION_SEND_CHANNEL.WALLET:return"Wallet";case L.NOTIFICATION_SEND_CHANNEL.PUSH:return"Push Kit";case L.NOTIFICATION_SEND_CHANNEL.EMAIL:return"Email";case L.NOTIFICATION_SEND_CHANNEL.WEBHOOK:return"Webhook";default:return""}},bt=()=>({components:{MUIDataTableFilter:{styleOverrides:{header:{marginBottom:0,p:{margin:0}},root:{"& .MuiGrid-container":{marginTop:0,"& .MuiGrid-item":{paddingTop:0}}}}},MuiPopover:{styleOverrides:{root:{"&.MuiPopover-root":{"& .MuiPaper-root:has(.filter-container)":{width:"420px"}}}}}}});function ee({config:t,enableTooltip:s=!0,showTitle:n=!1,children:o}){const{status:r,title:l="",sentTime:b="",reason:u=""}=t,D=[l,u].filter(Boolean).join(", ");return e.jsx(wt,{title:s?e.jsxs(e.Fragment,{children:[e.jsx(G,{color:"inherit",sx:{fontSize:12},children:D}),e.jsx("span",{children:b})]}):null,arrow:!0,placement:"top",children:e.jsxs(v,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsxs(v,{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center",children:[e.jsx(v,{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:Pe[r],style:{opacity:.15}}),e.jsx(v,{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:Pe[r]})]}),e.jsx(G,{color:"inherit",sx:{fontSize:12},children:n?l:o})]})})}ee.propTypes={config:d.object.isRequired,enableTooltip:d.bool,showTitle:d.bool,children:d.node};ee.defaultProps={enableTooltip:!0,showTitle:!1,children:null};me.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};me.defaultProps={onDelete:()=>{}};function me({list:t,label:s,onDelete:n}){const{t:o,locale:r}=J();return e.jsxs(v,{display:"flex",gap:1,alignItems:"center",children:[e.jsxs(G,{children:[s,": "]}),t.map(l=>{const b=ht(o,r,{status:l});return e.jsx(_e,{size:"small",label:e.jsx(v,{display:"flex",alignItems:"center",sx:{gap:"4px"},children:e.jsx(ee,{config:b,enableTooltip:!1,children:b.title})}),onDelete:u=>n(u,l)},l)})]})}Ke.propTypes={filterList:d.array.isRequired,onChange:d.func.isRequired,index:d.number.isRequired,column:d.object.isRequired,filterValues:d.array.isRequired,label:d.string.isRequired,renderLabel:d.func.isRequired};function Ke({filterList:t,onChange:s,index:n,column:o,filterValues:r,label:l,renderLabel:b}){return e.jsxs(Be,{className:"filter-container",children:[e.jsx(et,{component:"legend",children:l}),e.jsx(Ee,{row:!0,children:r.map(u=>e.jsx(De,{control:e.jsx(Ae,{checked:t[n].indexOf(u.value??u)>-1,onChange:D=>{const f=[...t];D.target.checked?f[n]=[...f[n],u.value??u]:f[n]=f[n].filter(C=>C!==(u.value??u)),s(f[n],n,o)},name:u.value??u}),label:e.jsx("span",{style:{display:"flex",alignItems:"center"},children:b(u)})},u.value??u))})]})}function Ie(t){return e.jsx(Ke,{...t,renderLabel:s=>e.jsx(ee,{enableTooltip:!1,config:{status:s.status},children:s.label})})}pe.propTypes={status:d.number.isRequired,updatedAt:d.string.isRequired,reason:d.string,channel:d.string,onResend:d.func};function pe({status:t,updatedAt:s,reason:n="",channel:o="wallet",onResend:r}){const{t:l,locale:b}=J(),u=ht(l,b,{status:t,updatedAt:s,reason:n,channel:o});return e.jsxs(v,{display:"flex",alignItems:"center",gap:1,children:[e.jsx(ee,{config:u,showTitle:!0}),u.status!=="success"&&e.jsx(we,{className:"resend-btn",size:"small",startIcon:e.jsx(ze,{}),sx:{fontSize:12,color:"rgba(0, 0, 0, 0.87)",fontWeight:400,".MuiButton-startIcon":{mr:"2px"}},onClick:r,children:l("notification.resend")})]})}Ue.propTypes={value:d.array.isRequired,onChange:d.func};function Ue({value:t,onChange:s}){const{locale:n}=J(),o=U().toDate(),[r,l]=x.useState(null),b=x.useCallback(f=>{l(r?null:f.currentTarget)},[r]),u=!!r,D=x.useCallback(f=>{if(!f.startDate||!f.endDate){V.error("Please select a date range");return}if(U(f.startDate).isAfter(f.endDate)||!U(f.startDate).isValid()||!U(f.endDate).isValid()){V.error("Invalid date range");return}s([f.startDate,f.endDate]),l(null)},[s]);return e.jsxs("div",{children:[e.jsx(G,{component:"div",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},mb:0,children:e.jsxs(we,{onClick:b,variant:"outlined",size:"small",color:"inherit",children:[Ge(t[0],n)," - ",Ge(t[1],n)]})}),e.jsx(Oe,{open:u,anchorEl:r,onClose:()=>{l(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:e.jsx(Vt,{open:!0,maxDate:o,initialDateRange:{startDate:t[0],endDate:t[1]},toggle:b,definedRanges:Gt(o),onChange:D})})]})}$e.propTypes={itemComponent:d.elementType.isRequired};function $e({itemComponent:t,...s}){var r;const{t:n}=J();return!((r=s==null?void 0:s.filterList)!=null&&r.filter(l=>l.length).length)?null:e.jsxs(v,{display:"flex",gap:1,alignItems:"center",children:[e.jsx("div",{className:"toolbar-filter-title",children:n("notification.filter")}),e.jsx("div",{className:"toolbar-filter-content",children:e.jsx(Mt.TableFilterList,{...s,ItemComponent:t})})]})}function Te({label:t,onDelete:s,canDelete:n=()=>!0,...o}){const r=s&&typeof s=="function"?s:void 0;let l=!0;return n&&typeof n=="function"&&(l=n({label:t,...o})),e.jsx(_e,{label:t,variant:"outlined",...r&&l?{onDelete:r}:{}})}Te.propTypes={label:d.string.isRequired,onDelete:d.func,canDelete:d.func};Te.defaultProps={canDelete:()=>!0};const fs=[{label:"Wallet",value:"app",checked:!0},{label:"Email",value:"email",checked:!0},{label:"Push Kit",value:"push",checked:!0},{label:"Webhook",value:"webhook",checked:!0}];He.propTypes={loading:d.bool,onCancel:d.func,onConfirm:d.func};He.defaultProps={loading:!1,onCancel:()=>{},onConfirm:()=>{}};function He({loading:t=!1,onCancel:s,onConfirm:n}){const{t:o}=J(),[r,l]=x.useState(fs),[b,u]=x.useState(!0),D=(C,N)=>{N.checked=C.target.checked;const B=r.map(z=>({...z,checked:z.value===N.value?N.checked:z.checked}));l(B)},f=C=>{C.stopPropagation(),n({channels:r.filter(N=>N.checked).map(N=>N.value),isResendFailedOnly:b})};return e.jsxs(v,{className:"resend-config",sx:{padding:"16px 24px"},children:[e.jsx(G,{variant:"body1",component:"div",className:"check-title",sx:{fontWeight:700,mb:1},children:o("notification.config")}),e.jsx(v,{className:"choose-channel",children:e.jsxs(Be,{component:"fieldset",variant:"standard",children:[e.jsx(et,{component:"legend",children:o("notification.selectChannels")}),e.jsx(Ee,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:1},children:r.map(C=>e.jsx(De,{control:e.jsx(Ae,{checked:C.checked,onChange:N=>D(N,C),name:C.value}),label:C.label},C.value))})]})}),e.jsx(v,{className:"resend-config-footer",children:e.jsx(Ee,{children:e.jsx(De,{control:e.jsx(Ae,{checked:b,onChange:C=>u(C.target.checked)}),label:o("notification.resendFailedOnly")})})}),e.jsxs(v,{display:"flex",justifyContent:"flex-end",gap:1,className:"resend-config-footer-tip",children:[e.jsx(we,{onClick:C=>{C.stopPropagation(),s()},color:"inherit",children:o("common.cancel")}),e.jsxs(we,{onClick:f,color:"primary",disabled:t,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[t&&e.jsx(tt,{size:16}),o("common.confirm")]})]})]})}jt.propTypes={notificationId:d.string.isRequired,handleResend:d.func,resending:d.bool};function jt({notificationId:t,handleResend:s,resending:n=!1}){const{t:o,locale:r}=J(),l=st(),b=x.useMemo(()=>nt(l,bt()),[l]),{getReceivers:u,inService:D,teamDid:f,getUser:C,blocklet:N}=We(),[B,z]=x.useState(!1),[E,Y]=x.useState([]),P=Le({anchorEl:null,position:null}),k=Le({anchorEl:null,position:null}),[I,$]=x.useState(null),[Q,te]=x.useState({total:0,pageSize:10,pageCount:0,page:1}),[p,S]=x.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[U().subtract(1,"month").startOf("day").toDate(),U().endOf("day").toDate()]}),[A,w]=x.useState([]),O=[{label:o("notification.sendStatus.pending"),value:0,status:"pending"},{label:o("notification.sendStatus.success"),value:1,status:"success"},{label:o("notification.sendStatus.failed"),value:2,status:"failed"}],_=async()=>{if(!B&&t)try{z(!0);const a=await u({notificationId:t,...p}),i=a.list.map(c=>({...c,receiverUser:{...c.receiverUser,avatar:rt(c.receiverUser.avatar,f,D)}}));Y(i),te(a.paging),z(!1)}catch(a){V.error(a.message),z(!1)}};x.useEffect(()=>{_()},[p]);const Z=a=>{a.stopPropagation();const i=a.currentTarget;k.anchorEl=i;const c=i.getBoundingClientRect();k.position={top:c.top+window.scrollY,left:c.left+window.scrollX}},W=a=>a.data.length?e.jsx("div",{style:{display:"flex",alignItems:"center",padding:"10px"},children:e.jsx(ke,{className:"resend-btn",size:"small",color:"primary",variant:"contained",startIcon:e.jsx(ze,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:Z,children:o("notification.resend")})}):null,ae={sort:!1,download:!1,print:!1,selectableRows:"multiple",searchPlaceholder:o("common.search"),searchAlwaysOpen:!1,filterType:"checkbox",searchDebounceTime:300,page:Q.page-1,rowsPerPage:Q.pageSize,count:Q.total,searchText:p.searchText,tableBodyMaxHeight:"calc(80vh - 260px)",rowsSelected:A,onRowSelectionChange:(a,i)=>{w(i.map(c=>c.dataIndex))},customToolbarSelect:W},se=({page:a,rowsPerPage:i,searchText:c,filterList:y})=>{const[,F=[],K=[],q=[]]=y;p.pageSize!==i?S(M=>({...M,pageSize:i,page:1})):p.page!==a+1?S(M=>({...M,page:a+1})):p.searchText!==c?S(M=>({...M,searchText:c,page:1})):fe(F,p.walletSendStatus)?fe(K,p.pushKitSendStatus)?fe(q,p.emailSendStatus)||S(M=>({...M,emailSendStatus:q,page:1})):S(M=>({...M,pushKitSendStatus:K,page:1})):S(M=>({...M,walletSendStatus:F,page:1}))},le=x.useCallback(async(a,i)=>{if(!i)return!1;const c=await C(i);return c?a==="wallet"?ls(c):a==="email"?os(N,c):a==="pushKit"?rs(N,c):a==="webhook"?cs(c):!0:!1},[C,N]),je=x.useCallback(a=>ds(o,a),[o]),ce=()=>{P.anchorEl=null,P.position=null,$(null)},de=()=>{k.anchorEl=null,k.position=null},ue=async(a,i,c=!0,y="")=>{if(!(!i.length||!a.length))try{s(a,i,c,y),k.anchorEl||(await ye(.5),ce())}catch(F){console.error("handleResend error",{error:F})}},h=async({channels:a,isResendFailedOnly:i})=>{const c=A.map(y=>E[y].receiver);await ue(a,c,i),await ye(.5),de(),w([])},m=async(a,i=[],c=!0)=>{try{await ue(["webhook"],[a.receiver],c,i)}catch(y){V.error(y.response?y.response.statusText:y.message)}},g=async(a,i,c,y=[],F=!0)=>{if(a.stopPropagation(),us(i,c)>=4){V.warning(o("notification.resendLimit"));return}if(!Fe.includes(c)){await m(i,y,F);return}if(a){const q=a.currentTarget,M=q.getBoundingClientRect();P.anchorEl=q,P.position={top:M.top+window.scrollY,left:M.left+window.scrollX}}$({channel:c});try{const q=await le(c,i.receiver);await ye(1),$({channel:c,result:q}),(typeof q=="boolean"&&q||Rt(q)&&Object.values(q).every(M=>!!M))&&(await s([c],[i.receiver],F),k.anchorEl||(await ye(.5),ce()))}catch(q){V.error(q.message)}},j=a=>{S(i=>({...i,dateRange:a,page:1}))},T=(a,i,c,y)=>{a.stopPropagation();const F=c.filter(K=>K!==i);S(K=>({...K,[y]:F,page:1}))},R=X(()=>[{label:o("notification.receiver"),name:"receiver",width:200,options:{filter:!1,customBodyRenderLite:a=>{const{receiverUser:i,receiver:c}=E[a];return i?e.jsxs(v,{"data-cy":`member-name-${i.fullName}`,display:"flex",alignItems:"center",gap:1,justifyContent:"flex-start",children:[e.jsx(at,{src:`${i.avatar}?imageFilter=resize&w=48&h=48`,size:32,did:c,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),e.jsx(xe,{children:i.fullName})]},c):e.jsx(Tt,{size:14,responsive:!1,compact:!0,copyable:!1,did:c})}}},{label:"Wallet",name:"walletSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),filter:!0,filterType:"custom",filterList:p.walletSendStatus??[],customFilterListOptions:{render:a=>e.jsx(me,{list:a,label:"Wallet",onDelete:(i,c)=>{i.stopPropagation(),T(i,c,R[1].options.filterList,"walletSendStatus")}}),update:Ce},filterOptions:{names:O,fullWidth:!0,logic:Ne,display:(a,i,c,y)=>e.jsx(Ie,{label:"Wallet",filterList:a,onChange:i,index:c,column:y,filterValues:O})},customBodyRenderLite:a=>{const{walletSendStatus:i,walletSendAt:c,walletSendFailedReason:y}=E[a];return e.jsx(pe,{status:i,updatedAt:c,reason:y,channel:"wallet",onResend:F=>g(F,E[a],"wallet",[],!1)})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:a=>{const{pushKitSendStatus:i,pushKitSendAt:c,pushKitSendFailedReason:y}=E[a];return e.jsx(pe,{status:i,updatedAt:c,reason:y,channel:"pushkit",onResend:F=>g(F,E[a],"pushKit",[],!1)})},filter:!0,filterType:"custom",filterList:p.pushKitSendStatus??[],customFilterListOptions:{render:a=>e.jsx(me,{list:a,label:"Push Kit",onDelete:(i,c)=>{i.stopPropagation(),T(i,c,R[2].options.filterList,"pushKitSendStatus")}}),update:Ce},filterOptions:{names:O,fullWidth:!0,logic:Ne,display:(a,i,c,y)=>e.jsx(Ie,{label:"Push Kit",filterList:a,onChange:i,index:c,column:y,filterValues:O})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:a=>{const{emailSendStatus:i,emailSendAt:c,emailSendFailedReason:y}=E[a];return e.jsx(pe,{status:i,updatedAt:c,reason:y,channel:"email",onResend:F=>g(F,E[a],"email",[],!1)})},filter:!0,filterType:"custom",filterList:p.emailSendStatus??[],customFilterListOptions:{render:a=>e.jsx(me,{list:a,label:"Email",onDelete:(i,c)=>{i.stopPropagation(),T(i,c,R[3].options.filterList,"emailSendStatus")}}),update:Ce},filterOptions:{names:O,fullWidth:!0,logic:Ne,display:(a,i,c,y)=>e.jsx(Ie,{label:"Email",filterList:a,onChange:i,index:c,column:y,filterValues:O})}}},{label:"Webhook",name:"webhook",width:200,options:{filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:a=>{const{webhook:i}=E[a];if(!i)return null;const c=Object.entries(i)[0];if(!c)return null;const[y,F]=c,K=F[0];return e.jsx(v,{display:"flex",flexDirection:"column",gap:1,children:e.jsxs(v,{className:"webhook-item",fontSize:12,children:[e.jsx(xe,{maxLength:30,children:y},y),e.jsx(pe,{status:K.status,updatedAt:K.sendAt,reason:K.failedReason,channel:"webhook",onResend:q=>g(q,E[a],"webhook",[y],!1)})]},y)})}}},{label:o("common.createdAt"),name:"createdAt",width:100,options:{filter:!1,customBodyRenderLite:a=>{const{createdAt:i}=E[a];return e.jsx(it,{value:i,locale:r,shouldUpdate:!0})}}}],[E,r,p,o]),H=[e.jsx(Ue,{value:p.dateRange,onChange:j},"date-picker"),e.jsx(ke,{variant:"contained",size:"small",color:"primary",loading:B,startIcon:e.jsx(Ht,{}),onClick:()=>_(),sx:{".MuiButton-startIcon":{mr:"2px"}},style:{marginLeft:8},children:o("common.refresh")},"refresh")];return e.jsx(v,{sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:e.jsx(hs,{children:e.jsxs(ot,{theme:b,children:[e.jsx(dt,{className:"receivers-table",locale:r,loading:B,columns:R,data:E,onChange:se,options:ae,customButtons:H,components:{TableFilterList:a=>e.jsx($e,{...a,itemComponent:i=>e.jsx(Te,{...i,canDelete:()=>!1})})}}),P.anchorEl&&e.jsx(Oe,{open:!!P.anchorEl,anchorReference:"anchorPosition",anchorPosition:P.position,onClose:ce,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs(gs,{children:[e.jsxs(G,{variant:"body1",component:"div",className:"check-title",children:[I==null?void 0:I.channel," Checking"]}),e.jsx(v,{display:"flex",flexDirection:"column",sx:{gap:"4px"},children:je(I==null?void 0:I.channel).map(a=>{var F,K;const{type:i,pass:c,fail:y}=a;return!(I!=null&&I.result)||(F=I==null?void 0:I.result)!=null&&F[i]?e.jsxs(G,{variant:"body1",component:"div",className:"check-item",display:"flex",alignItems:"center",sx:{gap:"4px",color:(K=I==null?void 0:I.result)!=null&&K[i]?Se.success.main:"inherit"},children:[I!=null&&I.result?e.jsx(ft,{}):e.jsx(tt,{size:12,sx:{color:Se.primary.main}}),e.jsx("span",{children:c})]},i):e.jsxs(G,{variant:"body1",component:"div",display:"flex",alignItems:"center",className:"check-item",sx:{gap:"4px",color:Se.error.main},children:[e.jsx(mt,{}),e.jsx("span",{children:y})]},i)})})]})}),k.anchorEl&&e.jsx(Oe,{open:!!k.anchorEl,anchorReference:"anchorPosition",anchorPosition:k.position,onClose:de,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsx(He,{loading:n,onCancel:de,onConfirm:h})})]})})})}const ms=x.memo(jt),hs=re.div`
|
|
2
2
|
td.MuiTableCell-footer {
|
|
3
3
|
border: none !important;
|
|
4
4
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{dq as E,j as n,N as a,aQ as _,aR as w,am as f,du as z,m as C}from"./index-
|
|
1
|
+
import{dq as E,j as n,N as a,aQ as _,aR as w,am as f,du as z,m as C}from"./index-DMUuXkl-.js";function o({icon:t,title:e="",description:i="",extra:v,...R}){return n.jsxs(I,{...R,children:[t,typeof e=="string"?n.jsx(a,{mt:3,fontSize:22,fontWeight:400,color:"#47494E",textAlign:"center",children:e}):e,typeof i=="string"?n.jsx(a,{mt:1,fontSize:14,color:"#7F828B",textAlign:"center",children:i}):i,n.jsx(a,{mt:3,children:v})]})}const I=E("div")`
|
|
2
2
|
box-sizing: border-box;
|
|
3
3
|
display: flex;
|
|
4
4
|
flex-direction: column;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{z as g,bq as v,u as y,j as r,Q as f,U as x,V as h}from"./index-
|
|
1
|
+
import{z as g,bq as v,u as y,j as r,Q as f,U as x,V as h}from"./index-DMUuXkl-.js";import{L as j,D as b}from"./download-DhL2-FKU.js";import{_ as L}from"./useLocalStorage-rbap7GBn.js";import"./ButtonGroup-Cv9T_ybJ.js";import"./getValidReactChildren-Ds2y77el.js";function I(){const c=g(),[s,i]=L("server-logs-filter",{name:"abtnode",type:{abtnode:"error"}}),{name:t=s.name}=v(),{info:l}=y(),n=l.routing.provider,a=[{id:"abtnode",name:"Blocklet Server",types:["error","info","access","stdout","stderr","pm2"]},{id:"blocklet-services",name:"Blocklet Services",types:["error","info","access","stdout","stderr"]}];if(n){const e=`Service Gateway(${n})`;a.push({id:`service-gateway-${n}`,name:e,types:["error","access","security"]})}const d=e=>{i({...s,name:e.target.value}),c(`/logs/${e.target.value}`)},m=r.jsx(f,{sx:{minWidth:240},children:r.jsx(x,{value:t,onChange:d,size:"small",children:a.map(e=>r.jsx(h,{value:e.id,children:e.name},e.id))})}),o=a.find(e=>e.id===t)||a[0],p=o.types.indexOf(s.type[t]||"error"),u=e=>{i({name:t,type:{...s.type,[t]:e}})};return r.jsx(j,{name:o.name,logId:o.id,types:o.types,prepend:m,postpend:r.jsx(b,{id:l.did,name:"blocklet-server"}),defaultTypeIndex:p,onTypeChange:u},o.id)}export{I as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as f,j as s,C as d,z as x,aB as v,cu as C,cv as u,N as j,bA as I,ag as P,F as S}from"./index-
|
|
1
|
+
import{u as f,j as s,C as d,z as x,aB as v,cu as C,cv as u,N as j,bA as I,ag as P,F as S}from"./index-DMUuXkl-.js";import{I as N}from"./invitation-OOnB1MnQ.js";import{g as R}from"./get-safe-url-CIlQ_jPL.js";import"./index-B3guyKGC.js";import"./index-CMclvolP.js";import"./emotion-react.browser.esm-CH16KKaA.js";import"./index-CJ2iy25m.js";import"./sdk-B0fHGxCR.js";import"./wrap-locale-Cm4YHFCT.js";function T(n){const{searchParams:i}=new URL(window.location.href),g=x(),{api:a,session:r}=v(),{info:l}=f(),c=i.get("redirect"),p=i.get("id"),e=C(async()=>{if(!p)return null;const{data:t}=await a.get("/api/invitation",{params:{inviteId:p,mode:"issue-passport"}});return t}),m=u(()=>{if(e.error)throw e.error;return e==null?void 0:e.data}),h=u(async(t,w=o=>o)=>{t&&(t.sessionToken&&P(w(t.sessionToken)),await r.refresh()),setTimeout(()=>{if(c){const o=decodeURIComponent(c);o.startsWith(S.WELLKNOWN_SERVICE_PATH_PREFIX)?g(o,{replace:!0}):window.location.href=R(o)}else window.location.href=window.env.pathPrefix||"/"},50)});return e.loading?s.jsx(d,{}):s.jsx(j,{className:"page-invite",sx:{width:"100vw",height:"100%",minHeight:"100vh",display:"flex",justifyContent:"center",alignItems:"center",backgroundColor:"#f6f8fa",overflow:"auto",padding:"20px"},children:s.jsx(N,{...n,action:"issue-passport",getDataFn:m,createPassportSvg:t=>I(t,l),checkFn:a.get,onLoginSuccess:h,passportColor:"default",onLogin:r.login})})}function z(){return f().loading?s.jsx(d,{}):s.jsx(T,{})}export{z as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{bm as j,d8 as O}from"./index-
|
|
1
|
+
import{bm as j,d8 as O}from"./index-DMUuXkl-.js";function m(i,t){for(var r=0;r<t.length;r++){const a=t[r];if(typeof a!="string"&&!Array.isArray(a)){for(const e in a)if(e!=="default"&&!(e in i)){const s=Object.getOwnPropertyDescriptor(a,e);s&&Object.defineProperty(i,e,s.get?s:{enumerable:!0,get:()=>a[e]})}}}return Object.freeze(Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}))}var d={default:O,call:function(i,t,r){var a="";typeof t=="function"&&(r=t,t={});var e={data:t===void 0?null:t};if(typeof r=="function"){var s="dscb"+window.dscb++;window[s]=r,e._dscbstub=s}return e=JSON.stringify(e),window._dsbridge?a=_dsbridge.call(i,e):(window._dswk||navigator.userAgent.indexOf("_dsbridge")!=-1)&&(a=prompt("_dsbridge="+i,e)),JSON.parse(a||"{}").data},register:function(i,t,r){var a=r?window._dsaf:window._dsf;window._dsInit||(window._dsInit=!0,setTimeout(function(){d.call("_dsb.dsinit")},0)),typeof t=="object"?a._obs[i]=t:a[i]=t},registerAsyn:function(i,t){this.register(i,t,!0)},hasNativeMethod:function(i,t){return this.call("_dsb.hasNativeMethod",{name:i,type:t||"all"})},disableJavascriptDialogBlock:function(i){this.call("_dsb.disableJavascriptDialogBlock",{disable:i!==!1})}};(function(){if(!window._dsf){var i={_dsf:{_obs:{}},_dsaf:{_obs:{}},dscb:0,dsBridge:d,close:function(){d.call("_dsb.closePage")},_handleMessageFromNative:function(r){var a=JSON.parse(r.data),e={id:r.callbackId,complete:!0},s=this._dsf[r.method],o=this._dsaf[r.method],p=function(u,_){e.data=u.apply(_,a),d.call("_dsb.returnValue",e)},v=function(u,_){a.push(function(w,y){e.data=w,e.complete=y!==!1,d.call("_dsb.returnValue",e)}),u.apply(_,a)};if(s)p(s,this._dsf);else if(o)v(o,this._dsaf);else{var l=r.method.split(".");if(l.length<2)return;var b=l.pop(),g=l.join("."),c=this._dsf._obs,f=c[g]||{},n=f[b];if(n&&typeof n=="function"){p(n,f);return}if(c=this._dsaf._obs,f=c[g]||{},n=f[b],n&&typeof n=="function"){v(n,f);return}}}};for(var t in i)window[t]=i[t];d.register("_hasJavascriptMethod",function(r,a){var e=r.split(".");if(e.length<2)return!!(_dsf[e]||_dsaf[e]);var r=e.pop(),s=e.join("."),o=_dsf._obs[s]||_dsaf._obs[s];return o&&!!o[r]})}})();var h=d;const J=j(h),S=m({__proto__:null,default:J},[h]);export{S as i};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c0 as ft,c1 as ht,b9 as A,bY as $t,cf as jt,bZ as f,r as d,c2 as vt,b$ as nt,c4 as N,j as b,c5 as mt,dh as oe,di as Ft,dj as Ht,dk as At,dl as le,dm as re,c3 as rt,am as ne,dn as bt,dp as se,dq as ae}from"./index-C6Izz9No.js";let Y;function Ot(){if(Y)return Y;const t=document.createElement("div"),e=document.createElement("div");return e.style.width="10px",e.style.height="1px",t.appendChild(e),t.dir="rtl",t.style.fontSize="14px",t.style.width="4px",t.style.height="1px",t.style.position="absolute",t.style.top="-1000px",t.style.overflow="scroll",document.body.appendChild(t),Y="reverse",t.scrollLeft>0?Y="default":(t.scrollLeft=1,t.scrollLeft===0&&(Y="negative")),document.body.removeChild(t),Y}function ie(t,e){const l=t.scrollLeft;if(e!=="rtl")return l;switch(Ot()){case"negative":return t.scrollWidth-t.clientWidth+l;case"reverse":return t.scrollWidth-t.clientWidth-l;default:return l}}function ce(t){return ht("MuiTab",t)}const k=ft("MuiTab",["root","labelIcon","textColorInherit","textColorPrimary","textColorSecondary","selected","disabled","fullWidth","wrapped","iconWrapper"]),de=["className","disabled","disableFocusRipple","fullWidth","icon","iconPosition","indicator","label","onChange","onClick","onFocus","selected","selectionFollowsFocus","textColor","value","wrapped"],ue=t=>{const{classes:e,textColor:l,fullWidth:a,wrapped:s,icon:n,label:u,selected:v,disabled:p}=t,x={root:["root",n&&u&&"labelIcon",`textColor${jt(l)}`,a&&"fullWidth",s&&"wrapped",v&&"selected",p&&"disabled"],iconWrapper:["iconWrapper"]};return mt(x,ce,e)},be=A($t,{name:"MuiTab",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:l}=t;return[e.root,l.label&&l.icon&&e.labelIcon,e[`textColor${jt(l.textColor)}`],l.fullWidth&&e.fullWidth,l.wrapped&&e.wrapped,{[`& .${k.iconWrapper}`]:e.iconWrapper}]}})(({theme:t,ownerState:e})=>f({},t.typography.button,{maxWidth:360,minWidth:90,position:"relative",minHeight:48,flexShrink:0,padding:"12px 16px",overflow:"hidden",whiteSpace:"normal",textAlign:"center"},e.label&&{flexDirection:e.iconPosition==="top"||e.iconPosition==="bottom"?"column":"row"},{lineHeight:1.25},e.icon&&e.label&&{minHeight:72,paddingTop:9,paddingBottom:9,[`& > .${k.iconWrapper}`]:f({},e.iconPosition==="top"&&{marginBottom:6},e.iconPosition==="bottom"&&{marginTop:6},e.iconPosition==="start"&&{marginRight:t.spacing(1)},e.iconPosition==="end"&&{marginLeft:t.spacing(1)})},e.textColor==="inherit"&&{color:"inherit",opacity:.6,[`&.${k.selected}`]:{opacity:1},[`&.${k.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity}},e.textColor==="primary"&&{color:(t.vars||t).palette.text.secondary,[`&.${k.selected}`]:{color:(t.vars||t).palette.primary.main},[`&.${k.disabled}`]:{color:(t.vars||t).palette.text.disabled}},e.textColor==="secondary"&&{color:(t.vars||t).palette.text.secondary,[`&.${k.selected}`]:{color:(t.vars||t).palette.secondary.main},[`&.${k.disabled}`]:{color:(t.vars||t).palette.text.disabled}},e.fullWidth&&{flexShrink:1,flexGrow:1,flexBasis:0,maxWidth:"none"},e.wrapped&&{fontSize:t.typography.pxToRem(12)})),St=d.forwardRef(function(e,l){const a=vt({props:e,name:"MuiTab"}),{className:s,disabled:n=!1,disableFocusRipple:u=!1,fullWidth:v,icon:p,iconPosition:x="top",indicator:B,label:y,onChange:m,onClick:w,onFocus:L,selected:T,selectionFollowsFocus:g,textColor:O="inherit",value:E,wrapped:st=!1}=a,X=nt(a,de),V=f({},a,{disabled:n,disableFocusRipple:u,selected:T,icon:!!p,iconPosition:x,label:!!y,fullWidth:v,textColor:O,wrapped:st}),D=ue(V),$=p&&y&&d.isValidElement(p)?d.cloneElement(p,{className:N(D.iconWrapper,p.props.className)}):p,J=R=>{!T&&m&&m(R,E),w&&w(R)},_=R=>{g&&!T&&m&&m(R,E),L&&L(R)};return b.jsxs(be,f({focusRipple:!u,className:N(D.root,s),ref:l,role:"tab","aria-selected":T,disabled:n,onClick:J,onFocus:_,ownerState:V,tabIndex:T?0:-1},X,{children:[x==="top"||x==="start"?b.jsxs(d.Fragment,{children:[$,y]}):b.jsxs(d.Fragment,{children:[y,$]}),B]}))});function pe(t){return(1+Math.sin(Math.PI*t-Math.PI/2))/2}function fe(t,e,l,a={},s=()=>{}){const{ease:n=pe,duration:u=300}=a;let v=null;const p=e[t];let x=!1;const B=()=>{x=!0},y=m=>{if(x){s(new Error("Animation cancelled"));return}v===null&&(v=m);const w=Math.min(1,(m-v)/u);if(e[t]=n(w)*(l-p)+p,w>=1){requestAnimationFrame(()=>{s(null)});return}requestAnimationFrame(y)};return p===l?(s(new Error("Element already at target position")),B):(requestAnimationFrame(y),B)}const he=["onChange"],ve={width:99,height:99,position:"absolute",top:-9999,overflow:"scroll"};function me(t){const{onChange:e}=t,l=nt(t,he),a=d.useRef(),s=d.useRef(null),n=()=>{a.current=s.current.offsetHeight-s.current.clientHeight};return oe(()=>{const u=Ft(()=>{const p=a.current;n(),p!==a.current&&e(a.current)}),v=Ht(s.current);return v.addEventListener("resize",u),()=>{u.clear(),v.removeEventListener("resize",u)}},[e]),d.useEffect(()=>{n(),e(a.current)},[e]),b.jsx("div",f({style:ve},l,{ref:s}))}function Se(t){return ht("MuiTabScrollButton",t)}const xe=ft("MuiTabScrollButton",["root","vertical","horizontal","disabled"]),ge=["className","slots","slotProps","direction","orientation","disabled"],ye=t=>{const{classes:e,orientation:l,disabled:a}=t;return mt({root:["root",l,a&&"disabled"]},Se,e)},Ce=A($t,{name:"MuiTabScrollButton",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:l}=t;return[e.root,l.orientation&&e[l.orientation]]}})(({ownerState:t})=>f({width:40,flexShrink:0,opacity:.8,[`&.${xe.disabled}`]:{opacity:0}},t.orientation==="vertical"&&{width:"100%",height:40,"& svg":{transform:`rotate(${t.isRtl?-90:90}deg)`}})),Be=d.forwardRef(function(e,l){var a,s;const n=vt({props:e,name:"MuiTabScrollButton"}),{className:u,slots:v={},slotProps:p={},direction:x}=n,B=nt(n,ge),y=At(),m=f({isRtl:y},n),w=ye(m),L=(a=v.StartScrollButtonIcon)!=null?a:le,T=(s=v.EndScrollButtonIcon)!=null?s:re,g=rt({elementType:L,externalSlotProps:p.startScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:m}),O=rt({elementType:T,externalSlotProps:p.endScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:m});return b.jsx(Ce,f({component:"div",className:N(w.root,u),ref:l,role:null,ownerState:m,tabIndex:null},B,{children:x==="left"?b.jsx(L,f({},g)):b.jsx(T,f({},O))}))});function we(t){return ht("MuiTabs",t)}const pt=ft("MuiTabs",["root","vertical","flexContainer","flexContainerVertical","centered","scroller","fixed","scrollableX","scrollableY","hideScrollbar","scrollButtons","scrollButtonsHideMobile","indicator"]),Te=["aria-label","aria-labelledby","action","centered","children","className","component","allowScrollButtonsMobile","indicatorColor","onChange","orientation","ScrollButtonComponent","scrollButtons","selectionFollowsFocus","slots","slotProps","TabIndicatorProps","TabScrollButtonProps","textColor","value","variant","visibleScrollbar"],Pt=(t,e)=>t===e?t.firstChild:e&&e.nextElementSibling?e.nextElementSibling:t.firstChild,kt=(t,e)=>t===e?t.lastChild:e&&e.previousElementSibling?e.previousElementSibling:t.lastChild,lt=(t,e,l)=>{let a=!1,s=l(t,e);for(;s;){if(s===t.firstChild){if(a)return;a=!0}const n=s.disabled||s.getAttribute("aria-disabled")==="true";if(!s.hasAttribute("tabindex")||n)s=l(t,s);else{s.focus();return}}},Me=t=>{const{vertical:e,fixed:l,hideScrollbar:a,scrollableX:s,scrollableY:n,centered:u,scrollButtonsHideMobile:v,classes:p}=t;return mt({root:["root",e&&"vertical"],scroller:["scroller",l&&"fixed",a&&"hideScrollbar",s&&"scrollableX",n&&"scrollableY"],flexContainer:["flexContainer",e&&"flexContainerVertical",u&&"centered"],indicator:["indicator"],scrollButtons:["scrollButtons",v&&"scrollButtonsHideMobile"],scrollableX:[s&&"scrollableX"],hideScrollbar:[a&&"hideScrollbar"]},we,p)},Ie=A("div",{name:"MuiTabs",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:l}=t;return[{[`& .${pt.scrollButtons}`]:e.scrollButtons},{[`& .${pt.scrollButtons}`]:l.scrollButtonsHideMobile&&e.scrollButtonsHideMobile},e.root,l.vertical&&e.vertical]}})(({ownerState:t,theme:e})=>f({overflow:"hidden",minHeight:48,WebkitOverflowScrolling:"touch",display:"flex"},t.vertical&&{flexDirection:"column"},t.scrollButtonsHideMobile&&{[`& .${pt.scrollButtons}`]:{[e.breakpoints.down("sm")]:{display:"none"}}})),Ee=A("div",{name:"MuiTabs",slot:"Scroller",overridesResolver:(t,e)=>{const{ownerState:l}=t;return[e.scroller,l.fixed&&e.fixed,l.hideScrollbar&&e.hideScrollbar,l.scrollableX&&e.scrollableX,l.scrollableY&&e.scrollableY]}})(({ownerState:t})=>f({position:"relative",display:"inline-block",flex:"1 1 auto",whiteSpace:"nowrap"},t.fixed&&{overflowX:"hidden",width:"100%"},t.hideScrollbar&&{scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}},t.scrollableX&&{overflowX:"auto",overflowY:"hidden"},t.scrollableY&&{overflowY:"auto",overflowX:"hidden"})),Re=A("div",{name:"MuiTabs",slot:"FlexContainer",overridesResolver:(t,e)=>{const{ownerState:l}=t;return[e.flexContainer,l.vertical&&e.flexContainerVertical,l.centered&&e.centered]}})(({ownerState:t})=>f({display:"flex"},t.vertical&&{flexDirection:"column"},t.centered&&{justifyContent:"center"})),ze=A("span",{name:"MuiTabs",slot:"Indicator",overridesResolver:(t,e)=>e.indicator})(({ownerState:t,theme:e})=>f({position:"absolute",height:2,bottom:0,width:"100%",transition:e.transitions.create()},t.indicatorColor==="primary"&&{backgroundColor:(e.vars||e).palette.primary.main},t.indicatorColor==="secondary"&&{backgroundColor:(e.vars||e).palette.secondary.main},t.vertical&&{height:"100%",width:2,right:0})),We=A(me)({overflowX:"auto",overflowY:"hidden",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}),Nt={},xt=d.forwardRef(function(e,l){const a=vt({props:e,name:"MuiTabs"}),s=ne(),n=At(),{"aria-label":u,"aria-labelledby":v,action:p,centered:x=!1,children:B,className:y,component:m="div",allowScrollButtonsMobile:w=!1,indicatorColor:L="primary",onChange:T,orientation:g="horizontal",ScrollButtonComponent:O=Be,scrollButtons:E="auto",selectionFollowsFocus:st,slots:X={},slotProps:V={},TabIndicatorProps:D={},TabScrollButtonProps:$={},textColor:J="primary",value:_,variant:R="standard",visibleScrollbar:at=!1}=a,Xt=nt(a,Te),M=R==="scrollable",C=g==="vertical",K=C?"scrollTop":"scrollLeft",Q=C?"top":"left",tt=C?"bottom":"right",it=C?"clientHeight":"clientWidth",q=C?"height":"width",j=f({},a,{component:m,allowScrollButtonsMobile:w,indicatorColor:L,orientation:g,vertical:C,scrollButtons:E,textColor:J,variant:R,visibleScrollbar:at,fixed:!M,hideScrollbar:M&&!at,scrollableX:M&&!C,scrollableY:M&&C,centered:x&&!M,scrollButtonsHideMobile:!w}),W=Me(j),Dt=rt({elementType:X.StartScrollButtonIcon,externalSlotProps:V.startScrollButtonIcon,ownerState:j}),_t=rt({elementType:X.EndScrollButtonIcon,externalSlotProps:V.endScrollButtonIcon,ownerState:j}),[gt,Yt]=d.useState(!1),[F,yt]=d.useState(Nt),[Ct,Ut]=d.useState(!1),[Bt,Vt]=d.useState(!1),[wt,Kt]=d.useState(!1),[Tt,qt]=d.useState({overflow:"hidden",scrollbarWidth:0}),Mt=new Map,z=d.useRef(null),H=d.useRef(null),It=()=>{const o=z.current;let r;if(o){const i=o.getBoundingClientRect();r={clientWidth:o.clientWidth,scrollLeft:o.scrollLeft,scrollTop:o.scrollTop,scrollLeftNormalized:ie(o,n?"rtl":"ltr"),scrollWidth:o.scrollWidth,top:i.top,bottom:i.bottom,left:i.left,right:i.right}}let c;if(o&&_!==!1){const i=H.current.children;if(i.length>0){const h=i[Mt.get(_)];c=h?h.getBoundingClientRect():null}}return{tabsMeta:r,tabMeta:c}},G=bt(()=>{const{tabsMeta:o,tabMeta:r}=It();let c=0,i;if(C)i="top",r&&o&&(c=r.top-o.top+o.scrollTop);else if(i=n?"right":"left",r&&o){const S=n?o.scrollLeftNormalized+o.clientWidth-o.scrollWidth:o.scrollLeft;c=(n?-1:1)*(r[i]-o[i]+S)}const h={[i]:c,[q]:r?r[q]:0};if(isNaN(F[i])||isNaN(F[q]))yt(h);else{const S=Math.abs(F[i]-h[i]),I=Math.abs(F[q]-h[q]);(S>=1||I>=1)&&yt(h)}}),ct=(o,{animation:r=!0}={})=>{r?fe(K,z.current,o,{duration:s.transitions.duration.standard}):z.current[K]=o},Et=o=>{let r=z.current[K];C?r+=o:(r+=o*(n?-1:1),r*=n&&Ot()==="reverse"?-1:1),ct(r)},Rt=()=>{const o=z.current[it];let r=0;const c=Array.from(H.current.children);for(let i=0;i<c.length;i+=1){const h=c[i];if(r+h[it]>o){i===0&&(r=o);break}r+=h[it]}return r},Gt=()=>{Et(-1*Rt())},Zt=()=>{Et(Rt())},Jt=d.useCallback(o=>{qt({overflow:null,scrollbarWidth:o})},[]),Qt=()=>{const o={};o.scrollbarSizeListener=M?b.jsx(We,{onChange:Jt,className:N(W.scrollableX,W.hideScrollbar)}):null;const c=M&&(E==="auto"&&(Ct||Bt)||E===!0);return o.scrollButtonStart=c?b.jsx(O,f({slots:{StartScrollButtonIcon:X.StartScrollButtonIcon},slotProps:{startScrollButtonIcon:Dt},orientation:g,direction:n?"right":"left",onClick:Gt,disabled:!Ct},$,{className:N(W.scrollButtons,$.className)})):null,o.scrollButtonEnd=c?b.jsx(O,f({slots:{EndScrollButtonIcon:X.EndScrollButtonIcon},slotProps:{endScrollButtonIcon:_t},orientation:g,direction:n?"left":"right",onClick:Zt,disabled:!Bt},$,{className:N(W.scrollButtons,$.className)})):null,o},zt=bt(o=>{const{tabsMeta:r,tabMeta:c}=It();if(!(!c||!r)){if(c[Q]<r[Q]){const i=r[K]+(c[Q]-r[Q]);ct(i,{animation:o})}else if(c[tt]>r[tt]){const i=r[K]+(c[tt]-r[tt]);ct(i,{animation:o})}}}),et=bt(()=>{M&&E!==!1&&Kt(!wt)});d.useEffect(()=>{const o=Ft(()=>{z.current&&G()});let r;const c=S=>{S.forEach(I=>{I.removedNodes.forEach(Z=>{var P;(P=r)==null||P.unobserve(Z)}),I.addedNodes.forEach(Z=>{var P;(P=r)==null||P.observe(Z)})}),o(),et()},i=Ht(z.current);i.addEventListener("resize",o);let h;return typeof ResizeObserver<"u"&&(r=new ResizeObserver(o),Array.from(H.current.children).forEach(S=>{r.observe(S)})),typeof MutationObserver<"u"&&(h=new MutationObserver(c),h.observe(H.current,{childList:!0})),()=>{var S,I;o.clear(),i.removeEventListener("resize",o),(S=h)==null||S.disconnect(),(I=r)==null||I.disconnect()}},[G,et]),d.useEffect(()=>{const o=Array.from(H.current.children),r=o.length;if(typeof IntersectionObserver<"u"&&r>0&&M&&E!==!1){const c=o[0],i=o[r-1],h={root:z.current,threshold:.99},S=ut=>{Ut(!ut[0].isIntersecting)},I=new IntersectionObserver(S,h);I.observe(c);const Z=ut=>{Vt(!ut[0].isIntersecting)},P=new IntersectionObserver(Z,h);return P.observe(i),()=>{I.disconnect(),P.disconnect()}}},[M,E,wt,B==null?void 0:B.length]),d.useEffect(()=>{Yt(!0)},[]),d.useEffect(()=>{G()}),d.useEffect(()=>{zt(Nt!==F)},[zt,F]),d.useImperativeHandle(p,()=>({updateIndicator:G,updateScrollButtons:et}),[G,et]);const Wt=b.jsx(ze,f({},D,{className:N(W.indicator,D.className),ownerState:j,style:f({},F,D.style)}));let ot=0;const te=d.Children.map(B,o=>{if(!d.isValidElement(o))return null;const r=o.props.value===void 0?ot:o.props.value;Mt.set(r,ot);const c=r===_;return ot+=1,d.cloneElement(o,f({fullWidth:R==="fullWidth",indicator:c&&!gt&&Wt,selected:c,selectionFollowsFocus:st,onChange:T,textColor:J,value:r},ot===1&&_===!1&&!o.props.tabIndex?{tabIndex:0}:{}))}),ee=o=>{const r=H.current,c=se(r).activeElement;if(c.getAttribute("role")!=="tab")return;let h=g==="horizontal"?"ArrowLeft":"ArrowUp",S=g==="horizontal"?"ArrowRight":"ArrowDown";switch(g==="horizontal"&&n&&(h="ArrowRight",S="ArrowLeft"),o.key){case h:o.preventDefault(),lt(r,c,kt);break;case S:o.preventDefault(),lt(r,c,Pt);break;case"Home":o.preventDefault(),lt(r,null,Pt);break;case"End":o.preventDefault(),lt(r,null,kt);break}},dt=Qt();return b.jsxs(Ie,f({className:N(W.root,y),ownerState:j,ref:l,as:m},Xt,{children:[dt.scrollButtonStart,dt.scrollbarSizeListener,b.jsxs(Ee,{className:W.scroller,ownerState:j,style:{overflow:Tt.overflow,[C?`margin${n?"Left":"Right"}`:"marginBottom"]:at?void 0:-Tt.scrollbarWidth},ref:z,children:[b.jsx(Re,{"aria-label":u,"aria-labelledby":v,"aria-orientation":g==="vertical"?"vertical":null,className:W.flexContainer,ownerState:j,onKeyDown:ee,ref:H,role:"tablist",children:te}),gt&&Wt]}),dt.scrollButtonEnd]}))}),Lt="index",U={tabs:`${Lt}-tabs`,tab:`${Lt}-tab`},Pe=ae(xt)(({theme:t})=>({[`& .${U.tabs}`]:{},[`& .${U.tab}`]:{fontSize:"0.875rem",[t.breakpoints.up("md")]:{fontSize:"1rem"}}}));function ke({tabs:t,current:e,onChange:l,iconPosition:a,...s}){return b.jsx(xt,{scrollButtons:"auto",value:e,onChange:(n,u)=>l(u),...s,variant:"scrollable",sx:{minHeight:"auto",".MuiTabs-scrollButtons.Mui-disabled":{opacity:.3,cursor:"not-allowed",pointerEvents:"auto"},".MuiTabs-scroller":{borderRadius:"100vw"},".MuiTabs-flexContainer":{borderRadius:"100vw",backgroundColor:"grey.100",padding:.5,display:"inline-flex",columnGap:.25,maxWidth:"100%",overflowX:"auto"},".MuiTab-root":{borderRadius:"100vw",border:"1px solid transparent",minHeight:"auto",lineHeight:1,py:1,color:"text.secondary",fontSize:"13px",fontWeight:"normal",textTransform:"capitalize",transition:"background-color 0.2s ease","&.Mui-selected, &:hover":{backgroundColor:"action.selected",borderColor:"grey.100",color:"grey.A700"}},".MuiTabs-indicator":{display:"none"},...s.sx},children:t.map(n=>b.jsx(St,{className:U.tab,value:n.value,label:n.label,icon:n.icon,iconPosition:a},n.value))})}function Ne({tabs:t,current:e,onChange:l,iconPosition:a,...s}){return b.jsx(xt,{scrollButtons:"auto",value:e,onChange:(n,u)=>l(u),...s,variant:"scrollable",sx:{minHeight:"auto",".MuiTabs-scrollButtons.Mui-disabled":{opacity:.3,cursor:"not-allowed",pointerEvents:"auto"},".MuiTabs-scroller":s.orientation!=="vertical"?{"&::after":{content:'""',display:"block",position:"sticky",left:0,zIndex:-1,width:"100%",height:"1px",backgroundColor:"grey.300"}}:{},".MuiTabs-flexContainer":{display:"inline-flex",columnGap:2.5,px:0,pb:.5},".MuiTab-root":{border:"1px solid transparent",minHeight:"auto",lineHeight:1,py:1,px:0,color:"text.secondary",fontSize:"14px",fontWeight:500,textTransform:"capitalize",minWidth:"auto","&.Mui-selected, &:hover":{color:"primary.main"}},".MuiTabs-indicator":{height:"1px",backgroundColor:"primary.main"},...s.sx},children:t.map(n=>b.jsx(St,{className:U.tab,value:n.value,label:n.label,icon:n.icon,iconPosition:a},n.value))})}function $e({tabs:t,current:e,onChange:l,variant:a,iconPosition:s,...n}){return a==="card"?b.jsx(ke,{...n,tabs:t,current:e,onChange:l,iconPosition:s}):a==="line"?b.jsx(Ne,{...n,tabs:t,current:e,onChange:l,iconPosition:s}):b.jsx(Pe,{scrollButtons:"auto",variant:"scrollable",value:e,onChange:(u,v)=>l(v),indicatorColor:"primary",...n,className:[U.tabs,n.className||""].join(" "),children:t.map(u=>b.jsx(St,{className:U.tab,value:u.value,label:u.label,icon:u.icon,iconPosition:s},u.value))})}export{$e as T,xt as a,St as b,Ot as d,ie as g,pt as t};
|
|
1
|
+
import{c0 as ft,c1 as ht,b9 as A,bY as $t,cf as jt,bZ as f,r as d,c2 as vt,b$ as nt,c4 as N,j as b,c5 as mt,dh as oe,di as Ft,dj as Ht,dk as At,dl as le,dm as re,c3 as rt,am as ne,dn as bt,dp as se,dq as ae}from"./index-DMUuXkl-.js";let Y;function Ot(){if(Y)return Y;const t=document.createElement("div"),e=document.createElement("div");return e.style.width="10px",e.style.height="1px",t.appendChild(e),t.dir="rtl",t.style.fontSize="14px",t.style.width="4px",t.style.height="1px",t.style.position="absolute",t.style.top="-1000px",t.style.overflow="scroll",document.body.appendChild(t),Y="reverse",t.scrollLeft>0?Y="default":(t.scrollLeft=1,t.scrollLeft===0&&(Y="negative")),document.body.removeChild(t),Y}function ie(t,e){const l=t.scrollLeft;if(e!=="rtl")return l;switch(Ot()){case"negative":return t.scrollWidth-t.clientWidth+l;case"reverse":return t.scrollWidth-t.clientWidth-l;default:return l}}function ce(t){return ht("MuiTab",t)}const k=ft("MuiTab",["root","labelIcon","textColorInherit","textColorPrimary","textColorSecondary","selected","disabled","fullWidth","wrapped","iconWrapper"]),de=["className","disabled","disableFocusRipple","fullWidth","icon","iconPosition","indicator","label","onChange","onClick","onFocus","selected","selectionFollowsFocus","textColor","value","wrapped"],ue=t=>{const{classes:e,textColor:l,fullWidth:a,wrapped:s,icon:n,label:u,selected:v,disabled:p}=t,x={root:["root",n&&u&&"labelIcon",`textColor${jt(l)}`,a&&"fullWidth",s&&"wrapped",v&&"selected",p&&"disabled"],iconWrapper:["iconWrapper"]};return mt(x,ce,e)},be=A($t,{name:"MuiTab",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:l}=t;return[e.root,l.label&&l.icon&&e.labelIcon,e[`textColor${jt(l.textColor)}`],l.fullWidth&&e.fullWidth,l.wrapped&&e.wrapped,{[`& .${k.iconWrapper}`]:e.iconWrapper}]}})(({theme:t,ownerState:e})=>f({},t.typography.button,{maxWidth:360,minWidth:90,position:"relative",minHeight:48,flexShrink:0,padding:"12px 16px",overflow:"hidden",whiteSpace:"normal",textAlign:"center"},e.label&&{flexDirection:e.iconPosition==="top"||e.iconPosition==="bottom"?"column":"row"},{lineHeight:1.25},e.icon&&e.label&&{minHeight:72,paddingTop:9,paddingBottom:9,[`& > .${k.iconWrapper}`]:f({},e.iconPosition==="top"&&{marginBottom:6},e.iconPosition==="bottom"&&{marginTop:6},e.iconPosition==="start"&&{marginRight:t.spacing(1)},e.iconPosition==="end"&&{marginLeft:t.spacing(1)})},e.textColor==="inherit"&&{color:"inherit",opacity:.6,[`&.${k.selected}`]:{opacity:1},[`&.${k.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity}},e.textColor==="primary"&&{color:(t.vars||t).palette.text.secondary,[`&.${k.selected}`]:{color:(t.vars||t).palette.primary.main},[`&.${k.disabled}`]:{color:(t.vars||t).palette.text.disabled}},e.textColor==="secondary"&&{color:(t.vars||t).palette.text.secondary,[`&.${k.selected}`]:{color:(t.vars||t).palette.secondary.main},[`&.${k.disabled}`]:{color:(t.vars||t).palette.text.disabled}},e.fullWidth&&{flexShrink:1,flexGrow:1,flexBasis:0,maxWidth:"none"},e.wrapped&&{fontSize:t.typography.pxToRem(12)})),St=d.forwardRef(function(e,l){const a=vt({props:e,name:"MuiTab"}),{className:s,disabled:n=!1,disableFocusRipple:u=!1,fullWidth:v,icon:p,iconPosition:x="top",indicator:B,label:y,onChange:m,onClick:w,onFocus:L,selected:T,selectionFollowsFocus:g,textColor:O="inherit",value:E,wrapped:st=!1}=a,X=nt(a,de),V=f({},a,{disabled:n,disableFocusRipple:u,selected:T,icon:!!p,iconPosition:x,label:!!y,fullWidth:v,textColor:O,wrapped:st}),D=ue(V),$=p&&y&&d.isValidElement(p)?d.cloneElement(p,{className:N(D.iconWrapper,p.props.className)}):p,J=R=>{!T&&m&&m(R,E),w&&w(R)},_=R=>{g&&!T&&m&&m(R,E),L&&L(R)};return b.jsxs(be,f({focusRipple:!u,className:N(D.root,s),ref:l,role:"tab","aria-selected":T,disabled:n,onClick:J,onFocus:_,ownerState:V,tabIndex:T?0:-1},X,{children:[x==="top"||x==="start"?b.jsxs(d.Fragment,{children:[$,y]}):b.jsxs(d.Fragment,{children:[y,$]}),B]}))});function pe(t){return(1+Math.sin(Math.PI*t-Math.PI/2))/2}function fe(t,e,l,a={},s=()=>{}){const{ease:n=pe,duration:u=300}=a;let v=null;const p=e[t];let x=!1;const B=()=>{x=!0},y=m=>{if(x){s(new Error("Animation cancelled"));return}v===null&&(v=m);const w=Math.min(1,(m-v)/u);if(e[t]=n(w)*(l-p)+p,w>=1){requestAnimationFrame(()=>{s(null)});return}requestAnimationFrame(y)};return p===l?(s(new Error("Element already at target position")),B):(requestAnimationFrame(y),B)}const he=["onChange"],ve={width:99,height:99,position:"absolute",top:-9999,overflow:"scroll"};function me(t){const{onChange:e}=t,l=nt(t,he),a=d.useRef(),s=d.useRef(null),n=()=>{a.current=s.current.offsetHeight-s.current.clientHeight};return oe(()=>{const u=Ft(()=>{const p=a.current;n(),p!==a.current&&e(a.current)}),v=Ht(s.current);return v.addEventListener("resize",u),()=>{u.clear(),v.removeEventListener("resize",u)}},[e]),d.useEffect(()=>{n(),e(a.current)},[e]),b.jsx("div",f({style:ve},l,{ref:s}))}function Se(t){return ht("MuiTabScrollButton",t)}const xe=ft("MuiTabScrollButton",["root","vertical","horizontal","disabled"]),ge=["className","slots","slotProps","direction","orientation","disabled"],ye=t=>{const{classes:e,orientation:l,disabled:a}=t;return mt({root:["root",l,a&&"disabled"]},Se,e)},Ce=A($t,{name:"MuiTabScrollButton",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:l}=t;return[e.root,l.orientation&&e[l.orientation]]}})(({ownerState:t})=>f({width:40,flexShrink:0,opacity:.8,[`&.${xe.disabled}`]:{opacity:0}},t.orientation==="vertical"&&{width:"100%",height:40,"& svg":{transform:`rotate(${t.isRtl?-90:90}deg)`}})),Be=d.forwardRef(function(e,l){var a,s;const n=vt({props:e,name:"MuiTabScrollButton"}),{className:u,slots:v={},slotProps:p={},direction:x}=n,B=nt(n,ge),y=At(),m=f({isRtl:y},n),w=ye(m),L=(a=v.StartScrollButtonIcon)!=null?a:le,T=(s=v.EndScrollButtonIcon)!=null?s:re,g=rt({elementType:L,externalSlotProps:p.startScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:m}),O=rt({elementType:T,externalSlotProps:p.endScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:m});return b.jsx(Ce,f({component:"div",className:N(w.root,u),ref:l,role:null,ownerState:m,tabIndex:null},B,{children:x==="left"?b.jsx(L,f({},g)):b.jsx(T,f({},O))}))});function we(t){return ht("MuiTabs",t)}const pt=ft("MuiTabs",["root","vertical","flexContainer","flexContainerVertical","centered","scroller","fixed","scrollableX","scrollableY","hideScrollbar","scrollButtons","scrollButtonsHideMobile","indicator"]),Te=["aria-label","aria-labelledby","action","centered","children","className","component","allowScrollButtonsMobile","indicatorColor","onChange","orientation","ScrollButtonComponent","scrollButtons","selectionFollowsFocus","slots","slotProps","TabIndicatorProps","TabScrollButtonProps","textColor","value","variant","visibleScrollbar"],Pt=(t,e)=>t===e?t.firstChild:e&&e.nextElementSibling?e.nextElementSibling:t.firstChild,kt=(t,e)=>t===e?t.lastChild:e&&e.previousElementSibling?e.previousElementSibling:t.lastChild,lt=(t,e,l)=>{let a=!1,s=l(t,e);for(;s;){if(s===t.firstChild){if(a)return;a=!0}const n=s.disabled||s.getAttribute("aria-disabled")==="true";if(!s.hasAttribute("tabindex")||n)s=l(t,s);else{s.focus();return}}},Me=t=>{const{vertical:e,fixed:l,hideScrollbar:a,scrollableX:s,scrollableY:n,centered:u,scrollButtonsHideMobile:v,classes:p}=t;return mt({root:["root",e&&"vertical"],scroller:["scroller",l&&"fixed",a&&"hideScrollbar",s&&"scrollableX",n&&"scrollableY"],flexContainer:["flexContainer",e&&"flexContainerVertical",u&&"centered"],indicator:["indicator"],scrollButtons:["scrollButtons",v&&"scrollButtonsHideMobile"],scrollableX:[s&&"scrollableX"],hideScrollbar:[a&&"hideScrollbar"]},we,p)},Ie=A("div",{name:"MuiTabs",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:l}=t;return[{[`& .${pt.scrollButtons}`]:e.scrollButtons},{[`& .${pt.scrollButtons}`]:l.scrollButtonsHideMobile&&e.scrollButtonsHideMobile},e.root,l.vertical&&e.vertical]}})(({ownerState:t,theme:e})=>f({overflow:"hidden",minHeight:48,WebkitOverflowScrolling:"touch",display:"flex"},t.vertical&&{flexDirection:"column"},t.scrollButtonsHideMobile&&{[`& .${pt.scrollButtons}`]:{[e.breakpoints.down("sm")]:{display:"none"}}})),Ee=A("div",{name:"MuiTabs",slot:"Scroller",overridesResolver:(t,e)=>{const{ownerState:l}=t;return[e.scroller,l.fixed&&e.fixed,l.hideScrollbar&&e.hideScrollbar,l.scrollableX&&e.scrollableX,l.scrollableY&&e.scrollableY]}})(({ownerState:t})=>f({position:"relative",display:"inline-block",flex:"1 1 auto",whiteSpace:"nowrap"},t.fixed&&{overflowX:"hidden",width:"100%"},t.hideScrollbar&&{scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}},t.scrollableX&&{overflowX:"auto",overflowY:"hidden"},t.scrollableY&&{overflowY:"auto",overflowX:"hidden"})),Re=A("div",{name:"MuiTabs",slot:"FlexContainer",overridesResolver:(t,e)=>{const{ownerState:l}=t;return[e.flexContainer,l.vertical&&e.flexContainerVertical,l.centered&&e.centered]}})(({ownerState:t})=>f({display:"flex"},t.vertical&&{flexDirection:"column"},t.centered&&{justifyContent:"center"})),ze=A("span",{name:"MuiTabs",slot:"Indicator",overridesResolver:(t,e)=>e.indicator})(({ownerState:t,theme:e})=>f({position:"absolute",height:2,bottom:0,width:"100%",transition:e.transitions.create()},t.indicatorColor==="primary"&&{backgroundColor:(e.vars||e).palette.primary.main},t.indicatorColor==="secondary"&&{backgroundColor:(e.vars||e).palette.secondary.main},t.vertical&&{height:"100%",width:2,right:0})),We=A(me)({overflowX:"auto",overflowY:"hidden",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}),Nt={},xt=d.forwardRef(function(e,l){const a=vt({props:e,name:"MuiTabs"}),s=ne(),n=At(),{"aria-label":u,"aria-labelledby":v,action:p,centered:x=!1,children:B,className:y,component:m="div",allowScrollButtonsMobile:w=!1,indicatorColor:L="primary",onChange:T,orientation:g="horizontal",ScrollButtonComponent:O=Be,scrollButtons:E="auto",selectionFollowsFocus:st,slots:X={},slotProps:V={},TabIndicatorProps:D={},TabScrollButtonProps:$={},textColor:J="primary",value:_,variant:R="standard",visibleScrollbar:at=!1}=a,Xt=nt(a,Te),M=R==="scrollable",C=g==="vertical",K=C?"scrollTop":"scrollLeft",Q=C?"top":"left",tt=C?"bottom":"right",it=C?"clientHeight":"clientWidth",q=C?"height":"width",j=f({},a,{component:m,allowScrollButtonsMobile:w,indicatorColor:L,orientation:g,vertical:C,scrollButtons:E,textColor:J,variant:R,visibleScrollbar:at,fixed:!M,hideScrollbar:M&&!at,scrollableX:M&&!C,scrollableY:M&&C,centered:x&&!M,scrollButtonsHideMobile:!w}),W=Me(j),Dt=rt({elementType:X.StartScrollButtonIcon,externalSlotProps:V.startScrollButtonIcon,ownerState:j}),_t=rt({elementType:X.EndScrollButtonIcon,externalSlotProps:V.endScrollButtonIcon,ownerState:j}),[gt,Yt]=d.useState(!1),[F,yt]=d.useState(Nt),[Ct,Ut]=d.useState(!1),[Bt,Vt]=d.useState(!1),[wt,Kt]=d.useState(!1),[Tt,qt]=d.useState({overflow:"hidden",scrollbarWidth:0}),Mt=new Map,z=d.useRef(null),H=d.useRef(null),It=()=>{const o=z.current;let r;if(o){const i=o.getBoundingClientRect();r={clientWidth:o.clientWidth,scrollLeft:o.scrollLeft,scrollTop:o.scrollTop,scrollLeftNormalized:ie(o,n?"rtl":"ltr"),scrollWidth:o.scrollWidth,top:i.top,bottom:i.bottom,left:i.left,right:i.right}}let c;if(o&&_!==!1){const i=H.current.children;if(i.length>0){const h=i[Mt.get(_)];c=h?h.getBoundingClientRect():null}}return{tabsMeta:r,tabMeta:c}},G=bt(()=>{const{tabsMeta:o,tabMeta:r}=It();let c=0,i;if(C)i="top",r&&o&&(c=r.top-o.top+o.scrollTop);else if(i=n?"right":"left",r&&o){const S=n?o.scrollLeftNormalized+o.clientWidth-o.scrollWidth:o.scrollLeft;c=(n?-1:1)*(r[i]-o[i]+S)}const h={[i]:c,[q]:r?r[q]:0};if(isNaN(F[i])||isNaN(F[q]))yt(h);else{const S=Math.abs(F[i]-h[i]),I=Math.abs(F[q]-h[q]);(S>=1||I>=1)&&yt(h)}}),ct=(o,{animation:r=!0}={})=>{r?fe(K,z.current,o,{duration:s.transitions.duration.standard}):z.current[K]=o},Et=o=>{let r=z.current[K];C?r+=o:(r+=o*(n?-1:1),r*=n&&Ot()==="reverse"?-1:1),ct(r)},Rt=()=>{const o=z.current[it];let r=0;const c=Array.from(H.current.children);for(let i=0;i<c.length;i+=1){const h=c[i];if(r+h[it]>o){i===0&&(r=o);break}r+=h[it]}return r},Gt=()=>{Et(-1*Rt())},Zt=()=>{Et(Rt())},Jt=d.useCallback(o=>{qt({overflow:null,scrollbarWidth:o})},[]),Qt=()=>{const o={};o.scrollbarSizeListener=M?b.jsx(We,{onChange:Jt,className:N(W.scrollableX,W.hideScrollbar)}):null;const c=M&&(E==="auto"&&(Ct||Bt)||E===!0);return o.scrollButtonStart=c?b.jsx(O,f({slots:{StartScrollButtonIcon:X.StartScrollButtonIcon},slotProps:{startScrollButtonIcon:Dt},orientation:g,direction:n?"right":"left",onClick:Gt,disabled:!Ct},$,{className:N(W.scrollButtons,$.className)})):null,o.scrollButtonEnd=c?b.jsx(O,f({slots:{EndScrollButtonIcon:X.EndScrollButtonIcon},slotProps:{endScrollButtonIcon:_t},orientation:g,direction:n?"left":"right",onClick:Zt,disabled:!Bt},$,{className:N(W.scrollButtons,$.className)})):null,o},zt=bt(o=>{const{tabsMeta:r,tabMeta:c}=It();if(!(!c||!r)){if(c[Q]<r[Q]){const i=r[K]+(c[Q]-r[Q]);ct(i,{animation:o})}else if(c[tt]>r[tt]){const i=r[K]+(c[tt]-r[tt]);ct(i,{animation:o})}}}),et=bt(()=>{M&&E!==!1&&Kt(!wt)});d.useEffect(()=>{const o=Ft(()=>{z.current&&G()});let r;const c=S=>{S.forEach(I=>{I.removedNodes.forEach(Z=>{var P;(P=r)==null||P.unobserve(Z)}),I.addedNodes.forEach(Z=>{var P;(P=r)==null||P.observe(Z)})}),o(),et()},i=Ht(z.current);i.addEventListener("resize",o);let h;return typeof ResizeObserver<"u"&&(r=new ResizeObserver(o),Array.from(H.current.children).forEach(S=>{r.observe(S)})),typeof MutationObserver<"u"&&(h=new MutationObserver(c),h.observe(H.current,{childList:!0})),()=>{var S,I;o.clear(),i.removeEventListener("resize",o),(S=h)==null||S.disconnect(),(I=r)==null||I.disconnect()}},[G,et]),d.useEffect(()=>{const o=Array.from(H.current.children),r=o.length;if(typeof IntersectionObserver<"u"&&r>0&&M&&E!==!1){const c=o[0],i=o[r-1],h={root:z.current,threshold:.99},S=ut=>{Ut(!ut[0].isIntersecting)},I=new IntersectionObserver(S,h);I.observe(c);const Z=ut=>{Vt(!ut[0].isIntersecting)},P=new IntersectionObserver(Z,h);return P.observe(i),()=>{I.disconnect(),P.disconnect()}}},[M,E,wt,B==null?void 0:B.length]),d.useEffect(()=>{Yt(!0)},[]),d.useEffect(()=>{G()}),d.useEffect(()=>{zt(Nt!==F)},[zt,F]),d.useImperativeHandle(p,()=>({updateIndicator:G,updateScrollButtons:et}),[G,et]);const Wt=b.jsx(ze,f({},D,{className:N(W.indicator,D.className),ownerState:j,style:f({},F,D.style)}));let ot=0;const te=d.Children.map(B,o=>{if(!d.isValidElement(o))return null;const r=o.props.value===void 0?ot:o.props.value;Mt.set(r,ot);const c=r===_;return ot+=1,d.cloneElement(o,f({fullWidth:R==="fullWidth",indicator:c&&!gt&&Wt,selected:c,selectionFollowsFocus:st,onChange:T,textColor:J,value:r},ot===1&&_===!1&&!o.props.tabIndex?{tabIndex:0}:{}))}),ee=o=>{const r=H.current,c=se(r).activeElement;if(c.getAttribute("role")!=="tab")return;let h=g==="horizontal"?"ArrowLeft":"ArrowUp",S=g==="horizontal"?"ArrowRight":"ArrowDown";switch(g==="horizontal"&&n&&(h="ArrowRight",S="ArrowLeft"),o.key){case h:o.preventDefault(),lt(r,c,kt);break;case S:o.preventDefault(),lt(r,c,Pt);break;case"Home":o.preventDefault(),lt(r,null,Pt);break;case"End":o.preventDefault(),lt(r,null,kt);break}},dt=Qt();return b.jsxs(Ie,f({className:N(W.root,y),ownerState:j,ref:l,as:m},Xt,{children:[dt.scrollButtonStart,dt.scrollbarSizeListener,b.jsxs(Ee,{className:W.scroller,ownerState:j,style:{overflow:Tt.overflow,[C?`margin${n?"Left":"Right"}`:"marginBottom"]:at?void 0:-Tt.scrollbarWidth},ref:z,children:[b.jsx(Re,{"aria-label":u,"aria-labelledby":v,"aria-orientation":g==="vertical"?"vertical":null,className:W.flexContainer,ownerState:j,onKeyDown:ee,ref:H,role:"tablist",children:te}),gt&&Wt]}),dt.scrollButtonEnd]}))}),Lt="index",U={tabs:`${Lt}-tabs`,tab:`${Lt}-tab`},Pe=ae(xt)(({theme:t})=>({[`& .${U.tabs}`]:{},[`& .${U.tab}`]:{fontSize:"0.875rem",[t.breakpoints.up("md")]:{fontSize:"1rem"}}}));function ke({tabs:t,current:e,onChange:l,iconPosition:a,...s}){return b.jsx(xt,{scrollButtons:"auto",value:e,onChange:(n,u)=>l(u),...s,variant:"scrollable",sx:{minHeight:"auto",".MuiTabs-scrollButtons.Mui-disabled":{opacity:.3,cursor:"not-allowed",pointerEvents:"auto"},".MuiTabs-scroller":{borderRadius:"100vw"},".MuiTabs-flexContainer":{borderRadius:"100vw",backgroundColor:"grey.100",padding:.5,display:"inline-flex",columnGap:.25,maxWidth:"100%",overflowX:"auto"},".MuiTab-root":{borderRadius:"100vw",border:"1px solid transparent",minHeight:"auto",lineHeight:1,py:1,color:"text.secondary",fontSize:"13px",fontWeight:"normal",textTransform:"capitalize",transition:"background-color 0.2s ease","&.Mui-selected, &:hover":{backgroundColor:"action.selected",borderColor:"grey.100",color:"grey.A700"}},".MuiTabs-indicator":{display:"none"},...s.sx},children:t.map(n=>b.jsx(St,{className:U.tab,value:n.value,label:n.label,icon:n.icon,iconPosition:a},n.value))})}function Ne({tabs:t,current:e,onChange:l,iconPosition:a,...s}){return b.jsx(xt,{scrollButtons:"auto",value:e,onChange:(n,u)=>l(u),...s,variant:"scrollable",sx:{minHeight:"auto",".MuiTabs-scrollButtons.Mui-disabled":{opacity:.3,cursor:"not-allowed",pointerEvents:"auto"},".MuiTabs-scroller":s.orientation!=="vertical"?{"&::after":{content:'""',display:"block",position:"sticky",left:0,zIndex:-1,width:"100%",height:"1px",backgroundColor:"grey.300"}}:{},".MuiTabs-flexContainer":{display:"inline-flex",columnGap:2.5,px:0,pb:.5},".MuiTab-root":{border:"1px solid transparent",minHeight:"auto",lineHeight:1,py:1,px:0,color:"text.secondary",fontSize:"14px",fontWeight:500,textTransform:"capitalize",minWidth:"auto","&.Mui-selected, &:hover":{color:"primary.main"}},".MuiTabs-indicator":{height:"1px",backgroundColor:"primary.main"},...s.sx},children:t.map(n=>b.jsx(St,{className:U.tab,value:n.value,label:n.label,icon:n.icon,iconPosition:a},n.value))})}function $e({tabs:t,current:e,onChange:l,variant:a,iconPosition:s,...n}){return a==="card"?b.jsx(ke,{...n,tabs:t,current:e,onChange:l,iconPosition:s}):a==="line"?b.jsx(Ne,{...n,tabs:t,current:e,onChange:l,iconPosition:s}):b.jsx(Pe,{scrollButtons:"auto",variant:"scrollable",value:e,onChange:(u,v)=>l(v),indicatorColor:"primary",...n,className:[U.tabs,n.className||""].join(" "),children:t.map(u=>b.jsx(St,{className:U.tab,value:u.value,label:u.label,icon:u.icon,iconPosition:s},u.value))})}export{$e as T,xt as a,St as b,Ot as d,ie as g,pt as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{m as R,j as e,R as B,P as y,r as C,Q as Z,S as J,U as Y,V as ee,N as h,F as E,br as I,bs as Ke,a_ as te,t as H,B as O,C as Ae,af as xe,e as we,x as L,D as fe,aZ as De,X as Re,n as $,A as Ie,ax as V,l as Pe,bt as U,W as Be,bu as he,bv as ge,bw as ye,bx as $e,J as _e,k as P,by as Le,aC as W,a5 as me,aW as ue,bz as Ne,Y as ze,Z as Ee,z as We,u as qe,bq as Ue,d as Me,bA as Fe}from"./index-
|
|
1
|
+
import{m as R,j as e,R as B,P as y,r as C,Q as Z,S as J,U as Y,V as ee,N as h,F as E,br as I,bs as Ke,a_ as te,t as H,B as O,C as Ae,af as xe,e as we,x as L,D as fe,aZ as De,X as Re,n as $,A as Ie,ax as V,l as Pe,bt as U,W as Be,bu as he,bv as ge,bw as ye,bx as $e,J as _e,k as P,by as Le,aC as W,a5 as me,aW as ue,bz as Ne,Y as ze,Z as Ee,z as We,u as qe,bq as Ue,d as Me,bA as Fe}from"./index-DMUuXkl-.js";import{T as He}from"./index-BJcQfMN9.js";import Oe from"./audit-logs-vOsLrHtf.js";import{T as be,M as Ve}from"./index-CIbq35qJ.js";import{r as je,P as Xe}from"./index-C_tSdokL.js";import{u as N,T as Ge}from"./team-DXOr-ygw.js";import{g as Qe,D as Ze}from"./index-DtQKM-2h.js";import{d as Je}from"./Delete-DSwbRjGm.js";import{d as Ye}from"./Edit-B7OHuMt8.js";import{E as et}from"./index-Z8_Ea0J-.js";import{d as tt}from"./Add-CKZvwomV.js";import{C as X}from"./index-C5kA3CHn.js";import{C as G}from"./click-to-copy-Bx0WCh-p.js";import{f as st}from"./index-BojVbZw0.js";import{D as nt}from"./delete-confirm-BbG1Njy7.js";import{P as ot}from"./permission-BrGI8BrM.js";import{u as it}from"./blocklet-DfNwfvjT.js";import{A as at}from"./actions-Bvcwob0t.js";import{u as Ce}from"./use-mobile-hZxK6-uz.js";import{u as rt}from"./useAsyncRetry-foiApHTO.js";import"./TableSearch-CbLOqG0x.js";import"./Search-BWsSz0TZ.js";import"./Clear-h2RSseCa.js";import"./useLocalStorage-rbap7GBn.js";import"./index-qDvx2LXA.js";import"./shorten-label-Dkc-R7Pf.js";import"./ViewList-COZmXWce.js";import"./resource-dialog-CroWtX8l.js";import"./index-B3guyKGC.js";import"./use-mobile-BknAfbf7.js";import"./ListItemButton-D3dXwiba.js";import"./index-CMclvolP.js";import"./emotion-react.browser.esm-CH16KKaA.js";import"./index-BVFznPvg.js";import"./Switch-B5mZ5gaW.js";import"./url-evaluation-D2uxzb5w.js";import"./index-Myd8Qh5l.js";import"./OpenInNew-DJezkARI.js";import"./index-BJHGOv7L.js";import"./HelpOutline-BFcbReM4.js";import"./index-CKzGu37_.js";import"./ButtonGroup-Cv9T_ybJ.js";import"./getValidReactChildren-Ds2y77el.js";import"./AdapterDayjs-BHlyhiPJ.js";import"./useThemeProps-CWjJ-DWG.js";import"./CSSTransition-D_ivveoB.js";import"./refType-BK4ojMi7.js";import"./index-IyfTJp8i.js";import"./Verified-FiZjuwhy.js";import"./DeleteOutline-BbkjMdAN.js";import"./ErrorOutline-Dj5RjmYU.js";import"./sdk-B0fHGxCR.js";import"./LockIcon-tb1yw67V.js";import"./cloneDeep-CvMji3zz.js";import"./chain-DaWBsVEZ.js";import"./list-header-I7ATqJra.js";import"./ToggleButtonGroup-BsAN6BnK.js";import"./TableRow-Cm_wAjgF.js";import"./ViewColumn-B1nkIYjz.js";import"./MoreVert-6SZ5-4Oc.js";import"./MoreHoriz-BREqCusY.js";import"./useAsync-CbClB-AN.js";function se({value:t}){const{t:s,locale:l}=R(),a=new Date;return new Date(t)<a?e.jsxs("span",{style:{color:"red"},children:[e.jsx(B,{value:t,locale:l}),`${s("setting.accessKey.expired",{time:""})}`]}):e.jsx(B,{value:t,locale:l,type:"all"})}se.propTypes={value:y.string.isRequired};function ne({value:t,onChange:s,...l}){const{t:a}=R(),r=C.useMemo(()=>[{value:"signature",title:a("setting.accessKey.signature"),description:a("setting.accessKey.signatureDesc")},{value:"simple",title:a("setting.accessKey.simple"),description:a("setting.accessKey.simpleDesc")}],[a]);return e.jsxs(Z,{style:{width:"100%"},variant:"outlined",...l,children:[e.jsx(J,{children:a("setting.accessKey.authType")}),e.jsx(Y,{value:t,onChange:s,fullWidth:!0,label:a("setting.accessKey.authType"),children:r.map(i=>e.jsx(ee,{value:i.value,children:e.jsxs(h,{children:[e.jsx("span",{children:i.title}),e.jsx(h,{maxWidth:510,fontSize:12,color:"#999",whiteSpace:"normal",children:i.description})]})},i.value))})]})}ne.propTypes={value:y.string.isRequired,onChange:y.func.isRequired};const q=()=>{const t=E.RBAC_CONFIG.roles.filter(r=>r.passport),{inService:s}=I(),{roles:l}=N(),a=[...t,...s?l:[]];return Ke(a,"name").filter(r=>r.name!==E.ROLES.OWNER)};function oe(t){const{remark:s,onCreate:l}=t,{api:a}=I(),{teamDid:r}=N(),{t:i}=R(),[b,j]=C.useState(!1),[x,k]=C.useState(null),d=q(),S=()=>{j(!1),k(null)},v=async n=>{const{remark:p,passport:f,authType:o}=n;j(!0);const m=await a.createAccessKey({input:{teamDid:r,remark:p.trim(),passport:f,expireAt:n.expireAt?new Date(n.expireAt).getTime():null,authType:o}}),{data:K}=m;l(K),k(null),j(!1)},g={title:`${i("common.create")} ${i("accessKey")}`,description:(n,p,f)=>e.jsxs(te,{gap:3,children:[e.jsx(H,{label:i("setting.accessKey.tip"),autoComplete:"off",variant:"outlined",name:"remark",inputProps:{"data-cy":"remark-input"},fullWidth:!0,autoFocus:!0,margin:"dense",value:n.remark,onChange:o=>{p({...n,remark:o.target.value,__disableConfirm:!n.passport||!o.target.value.trim()}),o.target.value.trim()?f(""):f(i("setting.accessKey.remarkInvalid"))}}),e.jsxs(Z,{style:{width:"100%"},variant:"outlined",children:[e.jsx(J,{children:i("setting.accessKey.passport")}),e.jsx(Y,{"data-cy":"create-access-key-select-passport",value:n.passport,onChange:o=>{const m=o.target.value;f(null),p({...n,passport:m,__disableConfirm:!n.remark||!m})},fullWidth:!0,label:i("setting.accessKey.passport"),disabled:b,children:d.map(o=>e.jsx(ee,{value:o.name,"data-cy":`create-access-key-passport-option-${o.name}`,children:e.jsxs(h,{children:[e.jsx("span",{children:o.title||o.name}),e.jsx(h,{maxWidth:440,fontSize:12,color:"#999",whiteSpace:"normal",textAlign:"justify",children:o.description})]})},o.name))})]}),e.jsx(ne,{value:n.authType,onChange:o=>{p({...n,authType:o.target.value})}}),e.jsx(be,{placeholder:i("setting.accessKey.expireTime"),value:n.expireAt,onChange:o=>{p({...n,expireAt:o,__disableConfirm:!n.passport||!n.remark||!o})}})]}),confirm:i("common.confirm"),cancel:i("common.cancel"),color:"primary",params:{remark:s,authType:"signature",__disableConfirm:!s.trim()},onConfirm:v,onCancel:S};return e.jsxs(e.Fragment,{children:[e.jsxs(O,{sx:{color:"common.white"},edge:"end",variant:"contained",color:"primary","data-cy":"add-access-key-btn",onClick:()=>k(g),className:"rule-action",children:[b?e.jsx(Ae,{size:16}):e.jsx(tt,{style:{fontSize:16}}),i("common.create")]}),x&&e.jsx(xe,{title:x.title,description:x.description,confirm:x.confirm,color:x.color,cancel:x.cancel,params:x.params,onConfirm:x.onConfirm,onCancel:x.onCancel})]})}oe.propTypes={remark:y.string,onCreate:y.func};oe.defaultProps={onCreate:()=>{},remark:""};function ie(t){var f,o;const{onConfirm:s,accessKeyId:l,accessKeySecret:a,hideSecret:r}=t,{t:i}=C.useContext(we),[b,j]=C.useState(!1),[x,k]=C.useState(()=>r),d=I(),S=()=>{k(!x)},v=m=>{j(m.target.checked)},g=L(window.location.origin,(o=(f=d==null?void 0:d.info)==null?void 0:f.routing)==null?void 0:o.adminPath),n=C.useMemo(()=>{var m,K,u,D;return r?`const Client = require('@abtnode/client');
|
|
2
2
|
const ensureServerEndpoint = require('@abtnode/util/lib/ensure-server-endpoint');
|
|
3
3
|
const { joinURL } = require('ufo');
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{dq as s,P as c,j as t,aZ as e}from"./index-
|
|
1
|
+
import{dq as s,P as c,j as t,aZ as e}from"./index-DMUuXkl-.js";import{S as l}from"./Switch-B5mZ5gaW.js";const r=s(i=>t.jsx(l,{focusVisibleClassName:".Mui-focusVisible",disableRipple:!0,...i}))(({theme:i})=>({width:42,height:26,padding:0,"& .MuiSwitch-switchBase":{padding:0,margin:2,transitionDuration:"300ms","&.Mui-checked":{transform:"translateX(16px)",color:"#fff","& + .MuiSwitch-track":{backgroundColor:i.palette.primary.main,opacity:1,border:0},"&.Mui-disabled + .MuiSwitch-track":{opacity:.5}},"&.Mui-focusVisible .MuiSwitch-thumb":{color:i.palette.primary.main,border:"6px solid #fff"},"&.Mui-disabled .MuiSwitch-thumb":{color:i.palette.mode==="light"?i.palette.grey[100]:i.palette.grey[600]},"&.Mui-disabled + .MuiSwitch-track":{opacity:i.palette.mode==="light"?.7:.3}},"& .MuiSwitch-thumb":{boxSizing:"border-box",width:22,height:22},"& .MuiSwitch-track":{borderRadius:26/2,backgroundColor:i.palette.grey[200],opacity:1,transition:i.transitions.create(["background-color"],{duration:500})}}));function a({labelProps:i,...o}){return i?t.jsx(e,{control:t.jsx(r,{...o}),...i}):t.jsx(r,{...o})}a.propTypes={labelProps:c.object};a.defaultProps={labelProps:null};export{a as S};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{bX as createSvgIcon,j as jsxRuntimeExports,r as reactExports,P as PropTypes,bm as getDefaultExportFromCjs,n as newStyled,H as useMediaQuery,dx as Skeleton,cS as Img,a1 as default_1$1,aC as Tooltip,ep as Button,k as Typography,C as CircularProgress,b9 as styled,am as useTheme,ff as isObject,dB as deepmerge,dT as StyledEngineProvider,dU as ThemeProvider,fH as ThemeProvider$1,fI as HeaderAddons,fJ as Hidden,$ as Center,aQ as requireCreateSvgIcon,aR as interopRequireDefaultExports,fK as Check,d8 as commonjsGlobal,cG as Buffer,bi as React,fj as noop,bC as __vitePreload,dq as styled$1}from"./index-
|
|
1
|
+
import{bX as createSvgIcon,j as jsxRuntimeExports,r as reactExports,P as PropTypes,bm as getDefaultExportFromCjs,n as newStyled,H as useMediaQuery,dx as Skeleton,cS as Img,a1 as default_1$1,aC as Tooltip,ep as Button,k as Typography,C as CircularProgress,b9 as styled,am as useTheme,ff as isObject,dB as deepmerge,dT as StyledEngineProvider,dU as ThemeProvider,fH as ThemeProvider$1,fI as HeaderAddons,fJ as Hidden,$ as Center,aQ as requireCreateSvgIcon,aR as interopRequireDefaultExports,fK as Check,d8 as commonjsGlobal,cG as Buffer,bi as React,fj as noop,bC as __vitePreload,dq as styled$1}from"./index-DMUuXkl-.js";import{j as joinUrl}from"./url-join-DU6UdRf1.js";import{C as CloseIcon}from"./Close-L6Q6a3RE.js";const PriorityHigh=createSvgIcon([jsxRuntimeExports.jsx("circle",{cx:"12",cy:"19",r:"2"},"0"),jsxRuntimeExports.jsx("path",{d:"M10 3h4v12h-4z"},"1")],"PriorityHigh"),StepContext=reactExports.createContext(),{Provider}=StepContext,matchPath=(i,s,a=window.location.pathname.replace(/\/$/,"/"))=>i?s?i===a:new RegExp(i).test(a):!1;function StepProvider({children:i,steps:s,mode:a}){const[o,u]=reactExports.useState("");!o&&s.length&&u(s[0].key);const S=s.map(T=>T.children?[{key:T.key,hasChild:!0},T.children.map(O=>({parentKey:T.key,key:O.key}))]:{key:T.key}).flat(1/0),P=S.filter(T=>!T.hasChild),C=T=>{let O;const D=S.findIndex(H=>H.key===o?(O=H.parentKey,!0):!1);if(O===T)return"current";const L=S.findIndex(H=>H.key===T);if(L!==-1){if(L===D)return"current";if(L<D)return"before"}return"after"};function E(T){u(T)}function _(T){if(typeof T=="function"){const O=T(P.findIndex(D=>D.key===o));u(P[O].key)}else u(P[T].key)}const I=P.findIndex(T=>T.key===o);reactExports.useEffect(()=>{if(a==="history"){let T="";s.some(O=>O.children&&O.children.length?O.children.some(D=>matchPath(D.path,D.exact)?(T=D.key,!0):!1):matchPath(O.path,O.exact)?(T=O.key,!0):!1),T&&u(T)}return()=>{}},[s,a]);const j={steps:s,totalStepsCount:P.length,getStepStatus:C,setActiveStepByKey:E,setActiveStepByIndex:_,activeStep:I,canBackToStep:T=>a==="memory"&&I!==0&&T<I};return jsxRuntimeExports.jsx(Provider,{value:j,children:i})}function useStepContext(){return reactExports.useContext(StepContext)}StepProvider.propTypes={children:PropTypes.any.isRequired,steps:PropTypes.array.isRequired,mode:PropTypes.string};StepProvider.defaultProps={mode:"history"};var has=Object.prototype.hasOwnProperty,toString=Object.prototype.toString;function isEmpty(i){if(i==null)return!0;if(typeof i=="boolean")return!1;if(typeof i=="number")return i===0;if(typeof i=="string"||typeof i=="function"||Array.isArray(i))return i.length===0;if(i instanceof Error)return i.message==="";if(i.toString==toString)switch(i.toString()){case"[object File]":case"[object Map]":case"[object Set]":return i.size===0;case"[object Object]":{for(var s in i)if(has.call(i,s))return!1;return!0}}return!1}var lib=isEmpty;const isEmpty$1=getDefaultExportFromCjs(lib),defaultBlockletLogo=""+new URL("blocklet-default-logo-Bspnu_ws.png",import.meta.url).href,translations={en:{optional:"Optional",defaultNavSubTitle:"Launching"},zh:{optional:"可选",defaultNavSubTitle:"启动"}},getTranslations=i=>translations[i]?translations[i]:translations.en,getLaunchingText=i=>i==="zh"?"启动":"Launching",getBlockletDisplayName=i=>(i==null?void 0:i.title)||(i==null?void 0:i.name)||"";function AppHeader({blockletMeta:i,subTitle:s,logoUrl:a,locale:o,navLogo:u,loading:S}){const P=useMediaQuery(j=>j.breakpoints.down("md")),C=P?18:48,E=reactExports.useRef(null),[_,I]=reactExports.useState("");return reactExports.useEffect(()=>{E.current&&E.current.offsetHeight>34&&(_===""?I("middle"):_==="middle"&&I("small"))},[_]),jsxRuntimeExports.jsxs(Container$2,{className:_==="small"?"center-mode":"",children:[P?jsxRuntimeExports.jsx("div",{className:"app-icon",children:u}):jsxRuntimeExports.jsxs("div",{className:"app-icon",children:[S&&jsxRuntimeExports.jsx(AppIconSkeleton,{blockletSize:C,isMobile:P}),!S&&jsxRuntimeExports.jsx(AppIcon,{blockletSize:C,logoUrl:a})]}),jsxRuntimeExports.jsxs("div",{className:"header-title",children:[P&&s&&jsxRuntimeExports.jsx("div",{className:"header-title-sub",children:s}),jsxRuntimeExports.jsxs("div",{className:"app-name-content",children:[!P&&jsxRuntimeExports.jsx("div",{className:"launching-context",children:s||getLaunchingText(o)}),jsxRuntimeExports.jsx("div",{className:`header-title-name ${_==="middle"||_==="small"?"middle-size":""}`,ref:E,children:jsxRuntimeExports.jsx(AppTitle,{logoUrl:a,isMobile:P,blockletMeta:i,blockletSize:C,loading:S})})]})]})]})}AppHeader.propTypes={blockletMeta:PropTypes.object,subTitle:PropTypes.any,logoUrl:PropTypes.string,locale:PropTypes.string,navLogo:PropTypes.any,loading:PropTypes.bool};AppHeader.defaultProps={subTitle:"",logoUrl:"",locale:"",navLogo:"",loading:!1,blockletMeta:{}};function AppIconSkeleton({blockletSize:i,isMobile:s}){return s?jsxRuntimeExports.jsx(Skeleton,{variant:"rectangular",width:100,height:16,alt:"icon",style:{marginTop:4}}):jsxRuntimeExports.jsx(Skeleton,{variant:"rectangular",width:i,height:i})}function AppIcon({logoUrl:i,blockletSize:s}){return jsxRuntimeExports.jsx(Img,{width:s,height:s,src:i,alt:"blocklet icon",fallback:defaultBlockletLogo,style:{verticalAlign:"text-bottom"}},`layout-app-icon-${i}`)}function AppTitle({isMobile:i,logoUrl:s,blockletMeta:a,blockletSize:o,loading:u}){const S=getBlockletDisplayName(a);return u?jsxRuntimeExports.jsx(Skeleton,{variant:"rectangular",width:100,height:16,alt:"icon",style:{marginTop:4}}):isEmpty$1(a)?jsxRuntimeExports.jsx(Skeleton,{variant:"rectangular",animation:!1,width:100,height:16,alt:"icon",style:{marginTop:4}}):i?jsxRuntimeExports.jsxs(MobileTitleStyle,{children:[jsxRuntimeExports.jsx(AppIcon,{blockletSize:o,logoUrl:s}),jsxRuntimeExports.jsx("span",{className:"ellipsis-title",children:getBlockletDisplayName(a)})]}):jsxRuntimeExports.jsx(AppLink,{className:"app-link",target:"_blank",href:joinUrl((a==null?void 0:a.registryUrl)||"",`/blocklets/${a==null?void 0:a.did}`),title:S,children:S})}const MobileTitleStyle=newStyled.div`
|
|
2
2
|
.ellipsis-title {
|
|
3
3
|
flex: 1;
|
|
4
4
|
position: absolute;
|