1import{r as c,j as e}from"./react-CRjXmzdu.js";import{T as g,U as d,V as m,W as w,X as h,y as f,L as x}from"./index-CSKv4Qvu.js";import{B as L,C as y,T as I}from"./mui-BxdtjvkT.js";import"./iconify-DtB_gzCW.js";import"./react-query-BRXozuDR.js";import"./redux-Dts5QXDw.js";import"./vendor-COBpgtl7.js";import"./router-BwRsLQU1.js";import"./lodash-CpjO0APP.js";import"./ui-utils-DqNXFlDe.js";import"./http-DoGoLSvF.js";import"./date-utils-Cj6NCtA4.js";import"./sanitize-B6Pz2xYC.js";import"./validation-B8dh9o27.js";import"./i18n-BIJR05_R.js";import"./emotion-CfcNTy1E.js";import"./firebase-Deeb8HW7.js";const S=new x("logout"),q=()=>{const[l,n]=c.useState(!0),u=async()=>{try{n(!0);const o=g();if(o&&window.self!==window.top){window.parent.postMessage({logout:!0},window.location.origin);return}const a=new URLSearchParams(window.location.search);if(!o&&a.get("scope")==="single"){await m(a.get("accountIndex")??void 0);return}await w(o),window.self===window.top&&(h([{key:"sessionToken"},{key:"token"},{key:"exp"}]),localStorage.removeItem("branding"),window.location.replace(f()))}catch(o){S.error("Logout.jsx [logout] catchError",o),n(!1)}};c.useEffect(()=>{u()},[]);const r=new URLSearchParams(window.location.search),i=!g()&&r.get("scope")==="single",t=d(),s=String(r.get("accountIndex")??""),p=!i||t.length<=1||t.length>0&&s!==""&&t.every(o=>String(o)===s);return!i||p?e.jsxs(L,{sx:{minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",gap:2,bgcolor:"background.default"},children:[l?e.jsx(y,{}):null,e.jsx(I,{variant:"body1",sx:{fontWeight:600},children:"Logging out..."})]}):null};export{q as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.