var x=Object.defineProperty;var f=Object.getOwnPropertySymbols;var b=Object.prototype.hasOwnProperty,A=Object.prototype.propertyIsEnumerable;var h=(o,t,e)=>t in o?x(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e,u=(o,t)=>{for(var e in t||(t={}))b.call(t,e)&&h(o,e,t[e]);if(f)for(var e of f(t))A.call(t,e)&&h(o,e,t[e]);return o};var p=(o,t,e)=>new Promise((c,s)=>{var n=a=>{try{i(e.next(a))}catch(r){s(r)}},m=a=>{try{i(e.throw(a))}catch(r){s(r)}},i=a=>a.done?c(a.value):Promise.resolve(a.value).then(n,m);i((e=e.apply(o,t)).next())});import"./element-plus-ByPIA5X9.js";import"./vxe-BRrz13Uv.js";import{a as B,aB as v,a5 as y,aC as E,aD as I,M as R}from"./Editor-BYRlEJ7f-DrA-LA5d.js";import{useRoute as U}from"./vue-router-BUqJHGtN.js";import{d as C,az as k,c as $,o as w,K as g,O as q,u as _}from"./vue-CWi9lEhc.js";import{_ as M}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./lodash-es-BaeSyToa.js";import"./@vueuse-DQGZ4KR4.js";import"./@element-plus-icons-vue-CM8mFRtE.js";import"./shared-CiMZBXIr.js";import"./dayjs-C1e0w4cr.js";import"./monaco-editor-xcHgnT1C.js";import"./html2canvas-DNSjNh3_.js";import"./mockjs-DhpLkc3z.js";import"./marked-BQZxLJfc.js";const S={class:"loading"},z=C({__name:"Auth",props:{remote:{},access:{},baseUrl:{default:"/"}},setup(o){return p(this,null,function*(){let t,e;const c=o,s=B(u(u({alert:y},v),c.access)),n=U(),m=r=>p(null,null,function*(){const d=`${c.remote||E}/api/open/user/${r}`,l=yield I(d).catch(()=>null);return!l||!l.success?(yield y("登录失败"),null):l.data}),i=n.query.token,a=i?([t,e]=k(()=>m(i)),t=yield t,e(),t):null;if(a)try{s.login(a);const r=n.query.redirect;location.href=decodeURIComponent(r||c.baseUrl)}catch(r){location.reload()}return(r,d)=>(w(),$("div",S,"正在登录中..."))})}}),D=M(z,[["__scopeId","data-v-2674e98b"]]),Z=C({__name:"auth",setup(o){return p(this,null,function*(){let t,e;const c=new R,s=([t,e]=k(()=>c.getExtension().catch(()=>null)),t=yield t,e(),t),n=s==null?void 0:s.remote,m=s==null?void 0:s.__ACCESS__;return(i,a)=>_(n)?(w(),g(_(D),{key:0,remote:_(n),access:_(m)},null,8,["remote","access"])):q("",!0)})}});export{Z as default};
