1 |
- System.register(["./instrument-legacy-5f5e2e86.js","./node_modules-legacy-bf1d9d7f.js","./src-legacy-fca58b40.js"],(function(e,i){"use strict";var t,n,a,o,r,d,l,s,u,m,c,p,v,g,_,h,f,x,y,S,M,w=document.createElement("style");return w.textContent="body{overflow:hidden}._skeleton_li4n4_4{position:fixed;left:0;top:0;width:100vw;height:100vh;padding:.53333rem .8rem;background-color:#fff;z-index:1000;--van-skeleton-paragraph-height: .8rem}._detail_li4n4_15{width:100vw;height:auto;overflow:hidden;--header-height: 1.65333rem;background:transparent;position:relative}._detail_li4n4_15 ._mask_li4n4_23{position:absolute;z-index:6;width:100%;height:100%}._detail_li4n4_15 ._container_li4n4_29{margin:0;border-radius:.26667rem}._detail_li4n4_15 #osmdCanvasPage1{position:relative!important}._detail_li4n4_15 #musicAndSelection{height:initial!important;max-height:initial!important}._detail_li4n4_15 .smoothAnimationBox{height:0!important;overflow:hidden}._detail_li4n4_15 #cursorImg-0{margin-top:-20PX!important;opacity:0!important}._whiteBg_li4n4_48{background:#fff}\n",document.head.appendChild(w),{setters:[e=>{t=e.d,n=e.g,a=e.r,o=e.o,r=e.s,d=e.H,l=e.v,s=e.c,u=e.M,m=e.Q,c=e.R,p=e.S,v=e.U,g=e.L,_=e.n,h=e.V,f=e.W,x=e.O,y=e.X,S=e.Y,M=e.Z},null,null],execute:function(){const i="_detail_li4n4_15",w="_mask_li4n4_23",b="_container_li4n4_29",I="_whiteBg_li4n4_48";e("default",t({name:"simple-detail",setup(){const e=n(),t=a({isLoading:!0,currentTime:0,totalTime:0,backgroundRendMode:""}),T=e=>{var i,n,a,o;let d={};try{d="string"==typeof(null==e?void 0:e.data)?JSON.parse(e.data):e.data}catch(h){console.error("parse_error: Invalid JSON data received")}if("api_play"===(null===(i=d)||void 0===i?void 0:i.api)&&(r.playState="play",k()),"api_paused"===(null===(n=d)||void 0===n?void 0:n.api)){var l,s;const e=null===(l=d)||void 0===l||null===(s=l.content)||void 0===s?void 0:s.currentTime;r.playState="paused",0===e&&setTimeout((()=>{t.currentTime=0,r.activeNoteIndex=0,r.activeMeasureIndex=r.times[0].MeasureNumberXML,N(!0)}),200)}var u,p,v;if("api_updateProgress"===(null===(a=d)||void 0===a?void 0:a.api)&&(r.playState,"paused"===r.playState&&(t.currentTime=null!==(u=null===(p=d)||void 0===p||null===(v=p.content)||void 0===v?void 0:v.currentTime)&&void 0!==u?u:t.currentTime,r.activeNoteIndex=0,r.activeMeasureIndex=r.times[0].MeasureNumberXML,N(!0))),"api_playProgress"===(null===(o=d)||void 0===o?void 0:o.api)){var g,_;const e=null===(g=d)||void 0===g||null===(_=g.content)||void 0===_?void 0:_.currentTime;if(e){if(e<t.currentTime){r.activeNoteIndex=0;let i=m(e)||r.times[0];i.i===r.activeNoteIndex&&(r.activeMeasureIndex=i.MeasureNumberXML),e<=r.times[0].fixtime&&c(!0)}t.currentTime=e}}};o((async()=>{const i=e.id||"";t.backgroundRendMode=e.backgroundRendMode,r.isSimplePage=!0,r.partIndex=e["part-index"]?Number(e["part-index"]):0,await d(i,"open"),t.isLoading=!1,r.isSingleLine=!0,window.addEventListener("message",T)})),l((()=>{r.isSimplePage=!1,window.removeEventListener("message",T)}));const L=async e=>{var i;const t=null===(i=document.getElementById("scrollContainer"))||void 0===i?void 0:i.getBoundingClientRect().height;r.osmd=e,0===r.originSpeed&&(r.originSpeed=r.speed=e.bpm||e.Sheet.userStartTempoInBPM||100);const n=(p.get("speeds")||{})[r.examSongId]||r.speed||e.bpm||e.Sheet.userStartTempoInBPM;n&&v(n),r.times=g(e),r.times,_((()=>{r.activeMeasureIndex=r.times[0].MeasureNumberXML})),h(r.times),f(),x(),window.parent.postMessage({api:"api_musicPage",height:t},"*"),y({height:t})},N=e=>{const i=t.currentTime;let n=m(i)||r.times[0];n&&S(n,e),r.activeNoteIndex=(null==n?void 0:n.i)||0,r.isSingleLine&&M(i,!0)},k=()=>{if("play"!==r.playState)return;let e=Date.now();requestAnimationFrame((()=>{Date.now()-e<16.7?(N(),k()):setTimeout((()=>{N(),k()}),16.7)}))};return()=>s("div",{class:[i,"video"===t.backgroundRendMode&&I]},[s("div",{class:w},null),s("div",{id:"scrollContainer",class:[b]},[!t.isLoading&&s(u,{onRendered:L,musicColor:"#000000"},null)])])}}))}}}));
|