@abtnode/blocklet-services 1.16.46 → 1.16.47-beta-20250710-123505-c50a3bdc
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 +11 -0
- package/api/libs/image.js +1 -1
- package/dist/assets/{access-control-CMbWBbA-.js → access-control-D9ajNfrY.js} +1 -1
- package/dist/assets/{add-component-core-C_-47aWH.js → add-component-core-BUbtTpoW.js} +2 -2
- package/dist/assets/{add-resource-CF3PYVap.js → add-resource-CtM0iCKK.js} +1 -1
- package/dist/assets/{addon-BU6EtMS1.js → addon-DCIzT5_Z.js} +1 -1
- package/dist/assets/{advanced-BsXG5Uen.js → advanced-CC1tbROy.js} +1 -1
- package/dist/assets/{appearance-DnQKeY3-.js → appearance-CS0deqWb.js} +1 -1
- package/dist/assets/{arrow-down.svg-CaNNzVmj.js → arrow-down.svg-BykEFw6H.js} +1 -1
- package/dist/assets/{audit-logs-BdTL3Ee_.js → audit-logs-CYNqDQoO.js} +1 -1
- package/dist/assets/{authorize-D3GrNEeY.js → authorize-CXMrv2qg.js} +1 -1
- package/dist/assets/{branding-xOC7tV88.js → branding-BXu_IrWA.js} +2 -2
- package/dist/assets/{branding-DU4A47RN.js → branding-CerBGo3n.js} +1 -1
- package/dist/assets/{bundle-avatar-mX0oF7zo.js → bundle-avatar-BzV5PyCo.js} +1 -1
- package/dist/assets/{complete-DyNDIJOz.js → complete-Derz7Riq.js} +1 -1
- package/dist/assets/{component-DTQzu9Ux.js → component-D_LcLvga.js} +3 -3
- package/dist/assets/{config-DlVTbC3O.js → config-BZak2zrL.js} +1 -1
- package/dist/assets/{config-CLS5JN-Q.js → config-Bzod-0Gd.js} +1 -1
- package/dist/assets/{config-navigation-beAE71Co.js → config-navigation-BIPzVxTz.js} +3 -3
- package/dist/assets/{config-space-p8dvh7nV.js → config-space-bJO1Pq2d.js} +1 -1
- package/dist/assets/{confirm-CCJkd_GP.js → confirm-_x5prMc6.js} +1 -1
- package/dist/assets/{connect-CRMI4vhC.js → connect-DMnnk6Yx.js} +1 -1
- package/dist/assets/{connect-Bscwq6pz.js → connect-Du3HB8Ck.js} +1 -1
- package/dist/assets/{connect-to-DK_UHSXd.js → connect-to-CWHsYUA6.js} +1 -1
- package/dist/assets/{dashboard-EECTIwDT.js → dashboard-e9cJiXmU.js} +3 -3
- package/dist/assets/{delete-confirm-OwSiQs5a.js → delete-confirm-DBhhuh63.js} +1 -1
- package/dist/assets/{domain-Bqb4STve.js → domain-CouGHCP6.js} +1 -1
- package/dist/assets/{domain-action-card-78ZAvOXg.js → domain-action-card-BzjWIWJc.js} +1 -1
- package/dist/assets/{domains-Cc33cE6l.js → domains-BcqusidF.js} +1 -1
- package/dist/assets/{email-CW26NZg4.js → email-BxJbHVNF.js} +1 -1
- package/dist/assets/engine-CbuJOouR.js +1 -0
- package/dist/assets/{exchange-passport-ARTNldc_.js → exchange-passport-D7pdvAln.js} +1 -1
- package/dist/assets/{form-C7DadyRx.js → form-RlCPH3oL.js} +1 -1
- package/dist/assets/{fuel-CdmuLJ5m.js → fuel-BHhjNMAS.js} +1 -1
- package/dist/assets/{gen-access-key-DmGPdafH.js → gen-access-key-Cg9O2Wh7.js} +1 -1
- package/dist/assets/{get-safe-url-CFJ4a0MT.js → get-safe-url-70dNOHyP.js} +1 -1
- package/dist/assets/{home-DSXcBmq0.js → home-BMGT804L.js} +1 -1
- package/dist/assets/{iframe-CTQOWc1h.js → iframe-DnqoUNAW.js} +1 -1
- package/dist/assets/{index-DO3jlY1J.js → index--xoJi0Oj.js} +1 -1
- package/dist/assets/{index-DRCXfYI5.js → index-6xRm42_o.js} +1 -1
- package/dist/assets/{index-DjGGLSgp.js → index-B0stLJYN.js} +1 -1
- package/dist/assets/{index-DaWCw-fb.js → index-BCUaY7ta.js} +1 -1
- package/dist/assets/{index-MvpWBcrT.js → index-BE2l5xAg.js} +1 -1
- package/dist/assets/{index-Bk5yhzGt.js → index-BM8TdfbN.js} +1 -1
- package/dist/assets/{index-waZfnNlB.js → index-BWv4abon.js} +1 -1
- package/dist/assets/{index-Kcu6d0fi.js → index-BfqC3XQE.js} +1 -1
- package/dist/assets/{index-DJhjl40G.js → index-Bqnrq_qv.js} +1 -1
- package/dist/assets/{index-S9T-sBWO.js → index-CDq77s86.js} +4 -4
- package/dist/assets/{index-CzlSSzt5.js → index-CGAgz-tD.js} +1 -1
- package/dist/assets/{index-DMKmqbPb.js → index-CTVZqg23.js} +1 -1
- package/dist/assets/{index-Cs_Iwqc6.js → index-CV2-Ra10.js} +1 -1
- package/dist/assets/{index-n70kyMPo.js → index-Cj5h-Tfb.js} +1 -1
- package/dist/assets/{index-kQLw_ftN.js → index-D830QhSG.js} +1 -1
- package/dist/assets/{index-DYWITQqN.js → index-DAExpjL_.js} +1 -1
- package/dist/assets/{index-DhbrYLsW.js → index-DZZp9n8Q.js} +1 -1
- package/dist/assets/{index-C410XMZO.js → index-Dapt6sZR.js} +1 -1
- package/dist/assets/{index-DKdSMDX6.js → index-DhFdjB1D.js} +1 -1
- package/dist/assets/{index-BuCfItTx.js → index-T7E5JhUh.js} +3 -3
- package/dist/assets/{index-ClY8OPfZ.js → index-ZosxPaRN.js} +1 -1
- package/dist/assets/{index-CnZyhA37.js → index-glbEl-Pn.js} +1 -1
- package/dist/assets/{index-CHgWkvhM.js → index-tnuA-tTl.js} +4 -4
- package/dist/assets/{invitation-S4WXAiey.js → invitation-C6_hcRBi.js} +1 -1
- package/dist/assets/{invite-COY7brfc.js → invite-DLUpRfAh.js} +1 -1
- package/dist/assets/{issue-passport-BSa2KdpC.js → issue-passport-DCSyjcCc.js} +1 -1
- package/dist/assets/{item-C-9-K-dS.js → item-D9OLZ5b9.js} +1 -1
- package/dist/assets/{landing-page-C3ZqUsaQ.js → landing-page-C4ZUBLGU.js} +1 -1
- package/dist/assets/{layout-CFnEKAtz.js → layout-BcCpT3Sj.js} +1 -1
- package/dist/assets/{list-B7ZF5Ul0.js → list-BlDvw1so.js} +1 -1
- package/dist/assets/{list-Dvw6k9Fn.js → list-CJmxDpTz.js} +2 -2
- package/dist/assets/{localization-B4hOUoCq.js → localization-H6VEIn1X.js} +1 -1
- package/dist/assets/{log-CQyBD4pJ.js → log-Bo8H0pew.js} +1 -1
- package/dist/assets/{login-yfGJSAJb.js → login-COCCrN_2.js} +1 -1
- package/dist/assets/{login-oauth-callback-BXAgY8t2.js → login-oauth-callback-BBKbLyu-.js} +1 -1
- package/dist/assets/{logo-uploader-DL_O0r92.js → logo-uploader-CnbjQmUt.js} +2 -2
- package/dist/assets/{lost-passport-BeFjTnh-.js → lost-passport-DsXYEZzf.js} +1 -1
- package/dist/assets/{open-window-PnHF0kAn.js → open-window-LUOmt0hD.js} +1 -1
- package/dist/assets/{over-due-invoice-payment-COY8cvLu.js → over-due-invoice-payment-CuQ5h3hN.js} +1 -1
- package/dist/assets/{overview-Cd-vxOiy.js → overview-Cn9TZC8v.js} +1 -1
- package/dist/assets/{passport-item-DelVKtIt.js → passport-item-DmWZqcWM.js} +1 -1
- package/dist/assets/{permission-B4gBENoO.js → permission-3PNyBKZ2.js} +1 -1
- package/dist/assets/{preferences-CjO06ZIQ.js → preferences-DVGAbEme.js} +1 -1
- package/dist/assets/{profile-embed-BitC6ZoS.js → profile-embed-CI5k42bk.js} +1 -1
- package/dist/assets/{publish-resource-Ck5quuGX.js → publish-resource-EHXQz0a8.js} +1 -1
- package/dist/assets/{runtime-B-Viq2us.js → runtime-WlpSIzes.js} +1 -1
- package/dist/assets/sdk-6bZnDL_f.js +1 -0
- package/dist/assets/{security-J0LBanar.js → security-pXCcg1d2.js} +1 -1
- package/dist/assets/{session-CD-6TrlW.js → session-CvQ97dDY.js} +1 -1
- package/dist/assets/{setup-CpWZbzzi.js → setup-DNMNAWdA.js} +3 -3
- package/dist/assets/{spaces-Jt4I6QVN.js → spaces-DVGE8nur.js} +1 -1
- package/dist/assets/{start-DFxA6tPZ.js → start-CgAXib9j.js} +1 -1
- package/dist/assets/{status-B2xgYwSq.js → status-CxWCFwty.js} +1 -1
- package/dist/assets/{step-actions-BnfP6cxN.js → step-actions-Cmo-e1Kn.js} +1 -1
- package/dist/assets/{studio-CiSsKpFb.js → studio-BoYrF6Kl.js} +1 -1
- package/dist/assets/{traffic-C0Ugjtml.js → traffic-2Q6t1xaL.js} +1 -1
- package/dist/assets/{transfer-BrnC_C-u.js → transfer-B7bfp-Lw.js} +1 -1
- package/dist/assets/{unsubscribe-Df9woQco.js → unsubscribe-B1VOJ7QT.js} +1 -1
- package/dist/assets/{use-blocklet-logo-B1g1jSm8.js → use-blocklet-logo-C7qZcidt.js} +1 -1
- package/dist/assets/{user-center-lZ9ifkcH.js → user-center-BfW2lvH2.js} +3 -3
- package/dist/assets/{user-center-Dicuqlij.js → user-center-Cg8K5HLJ.js} +3 -3
- package/dist/assets/{user-sessions-DmuUfMxJ.js → user-sessions-DEwJRITu.js} +1 -1
- package/dist/assets/{util-Doke8P4Y.js → util-B-cMjJCC.js} +1 -1
- package/dist/assets/{util-BTNHVX94.js → util-CNKleiqU.js} +1 -1
- package/dist/assets/{wrap-locale-CfJqsNLW.js → wrap-locale-Bf1-s-bS.js} +1 -1
- package/dist/assets/{zh-DJzU8mmk.js → zh-CEmPmptr.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/service-worker.js +1 -1
- package/package.json +23 -23
- package/dist/assets/engine-CcVO7RNx.js +0 -1
- package/dist/assets/sdk-Bg2mtU3m.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/user-center-
|
|
2
|
-
import{b as Q,I as X,T as me,_ as be}from"./vendor-ux-TkkDR0Gn.js";import{j as t,E as ye,bu as ve,M as Ce,ak as b,V as F,$ as f,O as de,bX as we,I as je,aN as ke,T as G,aj as Se,b5 as J,S as Z,b6 as ee,C as te,G as Me,H as Pe,cl as Ie,bc as Te,Y as oe,cm as Re,cn as Ee,at as ue,co as Be,p as ne,n as re}from"./vendor-mui-core-p6jGoroc.js";import{r as a,a as Oe,u as Ne,j as $e}from"./vendor-react-x2lQvn4m.js";import{W as ze,aQ as Fe,H as Ae,c as We}from"./index-S9T-sBWO.js";import{t as pe,Y as Le,C as De}from"./vendor-utils-CtD44yV-.js";import{a as O,h as _e}from"./vendor-hooks-zCCbpt45.js";import{l as He}from"./arrow-down.svg-CaNNzVmj.js";import{N as qe}from"./list-B7ZF5Ul0.js";import{d as Ue}from"./search-4YYphs0l.js";import{B as se}from"./bundle-avatar-mX0oF7zo.js";import{c as ie}from"./use-blocklet-logo-B1g1jSm8.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-BndcJjQO.js";import"./server-logo-notext.svg-BqCXmsOm.js";import"./index-DKdSMDX6.js";import"./util-Doke8P4Y.js";import"./base32-6sm6N7JR.js";import"./session-CD-6TrlW.js";function Ye(){let o=new Map;function d({root:x,rootMargin:l,threshold:g}){let h=o.get(x);h||(h=new Map,o.set(x,h));let y=JSON.stringify({rootMargin:l,threshold:g}),u=h.get(y);if(!u){let s=new Map;u={observer:new IntersectionObserver(c=>{c.forEach(p=>{s.get(p.target)?.(p)})},{root:x,rootMargin:l,threshold:g}),entryCallbacks:s},h.set(y,u)}return{observe:(s,c)=>{u.entryCallbacks.set(s,c),u.observer.observe(s)},unobserve:s=>{u.entryCallbacks.delete(s),u.observer.unobserve(s)}}}return{getObserver:d}}var Ve="0px",Ge=[0],Ke=Ye();function Qe(o){let d=o?.rootMargin??Ve,x=o?.threshold??Ge,l=a.useRef(null),g=a.useRef(null),h=a.useRef(null),[y,u]=a.useState(),s=a.useCallback(()=>{let w=l.current;if(!w){u(void 0);return}let k=Ke.getObserver({root:g.current,rootMargin:d,threshold:x});k.observe(w,I=>{u(I)}),h.current=k},[d,x]),c=a.useCallback(()=>{let w=h.current,k=l.current;k&&w?.unobserve(k),h.current=null},[]),p=a.useCallback(w=>{c(),l.current=w,s()},[s,c]),r=a.useCallback(w=>{c(),g.current=w,s()},[s,c]);return[p,{entry:y,rootRef:r}]}var Xe=Qe;function Je(o){let[d,x]=Xe(o),l=!!x.entry?.isIntersecting,[g,h]=a.useState(l);return l&&!g&&h(!0),[d,{...x,isVisible:l,wasEverVisible:g}]}var Ze=Je,et=100;function tt({loading:o,hasNextPage:d,onLoadMore:x,rootMargin:l,disabled:g,delayInMs:h=et}){let y=a.useRef(x),[u,{rootRef:s,isVisible:c}]=Ze({rootMargin:l});a.useEffect(()=>{y.current=x},[x]);let p=!g&&!o&&c&&d;return a.useEffect(()=>{if(p){let r=setTimeout(()=>{y.current()},h);return()=>{clearTimeout(r)}}},[p,h]),[u,{rootRef:s}]}var ot=tt;const K={info:"#3B82F6",success:"#10B981",warning:"#F59E0B",error:"#EF4444"};H.propTypes={severity:f.oneOf(["info","success","warning","error",""]).isRequired,size:f.number};function H({severity:o,size:d=8}){return K[o]?t.jsx(b,{component:"span",sx:{display:"inline-block",width:d,height:d,borderRadius:"50%",backgroundColor:K[o]||K.info}}):null}fe.propTypes={theme:f.string,type:f.oneOf(["button","line","select"]),onSelectType:f.func,extra:f.node,loading:f.bool,currentTab:f.oneOf(["info","success","warning","error",""])};function fe({theme:o="dark",type:d="button",onSelectType:x,extra:l=void 0,currentTab:g="",loading:h=!1,...y}){const{t:u}=a.useContext(Q),s=[{label:u("notification.allSeverity"),value:""},{label:u("notification.severityType.info"),value:"info"},{label:u("notification.severityType.success"),value:"success"},{label:u("notification.severityType.warning"),value:"warning"},{label:u("notification.severityType.error"),value:"error"}],c=i=>{(i!==g||!h)&&x(i)},p=a.useMemo(()=>{const i={width:"100%",bgcolor:o==="dark"?"#F9FAFB":"",overflowY:"auto",paddingTop:d==="select"?"0":"5px",whiteSpace:"nowrap",borderRadius:0,display:"flex",justifyContent:"space-between",alignItems:"flex-end",flexWrap:"wrap",gap:"8px"};return d==="line"?Object.assign(i,{}):i},[d,o]),r=(i,v,C)=>t.jsx(F,{disabled:h,onClick:()=>c(i.value),className:`profile-button ${v?"active":""}`,...y,children:i.label},i.value||C),w=(i,v,C)=>t.jsx(F,{variant:"text",disabled:h,onClick:()=>c(i.value),className:`profile-line-button ${v?"active":""}`,...y,children:i.label},i.value||C),k=()=>s?.map((i,v)=>{const C=g===i?.value;return d==="line"?t.jsx(a.Fragment,{children:w(i,C,v)},i.value||v):t.jsx(a.Fragment,{children:r(i,C,v)},i.value||v)}),I=i=>{const{value:v}=i.target;c(v==="all"?"":v)};return d==="select"?t.jsx(ye,{sx:{maxWidth:300},children:t.jsx(ve,{value:g||"all",onChange:I,size:"small",label:"Severity",IconComponent:i=>t.jsx(He,{...i,width:20,height:20}),MenuProps:{autoFocus:!1,PaperProps:{style:{maxHeight:400,overflowY:"auto",borderRadius:"8px",boxShadow:"0px 6px 24px rgba(0, 0, 0, 0.15)"}}},variant:"outlined",sx:{fieldset:{border:"none"}},children:s.map((i,v)=>t.jsx(Ce,{value:i.value||"all",children:t.jsxs(b,{sx:{display:"flex",alignItems:"center",gap:1},children:[t.jsx(H,{severity:i.value}),i.label]})},i.value||v))})}):t.jsxs(b,{className:"severity-tabs",sx:p,children:[t.jsx(b,{sx:{...d==="line"?{flex:1,borderBottom:"1px solid",borderColor:"grey.200"}:{display:"flex",gap:"24px"}},children:k()}),l]})}ge.propTypes={paging:f.objectOf(f.any).isRequired,loading:f.bool.isRequired,onChange:f.func.isRequired};function ge({loading:o,paging:d,onChange:x}){const{t:l}=a.useContext(Q),g=de(s=>s.breakpoints.down("md"));if(d.pageCount<=0||g)return null;const h=(s,c)=>{x({page:c+1})},y=s=>{const c=Number(s.target.value);x({page:1,pageSize:c})},u=d.page-1<=0?0:d.page-1;return t.jsx(b,{className:"notification-pagination",sx:{mt:2,display:"flex",justifyContent:"flex-end"},children:t.jsx(we,{component:"div",disabled:o,count:d.total,page:u,rowsPerPageOptions:[10,20,50,100],labelRowsPerPage:l("pagination.rowsPerPage"),labelDisplayedRows:({from:s,to:c,count:p})=>`${s}–${c} / ${p!==-1?p:`${l()}more than ${c}`}`,rowsPerPage:d.pageSize,onPageChange:h,onRowsPerPageChange:y})})}const nt=a.memo(ge),rt={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4h16v2.172a2 2 0 0 1-.586 1.414L15 12v7l-6 2v-8.5L4.52 7.572A2 2 0 0 1 4 6.227V4z"/>'},ae=6,le={"& .MuiCheckbox-root":{padding:"4px"},"& .MuiCheckbox-root .MuiSvgIcon-root":{fontSize:"1.35rem"},"& .MuiCheckbox-root:not(.Mui-checked)":{color:"divider"},"& .MuiCheckbox-root.Mui-checked":{color:"primary.main"},"& .MuiCheckbox-root .css-i4bv87-MuiSvgIcon-root":{width:"1.1em",height:"1.1em"},"& .MuiCheckbox-root svg":{stroke:"divider",strokeWidth:.7}},st={border:"1px solid",borderColor:"divider",borderRadius:1,overflow:"hidden",backgroundColor:"background.paper",backgroundImage:"none",transition:"all 0.2s ease-in-out"},ce=()=>({...st,width:"calc(50% - 8px)"});he.propTypes={loading:f.bool,type:f.oneOf(["server","service"]),onFilterChange:f.func,blockletMap:f.object,filterType:f.oneOf(["component","entity"]),selectedId:f.array,severity:f.array,enableMarkAllAsRead:f.bool,unReadCount:f.number,onReadFilterChange:f.func,currentReadFilter:f.string};function he({onFilterChange:o=()=>{},loading:d=!1,type:x="service",blockletMap:l={},filterType:g="component",selectedId:h=[],severity:y=[],enableMarkAllAsRead:u=!0,unReadCount:s=0,onReadFilterChange:c=()=>{},currentReadFilter:p="all"}){const{t:r}=a.useContext(Q),[w,k]=a.useState(null),I=!!w,[i,v]=a.useState(h),[C,T]=a.useState(y),[M,N]=a.useState(!1),[P,A]=a.useState(""),[R,E]=a.useState([]);a.useEffect(()=>{v(h),T(y)},[h,y]);const $=[{label:r("notification.filterType.all"),value:"all"},{label:r("notification.filterType.unread"),value:"unread"}],W=e=>{(e!==p||!d)&&c(e)},z=[{label:r("notification.severityType.info"),value:"info"},{label:r("notification.severityType.success"),value:"success"},{label:r("notification.severityType.warning"),value:"warning"},{label:r("notification.severityType.error"),value:"error"}],L=e=>{k(e.currentTarget),A(""),N(!1)},q=()=>{k(null)},D=e=>{const n=i.includes(e)?i.filter(m=>m!==e):[...i,e];v(n),o({id:n,severity:C})},_=e=>{const n=C.includes(e)?C.filter(m=>m!==e):[...C,e];T(n),o({severity:n,id:i})},U=e=>{A(e.target.value)},Y=()=>{N(!M)},B=Oe.useMemo(()=>{if(!l.size)return[];const e=[];return g==="component"&&e.push({label:r("notification.system"),id:"system"}),Array.from(l).forEach(([,n])=>{const m=n.did||n.meta?.did,j=n.title||n.meta?.title||"",S=n.appPid||n.appDid;(g==="component"&&S!==m||g==="entity"&&S===m)&&e.push({label:j,id:m,blocklet:n,ancestors:n.ancestors})}),e},[l,g,r]);a.useEffect(()=>{if(P.trim()==="")E(B);else{const e=P.toLowerCase(),n=B.filter(m=>m.label.toLowerCase().includes(e));E(n)}},[P,B]);const V=P.trim()!==""||M?R:R.slice(0,ae);return t.jsxs(b,{children:[t.jsxs(b,{sx:{display:"flex",justifyContent:u?"space-between":"flex-end",alignItems:"flex-start",flexWrap:"wrap",gap:1},children:[u&&t.jsx(b,{sx:{display:"flex",gap:1.5},children:$.map(e=>t.jsxs(F,{disabled:d,onClick:()=>W(e.value),className:`profile-button ${p===e.value?"active":""}`,sx:{...x==="service"&&p===e.value?{color:"secondary.main"}:{},color:"red",fontWeight:p===e.value?"bold":"normal"},children:[e.label,e.value==="unread"&&s>0&&` (${s})`]},e.value))}),t.jsxs(b,{sx:{display:"flex",justifyContent:"flex-end",gap:2},children:[t.jsx(je,{size:"small",onClick:L,disabled:d,sx:{minWidth:"auto",borderRadius:1,border:"1px solid",borderColor:"divider","&:hover":{backgroundColor:"action.hover"}},children:t.jsx(X,{icon:rt,hFlip:!0})}),t.jsx(ke,{open:I,anchorEl:w,onClose:q,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},slotProps:{paper:{sx:{p:3,width:450,maxHeight:500,overflowY:"auto",backgroundColor:"background.paper",backgroundImage:"none",borderRadius:1,boxShadow:"0px 6px 24px rgba(0, 0, 0, 0.15)"}}},children:t.jsxs(b,{children:[t.jsxs(b,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2,height:"28px"},children:[t.jsx(G,{variant:"subtitle1",sx:{fontWeight:"bold"},children:r("notification.severity")}),t.jsx(b,{sx:{minWidth:"60px",display:"flex",justifyContent:"flex-end"},children:(i.length>0||C.length>0)&&t.jsx(F,{size:"small",onClick:()=>{v([]),T([]),o({severity:[],id:[]})},startIcon:t.jsx(Se,{fontSize:"small"}),sx:{color:"text.secondary",textTransform:"none",minWidth:"auto","&:hover":{backgroundColor:"transparent"},"& .MuiButton-startIcon":{marginRight:"2px"}},children:r("notification.clear")})})]}),t.jsx(b,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3},children:t.jsx(J,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:2,flex:1},children:z.map(e=>t.jsx(Z,{elevation:0,sx:ce(C.includes(e.value)),children:t.jsx(ee,{sx:{margin:0,padding:.5,width:"100%","& .MuiFormControlLabel-label":{display:"flex",alignItems:"center",gap:1,fontSize:"0.875rem"},...le},control:t.jsx(te,{checked:C.includes(e.value),onChange:()=>_(e.value),disabled:d,size:"small"}),label:t.jsxs(b,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5},children:[t.jsx(H,{severity:e.value}),e.label]})})},e.value))})}),t.jsxs(b,{sx:{mb:2},children:[t.jsxs(b,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:2,mb:1.5},children:[t.jsx(G,{variant:"subtitle1",sx:{fontWeight:"bold",width:"calc(100% - 36px)"},children:r("notification.from")}),t.jsx(b,{sx:{display:"flex",alignItems:"center",width:"calc(100% - 36px)"},children:t.jsx(Me,{size:"small",placeholder:"search",value:P,onChange:U,sx:{width:"100%","& .MuiOutlinedInput-input":{padding:"6px 4px 6px 0"},".MuiOutlinedInput-root":{"&:hover":{fieldset:{borderColor:"divider"}},"&.Mui-focused":{fieldset:{borderColor:"divider"}}},fieldset:{borderColor:"divider"}},slotProps:{input:{size:"small",startAdornment:t.jsx(Pe,{position:"start",sx:{marginRight:"2px"},children:t.jsx(X,{icon:Ue})})}}})})]}),t.jsx(J,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:2},children:V.map(e=>t.jsx(Z,{elevation:0,sx:ce(i.includes(e.id)),children:t.jsx(ee,{sx:{margin:0,padding:.5,width:"100%","& .MuiFormControlLabel-label":{fontSize:"0.875rem",width:"calc(100% - 36px)"},...le},control:t.jsx(te,{checked:i.includes(e.id),onChange:()=>D(e.id),disabled:d,size:"small"}),label:t.jsxs(b,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5,minWidth:0,width:"100%"},children:[e.blocklet&&t.jsx(se,{size:20,blocklet:e.blocklet,ancestors:e.ancestors,style:{borderRadius:4,flexShrink:0}}),t.jsx(G,{noWrap:!0,variant:"body2",component:"span",title:e.label,sx:{flex:1,overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"},children:e.label})]})})},e.id))}),R.length>ae&&P.trim()===""&&t.jsx(F,{fullWidth:!0,size:"small",onClick:Y,sx:{mt:1},endIcon:M?t.jsx(Ie,{}):t.jsx(Te,{})})]})]})})]})]}),i.length>0||C.length>0?t.jsxs(b,{className:"notification-filter-content",sx:{display:"flex",flexWrap:"wrap",gap:1,mt:2},children:[C.map(e=>{const n=z.find(m=>m.value===e);return t.jsx(oe,{label:t.jsxs(b,{sx:{display:"flex",alignItems:"center",gap:.5},children:[t.jsx(H,{severity:e}),n?n.label:e]}),onDelete:()=>_(e),size:"small",variant:"outlined",sx:{borderRadius:2,color:"text.secondary",borderColor:"divider","& .MuiChip-label":{display:"flex",alignItems:"center"}}},`severity-${e}`)}),i.map(e=>{const n=B.find(m=>m.id===e);return t.jsx(oe,{label:t.jsxs(b,{sx:{display:"flex",alignItems:"center",gap:.5},children:[n?.blocklet&&t.jsx(se,{size:16,blocklet:n.blocklet,ancestors:n.ancestors,style:{borderRadius:4,flexShrink:0}}),n?n.label:e]}),variant:"outlined",onDelete:()=>D(e),size:"small",sx:{borderRadius:2,color:"text.secondary",borderColor:"divider","& .MuiChip-label":{display:"flex",alignItems:"center"}}},`component-${e}`)})]}):null]})}const it=ue(Be)`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/user-center-BfW2lvH2.js","assets/vendor-mui-core-p6jGoroc.js","assets/vendor-react-x2lQvn4m.js","assets/vendor-hooks-zCCbpt45.js","assets/vendor-utils-CtD44yV-.js","assets/index-CDq77s86.js","assets/vendor-ux-TkkDR0Gn.js","assets/lottie-web-4koyQiv_.js","assets/vendor-ux-DYcPPYq2.css","assets/vendor-arcblock-BndcJjQO.js","assets/index-DrVXX4fX.css","assets/index-D830QhSG.js","assets/arrow-down.svg-BykEFw6H.js","assets/user-sessions-DEwJRITu.js","assets/index--xoJi0Oj.js","assets/index-ClQB4tO4.js","assets/github-icon-CH2zo-td.js","assets/index-B0stLJYN.js","assets/index-DRYJ0xIl.js","assets/index-BojVbZw0.js","assets/index-DHPu60AO.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{b as Q,I as X,T as me,_ as be}from"./vendor-ux-TkkDR0Gn.js";import{j as t,E as ye,bu as ve,M as Ce,ak as b,V as F,$ as f,O as de,bX as we,I as je,aN as ke,T as G,aj as Se,b5 as J,S as Z,b6 as ee,C as te,G as Me,H as Pe,cl as Ie,bc as Te,Y as oe,cm as Re,cn as Ee,at as ue,co as Be,p as ne,n as re}from"./vendor-mui-core-p6jGoroc.js";import{r as a,a as Oe,u as Ne,j as $e}from"./vendor-react-x2lQvn4m.js";import{W as ze,aQ as Fe,H as Ae,c as We}from"./index-CDq77s86.js";import{t as pe,Y as Le,C as De}from"./vendor-utils-CtD44yV-.js";import{a as O,h as _e}from"./vendor-hooks-zCCbpt45.js";import{l as He}from"./arrow-down.svg-BykEFw6H.js";import{N as qe}from"./list-BlDvw1so.js";import{d as Ue}from"./search-4YYphs0l.js";import{B as se}from"./bundle-avatar-BzV5PyCo.js";import{c as ie}from"./use-blocklet-logo-C7qZcidt.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-BndcJjQO.js";import"./server-logo-notext.svg-BqCXmsOm.js";import"./index-DhFdjB1D.js";import"./util-B-cMjJCC.js";import"./base32-6sm6N7JR.js";import"./session-CvQ97dDY.js";function Ye(){let o=new Map;function d({root:x,rootMargin:l,threshold:g}){let h=o.get(x);h||(h=new Map,o.set(x,h));let y=JSON.stringify({rootMargin:l,threshold:g}),u=h.get(y);if(!u){let s=new Map;u={observer:new IntersectionObserver(c=>{c.forEach(p=>{s.get(p.target)?.(p)})},{root:x,rootMargin:l,threshold:g}),entryCallbacks:s},h.set(y,u)}return{observe:(s,c)=>{u.entryCallbacks.set(s,c),u.observer.observe(s)},unobserve:s=>{u.entryCallbacks.delete(s),u.observer.unobserve(s)}}}return{getObserver:d}}var Ve="0px",Ge=[0],Ke=Ye();function Qe(o){let d=o?.rootMargin??Ve,x=o?.threshold??Ge,l=a.useRef(null),g=a.useRef(null),h=a.useRef(null),[y,u]=a.useState(),s=a.useCallback(()=>{let w=l.current;if(!w){u(void 0);return}let k=Ke.getObserver({root:g.current,rootMargin:d,threshold:x});k.observe(w,I=>{u(I)}),h.current=k},[d,x]),c=a.useCallback(()=>{let w=h.current,k=l.current;k&&w?.unobserve(k),h.current=null},[]),p=a.useCallback(w=>{c(),l.current=w,s()},[s,c]),r=a.useCallback(w=>{c(),g.current=w,s()},[s,c]);return[p,{entry:y,rootRef:r}]}var Xe=Qe;function Je(o){let[d,x]=Xe(o),l=!!x.entry?.isIntersecting,[g,h]=a.useState(l);return l&&!g&&h(!0),[d,{...x,isVisible:l,wasEverVisible:g}]}var Ze=Je,et=100;function tt({loading:o,hasNextPage:d,onLoadMore:x,rootMargin:l,disabled:g,delayInMs:h=et}){let y=a.useRef(x),[u,{rootRef:s,isVisible:c}]=Ze({rootMargin:l});a.useEffect(()=>{y.current=x},[x]);let p=!g&&!o&&c&&d;return a.useEffect(()=>{if(p){let r=setTimeout(()=>{y.current()},h);return()=>{clearTimeout(r)}}},[p,h]),[u,{rootRef:s}]}var ot=tt;const K={info:"#3B82F6",success:"#10B981",warning:"#F59E0B",error:"#EF4444"};H.propTypes={severity:f.oneOf(["info","success","warning","error",""]).isRequired,size:f.number};function H({severity:o,size:d=8}){return K[o]?t.jsx(b,{component:"span",sx:{display:"inline-block",width:d,height:d,borderRadius:"50%",backgroundColor:K[o]||K.info}}):null}fe.propTypes={theme:f.string,type:f.oneOf(["button","line","select"]),onSelectType:f.func,extra:f.node,loading:f.bool,currentTab:f.oneOf(["info","success","warning","error",""])};function fe({theme:o="dark",type:d="button",onSelectType:x,extra:l=void 0,currentTab:g="",loading:h=!1,...y}){const{t:u}=a.useContext(Q),s=[{label:u("notification.allSeverity"),value:""},{label:u("notification.severityType.info"),value:"info"},{label:u("notification.severityType.success"),value:"success"},{label:u("notification.severityType.warning"),value:"warning"},{label:u("notification.severityType.error"),value:"error"}],c=i=>{(i!==g||!h)&&x(i)},p=a.useMemo(()=>{const i={width:"100%",bgcolor:o==="dark"?"#F9FAFB":"",overflowY:"auto",paddingTop:d==="select"?"0":"5px",whiteSpace:"nowrap",borderRadius:0,display:"flex",justifyContent:"space-between",alignItems:"flex-end",flexWrap:"wrap",gap:"8px"};return d==="line"?Object.assign(i,{}):i},[d,o]),r=(i,v,C)=>t.jsx(F,{disabled:h,onClick:()=>c(i.value),className:`profile-button ${v?"active":""}`,...y,children:i.label},i.value||C),w=(i,v,C)=>t.jsx(F,{variant:"text",disabled:h,onClick:()=>c(i.value),className:`profile-line-button ${v?"active":""}`,...y,children:i.label},i.value||C),k=()=>s?.map((i,v)=>{const C=g===i?.value;return d==="line"?t.jsx(a.Fragment,{children:w(i,C,v)},i.value||v):t.jsx(a.Fragment,{children:r(i,C,v)},i.value||v)}),I=i=>{const{value:v}=i.target;c(v==="all"?"":v)};return d==="select"?t.jsx(ye,{sx:{maxWidth:300},children:t.jsx(ve,{value:g||"all",onChange:I,size:"small",label:"Severity",IconComponent:i=>t.jsx(He,{...i,width:20,height:20}),MenuProps:{autoFocus:!1,PaperProps:{style:{maxHeight:400,overflowY:"auto",borderRadius:"8px",boxShadow:"0px 6px 24px rgba(0, 0, 0, 0.15)"}}},variant:"outlined",sx:{fieldset:{border:"none"}},children:s.map((i,v)=>t.jsx(Ce,{value:i.value||"all",children:t.jsxs(b,{sx:{display:"flex",alignItems:"center",gap:1},children:[t.jsx(H,{severity:i.value}),i.label]})},i.value||v))})}):t.jsxs(b,{className:"severity-tabs",sx:p,children:[t.jsx(b,{sx:{...d==="line"?{flex:1,borderBottom:"1px solid",borderColor:"grey.200"}:{display:"flex",gap:"24px"}},children:k()}),l]})}ge.propTypes={paging:f.objectOf(f.any).isRequired,loading:f.bool.isRequired,onChange:f.func.isRequired};function ge({loading:o,paging:d,onChange:x}){const{t:l}=a.useContext(Q),g=de(s=>s.breakpoints.down("md"));if(d.pageCount<=0||g)return null;const h=(s,c)=>{x({page:c+1})},y=s=>{const c=Number(s.target.value);x({page:1,pageSize:c})},u=d.page-1<=0?0:d.page-1;return t.jsx(b,{className:"notification-pagination",sx:{mt:2,display:"flex",justifyContent:"flex-end"},children:t.jsx(we,{component:"div",disabled:o,count:d.total,page:u,rowsPerPageOptions:[10,20,50,100],labelRowsPerPage:l("pagination.rowsPerPage"),labelDisplayedRows:({from:s,to:c,count:p})=>`${s}–${c} / ${p!==-1?p:`${l()}more than ${c}`}`,rowsPerPage:d.pageSize,onPageChange:h,onRowsPerPageChange:y})})}const nt=a.memo(ge),rt={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4h16v2.172a2 2 0 0 1-.586 1.414L15 12v7l-6 2v-8.5L4.52 7.572A2 2 0 0 1 4 6.227V4z"/>'},ae=6,le={"& .MuiCheckbox-root":{padding:"4px"},"& .MuiCheckbox-root .MuiSvgIcon-root":{fontSize:"1.35rem"},"& .MuiCheckbox-root:not(.Mui-checked)":{color:"divider"},"& .MuiCheckbox-root.Mui-checked":{color:"primary.main"},"& .MuiCheckbox-root .css-i4bv87-MuiSvgIcon-root":{width:"1.1em",height:"1.1em"},"& .MuiCheckbox-root svg":{stroke:"divider",strokeWidth:.7}},st={border:"1px solid",borderColor:"divider",borderRadius:1,overflow:"hidden",backgroundColor:"background.paper",backgroundImage:"none",transition:"all 0.2s ease-in-out"},ce=()=>({...st,width:"calc(50% - 8px)"});he.propTypes={loading:f.bool,type:f.oneOf(["server","service"]),onFilterChange:f.func,blockletMap:f.object,filterType:f.oneOf(["component","entity"]),selectedId:f.array,severity:f.array,enableMarkAllAsRead:f.bool,unReadCount:f.number,onReadFilterChange:f.func,currentReadFilter:f.string};function he({onFilterChange:o=()=>{},loading:d=!1,type:x="service",blockletMap:l={},filterType:g="component",selectedId:h=[],severity:y=[],enableMarkAllAsRead:u=!0,unReadCount:s=0,onReadFilterChange:c=()=>{},currentReadFilter:p="all"}){const{t:r}=a.useContext(Q),[w,k]=a.useState(null),I=!!w,[i,v]=a.useState(h),[C,T]=a.useState(y),[M,N]=a.useState(!1),[P,A]=a.useState(""),[R,E]=a.useState([]);a.useEffect(()=>{v(h),T(y)},[h,y]);const $=[{label:r("notification.filterType.all"),value:"all"},{label:r("notification.filterType.unread"),value:"unread"}],W=e=>{(e!==p||!d)&&c(e)},z=[{label:r("notification.severityType.info"),value:"info"},{label:r("notification.severityType.success"),value:"success"},{label:r("notification.severityType.warning"),value:"warning"},{label:r("notification.severityType.error"),value:"error"}],L=e=>{k(e.currentTarget),A(""),N(!1)},q=()=>{k(null)},D=e=>{const n=i.includes(e)?i.filter(m=>m!==e):[...i,e];v(n),o({id:n,severity:C})},_=e=>{const n=C.includes(e)?C.filter(m=>m!==e):[...C,e];T(n),o({severity:n,id:i})},U=e=>{A(e.target.value)},Y=()=>{N(!M)},B=Oe.useMemo(()=>{if(!l.size)return[];const e=[];return g==="component"&&e.push({label:r("notification.system"),id:"system"}),Array.from(l).forEach(([,n])=>{const m=n.did||n.meta?.did,j=n.title||n.meta?.title||"",S=n.appPid||n.appDid;(g==="component"&&S!==m||g==="entity"&&S===m)&&e.push({label:j,id:m,blocklet:n,ancestors:n.ancestors})}),e},[l,g,r]);a.useEffect(()=>{if(P.trim()==="")E(B);else{const e=P.toLowerCase(),n=B.filter(m=>m.label.toLowerCase().includes(e));E(n)}},[P,B]);const V=P.trim()!==""||M?R:R.slice(0,ae);return t.jsxs(b,{children:[t.jsxs(b,{sx:{display:"flex",justifyContent:u?"space-between":"flex-end",alignItems:"flex-start",flexWrap:"wrap",gap:1},children:[u&&t.jsx(b,{sx:{display:"flex",gap:1.5},children:$.map(e=>t.jsxs(F,{disabled:d,onClick:()=>W(e.value),className:`profile-button ${p===e.value?"active":""}`,sx:{...x==="service"&&p===e.value?{color:"secondary.main"}:{},color:"red",fontWeight:p===e.value?"bold":"normal"},children:[e.label,e.value==="unread"&&s>0&&` (${s})`]},e.value))}),t.jsxs(b,{sx:{display:"flex",justifyContent:"flex-end",gap:2},children:[t.jsx(je,{size:"small",onClick:L,disabled:d,sx:{minWidth:"auto",borderRadius:1,border:"1px solid",borderColor:"divider","&:hover":{backgroundColor:"action.hover"}},children:t.jsx(X,{icon:rt,hFlip:!0})}),t.jsx(ke,{open:I,anchorEl:w,onClose:q,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},slotProps:{paper:{sx:{p:3,width:450,maxHeight:500,overflowY:"auto",backgroundColor:"background.paper",backgroundImage:"none",borderRadius:1,boxShadow:"0px 6px 24px rgba(0, 0, 0, 0.15)"}}},children:t.jsxs(b,{children:[t.jsxs(b,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2,height:"28px"},children:[t.jsx(G,{variant:"subtitle1",sx:{fontWeight:"bold"},children:r("notification.severity")}),t.jsx(b,{sx:{minWidth:"60px",display:"flex",justifyContent:"flex-end"},children:(i.length>0||C.length>0)&&t.jsx(F,{size:"small",onClick:()=>{v([]),T([]),o({severity:[],id:[]})},startIcon:t.jsx(Se,{fontSize:"small"}),sx:{color:"text.secondary",textTransform:"none",minWidth:"auto","&:hover":{backgroundColor:"transparent"},"& .MuiButton-startIcon":{marginRight:"2px"}},children:r("notification.clear")})})]}),t.jsx(b,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3},children:t.jsx(J,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:2,flex:1},children:z.map(e=>t.jsx(Z,{elevation:0,sx:ce(C.includes(e.value)),children:t.jsx(ee,{sx:{margin:0,padding:.5,width:"100%","& .MuiFormControlLabel-label":{display:"flex",alignItems:"center",gap:1,fontSize:"0.875rem"},...le},control:t.jsx(te,{checked:C.includes(e.value),onChange:()=>_(e.value),disabled:d,size:"small"}),label:t.jsxs(b,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5},children:[t.jsx(H,{severity:e.value}),e.label]})})},e.value))})}),t.jsxs(b,{sx:{mb:2},children:[t.jsxs(b,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:2,mb:1.5},children:[t.jsx(G,{variant:"subtitle1",sx:{fontWeight:"bold",width:"calc(100% - 36px)"},children:r("notification.from")}),t.jsx(b,{sx:{display:"flex",alignItems:"center",width:"calc(100% - 36px)"},children:t.jsx(Me,{size:"small",placeholder:"search",value:P,onChange:U,sx:{width:"100%","& .MuiOutlinedInput-input":{padding:"6px 4px 6px 0"},".MuiOutlinedInput-root":{"&:hover":{fieldset:{borderColor:"divider"}},"&.Mui-focused":{fieldset:{borderColor:"divider"}}},fieldset:{borderColor:"divider"}},slotProps:{input:{size:"small",startAdornment:t.jsx(Pe,{position:"start",sx:{marginRight:"2px"},children:t.jsx(X,{icon:Ue})})}}})})]}),t.jsx(J,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:2},children:V.map(e=>t.jsx(Z,{elevation:0,sx:ce(i.includes(e.id)),children:t.jsx(ee,{sx:{margin:0,padding:.5,width:"100%","& .MuiFormControlLabel-label":{fontSize:"0.875rem",width:"calc(100% - 36px)"},...le},control:t.jsx(te,{checked:i.includes(e.id),onChange:()=>D(e.id),disabled:d,size:"small"}),label:t.jsxs(b,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5,minWidth:0,width:"100%"},children:[e.blocklet&&t.jsx(se,{size:20,blocklet:e.blocklet,ancestors:e.ancestors,style:{borderRadius:4,flexShrink:0}}),t.jsx(G,{noWrap:!0,variant:"body2",component:"span",title:e.label,sx:{flex:1,overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"},children:e.label})]})})},e.id))}),R.length>ae&&P.trim()===""&&t.jsx(F,{fullWidth:!0,size:"small",onClick:Y,sx:{mt:1},endIcon:M?t.jsx(Ie,{}):t.jsx(Te,{})})]})]})})]})]}),i.length>0||C.length>0?t.jsxs(b,{className:"notification-filter-content",sx:{display:"flex",flexWrap:"wrap",gap:1,mt:2},children:[C.map(e=>{const n=z.find(m=>m.value===e);return t.jsx(oe,{label:t.jsxs(b,{sx:{display:"flex",alignItems:"center",gap:.5},children:[t.jsx(H,{severity:e}),n?n.label:e]}),onDelete:()=>_(e),size:"small",variant:"outlined",sx:{borderRadius:2,color:"text.secondary",borderColor:"divider","& .MuiChip-label":{display:"flex",alignItems:"center"}}},`severity-${e}`)}),i.map(e=>{const n=B.find(m=>m.id===e);return t.jsx(oe,{label:t.jsxs(b,{sx:{display:"flex",alignItems:"center",gap:.5},children:[n?.blocklet&&t.jsx(se,{size:16,blocklet:n.blocklet,ancestors:n.ancestors,style:{borderRadius:4,flexShrink:0}}),n?n.label:e]}),variant:"outlined",onDelete:()=>D(e),size:"small",sx:{borderRadius:2,color:"text.secondary",borderColor:"divider","& .MuiChip-label":{display:"flex",alignItems:"center"}}},`component-${e}`)})]}):null]})}const it=ue(Be)`
|
|
3
3
|
position: fixed;
|
|
4
4
|
bottom: 20px;
|
|
5
5
|
right: 20px;
|
|
@@ -74,4 +74,4 @@ import{b as Q,I as X,T as me,_ as be}from"./vendor-ux-TkkDR0Gn.js";import{j as t
|
|
|
74
74
|
*::-webkit-scrollbar {
|
|
75
75
|
display: none; /* Chrome, Safari and Opera */
|
|
76
76
|
}
|
|
77
|
-
`;xe.propTypes={blocklets:f.array,context:f.object,pagination:f.bool,inDialog:f.bool,filterType:f.oneOf(["component","entity"]),toViewAll:f.func,type:f.oneOf(["server","service"])};function xe({blocklets:o=[],context:d,pagination:x=!0,inDialog:l=!1,filterType:g="component",toViewAll:h=()=>{},type:y="service"}){const{data:u,paging:s,refresh:c,loading:p,params:r,onReadNotification:w,componentDids:k,filterUnReadCount:I,initial:i}=d,v=e=>{c({...r,severity:e&&typeof e=="string"?[e]:e||[],paging:{...r.paging,page:1}})},[C]=Ne(),T=O(()=>C.get("id"),[C]),M=de(e=>e.breakpoints.down("md")),[N,P]=a.useState(0),[A,R]=a.useState(!1),E=a.useMemo(()=>r.read===!1?"unread":"all",[r.read]),$=O(()=>pe(e=>{if(p)return;const n=u.length,m=u.filter(S=>!ie(S)).length;let j={...r,append:!0,paging:{...r.paging,...e,currentPage:(s.currentPage||0)+1}};E==="unread"&&m<n&&e.page>r.paging.page&&(j={...r,append:!0,paging:{...r.paging,...e,page:r.paging.page||1,currentPage:(s.currentPage||0)+1}}),c(j)},500),[u,r,E,s,p,c]);_e(()=>{i&&typeof i=="function"&&i()}),a.useEffect(()=>{(!s.currentPage||s.currentPage===1)&&P(s.total)},[s.total,s.currentPage]),a.useEffect(()=>{setTimeout(()=>{const e=document.getElementById(T);e&&e.scrollIntoView({behavior:"smooth",block:"center"}),R(!0)},100),setTimeout(()=>{R(!1)},3e3)},[T]);const W=O(()=>u?.length>0&&u.length<N,[u,N]),z=a.useCallback(e=>{const{blocklet:n={}}=window,m=[n?.did,...(n?.ancestors||[]).map(j=>j)];return k?.includes(e)||m.findIndex(j=>j===e)>-1},[k]),L=a.useMemo(()=>{const e=new Map;return o.length&&o.forEach(n=>{const m=n?.did||n.meta?.did;m&&!e.has(m)&&(n.ancestors=[],e.set(m,n),n?.alsoKnownAs?.length>0&&n.alsoKnownAs.forEach(j=>{e.has(j)||e.set(j,n)})),n?.children?.length>0&&n.children.forEach(j=>{const S=j?.did||j.meta?.did;S&&!e.has(S)&&z(S)&&(j.ancestors=[n],e.set(S,j))})}),e},[o,z]),q=a.useCallback(()=>{p||$({page:s.page+1})},[s.page,p,$]),[D]=ot({loading:p,hasNextPage:W,onLoadMore:q}),_=e=>{!e||ie(e)||w(e.id).then(()=>{l&&h()})},U=({severity:e,id:n})=>{if(p)return;let m={};g==="component"?m={entityId:[],componentDid:n}:g==="entity"&&(m={componentDid:[],entityId:n}),c({...r,severity:e,...m,paging:{...r.paging,page:1}})},Y=e=>{if(p)return;let n={...r,paging:{...r.paging,page:1}};e==="unread"?(n.read=!1,n.paging.currentPage=1):n=Le(n,"read"),c(n)},B=O(()=>g==="component"?Array.isArray(r.componentDid)?r.componentDid:[]:g==="entity"?Array.isArray(r.entityId)?r.entityId:[]:[],[r,g]),V=O(()=>(Array.isArray(r.severity)?r.severity:[])[0]||"",[r.severity]);return t.jsxs(lt,{inDialog:!!l,children:[l?t.jsx(fe,{currentTab:V,type:"line",theme:"light",onSelectType:v}):t.jsx(he,{loading:p,blockletMap:L,unReadCount:I,filterType:g,type:y,selectedId:B,onFilterChange:U,severity:r.severity,onReadFilterChange:Y,currentReadFilter:E}),!M&&p?t.jsx(b,{sx:{display:"flex",width:"100%",minHeight:400,justifyContent:"center",alignItems:"center"},children:t.jsx(ne,{})}):t.jsx(qe,{data:u,blockletMap:L,onReadNotification:_,onReadBatch:w,inDialog:l,highlightId:T,highlight:!l&&A,type:y}),x&&!M?t.jsx(nt,{loading:p,paging:s,onChange:$}):null,x&&M&&(p||W)?t.jsx(b,{ref:D,sx:{display:"flex",width:"100%",minHeight:100,justifyContent:"center",alignItems:"center"},children:t.jsx(ne,{})}):null,!l&&M?t.jsx(at,{}):null]})}const ct=a.memo(xe),dt=a.lazy(()=>be(()=>import("./user-center-
|
|
77
|
+
`;xe.propTypes={blocklets:f.array,context:f.object,pagination:f.bool,inDialog:f.bool,filterType:f.oneOf(["component","entity"]),toViewAll:f.func,type:f.oneOf(["server","service"])};function xe({blocklets:o=[],context:d,pagination:x=!0,inDialog:l=!1,filterType:g="component",toViewAll:h=()=>{},type:y="service"}){const{data:u,paging:s,refresh:c,loading:p,params:r,onReadNotification:w,componentDids:k,filterUnReadCount:I,initial:i}=d,v=e=>{c({...r,severity:e&&typeof e=="string"?[e]:e||[],paging:{...r.paging,page:1}})},[C]=Ne(),T=O(()=>C.get("id"),[C]),M=de(e=>e.breakpoints.down("md")),[N,P]=a.useState(0),[A,R]=a.useState(!1),E=a.useMemo(()=>r.read===!1?"unread":"all",[r.read]),$=O(()=>pe(e=>{if(p)return;const n=u.length,m=u.filter(S=>!ie(S)).length;let j={...r,append:!0,paging:{...r.paging,...e,currentPage:(s.currentPage||0)+1}};E==="unread"&&m<n&&e.page>r.paging.page&&(j={...r,append:!0,paging:{...r.paging,...e,page:r.paging.page||1,currentPage:(s.currentPage||0)+1}}),c(j)},500),[u,r,E,s,p,c]);_e(()=>{i&&typeof i=="function"&&i()}),a.useEffect(()=>{(!s.currentPage||s.currentPage===1)&&P(s.total)},[s.total,s.currentPage]),a.useEffect(()=>{setTimeout(()=>{const e=document.getElementById(T);e&&e.scrollIntoView({behavior:"smooth",block:"center"}),R(!0)},100),setTimeout(()=>{R(!1)},3e3)},[T]);const W=O(()=>u?.length>0&&u.length<N,[u,N]),z=a.useCallback(e=>{const{blocklet:n={}}=window,m=[n?.did,...(n?.ancestors||[]).map(j=>j)];return k?.includes(e)||m.findIndex(j=>j===e)>-1},[k]),L=a.useMemo(()=>{const e=new Map;return o.length&&o.forEach(n=>{const m=n?.did||n.meta?.did;m&&!e.has(m)&&(n.ancestors=[],e.set(m,n),n?.alsoKnownAs?.length>0&&n.alsoKnownAs.forEach(j=>{e.has(j)||e.set(j,n)})),n?.children?.length>0&&n.children.forEach(j=>{const S=j?.did||j.meta?.did;S&&!e.has(S)&&z(S)&&(j.ancestors=[n],e.set(S,j))})}),e},[o,z]),q=a.useCallback(()=>{p||$({page:s.page+1})},[s.page,p,$]),[D]=ot({loading:p,hasNextPage:W,onLoadMore:q}),_=e=>{!e||ie(e)||w(e.id).then(()=>{l&&h()})},U=({severity:e,id:n})=>{if(p)return;let m={};g==="component"?m={entityId:[],componentDid:n}:g==="entity"&&(m={componentDid:[],entityId:n}),c({...r,severity:e,...m,paging:{...r.paging,page:1}})},Y=e=>{if(p)return;let n={...r,paging:{...r.paging,page:1}};e==="unread"?(n.read=!1,n.paging.currentPage=1):n=Le(n,"read"),c(n)},B=O(()=>g==="component"?Array.isArray(r.componentDid)?r.componentDid:[]:g==="entity"?Array.isArray(r.entityId)?r.entityId:[]:[],[r,g]),V=O(()=>(Array.isArray(r.severity)?r.severity:[])[0]||"",[r.severity]);return t.jsxs(lt,{inDialog:!!l,children:[l?t.jsx(fe,{currentTab:V,type:"line",theme:"light",onSelectType:v}):t.jsx(he,{loading:p,blockletMap:L,unReadCount:I,filterType:g,type:y,selectedId:B,onFilterChange:U,severity:r.severity,onReadFilterChange:Y,currentReadFilter:E}),!M&&p?t.jsx(b,{sx:{display:"flex",width:"100%",minHeight:400,justifyContent:"center",alignItems:"center"},children:t.jsx(ne,{})}):t.jsx(qe,{data:u,blockletMap:L,onReadNotification:_,onReadBatch:w,inDialog:l,highlightId:T,highlight:!l&&A,type:y}),x&&!M?t.jsx(nt,{loading:p,paging:s,onChange:$}):null,x&&M&&(p||W)?t.jsx(b,{ref:D,sx:{display:"flex",width:"100%",minHeight:100,justifyContent:"center",alignItems:"center"},children:t.jsx(ne,{})}):null,!l&&M?t.jsx(at,{}):null]})}const ct=a.memo(xe),dt=a.lazy(()=>be(()=>import("./user-center-BfW2lvH2.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20])));function Tt(){const{t:o}=me(),{api:d}=ze(),l=$e().tab,h=new URLSearchParams(window.location.search).get("embed")||window.sessionStorage?.getItem("embed"),y=Fe(),u=O(()=>({...window.blocklet,meta:{did:window.blocklet.did,name:window.blocklet.did},children:window?.blocklet?.componentMountPoints.map(c=>({...c,meta:{...c,did:c.did,name:c.name||c.title||"",logo:"logo.png"}}))})),s=async c=>{const{input:p,sessionId:r}=c;try{await d.destroySelf({input:{...p,sessionId:r}})}catch(w){console.error("destroy myself error",w)}};return t.jsxs(t.Fragment,{children:[t.jsx(Ae,{children:t.jsx("title",{children:o("pageTitle.userCenter")})}),t.jsx(dt,{embed:h==="1",currentTab:l?De(We.WELLKNOWN_SERVICE_PATH_PREFIX,"user",l):"",disableAutoRedirect:l==="settings",onDestroySelf:s,children:l==="notifications"?t.jsx(ct,{blocklets:[u],context:y}):null})]})}export{Tt as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as te,g as De}from"./vendor-react-x2lQvn4m.js";import{j as r,ak as T,am as we,T as j,Y as Fe,O as We,V as Re,bm as He,b6 as de,bn as ue,p as Ve}from"./vendor-mui-core-p6jGoroc.js";import{$ as Ge,s as Ze,T as Ie,X as Ye,o as Ce,A as Ee,D as Xe}from"./vendor-ux-TkkDR0Gn.js";import{a as V,g as pe,b as oe,h as Ke,k as Qe}from"./vendor-hooks-zCCbpt45.js";import{aM as Je,aN as $e,aO as Oe,aP as ei}from"./index-S9T-sBWO.js";const gi=f=>te.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",...f},te.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.25 10C3.25 6.27208 6.27208 3.25 10 3.25C13.7279 3.25 16.75 6.27208 16.75 10C16.75 13.7279 13.7279 16.75 10 16.75C6.27208 16.75 3.25 13.7279 3.25 10ZM10 1.75C5.44365 1.75 1.75 5.44365 1.75 10C1.75 14.5564 5.44365 18.25 10 18.25C14.5563 18.25 18.25 14.5564 18.25 10C18.25 5.44365 14.5563 1.75 10 1.75ZM8.03033 6.96967C7.73744 6.67678 7.26256 6.67678 6.96967 6.96967C6.67678 7.26256 6.67678 7.73744 6.96967 8.03033L11.9697 13.0303C12.2626 13.3232 12.7374 13.3232 13.0303 13.0303C13.3232 12.7374 13.3232 12.2626 13.0303 11.9697L8.03033 6.96967Z"}));var G={exports:{}},ii=G.exports,_e;function oi(){return _e||(_e=1,function(f,x){(function(d,n){var Z="1.0.40",m="",R="?",I="function",B="undefined",C="object",L="string",N="major",t="model",e="name",o="type",i="vendor",a="version",k="architecture",A="console",l="mobile",b="tablet",y="smarttv",E="wearable",q="embedded",u=500,w="Amazon",S="Apple",Y="ASUS",me="BlackBerry",X="Browser",K="Chrome",Le="Edge",Q="Firefox",D="Google",ge="Huawei",ae="LG",re="Microsoft",he="Motorola",F="Opera",W="Samsung",fe="Sharp",J="Sony",se="Xiaomi",ne="Zebra",xe="Facebook",ve="Chromium OS",ye="Mac OS",ke=" Browser",Pe=function(p,g){var c={};for(var v in p)g[v]&&g[v].length%2===0?c[v]=g[v].concat(p[v]):c[v]=p[v];return c},$=function(p){for(var g={},c=0;c<p.length;c++)g[p[c].toUpperCase()]=p[c];return g},Se=function(p,g){return typeof p===L?P(g).indexOf(P(p))!==-1:!1},P=function(p){return p.toLowerCase()},Ue=function(p){return typeof p===L?p.replace(/[^\d\.]/g,m).split(".")[0]:n},le=function(p,g){if(typeof p===L)return p=p.replace(/^\s\s*/,m),typeof g===B?p:p.substring(0,u)},H=function(p,g){for(var c=0,v,M,_,h,s,z;c<g.length&&!s;){var ce=g[c],je=g[c+1];for(v=M=0;v<ce.length&&!s&&ce[v];)if(s=ce[v++].exec(p),s)for(_=0;_<je.length;_++)z=s[++M],h=je[_],typeof h===C&&h.length>0?h.length===2?typeof h[1]==I?this[h[0]]=h[1].call(this,z):this[h[0]]=h[1]:h.length===3?typeof h[1]===I&&!(h[1].exec&&h[1].test)?this[h[0]]=z?h[1].call(this,z,h[2]):n:this[h[0]]=z?z.replace(h[1],h[2]):n:h.length===4&&(this[h[0]]=z?h[3].call(this,z.replace(h[1],h[2])):n):this[h]=z||n;c+=2}},ee=function(p,g){for(var c in g)if(typeof g[c]===C&&g[c].length>0){for(var v=0;v<g[c].length;v++)if(Se(g[c][v],p))return c===R?n:c}else if(Se(g[c],p))return c===R?n:c;return g.hasOwnProperty("*")?g["*"]:p},qe={"1.0":"/8","1.2":"/1","1.3":"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},Ae={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2","8.1":"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},Te={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[a,[e,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[a,[e,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[e,a],[/opios[\/ ]+([\w\.]+)/i],[a,[e,F+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[a,[e,F+" GX"]],[/\bopr\/([\w\.]+)/i],[a,[e,F]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[a,[e,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[a,[e,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon)\/([-\w\.]+)/i,/(heytap|ovi|115)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[e,a],[/quark(?:pc)?\/([-\w\.]+)/i],[a,[e,"Quark"]],[/\bddg\/([\w\.]+)/i],[a,[e,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[a,[e,"UC"+X]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[a,[e,"WeChat"]],[/konqueror\/([\w\.]+)/i],[a,[e,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[a,[e,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[a,[e,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[a,[e,"Smart Lenovo "+X]],[/(avast|avg)\/([\w\.]+)/i],[[e,/(.+)/,"$1 Secure "+X],a],[/\bfocus\/([\w\.]+)/i],[a,[e,Q+" Focus"]],[/\bopt\/([\w\.]+)/i],[a,[e,F+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[a,[e,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[a,[e,"Dolphin"]],[/coast\/([\w\.]+)/i],[a,[e,F+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[a,[e,"MIUI"+ke]],[/fxios\/([\w\.-]+)/i],[a,[e,Q]],[/\bqihoobrowser\/?([\w\.]*)/i],[a,[e,"360"]],[/\b(qq)\/([\w\.]+)/i],[[e,/(.+)/,"$1Browser"],a],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[e,/(.+)/,"$1"+ke],a],[/samsungbrowser\/([\w\.]+)/i],[a,[e,W+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[a,[e,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[e,"Sogou Mobile"],a],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[e,a],[/(lbbrowser|rekonq)/i,/\[(linkedin)app\]/i],[e],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[a,e],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[e,xe],a],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[e,a],[/\bgsa\/([\w\.]+) .*safari\//i],[a,[e,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[a,[e,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[a,[e,K+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[e,K+" WebView"],a],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[a,[e,"Android "+X]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[e,a],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[a,[e,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[a,e],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[e,[a,ee,qe]],[/(webkit|khtml)\/([\w\.]+)/i],[e,a],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[e,"Netscape"],a],[/(wolvic|librewolf)\/([\w\.]+)/i],[e,a],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[a,[e,Q+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[e,[a,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[e,[a,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[k,"amd64"]],[/(ia32(?=;))/i],[[k,P]],[/((?:i[346]|x)86)[;\)]/i],[[k,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[k,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[k,"armhf"]],[/windows (ce|mobile); ppc;/i],[[k,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[k,/ower/,m,P]],[/(sun4\w)[;\)]/i],[[k,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[k,P]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[t,[i,W],[o,b]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[t,[i,W],[o,l]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[t,[i,S],[o,l]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[t,[i,S],[o,b]],[/(macintosh);/i],[t,[i,S]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[t,[i,fe],[o,l]],[/(?:honor)([-\w ]+)[;\)]/i],[t,[i,"Honor"],[o,l]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[t,[i,ge],[o,b]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[t,[i,ge],[o,l]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i],[[t,/_/g," "],[i,se],[o,l]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[t,/_/g," "],[i,se],[o,b]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[t,[i,"OPPO"],[o,l]],[/\b(opd2\d{3}a?) bui/i],[t,[i,"OPPO"],[o,b]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[t,[i,"Vivo"],[o,l]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[t,[i,"Realme"],[o,l]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[t,[i,he],[o,l]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[t,[i,he],[o,b]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[t,[i,ae],[o,b]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[t,[i,ae],[o,l]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[t,[i,"Lenovo"],[o,b]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[t,/_/g," "],[i,"Nokia"],[o,l]],[/(pixel c)\b/i],[t,[i,D],[o,b]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[t,[i,D],[o,l]],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[t,[i,J],[o,l]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[t,"Xperia Tablet"],[i,J],[o,b]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[t,[i,"OnePlus"],[o,l]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[t,[i,w],[o,b]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[t,/(.+)/g,"Fire Phone $1"],[i,w],[o,l]],[/(playbook);[-\w\),; ]+(rim)/i],[t,i,[o,b]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[t,[i,me],[o,l]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[t,[i,Y],[o,b]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[t,[i,Y],[o,l]],[/(nexus 9)/i],[t,[i,"HTC"],[o,b]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[i,[t,/_/g," "],[o,l]],[/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])\w*(\)| bui)/i],[t,[i,"TCL"],[o,b]],[/(itel) ((\w+))/i],[[i,P],t,[o,ee,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[t,[i,"Acer"],[o,b]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[t,[i,"Meizu"],[o,l]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[t,[i,"Ulefone"],[o,l]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[t,[i,"Energizer"],[o,l]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[t,[i,"Cat"],[o,l]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[t,[i,"Smartfren"],[o,l]],[/droid.+; (a(?:015|06[35]|142p?))/i],[t,[i,"Nothing"],[o,l]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (imo) ((?!tab)[\w ]+?)(?: bui|\))/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[i,t,[o,l]],[/(imo) (tab \w+)/i,/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[i,t,[o,b]],[/(surface duo)/i],[t,[i,re],[o,b]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[t,[i,"Fairphone"],[o,l]],[/(u304aa)/i],[t,[i,"AT&T"],[o,l]],[/\bsie-(\w*)/i],[t,[i,"Siemens"],[o,l]],[/\b(rct\w+) b/i],[t,[i,"RCA"],[o,b]],[/\b(venue[\d ]{2,7}) b/i],[t,[i,"Dell"],[o,b]],[/\b(q(?:mv|ta)\w+) b/i],[t,[i,"Verizon"],[o,b]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[t,[i,"Barnes & Noble"],[o,b]],[/\b(tm\d{3}\w+) b/i],[t,[i,"NuVision"],[o,b]],[/\b(k88) b/i],[t,[i,"ZTE"],[o,b]],[/\b(nx\d{3}j) b/i],[t,[i,"ZTE"],[o,l]],[/\b(gen\d{3}) b.+49h/i],[t,[i,"Swiss"],[o,l]],[/\b(zur\d{3}) b/i],[t,[i,"Swiss"],[o,b]],[/\b((zeki)?tb.*\b) b/i],[t,[i,"Zeki"],[o,b]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[i,"Dragon Touch"],t,[o,b]],[/\b(ns-?\w{0,9}) b/i],[t,[i,"Insignia"],[o,b]],[/\b((nxa|next)-?\w{0,9}) b/i],[t,[i,"NextBook"],[o,b]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[i,"Voice"],t,[o,l]],[/\b(lvtel\-)?(v1[12]) b/i],[[i,"LvTel"],t,[o,l]],[/\b(ph-1) /i],[t,[i,"Essential"],[o,l]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[t,[i,"Envizen"],[o,b]],[/\b(trio[-\w\. ]+) b/i],[t,[i,"MachSpeed"],[o,b]],[/\btu_(1491) b/i],[t,[i,"Rotor"],[o,b]],[/(shield[\w ]+) b/i],[t,[i,"Nvidia"],[o,b]],[/(sprint) (\w+)/i],[i,t,[o,l]],[/(kin\.[onetw]{3})/i],[[t,/\./g," "],[i,re],[o,l]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[t,[i,ne],[o,b]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[t,[i,ne],[o,l]],[/smart-tv.+(samsung)/i],[i,[o,y]],[/hbbtv.+maple;(\d+)/i],[[t,/^/,"SmartTV"],[i,W],[o,y]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[i,ae],[o,y]],[/(apple) ?tv/i],[i,[t,S+" TV"],[o,y]],[/crkey/i],[[t,K+"cast"],[i,D],[o,y]],[/droid.+aft(\w+)( bui|\))/i],[t,[i,w],[o,y]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[t,[i,fe],[o,y]],[/(bravia[\w ]+)( bui|\))/i],[t,[i,J],[o,y]],[/(mitv-\w{5}) bui/i],[t,[i,se],[o,y]],[/Hbbtv.*(technisat) (.*);/i],[i,t,[o,y]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[i,le],[t,le],[o,y]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[o,y]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[i,t,[o,A]],[/droid.+; (shield) bui/i],[t,[i,"Nvidia"],[o,A]],[/(playstation [345portablevi]+)/i],[t,[i,J],[o,A]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[t,[i,re],[o,A]],[/\b(sm-[lr]\d\d[05][fnuw]?s?)\b/i],[t,[i,W],[o,E]],[/((pebble))app/i],[i,t,[o,E]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[t,[i,S],[o,E]],[/droid.+; (glass) \d/i],[t,[i,D],[o,E]],[/droid.+; (wt63?0{2,3})\)/i],[t,[i,ne],[o,E]],[/droid.+; (glass) \d/i],[t,[i,D],[o,E]],[/(pico) (4|neo3(?: link|pro)?)/i],[i,t,[o,E]],[/; (quest( \d| pro)?)/i],[t,[i,xe],[o,E]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[i,[o,q]],[/(aeobc)\b/i],[t,[i,w],[o,q]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[t,[o,l]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[t,[o,b]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[o,b]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[o,l]],[/(android[-\w\. ]{0,9});.+buil/i],[t,[i,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[a,[e,Le+"HTML"]],[/(arkweb)\/([\w\.]+)/i],[e,a],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[a,[e,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[e,a],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[a,e]],os:[[/microsoft (windows) (vista|xp)/i],[e,a],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[e,[a,ee,Ae]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[a,ee,Ae],[e,"Windows"]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[a,/_/g,"."],[e,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[e,ye],[a,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[a,e],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish|openharmony)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[e,a],[/\(bb(10);/i],[a,[e,me]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[a,[e,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[a,[e,Q+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[a,[e,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[a,[e,"watchOS"]],[/crkey\/([\d\.]+)/i],[a,[e,K+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[e,ve],a],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[e,a],[/(sunos) ?([\w\.\d]*)/i],[[e,"Solaris"],a],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[e,a]]},O=function(p,g){if(typeof p===C&&(g=p,p=n),!(this instanceof O))return new O(p,g).getResult();var c=typeof d!==B&&d.navigator?d.navigator:n,v=p||(c&&c.userAgent?c.userAgent:m),M=c&&c.userAgentData?c.userAgentData:n,_=g?Pe(Te,g):Te,h=c&&c.userAgent==v;return this.getBrowser=function(){var s={};return s[e]=n,s[a]=n,H.call(s,v,_.browser),s[N]=Ue(s[a]),h&&c&&c.brave&&typeof c.brave.isBrave==I&&(s[e]="Brave"),s},this.getCPU=function(){var s={};return s[k]=n,H.call(s,v,_.cpu),s},this.getDevice=function(){var s={};return s[i]=n,s[t]=n,s[o]=n,H.call(s,v,_.device),h&&!s[o]&&M&&M.mobile&&(s[o]=l),h&&s[t]=="Macintosh"&&c&&typeof c.standalone!==B&&c.maxTouchPoints&&c.maxTouchPoints>2&&(s[t]="iPad",s[o]=b),s},this.getEngine=function(){var s={};return s[e]=n,s[a]=n,H.call(s,v,_.engine),s},this.getOS=function(){var s={};return s[e]=n,s[a]=n,H.call(s,v,_.os),h&&!s[e]&&M&&M.platform&&M.platform!="Unknown"&&(s[e]=M.platform.replace(/chrome os/i,ve).replace(/macos/i,ye)),s},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return v},this.setUA=function(s){return v=typeof s===L&&s.length>u?le(s,u):s,this},this.setUA(v),this};O.VERSION=Z,O.BROWSER=$([e,a,N]),O.CPU=$([k]),O.DEVICE=$([t,i,o,A,l,y,b,E,q]),O.ENGINE=O.OS=$([e,a]),f.exports&&(x=f.exports=O),x.UAParser=O;var U=typeof d!==B&&(d.jQuery||d.Zepto);if(U&&!U.ua){var ie=new O;U.ua=ie.getResult(),U.ua.get=function(){return ie.getUA()},U.ua.set=function(p){ie.setUA(p);var g=ie.getResult();for(var c in g)U.ua[c]=g[c]}}})(typeof window=="object"?window:ii)}(G,G.exports)),G.exports}var ti=oi();const be=De(ti);function ai({user:f,sessionUser:x}){const d=V(()=>(f?.passports||[])?.find(n=>n.name===x.role),[f?.passports,x?.role]);return r.jsxs(T,{sx:{display:"flex",alignItems:"center",gap:1},children:[r.jsx(Ge,{size:40,variant:"circle",shape:"circle",src:x.avatar,did:x.did,sx:{flexShrink:0}}),r.jsxs(T,{sx:{flex:1,overflow:"hidden"},children:[r.jsxs(T,{sx:{display:"flex",alignItems:"center",gap:1},children:[r.jsx(we,{title:x.fullName,children:r.jsx(j,{sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",flex:1},children:x.fullName})}),r.jsx(Fe,{label:d?.title||d?.name||"Guest",size:"small",variant:"outlined",sx:{flexShrink:0,fontWeight:"bold",fontSize:"12px",color:"text.primary",borderColor:"grey.300",backgroundColor:"transparent",textTransform:"capitalize",pr:.5,pl:0,height:"auto"}})]}),r.jsx(we,{title:x.email,children:r.jsx(j,{variant:"body2",color:"grey",sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:x.email})})]})]})}const ri={zh:{confirm:"确认",cancel:"取消",visitorId:"设备标识",deviceType:"设备类型",platform:"操作系统",walletOS:"钱包类型",role:"角色",fullname:"姓名",email:"邮箱",avatar:"头像",user:"用户",createdAt:"首次活动时间",updatedAt:"最近活动时间",lastLoginIp:"最近活动地址",actions:"操作",logoutAll:"注销所有{type}会话",logoutAllTips:"不会注销当前会话",logout:"注销",currentSession:"当前会话",unknown:"未知",expired:"已过期",remove:"删除",logoutThisSession:"注销指定会话",logoutThisSessionConfirm:"确定要注销此会话吗?",logoutAllSession:"注销所有{type}会话",logoutAllSessionConfirm:"确定要注销所有{type}会话吗?",online:"活跃"},en:{confirm:"Confirm",cancel:"Cancel",visitorId:"Device ID",deviceType:"Device Type",platform:"Platform",walletOS:"Wallet OS",role:"Role",fullname:"Fullname",email:"Email",avatar:"Avatar",user:"User",createdAt:"First Active Time",updatedAt:"Last Active Time",actions:"Actions",lastLoginIp:"Last Login IP",logoutAll:"Logout all {type} sessions",logoutAllTips:"Will not logout current session",logout:"Logout",currentSession:"Current Session",unknown:"Unknown",expired:"Expired",remove:"Remove",logoutThisSession:"Logout this session",logoutThisSessionConfirm:"Are you sure to logout this session?",logoutAllSession:"Logout all {type} sessions",logoutAllSessionConfirm:"Are you sure to logout all {type} sessions?",online:"Active"}},Ne="Reserved IP",ze="ip-region-cache";async function si(f){const x=`https://ipapi.co/${f}/json/`,d=await(await fetch(x)).json();let n="";return d.error?d.reserved&&(n=Ne):n=[d.country_name,d.region,d.city].filter(Boolean).join("/"),n}async function ni(f){const x=`https://api.ip.sb/geoip/${f}`,d=await(await fetch(x)).json();let n="";return d.error?d.reserved&&(n=Ne):n=[d.country,d.region,d.city].filter(Boolean).join("/"),n}async function li(f){let x="",d={};try{const n=localStorage.getItem(ze);n&&(d=JSON.parse(n))}catch{d={}}if(d[f])x=d[f];else{try{x=await ni(f)}catch{console.warn("Fail to get ip region from ip.sb")}if(!x)try{x=await si(f)}catch{console.warn("Fail to get ip region from ip-api.co")}}if(x){const n=Object.keys(d);n.length>100&&delete d[n[0]],d[f]&&delete d[f],d[f]=x,localStorage.setItem(ze,JSON.stringify(d))}return x}const Be=f=>new be(f,{browser:[[/(ArcWallet)\/([\w\.]+)/i],[be.BROWSER.NAME,be.BROWSER.VERSION]]}).getResult(),Me={display:"flex",justifyContent:"flex-end",textAlign:"right"},ci=new ei({concurrency:1}),di=te.memo(({userSession:f,isMobile:x=!1})=>{const d=pe({loading:!0,ipRegion:""}),{t:n}=Ie();return te.useEffect(()=>{ci.add(async()=>{try{d.ipRegion=await li(f.lastLoginIp)}finally{d.loading=!1}})},[d,f.lastLoginIp]),r.jsx(T,{...x&&{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:1,flexWrap:"wrap"},children:d.ipRegion?r.jsxs(r.Fragment,{children:[r.jsx(j,{variant:"body2",children:d.ipRegion}),r.jsx(j,{variant:"body2",color:"grey",children:f.lastLoginIp||n("unknown")})]}):r.jsxs(r.Fragment,{children:[r.jsx(j,{children:f.lastLoginIp||n("unknown")}),d.loading?r.jsx(j,{variant:"body2",color:"grey",sx:{textAlign:"center"},children:r.jsx(Ve,{size:12,color:"inherit"})}):null]})})});function hi({user:f,showAction:x=!0,showUser:d=!0,getUserSessions:n,showOffline:Z=!1}){const m=pe({status:"online",page:1,pageSize:10}),R=pe({online:0,expired:0,offline:0}),I=Ze(),{locale:B}=Ie(),C=Je({key:"md"}),L=We(u=>u.breakpoints.down("lg")),{confirmApi:N,confirmHolder:t}=$e(),e=oe((u,w={})=>Ye(ri,u,B,"en",w)),o=oe(async()=>{const u=await n({page:m.page,pageSize:m.pageSize,status:m.status}),w=u?.paging?.total||0;return R[m.status]=w,{total:w,list:u?.list||[]}});Ke(async()=>{const u=await n({page:1,pageSize:1,status:"expired"});R.expired=u?.paging?.total||0;const w=await n({page:1,pageSize:1,status:"offline"});R.offline=w?.paging?.total||0});const i=Qe(o,{refreshDeps:[m.status,m.page,m.pageSize]}),a=V(()=>i.data?.list||[],[i.data?.list]),k=V(()=>{const u=m.status;return u==="online"?R[u]<=1:R[u]===0},[a,I]),A=V(()=>Ce({},C?Me:{}),[C]),l=oe(({visitorId:u})=>{N.open({title:e("logoutThisSession"),content:e("logoutThisSessionConfirm"),confirmButtonText:e("confirm"),confirmButtonProps:{color:"error"},cancelButtonText:e("cancel"),onConfirm:async()=>{await Oe.user.logout({visitorId:u,includeFederated:!0});const{page:w=0}=m,{list:S=[]}=i.data||{},Y=S.length||0;w>1&&Y===1&&(m.page=Math.max(w-1,1)),i.refresh(),N.close()}})}),b=oe(()=>{N.open({title:e("logoutAllSession",{type:e(m.status)}),content:e("logoutAllSessionConfirm",{type:e(m.status)}),confirmButtonText:e("confirm"),confirmButtonProps:{color:"error"},cancelButtonText:e("cancel"),onConfirm:async()=>{await Oe.user.logout({status:m.status,visitorId:I,includeFederated:!0}),m.page=1,i.refresh(),N.close()}})}),y=[];x&&y.push(r.jsx(we,{title:e("logoutAllTips",{type:e(m.status)}),children:r.jsx(Re,{sx:{ml:.5},size:"small",variant:"contained",color:"error",onClick:b,disabled:k,children:e("logoutAll",{type:e(m.status)})})},"logoutAll"));const E=V(()=>({search:!1,sort:!1,download:!1,filter:!1,print:!1,expandableRowsOnClick:!1,searchDebounceTime:600,page:m.page-1,rowsPerPage:m.pageSize,count:i.data?.total||0}),[i.data?.total,m.page,m.pageSize]),q=[{label:e("platform"),name:"platform",options:{customBodyRenderLite:u=>{const w=a[u],S=Be(w?.ua);return r.jsx(T,{sx:A,children:[S.os?.name,S.os?.version].filter(Boolean).join("/")||e("unknown")})}}},{label:e("deviceType"),name:"deviceType",options:{customBodyRenderLite:u=>{const w=a[u],S=Be(w?.ua);return r.jsx(T,{sx:A,children:[S.browser?.name,S.browser?.version].filter(Boolean).join("/")||e("unknown")})}}},{label:e("walletOS"),name:"walletOS",options:{customBodyRenderLite:u=>{const w=a[u];return r.jsx(T,{sx:A,children:w.extra?.walletOS||e("unknown")})}}},d&&{label:e("user"),name:"user",options:{customBodyRenderLite:u=>{const w=a[u];return r.jsx(T,{sx:Ce({minWidth:150,maxWidth:250},C?Me:{}),children:r.jsx(ai,{sessionUser:w.user,user:f})})}}},{label:e("createdAt"),name:"createdAt",options:{customBodyRenderLite:u=>{const w=a[u];return r.jsx(T,{sx:A,children:w.createdAt?r.jsx(Ee,{value:w.createdAt,relativeRange:3*86400*1e3,locale:B}):e("unknown")})}}},!Z&&{label:e("updatedAt"),name:"updatedAt",options:{customBodyRenderLite:u=>{const w=a[u];return r.jsx(T,{sx:A,children:w.status==="expired"?e("expired"):r.jsx(Ee,{value:w.updatedAt,relativeRange:3*86400*1e3,locale:B})})}}},{label:e("lastLoginIp"),name:"lastLoginIp",options:{customBodyRenderLite:u=>{const w=a[u];return r.jsx(di,{userSession:w,isMobile:C})}}},x&&{label:e("actions"),name:"actions",options:{customBodyRenderLite:u=>{const w=a[u];return r.jsx(T,{sx:A,children:r.jsx(Re,{sx:{whiteSpace:"nowrap",fontSize:"12px !important",lineHeight:"1.25",px:1},disabled:I===w.visitorId,variant:"outlined",size:"small",color:"error",onClick:()=>l({visitorId:w.visitorId}),children:w.status==="expired"?e("remove"):I===w.visitorId?e("currentSession"):e("logout")})})}}}].filter(Boolean);return r.jsxs(T,{className:"pc-user-sessions",sx:{maxWidth:C?"unset":L?"calc(100vw - 300px)":"100%",...C&&{".pc-user-sessions-table > div:nth-child(2)":{border:"1px solid",borderColor:"divider",borderRadius:1}},".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableRow-root":{border:"unset","&:nth-child(even)":{backgroundColor:"grey.50","&:hover":{backgroundColor:u=>`${u.palette.grey[50]} !important`}}},".MuiTableRow-hover":{"&:hover":{backgroundColor:"inherit !important"}},".MuiTableCell-root":{paddingRight:"8px",paddingLeft:"8px",color:"text.secondary",...C&&{padding:"8px !important","&:first-child":{paddingTop:"20px!important"},"&:last-child":{paddingBottom:"20px!important"}}}},children:[t,r.jsx(Xe,{count:i.data?.total||0,locale:B,data:a,columns:q,customButtons:y,options:E,loading:i.loading,className:"pc-user-sessions-table",title:r.jsxs(He,{row:!0,sx:{lineHeight:1,ml:1},onChange:u=>{m.status=u.target.value},children:[r.jsx(de,{value:"online",control:r.jsx(ue,{size:"small",sx:{lineHeight:1,fontSize:0},checked:m.status==="online"}),label:r.jsxs(j,{sx:{display:"flex",alignItems:"center"},children:[e("online"),r.jsxs(j,{component:"span",sx:{ml:.5,color:"text.secondary"},children:["(",R.online,")"]})]})}),r.jsx(de,{value:"expired",control:r.jsx(ue,{size:"small",sx:{lineHeight:1,fontSize:0},checked:m.status==="expired"}),label:r.jsxs(j,{sx:{display:"flex",alignItems:"center"},children:[e("expired"),r.jsxs(j,{component:"span",sx:{ml:.5,color:"text.secondary"},children:["(",R.expired,")"]})]})}),Z?r.jsx(de,{value:"offline",control:r.jsx(ue,{size:"small",sx:{lineHeight:1,fontSize:0},checked:m.status==="offline"}),label:r.jsxs(j,{sx:{display:"flex",alignItems:"center"},children:[e("offline"),r.jsxs(j,{component:"span",sx:{ml:.5,color:"text.secondary"},children:["(",R.offline,")"]})]})}):null]}),onChange:u=>{m.page=u.page+1,m.pageSize=u.rowsPerPage}})]})}export{hi as A,gi as C};
|
|
1
|
+
import{r as te,g as De}from"./vendor-react-x2lQvn4m.js";import{j as r,ak as T,am as we,T as j,Y as Fe,O as We,V as Re,bm as He,b6 as de,bn as ue,p as Ve}from"./vendor-mui-core-p6jGoroc.js";import{$ as Ge,s as Ze,T as Ie,X as Ye,o as Ce,A as Ee,D as Xe}from"./vendor-ux-TkkDR0Gn.js";import{a as V,g as pe,b as oe,h as Ke,k as Qe}from"./vendor-hooks-zCCbpt45.js";import{aM as Je,aN as $e,aO as Oe,aP as ei}from"./index-CDq77s86.js";const gi=f=>te.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",...f},te.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.25 10C3.25 6.27208 6.27208 3.25 10 3.25C13.7279 3.25 16.75 6.27208 16.75 10C16.75 13.7279 13.7279 16.75 10 16.75C6.27208 16.75 3.25 13.7279 3.25 10ZM10 1.75C5.44365 1.75 1.75 5.44365 1.75 10C1.75 14.5564 5.44365 18.25 10 18.25C14.5563 18.25 18.25 14.5564 18.25 10C18.25 5.44365 14.5563 1.75 10 1.75ZM8.03033 6.96967C7.73744 6.67678 7.26256 6.67678 6.96967 6.96967C6.67678 7.26256 6.67678 7.73744 6.96967 8.03033L11.9697 13.0303C12.2626 13.3232 12.7374 13.3232 13.0303 13.0303C13.3232 12.7374 13.3232 12.2626 13.0303 11.9697L8.03033 6.96967Z"}));var G={exports:{}},ii=G.exports,_e;function oi(){return _e||(_e=1,function(f,x){(function(d,n){var Z="1.0.40",m="",R="?",I="function",B="undefined",C="object",L="string",N="major",t="model",e="name",o="type",i="vendor",a="version",k="architecture",A="console",l="mobile",b="tablet",y="smarttv",E="wearable",q="embedded",u=500,w="Amazon",S="Apple",Y="ASUS",me="BlackBerry",X="Browser",K="Chrome",Le="Edge",Q="Firefox",D="Google",ge="Huawei",ae="LG",re="Microsoft",he="Motorola",F="Opera",W="Samsung",fe="Sharp",J="Sony",se="Xiaomi",ne="Zebra",xe="Facebook",ve="Chromium OS",ye="Mac OS",ke=" Browser",Pe=function(p,g){var c={};for(var v in p)g[v]&&g[v].length%2===0?c[v]=g[v].concat(p[v]):c[v]=p[v];return c},$=function(p){for(var g={},c=0;c<p.length;c++)g[p[c].toUpperCase()]=p[c];return g},Se=function(p,g){return typeof p===L?P(g).indexOf(P(p))!==-1:!1},P=function(p){return p.toLowerCase()},Ue=function(p){return typeof p===L?p.replace(/[^\d\.]/g,m).split(".")[0]:n},le=function(p,g){if(typeof p===L)return p=p.replace(/^\s\s*/,m),typeof g===B?p:p.substring(0,u)},H=function(p,g){for(var c=0,v,M,_,h,s,z;c<g.length&&!s;){var ce=g[c],je=g[c+1];for(v=M=0;v<ce.length&&!s&&ce[v];)if(s=ce[v++].exec(p),s)for(_=0;_<je.length;_++)z=s[++M],h=je[_],typeof h===C&&h.length>0?h.length===2?typeof h[1]==I?this[h[0]]=h[1].call(this,z):this[h[0]]=h[1]:h.length===3?typeof h[1]===I&&!(h[1].exec&&h[1].test)?this[h[0]]=z?h[1].call(this,z,h[2]):n:this[h[0]]=z?z.replace(h[1],h[2]):n:h.length===4&&(this[h[0]]=z?h[3].call(this,z.replace(h[1],h[2])):n):this[h]=z||n;c+=2}},ee=function(p,g){for(var c in g)if(typeof g[c]===C&&g[c].length>0){for(var v=0;v<g[c].length;v++)if(Se(g[c][v],p))return c===R?n:c}else if(Se(g[c],p))return c===R?n:c;return g.hasOwnProperty("*")?g["*"]:p},qe={"1.0":"/8","1.2":"/1","1.3":"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},Ae={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2","8.1":"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},Te={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[a,[e,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[a,[e,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[e,a],[/opios[\/ ]+([\w\.]+)/i],[a,[e,F+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[a,[e,F+" GX"]],[/\bopr\/([\w\.]+)/i],[a,[e,F]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[a,[e,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[a,[e,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon)\/([-\w\.]+)/i,/(heytap|ovi|115)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[e,a],[/quark(?:pc)?\/([-\w\.]+)/i],[a,[e,"Quark"]],[/\bddg\/([\w\.]+)/i],[a,[e,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[a,[e,"UC"+X]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[a,[e,"WeChat"]],[/konqueror\/([\w\.]+)/i],[a,[e,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[a,[e,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[a,[e,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[a,[e,"Smart Lenovo "+X]],[/(avast|avg)\/([\w\.]+)/i],[[e,/(.+)/,"$1 Secure "+X],a],[/\bfocus\/([\w\.]+)/i],[a,[e,Q+" Focus"]],[/\bopt\/([\w\.]+)/i],[a,[e,F+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[a,[e,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[a,[e,"Dolphin"]],[/coast\/([\w\.]+)/i],[a,[e,F+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[a,[e,"MIUI"+ke]],[/fxios\/([\w\.-]+)/i],[a,[e,Q]],[/\bqihoobrowser\/?([\w\.]*)/i],[a,[e,"360"]],[/\b(qq)\/([\w\.]+)/i],[[e,/(.+)/,"$1Browser"],a],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[e,/(.+)/,"$1"+ke],a],[/samsungbrowser\/([\w\.]+)/i],[a,[e,W+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[a,[e,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[e,"Sogou Mobile"],a],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[e,a],[/(lbbrowser|rekonq)/i,/\[(linkedin)app\]/i],[e],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[a,e],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[e,xe],a],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[e,a],[/\bgsa\/([\w\.]+) .*safari\//i],[a,[e,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[a,[e,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[a,[e,K+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[e,K+" WebView"],a],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[a,[e,"Android "+X]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[e,a],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[a,[e,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[a,e],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[e,[a,ee,qe]],[/(webkit|khtml)\/([\w\.]+)/i],[e,a],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[e,"Netscape"],a],[/(wolvic|librewolf)\/([\w\.]+)/i],[e,a],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[a,[e,Q+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[e,[a,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[e,[a,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[k,"amd64"]],[/(ia32(?=;))/i],[[k,P]],[/((?:i[346]|x)86)[;\)]/i],[[k,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[k,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[k,"armhf"]],[/windows (ce|mobile); ppc;/i],[[k,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[k,/ower/,m,P]],[/(sun4\w)[;\)]/i],[[k,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[k,P]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[t,[i,W],[o,b]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[t,[i,W],[o,l]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[t,[i,S],[o,l]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[t,[i,S],[o,b]],[/(macintosh);/i],[t,[i,S]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[t,[i,fe],[o,l]],[/(?:honor)([-\w ]+)[;\)]/i],[t,[i,"Honor"],[o,l]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[t,[i,ge],[o,b]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[t,[i,ge],[o,l]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i],[[t,/_/g," "],[i,se],[o,l]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[t,/_/g," "],[i,se],[o,b]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[t,[i,"OPPO"],[o,l]],[/\b(opd2\d{3}a?) bui/i],[t,[i,"OPPO"],[o,b]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[t,[i,"Vivo"],[o,l]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[t,[i,"Realme"],[o,l]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[t,[i,he],[o,l]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[t,[i,he],[o,b]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[t,[i,ae],[o,b]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[t,[i,ae],[o,l]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[t,[i,"Lenovo"],[o,b]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[t,/_/g," "],[i,"Nokia"],[o,l]],[/(pixel c)\b/i],[t,[i,D],[o,b]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[t,[i,D],[o,l]],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[t,[i,J],[o,l]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[t,"Xperia Tablet"],[i,J],[o,b]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[t,[i,"OnePlus"],[o,l]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[t,[i,w],[o,b]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[t,/(.+)/g,"Fire Phone $1"],[i,w],[o,l]],[/(playbook);[-\w\),; ]+(rim)/i],[t,i,[o,b]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[t,[i,me],[o,l]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[t,[i,Y],[o,b]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[t,[i,Y],[o,l]],[/(nexus 9)/i],[t,[i,"HTC"],[o,b]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[i,[t,/_/g," "],[o,l]],[/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])\w*(\)| bui)/i],[t,[i,"TCL"],[o,b]],[/(itel) ((\w+))/i],[[i,P],t,[o,ee,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[t,[i,"Acer"],[o,b]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[t,[i,"Meizu"],[o,l]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[t,[i,"Ulefone"],[o,l]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[t,[i,"Energizer"],[o,l]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[t,[i,"Cat"],[o,l]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[t,[i,"Smartfren"],[o,l]],[/droid.+; (a(?:015|06[35]|142p?))/i],[t,[i,"Nothing"],[o,l]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (imo) ((?!tab)[\w ]+?)(?: bui|\))/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[i,t,[o,l]],[/(imo) (tab \w+)/i,/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[i,t,[o,b]],[/(surface duo)/i],[t,[i,re],[o,b]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[t,[i,"Fairphone"],[o,l]],[/(u304aa)/i],[t,[i,"AT&T"],[o,l]],[/\bsie-(\w*)/i],[t,[i,"Siemens"],[o,l]],[/\b(rct\w+) b/i],[t,[i,"RCA"],[o,b]],[/\b(venue[\d ]{2,7}) b/i],[t,[i,"Dell"],[o,b]],[/\b(q(?:mv|ta)\w+) b/i],[t,[i,"Verizon"],[o,b]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[t,[i,"Barnes & Noble"],[o,b]],[/\b(tm\d{3}\w+) b/i],[t,[i,"NuVision"],[o,b]],[/\b(k88) b/i],[t,[i,"ZTE"],[o,b]],[/\b(nx\d{3}j) b/i],[t,[i,"ZTE"],[o,l]],[/\b(gen\d{3}) b.+49h/i],[t,[i,"Swiss"],[o,l]],[/\b(zur\d{3}) b/i],[t,[i,"Swiss"],[o,b]],[/\b((zeki)?tb.*\b) b/i],[t,[i,"Zeki"],[o,b]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[i,"Dragon Touch"],t,[o,b]],[/\b(ns-?\w{0,9}) b/i],[t,[i,"Insignia"],[o,b]],[/\b((nxa|next)-?\w{0,9}) b/i],[t,[i,"NextBook"],[o,b]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[i,"Voice"],t,[o,l]],[/\b(lvtel\-)?(v1[12]) b/i],[[i,"LvTel"],t,[o,l]],[/\b(ph-1) /i],[t,[i,"Essential"],[o,l]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[t,[i,"Envizen"],[o,b]],[/\b(trio[-\w\. ]+) b/i],[t,[i,"MachSpeed"],[o,b]],[/\btu_(1491) b/i],[t,[i,"Rotor"],[o,b]],[/(shield[\w ]+) b/i],[t,[i,"Nvidia"],[o,b]],[/(sprint) (\w+)/i],[i,t,[o,l]],[/(kin\.[onetw]{3})/i],[[t,/\./g," "],[i,re],[o,l]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[t,[i,ne],[o,b]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[t,[i,ne],[o,l]],[/smart-tv.+(samsung)/i],[i,[o,y]],[/hbbtv.+maple;(\d+)/i],[[t,/^/,"SmartTV"],[i,W],[o,y]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[i,ae],[o,y]],[/(apple) ?tv/i],[i,[t,S+" TV"],[o,y]],[/crkey/i],[[t,K+"cast"],[i,D],[o,y]],[/droid.+aft(\w+)( bui|\))/i],[t,[i,w],[o,y]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[t,[i,fe],[o,y]],[/(bravia[\w ]+)( bui|\))/i],[t,[i,J],[o,y]],[/(mitv-\w{5}) bui/i],[t,[i,se],[o,y]],[/Hbbtv.*(technisat) (.*);/i],[i,t,[o,y]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[i,le],[t,le],[o,y]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[o,y]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[i,t,[o,A]],[/droid.+; (shield) bui/i],[t,[i,"Nvidia"],[o,A]],[/(playstation [345portablevi]+)/i],[t,[i,J],[o,A]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[t,[i,re],[o,A]],[/\b(sm-[lr]\d\d[05][fnuw]?s?)\b/i],[t,[i,W],[o,E]],[/((pebble))app/i],[i,t,[o,E]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[t,[i,S],[o,E]],[/droid.+; (glass) \d/i],[t,[i,D],[o,E]],[/droid.+; (wt63?0{2,3})\)/i],[t,[i,ne],[o,E]],[/droid.+; (glass) \d/i],[t,[i,D],[o,E]],[/(pico) (4|neo3(?: link|pro)?)/i],[i,t,[o,E]],[/; (quest( \d| pro)?)/i],[t,[i,xe],[o,E]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[i,[o,q]],[/(aeobc)\b/i],[t,[i,w],[o,q]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[t,[o,l]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[t,[o,b]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[o,b]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[o,l]],[/(android[-\w\. ]{0,9});.+buil/i],[t,[i,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[a,[e,Le+"HTML"]],[/(arkweb)\/([\w\.]+)/i],[e,a],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[a,[e,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[e,a],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[a,e]],os:[[/microsoft (windows) (vista|xp)/i],[e,a],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[e,[a,ee,Ae]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[a,ee,Ae],[e,"Windows"]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[a,/_/g,"."],[e,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[e,ye],[a,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[a,e],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish|openharmony)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[e,a],[/\(bb(10);/i],[a,[e,me]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[a,[e,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[a,[e,Q+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[a,[e,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[a,[e,"watchOS"]],[/crkey\/([\d\.]+)/i],[a,[e,K+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[e,ve],a],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[e,a],[/(sunos) ?([\w\.\d]*)/i],[[e,"Solaris"],a],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[e,a]]},O=function(p,g){if(typeof p===C&&(g=p,p=n),!(this instanceof O))return new O(p,g).getResult();var c=typeof d!==B&&d.navigator?d.navigator:n,v=p||(c&&c.userAgent?c.userAgent:m),M=c&&c.userAgentData?c.userAgentData:n,_=g?Pe(Te,g):Te,h=c&&c.userAgent==v;return this.getBrowser=function(){var s={};return s[e]=n,s[a]=n,H.call(s,v,_.browser),s[N]=Ue(s[a]),h&&c&&c.brave&&typeof c.brave.isBrave==I&&(s[e]="Brave"),s},this.getCPU=function(){var s={};return s[k]=n,H.call(s,v,_.cpu),s},this.getDevice=function(){var s={};return s[i]=n,s[t]=n,s[o]=n,H.call(s,v,_.device),h&&!s[o]&&M&&M.mobile&&(s[o]=l),h&&s[t]=="Macintosh"&&c&&typeof c.standalone!==B&&c.maxTouchPoints&&c.maxTouchPoints>2&&(s[t]="iPad",s[o]=b),s},this.getEngine=function(){var s={};return s[e]=n,s[a]=n,H.call(s,v,_.engine),s},this.getOS=function(){var s={};return s[e]=n,s[a]=n,H.call(s,v,_.os),h&&!s[e]&&M&&M.platform&&M.platform!="Unknown"&&(s[e]=M.platform.replace(/chrome os/i,ve).replace(/macos/i,ye)),s},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return v},this.setUA=function(s){return v=typeof s===L&&s.length>u?le(s,u):s,this},this.setUA(v),this};O.VERSION=Z,O.BROWSER=$([e,a,N]),O.CPU=$([k]),O.DEVICE=$([t,i,o,A,l,y,b,E,q]),O.ENGINE=O.OS=$([e,a]),f.exports&&(x=f.exports=O),x.UAParser=O;var U=typeof d!==B&&(d.jQuery||d.Zepto);if(U&&!U.ua){var ie=new O;U.ua=ie.getResult(),U.ua.get=function(){return ie.getUA()},U.ua.set=function(p){ie.setUA(p);var g=ie.getResult();for(var c in g)U.ua[c]=g[c]}}})(typeof window=="object"?window:ii)}(G,G.exports)),G.exports}var ti=oi();const be=De(ti);function ai({user:f,sessionUser:x}){const d=V(()=>(f?.passports||[])?.find(n=>n.name===x.role),[f?.passports,x?.role]);return r.jsxs(T,{sx:{display:"flex",alignItems:"center",gap:1},children:[r.jsx(Ge,{size:40,variant:"circle",shape:"circle",src:x.avatar,did:x.did,sx:{flexShrink:0}}),r.jsxs(T,{sx:{flex:1,overflow:"hidden"},children:[r.jsxs(T,{sx:{display:"flex",alignItems:"center",gap:1},children:[r.jsx(we,{title:x.fullName,children:r.jsx(j,{sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",flex:1},children:x.fullName})}),r.jsx(Fe,{label:d?.title||d?.name||"Guest",size:"small",variant:"outlined",sx:{flexShrink:0,fontWeight:"bold",fontSize:"12px",color:"text.primary",borderColor:"grey.300",backgroundColor:"transparent",textTransform:"capitalize",pr:.5,pl:0,height:"auto"}})]}),r.jsx(we,{title:x.email,children:r.jsx(j,{variant:"body2",color:"grey",sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:x.email})})]})]})}const ri={zh:{confirm:"确认",cancel:"取消",visitorId:"设备标识",deviceType:"设备类型",platform:"操作系统",walletOS:"钱包类型",role:"角色",fullname:"姓名",email:"邮箱",avatar:"头像",user:"用户",createdAt:"首次活动时间",updatedAt:"最近活动时间",lastLoginIp:"最近活动地址",actions:"操作",logoutAll:"注销所有{type}会话",logoutAllTips:"不会注销当前会话",logout:"注销",currentSession:"当前会话",unknown:"未知",expired:"已过期",remove:"删除",logoutThisSession:"注销指定会话",logoutThisSessionConfirm:"确定要注销此会话吗?",logoutAllSession:"注销所有{type}会话",logoutAllSessionConfirm:"确定要注销所有{type}会话吗?",online:"活跃"},en:{confirm:"Confirm",cancel:"Cancel",visitorId:"Device ID",deviceType:"Device Type",platform:"Platform",walletOS:"Wallet OS",role:"Role",fullname:"Fullname",email:"Email",avatar:"Avatar",user:"User",createdAt:"First Active Time",updatedAt:"Last Active Time",actions:"Actions",lastLoginIp:"Last Login IP",logoutAll:"Logout all {type} sessions",logoutAllTips:"Will not logout current session",logout:"Logout",currentSession:"Current Session",unknown:"Unknown",expired:"Expired",remove:"Remove",logoutThisSession:"Logout this session",logoutThisSessionConfirm:"Are you sure to logout this session?",logoutAllSession:"Logout all {type} sessions",logoutAllSessionConfirm:"Are you sure to logout all {type} sessions?",online:"Active"}},Ne="Reserved IP",ze="ip-region-cache";async function si(f){const x=`https://ipapi.co/${f}/json/`,d=await(await fetch(x)).json();let n="";return d.error?d.reserved&&(n=Ne):n=[d.country_name,d.region,d.city].filter(Boolean).join("/"),n}async function ni(f){const x=`https://api.ip.sb/geoip/${f}`,d=await(await fetch(x)).json();let n="";return d.error?d.reserved&&(n=Ne):n=[d.country,d.region,d.city].filter(Boolean).join("/"),n}async function li(f){let x="",d={};try{const n=localStorage.getItem(ze);n&&(d=JSON.parse(n))}catch{d={}}if(d[f])x=d[f];else{try{x=await ni(f)}catch{console.warn("Fail to get ip region from ip.sb")}if(!x)try{x=await si(f)}catch{console.warn("Fail to get ip region from ip-api.co")}}if(x){const n=Object.keys(d);n.length>100&&delete d[n[0]],d[f]&&delete d[f],d[f]=x,localStorage.setItem(ze,JSON.stringify(d))}return x}const Be=f=>new be(f,{browser:[[/(ArcWallet)\/([\w\.]+)/i],[be.BROWSER.NAME,be.BROWSER.VERSION]]}).getResult(),Me={display:"flex",justifyContent:"flex-end",textAlign:"right"},ci=new ei({concurrency:1}),di=te.memo(({userSession:f,isMobile:x=!1})=>{const d=pe({loading:!0,ipRegion:""}),{t:n}=Ie();return te.useEffect(()=>{ci.add(async()=>{try{d.ipRegion=await li(f.lastLoginIp)}finally{d.loading=!1}})},[d,f.lastLoginIp]),r.jsx(T,{...x&&{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:1,flexWrap:"wrap"},children:d.ipRegion?r.jsxs(r.Fragment,{children:[r.jsx(j,{variant:"body2",children:d.ipRegion}),r.jsx(j,{variant:"body2",color:"grey",children:f.lastLoginIp||n("unknown")})]}):r.jsxs(r.Fragment,{children:[r.jsx(j,{children:f.lastLoginIp||n("unknown")}),d.loading?r.jsx(j,{variant:"body2",color:"grey",sx:{textAlign:"center"},children:r.jsx(Ve,{size:12,color:"inherit"})}):null]})})});function hi({user:f,showAction:x=!0,showUser:d=!0,getUserSessions:n,showOffline:Z=!1}){const m=pe({status:"online",page:1,pageSize:10}),R=pe({online:0,expired:0,offline:0}),I=Ze(),{locale:B}=Ie(),C=Je({key:"md"}),L=We(u=>u.breakpoints.down("lg")),{confirmApi:N,confirmHolder:t}=$e(),e=oe((u,w={})=>Ye(ri,u,B,"en",w)),o=oe(async()=>{const u=await n({page:m.page,pageSize:m.pageSize,status:m.status}),w=u?.paging?.total||0;return R[m.status]=w,{total:w,list:u?.list||[]}});Ke(async()=>{const u=await n({page:1,pageSize:1,status:"expired"});R.expired=u?.paging?.total||0;const w=await n({page:1,pageSize:1,status:"offline"});R.offline=w?.paging?.total||0});const i=Qe(o,{refreshDeps:[m.status,m.page,m.pageSize]}),a=V(()=>i.data?.list||[],[i.data?.list]),k=V(()=>{const u=m.status;return u==="online"?R[u]<=1:R[u]===0},[a,I]),A=V(()=>Ce({},C?Me:{}),[C]),l=oe(({visitorId:u})=>{N.open({title:e("logoutThisSession"),content:e("logoutThisSessionConfirm"),confirmButtonText:e("confirm"),confirmButtonProps:{color:"error"},cancelButtonText:e("cancel"),onConfirm:async()=>{await Oe.user.logout({visitorId:u,includeFederated:!0});const{page:w=0}=m,{list:S=[]}=i.data||{},Y=S.length||0;w>1&&Y===1&&(m.page=Math.max(w-1,1)),i.refresh(),N.close()}})}),b=oe(()=>{N.open({title:e("logoutAllSession",{type:e(m.status)}),content:e("logoutAllSessionConfirm",{type:e(m.status)}),confirmButtonText:e("confirm"),confirmButtonProps:{color:"error"},cancelButtonText:e("cancel"),onConfirm:async()=>{await Oe.user.logout({status:m.status,visitorId:I,includeFederated:!0}),m.page=1,i.refresh(),N.close()}})}),y=[];x&&y.push(r.jsx(we,{title:e("logoutAllTips",{type:e(m.status)}),children:r.jsx(Re,{sx:{ml:.5},size:"small",variant:"contained",color:"error",onClick:b,disabled:k,children:e("logoutAll",{type:e(m.status)})})},"logoutAll"));const E=V(()=>({search:!1,sort:!1,download:!1,filter:!1,print:!1,expandableRowsOnClick:!1,searchDebounceTime:600,page:m.page-1,rowsPerPage:m.pageSize,count:i.data?.total||0}),[i.data?.total,m.page,m.pageSize]),q=[{label:e("platform"),name:"platform",options:{customBodyRenderLite:u=>{const w=a[u],S=Be(w?.ua);return r.jsx(T,{sx:A,children:[S.os?.name,S.os?.version].filter(Boolean).join("/")||e("unknown")})}}},{label:e("deviceType"),name:"deviceType",options:{customBodyRenderLite:u=>{const w=a[u],S=Be(w?.ua);return r.jsx(T,{sx:A,children:[S.browser?.name,S.browser?.version].filter(Boolean).join("/")||e("unknown")})}}},{label:e("walletOS"),name:"walletOS",options:{customBodyRenderLite:u=>{const w=a[u];return r.jsx(T,{sx:A,children:w.extra?.walletOS||e("unknown")})}}},d&&{label:e("user"),name:"user",options:{customBodyRenderLite:u=>{const w=a[u];return r.jsx(T,{sx:Ce({minWidth:150,maxWidth:250},C?Me:{}),children:r.jsx(ai,{sessionUser:w.user,user:f})})}}},{label:e("createdAt"),name:"createdAt",options:{customBodyRenderLite:u=>{const w=a[u];return r.jsx(T,{sx:A,children:w.createdAt?r.jsx(Ee,{value:w.createdAt,relativeRange:3*86400*1e3,locale:B}):e("unknown")})}}},!Z&&{label:e("updatedAt"),name:"updatedAt",options:{customBodyRenderLite:u=>{const w=a[u];return r.jsx(T,{sx:A,children:w.status==="expired"?e("expired"):r.jsx(Ee,{value:w.updatedAt,relativeRange:3*86400*1e3,locale:B})})}}},{label:e("lastLoginIp"),name:"lastLoginIp",options:{customBodyRenderLite:u=>{const w=a[u];return r.jsx(di,{userSession:w,isMobile:C})}}},x&&{label:e("actions"),name:"actions",options:{customBodyRenderLite:u=>{const w=a[u];return r.jsx(T,{sx:A,children:r.jsx(Re,{sx:{whiteSpace:"nowrap",fontSize:"12px !important",lineHeight:"1.25",px:1},disabled:I===w.visitorId,variant:"outlined",size:"small",color:"error",onClick:()=>l({visitorId:w.visitorId}),children:w.status==="expired"?e("remove"):I===w.visitorId?e("currentSession"):e("logout")})})}}}].filter(Boolean);return r.jsxs(T,{className:"pc-user-sessions",sx:{maxWidth:C?"unset":L?"calc(100vw - 300px)":"100%",...C&&{".pc-user-sessions-table > div:nth-child(2)":{border:"1px solid",borderColor:"divider",borderRadius:1}},".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableRow-root":{border:"unset","&:nth-child(even)":{backgroundColor:"grey.50","&:hover":{backgroundColor:u=>`${u.palette.grey[50]} !important`}}},".MuiTableRow-hover":{"&:hover":{backgroundColor:"inherit !important"}},".MuiTableCell-root":{paddingRight:"8px",paddingLeft:"8px",color:"text.secondary",...C&&{padding:"8px !important","&:first-child":{paddingTop:"20px!important"},"&:last-child":{paddingBottom:"20px!important"}}}},children:[t,r.jsx(Xe,{count:i.data?.total||0,locale:B,data:a,columns:q,customButtons:y,options:E,loading:i.loading,className:"pc-user-sessions-table",title:r.jsxs(He,{row:!0,sx:{lineHeight:1,ml:1},onChange:u=>{m.status=u.target.value},children:[r.jsx(de,{value:"online",control:r.jsx(ue,{size:"small",sx:{lineHeight:1,fontSize:0},checked:m.status==="online"}),label:r.jsxs(j,{sx:{display:"flex",alignItems:"center"},children:[e("online"),r.jsxs(j,{component:"span",sx:{ml:.5,color:"text.secondary"},children:["(",R.online,")"]})]})}),r.jsx(de,{value:"expired",control:r.jsx(ue,{size:"small",sx:{lineHeight:1,fontSize:0},checked:m.status==="expired"}),label:r.jsxs(j,{sx:{display:"flex",alignItems:"center"},children:[e("expired"),r.jsxs(j,{component:"span",sx:{ml:.5,color:"text.secondary"},children:["(",R.expired,")"]})]})}),Z?r.jsx(de,{value:"offline",control:r.jsx(ue,{size:"small",sx:{lineHeight:1,fontSize:0},checked:m.status==="offline"}),label:r.jsxs(j,{sx:{display:"flex",alignItems:"center"},children:[e("offline"),r.jsxs(j,{component:"span",sx:{ml:.5,color:"text.secondary"},children:["(",R.offline,")"]})]})}):null]}),onChange:u=>{m.page=u.page+1,m.pageSize=u.rowsPerPage}})]})}export{hi as A,gi as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as A}from"./vendor-utils-CtD44yV-.js";import{r as _}from"./base32-6sm6N7JR.js";import{c as r}from"./index-
|
|
1
|
+
import{C as A}from"./vendor-utils-CtD44yV-.js";import{r as _}from"./base32-6sm6N7JR.js";import{c as r}from"./index-CDq77s86.js";var n=_();function d(e,i,s,o=!1){if(e&&e.startsWith(r.USER_AVATAR_URL_PREFIX)){const R=window.env.apiPrefix||"/";if(s){if(o&&window.blocklet?.serverDid){const t=`https://${n.encode(window.blocklet?.serverDid)}.${r.DEFAULT_DID_DOMAIN}`;return`${A(t,r.USER_AVATAR_PATH_PREFIX,i,e.replace(r.USER_AVATAR_URL_PREFIX,""))}?imageFilter=resize&w=64&h=64`}return`${A(R,r.USER_AVATAR_PATH_PREFIX,e.replace(r.USER_AVATAR_URL_PREFIX,""))}?imageFilter=resize&w=64&h=64`}return`${A(R,r.USER_AVATAR_PATH_PREFIX,i,e.replace(r.USER_AVATAR_URL_PREFIX,""))}?imageFilter=resize&w=64&h=64`}return e}const l=(e,i)=>e.nodeOwner&&e.nodeOwner.did===i,w=(e,i)=>e&&e.did===i;export{w as a,l as i,d as p};
|