import{d as y,g as F,o as L,s as H,a as O,b as G,c as x,e as D,f as e,h as I,T as j,R as V,F as B,i as W,j as J,k as Q,t as Y,l as z,r as U,N as $,m as q,n as C,p as A,q as K,u as n,v as i,I as Z,P as X,w as ee,x as te,y as ne,z as oe,A as M,B as ae,S as se,C as ie,M as re,D as le,E as ce,G as ue,H as de,J as pe,K as me,L as ge,O as he,Q as _e,U as ve,V as ye,W as fe,X as we,Y as Ie,Z as be}from"./index-9b17f61c.js";import{P as ke}from"./plyr.min-424cfb91.js";function pt(){import.meta.url,import("_").catch(()=>1);async function*l(){}}const Se=y({name:"App",setup(){const l=F(),c=async()=>I.platformType==="WEB"?await Q():I.platformType==="TEACHER"?await Y():await z(),s=async()=>{const o=await c(),{student:g}=(o==null?void 0:o.data)||{};W(g)};L(()=>{l.Authorization&&H(l.Authorization),s(),O(J()),G(l.campId||"")}),x(()=>{const o=document.getElementById("loading");o&&document.body.removeChild(o)});const m=D(()=>I.status==="login");return()=>e(B,null,[I.status==="error"?e(j,null,null):m.value?e(V,null,null):null])}}),xe="_skeleton_ohh0n_1",Ce="_detail_ohh0n_12",Be="_headHeight_ohh0n_20",Ne="_headHide_ohh0n_26",Pe="_container_ohh0n_29",Ee="_shareBox_ohh0n_37",Re="_demos_ohh0n_43",Te="_right_ohh0n_64",Ae="_wrong_ohh0n_68",Me="_notPlay_ohh0n_72",Fe="_cadence_wrong_ohh0n_76",Le="_intonation_wrong_ohh0n_80",De="_integrity_wrong_ohh0n_84",Ue="_android_ohh0n_88",r={skeleton:xe,detail:Ce,headHeight:Be,headHide:Ne,container:Pe,shareBox:Ee,demos:Re,right:Te,wrong:Ae,notPlay:Me,cadence_wrong:Fe,intonation_wrong:Le,integrity_wrong:De,android:Ue},He=l=>U.get("/sysMusicScoreAccompaniment/queryPage",{params:{clientType:"SMART_PRACTICE",sysMusicScoreId:l}}),Oe=l=>U.get("/sysMusicRecord/getLastEvaluationMusicalNotesPlayStats",{params:{recordId:l}}),Ge="_headerTop_2gg2k_1",je="_back_2gg2k_12",Ve="_left_2gg2k_23",We="_center_2gg2k_27",Je="_cItem_2gg2k_32",Qe="_active_2gg2k_53",Ye="_replaybtn_2gg2k_56",ze="_iconBtn_2gg2k_74",$e="_popup_2gg2k_80",qe="_audiobox_2gg2k_92",Ke="_videobox_2gg2k_99",a={headerTop:Ge,back:je,left:Ve,center:We,cItem:Je,active:Qe,replaybtn:Ye,iconBtn:ze,popup:$e,audiobox:qe,videobox:Ke},Ze="_container_1g67n_1",Xe="_noticeBar_1g67n_10",et="_icon_1g67n_14",tt="_status_1g67n_19",b={container:Ze,noticeBar:Xe,icon:et,status:tt},nt=""+new URL("arrow-c0b252e8.svg",import.meta.url).href,ot=""+new URL("music-38aa44e9.png",import.meta.url).href,at=y({name:"detail-title",props:{text:{type:String,default:""},rightView:{type:Boolean,default:!0},onClick:{type:Function}},render(){return e("div",{class:b.container},[e("img",{class:b.icon,src:ot},null),e($,{text:this.text,color:"#000",class:b.noticeBar,background:"none"},null),this.rightView?e("img",{class:b.status,src:nt},null):null])}}),st=""+new URL("icon-back-0a0ee88d.svg",import.meta.url).href,it=""+new URL("videobg-2d19d627.png",import.meta.url).href,rt=y({name:"header-top",props:{scoreData:{type:Object,default:()=>({})}},setup(l){const{scoreData:c}=q(l),s=C({show:!1,isInitPlyr:!1,_plrl:null}),m={BEGINNER:"入门级",ADVANCED:"进阶级",PERFORMER:"大师级"},o=A("intonation");A(!1);const g=()=>{ee()},h=u=>{},_=D(()=>{const u=(c.value.videoFilePath||"").split(".").pop();return u==="wav"||u==="mp3"?"audio":"video"}),k=()=>{s.show=!0,!s.isInitPlyr&&te(()=>{const u=_.value==="audio"?"#audioSrc":"#videoSrc";s._plrl=new ke(u,{controls:["play-large","play","progress","current-time"],fullscreen:{enabled:!1}}),s.isInitPlyr=!0})},f=K(n.track),S=n.examSongName+(f?` - ${n.track} (${f})`:"");return()=>e("div",{class:a.headerTop},[e("div",{class:a.left},[e("div",{class:a.back,onClick:g},[e("img",{src:st},null)]),e(at,{text:S},null)]),e("div",{class:a.center},[e("div",{class:a.cItem},[e("div",null,[m[c.value.heardLevel]]),e("div",null,[i("难度")])]),e("div",{class:a.cItem},[e("div",null,[c.value.score,i("分")]),e("div",null,[i("评测分数")])]),n.isPercussion?null:e(B,null,[e("div",{onClick:()=>h(),class:[a.cItem,o.value==="intonation"&&a.active]},[e("div",null,[c.value.intonation,i("分")]),e("div",null,[i("音准")])]),e("div",{onClick:()=>h(),class:[a.cItem,o.value==="cadence"&&a.active]},[e("div",{style:{color:"rgb(255, 200, 101)"}},[c.value.cadence,i("分")]),e("div",null,[i("节奏")])]),e("div",{onClick:()=>h(),class:[a.cItem,o.value==="integrity"&&a.active]},[e("div",{style:{color:"rgb(255, 241, 184)"}},[c.value.integrity,i("分")]),e("div",null,[i("完成度")])])])]),e("div",{style:{display:c.value.videoFilePath?"":"none"},class:a.replaybtn,onClick:k},[e(Z,{class:a.iconBtn,name:"replay"},null),e("span",null,[i("查看回放")])]),e(X,{teleport:"body",class:["popup-custom","van-scale",a.popup],transition:"van-scale",show:s.show,"onUpdate:show":u=>s.show=u,closeable:!0,onClose:()=>{var u;(u=s._plrl)==null||u.pause()}},{default:()=>[_.value==="audio"&&e("div",{class:a.audiobox},[e("audio",{id:"audioSrc",src:c.value.videoFilePath,controls:"false",preload:"metadata",playsinline:!0},null)]),_.value==="video"&&e("div",{class:a.videobox},[e("video",{id:"videoSrc",class:a.videoBox,src:c.value.videoFilePath,"data-poster":it,preload:"metadata",playsinline:!0},null)])]})])}}),v=y({name:"NoteSvg",props:{fill:String},render(){return e("svg",{width:"7px",height:"23px",viewBox:"0 0 7 23",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},[e("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e("g",{transform:"translate(-55.000000, -24.000000)"},[e("g",{transform:"translate(55.000000, 24.000000)",fill:this.fill},[e("path",{d:"M1.95251677,0.68258909 C3.68583115,-0.400505943 5.78379192,-0.169765229 6.63844331,1.1979629 C7.4930947,2.56569103 6.78079761,4.55247575 5.04748323,5.63557079 C3.85503595,6.38069455 2.49000663,6.50399819 1.47594704,6.06306368 L1.47635248,22.0768926 L0.0162402201,22.0768926 L0.0154715991,4.11169688 C-0.117424115,2.8976469 0.612367024,1.52000759 1.95251677,0.68258909 Z",id:"形状结合",transform:"translate(3.500000, 11.038446) scale(-1, -1) translate(-3.500000, -11.038446) "},null)])])])])}}),lt={RIGHT:r.right,WRONG:r.wrong,NOT_PLAY:r.notPlay,CADENCE_WRONG:r.cadence_wrong,INTONATION_WRONG:r.intonation_wrong,INTEGRITY_WRONG:r.integrity_wrong},ct=y({name:"music-list",setup(){const l=ne();F();const s=le().params.id,m=C({videoFilePath:"",cadence:0,integrity:0,intonation:0,score:0,heardLevel:""}),o=C({isLoading:!0,paddingLeft:"",headerHide:!1,musicalNotesPlayStats:[],userMeasureScore:{}}),g=async()=>{const t=await ce();if(t!=null&&t.content){const{isSpecialShapedScreen:d,notchHeight:p}=t.content;d&&(o.paddingLeft="25px")}};L(()=>{g(),oe()});const h=t=>{const d=n.partIndex,p=t.data[d];_(p,d),k(),o.isLoading=!1},_=(t,d)=>{if(n.detailId=t.id,n.xmlUrl=t.xmlUrl,n.partIndex=d,n.subjectId=t.subjectId,n.categoriesId=t.categoriesId,n.categoriesName=t.categoriesName,n.enableEvaluation=t.enableEvaluation,n.examSongId=t.examSongId+"",n.examSongName=t.examSongName,t.extConfigJson)try{n.extConfigJson=JSON.parse(t.extConfigJson)}catch(p){console.error("解析扩展字段错误:",p)}n.isOpenMetronome=!t.isOpenMetronome,n.needTick=t.isOpenMetronome,n.isShowFingering=t.isShowFingering,n.music=t.isOpenMetronome?t.mp3Url:t.metronomeMp3Url,n.accompany=t.isOpenMetronome?t.url:t.metronomeUrl,n.midiUrl=t.midiUrl,n.parentCategoriesId=t.parentCategoriesId,n.playMode=t.playMode,n.originSpeed=n.speed=t.speed,n.track=t.track,n.isOpenPrepare=!0,n.subjectId=ue(n.subjectId,"GYM"),n.isPercussion=n.subjectId==23||n.subjectId==113||n.subjectId==121||de(),n.fingeringInfo=pe(n.subjectId),n.isReport=!0},k=()=>{n.extConfigJson.multitrack&&me("multitrack",n.extConfigJson.multitrack)};x(async()=>{var d,p,N,P,E,R,T;window.appName="gym";const t=await Oe(s);n.partIndex=Number((d=t==null?void 0:t.data)==null?void 0:d.partIndex),o.musicalNotesPlayStats=((N=(p=t==null?void 0:t.data)==null?void 0:p.musicalNotesPlayStats)==null?void 0:N.notesData)||[],o.userMeasureScore=((P=t==null?void 0:t.data)==null?void 0:P.userMeasureScore)||{};for(let w in m)m[w]=(E=t==null?void 0:t.data)==null?void 0:E[w];Promise.all([He((T=(R=t==null?void 0:t.data)==null?void 0:R.musicalNotesPlayStats)==null?void 0:T.examSongId)]).then(w=>{h(w[0])})});const f=()=>{for(const t of o.musicalNotesPlayStats){const d=n.times[t.musicalNotesIndex],p=document.getElementById("vf-"+d.id);p==null||p.classList.add(lt[t.musicalErrorType])}},S=()=>{for(let t in o.userMeasureScore)_e(o.userMeasureScore[t],!1)},u=t=>{n.musicRendered=!0,n.osmd=t,n.times=ge(t),console.log("🚀 ~ state.times:",n.times),f(),S(),he()};return x(()=>{window.addEventListener("resize",M)}),ae(()=>{window.removeEventListener("resize",M)}),()=>e("div",{class:[r.shareBox,r.detail,n.setting.eyeProtection&&"eyeProtection",l.android&&r.android],style:{paddingLeft:o.paddingLeft}},[!n.musicRendered&&e("div",{class:r.skeleton},[e(se,{class:r.skeleton,row:8},null)]),e("div",{class:[r.headHeight,o.headerHide&&r.headHide],onClick:t=>t.stopPropagation()},[e(ie,{name:"van-slide-down"},{default:()=>[n.musicRendered&&e(rt,{scoreData:m},null)]})]),e("div",{id:"scrollContainer",class:[r.container,!n.setting.displayCursor&&"hideCursor"]},[e("div",{class:r.demos},[e("div",null,[e(v,{fill:"#01C1B5"},null),e("span",null,[i("演奏正确")])]),e("div",null,[e(v,{fill:"#067DD7"},null),e("span",null,[i("节奏错误")])]),n.isPercussion?null:e(B,null,[e("div",null,[e(v,{fill:"#FFAB25"},null),e("span",null,[i("音准错误")])]),e("div",null,[e(v,{fill:"#CC75FF"},null),e("span",null,[i("完成度不足")])])]),e("div",null,[e(v,{fill:"#000"},null),e("span",null,[i("未演奏")])])]),!o.isLoading&&e(re,{onRendered:u},null)])])}}),ut=[{path:"/detail/:id",component:fe},{path:"/report/:id",component:ct},{path:"/:pathMatch(.*)*",component:we,meta:{title:"404 Not Fund"}}],dt=ve({history:ye(),routes:ut});(function(){var m,o;const l=["mteadev.dayaedu.com","mteatest.dayaedu.com","mteaonline.dayaedu.com"],c=["mandev.dayaedu.com","mantest.dayaedu.com","manonline.dayaedu.com"],s=l.includes(location.hostname)?"/api-teacher":c.includes(location.hostname)?"/api-web":"/api-student";Ie({isApp:!!(window!=null&&window.DAYA||(o=(m=window.webkit)==null?void 0:m.messageHandlers)!=null&&o.DAYA),platformApi:s,platformType:s==="/api-student"?"STUDENT":s==="/api-teacher"?"TEACHER":"WEB",proxy:""})})();be(Se).use(dt).mount("#app");export{pt as __vite_legacy_guard};