var C=Object.defineProperty;var f=Object.getOwnPropertySymbols;var A=Object.prototype.hasOwnProperty,g=Object.prototype.propertyIsEnumerable;var h=(o,t,e)=>t in o?C(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e,u=(o,t)=>{for(var e in t||(t={}))A.call(t,e)&&h(o,e,t[e]);if(f)for(var e of f(t))g.call(t,e)&&h(o,e,t[e]);return o};var p=(o,t,e)=>new Promise((c,s)=>{var n=r=>{try{i(e.next(r))}catch(a){s(a)}},m=r=>{try{i(e.throw(r))}catch(a){s(a)}},i=r=>r.done?c(r.value):Promise.resolve(r.value).then(n,m);i((e=e.apply(o,t)).next())});import"./element-plus-ciXMzd3x.js";import"./vxe-Cxl6Y1mN.js";import{g as B,az as b,a3 as y,aA as v,aB as E,j as I}from"./Editor-CuHU2UOb-CNnJYpWJ.js";import{useRoute as U}from"./vue-router-BQ6kViA5.js";import{d as k,az as w,c as $,o as x,K as j,O as q,u as _}from"./vue-lxu90ABC.js";import{_ as z}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./lodash-es-BL-d_OSa.js";import"./@vueuse-CAg6njPM.js";import"./@element-plus-icons-vue-F28aem0n.js";import"./shared-DgX_DHMy.js";import"./dayjs-DO-COJPZ.js";import"./monaco-editor-B5WUUp7a.js";import"./html2canvas-CIV5arX1.js";import"./mockjs-CAmsTtoR.js";import"./marked-BQZxLJfc.js";const R={class:"loading"},S=k({__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},b),c.access)),n=U(),m=a=>p(null,null,function*(){const d=`${c.remote||v}/api/open/user/${a}`,l=yield E(d).catch(()=>null);return!l||!l.success?(yield y("登录失败"),null):l.data}),i=n.query.token,r=i?([t,e]=w(()=>m(i)),t=yield t,e(),t):null;if(r)try{s.login(r);const a=n.query.redirect;location.href=decodeURIComponent(a||c.baseUrl)}catch(a){location.reload()}return(a,d)=>(x(),$("div",R,"正在登录中..."))})}}),K=z(S,[["__scopeId","data-v-2674e98b"]]),Z=k({__name:"auth",setup(o){return p(this,null,function*(){let t,e;const c=new I,s=([t,e]=w(()=>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,r)=>_(n)?(x(),j(_(K),{key:0,remote:_(n),access:_(m)},null,8,["remote","access"])):q("",!0)})}});export{Z as default};
