!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(q),n="服务器错误,状态码"+e.status,m(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||"处理失败,请重试",L&&(403===r.code||401===r.code?f():d()),403!==r.code&&401!==r.code&&(clearTimeout(q),m(o)),h(),403===r.code&&(o+="403",f(),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 N=h(),F=o({name:"Auth-loayout",data:function(){return{loading:!1}},computed:{isExternal:function(){return this.$route.meta.isExternal&&!N.isStudent||!1},isNeedView:function(){return"login"===_.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(),_.orchestraInfo.unionId||g()},methods:{setAuth:function(){var t=this;return r(regeneratorRuntime.mark((function e(){var n,r,o,a,u,c,s,l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.$route.query,(r=n.userInfo||n.Authorization)&&B(r),!t.loading){e.next=5;break}return e.abrupt("return");case 5:if("init"!==_.user.status&&"error"!==_.user.status){e.next=26;break}if(t.loading=!0,e.prev=7,!_.orchestraInfo.unionId){e.next=15;break}return e.next=11,G.post("/api-auth/smsLogin",{requestType:"form",data:{clientId:"student",clientSecret:"student",phone:_.orchestraInfo.phone,token:_.orchestraInfo.token,isSurportRegister:!0}});case 11:o=e.sent,a=o.data.authentication,B(a.token_type+" "+a.access_token),v({api:"setCache",content:{key:"h5-colexiu-token",value:a.token_type+" "+a.access_token}});case 15:return e.next=17,G.get("/api-student/student/queryUserInfo",{initRequest:!0,requestType:"form"});case 17:u=e.sent,y(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")?d():f();case 25:t.loading=!1;case 26:if("logout"===_.user.status)try{s=t.$route,l=i({returnUrl:t.$route.path},t.$route.query),s.meta.isRegister&&(l.isRegister=s.meta.isRegister),t.$router.replace({path:"/home-auth",query:l})}catch(m){}case 27:case"end":return e.stop()}}),e,null,[[7,21]])})))()}},render:function(){return b(x,null,["error"===_.user.status?b("div",{class:U.error},[b(j,{type:"notFond",classImgSize:"CERT",tips:"加载失败,请稍后重试",buttonText:"重新加载",plain:!0,onClick:this.setAuth},null)]):this.isNeedView?b(w,null,null):null])}}),M=[{path:"/share-music-sheet",name:"share-music-sheet",component:function(){return k((function(){return n.import("./index-legacy.d18ce982.js")}),void 0)},meta:{title:"分享乐曲"}},{path:"/leaderboard",component:function(){return k((function(){return n.import("./index-legacy.d91cef2a.js")}),void 0)},meta:{title:"曲目挑战排行榜"}}],V=[{path:"/",component:P,children:[].concat(t(z),[{path:"/login",name:"login",component:function(){return k((function(){return n.import("./login-legacy.3773c912.js")}),void 0)},meta:{isRegister:!1}},{path:"/practiceClass",name:"practiceClass",component:function(){return k((function(){return n.import("./index-legacy.84f911e0.js")}),void 0)},meta:{title:"陪练课"}},{path:"/videoDetail",name:"videoDetail",component:function(){return k((function(){return n.import("./video-detail-legacy.22779a2a.js")}),void 0)},meta:{title:"视频课"}},{path:"/videoClassDetail",name:"videoClassDetail",component:function(){return k((function(){return n.import("./video-class-detail-legacy.b93ffaa8.js")}),void 0)},meta:{title:"视频课详情"}},{path:"/liveDetail",name:"liveDetail",component:function(){return k((function(){return n.import("./live-detail-legacy.b4ae9c41.js")}),void 0)},meta:{title:"直播课详情"}},{path:"/memberActive",name:"memberActive",component:function(){return k((function(){return n.import("./member-active-legacy.cdaea888.js")}),void 0)},meta:{title:"小酷Ai会员大放价"}},{path:"/memberActiveO",name:"memberActiveO",component:function(){return k((function(){return n.import("./member-active-o-legacy.1827787d.js")}),void 0)},meta:{title:"元旦狂想曲小酷送好礼"}},{path:"/memberRecord",name:"memberRecord",component:function(){return k((function(){return n.import("./member-record-legacy.31e88e6e.js")}),void 0)},meta:{title:"训练统计"}},{path:"/tradeRecord",name:"tradeRecord",component:function(){return k((function(){return n.import("./index-legacy.5666918e.js")}),void 0)},meta:{title:"交易记录"}},{path:"/teacherHome",name:"teacherHome",component:function(){return k((function(){return n.import("./teacher-home-legacy.6c5d419a.js")}),void 0)},meta:{title:"老师主页"}},{path:"/teacherElegant",name:"teacherElegant",component:function(){return k((function(){return n.import("./teacher-elegant-legacy.6429ab78.js")}),void 0)},meta:{title:"老师风采"}},{path:"/music-upload",component:function(){return k((function(){return n.import("./index-legacy.66b8243f.js")}),void 0)},meta:{title:"上传曲谱"}},{path:"/teacherFollow",component:function(){return k((function(){return n.import("./teacher-follow-legacy.6c93a7d9.js")}),void 0)},meta:{title:"我的关注"}},{path:"/track-review-activity",component:function(){return k((function(){return n.import("./index-legacy.e44203ed.js")}),void 0)},meta:{title:"曲目评测活动",isExternal:!0}},{path:"/track-song",component:function(){return k((function(){return n.import("./track-song-legacy.7755c57c.js")}),void 0)},meta:{title:"评测曲目"}}])},{path:"/home-layout",component:F,children:[{path:"/home-auth",name:"home-auth",component:function(){return k((function(){return n.import("./auth-login-legacy.661f6d3d.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.219d98d1.js")}),void 0)},meta:{title:"登录酷乐秀"}},{path:"/home-login",name:"home-login",component:function(){return k((function(){return n.import("./login-legacy.61de3b99.js")}),void 0)},meta:{title:"登录酷乐秀"}},{path:"/home",name:"home",component:function(){return k((function(){return n.import("./index-legacy.3c44627c.js")}),void 0)}}]}].concat(M,t(D),[{path:"/inviteTeacher",name:"inviteTeacher",component:function(){return k((function(){return n.import("./index-legacy.38cae358.js")}),void 0)},meta:{title:"邀请学员"}},{path:"/inviteSuccess",name:"inviteSuccess",component:function(){return k((function(){return n.import("./index-legacy.98e3030a.js")}),void 0)},meta:{title:"注册成功"}},{path:"/transfer",component:function(){return k((function(){return n.import("./transfer-legacy.357bbd2b.js")}),void 0)},meta:{title:"酷乐秀学院"}},{path:"/download",component:function(){return k((function(){return n.import("./download-legacy.a68b4aaf.js")}),void 0)}},{path:"/:pathMatch(.*)*",component:function(){return k((function(){return n.import("./index-legacy.4bf841d6.js")}),void 0)},meta:{title:"404 Not Fund",platform:"STUDENT"}}]),J=A({history:I(),routes:V});J.beforeEach((function(t,e,n){var r=t.meta.title;document.title=r||"酷乐秀",n()}));var K=!1;J.onError((function(t){if(t instanceof Error){var e=t.name.indexOf("chunk"),n=J.currentRoute.value.fullPath;e&&!K&&(K=!0,O.alert({title:"更新提示",message:"APP有更新请点击确定刷新页面?",confirmButtonColor:"var(--van-primary)"}).then((function(){h().isApp?T({api:"back"}):(location.hash=n,window.location.reload())})))}}));var Q=E(H);T({api:"setBarStatus",content:{status:0}}),T({api:"backIconChange",content:{backIconHide:!0}}),T({api:"getVersion"},(function(t){_.version=t.content.version})),h().isOrchestraStudent&&(v({api:"getUserAccount"}).then((function(t){var e=t.content;_.orchestraInfo.token=e.token.split(" ")[1],_.orchestraInfo.phone=e.phone,_.orchestraInfo.nickname=e.nickname,_.orchestraInfo.avatar=e.avatar,_.orchestraInfo.unionId=e.unionId||0})),v({api:"getCache",content:{key:"h5-colexiu-token"}}).then((function(t){var e=t.content;e.value&&S(e.value)}))),h().isTeacher?_.platformType="TEACHER":(h().isStudent,_.platformType="STUDENT"),"TEACHER"===_.platformType?_.platformApi="/api-teacher":_.platformApi="/api-student",C.locale("zh-ch"),Q.config.globalProperties.$dayjs=C,Q.config.globalProperties.$filters=R,Q.use(J),Q.mount("#app")}}}))}();