@abtnode/blocklet-services 1.16.24-beta-a02d4e5e → 1.16.24-beta-64150e24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api/index.js +1 -1
- package/api/libs/email.js +1 -0
- package/api/libs/image.js +0 -5
- package/api/middlewares/check-user.js +16 -0
- package/api/routes/user-session.js +16 -11
- package/api/routes/user.js +28 -13
- package/api/services/auth/index.js +2 -0
- package/api/services/auth/session.js +11 -13
- package/api/socket/channel/did.js +22 -18
- package/api/util/attach-shared-utils.js +13 -1
- package/dist/assets/{Add-vTyteaJS.js → Add-aR533i12.js} +1 -1
- package/dist/assets/{Avatar--wC9mrh2.js → Avatar-rCJCajEU.js} +1 -1
- package/dist/assets/Box-UZKPIg5l.js +1 -0
- package/dist/assets/Box-wC1DaiGM.js +1 -0
- package/dist/assets/{Button-ykwLiZ2J.js → Button-icne1Ua1.js} +1 -1
- package/dist/assets/{ButtonBase-gKUGc3Zq.js → ButtonBase-tD513M7V.js} +2 -2
- package/dist/assets/{ButtonBase-2j16Oank.js → ButtonBase-y-I9S5ql.js} +2 -2
- package/dist/assets/{CardContent-S7jGYoZi.js → CardContent-6A-HL2kL.js} +1 -1
- package/dist/assets/{CheckCircle-MSun7-U0.js → CheckCircle-60AM0ITf.js} +1 -1
- package/dist/assets/{ChevronLeft-OJEtYKJw.js → ChevronLeft-jYv99aor.js} +1 -1
- package/dist/assets/{ChevronRight-Az5bXFdS.js → ChevronRight-gVrMbICn.js} +1 -1
- package/dist/assets/{Chip-2zwjZf99.js → Chip-ay1aqrwj.js} +1 -1
- package/dist/assets/{CircularProgress-oRghdnB7.js → CircularProgress-2E7FsVpy.js} +5 -5
- package/dist/assets/{Close-UpPcWosj.js → Close-acdEKFOx.js} +1 -1
- package/dist/assets/{Collapse-9G0XJCS4.js → Collapse-7L2PLAwX.js} +1 -1
- package/dist/assets/{DeleteOutline-oDxVTiXQ.js → DeleteOutline-mJxIIf_E.js} +1 -1
- package/dist/assets/{Done-lDz0AHuP.js → Done-IUW8sxba.js} +1 -1
- package/dist/assets/{Download-DZZUg84i.js → Download-pM5Y1uk4.js} +1 -1
- package/dist/assets/{Edit-xGXK3CYT.js → Edit-0l6wvu4t.js} +1 -1
- package/dist/assets/{EditIcon-vSawnu2L.js → EditIcon-ole9UoIn.js} +1 -1
- package/dist/assets/{ExpandMore-sVVVrdQE.js → ExpandMore-73ZaztzD.js} +1 -1
- package/dist/assets/{ExpandMore-HZFmUR-a.js → ExpandMore-QGwDyScz.js} +1 -1
- package/dist/assets/{FilterList-cxHEtz0G.js → FilterList-SI94bUfz.js} +4 -4
- package/dist/assets/{FormControlLabel-rf6UEluy.js → FormControlLabel-k9sTwU-b.js} +1 -1
- package/dist/assets/{Google-VMrSS3LU.js → Google-WU1ZvKo9.js} +1 -1
- package/dist/assets/{Grid-hq_HvwNl.js → Grid-C0yrXHv6.js} +1 -1
- package/dist/assets/{Grid-wusqObpv.js → Grid-E30_4BeQ.js} +1 -1
- package/dist/assets/{Hidden-GZpNG8Fn.js → Hidden--yepz0pM.js} +1 -1
- package/dist/assets/{IconButton-SWdwxRXE.js → IconButton-8UYGgxfo.js} +1 -1
- package/dist/assets/{IconButton-pbUOyNxq.js → IconButton-opaehSAi.js} +3 -3
- package/dist/assets/{InfoOutlined-fmfPbKBr.js → InfoOutlined-H6zGOdnr.js} +1 -1
- package/dist/assets/{InputAdornment-cytNeut4.js → InputAdornment-01BB-IUi.js} +1 -1
- package/dist/assets/{InputAdornment-J9SNlDlG.js → InputAdornment-b8lVK7li.js} +1 -1
- package/dist/assets/{InputLabel-5ZGbi6bW.js → InputLabel-S5ITR0B1.js} +1 -1
- package/dist/assets/{Launch-wH2P5XtF.js → Launch-St5GEv7j.js} +1 -1
- package/dist/assets/{Link-hD326Lst.js → Link-4d7RYuFQ.js} +1 -1
- package/dist/assets/{Link-dqV63oGM.js → Link-P3Cgz37T.js} +1 -1
- package/dist/assets/{ListItem-zpF9vl3-.js → ListItem-hAjlDna0.js} +1 -1
- package/dist/assets/{ListItemText-AE7V4fm6.js → ListItemText-pzMz-_8U.js} +1 -1
- package/dist/assets/{LockIcon-RX4ACPLP.js → LockIcon-WynYWbOW.js} +1 -1
- package/dist/assets/{Loop-J3Oc551N.js → Loop-q74Adjst.js} +1 -1
- package/dist/assets/{Menu-R2sJfNVQ.js → Menu-anPorR00.js} +1 -1
- package/dist/assets/{OpenInNew-ey9Zce1G.js → OpenInNew-vpsAPHUY.js} +1 -1
- package/dist/assets/{Pagination-_AyYmu3K.js → Pagination-Dp0FMjhQ.js} +1 -1
- package/dist/assets/{Paper-xnFdFhSU.js → Paper-xlcAcZNb.js} +1 -1
- package/dist/assets/{RevokeIcon-hUSUDMyp.js → RevokeIcon-EG-Tgs1P.js} +1 -1
- package/dist/assets/{Search-I_yS6r69.js → Search-g3D9ZMg2.js} +1 -1
- package/dist/assets/{Search-iJmoubNh.js → Search-yih_sVbz.js} +1 -1
- package/dist/assets/{Select-M73NW8co.js → Select-1kfqC4Cs.js} +2 -2
- package/dist/assets/{ServerLogo-DO0zCcXJ.js → ServerLogo-UsfyzMmv.js} +1 -1
- package/dist/assets/{Skeleton-si3pCQpt.js → Skeleton-Sko1dhMc.js} +2 -2
- package/dist/assets/{Stepper-JspwoyL9.js → Stepper-MKCGeshB.js} +1 -1
- package/dist/assets/{TextField-LQ_MEBEr.js → TextField-BYLq4y6q.js} +1 -1
- package/dist/assets/{TextField-t2Fc5ZKP.js → TextField-egkc1TLq.js} +2 -2
- package/dist/assets/{Toolbar-yNKPFPYf.js → Toolbar-TavQhk9k.js} +1 -1
- package/dist/assets/{Tooltip-POCM6iwG.js → Tooltip-IqBOP7yE.js} +1 -1
- package/dist/assets/{Typography-KrY_5iS6.js → Typography-7BaU4rMH.js} +1 -1
- package/dist/assets/{access-control-QBAuY9yE.js → access-control-s8ZaVYk6.js} +1 -1
- package/dist/assets/{actions-O61MEW97.js → actions-WJB7Zfz1.js} +1 -1
- package/dist/assets/{add-component-core-NQjGVKRe.js → add-component-core-_1fUrUnH.js} +33 -33
- package/dist/assets/add-resource-8SDMQ09o.js +1 -0
- package/dist/assets/{addon-TQ0rCH75.js → addon-QeLrGOdX.js} +1 -1
- package/dist/assets/{analytics-8oJDRxnh.js → analytics-aWYg0Hso.js} +1 -1
- package/dist/assets/api-wjvMMbke.js +1 -0
- package/dist/assets/{audit-logs-DUiSrbgt.js → audit-logs-UFUAfPnh.js} +1 -1
- package/dist/assets/{button-uIqGychf.js → button-EgYm5107.js} +1 -1
- package/dist/assets/{click-to-copy-Stqj3s2e.js → click-to-copy-vmaq823F.js} +1 -1
- package/dist/assets/{complete-FTJGD-1N.js → complete-veGf8Jl6.js} +1 -1
- package/dist/assets/{component-EZRyGvJZ.js → component-5ds5_alG.js} +1 -1
- package/dist/assets/{config-VPh3sxvn.js → config-2fQ7fnBW.js} +1 -1
- package/dist/assets/{config-1heXK7PJ.js → config-kGiHk0RX.js} +1 -1
- package/dist/assets/{config-navigation-fn_fGXvZ.js → config-navigation-NkXbd3di.js} +1 -1
- package/dist/assets/{config-space-un0A86az.js → config-space-lWhx9oKc.js} +3 -3
- package/dist/assets/{confirm-NdF0-vLf.js → confirm-6Jdys1hj.js} +1 -1
- package/dist/assets/{connect-bUr2fIui.js → connect-fBDShwJm.js} +1 -1
- package/dist/assets/connect-sU3gSssk.js +1 -0
- package/dist/assets/{connect-to-jN6NfPLE.js → connect-to-43P2EzeD.js} +2 -2
- package/dist/assets/{content-layout-xv7efLhO.js → content-layout-uMjojnsj.js} +1 -1
- package/dist/assets/{createStack-X06a2NYY.js → createStack-Ql4z3puD.js} +1 -1
- package/dist/assets/{createSvgIcon-WGsmTjmI.js → createSvgIcon-j58drKza.js} +1 -1
- package/dist/assets/{createSvgIcon-V91OChAf.js → createSvgIcon-kg0p2IW6.js} +1 -1
- package/dist/assets/{dashboard--flHRbxA.js → dashboard-UpN-Xcgd.js} +3 -3
- package/dist/assets/{did-address-MOXaSOmL.js → did-address-KX8MZujh.js} +1 -1
- package/dist/assets/{domain-GsJNX7Pl.js → domain-KPXpTvNs.js} +1 -1
- package/dist/assets/{domain-list-U7SAJAPI.js → domain-list-t9wSnlq6.js} +2 -2
- package/dist/assets/{exchange-passport-__egRbif.js → exchange-passport-DCatUSSt.js} +1 -1
- package/dist/assets/{fallback-JR1UKYrN.js → fallback-U1OX2XSx.js} +1 -1
- package/dist/assets/{fuel-B07m2J73.js → fuel-dLXbx5xS.js} +1 -1
- package/dist/assets/{fullpage-WwvQZMup.js → fullpage-C15C9Cxy.js} +1 -1
- package/dist/assets/home-5ePzabyN.js +1 -0
- package/dist/assets/{iframe-QRp9-qFU.js → iframe-pCAFtFXo.js} +1 -1
- package/dist/assets/{index-jXu4Dpk_.js → index-2LB4uByH.js} +1 -1
- package/dist/assets/{index-1Jk_G-9Y.js → index-4krLq-ni.js} +1 -1
- package/dist/assets/{index-OP9njHuS.js → index-4zjZjcBC.js} +1 -1
- package/dist/assets/{index-LTzQUJ4f.js → index-65ROwV_z.js} +1 -1
- package/dist/assets/{index-iPbuZCut.js → index-6_bFjF9P.js} +1 -1
- package/dist/assets/{index-JA9h4YXr.js → index-6djx-5R6.js} +1 -1
- package/dist/assets/{index-nugxBGaB.js → index-8MsQJXFD.js} +1 -1
- package/dist/assets/index-9lo56i1W.js +57 -0
- package/dist/assets/{index-5q2qBS2A.js → index-9udvO7eN.js} +1 -1
- package/dist/assets/{index-uucW8lyA.js → index-A3qaKAQZ.js} +137 -137
- package/dist/assets/{index-xF6Zrp48.js → index-CFCBI32Y.js} +1 -1
- package/dist/assets/{index-MQ5sCiv0.js → index-F_tmMgba.js} +1 -1
- package/dist/assets/{index-nec3CBP4.js → index-H7NK0Hav.js} +1 -1
- package/dist/assets/{index-dEUBD3Ek.js → index-HH-12DL3.js} +1 -1
- package/dist/assets/{index-mxv-cWe1.js → index-IZZ7I0WA.js} +5 -5
- package/dist/assets/{index-0Pkf3xUv.js → index-PZQWptd6.js} +1 -1
- package/dist/assets/{index-LpR2xL_I.js → index-U0-vaLNC.js} +1 -1
- package/dist/assets/{index-S9D-ycna.js → index-WMg_ZmyK.js} +6 -6
- package/dist/assets/{index-rLUXQvhq.js → index-WdzhUrFb.js} +9 -9
- package/dist/assets/{index-R9oRnky0.js → index-XZuSftjk.js} +1 -1
- package/dist/assets/{index-qJop2tcw.js → index-XsRmOT5P.js} +1 -1
- package/dist/assets/{index-SAJDoXAy.js → index-Z09DYyo5.js} +3 -3
- package/dist/assets/{index-xvy96ScB.js → index-_bZjDFhP.js} +3 -3
- package/dist/assets/{index-wM_dFbiP.js → index-av1Ii_pg.js} +1 -1
- package/dist/assets/{index-7Vx2WCKR.js → index-cFZ_La2w.js} +1 -1
- package/dist/assets/{index-IwH7C-Ko.js → index-fefNq3JS.js} +1 -1
- package/dist/assets/index-fjKBcmH5.js +1 -0
- package/dist/assets/{index-rKkwz9HV.js → index-iY6yR8LR.js} +1 -1
- package/dist/assets/{index-fJ0BL_e2.js → index-m4TSpDqh.js} +1 -1
- package/dist/assets/{index-AaoUHVVG.js → index-wZoARVEY.js} +2 -2
- package/dist/assets/index-yufFTVXz.js +1 -0
- package/dist/assets/{index.es-z1twp67m.js → index.es-vBzWz3O4.js} +2 -2
- package/dist/assets/{index.esm-aWTu2T01.js → index.esm-AY_MiBcV.js} +1 -1
- package/dist/assets/{invitation-XLGa-pmm.js → invitation-3WWriyVt.js} +1 -1
- package/dist/assets/{invite-cKqEzS2M.js → invite-N6dQR5ZR.js} +1 -1
- package/dist/assets/{issue-passport-ILQvH9s3.js → issue-passport-jAawdTqX.js} +1 -1
- package/dist/assets/{jss-plugin-props-sort.esm-UoBHPEWO.js → jss-plugin-props-sort.esm-xdjEY1uR.js} +1 -1
- package/dist/assets/{launch-result-message-9HKjtLws.js → launch-result-message-cX2DdrLk.js} +1 -1
- package/dist/assets/{layout-L6_gNEgb.js → layout-68HwrJKQ.js} +1 -1
- package/dist/assets/{list-header-0W-lcNEo.js → list-header-hSrwFM5U.js} +1 -1
- package/dist/assets/{listItemButtonClasses-NYOJixt3.js → listItemButtonClasses-zLzjLEQ1.js} +1 -1
- package/dist/assets/localization-CAKlYD8P.js +1 -0
- package/dist/assets/{log-pZr6zM4h.js → log-JtMhj2o8.js} +1 -1
- package/dist/assets/{login-P2wJbw6C.js → login-rfrF2Cur.js} +1 -1
- package/dist/assets/{logo-uploader-uogalgrW.js → logo-uploader-ExzbUiFI.js} +3 -3
- package/dist/assets/{lost-passport-mo-weWhq.js → lost-passport-LEWrhtsE.js} +3 -3
- package/dist/assets/{lottie-skotHrQT.js → lottie-G1otoBC8.js} +1 -1
- package/dist/assets/{notifications-PPAwwS3Q.js → notifications-WG7t1uHO.js} +1 -1
- package/dist/assets/{overview-OOHYj1Q3.js → overview-yBfiQBkQ.js} +1 -1
- package/dist/assets/{page-header-zijGZ0Cx.js → page-header-4ASw0dHi.js} +1 -1
- package/dist/assets/{permission-6mOSjcdS.js → permission-DRuKjUv8.js} +1 -1
- package/dist/assets/{preferences-N_0iYWAP.js → preferences-NjSKRtT2.js} +1 -1
- package/dist/assets/publish-resource-NlVYECa8.js +1 -0
- package/dist/assets/{react-1-wuzDEA.js → react-9zU2PV91.js} +3 -3
- package/dist/assets/{selector-ckYcvYGI.js → selector-Dk6vMXQs.js} +3 -3
- package/dist/assets/session--6YbzF22.js +1 -0
- package/dist/assets/{setup-ZPQqv7iq.js → setup-uCg5vw2w.js} +3 -3
- package/dist/assets/{slicedToArray-3_3ts97I.js → slicedToArray-DPB3oHnW.js} +1 -1
- package/dist/assets/{spaces-2TPvVFS1.js → spaces-ckJ3F4TJ.js} +1 -1
- package/dist/assets/{start-0rD0U6t7.js → start-H2I7Lm2C.js} +1 -1
- package/dist/assets/{step-actions-iRZymf2P.js → step-actions-VeAtvDtT.js} +1 -1
- package/dist/assets/{studio-W4Vc_AGz.js → studio-ouCJArpF.js} +1 -1
- package/dist/assets/{styled-xYo1pInp.js → styled-0kjic46e.js} +1 -1
- package/dist/assets/{switch-control--QORsX6_.js → switch-control-dx-J5AXO.js} +1 -1
- package/dist/assets/{toUpper-q-l4gWRl.js → toUpper-cifwXOtQ.js} +1 -1
- package/dist/assets/{transfer-PhNYj9ZK.js → transfer-E04XdHU6.js} +1 -1
- package/dist/assets/{uniqBy-l9QHyf00.js → uniqBy-2Vt9UR0B.js} +1 -1
- package/dist/assets/{unsubscribe-FUenmxnt.js → unsubscribe-iO8zsaz8.js} +1 -1
- package/dist/assets/{use-blocklet-info-for-connect-did-spaces-V6x21iaX.js → use-blocklet-info-for-connect-did-spaces-mNvG04f3.js} +1 -1
- package/dist/assets/{useAsync-sivFle8p.js → useAsync-zNEgPETV.js} +1 -1
- package/dist/assets/{useLocalStorage-BhVXzkpi.js → useLocalStorage-XI5ozNRv.js} +1 -1
- package/dist/assets/{useMediaQuery-vIbaAqXb.js → useMediaQuery-mRt2C6pY.js} +1 -1
- package/dist/assets/{useSetState-8jGDsuv3.js → useSetState-Uk84-eN2.js} +1 -1
- package/dist/assets/{useSlotProps-1tP3JLmt.js → useSlotProps-ov-tJvVD.js} +1 -1
- package/dist/assets/useTheme-2SjM2dAw.js +1 -0
- package/dist/assets/user-center-hP5WNwoA.js +1 -0
- package/dist/assets/{util-HUv70eWD.js → util-v8NIXura.js} +1 -1
- package/dist/assets/{wrap-locale-wqIa2Ntp.js → wrap-locale-DICshMp9.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/service-worker.js +1 -1
- package/package.json +23 -23
- package/dist/assets/Box-w0hFB2y0.js +0 -1
- package/dist/assets/Box-wX7WNHof.js +0 -1
- package/dist/assets/add-resource-MJ63NHNw.js +0 -1
- package/dist/assets/api-OOifZ58k.js +0 -1
- package/dist/assets/connect-eXeZUYKc.js +0 -1
- package/dist/assets/home-0llsKSBK.js +0 -1
- package/dist/assets/index-aw1T-I5M.js +0 -57
- package/dist/assets/index-eB9Ifmty.js +0 -1
- package/dist/assets/index-jWqA6yOs.js +0 -1
- package/dist/assets/localization-kcWeWxhs.js +0 -1
- package/dist/assets/publish-resource-GJWeIB7T.js +0 -1
- package/dist/assets/session-dO7Ct3kg.js +0 -1
- package/dist/assets/useTheme-E3mdEt0J.js +0 -1
- package/dist/assets/user-center-W3YE5xaW.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var Be=Object.defineProperty;var ze=(t,e,n)=>e in t?Be(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var tt=(t,e,n)=>(ze(t,typeof e!="symbol"?e+"":e,n),n);import{g as Pt,a as Tt,Q as lt,
|
|
1
|
+
var Be=Object.defineProperty;var ze=(t,e,n)=>e in t?Be(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var tt=(t,e,n)=>(ze(t,typeof e!="symbol"?e+"":e,n),n);import{g as Pt,a as Tt,Q as lt,cH as ae,cM as He,_ as P,d as M,r as I,U as Lt,f as st,cN as B,aG as le,W as ue,j as h,h as z,i as jt,ch as Ve,cO as zt,P as d,$ as De,t as Ge,bu as Ue,bv as Ht,ct as Qe,co as We,cP as Ze,br as Je,Z as k,cQ as Ye,Y as Xe,cR as Ke,R as tn,cS as en,a6 as nn,cT as on,bK as de,l as fe,aD as sn,a5 as rn,a7 as cn}from"./index-A3qaKAQZ.js";import{D as an}from"./index-av1Ii_pg.js";import{L as ln}from"./selector-Dk6vMXQs.js";function un(t){return Tt("MuiListItem",t)}const dn=Pt("MuiListItem",["root","container","focusVisible","dense","alignItemsFlexStart","disabled","divider","gutters","padding","button","secondaryAction","selected"]),F=dn;function fn(t){return Tt("MuiListItemButton",t)}const pn=Pt("MuiListItemButton",["root","focusVisible","dense","alignItemsFlexStart","disabled","divider","gutters","selected"]),q=pn,hn=["alignItems","autoFocus","component","children","dense","disableGutters","divider","focusVisibleClassName","selected","className"],gn=(t,e)=>{const{ownerState:n}=t;return[e.root,n.dense&&e.dense,n.alignItems==="flex-start"&&e.alignItemsFlexStart,n.divider&&e.divider,!n.disableGutters&&e.gutters]},mn=t=>{const{alignItems:e,classes:n,dense:s,disabled:o,disableGutters:r,divider:i,selected:a}=t,l=jt({root:["root",s&&"dense",!r&&"gutters",i&&"divider",o&&"disabled",e==="flex-start"&&"alignItemsFlexStart",a&&"selected"]},fn,n);return P({},n,l)},bn=lt(ae,{shouldForwardProp:t=>He(t)||t==="classes",name:"MuiListItemButton",slot:"Root",overridesResolver:gn})(({theme:t,ownerState:e})=>P({display:"flex",flexGrow:1,justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minWidth:0,boxSizing:"border-box",textAlign:"left",paddingTop:8,paddingBottom:8,transition:t.transitions.create("background-color",{duration:t.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:(t.vars||t).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${q.selected}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:M(t.palette.primary.main,t.palette.action.selectedOpacity),[`&.${q.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.focusOpacity}))`:M(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)}},[`&.${q.selected}:hover`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:M(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:M(t.palette.primary.main,t.palette.action.selectedOpacity)}},[`&.${q.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},[`&.${q.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity}},e.divider&&{borderBottom:`1px solid ${(t.vars||t).palette.divider}`,backgroundClip:"padding-box"},e.alignItems==="flex-start"&&{alignItems:"flex-start"},!e.disableGutters&&{paddingLeft:16,paddingRight:16},e.dense&&{paddingTop:4,paddingBottom:4})),yn=I.forwardRef(function(e,n){const s=Lt({props:e,name:"MuiListItemButton"}),{alignItems:o="center",autoFocus:r=!1,component:i="div",children:a,dense:c=!1,disableGutters:l=!1,divider:u=!1,focusVisibleClassName:f,selected:p=!1,className:m}=s,b=st(s,hn),x=I.useContext(B),w=I.useMemo(()=>({dense:c||x.dense||!1,alignItems:o,disableGutters:l}),[o,x.dense,c,l]),T=I.useRef(null);le(()=>{r&&T.current&&T.current.focus()},[r]);const v=P({},s,{alignItems:o,dense:w.dense,disableGutters:l,divider:u,selected:p}),y=mn(v),R=ue(T,n);return h.jsx(B.Provider,{value:w,children:h.jsx(bn,P({ref:R,href:b.href||b.to,component:(b.href||b.to)&&i==="div"?"button":i,focusVisibleClassName:z(y.focusVisible,f),ownerState:v,className:z(y.root,m)},b,{classes:y,children:a}))})}),xn=yn;function vn(t){return Tt("MuiListItemSecondaryAction",t)}Pt("MuiListItemSecondaryAction",["root","disableGutters"]);const In=["className"],wn=t=>{const{disableGutters:e,classes:n}=t;return jt({root:["root",e&&"disableGutters"]},vn,n)},Cn=lt("div",{name:"MuiListItemSecondaryAction",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.disableGutters&&e.disableGutters]}})(({ownerState:t})=>P({position:"absolute",right:16,top:"50%",transform:"translateY(-50%)"},t.disableGutters&&{right:0})),pe=I.forwardRef(function(e,n){const s=Lt({props:e,name:"MuiListItemSecondaryAction"}),{className:o}=s,r=st(s,In),i=I.useContext(B),a=P({},s,{disableGutters:i.disableGutters}),c=wn(a);return h.jsx(Cn,P({className:z(c.root,o),ownerState:a,ref:n},r))});pe.muiName="ListItemSecondaryAction";const Sn=pe,An=["className"],Pn=["alignItems","autoFocus","button","children","className","component","components","componentsProps","ContainerComponent","ContainerProps","dense","disabled","disableGutters","disablePadding","divider","focusVisibleClassName","secondaryAction","selected","slotProps","slots"],Tn=(t,e)=>{const{ownerState:n}=t;return[e.root,n.dense&&e.dense,n.alignItems==="flex-start"&&e.alignItemsFlexStart,n.divider&&e.divider,!n.disableGutters&&e.gutters,!n.disablePadding&&e.padding,n.button&&e.button,n.hasSecondaryAction&&e.secondaryAction]},Ln=t=>{const{alignItems:e,button:n,classes:s,dense:o,disabled:r,disableGutters:i,disablePadding:a,divider:c,hasSecondaryAction:l,selected:u}=t;return jt({root:["root",o&&"dense",!i&&"gutters",!a&&"padding",c&&"divider",r&&"disabled",n&&"button",e==="flex-start"&&"alignItemsFlexStart",l&&"secondaryAction",u&&"selected"],container:["container"]},un,s)},jn=lt("div",{name:"MuiListItem",slot:"Root",overridesResolver:Tn})(({theme:t,ownerState:e})=>P({display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",width:"100%",boxSizing:"border-box",textAlign:"left"},!e.disablePadding&&P({paddingTop:8,paddingBottom:8},e.dense&&{paddingTop:4,paddingBottom:4},!e.disableGutters&&{paddingLeft:16,paddingRight:16},!!e.secondaryAction&&{paddingRight:48}),!!e.secondaryAction&&{[`& > .${q.root}`]:{paddingRight:48}},{[`&.${F.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},[`&.${F.selected}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:M(t.palette.primary.main,t.palette.action.selectedOpacity),[`&.${F.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.focusOpacity}))`:M(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)}},[`&.${F.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity}},e.alignItems==="flex-start"&&{alignItems:"flex-start"},e.divider&&{borderBottom:`1px solid ${(t.vars||t).palette.divider}`,backgroundClip:"padding-box"},e.button&&{transition:t.transitions.create("background-color",{duration:t.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:(t.vars||t).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${F.selected}:hover`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:M(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:M(t.palette.primary.main,t.palette.action.selectedOpacity)}}},e.hasSecondaryAction&&{paddingRight:48})),kn=lt("li",{name:"MuiListItem",slot:"Container",overridesResolver:(t,e)=>e.container})({position:"relative"}),Rn=I.forwardRef(function(e,n){const s=Lt({props:e,name:"MuiListItem"}),{alignItems:o="center",autoFocus:r=!1,button:i=!1,children:a,className:c,component:l,components:u={},componentsProps:f={},ContainerComponent:p="li",ContainerProps:{className:m}={},dense:b=!1,disabled:x=!1,disableGutters:w=!1,disablePadding:T=!1,divider:v=!1,focusVisibleClassName:y,secondaryAction:R,selected:C=!1,slotProps:g={},slots:S={}}=s,L=st(s.ContainerProps,An),A=st(s,Pn),j=I.useContext(B),ft=I.useMemo(()=>({dense:b||j.dense||!1,alignItems:o,disableGutters:w}),[o,j.dense,b,w]),pt=I.useRef(null);le(()=>{r&&pt.current&&pt.current.focus()},[r]);const E=I.Children.toArray(a),Ft=E.length&&Ve(E[E.length-1],["ListItemSecondaryAction"]),X=P({},s,{alignItems:o,autoFocus:r,button:i,dense:ft.dense,disabled:x,disableGutters:w,disablePadding:T,divider:v,hasSecondaryAction:Ft,selected:C}),qt=Ln(X),Bt=ue(pt,n),K=S.root||u.Root||jn,H=g.root||f.root||{},N=P({className:z(qt.root,H.className,c),disabled:x},A);let _=l||"li";return i&&(N.component=l||"div",N.focusVisibleClassName=z(F.focusVisible,y),_=ae),Ft?(_=!N.component&&!l?"div":_,p==="li"&&(_==="li"?_="div":N.component==="li"&&(N.component="div")),h.jsx(B.Provider,{value:ft,children:h.jsxs(kn,P({as:p,className:z(qt.container,m),ref:Bt,ownerState:X},L,{children:[h.jsx(K,P({},H,!zt(K)&&{as:_,ownerState:P({},X,H.ownerState)},N,{children:E})),E.pop()]}))})):h.jsx(B.Provider,{value:ft,children:h.jsxs(K,P({},H,{as:_,ref:Bt},!zt(K)&&{ownerState:P({},X,H.ownerState)},N,{children:[E,R&&h.jsx(Sn,{children:R})]}))})}),Mn=Rn;/**
|
|
2
2
|
* (c) Iconify
|
|
3
3
|
*
|
|
4
4
|
* For the full copyright and license information, please view the license.txt
|
|
@@ -8,10 +8,10 @@ var Be=Object.defineProperty;var ze=(t,e,n)=>e in t?Be(t,e,{enumerable:!0,config
|
|
|
8
8
|
*
|
|
9
9
|
* @license MIT
|
|
10
10
|
* @version 1.0.8
|
|
11
|
-
*/const he=Object.freeze({left:0,top:0,width:16,height:16}),rt=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),Z=Object.freeze({...he,...rt}),yt=Object.freeze({...Z,body:"",hidden:!1}),On=Object.freeze({width:null,height:null}),ge=Object.freeze({...On,...rt});function Nn(t,e=0){const n=t.replace(/^-?[0-9.]*/,"");function s(o){for(;o<0;)o+=4;return o%4}if(n===""){const o=parseInt(t);return isNaN(o)?0:s(o)}else if(n!==t){let o=0;switch(n){case"%":o=25;break;case"deg":o=90}if(o){let r=parseFloat(t.slice(0,t.length-n.length));return isNaN(r)?0:(r=r/o,r%1===0?s(r):0)}}return e}const _n=/[\s,]+/;function $n(t,e){e.split(_n).forEach(n=>{switch(n.trim()){case"horizontal":t.hFlip=!0;break;case"vertical":t.vFlip=!0;break}})}const me={...ge,preserveAspectRatio:""};function Vt(t){const e={...me},n=(s,o)=>t.getAttribute(s)||o;return e.width=n("width",null),e.height=n("height",null),e.rotate=Nn(n("rotate","")),$n(e,n("flip","")),e.preserveAspectRatio=n("preserveAspectRatio",n("preserveaspectratio","")),e}function En(t,e){for(const n in me)if(t[n]!==e[n])return!0;return!1}const D=/^[a-z0-9]+(-[a-z0-9]+)*$/,J=(t,e,n,s="")=>{const o=t.split(":");if(t.slice(0,1)==="@"){if(o.length<2||o.length>3)return null;s=o.shift().slice(1)}if(o.length>3||!o.length)return null;if(o.length>1){const a=o.pop(),c=o.pop(),l={provider:o.length>0?o[0]:s,prefix:c,name:a};return e&&!nt(l)?null:l}const r=o[0],i=r.split("-");if(i.length>1){const a={provider:s,prefix:i.shift(),name:i.join("-")};return e&&!nt(a)?null:a}if(n&&s===""){const a={provider:s,prefix:"",name:r};return e&&!nt(a,n)?null:a}return null},nt=(t,e)=>t?!!((t.provider===""||t.provider.match(D))&&(e&&t.prefix===""||t.prefix.match(D))&&t.name.match(D)):!1;function Fn(t,e){const n={};!t.hFlip!=!e.hFlip&&(n.hFlip=!0),!t.vFlip!=!e.vFlip&&(n.vFlip=!0);const s=((t.rotate||0)+(e.rotate||0))%4;return s&&(n.rotate=s),n}function Dt(t,e){const n=Fn(t,e);for(const s in yt)s in rt?s in t&&!(s in n)&&(n[s]=rt[s]):s in e?n[s]=e[s]:s in t&&(n[s]=t[s]);return n}function qn(t,e){const n=t.icons,s=t.aliases||Object.create(null),o=Object.create(null);function r(i){if(n[i])return o[i]=[];if(!(i in o)){o[i]=null;const a=s[i]&&s[i].parent,c=a&&r(a);c&&(o[i]=[a].concat(c))}return o[i]}return(e||Object.keys(n).concat(Object.keys(s))).forEach(r),o}function Bn(t,e,n){const s=t.icons,o=t.aliases||Object.create(null);let r={};function i(a){r=Dt(s[a]||o[a],r)}return i(e),n.forEach(i),Dt(t,r)}function be(t,e){const n=[];if(typeof t!="object"||typeof t.icons!="object")return n;t.not_found instanceof Array&&t.not_found.forEach(o=>{e(o,null),n.push(o)});const s=qn(t);for(const o in s){const r=s[o];r&&(e(o,Bn(t,o,r)),n.push(o))}return n}const zn={provider:"",aliases:{},not_found:{},...he};function ht(t,e){for(const n in e)if(n in t&&typeof t[n]!=typeof e[n])return!1;return!0}function ye(t){if(typeof t!="object"||t===null)return null;const e=t;if(typeof e.prefix!="string"||!t.icons||typeof t.icons!="object"||!ht(t,zn))return null;const n=e.icons;for(const o in n){const r=n[o];if(!o.match(D)||typeof r.body!="string"||!ht(r,yt))return null}const s=e.aliases||Object.create(null);for(const o in s){const r=s[o],i=r.parent;if(!o.match(D)||typeof i!="string"||!n[i]&&!s[i]||!ht(r,yt))return null}return e}const it=Object.create(null);function Hn(t,e){return{provider:t,prefix:e,icons:Object.create(null),missing:new Set}}function O(t,e){const n=it[t]||(it[t]=Object.create(null));return n[e]||(n[e]=Hn(t,e))}function kt(t,e){return ye(e)?be(e,(n,s)=>{s?t.icons[n]=s:t.missing.add(n)}):[]}function Vn(t,e,n){try{if(typeof n.body=="string")return t.icons[e]={...n},!0}catch{}return!1}function Dn(t,e){let n=[];return(typeof t=="string"?[t]:Object.keys(it)).forEach(o=>{(typeof o=="string"&&typeof e=="string"?[e]:Object.keys(it[o]||{})).forEach(i=>{const a=O(o,i);n=n.concat(Object.keys(a.icons).map(c=>(o!==""?"@"+o+":":"")+i+":"+c))})}),n}let U=!1;function xe(t){return typeof t=="boolean"&&(U=t),U}function Q(t){const e=typeof t=="string"?J(t,!0,U):t;if(e){const n=O(e.provider,e.prefix),s=e.name;return n.icons[s]||(n.missing.has(s)?null:void 0)}}function ve(t,e){const n=J(t,!0,U);if(!n)return!1;const s=O(n.provider,n.prefix);return Vn(s,n.name,e)}function Gt(t,e){if(typeof t!="object")return!1;if(typeof e!="string"&&(e=t.provider||""),U&&!e&&!t.prefix){let o=!1;return ye(t)&&(t.prefix="",be(t,(r,i)=>{i&&ve(r,i)&&(o=!0)})),o}const n=t.prefix;if(!nt({provider:e,prefix:n,name:"a"}))return!1;const s=O(e,n);return!!kt(s,t)}function Gn(t){return!!Q(t)}function Un(t){const e=Q(t);return e?{...Z,...e}:null}function Qn(t){const e={loaded:[],missing:[],pending:[]},n=Object.create(null);t.sort((o,r)=>o.provider!==r.provider?o.provider.localeCompare(r.provider):o.prefix!==r.prefix?o.prefix.localeCompare(r.prefix):o.name.localeCompare(r.name));let s={provider:"",prefix:"",name:""};return t.forEach(o=>{if(s.name===o.name&&s.prefix===o.prefix&&s.provider===o.provider)return;s=o;const r=o.provider,i=o.prefix,a=o.name,c=n[r]||(n[r]=Object.create(null)),l=c[i]||(c[i]=O(r,i));let u;a in l.icons?u=e.loaded:i===""||l.missing.has(a)?u=e.missing:u=e.pending;const f={provider:r,prefix:i,name:a};u.push(f)}),e}function Ie(t,e){t.forEach(n=>{const s=n.loaderCallbacks;s&&(n.loaderCallbacks=s.filter(o=>o.id!==e))})}function Wn(t){t.pendingCallbacksFlag||(t.pendingCallbacksFlag=!0,setTimeout(()=>{t.pendingCallbacksFlag=!1;const e=t.loaderCallbacks?t.loaderCallbacks.slice(0):[];if(!e.length)return;let n=!1;const s=t.provider,o=t.prefix;e.forEach(r=>{const i=r.icons,a=i.pending.length;i.pending=i.pending.filter(c=>{if(c.prefix!==o)return!0;const l=c.name;if(t.icons[l])i.loaded.push({provider:s,prefix:o,name:l});else if(t.missing.has(l))i.missing.push({provider:s,prefix:o,name:l});else return n=!0,!0;return!1}),i.pending.length!==a&&(n||Ie([t],r.id),r.callback(i.loaded.slice(0),i.missing.slice(0),i.pending.slice(0),r.abort))})}))}let Zn=0;function Jn(t,e,n){const s=Zn++,o=Ie.bind(null,n,s);if(!e.pending.length)return o;const r={id:s,icons:e,callback:t,abort:o};return n.forEach(i=>{(i.loaderCallbacks||(i.loaderCallbacks=[])).push(r)}),o}const xt=Object.create(null);function Ut(t,e){xt[t]=e}function vt(t){return xt[t]||xt[""]}function Yn(t,e=!0,n=!1){const s=[];return t.forEach(o=>{const r=typeof o=="string"?J(o,e,n):o;r&&s.push(r)}),s}var Xn={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function Kn(t,e,n,s){const o=t.resources.length,r=t.random?Math.floor(Math.random()*o):t.index;let i;if(t.random){let g=t.resources.slice(0);for(i=[];g.length>1;){const S=Math.floor(Math.random()*g.length);i.push(g[S]),g=g.slice(0,S).concat(g.slice(S+1))}i=i.concat(g)}else i=t.resources.slice(r).concat(t.resources.slice(0,r));const a=Date.now();let c="pending",l=0,u,f=null,p=[],m=[];typeof s=="function"&&m.push(s);function b(){f&&(clearTimeout(f),f=null)}function x(){c==="pending"&&(c="aborted"),b(),p.forEach(g=>{g.status==="pending"&&(g.status="aborted")}),p=[]}function w(g,S){S&&(m=[]),typeof g=="function"&&m.push(g)}function T(){return{startTime:a,payload:e,status:c,queriesSent:l,queriesPending:p.length,subscribe:w,abort:x}}function v(){c="failed",m.forEach(g=>{g(void 0,u)})}function y(){p.forEach(g=>{g.status==="pending"&&(g.status="aborted")}),p=[]}function R(g,S,L){const A=S!=="success";switch(p=p.filter(j=>j!==g),c){case"pending":break;case"failed":if(A||!t.dataAfterTimeout)return;break;default:return}if(S==="abort"){u=L,v();return}if(A){u=L,p.length||(i.length?C():v());return}if(b(),y(),!t.random){const j=t.resources.indexOf(g.resource);j!==-1&&j!==t.index&&(t.index=j)}c="completed",m.forEach(j=>{j(L)})}function C(){if(c!=="pending")return;b();const g=i.shift();if(g===void 0){if(p.length){f=setTimeout(()=>{b(),c==="pending"&&(y(),v())},t.timeout);return}v();return}const S={status:"pending",resource:g,callback:(L,A)=>{R(S,L,A)}};p.push(S),l++,f=setTimeout(C,t.rotate),n(g,e,S.callback)}return setTimeout(C),T}function we(t){const e={...Xn,...t};let n=[];function s(){n=n.filter(a=>a().status==="pending")}function o(a,c,l){const u=Kn(e,a,c,(f,p)=>{s(),l&&l(f,p)});return n.push(u),u}function r(a){return n.find(c=>a(c))||null}return{query:o,find:r,setIndex:a=>{e.index=a},getIndex:()=>e.index,cleanup:s}}function Rt(t){let e;if(typeof t.resources=="string")e=[t.resources];else if(e=t.resources,!(e instanceof Array)||!e.length)return null;return{resources:e,path:t.path||"/",maxURL:t.maxURL||500,rotate:t.rotate||750,timeout:t.timeout||5e3,random:t.random===!0,index:t.index||0,dataAfterTimeout:t.dataAfterTimeout!==!1}}const ut=Object.create(null),V=["https://api.simplesvg.com","https://api.unisvg.com"],ot=[];for(;V.length>0;)V.length===1||Math.random()>.5?ot.push(V.shift()):ot.push(V.pop());ut[""]=Rt({resources:["https://api.iconify.design"].concat(ot)});function Qt(t,e){const n=Rt(e);return n===null?!1:(ut[t]=n,!0)}function dt(t){return ut[t]}function to(){return Object.keys(ut)}function Wt(){}const gt=Object.create(null);function eo(t){if(!gt[t]){const e=dt(t);if(!e)return;const n=we(e),s={config:e,redundancy:n};gt[t]=s}return gt[t]}function Ce(t,e,n){let s,o;if(typeof t=="string"){const r=vt(t);if(!r)return n(void 0,424),Wt;o=r.send;const i=eo(t);i&&(s=i.redundancy)}else{const r=Rt(t);if(r){s=we(r);const i=t.resources?t.resources[0]:"",a=vt(i);a&&(o=a.send)}}return!s||!o?(n(void 0,424),Wt):s.query(e,o,n)().abort}const Zt="iconify2",W="iconify",Se=W+"-count",Jt=W+"-version",Ae=36e5,no=168;function It(t,e){try{return t.getItem(e)}catch{}}function Mt(t,e,n){try{return t.setItem(e,n),!0}catch{}}function Yt(t,e){try{t.removeItem(e)}catch{}}function wt(t,e){return Mt(t,Se,e.toString())}function Ct(t){return parseInt(It(t,Se))||0}const $={local:!0,session:!0},Pe={local:new Set,session:new Set};let Ot=!1;function oo(t){Ot=t}let et=typeof window>"u"?{}:window;function Te(t){const e=t+"Storage";try{if(et&&et[e]&&typeof et[e].length=="number")return et[e]}catch{}$[t]=!1}function Le(t,e){const n=Te(t);if(!n)return;const s=It(n,Jt);if(s!==Zt){if(s){const a=Ct(n);for(let c=0;c<a;c++)Yt(n,W+c.toString())}Mt(n,Jt,Zt),wt(n,0);return}const o=Math.floor(Date.now()/Ae)-no,r=a=>{const c=W+a.toString(),l=It(n,c);if(typeof l=="string"){try{const u=JSON.parse(l);if(typeof u=="object"&&typeof u.cached=="number"&&u.cached>o&&typeof u.provider=="string"&&typeof u.data=="object"&&typeof u.data.prefix=="string"&&e(u,a))return!0}catch{}Yt(n,c)}};let i=Ct(n);for(let a=i-1;a>=0;a--)r(a)||(a===i-1?(i--,wt(n,i)):Pe[t].add(a))}function je(){if(!Ot){oo(!0);for(const t in $)Le(t,e=>{const n=e.data,s=e.provider,o=n.prefix,r=O(s,o);if(!kt(r,n).length)return!1;const i=n.lastModified||-1;return r.lastModifiedCached=r.lastModifiedCached?Math.min(r.lastModifiedCached,i):i,!0})}}function so(t,e){const n=t.lastModifiedCached;if(n&&n>=e)return n===e;if(t.lastModifiedCached=e,n)for(const s in $)Le(s,o=>{const r=o.data;return o.provider!==t.provider||r.prefix!==t.prefix||r.lastModified===e});return!0}function ro(t,e){Ot||je();function n(s){let o;if(!$[s]||!(o=Te(s)))return;const r=Pe[s];let i;if(r.size)r.delete(i=Array.from(r).shift());else if(i=Ct(o),!wt(o,i+1))return;const a={cached:Math.floor(Date.now()/Ae),provider:t.provider,data:e};return Mt(o,W+i.toString(),JSON.stringify(a))}e.lastModified&&!so(t,e.lastModified)||Object.keys(e.icons).length&&(e.not_found&&(e=Object.assign({},e),delete e.not_found),n("local")||n("session"))}function Xt(){}function io(t){t.iconsLoaderFlag||(t.iconsLoaderFlag=!0,setTimeout(()=>{t.iconsLoaderFlag=!1,Wn(t)}))}function co(t,e){t.iconsToLoad?t.iconsToLoad=t.iconsToLoad.concat(e).sort():t.iconsToLoad=e,t.iconsQueueFlag||(t.iconsQueueFlag=!0,setTimeout(()=>{t.iconsQueueFlag=!1;const{provider:n,prefix:s}=t,o=t.iconsToLoad;delete t.iconsToLoad;let r;if(!o||!(r=vt(n)))return;r.prepare(n,s,o).forEach(a=>{Ce(n,a,c=>{if(typeof c!="object")a.icons.forEach(l=>{t.missing.add(l)});else try{const l=kt(t,c);if(!l.length)return;const u=t.pendingIcons;u&&l.forEach(f=>{u.delete(f)}),ro(t,c)}catch(l){console.error(l)}io(t)})})}))}const Nt=(t,e)=>{const n=Yn(t,!0,xe()),s=Qn(n);if(!s.pending.length){let c=!0;return e&&setTimeout(()=>{c&&e(s.loaded,s.missing,s.pending,Xt)}),()=>{c=!1}}const o=Object.create(null),r=[];let i,a;return s.pending.forEach(c=>{const{provider:l,prefix:u}=c;if(u===a&&l===i)return;i=l,a=u,r.push(O(l,u));const f=o[l]||(o[l]=Object.create(null));f[u]||(f[u]=[])}),s.pending.forEach(c=>{const{provider:l,prefix:u,name:f}=c,p=O(l,u),m=p.pendingIcons||(p.pendingIcons=new Set);m.has(f)||(m.add(f),o[l][u].push(f))}),r.forEach(c=>{const{provider:l,prefix:u}=c;o[l][u].length&&co(c,o[l][u])}),e?Jn(e,s,r):Xt},ao=t=>new Promise((e,n)=>{const s=typeof t=="string"?J(t,!0):t;if(!s){n(t);return}Nt([s||t],o=>{if(o.length&&s){const r=Q(s);if(r){e({...Z,...r});return}}n(t)})});function lo(t){try{const e=typeof t=="string"?JSON.parse(t):t;if(typeof e.body=="string")return{...e}}catch{}}function uo(t,e){const n=typeof t=="string"?J(t,!0,!0):null;if(!n){const r=lo(t);return{value:t,data:r}}const s=Q(n);if(s!==void 0||!n.prefix)return{value:t,name:n,data:s};const o=Nt([n],()=>e(t,n,Q(n)));return{value:t,name:n,loading:o}}function mt(t){return t.hasAttribute("inline")}let ke=!1;try{ke=navigator.vendor.indexOf("Apple")===0}catch{}function fo(t,e){switch(e){case"svg":case"bg":case"mask":return e}return e!=="style"&&(ke||t.indexOf("<a")===-1)?"svg":t.indexOf("currentColor")===-1?"bg":"mask"}const po=/(-?[0-9.]*[0-9]+[0-9.]*)/g,ho=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function St(t,e,n){if(e===1)return t;if(n=n||100,typeof t=="number")return Math.ceil(t*e*n)/n;if(typeof t!="string")return t;const s=t.split(po);if(s===null||!s.length)return t;const o=[];let r=s.shift(),i=ho.test(r);for(;;){if(i){const a=parseFloat(r);isNaN(a)?o.push(r):o.push(Math.ceil(a*e*n)/n)}else o.push(r);if(r=s.shift(),r===void 0)return o.join("");i=!i}}const go=t=>t==="unset"||t==="undefined"||t==="none";function Re(t,e){const n={...Z,...t},s={...ge,...e},o={left:n.left,top:n.top,width:n.width,height:n.height};let r=n.body;[n,s].forEach(b=>{const x=[],w=b.hFlip,T=b.vFlip;let v=b.rotate;w?T?v+=2:(x.push("translate("+(o.width+o.left).toString()+" "+(0-o.top).toString()+")"),x.push("scale(-1 1)"),o.top=o.left=0):T&&(x.push("translate("+(0-o.left).toString()+" "+(o.height+o.top).toString()+")"),x.push("scale(1 -1)"),o.top=o.left=0);let y;switch(v<0&&(v-=Math.floor(v/4)*4),v=v%4,v){case 1:y=o.height/2+o.top,x.unshift("rotate(90 "+y.toString()+" "+y.toString()+")");break;case 2:x.unshift("rotate(180 "+(o.width/2+o.left).toString()+" "+(o.height/2+o.top).toString()+")");break;case 3:y=o.width/2+o.left,x.unshift("rotate(-90 "+y.toString()+" "+y.toString()+")");break}v%2===1&&(o.left!==o.top&&(y=o.left,o.left=o.top,o.top=y),o.width!==o.height&&(y=o.width,o.width=o.height,o.height=y)),x.length&&(r='<g transform="'+x.join(" ")+'">'+r+"</g>")});const i=s.width,a=s.height,c=o.width,l=o.height;let u,f;i===null?(f=a===null?"1em":a==="auto"?l:a,u=St(f,c/l)):(u=i==="auto"?c:i,f=a===null?St(u,l/c):a==="auto"?l:a);const p={},m=(b,x)=>{go(x)||(p[b]=x.toString())};return m("width",u),m("height",f),p.viewBox=o.left.toString()+" "+o.top.toString()+" "+c.toString()+" "+l.toString(),{attributes:p,body:r}}const mo=()=>{let t;try{if(t=fetch,typeof t=="function")return t}catch{}};let ct=mo();function bo(t){ct=t}function yo(){return ct}function xo(t,e){const n=dt(t);if(!n)return 0;let s;if(!n.maxURL)s=0;else{let o=0;n.resources.forEach(i=>{o=Math.max(o,i.length)});const r=e+".json?icons=";s=n.maxURL-o-n.path.length-r.length}return s}function vo(t){return t===404}const Io=(t,e,n)=>{const s=[],o=xo(t,e),r="icons";let i={type:r,provider:t,prefix:e,icons:[]},a=0;return n.forEach((c,l)=>{a+=c.length+1,a>=o&&l>0&&(s.push(i),i={type:r,provider:t,prefix:e,icons:[]},a=c.length),i.icons.push(c)}),s.push(i),s};function wo(t){if(typeof t=="string"){const e=dt(t);if(e)return e.path}return"/"}const Co=(t,e,n)=>{if(!ct){n("abort",424);return}let s=wo(e.provider);switch(e.type){case"icons":{const r=e.prefix,a=e.icons.join(","),c=new URLSearchParams({icons:a});s+=r+".json?"+c.toString();break}case"custom":{const r=e.uri;s+=r.slice(0,1)==="/"?r.slice(1):r;break}default:n("abort",400);return}let o=503;ct(t+s).then(r=>{const i=r.status;if(i!==200){setTimeout(()=>{n(vo(i)?"abort":"next",i)});return}return o=501,r.json()}).then(r=>{if(typeof r!="object"||r===null){setTimeout(()=>{r===404?n("abort",r):n("next",o)});return}setTimeout(()=>{n("success",r)})}).catch(()=>{n("next",o)})},So={prepare:Io,send:Co};function Kt(t,e){switch(t){case"local":case"session":$[t]=e;break;case"all":for(const n in $)$[n]=e;break}}const bt="data-style";let Me="";function Ao(t){Me=t}function te(t,e){let n=Array.from(t.childNodes).find(s=>s.hasAttribute&&s.hasAttribute(bt));n||(n=document.createElement("style"),n.setAttribute(bt,bt),t.appendChild(n)),n.textContent=":host{display:inline-block;vertical-align:"+(e?"-0.125em":"0")+"}span,svg{display:block}"+Me}function Oe(){Ut("",So),xe(!0);let t;try{t=window}catch{}if(t){if(je(),t.IconifyPreload!==void 0){const n=t.IconifyPreload,s="Invalid IconifyPreload syntax.";typeof n=="object"&&n!==null&&(n instanceof Array?n:[n]).forEach(o=>{try{(typeof o!="object"||o===null||o instanceof Array||typeof o.icons!="object"||typeof o.prefix!="string"||!Gt(o))&&console.error(s)}catch{console.error(s)}})}if(t.IconifyProviders!==void 0){const n=t.IconifyProviders;if(typeof n=="object"&&n!==null)for(const s in n){const o="IconifyProviders["+s+"] is invalid.";try{const r=n[s];if(typeof r!="object"||!r||r.resources===void 0)continue;Qt(s,r)||console.error(o)}catch{console.error(o)}}}}return{enableCache:n=>Kt(n,!0),disableCache:n=>Kt(n,!1),iconExists:Gn,getIcon:Un,listIcons:Dn,addIcon:ve,addCollection:Gt,calculateSize:St,buildIcon:Re,loadIcons:Nt,loadIcon:ao,addAPIProvider:Qt,appendCustomStyle:Ao,_api:{getAPIConfig:dt,setAPIModule:Ut,sendAPIQuery:Ce,setFetch:bo,getFetch:yo,listAPIProviders:to}}}function Ne(t,e){let n=t.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const s in e)n+=" "+s+'="'+e[s]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+n+">"+t+"</svg>"}function Po(t){return t.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}function To(t){return"data:image/svg+xml,"+Po(t)}function Lo(t){return'url("'+To(t)+'")'}const At={"background-color":"currentColor"},_e={"background-color":"transparent"},ee={image:"var(--svg)",repeat:"no-repeat",size:"100% 100%"},ne={"-webkit-mask":At,mask:At,background:_e};for(const t in ne){const e=ne[t];for(const n in ee)e[t+"-"+n]=ee[n]}function oe(t){return t?t+(t.match(/^[-0-9.]+$/)?"px":""):"inherit"}function jo(t,e,n){const s=document.createElement("span");let o=t.body;o.indexOf("<a")!==-1&&(o+="<!-- "+Date.now()+" -->");const r=t.attributes,i=Ne(o,{...r,width:e.width+"",height:e.height+""}),a=Lo(i),c=s.style,l={"--svg":a,width:oe(r.width),height:oe(r.height),...n?At:_e};for(const u in l)c.setProperty(u,l[u]);return s}let G;function ko(){try{G=window.trustedTypes.createPolicy("iconify",{createHTML:t=>t})}catch{G=null}}function Ro(t){return G===void 0&&ko(),G?G.createHTML(t):t}function Mo(t){const e=document.createElement("span"),n=t.attributes;let s="";n.width||(s="width: inherit;"),n.height||(s+="height: inherit;"),s&&(n.style=s);const o=Ne(t.body,n);return e.innerHTML=Ro(o),e.firstChild}function se(t,e){const n=e.icon.data,s=e.customisations,o=Re(n,s);s.preserveAspectRatio&&(o.attributes.preserveAspectRatio=s.preserveAspectRatio);const r=e.renderedMode;let i;switch(r){case"svg":i=Mo(o);break;default:i=jo(o,{...Z,...n},r==="mask")}const a=Array.from(t.childNodes).find(c=>{const l=c.tagName&&c.tagName.toUpperCase();return l==="SPAN"||l==="SVG"});a?i.tagName==="SPAN"&&a.tagName===i.tagName?a.setAttribute("style",i.getAttribute("style")):t.replaceChild(i,a):t.appendChild(i)}function re(t,e,n){const s=n&&(n.rendered?n:n.lastRender);return{rendered:!1,inline:e,icon:t,lastRender:s}}function Oo(t="iconify-icon"){let e,n;try{e=window.customElements,n=window.HTMLElement}catch{return}if(!e||!n)return;const s=e.get(t);if(s)return s;const o=["icon","mode","inline","width","height","rotate","flip"],r=class extends n{constructor(){super();tt(this,"_shadowRoot");tt(this,"_state");tt(this,"_checkQueued",!1);const c=this._shadowRoot=this.attachShadow({mode:"open"}),l=mt(this);te(c,l),this._state=re({value:""},l),this._queueCheck()}static get observedAttributes(){return o.slice(0)}attributeChangedCallback(c){if(c==="inline"){const l=mt(this),u=this._state;l!==u.inline&&(u.inline=l,te(this._shadowRoot,l))}else this._queueCheck()}get icon(){const c=this.getAttribute("icon");if(c&&c.slice(0,1)==="{")try{return JSON.parse(c)}catch{}return c}set icon(c){typeof c=="object"&&(c=JSON.stringify(c)),this.setAttribute("icon",c)}get inline(){return mt(this)}set inline(c){c?this.setAttribute("inline","true"):this.removeAttribute("inline")}restartAnimation(){const c=this._state;if(c.rendered){const l=this._shadowRoot;if(c.renderedMode==="svg")try{l.lastChild.setCurrentTime(0);return}catch{}se(l,c)}}get status(){const c=this._state;return c.rendered?"rendered":c.icon.data===null?"failed":"loading"}_queueCheck(){this._checkQueued||(this._checkQueued=!0,setTimeout(()=>{this._check()}))}_check(){if(!this._checkQueued)return;this._checkQueued=!1;const c=this._state,l=this.getAttribute("icon");if(l!==c.icon.value){this._iconChanged(l);return}if(!c.rendered)return;const u=this.getAttribute("mode"),f=Vt(this);(c.attrMode!==u||En(c.customisations,f))&&this._renderIcon(c.icon,f,u)}_iconChanged(c){const l=uo(c,(u,f,p)=>{const m=this._state;if(m.rendered||this.getAttribute("icon")!==u)return;const b={value:u,name:f,data:p};b.data?this._gotIconData(b):m.icon=b});l.data?this._gotIconData(l):this._state=re(l,this._state.inline,this._state)}_gotIconData(c){this._checkQueued=!1,this._renderIcon(c,Vt(this),this.getAttribute("mode"))}_renderIcon(c,l,u){const f=fo(c.data.body,u),p=this._state.inline;se(this._shadowRoot,this._state={rendered:!0,icon:c,inline:p,customisations:l,attrMode:u,renderedMode:f})}};o.forEach(a=>{a in r.prototype||Object.defineProperty(r.prototype,a,{get:function(){return this.getAttribute(a)},set:function(c){c!==null?this.setAttribute(a,c):this.removeAttribute(a)}})});const i=Oe();for(const a in i)r[a]=r.prototype[a]=i[a];return e.define(t,r),r}Oo()||Oe();const No=d.shape({appLogo:d.node,appName:d.string,theme:d.shape({background:d.string}),enableConnect:d.bool,enableLocale:d.bool,navigation:d.arrayOf(d.shape({title:d.oneOfType([d.string,d.object]),link:d.oneOfType([d.string,d.object]),icon:d.string,items:d.arrayOf(d.shape({title:d.oneOfType([d.string,d.object]),link:d.oneOfType([d.string,d.object])}))}))}),$e=d.shape({showText:d.bool,showRole:d.bool,switchDid:d.bool,switchProfile:d.bool,switchPassport:d.bool,disableLogout:d.bool,onLogin:d.func,onLogout:d.func,onSwitchDid:d.func,onSwitchProfile:d.func,onSwitchPassport:d.func,menu:d.array,menuRender:d.func,dark:d.bool,size:d.number}),Y=(t,e,n="children")=>t.map(s=>Array.isArray(s[n])?e({...s,[n]:Y(s[n],e,n)}):e(s)),_o=(t,e="children")=>{const n=[];return Y(t,s=>n.push(s),e),n},_t=(t,e,n="children")=>t.map(s=>({...s})).filter(s=>{const o=s[n];if(Array.isArray(o)){const i=_t(o,e,n);s[n]=i!=null&&i.length?i:void 0}const r={filteredChildren:s[n],isLeaf:!(o!=null&&o.length)};return e(s,r)}),$o=t=>/^https?:\/\//.test(t),Yo=t=>/^[\w-]+:[\w-]+$/.test(t),Eo=t=>{if(!t||!(t!=null&&t.startsWith("/")))return!1;const e=o=>o.endsWith("/")?o:`${o}/`,n=e(window.location.pathname),s=e(new URL(t,window.location.origin).pathname);return n.startsWith(s)},Fo=(t=[])=>{const e=t.map((s,o)=>({path:s,index:o})).filter(s=>Eo(s.path));return e!=null&&e.length?e.slice(1).reduce((s,o)=>s.path.length>=o.path.length?s:o,e[0]).index:-1};var ie,ce;const at=((ie=window==null?void 0:window.blocklet)==null?void 0:ie.groupPrefix)||((ce=window==null?void 0:window.blocklet)==null?void 0:ce.prefix)||"/",qo=t=>{const e={...t},n=t==null?void 0:t.background;return typeof n=="string"?e.background={header:n,footer:n,default:n}:n&&typeof n=="object"&&(e.background={header:n.header||n.default,footer:n.footer||n.default,default:n.default}),e},Ee=(t,e="en")=>{if(!(t!=null&&t.length))return t;const n=(o,r)=>typeof o=="string"?o:typeof o=="object"?o[r]||(o==null?void 0:o.en)||(o==null?void 0:o.zh):o,s=(o,r)=>{if(typeof o=="string"){if($o(o)){const a=new URL(o);return a.searchParams.set("locale",r),a.href}const i=new URL(o,window.location.origin);return i.searchParams.set("locale",r),i.pathname+i.search}return typeof o=="object"?o[r]||(o==null?void 0:o.en)||(o==null?void 0:o.zh):o};return Y(t,o=>{var r;return{...o,title:n(o.title,e),link:(r=o.items)!=null&&r.length?o.link:s(o.link,e),_rawLink:o.link}},"items")},Bo=t=>Y(t,e=>e.role?{...e,role:Array.isArray(e.role)?e.role:[e.role]}:e,"items"),zo=t=>{if(!(t!=null&&t.length))return null;const e=Bo(t),n={header:[],footer:[],social:[],bottom:[],dashboard:[],sessionManager:[],userCenter:[]};return e.forEach(s=>{var o;s.section?Array.isArray(s.section)?s.section.forEach(r=>{var i;(i=n[r])==null||i.push(s)}):typeof s.section=="string"&&((o=n[s.section])==null||o.push(s)):n.header.push(s)}),n},Ho=t=>{if(!t)return null;const e={...t};return e.theme=qo(e.theme),e.navigation=zo(Vo(e.navigation)),e},Vo=(t=[])=>_t(t,(e,n)=>{var s;return!!e.link||((s=n.filteredChildren)==null?void 0:s.length)},"items"),Fe=(t,e)=>_t(t,(n,s)=>{var r;const o=!n.role||e&&n.role.includes(e);return s.isLeaf?o:o&&((r=s.filteredChildren)==null?void 0:r.length)},"items"),Do={top:-960,width:960,height:960,body:'<path fill="currentColor" d="M510-600v-210q0-12.75 8.625-21.375T540-840h270q12.75 0 21.375 8.625T840-810v210q0 12.75-8.625 21.375T810-570H540q-12.75 0-21.375-8.625T510-600M120-480v-330q0-12.75 8.625-21.375T150-840h270q12.75 0 21.375 8.625T450-810v330q0 12.75-8.625 21.375T420-450H150q-12.75 0-21.375-8.625T120-480m390 330v-330q0-12.75 8.625-21.375T540-510h270q12.75 0 21.375 8.625T840-480v330q0 12.75-8.625 21.375T810-120H540q-12.75 0-21.375-8.625T510-150m-390 0v-210q0-12.75 8.625-21.375T150-390h270q12.75 0 21.375 8.625T450-360v210q0 12.75-8.625 21.375T420-120H150q-12.75 0-21.375-8.625T120-150m60-360h210v-270H180zm390 330h210v-270H570zm0-450h210v-150H570zM180-180h210v-150H180zm210-150"/>'},Go={width:24,height:24,body:'<path fill="currentColor" d="M15.95 12.3L11.7 8.05q-.15-.15-.212-.325t-.063-.375q0-.2.063-.375t.212-.325l4.25-4.25q.15-.15.325-.212t.375-.063q.2 0 .375.063t.325.212l4.25 4.25q.15.15.213.325t.062.375q0 .2-.063.375t-.212.325l-4.25 4.25q-.15.15-.325.213t-.375.062q-.2 0-.375-.062t-.325-.213ZM3 10V4q0-.425.288-.713T4 3h6q.425 0 .713.288T11 4v6q0 .425-.288.713T10 11H4q-.425 0-.713-.288T3 10Zm10 10v-6q0-.425.288-.713T14 13h6q.425 0 .713.288T21 14v6q0 .425-.288.713T20 21h-6q-.425 0-.713-.288T13 20ZM3 20v-6q0-.425.288-.713T4 13h6q.425 0 .713.288T11 14v6q0 .425-.288.713T10 21H4q-.425 0-.713-.288T3 20ZM5 9h4V5H5v4Zm11.675 1.2L19.5 7.375L16.675 4.55L13.85 7.375l2.825 2.825ZM15 19h4v-4h-4v4ZM5 19h4v-4H5v4ZM9 9Zm4.85-1.625ZM9 15Zm6 0Z"/>'};function $t({session:t,locale:e,size:n}){const s=(window==null?void 0:window.blocklet)||{},o=(s.navigation||[]).filter(c=>c.section==="sessionManager"&&!["/sessionManager"].includes(c.id)).filter(c=>{var l;return!!((c==null?void 0:c.role)||[]).includes(((l=t==null?void 0:t.user)==null?void 0:l.role)||"guest")}).map(c=>{const l=((s==null?void 0:s.componentMountPoints)||[]).find(u=>c.component===u.name);return{...c,component:l}}),r=I.useRef(null),i=De({open:!1}),a=Ge((c=!i.open)=>{i.open=c});return o.length===0||!(t!=null&&t.user)?null:h.jsxs(h.Fragment,{children:[h.jsx(Ue,{size:"medium",ref:r,onClick:()=>a(),children:h.jsx(Ht,{icon:Do,fontSize:n,style:{transform:"scale(1.08)"}})}),h.jsx(Qe,{open:i.open,onClose:()=>a(!1),anchorEl:r.current,transition:!0,placement:"bottom-end",sx:{zIndex:1600},children:({TransitionProps:c})=>h.jsx(We,{onClickAway:l=>{l.preventDefault(),l.stopPropagation(),a(!1)},children:h.jsx(Ze,{...c,timeout:350,children:h.jsxs(Je,{variant:"outlined",sx:{borderRadius:3,width:350,maxWidth:"90vw",borderColor:k.lineStep,p:2,border:"0 !important",boxShadow:`0px 8px 16px 0px ${k.gray6}, 0px 0px 0px 1px ${k.gray6}`},children:[h.jsx(Ye,{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fill, 100px)",gridAutoRows:"minmax(100px, max-content)",justifyContent:"space-between",maxHeight:350,overflowY:"auto",p:0},children:o.map(l=>{var u,f;return h.jsx(Mn,{disablePadding:!0,children:h.jsxs(xn,{href:l.link,sx:{p:1,display:"flex",flexDirection:"column",alignItems:"center",gap:1,width:"100%",height:"100%",borderRadius:2,"&:hover":{backgroundColor:k.surfacePrimarySubtitle}},children:[(u=l==null?void 0:l.component)!=null&&u.did?h.jsx(Xe,{component:"img",src:`${Ke}/blocklet/logo-bundle/${l.component.did}`,sx:{borderRadius:2,width:50,height:50,objectFit:"contain"}}):h.jsx(Ht,{fontSize:50,icon:l.icon||Go,color:k.textSubtitle}),h.jsx(tn,{sx:{fontSize:"12px",color:k.textBase,textAlign:"center",lineHeight:"normal"},children:((f=l.title)==null?void 0:f.zh)||l.title})]})},l.id)})}),h.jsx(en,{session:t,children:h.jsx(nn,{variant:"outlined",fullWidth:!0,href:on,sx:{mt:1,borderRadius:2,color:k.textBase,borderColor:k.lineBorderStrong,"&:hover":{color:k.primaryBase,borderColor:k.primaryBase}},children:e==="zh"?"管理":"Manage"})})]})})})})]})}$t.propTypes={session:d.object.isRequired,locale:d.string,size:d.number};$t.defaultProps={locale:"en",size:24};function Et({formattedBlocklet:t,addons:e,sessionManagerProps:n}){var p,m,b,x;const s=I.useContext(de),{locale:o}=fe()||{},{enableConnect:r=!0,enableLocale:i=!0}=t,a=!!((p=s==null?void 0:s.session)!=null&&p.user);let c=Ee((m=t==null?void 0:t.navigation)==null?void 0:m.sessionManager,o)||[];c=Fe(c,(x=(b=s==null?void 0:s.session)==null?void 0:b.user)==null?void 0:x.role);const u=(()=>{if(e&&typeof e!="function")return Array.isArray(e)?e:[e];let w=[];if(i&&o&&w.push(h.jsx(ln,{showText:!1},"locale-selector")),r&&s){const T=[];a&&(c?c.slice(0,5):[]).forEach(y=>{T.push({label:y.title,icon:y.icon?h.jsx("iconify-icon",{icon:y.icon,height:24,style:{marginRight:8}}):null,component:"a",href:y.link,key:y.link})}),w.push(h.jsx($t,{session:s.session,locale:o},"session-blocklet")),w.push(h.jsx(sn,{session:s.session,locale:o,menu:T,showRole:!0,...n},"session-user"))}return typeof e=="function"&&(w=e(w)||[]),w})();return I.createElement(h.Fragment,null,...Array.isArray(u)?u:[u])}Et.propTypes={formattedBlocklet:d.object.isRequired,addons:d.oneOfType([d.func,d.node]),sessionManagerProps:$e};Et.defaultProps={addons:null,sessionManagerProps:{showRole:!0}};const Uo=()=>{const t=rn();I.useEffect(()=>{t.wallet&&cn(()=>import("./index-LTzQUJ4f.js").then(e=>e.i),__vite__mapDeps([0,1,2])).then(e=>{e.call||(e=e.default),e.call("arcHideTopBar","{}")}).catch(e=>{console.error("load dsbridge error",e)})},[t])};function qe({meta:t,fallbackUrl:e,invalidPathFallback:n,headerAddons:s,sessionManagerProps:o,links:r,...i}){var R;Uo();const a=I.useContext(de),c=(R=a==null?void 0:a.session)==null?void 0:R.user,l=c==null?void 0:c.role,{locale:u}=fe()||{},f=I.useMemo(()=>{const C=Object.assign({},window.blocklet,t);try{return Ho(C)}catch(g){return console.error("Failed to format blocklet info",g,C),C}},[t]),{localizedNav:p,flattened:m,matchedIndex:b}=I.useMemo(()=>{var L;let C=Ee((L=f==null?void 0:f.navigation)==null?void 0:L.dashboard,u)||[];C=Fe(C,l),C=Y(C,A=>({title:A.title,url:A.link,icon:A.icon?h.jsx("iconify-icon",{height:"100%",width:"100%",icon:A.icon}):null,external:!0,children:A.items}),"items");const g=_o(C).filter(A=>!!A.url),S=Fo(g.map(A=>A.url));return S!==-1&&(g[S].active=!0),{localizedNav:C,flattened:g,matchedIndex:S}},[f,u,l]),x=typeof r=="function"?r(p):[...p,...r];if(I.useLayoutEffect(()=>{c&&!(m!=null&&m.length)&&e&&(window.location.href=e)},[e]),I.useLayoutEffect(()=>{var C;c&&(m!=null&&m.length)&&b===-1&&(n?n():window.location.href=((C=m[0])==null?void 0:C.url)||at)},[n,m,b]),!f.appName)return null;const{appLogo:w,appLogoRect:T,appName:v}=f,y=h.jsx(Et,{formattedBlocklet:f,addons:s,sessionManagerProps:o});return h.jsx(an,{title:v,fullWidth:!0,sidebarWidth:128,legacy:!1,links:x,...i,headerProps:{homeLink:at,logo:h.jsx("img",{src:T||w,alt:"logo"}),addons:y,...i.headerProps}})}qe.propTypes={meta:No,fallbackUrl:d.string,invalidPathFallback:d.func,headerAddons:d.oneOfType([d.func,d.node]),sessionManagerProps:$e,links:d.oneOfType([d.array,d.func])};qe.defaultProps={meta:{},fallbackUrl:at,invalidPathFallback:null,headerAddons:void 0,sessionManagerProps:{showRole:!0,onLogout:()=>{window.location.href=at}},links:[]};export{qe as D,Et as H,Yo as a,No as b,_o as c,Fo as d,Ho as f,Ee as g,$o as i,Y as m,at as p,$e as s,Uo as u};
|
|
11
|
+
*/const he=Object.freeze({left:0,top:0,width:16,height:16}),rt=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),Z=Object.freeze({...he,...rt}),yt=Object.freeze({...Z,body:"",hidden:!1}),On=Object.freeze({width:null,height:null}),ge=Object.freeze({...On,...rt});function Nn(t,e=0){const n=t.replace(/^-?[0-9.]*/,"");function s(o){for(;o<0;)o+=4;return o%4}if(n===""){const o=parseInt(t);return isNaN(o)?0:s(o)}else if(n!==t){let o=0;switch(n){case"%":o=25;break;case"deg":o=90}if(o){let r=parseFloat(t.slice(0,t.length-n.length));return isNaN(r)?0:(r=r/o,r%1===0?s(r):0)}}return e}const _n=/[\s,]+/;function $n(t,e){e.split(_n).forEach(n=>{switch(n.trim()){case"horizontal":t.hFlip=!0;break;case"vertical":t.vFlip=!0;break}})}const me={...ge,preserveAspectRatio:""};function Vt(t){const e={...me},n=(s,o)=>t.getAttribute(s)||o;return e.width=n("width",null),e.height=n("height",null),e.rotate=Nn(n("rotate","")),$n(e,n("flip","")),e.preserveAspectRatio=n("preserveAspectRatio",n("preserveaspectratio","")),e}function En(t,e){for(const n in me)if(t[n]!==e[n])return!0;return!1}const D=/^[a-z0-9]+(-[a-z0-9]+)*$/,J=(t,e,n,s="")=>{const o=t.split(":");if(t.slice(0,1)==="@"){if(o.length<2||o.length>3)return null;s=o.shift().slice(1)}if(o.length>3||!o.length)return null;if(o.length>1){const a=o.pop(),c=o.pop(),l={provider:o.length>0?o[0]:s,prefix:c,name:a};return e&&!nt(l)?null:l}const r=o[0],i=r.split("-");if(i.length>1){const a={provider:s,prefix:i.shift(),name:i.join("-")};return e&&!nt(a)?null:a}if(n&&s===""){const a={provider:s,prefix:"",name:r};return e&&!nt(a,n)?null:a}return null},nt=(t,e)=>t?!!((t.provider===""||t.provider.match(D))&&(e&&t.prefix===""||t.prefix.match(D))&&t.name.match(D)):!1;function Fn(t,e){const n={};!t.hFlip!=!e.hFlip&&(n.hFlip=!0),!t.vFlip!=!e.vFlip&&(n.vFlip=!0);const s=((t.rotate||0)+(e.rotate||0))%4;return s&&(n.rotate=s),n}function Dt(t,e){const n=Fn(t,e);for(const s in yt)s in rt?s in t&&!(s in n)&&(n[s]=rt[s]):s in e?n[s]=e[s]:s in t&&(n[s]=t[s]);return n}function qn(t,e){const n=t.icons,s=t.aliases||Object.create(null),o=Object.create(null);function r(i){if(n[i])return o[i]=[];if(!(i in o)){o[i]=null;const a=s[i]&&s[i].parent,c=a&&r(a);c&&(o[i]=[a].concat(c))}return o[i]}return(e||Object.keys(n).concat(Object.keys(s))).forEach(r),o}function Bn(t,e,n){const s=t.icons,o=t.aliases||Object.create(null);let r={};function i(a){r=Dt(s[a]||o[a],r)}return i(e),n.forEach(i),Dt(t,r)}function be(t,e){const n=[];if(typeof t!="object"||typeof t.icons!="object")return n;t.not_found instanceof Array&&t.not_found.forEach(o=>{e(o,null),n.push(o)});const s=qn(t);for(const o in s){const r=s[o];r&&(e(o,Bn(t,o,r)),n.push(o))}return n}const zn={provider:"",aliases:{},not_found:{},...he};function ht(t,e){for(const n in e)if(n in t&&typeof t[n]!=typeof e[n])return!1;return!0}function ye(t){if(typeof t!="object"||t===null)return null;const e=t;if(typeof e.prefix!="string"||!t.icons||typeof t.icons!="object"||!ht(t,zn))return null;const n=e.icons;for(const o in n){const r=n[o];if(!o.match(D)||typeof r.body!="string"||!ht(r,yt))return null}const s=e.aliases||Object.create(null);for(const o in s){const r=s[o],i=r.parent;if(!o.match(D)||typeof i!="string"||!n[i]&&!s[i]||!ht(r,yt))return null}return e}const it=Object.create(null);function Hn(t,e){return{provider:t,prefix:e,icons:Object.create(null),missing:new Set}}function O(t,e){const n=it[t]||(it[t]=Object.create(null));return n[e]||(n[e]=Hn(t,e))}function kt(t,e){return ye(e)?be(e,(n,s)=>{s?t.icons[n]=s:t.missing.add(n)}):[]}function Vn(t,e,n){try{if(typeof n.body=="string")return t.icons[e]={...n},!0}catch{}return!1}function Dn(t,e){let n=[];return(typeof t=="string"?[t]:Object.keys(it)).forEach(o=>{(typeof o=="string"&&typeof e=="string"?[e]:Object.keys(it[o]||{})).forEach(i=>{const a=O(o,i);n=n.concat(Object.keys(a.icons).map(c=>(o!==""?"@"+o+":":"")+i+":"+c))})}),n}let U=!1;function xe(t){return typeof t=="boolean"&&(U=t),U}function Q(t){const e=typeof t=="string"?J(t,!0,U):t;if(e){const n=O(e.provider,e.prefix),s=e.name;return n.icons[s]||(n.missing.has(s)?null:void 0)}}function ve(t,e){const n=J(t,!0,U);if(!n)return!1;const s=O(n.provider,n.prefix);return Vn(s,n.name,e)}function Gt(t,e){if(typeof t!="object")return!1;if(typeof e!="string"&&(e=t.provider||""),U&&!e&&!t.prefix){let o=!1;return ye(t)&&(t.prefix="",be(t,(r,i)=>{i&&ve(r,i)&&(o=!0)})),o}const n=t.prefix;if(!nt({provider:e,prefix:n,name:"a"}))return!1;const s=O(e,n);return!!kt(s,t)}function Gn(t){return!!Q(t)}function Un(t){const e=Q(t);return e?{...Z,...e}:null}function Qn(t){const e={loaded:[],missing:[],pending:[]},n=Object.create(null);t.sort((o,r)=>o.provider!==r.provider?o.provider.localeCompare(r.provider):o.prefix!==r.prefix?o.prefix.localeCompare(r.prefix):o.name.localeCompare(r.name));let s={provider:"",prefix:"",name:""};return t.forEach(o=>{if(s.name===o.name&&s.prefix===o.prefix&&s.provider===o.provider)return;s=o;const r=o.provider,i=o.prefix,a=o.name,c=n[r]||(n[r]=Object.create(null)),l=c[i]||(c[i]=O(r,i));let u;a in l.icons?u=e.loaded:i===""||l.missing.has(a)?u=e.missing:u=e.pending;const f={provider:r,prefix:i,name:a};u.push(f)}),e}function Ie(t,e){t.forEach(n=>{const s=n.loaderCallbacks;s&&(n.loaderCallbacks=s.filter(o=>o.id!==e))})}function Wn(t){t.pendingCallbacksFlag||(t.pendingCallbacksFlag=!0,setTimeout(()=>{t.pendingCallbacksFlag=!1;const e=t.loaderCallbacks?t.loaderCallbacks.slice(0):[];if(!e.length)return;let n=!1;const s=t.provider,o=t.prefix;e.forEach(r=>{const i=r.icons,a=i.pending.length;i.pending=i.pending.filter(c=>{if(c.prefix!==o)return!0;const l=c.name;if(t.icons[l])i.loaded.push({provider:s,prefix:o,name:l});else if(t.missing.has(l))i.missing.push({provider:s,prefix:o,name:l});else return n=!0,!0;return!1}),i.pending.length!==a&&(n||Ie([t],r.id),r.callback(i.loaded.slice(0),i.missing.slice(0),i.pending.slice(0),r.abort))})}))}let Zn=0;function Jn(t,e,n){const s=Zn++,o=Ie.bind(null,n,s);if(!e.pending.length)return o;const r={id:s,icons:e,callback:t,abort:o};return n.forEach(i=>{(i.loaderCallbacks||(i.loaderCallbacks=[])).push(r)}),o}const xt=Object.create(null);function Ut(t,e){xt[t]=e}function vt(t){return xt[t]||xt[""]}function Yn(t,e=!0,n=!1){const s=[];return t.forEach(o=>{const r=typeof o=="string"?J(o,e,n):o;r&&s.push(r)}),s}var Xn={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function Kn(t,e,n,s){const o=t.resources.length,r=t.random?Math.floor(Math.random()*o):t.index;let i;if(t.random){let g=t.resources.slice(0);for(i=[];g.length>1;){const S=Math.floor(Math.random()*g.length);i.push(g[S]),g=g.slice(0,S).concat(g.slice(S+1))}i=i.concat(g)}else i=t.resources.slice(r).concat(t.resources.slice(0,r));const a=Date.now();let c="pending",l=0,u,f=null,p=[],m=[];typeof s=="function"&&m.push(s);function b(){f&&(clearTimeout(f),f=null)}function x(){c==="pending"&&(c="aborted"),b(),p.forEach(g=>{g.status==="pending"&&(g.status="aborted")}),p=[]}function w(g,S){S&&(m=[]),typeof g=="function"&&m.push(g)}function T(){return{startTime:a,payload:e,status:c,queriesSent:l,queriesPending:p.length,subscribe:w,abort:x}}function v(){c="failed",m.forEach(g=>{g(void 0,u)})}function y(){p.forEach(g=>{g.status==="pending"&&(g.status="aborted")}),p=[]}function R(g,S,L){const A=S!=="success";switch(p=p.filter(j=>j!==g),c){case"pending":break;case"failed":if(A||!t.dataAfterTimeout)return;break;default:return}if(S==="abort"){u=L,v();return}if(A){u=L,p.length||(i.length?C():v());return}if(b(),y(),!t.random){const j=t.resources.indexOf(g.resource);j!==-1&&j!==t.index&&(t.index=j)}c="completed",m.forEach(j=>{j(L)})}function C(){if(c!=="pending")return;b();const g=i.shift();if(g===void 0){if(p.length){f=setTimeout(()=>{b(),c==="pending"&&(y(),v())},t.timeout);return}v();return}const S={status:"pending",resource:g,callback:(L,A)=>{R(S,L,A)}};p.push(S),l++,f=setTimeout(C,t.rotate),n(g,e,S.callback)}return setTimeout(C),T}function we(t){const e={...Xn,...t};let n=[];function s(){n=n.filter(a=>a().status==="pending")}function o(a,c,l){const u=Kn(e,a,c,(f,p)=>{s(),l&&l(f,p)});return n.push(u),u}function r(a){return n.find(c=>a(c))||null}return{query:o,find:r,setIndex:a=>{e.index=a},getIndex:()=>e.index,cleanup:s}}function Rt(t){let e;if(typeof t.resources=="string")e=[t.resources];else if(e=t.resources,!(e instanceof Array)||!e.length)return null;return{resources:e,path:t.path||"/",maxURL:t.maxURL||500,rotate:t.rotate||750,timeout:t.timeout||5e3,random:t.random===!0,index:t.index||0,dataAfterTimeout:t.dataAfterTimeout!==!1}}const ut=Object.create(null),V=["https://api.simplesvg.com","https://api.unisvg.com"],ot=[];for(;V.length>0;)V.length===1||Math.random()>.5?ot.push(V.shift()):ot.push(V.pop());ut[""]=Rt({resources:["https://api.iconify.design"].concat(ot)});function Qt(t,e){const n=Rt(e);return n===null?!1:(ut[t]=n,!0)}function dt(t){return ut[t]}function to(){return Object.keys(ut)}function Wt(){}const gt=Object.create(null);function eo(t){if(!gt[t]){const e=dt(t);if(!e)return;const n=we(e),s={config:e,redundancy:n};gt[t]=s}return gt[t]}function Ce(t,e,n){let s,o;if(typeof t=="string"){const r=vt(t);if(!r)return n(void 0,424),Wt;o=r.send;const i=eo(t);i&&(s=i.redundancy)}else{const r=Rt(t);if(r){s=we(r);const i=t.resources?t.resources[0]:"",a=vt(i);a&&(o=a.send)}}return!s||!o?(n(void 0,424),Wt):s.query(e,o,n)().abort}const Zt="iconify2",W="iconify",Se=W+"-count",Jt=W+"-version",Ae=36e5,no=168;function It(t,e){try{return t.getItem(e)}catch{}}function Mt(t,e,n){try{return t.setItem(e,n),!0}catch{}}function Yt(t,e){try{t.removeItem(e)}catch{}}function wt(t,e){return Mt(t,Se,e.toString())}function Ct(t){return parseInt(It(t,Se))||0}const $={local:!0,session:!0},Pe={local:new Set,session:new Set};let Ot=!1;function oo(t){Ot=t}let et=typeof window>"u"?{}:window;function Te(t){const e=t+"Storage";try{if(et&&et[e]&&typeof et[e].length=="number")return et[e]}catch{}$[t]=!1}function Le(t,e){const n=Te(t);if(!n)return;const s=It(n,Jt);if(s!==Zt){if(s){const a=Ct(n);for(let c=0;c<a;c++)Yt(n,W+c.toString())}Mt(n,Jt,Zt),wt(n,0);return}const o=Math.floor(Date.now()/Ae)-no,r=a=>{const c=W+a.toString(),l=It(n,c);if(typeof l=="string"){try{const u=JSON.parse(l);if(typeof u=="object"&&typeof u.cached=="number"&&u.cached>o&&typeof u.provider=="string"&&typeof u.data=="object"&&typeof u.data.prefix=="string"&&e(u,a))return!0}catch{}Yt(n,c)}};let i=Ct(n);for(let a=i-1;a>=0;a--)r(a)||(a===i-1?(i--,wt(n,i)):Pe[t].add(a))}function je(){if(!Ot){oo(!0);for(const t in $)Le(t,e=>{const n=e.data,s=e.provider,o=n.prefix,r=O(s,o);if(!kt(r,n).length)return!1;const i=n.lastModified||-1;return r.lastModifiedCached=r.lastModifiedCached?Math.min(r.lastModifiedCached,i):i,!0})}}function so(t,e){const n=t.lastModifiedCached;if(n&&n>=e)return n===e;if(t.lastModifiedCached=e,n)for(const s in $)Le(s,o=>{const r=o.data;return o.provider!==t.provider||r.prefix!==t.prefix||r.lastModified===e});return!0}function ro(t,e){Ot||je();function n(s){let o;if(!$[s]||!(o=Te(s)))return;const r=Pe[s];let i;if(r.size)r.delete(i=Array.from(r).shift());else if(i=Ct(o),!wt(o,i+1))return;const a={cached:Math.floor(Date.now()/Ae),provider:t.provider,data:e};return Mt(o,W+i.toString(),JSON.stringify(a))}e.lastModified&&!so(t,e.lastModified)||Object.keys(e.icons).length&&(e.not_found&&(e=Object.assign({},e),delete e.not_found),n("local")||n("session"))}function Xt(){}function io(t){t.iconsLoaderFlag||(t.iconsLoaderFlag=!0,setTimeout(()=>{t.iconsLoaderFlag=!1,Wn(t)}))}function co(t,e){t.iconsToLoad?t.iconsToLoad=t.iconsToLoad.concat(e).sort():t.iconsToLoad=e,t.iconsQueueFlag||(t.iconsQueueFlag=!0,setTimeout(()=>{t.iconsQueueFlag=!1;const{provider:n,prefix:s}=t,o=t.iconsToLoad;delete t.iconsToLoad;let r;if(!o||!(r=vt(n)))return;r.prepare(n,s,o).forEach(a=>{Ce(n,a,c=>{if(typeof c!="object")a.icons.forEach(l=>{t.missing.add(l)});else try{const l=kt(t,c);if(!l.length)return;const u=t.pendingIcons;u&&l.forEach(f=>{u.delete(f)}),ro(t,c)}catch(l){console.error(l)}io(t)})})}))}const Nt=(t,e)=>{const n=Yn(t,!0,xe()),s=Qn(n);if(!s.pending.length){let c=!0;return e&&setTimeout(()=>{c&&e(s.loaded,s.missing,s.pending,Xt)}),()=>{c=!1}}const o=Object.create(null),r=[];let i,a;return s.pending.forEach(c=>{const{provider:l,prefix:u}=c;if(u===a&&l===i)return;i=l,a=u,r.push(O(l,u));const f=o[l]||(o[l]=Object.create(null));f[u]||(f[u]=[])}),s.pending.forEach(c=>{const{provider:l,prefix:u,name:f}=c,p=O(l,u),m=p.pendingIcons||(p.pendingIcons=new Set);m.has(f)||(m.add(f),o[l][u].push(f))}),r.forEach(c=>{const{provider:l,prefix:u}=c;o[l][u].length&&co(c,o[l][u])}),e?Jn(e,s,r):Xt},ao=t=>new Promise((e,n)=>{const s=typeof t=="string"?J(t,!0):t;if(!s){n(t);return}Nt([s||t],o=>{if(o.length&&s){const r=Q(s);if(r){e({...Z,...r});return}}n(t)})});function lo(t){try{const e=typeof t=="string"?JSON.parse(t):t;if(typeof e.body=="string")return{...e}}catch{}}function uo(t,e){const n=typeof t=="string"?J(t,!0,!0):null;if(!n){const r=lo(t);return{value:t,data:r}}const s=Q(n);if(s!==void 0||!n.prefix)return{value:t,name:n,data:s};const o=Nt([n],()=>e(t,n,Q(n)));return{value:t,name:n,loading:o}}function mt(t){return t.hasAttribute("inline")}let ke=!1;try{ke=navigator.vendor.indexOf("Apple")===0}catch{}function fo(t,e){switch(e){case"svg":case"bg":case"mask":return e}return e!=="style"&&(ke||t.indexOf("<a")===-1)?"svg":t.indexOf("currentColor")===-1?"bg":"mask"}const po=/(-?[0-9.]*[0-9]+[0-9.]*)/g,ho=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function St(t,e,n){if(e===1)return t;if(n=n||100,typeof t=="number")return Math.ceil(t*e*n)/n;if(typeof t!="string")return t;const s=t.split(po);if(s===null||!s.length)return t;const o=[];let r=s.shift(),i=ho.test(r);for(;;){if(i){const a=parseFloat(r);isNaN(a)?o.push(r):o.push(Math.ceil(a*e*n)/n)}else o.push(r);if(r=s.shift(),r===void 0)return o.join("");i=!i}}const go=t=>t==="unset"||t==="undefined"||t==="none";function Re(t,e){const n={...Z,...t},s={...ge,...e},o={left:n.left,top:n.top,width:n.width,height:n.height};let r=n.body;[n,s].forEach(b=>{const x=[],w=b.hFlip,T=b.vFlip;let v=b.rotate;w?T?v+=2:(x.push("translate("+(o.width+o.left).toString()+" "+(0-o.top).toString()+")"),x.push("scale(-1 1)"),o.top=o.left=0):T&&(x.push("translate("+(0-o.left).toString()+" "+(o.height+o.top).toString()+")"),x.push("scale(1 -1)"),o.top=o.left=0);let y;switch(v<0&&(v-=Math.floor(v/4)*4),v=v%4,v){case 1:y=o.height/2+o.top,x.unshift("rotate(90 "+y.toString()+" "+y.toString()+")");break;case 2:x.unshift("rotate(180 "+(o.width/2+o.left).toString()+" "+(o.height/2+o.top).toString()+")");break;case 3:y=o.width/2+o.left,x.unshift("rotate(-90 "+y.toString()+" "+y.toString()+")");break}v%2===1&&(o.left!==o.top&&(y=o.left,o.left=o.top,o.top=y),o.width!==o.height&&(y=o.width,o.width=o.height,o.height=y)),x.length&&(r='<g transform="'+x.join(" ")+'">'+r+"</g>")});const i=s.width,a=s.height,c=o.width,l=o.height;let u,f;i===null?(f=a===null?"1em":a==="auto"?l:a,u=St(f,c/l)):(u=i==="auto"?c:i,f=a===null?St(u,l/c):a==="auto"?l:a);const p={},m=(b,x)=>{go(x)||(p[b]=x.toString())};return m("width",u),m("height",f),p.viewBox=o.left.toString()+" "+o.top.toString()+" "+c.toString()+" "+l.toString(),{attributes:p,body:r}}const mo=()=>{let t;try{if(t=fetch,typeof t=="function")return t}catch{}};let ct=mo();function bo(t){ct=t}function yo(){return ct}function xo(t,e){const n=dt(t);if(!n)return 0;let s;if(!n.maxURL)s=0;else{let o=0;n.resources.forEach(i=>{o=Math.max(o,i.length)});const r=e+".json?icons=";s=n.maxURL-o-n.path.length-r.length}return s}function vo(t){return t===404}const Io=(t,e,n)=>{const s=[],o=xo(t,e),r="icons";let i={type:r,provider:t,prefix:e,icons:[]},a=0;return n.forEach((c,l)=>{a+=c.length+1,a>=o&&l>0&&(s.push(i),i={type:r,provider:t,prefix:e,icons:[]},a=c.length),i.icons.push(c)}),s.push(i),s};function wo(t){if(typeof t=="string"){const e=dt(t);if(e)return e.path}return"/"}const Co=(t,e,n)=>{if(!ct){n("abort",424);return}let s=wo(e.provider);switch(e.type){case"icons":{const r=e.prefix,a=e.icons.join(","),c=new URLSearchParams({icons:a});s+=r+".json?"+c.toString();break}case"custom":{const r=e.uri;s+=r.slice(0,1)==="/"?r.slice(1):r;break}default:n("abort",400);return}let o=503;ct(t+s).then(r=>{const i=r.status;if(i!==200){setTimeout(()=>{n(vo(i)?"abort":"next",i)});return}return o=501,r.json()}).then(r=>{if(typeof r!="object"||r===null){setTimeout(()=>{r===404?n("abort",r):n("next",o)});return}setTimeout(()=>{n("success",r)})}).catch(()=>{n("next",o)})},So={prepare:Io,send:Co};function Kt(t,e){switch(t){case"local":case"session":$[t]=e;break;case"all":for(const n in $)$[n]=e;break}}const bt="data-style";let Me="";function Ao(t){Me=t}function te(t,e){let n=Array.from(t.childNodes).find(s=>s.hasAttribute&&s.hasAttribute(bt));n||(n=document.createElement("style"),n.setAttribute(bt,bt),t.appendChild(n)),n.textContent=":host{display:inline-block;vertical-align:"+(e?"-0.125em":"0")+"}span,svg{display:block}"+Me}function Oe(){Ut("",So),xe(!0);let t;try{t=window}catch{}if(t){if(je(),t.IconifyPreload!==void 0){const n=t.IconifyPreload,s="Invalid IconifyPreload syntax.";typeof n=="object"&&n!==null&&(n instanceof Array?n:[n]).forEach(o=>{try{(typeof o!="object"||o===null||o instanceof Array||typeof o.icons!="object"||typeof o.prefix!="string"||!Gt(o))&&console.error(s)}catch{console.error(s)}})}if(t.IconifyProviders!==void 0){const n=t.IconifyProviders;if(typeof n=="object"&&n!==null)for(const s in n){const o="IconifyProviders["+s+"] is invalid.";try{const r=n[s];if(typeof r!="object"||!r||r.resources===void 0)continue;Qt(s,r)||console.error(o)}catch{console.error(o)}}}}return{enableCache:n=>Kt(n,!0),disableCache:n=>Kt(n,!1),iconExists:Gn,getIcon:Un,listIcons:Dn,addIcon:ve,addCollection:Gt,calculateSize:St,buildIcon:Re,loadIcons:Nt,loadIcon:ao,addAPIProvider:Qt,appendCustomStyle:Ao,_api:{getAPIConfig:dt,setAPIModule:Ut,sendAPIQuery:Ce,setFetch:bo,getFetch:yo,listAPIProviders:to}}}function Ne(t,e){let n=t.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const s in e)n+=" "+s+'="'+e[s]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+n+">"+t+"</svg>"}function Po(t){return t.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}function To(t){return"data:image/svg+xml,"+Po(t)}function Lo(t){return'url("'+To(t)+'")'}const At={"background-color":"currentColor"},_e={"background-color":"transparent"},ee={image:"var(--svg)",repeat:"no-repeat",size:"100% 100%"},ne={"-webkit-mask":At,mask:At,background:_e};for(const t in ne){const e=ne[t];for(const n in ee)e[t+"-"+n]=ee[n]}function oe(t){return t?t+(t.match(/^[-0-9.]+$/)?"px":""):"inherit"}function jo(t,e,n){const s=document.createElement("span");let o=t.body;o.indexOf("<a")!==-1&&(o+="<!-- "+Date.now()+" -->");const r=t.attributes,i=Ne(o,{...r,width:e.width+"",height:e.height+""}),a=Lo(i),c=s.style,l={"--svg":a,width:oe(r.width),height:oe(r.height),...n?At:_e};for(const u in l)c.setProperty(u,l[u]);return s}let G;function ko(){try{G=window.trustedTypes.createPolicy("iconify",{createHTML:t=>t})}catch{G=null}}function Ro(t){return G===void 0&&ko(),G?G.createHTML(t):t}function Mo(t){const e=document.createElement("span"),n=t.attributes;let s="";n.width||(s="width: inherit;"),n.height||(s+="height: inherit;"),s&&(n.style=s);const o=Ne(t.body,n);return e.innerHTML=Ro(o),e.firstChild}function se(t,e){const n=e.icon.data,s=e.customisations,o=Re(n,s);s.preserveAspectRatio&&(o.attributes.preserveAspectRatio=s.preserveAspectRatio);const r=e.renderedMode;let i;switch(r){case"svg":i=Mo(o);break;default:i=jo(o,{...Z,...n},r==="mask")}const a=Array.from(t.childNodes).find(c=>{const l=c.tagName&&c.tagName.toUpperCase();return l==="SPAN"||l==="SVG"});a?i.tagName==="SPAN"&&a.tagName===i.tagName?a.setAttribute("style",i.getAttribute("style")):t.replaceChild(i,a):t.appendChild(i)}function re(t,e,n){const s=n&&(n.rendered?n:n.lastRender);return{rendered:!1,inline:e,icon:t,lastRender:s}}function Oo(t="iconify-icon"){let e,n;try{e=window.customElements,n=window.HTMLElement}catch{return}if(!e||!n)return;const s=e.get(t);if(s)return s;const o=["icon","mode","inline","width","height","rotate","flip"],r=class extends n{constructor(){super();tt(this,"_shadowRoot");tt(this,"_state");tt(this,"_checkQueued",!1);const c=this._shadowRoot=this.attachShadow({mode:"open"}),l=mt(this);te(c,l),this._state=re({value:""},l),this._queueCheck()}static get observedAttributes(){return o.slice(0)}attributeChangedCallback(c){if(c==="inline"){const l=mt(this),u=this._state;l!==u.inline&&(u.inline=l,te(this._shadowRoot,l))}else this._queueCheck()}get icon(){const c=this.getAttribute("icon");if(c&&c.slice(0,1)==="{")try{return JSON.parse(c)}catch{}return c}set icon(c){typeof c=="object"&&(c=JSON.stringify(c)),this.setAttribute("icon",c)}get inline(){return mt(this)}set inline(c){c?this.setAttribute("inline","true"):this.removeAttribute("inline")}restartAnimation(){const c=this._state;if(c.rendered){const l=this._shadowRoot;if(c.renderedMode==="svg")try{l.lastChild.setCurrentTime(0);return}catch{}se(l,c)}}get status(){const c=this._state;return c.rendered?"rendered":c.icon.data===null?"failed":"loading"}_queueCheck(){this._checkQueued||(this._checkQueued=!0,setTimeout(()=>{this._check()}))}_check(){if(!this._checkQueued)return;this._checkQueued=!1;const c=this._state,l=this.getAttribute("icon");if(l!==c.icon.value){this._iconChanged(l);return}if(!c.rendered)return;const u=this.getAttribute("mode"),f=Vt(this);(c.attrMode!==u||En(c.customisations,f))&&this._renderIcon(c.icon,f,u)}_iconChanged(c){const l=uo(c,(u,f,p)=>{const m=this._state;if(m.rendered||this.getAttribute("icon")!==u)return;const b={value:u,name:f,data:p};b.data?this._gotIconData(b):m.icon=b});l.data?this._gotIconData(l):this._state=re(l,this._state.inline,this._state)}_gotIconData(c){this._checkQueued=!1,this._renderIcon(c,Vt(this),this.getAttribute("mode"))}_renderIcon(c,l,u){const f=fo(c.data.body,u),p=this._state.inline;se(this._shadowRoot,this._state={rendered:!0,icon:c,inline:p,customisations:l,attrMode:u,renderedMode:f})}};o.forEach(a=>{a in r.prototype||Object.defineProperty(r.prototype,a,{get:function(){return this.getAttribute(a)},set:function(c){c!==null?this.setAttribute(a,c):this.removeAttribute(a)}})});const i=Oe();for(const a in i)r[a]=r.prototype[a]=i[a];return e.define(t,r),r}Oo()||Oe();const No=d.shape({appLogo:d.node,appName:d.string,theme:d.shape({background:d.string}),enableConnect:d.bool,enableLocale:d.bool,navigation:d.arrayOf(d.shape({title:d.oneOfType([d.string,d.object]),link:d.oneOfType([d.string,d.object]),icon:d.string,items:d.arrayOf(d.shape({title:d.oneOfType([d.string,d.object]),link:d.oneOfType([d.string,d.object])}))}))}),$e=d.shape({showText:d.bool,showRole:d.bool,switchDid:d.bool,switchProfile:d.bool,switchPassport:d.bool,disableLogout:d.bool,onLogin:d.func,onLogout:d.func,onSwitchDid:d.func,onSwitchProfile:d.func,onSwitchPassport:d.func,menu:d.array,menuRender:d.func,dark:d.bool,size:d.number}),Y=(t,e,n="children")=>t.map(s=>Array.isArray(s[n])?e({...s,[n]:Y(s[n],e,n)}):e(s)),_o=(t,e="children")=>{const n=[];return Y(t,s=>n.push(s),e),n},_t=(t,e,n="children")=>t.map(s=>({...s})).filter(s=>{const o=s[n];if(Array.isArray(o)){const i=_t(o,e,n);s[n]=i!=null&&i.length?i:void 0}const r={filteredChildren:s[n],isLeaf:!(o!=null&&o.length)};return e(s,r)}),$o=t=>/^https?:\/\//.test(t),Yo=t=>/^[\w-]+:[\w-]+$/.test(t),Eo=t=>{if(!t||!(t!=null&&t.startsWith("/")))return!1;const e=o=>o.endsWith("/")?o:`${o}/`,n=e(window.location.pathname),s=e(new URL(t,window.location.origin).pathname);return n.startsWith(s)},Fo=(t=[])=>{const e=t.map((s,o)=>({path:s,index:o})).filter(s=>Eo(s.path));return e!=null&&e.length?e.slice(1).reduce((s,o)=>s.path.length>=o.path.length?s:o,e[0]).index:-1};var ie,ce;const at=((ie=window==null?void 0:window.blocklet)==null?void 0:ie.groupPrefix)||((ce=window==null?void 0:window.blocklet)==null?void 0:ce.prefix)||"/",qo=t=>{const e={...t},n=t==null?void 0:t.background;return typeof n=="string"?e.background={header:n,footer:n,default:n}:n&&typeof n=="object"&&(e.background={header:n.header||n.default,footer:n.footer||n.default,default:n.default}),e},Ee=(t,e="en")=>{if(!(t!=null&&t.length))return t;const n=(o,r)=>typeof o=="string"?o:typeof o=="object"?o[r]||(o==null?void 0:o.en)||(o==null?void 0:o.zh):o,s=(o,r)=>{if(typeof o=="string"){if($o(o)){const a=new URL(o);return a.searchParams.set("locale",r),a.href}const i=new URL(o,window.location.origin);return i.searchParams.set("locale",r),i.pathname+i.search}return typeof o=="object"?o[r]||(o==null?void 0:o.en)||(o==null?void 0:o.zh):o};return Y(t,o=>{var r;return{...o,title:n(o.title,e),link:(r=o.items)!=null&&r.length?o.link:s(o.link,e),_rawLink:o.link}},"items")},Bo=t=>Y(t,e=>e.role?{...e,role:Array.isArray(e.role)?e.role:[e.role]}:e,"items"),zo=t=>{if(!(t!=null&&t.length))return null;const e=Bo(t),n={header:[],footer:[],social:[],bottom:[],dashboard:[],sessionManager:[],userCenter:[]};return e.forEach(s=>{var o;s.section?Array.isArray(s.section)?s.section.forEach(r=>{var i;(i=n[r])==null||i.push(s)}):typeof s.section=="string"&&((o=n[s.section])==null||o.push(s)):n.header.push(s)}),n},Ho=t=>{if(!t)return null;const e={...t};return e.theme=qo(e.theme),e.navigation=zo(Vo(e.navigation)),e},Vo=(t=[])=>_t(t,(e,n)=>{var s;return!!e.link||((s=n.filteredChildren)==null?void 0:s.length)},"items"),Fe=(t,e)=>_t(t,(n,s)=>{var r;const o=!n.role||e&&n.role.includes(e);return s.isLeaf?o:o&&((r=s.filteredChildren)==null?void 0:r.length)},"items"),Do={top:-960,width:960,height:960,body:'<path fill="currentColor" d="M510-600v-210q0-12.75 8.625-21.375T540-840h270q12.75 0 21.375 8.625T840-810v210q0 12.75-8.625 21.375T810-570H540q-12.75 0-21.375-8.625T510-600M120-480v-330q0-12.75 8.625-21.375T150-840h270q12.75 0 21.375 8.625T450-810v330q0 12.75-8.625 21.375T420-450H150q-12.75 0-21.375-8.625T120-480m390 330v-330q0-12.75 8.625-21.375T540-510h270q12.75 0 21.375 8.625T840-480v330q0 12.75-8.625 21.375T810-120H540q-12.75 0-21.375-8.625T510-150m-390 0v-210q0-12.75 8.625-21.375T150-390h270q12.75 0 21.375 8.625T450-360v210q0 12.75-8.625 21.375T420-120H150q-12.75 0-21.375-8.625T120-150m60-360h210v-270H180zm390 330h210v-270H570zm0-450h210v-150H570zM180-180h210v-150H180zm210-150"/>'},Go={width:24,height:24,body:'<path fill="currentColor" d="M15.95 12.3L11.7 8.05q-.15-.15-.212-.325t-.063-.375q0-.2.063-.375t.212-.325l4.25-4.25q.15-.15.325-.212t.375-.063q.2 0 .375.063t.325.212l4.25 4.25q.15.15.213.325t.062.375q0 .2-.063.375t-.212.325l-4.25 4.25q-.15.15-.325.213t-.375.062q-.2 0-.375-.062t-.325-.213ZM3 10V4q0-.425.288-.713T4 3h6q.425 0 .713.288T11 4v6q0 .425-.288.713T10 11H4q-.425 0-.713-.288T3 10Zm10 10v-6q0-.425.288-.713T14 13h6q.425 0 .713.288T21 14v6q0 .425-.288.713T20 21h-6q-.425 0-.713-.288T13 20ZM3 20v-6q0-.425.288-.713T4 13h6q.425 0 .713.288T11 14v6q0 .425-.288.713T10 21H4q-.425 0-.713-.288T3 20ZM5 9h4V5H5v4Zm11.675 1.2L19.5 7.375L16.675 4.55L13.85 7.375l2.825 2.825ZM15 19h4v-4h-4v4ZM5 19h4v-4H5v4ZM9 9Zm4.85-1.625ZM9 15Zm6 0Z"/>'};function $t({session:t,locale:e,size:n}){const s=(window==null?void 0:window.blocklet)||{},o=(s.navigation||[]).filter(c=>c.section==="sessionManager"&&!["/sessionManager"].includes(c.id)).filter(c=>{var l;return!!((c==null?void 0:c.role)||[]).includes(((l=t==null?void 0:t.user)==null?void 0:l.role)||"guest")}).map(c=>{const l=((s==null?void 0:s.componentMountPoints)||[]).find(u=>c.component===u.name);return{...c,component:l}}),r=I.useRef(null),i=De({open:!1}),a=Ge((c=!i.open)=>{i.open=c});return o.length===0||!(t!=null&&t.user)?null:h.jsxs(h.Fragment,{children:[h.jsx(Ue,{size:"medium",ref:r,onClick:()=>a(),children:h.jsx(Ht,{icon:Do,fontSize:n,style:{transform:"scale(1.08)"}})}),h.jsx(Qe,{open:i.open,onClose:()=>a(!1),anchorEl:r.current,transition:!0,placement:"bottom-end",sx:{zIndex:1600},children:({TransitionProps:c})=>h.jsx(We,{onClickAway:l=>{l.preventDefault(),l.stopPropagation(),a(!1)},children:h.jsx(Ze,{...c,timeout:350,children:h.jsxs(Je,{variant:"outlined",sx:{borderRadius:3,width:350,maxWidth:"90vw",borderColor:k.lineStep,p:2,border:"0 !important",boxShadow:`0px 8px 16px 0px ${k.gray6}, 0px 0px 0px 1px ${k.gray6}`},children:[h.jsx(Ye,{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fill, 100px)",gridAutoRows:"minmax(100px, max-content)",justifyContent:"space-between",maxHeight:350,overflowY:"auto",p:0},children:o.map(l=>{var u,f;return h.jsx(Mn,{disablePadding:!0,children:h.jsxs(xn,{href:l.link,sx:{p:1,display:"flex",flexDirection:"column",alignItems:"center",gap:1,width:"100%",height:"100%",borderRadius:2,"&:hover":{backgroundColor:k.surfacePrimarySubtitle}},children:[(u=l==null?void 0:l.component)!=null&&u.did?h.jsx(Xe,{component:"img",src:`${Ke}/blocklet/logo-bundle/${l.component.did}`,sx:{borderRadius:2,width:50,height:50,objectFit:"contain"}}):h.jsx(Ht,{fontSize:50,icon:l.icon||Go,color:k.textSubtitle}),h.jsx(tn,{sx:{fontSize:"12px",color:k.textBase,textAlign:"center",lineHeight:"normal"},children:((f=l.title)==null?void 0:f.zh)||l.title})]})},l.id)})}),h.jsx(en,{session:t,children:h.jsx(nn,{variant:"outlined",fullWidth:!0,href:on,sx:{mt:1,borderRadius:2,color:k.textBase,borderColor:k.lineBorderStrong,"&:hover":{color:k.primaryBase,borderColor:k.primaryBase}},children:e==="zh"?"管理":"Manage"})})]})})})})]})}$t.propTypes={session:d.object.isRequired,locale:d.string,size:d.number};$t.defaultProps={locale:"en",size:24};function Et({formattedBlocklet:t,addons:e,sessionManagerProps:n}){var p,m,b,x;const s=I.useContext(de),{locale:o}=fe()||{},{enableConnect:r=!0,enableLocale:i=!0}=t,a=!!((p=s==null?void 0:s.session)!=null&&p.user);let c=Ee((m=t==null?void 0:t.navigation)==null?void 0:m.sessionManager,o)||[];c=Fe(c,(x=(b=s==null?void 0:s.session)==null?void 0:b.user)==null?void 0:x.role);const u=(()=>{if(e&&typeof e!="function")return Array.isArray(e)?e:[e];let w=[];if(i&&o&&w.push(h.jsx(ln,{showText:!1},"locale-selector")),r&&s){const T=[];a&&(c?c.slice(0,5):[]).forEach(y=>{T.push({label:y.title,icon:y.icon?h.jsx("iconify-icon",{icon:y.icon,height:24,style:{marginRight:8}}):null,component:"a",href:y.link,key:y.link})}),w.push(h.jsx($t,{session:s.session,locale:o},"session-blocklet")),w.push(h.jsx(sn,{session:s.session,locale:o,menu:T,showRole:!0,...n},"session-user"))}return typeof e=="function"&&(w=e(w)||[]),w})();return I.createElement(h.Fragment,null,...Array.isArray(u)?u:[u])}Et.propTypes={formattedBlocklet:d.object.isRequired,addons:d.oneOfType([d.func,d.node]),sessionManagerProps:$e};Et.defaultProps={addons:null,sessionManagerProps:{showRole:!0}};const Uo=()=>{const t=rn();I.useEffect(()=>{t.wallet&&cn(()=>import("./index-65ROwV_z.js").then(e=>e.i),__vite__mapDeps([0,1,2])).then(e=>{e.call||(e=e.default),e.call("arcHideTopBar","{}")}).catch(e=>{console.error("load dsbridge error",e)})},[t])};function qe({meta:t,fallbackUrl:e,invalidPathFallback:n,headerAddons:s,sessionManagerProps:o,links:r,...i}){var R;Uo();const a=I.useContext(de),c=(R=a==null?void 0:a.session)==null?void 0:R.user,l=c==null?void 0:c.role,{locale:u}=fe()||{},f=I.useMemo(()=>{const C=Object.assign({},window.blocklet,t);try{return Ho(C)}catch(g){return console.error("Failed to format blocklet info",g,C),C}},[t]),{localizedNav:p,flattened:m,matchedIndex:b}=I.useMemo(()=>{var L;let C=Ee((L=f==null?void 0:f.navigation)==null?void 0:L.dashboard,u)||[];C=Fe(C,l),C=Y(C,A=>({title:A.title,url:A.link,icon:A.icon?h.jsx("iconify-icon",{height:"100%",width:"100%",icon:A.icon}):null,external:!0,children:A.items}),"items");const g=_o(C).filter(A=>!!A.url),S=Fo(g.map(A=>A.url));return S!==-1&&(g[S].active=!0),{localizedNav:C,flattened:g,matchedIndex:S}},[f,u,l]),x=typeof r=="function"?r(p):[...p,...r];if(I.useLayoutEffect(()=>{c&&!(m!=null&&m.length)&&e&&(window.location.href=e)},[e]),I.useLayoutEffect(()=>{var C;c&&(m!=null&&m.length)&&b===-1&&(n?n():window.location.href=((C=m[0])==null?void 0:C.url)||at)},[n,m,b]),!f.appName)return null;const{appLogo:w,appLogoRect:T,appName:v}=f,y=h.jsx(Et,{formattedBlocklet:f,addons:s,sessionManagerProps:o});return h.jsx(an,{title:v,fullWidth:!0,sidebarWidth:128,legacy:!1,links:x,...i,headerProps:{homeLink:at,logo:h.jsx("img",{src:T||w,alt:"logo"}),addons:y,...i.headerProps}})}qe.propTypes={meta:No,fallbackUrl:d.string,invalidPathFallback:d.func,headerAddons:d.oneOfType([d.func,d.node]),sessionManagerProps:$e,links:d.oneOfType([d.array,d.func])};qe.defaultProps={meta:{},fallbackUrl:at,invalidPathFallback:null,headerAddons:void 0,sessionManagerProps:{showRole:!0,onLogout:()=>{window.location.href=at}},links:[]};export{qe as D,Et as H,Yo as a,No as b,_o as c,Fo as d,Ho as f,Ee as g,$o as i,Y as m,at as p,$e as s,Uo as u};
|
|
12
12
|
function __vite__mapDeps(indexes) {
|
|
13
13
|
if (!__vite__mapDeps.viteFileDeps) {
|
|
14
|
-
__vite__mapDeps.viteFileDeps = ["assets/index-
|
|
14
|
+
__vite__mapDeps.viteFileDeps = ["assets/index-65ROwV_z.js","assets/index-A3qaKAQZ.js","assets/index-TCTrVMXW.css"]
|
|
15
15
|
}
|
|
16
16
|
return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
|
|
17
17
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as l,_ as v,ea as lt,f as te,g as _e,a as Le,r as x,h as he,i as Me,P as w,l as ne,aY as xe,aZ as ge,bp as ye,L as W,a6 as F,bw as xt,T as $,a3 as K,o as gt,K as At,
|
|
1
|
+
import{j as l,_ as v,ea as lt,f as te,g as _e,a as Le,r as x,h as he,i as Me,P as w,l as ne,aY as xe,aZ as ge,bp as ye,L as W,a6 as F,bw as xt,T as $,a3 as K,o as gt,K as At,dc as Ot,ad as z,m as me,J as pe,W as Ve,aG as _t,aE as be,aF as yt,aJ as Lt,d as Se,bv as Mt,bO as st,eb as Fe,bD as Vt,a7 as Ft,ec as Ie,aC as zt,ar as Wt,as as Te}from"./index-A3qaKAQZ.js";import{d as kt,_ as Ut}from"./useSetState-Uk84-eN2.js";import{D as ze}from"./index-cFZ_La2w.js";import{T as jt}from"./index-4krLq-ni.js";import{B as j}from"./Box-UZKPIg5l.js";import{S as $e}from"./CircularProgress-2E7FsVpy.js";import{W as Kt}from"./did-address-KX8MZujh.js";import{C as Ct,M as qt}from"./confirm-6Jdys1hj.js";import{B as We,d as Ht}from"./ChevronRight-gVrMbICn.js";import{B as Jt,I as ve}from"./IconButton-opaehSAi.js";import{_ as Gt,F as Xt,C as De}from"./useLocalStorage-XI5ozNRv.js";import{u as Zt}from"./session--6YbzF22.js";import{s as q,u as Ue}from"./styled-0kjic46e.js";import{c as Yt}from"./createSvgIcon-kg0p2IW6.js";import{T as _}from"./Link-4d7RYuFQ.js";import{u as Qt,b as eo}from"./Menu-anPorR00.js";import{M as X}from"./TextField-BYLq4y6q.js";import{M as Be}from"./InputAdornment-b8lVK7li.js";import{d as nt}from"./Download-pM5Y1uk4.js";import{d as to}from"./DeleteOutline-mJxIIf_E.js";import{T as oo}from"./index-yufFTVXz.js";import{M as lo,A as so,f as Ee}from"./index-wZoARVEY.js";import{C as no}from"./click-to-copy-vmaq823F.js";import{c as Ke}from"./index-m4TSpDqh.js";import{i as ro}from"./index-XZuSftjk.js";import{d as io}from"./ExpandMore-QGwDyScz.js";import{d as co}from"./OpenInNew-vpsAPHUY.js";import{C as Nt}from"./Collapse-7L2PLAwX.js";import"./api-wjvMMbke.js";import{A as ao}from"./Avatar-rCJCajEU.js";import"./FilterList-SI94bUfz.js";import"./Search-g3D9ZMg2.js";import"./FormControlLabel-k9sTwU-b.js";import"./createStack-Ql4z3puD.js";import"./TextField-egkc1TLq.js";import"./Grid-C0yrXHv6.js";import"./Toolbar-TavQhk9k.js";import"./index-WdzhUrFb.js";import"./redux-XOuz_cVf.js";import"./toPropertyKey-NzAT2yhV.js";import"./Select-1kfqC4Cs.js";import"./InputLabel-S5ITR0B1.js";const uo=Yt(l.jsx("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}),"MoreHoriz"),po=["slots","slotProps"],fo=q(Jt)(({theme:e})=>v({display:"flex",marginLeft:`calc(${e.spacing(1)} * 0.5)`,marginRight:`calc(${e.spacing(1)} * 0.5)`},e.palette.mode==="light"?{backgroundColor:e.palette.grey[100],color:e.palette.grey[700]}:{backgroundColor:e.palette.grey[700],color:e.palette.grey[100]},{borderRadius:2,"&:hover, &:focus":v({},e.palette.mode==="light"?{backgroundColor:e.palette.grey[200]}:{backgroundColor:e.palette.grey[600]}),"&:active":v({boxShadow:e.shadows[0]},e.palette.mode==="light"?{backgroundColor:lt(e.palette.grey[200],.12)}:{backgroundColor:lt(e.palette.grey[600],.12)})})),mo=q(uo)({width:24,height:16});function ho(e){const{slots:t={},slotProps:o={}}=e,n=te(e,po),a=e;return l.jsx("li",{children:l.jsx(fo,v({focusRipple:!0},n,{ownerState:a,children:l.jsx(mo,v({as:t.CollapsedIcon,ownerState:a},o.collapsedIcon))}))})}function bo(e){return Le("MuiBreadcrumbs",e)}const xo=_e("MuiBreadcrumbs",["root","ol","li","separator"]),go=xo,yo=["children","className","component","slots","slotProps","expandText","itemsAfterCollapse","itemsBeforeCollapse","maxItems","separator"],ko=e=>{const{classes:t}=e;return Me({root:["root"],li:["li"],ol:["ol"],separator:["separator"]},bo,t)},jo=q(_,{name:"MuiBreadcrumbs",slot:"Root",overridesResolver:(e,t)=>[{[`& .${go.li}`]:t.li},t.root]})({}),Co=q("ol",{name:"MuiBreadcrumbs",slot:"Ol",overridesResolver:(e,t)=>t.ol})({display:"flex",flexWrap:"wrap",alignItems:"center",padding:0,margin:0,listStyle:"none"}),No=q("li",{name:"MuiBreadcrumbs",slot:"Separator",overridesResolver:(e,t)=>t.separator})({display:"flex",userSelect:"none",marginLeft:8,marginRight:8});function So(e,t,o,n){return e.reduce((a,d,p)=>(p<e.length-1?a=a.concat(d,l.jsx(No,{"aria-hidden":!0,className:t,ownerState:n,children:o},`separator-${p}`)):a.push(d),a),[])}const To=x.forwardRef(function(t,o){const n=Ue({props:t,name:"MuiBreadcrumbs"}),{children:a,className:d,component:p="nav",slots:c={},slotProps:h={},expandText:u="Show path",itemsAfterCollapse:b=1,itemsBeforeCollapse:f=1,maxItems:g=8,separator:i="/"}=n,s=te(n,yo),[r,m]=x.useState(!1),y=v({},n,{component:p,expanded:r,expandText:u,itemsAfterCollapse:b,itemsBeforeCollapse:f,maxItems:g,separator:i}),C=ko(y),k=Qt({elementType:c.CollapsedIcon,externalSlotProps:h.collapsedIcon,ownerState:y}),S=x.useRef(null),E=R=>{const D=()=>{m(!0);const T=S.current.querySelector("a[href],button,[tabindex]");T&&T.focus()};return f+b>=R.length?R:[...R.slice(0,f),l.jsx(ho,{"aria-label":u,slots:{CollapsedIcon:c.CollapsedIcon},slotProps:{collapsedIcon:k},onClick:D},"ellipsis"),...R.slice(R.length-b,R.length)]},I=x.Children.toArray(a).filter(R=>x.isValidElement(R)).map((R,D)=>l.jsx("li",{className:C.li,children:R},`child-${D}`));return l.jsx(jo,v({ref:o,component:p,color:"text.secondary",className:he(C.root,d),ownerState:y},s,{children:l.jsx(Co,{className:C.ol,ref:S,ownerState:y,children:So(r||g&&I.length<=g?I:E(I),C.separator,i,y)})}))}),qe=To;function ke({size:e,...t}){return l.jsx(j,{display:"flex",mt:4,...t,children:l.jsx($e,{size:e})})}ke.propTypes={size:w.number};ke.defaultProps={size:24};function St(){const{t:e,locale:t}=ne(),{api:o}=xe(),[n,a]=x.useState(!0),{blocklet:d}=ge(),[p,c]=x.useState(null),{componentDid:h=""}=ye(),[u,b]=x.useState(null),f=()=>{o.getProjects({input:{did:d.meta.did,componentDid:h}}).then(r=>{const m=(r==null?void 0:r.projects)||[];a(!1),b(m)}).catch(r=>{a(!1),$.error(r.message)})},g=r=>{c(r)},i=()=>{a(!1);const r=p.id;o.deleteProject({input:{did:d.meta.did,projectId:r}}).then(()=>{a(!1),f(),$.success(e("common.removeSuccess")),c(null)}).catch(m=>{a(!1),$.error(m.message)})};if(x.useEffect(()=>{f()},[]),!u&&n)return l.jsx(ke,{});if(!u)return null;if(!u.length)return l.jsxs(j,{display:"flex",flexDirection:"column",alignItems:"center",pt:10,children:[l.jsx(j,{sx:{fontSize:20,fontWeight:"bold",mb:3},children:e("blocklet.publish.blockletEmptyTip")}),l.jsx(j,{sx:{fontSize:14,color:"text.secondary",mb:3},children:e("blocklet.publish.createBlockletTip")}),l.jsx(W,{to:"create",children:l.jsx(F,{variant:"contained",children:e("blocklet.publish.createBlocklet")})})]});const s=[{label:"Blocklet",name:"blockletTitle",options:{customBodyRenderLite:r=>{const m=u[r];return l.jsx(W,{to:`${m.id}`,children:m.blockletTitle||"/"})}}},{label:"DID",name:"blockletDid",options:{customBodyRender:r=>l.jsx(Kt,{size:14,responsive:!0,did:r})}},{label:"Version",name:"blockletVersion",options:{customBodyRender:r=>r?l.jsx(jt,{type:"success",children:r}):""}},h?null:{label:e("common.scope"),name:"componentDid",options:{customBodyRender:r=>{const m=(d.children||[]).find(y=>y.meta.did===r);return m?l.jsxs(j,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:[l.jsx(We,{size:14,blocklet:m,ancestors:[d]}),l.jsx(j,{ml:.5,sx:{ml:.5,color:"text.primary",fontSize:14},children:m.meta.title})]},r):""}}},{label:e("common.updatedAt"),name:"updatedAt",options:{customBodyRender:r=>l.jsx(xt,{value:Number(r),locale:t})}},{label:e("common.actions"),name:"actions",options:{customBodyRenderLite:r=>{const m=u[r];return l.jsx(j,{display:"flex",children:l.jsx(ve,{color:"error","aria-label":"delete",onClick:()=>g(m),children:l.jsx(kt,{sx:{fontSize:18}})})})}}}].filter(Boolean);return l.jsxs(Io,{children:[l.jsx(j,{sx:{textAlign:"right"},children:l.jsx(W,{to:"create",children:l.jsx(F,{variant:"contained",children:e("blocklet.publish.createBlocklet")})})}),l.jsx(ze,{className:"main-table",locale:t,data:u,columns:s,options:{sort:!1,download:!1,filter:!1,print:!1,search:!1}}),p&&l.jsx(Ct,{title:`${e("common.delete")} ${p.blockletTitle}`,description:e("blocklet.publish.deleteBlockletTip"),confirm:e("common.confirm"),onConfirm:i,onCancel:()=>c(null)})]})}St.propTypes={};const Io=K(j)`
|
|
2
2
|
.main-table > div:first-child {
|
|
3
3
|
display: none;
|
|
4
4
|
}
|
|
@@ -132,7 +132,7 @@ import{j as l,_ as v,ea as lt,f as te,g as _e,a as Le,r as x,h as he,i as Me,P a
|
|
|
132
132
|
display: none;
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
|
-
`,pt=["image/*",".jpg",".jpeg",".png",".gif",".svg"],ft=1024*1024*10;var bt;const we=(bt=window.env)==null?void 0:bt.serverEndpoint,mt=x.lazy(()=>Ft(()=>import("./react-1-wuzDEA.js").then(e=>e.r),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25])).then(e=>({default:e.Uploader}))),vl=(e,t,o)=>{const n=[];return e.blockletTitle||n.push({param:"blockletTitle",message:o("blocklet.publish.errorTip.noTitle")}),e.blockletVersion?Ie.valid(e.blockletVersion)||n.push({param:"blockletVersion",message:"Invalid Blocklet Version"}):n.push({param:"blockletVersion",message:o("blocklet.publish.errorTip.noVersion")}),t===z.PROJECT.RELEASE_STATUS.published&&(e.blockletDescription||n.push({param:"blockletDescription",message:o("blocklet.publish.errorTip.noDescription")}),e.note||n.push({param:"note",message:o("blocklet.publish.errorTip.noNote")})),n.length?n:null},El=({tabs:e,blocklet:t,ancestors:o=[]})=>{const n=t.meta.did;e.push({label:l.jsxs(j,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:[l.jsx(We,{size:24,blocklet:t,ancestors:o}),l.jsx(j,{ml:"4px",className:"text",children:l.jsx(j,{children:t.meta.title})})]},n),value:n})},ht=(e,t)=>{const o=Fe(e,["blockletVersion","blockletTitle","blockletDescription","blockletLogo","blockletIntroduction","blockletScreenshots","blockletComponents","note"]);return o.blockletScreenshots||(o.blockletScreenshots=[]),o.blockletComponents?o.blockletComponents=o.blockletComponents.map(n=>({...n,included:!0})):o.blockletComponents=(t.children||[]).map(n=>({did:n.meta.did,included:!0,required:!0})),o};function ot({...e}){var Ne,O,ee;const t=gt(),{projectId:o,releaseId:n,componentDid:a}=ye(),{t:d}=ne(),{blocklet:p}=ge(),[c,h]=Ut(null),[u,b]=x.useState({}),[f,g]=x.useState(!1),[i,s]=x.useState(!1),[r,m]=x.useState(null),{api:y}=xe(),C=x.useRef(null),k=x.useRef(null),[S,E]=x.useState(),[I,R]=x.useState(),D=n==="create"?"":n,T=n==="create"?"create":"edit",B=[],H=((p==null?void 0:p.children)||[]).filter(N=>{var A;return(A=N.meta.resource)==null?void 0:A.exportApi}).filter(N=>!a||N.meta.did===a);H.forEach(N=>{El({tabs:B,blocklet:N,t:d,ancestors:[p]})});const[je,Ce]=x.useState((Ne=B[0])==null?void 0:Ne.value),oe=(r==null?void 0:r.status)==="published",L=oe,le=({typeOnly:N}={})=>{y.getProject({input:{did:p.meta.did,projectId:o}}).then(A=>{g(!1);const P=A.project||{};if(N){E(P.type);return}P.blockletVersion?Ie.valid(P.blockletVersion)&&(P.blockletVersion=Ie.inc(P.blockletVersion,"patch")):P.blockletVersion="1.0.0",h(ht(P,p)),E(P.type)}).catch(A=>{g(!1),$.error(Ee(A))})},ie=()=>{y.getRelease({input:{did:p.meta.did,projectId:o,releaseId:D}}).then(N=>{g(!1),h(ht(N==null?void 0:N.release,p)),m(N==null?void 0:N.release)}).catch(N=>{g(!1),$.error(Ee(N))})},J=x.useCallback(()=>{if(T==="edit"){if(!D){$.error("Empty release id");return}ie(),le({typeOnly:!0})}T==="create"&&le()},[T,D]);x.useEffect(()=>{J()},[J]);const Z=N=>{const A=vl(c,N,d);if(A){$.error(A.map(M=>M.message).join("; ")),b(A.reduce((M,U)=>({...M,[U.param]:U.message}),{}));return}const P={...c};if(P.blockletVersion=Ie.valid(P.blockletVersion),!P.blockletVersion){$.error("Invalid Blocklet Version"),b({blockletVersion:"Invalid Blocklet Version"});return}P.blockletTitle=(P.blockletTitle||"").trim(),P.blockletDescription=(P.blockletDescription||"").trim(),P.blockletIntroduction=(P.blockletIntroduction||"").trim(),P.note=(P.note||"").trim(),S==="pack"?P.blockletComponents=(P.blockletComponents||[]).filter(M=>M.included).map(M=>Fe(M,["did","required"])).map(JSON.stringify):delete P.blockletComponents,s(N),g(!0),y.createRelease({input:{...P,did:p.meta.did,projectId:o,releaseId:D,status:N}}).then(M=>{var U;if(s(!1),g(!1),N==="draft"?$.success(d("blocklet.publish.saveDraftSuccess")):$.success(d("blocklet.publish.createReleaseSuccess")),T==="create"){const Bt=(U=M==null?void 0:M.release)==null?void 0:U.id;t(`../${o}/${Bt}`,{replace:!0})}else ie()}).catch(M=>{s(!1),g(!1);const U=Ee(M);$.error(U),/resource.*empty/.test(U)&&b({blockletResource:U})})};if(!c&&f)return l.jsx(ke,{});if(!c)return null;const ce=`${pe.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${p.meta.did}/${o}/logo/upload`,se=`${pe.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${p.meta.did}/${o}/screenshot/upload`,ae=c!=null&&c.blockletLogo?`${ce}/${c.blockletLogo}`:`${pe.WELLKNOWN_SERVICE_PATH_PREFIX}/static/images/logo.png`,Y=((c==null?void 0:c.blockletScreenshots)||[]).filter(Boolean).map(N=>`${se}/${N}`),V=H.find(N=>N.meta.did===je),de=V?l.jsx(j,{children:l.jsx(et,{error:u.blockletResource,app:p,component:V,projectId:o,release:{...r,id:D},onSave:N=>{N.length&&b({blockletResource:""})}})}):l.jsx(j,{display:"flex",mt:-3,children:l.jsx(Vt,{children:d("common.empty")})}),ue=N=>{Ce(N)};let Q=null;if(oe&&we){const N=me(we,`/api/project/${p.meta.did}/${o}/${D}/release/blocklet.json`);if(S==="pack"){const A=new URL(we);A.pathname=me(A.pathname,"/launch-blocklet/agreement"),A.searchParams.set("blocklet_meta_url",N),Q=l.jsx(F,{variant:"outlined",style:{marginRight:8},children:l.jsx("a",{href:A.href,target:"_blank",rel:"noreferrer",children:d("common.install")})})}else Q=l.jsxs(l.Fragment,{children:[l.jsx(F,{variant:"outlined",style:{marginRight:8},onClick:()=>R(N),children:d("common.install")}),l.jsx(lo,{fullWidth:!0,maxWidth:"sm",open:I,onClose:()=>R(""),children:l.jsxs(j,{sx:{py:5,px:4,wordBreak:"break-all"},children:[l.jsx(_,{variant:"h6",sx:{mb:2},children:d("blocklet.publish.installResourceTip")}),l.jsx(no,{children:I}),l.jsxs(_,{sx:{mt:2},children:[d("blocklet.publish.installResourceTip2"),l.jsx("a",{style:{marginLeft:4},href:"https://www.arcblock.io/docs/blocklet-developer/R3weqCy7WPI8ggudt0C2alWv",target:"_blank",rel:"noreferrer",children:d("blocklet.publish.installResourceHelp")})]})]})})]})}return l.jsxs(Rl,{...e,children:[l.jsxs(j,{className:"sticky-header",children:[l.jsxs(qe,{className:"breadcrumbs","aria-label":"breadcrumb",children:[l.jsx(W,{to:"../",children:d("common.publish")}),l.jsx(W,{to:`../${o}`,children:(c==null?void 0:c.blockletTitle)||"Blocklet"}),l.jsx(_,{color:"text.primary",children:T==="create"?d("common.create"):(c==null?void 0:c.blockletVersion)||d("common.edit")})]}),l.jsxs(j,{display:"flex",children:[!oe&&l.jsxs(l.Fragment,{children:[l.jsxs(F,{variant:"outlined",disabled:f||i,onClick:()=>Z(z.PROJECT.RELEASE_STATUS.draft),style:{marginRight:12},children:[i===z.PROJECT.RELEASE_STATUS.draft&&l.jsx($e,{size:14,sx:{mr:.5}}),d("blocklet.publish.saveDraft")]}),l.jsxs(F,{variant:"contained",disabled:f||i,onClick:()=>Z(z.PROJECT.RELEASE_STATUS.published),children:[i===z.PROJECT.RELEASE_STATUS.published&&l.jsx($e,{size:14,sx:{mr:.5},color:"inherit"}),d("common.release")]})]}),oe&&l.jsxs(l.Fragment,{children:[Q,l.jsx(F,{variant:"contained",children:l.jsx("a",{href:me(`${pe.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${p.meta.did}/${o}/${D}/download/${(r.files||[])[0]}`),children:d("common.download")})})]})]})]}),l.jsxs(j,{children:[S==="pack"&&l.jsx(so,{type:"info",style:{width:"100%"},children:d("blocklet.publish.packTip")}),l.jsx(j,{pt:3}),l.jsxs(j,{display:"flex",className:"section",children:[l.jsx(_,{variant:"h3",className:"left",children:d("blocklet.publish.productTitle")}),l.jsxs(j,{sx:{flex:1},children:[l.jsx(X,{label:`Blocklet ${d("common.title")}`,placeholder:`Blocklet ${d("common.title")}`,InputProps:{"data-cy":"blocklet-title",readOnly:L},autoComplete:"off",variant:"outlined",fullWidth:!0,required:!0,value:c.blockletTitle||"",onChange:N=>{b({blockletTitle:""}),h({blockletTitle:N.target.value})},error:!!u.blockletTitle,helperText:u.blockletTitle||""}),l.jsx(X,{label:`Blocklet ${d("common.description")}`,placeholder:`Blocklet ${d("common.description")}`,InputProps:{"data-cy":"blocklet-description",readOnly:L},required:!0,autoComplete:"off",variant:"outlined",fullWidth:!0,value:c.blockletDescription||"",onChange:N=>{b({blockletDescription:""}),h({blockletDescription:N.target.value})},error:!!u.blockletDescription,helperText:u.blockletDescription||"",sx:{mt:3}}),l.jsx(X,{label:`Blocklet ${d("common.introduction")}`,placeholder:`Blocklet ${d("common.introduction")}`,InputProps:{"data-cy":"export-blocklet-introduction",readOnly:L,endAdornment:l.jsxs(Be,{position:"end",children:[((O=c==null?void 0:c.blockletIntroduction)==null?void 0:O.length)||0," / ",z.PROJECT.MAX_INTRO_LENGTH]})},autoComplete:"off",variant:"outlined",fullWidth:!0,multiline:!0,minRows:4,value:c.blockletIntroduction||"",onChange:N=>{b({blockletIntroduction:""}),h({blockletIntroduction:N.target.value.slice(0,z.PROJECT.MAX_INTRO_LENGTH)})},error:!!u.blockletIntroduction,helperText:u.blockletIntroduction||"",sx:{mt:3}})]})]}),l.jsxs(j,{display:"flex",mt:3,className:"section",children:[l.jsx(_,{variant:"h3",className:"left",children:d("blocklet.publish.versionTitle")}),l.jsxs(j,{sx:{flex:1},children:[l.jsx(X,{required:!0,label:`Blocklet ${d("common.version")}`,placeholder:`Blocklet ${d("common.version")}`,InputProps:{"data-cy":"blocklet-version",readOnly:L},autoComplete:"off",variant:"outlined",fullWidth:!0,value:c.blockletVersion,onChange:N=>{b({blockletVersion:""}),h({blockletVersion:N.target.value})},error:!!u.blockletVersion,helperText:u.blockletVersion||""}),l.jsx(X,{label:d("blocklet.publish.releaseNote"),autoComplete:"off",variant:"outlined",InputProps:{"data-cy":"release-note",readOnly:L,endAdornment:l.jsxs(Be,{position:"end",children:[((ee=c==null?void 0:c.note)==null?void 0:ee.length)||0," / ",z.PROJECT.MAX_NOTE_LENGTH]})},fullWidth:!0,multiline:!0,minRows:4,required:!0,value:c.note,onChange:N=>{b({note:""}),h({note:N.target.value.slice(0,z.PROJECT.MAX_NOTE_LENGTH)})},error:!!u.note,helperText:u.note||"",sx:{mt:3}})]})]}),l.jsxs(j,{display:"flex",mt:3,className:"section full-width",children:[l.jsx(_,{variant:"h3",className:"left",children:d("blocklet.publish.imgTitle")}),l.jsxs(j,{sx:{flex:1},children:[l.jsxs(j,{display:"flex",children:[l.jsx(_,{variant:"subtitle1",sx:{mr:2},children:d("common.logo")}),l.jsx(j,{sx:{flex:1,cursor:L?"default":"pointer"},children:l.jsx(ao,{variant:"square",sx:{width:80,height:80},alt:"Blocklet Logo",src:ae,onClick:()=>!L&&C.current.open()})})]}),l.jsxs(j,{display:"flex",mt:3,children:[l.jsx(_,{variant:"subtitle1",sx:{mr:2},children:d("common.screenshot")}),l.jsxs(j,{display:"flex",alignItems:"center",sx:{flex:1,flexWrap:"wrap"},children:[Y.map((N,A)=>l.jsxs(j,{className:"screenshot",children:[l.jsx("img",{alt:"screenshot",src:N}),!L&&l.jsx(ve,{className:"action",onClick:()=>{const P=[...c.blockletScreenshots];P.splice(A,1),h({blockletScreenshots:P})},children:l.jsx(to,{})})]})),Y.length<5&&l.jsx(j,{sx:{width:200,height:140,background:"#eee",cursor:L?"default":"pointer",color:"#999",mb:2},display:"flex",justifyContent:"center",alignItems:"center",fontSize:40,onClick:()=>!L&&k.current.open(),children:"+"})]})]})]}),l.jsx(mt,{id:"uploader-logo",ref:C,popup:!0,onUploadFinish:N=>{h({blockletLogo:N.data.filename}),C.current.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:ce,disableMediaKitPrefix:!0},coreProps:{restrictions:{allowedFileTypes:pt,maxFileSize:ft,maxNumberOfFiles:1}}},"uploader-logo"),l.jsx(mt,{id:"uploader-screenshot",ref:k,popup:!0,onUploadFinish:N=>{var P;const A=c.blockletScreenshots||[];A.push((P=N.data)==null?void 0:P.filename),h({blockletScreenshots:A}),k.current.close()},plugins:["ImageEditor"],apiPathProps:{uploader:se,disableMediaKitPrefix:!0},coreProps:{restrictions:{allowedFileTypes:pt,maxFileSize:ft,maxNumberOfFiles:5-Y.length}}},"uploader-screenshot")]}),l.jsxs(j,{display:"flex",mt:3,className:"section full-width",children:[l.jsx(j,{className:"left",children:l.jsx(_,{variant:"h3",children:d("blocklet.publish.resourceTitle")})}),l.jsxs(j,{sx:{flex:1},children:[l.jsx(oo,{tabs:B,current:je,onChange:ue,sx:{ml:-2,mt:-1.5}}),l.jsx(j,{children:de})]})]}),S==="pack"&&l.jsxs(j,{display:"flex",mt:3,className:"section full-width",children:[l.jsx(j,{className:"left",children:l.jsx(_,{variant:"h3",children:d("common.components")})}),l.jsx(j,{sx:{flex:1},children:l.jsx(tt,{disabled:f||L,app:p,value:c.blockletComponents,onChange:N=>{h({blockletComponents:N})}})})]})]})]})}ot.propTypes={};ot.defaultProps={};const Rl=K.div`
|
|
135
|
+
`,pt=["image/*",".jpg",".jpeg",".png",".gif",".svg"],ft=1024*1024*10;var bt;const we=(bt=window.env)==null?void 0:bt.serverEndpoint,mt=x.lazy(()=>Ft(()=>import("./react-9zU2PV91.js").then(e=>e.r),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25])).then(e=>({default:e.Uploader}))),vl=(e,t,o)=>{const n=[];return e.blockletTitle||n.push({param:"blockletTitle",message:o("blocklet.publish.errorTip.noTitle")}),e.blockletVersion?Ie.valid(e.blockletVersion)||n.push({param:"blockletVersion",message:"Invalid Blocklet Version"}):n.push({param:"blockletVersion",message:o("blocklet.publish.errorTip.noVersion")}),t===z.PROJECT.RELEASE_STATUS.published&&(e.blockletDescription||n.push({param:"blockletDescription",message:o("blocklet.publish.errorTip.noDescription")}),e.note||n.push({param:"note",message:o("blocklet.publish.errorTip.noNote")})),n.length?n:null},El=({tabs:e,blocklet:t,ancestors:o=[]})=>{const n=t.meta.did;e.push({label:l.jsxs(j,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:[l.jsx(We,{size:24,blocklet:t,ancestors:o}),l.jsx(j,{ml:"4px",className:"text",children:l.jsx(j,{children:t.meta.title})})]},n),value:n})},ht=(e,t)=>{const o=Fe(e,["blockletVersion","blockletTitle","blockletDescription","blockletLogo","blockletIntroduction","blockletScreenshots","blockletComponents","note"]);return o.blockletScreenshots||(o.blockletScreenshots=[]),o.blockletComponents?o.blockletComponents=o.blockletComponents.map(n=>({...n,included:!0})):o.blockletComponents=(t.children||[]).map(n=>({did:n.meta.did,included:!0,required:!0})),o};function ot({...e}){var Ne,O,ee;const t=gt(),{projectId:o,releaseId:n,componentDid:a}=ye(),{t:d}=ne(),{blocklet:p}=ge(),[c,h]=Ut(null),[u,b]=x.useState({}),[f,g]=x.useState(!1),[i,s]=x.useState(!1),[r,m]=x.useState(null),{api:y}=xe(),C=x.useRef(null),k=x.useRef(null),[S,E]=x.useState(),[I,R]=x.useState(),D=n==="create"?"":n,T=n==="create"?"create":"edit",B=[],H=((p==null?void 0:p.children)||[]).filter(N=>{var A;return(A=N.meta.resource)==null?void 0:A.exportApi}).filter(N=>!a||N.meta.did===a);H.forEach(N=>{El({tabs:B,blocklet:N,t:d,ancestors:[p]})});const[je,Ce]=x.useState((Ne=B[0])==null?void 0:Ne.value),oe=(r==null?void 0:r.status)==="published",L=oe,le=({typeOnly:N}={})=>{y.getProject({input:{did:p.meta.did,projectId:o}}).then(A=>{g(!1);const P=A.project||{};if(N){E(P.type);return}P.blockletVersion?Ie.valid(P.blockletVersion)&&(P.blockletVersion=Ie.inc(P.blockletVersion,"patch")):P.blockletVersion="1.0.0",h(ht(P,p)),E(P.type)}).catch(A=>{g(!1),$.error(Ee(A))})},ie=()=>{y.getRelease({input:{did:p.meta.did,projectId:o,releaseId:D}}).then(N=>{g(!1),h(ht(N==null?void 0:N.release,p)),m(N==null?void 0:N.release)}).catch(N=>{g(!1),$.error(Ee(N))})},J=x.useCallback(()=>{if(T==="edit"){if(!D){$.error("Empty release id");return}ie(),le({typeOnly:!0})}T==="create"&&le()},[T,D]);x.useEffect(()=>{J()},[J]);const Z=N=>{const A=vl(c,N,d);if(A){$.error(A.map(M=>M.message).join("; ")),b(A.reduce((M,U)=>({...M,[U.param]:U.message}),{}));return}const P={...c};if(P.blockletVersion=Ie.valid(P.blockletVersion),!P.blockletVersion){$.error("Invalid Blocklet Version"),b({blockletVersion:"Invalid Blocklet Version"});return}P.blockletTitle=(P.blockletTitle||"").trim(),P.blockletDescription=(P.blockletDescription||"").trim(),P.blockletIntroduction=(P.blockletIntroduction||"").trim(),P.note=(P.note||"").trim(),S==="pack"?P.blockletComponents=(P.blockletComponents||[]).filter(M=>M.included).map(M=>Fe(M,["did","required"])).map(JSON.stringify):delete P.blockletComponents,s(N),g(!0),y.createRelease({input:{...P,did:p.meta.did,projectId:o,releaseId:D,status:N}}).then(M=>{var U;if(s(!1),g(!1),N==="draft"?$.success(d("blocklet.publish.saveDraftSuccess")):$.success(d("blocklet.publish.createReleaseSuccess")),T==="create"){const Bt=(U=M==null?void 0:M.release)==null?void 0:U.id;t(`../${o}/${Bt}`,{replace:!0})}else ie()}).catch(M=>{s(!1),g(!1);const U=Ee(M);$.error(U),/resource.*empty/.test(U)&&b({blockletResource:U})})};if(!c&&f)return l.jsx(ke,{});if(!c)return null;const ce=`${pe.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${p.meta.did}/${o}/logo/upload`,se=`${pe.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${p.meta.did}/${o}/screenshot/upload`,ae=c!=null&&c.blockletLogo?`${ce}/${c.blockletLogo}`:`${pe.WELLKNOWN_SERVICE_PATH_PREFIX}/static/images/logo.png`,Y=((c==null?void 0:c.blockletScreenshots)||[]).filter(Boolean).map(N=>`${se}/${N}`),V=H.find(N=>N.meta.did===je),de=V?l.jsx(j,{children:l.jsx(et,{error:u.blockletResource,app:p,component:V,projectId:o,release:{...r,id:D},onSave:N=>{N.length&&b({blockletResource:""})}})}):l.jsx(j,{display:"flex",mt:-3,children:l.jsx(Vt,{children:d("common.empty")})}),ue=N=>{Ce(N)};let Q=null;if(oe&&we){const N=me(we,`/api/project/${p.meta.did}/${o}/${D}/release/blocklet.json`);if(S==="pack"){const A=new URL(we);A.pathname=me(A.pathname,"/launch-blocklet/agreement"),A.searchParams.set("blocklet_meta_url",N),Q=l.jsx(F,{variant:"outlined",style:{marginRight:8},children:l.jsx("a",{href:A.href,target:"_blank",rel:"noreferrer",children:d("common.install")})})}else Q=l.jsxs(l.Fragment,{children:[l.jsx(F,{variant:"outlined",style:{marginRight:8},onClick:()=>R(N),children:d("common.install")}),l.jsx(lo,{fullWidth:!0,maxWidth:"sm",open:I,onClose:()=>R(""),children:l.jsxs(j,{sx:{py:5,px:4,wordBreak:"break-all"},children:[l.jsx(_,{variant:"h6",sx:{mb:2},children:d("blocklet.publish.installResourceTip")}),l.jsx(no,{children:I}),l.jsxs(_,{sx:{mt:2},children:[d("blocklet.publish.installResourceTip2"),l.jsx("a",{style:{marginLeft:4},href:"https://www.arcblock.io/docs/blocklet-developer/R3weqCy7WPI8ggudt0C2alWv",target:"_blank",rel:"noreferrer",children:d("blocklet.publish.installResourceHelp")})]})]})})]})}return l.jsxs(Rl,{...e,children:[l.jsxs(j,{className:"sticky-header",children:[l.jsxs(qe,{className:"breadcrumbs","aria-label":"breadcrumb",children:[l.jsx(W,{to:"../",children:d("common.publish")}),l.jsx(W,{to:`../${o}`,children:(c==null?void 0:c.blockletTitle)||"Blocklet"}),l.jsx(_,{color:"text.primary",children:T==="create"?d("common.create"):(c==null?void 0:c.blockletVersion)||d("common.edit")})]}),l.jsxs(j,{display:"flex",children:[!oe&&l.jsxs(l.Fragment,{children:[l.jsxs(F,{variant:"outlined",disabled:f||i,onClick:()=>Z(z.PROJECT.RELEASE_STATUS.draft),style:{marginRight:12},children:[i===z.PROJECT.RELEASE_STATUS.draft&&l.jsx($e,{size:14,sx:{mr:.5}}),d("blocklet.publish.saveDraft")]}),l.jsxs(F,{variant:"contained",disabled:f||i,onClick:()=>Z(z.PROJECT.RELEASE_STATUS.published),children:[i===z.PROJECT.RELEASE_STATUS.published&&l.jsx($e,{size:14,sx:{mr:.5},color:"inherit"}),d("common.release")]})]}),oe&&l.jsxs(l.Fragment,{children:[Q,l.jsx(F,{variant:"contained",children:l.jsx("a",{href:me(`${pe.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${p.meta.did}/${o}/${D}/download/${(r.files||[])[0]}`),children:d("common.download")})})]})]})]}),l.jsxs(j,{children:[S==="pack"&&l.jsx(so,{type:"info",style:{width:"100%"},children:d("blocklet.publish.packTip")}),l.jsx(j,{pt:3}),l.jsxs(j,{display:"flex",className:"section",children:[l.jsx(_,{variant:"h3",className:"left",children:d("blocklet.publish.productTitle")}),l.jsxs(j,{sx:{flex:1},children:[l.jsx(X,{label:`Blocklet ${d("common.title")}`,placeholder:`Blocklet ${d("common.title")}`,InputProps:{"data-cy":"blocklet-title",readOnly:L},autoComplete:"off",variant:"outlined",fullWidth:!0,required:!0,value:c.blockletTitle||"",onChange:N=>{b({blockletTitle:""}),h({blockletTitle:N.target.value})},error:!!u.blockletTitle,helperText:u.blockletTitle||""}),l.jsx(X,{label:`Blocklet ${d("common.description")}`,placeholder:`Blocklet ${d("common.description")}`,InputProps:{"data-cy":"blocklet-description",readOnly:L},required:!0,autoComplete:"off",variant:"outlined",fullWidth:!0,value:c.blockletDescription||"",onChange:N=>{b({blockletDescription:""}),h({blockletDescription:N.target.value})},error:!!u.blockletDescription,helperText:u.blockletDescription||"",sx:{mt:3}}),l.jsx(X,{label:`Blocklet ${d("common.introduction")}`,placeholder:`Blocklet ${d("common.introduction")}`,InputProps:{"data-cy":"export-blocklet-introduction",readOnly:L,endAdornment:l.jsxs(Be,{position:"end",children:[((O=c==null?void 0:c.blockletIntroduction)==null?void 0:O.length)||0," / ",z.PROJECT.MAX_INTRO_LENGTH]})},autoComplete:"off",variant:"outlined",fullWidth:!0,multiline:!0,minRows:4,value:c.blockletIntroduction||"",onChange:N=>{b({blockletIntroduction:""}),h({blockletIntroduction:N.target.value.slice(0,z.PROJECT.MAX_INTRO_LENGTH)})},error:!!u.blockletIntroduction,helperText:u.blockletIntroduction||"",sx:{mt:3}})]})]}),l.jsxs(j,{display:"flex",mt:3,className:"section",children:[l.jsx(_,{variant:"h3",className:"left",children:d("blocklet.publish.versionTitle")}),l.jsxs(j,{sx:{flex:1},children:[l.jsx(X,{required:!0,label:`Blocklet ${d("common.version")}`,placeholder:`Blocklet ${d("common.version")}`,InputProps:{"data-cy":"blocklet-version",readOnly:L},autoComplete:"off",variant:"outlined",fullWidth:!0,value:c.blockletVersion,onChange:N=>{b({blockletVersion:""}),h({blockletVersion:N.target.value})},error:!!u.blockletVersion,helperText:u.blockletVersion||""}),l.jsx(X,{label:d("blocklet.publish.releaseNote"),autoComplete:"off",variant:"outlined",InputProps:{"data-cy":"release-note",readOnly:L,endAdornment:l.jsxs(Be,{position:"end",children:[((ee=c==null?void 0:c.note)==null?void 0:ee.length)||0," / ",z.PROJECT.MAX_NOTE_LENGTH]})},fullWidth:!0,multiline:!0,minRows:4,required:!0,value:c.note,onChange:N=>{b({note:""}),h({note:N.target.value.slice(0,z.PROJECT.MAX_NOTE_LENGTH)})},error:!!u.note,helperText:u.note||"",sx:{mt:3}})]})]}),l.jsxs(j,{display:"flex",mt:3,className:"section full-width",children:[l.jsx(_,{variant:"h3",className:"left",children:d("blocklet.publish.imgTitle")}),l.jsxs(j,{sx:{flex:1},children:[l.jsxs(j,{display:"flex",children:[l.jsx(_,{variant:"subtitle1",sx:{mr:2},children:d("common.logo")}),l.jsx(j,{sx:{flex:1,cursor:L?"default":"pointer"},children:l.jsx(ao,{variant:"square",sx:{width:80,height:80},alt:"Blocklet Logo",src:ae,onClick:()=>!L&&C.current.open()})})]}),l.jsxs(j,{display:"flex",mt:3,children:[l.jsx(_,{variant:"subtitle1",sx:{mr:2},children:d("common.screenshot")}),l.jsxs(j,{display:"flex",alignItems:"center",sx:{flex:1,flexWrap:"wrap"},children:[Y.map((N,A)=>l.jsxs(j,{className:"screenshot",children:[l.jsx("img",{alt:"screenshot",src:N}),!L&&l.jsx(ve,{className:"action",onClick:()=>{const P=[...c.blockletScreenshots];P.splice(A,1),h({blockletScreenshots:P})},children:l.jsx(to,{})})]})),Y.length<5&&l.jsx(j,{sx:{width:200,height:140,background:"#eee",cursor:L?"default":"pointer",color:"#999",mb:2},display:"flex",justifyContent:"center",alignItems:"center",fontSize:40,onClick:()=>!L&&k.current.open(),children:"+"})]})]})]}),l.jsx(mt,{id:"uploader-logo",ref:C,popup:!0,onUploadFinish:N=>{h({blockletLogo:N.data.filename}),C.current.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:ce,disableMediaKitPrefix:!0},coreProps:{restrictions:{allowedFileTypes:pt,maxFileSize:ft,maxNumberOfFiles:1}}},"uploader-logo"),l.jsx(mt,{id:"uploader-screenshot",ref:k,popup:!0,onUploadFinish:N=>{var P;const A=c.blockletScreenshots||[];A.push((P=N.data)==null?void 0:P.filename),h({blockletScreenshots:A}),k.current.close()},plugins:["ImageEditor"],apiPathProps:{uploader:se,disableMediaKitPrefix:!0},coreProps:{restrictions:{allowedFileTypes:pt,maxFileSize:ft,maxNumberOfFiles:5-Y.length}}},"uploader-screenshot")]}),l.jsxs(j,{display:"flex",mt:3,className:"section full-width",children:[l.jsx(j,{className:"left",children:l.jsx(_,{variant:"h3",children:d("blocklet.publish.resourceTitle")})}),l.jsxs(j,{sx:{flex:1},children:[l.jsx(oo,{tabs:B,current:je,onChange:ue,sx:{ml:-2,mt:-1.5}}),l.jsx(j,{children:de})]})]}),S==="pack"&&l.jsxs(j,{display:"flex",mt:3,className:"section full-width",children:[l.jsx(j,{className:"left",children:l.jsx(_,{variant:"h3",children:d("common.components")})}),l.jsx(j,{sx:{flex:1},children:l.jsx(tt,{disabled:f||L,app:p,value:c.blockletComponents,onChange:N=>{h({blockletComponents:N})}})})]})]})]})}ot.propTypes={};ot.defaultProps={};const Rl=K.div`
|
|
136
136
|
.sticky-header {
|
|
137
137
|
margin-top: -12px;
|
|
138
138
|
padding: 12px 0;
|
|
@@ -219,7 +219,7 @@ import{j as l,_ as v,ea as lt,f as te,g as _e,a as Le,r as x,h as he,i as Me,P a
|
|
|
219
219
|
`;export{Dt as default};
|
|
220
220
|
function __vite__mapDeps(indexes) {
|
|
221
221
|
if (!__vite__mapDeps.viteFileDeps) {
|
|
222
|
-
__vite__mapDeps.viteFileDeps = ["assets/react-
|
|
222
|
+
__vite__mapDeps.viteFileDeps = ["assets/react-9zU2PV91.js","assets/index-A3qaKAQZ.js","assets/index-TCTrVMXW.css","assets/index-fefNq3JS.js","assets/preact.module-yJdvQMHZ.js","assets/index-XsRmOT5P.js","assets/index-m4TSpDqh.js","assets/toUpper-cifwXOtQ.js","assets/index-IZZ7I0WA.js","assets/fallback-U1OX2XSx.js","assets/index-av1Ii_pg.js","assets/Toolbar-TavQhk9k.js","assets/Hidden--yepz0pM.js","assets/ExpandMore-73ZaztzD.js","assets/index-Z09DYyo5.js","assets/selector-Dk6vMXQs.js","assets/index-9lo56i1W.js","assets/RevokeIcon-EG-Tgs1P.js","assets/index-fjKBcmH5.js","assets/index-9udvO7eN.js","assets/index-yufFTVXz.js","assets/index-8MsQJXFD.js","assets/FormControlLabel-k9sTwU-b.js","assets/createStack-Ql4z3puD.js","assets/uniqBy-2Vt9UR0B.js","assets/react-yqGXLqWb.css"]
|
|
223
223
|
}
|
|
224
224
|
return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
|
|
225
225
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as Je,g as Ke,Q as re,br as et,c as B,_ as O,r as x,U as Ee,f as we,j as a,h as $,i as tt,a2 as St,cT as Mt,cL as $t,by as me,cU as _t,aT as ke,cV as rt,cW as ee,P as i,cX as ge,k as xe,bP as P,ai as It,aC as Oe,L as pe,R as F,cp as Lt,bu as nt,Y as _,bQ as zt,cY as Dt,cw as Ht,cZ as Bt,c_ as Ft,c$ as qt}from"./index-uucW8lyA.js";import{T as Wt}from"./Toolbar-yNKPFPYf.js";import{H as ot}from"./Hidden-GZpNG8Fn.js";import{d as Ut}from"./ExpandMore-sVVVrdQE.js";const je={50:"#e0f2f1",100:"#b2dfdb",200:"#80cbc4",300:"#4db6ac",400:"#26a69a",500:"#009688",600:"#00897b",700:"#00796b",800:"#00695c",900:"#004d40",A100:"#a7ffeb",A200:"#64ffda",A400:"#1de9b6",A700:"#00bfa5"};function Vt(e){return Je("MuiAppBar",e)}Ke("MuiAppBar",["root","positionFixed","positionAbsolute","positionSticky","positionStatic","positionRelative","colorDefault","colorPrimary","colorSecondary","colorInherit","colorTransparent","colorError","colorInfo","colorSuccess","colorWarning"]);const Yt=["className","color","enableColorOnDark","position"],Gt=e=>{const{color:t,position:r,classes:n}=e,o={root:["root",`color${B(t)}`,`position${B(r)}`]};return tt(o,Vt,n)},de=(e,t)=>e?`${e==null?void 0:e.replace(")","")}, ${t})`:t,Xt=re(et,{name:"MuiAppBar",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[`position${B(r.position)}`],t[`color${B(r.color)}`]]}})(({theme:e,ownerState:t})=>{const r=e.palette.mode==="light"?e.palette.grey[100]:e.palette.grey[900];return O({display:"flex",flexDirection:"column",width:"100%",boxSizing:"border-box",flexShrink:0},t.position==="fixed"&&{position:"fixed",zIndex:(e.vars||e).zIndex.appBar,top:0,left:"auto",right:0,"@media print":{position:"absolute"}},t.position==="absolute"&&{position:"absolute",zIndex:(e.vars||e).zIndex.appBar,top:0,left:"auto",right:0},t.position==="sticky"&&{position:"sticky",zIndex:(e.vars||e).zIndex.appBar,top:0,left:"auto",right:0},t.position==="static"&&{position:"static"},t.position==="relative"&&{position:"relative"},!e.vars&&O({},t.color==="default"&&{backgroundColor:r,color:e.palette.getContrastText(r)},t.color&&t.color!=="default"&&t.color!=="inherit"&&t.color!=="transparent"&&{backgroundColor:e.palette[t.color].main,color:e.palette[t.color].contrastText},t.color==="inherit"&&{color:"inherit"},e.palette.mode==="dark"&&!t.enableColorOnDark&&{backgroundColor:null,color:null},t.color==="transparent"&&O({backgroundColor:"transparent",color:"inherit"},e.palette.mode==="dark"&&{backgroundImage:"none"})),e.vars&&O({},t.color==="default"&&{"--AppBar-background":t.enableColorOnDark?e.vars.palette.AppBar.defaultBg:de(e.vars.palette.AppBar.darkBg,e.vars.palette.AppBar.defaultBg),"--AppBar-color":t.enableColorOnDark?e.vars.palette.text.primary:de(e.vars.palette.AppBar.darkColor,e.vars.palette.text.primary)},t.color&&!t.color.match(/^(default|inherit|transparent)$/)&&{"--AppBar-background":t.enableColorOnDark?e.vars.palette[t.color].main:de(e.vars.palette.AppBar.darkBg,e.vars.palette[t.color].main),"--AppBar-color":t.enableColorOnDark?e.vars.palette[t.color].contrastText:de(e.vars.palette.AppBar.darkColor,e.vars.palette[t.color].contrastText)},{backgroundColor:"var(--AppBar-background)",color:t.color==="inherit"?"inherit":"var(--AppBar-color)"},t.color==="transparent"&&{backgroundImage:"none",backgroundColor:"transparent",color:"inherit"}))}),Qt=x.forwardRef(function(t,r){const n=Ee({props:t,name:"MuiAppBar"}),{className:o,color:s="primary",enableColorOnDark:d=!1,position:l="fixed"}=n,c=we(n,Yt),u=O({},n,{color:s,position:l,enableColorOnDark:d}),p=Gt(u);return a.jsx(Xt,O({square:!0,component:"header",ownerState:u,elevation:4,className:$(p.root,o,l==="fixed"&&"mui-fixed"),ref:r},c))}),Zt=Qt,Jt=St({createStyledComponent:re("div",{name:"MuiContainer",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[`maxWidth${B(String(r.maxWidth))}`],r.fixed&&t.fixed,r.disableGutters&&t.disableGutters]}}),useThemeProps:e=>Ee({props:e,name:"MuiContainer"})}),ne=Jt;function Kt(e){return Je("MuiDrawer",e)}Ke("MuiDrawer",["root","docked","paper","paperAnchorLeft","paperAnchorRight","paperAnchorTop","paperAnchorBottom","paperAnchorDockedLeft","paperAnchorDockedRight","paperAnchorDockedTop","paperAnchorDockedBottom","modal"]);const er=["BackdropProps"],tr=["anchor","BackdropProps","children","className","elevation","hideBackdrop","ModalProps","onClose","open","PaperProps","SlideProps","TransitionComponent","transitionDuration","variant"],at=(e,t)=>{const{ownerState:r}=e;return[t.root,(r.variant==="permanent"||r.variant==="persistent")&&t.docked,t.modal]},rr=e=>{const{classes:t,anchor:r,variant:n}=e,o={root:["root"],docked:[(n==="permanent"||n==="persistent")&&"docked"],modal:["modal"],paper:["paper",`paperAnchor${B(r)}`,n!=="temporary"&&`paperAnchorDocked${B(r)}`]};return tt(o,Kt,t)},nr=re(Mt,{name:"MuiDrawer",slot:"Root",overridesResolver:at})(({theme:e})=>({zIndex:(e.vars||e).zIndex.drawer})),Ue=re("div",{shouldForwardProp:$t,name:"MuiDrawer",slot:"Docked",skipVariantsResolver:!1,overridesResolver:at})({flex:"0 0 auto"}),or=re(et,{name:"MuiDrawer",slot:"Paper",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.paper,t[`paperAnchor${B(r.anchor)}`],r.variant!=="temporary"&&t[`paperAnchorDocked${B(r.anchor)}`]]}})(({theme:e,ownerState:t})=>O({overflowY:"auto",display:"flex",flexDirection:"column",height:"100%",flex:"1 0 auto",zIndex:(e.vars||e).zIndex.drawer,WebkitOverflowScrolling:"touch",position:"fixed",top:0,outline:0},t.anchor==="left"&&{left:0},t.anchor==="top"&&{top:0,left:0,right:0,height:"auto",maxHeight:"100%"},t.anchor==="right"&&{right:0},t.anchor==="bottom"&&{top:"auto",left:0,bottom:0,right:0,height:"auto",maxHeight:"100%"},t.anchor==="left"&&t.variant!=="temporary"&&{borderRight:`1px solid ${(e.vars||e).palette.divider}`},t.anchor==="top"&&t.variant!=="temporary"&&{borderBottom:`1px solid ${(e.vars||e).palette.divider}`},t.anchor==="right"&&t.variant!=="temporary"&&{borderLeft:`1px solid ${(e.vars||e).palette.divider}`},t.anchor==="bottom"&&t.variant!=="temporary"&&{borderTop:`1px solid ${(e.vars||e).palette.divider}`})),it={left:"right",right:"left",top:"down",bottom:"up"};function ar(e){return["left","right"].indexOf(e)!==-1}function ir(e,t){return e.direction==="rtl"&&ar(t)?it[t]:t}const sr=x.forwardRef(function(t,r){const n=Ee({props:t,name:"MuiDrawer"}),o=me(),s={enter:o.transitions.duration.enteringScreen,exit:o.transitions.duration.leavingScreen},{anchor:d="left",BackdropProps:l,children:c,className:u,elevation:p=16,hideBackdrop:f=!1,ModalProps:{BackdropProps:h}={},onClose:m,open:b=!1,PaperProps:y={},SlideProps:T,TransitionComponent:j=_t,transitionDuration:C=s,variant:E="temporary"}=n,L=we(n.ModalProps,er),S=we(n,tr),R=x.useRef(!1);x.useEffect(()=>{R.current=!0},[]);const N=ir(o,d),W=O({},n,{anchor:d,elevation:p,open:b,variant:E},S),M=rr(W),le=a.jsx(or,O({elevation:E==="temporary"?p:0,square:!0},y,{className:$(M.paper,y.className),ownerState:W,children:c}));if(E==="permanent")return a.jsx(Ue,O({className:$(M.root,M.docked,u),ownerState:W,ref:r},S,{children:le}));const ce=a.jsx(j,O({in:b,direction:it[N],timeout:C,appear:R.current},T,{children:le}));return E==="persistent"?a.jsx(Ue,O({className:$(M.root,M.docked,u),ownerState:W,ref:r},S,{children:ce})):a.jsx(nr,O({BackdropProps:O({},l,h,{transitionDuration:C}),className:$(M.root,M.modal,u),open:b,ownerState:W,onClose:m,hideBackdrop:f,ref:r},S,L,{children:ce}))}),st=sr;function lr(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var lt=x,cr=lr(lt);function Ve(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function dr(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var ur=!!(typeof window<"u"&&window.document&&window.document.createElement);function pr(e,t,r){if(typeof e!="function")throw new Error("Expected reducePropsToState to be a function.");if(typeof t!="function")throw new Error("Expected handleStateChangeOnClient to be a function.");if(typeof r<"u"&&typeof r!="function")throw new Error("Expected mapStateOnServer to either be undefined or a function.");function n(o){return o.displayName||o.name||"Component"}return function(s){if(typeof s!="function")throw new Error("Expected WrappedComponent to be a React component.");var d=[],l;function c(){l=e(d.map(function(p){return p.props})),u.canUseDOM?t(l):r&&(l=r(l))}var u=function(p){dr(f,p);function f(){return p.apply(this,arguments)||this}f.peek=function(){return l},f.rewind=function(){if(f.canUseDOM)throw new Error("You may only call rewind() on the server. Call peek() to read the current state.");var b=l;return l=void 0,d=[],b};var h=f.prototype;return h.UNSAFE_componentWillMount=function(){d.push(this),c()},h.componentDidUpdate=function(){c()},h.componentWillUnmount=function(){var b=d.indexOf(this);d.splice(b,1),c()},h.render=function(){return cr.createElement(s,this.props)},f}(lt.PureComponent);return Ve(u,"displayName","SideEffect("+n(s)+")"),Ve(u,"canUseDOM",ur),u}}var fr=pr;const hr=ke(fr);var mr=typeof Element<"u",gr=typeof Map=="function",xr=typeof Set=="function",vr=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function ue(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var r,n,o;if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(n=r;n--!==0;)if(!ue(e[n],t[n]))return!1;return!0}var s;if(gr&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(s=e.entries();!(n=s.next()).done;)if(!t.has(n.value[0]))return!1;for(s=e.entries();!(n=s.next()).done;)if(!ue(n.value[1],t.get(n.value[0])))return!1;return!0}if(xr&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(s=e.entries();!(n=s.next()).done;)if(!t.has(n.value[0]))return!1;return!0}if(vr&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(r=e.length,r!=t.length)return!1;for(n=r;n--!==0;)if(e[n]!==t[n])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&typeof e.valueOf=="function"&&typeof t.valueOf=="function")return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&typeof e.toString=="function"&&typeof t.toString=="function")return e.toString()===t.toString();if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!Object.prototype.hasOwnProperty.call(t,o[n]))return!1;if(mr&&e instanceof Element)return!1;for(n=r;n--!==0;)if(!((o[n]==="_owner"||o[n]==="__v"||o[n]==="__o")&&e.$$typeof)&&!ue(e[o[n]],t[o[n]]))return!1;return!0}return e!==e&&t!==t}var br=function(t,r){try{return ue(t,r)}catch(n){if((n.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw n}};const yr=ke(br);/*
|
|
1
|
+
import{a as Je,g as Ke,Q as re,br as et,c as B,_ as O,r as x,U as Ee,f as we,j as a,h as $,i as tt,a2 as St,cU as Mt,cM as $t,by as me,cV as _t,aT as ke,cW as rt,cX as ee,P as i,cY as ge,k as xe,bQ as P,ai as It,aC as Oe,L as pe,R as F,cq as Lt,bu as nt,Y as _,bR as zt,cZ as Dt,cx as Ht,c_ as Bt,c$ as Ft,d0 as qt}from"./index-A3qaKAQZ.js";import{T as Wt}from"./Toolbar-TavQhk9k.js";import{H as ot}from"./Hidden--yepz0pM.js";import{d as Ut}from"./ExpandMore-73ZaztzD.js";const je={50:"#e0f2f1",100:"#b2dfdb",200:"#80cbc4",300:"#4db6ac",400:"#26a69a",500:"#009688",600:"#00897b",700:"#00796b",800:"#00695c",900:"#004d40",A100:"#a7ffeb",A200:"#64ffda",A400:"#1de9b6",A700:"#00bfa5"};function Vt(e){return Je("MuiAppBar",e)}Ke("MuiAppBar",["root","positionFixed","positionAbsolute","positionSticky","positionStatic","positionRelative","colorDefault","colorPrimary","colorSecondary","colorInherit","colorTransparent","colorError","colorInfo","colorSuccess","colorWarning"]);const Yt=["className","color","enableColorOnDark","position"],Gt=e=>{const{color:t,position:r,classes:n}=e,o={root:["root",`color${B(t)}`,`position${B(r)}`]};return tt(o,Vt,n)},de=(e,t)=>e?`${e==null?void 0:e.replace(")","")}, ${t})`:t,Xt=re(et,{name:"MuiAppBar",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[`position${B(r.position)}`],t[`color${B(r.color)}`]]}})(({theme:e,ownerState:t})=>{const r=e.palette.mode==="light"?e.palette.grey[100]:e.palette.grey[900];return O({display:"flex",flexDirection:"column",width:"100%",boxSizing:"border-box",flexShrink:0},t.position==="fixed"&&{position:"fixed",zIndex:(e.vars||e).zIndex.appBar,top:0,left:"auto",right:0,"@media print":{position:"absolute"}},t.position==="absolute"&&{position:"absolute",zIndex:(e.vars||e).zIndex.appBar,top:0,left:"auto",right:0},t.position==="sticky"&&{position:"sticky",zIndex:(e.vars||e).zIndex.appBar,top:0,left:"auto",right:0},t.position==="static"&&{position:"static"},t.position==="relative"&&{position:"relative"},!e.vars&&O({},t.color==="default"&&{backgroundColor:r,color:e.palette.getContrastText(r)},t.color&&t.color!=="default"&&t.color!=="inherit"&&t.color!=="transparent"&&{backgroundColor:e.palette[t.color].main,color:e.palette[t.color].contrastText},t.color==="inherit"&&{color:"inherit"},e.palette.mode==="dark"&&!t.enableColorOnDark&&{backgroundColor:null,color:null},t.color==="transparent"&&O({backgroundColor:"transparent",color:"inherit"},e.palette.mode==="dark"&&{backgroundImage:"none"})),e.vars&&O({},t.color==="default"&&{"--AppBar-background":t.enableColorOnDark?e.vars.palette.AppBar.defaultBg:de(e.vars.palette.AppBar.darkBg,e.vars.palette.AppBar.defaultBg),"--AppBar-color":t.enableColorOnDark?e.vars.palette.text.primary:de(e.vars.palette.AppBar.darkColor,e.vars.palette.text.primary)},t.color&&!t.color.match(/^(default|inherit|transparent)$/)&&{"--AppBar-background":t.enableColorOnDark?e.vars.palette[t.color].main:de(e.vars.palette.AppBar.darkBg,e.vars.palette[t.color].main),"--AppBar-color":t.enableColorOnDark?e.vars.palette[t.color].contrastText:de(e.vars.palette.AppBar.darkColor,e.vars.palette[t.color].contrastText)},{backgroundColor:"var(--AppBar-background)",color:t.color==="inherit"?"inherit":"var(--AppBar-color)"},t.color==="transparent"&&{backgroundImage:"none",backgroundColor:"transparent",color:"inherit"}))}),Qt=x.forwardRef(function(t,r){const n=Ee({props:t,name:"MuiAppBar"}),{className:o,color:s="primary",enableColorOnDark:d=!1,position:l="fixed"}=n,c=we(n,Yt),u=O({},n,{color:s,position:l,enableColorOnDark:d}),p=Gt(u);return a.jsx(Xt,O({square:!0,component:"header",ownerState:u,elevation:4,className:$(p.root,o,l==="fixed"&&"mui-fixed"),ref:r},c))}),Zt=Qt,Jt=St({createStyledComponent:re("div",{name:"MuiContainer",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[`maxWidth${B(String(r.maxWidth))}`],r.fixed&&t.fixed,r.disableGutters&&t.disableGutters]}}),useThemeProps:e=>Ee({props:e,name:"MuiContainer"})}),ne=Jt;function Kt(e){return Je("MuiDrawer",e)}Ke("MuiDrawer",["root","docked","paper","paperAnchorLeft","paperAnchorRight","paperAnchorTop","paperAnchorBottom","paperAnchorDockedLeft","paperAnchorDockedRight","paperAnchorDockedTop","paperAnchorDockedBottom","modal"]);const er=["BackdropProps"],tr=["anchor","BackdropProps","children","className","elevation","hideBackdrop","ModalProps","onClose","open","PaperProps","SlideProps","TransitionComponent","transitionDuration","variant"],at=(e,t)=>{const{ownerState:r}=e;return[t.root,(r.variant==="permanent"||r.variant==="persistent")&&t.docked,t.modal]},rr=e=>{const{classes:t,anchor:r,variant:n}=e,o={root:["root"],docked:[(n==="permanent"||n==="persistent")&&"docked"],modal:["modal"],paper:["paper",`paperAnchor${B(r)}`,n!=="temporary"&&`paperAnchorDocked${B(r)}`]};return tt(o,Kt,t)},nr=re(Mt,{name:"MuiDrawer",slot:"Root",overridesResolver:at})(({theme:e})=>({zIndex:(e.vars||e).zIndex.drawer})),Ue=re("div",{shouldForwardProp:$t,name:"MuiDrawer",slot:"Docked",skipVariantsResolver:!1,overridesResolver:at})({flex:"0 0 auto"}),or=re(et,{name:"MuiDrawer",slot:"Paper",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.paper,t[`paperAnchor${B(r.anchor)}`],r.variant!=="temporary"&&t[`paperAnchorDocked${B(r.anchor)}`]]}})(({theme:e,ownerState:t})=>O({overflowY:"auto",display:"flex",flexDirection:"column",height:"100%",flex:"1 0 auto",zIndex:(e.vars||e).zIndex.drawer,WebkitOverflowScrolling:"touch",position:"fixed",top:0,outline:0},t.anchor==="left"&&{left:0},t.anchor==="top"&&{top:0,left:0,right:0,height:"auto",maxHeight:"100%"},t.anchor==="right"&&{right:0},t.anchor==="bottom"&&{top:"auto",left:0,bottom:0,right:0,height:"auto",maxHeight:"100%"},t.anchor==="left"&&t.variant!=="temporary"&&{borderRight:`1px solid ${(e.vars||e).palette.divider}`},t.anchor==="top"&&t.variant!=="temporary"&&{borderBottom:`1px solid ${(e.vars||e).palette.divider}`},t.anchor==="right"&&t.variant!=="temporary"&&{borderLeft:`1px solid ${(e.vars||e).palette.divider}`},t.anchor==="bottom"&&t.variant!=="temporary"&&{borderTop:`1px solid ${(e.vars||e).palette.divider}`})),it={left:"right",right:"left",top:"down",bottom:"up"};function ar(e){return["left","right"].indexOf(e)!==-1}function ir(e,t){return e.direction==="rtl"&&ar(t)?it[t]:t}const sr=x.forwardRef(function(t,r){const n=Ee({props:t,name:"MuiDrawer"}),o=me(),s={enter:o.transitions.duration.enteringScreen,exit:o.transitions.duration.leavingScreen},{anchor:d="left",BackdropProps:l,children:c,className:u,elevation:p=16,hideBackdrop:f=!1,ModalProps:{BackdropProps:h}={},onClose:m,open:b=!1,PaperProps:y={},SlideProps:T,TransitionComponent:j=_t,transitionDuration:C=s,variant:E="temporary"}=n,L=we(n.ModalProps,er),S=we(n,tr),R=x.useRef(!1);x.useEffect(()=>{R.current=!0},[]);const N=ir(o,d),W=O({},n,{anchor:d,elevation:p,open:b,variant:E},S),M=rr(W),le=a.jsx(or,O({elevation:E==="temporary"?p:0,square:!0},y,{className:$(M.paper,y.className),ownerState:W,children:c}));if(E==="permanent")return a.jsx(Ue,O({className:$(M.root,M.docked,u),ownerState:W,ref:r},S,{children:le}));const ce=a.jsx(j,O({in:b,direction:it[N],timeout:C,appear:R.current},T,{children:le}));return E==="persistent"?a.jsx(Ue,O({className:$(M.root,M.docked,u),ownerState:W,ref:r},S,{children:ce})):a.jsx(nr,O({BackdropProps:O({},l,h,{transitionDuration:C}),className:$(M.root,M.modal,u),open:b,ownerState:W,onClose:m,hideBackdrop:f,ref:r},S,L,{children:ce}))}),st=sr;function lr(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var lt=x,cr=lr(lt);function Ve(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function dr(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var ur=!!(typeof window<"u"&&window.document&&window.document.createElement);function pr(e,t,r){if(typeof e!="function")throw new Error("Expected reducePropsToState to be a function.");if(typeof t!="function")throw new Error("Expected handleStateChangeOnClient to be a function.");if(typeof r<"u"&&typeof r!="function")throw new Error("Expected mapStateOnServer to either be undefined or a function.");function n(o){return o.displayName||o.name||"Component"}return function(s){if(typeof s!="function")throw new Error("Expected WrappedComponent to be a React component.");var d=[],l;function c(){l=e(d.map(function(p){return p.props})),u.canUseDOM?t(l):r&&(l=r(l))}var u=function(p){dr(f,p);function f(){return p.apply(this,arguments)||this}f.peek=function(){return l},f.rewind=function(){if(f.canUseDOM)throw new Error("You may only call rewind() on the server. Call peek() to read the current state.");var b=l;return l=void 0,d=[],b};var h=f.prototype;return h.UNSAFE_componentWillMount=function(){d.push(this),c()},h.componentDidUpdate=function(){c()},h.componentWillUnmount=function(){var b=d.indexOf(this);d.splice(b,1),c()},h.render=function(){return cr.createElement(s,this.props)},f}(lt.PureComponent);return Ve(u,"displayName","SideEffect("+n(s)+")"),Ve(u,"canUseDOM",ur),u}}var fr=pr;const hr=ke(fr);var mr=typeof Element<"u",gr=typeof Map=="function",xr=typeof Set=="function",vr=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function ue(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var r,n,o;if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(n=r;n--!==0;)if(!ue(e[n],t[n]))return!1;return!0}var s;if(gr&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(s=e.entries();!(n=s.next()).done;)if(!t.has(n.value[0]))return!1;for(s=e.entries();!(n=s.next()).done;)if(!ue(n.value[1],t.get(n.value[0])))return!1;return!0}if(xr&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(s=e.entries();!(n=s.next()).done;)if(!t.has(n.value[0]))return!1;return!0}if(vr&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(r=e.length,r!=t.length)return!1;for(n=r;n--!==0;)if(e[n]!==t[n])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&typeof e.valueOf=="function"&&typeof t.valueOf=="function")return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&typeof e.toString=="function"&&typeof t.toString=="function")return e.toString()===t.toString();if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!Object.prototype.hasOwnProperty.call(t,o[n]))return!1;if(mr&&e instanceof Element)return!1;for(n=r;n--!==0;)if(!((o[n]==="_owner"||o[n]==="__v"||o[n]==="__o")&&e.$$typeof)&&!ue(e[o[n]],t[o[n]]))return!1;return!0}return e!==e&&t!==t}var br=function(t,r){try{return ue(t,r)}catch(n){if((n.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw n}};const yr=ke(br);/*
|
|
2
2
|
object-assign
|
|
3
3
|
(c) Sindre Sorhus
|
|
4
4
|
@license MIT
|