var C=Object.defineProperty;var f=Object.getOwnPropertySymbols;var B=Object.prototype.hasOwnProperty,A=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,l=(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((i,s)=>{var c=r=>{try{n(e.next(r))}catch(a){s(a)}},m=r=>{try{n(e.throw(r))}catch(a){s(a)}},n=r=>r.done?i(r.value):Promise.resolve(r.value).then(c,m);n((e=e.apply(o,t)).next())});import"./element-plus-XVJlWyfz.js";import"./vxe-CWcmrjam.js";import{a as q,B as v,a3 as y,q as E,ay as I,h as $}from"./Editor-_84wgCQz-ClJHNWEl.js";import{useRoute as g}from"./vue-router-BO40Wv73.js";import{d as k,ay as x,c as R,o as w,K as S,O as V,u as _}from"./vue-BfodOvnP.js";import{_ as K}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./lodash-es-BL-d_OSa.js";import"./@vueuse-vmN9qs5b.js";import"./@element-plus-icons-vue-CM-7yUXL.js";import"./shared-CzXu-bVE.js";import"./dayjs-DO-COJPZ.js";import"./monaco-editor-B5WqzYTl.js";import"./html2canvas-CIV5arX1.js";import"./mockjs-Du5X89jz.js";import"./marked-BQZxLJfc.js";const L={class:"loading"},N=k({__name:"Auth",props:{remote:{},access:{}},setup(o){return p(this,null,function*(){let t,e;const i=o,s=q(l(l({alert:y},v),i.access)),c=g(),m=a=>p(null,null,function*(){const d=`${i.remote||E}/api/open/user/${a}`,u=yield I(d).catch(()=>null);return!u||!u.success?(yield y("登录失败"),null):u.data}),n=c.query.token,r=n?([t,e]=x(()=>m(n)),t=yield t,e(),t):null;if(r)try{s.login(r);const a=c.query.redirect;location.href=decodeURIComponent(a||"/")}catch(a){location.reload()}return(a,d)=>(w(),R("div",L,"正在登录中..."))})}}),O=K(N,[["__scopeId","data-v-720ff9d2"]]),Z=k({__name:"auth",setup(o){return p(this,null,function*(){let t,e;const i=new $,s=([t,e]=x(()=>i.getExtension().catch(()=>null)),t=yield t,e(),t),c=s==null?void 0:s.remote,m=s==null?void 0:s.__ACCESS__;return(n,r)=>_(c)?(w(),S(_(O),{key:0,remote:_(c),access:_(m)},null,8,["remote","access"])):V("",!0)})}});export{Z as default};
