!function(){function t(t){return function(t){if(Array.isArray(t))return e(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,n){if(!t)return;if("string"==typeof t)return e(t,n);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return e(t,n)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function e(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n299||e.status<200)){t.next=6;break}throw clearTimeout(D),n="服务器错误,状态码"+e.status,j(n),new Error(n);case 6:return t.next=8,e.clone().json();case 8:if(200===(r=t.sent).code||0===r.errCode){t.next=16;break}throw o=r.msg||r.message||"处理失败,请重试",B&&(403===r.code||401===r.code?_():h()),403!==r.code&&401!==r.code&&(clearTimeout(D),j(o)),l(),403===r.code&&(o+="403",_(),window.location.href=window.location.origin+window.location.pathname+"#/home-layout-center"),new Error(o);case 16:return t.abrupt("return",e);case 17:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),{global:!1});var M=l(),J=o({name:"Auth-loayout",data:function(){return{loading:!1}},computed:{isExternal:function(){return this.$route.meta.isExternal&&!M.isStudent||!1},isNeedView:function(){return"login"===m.user.status||"/home-auth"===this.$route.path||"/home-login"===this.$route.path||"/home-layout-center"===this.$route.path||this.isExternal}},mounted:function(){!this.isExternal&&this.setAuth(),m.orchestraInfo.unionId||A()},methods:{setAuth:function(){var t=this;return a(regeneratorRuntime.mark((function e(){var n,o,i,a,u,c,s,l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.$route.query,(o=n.userInfo||n.Authorization)&&L(o),!t.loading){e.next=5;break}return e.abrupt("return");case 5:if("init"!==m.user.status&&"error"!==m.user.status){e.next=26;break}if(t.loading=!0,e.prev=7,!m.orchestraInfo.unionId){e.next=15;break}return e.next=11,V.post("/api-auth/smsLogin",{requestType:"form",data:{clientId:"student",clientSecret:"student",phone:m.orchestraInfo.phone,token:m.orchestraInfo.token,isSurportRegister:!0}});case 11:i=e.sent,a=i.data.authentication,L(a.token_type+" "+a.access_token),I({api:"setCache",content:{key:"h5-colexiu-token",value:a.token_type+" "+a.access_token}});case 15:return e.next=17,V.get("/api-student/student/queryUserInfo",{initRequest:!0,requestType:"form"});case 17:u=e.sent,d(u.data),e.next=25;break;case 21:e.prev=21,e.t0=e.catch(7),-1===(c=e.t0.message).indexOf("5000")&&-1===c.indexOf("authentication")?h():_();case 25:t.loading=!1;case 26:if("logout"===m.user.status)try{s=t.$route,l=r({returnUrl:t.$route.path},t.$route.query),s.meta.isRegister&&(l.isRegister=s.meta.isRegister),t.$router.replace({path:"/home-auth",query:l})}catch(p){}case 27:case"end":return e.stop()}}),e,null,[[7,21]])})))()}},render:function(){return v(x,null,["error"===m.user.status?v("div",{class:H.error},[v(y,{type:"notFond",classImgSize:"CERT",tips:"加载失败,请稍后重试",buttonText:"重新加载",plain:!0,onClick:this.setAuth},null)]):this.isNeedView?v(b,null,null):null])}}),K=[{path:"/share-music-sheet",name:"share-music-sheet",component:function(){return R((function(){return n.import("./index-legacy.3420051c.js")}),void 0)},meta:{title:"分享乐曲"}},{path:"/leaderboard",component:function(){return R((function(){return n.import("./index-legacy.dd0a0aec.js")}),void 0)},meta:{title:"曲目挑战排行榜"}}],Q=[{path:"/",component:G,children:[].concat(t(E),[{path:"/login",name:"login",component:function(){return R((function(){return n.import("./login-legacy.7bacb5c0.js")}),void 0)},meta:{isRegister:!1}},{path:"/practiceClass",name:"practiceClass",component:function(){return R((function(){return n.import("./index-legacy.294d23c5.js")}),void 0)},meta:{title:"陪练课"}},{path:"/videoDetail",name:"videoDetail",component:function(){return R((function(){return n.import("./video-detail-legacy.95294c15.js")}),void 0)},meta:{title:"视频课"}},{path:"/videoClassDetail",name:"videoClassDetail",component:function(){return R((function(){return n.import("./video-class-detail-legacy.476ec0bd.js")}),void 0)},meta:{title:"视频课详情"}},{path:"/liveDetail",name:"liveDetail",component:function(){return R((function(){return n.import("./live-detail-legacy.05c8d3a4.js")}),void 0)},meta:{title:"直播课详情"}},{path:"/memberActive",name:"memberActive",component:function(){return R((function(){return n.import("./member-active-legacy.fd81f674.js")}),void 0)},meta:{title:"小酷Ai会员大放价"}},{path:"/memberRecord",name:"memberRecord",component:function(){return R((function(){return n.import("./member-record-legacy.fe79bc6b.js")}),void 0)},meta:{title:"训练统计"}},{path:"/tradeRecord",name:"tradeRecord",component:function(){return R((function(){return n.import("./index-legacy.2f09304d.js")}),void 0)},meta:{title:"交易记录"}},{path:"/teacherHome",name:"teacherHome",component:function(){return R((function(){return n.import("./teacher-home-legacy.3ead31c1.js")}),void 0)},meta:{title:"老师主页"}},{path:"/teacherElegant",name:"teacherElegant",component:function(){return R((function(){return n.import("./teacher-elegant-legacy.7a00c027.js")}),void 0)},meta:{title:"老师风采"}},{path:"/music-upload",component:function(){return R((function(){return n.import("./index-legacy.892a95c0.js")}),void 0)},meta:{title:"上传曲谱"}},{path:"/teacherFollow",component:function(){return R((function(){return n.import("./teacher-follow-legacy.3d7a8f5e.js")}),void 0)},meta:{title:"我的关注"}},{path:"/track-review-activity",component:function(){return R((function(){return n.import("./index-legacy.72990bcd.js")}),void 0)},meta:{title:"曲目评测活动",isExternal:!0}},{path:"/track-song",component:function(){return R((function(){return n.import("./track-song-legacy.bc605257.js")}),void 0)},meta:{title:"评测曲目"}}])},{path:"/home-layout",component:J,children:[{path:"/home-auth",name:"home-auth",component:function(){return R((function(){return n.import("./auth-login-legacy.87e3c360.js")}),void 0)},meta:{title:"登录酷乐秀"}},{path:"/home-layout-center",name:"home-layout-center",component:function(){return R((function(){return n.import("./home-layout-center-legacy.eaa31f8a.js")}),void 0)},meta:{title:"登录酷乐秀"}},{path:"/home-login",name:"home-login",component:function(){return R((function(){return n.import("./login-legacy.4122eb72.js")}),void 0)},meta:{title:"登录酷乐秀"}},{path:"/home",name:"home",component:function(){return R((function(){return n.import("./index-legacy.fbfec60a.js")}),void 0)}}]}].concat(K,t(O),[{path:"/inviteTeacher",name:"inviteTeacher",component:function(){return R((function(){return n.import("./index-legacy.841ddeb2.js")}),void 0)},meta:{title:"邀请学员"}},{path:"/inviteSuccess",name:"inviteSuccess",component:function(){return R((function(){return n.import("./index-legacy.7baa58c5.js")}),void 0)},meta:{title:"注册成功"}},{path:"/transfer",component:function(){return R((function(){return n.import("./transfer-legacy.96db33d9.js")}),void 0)},meta:{title:"酷乐秀学院"}},{path:"/download",component:function(){return R((function(){return n.import("./download-legacy.58d2fd48.js")}),void 0)}},{path:"/:pathMatch(.*)*",component:function(){return R((function(){return n.import("./index-legacy.b2f29da2.js")}),void 0)},meta:{title:"404 Not Fund",platform:"STUDENT"}}]),W=T({history:S(),routes:Q});W.beforeEach((function(t,e,n){var r=t.meta.title;document.title=r||"酷乐秀",n()}));var X=!1;W.onError((function(t){if(t instanceof Error){var e=t.name.indexOf("chunk"),n=W.currentRoute.value.fullPath;e&&!X&&(X=!0,C.alert({title:"更新提示",message:"APP有更新请点击确定刷新页面?",confirmButtonColor:"var(--van-primary)"}).then((function(){l().isApp?g({api:"back"}):(location.hash=n,window.location.reload())})))}}));var Y=$(U);g({api:"getVersion"},(function(t){m.version=t.content.version})),l().isOrchestraStudent&&(I({api:"getUserAccount"}).then((function(t){var e=t.content;m.orchestraInfo.token=e.token.split(" ")[1],m.orchestraInfo.phone=e.phone,m.orchestraInfo.nickname=e.nickname,m.orchestraInfo.avatar=e.avatar,m.orchestraInfo.unionId=e.unionId||0})),I({api:"getCache",content:{key:"h5-colexiu-token"}}).then((function(t){var e=t.content;e.value&&p(e.value)}))),l().isTeacher?m.platformType="TEACHER":(l().isStudent,m.platformType="STUDENT"),"TEACHER"===m.platformType?m.platformApi="/api-teacher":m.platformApi="/api-student",z.locale("zh-ch"),Y.config.globalProperties.$dayjs=z,Y.config.globalProperties.$filters=P,Y.use(W),Y.mount("#app")}}}))}();