!function(){function e(e){return function(e){if(Array.isArray(e))return t(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,n){if(!e)return;if("string"==typeof e)return t(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return t(e,n)}(e)||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 t(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n299||t.status<200)){e.next=6;break}throw clearTimeout(H),n="服务器错误,状态码"+t.status,m(n),new Error(n);case 6:return e.next=8,t.clone().json();case 8:if(200===(r=e.sent).code||0===r.errCode){e.next=16;break}throw o=r.msg||r.message||"处理失败,请重试",M&&(403===r.code||401===r.code?f():h()),403!==r.code&&401!==r.code&&(clearTimeout(H),m(o)),d(),403===r.code&&(o+="403",f(),window.location.href=window.location.origin+window.location.pathname+"#/home-layout-center"),new Error(o);case 16:return e.abrupt("return",t);case 17:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),{global:!1});var V=d(),J=o({name:"Auth-loayout",data:function(){return{loading:!1}},computed:{isExternal:function(){return this.$route.meta.isExternal&&!V.isStudent||!1},isNeedView:function(){return"login"===g.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(),g.orchestraInfo.unionId||_()},methods:{setAuth:function(){var e=this;return r(regeneratorRuntime.mark((function t(){var n,r,o,a,u,c,s,l;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.$route.query,(r=n.userInfo||n.Authorization)&&N(r),!e.loading){t.next=5;break}return t.abrupt("return");case 5:if("init"!==g.user.status&&"error"!==g.user.status){t.next=26;break}if(e.loading=!0,t.prev=7,!g.orchestraInfo.unionId){t.next=15;break}return t.next=11,F.post("/api-auth/smsLogin",{requestType:"form",data:{clientId:"student",clientSecret:"student",phone:g.orchestraInfo.phone,token:g.orchestraInfo.token,isSurportRegister:!0}});case 11:o=t.sent,a=o.data.authentication,N(a.token_type+" "+a.access_token),v({api:"setCache",content:{key:"h5-colexiu-token",value:a.token_type+" "+a.access_token}});case 15:return t.next=17,F.get("/api-student/student/queryUserInfo",{initRequest:!0,requestType:"form"});case 17:u=t.sent,y(u.data),t.next=25;break;case 21:t.prev=21,t.t0=t.catch(7),-1===(c=t.t0.message).indexOf("5000")&&-1===c.indexOf("authentication")?h():f();case 25:e.loading=!1;case 26:if("logout"===g.user.status)try{s=e.$route,l=i({returnUrl:e.$route.path},e.$route.query),s.meta.isRegister&&(l.isRegister=s.meta.isRegister),e.$router.replace({path:"/home-auth",query:l})}catch(m){}case 27:case"end":return t.stop()}}),t,null,[[7,21]])})))()}},render:function(){return b(j,null,["error"===g.user.status?b("div",{class:G.error},[b(x,{type:"notFond",classImgSize:"CERT",tips:"加载失败,请稍后重试",buttonText:"重新加载",plain:!0,onClick:this.setAuth},null)]):this.isNeedView?b(w,null,null):null])}}),K=[{path:"/share-music-sheet",name:"share-music-sheet",component:function(){return k((function(){return n.import("./index-legacy.e2b63520.js")}),void 0)},meta:{title:"分享乐曲"}},{path:"/leaderboard",component:function(){return k((function(){return n.import("./index-legacy.a081028f.js")}),void 0)},meta:{title:"曲目挑战排行榜"}}],Q=[{path:"/",component:$,children:[].concat(e(q),[{path:"/login",name:"login",component:function(){return k((function(){return n.import("./login-legacy.4439ad9e.js")}),void 0)},meta:{isRegister:!1}},{path:"/practiceClass",name:"practiceClass",component:function(){return k((function(){return n.import("./index-legacy.bd51969b.js")}),void 0)},meta:{title:"趣纠课"}},{path:"/videoDetail",name:"videoDetail",component:function(){return k((function(){return n.import("./video-detail-legacy.2ec10232.js")}),void 0)},meta:{title:"视频课"}},{path:"/videoClassDetail",name:"videoClassDetail",component:function(){return k((function(){return n.import("./video-class-detail-legacy.09df4ff3.js")}),void 0)},meta:{title:"视频课详情"}},{path:"/liveDetail",name:"liveDetail",component:function(){return k((function(){return n.import("./live-detail-legacy.f4bc44a3.js")}),void 0)},meta:{title:"直播课详情"}},{path:"/groupDetail",name:"groupDetail",component:function(){return k((function(){return n.import("./group-detail-legacy.25327a9f.js")}),void 0)},meta:{title:"小组课详情"}},{path:"/memberActive",name:"memberActive",component:function(){return k((function(){return n.import("./member-active-legacy.56e3ef71.js")}),void 0)},meta:{title:"小酷Ai会员大放价"}},{path:"/memberActiveO",name:"memberActiveO",component:function(){return k((function(){return n.import("./member-active-o-legacy.1f14f466.js")}),void 0)},meta:{title:"元旦狂想曲小酷送好礼"}},{path:"/memberRecord",name:"memberRecord",component:function(){return k((function(){return n.import("./member-record-legacy.7baffdae.js")}),void 0)},meta:{title:"练习统计"}},{path:"/tradeRecord",name:"tradeRecord",component:function(){return k((function(){return n.import("./index-legacy.b4024ce6.js")}),void 0)},meta:{title:"交易记录"}},{path:"/teacherHome",name:"teacherHome",component:function(){return k((function(){return n.import("./teacher-home-legacy.4577880a.js")}),void 0)},meta:{title:"老师主页"}},{path:"/teacherElegant",name:"teacherElegant",component:function(){return k((function(){return n.import("./teacher-elegant-legacy.b2aff5db.js")}),void 0)},meta:{title:"老师风采"}},{path:"/teacher-style",name:"teacher-style",component:function(){return k((function(){return n.import("./index-legacy.23ed9300.js")}),void 0)},meta:{title:"个人风采"}},{path:"/music-upload",component:function(){return k((function(){return n.import("./index-legacy.9a9f0204.js")}),void 0)},meta:{title:"上传曲谱"}},{path:"/teacherFollow",component:function(){return k((function(){return n.import("./teacher-follow-legacy.eb598570.js")}),void 0)},meta:{title:"我的关注"}},{path:"/track-review-activity",component:function(){return k((function(){return n.import("./index-legacy.176aded4.js")}),void 0)},meta:{title:"曲目评测活动",isExternal:!0}},{path:"/track-song",component:function(){return k((function(){return n.import("./track-song-legacy.4b0f477e.js")}),void 0)},meta:{title:"评测曲目"}},{path:"/discount-card",component:function(){return k((function(){return n.import("./index-legacy.1b23ed71.js")}),void 0)},meta:{title:"畅学卡"}},{path:"/double12Active",component:function(){return k((function(){return n.import("./index-legacy.33e34ec1.js")}),void 0)},meta:{title:"双十二限时特惠"}}])},{path:"/home-layout",component:J,children:[{path:"/home-auth",name:"home-auth",component:function(){return k((function(){return n.import("./auth-login-legacy.df1ee136.js")}),void 0)},meta:{title:"登录酷乐秀"}},{path:"/home-layout-center",name:"home-layout-center",component:function(){return k((function(){return n.import("./home-layout-center-legacy.3528ebce.js")}),void 0)},meta:{title:"登录酷乐秀"}},{path:"/home-login",name:"home-login",component:function(){return k((function(){return n.import("./login-legacy.d6448cca.js")}),void 0)},meta:{title:"登录酷乐秀"}},{path:"/home",name:"home",component:function(){return k((function(){return n.import("./index-legacy.9da6be43.js")}),void 0)}}]}].concat(K,e(U),[{path:"/inviteTeacher",name:"inviteTeacher",component:function(){return k((function(){return n.import("./index-legacy.f5dcf98e.js")}),void 0)},meta:{title:"邀请学员"}},{path:"/inviteSuccess",name:"inviteSuccess",component:function(){return k((function(){return n.import("./index-legacy.09b006cf.js")}),void 0)},meta:{title:"注册成功"}},{path:"/transfer",component:function(){return k((function(){return n.import("./transfer-legacy.fd0c0756.js")}),void 0)},meta:{title:"酷乐秀学院"}},{path:"/download",component:function(){return k((function(){return n.import("./download-legacy.603526f5.js")}),void 0)}},{path:"/:pathMatch(.*)*",component:function(){return k((function(){return n.import("./index-legacy.159bea24.js")}),void 0)},meta:{title:"404 Not Fund",platform:"STUDENT"}}]),W=A({history:I(),routes:Q,scrollBehavior:function(){return{left:0,top:0}}});W.beforeEach((function(e,t,n){var r=e.meta.title;document.title=r||"酷乐秀",n()}));var X=!1;W.onError((function(e){if(e instanceof Error){var t=e.name.indexOf("chunk"),n=W.currentRoute.value.fullPath;t&&!X&&(X=!0,R.alert({title:"更新提示",message:"APP有更新请点击确定刷新页面?",confirmButtonColor:"var(--van-primary)"}).then((function(){d().isApp?O({api:"back"}):(location.hash=n,window.location.reload())})))}})),void 0===window.ResizeObserver&&(window.ResizeObserver=T);var Y=S(L),Z=function(){var e=r(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return g.sourcType="kt",e.next=3,v({api:"getUserAccount"}).then(function(){var e=r(regeneratorRuntime.mark((function e(t){var n,r,o,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.content,console.log(n,"orchestra"),e.next=4,D.post("/api-auth/smsLogin",{requestType:"form",data:{clientId:"student",clientSecret:"student",phone:n.phone,isSurportRegister:!0,token:n.token.split(" ")[1]}});case 4:r=e.sent,o=r.data,i=o.authentication,E(i.token_type+" "+i.access_token);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}());case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ee=function(){var e=r(regeneratorRuntime.mark((function e(){var t,n,r,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(O({api:"setBarStatus",content:{status:0}}),O({api:"backIconChange",content:{backIconHide:!0}}),O({api:"getVersion"},(function(e){g.version=e.content.version})),d().isOrchestraStudent&&(v({api:"getUserAccount"}).then((function(e){var t=e.content;g.orchestraInfo.token=t.token.split(" ")[1],g.orchestraInfo.phone=t.phone,g.orchestraInfo.nickname=t.nickname,g.orchestraInfo.avatar=t.avatar,g.orchestraInfo.unionId=t.unionId||0})),v({api:"getCache",content:{key:"h5-colexiu-token"}}).then((function(e){var t=e.content;t.value&&E(t.value)}))),t=C.parse(location.search),n=C.parse(location.hash.split("?")[1]),r=t.source||n.source||"",o=t.Authorization||n.Authorization||"","kt"!==r){e.next=15;break}if(!o){e.next=13;break}g.sourcType="kt",e.next=15;break;case 13:return e.next=15,Z();case 15:d().isTeacher?g.platformType="TEACHER":(d().isStudent,g.platformType="STUDENT"),"TEACHER"===g.platformType?g.platformApi="/api-teacher":g.platformApi="/api-student",z.locale("zh-ch"),Y.config.globalProperties.$dayjs=z,Y.config.globalProperties.$filters=P,Y.use(W),Y.mount("#app");case 22:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();ee()}}}))}();