import{as as a,at as r,U as c}from"./main-DtyiNRRn.js";import{u as n}from"./login-Bm3sVYhM.js";const h={methods:{async logout({reason:o,successUrl:s}={}){const e=s||this.$fischer.pages.logoutSuccess().url,i=o?`${e}?reason=${o}`:e;try{this.$cookies.remove(n),this.$fischer.setAssistedService(),a.call(this),r(),await c.post("/webapi/shop/userapi/Logout",{}),await this.logoutFromSSO(i)}catch(t){console.error(t),this.error=!0}},logoutFromSSO(o){const s=new URL(o,window.location.origin);return window.location=`https://api.fischer.group/authorizationserver/logout.do?redirect_uri=${encodeURIComponent(s)}`,new Promise(()=>{})},async logoutIfTokenInvalid(o){(o==null?void 0:o.message)==="GraphQL error: Invalid token"&&await this.logoutToSuccess("invalidToken")},async logoutToSuccess(o){await this.logout(),o?window.location.href=`${this.$fischer.pages.logoutSuccess().url}?reason=${o}`:window.location.href=this.$fischer.pages.logoutSuccess().url}}};export{h as _};