import{A as t,_ as n,z as e,c as a}from"./p-d8e783d1.js";import{s as r}from"./p-17b7253a.js";import{c as o}from"./p-b423423b.js";import"./p-a6974d5a.js";import{u as i}from"./p-c7f96882.js";const{state:s,onChange:c}=o({identity:null});c("identity",(r=>{var o;return r?(a.client.setLink(t.from([(o=(t,{headers:n})=>({headers:Object.assign(Object.assign({},n),{authorization:r.token})}),new t((function(t,a){var r=n(t,[]);return new e((function(n){var e;return Promise.resolve(r).then((function(){return o(0,t.getContext())})).then(t.setContext).then((function(){e=a(t).subscribe({next:n.next.bind(n),error:n.error.bind(n),complete:n.complete.bind(n)})})).catch(n.error.bind(n)),function(){e&&e.unsubscribe()}}))}))),a.client.link])),window.localStorage.setItem("canAuthenticate","1")):(document.cookie="refreshToken=; Path=/; Expires=Thu, 01 Jan 1970 00:00:01 GMT;",window.localStorage.removeItem("canAuthenticate")),null})),async function(){if(!window.localStorage.getItem("canAuthenticate"))return;const t=await a.client.mutate({mutation:r(i)});s.identity=t.data.userTokenRefresh}();export{s as a,c as o}