deciphony-renderer 0.0.26 → 0.0.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- img[data-v-9f0fceab]{display:block}.measure[data-v-9f0fceab]{pointer-events:all}.singleStaff[data-v-684eebdd]{display:grid;grid-template-rows:1fr}.measureSlot[data-v-684eebdd]{display:grid;position:relative}.timeSignature[data-v-74f3a255]{width:100%;height:100%;display:flex;justify-content:space-evenly;align-items:center;flex-direction:column;font-weight:700}.timeSignature>div[data-v-74f3a255]{pointer-events:none}.keySignature[data-v-8485dd0d]{position:relative}.symbol[data-v-8485dd0d]{object-fit:contain}.msSymbol[data-v-f2b994c1]{pointer-events:all}.msSymbolSlot[data-v-ad68dc2d]{display:flex;position:absolute}.msSymbolContainer[data-v-8d8f6d46]{overflow:visible;position:absolute}.volta[data-v-511c3804]{pointer-events:auto;-webkit-user-select:none;user-select:none}.slur[data-v-784581bb]{width:100%;height:100%;pointer-events:auto;-webkit-user-select:none;user-select:none}.slur[data-v-784581bb]>*{pointer-events:none}.slur-svg[data-v-784581bb]{width:100%;height:100%}.slur-path[data-v-784581bb]{fill:#000;stroke:none}svg[data-v-1b2a89b1]{-webkit-user-select:none;user-select:none}svg[data-v-edd33ee1]{-webkit-user-select:none;user-select:none}.vitrualSymbolContainer[data-v-9c8f213c]{position:absolute;pointer-events:all;opacity:0;overflow:hidden}.vitrualSymbolContainer[data-v-9c8f213c]:hover{opacity:1}.test[data-v-9c8f213c]{height:50px;width:10px;background-color:#111}.lineLayer[data-v-88d0eee2],.symbolLayer[data-v-88d0eee2]{align-items:start}
1
+ img[data-v-9f0fceab]{display:block}.measure[data-v-9f0fceab]{pointer-events:all}.singleStaff[data-v-684eebdd]{display:grid;grid-template-rows:1fr}.measureSlot[data-v-684eebdd]{display:grid;position:relative}.timeSignature[data-v-74f3a255]{width:100%;height:100%;display:flex;justify-content:space-evenly;align-items:center;flex-direction:column;font-weight:700}.timeSignature>div[data-v-74f3a255]{pointer-events:none}.keySignature[data-v-8485dd0d]{position:relative}.symbol[data-v-8485dd0d]{object-fit:contain}.msSymbol[data-v-f2b994c1]{pointer-events:all}.msSymbolSlot[data-v-a3db67c4]{display:flex;position:absolute}.msSymbolContainer[data-v-0581bfa9]{overflow:visible;position:absolute}.volta[data-v-511c3804]{pointer-events:auto;-webkit-user-select:none;user-select:none}.slur[data-v-784581bb]{width:100%;height:100%;pointer-events:auto;-webkit-user-select:none;user-select:none}.slur[data-v-784581bb]>*{pointer-events:none}.slur-svg[data-v-784581bb]{width:100%;height:100%}.slur-path[data-v-784581bb]{fill:#000;stroke:none}svg[data-v-1b2a89b1]{-webkit-user-select:none;user-select:none}svg[data-v-edd33ee1]{-webkit-user-select:none;user-select:none}.vitrualSymbolContainer[data-v-9c8f213c]{position:absolute;pointer-events:all;opacity:0;overflow:hidden}.vitrualSymbolContainer[data-v-9c8f213c]:hover{opacity:1}.test[data-v-9c8f213c]{height:50px;width:10px;background-color:#111}.lineLayer[data-v-88d0eee2],.symbolLayer[data-v-88d0eee2]{align-items:start}
package/dist/index.cjs.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("vue");var ke=(e=>(e[e.Treble=1]="Treble",e[e.MezzoSoprano=2]="MezzoSoprano",e[e.Alto=3]="Alto",e[e.Tenor=4]="Tenor",e[e.BaritoneF=5]="BaritoneF",e[e.BaritoneC=6]="BaritoneC",e[e.Bass=7]="Bass",e[e.Subbass=8]="Subbass",e))(ke||{}),Pe=(e=>(e[e.standardStaff=1]="standardStaff",e[e.numberNotation=2]="numberNotation",e[e.rhythmNotation=3]="rhythmNotation",e[e.percussion=4]="percussion",e))(Pe||{});const Rt=["src"],Tt=r.defineComponent({__name:"measure",props:{measure:{type:Object,required:!0},x:{type:Number,default:0},y:{type:Number,default:0},width:{type:Number,default:400},height:{type:Number,default:80},componentWidth:{type:Number,default:1e3},componentHeight:{type:Number,default:800},strokeWidth:{type:Number,default:1},musicScore:{type:Object,default:{}}},emits:["measureMouseDown"],setup(e,{emit:t}){const n=e,{svgSkin:o,isOriginSkin:i}=r.inject("skin"),a=r.computed(()=>({width:"100%",display:"grid","grid-template-rows":"1fr","grid-template-columns":"1fr"})),l=r.computed(()=>{var d,h;switch(n.musicScore.showMode){case Pe.standardStaff:return(d=n.measure)!=null&&d.options.highlight?o.value.active_bar_standardStaff.url:o.value.bar_standardStaff.url;case Pe.numberNotation:return(h=n.measure)!=null&&h.options.highlight?o.value.active_bar_numberNotation.url:o.value.bar_numberNotation.url}return""}),c=r.computed(()=>{var h,u,f;return console.log("chicken"),{width:n.width+"px",height:n.height+"px","background-color":(h=n.measure)!=null&&h.options.highlight?(u=n.measure)==null?void 0:u.options.highlightColor:(f=n.measure)==null?void 0:f.options.color,mask:`url("${l.value}") no-repeat center`,"mask-size":"100% 100%",pointerEvents:"none"}}),s=t;function m(d){s("measureMouseDown",d,n.measure)}return(d,h)=>(r.openBlock(),r.createElementBlock("div",{style:r.normalizeStyle(a.value),class:"measure",onMousedown:r.withModifiers(m,["self"])},[r.unref(i)?(r.openBlock(),r.createElementBlock("div",{key:0,style:r.normalizeStyle(c.value)},null,4)):(r.openBlock(),r.createElementBlock("img",{key:1,src:l.value,style:r.normalizeStyle(c.value)},null,12,Rt))],36))}}),G=(e,t)=>{const n=e.__vccOpts||e;for(const[o,i]of t)n[o]=i;return n},jt=G(Tt,[["__scopeId","data-v-9f0fceab"]]);var O;(function(e){e[e.MultipStaves=1]="MultipStaves",e[e.SingleStaff=2]="SingleStaff",e[e.Measure=3]="Measure",e[e.SpanSymbol=4]="SpanSymbol",e[e.MsSymbolContainer=5]="MsSymbolContainer",e[e.MsSymbol=6]="MsSymbol"})(O||(O={}));var T;(function(e){e.Line="line",e.Space="space"})(T||(T={}));var M;(function(e){e.Lower="lower",e.Main="main",e.Upper="upper"})(M||(M={}));var S;(function(e){e[e.Treble=1]="Treble",e[e.MezzoSoprano=2]="MezzoSoprano",e[e.Alto=3]="Alto",e[e.Tenor=4]="Tenor",e[e.BaritoneF=5]="BaritoneF",e[e.BaritoneC=6]="BaritoneC",e[e.Bass=7]="Bass",e[e.Subbass=8]="Subbass"})(S||(S={}));var w;(function(e){e.Cb="Cb",e.Gb="Gb",e.Db="Db",e.Ab="Ab",e.Eb="Eb",e.Bb="Bb",e.F="F",e.C="C",e.G="G",e.D="D",e.A="A",e.E="E",e.B="B",e["F#"]="F#",e["C#"]="C#"})(w||(w={}));var L;(function(e){e[e.DO=1]="DO",e[e.RE=2]="RE",e[e.MI=3]="MI",e[e.FA=4]="FA",e[e.SOL=5]="SOL",e[e.LA=6]="LA",e[e.TI=7]="TI"})(L||(L={}));var z;(function(e){e.C="C",e.D="D",e.E="E",e.F="F",e.G="G",e.A="A",e.B="B"})(z||(z={}));var p;(function(e){e.None="",e.Natural="&",e.Sharp="#",e.Flat="b",e.DoubleSharp="##",e.DoubleFlat="bb"})(p||(p={}));var it;(function(e){e.None="",e.Single=".",e.Double="..",e.Triple="..."})(it||(it={}));var v;(function(e){e[e.whole=1]="whole",e[e.half=2]="half",e[e.quarter=4]="quarter",e[e.eighth=8]="eighth",e[e.sixteenth=16]="sixteenth",e[e.thirtySecond=32]="thirtySecond",e[e.sixtyFourth=64]="sixtyFourth",e[e.oneTwentyEighth=128]="oneTwentyEighth",e[e.twoFiftySixth=256]="twoFiftySixth"})(v||(v={}));var g;(function(e){e.NoteHead="noteHead",e.NoteStem="noteStem",e.NoteTail="noteTail",e.NoteNumber="noteNumber",e.ChronaxieReducingLine="chronaxieReducingLine",e.ChronaxieIncreasingLine="chronaxieIncreasingLine",e.NoteDot="noteDot",e.Rest="rest",e.Slur="slur",e.Tie="tie",e.DurationDot="durationDot",e.Accidental="accidental",e.Tuplet="tuplet",e.Clef="clef",e.Clef_f="clef_f",e.KeySignature="keySignature",e.TimeSignature="timeSignature",e.BarLine="barLine",e.BarLine_f="barLine_f"})(g||(g={}));var U;(function(e){e[e.standardStaff=1]="standardStaff",e[e.numberNotation=2]="numberNotation",e[e.rhythmNotation=3]="rhythmNotation",e[e.percussion=4]="percussion"})(U||(U={}));var P;(function(e){e[e.singleMeasure=1]="singleMeasure",e[e.multipleMeasure=2]="multipleMeasure"})(P||(P={}));var me;(function(e){e[e.volta=1]="volta",e[e.slur=2]="slur",e[e.tie=3]="tie"})(me||(me={}));var at;(function(e){e[e.msSymbol=1]="msSymbol",e[e.measure=2]="measure",e[e.singleStaff=3]="singleStaff",e[e.multipleStaves=4]="multipleStaves"})(at||(at={}));var R;(function(e){e[e.frontFixed=1]="frontFixed",e[e.rearFixed=2]="rearFixed",e[e.variable=3]="variable",e[e.span=4]="span"})(R||(R={}));var N;(function(e){e[e.single=1]="single",e[e.final=2]="final",e[e.reverseFinal=3]="reverseFinal",e[e.startRepeatSign=4]="startRepeatSign",e[e.endRepeatSign=5]="endRepeatSign"})(N||(N={}));var lt;(function(e){e[e.highlight=1]="highlight"})(lt||(lt={}));var Y;(function(e){e[e.normal=1]="normal",e[e.edit=2]="edit"})(Y||(Y={}));var te;(function(e){e[e.note=1]="note",e[e.rest=2]="rest"})(te||(te={}));var ze;(function(e){e[e.left=1]="left"})(ze||(ze={}));function Pt(e){return e>=v.eighth}function zt(e){return e!==v.whole}function ut(e,t){let n=p.None;if(!e.msSymbolArray)return{accidental:n,measureAccidental:p.None};const o=j(e.index,t),i=o.msSymbolContainer,a=o.measure,l=o.singleStaff,c=a==null?void 0:a.index.measureIndex,s=i==null?void 0:i.index.msSymbolContainerIndex;if(!i||!a||!l||s==null||c==null)return console.error("索引数据查找出错,获取符号的谱号失败"),{accidental:n,measureAccidental:p.None};let m=p.None;for(let d=c;d>=0;d--){const h=l.measureArray[d];if(d===c)for(let u=s;u>=0;u--){const y=h.msSymbolContainerArray[u].msSymbolArray[0];if(g.Accidental===y.type){m=y.accidental;break}}else for(let u=h.msSymbolContainerArray.length-1;u>=0;u--){const y=h.msSymbolContainerArray[u].msSymbolArray[0];if(g.Accidental===y.type){m=y.accidental;break}}}for(let d of e.msSymbolArray)if(d.type===g.Accidental)return n=d.accidental,{accidental:n,measureAccidental:m};return{accidental:n,measureAccidental:m}}function dt(e,t){const n=j(e.index,t),o=n.msSymbolContainer,i=n.measure,a=n.singleStaff,l=i==null?void 0:i.index.measureIndex,c=o==null?void 0:o.index.msSymbolContainerIndex;if(!o||!i||!a||c==null||l==null)return console.error("索引数据查找出错,获取符号的谱号失败"),w.C;for(let s=l;s>=0;s--){const m=a.measureArray[s];if(s===l)for(let d=c;d>=0;d--){const u=m.msSymbolContainerArray[d].msSymbolArray[0];if(g.KeySignature===u.type)return u.keySignature}else for(let d=m.msSymbolContainerArray.length-1;d>=0;d--){const u=m.msSymbolContainerArray[d].msSymbolArray[0];if(g.KeySignature===u.type)return u.keySignature}}return w.C}function Qe(e,t){const n=j(e.index,t),o=n.msSymbolContainer,i=n.measure,a=n.singleStaff,l=i==null?void 0:i.index.measureIndex,c=o==null?void 0:o.index.msSymbolContainerIndex;if(!o||!i||!a||c==null||l==null)return console.error("索引数据查找出错,获取符号的谱号失败"),S.Treble;for(let s=l;s>=0;s--){const m=a.measureArray[s];if(s===l)for(let d=c;d>=0;d--){const u=m.msSymbolContainerArray[d].msSymbolArray[0];if(g.Clef===u.type||g.Clef_f===u.type)return u.clef}else for(let d=m.msSymbolContainerArray.length-1;d>=0;d--){const u=m.msSymbolContainerArray[d].msSymbolArray[0];if(g.Clef===u.type||g.Clef_f===u.type)return u.clef}}return S.Treble}function Wt(e,{level:t="symbol",order:n="asc",callback:o}){const i=l=>n==="asc"?[...Array(l).keys()]:[...Array(l).keys()].reverse(),a=e.multipleStavesArray;for(const l of i(a.length)){const c=a[l];if(t==="multipleStaves"){if(o({multipleStavesIndex:l,singleStaffIndex:-1,measureIndex:-1,multipleStaves:c}))return;continue}for(const s of i(c.singleStaffArray.length)){const m=c.singleStaffArray[s];if(t==="singleStaff"){if(o({multipleStavesIndex:l,singleStaffIndex:s,measureIndex:-1,multipleStaves:c,singleStaff:m}))return;continue}for(const d of i(m.measureArray.length)){const h=m.measureArray[d];if(t==="measure"){if(o({multipleStavesIndex:l,singleStaffIndex:s,measureIndex:d,multipleStaves:c,singleStaff:m,measure:h}))return;continue}for(const u of i(h.msSymbolContainerArray.length)){const f=h.msSymbolContainerArray[u];if(t==="container"){if(o({multipleStavesIndex:l,singleStaffIndex:s,measureIndex:d,msSymbolContainerIndex:u,multipleStaves:c,singleStaff:m,measure:h,msSymbolContainer:f}))return;continue}for(const y of i(f.msSymbolArray.length)){const b=f.msSymbolArray[y];if(o({multipleStavesIndex:l,singleStaffIndex:s,measureIndex:d,msSymbolContainerIndex:u,msSymbolIndex:y,multipleStaves:c,singleStaff:m,measure:h,msSymbolContainer:f,msSymbol:b}))return}}}}}}function Ft(e,t,n,o){if(t.multipleStavesIndex==null||e.multipleStavesIndex==null||e.measureIndex==null||t.measureIndex==null||e.singleStaffIndex==null)return console.error("索引元素有误,无法正确执行traverseMeasure");const i=e.singleStaffIndex,a=j(e,n),l=j(t,n),c=a.singleStaff;l.singleStaff;const s=a.multipleStaves,m=l.multipleStaves;if(s===m){if(c==null||s==null)return console.error("索引元素有误,无法正确执行traverseMeasure");for(let d=e.measureIndex;d<=t.measureIndex;d++){const h=c.measureArray[d];o(h,c,s)}}else for(let d=e.multipleStavesIndex;d<=t.multipleStavesIndex;d++){const h=n.multipleStavesArray[d],u=h.singleStaffArray[i];if(s===h)for(let f=e.measureIndex;f<u.measureArray.length;f++){const y=u.measureArray[f];o(y,u,h)}else if(s!==h&&m!==h)for(let f=0;f<u.measureArray.length;f++){const y=u.measureArray[f];o(y,u,h)}else if(m===h&&s!==m)for(let f=0;f<t.measureIndex;f++){const y=u.measureArray[f];o(y,u,h)}}}function Vt(e){e.multipleStavesArray.forEach((t,n)=>{t.index={multipleStavesIndex:n,singleStaffIndex:-1,measureIndex:-1,msSymbolContainerIndex:-1,msSymbolIndex:-1},Zt(t)})}function Zt(e){const t=e.index.multipleStavesIndex;if(t==null)return console.error("数据有误,复谱表索引生成失败");e.singleStaffArray.forEach((n,o)=>{n.index={multipleStavesIndex:t,singleStaffIndex:o,measureIndex:-1,msSymbolContainerIndex:-1,msSymbolIndex:-1},mt(n)})}function mt(e){const t=e.index.singleStaffIndex,n=e.index.multipleStavesIndex;if(n==null||t==null)return console.error("数据有误,单谱表索引生成失败");e.measureArray.forEach((o,i)=>{o.index={multipleStavesIndex:n,singleStaffIndex:t,measureIndex:i,msSymbolContainerIndex:-1,msSymbolIndex:-1},Le(o)})}function Le(e){const t=e.index.singleStaffIndex,n=e.index.multipleStavesIndex,o=e.index.measureIndex;if(n==null||t==null||o==null)return console.error("数据有误,符号容器索引生成失败");e.msSymbolContainerArray.forEach((i,a)=>{i.index={multipleStavesIndex:n,singleStaffIndex:t,measureIndex:o,msSymbolContainerIndex:a,msSymbolIndex:-1},We(i)})}function We(e){const t=e.index.singleStaffIndex,n=e.index.multipleStavesIndex,o=e.index.measureIndex,i=e.index.msSymbolContainerIndex;if(n==null||t==null||o==null||i==null)return console.error("数据有误,符号索引生成失败");e.msSymbolArray.forEach((a,l)=>{const c={multipleStavesIndex:n,singleStaffIndex:t,measureIndex:o,msSymbolContainerIndex:i,msSymbolIndex:l};a.index=c,qe(a)})}function qe(e,t){let n=null;n=e,n.msSymbolArray.forEach((o,i)=>{o.index=n.index,o.msSymbolArray.length>0&&qe(o)})}function Ot(e){const t=e.map;for(let n=0;n<e.multipleStavesArray.length;n++){const o=e.multipleStavesArray[n];t[o.id]=o;for(let i=0;i<o.singleStaffArray.length;i++){const a=o.singleStaffArray[i];t[a.id]=a;for(let l=0;l<a.measureArray.length;l++){const c=a.measureArray[l];t[c.id]=c;for(let s=0;s<c.msSymbolContainerArray.length;s++){const m=c.msSymbolContainerArray[s];t[m.id]=m;for(let d=0;d<m.msSymbolArray.length;d++){const h=m.msSymbolArray[d];t[h.id]=h}}}}}}function Q(e){if(e.region===M.Main)return(e.index-1)*2+(e.type===T.Space?1:0);if(e.region===M.Lower)return-(e.index*2)+(e.type===T.Space?1:0);if(e.region===M.Upper)return 8+e.index*2+(e.type===T.Space?1:0);throw new Error("Invalid StaffRegion")}function Fe(e){if(e>=0&&e<=9){const t=e%2===0?T.Line:T.Space,n=Math.floor(e/2)+1,o=Math.floor(e/2)+1;return{region:M.Main,type:t,index:t===T.Line?n:o}}if(e<0){const t=Math.abs(e),n=t%2===0?T.Line:T.Space,o=Math.floor((t+1)/2);return{region:M.Lower,type:n,index:o}}if(e>=10){const t=e-10,n=t%2===0?T.Line:T.Space,o=Math.floor(t/2)+1;return{region:M.Upper,type:n,index:o}}throw new Error("Invalid index for StaffRegion")}function st(e){return typeof e=="number"?e<=3?"up":"down":Q(e)<=3?"up":"down"}function Ae(e,t){const n=t[e];if(n)return n;console.warn("此id元素不存在")}function j(e,t){const n={multipleStaves:null,singleStaff:null,measure:null,msSymbolContainer:null,msSymbol:null};if(e.multipleStavesIndex!==-1){const o=t.multipleStavesArray[e.multipleStavesIndex];if(n.multipleStaves=o,e.singleStaffIndex!==-1){const i=o.singleStaffArray[e.singleStaffIndex];if(n.singleStaff=i,e.measureIndex!==-1){const a=i.measureArray[e.measureIndex];if(n.measure=a,e.msSymbolContainerIndex!==-1){const l=a.msSymbolContainerArray[e.msSymbolContainerIndex];n.msSymbolContainer=l,e.msSymbolIndex!==-1&&(n.msSymbol=l.msSymbolArray[e.msSymbolIndex])}}}}return n}function Qt(e,t){const n=new Set;return e.bindingEndId.forEach(o=>{n.add(o)}),e.bindingStartId.forEach(o=>{n.add(o)}),e.msSymbolContainerArray.forEach((o,i)=>{o.msSymbolArray.forEach((a,l)=>{a.bindingEndId.forEach(c=>{n.add(c)}),a.bindingStartId.forEach(c=>{n.add(c)})})}),n}function Ue(e,t){let n=new Set;return e.measureArray.forEach(o=>{const i=Qt(o);n=new Set([...n,...i])}),n}function Ge(e,t){t.spanSymbolArray.forEach(n=>{e.has(n.id)&&(n.vueKey=Date.now())})}function xe(e,t){const n=j(e.index,t).msSymbol;return n||(console.error("获取主符号失败"),e)}function we(e,t){const n=[];return e===-1?[]:(t.msSymbolContainerArray.forEach(o=>{o.msSymbolArray.forEach(i=>{if(i.type===g.NoteHead&&i.beamId===e){const a={beamId:i.beamId,note:i,region:i.region,chronaxie:i.chronaxie};n.push(a)}})}),n)}function gt(e,t){e.id=t.id,e.bindingEndId=t.bindingEndId,e.bindingStartId=t.bindingStartId}function qt(e,t,n,o){if(!e||!t||!n)return;const i=e.index,a=t.index;Ut(i,a)>0;const l=n.multipleStavesArray,c=Math.min(i.multipleStavesIndex,a.multipleStavesIndex),s=Math.max(i.multipleStavesIndex,a.multipleStavesIndex);for(let m=c;m<=s;m++){const h=l[m].singleStaffArray,u=m===i.multipleStavesIndex?i.singleStaffIndex:0,f=m===a.multipleStavesIndex?a.singleStaffIndex:h.length-1;for(let y=u;y<=f;y++){const I=h[y].measureArray,A=m===i.multipleStavesIndex&&y===i.singleStaffIndex?i.measureIndex:0,x=m===a.multipleStavesIndex&&y===a.singleStaffIndex?a.measureIndex:I.length-1;for(let k=A;k<=x;k++){const _=I[k].msSymbolContainerArray,W=m===i.multipleStavesIndex&&y===i.singleStaffIndex&&k===i.measureIndex?i.msSymbolContainerIndex:0,V=m===a.multipleStavesIndex&&y===a.singleStaffIndex&&k===a.measureIndex?a.msSymbolContainerIndex:_.length-1;for(let q=W;q<=V;q++){const oe=_[q];o(oe)}}}}}function Ut(e,t){return e.multipleStavesIndex!==t.multipleStavesIndex?e.multipleStavesIndex-t.multipleStavesIndex:e.singleStaffIndex!==t.singleStaffIndex?e.singleStaffIndex-t.singleStaffIndex:e.measureIndex!==t.measureIndex?e.measureIndex-t.measureIndex:e.msSymbolContainerIndex-t.msSymbolContainerIndex}function F(e={}){const t={id:Math.random()*Date.now()+1,msTypeName:O.MsSymbol,index:{multipleStavesIndex:-1,singleStaffIndex:-1,measureIndex:-1,msSymbolContainerIndex:-1,msSymbolIndex:-1},options:{highlight:!1,highlightColor:"red",color:"black"},bindingStartId:[],bindingEndId:[],msSymbolArray:[],vueKey:Math.random()*Date.now()};switch(e.type){case g.NoteHead:{const n=e.region||{region:M.Main,type:T.Line,index:1};if(!e.chronaxie||![v.whole].includes(e.chronaxie)){const o=F({type:g.NoteStem,direction:st(Q(n))});t.msSymbolArray.push(o)}if(e.chronaxie&&![v.whole,v.half,v.quarter].includes(e.chronaxie)){const o=F({type:g.NoteTail,chronaxie:e.chronaxie||v.quarter,direction:st(n)});t.msSymbolArray.push(o)}return{...t,beamId:-1,type:g.NoteHead,region:n,chronaxie:e.chronaxie||v.quarter}}case g.NoteDot:return{...t,type:g.NoteDot,octave:e.octave??4};case g.NoteNumber:{e.chronaxie&&[v.whole,v.half].includes(e.chronaxie)&&(console.error("noteNumber的时值最大为四分音符"),e.chronaxie=v.quarter);const n={...t,type:g.NoteNumber,solmization:e.solmization||L.DO,chronaxie:e.chronaxie||v.quarter,octave:e.octave??4,beamId:-1};if(e.chronaxie&&![v.quarter].includes(e.chronaxie)){const o=F({type:g.ChronaxieReducingLine,chronaxie:e.chronaxie});t.msSymbolArray.push(o)}return n}case g.ChronaxieIncreasingLine:return{...t,type:g.ChronaxieIncreasingLine};case g.ChronaxieReducingLine:return{...t,type:g.ChronaxieReducingLine,chronaxie:e.chronaxie??v.eighth};case g.Rest:return{...t,type:g.Rest,chronaxie:e.chronaxie||v.quarter};case g.BarLine:{const n=e.barLineType??N.single;return N.endRepeatSign===n||N.startRepeatSign===n?{...t,type:g.BarLine,barLineType:n,loopCount:2}:{...t,type:g.BarLine,barLineType:n}}case g.BarLine_f:{const n=e.barLineType??N.single;return N.endRepeatSign===n||N.startRepeatSign===n?{...t,type:g.BarLine_f,barLineType:n,loopCount:2}:{...t,type:g.BarLine_f,barLineType:n}}case g.NoteStem:return{...t,direction:e.direction||"up",type:g.NoteStem};case g.NoteTail:return{...t,type:g.NoteTail,chronaxie:e.chronaxie||v.quarter,beamType:ze.left,direction:e.direction||"up"};case g.Clef_f:return{...t,type:g.Clef_f,clef:e.clef||S.Treble};case g.Clef:return{...t,type:g.Clef,clef:e.clef||S.Treble};case g.KeySignature:return{...t,type:g.KeySignature,keySignature:e.keySignature||w.C};case g.TimeSignature:return{...t,type:g.TimeSignature,timeSignature:e.timeSignature||{beat:1,chronaxie:4}};case g.Accidental:return{...t,type:g.Accidental,accidental:e.accidental||p.Sharp};default:return console.error("type不被识别,符号模版返回noteHead"),{...t,type:g.NoteHead,region:e.region||{region:M.Main,type:T.Line,index:1},chronaxie:e.chronaxie||v.quarter,beamId:-1}}}function _e(e={}){return{id:Math.random()*Date.now()+2,msSymbolArray:[],type:e.type||R.variable,index:{multipleStavesIndex:-1,singleStaffIndex:-1,measureIndex:-1,msSymbolContainerIndex:-1,msSymbolIndex:-1},bindingStartId:[],bindingEndId:[],options:{highlight:!1,highlightColor:"red",color:"transparent"},vueKey:Math.random()*Date.now(),msTypeName:O.MsSymbolContainer}}function $e(e,t){t.map[e.id]=e}function Ke(e,t){t.map[e]&&delete t.map[e]}function ge(e,t,n){t.msSymbolArray.push(e),qe(t),$e(e,n)}function he(e,t,n,o="after"){if(t.msTypeName===O.MsSymbol){if(typeof o=="number"){console.error("以符号为定位元素添加符号时,position只可以传after或before");return}const l=j(t.index,n).msSymbolContainer,c=j(t.index,n).msSymbol;if(!l)return console.error("符号容器不存在,符号添加失败");if(!c)return console.error("符号不存在,符号添加失败");const s=l.msSymbolArray,m=s.findIndex(d=>d===c);o==="before"?s.splice(m,0,e):s.splice(m+1,0,e),We(l)}else if(t.msTypeName===O.MsSymbolContainer){const l=t;if(!l)return console.error("小节不存在,符号容器添加失败");const c=l.msSymbolArray;if(o===-1||typeof o=="string")c.push(e);else if(o>=0&&o<=c.length)c.splice(o,0,e);else{console.error("索引有误,符号添加失败");return}We(l)}if($e(e,n),!("index"in t))return console.error("当前选中对象缺少index,符号添加失败");const i=j(t.index,n).singleStaff;if(!i)return console.error("单谱表查找出错,符号添加失败");mt(i);const a=Ue(i);Ge(a,n)}function ie(e,t,n,o="after"){if(t.msTypeName===O.MsSymbolContainer){if(typeof o=="number"){console.error("以符号容器为定位元素添加符号容器时,position只可以传after或before");return}const i=j(t.index,n).measure,a=j(t.index,n).msSymbolContainer;if(!i)return console.error("小节不存在,符号容器添加失败");if(!a)return console.error("符号容器不存在,符号容器添加失败");const l=i.msSymbolContainerArray,c=l.findIndex(s=>s===a);o==="before"?l.splice(c,0,e):l.splice(c+1,0,e),Le(i)}else if(t.msTypeName===O.Measure){const i=t;if(!i)return console.error("小节不存在,符号容器添加失败");const a=i.msSymbolContainerArray;if(o===-1||typeof o=="string")a.push(e);else if(o>=0&&o<=a.length)a.splice(o,0,e);else{console.error("索引有误,符号容器添加失败");return}Le(i)}$e(e,n)}function Gt(e,t){const n=j(e.index,t),o=n.measure,i=n.singleStaff;if(!o||!i)return console.error("索引数据出错,符号容器移除失败");const a=o.msSymbolContainerArray,l=a.findIndex(s=>s===e);if(l===-1)return console.error("找不到目标符号容器");a.splice(l,1),Ke(e.id,t),Le(o),Kt(e,t);const c=Ue(i);Ge(c,t)}function $t(e,t){for(let n=t.spanSymbolArray.length-1;n>=0;n--){const o=t.spanSymbolArray[n];(e.bindingStartId.includes(o.id)||e.bindingEndId.includes(o.id))&&(ht(o,t),Ke(o.id,t))}}function Kt(e,t){e.msSymbolArray.forEach(n=>{$t(n,t)});for(let n=t.spanSymbolArray.length-1;n>=0;n--){const o=t.spanSymbolArray[n];(e.bindingStartId.includes(o.id)||e.bindingEndId.includes(o.id))&&(ht(o,t),Ke(o.id,t))}}function ht(e,t){const n=t.spanSymbolArray.indexOf(e),o=e.startTargetId,i=e.endTargetId;t.spanSymbolArray.splice(n,1);const a=e.id,l=t.map[o];l&&"bindingStartId"in l&&l.bindingStartId.indexOf(a)!==-1&&l.bindingStartId.splice(n,1);const c=t.map[i];c&&"bindingEndId"in c&&c.bindingEndId.indexOf(a)!==-1&&c.bindingEndId.splice(n,1)}function Ve(e,t){t.direction=e,t.vueKey=Math.random()*Date.now()}function Ze(e,t){t.direction=e,t.vueKey=Math.random()*Date.now()}function Xt(e,t,n){const o=[];let i="up",a=4,l=!1;for(const c in t.msSymbolContainerArray){const s=t.msSymbolContainerArray[c];for(const m in s.msSymbolArray){const d=s.msSymbolArray[m];if(d.type===g.NoteHead&&![v.whole,v.half,v.quarter].includes(d.chronaxie)){const h=Math.abs(Q(d.region)-4),u=Math.abs(a-4);h>u&&(a=Q(d.region));const f=d.msSymbolArray.find(b=>b.type===g.NoteStem),y=d.msSymbolArray.find(b=>b.type===g.NoteTail);y&&f&&d.beamId===e&&(o.push({noteStem:f,noteTail:y}),l=!0)}else if(l)break}}i=a>=3?"down":"up";for(const c in o){const s=o[c].noteStem,m=o[c].noteTail;Ve(i,s),Ze(i,m)}}z.C,p.None,z.C,p.Sharp,z.D,p.None,z.D,p.Sharp,z.E,p.None,z.F,p.None,z.F,p.Sharp,z.G,p.None,z.G,p.Sharp,z.A,p.None,z.A,p.Sharp,z.B,p.None;const Jt={[w.Cb]:59,[w.Gb]:66,[w.Db]:61,[w.Ab]:68,[w.Eb]:63,[w.Bb]:70,[w.F]:65,[w.C]:60,[w.G]:67,[w.D]:62,[w.A]:69,[w.E]:64,[w.B]:71,"F#":66,"C#":61};function Et(e,t,n,o){const i=Jt[n];let l={[L.DO]:0,[L.RE]:2,[L.MI]:4,[L.FA]:5,[L.SOL]:7,[L.LA]:9,[L.TI]:11}[e];switch(t){case p.Sharp:l+=1;break;case p.Flat:l-=1;break;case p.DoubleSharp:l+=2;break;case p.DoubleFlat:l-=2;break;case p.None:break}return i+(o-4)*12+l}p.Natural,p.Sharp,p.Flat;p.Natural,p.Flat,p.Sharp;function Yt(e,t,n=p.Sharp){const o=["C","D","E","F","G","A","B"],i={0:["C",p.None],1:["C",p.Sharp],2:["D",p.None],3:["D",p.Sharp],4:["E",p.None],5:["F",p.None],6:["F",p.Sharp],7:["G",p.None],8:["G",p.Sharp],9:["A",p.None],10:["A",p.Sharp],11:["B",p.None]},a={0:["C",p.None],1:["D",p.Flat],2:["D",p.None],3:["E",p.Flat],4:["E",p.None],5:["F",p.None],6:["G",p.Flat],7:["G",p.None],8:["A",p.Flat],9:["A",p.None],10:["B",p.Flat],11:["B",p.None]},l=n===p.Sharp?i:a,c=(e%12+12)%12,[s,m]=l[c],d=Math.floor(e/12)-1,h=o.indexOf(s),u=d*7+h;function f(_,W){const V=o.indexOf(_);return W*7+V}const y={[S.Treble]:{diatonic:f("G",4),staffStep:2},[S.MezzoSoprano]:{diatonic:f("C",4),staffStep:2},[S.Alto]:{diatonic:f("C",4),staffStep:4},[S.Tenor]:{diatonic:f("C",4),staffStep:6},[S.BaritoneF]:{diatonic:f("F",3),staffStep:4},[S.BaritoneC]:{diatonic:f("C",4),staffStep:8},[S.Bass]:{diatonic:f("F",3),staffStep:6},[S.Subbass]:{diatonic:f("F",2),staffStep:6}},b=y[t]??y[S.Treble],I=u-b.diatonic+b.staffStep;let A,x,k;if(I>=0&&I<=8)A=M.Main,I%2===0?(x=T.Line,k=Math.floor(I/2)+1):(x=T.Space,k=Math.floor((I+1)/2));else if(I<0){A=M.Lower;const _=-I;_%2===1?(x=T.Space,k=Math.floor((_+1)/2)):(x=T.Line,k=_/2)}else{A=M.Upper;const _=I-8;_%2===1?(x=T.Space,k=Math.floor((_+1)/2)):(x=T.Line,k=_/2)}return{staffRegion:{region:A,type:x,index:k},accidental:m}}const e0={[S.Treble]:{[M.Main]:64,[M.Upper]:79,[M.Lower]:62},[S.MezzoSoprano]:{[M.Main]:57,[M.Upper]:72,[M.Lower]:55},[S.Alto]:{[M.Main]:53,[M.Upper]:69,[M.Lower]:52},[S.Tenor]:{[M.Main]:50,[M.Upper]:65,[M.Lower]:48},[S.BaritoneF]:{[M.Main]:47,[M.Upper]:62,[M.Lower]:45},[S.BaritoneC]:{[M.Main]:53,[M.Upper]:62,[M.Lower]:52},[S.Bass]:{[M.Main]:43,[M.Upper]:60,[M.Lower]:41},[S.Subbass]:{[M.Main]:28,[M.Upper]:43,[M.Lower]:26}},t0=[2,2,1,2,2,2,1],n0={0:0,2:1,4:2,5:3,7:4,9:5,11:6};function o0(e,t){return t=(t%e.length+e.length)%e.length,e.slice(t).concat(e.slice(0,t))}function r0(e,t,n){const o=e0[n];if(!o||typeof o[M.Main]!="number")throw new Error(`No clef mapping for clef ${n}. please add clefMidiMap entry.`);const i=o[M.Main],{region:a,type:l,index:c}=e;if(c<1)throw new Error("StaffRegion.index should be >= 1");let s;if(a===M.Main)s=(c-1)*2+(l===T.Space?1:0);else if(a===M.Upper)s=8+(c-1)*2+(l===T.Space?1:2);else if(a===M.Lower)s=-((c-1)*2+(l===T.Space?1:2));else throw new Error("Unknown StaffRegionEnum: "+a);const m=(i%12+12)%12;let d=n0[m];d===void 0&&(d=0);const h=o0(t0,d);let u=0;if(s>0)for(let y=0;y<s;y++)u+=h[y%h.length];else if(s<0){const y=Math.abs(s);for(let b=0;b<y;b++)(h.length-1-b)%h.length,u-=h[(h.length-1-b%7)%h.length]}let f=0;switch(t){case p.Sharp:f=1;break;case p.Flat:f=-1;break;case p.DoubleSharp:f=2;break;case p.DoubleFlat:f=-2;break;default:f=0}return i+u+f}p.Natural,p.Sharp,p.Flat;p.Natural,p.Flat,p.Sharp;const i0={[w.Cb]:59,[w.Gb]:66,[w.Db]:61,[w.Ab]:68,[w.Eb]:63,[w.Bb]:70,[w.F]:65,[w.C]:60,[w.G]:67,[w.D]:62,[w.A]:69,[w.E]:64,[w.B]:71,"F#":66,"C#":61},a0={0:{sharp:{solmization:L.DO,accidental:p.None},flat:{solmization:L.DO,accidental:p.None}},1:{sharp:{solmization:L.DO,accidental:p.Sharp},flat:{solmization:L.RE,accidental:p.Flat}},2:{sharp:{solmization:L.RE,accidental:p.None},flat:{solmization:L.RE,accidental:p.None}},3:{sharp:{solmization:L.RE,accidental:p.Sharp},flat:{solmization:L.MI,accidental:p.Flat}},4:{sharp:{solmization:L.MI,accidental:p.None},flat:{solmization:L.MI,accidental:p.None}},5:{sharp:{solmization:L.FA,accidental:p.None},flat:{solmization:L.FA,accidental:p.None}},6:{sharp:{solmization:L.FA,accidental:p.Sharp},flat:{solmization:L.SOL,accidental:p.Flat}},7:{sharp:{solmization:L.SOL,accidental:p.None},flat:{solmization:L.SOL,accidental:p.None}},8:{sharp:{solmization:L.SOL,accidental:p.Sharp},flat:{solmization:L.LA,accidental:p.Flat}},9:{sharp:{solmization:L.LA,accidental:p.None},flat:{solmization:L.LA,accidental:p.None}},10:{sharp:{solmization:L.LA,accidental:p.Sharp},flat:{solmization:L.TI,accidental:p.Flat}},11:{sharp:{solmization:L.TI,accidental:p.None},flat:{solmization:L.TI,accidental:p.None}}};function l0(e,t,n=p.Sharp){const o=i0[t],i=e-o,a=(i%12+12)%12,l=Math.floor(i/12)+4,c=a0[a],s=n===p.Sharp?c.sharp:c.flat;return{solmization:s.solmization,accidental:s.accidental,octave:l}}function s0(e){e.showMode=U.numberNotation;for(let t=0;t<e.multipleStavesArray.length;t++){const n=e.multipleStavesArray[t];for(let o=0;o<n.singleStaffArray.length;o++){const i=n.singleStaffArray[o];for(let a=0;a<i.measureArray.length;a++){const l=i.measureArray[a];for(let c=0;c<l.msSymbolContainerArray.length;c++){const s=l.msSymbolContainerArray[c];for(let m=0;m<s.msSymbolArray.length;m++){const d=s.msSymbolArray[m];if(d.type===g.NoteHead){const h=F({type:g.NoteNumber,chronaxie:v.quarter});gt(h,d);const{accidental:u,measureAccidental:f}=ut(d,e);let y=u;f&&y===p.Natural&&(y=f);const b=Qe(d,e),I=dt(d,e),A=r0(d.region,y,b),x=l0(A,I);if(h.solmization=x.solmization,h.octave=x.octave,h.msSymbolArray=[],[v.whole,v.half,v.quarter].includes(d.chronaxie)||(h.chronaxie=d.chronaxie),s.msSymbolArray.splice(m,1),he(h,s,e,m),x.octave!==4){const k=F({type:g.NoteDot,octave:x.octave});ge(k,h,e)}if(![v.whole,v.half,v.quarter].includes(h.chronaxie)){const k=F({type:g.ChronaxieReducingLine,chronaxie:h.chronaxie});ge(k,h,e)}if(x.accidental){const k=F({type:g.Accidental,accidental:x.accidental});ge(k,h,e)}}if(d.type===g.NoteHead){if(d.chronaxie===v.whole){for(let h=0;h<3;h++){const u=F({type:g.ChronaxieIncreasingLine}),f=_e({type:R.variable});ie(f,s,e,"after"),he(u,f,e,"after")}c+=3}else if(d.chronaxie===v.half){const h=F({type:g.ChronaxieIncreasingLine}),u=_e({type:R.variable});ie(u,s,e,"after"),he(h,u,e,"after"),c+=1}}}}}}}}function c0(e){var t;for(let n=0;n<e.multipleStavesArray.length;n++){const o=e.multipleStavesArray[n];for(let i=0;i<o.singleStaffArray.length;i++){const a=o.singleStaffArray[i];for(let l=0;l<a.measureArray.length;l++){const c=a.measureArray[l];for(let s=0;s<c.msSymbolContainerArray.length;s++){const m=c.msSymbolContainerArray[s];for(let d=0;d<m.msSymbolArray.length;d++){const h=m.msSymbolArray[d];if(h.type===g.ChronaxieIncreasingLine){Gt(m,e),s--;continue}if(h.type===g.NoteNumber){const u=F({type:g.NoteHead});gt(u,h);const{accidental:f,measureAccidental:y}=ut(h,e);let b=f;y&&b===p.Natural&&(b=y);const I=Qe(h,e),A=dt(h,e),x=Et(h.solmization,b,A,h.octave),k=Yt(x,I);if(u.region=k.staffRegion,u.vueKey=Date.now(),u.msSymbolArray=[],h.chronaxie===v.quarter){let B=0;for(let _=s+1;_<c.msSymbolContainerArray.length&&((t=c.msSymbolContainerArray[_])==null?void 0:t.msSymbolArray[0]).type===g.ChronaxieIncreasingLine;_++)B++;B===0?u.chronaxie=v.quarter:B===1?u.chronaxie=v.half:B===3&&(u.chronaxie=v.whole)}else u.chronaxie=h.chronaxie;if(m.msSymbolArray.splice(d,1),he(u,m,e,d),k.accidental){const B=F({type:g.Accidental,accidental:k.accidental});ge(B,u,e)}if(zt(u.chronaxie)){const B=F({type:g.NoteStem});B.index=u.index,ge(B,u,e)}if(Pt(u.chronaxie)){const B=F({type:g.NoteTail,chronaxie:u.chronaxie});ge(B,u,e)}}}}}}}e.showMode=U.standardStaff}S.Treble+"",S.MezzoSoprano+"",S.Alto+"",S.Tenor+"",S.BaritoneF+"",S.BaritoneC+"",S.Bass+"",S.Subbass+"";p.Natural,p.Sharp,p.Flat;p.Natural,p.Flat,p.Sharp;function u0(e,t=p.Sharp){const n=e%12,o=Math.floor(e/12)-1,a=(t===p.Sharp?["C","C#","D","D#","E","F","F#","G","G#","A","A#","B"]:["C","Db","D","Eb","E","F","Gb","G","Ab","A","Bb","B"])[n];return{letter:a[0],accidental:a[1]??"",octave:o}}console.log(u0(12));z.C+"",z.D+"",z.E+"",z.F+"",z.G+"",z.A+"",z.B+"";p.None+"",p.Sharp+"",p.Flat+"",p.DoubleFlat+"",p.DoubleSharp+"";const d0={[w.Cb]:11,[w.Gb]:6,[w.Db]:1,[w.Ab]:8,[w.Eb]:3,[w.Bb]:10,[w.F]:5,[w.C]:0,[w.G]:7,[w.D]:2,[w.A]:9,[w.E]:4,[w.B]:11,[w["F#"]]:6,[w["C#"]]:1},Z={[g.NoteHead]:{containerType:R.variable,aspectRatio:1,widthRatioConstant:1,category:P.singleMeasure,heightMultiplier:.25,space:{top:0,bottom:0,left:0,right:0}},[g.NoteNumber]:{containerType:R.variable,aspectRatio:1,widthRatioConstant:1,category:P.singleMeasure,heightMultiplier:1,space:{top:0,bottom:0,left:0,right:0}},[g.NoteDot]:{aspectRatio:{0:1/.7,1:1/.5,2:1/.3,3:1/.1,5:1/.1,6:1/.3,7:1/.5,8:1/.7},category:P.singleMeasure,widthRatioConstant:0,heightMultiplier:{0:.7,1:.5,2:.3,3:.1,5:.1,6:.3,7:.5,8:.7},space:{top:.1,bottom:.1,left:0,right:0}},[g.ChronaxieIncreasingLine]:{containerType:R.variable,aspectRatio:5,widthRatioConstant:1,category:P.singleMeasure,heightMultiplier:.1,space:{top:0,bottom:0,left:0,right:0}},[g.ChronaxieReducingLine]:{aspectRatio:{[v.eighth]:1/.1,[v.sixteenth]:1/.15,[v.thirtySecond]:1/.2,[v.sixtyFourth]:1/.25},category:P.singleMeasure,widthRatioConstant:0,heightMultiplier:{[v.eighth]:.1,[v.sixteenth]:.15,[v.thirtySecond]:.2,[v.sixtyFourth]:.25},space:{top:0,bottom:.1,left:0,right:0}},[g.NoteStem]:{aspectRatio:.05,category:P.singleMeasure,widthRatioConstant:0,heightMultiplier:.75,space:{top:0,bottom:0,left:0,right:0}},[g.NoteTail]:{aspectRatio:{[v.eighth]:4/10,[v.sixteenth]:4/10,[v.thirtySecond]:4/15,[v.sixtyFourth]:4/15,[v.oneTwentyEighth]:4/15,[v.twoFiftySixth]:4/20},category:P.singleMeasure,widthRatioConstant:0,heightMultiplier:.5,space:{top:0,bottom:0,left:0,right:0}},[g.Rest]:{containerType:R.variable,aspectRatio:{[v.whole]:2,[v.half]:2,[v.quarter]:4/10,[v.eighth]:1/2,[v.sixteenth]:1/2,[v.thirtySecond]:5/12,[v.sixtyFourth]:5/14,[v.oneTwentyEighth]:5/14,[v.twoFiftySixth]:5/14},widthRatioConstant:1,category:P.singleMeasure,heightMultiplier:{[v.whole]:1/8,[v.half]:1/8,[v.quarter]:.75,[v.eighth]:.5,[v.sixteenth]:3/4,[v.thirtySecond]:1,[v.sixtyFourth]:5/4,[v.oneTwentyEighth]:6/4,[v.twoFiftySixth]:7/4},space:{top:0,bottom:0,left:0,right:0}},[g.Slur]:{category:P.multipleMeasure,space:{top:0,bottom:0,left:0,right:0}},[g.Tie]:{category:P.multipleMeasure,space:{top:0,bottom:0,left:0,right:0}},[g.DurationDot]:{aspectRatio:1,category:P.singleMeasure,widthRatioConstant:.5,heightMultiplier:.1,space:{top:0,bottom:0,left:0,right:0}},[g.Accidental]:{aspectRatio:{[p.None]:0,[p.Natural]:1/3,[p.Flat]:1/3,[p.Sharp]:1/3,[p.DoubleFlat]:2/3,[p.DoubleSharp]:2/3},category:P.singleMeasure,widthRatioConstant:.5,heightMultiplier:.4,space:{top:0,bottom:0,left:0,right:0}},[g.Tuplet]:{category:P.multipleMeasure,space:{top:0,bottom:0,left:0,right:0}},[g.Clef]:{containerType:R.rearFixed,aspectRatio:{[S.Treble]:.6,[S.Alto]:.5,[S.Bass]:1,[S.BaritoneC]:.5,[S.Tenor]:.5,[S.BaritoneF]:.5,[S.MezzoSoprano]:.5,[S.Subbass]:.5},category:P.singleMeasure,heightMultiplier:{[S.Treble]:5/4,[S.Alto]:3/4,[S.Bass]:3/4,[S.BaritoneC]:3/4,[S.Tenor]:3/4,[S.BaritoneF]:3/4,[S.MezzoSoprano]:3/4,[S.Subbass]:3/4},space:{top:0,bottom:0,left:0,right:0}},[g.Clef_f]:{containerType:R.frontFixed,aspectRatio:{[S.Treble]:.6,[S.Alto]:.5,[S.Bass]:1,[S.BaritoneC]:.5,[S.Tenor]:.5,[S.BaritoneF]:.5,[S.MezzoSoprano]:.5,[S.Subbass]:.5},category:P.singleMeasure,heightMultiplier:{[S.Treble]:6/4,[S.Alto]:1,[S.Bass]:1,[S.BaritoneC]:1,[S.Tenor]:1,[S.BaritoneF]:1,[S.MezzoSoprano]:1,[S.Subbass]:1},space:{top:0,bottom:0,left:0,right:0}},[g.TimeSignature]:{containerType:R.frontFixed,aspectRatio:.6,category:P.singleMeasure,heightMultiplier:1,space:{top:0,bottom:0,left:0,right:0}},[g.KeySignature]:{containerType:R.frontFixed,aspectRatio:{[w.Cb]:.3*7,[w.Gb]:.3*6,[w.Db]:.3*5,[w.Ab]:.3*4,[w.Eb]:.3*3,[w.Bb]:.3*2,[w.F]:.3,[w.C]:0,[w.G]:.3,[w.D]:.3*2,[w.A]:.3*3,[w.E]:.3*4,[w.B]:.3*5,[w["F#"]]:.3*6,[w["C#"]]:.3*7},category:P.singleMeasure,heightMultiplier:1,space:{top:0,bottom:0,left:0,right:0}},[g.BarLine]:{containerType:R.rearFixed,aspectRatio:{[N.single]:1/50,[N.final]:13/40,[N.reverseFinal]:13/40,[N.startRepeatSign]:13/40,[N.endRepeatSign]:13/40},category:P.singleMeasure,heightMultiplier:1,space:{top:0,bottom:0,left:0,right:0}},[g.BarLine_f]:{containerType:R.frontFixed,aspectRatio:{[N.single]:1/50,[N.final]:13/40,[N.reverseFinal]:13/40,[N.startRepeatSign]:13/40,[N.endRepeatSign]:13/40},category:P.singleMeasure,heightMultiplier:1,space:{top:0,bottom:0,left:0,right:0}}};function ft(e){let t=0;const n=Z[e.type];if(!n)return console.error("符号没有匹配到正确的information",e),t;if("widthRatioConstant"in n&&(t+=n.widthRatioConstant),e.msSymbolArray)for(let o=0;o<e.msSymbolArray.length;o++){const i=e.msSymbolArray[o],a=Z[i.type];if(!n)return console.error("子符号没有匹配到正确的information",i),t;"widthRatioConstant"in a&&(t+=a.widthRatioConstant)}return t}function Xe(e){let t=0;if(e.msSymbolArray)for(let n=0;n<e.msSymbolArray.length;n++){const o=e.msSymbolArray[n],i=ft(o);t<i&&(t=i)}return t}function le(e,t){let n=0;for(let o=0;o<e.msSymbolContainerArray.length;o++){const i=e.msSymbolContainerArray[o];if(t&&i===t)return n;n+=Xe(i)}return n===0?1:n}function pt(e,t,n){let o=0;for(let i=0;i<e.measureArray.length;i++){const a=e.measureArray[i];o+=le(a,n)}return o}const m0=Object.freeze(Object.defineProperty({__proto__:null,getWidthConstantInMeasure:le,getWidthConstantInMsSymbol:ft,getWidthConstantInMsSymbolContainer:Xe,getWidthConstantInSingleStaff:pt},Symbol.toStringTag,{value:"Module"}));function g0(e){const t=Z[e.type];if("aspectRatio"in t&&typeof t.aspectRatio=="object"){if(e.type===g.KeySignature)return t.aspectRatio[e.keySignature];if(e.type===g.BarLine||e.type===g.BarLine_f)return t.aspectRatio[e.barLineType];if(e.type===g.NoteTail)return t.aspectRatio[e.chronaxie];if(e.type===g.NoteDot)return t.aspectRatio[e.octave];if(e.type===g.ChronaxieReducingLine)return t.aspectRatio[e.chronaxie];if(e.type===g.Clef||e.type===g.Clef_f)return t.aspectRatio[e.clef];if(e.type===g.Accidental)return t.aspectRatio[e.accidental];if(e.type===g.Rest)return t.aspectRatio[e.chronaxie]}return console.error("符号有误或符号不是复合aspectRatio类型"),0}function ue(e){if(!(e!=null&&e.type))return console.error("缺少符号传参,宽高比获取失败"),1;const t=Z[e.type];return"aspectRatio"in t&&typeof t.aspectRatio=="number"?t.aspectRatio:"aspectRatio"in t&&typeof t.aspectRatio=="object"?g0(e):(console.error("未找到符号对应宽高比"),1)}function h0(e){const t=Z[e.type];if("heightMultiplier"in t&&typeof t.heightMultiplier=="object"){if(e.type===g.ChronaxieReducingLine)return t.heightMultiplier[e.chronaxie];if(e.type===g.NoteDot)return t.heightMultiplier[e.octave];if(e.type===g.Rest)return t.heightMultiplier[e.chronaxie];if(e.type===g.Clef_f||e.type===g.Clef)return t.heightMultiplier[e.clef]}return console.error("符号有误或符号不是复合heightMultiplier类型"),0}function De(e){if(!(e!=null&&e.type))return console.error("缺少符号传参,高度乘数获取失败"),1;const t=Z[e.type];return"heightMultiplier"in t&&typeof t.heightMultiplier=="number"?t.heightMultiplier:"heightMultiplier"in t&&typeof t.heightMultiplier=="object"?h0(e):1}function ve(e,t){const n=Z[e.type],o=t.measureHeight;return{top:n.space.top*o,bottom:n.space.bottom*o,left:n.space.left*o,right:n.space.right*o}}const f0=Object.freeze(Object.defineProperty({__proto__:null,getHeightMultiplier:De,getMsSymbolAspectRatio:ue,getSpace:ve},Symbol.toStringTag,{value:"Module"}));function Je(e,t){return t*((7-Q(e))*2)/16}function He(e,t){const n=j(e.index,t).msSymbol,o=t.measureHeight;switch(e==null?void 0:e.type){case g.NoteStem:return e.direction==="up"?-$(e,t)+o/8:o/8;case g.Rest:switch(e.chronaxie){case v.whole:return o/4;case v.half:return o*3/8;case v.quarter:return o*1/8;case v.eighth:return o*2/8;case v.sixteenth:return o*2/8;case v.thirtySecond:return 0;case v.sixtyFourth:return 0;case v.oneTwentyEighth:return 0;case v.twoFiftySixth:return 0;default:return 0}case g.NoteTail:{ne(e,t);const i=n==null?void 0:n.msSymbolArray.find(s=>s.type===g.NoteStem);if(!i)return console.error("找不到符杠,符尾bottom计算失败"),o;const a=o*1/8,l=$(e,t),c=$(i,t);return e.direction==="up"?-c+a:c+a-l}case g.NoteDot:{Z[g.NoteDot];const i=ve(e,t).bottom,a=ve(e,t).top,l=xe(e,t);let c=0;const s=l.msSymbolArray.find(d=>d.type===g.ChronaxieReducingLine);let m=0;if(s&&(m=ve(s,t).bottom,c=$(s,t)),[0,1,2,3].includes(e.octave)){const d=$(e,t);return o-(-d-i-c-m)}else if([5,6,7,8].includes(e.octave))return a;return o}case g.ChronaxieIncreasingLine:{const l=Z[g.ChronaxieIncreasingLine].heightMultiplier*o;return o+-(o/2-l/2)}case g.ChronaxieReducingLine:{Z[g.ChronaxieReducingLine];const i=De(e),a=ve(e,t).bottom,l=i*o;return o-(-l-a)}case g.Clef:switch(e.clef){case S.Treble:return-o*1/8;case S.Alto:return o*1/8;case S.Bass:return o*1/8;default:return o*1/8}case g.Clef_f:switch(e.clef){case S.Treble:return-o*2/8;case S.Alto:return 0;case S.Bass:return 0;default:return 0}default:return 0}}function ne(e,t){var i;if(!e)return 0;const n=t.measureHeight,o=(i=j(e.index,t))==null?void 0:i.msSymbol;switch(o.type){case g.NoteHead:{if(!o||t.showMode===U.numberNotation)return 0;const a=o.region;return Je(a,n)}default:return 0}}function yt(e,t,n=!0){let o=0;t.measureHeight;for(let i of e.msSymbolArray){const a=ne(i,t);n?o=Math.max(a,o):o=Math.max(a,o)}return o}function Ee(e,t){let n=1e4;for(let o of e.msSymbolArray){const i=ne(o,t);let a=0;if(o.msSymbolArray)for(let l of o.msSymbolArray)a=Math.min(a,He(l,t));n=Math.min(i+a,n)}return n}function vt(e,t,n){let o=1e4;return qt(e,t,n,i=>{const a=Ee(i,n);o=Math.min(o,a)}),o}function St(e,t,n=!0){let o=0;for(let i of e.msSymbolContainerArray){const a=yt(i,t,n);o=Math.max(a,o)}return o}function Ye(e,t){let n=1e4;for(let o of e.msSymbolContainerArray){const i=Ee(o,t);n=Math.min(i,n)}return n}function p0(e,t,n=!0){let o=0;for(let i of e.measureArray){const a=St(i,t,n);o=Math.max(a,o)}return o}function y0(e,t){let n=1e4;for(let o of e.measureArray){const i=Ye(o,t);n=Math.min(i,n)}return n}function et(e,t,n){let o=0;return Wt(t,{level:"multipleStaves",order:"asc",callback:({multipleStaves:i})=>{if(!i)return!0;o+=i.multipleStavesPaddingTop;for(let a of i.singleStaffArray){o+=a.singleStaffPaddingTop;for(let l of a.measureArray)if(l===e)return!0;o+=a.singleStaffPaddingBottom+a.singleStaffMarginBottom+t.measureHeight}return o+=i.multipleStavesPaddingBottom+i.multipleStavesMarginBottom,!1}}),o}const v0=Object.freeze(Object.defineProperty({__proto__:null,getMaxMsSymbolTopInMeasure:St,getMaxMsSymbolTopInMsSymbolContainer:yt,getMaxMsSymbolTopInSingleStaff:p0,getMeasureTopToMusicScore:et,getMinMsSymbolTopBetweenMsSymbolContainer:vt,getMinMsSymbolTopInMeasure:Ye,getMinMsSymbolTopInMsSymbolContainer:Ee,getMinMsSymbolTopInSingleStaff:y0,getMsSymbolTopToSlot:He,getSlotTopToMeasure:ne,staffRegionToTop:Je},Symbol.toStringTag,{value:"Module"}));function bt(e,t){const n=j(e.index,t).msSymbol,o=Z[e==null?void 0:e.type],i=t.measureHeight;let a=0;if("heightMultiplier"in o){const m=o.heightMultiplier;a=i*m}const l=i*1/8,c=j(n.index,t).measure;if(!c)return console.error("索引找不到measure,符杠height计算失败"),0;const s=we(n.beamId,c);if(n.beamId===-1||!s||s.length===0){const m=ne(e,t);return e.direction==="up"?Math.max(a,Math.abs(m)-(i-a)+l):Math.max(a,Math.abs(m)+a-l)}else{const m=ne(e,t);if(e.direction==="up"){const d=s.reduce((u,f)=>{const y=u,b=f.note;return Q(y.region)<Q(b.region)?f.note:u},s[0].note),h=ne(d,t);return Q(d.region)>0?d===n?a:Math.abs(m)-i+Math.abs(h-i)+a:Math.abs(m)-i+l+a}else{const d=s.reduce((u,f)=>{const y=u,b=f.note;return Q(y.region)>Q(b.region)?b:u},s[0].note),h=ne(d,t);return Q(d.region)<8?d===n?a:Math.abs(m)+h+a:Math.abs(m)-l+a}}}function $(e,t){Z[e==null?void 0:e.type];const n=t.measureHeight,o=De(e);switch(e.type){case g.NoteStem:return bt(e,t);default:return n*o}}const S0=Object.freeze(Object.defineProperty({__proto__:null,getMsSymbolHeight:$,getNoteStemHeight:bt},Symbol.toStringTag,{value:"Module"}));function Se(e,t){let n=0;for(let o=0;o<e.msSymbolArray.length;o++){const i=e.msSymbolArray[o],a=Z[i.type];let l=0;"aspectRatio"in a&&typeof a.aspectRatio=="number"?l+=a.aspectRatio*t:"aspectRatio"in a&&typeof a.aspectRatio=="object"?i.type===g.KeySignature?l+=a.aspectRatio[i.keySignature]*t:i.type===g.BarLine||i.type===g.BarLine_f?l+=a.aspectRatio[i.barLineType]*t:(i.type===g.Clef||i.type===g.Clef_f)&&(l+=a.aspectRatio[i.clef]*t):console.error("符号的svg宽高比不存在"),n<l&&(n=l)}return n}function E(e,t,n,o,i){const a=o.measureHeight;if(!e||!t)return console.error("缺少必要的参数,坐标计算出错"),0;let l=0;const c=e.type;if([R.frontFixed,R.rearFixed].includes(c))l=Se(e,a);else{const s=J(t,a),m=le(t),d=Xe(e);l=(se(t,n,o,i)-s)/m*d}return l}function se(e,t,n,o){const i=pt(t,n.showMode),a=le(e),l=xt(t,n.measureHeight),c=J(e,n.measureHeight),s=t.measureArray.length,m=o-l,d=m/i*n.widthDynamicRatio,h=m*(1-n.widthDynamicRatio)/s;return d*a+c+h}function J(e,t,n="all",o){let i=0;for(let a=0;a<e.msSymbolContainerArray.length;a++){const l=e.msSymbolContainerArray[a];if(o&&o===l)return i;const c=l.type;(n==="all"&&[R.frontFixed,R.rearFixed].includes(c)||n==="front"&&[R.frontFixed].includes(c)||n==="rear"&&[R.rearFixed].includes(c))&&(i+=Se(l,t))}return i}function xt(e,t,n="all",o){let i=0;return e.measureArray.forEach(a=>{i+=J(a,t,n,o)}),i}function tt(e,t,n,o,i,a,l){const c=ue(e),s=$(e,a),m=we(t.beamId,o);return m.length>1?t.id===m[0].note.id||t.id===m[m.length-1].note.id?E(n,o,i,a,l)/2:E(n,o,i,a,l):s*c}function fe(e,t,n,o,i,a){const l=i.measureHeight,c=ue(e),s=De(e),m=$(e,i);switch(e==null?void 0:e.type){case g.NoteStem:return l*s*c;case g.NoteTail:{const d=j(e.index,i).msSymbol;return d?tt(e,d,t,n,o,i,a):(console.error("音符头索引失败,符尾宽度计算失败"),m*c)}default:return m*c}}function be(e,t,n=!1){const o=n?e:xe(e,t),i=ue(o);return $(o,t)*i}const b0=Object.freeze(Object.defineProperty({__proto__:null,getMeasureWidth:se,getMsSymbolContainerWidth:E,getMsSymbolSlotWidth:be,getMsSymbolWidth:fe,getNoteTailWidth:tt,getWidthFixedContainerWidth:Se,getWidthFixedContainerWidthSumInMeasure:J,getWidthFixedContainerWidthSumInSingleStaff:xt},Symbol.toStringTag,{value:"Module"})),x0=["onMousedown"],w0=["onMousedown"],C0=r.defineComponent({__name:"measureContainer",props:{musicScore:{type:Object,default:{}},disabled:{type:Boolean,default:!0},componentWidth:{type:Number,default:1e3},height:{type:Number,default:800}},emits:["singleStaffMouseDown","multipleStavesMouseDown"],setup(e,{emit:t}){const n=e,o=t,i=r.computed(()=>s=>({"grid-template-rows":`repeat(${s.singleStaffArray.length},1fr)`,"padding-top":s.multipleStavesPaddingTop+"px","padding-bottom":s.multipleStavesPaddingBottom+"px","margin-bottom":s.multipleStavesMarginBottom+"px","pointer-events":n.disabled?"none":"auto",outline:"1px solid "+(s.options.highlight?s.options.highlightColor:s.options.color)})),a=r.computed(()=>(s,m)=>({"grid-template-columns":`repeat(${s.measureArray.length},1fr)`,"padding-top":s.singleStaffPaddingTop+"px","padding-bottom":s.singleStaffPaddingBottom+"px","margin-bottom":s.singleStaffMarginBottom+"px","pointer-events":n.disabled?"none":"auto",outline:"1px solid "+(s.options.highlight?s.options.highlightColor:s.options.color)})),l=r.computed(()=>(s,m,d,h,u)=>se(s,m,h,u)),c=r.computed(()=>(s,m,d,h,u)=>{let f={};return f.height=n.musicScore.measureHeight+"px",f.width=l.value(s,m,d,h,u)+"px",f.pointerEvents=n.disabled?"none":"auto",f});return(s,m)=>(r.openBlock(),r.createElementBlock("div",null,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.musicScore.multipleStavesArray,(d,h)=>(r.openBlock(),r.createElementBlock("div",{key:"multipleStaves"+h,style:r.normalizeStyle(i.value(d)),class:"multipleStaves",onMousedown:r.withModifiers(u=>o("multipleStavesMouseDown",u,d),["self"])},[r.renderSlot(s.$slots,"multipleStaves",{},void 0,!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(d.singleStaffArray,(u,f)=>(r.openBlock(),r.createElementBlock("div",{key:"singleStaff"+f,style:r.normalizeStyle(a.value(u,d)),class:"singleStaff",onMousedown:r.withModifiers(y=>o("singleStaffMouseDown",y,u),["self"])},[r.renderSlot(s.$slots,"singleStaff",{},void 0,!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(u.measureArray,(y,b)=>(r.openBlock(),r.createElementBlock("div",{key:"measure"+b,style:r.normalizeStyle(c.value(y,u,d,e.musicScore,e.componentWidth)),class:"measureSlot"},[r.renderSlot(s.$slots,"default",{measure:y,measureIndex:b,measureWidth:l.value(y,u,d,e.musicScore,e.componentWidth),multipleStaves:d,multipleStavesIndex:h,singleStaff:u,singleStaffIndex:f},void 0,!0)],4))),128))],44,w0))),128))],44,x0))),128))]))}}),je=G(C0,[["__scopeId","data-v-684eebdd"]]);function Be(e,t,n){const o=j(e.index,t);if(o.singleStaff==null)return console.error("没有单谱表信息,无法计算小节left"),0;let i=0;for(let a of o.singleStaff.measureArray){if(a===e)return i;i+=se(a,o.singleStaff,t,n)}return i}function wt(e,t,n,o,i,a,l,c,s){const m=a.measureHeight;if(!n||!o||!i)return console.error("数据索引有误,符尾left计算出错"),0;const d=fe(e,n,o,i,a,s),h=we(t.beamId,o),u=Z[g.NoteStem];if(!("aspectRatio"in u)||typeof u.aspectRatio!="number")return console.error("符杠aspectRatio获取失败,符尾left计算出错"),0;if(h.length>1)return t.id===h[0].note.id?e.direction==="up"?l:0:t.id===h[h.length-1].note.id?e.direction==="up"?-d+l:-d:-Re(t,n,o,i,a,l,s);if(e.direction==="up")return l;{const f=Z[g.NoteStem];if(!("aspectRatio"in f)||typeof f.aspectRatio!="number")return console.error("符杠aspectRatio获取失败,符杠left计算出错"),0;const y=f.heightMultiplier;return m*y*f.aspectRatio}}function nt(e,t,n,o,i,a,l,c,s=!1){const m=s?e:xe(e,i),d=be(e,i),h=fe(e,t,n,o,i,c);switch(e==null?void 0:e.type){case g.NoteHead:return 0;case g.NoteStem:return e.direction==="up"?d-h:0;case g.NoteTail:return m.type!==g.NoteHead?(console.error("找不到音符头,符尾left计算出错"),0):wt(e,m,t,n,o,i,d,l,c);case g.Accidental:return-h;case g.NoteDot:{const u=fe(e,t,n,o,i,c);return d/2-u/2}}return 0}function Re(e,t,n,o,i,a,l,c=!1){const s=c?e:xe(e,i),m=E(t,n,o,i,l);switch(i.measureHeight,s==null?void 0:s.type){case g.NoteHead:return m/2-a/2;case g.NoteNumber:return m/2-a/2;case g.Rest:return m/2-a/2;case g.ChronaxieIncreasingLine:return m/2-a/2}return 0}function ot(e,t,n,o,i){const a=o.measureHeight;if(!e||!t||!n)return console.error("缺少必要的参数,坐标计算出错"),0;let l=0;const c=e.type;if([R.frontFixed].includes(c))l=J(t,a,"front",e);else if([R.rearFixed].includes(c))l=i-J(t,a)+J(t,a,"all",e);else{const s=J(t,a),m=le(t),d=le(t,e),h=J(t,a,"front");l=(i-s)/m*d+h}return l}function Oe(e,t,n,o,i,a,l,c,s=!1){const m=s?e:xe(e,i),d=Re(m,t,n,o,i,a,c),h=ot(t,n,o,i,l);return d+h}const I0=Object.freeze(Object.defineProperty({__proto__:null,getContainerLeftToMeasure:ot,getMeasureLeftToMusicScore:Be,getMsSymbolLeftToSlot:nt,getNoteTailLeftToSlot:wt,getSlotLeftToContainer:Re,getSlotLeftToMeasure:Oe},Symbol.toStringTag,{value:"Module"})),M0=["src"],k0=r.defineComponent({__name:"noteTail",props:{noteTail:{type:Object,required:!0},noteHead:{type:Object,required:!0},preContainer:{type:Object},nextContainer:{type:Object},msSymbolContainer:{type:Object,required:!0},measure:{type:Object,required:!0},singleStaff:{type:Object,required:!0},musicScore:{type:Object,required:!0},parentMsSymbol:{type:Object},slotLeft:{type:Number,required:!0},measureWidth:{type:Number,required:!0},componentWidth:{type:Number,required:!0}},setup(e){const t=e,{svgSkin:n,isOriginSkin:o}=r.inject("skin"),i=r.computed(()=>we(t.noteHead.beamId,t.measure));r.computed(()=>ue(t.noteTail));const a=r.computed(()=>{var u;switch((u=t.noteTail)==null?void 0:u.chronaxie){case v.eighth:return 1;case v.sixteenth:return 2}return 0}),l=r.computed(()=>$(t.noteTail,t.musicScore)),c=r.computed(()=>t.noteTail.type===g.NoteTail&&t.nextContainer?tt(t.noteTail,t.noteHead,t.msSymbolContainer,t.measure,t.singleStaff,t.musicScore,t.componentWidth):fe(t.noteTail,t.msSymbolContainer,t.measure,t.singleStaff,t.musicScore,t.componentWidth)),s=r.computed(()=>{var f,y;const u={width:`${c.value}px`,height:`${l.value}px`,display:"flex",flexDirection:((f=t.noteTail)==null?void 0:f.direction)==="up"?"column":"column-reverse",position:"absolute",left:m.value+"px",top:d.value+"px",background:t.noteTail.options.highlight?t.noteTail.options.highlightColor:t.noteTail.options.color};return h.value&&i.value.length<2?(u.mask=`url("${h.value}") center center / cover no-repeat`,((y=t.noteTail)==null?void 0:y.direction)==="down"&&(u.transform="scaleY(-1)")):u.background="transparent",u}),m=r.computed(()=>nt(t.noteTail,t.msSymbolContainer,t.measure,t.singleStaff,t.musicScore,t.slotLeft,t.measureWidth,t.componentWidth)),d=r.computed(()=>He(t.noteTail,t.musicScore)),h=r.computed(()=>{switch(t.noteTail.chronaxie){case v.eighth:return t.noteTail.options.highlight?n.value.active_noteTail_8.url:n.value.noteTail_8.url;case v.sixteenth:return t.noteTail.options.highlight?n.value.active_noteTail_16.url:n.value.noteTail_16.url;case v.thirtySecond:return t.noteTail.options.highlight?n.value.active_noteTail_32.url:n.value.noteTail_32.url;case v.sixtyFourth:return t.noteTail.options.highlight?n.value.active_noteTail_64.url:n.value.noteTail_64.url;case v.oneTwentyEighth:return t.noteTail.options.highlight?n.value.active_noteTail_128.url:n.value.noteTail_128.url;case v.twoFiftySixth:return t.noteTail.options.highlight?n.value.active_noteTail_256.url:n.value.noteTail_256.url;default:return""}});return(u,f)=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[r.unref(o)?(r.openBlock(),r.createElementBlock("div",{key:0,style:r.normalizeStyle(s.value)},null,4)):(r.openBlock(),r.createElementBlock("img",{key:1,src:h.value,style:r.normalizeStyle(s.value)},null,12,M0)),i.value.length>1?(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:2},r.renderList(a.value*2-1,(y,b)=>(r.openBlock(),r.createElementBlock("div",{style:r.normalizeStyle({backgroundColor:b%2===0?"black":"transparent",height:l.value/5+"px",width:"100%"})},null,4))),256)):r.createCommentVNode("",!0)],64))}}),L0=r.defineComponent({__name:"timeSignature",props:{timeSignature:{type:Object,required:!0},measureHeight:{type:Number,default:60}},setup(e){const t=e,n=r.computed(()=>({fontSize:t.measureHeight/3+"px",userSelect:"none",color:t.timeSignature.options.highlight?t.timeSignature.options.highlightColor:t.timeSignature.options.color}));return(o,i)=>e.timeSignature&&e.timeSignature.type===r.unref(g).TimeSignature?(r.openBlock(),r.createElementBlock("div",{key:0,style:r.normalizeStyle(n.value),class:"timeSignature"},[r.createElementVNode("div",null,r.toDisplayString(e.timeSignature.timeSignature.beat),1),r.createElementVNode("div",null,r.toDisplayString(e.timeSignature.timeSignature.chronaxie),1)],4)):r.createCommentVNode("",!0)}}),A0=G(L0,[["__scopeId","data-v-74f3a255"]]),_0={key:0,class:"keySignature"},B0={key:1,class:"keySignature"},N0=["src"],D0=r.defineComponent({__name:"keySignature",props:{keySignature:{type:Object,required:!0},slotWidth:{type:Number,default:50},measureHeight:{type:Number,default:60},musicScore:{type:Object,default:{}}},setup(e){const t=e,{svgSkin:n,isOriginSkin:o}=r.inject("skin"),i=r.computed(()=>t.keySignature?Qe(t.keySignature,t.musicScore):S.Treble),a=r.computed(()=>{const u={Cb:{type:"flat",count:7},Gb:{type:"flat",count:6},Db:{type:"flat",count:5},Ab:{type:"flat",count:4},Eb:{type:"flat",count:3},Bb:{type:"flat",count:2},F:{type:"flat",count:1},C:{type:"none",count:0},G:{type:"sharp",count:1},D:{type:"sharp",count:2},A:{type:"sharp",count:3},E:{type:"sharp",count:4},B:{type:"sharp",count:5},"F#":{type:"sharp",count:6},"C#":{type:"sharp",count:7}};return t.keySignature.type===g.KeySignature?u[t.keySignature.keySignature]:(console.error("keySignature出错,没有keySignature属性",t.keySignature),u[w.C])}),l=r.computed(()=>{var u;return(u=t.keySignature)!=null&&u.options.highlight?a.value.type==="sharp"?n.value.active_accidental_sharp.url:n.value.active_accidental_flat.url:a.value.type==="sharp"?n.value.accidental_sharp.url:n.value.accidental_flat.url}),c=r.computed(()=>t.measureHeight/8),s={[S.Treble]:[8,5,9,6,3,7,4],[S.Alto]:[7,4,8,5,2,6,3],[S.Bass]:[6,3,7,4,1,5,2]},m={[S.Treble]:[5,8,4,7,3,6,2],[S.Alto]:[4,7,3,6,2,5,1],[S.Bass]:[3,6,2,5,1,4,0]},d=r.computed(()=>a.value.type==="sharp"?(s[i.value]||s[S.Treble]).slice(0,a.value.count).map(f=>f*c.value):a.value.type==="flat"?(m[i.value]||m[S.Treble]).slice(0,a.value.count).map(f=>f*c.value):[]),h=r.computed(()=>{const u=t.measureHeight*.5,f=t.measureHeight*.25;return(y,b)=>({width:u+"px",height:u+"px",position:"absolute",pointerEvents:"none",left:`${y*f}px`,top:`${t.measureHeight-b-u/2}px`,backgroundColor:t.keySignature.options.highlight?t.keySignature.options.highlightColor:t.keySignature.options.color,maskImage:`url("${l.value}")`,WebkitMaskImage:`url("${l.value}")`,maskRepeat:"no-repeat",WebkitMaskRepeat:"no-repeat",maskSize:"contain",WebkitMaskSize:"contain",maskPosition:"center",WebkitMaskPosition:"center"})});return(u,f)=>r.unref(o)?(r.openBlock(),r.createElementBlock("div",_0,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(d.value,(y,b)=>(r.openBlock(),r.createElementBlock("div",{key:b,style:r.normalizeStyle(h.value(b,y)),class:"symbol"},null,4))),128))])):(r.openBlock(),r.createElementBlock("div",B0,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(d.value,(y,b)=>(r.openBlock(),r.createElementBlock("img",{key:b,src:l.value,style:r.normalizeStyle(h.value(b,y)),class:"symbol"},null,12,N0))),128))]))}}),H0=G(D0,[["__scopeId","data-v-8485dd0d"]]),R0=["src"],T0=r.defineComponent({__name:"clef",props:{clef:{type:Object,required:!0},musicScore:{required:!0,type:Object}},setup(e){const t=e,{svgSkin:n,isOriginSkin:o}=r.inject("skin"),i=r.computed(()=>{let l="";return t.clef.clef===ke.Treble?l=n.value.clef_treble.url:t.clef.clef===ke.Alto?l=n.value.clef_alto.url:t.clef.clef===ke.Bass&&(l=n.value.clef_bass.url),l}),a=r.computed(()=>{var c,s,m;const l={};return o.value&&(l.mask=`url("${i.value}") center center / 100% 100% no-repeat`,l.backgroundColor=(c=t.clef)!=null&&c.options.highlight?(s=t.clef)==null?void 0:s.options.highlightColor:(m=t.clef)==null?void 0:m.options.color),l});return(l,c)=>r.unref(o)?(r.openBlock(),r.createElementBlock("div",{key:0,style:r.normalizeStyle(a.value),comment:"谱号"},null,4)):(r.openBlock(),r.createElementBlock("img",{key:1,src:i.value,comment:"谱号"},null,8,R0))}}),j0=["src"],P0=["src"],z0=["src"],W0=r.defineComponent({__name:"msSymbol",props:{msSymbol:{type:Object,required:!0},msSymbolContainer:{type:Object,required:!0},preContainer:{type:Object},nextContainer:{type:Object},measure:{type:Object,required:!0},measureWidth:{type:Number,required:!0},singleStaff:{type:Object,required:!0},musicScore:{type:Object,required:!0},containerWidth:{type:Number,required:!0},isMain:{type:Boolean,default:!1},measureHeight:{type:Number,required:!0},parentMsSymbol:{type:Object},slotWidth:{type:Number,required:!0},slotTop:{type:Number,required:!0},slotLeft:{type:Number,required:!0},componentWidth:{type:Number,required:!0},componentHeight:{type:Number,required:!0}},emits:["msSymbolMouseDown","msSymbolMouseUp"],setup(e,{expose:t,emit:n}){const o=e,{svgSkin:i,isOriginSkin:a}=r.inject("skin");r.watch(()=>{var x;return(x=o.msSymbol)==null?void 0:x.vueKey},()=>{l()});function l(){var x,k,B,_,W,V,q;switch((x=o.msSymbol)==null?void 0:x.type){case g.NoteHead:switch((k=o.msSymbol)==null?void 0:k.chronaxie){case v.whole:return o.msSymbol.options.highlight?i.value.active_noteHead_1.url:i.value.noteHead_1.url;case v.half:return o.msSymbol.options.highlight?i.value.active_noteHead_2.url:i.value.noteHead_2.url;case v.quarter:return o.msSymbol.options.highlight?i.value.active_noteHead_4.url:i.value.noteHead_4.url;default:return o.msSymbol.options.highlight?i.value.active_noteHead_4.url:i.value.noteHead_4.url}case g.Rest:switch((B=o.msSymbol)==null?void 0:B.chronaxie){case v.whole:return o.msSymbol.options.highlight?i.value.active_rest_1.url:i.value.rest_1.url;case v.half:return o.msSymbol.options.highlight?i.value.active_rest_2.url:i.value.rest_2.url;case v.quarter:return o.msSymbol.options.highlight?i.value.active_rest_4.url:i.value.rest_4.url;case v.eighth:return o.msSymbol.options.highlight?i.value.active_rest_8.url:i.value.rest_8.url;case v.sixteenth:return o.msSymbol.options.highlight?i.value.active_rest_16.url:i.value.rest_16.url;case v.thirtySecond:return o.msSymbol.options.highlight?i.value.active_rest_32.url:i.value.rest_32.url;case v.sixtyFourth:return o.msSymbol.options.highlight?i.value.active_rest_64.url:i.value.rest_64.url;case v.oneTwentyEighth:return o.msSymbol.options.highlight?i.value.active_rest_128.url:i.value.rest_128.url;case v.twoFiftySixth:return o.msSymbol.options.highlight?i.value.active_rest_256.url:i.value.rest_256.url;default:return o.msSymbol.options.highlight?i.value.active_rest_4.url:i.value.rest_4.url}case g.NoteStem:return o.msSymbol.options.highlight?i.value.active_noteStem.url:i.value.noteStem.url;case g.NoteTail:return"";case g.Clef:return"";case g.Clef_f:return"";case g.BarLine:{switch((_=o.msSymbol)==null?void 0:_.barLineType){case N.single:return o.msSymbol.options.highlight?i.value.active_barline_single.url:i.value.barline_single.url;case N.final:return o.msSymbol.options.highlight?i.value.active_barLine_final.url:i.value.barLine_final.url;case N.reverseFinal:return o.msSymbol.options.highlight?i.value.active_barline_reverseFinal.url:i.value.barline_reverseFinal.url;case N.startRepeatSign:return o.msSymbol.options.highlight?i.value.active_barline_startRepeatSign.url:i.value.barline_startRepeatSign.url;case N.endRepeatSign:return o.msSymbol.options.highlight?i.value.active_barLine_endRepeatSign.url:i.value.barLine_endRepeatSign.url}return""}case g.BarLine_f:{switch((W=o.msSymbol)==null?void 0:W.barLineType){case N.single:return o.msSymbol.options.highlight?i.value.active_barline_single.url:i.value.barline_single.url;case N.final:return o.msSymbol.options.highlight?i.value.activebarLine_final.url:i.value.barLine_final.url;case N.reverseFinal:return o.msSymbol.options.highlight?i.value.active_barline_reverseFinal.url:i.value.barline_reverseFinal.url;case N.startRepeatSign:return o.msSymbol.options.highlight?i.value.active_barline_startRepeatSign.url:i.value.barline_startRepeatSign.url;case N.endRepeatSign:return o.msSymbol.options.highlight?i.value.active_barLine_endRepeatSign.url:i.value.barLine_endRepeatSign.url}return console.error("未知的小节线类型",o.msSymbol),""}case g.KeySignature:return"";case g.TimeSignature:return"";case g.Accidental:{switch((V=o.msSymbol)==null?void 0:V.accidental){case p.Sharp:return o.msSymbol.options.highlight?i.value.active_accidental_sharp.url:i.value.accidental_sharp.url;case p.Flat:return o.msSymbol.options.highlight?i.value.active_accidental_flat.url:i.value.accidental_flat.url;case p.Natural:return o.msSymbol.options.highlight?i.value.active_accidental_nature.url:i.value.accidental_nature.url;case p.DoubleSharp:return o.msSymbol.options.highlight?i.value.active_accidental_doubleSharp.url:i.value.accidental_doubleSharp.url;case p.DoubleFlat:return o.msSymbol.options.highlight?i.value.active_accidental_doubleFlat.url:i.value.accidental_doubleFlat.url}return console.error("未知的变音符号",o.msSymbol),""}case g.NoteNumber:switch((q=o.msSymbol)==null?void 0:q.solmization){case L.DO:return o.msSymbol.options.highlight?i.value.active_number_1.url:i.value.number_1.url;case L.RE:return o.msSymbol.options.highlight?i.value.active_number_2.url:i.value.number_2.url;case L.MI:return o.msSymbol.options.highlight?i.value.active_number_3.url:i.value.number_3.url;case L.FA:return o.msSymbol.options.highlight?i.value.active_number_4.url:i.value.number_4.url;case L.SOL:return o.msSymbol.options.highlight?i.value.active_number_5.url:i.value.number_5.url;case L.LA:return o.msSymbol.options.highlight?i.value.active_number_6.url:i.value.number_6.url;case L.TI:return o.msSymbol.options.highlight?i.value.active_number_7.url:i.value.number_7.url;default:return o.msSymbol.options.highlight?i.value.active_number_1.url:i.value.number_1.url}case g.NoteDot:switch(o.msSymbol.octave){case 0:return i.value.noteDot_4.url;case 1:return i.value.noteDot_3.url;case 2:return i.value.noteDot_2.url;case 3:return i.value.noteDot_1.url;case 5:return i.value.noteDot_1.url;case 6:return i.value.noteDot_2.url;case 7:return i.value.noteDot_3.url;case 8:return i.value.noteDot_4.url;default:return""}case g.ChronaxieReducingLine:switch(o.msSymbol.chronaxie){case v.eighth:return i.value.chronaxieReducingLine_1.url;case v.sixteenth:return i.value.chronaxieReducingLine_2.url;case v.thirtySecond:return i.value.chronaxieReducingLine_3.url;case v.sixtyFourth:return i.value.chronaxieReducingLine_4.url;default:return""}case g.ChronaxieIncreasingLine:return o.msSymbol.options.highlight?i.value.active_chronaxieIncreasingLine.url:i.value.chronaxieIncreasingLine.url;default:return console.error("未知的符号类别",o.msSymbol),""}}const c=r.computed(()=>l()),s=r.ref(null),m=r.computed(()=>ue(o.msSymbol)),d=r.computed(()=>$(o.msSymbol,o.musicScore)),h=r.computed(()=>fe(o.msSymbol,o.msSymbolContainer,o.measure,o.singleStaff,o.musicScore,o.componentWidth)),u=r.computed(()=>nt(o.msSymbol,o.msSymbolContainer,o.measure,o.singleStaff,o.musicScore,o.slotLeft,o.measureWidth,o.componentWidth)),f=r.computed(()=>He(o.msSymbol,o.musicScore)),y=r.computed(()=>{var k;const x={width:`${h.value}px`,height:`${d.value}px`,position:"absolute",pointerEvents:"auto",left:u.value+"px",top:f.value+"px"};return(k=o.msSymbol)!=null&&k.type&&[g.KeySignature,g.TimeSignature,g.NoteTail].includes(o.msSymbol.type)&&(x.background="unset"),c.value&&a&&(x.mask=`url("${c.value}") no-repeat center`,x["mask-size"]="100% 100%",x.backgroundColor=o.msSymbol.options.highlight?o.msSymbol.options.highlightColor:o.msSymbol.options.color),x}),b=n;function I(x){b("msSymbolMouseDown",x,o.msSymbol)}function A(x){b("msSymbolMouseUp",x,o.msSymbol)}return r.onMounted(()=>{}),t({aspectRatio:m}),(x,k)=>{var B,_,W,V,q,oe,de;return((B=e.msSymbol)==null?void 0:B.type)===r.unref(g).Clef||((_=e.msSymbol)==null?void 0:_.type)===r.unref(g).Clef_f&&"clef"in e.msSymbol?r.withDirectives((r.openBlock(),r.createBlock(T0,{key:0,clef:e.msSymbol,musicScore:e.musicScore,style:r.normalizeStyle(y.value),onMouseup:r.withModifiers(A,["self"]),onMousedown:r.withModifiers(I,["self"])},null,8,["clef","musicScore","style"])),[[r.vShow,e.musicScore.showMode===r.unref(U).standardStaff]]):((W=e.msSymbol)==null?void 0:W.type)===r.unref(g).KeySignature?r.withDirectives((r.openBlock(),r.createBlock(H0,{key:1,keySignature:e.msSymbol,"measure-height":e.measureHeight,musicScore:e.musicScore,slotWidth:e.slotWidth,style:r.normalizeStyle(y.value),onMouseup:r.withModifiers(A,["self"]),onMousedown:r.withModifiers(I,["self"])},null,8,["keySignature","measure-height","musicScore","slotWidth","style"])),[[r.vShow,e.musicScore.showMode===r.unref(U).standardStaff]]):((V=e.msSymbol)==null?void 0:V.type)===r.unref(g).TimeSignature?r.withDirectives((r.openBlock(),r.createBlock(A0,{key:2,"measure-height":e.measureHeight,style:r.normalizeStyle(y.value),"time-signature":e.msSymbol,onMouseup:r.withModifiers(A,["self"]),onMousedown:r.withModifiers(I,["self"])},null,8,["measure-height","style","time-signature"])),[[r.vShow,e.musicScore.showMode===r.unref(U).standardStaff]]):((q=e.msSymbol)==null?void 0:q.type)===r.unref(g).NoteTail?r.withDirectives((r.openBlock(),r.createBlock(k0,{key:3,"component-width":e.componentWidth,measure:e.measure,"measure-width":e.measureWidth,"ms-symbol-container":e.msSymbolContainer,musicScore:e.musicScore,"next-container":e.nextContainer?e.nextContainer:null,noteHead:e.parentMsSymbol,noteTail:e.msSymbol,"pre-container":e.preContainer?e.preContainer:null,"single-staff":e.singleStaff,"slot-left":e.slotLeft},null,8,["component-width","measure","measure-width","ms-symbol-container","musicScore","next-container","noteHead","noteTail","pre-container","single-staff","slot-left"])),[[r.vShow,e.musicScore.showMode===r.unref(U).standardStaff]]):((oe=e.msSymbol)==null?void 0:oe.type)===r.unref(g).NoteStem&&r.unref(a)?r.withDirectives((r.openBlock(),r.createElementBlock("div",{key:4,ref_key:"msSymbolRef",ref:s,style:r.normalizeStyle(y.value),class:"msSymbol",onMouseup:r.withModifiers(A,["self"]),onMousedown:r.withModifiers(I,["self"])},null,36)),[[r.vShow,e.musicScore.showMode===r.unref(U).standardStaff]]):((de=e.msSymbol)==null?void 0:de.type)===r.unref(g).NoteStem?r.withDirectives((r.openBlock(),r.createElementBlock("img",{key:5,ref_key:"msSymbolRef",ref:s,src:c.value,style:r.normalizeStyle(y.value),class:"msSymbol",onMouseup:r.withModifiers(A,["self"]),onMousedown:r.withModifiers(I,["self"])},null,44,j0)),[[r.vShow,e.musicScore.showMode===r.unref(U).standardStaff]]):r.unref(a)?(r.openBlock(),r.createElementBlock("div",{key:6,ref_key:"msSymbolRef",ref:s,src:c.value,style:r.normalizeStyle(y.value),class:"msSymbol",onMouseup:r.withModifiers(A,["self"]),onMousedown:r.withModifiers(I,["self"])},null,44,P0)):(r.openBlock(),r.createElementBlock("img",{key:7,ref_key:"msSymbolRef",ref:s,src:c.value,style:r.normalizeStyle(y.value),class:"msSymbol",onMouseup:r.withModifiers(A,["self"]),onMousedown:r.withModifiers(I,["self"])},null,44,z0))}}}),ct=G(W0,[["__scopeId","data-v-f2b994c1"]]),F0=r.defineComponent({__name:"msSymbolSlot",props:{msSymbol:{type:Object,required:!0},msSymbolContainer:{type:Object,required:!0},preContainer:{type:Object},nextContainer:{type:Object},containerWidth:{type:Number,default:60,required:!0},measureHeight:{type:Number,default:60,required:!0},measure:{type:Object,required:!0},measureWidth:{type:Number,default:200,required:!0},componentWidth:{type:Number,default:1e3},componentHeight:{type:Number,default:800},singleStaff:{type:Object,required:!0},multipleStaves:{type:Object,required:!0},musicScore:{type:Object,default:{}}},emits:["msSymbolMouseDown","msSymbolMouseUp"],setup(e,{emit:t}){const n=e,o=r.computed(()=>!n.msSymbol||!n.measure||!n.singleStaff?(console.error("缺少必要的参数,坐标计算出错"),{}):{left:a.value+"px",height:n.measureHeight+"px",width:i.value+"px",top:l.value+"px",pointEvents:" none"});r.computed(()=>ue(n.msSymbol)),r.computed(()=>$(n.msSymbol,n.musicScore));const i=r.computed(()=>be(n.msSymbol,n.musicScore)),a=r.computed(()=>Re(n.msSymbol,n.msSymbolContainer,n.measure,n.singleStaff,n.musicScore,i.value,n.componentWidth)),l=r.computed(()=>ne(n.msSymbol,n.musicScore)),c=t;return(s,m)=>{var d;return r.openBlock(),r.createElementBlock("div",{style:r.normalizeStyle(o.value),class:"msSymbolSlot p-stackItem"},[e.msSymbol?(r.openBlock(),r.createBlock(ct,{key:0,ref:"mainMsSymbolRef",componentHeight:e.componentHeight,componentWidth:e.componentWidth,containerWidth:e.containerWidth,isMain:!0,measure:e.measure,"measure-width":e.measureWidth,measureHeight:e.measureHeight,"ms-symbol":e.msSymbol,msSymbolContainer:n.msSymbolContainer,musicScore:n.musicScore,nextContainer:n.nextContainer?n.nextContainer:null,preContainer:n.preContainer?n.preContainer:null,"single-staff":e.singleStaff,"slot-left":a.value,"slot-width":i.value,slotTop:l.value,onMsSymbolMouseDown:m[0]||(m[0]=(h,u)=>c("msSymbolMouseDown",h,u)),onMsSymbolMouseUp:m[1]||(m[1]=(h,u)=>c("msSymbolMouseUp",h,u))},null,8,["componentHeight","componentWidth","containerWidth","measure","measure-width","measureHeight","ms-symbol","msSymbolContainer","musicScore","nextContainer","preContainer","single-staff","slot-left","slot-width","slotTop"])):r.createCommentVNode("",!0),(d=e.msSymbol)!=null&&d.msSymbolArray?(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:1},r.renderList(e.msSymbol.msSymbolArray,h=>(r.openBlock(),r.createBlock(ct,{componentHeight:e.componentHeight,componentWidth:e.componentWidth,containerWidth:e.containerWidth,isMain:!1,measure:e.measure,"measure-width":e.measureWidth,measureHeight:e.measureHeight,"ms-symbol":h,msSymbolContainer:n.msSymbolContainer,musicScore:n.musicScore,nextContainer:n.nextContainer?n.nextContainer:null,"parent-ms-symbol":e.msSymbol,preContainer:n.preContainer?n.preContainer:null,"single-staff":e.singleStaff,"slot-left":a.value,"slot-top":l.value,"slot-width":i.value,onMsSymbolMouseDown:m[2]||(m[2]=(u,f)=>c("msSymbolMouseDown",u,f)),onMsSymbolMouseUp:m[3]||(m[3]=(u,f)=>c("msSymbolMouseUp",u,f))},null,8,["componentHeight","componentWidth","containerWidth","measure","measure-width","measureHeight","ms-symbol","msSymbolContainer","musicScore","nextContainer","parent-ms-symbol","preContainer","single-staff","slot-left","slot-top","slot-width"]))),256)):r.createCommentVNode("",!0)],4)}}}),V0=G(F0,[["__scopeId","data-v-ad68dc2d"]]),Z0=r.defineComponent({__name:"msSymbolContainer",props:{msSymbolContainer:{type:Object,required:!0},preContainer:{type:Object},nextContainer:{type:Object},measureHeight:{type:Number,required:!0},measure:{type:Object,required:!0},measureWidth:{type:Number,required:!0},componentWidth:{type:Number,required:!0},componentHeight:{type:Number,required:!0},singleStaff:{type:Object,required:!0},multipleStaves:{type:Object,required:!0},musicScore:{type:Object,required:!0}},emits:["msSymbolMouseDown","msSymbolMouseUp"],setup(e,{emit:t}){const n=e,o=r.computed(()=>!n.msSymbolContainer||!n.measure||!n.singleStaff?(console.error("缺少必要的参数,坐标计算出错"),{}):{left:a.value+"px",height:n.measureHeight+"px",width:i.value+"px",bottom:"0px",pointerEvents:"none"}),i=r.computed(()=>E(n.msSymbolContainer,n.measure,n.singleStaff,n.musicScore,n.componentWidth)),a=r.computed(()=>ot(n.msSymbolContainer,n.measure,n.singleStaff,n.musicScore,n.measureWidth)),l=t;return(c,s)=>{var m;return r.openBlock(),r.createElementBlock("div",{style:r.normalizeStyle(o.value),class:"msSymbolContainer"},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList((m=e.msSymbolContainer)==null?void 0:m.msSymbolArray,d=>(r.openBlock(),r.createBlock(V0,{componentHeight:e.componentHeight,componentWidth:e.componentWidth,containerWidth:i.value,measure:n.measure,measureHeight:n.measureHeight,measureWidth:n.measureWidth,msSymbol:d,msSymbolContainer:n.msSymbolContainer,multipleStaves:n.multipleStaves,musicScore:n.musicScore,nextContainer:n.nextContainer?n.nextContainer:null,preContainer:n.preContainer?n.preContainer:null,singleStaff:n.singleStaff,onMsSymbolMouseDown:(h,u)=>l("msSymbolMouseDown",h,u),onMsSymbolMouseUp:(h,u)=>l("msSymbolMouseUp",h,u)},null,8,["componentHeight","componentWidth","containerWidth","measure","measureHeight","measureWidth","msSymbol","msSymbolContainer","multipleStaves","musicScore","nextContainer","preContainer","singleStaff","onMsSymbolMouseDown","onMsSymbolMouseUp"]))),256))],4)}}}),O0=G(Z0,[["__scopeId","data-v-8d8f6d46"]]),Q0=["d"],q0=["x","y"],U0=r.defineComponent({__name:"volta",props:{volta:{type:Object,required:!0},position:{type:Object,default:()=>({startPoint:{x:0,y:0},endPoint:{x:0,y:0}})}},setup(e){const t=e,n=r.computed(()=>{var a,l,c,s;return{startPoint:{x:t.position.startPoint.x+((a=t.volta)==null?void 0:a.options.offset.startPoint.x),y:t.position.startPoint.y+((l=t.volta)==null?void 0:l.options.offset.startPoint.y)},endPoint:{x:t.position.endPoint.x+((c=t.volta)==null?void 0:c.options.offset.endPoint.x),y:t.position.endPoint.y+((s=t.volta)==null?void 0:s.options.offset.endPoint.y)}}}),o=r.computed(()=>{const{startPoint:a,endPoint:l}=n.value;a.y;const c=4;return`
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("vue");var ke=(e=>(e[e.Treble=1]="Treble",e[e.MezzoSoprano=2]="MezzoSoprano",e[e.Alto=3]="Alto",e[e.Tenor=4]="Tenor",e[e.BaritoneF=5]="BaritoneF",e[e.BaritoneC=6]="BaritoneC",e[e.Bass=7]="Bass",e[e.Subbass=8]="Subbass",e))(ke||{}),Pe=(e=>(e[e.standardStaff=1]="standardStaff",e[e.numberNotation=2]="numberNotation",e[e.rhythmNotation=3]="rhythmNotation",e[e.percussion=4]="percussion",e))(Pe||{});const Rt=["src"],Tt=r.defineComponent({__name:"measure",props:{measure:{type:Object,required:!0},x:{type:Number,default:0},y:{type:Number,default:0},width:{type:Number,default:400},height:{type:Number,default:80},componentWidth:{type:Number,default:1e3},componentHeight:{type:Number,default:800},strokeWidth:{type:Number,default:1},musicScore:{type:Object,default:{}}},emits:["measureMouseDown"],setup(e,{emit:t}){const n=e,{svgSkin:o,isOriginSkin:i}=r.inject("skin"),a=r.computed(()=>({width:"100%",display:"grid","grid-template-rows":"1fr","grid-template-columns":"1fr"})),l=r.computed(()=>{var d,h;switch(n.musicScore.showMode){case Pe.standardStaff:return(d=n.measure)!=null&&d.options.highlight?o.value.active_bar_standardStaff.url:o.value.bar_standardStaff.url;case Pe.numberNotation:return(h=n.measure)!=null&&h.options.highlight?o.value.active_bar_numberNotation.url:o.value.bar_numberNotation.url}return""}),c=r.computed(()=>{var h,u,f;return console.log("chicken"),{width:n.width+"px",height:n.height+"px","background-color":(h=n.measure)!=null&&h.options.highlight?(u=n.measure)==null?void 0:u.options.highlightColor:(f=n.measure)==null?void 0:f.options.color,mask:`url("${l.value}") no-repeat center`,"mask-size":"100% 100%",pointerEvents:"none"}}),s=t;function m(d){s("measureMouseDown",d,n.measure)}return(d,h)=>(r.openBlock(),r.createElementBlock("div",{style:r.normalizeStyle(a.value),class:"measure",onMousedown:r.withModifiers(m,["self"])},[r.unref(i)?(r.openBlock(),r.createElementBlock("div",{key:0,style:r.normalizeStyle(c.value)},null,4)):(r.openBlock(),r.createElementBlock("img",{key:1,src:l.value,style:r.normalizeStyle(c.value)},null,12,Rt))],36))}}),G=(e,t)=>{const n=e.__vccOpts||e;for(const[o,i]of t)n[o]=i;return n},jt=G(Tt,[["__scopeId","data-v-9f0fceab"]]);var O;(function(e){e[e.MultipStaves=1]="MultipStaves",e[e.SingleStaff=2]="SingleStaff",e[e.Measure=3]="Measure",e[e.SpanSymbol=4]="SpanSymbol",e[e.MsSymbolContainer=5]="MsSymbolContainer",e[e.MsSymbol=6]="MsSymbol"})(O||(O={}));var T;(function(e){e.Line="line",e.Space="space"})(T||(T={}));var M;(function(e){e.Lower="lower",e.Main="main",e.Upper="upper"})(M||(M={}));var S;(function(e){e[e.Treble=1]="Treble",e[e.MezzoSoprano=2]="MezzoSoprano",e[e.Alto=3]="Alto",e[e.Tenor=4]="Tenor",e[e.BaritoneF=5]="BaritoneF",e[e.BaritoneC=6]="BaritoneC",e[e.Bass=7]="Bass",e[e.Subbass=8]="Subbass"})(S||(S={}));var w;(function(e){e.Cb="Cb",e.Gb="Gb",e.Db="Db",e.Ab="Ab",e.Eb="Eb",e.Bb="Bb",e.F="F",e.C="C",e.G="G",e.D="D",e.A="A",e.E="E",e.B="B",e["F#"]="F#",e["C#"]="C#"})(w||(w={}));var L;(function(e){e[e.DO=1]="DO",e[e.RE=2]="RE",e[e.MI=3]="MI",e[e.FA=4]="FA",e[e.SOL=5]="SOL",e[e.LA=6]="LA",e[e.TI=7]="TI"})(L||(L={}));var z;(function(e){e.C="C",e.D="D",e.E="E",e.F="F",e.G="G",e.A="A",e.B="B"})(z||(z={}));var p;(function(e){e.None="",e.Natural="&",e.Sharp="#",e.Flat="b",e.DoubleSharp="##",e.DoubleFlat="bb"})(p||(p={}));var it;(function(e){e.None="",e.Single=".",e.Double="..",e.Triple="..."})(it||(it={}));var v;(function(e){e[e.whole=1]="whole",e[e.half=2]="half",e[e.quarter=4]="quarter",e[e.eighth=8]="eighth",e[e.sixteenth=16]="sixteenth",e[e.thirtySecond=32]="thirtySecond",e[e.sixtyFourth=64]="sixtyFourth",e[e.oneTwentyEighth=128]="oneTwentyEighth",e[e.twoFiftySixth=256]="twoFiftySixth"})(v||(v={}));var g;(function(e){e.NoteHead="noteHead",e.NoteStem="noteStem",e.NoteTail="noteTail",e.NoteNumber="noteNumber",e.ChronaxieReducingLine="chronaxieReducingLine",e.ChronaxieIncreasingLine="chronaxieIncreasingLine",e.NoteDot="noteDot",e.Rest="rest",e.Slur="slur",e.Tie="tie",e.DurationDot="durationDot",e.Accidental="accidental",e.Tuplet="tuplet",e.Clef="clef",e.Clef_f="clef_f",e.KeySignature="keySignature",e.TimeSignature="timeSignature",e.BarLine="barLine",e.BarLine_f="barLine_f"})(g||(g={}));var U;(function(e){e[e.standardStaff=1]="standardStaff",e[e.numberNotation=2]="numberNotation",e[e.rhythmNotation=3]="rhythmNotation",e[e.percussion=4]="percussion"})(U||(U={}));var P;(function(e){e[e.singleMeasure=1]="singleMeasure",e[e.multipleMeasure=2]="multipleMeasure"})(P||(P={}));var me;(function(e){e[e.volta=1]="volta",e[e.slur=2]="slur",e[e.tie=3]="tie"})(me||(me={}));var at;(function(e){e[e.msSymbol=1]="msSymbol",e[e.measure=2]="measure",e[e.singleStaff=3]="singleStaff",e[e.multipleStaves=4]="multipleStaves"})(at||(at={}));var R;(function(e){e[e.frontFixed=1]="frontFixed",e[e.rearFixed=2]="rearFixed",e[e.variable=3]="variable",e[e.span=4]="span"})(R||(R={}));var N;(function(e){e[e.single=1]="single",e[e.final=2]="final",e[e.reverseFinal=3]="reverseFinal",e[e.startRepeatSign=4]="startRepeatSign",e[e.endRepeatSign=5]="endRepeatSign"})(N||(N={}));var lt;(function(e){e[e.highlight=1]="highlight"})(lt||(lt={}));var Y;(function(e){e[e.normal=1]="normal",e[e.edit=2]="edit"})(Y||(Y={}));var te;(function(e){e[e.note=1]="note",e[e.rest=2]="rest"})(te||(te={}));var ze;(function(e){e[e.left=1]="left"})(ze||(ze={}));function Pt(e){return e>=v.eighth}function zt(e){return e!==v.whole}function ut(e,t){let n=p.None;if(!e.msSymbolArray)return{accidental:n,measureAccidental:p.None};const o=j(e.index,t),i=o.msSymbolContainer,a=o.measure,l=o.singleStaff,c=a==null?void 0:a.index.measureIndex,s=i==null?void 0:i.index.msSymbolContainerIndex;if(!i||!a||!l||s==null||c==null)return console.error("索引数据查找出错,获取符号的谱号失败"),{accidental:n,measureAccidental:p.None};let m=p.None;for(let d=c;d>=0;d--){const h=l.measureArray[d];if(d===c)for(let u=s;u>=0;u--){const y=h.msSymbolContainerArray[u].msSymbolArray[0];if(g.Accidental===y.type){m=y.accidental;break}}else for(let u=h.msSymbolContainerArray.length-1;u>=0;u--){const y=h.msSymbolContainerArray[u].msSymbolArray[0];if(g.Accidental===y.type){m=y.accidental;break}}}for(let d of e.msSymbolArray)if(d.type===g.Accidental)return n=d.accidental,{accidental:n,measureAccidental:m};return{accidental:n,measureAccidental:m}}function dt(e,t){const n=j(e.index,t),o=n.msSymbolContainer,i=n.measure,a=n.singleStaff,l=i==null?void 0:i.index.measureIndex,c=o==null?void 0:o.index.msSymbolContainerIndex;if(!o||!i||!a||c==null||l==null)return console.error("索引数据查找出错,获取符号的谱号失败"),w.C;for(let s=l;s>=0;s--){const m=a.measureArray[s];if(s===l)for(let d=c;d>=0;d--){const u=m.msSymbolContainerArray[d].msSymbolArray[0];if(g.KeySignature===u.type)return u.keySignature}else for(let d=m.msSymbolContainerArray.length-1;d>=0;d--){const u=m.msSymbolContainerArray[d].msSymbolArray[0];if(g.KeySignature===u.type)return u.keySignature}}return w.C}function Qe(e,t){const n=j(e.index,t),o=n.msSymbolContainer,i=n.measure,a=n.singleStaff,l=i==null?void 0:i.index.measureIndex,c=o==null?void 0:o.index.msSymbolContainerIndex;if(!o||!i||!a||c==null||l==null)return console.error("索引数据查找出错,获取符号的谱号失败"),S.Treble;for(let s=l;s>=0;s--){const m=a.measureArray[s];if(s===l)for(let d=c;d>=0;d--){const u=m.msSymbolContainerArray[d].msSymbolArray[0];if(g.Clef===u.type||g.Clef_f===u.type)return u.clef}else for(let d=m.msSymbolContainerArray.length-1;d>=0;d--){const u=m.msSymbolContainerArray[d].msSymbolArray[0];if(g.Clef===u.type||g.Clef_f===u.type)return u.clef}}return S.Treble}function Wt(e,{level:t="symbol",order:n="asc",callback:o}){const i=l=>n==="asc"?[...Array(l).keys()]:[...Array(l).keys()].reverse(),a=e.multipleStavesArray;for(const l of i(a.length)){const c=a[l];if(t==="multipleStaves"){if(o({multipleStavesIndex:l,singleStaffIndex:-1,measureIndex:-1,multipleStaves:c}))return;continue}for(const s of i(c.singleStaffArray.length)){const m=c.singleStaffArray[s];if(t==="singleStaff"){if(o({multipleStavesIndex:l,singleStaffIndex:s,measureIndex:-1,multipleStaves:c,singleStaff:m}))return;continue}for(const d of i(m.measureArray.length)){const h=m.measureArray[d];if(t==="measure"){if(o({multipleStavesIndex:l,singleStaffIndex:s,measureIndex:d,multipleStaves:c,singleStaff:m,measure:h}))return;continue}for(const u of i(h.msSymbolContainerArray.length)){const f=h.msSymbolContainerArray[u];if(t==="container"){if(o({multipleStavesIndex:l,singleStaffIndex:s,measureIndex:d,msSymbolContainerIndex:u,multipleStaves:c,singleStaff:m,measure:h,msSymbolContainer:f}))return;continue}for(const y of i(f.msSymbolArray.length)){const b=f.msSymbolArray[y];if(o({multipleStavesIndex:l,singleStaffIndex:s,measureIndex:d,msSymbolContainerIndex:u,msSymbolIndex:y,multipleStaves:c,singleStaff:m,measure:h,msSymbolContainer:f,msSymbol:b}))return}}}}}}function Ft(e,t,n,o){if(t.multipleStavesIndex==null||e.multipleStavesIndex==null||e.measureIndex==null||t.measureIndex==null||e.singleStaffIndex==null)return console.error("索引元素有误,无法正确执行traverseMeasure");const i=e.singleStaffIndex,a=j(e,n),l=j(t,n),c=a.singleStaff;l.singleStaff;const s=a.multipleStaves,m=l.multipleStaves;if(s===m){if(c==null||s==null)return console.error("索引元素有误,无法正确执行traverseMeasure");for(let d=e.measureIndex;d<=t.measureIndex;d++){const h=c.measureArray[d];o(h,c,s)}}else for(let d=e.multipleStavesIndex;d<=t.multipleStavesIndex;d++){const h=n.multipleStavesArray[d],u=h.singleStaffArray[i];if(s===h)for(let f=e.measureIndex;f<u.measureArray.length;f++){const y=u.measureArray[f];o(y,u,h)}else if(s!==h&&m!==h)for(let f=0;f<u.measureArray.length;f++){const y=u.measureArray[f];o(y,u,h)}else if(m===h&&s!==m)for(let f=0;f<t.measureIndex;f++){const y=u.measureArray[f];o(y,u,h)}}}function Vt(e){e.multipleStavesArray.forEach((t,n)=>{t.index={multipleStavesIndex:n,singleStaffIndex:-1,measureIndex:-1,msSymbolContainerIndex:-1,msSymbolIndex:-1},Zt(t)})}function Zt(e){const t=e.index.multipleStavesIndex;if(t==null)return console.error("数据有误,复谱表索引生成失败");e.singleStaffArray.forEach((n,o)=>{n.index={multipleStavesIndex:t,singleStaffIndex:o,measureIndex:-1,msSymbolContainerIndex:-1,msSymbolIndex:-1},mt(n)})}function mt(e){const t=e.index.singleStaffIndex,n=e.index.multipleStavesIndex;if(n==null||t==null)return console.error("数据有误,单谱表索引生成失败");e.measureArray.forEach((o,i)=>{o.index={multipleStavesIndex:n,singleStaffIndex:t,measureIndex:i,msSymbolContainerIndex:-1,msSymbolIndex:-1},Le(o)})}function Le(e){const t=e.index.singleStaffIndex,n=e.index.multipleStavesIndex,o=e.index.measureIndex;if(n==null||t==null||o==null)return console.error("数据有误,符号容器索引生成失败");e.msSymbolContainerArray.forEach((i,a)=>{i.index={multipleStavesIndex:n,singleStaffIndex:t,measureIndex:o,msSymbolContainerIndex:a,msSymbolIndex:-1},We(i)})}function We(e){const t=e.index.singleStaffIndex,n=e.index.multipleStavesIndex,o=e.index.measureIndex,i=e.index.msSymbolContainerIndex;if(n==null||t==null||o==null||i==null)return console.error("数据有误,符号索引生成失败");e.msSymbolArray.forEach((a,l)=>{const c={multipleStavesIndex:n,singleStaffIndex:t,measureIndex:o,msSymbolContainerIndex:i,msSymbolIndex:l};a.index=c,qe(a)})}function qe(e,t){let n=null;n=e,n.msSymbolArray.forEach((o,i)=>{o.index=n.index,o.msSymbolArray.length>0&&qe(o)})}function Ot(e){const t=e.map;for(let n=0;n<e.multipleStavesArray.length;n++){const o=e.multipleStavesArray[n];t[o.id]=o;for(let i=0;i<o.singleStaffArray.length;i++){const a=o.singleStaffArray[i];t[a.id]=a;for(let l=0;l<a.measureArray.length;l++){const c=a.measureArray[l];t[c.id]=c;for(let s=0;s<c.msSymbolContainerArray.length;s++){const m=c.msSymbolContainerArray[s];t[m.id]=m;for(let d=0;d<m.msSymbolArray.length;d++){const h=m.msSymbolArray[d];t[h.id]=h}}}}}}function Q(e){if(e.region===M.Main)return(e.index-1)*2+(e.type===T.Space?1:0);if(e.region===M.Lower)return-(e.index*2)+(e.type===T.Space?1:0);if(e.region===M.Upper)return 8+e.index*2+(e.type===T.Space?1:0);throw new Error("Invalid StaffRegion")}function Fe(e){if(e>=0&&e<=9){const t=e%2===0?T.Line:T.Space,n=Math.floor(e/2)+1,o=Math.floor(e/2)+1;return{region:M.Main,type:t,index:t===T.Line?n:o}}if(e<0){const t=Math.abs(e),n=t%2===0?T.Line:T.Space,o=Math.floor((t+1)/2);return{region:M.Lower,type:n,index:o}}if(e>=10){const t=e-10,n=t%2===0?T.Line:T.Space,o=Math.floor(t/2)+1;return{region:M.Upper,type:n,index:o}}throw new Error("Invalid index for StaffRegion")}function st(e){return typeof e=="number"?e<=3?"up":"down":Q(e)<=3?"up":"down"}function Ae(e,t){const n=t[e];if(n)return n;console.warn("此id元素不存在")}function j(e,t){const n={multipleStaves:null,singleStaff:null,measure:null,msSymbolContainer:null,msSymbol:null};if(e.multipleStavesIndex!==-1){const o=t.multipleStavesArray[e.multipleStavesIndex];if(n.multipleStaves=o,e.singleStaffIndex!==-1){const i=o.singleStaffArray[e.singleStaffIndex];if(n.singleStaff=i,e.measureIndex!==-1){const a=i.measureArray[e.measureIndex];if(n.measure=a,e.msSymbolContainerIndex!==-1){const l=a.msSymbolContainerArray[e.msSymbolContainerIndex];n.msSymbolContainer=l,e.msSymbolIndex!==-1&&(n.msSymbol=l.msSymbolArray[e.msSymbolIndex])}}}}return n}function Qt(e,t){const n=new Set;return e.bindingEndId.forEach(o=>{n.add(o)}),e.bindingStartId.forEach(o=>{n.add(o)}),e.msSymbolContainerArray.forEach((o,i)=>{o.msSymbolArray.forEach((a,l)=>{a.bindingEndId.forEach(c=>{n.add(c)}),a.bindingStartId.forEach(c=>{n.add(c)})})}),n}function Ue(e,t){let n=new Set;return e.measureArray.forEach(o=>{const i=Qt(o);n=new Set([...n,...i])}),n}function Ge(e,t){t.spanSymbolArray.forEach(n=>{e.has(n.id)&&(n.vueKey=Date.now())})}function xe(e,t){const n=j(e.index,t).msSymbol;return n||(console.error("获取主符号失败"),e)}function we(e,t){const n=[];return e===-1?[]:(t.msSymbolContainerArray.forEach(o=>{o.msSymbolArray.forEach(i=>{if(i.type===g.NoteHead&&i.beamId===e){const a={beamId:i.beamId,note:i,region:i.region,chronaxie:i.chronaxie};n.push(a)}})}),n)}function gt(e,t){e.id=t.id,e.bindingEndId=t.bindingEndId,e.bindingStartId=t.bindingStartId}function qt(e,t,n,o){if(!e||!t||!n)return;const i=e.index,a=t.index;Ut(i,a)>0;const l=n.multipleStavesArray,c=Math.min(i.multipleStavesIndex,a.multipleStavesIndex),s=Math.max(i.multipleStavesIndex,a.multipleStavesIndex);for(let m=c;m<=s;m++){const h=l[m].singleStaffArray,u=m===i.multipleStavesIndex?i.singleStaffIndex:0,f=m===a.multipleStavesIndex?a.singleStaffIndex:h.length-1;for(let y=u;y<=f;y++){const I=h[y].measureArray,A=m===i.multipleStavesIndex&&y===i.singleStaffIndex?i.measureIndex:0,x=m===a.multipleStavesIndex&&y===a.singleStaffIndex?a.measureIndex:I.length-1;for(let k=A;k<=x;k++){const _=I[k].msSymbolContainerArray,W=m===i.multipleStavesIndex&&y===i.singleStaffIndex&&k===i.measureIndex?i.msSymbolContainerIndex:0,V=m===a.multipleStavesIndex&&y===a.singleStaffIndex&&k===a.measureIndex?a.msSymbolContainerIndex:_.length-1;for(let q=W;q<=V;q++){const oe=_[q];o(oe)}}}}}function Ut(e,t){return e.multipleStavesIndex!==t.multipleStavesIndex?e.multipleStavesIndex-t.multipleStavesIndex:e.singleStaffIndex!==t.singleStaffIndex?e.singleStaffIndex-t.singleStaffIndex:e.measureIndex!==t.measureIndex?e.measureIndex-t.measureIndex:e.msSymbolContainerIndex-t.msSymbolContainerIndex}function F(e={}){const t={id:Math.random()*Date.now()+1,msTypeName:O.MsSymbol,index:{multipleStavesIndex:-1,singleStaffIndex:-1,measureIndex:-1,msSymbolContainerIndex:-1,msSymbolIndex:-1},options:{highlight:!1,highlightColor:"red",color:"black"},bindingStartId:[],bindingEndId:[],msSymbolArray:[],vueKey:Math.random()*Date.now()};switch(e.type){case g.NoteHead:{const n=e.region||{region:M.Main,type:T.Line,index:1};if(!e.chronaxie||![v.whole].includes(e.chronaxie)){const o=F({type:g.NoteStem,direction:st(Q(n))});t.msSymbolArray.push(o)}if(e.chronaxie&&![v.whole,v.half,v.quarter].includes(e.chronaxie)){const o=F({type:g.NoteTail,chronaxie:e.chronaxie||v.quarter,direction:st(n)});t.msSymbolArray.push(o)}return{...t,beamId:-1,type:g.NoteHead,region:n,chronaxie:e.chronaxie||v.quarter}}case g.NoteDot:return{...t,type:g.NoteDot,octave:e.octave??4};case g.NoteNumber:{e.chronaxie&&[v.whole,v.half].includes(e.chronaxie)&&(console.error("noteNumber的时值最大为四分音符"),e.chronaxie=v.quarter);const n={...t,type:g.NoteNumber,solmization:e.solmization||L.DO,chronaxie:e.chronaxie||v.quarter,octave:e.octave??4,beamId:-1};if(e.chronaxie&&![v.quarter].includes(e.chronaxie)){const o=F({type:g.ChronaxieReducingLine,chronaxie:e.chronaxie});t.msSymbolArray.push(o)}return n}case g.ChronaxieIncreasingLine:return{...t,type:g.ChronaxieIncreasingLine};case g.ChronaxieReducingLine:return{...t,type:g.ChronaxieReducingLine,chronaxie:e.chronaxie??v.eighth};case g.Rest:return{...t,type:g.Rest,chronaxie:e.chronaxie||v.quarter};case g.BarLine:{const n=e.barLineType??N.single;return N.endRepeatSign===n||N.startRepeatSign===n?{...t,type:g.BarLine,barLineType:n,loopCount:2}:{...t,type:g.BarLine,barLineType:n}}case g.BarLine_f:{const n=e.barLineType??N.single;return N.endRepeatSign===n||N.startRepeatSign===n?{...t,type:g.BarLine_f,barLineType:n,loopCount:2}:{...t,type:g.BarLine_f,barLineType:n}}case g.NoteStem:return{...t,direction:e.direction||"up",type:g.NoteStem};case g.NoteTail:return{...t,type:g.NoteTail,chronaxie:e.chronaxie||v.quarter,beamType:ze.left,direction:e.direction||"up"};case g.Clef_f:return{...t,type:g.Clef_f,clef:e.clef||S.Treble};case g.Clef:return{...t,type:g.Clef,clef:e.clef||S.Treble};case g.KeySignature:return{...t,type:g.KeySignature,keySignature:e.keySignature||w.C};case g.TimeSignature:return{...t,type:g.TimeSignature,timeSignature:e.timeSignature||{beat:1,chronaxie:4}};case g.Accidental:return{...t,type:g.Accidental,accidental:e.accidental||p.Sharp};default:return console.error("type不被识别,符号模版返回noteHead"),{...t,type:g.NoteHead,region:e.region||{region:M.Main,type:T.Line,index:1},chronaxie:e.chronaxie||v.quarter,beamId:-1}}}function _e(e={}){return{id:Math.random()*Date.now()+2,msSymbolArray:[],type:e.type||R.variable,index:{multipleStavesIndex:-1,singleStaffIndex:-1,measureIndex:-1,msSymbolContainerIndex:-1,msSymbolIndex:-1},bindingStartId:[],bindingEndId:[],options:{highlight:!1,highlightColor:"red",color:"transparent"},vueKey:Math.random()*Date.now(),msTypeName:O.MsSymbolContainer}}function $e(e,t){t.map[e.id]=e}function Ke(e,t){t.map[e]&&delete t.map[e]}function ge(e,t,n){t.msSymbolArray.push(e),qe(t),$e(e,n)}function he(e,t,n,o="after"){if(t.msTypeName===O.MsSymbol){if(typeof o=="number"){console.error("以符号为定位元素添加符号时,position只可以传after或before");return}const l=j(t.index,n).msSymbolContainer,c=j(t.index,n).msSymbol;if(!l)return console.error("符号容器不存在,符号添加失败");if(!c)return console.error("符号不存在,符号添加失败");const s=l.msSymbolArray,m=s.findIndex(d=>d===c);o==="before"?s.splice(m,0,e):s.splice(m+1,0,e),We(l)}else if(t.msTypeName===O.MsSymbolContainer){const l=t;if(!l)return console.error("小节不存在,符号容器添加失败");const c=l.msSymbolArray;if(o===-1||typeof o=="string")c.push(e);else if(o>=0&&o<=c.length)c.splice(o,0,e);else{console.error("索引有误,符号添加失败");return}We(l)}if($e(e,n),!("index"in t))return console.error("当前选中对象缺少index,符号添加失败");const i=j(t.index,n).singleStaff;if(!i)return console.error("单谱表查找出错,符号添加失败");mt(i);const a=Ue(i);Ge(a,n)}function ie(e,t,n,o="after"){if(t.msTypeName===O.MsSymbolContainer){if(typeof o=="number"){console.error("以符号容器为定位元素添加符号容器时,position只可以传after或before");return}const i=j(t.index,n).measure,a=j(t.index,n).msSymbolContainer;if(!i)return console.error("小节不存在,符号容器添加失败");if(!a)return console.error("符号容器不存在,符号容器添加失败");const l=i.msSymbolContainerArray,c=l.findIndex(s=>s===a);o==="before"?l.splice(c,0,e):l.splice(c+1,0,e),Le(i)}else if(t.msTypeName===O.Measure){const i=t;if(!i)return console.error("小节不存在,符号容器添加失败");const a=i.msSymbolContainerArray;if(o===-1||typeof o=="string")a.push(e);else if(o>=0&&o<=a.length)a.splice(o,0,e);else{console.error("索引有误,符号容器添加失败");return}Le(i)}$e(e,n)}function Gt(e,t){const n=j(e.index,t),o=n.measure,i=n.singleStaff;if(!o||!i)return console.error("索引数据出错,符号容器移除失败");const a=o.msSymbolContainerArray,l=a.findIndex(s=>s===e);if(l===-1)return console.error("找不到目标符号容器");a.splice(l,1),Ke(e.id,t),Le(o),Kt(e,t);const c=Ue(i);Ge(c,t)}function $t(e,t){for(let n=t.spanSymbolArray.length-1;n>=0;n--){const o=t.spanSymbolArray[n];(e.bindingStartId.includes(o.id)||e.bindingEndId.includes(o.id))&&(ht(o,t),Ke(o.id,t))}}function Kt(e,t){e.msSymbolArray.forEach(n=>{$t(n,t)});for(let n=t.spanSymbolArray.length-1;n>=0;n--){const o=t.spanSymbolArray[n];(e.bindingStartId.includes(o.id)||e.bindingEndId.includes(o.id))&&(ht(o,t),Ke(o.id,t))}}function ht(e,t){const n=t.spanSymbolArray.indexOf(e),o=e.startTargetId,i=e.endTargetId;t.spanSymbolArray.splice(n,1);const a=e.id,l=t.map[o];l&&"bindingStartId"in l&&l.bindingStartId.indexOf(a)!==-1&&l.bindingStartId.splice(n,1);const c=t.map[i];c&&"bindingEndId"in c&&c.bindingEndId.indexOf(a)!==-1&&c.bindingEndId.splice(n,1)}function Ve(e,t){t.direction=e,t.vueKey=Math.random()*Date.now()}function Ze(e,t){t.direction=e,t.vueKey=Math.random()*Date.now()}function Xt(e,t,n){const o=[];let i="up",a=4,l=!1;for(const c in t.msSymbolContainerArray){const s=t.msSymbolContainerArray[c];for(const m in s.msSymbolArray){const d=s.msSymbolArray[m];if(d.type===g.NoteHead&&![v.whole,v.half,v.quarter].includes(d.chronaxie)){const h=Math.abs(Q(d.region)-4),u=Math.abs(a-4);h>u&&(a=Q(d.region));const f=d.msSymbolArray.find(b=>b.type===g.NoteStem),y=d.msSymbolArray.find(b=>b.type===g.NoteTail);y&&f&&d.beamId===e&&(o.push({noteStem:f,noteTail:y}),l=!0)}else if(l)break}}i=a>=3?"down":"up";for(const c in o){const s=o[c].noteStem,m=o[c].noteTail;Ve(i,s),Ze(i,m)}}z.C,p.None,z.C,p.Sharp,z.D,p.None,z.D,p.Sharp,z.E,p.None,z.F,p.None,z.F,p.Sharp,z.G,p.None,z.G,p.Sharp,z.A,p.None,z.A,p.Sharp,z.B,p.None;const Jt={[w.Cb]:59,[w.Gb]:66,[w.Db]:61,[w.Ab]:68,[w.Eb]:63,[w.Bb]:70,[w.F]:65,[w.C]:60,[w.G]:67,[w.D]:62,[w.A]:69,[w.E]:64,[w.B]:71,"F#":66,"C#":61};function Et(e,t,n,o){const i=Jt[n];let l={[L.DO]:0,[L.RE]:2,[L.MI]:4,[L.FA]:5,[L.SOL]:7,[L.LA]:9,[L.TI]:11}[e];switch(t){case p.Sharp:l+=1;break;case p.Flat:l-=1;break;case p.DoubleSharp:l+=2;break;case p.DoubleFlat:l-=2;break;case p.None:break}return i+(o-4)*12+l}p.Natural,p.Sharp,p.Flat;p.Natural,p.Flat,p.Sharp;function Yt(e,t,n=p.Sharp){const o=["C","D","E","F","G","A","B"],i={0:["C",p.None],1:["C",p.Sharp],2:["D",p.None],3:["D",p.Sharp],4:["E",p.None],5:["F",p.None],6:["F",p.Sharp],7:["G",p.None],8:["G",p.Sharp],9:["A",p.None],10:["A",p.Sharp],11:["B",p.None]},a={0:["C",p.None],1:["D",p.Flat],2:["D",p.None],3:["E",p.Flat],4:["E",p.None],5:["F",p.None],6:["G",p.Flat],7:["G",p.None],8:["A",p.Flat],9:["A",p.None],10:["B",p.Flat],11:["B",p.None]},l=n===p.Sharp?i:a,c=(e%12+12)%12,[s,m]=l[c],d=Math.floor(e/12)-1,h=o.indexOf(s),u=d*7+h;function f(_,W){const V=o.indexOf(_);return W*7+V}const y={[S.Treble]:{diatonic:f("G",4),staffStep:2},[S.MezzoSoprano]:{diatonic:f("C",4),staffStep:2},[S.Alto]:{diatonic:f("C",4),staffStep:4},[S.Tenor]:{diatonic:f("C",4),staffStep:6},[S.BaritoneF]:{diatonic:f("F",3),staffStep:4},[S.BaritoneC]:{diatonic:f("C",4),staffStep:8},[S.Bass]:{diatonic:f("F",3),staffStep:6},[S.Subbass]:{diatonic:f("F",2),staffStep:6}},b=y[t]??y[S.Treble],I=u-b.diatonic+b.staffStep;let A,x,k;if(I>=0&&I<=8)A=M.Main,I%2===0?(x=T.Line,k=Math.floor(I/2)+1):(x=T.Space,k=Math.floor((I+1)/2));else if(I<0){A=M.Lower;const _=-I;_%2===1?(x=T.Space,k=Math.floor((_+1)/2)):(x=T.Line,k=_/2)}else{A=M.Upper;const _=I-8;_%2===1?(x=T.Space,k=Math.floor((_+1)/2)):(x=T.Line,k=_/2)}return{staffRegion:{region:A,type:x,index:k},accidental:m}}const e0={[S.Treble]:{[M.Main]:64,[M.Upper]:79,[M.Lower]:62},[S.MezzoSoprano]:{[M.Main]:57,[M.Upper]:72,[M.Lower]:55},[S.Alto]:{[M.Main]:53,[M.Upper]:69,[M.Lower]:52},[S.Tenor]:{[M.Main]:50,[M.Upper]:65,[M.Lower]:48},[S.BaritoneF]:{[M.Main]:47,[M.Upper]:62,[M.Lower]:45},[S.BaritoneC]:{[M.Main]:53,[M.Upper]:62,[M.Lower]:52},[S.Bass]:{[M.Main]:43,[M.Upper]:60,[M.Lower]:41},[S.Subbass]:{[M.Main]:28,[M.Upper]:43,[M.Lower]:26}},t0=[2,2,1,2,2,2,1],n0={0:0,2:1,4:2,5:3,7:4,9:5,11:6};function o0(e,t){return t=(t%e.length+e.length)%e.length,e.slice(t).concat(e.slice(0,t))}function r0(e,t,n){const o=e0[n];if(!o||typeof o[M.Main]!="number")throw new Error(`No clef mapping for clef ${n}. please add clefMidiMap entry.`);const i=o[M.Main],{region:a,type:l,index:c}=e;if(c<1)throw new Error("StaffRegion.index should be >= 1");let s;if(a===M.Main)s=(c-1)*2+(l===T.Space?1:0);else if(a===M.Upper)s=8+(c-1)*2+(l===T.Space?1:2);else if(a===M.Lower)s=-((c-1)*2+(l===T.Space?1:2));else throw new Error("Unknown StaffRegionEnum: "+a);const m=(i%12+12)%12;let d=n0[m];d===void 0&&(d=0);const h=o0(t0,d);let u=0;if(s>0)for(let y=0;y<s;y++)u+=h[y%h.length];else if(s<0){const y=Math.abs(s);for(let b=0;b<y;b++)(h.length-1-b)%h.length,u-=h[(h.length-1-b%7)%h.length]}let f=0;switch(t){case p.Sharp:f=1;break;case p.Flat:f=-1;break;case p.DoubleSharp:f=2;break;case p.DoubleFlat:f=-2;break;default:f=0}return i+u+f}p.Natural,p.Sharp,p.Flat;p.Natural,p.Flat,p.Sharp;const i0={[w.Cb]:59,[w.Gb]:66,[w.Db]:61,[w.Ab]:68,[w.Eb]:63,[w.Bb]:70,[w.F]:65,[w.C]:60,[w.G]:67,[w.D]:62,[w.A]:69,[w.E]:64,[w.B]:71,"F#":66,"C#":61},a0={0:{sharp:{solmization:L.DO,accidental:p.None},flat:{solmization:L.DO,accidental:p.None}},1:{sharp:{solmization:L.DO,accidental:p.Sharp},flat:{solmization:L.RE,accidental:p.Flat}},2:{sharp:{solmization:L.RE,accidental:p.None},flat:{solmization:L.RE,accidental:p.None}},3:{sharp:{solmization:L.RE,accidental:p.Sharp},flat:{solmization:L.MI,accidental:p.Flat}},4:{sharp:{solmization:L.MI,accidental:p.None},flat:{solmization:L.MI,accidental:p.None}},5:{sharp:{solmization:L.FA,accidental:p.None},flat:{solmization:L.FA,accidental:p.None}},6:{sharp:{solmization:L.FA,accidental:p.Sharp},flat:{solmization:L.SOL,accidental:p.Flat}},7:{sharp:{solmization:L.SOL,accidental:p.None},flat:{solmization:L.SOL,accidental:p.None}},8:{sharp:{solmization:L.SOL,accidental:p.Sharp},flat:{solmization:L.LA,accidental:p.Flat}},9:{sharp:{solmization:L.LA,accidental:p.None},flat:{solmization:L.LA,accidental:p.None}},10:{sharp:{solmization:L.LA,accidental:p.Sharp},flat:{solmization:L.TI,accidental:p.Flat}},11:{sharp:{solmization:L.TI,accidental:p.None},flat:{solmization:L.TI,accidental:p.None}}};function l0(e,t,n=p.Sharp){const o=i0[t],i=e-o,a=(i%12+12)%12,l=Math.floor(i/12)+4,c=a0[a],s=n===p.Sharp?c.sharp:c.flat;return{solmization:s.solmization,accidental:s.accidental,octave:l}}function s0(e){e.showMode=U.numberNotation;for(let t=0;t<e.multipleStavesArray.length;t++){const n=e.multipleStavesArray[t];for(let o=0;o<n.singleStaffArray.length;o++){const i=n.singleStaffArray[o];for(let a=0;a<i.measureArray.length;a++){const l=i.measureArray[a];for(let c=0;c<l.msSymbolContainerArray.length;c++){const s=l.msSymbolContainerArray[c];for(let m=0;m<s.msSymbolArray.length;m++){const d=s.msSymbolArray[m];if(d.type===g.NoteHead){const h=F({type:g.NoteNumber,chronaxie:v.quarter});gt(h,d);const{accidental:u,measureAccidental:f}=ut(d,e);let y=u;f&&y===p.Natural&&(y=f);const b=Qe(d,e),I=dt(d,e),A=r0(d.region,y,b),x=l0(A,I);if(h.solmization=x.solmization,h.octave=x.octave,h.msSymbolArray=[],[v.whole,v.half,v.quarter].includes(d.chronaxie)||(h.chronaxie=d.chronaxie),s.msSymbolArray.splice(m,1),he(h,s,e,m),x.octave!==4){const k=F({type:g.NoteDot,octave:x.octave});ge(k,h,e)}if(![v.whole,v.half,v.quarter].includes(h.chronaxie)){const k=F({type:g.ChronaxieReducingLine,chronaxie:h.chronaxie});ge(k,h,e)}if(x.accidental){const k=F({type:g.Accidental,accidental:x.accidental});ge(k,h,e)}}if(d.type===g.NoteHead){if(d.chronaxie===v.whole){for(let h=0;h<3;h++){const u=F({type:g.ChronaxieIncreasingLine}),f=_e({type:R.variable});ie(f,s,e,"after"),he(u,f,e,"after")}c+=3}else if(d.chronaxie===v.half){const h=F({type:g.ChronaxieIncreasingLine}),u=_e({type:R.variable});ie(u,s,e,"after"),he(h,u,e,"after"),c+=1}}}}}}}}function c0(e){var t;for(let n=0;n<e.multipleStavesArray.length;n++){const o=e.multipleStavesArray[n];for(let i=0;i<o.singleStaffArray.length;i++){const a=o.singleStaffArray[i];for(let l=0;l<a.measureArray.length;l++){const c=a.measureArray[l];for(let s=0;s<c.msSymbolContainerArray.length;s++){const m=c.msSymbolContainerArray[s];for(let d=0;d<m.msSymbolArray.length;d++){const h=m.msSymbolArray[d];if(h.type===g.ChronaxieIncreasingLine){Gt(m,e),s--;continue}if(h.type===g.NoteNumber){const u=F({type:g.NoteHead});gt(u,h);const{accidental:f,measureAccidental:y}=ut(h,e);let b=f;y&&b===p.Natural&&(b=y);const I=Qe(h,e),A=dt(h,e),x=Et(h.solmization,b,A,h.octave),k=Yt(x,I);if(u.region=k.staffRegion,u.vueKey=Date.now(),u.msSymbolArray=[],h.chronaxie===v.quarter){let B=0;for(let _=s+1;_<c.msSymbolContainerArray.length&&((t=c.msSymbolContainerArray[_])==null?void 0:t.msSymbolArray[0]).type===g.ChronaxieIncreasingLine;_++)B++;B===0?u.chronaxie=v.quarter:B===1?u.chronaxie=v.half:B===3&&(u.chronaxie=v.whole)}else u.chronaxie=h.chronaxie;if(m.msSymbolArray.splice(d,1),he(u,m,e,d),k.accidental){const B=F({type:g.Accidental,accidental:k.accidental});ge(B,u,e)}if(zt(u.chronaxie)){const B=F({type:g.NoteStem});B.index=u.index,ge(B,u,e)}if(Pt(u.chronaxie)){const B=F({type:g.NoteTail,chronaxie:u.chronaxie});ge(B,u,e)}}}}}}}e.showMode=U.standardStaff}S.Treble+"",S.MezzoSoprano+"",S.Alto+"",S.Tenor+"",S.BaritoneF+"",S.BaritoneC+"",S.Bass+"",S.Subbass+"";p.Natural,p.Sharp,p.Flat;p.Natural,p.Flat,p.Sharp;function u0(e,t=p.Sharp){const n=e%12,o=Math.floor(e/12)-1,a=(t===p.Sharp?["C","C#","D","D#","E","F","F#","G","G#","A","A#","B"]:["C","Db","D","Eb","E","F","Gb","G","Ab","A","Bb","B"])[n];return{letter:a[0],accidental:a[1]??"",octave:o}}console.log(u0(12));z.C+"",z.D+"",z.E+"",z.F+"",z.G+"",z.A+"",z.B+"";p.None+"",p.Sharp+"",p.Flat+"",p.DoubleFlat+"",p.DoubleSharp+"";const d0={[w.Cb]:11,[w.Gb]:6,[w.Db]:1,[w.Ab]:8,[w.Eb]:3,[w.Bb]:10,[w.F]:5,[w.C]:0,[w.G]:7,[w.D]:2,[w.A]:9,[w.E]:4,[w.B]:11,[w["F#"]]:6,[w["C#"]]:1},Z={[g.NoteHead]:{containerType:R.variable,aspectRatio:1,widthRatioConstant:1,category:P.singleMeasure,heightMultiplier:.25,space:{top:0,bottom:0,left:0,right:0}},[g.NoteNumber]:{containerType:R.variable,aspectRatio:1,widthRatioConstant:1,category:P.singleMeasure,heightMultiplier:1,space:{top:0,bottom:0,left:0,right:0}},[g.NoteDot]:{aspectRatio:{0:1/.7,1:1/.5,2:1/.3,3:1/.1,5:1/.1,6:1/.3,7:1/.5,8:1/.7},category:P.singleMeasure,widthRatioConstant:0,heightMultiplier:{0:.7,1:.5,2:.3,3:.1,5:.1,6:.3,7:.5,8:.7},space:{top:.1,bottom:.1,left:0,right:0}},[g.ChronaxieIncreasingLine]:{containerType:R.variable,aspectRatio:5,widthRatioConstant:1,category:P.singleMeasure,heightMultiplier:.1,space:{top:0,bottom:0,left:0,right:0}},[g.ChronaxieReducingLine]:{aspectRatio:{[v.eighth]:1/.1,[v.sixteenth]:1/.15,[v.thirtySecond]:1/.2,[v.sixtyFourth]:1/.25},category:P.singleMeasure,widthRatioConstant:0,heightMultiplier:{[v.eighth]:.1,[v.sixteenth]:.15,[v.thirtySecond]:.2,[v.sixtyFourth]:.25},space:{top:0,bottom:.1,left:0,right:0}},[g.NoteStem]:{aspectRatio:.05,category:P.singleMeasure,widthRatioConstant:0,heightMultiplier:.75,space:{top:0,bottom:0,left:0,right:0}},[g.NoteTail]:{aspectRatio:{[v.eighth]:4/10,[v.sixteenth]:4/10,[v.thirtySecond]:4/15,[v.sixtyFourth]:4/15,[v.oneTwentyEighth]:4/15,[v.twoFiftySixth]:4/20},category:P.singleMeasure,widthRatioConstant:0,heightMultiplier:.5,space:{top:0,bottom:0,left:0,right:0}},[g.Rest]:{containerType:R.variable,aspectRatio:{[v.whole]:2,[v.half]:2,[v.quarter]:4/10,[v.eighth]:1/2,[v.sixteenth]:1/2,[v.thirtySecond]:5/12,[v.sixtyFourth]:5/14,[v.oneTwentyEighth]:5/14,[v.twoFiftySixth]:5/14},widthRatioConstant:1,category:P.singleMeasure,heightMultiplier:{[v.whole]:1/8,[v.half]:1/8,[v.quarter]:.75,[v.eighth]:.5,[v.sixteenth]:3/4,[v.thirtySecond]:1,[v.sixtyFourth]:5/4,[v.oneTwentyEighth]:6/4,[v.twoFiftySixth]:7/4},space:{top:0,bottom:0,left:0,right:0}},[g.Slur]:{category:P.multipleMeasure,space:{top:0,bottom:0,left:0,right:0}},[g.Tie]:{category:P.multipleMeasure,space:{top:0,bottom:0,left:0,right:0}},[g.DurationDot]:{aspectRatio:1,category:P.singleMeasure,widthRatioConstant:.5,heightMultiplier:.1,space:{top:0,bottom:0,left:0,right:0}},[g.Accidental]:{aspectRatio:{[p.None]:0,[p.Natural]:1/3,[p.Flat]:1/3,[p.Sharp]:1/3,[p.DoubleFlat]:2/3,[p.DoubleSharp]:2/3},category:P.singleMeasure,widthRatioConstant:.5,heightMultiplier:.4,space:{top:0,bottom:0,left:0,right:0}},[g.Tuplet]:{category:P.multipleMeasure,space:{top:0,bottom:0,left:0,right:0}},[g.Clef]:{containerType:R.rearFixed,aspectRatio:{[S.Treble]:.6,[S.Alto]:.5,[S.Bass]:1,[S.BaritoneC]:.5,[S.Tenor]:.5,[S.BaritoneF]:.5,[S.MezzoSoprano]:.5,[S.Subbass]:.5},category:P.singleMeasure,heightMultiplier:{[S.Treble]:5/4,[S.Alto]:3/4,[S.Bass]:3/4,[S.BaritoneC]:3/4,[S.Tenor]:3/4,[S.BaritoneF]:3/4,[S.MezzoSoprano]:3/4,[S.Subbass]:3/4},space:{top:0,bottom:0,left:0,right:0}},[g.Clef_f]:{containerType:R.frontFixed,aspectRatio:{[S.Treble]:.6,[S.Alto]:.5,[S.Bass]:1,[S.BaritoneC]:.5,[S.Tenor]:.5,[S.BaritoneF]:.5,[S.MezzoSoprano]:.5,[S.Subbass]:.5},category:P.singleMeasure,heightMultiplier:{[S.Treble]:6/4,[S.Alto]:1,[S.Bass]:1,[S.BaritoneC]:1,[S.Tenor]:1,[S.BaritoneF]:1,[S.MezzoSoprano]:1,[S.Subbass]:1},space:{top:0,bottom:0,left:0,right:0}},[g.TimeSignature]:{containerType:R.frontFixed,aspectRatio:.6,category:P.singleMeasure,heightMultiplier:1,space:{top:0,bottom:0,left:0,right:0}},[g.KeySignature]:{containerType:R.frontFixed,aspectRatio:{[w.Cb]:.3*7,[w.Gb]:.3*6,[w.Db]:.3*5,[w.Ab]:.3*4,[w.Eb]:.3*3,[w.Bb]:.3*2,[w.F]:.3,[w.C]:0,[w.G]:.3,[w.D]:.3*2,[w.A]:.3*3,[w.E]:.3*4,[w.B]:.3*5,[w["F#"]]:.3*6,[w["C#"]]:.3*7},category:P.singleMeasure,heightMultiplier:1,space:{top:0,bottom:0,left:0,right:0}},[g.BarLine]:{containerType:R.rearFixed,aspectRatio:{[N.single]:1/50,[N.final]:13/40,[N.reverseFinal]:13/40,[N.startRepeatSign]:13/40,[N.endRepeatSign]:13/40},category:P.singleMeasure,heightMultiplier:1,space:{top:0,bottom:0,left:0,right:0}},[g.BarLine_f]:{containerType:R.frontFixed,aspectRatio:{[N.single]:1/50,[N.final]:13/40,[N.reverseFinal]:13/40,[N.startRepeatSign]:13/40,[N.endRepeatSign]:13/40},category:P.singleMeasure,heightMultiplier:1,space:{top:0,bottom:0,left:0,right:0}}};function ft(e){let t=0;const n=Z[e.type];if(!n)return console.error("符号没有匹配到正确的information",e),t;if("widthRatioConstant"in n&&(t+=n.widthRatioConstant),e.msSymbolArray)for(let o=0;o<e.msSymbolArray.length;o++){const i=e.msSymbolArray[o],a=Z[i.type];if(!n)return console.error("子符号没有匹配到正确的information",i),t;"widthRatioConstant"in a&&(t+=a.widthRatioConstant)}return t}function Xe(e){let t=0;if(e.msSymbolArray)for(let n=0;n<e.msSymbolArray.length;n++){const o=e.msSymbolArray[n],i=ft(o);t<i&&(t=i)}return t}function le(e,t){let n=0;for(let o=0;o<e.msSymbolContainerArray.length;o++){const i=e.msSymbolContainerArray[o];if(t&&i===t)return n;n+=Xe(i)}return n===0?1:n}function pt(e,t,n){let o=0;for(let i=0;i<e.measureArray.length;i++){const a=e.measureArray[i];o+=le(a,n)}return o}const m0=Object.freeze(Object.defineProperty({__proto__:null,getWidthConstantInMeasure:le,getWidthConstantInMsSymbol:ft,getWidthConstantInMsSymbolContainer:Xe,getWidthConstantInSingleStaff:pt},Symbol.toStringTag,{value:"Module"}));function g0(e){const t=Z[e.type];if("aspectRatio"in t&&typeof t.aspectRatio=="object"){if(e.type===g.KeySignature)return t.aspectRatio[e.keySignature];if(e.type===g.BarLine||e.type===g.BarLine_f)return t.aspectRatio[e.barLineType];if(e.type===g.NoteTail)return t.aspectRatio[e.chronaxie];if(e.type===g.NoteDot)return t.aspectRatio[e.octave];if(e.type===g.ChronaxieReducingLine)return t.aspectRatio[e.chronaxie];if(e.type===g.Clef||e.type===g.Clef_f)return t.aspectRatio[e.clef];if(e.type===g.Accidental)return t.aspectRatio[e.accidental];if(e.type===g.Rest)return t.aspectRatio[e.chronaxie]}return console.error("符号有误或符号不是复合aspectRatio类型"),0}function ue(e){if(!(e!=null&&e.type))return console.error("缺少符号传参,宽高比获取失败"),1;const t=Z[e.type];return"aspectRatio"in t&&typeof t.aspectRatio=="number"?t.aspectRatio:"aspectRatio"in t&&typeof t.aspectRatio=="object"?g0(e):(console.error("未找到符号对应宽高比"),1)}function h0(e){const t=Z[e.type];if("heightMultiplier"in t&&typeof t.heightMultiplier=="object"){if(e.type===g.ChronaxieReducingLine)return t.heightMultiplier[e.chronaxie];if(e.type===g.NoteDot)return t.heightMultiplier[e.octave];if(e.type===g.Rest)return t.heightMultiplier[e.chronaxie];if(e.type===g.Clef_f||e.type===g.Clef)return t.heightMultiplier[e.clef]}return console.error("符号有误或符号不是复合heightMultiplier类型"),0}function De(e){if(!(e!=null&&e.type))return console.error("缺少符号传参,高度乘数获取失败"),1;const t=Z[e.type];return"heightMultiplier"in t&&typeof t.heightMultiplier=="number"?t.heightMultiplier:"heightMultiplier"in t&&typeof t.heightMultiplier=="object"?h0(e):1}function ve(e,t){const n=Z[e.type],o=t.measureHeight;return{top:n.space.top*o,bottom:n.space.bottom*o,left:n.space.left*o,right:n.space.right*o}}const f0=Object.freeze(Object.defineProperty({__proto__:null,getHeightMultiplier:De,getMsSymbolAspectRatio:ue,getSpace:ve},Symbol.toStringTag,{value:"Module"}));function Je(e,t){return t*((7-Q(e))*2)/16}function He(e,t){const n=j(e.index,t).msSymbol,o=t.measureHeight;switch(e==null?void 0:e.type){case g.NoteStem:return e.direction==="up"?-$(e,t)+o/8:o/8;case g.Rest:switch(e.chronaxie){case v.whole:return o/4;case v.half:return o*3/8;case v.quarter:return o*1/8;case v.eighth:return o*2/8;case v.sixteenth:return o*2/8;case v.thirtySecond:return 0;case v.sixtyFourth:return 0;case v.oneTwentyEighth:return 0;case v.twoFiftySixth:return 0;default:return 0}case g.NoteTail:{ne(e,t);const i=n==null?void 0:n.msSymbolArray.find(s=>s.type===g.NoteStem);if(!i)return console.error("找不到符杠,符尾bottom计算失败"),o;const a=o*1/8,l=$(e,t),c=$(i,t);return e.direction==="up"?-c+a:c+a-l}case g.NoteDot:{Z[g.NoteDot];const i=ve(e,t).bottom,a=ve(e,t).top,l=xe(e,t);let c=0;const s=l.msSymbolArray.find(d=>d.type===g.ChronaxieReducingLine);let m=0;if(s&&(m=ve(s,t).bottom,c=$(s,t)),[0,1,2,3].includes(e.octave)){const d=$(e,t);return o-(-d-i-c-m)}else if([5,6,7,8].includes(e.octave))return a;return o}case g.ChronaxieIncreasingLine:{const l=Z[g.ChronaxieIncreasingLine].heightMultiplier*o;return o+-(o/2-l/2)}case g.ChronaxieReducingLine:{Z[g.ChronaxieReducingLine];const i=De(e),a=ve(e,t).bottom,l=i*o;return o-(-l-a)}case g.Clef:switch(e.clef){case S.Treble:return-o*1/8;case S.Alto:return o*1/8;case S.Bass:return o*1/8;default:return o*1/8}case g.Clef_f:switch(e.clef){case S.Treble:return-o*2/8;case S.Alto:return 0;case S.Bass:return 0;default:return 0}default:return 0}}function ne(e,t){var i;if(!e)return 0;const n=t.measureHeight,o=(i=j(e.index,t))==null?void 0:i.msSymbol;switch(o.type){case g.NoteHead:{if(!o||t.showMode===U.numberNotation)return 0;const a=o.region;return Je(a,n)}default:return 0}}function yt(e,t,n=!0){let o=0;t.measureHeight;for(let i of e.msSymbolArray){const a=ne(i,t);n?o=Math.max(a,o):o=Math.max(a,o)}return o}function Ee(e,t){let n=1e4;for(let o of e.msSymbolArray){const i=ne(o,t);let a=0;if(o.msSymbolArray)for(let l of o.msSymbolArray)a=Math.min(a,He(l,t));n=Math.min(i+a,n)}return n}function vt(e,t,n){let o=1e4;return qt(e,t,n,i=>{const a=Ee(i,n);o=Math.min(o,a)}),o}function St(e,t,n=!0){let o=0;for(let i of e.msSymbolContainerArray){const a=yt(i,t,n);o=Math.max(a,o)}return o}function Ye(e,t){let n=1e4;for(let o of e.msSymbolContainerArray){const i=Ee(o,t);n=Math.min(i,n)}return n}function p0(e,t,n=!0){let o=0;for(let i of e.measureArray){const a=St(i,t,n);o=Math.max(a,o)}return o}function y0(e,t){let n=1e4;for(let o of e.measureArray){const i=Ye(o,t);n=Math.min(i,n)}return n}function et(e,t,n){let o=0;return Wt(t,{level:"multipleStaves",order:"asc",callback:({multipleStaves:i})=>{if(!i)return!0;o+=i.multipleStavesPaddingTop;for(let a of i.singleStaffArray){o+=a.singleStaffPaddingTop;for(let l of a.measureArray)if(l===e)return!0;o+=a.singleStaffPaddingBottom+a.singleStaffMarginBottom+t.measureHeight}return o+=i.multipleStavesPaddingBottom+i.multipleStavesMarginBottom,!1}}),o}const v0=Object.freeze(Object.defineProperty({__proto__:null,getMaxMsSymbolTopInMeasure:St,getMaxMsSymbolTopInMsSymbolContainer:yt,getMaxMsSymbolTopInSingleStaff:p0,getMeasureTopToMusicScore:et,getMinMsSymbolTopBetweenMsSymbolContainer:vt,getMinMsSymbolTopInMeasure:Ye,getMinMsSymbolTopInMsSymbolContainer:Ee,getMinMsSymbolTopInSingleStaff:y0,getMsSymbolTopToSlot:He,getSlotTopToMeasure:ne,staffRegionToTop:Je},Symbol.toStringTag,{value:"Module"}));function bt(e,t){const n=j(e.index,t).msSymbol,o=Z[e==null?void 0:e.type],i=t.measureHeight;let a=0;if("heightMultiplier"in o){const m=o.heightMultiplier;a=i*m}const l=i*1/8,c=j(n.index,t).measure;if(!c)return console.error("索引找不到measure,符杠height计算失败"),0;const s=we(n.beamId,c);if(n.beamId===-1||!s||s.length===0){const m=ne(e,t);return e.direction==="up"?Math.max(a,Math.abs(m)-(i-a)+l):Math.max(a,Math.abs(m)+a-l)}else{const m=ne(e,t);if(e.direction==="up"){const d=s.reduce((u,f)=>{const y=u,b=f.note;return Q(y.region)<Q(b.region)?f.note:u},s[0].note),h=ne(d,t);return Q(d.region)>0?d===n?a:Math.abs(m)-i+Math.abs(h-i)+a:Math.abs(m)-i+l+a}else{const d=s.reduce((u,f)=>{const y=u,b=f.note;return Q(y.region)>Q(b.region)?b:u},s[0].note),h=ne(d,t);return Q(d.region)<8?d===n?a:Math.abs(m)+h+a:Math.abs(m)-l+a}}}function $(e,t){Z[e==null?void 0:e.type];const n=t.measureHeight,o=De(e);switch(e.type){case g.NoteStem:return bt(e,t);default:return n*o}}const S0=Object.freeze(Object.defineProperty({__proto__:null,getMsSymbolHeight:$,getNoteStemHeight:bt},Symbol.toStringTag,{value:"Module"}));function Se(e,t){let n=0;for(let o=0;o<e.msSymbolArray.length;o++){const i=e.msSymbolArray[o],a=Z[i.type];let l=0;"aspectRatio"in a&&typeof a.aspectRatio=="number"?l+=a.aspectRatio*t:"aspectRatio"in a&&typeof a.aspectRatio=="object"?i.type===g.KeySignature?l+=a.aspectRatio[i.keySignature]*t:i.type===g.BarLine||i.type===g.BarLine_f?l+=a.aspectRatio[i.barLineType]*t:(i.type===g.Clef||i.type===g.Clef_f)&&(l+=a.aspectRatio[i.clef]*t):console.error("符号的svg宽高比不存在"),n<l&&(n=l)}return n}function E(e,t,n,o,i){const a=o.measureHeight;if(!e||!t)return console.error("缺少必要的参数,坐标计算出错"),0;let l=0;const c=e.type;if([R.frontFixed,R.rearFixed].includes(c))l=Se(e,a);else{const s=J(t,a),m=le(t),d=Xe(e);l=(se(t,n,o,i)-s)/m*d}return l}function se(e,t,n,o){const i=pt(t,n.showMode),a=le(e),l=xt(t,n.measureHeight),c=J(e,n.measureHeight),s=t.measureArray.length,m=o-l,d=m/i*n.widthDynamicRatio,h=m*(1-n.widthDynamicRatio)/s;return d*a+c+h}function J(e,t,n="all",o){let i=0;for(let a=0;a<e.msSymbolContainerArray.length;a++){const l=e.msSymbolContainerArray[a];if(o&&o===l)return i;const c=l.type;(n==="all"&&[R.frontFixed,R.rearFixed].includes(c)||n==="front"&&[R.frontFixed].includes(c)||n==="rear"&&[R.rearFixed].includes(c))&&(i+=Se(l,t))}return i}function xt(e,t,n="all",o){let i=0;return e.measureArray.forEach(a=>{i+=J(a,t,n,o)}),i}function tt(e,t,n,o,i,a,l){const c=ue(e),s=$(e,a),m=we(t.beamId,o);return m.length>1?t.id===m[0].note.id||t.id===m[m.length-1].note.id?E(n,o,i,a,l)/2:E(n,o,i,a,l):s*c}function fe(e,t,n,o,i,a){const l=i.measureHeight,c=ue(e),s=De(e),m=$(e,i);switch(e==null?void 0:e.type){case g.NoteStem:return l*s*c;case g.NoteTail:{const d=j(e.index,i).msSymbol;return d?tt(e,d,t,n,o,i,a):(console.error("音符头索引失败,符尾宽度计算失败"),m*c)}default:return m*c}}function be(e,t,n=!1){const o=n?e:xe(e,t),i=ue(o);return $(o,t)*i}const b0=Object.freeze(Object.defineProperty({__proto__:null,getMeasureWidth:se,getMsSymbolContainerWidth:E,getMsSymbolSlotWidth:be,getMsSymbolWidth:fe,getNoteTailWidth:tt,getWidthFixedContainerWidth:Se,getWidthFixedContainerWidthSumInMeasure:J,getWidthFixedContainerWidthSumInSingleStaff:xt},Symbol.toStringTag,{value:"Module"})),x0=["onMousedown"],w0=["onMousedown"],C0=r.defineComponent({__name:"measureContainer",props:{musicScore:{type:Object,default:{}},disabled:{type:Boolean,default:!0},componentWidth:{type:Number,default:1e3},height:{type:Number,default:800}},emits:["singleStaffMouseDown","multipleStavesMouseDown"],setup(e,{emit:t}){const n=e,o=t,i=r.computed(()=>s=>({"grid-template-rows":`repeat(${s.singleStaffArray.length},1fr)`,"padding-top":s.multipleStavesPaddingTop+"px","padding-bottom":s.multipleStavesPaddingBottom+"px","margin-bottom":s.multipleStavesMarginBottom+"px","pointer-events":n.disabled?"none":"auto",outline:"1px solid "+(s.options.highlight?s.options.highlightColor:s.options.color)})),a=r.computed(()=>(s,m)=>({"grid-template-columns":`repeat(${s.measureArray.length},1fr)`,"padding-top":s.singleStaffPaddingTop+"px","padding-bottom":s.singleStaffPaddingBottom+"px","margin-bottom":s.singleStaffMarginBottom+"px","pointer-events":n.disabled?"none":"auto",outline:"1px solid "+(s.options.highlight?s.options.highlightColor:s.options.color)})),l=r.computed(()=>(s,m,d,h,u)=>se(s,m,h,u)),c=r.computed(()=>(s,m,d,h,u)=>{let f={};return f.height=n.musicScore.measureHeight+"px",f.width=l.value(s,m,d,h,u)+"px",f.pointerEvents=n.disabled?"none":"auto",f});return(s,m)=>(r.openBlock(),r.createElementBlock("div",null,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.musicScore.multipleStavesArray,(d,h)=>(r.openBlock(),r.createElementBlock("div",{key:"multipleStaves"+h,style:r.normalizeStyle(i.value(d)),class:"multipleStaves",onMousedown:r.withModifiers(u=>o("multipleStavesMouseDown",u,d),["self"])},[r.renderSlot(s.$slots,"multipleStaves",{},void 0,!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(d.singleStaffArray,(u,f)=>(r.openBlock(),r.createElementBlock("div",{key:"singleStaff"+f,style:r.normalizeStyle(a.value(u,d)),class:"singleStaff",onMousedown:r.withModifiers(y=>o("singleStaffMouseDown",y,u),["self"])},[r.renderSlot(s.$slots,"singleStaff",{},void 0,!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(u.measureArray,(y,b)=>(r.openBlock(),r.createElementBlock("div",{key:"measure"+b,style:r.normalizeStyle(c.value(y,u,d,e.musicScore,e.componentWidth)),class:"measureSlot"},[r.renderSlot(s.$slots,"default",{measure:y,measureIndex:b,measureWidth:l.value(y,u,d,e.musicScore,e.componentWidth),multipleStaves:d,multipleStavesIndex:h,singleStaff:u,singleStaffIndex:f},void 0,!0)],4))),128))],44,w0))),128))],44,x0))),128))]))}}),je=G(C0,[["__scopeId","data-v-684eebdd"]]);function Be(e,t,n){const o=j(e.index,t);if(o.singleStaff==null)return console.error("没有单谱表信息,无法计算小节left"),0;let i=0;for(let a of o.singleStaff.measureArray){if(a===e)return i;i+=se(a,o.singleStaff,t,n)}return i}function wt(e,t,n,o,i,a,l,c,s){const m=a.measureHeight;if(!n||!o||!i)return console.error("数据索引有误,符尾left计算出错"),0;const d=fe(e,n,o,i,a,s),h=we(t.beamId,o),u=Z[g.NoteStem];if(!("aspectRatio"in u)||typeof u.aspectRatio!="number")return console.error("符杠aspectRatio获取失败,符尾left计算出错"),0;if(h.length>1)return t.id===h[0].note.id?e.direction==="up"?l:0:t.id===h[h.length-1].note.id?e.direction==="up"?-d+l:-d:-Re(t,n,o,i,a,l,s);if(e.direction==="up")return l;{const f=Z[g.NoteStem];if(!("aspectRatio"in f)||typeof f.aspectRatio!="number")return console.error("符杠aspectRatio获取失败,符杠left计算出错"),0;const y=f.heightMultiplier;return m*y*f.aspectRatio}}function nt(e,t,n,o,i,a,l,c,s=!1){const m=s?e:xe(e,i),d=be(e,i),h=fe(e,t,n,o,i,c);switch(e==null?void 0:e.type){case g.NoteHead:return 0;case g.NoteStem:return e.direction==="up"?d-h:0;case g.NoteTail:return m.type!==g.NoteHead?(console.error("找不到音符头,符尾left计算出错"),0):wt(e,m,t,n,o,i,d,l,c);case g.Accidental:return-h;case g.NoteDot:{const u=fe(e,t,n,o,i,c);return d/2-u/2}}return 0}function Re(e,t,n,o,i,a,l,c=!1){const s=c?e:xe(e,i),m=E(t,n,o,i,l);switch(i.measureHeight,s==null?void 0:s.type){case g.NoteHead:return m/2-a/2;case g.NoteNumber:return m/2-a/2;case g.Rest:return m/2-a/2;case g.ChronaxieIncreasingLine:return m/2-a/2}return 0}function ot(e,t,n,o,i){const a=o.measureHeight;if(!e||!t||!n)return console.error("缺少必要的参数,坐标计算出错"),0;let l=0;const c=e.type;if([R.frontFixed].includes(c))l=J(t,a,"front",e);else if([R.rearFixed].includes(c))l=i-J(t,a)+J(t,a,"all",e);else{const s=J(t,a),m=le(t),d=le(t,e),h=J(t,a,"front");l=(i-s)/m*d+h}return l}function Oe(e,t,n,o,i,a,l,c,s=!1){const m=s?e:xe(e,i),d=Re(m,t,n,o,i,a,c),h=ot(t,n,o,i,l);return d+h}const I0=Object.freeze(Object.defineProperty({__proto__:null,getContainerLeftToMeasure:ot,getMeasureLeftToMusicScore:Be,getMsSymbolLeftToSlot:nt,getNoteTailLeftToSlot:wt,getSlotLeftToContainer:Re,getSlotLeftToMeasure:Oe},Symbol.toStringTag,{value:"Module"})),M0=["src"],k0=r.defineComponent({__name:"noteTail",props:{noteTail:{type:Object,required:!0},noteHead:{type:Object,required:!0},preContainer:{type:Object},nextContainer:{type:Object},msSymbolContainer:{type:Object,required:!0},measure:{type:Object,required:!0},singleStaff:{type:Object,required:!0},musicScore:{type:Object,required:!0},parentMsSymbol:{type:Object},slotLeft:{type:Number,required:!0},measureWidth:{type:Number,required:!0},componentWidth:{type:Number,required:!0}},setup(e){const t=e,{svgSkin:n,isOriginSkin:o}=r.inject("skin"),i=r.computed(()=>we(t.noteHead.beamId,t.measure));r.computed(()=>ue(t.noteTail));const a=r.computed(()=>{var u;switch((u=t.noteTail)==null?void 0:u.chronaxie){case v.eighth:return 1;case v.sixteenth:return 2}return 0}),l=r.computed(()=>$(t.noteTail,t.musicScore)),c=r.computed(()=>t.noteTail.type===g.NoteTail&&t.nextContainer?tt(t.noteTail,t.noteHead,t.msSymbolContainer,t.measure,t.singleStaff,t.musicScore,t.componentWidth):fe(t.noteTail,t.msSymbolContainer,t.measure,t.singleStaff,t.musicScore,t.componentWidth)),s=r.computed(()=>{var f,y;const u={width:`${c.value}px`,height:`${l.value}px`,display:"flex",flexDirection:((f=t.noteTail)==null?void 0:f.direction)==="up"?"column":"column-reverse",position:"absolute",left:m.value+"px",top:d.value+"px",background:t.noteTail.options.highlight?t.noteTail.options.highlightColor:t.noteTail.options.color};return h.value&&i.value.length<2?(u.mask=`url("${h.value}") center center / cover no-repeat`,((y=t.noteTail)==null?void 0:y.direction)==="down"&&(u.transform="scaleY(-1)")):u.background="transparent",u}),m=r.computed(()=>nt(t.noteTail,t.msSymbolContainer,t.measure,t.singleStaff,t.musicScore,t.slotLeft,t.measureWidth,t.componentWidth)),d=r.computed(()=>He(t.noteTail,t.musicScore)),h=r.computed(()=>{switch(t.noteTail.chronaxie){case v.eighth:return t.noteTail.options.highlight?n.value.active_noteTail_8.url:n.value.noteTail_8.url;case v.sixteenth:return t.noteTail.options.highlight?n.value.active_noteTail_16.url:n.value.noteTail_16.url;case v.thirtySecond:return t.noteTail.options.highlight?n.value.active_noteTail_32.url:n.value.noteTail_32.url;case v.sixtyFourth:return t.noteTail.options.highlight?n.value.active_noteTail_64.url:n.value.noteTail_64.url;case v.oneTwentyEighth:return t.noteTail.options.highlight?n.value.active_noteTail_128.url:n.value.noteTail_128.url;case v.twoFiftySixth:return t.noteTail.options.highlight?n.value.active_noteTail_256.url:n.value.noteTail_256.url;default:return""}});return(u,f)=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[r.unref(o)?(r.openBlock(),r.createElementBlock("div",{key:0,style:r.normalizeStyle(s.value)},null,4)):(r.openBlock(),r.createElementBlock("img",{key:1,src:h.value,style:r.normalizeStyle(s.value)},null,12,M0)),i.value.length>1?(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:2},r.renderList(a.value*2-1,(y,b)=>(r.openBlock(),r.createElementBlock("div",{style:r.normalizeStyle({backgroundColor:b%2===0?"black":"transparent",height:l.value/5+"px",width:"100%"})},null,4))),256)):r.createCommentVNode("",!0)],64))}}),L0=r.defineComponent({__name:"timeSignature",props:{timeSignature:{type:Object,required:!0},measureHeight:{type:Number,default:60}},setup(e){const t=e,n=r.computed(()=>({fontSize:t.measureHeight/3+"px",userSelect:"none",color:t.timeSignature.options.highlight?t.timeSignature.options.highlightColor:t.timeSignature.options.color}));return(o,i)=>e.timeSignature&&e.timeSignature.type===r.unref(g).TimeSignature?(r.openBlock(),r.createElementBlock("div",{key:0,style:r.normalizeStyle(n.value),class:"timeSignature"},[r.createElementVNode("div",null,r.toDisplayString(e.timeSignature.timeSignature.beat),1),r.createElementVNode("div",null,r.toDisplayString(e.timeSignature.timeSignature.chronaxie),1)],4)):r.createCommentVNode("",!0)}}),A0=G(L0,[["__scopeId","data-v-74f3a255"]]),_0={key:0,class:"keySignature"},B0={key:1,class:"keySignature"},N0=["src"],D0=r.defineComponent({__name:"keySignature",props:{keySignature:{type:Object,required:!0},slotWidth:{type:Number,default:50},measureHeight:{type:Number,default:60},musicScore:{type:Object,default:{}}},setup(e){const t=e,{svgSkin:n,isOriginSkin:o}=r.inject("skin"),i=r.computed(()=>t.keySignature?Qe(t.keySignature,t.musicScore):S.Treble),a=r.computed(()=>{const u={Cb:{type:"flat",count:7},Gb:{type:"flat",count:6},Db:{type:"flat",count:5},Ab:{type:"flat",count:4},Eb:{type:"flat",count:3},Bb:{type:"flat",count:2},F:{type:"flat",count:1},C:{type:"none",count:0},G:{type:"sharp",count:1},D:{type:"sharp",count:2},A:{type:"sharp",count:3},E:{type:"sharp",count:4},B:{type:"sharp",count:5},"F#":{type:"sharp",count:6},"C#":{type:"sharp",count:7}};return t.keySignature.type===g.KeySignature?u[t.keySignature.keySignature]:(console.error("keySignature出错,没有keySignature属性",t.keySignature),u[w.C])}),l=r.computed(()=>{var u;return(u=t.keySignature)!=null&&u.options.highlight?a.value.type==="sharp"?n.value.active_accidental_sharp.url:n.value.active_accidental_flat.url:a.value.type==="sharp"?n.value.accidental_sharp.url:n.value.accidental_flat.url}),c=r.computed(()=>t.measureHeight/8),s={[S.Treble]:[8,5,9,6,3,7,4],[S.Alto]:[7,4,8,5,2,6,3],[S.Bass]:[6,3,7,4,1,5,2]},m={[S.Treble]:[5,8,4,7,3,6,2],[S.Alto]:[4,7,3,6,2,5,1],[S.Bass]:[3,6,2,5,1,4,0]},d=r.computed(()=>a.value.type==="sharp"?(s[i.value]||s[S.Treble]).slice(0,a.value.count).map(f=>f*c.value):a.value.type==="flat"?(m[i.value]||m[S.Treble]).slice(0,a.value.count).map(f=>f*c.value):[]),h=r.computed(()=>{const u=t.measureHeight*.5,f=t.measureHeight*.25;return(y,b)=>({width:u+"px",height:u+"px",position:"absolute",pointerEvents:"none",left:`${y*f}px`,top:`${t.measureHeight-b-u/2}px`,backgroundColor:t.keySignature.options.highlight?t.keySignature.options.highlightColor:t.keySignature.options.color,maskImage:`url("${l.value}")`,WebkitMaskImage:`url("${l.value}")`,maskRepeat:"no-repeat",WebkitMaskRepeat:"no-repeat",maskSize:"contain",WebkitMaskSize:"contain",maskPosition:"center",WebkitMaskPosition:"center"})});return(u,f)=>r.unref(o)?(r.openBlock(),r.createElementBlock("div",_0,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(d.value,(y,b)=>(r.openBlock(),r.createElementBlock("div",{key:b,style:r.normalizeStyle(h.value(b,y)),class:"symbol"},null,4))),128))])):(r.openBlock(),r.createElementBlock("div",B0,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(d.value,(y,b)=>(r.openBlock(),r.createElementBlock("img",{key:b,src:l.value,style:r.normalizeStyle(h.value(b,y)),class:"symbol"},null,12,N0))),128))]))}}),H0=G(D0,[["__scopeId","data-v-8485dd0d"]]),R0=["src"],T0=r.defineComponent({__name:"clef",props:{clef:{type:Object,required:!0},musicScore:{required:!0,type:Object}},setup(e){const t=e,{svgSkin:n,isOriginSkin:o}=r.inject("skin"),i=r.computed(()=>{let l="";return t.clef.clef===ke.Treble?l=n.value.clef_treble.url:t.clef.clef===ke.Alto?l=n.value.clef_alto.url:t.clef.clef===ke.Bass&&(l=n.value.clef_bass.url),l}),a=r.computed(()=>{var c,s,m;const l={};return o.value&&(l.mask=`url("${i.value}") center center / 100% 100% no-repeat`,l.backgroundColor=(c=t.clef)!=null&&c.options.highlight?(s=t.clef)==null?void 0:s.options.highlightColor:(m=t.clef)==null?void 0:m.options.color),l});return(l,c)=>r.unref(o)?(r.openBlock(),r.createElementBlock("div",{key:0,style:r.normalizeStyle(a.value),comment:"谱号"},null,4)):(r.openBlock(),r.createElementBlock("img",{key:1,src:i.value,comment:"谱号"},null,8,R0))}}),j0=["src"],P0=["src"],z0=["src"],W0=r.defineComponent({__name:"msSymbol",props:{msSymbol:{type:Object,required:!0},msSymbolContainer:{type:Object,required:!0},preContainer:{type:Object},nextContainer:{type:Object},measure:{type:Object,required:!0},measureWidth:{type:Number,required:!0},singleStaff:{type:Object,required:!0},musicScore:{type:Object,required:!0},containerWidth:{type:Number,required:!0},isMain:{type:Boolean,default:!1},measureHeight:{type:Number,required:!0},parentMsSymbol:{type:Object},slotWidth:{type:Number,required:!0},slotTop:{type:Number,required:!0},slotLeft:{type:Number,required:!0},componentWidth:{type:Number,required:!0},componentHeight:{type:Number,required:!0}},emits:["msSymbolMouseDown","msSymbolMouseUp"],setup(e,{expose:t,emit:n}){const o=e,{svgSkin:i,isOriginSkin:a}=r.inject("skin");r.watch(()=>{var x;return(x=o.msSymbol)==null?void 0:x.vueKey},()=>{l()});function l(){var x,k,B,_,W,V,q;switch((x=o.msSymbol)==null?void 0:x.type){case g.NoteHead:switch((k=o.msSymbol)==null?void 0:k.chronaxie){case v.whole:return o.msSymbol.options.highlight?i.value.active_noteHead_1.url:i.value.noteHead_1.url;case v.half:return o.msSymbol.options.highlight?i.value.active_noteHead_2.url:i.value.noteHead_2.url;case v.quarter:return o.msSymbol.options.highlight?i.value.active_noteHead_4.url:i.value.noteHead_4.url;default:return o.msSymbol.options.highlight?i.value.active_noteHead_4.url:i.value.noteHead_4.url}case g.Rest:switch((B=o.msSymbol)==null?void 0:B.chronaxie){case v.whole:return o.msSymbol.options.highlight?i.value.active_rest_1.url:i.value.rest_1.url;case v.half:return o.msSymbol.options.highlight?i.value.active_rest_2.url:i.value.rest_2.url;case v.quarter:return o.msSymbol.options.highlight?i.value.active_rest_4.url:i.value.rest_4.url;case v.eighth:return o.msSymbol.options.highlight?i.value.active_rest_8.url:i.value.rest_8.url;case v.sixteenth:return o.msSymbol.options.highlight?i.value.active_rest_16.url:i.value.rest_16.url;case v.thirtySecond:return o.msSymbol.options.highlight?i.value.active_rest_32.url:i.value.rest_32.url;case v.sixtyFourth:return o.msSymbol.options.highlight?i.value.active_rest_64.url:i.value.rest_64.url;case v.oneTwentyEighth:return o.msSymbol.options.highlight?i.value.active_rest_128.url:i.value.rest_128.url;case v.twoFiftySixth:return o.msSymbol.options.highlight?i.value.active_rest_256.url:i.value.rest_256.url;default:return o.msSymbol.options.highlight?i.value.active_rest_4.url:i.value.rest_4.url}case g.NoteStem:return o.msSymbol.options.highlight?i.value.active_noteStem.url:i.value.noteStem.url;case g.NoteTail:return"";case g.Clef:return"";case g.Clef_f:return"";case g.BarLine:{switch((_=o.msSymbol)==null?void 0:_.barLineType){case N.single:return o.msSymbol.options.highlight?i.value.active_barline_single.url:i.value.barline_single.url;case N.final:return o.msSymbol.options.highlight?i.value.active_barLine_final.url:i.value.barLine_final.url;case N.reverseFinal:return o.msSymbol.options.highlight?i.value.active_barline_reverseFinal.url:i.value.barline_reverseFinal.url;case N.startRepeatSign:return o.msSymbol.options.highlight?i.value.active_barline_startRepeatSign.url:i.value.barline_startRepeatSign.url;case N.endRepeatSign:return o.msSymbol.options.highlight?i.value.active_barLine_endRepeatSign.url:i.value.barLine_endRepeatSign.url}return""}case g.BarLine_f:{switch((W=o.msSymbol)==null?void 0:W.barLineType){case N.single:return o.msSymbol.options.highlight?i.value.active_barline_single.url:i.value.barline_single.url;case N.final:return o.msSymbol.options.highlight?i.value.activebarLine_final.url:i.value.barLine_final.url;case N.reverseFinal:return o.msSymbol.options.highlight?i.value.active_barline_reverseFinal.url:i.value.barline_reverseFinal.url;case N.startRepeatSign:return o.msSymbol.options.highlight?i.value.active_barline_startRepeatSign.url:i.value.barline_startRepeatSign.url;case N.endRepeatSign:return o.msSymbol.options.highlight?i.value.active_barLine_endRepeatSign.url:i.value.barLine_endRepeatSign.url}return console.error("未知的小节线类型",o.msSymbol),""}case g.KeySignature:return"";case g.TimeSignature:return"";case g.Accidental:{switch((V=o.msSymbol)==null?void 0:V.accidental){case p.Sharp:return o.msSymbol.options.highlight?i.value.active_accidental_sharp.url:i.value.accidental_sharp.url;case p.Flat:return o.msSymbol.options.highlight?i.value.active_accidental_flat.url:i.value.accidental_flat.url;case p.Natural:return o.msSymbol.options.highlight?i.value.active_accidental_nature.url:i.value.accidental_nature.url;case p.DoubleSharp:return o.msSymbol.options.highlight?i.value.active_accidental_doubleSharp.url:i.value.accidental_doubleSharp.url;case p.DoubleFlat:return o.msSymbol.options.highlight?i.value.active_accidental_doubleFlat.url:i.value.accidental_doubleFlat.url}return console.error("未知的变音符号",o.msSymbol),""}case g.NoteNumber:switch((q=o.msSymbol)==null?void 0:q.solmization){case L.DO:return o.msSymbol.options.highlight?i.value.active_number_1.url:i.value.number_1.url;case L.RE:return o.msSymbol.options.highlight?i.value.active_number_2.url:i.value.number_2.url;case L.MI:return o.msSymbol.options.highlight?i.value.active_number_3.url:i.value.number_3.url;case L.FA:return o.msSymbol.options.highlight?i.value.active_number_4.url:i.value.number_4.url;case L.SOL:return o.msSymbol.options.highlight?i.value.active_number_5.url:i.value.number_5.url;case L.LA:return o.msSymbol.options.highlight?i.value.active_number_6.url:i.value.number_6.url;case L.TI:return o.msSymbol.options.highlight?i.value.active_number_7.url:i.value.number_7.url;default:return o.msSymbol.options.highlight?i.value.active_number_1.url:i.value.number_1.url}case g.NoteDot:switch(o.msSymbol.octave){case 0:return i.value.noteDot_4.url;case 1:return i.value.noteDot_3.url;case 2:return i.value.noteDot_2.url;case 3:return i.value.noteDot_1.url;case 5:return i.value.noteDot_1.url;case 6:return i.value.noteDot_2.url;case 7:return i.value.noteDot_3.url;case 8:return i.value.noteDot_4.url;default:return""}case g.ChronaxieReducingLine:switch(o.msSymbol.chronaxie){case v.eighth:return i.value.chronaxieReducingLine_1.url;case v.sixteenth:return i.value.chronaxieReducingLine_2.url;case v.thirtySecond:return i.value.chronaxieReducingLine_3.url;case v.sixtyFourth:return i.value.chronaxieReducingLine_4.url;default:return""}case g.ChronaxieIncreasingLine:return o.msSymbol.options.highlight?i.value.active_chronaxieIncreasingLine.url:i.value.chronaxieIncreasingLine.url;default:return console.error("未知的符号类别",o.msSymbol),""}}const c=r.computed(()=>l()),s=r.ref(null),m=r.computed(()=>ue(o.msSymbol)),d=r.computed(()=>$(o.msSymbol,o.musicScore)),h=r.computed(()=>fe(o.msSymbol,o.msSymbolContainer,o.measure,o.singleStaff,o.musicScore,o.componentWidth)),u=r.computed(()=>nt(o.msSymbol,o.msSymbolContainer,o.measure,o.singleStaff,o.musicScore,o.slotLeft,o.measureWidth,o.componentWidth)),f=r.computed(()=>He(o.msSymbol,o.musicScore)),y=r.computed(()=>{var k;const x={width:`${h.value}px`,height:`${d.value}px`,position:"absolute",pointerEvents:"auto",left:u.value+"px",top:f.value+"px"};return(k=o.msSymbol)!=null&&k.type&&[g.KeySignature,g.TimeSignature,g.NoteTail].includes(o.msSymbol.type)&&(x.background="unset"),c.value&&a&&(x.mask=`url("${c.value}") no-repeat center`,x["mask-size"]="100% 100%",x.backgroundColor=o.msSymbol.options.highlight?o.msSymbol.options.highlightColor:o.msSymbol.options.color),x}),b=n;function I(x){b("msSymbolMouseDown",x,o.msSymbol)}function A(x){b("msSymbolMouseUp",x,o.msSymbol)}return r.onMounted(()=>{}),t({aspectRatio:m}),(x,k)=>{var B,_,W,V,q,oe,de;return((B=e.msSymbol)==null?void 0:B.type)===r.unref(g).Clef||((_=e.msSymbol)==null?void 0:_.type)===r.unref(g).Clef_f&&"clef"in e.msSymbol?r.withDirectives((r.openBlock(),r.createBlock(T0,{key:0,clef:e.msSymbol,musicScore:e.musicScore,style:r.normalizeStyle(y.value),onMouseup:r.withModifiers(A,["self"]),onMousedown:r.withModifiers(I,["self"])},null,8,["clef","musicScore","style"])),[[r.vShow,e.musicScore.showMode===r.unref(U).standardStaff]]):((W=e.msSymbol)==null?void 0:W.type)===r.unref(g).KeySignature?r.withDirectives((r.openBlock(),r.createBlock(H0,{key:1,keySignature:e.msSymbol,"measure-height":e.measureHeight,musicScore:e.musicScore,slotWidth:e.slotWidth,style:r.normalizeStyle(y.value),onMouseup:r.withModifiers(A,["self"]),onMousedown:r.withModifiers(I,["self"])},null,8,["keySignature","measure-height","musicScore","slotWidth","style"])),[[r.vShow,e.musicScore.showMode===r.unref(U).standardStaff]]):((V=e.msSymbol)==null?void 0:V.type)===r.unref(g).TimeSignature?r.withDirectives((r.openBlock(),r.createBlock(A0,{key:2,"measure-height":e.measureHeight,style:r.normalizeStyle(y.value),"time-signature":e.msSymbol,onMouseup:r.withModifiers(A,["self"]),onMousedown:r.withModifiers(I,["self"])},null,8,["measure-height","style","time-signature"])),[[r.vShow,e.musicScore.showMode===r.unref(U).standardStaff]]):((q=e.msSymbol)==null?void 0:q.type)===r.unref(g).NoteTail?r.withDirectives((r.openBlock(),r.createBlock(k0,{key:3,"component-width":e.componentWidth,measure:e.measure,"measure-width":e.measureWidth,"ms-symbol-container":e.msSymbolContainer,musicScore:e.musicScore,"next-container":e.nextContainer?e.nextContainer:null,noteHead:e.parentMsSymbol,noteTail:e.msSymbol,"pre-container":e.preContainer?e.preContainer:null,"single-staff":e.singleStaff,"slot-left":e.slotLeft},null,8,["component-width","measure","measure-width","ms-symbol-container","musicScore","next-container","noteHead","noteTail","pre-container","single-staff","slot-left"])),[[r.vShow,e.musicScore.showMode===r.unref(U).standardStaff]]):((oe=e.msSymbol)==null?void 0:oe.type)===r.unref(g).NoteStem&&r.unref(a)?r.withDirectives((r.openBlock(),r.createElementBlock("div",{key:4,ref_key:"msSymbolRef",ref:s,style:r.normalizeStyle(y.value),class:"msSymbol",onMouseup:r.withModifiers(A,["self"]),onMousedown:r.withModifiers(I,["self"])},null,36)),[[r.vShow,e.musicScore.showMode===r.unref(U).standardStaff]]):((de=e.msSymbol)==null?void 0:de.type)===r.unref(g).NoteStem?r.withDirectives((r.openBlock(),r.createElementBlock("img",{key:5,ref_key:"msSymbolRef",ref:s,src:c.value,style:r.normalizeStyle(y.value),class:"msSymbol",onMouseup:r.withModifiers(A,["self"]),onMousedown:r.withModifiers(I,["self"])},null,44,j0)),[[r.vShow,e.musicScore.showMode===r.unref(U).standardStaff]]):r.unref(a)?(r.openBlock(),r.createElementBlock("div",{key:6,ref_key:"msSymbolRef",ref:s,src:c.value,style:r.normalizeStyle(y.value),class:"msSymbol",onMouseup:r.withModifiers(A,["self"]),onMousedown:r.withModifiers(I,["self"])},null,44,P0)):(r.openBlock(),r.createElementBlock("img",{key:7,ref_key:"msSymbolRef",ref:s,src:c.value,style:r.normalizeStyle(y.value),class:"msSymbol",onMouseup:r.withModifiers(A,["self"]),onMousedown:r.withModifiers(I,["self"])},null,44,z0))}}}),ct=G(W0,[["__scopeId","data-v-f2b994c1"]]),F0=r.defineComponent({__name:"msSymbolSlot",props:{msSymbol:{type:Object,required:!0},msSymbolContainer:{type:Object,required:!0},preContainer:{type:Object},nextContainer:{type:Object},containerWidth:{type:Number,default:60,required:!0},measureHeight:{type:Number,default:60,required:!0},measure:{type:Object,required:!0},measureWidth:{type:Number,default:200,required:!0},componentWidth:{type:Number,default:1e3},componentHeight:{type:Number,default:800},singleStaff:{type:Object,required:!0},multipleStaves:{type:Object,required:!0},musicScore:{type:Object,default:{}}},emits:["msSymbolMouseDown","msSymbolMouseUp"],setup(e,{emit:t}){const n=e,o=r.computed(()=>!n.msSymbol||!n.measure||!n.singleStaff?(console.error("缺少必要的参数,坐标计算出错"),{}):{left:a.value+"px",height:n.measureHeight+"px",width:i.value+"px",top:l.value+"px",pointEvents:" none"});r.computed(()=>ue(n.msSymbol)),r.computed(()=>$(n.msSymbol,n.musicScore));const i=r.computed(()=>be(n.msSymbol,n.musicScore)),a=r.computed(()=>Re(n.msSymbol,n.msSymbolContainer,n.measure,n.singleStaff,n.musicScore,i.value,n.componentWidth)),l=r.computed(()=>ne(n.msSymbol,n.musicScore)),c=t;return(s,m)=>{var d;return r.openBlock(),r.createElementBlock("div",{style:r.normalizeStyle(o.value),class:"msSymbolSlot p-stackItem"},[e.msSymbol?(r.openBlock(),r.createBlock(ct,{key:0,ref:"mainMsSymbolRef",componentHeight:e.componentHeight,componentWidth:e.componentWidth,containerWidth:e.containerWidth,isMain:!0,measure:e.measure,"measure-width":e.measureWidth,measureHeight:e.measureHeight,"ms-symbol":e.msSymbol,msSymbolContainer:n.msSymbolContainer,musicScore:n.musicScore,nextContainer:n.nextContainer?n.nextContainer:null,preContainer:n.preContainer?n.preContainer:null,"single-staff":e.singleStaff,"slot-left":a.value,"slot-width":i.value,slotTop:l.value,onMsSymbolMouseDown:m[0]||(m[0]=(h,u)=>c("msSymbolMouseDown",h,u)),onMsSymbolMouseUp:m[1]||(m[1]=(h,u)=>c("msSymbolMouseUp",h,u))},null,8,["componentHeight","componentWidth","containerWidth","measure","measure-width","measureHeight","ms-symbol","msSymbolContainer","musicScore","nextContainer","preContainer","single-staff","slot-left","slot-width","slotTop"])):r.createCommentVNode("",!0),(d=e.msSymbol)!=null&&d.msSymbolArray?(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:1},r.renderList(e.msSymbol.msSymbolArray,h=>(r.openBlock(),r.createBlock(ct,{componentHeight:e.componentHeight,componentWidth:e.componentWidth,containerWidth:e.containerWidth,isMain:!1,measure:e.measure,"measure-width":e.measureWidth,measureHeight:e.measureHeight,"ms-symbol":h,msSymbolContainer:n.msSymbolContainer,musicScore:n.musicScore,nextContainer:n.nextContainer?n.nextContainer:null,"parent-ms-symbol":e.msSymbol,preContainer:n.preContainer?n.preContainer:null,"single-staff":e.singleStaff,"slot-left":a.value,"slot-top":l.value,"slot-width":i.value,onMsSymbolMouseDown:m[2]||(m[2]=(u,f)=>c("msSymbolMouseDown",u,f)),onMsSymbolMouseUp:m[3]||(m[3]=(u,f)=>c("msSymbolMouseUp",u,f))},null,8,["componentHeight","componentWidth","containerWidth","measure","measure-width","measureHeight","ms-symbol","msSymbolContainer","musicScore","nextContainer","parent-ms-symbol","preContainer","single-staff","slot-left","slot-top","slot-width"]))),256)):r.createCommentVNode("",!0)],4)}}}),V0=G(F0,[["__scopeId","data-v-a3db67c4"]]),Z0=r.defineComponent({__name:"msSymbolContainer",props:{msSymbolContainer:{type:Object,required:!0},preContainer:{type:Object},nextContainer:{type:Object},measureHeight:{type:Number,required:!0},measure:{type:Object,required:!0},measureWidth:{type:Number,required:!0},componentWidth:{type:Number,required:!0},componentHeight:{type:Number,required:!0},singleStaff:{type:Object,required:!0},multipleStaves:{type:Object,required:!0},musicScore:{type:Object,required:!0}},emits:["msSymbolMouseDown","msSymbolMouseUp"],setup(e,{emit:t}){const n=e,o=r.computed(()=>!n.msSymbolContainer||!n.measure||!n.singleStaff?(console.error("缺少必要的参数,坐标计算出错"),{}):{left:a.value+"px",height:n.measureHeight+"px",width:i.value+"px",bottom:"0px",pointerEvents:"none"}),i=r.computed(()=>E(n.msSymbolContainer,n.measure,n.singleStaff,n.musicScore,n.componentWidth)),a=r.computed(()=>ot(n.msSymbolContainer,n.measure,n.singleStaff,n.musicScore,n.measureWidth)),l=t;return(c,s)=>{var m;return r.openBlock(),r.createElementBlock("div",{style:r.normalizeStyle(o.value),class:"msSymbolContainer"},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList((m=e.msSymbolContainer)==null?void 0:m.msSymbolArray,d=>(r.openBlock(),r.createBlock(V0,{componentHeight:e.componentHeight,componentWidth:e.componentWidth,containerWidth:i.value,measure:n.measure,measureHeight:n.measureHeight,measureWidth:n.measureWidth,msSymbol:d,msSymbolContainer:n.msSymbolContainer,multipleStaves:n.multipleStaves,musicScore:n.musicScore,nextContainer:n.nextContainer?n.nextContainer:null,preContainer:n.preContainer?n.preContainer:null,singleStaff:n.singleStaff,onMsSymbolMouseDown:(h,u)=>l("msSymbolMouseDown",h,u),onMsSymbolMouseUp:(h,u)=>l("msSymbolMouseUp",h,u)},null,8,["componentHeight","componentWidth","containerWidth","measure","measureHeight","measureWidth","msSymbol","msSymbolContainer","multipleStaves","musicScore","nextContainer","preContainer","singleStaff","onMsSymbolMouseDown","onMsSymbolMouseUp"]))),256))],4)}}}),O0=G(Z0,[["__scopeId","data-v-0581bfa9"]]),Q0=["d"],q0=["x","y"],U0=r.defineComponent({__name:"volta",props:{volta:{type:Object,required:!0},position:{type:Object,default:()=>({startPoint:{x:0,y:0},endPoint:{x:0,y:0}})}},setup(e){const t=e,n=r.computed(()=>{var a,l,c,s;return{startPoint:{x:t.position.startPoint.x+((a=t.volta)==null?void 0:a.options.offset.startPoint.x),y:t.position.startPoint.y+((l=t.volta)==null?void 0:l.options.offset.startPoint.y)},endPoint:{x:t.position.endPoint.x+((c=t.volta)==null?void 0:c.options.offset.endPoint.x),y:t.position.endPoint.y+((s=t.volta)==null?void 0:s.options.offset.endPoint.y)}}}),o=r.computed(()=>{const{startPoint:a,endPoint:l}=n.value;a.y;const c=4;return`
2
2
  M ${a.x+c} ${l.y-c}
3
3
  L ${a.x+c} ${a.y+c}
4
4
  L ${l.x-c} ${a.y+c}
package/dist/index.es.js CHANGED
@@ -3277,7 +3277,7 @@ const Lr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3277
3277
  ], 4);
3278
3278
  };
3279
3279
  }
3280
- }), an = /* @__PURE__ */ oe(rn, [["__scopeId", "data-v-ad68dc2d"]]), ln = /* @__PURE__ */ K({
3280
+ }), an = /* @__PURE__ */ oe(rn, [["__scopeId", "data-v-a3db67c4"]]), ln = /* @__PURE__ */ K({
3281
3281
  __name: "msSymbolContainer",
3282
3282
  props: {
3283
3283
  msSymbolContainer: {
@@ -3359,7 +3359,7 @@ const Lr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3359
3359
  ], 4);
3360
3360
  };
3361
3361
  }
3362
- }), sn = /* @__PURE__ */ oe(ln, [["__scopeId", "data-v-8d8f6d46"]]), cn = ["d"], un = ["x", "y"], dn = /* @__PURE__ */ K({
3362
+ }), sn = /* @__PURE__ */ oe(ln, [["__scopeId", "data-v-0581bfa9"]]), cn = ["d"], un = ["x", "y"], dn = /* @__PURE__ */ K({
3363
3363
  __name: "volta",
3364
3364
  props: {
3365
3365
  volta: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deciphony-renderer",
3
- "version": "0.0.26",
3
+ "version": "0.0.28",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",