import{u as b,r as i,d as C,ah as N,a as P,M as O,a2 as _,H as w,_ as y,ai as k,s as I,f as Y,D as F,c as K}from"./App.03d0734f.js";/* empty css */function A(){import("data:text/javascript,")}(function(l,t){var o=t.documentElement,p=l.devicePixelRatio||1;function s(){t.body?t.body.style.fontSize=12+"px":t.addEventListener("DOMContentLoaded",s)}s();function r(){var d=o.clientWidth/10;o.style.fontSize=d+"px"}if(r(),l.addEventListener("resize",r),l.addEventListener("pageshow",function(d){d.persisted&&r()}),p>=2){var n=t.createElement("body"),e=t.createElement("div");e.style.border=".5px solid transparent",n.appendChild(e),o.appendChild(n),e.offsetHeight===1&&o.classList.add("hairlines"),o.removeChild(n)}})(window,document);const f=b(),X=i();var j=C({name:"Colexiu",setup(){let u=0;const l=i(!0),t=i(!1),o=i(""),p=new _(650,884),s=i({}),r=i(!1),n=i("staff"),e=i({staff:null,first:null,fixed:null});f.pageType==="more"&&(s.value={PageFormat:p,DYMusicScoreType:"staff",RenderKeySignatures:!0}),async function(){try{console.log("\u9700\u8981\u6E32\u67D3\u7684xml search.xml:",f.xml);const c=await N(f.xml,{musicSheetName:f.title||""});if(!c.value){l.value=!1,t.value=!0,console.log("\u6CA1\u6709xml\u9519\u8BEF\u4E86"),window.parent.postMessage({api:"osdmRenderedError"},"*");return}o.value=c.value}catch(c){console.log("\u83B7\u53D6xml\u9519\u8BEF\u4E86",c),window.parent.postMessage({api:"osdmRenderedError"},"*")}}();const d=async c=>{w({api:"cloudLoading",content:{show:!1,type:"fullscreen"}});const S=async a=>{if(a){const v=[];if(a.Drawer.Backends.length>0){for(let g=0,R=a.Drawer.Backends.length;g{r.value=!1},100)):n.value==="first"?(u=2,n.value="fixed",e.value.first=a,s.value.DYMusicScoreType="jianpu",s.value.RenderKeySignatures=!1,await y(),r.value=!0,setTimeout(()=>{r.value=!1},100)):n.value==="fixed"&&(u=3,e.value.fixed=a,console.log(e.value,"staffImgs fixed = last")),u===3&&(console.log(e.value,"staffImgs ------------- postMessage"),window.parent.postMessage({api:"osdmRendered",content:{img:JSON.parse(JSON.stringify(e.value))}},"*"))}catch(a){console.log("\u6E32\u67D3\u9519\u8BEF\u4E86"),console.log(a,"error"),window.parent.postMessage({api:"osdmRenderedError"},"*")}},x=async()=>{},h=()=>{console.log("onRenderError\u9519\u8BEF\u4E86"),w({api:"cloudLoading",content:{show:!1,type:"fullscreen"}}),t.value=!0,l.value=!1,window.parent&&window.parent.postMessage({api:"osdmRenderedError"},"*")};return()=>!r.value&&P(O,{ref:X,score:o.value,isSoundEffect:!0,opotions:{drawTitle:!1,drawComposer:!0,drawLyricist:!1,drawMetronomeMarks:!0,drawMeasureNumbers:!0,autoResize:!1},EngravingRules:s,onStartRender:x,onRenderError:h,onRerender:d},null)}});I.clintNmae="colexiu";window.DYEnvironment="COLEXIU";document.body.style.setProperty("--osdm-zoom",""+Y());F();K(j).mount("#app");export{A as __vite_legacy_guard};