1(self.webpackChunkwheel_fortune_reyble=self.webpackChunkwheel_fortune_reyble||[]).push([[177],{1177:function(xe,ke,Ve){var pe,be=Ve(4323).default;pe=()=>(()=>{var ve={1710(dt,g,u){dt.exports=function l(s,c,r){function i(h,e){if(!c[h]){if(!s[h]){if(o)return o(h,!0);var f=new Error("Cannot find module '"+h+"'");throw f.code="MODULE_NOT_FOUND",f}var m=c[h]={exports:{}};s[h][0].call(m.exports,function(p){return i(s[h][1][p]||p)},m,m.exports,l,s,c,r)}return c[h].exports}for(var o=void 0,n=0;n<r.length;n++)i(r[n]);return i}({1:[function(l,s,c){"use strict";var r=l("./utils"),i=l("./support"),o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";c.encode=function(n){for(var h,e,f,p,E,y,d=[],S=0,M=n.length,x=M,_="string"!==r.getTypeOf(n);S<n.length;)x=M-S,f=_?(h=n[S++],e=S<M?n[S++]:0,S<M?n[S++]:0):(h=n.charCodeAt(S++),e=S<M?n.charCodeAt(S++):0,S<M?n.charCodeAt(S++):0),p=(3&h)<<4|e>>4,E=1<x?(15&e)<<2|f>>6:64,y=2<x?63&f:64,d.push(o.charAt(h>>2)+o.charAt(p)+o.charAt(E)+o.charAt(y));return d.join("")},c.decode=function(n){var h,e,f,m,p,E,y=0,d=0;if("data:"===n.substr(0,5))throw new Error("Invalid base64 input, it looks like a data url.");var M,x=3*(n=n.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(n.charAt(n.length-1)===o.charAt(64)&&x--,n.charAt(n.length-2)===o.charAt(64)&&x--,x%1!=0)throw new Error("Invalid base64 input, bad content length.");for(M=i.uint8array?new Uint8Array(0|x):new Array(0|x);y<n.length;)h=o.indexOf(n.charAt(y++))<<2|(m=o.indexOf(n.charAt(y++)))>>4,e=(15&m)<<4|(p=o.indexOf(n.charAt(y++)))>>2,f=(3&p)<<6|(E=o.indexOf(n.charAt(y++))),M[d++]=h,64!==p&&(M[d++]=e),64!==E&&(M[d++]=f);return M}},{"./support":30,"./utils":32}],2:[function(l,s,c){"use strict";var r=l("./external"),i=l("./stream/DataWorker"),o=l("./stream/Crc32Probe"),n=l("./stream/DataLengthProbe");function h(e,f,m,p,E){this.compressedSize=e,this.uncompressedSize=f,this.crc32=m,this.compression=p,this.compressedContent=E}h.prototype={getContentWorker:function(){var e=new i(r.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new n("data_length")),f=this;return e.on("end",function(){if(this.streamInfo.data_length!==f.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),e},getCompressedWorker:function(){return new i(r.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},h.createWorkerFrom=function(e,f,m){return e.pipe(new o).pipe(new n("uncompressedSize")).pipe(f.compressWorker(m)).pipe(new n("compressedSize")).withStreamInfo("compression",f)},s.exports=h},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(l,s,c){"use strict";var r=l("./stream/GenericWorker");c.STORE={magic:"\0\0",compressWorker:function(){return new r("STORE compression")},uncompressWorker:function(){return new r("STORE decompression")}},c.DEFLATE=l("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(l,s,c){"use strict";var r=l("./utils"),i=function(){for(var o,n=[],h=0;h<256;h++){o=h;for(var e=0;e<8;e++)o=1&o?3988292384^o>>>1:o>>>1;n[h]=o}return n}();s.exports=function(o,n){return void 0!==o&&o.length?"string"!==r.getTypeOf(o)?function(h,e,f){var m=i,p=0+f;h^=-1;for(var E=0;E<p;E++)h=h>>>8^m[255&(h^e[E])];return~h}(0|n,o,o.length):function(h,e,f){var m=i,p=0+f;h^=-1;for(var E=0;E<p;E++)h=h>>>8^m[255&(h^e.charCodeAt(E))];return~h}(0|n,o,o.length):0}},{"./utils":32}],5:[function(l,s,c){"use strict";c.base64=!1,c.binary=!1,c.dir=!1,c.createFolders=!0,c.date=null,c.compression=null,c.compressionOptions=null,c.comment=null,c.unixPermissions=null,c.dosPermissions=null},{}],6:[function(l,s,c){"use strict";var r;r=typeof Promise<"u"?Promise:l("lie"),s.exports={Promise:r}},{lie:37}],7:[function(l,s,c){"use strict";var r=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",i=l("pako"),o=l("./utils"),n=l("./stream/GenericWorker"),h=r?"uint8array":"array";function e(f,m){n.call(this,"FlateWorker/"+f),this._pako=null,this._pakoAction=f,this._pakoOptions=m,this.meta={}}c.magic="\b\0",o.inherits(e,n),e.prototype.processChunk=function(f){this.meta=f.meta,null===this._pako&&this._createPako(),this._pako.push(o.transformTo(h,f.data),!1)},e.prototype.flush=function(){n.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)}
vendor: 1,036 bytes, line 1
1,e.prototype.cleanUp=function(){n.prototype.cleanUp.call(this),this._pako=null},e.prototype._createPako=function(){this._pako=new i[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var f=this;this._pako.onData=function(m){f.push({data:m,meta:f.meta})}},c.compressWorker=function(f){return new e("Deflate",f)},c.uncompressWorker=function(){return new e("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(l,s,c){"use strict";function r(p,E){var y,d="";for(y=0;y<E;y++)d+=String.fromCharCode(255&p),p>>>=8;return d}function i(p,E,y,d,S,M){var x,_,I=p.file,T=p.compression,A=M!==h.utf8encode,v=o.transformTo("string",M(I.name)),B=o.transformTo("string",h.utf8encode(I.name)),D=I.comment,L=o.transformTo("string",M(D)),F=o.transformTo("string",h.utf8encode(D)),V=B.length!==I.name.length,j=F.length!==D.length,P="",U="",Y="",H=I.dir,Q=I.date,ot={crc32:0,compressedSize:0,uncompressedSize:0};E&&!y||(ot.crc32=p.crc32,ot.compressedSize=p.compressedSize,ot.uncompressedSize=p.uncompressedSize);var $=0;
vendor: 5,754 bytes, line 1
1E&&($|=8),A||!V&&!j||($|=2048);var N,O,it=0,nt=0;H&&(it|=16),"UNIX"===S?(nt=798,it|=(O=N=I.unixPermissions,N||(O=H?16893:33204),(65535&O)<<16)):(nt=20,it|=function(N){return 63&(N||0)}(I.dosPermissions)),x=Q.getUTCHours(),x<<=6,x|=Q.getUTCMinutes(),x<<=5,x|=Q.getUTCSeconds()/2,_=Q.getUTCFullYear()-1980,_<<=4,_|=Q.getUTCMonth()+1,_<<=5,_|=Q.getUTCDate(),V&&(U=r(1,1)+r(e(v),4)+B,P+="up"+r(U.length,2)+U),j&&(Y=r(1,1)+r(e(L),4)+F,P+="uc"+r(Y.length,2)+Y);var st="";return st+="\n\0",st+=r($,2),st+=T.magic,st+=r(x,2),st+=r(_,2),st+=r(ot.crc32,4),st+=r(ot.compressedSize,4),st+=r(ot.uncompressedSize,4),st+=r(v.length,2),st+=r(P.length,2),{fileRecord:f.LOCAL_FILE_HEADER+st+v+P,dirRecord:f.CENTRAL_FILE_HEADER+r(nt,2)+st+r(L.length,2)+"\0\0\0\0"+r(it,4)+r(d,4)+v+P+L}}var o=l("../utils"),n=l("../stream/GenericWorker"),h=l("../utf8"),e=l("../crc32"),f=l("../signature");function m(p,E,y,d){n.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=E,this.zipPlatform=y,this.encodeFileName=d,this.streamFiles=p,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}o.inherits(m,n),m.prototype.push=function(p){var E=p.meta.percent||0,y=this.entriesCount,d=this._sources.length;this.accumulate?this.contentBuffer.push(p):(this.bytesWritten+=p.data.length,n.prototype.push.call(this,{data:p.data,meta:{currentFile:this.currentFile,percent:y?(E+100*(y-d-1))/y:100}}))},m.prototype.openedSource=function(p){this.currentSourceOffset=this.bytesWritten,this.currentFile=p.file.name;var E=this.streamFiles&&!p.file.dir;if(E){var y=i(p,E,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:y.fileRecord,meta:{percent:0}})}else this.accumulate=!0},m.prototype.closedSource=function(p){this.accumulate=!1;var d,E=this.streamFiles&&!p.file.dir,y=i(p,E,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(y.dirRecord),E)this.push({data:(d=p,f.DATA_DESCRIPTOR+r(d.crc32,4)+r(d.compressedSize,4)+r(d.uncompressedSize,4)),meta:{percent:100}});else for(this.push({data:y.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},m.prototype.flush=function(){for(var p=this.bytesWritten,E=0;E<this.dirRecords.length;E++)this.push({data:this.dirRecords[E],meta:{percent:100}});var S,M,x,T,d=(S=this.dirRecords.length,M=this.bytesWritten-p,x=p,T=o.transformTo("string",(0,this.encodeFileName)(this.zipComment)),f.CENTRAL_DIRECTORY_END+"\0\0\0\0"+r(S,2)+r(S,2)+r(M,4)+r(x,4)+r(T.length,2)+T);this.push({data:d,meta:{percent:100}})},m.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},m.prototype.registerPrevious=function(p){this._sources.push(p);var E=this;return p.on("data",function(y){E.processChunk(y)}),p.on("end",function(){E.closedSource(E.previous.streamInfo),E._sources.length?E.prepareNextSource():E.end()}),p.on("error",function(y){E.error(y)}),this},m.prototype.resume=function(){return!!n.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},m.prototype.error=function(p){var E=this._sources;if(!n.prototype.error.call(this,p))return!1;for(var y=0;y<E.length;y++)try{E[y].error(p)}catch{}return!0},m.prototype.lock=function(){n.prototype.lock.call(this);for(var p=this._sources,E=0;E<p.length;E++)p[E].lock()},s.exports=m},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(l,s,c){"use strict";var r=l("../compressions"),i=l("./ZipFileWorker");c.generateWorker=function(o,n,h){var e=new i(n.streamFiles,h,n.platform,n.encodeFileName),f=0;try{o.forEach(function(m,p){f++;var E=function(M,x){var _=M||x,I=r[_];if(!I)throw new Error(_+" is not a valid compression method !");return I}(p.options.compression,n.compression),d=p.dir,S=p.date;p._compressWorker(E,p.options.compressionOptions||n.compressionOptions||{}).withStreamInfo("file",{name:m,dir:d,date:S,comment:p.comment||"",unixPermissions:p.unixPermissions,dosPermissions:p.dosPermissions}).pipe(e)}),e.entriesCount=f}catch(m){e.error(m)}return e}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(l,s,c){"use strict";function r(){if(!(this instanceof r))return new r;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var i=new r;for(var o in this)"function"!=typeof this[o]&&(i[o]=this[o]);return i}}(r.prototype=l("./object")).loadAsync=l("./load"),r.support=l("./support"),r.defaults=l("./defaults"),r.version="3.10.1",r.loadAsync=function(i,o){return(new r).loadAsync(i,o)},r.external=l("./external"),s.exports=r},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(l,s,c){"use strict";var r=l("./utils"),i=l("./external"),o=l("./utf8"),n=l("./zipEntries"),h=l("./stream/Crc32Probe"),e=l("./nodejsUtils");function f(m){return new i.Promise(function(p,E){var y=m.decompressed.getContentWorker().pipe(new h);y.on("error",function(d){E(d)}).on("end",function(){y.streamInfo.crc32!==m.decompressed.crc32?E(new Error("Corrupted zip : CRC32 mismatch")):p()}).resume()})}s.exports=function(m,p){var E=this;return p=r.extend(p||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:o.utf8decode}),e.isNode&&e.isStream(m)?i.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):r.prepareContent("the loaded zip f
1ile",m,!0,p.optimizedBinaryString,p.base64).then(function(y){var d=new n(p);return d.load(y),d}).then(function(y){var d=[i.Promise.resolve(y)],S=y.files;if(p.checkCRC32)for(var M=0;M<S.length;M++)d.push(f(S[M]));return i.Promise.all(d)}).then(function(y){for(var d=y.shift(),S=d.files,M=0;M<S.length;M++){var x=S[M],_=x.fileNameStr,I=r.resolve(x.fileNameStr);E.file(I,x.decompressed,{binary:!0,optimizedBinaryString:!0,date:x.date,dir:x.dir,comment:x.fileCommentStr.length?x.fileCommentStr:null,unixPermissions:x.unixPermissions,dosPermissions:x.dosPermissions,createFolders:p.createFolders}),x.dir||(E.file(I).unsafeOriginalName=_)}return d.zipComment.length&&(E.comment=d.zipComment),E})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(l,s,c){"use strict";var r=l("../utils"),i=l("../stream/GenericWorker");function o(n,h){i.call(this,"Nodejs stream input adapter for "+n),this._upstreamEnded=!1,this._bindStream(h)}r.inherits(o,i),o.prototype._bindStream=function(n){var h=this;(this._stream=n).pause(),n.on("data",function(e){h.push({data:e,meta:{percent:0}})}).on("error",function(e){h.isPaused?this.generatedError=e:h.error(e)}).on("end",function(){h.isPaused?h._upstreamEnded=!0:h.end()})},o.prototype.pause=function(){return!!i.prototype.pause.call(this)&&(this._stream.pause(),!0)},o.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},s.exports=o},{"../stream/GenericWorker":28,"../utils":32}],13:[function(l,s,c){"use strict";var r=l("readable-stream").Readable;function i(o,n,h){r.call(this,n),this._helper=o;var e=this;o.on("data",function(f,m){e.push(f)||e._helper.pause(),h&&h(m)}).on("error",function(f){e.emit("error",f)}).on("end",function(){e.push(null)})}l("../utils").inherits(i,r),i.prototype._read=function(){this._helper.resume()},s.exports=i},{"../utils":32,"readable-stream":16}],14:[function(l,s,c){"use strict";s.exports={isNode:typeof Buffer<"u",newBufferFrom:function(r,i){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(r,i);if("number"==typeof r)throw new Error('The "data" argument must not be a number');return new Buffer(r,i)},allocBuffer:function(r){if(Buffer.alloc)return Buffer.alloc(r);var i=new Buffer(r);return i.fill(0),i},isBuffer:function(r){return Buffer.isBuffer(r)},isStream:function(r){return r&&"function"==typeof r.on&&"function"==typeof r.pause&&"function"==typeof r.resume}}},{}],15:[function(l,s,c){"use strict";function r(I,T,A){var v,F,B=o.getTypeOf(T),D=o.extend(A||{},e);D.date=D.date||new Date,null!==D.compression&&(D.compression=D.compression.toUpperCase()),"string"==typeof D.unixPermissions&&(D.unixPermissions=parseInt(D.unixPermissions,8)),D.unixPermissions&&16384&D.unixPermissions&&(D.dir=!0),D.dosPermissions&&16&D.dosPermissions&&(D.dir=!0),D.dir&&(I=S(I)),D.createFolders&&(v=d(I))&&M.call(this,v,!0),A&&void 0!==A.binary||(D.binary=!("string"===B&&!1===D.binary&&!1===D.base64)),(T instanceof f&&0===T.uncompressedSize||D.dir||!T||0===T.length)&&(D.base64=!1,D.binary=!0,T="",D.compression="STORE",B="string"),F=T instanceof f||T instanceof n?T:E.isNode&&E.isStream(T)?new y(I,T):o.prepareContent(I,T,D.binary,D.optimizedBinaryString,D.base64);var V=new m(I,F,D);this.files[I]=V}var i=l("./utf8"),o=l("./utils"),n=l("./stream/GenericWorker"),h=l("./stream/StreamHelper"),e=l("./defaults"),f=l("./compressedObject"),m=l("./zipObject"),p=l("./generate"),E=l("./nodejsUtils"),y=l("./nodejs/NodejsStreamInputAdapter"),d=function(I){"/"===I.slice(-1)&&(I=I.substring(0,I.length-1));var T=I.lastIndexOf("/");return 0<T?I.substring(0,T):""},S=function(I){return"/"!==I.slice(-1)&&(I+="/"),I},M=function(I,T){return T=void 0!==T?T:e.createFolders,I=S(I),this.files[I]||r.call(this,I,null,{dir:!0,createFolders:T}),this.files[I]};function x(I){return"[object RegExp]"===Object.prototype.toString.call(I)}var _={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(I){var T,A,v;for(T in this.files)v=this.files[T],(A=T.slice(this.root.length,T.length))&&T.slice(0,this.root.length)===this.root&&I(A,v)},filter:function(I){var T=[];return this.forEach(function(A,v){I(A,v)&&T.push(v)}),T},file:function(I,T,A){if(1!==arguments.length)return r.call(this,I=this.root+I,T,A),this;if(x(I)){var v=I;return this.filter(function(D,L){return!L.dir&&v.test(D)})}var B=this.files[this.root+I];return B&&!B.dir?B:null},folder:function(I){if(!I)return this;
vendor: 4,507 bytes, line 1
1if(x(I))return this.filter(function(B,D){return D.dir&&I.test(B)});var A=M.call(this,this.root+I),v=this.clone();return v.root=A.name,v},remove:function(I){var T=this.files[I=this.root+I];if(T||("/"!==I.slice(-1)&&(I+="/"),T=this.files[I]),T&&!T.dir)delete this.files[I];else for(var A=this.filter(function(B,D){return D.name.slice(0,I.length)===I}),v=0;v<A.length;v++)delete this.files[A[v].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(I){var T,A={};try{if((A=o.extend(I||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:i.utf8encode})).type=A.type.toLowerCase(),A.compression=A.compression.toUpperCase(),"binarystring"===A.type&&(A.type="string"),!A.type)throw new Error("No output type specified.");o.checkSupport(A.type),"darwin"!==A.platform&&"freebsd"!==A.platform&&"linux"!==A.platform&&"sunos"!==A.platform||(A.platform="UNIX"),"win32"===A.platform&&(A.platform="DOS"),T=p.generateWorker(this,A,A.comment||this.comment||"")}catch(B){(T=new n("error")).error(B)}return new h(T,A.type||"string",A.mimeType)},generateAsync:function(I,T){return this.generateInternalStream(I).accumulate(T)},generateNodeStream:function(I,T){return(I=I||{}).type||(I.type="nodebuffer"),this.generateInternalStream(I).toNodejsStream(T)}};s.exports=_},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(l,s,c){"use strict";s.exports=l("stream")},{stream:void 0}],17:[function(l,s,c){"use strict";var r=l("./DataReader");function i(o){r.call(this,o);for(var n=0;n<this.data.length;n++)o[n]=255&o[n]}l("../utils").inherits(i,r),i.prototype.byteAt=function(o){return this.data[this.zero+o]},i.prototype.lastIndexOfSignature=function(o){for(var n=o.charCodeAt(0),h=o.charCodeAt(1),e=o.charCodeAt(2),f=o.charCodeAt(3),m=this.length-4;0<=m;--m)if(this.data[m]===n&&this.data[m+1]===h&&this.data[m+2]===e&&this.data[m+3]===f)return m-this.zero;return-1},i.prototype.readAndCheckSignature=function(o){var n=o.charCodeAt(0),h=o.charCodeAt(1),e=o.charCodeAt(2),f=o.charCodeAt(3),m=this.readData(4);return n===m[0]&&h===m[1]&&e===m[2]&&f===m[3]},i.prototype.readData=function(o){if(this.checkOffset(o),0===o)return[];var n=this.data.slice(this.zero+this.index,this.zero+this.index+o);return this.index+=o,n},s.exports=i},{"../utils":32,"./DataReader":18}],18:[function(l,s,c){"use strict";var r=l("../utils");function i(o){this.data=o,this.length=o.length,this.index=0,this.zero=0}i.prototype={checkOffset:function(o){this.checkIndex(this.index+o)},checkIndex:function(o){if(this.length<this.zero+o||o<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+o+"). Corrupted zip ?")},setIndex:function(o){this.checkIndex(o),this.index=o},skip:function(o){this.setIndex(this.index+o)},byteAt:function(){},readInt:function(o){var n,h=0;for(this.checkOffset(o),n=this.index+o-1;n>=this.index;n--)h=(h<<8)+this.byteAt(n);return this.index+=o,h},readString:function(o){return r.transformTo("string",this.readData(o))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var o=this.readInt(4);return new Date(Date.UTC(1980+(o>>25&127),(o>>21&15)-1,o>>16&31,o>>11&31,o>>5&63,(31&o)<<1))}},s.exports=i},{"../utils":32}],19:[function(l,s,c){"use strict";var r=l("./Uint8ArrayReader");function i(o){r.call(this,o)}l("../utils").inherits(i,r),i.prototype.readData=function(o){this.checkOffset(o);var n=this.data.slice(this.zero+this.index,this.zero+this.index+o);return this.index+=o,n},s.exports=i},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(l,s,c){"use strict";var r=l("./DataReader");function i(o){r.call(this,o)}l("../utils").inherits(i,r),i.prototype.byteAt=function(o){return this.data.charCodeAt(this.zero+o)},i.prototype.lastIndexOfSignature=function(o){return this.data.lastIndexOf(o)-this.zero},i.prototype.readAndCheckSignature=function(o){return o===this.readData(4)},i.prototype.readData=function(o){this.checkOffset(o);var n=this.data.slice(this.zero+this.index,this.zero+this.index+o);return this.index+=o,n},s.exports=i},{"../utils":32,"./DataReader":18}],21:[function(l,s,c){"use strict";var r=l("./ArrayReader");function i(o){r.call(this,o)}
vendor: 6,946 bytes, line 1
1l("../utils").inherits(i,r),i.prototype.readData=function(o){if(this.checkOffset(o),0===o)return new Uint8Array(0);var n=this.data.subarray(this.zero+this.index,this.zero+this.index+o);return this.index+=o,n},s.exports=i},{"../utils":32,"./ArrayReader":17}],22:[function(l,s,c){"use strict";var r=l("../utils"),i=l("../support"),o=l("./ArrayReader"),n=l("./StringReader"),h=l("./NodeBufferReader"),e=l("./Uint8ArrayReader");s.exports=function(f){var m=r.getTypeOf(f);return r.checkSupport(m),"string"!==m||i.uint8array?"nodebuffer"===m?new h(f):i.uint8array?new e(r.transformTo("uint8array",f)):new o(r.transformTo("array",f)):new n(f)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(l,s,c){"use strict";c.LOCAL_FILE_HEADER="PK\x03\x04",c.CENTRAL_FILE_HEADER="PK\x01\x02",c.CENTRAL_DIRECTORY_END="PK\x05\x06",c.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x06\x07",c.ZIP64_CENTRAL_DIRECTORY_END="PK\x06\x06",c.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(l,s,c){"use strict";var r=l("./GenericWorker"),i=l("../utils");function o(n){r.call(this,"ConvertWorker to "+n),this.destType=n}i.inherits(o,r),o.prototype.processChunk=function(n){this.push({data:i.transformTo(this.destType,n.data),meta:n.meta})},s.exports=o},{"../utils":32,"./GenericWorker":28}],25:[function(l,s,c){"use strict";var r=l("./GenericWorker"),i=l("../crc32");function o(){r.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}l("../utils").inherits(o,r),o.prototype.processChunk=function(n){this.streamInfo.crc32=i(n.data,this.streamInfo.crc32||0),this.push(n)},s.exports=o},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(l,s,c){"use strict";var r=l("../utils"),i=l("./GenericWorker");function o(n){i.call(this,"DataLengthProbe for "+n),this.propName=n,this.withStreamInfo(n,0)}r.inherits(o,i),o.prototype.processChunk=function(n){n&&(this.streamInfo[this.propName]=(this.streamInfo[this.propName]||0)+n.data.length),i.prototype.processChunk.call(this,n)},s.exports=o},{"../utils":32,"./GenericWorker":28}],27:[function(l,s,c){"use strict";var r=l("../utils"),i=l("./GenericWorker");function o(n){i.call(this,"DataWorker");var h=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,n.then(function(e){h.dataIsReady=!0,h.data=e,h.max=e&&e.length||0,h.type=r.getTypeOf(e),h.isPaused||h._tickAndRepeat()},function(e){h.error(e)})}r.inherits(o,i),o.prototype.cleanUp=function(){i.prototype.cleanUp.call(this),this.data=null},o.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,r.delay(this._tickAndRepeat,[],this)),!0)},o.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(r.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},o.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var n=null,h=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":n=this.data.substring(this.index,h);break;case"uint8array":n=this.data.subarray(this.index,h);break;case"array":case"nodebuffer":n=this.data.slice(this.index,h)}return this.index=h,this.push({data:n,meta:{percent:this.max?this.index/this.max*100:0}})},s.exports=o},{"../utils":32,"./GenericWorker":28}],28:[function(l,s,c){"use strict";function r(i){this.name=i||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}r.prototype={push:function(i){this.emit("data",i)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(i){this.emit("error",i)}return!0},error:function(i){return!this.isFinished&&(this.isPaused?this.generatedError=i:(this.isFinished=!0,this.emit("error",i),this.previous&&this.previous.error(i),this.cleanUp()),!0)},on:function(i,o){return this._listeners[i].push(o),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(i,o){if(this._listeners[i])for(var n=0;n<this._listeners[i].length;n++)this._listeners[i][n].call(this,o)},pipe:function(i){return i.registerPrevious(this)},registerPrevious:function(i){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=i.streamInfo,this.mergeStreamInfo(),this.previous=i;var o=this;return i.on("data",function(n){o.processChunk(n)}),i.on("end",function(){o.end()}),i.on("error",function(n){o.error(n)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var i=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),i=!0),this.previous&&this.previous.resume(),!i},flush:function(){},processChunk:function(i){this.push(i)},withStreamInfo:function(i,o){return this.extraStreamInfo[i]=o,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var i in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,i)&&(this.streamInfo[i]=this.extraStreamInfo[i])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var i="Worker "+this.name;return this.previous?this.previous+" -> "+i:i}},s.exports=r},{}],29:[function(l,s,c){"use strict";var r=l("../utils"),i=l("./ConvertWorker"),o=l("./GenericWorker"),n=l("../base64"),h=l("../support"),e=l("../external"),f=null;if(h.nodestream)try{f=l("../nodejs/NodejsStreamOutputAdapter")}catch{}function m(p,E,y){var d=E;switch(E){case"blob":case"arraybuffer":d="uint8array";break;case"base64":d="string"}try{this._internalType=d,this._outputType=E,this._mimeType=y,r.checkSupport(d),this._worker=p.pipe(new i(d)),p.lock()}catch(S){this._worker=new o("error"),this._worker.error(S)}}m.prototype={accumulate:function(p){return E=this,y=p,new e.Promise(function(d,S){var M=[],x=E._internalType,_=E._outputType,I=E._mimeType;E.on("data",function(T,A){M.push(T),y&&y(A)}).on("error",function(T){M=[],S(T)}).on("end",function(){try{var T=function(A,v,B){switch(A){case"blob":return r.newBlob(r.transformTo("arraybuffer",v),B);case"base64":return n.encode(v);default:return r.transformTo(A,v)}}(_,function(A,v){var B,D=0,L=null,F=0;for(B=0;B<v.length;B++)F+=v[B].length;switch(A){case"string":return v.join("");case"array":return Array.prototype.concat.apply([],v);case"uint8array":for(L=new Uint8Array(F),B=0;B<v.length;B++)L.set(v[B],D),D+=v[B].length;return L;case"nodebuffer":return Buffer.concat(v);default:throw new Error("concat : unsupported type '"+A+"'")}}(x,M),I);d(T)}catch(A){S(A)}M=[]}).resume()});var E,y},on:function(p,E){var y=this;
1return this._worker.on(p,"data"===p?function(d){E.call(y,d.data,d.meta)}:function(){r.delay(E,arguments,y)}),this},resume:function(){return r.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(p){if(r.checkSupport("nodestream"),"nodebuffer"!==this._outputType)throw new Error(this._outputType+" is not supported by this method");return new f(this,{objectMode:"nodebuffer"!==this._outputType},p)}},s.exports=m},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(l,s,c){"use strict";if(c.base64=!0,c.array=!0,c.string=!0,c.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",c.nodebuffer=typeof Buffer<"u",c.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")c.blob=!1;else{var r=new ArrayBuffer(0);try{c.blob=0===new Blob([r],{type:"application/zip"}).size}catch{try{var i=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);i.append(r),c.blob=0===i.getBlob("application/zip").size}catch{c.blob=!1}}}try{c.nodestream=!!l("readable-stream").Readable}catch{c.nodestream=!1}},{"readable-stream":16}],31:[function(l,s,c){"use strict";for(var r=l("./utils"),i=l("./support"),o=l("./nodejsUtils"),n=l("./stream/GenericWorker"),h=new Array(256),e=0;e<256;e++)h[e]=252<=e?6:248<=e?5:240<=e?4:224<=e?3:192<=e?2:1;function f(){n.call(this,"utf-8 decode"),this.leftOver=null}function m(){n.call(this,"utf-8 encode")}h[254]=h[254]=1,c.utf8encode=function(p){return i.nodebuffer?o.newBufferFrom(p,"utf-8"):function(E){var y,d,S,M,x,_=E.length,I=0;for(M=0;M<_;M++)55296==(64512&(d=E.charCodeAt(M)))&&M+1<_&&56320==(64512&(S=E.charCodeAt(M+1)))&&(d=65536+(d-55296<<10)+(S-56320),M++),I+=d<128?1:d<2048?2:d<65536?3:4;for(y=i.uint8array?new Uint8Array(I):new Array(I),M=x=0;x<I;M++)55296==(64512&(d=E.charCodeAt(M)))&&M+1<_&&56320==(64512&(S=E.charCodeAt(M+1)))&&(d=65536+(d-55296<<10)+(S-56320),M++),d<128?y[x++]=d:(d<2048?y[x++]=192|d>>>6:(d<65536?y[x++]=224|d>>>12:(y[x++]=240|d>>>18,y[x++]=128|d>>>12&63),y[x++]=128|d>>>6&63),y[x++]=128|63&d);return y}(p)},c.utf8decode=function(p){return i.nodebuffer?r.transformTo("nodebuffer",p).toString("utf-8"):function(E){var y,d,S,M,x=E.length,_=new Array(2*x);for(y=d=0;y<x;)if((S=E[y++])<128)_[d++]=S;else if(4<(M=h[S]))_[d++]=65533,y+=M-1;else{for(S&=2===M?31:3===M?15:7;1<M&&y<x;)S=S<<6|63&E[y++],M--;1<M?_[d++]=65533:S<65536?_[d++]=S:(_[d++]=55296|(S-=65536)>>10&1023,_[d++]=56320|1023&S)}return _.length!==d&&(_.subarray?_=_.subarray(0,d):_.length=d),r.applyFromCharCode(_)}(p=r.transformTo(i.uint8array?"uint8array":"array",p))},r.inherits(f,n),f.prototype.processChunk=function(p){var E=r.transformTo(i.uint8array?"uint8array":"array",p.data);if(this.leftOver&&this.leftOver.length){if(i.uint8array){var y=E;(E=new Uint8Array(y.length+this.leftOver.length)).set(this.leftOver,0),E.set(y,this.leftOver.length)}else E=this.leftOver.concat(E);this.leftOver=null}var d=function(M,x){var _;for((x=x||M.length)>M.length&&(x=M.length),_=x-1;0<=_&&128==(192&M[_]);)_--;return _<0||0===_?x:_+h[M[_]]>x?_:x}(E),S=E;d!==E.length&&(i.uint8array?(S=E.subarray(0,d),this.leftOver=E.subarray(d,E.length)):(S=E.slice(0,d),this.leftOver=E.slice(d,E.length))),this.push({data:c.utf8decode(S),meta:p.meta})},f.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:c.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},c.Utf8DecodeWorker=f,r.inherits(m,n),m.prototype.processChunk=function(p){this.push({data:c.utf8encode(p.data),meta:p.meta})},c.Utf8EncodeWorker=m},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(l,s,c){"use strict";var r=l("./support"),i=l("./base64"),o=l("./nodejsUtils"),n=l("./external");function h(y){return y}function e(y,d){for(var S=0;S<y.length;++S)d[S]=255&y.charCodeAt(S);return d}l("setimmediate"),c.newBlob=function(y,d){c.checkSupport("blob");try{return new Blob([y],{type:d})}catch{try{var S=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return S.append(y),S.getBlob(d)}catch{throw new Error("Bug : can't construct the Blob.")}}};var f={stringifyByChunk:function(y,d,S){var M=[],x=0,_=y.length;if(_<=S)return String.fromCharCode.apply(null,y);for(;x<_;)M.push(String.fromCharCode.apply(null,"array"===d||"nodebuffer"===d?y.slice(
vendor: 6,811 bytes, line 1
1x,Math.min(x+S,_)):y.subarray(x,Math.min(x+S,_)))),x+=S;return M.join("")},stringifyByChar:function(y){for(var d="",S=0;S<y.length;S++)d+=String.fromCharCode(y[S]);return d},applyCanBeUsed:{uint8array:function(){try{return r.uint8array&&1===String.fromCharCode.apply(null,new Uint8Array(1)).length}catch{return!1}}(),nodebuffer:function(){try{return r.nodebuffer&&1===String.fromCharCode.apply(null,o.allocBuffer(1)).length}catch{return!1}}()}};function m(y){var d=65536,S=c.getTypeOf(y),M=!0;if("uint8array"===S?M=f.applyCanBeUsed.uint8array:"nodebuffer"===S&&(M=f.applyCanBeUsed.nodebuffer),M)for(;1<d;)try{return f.stringifyByChunk(y,S,d)}catch{d=Math.floor(d/2)}return f.stringifyByChar(y)}function p(y,d){for(var S=0;S<y.length;S++)d[S]=y[S];return d}c.applyFromCharCode=m;var E={};E.string={string:h,array:function(y){return e(y,new Array(y.length))},arraybuffer:function(y){return E.string.uint8array(y).buffer},uint8array:function(y){return e(y,new Uint8Array(y.length))},nodebuffer:function(y){return e(y,o.allocBuffer(y.length))}},E.array={string:m,array:h,arraybuffer:function(y){return new Uint8Array(y).buffer},uint8array:function(y){return new Uint8Array(y)},nodebuffer:function(y){return o.newBufferFrom(y)}},E.arraybuffer={string:function(y){return m(new Uint8Array(y))},array:function(y){return p(new Uint8Array(y),new Array(y.byteLength))},arraybuffer:h,uint8array:function(y){return new Uint8Array(y)},nodebuffer:function(y){return o.newBufferFrom(new Uint8Array(y))}},E.uint8array={string:m,array:function(y){return p(y,new Array(y.length))},arraybuffer:function(y){return y.buffer},uint8array:h,nodebuffer:function(y){return o.newBufferFrom(y)}},E.nodebuffer={string:m,array:function(y){return p(y,new Array(y.length))},arraybuffer:function(y){return E.nodebuffer.uint8array(y).buffer},uint8array:function(y){return p(y,new Uint8Array(y.length))},nodebuffer:h},c.transformTo=function(y,d){if(d=d||"",!y)return d;c.checkSupport(y);var S=c.getTypeOf(d);return E[S][y](d)},c.resolve=function(y){for(var d=y.split("/"),S=[],M=0;M<d.length;M++){var x=d[M];"."===x||""===x&&0!==M&&M!==d.length-1||(".."===x?S.pop():S.push(x))}return S.join("/")},c.getTypeOf=function(y){return"string"==typeof y?"string":"[object Array]"===Object.prototype.toString.call(y)?"array":r.nodebuffer&&o.isBuffer(y)?"nodebuffer":r.uint8array&&y instanceof Uint8Array?"uint8array":r.arraybuffer&&y instanceof ArrayBuffer?"arraybuffer":void 0},c.checkSupport=function(y){if(!r[y.toLowerCase()])throw new Error(y+" is not supported by this platform")},c.MAX_VALUE_16BITS=65535,c.MAX_VALUE_32BITS=-1,c.pretty=function(y){var d,S,M="";for(S=0;S<(y||"").length;S++)M+="\\x"+((d=y.charCodeAt(S))<16?"0":"")+d.toString(16).toUpperCase();return M},c.delay=function(y,d,S){setImmediate(function(){y.apply(S||null,d||[])})},c.inherits=function(y,d){function S(){}S.prototype=d.prototype,y.prototype=new S},c.extend=function(){var y,d,S={};for(y=0;y<arguments.length;y++)for(d in arguments[y])Object.prototype.hasOwnProperty.call(arguments[y],d)&&void 0===S[d]&&(S[d]=arguments[y][d]);return S},c.prepareContent=function(y,d,S,M,x){return n.Promise.resolve(d).then(function(_){return r.blob&&(_ instanceof Blob||-1!==["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(_)))&&typeof FileReader<"u"?new n.Promise(function(I,T){var A=new FileReader;A.onload=function(v){I(v.target.result)},A.onerror=function(v){T(v.target.error)},A.readAsArrayBuffer(_)}):_}).then(function(_){var T,I=c.getTypeOf(_);return I?("arraybuffer"===I?_=c.transformTo("uint8array",_):"string"===I&&(x?_=i.decode(_):S&&!0!==M&&(_=e(T=_,r.uint8array?new Uint8Array(T.length):new Array(T.length)))),_):n.Promise.reject(new Error("Can't read the data of '"+y+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(l,s,c){"use strict";var r=l("./reader/readerFor"),i=l("./utils"),o=l("./signature"),n=l("./zipEntry"),h=l("./support");function e(f){this.files=[],this.loadOptions=f}e.prototype={checkSignature:function(f){if(!this.reader.readAndCheckSignature(f)){this.reader.index-=4;var m=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+i.pretty(m)+", expected "+i.pretty(f)+")")}},isSignature:function(f,m){var p=this.reader.index;this.reader.setIndex(f);var E=this.reader.readString(4)===m;return this.reader.setIndex(p),E},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var f=this.reader.readData(this.zipCommentLength),p=i.transformTo(h.uint8array?"uint8array":"array",f);this.zipComment=this.loadOptions.decodeFileName(p)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var f,m,p,E=this.zip64EndOfCentralSize-44;0<E;)f=this.reader.readInt(2),m=this.reader.readInt(4),p=this.reader.readData(m),this.zip64ExtensibleData[f]={id:f,length:m,value:p}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var f,m;for(f=0;f<this.files.length;f++)this.reader.setIndex((m=this.files[f]).localHeaderOffset),this.checkSignature(o.LOCAL_FILE_HEADER),m.readLocalPart(this.reader),m.handleUTF8(),m.processAttributes()},readCentralDir:function(){var f;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(o.CENTRAL_FILE_HEADER);)(f=new n({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(f);if(this.centralDirRecords!==this.files.length&&0!==this.centralDirRecords&&0===this.files.length)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var f=this.reader.lastIndexOfSignature(o.CENTRAL_DIRECTORY_END);if(f<0)throw this.isSignature(0,o.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip f
1ile ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(f);var m=f;if(this.checkSignature(o.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===i.MAX_VALUE_16BITS||this.diskWithCentralDirStart===i.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===i.MAX_VALUE_16BITS||this.centralDirRecords===i.MAX_VALUE_16BITS||this.centralDirSize===i.MAX_VALUE_32BITS||this.centralDirOffset===i.MAX_VALUE_32BITS){if(this.zip64=!0,(f=this.reader.lastIndexOfSignature(o.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(f),this.checkSignature(o.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,o.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(o.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(o.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var p=this.centralDirOffset+this.centralDirSize;this.zip64&&(p+=20,p+=12+this.zip64EndOfCentralSize);var E=m-p;if(0<E)this.isSignature(m,o.CENTRAL_FILE_HEADER)||(this.reader.zero=E);else if(E<0)throw new Error("Corrupted zip: missing "+Math.abs(E)+" bytes.")},prepareReader:function(f){this.reader=r(f)},load:function(f){this.prepareReader(f),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},s.exports=e},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(l,s,c){"use strict";var r=l("./reader/readerFor"),i=l("./utils"),o=l("./compressedObject"),n=l("./crc32"),h=l("./utf8"),e=l("./compressions"),f=l("./support");function m(p,E){this.options=p,this.loadOptions=E}m.prototype={isEncrypted:function(){return!(1&~this.bitFlag)},useUTF8:function(){return!(2048&~this.bitFlag)},readLocalPart:function(p){var E,y;if(p.skip(22),this.fileNameLength=p.readInt(2),y=p.readInt(2),this.fileName=p.readData(this.fileNameLength),p.skip(y),-1===this.compressedSize||-1===this.uncompressedSize)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(null===(E=function(d){for(var S in e)if(Object.prototype.hasOwnProperty.call(e,S)&&e[S].magic===d)return e[S];return null}(this.compressionMethod)))throw new Error("Corrupted zip : compression "+i.pretty(this.compressionMethod)+" unknown (inner file : "+i.transformTo("string",this.fileName)+")");this.decompressed=new o(this.compressedSize,this.uncompressedSize,this.crc32,E,p.readData(this.compressedSize))},readCentralPart:function(p){this.versionMadeBy=p.readInt(2),p.skip(2),this.bitFlag=p.readInt(2),this.compressionMethod=p.readString(2),this.date=p.readDate(),this.crc32=p.readInt(4),this.compressedSize=p.readInt(4),this.uncompressedSize=p.readInt(4);var E=p.readInt(2);if(this.extraFieldsLength=p.readInt(2),this.fileCommentLength=p.readInt(2),this.diskNumberStart=p.readInt(2),this.internalFileAttributes=p.readInt(2),this.externalFileAttributes=p.readInt(4),this.localHeaderOffset=p.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");p.skip(E),this.readExtraFields(p),this.parseZIP64ExtraField(p),this.fileComment=p.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var p=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),0==p&&(this.dosPermissions=63&this.externalFileAttributes),3==p&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var p=r(this.extraFields[1].value);this.uncompressedSize===i.MAX_VALUE_32BITS&&(this.uncompressedSize=p.readInt(8)),this.compressedSize===i.MAX_VALUE_32BITS&&(this.compressedSize=p.readInt(8)),this.localHeaderOffset===i.MAX_VALUE_32BITS&&
vendor: 2,334 bytes, line 1
1(this.localHeaderOffset=p.readInt(8)),this.diskNumberStart===i.MAX_VALUE_32BITS&&(this.diskNumberStart=p.readInt(4))}},readExtraFields:function(p){var E,y,d,S=p.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});p.index+4<S;)E=p.readInt(2),y=p.readInt(2),d=p.readData(y),this.extraFields[E]={id:E,length:y,value:d};p.setIndex(S)},handleUTF8:function(){var p=f.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=h.utf8decode(this.fileName),this.fileCommentStr=h.utf8decode(this.fileComment);else{var E=this.findExtraFieldUnicodePath();if(null!==E)this.fileNameStr=E;else{var y=i.transformTo(p,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(y)}var d=this.findExtraFieldUnicodeComment();if(null!==d)this.fileCommentStr=d;else{var S=i.transformTo(p,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(S)}}},findExtraFieldUnicodePath:function(){var p=this.extraFields[28789];if(p){var E=r(p.value);return 1!==E.readInt(1)||n(this.fileName)!==E.readInt(4)?null:h.utf8decode(E.readData(p.length-5))}return null},findExtraFieldUnicodeComment:function(){var p=this.extraFields[25461];if(p){var E=r(p.value);return 1!==E.readInt(1)||n(this.fileComment)!==E.readInt(4)?null:h.utf8decode(E.readData(p.length-5))}return null}},s.exports=m},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(l,s,c){"use strict";function r(E,y,d){this.name=E,this.dir=d.dir,this.date=d.date,this.comment=d.comment,this.unixPermissions=d.unixPermissions,this.dosPermissions=d.dosPermissions,this._data=y,this._dataBinary=d.binary,this.options={compression:d.compression,compressionOptions:d.compressionOptions}}var i=l("./stream/StreamHelper"),o=l("./stream/DataWorker"),n=l("./utf8"),h=l("./compressedObject"),e=l("./stream/GenericWorker");r.prototype={internalStream:function(E){var y=null,d="string";try{if(!E)throw new Error("No output type specified.");var S="string"===(d=E.toLowerCase())||"text"===d;"binarystring"!==d&&"text"!==d||(d="string"),y=this._decompressWorker();var M=!this._dataBinary;M&&!S&&(y=y.pipe(new n.Utf8EncodeWorker)),!M&&S&&(y=y.pipe(new n.Utf8DecodeWorker))}catch(x){(y=new e("error")).error(x)}return new i(y,d,"")},async:function(E,y){return this.internalStream(E).accumulate(y)}
vendor: 8,863 bytes, line 1
1,nodeStream:function(E,y){return this.internalStream(E||"nodebuffer").toNodejsStream(y)},_compressWorker:function(E,y){if(this._data instanceof h&&this._data.compression.magic===E.magic)return this._data.getCompressedWorker();var d=this._decompressWorker();return this._dataBinary||(d=d.pipe(new n.Utf8EncodeWorker)),h.createWorkerFrom(d,E,y)},_decompressWorker:function(){return this._data instanceof h?this._data.getContentWorker():this._data instanceof e?this._data:new o(this._data)}};for(var f=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],m=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},p=0;p<f.length;p++)r.prototype[f[p]]=m;s.exports=r},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(l,s,c){(function(r){"use strict";var i,o,n=r.MutationObserver||r.WebKitMutationObserver;if(n){var h=0,e=new n(E),f=r.document.createTextNode("");e.observe(f,{characterData:!0}),i=function(){f.data=h=++h%2}}else if(r.setImmediate||void 0===r.MessageChannel)i="document"in r&&"onreadystatechange"in r.document.createElement("script")?function(){var y=r.document.createElement("script");y.onreadystatechange=function(){E(),y.onreadystatechange=null,y.parentNode.removeChild(y),y=null},r.document.documentElement.appendChild(y)}:function(){setTimeout(E,0)};else{var m=new r.MessageChannel;m.port1.onmessage=E,i=function(){m.port2.postMessage(0)}}var p=[];function E(){var y,d;o=!0;for(var S=p.length;S;){for(d=p,p=[],y=-1;++y<S;)d[y]();S=p.length}o=!1}s.exports=function(y){1!==p.push(y)||o||i()}}).call(this,void 0!==u.g?u.g:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(l,s,c){"use strict";var r=l("immediate");function i(){}var o={},n=["REJECTED"],h=["FULFILLED"],e=["PENDING"];function f(S){if("function"!=typeof S)throw new TypeError("resolver must be a function");this.state=e,this.queue=[],this.outcome=void 0,S!==i&&y(this,S)}function m(S,M,x){this.promise=S,"function"==typeof M&&(this.onFulfilled=M,this.callFulfilled=this.otherCallFulfilled),"function"==typeof x&&(this.onRejected=x,this.callRejected=this.otherCallRejected)}function p(S,M,x){r(function(){var _;try{_=M(x)}catch(I){return o.reject(S,I)}_===S?o.reject(S,new TypeError("Cannot resolve promise with itself")):o.resolve(S,_)})}function E(S){var M=S&&S.then;if(S&&("object"==typeof S||"function"==typeof S)&&"function"==typeof M)return function(){M.apply(S,arguments)}}function y(S,M){var x=!1;function _(A){x||(x=!0,o.reject(S,A))}function I(A){x||(x=!0,o.resolve(S,A))}var T=d(function(){M(I,_)});"error"===T.status&&_(T.value)}function d(S,M){var x={};try{x.value=S(M),x.status="success"}catch(_){x.status="error",x.value=_}return x}(s.exports=f).prototype.finally=function(S){if("function"!=typeof S)return this;var M=this.constructor;return this.then(function(x){return M.resolve(S()).then(function(){return x})},function(x){return M.resolve(S()).then(function(){throw x})})},f.prototype.catch=function(S){return this.then(null,S)},f.prototype.then=function(S,M){if("function"!=typeof S&&this.state===h||"function"!=typeof M&&this.state===n)return this;var x=new this.constructor(i);return this.state!==e?p(x,this.state===h?S:M,this.outcome):this.queue.push(new m(x,S,M)),x},m.prototype.callFulfilled=function(S){o.resolve(this.promise,S)},m.prototype.otherCallFulfilled=function(S){p(this.promise,this.onFulfilled,S)},m.prototype.callRejected=function(S){o.reject(this.promise,S)},m.prototype.otherCallRejected=function(S){p(this.promise,this.onRejected,S)},o.resolve=function(S,M){var x=d(E,M);if("error"===x.status)return o.reject(S,x.value);var _=x.value;if(_)y(S,_);else{S.state=h,S.outcome=M;for(var I=-1,T=S.queue.length;++I<T;)S.queue[I].callFulfilled(M)}return S},o.reject=function(S,M){S.state=n,S.outcome=M;for(var x=-1,_=S.queue.length;++x<_;)S.queue[x].callRejected(M);return S},f.resolve=function(S){return S instanceof this?S:o.resolve(new this(i),S)},f.reject=function(S){var M=new this(i);return o.reject(M,S)},f.all=function(S){var M=this;if("[object Array]"!==Object.prototype.toString.call(S))return this.reject(new TypeError("must be an array"));var x=S.length,_=!1;if(!x)return this.resolve([]);for(var I=new Array(x),T=0,A=-1,v=new this(i);++A<x;)B(S[A],A);return v;function B(D,L){M.resolve(D).then(function(F){I[L]=F,++T!==x||_||(_=!0,o.resolve(v,I))},function(F){_||(_=!0,o.reject(v,F))})}},f.race=function(S){if("[object Array]"!==Object.prototype.toString.call(S))return this.reject(new TypeError("must be an array"));var M=S.length,x=!1;if(!M)return this.resolve([]);for(var I=-1,T=new this(i);++I<M;)this.resolve(S[I]).then(function(A){x||(x=!0,o.resolve(T,A))},function(A){x||(x=!0,o.reject(T,A))});return T}},{immediate:36}],38:[function(l,s,c){"use strict";var r={};(0,l("./lib/utils/common").assign)(r,l("./lib/deflate"),l("./lib/inflate"),l("./lib/zlib/constants")),s.exports=r},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(l,s,c){"use strict";var r=l("./zlib/deflate"),i=l("./utils/common"),o=l("./utils/strings"),n=l("./zlib/messages"),h=l("./zlib/zstream"),e=Object.prototype.toString;function f(p){if(!(this instanceof f))return new f(p);this.options=i.assign({level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,to:""},p||{});var E=this.options;E.raw&&0<E.windowBits?E.windowBits=-E.windowBits:E.gzip&&0<E.windowBits&&E.windowBits<16&&(E.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new h,this.strm.avail_out=0;var y=r.deflateInit2(this.strm,E.level,E.method,E.windowBits,E.memLevel,E.strategy);if(0!==y)throw new Error(n[y]);if(E.header&&r.deflateSetHeader(this.strm,E.header),E.dictionary){var d;if(d="string"==typeof E.dictionary?o.string2buf(E.dictionary):"[object ArrayBuffer]"===e.call(E.dictionary)?new Uint8Array(E.dictionary):E.dictionary,0!==(y=r.deflateSetDictionary(this.strm,d)))throw new Error(n[y]);this._dict_set=!0}}function m(p,E){var y=new f(E);if(y.push(p,!0),y.err)throw y.msg||n[y.err];return y.result}f.prototype.push=function(p,E){var y,d,S=this.strm,M=this.options.chunkSize;if(this.ended)return!1;d=E===~~E?E:!0===E?4:0,S.input="string"==typeof p?o.string2buf(p):"[object ArrayBuffer]"===e.call(p)?new Uint8Array(p):p,S.next_in=0,S.avail_in=S.input.length;do{if(0===S.avail_out&&(S.output=new i.Buf8(M),S.next_out=0,S.avail_out=M),1!==(y=r.deflate(S,d))&&0!==y)return this.onEnd(y),!(this.ended=!0);0!==S.avail_out&&(0!==S.avail_in||4!==d&&2!==d)||this.onData("string"===this.options.to?o.buf2binstring(i.shrinkBuf(S.output,S.next_out)):i.shrinkBuf(S.output,S.next_out))}while((0<S.avail_in||0===S.avail_out)&&1!==y);return 4===d?(y=r.deflateEnd(this.strm),this.onEnd(y),this.ended=!0,0===y):2!==d||(this.onEnd(0),!(S.avail_out=0))},f.prototype.onData=function(p){this.chunks.push(p)},f.prototype.onEnd=function(p){0===p&&(this.result="string"===this.options.to?this.chunks.join(""):i.flattenChunks(this.chunks)),this.chunks=[],this.err=p,this.msg=this.strm.msg},c.Deflate=f,c.deflate=m,c.deflateRaw=function(p,E){return(E=E||{}).raw=!0,m(p,E)},c.gzip=function(p,E){return(E=E||{}).gzip=!0,m(p,E)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(l,s,c){"use strict";var r=l("./zlib/inflate"),i=l("./utils/common"),o=l("./utils/strings"),n=l("./zlib/constants"),h=l("./zlib/messages"),e=l("./zlib/zstream"),f=l("./zlib/gzheader"),m=Object.prototype.toString;function p(y){if(!(this instanceof p))return new p(y);this.options=i.assign({chunkSize:16384,windowBits:0,to:""},y||{});var d=this.options;d.raw&&0<=d.windowBits&&d.windowBits<16&&(d.windowBits=-d.windowBits,0===d.windowBits&&(d.windowBits=-15)),!(0<=d.windowBits&&d.windowBits<16)||y&&y.windowBits||(d.windowBits+=32),15<d.windowBits&&d.windowBits<48&&!(15&d.windowBits)&&(d.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new e,this.strm.avail_out=0;var S=r.inflateInit2(this.strm,d.windowBits);if(S!==n.Z_OK)throw new Error(h[S]);this.header=new f,r.inflateGetHeader(this.strm,this.header)}function E(y,d){var S=new p(d);if(S.push(y,!0),S.err)throw S.msg||h[S.err];return S.result}p.prototype.push=function(y,d){var S,M,x,_,I,T,A=this.strm,v=this.options.chunkSize,B=this.options.dictionary,D=!1;if(this.ended)return!1;M=d===~~d?d:!0===d?n.Z_FINISH:n.Z_NO_FLUSH,A.input="string"==typeof y?o.binstring2buf(y):"[object ArrayBuffer]"===m.call(y)?new Uint8Array(y):y,A.next_in=0,A.avail_in=A.input.length;do{if(0===A.avail_out&&(A.output=new i.Buf8(v),A.next_out=0,A.avail_out=v),(S=r.inflate(A,n.Z_NO_FLUSH))===n.Z_NEED_DICT&&B&&(T="string"==typeof B?o.string2buf(B):"[object ArrayBuffer]"===m.call(B)?new Uint8Array(B):B,S=r.inflateSetDictionary(this.strm,T)),S===n.Z_BUF_ER
vendor: 12,317 bytes, line 1
1ROR&&!0===D&&(S=n.Z_OK,D=!1),S!==n.Z_STREAM_END&&S!==n.Z_OK)return this.onEnd(S),!(this.ended=!0);A.next_out&&(0!==A.avail_out&&S!==n.Z_STREAM_END&&(0!==A.avail_in||M!==n.Z_FINISH&&M!==n.Z_SYNC_FLUSH)||("string"===this.options.to?(x=o.utf8border(A.output,A.next_out),_=A.next_out-x,I=o.buf2string(A.output,x),A.next_out=_,A.avail_out=v-_,_&&i.arraySet(A.output,A.output,x,_,0),this.onData(I)):this.onData(i.shrinkBuf(A.output,A.next_out)))),0===A.avail_in&&0===A.avail_out&&(D=!0)}while((0<A.avail_in||0===A.avail_out)&&S!==n.Z_STREAM_END);return S===n.Z_STREAM_END&&(M=n.Z_FINISH),M===n.Z_FINISH?(S=r.inflateEnd(this.strm),this.onEnd(S),this.ended=!0,S===n.Z_OK):M!==n.Z_SYNC_FLUSH||(this.onEnd(n.Z_OK),!(A.avail_out=0))},p.prototype.onData=function(y){this.chunks.push(y)},p.prototype.onEnd=function(y){y===n.Z_OK&&(this.result="string"===this.options.to?this.chunks.join(""):i.flattenChunks(this.chunks)),this.chunks=[],this.err=y,this.msg=this.strm.msg},c.Inflate=p,c.inflate=E,c.inflateRaw=function(y,d){return(d=d||{}).raw=!0,E(y,d)},c.ungzip=E},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(l,s,c){"use strict";var r=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";c.assign=function(n){for(var h=Array.prototype.slice.call(arguments,1);h.length;){var e=h.shift();if(e){if("object"!=typeof e)throw new TypeError(e+"must be non-object");for(var f in e)e.hasOwnProperty(f)&&(n[f]=e[f])}}return n},c.shrinkBuf=function(n,h){return n.length===h?n:n.subarray?n.subarray(0,h):(n.length=h,n)};var i={arraySet:function(n,h,e,f,m){if(h.subarray&&n.subarray)n.set(h.subarray(e,e+f),m);else for(var p=0;p<f;p++)n[m+p]=h[e+p]},flattenChunks:function(n){var h,e,f,m,p,E;for(h=f=0,e=n.length;h<e;h++)f+=n[h].length;for(E=new Uint8Array(f),h=m=0,e=n.length;h<e;h++)E.set(p=n[h],m),m+=p.length;return E}},o={arraySet:function(n,h,e,f,m){for(var p=0;p<f;p++)n[m+p]=h[e+p]},flattenChunks:function(n){return[].concat.apply([],n)}};c.setTyped=function(n){n?(c.Buf8=Uint8Array,c.Buf16=Uint16Array,c.Buf32=Int32Array,c.assign(c,i)):(c.Buf8=Array,c.Buf16=Array,c.Buf32=Array,c.assign(c,o))},c.setTyped(r)},{}],42:[function(l,s,c){"use strict";var r=l("./common"),i=!0,o=!0;try{String.fromCharCode.apply(null,[0])}catch{i=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{o=!1}for(var n=new r.Buf8(256),h=0;h<256;h++)n[h]=252<=h?6:248<=h?5:240<=h?4:224<=h?3:192<=h?2:1;function e(f,m){if(m<65537&&(f.subarray&&o||!f.subarray&&i))return String.fromCharCode.apply(null,r.shrinkBuf(f,m));for(var p="",E=0;E<m;E++)p+=String.fromCharCode(f[E]);return p}n[254]=n[254]=1,c.string2buf=function(f){var m,p,E,y,d,S=f.length,M=0;for(y=0;y<S;y++)55296==(64512&(p=f.charCodeAt(y)))&&y+1<S&&56320==(64512&(E=f.charCodeAt(y+1)))&&(p=65536+(p-55296<<10)+(E-56320),y++),M+=p<128?1:p<2048?2:p<65536?3:4;for(m=new r.Buf8(M),y=d=0;d<M;y++)55296==(64512&(p=f.charCodeAt(y)))&&y+1<S&&56320==(64512&(E=f.charCodeAt(y+1)))&&(p=65536+(p-55296<<10)+(E-56320),y++),p<128?m[d++]=p:(p<2048?m[d++]=192|p>>>6:(p<65536?m[d++]=224|p>>>12:(m[d++]=240|p>>>18,m[d++]=128|p>>>12&63),m[d++]=128|p>>>6&63),m[d++]=128|63&p);return m},c.buf2binstring=function(f){return e(f,f.length)},c.binstring2buf=function(f){for(var m=new r.Buf8(f.length),p=0,E=m.length;p<E;p++)m[p]=f.charCodeAt(p);return m},c.buf2string=function(f,m){var p,E,y,d,S=m||f.length,M=new Array(2*S);for(p=E=0;p<S;)if((y=f[p++])<128)M[E++]=y;else if(4<(d=n[y]))M[E++]=65533,p+=d-1;else{for(y&=2===d?31:3===d?15:7;1<d&&p<S;)y=y<<6|63&f[p++],d--;1<d?M[E++]=65533:y<65536?M[E++]=y:(M[E++]=55296|(y-=65536)>>10&1023,M[E++]=56320|1023&y)}return e(M,E)},c.utf8border=function(f,m){var p;for((m=m||f.length)>f.length&&(m=f.length),p=m-1;0<=p&&128==(192&f[p]);)p--;return p<0||0===p?m:p+n[f[p]]>m?p:m}},{"./common":41}],43:[function(l,s,c){"use strict";s.exports=function(r,i,o,n){for(var h=65535&r,e=r>>>16&65535,f=0;0!==o;){for(o-=f=2e3<o?2e3:o;e=e+(h=h+i[n++]|0)|0,--f;);h%=65521,e%=65521}return h|e<<16}},{}],44:[function(l,s,c){"use strict";s.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(l,s,c){"use strict";var r=function(){for(var i,o=[],n=0;n<256;n++){i=n;for(var h=0;h<8;h++)i=1&i?3988292384^i>>>1:i>>>1;o[n]=i}return o}();s.exports=function(i,o,n,h){var e=r,f=h+n;i^=-1;for(var m=h;m<f;m++)i=i>>>8^e[255&(i^o[m])];return~i}},{}],46:[function(l,s,c){"use strict";var r,i=l("../utils/common"),o=l("./trees"),n=l("./adler32"),h=l("./crc32"),e=l("./messages"),f=-2,m=258,p=262,E=113;function y(P,U){return P.msg=e[U],U}function d(P){return(P<<1)-(4<P?9:0)}function S(P){for(var U=P.length;0<=--U;)P[U]=0}function M(P){var U=P.state,Y=U.pending;Y>P.avail_out&&(Y=P.avail_out),0!==Y&&(i.arraySet(P.output,U.pending_buf,U.pending_out,Y,P.next_out),P.next_out+=Y,U.pending_out+=Y,P.total_out+=Y,P.avail_out-=Y,U.pending-=Y,0===U.pending&&(U.pending_out=0))}function x(P,U){o._tr_flush_block(P,0<=P.block_start?P.block_start:-1,P.strstart-P.block_start,U),P.block_start=P.strstart,M(P.strm)}function _(P,U){P.pending_buf[P.pending++]=U}function I(P,U){P.pending_buf[P.pending++]=U>>>8&255,P.pending_buf[P.pending++]=255&U}function T(P,U){var Y,H,Q=P.max_chain_length,ot=P.strstart,$=P.prev_length,it=P.nice_match,nt=P.strstart>P.w_size-p?P.strstart-(P.w_size-p):0,st=P.window,N=P.w_mask,C=P.prev,O=P.strstart+m,X=st[ot+$-1],W=st[ot+$];P.prev_length>=P.good_match&&(Q>>=2),it>P.lookahead&&(it=P.lookahead);do{if(st[(Y=U)+$]===W&&st[Y+$-1]===X&&st[Y]===st[ot]&&st[++Y]===st[ot+1]){ot+=2,Y++;do{}while(st[++ot]===st[++Y]&&st[++ot]===st[++Y]&&st[++ot]===st[++Y]&&st[++ot]===st[++Y]&&st[++ot]===st[++Y]&&st[++ot]===st[++Y]&&st[++ot]===st[++Y]&&st[++ot]===st[++Y]&&ot<O);if(H=m-(O-ot),ot=O-m,$<H){if(P.match_start=U,it<=($=H))break;X=st[ot+$-1],W=st[ot+$]}}}while((U=C[U&N])>nt&&0!=--Q);return $<=P.lookahead?$:P.lookahead}function A(P){var U,Y,H,Q,ot,$,it,nt,st,N,C=P.w_size;do{if(Q=P.window_size-P.lookahead-P.strstart,P.strstart>=C+(C-p)){for(i.arraySet(P.window,P.window,C,C,0),P.match_start-=C,P.strstart-=C,P.block_start-=C,U=Y=P.hash_size;H=P.head[--U],P.head[U]=C<=H?H-C:0,--Y;);for(U=Y=C;H=P.prev[--U],P.prev[U]=C<=H?H-C:0,--Y;);Q+=C}if(0===P.strm.avail_in)break;if(it=P.window,nt=P.strstart+P.lookahead,N=void 0,(st=Q)<(N=($=P.strm).avail_in)&&(N=st),Y=0===N?0:($.avail_in-=N,i.arraySet(it,$.input,$.next_in,N,nt),1===$.state.wrap?$.adler=n($.adler,it,N,nt):2===$.state.wrap&&($.adler=h($.adler,it,N,nt)),$.next_in+=N,$.total_in+=N,N),P.lookahead+=Y,P.lookahead+P.insert>=3)for(P.ins_h=P.window[ot=P.strstart-P.insert],P.ins_h=(P.ins_h<<P.hash_shift^P.window[ot+1])&P.hash_mask;P.insert&&(P.ins_h=(P.ins_h<<P.hash_shift^P.window[ot+3-1])&P.hash_mask,P.prev[ot&P.w_mask]=P.head[P.ins_h],P.head[P.ins_h]=ot,ot++,P.insert--,!(P.lookahead+P.insert<3)););}while(P.lookahead<p&&0!==P.strm.avail_in)}function v(P,U){for(var Y,H;;){if(P.lookahead<p){if(A(P),P.lookahead<p&&0===U)return 1;if(0===P.lookahead)break}if(Y=0,P.lookahead>=3&&(P.ins_h=(P.ins_h<<P.hash_shift^P.window[P.strstart+3-1])&P.hash_mask,Y=P.prev[P.strstart&P.w_mask]=P.head[P.ins_h],P.head[P.ins_h]=P.strstart),0!==Y&&P.strstart-Y<=P.w_size-p&&(P.match_length=T(P,Y)),P.match_length>=3)if(H=o._tr_tally(P,P.strstart-P.match_start,P.match_length-3),P.lookahead-=P.match_length,P.match_length<=P.max_lazy_match&&P.lookahead>=3){for(P.match_length--;P.strstart++,P.ins_h=(P.ins_h<<P.hash_shift^P.window[P.strstart+3-1])&P.hash_mask,Y=P.prev[P.strstart&P.w_mask]=P.head[P.ins_h],P.head[P.ins_h]=P.strstart,0!=--P.match_length;);P.strstart++}else P.strstart+=P.match_length,P.match_length=0,P.ins_h=P.window[P.strstart],P.ins_h=(P.ins_h<<P.hash_shift^P.window[P.strstart+1])&P.hash_mask;else H=o._tr_tally(P,0,P.window[P.strstart]),P.lookahead--,P.strstart++;if(H&&(x(P,!1),0===P.strm.avail_out))return 1}return P.insert=P.strstart<2?P.strstart:2,4===U?(x(P,!0),0===P.strm.avail_out?3:4):P.last_lit&&(x(P,!1),0===P.strm.avail_out)?1:2}function B(P,U){for(var Y,H,Q;;){if(P.lookahead<p){if(A(P),P.lookahead<p&&0===U)return 1;if(0===P.lookahead)break}if(Y=0,P.lookahead>=3&&(P.ins_h=(P.ins_h<<P.hash_shift^P.window[P.strstart+3-1])&P.hash_mask,Y=P.prev[P.strstart&P.w_mask]=P.head[P.ins_h],P.head[P.ins_h]=P.strstart),P.prev_length=P.match_length,P.prev_match=P.match_start,P.match_length=2,0!==Y&&P.prev_length<P.max_lazy_match&&P.strstart-Y<=P.w_size-p&&(P.match_length=T(P,Y),P.match_length<=5&&(1===P.strategy||3===P.match_length&&4096<P.strstart-P.match_start)&&(P.match_length=2)),P.prev_length>=3&&P.match_length<=P.prev_length){for(Q=P.strstart+P.lookahead-3,H=o._tr_tally(P,P.strstart-1-P.prev_match,P.prev_length-3),P.lookahead-=P.prev_length-1,P.prev_length-=2;++P.strstart<=Q&&(P.ins_h=(P.ins_h<<P.hash_shift^P.window[P.strstart+3-1])&P.hash_mask,Y=P.prev[P.strstart&P.w_mask]=P.head[P.ins_h],P.head[P.ins_h]=P.strstart),0!=--P.prev_length;);if(P.match_available=0,P.match_length=2,P.strstart++,H&&(x(P,!1),0===P.strm.avail_out))return 1}else if(P.match_available){if((H=o._tr_tally(P,0,P.window[P.strstart-1]))&&x(P,!1),P.strstart++,P.lookahead--,0===P.strm.avail_out)return 1}else P.match_available=1,P.strstart++,P.lookahead--}return P.match_available&&(H=o._tr_tally(P,0,P.window[P.strstart-1]),P.match_available=0),P.insert=P.strstart<2?P.strstart:2,4===U?(x(P,!0),0===P.strm.avail_out?3:4):P.last_lit&&(x(P,!1),0===P.strm.avail_out)?1:2}function D(P,U,Y,H,Q){this.good_length=P,this.max_lazy=U,this.nice_length=Y,this.max_chain=H,this.func=Q}function L(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new i.Buf16(1146),this.dyn_dtree=new i.Buf16(122),this.bl_tree=new i.Buf16(78),S(this.dyn_ltree),S(this.dyn_dtree),S(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new i.Buf16(16),this.heap=new i.Buf16(573),S(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new i.Buf16(573),S(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function F(P){var U;return P&&P.state?(P.total_in=P.total_out=0,P.data_type=2,(U=P.state).pending=0,U.pending_out=0,U.wrap<0&&(U.wrap=-U.wrap),U.status=U.wrap?42:E,P.adler=2===U.wrap?0:1,U.last_flush=0,o._tr_init(U),0):y(P,f)}function V(P){var Y,U=F(P);return 0===U&&((Y=P.state).window_size=2*Y.w_size,S(Y.head),Y.max_lazy_match=r[Y.level].max_lazy,Y.good_match=r[Y.level].good_length,Y.nice_match=r[Y.level].nice_length,Y.max_chain_length=r[Y.level].max_chain,Y.strstart=0,Y.block_start=0,Y.lookahead=0,Y.insert=0,Y.match_length=Y.prev_length=2,Y.match_available=0,Y.ins_h=0),U}function j(P,U,Y,H,Q,ot){if(!P)return f;var $=1;if(-1===U&&(U=6),H<0?($=0,H=-H):15<H&&($=2,H-=16),Q<1||9<Q||8!==Y||H<8||15<H||U<0||9<U||ot<0||4<ot)return y(P,f);8===H&&(H=9);var it=new L;return(P.state=it).strm=P,it.wrap=$,it.gzhead=null,it.w_bits=H,it.w_size=1<<it.w_bits,it.w_mask=it.w_size-1,it.hash_bits=Q+7,it.hash_size=1<<it.hash_bits,it.hash_mask=it.hash_size-1,it.hash_shift=~~((it.hash_bits+3-1)/3),it.window=new i.Buf8(2*it.w_size),it.head=new i.Buf16(it.hash_size),it.prev=new i.Buf16(it.w_size),it.lit_bufsize=1<<Q+6,it.pending_buf_size=4*it.lit_bufsize,it.pending_buf=new i.Buf8(it.pending_buf_size),it.d_buf=1*it.lit_bufsize,it.l_buf=3*it.lit_bufsize,it.level=U,it.strategy=ot,it.method=Y,V(P)}r=[new D(0,0,0,0,function(P,U){var Y=65535;for(Y>
vendor: 6,372 bytes, line 1
1P.pending_buf_size-5&&(Y=P.pending_buf_size-5);;){if(P.lookahead<=1){if(A(P),0===P.lookahead&&0===U)return 1;if(0===P.lookahead)break}P.strstart+=P.lookahead,P.lookahead=0;var H=P.block_start+Y;if((0===P.strstart||P.strstart>=H)&&(P.lookahead=P.strstart-H,P.strstart=H,x(P,!1),0===P.strm.avail_out)||P.strstart-P.block_start>=P.w_size-p&&(x(P,!1),0===P.strm.avail_out))return 1}return P.insert=0,4===U?(x(P,!0),0===P.strm.avail_out?3:4):(P.strstart>P.block_start&&x(P,!1),1)}),new D(4,4,8,4,v),new D(4,5,16,8,v),new D(4,6,32,32,v),new D(4,4,16,16,B),new D(8,16,32,32,B),new D(8,16,128,128,B),new D(8,32,128,256,B),new D(32,128,258,1024,B),new D(32,258,258,4096,B)],c.deflateInit=function(P,U){return j(P,U,8,15,8,0)},c.deflateInit2=j,c.deflateReset=V,c.deflateResetKeep=F,c.deflateSetHeader=function(P,U){return P&&P.state?2!==P.state.wrap?f:(P.state.gzhead=U,0):f},c.deflate=function(P,U){var Y,H,Q,ot;if(!P||!P.state||5<U||U<0)return P?y(P,f):f;if(H=P.state,!P.output||!P.input&&0!==P.avail_in||666===H.status&&4!==U)return y(P,0===P.avail_out?-5:f);if(H.strm=P,Y=H.last_flush,H.last_flush=U,42===H.status)if(2===H.wrap)P.adler=0,_(H,31),_(H,139),_(H,8),H.gzhead?(_(H,(H.gzhead.text?1:0)+(H.gzhead.hcrc?2:0)+(H.gzhead.extra?4:0)+(H.gzhead.name?8:0)+(H.gzhead.comment?16:0)),_(H,255&H.gzhead.time),_(H,H.gzhead.time>>8&255),_(H,H.gzhead.time>>16&255),_(H,H.gzhead.time>>24&255),_(H,9===H.level?2:2<=H.strategy||H.level<2?4:0),_(H,255&H.gzhead.os),H.gzhead.extra&&H.gzhead.extra.length&&(_(H,255&H.gzhead.extra.length),_(H,H.gzhead.extra.length>>8&255)),H.gzhead.hcrc&&(P.adler=h(P.adler,H.pending_buf,H.pending,0)),H.gzindex=0,H.status=69):(_(H,0),_(H,0),_(H,0),_(H,0),_(H,0),_(H,9===H.level?2:2<=H.strategy||H.level<2?4:0),_(H,3),H.status=E);else{var $=8+(H.w_bits-8<<4)<<8;$|=(2<=H.strategy||H.level<2?0:H.level<6?1:6===H.level?2:3)<<6,0!==H.strstart&&($|=32),$+=31-$%31,H.status=E,I(H,$),0!==H.strstart&&(I(H,P.adler>>>16),I(H,65535&P.adler)),P.adler=1}if(69===H.status)if(H.gzhead.extra){for(Q=H.pending;H.gzindex<(65535&H.gzhead.extra.length)&&(H.pending!==H.pending_buf_size||(H.gzhead.hcrc&&H.pending>Q&&(P.adler=h(P.adler,H.pending_buf,H.pending-Q,Q)),M(P),Q=H.pending,H.pending!==H.pending_buf_size));)_(H,255&H.gzhead.extra[H.gzindex]),H.gzindex++;H.gzhead.hcrc&&H.pending>Q&&(P.adler=h(P.adler,H.pending_buf,H.pending-Q,Q)),H.gzindex===H.gzhead.extra.length&&(H.gzindex=0,H.status=73)}else H.status=73;if(73===H.status)if(H.gzhead.name){Q=H.pending;do{if(H.pending===H.pending_buf_size&&(H.gzhead.hcrc&&H.pending>Q&&(P.adler=h(P.adler,H.pending_buf,H.pending-Q,Q)),M(P),Q=H.pending,H.pending===H.pending_buf_size)){ot=1;break}ot=H.gzindex<H.gzhead.name.length?255&H.gzhead.name.charCodeAt(H.gzindex++):0,_(H,ot)}while(0!==ot);H.gzhead.hcrc&&H.pending>Q&&(P.adler=h(P.adler,H.pending_buf,H.pending-Q,Q)),0===ot&&(H.gzindex=0,H.status=91)}else H.status=91;if(91===H.status)if(H.gzhead.comment){Q=H.pending;do{if(H.pending===H.pending_buf_size&&(H.gzhead.hcrc&&H.pending>Q&&(P.adler=h(P.adler,H.pending_buf,H.pending-Q,Q)),M(P),Q=H.pending,H.pending===H.pending_buf_size)){ot=1;break}ot=H.gzindex<H.gzhead.comment.length?255&H.gzhead.comment.charCodeAt(H.gzindex++):0,_(H,ot)}while(0!==ot);H.gzhead.hcrc&&H.pending>Q&&(P.adler=h(P.adler,H.pending_buf,H.pending-Q,Q)),0===ot&&(H.status=103)}else H.status=103;if(103===H.status&&(H.gzhead.hcrc?(H.pending+2>H.pending_buf_size&&M(P),H.pending+2<=H.pending_buf_size&&(_(H,255&P.adler),_(H,P.adler>>8&255),P.adler=0,H.status=E)):H.status=E),0!==H.pending){if(M(P),0===P.avail_out)return H.last_flush=-1,0}else if(0===P.avail_in&&d(U)<=d(Y)&&4!==U)return y(P,-5);if(666===H.status&&0!==P.avail_in)return y(P,-5);if(0!==P.avail_in||0!==H.lookahead||0!==U&&666!==H.status){var it=2===H.strategy?function(nt,st){for(var N;;){if(0===nt.lookahead&&(A(nt),0===nt.lookahead)){if(0===st)return 1;break}if(nt.match_length=0,N=o._tr_tally(nt,0,nt.window[nt.strstart]),nt.lookahead--,nt.strstart++,N&&(x(nt,!1),0===nt.strm.avail_out))return 1}return nt.insert=0,4===st?(x(nt,!0),0===nt.strm.avail_out?3:4):nt.last_lit&&(x(nt,!1),0===nt.strm.avail_out)?1:2}(H,U):3===H.strategy?function(nt,st){for(var N,C,O,X,W=nt.window;;){if(nt.lookahead<=m){if(A(nt),nt.lookahead<=m&&0===st)return 1;if(0===nt.lookahead)break}if(nt.match_length=0,nt.lookahead>=3&&0<nt.strstart&&(C=W[O=nt.strstart-1])===W[++O]&&C===W[++O]&&C===W[++O]){X=nt.strstart+m;do{}while(C===W[++O]&&C===W[++O]&&C===W[++O]&&C===W[++O]&&C===W[++O]&&C===W[++O]&&C===W[++O]&&C===W[++O]&&O<X);nt.match_length=m-(X-O),nt.match_length>nt.lookahead&&(nt.match_length=nt.lookahead)}if(nt.match_length>=3?(N=o._tr_tally(nt,1,nt.match_length-3),nt.lookahead-=nt.match_length,nt.strstart+=nt.match_length,nt.match_length=0):(N=o._tr_tally(nt,0,nt.window[nt.strstart]),nt.lookahead--,nt.strstart++),N&&(x(nt,!1),0===nt.strm.avail_out))return 1}return nt.insert=0,4===st?(x(nt,!0),0===nt.strm.avail_out?3:4):nt.last_lit&&(x(nt,!1),0===nt.strm.avail_out)?1:2}(H,U):r[H.level].func(H,U);if(3!==it&&4!==it||(H.status=666),1===it||3===it)return 0===P.avail_out&&(H.last_flush=-1),0;if(2===it&&(1===U?o._tr_align(H):5!==U&&(o._tr_stored_block(H,0,0,!1),3===U&&(S(H.head),0===H.lookahead&&(H.strstart=0,H.block_start=0,H.insert=0))),M(P),0===P.avail_out))return H.last_flush=-1,0}return 4!==U?0:H.wrap<=0?1:(2===H.wrap?(_(H,255&P.adler),_(H,P.adler>>8&255),_(H,P.adler>>16&255),_(H,P.adler>>24&255),_(H,255&P.total_in),_(H,P.total_in>>8&255),_(H,P.total_in>>16&255),_(H,P.total_in>>24&255)):(I(H,P.adler>>>16),I(H,65535&P.adler)),M(P),0<H.wrap&&(H.wrap=-H.wrap),0!==H.pending?0:1)},c.deflateEnd=function(P){var U;return P&&P.state?42!==(U=P.state.status)&&69!==U&&73!==U&&91!==U&&103!==U&&U!==E&&666!==U?y(P,f):(P.state=null,U===E?y(P,-3):0):f},c.deflateSetDictionary=function(P,U){var Y,H,Q,ot,$,it,nt,st,N=U.length;if(!P||!P.state||2===(ot=(Y=P.state).wrap)||1===ot&&42!==Y.status||Y.lookahead)return f;for(1===ot&&(P.adler=n(P.adler,U,N,0)),Y.wrap=0,N>=Y.w_size&&(0===ot&&(S(Y.head),Y.strstart=0,Y.block_start=0,Y.insert=0),st=new i.Buf8(Y.w_size),i.arraySet(st,U,N-Y.w_size,Y.w_size,0),U=st,N=Y.w_size),$=P.avail_in,it=P.next_in,nt=P.input,P.avail_in=N,P.next_in=0,P.input=U,A(Y);Y.lookahead>=3;){for(H=Y.strstart,Q=Y.lookahead-2;Y.ins_h=(Y.ins_h<<Y.hash_shift^Y.window[H+3-1])&Y.hash_mask,Y.prev[H&Y.w_mask]=Y.head[Y.ins_h],Y.head[Y.ins_h]=H,H++,--Q;);Y.strstart=H,Y.lookahead=2,A(Y)}
vendor: 4,878 bytes, line 1
1return Y.strstart+=Y.lookahead,Y.block_start=Y.strstart,Y.insert=Y.lookahead,Y.lookahead=0,Y.match_length=Y.prev_length=2,Y.match_available=0,P.next_in=it,P.input=nt,P.avail_in=$,Y.wrap=ot,0},c.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(l,s,c){"use strict";s.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(l,s,c){"use strict";s.exports=function(r,i){var o,n,h,e,f,m,p,E,y,d,S,M,x,_,I,T,A,v,B,D,L,F,V,j,P;j=r.input,h=(n=r.next_in)+(r.avail_in-5),P=r.output,f=(e=r.next_out)-(i-r.avail_out),m=e+(r.avail_out-257),p=(o=r.state).dmax,E=o.wsize,y=o.whave,d=o.wnext,S=o.window,M=o.hold,x=o.bits,_=o.lencode,I=o.distcode,T=(1<<o.lenbits)-1,A=(1<<o.distbits)-1;t:do{x<15&&(M+=j[n++]<<x,M+=j[n++]<<(x+=8),x+=8),v=_[M&T];e:for(;;){if(M>>>=B=v>>>24,x-=B,0==(B=v>>>16&255))P[e++]=65535&v;else{if(!(16&B)){if(!(64&B)){v=_[(65535&v)+(M&(1<<B)-1)];continue e}if(32&B){o.mode=12;break t}r.msg="invalid literal/length code",o.mode=30;break t}D=65535&v,(B&=15)&&(x<B&&(M+=j[n++]<<x,x+=8),D+=M&(1<<B)-1,M>>>=B,x-=B),x<15&&(M+=j[n++]<<x,M+=j[n++]<<(x+=8),x+=8),v=I[M&A];i:for(;;){if(M>>>=B=v>>>24,x-=B,!(16&(B=v>>>16&255))){if(!(64&B)){v=I[(65535&v)+(M&(1<<B)-1)];continue i}r.msg="invalid distance code",o.mode=30;break t}if(L=65535&v,x<(B&=15)&&(M+=j[n++]<<x,(x+=8)<B&&(M+=j[n++]<<x,x+=8)),p<(L+=M&(1<<B)-1)){r.msg="invalid distance too far back",o.mode=30;break t}if(M>>>=B,x-=B,(B=e-f)<L){if(y<(B=L-B)&&o.sane){r.msg="invalid distance too far back",o.mode=30;break t}if(V=S,(F=0)===d){if(F+=E-B,B<D){for(D-=B;P[e++]=S[F++],--B;);F=e-L,V=P}}else if(d<B){if(F+=E+d-B,(B-=d)<D){for(D-=B;P[e++]=S[F++],--B;);if(F=0,d<D){for(D-=B=d;P[e++]=S[F++],--B;);F=e-L,V=P}}}else if(F+=d-B,B<D){for(D-=B;P[e++]=S[F++],--B;);F=e-L,V=P}for(;2<D;)P[e++]=V[F++],P[e++]=V[F++],P[e++]=V[F++],D-=3;D&&(P[e++]=V[F++],1<D&&(P[e++]=V[F++]))}else{for(F=e-L;P[e++]=P[F++],P[e++]=P[F++],P[e++]=P[F++],2<(D-=3););D&&(P[e++]=P[F++],1<D&&(P[e++]=P[F++]))}break}}break}}while(n<h&&e<m);n-=D=x>>3,M&=(1<<(x-=D<<3))-1,r.next_in=n,r.next_out=e,r.avail_in=n<h?h-n+5:5-(n-h),r.avail_out=e<m?m-e+257:257-(e-m),o.hold=M,o.bits=x}},{}],49:[function(l,s,c){"use strict";var r=l("../utils/common"),i=l("./adler32"),o=l("./crc32"),n=l("./inffast"),h=l("./inftrees"),e=-2;function f(T){return(T>>>24&255)+(T>>>8&65280)+((65280&T)<<8)+((255&T)<<24)}function m(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new r.Buf16(320),this.work=new r.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function p(T){var A;return T&&T.state?(T.total_in=T.total_out=(A=T.state).total=0,T.msg="",A.wrap&&(T.adler=1&A.wrap),A.mode=1,A.last=0,A.havedict=0,A.dmax=32768,A.head=null,A.hold=0,A.bits=0,A.lencode=A.lendyn=new r.Buf32(852),A.distcode=A.distdyn=new r.Buf32(592),A.sane=1,A.back=-1,0):e}function E(T){var A;return T&&T.state?((A=T.state).wsize=0,A.whave=0,A.wnext=0,p(T)):e}function y(T,A){var v,B;return T&&T.state?(B=T.state,A<0?(v=0,A=-A):(v=1+(A>>4),A<48&&(A&=15)),A&&(A<8||15<A)?e:(null!==B.window&&B.wbits!==A&&(B.window=null),B.wrap=v,B.wbits=A,E(T))):e}function d(T,A){var v,B;return T?(B=new m,(T.state=B).window=null,0!==(v=y(T,A))&&(T.state=null),v):e}var S,M,x=!0;function _(T){if(x){var A;for(S=new r.Buf32(512),M=new r.Buf32(32),A=0;A<144;)T.lens[A++]=8;for(;A<256;)T.lens[A++]=9;for(;A<280;)T.lens[A++]=7;for(;A<288;)T.lens[A++]=8;for(h(1,T.lens,0,288,S,0,T.work,{bits:9}),A=0;A<32;)T.lens[A++]=5;h(2,T.lens,0,32,M,0,T.work,{bits:5}),x=!1}T.lencode=S,T.lenbits=9,T.distcode=M,T.distbits=5}function I(T,A,v,B){var D,L=T.state;return null===L.window&&(L.wsize=1<<L.wbits,L.wnext=0,L.whave=0,L.window=new r.Buf8(L.wsize)),B>=L.wsize?(r.arraySet(L.window,A,v-L.wsize,L.wsize,0),L.wnext=0,L.whave=L.wsize):(B<(D=L.wsize-L.wnext)&&(D=B),r.arraySet(L.window,A,v-B,D,L.wnext),(B-=D)?(r.arraySet(L.window,A,v-B,B,0),L.wnext=B,L.whave=L.wsize):(L.wnext+=D,L.wnext===L.wsize&&(L.wnext=0),L.whave<L.wsize&&(L.whave+=D))),0}c.inflateReset=E,c.inflateReset2=y,c.inflateResetKeep=p,c.inflateInit=function(T){return d(T,15)},c.inflateInit2=d,c.inflate=function(T,A){var v,B,D,L,F,V,j,P,U,Y,H,Q,ot,$,it,nt,st,N,C,O,X,W,G,K,q=0,Z=new r.Buf8(4),et=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!T||!T.state||!T.output||!T.input&&0!==T.avail_in)return e;12===(v=T.state).mode&&(v.mode=13),F=T.next_out,D=T.output,L=T.next_in,B=T.input,P
vendor: 3,347 bytes, line 1
1=v.hold,U=v.bits,Y=V=T.avail_in,H=j=T.avail_out,W=0;t:for(;;)switch(v.mode){case 1:if(0===v.wrap){v.mode=13;break}for(;U<16;){if(0===V)break t;V--,P+=B[L++]<<U,U+=8}if(2&v.wrap&&35615===P){Z[v.check=0]=255&P,Z[1]=P>>>8&255,v.check=o(v.check,Z,2,0),U=P=0,v.mode=2;break}if(v.flags=0,v.head&&(v.head.done=!1),!(1&v.wrap)||(((255&P)<<8)+(P>>8))%31){T.msg="incorrect header check",v.mode=30;break}if(8!=(15&P)){T.msg="unknown compression method",v.mode=30;break}if(U-=4,X=8+(15&(P>>>=4)),0===v.wbits)v.wbits=X;else if(X>v.wbits){T.msg="invalid window size",v.mode=30;break}v.dmax=1<<X,T.adler=v.check=1,v.mode=512&P?10:12,U=P=0;break;case 2:for(;U<16;){if(0===V)break t;V--,P+=B[L++]<<U,U+=8}if(v.flags=P,8!=(255&v.flags)){T.msg="unknown compression method",v.mode=30;break}if(57344&v.flags){T.msg="unknown header flags set",v.mode=30;break}v.head&&(v.head.text=P>>8&1),512&v.flags&&(Z[0]=255&P,Z[1]=P>>>8&255,v.check=o(v.check,Z,2,0)),U=P=0,v.mode=3;case 3:for(;U<32;){if(0===V)break t;V--,P+=B[L++]<<U,U+=8}v.head&&(v.head.time=P),512&v.flags&&(Z[0]=255&P,Z[1]=P>>>8&255,Z[2]=P>>>16&255,Z[3]=P>>>24&255,v.check=o(v.check,Z,4,0)),U=P=0,v.mode=4;case 4:for(;U<16;){if(0===V)break t;V--,P+=B[L++]<<U,U+=8}v.head&&(v.head.xflags=255&P,v.head.os=P>>8),512&v.flags&&(Z[0]=255&P,Z[1]=P>>>8&255,v.check=o(v.check,Z,2,0)),U=P=0,v.mode=5;case 5:if(1024&v.flags){for(;U<16;){if(0===V)break t;V--,P+=B[L++]<<U,U+=8}v.length=P,v.head&&(v.head.extra_len=P),512&v.flags&&(Z[0]=255&P,Z[1]=P>>>8&255,v.check=o(v.check,Z,2,0)),U=P=0}else v.head&&(v.head.extra=null);v.mode=6;case 6:if(1024&v.flags&&(V<(Q=v.length)&&(Q=V),Q&&(v.head&&(X=v.head.extra_len-v.length,v.head.extra||(v.head.extra=new Array(v.head.extra_len)),r.arraySet(v.head.extra,B,L,Q,X)),512&v.flags&&(v.check=o(v.check,B,Q,L)),V-=Q,L+=Q,v.length-=Q),v.length))break t;v.length=0,v.mode=7;case 7:if(2048&v.flags){if(0===V)break t;for(Q=0;X=B[L+Q++],v.head&&X&&v.length<65536&&(v.head.name+=String.fromCharCode(X)),X&&Q<V;);if(512&v.flags&&(v.check=o(v.check,B,Q,L)),V-=Q,L+=Q,X)break t}else v.head&&(v.head.name=null);v.length=0,v.mode=8;case 8:if(4096&v.flags){if(0===V)break t;for(Q=0;X=B[L+Q++],v.head&&X&&v.length<65536&&(v.head.comment+=String.fromCharCode(X)),X&&Q<V;);if(512&v.flags&&(v.check=o(v.check,B,Q,L)),V-=Q,L+=Q,X)break t}else v.head&&(v.head.comment=null);v.mode=9;case 9:if(512&v.flags){for(;U<16;){if(0===V)break t;V--,P+=B[L++]<<U,U+=8}if(P!==(65535&v.check)){T.msg="header crc mismatch",v.mode=30;break}U=P=0}v.head&&(v.head.hcrc=v.flags>>9&1,v.head.done=!0),T.adler=v.check=0,v.mode=12;break;case 10:for(;U<32;){if(0===V)break t;V--,P+=B[L++]<<U,U+=8}T.adler=v.check=f(P),U=P=0,v.mode=11;case 11:if(0===v.havedict)return T.next_out=F,T.avail_out=j,T.next_in=L,T.avail_in=V,v.hold=P,v.bits=U,2;T.adler=v.check=1,v.mode=12;case 12:if(5===A||6===A)break t;case 13:if(v.last){P>>>=7&U,U-=7&U,v.mode=27;break}for(;U<3;){if(0===V)break t;V--,P+=B[L++]<<U,U+=8}switch(v.last=1&P,U-=1,3&(P>>>=1)){case 0:v.mode=14;break;case 1:if(_(v),v.mode=20,6!==A)break;P>>>=2,U-=2;break t;case 2:v.mode=17;break;case 3:T.msg="invalid block type",v.mode=30}P>>>=2,U-=2;break;case 14:for(P>>>=7&U,U-=7&U;U<32;){if(0===V)break t;V--,P+=B[L++]<<U,U+=8}if((65535&P)!=(P>>>16^65535)){T.msg="invalid stored block lengths",v.mode=30;break}if(v.length=65535&P,U=P=0,v.mode=15,6===A)break t;case 15:v.mode=16;
vendor: 4,148 bytes, line 1
1case 16:if(Q=v.length){if(V<Q&&(Q=V),j<Q&&(Q=j),0===Q)break t;r.arraySet(D,B,L,Q,F),V-=Q,L+=Q,j-=Q,F+=Q,v.length-=Q;break}v.mode=12;break;case 17:for(;U<14;){if(0===V)break t;V--,P+=B[L++]<<U,U+=8}if(v.nlen=257+(31&P),U-=5,v.ndist=1+(31&(P>>>=5)),U-=5,v.ncode=4+(15&(P>>>=5)),P>>>=4,U-=4,286<v.nlen||30<v.ndist){T.msg="too many length or distance symbols",v.mode=30;break}v.have=0,v.mode=18;case 18:for(;v.have<v.ncode;){for(;U<3;){if(0===V)break t;V--,P+=B[L++]<<U,U+=8}v.lens[et[v.have++]]=7&P,P>>>=3,U-=3}for(;v.have<19;)v.lens[et[v.have++]]=0;if(v.lencode=v.lendyn,v.lenbits=7,W=h(0,v.lens,0,19,v.lencode,0,v.work,G={bits:v.lenbits}),v.lenbits=G.bits,W){T.msg="invalid code lengths set",v.mode=30;break}v.have=0,v.mode=19;case 19:for(;v.have<v.nlen+v.ndist;){for(;nt=(q=v.lencode[P&(1<<v.lenbits)-1])>>>16&255,st=65535&q,!((it=q>>>24)<=U);){if(0===V)break t;V--,P+=B[L++]<<U,U+=8}if(st<16)P>>>=it,U-=it,v.lens[v.have++]=st;else{if(16===st){for(K=it+2;U<K;){if(0===V)break t;V--,P+=B[L++]<<U,U+=8}if(P>>>=it,U-=it,0===v.have){T.msg="invalid bit length repeat",v.mode=30;break}X=v.lens[v.have-1],Q=3+(3&P),P>>>=2,U-=2}else if(17===st){for(K=it+3;U<K;){if(0===V)break t;V--,P+=B[L++]<<U,U+=8}U-=it,X=0,Q=3+(7&(P>>>=it)),P>>>=3,U-=3}else{for(K=it+7;U<K;){if(0===V)break t;V--,P+=B[L++]<<U,U+=8}U-=it,X=0,Q=11+(127&(P>>>=it)),P>>>=7,U-=7}if(v.have+Q>v.nlen+v.ndist){T.msg="invalid bit length repeat",v.mode=30;break}for(;Q--;)v.lens[v.have++]=X}}if(30===v.mode)break;if(0===v.lens[256]){T.msg="invalid code -- missing end-of-block",v.mode=30;break}if(v.lenbits=9,W=h(1,v.lens,0,v.nlen,v.lencode,0,v.work,G={bits:v.lenbits}),v.lenbits=G.bits,W){T.msg="invalid literal/lengths set",v.mode=30;break}if(v.distbits=6,v.distcode=v.distdyn,W=h(2,v.lens,v.nlen,v.ndist,v.distcode,0,v.work,G={bits:v.distbits}),v.distbits=G.bits,W){T.msg="invalid distances set",v.mode=30;break}if(v.mode=20,6===A)break t;case 20:v.mode=21;case 21:if(6<=V&&258<=j){T.next_out=F,T.avail_out=j,T.next_in=L,T.avail_in=V,v.hold=P,v.bits=U,n(T,H),F=T.next_out,D=T.output,j=T.avail_out,L=T.next_in,B=T.input,V=T.avail_in,P=v.hold,U=v.bits,12===v.mode&&(v.back=-1);break}for(v.back=0;nt=(q=v.lencode[P&(1<<v.lenbits)-1])>>>16&255,st=65535&q,!((it=q>>>24)<=U);){if(0===V)break t;V--,P+=B[L++]<<U,U+=8}if(nt&&!(240&nt)){for(N=it,C=nt,O=st;nt=(q=v.lencode[O+((P&(1<<N+C)-1)>>N)])>>>16&255,st=65535&q,!(N+(it=q>>>24)<=U);){if(0===V)break t;V--,P+=B[L++]<<U,U+=8}P>>>=N,U-=N,v.back+=N}if(P>>>=it,U-=it,v.back+=it,v.length=st,0===nt){v.mode=26;break}if(32&nt){v.back=-1,v.mode=12;break}if(64&nt){T.msg="invalid literal/length code",v.mode=30;break}v.extra=15&nt,v.mode=22;case 22:if(v.extra){for(K=v.extra;U<K;){if(0===V)break t;V--,P+=B[L++]<<U,U+=8}v.length+=P&(1<<v.extra)-1,P>>>=v.extra,U-=v.extra,v.back+=v.extra}v.was=v.length,v.mode=23;case 23:for(;nt=(q=v.distcode[P&(1<<v.distbits)-1])>>>16&255,st=65535&q,!((it=q>>>24)<=U);){if(0===V)break t;V--,P+=B[L++]<<U,U+=8}if(!(240&nt)){for(N=it,C=nt,O=st;nt=(q=v.distcode[O+((P&(1<<N+C)-1)>>N)])>>>16&255,st=65535&q,!(N+(it=q>>>24)<=U);){if(0===V)break t;V--,P+=B[L++]<<U,U+=8}P>>>=N,U-=N,v.back+=N}if(P>>>=it,U-=it,v.back+=it,64&nt){T.msg="invalid distance code",v.mode=30;break}v.offset=st,v.extra=15&nt,v.mode=24;case 24:if(v.extra){for(K=v.extra;U<K;){if(0===V)break t;V--,P+=B[L++]<<U,U+=8}v.offset+=P&(1<<v.extra)-1,P>>>=v.extra,U-=v.extra,v.back+=v.extra}if(v.offset>v.dmax){T.msg="invalid distance too far back",v.mode=30;break}v.mode=25;case 25:if(0===j)break t;if(v.offset>(Q=H-j)){if((Q=v.offset-Q)>v.whave&&v.sane){T.msg="invalid distance too far back",v.mode=30;break}ot=Q>v.wnext?v.wsize-(Q-=v.wnext):v.wnext-Q,Q>v.length&&(Q=v.length),$=v.window}else $=D,ot=F-v.offset,Q=v.length;for(j<Q&&(Q=j),j-=Q,v.length-=Q;D[F++]=$[ot++],--Q;);0===v.length&&(v.mode=21);break;case 26:if(0===j)break t;D[F++]=v.length,j--,v.mode=21;break;case 27:if(v.wrap){for(;U<32;){if(0===V)break t;V--,P|=B[L++]<<U,U+=8}if(T.total_out+=H-=j,v.total+=H,H&&(T.adler=v.check=v.flags?o(v.check,D,H,F-H):i(v.check,D,H,F-H)),H=j,(v.flags?P:f(P))!==v.check){T.msg="incorrect data check",v.mode=30;break}U=P=0}v.mode=28;case 28:if(v.wrap&&v.flags){for(;
vendor: 5,755 bytes, line 1
1U<32;){if(0===V)break t;V--,P+=B[L++]<<U,U+=8}if(P!==(4294967295&v.total)){T.msg="incorrect length check",v.mode=30;break}U=P=0}v.mode=29;case 29:W=1;break t;case 30:W=-3;break t;case 31:return-4;default:return e}return T.next_out=F,T.avail_out=j,T.next_in=L,T.avail_in=V,v.hold=P,v.bits=U,(v.wsize||H!==T.avail_out&&v.mode<30&&(v.mode<27||4!==A))&&I(T,T.output,T.next_out,H-T.avail_out)?(v.mode=31,-4):(H-=T.avail_out,T.total_in+=Y-=T.avail_in,T.total_out+=H,v.total+=H,v.wrap&&H&&(T.adler=v.check=v.flags?o(v.check,D,H,T.next_out-H):i(v.check,D,H,T.next_out-H)),T.data_type=v.bits+(v.last?64:0)+(12===v.mode?128:0)+(20===v.mode||15===v.mode?256:0),(0==Y&&0===H||4===A)&&0===W&&(W=-5),W)},c.inflateEnd=function(T){if(!T||!T.state)return e;var A=T.state;return A.window&&(A.window=null),T.state=null,0},c.inflateGetHeader=function(T,A){var v;return T&&T.state&&2&(v=T.state).wrap?((v.head=A).done=!1,0):e},c.inflateSetDictionary=function(T,A){var v,B=A.length;return T&&T.state?0!==(v=T.state).wrap&&11!==v.mode?e:11===v.mode&&i(1,A,B,0)!==v.check?-3:I(T,A,B,B)?(v.mode=31,-4):(v.havedict=1,0):e},c.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(l,s,c){"use strict";var r=l("../utils/common"),i=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],o=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],n=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],h=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];s.exports=function(e,f,m,p,E,y,d,S){var M,x,_,I,T,A,v,B,D,L=S.bits,F=0,V=0,j=0,P=0,U=0,Y=0,H=0,Q=0,ot=0,$=0,it=null,nt=0,st=new r.Buf16(16),N=new r.Buf16(16),C=null,O=0;for(F=0;F<=15;F++)st[F]=0;for(V=0;V<p;V++)st[f[m+V]]++;for(U=L,P=15;1<=P&&0===st[P];P--);if(P<U&&(U=P),0===P)return E[y++]=20971520,E[y++]=20971520,S.bits=1,0;for(j=1;j<P&&0===st[j];j++);for(U<j&&(U=j),F=Q=1;F<=15;F++)if(Q<<=1,(Q-=st[F])<0)return-1;if(0<Q&&(0===e||1!==P))return-1;for(N[1]=0,F=1;F<15;F++)N[F+1]=N[F]+st[F];for(V=0;V<p;V++)0!==f[m+V]&&(d[N[f[m+V]]++]=V);if(A=0===e?(it=C=d,19):1===e?(it=i,nt-=257,C=o,O-=257,256):(it=n,C=h,-1),F=j,T=y,H=V=$=0,_=-1,I=(ot=1<<(Y=U))-1,1===e&&852<ot||2===e&&592<ot)return 1;for(;;){for(v=F-H,D=d[V]<A?(B=0,d[V]):d[V]>A?(B=C[O+d[V]],it[nt+d[V]]):(B=96,0),M=1<<F-H,j=x=1<<Y;E[T+($>>H)+(x-=M)]=v<<24|B<<16|D,0!==x;);for(M=1<<F-1;$&M;)M>>=1;if(0!==M?($&=M-1,$+=M):$=0,V++,0==--st[F]){if(F===P)break;F=f[m+d[V]]}if(U<F&&($&I)!==_){for(0===H&&(H=U),T+=j,Q=1<<(Y=F-H);Y+H<P&&!((Q-=st[Y+H])<=0);)Y++,Q<<=1;if(ot+=1<<Y,1===e&&852<ot||2===e&&592<ot)return 1;E[_=$&I]=U<<24|Y<<16|T-y}}return 0!==$&&(E[T+$]=F-H<<24|4194304),S.bits=U,0}},{"../utils/common":41}],51:[function(l,s,c){"use strict";s.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(l,s,c){"use strict";var r=l("../utils/common");function i(C){for(var O=C.length;0<=--O;)C[O]=0}var e=15,f=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],m=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],p=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],E=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],y=new Array(576);i(y);var d=new Array(60);i(d);var S=new Array(512);i(S);var M=new Array(256);i(M);var x=new Array(29);i(x);var _,I,T,A=new Array(30);function v(C,O,X,W,G){this.static_tree=C,this.extra_bits=O,this.extra_base=X,this.elems=W,this.max_length=G,this.has_stree=C&&C.length}function B(C,O){this.dyn_tree=C,this.max_code=0,this.stat_desc=O}function D(C){return C<256?S[C]:S[256+(C>>>7)]}function L(C,O){C.pending_buf[C.pending++]=255&O,C.pending_buf[C.pending++]=O>>>8&255}function F(C,O,X){C.bi_valid>16-X?(C.bi_buf|=O<<C.bi_valid&65535,L(C,C.bi_buf),C.bi_buf=O>>16-C.bi_valid,C.bi_valid+=X-16):(C.bi_buf|=O<<C.bi_valid&65535,C.bi_valid+=X)}function V(C,O,X){F(C,X[2*O],X[2*O+1])}function j(C,O){for(var X=0;X|=1&C,C>>>=1,X<<=1,0<--O;);return X>>>1}function P(C,O,X){var W,G,K=new Array(16),q=0;for(W=1;W<=e;W++)K[W]=q=q+X[W-1]<<1;for(G=0;G<=O;G++){var Z=C[2*G+1];0!==Z&&(C[2*G]=j(K[Z]++,Z))}}function U(C){var O;for(O=0;O<286;O++)C.dyn_ltree[2*O]=0;for(O=0;O<30;O++)C.dyn_dtree[2*O]=0;for(O=0;O<19;O++)C.bl_tree[2*O]=0;C.dyn_ltree[512]=1,C.opt_len=C.static_len=0,C.last_lit=C.matches=0}function Y(C){8<C.bi_valid?L(C,C.bi_buf):0<C.bi_valid&&(C.pending_buf[C.pending++]=C.bi_buf),C.bi_buf=0,C.bi_valid=0}function H(C,O,X,W){var G=2*O,K=2*X;return C[G]<C[K]||C[G]===C[K]&&W[O]<=W[X]}function Q(C,O,X){for(var W=C.heap[X],G=X<<1;G<=C.heap_len&&(G<C.heap_len&&H(O,C.heap[G+1],C.heap[G],C.depth)&&G++,!H(O,W,C.heap[G],C.depth));)C.heap[X]=C.heap[G],X=G,G<<=1;C.heap[X]=W}function ot(C,O,X){var W,G,K,q,Z=0;if(0!==C.last_lit)for(;W=C.pending_buf[C.d_buf+2*Z]<<8|C.pending_buf[C.d_buf+2*Z+1],G=C.pending_buf[C.l_buf+Z],Z++,0===W?V(C,G,O):(V(C,(K=M[G])+256+1,O),0!==(q=f[K])&&F(C,G-=x[K],q),V(C,K=D(--W),X),0!==(q=m[K])&&F(C,W-=A[K],q)),Z<C.last_lit;);V(C,256,O)}function $(C,O){var X,W,G,K=O.dyn_tree,q=O.stat_desc.static_tree,Z=O.stat_desc.has_stree,et=O.stat_desc.elems,ct=-1;for(C.heap_len=0,C.heap_max=573,X=0;X<et;X++)0!==K[2*X]?(C.heap[++C.heap_len]=ct=X,C.depth[X]=0):K[2*X+1]=0;for(;C.heap_len<2;)K[2*(G=C.heap[++C.heap_len]=ct<2?++ct:0)]=1,C.depth[G]=0,C.opt_len--,Z&&(C.static_len-=q[2*G+1]);for(O.max_code=ct,X=C.heap_len>>1;1<=X;X--)Q(C,K,X);for(G=et;X=C.heap[1],C.heap[1]=C.heap[C.heap_len--],Q(C,K,1),W=C.heap[1],C.heap[--C.heap_max]=X,C.heap[--C.heap_max]=W,K[2*G]=K[2*X]+K[2*W],C.depth[G]=(C.depth[X]>
vendor: 23,204 bytes, line 1
1=C.depth[W]?C.depth[X]:C.depth[W])+1,K[2*X+1]=K[2*W+1]=G,C.heap[1]=G++,Q(C,K,1),2<=C.heap_len;);C.heap[--C.heap_max]=C.heap[1],function(pt,gt){var Et,St,Mt,yt,vt,_t,At=gt.dyn_tree,Nt=gt.max_code,Bt=gt.stat_desc.static_tree,Ft=gt.stat_desc.has_stree,Ot=gt.stat_desc.extra_bits,It=gt.stat_desc.extra_base,Rt=gt.stat_desc.max_length,Dt=0;for(yt=0;yt<=e;yt++)pt.bl_count[yt]=0;for(At[2*pt.heap[pt.heap_max]+1]=0,Et=pt.heap_max+1;Et<573;Et++)Rt<(yt=At[2*At[2*(St=pt.heap[Et])+1]+1]+1)&&(yt=Rt,Dt++),At[2*St+1]=yt,Nt<St||(pt.bl_count[yt]++,vt=0,It<=St&&(vt=Ot[St-It]),pt.opt_len+=(_t=At[2*St])*(yt+vt),Ft&&(pt.static_len+=_t*(Bt[2*St+1]+vt)));if(0!==Dt){do{for(yt=Rt-1;0===pt.bl_count[yt];)yt--;pt.bl_count[yt]--,pt.bl_count[yt+1]+=2,pt.bl_count[Rt]--,Dt-=2}while(0<Dt);for(yt=Rt;0!==yt;yt--)for(St=pt.bl_count[yt];0!==St;)Nt<(Mt=pt.heap[--Et])||(At[2*Mt+1]!==yt&&(pt.opt_len+=(yt-At[2*Mt+1])*At[2*Mt],At[2*Mt+1]=yt),St--)}}(C,O),P(K,ct,C.bl_count)}function it(C,O,X){var W,G,K=-1,q=O[1],Z=0,et=7,ct=4;for(0===q&&(et=138,ct=3),O[2*(X+1)+1]=65535,W=0;W<=X;W++)G=q,q=O[2*(W+1)+1],++Z<et&&G===q||(Z<ct?C.bl_tree[2*G]+=Z:0!==G?(G!==K&&C.bl_tree[2*G]++,C.bl_tree[32]++):Z<=10?C.bl_tree[34]++:C.bl_tree[36]++,K=G,ct=(Z=0)===q?(et=138,3):G===q?(et=6,3):(et=7,4))}function nt(C,O,X){var W,G,K=-1,q=O[1],Z=0,et=7,ct=4;for(0===q&&(et=138,ct=3),W=0;W<=X;W++)if(G=q,q=O[2*(W+1)+1],!(++Z<et&&G===q)){if(Z<ct)for(;V(C,G,C.bl_tree),0!=--Z;);else 0!==G?(G!==K&&(V(C,G,C.bl_tree),Z--),V(C,16,C.bl_tree),F(C,Z-3,2)):Z<=10?(V(C,17,C.bl_tree),F(C,Z-3,3)):(V(C,18,C.bl_tree),F(C,Z-11,7));K=G,ct=(Z=0)===q?(et=138,3):G===q?(et=6,3):(et=7,4)}}i(A);var st=!1;function N(C,O,X,W){var G,K,q;F(C,0+(W?1:0),3),K=O,q=X,Y(G=C),L(G,q),L(G,~q),r.arraySet(G.pending_buf,G.window,K,q,G.pending),G.pending+=q}c._tr_init=function(C){st||(function(){var O,X,W,G,K,q=new Array(16);for(G=W=0;G<28;G++)for(x[G]=W,O=0;O<1<<f[G];O++)M[W++]=G;for(M[W-1]=G,G=K=0;G<16;G++)for(A[G]=K,O=0;O<1<<m[G];O++)S[K++]=G;for(K>>=7;G<30;G++)for(A[G]=K<<7,O=0;O<1<<m[G]-7;O++)S[256+K++]=G;for(X=0;X<=e;X++)q[X]=0;for(O=0;O<=143;)y[2*O+1]=8,O++,q[8]++;for(;O<=255;)y[2*O+1]=9,O++,q[9]++;for(;O<=279;)y[2*O+1]=7,O++,q[7]++;for(;O<=287;)y[2*O+1]=8,O++,q[8]++;for(P(y,287,q),O=0;O<30;O++)d[2*O+1]=5,d[2*O]=j(O,5);_=new v(y,f,257,286,e),I=new v(d,m,0,30,e),T=new v(new Array(0),p,0,19,7)}(),st=!0),C.l_desc=new B(C.dyn_ltree,_),C.d_desc=new B(C.dyn_dtree,I),C.bl_desc=new B(C.bl_tree,T),C.bi_buf=0,C.bi_valid=0,U(C)},c._tr_stored_block=N,c._tr_flush_block=function(C,O,X,W){var G,K,q=0;0<C.level?(2===C.strm.data_type&&(C.strm.data_type=function(Z){var et,ct=4093624447;for(et=0;et<=31;et++,ct>>>=1)if(1&ct&&0!==Z.dyn_ltree[2*et])return 0;if(0!==Z.dyn_ltree[18]||0!==Z.dyn_ltree[20]||0!==Z.dyn_ltree[26])return 1;for(et=32;et<256;et++)if(0!==Z.dyn_ltree[2*et])return 1;return 0}(C)),$(C,C.l_desc),$(C,C.d_desc),q=function(Z){var et;for(it(Z,Z.dyn_ltree,Z.l_desc.max_code),it(Z,Z.dyn_dtree,Z.d_desc.max_code),$(Z,Z.bl_desc),et=18;3<=et&&0===Z.bl_tree[2*E[et]+1];et--);return Z.opt_len+=3*(et+1)+5+5+4,et}(C),(K=C.static_len+3+7>>>3)<=(G=C.opt_len+3+7>>>3)&&(G=K)):G=K=X+5,X+4<=G&&-1!==O?N(C,O,X,W):4===C.strategy||K===G?(F(C,2+(W?1:0),3),ot(C,y,d)):(F(C,4+(W?1:0),3),function(Z,et,ct,pt){var gt;for(F(Z,et-257,5),F(Z,ct-1,5),F(Z,pt-4,4),gt=0;gt<pt;gt++)F(Z,Z.bl_tree[2*E[gt]+1],3);nt(Z,Z.dyn_ltree,et-1),nt(Z,Z.dyn_dtree,ct-1)}(C,C.l_desc.max_code+1,C.d_desc.max_code+1,q+1),ot(C,C.dyn_ltree,C.dyn_dtree)),U(C),W&&Y(C)},c._tr_tally=function(C,O,X){return C.pending_buf[C.d_buf+2*C.last_lit]=O>>>8&255,C.pending_buf[C.d_buf+2*C.last_lit+1]=255&O,C.pending_buf[C.l_buf+C.last_lit]=255&X,C.last_lit++,0===O?C.dyn_ltree[2*X]++:(C.matches++,O--,C.dyn_ltree[2*(M[X]+256+1)]++,C.dyn_dtree[2*D(O)]++),C.last_lit===C.lit_bufsize-1},c._tr_align=function(C){var O;F(C,2,3),V(C,256,y),16===(O=C).bi_valid?(L(O,O.bi_buf),O.bi_buf=0,O.bi_valid=0):8<=O.bi_valid&&(O.pending_buf[O.pending++]=255&O.bi_buf,O.bi_buf>>=8,O.bi_valid-=8)}},{"../utils/common":41}],53:[function(l,s,c){"use strict";s.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(l,s,c){(function(r){!function(i){"use strict";if(!i.setImmediate){var o,n,h,e,f=1,m={},p=!1,E=i.document,y=Object.getPrototypeOf&&Object.getPrototypeOf(i);y=y&&y.setTimeout?y:i,o="[object process]"==={}.toString.call(i.process)?function(x){process.nextTick(function(){S(x)})}:function(){if(i.postMessage&&!i.importScripts){var x=!0,_=i.onmessage;return i.onmessage=function(){x=!1},i.postMessage("","*"),i.onmessage=_,x}}()?(e="setImmediate$"+Math.random()+"$",i.addEventListener?i.addEventListener("message",M,!1):i.attachEvent("onmessage",M),function(x){i.postMessage(e+x,"*")}):i.MessageChannel?((h=new MessageChannel).port1.onmessage=function(x){S(x.data)},function(x){h.port2.postMessage(x)}):E&&"onreadystatechange"in E.createElement("script")?(n=E.documentElement,function(x){var _=E.createElement("script");_.onreadystatechange=function(){S(x),_.onreadystatechange=null,n.removeChild(_),_=null},n.appendChild(_)}):function(x){setTimeout(S,0,x)},y.setImmediate=function(x){"function"!=typeof x&&(x=new Function(""+x));for(var _=new Array(arguments.length-1),I=0;I<_.length;I++)_[I]=arguments[I+1];return m[f]={callback:x,args:_},o(f),f++},y.clearImmediate=d}function d(x){delete m[x]}function S(x){if(p)setTimeout(S,0,x);else{var _=m[x];if(_){p=!0;try{!function(I){var T=I.callback,A=I.args;switch(A.length){case 0:T();break;case 1:T(A[0]);break;case 2:T(A[0],A[1]);break;case 3:T(A[0],A[1],A[2]);break;default:T.apply(void 0,A)}}(_)}finally{d(x),p=!1}}}}function M(x){x.source===i&&"string"==typeof x.data&&0===x.data.indexOf(e)&&S(+x.data.slice(e.length))}}(typeof self>"u"?void 0===r?this:r:self)}).call(this,void 0!==u.g?u.g:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)},3065(dt,g,u){var l,s;!function(){"use strict";l=function(){var c=function(){},r="undefined",i=typeof window!==r&&typeof window.navigator!==r&&/Trident\/|MSIE /.test(window.navigator.userAgent),o=["trace","debug","info","warn","error"],n={},h=null;function e(S,M){var x=S[M];if("function"==typeof x.bind)return x.bind(S);try{return Function.prototype.bind.call(x,S)}catch{return function(){return Function.prototype.apply.apply(x,[S,arguments])}}}function f(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function m(){for(var S=this.getLevel(),M=0;M<o.length;M++){var x=o[M];this[x]=M<S?c:this.methodFactory(x,S,this.name)}if(this.log=this.debug,typeof console===r&&S<this.levels.SILENT)return"No console available for logging"}function p(S){return function(){typeof console!==r&&(m.call(this),this[S].apply(this,arguments))}}function E(S,M,x){return"debug"===(_=S)&&(_="log"),typeof console!==r&&("trace"===_&&i?f:void 0!==console[_]?e(console,_):void 0!==console.log?e(console,"log"):c)||p.apply(this,arguments);var _}function y(S,M){var x,_,I,T=this,A="loglevel";function v(){var L;if(typeof window!==r&&A){try{L=window.localStorage[A]}catch{}if(typeof L===r)try{var F=window.document.cookie,V=encodeURIComponent(A),j=F.indexOf(V+"=");-1!==j&&(L=/^([^;]+)/.exec(F.slice(j+V.length+1))[1])}catch{}return void 0===T.levels[L]&&(L=void 0),L}}function B(L){var F=L;if("string"==typeof F&&void 0!==T.levels[F.toUpperCase()]&&(F=T.levels[F.toUpperCase()]),"number"==typeof F&&F>=0&&F<=T.levels.SILENT)return F;throw new TypeError("log.setLevel() called with invalid level: "+L)}"string"==typeof S?A+=":"+S:"symbol"==typeof S&&(A=void 0),T.name=S,T.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},T.methodFactory=M||E,T.getLevel=function(){return I??_??x},T.setLevel=function(L,F){return I=B(L),!1!==F&&function(V){var j=(o[V]||"silent").toUpperCase();if(typeof window!==r&&A){try{return void(window.localStorage[A]=j)}catch{}try{window.document.cookie=encodeURIComponent(A)+"="+j+";"}catch{}}}(I),m.call(T)},T.setDefaultLevel=function(L){_=B(L),v()||T.setLevel(L,!1)},T.resetLevel=function(){I=null,function(){if(typeof window!==r&&A){try{window.localStorage.removeItem(A)}catch{}try{window.document.cookie=encodeURIComponent(A)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}(),m.call(T)},T.enableAll=function(L){T.setLevel(T.levels.TRACE,L)},T.disableAll=function(L){T.setLevel(T.levels.SILENT,L)},T.rebuild=function(){if(h!==T&&(x=B(h.getLevel())),m.call(T),h===T)for(var L in n)n[L].rebuild()},x=B(h?h.getLevel():"WARN");var D=v();null!=D&&(I=B(D)),m.call(T)}(h=new y).getLogger=function(S){if("symbol"!=typeof S&&"string"!=typeof S||""===S)throw new TypeError("You must supply a name when creating a logger.");var M=n[S];return M||(M=n[S]=new y(S,h.methodFactory)),M};var d=typeof window!==r?window.log:void 0;return h.noConflict=function(){return typeof window!==r&&window.log===h&&(window.log=d),h},h.getLoggers=function(){return n},h.default=h,h},void 0===(s=l.call(g,u,g,dt))||(dt.exports=s)}()},2561(dt,g){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.Fraction=void 0;class u{static max(s,c){return s.RealValue>c.RealValue?s:c}static Equal(s,c){return s.wholeValue===c.wholeValue&&s.Denominator===c.Denominator&&s.Numerator===c.Numerator}static createFromFraction(s){return new u(s.numerator,s.denominator,s.wholeValue,!1)}static plus(s,c){const r=s.clone();return r.Add(c),r}static minus(s,c){const r=s.clone();return r.Sub(c),r}static multiply(s,c){return new u((s.wholeValue*s.denominator+s.numerator)*(c.wholeValue*c.denominator+c.numerator),s.denominator*c.denominator)}static greatestCommonDenominator(s,c){if(0===s)return c;if(1===c)return 1;for(;Math.abs(c)>=1&&Math.abs(s)>=1;)s>c?s-=c:c-=s;const r=Math.round(s);return Math.max(r,1)}constructor(s=0,c=1,r=0,i=!0){this.numerator=0,this.denominator=1,this.wholeValue=0,this.numerator=s,this.denominator=c,this.wholeValue=r,i&&this.simplify(),this.setRealValue()}toString(){let s=this.numerator+"/"+this.denominator;return 0!==this.wholeValue&&(s=this.wholeValue+" "+s),s}clone(){return new u(this.numerator,this.denominator,this.wholeValue,!1)}get Numerator(){return this.numerator}set Numerator(s){this.numerator!==s&&(this.numerator=s,this.simplify(),this.setRealValue())}get Denominator(){return this.denominator}set Denominator(s){this.denominator!==s&&(this.denominator=s,0!==this.numerator&&this.simplify(),this.setRealValue())}get WholeValue(){return this.wholeValue}set WholeValue(s){this.wholeValue!==s&&(this.wholeValue=s,this.setRealValue())}GetExpandedNumerator(){return this.wholeValue*this.denominator+this.numerator}calculateNumberOfNeededDots(){let s=1,c=2;const r=this.GetExpandedNumerator();for(;c<r;)s++,c=Math.pow(2,s);return Math.min(3,s-1)}IsNegative(){return this.realValue<0}get RealValue(){return this.realValue}expand(s){this.numerator*=s,this.denominator*=s,0!==this.wholeValue&&(this.numerator+=this.wholeValue*this.denominator,this.wholeValue=0)}Add(s){return this.numerator=(this.wholeValue*this.denominator+this.numerator)*s.denominator+(s.wholeValue*s.denominator+s.numerator)*this.denominator,this.denominator=this.denominator*s.denominator,this.wholeValue=0,this.simplify(),this.setRealValue(),this}Sub(s){return this.numerator=(this.wholeValue*this.denominator+this.numerator)*s.denominator-(s.wholeValue*s.denominator+s.numerator)*this.denominator,this.denominator=this.denominator*s.denominator,this.wholeValue=0,this.simplify(),this.setRealValue(),this}Quantize(s){if(this.denominator<=s)return this;const c=new u(this.numerator+1,this.denominator,this.wholeValue);for(;c.Denominator>s;)c.Numerator++;if(this.numerator>this.denominator){const r=new u(this.numerator-1,this.denominator,this.wholeValue);for(;r.Denominator>s;)r.Numerator--;if(r.Denominator<c.Denominator)return r}return c}Equals(s){return this.realValue===s?.realValue}CompareTo(s){const c=this.realValue-s.realValue;return c?c<0?-1:1:0}lt(s){return this.realValue<s.realValue}lte(s){return this.realValue<=s.realValue}gt(s){return!this.lte(s)}gte(s){return!this.lt(s)}setRealValue(){this.realValue=this.wholeValue+this.numerator/this.denominator}simplify(){if(0===this.numerator)return void(this.denominator=1);const s=u.greatestCommonDenominator(Math.abs(this.numerator),Math.abs(this.denominator));this.numerator/=s,this.denominator/=s;const c=Math.floor(this.numerator/this.denominator);if(0!==c&&(this.wholeValue+=c,this.numerator-=c*this.denominator,0===this.numerator&&(this.denominator=1)),this.denominator>u.maximumAllowedNumber){const r=this.denominator/u.maximumAllowedNumber;this.numerator=Math.round(this.numerator/r),this.denominator=Math.round(this.denominator/r)}if(this.numerator>u.maximumAllowedNumber){const r=this.numerator/u.maximumAllowedNumber;this.numerator=Math.round(this.numerator/r),this.denominator=Math.round(this.denominator/r)}}isOnBeat(s){const c=this.distanceFromBeat(s);return Math.abs(c)<u.FloatInaccuracyTolerance}distanceFromBeat(s){const c=new u(1,s.Denominator);return this.RealValue%c.RealValue}}g.Fraction=u,u.maximumAllowedNumber=46340,u.FloatInaccuracyTolerance=1e-4},6904(dt,g,u){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.Matrix2D=void 0;const l=u(9409);class s{constructor(){this.matrix=[];for(let r=0;r<2;r++){this.matrix[r]=[];for(let i=0;i<2;i++)this.matrix[r][i]=0}}static getRotationMatrix(r){const i=new s,o=Math.cos(r),n=Math.sin(r);return i.matrix[0][0]=o,i.matrix[0][1]=-n,i.matrix[1][0]=n,i.matrix[1][1]=o,i}scalarMultiplication(r){for(let i=0;i<2;i++)for(let o=0;o<2;o++)this.matrix[i][o]*=r}getTransposeMatrix(){const r=new s;for(let i=0;i<2;i++)for(let o=0;o<2;o++)r.matrix[i][o]=this.matrix[o][i];return r}vectorMultiplication(r){const i=new l.PointF2D;return i.x=r.x*this.matrix[0][0]+r.y*this.matrix[0][1],i.y=r.x*this.matrix[1][0]+r.y*this.matrix[1][1],i}}g.Matrix2D=s},8786(dt,g){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.MusicSheetErrors=void 0,g.MusicSheetErrors=class{constructor(){this.measureErrors={},this.errors=[],this.tempErrors=[]}finalizeMeasure(u){let l=this.measureErrors[u];l||(l=[]),this.measureErrors[u]=l.concat(this.tempErrors),this.tempErrors=[]}pushMeasureError(u){this.tempErrors.push(u)}push(u){this.errors.push(u)}}},8705(dt,g){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.OSMDColor=void 0;class u{constructor(s,c,r){this.alpha=255,this.red=s,this.green=c,this.blue=r}static get Black(){return new u(0,0,0)}static get DeepSkyBlue(){return new u(0,191,255)}static get Green(){return new u(20,160,20)}static get Magenta(){return new u(255,0,255)}static get Orange(){return new u(255,128,0)}static get Red(){return new u(240,20,20)}static get Disabled(){return new u(225,225,225)}static get DarkBlue(){return new u(0,0,140)}static get Debug1(){return new u(200,0,140)}static get Debug2(){return new u(100,100,200)}static get Debug3(){return new u(0,50,140)}toString(){return"rgb("+this.red+","+this.green+","+this.blue+","+this.alpha+")"}}g.OSMDColor=u},8233(dt,g){"use strict";var u,l,c;Object.defineProperty(g,"__esModule",{value:!0}),g.Pitch=g.AccidentalEnum=g.NoteEnum=void 0,(c=u||(g.NoteEnum=u={}))[c.C=0]="C",c[c.D=2]="D",c[c.E=4]="E",c[c.F=5]="F",c[c.G=7]="G",c[c.A=9]="A",c[c.B=11]="B",function(c){c[c.SHARP=0]="SHARP",c[c.FLAT=1]="FLAT",c[c.NONE=2]="NONE",c[c.NATURAL=3]="NATURAL",c[c.DOUBLESHARP=4]="DOUBLESHARP",c[c.DOUBLEFLAT=5]="DOUBLEFLAT",c[c.TRIPLESHARP=6]="TRIPLESHARP",c[c.TRIPLEFLAT=7]="TRIPLEFLAT",c[c.QUARTERTONESHARP=8]="QUARTERTONESHARP",c[c.QUARTERTONEFLAT=9]="QUARTERTONEFLAT",c[c.SLASHFLAT=10]="SLASHFLAT",c[c.THREEQUARTERSSHARP=11]="THREEQUARTERSSHARP",c[c.THREEQUARTERSFLAT=12]="THREEQUARTERSFLAT",c[c.SLASHQUARTERSHARP=13]="SLASHQUARTERSHARP",c[c.SLASHSHARP=14]="SLASHSHARP",c[c.DOUBLESLASHFLAT=15]="DOUBLESLASHFLAT",c[c.SORI=16]="SORI",c[c.KORON=17]="KORON"}(l||(g.AccidentalEnum=l={}));class s{static getNoteEnumString(r){switch(r){case u.C:return"C";case u.D:return"D";case u.E:return"E";case u.F:return"F";case u.G:return"G";case u.A:return"A";case u.B:return"B";default:return""}}static lineShiftFromNoteEnum(r,i){if(0===i)return[r,0];const o=s.pitchEnumValues,n=o.indexOf(r);let h=0,e=(n+i)%o.length;return n+i>o.length-1&&(h=1),e<0&&(e=o.length+e,h=-1),[o[e],h]}static CalculateTransposedHalfTone(r,i){return s.WrapAroundCheck(r.fundamentalNote+r.AccidentalHalfTones+i,12)}static WrapAroundCheck(r,i){let o=0;for(;r<0;)r+=i,o--;for(;r>=i;)r-=i,o++;return{overflow:o,halftone:r}}static calcFrequency(r){let i,o=0;return r instanceof s?(o=r.octave-1,i=r.fundamentalNote-u.A+r.AccidentalHalfTones):"number"==typeof r&&(i=r-57),440*Math.pow(2,o)*Math.pow(2,i/12)}static calcFractionalKey(r){return Math.log(r/440)/Math.LN10*s.halftoneFactor+57}static fromFrequency(r){const i=s.calcFractionalKey(r)+.5,o=Math.floor(i/12)-s.octXmlDiff,n=Math.floor(i)%12;let h=n,e=l.NONE;return-1===this.pitchEnumValues.indexOf(h)&&(h=n-1,e=l.SHARP),new s(h,o,e)}static fromHalftone(r){const i=Math.floor(r/12)-s.octXmlDiff,o=r%12;let n=o,h=l.NONE;return-1===this.pitchEnumValues.indexOf(n)&&(n=o-1,h=l.SHARP),new s(n,i,h)}static ceiling(r){let i=r%=12;return-1===this.pitchEnumValues.indexOf(i)&&(i=r+1),i}static floor(r){let i=r%=12;return-1===this.pitchEnumValues.indexOf(i)&&(i=r-1),i}constructor(r,i,o,n=void 0,h=!1,e=void 0){this.accidental=l.NONE,this.fundamentalNote=r,this.octave=i,this.accidental=o,this.accidentalXml=n,this.halfTone=r+12*(i+s.octXmlDiff)+s.HalfTonesFromAccidental(o),h||(this.frequency=s.calcFrequency(this)),this.OctaveShiftApplied=e}static HalfTonesFromAccidental(r){switch(r){case l.NONE:return 0;case l.SHARP:return 1;case l.FLAT:return-1;case l.NATURAL:return 0;case l.DOUBLESHARP:return 2;case l.DOUBLEFLAT:return-2;case l.TRIPLESHARP:return 3;case l.TRIPLEFLAT:return-3;case l.QUARTERTONESHARP:return.5;case l.QUARTERTONEFLAT:return-.5;case l.SLASHFLAT:return-.51;case l.THREEQUARTERSSHARP:return 1.5;case l.THREEQUARTERSFLAT:return-1.5;case l.SLASHQUARTERSHARP:return.0013;case l.SLASHSHARP:return.0014;case l.DOUBLESLASHFLAT:return-.0015;case l.SORI:return.0016;case l.KORON:return.0017;default:throw new Error("Unhandled AccidentalEnum value")}}static AccidentalFromHalfTones(r){switch(r){case 0:return l.NONE;case 1:return l.SHARP;case-1:return l.FLAT;case 2:return l.DOUBLESHARP;case-2:return l.DOUBLEFLAT;case 3:return l.TRIPLESHARP;case-3:return l.TRIPLEFLAT;case.5:return l.QUARTERTONESHARP;case-.5:return l.QUARTERTONEFLAT;case 1.5:return l.THREEQUARTERSSHARP;case-1.5:return l.THREEQUARTERSFLAT;default:return r>0&&r<1?l.QUARTERTONESHARP:r<0&&r>-1?l.QUARTERTONEFLAT:l.QUARTERTONESHARP}}static accidentalVexflow(r){let i;switch(r){case l.NATURAL:i="n";break;case l.FLAT:i="b";break;case l.SHARP:i="#";break;case l.DOUBLESHARP:i="##";break;case l.TRIPLESHARP:i="###";break;case l.DOUBLEFLAT:i="bb";break;case l.TRIPLEFLAT:i="bbs";break;case l.QUARTERTONESHARP:i="+";break;case l.QUARTERTONEFLAT:i="d";break;case l.SLASHFLAT:i="bs";break;case l.THREEQUARTERSSHARP:i="++";break;case l.THREEQUARTERSFLAT:i="db";break;case l.SLASHQUARTERSHARP:i="+-";break;case l.SLASHSHARP:i="++-";break;case l.DOUBLESLASHFLAT:i="bss";break;case l.SORI:i="o";break;case l.KORON:i="k"}return i}get AccidentalHalfTones(){return s.HalfTonesFromAccidental(this.accidental)}get Octave(){return this.octave}get FundamentalNote(){return this.fundamentalNote}get Accidental(){return this.accidental}get AccidentalXml(){return this.accidentalXml}get Frequency(){return this.frequency}static get OctaveXmlDifference(){return s.octXmlDiff}getHalfTone(){return this.halfTone}getTransposedPitch(r){if(r>12)throw new Error("rewrite this method to handle bigger octave changes or don't use is with bigger octave changes!");return r>0?this.getHigherPitchByTransposeFactor(r):r<0?this.getLowerPitchByTransposeFactor(-r):this}DoEnharmonicChange(){switch(this.accidental){case l.FLAT:case l.DOUBLEFLAT:this.fundamentalNote=this.getPreviousFundamentalNote(this.fundamentalNote),this.accidental=s.AccidentalFromHalfTones(this.halfTone-(this.fundamentalNote+12*(this.octave+s.octXmlDiff)));break;case l.SHARP:case l.DOUBLESHARP:this.fundamentalNote=this.getNextFundamentalNote(this.fundamentalNote),this.accidental=s.AccidentalFromHalfTones(this.halfTone-(this.fundamentalNote+12*(this.octave+s.octXmlDiff)));break;default:return}}ToString(){let r=s.accidentalVexflow(this.accidental);return r||(r=""),"Key: "+s.getNoteEnumString(this.fundamentalNote)+r+", Note: "+this.fundamentalNote+", octave: "+this.octave.toString()}ToStringShort(r=0){let i=s.accidentalVexflow(this.accidental);i||(i="");const o=this.octave+r;return s.getNoteEnumString(this.fundamentalNote)+i+o}get ToStringShortGet(){return this.ToStringShort(0)}OperatorEquals(r){const i=this;return!(!i||!r)&&i.FundamentalNote===r.FundamentalNote&&i.Octave===r.Octave&&i.Accidental===r.Accidental}OperatorNotEqual(r){return this!==r}OperatorFundamentalGreaterThan(r){const i=this;return i.Octave===r.Octave?i.FundamentalNote>r.FundamentalNote:i.Octave>r.Octave}OperatorFundamentalLessThan(r){const i=this;return i.Octave===r.Octave?i.FundamentalNote<r.FundamentalNote:i.Octave<r.Octave}getHigherPitchByTransposeFactor(r){const i=s.pitchEnumValues.indexOf(this.fundamentalNote);let o,n=this.octave;return i+r>s.pitchEnumValues.length-1?(o=s.pitchEnumValues[i+r-s.pitchEnumValues.length],n++):o=s.pitchEnumValues[i+r],new s(o,n,l.NONE)}getLowerPitchByTransposeFactor(r){const i=s.pitchEnumValues.indexOf(this.fundamentalNote);let o,n=this.octave;return i-r<0?(o=s.pitchEnumValues[s.pitchEnumValues.length+i-r],n--):o=s.pitchEnumValues[i-r],new s(o,n,l.NONE)}getNextFundamentalNote(r){let i=s.pitchEnumValues.indexOf(r);return i=(i+1)%s.pitchEnumValues.length,s.pitchEnumValues[i]}getPreviousFundamentalNote(r){const i=s.pitchEnumValues.indexOf(r);return i>0?s.pitchEnumValues[i-1]:s.pitchEnumValues[s.pitchEnumValues.length-1]}}g.Pitch=s,s.pitchEnumValues=[u.C,u.D,u.E,u.F,u.G,u.A,u.B],s.halftoneFactor=12/(Math.LN2/Math.LN10),s.octXmlDiff=3},283(dt,g,u){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.PlaybackSettings=void 0;const l=u(2561);class s{constructor(r=new l.Fraction,i=100){this.rhythm=r,this.beatsPerMinute=i,this.beatLengthInMilliseconds=6e4/i,this.beatRealValue=.25}static createFrom(r){return new s(r.Rhythm,r.BeatsPerMinute)}get BeatsPerMinute(){return this.beatsPerMinute}set BeatsPerMinute(r){this.beatsPerMinute=r,this.beatLengthInMilliseconds=6e4/this.beatsPerMinute}get Rhythm(){return this.rhythm}set Rhythm(r){this.rhythm=r}get BeatRealValue(){return this.beatRealValue}get BeatLengthInMilliseconds(){return this.beatLengthInMilliseconds}getDurationInMilliseconds(r){return("number"==typeof r?r:r.RealValue)*this.BeatLengthInMilliseconds/this.beatRealValue}getDurationAsNoteDuration(r,i=1024){const o=r/this.BeatLengthInMilliseconds;let n=Math.floor(o);const h=new l.Fraction(n,4),e=o-n;return n=Math.round(e/(1/i)/4),0!==e&&0===n&&r>0&&(n=1),h.Add(new l.Fraction(n,i)),h}}g.PlaybackSettings=s},9409(dt,g){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.PointF2D=void 0;class u{constructor(s=0,c=0){this.x=0,this.y=0,this.x=s,this.y=c}static get Empty(){return new u}
1static pointsAreEqual(s,c){return s.x===c.x&&s.y===c.y}ToString(){return"["+this.x+", "+this.y+"]"}}g.PointF2D=u},200(dt,g,u){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.RectangleF2D=void 0;const l=u(6864),s=u(9409);class c{constructor(i,o,n,h){this.x=0,this.y=0,this.width=0,this.height=0,this.x=i,this.y=o,this.width=n,this.height=h}static createFromLocationAndSize(i,o){return new c(i.x,i.y,o.width,o.height)}get Location(){return new s.PointF2D(this.x,this.y)}get Size(){return new l.SizeF2D(this.width,this.height)}}g.RectangleF2D=c},6864(dt,g){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.SizeF2D=void 0,g.SizeF2D=class{constructor(u=0,l=0){this.width=u,this.height=l}}},9735(dt,g,u){"use strict";var l=this&&this.__createBinding||(Object.create?function(c,r,i,o){void 0===o&&(o=i);var n=Object.getOwnPropertyDescriptor(r,i);n&&!("get"in n?!r.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return r[i]}}),Object.defineProperty(c,o,n)}:function(c,r,i,o){void 0===o&&(o=i),c[o]=r[i]}),s=this&&this.__exportStar||function(c,r){for(var i in c)"default"===i||Object.prototype.hasOwnProperty.call(r,i)||l(r,c,i)};Object.defineProperty(g,"__esModule",{value:!0}),s(u(2561),g),s(u(6904),g),s(u(8786),g),s(u(8705),g),s(u(8233),g),s(u(9409),g),s(u(200),g),s(u(6864),g)},4434(dt,g){"use strict";var u,l;Object.defineProperty(g,"__esModule",{value:!0}),g.ColoringModes=void 0,(l=u||(g.ColoringModes=u={}))[l.XML=0]="XML",l[l.AutoColoring=1]="AutoColoring",l[l.CustomColorSet=2]="CustomColorSet"},4146(dt,g){"use strict";var u,l;Object.defineProperty(g,"__esModule",{value:!0}),g.DrawingParametersEnum=void 0,(l=u||(g.DrawingParametersEnum=u={})).allon="allon",l.compact="compact",l.compacttight="compacttight",l.default="default",l.leadsheet="leadsheet",l.preview="preview",l.thumbnail="thumbnail"},2570(dt,g){"use strict";var u,l;Object.defineProperty(g,"__esModule",{value:!0}),g.FontStyles=void 0,(l=u||(g.FontStyles=u={}))[l.Regular=0]="Regular",l[l.Bold=1]="Bold",l[l.Italic=2]="Italic",l[l.BoldItalic=3]="BoldItalic",l[l.Underlined=4]="Underlined"},5951(dt,g){"use strict";var u,l;Object.defineProperty(g,"__esModule",{value:!0}),g.Fonts=void 0,(l=u||(g.Fonts=u={}))[l.TimesNewRoman=0]="TimesNewRoman",l[l.Kokila=1]="Kokila"},7533(dt,g){"use strict";var u,l;Object.defineProperty(g,"__esModule",{value:!0}),g.TextAlignment=g.TextAlignmentEnum=void 0,(l=u||(g.TextAlignmentEnum=u={}))[l.LeftTop=0]="LeftTop",l[l.LeftCenter=1]="LeftCenter",l[l.LeftBottom=2]="LeftBottom",l[l.CenterTop=3]="CenterTop",l[l.CenterCenter=4]="CenterCenter",l[l.CenterBottom=5]="CenterBottom",l[l.RightTop=6]="RightTop",l[l.RightCenter=7]="RightCenter",l[l.RightBottom=8]="RightBottom",g.TextAlignment=class{static IsLeft(l){return l===u.LeftTop||l===u.LeftCenter||l===u.LeftBottom}static IsCenterAligned(l){return l===u.CenterTop||l===u.CenterCenter||l===u.CenterBottom}static IsRight(l){return l===u.RightTop||l===u.RightCenter||l===u.RightBottom}}},2514(dt,g){"use strict";var u,l;Object.defineProperty(g,"__esModule",{value:!0}),g.TieTypes=void 0,(l=u||(g.TieTypes=u={})).SIMPLE="",l.HAMMERON="H",l.PULLOFF="P",l.SLIDE="S",l.TAPPING="T"},2257(dt,g,u){"use strict";var l=this&&this.__createBinding||(Object.create?function(c,r,i,o){void 0===o&&(o=i);var n=Object.getOwnPropertyDescriptor(r,i);n&&!("get"in n?!r.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return r[i]}}),Object.defineProperty(c,o,n)}:function(c,r,i,o){void 0===o&&(o=i),c[o]=r[i]}),s=this&&this.__exportStar||function(c,r){for(var i in c)"default"===i||Object.prototype.hasOwnProperty.call(r,i)||l(r,c,i)};Object.defineProperty(g,"__esModule",{value:!0}),s(u(4434),g),s(u(4146),g),s(u(2570),g),s(u(5951),g),s(u(7533),g),s(u(2514),g)},6888(dt,g,u){"use strict";var l=this&&this.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(g,"__esModule",{value:!0}),g.MXLHelper=g.MXLFile=void 0;const s=u(3902),c=l(u(1710)),r=l(u(3065));g.MXLFile=class{constructor(o){this.unzipSuccessful=!1,this.blob=o}tryUnzip(){var o=this;
1return be(function*(){o.zipFile=new c.default;try{return o.unzipSuccessful=!0,yield o.zipFile.loadAsync(o.blob),!0}catch{return o.unzipSuccessful=!1,!1}})()}getXmlString(){return i.jszipToXMLstring(this.zipFile)}};class i{static MXLtoIXmlElement(n){return this.MXLtoXMLstring(n).then(h=>{const e=(new DOMParser).parseFromString(h,"text/xml"),f=new s.IXmlElement(e.documentElement);return Promise.resolve(f)},h=>{throw new Error("extractSheetFromMxl: "+h.message)})}static jszipToXMLstring(n){return be(function*(){let h=yield n.file("META-INF/container.xml").async("text");if(!h.startsWith("<")){const m=yield n.file("META-INF/container.xml").async("uint8array");h=new TextDecoder("utf-8").decode(m)}if(!h.startsWith("<")){const m=yield n.file("META-INF/container.xml").async("uint8array");h=new TextDecoder("utf-16").decode(m)}const e=(new DOMParser).parseFromString(h,"text/xml").getElementsByTagName("rootfile")[0].getAttribute("full-path"),f=yield n.file(e).async("text");if(!f.substring(0,1).startsWith("<")){const m=yield n.file(e).async("uint8array");return new TextDecoder("utf-16").decode(m)}return f})()}static MXLtoXMLstring(n){var h=this;const e=new c.default;return e.loadAsync(n).then(function(){var f=be(function*(m){return h.jszipToXMLstring(e)});return function(m){return f.apply(this,arguments)}}(),f=>{throw r.default.error(f),f})}}g.MXLHelper=i},3902(dt,g){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.IXmlElement=void 0;class u{constructor(s){if(this.hasAttributes=!1,!s)throw new Error("IXmlElement: expected Element, got undefined");this.elem=s,this.name=s.nodeName.toLowerCase(),s.hasAttributes()&&(this.hasAttributes=!0,this.firstAttribute=s.attributes[0]),this.hasElements=s.hasChildNodes(),this.value=1===s.childNodes.length&&s.childNodes[0].nodeType===Node.TEXT_NODE?s.childNodes[0].nodeValue:""}attribute(s){return this.elem.attributes.getNamedItem(s)}attributes(){if(!this.attrs){const s=this.elem.attributes,c=[];for(let r=0;r<s.length;r+=1)c.push(s[r]);this.attrs=c}return this.attrs}element(s){const c=this.elem.childNodes;for(let r=0,i=c.length;r<i;r+=1){const o=c[r];if(o.nodeType===Node.ELEMENT_NODE&&o.nodeName.toLowerCase()===s)return new u(o)}}elements(s){const c=this.elem.childNodes,r=[],i=!s;i||(s=s.toLowerCase());for(let o=0;o<c.length;o+=1){const n=c[o];n.nodeType!==Node.ELEMENT_NODE||!i&&n.nodeName.toLowerCase()!==s||r.push(new u(n))}return r}combinedElement(s){const c=this.elem.childNodes;if(c.length>0){let r;for(let i=0,o=c.length;i<o;i+=1){const n=c[i];if(n.nodeType===Node.ELEMENT_NODE&&n.nodeName.toLowerCase()===s)if(r){const h=n.childNodes;for(let e=0,f=h.length;e<f;e+=1)r.appendChild(h[e].cloneNode(!0))}else r=n}if(r)return new u(r)}}}g.IXmlElement=u},599(dt,g,u){"use strict";var l=this&&this.__createBinding||(Object.create?function(c,r,i,o){void 0===o&&(o=i);var n=Object.getOwnPropertyDescriptor(r,i);n&&!("get"in n?!r.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return r[i]}}),Object.defineProperty(c,o,n)}:function(c,r,i,o){void 0===o&&(o=i),c[o]=r[i]}),s=this&&this.__exportStar||function(c,r){for(var i in c)"default"===i||Object.prototype.hasOwnProperty.call(r,i)||l(r,c,i)};Object.defineProperty(g,"__esModule",{value:!0}),s(u(6888),g),s(u(3902),g)},4356(dt,g){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.StringUtil=void 0,g.StringUtil=class{static StringContainsSeparatedWord(u,l,s=!1){return new RegExp("( |^)"+l+"([ .]|$)",s?"i":void 0).test(u)}}},2552(dt,g,u){"use strict";var l=this&&this.__createBinding||(Object.create?function(c,r,i,o){void 0===o&&(o=i);var n=Object.getOwnPropertyDescriptor(r,i);n&&!("get"in n?!r.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return r[i]}}),Object.defineProperty(c,o,n)}:function(c,r,i,o){void 0===o&&(o=i),c[o]=r[i]}),s=this&&this.__exportStar||function(c,r){for(var i in c)"default"===i||Object.prototype.hasOwnProperty.call(r,i)||l(r,c,i)};Object.defineProperty(g,"__esModule",{value:!0}),s(u(9735),g),s(u(2257),g),s(u(599),g)},7307(dt,g){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.InvalidEnumArgumentException=g.ArgumentOutOfRangeException=g.MusicSheetReadingException=void 0,g.MusicSheetReadingException=class{constructor(u,l){this.message=u,l&&(this.message+=" "+l.toString())}},g.ArgumentOutOfRangeException=class{constructor(u){this.message=u}},g.InvalidEnumArgumentException=class{constructor(u){this.message=u}}},9490(dt,g,u){"use strict";
vendor: 4,581 bytes, line 1
1Object.defineProperty(g,"__esModule",{value:!0}),g.AbstractGraphicalExpression=void 0;const l=u(7741),s=u(6438);g.AbstractGraphicalExpression=class c extends l.GraphicalObject{constructor(i,o,n){super(),this.expression=o,this.parentMeasure=n,this.boundingBox=new s.BoundingBox(this,i.PositionAndShape),this.parentStaffLine=i,this.parentStaffLine.AbstractExpressions.push(this),this.rules=i.ParentMusicSystem.rules}get Label(){return this.label}get ParentStaffLine(){return this.parentStaffLine}get SourceExpression(){return this.expression}get Placement(){return this.expression.Placement}}},1974(dt,g,u){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.AbstractGraphicalInstruction=void 0;const l=u(7741);g.AbstractGraphicalInstruction=class s extends l.GraphicalObject{constructor(r){super(),this.parent=r}get Parent(){return this.parent}set Parent(r){this.parent=r}}},8927(dt,g,u){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.AccidentalCalculator=void 0;const l=u(8233),s=u(8233),c=u(3263),r=u(7921);g.AccidentalCalculator=class{constructor(){this.keySignatureNoteAlterationsDict=new c.Dictionary,this.currentAlterationsComparedToKeyInstructionList=[],this.currentInMeasureNoteAlterationsDict=new c.Dictionary}get ActiveKeyInstruction(){return this.activeKeyInstruction}set ActiveKeyInstruction(i){this.activeKeyInstruction=i,this.reactOnKeyInstructionChange()}doCalculationsAtEndOfMeasure(){this.currentInMeasureNoteAlterationsDict.clear(),this.currentAlterationsComparedToKeyInstructionList.clear();for(const i of this.keySignatureNoteAlterationsDict.keys())this.currentInMeasureNoteAlterationsDict.setValue(i,this.keySignatureNoteAlterationsDict.getValue(i))}checkAccidental(i,o){if(!o)return;const n=o.FundamentalNote+12*o.Octave,h=i.sourceNote.NoteTie;if(h&&i.sourceNote!==h.StartNote)return;const e=this.currentAlterationsComparedToKeyInstructionList.indexOf(n)>=0;if(this.currentInMeasureNoteAlterationsDict.containsKey(n))if(e&&this.currentAlterationsComparedToKeyInstructionList.splice(this.currentAlterationsComparedToKeyInstructionList.indexOf(n),1),this.currentInMeasureNoteAlterationsDict.getValue(n)!==o.AccidentalHalfTones){this.keySignatureNoteAlterationsDict.containsKey(n)&&this.keySignatureNoteAlterationsDict.getValue(n)!==o.AccidentalHalfTones?(this.currentAlterationsComparedToKeyInstructionList.push(n),this.currentInMeasureNoteAlterationsDict.setValue(n,o.AccidentalHalfTones)):o.Accidental!==l.AccidentalEnum.NONE?this.keySignatureNoteAlterationsDict.containsKey(n)?this.currentInMeasureNoteAlterationsDict.setValue(n,this.keySignatureNoteAlterationsDict.getValue(n)):this.currentInMeasureNoteAlterationsDict.remove(n):this.currentInMeasureNoteAlterationsDict.setValue(n,o.AccidentalHalfTones);const f=this.currentInMeasureNoteAlterationsDict.getValue(n);if(o.Accidental===l.AccidentalEnum.NONE&&(o=.5===Math.abs(f)?new s.Pitch(o.FundamentalNote,o.Octave,l.AccidentalEnum.NONE,void 0,!1,o.OctaveShiftApplied):new s.Pitch(o.FundamentalNote,o.Octave,l.AccidentalEnum.NATURAL,void 0,!1,o.OctaveShiftApplied)),this.isAlterAmbiguousAccidental(o.Accidental)&&!o.AccidentalXml)return;r.MusicSheetCalculator.symbolFactory.addGraphicalAccidental(i,o)}else o.AccidentalXml&&0===this.Transpose&&!e&&r.MusicSheetCalculator.symbolFactory.addGraphicalAccidental(i,o);else if(o.Accidental!==l.AccidentalEnum.NONE){if(e||this.currentAlterationsComparedToKeyInstructionList.push(n),this.currentInMeasureNoteAlterationsDict.setValue(n,o.AccidentalHalfTones),this.isAlterAmbiguousAccidental(o.Accidental)&&!o.AccidentalXml)return;r.MusicSheetCalculator.symbolFactory.addGraphicalAccidental(i,o)}else e&&(o=new s.Pitch(o.FundamentalNote,o.Octave,l.AccidentalEnum.NATURAL,void 0,!1,o.OctaveShiftApplied),this.currentAlterationsComparedToKeyInstructionList.splice(this.currentAlterationsComparedToKeyInstructionList.indexOf(n),1),r.MusicSheetCalculator.symbolFactory.addGraphicalAccidental(i,o))}isAlterAmbiguousAccidental(i){return i===l.AccidentalEnum.SLASHFLAT||i===l.AccidentalEnum.QUARTERTONEFLAT}reactOnKeyInstructionChange(){const i=this.activeKeyInstruction.AlteratedNotes;let o;o=this.activeKeyInstruction.Key>0?l.AccidentalEnum.SHARP:l.AccidentalEnum.FLAT,this.keySignatureNoteAlterationsDict.clear(),this.currentAlterationsComparedToKeyInstructionList.length=0;for(let n=-9;n<9;n++)for(let h=0;h<i.length;h++)this.keySignatureNoteAlterationsDict.setValue(i[h]+12*n,s.Pitch.HalfTonesFromAccidental(o));this.doCalculationsAtEndOfMeasure()}}},6438(dt,g,u){"use strict";var l=this&&this.__importDefault||function(e){return e&&e.__esMo
1dule?e:{default:e}};Object.defineProperty(g,"__esModule",{value:!0}),g.ColDirEnum=g.BoundingBox=void 0;const s=l(u(3065)),c=u(7307),r=u(9409),i=u(6864),o=u(200),n=u(7741);var h,e;g.BoundingBox=class{constructor(e=void 0,f=void 0,m=!1){this.isSymbol=!1,this.relativePositionHasBeenSet=!1,this.xBordersHaveBeenSet=!1,this.yBordersHaveBeenSet=!1,this.absolutePosition=new r.PointF2D,this.relativePosition=new r.PointF2D,this.size=new i.SizeF2D,this.marginSize=new i.SizeF2D,this.upperLeftCorner=new r.PointF2D,this.upperLeftMarginCorner=new r.PointF2D,this.borderLeft=0,this.borderRight=0,this.borderTop=0,this.borderBottom=0,this.borderMarginLeft=0,this.borderMarginRight=0,this.borderMarginTop=0,this.borderMarginBottom=0,this.childElements=[],this.parent=f,this.dataObject=e,this.isSymbol=m,this.xBordersHaveBeenSet=!1,this.yBordersHaveBeenSet=!1,f&&(this.Parent=f)}get RelativePositionHasBeenSet(){return this.relativePositionHasBeenSet}get XBordersHaveBeenSet(){return this.xBordersHaveBeenSet}set XBordersHaveBeenSet(e){this.xBordersHaveBeenSet=e}get YBordersHaveBeenSet(){return this.yBordersHaveBeenSet}set YBordersHaveBeenSet(e){this.yBordersHaveBeenSet=e}get AbsolutePosition(){return this.absolutePosition}set AbsolutePosition(e){this.absolutePosition=e}get RelativePosition(){return this.relativePosition}set RelativePosition(e){this.relativePosition=e,this.relativePositionHasBeenSet=!0}get Size(){return this.size}set Size(e){this.size=e}get MarginSize(){return this.marginSize}
vendor: 9,780 bytes, line 1
1get UpperLeftCorner(){return this.upperLeftCorner}get UpperLeftMarginCorner(){return this.upperLeftMarginCorner}get BorderLeft(){return this.borderLeft}set BorderLeft(e){this.borderLeft=e,this.calculateRectangle()}get BorderRight(){return this.borderRight}set BorderRight(e){this.borderRight=e,this.calculateRectangle()}get BorderTop(){return this.borderTop}set BorderTop(e){this.borderTop=e,this.calculateRectangle()}get BorderBottom(){return this.borderBottom}set BorderBottom(e){this.borderBottom=e,this.calculateRectangle()}get BorderMarginLeft(){return this.borderMarginLeft>this.borderLeft?this.borderLeft:this.borderMarginLeft}set BorderMarginLeft(e){this.borderMarginLeft=e,this.calculateMarginRectangle()}get BorderMarginRight(){return this.borderMarginRight<this.borderRight?this.borderRight:this.borderMarginRight}set BorderMarginRight(e){this.borderMarginRight=e,this.calculateMarginRectangle()}get BorderMarginTop(){return this.borderMarginTop>this.borderTop?this.borderTop:this.borderMarginTop}set BorderMarginTop(e){this.borderMarginTop=e,this.calculateMarginRectangle()}get BorderMarginBottom(){return this.borderMarginBottom<this.borderBottom?this.borderBottom:this.borderMarginBottom}set BorderMarginBottom(e){this.borderMarginBottom=e,this.calculateMarginRectangle()}get BoundingRectangle(){return this.boundingRectangle}get BoundingMarginRectangle(){return this.boundingMarginRectangle}get ChildElements(){return this.childElements}set ChildElements(e){this.childElements=e}get Parent(){return this.parent}set Parent(e){if(this.parent){const f=this.parent.ChildElements.indexOf(this,0);f>-1&&this.parent.ChildElements.splice(f,1)}this.parent=e,this.parent.ChildElements.indexOf(this)>-1?s.default.error("BoundingBox of "+this.dataObject.constructor.name+" already in children list of "+this.parent.dataObject.constructor.name+"'s BoundingBox"):this.parent.ChildElements.push(this)}get DataObject(){return this.dataObject}get Center(){return new r.PointF2D(this.RelativePosition.x+(this.BorderMarginRight+this.BorderMarginLeft),this.RelativePosition.y+(this.BorderMarginBottom+this.BorderMarginTop))}setAbsolutePositionFromParent(){this.parent?(this.absolutePosition.x=this.parent.AbsolutePosition.x+this.relativePosition.x,this.absolutePosition.y=this.parent.AbsolutePosition.y+this.relativePosition.y):this.absolutePosition=this.relativePosition}calculateAbsolutePosition(){this.absolutePosition.x=this.relativePosition.x,this.absolutePosition.y=this.relativePosition.y;let e=this.parent;for(;e;)this.absolutePosition.x+=e.relativePosition.x,this.absolutePosition.y+=e.relativePosition.y,e=e.parent}calculateAbsolutePositionsRecursiveWithoutTopelement(){this.absolutePosition.x=0,this.absolutePosition.y=0;for(let e=0,f=this.ChildElements.length;e<f;++e)this.ChildElements[e].calculateAbsolutePositionsRecursive(this.absolutePosition.x,this.absolutePosition.y)}calculateAbsolutePositionsRecursive(e,f){this.absolutePosition.x=this.relativePosition.x+e,this.absolutePosition.y=this.relativePosition.y+f;for(let m=0,p=this.ChildElements.length;m<p;++m)this.ChildElements[m].calculateAbsolutePositionsRecursive(this.absolutePosition.x,this.absolutePosition.y)}calculateAbsolutePositionsOfChildren(){for(let e=0,f=this.ChildElements.length;e<f;++e)this.ChildElements[e].calculateAbsolutePositionsRecursive(this.absolutePosition.x,this.absolutePosition.y)}calculateBoundingBox(e=[]){if(0===this.childElements.length)return;for(let x=0,_=this.ChildElements.length;x<_;++x){const I=this.ChildElements[x];let T=!0;for(const A of e){const v=I.DataObject;if(v.isInstanceOfClass&&v.isInstanceOfClass(A)){T=!1;break}}T&&I.calculateBoundingBox(e)}let f=Number.MAX_VALUE,m=Number.MIN_VALUE,p=Number.MAX_VALUE,E=Number.MIN_VALUE,y=Number.MAX_VALUE,d=Number.MIN_VALUE,S=Number.MAX_VALUE,M=Number.MIN_VALUE;this.isSymbol&&(f=this.borderLeft,m=this.borderRight,p=this.borderTop,E=this.borderBottom,y=this.borderMarginLeft,d=this.borderMarginRight,S=this.borderMarginTop,M=this.borderMarginBottom);for(let x=0,_=this.ChildElements.length;x<_;++x){const I=this.ChildElements[x];f=Math.min(f,I.relativePosition.x+I.borderLeft),m=Math.max(m,I.relativePosition.x+I.borderRight),p=Math.min(p,I.relativePosition.y+I.borderTop),E=Math.max(E,I.relativePosition.y+I.borderBottom),y=Math.min(y,I.relativePosition.x+I.borderMarginLeft),d=Math.max(d,I.relativePosition.x+I.borderMarginRight),S=Math.min(S,I.relativePosition.y+I.borderMarginTop),M=Math.max(M,I.relativePosition.y+I.borderMarginBottom)}this.borderLeft=f,this.borderRight=m,this.borderTop=p,this.borderBottom=E,this.borderMarginLeft=y,this.borderMarginRight=d,this.borderMarginTop=S,this.borderMarginBottom=M,this.calculateRectangle(),this.calculateMarginRectangle(),this.xBordersHaveBeenSet=!0,this.yBordersHaveBeenSet=!0}calculateTopBottomBorders(){if(0===this.childElements.length)return;for(let E=0,y=this.ChildElements.length;E<y;++E)this.ChildElements[E].calculateTopBottomBorders();let e=Number.MAX_VALUE,f=Number.MIN_VALUE,m=Number.MAX_VALUE,p=Number.MIN_VALUE;this.yBordersHaveBeenSet&&(e=this.borderTop,f=this.borderBottom,m=this.borderMarginTop,p=this.borderMarginBottom);for(let E=0,y=this.ChildElements.length;E<y;++E){const d=this.ChildElements[E];e=Math.min(e,d.relativePosition.y+d.borderTop),f=Math.max(f,d.relativePosition.y+d.borderBottom),m=Math.min(m,d.relativePosition.y+d.borderMarginTop),p=Math.max(p,d.relativePosition.y+d.borderMarginBottom)}this.borderTop=e,this.borderBottom=f,this.borderMarginTop=m,this.borderMarginBottom=p,this.calculateRectangle(),this.calculateMarginRectangle()}computeNonOverlappingPositionWithMargin(e,f,m){this.RelativePosition=new r.PointF2D(m.x,m.y),this.setAbsolutePositionFromParent();let p=0,E=!1;do{switch(f){case h.Left:case h.Right:p=this.relativePosition.x,e.calculateMarginPositionAlongDirection(this,f),E=Math.abs(p-this.relativePosition.x)>.001;break;case h.Up:case h.Down:p=this.relativePosition.y,e.calculateMarginPositionAlongDirection(this,f),E=Math.abs(p-this.relativePosition.y)>.001;break;default:throw new c.ArgumentOutOfRangeException("direction")}}while(E)}collisionDetection(e){const f=Math.min(this.AbsolutePosition.x+this.borderRight,e.absolutePosition.x+e.borderRight)-Math.max(this.AbsolutePosition.x+this.borderLeft,e.absolutePosition.x+e.borderLeft),m=Math.min(this.AbsolutePosition.y+this.borderBottom,e.absolutePosition.y+e.borderBottom)-Math.max(this.AbsolutePosition.y+this.borderTop,e.absolutePosition.y+e.borderTop);return f>=0&&m>=0}liesInsideBorders(e){return this.AbsolutePosition.x+this.borderLeft<=e.absolutePosition.x+e.borderLeft&&e.absolutePosition.x+e.borderLeft<=this.AbsolutePosition.x+this.borderRight&&this.AbsolutePosition.x+this.borderLeft<=e.absolutePosition.x+e.borderRight&&e.absolutePosition.x+e.borderRight<=this.AbsolutePosition.x+this.borderRight&&this.AbsolutePosition.y+this.borderTop<=e.absolutePosition.y+e.borderTop&&e.absolutePosition.y+e.borderTop<=this.AbsolutePosition.y+this.borderBottom&&this.AbsolutePosition.y+this.borderTop<=e.absolutePosition.y+e.borderBottom&&e.absolutePosition.y+e.borderBottom<=this.AbsolutePosition.y+this.borderBottom}pointLiesInsideBorders(e){return this.AbsolutePosition.x+this.borderLeft<=e.x&&e.x<=this.AbsolutePosition.x+this.borderRight&&this.AbsolutePosition.y+this.borderTop<=e.y&&e.y<=this.AbsolutePosition.y+this.borderBottom}marginCollisionDetection(e){const f=Math.min(this.AbsolutePosition.x+this.borderMarginRight,e.absolutePosition.x+e.borderMarginRight)-Math.max(this.AbsolutePosition.x+this.borderMarginLeft,e.absolutePosition.x+e.borderMarginLeft),m=Math.min(this.AbsolutePosition.y+this.borderMarginBottom,e.absolutePosition.y+e.borderMarginBottom)-Math.max(this.AbsolutePosition.y+this.borderMarginTop,e.absolutePosition.y+e.borderMarginTop);return f>0&&m>0}liesInsideMargins(e){return this.AbsolutePosition.x+this.borderMarginLeft<=e.absolutePosition.x+e.borderMarginLeft&&e.absolutePosition.x+e.borderMarginLeft<=this.AbsolutePosition.x+this.borderMarginRight&&this.AbsolutePosition.x+this.borderMarginLeft<=e.absolutePosition.x+e.borderMarginRight&&e.absolutePosition.x+e.borderMarginRight<=this.AbsolutePosition.x+this.borderMarginRight&&this.AbsolutePosition.y+this.borderMarginTop<=e.absolutePosition.y+e.borderMarginTop&&e.absolutePosition.y+e.borderMarginTop<=this.AbsolutePosition.y+this.borderMarginBottom&&this.AbsolutePosition.y+this.borderMarginTop<=e.absolutePosition.y+e.borderMarginBottom&&e.absolutePosition.y+e.borderMarginBottom<=this.AbsolutePosition.y+this.borderMarginBottom}pointLiesInsideMargins(e){return this.AbsolutePosition.x+this.borderMarginLeft<=e.x&&e.x<=this.AbsolutePosition.x+this.borderMarginRight&&this.AbsolutePosition.y+this.borderMarginTop<=e.y&&e.y<=this.AbsolutePosition.y+this.borderMarginBottom}computeNonOverlappingPosition(e,f,m){this.RelativePosition=new r.PointF2D(m.x,m.y),this.setAbsolutePositionFromParent();let p=0,E=!1;do{switch(f){case h.Left:case h.Right:p=this.relativePosition.x,e.calculatePositionAlongDirection(this,f),E=Math.abs(p-this.relativePosition.x)>1e-4;break;case h.Up:case h.Down:p=this.relativePosition.y,e.calculatePositionAlongDirection(this,f),E=Math.abs(p-this.relativePosition.y)>1e-4;break;default:throw new c.ArgumentOutOfRangeException("direction")}}while(E)}getClickedObjectOfType(e){const f=this.dataObject;if(this.pointLiesInsideBorders(e)&&f)return f;for(let m=0,p=this.childElements.length;m<p;++m){const E=this.childElements[m].getClickedObjectOfType(e);if(E)return E}}getObjectsInRegion(e,f=!0,m=n.GraphicalObject.name){let p=[];for(const E of this.childElements)p=p.concat(E.getObjectsInRegion(e,f,m));return this.dataObject&&this.dataObject.isInstanceOfClass(m)&&(f?e.liesInsideBorders(this)&&p.push(this.dataObject):e.collisionDetection(this)&&p.push(this.dataObject)),p}
1calculateRectangle(){this.upperLeftCorner=new r.PointF2D(this.BorderLeft,this.BorderTop),this.size=new i.SizeF2D(this.BorderRight-this.BorderLeft,this.BorderBottom-this.BorderTop),this.boundingRectangle=o.RectangleF2D.createFromLocationAndSize(this.upperLeftCorner,this.size)}calculateMarginRectangle(){this.upperLeftMarginCorner=new r.PointF2D(this.BorderMarginLeft,this.BorderMarginTop),this.marginSize=new i.SizeF2D(this.BorderMarginRight-this.BorderMarginLeft,this.BorderMarginBottom-this.BorderMarginTop),this.boundingMarginRectangle=o.RectangleF2D.createFromLocationAndSize(this.upperLeftMarginCorner,this.marginSize)}calculateMarginPositionAlongDirection(e,f){if(this!==e){if(this.isSymbol&&this.marginCollisionDetection(e)){let m=0;switch(f){case h.Left:return m=this.absolutePosition.x+this.borderMarginLeft-(e.absolutePosition.x+e.borderMarginRight),e.relativePosition.x+=m,void(e.absolutePosition.x+=m);case h.Right:return m=this.absolutePosition.x+this.borderMarginRight-(e.absolutePosition.x+e.borderMarginLeft),e.relativePosition.x+=m,void(e.absolutePosition.x+=m);case h.Up:return m=this.absolutePosition.y+this.borderMarginTop-(e.absolutePosition.y+e.borderMarginBottom),e.relativePosition.y+=m,void(e.absolutePosition.y+=m);case h.Down:return m=this.absolutePosition.y+this.borderMarginBottom-(e.absolutePosition.y+e.borderMarginTop),e.relativePosition.y+=m,void(e.absolutePosition.y+=m);default:throw new c.ArgumentOutOfRangeException("direction")}}for(let m=0,p=this.ChildElements.length;m<p;++m)this.ChildElements[m].calculateMarginPositionAlongDirection(e,f)}}calculatePositionAlongDirection(e,f){if(this!==e){if(this.isSymbol&&this.collisionDetection(e)){let m;switch(f){case h.Left:return m=this.absolutePosition.x+this.borderLeft-(e.absolutePosition.x+e.borderRight),e.relativePosition.x+=m,void(e.absolutePosition.x+=m);case h.Right:return m=this.absolutePosition.x+this.borderRight-(e.absolutePosition.x+e.borderLeft),e.relativePosition.x+=m,void(e.absolutePosition.x+=m);case h.Up:return m=this.absolutePosition.y+this.borderTop-(e.absolutePosition.y+e.borderBottom),e.relativePosition.y+=m,void(e.absolutePosition.y+=m);case h.Down:return m=this.absolutePosition.y+this.borderBottom-(e.absolutePosition.y+e.borderTop),e.relativePosition.y+=m,void(e.absolutePosition.y+=m);default:throw new c.ArgumentOutOfRangeException("direction")}}for(let m=0,p=this.ChildElements.length;m<p;++m)this.ChildElements[m].calculatePositionAlongDirection(e,f)}}},(e=h||(g.ColDirEnum=h={}))[e.Left=0]="Left",e[e.Right=1]="Right",e[e.Up=2]="Up",e[e.Down=3]="Down",e[e.NotYetDefined=4]="NotYetDefined"},995(dt,g,u){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.Clickable=void 0;const l=u(7741);g.Clickable=class s extends l.GraphicalObject{}},2683(dt,g,u){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.AutoColorSet=g.NoteState=g.GraphicalLayers=g.StyleSets=g.OUTLINE_AND_FILL_STYLE_DICT=g.OutlineAndFillStyleEnum=void 0;const l=u(3263);var s,c,r,i,o,n;(n=s||(g.OutlineAndFillStyleEnum=s={}))[n.BaseWritingColor=0]="BaseWritingColor",n[n.FollowingCursor=1]="FollowingCursor",n[n.AlternativeFollowingCursor=2]="AlternativeFollowingCursor",n[n.PlaybackCursor=3]="PlaybackCursor",n[n.Highlighted=4]="Highlighted",n[n.ErrorUnderlay=5]="ErrorUnderlay",n[n.Selected=6]="Selected",n[n.SelectionSymbol=7]="SelectionSymbol",n[n.DebugColor1=8]="DebugColor1",n[n.DebugColor2=9]="DebugColor2",n[n.DebugColor3=10]="DebugColor3",n[n.SplitScreenDivision=11]="SplitScreenDivision",n[n.GreyTransparentOverlay=12]="GreyTransparentOverlay",n[n.MarkedArea1=13]="MarkedArea1",n[n.MarkedArea2=14]="MarkedArea2",n[n.MarkedArea3=15]="MarkedArea3",n[n.MarkedArea4=16]="MarkedArea4",n[n.MarkedArea5=17]="MarkedArea5",n[n.MarkedArea6=18]="MarkedArea6",n[n.MarkedArea7=19]="MarkedArea7",n[n.MarkedArea8=20]="MarkedArea8",n[n.MarkedArea9=21]="MarkedArea9",n[n.MarkedArea10=22]="MarkedArea10",n[n.Comment1=23]="Comment1",n[n.Comment2=24]="Comment2",n[n.Comment3=25]="Comment3",n[n.Comment4=26]="Comment4",n[n.Comment5=27]="Comment5",n[n.Comment6=28]="Comment6",n[n.Comment7=29]="Comment7",n[n.Comment8=30]="Comment8",n[n.Comment9=31]="Comment9",n[n.Comment10=32]="Comment10",g.OUTLINE_AND_FILL_STYLE_DICT=new l.Dictionary,g.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.BaseWritingColor,"Thistle"),g.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.FollowingCursor,"Aqua"),g.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.AlternativeFollowingCursor,"Azure"),g.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.PlaybackCursor,"Bisque"),g.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.Highlighted,"CadetBlue"),g.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.ErrorUnderlay,"DarkBlue"),g.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.Selected,"DarkGoldenRod"),g.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.SelectionSymbol,"BlanchedAlmond"),g.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.DebugColor1,"Chartreuse"),g.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.DebugColor2,"DarkGreen"),g.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.DebugColor3,"DarkOrange"),g.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.SplitScreenDivision,"FireBrick"),g.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.GreyTransparentOverlay,"DarkSalmon"),g.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.MarkedArea1,"DarkSeaGreen"),g.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.MarkedArea2,"DarkOrchid"),g.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.MarkedArea3,"Aquamarine"),g.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.MarkedArea4,"DarkKhaki"),g.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.MarkedArea5,"ForestGreen"),g.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.MarkedArea6,"AliceBlue"),g.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.MarkedArea7,"DeepPink"),g.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.MarkedArea8,"Coral"),g.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.MarkedArea9,"DarkOliveGreen"),g.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.MarkedArea10,"Chocolate"),g.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.Comment1,"DodgerBlue"),g.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.Comment2,"Blue"),g.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.Comment3,"Beige"),g.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.Comment4,"Crimson"),g.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.Comment5,"Fuchsia"),g.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.Comment6,"Brown"),g.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.Comment7,"BlanchedAlmond"),g.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.Comment8,"CornflowerBlue"),g.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.Comment9,"Cornsilk"),g.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.Comment10,"DarkGrey"),function(n){n[n.MarkedArea=0]="MarkedArea",n[n.Comment=1]="Comment"}(c||(g.StyleSets=c={}
1)),function(n){n[n.Background=0]="Background",n[n.Highlight=1]="Highlight",n[n.MeasureError=2]="MeasureError",n[n.SelectionSymbol=3]="SelectionSymbol",n[n.Cursor=4]="Cursor",n[n.PSI_Debug=5]="PSI_Debug",n[n.Notes=6]="Notes",n[n.Comment=7]="Comment",n[n.Debug_above=8]="Debug_above"}(r||(g.GraphicalLayers=r={})),function(n){n[n.Normal=0]="Normal",n[n.Selected=1]="Selected",n[n.Follow_Confirmed=2]="Follow_Confirmed",n[n.QFeedback_NotFound=3]="QFeedback_NotFound",n[n.QFeedback_OK=4]="QFeedback_OK",n[n.QFeedback_Perfect=5]="QFeedback_Perfect",n[n.Debug1=6]="Debug1",n[n.Debug2=7]="Debug2",n[n.Debug3=8]="Debug3"}(i||(g.NoteState=i={})),function(n){n.C="#d82c6b",n.D="#F89D15",n.E="#FFE21A",n.F="#4dbd5c",n.G="#009D96",n.A="#43469d",n.B="#76429c",n.Rest="#000000"}(o||(g.AutoColorSet=o={}))},242(dt,g){"use strict";var u,l,s,c;Object.defineProperty(g,"__esModule",{value:!0}),g.PhonicScoreModes=g.MusicSymbolDrawingStyle=g.DrawingMode=void 0,(c=u||(g.DrawingMode=u={}))[c.All=0]="All",c[c.NoOverlays=1]="NoOverlays",c[c.Leadsheet=2]="Leadsheet",function(c){c[c.Normal=0]="Normal",c[c.Disabled=1]="Disabled",c[c.Selected=2]="Selected",c[c.Clickable=3]="Clickable",c[c.PlaybackSymbols=4]="PlaybackSymbols",c[c.FollowSymbols=5]="FollowSymbols",c[c.QFeedbackNotFound=6]="QFeedbackNotFound",c[c.QFeedbackOk=7]="QFeedbackOk",c[c.QFeedbackPerfect=8]="QFeedbackPerfect",c[c.Debug1=9]="Debug1",c[c.Debug2=10]="Debug2",c[c.Debug3=11]="Debug3"}(l||(g.MusicSymbolDrawingStyle=l={})),function(c){c[c.Following=0]="Following",c[c.Midi=1]="Midi",c[c.Manual=2]="Manual"}(s||(g.PhonicScoreModes=s={}))},3661(dt,g,u){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.DrawingParameters=void 0;const l=u(9713),s=u(6362),c=u(4146);g.DrawingParameters=class{constructor(r=c.DrawingParametersEnum.default,i){this.drawCursors=!0,this.drawTitle=!0,this.drawSubtitle=!0,this.drawLyricist=!0,this.drawComposer=!0,this.drawCopyright=!1,this.drawCredits=!0,this.drawPartNames=!0,this.fingeringPosition=s.PlacementEnum.Left,this.drawHiddenNotes=!1,this.rules=i,this.rules||(this.rules=new l.EngravingRules),this.DrawingParametersEnum=r}set DrawingParametersEnum(r){switch(this.drawingParametersEnum=r,r){case c.DrawingParametersEnum.allon:this.setForAllOn();break;case c.DrawingParametersEnum.thumbnail:this.setForThumbnail();break;case c.DrawingParametersEnum.leadsheet:this.setForLeadsheet();break;case c.DrawingParametersEnum.compact:this.setForCompactMode();break;case c.DrawingParametersEnum.compacttight:this.setForCompactTightMode();break;default:this.setForDefault()}}get DrawingParametersEnum(){return this.drawingParametersEnum}setForAllOn(){this.drawHighlights=!0,this.drawErrors=!0,this.drawSelectionStartSymbol=!0,this.drawSelectionEndSymbol=!0,this.drawCursors=!0,this.drawActivitySymbols=!0,this.drawScrollIndicator=!0,this.drawComments=!0,this.drawMarkedAreas=!0,this.DrawTitle=!0,this.DrawSubtitle=!0,this.DrawComposer=!0,this.DrawLyricist=!0,this.drawCredits=!0,this.DrawPartNames=!0,this.drawHiddenNotes=!0,this.rules.CompactMode=!1}setForDefault(){this.rules.loadDefaultValues(),this.setForAllOn(),this.drawHiddenNotes=!1}setForThumbnail(){this.drawHighlights=!1,this.drawErrors=!1,this.drawSelectionStartSymbol=!1,this.drawSelectionStartSymbol=!1,this.drawCursors=!1,this.drawActivitySymbols=!1,this.drawScrollIndicator=!1,this.drawComments=!0,this.drawMarkedAreas=!0,this.drawHiddenNotes=!1}setForCompactMode(){this.rules.CompactMode=!0,this.DrawCredits=!1,this.drawHiddenNotes=!1}setForCompactTightMode(){this.setForCompactMode(),this.DrawPartNames=!1,this.rules.VoiceSpacingMultiplierVexflow=.65,this.rules.VoiceSpacingAddendVexflow=2,this.rules.MinSkyBottomDistBetweenStaves=1,this.rules.MinSkyBottomDistBetweenSystems=1,this.rules.BetweenStaffDistance=2.5,this.rules.StaffDistance=3.5,this.rules.MinimumDistanceBetweenSystems=1,this.rules.PageBottomMargin=0,this.rules.PageLeftMargin=2,this.rules.PageRightMargin=2}setForLeadsheet(){this.drawHighlights=!1,this.drawErrors=!1,this.drawSelectionStartSymbol=!0,this.drawSelectionEndSymbol=!0,this.drawCursors=!0,this.drawActivitySymbols=!1,this.drawScrollIndicator=!0,this.drawComments=!0,this.drawMarkedAreas=!0}get DrawCredits(){return this.drawCredits}set DrawCredits(r){this.drawCredits=r,this.DrawComposer=r,this.DrawTitle=r,this.DrawSubtitle=r,this.DrawLyricist=r,this.DrawCopyright=r}get DrawTitle(){return this.drawTitle}set DrawTitle(r){this.drawTitle=r,this.rules.RenderTitle=r,r||(this.DrawSubtitle=!1)}get DrawSubtitle(){return this.drawSubtitle}set DrawSubtitle(r){this.drawSubtitle=r,this.rules.RenderSubtitle=r,r&&(this.DrawTitle=!0)}get DrawComposer(){return this.drawComposer}set DrawComposer(r){this.drawComposer=r,this.rules.RenderComposer=r}get DrawLyricist(){return this.drawLyricist}set DrawLyricist(r){this.drawLyricist=r,this.rules.RenderLyricist=r}get DrawCopyright(){return this.drawCopyright}set DrawCopyright(r){this.drawCopyright=r,this.rules.RenderCopyright=r}get DrawPartNames(){return this.drawPartNames}set DrawPartNames(r){this.drawPartNames=r,this.rules.RenderPartNames=r,this.rules.RenderPartNames||(this.rules.RenderPartAbbreviations=!1)}get FingeringPosition(){return this.fingeringPosition}set FingeringPosition(r){this.fingeringPosition=r,this.rules.FingeringPosition=r}get Rules(){return this.rules}set Rules(r){this.rules=r}}},9713(dt,g,u){"use strict";var l=this&&this.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};
vendor: 5,580 bytes, line 1
1Object.defineProperty(g,"__esModule",{value:!0}),g.PageFormat=g.EngravingRules=void 0;const s=u(1888),c=l(u(3065)),r=u(7533),i=u(6362),o=u(624),n=u(4434),h=u(3263),e=u(2257),f=u(8233),m=u(9719),p=u(3430);class E{constructor(){this.NoteDistances=[1,1,1.3,1.6,2,2.5,3,4],this.NoteDistancesScalingFactors=[1,2,4,8,16,32,64,128],this.DurationDistanceDict={},this.DurationScalingDistanceDict={},this.NoteToGraphicalNoteMapObjectCount=0,this.RenderCount=0,this.loadDefaultValues()}loadDefaultValues(){this.SamplingUnit=3*E.unit,this.SheetTitleHeight=4,this.SheetSubtitleHeight=2,this.SheetMinimumDistanceBetweenTitleAndSubtitle=1,this.SheetComposerHeight=2,this.SheetAuthorHeight=2,this.SheetCopyrightHeight=1.5,this.SheetCopyrightMargin=2,this.SheetComposerSubtitleUseLegacyParsing=!1,this.CompactMode=!1,this.PagePlacementEnum=s.PagePlacementEnum.Down,this.PageHeight=100001,this.PageTopMargin=5,this.PageTopMarginNarrow=0,this.PageBottomMargin=5,this.PageLeftMargin=5,this.PageRightMargin=5,this.TitleTopDistance=5,this.TitleBottomDistance=1,this.StaffDistance=7,this.BetweenStaffDistance=5,this.MinimumStaffLineDistance=4,this.MinSkyBottomDistBetweenStaves=1,this.StaffHeight=4,this.TabStaffInterlineHeight=1.1111,this.TabStaffInterlineHeightForBboxes=1.3,this.BetweenStaffLinesDistance=E.unit,this.SystemLeftMargin=0,this.SystemRightMargin=0,this.SystemLabelsRightMargin=2,this.SystemComposerDistance=2,this.SystemLyricistDistance=2,this.InstrumentLabelTextHeight=2,this.MinimumDistanceBetweenSystems=7,this.MinSkyBottomDistBetweenSystems=5,this.LastSystemMaxScalingFactor=1.4,this.AutoBeamNotes=!1,this.AutoBeamOptions={beam_middle_rests_only:!1,beam_rests:!1,maintain_stem_directions:!1},this.AutoBeamTabs=!1,this.BeamWidth=E.unit/2,this.BeamSpaceWidth=E.unit/3,this.BeamForwardLength=1.25*E.unit,this.FlatBeams=!1,this.FlatBeamOffset=20,this.FlatBeamOffsetPerBeam=10,this.ClefLeftMargin=.5,this.ClefRightMargin=.75,this.PercussionOneLineCutoff=3,this.PercussionForceVoicesOneLineCutoff=1,this.PercussionUseXMLDisplayStep=!0,this.PercussionXMLDisplayStepNoteValueShift=0,this.PercussionOneLineXMLDisplayStepOctaveOffset=0,this.PercussionUseCajon2NoteSystem=!1,this.BetweenKeySymbolsDistance=.2,this.KeyRightMargin=.75,this.RhythmRightMargin=1.25,this.ShowRhythmAgainAfterPartEndOrFinalBarline=!0,this.NewPartAndSystemAfterFinalBarline=!1,this.InStaffClefScalingFactor=.8,this.DistanceBetweenNaturalAndSymbolWhenCancelling=.4,this.NoteHelperLinesOffset=.25,this.MeasureLeftMargin=.7,this.MeasureRightMargin=0,this.DistanceBetweenLastInstructionAndRepetitionBarline=1,this.ArpeggioDistance=.6,this.StaccatoShorteningFactor=2,this.IdealStemLength=3,this.StemNoteHeadBorderYOffset=.2,this.StemMargin=.2,this.StemMinLength=2.5,this.StemMaxLength=4.5,this.BeamSlopeMaxAngle=10,this.StemMinAllowedDistanceBetweenNoteHeadAndBeamLine=1,this.SetWantedStemDirectionByXml=!0,this.GraceNoteScalingFactor=.6,this.GraceNoteXOffset=.2,this.GraceNoteGroupXMargin=0,this.WedgeOpeningLength=1.2,this.WedgeMeasureEndOpeningLength=.75,this.WedgeMeasureBeginOpeningLength=.75,this.WedgePlacementAboveY=-1.5,this.WedgePlacementBelowY=1.5,this.WedgeHorizontalMargin=.6,this.WedgeVerticalMargin=.5,this.DistanceOffsetBetweenTwoHorizontallyCrossedWedges=.3,this.WedgeMinLength=2,this.WedgeEndDistanceBetweenTimestampsFactor=1.75,this.ArticulationAboveNoteForStemUp=!1,this.SoftAccentWedgePadding=.4,this.SoftAccentSizeFactor=.6,this.DistanceBetweenAdjacentDynamics=.75,this.TempoChangeMeasureValidity=4,this.TempoContinousFactor=.7,this.StaccatoScalingFactor=.8,this.BetweenDotsDistance=.8,this.OrnamentAccidentalScalingFactor=.65,this.ChordSymbolTextHeight=2,this.ChordSymbolTextAlignmentTop=r.TextAlignmentEnum.LeftBottom,this.ChordSymbolTextAlignmentBottom=r.TextAlignmentEnum.LeftTop,this.ChordSymbolBottomMargin=.6,this.ChordSymbolRelativeXOffset=-1,this.ChordSymbolExtraXShiftForShortChordSymbols=.3,this.ChordSymbolExtraXShiftWidthThreshold=2,this.ChordSymbolXSpacing=1,this.ChordOverlapAllowedIntoNextMeasure=0,this.ChordSymbolYOffset=.1,this.ChordSymbolYPadding=0,this.ChordSymbolYAlignment=!0,this.ChordSymbolYAlignmentScope="staffline",this.ChordSymbolWholeMeasureRestXOffset=0,this.ChordSymbolWholeMeasureRestXOffsetMeasure1=-2,this.ChordAccidentalTexts=new h.Dictionary,this.resetChordAccidentalTexts(this.ChordAccidentalTexts,!1),this.ChordSymbolLabelTexts=new h.Dictionary,this.resetChordSymbolLabelTexts(this.ChordSymbolLabelTexts),this.CustomChords=[],this.resetChordNames(),this.RepetitionSymbolsYOffset=0,this.RepetitionEndInstructionXShiftAsPercentOfStaveWidth=.4,this.RehearsalMarkXOffsetDefault=10,this.RehearsalMarkXOffset=0,this.RehearsalMarkXOffsetSystemStartMeasure=-20,this.RehearsalMarkYOffsetDefault=-15,this.RehearsalMarkYOffsetAddedForRehearsalMarks=-12,this.RehearsalMarkYOffset=0,this.RehearsalMarkFontSize=10,this.MeasureNumberLabelHeight=1.5*E.unit,this.MeasureNumberLabelOffset=2,this.MeasureNumberLabelXOffset=-.5,this.TupletsRatioed=!1,this.TupletsRatioedUseXMLValue=!0,this.TupletsBracketed=!1,this.TripletsBracketed=!1,this.TupletsBracketedUseXMLValue=!0,this.TupletNumberLabelHeight=1.5*E.unit,this.TupletNumberYOffset=.5,this.TupletNumberLimitConsecutiveRepetitions=!0,this.TupletNumberMaxConsecutiveRepetitions=2,this.TupletNumberAlwaysDisableAfterFirstMax=!0,this.TupletNumberUseShowNoneXMLValue=!0,this.LabelMarginBorderFactor=.1,this.TupletVerticalLineLength=.5,this.TupletNumbersInTabs=!0,this.TabTupletYOffsetBottom=1,this.TabTupletYOffsetTop=-3.5,this.TabTupletYOffsetEffects=1.5,this.TabTupletsBracketed=!0,this.TabBeamsRendered=!0,this.TabKeySignatureRen
1dered=!1,this.TabKeySignatureSpacingAdded=!0,this.TabTimeSignatureRendered=!1,this.TabTimeSignatureSpacingAdded=!0,this.TabFingeringsRendered=!1,this.TabUseXNoteheadShapeForTabNote=!0,this.TabUseXNoteheadAlternativeGlyph=!0,this.TabXNoteheadScale=.9,this.SlurPlacementFromXML=!0,this.SlurPlacementAtStems=!1,this.SlurPlacementUseSkyBottomLine=!1,this.BezierCurveStepSize=1e3,this.calculateCurveParametersArrays(),this.TieGhostObjectWidth=.75,this.TieYPositionOffsetFactor=.3,this.MinimumNeededXspaceForTieGhostObject=1,this.TieHeightMinimum=.28,this.TieHeightMaximum=1.2,this.TieHeightInterpolationK=.0288,this.TieHeightInterpolationD=.136,this.SlurNoteHeadYOffset=.5,this.SlurEndArticulationYOffset=.8,this.SlurStartArticulationYOffsetOfArticulation=.5,this.SlurStemXOffset=.3,this.SlurSlopeMaxAngle=15,this.SlurTangentMinAngle=30,this.SlurTangentMaxAngle=80,this.SlurHeightFactor=1,this.SlurHeightFlattenLongSlursFactorByWidth=.24,this.SlurHeightFlattenLongSlursFactorByAngle=.36,this.SlurHeightFlattenLongSlursCutoffAngle=47,this.SlurHeightFlattenLongSlursCutoffWidth=16,this.SlursStartingAtSameStaffEntryYOffset=.8,this.SlurMaximumYControlPointDistance=void 0,this.GlissandoNoteOffset=.5,this.GlissandoStafflineStartMinimumWidth=1,this.GlissandoStafflineStartYDistanceToNote=.8,this.GlissandoStafflineEndOffset=1,this.GlissandoDefaultWidth=.1,this.RepetitionAllowFirstMeasureBeginningRepeatBarline=!0,this.RepetitionEndingLabelHeight=2,this.RepetitionEndingLabelXOffset=.5,this.RepetitionEndingLabelYOffset=.3,this.RepetitionEndingLineYLowerOffset=.5,this.RepetitionEndingLineYUpperOffset=.3,this.CursorIgnoreRepetitions=!1,this.VoltaOffset=2.5,this.LabelXOffsetForStafflineLeftOverflowCheck=-1.2,this.TempoExpressionTextAlignment=r.TextAlignmentEnum.CenterBottom,this.UnknownExpressionTextAlignment=r.TextAlignmentEnum.CenterBottom,this.LyricsAlignmentStandard=r.TextAlignmentEnum.LeftBottom,this.LyricsHeight=2,this.LyricsYOffsetToStaffHeight=0,this.LyricsYMarginToBottomLine=.2,this.LyricsExtraXShiftForShortLyrics=.5,this.LyricsExtraXShiftForShortLyricsWidthThreshold=1.4,this.LyricsUseXPaddingForLongLyrics=!0,this.LyricsXPaddingFactorForLongLyrics=1,this.LyricsXPaddingWidthThreshold=1.7,this.LyricsXPaddingReductionForLongNotes=.7,this.LyricsXPaddingReductionForLastNoteInMeasure=1.2,this.LyricsXPaddingForLastNoteInMeasure=!0,this.LyricsXPaddingReductionForLastNoteInMeasureCrossMeasureMidWord=1,this.VerticalBetweenLyricsDistance=.5,this.HorizontalBetweenLyricsDistance=.2,this.BetweenSyllableMaximumDistance=10,this.BetweenSyllableMinimumDistance=.5,this.LyricOverlapAllowedIntoNextMeasure=3.4,this.MinimumDistanceBetweenDashes=10,this.MaximumLyricsElongationFactor=2.5,this.TempoYSpacing=.5,this.InstantaneousTempoTextHeight=2.3,this.ContinuousDynamicTextHeight=2.3,this.UseEndOffsetForExpressions=!0,this.MoodTextHeight=2.3,this.UnknownTextHeight=2,this.ContinuousTempoTextHeight=2.3,this.DynamicExpressionMaxDistance=2,this.DynamicExpressionSpacer=.5,this.IgnoreRepeatedDynamics=!1,this.ExpressionsUseXMLColor=!0,this.VexFlowDefaultNotationFontScale=39,this.VexFlowDefaultTabFontScale=39,this.TremoloStrokeScale=1,this.TremoloYSpacingScale=1,this.TremoloBuzzRollThickness=.25,this.StemWidth=.15,this.StaffLineWidth=.1,this.StaffLineColor=void 0,this.LedgerLineWidth=1,this.LedgerLineStrokeStyle=void 0,this.LedgerLineColorDefault="#000000",this.WedgeLineWidth=.12,this.TupletLineWidth=.12,this.LyricUnderscoreLineWidth=.12,this.SystemThinLineWidth=.12,this.SystemBoldLineWidth=E.unit/2,this.SystemRepetitionEndingLineWidth=.12,this.SystemDotWidth=E.unit/2,this.DistanceBetweenVerticalSystemLines=.35,this.DistanceBetweenDotAndLine=.7,this.RepeatEndStartPadding=2,this.OctaveShiftLineWidth=.12,this.OctaveShiftVerticalLineLength=E.unit,this.OctaveShiftOnWholeMeasureNoteUntilEndOfMeasure=!1,this.GraceLineWidth=this.StaffLineWidth*this.GraceNoteScalingFactor,this.MultipleRestMeasureDefaultWidth=4,this.MultipleRestMeasureAddKeySignature=!0,this.FixedMeasureWidth=!1,this.FixedMeasureWidthFixedValue=void 0,this.FixedMeasureWidthUseForPickupMeasures=!1,this.MinimumCrossedBeamDifferenceMargin=1e-4,this.SheetMaximumWidth=32767,this.VoiceSpacingMultiplierVexflow=.85,this.VoiceSpacingAddendVexflow=3,this.PickupMeasureWidthMultiplier=1,this.PickupMeasureRepetitionSpacing=.8,this.PickupMeasureSpacingSingleNoteAddend=1.6,this.DisplacedNoteMargin=.1,this.MinNoteDistance=2,this.SubMeasureXSpacingThreshold=35,this.MeasureDynamicsMaxScalingFactor=2.5,this.WholeRestXShiftVexflow=-1.5,this.MetronomeMarksDrawn=!0,this.MetronomeMarkXShift=-6,this.MetronomeMarkYShift=-1,this.SoftmaxFactorVexFlow=15,this.StaggerSameWholeNotes=!0,this.AlignRests=o.AlignRestOption.Never,this.RestCollisionYPadding=0,this.FillEmptyMeasuresWithWholeRest=o.FillEmptyMeasuresWithWholeRests.No,this.ArpeggiosGoAcrossVoices=!1,this.RenderArpeggios=!0,this.RenderSlurs=!0,this.RenderGlissandi=!0,this.ColoringMode=n.ColoringModes.XML,this.ColoringEnabled=!0,this.ColorStemsLikeNoteheads=!1,this.ColorBeams=!0,this.ColorFlags=!0,this.applyDefaultColorMusic("#000000"),this.DefaultColorCursor="#33e02f",this.DefaultFontFamily="Times New Roman",this.DefaultFontStyle=e.FontStyles.Regular,this.DefaultVexFlowNoteFont="gonville",this.MaxMeasureToDrawIndex=Number.MAX_VALUE,this.MaxMeasureToDrawNumber=Number.MAX_VALUE,this.MinMeasureToDrawIndex=0,this.MinMeasureToDrawNumber=0,this.MaxSystemToDrawNumber=Number.MAX_VALUE,this.MaxPageToDrawNumber=Number.MAX_VALUE,this.RenderComposer=!0,this.RenderTitle=!0,this.RenderSubtitle=!0,this.RenderLyricist=!0,this.RenderCopyright=!1,this.RenderPartNames=!0,this.RenderPartAbbreviations=!0,this.RenderSystemLabelsAfterFirstPage=!0,this.RenderFingerings=!0,this.RenderMeasureNumbers=!0,this.RenderMeasureNumbersOnlyAtSystemStart=!1,this.UseXMLMeasureNumbers=!0,this.RenderLyrics=!0,this.RenderChordSymbols=!0,this.RenderMultipleRestMeasures=!0,this.AutoGenerateMultipleRestMeasuresFromRestMeasures=!0,this.RenderRehearsalMarks=!0,this.RenderClefsAtBeginningOfStaffline=!0,this.RenderKeySignatures=!0,this.RenderTimeSignatures=!0,this.RenderFirstTempoExpression=!0,this.RenderPedals=!0,this.RenderWavyLines=!0,this.ArticulationPlacementFromXML=!0,this.BreathMarkDistance=.8,this.FingeringPosition=i.PlacementEnum.AboveOrBelow,this.FingeringPositionFromXML=!0,this.FingeringPositionGrace=i.PlacementEnum.Left,this.FingeringInsideStafflines=!1,this.FingeringLabelFontHeight=1.7,this.FingeringOffsetX=0,this.FingeringOffsetY=0,this.FingeringPaddingY=-.2,this.FingeringTextSize=1.5,this.RenderStringNumbersClassical=!0,this.Str
vendor: 6,535 bytes, line 1
1ingNumberOffsetY=0,this.NewSystemAtXMLNewSystemAttribute=!1,this.NewPageAtXMLNewPageAttribute=!1,this.NewSystemAtXMLNewPageAttribute=!1,this.RenderXMeasuresPerLineAkaSystem=0,this.RestoreCursorAfterRerender=!0,this.StretchLastSystemLine=!1,this.IgnoreBracketsWords=!0,this.PlaceWordsInsideStafflineFromXml=!1,this.PlaceWordsInsideStafflineYOffset=.9,this.PageFormat=y.UndefinedPageFormat,this.PageBackgroundColor=void 0,this.DarkModeEnabled=!1,this.UsePageBackgroundColorForTabNotes=!0,this.RenderSingleHorizontalStaffline=!1,this.SpacingBetweenTextLines=0,this.NoteToGraphicalNoteMap=new h.Dictionary,this.NoteToGraphicalNoteMapObjectCount=0,this.SkyBottomLineBatchMinMeasures=5,this.SkyBottomLineWebGLMinMeasures=80,this.AlwaysSetPreferredSkyBottomLineBackendAutomatically=!0,this.DisableWebGLInFirefox=!0,this.DisableWebGLInSafariAndIOS=!0,this.setPreferredSkyBottomLineBackendAutomatically(),this.UseInterpolatedTempoForAccelerandoEtc=!1;try{this.MaxInstructionsConstValue=this.ClefLeftMargin+this.ClefRightMargin+this.KeyRightMargin+this.RhythmRightMargin+11}catch(S){c.default.info("EngravingRules()",S)}}setPreferredSkyBottomLineBackendAutomatically(S=-1){let M="",x="";"object"==typeof globalThis&&(M=globalThis.navigator?.vendor??"",x=globalThis.navigator?.userAgent??"");let _=!1;(this.DisableWebGLInSafariAndIOS&&/apple/i.test(M)||this.DisableWebGLInFirefox&&x.includes("Firefox"))&&(_=!0),this.PreferredSkyBottomLineBatchCalculatorBackend=o.SkyBottomLineBatchCalculatorBackendType.Plain,_||S>=this.SkyBottomLineWebGLMinMeasures&&(this.PreferredSkyBottomLineBatchCalculatorBackend=o.SkyBottomLineBatchCalculatorBackendType.WebGL)}applyDefaultColorMusic(S){this.DefaultColorMusic=S,this.DefaultColorNotehead=S,this.DefaultColorRest=S,this.DefaultColorStem=S,this.DefaultColorLabel=S,this.DefaultColorLyrics=S,this.DefaultColorTitle=S,this.LedgerLineColorDefault=S}addGraphicalNoteToNoteMap(S,M){S.NoteToGraphicalNoteObjectId=this.NoteToGraphicalNoteMapObjectCount,this.NoteToGraphicalNoteMap.setValue(S.NoteToGraphicalNoteObjectId,M),this.NoteToGraphicalNoteMapObjectCount++}GNote(S){return p.GraphicalNote.FromNote(S,this)}clearMusicSheetObjects(){this.NoteToGraphicalNoteMap=new h.Dictionary,this.NoteToGraphicalNoteMapObjectCount=0}resetChordAccidentalTexts(S,M){S.setValue(f.AccidentalEnum.SHARP,M?"\u266f":"#"),S.setValue(f.AccidentalEnum.FLAT,M?"\u266d":"b"),S.setValue(f.AccidentalEnum.DOUBLEFLAT,M?"\u{1d12b}":"bb"),S.setValue(f.AccidentalEnum.DOUBLESHARP,M?"\u{1d12a}":"x")}setChordSymbolLabelText(S,M){this.ChordSymbolLabelTexts.setValue(S,M)}resetChordSymbolLabelTexts(S){return S.setValue(m.ChordSymbolEnum.minor,"m"),S.setValue(m.ChordSymbolEnum.augmented,"aug"),S.setValue(m.ChordSymbolEnum.diminished,"dim"),S.setValue(m.ChordSymbolEnum.dominant,"7"),S.setValue(m.ChordSymbolEnum.majorseventh,"maj7"),S.setValue(m.ChordSymbolEnum.minorseventh,"m7"),S.setValue(m.ChordSymbolEnum.diminishedseventh,"dim7"),S.setValue(m.ChordSymbolEnum.augmentedseventh,"aug7"),S.setValue(m.ChordSymbolEnum.halfdiminished,`m7${this.ChordAccidentalTexts.getValue(f.AccidentalEnum.FLAT)}5`),S.setValue(m.ChordSymbolEnum.majorminor,"m(maj7)"),S.setValue(m.ChordSymbolEnum.majorsixth,"maj6"),S.setValue(m.ChordSymbolEnum.minorsixth,"m6"),S.setValue(m.ChordSymbolEnum.dominantninth,"9"),S.setValue(m.ChordSymbolEnum.majorninth,"maj9"),S.setValue(m.ChordSymbolEnum.minorninth,"m9"),S.setValue(m.ChordSymbolEnum.dominant11th,"11"),S.setValue(m.ChordSymbolEnum.major11th,"maj11"),S.setValue(m.ChordSymbolEnum.minor11th,"m11"),S.setValue(m.ChordSymbolEnum.dominant13th,"13"),S.setValue(m.ChordSymbolEnum.major13th,"maj13"),S.setValue(m.ChordSymbolEnum.minor13th,"m13"),S.setValue(m.ChordSymbolEnum.suspendedsecond,"sus2"),S.setValue(m.ChordSymbolEnum.suspendedfourth,"sus4"),S.setValue(m.ChordSymbolEnum.power,"5"),S.setValue(m.ChordSymbolEnum.none,"N.C."),S}addChordName(S,M,x,_,I){void 0!==m.ChordSymbolEnum[M]&&this.CustomChords.push(m.CustomChord.createCustomChord(S,m.ChordSymbolEnum[M],{adds:x,alts:_,subs:I}))}renameChord(S,M){m.CustomChord.renameCustomChord(S,M,this.CustomChords)}resetChordNames(){const S=this.ChordAccidentalTexts.getValue(f.AccidentalEnum.SHARP),M=this.ChordAccidentalTexts.getValue(f.AccidentalEnum.FLAT);this.addChordName("alt","major",[`${S}5`,`${M}9`,`${S}9`],[`${M}5`],[]),this.addChordName("7alt","dominant",[`${S}5`,`${M}9`,`${S}9`],[`${M}5`],[]),this.addChordName("7sus4","dominant",["4"],[],["3"]),this.addChordName("7sus4","suspendedfourth",["7"],[],[]),this.addChordName("9sus4","dominantninth",["4"],[],["3"]),this.addChordName("9sus4","suspendedfourth",["9"],[],[]),this.addChordName("11sus4","dominant11th",["4"],[],["3"]),this.addChordName("11sus4","suspendedfourth",["11"],[],[]),this.addChordName("13sus4","dominant13th",["4"],[],["3"]),this.addChordName("13sus4","suspendedfourth",["13"],[],[]),this.addChordName("7sus2","dominant",["2"],[],["3"]),this.addChordName("7sus2","suspendedsecond",["7"],[],[]),this.addChordName(`m7${M}5`,"minorseventh",[],[`${M}5`],[]),this.addChordName("9sus2","dominantninth",["2"],[],["3"]),this.addChordName("9sus2","suspendedsecond",["9"],[],[]),this.addChordName("11sus2","dominant11th",["2"],[],["3"]),this.addChordName("11sus2","suspendedsecond",["11"],[],[]),this.addChordName("13sus2","dominant13th",["2"],[],["3"]),this.addChordName("13sus2","suspendedsecond",["13"],[],[]),this.addChordName("m(maj9)","majorminor",["9"],[],[]),this.addChordName("m(maj11)","majorminor",["11"],[],[]),this.addChordName("m(maj13)","majorminor",["13"],[],[]),this.addChordName("69","majorsixth",["9"],[],[]),this.addChordName("mi69","minorsixth",["9"],[],[])}calculateCurveParametersArrays(){this.TPower3=new Array(this.BezierCurveStepSize),this.OneMinusTPower3=new Array(this.BezierCurveStepSize),this.FactorOne=new Array(this.BezierCurveStepSize),this.FactorTwo=new Array(this.BezierCurveStepSize);for(let S=0;S<this.BezierCurveStepSize;S++){const M=S/this.BezierCurveStepSize;this.TPower3[S]=Math.pow(M,3),this.OneMinusTPower3[S]=Math.pow(1-M,3),this.FactorOne[S]=3*Math.pow(1-M,2)*M,this.FactorTwo[S]=3*(1-M)*Math.pow(M,2)}}}g.EngravingRules=E,E.unit=1;class y{constructor(S,M,x="noIdStringGiven"){this.width=S,this.height=M,this.idString=x}get aspectRatio(){return this.IsUndefined?0:this.width/this.height}get IsUndefined(){return void 0===this.width||void 0===this.height||0===this.height||0===this.width}static get UndefinedPageFormat(){return new y(0,0)}Equals(S){return!!S&&S.width===this.width&&S.height===this.height}}g.PageFormat=y},6659(dt,g,u){"use strict";
1Object.defineProperty(g,"__esModule",{value:!0}),g.GraphicalChordSymbolContainer=void 0;const l=u(7435),s=u(8254),c=u(9719),r=u(6438),i=u(7741),o=u(9409),n=u(4980);g.GraphicalChordSymbolContainer=class h extends i.GraphicalObject{constructor(f,m,p,E,y,d){super(),this.chordSymbolContainer=f,this.boundingBox=new r.BoundingBox(this,m),this.rules=d,this.calculateLabel(p,y,E)}get GetChordSymbolContainer(){return this.chordSymbolContainer}get GraphicalLabel(){return this.graphicalLabel}calculateLabel(f,m,p){const E=c.ChordSymbolContainer.calculateChordText(this.chordSymbolContainer,m,p),y=this.GetChordSymbolContainer.Placement===n.PlacementEnum.Above?this.rules.ChordSymbolTextAlignmentTop:this.rules.ChordSymbolTextAlignmentBottom;this.graphicalLabel=new s.GraphicalLabel(new l.Label(E),f,y,this.rules,this.boundingBox),this.graphicalLabel.PositionAndShape.RelativePosition=new o.PointF2D(this.rules.ChordSymbolRelativeXOffset,0),this.graphicalLabel.Label.colorDefault=this.rules.DefaultColorChordSymbol}}},953(dt,g){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.GraphicalComment=void 0,g.GraphicalComment=class{constructor(u,l){this.label=u,this.settings=l}}},1066(dt,g,u){"use strict";var l=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(g,"__esModule",{value:!0}),g.GraphicalContinuousDynamicExpression=void 0;const s=u(6452),c=u(5875),r=u(9409),i=u(9490),o=u(6362),n=l(u(3065));g.GraphicalContinuousDynamicExpression=class h extends i.AbstractGraphicalExpression{constructor(f,m,p){super(m,f,p),this.lines=[],this.isSplittedPart=!1,this.notToBeRemoved=!1}get StartMeasure(){return this.startMeasure}set StartMeasure(f){this.startMeasure=f}get EndMeasure(){return this.endMeasure}set EndMeasure(f){this.endMeasure=f}get EndStaffLine(){return this.endMeasure?this.endMeasure.ParentStaffLine:void 0}get IsSplittedPart(){return this.isSplittedPart}set IsSplittedPart(f){this.isSplittedPart=f}get IsVerbal(){return this.ContinuousDynamic.Label&&this.ContinuousDynamic.Label.length>0}get NotToBeRemoved(){return this.notToBeRemoved}set NotToBeRemoved(f){this.notToBeRemoved=f}get Lines(){return this.lines}get ContinuousDynamic(){return this.SourceExpression}updateSkyBottomLine(){const f=this.parentStaffLine.SkyBottomLineCalculator,m=this.IsVerbal?this.label.PositionAndShape.RelativePosition.x+this.label.PositionAndShape.BorderMarginLeft:0,p=this.IsVerbal?this.label.PositionAndShape.RelativePosition.x+this.label.PositionAndShape.BorderMarginRight:0;switch(!this.IsSoftAccent&&!this.IsVerbal&&this.lines.length<2&&n.default.warn("Not enough lines for SkyBottomLine calculation"),this.IsVerbal||this.ContinuousDynamic.DynamicType!==c.ContDynamicEnum.crescendo&&this.ContinuousDynamic.DynamicType!==c.ContDynamicEnum.diminuendo&&n.default.warn("GraphicalContinuousDynamicExpression.updateSkyBottomLine(): unhandled continuous dynamic type. start measure: "+this.startMeasure?.MeasureNumber),this.Placement){case o.PlacementEnum.Above:this.IsSoftAccent?(f.updateSkyLineWithWedge(this.lines[0].Start,this.lines[0].End),f.updateSkyLineWithWedge(this.lines[2].End,this.lines[2].Start),f.updateSkyLineWithLine(this.lines[0].End,this.lines[2].End,this.lines[0].End.y)):this.IsVerbal?f.updateSkyLineInRange(m,p,this.label.PositionAndShape.BorderMarginTop+this.label.PositionAndShape.RelativePosition.y):this.ContinuousDynamic.DynamicType===c.ContDynamicEnum.crescendo?f.updateSkyLineWithWedge(this.lines[0].Start,this.lines[0].End):this.ContinuousDynamic.DynamicType===c.ContDynamicEnum.diminuendo&&f.updateSkyLineWithWedge(this.lines[0].End,this.lines[0].Start);break;case o.PlacementEnum.Below:this.IsVerbal?f.updateBottomLineInRange(m,p,this.label.PositionAndShape.BorderMarginBottom+this.label.PositionAndShape.RelativePosition.y):this.ContinuousDynamic.DynamicType===c.ContDynamicEnum.crescendo?f.updateBottomLineWithWedge(this.lines[1].Start,this.lines[1].End):this.ContinuousDynamic.DynamicType===c.ContDynamicEnum.diminuendo&&f.updateBottomLineWithWedge(this.lines[1].End,this.lines[1].Start);break;default:n.default.error("Placement for GraphicalContinuousDynamicExpression is unknown")}}createCrescendoLines(f,m,p,E=this.rules.WedgeOpeningLength,y=this.rules.WedgeLineWidth){const d=new r.PointF2D(f,p),S=new r.PointF2D(m,p-E/2),M=new r.PointF2D(m,p+E/2);this.addWedgeLines(d,S,M,y)}createFirstHalfCrescendoLines(f,m,p,E=this.rules.WedgeMeasureEndOpeningLength,y=this.rules.WedgeLineWidth){const d=new r.PointF2D(f,p),S=new r.PointF2D(m,p-E/2),M=new r.PointF2D(m,p+E/2);this.addWedgeLines(d,S,M,y)}createSecondHalfCrescendoLines(f,m,p,E=this.rules.WedgeMeasureBeginOpeningLength,y=this.rules.WedgeOpeningLength,d=this.rules.WedgeLineWidth){const S=new r.PointF2D(f,p-E/2),M=new r.PointF2D(f,p+E/2),x=new r.PointF2D(m,p-y/2),_=new r.PointF2D(m,p+y/2);this.addDoubleLines(S,x,M,_,d)}
vendor: 4,145 bytes, line 1
1recalculateCrescendoLines(f,m,p){const E=Math.abs(this.lines[0].Start.y-this.lines[1].Start.y)>1e-4;this.lines.clear(),E?this.createSecondHalfCrescendoLines(f,m,p):this.isSplittedPart?this.createFirstHalfCrescendoLines(f,m,p):this.createCrescendoLines(f,m,p)}createDiminuendoLines(f,m,p,E=this.rules.WedgeOpeningLength,y=this.rules.WedgeLineWidth){const d=new r.PointF2D(f,p-E/2),S=new r.PointF2D(f,p+E/2),M=new r.PointF2D(m,p);this.addWedgeLines(M,d,S,y)}createFirstHalfDiminuendoLines(f,m,p,E=this.rules.WedgeOpeningLength,y=this.rules.WedgeMeasureEndOpeningLength,d=this.rules.WedgeLineWidth){const S=new r.PointF2D(f,p-E/2),M=new r.PointF2D(f,p+E/2),x=new r.PointF2D(m,p-y/2),_=new r.PointF2D(m,p+y/2);this.addDoubleLines(S,x,M,_,d)}createSecondHalfDiminuendoLines(f,m,p,E=this.rules.WedgeMeasureBeginOpeningLength,y=this.rules.WedgeLineWidth){const d=new r.PointF2D(f,p-E/2),S=new r.PointF2D(f,p+E/2),M=new r.PointF2D(m,p);this.addWedgeLines(M,d,S,y)}recalculateDiminuendoLines(f,m,p){const E=Math.abs(this.lines[0].End.y-this.lines[1].End.y)>1e-4;this.lines.clear(),E?this.createFirstHalfDiminuendoLines(f,m,p):this.isSplittedPart?this.createSecondHalfDiminuendoLines(f,m,p):this.createDiminuendoLines(f,m,p)}createFirstHalfLines(f,m,p,E=this.rules.WedgeOpeningLength,y=this.rules.WedgeMeasureEndOpeningLength,d=this.rules.WedgeLineWidth){this.ContinuousDynamic.DynamicType===c.ContDynamicEnum.crescendo?this.createFirstHalfCrescendoLines(f,m,p,y,d):this.ContinuousDynamic.DynamicType===c.ContDynamicEnum.diminuendo&&this.createFirstHalfDiminuendoLines(f,m,p,E,y,d)}createSecondHalfLines(f,m,p,E=this.rules.WedgeMeasureBeginOpeningLength,y=this.rules.WedgeOpeningLength,d=this.rules.WedgeLineWidth){this.ContinuousDynamic.DynamicType===c.ContDynamicEnum.crescendo?this.createSecondHalfCrescendoLines(f,m,p,E,y,d):this.ContinuousDynamic.DynamicType===c.ContDynamicEnum.diminuendo&&this.createSecondHalfDiminuendoLines(f,m,p,E,d)}createLines(f,m,p,E=this.rules.WedgeOpeningLength,y=this.rules.WedgeLineWidth){this.ContinuousDynamic.DynamicType===c.ContDynamicEnum.crescendo?this.createCrescendoLines(f,m,p,E,y):this.ContinuousDynamic.DynamicType===c.ContDynamicEnum.diminuendo&&this.createDiminuendoLines(f,m,p,E,y)}calcPsi(){this.IsVerbal?this.PositionAndShape.calculateBoundingBox():(this.PositionAndShape.RelativePosition=this.lines[0].Start,this.PositionAndShape.BorderMarginTop=this.lines[0].End.y-this.lines[0].Start.y,this.PositionAndShape.BorderMarginBottom=this.lines[1].End.y-this.lines[1].Start.y,this.PositionAndShape.Center.y=(this.PositionAndShape.BorderMarginTop+this.PositionAndShape.BorderMarginBottom)/2,this.IsSoftAccent?(this.PositionAndShape.BorderMarginLeft=0,this.PositionAndShape.BorderMarginRight=this.lines[3].Start.x-this.lines[0].Start.x):this.ContinuousDynamic.DynamicType===c.ContDynamicEnum.crescendo?(this.PositionAndShape.BorderMarginLeft=0,this.PositionAndShape.BorderMarginRight=this.lines[0].End.x-this.lines[0].Start.x):(this.PositionAndShape.BorderMarginLeft=this.lines[0].End.x-this.lines[0].Start.x,this.PositionAndShape.BorderMarginRight=0))}cleanUp(){this.lines.clear()}shiftYPosition(f){this.IsVerbal?(this.PositionAndShape.RelativePosition.y+=f,this.PositionAndShape.calculateBoundingBox()):(this.lines[0].Start.y+=f,this.lines[0].End.y+=f,this.lines[1].End.y+=f)}squeeze(f){this.IsVerbal||Math.abs(this.lines[0].End.x-this.lines[0].Start.x)<Math.abs(f)||(this.ContinuousDynamic.DynamicType===c.ContDynamicEnum.crescendo?f>0?this.lines[0].Start.x+=f:(this.lines[0].End.x+=f,this.lines[1].End.x+=f):f<0?this.lines[0].Start.x+=f:(this.lines[0].End.x+=f,this.lines[1].End.x+=f),this.calcPsi())}addWedgeLines(f,m,p,E){const y=new s.GraphicalLine(f,m,E),d=new s.GraphicalLine(f,p,E);this.rules.DefaultColorMusic&&(y.colorHex=this.rules.DefaultColorMusic,d.colorHex=this.rules.DefaultColorMusic),this.lines.push(y),this.lines.push(d)}addDoubleLines(f,m,p,E,y){const d=new s.GraphicalLine(f,m,y),S=new s.GraphicalLine(p,E,y);this.rules.DefaultColorMusic&&(d.colorHex=this.rules.DefaultColorMusic,S.colorHex=this.rules.DefaultColorMusic),this.lines.push(d),this.lines.push(S)}}},6711(dt,g,u){"use strict";
1Object.defineProperty(g,"__esModule",{value:!0}),g.GraphicalCurve=void 0;const l=u(9409);class s{constructor(){s.tPow3=new Array(s.bezierCurveStepSize),s.oneMinusTPow3=new Array(s.bezierCurveStepSize),s.bezierFactorOne=new Array(s.bezierCurveStepSize),s.bezierFactorTwo=new Array(s.bezierCurveStepSize);for(let r=0;r<s.bezierCurveStepSize;r++){const i=r/s.bezierCurveStepSize;s.tPow3[r]=Math.pow(i,3),s.oneMinusTPow3[r]=Math.pow(1-i,3),s.bezierFactorOne[r]=3*Math.pow(1-i,2)*i,s.bezierFactorTwo[r]=3*(1-i)*Math.pow(i,2)}}calculateCurvePointAtIndex(r){const i=Math.round(r*s.bezierCurveStepSize);return i<0||i>=s.bezierCurveStepSize?new l.PointF2D:new l.PointF2D(s.oneMinusTPow3[i]*this.bezierStartPt.x+s.bezierFactorOne[i]*this.bezierStartControlPt.x+s.bezierFactorTwo[i]*this.bezierEndControlPt.x+s.tPow3[i]*this.bezierEndPt.x,s.oneMinusTPow3[i]*this.bezierStartPt.y+s.bezierFactorOne[i]*this.bezierStartControlPt.y+s.bezierFactorTwo[i]*this.bezierEndControlPt.y+s.tPow3[i]*this.bezierEndPt.y)}}g.GraphicalCurve=s,s.bezierCurveStepSize=1e3},98(dt,g,u){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.GraphicalGlissando=void 0;const l=u(9409),s=u(6438),c=u(6452);g.GraphicalGlissando=class{constructor(r){this.Glissando=r,this.staffEntries=[]}calculateLine(r){const i=this.staffEntries[0],o=this.staffEntries[this.staffEntries.length-1],n=i.findGraphicalNoteFromNote(this.Glissando.StartNote),h=o.findGraphicalNoteFromNote(this.Glissando.EndNote);if(!n&&!h)return;const e=i.parentMeasure.ParentStaffLine;let f,m,p,E;if(n&&i.parentMeasure.ParentStaffLine===this.StaffLine?(f=n.PositionAndShape.RelativePosition.x+n.parentVoiceEntry.parentStaffEntry.PositionAndShape.RelativePosition.x+n.parentVoiceEntry.parentStaffEntry.parentMeasure.PositionAndShape.RelativePosition.x+r.GlissandoNoteOffset,p=n.PositionAndShape.AbsolutePosition.y):(f=o.parentMeasure.beginInstructionsWidth-.4,p=h.PositionAndShape.AbsolutePosition.y+(this.Glissando.Direction===s.ColDirEnum.Down?-1:1)*r.GlissandoStafflineStartYDistanceToNote),h&&o.parentMeasure.ParentStaffLine===this.StaffLine)m=h.PositionAndShape.RelativePosition.x+h.parentVoiceEntry.parentStaffEntry.PositionAndShape.RelativePosition.x+h.parentVoiceEntry.parentStaffEntry.parentMeasure.PositionAndShape.RelativePosition.x-.5-r.GlissandoNoteOffset,f>m&&(f=m-r.GlissandoStafflineStartMinimumWidth),E=h.PositionAndShape.AbsolutePosition.y;else{if(e.Measures.last().parentSourceMeasure.HasEndLine)return;m=e.PositionAndShape.Size.width,m-f>r.GlissandoStafflineEndOffset&&(f=m-r.GlissandoStafflineEndOffset),E=n.PositionAndShape.AbsolutePosition.y+(this.Glissando.Direction===s.ColDirEnum.Down?1:-1)*r.GlissandoStafflineStartYDistanceToNote}const y=new l.PointF2D(f,p),d=new l.PointF2D(m,E);void 0===this.Width&&(this.Width=r.GlissandoDefaultWidth),this.Line=new c.GraphicalLine(y,d,this.Width)}}},5023(dt,g,u){"use strict";var l=this&&this.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(g,"__esModule",{value:!0}),g.GraphicalInstantaneousDynamicExpression=void 0;const s=u(9490),c=u(6362),r=l(u(3065));g.GraphicalInstantaneousDynamicExpression=class i extends s.AbstractGraphicalExpression{constructor(n,h,e){super(h,n,e.parentSourceMeasure),this.mInstantaneousDynamicExpression=n,this.mMeasure=e}updateSkyBottomLine(){const n=this.parentStaffLine.SkyBottomLineCalculator,h=this.PositionAndShape.RelativePosition.x+this.PositionAndShape.BorderMarginLeft,e=this.PositionAndShape.RelativePosition.x+this.PositionAndShape.BorderMarginRight;let f=0;switch(this.Placement){case c.PlacementEnum.Above:f=this.PositionAndShape.RelativePosition.y+this.PositionAndShape.BorderMarginTop,n.updateSkyLineInRange(h,e,f);break;case c.PlacementEnum.Below:f=this.PositionAndShape.RelativePosition.y+this.PositionAndShape.BorderMarginBottom,n.updateBottomLineInRange(h,e,f);break;default:r.default.error("Placement for GraphicalInstantaneousDynamicExpression is unknown")}}}},3361(dt,g,u){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.GraphicalInstantaneousTempoExpression=void 0;const l=u(9490);g.GraphicalInstantaneousTempoExpression=class s extends l.AbstractGraphicalExpression{constructor(r,i){super(i.PositionAndShape.Parent.DataObject,r,r.parentMeasure),this.label=i}get GraphicalLabel(){return this.label}updateSkyBottomLine(){}}},8254(dt,g,u){"use strict";
vendor: 40,999 bytes, line 1
1Object.defineProperty(g,"__esModule",{value:!0}),g.GraphicalLabel=void 0;const l=u(7533),s=u(6438),c=u(995),r=u(7921);g.GraphicalLabel=class i extends c.Clickable{constructor(n,h,e,f,m=void 0){super(),this.CenteringXShift=0,this.label=n,this.boundingBox=new s.BoundingBox(this,m),this.label.fontHeight=h,this.label.textAlignment=e,this.rules=f}get Label(){return this.label}toString(){return`${this.label.text} (${this.boundingBox.RelativePosition.x},${this.boundingBox.RelativePosition.y})`}setLabelPositionAndShapeBorders(){if(""===this.Label.text.trim())return;this.TextLines=[];const n=this.rules?.LabelMarginBorderFactor??.1,h=this.Label.text.split(/[\n\r]+/g),e=h.length;let f=0;for(let E=0;E<e;E++){const y=h[E].trim(),d=r.MusicSheetCalculator.TextMeasurer.computeTextWidthToHeightRatio(y,this.Label.font,this.Label.fontStyle,this.label.fontFamily),S=this.Label.fontHeight*d;f=Math.max(f,S),this.TextLines.push({text:y,xOffset:0,width:S})}for(const E of this.TextLines){let y=0;switch(this.Label.textAlignment){case l.TextAlignmentEnum.RightBottom:case l.TextAlignmentEnum.RightCenter:case l.TextAlignmentEnum.RightTop:y=f-E.width;break;case l.TextAlignmentEnum.CenterBottom:case l.TextAlignmentEnum.CenterCenter:case l.TextAlignmentEnum.CenterTop:y=(f-E.width)/2}E.xOffset=y}let m=this.Label.fontHeight*e;this.rules.SpacingBetweenTextLines>0&&this.TextLines.length>1&&(m+=this.rules.SpacingBetweenTextLines*e/10);const p=this.PositionAndShape;switch(this.Label.textAlignment){case l.TextAlignmentEnum.CenterBottom:p.BorderTop=-m,p.BorderLeft=-f/2,p.BorderBottom=0,p.BorderRight=f/2;break;case l.TextAlignmentEnum.CenterCenter:p.BorderTop=-m/2,p.BorderLeft=-f/2,p.BorderBottom=m/2,p.BorderRight=f/2;break;case l.TextAlignmentEnum.CenterTop:p.BorderTop=0,p.BorderLeft=-f/2,p.BorderBottom=m,p.BorderRight=f/2;break;case l.TextAlignmentEnum.LeftBottom:p.BorderTop=-m,p.BorderLeft=0,p.BorderBottom=0,p.BorderRight=f;break;case l.TextAlignmentEnum.LeftCenter:p.BorderTop=-m/2,p.BorderLeft=0,p.BorderBottom=m/2,p.BorderRight=f;break;case l.TextAlignmentEnum.LeftTop:p.BorderTop=0,p.BorderLeft=0,p.BorderBottom=m,p.BorderRight=f;break;case l.TextAlignmentEnum.RightBottom:p.BorderTop=-m,p.BorderLeft=-f,p.BorderBottom=0,p.BorderRight=0;break;case l.TextAlignmentEnum.RightCenter:p.BorderTop=-m/2,p.BorderLeft=-f,p.BorderBottom=m/2,p.BorderRight=0;break;case l.TextAlignmentEnum.RightTop:p.BorderTop=0,p.BorderLeft=-f,p.BorderBottom=m,p.BorderRight=0}p.BorderMarginTop=p.BorderTop-m*n,p.BorderMarginLeft=p.BorderLeft-m*n,p.BorderMarginBottom=p.BorderBottom+m*n,p.BorderMarginRight=p.BorderRight+m*n}}},6452(dt,g,u){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.GraphicalLine=void 0;const l=u(2683);g.GraphicalLine=class{constructor(s,c,r=0,i=l.OutlineAndFillStyleEnum.BaseWritingColor,o=void 0){this.start=s,this.end=c,this.width=r,this.styleId=i,this.colorHex=o}get Start(){return this.start}set Start(s){this.start=s}get End(){return this.end}set End(s){this.end=s}get Width(){return this.width}set Width(s){this.width=s}}},2395(dt,g,u){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.GraphicalLyricEntry=void 0;const l=u(8254),s=u(7435),c=u(9409),r=u(7533);g.GraphicalLyricEntry=class{constructor(i,o,n,h){this.lyricsEntry=i,this.graphicalStaffEntry=o;const e=o.parentMeasure.parentSourceMeasure.Rules.LyricsAlignmentStandard,f=new s.Label(i.Text),m=this.graphicalStaffEntry.parentMeasure.parentSourceMeasure.Rules;this.graphicalLabel=new l.GraphicalLabel(f,n,e,m,o.PositionAndShape),this.graphicalLabel.Label.colorDefault=m.DefaultColorLyrics,this.graphicalLabel.PositionAndShape.RelativePosition=new c.PointF2D(0,h),this.graphicalLabel.setLabelPositionAndShapeBorders(),this.graphicalLabel.PositionAndShape.Size.width<m.LyricsExtraXShiftForShortLyricsWidthThreshold&&(this.graphicalLabel.PositionAndShape.RelativePosition.x+=m.LyricsExtraXShiftForShortLyrics,this.graphicalLabel.CenteringXShift=m.LyricsExtraXShiftForShortLyrics),e===r.TextAlignmentEnum.LeftBottom&&(this.graphicalLabel.PositionAndShape.RelativePosition.x-=1)}hasDashFromLyricWord(){if(!this.ParentLyricWord)return!1;const i=this.ParentLyricWord.GraphicalLyricsEntries.indexOf(this);return this.ParentLyricWord.GraphicalLyricsEntries.length>1&&i<this.ParentLyricWord.GraphicalLyricsEntries.length-1}get LyricsEntry(){return this.lyricsEntry}get ParentLyricWord(){return this.graphicalLyricWord}set ParentLyricWord(i){this.graphicalLyricWord=i}get GraphicalLabel(){return this.graphicalLabel}set GraphicalLabel(i){this.graphicalLabel=i}get StaffEntryParent(){return this.graphicalStaffEntry}set StaffEntryParent(i){this.graphicalStaffEntry=i}}},7751(dt,g){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.GraphicalLyricWord=void 0,g.GraphicalLyricWord=class{constructor(u){this.graphicalLyricsEntries=[],this.lyricWord=u,this.initialize()}get GetLyricWord(){return this.lyricWord}get GraphicalLyricsEntries(){return this.graphicalLyricsEntries}set GraphicalLyricsEntries(u){this.graphicalLyricsEntries=u}isFilled(){for(let u=0;u<this.graphicalLyricsEntries.length;u++)if(!this.graphicalLyricsEntries[u])return!1;return!0}initialize(){for(let u=0;u<this.lyricWord.Syllables.length;u++)this.graphicalLyricsEntries.push(void 0)}}},1519(dt,g){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.GraphicalMarkedArea=void 0,g.GraphicalMarkedArea=class{constructor(u,l=void 0,s=void 0,c=void 0){this.systemRectangle=u,this.labelRectangle=l,this.label=s,this.settings=c}}},5748(dt,g,u){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.GraphicalMeasure=void 0;const l=u(7741),s=u(2561),c=u(6438),r=u(9409);g.GraphicalMeasure=class i extends l.GraphicalObject{constructor(n=void 0,h=void 0,e=void 0){super(),this.hasOnlyRests=!1,this.measureNumber=-1,this.ShowTimeSignature=!0,this.ShowKeySignature=!0,this.isTabMeasure=!1,this.parentStaff=n,this.parentSourceMeasure=h,this.parentStaffLine=e,e?(this.parentStaff=e.ParentStaff,this.PositionAndShape=new c.BoundingBox(this,e.PositionAndShape)):this.PositionAndShape=new c.BoundingBox(this),this.PositionAndShape.BorderBottom=4,this.parentSourceMeasure&&(this.measureNumber=this.parentSourceMeasure.MeasureNumber),this.staffEntries=[]}get ParentStaff(){return this.parentStaff}get ParentMusicSystem(){return this.parentMusicSystem}set ParentMusicSystem(n){this.parentMusicSystem=n}get MeasureNumber(){return this.measureNumber}get FirstInstructionStaffEntry(){return this.firstInstructionStaffEntry}set FirstInstructionStaffEntry(n){this.firstInstructionStaffEntry=n}get LastInstructionStaffEntry(){return this.lastInstructionStaffEntry}set LastInstructionStaffEntry(n){this.lastInstructionStaffEntry=n}get ParentStaffLine(){return this.parentStaffLine}set ParentStaffLine(n){this.parentStaffLine=n,this.parentStaffLine&&(this.PositionAndShape.Parent=this.parentStaffLine.PositionAndShape)}resetLayout(){throw new Error("not implemented")}getLineWidth(n){throw new Error("not implemented")}addClefAtBegin(n){throw new Error("not implemented")}addKeyAtBegin(n,h,e){throw new Error("not implemented")}addRhythmAtBegin(n){throw new Error("not implemented")}addClefAtEnd(n,h=!0){throw new Error("not implemented")}setPositionInStaffline(n){this.PositionAndShape.RelativePosition=new r.PointF2D(n,0)}setWidth(n){this.PositionAndShape.BorderRight=n}layoutSymbols(){throw new Error("not implemented")}findGraphicalStaffEntryFromTimestamp(n){for(let h=0,e=this.staffEntries.length;h<e;++h){const f=this.staffEntries[h];if(f.relInMeasureTimestamp?.Equals(n))return f}}findGraphicalStaffEntryFromVerticalContainerTimestamp(n){for(let h=0,e=this.staffEntries.length;h<e;++h){const f=this.staffEntries[h];if(f.sourceStaffEntry.VerticalContainerParent.getAbsoluteTimestamp().Equals(n))return f}}hasSameDurationWithSourceMeasureParent(){const n=new s.Fraction(0,1);for(let h=0,e=this.staffEntries.length;h<e;++h)n.Add(this.staffEntries[h].findStaffEntryMinNoteLength());return n.Equals(this.parentSourceMeasure.Duration)}hasMultipleVoices(){if(0===this.staffEntries.length)return!1;const n=[];for(let h=0,e=this.staffEntries.length;h<e;++h){const f=this.staffEntries[h];for(let m=0,p=f.sourceStaffEntry.VoiceEntries.length;m<p;++m){const E=f.sourceStaffEntry.VoiceEntries[m];n.indexOf(E.ParentVoice)<0&&n.push(E.ParentVoice)}}return n.length>1}isVisible(){return this.ParentStaff.isVisible()}isMultiRestMeasure(){return void 0!==this.multiRestElement}getGraphicalMeasureDurationFromStaffEntries(){let n=new s.Fraction(0,1);const h=[];for(let e=0,f=this.staffEntries.length;e<f;++e){const m=this.staffEntries[e];for(let p=0,E=m.sourceStaffEntry.VoiceEntries.length;p<E;++p){const y=m.sourceStaffEntry.VoiceEntries[p];h.indexOf(y.ParentVoice)<0&&h.push(y.ParentVoice)}}for(let e=0,f=h.length;e<f;++e){const m=h[e],p=new s.Fraction(0,1);for(const E of this.staffEntries)for(const y of E.graphicalVoiceEntries)y.parentVoiceEntry.ParentVoice===m&&y.notes.length>0&&p.Add(y.notes[0].graphicalNoteLength);n.lt(p)&&(n=s.Fraction.createFromFraction(p))}return n}addGraphicalStaffEntry(n){this.staffEntries.push(n)}addGraphicalStaffEntryAtTimestamp(n){if(n)if(0===this.staffEntries.length||this.staffEntries[this.staffEntries.length-1].relInMeasureTimestamp.lt(n.relInMeasureTimestamp))this.staffEntries.push(n);else for(let h=this.staffEntries.length-1;h>=0;h--){if(this.staffEntries[h].relInMeasureTimestamp.lt(n.relInMeasureTimestamp)){this.staffEntries.splice(h+1,0,n);break}0===h&&this.staffEntries.splice(h,0,n)}}isPianoRightHand(){return this.isUpperStaffOfInstrument()}isPianoLeftHand(){return this.isLowerStaffOfInstrument()}isUpperStaffOfInstrument(){return 1===this.parentStaff.ParentInstrument.Staves.length||this.ParentStaff===this.parentStaff.ParentInstrument.Staves[0]}isLowerStaffOfInstrument(){return 1!==this.parentStaff.ParentInstrument.Staves.length&&this.ParentStaff===this.ParentStaff.ParentInstrument.Staves.last()}beginsWithLineRepetition(){const n=this.parentSourceMeasure;return!!n&&n.beginsWithLineRepetition()}endsWithLineRepetition(){const n=this.parentSourceMeasure;return!!n&&n.endsWithLineRepetition()}beginsWithWordRepetition(){const n=this.parentSourceMeasure;return!!n&&n.beginsWithWordRepetition()}endsWithWordRepetition(){const n=this.parentSourceMeasure;return!!n&&n.endsWithWordRepetition()}getTransposedHalftones(){return this.parentStaff.ParentInstrument.GetMusicSheet.Transpose+this.parentStaff.ParentInstrument.Transpose}}},1888(dt,g,u){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.PagePlacementEnum=g.GraphicalMusicPage=void 0;const l=u(6438),s=u(7741),c=u(9409);var i,o;g.GraphicalMusicPage=class r extends s.GraphicalObject{constructor(n){super(),this.musicSystems=[],this.labels=[],this.parent=n,this.boundingBox=new l.BoundingBox(this,void 0)}get MusicSystems(){return this.musicSystems}set MusicSystems(n){this.musicSystems=n}get Labels(){return this.labels}set Labels(n){this.labels=n}get Parent(){return this.parent}set Parent(n){this.parent=n}get PageNumber(){return this.pageNumber}set PageNumber(n){this.pageNumber=n}setMusicPageAbsolutePosition(n,h){return new c.PointF2D(0,0)}},(o=i||(g.PagePlacementEnum=i={}))[o.Down=0]="Down",o[o.Right=1]="Right",o[o.RightDown=2]="RightDown"},8724(dt,g,u){"use strict";var l=this&&this.__importDefault||function(y){return y&&y.__esModule?y:{default:y}};Object.defineProperty(g,"__esModule",{value:!0}),g.SystemImageProperties=g.GraphicalMusicSheet=void 0;const s=u(6723),c=u(6452),r=u(348),i=u(9409),o=u(164),n=u(4543),h=u(2561),e=u(6438),f=l(u(3065)),m=u(813),p=u(4548),E=u(7741);g.GraphicalMusicSheet=class{constructor(y,d){this.musicPages=[],this.measureList=[],this.verticalGraphicalStaffEntryContainers=[],this.cursors=[],this.leadSheet=!1,this.musicSheet=y,this.numberOfStaves=this.musicSheet.Staves.length,this.calculator=d,this.calculator.initialize(this)}get ParentMusicSheet(){return this.musicSheet}get GetCalculator(){return this.calculator}get MusicPages(){return this.musicPages}set MusicPages(y){this.musicPages=y}get MeasureList(){return this.measureList}set MeasureList(y){this.measureList=y}get VerticalGraphicalStaffEntryContainers(){return this.verticalGraphicalStaffEntryContainers}set VerticalGraphicalStaffEntryContainers(y){this.verticalGraphicalStaffEntryContainers=y}get Title(){return this.title}set Title(y){this.title=y}get Subtitle(){return this.subtitle}set Subtitle(y){this.subtitle=y}get Composer(){return this.composer}set Composer(y){this.composer=y}get Lyricist(){return this.lyricist}set Lyricist(y){this.lyricist=y}get Copyright(){return this.copyright}set Copyright(y){this.copyright=y}get Cursors(){return this.cursors}get SelectionStartSymbol(){return this.selectionStartSymbol}get SelectionEndSymbol(){return this.selectionEndSymbol}get MinAllowedSystemWidth(){return this.minAllowedSystemWidth}set MinAllowedSystemWidth(y){this.minAllowedSystemWidth=y}get NumberOfStaves(){return this.numberOfStaves}get LeadSheet(){return this.leadSheet}set LeadSheet(y){this.leadSheet=y}static transformRelativeToAbsolutePosition(y){for(let d=0;d<y.MusicPages.length;d++){const S=y.MusicPages[d].setMusicPageAbsolutePosition(d,y.ParentMusicSheet.Rules);y.MusicPages[d].PositionAndShape.calculateAbsolutePositionsRecursive(S.x,S.y)}}Initialize(){this.verticalGraphicalStaffEntryContainers=[],this.musicPages=[],this.measureList=[]}reCalculate(){this.calculator.calculate()}EnforceRedrawOfMusicSystems(){for(let y=0,d=this.musicPages.length;y<d;++y){const S=this.musicPages[y];for(let M=0,x=S.MusicSystems.length;M<x;++M)S.MusicSystems[M].needsToBeRedrawn=!0}}getClickedObject(y){for(let d=0,S=this.MusicPages.length;d<S;++d)return this.MusicPages[d].PositionAndShape.getClickedObjectOfType(y)}findGraphicalMeasure(y,d){for(let S=y;S>=0;S--){const M=this.measureList[S]?.[d];if(M)return M}}findGraphicalMeasureByMeasureNumber(y,d){for(let S=y;S>=0;S--)if(this.MeasureList[S]){const M=this.MeasureList[S][d];if(M?.MeasureNumber===y)return M}}findGraphicalStaffEntryFromMeasureList(y,d,S){for(let M=d;M<this.measureList.length;M++){const x=this.measureList[M][y];if(x)for(let _=0,I=x.staffEntries.length;_<I;++_){const T=x.staffEntries[_];if(T.sourceStaffEntry===S)return T}}}findNextGraphicalStaffEntry(y,d,S){const M=S.parentMeasure,x=M.staffEntries.indexOf(S);if(x<M.staffEntries.length-1)return M.staffEntries[x+1];if(d<this.measureList.length-1){const _=this.measureList[d+1][y];if(_.staffEntries.length>0)return _.staffEntries[0]}}getFirstVisibleMeasuresListFromIndices(y,d){const S=[],M=this.measureList[0].length;for(let x=y;x<=d;x++)for(let _=0;_<M;_++)if(this.measureList[x][_].isVisible()){S.push(this.measureList[x][_]);break}return S}orderMeasuresByStaffLine(y){const d=[];let S=[];d.push(S);for(let M=0;M<y.length;M++)0===M?S.push(y[0]):(y[M].ParentStaffLine===y[M-1].ParentStaffLine||(-1===d.indexOf(S)&&d.push(S),S=[],d.push(S)),S.push(y[M]));return d}initializeActiveClefs(){const y=[],d=this.musicSheet.getFirstSourceMeasure();if(d)for(let S=0;S<d.CompleteNumberOfStaves;S++){let M=new o.ClefInstruction;if(d.FirstInstructionsStaffEntries[S])for(let x=0,_=d.FirstInstructionsStaffEntries[S].Instructions.length;x<_;++x){const I=d.FirstInstructionsStaffEntries[S].Instructions[x];I instanceof o.ClefInstruction&&(M=I)}y.push(M)}return y}GetMainKey(){const y=this.musicSheet.getFirstSourceMeasure();if(y)for(let d=0;d<y.CompleteNumberOfStaves;d++)for(let S=0,M=y.FirstInstructionsStaffEntries[d].Instructions.length;S<M;++S){const x=y.FirstInstructionsStaffEntries[d].Instructions[S];if(x instanceof n.KeyInstruction)return x}}getOrCreateVerticalContainer(y){if(0===this.verticalGraphicalStaffEntryContainers.length||m.CollectionUtil.getLastElement(this.verticalGraphicalStaffEntryContainers).AbsoluteTimestamp.lt(y)){const d=new s.VerticalGraphicalStaffEntryContainer(this.numberOfStaves,y);return this.verticalGraphicalStaffEntryContainers.push(d),d}for(let d=this.verticalGraphicalStaffEntryContainers.length-1;d>=0;d--){if(this.verticalGraphicalStaffEntryContainers[d].AbsoluteTimestamp.lt(y)){const S=new s.VerticalGraphicalStaffEntryContainer(this.numberOfStaves,y);return this.verticalGraphicalStaffEntryContainers.splice(d+1,0,S),S}if(this.verticalGraphicalStaffEntryContainers[d].AbsoluteTimestamp.Equals(y))return this.verticalGraphicalStaffEntryContainers[d]}}GetVerticalContainerFromTimestamp(y,d=0){const S=m.CollectionUtil.binarySearch(this.verticalGraphicalStaffEntryContainers,new s.VerticalGraphicalStaffEntryContainer(0,y),s.VerticalGraphicalStaffEntryContainer.compareByTimestamp,d);if(S>=0)return this.verticalGraphicalStaffEntryContainers[S]}GetInterpolatedIndexInVerticalContainers(y){const d=this.verticalGraphicalStaffEntryContainers;if(1===d.length)return 0;let S,M,x=0,_=d.length-1;if(y.lte(d[d.length-1].AbsoluteTimestamp)){for(;_-x>1;){const A=Math.floor((_+x)/2);if(d[x].AbsoluteTimestamp.Equals(y)){_=x;break}if(d[_].AbsoluteTimestamp.Equals(y)){x=_;break}if(d[A].AbsoluteTimestamp.Equals(y))return this.verticalGraphicalStaffEntryContainers.indexOf(d[A]);y.lt(d[A].AbsoluteTimestamp)?_=A:x=A}if(x===_)return this.verticalGraphicalStaffEntryContainers.indexOf(d[x]);S=d[x].AbsoluteTimestamp,M=d[_].AbsoluteTimestamp}else S=d[d.length-1].AbsoluteTimestamp,M=h.Fraction.plus(this.getLongestStaffEntryDuration(d.length-1),S),_=d.length;return Math.min(_-(M.RealValue-y.RealValue)/(M.RealValue-S.RealValue),this.verticalGraphicalStaffEntryContainers.length-1)}getVisibleStavesIndicesFromSourceMeasure(y){const d=[],S=[];for(let M=0,x=y.length;M<x;++M){const _=y[M].ParentStaff.ParentInstrument;-1===d.indexOf(_)&&d.push(_)}for(let M=0,x=d.length;M<x;++M){const _=d[M],I=this.musicSheet.getGlobalStaffIndexOfFirstStaff(_);for(let T=0;T<_.Staves.length;T++)S.push(I+T)}return S}getGraphicalMeasureFromSourceMeasureAndIndex(y,d){for(let S=0;S<this.measureList.length;S++)if(this.measureList[S][0]?.parentSourceMeasure===y)return this.measureList[S][d]}getLastGraphicalMeasureFromIndex(y,d=!0){let S=this.measureList.length-1;d&&(S=Math.min(S,this.musicSheet.Rules.MaxMeasureToDrawIndex));let M=this.measureList[S][y];for(;!M&&S>=0;)M=this.measureList[--S][y];return this.measureList[S][y]}getMeasureIndex(y,d,S){for(d=0;d<this.measureList.length;d++)for(let M=0,x=this.measureList[d].length;M<x;++M)if(this.measureList[d][M]===y)return!0;return!1}GetNearestGraphicalObject(y,d=E.GraphicalObject.name,S=5,M=20,x=5,_=void 0){const I=[];for(;0===I.length&&S<=M;){const A=new e.BoundingBox(void 0);A.BorderLeft=y.x-S,A.BorderTop=y.y-S,A.BorderRight=y.x+S,A.BorderBottom=y.y+S,A.AbsolutePosition=new i.PointF2D(y.x,y.y),A.calculateAbsolutePosition();for(let v=0,B=this.MusicPages.length;v<B;++v){const D=this.MusicPages[v].PositionAndShape.getObjectsInRegion(A,!1,d);if(D&&0!==D.length)for(let L=0,F=D.length;L<F;++L)_?_(D[L])&&I.push(D[L]):I.push(D[L])}S+=x}let T;for(let A=0,v=I.length;A<v;++A){const B=I[A];(void 0===T||this.CalculateDistance(B.PositionAndShape.AbsolutePosition,y)<this.CalculateDistance(T.PositionAndShape.AbsolutePosition,y))&&(T=B)}if(T)return T}GetNearestVoiceEntry(y){return this.GetNearestGraphicalObject(y,p.GraphicalVoiceEntry.name,5,20,5,d=>void 0!==d.parentStaffEntry?.relInMeasureTimestamp)}GetNearestNote(y,d){const S=this.GetNearestVoiceEntry(y);if(!S)return;let M,x=Number.MAX_SAFE_INTEGER;for(const _ of S.notes){const I=_.PositionAndShape.AbsolutePosition.y,T=Math.abs(_.PositionAndShape.AbsolutePosition.x-y.x),A=Math.abs(I-y.y);T+A<x&&(M=_,x=T+A)}return M}domToSvg(y){return this.domToSvgTransform(y,!0)}svgToDom(y){return this.domToSvgTransform(y,!1)}svgToOsmd(y){const d=new i.PointF2D(y.x,y.y);return d.x/=10,d.y/=10,d}domToSvgTransform(y,d){const S=this.drawer.Backends[0].getSvgElement(),M=S.createSVGPoint();M.x=y.x,M.y=y.y;let x=S.getScreenCTM();d&&(x=x.inverse());const _=M.matrixTransform(x);return new i.PointF2D(_.x,_.y)}GetClickableLabel(y){const d=new e.BoundingBox;d.BorderLeft=y.x-4,d.BorderTop=y.y-4,d.BorderRight=y.x+4,d.BorderBottom=y.y+4,d.AbsolutePosition=new i.PointF2D(0,0);for(let S=0,M=this.MusicPages.length;S<M;++S){const x=this.MusicPages[S].PositionAndShape.getObjectsInRegion(d);if(1===x.length)for(let _=0,I=x.length;_<I;++_)return x[_]}}GetNearestStaffEntry(y){const d=[],S=new e.BoundingBox(void 0);S.BorderLeft=y.x-10,S.BorderTop=y.y-10,S.BorderRight=y.x+10,S.BorderBottom=y.y+10,S.AbsolutePosition=new i.PointF2D(0,0);for(let x=0,_=this.MusicPages.length;x<_;++x){const I=this.MusicPages[x].PositionAndShape.getObjectsInRegion(S,!1,r.GraphicalStaffEntry.name);if(I&&0!==I.length)for(let T=0,A=I.length;T<A;++T)d.push(I[T])}let M;for(let x=0,_=d.length;x<_;++x){const I=d[x];if(void 0===M)M=I;else{if(!I.relInMeasureTimestamp)continue;this.CalculateDistance(I.PositionAndShape.AbsolutePosition,y)<this.CalculateDistance(M.PositionAndShape.AbsolutePosition,y)&&(M=I)}}if(M)return M}GetNearestObject(y,d){const S=[],M=new e.BoundingBox(void 0);M.BorderLeft=y.x-10,M.BorderTop=y.y-10,M.BorderRight=y.x+10,M.BorderBottom=y.y+10,M.AbsolutePosition=new i.PointF2D(0,0);for(let _=0,I=this.MusicPages.length;_<I;++_){const T=this.MusicPages[_].PositionAndShape.getObjectsInRegion(M,!1,d);if(T&&0!==T.length)for(let A=0,v=T.length;A<v;++A)S.push(T[A])}let x;for(let _=0,I=S.length;_<I;++_){const T=S[_];(void 0===x||this.CalculateDistance(T.PositionAndShape.AbsolutePosition,y)<this.CalculateDistance(x.PositionAndShape.AbsolutePosition,y))&&(x=T)}if(x)return x}GetPossibleCommentAnchor(y){const d=this.GetNearestStaffEntry(y);if(d)return d.sourceStaffEntry}getClickedObjectOfType(y){for(let d=0,S=this.musicPages.length;d<S;++d){const M=this.musicPages[d].PositionAndShape.getClickedObjectOfType(y);if(M)return M}}tryGetTimestampFromPosition(y){const d=this.getClickedObjectOfType(y);if(d)return d.getAbsoluteTimestamp()}tryGetClickableLabel(y){try{return this.GetClickableLabel(y)}catch(d){f.default.info("GraphicalMusicSheet.tryGetClickableObject","positionOnMusicSheet: "+y,d)}}tryGetTimeStampFromPosition(y){try{const d=this.GetNearestStaffEntry(y);return d?d.getAbsoluteTimestamp():void 0}catch(d){f.default.info("GraphicalMusicSheet.tryGetTimeStampFromPosition","positionOnMusicSheet: "+y,d)}}getStaffEntry(y){const d=this.VerticalGraphicalStaffEntryContainers[y];let S;try{for(let M=0,x=d.StaffEntries.length;M<x;++M){const _=d.StaffEntries[M];_&&_.sourceStaffEntry.ParentStaff.isVisible()&&(S?_.PositionAndShape&&S.PositionAndShape&&S.PositionAndShape.RelativePosition.x>_.PositionAndShape.RelativePosition.x&&(S=_):S=_)}}catch(M){f.default.info("GraphicalMusicSheet.getStaffEntry",M)}return S}GetPreviousVisibleContainerIndex(y){for(let d=y-1;d>=0;d--){const S=this.verticalGraphicalStaffEntryContainers[d].StaffEntries;for(let M=0,x=S.length;M<x;++M){const _=S[M];if(_&&_.sourceStaffEntry.ParentStaff.isVisible())return d}}return-1}GetNextVisibleContainerIndex(y){for(let d=y+1;d<this.verticalGraphicalStaffEntryContainers.length;++d){const S=this.verticalGraphicalStaffEntryContainers[d].StaffEntries;for(let M=0,x=S.length;M<x;++M){const _=S[M];if(_&&_.sourceStaffEntry.ParentStaff.isVisible())return d}}return-1}findClosestLeftStaffEntry(y,d){let S,M=Math.floor(y);M=Math.min(this.VerticalGraphicalStaffEntryContainers.length-1,M);for(let x=M;x>=0;x--)if(S=this.getStaffEntry(x),S&&(!d||S.sourceStaffEntry.ParentStaff.isVisible()))return S}findClosestRightStaffEntry(y,d){let S;for(let M=Math.max(0,Math.ceil(y));M<this.VerticalGraphicalStaffEntryContainers.length;M++)if(S=this.getStaffEntry(M),S&&(!d||S.sourceStaffEntry.ParentStaff.isVisible()))return S}calculateCursorLineAtTimestamp(y,d){const S=this.calculateXPositionFromTimestamp(y),M=S[0],x=S[1];if(!x||0===x.StaffLines.length)return;const _=x.PositionAndShape.AbsolutePosition.y,I=m.CollectionUtil.last(x.StaffLines).PositionAndShape.RelativePosition.y+4;return new c.GraphicalLine(new i.PointF2D(M,_),new i.PointF2D(M,_+I),3,d)}calculateXPositionFromTimestamp(y){let d;const S=this.GetInterpolatedIndexInVerticalContainers(y),M=this.findClosestLeftStaffEntry(S,!0),x=this.findClosestRightStaffEntry(S,!0),_=y.RealValue;if(!M&&!x)return[0,void 0];let I,T;if(I=M?M.parentMeasure.ParentStaffLine?.ParentMusicSystem:x.parentMeasure.ParentStaffLine?.ParentMusicSystem,T=x?x.parentMeasure.ParentStaffLine?.ParentMusicSystem:M.parentMeasure.ParentStaffLine?.ParentMusicSystem,I===T){let A,v,B;if(d=I,M)if(x)v=M.PositionAndShape.AbsolutePosition.x,B=x.PositionAndShape.AbsolutePosition.x,A=M===x?0:(_-M.getAbsoluteTimestamp().RealValue)/(x.getAbsoluteTimestamp().RealValue-M.getAbsoluteTimestamp().RealValue);else{v=M.PositionAndShape.AbsolutePosition.x,B=d.GetRightBorderAbsoluteXPosition();const D=M.parentMeasure.parentSourceMeasure;A=(_-M.getAbsoluteTimestamp().RealValue)/(h.Fraction.plus(D.AbsoluteTimestamp,D.Duration).RealValue-M.getAbsoluteTimestamp().RealValue)}else v=B=x.PositionAndShape.AbsolutePosition.x,A=0;return A=Math.min(1,Math.max(0,A)),[v+A*(B-v),d]}{const A=x.parentMeasure.parentSourceMeasure.AbsoluteTimestamp.RealValue;let v,B;if(_<A&&I.StaffLines[0]){d=I;const D=M.PositionAndShape.AbsolutePosition.x,L=d.GetRightBorderAbsoluteXPosition();v=(_-M.getAbsoluteTimestamp().RealValue)/(A-M.getAbsoluteTimestamp().RealValue),v=Math.min(1,Math.max(0,v)),B=D+v*(L-D)}else{d=T;const D=x.PositionAndShape.AbsolutePosition.x,L=d.GetLeftBorderAbsoluteXPosition();v=(_-A)/(x.getAbsoluteTimestamp().RealValue-A),v=Math.min(1,Math.max(0,v)),B=L+v*(D-L)}return[B,d]}}GetNumberOfVisibleInstruments(){let y=0;for(let d=0,S=this.musicSheet.Instruments.length;d<S;++d)this.musicSheet.Instruments[d].isVisible()&&y++;return y}GetNumberOfFollowedInstruments(){let y=0;for(let d=0,S=this.musicSheet.Instruments.length;d<S;++d)!0===this.musicSheet.Instruments[d].Following&&y++;return y}GetGraphicalFromSourceStaffEntry(y){return y.VerticalContainerParent.ParentMeasure?.VerticalMeasureList?y.VerticalContainerParent.ParentMeasure.VerticalMeasureList[y.ParentStaff.idInMusicSheet]?.findGraphicalStaffEntryFromTimestamp(y.Timestamp):void 0}CalculateDistance(y,d){const S=y.x-d.x,M=y.y-d.y;return S*S+M*M}getLongestStaffEntryDuration(y){let d=new h.Fraction(0,1);for(const S of this.verticalGraphicalStaffEntryContainers[y].StaffEntries){if(!S)continue;const M=S.findStaffEntryMaxNoteLength();d.lt(M)&&(d=M)}return d}},g.SystemImageProperties=class{}},3430(dt,g,u){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.GraphicalNote=void 0;const l=u(8233),s=u(7741),c=u(7921),r=u(6438);g.GraphicalNote=class i extends s.GraphicalObject{constructor(n,h,e,f=void 0){super(),this.DrawnAccidental=l.AccidentalEnum.NONE,this.lineShift=0,this.sourceNote=n,this.parentVoiceEntry=h,this.PositionAndShape=new r.BoundingBox(this,h.PositionAndShape),this.graphicalNoteLength=f||n.Length,this.numberOfDots=this.calculateNumberOfNeededDots(this.graphicalNoteLength),this.rules=e,this.rules.addGraphicalNoteToNoteMap(n,this)}Transpose(n,h,e,f){let m=this.sourceNote.Pitch;return c.MusicSheetCalculator.transposeCalculator&&(m=c.MusicSheetCalculator.transposeCalculator.transposePitch(this.sourceNote.Pitch,n,e)),m}calculateNumberOfNeededDots(n){return this.sourceNote&&this.sourceNote.NoteTuplet?0:n.calculateNumberOfNeededDots()}get ParentMusicPage(){return this.parentVoiceEntry.parentStaffEntry.parentMeasure.ParentMusicSystem?.Parent}static FromNote(n,h){return h.NoteToGraphicalNoteMap.getValue(n.NoteToGraphicalNoteObjectId)}ToStringShort(n=0){return this.sourceNote?.ToStringShort(n)}get ToStringShortGet(){return this.ToStringShort(0)}getLyricsSVGs(){const n=[];if(!this.parentVoiceEntry)return n;for(const h of this.parentVoiceEntry.parentStaffEntry.LyricsEntries)n.push(h.GraphicalLabel?.SVGNode);return n}setColor(n,h){}setVisible(n,h={}){}}},7741(dt,g,u){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.GraphicalObject=void 0;const l=u(7791);g.GraphicalObject=class s extends l.AClassHierarchyTrackable{get PositionAndShape(){return this.boundingBox}set PositionAndShape(r){this.boundingBox=r}}},2768(dt,g,u){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.GraphicalOctaveShift=void 0;const l=u(7741),s=u(437),c=u(6438),r=u(512),i=u(7307);g.GraphicalOctaveShift=class o extends l.GraphicalObject{constructor(h,e){super(),this.getOctaveShift=h,this.setSymbol(),this.PositionAndShape=new c.BoundingBox(this,e)}setSymbol(){switch(this.getOctaveShift.Type){case s.OctaveEnum.VA8:this.octaveSymbol=r.MusicSymbol.VA8;break;case s.OctaveEnum.VB8:this.octaveSymbol=r.MusicSymbol.VB8;break;case s.OctaveEnum.MA15:this.octaveSymbol=r.MusicSymbol.MA15;break;case s.OctaveEnum.MB15:this.octaveSymbol=r.MusicSymbol.MB15;break;default:throw new i.ArgumentOutOfRangeException("")}}}},7824(dt,g,u){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.GraphicalPedal=void 0;const l=u(7741),s=u(6438),c=u(512);g.GraphicalPedal=class r extends l.GraphicalObject{constructor(o,n){super(),this.getPedal=o,this.setSymbol(),this.PositionAndShape=new s.BoundingBox(this,n)}setSymbol(){this.pedalSymbol=!this.getPedal.IsLine&&this.getPedal.IsSign?c.MusicSymbol.PEDAL_SYMBOL:this.getPedal.IsLine&&this.getPedal.IsSign?c.MusicSymbol.PEDAL_MIXED:c.MusicSymbol.PEDAL_BRACKET}}},973(dt,g,u){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.GraphicalRectangle=void 0;const l=u(6438),s=u(7741);g.GraphicalRectangle=class c extends s.GraphicalObject{constructor(i,o,n,h){super(),this.boundingBox=new l.BoundingBox(this,n),this.boundingBox.RelativePosition=i,this.boundingBox.BorderRight=o.x-i.x,this.boundingBox.BorderBottom=o.y-i.y,this.style=h}}},4022(dt,g,u){"use strict";var l=this&&this.__importDefault||function(m){return m&&m.__esModule?m:{default:m}};Object.defineProperty(g,"__esModule",{value:!0}),g.GraphicalSlur=void 0;const s=u(9409),c=u(6711),r=u(6362),i=u(6904),o=u(4249),n=u(2561),h=u(1336);var e=l(u(3206)).default.Flow;class f extends c.GraphicalCurve{constructor(p,E){super(),this.staffEntries=[],this.slur=p,this.rules=E}static Compare(p,E){if(p.staffEntries.length<1)return-1;if(E.staffEntries.length<1)return 1;const y=n.Fraction.minus(p.staffEntries[p.staffEntries.length-1].getAbsoluteTimestamp(),p.staffEntries[0].getAbsoluteTimestamp()),d=n.Fraction.minus(E.staffEntries[E.staffEntries.length-1].getAbsoluteTimestamp(),E.staffEntries[0].getAbsoluteTimestamp());return y.RealValue>d.RealValue?1:d.RealValue>y.RealValue?-1:0}calculateCurve(p){const E=this.staffEntries[0],y=this.staffEntries[this.staffEntries.length-1];let d=E.findGraphicalNoteFromNote(this.slur.StartNote);!d&&this.graceStart&&(d=E.findGraphicalNoteFromGraceNote(this.slur.StartNote)),d||(d=E.findEndTieGraphicalNoteFromNoteWithStartingSlur(this.slur.StartNote,this.slur));let S=y.findGraphicalNoteFromNote(this.slur.EndNote);!S&&this.graceEnd&&(S=y.findGraphicalNoteFromGraceNote(this.slur.EndNote));const M=E.parentMeasure.ParentStaffLine,x=M.SkyBottomLineCalculator;this.calculatePlacement(x,M);const _=this.calculateStartAndEnd(d,S,M,p,x),I=_.startX,T=_.endX;let A=_.startY,v=_.endY;const B=p.SlurTangentMinAngle,D=p.SlurTangentMaxAngle;let L;if(this.placement===r.PlacementEnum.Above){A-=p.SlurNoteHeadYOffset,v-=p.SlurNoteHeadYOffset;const F=new s.PointF2D(this.staffEntries[0].parentMeasure.PositionAndShape.RelativePosition.x+this.staffEntries[0].PositionAndShape.RelativePosition.x,A);d?F.x+=this.staffEntries[0].PositionAndShape.BorderRight:F.x=this.staffEntries[0].parentMeasure.beginInstructionsWidth,this.graceStart&&(F.x+=y.PositionAndShape.RelativePosition.x);const V=new s.PointF2D(this.staffEntries[this.staffEntries.length-1].parentMeasure.PositionAndShape.RelativePosition.x+this.staffEntries[this.staffEntries.length-1].PositionAndShape.RelativePosition.x,v);if(S?V.x+=this.staffEntries[this.staffEntries.length-1].PositionAndShape.BorderLeft:V.x=this.staffEntries[this.staffEntries.length-1].parentMeasure.PositionAndShape.RelativePosition.x+this.staffEntries[this.staffEntries.length-1].parentMeasure.PositionAndShape.Size.width,this.graceEnd&&(V.x+=y.staffEntryParent.PositionAndShape.RelativePosition.x),L=this.calculateTopPoints(F,V,M,x),0===L.length){const St=new s.PointF2D((V.x-F.x)/2+F.x,(V.y-F.y)/2+F.y);L.push(St)}const j=Math.atan((v-A)/(T-I)),P=new s.PointF2D(0,0);let U=new s.PointF2D(T-I,-(v-A));const Y=i.Matrix2D.getRotationMatrix(j),H=Y.getTransposeMatrix();U=Y.vectorMultiplication(U);const Q=this.calculateTranslatedAndRotatedPointListAbove(L,I,A,Y),ot=this.calculateMaxLeftSlope(Q,P,U),$=this.calculateMaxRightSlope(Q,P,U),it=P.y-P.x*ot,nt=U.y-U.x*$,st=new s.PointF2D;let N=!1;Math.abs(Math.abs(ot)-Math.abs($))<1e-4?(st.x=U.x/2,st.y=0,N=!0):(st.x=(nt-it)/(ot-$),st.y=ot*st.x+it);const C=this.calculateHeightWidthRatio(U.x,Q),O=0,X=0;let W=B,G=-B;if(!N){const St=this.calculateAngles(B,ot,$,D);W=St.startAngle,G=St.endAngle}const K=this.calculateControlPoints(U.x,W,G,Q,C,A,v);let q=K.startControlPoint,Z=K.endControlPoint;q=H.vectorMultiplication(q),q.x+=I,q.y=-q.y+A,Z=H.vectorMultiplication(Z),Z.x+=I,Z.y=-Z.y+A,this.bezierStartPt=new s.PointF2D(I,A-O),this.bezierStartControlPt=new s.PointF2D(q.x,q.y-O),this.bezierEndControlPt=new s.PointF2D(Z.x,Z.y-X),this.bezierEndPt=new s.PointF2D(T,v-X);const et=M.SkyLine.length,ct=x.getLeftIndexForPointX(this.bezierStartPt.x,et),pt=x.getLeftIndexForPointX(this.bezierEndPt.x,et),gt=this.bezierEndPt.x-this.bezierStartPt.x,Et=x.SamplingUnit;for(let St=ct;St<pt;St++){const yt=this.calculateCurvePointAtIndex(Math.abs(St/Et-this.bezierStartPt.x)/gt);let vt=x.getLeftIndexForPointX(yt.x,et);vt>=ct&&(M.SkyLine[vt]=Math.min(M.SkyLine[vt],yt.y)),vt++,vt<et&&(M.SkyLine[vt]=Math.min(M.SkyLine[vt],yt.y))}}else{A+=p.SlurNoteHeadYOffset,v+=p.SlurNoteHeadYOffset;const F=new s.PointF2D(this.staffEntries[0].parentMeasure.PositionAndShape.RelativePosition.x+this.staffEntries[0].PositionAndShape.RelativePosition.x,A);d?F.x+=this.staffEntries[0].PositionAndShape.BorderRight:F.x=this.staffEntries[0].parentMeasure.beginInstructionsWidth,this.graceStart&&(F.x+=y.PositionAndShape.RelativePosition.x);const V=new s.PointF2D(this.staffEntries[this.staffEntries.length-1].parentMeasure.PositionAndShape.RelativePosition.x+this.staffEntries[this.staffEntries.length-1].PositionAndShape.RelativePosition.x,v);if(S?V.x+=this.staffEntries[this.staffEntries.length-1].PositionAndShape.BorderLeft:V.x=this.staffEntries[this.staffEntries.length-1].parentMeasure.PositionAndShape.RelativePosition.x+this.staffEntries[this.staffEntries.length-1].parentMeasure.PositionAndShape.Size.width,this.graceEnd&&(V.x+=y.staffEntryParent.PositionAndShape.RelativePosition.x),L=this.calculateBottomPoints(F,V,M,x),0===L.length){const St=new s.PointF2D((V.x-F.x)/2+F.x,(V.y-F.y)/2+F.y);L.push(St)}const j=Math.atan((v-A)/(T-I)),P=new s.PointF2D(0,0);let U=new s.PointF2D(T-I,v-A);const Y=i.Matrix2D.getRotationMatrix(-j),H=Y.getTransposeMatrix();U=Y.vectorMultiplication(U);const Q=this.calculateTranslatedAndRotatedPointListBelow(L,I,A,Y),ot=this.calculateMaxLeftSlope(Q,P,U),$=this.calculateMaxRightSlope(Q,P,U),it=P.y-P.x*ot,nt=U.y-U.x*$,st=new s.PointF2D;let N=!1;Math.abs(Math.abs(ot)-Math.abs($))<1e-4?(st.x=U.x/2,st.y=0,N=!0):(st.x=(nt-it)/(ot-$),st.y=ot*st.x+it);const C=this.calculateHeightWidthRatio(U.x,Q),O=0,X=0;let W=B,G=-B;if(!N){const St=this.calculateAngles(B,ot,$,D);W=St.startAngle,G=St.endAngle}const K=this.calculateControlPoints(U.x,W,G,Q,C,A,v);let q=K.startControlPoint,Z=K.endControlPoint;q=H.vectorMultiplication(q),q.x+=I,q.y+=A,Z=H.vectorMultiplication(Z),Z.x+=I,Z.y+=A,this.bezierStartPt=new s.PointF2D(I,A+O),this.bezierStartControlPt=new s.PointF2D(q.x,q.y+O),this.bezierEndControlPt=new s.PointF2D(Z.x,Z.y+X),this.bezierEndPt=new s.PointF2D(T,v+X);const et=M.BottomLine.length,ct=x.getLeftIndexForPointX(this.bezierStartPt.x,et),pt=x.getLeftIndexForPointX(this.bezierEndPt.x,et),gt=this.bezierEndPt.x-this.bezierStartPt.x,Et=x.SamplingUnit;for(let St=ct;St<pt;St++){const yt=this.calculateCurvePointAtIndex(Math.abs(St/Et-this.bezierStartPt.x)/gt);let vt=x.getLeftIndexForPointX(yt.x,et);vt>=ct&&(M.BottomLine[vt]=Math.max(M.BottomLine[vt],yt.y)),vt++,vt<et&&(M.BottomLine[vt]=Math.max(M.BottomLine[vt],yt.y))}}}calculateStartAndEnd(p,E,y,d,S){let M=0,x=0,_=0,I=0;if(p){M=p.PositionAndShape.RelativePosition.x+p.parentVoiceEntry.parentStaffEntry.PositionAndShape.RelativePosition.x+p.parentVoiceEntry.parentStaffEntry.parentMeasure.PositionAndShape.RelativePosition.x,this.graceStart&&(M+=p.parentVoiceEntry.parentStaffEntry.staffEntryParent.PositionAndShape.RelativePosition.x);const T=p.parentVoiceEntry;this.placement===r.PlacementEnum.Above?(x=T.PositionAndShape.RelativePosition.y+T.PositionAndShape.BorderTop,this.rules.SlurPlacementUseSkyBottomLine&&(x=Math.min(I,T.parentStaffEntry.getSkylineMin()))):(x=T.PositionAndShape.RelativePosition.y+T.PositionAndShape.BorderBottom,this.rules.SlurPlacementUseSkyBottomLine&&(x=Math.max(I,T.parentStaffEntry.getBottomlineMax()))),T.parentVoiceEntry.StemDirection===h.StemDirectionType.Down&&this.placement===r.PlacementEnum.Below&&(M-=.5),T.parentVoiceEntry.StemDirection===h.StemDirectionType.Up&&this.placement===r.PlacementEnum.Above&&(M+=.5)}else M=0;if(E){_=E.PositionAndShape.RelativePosition.x+E.parentVoiceEntry.parentStaffEntry.PositionAndShape.RelativePosition.x+E.parentVoiceEntry.parentStaffEntry.parentMeasure.PositionAndShape.RelativePosition.x,this.graceEnd&&(_+=E.parentVoiceEntry.parentStaffEntry.staffEntryParent.PositionAndShape.RelativePosition.x);const T=E.parentVoiceEntry;let A;for(const v of T.parentVoiceEntry.Articulations)if(A=v.placement,v.placement===r.PlacementEnum.NotYetDefined)for(const B of E.vfnote[0].modifiers)if(B.getCategory()===e.Articulation.CATEGORY){B.position===e.Modifier.Position.ABOVE?(v.placement=r.PlacementEnum.Above,A=r.PlacementEnum.Above):B.position===e.Modifier.Position.BELOW&&(v.placement=r.PlacementEnum.Below,A=r.PlacementEnum.Below);break}this.placement===r.PlacementEnum.Above?(I=T.PositionAndShape.RelativePosition.y+T.PositionAndShape.BorderTop,this.rules.SlurPlacementUseSkyBottomLine&&(I=Math.min(I,T.parentStaffEntry.getSkylineMin())),A===r.PlacementEnum.Above&&(I-=this.rules.SlurEndArticulationYOffset)):(I=T.PositionAndShape.RelativePosition.y+T.PositionAndShape.BorderBottom,this.rules.SlurPlacementUseSkyBottomLine&&(I=Math.max(I,T.parentStaffEntry.getBottomlineMax())),A===r.PlacementEnum.Below&&(I+=this.rules.SlurEndArticulationYOffset)),T.parentVoiceEntry.StemDirection===h.StemDirectionType.Down&&this.placement===r.PlacementEnum.Below&&(_-=.5),T.parentVoiceEntry.StemDirection===h.StemDirectionType.Up&&this.placement===r.PlacementEnum.Above&&(_+=.5)}else _=y.PositionAndShape.Size.width;return p||E||(x=-1.5,I=-1.5),p||(x=this.placement===r.PlacementEnum.Above?I-1:I+1),E||(I=this.placement===r.PlacementEnum.Above?x-1:x+1),this.slur.startNoteHasMoreStartingSlurs()&&this.slur.isSlurLonger()&&(this.placement===r.PlacementEnum.Above?x-=d.SlursStartingAtSameStaffEntryYOffset:x+=d.SlursStartingAtSameStaffEntryYOffset),this.slur.endNoteHasMoreEndingSlurs()&&this.slur.isSlurLonger()&&(this.placement===r.PlacementEnum.Above?I-=d.SlursStartingAtSameStaffEntryYOffset:I+=d.SlursStartingAtSameStaffEntryYOffset),this.placement===r.PlacementEnum.Above?(x=Math.min(x,1.5),I=Math.min(I,1.5)):(x=Math.max(x,y.StaffHeight-1.5),I=Math.max(I,y.StaffHeight-1.5)),{startX:M,startY:x,endX:_,endY:I}}calculatePlacement(p,E){if(this.rules.SlurPlacementFromXML&&this.slur.PlacementXml!==r.PlacementEnum.NotYetDefined)return void(this.placement=this.slur.PlacementXml);for(let M=0,x=this.staffEntries.length;M<x;++M)if(this.staffEntries[M].parentMeasure.hasMultipleVoices())return void(this.placement=this.slur.StartNote.ParentVoiceEntry.ParentVoice instanceof o.LinkedVoice||this.slur.EndNote.ParentVoiceEntry.ParentVoice instanceof o.LinkedVoice?r.PlacementEnum.Below:r.PlacementEnum.Above);for(let M=0,x=this.staffEntries.length;M<x;++M)if(this.staffEntries[M].LyricsEntries.length>0)return void(this.placement=r.PlacementEnum.Above);const y=this.staffEntries[0],d=this.staffEntries[this.staffEntries.length-1],S=y.graphicalVoiceEntries[0].parentVoiceEntry.StemDirection;if(S===d.graphicalVoiceEntries[0].parentVoiceEntry.StemDirection)this.placement=S===h.StemDirectionType.Up?r.PlacementEnum.Below:r.PlacementEnum.Above,this.rules.SlurPlacementAtStems&&(this.placement=S===h.StemDirectionType.Up?r.PlacementEnum.Above:r.PlacementEnum.Below);else{let M=y.PositionAndShape.BorderLeft+y.PositionAndShape.RelativePosition.x+y.parentMeasure.PositionAndShape.RelativePosition.x,x=d.PositionAndShape.BorderRight+d.PositionAndShape.RelativePosition.x+d.parentMeasure.PositionAndShape.RelativePosition.x;this.graceStart&&(M+=d.PositionAndShape.RelativePosition.x),this.graceEnd&&(x+=d.staffEntryParent.PositionAndShape.RelativePosition.x);const _=-1*p.getSkyLineMinInRange(M,x),I=p.getBottomLineMaxInRange(M,x)-E.StaffHeight;this.placement=I>_?r.PlacementEnum.Above:r.PlacementEnum.Below}}calculateTopPoints(p,E,y,d){const S=[];let M=d.getRightIndexForPointX(p.x,y.SkyLine.length),x=d.getLeftIndexForPointX(E.x,y.SkyLine.length);M<0&&(M=0),x>=y.SkyLine.length&&(x=y.SkyLine.length-1);for(let _=M;_<x;_++){const I=y.SkyLine[_];
1if(0!==I){const T=new s.PointF2D((.5+_)/d.SamplingUnit,I);S.push(T)}}return S}calculateBottomPoints(p,E,y,d){const S=[];let M=d.getRightIndexForPointX(p.x,y.BottomLine.length),x=d.getLeftIndexForPointX(E.x,y.BottomLine.length);M<0&&(M=0),x>=y.BottomLine.length&&(x=y.BottomLine.length-1);for(let _=M;_<x;_++){const I=y.BottomLine[_];if(0!==I){const T=new s.PointF2D((.5+_)/d.SamplingUnit,I);S.push(T)}}return S}calculateMaxLeftSlope(p,E,y){let d=-Number.MAX_VALUE;const S=E.x,M=E.y;for(let x=0;x<p.length;x++)Math.abs(p[x].y-Number.MAX_VALUE)<1e-4||Math.abs(p[x].y- -Number.MAX_VALUE)<1e-4||(d=Math.max(d,(p[x].y-M)/(p[x].x-S)));return d=Math.max(d,Math.abs(y.y-M)/(y.x-S)),d=Math.min(d,5.6713),d}calculateMaxRightSlope(p,E,y){let d=Number.MAX_VALUE;const S=y.x,M=y.y;for(let x=0;x<p.length;x++)Math.abs(p[x].y-Number.MAX_VALUE)<1e-4||Math.abs(p[x].y- -Number.MAX_VALUE)<1e-4||(d=Math.min(d,(M-p[x].y)/(S-p[x].x)));return d=Math.min(d,(M-E.y)/(S-E.x)),d=Math.max(d,-5.6713),d}getPointListMaxY(p){let E=-Number.MAX_VALUE;for(let y=0,d=p.length;y<d;++y){const S=p[y];Math.abs(S.y- -Number.MAX_VALUE)<1e-4||Math.abs(S.y-Number.MAX_VALUE)<1e-4||(E=Math.max(E,S.y))}return E}calculateTranslatedAndRotatedPointListAbove(p,E,y,d){const S=[];for(let M=0;M<p.length;M++){if(Math.abs(p[M].y-Number.MAX_VALUE)<1e-4||Math.abs(p[M].y- -Number.MAX_VALUE)<1e-4)continue;let x=new s.PointF2D(p[M].x-E,-(p[M].y-y));x=d.vectorMultiplication(x),S.push(x)}return S}calculateTranslatedAndRotatedPointListBelow(p,E,y,d){const S=[];for(let M=0;M<p.length;M++){if(Math.abs(p[M].y-Number.MAX_VALUE)<1e-4||Math.abs(p[M].y- -Number.MAX_VALUE)<1e-4)continue;let x=new s.PointF2D(p[M].x-E,p[M].y-y);x=d.vectorMultiplication(x),S.push(x)}return S}calculateHeightWidthRatio(p,E){return 0===E.length?0:Math.max(0,this.getPointListMaxY(E))/p}calculateControlPoints(p,E,y,d,S,M,x){let _=this.rules.SlurHeightFactor,I=1;E>this.rules.SlurHeightFlattenLongSlursCutoffAngle&&p>this.rules.SlurHeightFlattenLongSlursCutoffWidth&&(I+=p/70*this.rules.SlurHeightFlattenLongSlursFactorByWidth,I*=1+E/30*this.rules.SlurHeightFlattenLongSlursFactorByAngle,_/=I);const v=Math.min(.5,Math.max(.1,1.7*E/80*_*Math.pow(Math.max(S,.05),.4))),B=Math.min(.5,Math.max(.1,1.7*-y/80*_*Math.pow(Math.max(S,.05),.4))),D=new s.PointF2D;D.x=p*v*Math.cos(E*f.degreesToRadiansFactor),D.y=p*v*Math.sin(E*f.degreesToRadiansFactor);const L=new s.PointF2D;L.x=p-p*B*Math.cos(y*f.degreesToRadiansFactor),L.y=-p*B*Math.sin(y*f.degreesToRadiansFactor);let F=D.y-L.y;for(;this.rules.SlurMaximumYControlPointDistance&&Math.abs(F)>this.rules.SlurMaximumYControlPointDistance;)F<0?(D.y+=1,L.y-=1):(D.y-=1,L.y+=1),F=D.y-L.y;return{startControlPoint:D,endControlPoint:L}}calculateAngles(p,E,y,d){let S=Math.atan(E)/f.degreesToRadiansFactor;E>0?S+=20:S-=20;let M=Math.atan(y)/f.degreesToRadiansFactor;return y<0?M-=20:M+=20,{startAngle:Math.min(Math.max(p,S),d),endAngle:Math.max(Math.min(-p,M),-d)}}}g.GraphicalSlur=f,f.degreesToRadiansFactor=Math.PI/180},348(dt,g,u){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.GraphicalStaffEntry=void 0;const l=u(6438),s=u(2561),c=u(7741),r=u(813),i=u(7921);g.GraphicalStaffEntry=class o extends c.GraphicalObject{constructor(h,e=void 0,f=void 0){super(),this.graphicalChordContainers=[],this.tabStaffEntry=void 0,this.MaxAccidentals=0,this.graphicalInstructions=[],this.ties=[],this.graphicalTies=[],this.lyricsEntries=[],this.parentMeasure=h,this.graphicalVoiceEntries=[],this.sourceStaffEntry=e,f?(this.staffEntryParent=f,this.parentVerticalContainer=f.parentVerticalContainer,this.PositionAndShape=new l.BoundingBox(this,f.PositionAndShape)):this.PositionAndShape=new l.BoundingBox(this,h.PositionAndShape),e&&(this.relInMeasureTimestamp=e.Timestamp),this.FingeringEntries=[]}get GraphicalInstructions(){return this.graphicalInstructions}get GraphicalTies(){return this.graphicalTies}get LyricsEntries(){return this.lyricsEntries}set LyricsEntries(h){this.lyricsEntries=h}getAbsoluteTimestamp(){const h=this.parentMeasure.parentSourceMeasure.AbsoluteTimestamp.clone();return this.relInMeasureTimestamp&&h.Add(this.relInMeasureTimestamp),h}findTieGraphicalNoteFromNote(h){for(const e of this.graphicalVoiceEntries)for(const f of e.notes){const m=f.sourceNote;if(!m.isRest()&&m.Pitch.FundamentalNote===h.Pitch.FundamentalNote&&m.Pitch.Octave===h.Pitch.Octave&&m.getAbsoluteTimestamp().Equals(h.getAbsoluteTimestamp()))return f}}findEndTieGraphicalNoteFromNoteWithStartingSlur(h,e){if(h)for(const f of this.graphicalVoiceEntries)if(f.parentVoiceEntry===h.ParentVoiceEntry)for(const m of f.notes){const p=m.sourceNote;if(p.NoteTie&&-1!==p.NoteSlurs.indexOf(e))return m}}
vendor: 55,427 bytes, line 1
1findGraphicalNoteFromGraceNote(h){if(h)for(const e of this.graphicalVoiceEntries)if(e.parentVoiceEntry===h.ParentVoiceEntry)for(const f of e.notes)if(f.sourceNote===h)return f}findGraphicalNoteFromNote(h){if(h)for(const e of this.graphicalVoiceEntries)if(e.parentVoiceEntry===h.ParentVoiceEntry)for(const f of e.notes)if(f.sourceNote===h&&this.getAbsoluteTimestamp().Equals(h.getAbsoluteTimestamp()))return f}getGraphicalNoteDurationFromVoice(h){for(const e of this.graphicalVoiceEntries)if(e.parentVoiceEntry.ParentVoice===h)return e.notes[0].graphicalNoteLength;return new s.Fraction(0,1)}findVoiceEntryGraphicalNotes(h){for(const e of this.graphicalVoiceEntries)if(e.parentVoiceEntry===h)return e.notes}isVoiceEntryPartOfLinkedVoiceEntry(h){if(this.sourceStaffEntry.Link)for(let e=0,f=this.sourceStaffEntry.Link.LinkStaffEntries.length;e<f;++e){const m=this.sourceStaffEntry.Link.LinkStaffEntries[e];if(-1!==m.VoiceEntries.indexOf(h)&&m!==this.sourceStaffEntry)return!0}return!1}findStaffEntryMinNoteLength(){let h=new s.Fraction(Number.MAX_VALUE,1);for(const e of this.graphicalVoiceEntries)for(const f of e.notes){const m=f.graphicalNoteLength;m.lt(h)&&m.GetExpandedNumerator()>0&&(h=m)}return h}findStaffEntryMaxNoteLength(){let h=new s.Fraction(0,1);for(const e of this.graphicalVoiceEntries)for(const f of e.notes){const m=f.graphicalNoteLength;h.lt(m)&&m.GetExpandedNumerator()>0&&(h=m)}return h}findOrCreateGraphicalVoiceEntry(h){for(const f of this.graphicalVoiceEntries)if(f.parentVoiceEntry===h)return f;const e=i.MusicSheetCalculator.symbolFactory.createVoiceEntry(h,this);return this.graphicalVoiceEntries.push(e),e}findOrCreateGraphicalVoiceEntryFromGraphicalNote(h){for(const f of this.graphicalVoiceEntries)if(f===h.parentVoiceEntry)return f;const e=i.MusicSheetCalculator.symbolFactory.createVoiceEntry(h.sourceNote.ParentVoiceEntry,this);return this.graphicalVoiceEntries.push(e),e}addGraphicalNoteToListAtCorrectYPosition(h,e){const f=h.notes;if(0===f.length||e.PositionAndShape.RelativePosition.y<r.CollectionUtil.last(f).PositionAndShape.RelativePosition.y)f.push(e);else for(let m=f.length-1;m>=0;m--){if(f[m].PositionAndShape.RelativePosition.y>e.PositionAndShape.RelativePosition.y){f.splice(m+1,0,e);break}if(0===m){f.splice(0,0,e);break}}}hasOnlyRests(){return this.sourceStaffEntry.hasOnlyRests}getSkylineMin(){const h=this.parentMeasure?.ParentStaffLine.SkyBottomLineCalculator;if(!h)return;const[e,f]=this.getAbsoluteStartAndEnd();return h.getSkyLineMinInRange(e,f)}getHighestYAtEntry(){return this.parentMeasure.ParentStaffLine.PositionAndShape.AbsolutePosition.y+this.getSkylineMin()}getLowestYAtEntry(){return this.parentMeasure.ParentStaffLine.PositionAndShape.AbsolutePosition.y+this.getBottomlineMax()}getBottomlineMax(){const h=this.parentMeasure?.ParentStaffLine.SkyBottomLineCalculator;if(!h)return;const[e,f]=this.getAbsoluteStartAndEnd();return h.getBottomLineMaxInRange(e,f)}getAbsoluteStartAndEnd(){let h=this.PositionAndShape.AbsolutePosition.x;return h-=this.parentMeasure.ParentStaffLine.PositionAndShape.AbsolutePosition.x,[h,h+this.PositionAndShape.Size.width]}}},9760(dt,g){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.GraphicalStaffEntryLink=void 0,g.GraphicalStaffEntryLink=class{constructor(u){this.graphicalLinkedStaffEntries=[],this.staffEntryLink=u,this.initialize()}get GetStaffEntryLink(){return this.staffEntryLink}get GraphicalLinkedStaffEntries(){return this.graphicalLinkedStaffEntries}set GraphicalLinkedStaffEntries(u){this.graphicalLinkedStaffEntries=u}isFilled(){for(let u=0;u<this.graphicalLinkedStaffEntries.length;u++)if(!this.graphicalLinkedStaffEntries[u])return!1;return!0}getLinkedStaffEntriesGraphicalNotes(u){if(-1!==this.graphicalLinkedStaffEntries.indexOf(u)){const l=[];for(let s=0,c=this.graphicalLinkedStaffEntries.length;s<c;++s){const r=this.graphicalLinkedStaffEntries[s];for(const i of r.graphicalVoiceEntries)for(const o of i.notes)o.sourceNote.ParentStaffEntry.Link&&o.sourceNote.ParentVoiceEntry===this.staffEntryLink.GetVoiceEntry&&l.push(o)}return l}}initialize(){for(let u=0,l=this.staffEntryLink.LinkStaffEntries.length;u<l;++u)this.graphicalLinkedStaffEntries.push(void 0)}}},5054(dt,g){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.GraphicalTie=void 0,g.GraphicalTie=class{constructor(u,l=void 0,s=void 0){this.tie=u,this.startNote=l,this.endNote=s}get SVGElement(){return this.vfTie.getAttribute("el")}get GetTie(){return this.tie}get StartNote(){return this.startNote}get Tie(){return this.tie}set StartNote(u){this.startNote=u}get EndNote(){return this.endNote}set EndNote(u){this.endNote=u}}},5824(dt,g,u){"use strict";var l=this&&this.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(g,"__esModule",{value:!0}),g.GraphicalUnknownExpression=void 0;const s=u(9490),c=u(6362),r=l(u(3065));g.GraphicalUnknownExpression=class i extends s.AbstractGraphicalExpression{constructor(n,h,e,f,m=void 0){super(n,new c.AbstractExpression(e),f),this.label=h,this.sourceMultiExpression=m}updateSkyBottomLine(){const n=this.parentStaffLine.SkyBottomLineCalculator,h=this.label.PositionAndShape.RelativePosition.x+this.label.PositionAndShape.BorderMarginLeft,e=this.label.PositionAndShape.RelativePosition.x+this.label.PositionAndShape.BorderMarginRight;switch(this.Placement){case c.PlacementEnum.Above:n.updateSkyLineInRange(h,e,this.label.PositionAndShape.BorderMarginTop+this.label.PositionAndShape.RelativePosition.y);break;case c.PlacementEnum.Below:n.updateBottomLineInRange(h,e,this.label.PositionAndShape.BorderMarginBottom+this.label.PositionAndShape.RelativePosition.y);break;default:r.default.error("Placement for GraphicalUnknownExpression is unknown")}}}},4548(dt,g,u){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.GraphicalVoiceEntry=void 0;const l=u(7741),s=u(6438),c=u(9713);g.GraphicalVoiceEntry=class r extends l.GraphicalObject{constructor(o,n,h){super(),this.parentVoiceEntry=o,this.parentStaffEntry=n,this.PositionAndShape=new s.BoundingBox(this,n?n.PositionAndShape:void 0,!0),this.notes=[],this.rules=h||(n?n.parentMeasure.parentSourceMeasure.Rules:new c.EngravingRules)}sort(){return this.notes.sort((o,n)=>(n.sourceNote.Pitch?.getHalfTone()??0)-(o.sourceNote.Pitch?.getHalfTone()??0)),this.notes}sortForVexflow(){return this.notes.sort((o,n)=>(o.sourceNote.Pitch?.getHalfTone()??0)-(n.sourceNote.Pitch.getHalfTone()??0)),this.notes}applyCustomNoteheads(){}color(){}}},7753(dt,g,u){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.GraphicalWavyLine=void 0;const l=u(6438),s=u(7741);g.GraphicalWavyLine=class c extends s.GraphicalObject{constructor(i,o){super(),this.getWavyLine=i,this.PositionAndShape=new l.BoundingBox(this,o)}}},7225(dt,g){"use strict";Object.defineProperty(g,"__esModule",{value:!0})},7921(dt,g,u){"use strict";var l=this&&this.__importDefault||function(st){return st&&st.__esModule?st:{default:st}};Object.defineProperty(g,"__esModule",{value:!0}),g.MusicSheetCalculator=void 0;const s=u(8724),c=u(2561),r=u(1850),i=u(5748),o=u(164),n=u(437),h=u(1336),e=u(1645),f=u(7066),m=u(9409),p=u(2369),E=u(8254),y=u(7533),d=u(4543),S=u(3123),M=u(4249),x=u(6438),_=u(8033),I=u(8927),T=u(164),A=u(4064),v=l(u(3065)),B=u(3263),D=u(6452),L=u(7435),F=u(3236),V=u(6362),j=u(3361),P=u(9161),U=u(2221),Y=u(5875),H=u(1066),Q=u(624),ot=u(5824),$=u(5534),it=u(9647);class nt{constructor(){this.staffEntriesWithGraphicalTies=[],this.staffEntriesWithOrnaments=[],this.staffEntriesWithChordSymbols=[],this.staffLinesWithLyricWords=[],this.graphicalLyricWords=[],this.abstractNotImplementedErrorMessage="abstract, not implemented",this.dynamicExpressionMap=new Map}static get TextMeasurer(){return nt.textMeasurer}static set TextMeasurer(N){nt.textMeasurer=N}get leadSheet(){return this.graphicalMusicSheet.LeadSheet}static setMeasuresMinStaffEntriesWidth(N,C){for(let O=0,X=N.length;O<X;++O){const W=N[O];W&&(W.minimumStaffEntriesWidth=C)}}initialize(N){this.graphicalMusicSheet=N,this.rules=N.ParentMusicSheet.Rules,this.rules.clearMusicSheetObjects(),this.prepareGraphicalMusicSheet()}prepareGraphicalMusicSheet(){const N=this.graphicalMusicSheet.ParentMusicSheet;this.staffEntriesWithGraphicalTies=[],this.staffEntriesWithOrnaments=[],this.staffEntriesWithChordSymbols=[],this.staffLinesWithLyricWords=[],this.graphicalMusicSheet.Initialize();const C=this.graphicalMusicSheet.MeasureList,O=this.createAccidentalCalculators(),X=this.graphicalMusicSheet.initializeActiveClefs(),W=[],G=N.getCompleteNumberOfStaves(),K=[];for(let Z=0;Z<G;Z++)K.push(void 0);for(let Z=0,et=N.SourceMeasures.length;Z<et;++Z){const ct=N.SourceMeasures[Z],pt=this.createGraphicalMeasuresForSourceMeasure(ct,O,W,K,X);if(C.push(pt),ct.multipleRestMeasures>0&&this.rules.RenderMultipleRestMeasures){ct.isReducedToMultiRest=!0,ct.multipleRestMeasureNumber=1;const gt=ct.multipleRestMeasures-1;Z+=gt;for(let Et=1;Et<=gt;Et++){const St=N.SourceMeasures.indexOf(ct)+Et;if(St>=N.SourceMeasures.length)break;const Mt=N.SourceMeasures[St];Mt.multipleRestMeasureNumber=Et+1,Mt.isReducedToMultiRest=!0,C.push([void 0])}}}if(this.rules.AutoGenerateMultipleRestMeasuresFromRestMeasures&&this.rules.RenderMultipleRestMeasures){let Z,et=0;for(let ct=0,pt=N.SourceMeasures.length;ct<pt;++ct){const gt=N.SourceMeasures[ct];if(!gt.isReducedToMultiRest&>.canBeReducedToMultiRest())if(et>0){Z.isReducedToMultiRest=!0,Z.multipleRestMeasureNumber=1,et++,gt.multipleRestMeasureNumber=et,gt.isReducedToMultiRest=!0;for(let Et=0;Et<C[ct].length;Et++)C[ct][Et]=void 0}else Z=gt,et=1;else if(et>1){Z.multipleRestMeasures=et;const Et=this.createGraphicalMeasuresForSourceMeasure(Z,O,W,K,X);C[Z.measureListIndex]=Et,et=0,Z=void 0}else et=0,Z=void 0}if(et>1){Z.multipleRestMeasures=et,Z.isReducedToMultiRest=!0;const ct=this.createGraphicalMeasuresForSourceMeasure(Z,O,W,K,X);C[Z.measureListIndex]=ct,et=0,Z=void 0}}const q=X.map(Z=>Z.ClefType===o.ClefEnum.percussion);this.handleStaffEntries(q),this.calculateVerticalContainersList(),this.setIndicesToVerticalGraphicalContainers()}calculate(){this.musicSystems=[],this.clearSystemsAndMeasures(),this.clearRecreatedObjects(),this.createGraphicalTies(),this.calculateSheetLabelBoundingBoxes(),this.calculateXLayout(this.graphicalMusicSheet,this.maxInstrNameLabelLength()),this.graphicalMusicSheet.MusicPages.length=0,this.calculateMusicSystems(),s.GraphicalMusicSheet.transformRelativeToAbsolutePosition(this.graphicalMusicSheet)}calculateXLayout(N,C){if(this.graphicalMusicSheet.MeasureList.length>0){let O,X=0,W=1;for(let G=0;G<this.graphicalMusicSheet.MeasureList.length;G++){O=this.graphicalMusicSheet.MeasureList[G];let K=this.calculateMeasureXLayout(O);K=this.calculateMeasureWidthFromStaffEntries(O,K),K>X&&(X=K);const q=this.graphicalMusicSheet.ParentMusicSheet.MeasureWidthFactor;for(const Z of O)if(Z?.parentSourceMeasure.WidthFactor){W=Z.parentSourceMeasure.WidthFactor;break}K*=q*W,nt.setMeasuresMinStaffEntriesWidth(O,K)}if(this.rules.FixedMeasureWidth){let G=X;this.rules.FixedMeasureWidthFixedValue&&(G=this.rules.FixedMeasureWidthFixedValue);for(let K=0;K<this.graphicalMusicSheet.MeasureList.length;K++)O=this.graphicalMusicSheet.MeasureList[K],!this.rules.FixedMeasureWidthUseForPickupMeasures&&O[0]?.parentSourceMeasure.ImplicitMeasure||nt.setMeasuresMinStaffEntriesWidth(O,G)}}}calculateMeasureWidthFromStaffEntries(N,C){throw new Error(this.abstractNotImplementedErrorMessage)}formatMeasures(){throw new Error(this.abstractNotImplementedErrorMessage)}calculateMeasureXLayout(N){throw new Error(this.abstractNotImplementedErrorMessage)}initGraphicalMeasuresCreation(){throw new Error(this.abstractNotImplementedErrorMessage)}handleBeam(N,C,O){throw new Error(this.abstractNotImplementedErrorMessage)}handleTiedGraphicalNote(N,C,O,X,W,G,K,q){throw new Error(this.abstractNotImplementedErrorMessage)}handleVoiceEntryLyrics(N,C,O){throw new Error(this.abstractNotImplementedErrorMessage)}handleVoiceEntryOrnaments(N,C,O){throw new Error(this.abstractNotImplementedErrorMessage)}handleVoiceEntryArticulations(N,C,O){throw new Error(this.abstractNotImplementedErrorMessage)}handleVoiceEntryTechnicalInstructions(N,C,O){throw new Error(this.abstractNotImplementedErrorMessage)}handleTuplet(N,C,O){throw new Error(this.abstractNotImplementedErrorMessage)}layoutVoiceEntry(N,C,O,X){throw new Error(this.abstractNotImplementedErrorMessage)}layoutStaffEntry(N){throw new Error(this.abstractNotImplementedErrorMessage)}createGraphicalTie(N,C,O,X,W){throw new Error(this.abstractNotImplementedErrorMessage)}updateStaffLineBorders(N){throw new Error(this.abstractNotImplementedErrorMessage)}calculateMeasureNumberPlacement(N){const C=N.StaffLines[0];if(!C||!C.Measures[0])return void v.default.warn("calculateMeasureNumberPlacement: measure undefined for system.Id "+N.Id);let O=C.Measures[0].MeasureNumber,X=0;for(let W=0;W<C.Measures.length;W++){const G=C.Measures[W];let K=this.rules.RenderMeasureNumbersOnlyAtSystemStart&&W>1;if(1===W&&C.Measures[0].parentSourceMeasure.ImplicitMeasure&&(K=!1),K)return;0!==G.MeasureNumber&&1!==G.MeasureNumber||(O=G.MeasureNumber),X=G!==C.Measures[0]&&this.rules.MeasureNumberLabelXOffset?this.rules.MeasureNumberLabelXOffset:0;const q=this.rules.UseXMLMeasureNumbers&&1===G.MeasureNumber&&1!==G.parentSourceMeasure.getPrintedMeasureNumber();((G.MeasureNumber===O||G.MeasureNumber>=O+this.rules.MeasureNumberLabelOffset)&&!G.parentSourceMeasure.ImplicitMeasure||q)&&((1!==G.MeasureNumber||1===G.MeasureNumber&&G!==C.Measures[0]||q)&&this.calculateSingleMeasureNumberPlacement(G,C,N,X),O=G.MeasureNumber)}}calculateSingleMeasureNumberPlacement(N,C,O,X=0){const W=N.parentSourceMeasure.getPrintedMeasureNumber().toString(),G=new L.Label(W),K=new E.GraphicalLabel(G,this.rules.MeasureNumberLabelHeight,y.TextAlignmentEnum.LeftBottom,this.rules),q=C.SkyBottomLineCalculator;K.setLabelPositionAndShapeBorders(),K.PositionAndShape.Parent=O.PositionAndShape;const Z=C.PositionAndShape.RelativePosition.x+N.PositionAndShape.RelativePosition.x-K.PositionAndShape.BorderMarginLeft+X;let et,ct=Z,pt=Z-K.PositionAndShape.BorderLeft+K.PositionAndShape.BorderRight;ct-=C.PositionAndShape.RelativePosition.x,pt-=C.PositionAndShape.RelativePosition.x;const St=q.getSkyLineMinInRange(ct+.5,pt-.5);if(N===C.Measures[0]){let Mt=0;if(O.GroupBrackets.length>0)for(const yt of O.GroupBrackets)Mt=Math.min(Mt,yt.PositionAndShape.BorderTop);else N.ParentStaff.ParentInstrument.Parent&&(Mt=-1);et=Math.min(St,Mt)}else et=St;et=Math.min(0,et),K.PositionAndShape.RelativePosition=new m.PointF2D(Z,et),O.MeasureNumberLabels.push(K)}calculateMeasureNumberSkyline(N){const C=N.StaffLines[0];for(const O of N.MeasureNumberLabels){let X=O.PositionAndShape.RelativePosition.x,W=X-O.PositionAndShape.BorderLeft+O.PositionAndShape.BorderRight;X-=C.PositionAndShape.RelativePosition.x,W-=C.PositionAndShape.RelativePosition.x,C.SkyBottomLineCalculator.updateSkyLineInRange(X,W,O.PositionAndShape.RelativePosition.y+O.PositionAndShape.BorderMarginTop)}}layoutGraphicalTie(N,C,O){throw new Error(this.abstractNotImplementedErrorMessage)}calculateSingleStaffLineLyricsPosition(N,C){let O=0,X=this.rules.StaffHeight;const W=new Map,G=[],K=N.SkyBottomLineCalculator;let q=N.Measures.length;for(let et=0;et<q;++et){const ct=N.Measures[et],pt=ct.PositionAndShape.RelativePosition,gt=ct.staffEntries.length;for(let Et=0;Et<gt;++Et){const St=ct.staffEntries[Et],Mt=St.LyricsEntries.length;for(let yt=0;yt<Mt;++yt){const vt=St.LyricsEntries[yt].LyricsEntry;W[vt.VerseNumber]=vt.IsChorus}if(Mt>0){G.push(St),O=Math.max(O,St.LyricsEntries.length);const yt=St.PositionAndShape.RelativePosition.x+pt.x;let vt=Number.MAX_VALUE,_t=Number.MIN_VALUE;for(let Nt=0;Nt<St.LyricsEntries.length;Nt++){const Bt=St.LyricsEntries[Nt].GraphicalLabel;vt=Math.min(vt,yt+Bt.PositionAndShape.BorderMarginLeft),_t=Math.max(_t,yt+Bt.PositionAndShape.BorderMarginRight)}const At=K.getBottomLineMaxInRange(vt,_t);X=Math.max(X,At+this.rules.LyricsYMarginToBottomLine)}}}let Z=0;q=G.length;for(const et of G){const ct=[];let pt=!0;for(let gt=0;gt<et.LyricsEntries.length;gt++)pt&&(pt=et.LyricsEntries[gt].LyricsEntry.IsChorus);for(const gt of C)W[gt]===pt&&ct.push(gt);for(let gt=0;gt<et.LyricsEntries.length;gt++){const Et=et.LyricsEntries[gt],St=Et.GraphicalLabel,yt=ct.indexOf(Et.LyricsEntry.VerseNumber),vt=X+this.rules.LyricsHeight+this.rules.VerticalBetweenLyricsDistance+this.rules.LyricsYOffsetToStaffHeight+(this.rules.VerticalBetweenLyricsDistance+this.rules.LyricsHeight)*yt;St.PositionAndShape.RelativePosition=new m.PointF2D(St.PositionAndShape.RelativePosition.x,vt),St.Label.fontStyle=Et.LyricsEntry.FontStyle,Z=Math.max(Z,vt)}}if(G.length>0){const et=N.PositionAndShape.Size.width;let ct=G[0].PositionAndShape.RelativePosition.x+G[0].PositionAndShape.BorderMarginLeft+G[0].parentMeasure.PositionAndShape.RelativePosition.x;ct=ct>et?et:ct,K.updateBottomLineInRange(ct,et,Z)}return G}calculateLyricsExtendsAndDashes(N){for(let C=0,O=N.length;C<O;++C){const X=N[C];for(let W=0;W<X.LyricsEntries.length;W++){const G=X.LyricsEntries[W];G.ParentLyricWord&&G.ParentLyricWord.GraphicalLyricsEntries[G.ParentLyricWord.GraphicalLyricsEntries.length-1]!==G&&this.calculateSingleLyricWord(G),G.LyricsEntry.extend&&this.calculateLyricExtend(G)}}}calculateSingleOctaveShift(N,C,O,X){throw new Error(this.abstractNotImplementedErrorMessage)}calculateWordRepetitionInstruction(N,C){throw new Error(this.abstractNotImplementedErrorMessage)}calculateMoodAndUnknownExpression(N,C,O){const X=N.AbsoluteTimestamp,W=this.graphicalMusicSheet.MeasureList[C];let G=new m.PointF2D;const K=N.UnknownList[0]?.defaultYXml;if(N.MoodList.length>0||N.UnknownList.length>0){let q="";for(let St=0,Mt=N.EntriesList.length;St<Mt;++St){const yt=N.EntriesList[St];""!==yt.prefix&&(q+=""===q?yt.prefix:" "+yt.prefix),q+=""===q?yt.label:" "+yt.label}const Z=W[O].ParentStaffLine;if(!Z)return void v.default.debug("MusicSheetCalculator.calculateMoodAndUnknownExpression: staffLine undefined. Returning.");G=this.getRelativePositionInStaffLineFromTimestamp(X,O,Z,Z?.isPartOfMultiStaffInstrument()),Math.abs(G.x-0)<1e-4&&(G.x=W[O].beginInstructionsWidth+this.rules.RhythmRightMargin);const et=this.rules.UnknownTextHeight,ct=N.getPlacementOfFirstEntry(),pt=this.calculateLabel(Z,G,q,N.getFontstyleOfFirstEntry(),ct,et),gt=N.getColorXMLOfFirstEntry();if(this.rules.ExpressionsUseXMLColor&>&&(pt.ColorXML=gt),this.rules.PlaceWordsInsideStafflineFromXml&&K<0&&K>-50){let St=K/10;St+=this.rules.PlaceWordsInsideStafflineYOffset,pt.PositionAndShape.RelativePosition.y=St}const Et=new ot.GraphicalUnknownExpression(Z,pt,ct,W[O]?.parentSourceMeasure,N);Z.AbstractExpressions.push(Et)}}clearRecreatedObjects(){for(let N=0,C=this.staffEntriesWithGraphicalTies.length;N<C;++N)this.staffEntriesWithGraphicalTies[N].GraphicalTies.length=0;this.staffEntriesWithGraphicalTies.length=0}handleStaffEntryLink(N,C){v.default.debug("handleStaffEntryLink not implemented")}calculateMusicSystems(){if(!this.graphicalMusicSheet.MeasureList)return;const N=this.graphicalMusicSheet.MeasureList;if(!N)return;this.rules.MinMeasureToDrawIndex>N.length-1&&(v.default.debug("minimum measure to draw index out of range. resetting min measure index to limit."),this.rules.MinMeasureToDrawIndex=N.length-1);const C=[];for(let W=this.rules.MinMeasureToDrawIndex,G=N.length;W<G&&W<=this.rules.MaxMeasureToDrawIndex;++W){const K=[];for(let q=0,Z=N[W].length;q<Z;++q){const et=N[W][q];if(et?.isVisible()&&(K.push(et),this.rules.ColoringEnabled))for(const ct of et.staffEntries)for(const pt of ct.graphicalVoiceEntries)pt.applyCustomNoteheads(),pt.color()}C.push(K)}let O=0;for(let W=0,G=C.length;W<G;++W){O=Math.max(C[W].length,O);break}if(0===O)return;const X=new f.MusicSystemBuilder;if(X.initialize(this.graphicalMusicSheet,C,O),this.musicSystems=X.buildMusicSystems(),this.formatMeasures(),this.leadSheet||(this.optimizeRestPlacement(),this.calculateStaffEntryArticulationMarks(),this.rules.RenderSlurs&&this.calculateTieCurves()),this.calculateSkyBottomLines(),this.calculateTupletNumbers(),this.rules.RenderMeasureNumbers)for(let W=0,G=this.musicSystems.length;W<G;++W)this.calculateMeasureNumberPlacement(this.musicSystems[W]);if(this.rules.RenderFingerings&&this.calculateFingerings(),!this.leadSheet&&this.rules.RenderSlurs&&this.calculateSlurs(),this.calculateGlissandi(),this.rules.RenderMeasureNumbers)for(let W=0,G=this.musicSystems.length;W<G;++W)this.calculateMeasureNumberSkyline(this.musicSystems[W]);this.leadSheet||this.calculateOrnaments(),this.calculateChordSymbols(),this.leadSheet||(this.calculateDynamicExpressions(),this.calculateMoodAndUnknownExpressions(),this.calculateExpressionAlignements(),this.calculateOctaveShifts(),this.rules.RenderPedals&&this.calculatePedals(),this.rules.RenderWavyLines&&this.calculateWavyLines(),this.calculateWordRepetitionInstructions()),this.calculateRepetitionEndings(),this.leadSheet||this.calculateTempoExpressions(),this.calculateRehearsalMarks(),this.calculateLyricsPosition();for(let W=0,G=this.musicSystems.length;W<G;++W){const K=this.musicSystems[W];for(let q=0,Z=K.StaffLines.length;q<Z;++q)this.updateStaffLineBorders(K.StaffLines[q])}X.calculateSystemYLayout(),this.calculateComments(),this.calculateMarkedAreas();for(let W=0,G=this.graphicalMusicSheet.MusicPages.length;W<G;++W){const K=this.graphicalMusicSheet.MusicPages[W];for(let Z=0,et=K.MusicSystems.length;Z<et;++Z){const ct=0===W&&0===Z,pt=K.MusicSystems[Z];pt.setMusicSystemLabelsYPosition(),this.leadSheet?pt===pt.Parent.MusicSystems[0]&&pt.createSystemLeftLine(this.rules.SystemThinLineWidth,this.rules.SystemLabelsRightMargin,ct):(pt.setYPositionsToVerticalLineObjectsAndCreateLines(this.rules),pt.createSystemLeftLine(this.rules.SystemThinLineWidth,this.rules.SystemLabelsRightMargin,ct),pt.createInstrumentBrackets(this.graphicalMusicSheet.ParentMusicSheet.Instruments,this.rules.StaffHeight),pt.createGroupBrackets(this.graphicalMusicSheet.ParentMusicSheet.InstrumentalGroups,this.rules.StaffHeight,0),pt.alignBeginInstructions()),pt.calculateBorders(this.rules)}const q=K.MusicSystems[0].PositionAndShape.BorderTop;for(let Z=0,et=K.MusicSystems.length;Z<et;++Z){const ct=K.MusicSystems[Z];ct.PositionAndShape.RelativePosition=new m.PointF2D(ct.PositionAndShape.RelativePosition.x,ct.PositionAndShape.RelativePosition.y-q)}K.PositionAndShape.calculateTopBottomBorders(),K===this.graphicalMusicSheet.MusicPages[0]&&this.calculatePageLabels(K),K.PositionAndShape.calculateTopBottomBorders()}}calculateMarkedAreas(){}calculateComments(){}calculateChordSymbols(){for(const N of this.musicSystems)for(const C of N.StaffLines){const O=C.SkyBottomLineCalculator;let X=Number.MAX_SAFE_INTEGER,W=Number.MIN_SAFE_INTEGER;if(this.rules.ChordSymbolYAlignment&&"staffline"===this.rules.ChordSymbolYAlignmentScope){const G=[];for(const Z of C.Measures)G.push(...Z.staffEntries);const{minOffset:K,maxOffset:q}=this.calculateAlignedChordSymbolsOffset(G,O);X=K,W=q}for(let G=0;G<C.Measures.length;G++){const K=C.Measures[G];if(this.rules.ChordSymbolYAlignment&&"measure"===this.rules.ChordSymbolYAlignmentScope){const{minOffset:Z,maxOffset:et}=this.calculateAlignedChordSymbolsOffset(K.staffEntries,O);X=Z,W=et}let q;for(const Z of K.staffEntries)if(Z.graphicalChordContainers&&0!==Z.graphicalChordContainers.length)for(let et=0;et<Z.graphicalChordContainers.length;et++){const ct=Z.graphicalChordContainers[et];if(0===Z.graphicalVoiceEntries.length&&Z.relInMeasureTimestamp.RealValue>0){let _t=0;0===K.staffEntries[0].relInMeasureTimestamp.RealValue&&(_t=K.staffEntries[0].PositionAndShape.RelativePosition.x,1===K.MeasureNumber&&(_t+=this.rules.ChordSymbolWholeMeasureRestXOffsetMeasure1));let At=_t+Z.relInMeasureTimestamp.RealValue/K.parentSourceMeasure.Duration.RealValue*(K.PositionAndShape.Size.width-K.endInstructionsWidth-_t)+ct.PositionAndShape.BorderMarginLeft;q&&(At=Math.max(At,q.PositionAndShape.RelativePosition.x+q.GraphicalLabel.PositionAndShape.Size.width+this.rules.ChordSymbolXSpacing)),ct.PositionAndShape.RelativePosition.x=At,ct.PositionAndShape.Parent=K.staffEntries[0].PositionAndShape.Parent}const pt=ct.PositionAndShape,gt=pt.Parent;if(gt.DataObject instanceof i.GraphicalMeasure&&0===Z.relInMeasureTimestamp.RealValue&&(pt.RelativePosition.x=Math.max(K.beginInstructionsWidth,pt.RelativePosition.x),1===K.MeasureNumber&&pt.RelativePosition.x>3&&(pt.RelativePosition.x+=this.rules.ChordSymbolWholeMeasureRestXOffsetMeasure1)),0===Z.PositionAndShape.RelativePosition.x){const _t=N.GraphicalMeasures[G];for(const At of _t){let Nt=!1;for(const Bt of At.staffEntries)if(Bt.relInMeasureTimestamp===Z.relInMeasureTimestamp&&0!==Bt.PositionAndShape.RelativePosition.x){pt.RelativePosition.x=Bt.PositionAndShape.RelativePosition.x,Nt=!0;break}if(Nt)break}}const Et=pt.BorderMarginLeft+gt.AbsolutePosition.x+pt.RelativePosition.x,St=pt.BorderMarginRight+gt.AbsolutePosition.x+pt.RelativePosition.x,Mt=ct.GetChordSymbolContainer.Placement;Mt===V.PlacementEnum.Below?(!this.rules.ChordSymbolYAlignment||W<0)&&(W=O.getBottomLineMaxInRange(Et,St)):Mt===V.PlacementEnum.Above&&(!this.rules.ChordSymbolYAlignment||X>0)&&(X=O.getSkyLineMinInRange(Et,St));let yt=0;0===et?(yt+=this.rules.ChordSymbolYOffset,yt+=.1):yt+=this.rules.ChordSymbolYPadding,Mt!==V.PlacementEnum.Below&&(yt*=-1);const vt=ct.GraphicalLabel;Mt===V.PlacementEnum.Below?(vt.PositionAndShape.RelativePosition.y=W+yt,vt.setLabelPositionAndShapeBorders(),vt.PositionAndShape.calculateBoundingBox(),O.updateBottomLineInRange(Et,St,W+vt.PositionAndShape.BorderMarginBottom+this.rules.ChordSymbolBottomMargin)):(vt.PositionAndShape.RelativePosition.y=X+yt,vt.setLabelPositionAndShapeBorders(),vt.PositionAndShape.calculateBoundingBox(),O.updateSkyLineInRange(Et,St,X+vt.PositionAndShape.BorderMarginTop)),q=ct}}}}calculateAlignedChordSymbolsOffset(N,C){let O=Number.MAX_SAFE_INTEGER,X=Number.MIN_SAFE_INTEGER;for(const W of N)for(const G of W.graphicalChordContainers){const K=G.PositionAndShape,q=K.Parent;let Z=K.BorderMarginLeft+q.AbsolutePosition.x,et=K.BorderMarginRight+q.AbsolutePosition.x;q.DataObject instanceof i.GraphicalMeasure&&(Z+=q.DataObject.beginInstructionsWidth,et+=q.DataObject.beginInstructionsWidth);const ct=G.GetChordSymbolContainer.Placement;ct===V.PlacementEnum.Above?O=Math.min(O,C.getSkyLineMinInRange(Z,et)):ct===V.PlacementEnum.Below&&(X=Math.max(X,C.getBottomLineMaxInRange(Z,et)))}return{minOffset:O,maxOffset:X}}layoutMeasureWithWholeRest(N,C,O){}layoutBeams(N){}layoutArticulationMarks(N,C,O){}layoutOrnament(N,C,O){}calculateRestNotePlacementWithinGraphicalBeam(N,C,O,X,W){}calculateTupletNumbers(){if(!this.rules.TupletNumberLimitConsecutiveRepetitions)return;let N,C,O,X=-1,W=0;const G={};for(const K of this.graphicalMusicSheet.ParentMusicSheet.Instruments)for(const q of K.Voices){W=0,G[q.VoiceId]={};for(const Z of q.VoiceEntries)if(Z.Notes.length>0){const et=Z.Notes[0];if(!et.NoteTuplet||et.NoteTuplet.shouldBeBracketed(this.rules.TupletsBracketedUseXMLValue,this.rules.TupletsBracketed,this.rules.TripletsBracketed)){X=-1,W=0,C=void 0,N=void 0;continue}if(et.NoteTuplet===O)continue;let ct=et.TypeLength;if(ct||(v.default.warn("note missing TypeLength"),ct=et.NoteTuplet.Fractions[0]),et.NoteTuplet!==C&&G[q.VoiceId][et.NoteTuplet.TupletLabelNumber]&&G[q.VoiceId][et.NoteTuplet.TupletLabelNumber][ct.RealValue]){et.NoteTuplet.RenderTupletNumber=!1,O=et.NoteTuplet;continue}et.NoteTuplet.TupletLabelNumber===X&&ct.Equals(N)&&!et.NoteTuplet.Bracket||(X=et.NoteTuplet.TupletLabelNumber,N=ct,W=0),C=et.NoteTuplet,W++,W<=this.rules.TupletNumberMaxConsecutiveRepetitions&&(et.NoteTuplet.RenderTupletNumber=!0),W>this.rules.TupletNumberMaxConsecutiveRepetitions&&(et.NoteTuplet.RenderTupletNumber=!1,this.rules.TupletNumberAlwaysDisableAfterFirstMax&&(G[q.VoiceId][X]||(G[q.VoiceId][X]={}),G[q.VoiceId][X][ct.RealValue]=!0)),O=C}}}calculateSlurs(){}calculateGlissandi(){}calculateDynamicExpressionsForMultiExpression(N,C,O){}calculateGraphicalVerbalContinuousDynamic(N,C){const O=N.Label,X=C.x+O.PositionAndShape.BorderMarginLeft,W=C.x+O.PositionAndShape.BorderMarginRight,K=N.ParentStaffLine.SkyBottomLineCalculator;let q;N.ContinuousDynamic.Placement===V.PlacementEnum.Below?(q=K.getBottomLineMaxInRange(X,W),O.PositionAndShape.RelativePosition=new m.PointF2D(C.x,q-O.PositionAndShape.BorderMarginTop)):(q=K.getSkyLineMinInRange(X,W),O.PositionAndShape.RelativePosition=new m.PointF2D(C.x,q-O.PositionAndShape.BorderMarginBottom))}calculateGraphicalContinuousDynamic(N,C){const O=N.IsSoftAccent,X=N.ParentStaffLine.ParentStaff.idInMusicSheet,W=this.graphicalMusicSheet.getGraphicalMeasureFromSourceMeasureAndIndex(N.ContinuousDynamic.EndMultiExpression.SourceMeasureParent,X);if(!W)return void v.default.warn("MusicSheetCalculator.calculateGraphicalContinuousDynamic: No endMeasure found");N.EndMeasure=W;const G=N.ParentStaffLine,K=W.ParentStaffLine,q=K&&G===K;let Z=!1;K?Z=K?.isPartOfMultiStaffInstrument():G&&(Z=G?.isPartOfMultiStaffInstrument());const et=c.Fraction.createFromFraction(N.ContinuousDynamic.EndMultiExpression.AbsoluteTimestamp),ct=this.graphicalMusicSheet.GetVerticalContainerFromTimestamp(et),pt=ct.getFirstNonNullStaffEntry().parentMeasure,gt=pt.PositionAndShape.AbsolutePosition.x+pt.PositionAndShape.BorderRight;let Et=new c.Fraction(0,0,0);for(const Ut of ct.StaffEntries){if(Ut?.sourceStaffEntry.ParentStaff!==G.ParentStaff)continue;const Yt=Ut?.sourceStaffEntry?.calculateMaxNoteLength(!1);Yt?.gt(Et)&&(Et=Yt)}const Mt=this.getRelativePositionInStaffLineFromTimestamp(et,X,K,Z,0,!O&&N.ContinuousDynamic.DynamicType===Y.ContDynamicEnum.diminuendo),yt=c.Fraction.plus(et,Et).clone();N.ContinuousDynamic.EndMultiExpression.EndOffsetFraction&&this.rules.UseEndOffsetForExpressions&&yt.Add(N.ContinuousDynamic.EndMultiExpression.EndOffsetFraction);const vt=this.getRelativePositionInStaffLineFromTimestamp(yt,X,K,Z,0,N.ContinuousDynamic.DynamicType===Y.ContDynamicEnum.diminuendo),_t=this.rules.SoftAccentWedgePadding,At=ct.getFirstNonNullStaffEntry().PositionAndShape.Size.width,Nt=this.rules.SoftAccentSizeFactor;O?(C.x-=At/2*Nt+_t,Mt.x=C.x+At/2*Nt):vt.x>Mt.x&&vt.x<gt?Mt.x+=(vt.x-Mt.x)/this.rules.WedgeEndDistanceBetweenTimestampsFactor:Mt.x=gt-this.rules.WedgeHorizontalMargin;const Bt=this.dynamicExpressionMap.get(N.ContinuousDynamic.StartMultiExpression.AbsoluteTimestamp.RealValue);Bt&&Bt.DataObject.ParentStaffLine===G&&(C.x=Bt.RelativePosition.x+this.rules.WedgeHorizontalMargin,C.x+=Bt.BorderMarginRight);const Ft=G.ParentMusicSystem,Ot=Ft.StaffLines.indexOf(G),It=G.SkyBottomLineCalculator,Rt=N.ContinuousDynamic.Placement;let Dt;q&&Mt.x-C.x<this.rules.WedgeMinLength&&!O&&(Mt.x=C.x+this.rules.WedgeMinLength);const ie=C.x;let se=K.Measures[0].beginInstructionsWidth-this.rules.WedgeHorizontalMargin-2,Xt=0,oe=0;const Qt=[];if(q)Xt=Mt.x;else{Xt=G.PositionAndShape.Size.width,oe=Mt.x;const Ut=[G,K],Yt=N.StartMeasure;let qt=Yt,Ht=0,Jt=Yt.parentSourceMeasure.measureListIndex;for(;qt!==W&&Ht<1e3;){const me=this.graphicalMusicSheet.getGraphicalMeasureFromSourceMeasureAndIndex(this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures[Jt],X);if(me){qt=me;const he=qt.ParentStaffLine;if(!Ut.includes(he)){Ut.push(he);const Se=new H.GraphicalContinuousDynamicExpression(N.ContinuousDynamic,he,he.Measures[0].parentSourceMeasure);Se.IsSplittedPart=!0,Qt.push(Se)}}Jt++,Ht++}Dt=new H.GraphicalContinuousDynamicExpression(N.ContinuousDynamic,K,W.parentSourceMeasure),Dt.IsSplittedPart=!0,N.IsSplittedPart=!0}O&&(se=Mt.x+_t,oe=se+At/2*Nt);let Wt=0,jt=0;if(Rt===V.PlacementEnum.Below){let Ut=0;Ot<Ft.StaffLines.length-1&&(Ut=Ot+1),Wt=Ut>Ot?this.rules.StaffHeight+(Ft.StaffLines[Ut].PositionAndShape.RelativePosition.y-G.PositionAndShape.RelativePosition.y-this.rules.StaffHeight)/2:this.rules.WedgePlacementBelowY,Wt-=this.rules.WedgeOpeningLength/2,q||(jt=Wt);let Yt=It.getBottomLineMaxInRange(ie,Xt);Yt>Wt&&(Wt=Yt);const qt=!1;if(Ot<Ft.StaffLines.length-1){const Ht=G.findClosestStaffEntry(Xt);if(G.findClosestStaffEntry(ie)&&Ht&&qt){const re=Ft.StaffLines[Ut],me=re.SkyBottomLineCalculator.getSkyLineMinInRange(ie,Xt),he=re.PositionAndShape.RelativePosition.y-G.PositionAndShape.RelativePosition.y+me;Wt=he-this.rules.WedgeOpeningLength>this.rules.StaffHeight?he-this.rules.WedgeVerticalMargin:this.rules.StaffHeight+this.rules.WedgeOpeningLength,N.NotToBeRemoved=!0}}q||(Yt=K.SkyBottomLineCalculator.getBottomLineMaxInRange(se,oe),Yt>jt&&(jt=Yt),jt+=this.rules.WedgeOpeningLength/2,jt+=this.rules.WedgeVerticalMargin),qt||(Wt+=this.rules.WedgeOpeningLength/2,Wt+=this.rules.WedgeVerticalMargin)}else if(Rt===V.PlacementEnum.Above){if(1===G.ParentStaff.ParentInstrument.Staves.length)Wt=this.rules.WedgePlacementAboveY;else{let qt=0;Ot>0&&(qt=Ot-1),Wt=-(G.PositionAndShape.RelativePosition.y-Ft.StaffLines[qt].PositionAndShape.RelativePosition.y-this.rules.StaffHeight)/2}Wt+=this.rules.WedgeOpeningLength/2,q||(jt=Wt);let Ut=It.getSkyLineMinInRange(ie,Xt);Ut<Wt&&(Wt=Ut);const Yt=!1;if(G.ParentStaff.ParentInstrument.Staves.length>1&&Ot>0){const qt=G.findClosestStaffEntry(ie),Ht=G.findClosestStaffEntry(Xt);if(qt&&Ht&&Yt){const re=Ft.StaffLines[Ot-1];if(re){const me=re.SkyBottomLineCalculator.getBottomLineMaxInRange(ie,Xt);Wt=(G.PositionAndShape.RelativePosition.y-re.PositionAndShape.RelativePosition.y-me-this.rules.StaffHeight)/2+this.rules.StaffHeight}}}q||(Ut=K.SkyBottomLineCalculator.getSkyLineMinInRange(se,oe),Ut<jt&&(jt=Ut),jt-=this.rules.WedgeOpeningLength/2),Yt||(Wt-=this.rules.WedgeOpeningLength/2,Wt-=this.rules.WedgeVerticalMargin),q||(jt-=this.rules.WedgeVerticalMargin)}if(N.Lines.clear(),O)N.createFirstHalfCrescendoLines(ie,Xt,Wt),N.createSecondHalfDiminuendoLines(se,oe,Wt),N.calcPsi();else if(q&&!O)N.createLines(ie,Xt,Wt),N.calcPsi();else{N.createFirstHalfLines(ie,Xt,Wt),N.calcPsi();for(let Ut=0;Ut<Qt.length;Ut++){const Yt=Qt[Ut],qt=Yt.ParentStaffLine;let Ht=jt;if(Rt===V.PlacementEnum.Below){const Jt=K.SkyBottomLineCalculator.getBottomLineMaxInRange(se,Xt);Jt>Ht&&(Ht=Jt),Ht+=this.rules.WedgeOpeningLength/2,Ht+=this.rules.WedgeVerticalMargin}else if(Rt===V.PlacementEnum.Above){const Jt=qt.SkyBottomLineCalculator.getSkyLineMinInRange(se,oe);Jt<jt&&(Ht=Jt),Ht-=this.rules.WedgeOpeningLength/2}N.ContinuousDynamic.DynamicType===Y.ContDynamicEnum.crescendo?Yt.createSecondHalfCrescendoLines(0,qt.PositionAndShape.Size.width,Ht):Yt.createFirstHalfDiminuendoLines(0,qt.PositionAndShape.Size.width,Ht),Yt.calcPsi()}Dt.createSecondHalfLines(se,oe,jt),Dt.calcPsi()}this.dynamicExpressionMap.set(et.RealValue,N.PositionAndShape)}calculateGraphicalInstantaneousDynamicExpression(N,C,O){const X=N.ParentStaffLine;if(!X)return;const W=C.x+N.PositionAndShape.BorderMarginLeft,G=C.x+N.PositionAndShape.BorderMarginRight,K=X.SkyBottomLineCalculator;let q=0;if(N.Placement===V.PlacementEnum.Above){const Z=K.getSkyLineMinInRange(W,G);if(X.isPartOfMultiStaffInstrument()&&X.ParentStaff!==X.ParentStaff.ParentInstrument.Staves[0]){const et=X.ParentMusicSystem.StaffLines[X.ParentMusicSystem.StaffLines.indexOf(X)-1];if(et){const ct=X?.PositionAndShape.RelativePosition.y-et.PositionAndShape.RelativePosition.y-this.rules.StaffHeight;q=Z>-ct/2?-ct/2:Z-N.PositionAndShape.BorderMarginBottom}}else q=Z-N.PositionAndShape.BorderMarginBottom;N.PositionAndShape.RelativePosition=new m.PointF2D(C.x,q)}else if(N.Placement===V.PlacementEnum.Below){const Z=K.getBottomLineMaxInRange(W,G),et=X.ParentStaff.ParentInstrument.Staves[X.ParentStaff.ParentInstrument.Staves.length-1];if(X.isPartOfMultiStaffInstrument()&&X.ParentStaff!==et){const ct=X.ParentMusicSystem.StaffLines[X.ParentMusicSystem.StaffLines.indexOf(X)+1];if(ct){const pt=ct.PositionAndShape.RelativePosition.y-X.PositionAndShape.RelativePosition.y-this.rules.StaffHeight;q=Z+N.PositionAndShape.BorderMarginBottom<this.rules.StaffHeight+pt/2?this.rules.StaffHeight+pt/2:Z-N.PositionAndShape.BorderMarginTop}}else q=Z-N.PositionAndShape.BorderMarginTop;N.PositionAndShape.RelativePosition=new m.PointF2D(C.x,q)}N.updateSkyBottomLine()}calcGraphicalRepetitionEndingsRecursively(N){}layoutSingleRepetitionEnding(N,C,O,X,W,G){}calculateLabel(N,C,O,X,W,G,K=y.TextAlignmentEnum.CenterBottom,q=0){const Z=new L.Label(O,K);Z.fontStyle=X,Z.fontHeight=G;const et=new E.GraphicalLabel(Z,G,Z.textAlignment,this.rules,N.PositionAndShape);W===V.PlacementEnum.Below&&(et.Label.textAlignment=y.TextAlignmentEnum.LeftTop),et.setLabelPositionAndShapeBorders(),et.PositionAndShape.BorderMarginBottom*=1.1,et.PositionAndShape.BorderMarginTop*=1.1,et.PositionAndShape.BorderMarginLeft*=1.1,et.PositionAndShape.BorderMarginRight*=1.1;let pt,gt=C.x+et.PositionAndShape.BorderMarginLeft,Et=C.x+et.PositionAndShape.BorderMarginRight;if(Et>N.PositionAndShape.Size.width&&(Et=N.PositionAndShape.Size.width-this.rules.MeasureRightMargin,gt=Et-et.PositionAndShape.MarginSize.width,C.x=gt-et.PositionAndShape.BorderMarginLeft),gt<N.PositionAndShape.BorderMarginLeft){const Mt=N.PositionAndShape.BorderMarginLeft-gt+this.rules.LabelXOffsetForStafflineLeftOverflowCheck;gt+=Mt,Et+=Mt,C.x+=Mt}const St=N.SkyBottomLineCalculator;return pt=W===V.PlacementEnum.Below?St.getBottomLineMaxInRange(gt,Et)+q:St.getSkyLineMinInRange(gt,Et)-q,et.PositionAndShape.RelativePosition=new m.PointF2D(C.x,pt),W===V.PlacementEnum.Below?St.updateBottomLineInRange(gt,Et,et.PositionAndShape.BorderMarginBottom+pt):St.updateSkyLineInRange(gt,Et,et.PositionAndShape.BorderMarginTop+pt),et}calculateTempoExpressionsForMultiTempoExpression(N,C,O){const X=c.Fraction.plus(N.AbsoluteTimestamp,C.Timestamp),W=this.graphicalMusicSheet.MeasureList[O];let G=new m.PointF2D;if(C.ContinuousTempo||C.InstantaneousTempo){if(this.rules.MinMeasureToDrawIndex>0||!W[0])return;let K=W[0].ParentStaffLine,q=W[0].PositionAndShape.RelativePosition.x,Z=0;for(let et=0;et<W.length;et++)if(W[et].ParentStaffLine&&0!==W[et].ParentStaffLine.Measures.length&&W[et].ParentStaffLine.Measures.length>0){K=W[et].ParentStaffLine,q=W[et].PositionAndShape.RelativePosition.x,Z=et;break}if(G=this.getRelativePositionInStaffLineFromTimestamp(X,Z,K,K.isPartOfMultiStaffInstrument(),q),C.EntriesList.length>0&&C.EntriesList[0].Expression instanceof P.InstantaneousTempoExpression&&(C.EntriesList[0].Expression.Placement=V.PlacementEnum.Above,K.Measures[0].staffEntries.length>0&&0===Math.abs(G.x-K.Measures[0].staffEntries[0].PositionAndShape.RelativePosition.x)&&K.ParentMusicSystem===this.musicSystems[0])){const et=K.Measures[0].FirstInstructionStaffEntry;if(et){const ct=et.GraphicalInstructions.last();G.x=ct.PositionAndShape.RelativePosition.x}this.rules.CompactMode&&(G.x=K.PositionAndShape.RelativePosition.x+K.Measures[0].PositionAndShape.RelativePosition.x)}for(const et of C.EntriesList){let ct=this.rules.TempoExpressionTextAlignment;this.rules.CompactMode&&(ct=y.TextAlignmentEnum.LeftBottom);const pt=this.calculateLabel(K,G,et.label,C.getFontstyleOfFirstEntry(),et.Expression.Placement,this.rules.UnknownTextHeight,ct,this.rules.TempoYSpacing);if(et.Expression.ColorXML&&this.rules.ExpressionsUseXMLColor&&(pt.ColorXML=et.Expression.ColorXML),et.Expression instanceof P.InstantaneousTempoExpression){for(const gt of K.AbstractExpressions);if(new j.GraphicalInstantaneousTempoExpression(et.Expression,pt).ParentStaffLine||v.default.warn("Adding staffline didn't work"),this.rules.MetronomeMarksDrawn&&et.Expression.TempoType===P.TempoType.metronomeMark){this.createMetronomeMark(et.Expression);continue}}else if(et.Expression instanceof U.ContinuousTempoExpression){for(const gt of K.AbstractExpressions);K.AbstractExpressions.push(new j.GraphicalInstantaneousTempoExpression(et.Expression,pt))}}}}createMetronomeMark(N){throw new Error(this.abstractNotImplementedErrorMessage)}graphicalMeasureCreatedCalculations(N){}clearSystemsAndMeasures(){for(let N=0,C=this.graphicalMusicSheet.MusicPages.length;N<C;++N){const O=this.graphicalMusicSheet.MusicPages[N];for(let X=0,W=O.MusicSystems.length;X<W;++X){const G=O.MusicSystems[X];for(let K=0,q=G.StaffLines.length;K<q;++K){const Z=G.StaffLines[K];Z.ParentStaff.Visible||Z.Measures.clear();for(let et=0,ct=Z.Measures.length;et<ct;++et){const pt=Z.Measures[et];if(pt.FirstInstructionStaffEntry){const gt=pt.PositionAndShape.ChildElements.indexOf(pt.FirstInstructionStaffEntry.PositionAndShape);gt>-1&&pt.PositionAndShape.ChildElements.splice(gt,1),pt.FirstInstructionStaffEntry=void 0,pt.beginInstructionsWidth=0}if(pt.LastInstructionStaffEntry){const gt=pt.PositionAndShape.ChildElements.indexOf(pt.LastInstructionStaffEntry.PositionAndShape);gt>-1&&pt.PositionAndShape.ChildElements.splice(gt,1),pt.LastInstructionStaffEntry=void 0,pt.endInstructionsWidth=0}}Z.Measures=[],Z.PositionAndShape.ChildElements=[]}G.StaffLines.length=0,G.PositionAndShape.ChildElements=[]}O.MusicSystems=[],O.PositionAndShape.ChildElements=[]}this.graphicalMusicSheet.MusicPages=[]}handleVoiceEntry(N,C,O,X,W,G,K,q,Z,et=void 0,ct=void 0){N.StemDirectionXml!==h.StemDirectionType.Undefined&&this.rules.SetWantedStemDirectionByXml&&void 0!==N.StemDirectionXml?N.WantedStemDirection=N.StemDirectionXml:this.calculateStemDirectionFromVoices(N);const pt=C.findOrCreateGraphicalVoiceEntry(N);pt.octaveShiftValue=q;const gt=C.tabStaffEntry;let Et;gt&&(Et=gt.findOrCreateGraphicalVoiceEntry(N));for(let St=0,Mt=N.Notes.length;St<Mt;++St){const yt=N.Notes[St];if(!yt||void 0!==ct&&void 0!==ct.Link&&void 0!==et&&et.indexOf(yt)>-1)continue;let vt;if(N.IsGrace?vt=nt.symbolFactory.createGraceNote(yt,pt,W,this.rules,q):(vt=nt.symbolFactory.createNote(yt,pt,W,q,this.rules,void 0),nt.stafflineNoteCalculator.trackNote(vt)),yt.Pitch&&this.checkNoteForAccidental(vt,O,W,q),this.resetYPositionForLeadSheet(vt.PositionAndShape),C.addGraphicalNoteToListAtCorrectYPosition(pt,vt),vt.PositionAndShape.calculateBoundingBox(),this.leadSheet||(void 0!==yt.NoteBeam&&yt.PrintObject&&(yt instanceof it.TabNote&&!this.rules.TabBeamsRendered||this.handleBeam(vt,yt.NoteBeam,K)),void 0!==yt.NoteTuplet&&yt.PrintObject&&this.handleTuplet(vt,yt.NoteTuplet,G)),Et){const _t=nt.symbolFactory.createNote(yt,Et,W,q,this.rules,void 0);gt.addGraphicalNoteToListAtCorrectYPosition(Et,_t),_t.PositionAndShape.calculateBoundingBox(),this.leadSheet||yt.NoteTuplet&&this.handleTuplet(_t,yt.NoteTuplet,G)}}return N.Articulations.length>0&&this.handleVoiceEntryArticulations(N.Articulations,N,C),N.TechnicalInstructions.length>0&&this.handleVoiceEntryTechnicalInstructions(N.TechnicalInstructions,N,C),N.LyricsEntries.size()>0&&this.handleVoiceEntryLyrics(N,C,X),N.OrnamentContainer&&this.handleVoiceEntryOrnaments(N.OrnamentContainer,N,C),q}resetYPositionForLeadSheet(N){this.leadSheet&&(N.RelativePosition=new m.PointF2D(N.RelativePosition.x,0))}layoutVoiceEntries(N,C){if(N.PositionAndShape.RelativePosition=new m.PointF2D(0,0),!this.leadSheet)for(const O of N.graphicalVoiceEntries){const X=O.notes;0!==X.length&&this.layoutVoiceEntry(X[0].sourceNote.ParentVoiceEntry,X,N,void 0!==X[0].sourceNote.Pitch)}}maxInstrNameLabelLength(){let N=0;for(const C of this.graphicalMusicSheet.ParentMusicSheet.Instruments)if(C.NameLabel?.print&&C.Voices.length>0&&C.Voices[0].Visible){let O=C.NameLabel;this.rules.RenderPartNames||(O=new L.Label("",O.textAlignment,O.font));const X=new E.GraphicalLabel(O,this.rules.InstrumentLabelTextHeight,y.TextAlignmentEnum.LeftCenter,this.rules);X.setLabelPositionAndShapeBorders(),N=Math.max(N,X.PositionAndShape.MarginSize.width)}return this.rules.RenderPartNames?N:0}calculateSheetLabelBoundingBoxes(){const N=this.graphicalMusicSheet.ParentMusicSheet,C=this.rules.DefaultColorTitle;if(void 0!==N.Title&&this.rules.RenderTitle){const O=new E.GraphicalLabel(N.Title,this.rules.SheetTitleHeight,y.TextAlignmentEnum.CenterBottom,this.rules);O.Label.IsCreditLabel=!0,O.Label.colorDefault=C,this.graphicalMusicSheet.Title=O,O.setLabelPositionAndShapeBorders()}else this.rules.RenderTitle||(this.graphicalMusicSheet.Title=void 0);if(void 0!==N.Subtitle&&this.rules.RenderSubtitle){const O=new E.GraphicalLabel(N.Subtitle,this.rules.SheetSubtitleHeight,y.TextAlignmentEnum.CenterCenter,this.rules);O.Label.IsCreditLabel=!0,O.Label.colorDefault=C,this.graphicalMusicSheet.Subtitle=O,O.setLabelPositionAndShapeBorders()}else this.rules.RenderSubtitle||(this.graphicalMusicSheet.Subtitle=void 0);if(void 0!==N.Composer&&this.rules.RenderComposer){const O=new E.GraphicalLabel(N.Composer,this.rules.SheetComposerHeight,y.TextAlignmentEnum.RightCenter,this.rules);O.Label.IsCreditLabel=!0,O.Label.colorDefault=C,this.graphicalMusicSheet.Composer=O,O.setLabelPositionAndShapeBorders()}else this.rules.RenderComposer||(this.graphicalMusicSheet.Composer=void 0);if(void 0!==N.Lyricist&&this.rules.RenderLyricist){const O=new E.GraphicalLabel(N.Lyricist,this.rules.SheetAuthorHeight,y.TextAlignmentEnum.LeftCenter,this.rules);O.Label.IsCreditLabel=!0,O.Label.colorDefault=C,this.graphicalMusicSheet.Lyricist=O,O.setLabelPositionAndShapeBorders()}else this.rules.RenderLyricist||(this.graphicalMusicSheet.Lyricist=void 0);if(void 0!==N.Copyright&&this.rules.RenderCopyright){const O=new E.GraphicalLabel(N.Copyright,this.rules.SheetCopyrightHeight,y.TextAlignmentEnum.CenterBottom,this.rules);O.Label.IsCreditLabel=!0,O.Label.colorDefault=C,this.graphicalMusicSheet.Copyright=O,O.setLabelPositionAndShapeBorders()}else this.rules.RenderCopyright||(this.graphicalMusicSheet.Copyright=void 0)}checkMeasuresForWholeRestNotes(){for(let N=0,C=this.musicSystems.length;N<C;++N){const O=this.musicSystems[N];for(let X=0,W=O.StaffLines.length;X<W;++X){const G=O.StaffLines[X];for(let K=0,q=G.Measures.length;K<q;++K){const Z=G.Measures[K];if(1===Z.staffEntries.length){const et=Z.staffEntries[0];if(et.graphicalVoiceEntries.length>0&&1===et.graphicalVoiceEntries[0].notes.length){const ct=et.graphicalVoiceEntries[0].notes[0];!ct.sourceNote.Pitch&&new c.Fraction(1,2).lt(ct.sourceNote.Length)&&this.layoutMeasureWithWholeRest(ct,et,Z)}}}}}}optimizeRestNotePlacement(N,C){if(0===N.graphicalVoiceEntries.length)return;const O=N.graphicalVoiceEntries[0].notes;if(0===O.length)return;const X=O[0],W=X.sourceNote.isRest();if(2===N.graphicalVoiceEntries.length){let G=!1;const K=N.graphicalVoiceEntries[1].notes;K.length>0&&(G=K[0].sourceNote.isRest()),W&&G?this.calculateTwoRestNotesPlacementWithCollisionDetection(N):(W||G)&&this.calculateRestNotePlacementWithCollisionDetectionFromGraphicalNote(N)}else if(W&&N!==C.staffEntries[0]&&N!==C.staffEntries[C.staffEntries.length-1]){const G=C.staffEntries.indexOf(N),K=C.staffEntries[G-1],q=C.staffEntries[G+1];if(1===K.graphicalVoiceEntries.length){const Z=K.graphicalVoiceEntries[0].notes[0];if(void 0!==Z.sourceNote.NoteBeam&&1===q.graphicalVoiceEntries.length){const et=q.graphicalVoiceEntries[0].notes[0];void 0!==et.sourceNote.NoteBeam&&Z.sourceNote.NoteBeam===et.sourceNote.NoteBeam&&(this.calculateRestNotePlacementWithinGraphicalBeam(N,X,Z,q,et),N.PositionAndShape.calculateBoundingBox())}}}}getRelativePositionInStaffLineFromTimestamp(N,C,O,X,W=0,G=!1){let K,q,Z=new m.PointF2D;const et=this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers.length,ct=this.graphicalMusicSheet.GetInterpolatedIndexInVerticalContainers(N),pt=Math.min(Math.floor(ct),et-1),gt=Math.min(Math.ceil(ct),et-1);if(pt<0||C<0)return Z;if(K=this.getFirstLeftNotNullStaffEntryFromContainer(pt,C,X),q=this.getFirstRightNotNullStaffEntryFromContainer(gt,C,X),K&&q){let Et=K.parentMeasure.PositionAndShape.RelativePosition.x;W>0&&(Et=W);let St=K.PositionAndShape.RelativePosition.x+Et,Mt=q.PositionAndShape.RelativePosition.x+q.parentMeasure.PositionAndShape.RelativePosition.x;const yt=N.RealValue>q.getAbsoluteTimestamp().RealValue;W>0?Mt=q.PositionAndShape.RelativePosition.x+Et:G&&(K.getAbsoluteTimestamp().RealValue===N.RealValue||yt)&&(St=K.PositionAndShape.RelativePosition.x+K.PositionAndShape.BorderLeft+Et,Mt=St);let vt=0;if(K!==q){const _t=K.getAbsoluteTimestamp(),At=q.getAbsoluteTimestamp();vt=c.Fraction.minus(N,_t).RealValue/c.Fraction.minus(At,_t).RealValue}K.parentMeasure.ParentStaffLine!==q.parentMeasure.ParentStaffLine&&(K.parentMeasure.ParentStaffLine===O?Mt=O.PositionAndShape.Size.width:St=O.PositionAndShape.RelativePosition.x),Z=new m.PointF2D(St+(Mt-St)*vt,0)}return Z}getRelativeXPositionFromTimestamp(N){const C=this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers.length,O=this.graphicalMusicSheet.GetInterpolatedIndexInVerticalContainers(N),X=Math.max(0,Math.min(Math.round(O),C-1)),W=this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers[X].getFirstNonNullStaffEntry();return W.PositionAndShape.RelativePosition.x+W.parentMeasure.PositionAndShape.RelativePosition.x}calculatePageLabels(N){this.rules.RenderSingleHorizontalStaffline&&(N.PositionAndShape.calculateBoundingBox([i.GraphicalMeasure.name]),this.graphicalMusicSheet.ParentMusicSheet.pageWidth=N.PositionAndShape.Size.width);let C=10,O=-1;if(N.MusicSystems.length>0){const Z=N.MusicSystems[0];C=Z.PositionAndShape.RelativePosition.y+Z.PositionAndShape.BorderTop;const et=N.MusicSystems[N.MusicSystems.length-1];O=et.PositionAndShape.RelativePosition.y+et.PositionAndShape.BorderBottom}const X=this.graphicalMusicSheet.Title;if(X&&this.rules.RenderTitle){X.PositionAndShape.Parent=N.PositionAndShape;const Z=new m.PointF2D;Z.x=this.graphicalMusicSheet.ParentMusicSheet.pageWidth/2,this.rules.RenderSingleHorizontalStaffline&&(Z.x=Math.max(Z.x,X.PositionAndShape.Size.width)),Z.y=this.rules.TitleTopDistance+this.rules.SheetTitleHeight,X.PositionAndShape.RelativePosition=Z,N.Labels.push(X)}if(this.graphicalMusicSheet.Subtitle&&this.rules.RenderTitle&&this.rules.RenderSubtitle){const Z=this.graphicalMusicSheet.Subtitle;Z.PositionAndShape.Parent=N.PositionAndShape;const et=new m.PointF2D;et.x=this.graphicalMusicSheet.ParentMusicSheet.pageWidth/2,this.rules.RenderSingleHorizontalStaffline&&(et.x=X.PositionAndShape.RelativePosition.x),et.y=this.rules.TitleTopDistance+this.rules.SheetTitleHeight+this.rules.SheetMinimumDistanceBetweenTitleAndSubtitle;const ct=Z.TextLines?.length;ct>1&&(et.y+=Z.PositionAndShape.BorderBottom*(ct-1)/ct),Z.PositionAndShape.RelativePosition=et,N.Labels.push(Z)}const W=this.graphicalMusicSheet.Composer;let G;if(W&&this.rules.RenderComposer){W.PositionAndShape.Parent=N.PositionAndShape,W.setLabelPositionAndShapeBorders();const Z=new m.PointF2D;Z.x=this.graphicalMusicSheet.ParentMusicSheet.pageWidth-this.rules.PageRightMargin,Z.y=C,Z.y-=this.rules.SystemComposerDistance;const et=W.TextLines?.length;et>1&&(Z.y-=W.PositionAndShape.BorderBottom*(et-1)/et),G=Z.y,W.PositionAndShape.RelativePosition=Z,N.Labels.push(W)}const K=this.graphicalMusicSheet.Lyricist;if(K&&this.rules.RenderLyricist){K.PositionAndShape.Parent=N.PositionAndShape,K.setLabelPositionAndShapeBorders();const Z=new m.PointF2D;Z.x=this.rules.PageLeftMargin,Z.y=C,Z.y-=this.rules.SystemLyricistDistance,Z.y+=K.PositionAndShape.BorderBottom,Z.y=Math.min(Z.y,G??Number.MAX_SAFE_INTEGER),K.PositionAndShape.RelativePosition=Z,N.Labels.push(K)}const q=this.graphicalMusicSheet.Copyright;if(q&&this.rules.RenderCopyright){q.PositionAndShape.Parent=N.PositionAndShape,q.setLabelPositionAndShapeBorders();const Z=new m.PointF2D;Z.x=N.PositionAndShape.Size.width/2,Z.y=O+this.rules.SheetCopyrightMargin,Z.y-=q.PositionAndShape.BorderTop,q.PositionAndShape.RelativePosition=Z,N.Labels.push(q)}this.rules.RenderSingleHorizontalStaffline&&(N.PositionAndShape.calculateBoundingBox([i.GraphicalMeasure.name]),this.graphicalMusicSheet.ParentMusicSheet.pageWidth=N.PositionAndShape.Size.width)}createGraphicalTies(){for(let N=0;N<this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures.length;N++){const C=this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures[N];for(let O=0;O<C.CompleteNumberOfStaves;O++)for(let X=0;X<C.VerticalSourceStaffEntryContainers.length;X++){const W=C.VerticalSourceStaffEntryContainers[X].StaffEntries[O];if(W){const G=this.graphicalMusicSheet.findGraphicalStaffEntryFromMeasureList(O,N,W);G&&(G.GraphicalTies.clear(),G.ties.clear());for(let K=0,q=W.VoiceEntries.length;K<q;++K){const Z=W.VoiceEntries[K];for(let et=0,ct=Z.Notes.length;et<ct;++et){const pt=Z.Notes[et];if(pt.NoteTie){const gt=pt.NoteTie;if(pt===pt.NoteTie.Notes.last())continue;if(G)for(const Et of G.GraphicalTies);this.handleTie(gt,G,O,N)}}}this.setTieDirections(G)}}}}handleTie(N,C,O,X){if(!C)return;C.ties.push(N);let W,G,K,q=C;for(let Z=1;Z<N.Notes.length;Z++)if(W=q.findTieGraphicalNoteFromNote(N.Notes[Z-1]),G=this.graphicalMusicSheet.GetGraphicalFromSourceStaffEntry(N.Notes[Z].ParentStaffEntry),G){if(K=G.findTieGraphicalNoteFromNote(N.Notes[Z]),void 0!==W&&void 0!==K&&G){if(!W.sourceNote.PrintObject||!K.sourceNote.PrintObject)continue;const et=this.createGraphicalTie(N,q,G,W,K);q.GraphicalTies.push(et),this.staffEntriesWithGraphicalTies.indexOf(q)>=0&&this.staffEntriesWithGraphicalTies.push(q)}q=G}}setTieDirections(N){if(!N)return;const C=N.ties;if(1===C.length){const O=C[0];if(O.TieDirection===V.PlacementEnum.NotYetDefined){const X=O.Notes[0].ParentVoiceEntry.ParentVoice.VoiceId;2!==X&&6!==X||(O.TieDirection=V.PlacementEnum.Below)}}if(C.length>1){let O;for(const X of C){const W=X.Notes[0];(!O||W.Pitch.getHalfTone()>O.Pitch.getHalfTone())&&(O=W)}for(const X of C)X.TieDirection===V.PlacementEnum.NotYetDefined&&(X.TieDirection=X.Notes[0]===O?V.PlacementEnum.Above:V.PlacementEnum.Below)}}createAccidentalCalculators(){const N=[],C=this.graphicalMusicSheet.ParentMusicSheet.getFirstSourceMeasure();if(C){const O=this.graphicalMusicSheet.ParentMusicSheet.Transpose;for(let X=0;X<C.CompleteNumberOfStaves;X++){const W=new I.AccidentalCalculator;if(N.push(W),W.Transpose=O,C.FirstInstructionsStaffEntries[X])for(let G=0,K=C.FirstInstructionsStaffEntries[X].Instructions.length;G<K;++G){const q=C.FirstInstructionsStaffEntries[X].Instructions[G];if(q instanceof d.KeyInstruction){const et=new d.KeyInstruction(q.Parent,q.keyTypeOriginal,q.Mode),ct=this.graphicalMusicSheet.ParentMusicSheet.Staves[X];0!==O&&ct?.ParentInstrument?.MidiInstrumentId!==T.MidiInstrument.Percussion&&nt.transposeCalculator&&nt.transposeCalculator.transposeKey(et,O),W.ActiveKeyInstruction=et}}}}return N}calculateVerticalContainersList(){const N=this.graphicalMusicSheet.MeasureList[0].length;for(let C=0;C<this.graphicalMusicSheet.MeasureList.length;C++)for(let O=0;O<N;O++){const X=this.graphicalMusicSheet.MeasureList[C][O];if(X)for(let W=0,G=X.staffEntries.length;W<G;++W){const K=X.staffEntries[W],q=this.graphicalMusicSheet.getOrCreateVerticalContainer(K.getAbsoluteTimestamp());q&&(q.StaffEntries[O]=K,K.parentVerticalContainer=q)}}}setIndicesToVerticalGraphicalContainers(){for(let N=0;N<this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers.length;N++)this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers[N].Index=N}createGraphicalMeasuresForSourceMeasure(N,C,O,X,W){this.initGraphicalMeasuresCreation();const G=[],K=[],q=[],Z=[];let et=!0;for(let ct=0;ct<N.CompleteNumberOfStaves;ct++){const pt=this.createGraphicalMeasure(N,q,K,C[ct],W,X,O,ct,Z);et=et&&pt.hasOnlyRests,G.push(pt)}return N.allRests=et,N.VerticalMeasureList=G,G}createGraphicalMeasure(N,C,O,X,W,G,K,q,Z){const et=this.graphicalMusicSheet.ParentMusicSheet.getStaffFromIndex(q);let ct;if(W[q].ClefType===o.ClefEnum.TAB||et.isTab)et.isTab=!0,ct=nt.symbolFactory.createTabStaffMeasure(N,et);else if(N.multipleRestMeasures&&this.rules.RenderMultipleRestMeasures)ct=nt.symbolFactory.createMultiRestMeasure(N,et);else{if(N.multipleRestMeasureNumber>1)return;ct=nt.symbolFactory.createGraphicalMeasure(N,et)}if(ct.hasError=N.getErrorInMeasure(q),N.FirstInstructionsStaffEntries[q])for(let gt=0,Et=N.FirstInstructionsStaffEntries[q].Instructions.length;gt<Et;
1++gt){const St=N.FirstInstructionsStaffEntries[q].Instructions[gt];if(St instanceof d.KeyInstruction){const Mt=new d.KeyInstruction(St.Parent,St.keyTypeOriginal,St.Mode),yt=ct.getTransposedHalftones();0!==yt&&void 0===nt.transposeCalculator&&v.default.info("[OSMD] transpose requested, but TransposeCalculator undefined. Use osmd.TransposeCalculator = new TransposeCalculator()"),0!==yt&&ct.ParentStaff.ParentInstrument.MidiInstrumentId!==T.MidiInstrument.Percussion&&nt.transposeCalculator&&nt.transposeCalculator.transposeKey(Mt,yt),X.ActiveKeyInstruction=Mt}}const pt=[];for(let gt=0,Et=N.StaffLinkedExpressions[q].length;gt<Et;++gt){const St=N.StaffLinkedExpressions[q][gt];let Mt;if(St.OctaveShiftStart?Mt=St.OctaveShiftStart:St.OctaveShiftEnd&&(Mt=St.OctaveShiftEnd),Mt){pt.push(St);const yt=Mt;let vt=yt?.ParentEndMultiExpression?.AbsoluteTimestamp;yt?.ParentEndMultiExpression||(vt=c.Fraction.plus(N.AbsoluteTimestamp,N.Duration)),G[q]=new _.OctaveShiftParams(yt,yt.ParentStartMultiExpression.AbsoluteTimestamp,vt)}}for(let gt=0;gt<N.VerticalSourceStaffEntryContainers.length;gt++){const Et=N.VerticalSourceStaffEntryContainers[gt].StaffEntries[q];if(Et){for(let _t=0,At=Et.Instructions.length;_t<At;++_t){const Nt=Et.Instructions[_t];Nt instanceof o.ClefInstruction&&W[q]?.ClefType!==o.ClefEnum.TAB&&(W[q]=Nt)}const St=nt.symbolFactory.createStaffEntry(Et,ct);gt<ct.staffEntries.length?ct.addGraphicalStaffEntryAtTimestamp(St):ct.addGraphicalStaffEntry(St);const Mt=[];Et.Link&&(Et.findLinkedNotes(Mt),this.handleStaffEntryLink(St,Z));let yt,vt=n.OctaveEnum.NONE;if(G[q]&&G[q].getAbsoluteStartTimestamp.lte(Et.AbsoluteTimestamp)&&Et.AbsoluteTimestamp.lte(G[q].getAbsoluteEndTimestamp)&&(vt=G[q].getOpenOctaveShift.Type,yt=G[q].getOpenOctaveShift),vt===n.OctaveEnum.NONE)for(const _t of pt){let At;if(_t.OctaveShiftStart?At=_t.OctaveShiftStart:_t.OctaveShiftEnd&&(At=_t.OctaveShiftEnd),At?.ParentStartMultiExpression?.AbsoluteTimestamp.lte(Et.AbsoluteTimestamp)&&!At.ParentEndMultiExpression?.AbsoluteTimestamp.lt(Et.AbsoluteTimestamp)){vt=At.Type,yt=At;break}}for(let _t=0,At=Et.VoiceEntries.length;_t<At;++_t){const Nt=Et.VoiceEntries[_t];vt!==n.OctaveEnum.NONE&&yt&&yt.endVoiceEntryIndex>0&&yt.ParentEndMultiExpression?.AbsoluteTimestamp.Equals(Et.AbsoluteTimestamp)&&_t>=yt.endVoiceEntryIndex&&(vt=n.OctaveEnum.NONE,yt=void 0),vt=this.handleVoiceEntry(Nt,St,X,K,W[q],C,O,vt,q,Mt,Et)}for(const _t of Et.Instructions)if(_t instanceof o.ClefInstruction){nt.symbolFactory.createInStaffClef(St,_t);break}this.rules.RenderChordSymbols&&Et.ChordContainers?.length>0&&(Et.ParentStaff.ParentInstrument.HasChordSymbols=!0,nt.symbolFactory.createChordSymbols(Et,St,X.ActiveKeyInstruction,this.graphicalMusicSheet.ParentMusicSheet.Transpose))}}if(X.doCalculationsAtEndOfMeasure(),N.LastInstructionsStaffEntries[q]){const gt=N.LastInstructionsStaffEntries[q];for(let Et=0,St=gt.Instructions.length;Et<St;++Et){const Mt=gt.Instructions[Et];Mt instanceof o.ClefInstruction&&W[q]?.ClefType!==o.ClefEnum.TAB&&(W[q]=Mt)}}for(let gt=0,Et=N.StaffLinkedExpressions[q].length;gt<Et;++gt){const St=N.StaffLinkedExpressions[q][gt];void 0!==St.OctaveShiftEnd&&void 0!==G[q]&&St.OctaveShiftEnd===G[q].getOpenOctaveShift&&(G[q]=void 0)}for(const gt of ct.staffEntries)for(const Et of gt.graphicalVoiceEntries)this.setBeamNotesWantedStemDirections(Et.parentVoiceEntry);if(this.rules.FillEmptyMeasuresWithWholeRest>=1&&0===ct.staffEntries.length){const gt=new p.SourceStaffEntry(new F.VerticalSourceStaffEntryContainer(ct.parentSourceMeasure,ct.parentSourceMeasure.AbsoluteTimestamp,ct.parentSourceMeasure.CompleteNumberOfStaves),et);if(0===et.Voices.length){const At=new $.Voice(ct.ParentStaff.ParentInstrument,-1);et.Voices.push(At)}const Et=new h.VoiceEntry(new c.Fraction(0,1),et.Voices[0],gt);let St=N.Duration;0===St.RealValue&&(St=N.ActiveTimeSignature.clone());const Mt=new r.Note(Et,gt,St,void 0,N,!0);Mt.IsWholeMeasureRest=!0,Mt.PrintObject=this.rules.FillEmptyMeasuresWithWholeRest===Q.FillEmptyMeasuresWithWholeRests.YesVisible,Et.Notes.push(Mt);const yt=nt.symbolFactory.createStaffEntry(gt,ct);ct.addGraphicalStaffEntry(yt),yt.relInMeasureTimestamp=Et.Timestamp;
vendor: 4,133 bytes, line 1
1const vt=nt.symbolFactory.createVoiceEntry(Et,yt);yt.graphicalVoiceEntries.push(vt);const _t=nt.symbolFactory.createNote(Mt,vt,new o.ClefInstruction,n.OctaveEnum.NONE,this.rules);nt.stafflineNoteCalculator.trackNote(_t),vt.notes.push(_t)}ct.hasOnlyRests=!0;for(const gt of ct.staffEntries)if(ct.hasOnlyRests=gt.hasOnlyRests(),!ct.hasOnlyRests)break;return ct}checkNoteForAccidental(N,C,O,X){let W=N.sourceNote.Pitch;const G=N.parentVoiceEntry.parentStaffEntry.parentMeasure.getTransposedHalftones();0!==G&&N.sourceNote.ParentStaffEntry.ParentStaff.ParentInstrument.MidiInstrumentId!==T.MidiInstrument.Percussion?(W=N.Transpose(C.ActiveKeyInstruction,O,G,X),N.sourceNote.TransposedPitch=W):N.sourceNote.TransposedPitch=void 0,N.sourceNote.halfTone=W.getHalfTone(),C.checkAccidental(N,W)}handleStaffEntries(N){for(let C=0,O=this.graphicalMusicSheet.MeasureList.length;C<O;++C){const X=this.graphicalMusicSheet.MeasureList[C];for(let W=0,G=X.length;W<G;++W){const K=X[W];if(K){this.rules.PercussionOneLineCutoff>0&&!this.rules.PercussionUseCajon2NoteSystem&&N[W]&&(-1===this.rules.PercussionOneLineCutoff||nt.stafflineNoteCalculator.getStafflineUniquePositionCount(W)<this.rules.PercussionOneLineCutoff)&&(K.ParentStaff.StafflineCount=1);for(const q of K.staffEntries)void 0!==q.parentMeasure&&q.graphicalVoiceEntries.length>0&&q.graphicalVoiceEntries[0].notes.length>0&&(this.layoutVoiceEntries(q,W),this.layoutStaffEntry(q));this.graphicalMeasureCreatedCalculations(K)}}}}calculateSkyBottomLines(){}calculateExpressionAlignements(){}calculateStaffEntryArticulationMarks(){for(let N=0,C=this.musicSystems.length;N<C;++N){const O=this.musicSystems[N];for(let X=0,W=O.StaffLines.length;X<W;++X){const G=O.StaffLines[X];for(let K=0,q=G.Measures.length;K<q;++K){const Z=G.Measures[K];for(let et=0,ct=Z.staffEntries.length;et<ct;++et){const pt=Z.staffEntries[et];for(let gt=0,Et=pt.sourceStaffEntry.VoiceEntries.length;gt<Et;++gt){const St=pt.sourceStaffEntry.VoiceEntries[gt];St.Articulations.length>0&&this.layoutArticulationMarks(St.Articulations,St,pt)}}}}}}calculateOrnaments(){for(let N=0,C=this.musicSystems.length;N<C;++N){const O=this.musicSystems[N];for(let X=0,W=O.StaffLines.length;X<W;++X){const G=O.StaffLines[X];for(let K=0,q=G.Measures.length;K<q;++K){const Z=G.Measures[K];for(let et=0,ct=Z.staffEntries.length;et<ct;++et){const pt=Z.staffEntries[et];for(let gt=0,Et=pt.sourceStaffEntry.VoiceEntries.length;gt<Et;++gt){const St=pt.sourceStaffEntry.VoiceEntries[gt];if(St.OrnamentContainer){if(St.hasTie()&&!pt.relInMeasureTimestamp.Equals(St.Timestamp))continue;this.layoutOrnament(St.OrnamentContainer,St,pt),-1===this.staffEntriesWithOrnaments.indexOf(pt)&&this.staffEntriesWithOrnaments.push(pt)}}}}}}}getFingeringPlacement(N){let C=this.rules.FingeringPosition;return C!==V.PlacementEnum.NotYetDefined&&C!==V.PlacementEnum.AboveOrBelow||(C=N.isUpperStaffOfInstrument()?V.PlacementEnum.Above:V.PlacementEnum.Below),C}calculateFingerings(){if(this.rules.FingeringPosition!==V.PlacementEnum.Left&&this.rules.FingeringPosition!==V.PlacementEnum.Right)for(const N of this.musicSystems)for(const C of N.StaffLines)for(const O of C.Measures){if(O.isTabMeasure&&!this.rules.TabFingeringsRendered)continue;const X=this.getFingeringPlacement(O);for(const W of O.staffEntries){W.FingeringEntries=[];const G=C.SkyBottomLineCalculator,K=W.PositionAndShape.RelativePosition.x+O.PositionAndShape.RelativePosition.x,q=[];for(const Z of W.graphicalVoiceEntries)if(!Z.parentVoiceEntry.IsGrace)for(const et of Z.parentVoiceEntry.TechnicalInstructions)et.type===S.TechnicalInstructionType.Fingering&&q.push(et);if(q.length>0){let Z;X===V.PlacementEnum.Below&&q.reverse();for(const et of W.graphicalVoiceEntries)for(const ct of et.notes)(!Z||ct.sourceNote.Pitch?.getHalfTone()>Z.Pitch?.getHalfTone())&&(Z=ct.sourceNote);q[0].sourceNote===Z&&X===V.PlacementEnum.Above&&q.reverse()}for(let Z=0;Z<q.length;Z++){const et=q[Z],pt=new L.Label(et.value,X===V.PlacementEnum.Above?y.TextAlignmentEnum.CenterBottom:y.TextAlignmentEnum.CenterTop),gt=new E.GraphicalLabel(pt,this.rules.FingeringTextSize,pt.textAlignment,this.rules,C.PositionAndShape);
1et.fontFamily&&(pt.fontFamily=et.fontFamily);const Et=K+gt.PositionAndShape.BorderMarginLeft,St=K+gt.PositionAndShape.BorderMarginRight;let Mt;Mt=X===V.PlacementEnum.Above?G.getSkyLineMinInRange(Et,St):G.getBottomLineMaxInRange(Et,St);let yt=0;0===Z?(yt+=this.rules.FingeringOffsetY,X===V.PlacementEnum.Above&&(yt+=.1)):yt+=this.rules.FingeringPaddingY,X===V.PlacementEnum.Above&&(yt*=-1),gt.PositionAndShape.RelativePosition.y+=Mt+yt,gt.PositionAndShape.RelativePosition.x=K,gt.setLabelPositionAndShapeBorders(),gt.PositionAndShape.calculateBoundingBox(),W.FingeringEntries.push(gt);const vt=gt.PositionAndShape.RelativePosition.x+gt.PositionAndShape.BorderLeft,_t=vt-gt.PositionAndShape.BorderLeft+gt.PositionAndShape.BorderRight;X===V.PlacementEnum.Above?G.updateSkyLineInRange(vt,_t,gt.PositionAndShape.RelativePosition.y+gt.PositionAndShape.BorderTop):X===V.PlacementEnum.Below&&G.updateBottomLineInRange(vt,_t,gt.PositionAndShape.RelativePosition.y+gt.PositionAndShape.BorderBottom)}}}}optimizeRestPlacement(){for(let N=0,C=this.musicSystems.length;N<C;++N){const O=this.musicSystems[N];for(let X=0,W=O.StaffLines.length;X<W;++X){const G=O.StaffLines[X];for(let K=0,q=G.Measures.length;K<q;++K){const Z=G.Measures[K];for(let et=0,ct=Z.staffEntries.length;et<ct;++et)this.optimizeRestNotePlacement(Z.staffEntries[et],Z)}}}}calculateTwoRestNotesPlacementWithCollisionDetection(N){const C=N.graphicalVoiceEntries[0].notes[0],O=N.graphicalVoiceEntries[1].notes[0];O.PositionAndShape.RelativePosition=new m.PointF2D(0,2.5),N.PositionAndShape.calculateAbsolutePositionsRecursiveWithoutTopelement(),C.PositionAndShape.computeNonOverlappingPositionWithMargin(N.PositionAndShape,x.ColDirEnum.Up,new m.PointF2D(0,O.PositionAndShape.RelativePosition.y));const X=C.PositionAndShape.RelativePosition;X.y-=1,C.PositionAndShape.RelativePosition=X,N.PositionAndShape.calculateBoundingBox()}calculateRestNotePlacementWithCollisionDetectionFromGraphicalNote(N){let C,O;N.graphicalVoiceEntries[0].notes[0].sourceNote.isRest()?(C=N.graphicalVoiceEntries[0].notes[0],O=N.graphicalVoiceEntries[1].notes):(O=N.graphicalVoiceEntries[0].notes,C=N.graphicalVoiceEntries[1].notes[0]);let X=!1;N.PositionAndShape.calculateAbsolutePositionsRecursiveWithoutTopelement();for(let W=0,G=O.length;W<G;++W)if(C.PositionAndShape.marginCollisionDetection(O[W].PositionAndShape)){X=!0;break}if(X)if(C.sourceNote.ParentVoiceEntry.ParentVoice instanceof M.LinkedVoice)C.PositionAndShape.RelativePosition=new m.PointF2D(0,O[0].PositionAndShape.BorderMarginBottom+O[0].PositionAndShape.RelativePosition.y-C.PositionAndShape.BorderMarginTop+.5);else{const W=O[O.length-1],G=W.PositionAndShape.BorderMarginTop+W.PositionAndShape.RelativePosition.y;if(O[0].sourceNote.ParentVoiceEntry.ParentVoice instanceof M.LinkedVoice)C.PositionAndShape.RelativePosition=new m.PointF2D(0,G-C.PositionAndShape.BorderMarginBottom-.5);else{const K=O[0].PositionAndShape.BorderMarginBottom+O[0].PositionAndShape.RelativePosition.y;C.PositionAndShape.RelativePosition=new m.PointF2D(0,K<2?K-C.PositionAndShape.BorderMarginTop+.5:G-C.PositionAndShape.BorderMarginBottom-0)}}N.PositionAndShape.calculateBoundingBox()}calculateTieCurves(){for(const N of this.musicSystems)for(const C of N.StaffLines)for(const O of C.Measures)for(const X of O.staffEntries)for(const W of X.GraphicalTies)void 0!==W.StartNote&&W.StartNote.parentVoiceEntry.parentStaffEntry===X&&this.layoutGraphicalTie(W,W.StartNote.parentVoiceEntry.parentStaffEntry.parentMeasure.ParentStaffLine!==W.EndNote.parentVoiceEntry.parentStaffEntry.parentMeasure.ParentStaffLine,O.ParentStaff.isTab)}calculateLyricsPosition(){const N=new B.Dictionary;for(let C=0,O=this.graphicalMusicSheet.ParentMusicSheet.Instruments.length;C<O;++C){const X=this.graphicalMusicSheet.ParentMusicSheet.Instruments[C];X.HasLyrics&&X.LyricVersesNumbers.length>0&&X.LyricVersesNumbers.sort()}for(let C=0,O=this.musicSystems.length;C<O;++C){const X=this.musicSystems[C];for(let W=0,G=X.StaffLines.length;W<G;++W){const K=X.StaffLines[W],q=this.calculateSingleStaffLineLyricsPosition(K,K.ParentStaff.ParentInstrument.LyricVersesNumbers);N.setValue(K,q),this.calculateLyricsExtendsAndDashes(N.getValue(K))}}for(let C=0,O=this.musicSystems.length;C<O;++C){const X=this.musicSystems[C];for(let W=0,G=X.StaffLines.length;W<G;++W)this.calculateLyricsExtendsAndDashes(N.getValue(X.StaffLines[W]))}}calculateSingleLyricWord(N){const C=N.ParentLyricWord,O=C.GraphicalLyricsEntries.indexOf(N);let X;if(O>=0&&(X=C.GraphicalLyricsEntries[O+1]),!X)return;const W=N.StaffEntryParent.parentMeasure.ParentStaffLine,G=X.StaffEntryParent.parentMeasure.ParentStaffLine,K=N.StaffEntryParent,q=X.StaffEntryParent;if(N.StaffEntryParent.parentMeasure.ParentStaffLine===X.StaffEntryParent.parentMeasure.ParentStaffLine){const Z=K.parentMeasure.PositionAndShape.RelativePosition.x+K.PositionAndShape.RelativePosition.x+N.GraphicalLabel.PositionAndShape.RelativePosition.x+N.GraphicalLabel.PositionAndShape.BorderMarginRight-N.GraphicalLabel.CenteringXShift,et=q.parentMeasure.PositionAndShape.RelativePosition.x+q.PositionAndShape.RelativePosition.x+N.GraphicalLabel.PositionAndShape.RelativePosition.x+X.GraphicalLabel.PositionAndShape.BorderMarginLeft,ct=N.GraphicalLabel.PositionAndShape.RelativePosition.y;let pt=1;et-Z>3*this.rules.MinimumDistanceBetweenDashes&&(pt=Math.floor((et-Z)/this.rules.MinimumDistanceBetweenDashes)-1),1===pt?this.calculateSingleDashForLyricWord(W,Z,et,ct):this.calculateDashes(W,Z,et,ct)}else{const et=W.Measures[W.Measures.length-1];let pt=N.GraphicalLabel.PositionAndShape.RelativePosition.y;this.calculateDashes(W,K.parentMeasure.PositionAndShape.RelativePosition.x+K.PositionAndShape.RelativePosition.x+N.GraphicalLabel.PositionAndShape.BorderMarginRight,et.PositionAndShape.RelativePosition.x+et.PositionAndShape.Size.width,pt),G&&G.Measures[0]&&q.parentMeasure.ParentStaffLine&&(q!==q.parentMeasure.staffEntries[0]||q.parentMeasure!==q.parentMeasure.ParentStaffLine.Measures[0])&&(pt=X.GraphicalLabel.PositionAndShape.RelativePosition.y,this.calculateDashes(G,G.Measures[0].staffEntries[0].PositionAndShape.RelativePosition.x,q.parentMeasure.PositionAndShape.RelativePosition.x+q.PositionAndShape.RelativePosition.x+X.GraphicalLabel.PositionAndShape.BorderMarginLeft,pt))}}calculateDashes(N,C,O,X){let W=O-C;if(W<3*this.rules.MinimumDistanceBetweenDashes)this.calculateSingleDashForLyricWord(N,C,O,X);else{const G=Math.floor(W/this.rules.MinimumDistanceBetweenDashes)-1,K=W/(G+1);let q=0;for(C+=K,O-=K;q<=Math.floor(G/2)&&O>C;)W=this.calculateRightAndLeftDashesForLyricWord(N,C,O,X),C+=K,O-=K,q++;W>2*K&&this.calculateSingleDashForLyricWord(N,C,O,X)}}calculateSingleDashForLyricWord(N,C,O,X){const W=new L.Label("-");W.colorDefault=this.rules.DefaultColorLyrics;let G=this.rules.LyricsHeight;O-C<.8&&(G*=.8,X-=.1*G);const K=new E.GraphicalLabel(W,G,y.TextAlignmentEnum.CenterBottom,this.rules);
vendor: 22,945 bytes, line 1
1K.setLabelPositionAndShapeBorders(),N.LyricsDashes.push(K),-1===this.staffLinesWithLyricWords.indexOf(N)&&this.staffLinesWithLyricWords.push(N),K.PositionAndShape.Parent=N.PositionAndShape;const q=new m.PointF2D(C+(O-C)/2,X);K.PositionAndShape.RelativePosition=q}calculateLyricExtend(N){let C=N.GraphicalLabel.PositionAndShape.RelativePosition.y;const O=N.StaffEntryParent,X=O.parentMeasure.ParentStaffLine;let W,G;const K=O.parentMeasure.ParentStaff.idInMusicSheet;if(O.parentVerticalContainer){for(let q=O.parentVerticalContainer.Index+1;q<this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers.length;++q){const Z=this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers[q].StaffEntries[K];if(Z){if(Z.hasOnlyRests()||Z.LyricsEntries.length>0)break;W=Z,G=W.parentMeasure.ParentStaffLine,G||(G=O.parentMeasure.ParentStaffLine)}}if(W&&G)if(X===G&&W.parentMeasure.ParentStaffLine)C-=N.GraphicalLabel.PositionAndShape.Size.height/4,this.calculateSingleLyricWordWithUnderscore(X,O.parentMeasure.PositionAndShape.RelativePosition.x+O.PositionAndShape.RelativePosition.x+N.GraphicalLabel.PositionAndShape.BorderMarginRight,W.parentMeasure.PositionAndShape.RelativePosition.x+W.PositionAndShape.RelativePosition.x+W.PositionAndShape.BorderMarginRight,C);else{const q=X.Measures[X.Measures.length-1].PositionAndShape;if(C-=N.GraphicalLabel.PositionAndShape.Size.height/4,this.calculateSingleLyricWordWithUnderscore(X,O.parentMeasure.PositionAndShape.RelativePosition.x+O.PositionAndShape.RelativePosition.x+N.GraphicalLabel.PositionAndShape.BorderMarginRight,q.RelativePosition.x+q.Size.width,C),!W)return;W.parentMeasure.ParentStaffLine&&W.parentMeasure.staffEntries&&(W!==W.parentMeasure.staffEntries[0]||W.parentMeasure!==W.parentMeasure.ParentStaffLine.Measures[0])&&this.calculateSingleLyricWordWithUnderscore(G,G.Measures[0].staffEntries[0].PositionAndShape.RelativePosition.x,W.parentMeasure.PositionAndShape.RelativePosition.x+W.PositionAndShape.RelativePosition.x+W.PositionAndShape.BorderMarginRight,C)}}}calculateSingleLyricWordWithUnderscore(N,C,O,X){const W=new m.PointF2D(C,X),G=new m.PointF2D(O,X),K=new D.GraphicalLine(W,G,this.rules.LyricUnderscoreLineWidth);K.colorHex=this.rules.DefaultColorLyrics,N.LyricLines.push(K),-1===this.staffLinesWithLyricWords.indexOf(N)&&this.staffLinesWithLyricWords.push(N)}calculateRightAndLeftDashesForLyricWord(N,C,O,X){const W=new L.Label("-");W.colorDefault=this.rules.DefaultColorLyrics;const G=new E.GraphicalLabel(W,this.rules.LyricsHeight,y.TextAlignmentEnum.CenterBottom,this.rules);G.setLabelPositionAndShapeBorders(),N.LyricsDashes.push(G),-1===this.staffLinesWithLyricWords.indexOf(N)&&this.staffLinesWithLyricWords.push(N),G.PositionAndShape.Parent=N.PositionAndShape;const K=new m.PointF2D(C,X);G.PositionAndShape.RelativePosition=K;const q=new L.Label("-"),Z=new E.GraphicalLabel(q,this.rules.LyricsHeight,y.TextAlignmentEnum.CenterBottom,this.rules);Z.setLabelPositionAndShapeBorders(),N.LyricsDashes.push(Z),Z.PositionAndShape.Parent=N.PositionAndShape;const et=new m.PointF2D(O,X);return Z.PositionAndShape.RelativePosition=et,Z.PositionAndShape.RelativePosition.x-G.PositionAndShape.RelativePosition.x}calculateDynamicExpressions(){const N=Math.min(this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures.length-1,this.rules.MaxMeasureToDrawIndex);for(let C=Math.min(this.rules.MinMeasureToDrawIndex,this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures.length);C<=N;C++){const O=this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures[C];this.dynamicExpressionMap.clear();for(let X=0;X<O.StaffLinkedExpressions.length;X++)if(this.graphicalMusicSheet.MeasureList[C]&&this.graphicalMusicSheet.MeasureList[C][X]&&this.graphicalMusicSheet.MeasureList[C][X].ParentStaff.isVisible())for(let W=0;W<O.StaffLinkedExpressions[X].length;W++)(void 0!==O.StaffLinkedExpressions[X][W].InstantaneousDynamic||void 0!==O.StaffLinkedExpressions[X][W].StartingContinuousDynamic&&O.StaffLinkedExpressions[X][W].StartingContinuousDynamic.StartMultiExpression===O.StaffLinkedExpressions[X][W]&&0===O.StaffLinkedExpressions[X][W].UnknownList.length)&&this.calculateDynamicExpressionsForMultiExpression(O.StaffLinkedExpressions[X][W],C,X)}this.dynamicExpressionMap.clear()}calculateOctaveShifts(){for(let N=0;N<this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures.length;N++){const C=this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures[N];for(let O=0;O<C.StaffLinkedExpressions.length;O++)if(this.graphicalMusicSheet.MeasureList[N]&&this.graphicalMusicSheet.MeasureList[N][O]&&this.graphicalMusicSheet.MeasureList[N][O].ParentStaff.isVisible())for(let X=0;X<C.StaffLinkedExpressions[O].length;X++)C.StaffLinkedExpressions[O][X].OctaveShiftStart&&this.calculateSingleOctaveShift(C,C.StaffLinkedExpressions[O][X],N,O)}}calculatePedals(){for(let N=0;N<this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures.length;N++){const C=this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures[N];for(let O=0;O<C.StaffLinkedExpressions.length;O++)if(this.graphicalMusicSheet.MeasureList[N]&&this.graphicalMusicSheet.MeasureList[N][O]&&this.graphicalMusicSheet.MeasureList[N][O].ParentStaff.isVisible())for(let X=0;X<C.StaffLinkedExpressions[O].length;X++)C.StaffLinkedExpressions[O][X].PedalStart&&this.calculateSinglePedal(C,C.StaffLinkedExpressions[O][X],N,O)}}calculateWavyLines(){for(let N=0;N<this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures.length;N++){const C=this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures[N];for(let O=0;O<C.StaffLinkedExpressions.length;O++)if(this.graphicalMusicSheet.MeasureList[N]&&this.graphicalMusicSheet.MeasureList[N][O]&&this.graphicalMusicSheet.MeasureList[N][O].ParentStaff.isVisible())for(let X=0;X<C.StaffLinkedExpressions[O].length;X++)C.StaffLinkedExpressions[O][X].WavyLineStart&&this.calculateSingleWavyLine(C,C.StaffLinkedExpressions[O][X],N,O)}}getFirstLeftNotNullStaffEntryFromContainer(N,C,O){if(this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers[N].StaffEntries[C])return this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers[N].StaffEntries[C];for(let X=N-1;X>=0;X--)if(this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers[X].StaffEntries[C])return this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers[X].StaffEntries[C]}getFirstRightNotNullStaffEntryFromContainer(N,C,O){if(this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers[N].StaffEntries[C])return this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers[N].StaffEntries[C];for(let X=N+1;X<this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers.length;X++)if(this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers[X].StaffEntries[C])return this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers[X].StaffEntries[C]}calculateWordRepetitionInstructions(){const N=[];for(let C=0;C<this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures.length;C++){const O=this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures[C];let X,W=!1,G=!1;for(const K of O.FirstRepetitionInstructions)K.type===e.RepetitionInstructionEnum.Ending&&K.alignment===e.AlignmentType.Begin&&(W=!0,X=K.endingIndices);for(const K of O.LastRepetitionInstructions)K.type!==e.RepetitionInstructionEnum.Ending||K.alignment!==e.AlignmentType.End&&K.alignment!==e.AlignmentType.Discontinue||(G=!0);W&&N.push({startMeasure:C,endingIndices:X});for(let K=0,q=O.FirstRepetitionInstructions.length;K<q;++K)this.calculateWordRepetitionInstruction(O.FirstRepetitionInstructions[K],C);for(let K=0,q=O.LastRepetitionInstructions.length;K<q;++K)this.calculateWordRepetitionInstruction(O.LastRepetitionInstructions[K],C);if(!W&&!G&&N.length>0){const K=N[N.length-1];if(C>K.startMeasure){const q=new e.RepetitionInstruction(C,e.RepetitionInstructionEnum.Ending,e.AlignmentType.Mid,void 0,K.endingIndices);this.calculateWordRepetitionInstruction(q,C)}}G&&N.length>0&&N.pop()}}calculateRepetitionEndings(){const N=this.graphicalMusicSheet.ParentMusicSheet;for(let C=0,O=N.Repetitions.length;C<O;++C)this.calcGraphicalRepetitionEndingsRecursively(N.Repetitions[C])}calculateTempoExpressions(){const N=Math.min(this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures.length-1,this.rules.MaxMeasureToDrawIndex);for(let C=this.rules.MinMeasureToDrawIndex;C<=N;C++){const O=this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures[C];for(let X=0;X<O.TempoExpressions.length;X++)this.calculateTempoExpressionsForMultiTempoExpression(O,O.TempoExpressions[X],C)}}calculateRehearsalMarks(){if(this.rules.RenderRehearsalMarks)for(const N of this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures)this.calculateRehearsalMark(N)}calculateRehearsalMark(N){throw new Error(this.abstractNotImplementedErrorMessage)}calculateMoodAndUnknownExpressions(){for(let N=0;N<this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures.length;N++){const C=this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures[N];for(let O=0;O<C.StaffLinkedExpressions.length;O++){if(!this.graphicalMusicSheet.MeasureList[N]||!this.graphicalMusicSheet.MeasureList[N][O])continue;let X=O;if(!this.graphicalMusicSheet.MeasureList[N][O].ParentStaff.isVisible()){if(0!==O)continue;{let W=!1;for(let G=0;G<this.graphicalMusicSheet.MeasureList[N].length;G++)if(this.graphicalMusicSheet.MeasureList[N][G]?.ParentStaff.isVisible()){X=G,W=!0;break}if(!W)continue}}for(let W=0;W<C.StaffLinkedExpressions[O].length;W++)(C.StaffLinkedExpressions[O][W].MoodList.length>0||C.StaffLinkedExpressions[O][W].UnknownList.length>0)&&this.calculateMoodAndUnknownExpression(C.StaffLinkedExpressions[O][W],N,X)}}}calculateStemDirectionFromVoices(N){if(void 0!==N.ParentSourceStaffEntry.Link)return N===N.ParentSourceStaffEntry.VoiceEntries[0]?void(N.WantedStemDirection=h.StemDirectionType.Up):void(N.WantedStemDirection=h.StemDirectionType.Down);N.ParentVoice instanceof M.LinkedVoice?N.WantedStemDirection=h.StemDirectionType.Down:N.ParentSourceStaffEntry.VoiceEntries.length>1&&(N.WantedStemDirection=h.StemDirectionType.Up)}setBeamNotesWantedStemDirections(N){if(!(N.Notes.length>0))return;const C=N.Notes[0].NoteBeam;if(C)for(const O of C.Notes)if(O.Notehead?.Shape!==A.NoteHeadShape.NONE&&O.ParentVoiceEntry.WantedStemDirection!==h.StemDirectionType.Undefined&&O.ParentVoiceEntry.ParentSourceStaffEntry.ParentStaff.Id===N.ParentSourceStaffEntry.ParentStaff.Id){N.WantedStemDirection=O.ParentVoiceEntry.WantedStemDirection;break}}}g.MusicSheetCalculator=nt},1932(dt,g,u){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.MusicSheetDrawer=void 0;const l=u(6438),s=u(2683),c=u(6452),r=u(200),i=u(9409),o=u(8254),n=u(7435),h=u(7533),e=u(7307),f=u(4284),m=u(512),p=u(242),E=u(7499),y=u(298);g.MusicSheetDrawer=class{constructor(d,S){this.drawableBoundingBoxElement="None",this.skyLineVisible=!1,this.bottomLineVisible=!1,this.phonicScoreMode=p.PhonicScoreModes.Manual,this.textMeasurer=d,this.splitScreenLineColor=-1,this.drawingParameters=S,this.rules=S.Rules}set Mode(d){this.phonicScoreMode=d}drawSheet(d){if(this.graphicalMusicSheet=d,this.rules=d.ParentMusicSheet.Rules,this.drawSplitScreenLine(),this.drawingParameters.drawCursors)for(const M of d.Cursors){if(!M)continue;const x=new l.BoundingBox(M);x.AbsolutePosition=M.Start,x.BorderBottom=M.End.y-M.Start.y,x.BorderRight=M.Width/2,x.BorderLeft=-M.Width/2,this.isVisible(x)&&this.drawLineAsVerticalRectangle(M,s.GraphicalLayers.Cursor)}this.drawingParameters.drawScrollIndicator&&this.drawScrollIndicator();const S=Math.min(this.graphicalMusicSheet.MusicPages.length,this.rules.MaxPageToDrawNumber);for(let M=0;M<S;M++)this.drawPage(this.graphicalMusicSheet.MusicPages[M])}drawLineAsHorizontalRectangle(d,S){let M=new r.RectangleF2D(d.Start.x,d.End.y-d.Width/2,d.End.x-d.Start.x,d.Width);M=this.applyScreenTransformationForRect(M),this.renderRectangle(M,S,d.styleId,d.colorHex)}drawLineAsVerticalRectangle(d,S){const M=d.Start,x=d.Width;let _=new r.RectangleF2D(M.x-x/2,M.y,x,d.End.y-M.y);_=this.applyScreenTransformationForRect(_),this.renderRectangle(_,S,d.styleId)}drawLineAsHorizontalRectangleWithOffset(d,S,M){const x=new i.PointF2D(d.Start.x+S.x,d.Start.y+S.y),_=new i.PointF2D(d.End.x+S.x,d.End.y+S.y),I=d.Width;let T=new r.RectangleF2D(x.x,_.y-I/2,_.x-x.x,I);T=this.applyScreenTransformationForRect(T),this.renderRectangle(T,M,d.styleId)}drawLineAsVerticalRectangleWithOffset(d,S,M){const x=new i.PointF2D(d.Start.x+S.x,d.Start.y+S.y),_=new i.PointF2D(d.End.x+S.x,d.End.y+S.y);let T=new r.RectangleF2D(x.x,x.y,d.Width,_.y-x.y);T=this.applyScreenTransformationForRect(T),this.renderRectangle(T,M,d.styleId)}drawRectangle(d,S){const M=d.PositionAndShape;let x=new r.RectangleF2D(M.AbsolutePosition.x,M.AbsolutePosition.y,M.BorderRight,M.BorderBottom);x=this.applyScreenTransformationForRect(x),this.renderRectangle(x,S,d.style)}calculatePixelDistance(d){throw new Error("not implemented")}drawLabel(d,S){if(!this.isVisible(d.PositionAndShape))return;const M=d.Label;if(""===M.text.trim())return;const x=this.applyScreenTransformation(d.PositionAndShape.AbsolutePosition),_=this.calculatePixelDistance(M.fontHeight),I=this.calculatePixelDistance(d.PositionAndShape.Size.width),T=Math.ceil(I),A=Math.ceil(_*(.2+d.TextLines.length));switch(M.textAlignment){case h.TextAlignmentEnum.LeftTop:break;case h.TextAlignmentEnum.LeftCenter:x.y-=A/2;break;case h.TextAlignmentEnum.LeftBottom:x.y-=A;break;case h.TextAlignmentEnum.CenterTop:x.x-=T/2;break;case h.TextAlignmentEnum.CenterCenter:x.x-=T/2,x.y-=A/2;break;case h.TextAlignmentEnum.CenterBottom:x.x-=T/2,x.y-=A;break;case h.TextAlignmentEnum.RightTop:x.x-=T;break;case h.TextAlignmentEnum.RightCenter:x.x-=T,x.y-=A/2;break;case h.TextAlignmentEnum.RightBottom:x.x-=T,x.y-=A;break;default:throw new e.ArgumentOutOfRangeException("")}return this.renderLabel(d,S,T,A,_,x)}applyScreenTransformation(d){throw new Error("not implemented")}applyScreenTransformations(d){const S=[];for(const M of d)S.push(this.applyScreenTransformation(M));return S}applyScreenTransformationForRect(d){throw new Error("not implemented")}drawSplitScreenLine(){}renderRectangle(d,S,M,x=void 0,_=1){throw new Error("not implemented")}drawScrollIndicator(){}drawSelectionStartSymbol(d){}drawSelectionEndSymbol(d){}renderLabel(d,S,M,x,_,I){throw new Error("not implemented")}renderSystemToScreen(d,S,M){}drawMeasure(d){throw new Error("not implemented")}drawSkyLine(d){}drawBottomLine(d){}drawInstrumentBrace(d,S){}drawGroupBracket(d,S){}isVisible(d){return!0}drawMusicSystem(d){const S=this.getSystemAbsBoundingRect(d),M=this.getSytemBoundingBoxInPixels(S);this.drawMusicSystemComponents(d,M,S)}getSytemBoundingBoxInPixels(d){const S=this.applyScreenTransformationForRect(d);return S.x=Math.round(S.x),S.y=Math.round(S.y),S}getSystemAbsBoundingRect(d){const S=d.PositionAndShape.BoundingRectangle;return new r.RectangleF2D(d.PositionAndShape.AbsolutePosition.x+d.PositionAndShape.BorderLeft-1,d.PositionAndShape.AbsolutePosition.y+d.PositionAndShape.BorderTop-1,S.width+6,S.height+2)}drawMusicSystemComponents(d,S,M){const x=this.graphicalMusicSheet.SelectionStartSymbol,_=this.graphicalMusicSheet.SelectionEndSymbol;this.drawingParameters.drawSelectionStartSymbol&&void 0!==x&&this.isVisible(x.PositionAndShape)&&this.drawSelectionStartSymbol(x),this.drawingParameters.drawSelectionEndSymbol&&void 0!==_&&this.isVisible(_.PositionAndShape)&&this.drawSelectionEndSymbol(_);for(const A of d.StaffLines)this.drawStaffLine(A),this.rules.RenderLyrics&&(A.LyricsDashes.length>0&&this.drawDashes(A.LyricsDashes),A.LyricLines.length>0&&this.drawLyricLines(A.LyricLines,A));for(const A of d.SystemLines)this.drawSystemLineObject(A);if(this.rules.RenderSystemLabelsAfterFirstPage||d.Parent===d.Parent.Parent.MusicPages[0])for(const A of d.Labels)A.SVGNode=this.drawLabel(A,s.GraphicalLayers.Notes);const I=this.graphicalMusicSheet.ParentMusicSheet.Instruments,T=I.filter(A=>A.isVisible()).length;for(const A of d.InstrumentBrackets)this.drawInstrumentBrace(A,d);if(I.length>0)if(T>1)for(const A of d.GroupBrackets)this.drawGroupBracket(A,d);else for(const A of d.GroupBrackets)A.Visible=!1;if(!this.leadSheet)for(const A of d.MeasureNumberLabels)A.SVGNode=this.drawLabel(A,s.GraphicalLayers.Notes),A.SVGNode?.classList?.add("measure-number");for(const A of d.StaffLines)this.drawStaffLineSymbols(A);this.drawingParameters.drawMarkedAreas&&this.drawMarkedAreas(d),this.drawingParameters.drawComments&&this.drawComment(d)}activateSystemRendering(d,S,M,x){return!0}drawSystemLineObject(d){}drawStaffLine(d){for(const S of d.Measures)this.drawMeasure(S);this.rules.RenderLyrics&&d.LyricsDashes.length>0&&this.drawDashes(d.LyricsDashes),this.drawOctaveShifts(d),this.drawPedals(d),this.drawWavyLines(d),this.drawExpressions(d),this.skyLineVisible&&this.drawSkyLine(d),this.bottomLineVisible&&this.drawBottomLine(d)}drawLyricLines(d,S){S.LyricLines.forEach(M=>{M.Start.y+=S.PositionAndShape.AbsolutePosition.y,M.End.y+=S.PositionAndShape.AbsolutePosition.y,M.Start.x+=S.PositionAndShape.AbsolutePosition.x,M.End.x+=S.PositionAndShape.AbsolutePosition.x,this.drawGraphicalLine(M,this.rules.LyricUnderscoreLineWidth,M.colorHex)})}drawExpressions(d){}drawGraphicalLine(d,S,M="black"){return this.drawLine(d.Start,d.End,M,S)}drawLine(d,S,M="#FF0000FF",x){}drawDashes(d){d.forEach(S=>{S.SVGNode=this.drawLabel(S,s.GraphicalLayers.Notes),S.SVGNode?.classList.add("dash")})}drawOctaveShifts(d){}drawStaffLines(d){if(d.StaffLines){const S=d.PositionAndShape.AbsolutePosition;for(let M=0;M<5;M++)this.drawLineAsHorizontalRectangleWithOffset(d.StaffLines[M],S,s.GraphicalLayers.Notes)}}drawInstantaneousDynamic(d){throw new Error("not implemented")}drawContinuousDynamic(d){throw new Error("not implemented")}drawSymbol(d,S,M,x=1,_=s.GraphicalLayers.Notes){}get leadSheet(){return this.graphicalMusicSheet.LeadSheet}set leadSheet(d){this.graphicalMusicSheet.LeadSheet=d}drawPage(d){if(this.isVisible(d.PositionAndShape)){for(const S of d.MusicSystems)this.isVisible(S.PositionAndShape)&&this.drawMusicSystem(S);if(d===d.Parent.MusicPages[0])for(const S of d.Labels)S.SVGNode=this.drawLabel(S,s.GraphicalLayers.Notes);this.drawableBoundingBoxElement&&this.drawBoundingBoxes(d.PositionAndShape,0,this.drawableBoundingBoxElement)}}drawBoundingBoxes(d,S=0,M="all",x=!1){const _=d.DataObject.constructor.name;let I=!1;if("all"===M?I=!0:"VexFlowStaffEntry"===M?I=d.DataObject instanceof E.VexFlowStaffEntry:"VexFlowMeasure"===M?I=d.DataObject instanceof E.VexFlowMeasure:"VexFlowGraphicalNote"===M?I=d.DataObject instanceof E.VexFlowGraphicalNote:"VexFlowVoiceEntry"===M?I=d.DataObject instanceof E.VexFlowVoiceEntry:"GraphicalLabel"===M?I=d.DataObject instanceof o.GraphicalLabel:"VexFlowStaffLine"===M?I=d.DataObject instanceof E.VexFlowStaffLine:"SystemLine"===M?I=d.DataObject instanceof f.SystemLine:"StaffLineActivitySymbol"===M?I=d.DataObject instanceof y.StaffLineActivitySymbol:"VexFlowContinuousDynamicExpression"===M&&(I=d.DataObject instanceof E.VexFlowContinuousDynamicExpression),I||_===M){let T;x&&(T=_),this.drawBoundingBox(d,void 0,!0,T,S)}S++,d.ChildElements.forEach(T=>this.drawBoundingBoxes(T,S,M))}drawBoundingBox(d,S=void 0,M=!1,x=void 0,_=0){let I=new r.RectangleF2D(d.AbsolutePosition.x+d.BorderMarginLeft,d.AbsolutePosition.y+d.BorderMarginTop,d.BorderMarginRight-d.BorderMarginLeft,d.BorderMarginBottom-d.BorderMarginTop);M&&(this.drawLineAsHorizontalRectangle(new c.GraphicalLine(new i.PointF2D(d.AbsolutePosition.x-1,d.AbsolutePosition.y),new i.PointF2D(d.AbsolutePosition.x+1,d.AbsolutePosition.y),.1,s.OutlineAndFillStyleEnum.BaseWritingColor,S),_-1),this.drawLineAsVerticalRectangle(new c.GraphicalLine(new i.PointF2D(d.AbsolutePosition.x,d.AbsolutePosition.y-1),new i.PointF2D(d.AbsolutePosition.x,d.AbsolutePosition.y+1),.1,s.OutlineAndFillStyleEnum.BaseWritingColor,S),_-1)),I=this.applyScreenTransformationForRect(I);const T=this.renderRectangle(I,s.GraphicalLayers.Background,_,S,.5);if(x){const A=new n.Label(x),v=new o.GraphicalLabel(A,.8,h.TextAlignmentEnum.CenterCenter,this.rules);v.setLabelPositionAndShapeBorders(),this.renderLabel(v,_,I.width,I.height,I.height,new i.PointF2D(I.x,I.y+12))}return T}drawMarkedAreas(d){for(const S of d.GraphicalMarkedAreas)S&&(S.systemRectangle&&this.drawRectangle(S.systemRectangle,s.GraphicalLayers.Background),S.settings&&(S.settings.SVGNode=this.drawLabel(S.settings,s.GraphicalLayers.Comment)),S.labelRectangle&&this.drawRectangle(S.labelRectangle,s.GraphicalLayers.Background),S.label&&(S.label.SVGNode=this.drawLabel(S.label,s.GraphicalLayers.Comment)))}drawComment(d){for(const S of d.GraphicalComments)S&&(S.settings&&(S.settings.SVGNode=this.drawLabel(S.settings,s.GraphicalLayers.Comment)),S.label&&(S.label.SVGNode=this.drawLabel(S.label,s.GraphicalLayers.Comment)))}drawStaffLineSymbols(d){const M=d.PositionAndShape.AbsolutePosition.x,x=d.PositionAndShape.AbsolutePosition.y+2,_=d.PositionAndShape.BorderRight;d.ParentStaff.ParentInstrument.highlight&&this.drawingParameters.drawHighlights&&this.drawLineAsHorizontalRectangle(new c.GraphicalLine(new i.PointF2D(M,x),new i.PointF2D(M+_,x),4,s.OutlineAndFillStyleEnum.Highlighted),s.GraphicalLayers.Highlight);let I=p.MusicSymbolDrawingStyle.Disabled,T=m.MusicSymbol.PLAY,A=this.drawingParameters.drawActivitySymbols;switch(this.phonicScoreMode){case p.PhonicScoreModes.Midi:T=m.MusicSymbol.PLAY,this.midiPlaybackAvailable&&d.ParentStaff.audible&&(I=p.MusicSymbolDrawingStyle.PlaybackSymbols);break;case p.PhonicScoreModes.Following:T=m.MusicSymbol.MIC,d.ParentStaff.following&&(I=p.MusicSymbolDrawingStyle.FollowSymbols);break;default:A=!1}if(A){const v=new i.PointF2D(M+_+2,x);this.drawSymbol(T,I,v)}if(this.drawingParameters.drawErrors)for(const v of d.Measures){const B=v.PositionAndShape,D=B.AbsolutePosition.x,L=B.AbsolutePosition.y+2;v.hasError&&this.graphicalMusicSheet.ParentMusicSheet.DrawErroneousMeasures&&this.drawLineAsHorizontalRectangle(new c.GraphicalLine(new i.PointF2D(D,L),new i.PointF2D(D+B.BorderRight,L),4,s.OutlineAndFillStyleEnum.ErrorUnderlay),s.GraphicalLayers.MeasureError)}}}},512(dt,g){"use strict";var u,l;Object.defineProperty(g,"__esModule",{value:!0}),g.MusicSymbol=void 0,(l=u||(g.MusicSymbol=u={}))[l.Unused_first_Symbol=0]="Unused_first_Symbol",l[l.BLACK_HEAD=1]="BLACK_HEAD",l[l.UPWARDS_TAIL=2]="UPWARDS_TAIL",l[l.DOWNWARDS_TAIL=3]="DOWNWARDS_TAIL",l[l.UPWARDS_DOUBLE_TAIL=4]="UPWARDS_DOUBLE_TAIL",l[l.DOWNWARDS_DOUBLE_TAIL=5]="DOWNWARDS_DOUBLE_TAIL",l[l.UPWARDS_TRIPLE_TAIL=6]="UPWARDS_TRIPLE_TAIL",l[l.DOWNWARDS_TRIPLE_TAIL=7]="DOWNWARDS_TRIPLE_TAIL",l[l.UPWARDS_QUAD_TAIL=8]="UPWARDS_QUAD_TAIL",l[l.DOWNWARDS_QUAD_TAIL=9]="DOWNWARDS_QUAD_TAIL",l[l.ROUND_HEAD=10]="ROUND_HEAD",l[l.WHITE_HEAD=11]="WHITE_HEAD",l[l.G_CLEF=12]="G_CLEF",l[l.F_CLEF=13]="F_CLEF",l[l.C_CLEF=14]="C_CLEF",l[l.BREVE=15]="BREVE",l[l.BREVE_REST=16]="BREVE_REST",l[l.COMMON_TIME=17]="COMMON_TIME",l[l.CUT_TIME=18]="CUT_TIME",l[l.WHOLE_REST=19]="WHOLE_REST",l[l.HALF_REST=20]="HALF_REST",l[l.QUARTER_REST=21]="QUARTER_REST",l[l.EIGHTH_REST=22]="EIGHTH_REST",l[l.SIXTEENTH_REST=23]="SIXT
1EENTH_REST",l[l.THIRTYSECOND_REST=24]="THIRTYSECOND_REST",l[l.SIXTYFOURTH_REST=25]="SIXTYFOURTH_REST",l[l.FLAT=26]="FLAT",l[l.SHARP=27]="SHARP",l[l.NATURAL=28]="NATURAL",l[l.DOUBLE_FLAT=29]="DOUBLE_FLAT",l[l.DOUBLE_SHARP=30]="DOUBLE_SHARP",l[l.ZERO=31]="ZERO",l[l.ONE=32]="ONE",l[l.TWO=33]="TWO",l[l.THREE=34]="THREE",l[l.FOUR=35]="FOUR",l[l.FIVE=36]="FIVE",l[l.SIX=37]="SIX",l[l.SEVEN=38]="SEVEN",l[l.EIGHT=39]="EIGHT",l[l.NINE=40]="NINE",l[l.DOT=41]="DOT",l[l.FERMATA=42]="FERMATA",l[l.INVERTED_FERMATA=43]="INVERTED_FERMATA",l[l.SPICCATO=44]="SPICCATO",l[l.TENUTO=45]="TENUTO",l[l.MARCATO=46]="MARCATO",l[l.MARCATISSIMO=47]="MARCATISSIMO",l[l.INVERTED_MARCATISSIMO=48]="INVERTED_MARCATISSIMO",l[l.P=49]="P",l[l.F=50]="F",l[l.S=51]="S",l[l.Z=52]="Z",l[l.M=53]="M",l[l.R=54]="R",l[l.SEGNO=55]="SEGNO",l[l.CODA=56]="CODA",l[l.DRUM_CLEF=57]="DRUM_CLEF",l[l.G_CLEF_SUB8=58]="G_CLEF_SUB8",l[l.G_CLEF_SUPER8=59]="G_CLEF_SUPER8",l[l.G_CLEF_SUB15=60]="G_CLEF_SUB15",l[l.G_CLEF_SUPER15=61]="G_CLEF_SUPER15",l[l.F_CLEF_SUB8=62]="F_CLEF_SUB8",l[l.F_CLEF_SUPER8=63]="F_CLEF_SUPER8",l[l.F_CLEF_SUB15=64]="F_CLEF_SUB15",l[l.F_CLEF_SUPER15=65]="F_CLEF_SUPER15",l[l.DOWN_BOW=66]="DOWN_BOW",l[l.MORDENT=67]="MORDENT",l[l.INVERTED_MORDENT=68]="INVERTED_MORDENT",l[l.TURN=69]="TURN",l[l.INVERTED_TURN=70]="INVERTED_TURN",l[l.LEFTHAND_PIZZICATO=71]="LEFTHAND_PIZZICATO",l[l.RELEASE_PED=72]="RELEASE_PED",l[l.ENGAGE_PED=73]="ENGAGE_PED",l[l.VA8=74]="VA8",l[l.VB8=75]="VB8",l[l.TRILL=76]="TRILL",l[l.MA15=77]="MA15",l[l.MB15=78]="MB15",l[l.HIGH=79]="HIGH",l[l.PLAY=80]="PLAY",l[l.MIC=81]="MIC",l[l.SNAP_PIZZICATO=82]="SNAP_PIZZICATO",l[l.NATURAL_HARMONIC=83]="NATURAL_HARMONIC",l[l.EditPen=84]="EditPen",l[l.PEDAL_BRACKET=85]="PEDAL_BRACKET",l[l.PEDAL_MIXED=86]="PEDAL_MIXED",l[l.PEDAL_SYMBOL=87]="PEDAL_SYMBOL"},5221(dt,g,u){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.MusicSystem=void 0;const l=u(9252),s=u(6438),c=u(2561),r=u(7533),i=u(8254),o=u(7741),n=u(9409),h=u(6954),e=u(3263),f=u(67),m=u(7435);g.MusicSystem=class p extends o.GraphicalObject{constructor(y){super(),this.needsToBeRedrawn=!0,this.staffLines=[],this.graphicalMeasures=[],this.labels=new e.Dictionary,this.measureNumberLabels=[],this.objectsToRedraw=[],this.instrumentBrackets=[],this.groupBrackets=[],this.graphicalMarkedAreas=[],this.graphicalComments=[],this.systemLines=[],this.breaksPage=!1,this.id=y,this.boundingBox=new s.BoundingBox(this),this.maxLabelLength=0}get Parent(){return this.parent}set Parent(y){if(this.parent){const d=this.parent.MusicSystems.indexOf(this,0);d>-1&&this.parent.MusicSystems.splice(d,1)}this.parent=y,this.boundingBox.Parent=y.PositionAndShape}get NextSystem(){const y=this.Parent.MusicSystems.indexOf(this);return y!==this.Parent.MusicSystems.length?this.Parent.MusicSystems[y+1]:void 0}get StaffLines(){return this.staffLines}set StaffLines(y){this.staffLines=y}get GraphicalMeasures(){return this.graphicalMeasures}get MeasureNumberLabels(){return this.measureNumberLabels}get Labels(){return this.labels.values()}get ObjectsToRedraw(){return this.objectsToRedraw}get InstrumentBrackets(){return this.instrumentBrackets}get GroupBrackets(){return this.groupBrackets}get GraphicalMarkedAreas(){return this.graphicalMarkedAreas}get GraphicalComments(){return this.graphicalComments}get SystemLines(){return this.systemLines}get Id(){return this.id}get MaxLabelLength(){return this.maxLabelLength}createSystemLeftLine(y,d,S){let _,M=-y/2;S&&(M=this.maxLabelLength+d-y/2),this.staffLines.length>1&&(_=this.staffLines[this.staffLines.length-1].Measures[0]);const I=this.createSystemLine(M,y,h.SystemLinesEnum.SingleThin,f.SystemLinePosition.MeasureBegin,this,this.staffLines[0].Measures[0],_);this.SystemLines.push(I),I.PositionAndShape.RelativePosition=new n.PointF2D(M,0),I.PositionAndShape.BorderLeft=0,I.PositionAndShape.BorderRight=y,I.PositionAndShape.BorderTop=I.PositionAndShape.Parent.BorderTop,I.PositionAndShape.BorderBottom=I.PositionAndShape.Parent.BorderBottom,this.createLinesForSystemLine(I)}createVerticalLineForMeasure(y,d,S,M,x,_){const I=_.ParentStaffLine,T=new n.PointF2D(I.PositionAndShape.RelativePosition.x,I.PositionAndShape.RelativePosition.y),A=I.ParentStaff.ParentInstrument.Staves;if(I.ParentStaff===A[0]){let v;A.length>1&&(v=this.getBottomStaffLine(I).Measures[x]);const B=this.createSystemLine(y,d,S,M,this,_,v);B.PositionAndShape.RelativePosition=new n.PointF2D(T.x+y,0),B.PositionAndShape.BorderLeft=0,B.PositionAndShape.BorderRight=d,this.SystemLines.push(B)}}setYPositionsToVerticalLineObjectsAndCreateLines(y){}calculateBorders(y){}alignBeginInstructions(){}GetLeftBorderAbsoluteXPosition(){return this.StaffLines[0].PositionAndShape.AbsolutePosition.x+this.StaffLines[0].Measures[0].beginInstructionsWidth}GetRightBorderAbsoluteXPosition(){return this.StaffLines[0].PositionAndShape.AbsolutePosition.x+this.StaffLines[0].StaffLines[0].End.x}AddGraphicalMeasures(y){for(let d=0,S=y.length;d<S;++d)y[d].ParentMusicSystem=this;this.graphicalMeasures.push(y)}GetSystemsFirstTimeStamp(){return this.graphicalMeasures[0][0].parentSourceMeasure.AbsoluteTimestamp}GetSystemsLastTimeStamp(){const y=this.graphicalMeasures[this.graphicalMeasures.length-1][0].parentSourceMeasure;
vendor: 12,971 bytes, line 1
1return c.Fraction.plus(y.AbsoluteTimestamp,y.Duration)}createInstrumentBrackets(y,d){for(let S=0,M=y.length;S<M;++S){const x=y[S];if(x.Staves.length>1){let _,I;for(let T=0,A=this.staffLines.length;T<A;++T){const v=this.staffLines[T];v.ParentStaff===x.Staves[0]&&v.ParentStaff.Visible&&(_=v),v.ParentStaff===x.Staves[x.Staves.length-1]&&v.ParentStaff.Visible&&(I=v)}_&&I&&this.createInstrumentBracket(_,I)}}}createGroupBrackets(y,d,S){for(let M=0,x=y.length;M<x;++M){const _=y[M];if(_.InstrumentalGroups.length<1)continue;const I=this.findFirstVisibleInstrumentInInstrumentalGroup(_),T=this.findLastVisibleInstrumentInInstrumentalGroup(_);if(!I||!T)continue;let A,v;for(let B=0,D=this.staffLines.length;B<D;++B){const L=this.staffLines[B];L.ParentStaff===I.Staves[0]&&(A=L),L.ParentStaff===T.Staves[0]&&(v=L)}A&&v&&this.createGroupBracket(A,v,S),_.InstrumentalGroups.length<1||this.createGroupBrackets(_.InstrumentalGroups,d,S+1)}}createMusicSystemLabel(y,d,S,M=!1){const x=d;for(let I=0,T=this.staffLines.length;I<T;++I){const A=this.staffLines[I].ParentStaff.ParentInstrument;let v;if(M)v=A.NameLabel,this.rules.RenderPartNames&&v?.print||(v=new m.Label("",A.NameLabel.textAlignment,A.NameLabel.font),d=0);else{if(!this.rules.RenderPartAbbreviations||!this.rules.RenderPartNames||1===this.staffLines.length||!A.PartAbbreviation||""===A.PartAbbreviation)return;v=new m.Label(A.PartAbbreviation,A.NameLabel.textAlignment,A.NameLabel.font)}if(A?.NameLabel?.print){const B=new i.GraphicalLabel(v,y,r.TextAlignmentEnum.LeftCenter,this.rules,this.boundingBox);B.setLabelPositionAndShapeBorders(),this.labels.setValue(A,B)}else d=0}this.maxLabelLength=0;const _=this.labels.values();for(let I=0,T=_.length;I<T;++I){const A=_[I];A.Label.print&&A.PositionAndShape.Size.width>this.maxLabelLength&&(this.maxLabelLength=A.PositionAndShape.Size.width,d=x)}this.updateMusicSystemStaffLineXPosition(d)}setMusicSystemLabelsYPosition(){this.labels.forEach((y,d)=>{let S=0,M=0;for(let x=0;x<this.staffLines.length;x++)if(this.staffLines[x].ParentStaff.ParentInstrument===y){for(let _=x;_<this.staffLines.length;_++){const I=this.staffLines[_];if(I.ParentStaff.ParentInstrument!==y)break;S+=I.PositionAndShape.RelativePosition.y,M++}break}M>0&&(d.PositionAndShape.RelativePosition=new n.PointF2D(0,S/M+2))})}checkStaffEntriesForStaffEntryLink(){let y=!1,d=!1;for(let S=0;S<this.staffLines.length-1;S++){for(let M=0,x=this.staffLines[S].Measures.length;M<x;++M){const _=this.staffLines[S].Measures[M];for(let I=0,T=_.staffEntries.length;I<T;++I)_.staffEntries[I].sourceStaffEntry.Link&&(y=!0)}for(let M=0,x=this.staffLines[S+1].Measures.length;M<x;++M){const _=this.staffLines[S+1].Measures[M];for(let I=0,T=_.staffEntries.length;I<T;++I)_.staffEntries[I].sourceStaffEntry.Link&&(d=!0)}}return!(!y||!d)}getBottomStaffLine(y){const d=y.ParentStaff.ParentInstrument.Staves;let S;for(let M=d.length-1;M>=0;M--)if(d[M]?.Visible){S=d[M];break}for(const M of y.ParentMusicSystem.staffLines)if(M.ParentStaff===S)return M}createSystemLine(y,d,S,M,x,_,I=void 0){throw new Error("not implemented")}createLinesForSystemLine(y){}calcBracketsWidth(){let y=0;for(let d=0,S=this.GroupBrackets.length;d<S;++d)y=Math.max(y,this.GroupBrackets[d].PositionAndShape.Size.width);for(let d=0,S=this.InstrumentBrackets.length;d<S;++d)y=Math.max(y,this.InstrumentBrackets[d].PositionAndShape.Size.width);return y}createInstrumentBracket(y,d){}createGroupBracket(y,d,S){}findFirstVisibleInstrumentInInstrumentalGroup(y){for(let d=0,S=y.InstrumentalGroups.length;d<S;++d){const M=y.InstrumentalGroups[d];if(!(M instanceof l.Instrument))return this.findFirstVisibleInstrumentInInstrumentalGroup(M);if(M.isVisible())return M}}findLastVisibleInstrumentInInstrumentalGroup(y){let d;for(let S=y.InstrumentalGroups.length-1;S>=0;S--){if(d=y.InstrumentalGroups[S],!(d instanceof l.Instrument))return this.findLastVisibleInstrumentInInstrumentalGroup(d);if(d.isVisible())return d}}updateMusicSystemStaffLineXPosition(y){for(let d=0,S=this.StaffLines.length;d<S;++d){const M=this.StaffLines[d],x=M.PositionAndShape.RelativePosition;x.x=this.maxLabelLength+y,M.PositionAndShape.RelativePosition=x,M.PositionAndShape.BorderRight=this.boundingBox.Size.width-this.maxLabelLength-y;for(let _=0;_<M.StaffLines.length;_++){const I=new n.PointF2D(M.PositionAndShape.Size.width,M.StaffLines[_].End.y);M.StaffLines[_].End=I}}}}},7066(dt,g,u){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.MeasureBuildParameters=g.SystemBuildParameters=g.MusicSystemBuilder=void 0;const l=u(1888),s=u(9288),c=u(4543),r=u(164),i=u(9409),o=u(6452),n=u(6954),h=u(7921),e=u(164),f=u(813),m=u(67);g.MusicSystemBuilder=class{constructor(){this.musicSystems=[],this.globalSystemIndex=0,this.leadSheet=!1}initialize(E,y,d){this.leadSheet=E.LeadSheet,this.graphicalMusicSheet=E,this.rules=this.graphicalMusicSheet.ParentMusicSheet.Rules,this.measureList=y,this.numberOfVisibleStaffLines=d,this.activeRhythm=new Array(this.numberOfVisibleStaffLines),this.activeKeys=new Array(this.numberOfVisibleStaffLines),this.activeClefs=new Array(this.numberOfVisibleStaffLines),this.initializeActiveInstructions(this.measureList[0])}buildMusicSystems(){const E=this.getFullPageSystemWidth();let y=!1;for(this.measureListIndex=0,this.currentSystemParams=new p,this.currentSystemParams.currentSystem=this.initMusicSystem(),this.currentSystemParams.maxLabelLength=this.currentSystemParams.currentSystem.MaxLabelLength;this.measureListIndex<this.measureList.length;){const d=this.measureList[this.measureListIndex];if(!d||!d[0]){this.measureListIndex++;continue}for(let Q=0,ot=d.length;Q<ot;++Q)d[Q].resetLayout();const S=d[0].parentSourceMeasure,M=S.HasEndLine,x=M&&this.rules.NewPartAndSystemAfterFinalBarline,_=this.currentSystemParams.IsSystemStartMeasure();S.IsSystemStartMeasure=_;const I=S===this.graphicalMusicSheet.ParentMusicSheet.getFirstSourceMeasure();let T=this.rules.MeasureLeftMargin,A=0;const v=this.getMeasureStartLine();if(T+=this.getLineWidth(d[0],v,_),!this.leadSheet){let Q=!1;y&&this.rules.ShowRhythmAgainAfterPartEndOrFinalBarline&&(Q=!0),T+=this.addBeginInstructions(d,_,I||Q),A+=this.addEndInstructions(d)}let B=0;for(let Q=0;Q<this.numberOfVisibleStaffLines;Q++)B=Math.max(B,d[Q].minimumStaffEntriesWidth);const D=this.getMeasureEndLine();A+=this.getLineWidth(d[0],D,_);let L,F=this.rules.MeasureLeftMargin;if(this.measureListIndex+1<this.measureList.length){const Q=this.measureList[this.measureListIndex+1];L=Q[0]?.parentSourceMeasure,L?.hasBeginInstructions()&&(F+=this.addBeginInstructions(Q,!1,!1))}let V=T+A+B;if(d[0]?.parentSourceMeasure?.multipleRestMeasures){B=this.rules.MultipleRestMeasureDefaultWidth,V=T+A+B;for(let Q=0;Q<this.numberOfVisibleStaffLines;Q++)d[Q]&&(d[Q].minimumStaffEntriesWidth=B)}const j=this.currentSystemParams.systemMeasures.length,Y=this.rules.NewPageAtXMLNewPageAttribute&&S.printNewPageXml;if(_||this.currentSystemParams.currentWidth+V+F+(this.currentSystemParams.maxLabelLength>0?this.currentSystemParams.maxLabelLength+this.rules.SystemLabelsRightMargin:0)<E&&!(Y||this.rules.NewSystemAtXMLNewPageAttribute&&S.printNewPageXml||this.rules.NewSystemAtXMLNewSystemAttribute&&S.printNewSystemXml||j===this.rules.RenderXMeasuresPerLineAkaSystem&&j>0)){if(this.addMeasureToSystem(d,v,D,V,T,B,A),this.updateActiveClefs(S,d),this.measureListIndex++,x){if(this.rules.MaxSystemToDrawNumber===this.musicSystems.length)return this.finalizeCurrentSystem(d,!this.rules.StretchLastSystemLine,!1),this.musicSystems;this.finalizeCurrentAndCreateNewSystem(d,!this.rules.StretchLastSystemLine,!1)}y=M}else{if(this.rules.MaxSystemToDrawNumber===this.musicSystems.length)return this.finalizeCurrentSystem(d,!1,!0,Y),this.musicSystems;this.finalizeCurrentAndCreateNewSystem(d,!1,!0,Y)}}if(this.currentSystemParams.systemMeasures.length>0){if(this.rules.MaxSystemToDrawNumber===this.musicSystems.length)return this.finalizeCurrentSystem(this.measureList[this.measureList.length-1],!this.rules.StretchLastSystemLine,!1),this.musicSystems;this.finalizeCurrentAndCreateNewSystem(this.measureList[this.measureList.length-1],!this.rules.StretchLastSystemLine,!1)}return this.musicSystems}calculateSystemYLayout(){for(const E of this.musicSystems)this.optimizeDistanceBetweenStaffLines(E);this.calculateMusicSystemsRelativePositions()}setMeasureWidth(E,y,d,S){for(let M=0,x=E.length;M<x;++M){const _=E[M];_.setWidth(y),d>0&&(_.beginInstructionsWidth=d),S>0&&(_.endInstructionsWidth=S)}}finalizeCurrentAndCreateNewSystem(E,y=!1,d=!0,S=!1){this.finalizeCurrentSystem(E,y,d,S),this.currentSystemParams=new p,void 0!==E&&this.measureListIndex<this.measureList.length&&(this.currentSystemParams.currentSystem=this.initMusicSystem(),this.currentSystemParams.maxLabelLength=this.currentSystemParams.currentSystem.MaxLabelLength)}finalizeCurrentSystem(E,y=!1,d=!0,S=!1){this.currentSystemParams.currentSystem.breaksPage=S,this.adaptRepetitionLineWithIfNeeded(),void 0!==E&&d&&this.checkAndCreateExtraInstructionMeasure(E),this.stretchMusicSystem(y)}adaptRepetitionLineWithIfNeeded(){const E=this.currentSystemParams.systemMeasures;if(E.length>=1){const y=this.currentSystemParams.currentSystem.GraphicalMeasures[this.currentSystemParams.currentSystem.GraphicalMeasures.length-1];let d=0;const S=E[E.length-1];S.endLine===n.SystemLinesEnum.DotsBoldBoldDots&&(S.endLine=n.SystemLinesEnum.DotsThinBold,d=y[0].getLineWidth(n.SystemLinesEnum.DotsBoldBoldDots)/2-y[0].getLineWidth(n.SystemLinesEnum.DotsThinBold)),this.currentSystemParams.currentSystemFixWidth-=d;for(let M=0,x=y.length;M<x;++M)y[M].endInstructionsWidth-=d}}addMeasureToSystem(E,y,d,S,M,x,_){this.currentSystemParams.systemMeasures.push({beginLine:y,endLine:d}),this.setMeasureWidth(E,S,M,_),this.addStaveMeasuresToSystem(E),this.currentSystemParams.currentWidth+=S,this.currentSystemParams.currentSystemFixWidth+=M+_,this.currentSystemParams.currentSystemVarWidth+=x,this.currentSystemParams.systemMeasureIndex++}initMusicSystem(){const E=h.MusicSheetCalculator.symbolFactory.createMusicSystem(this.globalSystemIndex++,this.rules);return this.musicSystems.push(E),this.layoutSystemStaves(E),E.createMusicSystemLabel(this.rules.InstrumentLabelTextHeight,this.rules.SystemLabelsRightMargin,this.rules.LabelMarginBorderFactor,1===this.musicSystems.length),E}getFullPageSystemWidth(){return this.graphicalMusicSheet.ParentMusicSheet.pageWidth-this.rules.PageLeftMargin-this.rules.PageRightMargin-this.rules.SystemLeftMargin-this.rules.SystemRightMargin}layoutSystemStaves(E){const y=this.getFullPageSystemWidth(),d=E.PositionAndShape;d.BorderLeft=0,d.BorderRight=y,d.BorderTop=0;const S=[],M=this.graphicalMusicSheet.ParentMusicSheet.Instruments;for(let I=0,T=M.length;I<T;++I){const A=M[I];if(A.isVisible()&&0!==A.Voices.length)for(let v=0,B=A.Staves.length;v<B;++v){const D=A.Staves[v];D?.Visible&&S.push(D)}}let x=!1;if(this.leadSheet)for(let I=0,T=S.length;I<T;++I)if(S[I].ParentInstrument.LyricVersesNumbers.length>1){x=!0;break}let _=0;for(let I=0;I<S.length;I++)if(this.addStaffLineToMusicSystem(E,_,S[I]),_+=this.rules.StaffHeight,I+1<S.length){let T=0;T=this.leadSheet&&!x?2.5:S[I].ParentInstrument===S[I+1].ParentInstrument?this.rules.BetweenStaffDistance:this.rules.StaffDistance,_+=T}d.BorderBottom=_}addStaffLineToMusicSystem(E,y,d){if(E){const S=h.MusicSheetCalculator.symbolFactory.createStaffLine(E,d);E.StaffLines.push(S);const M=S.PositionAndShape,x=new i.PointF2D;x.x=0,M.BorderRight=E.PositionAndShape.Size.width,x.y=y,M.RelativePosition=x,M.BorderLeft=0,M.BorderTop=0,M.BorderBottom=this.rules.StaffHeight;for(let _=0;_<5;_++){const I=new i.PointF2D;I.x=0,I.y=_*this.rules.StaffHeight/4;const T=new i.PointF2D;T.x=S.PositionAndShape.Size.width,T.y=_*this.rules.StaffHeight/4,this.leadSheet&&(I.y=T.y=0),S.StaffLines[_]=new o.GraphicalLine(I,T,this.rules.StaffLineWidth)}}}initializeActiveInstructions(E){const y=this.graphicalMusicSheet.ParentMusicSheet.getFirstSourceMeasure();if(y){this.visibleStaffIndices=this.graphicalMusicSheet.getVisibleStavesIndicesFromSourceMeasure(E);for(let S=0,M=this.visibleStaffIndices.length;S<M;S++){const x=this.visibleStaffIndices[S],_=this.graphicalMusicSheet.getGraphicalMeasureFromSourceMeasureAndIndex(y,x);this.activeClefs[S]=y.FirstInstructionsStaffEntries[x].Instructions[0],_.InitiallyActiveClef=this.activeClefs[S];const I=y.FirstInstructionsStaffEntries[x].Instructions[1];if(I){let A=c.KeyInstruction.copy(I);A=this.transposeKeyInstruction(A,_),this.activeKeys[S]=A}this.activeRhythm[S]=y.FirstInstructionsStaffEntries[x].Instructions[2]}const d=this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures;for(let S=0;S<this.rules.MinMeasureToDrawIndex;S++){const M=d[S];if(M)for(let x=0,_=this.visibleStaffIndices.length;x<_;x++){const I=this.visibleStaffIndices[x],T=M.FirstInstructionsStaffEntries[I];if(T)for(let B=0,D=T.Instructions.length;B<D;++B){const L=T.Instructions[B];L instanceof r.ClefInstruction?this.activeClefs[x]=L:L instanceof c.KeyInstruction?this.activeKeys[x]=L:L instanceof s.RhythmInstru
1ction&&(this.activeRhythm[x]=L)}const A=M.getEntriesPerStaff(I);for(let B=0,D=A.length;B<D;++B){const L=A[B];if(L.Instructions)for(let F=0,V=L.Instructions.length;F<V;++F){const j=L.Instructions[F];j instanceof r.ClefInstruction&&(this.activeClefs[x]=j)}}const v=M.LastInstructionsStaffEntries[I];if(v)for(let B=0,D=v.Instructions.length;B<D;++B){const L=v.Instructions[B];L instanceof r.ClefInstruction&&(this.activeClefs[x]=L)}}}}}transposeKeyInstruction(E,y){const d=y.getTransposedHalftones();return d!==E.isTransposedBy&&y.ParentStaff.ParentInstrument.MidiInstrumentId!==e.MidiInstrument.Percussion&&void 0!==h.MusicSheetCalculator.transposeCalculator&&h.MusicSheetCalculator.transposeCalculator.transposeKey(E,d),E}addBeginInstructions(E,y,d){const S=E.length;if(0===S)return 0;let M=0;const x=E[0].parentSourceMeasure,_=[];for(let I=0;I<S;++I){const T=E[I];T&&_.push(T.getVFStave());const B=this.AddInstructionsAtMeasureBegin(x.FirstInstructionsStaffEntries[this.visibleStaffIndices[I]],T,I,d,y);M=Math.max(M,B)}return _[0].formatBegModifiers(_),M}addEndInstructions(E){const y=E.length;if(0===y)return 0;let d=.5;const S=E[0].parentSourceMeasure;for(let M=0;M<y;M++){const T=this.addInstructionsAtMeasureEnd(S.LastInstructionsStaffEntries[this.visibleStaffIndices[M]],E[M],E);d=Math.max(d,T)}return d}AddInstructionsAtMeasureBegin(E,y,d,S,M){let x,_,I,T=0;if(E)for(let D=0,L=E.Instructions.length;D<L;++D){const F=E.Instructions[D];F instanceof r.ClefInstruction?x=F:F instanceof c.KeyInstruction?_=F:F instanceof s.RhythmInstruction&&(I=F)}y.InitiallyActiveClef=x??this.activeClefs[d],M&&(x||(x=this.activeClefs[d]),_||(_=c.KeyInstruction.copy(this.activeKeys[d])),S&&!I&&(I=this.activeRhythm[d]));let A=!1,v=!1,B=!1;if(x?(y.addClefAtBegin(x),A=!0):x=this.activeClefs[d],_&&(_=this.transposeKeyInstruction(_,y),y.addKeyAtBegin(_,M?void 0:this.activeKeys[d],x),v=!0),void 0!==I&&I.PrintObject&&this.rules.RenderTimeSignatures){let D=!0;const L=y.MeasureNumber-1-this.rules.MinMeasureToDrawIndex;if(y.MeasureNumber-1>=0&&this.measureList[L]){const F=this.measureList[L],V=F[0]?.parentSourceMeasure;V?.ImplicitMeasure&&V?.RhythmPrinted&&(D=!1)}D&&(y.addRhythmAtBegin(I),y.parentSourceMeasure.RhythmPrinted=I,B=!0)}return(A||v||B)&&(T+=y.beginInstructionsWidth,B&&(T+=this.rules.RhythmRightMargin)),T}addInstructionsAtMeasureEnd(E,y,d){if(!E||!E.Instructions||0===E.Instructions.length)return 0;for(let S=0,M=E.Instructions.length;S<M;++S){const x=E.Instructions[S];if(x instanceof r.ClefInstruction){const _=x;y.addClefAtEnd(_);for(const I of d)I!==y&&I.addClefAtEnd(_,!1)}}return this.rules.MeasureRightMargin+y.endInstructionsWidth}updateActiveClefs(E,y){for(let d=0,S=y.length;d<S;d++){const M=this.visibleStaffIndices[d],x=E.FirstInstructionsStaffEntries[M];if(x)for(let T=0,A=x.Instructions.length;T<A;++T){const v=x.Instructions[T];v instanceof r.ClefInstruction?this.activeClefs[d]=v:v instanceof c.KeyInstruction?this.activeKeys[d]=v:v instanceof s.RhythmInstruction&&(this.activeRhythm[d]=v)}const _=E.getEntriesPerStaff(M);for(let T=0,A=_.length;T<A;++T){const v=_[T];if(v.Instructions)for(let B=0,D=v.Instructions.length;B<D;++B){const L=v.Instructions[B];L instanceof r.ClefInstruction&&(this.activeClefs[d]=L)}}const I=E.LastInstructionsStaffEntries[M];if(I){const T=I.Instructions;for(let A=0,v=T.length;A<v;++A){const B=T[A];B instanceof r.ClefInstruction&&(this.activeClefs[d]=B)}}}}
vendor: 8,231 bytes, line 1
1checkAndCreateExtraInstructionMeasure(E){const y=E[0].parentSourceMeasure.FirstInstructionsStaffEntries,d=[];for(let M=0,x=E.length;M<x;++M)d.push(y[E[M].ParentStaff.idInMusicSheet]);let S=0;for(let M=0,x=d.length;M<x;++M){const _=d[M];if(!_)continue;const I=_.Instructions;let T,A;for(let v=0,B=I.length;v<B;++v){const D=I[v];D instanceof c.KeyInstruction&&D.Key!==this.activeKeys[M].Key&&(T=D),D instanceof s.RhythmInstruction&&D!==this.activeRhythm[M]&&(A=D)}if(void 0!==T||A){const v=this.addExtraInstructionMeasure(M,T,A);S=Math.max(S,v)}}S>0&&(this.currentSystemParams.systemMeasures.push({beginLine:n.SystemLinesEnum.None,endLine:n.SystemLinesEnum.None}),this.currentSystemParams.currentWidth+=S,this.currentSystemParams.currentSystemFixWidth+=S)}addExtraInstructionMeasure(E,y,d){const S=this.currentSystemParams.currentSystem,M=h.MusicSheetCalculator.symbolFactory.createExtraGraphicalMeasure(S.StaffLines[E]);[].push(M),y&&M.addKeyAtBegin(y,this.activeKeys[E],this.activeClefs[E]),void 0!==d&&d.PrintObject&&M.addRhythmAtBegin(d),M.PositionAndShape.BorderLeft=0,M.PositionAndShape.BorderTop=0,M.PositionAndShape.BorderBottom=this.rules.StaffHeight;const x=this.rules.MeasureLeftMargin+M.beginInstructionsWidth+this.rules.MeasureRightMargin;return M.PositionAndShape.BorderRight=x,S.StaffLines[E].Measures.push(M),x}addStaveMeasuresToSystem(E){if(E[0]){const y=[];for(let S=0;S<E.length;S++)y.push(E[S]);const d=this.currentSystemParams.currentSystem;for(let S=0;S<this.numberOfVisibleStaffLines;S++){const M=y[S];d.StaffLines[S].Measures.push(M),M.ParentStaffLine=d.StaffLines[S]}d.AddGraphicalMeasures(y)}}getMeasureStartLine(){if(this.thisMeasureBeginsLineRepetition()){const E=0===this.measureListIndex;if(E&&this.rules.RepetitionAllowFirstMeasureBeginningRepeatBarline)return n.SystemLinesEnum.BoldThinDots;const y=this.currentSystemParams.IsSystemStartMeasure();if(this.previousMeasureEndsLineRepetition()&&!y)return n.SystemLinesEnum.DotsBoldBoldDots;if(!E)return n.SystemLinesEnum.BoldThinDots}return n.SystemLinesEnum.None}getMeasureEndLine(){let E;try{if(E=this.measureList[this.measureListIndex][0].parentSourceMeasure,this.rules.RenderMultipleRestMeasures&&E.multipleRestMeasures>1){const y=Math.min(this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures.length-1,E.measureListIndex+E.multipleRestMeasures-1);E=this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures[y]}}finally{}return this.nextMeasureBeginsLineRepetition()&&this.thisMeasureEndsLineRepetition()?n.SystemLinesEnum.DotsBoldBoldDots:this.thisMeasureEndsLineRepetition()?n.SystemLinesEnum.DotsThinBold:this.nextMeasureHasKeyInstructionChange()?n.SystemLinesEnum.DoubleThin:E&&void 0!==E.endingBarStyleEnum?E.endingBarStyleEnum:n.SystemLinesEnum.SingleThin}getLineWidth(E,y,d){let S=E.getLineWidth(y);return y===n.SystemLinesEnum.DotsBoldBoldDots&&(S/=2),d&&y===n.SystemLinesEnum.BoldThinDots&&(S+=this.rules.DistanceBetweenLastInstructionAndRepetitionBarline),S}previousMeasureEndsLineRepetition(){if(0===this.measureListIndex)return!1;for(let E=0,y=this.measureList[this.measureListIndex-1].length;E<y;++E)if(this.measureList[this.measureListIndex-1][E].endsWithLineRepetition())return!0;return!1}thisMeasureBeginsLineRepetition(){for(let E=0,y=this.measureList[this.measureListIndex].length;E<y;++E)if(this.measureList[this.measureListIndex][E].beginsWithLineRepetition())return!0;return!1}nextMeasureBeginsLineRepetition(){const E=this.measureListIndex+1;if(E>=this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures.length||!this.measureList[E])return!1;for(let y=0,d=this.measureList[E].length;y<d;++y)if(this.measureList[E][y].beginsWithLineRepetition())return!0;return!1}thisMeasureEndsLineRepetition(){for(let E=0,y=this.measureList[this.measureListIndex].length;E<y;++E){const d=this.measureList[this.measureListIndex][E];if(d.endsWithLineRepetition())return!0;if(d.parentSourceMeasure?.isReducedToMultiRest){const S=this.graphicalMusicSheet.ParentMusicSheet;let M=d.parentSourceMeasure;const x=S.SourceMeasures.indexOf(M);let _=M.multipleRestMeasureNumber;for(let I=x+1;I<S.SourceMeasures.length;I++){const T=S.SourceMeasures[I];if(!(T.multipleRestMeasureNumber>=_))break;M=T,_=T.multipleRestMeasureNumber}return M.endsWithLineRepetition()}}return!1}nextMeasureBeginsWordRepetition(){const E=this.measureListIndex+1;if(E>=this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures.length||E>this.measureList.length-1)return!1;for(let y=0,d=this.measureList[E].length;y<d;++y)if(this.measureList[E][y].beginsWithWordRepetition())return!0;return!1}thisMeasureEndsWordRepetition(){for(let E=0,y=this.measureList[this.measureListIndex].length;E<y;++E)if(this.measureList[this.measureListIndex][E].endsWithWordRepetition())return!0;return!1}nextMeasureHasKeyInstructionChange(){return void 0!==this.getNextMeasureKeyInstruction()}getNextMeasureKeyInstruction(){if(this.measureListIndex<this.measureList.length-1)for(let E=0;E<this.measureList[this.measureListIndex].length;E++){const y=this.measureList[this.measureListIndex+1][E]?.parentSourceMeasure;return y?y.getKeyInstruction(this.visibleStaffIndices[E]):void 0}}calculateXScalingFactor(E,y){return Math.abs(y-0)<1e-5||Math.abs(E-0)<1e-5?1:(this.currentSystemParams.currentSystem.StaffLines[0].PositionAndShape.Size.width-E)/y}stretchMusicSystem(E){let y=this.calculateXScalingFactor(this.currentSystemParams.currentSystemFixWidth,this.currentSystemParams.currentSystemVarWidth);E&&(y=Math.min(y,this.rules.LastSystemMaxScalingFactor));const d=this.currentSystemParams.currentSystem;for(let S=0,M=d.StaffLines.length;S<M;++S){const x=d.StaffLines[S];let _=0;for(let I=0;I<x.Measures.length;I++){const T=x.Measures[I];if(T.setPositionInStaffline(_),T.setWidth(T.beginInstructionsWidth+T.minimumStaffEntriesWidth*y+T.endInstructionsWidth),I<this.currentSystemParams.systemMeasures.length){const v=this.currentSystemParams.systemMeasures[I].beginLine,B=T.getLineWidth(n.SystemLinesEnum.BoldThinDots);if(v===n.SystemLinesEnum.BoldThinDots){let D=_;0===I&&(D=_+T.beginInstructionsWidth-B),d.createVerticalLineForMeasure(D,B,v,m.SystemLinePosition.MeasureBegin,I,T)}}if(T.staffEntriesScaleFactor=y,T.layoutSymbols(),!(I+1<this.currentSystemParams.systemMeasures.length&&this.currentSystemParams.systemMeasures[I+1].beginLine===n.SystemLinesEnum.BoldThinDots)){let v=n.SystemLinesEnum.SingleThin;I<this.currentSystemParams.systemMeasures.length&&(v=this.currentSystemParams.systemMeasures[I].endLine);const B=T.getLineWidth(v);let D=T.PositionAndShape.RelativePosition.x+T.PositionAndShape.BorderRight-B;v===n.SystemLinesEnum.DotsBoldBoldDots&&(D-=B/2),d.createVerticalLineForMeasure(D,B,v,m.SystemLinePosition.MeasureEnd,I,T)}_=T.PositionAndShape.RelativePosition.x+T.PositionAndShape.BorderRight}}E&&this.decreaseMusicSystemBorders()}decreaseMusicSystemBorders(){const E=this.currentSystemParams.currentSystem,y=f.CollectionUtil.last(E.StaffLines[0].Measures).PositionAndShape,d=y.RelativePosition.x+y.Size.width;for(let S=0,M=E.StaffLines.length;S<M;++S){const x=E.StaffLines[S];x.PositionAndShape.BorderRight=d;for(let _=0,I=x.StaffLines.length;_<I;++_){const T=x.StaffLines[_];T.End=new i.PointF2D(d,T.End.y)}}E.PositionAndShape.BorderRight=d+this.currentSystemParams.maxLabelLength+this.rules.SystemLabelsRightMargin}updateStaffLinesRelativePosition(E,y,d){for(let S=y;S<E.StaffLines.length;S++)E.StaffLines[S].PositionAndShape.RelativePosition.y=d;E.PositionAndShape.BorderBottom+=d}createMusicPage(){const E=new l.GraphicalMusicPage(this.graphicalMusicSheet);return this.graphicalMusicSheet.MusicPages.push(E),E.PageNumber=this.graphicalMusicSheet.MusicPages.length,E.PositionAndShape.BorderLeft=0,E.PositionAndShape.BorderRight=this.graphicalMusicSheet.ParentMusicSheet.pageWidth,E.PositionAndShape.BorderTop=0,E.PositionAndShape.BorderBottom=this.rules.PageHeight,E.PositionAndShape.RelativePosition=new i.PointF2D(0,0),E}addSystemToPage(E,y){E.MusicSystems.push(y),y.Parent=E}optimizeDistanceBetweenStaffLines(E){if(!E.checkStaffEntriesForStaffEntryLink())for(let S=0;S<E.StaffLines.length-1;S++){const M=E.StaffLines[S].BottomLine,x=E.StaffLines[S+1].SkyLine;let _=0;for(let T=0;T<M.length;T++){const A=M[T],v=Math.max(0,T-6),B=Math.min(x.length-1,T+6);let D=0;for(let F=v;F<=B;
1F++)D=Math.min(D,x[F]);_=Math.max(A-D,_)}_+=this.rules.MinSkyBottomDistBetweenStaves,_=Math.max(_,this.rules.StaffHeight+this.rules.MinimumStaffLineDistance),this.updateStaffLinesRelativePosition(E,S+1,_+E.StaffLines[S].PositionAndShape.RelativePosition.y)}const y=E.StaffLines[0];E.PositionAndShape.BorderTop=y.PositionAndShape.RelativePosition.y+y.PositionAndShape.BorderTop;const d=E.StaffLines[E.StaffLines.length-1];E.PositionAndShape.BorderBottom=d.PositionAndShape.RelativePosition.y+d.PositionAndShape.BorderBottom}calculateMusicSystemsRelativePositions(){let E=this.createMusicPage(),y=0,d=this.musicSystems[0],S=0;for(let M=0;M<this.musicSystems.length;M++)if(d=this.musicSystems[M],0===E.MusicSystems.length){this.addSystemToPage(E,d),y=this.rules.CompactMode?this.rules.PageTopMarginNarrow:this.rules.PageTopMargin,1===this.graphicalMusicSheet.MusicPages.length&&this.rules.RenderTitle&&(y+=this.rules.TitleTopDistance+this.rules.SheetTitleHeight+this.rules.TitleBottomDistance);const x=new i.PointF2D(this.rules.PageLeftMargin+this.rules.SystemLeftMargin,y);d.PositionAndShape.RelativePosition=x,y+d.PositionAndShape.BorderBottom>this.rules.PageHeight-this.rules.PageBottomMargin&&(S++,S<=4&&console.log(`warning: could not fit a single system on page ${E.PageNumber} and measure number ${d.GraphicalMeasures[0][0].MeasureNumber}.\n The PageFormat may be too small for this sheet."\n Will not give further warnings for all pages, only total.`))}else{const x=this.musicSystems[M-1],_=x.StaffLines[x.StaffLines.length-1],I=_.PositionAndShape;let T=this.findRequiredDistanceWithSkyBottomLine(x,d);T+=this.rules.MinSkyBottomDistBetweenSystems,T=Math.max(T,this.rules.MinimumDistanceBetweenSystems+_.StaffHeight);const A=y+I.RelativePosition.y+T;if(this.rules.NewPageAtXMLNewPageAttribute&&x.breaksPage||!(A+d.PositionAndShape.BorderMarginBottom<this.rules.PageHeight-this.rules.PageBottomMargin)){E=this.createMusicPage(),M-=1;continue}{this.addSystemToPage(E,d),y=A;const B=new i.PointF2D(this.rules.PageLeftMargin+this.rules.SystemLeftMargin,y);d.PositionAndShape.RelativePosition=B}}S>0&&console.log(`total amount of pages that couldn't fit a single music system: ${S} of ${E.PageNumber}`)}findRequiredDistanceWithSkyBottomLine(E,y){const d=E.StaffLines[E.StaffLines.length-1],S=y.StaffLines[0],M=d.BottomLine,x=S.SkyLine,_=d.PositionAndShape,I=S.PositionAndShape,T=1/this.rules.SamplingUnit;let A=0;for(let v=0;v<M.length;v++){const B=M[v],D=v+Math.round((_.RelativePosition.x-I.RelativePosition.x)*T);if(D<0)continue;if(D>=x.length)break;const L=Math.max(0,D-6),F=Math.min(x.length-1,D+6);let V=0;for(let P=L;P<=F;P++)V=Math.min(V,x[P]);A=Math.max(B-V,A)}return 0===A&&(A=_.BorderBottom-I.BorderTop),A}};class p{constructor(){this.systemMeasures=[],this.systemMeasureIndex=0,this.currentWidth=0,this.currentSystemFixWidth=0,this.currentSystemVarWidth=0,this.maxLabelLength=0}IsSystemStartMeasure(){return 0===this.systemMeasureIndex}}g.SystemBuildParameters=p,g.MeasureBuildParameters=class{}},8033(dt,g){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.OctaveShiftParams=void 0,g.OctaveShiftParams=class{constructor(u,l,s){this.getOpenOctaveShift=u,this.getAbsoluteStartTimestamp=l,this.getAbsoluteEndTimestamp=s}}},735(dt,g,u){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.PlainSkyBottomLineBatchCalculatorBackend=void 0;const l=u(5479),s=u(3667);g.PlainSkyBottomLineBatchCalculatorBackend=class c extends s.SkyBottomLineBatchCalculatorBackend{constructor(i,o){super(i,o)}getPreferredRenderingConfiguration(i,o){return{elementWidth:Math.ceil(i),numColumns:6,numRows:6}}onInitialize(i){}calculateFromCanvas(i,o,n,h,e){const f=i.width,m=o.getImageData(0,0,i.width,i.height),{elementWidth:p,elementHeight:E,numColumns:y}=e,d=[];for(let S=0;S<n.length;++S){const M=n[S],x=Math.floor(M.getVFStave().getWidth()),_=Math.max(Math.ceil(M.PositionAndShape.Size.width*h),1),I=S%y*p,T=I+x,A=Math.floor(S/y)*E,v=A+E,B=new Array(Math.max(_,x)).fill(0),D=new Array(Math.max(_,x)).fill(0);for(let V=I;V<T;++V){B[V-I]=0;for(let j=A;j<v;++j)if(m.data[j*f*4+4*V+3]>0){B[V-I]=j-A;break}D[V-I]=E;for(let j=v-1;j>=A;j--)if(m.data[j*f*4+4*V+3]>0){D[V-I]=j-A;break}}const L=Math.max(...B),F=Math.min(...D);for(let V=0;V<x;++V)B[V]=0===B[V]?L:B[V],D[V]=D[V]===E?F:D[V];d.push(new l.SkyBottomLineCalculationResult(B,D))}return d}}},7624(dt,g,u){"use strict";
vendor: 5,318 bytes, line 1
1Object.defineProperty(g,"__esModule",{value:!0}),g.SelectionEndSymbol=void 0;const l=u(7741),s=u(2683),c=u(9409),r=u(6438),i=u(6452),o=u(813);g.SelectionEndSymbol=class n extends l.GraphicalObject{constructor(e,f){super();const m=f,p=e.PositionAndShape.AbsolutePosition.y,E=o.CollectionUtil.last(e.StaffLines).PositionAndShape.RelativePosition.y+4;this.verticalLine=new i.GraphicalLine(new c.PointF2D(m,p),new c.PointF2D(m,p+E),.4,s.OutlineAndFillStyleEnum.SelectionSymbol);for(let y=0,d=e.StaffLines.length;y<d;++y){const M=new c.PointF2D(m,p+e.StaffLines[y].PositionAndShape.RelativePosition.y),x=new Array(3);M.y-=.2,x[0].x=M.x-3,x[0].y=M.y+1.2,x[1].x=M.x-2,x[1].y=M.y+.4,x[2].x=M.x-2,x[2].y=M.y+2,this.arrows.push(x);const _=new Array(8),I=.8;M.x-=.1,M.y+=.3;const T=.2;_[0].x=M.x-2,_[0].y=M.y+1.5-T,_[1].x=M.x-1,_[1].y=M.y+1.5-T,_[2].x=M.x-1,_[2].y=M.y+2.5,_[3].x=M.x-2,_[3].y=M.y+2.5,_[4].x=_[0].x,_[4].y=_[0].y-I,_[5].x=_[4].x+I+1,_[5].y=_[4].y,_[6].x=_[5].x,_[6].y=_[3].y+I,_[7].x=_[3].x,_[7].y=_[6].y,this.arrowlines.push(_)}this.boundingBox=new r.BoundingBox(this),this.boundingBox.AbsolutePosition=new c.PointF2D(m,p),this.boundingBox.BorderLeft=-.4,this.boundingBox.BorderRight=4,this.boundingBox.BorderBottom=E}}},8713(dt,g,u){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.SelectionStartSymbol=void 0;const l=u(9409),s=u(2683),c=u(6452),r=u(7741),i=u(6438),o=u(813);g.SelectionStartSymbol=class n extends r.GraphicalObject{constructor(e,f){super();const m=f,p=e.PositionAndShape.AbsolutePosition.y,E=o.CollectionUtil.last(e.StaffLines).PositionAndShape.RelativePosition.y+4;this.verticalLine=new c.GraphicalLine(new l.PointF2D(m,p),new l.PointF2D(m,p+E),.4,s.OutlineAndFillStyleEnum.SelectionSymbol);for(let y=0,d=e.StaffLines.length;y<d;++y){const M=new l.PointF2D(m,p+e.StaffLines[y].PositionAndShape.RelativePosition.y),x=new Array(7);x[0].x=M.x+4,x[0].y=M.y+2,x[1].x=M.x+2.5,x[1].y=M.y+.5,x[2].x=M.x+2.5,x[2].y=M.y+1.3,x[3].x=M.x+1,x[3].y=M.y+1.3,x[4].x=M.x+1,x[4].y=M.y+2.7,x[5].x=M.x+2.5,x[5].y=M.y+2.7,x[6].x=M.x+2.5,x[6].y=M.y+3.5,this.arrows.push(x)}this.boundingBox=new i.BoundingBox(this),this.boundingBox.AbsolutePosition=new l.PointF2D(m,p),this.boundingBox.BorderLeft=-.4,this.boundingBox.BorderRight=4,this.boundingBox.BorderBottom=E}}},1327(dt,g,u){"use strict";var l=this&&this.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(g,"__esModule",{value:!0}),g.SkyBottomLineBatchCalculator=void 0;const s=u(5955),c=u(735),r=u(3508),i=l(u(3065)),o=u(813);g.SkyBottomLineBatchCalculator=class{constructor(n,h){const e=new Map;for(const f of n){const m=f.ParentMusicSystem.rules;(()=>{if(e.has(m))return e.get(m);{const p=[];return e.set(m,p),p}})().push({skyBottomLineCalculator:f.SkyBottomLineCalculator,measures:f.Measures})}this.batches=new Map;for(const[f,m]of e.entries()){const p=o.CollectionUtil.flat(m.map(y=>y.measures)),E=(()=>{if(h===s.SkyBottomLineBatchCalculatorBackendType.Plain)return new c.PlainSkyBottomLineBatchCalculatorBackend(f,p).initialize();try{return new r.WebGLSkyBottomLineBatchCalculatorBackend(f,p).initialize()}catch{return i.default.info("Couldn't create WebGLBackend for Skyline. Using fallback."),new c.PlainSkyBottomLineBatchCalculatorBackend(f,p).initialize()}})();E.initialize(),this.batches.set(f,{backend:E,entries:m})}}calculateLines(){for(const[,{backend:n,entries:h}]of this.batches){const e=n.calculateLines();let f=0;for(const{skyBottomLineCalculator:m,measures:p}of h){const E=f+p.length;m.updateLines(e.slice(f,E)),f=E}}}}},3667(dt,g,u){"use strict";var l=this&&this.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(g,"__esModule",{value:!0}),g.SkyBottomLineBatchCalculatorBackend=void 0;const s=u(9834),c=l(u(3065));g.SkyBottomLineBatchCalculatorBackend=class{constructor(r,i){this.elementHeight=300,this.canvas=new s.CanvasVexFlowBackend(r),this.measures=i,this.maxWidth=Math.max(...this.measures.map(o=>{let n=o.getVFStave().getWidth();return n>0||o.IsExtraGraphicalMeasure||(c.default.warn("SkyBottomLineBatchCalculatorBackend: width not > 0 in measure "+o.MeasureNumber),n=50),n})),this.samplingUnit=r.SamplingUnit}initialize(){if(this.tableConfiguration={...this.getPreferredRenderingConfiguration(this.maxWidth,this.elementHeight),elementHeight:this.elementHeight},this.tableConfiguration.numRows<1||this.tableConfiguration.numColumns<1)throw c.default.warn("SkyBottomLineBatchCalculatorBackend: numRows or numColumns in tableConfiguration is 0"),new Error("numRows or numColumns in tableConfiguration is 0");return this.tableConfiguration.elementWidth<this.maxWidth&&c.default.warn("SkyBottomLineBatchCalculatorBackend: elementWidth in tableConfiguration is less than the width of widest measure"),this.canvas.initializeHeadless(this.tableConfiguration.elementWidth*this.tableConfiguration.numColumns,this.elementHeight*this.tableConfiguration.numRows),this.onInitialize(this.tableConfiguration),this}calculateLines(){const{numColumns:r,numRows:i,elementWidth:o}=this.tableConfiguration,n=this.elementHeight,h=r*i,e=this.canvas.getContext(),f=e,m=this.canvas.getCanvas(),p=[];for(let E=0;E<this.measures.length;E+=h){e.clear();const y=this.measures.slice(E,E+h);for(let S=0;S<y.length;++S){const M=y[S],x=M.getVFStave(),_=S%r,I=Math.floor(S/r);
1let T=x.getWidth();T>0||M.IsExtraGraphicalMeasure||(T=50),T=Math.floor(T),M.PositionAndShape.calculateAbsolutePositionsRecursive(0,0),x.setX(0),x.setY(x.y+100);const B=x.getWidth();x.setWidth(T),M.format(),x.setWidth(B);try{f.translate(_*o,I*n),M.draw(e),f.translate(-_*o,-I*n)}catch(D){c.default.warn("SkyBottomLineBatchCalculatorBackend.calculateLines.draw",D)}}const d=this.calculateFromCanvas(m,e,y,this.samplingUnit,this.tableConfiguration);p.push(...d)}return p}}},5479(dt,g){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.SkyBottomLineCalculationResult=void 0,g.SkyBottomLineCalculationResult=class{constructor(u,l){this.skyLine=u,this.bottomLine=l}}},2779(dt,g,u){"use strict";var l=this&&this.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(g,"__esModule",{value:!0}),g.SkyBottomLineCalculator=void 0,u(9409);const s=u(9479),c=l(u(3065)),r=u(5479),i=u(9834);g.SkyBottomLineCalculator=class{constructor(o){this.mStaffLineParent=o,this.mRules=o.ParentMusicSystem.rules}updateLines(o){const n=this.StaffLineParent.Measures;if(o.length!==n.length)if(c.default.warn("SkyBottomLineCalculator: lengths of calculation result array and measure array do not match"),o.length<n.length)for(;o.length<n.length;)o.push(new r.SkyBottomLineCalculationResult([],[]));else o=o.slice(0,n.length);const h=Math.max(Math.ceil(this.StaffLineParent.PositionAndShape.Size.width*this.SamplingUnit),1);this.mSkyLine=[],this.mBottomLine=[];for(const{skyLine:y,bottomLine:d}of o)this.mSkyLine.push(...y),this.mBottomLine.push(...d);const e=this.mSkyLine.length/h,f=[],m=[];for(let y=0;y<this.mSkyLine.length&&f.length!==h;y+=e){const d=Math.min(this.mSkyLine.length,y+e);let S=this.mSkyLine.slice(y,d+1);f.push(Math.min(...S)),S=this.mBottomLine.slice(y,d+1),m.push(Math.max(...S))}this.mSkyLine=f,this.mBottomLine=m,this.mSkyLine.length!==h&&c.default.debug(`SkyLine calculation was not correct (${this.mSkyLine.length} instead of ${h})`);const p=Math.max(...this.mSkyLine);this.mSkyLine=this.mSkyLine.map(y=>(y-p)/s.unitInPixels+this.StaffLineParent.TopLineOffset);const E=Math.min(...this.mBottomLine);this.mBottomLine=this.mBottomLine.map(y=>(y-E)/s.unitInPixels+this.StaffLineParent.BottomLineOffset)}calculateLines(){const o=this.mRules.SamplingUnit,n=[],h=new i.CanvasVexFlowBackend(this.mRules);for(const e of this.StaffLineParent.Measures){e.PositionAndShape.calculateAbsolutePositionsRecursive(0,0);const f=e.getVFStave();let m=f.getWidth();m>0||e.IsExtraGraphicalMeasure||(c.default.warn("SkyBottomLineCalculator: width not > 0 in measure "+e.MeasureNumber),m=50),h.initializeHeadless(m);const p=h.getContext(),E=h.getCanvas();m=E.width;const y=E.height;f.setY(f.y+100);const d=f.getWidth();f.setWidth(m),e.format(),f.setWidth(d);try{e.draw(p)}catch(T){c.default.warn("SkyBottomLineCalculator.calculateLines.draw",T)}const S=p.getImageData(0,0,m,y),M=4,x=Math.max(Math.ceil(e.PositionAndShape.Size.width*o),1),_=new Array(x),I=new Array(x);for(let T=0;T<m;T++){for(let A=0;A<y;A++)if(S.data[A*m*M+T*M+3]>0){_[T]=A;break}for(let A=y;A>0;A--)if(S.data[A*m*M+T*M+3]>0){I[T]=A;break}}for(let T=0;T<_.length;T++)void 0===_[T]&&(_[T]=Math.max(this.findPreviousValidNumber(T,_),this.findNextValidNumber(T,_)));for(let T=0;T<I.length;T++)void 0===I[T]&&(I[T]=Math.max(this.findPreviousValidNumber(T,I),this.findNextValidNumber(T,I)));n.push(new r.SkyBottomLineCalculationResult(_,I)),h.clear()}this.updateLines(n)}updateSkyLineWithLine(o,n,h){const e=Math.floor(o.x*this.SamplingUnit),f=Math.ceil(n.x*this.SamplingUnit);for(let m=e+1;m<Math.min(f,this.SkyLine.length);m++)this.SkyLine[m]=h}updateSkyLineWithWedge(o,n){let h=Math.floor(o.x*this.SamplingUnit),e=Math.ceil(n.x*this.SamplingUnit),f=(n.y-o.y)/(n.x-o.x);e-h<=1&&(e++,f=0),h<0&&(h=0),h>=this.BottomLine.length&&(h=this.BottomLine.length-1),e<0&&(e=0),e>=this.BottomLine.length&&(e=this.BottomLine.length),this.SkyLine[h]=o.y;for(let m=h+1;m<Math.min(e,this.SkyLine.length);m++)this.SkyLine[m]=this.SkyLine[m-1]+f/this.SamplingUnit}updateBottomLineWithWedge(o,n){let h=Math.floor(o.x*this.SamplingUnit),e=Math.ceil(n.x*this.SamplingUnit),f=(n.y-o.y)/(n.x-o.x);e-h<=1&&(e++,f=0),h<0&&(h=0),h>=this.BottomLine.length&&(h=this.BottomLine.length-1),e<0&&(e=0),e>=this.BottomLine.length&&(e=this.BottomLine.length),this.BottomLine[h]=o.y;for(let m=h+1;m<e;m++)this.BottomLine[m]=this.BottomLine[m-1]+f/this.SamplingUnit}updateSkyLineInRange(o,n,h){this.updateInRange(this.mSkyLine,o,n,h)}updateBottomLineInRange(o,n,h){this.updateInRange(this.BottomLine,o,n,h)}resetSkyLineInRange(o,n){this.updateInRange(this.SkyLine,o,n)}resetBottomLineInRange(o,n){this.setInRange(this.BottomLine,o,n)}setSkyLineWithValue(o){this.SkyLine.forEach(n=>o)}setBottomLineWithValue(o){this.BottomLine.forEach(n=>o)}getLeftIndexForPointX(o,n){const h=Math.floor(o*this.SamplingUnit);return h<0?0:h>=n?n-1:h}getRightIndexForPointX(o,n){const h=Math.ceil(o*this.SamplingUnit);return h<0?0:h>=n?n-1:h}updateStaffLineBorders(){this.mStaffLineParent.PositionAndShape.BorderTop=this.getSkyLineMin(),this.mStaffLineParent.PositionAndShape.BorderMarginTop=this.getSkyLineMin(),this.mStaffLineParent.PositionAndShape.BorderBottom=this.getBottomLineMax(),this.mStaffLineParent.PositionAndShape.BorderMarginBottom=this.getBottomLineMax()}getSkyLineMin(){return Math.min(...this.SkyLine.filter(o=>!isNaN(o)))}getSkyLineMinAtPoint(o){const n=Math.round(o*this.SamplingUnit);return this.mSkyLine[n]}getSkyLineMinInRange(o,n){return this.getMinInRange(this.SkyLine,o,n)}getBottomLineMax(){return Math.max(...this.BottomLine.filter(o=>!isNaN(o)))}getBottomLineMaxAtPoint(o){const n=Math.round(o*this.SamplingUnit);return this.mBottomLine[n]}getBottomLineMaxInRange(o,n){return this.getMaxInRange(this.BottomLine,o,n)}getBottomLineMaxInBoundingBox(o){const n=Math.floor(o.AbsolutePosition.x+o.BorderLeft),h=Math.ceil(o.AbsolutePosition.x+o.BorderRight);return this.getMaxInRange(this.mBottomLine,n,h)}updateWithBoundingBoxRecursively(o){if(o.ChildElements&&o.ChildElements.length>0)this.updateWithBoundingBoxRecursively(o);else{const n=o.BorderTop+o.AbsolutePosition.y,h=o.BorderBottom+o.AbsolutePosition.y;if(n<0){const e=Math.floor(o.AbsolutePosition.x+o.BorderLeft),f=Math.ceil(o.AbsolutePosition.x+o.BorderRight);this.updateInRange(this.mSkyLine,e,f,n)}else if(h>this.StaffLineParent.StaffHeight){const e=Math.floor(o.AbsolutePosition.x+o.BorderLeft),f=Math.ceil(o.AbsolutePosition.x+o.BorderRight);this.updateInRange(this.mBottomLine,e,f,h)}}}findPreviousValidNumber(o,n){for(let h=o;h>=0;h--)if(!isNaN(n[h]))return n[h];return 0}findNextValidNumber(o,n){if(o>=n.length)return n[o-1];for(let h=o;h<n.length;h++)if(!isNaN(n[h]))return n[h];return 0}drawPixel(o,n,h="#FF0000FF"){const e=n.getContext(),f=e.fillStyle;e.fillStyle=h,e.fillRect(o.x,o.y,2,2),e.fillStyle=f}updateInRange(o,n=0,h=o.length,e=0){if(n=Math.floor(n*this.SamplingUnit),(h=Math.ceil(h*this.SamplingUnit))<n)throw new Error("start index of line is greater than the end index");n<0&&(n=0),h>o.length&&(h=o.length);for(let f=n;f<h;f++)o[f]=Math.abs(e)>Math.abs(o[f])?e:o[f]}setInRange(o,n=0,h=o.length,e=0){if(n=Math.floor(n*this.SamplingUnit),(h=Math.ceil(h*this.SamplingUnit))<n)throw new Error("start index of line is greater then the end index");n<0&&(n=0),h>o.length&&(h=o.length);for(let f=n;f<h;f++)o[f]=e}getMinInRange(o,n,h){return n=Math.floor(n*this.SamplingUnit),h=Math.ceil(h*this.SamplingUnit),o?(n<0&&(n=0),n>=o.length&&(n=o.length-1),h<0&&(h=0),h>=o.length&&(h=o.length),n>=0&&h<=o.length?Math.min(...o.slice(n,h+1)):void 0):Number.MAX_VALUE}getMaxInRange(o,n,h){return n=Math.floor(n*this.SamplingUnit),h=Math.ceil(h*this.SamplingUnit),o?(n<0&&(n=0),n>=o.length&&(n=o.length-1),h<0&&(h=0),h>=o.length&&(h=o.length),n>=0&&h<=o.length?Math.max(...o.slice(n,h+1)):void 0):Number.MIN_VALUE}get SamplingUnit(){return this.mRules.SamplingUnit}get StaffLineParent(){return this.mStaffLineParent}get SkyLine(){return this.mSkyLine}get BottomLine(){return this.mBottomLine}}},2919(dt,g,u){"use strict";
1Object.defineProperty(g,"__esModule",{value:!0}),g.StaffLine=void 0;const l=u(6438),s=u(7741),c=u(298),r=u(9409),i=u(2779);g.StaffLine=class o extends s.GraphicalObject{constructor(h,e){super(),this.measures=[],this.staffLines=new Array(5),this.octaveShifts=[],this.lyricLines=[],this.lyricsDashes=[],this.abstractExpressions=[],this.graphicalSlurs=[],this.graphicalGlissandi=[],this.Pedals=[],this.WavyLines=[],this.parentMusicSystem=h,this.parentStaff=e,this.boundingBox=new l.BoundingBox(this,h.PositionAndShape),this.skyBottomLine=new i.SkyBottomLineCalculator(this),this.staffHeight=this.parentMusicSystem.rules.StaffHeight,this.topLineOffset=0,this.bottomLineOffset=4,this.calculateStaffLineOffsets()}calculateStaffLineOffsets(){if(this.ParentStaff.isTab)this.staffHeight=this.bottomLineOffset=5===this.ParentStaff.StafflineCount?6*this.ParentStaff.ParentInstrument.GetMusicSheet.Rules.TabStaffInterlineHeight:this.ParentStaff.ParentInstrument.GetMusicSheet.Rules.TabStaffInterlineHeight*this.ParentStaff.StafflineCount;else switch(this.ParentStaff.StafflineCount){case 4:this.bottomLineOffset=1;break;case 3:this.topLineOffset=1,this.bottomLineOffset=1;break;case 2:this.topLineOffset=2,this.bottomLineOffset=1;break;case 1:this.topLineOffset=2,this.bottomLineOffset=2}}get Measures(){return this.measures}set Measures(h){this.measures=h}get StaffLines(){return this.staffLines}set StaffLines(h){this.staffLines=h}get NextStaffLine(){const h=this.parentMusicSystem.StaffLines.indexOf(this);return h!==this.parentMusicSystem.StaffLines.length?this.parentMusicSystem.StaffLines[h+1]:void 0}get LyricLines(){return this.lyricLines}get AbstractExpressions(){return this.abstractExpressions}set AbstractExpressions(h){this.abstractExpressions=h}set LyricLines(h){this.lyricLines=h}get LyricsDashes(){return this.lyricsDashes}set LyricsDashes(h){this.lyricsDashes=h}get ParentMusicSystem(){return this.parentMusicSystem}set ParentMusicSystem(h){this.parentMusicSystem=h}get ParentStaff(){return this.parentStaff}set ParentStaff(h){this.parentStaff=h}get SkyBottomLineCalculator(){return this.skyBottomLine}get SkyLine(){return this.skyBottomLine.SkyLine}get BottomLine(){return this.skyBottomLine.BottomLine}get OctaveShifts(){return this.octaveShifts}set OctaveShifts(h){this.octaveShifts=h}get StaffHeight(){return this.staffHeight}get TopLineOffset(){return this.topLineOffset}get BottomLineOffset(){return this.bottomLineOffset}get GraphicalSlurs(){return this.graphicalSlurs}get GraphicalGlissandi(){return this.graphicalGlissandi}addSlurToStaffline(h){this.graphicalSlurs.push(h)}addGlissandoToStaffline(h){this.graphicalGlissandi.push(h),h.StaffLine=this}addActivitySymbolClickArea(){const h=new c.StaffLineActivitySymbol(this),e=this.PositionAndShape;h.PositionAndShape.RelativePosition=new r.PointF2D(e.RelativePosition.x+e.BorderRight+.5,e.RelativePosition.y+.5),h.PositionAndShape.Parent=this.parentMusicSystem.PositionAndShape}isPartOfMultiStaffInstrument(){return this.parentStaff.ParentInstrument.Staves.length>1}findClosestStaffEntry(h){let e;for(let f=0,m=this.Measures.length;f<m;++f){const p=this.Measures[f];for(let E=0,y=p.staffEntries.length;E<y;++E){const d=p.staffEntries[E];Math.abs(d.PositionAndShape.RelativePosition.x-h+p.PositionAndShape.RelativePosition.x)<5&&(e=d)}}return e}}},298(dt,g,u){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.StaffLineActivitySymbol=void 0;const l=u(7741),s=u(6438);g.StaffLineActivitySymbol=class c extends l.GraphicalObject{constructor(i){super(),this.parentStaffLine=i,this.boundingBox=new s.BoundingBox(this,i.PositionAndShape),this.boundingBox.BorderRight=6,this.boundingBox.BorderBottom=4.5,this.boundingBox.BorderLeft=-1.5,this.boundingBox.BorderTop=-1.5}}},4284(dt,g,u){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.SystemLine=void 0;const l=u(6954),s=u(6438),c=u(7741);g.SystemLine=class r extends c.GraphicalObject{constructor(o,n,h,e,f=void 0){super(),this.lineType=o,this.linePosition=n,this.parentMusicSystem=h,this.topMeasure=e,this.bottomMeasure=f,this.parentTopStaffLine=e?.ParentStaffLine,this.boundingBox=new s.BoundingBox(this,h.PositionAndShape)}static getObjectWidthForLineType(o,n){switch(n){case l.SystemLinesEnum.SingleThin:return o.SystemThinLineWi
vendor: 4,317 bytes, line 1
1dth;case l.SystemLinesEnum.DoubleThin:return 2*o.SystemThinLineWidth+o.DistanceBetweenVerticalSystemLines;case l.SystemLinesEnum.ThinBold:return o.SystemThinLineWidth+o.SystemBoldLineWidth+o.DistanceBetweenVerticalSystemLines;case l.SystemLinesEnum.BoldThinDots:case l.SystemLinesEnum.DotsThinBold:return o.SystemThinLineWidth+o.SystemBoldLineWidth+o.DistanceBetweenVerticalSystemLines+o.SystemDotWidth+o.DistanceBetweenDotAndLine;case l.SystemLinesEnum.DotsBoldBoldDots:return 2*o.SystemBoldLineWidth+2*o.SystemDotWidth+2*o.DistanceBetweenDotAndLine+o.DistanceBetweenVerticalSystemLines;default:return 0}}}},67(dt,g){"use strict";var u,l;Object.defineProperty(g,"__esModule",{value:!0}),g.SystemLinePosition=void 0,(l=u||(g.SystemLinePosition=u={}))[l.MeasureBegin=0]="MeasureBegin",l[l.MeasureEnd=1]="MeasureEnd"},6954(dt,g){"use strict";var u,l;Object.defineProperty(g,"__esModule",{value:!0}),g.SystemLinesEnumHelper=g.SystemLinesEnum=void 0,(l=u||(g.SystemLinesEnum=u={}))[l.SingleThin=0]="SingleThin",l[l.DoubleThin=1]="DoubleThin",l[l.ThinBold=2]="ThinBold",l[l.BoldThinDots=3]="BoldThinDots",l[l.DotsThinBold=4]="DotsThinBold",l[l.DotsBoldBoldDots=5]="DotsBoldBoldDots",l[l.None=6]="None",l[l.Dotted=7]="Dotted",l[l.Dashed=8]="Dashed",l[l.Bold=9]="Bold",l[l.BoldThin=10]="BoldThin",l[l.DoubleBold=11]="DoubleBold",l[l.Tick=12]="Tick",l[l.Short=13]="Short",g.SystemLinesEnumHelper=class{static xmlBarlineStyleToSystemLinesEnum(l){return"regular"===l?u.SingleThin:"dotted"===l?u.Dotted:"dashed"===l?u.Dashed:"heavy"===l?u.Bold:"light-light"===l?u.DoubleThin:"light-heavy"===l?u.ThinBold:"heavy-light"===l?u.BoldThin:"heavy-heavy"===l?u.DoubleBold:"tick"===l?u.Tick:"short"===l?u.Short:"none"===l?u.None:u.SingleThin}}},6723(dt,g){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.VerticalGraphicalStaffEntryContainer=void 0,g.VerticalGraphicalStaffEntryContainer=class{constructor(u,l){this.staffEntries=[],this.absoluteTimestamp=l,this.staffEntries=new Array(u)}get Index(){return this.index}set Index(u){this.index=u}get AbsoluteTimestamp(){return this.absoluteTimestamp}get StaffEntries(){return this.staffEntries}set StaffEntries(u){this.staffEntries=u}static compareByTimestamp(u,l){const s=u.absoluteTimestamp.RealValue,c=l.absoluteTimestamp.RealValue;return s<c?-1:s>c?1:0}getFirstNonNullStaffEntry(){for(let u=0,l=this.staffEntries.length;u<l;++u){const s=this.staffEntries[u];if(s)return s}}}},1083(dt,g,u){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.AlignmentManager=void 0;const l=u(2400),s=u(9409);g.AlignmentManager=class{constructor(c){this.parentStaffline=c,this.rules=this.parentStaffline.ParentMusicSystem.rules}alignDynamicExpressions(){const c=[];let r=new Array;for(let i=0;i<this.parentStaffline.AbstractExpressions.length-1;i++){const o=this.parentStaffline.AbstractExpressions[i],n=this.parentStaffline.AbstractExpressions[i+1],h=o?.SourceExpression?.Placement,e=n?.SourceExpression?.Placement;if(h===e){const f=this.getDistance(o.PositionAndShape,n.PositionAndShape);Math.abs(f.x)<this.rules.DynamicExpressionMaxDistance?(-1===r.indexOf(o)&&r.push(o),r.push(n)):(c.push(r),r=new Array)}}c.push(r);for(const i of c)if(i.length>0){const o=i.map(h=>h.PositionAndShape.Center.y),n=Math.max(...o);for(let h=0;h<i.length;h++){const e=i[h],f=o[h]-n;if(e instanceof l.VexFlowContinuousDynamicExpression?(e.shiftYPosition(-f),e.calcPsi()):(e.PositionAndShape.RelativePosition.y-=.8*f,e.PositionAndShape.calculateBoundingBox()),e.squeeze){const m=h<i.length-1?i[h+1]:void 0,p=h>0?i[h-1]:void 0;if(m){const E=this.getOverlap(e.PositionAndShape,m.PositionAndShape);e.squeeze(-(E.x+this.rules.DynamicExpressionSpacer))}if(p){const E=this.getOverlap(p.PositionAndShape,e.PositionAndShape);e.squeeze(E.x+this.rules.DynamicExpressionSpacer)}}}}}getDistance(c,r){return new s.PointF2D(r.RelativePosition.x+r.BorderMarginLeft-(c.RelativePosition.x+c.BorderMarginRight),r.RelativePosition.y+r.BorderMarginTop-(c.RelativePosition.y+c.BorderMarginBottom))}getOverlap(c,r){return new s.PointF2D(c.RelativePosition.x+c.BorderMarginRight-(r.RelativePosition.x+r.BorderMarginLeft),c.RelativePosition.y+c.BorderMarginBottom-(r.RelativePosition.y+r.BorderMarginTop))}}},9834(dt,g,u){"use strict";var l=this&&this.__importDefault||function(h){return h&&h.__esModule?h:{default:h}};
1Object.defineProperty(g,"__esModule",{value:!0}),g.CanvasVexFlowBackend=void 0;var s=l(u(3206)).default.Flow;const c=u(1902),r=u(6014),i=u(624),o=u(1888);g.CanvasVexFlowBackend=class n extends c.VexFlowBackend{constructor(e){super(),this.rules=e}getVexflowBackendType(){return s.Renderer.Backends.CANVAS}getOSMDBackendType(){return i.BackendType.Canvas}getCanvasSize(){return document.getElementById("osmdCanvasPage"+this.graphicalMusicPage.PageNumber)?.offsetHeight}initialize(e,f){this.zoom=f,this.canvas=document.createElement("canvas"),this.graphicalMusicPage||(this.graphicalMusicPage=new o.GraphicalMusicPage(void 0),this.graphicalMusicPage.PageNumber=1),this.canvas.id="osmdCanvasVexFlowBackendCanvas"+this.graphicalMusicPage.PageNumber,this.inner=document.createElement("div"),this.inner.id="osmdCanvasPage"+this.graphicalMusicPage.PageNumber,this.inner.style.position="relative",this.canvas.style.zIndex="0",this.inner.appendChild(this.canvas),e.appendChild(this.inner),this.renderer=new s.Renderer(this.canvas,this.getVexflowBackendType()),this.ctx=this.renderer.getContext()}initializeHeadless(e=300,f=300){this.graphicalMusicPage||(this.graphicalMusicPage=new o.GraphicalMusicPage(void 0),this.graphicalMusicPage.PageNumber=1),this.canvas=document.createElement("canvas"),this.canvas.width=e,this.canvas.height=f,this.renderer=new s.Renderer(this.canvas,this.getVexflowBackendType()),this.ctx=this.renderer.getContext()}getContext(){return this.ctx}free(){this.canvas&&(this.canvas.width=0,this.canvas.height=0,this.canvas.remove(),delete this.canvas,this.canvas=null)}clear(){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.rules.PageBackgroundColor&&(this.ctx.save(),this.ctx.setFillStyle(this.rules.PageBackgroundColor),this.zoom=1,this.ctx.fillRect(0,0,this.canvas.width/this.zoom,this.canvas.height/this.zoom),this.ctx.restore())}scale(e){this.ctx.scale(e,e)}translate(e,f){this.CanvasRenderingCtx.translate(e,f)}renderText(e,f,m,p,E,y,d=void 0,S=void 0){const M=this.CanvasRenderingCtx.font;this.CanvasRenderingCtx.save(),this.CanvasRenderingCtx.font=r.VexFlowConverter.font(e,f,m,this.rules,S),this.CanvasRenderingCtx.fillStyle=d,this.CanvasRenderingCtx.strokeStyle=d,this.CanvasRenderingCtx.fillText(p,y.x,y.y+E),this.CanvasRenderingCtx.restore(),this.CanvasRenderingCtx.font=M}renderRectangle(e,f,m,p=1){const E=this.CanvasRenderingCtx.fillStyle;this.CanvasRenderingCtx.fillStyle=m||r.VexFlowConverter.style(f),this.CanvasRenderingCtx.globalAlpha=p,this.ctx.fillRect(e.x,e.y,e.width,e.height),this.CanvasRenderingCtx.fillStyle=E,this.CanvasRenderingCtx.globalAlpha=1}renderLine(e,f,m="#FF0000FF",p=2,E){const y=this.CanvasRenderingCtx.strokeStyle;this.CanvasRenderingCtx.strokeStyle=m,this.CanvasRenderingCtx.beginPath(),this.CanvasRenderingCtx.moveTo(e.x,e.y),this.CanvasRenderingCtx.lineTo(f.x,f.y),this.CanvasRenderingCtx.stroke(),this.CanvasRenderingCtx.strokeStyle=y}renderCurve(e){this.ctx.beginPath(),this.ctx.moveTo(e[0].x,e[0].y),this.ctx.bezierCurveTo(e[1].x,e[1].y,e[2].x,e[2].y,e[3].x,e[3].y),this.ctx.lineTo(e[7].x,e[7].y),this.ctx.bezierCurveTo(e[6].x,e[6].y,e[5].x,e[5].y,e[4].x,e[4].y),this.ctx.lineTo(e[0].x,e[0].y),this.ctx.closePath(),this.ctx.fill()}renderPath(e,f=!0,m){let p;this.ctx.beginPath();for(const E of e)p?this.ctx.lineTo(E.x,E.y):(this.ctx.moveTo(E.x,E.y),p=E);this.ctx.closePath(),f?this.ctx.fill():this.ctx.stroke()}get CanvasRenderingCtx(){return this.ctx.vexFlowCanvasContext}}},9436(dt,g,u){"use strict";var l=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(g,"__esModule",{value:!0}),g.SvgVexFlowBackend=void 0;var s=l(u(3206)).default.Flow;const c=u(1902),r=u(6014),i=u(2570),o=u(624),n=l(u(3065));g.SvgVexFlowBackend=class h extends c.VexFlowBackend{constructor(f){super(),this.rules=f}getVexflowBackendType(){return s.Renderer.Backends.SVG}getOSMDBackendType(){return o.BackendType.SVG}getCanvasSize(){return document.getElementById("osmdCanvasPage"+this.graphicalMusicPage.PageNumber)?.offsetHeight}initialize(f,m){this.zoom=m,this.canvas=document.createElement("div"),this.canvas.id="osmdCanvasPage"+this.graphicalMusicPage.PageNumber,this.inner=this.canvas,this.inner.style.position="relative",this.canvas.style.zIndex="0",f.appendChild(this.inner),this.renderer=new s.Renderer(this.canvas,this.getVexflowBacken
vendor: 15,913 bytes, line 1
1dType()),this.ctx=this.renderer.getContext(),this.ctx.svg.id="osmdSvgPage"+this.graphicalMusicPage.PageNumber}getContext(){return this.ctx}getSvgElement(){return this.ctx.svg}removeNode(f){const m=this.ctx?.svg;if(!m)return!1;try{m.removeChild(f)}catch(p){return n.default.error(p),!1}return!0}free(){const f=this.ctx.svg;for(;f.lastChild;)f.removeChild(f.lastChild)}clear(){this.ctx&&(this.free(),this.rules.PageBackgroundColor&&(this.ctx.svg.style["background-color"]=this.rules.PageBackgroundColor))}scale(f){this.ctx.scale(f,f)}translate(f,m){}renderText(f,m,p,E,y,d,S=void 0,M=void 0){this.ctx.save();const x=this.ctx.openGroup("text");S&&(this.ctx.attributes.fill=S,this.ctx.attributes.stroke=S);let _=M;M&&"default"!==M||(_=this.rules.DefaultFontFamily),this.ctx.setFont(_,f,r.VexFlowConverter.fontStyle(m)),this.ctx.attributes["font-size"]=`${f}px`,this.ctx.state["font-size"]=`${f}px`;let I="normal",T="normal";switch(m){case i.FontStyles.Bold:I="bold";break;case i.FontStyles.Italic:T="italic";break;case i.FontStyles.BoldItalic:I="bold",T="italic";break;default:I="normal"}return this.ctx.attributes["font-weight"]=I,this.ctx.state["font-weight"]=I,this.ctx.attributes["font-style"]=T,this.ctx.state["font-style"]=T,this.ctx.fillText(E,d.x,d.y+y),this.ctx.closeGroup(),this.ctx.restore(),x}renderRectangle(f,m,p,E=1){this.ctx.save();const y=this.ctx.openGroup("rect");return this.ctx.attributes.fill=p||r.VexFlowConverter.style(m),this.ctx.attributes["fill-opacity"]=E,this.ctx.fillRect(f.x,f.y,f.width,f.height),this.ctx.restore(),this.ctx.attributes["fill-opacity"]=1,this.ctx.closeGroup(),y}renderLine(f,m,p="#FF0000FF",E=2,y){this.ctx.save();const d=this.ctx.openGroup("line",y);return this.ctx.beginPath(),this.ctx.moveTo(f.x,f.y),this.ctx.lineTo(m.x,m.y),this.ctx.attributes.stroke=p,this.ctx.lineWidth=E,this.ctx.stroke(),this.ctx.closeGroup(),this.ctx.restore(),d}renderCurve(f,m,p){let E;m&&p&&(E=`${p.getSVGId()}-slur`);const y=this.ctx.openGroup("curve",E);return this.ctx.beginPath(),this.ctx.moveTo(f[0].x,f[0].y),this.ctx.bezierCurveTo(f[1].x,f[1].y,f[2].x,f[2].y,f[3].x,f[3].y),this.ctx.lineTo(f[7].x,f[7].y),this.ctx.bezierCurveTo(f[6].x,f[6].y,f[5].x,f[5].y,f[4].x,f[4].y),this.ctx.lineTo(f[0].x,f[0].y),this.ctx.closePath(),this.ctx.fill(),this.ctx.closeGroup(),y}renderPath(f,m=!0,p){const E=this.ctx.openGroup("path",p);let y;this.ctx.beginPath();for(const d of f)y?this.ctx.lineTo(d.x,d.y):(this.ctx.moveTo(d.x,d.y),y=d);return this.ctx.closePath(),m?this.ctx.fill():this.ctx.stroke(),this.ctx.stroke(),this.ctx.closeGroup(),E}export(){const f=this.ctx.svg.cloneNode(!0),m=document.implementation.createDocumentType("svg","-//W3C//DTD SVG 1.1//EN","http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"),p=document.implementation.createDocument("http://www.w3.org/2000/svg","svg",m);p.replaceChild(f,p.documentElement);const E=(new XMLSerializer).serializeToString(p),y=document.createElement("a");y.href="data:image/svg+xml; charset=utf8, "+encodeURIComponent(E.replace(/></g,">\n\r<")),y.download="opensheetmusicdisplay_download.svg",y.innerHTML=window.location.href+"/download",document.body.appendChild(y)}}},1902(dt,g,u){"use strict";var l=this&&this.__importDefault||function(c){return c&&c.__esModule?c:{default:c}};Object.defineProperty(g,"__esModule",{value:!0}),g.VexFlowBackend=g.VexFlowBackends=void 0;var s=l(u(3206)).default.Flow;g.VexFlowBackends=class{},g.VexFlowBackend=class{getInnerElement(){return this.inner}getCanvas(){return this.canvas}getRenderElement(){let c=this.canvas;return this.getVexflowBackendType()===s.Renderer.Backends.CANVAS&&(c=this.inner),c}getRenderer(){return this.renderer}removeAllChildrenFromContainer(c){for(;0!==c.children.length;)c.removeChild(c.children.item(0))}removeFromContainer(c){const r=this.getRenderElement();for(let i=0;i<c.children.length;i++)if(c.children.item(i)===r){c.removeChild(r);break}}resize(c,r){this.renderer.resize(c,r),this.width=c,this.height=r}}},2400(dt,g,u){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.VexFlowContinuousDynamicExpression=void 0;const l=u(1066),s=u(8254),c=u(7435),r=u(7533),i=u(2570);g.VexFlowContinuousDynamicExpression=class o extends l.GraphicalContinuousDynamicExpression{constructor(h,e,f,m){if(super(h,e,f),this.IsVerbal){const p=new c.Label(h.Label);this.label=new s.GraphicalLabel(p,m||this.rules.ContinuousDynamicTextHeight,r.TextAlignmentEnum.LeftCenter,this.rules,this.PositionAndShape),this.label.Label.fontStyle=i.FontStyles.Italic,this.label.setLabelPositionAndShapeBorders(),this.PositionAndShape.calculateBoundingBox(),h.ColorXML&&this.rules.ExpressionsUseXMLColor&&(this.label.ColorXML=h.ColorXML)}}}},6014(dt,g,u){"use strict";var l=this&&this.__importDefault||function(B){return B&&B.__esModule?B:{default:B}};Object.defineProperty(g,"__esModule",{value:!0}),g.VexFlowConverter=void 0;var s=l(u(3206)).default.Flow;const c=u(164),r=u(8233),i=u(2561),o=u(9288),n=u(4543),h=u(8233),e=u(8233),f=u(6954),m=u(2570),p=u(5951),E=u(2683),y=l(u(3065)),d=u(1336),S=u(67),M=u(8215),x=u(4064),_=u(9479),I=u(4236),T=u(9647),A=u(6362);class v{static durations(D,L){const F=[],V=D.clone();for(;V.RealValue>1e-4;){const j=V.RealValue;if(j>=2)F.push("1/2"),V.Sub(new i.Fraction(2,1));else if(j>=1)F.push("w"),V.Sub(new i.Fraction(1,1));else if(j<1&&j>=.5){if(L&&j>.5)return["w"];F.push("h"),V.Sub(new i.Fraction(1,2))}else if(j<.5&&j>=.25){if(L&&j>.25)return["h"];F.push("q"),V.Sub(new i.Fraction(1,4))}else if(j<.25&&j>=.125){if(L&&j>.125)return["q"];F.push("8"),V.Sub(new i.Fraction(1,8))}else if(j<.125&&j>=.0625){if(L&&j>.0625)return["8"];F.push("16"),V.Sub(new i.Fraction(1,16))}else if(j<.0625&&j>=.03125){if(L&&j>.03125)return["16"];F.push("32"),V.Sub(new i.Fraction(1,32))}else if(j<.03125&&j>=.015625){if(L&&j>.015625)return["32"];F.push("64"),V.Sub(new i.Fraction(1,64))}else{if(L)return["64"];F.push("128"),V.Sub(new i.Fraction(1,128))}}return F}static pitch(D,L,F,V=void 0,j=void 0){let P=j;void 0===j&&(P=3),L&&void 0===j&&(P=0,F.ClefType===c.ClefEnum.F&&(P=2),F.ClefType===c.ClefEnum.C&&(P=2));const U=e.NoteEnum[D.FundamentalNote].toLowerCase(),Y=r.Pitch.accidentalVexflow(D.Accidental),H=D.Octave-F.OctaveOffset+P;let Q="";return V&&(Q=this.NoteHeadCode(V)),[U+"n/"+H+Q,Y,F]}static restToNotePitch(D,L){let F=D.Octave;switch(L){case c.ClefEnum.C:case c.ClefEnum.F:F+=2}return new r.Pitch(D.FundamentalNote,F,h.AccidentalEnum.NONE)}static NoteHeadCode(D){const L=D.Filled?"2":"1";switch(D.Shape){case x.NoteHeadShape.NORMAL:case x.NoteHeadShape.NONE:return"";case x.NoteHeadShape.DIAMOND:return"/D"+L;case x.NoteHeadShape.TRIANGLE:return"/T"+L;case x.NoteHeadShape.TRIANGLE_INVERTED:return"/TI";case x.NoteHeadShape.X:return"/X"+L;case x.NoteHeadShape.CIRCLEX:return"/X3";case x.NoteHeadShape.RECTANGLE:return"/R"+L;case x.NoteHeadShape.SQUARE:return"/S"+L;default:return""}}static GhostNotes(D){const L=[],F=v.durations(D,!1);for(const V of F)L.push(new s.GhostNote({duration:V}));return L}static StaveNote(D){D.sortForVexflow();const L=D.notes,F=D.parentStaffEntry.parentMeasure.parentSourceMeasure.Rules,V=L[0];let j=[];const P=[],U=V.graphicalNoteLength,Y=void 0!==V.sourceNote.NoteTuplet;let H,Q=v.durations(U,Y)[0];void 0!==V.sourceNote.TypeLength&&V.sourceNote.TypeLength!==U&&0!==V.sourceNote.TypeLength.RealValue&&(Q=v.durations(V.sourceNote.TypeLength,Y)[0],V.numberOfDots=V.sourceNote.DotsXml);let ot,$,it=V.numberOfDots,nt=!1,st=0,N=!1;for(const W of L){if(it<W.numberOfDots&&(it=W.numberOfDots),W.sourceNote.isRest()){if(N=!0,W.sourceNote.Pitch){j=[W.vfpitch[0]];break}{j=["b/4"];const K=W.parentVoiceEntry?.parentVoiceEntry;if(K){const q=W.parentVoiceEntry?.parentStaffEntry.parentMeasure.staffEntries;let Z,et,ct=-1;for(let pt=0;pt<q.length;pt++)if(q[pt]?.graphicalVoiceEntries[0]?.parentVoiceEntry===K){ct=pt;break}if(ct>=1&&q.length-1>=ct+1&&(Z=q[ct-1]?.graphicalVoiceEntries[0]?.parentVoiceEntry,et=q[ct+1]?.graphicalVoiceEntries[0]?.parentVoiceEntry,Z&&et)){const pt=Z.Notes[0],gt=et.Notes[0];if(pt.NoteBeam?.Notes.includes(gt)){const Et=Z.Notes.last().Pitch,St=W.Clef();j=[v.pitch(v.restToNotePitch(Et.getTransposedPitch(-2),St.ClefType),!1,St)[0]]}}}}if((W.sourceNote.IsWholeMeasureRest||U.RealValue===W.sourceNote.SourceMeasure.ActiveTimeSignature.RealValue)&&(j=["d/5"],1===D.parentStaffEntry.parentMeasure.ParentStaff.StafflineCount&&(j=["b/4"]),Q="w",it=0,nt=!0,st=F.WholeRestXShiftVexflow*_.unitInPixels),W.sourceNote.ParentStaff.Voices.length>1){const K=W.parentVoiceEntry.parentStaffEntry.graphicalVoiceEntries,q=W.parentVoiceEntry.parentVoiceEntry.ParentVoice.VoiceId;let Z,et;for(const ct of K)for(const pt of ct.notes){if(pt===W||pt.sourceNote.isRest()||!pt.sourceNote.PrintObject)continue;const gt=pt.parentVoiceEntry.parentVoiceEntry.WantedStemDirection,Et=1===q||5===q,St=Et?1:-1,Mt=pt.sourceNote.Pitch.getHalfTone();(!Z||1===St&&Mt>Z||-1===St&&Mt<Z)&&(Z=Mt,et=0,et+=Et&>===d.StemDirectionType.Up?7:Et||gt!==d.StemDirectionType.Down?Et?1:2:7,Q.includes("8")||gt===d.StemDirectionType.Up&&-1===St&&(et+=1),pt.sourceNote.NoteBeam&&(et+=1),Q.includes("w")&&(et/=2),et+=.5*Math.ceil(F.RestCollisionYPadding),et*=St,W.lineShift=et)}if(Z>0){let ct=3;const pt=W.Clef();switch(pt.ClefType){case c.ClefEnum.F:ct=5;break;case c.ClefEnum.C:ct=4}ot=r.Pitch.fromHalftone(Z),j=[v.pitch(ot,!0,pt,void 0,ct)[0]]}}break}const G=W.vfpitch;j.push(G[0]),P.push(G[1]),H||(H=v.Clef(G[2]).type)}for(let W=0,G=it;W<G;++W)Q+="d";1===L.length&&L[0].sourceNote.Notehead?.Shape===x.NoteHeadShape.SLASH&&(Q+="s"),N&&(Q+="r");const C={align_center:nt,auto_stem:!0,clef:H,duration:Q,keys:j,slash:D.GraceSlash},O=D.notes[0].sourceNote;if(O.IsCueNote&&(C.glyph_font_scale=s.DEFAULT_NOTATION_FONT_SCALE*s.GraceNote.SCALE,C.stroke_px=s.GraceNote.LEDGER_LINE_OFFSET),D.parentVoiceEntry.IsGrace||D.notes[0].sourceNote.IsCueNote)$=new s.GraceNote(C);else{$=new s.StaveNote(C),$.stagger_same_whole_notes=F.StaggerSameWholeNotes;const W=D.parentStaffEntry.LyricsEntries;let G=!0,K=0;if(W.length>0&&F.RenderLyrics&&F.LyricsUseXPaddingForLongLyrics){const q=D.parentStaffEntry.parentMeasure,Z=[];for(let pt=q.staffEntries.indexOf(D.parentStaffEntry)+1;pt<q.staffEntries.length;pt++){const gt=q.staffEntries[pt];gt.graphicalVoiceEntries[0]&&Z.push(gt)}let et,ct=D.parentStaffEntry.relInMeasureTimestamp.clone();for(const pt of Z){const gt=pt.relInMeasureTimestamp.clone();if(et=i.Fraction.minus(gt,D.parentVoiceEntry.Timestamp),et.RealValue>.25){G=!1;break}if(pt.LyricsEntries.length>0)break;K+=32*i.Fraction.minus(gt,ct).RealValue,ct=gt}}if(F.RenderLyrics&&F.LyricsUseXPaddingForLongLyrics&&W.length>0&&G){let q=!1,Z=0;for(const ct of L)if(ct.sourceNote.Length.RealValue<=.125){q=!0;break}let et=!1;for(const ct of W){const pt=F.LyricsXPaddingWidthThreshold;let gt=ct.GraphicalLabel.PositionAndShape.Size.width;if(ct.hasDashFromLyricWord()&&(gt+=.5),gt>pt){Z+=gt-pt;const Et=D.parentStaffEntry,St=Et.parentMeasure.staffEntries,Mt=St.indexOf(Et)===St.length-1,yt=Mt&&ct.hasDashFromLyricWord();Mt&&(K+=yt?F.LyricsXPaddingReductionForLastNoteInMeasureCrossMeasureMidWord:F.LyricsXPaddingReductionForLastNoteInMeasure),q||(K+=F.LyricsXPaddingReductionForLongNotes),!F.LyricsXPaddingForLastNoteInMeasure&&Mt||gt>pt+K&&(et=!0,Z-=K);break}}et&&($.paddingRight=10*F.LyricsXPaddingFactorForLongLyrics*Z)}}const X=D.notes[0].lineShift;if(0!==X&&($.getKeyProps()[0].line+=X),L.length>1)for(let W=0;W<L.length;W++)L[W].sourceNote.Notehead?.Shape===x.NoteHeadShape.SLASH&&($.note_heads[W].note_type="s");if($.getKeyProps().forEach(({line:W},G)=>D.notes[G].staffLine=W),(F.LedgerLineWidth||F.LedgerLineStrokeStyle)&&($.ledgerLineStyle||($.ledgerLineStyle={}),F.LedgerLineWidth&&($.ledgerLineStyle.lineWidth=F.LedgerLineWidth),F.LedgerLineStrokeStyle&&($.ledgerLineStyle.strokeStyle=F.LedgerLineStrokeStyle)),F.ColoringEnabled){const W=F.DefaultColorStem;let G=D.parentVoiceEntry.StemColor;!G&&W&&(G=W);const K={fillStyle:G,strokeStyle:G};G&&($.setStemStyle(K),$.flag&&F.ColorFlags&&$.setFlagStyle(K))}if($.x_shift=st,D.parentVoiceEntry.IsGrace&&D.notes[0].sourceNote.NoteBeam&&(D.parentVoiceEntry.WantedStemDirection=D.notes[0].sourceNote.NoteBeam.Notes[0].ParentVoiceEntry.WantedStemDirection),D.parentVoiceEntry)switch(D.parentVoiceEntry.WantedStemDirection){case d.StemDirectionType.Up:$.setStemDirection(s.Stem.UP),D.parentVoiceEntry.StemDirection=d.StemDirectionType.Up;break;case d.StemDirectionType.Down:$.setStemDirection(s.Stem.DOWN),D.parentVoiceEntry.StemDirection=d.StemDirectionType.Down}for(let W=0,G=L.length;W<G;W+=1){if(L[W].setIndex($,W),P[W]){if("###"===P[W]){$.addAccidental(W,new s.Accidental("##")),$.addAccidental(W,new s.Accidental("#"));continue}if("bbs"===P[W]){$.addAccidental(W,new s.Accidental("bb")),$.addAccidental(W,new s.Accidental("b"));continue}$.addAccidental(W,new s.Accidental(P[W]))}const K=L[W].sourceNote.TremoloStrokes;if(K>0){const q=new s.Tremolo(K);q.extra_stroke_scale=F.TremoloStrokeScale,q.y_spacing_scale=F.TremoloYSpacingScale,$.addModifier(W,q)}}if(.25===O.Length.RealValue&&O.Notehead&&!1===O.Notehead.Filled){const W=$.getKeyProps();for(let G=0;G<W.length;G++)W[G].code="v81"}for(let W=0,G=it;W<G;++W)$.addDotToAll();return $}static generateArticulations(D,L,F){if(D&&"GhostNote"!==D.getAttribute("type"))for(const V of L.sourceNote.ParentVoiceEntry.Articulations){let j,P=s.Modifier.Position.ABOVE;if(D.getStemDirection()===s.Stem.UP&&(P=s.Modifier.Position.BELOW,F.ArticulationAboveNoteForStemUp)){const Y=L.parentVoiceEntry.parentStaffEntry.parentMeasure,H=Y?.ParentStaff,Q=H?.ParentInstrument.Staves;(1===Q.length||2===Q.length&&H!==Q[1])&&(P=s.Modifier.Position.ABOVE)}switch(F.ArticulationPlacementFromXML&&(V.placement===A.PlacementEnum.Above?P=s.Modifier.Position.ABOVE:V.placement===A.PlacementEnum.Below&&(P=s.Modifier.Position.BELOW)),V.articulationEnum){case d.ArticulationEnum.accent:{j=new s.Articulation("a>");const Y=L.sourceNote.NoteSlurs;for(const H of Y)H.StartNote===L.sourceNote&&(H.PlacementXml===A.PlacementEnum.Above?j.setYShift(10*-F.SlurStartArticulationYOffsetOfArticulation):H.PlacementXml===A.PlacementEnum.Below&&j.setYShift(10*F.SlurStartArticulationYOffsetOfArticulation));j.render_options={...j.render_options,extra_left_px:0,extra_right_px:0},j.getWidth&&(j.getWidth=function(){return 0});break}case d.ArticulationEnum.breathmark:j=new s.Articulation("abr"),V.placement===A.PlacementEnum.Above&&(P=s.Modifier.Position.ABOVE),j.breathMarkDistance=F.BreathMarkDistance;break;case d.ArticulationEnum.downbow:j=new s.Articulation("am"),void 0===V.placement&&(P=s.Modifier.Position.ABOVE,V.placement=A.PlacementEnum.Above);break;case d.ArticulationEnum.fermata:j=new s.Articulation("a@a"),P=s.Modifier.Position.ABOVE,V.placement=A.PlacementEnum.Above;break;case d.ArticulationEnum.marcatodown:j=new s.Articulation("a|");break;case d.ArticulationEnum.marcatoup:j=new s.Articulation("a^"),P=s.Modifier.Position.ABOVE;break;case d.ArticulationEnum.invertedfermata:{const Y=L.sourceNote.ParentVoiceEntry;if(Y!==L.sourceNote.ParentVoiceEntry.ParentSourceStaffEntry.VoiceEntries.last()){Y.Articulations=Y.Articulations.slice(Y.Articulations.indexOf(V)),Y.ParentSourceStaffEntry.VoiceEntries.last().Articulations.push(V);continue}j=new s.Articulation("a@u"),P=s.Modifier.Position.BELOW,V.placement=A.PlacementEnum.Below;break}case d.ArticulationEnum.lefthandpizzicato:j=new s.Articulation("a+");break;case d.ArticulationEnum.naturalharmonic:j=new s.Articulation("ah");break;case d.ArticulationEnum.snappizzicato:j=new s.Articulation("ao");break;case d.ArticulationEnum.staccatissimo:j=new s.Articulation("av");break;case d.ArticulationEnum.staccato:j=new s.Articulation("a.");break;case d.ArticulationEnum.tenuto:j=new s.Articulation("a-");break;case d.ArticulationEnum.upbow:j=new s.Articulation("a|"),void 0===V.placement&&(P=s.Modifier.Position.ABOVE,V.placement=A.PlacementEnum.Above);break;case d.ArticulationEnum.strongaccent:j=new s.Articulation("a^")}j&&(j.setPosition(P),D.addModifier(0,j))}}
1static generateOrnaments(D,L){let F,V=s.Modifier.Position.ABOVE;switch(L.placement===A.PlacementEnum.Below&&(V=s.Modifier.Position.BELOW),L.GetOrnament){case M.OrnamentEnum.DelayedInvertedTurn:F=new s.Ornament("turn_inverted"),F.setDelayed(!0);break;case M.OrnamentEnum.DelayedTurn:F=new s.Ornament("turn"),F.setDelayed(!0);break;case M.OrnamentEnum.InvertedMordent:F=new s.Ornament("mordent"),F.setDelayed(!1);break;case M.OrnamentEnum.InvertedTurn:F=new s.Ornament("turn_inverted"),F.setDelayed(!1);break;case M.OrnamentEnum.Mordent:F=new s.Ornament("mordent_inverted"),F.setDelayed(!1);break;case M.OrnamentEnum.Trill:F=new s.Ornament("tr"),F.setDelayed(!1);break;case M.OrnamentEnum.Turn:F=new s.Ornament("turn"),F.setDelayed(!1);break;default:return void y.default.warn("unhandled OrnamentEnum type: "+L.GetOrnament)}F&&(L.AccidentalBelow!==h.AccidentalEnum.NONE&&F.setLowerAccidental(r.Pitch.accidentalVexflow(L.AccidentalBelow)),L.AccidentalAbove!==h.AccidentalEnum.NONE&&F.setUpperAccidental(r.Pitch.accidentalVexflow(L.AccidentalAbove)),F.setPosition(V),D.addModifier(0,F))}static StrokeTypeFromArpeggioType(D){switch(D){case I.ArpeggioType.ARPEGGIO_DIRECTIONLESS:return s.Stroke.Type.ARPEGGIO_DIRECTIONLESS;case I.ArpeggioType.BRUSH_DOWN:return s.Stroke.Type.BRUSH_UP;case I.ArpeggioType.BRUSH_UP:return s.Stroke.Type.BRUSH_DOWN;case I.ArpeggioType.RASQUEDO_DOWN:return s.Stroke.Type.RASQUEDO_UP;case I.ArpeggioType.RASQUEDO_UP:return s.Stroke.Type.RASQUEDO_DOWN;case I.ArpeggioType.ROLL_DOWN:return s.Stroke.Type.ROLL_UP;case I.ArpeggioType.ROLL_UP:return s.Stroke.Type.ROLL_DOWN;default:return s.Stroke.Type.ARPEGGIO_DIRECTIONLESS}}static CreateTabNote(D){const L=[],F=D.notes.reverse(),V=[];let U=v.durations(D.notes[0].graphicalNoteLength,void 0!==D.notes[0].sourceNote.NoteTuplet)[0],Y=0;const H=D.parentStaffEntry.parentMeasure.parentSourceMeasure.Rules;let Q=!1;for(const $ of D.notes){const it=$.sourceNote;let nt={str:it.StringNumberTab,fret:it.FretNumber};$.sourceNote instanceof T.TabNote||(y.default.info(`invalid tab note: ${$.sourceNote.Pitch.ToString()} in measure ${D.parentStaffEntry.parentMeasure.MeasureNumber}, likely missing XML string+fret number.`),nt={str:1,fret:0}),H.TabUseXNoteheadShapeForTabNote&&$.sourceNote.Notehead?.Shape===x.NoteHeadShape.X&&(nt.fret="x",Q=!0),L.push(nt),it.BendArray&&it.BendArray.forEach(function(st){let N;const C=st.bendalter-nt.fret;N=C>1?"Full":1===C?"1/2":"1/4",V.push("up"===st.direction?{type:s.Bend.UP,text:N,width:10}:{type:s.Bend.DOWN,text:N,width:10})}),Y<$.numberOfDots&&(Y=$.numberOfDots)}for(let $=0,it=Y;$<it;++$)U+="d";const ot=new s.TabNote({duration:U,positions:L});Q&&(ot.render_options.scale=H.TabXNoteheadScale,ot.render_options.TabUseXNoteheadAlternativeGlyph=H.TabUseXNoteheadAlternativeGlyph,ot.updateWidth()),H.UsePageBackgroundColorForTabNotes&&(ot.BackgroundColor=H.PageBackgroundColor);for(let $=0,it=F.length;$<it;$+=1)F[$].setIndex(ot,$);return V.forEach(function($){ot.addModifier(new s.Bend($.text,$.type!==s.Bend.UP))}),ot}static Clef(D,L="default"){let F,V;switch("default"!==L&&"small"!==L&&(y.default.warn(`Invalid VexFlow clef size "${L}" specified. Using "default".`),L="default"),D.ClefType){case c.ClefEnum.G:switch(D.Line){case 1:F="french";break;case 2:F="treble";break;default:F="treble",y.default.error(`Clef ${c.ClefEnum[D.ClefType]} on line ${D.Line} not supported by VexFlow. Using default value "${F}".`)}break;case c.ClefEnum.F:switch(D.Line){case 4:F="bass";break;case 3:F="baritone-f";break;case 5:F="subbass";break;default:F="bass",y.default.error(`Clef ${c.ClefEnum[D.ClefType]} on line ${D.Line} not supported by VexFlow. Using default value "${F}".`)}break;case c.ClefEnum.C:switch(D.Line){case 3:F="alto";break;case 4:F="tenor";break;case 1:F="soprano";break;case 2:F="mezzo-soprano";break;default:F="alto",y.default.error(`Clef ${c.ClefEnum[D.ClefType]} on line ${D.Line} not supported by VexFlow. Using default value "${F}".`)}break;case c.ClefEnum.percussion:F="percussion";break;case c.ClefEnum.TAB:F="treble";break;default:y.default.info("bad clef type: "+D.ClefType),F="treble"}return 1===D.OctaveOffset&&"bass"!==F?V="8va":-1===D.OctaveOffset&&(V="8vb"),{type:F,size:L,annotation:V}}static TimeSignature(D){let L;switch(D.SymbolEnum){case o.RhythmSymbolEnum.NONE:L=D.Rhythm.Numerator+"/"+D.Rhythm.Denominator;break;case o.RhythmSymbolEnum.COMMON:L="C";break;case o.RhythmSymbolEnum.CUT:L="C|"}return new s.TimeSignature(L)}static keySignature(D){if(!D)return;let L;switch(D.Mode){case n.KeyEnum.minor:L=v.minorMap[D.Key]+"m";break;case n.KeyEnum.major:case n.KeyEnum.none:L=v.majorMap[D.Key];break;default:L="C"}return L}static line(D,L){switch(D){case f.SystemLinesEnum.SingleThin:return L===S.SystemLinePosition.MeasureBegin?s.StaveConnector.type.SINGLE:s.StaveConnector.type.SINGLE_RIGHT;case f.SystemLinesEnum.DoubleThin:return s.StaveConnector.type.THIN_DOUBLE;case f.SystemLinesEnum.ThinBold:return s.StaveConnector.type.BOLD_DOUBLE_RIGHT;case f.SystemLinesEnum.BoldThinDots:return s.StaveConnector.type.BOLD_DOUBLE_LEFT;case f.SystemLinesEnum.DotsThinBold:case f.SystemLinesEnum.DotsBoldBoldDots:return s.StaveConnector.type.BOLD_DOUBLE_RIGHT;
1case f.SystemLinesEnum.None:return s.StaveConnector.type.NONE}}static font(D,L=m.FontStyles.Regular,F=p.Fonts.TimesNewRoman,V,j=void 0){let P="normal",U="normal",Y=`'${V.DefaultFontFamily}'`;switch(L){case m.FontStyles.Bold:U="bold";break;case m.FontStyles.Italic:P="italic";break;case m.FontStyles.BoldItalic:P="italic",U="bold"}return j&&"default"!==j&&(Y=`'${j}'`),P+" "+U+" "+Math.floor(D)+"px "+Y}static fontStyle(D){switch(D){case m.FontStyles.Bold:return"bold";case m.FontStyles.Italic:return"italic";case m.FontStyles.BoldItalic:return"italic bold";default:return"normal"}}static style(D){return E.OUTLINE_AND_FILL_STYLE_DICT.getValue(D)}}g.VexFlowConverter=v,v.majorMap={"-1":"F","-2":"Bb","-3":"Eb","-4":"Ab","-5":"Db","-6":"Gb","-7":"Cb","-8":"Fb",0:"C",1:"G",2:"D",3:"A",4:"E",5:"B",6:"F#",7:"C#",8:"G#"},v.minorMap={"-1":"D","-2":"G","-3":"C","-4":"F","-5":"Bb","-6":"Eb","-7":"Ab","-8":"Db",0:"A",1:"E",2:"B",3:"F#",4:"C#",5:"G#",6:"D#",7:"A#",8:"E#"}},1216(dt,g,u){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.VexFlowGlissando=void 0;const l=u(98);g.VexFlowGlissando=class s extends l.GraphicalGlissando{}},9635(dt,g,u){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.VexFlowGraphicalNote=void 0;const l=u(3430),s=u(6014),c=u(437),r=u(3849);g.VexFlowGraphicalNote=class i extends l.GraphicalNote{constructor(n,h,e,f=c.OctaveEnum.NONE,m,p=void 0){if(super(n,h,m,p),this.clef=e,this.octaveShift=f,n.Pitch){const E=n.isRest()?n.Pitch:c.OctaveShift.getPitchFromOctaveShift(n.Pitch,f);this.vfpitch=s.VexFlowConverter.pitch(E,n.isRest(),this.clef,this.sourceNote.Notehead),this.vfpitch[1]=void 0}}setAccidental(n){const h=this.drawPitch(n);this.vfpitch=s.VexFlowConverter.pitch(h,this.sourceNote.isRest(),this.clef,this.sourceNote.Notehead),this.DrawnAccidental=h.Accidental}drawPitch(n){return c.OctaveShift.getPitchFromOctaveShift(n,this.octaveShift)}Transpose(n,h,e,f){const m=super.Transpose(n,h,e,f),p=c.OctaveShift.getPitchFromOctaveShift(m,this.octaveShift);return this.vfpitch=s.VexFlowConverter.pitch(p,this.sourceNote.isRest(),this.clef,this.sourceNote.Notehead),this.vfpitch[1]=void 0,p}setIndex(n,h){this.vfnote=[n,h],this.vfnoteIndex=h}notehead(n=void 0){let h=n;h||(h=this.vfnote[0]);const e=h.note_heads;return e&&e.length>this.vfnoteIndex&&e[this.vfnoteIndex]?h.note_heads[this.vfnoteIndex]:{line:0}}Clef(){return this.clef}getSVGId(){if(this.vfnote)return this.vfnote[0].getAttribute("id")}setVisible(n,h={}){const e=h.applyToBeams??!0,f=h.applyToLedgerLines??!0,p=h.applyToSlurs??!0,E=h.applyToStem??!0,y=h.applyToTies??!0,d="visibility",S=n?"visible":"hidden";if((h.applyToNotehead??!0)&&this.getSVGGElement()?.setAttribute(d,S),E&&this.getStemSVG()?.setAttribute(d,S),e)for(const M of this.getBeamSVGs())M?.setAttribute(d,S);if(f)for(const M of this.getLedgerLineSVGs())M?.setAttribute(d,S);if(y)for(const M of this.getTieSVGs())M?.setAttribute(d,S);
vendor: 17,877 bytes, line 1
1if(p)for(const M of this.getSlurSVGs())M?.setAttribute(d,S)}getSVGGElement(){if(this.vfnote)return this.vfnote[0].getAttribute("el")}getStemSVG(){const n=document.getElementById("vf-"+this.getSVGId()+"-stem");return n?.children.length>0?n.children[0]:n}getBeamSVGs(){const n=[];for(let h=0;;h++){const e=document.getElementById(`vf-${this.getSVGId()}-beam${h}`);if(!e)break;n.push(e)}return n}getLedgerLineSVGs(){const n=[],h=`vf-${this.getSVGId()}ledgers`,e=document.getElementById(h);if(!e)return[];for(const f of e.childNodes)n.push(f);return n}getTieSVGs(){const n=[],h=document.querySelectorAll(`[id='vf-${this.getSVGId()}-tie']`);for(const e of h)n.push(e);return n}getSlurSVGs(){const n=[],h=document.querySelectorAll(`[id='vf-${this.getSVGId()}-slur']`);for(const e of h)n.push(e);return n}getNoteheadSVGs(){const n=this.getVFNoteSVG(),h=[];if(n?.children?.length)for(const e of n.children)e.classList.contains("vf-notehead")&&h.push(e);return h}getFlagSVG(){const n=this.getVFNoteSVG();if(n?.children?.length)for(const h of n.children)if(h.classList.contains("vf-flag"))return h}getVFNoteSVG(){if(this.parentVoiceEntry.parentStaffEntry.parentMeasure.isMultiRestMeasure())return this.parentVoiceEntry.parentStaffEntry.parentMeasure.multiRestElement;const n=this.getSVGGElement();if(n)for(const h of n.children)if(h.classList.contains("vf-note"))return h}getModifierSVGs(){const n=this.getSVGGElement(),h=[];if(!n?.children)return h;if(n.children.length)for(const e of n.children)e.classList.contains("vf-modifiers")&&h.push(e);return h}setColor(n,h={}){const f=h.applyToFlag??!0,m=h.applyToLedgerLines??!1,p=h.applyToLyrics??!1,E=h.applyToModifiers??!0,y=h.applyToNoteheads??!0,d=h.applyToSlurs??!1,S=h.applyToStem??!0,M=h.applyToTies??!1,x=h.applyToMultiRestMeasure??!0,_=h.applyToMultiRestMeasureNumber??!0,I=h.applyToMultiRestMeasureRestBar??!0;if(h.applyToBeams){const T=this.getBeamSVGs();for(const A of T)for(const v of A.children)v.setAttribute("fill",n)}if(f){const T=this.getFlagSVG();if(T)for(const A of T.children)A.setAttribute("fill",n)}if(m){const T=this.getLedgerLineSVGs();for(const A of T)A.setAttribute("stroke",n)}if(p){const T=this.getLyricsSVGs();for(const A of T)for(const v of A.children)v.setAttribute("stroke",n),v.setAttribute("fill",n)}if(x&&this.parentVoiceEntry.parentStaffEntry.parentMeasure instanceof r.VexFlowMultiRestMeasure){const T=this.parentVoiceEntry.parentStaffEntry.parentMeasure.multiRestElementSVG;if(T?.children?.length)for(const A of T.children)if(A.children?.length){if(_)for(const v of A.children)v.setAttribute("fill",n)}else I&&A.setAttribute("fill",n)}if(E){const T=this.getModifierSVGs();for(const A of T)for(const v of A.children)v.setAttribute("fill",n)}if(y){const T=this.getNoteheadSVGs();for(const A of T)for(const v of A.children)v.setAttribute("fill",n)}if(d){const T=this.getSlurSVGs();for(const A of T)for(const v of A.children)v.setAttribute("fill",n)}if(S){const T=this.getStemSVG();T&&T.setAttribute("stroke",n)}if(M){const T=this.getTieSVGs();for(const A of T)for(const v of A.children)v.setAttribute("fill",n)}}}},3753(dt,g,u){"use strict";var l=this&&this.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(g,"__esModule",{value:!0}),g.VexFlowGraphicalSymbolFactory=void 0;var s=l(u(3206)).default.Flow;const c=u(4332),r=u(5246),i=u(6670),o=u(437),n=u(9635),h=u(6659),e=u(4134),f=u(6014),m=u(6173),p=u(5866),E=u(3849),y=u(6362);g.VexFlowGraphicalSymbolFactory=class{createMusicSystem(d,S){return new c.VexFlowMusicSystem(d,S)}createStaffLine(d,S){return new p.VexFlowStaffLine(d,S)}createGraphicalMeasure(d,S,M=!1){return new r.VexFlowMeasure(S,d,void 0)}createMultiRestMeasure(d,S,M){return new E.VexFlowMultiRestMeasure(S,d,M)}createTabStaffMeasure(d,S){return new m.VexFlowTabMeasure(S,d)}createExtraGraphicalMeasure(d){const S=new r.VexFlowMeasure(d.ParentStaff,void 0,d);return S.IsExtraGraphicalMeasure=!0,S.ExtraGraphicalMeasurePreviousMeasure=d.Measures.last(),S}createStaffEntry(d,S){return new i.VexFlowStaffEntry(S,d,void 0)}createVoiceEntry(d,S){return new e.VexFlowVoiceEntry(d,S)}createNote(d,S,M,x=o.OctaveEnum.NONE,_,I=void 0){return new n.VexFlowGraphicalNote(d,S,M,x,_,I)}createGraceNote(d,S,M,x,_=o.OctaveEnum.NONE){return new n.VexFlowGraphicalNote(d,S,M,_,x)}addGraphicalAccidental(d,S){d.setAccidental(S)}addFermataAtTiedEndNote(d,S){}createInStaffClef(d,S){const M=d,x=f.VexFlowConverter.Clef(S,"small");M.vfClefBefore=new s.ClefNote(x.type,x.size,x.annotation)}createChordSymbols(d,S,M,x){const _=S.parentMeasure.parentSourceMeasure.Rules;let I=0;const T=_.ChordSymbolXSpacing;for(const A of d.ChordContainers){if(!A)continue;let v=S.PositionAndShape;1===S.graphicalVoiceEntries.length&&1===S.graphicalVoiceEntries[0].notes.length&&S.graphicalVoiceEntries[0].notes[0].sourceNote.isWholeRest()&&(v=S.parentMeasure.PositionAndShape,I+=S.parentMeasure.beginInstructionsWidth,I+=_.ChordSymbolWholeMeasureRestXOffset);const B=new h.GraphicalChordSymbolContainer(A,v,_.ChordSymbolTextHeight,M,x,_),L=B.GraphicalLabel;B.GetChordSymbolContainer.Placement===y.PlacementEnum.Below?L.PositionAndShape.RelativePosition.y=_.StaffHeight+_.ChordSymbolYOffset:L.PositionAndShape.RelativePosition.y-=_.ChordSymbolYOffset,L.setLabelPositionAndShapeBorders();let F=0;L.PositionAndShape.Size.width<_.ChordSymbolExtraXShiftWidthThreshold&&(F=_.ChordSymbolExtraXShiftForShortChordSymbols),L.PositionAndShape.RelativePosition.x+=I+F,L.setLabelPositionAndShapeBorders(),B.PositionAndShape.calculateBoundingBox(),S.graphicalChordContainers.push(B),I+=L.PositionAndShape.Size.width+T}}createGraphicalTechnicalInstruction(d,S){}}},7809(dt,g,u){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.VexFlowInstantaneousDynamicExpression=void 0;const l=u(5023),s=u(2148),c=u(8254),r=u(7435),i=u(7533),o=u(2570);g.VexFlowInstantaneousDynamicExpression=class n extends l.GraphicalInstantaneousDynamicExpression{constructor(e,f,m){super(e,f,m);const p=new r.Label(this.Expression);this.label=new c.GraphicalLabel(p,this.rules.ContinuousDynamicTextHeight,i.TextAlignmentEnum.CenterCenter,this.rules,this.PositionAndShape),this.label.Label.fontStyle=o.FontStyles.BoldItalic,this.label.setLabelPositionAndShapeBorders(),this.PositionAndShape.calculateBoundingBox()}get InstantaneousDynamic(){return this.mInstantaneousDynamicExpression}get Expression(){return s.DynamicEnum[this.mInstantaneousDynamicExpression.DynEnum]}}},7098(dt,g,u){"use strict";var l=this&&this.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(g,"__esModule",{value:!0}),g.VexFlowInstrumentBrace=void 0;var s=l(u(3206)).default.Flow;const c=u(3109);g.VexFlowInstrumentBrace=class r extends c.VexFlowInstrumentBracket{constructor(o,n,h=0){super(o,n,h),this.vexflowConnector.setType(s.StaveConnector.type.BRACE)}}},3109(dt,g,u){"use strict";var l=this&&this.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(g,"__esModule",{value:!0}),g.VexFlowInstrumentBracket=void 0;var s=l(u(3206)).default.Flow;const c=u(7741),r=u(6438),i=u(9479);g.VexFlowInstrumentBracket=class o extends c.GraphicalObject{constructor(h,e,f=0){super(),this.Visible=!0,this.PositionAndShape=new r.BoundingBox(this,h.ParentMusicSystem.PositionAndShape);const p=e.Measures[0];this.addConnector(h.Measures[0].getVFStave(),p.getVFStave(),s.StaveConnector.type.BRACKET,f)}draw(h){this.Visible&&this.vexflowConnector.setContext(h).draw();const e=this.vexflowConnector,f=e.top_stave.getYForLine(0),m=e.bottom_stave.getYForLine(e.bottom_stave.getNumLines()-1)+e.thickness;this.PositionAndShape.AbsolutePosition.x=(e.top_stave.getX()-2+e.x_shift)/i.unitInPixels,this.PositionAndShape.AbsolutePosition.y=f/i.unitInPixels,this.PositionAndShape.Size.height=(m-f)/i.unitInPixels,this.PositionAndShape.Size.width=12/i.unitInPixels}addConnector(h,e,f,m){this.vexflowConnector=new s.StaveConnector(h,e).setType(f).setXShift(-5*m)}}},5246(dt,g,u){"use strict";var l=this&&this.__importDefault||function(A){return A&&A.__esModule?A:{default:A}};Object.defineProperty(g,"__esModule",{value:!0}),g.StavePositionEnum=g.VexFlowMeasure=void 0;var s=l(u(3206)).default.Flow;const c=u(5748),r=u(6954),i=u(164),o=u(6014),n=u(8365);var h=s.NoteSubGroup;const e=l(u(3065)),f=u(9479),m=u(1645),p=u(67),E=u(1336),y=u(4134),d=u(2561),S=u(9713),M=u(3123),x=u(6362),_=u(5282);class I extends c.GraphicalMeasure{constructor(v,B,D){super(v,B,D),this.octaveOffset=3,this.vfVoices={},this.vfTies=[],this.vfRepetitionWords=[],this.hasMetronomeMark=!1,this.connectors=[],this.beams={},this.autoVfBeams=[],this.autoTupletVfBeams=[],this.vfbeams={},this.tuplets={},this.vftuplets={},this.minimumStaffEntriesWidth=-1,this.rules=D?D.ParentMusicSystem.rules:B?B.Rules:new S.EngravingRules,this.resetLayout()}setAbsoluteCoordinates(v,B){this.stave.setX(v).setY(B)}resetLayout(){this.stave=new s.Stave(0,0,0,{fill_style:this.rules.StaffLineColor,space_above_staff_ln:0,space_below_staff_ln:0}),this.InitiallyActiveClef&&(this.stave.clef=o.VexFlowConverter.Clef(this.InitiallyActiveClef).type),this.stave.MeasureNumber=this.MeasureNumber,this.hasMetronomeMark=!1,this.ParentStaff&&this.setLineNumber(this.ParentStaff.StafflineCount),this.stave.setBegBarType(s.Barline.type.NONE),this.parentSourceMeasure&&this.parentSourceMeasure.endingBarStyleEnum===r.SystemLinesEnum.None&&this.stave.setEndBarType(s.Barline.type.NONE),this.updateInstructionWidth()}clean(){this.vfTies.length=0,this.connectors=[],this.resetLayout()}getLineWidth(v){switch(v){case r.SystemLinesEnum.BoldThinDots:case r.SystemLinesEnum.DotsThinBold:return 10/f.unitInPixels;case r.SystemLinesEnum.DotsBoldBoldDots:return 10/f.unitInPixels+this.rules.RepeatEndStartPadding;default:return 0}}addClefAtBegin(v){if(this.rules.RenderClefsAtBeginningOfStaffline){if(this.octaveOffset=v.OctaveOffset,v.ClefType===i.ClefEnum.TAB)this.stave.addClef("tab",void 0,void 0,void 0);else{const B=o.VexFlowConverter.Clef(v,"default");this.stave.addClef(B.type,B.size,B.annotation,s.StaveModifier.Position.BEGIN)}this.updateInstructionWidth()}}setLineNumber(v){5!==v&&(0===v?(this.stave.setNumLines(0),this.stave.getBottomLineY=function(){return this.getYForLine(this.options.num_lines)}):1===v?(this.stave.options.line_config=[{visible:!1},{visible:!1},{visible:!0},{visible:!1},{visible:!1}],this.stave.getBottomLineY=function(){return this.getYForLine(2)}):2===v?(this.stave.options.line_config=[{visible:!1},{visible:!1},{visible:!0},{visible:!0},{visible:!1}],this.stave.getBottomLineY=function(){return this.getYForLine(3)}):3===v?(this.stave.options.line_config=[{visible:!1},{visible:!0},{visible:!0},{visible:!0},{visible:!1}],this.stave.getBottomLineY=function(){return this.getYForLine(2)}):(this.stave.setNumLines(v),this.stave.getBottomLineY=function(){return this.getYForLine(this.options.num_lines)}))}addKeyAtBegin(v,B,D){if(this.rules.RenderKeySignatures&&this.ShowKeySignature&&(!this.isTabMeasure||this.rules.TabKeySignatureRendered||this.rules.TabKeySignatureSpacingAdded)&&(!this.parentSourceMeasure?.isReducedToMultiRest||this.rules.MultipleRestMeasureAddKeySignature)){if(this.stave.setKeySignature(o.VexFlowConverter.keySignature(v),o.VexFlowConverter.keySignature(B),void 0),this.isTabMeasure&&!this.rules.TabKeySignatureRendered){const L=this.stave.getModifiers();for(const F of L)if(F instanceof s.KeySignature){F.setStyle({fillStyle:"#00000000"}),F.hidden=!0;break}}this.updateInstructionWidth()}}addRhythmAtBegin(v){if(this.isTabMeasure&&!this.rules.TabTimeSignatureRendered&&!this.rules.TabTimeSignatureSpacingAdded)return;const B=o.VexFlowConverter.TimeSignature(v);this.stave.addModifier(B,s.StaveModifier.Position.BEGIN),(!this.ShowTimeSignature||this.isTabMeasure&&!this.rules.TabTimeSignatureRendered)&&(B.setStyle({fillStyle:"#00000000"}),B.hidden=!0),this.updateInstructionWidth()}addClefAtEnd(v,B=!0){if(this.isTabMeasure)return;const D=o.VexFlowConverter.Clef(v,"small");if(B||!this.stave.endClef){this.stave.setEndClef(D.type,D.size,D.annotation);for(const L of this.stave.getModifiers())if(B){const F=L.originalStrokeStyle,V=L.originalFillStyle;L.getStyle()&&(F&&V?(L.getStyle().strokeStyle=F,L.getStyle().fillStyle=V):(L.getStyle().strokeStyle=null,L.getStyle().fillStyle=null))}else if("clefs"===L.getCategory()&&L.getPosition()===s.StaveModifier.Position.END&&L.type===D.type){const F="#12345600",V=L.getStyle();V&&(L.originalStrokeStyle=V.strokeStyle,L.originalFillStyle=V.fillStyle),L.setStyle({strokeStyle:F,fillStyle:F})}return this.parentSourceMeasure.hasEndClef=!0,this.updateInstructionWidth()}}addMeasureLine(v,B,D=!0){switch(B){case p.SystemLinePosition.MeasureBegin:v===r.SystemLinesEnum.BoldThinDots&&(D||(this.stave.modifiers[0].draw=function(L){switch(L.checkContext(),this.setRendered(),this.type){case s.Barline.type.SINGLE:this.drawVerticalBar(L,this.x,!1);break;case s.Barline.type.DOUBLE:this.drawVerticalBar(L,this.x,!0);break;case s.Barline.type.END:this.drawVerticalEndBar(L,this.x);break;case s.Barline.type.REPEAT_BEGIN:this.drawRepeatBar(L,this.x,!0);break;case s.Barline.type.REPEAT_END:this.drawRepeatBar(L,this.x,!1);break;case s.Barline.type.REPEAT_BOTH:this.drawRepeatBar(L,this.x,!1),this.drawRepeatBar(L,this.x,!0)}}),this.stave.setBegBarType(s.Barline.type.REPEAT_BEGIN));break;case p.SystemLinePosition.MeasureEnd:switch(v){case r.SystemLinesEnum.DotsBoldBoldDots:this.stave.setEndBarType(s.Barline.type.REPEAT_BOTH);break;case r.SystemLinesEnum.DotsThinBold:this.stave.setEndBarType(s.Barline.type.REPEAT_END);break;case r.SystemLinesEnum.DoubleThin:this.stave.setEndBarType(s.Barline.type.DOUBLE);break;case r.SystemLinesEnum.ThinBold:this.stave.setEndBarType(s.Barline.type.END);break;case r.SystemLinesEnum.DoubleBold:this.stave.setEndBarType(8);break;case r.SystemLinesEnum.None:this.stave.setEndBarType(s.Barline.type.NONE)}}}addMeasureNumber(){const v=this.MeasureNumber.toString();this.stave.setText(v,T.ABOVE,{justification:1,shift_x:0,shift_y:0})}addWordRepetition(v){let B,D=s.StaveModifier.Position.END;const L=this.beginInstructionsWidth;switch(v.type){case m.RepetitionInstructionEnum.Segno:B=s.Repetition.type.SEGNO_LEFT,D=s.StaveModifier.Position.LEFT;break;case m.RepetitionInstructionEnum.Coda:B=s.Repetition.type.CODA_LEFT,D=s.StaveModifier.Position.LEFT;break;case m.RepetitionInstructionEnum.DaCapo:B=s.Repetition.type.DC;break;case m.RepetitionInstructionEnum.DalSegno:B=s.Repetition.type.DS;break;case m.RepetitionInstructionEnum.Fine:B=s.Repetition.type.FINE;break;case m.RepetitionInstructionEnum.ToCoda:B=s.Repetition.type.TO_CODA;break;case m.RepetitionInstructionEnum.DaCapoAlFine:B=s.Repetition.type.DC_AL_FINE;break;case m.RepetitionInstructionEnum.DaCapoAlCoda:B=s.Repetition.type.DC_AL_CODA;break;case m.RepetitionInstructionEnum.DalSegnoAlFine:B=s.Repetition.type.DS_AL_FINE;break;case m.RepetitionInstructionEnum.DalSegnoAlCoda:B=s.Repetition.type.DS_AL_CODA}if(B){const F=new s.Repetition(B,L,-this.rules.RepetitionSymbolsYOffset);return F.xShiftAsPercentOfStaveWidth=this.rules.RepetitionEndInstructionXShiftAsPercentOfStaveWidth,void this.stave.addModifier(F,D)}this.addVolta(v)}addVolta(v){let B=s.Volta.type.BEGIN;if(v.type===m.RepetitionInstructionEnum.Ending){switch(v.alignment){case m.AlignmentType.Begin:B=this.parentSourceMeasure.endsRepetitionEnding()?s.Volta.type.BEGIN_END:s.Volta.type.BEGIN;break;case m.AlignmentType.Discontinue:if(this.parentSourceMeasure.beginsRepetitionEnding())return;B=s.Volta.type.MID;break;case m.AlignmentType.End:if(this.parentSourceMeasure.beginsRepetitionEnding())return;B=s.Volta.type.END;break;case m.AlignmentType.Mid:B=s.Volta.type.MID}const D=this.ParentStaffLine.SkyBottomLineCalculator,L=this.PositionAndShape.AbsolutePosition.x+this.PositionAndShape.BorderMarginLeft+.4,F=Math.max(this.PositionAndShape.AbsolutePosition.x+this.PositionAndShape.BorderMarginRight,L+.4),V=D.getSkyLineMinInRange(L,F)-2;let j,P=-6.1+this.rules.VoltaOffset,U=this.rules.VoltaOffset;V<P&&(U+=V-P,P=V);const Y=this.parentSourceMeasure.MeasureNumber;for(let H=0;H<this.ParentStaffLine.Measures.length;H++){const Q=this.ParentStaffLine.Measures[H];Q instanceof I&&(Q.MeasureNumber!==Y-1&&Q.MeasureNumber+Q.parentSourceMeasure?.multipleRestMeasures!==Y||(j=Q))}if(j){const H=j.stave.getModifiers();for(let Q=0;Q<H.length;Q++){const ot=H[Q];if(ot.hasOwnProperty("volta")){const $=j.ParentStaffLine.SkyBottomLineCalculator,it=j.PositionAndShape.AbsolutePosition.x+j.PositionAndShape.BorderMarginLeft+.4,nt=Math.max(j.PositionAndShape.AbsolutePosition.x+j.PositionAndShape.BorderMarginRight,it+.4),st=$.getSkyLineMinInRange(it,nt);st<=P?(U+=st-P,P=st):(ot.y_shift=U*f.unitInPixels,j.ParentStaffLine.SkyBottomLineCalculator.updateSkyLineInRange(it,nt,P))}}}U*=10,this.stave.setVoltaType(B,v.endingIndices[0],U),D.updateSkyLineInRange(L,F,P)}}setWidth(v){super.setWidth(v),this.stave.setWidth(v*f.unitInPixels)}layoutSymbols(){}draw(v){const B=v.openGroup();B&&(B.classList?.add("vf-measure"),B.id=`${this.MeasureNumber}`),this.stave.setContext(v).draw();for(const D in this.vfVoices)this.vfVoices.hasOwnProperty(D)&&(v.save(),this.vfVoices[D].draw(v,this.stave),v.restore());for(const D in this.vfbeams)if(this.vfbeams.hasOwnProperty(D))for(const L of this.vfbeams[D])L.setContext(v).draw();if(this.autoVfBeams)for(const D of this.autoVfBeams)D.setContext(v).draw();if(!this.isTabMeasure||this.rules.TupletNumbersInTabs){if(this.autoTupletVfBeams)for(const D of this.autoTupletVfBeams)D.setContext(v).draw();for(const D in this.vftuplets)if(this.vftuplets.hasOwnProperty(D))for(let L=0;L<this.tuplets[D].length;L++){const F=this.tuplets[D][L][0],V=this.vftuplets[D][L];V&&(V.RenderTupletNumber=!(!F.RenderTupletNumber||F.ShowNumberNoneGivenInXml&&this.rules.TupletNumberUseShowNoneXMLValue),V.setContext(v).draw())}}for(const D of this.vfTies)D instanceof s.TabSlide||(D.setContext(v),D.draw());v.closeGroup();
1for(const D of this.connectors)v.openGroup("connector"),D.setContext(v).draw(),v.closeGroup();this.correctNotePositions()}format(){this.formatVoices&&this.formatVoices((this.PositionAndShape.Size.width-this.beginInstructionsWidth-this.endInstructionsWidth)*f.unitInPixels,this)}correctNotePositions(){if(this.isTabMeasure)for(const v of this.getVoicesWithinMeasure())for(const B of v.VoiceEntries)for(const D of B.Notes){const L=D,F=this.rules.GNote(D);L.StringNumberTab>=0&&(F.parentVoiceEntry.PositionAndShape.RelativePosition.y=(L.StringNumberTab-1)*this.rules.TabStaffInterlineHeightForBboxes)}else for(const v of this.getVoicesWithinMeasure())for(const B of v.VoiceEntries)for(const D of B.Notes){if(D.isRest())continue;const L=this.rules.GNote(D);if(!L?.vfnote)return;const F=L.vfnote[0];let V=0;L.parentVoiceEntry.parentVoiceEntry.StemDirection===E.StemDirectionType.Up&&"w"!==L.vfnote[0].getDuration()?V+=3.5:V+=.5,V+=-L.notehead(F).line+L.parentVoiceEntry.notes.last().notehead().line,L.PositionAndShape.RelativePosition.y=V}}getVoicesWithinMeasure(){const v=[];for(const B of this.staffEntries)for(const D of B.graphicalVoiceEntries)-1===v.indexOf(D.parentVoiceEntry.ParentVoice)&&v.push(D.parentVoiceEntry.ParentVoice);return v}getGraphicalVoiceEntriesPerVoice(v){const B=[];for(const D of this.staffEntries)for(const L of D.graphicalVoiceEntries)L.parentVoiceEntry.ParentVoice===v&&B.push(L);return B}getRestFilledVexFlowStaveNotesPerVoice(v){let B,D=this.getGraphicalVoiceEntriesPerVoice(v);for(let V=0;V<D.length;V++){const j=D[V],P=j.notes[0].sourceNote.getAbsoluteTimestamp();let U=new d.Fraction;for(const Y of j.notes){const H=d.Fraction.plus(Y.sourceNote.getAbsoluteTimestamp(),Y.sourceNote.Length);U.lt(H)&&(U=H)}if(B){const Y=d.Fraction.minus(P,B);if(Y.RealValue>0){e.default.trace(`Ghost Found in between (measure ${this.MeasureNumber})`);const H=this.createGhostGves(Y);D.splice(V,0,...H),V+=H.length}}else{const Y=d.Fraction.minus(P,this.parentSourceMeasure.AbsoluteTimestamp);if(Y.RealValue>0){e.default.trace(`Ghost Found at start (measure ${this.MeasureNumber})`);const H=this.createGhostGves(Y);D.splice(0,0,...H),V+=H.length}}B=U}const L=d.Fraction.plus(this.parentSourceMeasure.AbsoluteTimestamp,this.parentSourceMeasure.Duration),F=d.Fraction.minus(L,B);if(F.RealValue>0){e.default.trace(`Ghost Found at end (measure ${this.MeasureNumber})`);const V=this.createGhostGves(F);D=D.concat(V)}return D}createGhostGves(v){const B=o.VexFlowConverter.GhostNotes(v),D=[];for(const L of B){const F=new y.VexFlowVoiceEntry(void 0,void 0,this.rules);F.vfStaveNote=L,D.push(F)}return D}handleBeam(v,B){const D=v.sourceNote.ParentVoiceEntry.ParentVoice.VoiceId;let L,F=this.beams[D];F||(F=this.beams[D]=[]);for(const j of F)j[0]===B&&(L=j);L||(L=[B,[]],F.push(L));const V=v.parentVoiceEntry;L[1].indexOf(V)<0&&L[1].push(V)}handleTuplet(v,B){const D=v.sourceNote.ParentVoiceEntry.ParentVoice.VoiceId;B=v.sourceNote.NoteTuplet;let L,F=this.tuplets[D];F||(F=this.tuplets[D]=[]);for(const j of F)j[0]===B&&(L=j);L||(L=[B,[]],F.push(L));const V=v.parentVoiceEntry;L[1].indexOf(V)<0&&L[1].push(V)}finalizeBeams(){if(this.vfbeams={},this.isTabMeasure&&!this.rules.TabBeamsRendered)return;const v=[];for(const B in this.beams)if(this.beams.hasOwnProperty(B)){let D=this.vfbeams[B];D||(D=this.vfbeams[B]=[]);for(const L of this.beams[B]){let F=!1;for(const ot of L[0].Notes)if(ot.Length.RealValue>=new d.Fraction(1,4).RealValue&&(!ot.TypeLength||ot.TypeLength.RealValue>.125)){F=!0;break}if(F){e.default.debug("Beam between note >= quarter, likely tremolo, currently unsupported. continuing.");continue}const V=[],j=L[0],P=L[1];let U=!0;for(const ot of P)ot.parentVoiceEntry.ParentVoice===j.Notes[0].ParentVoiceEntry.ParentVoice&&(U=ot.parentVoiceEntry.WantedStemDirection===E.StemDirectionType.Undefined);let Y,H=!1;const Q=[];for(const ot of P){const $=ot.vfStaveNote;$&&(V.push($),v.push($)),ot.parentVoiceEntry.IsGrace&&(H=!0),ot.parentVoiceEntry.StemColor&&this.rules.ColoringEnabled&&Q.push(ot.parentVoiceEntry.StemColor)}if(V.length>1){const ot=new s.Beam(V,U);if(j.SecondaryBreakIndices?.length>0&&ot.breakSecondaryAt(j.SecondaryBreakIndices),H&&(ot.render_options.beam_width=3,ot.render_options.partial_beam_length=4),Q.length>=2&&this.rules.ColorBeams){Y=Q[0];for(const $ of Q)if($!==Y){Y=void 0;break}ot.setStyle({fillStyle:Y,strokeStyle:Y})}
1this.rules.FlatBeams&&(ot.render_options.flat_beams=!0,ot.render_options.flat_beam_offset=this.rules.FlatBeamOffset,ot.render_options.flat_beam_offset_per_beam=this.rules.FlatBeamOffsetPerBeam),D.push(ot)}else e.default.debug("Warning! Beam with no notes!")}}this.rules.AutoBeamNotes&&this.autoBeamNotes(v)}autoBeamNotes(v){if(!this.rules.AutoBeamTabs&&this.isTabMeasure)return;let B,D=60,L=[],F=[],V=[];this.autoTupletVfBeams=[];const j=[];this.autoVfBeams=[];let P=this.parentSourceMeasure.ActiveTimeSignature;P||(P=this.parentSourceMeasure.Duration);for(const H of this.staffEntries)for(const Q of H.graphicalVoiceEntries){const ot=Q.vfStaveNote,$=Q.notes[0],it={vfStaveNote:ot,sourceNote:$.sourceNote},nt=H.relInMeasureTimestamp.isOnBeat(P),st=F.length>=2,N=$.sourceNote.Length.RealValue-new d.Fraction(1,4).RealValue>-d.Fraction.FloatInaccuracyTolerance,C=Q.parentVoiceEntry.IsGrace||N||v.contains(ot);if(C||nt){if(st){for(const X of F)L.push(X);j.push(L.slice()),L=[]}if(F=[],C)continue}const O=Q.notes[0].sourceNote.NoteTuplet;if(O){let X=!1;for(const W of O.Notes){for(const G of W)if(G.NoteTypeXml>=_.NoteType.QUARTER||G.ParentVoiceEntry.IsGrace||G.isRest()&&!this.rules.AutoBeamOptions.beam_rests){X=!0;break}if(X)break}if(B){if(B!==O){if(V.length>1){const W=[];for(const q of V)W.push(q.vfStaveNote);const G=new s.Beam(W,!0);this.rules.FlatBeams&&(G.render_options.flat_beams=!0,G.render_options.flat_beam_offset=this.rules.FlatBeamOffset,G.render_options.flat_beam_offset_per_beam=this.rules.FlatBeamOffsetPerBeam),this.autoTupletVfBeams.push(G);const K=new n.Beam(D++);K.AutoGenerated=!0;for(const q of V)K.addNoteToBeam(q.sourceNote)}V=[],B=O}}else B=O;X||V.push(it)}else B=void 0,F.push(it)}if(V.length>=2){const H=[];for(const $ of V)H.push($.vfStaveNote);const Q=new s.Beam(H,!0);this.rules.FlatBeams&&(Q.render_options.flat_beams=!0,Q.render_options.flat_beam_offset=this.rules.FlatBeamOffset,Q.render_options.flat_beam_offset_per_beam=this.rules.FlatBeamOffsetPerBeam),this.autoTupletVfBeams.push(Q);const ot=new n.Beam(D++);ot.AutoGenerated=!0;for(const $ of V)ot.addNoteToBeam($.sourceNote)}if(F.length>=2){for(const H of F)L.push(H);j.push(L)}const U=this.rules.AutoBeamOptions,Y={beam_middle_only:U.beam_middle_rests_only,beam_rests:U.beam_rests,maintain_stem_directions:U.maintain_stem_directions};if(U.groups&&U.groups.length){const H=[];for(const Q of U.groups)H.push(new s.Fraction(Q[0],Q[1]));Y.groups=H}for(const H of j){const Q=[];for(const $ of H)Q.push($.vfStaveNote);const ot=s.Beam.generateBeams(Q,Y);for(const $ of ot)this.rules.FlatBeams&&($.render_options.flat_beams=!0,$.render_options.flat_beam_offset=this.rules.FlatBeamOffset,$.render_options.flat_beam_offset_per_beam=this.rules.FlatBeamOffsetPerBeam),this.autoVfBeams.push($)}}finalizeTuplets(){this.vftuplets={};for(const v in this.tuplets)if(this.tuplets.hasOwnProperty(v)){let B=this.vftuplets[v];B||(B=this.vftuplets[v]=[]);for(const D of this.tuplets[v]){const L=[],F=D[1];for(const V of F)L.push(V.vfStaveNote);if(L.length>1){const V=D[0],j=V.Notes[0][0].NormalNotes,P=V.shouldBeBracketed(this.rules.TupletsBracketedUseXMLValue,this.rules.TupletsBracketed,this.rules.TripletsBracketed,this.isTabMeasure,this.rules.TabTupletsBracketed);let U=s.Tuplet.LOCATION_TOP;V.tupletLabelNumberPlacement===x.PlacementEnum.Below&&(U=s.Tuplet.LOCATION_BOTTOM);let Y=0;this.isTabMeasure&&(Y=10*this.rules.TabTupletYOffsetBottom,U===s.Tuplet.LOCATION_TOP)&&(Y=-10*this.rules.TabTupletYOffsetTop,V.Notes[0][0]?.hasTabEffects()&&(Y-=10*this.rules.TabTupletYOffsetEffects));const H=new s.Tuplet(L,{bracketed:P,location:U,notes_occupied:j,num_notes:V.TupletLabelNumber,ratioed:V.Ratioed,y_offset:Y});B.push(H)}else e.default.debug("Warning! Tuplet with no notes! Trying to ignore, but this is a serious problem.")}}}layoutStaffEntry(v){}graphicalMeasureCreatedCalculations(){let v,B=[];const D=[];for(const F of this.staffEntries){v=!1,B=[];for(const V of F.graphicalVoiceEntries)if(V.parentVoiceEntry.IsGrace)B.push(V),D.push(V),v||(v=V.parentVoiceEntry.GraceSlur);else if(V.vfStaveNote=o.VexFlowConverter.StaveNote(V),B.length>0){const j=[];for(let Y=0;Y<B.length;Y++){const H=B[Y];H.GraceSlash=H.parentVoiceEntry.GraceNoteSlash,Y>0&&(H.GraceSlash=!1);const Q=o.VexFlowConverter.StaveNote(H);
vendor: 4,098 bytes, line 1
1H.vfStaveNote=Q,j.push(Q)}const P=new s.GraceNoteGroup(j,v);let U=this.rules.GraceNoteGroupXMargin;j.length>1&&(U/=3),P.spacing=10*U,V.vfStaveNote.addModifier(0,P),B=[]}}if(B.length>0)for(const F of B)F.vfStaveNote=o.VexFlowConverter.StaveNote(F),F.parentVoiceEntry.GraceAfterMainNote=!0;this.finalizeBeams(),this.finalizeTuplets();const L=this.getVoicesWithinMeasure();if(this.rules.RenderFingerings)for(const F of this.staffEntries)F.setModifierXOffsets();for(const F of L){if(!F)continue;this.vfVoices[F.VoiceId]=new s.Voice({beat_value:this.parentSourceMeasure.ActiveTimeSignature.Denominator,num_beats:this.parentSourceMeasure.ActiveTimeSignature.Numerator,resolution:s.RESOLUTION}).setMode(s.Voice.Mode.SOFT);const V=this.getRestFilledVexFlowStaveNotesPerVoice(F);for(const j of V){if(j.parentVoiceEntry&&j.parentVoiceEntry.IsGrace&&!j.parentVoiceEntry.GraceAfterMainNote)continue;const P=j;if(0===P.vfStaveNote.getTicks().denominator&&(P.vfStaveNote.getTicks().denominator=1),j.notes.length>0&&j.notes[0].sourceNote&&j.notes[0].sourceNote.NoteTuplet){const Y=j.notes[0].graphicalNoteLength,H=P.vfStaveNote.getTicks();H.numerator=Y.Numerator*s.RESOLUTION,H.denominator=Y.Denominator,H.simplify()}const U=P.parentStaffEntry;if(U&&U.vfClefBefore){if(j.notes[0]&&!j.notes[0].sourceNote.PrintObject){const Q=this.rules.DefaultColorMusic||"#000000";U.vfClefBefore.setStyle({fillStyle:Q,strokeStyle:Q})}const Y=new h([U.vfClefBefore]),H=P.vfStaveNote;H&&"function"==typeof H.addModifier&&H.addModifier(0,Y)}0!==j.notes.length&&j.notes[0]&&j.notes[0].sourceNote.PrintObject?(j.parentVoiceEntry&&this.rules.RenderFingerings&&(this.rules.FingeringPosition!==x.PlacementEnum.Left&&this.rules.FingeringPosition!==x.PlacementEnum.Right||this.createFingerings(j),this.createStringNumber(j)),this.createArpeggio(j),this.vfVoices[F.VoiceId].addTickable(P.vfStaveNote)):this.vfVoices[F.VoiceId].addTickable(P.vfStaveNote)}}this.setStemDirectionFromVexFlow();for(const F of D)this.createFingerings(F),this.createStringNumber(F),this.createArpeggio(F);this.createArticulations(),this.createOrnaments()}createArpeggio(v){if(v.parentVoiceEntry&&v.parentVoiceEntry.Arpeggio)if(v.notes&&v.notes.length>1){const D=o.VexFlowConverter.StrokeTypeFromArpeggioType(v.parentVoiceEntry.Arpeggio.type),L=new s.Stroke(D,{all_voices:this.rules.ArpeggiosGoAcrossVoices});this.rules.RenderArpeggios&&v.vfStaveNote.addStroke(0,L)}else e.default.debug(`[OSMD] arpeggio in measure ${this.MeasureNumber} could not be drawn.\n voice entry had less than two notes, arpeggio is likely between voice entries, not currently supported in Vexflow.`)}setStemDirectionFromVexFlow(){for(const v of this.staffEntries)for(const B of v.graphicalVoiceEntries)for(const D of B.notes){const L=D.vfnote;if(L&&L[0])switch(L[0].getStemDirection()){case s.Stem.UP:B.parentVoiceEntry.StemDirection=E.StemDirectionType.Up;break;case s.Stem.DOWN:B.parentVoiceEntry.StemDirection=E.StemDirectionType.Down}}}createArticulations(){for(let v=0,B=this.staffEntries.length;v<B;++v){const D=this.staffEntries[v].graphicalVoiceEntries;for(const L of D)o.VexFlowConverter.generateArticulations(L.vfStaveNote,L.notes[0],this.rules)}}createOrnaments(){for(let v=0,B=this.staffEntries.length;v<B;++v){const D=this.staffEntries[v].graphicalVoiceEntries;for(const L in D)if(D.hasOwnProperty(L)){const V=D[L].notes[0].sourceNote.ParentVoiceEntry.OrnamentContainer;V&&o.VexFlowConverter.generateOrnaments(D[L].vfStaveNote,V)}}}createFingerings(v){const B=v;let D=0;for(const V of v.notes)V.sourceNote.Fingering&&D++;const L=[];for(const V of v.parentVoiceEntry.TechnicalInstructions)V.type===M.TechnicalInstructionType.Fingering&&L.push(V);if(L.length>D){let V=0;for(const j of v.notes)if(j.sourceNote.Fingering)V++;else{if(V>L.length-1)break;j.sourceNote.Fingering=L[V],V++}}let F=-1;for(const V of v.notes){const j=V.sourceNote.Fingering;if(!j){F++;continue}F++;let P=this.rules.FingeringPosition;this.rules.FingeringPositionGrace===x.PlacementEnum.AboveOrBelow&&(this.isUpperStaffOfInstrument()?P=x.PlacementEnum.Above:this.isLowerStaffOfInstrument()&&
1(P=x.PlacementEnum.Below)),j.placement!==x.PlacementEnum.NotYetDefined&&(P=j.placement);let U,Y=this.rules.FingeringOffsetX;switch(P){default:case x.PlacementEnum.Left:U=s.StaveModifier.Position.LEFT,Y-=V.baseFingeringXOffset*f.unitInPixels;break;case x.PlacementEnum.Right:U=s.StaveModifier.Position.RIGHT,Y+=V.baseFingeringXOffset*f.unitInPixels;break;case x.PlacementEnum.Above:U=s.StaveModifier.Position.ABOVE;break;case x.PlacementEnum.Below:U=s.StaveModifier.Position.BELOW;break;case x.PlacementEnum.NotYetDefined:v.notes.length>1||v.parentStaffEntry.graphicalVoiceEntries.length>1?U=s.StaveModifier.Position.LEFT:0===v.parentStaffEntry.sourceStaffEntry.ParentStaff.idInMusicSheet?(U=s.StaveModifier.Position.ABOVE,P=x.PlacementEnum.Above):(U=s.StaveModifier.Position.BELOW,P=x.PlacementEnum.Below)}const H=new s.FretHandFinger(j.value);if(H.setPosition(U),H.setOffsetX(Y),P===x.PlacementEnum.Above||P===x.PlacementEnum.Below){const Q=P===x.PlacementEnum.Above?-1:1,ot=P===x.PlacementEnum.Above?F:D-1-F;if(this.rules.FingeringInsideStafflines&&D>1){const $=H.getWidth()/2;H.setOffsetY(Q*(ot+2.5*D)*$)}else if(!this.rules.FingeringInsideStafflines){const $=new s.StringNumber(j.value);$.radius=0,$.setPosition(U),$.setOffsetY(Q*ot*$.getWidth()*2/3),B.vfStaveNote.addModifier(F,$);continue}}B.vfStaveNote.addModifier(F,H)}}createStringNumber(v){if(!this.rules.RenderStringNumbersClassical)return;const B=v;v.notes.forEach((D,L)=>{const F=D.sourceNote.StringInstruction;if(F){let V=F.value;switch(V){case"1":V="I";break;case"2":V="II";break;case"3":V="III";break;case"4":V="IV";break;case"5":V="V";break;case"6":V="VI"}const j=new s.StringNumber(V);j.radius=0;const P=-this.rules.StringNumberOffsetY;v.notes.length>1||v.parentStaffEntry.graphicalVoiceEntries.length>1?(j.setOffsetX(13*D.baseStringNumberXOffset),j.setPosition(s.Modifier.Position.RIGHT)):j.setPosition(s.Modifier.Position.ABOVE),j.setOffsetY(P),B.vfStaveNote.addModifier(L,j)}})}lineTo(v,B,D=0){const L=new s.StaveConnector(v.getVFStave(),this.stave);L.setType(B),0!==D&&L.setXShift(D),this.connectors.push(L)}getVFStave(){return this.stave}updateInstructionWidth(){let v=0,B=0;const D=this.stave.getModifiers();for(const L of D)L.getPosition()===T.BEGIN?v+=L.getWidth()+L.getPadding(void 0):L.getPosition()===T.END&&(B+=L.getWidth()+L.getPadding(void 0));this.beginInstructionsWidth=(v??0)/f.unitInPixels,this.endInstructionsWidth=(B??0)/f.unitInPixels}addStaveTie(v,B){this.vfTies.push(v),B.vfTie=v,B.Tie.TieDirection===x.PlacementEnum.Below&&v.setDirection(1)}}var T,A;g.VexFlowMeasure=I,(A=T||(g.StavePositionEnum=T={}))[A.LEFT=1]="LEFT",A[A.RIGHT=2]="RIGHT",A[A.ABOVE=3]="ABOVE",A[A.BELOW=4]="BELOW",A[A.BEGIN=5]="BEGIN",A[A.END=6]="END"},3849(dt,g,u){"use strict";var l=this&&this.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(g,"__esModule",{value:!0}),g.VexFlowMultiRestMeasure=void 0;var s=l(u(3206)).default.Flow;const c=u(5246);g.VexFlowMultiRestMeasure=class r extends c.VexFlowMeasure{constructor(o,n=void 0,h=void 0){super(o,n,h),this.minimumStaffEntriesWidth=-1,h?this.rules=h.ParentMusicSystem.rules:n&&(this.rules=n.Rules),this.resetLayout(),this.multiRestElement=new s.MultiMeasureRest(n.multipleRestMeasures,{})}draw(o){const n=o.openGroup();n&&(n.classList?.add("vf-measure"),n.classList?.add("multi"),n.id=`${this.MeasureNumber}`),this.stave.setContext(o).draw(),this.multiRestElementSVG=o.openGroup("multirest"),this.multiRestElement.setStave(this.stave),this.multiRestElement.setContext(o),this.multiRestElement.draw(),this.multiRestElement.id=`vf-multi${this.MeasureNumber}`,o.closeGroup(),o.closeGroup();for(const h of this.connectors)h.setContext(o).draw()}format(){for(const o of this.staffEntries){const n=this.PositionAndShape.Size.width-this.beginInstructionsWidth;o.PositionAndShape.RelativePosition.x=this.PositionAndShape.Size.width/2+this.beginInstructionsWidth/3,o.PositionAndShape.RelativePosition.y=0;const h=o.graphicalVoiceEntries[0]?.notes[0]?.PositionAndShape;h.BorderLeft=-n/3,h.BorderRight=n/3,h.BorderTop=1,h.BorderBottom=3,o.PositionAndShape.calculateBoundingBox()}}getVoicesWithinMeasure(){return[]}getGraphicalVoiceEntriesPerVoice(o){return[]}getRestFilledVexFlowStaveNotesPerVoice(o){return[]}handleBeam(o,n){}handleTuplet(o,n){}finalizeBeams(){}finalizeTuplets(){}layoutStaffEntry(o){}graphicalMeasureCreatedCalculations(){}createArticulations(){}createOrnaments(){}createFingerings(o){}getVFStave(){return this.stave}}},806(dt,g,u){"use strict";var l=this&&this.__importDefault||function(ot){return ot&&ot.__esMo
vendor: 52,424 bytes, line 1
1dule?ot:{default:ot}};Object.defineProperty(g,"__esModule",{value:!0}),g.VexFlowMusicSheetCalculator=void 0;const s=u(7921),c=u(3753),r=u(5748),i=u(1327),o=u(5054),n=u(2561),h=u(8215),e=u(7785),f=l(u(3206));var m=f.default.Flow;const p=l(u(3065)),E=u(9479),y=u(2395),d=u(7751),S=u(9310),M=u(7809),x=u(7533),_=u(4022),I=u(2400),T=u(9161),A=u(624),v=u(7506),B=u(5282),D=u(6014),L=u(4980),F=u(6659),V=u(6954),j=u(7109),P=u(512),U=u(813),Y=u(1216),H=u(2907);g.VexFlowMusicSheetCalculator=class Q extends s.MusicSheetCalculator{constructor($){super(),this.beamsNeedUpdate=!1,this.previousLyricOverflowsByStaff=new Map,this.previousChordOverflowsByStaff=new Map,this.rules=$,s.MusicSheetCalculator.symbolFactory=new c.VexFlowGraphicalSymbolFactory,s.MusicSheetCalculator.TextMeasurer=new e.VexFlowTextMeasurer(this.rules),s.MusicSheetCalculator.stafflineNoteCalculator=new v.VexflowStafflineNoteCalculator(this.rules),"gonville"===this.rules.DefaultVexFlowNoteFont?.toLowerCase()?f.default.Flow.DEFAULT_FONT_STACK=[f.default.Flow.Fonts?.Gonville,f.default.Flow.Fonts?.Bravura,f.default.Flow.Fonts?.Custom]:"petaluma"===this.rules.DefaultVexFlowNoteFont?.toLowerCase()&&(f.default.Flow.DEFAULT_FONT_STACK=[f.default.Flow.Fonts?.Petaluma,f.default.Flow.Fonts?.Gonville,f.default.Flow.Fonts?.Bravura])}clearRecreatedObjects(){super.clearRecreatedObjects(),s.MusicSheetCalculator.stafflineNoteCalculator=new v.VexflowStafflineNoteCalculator(this.rules);for(const $ of this.graphicalMusicSheet.MeasureList)for(const it of $)it?.clean()}formatMeasures(){for(const $ of this.graphicalMusicSheet.MeasureList)if($&&$[0]){$.find(it=>it?.isVisible()).format();for(const it of $){for(const nt of it.staffEntries)nt.calculateXPosition();it.finalizeBeams()}}this.beamsNeedUpdate=!1}calculateMeasureXLayout($){const it=[];for(const W of $)W?.isVisible()&&it.push(W);if(0===it.length)return 0;$=it;const nt=[],st=new m.Formatter({softmaxFactor:this.rules.SoftmaxFactorVexFlow});let N=$[0].staffEntries.length,C=1;for(const W of $){if(!W)continue;let G=0;for(const Z of W.staffEntries)G+=Z.setMaxAccidentals();W.parentSourceMeasure.ImplicitMeasure&&(N=Math.max(W.staffEntries.length,N),C=Math.max(W.staffEntries.length+G,C));const K=W.vfVoices,q=[];for(const Z in K)if(K.hasOwnProperty(Z)){const et=K[Z];W.hasOnlyRests&&!et.ticksUsed.equals(et.totalTicks)&&(et.ticksUsed=et.totalTicks),q.push(et),nt.push(et)}0!==q.length?st.joinVoices(q):p.default.debug("Found a measure with no voices. Continuing anyway.",K)}let O=12;const X=$[0].parentSourceMeasure;if(nt.length>0){if(O=st.preCalculateMinTotalWidth(nt)/E.unitInPixels*this.rules.VoiceSpacingMultiplierVexflow+this.rules.VoiceSpacingAddendVexflow+.3*N,X?.ImplicitMeasure){O*=X.Duration.RealValue/X.ActiveTimeSignature.RealValue;let K=0;const q=X.measureListIndex;if(q>1)for(const Z of this.graphicalMusicSheet.MeasureList[q-1]){const et=Z?.parentSourceMeasure.endingBarStyleEnum;if(et===V.SystemLinesEnum.ThinBold||et===V.SystemLinesEnum.DotsThinBold){K=this.rules.PickupMeasureRepetitionSpacing;break}}O+=K,N>1?O+=.3*C*1.5:q>1&&1===N&&(O+=this.rules.PickupMeasureSpacingSingleNoteAddend),O*=this.rules.PickupMeasureWidthMultiplier}s.MusicSheetCalculator.setMeasuresMinStaffEntriesWidth($,O);const W=(K,q)=>{st.formatToStave(nt,q.getVFStave())},G=(K,q)=>{st.formatToStave(nt,q.getVFStave(),{align_rests:!0,context:void 0})};for(const K of $){if(this.rules.AlignRests===A.AlignRestOption.Never)K.formatVoices=W;else if(this.rules.AlignRests===A.AlignRestOption.Always)K.formatVoices=G;else if(this.rules.AlignRests===A.AlignRestOption.Auto){let q=!1;for(const Z of K.staffEntries){let et=0,ct=0;for(const pt of Z.graphicalVoiceEntries)if(pt.parentVoiceEntry.IsGrace||pt&&pt.notes&&pt.notes[0]&&pt.notes[0].sourceNote&&pt.notes[0].sourceNote.PrintObject&&et++,pt&&pt.notes&&pt.notes[0]&&pt.notes[0].sourceNote&&pt.notes[0].sourceNote.isRest()&&pt.notes[0].sourceNote.PrintObject&&ct++,et>1&&ct>=1){q=!0;break}if(q)break}K.formatVoices=q?G:W}K===$[0]&&K.formatVoices(O*E.unitInPixels,K)}}for(const W of $)if(W)for(const G of W.staffEntries)G.calculateXPosition();for(const W of $){if(!W)continue;const G=W.vfVoices,K=[];for(const q in G)G.hasOwnProperty(q)&&K.push(G[q]);0!==K.length?st.joinVoices(K):p.default.debug("Found a measure with no voices. Continuing anyway.",G)}return O}calculateElongationFactor($,it,nt,st,N,C,O,X){let W=N,G=0,K=!1;for(const q of $){const Z=q.GraphicalLabel.Label.textAlignment;let et=O,ct=X;if(K=!1,q instanceof y.GraphicalLyricEntry&&q.ParentLyricWord){q.LyricsEntry.SyllableIndex>0&&(et=this.rules.BetweenSyllableMinimumDistance,x.TextAlignment.IsCenterAligned(Z)&&(et+=1));const Ot=q.ParentLyricWord.GetLyricWord.Syllables;Ot.length>1&&q.LyricsEntry.SyllableIndex<Ot.length-1&&(K=!0,void 0===this.dashSpace&&(this.dashSpace=1.5),ct-=this.dashSpace)}const pt=q instanceof y.GraphicalLyricEntry?q.GraphicalLabel.PositionAndShape:q.PositionAndShape,gt=pt.Size.width;let Et,St,Mt,yt,vt=it.PositionAndShape.RelativePosition.x+pt.BorderLeft;q instanceof F.GraphicalChordSymbolContainer&&q.PositionAndShape.Parent.DataObject instanceof r.GraphicalMeasure&&(vt=this.rules.ChordSymbolWholeMeasureRestXOffset+pt.BorderMarginLeft+q.PositionAndShape.Parent.DataObject.beginInstructionsWidth),nt[G]&&(St=vt-nt[G].xPosition);const _t=st*N;x.TextAlignment.IsCenterAligned(Z)?(ct/=4,Mt=_t-vt,yt=gt/2-ct,nt[G]&&(Et=nt[G].labelWidth/2+gt/2+et)):x.TextAlignment.IsLeft(Z)&&(Mt=_t-vt,yt=gt-ct,nt[G]&&(Et=nt[G].labelWidth+et));let At,Nt=1;At=Mt>0?yt/Mt:(vt+yt)/st;let Bt=1;q instanceof y.GraphicalLyricEntry&&q.LyricsEntry?nt[G]&&(Bt=Et/St,nt[G].sourceNoteDuration.Denominator>4&&(Bt*=1.1)):nt[G]&&(Bt=Et/St),Nt=Math.max(At,Bt),W=Math.max(W,Nt);let Ft=Math.max(Et-St||0,0);nt[G]&&(Ft+=nt[G].cumulativeOverlap),nt[G]={cumulativeOverlap:Ft,extend:q instanceof y.GraphicalLyricEntry&&q.LyricsEntry.extend,labelWidth:gt,measureNumber:C,needsDashSpaceAtEnd:K,sourceNoteDuration:q instanceof y.GraphicalLyricEntry&&q.LyricsEntry&&q.LyricsEntry.Parent.Notes[0].Length,text:q instanceof y.GraphicalLyricEntry?q.LyricsEntry.Text:q.GraphicalLabel.Label.text,xPosition:vt},G++}return W}calculateElongationFactorFromStaffEntries($,it,nt,st,N,C){let O=nt;const X={},W={};if(N)for(let G=0;G<N.length;G++){const K=N[G];K>0&&(X[G]={cumulativeOverlap:0,extend:!1,labelWidth:K,measureNumber:st-1,sourceNoteDuration:new n.Fraction(1,4),text:"",xPosition:0})}if(C)for(let G=0;G<C.length;G++){const K=C[G];K>0&&(W[G]={cumulativeOverlap:0,extend:!1,labelWidth:K,measureNumber:st-1,sourceNoteDuration:new n.Fraction(1,4),text:"",xPosition:0})}for(const G of $)G.LyricsEntries.length>0&&this.rules.RenderLyrics&&(O=this.calculateElongationFactor(G.LyricsEntries,G,X,it,O,st,this.rules.HorizontalBetweenLyricsDistance,this.rules.LyricOverlapAllowedIntoNextMeasure)),G.graphicalChordContainers.length>0&&this.rules.RenderChordSymbols&&(O=this.calculateElongationFactor(G.graphicalChordContainers,G,W,it,O,st,this.rules.ChordSymbolXSpacing,this.rules.ChordOverlapAllowedIntoNextMeasure));return{factor:O,lastLyricEntryDict:X,lastChordEntryDict:W}}calculateMeasureWidthFromStaffEntries($,it){let nt=1;const st=[],N=new Set;for(const O of $){if(!O||0===O.staffEntries.length||!O.isVisible())continue;const X=O.ParentStaff;N.add(X);const W=this.previousLyricOverflowsByStaff.get(X),G=this.previousChordOverflowsByStaff.get(X),K=this.calculateElongationFactorFromStaffEntries(O.staffEntries,it,nt,O.MeasureNumber,W,G);nt=K.factor,st.push({staff:X,lastLyricEntryDict:K.lastLyricEntryDict,lastChordEntryDict:K.lastChordEntryDict})}nt=Math.min(nt,this.rules.MaximumLyricsElongationFactor);const C=it*nt;for(const O of st){const X=this.computeContainerOverflows(O.lastLyricEntryDict,C),W=this.computeContainerOverflows(O.lastChordEntryDict,C);this.previousLyricOverflowsByStaff.set(O.staff,X),this.previousChordOverflowsByStaff.set(O.staff,W)}for(const O of Array.from(this.previousLyricOverflowsByStaff.keys()))N.has(O)||this.previousLyricOverflowsByStaff.delete(O);for(const O of Array.from(this.previousChordOverflowsByStaff.keys()))N.has(O)||this.previousChordOverflowsByStaff.delete(O);return C}computeContainerOverflows($,it){const nt=[];for(const st of Object.keys($)){const N=Number(st),C=$[N];if(!C)continue;let X=Math.max(0,C.xPosition+C.labelWidth-it);C.needsDashSpaceAtEnd&&void 0!==this.dashSpace&&(X+=this.dashSpace),nt[N]=X}return nt}createGraphicalTie($,it,nt,st,N){return new o.GraphicalTie($,st,N)}updateStaffLineBorders($){$.SkyBottomLineCalculator.updateStaffLineBorders()}graphicalMeasureCreatedCalculations($){$.rules=this.rules,$.graphicalMeasureCreatedCalculations()}layoutVoiceEntry($,it,nt,st){for(let N=0;N<it.length;N++)it[N]=s.MusicSheetCalculator.stafflineNoteCalculator.positionNote(it[N])}layoutStaffEntry($){$.parentMeasure.layoutStaffEntry($)}initGraphicalMeasuresCreation(){}layoutArticulationMarks($,it,nt){}layoutGraphicalTie($,it,nt){const st=$.StartNote,N=$.EndNote;let C,O,X=0;st&&st.vfnote&&st.vfnote.length>=2&&(C=st.vfnote[0],X=st.vfnote[1]);let W=0;if(N&&N.vfnote&&N.vfnote.length>=2&&(O=N.vfnote[0],W=N.vfnote[1]),it){if(C){const G=new m.StaveTie({first_indices:[X],first_note:C});st.parentVoiceEntry.parentStaffEntry.parentMeasure.addStaveTie(G,$)}if(O){const G=new m.StaveTie({last_indices:[W],last_note:O});N.parentVoiceEntry.parentStaffEntry.parentMeasure.addStaveTie(G,$)}}else if(C||O){let G;if(nt)if("S"===$.Tie.Type){let Z=1;$.StartNote.sourceNote.FretNumber>$.EndNote.sourceNote.FretNumber&&(Z=-1),G=new m.TabSlide({first_indices:[X],first_note:C,last_indices:[W],last_note:O},Z)}else G=new m.TabTie({first_indices:[X],first_note:C,last_indices:[W],last_note:O},$.Tie.Type);else{G=new m.StaveTie({first_indices:[X],first_note:C,last_indices:[W],last_note:O});const K=$.Tie.getTieDirection(st.sourceNote);K===L.PlacementEnum.Below?G.setDirection(1):K===L.PlacementEnum.Above&&G.setDirection(-1)}N.parentVoiceEntry.parentStaffEntry.parentMeasure.addStaveTie(G,$)}}calculateDynamicExpressionsForMultiExpression($,it,nt){if(it<this.rules.MinMeasureToDrawIndex||it>this.rules.MaxMeasureToDrawIndex)return;const st=$.AbsoluteTimestamp,N=this.graphicalMusicSheet.MeasureList[it],C=N[nt].ParentStaffLine,O=N[nt],X=$.StartingContinuousDynamic,W=void 0!==X&&!X.IsStartOfSoftAccent,G=this.getRelativePositionInStaffLineFromTimestamp(st,nt,C,C?.isPartOfMultiStaffInstrument(),void 0,W);if(G.x<=0&&(G.x=O.beginInstructionsWidth+this.rules.RhythmRightMargin),$.InstantaneousDynamic){const K=new M.VexFlowInstantaneousDynamicExpression($.InstantaneousDynamic,C,O);this.calculateGraphicalInstantaneousDynamicExpression(K,G,st),this.dynamicExpressionMap.set(st.RealValue,K.PositionAndShape)}if(X){const K=new I.VexFlowContinuousDynamicExpression(X,C,O.parentSourceMeasure);if(K.StartMeasure=O,K.IsSoftAccent=$.StartingContinuousDynamic.IsStartOfSoftAccent,!K.IsVerbal&&X.EndMultiExpression)try{this.calculateGraphicalContinuousDynamic(K,G),K.updateSkyBottomLine()}catch{}else K.IsVerbal?this.calculateGraphicalVerbalContinuousDynamic(K,G):p.default.warn("This continuous dynamic is not covered. measure"+$.SourceMeasureParent.MeasureNumber)}}createMetronomeMark($){const it=$.ParentMultiTempoExpression.SourceMeasureParent.MeasureNumber,nt=Math.max($.StaffNumber-1,0),st=this.graphicalMusicSheet.findGraphicalMeasureByMeasureNumber(it,nt),N=st===this.graphicalMusicSheet.MeasureList[0][0];if(st.hasMetronomeMark)return;const C=st.getVFStave();let O=this.rules.MetronomeMarkYShift,X=!1;for(const K of $.parentMeasure.TempoExpressions){const q=K.InstantaneousTempo?.TempoType===T.TempoType.metronomeMark;if(K.getPlacementOfFirstEntry()===L.PlacementEnum.Above&&!q){X=!0;break}}X&&(O-=1.4);const W=this.graphicalMusicSheet.MeasureList[0][0].ParentStaffLine?.SkyLine;if($.metronomeNoteGroupLeft&&$.metronomeNoteGroupRight){const K=this.buildNoteEquationForVexFlow($.metronomeNoteGroupLeft,$.metronomeNoteGroupRight);C.setTempo({noteEquation:K},O*E.unitInPixels)}else{let K="q";if($.beatUnit){const q=B.NoteTypeHandler.getNoteDurationFromType($.beatUnit);K=D.VexFlowConverter.durations(q,!1)[0]}C.setTempo({bpm:$.TempoInBpm,dots:$.dotted,duration:K},O*E.unitInPixels)}const G=N?this.rules.MetronomeMarkXShift*E.unitInPixels:0;C.getModifiers()[C.getModifiers().length-1].setShiftX(G),st.hasMetronomeMark=!0,W&&(W[0]=Math.min(W[0],-4.5+O))}buildNoteEquationForVexFlow($,it){const nt=st=>{const N={notes:st.notes.map(C=>{const O=B.NoteTypeHandler.getNoteDurationFromType(C.type);return{duration:D.VexFlowConverter.durations(O,!1)[0],dots:C.dots,beam:C.beam}})};return st.tuplet&&(N.tuplet={actualNotes:st.tuplet.actualNotes,normalNotes:st.tuplet.normalNotes,bracket:st.tuplet.bracket,showNumber:st.tuplet.showNumber}),N};return{left:nt($),right:nt(it)}}calculateRehearsalMark($){const it=$.rehearsalExpression;if(!it)return;const st=Math.max($.MeasureNumber-this.graphicalMusicSheet.MeasureList[0][0].MeasureNumber,0);for(const N of this.graphicalMusicSheet.MeasureList[st]){const C=N?.getVFStave();if(!C||!N.isVisible())continue;let O=-this.rules.RehearsalMarkYOffsetDefault-this.rules.RehearsalMarkYOffset;N.parentSourceMeasure.isReducedToMultiRest&&(O+=this.rules.RehearsalMarkYOffsetAddedForRehearsalMarks);let X=this.rules.RehearsalMarkXOffsetDefault+this.rules.RehearsalMarkXOffset;return $.IsSystemStartMeasure&&(X+=this.rules.RehearsalMarkXOffsetSystemStartMeasure),void C.setSection(it.label,O,X,this.rules.RehearsalMarkFontSize)}}calculateSingleOctaveShift($,it,nt,st){const N=it.OctaveShiftStart,C=N.ParentStartMultiExpression.Timestamp,O=N.ParentEndMultiExpression?.Timestamp,X=this.rules.MinMeasureToDrawIndex,W=this.rules.MaxMeasureToDrawIndex;let G,K,q=this.graphicalMusicSheet.MeasureList[nt][st].ParentStaffLine;if(q||(q=this.graphicalMusicSheet.MeasureList[X][st].ParentStaffLine),G=N.ParentEndMultiExpression?this.graphicalMusicSheet.getGraphicalMeasureFromSourceMeasureAndIndex(N.ParentEndMultiExpression.SourceMeasureParent,st):this.graphicalMusicSheet.getLastGraphicalMeasureFromIndex(st,!0),G.MeasureNumber>W+1&&(G=this.graphicalMusicSheet.getLastGraphicalMeasureFromIndex(st,!0)),K=N.ParentStartMultiExpression?this.graphicalMusicSheet.getGraphicalMeasureFromSourceMeasureAndIndex(N.ParentStartMultiExpression.SourceMeasureParent,st):this.graphicalMusicSheet.MeasureList[X][st],K.MeasureNumber<X+1&&(K=this.graphicalMusicSheet.MeasureList[X][st]),K.parentSourceMeasure.measureListIndex<X||K.parentSourceMeasure.measureListIndex>W||G.parentSourceMeasure.measureListIndex<X||G.parentSourceMeasure.measureListIndex>W)return;let Z=G.ParentStaffLine;if(Z||(Z=q),G&&q&&Z){const et=new S.VexFlowOctaveShift(N,q.PositionAndShape);if(!et.startNote){let gt;for(const Et of K.staffEntries)if(Et){gt=Et;break}if(!gt||(et.setStartNote(gt),!et.startNote))return}if(!et.endNote){let gt;for(let Et=G.staffEntries.length-1;Et>=0;Et++)if(G.staffEntries[Et]){gt=G.staffEntries[Et];break}if(!gt)return void(et.graphicalEndAtMeasureEnd=!0);if(et.setEndNote(gt),!et.endNote)return}let ct=K.findGraphicalStaffEntryFromTimestamp(C);ct||(ct=K.staffEntries[0]);let pt=G.findGraphicalStaffEntryFromTimestamp(O);if(!pt)for(let gt=G.staffEntries.length-1;gt>=0;gt--){const Et=G.staffEntries[gt];if(Et.relInMeasureTimestamp?.lte(O)){pt=Et;break}}if(pt||(pt=G.staffEntries[G.staffEntries.length-1]),et.setStartNote(ct),Z!==q){et.endsOnDifferentStaffLine=!0;let gt=this.findLastStafflineMeasure(q);void 0===gt&&(gt=G);const Et=gt.staffEntries[gt.staffEntries.length-1];if(et.setEndNote(Et),et.graphicalEndAtMeasureEnd=!0,et.endMeasure=gt,Z.ParentMusicSystem.Id-q.ParentMusicSystem.Id>0)for(let St=q.ParentMusicSystem.Id;St<Z.ParentMusicSystem.Id;St++){const yt=this.musicSystems[St+1];let vt;for(const Rt of yt.StaffLines)if(Rt.ParentStaff.idInMusicSheet===st){vt=Rt;break}if(!vt)continue;const _t=vt.Measures[0],At=new S.VexFlowOctaveShift(N,_t.PositionAndShape);let Nt=this.findLastStafflineMeasure(vt);St<Z.ParentMusicSystem.Id-1&&(At.endsOnDifferentStaffLine=!0,At.graphicalEndAtMeasureEnd=!0,At.endMeasure=Nt);const Bt=_t.staffEntries[0];let Ft=Nt.staffEntries[Nt.staffEntries.length-1];G.ParentStaffLine===vt&&(Nt=G,Ft=pt),1===Ft.graphicalVoiceEntries.length&&1===Ft.graphicalVoiceEntries[0].notes.length&&Ft.graphicalVoiceEntries[0].notes[0].sourceNote.isWholeMeasureNote()&&(At.graphicalEndAtMeasureEnd=!0,At.endMeasure=Nt);const Ot="VexFlowMusicSheetCalculator.calculateSingleOctaveShift: ";Bt||p.default.warn(Ot+"no firstNote found"),Ft||p.default.warn(Ot+"no lastNote found"),At.setStartNote(Bt),At.setEndNote(Ft,G.ParentStaffLine===vt&&N.endVoiceEntryIndex>0?N.endVoiceEntryIndex:-1),vt.OctaveShifts.push(At),this.calculateOctaveShiftSkyBottomLine(Bt,Ft,At,vt)}this.calculateOctaveShiftSkyBottomLine(ct,Et,et,q)}else et.setEndNote(pt,N.endVoiceEntryIndex>0?N.endVoiceEntryIndex:-1),this.calculateOctaveShiftSkyBottomLine(ct,pt,et,q);q.OctaveShifts.push(et)}else p.default.warn("End measure or staffLines for octave shift are undefined! This should not happen!")}findLastStafflineMeasure($){for(let it=$.Measures.length-1;it>=0;it--){const nt=$.Measures[it];if(nt.staffEntries.length>0)return nt}}calculateSinglePedal($,it,nt,st){const N=it.PedalStart,C=N.ParentStartMultiExpression.Timestamp,O=N.ParentEndMultiExpression?.Timestamp,X=this.rules.MinMeasureToDrawIndex,W=this.rules.MaxMeasureToDrawIndex;let G,K,q=this.graphicalMusicSheet.MeasureList[nt][st].ParentStaffLine;if(q||(q=this.graphicalMusicSheet.MeasureList[X][st].ParentStaffLine),G=N.ParentEndMultiExpression?this.graphicalMusicSheet.getGraphicalMeasureFromSourceMeasureAndIndex(N.ParentEndMultiExpression.SourceMeasureParent,st):this.graphicalMusicSheet.getLastGraphicalMeasureFromIndex(st,!0),G.MeasureNumber>W+1&&(G=this.graphicalMusicSheet.getLastGraphicalMeasureFromIndex(st,!0)),N.ParentEndMultiExpression?K=this.graphicalMusicSheet.getGraphicalMeasureFromSourceMeasureAndIndex(N.ParentStartMultiExpression.SourceMeasureParent,st):(K=this.graphicalMusicSheet.getGraphicalMeasureFromSourceMeasureAndIndex(N.ParentStartMultiExpression.SourceMeasureParent,st),K||(K=this.graphicalMusicSheet.MeasureList[X][st])),K.MeasureNumber<X+1&&(K=this.graphicalMusicSheet.MeasureList[X][st]),K.parentSourceMeasure.measureListIndex<X||K.parentSourceMeasure.measureListIndex>W||G.parentSourceMeasure.measureListIndex<X||G.parentSourceMeasure.measureListIndex>W)return;let Z=G.ParentStaffLine;if(Z||(Z=q),G&&q&&Z){let et=!1;q!==Z&&(et=!0);const ct=new j.VexFlowPedal(N,q.PositionAndShape,!1,et);ct.setEndsStave(G,O);let pt=K.findGraphicalStaffEntryFromTimestamp(C);pt||(pt=K.staffEntries[0]);let gt=G.findGraphicalStaffEntryFromTimestamp(O);if(gt||(gt=G.staffEntries[G.staffEntries.length-1]),!ct.setStartNote(pt))return;if(ct.setBeginsStave(ct.startNote.isRest(),C),Z!==q)if(ct.pedalSymbol===P.MusicSymbol.PEDAL_SYMBOL){ct.setEndNote(gt),ct.setEndMeasure(G),ct.ReleaseText=" ",ct.CalculateBoundingBox(),this.calculatePedalSkyBottomLine(ct.startVfVoiceEntry,ct.endVfVoiceEntry,ct,q);const Et=Z.Measures[0],St=new j.VexFlowPedal(N,Et.PositionAndShape);if(ct.setEndsStave(G,O),!St.setStartNote(Et.staffEntries[0]))return;St.setEndNote(gt),St.setEndMeasure(G),ct.setEndMeasure(G),Z.Pedals.push(St),St.CalculateBoundingBox(),St.DepressText=" ",this.calculatePedalSkyBottomLine(St.startVfVoiceEntry,St.endVfVoiceEntry,St,Z)}else{let Et=this.findLastStafflineMeasure(q);void 0===Et&&(Et=G),ct.setEndNote(Et.staffEntries[Et.staffEntries.length-1]),ct.setEndMeasure(G),ct.ChangeEnd=!1;const Mt=Z.ParentMusicSystem.Id-q.ParentMusicSystem.Id;if(Mt>0){let yt=1;for(let vt=q.ParentMusicSystem.Id;vt<Z.ParentMusicSystem.Id;vt++){const _t=this.musicSystems[vt+1].StaffLines[st],At=_t.Measures[0];let Nt=!1,Bt=!1;yt<Mt?Nt=!0:Bt=!0,yt++;const Ft=new j.VexFlowPedal(N,At.PositionAndShape,!0,Nt);ct.setEndsStave(G,O),Ft.ChangeBegin=!1,Ft.ChangeEnd=!!Bt&&N.ChangeEnd;let Ot=this.findLastStafflineMeasure(_t);const It=At.staffEntries[0];let Rt=Ot.staffEntries[Ot.staffEntries.length-1];if(G.ParentStaffLine===_t?(Ot=G,Ft.setEndMeasure(G),Rt=gt):Ft.setEndMeasure(_t.Measures.last()),!Ft.setStartNote(It))break;Ft.setEndNote(Rt),ct.setEndMeasure(G),_t.Pedals.push(Ft),Ft.CalculateBoundingBox(),this.calculatePedalSkyBottomLine(Ft.startVfVoiceEntry,Ft.endVfVoiceEntry,Ft,_t)}}ct.CalculateBoundingBox(),this.calculatePedalSkyBottomLine(ct.startVfVoiceEntry,ct.endVfVoiceEntry,ct,q)}else ct.setEndNote(gt),ct.setEndMeasure(G),ct.CalculateBoundingBox(),this.calculatePedalSkyBottomLine(ct.startVfVoiceEntry,ct.endVfVoiceEntry,ct,q);q.Pedals.push(ct)}else p.default.warn("End measure or staffLines for pedal are undefined! This should not happen!")}calculateSingleWavyLine($,it,nt,st){const N=it.WavyLineStart,C=N.ParentStartMultiExpression.Timestamp,O=N.ParentEndMultiExpression?.Timestamp,X=this.rules.MinMeasureToDrawIndex,W=this.rules.MaxMeasureToDrawIndex;let G,K,q=this.graphicalMusicSheet.MeasureList[nt][st].ParentStaffLine;if(q||(q=this.graphicalMusicSheet.MeasureList[X][st].ParentStaffLine),G=N.ParentEndMultiExpression?this.graphicalMusicSheet.getGraphicalMeasureFromSourceMeasureAndIndex(N.ParentEndMultiExpression.SourceMeasureParent,st):this.graphicalMusicSheet.getLastGraphicalMeasureFromIndex(st,!0),G.MeasureNumber>W+1&&(G=this.graphicalMusicSheet.getLastGraphicalMeasureFromIndex(st,!0)),K=N.ParentEndMultiExpression?this.graphicalMusicSheet.getGraphicalMeasureFromSourceMeasureAndIndex(N.ParentStartMultiExpression.SourceMeasureParent,st):this.graphicalMusicSheet.MeasureList[X][st],K.MeasureNumber<X+1&&(K=this.graphicalMusicSheet.MeasureList[X][st]),K.parentSourceMeasure.measureListIndex<X||K.parentSourceMeasure.measureListIndex>W||G.parentSourceMeasure.measureListIndex<X||G.parentSourceMeasure.measureListIndex>W)return;let Z=G.ParentStaffLine;if(Z||(Z=q),G&&q&&Z){const et=new H.VexFlowVibratoBracket(N,q.PositionAndShape,K.ParentStaff.isTab);let ct=K.findGraphicalStaffEntryFromTimestamp(C);ct||(ct=K.staffEntries[0]);let pt=G.findGraphicalStaffEntryFromTimestamp(O);if(pt||(pt=G.staffEntries[G.staffEntries.length-1]),et.setStartNote(ct),Z!==q){let gt=q.Measures[q.Measures.length-1];void 0===gt&&(gt=G);const Et=gt.staffEntries[gt.staffEntries.length-1];if(Et&&et.setEndNote(Et),Z.ParentMusicSystem.Id-q.ParentMusicSystem.Id>0)for(let St=q.ParentMusicSystem.Id;St<Z.ParentMusicSystem.Id;St++){const Mt=this.musicSystems[St+1].StaffLines[st],yt=Mt.Measures[0],vt=new H.VexFlowVibratoBracket(N,yt.PositionAndShape,Mt.ParentStaff.isTab);let _t=Mt.Measures[Mt.Measures.length-1],Nt=_t.staffEntries[_t.staffEntries.length-1];G.ParentStaffLine===Mt&&(_t=G,Nt=pt),vt.setStartNote(yt.staffEntries[0]),vt.setEndNote(Nt),Mt.WavyLines.push(vt),vt.CalculateBoundingBox(),this.calculateWavyLineSkyBottomLine(vt.startVfVoiceEntry,vt.endVfVoiceEntry,vt,Mt)}et.CalculateBoundingBox(),this.calculateWavyLineSkyBottomLine(et.startVfVoiceEntry,et.endVfVoiceEntry,et,q)}else et.setEndNote(pt),et.CalculateBoundingBox(),this.calculateWavyLineSkyBottomLine(et.startVfVoiceEntry,et.endVfVoiceEntry,et,q);q.WavyLines.push(et)}else p.default.warn("End measure or staffLines for wavy line are undefined! This should not happen!")}calculateWavyLineSkyBottomLine($,it,nt,st){const N=nt.startNote.getStave();let C=nt.endNote?.getStave();C||(C=N,it=$);const O=Math.max(N.options.top_text_position,C.options.top_text_position);N.options.top_text_position=O,C.options.top_text_position=O;let X,W=-O,G=0,K=0,q=1/0,Z=1/0,et=$.PositionAndShape.AbsolutePosition.x+$.PositionAndShape.BorderLeft;if($.parentVoiceEntry?.OrnamentContainer?.GetOrnament===h.OrnamentEnum.Trill&&(G=et,et+=2,K=et,q=st.SkyBottomLineCalculator.getSkyLineMinInRange(G,K),Z=q+1.85),nt.ToEndOfStopStave)X=it.parentStaffEntry.parentMeasure.PositionAndShape.AbsolutePosition.x+it.parentStaffEntry.parentMeasure.PositionAndShape.BorderRight-1;else{X=it.PositionAndShape.AbsolutePosition.x+it.PositionAndShape.BorderRight;const ct=it.parentStaffEntry.vfClefBefore;ct&&(X+=ct.getWidth()/10)}W=st.SkyBottomLineCalculator.getSkyLineMinInRange(et,X),W!==1/0&&(W<q?(N.options.top_text_position=-W,C.options.top_text_position=-W,st.SkyBottomLineCalculator.updateSkyLineInRange(G,K,W-1.85)):(nt.line=-Z,W=Z),W-=nt.PositionAndShape.Size.height,st.SkyBottomLineCalculator.updateSkyLineInRange(et,X,W))}calculatePedalSkyBottomLine($,it,nt,st){let N=it?.PositionAndShape;N||(N=nt.endMeasure.PositionAndShape);const C=f.default.Flow.PedalMarking.Styles,O=nt.getPedalMarking(),X=O.line+3+(st.StaffLines.length-1),W=O.render_options.text_margin_right/10;let G,K=$.PositionAndShape.AbsolutePosition.x-W;O.style!==C.MIXED&&O.style!==C.MIXED_OPEN_END&&O.style!==C.TEXT||(K-=1);let q=st.StaffLines.length-1;for(const Z of st.Pedals){const et=Z.getPedalMarking().line+3+(st.StaffLines.length-1);q=Math.max(et,q)}if(nt.EndSymbolPositionAndShape){const Z=O.render_options.glyph_point_size/20;G=K+3.4;const et=N.AbsolutePosition.x-W,ct=et+1.5;q=Math.max(st.SkyBottomLineCalculator.getBottomLineMaxInRange(K,G),q),q=Math.max(X+2*Z,q);const pt=st.SkyBottomLineCalculator.getBottomLineMaxInRange(et,ct);nt.DepressText||(q=Math.max(q,pt)),nt.setLine(q-3-(st.StaffLines.length-1)),st.SkyBottomLineCalculator.updateBottomLineInRange(K,G,q+Z),st.SkyBottomLineCalculator.updateBottomLineInRange(et,ct,q+Z)}else{const Z=O.render_options.bracket_height/10;if(O.EndsStave)G=it?it.parentStaffEntry.parentMeasure.PositionAndShape.AbsolutePosition.x+it.parentStaffEntry.parentMeasure.PositionAndShape.Size.width-W:N.AbsolutePosition.x+N.Size.width;else switch(O.style){case C.BRACKET_OPEN_END:case C.BRACKET_OPEN_BOTH:case C.MIXED_OPEN_END:G=N.AbsolutePosition.x+N.BorderRight-W;break;default:G=N.AbsolutePosition.x+N.BorderLeft-W}const et=it?.parentStaffEntry?.vfClefBefore;if(et&&(G+=et.getWidth()/10),q=Math.max(st.SkyBottomLineCalculator.getBottomLineMaxInRange(K,G),q),q===1/0)return;if(q=Math.max(q,X+Z),nt.setLine(q-3-(st.StaffLines.length-1)),K>G){const ct=G;G=K,K=ct}st.SkyBottomLineCalculator.updateBottomLineInRange(K,G,q+Z)}for(const Z of st.Pedals){const et=Z,ct=et.getPedalMarking();if(q>ct.line+3+(st.StaffLines.length-1)){const pt=ct.render_options.text_margin_right/10;let gt,Et=et.startVfVoiceEntry.PositionAndShape.AbsolutePosition.x-pt;et.setLine(q-3-(st.StaffLines.length-1));let St=et.endVfVoiceEntry?.PositionAndShape;if(St||(St=et.endMeasure.PositionAndShape),et.EndSymbolPositionAndShape){const Mt=O.render_options.glyph_point_size/20;gt=Et+3.4;const yt=St.AbsolutePosition.x-pt,vt=yt+1.5;st.SkyBottomLineCalculator.updateBottomLineInRange(Et,gt,q+Mt),st.SkyBottomLineCalculator.updateBottomLineInRange(yt,vt,q+Mt)}else{const Mt=ct.render_options.bracket_height/10;if(ct.EndsStave)gt=St.AbsolutePosition.x+St.Size.width-pt;else switch(O.style){case C.BRACKET_OPEN_END:case C.BRACKET_OPEN_BOTH:case C.MIXED_OPEN_END:gt=St.AbsolutePosition.x+St.BorderRight-pt;break;default:gt=St.AbsolutePosition.x+St.BorderLeft-pt}const yt=et.endVfVoiceEntry?.parentStaffEntry?.vfClefBefore;if(yt&&(gt+=yt.getWidth()/10),Et>gt){const vt=Et;Et=gt,gt=vt}st.SkyBottomLineCalculator.updateBottomLineInRange(Et,gt,q+Mt)}}}}calculateOctaveShiftSkyBottomLine($,it,nt,st){if(!it)return void p.default.warn("octaveshift: no endStaffEntry");let N=it.PositionAndShape;nt.graphicalEndAtMeasureEnd&&(N=it.parentMeasure.PositionAndShape);let C=$.PositionAndShape.Size.width,O=N.Size.width;$.hasOnlyRests()?C=-C:C/=2,nt.graphicalEndAtMeasureEnd||(it.hasOnlyRests()?O*=2:O/=2,$===it&&(O*=2));let X=$.PositionAndShape.AbsolutePosition.x-C,W=N.AbsolutePosition.x+O;if(X>W){const q=X;X=W,W=q}nt.PositionAndShape.Size.width=W-X;const G=nt.getTextBracket(),K=G.font.size/10;if(G.position===m.TextBracket.Positions.TOP){const q=Math.ceil(st.SkyBottomLineCalculator.getSkyLineMinInRange(X,W));if(q===1/0)return;G.start.getStave().options.top_text_position=Math.abs(q),st.SkyBottomLineCalculator.updateSkyLineInRange(X,W,q-2*K)}else{const q=st.SkyBottomLineCalculator.getBottomLineMaxInRange(X,W);if(q===1/0)return;G.start.getStave().options.bottom_text_position=q,st.SkyBottomLineCalculator.updateBottomLineInRange(X,W,q+1.5*K)}}calculateWordRepetitionInstruction($,it){let nt;const st=this.graphicalMusicSheet.MeasureList[it];for(let N=0,C=st.length;N<C;++N){const O=st[N];if(O&&O.ParentStaffLine&&O.ParentStaff.isVisible()){nt=O;break}}nt&&nt.addWordRepetition($)}calculateSkyBottomLines(){const $=U.CollectionUtil.flat(this.musicSystems.map(nt=>nt.StaffLines));let it=0;for(const nt of $)for(const st of nt.Measures)st&&it++;if(this.rules.AlwaysSetPreferredSkyBottomLineBackendAutomatically&&this.rules.setPreferredSkyBottomLineBackendAutomatically(it),it>=this.rules.SkyBottomLineBatchMinMeasures)new i.SkyBottomLineBatchCalculator($,this.rules.PreferredSkyBottomLineBatchCalculatorBackend).calculateLines();else for(const nt of $)nt.SkyBottomLineCalculator.calculateLines()}calculateExpressionAlignements(){for(const $ of this.musicSystems)for(const it of $.StaffLines)try{it.AlignmentManager.alignDynamicExpressions(),it.AbstractExpressions.forEach(nt=>{nt.updateSkyBottomLine()})}catch{}}handleTiedGraphicalNote($,it,nt,st,N,C,O,X){}handleBeam($,it,nt){$.parentVoiceEntry.parentStaffEntry.parentMeasure.handleBeam($,it)}handleVoiceEntryLyrics($,it,nt){$.LyricsEntries.forEach((st,N)=>{const C=new y.GraphicalLyricEntry(N,it,this.rules.LyricsHeight,this.rules.StaffHeight);if(it.LyricsEntries.push(C),C.GraphicalLabel.setLabelPositionAndShapeBorders(),N.Word){const O=N.Word.Syllables.indexOf(N);let X=nt.indexOf(N.Word);if(-1===X&&(nt.push(N.Word),X=nt.indexOf(N.Word)),0===this.graphicalLyricWords.length||X>this.graphicalLyricWords.length-1){const W=new d.GraphicalLyricWord(N.Word);C.ParentLyricWord=W,W.GraphicalLyricsEntries[O]=C,this.graphicalLyricWords.push(W)}else{const W=this.graphicalLyricWords[X];C.ParentLyricWord=W,W.GraphicalLyricsEntries[O]=C,W.isFilled()&&(nt.splice(X,1),this.graphicalLyricWords.splice(this.graphicalLyricWords.indexOf(W),1))}}})}handleVoiceEntryOrnaments($,it,nt){}handleVoiceEntryArticulations($,it,nt){}handleVoiceEntryTechnicalInstructions($,it,nt){}handleTuplet($,it,nt){$.parentVoiceEntry.parentStaffEntry.parentMeasure.handleTuplet($,it)}findIndexGraphicalSlurFromSlur($,it){for(let nt=0;nt<$.length;nt++)if($[nt].slur===it)return nt;return-1}indexOfGraphicalGlissFromGliss($,it){for(let nt=0;nt<$.length;nt++)if($[nt].Glissando===it)return nt;return-1}calculateSlurs(){const $={};for(const it of this.graphicalMusicSheet.MeasureList[0])$[it.ParentStaff.idInMusicSheet]=[];for(const it of this.musicSystems)for(const nt of it.StaffLines){const st=$[nt.ParentStaff.idInMusicSheet];for(let N=0;N<st.length;N++){const O=new _.GraphicalSlur(st[N].slur,this.rules);nt.addSlurToStaffline(O),st[N]=O}for(const N of nt.Measures)for(const C of N.staffEntries){for(const O of C.graphicalVoiceEntries)for(const X of O.notes)for(const W of X.sourceNote.NoteSlurs)if(W.EndNote&&W.StartNote){if(W.StartNote===X.sourceNote){const G=new _.GraphicalSlur(W,this.rules);st.push(G),nt.addSlurToStaffline(G)}if(W.EndNote===X.sourceNote){const G=this.findIndexGraphicalSlurFromSlur(st,W);if(G>=0){const K=st[G];-1===K.staffEntries.indexOf(C)&&K.staffEntries.push(C),st.splice(G,1)}}}for(const O of st)-1===O.staffEntries.indexOf(C)&&O.staffEntries.push(C)}}for(const it of this.musicSystems)for(const nt of it.StaffLines){const st=nt.GraphicalSlurs.sort(_.GraphicalSlur.Compare);for(const N of st)N.slur.isCrossed()||N.calculateCurve(this.rules)}}calculateGlissandi(){const $={};for(const it of this.graphicalMusicSheet.MeasureList[0])$[it.ParentStaff.idInMusicSheet]=[];for(const it of this.musicSystems)for(const nt of it.StaffLines){const st=$[nt.ParentStaff.idInMusicSheet];for(let N=0;N<st.length;N++){const O=new Y.VexFlowGlissando(st[N].Glissando);nt.addGlissandoToStaffline(O),st[N]=O}for(const N of nt.Measures)for(const C of N.staffEntries){for(const O of C.graphicalVoiceEntries)for(const X of O.notes){const W=X.sourceNote.NoteGlissando;if(W?.EndNote&&W?.StartNote){if(W.StartNote===X.sourceNote){const G=new Y.VexFlowGlissando(W);st.push(G),nt.addGlissandoToStaffline(G)}if(W.EndNote===X.sourceNote){const G=this.indexOfGraphicalGlissFromGliss(st,W);if(G>=0){const K=st[G];-1===K.staffEntries.indexOf(C)&&K.staffEntries.push(C),st.splice(G,1)}}}}for(const O of st)-1===O.staffEntries.indexOf(C)&&O.staffEntries.push(C)}}for(const it of this.musicSystems)for(const nt of it.StaffLines)for(const st of nt.GraphicalGlissandi)if(nt.ParentStaff.isTab){const N=st.Glissando.StartNote,C=st.Glissando.EndNote,O=st.staffEntries[0].findGraphicalNoteFromNote(N),X=st.staffEntries.last().findGraphicalNoteFromNote(C);if(!O&&!X)return;let W,G,K,q,Z=1;N.FretNumber>C.FretNumber&&(Z=-1),O&&O.vfnote&&O.vfnote.length>=2&&(K=O.vfnote[0],W=[0]),X&&X.vfnote&&X.vfnote.length>=2&&(q=X.vfnote[0],G=[0]);const et=new m.TabSlide({first_indices:W,first_note:K,last_indices:G,last_note:q},Z),ct=O?.parentVoiceEntry.parentStaffEntry.parentMeasure;ct&&(ct.vfTies.push(et),st.vfTie=et);const pt=X?.parentVoiceEntry.parentStaffEntry.parentMeasure;pt&&(pt.vfTies.push(et),st.vfTie=et)}}}},9479(dt,g,u){"use strict";var l=this&&this.__importDefault||function(M){return M&&M.__esModule?M:{default:M}};Object.defineProperty(g,"__esModule",{value:!0}),g.VexFlowMusicSheetDrawer=g.unitInPixels=void 0;const s=l(u(3206)),c=u(1932),r=u(200),i=u(9409),o=u(7785),n=u(2683),h=u(6362),e=u(3361),f=u(5023),m=l(u(3065)),p=u(1066),E=u(3661),y=u(5824),d=u(9436);g.unitInPixels=10,g.VexFlowMusicSheetDrawer=class S extends c.MusicSheetDrawer{constructor(x=new E.DrawingParameters){super(new o.VexFlowTextMeasurer(x.Rules),x),this.backends=[],this.zoom=1,this.pageIdx=0}get Backends(){return this.backends}drawSheet(x){"gonville"===this.rules.DefaultVexFlowNoteFont&&(s.default.Flow.DEFAULT_FONT_STACK=[s.default.Flow.Fonts?.Gonville,s.default.Flow.Fonts?.Bravura,s.default.Flow.Fonts?.Custom]),s.default.Flow.STAVE_LINE_THICKNESS=this.rules.StaffLineWidth*g.unitInPixels,s.default.Flow.STEM_WIDTH=this.rules.StemWidth*g.unitInPixels,s.default.Flow.DEFAULT_NOTATION_FONT_SCALE=this.rules.VexFlowDefaultNotationFontScale,s.default.Flow.DEFAULT_TAB_FONT_SCALE=this.rules.VexFlowDefaultTabFontScale,this.pageIdx=0;for(const _ of x.MusicPages){if(_.PageNumber>this.rules.MaxPageToDrawNumber)break;const I=this.backends[this.pageIdx];I.graphicalMusicPage=_,I.scale(this.zoom),this.pageIdx+=1}this.pageIdx=0,this.backend=this.backends[0],super.drawSheet(x)}drawPage(x){x&&(this.backend=this.backends[x.PageNumber-1],super.drawPage(x),this.pageIdx+=1)}clear(){for(const x of this.backends)x.clear()}setZoom(x){this.zoom=x}calculatePixelDistance(x){return x*g.unitInPixels}drawStaffLine(x){const _=this.backend.getContext(),I=_.openGroup();I&&(I.classList.add("staffline"),x.ParentStaff&&(I.id=`${x.ParentStaff.ParentInstrument?.Name}${x.ParentStaff.ParentInstrument?.Id}-${x.ParentStaff?.Id}`)),super.drawStaffLine(x);const T=x.PositionAndShape.AbsolutePosition;this.rules.RenderSlurs&&this.drawSlurs(x,T),this.rules.RenderGlissandi&&this.drawGlissandi(x,T),_.closeGroup()}drawSlurs(x,_){for(const I of x.GraphicalSlurs)I.slur.isCrossed()||this.drawSlur(I,_)}drawGlissandi(x,_){for(const I of x.GraphicalGlissandi)this.drawGlissando(I,_)}drawGlissando(x,_){if(x.StaffLine.ParentStaff.isTab||x.calculateLine(this.rules),x.Line){const I=new i.PointF2D(x.Line.Start.x+_.x,x.Line.Start.y),T=new i.PointF2D(x.Line.End.x+_.x,x.Line.End.y);x.Line.SVGElement=this.drawLine(I,T,x.Color,x.Width)}else{const I=x.vfTie;if(I){const T=this.backend.getContext();I.setContext(T),I.draw()}}}drawSlur(x,_){const I=[],T=new i.PointF2D(x.bezierStartPt.x+_.x,x.bezierStartPt.y+_.y),A=new i.PointF2D(x.bezierStartControlPt.x+_.x,x.bezierStartControlPt.y+_.y),v=new i.PointF2D(x.bezierEndControlPt.x+_.x,x.bezierEndControlPt.y+_.y),B=new i.PointF2D(x.bezierEndPt.x+_.x,x.bezierEndPt.y+_.y);I.push(this.applyScreenTransformation(T)),I.push(this.applyScreenTransformation(A)),I.push(this.applyScreenTransformation(v)),I.push(this.applyScreenTransformation(B)),x.placement===h.PlacementEnum.Above?(T.y-=.05,A.y-=.3,v.y-=.3,B.y-=.05):(T.y+=.05,A.y+=.3,v.y+=.3,B.y+=.05),I.push(this.applyScreenTransformation(T)),I.push(this.applyScreenTransformation(A)),I.push(this.applyScreenTransformation(v)),I.push(this.applyScreenTransformation(B));const D=this.rules.GNote(x.slur.StartNote);x.SVGElement=this.backend.renderCurve(I,!0,D)}drawMeasure(x){x.setAbsoluteCoordinates(x.PositionAndShape.AbsolutePosition.x*g.unitInPixels,x.PositionAndShape.AbsolutePosition.y*g.unitInPixels);try{x.draw(this.backend.getContext())}catch(I){m.default.warn("VexFlowMusicSheetDrawer.drawMeasure",I)}let _=0;for(const I of x.staffEntries)this.drawStaffEntry(I),_=this.drawBuzzRolls(I,_)}drawBuzzRolls(x,_){for(const I of x.graphicalVoiceEntries)for(const T of I.notes)if(T.sourceNote.TremoloInfo?.tremoloUnmeasured){const A=this.rules.TremoloBuzzRollThickness,v=.9,B=.5,D=T;let L,F;const V=D.vfnote[0].getStemDirection();let j;if(this.backend instanceof d.SvgVexFlowBackend&&(j=D.getStemSVG()),void 0!==j?.getBbox){const $=j.getBBox();L=new i.PointF2D($.x/10,$.y/10),F=$.height/10}else F=D.vfnote[0].getStemLength()/10,L=new i.PointF2D(D.vfnote[0].getStem().x_begin/10,D.vfnote[0].getStem().y_top/10),1===V&&(L.y-=F);let P=L.y+F/3;D.vfnote[0].getBeamCount()>1&&(P=L.y+F/2,-1===V&&(P-=B+.2));const U=L.x-.5,Y=P,H=[],Q=[new i.PointF2D(0,-A),new i.PointF2D(v-A,0),new i.PointF2D(-v+A,-B),new i.PointF2D(0,-A),new i.PointF2D(v,0),new i.PointF2D(0,A),new i.PointF2D(-v+A,0),new i.PointF2D(v-A,B),new i.PointF2D(0,A),new i.PointF2D(-v,0)];let ot=new i.PointF2D(U,Y);H.push(ot);for(const $ of Q)ot=H.last(),H.push(new i.PointF2D(ot.x+$.x,ot.y-$.y));this.DrawPath(H,D.ParentMusicPage,!0,`buzzRoll${_}`),_++}return _}drawLine(x,_,I="#000000FF",T=.2){return x=this.applyScreenTransformation(x),_=this.applyScreenTransformation(_),this.backend.renderLine(x,_,I,T*g.unitInPixels)}DrawOverlayLine(x,_,I,T="#FF0000FF",A=.2,v){if(!I.PageNumber||I.PageNumber>this.backends.length||I.PageNumber<1)return void console.log("VexFlowMusicSheetDrawer.drawOverlayLine: invalid page number / music page number doesn't correspond to an existing backend.");const D=this.backends[I.PageNumber-1];return x=this.applyScreenTransformation(x),_=this.applyScreenTransformation(_),v||(v=`overlayLine ${x.x}/${x.y}`),D.renderLine(x,_,T,A*g.unitInPixels,v)}DrawPath(x,_,I=!0,T){const v=this.backends[_.PageNumber-1],B=[];for(const D of x)B.push(this.applyScreenTransformation(D));return v.renderPath(B,I,T)}drawSkyLine(x){this.drawSampledLine(x.SkyLine,x.PositionAndShape.AbsolutePosition,x.PositionAndShape.Size.width)}drawBottomLine(x){const _=new i.PointF2D(x.PositionAndShape.AbsolutePosition.x,x.PositionAndShape.AbsolutePosition.y);this.drawSampledLine(x.BottomLine,_,x.PositionAndShape.Size.width,"#0000FFFF")}drawSampledLine(x,_,I,T="#FF0000FF"){const A=[];let v=0;for(let D=0;D<x.length;D++)x[D]!==v&&(A.push(D),v=x[D]);const B=_;if(A.length>0){const D=this.rules.SamplingUnit;let L,F,V=new i.PointF2D(B.x,B.y),j=new i.PointF2D(A[0]/D+B.x,B.y);this.drawLine(V,j,T),x[0]>=0&&(L=new i.PointF2D(A[0]/D+B.x,B.y),F=new i.PointF2D(A[0]/D+B.x,B.y+x[A[0]]),this.drawLine(L,F,T));for(let P=1;P<A.length;P++)V=new i.PointF2D(A[P-1]/D+B.x,B.y+x[A[P-1]]),j=new i.PointF2D(A[P]/D+B.x,B.y+x[A[P-1]]),this.drawLine(V,j,T),L=new i.PointF2D(A[P]/D+B.x,B.y+x[A[P-1]]),F=new i.PointF2D(A[P]/D+B.x,B.y+x[A[P]]),this.drawLine(L,F,T);A[A.length-1]<x.length?(V=new i.PointF2D(A[A.length-1]/D+B.x,B.y+x[A[A.length-1]]),j=new i.PointF2D(B.x+I,B.y+x[A[A.length-1]]),this.drawLine(V,j,T)):(V=new i.PointF2D(A[A.length-1]/D+B.x,B.y),j=new i.PointF2D(B.x+I,B.y),this.drawLine(V,j,T))}else{const D=new i.PointF2D(B.x,B.y),L=new i.PointF2D(B.x+I,B.y);this.drawLine(D,L,T)}}drawStaffEntry(x){if(x.FingeringEntries.length>0)for(const _ of x.FingeringEntries)_.SVGNode=this.drawLabel(_,n.GraphicalLayers.Notes);if(void 0!==x.graphicalChordContainers&&x.graphicalChordContainers.length>0)for(const _ of x.graphicalChordContainers){const I=_.GraphicalLabel;I.SVGNode=this.drawLabel(I,n.GraphicalLayers.Notes)}this.rules.RenderLyrics&&x.LyricsEntries.length>0&&this.drawLyrics(x.LyricsEntries,n.GraphicalLayers.Notes)}drawLyrics(x,_){x.forEach(I=>{const T=I.GraphicalLabel;T.Label.colorDefault=this.rules.DefaultColorLyrics,T.SVGNode=this.drawLabel(T,_),T.SVGNode?.classList.add("lyrics")})}drawInstrumentBrace(x,_){const I=this.backend.getContext();I.openGroup("brace"),x.draw(I),I.closeGroup()}drawGroupBracket(x,_){const I=this.backend.getContext();I.openGroup("bracket"),x.draw(I),I.closeGroup()}drawOctaveShifts(x){for(const _ of x.OctaveShifts)if(_){const I=_,T=this.backend.getContext(),A=I.getTextBracket();this.rules.DefaultColorMusic&&(A.render_options.color=this.rules.DefaultColorMusic),A.setContext(T);try{A.draw()}catch(v){m.default.warn(v)}}}drawPedals(x){for(const _ of x.Pedals)if(_){const I=_,T=this.backend.getContext(),A=I.getPedalMarking();A.render_options.color=this.rules.DefaultColorMusic,A.setContext(T),A.draw()}}drawWavyLines(x){for(const _ of x.WavyLines)if(_){const I=_,T=this.backend.getContext(),A=I.getVibratoBracket();A.setContext(T),A.draw()}}drawExpressions(x){for(const _ of x.AbstractExpressions)if(_ instanceof f.GraphicalInstantaneousDynamicExpression)this.drawInstantaneousDynamic(_);else if(_ instanceof e.GraphicalInstantaneousTempoExpression){if(_.SourceExpression.parentMeasure?.MeasureNumber<=1&&!this.rules.RenderFirstTempoExpression)continue;const I=_.GraphicalLabel;I.SVGNode=this.drawLabel(I,n.GraphicalLayers.Notes)}else if(_ instanceof p.GraphicalContinuousDynamicExpression)this.drawContinuousDynamic(_);else if(_ instanceof y.GraphicalUnknownExpression){const I=_.Label;I.SVGNode=this.drawLabel(I,n.GraphicalLayers.Notes)}else m.default.warn("Unkown type of expression!")}drawInstantaneousDynamic(x){const _=x.Label;_.SVGNode=this.drawLabel(_,n.GraphicalLayers.Notes)}drawContinuousDynamic(x){if(x.IsVerbal){const _=x.Label;_.SVGNode=this.drawLabel(_,n.GraphicalLayers.Notes)}else for(const _ of x.Lines){const I=new i.PointF2D(x.ParentStaffLine.PositionAndShape.AbsolutePosition.x+_.Start.x,x.ParentStaffLine.PositionAndShape.AbsolutePosition.y+_.Start.y),T=new i.PointF2D(x.ParentStaffLine.PositionAndShape.AbsolutePosition.x+_.End.x,x.ParentStaffLine.PositionAndShape.AbsolutePosition.y+_.End.y);_.SVGElement=this.drawLine(I,T,_.colorHex??"#000000",_.Width)}}renderLabel(x,_,I,T,A,v){if(!x.Label.print)return;const B=x.Label.fontHeight*g.unitInPixels,{font:D}=x.Label;let L;this.rules.ColoringEnabled&&(L=x.Label.colorDefault,x.ColorXML&&(L=x.ColorXML),L||(L=this.rules.DefaultColorLabel));let F,{fontStyle:V,fontFamily:j}=x.Label;V||(V=this.rules.DefaultFontStyle),j||(j=this.rules.DefaultFontFamily);for(let P=0;P<x.TextLines?.length;P++){const U=x.TextLines[P],Y=this.calculatePixelDistance(U.xOffset),H=new i.PointF2D(v.x+Y,v.y),Q=this.backend.renderText(B,V,D,U.text,A,H,L,x.Label.fontFamily);F?F.appendChild(Q):F=Q,v.y=v.y+A,x.TextLines.length>1&&(v.y+=this.rules.SpacingBetweenTextLines)}return F}renderRectangle(x,_,I,T,A){return this.backend.renderRectangle(x,I,T,A)}applyScreenTransformation(x){return new i.PointF2D(x.x*g.unitInPixels,x.y*g.unitInPixels)}applyScreenTransformationForRect(x){return new r.RectangleF2D(x.x*g.unitInPixels,x.y*g.unitInPixels,x.width*g.unitInPixels,x.height*g.unitInPixels)}}},4332(dt,g,u){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.VexFlowMusicSystem=void 0;const l=u(5221),s=u(6954),c=u(67),r=u(4284),i=u(6014),o=u(3109),n=u(7098);g.VexFlowMusicSystem=class h extends l.MusicSystem{constructor(f,m){super(f),this.rules=m}calculateBorders(f){if(0===this.staffLines.length)return;const m=this.calcBracketsWidth();this.boundingBox.BorderLeft=-m,this.boundingBox.BorderMarginLeft=-m,this.boundingBox.XBordersHaveBeenSet=!0;const p=this.staffLines[0].SkyBottomLineCalculator.getSkyLineMin();this.boundingBox.BorderTop=p,this.boundingBox.BorderMarginTop=p;const E=this.staffLines[this.staffLines.length-1],y=E.SkyBottomLineCalculator.getBottomLineMax()+E.PositionAndShape.RelativePosition.y;this.boundingBox.BorderBottom=y,this.boundingBox.BorderMarginBottom=y,this.boundingBox.XBordersHaveBeenSet=!0,this.boundingBox.YBordersHaveBeenSet=!0}createSystemLine(f,m,p,E,y,d,S=void 0){const M=d;let x=!1;if(S){x=!0,S.addMeasureLine(p,E),M&&M.addMeasureLine(p,E,x);let _=0;if(p===s.SystemLinesEnum.BoldThinDots&&E===c.SystemLinePosition.MeasureBegin&&d.beginInstructionsWidth>0&&(_=M.getVFStave().getModifierXShift(0)),S.lineTo(d,i.VexFlowConverter.line(p,E),_),p===s.SystemLinesEnum.DotsBoldBoldDots){const I=S.ParentStaffLine.Measures.indexOf(S)+1,T=S.ParentStaffLine.Measures[I],A=d.ParentStaffLine.Measures[I];T&&A&&(T.lineTo(A,i.VexFlowConverter.line(s.SystemLinesEnum.BoldThinDots,E)),T.addMeasureLine(s.SystemLinesEnum.BoldThinDots,E))}}else M&&M.addMeasureLine(p,E,x);return new r.SystemLine(p,E,this,d,S)}createInstrumentBracket(f,m){const y=new n.VexFlowInstrumentBrace(f,m);this.InstrumentBrackets.push(y)}createGroupBracket(f,m,p){const E=f,y=m;if(0===p){const d=new o.VexFlowInstrumentBracket(E,y,p);this.GroupBrackets.push(d)}else{const d=new n.VexFlowInstrumentBrace(E,y,p);this.GroupBrackets.push(d)}}}},9310(dt,g,u){"use strict";var l=this&&this.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(g,"__esModule",{value:!0}),g.VexFlowOctaveShift=void 0;var s=l(u(3206)).default.Flow;const c=u(2768),r=u(437),i=l(u(3065));g.VexFlowOctaveShift=class o extends c.GraphicalOctaveShift{constructor(h,e){switch(super(h,e),h.Type){case r.OctaveEnum.VA8:this.position=s.TextBracket.Positions.TOP,this.supscript="va",this.text="8";break;case r.OctaveEnum.MA15:this.position=s.TextBracket.Positions.TOP,this.supscript="ma",this.text="15";break;case r.OctaveEnum.VB8:this.position=s.TextBracket.Positions.BOTTOM,this.supscript="vb",this.text="8";break;case r.OctaveEnum.MB15:this.position=s.TextBracket.Positions.BOTTOM,this.supscript="mb",this.text="15";break;default:i.default.error("Unknown or NONE octaveshift. This should not be called!")}}setStartNote(h){for(const e of h.graphicalVoiceEntries){const f=e;if(f?.vfStaveNote)return this.startNote=f.vfStaveNote,!0}return!1}setEndNote(h,e=-1){const f=h.graphicalVoiceEntries;for(let m=(e>=0?Math.min(e,f.length):f.length)-1;m>=0;m--){const p=f[m];if(p?.vfStaveNote)return this.endNote=p.vfStaveNote,this.endMeasure=h.parentMeasure,this.endMeasure?.parentSourceMeasure.Rules.OctaveShiftOnWholeMeasureNoteUntilEndOfMeasure&&p.notes[0].sourceNote.isWholeMeasureNote()&&(this.graphicalEndAtMeasureEnd=!0),!0}return!1}getTextBracket(){let h,e=this.endNote;const f=this;this.graphicalEndAtMeasureEnd&&(h={getAbsoluteX:()=>10*(f.endMeasure.PositionAndShape.AbsolutePosition.x+f.endMeasure.PositionAndShape.Size.width),getGlyph:()=>({getWidth:()=>0})}),h&&(e=h);const m=new s.TextBracket({position:this.position,start:this.startNote,stop:e,superscript:this.supscript,text:this.text});return this.endsOnDifferentStaffLine&&(m.render_options.show_bracket=!1),m}}},7109(dt,g,u){"use strict";var l=this&&this.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(g,"__esModule",{value:!0}),g.VexFlowPedal=void 0;const s=l(u(3206)),c=u(6438),r=u(7824),i=u(512);g.VexFlowPedal=class o extends r.GraphicalPedal{constructor(h,e,f=!1,m=!1){switch(super(h,e),this.vfStyle=s.default.Flow.PedalMarking.Styles.BRACKET,this.ChangeBegin=!1,this.ChangeEnd=!1,this.line=-3,this.EndSymbolPositionAndShape=void 0,this.ChangeBegin=h.ChangeBegin,this.ChangeEnd=h.ChangeEnd,this.pedalSymbol){case i.MusicSymbol.PEDAL_SYMBOL:this.vfStyle=s.default.Flow.PedalMarking.Styles.TEXT,this.EndSymbolPositionAndShape=new c.BoundingBox(this,e);break;case i.MusicSymbol.PEDAL_MIXED:this.vfStyle=f&&m?s.default.Flow.PedalMarking.Styles.BRACKET_OPEN_BOTH:f?s.default.Flow.PedalMarking.Styles.BRACKET_OPEN_BEGIN:m?s.default.Flow.PedalMarking.Styles.MIXED_OPEN_END:s.default.Flow.PedalMarking.Styles.MIXED;break;default:this.vfStyle=f&&m?s.default.Flow.PedalMarking.Styles.BRACKET_OPEN_BOTH:f?s.default.Flow.PedalMarking.Styles.BRACKET_OPEN_BEGIN:m?s.default.Flow.PedalMarking.Styles.BRACKET_OPEN_END:s.default.Flow.PedalMarking.Styles.BRACKET}}setStartNote(h){if(!h)return!1;for(const e of h.graphicalVoiceEntries){const f=e;if(f?.vfStaveNote)return this.startNote=f.vfStaveNote,this.startVfVoiceEntry=f,!0}return!1}setEndNote(h){if(!h)return!1;for(const e of h.graphicalVoiceEntries){const f=e;if(f?.vfStaveNote)return this.endNote=f.vfStaveNote,this.endVfVoiceEntry=f,!0}return!1}setEndMeasure(h){this.endMeasure=h}CalculateBoundingBox(){}setLine(h){this.line=h}getPedalMarking(){const h=new s.default.Flow.PedalMarking([this.startNote,this.endNote]);return this.endMeasure&&h.setEndStave(this.endMeasure.getVFStave()),h.setStyle(this.vfStyle),h.setLine(this.line),h.setCustomText(this.DepressText,this.ReleaseText),this.endVfVoiceEntry&&!this.getPedal.EndsStave||(h.EndsStave=!0),this.getPedal.BeginsStave&&(h.BeginsStave=!0),h.ChangeBegin=this.ChangeBegin,h.ChangeEnd=this.ChangeEnd,h}setEndsStave(h,e){e?.gte(h.parentSourceMeasure.Duration)&&(this.getPedal.EndsStave=!0)}setBeginsStave(h,e){h&&0===e.RealValue&&(this.getPedal.BeginsStave=!0)}}},5468(dt,g,u){"use strict";var l=this&&this.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(g,"__esModule",{value:!0}),g.VexFlowSlur=g.CurvePositionEnum=void 0;var s,i,c=l(u(3206)).default.Flow;(i=s||(g.CurvePositionEnum=s={}))[i.NEAR_HEAD=1]="NEAR_HEAD",i[i.NEAR_TOP=2]="NEAR_TOP";class r{constructor(o){this.vfStartNote=void 0,this.vfEndNote=void 0,this.parentSlur=o}static createFromVexflowSlur(o){return new r(o.parentSlur)}get vfSlur(){return this.parentSlur}curve_Options(){return{cps:[{x:0,y:10},{x:0,y:10}],invert:!1,position:s.NEAR_TOP,position_end:s.NEAR_TOP,spacing:2,thickness:2,x_shift:0,y_shift:10}}createVexFlowCurve(){this.vfCurve=new c.Curve(this.vfStartNote,this.vfEndNote,void 0)}}g.VexFlowSlur=r},6670(dt,g,u){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.VexFlowStaffEntry=void 0;const l=u(348),s=u(9479),c=u(8233);g.VexFlowStaffEntry=class r extends l.GraphicalStaffEntry{constructor(o,n,h){super(o,n,h)}calculateXPosition(){const o=this.parentMeasure.getVFStave();let n=0;for(const h of this.graphicalVoiceEntries)if(h.vfStaveNote){if(h.vfStaveNote.setStave(o),!h.vfStaveNote.preFormatted)continue;h.applyBordersFromVexflow();let e=!1,f=this.PositionAndShape;h.notes[0].sourceNote.isWholeRest()&&!this.hasOnlyRests()&&(e=!0,f=h.PositionAndShape),this.parentMeasure.ParentStaff.isTab?f.RelativePosition.x=(h.vfStaveNote.getAbsoluteX()+h.vfStaveNote.glyph.getWidth())/s.unitInPixels:(f.RelativePosition.x=h.vfStaveNote.getBoundingBox().getX()/s.unitInPixels,e&&(f.RelativePosition.x-=o.getNoteStartX()/s.unitInPixels,f.RelativePosition.x-=1.3));const m=h.notes[0].sourceNote;m.isRest()&&m.Length.RealValue===this.parentMeasure.parentSourceMeasure.ActiveTimeSignature.RealValue&&(f.RelativePosition.x+=this.parentMeasure.parentSourceMeasure.Rules.WholeRestXShiftVexflow-.1,h.PositionAndShape.BorderLeft=-.7,h.PositionAndShape.BorderRight=.7),h.PositionAndShape.BorderLeft<n&&(n=h.PositionAndShape.BorderLeft)}this.PositionAndShape.RelativePosition.x-=n,this.PositionAndShape.calculateBoundingBox()}setMaxAccidentals(){for(const o of this.graphicalVoiceEntries)for(const n of o.notes)if(n.DrawnAccidental!==c.AccidentalEnum.NONE)return this.MaxAccidentals=1;return this.MaxAccidentals=0}setModifierXOffsets(){const o=[];for(const n of this.graphicalVoiceEntries)n.parentVoiceEntry?.IsGrace?this.applyModifierOffsets(n.notes):o.push(...n.notes);this.applyModifierOffsets(o)}applyModifierOffsets(o){if(0===o.length)return;const n=o.map(f=>f.staffLine),h=this.calculateModifierXOffsets(n,.5),e=this.calculateModifierXOffsets(n,1);o.forEach((f,m)=>{f.baseFingeringXOffset=h[m],f.baseStringNumberXOffset=e[m]})}calculateModifierXOffsets(o,n){const h=[];for(let e=0;e<o.length;e++){let f=0,m=!0;for(;m;)for(let p=e;p>=0;p--){if(Math.abs(o[e]-o[p])<=n&&f===h[p]){f++,m=!0;break}m=!1}h.push(f)}return h}}},5866(dt,g,u){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.VexFlowStaffLine=void 0;const l=u(2919),s=u(1083);g.VexFlowStaffLine=class c extends l.StaffLine{constructor(i,o){super(i,o),this.slursInVFStaffLine=[],this.alignmentManager=new s.AlignmentManager(this)}get SlursInVFStaffLine(){return this.slursInVFStaffLine}addVFSlurToVFStaffline(i){this.slursInVFStaffLine.push(i)}get AlignmentManager(){return this.alignmentManager}}},6173(dt,g,u){"use strict";var l=this&&this.__importDefault||function(h){return h&&h.__esModule?h:{default:h}};
1Object.defineProperty(g,"__esModule",{value:!0}),g.VexFlowTabMeasure=void 0;var s=l(u(3206)).default.Flow;const c=u(5246),r=u(6014),i=l(u(3065)),o=u(164);g.VexFlowTabMeasure=class n extends c.VexFlowMeasure{constructor(e,f=void 0,m=void 0){super(e,f,m),this.isTabMeasure=!0}resetLayout(){this.stave=new s.TabStave(0,0,0,{space_above_staff_ln:0,space_below_staff_ln:0,num_lines:this.ParentStaff.StafflineCount??6}),this.updateInstructionWidth()}graphicalMeasureCreatedCalculations(){for(let f=0,m=this.staffEntries.length;f<m;++f){const p=this.staffEntries[f];for(const E of p.graphicalVoiceEntries)if(E.notes[0].sourceNote.isRest()){const y=r.VexFlowConverter.GhostNotes(E.notes[0].sourceNote.Length);E.vfStaveNote=y[0],E.vfGhostNotes=y}else E.vfStaveNote=r.VexFlowConverter.CreateTabNote(E)}this.finalizeTuplets();const e=this.getVoicesWithinMeasure();for(const f of e){if(!f)continue;this.vfVoices[f.VoiceId]=new s.Voice({beat_value:this.parentSourceMeasure.Duration.Denominator,num_beats:this.parentSourceMeasure.Duration.Numerator,resolution:s.RESOLUTION}).setMode(s.Voice.Mode.SOFT);const m=this.getRestFilledVexFlowStaveNotesPerVoice(f);for(const p of m){if(p.parentVoiceEntry&&p.parentVoiceEntry.IsGrace&&!p.parentVoiceEntry.GraceAfterMainNote)continue;const E=p;if(0!==p.notes.length&&p.notes[0]&&p.notes[0].sourceNote.PrintObject){if(p.parentVoiceEntry&&p.parentVoiceEntry.Arpeggio)if(p.notes&&p.notes.length>1){const d=r.VexFlowConverter.StrokeTypeFromArpeggioType(p.parentVoiceEntry.Arpeggio.type),S=new s.Stroke(d,{all_voices:this.rules.ArpeggiosGoAcrossVoices});this.rules.RenderArpeggios&&E.vfStaveNote.addStroke(0,S)}else i.default.debug(`[OSMD] arpeggio in measure ${this.MeasureNumber} could not be drawn.\n voice entry had less than two notes, arpeggio is likely between voice entries, not currently supported in Vexflow.`);if(E.vfGhostNotes)for(const y of E.vfGhostNotes)this.vfVoices[f.VoiceId].addTickable(y);else this.vfVoices[f.VoiceId].addTickable(E.vfStaveNote)}else if(E.vfGhostNotes)for(const y of E.vfGhostNotes)this.vfVoices[f.VoiceId].addTickable(y);else this.vfVoices[f.VoiceId].addTickable(E.vfStaveNote)}}}addClefAtBegin(e){e.ClefType===o.ClefEnum.TAB&&super.addClefAtBegin(e)}draw(e){super.draw(e);const f=this.parentSourceMeasure;f.multipleRestMeasures&&this.rules.RenderMultipleRestMeasures&&(this.multiRestElement=new s.MultiMeasureRest(f.multipleRestMeasures,{}),this.multiRestElement.setStave(this.stave),this.multiRestElement.setContext(e),this.multiRestElement.draw())}}},7785(dt,g,u){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.VexFlowTextMeasurer=void 0;const l=u(6014);g.VexFlowTextMeasurer=class{constructor(s){this.fontSize=20,this.fontSizeStandard=this.fontSize;const c=document.createElement("canvas");this.context=c.getContext("2d"),this.rules=s}computeTextWidthToHeightRatio(s,c,r,i=void 0,o=this.fontSize){return this.context.font=l.VexFlowConverter.font(o,r,c,this.rules,i),this.context.measureText(s).width/o}setFontSize(s=this.fontSizeStandard){return this.fontSize=s,s}}},2907(dt,g,u){"use strict";var l=this&&this.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(g,"__esModule",{value:!0}),g.VexFlowVibratoBracket=void 0;const s=u(7753),c=l(u(3206));g.VexFlowVibratoBracket=class r extends s.GraphicalWavyLine{get ToEndOfStopStave(){return this.toEndOfStopStave}constructor(o,n,h=!1){super(o,n),this.line=1,this.isVibrato=!1,this.toEndOfStopStave=!1,this.isVibrato=h}setStartNote(o){for(const n of o.graphicalVoiceEntries){const h=n;if(h?.vfStaveNote)return this.startNote=h.vfStaveNote,this.startVfVoiceEntry=h,!0}return!1}setEndNote(o){for(const n of o.graphicalVoiceEntries){const h=n;if(h?.vfStaveNote){this.endNote=h.vfStaveNote,this.endVfVoiceEntry=h;const e=this.endVfVoiceEntry.parentStaffEntry.parentMeasure.staffEntries;return this.toEndOfStopStave=e[e.length-1]===this.endVfVoiceEntry.parentStaffEntry,!0}}return!1}CalculateBoundingBox(){const o=this.getVibratoBracket();this.boundingBox.Size.height=.2*o.render_options.wave_height}getVibratoBracket(){const o=new c.default.Flow.VibratoBracket({start:this.startNote,stop:this.endNote,toEndOfStopStave:this.toEndOf
1StopStave});return o.setLine(this.line),this.isVibrato?o.render_options.vibrato_width=20:o.render_options.wave_girth=4,o}}},4134(dt,g,u){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.VexFlowVoiceEntry=void 0;const l=u(4548),s=u(9479),c=u(4434),r=u(4064);g.VexFlowVoiceEntry=class i extends l.GraphicalVoiceEntry{constructor(n,h,e){super(n,h,e)}applyBordersFromVexflow(){const n=this.vfStaveNote;if(!n.getNoteHeadBeginX)return;const h=n.getBoundingBox(),e=n.getNoteHeadBeginX()-h.x;this.PositionAndShape.RelativePosition.y=h.y/s.unitInPixels,this.PositionAndShape.BorderTop=0,this.PositionAndShape.BorderBottom=h.h/s.unitInPixels,this.PositionAndShape.BorderLeft=-(e+(n.width-(n.paddingRight??0))/2)/s.unitInPixels,this.PositionAndShape.BorderRight=(h.w-e)/s.unitInPixels}set vfStaveNote(n){this.mVexFlowStaveNote=n}get vfStaveNote(){return this.mVexFlowStaveNote}applyCustomNoteheads(){const n=this.vfStaveNote;if(n)for(let h=0;h<this.notes.length;h++){const e=this.notes[h].sourceNote;n.note_heads&&e.CustomNoteheadVFCode&&(n.note_heads[h].glyph_code=e.CustomNoteheadVFCode)}}color(){const n=this.rules.DefaultColorNotehead,h=this.rules.DefaultColorRest,e=this.rules.DefaultColorStem,f="#00000000";let m,p;const E=this.vfStaveNote;for(let x=0;x<this.notes.length;x++){const _=this.notes[x];if(p=_.sourceNote.NoteheadColor,m=p,(this.rules.ColoringMode===c.ColoringModes.AutoColoring||this.rules.ColoringMode===c.ColoringModes.CustomColorSet)&&(m=_.sourceNote.isRest()?this.rules.ColoringSetCurrent.getValue(-1):this.rules.ColoringSetCurrent.getValue(_.sourceNote.Pitch.FundamentalNote)),_.sourceNote.PrintObject&&_.sourceNote.Notehead?.Shape!==r.NoteHeadShape.NONE?m&&"#000000"!==m||(m=this.rules.DefaultColorNotehead):m=f,!p&&this.rules.ColoringMode===c.ColoringModes.XML&&_.sourceNote.PrintObject&&_.sourceNote.Notehead?.Shape!==r.NoteHeadShape.NONE&&(!_.sourceNote.isRest()&&n?m=n:_.sourceNote.isRest()&&h&&(m=h)),m&&_.sourceNote.PrintObject&&_.sourceNote.Notehead?.Shape!==r.NoteHeadShape.NONE)_.sourceNote.NoteheadColorCurrentlyRendered=m;else if(!m)continue;if(this.rules.ColoringEnabled&&_.sourceNote.NoteBeam&&this.rules.ColorBeams){const I=_.sourceNote.NoteBeam.Notes;let T=!0;for(let A=0;A<I.length;A++)I[A].NoteheadColorCurrentlyRendered!==m&&(T=!1);T&&E?.beam?.setStyle&&E.beam.setStyle({fillStyle:m,strokeStyle:m})}if(E){if(E.note_heads){const I=E.note_heads[x];I&&I.setStyle({fillStyle:m,strokeStyle:m})}E.setLedgerLineStyle&&E.setLedgerLineStyle(m===f?{fillStyle:m,strokeStyle:m,lineWidth:this.rules.LedgerLineWidth}:{fillStyle:this.rules.LedgerLineColorDefault,lineWidth:this.rules.LedgerLineWidth,strokeStyle:this.rules.LedgerLineColorDefault})}}let y=e,d=!1;this.rules.ColoringEnabled&&(y=this.parentVoiceEntry.StemColor,y&&"#000000"!==y||(y=e),this.rules.ColorStemsLikeNoteheads&&m&&(y=m,d=!0));let S=!0;for(const x of this.parentVoiceEntry.Notes)if(x.PrintObject&&x.Notehead?.Shape!==r.NoteHeadShape.NONE){S=!1;break}S&&(y=f);const M={fillStyle:y,strokeStyle:y};E&&E.setStemStyle&&(!S&&d&&(this.parentVoiceEntry.StemColor=y),E.setStemStyle(M),E.flag&&E.setFlagStyle&&this.rules.ColorFlags&&E.setFlagStyle(M))}}},7506(dt,g,u){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.VexflowStafflineNoteCalculator=void 0;const l=u(8233),s=u(9635),c=u(3263),r=u(164),i=u(1336);class o{constructor(h){this.staffPitchListMapping=new c.Dictionary,this.baseLineNote=l.NoteEnum.B,this.baseLineOctave=1,this.rules=h}trackNote(h){if(!(h instanceof s.VexFlowGraphicalNote)||h.Clef().ClefType!==r.ClefEnum.percussion||h.sourceNote.isRest()||0===this.rules.PercussionOneLineCutoff||-1===this.rules.PercussionForceVoicesOneLineCutoff)return;const e=h.parentVoiceEntry.parentStaffEntry.sourceStaffEntry.ParentStaff.idInMusicSheet;let f;this.staffPitchListMapping.containsKey(e)||this.staffPitchListMapping.setValue(e,new Array),f=this.staffPitchListMapping.getValue(e),o.findOrInsert(f,h.sourceNote.Pitch)}static PitchIndexOf(h,e,f=0){if(f>h.length-1)return-1;for(let m=f;m<h.length;m++)if(e.OperatorEquals(h[m]))return m;return-1}static findOrInsert(h,e){for(let f=0;f<h.length;f++){const m=h[f];if(e.OperatorEquals(m))return f;
vendor: 169,279 bytes, line 1
1if(e.OperatorFundamentalLessThan(m))return h.splice(f,0,e),f}return h.push(e),h.length-1}positionNote(h){const e=h.parentVoiceEntry.parentStaffEntry.sourceStaffEntry.ParentStaff.idInMusicSheet;if(!(h instanceof s.VexFlowGraphicalNote)||h.sourceNote.isRest()||!this.staffPitchListMapping.containsKey(e))return h;const f=this.staffPitchListMapping.getValue(e);if(f.length>this.rules.PercussionOneLineCutoff&&(!this.rules.PercussionUseXMLDisplayStep||void 0===h.sourceNote.displayStepUnpitched)&&!this.rules.PercussionUseCajon2NoteSystem)return h;const p=h,E=h.sourceNote.Pitch;let y=this.baseLineNote,d=this.baseLineOctave;if(this.rules.PercussionUseCajon2NoteSystem?E.FundamentalNote===l.NoteEnum.C&&(y=l.NoteEnum.G,d=1):this.rules.PercussionUseXMLDisplayStep&&void 0!==h.sourceNote.displayStepUnpitched&&(y=h.sourceNote.displayStepUnpitched,d=h.sourceNote.displayOctaveUnpitched+this.rules.PercussionOneLineXMLDisplayStepOctaveOffset),f.length<=this.rules.PercussionForceVoicesOneLineCutoff)p.setAccidental(new l.Pitch(y,d,E.Accidental));else{const S=o.PitchIndexOf(f,E);if(S>-1){const M=Math.ceil(f.length/2);if(!this.rules.PercussionUseXMLDisplayStep)if(S>=M)switch(d=2,(S-M)%5){case 1:y=l.NoteEnum.E;break;case 2:y=l.NoteEnum.G;break;case 3:y=l.NoteEnum.B;break;case 4:y=l.NoteEnum.D,d=3;break;default:y=l.NoteEnum.C}else switch(S%5){case 1:y=l.NoteEnum.F;break;case 2:y=l.NoteEnum.D;break;case 3:y=l.NoteEnum.B,d=0;break;case 4:y=l.NoteEnum.G,d=0;break;default:y=l.NoteEnum.A}const x=new l.Pitch(y,d,E.Accidental);p.setAccidental(x),!this.rules.SetWantedStemDirectionByXml&&p.parentVoiceEntry.parentVoiceEntry.Notes.length<2&&(p.parentVoiceEntry.parentVoiceEntry.WantedStemDirection=x.Octave>this.baseLineOctave||x.FundamentalNote===this.baseLineNote&&x.Octave===this.baseLineOctave?i.StemDirectionType.Up:i.StemDirectionType.Down)}}return p}getStafflineUniquePositionCount(h){return this.staffPitchListMapping.containsKey(h)?this.staffPitchListMapping.getValue(h).length:0}}g.VexflowStafflineNoteCalculator=o},7499(dt,g,u){"use strict";var l=this&&this.__createBinding||(Object.create?function(c,r,i,o){void 0===o&&(o=i);var n=Object.getOwnPropertyDescriptor(r,i);n&&!("get"in n?!r.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return r[i]}}),Object.defineProperty(c,o,n)}:function(c,r,i,o){void 0===o&&(o=i),c[o]=r[i]}),s=this&&this.__exportStar||function(c,r){for(var i in c)"default"===i||Object.prototype.hasOwnProperty.call(r,i)||l(r,c,i)};Object.defineProperty(g,"__esModule",{value:!0}),s(u(1083),g),s(u(9834),g),s(u(9436),g),s(u(1902),g),s(u(2400),g),s(u(6014),g),s(u(1216),g),s(u(9635),g),s(u(3753),g),s(u(7809),g),s(u(7098),g),s(u(3109),g),s(u(5246),g),s(u(3849),g),s(u(806),g),s(u(9479),g),s(u(4332),g),s(u(9310),g),s(u(5468),g),s(u(6670),g),s(u(5866),g),s(u(7506),g),s(u(6173),g),s(u(7785),g),s(u(4134),g)},3508(dt,g,u){"use strict";var l=this&&this.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(g,"__esModule",{value:!0}),g.WebGLSkyBottomLineBatchCalculatorBackend=void 0;const s=u(5479),c=u(3667),r=l(u(5340)),i=l(u(5166)),o=l(u(3065)),n=u(813);function h(f,m,p){const E=f.createShader(m);if(!E)throw o.default.warn("WebGLSkyBottomLineCalculatorBackend: Could not create a WebGL shader"),new Error("Could not create a WebGL shader");if(f.shaderSource(E,p),f.compileShader(E),!f.getShaderParameter(E,f.COMPILE_STATUS))throw o.default.warn("Shader compilation failed\n"+f.getShaderInfoLog(E)),f.deleteShader(E),new Error("WebGL shader compilation failed");return E}g.WebGLSkyBottomLineBatchCalculatorBackend=class e extends c.SkyBottomLineBatchCalculatorBackend{constructor(m,p){super(m,p)}getPreferredRenderingConfiguration(m,p){const E=Math.min(4096,function(){const d=document.createElement("canvas").getContext("webgl");return d.getParameter(d.MAX_TEXTURE_SIZE)}()),y=Math.ceil(m);return{elementWidth:y,numColumns:Math.min(5,Math.floor(E/y)),numRows:Math.min(5,Math.floor(E/p))}}onInitialize(m){const{elementWidth:p,elementHeight:E,numColumns:y,numRows:d}=m,S=document.createElement("canvas");S.width=p*y,S.height=d;const M=S.getContext("webgl");if(!M)throw o.default.warn("WebGLSkyBottomLineCalculatorBackend: No WebGL support"),new Error("No WebGL support");this.gl=M;const x=function(_,I,T){const A=_.createProgram();if(!A)throw o.default.warn("WebGLSkyBottomLineCalculatorBackend: Could not create a WebGL program"),new Error("Could not create a WebGL program");if(_.attachShader(A,I),_.attachShader(A,T),_.linkProgram(A),!_.getProgramParameter(A,_.LINK_STATUS))throw o.default.warn("WebGLSkyBottomLineCalculatorBackend: WebGL program link failed\n"+_.getProgramInfoLog(A)),_.deleteProgram(A),new Error("WebGL program link failed");return A}(M,h(M,M.VERTEX_SHADER,r.default),h(M,M.FRAGMENT_SHADER,function(_,I){let T=_;for(const[A,v]of Object.entries(I)){const B=new RegExp(`#define ${A} .*`);T=T.replace(B,`#define ${A} ${v}`)}return T}(i.default,{NUM_ROWS:d,ELEMENT_HEIGHT:E})));(function(_,I){const T=_.createBuffer();if(!T)throw o.default.warn("WebGLSkyBottomLineCalculatorBackend: WebGL buffer creation failed"),new Error("WebGL buffer creation failed");_.bindBuffer(_.ARRAY_BUFFER,T),_.bufferData(_.ARRAY_BUFFER,new Float32Array(n.CollectionUtil.flat([[-1,-1],[1,-1],[1,1],[-1,-1],[1,1],[-1,1]])),_.STATIC_DRAW),_.useProgram(I);const A=_.getAttribLocation(I,"a_position");_.enableVertexAttribArray(A),_.vertexAttribPointer(A,2,_.FLOAT,!1,0,0)})(M,x),this.texture=function(_,I){const T=_.createTexture();if(!T)throw o.default.warn("WebGLSkyBottomLineCalculatorBackend: WebGL texture creation failed"),new Error("WebGL texture creation failed");_.activeTexture(_.TEXTURE0+0),_.bindTexture(_.TEXTURE_2D,T),_.texParameteri(_.TEXTURE_2D,_.TEXTURE_WRAP_S,_.CLAMP_TO_EDGE),_.texParameteri(_.TEXTURE_2D,_.TEXTURE_WRAP_T,_.CLAMP_TO_EDGE),_.texParameteri(_.TEXTURE_2D,_.TEXTURE_MIN_FILTER,_.NEAREST),_.texParameteri(_.TEXTURE_2D,_.TEXTURE_MAG_FILTER,_.NEAREST);const A=_.getUniformLocation(I,"u_image");if(!A)throw o.default.warn("WebGLSkyBottomLineCalculatorBackend: WebGL invalid uniform name"),new Error("WebGL invalid uniform name");return _.uniform1i(A,0),T}(M,x)}calculateFromCanvas(m,p,E,y,d){const S=this.gl,{elementWidth:M,elementHeight:x,numColumns:_}=d;S.viewport(0,0,S.canvas.width,S.canvas.height),S.bindTexture(S.TEXTURE_2D,this.texture),S.texImage2D(S.TEXTURE_2D,0,S.RGBA,S.RGBA,S.UNSIGNED_BYTE,m),S.drawArrays(S.TRIANGLES,0,6);const I=new Uint8Array(S.canvas.width*S.canvas.height*4);S.readPixels(0,0,S.canvas.width,S.canvas.height,S.RGBA,S.UNSIGNED_BYTE,I);const T=[];for(let A=0;A<E.length;++A){const v=E[A],B=Math.floor(v.getVFStave().getWidth()),D=Math.max(Math.ceil(v.PositionAndShape.Size.width*y),1),L=A%_*M*4,F=Math.floor(A/_)*M*_*4,V=new Array(Math.max(D,B)).fill(0),j=new Array(Math.max(D,B)).fill(0);for(let Y=0;Y<B;++Y){const Q=I[4*Y+L+F+1],ot=I[4*Y+L+F+2],$=I[4*Y+L+F]+256*Math.floor(ot/16),it=Q+ot%16*256;V[Y]=$,j[Y]=it}const P=Math.max(...V),U=Math.min(...j);for(let Y=0;Y<B;++Y)V[Y]=0===V[Y]?P:V[Y],j[Y]=j[Y]===x?U:j[Y];T.push(new s.SkyBottomLineCalculationResult(V,j))}return T}}},899(dt,g,u){"use strict";var l=this&&this.__createBinding||(Object.create?function(c,r,i,o){void 0===o&&(o=i);var n=Object.getOwnPropertyDescriptor(r,i);n&&!("get"in n?!r.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return r[i]}}),Object.defineProperty(c,o,n)}:function(c,r,i,o){void 0===o&&(o=i),c[o]=r[i]}),s=this&&this.__exportStar||function(c,r){for(var i in c)"default"===i||Object.prototype.hasOwnProperty.call(r,i)||l(r,c,i)};Object.defineProperty(g,"__esModule",{value:!0}),s(u(9490),g),s(u(1974),g),s(u(8927),g),s(u(1083),g),s(u(6438),g),s(u(995),g),s(u(2683),g),s(u(242),g),s(u(3661),g),s(u(9713),g),s(u(6659),g),s(u(953),g),s(u(1066),g),s(u(6711),g),s(u(98),g),s(u(5023),g),s(u(3361),g),s(u(8254),g),s(u(6452),g),s(u(2395),g),s(u(7751),g),s(u(1519),g),s(u(5748),g),s(u(1888),g),s(u(8724),g),s(u(3430),g),s(u(7741),g),s(u(2768),g),s(u(973),g),s(u(4022),g),s(u(348),g),s(u(9760),g),s(u(5054),g),s(u(4548),g),s(u(7225),g),s(u(7921),g),s(u(1932),g),s(u(512),g),s(u(5221),g),s(u(7066),g),s(u(8033),g),s(u(7624),g),s(u(8713),g),s(u(2779),g),s(u(2919),g),s(u(298),g),s(u(4284),g),s(u(67),g),s(u(6954),g),s(u(6723),g),s(u(7499),g)},9252(dt,g,u){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.Instrument=void 0;const l=u(7586),s=u(7435),c=u(1910);g.Instrument=class r extends l.InstrumentalGroup{constructor(o,n,h,e){super(void 0,h,e),this.Transpose=0,this.voices=[],this.staves=[],this.hasLyrics=!1,this.hasChordSymbols=!1,this.lyricVersesNumbers=[],this.subInstruments=[],this.id=o,this.idString=n,this.nameLabel=new s.Label(n)}get Voices(){return this.voices}get Staves(){return this.staves}get NameLabel(){return this.nameLabel}get HasLyrics(){return this.hasLyrics}set HasLyrics(o){this.hasLyrics=o}get HasChordSymbols(){return this.hasChordSymbols}set HasChordSymbols(o){this.hasChordSymbols=o}get LyricVersesNumbers(){return this.lyricVersesNumbers}set LyricVersesNumbers(o){this.lyricVersesNumbers=o}get Name(){return this.nameLabel.text}set Name(o){this.nameLabel.text=o}get IdString(){return this.idString}get Id(){return this.id}get MidiInstrumentId(){return this.subInstruments[0].midiInstrumentID}set MidiInstrumentId(o){this.subInstruments[0].midiInstrumentID=o}get Volume(){return this.subInstruments[0].volume}set Volume(o){for(let n=0,h=this.subInstruments.length;n<h;++n)this.subInstruments[n].volume=o}get PlaybackTranspose(){return this.playbackTranspose}set PlaybackTranspose(o){this.playbackTranspose=o}get SubInstruments(){return this.subInstruments}getSubInstrument(o){for(let n=0,h=this.subInstruments.length;n<h;++n){const e=this.subInstruments[n];if(e.idString===o)return e}}get PartAbbreviation(){return this.partAbbreviation}set PartAbbreviation(o){this.partAbbreviation=o}get Visible(){return this.voices.length>0&&this.Voices[0].Visible}isVisible(){if(!this.Visible)return!1;for(const o of this.Staves)if(o.Visible)return!0;return!1}set Visible(o){for(let n=0,h=this.Voices.length;n<h;++n)this.Voices[n].Visible=o}get Audible(){let o=!1;for(let n=0,h=this.Voices.length;n<h;++n)o=o||this.Voices[n].Audible;return o}set Audible(o){for(let n=0,h=this.Voices.length;n<h;++n)this.Voices[n].Audible=o;for(let n=0,h=this.staves.length;n<h;++n)this.staves[n].audible=o}get Following(){let o=!1;for(let n=0,h=this.Voices.length;n<h;++n)o=o||this.Voices[n].Following;return o}set Following(o){for(let n=0,h=this.Voices.length;n<h;++n)this.Voices[n].Following=o;for(let n=0,h=this.staves.length;n<h;++n)this.staves[n].following=o}SetVoiceAudible(o,n){for(let h=0,e=this.Voices.length;h<e;++h){const f=this.Voices[h];if(f.VoiceId===o){f.Audible=n;break}}}SetVoiceFollowing(o,n){for(let h=0,e=this.Voices.length;h<e;++h){const f=this.Voices[h];if(f.VoiceId===o){f.Following=n;break}}}SetStaffAudible(o,n){const h=this.staves[o-1];if(h.audible=n,n)for(let e=0,f=h.Voices.length;e<f;++e)h.Voices[e].Audible=!0;else for(let e=0,f=h.Voices.length;e<f;++e){const m=h.Voices[e];let p=!1;for(let E=0,y=this.Staves.length;E<y;++E){const d=this.Staves[E];if(d.Id!==o&&d.audible)for(let S=0,M=d.Voices.length;S<M;++S)d.Voices[S]===m&&(p=!0)}p||(m.Audible=!1)}}SetStaffFollow(o,n){const h=this.staves[o-1];if(h.following=n,n)for(let e=0,f=h.Voices.length;e<f;++e)h.Voices[e].Following=!0;else for(let e=0,f=h.Voices.length;e<f;++e){const m=h.Voices[e];let p=!1;for(let E=0,y=this.Staves.length;E<y;++E){const d=this.Staves[E];if(d.Id!==o&&d.following)for(let S=0,M=d.Voices.length;S<M;++S)d.Voices[S]===m&&(p=!0)}p||(m.Following=!1)}}areAllVoiceVisible(){for(const o of this.Voices)if(!o.Visible)return!1;return!0}createStaves(o){for(let n=0;n<o;n++)this.staves.push(new c.Staff(this,n+1))}toString(){return`${this.Name} , id: ${this.id}, idstring: ${this.idString}`}}},7586(dt,g){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.InstrumentalGroup=void 0,g.InstrumentalGroup=class{constructor(u,l,s){this.instrumentalGroups=[],this.name=u,this.musicSheet=l,this.parent=s}get InstrumentalGroups(){return this.instrumentalGroups}get Parent(){return this.parent}get Name(){return this.name}set Name(u){this.name=u}get GetMusicSheet(){return this.musicSheet}}},7791(dt,g){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.AClassHierarchyTrackable=void 0,g.AClassHierarchyTrackable=class{isInstanceOfClass(u){let l=this.constructor.prototype;for(;l;){if(u===l.constructor.name)return!0;l=l.__proto__}return!1}}},5678(dt,g){"use strict";Object.defineProperty(g,"__esModule",{value:!0})},8900(dt,g){"use strict";Object.defineProperty(g,"__esModule",{value:!0})},6703(dt,g){"use strict";Object.defineProperty(g,"__esModule",{value:!0})},5377(dt,g){"use strict";Object.defineProperty(g,"__esModule",{value:!0})},6332(dt,g){"use strict";Object.defineProperty(g,"__esModule",{value:!0})},9767(dt,g){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.ITextTranslation=void 0,g.ITextTranslation=class{static translateText(u,l){if(!this.defaultTextTranslation)return l}}},9990(dt,g){"use strict";Object.defineProperty(g,"__esModule",{value:!0})},4864(dt,g){"use strict";Object.defineProperty(g,"__esModule",{value:!0})},2870(dt,g,u){"use strict";var l=this&&this.__createBinding||(Object.create?function(c,r,i,o){void 0===o&&(o=i);var n=Object.getOwnPropertyDescriptor(r,i);n&&!("get"in n?!r.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return r[i]}}),Object.defineProperty(c,o,n)}:function(c,r,i,o){void 0===o&&(o=i),c[o]=r[i]}),s=this&&this.__exportStar||function(c,r){for(var i in c)"default"===i||Object.prototype.hasOwnProperty.call(r,i)||l(r,c,i)};Object.defineProperty(g,"__esModule",{value:!0}),s(u(5678),g),s(u(8900),g),s(u(6703),g),s(u(6332),g),s(u(9767),g),s(u(9990),g),s(u(4864),g),s(u(7791),g),s(u(5377),g)},7435(dt,g,u){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.Label=void 0;const l=u(7533);g.Label=class{constructor(s="",c=l.TextAlignmentEnum.CenterBottom,r=void 0,i=!0){this.IsCreditLabel=!1,this.text=s,this.print=i,this.textAlignment=c,this.font=r,this.fontFamily=void 0}ToString(){return this.text}}},9024(dt,g,u){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.TimestampTransform=g.MusicPartManager=void 0;const l=u(2561),s=u(474);g.MusicPartManager=class{constructor(r){this.musicSheet=r}reInit(){this.init()}init(){this.parts=this.musicSheet.Repetitions.slice(),this.sheetStart=this.musicSheet.SelectionStart=new l.Fraction(0,1),this.sheetEnd=this.musicSheet.SelectionEnd=this.musicSheet.SheetEndTimestamp,this.calcMapping()}getCurrentRepetitionTimestampTransform(r){let i;for(let o=this.timestamps.length-1;o>=0;o--)if(i=this.timestamps[o],r.gte(i.$from))return i;return this.timestamps[0]}absoluteEnrolledToSheetTimestamp(r){if(0===this.timestamps.length)return r;const i=this.getCurrentRepetitionTimestampTransform(r);return l.Fraction.plus(r,l.Fraction.minus(i.to,i.$from))}get Parts(){return this.parts}get MusicSheet(){return this.musicSheet}getIterator(r){return r?new s.MusicPartManagerIterator(this.musicSheet,r,void 0):new s.MusicPartManagerIterator(this.musicSheet,this.musicSheet.SelectionStart,this.musicSheet.SelectionEnd)}setSelectionStart(r){this.musicSheet.SelectionStart=r,this.musicSheet.SelectionEnd=void 0}setSelectionRange(r,i){this.musicSheet.SelectionStart=r??this.sheetStart,this.musicSheet.SelectionEnd=i??this.sheetEnd}calcMapping(){const r=[],i=this.getIterator();let o=i.CurrentRepetition,n=new c(i.CurrentEnrolledTimestamp.clone(),i.CurrentSourceTimestamp.clone(),void 0,0);for(r.push(n);!i.EndReached;){if(i.JumpOccurred||o!==i.CurrentRepetition){if(o=i.CurrentRepetition,i.backJumpOccurred){const h=i.JumpResponsibleRepetition;n.nextBackJump=i.CurrentEnrolledTimestamp,n.curRepetition=h,n.curRepetitionIteration=i.CurrentJumpResponsibleRepetitionIterationBeforeJump;for(let e=this.timestamps.length-2;e>=0&&!r[e].to.lt(h.AbsoluteTimestamp)&&!r[e].curRepetition;e--)r[e].nextBackJump=n.nextBackJump,r[e].curRepetition=h,r[e].curRepetitionIteration=n.curRepetitionIteration}n=new c(i.CurrentEnrolledTimestamp.clone(),i.CurrentSourceTimestamp.clone(),void 0,0),r.push(n)}i.moveToNext()}this.timestamps=r}};class c{constructor(i,o,n,h){this.$from=i,this.to=o,this.curRepetition=n,this.curRepetitionIteration=h,this.nextBackJump=void 0,this.nextForwardJump=void 0}}g.TimestampTransform=c},474(dt,g,u){"use strict";var l=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(g,"__esModule",{value:!0}),g.MusicPartManagerIterator=void 0;const s=u(2561),c=u(1110),r=u(9288),i=u(5875),o=l(u(3065)),n=u(4064);class h{constructor(f,m,p){this.currentMeasureIndex=0,this.currentPartIndex=0,this.currentVoiceEntryIndex=-1,this.currentDynamicEntryIndex=0,this.currentTempoEntryIndex=0,this.currentDynamicChangingExpressions=[],this.repetitionIterationCountDictKeys=[],this.repetitionIterationCountDictValues=[],this.currentRepetition=void 0,this.endReached=!1,this.frontReached=!1,this.currentTimeStamp=new s.Fraction(0,1),this.currentEnrolledMeasureTimestamp=new s.Fraction(0,1),this.currentRelativeInMeasureTimestamp=new s.Fraction(0,1),this.currentVerticalContainerInMeasureTimestamp=new s.Fraction(0,1),this.jumpResponsibleRepetition=void 0,this.activeDynamicExpressions=[],this.SkipInvisibleNotes=!0;try{this.frontReached=!0,this.musicSheet=f,this.currentBpm=f.userStartTempoInBPM,this.currentVoiceEntries=void 0,this.frontReached=!1;for(const E of this.musicSheet.Repetitions)this.setRepetitionIterationCount(E,1);for(let E=0;E<f.getCompleteNumberOfStaves();E++)this.ActiveDynamicExpressions.push(void 0);this.currentMeasure=this.musicSheet.SourceMeasures[0],m||(m=new s.Fraction);do{this.moveToNext()}while((!this.currentVoiceEntries||this.currentTimeStamp.lt(m))&&!this.endReached);for(let E=0;E<this.activeDynamicExpressions.length;E++)this.activeDynamicExpressions[E]&&this.currentDynamicChangingExpressions.push(new c.DynamicsContainer(this.activeDynamicExpressions[E],E));this.currentTempoChangingExpression=this.activeTempoExpression}catch(E){o.default.info("MusicPartManagerIterator: "+E)}}get EndReached(){return this.endReached}get FrontReached(){return this.frontReached}get CurrentMeasure(){return this.currentMeasure}get CurrentRepetition(){return this.currentRepetition}get CurrentRepetitionIteration(){return this.CurrentRepetition?this.getRepetitionIterationCount(this.CurrentRepetition):0}get CurrentJumpResponsibleRepetitionIterationBeforeJump(){return this.jumpResponsibleRepetition?this.getRepetitionIterationCount(this.jumpResponsibleRepetition)-1:0}get CurrentBpm(){return this.currentBpm}set CurrentBpm(f){this.currentBpm=f}get CurrentVoiceEntries(){return this.currentVoiceEntries}get CurrentMeasureIndex(){return this.currentMeasureIndex}get CurrentEnrolledTimestamp(){return s.Fraction.plus(this.currentEnrolledMeasureTimestamp,this.currentVerticalContainerInMeasureTimestamp)}get CurrentSourceTimestamp(){return this.currentTimeStamp}get CurrentRelativeInMeasureTimestamp(){return this.currentRelativeInMeasureTimestamp}get JumpOccurred(){return this.backJumpOccurred||this.forwardJumpOccurred}get ActiveTempoExpression(){return this.activeTempoExpression}get ActiveDynamicExpressions(){return this.activeDynamicExpressions}get CurrentTempoChangingExpression(){return this.currentTempoChangingExpression}get JumpResponsibleRepetition(){return this.jumpResponsibleRepetition}clone(f=void 0,m=void 0){const p=new h(this.musicSheet,f??this.currentTimeStamp,m);return p.currentVoiceEntryIndex=this.currentVoiceEntryIndex,p.currentMappingPart=this.currentMappingPart,p.currentPartIndex=this.currentPartIndex,p.currentVoiceEntries=this.currentVoiceEntries,p.endReached=this.endReached,p.frontReached=this.frontReached,p}CurrentVisibleVoiceEntries(f){const m=[];if(!this.currentVoiceEntries)return m;if(f){for(const p of this.currentVoiceEntries)p.ParentVoice.Parent.IdString===f.IdString&&this.getVisibleEntries(p,m);return m}for(const p of this.currentVoiceEntries)this.getVisibleEntries(p,m);return m}CurrentAudibleVoiceEntries(f){const m=[];if(this.currentVoiceEntries)if(f){for(const p of this.currentVoiceEntries)if(p.ParentVoice.Parent.IdString===f.IdString)return this.getAudibleEntries(p,m),m}else for(const p of this.currentVoiceEntries)this.getAudibleEntries(p,m);return m}getCurrentDynamicChangingExpressions(){return this.currentDynamicChangingExpressions}CurrentScoreFollowingVoiceEntries(f){const m=[];if(!this.currentVoiceEntries)return m;if(f){for(const p of this.currentVoiceEntries)if(p.ParentVoice.Parent.IdString===f.IdString)return this.getScoreFollowingEntries(p,m),m}else for(const p of this.currentVoiceEntries)this.getScoreFollowingEntries(p,m);return m}currentPlaybackSettings(){return this.musicSheet.SheetPlaybackSetting}moveToPrevious(){this.frontReached||(this.currentVoiceEntries&&(this.currentVoiceEntries=[]),this.recursiveMoveBack())}moveToPreviousVisibleVoiceEntry(f){for(;!this.frontReached;)if(this.moveToPrevious(),this.checkEntries(f))return}moveToNext(){if(this.forwardJumpOccurred=this.backJumpOccurred=!1,!this.endReached&&(this.frontReached&&(this.frontReached=!1,this.currentVoiceEntryIndex=-1),this.currentVoiceEntries&&(this.currentVoiceEntries.length=0),this.recursiveMove(),this.currentMeasure||(this.currentTimeStamp=new s.Fraction(99999,1),this.currentMeasure=this.musicSheet.SourceMeasures.last()),void 0!==this.CurrentTempoChangingExpression&&!this.musicSheet.IgnoreTempoInstructions))if(void 0!==this.CurrentTempoChangingExpression.ContinuousTempo&&this.currentMeasure.Rules.UseInterpolatedTempoForAccelerandoEtc){const f=this.CurrentTempoChangingExpression.ContinuousTempo.getInterpolatedTempo(this.CurrentSourceTimestamp);f>0&&(this.currentBpm=f)}else this.musicSheet.IgnoreTempoInstructions||this.CurrentTempoChangingExpression.InstantaneousTempo?.TempoInBpm&&(this.currentBpm=this.CurrentTempoChangingExpression.InstantaneousTempo.TempoInBpm)}moveToNextVisibleVoiceEntry(f){for(;!this.endReached;)if(this.moveToNext(),this.checkEntries(f))return}resetRepetitionIterationCount(f){return this.setRepetitionIterationCount(f,1),1}incrementRepetitionIterationCount(f){return-1===this.repetitionIterationCountDictKeys.indexOf(f)?this.setRepetitionIterationCount(f,1):this.setRepetitionIterationCount(f,this.getRepetitionIterationCount(f)+1)}setRepetitionIterationCount(f,m){const p=this.repetitionIterationCountDictKeys.indexOf(f);return-1===p?(this.repetitionIterationCountDictKeys.push(f),this.repetitionIterationCountDictValues.push(m)):this.repetitionIterationCountDictValues[p]=m,m}getRepetitionIterationCount(f){const m=this.repetitionIterationCountDictKeys.indexOf(f);if(-1!==m)return this.repetitionIterationCountDictValues[m]}handleRepetitionsAtMeasureBegin(){for(let f=0,m=this.currentMeasure.FirstRepetitionInstructions.length;f<m;++f){const p=this.currentMeasure.FirstRepetitionInstructions[f];if(!p.parentRepetition)continue;const E=p.parentRepetition;this.currentRepetition=E,E.StartIndex===this.currentMeasureIndex&&void 0!==this.JumpResponsibleRepetition&&E!==this.JumpResponsibleRepetition&&E.StartIndex>=this.JumpResponsibleRepetition.StartIndex&&E.EndIndex<=this.JumpResponsibleRepetition.EndIndex&&this.resetRepetitionIterationCount(E)}}handleRepetitionsAtMeasureEnd(){for(let f=0,m=this.currentMeasure.LastRepetitionInstructions.length;f<m;++f){const p=this.currentMeasure.LastRepetitionInstructions[f],E=p.parentRepetition;if(E){if(E.BackwardJumpInstructions.indexOf(p)>-1&&this.getRepetitionIterationCount(E)<E.UserNumberOfRepetitions&&!E.SkipRepetition&&!this.musicSheet.Rules.CursorIgnoreRepetitions)return void this.doBackJump(E);if(p===E.forwardJumpInstruction&&(void 0!==this.JumpResponsibleRepetition&&E!==this.JumpResponsibleRepetition&&E.StartIndex>=this.JumpResponsibleRepetition.StartIndex&&E.EndIndex<=this.JumpResponsibleRepetition.EndIndex&&this.resetRepetitionIterationCount(E),this.repetitionIterationCountDictKeys.contains(E))){const y=E.getForwardJumpTargetForIteration(this.getRepetitionIterationCount(E));if(y>=0)return this.currentMeasureIndex=y,this.currentMeasure=this.musicSheet.SourceMeasures[this.currentMeasureIndex],this.currentVoiceEntryIndex=-1,this.jumpResponsibleRepetition=E,void(this.forwardJumpOccurred=!0);-2===y&&(this.endReached=!0)}}}this.currentMeasureIndex++,void 0!==this.JumpResponsibleRepetition&&this.currentMeasureIndex>this.JumpResponsibleRepetition.EndIndex&&(this.jumpResponsibleRepetition=void 0)}doBackJump(f){f.SkipRepetition||this.musicSheet.Rules.CursorIgnoreRepetitions||(this.currentMeasureIndex=f.getBackwardJumpTarget(),this.currentMeasure=this.musicSheet.SourceMeasures[this.currentMeasureIndex],this.currentVoiceEntryIndex=-1,this.incrementRepetitionIterationCount(f),this.jumpResponsibleRepetition=f,this.backJumpOccurred=!0)}activateCurrentRhythmInstructions(){if(void 0!==this.currentMeasure&&this.currentMeasure.FirstInstructionsStaffEntries.length>0&&void 0!==this.currentMeasure.FirstInstructionsStaffEntries[0]){const f=this.currentMeasure.FirstInstructionsStaffEntries[0].Instructions;for(let m=0,p=f.length;m<p;++m){const E=f[m];E instanceof r.RhythmInstruction&&(this.musicSheet.SheetPlaybackSetting.rhythm=E.Rhythm)}}}activateCurrentDynamicOrTempoInstructions(){const f=this.musicSheet.TimestampSortedDynamicExpressionsList;for(;this.currentDynamicEntryIndex>0&&(this.currentDynamicEntryIndex>=f.length||f[this.currentDynamicEntryIndex].parMultiExpression().AbsoluteTimestamp.gte(this.CurrentSourceTimestamp));)this.currentDynamicEntryIndex--;for(;this.currentDynamicEntryIndex<f.length&&f[this.currentDynamicEntryIndex].parMultiExpression().AbsoluteTimestamp.lt(this.CurrentSourceTimestamp);)this.currentDynamicEntryIndex++;for(;this.currentDynamicEntryIndex<f.length&&f[this.currentDynamicEntryIndex].parMultiExpression().AbsoluteTimestamp.Equals(this.CurrentSourceTimestamp);){const p=f[this.currentDynamicEntryIndex],E=p.staffNumber;this.CurrentSourceTimestamp.Equals(p.parMultiExpression().AbsoluteTimestamp)&&(p.continuousDynamicExpression?this.activeDynamicExpressions[E]=p.continuousDynamicExpression:p.instantaneousDynamicExpression&&(this.activeDynamicExpressions[E]=p.instantaneousDynamicExpression)),this.currentDynamicEntryIndex++}this.currentDynamicChangingExpressions.length=0;for(let p=0;p<this.activeDynamicExpressions.length;p++)if(this.activeDynamicExpressions[p]){let E,y;if(this.activeDynamicExpressions[p]instanceof i.ContinuousDynamicExpression){const d=this.activeDynamicExpressions[p];E=d.StartMultiExpression.AbsoluteTimestamp,y=d.EndMultiExpression.AbsoluteTimestamp,this.CurrentSourceTimestamp.gte(E)&&this.CurrentSourceTimestamp.lte(y)&&this.currentDynamicChangingExpressions.push(new c.DynamicsContainer(d,p))}else{const d=this.activeDynamicExpressions[p];this.CurrentSourceTimestamp.Equals(d.ParentMultiExpression.AbsoluteTimestamp)&&this.currentDynamicChangingExpressions.push(new c.DynamicsContainer(d,p))}}const m=this.musicSheet.TimestampSortedTempoExpressionsList;for(;this.currentTempoEntryIndex>0&&(this.currentTempoEntryIndex>=m.length||m[this.currentTempoEntryIndex].AbsoluteTimestamp.gte(this.CurrentSourceTimestamp));)this.currentTempoEntryIndex--;for(;this.currentTempoEntryIndex<m.length&&m[this.currentTempoEntryIndex].AbsoluteTimestamp.lt(this.CurrentSourceTimestamp);)this.currentTempoEntryIndex++;for(;this.currentTempoEntryIndex<m.length&&m[this.currentTempoEntryIndex].AbsoluteTimestamp.Equals(this.CurrentSourceTimestamp);)this.activeTempoExpression=m[this.currentTempoEntryIndex],this.currentTempoEntryIndex++;if(this.currentTempoChangingExpression=void 0,this.activeTempoExpression){let p=this.activeTempoExpression.AbsoluteTimestamp;this.activeTempoExpression.ContinuousTempo&&(p=this.activeTempoExpression.ContinuousTempo.AbsoluteEndTimestamp),(this.CurrentSourceTimestamp.gte(this.activeTempoExpression.AbsoluteTimestamp)||this.CurrentSourceTimestamp.lte(p))&&(this.currentTempoChangingExpression=this.activeTempoExpression)}}recursiveMoveBack(){if(this.currentVoiceEntryIndex>0){this.currentVoiceEntryIndex--;const f=this.currentMeasure.VerticalSourceStaffEntryContainers[this.currentVoiceEntryIndex];this.currentVoiceEntries=this.getVoiceEntries(f),this.currentVerticalContainerInMeasureTimestamp=f.Timestamp,this.currentRelativeInMeasureTimestamp=this.currentVerticalContainerInMeasureTimestamp,this.currentTimeStamp=s.Fraction.plus(this.currentMeasure.AbsoluteTimestamp,this.currentVerticalContainerInMeasureTimestamp),this.activateCurrentDynamicOrTempoInstructions();const m=this.musicSheet.SelectionEnd;return m&&this.currentTimeStamp.lt(m)&&(this.endReached=!1),void(this.currentMeasureIndex=this.musicSheet.SourceMeasures.indexOf(this.CurrentMeasure))}if(0!==this.currentVoiceEntryIndex||0===this.currentMeasureIndex)this.frontReached=!0,this.currentTimeStamp=new s.Fraction(-1,1);else{const f=this.musicSheet.SourceMeasures[this.currentMeasureIndex-1];this.currentMeasureIndex--,this.currentMeasure=this.musicSheet.SourceMeasures[this.currentMeasureIndex];const m=f.VerticalSourceStaffEntryContainers[f.VerticalSourceStaffEntryContainers.length-1];this.currentVoiceEntries=this.getVoiceEntries(m),this.currentVerticalContainerInMeasureTimestamp=m.Timestamp,this.currentVoiceEntryIndex=f.VerticalSourceStaffEntryContainers.length-1,this.currentRelativeInMeasureTimestamp=this.currentVerticalContainerInMeasureTimestamp,this.currentTimeStamp=s.Fraction.plus(this.currentMeasure.AbsoluteTimestamp,m.Timestamp),this.activateCurrentDynamicOrTempoInstructions();const p=this.musicSheet.SelectionEnd;p&&this.currentTimeStamp.lt(p)&&(this.endReached=!1)}}recursiveMove(){if(this.currentVoiceEntryIndex++,0===this.currentVoiceEntryIndex&&(this.handleRepetitionsAtMeasureBegin(),this.activateCurrentRhythmInstructions()),this.currentVoiceEntryIndex>=0&&this.currentVoiceEntryIndex<this.currentMeasure.VerticalSourceStaffEntryContainers.length){const f=this.currentMeasure.VerticalSourceStaffEntryContainers[this.currentVoiceEntryIndex];this.currentVoiceEntries=this.getVoiceEntries(f),this.currentVerticalContainerInMeasureTimestamp=f.Timestamp,this.currentRelativeInMeasureTimestamp=this.currentVerticalContainerInMeasureTimestamp,this.currentTimeStamp=s.Fraction.plus(this.currentMeasure.AbsoluteTimestamp,this.currentVerticalContainerInMeasureTimestamp);const m=this.musicSheet.SelectionEnd;return m&&this.currentTimeStamp.gte(m)&&(this.endReached=!0),void this.activateCurrentDynamicOrTempoInstructions()}if(this.currentEnrolledMeasureTimestamp.Add(this.currentMeasure.Duration),this.handleRepetitionsAtMeasureEnd(),this.currentMeasureIndex>=0&&this.currentMeasureIndex<this.musicSheet.SourceMeasures.length)return this.currentMeasure=this.musicSheet.SourceMeasures[this.currentMeasureIndex],this.currentTimeStamp=s.Fraction.plus(this.currentMeasure.AbsoluteTimestamp,this.currentVerticalContainerInMeasureTimestamp),this.currentVoiceEntryIndex=-1,void this.recursiveMove();this.currentVerticalContainerInMeasureTimestamp=new s.Fraction,this.currentMeasure=void 0,this.currentVoiceEntries=void 0,this.endReached=!0}checkEntries(f){const m=this.CurrentVisibleVoiceEntries();if(m.length>0){if(!f)return!0;for(let p=0,E=m.length;p<E;++p)if(m[p].Notes[0].Pitch)return!0}return!1}getVisibleEntries(f,m){if(f.ParentVoice.Visible){let p=!1;for(const E of f.Notes)if(E.PrintObject&&E.Notehead?.Shape!==n.NoteHeadShape.NONE){p=!0;break}if(!p&&this.SkipInvisibleNotes)return;m.push(f)}}getAudibleEntries(f,m){if(f.hasTie()){const p=f.Notes[0];if(void 0!==p.NoteTie&&p.NoteTie.StartNote!==p)return}f.ParentVoice.Audible&&f.ParentSourceStaffEntry.ParentStaff.audible&&m.push(f)}getScoreFollowingEntries(f,m){f.ParentVoice.Following&&f.ParentVoice.Parent.Following&&m.push(f)}getVoiceEntries(f){const m=[];for(const p of f.StaffEntries)if(p)for(const E of p.VoiceEntries)m.push(E);return m}}g.MusicPartManagerIterator=h},1121(dt,g,u){"use strict";var l=this&&this.__createBinding||(Object.create?function(c,r,i,o){void 0===o&&(o=i);var n=Object.getOwnPropertyDescriptor(r,i);n&&!("get"in n?!r.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return r[i]}}),Object.defineProperty(c,o,n)}:function(c,r,i,o){void 0===o&&(o=i),c[o]=r[i]}),s=this&&this.__exportStar||function(c,r){for(var i in c)"default"===i||Object.prototype.hasOwnProperty.call(r,i)||l(r,c,i)};Object.defineProperty(g,"__esModule",{value:!0}),s(u(9024),g),s(u(474),g)},427(dt,g,u){"use strict";var l=this&&this.__importDefault||function(y){return y&&y.__esModule?y:{default:y}};Object.defineProperty(g,"__esModule",{value:!0}),g.MusicSheet=void 0;const s=u(2561),c=u(9024),r=u(6001),i=u(7435),o=u(5534),n=u(8786),h=u(9713),e=u(2683),f=l(u(3065)),m=u(7533),p=u(283);class E{constructor(){this.idString="uninitialized",this.sourceMeasures=[],this.repetitions=[],this.dynListStaves=[],this.timestampSortedDynamicExpressionsList=[],this.timestampSortedTempoExpressionsList=[],this.instrumentalGroups=[],this.instruments=[],this.musicPartManager=void 0,this.musicSheetErrors=new n.MusicSheetErrors,this.staves=[],this.transpose=0,this.defaultStartTempoInBpm=0,this.drawErroneousMeasures=!1,this.hasBeenOpenedForTheFirstTime=!1,this.currentEnrolledPosition=new s.Fraction(0,1),this.MeasureWidthFactor=1,this.IgnoreTempoInstructions=!1,this.playbackSettings=new p.PlaybackSettings,this.playbackSettings.rhythm=new s.Fraction(4,4,0,!1),this.userStartTempoInBPM=100,this.pageWidth=120,this.MusicPartManager=new c.MusicPartManager(this),this.hasBPMInfo=!1}static getIndexFromStaff(d){return d.idInMusicSheet}get SourceMeasures(){return this.sourceMeasures}set SourceMeasures(d){this.sourceMeasures=d}get Repetitions(){return this.repetitions}set Repetitions(d){this.repetitions=d}get DynListStaves(){return this.dynListStaves}set TimestampSortedTempoExpressionsList(d){this.timestampSortedTempoExpressionsList=d}get TimestampSortedTempoExpressionsList(){return this.timestampSortedTempoExpressionsList}get TimestampSortedDynamicExpressionsList(){return this.timestampSortedDynamicExpressionsList}get InstrumentalGroups(){return this.instrumentalGroups}get Parts(){return this.instruments}get Instruments(){return this.instruments}get SheetPlaybackSetting(){return this.playbackSettings}set SheetPlaybackSetting(d){this.playbackSettings=d}get DrawErroneousMeasures(){return this.drawErroneousMeasures}set DrawErroneousMeasures(d){this.drawErroneousMeasures=d}get HasBeenOpenedForTheFirstTime(){return this.hasBeenOpenedForTheFirstTime}set HasBeenOpenedForTheFirstTime(d){this.hasBeenOpenedForTheFirstTime=d}InitializeStartTempoInBPM(d){this.userStartTempoInBPM=d}get DefaultStartTempoInBpm(){return this.defaultStartTempoInBpm}set DefaultStartTempoInBpm(d){this.defaultStartTempoInBpm=d,this.InitializeStartTempoInBPM(d)}get Path(){return this.path}set Path(d){this.path=d}get Staves(){return this.staves}get TitleString(){return this.title?this.title.text:""}set TitleString(d){this.Title=new i.Label(d)}get SubtitleString(){return this.subtitle?this.subtitle.text:""}set SubtitleString(d){this.Subtitle=new i.Label(d)}get ComposerString(){return this.composer?this.composer.text:""}set ComposerString(d){this.Composer=new i.Label(d)}get LyricistString(){return this.lyricist?this.lyricist.text:""}set LyricistString(d){this.Lyricist=new i.Label(d)}get CopyrightString(){return this.copyright?this.copyright.text:""}set CopyrightString(d){this.Copyright=new i.Label(d,m.TextAlignmentEnum.CenterBottom,void 0,!0)}get Title(){return this.title}set Title(d){this.title=d}get Subtitle(){return this.subtitle}set Subtitle(d){this.subtitle=d}get Composer(){return this.composer}set Composer(d){this.composer=d}get Lyricist(){return this.lyricist}set Lyricist(d){this.lyricist=d}get Copyright(){return this.copyright}set Copyright(d){this.copyright=d}get Rules(){return this.rules||(f.default.debug("warning: sheet.Rules was undefined. Creating new EngravingRules."),this.rules=new h.EngravingRules),this.rules}set Rules(d){this.rules=d}get SheetErrors(){return this.musicSheetErrors}get SelectionStart(){return this.selectionStart}set SelectionStart(d){this.selectionStart=d.clone(),this.currentEnrolledPosition=d.clone()}get SelectionEnd(){return this.selectionEnd}set SelectionEnd(d){this.selectionEnd=d}set HasBPMInfo(d){this.hasBPMInfo=d}get HasBPMInfo(){return this.hasBPMInfo}addMeasure(d){this.sourceMeasures.push(d),d.measureListIndex=this.sourceMeasures.length-1}checkForInstrumentWithNoVoice(){for(let d=0,S=this.instruments.length;d<S;++d){const M=this.instruments[d];if(0===M.Voices.length){const x=new o.Voice(M,1);M.Voices.push(x)}}}getStaffFromIndex(d){return this.staves[d]}fillStaffList(){let d=0;for(let S=0,M=this.instruments.length;S<M;++S){const x=this.instruments[S];for(let _=0,I=x.Staves.length;_<I;++_){const T=x.Staves[_];T.idInMusicSheet=d,this.staves.push(T),d++}}}get MusicPartManager(){return this.musicPartManager}set MusicPartManager(d){this.musicPartManager=d}getCompleteNumberOfStaves(){let d=0;for(let S=0,M=this.instruments.length;S<M;++S)d+=this.instruments[S].Staves.length;return d}getListOfMeasuresFromIndeces(d,S){const M=[];for(let x=d;x<=S;x++)M.push(this.sourceMeasures[x]);return M}getNextSourceMeasure(d){const S=this.sourceMeasures.indexOf(d);return S===this.sourceMeasures.length-1?d:this.sourceMeasures[S+1]}getFirstSourceMeasure(){return this.sourceMeasures[0]}getLastSourceMeasure(){return this.sourceMeasures[this.sourceMeasures.length-1]}resetAllNoteStates(){const d=this.MusicPartManager.getIterator();for(;!d.EndReached&&d.CurrentVoiceEntries;){for(let S=0,M=d.CurrentVoiceEntries.length;S<M;++S){const x=d.CurrentVoiceEntries[S];for(let _=0,I=x.Notes.length;_<I;++_)x.Notes[_].state=e.NoteState.Normal}d.moveToNext()}}getMusicSheetInstrumentIndex(d){return this.Instruments.indexOf(d)}getGlobalStaffIndexOfFirstStaff(d){const S=this.getMusicSheetInstrumentIndex(d);let M=0;for(let x=0;x<S;x++)M+=this.Instruments[x].Staves.length;return M}setRepetitionNewUserNumberOfRepetitions(d,S){let M=0;for(let x=0;x<this.repetitions.length;x++)if(this.repetitions[x]instanceof r.Repetition){if(d===M){this.repetitions[x].UserNumberOfRepetitions=S;break}M++}}getRepetitionByIndex(d){let S=0;for(let M=0;M<this.repetitions.length;M++)if(this.repetitions[M]instanceof r.Repetition){if(d===S)return this.repetitions[M];S++}}CompareTo(d){return this.Title.text.localeCompare(d.Title.text)}getExpressionsStartTempoInBPM(){if(this.TimestampSortedTempoExpressionsList.length>0){const d=this.TimestampSortedTempoExpressionsList[0];if(d.InstantaneousTempo)return d.InstantaneousTempo.TempoInBpm;if(d.ContinuousTempo)return d.ContinuousTempo.StartTempo}return this.userStartTempoInBPM}get Errors(){return this.musicSheetErrors.measureErrors}get FirstMeasureNumber(){try{return this.getFirstSourceMeasure().MeasureNumber}catch(d){return f.default.info("MusicSheet.FirstMeasureNumber: ",d),0}}get LastMeasureNumber(){try{return this.getLastSourceMeasure().MeasureNumber}catch(d){return f.default.info("MusicSheet.LastMeasureNumber: ",d),0}}get CurrentEnrolledPosition(){return this.currentEnrolledPosition.clone()}set CurrentEnrolledPosition(d){this.currentEnrolledPosition=d.clone()}get Transpose(){return this.transpose}set Transpose(d){this.transpose=d}get FullNameString(){return this.ComposerString+" "+this.TitleString}get IdString(){return this.idString}set IdString(d){this.idString=d}getEnrolledSelectionStartTimeStampWorkaround(){const d=this.MusicPartManager.getIterator(this.SelectionStart);return s.Fraction.createFromFraction(d.CurrentEnrolledTimestamp)}get SheetEndTimestamp(){const d=this.getLastSourceMeasure();return s.Fraction.plus(d.AbsoluteTimestamp,d.Duration)}getSourceMeasureFromTimeStamp(d){for(let S=0,M=this.sourceMeasures.length;S<M;++S){const x=this.sourceMeasures[S];for(let _=0,I=x.VerticalSourceStaffEntryContainers.length;_<I;++_)if(d.Equals(x.VerticalSourceStaffEntryContainers[_].getAbsoluteTimestamp()))return x}return this.findSourceMeasureFromTimeStamp(d)}findSourceMeasureFromTimeStamp(d){for(const S of this.sourceMeasures)if(S.AbsoluteTimestamp.lte(d)&&d.lt(s.Fraction.plus(S.AbsoluteTimestamp,S.Duration)))return S}getVisibleInstruments(){const d=[];for(let S=0,M=this.Instruments.length;S<M;++S){const x=this.Instruments[S];x.Voices.length>0&&x.Voices[0].Visible&&d.push(x)}return d}}g.MusicSheet=E,E.defaultTitle="defaultTitle"},1325(dt,g){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.MappingSourceMusicPart=void 0,g.MappingSourceMusicPart=class{constructor(u,l,s,c=-1,r=!1){this.repetitionRun=-1,this.sourceMusicPart=u,this.parentPartListEntry=s,this.startTimestamp=l.clone(),this.repetitionRun=c,this.parentRepetition=s,this.isEnding=r}get IsRepetition(){return void 0!==this.parentRepetition}get IsEnding(){return this.isEnding}get IsLastRepetitionRun(){return this.IsRepetition&&this.repetitionRun+1===this.parentRepetition.UserNumberOfRepetitions}get RepetitionRun(){return this.repetitionRun}get ParentPartListEntry(){return this.parentPartListEntry}get SourceMusicPart(){return this.sourceMusicPart}get StartTimestamp(){return this.startTimestamp}CompareTo(u){return u?this.startTimestamp.CompareTo(u.startTimestamp):1}}},7551(dt,g){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.PartListEntry=void 0,g.PartListEntry=class{constructor(u){this.enrolledTimestamps=[],this.visible=!0,this.musicSheet=u}get Visible(){return this.visible}set Visible(u){this.visible=u}getFirstSourceMeasure(){return this.musicSheet.SourceMeasures[this.startIndex]}getLastSourceMeasure(){return this.musicSheet.SourceMeasures[this.endIndex]}}},6001(dt,g,u){"use strict";var l=this&&this.__importDefault||function(h){return h&&h.__esModule?h:{default:h}};Object.defineProperty(g,"__esModule",{value:!0}),g.RepetitionEndingPart=g.Repetition=void 0;const s=u(3457),c=u(2561),r=u(7551),i=l(u(3065));g.Repetition=class o extends r.PartListEntry{constructor(e,f=!1){super(e),this.SkipRepetition=!1,this.userNumberOfRepetitions=0,this.backwardJumpInstructions=[],this.endingParts=[],this.endingIndexDict={},this.visibles=[],this.fromWords=!1,this.repetitonIterationOrder=[],this.numberOfEndings=1,this.musicSheet2=e,this.virtualOverallRepetition=f}get BackwardJumpInstructions(){return this.backwardJumpInstructions}get EndingIndexDict(){return this.endingIndexDict}get EndingParts(){return this.endingParts}get Visibles(){return this.visibles}set Visibles(e){this.visibles=e}get DefaultNumberOfRepetitions(){let e=2;return this.virtualOverallRepetition&&(e=1),Math.max(e,Object.keys(this.endingIndexDict).length,this.checkRepetitionForMultipleLyricVerses())}get UserNumberOfRepetitions(){return this.userNumberOfRepetitions}set UserNumberOfRepetitions(e){this.userNumberOfRepetitions=e,this.repetitonIterationOrder=[];const f=this.userNumberOfRepetitions-this.NumberOfEndings;for(let m=1;m<=this.userNumberOfRepetitions;m++)this.repetitonIterationOrder.push(m<=f?1:m-f)}getForwardJumpTargetForIteration(e){const f=this.repetitonIterationOrder[e-1];return this.endingIndexDict[f]?this.endingIndexDict[f].part.StartIndex:-1}getBackwardJumpTarget(){return this.startMarker.measureIndex}setEndingsStartIndex(e,f){const m=new n(new s.SourceMusicPart(this.musicSheet2,f,f));this.endingParts.push(m);for(const p of e)try{this.endingIndexDict[p]=m,m.endingIndices.push(p),this.numberOfEndings<p&&(this.numberOfEndings=p)}catch(E){i.default.error("Repetition: Exception.",E)}}setEndingStartIndex(e,f){const m=new n(new s.SourceMusicPart(this.musicSheet2,f,f));this.EndingIndexDict[e]=m,this.endingParts.push(m),m.endingIndices.push(e),this.numberOfEndings<e&&(this.numberOfEndings=e)}setEndingEndIndex(e,f){this.endingIndexDict[e]&&this.endingIndexDict[e].part.setEndIndex(f)}get NumberOfEndings(){return this.numberOfEndings}get FromWords(){return this.fromWords}set FromWords(e){this.fromWords=e}get AbsoluteTimestamp(){return c.Fraction.createFromFraction(this.musicSheet2.SourceMeasures[this.startMarker.measureIndex].AbsoluteTimestamp)}get StartIndex(){return this.startMarker.measureIndex}get EndIndex(){if(0===this.BackwardJumpInstructions.length)return this.StartIndex;let e=this.backwardJumpInstructions[this.backwardJumpInstructions.length-1].measureIndex;return this.endingIndexDict[this.NumberOfEndings]&&(e=Math.max(this.endingIndexDict[this.NumberOfEndings].part.EndIndex,e)),e}checkRepetitionForMultipleLyricVerses(){let e=0;const m=this.EndIndex;for(let p=this.StartIndex;p<=m;p++){const E=this.musicSheet2.SourceMeasures[p];for(let y=0;y<E.CompleteNumberOfStaves;y++)if(E.VerticalSourceStaffEntryContainers[y])for(const d of E.VerticalSourceStaffEntryContainers[y].StaffEntries)if(d){let S=0;for(const M of d.VoiceEntries)S+=M.LyricsEntries.keys.length;e=Math.max(e,S)}}return e}get FirstSourceMeasureNumber(){return this.getFirstSourceMeasure().MeasureNumber}get LastSourceMeasureNumber(){return this.getLastSourceMeasure().MeasureNumber}coversIdenticalMeasures(e){return this.StartIndex===e.StartIndex&&this.EndIndex===e.EndIndex}removeFromRepetitionInstructions(){void 0!==this.startMarker&&(this.startMarker.parentRepetition=void 0),void 0!==this.endMarker&&(this.endMarker.parentRepetition=void 0);for(const e of this.BackwardJumpInstructions)e.parentRepetition=void 0}};class n{constructor(e){this.endingIndices=[],this.part=e}ToString(){return this.endingIndices.join(", ")}}g.RepetitionEndingPart=n},3457(dt,g,u){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.SourceMusicPart=void 0;const l=u(7551),s=u(2561);g.SourceMusicPart=class c extends l.PartListEntry{constructor(i,o,n){super(i),this.musicSheet=i,this.startIndex=o,this.endIndex=n}get MeasuresCount(){return this.endIndex-this.startIndex+1}get StartIndex(){return this.startIndex}get EndIndex(){return this.endIndex}get ParentRepetition(){return this.parentRepetition}set ParentRepetition(i){this.parentRepetition=i}get AbsoluteTimestamp(){return s.Fraction.createFromFraction(this.musicSheet.SourceMeasures[this.startIndex].AbsoluteTimestamp)}setStartIndex(i){this.startIndex=i}setEndIndex(i){this.endIndex=i}}},4076(dt,g,u){"use strict";var l=this&&this.__createBinding||(Object.create?function(c,r,i,o){void 0===o&&(o=i);var n=Object.getOwnPropertyDescriptor(r,i);n&&!("get"in n?!r.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return r[i]}}),Object.defineProperty(c,o,n)}:function(c,r,i,o){void 0===o&&(o=i),c[o]=r[i]}),s=this&&this.__exportStar||function(c,r){for(var i in c)"default"===i||Object.prototype.hasOwnProperty.call(r,i)||l(r,c,i)};Object.defineProperty(g,"__esModule",{value:!0}),s(u(1325),g),s(u(7551),g),s(u(6001),g),s(u(3457),g)},1272(dt,g,u){"use strict";var l=this&&this.__importDefault||function(T){return T&&T.__esModule?T:{default:T}};Object.defineProperty(g,"__esModule",{value:!0}),g.InstrumentReader=void 0;const s=u(469),c=u(2369),r=u(164),i=u(4543),o=u(9288),n=u(2561),h=u(9767),e=u(7307),f=u(164),m=u(9288),p=u(4543),E=l(u(3065)),y=u(164),d=u(9536),S=u(5984),M=u(3186),x=u(1336),_=u(5282),I=u(6954);g.InstrumentReader=class{constructor(T,A,v,B){this.voiceGeneratorsDict={},this.staffMainVoiceGeneratorDict={},this.divisions=0,this.currentClefNumber=1,this.currentXmlMeasureIndex=0,this.activeKeyHasBeenInitialized=!1,this.abstractInstructions=[],this.repetitionInstructionReader=A,this.xmlMeasureList=v,this.musicSheet=B.GetMusicSheet,this.instrument=B,this.activeClefs=new Array(B.Staves.length),this.activeClefsHaveBeenInitialized=new Array(B.Staves.length);for(let D=0;D<B.Staves.length;D++)this.activeClefsHaveBeenInitialized[D]=!1;this.createExpressionGenerators(B.Staves.length),this.slurReader=new M.SlurReader(this.musicSheet),this.pluginManager=T}get ActiveKey(){return this.activeKey}get MaxTieNoteFraction(){return this.maxTieNoteFraction}get ActiveRhythm(){return this.activeRhythm}set ActiveRhythm(T){this.activeRhythm=T}readNextXmlMeasure(T,A,v){if(this.currentXmlMeasureIndex>=this.xmlMeasureList.length)return!1;this.currentMeasure=T,this.followingMultirestMeasures=Math.max(this.followingMultirestMeasures-1,0),this.inSourceMeasureInstrumentIndex=this.musicSheet.getGlobalStaffIndexOfFirstStaff(this.instrument),this.repetitionInstructionReader&&this.repetitionInstructionReader.prepareReadingMeasure(T,this.currentXmlMeasureIndex);let B=new n.Fraction(0,1),D=new n.Fraction(0,1),L=!1;this.maxTieNoteFraction=new n.Fraction(0,1);let F=!1;try{const V=this.xmlMeasureList[this.currentXmlMeasureIndex],j=V.elements();let P;T.Rules.UseXMLMeasureNumbers&&!Number.isInteger(T.MeasureNumberXML)&&(P=parseInt(V.attribute("number")?.value,10),Number.isInteger(P)&&(T.MeasureNumberXML=P));const U=V.attribute("osmdWidthFactor");if(U){const H=Number.parseFloat(U.value);"number"!=typeof H||isNaN(H)?E.default.info(`xml parse: osmdWidthFactor invalid for measure ${P}`):T.WidthFactor=H}let Y;for(let H=0;H<j.length;H++){const Q=j[H];if(H>0&&(Y=j[H-1]),"print"===Q.name)"yes"===Q.attribute("new-system")?.value&&(T.printNewSystemXml=!0),"yes"===Q.attribute("new-page")?.value&&(T.printNewPageXml=!0);else if("attributes"===Q.name){const ot=Q.element("divisions");if(ot&&(this.divisions=parseInt(ot.value,10),isNaN(this.divisions))){const nt=h.ITextTranslation.translateText("ReaderErrorMessages/DivisionError","Invalid divisions value at Instrument: ");if(E.default.debug("InstrumentReader.readNextXmlMeasure",nt),this.divisions=this.readDivisionsFromNotes(),!(this.divisions>0))throw L=!0,new e.MusicSheetReadingException(nt+this.instrument.Name);this.musicSheet.SheetErrors.push(nt+this.instrument.Name)}if(!Q.element("divisions")&&0===this.divisions&&0===this.currentXmlMeasureIndex){const nt=h.ITextTranslation.translateText("ReaderErrorMessages/DivisionError","Invalid divisions value at Instrument: ");if(this.divisions=this.readDivisionsFromNotes(),!(this.divisions>0))throw L=!0,new e.MusicSheetReadingException(nt+this.instrument.Name);this.musicSheet.SheetErrors.push(nt+this.instrument.Name)}this.addAbstractInstruction(Q,v,Y,B.clone()),B.Equals(new n.Fraction(0,1))&&this.isAttributesNodeAtBeginOfMeasure(this.xmlMeasureList[this.currentXmlMeasureIndex],Q)&&this.saveAbstractInstructionList(this.instrument.Staves.length,!0),this.isAttributesNodeAtEndOfMeasure(this.xmlMeasureList[this.currentXmlMeasureIndex],Q,B)&&this.saveClefInstructionAtEndOfMeasure();const $=Q.elements("staff-details");for(const nt of $){const st=nt.element("staff-lines");if(st){let N=1;const C=nt.attribute("number");C&&(N=parseInt(C.value,10)),this.instrument.Staves[N-1].StafflineCount=parseInt(st.value,10)}}const it=Q.element("measure-style");if(it){const nt=it.element("multiple-rest");if(nt){const st=nt.value;let N=0;try{N=Number.parseInt(st,10),void 0!==T.multipleRestMeasures&&N!==T.multipleRestMeasures?T.multipleRestMeasures=0:(T.multipleRestMeasures=N,this.currentMultirestStartMeasure=T,this.followingMultirestMeasures=N+1)}catch(C){console.log("multirest parse error: "+C)}}}}else if("note"===Q.name){let ot=!0;"no"===Q.attribute("print-object")?.value&&(ot=!1);const $=this.getNoteStaff(Q);this.currentStaff=this.instrument.Staves[$-1];const it=void 0!==Q.element("chord");if(Q.element("voice")){const yt=parseInt(Q.element("voice").value,10);this.currentVoiceGenerator=this.getOrCreateVoiceGenerator(yt,$-1)}else it&&this.currentVoiceGenerator||(this.currentVoiceGenerator=this.getOrCreateVoiceGenerator(1,$-1));let nt,st=0,N=new n.Fraction(0,1),C=2;const O=void 0!==Q.element("rest");if(Q.element("duration")){if(0===this.divisions&&0===this.currentXmlMeasureIndex){if(this.divisions=this.readDivisionsFromNotes(),0===this.divisions){const yt=h.ITextTranslation.translateText("ReaderErrorMessages/DivisionError","Invalid divisions value at Instrument: ");throw L=!0,new e.MusicSheetReadingException(yt+this.instrument.Name)}this.musicSheet.SheetErrors.push(h.ITextTranslation.translateText("ReaderErrorMessages/DivisionError","Invalid divisions value at Instrument: ")+this.instrument.Name)}if(st=parseInt(Q.element("duration").value,10),isNaN(st)){const yt=h.ITextTranslation.translateText("ReaderErrorMessages/NoteDurationError","Invalid Note Duration.");this.musicSheet.SheetErrors.pushMeasureError(yt),E.default.debug("InstrumentReader.readNextXmlMeasure",yt);continue}if(N=new n.Fraction(st,4*this.divisions),O&&N.RealValue>this.ActiveRhythm?.Rhythm.RealValue&&(N=this.ActiveRhythm.Rhythm.clone()),0===st?N=this.getNoteDurationFromTypeNode(Q):nt=this.getNoteDurationFromTypeNode(Q),Q.element("time-modification")){N=this.getNoteDurationForTuplet(Q);const yt=Q.element("time-modification");yt?.element("normal-notes")&&(C=parseInt(yt.element("normal-notes").value,10))}}const X=Q.combinedElement("notations"),W=void 0!==Q.element("grace")||0===st||it&&F;let G=!1,K=!1;if(W){const yt=Q.element("grace");yt&&yt.attributes()&&yt.attribute("slash")&&"yes"===yt.attribute("slash").value&&(G=!0),N=this.getNoteDurationFromTypeNode(Q),X&&X.element("slur")&&(K=!0)}const[q,Z]=this.getCueNoteAndNoteTypeXml(Q),[et,ct,pt]=this.getStemDirectionAndColors(Q);let gt;if(X){const yt=X.element("ornaments");yt&&(gt=this.getTremoloInfo(yt),this.getWavyLines(yt,Q,B,D))}const Et=it?D.clone():B.clone();this.currentStaffEntry=this.currentMeasure.findOrCreateStaffEntry(Et,this.inSourceMeasureInstrumentIndex+$-1,this.currentStaff).staffEntry,(!this.currentVoiceGenerator.hasVoiceEntry()||!it&&!W&&!F||W&&!F||W&&!it||!W&&F)&&this.currentVoiceGenerator.createVoiceEntry(Et,this.currentStaffEntry,!W,W,G,K),W||it||(D=B.clone(),B.Add(N)),it&&void 0!==this.currentStaffEntry&&this.currentStaffEntry.ParentStaff!==this.currentStaff&&(this.currentStaffEntry=this.currentVoiceGenerator.checkForStaffEntryLink(this.inSourceMeasureInstrumentIndex+$-1,this.currentStaff,this.currentStaffEntry,this.currentMeasure));const St=void 0!==this.currentStaffEntry&&void 0!==this.currentStaffEntry.Timestamp&&this.currentStaffEntry.Timestamp.Equals(new n.Fraction(0,1))&&!this.currentStaffEntry.hasNotes();this.saveAbstractInstructionList(this.instrument.Staves.length,St);const Mt=Q.elements("dot").length;if(this.currentVoiceGenerator.read(Q,N,nt,Z,C,O,this.currentStaffEntry,this.currentMeasure,A,this.maxTieNoteFraction,it,v,ot,q,W,et,gt,ct,pt,Mt),void 0!==X&&X.element("dynamics")){const yt=this.expressionReaders[this.readExpressionStaffNumber(Q)-1];yt&&(yt.readExpressionParameters(Q,this.instrument,this.divisions,B,D,this.currentMeasure.MeasureNumber,!1),yt.read(Q,this.currentMeasure,D))}F=W}else if("forward"===Q.name){const ot=parseInt(Q.element("duration").value,10);B.Add(new n.Fraction(ot,4*this.divisions))}else if("backup"===Q.name){const ot=parseInt(Q.element("duration").value,10);B.Sub(new n.Fraction(ot,4*this.divisions)),B.IsNegative()&&(B=new n.Fraction(0,1)),D.Sub(new n.Fraction(ot,4*this.divisions)),D.IsNegative()&&(D=new n.Fraction(0,1))}else if("direction"===Q.name){const ot=Q.elements("direction-type"),$=ot[0];let it=Math.min(1,B.RealValue);void 0!==this.activeRhythm&&this.activeRhythm.Rhythm&&(it/=this.activeRhythm.Rhythm.RealValue);let nt=!1;if(this.repetitionInstructionReader&&(nt=this.repetitionInstructionReader.handleRepetitionInstructionsFromWordsOrSymbols($,it)),!nt){let st=this.expressionReaders[0];const N=this.readExpressionStaffNumber(Q)-1;if(N<this.expressionReaders.length&&(st=this.expressionReaders[N]),st){if(ot.some(C=>C.element("octave-shift"))){st.readExpressionParameters(Q,this.instrument,this.divisions,B,D,this.currentMeasure.MeasureNumber,!0);let C,O=0;this.currentStaffEntry?.Timestamp?.Equals(B)?(O=this.currentStaffEntry.VoiceEntries.length,C=B.clone()):C=D.clone(),st.addOctaveShift(Q,this.currentMeasure,C,O)}ot.some(C=>C.element("pedal"))&&(st.readExpressionParameters(Q,this.instrument,this.divisions,B,D,this.currentMeasure.MeasureNumber,!0),st.addPedalMarking(Q,this.currentMeasure,B.clone())),st.readExpressionParameters(Q,this.instrument,this.divisions,B,D,this.currentMeasure.MeasureNumber,!1),st.read(Q,this.currentMeasure,B,D.clone())}}}else if("barline"===Q.name){this.repetitionInstructionReader&&this.repetitionInstructionReader.handleLineRepetitionInstructions(Q)&&(this.currentMeasure.HasEndLine=!0);const ot=Q.attribute("location");if(H===j.length-1||"right"===(ot?.value??"right")){const it=Q.element("bar-style")?.value;it&&(this.currentMeasure.endingBarStyleXml=it,this.currentMeasure.endingBarStyleEnum=I.SystemLinesEnumHelper.xmlBarlineStyleToSystemLinesEnum(it))}}else if("sound"===Q.name)try{if(Q.attribute("tempo")){const ot=parseFloat(Q.attribute("tempo").value);0===this.currentXmlMeasureIndex&&(this.musicSheet.DefaultStartTempoInBpm=ot,this.musicSheet.HasBPMInfo=!0)}}catch(ot){E.default.debug("InstrumentReader.readTempoInstruction",ot)}else if("harmony"===Q.name){const ot=this.getNoteStaff(Q);this.currentStaff=this.instrument.Staves[ot-1];const $=B.clone();this.currentStaffEntry=this.currentMeasure.findOrCreateStaffEntry($,this.inSourceMeasureInstrumentIndex+ot-1,this.currentStaff).staffEntry,this.currentStaffEntry.ChordContainers.push(d.ChordSymbolReader.readChordSymbol(Q,this.musicSheet,this.activeKey))}}for(const H in this.voiceGeneratorsDict)this.voiceGeneratorsDict.hasOwnProperty(H)&&this.voiceGeneratorsDict[H].checkForOpenBeam();if(this.currentXmlMeasureIndex===this.xmlMeasureList.length-1){for(let H=0;H<this.instrument.Staves.length;H++)this.activeClefsHaveBeenInitialized[H]||this.createDefaultClefInstruction(this.musicSheet.getGlobalStaffIndexOfFirstStaff(this.instrument)+H);this.activeKeyHasBeenInitialized||this.createDefaultKeyInstruction();for(let H=0;H<this.expressionReaders.length;H++){const Q=this.expressionReaders[H];Q&&Q.closeOpenExpressions(this.currentMeasure,B)}}this.musicSheet.HasBPMInfo?0===T.TempoInBPM&&this.previousMeasure&&(this.currentMeasure.TempoInBPM=this.previousMeasure.TempoInBPM):this.currentMeasure.TempoInBPM=120}catch(V){if(L)throw new e.MusicSheetReadingException(V.Message);const j=h.ITextTranslation.translateText("ReaderErrorMessages/MeasureError","Error while reading Measure.");this.musicSheet.SheetErrors.pushMeasureError(j),E.default.debug("InstrumentReader.readNextXmlMeasure",j,V)}return this.previousMeasure=this.currentMeasure,this.currentXmlMeasureIndex+=1,!0}getStemDirectionAndColors(T){let A,v=x.StemDirectionType.Undefined;const B=T.element("stem");if(B){v=this.getStemDirectionType(B);const F=B.attribute("color");F&&(A=this.parseXmlColor(F.value))}let D=this.getNoteHeadColorXml(T);const L=this.getNoteColorXml(T);return L&&!D&&(D=L),L&&!A&&(A=L),[v,A,D]}parseXmlColor(T){return T}doCalculationsAfterDurationHasBeenSet(){for(const T in this.voiceGeneratorsDict)this.voiceGeneratorsDict.hasOwnProperty(T)&&this.voiceGeneratorsDict[T].checkOpenTies()}getOrCreateVoiceGenerator(T,A){const v=this.instrument.Staves[A];let B=this.voiceGeneratorsDict[T];if(B)-1===v.Voices.indexOf(B.GetVoice)&&v.Voices.push(B.GetVoice);else{const D=this.staffMainVoiceGeneratorDict[A];D?(B=new s.VoiceGenerator(this.pluginManager,v,T,this.slurReader,D.GetVoice),v.Voices.push(B.GetVoice),this.voiceGeneratorsDict[T]=B):(B=new s.VoiceGenerator(this.pluginManager,v,T,this.slurReader),v.Voices.push(B.GetVoice),this.voiceGeneratorsDict[T]=B,this.staffMainVoiceGeneratorDict[A]=B)}return B}createExpressionGenerators(T){this.expressionReaders=new Array(T);for(let A=0;A<T;A++)this.expressionReaders[A]=new S.ExpressionReader(this.musicSheet,this.instrument,A+1)}createDefaultClefInstruction(T){let A;A=this.musicSheet.SourceMeasures.length>0?this.musicSheet.SourceMeasures[0]:this.currentMeasure;const v=new r.ClefInstruction(f.ClefEnum.G,0,2);let B;A.FirstInstructionsStaffEntries[T]?(B=A.FirstInstructionsStaffEntries[T],B.removeFirstInstructionOfTypeClefInstruction()):(B=new c.SourceStaffEntry(void 0,void 0),A.FirstInstructionsStaffEntries[T]=B),v.Parent=B,B.Instructions.splice(0,0,v)}createDefaultKeyInstruction(){let T;T=this.musicSheet.SourceMeasures.length>0?this.musicSheet.SourceMeasures[0]:this.currentMeasure;const A=new i.KeyInstruction(void 0,0,p.KeyEnum.major);for(let v=this.inSourceMeasureInstrumentIndex;v<this.inSourceMeasureInstrumentIndex+this.instrument.Staves.length;v++)if(T.FirstInstructionsStaffEntries[v]){const B=T.FirstInstructionsStaffEntries[v];A.Parent=B,B.removeFirstInstructionOfTypeKeyInstruction(),B.Instructions.splice(B.Instructions[0]instanceof r.ClefInstruction?1:0,0,A)}else{const B=new c.SourceStaffEntry(void 0,void 0);T.FirstInstructionsStaffEntries[v]=B,A.Parent=B,B.Instructions.push(A)}}isAttributesNodeAtBeginOfMeasure(T,A){const v=T.elements(),B=v.indexOf(A);if(B>0&&"backup"===v[B-1].name)return!0;let D=-1;for(let L=0;L<v.length;L++)if("note"===v[L].name){D=L;break}return B<D&&D>0||D<0}isAttributesNodeAtEndOfMeasure(T,A,v){if(v.Equals(this.ActiveRhythm?.Rhythm))return!0;const B=T.elements().slice();let D=0;for(let F=0;F<B.length;F++)if(B[F]===A){D=F;break}let L=0;for(let F=D;F<B.length;F++)if("note"===B[F].name){L=F;break}return D>L}getNoteDurationFromTypeNode(T){const A=T.element("type");return A?_.NoteTypeHandler.getNoteDurationFromType(A.value):new n.Fraction(0,4*this.divisions)}addAbstractInstruction(T,A,v,B){if(T.element("divisions")&&1===T.elements().length)return;const D=T.element("transpose");if(D){const V=D.element("chromatic");V&&(this.instrument.PlaybackTranspose=parseInt(V.value,10))}const L=T.elements("clef");let F;if(L.length>0)for(let V=0,j=L.length;V<j;++V){const P=L[V];let U=f.ClefEnum.G,Y=2,H=1,Q=0;const ot=P.element("line");if(ot)try{Y=parseInt(ot.value,10)}catch(st){F=h.ITextTranslation.translateText("ReaderErrorMessages/ClefLineError","Invalid clef line. Using default."),this.musicSheet.SheetErrors.pushMeasureError(F),Y=2,E.default.debug("InstrumentReader.addAbstractInstruction",F,st)}const $=P.element("sign");if($)try{U=f.ClefEnum[$.value],r.ClefInstruction.isSupportedClef(U)||(F=h.ITextTranslation.translateText("ReaderErrorMessages/ClefError","Unsupported clef. Using default."),this.musicSheet.SheetErrors.pushMeasureError(F),U=f.ClefEnum.G,Y=2),U===f.ClefEnum.TAB&&(Q=-1)}catch(st){F=h.ITextTranslation.translateText("ReaderErrorMessages/ClefError","Invalid clef. Using default."),this.musicSheet.SheetErrors.pushMeasureError(F),U=f.ClefEnum.G,Y=2,E.default.debug("InstrumentReader.addAbstractInstruction",F,st)}const it=P.element("clef-octave-change");if(it)try{Q=parseInt(it.value,10)}catch{F=h.ITextTranslation.translateText("ReaderErrorMessages/ClefOctaveError","Invalid clef octave. Using default."),this.musicSheet.SheetErrors.pushMeasureError(F),Q=0}if(P.hasAttributes&&P.attribute("number"))try{H=parseInt(P.attribute("number").value,10),H>this.currentClefNumber&&(H=this.currentClefNumber),this.currentClefNumber=H+1}catch{F=h.ITextTranslation.translateText("ReaderErrorMessages/ClefError","Invalid clef. Using default."),this.musicSheet.SheetErrors.pushMeasureError(F),H=1,this.currentClefNumber=H+1}const nt=new r.ClefInstruction(U,Q,Y);this.abstractInstructions.push([H,nt,B])}if(void 0!==T.element("key")&&this.instrument.MidiInstrumentId!==y.MidiInstrument.Percussion){let V=0;const j=T.element("key").element("fifths");if(j)try{V=parseInt(j.value,10)}catch(H){F=h.ITextTranslation.translateText("ReaderErrorMessages/KeyError","Invalid key. Set to default."),this.musicSheet.SheetErrors.pushMeasureError(F),V=0,E.default.debug("InstrumentReader.addAbstractInstruction",F,H)}let P=p.KeyEnum.none,U=T.element("key");if(U&&(U=U.element("mode")),U)try{P=p.KeyEnum[U.value]}catch(H){F=h.ITextTranslation.translateText("ReaderErrorMessages/KeyError","Invalid key/mode. Set to default."),this.musicSheet.SheetErrors.pushMeasureError(F),P=p.KeyEnum.major,E.default.debug("InstrumentReader.addAbstractInstruction",F,H)}const Y=new i.KeyInstruction(void 0,V,P);this.abstractInstructions.push([1,Y,B])}if(T.element("time")){const V=T.element("time");let j=m.RhythmSymbolEnum.NONE,P=!0;if(void 0!==V&&V.hasAttributes){const it=V.attribute("symbol");it&&("common"===it.value?j=m.RhythmSymbolEnum.COMMON:"cut"===it.value&&(j=m.RhythmSymbolEnum.CUT));const nt=V.attribute("print-object");nt&&"no"===nt.value&&(P=!1)}let U=0,Y=0;const H=V&&void 0!==V.element("senza-misura"),Q=T.elements("time"),ot=[],$=[];for(let it=0,nt=Q.length;it<nt;++it){const st=Q[it];ot.push(...st.elements("beats")),$.push(...st.elements("beat-type"))}if(H)this.abstractInstructions.push([1,new o.RhythmInstruction(new n.Fraction(4,4,0,!1),m.RhythmSymbolEnum.NONE),B]);else{try{if(void 0!==ot&&ot.length>0&&void 0!==$&&ot.length===$.length){const nt=ot.length,st=new Array(nt);let N=0;for(let C=0;C<nt;C++){const O=ot[C].value;let X=0,W=0;if(-1!==O.indexOf("+")){const G=O.split("+");for(let K=0,q=G.length;K<q;++K)X+=parseInt(G[K],10)}else X=parseInt(O,10);W=parseInt($[C].value,10),N=Math.max(N,W),st[C]=new n.Fraction(X,W,0,!1)}for(let C=0;C<nt;C++)U+=st[C].Denominator===N?st[C].Numerator:N/st[C].Denominator*st[C].Numerator;Y=N}else U=parseInt(T.element("time").element("beats").value,10),Y=parseInt(T.element("time").element("beat-type").value,10)}catch(nt){F=h.ITextTranslation.translateText("ReaderErrorMessages/RhythmError","Invalid rhythm. Set to default."),this.musicSheet.SheetErrors.pushMeasureError(F),U=4,Y=4,E.default.debug("InstrumentReader.addAbstractInstruction",F,nt)}const it=new o.RhythmInstruction(new n.Fraction(U,Y,0,!1),j);it.PrintObject=P,this.abstractInstructions.push([1,it,B])}}}saveAbstractInstructionList(T,A){for(let v=this.abstractInstructions.length-1;v>=0;v--){const B=this.abstractInstructions[v],D=B[0],L=B[1],F=B[2];if(L instanceof r.ClefInstruction){const V=L;if(0===this.currentXmlMeasureIndex||D<=this.activeClefs.length&&V!==this.activeClefs[D-1])if(A||void 0===this.currentStaffEntry||this.currentStaffEntry.hasNotes()||D-1!==this.instrument.Staves.indexOf(this.currentStaffEntry.ParentStaff))if(A){if(0!==F.RealValue)continue;let j;if(this.currentMeasure){const P=V,U=this.inSourceMeasureInstrumentIndex+D-1,Y=this.currentMeasure.FirstInstructionsStaffEntries[U];if(0===this.currentXmlMeasureIndex)if(Y)if(void 0===this.currentMeasure.FirstInstructionsStaffEntries[U]||Y.Instructions[0]instanceof r.ClefInstruction){const H=new c.SourceStaffEntry(void 0,void 0);this.currentMeasure.LastInstructionsStaffEntries[U]=H,P.Parent=H,H.Instructions.push(P)}else j=Y,P.Parent=j,j.removeFirstInstructionOfTypeClefInstruction(),j.Instructions.splice(0,0,P),this.activeClefsHaveBeenInitialized[D-1]=!0;else j=new c.SourceStaffEntry(void 0,void 0),this.currentMeasure.FirstInstructionsStaffEntries[U]=j,P.Parent=j,j.Instructions.push(P),this.activeClefsHaveBeenInitialized[D-1]=!0;else if(this.activeClefsHaveBeenInitialized[D-1]){let H=this.previousMeasure;this.followingMultirestMeasures>0&&this.currentMeasure.Rules.RenderMultipleRestMeasures&&(H=this.currentMultirestStartMeasure);const Q=new c.SourceStaffEntry(void 0,void 0);H.LastInstructionsStaffEntries[U]=Q,P.Parent=Q,Q.Instructions.push(P)}else{const H=this.musicSheet.SourceMeasures[0];H.FirstInstructionsStaffEntries[U]?(j=H.FirstInstructionsStaffEntries[U],j.removeFirstInstructionOfTypeClefInstruction()):j=new c.SourceStaffEntry(void 0,void 0),P.Parent=j,j.Instructions.splice(0,0,P),this.activeClefsHaveBeenInitialized[D-1]=!0}this.activeClefs[D-1]=V,this.abstractInstructions.splice(v,1)}}else{let j;const P=this.activeRhythm.Rhythm;P.RealValue>0&&F.RealValue/P.RealValue>.9&&P.RealValue!==F.RealValue&&(this.currentMeasure.LastInstructionsStaffEntries[D-1]||(this.currentMeasure.LastInstructionsStaffEntries[D-1]=new c.SourceStaffEntry(void 0,this.instrument.Staves[D-1])),j=this.currentMeasure.LastInstructionsStaffEntries[D-1]),j&&(V.Parent=j,j.Instructions.push(V),this.activeClefs[D-1]=V,this.abstractInstructions.splice(v,1))}else{const j=V,P=this.currentStaffEntry;if(F&&Math.abs(F.RealValue-P.Timestamp.RealValue)>.01)continue;j.Parent=P,P.removeFirstInstructionOfTypeClefInstruction(),P.Instructions.push(j),this.activeClefs[D-1]=V,this.abstractInstructions.splice(v,1)}else D<=this.activeClefs.length&&V===this.activeClefs[D-1]&&this.abstractInstructions.splice(v,1)}if(L instanceof i.KeyInstruction){const V=L;if(this.activeKey&&this.activeKey.Key===V.Key)this.abstractInstructions.splice(v,1);else{let j;if(this.activeKey=V,this.abstractInstructions.splice(v,1),this.activeKeyHasBeenInitialized?j=this.currentMeasure:(this.activeKeyHasBeenInitialized=!0,j=this.currentXmlMeasureIndex>0?this.musicSheet.SourceMeasures[0]:this.currentMeasure),j)for(let P=this.inSourceMeasureInstrumentIndex;P<this.inSourceMeasureInstrumentIndex+T;P++){const U=V;if(j.FirstInstructionsStaffEntries[P]){const Y=j.FirstInstructionsStaffEntries[P];U.Parent=Y,Y.removeFirstInstructionOfTypeKeyInstruction(),0===Y.Instructions.length?Y.Instructions.push(U):Y.Instructions.splice(Y.Instructions[0]instanceof r.ClefInstruction?1:0,0,U)}else{const Y=new c.SourceStaffEntry(void 0,void 0);j.FirstInstructionsStaffEntries[P]=Y,U.Parent=Y,Y.Instructions.push(U)}}}}if(L instanceof o.RhythmInstruction){const V=L;if(this.activeRhythm&&this.activeRhythm===V)this.abstractInstructions.splice(v,1);else if(this.activeRhythm=V,this.abstractInstructions.splice(v,1),this.currentMeasure)for(let j=this.inSourceMeasureInstrumentIndex;j<this.inSourceMeasureInstrumentIndex+T;j++){const P=V;let U;this.currentMeasure.FirstInstructionsStaffEntries[j]?(U=this.currentMeasure.FirstInstructionsStaffEntries[j],U.removeFirstInstructionOfTypeRhythmInstruction()):(U=new c.SourceStaffEntry(void 0,void 0),this.currentMeasure.FirstInstructionsStaffEntries[j]=U),P.Parent=U,U.Instructions.push(P)}}}}saveClefInstructionAtEndOfMeasure(){for(let T=this.abstractInstructions.length-1;T>=0;T--){const A=this.abstractInstructions[T][0],v=this.abstractInstructions[T][1];if(v instanceof r.ClefInstruction){const B=v;if(!this.activeClefs[A-1]||B.ClefType!==this.activeClefs[A-1].ClefType||B.ClefType===this.activeClefs[A-1].ClefType&&B.Line!==this.activeClefs[A-1].Line){const D=new c.SourceStaffEntry(void 0,void 0);this.currentMeasure.LastInstructionsStaffEntries[this.inSourceMeasureInstrumentIndex+A-1]=D;const L=B;L.Parent=D,D.Instructions.push(L),this.activeClefs[A-1]=B,this.abstractInstructions.splice(T,1)}}}}getNoteDurationForTuplet(T){const A=T.element("duration"),v=Number.parseInt(A.value,10);return new n.Fraction(v,4*this.divisions)}readExpressionStaffNumber(T){let A=1;if(T.element("staff")){const v=T.element("staff");if(v)try{A=parseInt(v.value,10)}catch(B){const D=h.ITextTranslation.translateText("ReaderErrorMessages/ExpressionStaffError","Invalid Expression staff number. Set to default.");this.musicSheet.SheetErrors.pushMeasureError(D),A=1,E.default.debug("InstrumentReader.readExpressionStaffNumber",D,B)}}return A}readDivisionsFromNotes(){let T=0,A=this.currentXmlMeasureIndex,v=!1;for(;!v;){const B=this.xmlMeasureList[A].elements();for(let D=0,L=B.length;D<L;++D){const F=B[D];if("note"===F.name&&!F.element("time-modification")){const V=F.element("duration"),j=F.element("type");if(void 0!==V&&j){const P=j.value;let U=0;try{U=parseInt(V.value,10)}catch(Y){E.default.debug("InstrumentReader.readDivisionsFromNotes",Y);continue}switch(P){case"1024th":T=U/4*1024;break;case"512th":T=U/4*512;break;case"256th":T=U/4*256;break;case"128th":T=U/4*128;break;case"64th":T=U/4*64;break;case"32nd":T=U/4*32;break;case"16th":T=U/4*16;break;case"eighth":T=U/4*8;break;case"quarter":T=U/4*4;break;case"half":T=U/4*2;break;case"whole":T=U/4;break;case"breve":T=U/4/2;break;case"long":T=U/4/4;break;case"maxima":T=U/4/8}}}if(T>0){v=!0;break}}if(0===T&&(A++,A===this.xmlMeasureList.length)){const D=h.ITextTranslation.translateText("ReaderErrorMEssages/DivisionsError","Invalid divisions value at Instrument: ");throw new e.MusicSheetReadingException(D+this.instrument.Name)}}return T}getCueNoteAndNoteTypeXml(T){let A=!1;T.element("cue")&&(A=!0);const v=T.element("type");let B=_.NoteType.UNDEFINED;return v&&("cue"===v.attribute("size")?.value&&(A=!0),B=_.NoteTypeHandler.StringToNoteType(v.value)),[A,B]}getStemDirectionType(T){switch(T.value){case"down":return x.StemDirectionType.Down;case"up":return x.StemDirectionType.Up;case"double":return x.StemDirectionType.Double;case"none":return x.StemDirectionType.None;default:return x.StemDirectionType.Undefined}}getNoteHeadColorXml(T){const A=T.element("notehead");if(A){const v=A.attribute("color");if(v)return this.parseXmlColor(v.value)}return null}getNoteColorXml(T){const A=T.attribute("color");return A?this.parseXmlColor(A.value):null}getTremoloInfo(T){let A,v;const B=T.element("tremolo");if(B){const D=B.attribute("type");if(D){if("single"===D.value){const L=parseInt(B.value,10);L>0&&(A=L)}else A=0;"unmeasured"===D.value&&(v=!0)}}return{tremoloStrokes:A,tremoloUnmeasured:v}}getWavyLines(T,A,v,B){const D=T.elements("wavy-line");if(D)for(const L of D){const F=this.expressionReaders[this.readExpressionStaffNumber(A)-1];F&&(F.readExpressionParameters(L,this.instrument,this.divisions,v,B,this.currentMeasure.MeasureNumber,!1),F.addWavyLine(L,this.currentMeasure,v,B))}}getNoteStaff(T){let A=1;return this.instrument.Staves.length>1&&T.element("staff")&&(A=parseInt(T.element("staff").value,10),isNaN(A)&&(E.default.debug("InstrumentReader.readNextXmlMeasure.get staff number"),A=1)),A}}},9099(dt,g,u){"use strict";var l=this&&this.__importDefault||function(T){return T&&T.__esModule?T:{default:T}};Object.defineProperty(g,"__esModule",{value:!0}),g.MusicSheetReader=void 0;const s=u(427),c=u(4387),r=u(2561),i=u(1272),o=u(9252),n=u(9767),h=u(7307),e=l(u(3065)),f=u(9288),m=u(9288),p=u(2369),E=u(7586),y=u(5294),d=u(164),S=u(7435),M=u(5749),x=u(9713),_=u(7503),I=u(7533);g.MusicSheetReader=class{constructor(T=void 0,A=new x.EngravingRules){this.completeNumberOfStaves=0,this.pluginManager=new _.ReaderPluginManager,this.afterSheetReadingModules=T||[],this.repetitionInstructionReader=M.MusicSymbolModuleFactory.createRepetitionInstructionReader(),this.repetitionCalculator=M.MusicSymbolModuleFactory.createRepetitionCalculator(),this.rules=A}get PluginManager(){return this.pluginManager}get CompleteNumberOfStaves(){return this.completeNumberOfStaves}static doCalculationsAfterDurationHasBeenSet(T){for(const A of T)A.doCalculationsAfterDurationHasBeenSet()}createMusicSheet(T,A){try{return this._createMusicSheet(T,A)}catch(v){return void e.default.error("MusicSheetReader.CreateMusicSheet",v)}}_removeFromArray(T,A){const v=T.indexOf(A);-1!==v&&T.splice(v,1)}trimString(T){return T.replace(/^\s+|\s+$/g,"")}_lastElement(T){return T[T.length-1]}_createMusicSheet(T,A){const v=[];let B=0;this.musicSheet=new s.MusicSheet,this.musicSheet.Path=A,this.musicSheet.Rules=this.rules;const D=T.attribute("osmdMeasureWidthFactor");if(D){const Y=Number.parseFloat(D.value);"number"!=typeof Y||isNaN(Y)?e.default.info("xml parse: osmdMeasureWidthFactor invalid"):this.musicSheet.MeasureWidthFactor=Y}if(!T)throw new h.MusicSheetReadingException("Undefined root element");this.pushSheetLabels(T,A);const L=T.element("part-list");if(!L)throw new h.MusicSheetReadingException("Undefined partListNode");const F=T.elements("part"),V=L.elements();this.initializeReading(V,F,v);let j=!0;this.currentFraction=new r.Fraction(0,1);let P=!1,U=T.element("identification");for(U&&(U=U.element("encoding")),U&&(U=U.element("software")),void 0!==U&&"Guitar Pro 5"===U.value&&(P=!0);j;){void 0!==this.currentMeasure&&this.currentMeasure.HasEndLine&&this.rules.NewPartAndSystemAfterFinalBarline&&(B=0),this.currentMeasure=new c.SourceMeasure(this.completeNumberOfStaves,this.musicSheet.Rules);for(const Y of v)try{j=j&&Y.readNextXmlMeasure(this.currentMeasure,this.currentFraction,P)}catch(H){const Q=n.ITextTranslation.translateText("ReaderErrorMessages/InstrumentError","Error while reading instruments.");throw new h.MusicSheetReadingException(Q,H)}j&&(this.musicSheet.addMeasure(this.currentMeasure),this.checkIfRhythmInstructionsAreSetAndEqual(v),this.checkSourceMeasureForNullEntries(),B=this.setSourceMeasureDuration(v,B),this.currentMeasure.AbsoluteTimestamp=this.currentFraction.clone(),this.musicSheet.SheetErrors.finalizeMeasure(this.currentMeasure.MeasureNumber),this.currentFraction.Add(this.currentMeasure.Duration),this.previousMeasure=this.currentMeasure)}this.repetitionInstructionReader&&(this.repetitionInstructionReader.removeRedundantInstructions(),this.repetitionCalculator&&this.repetitionCalculator.calculateRepetitions(this.musicSheet,this.repetitionInstructionReader.repetitionInstructions)),this.musicSheet.checkForInstrumentWithNoVoice(),this.musicSheet.fillStaffList();for(let Y=0,H=this.afterSheetReadingModules.length;Y<H;++Y)this.afterSheetReadingModules[Y].calculate(this.musicSheet);return this.musicSheet.userStartTempoInBPM=this.musicSheet.userStartTempoInBPM||this.musicSheet.DefaultStartTempoInBpm,this.musicSheet}initializeReading(T,A,v){const B=this.createInstrumentGroups(T);this.completeNumberOfStaves=this.getCompleteNumberOfStavesFromXml(A),0!==A.length&&(this.repetitionInstructionReader.MusicSheet=this.musicSheet,this.currentFraction=new r.Fraction(0,1),this.currentMeasure=void 0,this.previousMeasure=void 0);let D=0;for(const L of A){const F=L.attribute("id");if(F){const V=B[F.value],j=L.elements("measure");let P=1;try{P=this.getInstrumentNumberOfStavesFromXml(L)}catch{const Y=n.ITextTranslation.translateText("ReaderErrorMessages/InstrumentStavesNumberError","Invalid number of staves at instrument: ");this.musicSheet.SheetErrors.push(Y+V.Name);continue}V.createStaves(P),v.push(new i.InstrumentReader(this.pluginManager,this.repetitionInstructionReader,j,V)),this.repetitionInstructionReader&&(this.repetitionInstructionReader.xmlMeasureList[D]=j),D++}}}checkIfRhythmInstructionsAreSetAndEqual(T){const A=[];for(let D=0;D<this.completeNumberOfStaves;D++)if(this.currentMeasure.FirstInstructionsStaffEntries[D]){const L=this.currentMeasure.FirstInstructionsStaffEntries[D].Instructions[this.currentMeasure.FirstInstructionsStaffEntries[D].Instructions.length-1];L instanceof f.RhythmInstruction&&A.push(L)}let v=0,B=-1;for(let D=0,L=A.length;D<L;++D){const F=A[D];if(F.Rhythm.RealValue>v){if(this.areRhythmInstructionsMixed(A)&&F.SymbolEnum!==m.RhythmSymbolEnum.NONE)continue;v=F.Rhythm.RealValue,B=A.indexOf(F)}}if(A.length>0&&A.length<this.completeNumberOfStaves){const D=A[B].clone();for(let L=0;L<this.completeNumberOfStaves;L++)void 0===this.currentMeasure.FirstInstructionsStaffEntries[L]||this._lastElement(this.currentMeasure.FirstInstructionsStaffEntries[L].Instructions)instanceof f.RhythmInstruction||(this.currentMeasure.FirstInstructionsStaffEntries[L].removeAllInstructionsOfTypeRhythmInstruction(),this.currentMeasure.FirstInstructionsStaffEntries[L].Instructions.push(D.clone())),this.currentMeasure.FirstInstructionsStaffEntries[L]||(this.currentMeasure.FirstInstructionsStaffEntries[L]=new p.SourceStaffEntry(void 0,void 0),this.currentMeasure.FirstInstructionsStaffEntries[L].Instructions.push(D.clone()));for(let L=0,F=T.length;L<F;++L)T[L].ActiveRhythm=D}if(0===A.length&&this.currentMeasure===this.musicSheet.SourceMeasures[0]){const D=new f.RhythmInstruction(new r.Fraction(4,4,0,!1),m.RhythmSymbolEnum.NONE);for(let L=0;L<this.completeNumberOfStaves;L++)this.currentMeasure.FirstInstructionsStaffEntries[L]?this.currentMeasure.FirstInstructionsStaffEntries[L].removeAllInstructionsOfTypeRhythmInstruction():this.currentMeasure.FirstInstructionsStaffEntries[L]=new p.SourceStaffEntry(void 0,void 0),this.currentMeasure.FirstInstructionsStaffEntries[L].Instructions.push(D);for(let L=0,F=T.length;L<F;++L)T[L].ActiveRhythm=D}for(let D=0,L=A.length;D<L;++D){const F=A[D];if(F.Rhythm.RealValue<v&&this._lastElement(this.currentMeasure.FirstInstructionsStaffEntries[A.indexOf(F)].Instructions)instanceof f.RhythmInstruction){const V=this.currentMeasure.FirstInstructionsStaffEntries[A.indexOf(F)].Instructions;V[V.length-1]=A[B].clone()}Math.abs(F.Rhythm.RealValue-v)<1e-6&&F.SymbolEnum!==m.RhythmSymbolEnum.NONE&&this.areRhythmInstructionsMixed(A)&&(F.SymbolEnum=m.RhythmSymbolEnum.NONE)}}areRhythmInstructionsMixed(T){for(let A=1;A<T.length;A++)if(Math.abs(T[A].Rhythm.RealValue-T[0].Rhythm.RealValue)<1e-6&&T[A].SymbolEnum!==T[0].SymbolEnum)return!0;return!1}setSourceMeasureDuration(T,A){let v=new r.Fraction(0,1);const B=[];for(const F of T){B.push(F.MaxTieNoteFraction);const V=F.ActiveRhythm.Rhythm;v.lt(V)&&(v=new r.Fraction(V.Numerator,V.Denominator,0,!1))}const D=this.currentMeasure.calculateInstrumentsDuration(this.musicSheet,B);let L=new r.Fraction(0,1);for(const F of D)L.lt(F)&&(L=F);r.Fraction.Equal(L,v)?this.checkFractionsForEquivalence(L,v):L.lt(v)&&(L=this.currentMeasure.reverseCheck(this.musicSheet,L),this.checkFractionsForEquivalence(L,v)),this.currentMeasure.ImplicitMeasure=this.checkIfMeasureIsImplicit(L,v),(!this.currentMeasure.ImplicitMeasure||A>0)&&A++,this.currentMeasure.Duration=L,this.currentMeasure.ActiveTimeSignature=v,this.currentMeasure.MeasureNumber=A;for(let F=0;F<D.length;F++){const V=D[F];if(this.currentMeasure.ImplicitMeasure&&V!==L||!r.Fraction.Equal(V,v)&&!this.allInstrumentsHaveSameDuration(D,L)){const j=this.musicSheet.getGlobalStaffIndexOfFirstStaff(this.musicSheet.Instruments[F]);for(let P=0;P<this.musicSheet.Instruments[F].Staves.length;P++)if(!this.graphicalMeasureIsEmpty(j+P)){this.currentMeasure.setErrorInGraphicalMeasure(j+P,!0);const U=n.ITextTranslation.translateText("ReaderErrorMessages/MissingNotesError","Given Notes don't correspond to measure duration.");this.musicSheet.SheetErrors.pushMeasureError(U)}}}return A}checkFractionsForEquivalence(T,A){A.Denominator>T.Denominator&&T.expand(A.Denominator/T.Denominator)}checkIfMeasureIsImplicit(T,A){return!(this.previousMeasure||!T.lt(A))||!!this.previousMeasure&&r.Fraction.plus(this.previousMeasure.Duration,T).Equals(A)}allInstrumentsHaveSameDuration(T,A){let v=0;for(let B=0,D=T.length;B<D;++B)T[B].Equals(A)&&v++;return v===T.length&&A!==new r.Fraction(0,1)}graphicalMeasureIsEmpty(T){let A=0;for(let v=0;v<this.currentMeasure.VerticalSourceStaffEntryContainers.length;v++)this.currentMeasure.VerticalSourceStaffEntryContainers[v].StaffEntries[T]||A++;return A===this.currentMeasure.VerticalSourceStaffEntryContainers.length}checkSourceMeasureForNullEntries(){for(let T=this.currentMeasure.VerticalSourceStaffEntryContainers.length-1;T>=0;T--)for(let A=this.currentMeasure.VerticalSourceStaffEntryContainers[T].StaffEntries.length-1;A>=0;A--){const v=this.currentMeasure.VerticalSourceStaffEntryContainers[T].StaffEntries[A];if(v)for(let B=v.VoiceEntries.length-1;B>=0;B--){const D=v.VoiceEntries[B];0===D.Notes.length&&(this._removeFromArray(D.ParentVoice.VoiceEntries,D),this._removeFromArray(v.VoiceEntries,D))}void 0!==v&&0===v.VoiceEntries.length&&0===v.ChordContainers.length&&(this.currentMeasure.VerticalSourceStaffEntryContainers[T].StaffEntries[A]=void 0)}for(let T=this.currentMeasure.VerticalSourceStaffEntryContainers.length-1;T>=0;T--){let A=0;for(let v=0,B=this.currentMeasure.VerticalSourceStaffEntryContainers[T].StaffEntries.length;v<B;++v)this.currentMeasure.VerticalSourceStaffEntryContainers[T].StaffEntries[v]||A++;A===this.currentMeasure.VerticalSourceStaffEntryContainers[T].StaffEntries.length&&this._removeFromArray(this.currentMeasure.VerticalSourceStaffEntryContainers,this.currentMeasure.VerticalSourceStaffEntryContainers[T])}}pushSheetLabels(T,A){this.readComposer(T),this.readTitle(T),this.readCopyright(T);try{this.musicSheet.Title&&this.musicSheet.Composer&&this.musicSheet.Subtitle||this.readTitleAndComposerFromCredits(T)}catch(v){e.default.info("MusicSheetReader.pushSheetLabels","readTitleAndComposerFromCredits",v)}try{if(!this.musicSheet.Title){const v=Math.max(0,A.lastIndexOf("/"),A.lastIndexOf("\\")),B=A.substr(v).split(".",1);this.musicSheet.Title=new S.Label(B[0])}}catch(v){e.default.info("MusicSheetReader.pushSheetLabels","read title from file name",v)}}presentAttrsWithValue(T,A){for(const v of T.attributes())if(v.value===A)return!0;return!1}readComposer(T){const A=T.element("identification");if(A){const v=A.elements("creator");for(let B=0,D=v.length;B<D;++B){const L=v[B];if(L.hasAttributes){if(this.presentAttrsWithValue(L,"composer")){this.musicSheet.Composer=new S.Label(this.trimString(L.value));continue}(this.presentAttrsWithValue(L,"lyricist")||this.presentAttrsWithValue(L,"poet"))&&(this.musicSheet.Lyricist=new S.Label(this.trimString(L.value)))}}}}readCopyright(T){const A=T.elements("identification");if(A.length>0){const v=A[0].elements("rights");if(v.length>0)for(let B=0,D=v.length;B<D;++B){const L=v[B];if(L.value){this.musicSheet.Copyright=new S.Label(L.value,I.TextAlignmentEnum.CenterBottom,void 0,!0);break}}}}readTitleAndComposerFromCredits(T){if(this.rules.SheetComposerSubtitleUseLegacyParsing)return void this.readTitleAndComposerFromCreditsLegacy(T);const A=this.computeSystemYCoordinates(T);if(0===A)return;let v,B,D;const L=T.elements("credit");for(let F=0,V=L.length;F<V;++F){const j=L[F];if(!j.attribute("page"))return;if("1"===j.attribute("page").value){let P;if(j){let U=!1,Y=!1;const H=j.element("credit-type");"subtitle"===H?.value?U=!0:"composer"===H?.value&&(Y=!0);let Q=U||Y;P=j.elements("credit-words");for(const ot of P){const $=ot.value?.trim();if("Copyright \xa9"===$)continue;const it=ot.attribute("justify")?.value;"right"===it?(Y=!0,Q=!0):"center"===it&&v&&(U=!0,Q=!0);const nt=ot.attribute("default-y")?.value,st=null!=nt,N=st?parseFloat(nt):Number.MIN_VALUE;if(st&&N>A||Q)if(v||Q){if(Y||"right"===it)D?D+="\n"+$:D=$;else if(U||"right"!==it&&"left"!==it)B?B+="\n"+$:B=$;else if("left"===it){this.musicSheet.Lyricist||(this.musicSheet.Lyricist=new S.Label($));break}}else v=$}}}}if(!this.musicSheet.Title&&v&&(this.musicSheet.Title=new S.Label(this.trimString(v))),!this.musicSheet.Subtitle&&B&&(this.musicSheet.Subtitle=new S.Label(this.trimString(B))),D){let F=!1;this.musicSheet.Composer?(D.match("\n")??[]).length+1>=(this.musicSheet.Composer.text.match("\n")??[]).length+1&&(F=!0):F=!0,F&&(this.musicSheet.Composer=new S.Label(this.trimString(D)))}}readTitleAndComposerFromCreditsLegacy(T){const A=this.computeSystemYCoordinates(T);if(0===A)return;let v,B,D,L=1,F=0;const V=T.elements("credit");for(let j=0,P=V.length;j<P;++j){const U=V[j];if(!U.attribute("page"))return;if("1"===U.attribute("page").value){let Y;if(U){if(Y=U.element("credit-words"),!Y.attribute("justify"))break;const H=Y.attribute("justify")?.value,Q=Y.attribute("default-y")?.value,ot=null!=Q,$=ot?parseFloat(Q):Number.MIN_VALUE;let it=!1;if("subtitle"===U.element("credit-type")?.value&&(it=!0),ot&&$>A||it){if(!this.musicSheet.Title&&!it){const st=Y.attribute("font-size")?.value;if(st){const N=parseFloat(st);L<N&&(L=N,v=Y.value)}}switch(this.musicSheet.Subtitle||("right"!==H&&"left"!==H||it)&&(F<$?(F=$,D&&(B=D),D=Y.value):B?B+="\n"+Y.value:B=Y.value),H){case"right":this.musicSheet.Composer||(this.musicSheet.Composer=new S.Label(this.trimString(Y.value)));break;case"left":this.musicSheet.Lyricist||(this.musicSheet.Lyricist=new S.Label(this.trimString(Y.value)))}}}}}!this.musicSheet.Title&&v&&(this.musicSheet.Title=new S.Label(this.trimString(v))),!this.musicSheet.Subtitle&&B&&(this.musicSheet.Subtitle=new S.Label(this.trimString(B)))}computeSystemYCoordinates(T){if(!T.element("defaults"))return 0;let A=0,v=0;try{const L=T.element("defaults")?.element("page-layout")?.element("page-height").value??"0";A=parseFloat(L)}catch{return e.default.info("MusicSheetReader.computeSystemYCoordinates(): couldn't find page height, not reading title/composer."),0}let B=!1;const D=T.elements("part");for(let L=0,F=D.length;L<F;++L){const V=D[L].elements("measure");for(let j=0,P=V.length;j<P;++j){const U=V[j];if(U.element("print")){const Y=U.element("print").elements("system-layout");for(let H=0,Q=Y.length;H<Q;++H){const ot=Y[H];if(ot.element("top-system-distance")){const $=ot.element("top-system-distance").value;v=parseFloat($),B=!0;break}}break}}if(B)break}if(T.element("defaults").element("system-layout")&&T.element("defaults").element("system-layout").element("top-system-distance")){const L=T.element("defaults").element("system-layout").element("top-system-distance").value;v=parseFloat(L)}return 0===v?0:A-v}readTitle(T){const A=T.element("work");let v;A&&(v=A.element("work-title"),v&&v.value&&(this.musicSheet.Title=new S.Label(this.trimString(v.value))));const B=T.element("movement-title");let D="";if(B&&(this.musicSheet.Title?D=this.trimString(B.value):this.musicSheet.Title=new S.Label(this.trimString(B.value))),A){const L=A.element("work-number");if(L){const F=L.value;F&&(D=""===D?F:D+", "+F)}}D&&(this.musicSheet.Subtitle=new S.Label(D))}createInstrumentGroups(T){let A=0;const v={};let B;try{const D=T;for(let L=0,F=D.length;L<F;++L){const V=D[L];if("score-part"===V.name){const j=V.attribute("id").value,P=new o.Instrument(A,j,this.musicSheet,B);A++;const U=V.elements();for(let Y=0,H=U.length;Y<H;++Y){const Q=U[Y];try{if("part-name"===Q.name)P.Name=Q.value,Q.attribute("print-object")&&"no"===Q.attribute("print-object").value&&(P.NameLabel.print=!1);else if("part-abbreviation"===Q.name)P.PartAbbreviation=Q.value;else if("score-instrument"===Q.name){const ot=new y.SubInstrument(P);ot.idString=Q.firstAttribute.value,P.SubInstruments.push(ot);const $=Q.element("instrument-name");$&&(ot.name=$.value,ot.setMidiInstrument($.value))}else if("midi-instrument"===Q.name){let ot=P.getSubInstrument(Q.firstAttribute.value);for(let it=0,nt=P.SubInstruments.length;it<nt;++it){const st=P.SubInstruments[it];if(st.idString===Q.value){ot=st;break}}const $=Q.elements();for(let it=0,nt=$.length;it<nt;++it){const st=$[it];try{if("midi-channel"===st.name)10===parseInt(st.value,10)&&(P.MidiInstrumentId=d.MidiInstrument.Percussion);else if("midi-program"===st.name)P.SubInstruments.length>0&&P.MidiInstrumentId!==d.MidiInstrument.Percussion&&(ot.midiInstrumentID=Math.max(0,parseInt(st.value,10)-1));else if("midi-unpitched"===st.name)ot.fixedKey=Math.max(0,parseInt(st.value,10));else if("volume"===st.name)try{const N=parseFloat(st.value);ot.volume=N/127}catch(N){e.default.debug("ExpressionReader.readExpressionParameters","read volume",N)}else if("pan"===st.name)try{const N=parseFloat(st.value);ot.pan=N/64}catch(N){e.default.debug("ExpressionReader.readExpressionParameters","read pan",N)}}catch(N){e.default.info("MusicSheetReader.createInstrumentGroups midi settings: ",N)}}}}catch(ot){e.default.info("MusicSheetReader.createInstrumentGroups: ",ot)}}if(0===P.SubInstruments.length){const Y=new y.SubInstrument(P);P.SubInstruments.push(Y)}v[j]=P,B?(B.InstrumentalGroups.push(P),this.musicSheet.Instruments.push(P)):(this.musicSheet.InstrumentalGroups.push(P),this.musicSheet.Instruments.push(P))}else if("part-group"===V.name&&"start"===V.attribute("type").value){const j=new E.InstrumentalGroup("group",this.musicSheet,B);B?B.InstrumentalGroups.push(j):this.musicSheet.InstrumentalGroups.push(j),B=j}else if("part-group"===V.name&&"stop"===V.attribute("type").value&&B){if(1===B.InstrumentalGroups.length){const j=B.InstrumentalGroups[0];B.Parent?(B.Parent.InstrumentalGroups.push(j),this._removeFromArray(B.Parent.InstrumentalGroups,B)):(this.musicSheet.InstrumentalGroups.push(j),this._removeFromArray(this.musicSheet.InstrumentalGroups,B))}B=B.Parent}}}catch(D){const L=n.ITextTranslation.translateText("ReaderErrorMessages/InstrumentError","Error while reading Instruments");throw new h.MusicSheetReadingException(L,D)}for(let D=0,L=this.musicSheet.Instruments.length;D<L;++D){const F=this.musicSheet.Instruments[D];F.Name||(F.Name="Instr. "+F.IdString)}return v}getCompleteNumberOfStavesFromXml(T){let A=0;for(const v of T){const B=v.elements("measure");if(B.length>0){const D=B[0];if(D){let L=D.element("attributes");L&&(L=L.element("staves")),L?A+=parseInt(L.value,10):A++}}}if(isNaN(A)||A<=0){const v=n.ITextTranslation.translateText("ReaderErrorMessages/StaffError","Invalid number of staves.");throw new h.MusicSheetReadingException(v)}return A}getInstrumentNumberOfStavesFromXml(T){let A=0;const v=T.element("measure");if(v){const B=v.element("attributes");let D;B&&(D=B.element("staves")),A=B&&D?parseInt(D.value,10):1}if(isNaN(A)||A<=0){const B=n.ITextTranslation.translateText("ReaderErrorMessages/StaffError","Invalid number of Staves.");throw new h.MusicSheetReadingException(B)}return A}}},5749(dt,g,u){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.MusicSymbolModuleFactory=void 0;const l=u(7631),s=u(6302);g.MusicSymbolModuleFactory=class{static createRepetitionInstructionReader(){return new l.RepetitionInstructionReader}static createRepetitionCalculator(){return new s.RepetitionCalculator}}},4127(dt,g,u){"use strict";var l=this&&this.__importDefault||function(m){return m&&m.__esModule?m:{default:m}};Object.defineProperty(g,"__esModule",{value:!0}),g.ArticulationReader=void 0;const s=u(1336),c=l(u(3065)),r=u(3123),i=u(8215),o=u(6362),n=u(8233),h=u(9003),e=u(9019),f=u(8045);g.ArticulationReader=class{constructor(m){this.rules=m}getAccEnumFromString(m){switch(m){case"sharp":return n.AccidentalEnum.SHARP;case"flat":return n.AccidentalEnum.FLAT;case"natural":return n.AccidentalEnum.NATURAL;case"double-sharp":case"sharp-sharp":return n.AccidentalEnum.DOUBLESHARP;case"double-flat":case"flat-flat":return n.AccidentalEnum.DOUBLEFLAT;case"triple-sharp":return n.AccidentalEnum.TRIPLESHARP;case"triple-flat":return n.AccidentalEnum.TRIPLEFLAT;case"quarter-sharp":return n.AccidentalEnum.QUARTERTONESHARP;case"quarter-flat":return n.AccidentalEnum.QUARTERTONEFLAT;case"three-quarters-sharp":return n.AccidentalEnum.THREEQUARTERSSHARP;case"three-quarters-flat":return n.AccidentalEnum.THREEQUARTERSFLAT;case"slash-quarter-sharp":return n.AccidentalEnum.SLASHQUARTERSHARP;case"slash-sharp":return n.AccidentalEnum.SLASHSHARP;case"double-slash-flat":return n.AccidentalEnum.DOUBLESLASHFLAT;case"sori":return n.AccidentalEnum.SORI;case"koron":return n.AccidentalEnum.KORON;default:return n.AccidentalEnum.NONE}}addArticulationExpression(m,p){if(void 0!==m&&m.elements().length>0){const E=m.elements();for(let y=0,d=E.length;y<d;++y){const S=E[y];let M=S.name;try{M=M.replace("-","");const x=s.ArticulationEnum[M];if(s.VoiceEntry.isSupportedArticulation(x)){let _=o.PlacementEnum.NotYetDefined;const I=S.attribute("placement")?.value;"above"===I?_=o.PlacementEnum.Above:"below"===I&&(_=o.PlacementEnum.Below);const T=new h.Articulation(x,_);if("staccato"===M)p.Articulations.length>0&&p.Articulations[0].articulationEnum!==s.ArticulationEnum.staccato&&p.Articulations.splice(0,0,T);else if("breathmark"===M)_===o.PlacementEnum.NotYetDefined&&(T.placement=o.PlacementEnum.Above);else if("strongaccent"===M){const A=S?.attribute("type")?.value;"up"===A?T.articulationEnum=s.ArticulationEnum.marcatoup:"down"===A&&(T.articulationEnum=s.ArticulationEnum.marcatodown)}else if(x===s.ArticulationEnum.softaccent){const A=p.ParentSourceStaffEntry.ParentStaff.Id-1;_===o.PlacementEnum.NotYetDefined&&(_=o.PlacementEnum.Above,A>0&&(_=o.PlacementEnum.Below));const v=p.ParentSourceStaffEntry.VerticalContainerParent.ParentMeasure,B=new e.MultiExpression(v,p.Timestamp);B.StartingContinuousDynamic=new f.ContinuousDynamicExpression(f.ContDynamicEnum.crescendo,_,A,v,-1),B.StartingContinuousDynamic.IsStartOfSoftAccent=!0,B.StartingContinuousDynamic.StartMultiExpression=B,B.StartingContinuousDynamic.EndMultiExpression=B,B.EndingContinuousDynamic=new f.ContinuousDynamicExpression(f.ContDynamicEnum.diminuendo,_,A,v,-1),B.EndingContinuousDynamic.StartMultiExpression=B,B.EndingContinuousDynamic.EndMultiExpression=B,v.StaffLinkedExpressions[A].push(B)}p.hasArticulation(T)||p.Articulations.push(T)}}catch(x){return void c.default.debug("addArticulationExpression","Invalid note articulation.",x)}}}}addFermata(m,p){let E=s.ArticulationEnum.fermata;m.attributes().length>0&&m.attribute("type")&&"inverted"===m.attribute("type").value&&(E=s.ArticulationEnum.invertedfermata);let y=o.PlacementEnum.Above;"below"===m.attribute("placement")?.value&&(y=o.PlacementEnum.Below),p.Articulations.push(new h.Articulation(E,y))}addTechnicalArticulations(m,p,E){const y={bend:s.ArticulationEnum.bend,"down-bow":s.ArticulationEnum.downbow,"open-string":s.ArticulationEnum.naturalharmonic,"snap-pizzicato":s.ArticulationEnum.snappizzicato,stopped:s.ArticulationEnum.lefthandpizzicato,"up-bow":s.ArticulationEnum.upbow,harmonic:s.ArticulationEnum.naturalharmonic};for(const M in y){if(!y.hasOwnProperty(M))continue;const x=y[M],_=m.element(M);if(_){let I;"above"===_.attribute("placement")?.value&&(I=o.PlacementEnum.Above),"below"===_.attribute("placement")?.value&&(I=o.PlacementEnum.Below);const T=new h.Articulation(x,I);p.hasArticulation(T)||p.Articulations.push(T)}}const d=m.elements("fingering");for(const M of d){const x=this.createTechnicalInstruction(M,E);x.type=r.TechnicalInstructionType.Fingering,E.Fingering||(E.Fingering=x),p.TechnicalInstructions.push(x)}const S=m.element("string");if(S){const M=this.createTechnicalInstruction(S,E);M.type=r.TechnicalInstructionType.String,E.StringInstruction=M,p.TechnicalInstructions.push(M)}}createTechnicalInstruction(m,p){const E=new r.TechnicalInstruction;E.sourceNote=p,E.value=m.value;const y=m.attribute("placement");return this.rules.FingeringPositionFromXML&&(E.placement=this.getPlacement(y)),E}getPlacement(m,p=o.PlacementEnum.NotYetDefined){if(p!==o.PlacementEnum.NotYetDefined)return p;if(!m)return o.PlacementEnum.NotYetDefined;switch(m.value){case"above":return o.PlacementEnum.Above;case"below":return o.PlacementEnum.Below;case"left":return o.PlacementEnum.Left;case"right":return o.PlacementEnum.Right;default:return o.PlacementEnum.NotYetDefined}}addOrnament(m,p){if(m){let E;const y={"delayed-inverted-turn":i.OrnamentEnum.DelayedInvertedTurn,"delayed-turn":i.OrnamentEnum.DelayedTurn,"inverted-mordent":i.OrnamentEnum.InvertedMordent,"inverted-turn":i.OrnamentEnum.InvertedTurn,mordent:i.OrnamentEnum.Mordent,"trill-mark":i.OrnamentEnum.Trill,turn:i.OrnamentEnum.Turn};for(const d in y){if(!y.hasOwnProperty(d))continue;const S=m.element(d);if(S){E=new i.OrnamentContainer(y[d]);const M=S.attribute("placement");M&&"below"===M.value&&(E.placement=o.PlacementEnum.Below)}}if(E){const d=m.elements("accidental-mark");if(d){let S=o.PlacementEnum.Below,M=n.AccidentalEnum.NONE;const x=d;for(let _=0,I=x.length;_<I;++_){const T=x[_];let A=T.value;M=this.getAccEnumFromString(A);const v=T.attribute("placement");T.hasAttributes&&v&&(A=v.value,"above"===A?S=o.PlacementEnum.Above:"below"===A&&(S=o.PlacementEnum.Below)),S===o.PlacementEnum.Above?E.AccidentalAbove=M:S===o.PlacementEnum.Below&&(E.AccidentalBelow=M)}}p.OrnamentContainer=E}}}}},9536(dt,g,u){"use strict";var l=this&&this.__importDefault||function(h){return h&&h.__esModule?h:{default:h}};Object.defineProperty(g,"__esModule",{value:!0}),g.ChordSymbolReader=void 0;const s=u(9719),c=u(8233),r=u(9767),i=l(u(3065)),o=u(6362);class n{static readChordSymbol(e,f,m){const p=e.element("root"),E=e.element("kind"),y=e.element("numeral"),d=E.attribute("text");if(!p&&!y)return;let S;const M=e.element("bass");if(M){const V=M.element("bass-step"),j=M.element("bass-alter");let P=c.NoteEnum.C;if(V)try{P=c.NoteEnum[V.value.trim()]}catch(Y){const H=r.ITextTranslation.translateText("ReaderErrorMessages/ChordSymbolError","Invalid chord symbol");return f.SheetErrors.pushMeasureError(H),void i.default.debug("InstrumentReader.readChordSymbol",H,Y)}let U=c.AccidentalEnum.NONE;if(j)try{U=c.Pitch.AccidentalFromHalfTones(parseInt(j.value,10))}catch(Y){const H=r.ITextTranslation.translateText("ReaderErrorMessages/ChordSymbolError","Invalid chord symbol");f.SheetErrors.pushMeasureError(H),i.default.debug("InstrumentReader.readChordSymbol",H,Y)}S=new c.Pitch(P,1,U)}const x=[],_=e.elements("degree");for(const V of _)if(V){const j=V.element("degree-value"),P=V.element("degree-alter"),U=V.element("degree-type");if(!j||!P||!U)return;let Y,H,Q;try{Y=parseInt(j.value.trim(),10)}catch(ot){const $=r.ITextTranslation.translateText("ReaderErrorMessages/ChordSymbolError","Invalid chord symbol");return f.SheetErrors.pushMeasureError($),void i.default.debug("InstrumentReader.readChordSymbol",$,ot)}try{H=c.Pitch.AccidentalFromHalfTones(parseInt(P.value,10))}catch(ot){const $=r.ITextTranslation.translateText("ReaderErrorMessages/ChordSymbolError","Invalid chord symbol");return f.SheetErrors.pushMeasureError($),void i.default.debug("InstrumentReader.readChordSymbol",$,ot)}try{Q=s.ChordDegreeText[U.value.trim().toLowerCase()]}catch(ot){const $=r.ITextTranslation.translateText("ReaderErrorMessages/ChordSymbolError","Invalid chord symbol");return f.SheetErrors.pushMeasureError($),void i.default.debug("InstrumentReader.readChordSymbol",$,ot)}x.push(new s.Degree(Y,H,Q))}let I=n.readPlacement(e);if(I!==o.PlacementEnum.Below&&(I=o.PlacementEnum.Above),y){const V=y.element("numeral-root"),j=V?.attribute("text")?.value,P=j??V?.value,U=new s.ChordSymbolContainer(void 0,s.ChordSymbolEnum.none,S,x,f.Rules,I);return U.NumeralText=P,U}const T=p.element("root-step"),A=p.element("root-alter");if(p&&!T)return;let v;try{v=c.NoteEnum[T.value.trim()]}catch(V){const j=r.ITextTranslation.translateText("ReaderErrorMessages/ChordSymbolError","Invalid chord symbol");return f.SheetErrors.pushMeasureError(j),void i.default.debug("InstrumentReader.readChordSymbol",j,V)}let B=c.AccidentalEnum.NONE;if(A)try{B=c.Pitch.AccidentalFromHalfTones(parseInt(A.value,10))}catch(V){const j=r.ITextTranslation.translateText("ReaderErrorMessages/ChordSymbolError","Invalid chord symbol");f.SheetErrors.pushMeasureError(j),i.default.debug("InstrumentReader.readChordSymbol",j,V)}const D=new c.Pitch(v,1,B);let L,F=E.value.trim().replace("-","");if(d)switch(d.value){case"aug":F="augmented";break;case"dim":F="diminished"}try{L=s.ChordSymbolEnum[F]}catch(V){const j=r.ITextTranslation.translateText("ReaderErrorMessages/ChordSymbolError","Invalid chord symbol");return f.SheetErrors.pushMeasureError(j),void i.default.debug("InstrumentReader.readChordSymbol",j,V)}return new s.ChordSymbolContainer(D,L,S,x,f.Rules,I)}static readPlacement(e){const f=e.attribute("placement")?.value;return"above"===f?o.PlacementEnum.Above:"below"===f?o.PlacementEnum.Below:o.PlacementEnum.NotYetDefined}}g.ChordSymbolReader=n},5984(dt,g,u){"use strict";var l=this&&this.__importDefault||function(I){return I&&I.__esModule?I:{default:I}};Object.defineProperty(g,"__esModule",{value:!0}),g.ExpressionReader=void 0;const s=u(2561),c=u(5332),r=u(5875),i=u(2221),o=u(2148),n=u(437),h=u(9019),e=u(9161),f=u(9803),m=u(1112),p=u(6362),E=u(7533),y=u(9767),d=l(u(3065)),S=u(2570),M=u(9157),x=u(3253),_=u(6206);g.ExpressionReader=class{constructor(I,T,A){this.openContinuousDynamicExpressions=[],this.openOctaveShifts=new Map,this.pendingOctaveShiftStops=new Map,this.musicSheet=I,this.staffNumber=A,this.globalStaffIndex=I.getGlobalStaffIndexOfFirstStaff(T)+(A-1),this.initialize()}readExpressionParameters(I,T,A,v,B,D,L){this.initialize(),this.divisions=A;const F=I.element("offset");if(void 0!==F&&!L)try{this.offsetDivisions=parseInt(F.value,10)}catch(U){const Y="ReaderErrorMessages/ExpressionOffsetError, Invalid expression offset -> set to default.";d.default.debug("ExpressionReader.readExpressionParameters",Y,U),this.musicSheet.SheetErrors.pushMeasureError(Y),this.offsetDivisions=0}this.directionTimestamp=s.Fraction.createFromFraction(v);let V=new s.Fraction(Math.abs(this.offsetDivisions),4*A);this.offsetDivisions>0?v.RealValue>0?(V=s.Fraction.multiply(s.Fraction.minus(v,B),V),this.directionTimestamp=s.Fraction.plus(V,v)):this.directionTimestamp=s.Fraction.createFromFraction(V):this.offsetDivisions<0&&(v.RealValue>0?(V=s.Fraction.multiply(s.Fraction.minus(v,B),V),this.directionTimestamp=s.Fraction.minus(v,V)):this.directionTimestamp=s.Fraction.createFromFraction(V));const j=I.elements("direction-type"),P=I.attribute("placement");if(P)try{const U=P.value;"below"===U?this.placement=p.PlacementEnum.Below:"above"===U&&(this.placement=p.PlacementEnum.Above)}catch(U){const Y=y.ITextTranslation.translateText("ReaderErrorMessages/ExpressionPlacementError","Invalid expression placement -> set to default.");d.default.debug("ExpressionReader.readExpressionParameters",Y,U),this.musicSheet.SheetErrors.pushMeasureError(Y),this.placement=p.PlacementEnum.Below}try{for(const U of j){const Y=U.element("wedge");if(Y){const H=Y.attribute("default-y");H&&(this.WedgeYPosXml=parseInt(H.value,10),this.placement===p.PlacementEnum.NotYetDefined&&this.readExpressionPlacement(H,"read wedge y pos"))}if(this.placement===p.PlacementEnum.NotYetDefined){const H=U.element("dynamics");if(H){const $=H.attribute("default-y");$&&this.readExpressionPlacement($,"read dynamics y pos")}const Q=U.element("words");if(Q){const $=Q.attribute("default-y");$&&this.readExpressionPlacement($,"read words y pos")}const ot=U.element("rehearsal");if(ot){const $=ot.attribute("default-y");$&&this.readExpressionPlacement($,"read rehearsal pos")}}}}catch(U){const Y=y.ITextTranslation.translateText("ReaderErrorMessages/ExpressionPlacementError","Invalid expression placement. Set to default.");d.default.debug("ExpressionReader.readExpressionParameters",Y,U),this.musicSheet.SheetErrors.pushMeasureError(Y),this.placement=p.PlacementEnum.Below}this.placement===p.PlacementEnum.NotYetDefined&&(this.placement=T.Staves.length>1?p.PlacementEnum.Below:T.HasLyrics?p.PlacementEnum.Above:p.PlacementEnum.Below)}read(I,T,A,v=void 0){let B=!1,D=!1;const L=A.clone(),F=I.element("offset");if(F?.value){const P=Number.parseInt(F.value,10);L.Add(new s.Fraction(P,4*this.divisions))}const V=I.element("sound");if(V){const P=V.attribute("tempo"),U=V.attribute("dynamics");if(P&&(P.value.match(/^(\d+)(\.\d+)?$/)?.length>0?this.soundTempo=Math.round(Number.parseFloat(P.value)):(d.default.info("invalid xml tempo: "+P.value),this.soundTempo=100),T.TempoInBPM=this.soundTempo,0===this.musicSheet.DefaultStartTempoInBpm&&(this.musicSheet.DefaultStartTempoInBpm=this.soundTempo),this.musicSheet.HasBPMInfo=!0,B=!0),U){const Y=U.value.match(/\d+/);this.soundDynamic=void 0!==Y?parseInt(Y[0],10):100,D=!0}}const j=I.elements("direction-type");for(const P of j){let U=P.element("metronome");if(U){const Y=U.elements("metronome-note"),H=U.element("metronome-relation");if(Y.length>0&&H)this.parseComplexMetronomeMark(U,Y,H,T,L);else{const Q=U.element("beat-unit"),ot=void 0!==U.element("beat-unit-dot"),$=U.element("per-minute");if(void 0!==Q&&$){U.hasAttributes&&void 0!==U.attribute("default-x")&&(this.directionTimestamp=s.Fraction.createFromFraction(L));const it=$.value.match(/(\d+\.?\d*)/),nt=it?parseFloat(it[1]):NaN;this.createNewTempoExpressionIfNeeded(T);const st=new e.InstantaneousTempoExpression(void 0,this.placement,this.staffNumber,nt,this.currentMultiTempoExpression,!0);st.parentMeasure=T,this.soundTempo=nt,T.TempoInBPM=this.soundTempo*(ot?1.5:1),0===this.musicSheet.DefaultStartTempoInBpm&&(this.musicSheet.DefaultStartTempoInBpm=this.soundTempo),this.musicSheet.HasBPMInfo=!0,st.dotted=ot,st.beatUnit=Q.value,this.currentMultiTempoExpression.addExpression(st,""),this.currentMultiTempoExpression.CombinedExpressionsText="test"}}}else if(U=P.element("dynamics"),U){const Y=void 0!==I.element("notations");this.interpretInstantaneousDynamics(U,T,L,Y)}else if(U=P.element("words"),U)if(B){this.createNewTempoExpressionIfNeeded(T),this.currentMultiTempoExpression.CombinedExpressionsText=U.value;const Y=new e.InstantaneousTempoExpression(U.value,this.placement,this.staffNumber,this.soundTempo,this.currentMultiTempoExpression);this.currentMultiTempoExpression.addExpression(Y,"")}else D||this.interpretWords(U,T,L);else U=P.element("wedge"),U?this.interpretWedge(I,U,T,v,T.MeasureNumber):(U=P.element("rehearsal"),U&&this.interpretRehearsalMark(U,T,A,T.MeasureNumber))}}closeOpenExpressions(I,T){for(const A of this.openContinuousDynamicExpressions)this.createNewMultiExpressionIfNeeded(I,A.NumberXml,T),this.closeOpenContinuousDynamic(A,I,T);this.openContinuousTempoExpression&&this.closeOpenContinuousTempo(s.Fraction.plus(I.AbsoluteTimestamp,T))}addOctaveShift(I,T,A,v=0){let B=1;const D=I.element("staff");if(D)try{B=parseInt(D.value,10)}catch(V){const j=y.ITextTranslation.translateText("ReaderErrorMessages/OctaveShiftStaffError","Invalid octave shift staff number. Set to default");this.musicSheet.SheetErrors.pushMeasureError(j),B=1,d.default.debug("ExpressionReader.addOctaveShift",j,V)}const L=I.elements("direction-type"),F=this.readPlacement(I);for(const V of L){const j=V.element("octave-shift");if(void 0!==j&&j.hasAttributes)try{const P=this.readNumber(j);if(j.attribute("size")){const U=parseInt(j.attribute("size").value,10);let Y=0;8===U?Y=1:15===U&&(Y=2);let H=j.attribute("type")?.value;if(H||(F===p.PlacementEnum.Above?H="down":F===p.PlacementEnum.Below&&(H="up")),"up"===H||"down"===H){const Q=new n.OctaveShift(H,Y);Q.StaffNumber=B,Q.numberXml=P,this.getMultiExpression=this.createNewMultiExpressionIfNeeded(T,P),this.getMultiExpression.OctaveShiftStart=Q,Q.ParentStartMultiExpression=this.getMultiExpression,this.openOctaveShifts.set(P,Q);const ot=this.pendingOctaveShiftStops.get(P);ot&&(this.pendingOctaveShiftStops.delete(P),this.getMultiExpression=this.createNewMultiExpressionIfNeeded(ot.measure,P,ot.endTimestamp),this.getMultiExpression.OctaveShiftEnd=Q,Q.ParentEndMultiExpression=this.getMultiExpression,this.openOctaveShifts.delete(P))}else if("stop"===H){const Q=this.openOctaveShifts.get(P);if(Q)Q.endVoiceEntryIndex=v,this.getMultiExpression=this.createNewMultiExpressionIfNeeded(T,Q.numberXml,A),this.getMultiExpression.OctaveShiftEnd=Q,Q.ParentEndMultiExpression=this.getMultiExpression,this.openOctaveShifts.delete(P);else{const ot=s.Fraction.minus(this.directionTimestamp,new s.Fraction(1,4*this.divisions));this.pendingOctaveShiftStops.set(P,{measure:T,endTimestamp:ot})}}else H||d.default.debug("octave-shift missing type in xml")}}catch(P){const U=y.ITextTranslation.translateText("ReaderErrorMessages/OctaveShiftError","Error while reading octave shift.");this.musicSheet.SheetErrors.pushMeasureError(U),d.default.debug("ExpressionReader.addOctaveShift",U,P)}}}addPedalMarking(I,T,A){const v=I.elements("direction-type");for(const B of v){const D=B.element("pedal");if(D&&D.hasAttributes){let L=!1,F=!1;try{switch("yes"===D.attribute("line")?.value?F=!0:"no"===D.attribute("line")?.value?(F=!1,L=!0):"yes"===D.attribute("sign")?.value?L=!0:(L=!1,F=!0),D.attribute("type").value){case"start":this.openPedal&&this.openPedal.IsLine&&this.endOpenPedal(T),this.createNewMultiExpressionIfNeeded(T,-1),this.openPedal=new x.Pedal(F,L),this.getMultiExpression.PedalStart=this.openPedal,this.openPedal.ParentStartMultiExpression=this.getMultiExpression;break;case"stop":this.openPedal&&this.endOpenPedal(T,A);break;case"change":this.openPedal&&this.openPedal.IsLine&&(this.openPedal.ChangeEnd=!0,this.createNewMultiExpressionIfNeeded(T,-1),this.getMultiExpression.PedalEnd=this.openPedal,this.openPedal.ParentEndMultiExpression=this.getMultiExpression,this.createNewMultiExpressionIfNeeded(T,-1),this.openPedal=new x.Pedal(F,L),this.openPedal.ChangeBegin=!0,this.getMultiExpression.PedalStart=this.openPedal,this.openPedal.ParentStartMultiExpression=this.getMultiExpression)}}catch(V){const j=y.ITextTranslation.translateText("ReaderErrorMessages/PedalError","Error while reading pedal.");this.musicSheet.SheetErrors.pushMeasureError(j),d.default.debug("ExpressionReader.addPedalMarking",j,V)}}}}endOpenPedal(I,T){this.createNewMultiExpressionIfNeeded(I,-1,T),this.getMultiExpression.PedalEnd=this.openPedal,this.openPedal.ParentEndMultiExpression=this.getMultiExpression,this.openPedal=void 0}addWavyLine(I,T,A,v){if(I&&I.hasAttributes)try{switch(I.attribute("type").value){case"start":this.createNewMultiExpressionIfNeeded(T,-1),this.openWavyLine=new _.WavyLine(this.placement),this.getMultiExpression.WavyLineStart=this.openWavyLine,this.openWavyLine.ParentStartMultiExpression=this.getMultiExpression;break;case"stop":this.openWavyLine&&(this.createNewMultiExpressionIfNeeded(T,-1,A),this.getMultiExpression.WavyLineEnd=this.openWavyLine,this.openWavyLine.ParentEndMultiExpression=this.getMultiExpression,this.openWavyLine=void 0)}}catch(B){const D=y.ITextTranslation.translateText("ReaderErrorMessages/WavyLineError","Error while reading wavy-line.");this.musicSheet.SheetErrors.pushMeasureError(D),d.default.debug("ExpressionReader.addWavyLine",D,B)}}initialize(){this.placement=p.PlacementEnum.NotYetDefined,this.soundTempo=0,this.soundDynamic=0,this.offsetDivisions=0}readPlacement(I){const T=I.attribute("placement")?.value;return"above"===T?p.PlacementEnum.Above:"below"===T?p.PlacementEnum.Below:p.PlacementEnum.NotYetDefined}readExpressionPlacement(I,T){try{const A=this.readPosition(I);A<0?this.placement=p.PlacementEnum.Below:A>0&&(this.placement=p.PlacementEnum.Above)}catch(A){d.default.debug("ExpressionReader.readExpressionParameters",T,A)}}readPosition(I){try{const T=parseInt(I.value,10);return T<0?this.placement=p.PlacementEnum.Below:T>0&&(this.placement=p.PlacementEnum.Above),T}catch(T){d.default.debug("ExpressionReader.readExpressionParameters",T)}}parseComplexMetronomeMark(I,T,A,v,B){I.hasAttributes&&void 0!==I.attribute("default-x")&&(this.directionTimestamp=s.Fraction.createFromFraction(B));const D=I.elements(),L=[],F=[];let V,j=!1;for(const H of D){if("metronome-relation"===H.name){j=!0;continue}if("metronome-note"!==H.name)continue;const Q=H.element("metronome-type");if(!Q)continue;const ot={type:Q.value,dots:H.elements("metronome-dot").length},$=H.element("metronome-beam");$&&(ot.beam=$.value);const it=H.element("metronome-tuplet");if(it&&"start"===(it.hasAttributes?it.attribute("type")?.value:void 0)){const nt=it.element("actual-notes"),st=it.element("normal-notes"),N=it.attribute("bracket"),C=it.attribute("show-number");V={actualNotes:nt?parseInt(nt.value,10):3,normalNotes:st?parseInt(st.value,10):2,bracket:!N||"yes"===N.value,showNumber:C?C.value:"actual"}}j?F.push(ot):L.push(ot)}const P={notes:L},U={notes:F,tuplet:V};this.createNewTempoExpressionIfNeeded(v);const Y=new e.InstantaneousTempoExpression(void 0,this.placement,this.staffNumber,this.soundTempo,this.currentMultiTempoExpression,!0);Y.parentMeasure=v,Y.metronomeNoteGroupLeft=P,Y.metronomeNoteGroupRight=U,Y.metronomeRelation=A.value,0===this.musicSheet.DefaultStartTempoInBpm&&(this.musicSheet.DefaultStartTempoInBpm=this.soundTempo),this.musicSheet.HasBPMInfo=!0,this.currentMultiTempoExpression.addExpression(Y,""),this.currentMultiTempoExpression.CombinedExpressionsText="test"}interpretInstantaneousDynamics(I,T,A,v){if(I.hasElements){I.hasAttributes&&I.attribute("default-x")&&(this.directionTimestamp=s.Fraction.createFromFraction(A));const B=this.readNumber(I);let D=I.elements()[0]?.name;if("other-dynamics"===D&&(D=I.elements()[0].value),D){if(T.Rules?.IgnoreRepeatedDynamics){let F;try{F=o.DynamicEnum[D]}catch{const j=y.ITextTranslation.translateText("ReaderErrorMessages/DynamicError","Error while reading dynamic.");return void this.musicSheet.SheetErrors.pushMeasureError(j)}if(this.activeInstantaneousDynamic?.DynEnum===F)return}v?this.createNewMultiExpressionIfNeeded(T,B,s.Fraction.createFromFraction(A)):this.createNewMultiExpressionIfNeeded(T,B);const L=new o.InstantaneousDynamicExpression(D,this.soundDynamic,this.placement,this.staffNumber,T);L.InMeasureTimestamp=A.clone(),this.getMultiExpression.addExpression(L,""),this.activeInstantaneousDynamic?this.activeInstantaneousDynamic.DynEnum=L.DynEnum:this.activeInstantaneousDynamic=new o.InstantaneousDynamicExpression(D,0,p.PlacementEnum.NotYetDefined,1,T)}}}interpretWords(I,T,A){const v=I.value;if(T.Rules.IgnoreBracketsWords&&(/^\(\s*\)$/.test(v)||/^\[\s*\]$/.test(v)))return;let B;const D=I.attribute("font-style");let L,F,V;D&&(L=D.value,"italic"===L&&(B=S.FontStyles.Italic));const j=I.attribute("font-weight");j&&(F=j.value,"bold"===F&&(B=S.FontStyles.Bold,"italic"===L&&(B=S.FontStyles.BoldItalic)));const P=I.attribute("color");let U;if(P&&(V=P.value),T.Rules.PlaceWordsInsideStafflineFromXml){const Y=I.attribute("default-y")?.value;Y?.length>0&&(U=Number.parseInt(Y,10))}if(v.length>0){if(I.hasAttributes&&I.attribute("default-x")&&(this.directionTimestamp=s.Fraction.createFromFraction(A)),this.checkIfWordsNodeIsRepetitionInstruction(v))return;this.fillMultiOrTempoExpression(v,T,A,B,V,U),this.initialize()}}readNumber(I){let T=1;const A=I.attribute("number")?.value;return A&&(T=Number.parseInt(A,10)),T}interpretWedge(I,T,A,v,B){void 0!==T&&T.hasAttributes&&T.attribute("default-x")&&(this.directionTimestamp=s.Fraction.createFromFraction(v));const D=this.readNumber(T),L=T.attribute("type")?.value?.toLowerCase();this.lastWedge&&this.lastWedge.parentMeasure.MeasureNumberXML===A.MeasureNumberXML&&this.lastWedge.StaffNumber===this.staffNumber&&this.placement===this.lastWedge.Placement&&void 0!==this.WedgeYPosXml&&this.lastWedge.YPosXml===this.WedgeYPosXml&&this.lastWedge.StartMultiExpression.Timestamp.Equals(this.directionTimestamp)&&this.lastWedge.DynamicType===r.ContDynamicEnum[L]||("stop"===L?(this.createNewMultiExpressionIfNeeded(A,D,v),this.getMultiExpression.EndOffsetFraction=new s.Fraction(this.offsetDivisions,4*this.divisions)):this.createNewMultiExpressionIfNeeded(A,D),this.addWedge(T,A,v),this.initialize())}interpretRehearsalMark(I,T,A,v){T.rehearsalExpression=new M.RehearsalExpression(I.value,this.placement)}createNewMultiExpressionIfNeeded(I,T,A=void 0){A||(A=this.directionTimestamp);let v=this.getMultiExpression;return(!v||v&&(v.SourceMeasureParent!==I||v.numberXml!==T||v.SourceMeasureParent===I&&!v.Timestamp.Equals(A)))&&(this.getMultiExpression=v=new h.MultiExpression(I,s.Fraction.createFromFraction(A)),this.getMultiExpression.numberXml=T,I.StaffLinkedExpressions[this.globalStaffIndex].push(v)),v}createNewTempoExpressionIfNeeded(I){this.currentMultiTempoExpression&&this.currentMultiTempoExpression.SourceMeasureParent===I&&this.currentMultiTempoExpression.Timestamp===this.directionTimestamp||(this.currentMultiTempoExpression=new c.MultiTempoExpression(I,s.Fraction.createFromFraction(this.directionTimestamp)),I.TempoExpressions.push(this.currentMultiTempoExpression))}addWedge(I,T,A){if(void 0!==I&&I.hasAttributes){const v=this.readNumber(I),B=I.attribute("type").value.toLowerCase();try{if("crescendo"===B||"diminuendo"===B){const D=new r.ContinuousDynamicExpression(r.ContDynamicEnum[B],this.placement,this.staffNumber,T,v);this.lastWedge=D,this.lastWedge.YPosXml=this.WedgeYPosXml,this.openContinuousDynamicExpressions.push(D);let L=this.getMultiExpression;L||(L=this.createNewMultiExpressionIfNeeded(T,v)),L.StartingContinuousDynamic=D,D.StartMultiExpression=L,void 0!==this.activeInstantaneousDynamic&&this.activeInstantaneousDynamic.StaffNumber===D.StaffNumber&&(this.activeInstantaneousDynamic=void 0)}else if("stop"===B)for(const D of this.openContinuousDynamicExpressions)D.NumberXml===v&&this.closeOpenContinuousDynamic(D,T,A)}catch(D){const L="ReaderErrorMessages/WedgeError, Error while reading Crescendo / Diminuendo.";this.musicSheet.SheetErrors.pushMeasureError(L),d.default.debug("ExpressionReader.addWedge",L,D)}}}fillMultiOrTempoExpression(I,T,A,v,B,D=void 0){if(!I)return;const L=I.trim();this.createExpressionFromString("",L,T,A,I,v,B,D)}createExpressionFromString(I,T,A,v,B,D,L,F=void 0){const V=e.InstantaneousTempoExpression.isInputStringInstantaneousTempo(T),j=i.ContinuousTempoExpression.isInputStringContinuousTempo(T);if(V||j){if(A.TempoExpressions.length>0)for(let H=0,Q=A.TempoExpressions.length;H<Q;++H){const ot=A.TempoExpressions[H];if(ot.Timestamp===this.directionTimestamp&&void 0!==ot.InstantaneousTempo&&-1!==ot.InstantaneousTempo.Label.indexOf(T))return!1}if(this.createNewTempoExpressionIfNeeded(A),this.currentMultiTempoExpression.CombinedExpressionsText=B,V){const H=new e.InstantaneousTempoExpression(T,this.placement,this.staffNumber,this.soundTempo,this.currentMultiTempoExpression);return H.ColorXML=L,this.currentMultiTempoExpression.addExpression(H,I),!0}if(j){const H=new i.ContinuousTempoExpression(T,this.placement,this.staffNumber,this.currentMultiTempoExpression);return H.ColorXML=L,this.currentMultiTempoExpression.addExpression(H,I),!0}}if(r.ContinuousDynamicExpression.isInputStringContinuousDynamic(T)){const H=new r.ContinuousDynamicExpression(void 0,this.placement,this.staffNumber,A,-1,T);H.ColorXML=L;const Q=this.getMultiExpression;return Q&&this.closeOpenContinuousDynamic(Q.StartingContinuousDynamic,A,v),this.createNewMultiExpressionIfNeeded(A,-1),void 0!==this.activeInstantaneousDynamic&&this.activeInstantaneousDynamic.StaffNumber===H.StaffNumber&&(this.activeInstantaneousDynamic=void 0),this.openContinuousDynamicExpressions.push(H),H.StartMultiExpression=this.getMultiExpression,this.getMultiExpression.addExpression(H,I),!0}if(f.MoodExpression.isInputStringMood(T)){const H=this.createNewMultiExpressionIfNeeded(A,-1);A.hasMoodExpressions=!0;const Q=new f.MoodExpression(T,this.placement,this.staffNumber);return Q.fontStyle=D,Q.ColorXML=L,H.addExpression(Q,I),!0}const P=this.createNewMultiExpressionIfNeeded(A,-1,v);if(A.TempoExpressions.length>0)for(let H=0,Q=A.TempoExpressions.length;H<Q;++H){const ot=A.TempoExpressions[H];if(ot.Timestamp===this.directionTimestamp&&void 0!==ot.InstantaneousTempo&&ot.EntriesList.length>0&&!this.hasDigit(T)&&this.globalStaffIndex>0){if(ot.EntriesList[0].label.indexOf(T)>=0)return!1;break}}let U=this.musicSheet.Rules.UnknownExpressionTextAlignment;this.musicSheet.Rules.CompactMode&&(U=E.TextAlignmentEnum.LeftBottom);const Y=new m.UnknownExpression(T,this.placement,U,this.staffNumber);return Y.fontStyle=D,Y.ColorXML=L,Y.defaultYXml=F,Y.parentMeasure=A,P.addExpression(Y,I),!1}closeOpenContinuousDynamic(I,T,A){I&&(I.EndMultiExpression=this.createNewMultiExpressionIfNeeded(T,I.NumberXml,A),I.StartMultiExpression.EndingContinuousDynamic=I,this.openContinuousDynamicExpressions=this.openContinuousDynamicExpressions.filter(B=>B!==I))}closeOpenContinuousTempo(I){this.openContinuousTempoExpression.AbsoluteEndTimestamp=I,this.openContinuousTempoExpression=void 0}checkIfWordsNodeIsRepetitionInstruction(I){return"coda"===(I=I.trim().toLowerCase())||"tocoda"===I||"to coda"===I||"fine"===I||"d.c."===I||"dacapo"===I||"da capo"===I||"d.s."===I||"dalsegno"===I||"dal segno"===I||"d.c. al fine"===I||"d.s. al fine"===I||"d.c. al coda"===I||"d.s. al coda"===I}hasDigit(I){return/\d/.test(I)}}},6030(dt,g,u){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.LyricsReader=void 0;const l=u(649),s=u(2317),c=u(9767);g.LyricsReader=class{constructor(r){this.openLyricWords={},this.musicSheet=r}addLyricEntry(r,i){if(r){const o=r;for(let n=0,h=o.length;n<h;++n){const e=o[n];try{let f="single";if(e.element("text")){let m=e.element("text");if(e.element("syllabic")&&(f=e.element("syllabic").value),m){let p="";const E=e.elements();for(const S of E)"text"!==S.name&&"elision"!==S.name||(p+=S.value);if(p=p.replace(" "," "),void 0!==e.element("elision")&&"-"===p){const S=e.elements();let M,x,_=0;for(let I=0;I<S.length;I++)if("elision"===S[I].name){_=I;break}if(_>0)for(let I=_;I<S.length;I++){const T=S[I];"text"===T.name&&(M=T),"syllabic"===T.name&&(x=T)}void 0!==M&&x&&(m=M,f="middle")}let y,d="1";void 0!==e.attributes()&&e.attribute("number")&&(d=e.attribute("number").value),"single"===f||"end"===f?(this.openLyricWords[d]?(this.currentLyricWord=this.openLyricWords[d],y=new s.LyricsEntry(p,d,this.currentLyricWord,i,this.currentLyricWord.Syllables.length),this.currentLyricWord.Syllables.push(y),delete this.openLyricWords[d],this.currentLyricWord=void 0):y=new s.LyricsEntry(p,d,void 0,i),y.extend=void 0!==e.element("extend")):"begin"===f?(this.openLyricWords[d]&&(delete this.openLyricWords[d],this.currentLyricWord=void 0),this.currentLyricWord=new l.LyricWord,this.openLyricWords[d]=this.currentLyricWord,y=new s.LyricsEntry(p,d,this.currentLyricWord,i,0),this.currentLyricWord.Syllables.push(y)):"middle"===f&&(this.openLyricWords[d]?(this.currentLyricWord=this.openLyricWords[d],y=new s.LyricsEntry(p,d,this.currentLyricWord,i,this.currentLyricWord.Syllables.length),this.currentLyricWord.Syllables.push(y)):y=new s.LyricsEntry(p,d,void 0,i)),y&&(i.LyricsEntries[d]||(i.LyricsEntries.setValue(d,y),i.ParentSourceStaffEntry?.VerticalContainerParent?.ParentMeasure&&(i.ParentSourceStaffEntry.VerticalContainerParent.ParentMeasure.hasLyrics=!0)),i.ParentVoice.Parent.LyricVersesNumbers.includes(d)||i.ParentVoice.Parent.LyricVersesNumbers.push(d))}}}catch{const m=c.ITextTranslation.translateText("ReaderErrorMessages/LyricError","Error while reading lyric entry.");this.musicSheet.SheetErrors.pushMeasureError(m);continue}}}}}},6302(dt,g,u){"use strict";var l=this&&this.__importDefault||function(h){return h&&h.__esModule?h:{default:h}};Object.defineProperty(g,"__esModule",{value:!0}),g.RepetitionBuildingContainer=g.RepetitionCalculator=void 0;const s=u(1645),c=u(1645),r=u(7307),i=u(4076),o=l(u(3065));g.RepetitionCalculator=class{constructor(){this.repetitionInstructions=[],this.openRepetitions=[],this.lastRepetitionCommonPartStartIndex=0}calculateRepetitions(h,e){this.musicSheet=h,this.repetitionInstructions=e,this.openRepetitions.length=0,this.lastRepetitionCommonPartStartIndex=0;const f=this.musicSheet.SourceMeasures,m=new Set;for(let d=1;d<f.length;d++)(f[d].MeasureNumberXML??f[d].MeasureNumber)<=1&&(f[d-1].MeasureNumberXML??f[d-1].MeasureNumber)>1&&m.add(d);let p=0;for(const d of this.repetitionInstructions){if(this.currentMeasureIndex=d.measureIndex,this.currentMeasureIndex>p)for(const S of m)if(S>p&&S<=this.currentMeasureIndex){for(;this.openRepetitions.length>0;)this.finalizeRepetition(this.openRepetitions.last());this.lastRepetitionCommonPartStartIndex=S;break}p=this.currentMeasureIndex;try{this.currentMeasure=f[this.currentMeasureIndex],this.handleRepetitionInstructions(d)}catch(S){o.default.error("RepetitionCalculator: calculateRepetitions",S)}}for(;this.openRepetitions.length>0;)try{const d=this.openRepetitions.last();if(d.RepetitonUnderConstruction.FromWords){if(d.WaitingForCoda){let S=d.RepetitonUnderConstruction.BackwardJumpInstructions.last().measureIndex+1;S>=this.musicSheet.SourceMeasures.length&&(S=-1),d.RepetitonUnderConstruction.setEndingStartIndex(2,S)}else if(0===d.RepetitonUnderConstruction.BackwardJumpInstructions.length){this.openRepetitions.splice(this.openRepetitions.length-1,1);continue}}else if(0===d.RepetitonUnderConstruction.BackwardJumpInstructions.length){const S=f.length-1,M=new s.RepetitionInstruction(S,s.RepetitionInstructionEnum.BackJumpLine,s.AlignmentType.End,d.RepetitonUnderConstruction);d.RepetitonUnderConstruction.BackwardJumpInstructions.push(M),f[S].LastRepetitionInstructions.push(M)}this.finalizeRepetition(this.openRepetitions.last())}catch{try{const S=this.openRepetitions.last().RepetitonUnderConstruction;for(const M of this.repetitionInstructions)M.parentRepetition===S&&(M.parentRepetition=void 0);this.openRepetitions.splice(this.openRepetitions.length-1,1)}catch(S){o.default.error("RepetitionCalculator: calculateRepetitions2",S)}}let E=!1;const y=this.musicSheet.SourceMeasures.length-1;for(const d of this.musicSheet.Repetitions)if(0===d.StartIndex&&d.EndIndex===y){E=!0;break}if(!E){const d=new i.Repetition(this.musicSheet,!0);d.FromWords=!0,d.startMarker=new s.RepetitionInstruction(0,s.RepetitionInstructionEnum.StartLine),d.startMarker.parentRepetition=d,this.musicSheet.SourceMeasures[0].FirstRepetitionInstructions.push(d.startMarker),d.endMarker=new s.RepetitionInstruction(y,s.RepetitionInstructionEnum.BackJumpLine),d.endMarker.parentRepetition=d,d.BackwardJumpInstructions.push(d.endMarker),d.UserNumberOfRepetitions=d.DefaultNumberOfRepetitions,this.musicSheet.Repetitions.push(d)}for(let d=0,S=this.musicSheet.SourceMeasures.length;d<S;++d){const M=this.musicSheet.SourceMeasures[d];M.FirstRepetitionInstructions.length>1&&M.FirstRepetitionInstructions.sort(c.RepetitionInstructionComparer.Compare),M.LastRepetitionInstructions.length>1&&M.LastRepetitionInstructions.sort(c.RepetitionInstructionComparer.Compare)}}handleRepetitionInstructions(h){let e;switch(h.type){case s.RepetitionInstructionEnum.StartLine:e=this.createNewRepetition(this.currentMeasureIndex),h.parentRepetition=e.RepetitonUnderConstruction,e.RepetitonUnderConstruction.FromWords=!1,e.RepetitonUnderConstruction.startMarker=h,this.currentMeasure.FirstRepetitionInstructions.push(h);break;case s.RepetitionInstructionEnum.BackJumpLine:e=this.getOrCreateCurrentRepetition2(!1),h.parentRepetition=e.RepetitonUnderConstruction,e.RepetitonUnderConstruction.BackwardJumpInstructions.push(h),this.currentMeasure.LastRepetitionInstructions.push(h),0===e.RepetitonUnderConstruction.EndingParts.length&&this.finalizeRepetition(e);break;case s.RepetitionInstructionEnum.Ending:if(e=this.getOrCreateCurrentRepetition(),h.parentRepetition=e.RepetitonUnderConstruction,h.endingIndices.contains(1)&&h.alignment===s.AlignmentType.Begin){if(e.RepetitonUnderConstruction.BackwardJumpInstructions.length>0||e.RepetitonUnderConstruction.EndingIndexDict.hasOwnProperty(1)){e=void 0;for(let f=this.openRepetitions.length-1;f>=0;f--){const m=this.openRepetitions[f];if(0===m.RepetitonUnderConstruction.BackwardJumpInstructions.length)for(e=m;this.openRepetitions.length-1>f;){const p=this.openRepetitions.last();this.finalizeRepetition(p)}}void 0===e&&(e=this.createNewRepetition(0),e.RepetitonUnderConstruction.startMarker=new s.RepetitionInstruction(0,s.RepetitionInstructionEnum.None))}void 0===e.RepetitonUnderConstruction.forwardJumpInstruction&&(e.RepetitonUnderConstruction.forwardJumpInstruction=new s.RepetitionInstruction(this.currentMeasureIndex-1,s.RepetitionInstructionEnum.ForwardJump,s.AlignmentType.End,e.RepetitonUnderConstruction),this.musicSheet.SourceMeasures[this.currentMeasureIndex-1].LastRepetitionInstructions.push(e.RepetitonUnderConstruction.forwardJumpInstruction))}if(h.alignment===s.AlignmentType.Begin)e.RepetitonUnderConstruction.setEndingsStartIndex(h.endingIndices,this.currentMeasureIndex),this.currentMeasure.FirstRepetitionInstructions.push(h);else for(let f=0,m=h.endingIndices.length;f<m;++f)e.RepetitonUnderConstruction.setEndingEndIndex(h.endingIndices[f],this.currentMeasureIndex),this.currentMeasure.LastRepetitionInstructions.push(h);break;case s.RepetitionInstructionEnum.Segno:if(e=this.getCurrentRepetition(!0),void 0!==e&&e.SegnoFound&&e.RepetitonUnderConstruction.BackwardJumpInstructions.length>0&&Math.abs(e.RepetitonUnderConstruction.BackwardJumpInstructions.last().measureIndex-this.currentMeasureIndex)<=1)break;e=this.createNewRepetition(this.currentMeasureIndex),h.parentRepetition=e.RepetitonUnderConstruction,e.RepetitonUnderConstruction.FromWords=!0,e.SegnoFound=!0,e.RepetitonUnderConstruction.startMarker=h,this.currentMeasure.FirstRepetitionInstructions.push(h);break;case s.RepetitionInstructionEnum.Fine:if(0===this.openRepetitions.length||(e=this.getCurrentRepetition(!0),void 0===e))break;h.parentRepetition=e.RepetitonUnderConstruction,e.RepetitonUnderConstruction.FromWords=!0,void 0===e.RepetitonUnderConstruction.forwardJumpInstruction?(e.FineFound=!0,e.RepetitonUnderConstruction.forwardJumpInstruction=h,e.RepetitonUnderConstruction.setEndingStartIndex(2,-2),this.currentMeasure.LastRepetitionInstructions.push(h)):this.currentMeasure.LastRepetitionInstructions.push(new s.RepetitionInstruction(this.currentMeasureIndex,s.RepetitionInstructionEnum.Fine,s.AlignmentType.End,void 0));break;case s.RepetitionInstructionEnum.ToCoda:if(0===this.openRepetitions.length||(e=this.getCurrentRepetition(!0),void 0===e))break;void 0===e.RepetitonUnderConstruction.forwardJumpInstruction&&(h.parentRepetition=e.RepetitonUnderConstruction,e.RepetitonUnderConstruction.FromWords=!0,e.ToCodaFound=!0,e.RepetitonUnderConstruction.forwardJumpInstruction=h,this.currentMeasure.LastRepetitionInstructions.push(h));break;case s.RepetitionInstructionEnum.Coda:if(0===this.openRepetitions.length)break;e=this.getOrCreateCurrentRepetition2(!0),h.parentRepetition=e.RepetitonUnderConstruction,e.WaitingForCoda?(e.CodaFound=!0,e.RepetitonUnderConstruction.setEndingStartIndex(2,this.currentMeasureIndex),this.currentMeasure.LastRepetitionInstructions.push(h),this.finalizeRepetition(e),this.currentMeasureIndex>0&&(this.musicSheet.SourceMeasures[this.currentMeasureIndex-1].printNewSystemXml=!0)):e.ToCodaFound||(0===e.RepetitonUnderConstruction.BackwardJumpInstructions.length?(e.ToCodaFound=!0,e.RepetitonUnderConstruction.forwardJumpInstruction=new s.RepetitionInstruction(this.currentMeasureIndex,s.RepetitionInstructionEnum.ToCoda,s.AlignmentType.End,e.RepetitonUnderConstruction),this.currentMeasure.LastRepetitionInstructions.push(e.RepetitonUnderConstruction.forwardJumpInstruction)):this.currentMeasure.LastRepetitionInstructions.push(new s.RepetitionInstruction(this.currentMeasureIndex,s.RepetitionInstructionEnum.Coda,s.AlignmentType.Begin,void 0)));break;case s.RepetitionInstructionEnum.DaCapo:e=this.getOrCreateCurrentRepetition(),e.RepetitonUnderConstruction.BackwardJumpInstructions.length>0&&this.finalizeRepetition(e),0!==e.RepetitonUnderConstruction.StartIndex&&(e=this.createNewRepetition(0)),h.parentRepetition=e.RepetitonUnderConstruction,e.RepetitonUnderConstruction.FromWords=!0,e.RepetitonUnderConstruction.startMarker=new s.RepetitionInstruction(0,s.RepetitionInstructionEnum.None,s.AlignmentType.Begin,e.RepetitonUnderConstruction),e.RepetitonUnderConstruction.BackwardJumpInstructions.push(h),this.currentMeasure.LastRepetitionInstructions.push(h),0===e.RepetitonUnderConstruction.EndingParts.length&&this.finalizeRepetition(e);break;case s.RepetitionInstructionEnum.DalSegno:if(e=this.getOrCreateCurrentRepetition2(!0),e.RepetitonUnderConstruction.BackwardJumpInstructions.length>0&&(this.finalizeRepetition(e),e=this.createNewRepetition(0),e.RepetitonUnderConstruction.FromWords=!0,e.RepetitonUnderConstruction.startMarker=new s.RepetitionInstruction(0,s.RepetitionInstructionEnum.None,s.AlignmentType.Begin,e.RepetitonUnderConstruction)),h.parentRepetition=e.RepetitonUnderConstruction,!e.SegnoFound){const f=this.findInstructionInMainListBackwards(s.RepetitionInstructionEnum.Segno,h.measureIndex);f>=0&&(e.SegnoFound=!0,e.RepetitonUnderConstruction.startMarker=new s.RepetitionInstruction(f,s.RepetitionInstructionEnum.Segno,s.AlignmentType.Begin,e.RepetitonUnderConstruction),this.musicSheet.SourceMeasures[f].FirstRepetitionInstructions.splice(0,0,e.RepetitonUnderConstruction.startMarker))}e.RepetitonUnderConstruction.EndingIndexDict.hasOwnProperty(1)&&e.RepetitonUnderConstruction.setEndingEndIndex(1,this.currentMeasureIndex),e.RepetitonUnderConstruction.BackwardJumpInstructions.push(h),this.currentMeasure.LastRepetitionInstructions.push(h);break;case s.RepetitionInstructionEnum.DalSegnoAlFine:if(0===this.openRepetitions.length)break;if(e=this.getOrCreateCurrentRepetition2(!0),h.parentRepetition=e.RepetitonUnderConstruction,!e.SegnoFound){const f=this.findInstructionInMainListBackwards(s.RepetitionInstructionEnum.Segno,h.measureIndex);f>=0&&(e.SegnoFound=!0,e.RepetitonUnderConstruction.startMarker=new s.RepetitionInstruction(f,s.RepetitionInstructionEnum.Segno,s.AlignmentType.Begin,e.RepetitonUnderConstruction),this.musicSheet.SourceMeasures[f].FirstRepetitionInstructions.splice(0,0,e.RepetitonUnderConstruction.startMarker))}if(!e.FineFound){const f=this.findInstructionInMainListBackwards(s.RepetitionInstructionEnum.Fine,h.measureIndex);f>=0&&(e.FineFound=!0,e.RepetitonUnderConstruction.forwardJumpInstruction=new s.RepetitionInstruction(f,s.RepetitionInstructionEnum.Fine,s.AlignmentType.Begin,e.RepetitonUnderConstruction),e.RepetitonUnderConstruction.setEndingStartIndex(2,-2),this.musicSheet.SourceMeasures[f].LastRepetitionInstructions.splice(0,0,e.RepetitonUnderConstruction.forwardJumpInstruction))}e.RepetitonUnderConstruction.EndingIndexDict.hasOwnProperty(1)||e.RepetitonUnderConstruction.setEndingEndIndex(1,this.currentMeasureIndex),e.RepetitonUnderConstruction.BackwardJumpInstructions.push(h),this.currentMeasure.LastRepetitionInstructions.push(h);break;case s.RepetitionInstructionEnum.DaCapoAlFine:if(e=this.getOrCreateCurrentRepetition(),e.RepetitonUnderConstruction.BackwardJumpInstructions.length>0&&(this.finalizeRepetition(e),e=this.createNewRepetition(0)),void 0!==e.RepetitonUnderConstruction.startMarker&&0!==e.RepetitonUnderConstruction.StartIndex&&(e=this.createNewRepetition(0)),e.RepetitonUnderConstruction.startMarker=new s.RepetitionInstruction(0,s.RepetitionInstructionEnum.None,s.AlignmentType.Begin,e.RepetitonUnderConstruction),e.RepetitonUnderConstruction.FromWords=!0,h.parentRepetition=e.RepetitonUnderConstruction,!e.FineFound){const f=this.findInstructionInMainListBackwards(s.RepetitionInstructionEnum.Fine,h.measureIndex);f>=0&&(e.FineFound=!0,e.RepetitonUnderConstruction.forwardJumpInstruction=new s.RepetitionInstruction(f,s.RepetitionInstructionEnum.Fine,s.AlignmentType.Begin,e.RepetitonUnderConstruction),e.RepetitonUnderConstruction.setEndingStartIndex(2,-2),this.musicSheet.SourceMeasures[f].LastRepetitionInstructions.splice(0,0,e.RepetitonUnderConstruction.forwardJumpInstruction))}e.RepetitonUnderConstruction.EndingIndexDict.hasOwnProperty(1)||e.RepetitonUnderConstruction.setEndingEndIndex(1,this.currentMeasureIndex),e.RepetitonUnderConstruction.BackwardJumpInstructions.push(h),this.currentMeasure.LastRepetitionInstructions.push(h);break;case s.RepetitionInstructionEnum.DalSegnoAlCoda:if(0===this.openRepetitions.length)break;if(e=this.getOrCreateCurrentRepetition2(!0),h.parentRepetition=e.RepetitonUnderConstruction,!e.SegnoFound){const f=this.findInstructionInMainListBackwards(s.RepetitionInstructionEnum.Segno,h.measureIndex);f>=0&&(e.SegnoFound=!0,e.RepetitonUnderConstruction.startMarker=new s.RepetitionInstruction(f,s.RepetitionInstructionEnum.Segno,s.AlignmentType.Begin,e.RepetitonUnderConstruction),this.musicSheet.SourceMeasures[f].FirstRepetitionInstructions.splice(0,0,e.RepetitonUnderConstruction.startMarker))}if(!e.ToCodaFound){const f=this.findInstructionInMainListBackwards(s.RepetitionInstructionEnum.ToCoda,h.measureIndex);if(f>=0)e.RepetitonUnderConstruction.forwardJumpInstruction=new s.RepetitionInstruction(f,s.RepetitionInstructionEnum.ToCoda,s.AlignmentType.Begin,e.RepetitonUnderConstruction),this.musicSheet.SourceMeasures[f].LastRepetitionInstructions.splice(0,0,e.RepetitonUnderConstruction.forwardJumpInstruction),e.ToCodaFound=!0;else{const m=this.findInstructionInMainListBackwards(s.RepetitionInstructionEnum.Coda,h.measureIndex);m>=0&&(e.RepetitonUnderConstruction.forwardJumpInstruction=new s.RepetitionInstruction(m,s.RepetitionInstructionEnum.ToCoda,s.AlignmentType.Begin,e.RepetitonUnderConstruction),this.musicSheet.SourceMeasures[m].LastRepetitionInstructions.splice(0,0,e.RepetitonUnderConstruction.forwardJumpInstruction),e.ToCodaFound=!0)}}e.ToCodaFound&&(e.WaitingForCoda=!0),e.RepetitonUnderConstruction.EndingIndexDict.hasOwnProperty(1)||e.RepetitonUnderConstruction.setEndingEndIndex(1,this.currentMeasureIndex),e.RepetitonUnderConstruction.BackwardJumpInstructions.push(h),this.currentMeasure.LastRepetitionInstructions.push(h);break;case s.RepetitionInstructionEnum.DaCapoAlCoda:if(e=this.getOrCreateCurrentRepetition(),e.RepetitonUnderConstruction.BackwardJumpInstructions.length>0?(this.finalizeRepetition(e),e=this.createNewRepetition(0)):0===e.RepetitonUnderConstruction.EndingParts.length&&(e=this.createNewRepetition(0)),void 0!==e.RepetitonUnderConstruction.startMarker&&0!==e.RepetitonUnderConstruction.StartIndex&&(e=this.createNewRepetition(0)),e.RepetitonUnderConstruction.startMarker=new s.RepetitionInstruction(0,s.RepetitionInstructionEnum.None,s.AlignmentType.Begin,e.RepetitonUnderConstruction),e.RepetitonUnderConstruction.FromWords=!0,h.parentRepetition=e.RepetitonUnderConstruction,!e.ToCodaFound){const f=this.findInstructionInMainListBackwards(s.RepetitionInstructionEnum.ToCoda,h.measureIndex);if(f>=0)e.RepetitonUnderConstruction.forwardJumpInstruction=new s.RepetitionInstruction(f,s.RepetitionInstructionEnum.ToCoda,s.AlignmentType.Begin,e.RepetitonUnderConstruction),this.musicSheet.SourceMeasures[f].LastRepetitionInstructions.splice(0,0,e.RepetitonUnderConstruction.forwardJumpInstruction),e.ToCodaFound=!0;else{const m=this.findInstructionInMainListBackwards(s.RepetitionInstructionEnum.Coda,h.measureIndex);m>=0&&(e.RepetitonUnderConstruction.forwardJumpInstruction=new s.RepetitionInstruction(m,s.RepetitionInstructionEnum.ToCoda,s.AlignmentType.Begin,e.RepetitonUnderConstruction),this.musicSheet.SourceMeasures[m].LastRepetitionInstructions.splice(0,0,e.RepetitonUnderConstruction.forwardJumpInstruction),e.ToCodaFound=!0)}}e.ToCodaFound&&(e.WaitingForCoda=!0),e.RepetitonUnderConstruction.EndingIndexDict.hasOwnProperty(1)||e.RepetitonUnderConstruction.setEndingEndIndex(1,this.currentMeasureIndex),e.RepetitonUnderConstruction.BackwardJumpInstructions.push(h),this.currentMeasure.LastRepetitionInstructions.push(h);break;case s.RepetitionInstructionEnum.None:break;default:throw new r.ArgumentOutOfRangeException("currentRepetitionInstruction")}return!0}findInstructionInMainListBackwards(h,e){for(let f=this.repetitionInstructions.length-1;f>=0;f--){const m=this.repetitionInstructions[f];if(m.measureIndex<=e&&m.type===h)return m.measureIndex}return-1}finalizeRepetition(h){const e=h.RepetitonUnderConstruction;if(e.BackwardJumpInstructions.length>0){let f=!0;const m=this.getLastFinalizedRepetition();if(void 0!==m&&e.coversIdenticalMeasures(m)){if(e.NumberOfEndings>m.NumberOfEndings){const p=this.musicSheet.Repetitions.indexOf(m,0);p>-1&&this.musicSheet.Repetitions.splice(p,1),m.removeFromRepetitionInstructions(),this.musicSheet.Repetitions.push(e)}f=!1,e.removeFromRepetitionInstructions()}else this.musicSheet.Repetitions.push(e);if(f){e.startMarker.type===s.RepetitionInstructionEnum.None&&this.musicSheet.SourceMeasures[e.StartIndex].FirstRepetitionInstructions.push(e.startMarker);let p=e.DefaultNumberOfRepetitions;1===e.BackwardJumpInstructions.length&&e.BackwardJumpInstructions[0].Times>0&&(p=e.BackwardJumpInstructions[0].Times),e.UserNumberOfRepetitions=p}}this.openRepetitions.splice(this.openRepetitions.length-1,1)}getCurrentRepetition(h){let e;for(let f=this.openRepetitions.length-1;f>=0;f--)if(this.openRepetitions[f].RepetitonUnderConstruction.FromWords===h){for(e=this.openRepetitions[f];f<this.openRepetitions.length-1;)this.finalizeRepetition(this.openRepetitions.last());return e}return e}getOrCreateCurrentRepetition(){if(this.openRepetitions.length>0)return this.openRepetitions.last();const h=this.createNewRepetition(0);return h.RepetitonUnderConstruction.startMarker=new s.RepetitionInstruction(0,s.RepetitionInstructionEnum.None,s.AlignmentType.Begin,h.RepetitonUnderConstruction),h}getOrCreateCurrentRepetition2(h){let e;for(let f=this.openRepetitions.length-1;f>=0;f--)if(e=this.openRepetitions[f],e.RepetitonUnderConstruction.FromWords===h){for(;f<this.openRepetitions.length-1;)this.finalizeRepetition(this.openRepetitions.last());return e}return e=this.createNewRepetition(this.lastRepetitionCommonPartStartIndex),e.RepetitonUnderConstruction.startMarker=new s.RepetitionInstruction(this.lastRepetitionCommonPartStartIndex,s.RepetitionInstructionEnum.None,s.AlignmentType.Begin,e.RepetitonUnderConstruction),this.lastRepetitionCommonPartStartIndex=this.currentMeasureIndex+1,e.RepetitonUnderConstruction.FromWords=h,e}createNewRepetition(h){if(this.openRepetitions.length>0){const f=this.openRepetitions.last(),m=f.RepetitonUnderConstruction;if(m.BackwardJumpInstructions.length>0){const p=Object.keys(m.EndingIndexDict);(0===p.length||m.EndingIndexDict[p[p.length-1]].part.EndIndex>=0)&&this.finalizeRepetition(f)}}const e=new n(this.musicSheet);return this.lastRepetitionCommonPartStartIndex=h,this.openRepetitions.push(e),e}getLastFinalizedRepetition(){if(this.musicSheet.Repetitions.length>0)return this.musicSheet.Repetitions.last()}};class n{constructor(e){this.RepetitonUnderConstruction=new i.Repetition(e)}}g.RepetitionBuildingContainer=n},7631(dt,g,u){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.RepetitionInstructionReader=void 0;const l=u(1645),s=u(1645),c=u(4356);g.RepetitionInstructionReader=class{set MusicSheet(r){this.musicSheet=r,this.xmlMeasureList=new Array(this.musicSheet.Instruments.length),this.repetitionInstructions=[]}prepareReadingMeasure(r,i){this.currentMeasureIndex=i}handleLineRepetitionInstructions(r){let i=!1;if(r.elements().length>0){let o="",n=!1,h="",e="",f="";const m=[],p=r.element("bar-style");p&&(f=p.value),o=r.attributes().length>0&&r.attribute("location")?r.attribute("location").value:"right";const E=r.elements();for(let y=0,d=E.length;y<d;++y){const S=E[y];if("repeat"===S.name&&S.hasAttributes)n=!0,h=S.attribute("direction").value;else if("ending"===S.name&&S.hasAttributes&&void 0!==S.attribute("type")&&S.attribute("number")){if("no"===S.attribute("print-object")?.value)continue;e=S.attribute("type").value;let M=S.attribute("number").value;S.value&&(M=S.value);const x=M.split("[,+]");for(let _=0,I=x.length;_<I;++_){const T=x[_],A=T.match("[0-9]");if(-1!==T.search("-")&&2===A.length){const v=parseInt(A[0],10),B=parseInt(A[1],10);for(let D=v;D<=B;D++)m.push(D)}else for(let v=0,B=A.length;v<B;++v)m.push(parseInt(A[v],10))}}}if("light-heavy"!==f||0!==m.length||n||(i=!0),n||m.length>0)if("left"===o){if("start"===e){const y=new l.RepetitionInstruction(this.currentMeasureIndex,l.RepetitionInstructionEnum.Ending,l.AlignmentType.Begin,void 0,m);this.addInstruction(this.repetitionInstructions,y)}if("forward"===h){const y=new l.RepetitionInstruction(this.currentMeasureIndex,l.RepetitionInstructionEnum.StartLine);this.addInstruction(this.repetitionInstructions,y)}}else{if("stop"===e){const y=new l.RepetitionInstruction(this.currentMeasureIndex,l.RepetitionInstructionEnum.Ending,l.AlignmentType.End,void 0,m);this.addInstruction(this.repetitionInstructions,y)}else if("discontinue"===e){const y=new l.RepetitionInstruction(this.currentMeasureIndex,l.RepetitionInstructionEnum.Ending,l.AlignmentType.Discontinue,void 0,m);this.addInstruction(this.repetitionInstructions,y)}if("backward"===h){const y=new l.RepetitionInstruction(this.currentMeasureIndex,l.RepetitionInstructionEnum.BackJumpLine);this.addInstruction(this.repetitionInstructions,y)}}}return i}handleRepetitionInstructionsFromWordsOrSymbols(r,i){const o=r.element("words"),n=this.currentMeasureIndex;if(o){const h="d\\s?\\.s\\.",e=o.value.trim().toLowerCase();if(c.StringUtil.StringContainsSeparatedWord(e,h+" al fine",!0)){const m=new l.RepetitionInstruction(n,l.RepetitionInstructionEnum.DalSegnoAlFine);return this.addInstruction(this.repetitionInstructions,m),!0}const f="d\\.\\s?c\\.";if(c.StringUtil.StringContainsSeparatedWord(e,f+" al coda",!0)){const m=new l.RepetitionInstruction(n,l.RepetitionInstructionEnum.DaCapoAlCoda);return this.addInstruction(this.repetitionInstructions,m),!0}if(c.StringUtil.StringContainsSeparatedWord(e,f+" al fine",!0)){const m=new l.RepetitionInstruction(n,l.RepetitionInstructionEnum.DaCapoAlFine);return this.addInstruction(this.repetitionInstructions,m),!0}if(c.StringUtil.StringContainsSeparatedWord(e,f+" al coda",!0)){const m=new l.RepetitionInstruction(n,l.RepetitionInstructionEnum.DaCapoAlCoda);return this.addInstruction(this.repetitionInstructions,m),!0}if(c.StringUtil.StringContainsSeparatedWord(e,f)||c.StringUtil.StringContainsSeparatedWord(e,"da\\s?capo",!0)){const m=new l.RepetitionInstruction(n,l.RepetitionInstructionEnum.DaCapo);return this.addInstruction(this.repetitionInstructions,m),!0}if(c.StringUtil.StringContainsSeparatedWord(e,h,!0)||c.StringUtil.StringContainsSeparatedWord(e,"dal\\s?segno",!0)){let m;return m=c.StringUtil.StringContainsSeparatedWord(e,"al\\s?coda",!0)?new l.RepetitionInstruction(n,l.RepetitionInstructionEnum.DalSegnoAlCoda):new l.RepetitionInstruction(n,l.RepetitionInstructionEnum.DalSegno),this.addInstruction(this.repetitionInstructions,m),!0}if(c.StringUtil.StringContainsSeparatedWord(e,"to\\s?coda",!0)||c.StringUtil.StringContainsSeparatedWord(e,"a (la )?coda",!0)){const m=new l.RepetitionInstruction(n,l.RepetitionInstructionEnum.ToCoda);return this.addInstruction(this.repetitionInstructions,m),!0}if(c.StringUtil.StringContainsSeparatedWord(e,"fine",!0)){const m=new l.RepetitionInstruction(n,l.RepetitionInstructionEnum.Fine);return this.addInstruction(this.repetitionInstructions,m),!0}if(c.StringUtil.StringContainsSeparatedWord(e,"coda",!0)){const m=new l.RepetitionInstruction(n,l.RepetitionInstructionEnum.Coda);return this.addInstruction(this.repetitionInstructions,m),!0}if(c.StringUtil.StringContainsSeparatedWord(e,"segno",!0)){const m=new l.RepetitionInstruction(n,l.RepetitionInstructionEnum.Segno);return this.addInstruction(this.repetitionInstructions,m),!0}}else{if(r.element("segno")){const h=new l.RepetitionInstruction(n,l.RepetitionInstructionEnum.Segno);return this.addInstruction(this.repetitionInstructions,h),!0}if(r.element("coda")){const h=new l.RepetitionInstruction(n,l.RepetitionInstructionEnum.Coda);return this.addInstruction(this.repetitionInstructions,h),!0}}return!1}removeRedundantInstructions(){let r=0,i=0,o=0,n=0;for(let h=0;h<this.repetitionInstructions.length;h++){const e=this.repetitionInstructions[h];switch(e.type){case l.RepetitionInstructionEnum.Coda:o>0&&this.findInstructionInPreviousMeasure(h,e.measureIndex,l.RepetitionInstructionEnum.ToCoda)&&(e.type=l.RepetitionInstructionEnum.None);break;case l.RepetitionInstructionEnum.Segno:if(r-n>0){let f=!1;for(let m=0,p=this.repetitionInstructions.length;m<p;++m){const E=this.repetitionInstructions[m];if(e.measureIndex-E.measureIndex==1)switch(E.type){case l.RepetitionInstructionEnum.BackJumpLine:E.type=o-i>0?l.RepetitionInstructionEnum.DalSegnoAlCoda:l.RepetitionInstructionEnum.DalSegno,e.type=l.RepetitionInstructionEnum.None,f=!0;break;case l.RepetitionInstructionEnum.DalSegno:case l.RepetitionInstructionEnum.DalSegnoAlFine:case l.RepetitionInstructionEnum.DalSegnoAlCoda:e.type=l.RepetitionInstructionEnum.None,f=!0}if(f)break}if(f)break;e.type=o-i>0?l.RepetitionInstructionEnum.DalSegnoAlCoda:l.RepetitionInstructionEnum.DalSegno,e.alignment=l.AlignmentType.End,e.measureIndex--}}if(this.backwardSearchForPreviousIdenticalInstruction(h,e)||e.type===l.RepetitionInstructionEnum.None)this.repetitionInstructions.splice(h,1),h--;else switch(e.type){case l.RepetitionInstructionEnum.Fine:break;case l.RepetitionInstructionEnum.ToCoda:o++;break;case l.RepetitionInstructionEnum.Coda:i++;break;case l.RepetitionInstructionEnum.Segno:r++;break;case l.RepetitionInstructionEnum.DalSegnoAlFine:case l.RepetitionInstructionEnum.DalSegnoAlCoda:n++}}this.repetitionInstructions.sort(s.RepetitionInstructionComparer.Compare)}findInstructionInPreviousMeasure(r,i,o){for(let n=r-1;n>=0;n--){const h=this.repetitionInstructions[n];if(i-h.measureIndex==1&&h.type===o)return!0}return!1}backwardSearchForPreviousIdenticalInstruction(r,i){for(let o=r-1;o>=0;o--)if(this.repetitionInstructions[o].equals(i))return!0;return!1}addInstruction(r,i){let o=!0;for(let n=0,h=r.length;n<h;++n)if(i.equals(r[n])){o=!1;break}o&&r.push(i)}}},3186(dt,g,u){"use strict";var l=this&&this.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(g,"__esModule",{value:!0}),g.SlurReader=void 0;const s=u(6229),c=l(u(3065)),r=u(9767),i=u(4980),o=u(7718);g.SlurReader=class{constructor(n){this.openSlurDict={},this.musicSheet=n}addSlur(n,h){try{if(n)for(const e of n)if(e.attributes().length>0){const f=e.attribute("type").value;let m=1;try{e.attribute("number")&&(m=parseInt(e.attribute("number").value,10))}catch(d){c.default.debug("VoiceGenerator.addSlur number: ",d)}let p=i.PlacementEnum.NotYetDefined;const E=e.attribute("placement");E&&E.value&&("above"===E.value?p=i.PlacementEnum.Above:"below"===E.value&&(p=i.PlacementEnum.Below));const y=e.attribute("orientation");if(y&&y.value&&("over"===y.value?p=i.PlacementEnum.Above:"under"===y.value&&(p=i.PlacementEnum.Below)),"start"===f){let d=this.openSlurDict[m];d||(d=new s.Slur,this.openSlurDict[m]=d),d.StartNote=h,d.PlacementXml=p}else if("stop"===f){const d=this.openSlurDict[m];if(d){const S=e.name;if("slide"===S||"glissando"===S){const x=new o.Glissando(d.StartNote);x.AddNote(h),x.EndNote=h,h.NoteGlissando=x,delete this.openSlurDict[m]}else d.EndNote=h,h.isDuplicateSlur(d)||(h.NoteSlurs.push(d),d.StartNote.NoteSlurs.push(d)),delete this.openSlurDict[m]}}}}catch{const f=r.ITextTranslation.translateText("ReaderErrorMessages/SlurError","Error while reading slur.");this.musicSheet.SheetErrors.pushMeasureError(f)}}}},1538(dt,g,u){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.TempoSorter=g.TemposCalculator=void 0;const l=u(2561),s=u(899),c=u(6362),r=u(9161),i=u(5332);class o{calculate(e){o.processTempoExpressions(e)}static processTempoExpressions(e){const f=[];for(let d=0,S=e.SourceMeasures;d<S.length;d++){const M=S[d];M.TempoExpressions.sort(n.Compare);for(let x=0,_=M.TempoExpressions;x<_.length;x++){const I=_[x];null!=I.InstantaneousTempo&&I.InstantaneousTempo.TempoType===r.TempoType.none&&(I.InstantaneousTempo.TempoType=r.TempoType.inst),f.push(I)}}f.sort(n.Compare);const m=o.cleanExpListStartingEntry(e,f),p=[];let E=null,y=m;for(let d=0,S=f;d<S.length;d++){const M=S[d];if(null===E||M.AbsoluteTimestamp!==E.AbsoluteTimestamp){if(null!=M.InstantaneousTempo&&0===M.InstantaneousTempo.TempoInBpm){const x=M.InstantaneousTempo;if(x.isMetronomeMark&&(x.TempoInBpm=y),x instanceof r.InstantaneousTempoExpression&&x.TempoType!==r.TempoType.change&&(x.TempoInBpm=r.InstantaneousTempoExpression.getDefaultValueForInstTempo(x.InstTempo)),x.TempoType===r.TempoType.change)switch(x.ChangeSubType){case r.ChangeSubType.atempo:x.TempoInBpm=y;break;case r.ChangeSubType.doppioMovimento:x.TempoInBpm=2*y;break;case r.ChangeSubType.tempoprimo:x.TempoInBpm=m}y=x.TempoInBpm}}else null==E&&M.AbsoluteTimestamp!==E.AbsoluteTimestamp||(null!=E.InstantaneousTempo&&null!=M.InstantaneousTempo&&M.clearInstantaneousTempo(),null!=M.ContinuousTempo&&(null===E.ContinuousTempo&&E.addExpression(M.ContinuousTempo,""),M.clearContinuousTempo()));if(null===M.InstantaneousTempo&&null===M.ContinuousTempo){const x=M.SourceMeasureParent.TempoExpressions.indexOf(M);x>=0&&M.SourceMeasureParent.TempoExpressions.splice(x,1)}else p.push(M),E=M}y=m;for(let d=0;d<p.length;d++){const S=p[d];if(null!=S.InstantaneousTempo&&(y=S.InstantaneousTempo.TempoInBpm),null!=S.ContinuousTempo){const M=S.ContinuousTempo;M.StartTempo=y;const x=S.SourceMeasureParent.measureListIndex;let _=x;const I=Math.min(x+e.Rules.TempoChangeMeasureValidity,e.SourceMeasures.length-1);for(;_<=I;){const D=e.SourceMeasures[_],L=D.endingBarStyleEnum===s.SystemLinesEnum.ThinBold;if(D.endsWithLineRepetition()||L||_===e.SourceMeasures.length-1)break;if(_>x&&D.beginsWithRepetition()){_--;break}_++}const T=e.SourceMeasures[_];let A,v=l.Fraction.plus(T.AbsoluteTimestamp,l.Fraction.minus(T.Duration,new l.Fraction(1,64)));d<p.length-1&&(A=p[d+1].AbsoluteTimestamp,A.RealValue<v.RealValue&&(v=A)),M.AbsoluteEndTimestamp=v;let B=M.StartTempo*(1-e.Rules.TempoContinousFactor)*M.getTempoFactor();B*=Math.pow(Math.max(.6,Math.min(M.AbsoluteTimeSpan,2)/2),.25),M.EndTempo=M.StartTempo+B}}e.TimestampSortedTempoExpressionsList=p,p[0]?.InstantaneousTempo&&(e.DefaultStartTempoInBpm=p[0].InstantaneousTempo.TempoInBpm)}static cleanExpListStartingEntry(e,f){if(0!==f.length&&f[0].AbsoluteTimestamp.Equals(new l.Fraction(0,1))||(f=[new i.MultiTempoExpression(e.SourceMeasures[0],new l.Fraction(0,1))].concat(f)),!f[0].InstantaneousTempo){const p=new r.InstantaneousTempoExpression("*generated",c.PlacementEnum.Above,1,0,f[0],!0);f[0].addExpression(p,"")}const m=f[0].InstantaneousTempo;return 0!==m.TempoInBpm||(0===m.TempoInBpm&&e.DefaultStartTempoInBpm>0&&(m.TempoInBpm=e.DefaultStartTempoInBpm),0===m.TempoInBpm&&(m.TempoInBpm=r.InstantaneousTempoExpression.getDefaultValueForInstTempo[r.InstTempo.moderato])),m.TempoInBpm}}g.TemposCalculator=o;class n{static Compare(e,f){let m=0;if(m=n.CompareNumber(e.AbsoluteTimestamp.RealValue,f.AbsoluteTimestamp.RealValue),0!==m)return m;const p=n.calcSortPriority(e),E=n.calcSortPriority(f);return m=n.CompareNumber(p,E),m}static calcSortPriority(e){if(null!=e.InstantaneousTempo){switch(e.InstantaneousTempo.TempoType){case r.TempoType.metronomeMark:return 1;case r.TempoType.inst:return 2;case r.TempoType.change:switch(e.InstantaneousTempo.ChangeSubType){case r.ChangeSubType.atempo:case r.ChangeSubType.doppioMovimento:return 3;case r.ChangeSubType.tempoprimo:return 4}}return 5}return 9}static CompareNumber(e,f){return e<f?-1:e===f?0:1}}g.TempoSorter=n},302(dt,g,u){"use strict";var l=this&&this.__createBinding||(Object.create?function(c,r,i,o){void 0===o&&(o=i);var n=Object.getOwnPropertyDescriptor(r,i);n&&!("get"in n?!r.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return r[i]}}),Object.defineProperty(c,o,n)}:function(c,r,i,o){void 0===o&&(o=i),c[o]=r[i]}),s=this&&this.__exportStar||function(c,r){for(var i in c)"default"===i||Object.prototype.hasOwnProperty.call(r,i)||l(r,c,i)};Object.defineProperty(g,"__esModule",{value:!0}),s(u(4127),g),s(u(9536),g),s(u(5984),g),s(u(6030),g),s(u(6302),g),s(u(7631),g),s(u(3186),g),s(u(1538),g)},7503(dt,g,u){"use strict";var l=this&&this.__importDefault||function(c){return c&&c.__esModule?c:{default:c}};Object.defineProperty(g,"__esModule",{value:!0}),g.ReaderPluginManager=void 0;const s=l(u(3065));g.ReaderPluginManager=class{constructor(){this.voiceMeasureReadPlugins=[]}addVoiceMeasureReadPlugin(c){this.voiceMeasureReadPlugins.push(c)}processVoiceMeasureReadPlugins(c,r,i){for(const o of this.voiceMeasureReadPlugins)try{o.measureReadCalculations(c,r,i)}catch(n){s.default.info("VoiceGenerator.addSingleNote: ",n)}}}},469(dt,g,u){"use strict";var l=this&&this.__importDefault||function(F){return F&&F.__esModule?F:{default:F}};Object.defineProperty(g,"__esModule",{value:!0}),g.VoiceGenerator=void 0;const s=u(4249),c=u(5534),r=u(1336),i=u(1850),o=u(2369),n=u(8365),h=u(5274),e=u(2257),f=u(4268),m=u(2561),p=u(9767),E=u(6030),y=u(7307),d=u(8233),S=u(8233),M=u(6644),x=l(u(3065)),_=u(8233),I=u(813),T=u(4127),A=u(4064),v=u(4236),B=u(5282),D=u(9647),L=u(6362);g.VoiceGenerator=class{constructor(F,V,j,P,U=void 0){this.openBeams=[],this.beamNumberOffset=0,this.currentOctaveShift=0,this.tupletDict={},this.openTupletNumber=0,this.staff=V,this.instrument=V.ParentInstrument,this.musicSheet=this.instrument.GetMusicSheet,this.slurReader=P,this.pluginManager=F,this.voice=U?new s.LinkedVoice(this.instrument,j,U):new c.Voice(this.instrument,j),this.instrument.Voices.push(this.voice),this.staff.Voices.push(this.voice),this.lyricsReader=new E.LyricsReader(this.musicSheet),this.articulationReader=new T.ArticulationReader(this.musicSheet.Rules)}get openTieDict(){return this.staff.openTieDict}get GetVoice(){return this.voice}get OctaveShift(){return this.currentOctaveShift}set OctaveShift(F){this.currentOctaveShift=F}createVoiceEntry(F,V,j,P=!1,U=!1,Y=!1){this.currentVoiceEntry=new r.VoiceEntry(F.clone(),this.voice,V,P,U,Y),j&&this.voice.VoiceEntries.push(this.currentVoiceEntry)}read(F,V,j,P,U,Y,H,Q,ot,$,it,nt,st,N,C,O,X,W,G,K){this.currentStaffEntry=H,this.currentMeasure=Q;try{this.currentNote=Y?this.addRestNote(F.element("rest"),V,P,j,U,st,N,G):this.addSingleNote(F,V,P,j,U,it,nt,st,N,C,O,X,W,G),this.currentNote.DotsXml=K;const q=F.elements("lyric");void 0!==this.lyricsReader&&q&&(this.lyricsReader.addLyricEntry(q,this.currentVoiceEntry),this.voice.Parent.HasLyrics=!0);let Z=!1;const et=F.element("notations");if(et){this.articulationReader&&this.readArticulations(et,this.currentVoiceEntry,this.currentNote);const ct=et.elements("slur"),pt=et.elements("slide"),gt=et.elements("glissando");void 0!==this.slurReader&&(ct.length>0||pt.length>0)&&!this.currentNote.ParentVoiceEntry.IsGrace&&(this.slurReader.addSlur(ct,this.currentNote),pt.length>0&&this.slurReader.addSlur(pt,this.currentNote),gt.length>0&&this.slurReader.addSlur(gt,this.currentNote));const Et=et.elements("tuplet");Et.length>0&&(this.openTupletNumber=this.addTuplet(F,Et),Z=!0);const St=et.element("arpeggiate");if(void 0!==St){let vt;if(this.currentVoiceEntry.Arpeggio)vt=this.currentVoiceEntry.Arpeggio;else{let _t=!1;for(const At of this.currentStaffEntry.VoiceEntries)if(At.Arpeggio){_t=!0,vt=At.Arpeggio;break}if(!_t){let At=v.ArpeggioType.ARPEGGIO_DIRECTIONLESS;const Nt=St.attribute("direction");if(Nt)switch(Nt.value){case"up":At=v.ArpeggioType.ROLL_UP;break;case"down":At=v.ArpeggioType.ROLL_DOWN;break;default:At=v.ArpeggioType.ARPEGGIO_DIRECTIONLESS}vt=new v.Arpeggio(this.currentVoiceEntry,At),this.currentVoiceEntry.Arpeggio=vt}}vt.addNote(this.currentNote)}const Mt=et.elements("tied");Mt.length>0&&this.addTie(Mt,ot,$,e.TieTypes.SIMPLE);const yt=et.element("technical");if(yt){const vt=yt.elements("hammer-on");vt.length>0&&this.addTie(vt,ot,$,e.TieTypes.HAMMERON);const _t=yt.elements("pull-off");_t.length>0&&this.addTie(_t,ot,$,e.TieTypes.PULLOFF)}}void 0===F.element("time-modification")||Z||this.handleTimeModificationNode(F)}catch(q){x.default.warn(q);const Z=p.ITextTranslation.translateText("ReaderErrorMessages/NoteError","Ignored erroneous Note.");this.musicSheet.SheetErrors.pushMeasureError(Z),this.musicSheet.SheetErrors.pushMeasureError(q)}return this.currentNote}checkForStaffEntryLink(F,V,j,P){const U=new M.StaffEntryLink(this.currentVoiceEntry);U.LinkStaffEntries.push(j),j.Link=U;const Y=this.currentVoiceEntry.Timestamp.clone(),H=P.getVerticalContainerByTimestamp(Y);return(j=H.StaffEntries[F])||(j=new o.SourceStaffEntry(H,V),H.StaffEntries[F]=j),j.VoiceEntries.push(this.currentVoiceEntry),U.LinkStaffEntries.push(j),j.Link=U,j}checkForOpenBeam(){this.openBeams.length>0&&this.currentNote&&this.handleOpenBeam()}checkOpenTies(){const F=this.openTieDict;for(const V in F)if(F.hasOwnProperty(V)){const j=F[V];m.Fraction.plus(j.StartNote.ParentStaffEntry.Timestamp,j.Duration).lt(j.StartNote.SourceMeasure.Duration)&&delete F[V]}}hasVoiceEntry(){return void 0!==this.currentVoiceEntry}readArticulations(F,V,j){const P=F.element("articulations");P&&this.articulationReader.addArticulationExpression(P,V);const U=F.element("fermata");U&&this.articulationReader.addFermata(U,V);const Y=F.element("technical");Y&&this.articulationReader.addTechnicalArticulations(Y,V,j);const H=F.element("ornaments");H&&this.articulationReader.addOrnament(H,V)}addSingleNote(F,V,j,P,U,Y,H,Q,ot,$,it,nt,st,N){let C,O,X,W,G=0,K=d.AccidentalEnum.NONE,q=S.NoteEnum.C,Z=S.NoteEnum.C,et=0,ct=0;const pt=F.elements();for(let At=0,Nt=pt.length;At<Nt;++At){const Bt=pt[At];try{if("pitch"===Bt.name){const Ft=Bt.elements();for(let Ot=0,It=Ft.length;Ot<It;++Ot){const Rt=Ft[Ot];X=void 0,W=void 0;try{if("step"===Rt.name){if(q=S.NoteEnum[Rt.value],void 0===q){const Dt=p.ITextTranslation.translateText("ReaderErrorMessages/NotePitchError","Invalid pitch while reading note.");throw this.musicSheet.SheetErrors.pushMeasureError(Dt),new y.MusicSheetReadingException(Dt,void 0)}}else if("alter"===Rt.name){if(G=parseFloat(Rt.value),isNaN(G)){const Dt=p.ITextTranslation.translateText("ReaderErrorMessages/NoteAlterationError","Invalid alteration while reading note.");throw this.musicSheet.SheetErrors.pushMeasureError(Dt),new y.MusicSheetReadingException(Dt,void 0)}K=_.Pitch.AccidentalFromHalfTones(G)}else if("octave"===Rt.name&&(et=parseInt(Rt.value,10),isNaN(et))){const Dt=p.ITextTranslation.translateText("ReaderErrorMessages/NoteOctaveError","Invalid octave value while reading note.");throw this.musicSheet.SheetErrors.pushMeasureError(Dt),new y.MusicSheetReadingException(Dt,void 0)}}catch(Dt){x.default.info("VoiceGenerator.addSingleNote read Step: ",Dt.message)}}}else if("accidental"===Bt.name)C=Bt.value,"natural"===C?K=d.AccidentalEnum.NATURAL:"slash-flat"===C?K=d.AccidentalEnum.SLASHFLAT:"slash-quarter-sharp"===C?K=d.AccidentalEnum.SLASHQUARTERSHARP:"slash-sharp"===C?K=d.AccidentalEnum.SLASHSHARP:"double-slash-flat"===C?K=d.AccidentalEnum.DOUBLESLASHFLAT:"sori"===C?K=d.AccidentalEnum.SORI:"koron"===C&&(K=d.AccidentalEnum.KORON);else if("unpitched"===Bt.name){const Ft=Bt.element("display-step"),Ot=Bt.element("display-octave");if(Ot&&(et=parseInt(Ot.value,10),ct=et-3,H&&(et+=1),1===this.instrument.Staves[0].StafflineCount&&(ct+=1)),Ft){q=S.NoteEnum[Ft.value.toUpperCase()];let It=0,Rt=this.musicSheet.Rules.PercussionXMLDisplayStepNoteValueShift;1===this.instrument.Staves[0].StafflineCount&&(Rt-=3),[Z,It]=_.Pitch.lineShiftFromNoteEnum(q,Rt),ct+=It}}else"instrument"===Bt.name?Bt.firstAttribute&&(O=Bt.firstAttribute.value):"notehead"===Bt.name&&(X=Bt.value,Bt.attribute("filled")&&(W="yes"===Bt.attribute("filled").value))}catch(Ft){x.default.info("VoiceGenerator.addSingleNote: ",Ft)}}et-=_.Pitch.OctaveXmlDifference;const gt=new _.Pitch(q,et,K,C),Et=m.Fraction.createFromFraction(V);let St,Mt=-1,yt=-1;const vt=[],_t=F.element("notations");if(_t){const At=_t.element("technical");if(At){const Nt=At.element("string");Nt&&(Mt=parseInt(Nt.value,10));const Bt=At.element("fret");Bt&&(yt=parseInt(Bt.value,10)),At.elements("bend").forEach(function(Ft){const Ot=Ft.element("bend-alter");void 0!==Ft.element("release")?vt.push({bendalter:parseInt(Ot.value,10),direction:"down"}):vt.push({bendalter:parseInt(Ot.value,10),direction:"up"})})}}return St=Mt<0||yt<0?new i.Note(this.currentVoiceEntry,this.currentStaffEntry,Et,gt,this.currentMeasure):new D.TabNote(this.currentVoiceEntry,this.currentStaffEntry,Et,gt,this.currentMeasure,Mt,yt,vt),this.addNoteInfo(St,j,Q,ot,U,Z,ct,N,N),St.TypeLength=P,St.IsGraceNote=$,St.StemDirectionXml=it,St.TremoloInfo=nt,St.PlaybackInstrumentId=O,(void 0!==X&&"normal"!==X||void 0!==W)&&(St.Notehead=new A.Notehead(St,X,W)),it===r.StemDirectionType.None&&(st="#00000000"),this.currentVoiceEntry.Notes.push(St),this.currentVoiceEntry.StemDirectionXml=it,st&&(this.currentVoiceEntry.StemColorXml=st,this.currentVoiceEntry.StemColor=st,St.StemColorXml=st),F.elements("beam")&&!Y&&this.createBeam(F,St),St}addRestNote(F,V,j,P,U,Y,H,Q){const ot=m.Fraction.createFromFraction(V),$=F.element("display-step"),it=F.element("display-octave");let nt,st,N;$&&it&&(nt=S.NoteEnum[$.value.toUpperCase()],st=parseInt(it.value,10),N=new _.Pitch(nt,st,d.AccidentalEnum.NONE,void 0,!0));const C=new i.Note(this.currentVoiceEntry,this.currentStaffEntry,ot,N,this.currentMeasure,!0);return this.addNoteInfo(C,j,Y,H,U,nt,st,Q,Q),C.TypeLength=P,this.currentVoiceEntry.Notes.push(C),this.openBeams.length>0&&this.openBeams.last().ExtendedNoteList.push(C),C}addNoteInfo(F,V,j,P,U,Y,H,Q,ot){F.NoteTypeXml=V,F.PrintObject=j,F.IsCueNote=P,F.NormalNotes=U,F.displayStepUnpitched=Y,F.displayOctaveUnpitched=H,F.NoteheadColorXml=Q,F.NoteheadColor=Q}createBeam(F,V){try{const j=F.element("beam");let P;if(void 0!==j&&j.hasAttributes&&(P=j.attribute("number")),P){let U=parseInt(P.value,10);const Y=F.elements("beam"),H=Y[0].value;Y&&("begin"===H?(U===this.openBeams.last()?.BeamNumber?(this.beamNumberOffset++,U+=this.beamNumberOffset):this.openBeams.last()&&this.handleOpenBeam(),this.openBeams.push(new n.Beam(U,this.beamNumberOffset))):U+=this.beamNumberOffset);let Q=!1;if(!(U>0&&U<=this.openBeams.length&&this.openBeams[U-1]))return void x.default.debug("[OSMD] invalid beamnumber");for(let ot=0,$=this.openBeams[U-1].Notes.length;ot<$;++ot)this.currentVoiceEntry===this.openBeams[U-1].Notes[ot].ParentVoiceEntry&&(Q=!0);if(!Q){const ot=this.openBeams[U-1];if(ot.addNoteToBeam(V),"continue"===H&&Y.length>1)for(let $=1;$<Y.length;$++)if("end"===Y[$].value){const it=ot.Notes.length-1;it>0&&ot.SecondaryBreakIndices.push(it);break}"end"===H&&this.endBeam()}}}catch(j){const P=p.ITextTranslation.translateText("ReaderErrorMessages/BeamError","Error while reading beam.");throw this.musicSheet.SheetErrors.pushMeasureError(P),new y.MusicSheetReadingException("",j)}}endBeam(){this.openBeams.pop(),this.beamNumberOffset=Math.max(0,this.beamNumberOffset-1)}handleOpenBeam(){const F=this.openBeams.last();if(0!==F.Notes.length){if(1===F.Notes.length)return F.Notes[0].NoteBeam=void 0,void this.endBeam();if(this.currentNote===I.CollectionUtil.last(F.Notes))this.endBeam();else{const V=I.CollectionUtil.last(F.Notes).ParentStaffEntry,j=this.currentMeasure.getVerticalContainerIndexByTimestamp(V.Timestamp),P=V.VerticalContainerParent.StaffEntries.indexOf(V);if(j<this.currentMeasure.VerticalSourceStaffEntryContainers.length-1){const U=this.currentMeasure.VerticalSourceStaffEntryContainers[j+1].StaffEntries[P];if(U)for(let Y=0,H=U.VoiceEntries.length;Y<H;++Y){const Q=U.VoiceEntries[Y];if(Q.ParentVoice===this.voice){const ot=Q.Notes[0];ot.Length.lte(new m.Fraction(1,8))?(this.openBeams.last().addNoteToBeam(ot),this.endBeam()):this.endBeam()}}}else this.endBeam()}}else this.endBeam()}addTuplet(F,V){let j,P=!1;if(void 0!==V&&V.length>1){let U=F.element("time-modification");U&&(U=U.element("actual-notes"));const Y=V;for(let H=0,Q=Y.length;H<Q;++H){const ot=Y[H];if(void 0!==ot&&ot.attributes()){const $=ot.attribute("bracket");$&&"yes"===$.value?(P=!0,j=!0):$&&"no"===$.value&&(j=!1);let it=this.musicSheet.Rules.TupletsRatioed;const nt=ot.attribute("show-number");nt&&"both"===nt.value&&this.musicSheet.Rules.TupletsRatioedUseXMLValue&&(it=!0);const st=this.readShowNumberNoneGiven(ot),N=ot.attribute("type");if(N&&"start"===N.value){let C=1;ot.attribute("number")&&(C=parseInt(ot.attribute("number").value,10));let O=0;if(U&&(O=parseInt(U.value,10),isNaN(O))){const K=p.ITextTranslation.translateText("ReaderErrorMessages/TupletNoteDurationError","Invalid tuplet note duration.");throw this.musicSheet.SheetErrors.pushMeasureError(K),new y.MusicSheetReadingException(K,void 0)}const X=new f.Tuplet(O,P);
1X.Ratioed=it,X.BracketedXmlValue=j,X.ShowNumberNoneGivenInXml=st,X.tupletLabelNumberPlacement=L.PlacementEnum.Above;const W=ot.attribute("placement");W&&("below"===W.value&&(X.tupletLabelNumberPlacement=L.PlacementEnum.Below),X.PlacementFromXml=!0),this.tupletDict[C]&&(delete this.tupletDict[C],0===Object.keys(this.tupletDict).length?this.openTupletNumber=0:Object.keys(this.tupletDict).length>1&&this.openTupletNumber--),this.tupletDict[C]=X;const G=[];G.push(this.currentNote),X.Notes.push(G),X.Fractions.push(this.getTupletNoteDurationFromType(F)),this.currentNote.NoteTuplet=X,this.openTupletNumber=C}else if("stop"===N.value){let C=1;ot.attribute("number")&&(C=parseInt(ot.attribute("number").value,10));const O=this.tupletDict[C];if(O){const X=ot.attribute("placement");X&&(O.tupletLabelNumberPlacement="below"===X.value?L.PlacementEnum.Below:L.PlacementEnum.Above,O.PlacementFromXml=!0);const W=[];if(W.push(this.currentNote),O.Notes.push(W),!O.PlacementFromXml){let G=!1;for(const K of O.Notes){for(const q of K)if(!q.isRest()){O.tupletLabelNumberPlacement=q.StemDirectionXml===r.StemDirectionType.Down?L.PlacementEnum.Below:L.PlacementEnum.Above,G=!0;break}if(G)break}}O.Fractions.push(this.getTupletNoteDurationFromType(F)),this.currentNote.NoteTuplet=O,delete this.tupletDict[C],0===Object.keys(this.tupletDict).length?this.openTupletNumber=0:Object.keys(this.tupletDict).length>1&&this.openTupletNumber--}}}}}else if(V[0]){const U=V[0];if(U.hasAttributes){const Y=U.attribute("type").value;let H=1;U.attribute("number")&&(H=parseInt(U.attribute("number").value,10));const Q=isNaN(H),ot=this.readShowNumberNoneGiven(U),$=U.attribute("bracket");$&&"yes"===$.value?(P=!0,j=!0):$&&"no"===$.value&&(j=!1);let it=this.musicSheet.Rules.TupletsRatioed;const nt=U.attribute("show-number");if(nt&&"both"===nt.value&&this.musicSheet.Rules.TupletsRatioedUseXMLValue&&(it=!0),"start"===Y){let st=0,N=F.element("time-modification");if(N&&(N=N.element("actual-notes")),N&&(st=parseInt(N.value,10),isNaN(st))){const W=p.ITextTranslation.translateText("ReaderErrorMessages/TupletNoteDurationError","Invalid tuplet note duration.");throw this.musicSheet.SheetErrors.pushMeasureError(W),new y.MusicSheetReadingException(W)}Q&&(this.openTupletNumber++,H=this.openTupletNumber);let C=this.tupletDict[H];C||(C=this.tupletDict[H]=new f.Tuplet(st,P),C.Ratioed=it,C.BracketedXmlValue=j,C.ShowNumberNoneGivenInXml=ot,C.tupletLabelNumberPlacement=L.PlacementEnum.Above);const O=U.attribute("placement");O&&(C.tupletLabelNumberPlacement="below"===O.value?L.PlacementEnum.Below:L.PlacementEnum.Above,C.PlacementFromXml=!0);const X=[];X.push(this.currentNote),C.Notes.push(X),C.Fractions.push(this.getTupletNoteDurationFromType(F)),this.currentNote.NoteTuplet=C,this.openTupletNumber=H}else if("stop"===Y){Q&&(H=this.openTupletNumber);const st=this.tupletDict[this.openTupletNumber];if(st){const N=U.attribute("placement");N&&(st.tupletLabelNumberPlacement="below"===N.value?L.PlacementEnum.Below:L.PlacementEnum.Above,st.PlacementFromXml=!0);const C=[];if(C.push(this.currentNote),st.Notes.push(C),!st.PlacementFromXml){let O=!1;for(const X of st.Notes){for(const W of X)if(!W.isRest()){st.tupletLabelNumberPlacement=W.StemDirectionXml===r.StemDirectionType.Down?L.PlacementEnum.Below:L.PlacementEnum.Above,O=!0;break}if(O)break}}st.Fractions.push(this.getTupletNoteDurationFromType(F)),this.currentNote.NoteTuplet=st,0===Object.keys(this.tupletDict).length?this.openTupletNumber=0:Object.keys(this.tupletDict).length>1&&this.openTupletNumber--,delete this.tupletDict[H]}}}}return this.openTupletNumber}readShowNumberNoneGiven(F){const V=F.attribute("show-number");return!(!V?.value||"none"!==V.value)}handleTimeModificationNode(F){if(this.tupletDict[this.openTupletNumber])try{const V=this.tupletDict[this.openTupletNumber],j=I.CollectionUtil.last(V.Notes);let P;j[0].ParentVoiceEntry.Timestamp.Equals(this.currentVoiceEntry.Timestamp)?P=j:(P=[],V.Notes.push(P),V.Fractions.push(this.getTupletNoteDurationFromType(F))),P.push(this.currentNote),this.currentNote.NoteTuplet=V}catch(V){const j=p.ITextTranslation.translateText("ReaderErrorMessages/TupletNumberError","Invalid tuplet number.");throw this.musicSheet.SheetErrors.pushMeasureError(j),V}else if(this.currentVoiceEntry.Notes.length>0){const V=this.currentVoiceEntry.Notes[0];if(V.NoteTuplet){const j=V.NoteTuplet;I.CollectionUtil.last(j.Notes).push(this.currentNote),this.currentNote.NoteTuplet=j}}}addTie(F,V,j,P){if(F)if(1===F.length){const U=F[0];if(void 0!==U&&U.attributes()){const Y=this.getTieDirection(U),H=U.attribute("type").value;try{if("start"===H){const Q=this.findCurrentNoteInTieDict(this.currentNote);Q<0&&delete this.openTieDict[Q];const ot=this.getNextAvailableNumberForTie(),$=new h.Tie(this.currentNote,P);this.openTieDict[ot]=$,$.TieNumber=ot,$.TieDirection=Y}else if("stop"===H){const Q=this.findCurrentNoteInTieDict(this.currentNote),ot=this.openTieDict[Q];ot&&(ot.AddNote(this.currentNote),delete this.openTieDict[Q])}}catch{const ot=p.ITextTranslation.translateText("ReaderErrorMessages/TieError","Error while reading tie.");this.musicSheet.SheetErrors.pushMeasureError(ot)}}}else if(2===F.length){const U=this.findCurrentNoteInTieDict(this.currentNote);if(U>=0){const Y=this.openTieDict[U];Y.AddNote(this.currentNote);for(const H of F)if("start"===H.attribute("type").value){const Q=this.getTieDirection(H);
vendor: 14,787 bytes, line 1
1Y.NoteIndexToTieDirection[Y.Notes.length-1]=Q}}}}getTieDirection(F){let V=L.PlacementEnum.NotYetDefined;const j=F.attribute("placement");j&&("above"===j.value?V=L.PlacementEnum.Above:"below"===j.value&&(V=L.PlacementEnum.Below));const P=F.attribute("orientation");return P&&("over"===P.value?V=L.PlacementEnum.Above:"under"===P.value&&(V=L.PlacementEnum.Below)),V}getNextAvailableNumberForTie(){const F=Object.keys(this.openTieDict);if(0===F.length)return 1;F.sort((V,j)=>+V-+j);for(let V=0;V<F.length;V++)if(""+(V+1)!==F[V])return V+1;return+F[F.length-1]+1}findCurrentNoteInTieDict(F){const V=this.openTieDict;for(const j in V)if(V.hasOwnProperty(j)){const P=V[j],U=P.Notes[0];if(P.Pitch.FundamentalNote===F.Pitch.FundamentalNote&&P.Pitch.Octave===F.Pitch.Octave||void 0!==U.StringNumberTab&&U.StringNumberTab===F.StringNumberTab)return parseInt(j,10)}return-1}getTupletNoteDurationFromType(F){if(F.element("type")){const V=F.element("type");if(V){const j=V.value;try{return B.NoteTypeHandler.getNoteDurationFromType(j)}catch(P){const U=p.ITextTranslation.translateText("ReaderErrorMessages/NoteDurationError","Invalid note duration.");throw this.musicSheet.SheetErrors.pushMeasureError(U),new y.MusicSheetReadingException("",P)}}}}}},6352(dt,g,u){"use strict";var l=this&&this.__createBinding||(Object.create?function(c,r,i,o){void 0===o&&(o=i);var n=Object.getOwnPropertyDescriptor(r,i);n&&!("get"in n?!r.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return r[i]}}),Object.defineProperty(c,o,n)}:function(c,r,i,o){void 0===o&&(o=i),c[o]=r[i]}),s=this&&this.__exportStar||function(c,r){for(var i in c)"default"===i||Object.prototype.hasOwnProperty.call(r,i)||l(r,c,i)};Object.defineProperty(g,"__esModule",{value:!0}),s(u(1272),g),s(u(9099),g),s(u(5749),g),s(u(469),g),s(u(302),g),s(u(7503),g)},5294(dt,g,u){"use strict";var l=this&&this.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(g,"__esModule",{value:!0}),g.SubInstrument=void 0;const s=u(164),c=l(u(3065));class r{constructor(o){this.parentInstrument=o,this.fixedKey=-1,this.name=this.parseMidiInstrument(this.parentInstrument.Name),this.midiInstrumentID=r.midiInstrument[this.name],this.volume=1}get ParentInstrument(){return this.parentInstrument}static isPianoInstrument(o){return o===s.MidiInstrument.Acoustic_Grand_Piano||o===s.MidiInstrument.Bright_Acoustic_Piano||o===s.MidiInstrument.Electric_Grand_Piano||o===s.MidiInstrument.Electric_Piano_1||o===s.MidiInstrument.Electric_Piano_2}setMidiInstrument(o){this.midiInstrumentID=r.midiInstrument[this.parseMidiInstrument(o)]}parseMidiInstrument(o){try{if(o){const n=o.toLowerCase().trim();for(const h in r.midiInstrument)if(-1!==n.indexOf(h))return h}if(this.parentInstrument.Name){const n=this.parentInstrument.Name.toLowerCase().trim();for(const h in r.midiInstrument)if(-1!==n.indexOf(h))return h}}catch{c.default.error("Error parsing MIDI Instrument. Default to Grand Piano.")}return"unnamed"}}g.SubInstrument=r,r.midiInstrument={alt:s.MidiInstrument.Synth_Voice,alto:s.MidiInstrument.Synth_Voice,banjo:s.MidiInstrument.Banjo,bariton:s.MidiInstrument.Synth_Voice,baritone:s.MidiInstrument.Synth_Voice,bass:s.MidiInstrument.Synth_Voice,blockfloete:s.MidiInstrument.Recorder,brass:s.MidiInstrument.Trombone,bratsche:s.MidiInstrument.Viola,cello:s.MidiInstrument.Cello,clarinet:s.MidiInstrument.Clarinet,contrabass:s.MidiInstrument.Contrabass,drums:s.MidiInstrument.Percussion,flute:s.MidiInstrument.Flute,floete:s.MidiInstrument.Flute,frenchhorn:s.MidiInstrument.French_Horn,gitarre:s.MidiInstrument.Acoustic_Guitar_nylon,guitar:s.MidiInstrument.Acoustic_Guitar_nylon,harfe:s.MidiInstrument.Orchestral_Harp,harp:s.MidiInstrument.Orchestral_Harp,klarinette:s.MidiInstrument.Clarinet,klavier:s.MidiInstrument.Acoustic_Grand_Piano,kontrabass:s.MidiInstrument.Contrabass,oboe:s.MidiInstrument.Oboe,organ:s.MidiInstrument.Church_Organ,orgel:s.MidiInstrument.Church_Organ,orgue:s.MidiInstrument.Church_Organ,percussion:s.MidiInstrument.Percussion,piano:s.MidiInstrument.Acoustic_Grand_Piano,piccolo:s.MidiInstrument.Piccolo,posaune:s.MidiInstrument.Trombone,recorder:s.MidiInstrument.Recorder,sax:s.MidiInstrument.Tenor_Sax,schlagwerk:s.MidiInstrument.Percussion,schlagzeug:s.MidiInstrument.Percussion,sopran:s.MidiInstrument.Synth_Voice,steeldrum:s.MidiInstrument.Steel_Drums,streicher:s.MidiInstrument.String_Ensemble_1,strings:s.MidiInstrument.String_Ensemble_1,tenor:s.MidiInstrument.Synth_Voice,tpt:s.MidiInstrument.Trumpet,trombone:s.MidiInstrument.Trombone,trompete:s.MidiInstrument.Trumpet,trumpet:s.MidiInstrument.Trumpet,tuba:s.MidiInstrument.Tuba,unnamed:s.MidiInstrument.Acoustic_Grand_Piano,viola:s.MidiInstrument.Viola,violin:s.MidiInstrument.Violin,"violon-c":s.MidiInstrument.Cello,"violon.":s.MidiInstrument.Violin,voice:s.MidiInstrument.Synth_Voice,woodblock:s.MidiInstrument.Woodblock}},4236(dt,g){"use strict";var u,l;Object.defineProperty(g,"__esModule",{value:!0}),g.ArpeggioType=g.Arpeggio=void 0,g.Arpeggio=class{constructor(l,s=u.ARPEGGIO_DIRECTIONLESS){this.parentVoiceEntry=l,this.type=s,this.notes=[]}addNote(l){this.notes.push(l),l.Arpeggio=this}},(l=u||(g.ArpeggioType=u={}))[l.BRUSH_DOWN=1]="BRUSH_DOWN",l[l.BRUSH_UP=2]="BRUSH_UP",l[l.ROLL_DOWN=3]="ROLL_DOWN",l[l.ROLL_UP=4]="ROLL_UP",l[l.RASQUEDO_DOWN=5]="RASQUEDO_DOWN",l[l.RASQUEDO_UP=6]="RASQUEDO_UP",l[l.ARPEGGIO_DIRECTIONLESS=7]="ARPEGGIO_DIRECTIONLESS"},9003(dt,g){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.Articulation=void 0,g.Articulation=class{constructor(u,l){this.articulationEnum=u,this.placement=l}Equals(u){return u.articulationEnum===this.articulationEnum&&u.placement===this.placement}}},8365(dt,g){"use strict";var u,l;Object.defineProperty(g,"__esModule",{value:!0}),g.BeamEnum=g.Beam=void 0,g.Beam=class{constructor(l=1,s=0){this.notes=[],this.extendedNoteList=[],this.BeamNumberOffsetToXML=0,this.AutoGenerated=!1,this.SecondaryBreakIndices=[],this.BeamNumber=l,this.BeamNumberOffsetToXML=s}get Notes(){return this.notes}set Notes(l){this.notes=l}get ExtendedNoteList(){return this.extendedNoteList}set ExtendedNoteList(l){this.extendedNoteList=l}addNoteToBeam(l){l&&(l.NoteBeam=this,this.notes.push(l),this.extendedNoteList.push(l))}},(l=u||(g.BeamEnum=u={}))[l.BeamNone=-1]="BeamNone",l[l.BeamBegin=0]="BeamBegin",l[l.BeamContinue=1]="BeamContinue",l[l.BeamEnd=2]="BeamEnd",l[l.BeamForward=3]="BeamForward",l[l.BeamBackward=4]="BeamBackward"},9719(dt,g,u){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.ChordSymbolEnum=g.ChordDegreeText=g.CustomChord=g.Degree=g.ChordSymbolContainer=void 0;const l=u(8233),s=u(7921),c=u(8233),r=u(6362);g.ChordSymbolContainer=class{constructor(h,e,f,m,p,E=r.PlacementEnum.Above){this.rootPitch=h,this.chordKind=e,this.bassPitch=f,this.degrees=m,this.rules=p,this.Placement=E}get RootPitch(){return this.rootPitch}get ChordKind(){return this.chordKind}get BassPitch(){return this.bassPitch}get ChordDegrees(){return this.degrees}static calculateChordText(h,e,f){if(void 0!==h.NumeralText)return h.NumeralText;let m=h.RootPitch;if(s.MusicSheetCalculator.transposeCalculator&&(m=s.MusicSheetCalculator.transposeCalculator.transposePitch(h.RootPitch,f,e)),h.ChordKind===n.none)return h.getTextFromChordKindEnum(h.ChordKind);let p=l.Pitch.getNoteEnumString(m.FundamentalNote);m.Accidental!==c.AccidentalEnum.NONE&&(p+=h.getTextForAccidental(m.Accidental));const E={adds:[],alts:[],subs:[]};for(const M of h.ChordDegrees)if(M){let x="";switch(M.alteration!==c.AccidentalEnum.NONE&&(x+=h.getTextForAccidental(M.alteration)),x+=M.value,M.text){case o.add:E.adds.push(x);break;case o.alter:E.alts.push(x);break;case o.subtract:E.subs.push(x)}}let y=h.getTextFromChordKindEnum(h.ChordKind);const d=["adds","alts","subs"],S=h.rules.CustomChords;for(const M of S){if(M.chordKind!==h.chordKind)continue;let x=!0;for(const _ of d){for(const I of M.degrees[_]||[])if(E[_].indexOf(I)<0){x=!1;break}if(!x)break}if(x){for(const _ of d)for(const I of M.degrees[_]||[])E[_].splice(E[_].indexOf(I),1);y=M.alternateName}}if(p+=y,E.adds.length>0&&(p+="("+E.adds.join(",")+")"),E.alts.length>0&&(p+="(alt "+E.alts.join(",")+")"),E.subs.length>0&&(p+="(omit "+E.subs.join(",")+")"),h.BassPitch){let M=h.BassPitch;s.MusicSheetCalculator.transposeCalculator&&(M=s.MusicSheetCalculator.transposeCalculator.transposePitch(h.BassPitch,f,e)),p+="/",p+=l.Pitch.getNoteEnumString(M.FundamentalNote),p+=h.getTextForAccidental(M.Accidental)}return p}getTextForAccidental(h){const e=this.rules.ChordAccidentalTexts.getValue(h);return void 0!==e?e:""}getTextFromChordKindEnum(h){return this.rules.ChordSymbolLabelTexts.getValue(h)??""}},g.Degree=class{constructor(h,e,f){this.value=h,this.alteration=e,this.text=f}};class i{constructor(e,f,m){this.alternateName=e,this.chordKind=f,this.degrees=m}static createCustomChord(e,f,m){return new i(e,f,m)}static renameCustomChord(e,f,m){for(const p of m)p.alternateName===e&&(p.alternateName=f)}}var o,n,h;g.CustomChord=i,(h=o||(g.ChordDegreeText=o={}))[h.add=0]="add",h[h.alter=1]="alter",h[h.subtract=2]="subtract",function(h){h[h.major=0]="major",h[h.minor=1]="minor",h[h.augmented=2]="augmented",h[h.diminished=3]="diminished",h[h.dominant=4]="dominant",h[h.majorseventh=5]="majorseventh",h[h.minorseventh=6]="minorseventh",h[h.diminishedseventh=7]="diminishedseventh",h[h.augmentedseventh=8]="augmentedseventh",h[h.halfdiminished=9]="halfdiminished",h[h.majorminor=10]="majorminor",h[h.majorsixth=11]="majorsixth",h[h.minorsixth=12]="minorsixth",h[h.dominantninth=13]="dominantninth",h[h.majorninth=14]="majorninth",h[h.minorninth=15]="minorninth",h[h.dominant11th=16]="dominant11th",h[h.major11th=17]="major11th",h[h.minor11th=18]="minor11th",h[h.dominant13th=19]="dominant13th",h[h.major13th=20]="major13th",h[h.minor13th=21]="minor13th",h[h.suspendedsecond=22]="suspendedsecond",h[h.suspendedfourth=23]="suspendedfourth",h[h.Neapolitan=24]="Neapolitan",h[h.Italian=25]="Italian",h[h.French=26]="French",h[h.German=27]="German",h[h.pedal=28]="pedal",h[h.power=29]="power",h[h.Tristan=30]="Tristan",h[h.none=31]="none"}(n||(g.ChordSymbolEnum=n={}))},6362(dt,g){"use strict";var u,l;Object.defineProperty(g,"__esModule",{value:!0}),g.PlacementEnum=g.AbstractExpression=void 0,g.AbstractExpression=class{constructor(l){this.placement=l}static isStringInStringList(l,s){for(let c=0,r=l.length;c<r;++c){const i=l[c];if(s.toLowerCase()===i.toLowerCase().trim())return!0}return!1}get Placement(){return this.placement}static PlacementEnumFromString(l){switch(l.toLowerCase()){case"above":return u.Above;case"below":return u.Below;case"aboveorbelow":case"abovebelow":return u.AboveOrBelow;case"left":return u.Left;case"right":return u.Right;default:return u.NotYetDefined}}},(l=u||(g.PlacementEnum=u={}))[l.Above=0]="Above",l[l.Below=1]="Below",l[l.Left=2]="Left",l[l.Right=3]="Right",l[l.NotYetDefined=4]="NotYetDefined",l[l.AboveOrBelow=5]="AboveOrBelow"},9147(dt,g,u){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.AbstractTempoExpression=void 0;const l=u(6362);class s extends l.AbstractExpression{constructor(r,i,o,n){super(i),this.label=r,this.staffNumber=o,this.parentMultiTempoExpression=n}get Label(){return this.label}set Label(r){this.label=r}get Placement(){return this.placement}set Placement(r){this.placement=r}get StaffNumber(){return this.staffNumber}set StaffNumber(r){this.staffNumber=r}get ParentMultiTempoExpression(){return this.parentMultiTempoExpression}static isStringInStringList(r,i){for(const o of r)if(s.stringContainsSeparatedWord(i.toLowerCase().trim(),o.toLowerCase().trim()))return!0;return!1}static stringContainsSeparatedWord(r,i){return r===i||-1!==r.indexOf(" "+i)||-1!==r.indexOf(i+" ")}}g.AbstractTempoExpression=s},5875(dt,g,u){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.ContDynamicEnum=g.ContinuousDynamicExpression=void 0;const l=u(6362),s=u(2561);class c extends l.AbstractExpression{constructor(o,n,h,e,f,m=""){super(n),this.parentMeasure=e,this.NumberXml=f,this.dynamicType=o,this.label=m,this.staffNumber=h,this.startVolume=-1,this.endVolume=-1,""!==m&&this.setType()}get DynamicType(){return this.dynamicType}set DynamicType(o){this.dynamicType=o}get StartMultiExpression(){return this.startMultiExpression}set StartMultiExpression(o){this.startMultiExpression=o}get EndMultiExpression(){return this.endMultiExpression}set EndMultiExpression(o){this.endMultiExpression=o}get Placement(){return this.placement}set Placement(o){this.placement=o}get StartVolume(){return this.startVolume}set StartVolume(o){this.startVolume=o}get EndVolume(){return this.endVolume}set EndVolume(o){this.endVolume=o}get StaffNumber(){return this.staffNumber}set StaffNumber(o){this.staffNumber=o}get Label(){return this.label}set Label(o){this.label=o,this.setType()}static isInputStringContinuousDynamic(o){return!!o&&(c.isStringInStringList(c.listContinuousDynamicIncreasing,o)||c.isStringInStringList(c.listContinuousDynamicDecreasing,o))}getInterpolatedDynamic(o){const n=this.StartMultiExpression.AbsoluteTimestamp;let h;if(h=this.EndMultiExpression?this.EndMultiExpression.AbsoluteTimestamp:s.Fraction.plus(this.startMultiExpression.SourceMeasureParent.AbsoluteTimestamp,this.startMultiExpression.SourceMeasureParent.Duration),o.lt(n))return-1;if(h.lt(o))return-2;const e=s.Fraction.minus(o,n).RealValue/s.Fraction.minus(h,n).RealValue;return Math.max(0,Math.min(99.9,this.startVolume+(this.endVolume-this.startVolume)*e))}isWedge(){return!this.label}setType(){c.isStringInStringList(c.listContinuousDynamicIncreasing,this.label)?this.dynamicType=r.crescendo:c.isStringInStringList(c.listContinuousDynamicDecreasing,this.label)&&(this.dynamicType=r.diminuendo)}}var r,i;g.ContinuousDynamicExpression=c,c.listContinuousDynamicIncreasing=["crescendo","cresc","cresc.","cres."],c.listContinuousDynamicDecreasing=["decrescendo","decresc","decr.","diminuendo","dim.","dim"],(i=r||(g.ContDynamicEnum=r={}))[i.crescendo=0]="crescendo",i[i.diminuendo=1]="diminuendo"},2221(dt,g,u){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.ContinuousTempoType=g.ContinuousTempoExpression=void 0;const l=u(2561),s=u(9147);class c extends s.AbstractTempoExpression{constructor(o,n,h,e){super(o,n,h,e),this.setTempoType()}static isInputStringContinuousTempo(o){return!!o&&(o.endsWith(".")&&(o=o.substring(0,o.length-1)),c.isStringInStringList(c.listContinuousTempoFaster,o)||c.isStringInStringList(c.listContinuousTempoSlower,o))}static isIncreasingTempo(o){return o<=r.piuMosso}static isDecreasingTempo(o){return o>=r.allargando&&o<=r.ritenuto}get TempoType(){return this.tempoType}set TempoType(o){this.tempoType=o}get StartTempo(){return this.startTempo}set StartTempo(o){this.startTempo=o}get EndTempo(){return this.endTempo}set EndTempo(o){this.endTempo=o}
1get AbsoluteStartTimestamp(){return l.Fraction.plus(this.parentMultiTempoExpression.SourceMeasureParent.AbsoluteTimestamp,this.parentMultiTempoExpression.Timestamp)}get AbsoluteEndTimestamp(){return this.absoluteEndTimestamp}set AbsoluteEndTimestamp(o){this.absoluteEndTimestamp=o,this.AbsoluteTimeSpan=l.Fraction.minus(this.AbsoluteEndTimestamp,this.AbsoluteStartTimestamp).RealValue}get AbsoluteTimestamp(){return this.ParentMultiTempoExpression.AbsoluteTimestamp}getAbsoluteFloatTimestamp(){return this.ParentMultiTempoExpression.AbsoluteTimestamp.RealValue}getInterpolatedTempo(o){const n=l.Fraction.plus(this.parentMultiTempoExpression.SourceMeasureParent.AbsoluteTimestamp,this.parentMultiTempoExpression.Timestamp);if(o.lt(n))return-1;if(this.absoluteEndTimestamp.lt(o))return-2;const h=l.Fraction.minus(o,n).RealValue/l.Fraction.minus(this.absoluteEndTimestamp,n).RealValue;return Math.max(0,Math.min(250,this.startTempo+(this.endTempo-this.startTempo)*h))}setTempoType(){c.isStringInStringList(c.listContinuousTempoFaster,this.label)?this.tempoType=r.accelerando:c.isStringInStringList(c.listContinuousTempoSlower,this.label)&&(this.tempoType=r.ritardando)}getTempoFactor(o=this.Label){return 1}}var r,i;g.ContinuousTempoExpression=c,c.listContinuousTempoFaster=["accelerando","accel","piu mosso","poco piu","stretto"],c.listContinuousTempoSlower=["poco meno","meno mosso","piu lento","calando","allargando","rallentando","ritardando","ritenuto","ritard.","ritard","rit.","rit","riten.","riten"],(i=r||(g.ContinuousTempoType=r={}))[i.accelerando=0]="accelerando",i[i.stretto=1]="stretto",i[i.stringendo=2]="stringendo",i[i.mosso=3]="mosso",i[i.piuMosso=4]="piuMosso",i[i.allargando=5]="allargando",i[i.calando=6]="calando",i[i.menoMosso=7]="menoMosso",i[i.rallentando=8]="rallentando",i[i.ritardando=9]="ritardando",i[i.ritard=10]="ritard",i[i.rit=11]="rit",i[i.ritenuto=12]="ritenuto",i[i.rubato=13]="rubato",i[i.precipitando=14]="precipitando"},437(dt,g,u){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.OctaveEnum=g.OctaveShift=void 0;const l=u(8233);var s,c;g.OctaveShift=class{constructor(c,r){this.numberXml=1,this.endVoiceEntryIndex=0,this.setOctaveShiftValue(c,r)}get Type(){return this.octaveValue}set Type(c){this.octaveValue=c}get StaffNumber(){return this.staffNumber}set StaffNumber(c){this.staffNumber=c}get ParentStartMultiExpression(){return this.startMultiExpression}set ParentStartMultiExpression(c){this.startMultiExpression=c}get ParentEndMultiExpression(){return this.endMultiExpression}set ParentEndMultiExpression(c){this.endMultiExpression=c}setOctaveShiftValue(c,r){this.octaveValue=1===r&&"down"===c?s.VA8:1===r&&"up"===c?s.VB8:2===r&&"down"===c?s.MA15:2===r&&"up"===c?s.MB15:s.NONE}static getPitchFromOctaveShift(c,r){if(!c)return;if(c.OctaveShiftApplied)return c;let i=c.Octave;switch(r){case s.VA8:i-=1;break;case s.VB8:i+=1;break;case s.MA15:i-=2;break;case s.MB15:i+=2;break;default:i+=0}const o=new l.Pitch(c.FundamentalNote,i,c.Accidental);return o.OctaveShiftApplied=!0,o}},(c=s||(g.OctaveEnum=s={}))[c.VA8=0]="VA8",c[c.VB8=1]="VB8",c[c.MA15=2]="MA15",c[c.MB15=3]="MB15",c[c.NONE=4]="NONE"},3253(dt,g){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.Pedal=void 0,g.Pedal=class{constructor(u=!1,l=!0){this.ChangeEnd=!1,this.ChangeBegin=!1,this.EndsStave=!1,this.BeginsStave=!1,this.line=u,this.sign=l}get IsLine(){return this.line}get IsSign(){return this.sign}}},6229(dt,g,u){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.Slur=void 0;const l=u(2561);g.Slur=class{constructor(){}get StartNote(){return this.startNote}set StartNote(s){this.startNote=s}get EndNote(){return this.endNote}set EndNote(s){this.endNote=s}startNoteHasMoreStartingSlurs(){if(!this.startNote)return!1;for(let s=0,c=this.startNote.NoteSlurs.length;s<c;++s){const r=this.startNote.NoteSlurs[s];if(r!==this&&r.StartNote===this.startNote)return!0}return!1}endNoteHasMoreEndingSlurs(){if(!this.endNote)return!1;for(let s=0,c=this.endNote.NoteSlurs.length;s<c;++s){const r=this.endNote.NoteSlurs[s];if(r!==this&&r.EndNote===this.endNote)return!0}return!1}isCrossed(){return this.startNote.ParentStaffEntry.ParentStaff!==this.endNote.ParentStaffEntry.ParentStaff}isSlurLonger(){if(!this.endNote||!this.startNote)return!1;const s=l.Fraction.minus(this.endNote.getAbsoluteTimestamp(),this.startNote.getAbsoluteTimestamp());for(let c=0,r=this.startNote.NoteSlurs.length;c<r;++c){const i=this.startNote.NoteSlurs[c];if(i!==this&&void 0!==i.EndNote&&void 0!==i.StartNote&&-1===l.Fraction.minus(i.EndNote.getAbsoluteTimestamp(),i.StartNote.getAbsoluteTimestamp()).CompareTo(s))return!0}for(let c=0,r=this.endNote.NoteSlurs.length;c<r;++c){const i=this.endNote.NoteSlurs[c];if(i!==this&&void 0!==i.EndNote&&void 0!==i.StartNote&&l.Fraction.minus(i.EndNote.getAbsoluteTimestamp(),i.StartNote.getAbsoluteTimestamp()).CompareTo(s))return!0}return!1}}},6206(dt,g,u){"use strict";
1Object.defineProperty(g,"__esModule",{value:!0}),g.WavyLine=void 0;const l=u(6362);g.WavyLine=class s extends l.AbstractExpression{constructor(r){super(r)}}},8045(dt,g,u){"use strict";var l=this&&this.__createBinding||(Object.create?function(c,r,i,o){void 0===o&&(o=i);var n=Object.getOwnPropertyDescriptor(r,i);n&&!("get"in n?!r.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return r[i]}}),Object.defineProperty(c,o,n)}:function(c,r,i,o){void 0===o&&(o=i),c[o]=r[i]}),s=this&&this.__exportStar||function(c,r){for(var i in c)"default"===i||Object.prototype.hasOwnProperty.call(r,i)||l(r,c,i)};Object.defineProperty(g,"__esModule",{value:!0}),s(u(5875),g),s(u(2221),g),s(u(437),g),s(u(6229),g)},6990(dt,g){"use strict";var u,l;Object.defineProperty(g,"__esModule",{value:!0}),g.DynamicExpressionSymbolEnum=void 0,(l=u||(g.DynamicExpressionSymbolEnum=u={}))[l.p=0]="p",l[l.f=1]="f",l[l.s=2]="s",l[l.z=3]="z",l[l.m=4]="m",l[l.r=5]="r"},2148(dt,g,u){"use strict";var l=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(g,"__esModule",{value:!0}),g.DynamicEnum=g.InstantaneousDynamicExpression=void 0;const s=u(6362),c=u(6990),r=u(7307),i=l(u(3065)),o=u(3263);class n extends s.AbstractExpression{static staticConstructor(){n.dynamicToRelativeVolumeDict.setValue(h.ffffff,1),n.dynamicToRelativeVolumeDict.setValue(h.fffff,.9921259842519685),n.dynamicToRelativeVolumeDict.setValue(h.ffff,.984251968503937),n.dynamicToRelativeVolumeDict.setValue(h.fff,.9763779527559056),n.dynamicToRelativeVolumeDict.setValue(h.ff,.9606299212598425),n.dynamicToRelativeVolumeDict.setValue(h.f,.8503937007874016),n.dynamicToRelativeVolumeDict.setValue(h.mf,.5984251968503937),n.dynamicToRelativeVolumeDict.setValue(h.sf,.5),n.dynamicToRelativeVolumeDict.setValue(h.sfp,.5),n.dynamicToRelativeVolumeDict.setValue(h.sfpp,.5),n.dynamicToRelativeVolumeDict.setValue(h.fp,.5),n.dynamicToRelativeVolumeDict.setValue(h.rf,.5),n.dynamicToRelativeVolumeDict.setValue(h.rfz,.5),n.dynamicToRelativeVolumeDict.setValue(h.sfz,.5),n.dynamicToRelativeVolumeDict.setValue(h.sffz,.5),n.dynamicToRelativeVolumeDict.setValue(h.fz,.5),n.dynamicToRelativeVolumeDict.setValue(h.mp,.47244094488188976),n.dynamicToRelativeVolumeDict.setValue(h.p,.2204724409448819),n.dynamicToRelativeVolumeDict.setValue(h.pp,.09448818897637795),n.dynamicToRelativeVolumeDict.setValue(h.ppp,.07874015748031496),n.dynamicToRelativeVolumeDict.setValue(h.pppp,.05511811023622047),n.dynamicToRelativeVolumeDict.setValue(h.ppppp,.03937007874015748),n.dynamicToRelativeVolumeDict.setValue(h.pppppp,.031496062992125984)}constructor(f,m,p,E,y){super(p),this.parentMeasure=y,this.dynamicEnum=h[f.toLowerCase()],this.soundDynamic=m,this.staffNumber=E}get ParentMultiExpression(){return this.multiExpression}set ParentMultiExpression(f){this.multiExpression=f}get DynEnum(){return this.dynamicEnum}set DynEnum(f){this.dynamicEnum=f}get SoundDynamic(){return this.soundDynamic}set SoundDynamic(f){this.soundDynamic=f}get Placement(){return this.placement}set Placement(f){this.placement=f}get StaffNumber(){return this.staffNumber}set StaffNumber(f){this.staffNumber=f}get Length(){return Math.abs(this.length)<1e-4&&(this.length=this.calculateLength()),this.length}get MidiVolume(){return 127*this.Volume}get Volume(){return n.dynamicToRelativeVolumeDict.getValue(this.dynamicEnum)}static isInputStringInstantaneousDynamic(f){return!!f&&n.isStringInStringList(n.listInstantaneousDynamics,f)}getDynamicExpressionSymbol(f){switch(f){case"p":return c.DynamicExpressionSymbolEnum.p;case"f":return c.DynamicExpressionSymbolEnum.f;case"s":return c.DynamicExpressionSymbolEnum.s;case"z":return c.DynamicExpressionSymbolEnum.z;case"m":return c.DynamicExpressionSymbolEnum.m;case"r":return c.DynamicExpressionSymbolEnum.r;default:throw new r.InvalidEnumArgumentException("unknown DynamicExpressionSymbolEnum: "+f)}}calculateLength(){return i.default.debug("[Andrea] instantaneousDynamicExpression: not implemented: calculateLength!"),0}}var h,e;g.InstantaneousDynamicExpression=n,n.dynamicToRelativeVolumeDict=new o.Dictionary,n.listInstantaneousDynamics=["pppppp","ppppp","pppp","ppp","pp","p","ffffff","fffff","ffff","fff","ff","f","mf","mp","sf","sff","sp","spp","fp","rf","rfz","sfz","sffz","fz"],(e=h||(g.DynamicEnum=h={}))[e.pppppp=0]="pppppp",e[e.ppppp=1]="ppppp",e[e.pppp=2]="pppp",e[e.ppp=3]="ppp",e[e.pp=4]="pp",e[e.p=5]="p",e[e.mp=6]="mp",e[e.mf=7]="mf",e[e.f=8]="f",e[e.ff=9]="ff",e[e.fff=10]="fff",e[e.ffff=11]="ffff",e[e.fffff=12]="fffff",e[e.ffffff=13]="ffffff",e[e.sf=14]="sf",e[e.sff=15]="sff",e[e.sfp=16]="sfp",e[e.sfpp=17]="sfpp",e[e.fp=18]="fp",e[e.rf=19]="rf",e[e.rfz=20]="rfz",e[e.sfz=21]="sfz",e[e.sffz=22]="sffz",e[e.fz=23]="fz",e[e.other=24]="other",n.staticConstructor()},9161(dt,g,u){"use strict";
vendor: 6,858 bytes, line 1
1Object.defineProperty(g,"__esModule",{value:!0}),g.ChangeSubType=g.InstTempo=g.TempoType=g.InstantaneousTempoExpression=void 0;const l=u(9147),s=u(2561);class c extends l.AbstractTempoExpression{constructor(h,e,f,m,p,E=!1){super(h,e,f,p),this.parentMeasure=p.SourceMeasureParent,this.isMetronomeMark=E,this.setTempoAndTempoType(m)}static getDefaultValueForInstTempo(h){switch(h){case i.larghissimo:return 20;case i.grave:return 30;case i.lento:return 48;case i.largo:return 52;case i.larghetto:return 63;case i.adagio:return 70;case i.adagietto:return 75;case i.andanteModerato:return 88;case i.andante:return 92;case i.andantino:return 96;case i.moderato:return 106;case i.allegretto:return 112;case i.allegroModerato:return 118;case i.allegro:return 130;case i.vivace:return 140;case i.vivacissimo:return 155;case i.allegrissimo:return 170;case i.presto:return 184;case i.prestissimo:return 200;default:return 60}}static isInputStringInstantaneousTempo(h){return!!h&&(c.isStringInStringList(c.listInstantaneousTempoLarghissimo,h)||c.isStringInStringList(c.listInstantaneousTempoGrave,h)||c.isStringInStringList(c.listInstantaneousTempoLento,h)||c.isStringInStringList(c.listInstantaneousTempoLargo,h)||c.isStringInStringList(c.listInstantaneousTempoLarghetto,h)||c.isStringInStringList(c.listInstantaneousTempoAdagio,h)||c.isStringInStringList(c.listInstantaneousTempoAdagietto,h)||c.isStringInStringList(c.listInstantaneousTempoAndanteModerato,h)||c.isStringInStringList(c.listInstantaneousTempoAndante,h)||c.isStringInStringList(c.listInstantaneousTempoAndantino,h)||c.isStringInStringList(c.listInstantaneousTempoModerato,h)||c.isStringInStringList(c.listInstantaneousTempoAllegretto,h)||c.isStringInStringList(c.listInstantaneousTempoAllegroModerato,h)||c.isStringInStringList(c.listInstantaneousTempoAllegro,h)||c.isStringInStringList(c.listInstantaneousTempoVivace,h)||c.isStringInStringList(c.listInstantaneousTempoVivacissimo,h)||c.isStringInStringList(c.listInstantaneousTempoAllegrissimo,h)||c.isStringInStringList(c.listInstantaneousTempoPresto,h)||c.isStringInStringList(c.listInstantaneousTempoPrestissimo,h)||c.isStringInStringList(c.listInstantaneousTempoChangesGeneral,h))}get Label(){return this.label}set Label(h){this.label=h}get Placement(){return this.placement}set Placement(h){this.placement=h}get StaffNumber(){return this.staffNumber}set StaffNumber(h){this.staffNumber=h}get TempoInBpm(){return this.tempoInBpm}set TempoInBpm(h){this.tempoInBpm=h}get ParentMultiTempoExpression(){return this.parentMultiTempoExpression}getAbsoluteTimestamp(){return s.Fraction.plus(this.ParentMultiTempoExpression.SourceMeasureParent.AbsoluteTimestamp,this.ParentMultiTempoExpression.Timestamp)}getAbsoluteFloatTimestamp(){return s.Fraction.plus(this.ParentMultiTempoExpression.SourceMeasureParent.AbsoluteTimestamp,this.ParentMultiTempoExpression.Timestamp).RealValue}setTempoAndTempoType(h){if(!this.label)return this.tempoInBpm=h,void(this.TempoType=r.metronomeMark);c.isStringInStringList(c.listInstantaneousTempoLarghissimo,this.label)?(0===h&&(h=c.getDefaultValueForInstTempo(i.larghissimo)),this.tempoInBpm=h,this.InstTempo=i.larghissimo,this.TempoType=r.inst):c.isStringInStringList(c.listInstantaneousTempoGrave,this.label)?(0===h&&(h=c.getDefaultValueForInstTempo(i.grave)),this.tempoInBpm=h,this.InstTempo=i.grave,this.TempoType=r.inst):c.isStringInStringList(c.listInstantaneousTempoLento,this.label)?(0===h&&(h=c.getDefaultValueForInstTempo(i.lento)),this.tempoInBpm=h,this.InstTempo=i.lento,this.TempoType=r.inst):c.isStringInStringList(c.listInstantaneousTempoLargo,this.label)?(0===h&&(h=c.getDefaultValueForInstTempo(i.largo)),this.tempoInBpm=h,this.InstTempo=i.largo,this.TempoType=r.inst):c.isStringInStringList(c.listInstantaneousTempoLarghetto,this.label)?(0===h&&(h=c.getDefaultValueForInstTempo(i.larghetto)),this.tempoInBpm=h,this.InstTempo=i.larghetto,this.TempoType=r.inst):c.isStringInStringList(c.listInstantaneousTempoAdagio,this.label)?(0===h&&(h=c.getDefaultValueForInstTempo(i.adagio)),this.tempoInBpm=h,this.InstTempo=i.adagio,this.TempoType=r.inst):c.isStringInStringList(c.listInstantaneousTempoAdagietto,this.label)?(0===h&&(h=c.getDefaultValueForInstTempo(i.adagietto)),this.tempoInBpm=h,this.InstTempo=i.adagietto,this.TempoType=r.inst):c.isStringInStringList(c.listInstantaneousTempoAndanteModerato,this.label)?(0===h&&(h=c.getDefaultValueForInstTempo(i.andanteModerato)),this.tempoInBpm=h,this.InstTempo=i.andanteModerato,this.TempoType=r.inst):c.isStringInStringList(c.listInstantaneousTempoAndante,this.label)?(0===h&&(h=c.getDefaultValueForInstTempo(i.andante)),this.tempoInBpm=h,this.InstTempo=i.andante,this.TempoType=r.inst):c.isStringInStringList(c.listInstantaneousTempoAndantino,this.label)?(0===h&&(h=c.getDefaultValueForInstTempo(i.andantino)),this.tempoInBpm=h,this.InstTempo=i.andantino,this.TempoType=r.inst):c.isStringInStringList(c.listInstantaneousTempoModerato,this.label)?(0===h&&(h=c.getDefaultValueForInstTempo(i.moderato)),this.tempoInBpm=h,this.InstTempo=i.moderato,this.TempoType=r.inst):c.isStringInStringList(c.listInstantaneousTempoAllegretto,this.label)?(0===h&&(h=c.getDefaultValueForInstTempo(i.allegretto)),this.tempoInBpm=h,this.InstTempo=i.allegretto,this.TempoType=r.inst):c.isStringInStringList(c.listInstantaneousTempoAllegroModerato,this.label)?(0===h&&(h=c.getDefaultValueForInstTempo(i.allegroModerato)),this.tempoInBpm=h,this.InstTempo=i.allegroModerato,this.TempoType=r.inst):c.isStringInStringList(c.listInstantaneousTempoAllegro,this.label)?(0===h&&(h=c.getDefaultValueForInstTempo(i.allegro)),this.tempoInBpm=h,this.InstTempo=i.allegro,this.TempoType=r.inst):c.isStringInStringList(c.listInstantaneousTempoVivace,this.label)?(0===h&&(h=c.getDefaultValueForInstTempo(i.vivace)),this.tempoInBpm=h,this.InstTempo=i.vivace,this.TempoType=r.inst):c.isStringInStringList(c.listInstantaneousTempoVivacissimo,this.label)?(0===h&&(h=c.getDefaultValueForInstTempo(i.vivacissimo)),this.tempoInBpm=h,this.InstTempo=i.vivacissimo,this.TempoType=r.inst):c.isStringInStringList(c.listInstantaneousTempoAllegrissimo,this.label)?(0===h&&(h=c.getDefaultValueForInstTempo(i.allegrissimo)),this.tempoInBpm=h,this.InstTempo=i.allegrissimo,this.TempoType=r.inst):c.isStringInStringList(c.listInstantaneousTempoPresto,this.label)?(0===h&&(h=c.getDefaultValueForInstTempo(i.presto)),this.tempoInBpm=h,this.InstTempo=i.presto,this.TempoType=r.inst):c.isStringInStringList(c.listInstantaneousTempoPrestissimo,this.label)?(0===h&&(h=c.getDefaultValueForInstTempo(i.prestissimo)),this.tempoInBpm=h,this.InstTempo=i.prestissimo,this.TempoType=r.inst):c.isStringInStringList(c.listInstantaneousTempoAddons,this.label)?(this.tempoInBpm=0,this.TempoType=r.addon):c.isStringInStringList(c.listInstantaneousTempoChangesGeneral,this.label)&&(this.tempoInBpm=0,this.TempoType=r.change)}}var r,i,o,n;
1g.InstantaneousTempoExpression=c,c.listInstantaneousTempoLarghissimo=["Larghissimo","Sehr breit","very, very slow"],c.listInstantaneousTempoGrave=["Grave","Schwer","slow and solemn"],c.listInstantaneousTempoLento=["Lento","Lent","Langsam","slowly"],c.listInstantaneousTempoLargo=["Largo","Breit","broadly"],c.listInstantaneousTempoLarghetto=["Larghetto","Etwas breit","rather broadly"],c.listInstantaneousTempoAdagio=["Adagio","Langsam","Ruhig","slow and stately"],c.listInstantaneousTempoAdagietto=["Adagietto","Ziemlich ruhig","Ziemlich langsam","rather slow"],c.listInstantaneousTempoAndanteModerato=["Andante moderato"],c.listInstantaneousTempoAndante=["Andante","Gehend","Schreitend","at a walking pace"],c.listInstantaneousTempoAndantino=["Andantino","Maestoso"],c.listInstantaneousTempoModerato=["Moderato","M\xe4\xdfig","Mod\xe9r\xe9","moderately"],c.listInstantaneousTempoAllegretto=["Allegretto","Animato","fast"],c.listInstantaneousTempoAllegroModerato=["Allegro moderato"],c.listInstantaneousTempoAllegro=["Allegro","Rapide","Vite","Rasch","Schnell","Fr\xf6hlich"],c.listInstantaneousTempoVivace=["Vivace","Allegro Assai","Lebhaft","Lebendig","lively and fast"],c.listInstantaneousTempoVivacissimo=["Vivacissimo","Sehr lebhaft","Sehr lebendig"],c.listInstantaneousTempoAllegrissimo=["Allegrissimo","very fast"],c.listInstantaneousTempoPresto=["Presto","Sehr schnell","Geschwind"],c.listInstantaneousTempoPrestissimo=["Prestissimo","\xe4u\xdferst schnell"],c.listInstantaneousTempoChangesGeneral=["tempo primo","a tempo","tempo i","rubato","doppio movimento","rallentando","ritardando","ritard.","rit.","ritard","rall...","accelerando","accel"],c.listInstantaneousTempoAddons=["assai","amoroso","cantabile","con brio","con dolore","con espressione","con fuoco","con moto","con spirito","spiritoso","espressivo","giocoso","giusto","grazioso","lesto","lugubre","maestoso","ma non troppo","marcato","molto","morendo","mosso","non tanto","piu","un poco","poco","quasi","risoluto","scherzando","sostenuto","teneramente","tempo giusto","tranquillo","sehr","lieblich","liebevoll","mit Leidenschaft","mit Liebe","amour\xf6s","gesanglich","mit Schwung","mit Feuer","mit Schmerz","mit Ausdruck","mit Bewegung","geistvoll","ausdrucksvoll","freudig","verspielt","angemessen","grazi\xf6s","mit Grazie","flink","beh\xe4nde","traurig","klagend","majest\xe4tisch","aber nicht zu sehr","markant","gem\xe4\xdfigt","viel","sehr","ersterbend","bewegt","nicht zu sehr","mehr","ein wenig","gleichsam","entschlossen","zupackend","heiter","nachdr\xfccklich","getragen","gewichtig","zart","z\xe4rtlich","im angemessenen Zeitma\xdf","ruhig","ein wenig","alla marcia","ad libitum","alla breve"],(n=r||(g.TempoType=r={}))[n.none=0]="none",n[n.metronomeMark=1]="metronomeMark",n[n.inst=2]="inst",n[n.change=3]="change",n[n.addon=4]="addon",function(n){n[n.larghissimo=0]="larghissimo",n[n.grave=1]="grave",n[n.lento=2]="lento",n[n.largo=3]="largo",n[n.larghetto=4]="larghetto",n[n.adagio=5]="adagio",n[n.adagietto=6]="adagietto",n[n.andanteModerato=7]="andanteModerato",n[n.andante=8]="andante",n[n.andantino=9]="andantino",n[n.moderato=10]="moderato",n[n.allegretto=11]="allegretto",n[n.allegroModerato=12]="allegroModerato",n[n.allegro=13]="allegro",n[n.vivace=14]="vivace",n[n.vivacissimo=15]="vivacissimo",n[n.allegrissimo=16]="allegrissimo",n[n.presto=17]="presto",n[n.prestissimo=18]="prestissimo",n[n.lastRealTempo=19]="lastRealTempo"}(i||(g.InstTempo=i={})),function(n){n[n.none=0]="none",n[n.atempo=1]="atempo",n[n.doppioMovimento=2]="doppioMovimento",n[n.tempoprimo=3]="tempoprimo"}(o||(g.ChangeSubType=o={}))},9803(dt,g,u){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.MoodEnum=g.MoodExpression=void 0;const l=u(6362);class s extends l.AbstractExpression{constructor(i,o,n){super(o),this.label=i,this.staffNumber=n,this.setMoodType()}static isInputStringMood(i){return!!i&&(s.isStringInStringList(s.listMoodAffettuoso,i)||s.isStringInStringList(s.listMoodAgitato,i)||s.isStringInStringList(s.listMoodAnimato,i)||s.isStringInStringList(s.listMoodAppassionato,i)||s.isStringInStringList(s.listMoodBrillante,i)||s.isStringInStringList(s.listMoodCantabile,i)||s.isStringInStringList(s.listMoodDolce,i)||s.isStringInStringList(s.listMoodEnergico,i)||s.isStringInStringList(s.listMoodEroico,i)||s.isStringInStringList(s.listMoodEspressivo,i)||s.isStringInStringList(s.listMoodFurioso,i)||s.isStringInStringList(s.listMoodGiocoso,i)||s.isStringInStringList(s.listMoodGioioso,i)||s.isStringInStringList(s.listMoodGrandioso,i)||s.isStringInStringList(s.listMoodGrazioso,i)||s.isStringInStringList(s.listMoodLacrimoso,i)||s.isStringInStringList(s.listMoodLeggiero,i)||s.isStringInStringList(s.listMoodMaestoso,i)||s.isStringInStringList(s.listMoodMalinconico,i)||s.isStringInStringList(s.listMoodMarcato,i)||s.isStringInStringList(s.listMoodMarziale,i)||s.isStringInStringList(s.listMoodMesto,i)||s.isStringInStringList(s.listMoodMorendo,i)||s.isStringInStringList(s.listMoodNobilmente,i)||s.isStringInStringList(s.listMoodPatetico,i)||s.isStringInStringList(s.listMoodPesante,i)||s.isStringInStringList(s.listMoodSaltando,i)||s.isStringInStringList(s.listMoodSautille,i)||s.isStringInStringList(s.listMoodScherzando,i)||s.isStringInStringList(s.listMoodSostenuto,i)||s.isStringInStringList(s.listMoodSpiccato,i)||s.isStringInStringList(s.listMoodTenerezza,i)||s.isStringInStringList(s.listMoodTranquillamente,i)||s.isStringInStringList(s.listMoodTrionfante,i))}get Label(){return this.label}set Label(i){this.label=i}get Mood(){return this.moodType}set Mood(i){this.moodType=i}get StaffNumber(){return this.staffNumber}set StaffNumber(i){this.staffNumber=i}get Placement(){return this.placement}set Placement(i){this.placement=i}setMoodType(){s.isStringInStringList(s.listMoodAffettuoso,this.label)?this.moodType=c.Affettuoso:s.isStringInStringList(s.listMoodAgitato,this.label)?this.moodType=c.Agitato:s.isStringInStringList(s.listMoodAnimato,this.label)?this.moodType=c.Animato:s.isStringInStringList(s.listMoodAppassionato,this.label)?this.moodType=c.Appassionato:s.isStringInStringList(s.listMoodBrillante,this.label)?this.moodType=c.Brillante:s.isStringInStringList(s.listMoodCantabile,this.label)?this.moodType=c.Cantabile:s.isStringInStringList(s.listMoodDolce,this.label)?this.moodType=c.Dolce:s.isStringInStringList(s.listMoodEnergico,this.label)?this.moodType=c.Energico:s.isStringInStringList(s.listMoodEroico,this.label)?this.moodType=c.Eroico:s.isStringInStringList(s.listMoodEspressivo,this.label)?this.moodType=c.Espressivo:s.isStringInStringList(s.listMoodFurioso,this.label)?this.moodType=c.Furioso:s.isStringInStringList(s.listMoodGiocoso,this.label)?this.moodType=c.Giocoso:s.isStringInStringList(s.listMoodGioioso,this.label)?this.moodType=c.Gioioso:s.isStringInStringList(s.listMoodGrandioso,this.label)?this.moodType=c.Grandioso:s.isStringInStringList(s.listMoodGrazioso,this.label)?this.moodType=c.Grazioso:s.isStringInStringList(s.listMoodLacrimoso,this.label)?this.moodType=c.Lacrimoso:s.isStringInStringList(s.listMoodLeggiero,this.label)?this.moodType=c.Leggiero:s.isStringInStringList(s.listMoodMaestoso,this.label)?this.moodType=c.Maestoso:s.isStringInStringList(s.listMoodMalinconico,this.label)?this.moodType=c.Malinconico:s.isStringInStringList(s.listMoodMarcato,this.label)?this.moodType=c.Marcato:s.isStringInStringList(s.listMoodMarziale,this.label)?this.moodType=c.Marziale:s.isStringInStringList(s.listMoodMesto,this.label)?this.moodType=c.Mesto:s.isStringInStringList(s.listMoodMorendo,this.label)?this.moodType=c.Morendo:s.isStringInStringList(s.listMoodNobilmente,this.label)?this.moodType=c.Nobilmente:s.isStringInStringList(s.listMoodPatetico,this.label)?this.moodType=c.Patetico:s.isStringInStringList(s.listMoodPesante,this.label)?this.moodType=c.Pesante:s.isStringInStringList(s.listMoodSaltando,this.label)?this.moodType=c.Saltando:s.isStringInStringList(s.listMoodSautille,this.label)?this.moodType=c.Sautille:s.isStringInStringList(s.listMoodScherzando,this.label)?this.moodType=c.Scherzando:s.isStringInStringList(s.listMoodSostenuto,this.label)?this.moodType=c.Sostenuto:s.isStringInStringList(s.listMoodSpiccato,this.label)?this.moodType=c.Spiccato:s.isStringInStringList(s.listMoodTenerezza,this.label)?this.moodType=c.Tenerezza:s.isStringInStringList(s.listMoodTranquillamente,this.label)?this.moodType=c.Tranquillamente:s.isStringInStringList(s.listMoodTrionfante,this.label)&&(this.moodType=c.Trionfante)}}var c,r;g.MoodExpression=s,s.listMoodAffettuoso=["affettuoso"],s.listMoodAgitato=["agitato"],s.listMoodAppassionato=["appassionato"],s.listMoodAnimato=["animato","lively"],s.listMoodBrillante=["brillante"],s.listMoodCantabile=["cantabile"],s.listMoodDolce=["dolce"],s.listMoodEnergico=["energico"],s.listMoodEroico=["eroico"],s.listMoodEspressivo=["espressivo"],s.listMoodFurioso=["furioso"],s.listMoodGiocoso=["giocoso"],s.listMoodGioioso=["gioioso"],s.listMoodLacrimoso=["lacrimoso"],s.listMoodGrandioso=["grandioso"],s.listMoodGrazioso=["grazioso"],s.listMoodLeggiero=["leggiero"],s.listMoodMaestoso=["maestoso"],s.listMoodMalinconico=["malinconico"],s.listMoodMarcato=["marcato"],s.listMoodMarziale=["marziale"],s.listMoodMesto=["mesto"],s.listMoodMorendo=["morendo"],s.listMoodNobilmente=["nobilmente"],s.listMoodPatetico=["patetico"],s.listMoodPesante=["pesante"],s.listMoodSautille=["sautille"],s.listMoodSaltando=["saltando"],s.listMoodScherzando=["scherzando"],s.listMoodSostenuto=["sostenuto"],s.listMoodSpiccato=["spiccato"],s.listMoodTenerezza=["tenerezza"],s.listMoodTranquillamente=["tranquillamente"],s.listMoodTrionfante=["tri
1onfante"],(r=c||(g.MoodEnum=c={}))[r.Affettuoso=0]="Affettuoso",r[r.Agitato=1]="Agitato",r[r.Appassionato=2]="Appassionato",r[r.Animato=3]="Animato",r[r.Brillante=4]="Brillante",r[r.Cantabile=5]="Cantabile",r[r.Dolce=6]="Dolce",r[r.Energico=7]="Energico",r[r.Eroico=8]="Eroico",r[r.Espressivo=9]="Espressivo",r[r.Furioso=10]="Furioso",r[r.Giocoso=11]="Giocoso",r[r.Gioioso=12]="Gioioso",r[r.Lacrimoso=13]="Lacrimoso",r[r.Grandioso=14]="Grandioso",r[r.Grazioso=15]="Grazioso",r[r.Leggiero=16]="Leggiero",r[r.Maestoso=17]="Maestoso",r[r.Malinconico=18]="Malinconico",r[r.Marcato=19]="Marcato",r[r.Marziale=20]="Marziale",r[r.Mesto=21]="Mesto",r[r.Morendo=22]="Morendo",r[r.Nobilmente=23]="Nobilmente",r[r.Patetico=24]="Patetico",r[r.Pesante=25]="Pesante",r[r.Sautille=26]="Sautille",r[r.Saltando=27]="Saltando",r[r.Scherzando=28]="Scherzando",r[r.Sostenuto=29]="Sostenuto",r[r.Spiccato=30]="Spiccato",r[r.Tenerezza=31]="Tenerezza",r[r.Tranquillamente=32]="Tranquillamente",r[r.Trionfante=33]="Trionfante",r[r.Vivace=34]="Vivace"},9019(dt,g,u){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.MultiExpressionEntry=g.MultiExpression=void 0;const l=u(2561),s=u(2148),c=u(5875),r=u(9803),i=u(1112),o=u(6362),n=u(2570);g.MultiExpression=class{constructor(e,f){this.unknownList=[],this.moodList=[],this.expressions=[],this.sourceMeasure=e,this.timestamp=f}get SourceMeasureParent(){return this.sourceMeasure}set SourceMeasureParent(e){this.sourceMeasure=e}get StaffNumber(){return this.staffNumber}set StaffNumber(e){this.staffNumber=e}get Timestamp(){return this.timestamp}set Timestamp(e){this.timestamp=e}get AbsoluteTimestamp(){return l.Fraction.plus(this.timestamp,this.sourceMeasure.AbsoluteTimestamp)}get InstantaneousDynamic(){return this.instantaneousDynamic}set InstantaneousDynamic(e){this.instantaneousDynamic=e}get EndingContinuousDynamic(){return this.endingContinuousDynamic}set EndingContinuousDynamic(e){this.endingContinuousDynamic=e}get StartingContinuousDynamic(){return this.startingContinuousDynamic}set StartingContinuousDynamic(e){this.startingContinuousDynamic=e}get MoodList(){return this.moodList}get UnknownList(){return this.unknownList}get EntriesList(){return this.expressions}get OctaveShiftStart(){return this.octaveShiftStart}set OctaveShiftStart(e){this.octaveShiftStart=e}get OctaveShiftEnd(){return this.octaveShiftEnd}set OctaveShiftEnd(e){this.octaveShiftEnd=e}get CombinedExpressionsText(){return this.combinedExpressionsText}set CombinedExpressionsText(e){this.combinedExpressionsText=e}getPlacementOfFirstEntry(){let e=o.PlacementEnum.Above;return this.expressions.length>0&&(this.expressions[0].expression instanceof s.InstantaneousDynamicExpression||this.expressions[0].expression instanceof c.ContinuousDynamicExpression||this.expressions[0].expression instanceof r.MoodExpression||this.expressions[0].expression instanceof i.UnknownExpression)&&(e=this.expressions[0].expression.Placement),e}getFontstyleOfFirstEntry(){let e=n.FontStyles.Regular;return this.expressions.length>0&&(this.expressions[0].expression instanceof c.ContinuousDynamicExpression||this.expressions[0].expression instanceof r.MoodExpression?e=n.FontStyles.Italic:this.expressions[0].expression instanceof i.UnknownExpression&&(e=this.expressions[0].expression.fontStyle??n.FontStyles.Regular)),e}getColorXMLOfFirstEntry(){let e;return this.expressions.length>=1&&(e=this.expressions[0].expression.ColorXML),e}addExpression(e,f){e instanceof s.InstantaneousDynamicExpression?(this.instantaneousDynamic&&this.removeExpressionFromEntryList(this.InstantaneousDynamic),this.instantaneousDynamic=e,this.instantaneousDynamic.ParentMultiExpression=this):e instanceof c.ContinuousDynamicExpression?this.startingContinuousDynamic=e:e instanceof r.MoodExpression?this.moodList.push(e):e instanceof i.UnknownExpression&&this.unknownList.push(e),this.addExpressionToEntryList(e,f)}CompareTo(e){return this.Timestamp.RealValue>e.Timestamp.RealValue?1:this.Timestamp.RealValue<e.Timestamp.RealValue?-1:0}addExpressionToEntryList(e,f){const m=new h;m.prefix=f,m.expression=e,m.label=e instanceof c.ContinuousDynamicExpression||e instanceof r.MoodExpression||e instanceof i.UnknownExpression?e.Label:"",this.expressions.push(m)}removeExpressionFromEntryList(e){for(let f=0,m=this.expressions.length;f<m;++f)if(this.expressions[f].expression===e){this.expressions.splice(f,1);break}}};class h{}g.MultiExpressionEntry=h},5332(dt,g,u){"use strict";
vendor: 10,162 bytes, line 1
1Object.defineProperty(g,"__esModule",{value:!0}),g.TempoExpressionEntry=g.MultiTempoExpression=void 0;const l=u(2561),s=u(9161),c=u(6362),r=u(2570),i=u(2221);g.MultiTempoExpression=class{constructor(n,h){this.expressions=[],this.sourceMeasure=n,this.timestamp=h}get Timestamp(){return this.timestamp}get AbsoluteTimestamp(){return l.Fraction.plus(this.sourceMeasure.AbsoluteTimestamp,this.timestamp)}get SourceMeasureParent(){return this.sourceMeasure}set SourceMeasureParent(n){this.sourceMeasure=n}get InstantaneousTempo(){return this.instantaneousTempo}get ContinuousTempo(){return this.continuousTempo}get EntriesList(){return this.expressions}get CombinedExpressionsText(){return this.combinedExpressionsText}set CombinedExpressionsText(n){this.combinedExpressionsText=n}getPlacementOfFirstEntry(){let n=c.PlacementEnum.Above;return this.expressions.length>0&&(this.expressions[0].Expression instanceof s.InstantaneousTempoExpression||this.expressions[0].Expression instanceof i.ContinuousTempoExpression)&&(n=this.expressions[0].Expression.Placement),n}getFontstyleOfFirstEntry(){let n=r.FontStyles.Regular;return this.expressions[0].Expression instanceof s.InstantaneousTempoExpression?n=r.FontStyles.Bold:this.expressions[0].Expression instanceof i.ContinuousTempoExpression&&(n=r.FontStyles.Italic),n}addExpression(n,h){if(this.checkIfAlreadyExists(n))return;n instanceof s.InstantaneousTempoExpression?this.instantaneousTempo=n:n instanceof i.ContinuousTempoExpression&&(this.continuousTempo=n);const e=new o;e.prefix=h,e.Expression=n,e.label=n.Label,this.expressions.push(e)}CompareTo(n){return this.Timestamp.RealValue>n.Timestamp.RealValue?1:this.Timestamp.RealValue<n.Timestamp.RealValue?-1:0}checkIfAlreadyExists(n){for(const h of this.expressions)if(h.label===n.Label)return!0;return!1}clearInstantaneousTempo(){this.instantaneousTempo=void 0}clearContinuousTempo(){this.continuousTempo=void 0}};class o{get Expression(){return this.expression}set Expression(h){this.expression=h}}g.TempoExpressionEntry=o},9157(dt,g,u){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.RehearsalExpression=void 0;const l=u(6362);g.RehearsalExpression=class s extends l.AbstractExpression{constructor(r,i){super(i),this.label=r}}},1112(dt,g,u){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.UnknownExpression=void 0;const l=u(6362),s=u(7533);g.UnknownExpression=class c extends l.AbstractExpression{constructor(i,o,n,h){super(o),this.label=i,this.staffNumber=h,void 0===n&&(n=s.TextAlignmentEnum.LeftBottom),this.textAlignment=n}get Label(){return this.label}get Placement(){return this.placement}set Placement(i){this.placement=i}get StaffNumber(){return this.staffNumber}set StaffNumber(i){this.staffNumber=i}get TextAlignment(){return this.textAlignment}}},4980(dt,g,u){"use strict";var l=this&&this.__createBinding||(Object.create?function(c,r,i,o){void 0===o&&(o=i);var n=Object.getOwnPropertyDescriptor(r,i);n&&!("get"in n?!r.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return r[i]}}),Object.defineProperty(c,o,n)}:function(c,r,i,o){void 0===o&&(o=i),c[o]=r[i]}),s=this&&this.__exportStar||function(c,r){for(var i in c)"default"===i||Object.prototype.hasOwnProperty.call(r,i)||l(r,c,i)};Object.defineProperty(g,"__esModule",{value:!0}),s(u(6362),g),s(u(9147),g),s(u(6990),g),s(u(2148),g),s(u(9161),g),s(u(9803),g),s(u(9019),g),s(u(5332),g),s(u(9157),g),s(u(1112),g)},7718(dt,g,u){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.Glissando=void 0;const l=u(2561),s=u(6438);g.Glissando=class{constructor(c){this.notes=[],this.XMLNumber=1,this.AddNote(c),this.StartNote=c,this.Direction=s.ColDirEnum.NotYetDefined}get Notes(){return this.notes}get Duration(){const c=new l.Fraction;for(const r of this.notes)c.Add(r.Length);return c}get Pitch(){return this.StartNote.Pitch}AddNote(c){this.notes.push(c),c.NoteGlissando=this,2===this.notes.length&&(this.Direction=this.notes[0].Pitch.getHalfTone()<this.notes[1].Pitch.getHalfTone()?s.ColDirEnum.Up:s.ColDirEnum.Down)}}},1110(dt,g,u){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.DynamicsContainer=void 0;const l=u(5875),s=u(2148);g.DynamicsContainer=class{constructor(c,r){c instanceof l.ContinuousDynamicExpression?this.continuousDynamicExpression=c:c instanceof s.InstantaneousDynamicExpression&&(this.instantaneousDynamicExpression=c),this.staffNumber=r}static Compare(c,r){return c.parMultiExpression().AbsoluteTimestamp.CompareTo(r.parMultiExpression().AbsoluteTimestamp)}parMultiExpression(){return this.continuousDynamicExpression?this.continuousDynamicExpression.StartMultiExpression:this.instantaneousDynamicExpression?this.instantaneousDynamicExpression.ParentMultiExpression:void 0}}},5364(dt,g){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.AbstractNotationInstruction=void 0,g.AbstractNotationInstruction=class{constructor(u){this.printObject=!0,this.parent=u}get Parent(){return this.parent}set Parent(u){this.parent=u}get PrintObject(){return this.printObject}set PrintObject(u){this.printObject=u}}},164(dt,g,u){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.MidiInstrument=g.ClefEnum=g.ClefInstruction=void 0;const l=u(8233),s=u(5364),c=u(8233),r=u(8233),i=u(7307);class o extends s.AbstractNotationInstruction{constructor(f=n.G,m=0,p=2){super(void 0),this.clefType=n.G,this.line=2,this.octaveOffset=0,this.line=p,this.clefType=f,this.octaveOffset=m,this.calcParameters()}static getDefaultClefFromMidiInstrument(f){switch(f){case h.Acoustic_Grand_Piano:case h.Electric_Bass_finger:case h.Electric_Bass_pick:case h.Fretless_Bass:case h.Slap_Bass_1:case h.Slap_Bass_2:case h.Synth_Bass_1:case h.Synth_Bass_2:case h.Contrabass:return new o(n.F,0,4);default:return new o(n.G,0,2)}}static getAllPossibleClefs(){const f=[];for(let m=0;m<=2;m++){const p=new o(n.G,m,2);f.push(p)}for(let m=-2;m<=0;m++){const p=new o(n.F,m,4);f.push(p)}return f}static isSupportedClef(f){switch(f){case n.G:case n.F:case n.C:case n.percussion:case n.TAB:return!0;default:return!1}}get ClefType(){return this.clefType}set ClefType(f){this.clefType=f}get Line(){return this.line}set Line(f){this.line=f}get OctaveOffset(){return this.octaveOffset}set OctaveOffset(f){this.octaveOffset=f}get ClefPitch(){return this.clefPitch}set ClefPitch(f){this.clefPitch=f}get ReferenceCyPosition(){return this.referenceCyPosition}set ReferenceCyPosition(f){this.referenceCyPosition=f}Equals(f){return this===f||!(!this||!f)&&this.clefPitch===f.clefPitch&&this.Line===f.Line}NotEqual(f){return!this.Equals(f)}ToString(){return"ClefType: "+this.clefType}calcParameters(){switch(this.clefType){case n.G:this.clefPitch=new l.Pitch(c.NoteEnum.G,1+this.octaveOffset,r.AccidentalEnum.NONE),this.referenceCyPosition=5-this.line+2;break;case n.F:this.clefPitch=new l.Pitch(c.NoteEnum.F,0+this.octaveOffset,r.AccidentalEnum.NONE),this.referenceCyPosition=5-this.line+1.5;break;case n.C:this.clefPitch=new l.Pitch(c.NoteEnum.C,1+this.octaveOffset,r.AccidentalEnum.NONE),this.referenceCyPosition=5-this.line;break;case n.percussion:this.clefPitch=new l.Pitch(c.NoteEnum.C,2,r.AccidentalEnum.NONE),this.referenceCyPosition=2;break;case n.TAB:this.clefPitch=new l.Pitch(c.NoteEnum.G,0,r.AccidentalEnum.NONE),this.referenceCyPosition=0;break;default:throw new i.ArgumentOutOfRangeException("clefType")}}}var n,h,e;g.ClefInstruction=o,(e=n||(g.ClefEnum=n={}))[e.G=0]="G",e[e.F=1]="F",e[e.C=2]="C",e[e.percussion=3]="percussion",e[e.TAB=4]="TAB",function(e){e[e.None=-1]="None",e[e.Acoustic_Grand_Piano=0]="Acoustic_Grand_Piano",e[e.Bright_Acoustic_Piano=1]="Bright_Acoustic_Piano",e[e.Electric_Grand_Piano=2]="Electric_Grand_Piano",e[e.Honky_tonk_Piano=3]="Honky_tonk_Piano",e[e.Electric_Piano_1=4]="Electric_Piano_1",e[e.Electric_Piano_2=5]="Electric_Piano_2",e[e.Harpsichord=6]="Harpsichord",e[e.Clavinet=7]="Clavinet",e[e.Celesta=8]="Celesta",e[e.Glockenspiel=9]="Glockenspiel",e[e.Music_Box=10]="Music_Box",e[e.Vibraphone=11]="Vibraphone",e[e.Marimba=12]="Marimba",e[e.Xylophone=13]="Xylophone",e[e.Tubular_Bells=14]="Tubular_Bells",e[e.Dulcimer=15]="Dulcimer",e[e.Drawbar_Organ=16]="Drawbar_Organ",e[e.Percussive_Organ=17]="Percussive_Organ",e[e.Rock_Organ=18]="Rock_Organ",e[e.Church_Organ=19]="Church_Organ",e[e.Reed_Organ=20]="Reed_Organ",e[e.Accordion=21]="Accordion",e[e.Harmonica=22]="Harmonica",e[e.Tango_Accordion=23]="Tango_Accordion",e[e.Acoustic_Guitar_nylon=24]="Acoustic_Guitar_nylon",e[e.Acoustic_Guitar_steel=25]="Acoustic_Guitar_steel",e[e.Electric_Guitar_jazz=26]="Electric_Guitar_jazz",e[e.Electric_Guitar_clean=27]="Electric_Guitar_clean",e[e.Electric_Guitar_muted=28]="Electric_Guitar_muted",e[e.Overdriven_Guitar=29]="Overdriven_Guitar",e[e.Distortion_Guitar=30]="Distortion_Guitar",e[e.Guitar_harmonics=31]="Guitar_harmonics",e[e.Acoustic_Bass=32]="Acoustic_Bass",e[e.Electric_Bass_finger=33]="Electric_Bass_finger",e[e.Electric_Bass_pick=34]="Electric_Bass_pick",e[e.Fretless_Bass=35]="Fretless_Bass",e[e.Slap_Bass_1=36]="Slap_Bass_1",e[e.Slap_Bass_2=37]="Slap_Bass_2",e[e.Synth_Bass_1=38]="Synth_Bass_1",e[e.Synth_Bass_2=39]="Synth_Bass_2",e[e.Violin=40]="Violin",e[e.Viola=41]="Viola",e[e.Cello=42]="Cello",e[e.Contrabass=43]="Contrabass",e[e.Tremolo_Strings=44]="Tremolo_Strings",e[e.Pizzicato_Strings=45]="Pizzicato_Strings",e[e.Orchestral_Harp=46]="Orchestral_Harp",e[e.Timpani=47]="Timpani",e[e.String_Ensemble_1=48]="String_Ensemble_1",e[e.String_Ensemble_2=49]="String_Ensemble_2",e[e.Synth_Strings_1=50]="Synth_Strings_1",e[e.Synth_Strings_2=51]="Synth_Strings_2",e[e.Choir_Aahs=52]="Choir_Aahs",e[e.Voice_Oohs=53]="Voice_Oohs",e[e.Synth_Voice=54]="Synth_Voice",e[e.Orchestra_Hit=55]="Orchestra_Hit",e[e.Trumpet=56]="Trumpet",e[e.Trombone=57]="Trombone",e[e.Tuba=58]="Tuba",e[e.Muted_Trumpet=59]="Muted_Trumpet",e[e.French_Horn=60]="French_Horn",e[e.Brass_Section=61]="Brass_Section",e[e.Synth_Brass_1=62]="Synth_Brass_1",e[e.Synth_Brass_2=63]="Synth_Brass_2",e[e.Soprano_Sax=64]="Soprano_Sax",e[e.Alto_Sax=65]="Alto_Sax",e[e.Tenor_Sax=66]="Tenor_Sax",e[e.Baritone_Sax=67]="Baritone_Sax",e[e.Oboe=68]="Oboe",e[e.English_Horn=69]="English_Horn",e[e.Bassoon=70]="Bassoon",e[e.Clarinet=71
1]="Clarinet",e[e.Piccolo=72]="Piccolo",e[e.Flute=73]="Flute",e[e.Recorder=74]="Recorder",e[e.Pan_Flute=75]="Pan_Flute",e[e.Blown_Bottle=76]="Blown_Bottle",e[e.Shakuhachi=77]="Shakuhachi",e[e.Whistle=78]="Whistle",e[e.Ocarina=79]="Ocarina",e[e.Lead_1_square=80]="Lead_1_square",e[e.Lead_2_sawtooth=81]="Lead_2_sawtooth",e[e.Lead_3_calliope=82]="Lead_3_calliope",e[e.Lead_4_chiff=83]="Lead_4_chiff",e[e.Lead_5_charang=84]="Lead_5_charang",e[e.Lead_6_voice=85]="Lead_6_voice",e[e.Lead_7_fifths=86]="Lead_7_fifths",e[e.Lead_8_bass_lead=87]="Lead_8_bass_lead",e[e.Pad_1_new_age=88]="Pad_1_new_age",e[e.Pad_2_warm=89]="Pad_2_warm",e[e.Pad_3_polysynth=90]="Pad_3_polysynth",e[e.Pad_4_choir=91]="Pad_4_choir",e[e.Pad_5_bowed=92]="Pad_5_bowed",e[e.Pad_6_metallic=93]="Pad_6_metallic",e[e.Pad_7_halo=94]="Pad_7_halo",e[e.Pad_8_sweep=95]="Pad_8_sweep",e[e.FX_1_rain=96]="FX_1_rain",e[e.FX_2_soundtrack=97]="FX_2_soundtrack",e[e.FX_3_crystal=98]="FX_3_crystal",e[e.FX_4_atmosphere=99]="FX_4_atmosphere",e[e.FX_5_brightness=100]="FX_5_brightness",e[e.FX_6_goblins=101]="FX_6_goblins",e[e.FX_7_echoes=102]="FX_7_echoes",e[e.FX_8_scifi=103]="FX_8_scifi",e[e.Sitar=104]="Sitar",e[e.Banjo=105]="Banjo",e[e.Shamisen=106]="Shamisen",e[e.Koto=107]="Koto",e[e.Kalimba=108]="Kalimba",e[e.Bag_pipe=109]="Bag_pipe",e[e.Fiddle=110]="Fiddle",e[e.Shanai=111]="Shanai",e[e.Tinkle_Bell=112]="Tinkle_Bell",e[e.Agogo=113]="Agogo",e[e.Steel_Drums=114]="Steel_Drums",e[e.Woodblock=115]="Woodblock",e[e.Taiko_Drum=116]="Taiko_Drum",e[e.Melodic_Tom=117]="Melodic_Tom",e[e.Synth_Drum=118]="Synth_Drum",e[e.Reverse_Cymbal=119]="Reverse_Cymbal",e[e.Guitar_Fret_Noise=120]="Guitar_Fret_Noise",e[e.Breath_Noise=121]="Breath_Noise",e[e.Seashore=122]="Seashore",e[e.Bird_Tweet=123]="Bird_Tweet",e[e.Telephone_Ring=124]="Telephone_Ring",e[e.Helicopter=125]="Helicopter",e[e.Applause=126]="Applause",e[e.Gunshot=127]="Gunshot",e[e.Percussion=128]="Percussion"}(h||(g.MidiInstrument=h={}))},4543(dt,g,u){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.KeyEnum=g.NoteEnumToHalfToneLink=g.KeyInstruction=void 0;const l=u(5364),s=u(8233),c=u(8233);class r extends l.AbstractNotationInstruction{constructor(n=void 0,h=0,e=i.major){super(n),this.isTransposedBy=0,this.Key=h,this.keyTypeOriginal=h,this.mode=e,this.alteratedNotes=this.calcAlteratedNotes()}static copy(n){const h=new r(n.parent,n.Key,n.Mode);return h.keyTypeOriginal=n.keyTypeOriginal,h}static getAllPossibleMajorKeyInstructions(){const n=[];for(let h=-7;h<7;h++){const e=new r(void 0,h,i.major);n.push(e)}return n}get Key(){return this.keyType}set Key(n){this.keyType=n,this.alteratedNotes=this.calcAlteratedNotes()}get Mode(){return this.mode}set Mode(n){this.mode=n}get AlteratedNotes(){return this.alteratedNotes}calcAlteratedNotes(){const n=[];if(this.keyType>0)for(let h=0;h<this.keyType;h++)n.push(r.sharpPositionList[h]);else if(this.keyType<0)for(let h=0;h<-this.keyType;h++)n.push(r.flatPositionList[h]);return n}willAlterateNote(n){return this.alteratedNotes.indexOf(n)>=0}getAlterationForPitch(n){return this.keyType>0&&this.alteratedNotes.indexOf(n.FundamentalNote)<=this.keyType?c.AccidentalEnum.SHARP:this.keyType<0&&this.alteratedNotes.indexOf(n.FundamentalNote)<=Math.abs(this.keyType)?c.AccidentalEnum.FLAT:c.AccidentalEnum.NONE}ToString(){return"Key: "+this.keyType+this.mode}OperatorEquals(n){const h=this;return h===n||!(!h||!n)&&h.Key===n.Key&&h.Mode===n.Mode}OperatorNotEqual(n){return!this.OperatorEquals(n)}}var i,o;g.KeyInstruction=r,r.sharpPositionList=[s.NoteEnum.F,s.NoteEnum.C,s.NoteEnum.G,s.NoteEnum.D,s.NoteEnum.A,s.NoteEnum.E,s.NoteEnum.B],r.flatPositionList=[s.NoteEnum.B,s.NoteEnum.E,s.NoteEnum.A,s.NoteEnum.D,s.NoteEnum.G,s.NoteEnum.C,s.NoteEnum.F],g.NoteEnumToHalfToneLink=class{constructor(o,n){this.note=o,this.halfTone=n}},(o=i||(g.KeyEnum=i={}))[o.major=0]="major",o[o.minor=1]="minor",o[o.none=2]="none",o[o.dorian=3]="dorian",o[o.phrygian=4]="phrygian",o[o.lydian=5]="lydian",o[o.mixolydian=6]="mixolydian",o[o.aeolian=7]="aeolian",o[o.ionian=8]="ionian",o[o.locrian=9]="locrian"},1645(dt,g){"use strict";var u,l,s;
1Object.defineProperty(g,"__esModule",{value:!0}),g.AlignmentType=g.RepetitionInstructionEnum=g.RepetitionInstruction=g.RepetitionInstructionComparer=void 0,g.RepetitionInstructionComparer=class{static Compare(s,c){if(void 0!==s.parentRepetition&&c.parentRepetition){if(s.alignment===l.End&&c.alignment===l.End){if(s.parentRepetition.StartIndex<c.parentRepetition.StartIndex)return 1;if(s.parentRepetition.StartIndex>c.parentRepetition.StartIndex)return-1}if(s.alignment===l.Begin&&c.alignment===l.Begin){if(s.parentRepetition.EndIndex<c.parentRepetition.EndIndex)return 1;if(s.parentRepetition.EndIndex>c.parentRepetition.EndIndex)return-1}}return 0}},g.RepetitionInstruction=class{constructor(s,c,r=l.End,i=void 0,o=void 0){this.endingIndices=void 0,this.measureIndex=s,o&&(this.endingIndices=o.slice()),this.type=c,this.alignment=r,this.parentRepetition=i}CompareTo(s){const c=s;if(this.measureIndex>c.measureIndex)return 1;if(this.measureIndex<c.measureIndex)return-1;if(this.alignment===l.Begin){if(c.alignment===l.End)return-1;switch(this.type){case u.Ending:return 1;case u.StartLine:return c.type===u.Ending?-1:1;case u.Coda:case u.Segno:return c.type===u.Coda?1:-1}}else{if(c.alignment===l.Begin)return 1;switch(this.type){case u.Ending:return-1;case u.Fine:case u.ToCoda:return c.type===u.Ending?1:-1;case u.ForwardJump:switch(c.type){case u.Ending:case u.Fine:case u.ToCoda:return 1}return-1;case u.DalSegnoAlFine:case u.DaCapoAlFine:case u.DalSegnoAlCoda:case u.DaCapoAlCoda:case u.DaCapo:case u.DalSegno:case u.BackJumpLine:return 1}}return 0}equals(s){if(this.measureIndex!==s.measureIndex||this.type!==s.type||this.alignment!==s.alignment)return!1;if(this.endingIndices===s.endingIndices)return!0;if(!this.endingIndices||!s.endingIndices||this.endingIndices.length!==s.endingIndices.length)return!1;for(let c=0;c<this.endingIndices.length;c++)if(this.endingIndices[c]!==s.endingIndices[c])return!1;return!0}},(s=u||(g.RepetitionInstructionEnum=u={}))[s.StartLine=0]="StartLine",s[s.ForwardJump=1]="ForwardJump",s[s.BackJumpLine=2]="BackJumpLine",s[s.Ending=3]="Ending",s[s.DaCapo=4]="DaCapo",s[s.DalSegno=5]="DalSegno",s[s.Fine=6]="Fine",s[s.ToCoda=7]="ToCoda",s[s.DalSegnoAlFine=8]="DalSegnoAlFine",s[s.DaCapoAlFine=9]="DaCapoAlFine",s[s.DalSegnoAlCoda=10]="DalSegnoAlCoda",s[s.DaCapoAlCoda=11]="DaCapoAlCoda",s[s.Coda=12]="Coda",s[s.Segno=13]="Segno",s[s.None=14]="None",function(s){s[s.Begin=0]="Begin",s[s.End=1]="End",s[s.Mid=2]="Mid",s[s.Discontinue=3]="Discontinue"}(l||(g.AlignmentType=l={}))},9288(dt,g,u){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.RhythmSymbolEnum=g.RhythmInstruction=void 0;const l=u(5364);class s extends l.AbstractNotationInstruction{constructor(i,o){super(void 0),this.rhythm=i,this.numerator=i.Numerator,this.denominator=i.Denominator,this.symbolEnum=o}get Rhythm(){return this.rhythm}set Rhythm(i){this.rhythm=i}get SymbolEnum(){return this.symbolEnum}set SymbolEnum(i){this.symbolEnum=i}clone(){return new s(this.rhythm.clone(),this.symbolEnum)}OperatorEquals(i){const o=this;return o===i||!(!o||!i)&&o.numerator===i.numerator&&o.denominator===i.denominator}OperatorNotEqual(i){return this!==i}ToString(){return"Rhythm: "+this.rhythm.toString()}}var c,r;g.RhythmInstruction=s,(r=c||(g.RhythmSymbolEnum=c={}))[r.NONE=0]="NONE",r[r.COMMON=1]="COMMON",r[r.CUT=2]="CUT"},3123(dt,g){"use strict";var u,l;Object.defineProperty(g,"__esModule",{value:!0}),g.TechnicalInstruction=g.TechnicalInstructionType=void 0,(l=u||(g.TechnicalInstructionType=u={}))[l.Fingering=0]="Fingering",l[l.String=1]="String",g.TechnicalInstruction=class{}},9184(dt,g,u){"use strict";var l=this&&this.__createBinding||(Object.create?function(c,r,i,o){void 0===o&&(o=i);var n=Object.getOwnPropertyDescriptor(r,i);n&&!("get"in n?!r.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return r[i]}}),Object.defineProperty(c,o,n)}:function(c,r,i,o){void 0===o&&(o=i),c[o]=r[i]}),s=this&&this.__exportStar||function(c,r){for(var i in c)"default"===i||Object.prototype.hasOwnProperty.call(r,i)||l(r,c,i)};Object.defineProperty(g,"__esModule",{value:!0}),s(u(5364),g),s(u(164),g),s(u(4543),g),s(u(1645),g),s(u(9288),g),s(u(3123),g)},4249(dt,g,u){"use strict";
vendor: 4,535 bytes, line 1
1Object.defineProperty(g,"__esModule",{value:!0}),g.LinkedVoice=void 0;const l=u(5534);g.LinkedVoice=class s extends l.Voice{constructor(r,i,o){super(r,i),this.master=o}get Master(){return this.master}}},2317(dt,g,u){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.LyricsEntry=void 0;const l=u(2570);g.LyricsEntry=class{constructor(s,c,r,i,o=-1){this.text=s,this.word=r,this.parent=i,this.verseNumber=c,o>=0&&(this.syllableIndex=o)}get Text(){return this.text}set Text(s){this.text=s}get Word(){return this.word}get Parent(){return this.parent}set Parent(s){this.parent=s}get VerseNumber(){return this.verseNumber}get SyllableIndex(){return this.syllableIndex}get IsTranslation(){return this.VerseNumber.endsWith("translation")}get IsChorus(){return this.VerseNumber.startsWith("chorus")}get FontStyle(){return this.IsChorus||this.IsTranslation?l.FontStyles.Italic:l.FontStyles.Regular}}},649(dt,g){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.LyricWord=void 0,g.LyricWord=class{constructor(){this.syllables=[]}get Syllables(){return this.syllables}containsVoiceEntry(u){for(let l=0,s=this.Syllables.length;l<s;++l)if(this.Syllables[l].Parent===u)return!0;return!1}findLyricEntryInVoiceEntry(u){for(let l=0,s=this.Syllables.length;l<s;++l){const c=this.Syllables[l];if(c.Parent===u)return c}}}},1850(dt,g,u){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.Appearance=g.Note=void 0;const l=u(2561);var s,c;g.Note=class{constructor(c,r,i,o,n,h){this.slurs=[],this.playbackInstrumentId=void 0,this.notehead=void 0,this.printObject=!0,this.voiceEntry=c,this.parentStaffEntry=r,this.length=i,this.pitch=o,this.sourceMeasure=n,this.isRestFlag=h??!1,this.halfTone=o?o.getHalfTone():0}get NoteAsString(){return this.pitch.toString()}ToStringShort(c=0){return!this.Pitch||this.isRest()?"rest":this.Pitch?.ToStringShort(c)}get ToStringShortGet(){return this.ToStringShort(0)}get ParentVoiceEntry(){return this.voiceEntry}set ParentVoiceEntry(c){this.voiceEntry=c}get ParentStaffEntry(){return this.parentStaffEntry}get ParentStaff(){return this.parentStaffEntry.ParentStaff}get Length(){return this.length}set Length(c){this.length=c}get SourceMeasure(){return this.sourceMeasure}get TypeLength(){return this.typeLength}set TypeLength(c){this.typeLength=c}get NoteTypeXml(){return this.noteTypeXml}set NoteTypeXml(c){this.noteTypeXml=c}get NormalNotes(){return this.normalNotes}set NormalNotes(c){this.normalNotes=c}get Pitch(){return this.pitch}get NoteBeam(){return this.beam}set NoteBeam(c){this.beam=c}set Notehead(c){this.notehead=c}get Notehead(){return this.notehead}get NoteTuplet(){return this.tuplet}set NoteTuplet(c){this.tuplet=c}get NoteGlissando(){return this.glissando}set NoteGlissando(c){this.glissando=c}get NoteTie(){return this.tie}set NoteTie(c){this.tie=c}get NoteSlurs(){return this.slurs}set NoteSlurs(c){this.slurs=c}get PlaybackInstrumentId(){return this.playbackInstrumentId}set PlaybackInstrumentId(c){this.playbackInstrumentId=c}get PrintObject(){return this.printObject}set PrintObject(c){this.printObject=c}get Arpeggio(){return this.arpeggio}set Arpeggio(c){this.arpeggio=c}get IsCueNote(){return this.isCueNote}set IsCueNote(c){this.isCueNote=c}get StemDirectionXml(){return this.stemDirectionXml}set StemDirectionXml(c){this.stemDirectionXml=c}get TremoloStrokes(){return this.TremoloInfo?.tremoloStrokes}get StemColorXml(){return this.stemColorXml}set StemColorXml(c){this.stemColorXml=c}get NoteheadColorXml(){return this.noteheadColorXml}set NoteheadColorXml(c){this.noteheadColorXml=c}get NoteheadColor(){return this.noteheadColor}set NoteheadColor(c){this.noteheadColor=c}get NoteheadColorCurrentlyRendered(){return this.noteheadColorCurrentlyRendered}set NoteheadColorCurrentlyRendered(c){this.noteheadColorCurrentlyRendered=c}isRest(){return this.isRestFlag}isWholeRest(){return this.isRest()&&this.Length.RealValue===this.sourceMeasure.ActiveTimeSignature.RealValue}isWholeMeasureNote(){return this.Length.RealValue===this.sourceMeasure.ActiveTimeSignature.RealValue}ToString(){return this.pitch?this.Pitch.ToString()+", length: "+this.length.toString():"rest note, length: "+this.length.toString()}getAbsoluteTimestamp(){return l.Fraction.plus(this.voiceEntry.Timestamp,this.sourceMeasure.AbsoluteTimestamp)}isDuplicateSlur(c){for(let r=0,i=this.slurs.length;r<i;++r){const o=this.slurs[r];if(void 0!==o.StartNote&&void 0!==o.EndNote&&void 0!==c.StartNote&&c.StartNote===o.StartNote&&o.EndNote===this&&c.PlacementXml===o.PlacementXml)return!0}return!1}
1hasTabEffects(){return!1}},(c=s||(g.Appearance=s={}))[c.Normal=0]="Normal",c[c.Grace=1]="Grace",c[c.Cue=2]="Cue"},5282(dt,g,u){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.NoteTypeHandler=g.NoteType=void 0;const l=u(2561),s=u(9767),c=u(7307);var r,o;(o=r||(g.NoteType=r={}))[o.UNDEFINED=0]="UNDEFINED",o[o._1024th=1]="_1024th",o[o._512th=2]="_512th",o[o._256th=3]="_256th",o[o._128th=4]="_128th",o[o._64th=5]="_64th",o[o._32nd=6]="_32nd",o[o._16th=7]="_16th",o[o.EIGTH=8]="EIGTH",o[o.QUARTER=9]="QUARTER",o[o.HALF=10]="HALF",o[o.WHOLE=11]="WHOLE",o[o.BREVE=12]="BREVE",o[o.LONG=13]="LONG",o[o.MAXIMA=14]="MAXIMA";class i{static NoteTypeToString(n){return this.NoteTypeXmlValues[n]}static StringToNoteType(n){const h=this.NoteTypeXmlValues.indexOf(n);return-1!==h?h:r.UNDEFINED}static getNoteDurationFromType(n){switch(n){case"1024th":return new l.Fraction(1,1024);case"512th":return new l.Fraction(1,512);case"256th":return new l.Fraction(1,256);case"128th":return new l.Fraction(1,128);case"64th":return new l.Fraction(1,64);case"32th":case"32nd":return new l.Fraction(1,32);case"16th":return new l.Fraction(1,16);case"eighth":return new l.Fraction(1,8);case"quarter":return new l.Fraction(1,4);case"half":return new l.Fraction(1,2);case"whole":return new l.Fraction(1,1);case"breve":return new l.Fraction(2,1);case"long":return new l.Fraction(4,1);case"maxima":return new l.Fraction(8,1);default:{const h=s.ITextTranslation.translateText("ReaderErrorMessages/NoteDurationError","Invalid note duration.");throw new c.MusicSheetReadingException(h)}}}}g.NoteTypeHandler=i,i.NoteTypeXmlValues=["","1024th","512th","256th","128th","64th","32nd","16th","eigth","quarter","half","whole","breve","long","maxima"]},4064(dt,g,u){"use strict";var l=this&&this.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(g,"__esModule",{value:!0}),g.NoteHeadShape=g.Notehead=void 0;const s=l(u(3065));class c{constructor(o,n,h=void 0){this.sourceNote=o,this.setShapeFromXml(n,h)}setShapeFromXml(o,n=void 0){this.shape=c.ShapeTypeXmlToShape(o);let h=n;void 0===h&&(this.sourceNote?h=this.sourceNote.Length.Denominator>2:(s.default.warn("notehead: sourceNote and filledXmlAttribute undefined."),h=!0)),this.filled=h}get SourceNote(){return this.sourceNote}get Shape(){return this.shape}get Filled(){return this.filled}static ShapeTypeXmlToShape(o){switch(o.toLowerCase()){case"normal":return r.NORMAL;case"none":return r.NONE;case"x":return r.X;case"slash":return r.SLASH;case"diamond":return r.DIAMOND;case"square":case"la":return r.SQUARE;case"do":case"triangle":return r.TRIANGLE;case"inverted triangle":return r.TRIANGLE_INVERTED;case"rectangle":return r.RECTANGLE;case"circle-x":return r.CIRCLEX;default:return s.default.info("unsupported/unhandled xml notehead '"+o+"'. Using normal notehead."),r.NORMAL}}}var r,i;g.Notehead=c,(i=r||(g.NoteHeadShape=r={}
1))[i.CIRCLEX=0]="CIRCLEX",i[i.DIAMOND=1]="DIAMOND",i[i.NORMAL=2]="NORMAL",i[i.NONE=3]="NONE",i[i.RECTANGLE=4]="RECTANGLE",i[i.SLASH=5]="SLASH",i[i.SQUARE=6]="SQUARE",i[i.TRIANGLE=7]="TRIANGLE",i[i.TRIANGLE_INVERTED=8]="TRIANGLE_INVERTED",i[i.X=9]="X"},8215(dt,g,u){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.OrnamentEnum=g.OrnamentContainer=void 0;const l=u(8233),s=u(6362);var c,r;g.OrnamentContainer=class{constructor(r){this.placement=s.PlacementEnum.Above,this.accidentalAbove=l.AccidentalEnum.NONE,this.accidentalBelow=l.AccidentalEnum.NONE,this.ornament=r}get GetOrnament(){return this.ornament}get AccidentalAbove(){return this.accidentalAbove}set AccidentalAbove(r){this.accidentalAbove=r}get AccidentalBelow(){return this.accidentalBelow}set AccidentalBelow(r){this.accidentalBelow=r}},(r=c||(g.OrnamentEnum=c={}))[r.Trill=0]="Trill",r[r.Turn=1]="Turn",r[r.InvertedTurn=2]="InvertedTurn",r[r.DelayedTurn=3]="DelayedTurn",r[r.DelayedInvertedTurn=4]="DelayedInvertedTurn",r[r.Mordent=5]="Mordent",r[r.InvertedMordent=6]="InvertedMordent"},4387(dt,g,u){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.SourceMeasure=void 0;const l=u(2561),s=u(3236),c=u(2369),r=u(1645),i=u(1336),o=u(164),n=u(4543),h=u(6954);g.SourceMeasure=class{constructor(e,f){this.printNewSystemXml=!1,this.printNewPageXml=!1,this.IsSystemStartMeasure=!1,this.WidthFactor=1,this.hasLyrics=!1,this.hasMoodExpressions=!1,this.allRests=!1,this.isReducedToMultiRest=!1,this.multipleRestMeasureNumber=0,this.staffLinkedExpressions=[],this.tempoExpressions=[],this.verticalSourceStaffEntryContainers=[],this.graphicalMeasureErrors=[],this.firstRepetitionInstructions=[],this.lastRepetitionInstructions=[],this.completeNumberOfStaves=e,this.implicitMeasure=!1,this.hasEndLine=!1,this.endingBarStyleXml="",this.endingBarStyleEnum=h.SystemLinesEnum.SingleThin,this.firstInstructionsStaffEntries=new Array(e),this.lastInstructionsStaffEntries=new Array(e),this.rules=f,this.TempoInBPM=0;for(let m=0;m<e;m++)this.graphicalMeasureErrors.push(!1),this.staffLinkedExpressions.push([])}get MeasureNumber(){return this.measureNumber}set MeasureNumber(e){this.measureNumber=e}getPrintedMeasureNumber(){return this.rules.UseXMLMeasureNumbers&&Number.isInteger(this.MeasureNumberXML)?(this.MeasureNumberPrinted=this.MeasureNumberXML,this.MeasureNumberPrinted):(this.MeasureNumberPrinted=this.MeasureNumber,this.MeasureNumberPrinted)}get AbsoluteTimestamp(){return this.absoluteTimestamp}set AbsoluteTimestamp(e){this.absoluteTimestamp=e}get CompleteNumberOfStaves(){return this.completeNumberOfStaves}get Duration(){return this.duration}set Duration(e){this.duration=e}get ActiveTimeSignature(){return this.activeTimeSignature}set ActiveTimeSignature(e){this.activeTimeSignature=e}get ImplicitMeasure(){return this.implicitMeasure}set ImplicitMeasure(e){this.implicitMeasure=e}get HasEndLine(){return this.hasEndLine}set HasEndLine(e){this.hasEndLine=e}get StaffLinkedExpressions(){return this.staffLinkedExpressions}get TempoExpressions(){return this.tempoExpressions}get VerticalSourceStaffEntryContainers(){return this.verticalSourceStaffEntryContainers}get FirstInstructionsStaffEntries(){return this.firstInstructionsStaffEntries}get LastInstructionsStaffEntries(){return this.lastInstructionsStaffEntries}get FirstRepetitionInstructions(){return this.firstRepetitionInstructions}get LastRepetitionInstructions(){return this.lastRepetitionInstructions}getErrorInMeasure(e){return this.graphicalMeasureErrors[e]}setErrorInGraphicalMeasure(e,f){this.graphicalMeasureErrors[e]=f}getNextMeasure(e){return e[this.measureListIndex+1]}getPreviousMeasure(e){if(this.measureListIndex>1)return e[this.measureListIndex-1]}get Rules(){return this.rules}get VerticalMeasureList(){return this.verticalMeasureList}set VerticalMeasureList(e){this.verticalMeasureList=e}get TempoInBPM(){return this.tempoInBPM}set TempoInBPM(e){this.tempoInBPM=e}findOrCreateStaffEntry(e,f,m){let p,E;for(const d of this.verticalSourceStaffEntryContainers)if(d.Timestamp.Equals(e)){E=d;break}if(E)return E.StaffEntries[f]?p=E.StaffEntries[f]:(p=new c.SourceStaffEntry(E,m),E.StaffEntries[f]=p),{createdNewContainer:!1,staffEntry:p};if(0===this.verticalSourceStaffEntryContainers.length||this.verticalSourceStaffEntryContainers[this.verticalSourceStaffEntryContainers.length-1].Timestamp.lt(e)){const d=new s.VerticalSourceStaffEntryContainer(this,e.clone(),this.completeNumberOfStaves);this.verticalSourceStaffEntryContainers.push(d),p=new c.SourceStaffEntry(d,m),d.StaffEntries[f]=p}else for(let d=this.verticalSourceStaffEntryContainers.length-1;d>=0;d--){if(this.verticalSourceStaffEntryContainers[d].Timestamp.lt(e)){const S=new s.VerticalSourceStaffEntryContainer(this,e.clone(),this.completeNumberOfStaves);this.verticalSourceStaffEntryContainers.splice(d+1,0,S),p=new c.SourceStaffEntry(S,m),S.StaffEntries[f]=p;break}if(0===d){const S=new s.VerticalSourceStaffEntryContainer(this,e.clone(),this.completeNumberOfStaves);this.verticalSourceStaffEntryContainers.splice(d,0,S),p=new c.SourceStaffEntry(S,m),S.StaffEntries[f]=p;break}}return{createdNewContainer:!0,staffEntry:p}}findOrCreateVoiceEntry(e,f){let m,p=!1;
vendor: 24,485 bytes, line 1
1for(const E of e.VoiceEntries)if(E.ParentVoice===f){m=E;break}return m||(m=new i.VoiceEntry(e.Timestamp,f,e),p=!0),{createdVoiceEntry:p,voiceEntry:m}}getPreviousSourceStaffEntryFromIndex(e,f){for(let m=f-1;m>=0;m--)if(this.verticalSourceStaffEntryContainers[m][e])return this.verticalSourceStaffEntryContainers[m][e]}getVerticalContainerIndexByTimestamp(e){for(let f=0,m=this.VerticalSourceStaffEntryContainers.length;f<m;++f)if(this.VerticalSourceStaffEntryContainers[f].Timestamp.Equals(e))return f;return-1}getVerticalContainerByTimestamp(e){for(let f=0,m=this.VerticalSourceStaffEntryContainers.length;f<m;++f){const p=this.VerticalSourceStaffEntryContainers[f];if(p.Timestamp.Equals(e))return p}}checkForEmptyVerticalContainer(e){let f=0;for(let m=0;m<this.completeNumberOfStaves;m++)this.verticalSourceStaffEntryContainers[e][m]||f++;f===this.completeNumberOfStaves&&this.verticalSourceStaffEntryContainers.splice(e,1)}reverseCheck(e,f){let m=new l.Fraction(0,1);const p=[];for(let E=0;E<e.Instruments.length;E++){let y=new l.Fraction(0,1);const d=e.getGlobalStaffIndexOfFirstStaff(e.Instruments[E]);for(let S=0;S<e.Instruments[E].Staves.length;S++){const M=this.getLastSourceStaffEntryForInstrument(d+S);if(void 0!==M&&!M.hasTie())for(let x=this.verticalSourceStaffEntryContainers.indexOf(M.VerticalContainerParent)-1;x>=0;x--){const _=this.verticalSourceStaffEntryContainers[x][d+S];if(void 0!==_&&_.hasTie()&&y.lt(l.Fraction.plus(_.Timestamp,_.calculateMaxNoteLength()))){y=l.Fraction.plus(_.Timestamp,_.calculateMaxNoteLength());break}}}p.push(y)}for(let E=0,y=p.length;E<y;++E){const d=p[E];m.lt(d)&&(m=d)}return l.Fraction.max(m,f)}calculateInstrumentsDuration(e,f){const m=[];for(let p=0;p<e.Instruments.length;p++){let E=new l.Fraction(0,1);const y=e.getGlobalStaffIndexOfFirstStaff(e.Instruments[p]);for(let d=0;d<e.Instruments[p].Staves.length;d++){const S=this.getLastSourceStaffEntryForInstrument(y+d);if(void 0!==S&&S.Timestamp){const M=S.calculateMaxNoteLength(!1);E.lt(l.Fraction.plus(S.Timestamp,M))&&(E=l.Fraction.plus(S.Timestamp,M))}}E.lt(f[p])&&(E=f[p]),m.push(E)}return m}getEntriesPerStaff(e){const f=[];for(const m of this.VerticalSourceStaffEntryContainers){const p=m.StaffEntries[e];p&&f.push(p)}return f}hasBeginInstructions(){for(let e=0,f=this.FirstInstructionsStaffEntries.length;e<f;e++){const m=this.FirstInstructionsStaffEntries[e];if(void 0!==m&&m.Instructions.length>0)return!0}return!1}beginsWithRepetition(){return this.beginsWithLineRepetition()||this.beginsWithWordRepetition()}beginsWithLineRepetition(){for(let e=0,f=this.FirstRepetitionInstructions.length;e<f;++e){const m=this.FirstRepetitionInstructions[e];if(m.type===r.RepetitionInstructionEnum.StartLine){if(void 0!==m.parentRepetition&&m.parentRepetition.FromWords)continue;return!0}if(void 0!==m.parentRepetition&&m===m.parentRepetition.startMarker&&!m.parentRepetition.FromWords&&m.type!==r.RepetitionInstructionEnum.None)return!0}return!1}endsWithLineRepetition(){for(let e=0,f=this.LastRepetitionInstructions.length;e<f;++e){const m=this.LastRepetitionInstructions[e];if(m.type===r.RepetitionInstructionEnum.BackJumpLine)return!0;const p=m.parentRepetition;if(p&&!p.FromWords)for(let E=0,y=p.BackwardJumpInstructions.length;E<y;++E)if(m===p.BackwardJumpInstructions[E])return!0}return!1}beginsWithWordRepetition(){for(let e=0,f=this.FirstRepetitionInstructions.length;e<f;++e){const m=this.FirstRepetitionInstructions[e];if(void 0!==m.parentRepetition&&m===m.parentRepetition.startMarker&&m.parentRepetition.FromWords)return!0}return!1}endsWithWordRepetition(){for(let e=0,f=this.LastRepetitionInstructions.length;e<f;++e){const m=this.LastRepetitionInstructions[e],p=m.parentRepetition;if(p&&p.FromWords){for(let E=0,y=p.BackwardJumpInstructions.length;E<y;++E)if(m===p.BackwardJumpInstructions[E])return!0;if(m===p.forwardJumpInstruction)return!0}}return!1}beginsRepetitionEnding(){for(const e of this.FirstRepetitionInstructions)if(e.type===r.RepetitionInstructionEnum.Ending&&e.alignment===r.AlignmentType.Begin)return!0;return!1}endsRepetitionEnding(){for(const e of this.LastRepetitionInstructions)if(e.type===r.RepetitionInstructionEnum.Ending&&e.alignment===r.AlignmentType.End)return!0;return!1}getKeyInstruction(e){if(this.FirstInstructionsStaffEntries[e]){const f=this.FirstInstructionsStaffEntries[e];for(let m=0,p=f.Instructions.length;m<p;++m){const E=f.Instructions[m];if(E instanceof n.KeyInstruction)return E}}}getLastSourceStaffEntryForInstrument(e,f=!0){let m;for(let p=this.verticalSourceStaffEntryContainers.length-1;p>=0;p--)if(m=this.verticalSourceStaffEntryContainers[p].StaffEntries[e],m&&(!f||m.VoiceEntries.length>0))return m}canBeReducedToMultiRest(){if(this.firstRepetitionInstructions.length>0||this.lastRepetitionInstructions.length>0)return!1;let e=!0,f=!1;for(const m of this.verticalSourceStaffEntryContainers)if(m)for(const p of m.StaffEntries)if(p&&p.ParentStaff.isVisible()){if(p.ChordContainers.length>0)return!1;p.ParentStaff.hasLyrics&&(f=!0);for(const E of p.VoiceEntries){for(const y of E.Notes)if(!y.isRest()){e=!1;break}if(!e)break}}if(!e||f||this.hasMoodExpressions||this.tempoExpressions.length>0)return!1;for(const m of this.staffLinkedExpressions)if(m.length>0)return!1;for(const m of this.lastInstructionsStaffEntries)for(let p=0,E=m?.Instructions.length;p<E;++p)if(m.Instructions[p]instanceof o.ClefInstruction)return!1;return this.Duration?.RealValue===this.ActiveTimeSignature?.RealValue}}},2369(dt,g,u){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.SourceStaffEntry=void 0;const l=u(2561),s=u(164),c=u(4543),r=u(9288);g.SourceStaffEntry=class{constructor(i,o){this.voiceEntries=[],this.instructions=[],this.chordSymbolContainers=[],this.verticalContainerParent=i,this.parentStaff=o}get ParentStaff(){return this.parentStaff}get VerticalContainerParent(){return this.verticalContainerParent}get Timestamp(){if(this.VerticalContainerParent)return this.VerticalContainerParent.Timestamp}get AbsoluteTimestamp(){if(this.VerticalContainerParent)return l.Fraction.plus(this.VerticalContainerParent.ParentMeasure.AbsoluteTimestamp,this.VerticalContainerParent.Timestamp)}get VoiceEntries(){return this.voiceEntries}set VoiceEntries(i){this.voiceEntries=i}get Link(){return this.staffEntryLink}set Link(i){this.staffEntryLink=i}get Instructions(){return this.instructions}set Instructions(i){this.instructions=i}get ChordContainers(){return this.chordSymbolContainers}set ChordContainers(i){this.chordSymbolContainers=i}removeAllInstructionsOfTypeClefInstruction(){let i=0,o=0;for(;i<this.instructions.length;)this.instructions[i]instanceof s.ClefInstruction?(this.instructions.splice(i,1),o++):i++;return o}removeFirstInstructionOfTypeClefInstruction(){for(let i=0;i<this.instructions.length;i++)if(this.instructions[i]instanceof s.ClefInstruction)return this.instructions.splice(i,1),!0;return!1}removeAllInstructionsOfTypeKeyInstruction(){let i=0,o=0;for(;i<this.instructions.length;)this.instructions[i]instanceof c.KeyInstruction?(this.instructions.splice(i,1),o++):i++;return o}removeFirstInstructionOfTypeKeyInstruction(){for(let i=0;i<this.instructions.length;i++)if(this.instructions[i]instanceof c.KeyInstruction)return this.instructions.splice(i,1),!0;return!1}removeAllInstructionsOfTypeRhythmInstruction(){let i=0,o=0;for(;i<this.instructions.length;)this.instructions[i]instanceof r.RhythmInstruction?(this.instructions.splice(i,1),o++):i++;return o}removeFirstInstructionOfTypeRhythmInstruction(){for(let i=0;i<this.instructions.length;i++)if(this.instructions[i]instanceof r.RhythmInstruction)return this.instructions.splice(i,1),!0;return!1}calculateMinNoteLength(){let i=new l.Fraction(Number.MAX_VALUE,1);for(let o=0,n=this.VoiceEntries.length;o<n;++o){const h=this.VoiceEntries[o];for(let e=0,f=h.Notes.length;e<f;++e){const m=h.Notes[e];m.Length.lt(i)&&(i=m.Length)}}return i}calculateMaxNoteLength(i=!0){let o=new l.Fraction(0,1);for(let n=0,h=this.VoiceEntries.length;n<h;++n){const e=this.VoiceEntries[n];for(let f=0,m=e.Notes.length;f<m;++f){const p=e.Notes[f];if(i&&p.NoteTie){const E=l.Fraction.createFromFraction(p.Length);let y=!1;for(const d of p.NoteTie.Notes)d!==p?y&&E.Add(d.Length):y=!0;o.lt(E)&&(o=E)}else o.lt(p.Length)&&(o=p.Length)}}return o}hasNotes(){for(let i=0,o=this.VoiceEntries.length;i<o;++i)if(this.VoiceEntries[i].Notes.length>0)return!0;return!1}hasTie(){for(let i=0,o=this.VoiceEntries.length;i<o;++i)if(this.VoiceEntries[i].hasTie())return!0;return!1}findLinkedNotes(i){for(let o=0,n=this.voiceEntries.length;o<n;++o){const h=this.voiceEntries[o];for(let e=0,f=h.Notes.length;e<f;++e){const m=h.Notes[e];m.ParentStaffEntry===this&&i.push(m)}}}get hasOnlyRests(){for(const i of this.voiceEntries)for(const o of i.Notes)if(!o.isRest())return!1;return!0}}},1910(dt,g){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.Staff=void 0,g.Staff=class{constructor(u,l){this.isTab=!1,this.voices=[],this.volume=1,this.stafflineCount=5,this.hasLyrics=!1,this.openTieDict={},this.parentInstrument=u,this.id=l,this.audible=!0,this.Visible=!0,this.following=!0}get ParentInstrument(){return this.parentInstrument}set ParentInstrument(u){this.parentInstrument=u}get Voices(){return this.voices}get Id(){return this.id}get Volume(){return this.volume}set Volume(u){this.volume=u}get StafflineCount(){return this.stafflineCount}set StafflineCount(u){this.stafflineCount=u}isVisible(){return this.Visible&&this.ParentInstrument.Visible}}},6644(dt,g){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.StaffEntryLink=void 0,g.StaffEntryLink=class{constructor(u){this.linkStaffEntries=[],this.voiceEntry=u}get GetVoiceEntry(){return this.voiceEntry}get LinkStaffEntries(){return this.linkStaffEntries}set LinkStaffEntries(u){this.linkStaffEntries=u}}},9647(dt,g,u){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.TabNote=void 0;const l=u(1850);g.TabNote=class s extends l.Note{constructor(r,i,o,n,h,e,f,m){super(r,i,o,n,h),this.stringNumberTab=e,this.fretNumber=f,this.bendArray=m}get StringNumberTab(){return this.stringNumberTab}get FretNumber(){return this.fretNumber}get BendArray(){return this.bendArray}hasTabEffects(){return this.bendArray?.length>0}}},5274(dt,g,u){"use strict";var l=this&&this.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(g,"__esModule",{value:!0}),g.Tie=void 0;const s=u(2561),c=u(6362),r=l(u(3065));g.Tie=class{constructor(i,o){this.notes=[],this.TieNumber=1,this.TieDirection=c.PlacementEnum.NotYetDefined,this.NoteIndexToTieDirection={},this.AddNote(i),this.type=o}getTieDirection(i){if(!i)return this.TieDirection;for(let o=0;o<this.Notes.length;o++)if(this.Notes[o]===i)return this.NoteIndexToTieDirection[o]||this.TieDirection;return r.default.debug("tie.getTieDuration note not in tie.Notes"),this.TieDirection}get Notes(){return this.notes}get Type(){return this.type}get StartNote(){return this.notes[0]}get Duration(){const i=new s.Fraction;for(const o of this.notes)i.Add(o.Length);return i}get Pitch(){return this.StartNote.Pitch}AddNote(i){this.notes.push(i),i.NoteTie=this}}},4268(dt,g){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.Tuplet=void 0,g.Tuplet=class{constructor(u,l=!1){this.PlacementFromXml=!1,this.RenderTupletNumber=!0,this.notes=[],this.fractions=[],this.tupletLabelNumber=u,this.bracket=l}shouldBeBracketed(u,l,s,c=!1,r=!1){if(c)return r;if(u&&void 0!==this.BracketedXmlValue)return this.BracketedXmlValue;const i=this.Notes[0][0].NoteBeam;if(!i)return!0;for(const o of this.Notes)if(o[0].NoteBeam!==i)return!0;return this.Bracket||3===this.TupletLabelNumber&&s||3!==this.TupletLabelNumber&&l}get TupletLabelNumber(){return this.tupletLabelNumber}set TupletLabelNumber(u){this.tupletLabelNumber=u}get Notes(){return this.notes}set Notes(u){this.notes=u}get Fractions(){return this.fractions}set Fractions(u){this.fractions=u}get Bracket(){return this.bracket}set Bracket(u){this.bracket=u}getNoteIndex(u){for(let l=this.notes.length-1;l>=0;l--)for(let s=0;s<this.notes[l].length;s++)if(u===this.notes[l][s])return l;return 0}}},3236(dt,g,u){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.VerticalSourceStaffEntryContainer=void 0;const l=u(2561);g.VerticalSourceStaffEntryContainer=class{constructor(s,c,r){this.staffEntries=[],this.comments=[],this.timestamp=c,this.staffEntries=new Array(r),this.parentMeasure=s}$get$(s){return this.staffEntries[s]}$set$(s,c){this.staffEntries[s]=c}get Timestamp(){return this.timestamp}set Timestamp(s){this.timestamp=s}get StaffEntries(){return this.staffEntries}set StaffEntries(s){this.staffEntries=s}get Comments(){return this.comments}set Comments(s){this.comments=s}get ParentMeasure(){return this.parentMeasure}set ParentMeasure(s){this.parentMeasure=s}getAbsoluteTimestamp(){return l.Fraction.plus(this.timestamp,this.parentMeasure.AbsoluteTimestamp)}}},5534(dt,g){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.Voice=void 0,g.Voice=class{constructor(u,l){this.voiceEntries=[],this.volume=1,this.parent=u,this.visible=!0,this.audible=!0,this.following=!0,this.voiceId=l}get VoiceEntries(){return this.voiceEntries}get Parent(){return this.parent}get Visible(){return this.visible}set Visible(u){this.visible=u}get Audible(){return this.audible}set Audible(u){this.audible=u}get Following(){return this.following}set Following(u){this.following=u}get VoiceId(){return this.voiceId}get Volume(){return this.volume}set Volume(u){this.volume=u}}},1336(dt,g,u){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.StemDirectionType=g.ArticulationEnum=g.VoiceEntry=void 0;const l=u(2561),s=u(1850),c=u(8233),r=u(8215),i=u(8233),o=u(3263);class n{constructor(m,p,E,y=!1,d=!1,S=!1){if(this.notes=[],this.articulations=[],this.technicalInstructions=[],this.lyricsEntries=new o.Dictionary,this.wantedStemDirection=e.Undefined,this.stemDirectionXml=e.Undefined,this.stemDirection=e.Undefined,this.timestamp=m,this.parentVoice=p,this.parentSourceStaffEntry=E,this.isGrace=y,this.graceAfterMainNote=!1,this.graceNoteSlash=d,this.graceSlur=S,void 0!==E){const M=E.VoiceEntries;-1===M.indexOf(this)&&M.push(this)}}get ParentSourceStaffEntry(){return this.parentSourceStaffEntry}get ParentVoice(){return this.parentVoice}get Timestamp(){return this.timestamp}set Timestamp(m){this.timestamp=m}get Notes(){return this.notes}get IsGrace(){return this.isGrace}set IsGrace(m){this.isGrace=m}get GraceAfterMainNote(){return this.graceAfterMainNote}set GraceAfterMainNote(m){this.graceAfterMainNote=m}get GraceNoteSlash(){return this.graceNoteSlash}set GraceNoteSlash(m){this.graceNoteSlash=m}get GraceSlur(){return this.graceSlur}set GraceSlur(m){this.graceSlur=m}get Articulations(){return this.articulations}set Articulations(m){this.articulations=m}get TechnicalInstructions(){return this.technicalInstructions}get LyricsEntries(){return this.lyricsEntries}get Arpeggio(){return this.arpeggio}set Arpeggio(m){this.arpeggio=m}get OrnamentContainer(){return this.ornamentContainer}set OrnamentContainer(m){this.ornamentContainer=m}set WantedStemDirection(m){this.wantedStemDirection=m}get WantedStemDirection(){return this.wantedStemDirection}set StemDirectionXml(m){this.stemDirectionXml=m}get StemDirectionXml(){return this.stemDirectionXml}set StemDirection(m){this.stemDirection=m}get StemDirection(){return this.stemDirection}get StemColorXml(){return this.stemColorXml}set StemColorXml(m){this.stemColorXml=m}get StemColor(){return this.stemColor}set StemColor(m){this.stemColor=m}hasArticulation(m){for(const p of this.articulations)if(p.Equals(m))return!0;return!1}static isSupportedArticulation(m){switch(m){case h.accent:case h.strongaccent:case h.softaccent:case h.invertedstrongaccent:case h.staccato:case h.staccatissimo:case h.spiccato:case h.tenuto:case h.fermata:case h.invertedfermata:case h.breathmark:case h.caesura:case h.lefthandpizzicato:case h.naturalharmonic:case h.snappizzicato:case h.upbow:case h.downbow:case h.bend:return!0;default:return!1}}hasTie(){for(let m=0,p=this.Notes.length;m<p;++m)if(this.Notes[m].NoteTie)return!0;return!1}hasSlur(){for(let m=0,p=this.Notes.length;m<p;++m)if(this.Notes[m].NoteSlurs.length>0)return!0;return!1}isStaccato(){for(const m of this.Articulations)if(m.articulationEnum===h.staccato)return!0;return!1}isAccent(){for(const m of this.Articulations)if(m.articulationEnum===h.accent||m.articulationEnum===h.strongaccent)return!0;return!1}getVerseNumberForLyricEntry(m){let p="1";return this.lyricsEntries.forEach((E,y)=>{m===y&&(p=E)}),p}createVoiceEntriesForOrnament(m,p){m||(m=this);const E=[];if(!m.ornamentContainer)return;const y=this.notes[0],d=y.Length,S=m.ParentVoice,M=m.Timestamp;let x=l.Fraction.createFromFraction(M);switch(m.ornamentContainer.GetOrnament){case r.OrnamentEnum.Trill:{const _=new l.Fraction(d.Numerator,8*d.Denominator),I=y.Pitch.getTransposedPitch(1);let T=p.getAlterationForPitch(I);m.OrnamentContainer.AccidentalAbove!==i.AccidentalEnum.NONE&&(T=m.ornamentContainer.AccidentalAbove);for(let A=0;A<8;A++)x=l.Fraction.plus(M,new l.Fraction(A*_.Numerator,_.Denominator)),A%2==0?this.createBaseVoiceEntry(x,_,S,y,E):this.createAlteratedVoiceEntry(x,_,S,y.SourceMeasure,I,T,E);break}case r.OrnamentEnum.Turn:{const _=new l.Fraction(d.Numerator,4*d.Denominator),I=y.Pitch.getTransposedPitch(-1),T=p.getAlterationForPitch(I),A=y.Pitch.getTransposedPitch(1),v=p.getAlterationForPitch(A);this.createAlteratedVoiceEntry(x,_,S,y.SourceMeasure,A,v,E),x.Add(_),this.createBaseVoiceEntry(x,_,S,y,E),x.Add(_),this.createAlteratedVoiceEntry(x,_,S,y.SourceMeasure,I,T,E),x.Add(_),this.createBaseVoiceEntry(x,_,S,y,E);break}case r.OrnamentEnum.InvertedTurn:{const _=new l.Fraction(d.Numerator,4*d.Denominator),I=y.Pitch.getTransposedPitch(-1),T=p.getAlterationForPitch(I),A=y.Pitch.getTransposedPitch(1),v=p.getAlterationForPitch(A);this.createAlteratedVoiceEntry(x,_,S,y.SourceMeasure,I,T,E),x.Add(_),this.createBaseVoiceEntry(x,_,S,y,E),x.Add(_),this.createAlteratedVoiceEntry(x,_,S,y.SourceMeasure,A,v,E),x.Add(_),this.createBaseVoiceEntry(x,_,S,y,E);break}case r.OrnamentEnum.DelayedTurn:{const _=new l.Fraction(d.Numerator,2*d.Denominator),I=y.Pitch.getTransposedPitch(-1),T=p.getAlterationForPitch(I),A=y.Pitch.getTransposedPitch(1),v=p.getAlterationForPitch(A);this.createBaseVoiceEntry(x,_,S,y,E),x=l.Fraction.plus(M,_),_.Denominator=8*d.Denominator,this.createAlteratedVoiceEntry(x,_,S,y.SourceMeasure,A,v,E),x.Add(_),this.createBaseVoiceEntry(x,_,S,y,E),x.Add(_),this.createAlteratedVoiceEntry(x,_,S,y.SourceMeasure,I,T,E),x.Add(_),this.createBaseVoiceEntry(x,_,S,y,E);break}case r.OrnamentEnum.DelayedInvertedTurn:{const _=new l.Fraction(d.Numerator,2*d.Denominator),I=y.Pitch.getTransposedPitch(-1),T=p.getAlterationForPitch(I),A=y.Pitch.getTransposedPitch(1),v=p.getAlterationForPitch(A);this.createBaseVoiceEntry(x,_,S,y,E),x=l.Fraction.plus(M,_),_.Denominator=8*d.Denominator,this.createAlteratedVoiceEntry(x,_,S,y.SourceMeasure,I,T,E),x.Add(_),this.createBaseVoiceEntry(x,_,S,y,E),x.Add(_),this.createAlteratedVoiceEntry(x,_,S,y.SourceMeasure,A,v,E),x.Add(_),this.createBaseVoiceEntry(x,_,S,y,E);break}case r.OrnamentEnum.Mordent:{const _=new l.Fraction(d.Numerator,4*d.Denominator),I=y.Pitch.getTransposedPitch(1),T=p.getAlterationForPitch(I);this.createBaseVoiceEntry(x,_,S,y,E),x.Add(_),this.createAlteratedVoiceEntry(x,_,S,y.SourceMeasure,I,T,E),_.Denominator=2*d.Denominator,x=l.Fraction.plus(M,_),this.createBaseVoiceEntry(x,_,S,y,E);break}case r.OrnamentEnum.InvertedMordent:{const _=new l.Fraction(d.Numerator,4*d.Denominator),I=y.Pitch.getTransposedPitch(-1),T=p.getAlterationForPitch(I);this.createBaseVoiceEntry(x,_,S,y,E),x.Add(_),this.createAlteratedVoiceEntry(x,_,S,y.SourceMeasure,I,T,E),_.Denominator=2*d.Denominator,x=l.Fraction.plus(M,_),this.createBaseVoiceEntry(x,_,S,y,E);break}default:throw new RangeError}return E}createBaseVoiceEntry(m,p,E,y,d){const S=new n(m,E,y.ParentStaffEntry),M=new c.Pitch(y.Pitch.FundamentalNote,y.Pitch.Octave,y.Pitch.Accidental),x=new s.Note(S,void 0,p,M,y.SourceMeasure);S.Notes.push(x),d.push(S)}createAlteratedVoiceEntry(m,p,E,y,d,S,M){const x=new n(m,E,void 0),_=new c.Pitch(d.FundamentalNote,d.Octave,S),I=new s.Note(x,void 0,p,_,y);x.Notes.push(I),M.push(x)}}var h,e,f;g.VoiceEntry=n,(f=h||(g.ArticulationEnum=h={}))[f.accent=0]="accent",f[f.strongaccent=1]="strongaccent",f[f.softaccent=2]="softaccent",f[f.marcatoup=3]="marcatoup",f[f.marcatodown=4]="marcatodown",f[f.invertedstrongaccent=5]="invertedstrongaccent",f[f.staccato=6]="staccato",f[f.staccatissimo=7]="staccatissimo",f[f.spiccato=8]="spiccato",f[f.tenuto=9]="tenuto",f[f.fermata=10]="fermata",f[f.invertedfermata=11]="invertedfermata",f[f.breathmark=12]="breathmark",f[f.caesura=13]="caesura",f[f.lefthandpizzicato=14]="lefthandpizzicato",f[f.naturalharmonic=15]="naturalharmonic",f[f.snappizzicato=16]="snappizzicato",f[f.upbow=17]="upbow",f[f.downbow=18]="downbow",f[f.scoop=19]="scoop",f[f.plop=20]="plop",f[f.doit=21]="doit",f[f.falloff=22]="falloff",f[f.stress=23]="stress",f[f.unstress=24]="unstress",f[f.detachedlegato=25]="detachedlegato",f[f.otherarticulation=26]="otherarticulation",f[f.bend=27]="bend",function(f){f[f.Undefined=-1]="Undefined",f[f.Up=0]="Up",f[f.Down=1]="Down",f[f.None=2]="None",f[f.Double=3]="Double"}(e||(g.StemDirectionType=e={}))},7456(dt,g,u){"use strict";var l=this&&this.__createBinding||(Object.create?function(c,r,i,o){void 0===o&&(o=i);var n=Object.getOwnPropertyDescriptor(r,i);n&&!("get"in n?!r.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return r[i]}}),Object.defineProperty(c,o,n)}:function(c,r,i,o){void 0===o&&(o=i),c[o]=r[i]}),s=this&&this.__exportStar||function(c,r){for(var i in c)"default"===i||Object.prototype.hasOwnProperty.call(r,i)||l(r,c,i)};Object.defineProperty(g,"__esModule",{value:!0}),s(u(4236),g),s(u(8365),g),s(u(9719),g),s(u(7718),g),s(u(4249),g),s(u(1850),g),s(u(4064),g),s(u(5282),g),s(u(8215),g),s(u(4387),g),s(u(2369),g),s(u(1910),g),s(u(6644),g),s(u(5274),g),s(u(4268),g),s(u(3236),g),s(u(5534),g),s(u(1336),g),s(u(9184),g),s(u(1850),g),s(u(5282),g),s(u(4387),g),s(u(2369),g),s(u(3236),g),s(u(5274),g)},1745(dt,g,u){"use strict";var l=this&&this.__createBinding||(Object.create?function(c,r,i,o){void 0===o&&(o=i);var n=Object.getOwnPropertyDescriptor(r,i);n&&!("get"in n?!r.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return r[i]}}),Object.defineProperty(c,o,n)}:function(c,r,i,o){void 0===o&&(o=i),c[o]=r[i]}),s=this&&this.__exportStar||function(c,r){for(var i in c)"default"===i||Object.prototype.hasOwnProperty.call(r,i)||l(r,c,i)};Object.defineProperty(g,"__esModule",{value:!0}),s(u(7307),g),s(u(9252),g),s(u(7586),g),s(u(7435),g),s(u(427),g),s(u(5294),g),s(u(7456),g),s(u(4076),g),s(u(1121),g),s(u(6352),g),s(u(899),g),s(u(2870),g)},3173(dt,g){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.AJAX=void 0,g.AJAX=class{static ajax(u,l=9e3){let s;const c=u.indexOf(".mxl")>-1?"text/plain; charset=x-user-defined":"application/xml";if(XMLHttpRequest)s=new XMLHttpRequest;else{if(!ActiveXObject)return Promise.reject(new Error("XMLHttp not supported."));s=new ActiveXObject("Microsoft.XMLHTTP")}return s.timeout=l,new Promise((r,i)=>{s.onreadystatechange=()=>{s.readyState===XMLHttpRequest.DONE&&(200===s.status||0===s.status&&s.responseText?r(s.responseText):i(new Error("Could not retrieve requested URL "+s.status)))},s.ontimeout=o=>{i(new Error("Server request Timeout"))},s.overrideMimeType(c),s.open("GET",u,!0),s.send()})}}},6597(dt,g,u){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.Cursor=void 0;const l=u(2561),s=u(624);g.Cursor=class{constructor(c,r,i){this.hidden=!0,this.currentPageNumber=1,this.skipInvisibleNotes=!0,this.container=c,this.openSheetMusicDisplay=r,this.rules=this.openSheetMusicDisplay.EngravingRules,this.cursorOptions=i;let o=0;for(this.cursorElementId="cursorImg-0";document.getElementById(this.cursorElementId);)o++,this.cursorElementId=`cursorImg-${o}`;const n=document.createElement("img");n.id=this.cursorElementId,n.style.position="absolute",!0===this.cursorOptions.follow?(this.wantedZIndex="-1",n.style.zIndex=this.wantedZIndex):(this.wantedZIndex="-2",n.style.zIndex=this.wantedZIndex),this.cursorElement=n,this.container.appendChild(n)}adjustToBackgroundColor(){let c;c=this.rules.PageBackgroundColor?"1":this.wantedZIndex,this.cursorElement.style.zIndex=c}init(c,r){this.manager=c,this.graphic=r,this.reset(),this.hidden=!0,this.hide()}
1show(){this.hidden=!1,this.update(),this.adjustToBackgroundColor()}resetIterator(){if(!this.openSheetMusicDisplay.Sheet||!this.openSheetMusicDisplay.Sheet.SourceMeasures)return void console.log("OSMD.Cursor.resetIterator(): sheet or measures were null/undefined.");const c=this.openSheetMusicDisplay.Sheet.SourceMeasures.length-1;let r=this.rules.MinMeasureToDrawIndex;r=Math.min(r,c);let i=this.rules.MaxMeasureToDrawIndex;if(i=Math.min(i,c),this.openSheetMusicDisplay.Sheet&&this.openSheetMusicDisplay.Sheet.SourceMeasures.length>r&&(this.openSheetMusicDisplay.Sheet.SelectionStart=this.openSheetMusicDisplay.Sheet.SourceMeasures[r].AbsoluteTimestamp),this.openSheetMusicDisplay.Sheet&&this.openSheetMusicDisplay.Sheet.SourceMeasures.length>i){const o=this.openSheetMusicDisplay.Sheet.SourceMeasures[i];this.openSheetMusicDisplay.Sheet.SelectionEnd=l.Fraction.plus(o.AbsoluteTimestamp,o.Duration)}this.iterator=this.manager.getIterator(),this.iterator.SkipInvisibleNotes=this.skipInvisibleNotes}getStaffEntryFromVoiceEntry(c){return this.graphic.findGraphicalStaffEntryFromMeasureList(c.ParentSourceStaffEntry.ParentStaff.idInMusicSheet,c.ParentSourceStaffEntry.VerticalContainerParent.ParentMeasure.measureListIndex,c.ParentSourceStaffEntry)}update(){if(this.hidden||null==this.hidden)return;this.updateCurrentPage();const c=this.iterator;let r,i=c.CurrentVisibleVoiceEntries(),o=c.CurrentMeasureIndex,n=0,h=0,e=0;if(0!==i.length||c.FrontReached||c.EndReached||(c.moveToPrevious(),i=c.CurrentVisibleVoiceEntries(),c.moveToNext()),c.FrontReached&&0===i.length){c.moveToNext(),i=c.CurrentVisibleVoiceEntries();const y=this.findVisibleGraphicalMeasure(c.CurrentMeasureIndex);n=y.PositionAndShape.AbsolutePosition.x,r=y.ParentMusicSystem,c.moveToPrevious()}else if(c.EndReached||!c.CurrentVoiceEntries||0===i.length){c.moveToPrevious(),i=c.CurrentVisibleVoiceEntries(),o=c.CurrentMeasureIndex;const y=this.findVisibleGraphicalMeasure(c.CurrentMeasureIndex);n=y.PositionAndShape.AbsolutePosition.x+y.PositionAndShape.Size.width,r=y.ParentMusicSystem,c.moveToNext()}else if(c.CurrentMeasure.isReducedToMultiRest){const y=this.findVisibleGraphicalMeasure(c.CurrentMeasureIndex);n=y.PositionAndShape.AbsolutePosition.x+y.beginInstructionsWidth+c.CurrentMeasure.multipleRestMeasureNumber/(y.parentSourceMeasure.multipleRestMeasures+1)*(y.PositionAndShape.Size.width-y.beginInstructionsWidth),r=y.ParentMusicSystem}else{const y=i.map(d=>this.getStaffEntryFromVoiceEntry(d)).sort((d,S)=>d?.PositionAndShape?.AbsolutePosition?.x<=S?.PositionAndShape?.AbsolutePosition?.x?-1:1)[0];y&&(n=y.PositionAndShape.AbsolutePosition.x,r=y.parentMeasure.ParentMusicSystem)}if(!r?.StaffLines[0])return;h=r.PositionAndShape.AbsolutePosition.y+r.StaffLines[0].PositionAndShape.RelativePosition.y;let f=r.PositionAndShape.AbsolutePosition.y;const m=r.StaffLines[r.StaffLines.length-1];m&&(f+=m.PositionAndShape.RelativePosition.y+m.StaffHeight),e=f-h;const p=this.findVisibleGraphicalMeasure(o);if(p){if(this.updateWidthAndStyle(p.PositionAndShape,n,h,e),this.openSheetMusicDisplay.FollowCursor&&this.cursorOptions.follow)if(this.openSheetMusicDisplay.EngravingRules.RenderSingleHorizontalStaffline)this.cursorElement.scrollIntoView({behavior:"smooth",inline:"center"});else{const y=this.cursorElement.getBoundingClientRect().top;this.cursorElement.scrollIntoView({behavior:y<1e3?"smooth":"auto",block:"center"})}this.cursorElement.style.display=""}}findVisibleGraphicalMeasure(c){for(let r=0;r<this.graphic.NumberOfStaves;r++){const i=this.graphic.findGraphicalMeasure(this.iterator.CurrentMeasureIndex,r);if(i?.ParentStaff.isVisible())return i}}updateWidthAndStyle(c,r,i,o){const n=this.cursorElement;let h=0;switch(this.cursorOptions.type){case s.CursorType.ThinLeft:n.style.top=10*i*this.openSheetMusicDisplay.zoom+"px",n.style.left=10*(r-1.5)*this.openSheetMusicDisplay.zoom+"px",n.height=10*o*this.openSheetMusicDisplay.zoom,h=5*this.openSheetMusicDisplay.zoom;break;case s.CursorType.ShortThinTopLeft:n.style.top=10*(i-2.5)*this.openSheetMusicDisplay.zoom+"px",n.style.left=10*r*this.openSheetMusicDisplay.zoom+"px",n.height=15*this.openSheetMusicDisplay.zoom,h=5*this.openSheetMusicDisplay.zoom;break;case s.CursorType.CurrentArea:n.style.top=10*c.AbsolutePosition.y*this.openSheetMusicDisplay.zoom+"px",n.style.left=10*c.AbsolutePosition.x*this.openSheetMusicDisplay.zoom+"px",n.height=10*o*this.openSheetMusicDisplay.zoom,h=10*c.Size.width*this.openSheetMusicDisplay.zoom;break;case s.CursorType.CurrentAreaLeft:n.style.top=10*c.AbsolutePosition.y*this.openSheetMusicDisplay.zoom+"px",n.style.left=10*c.AbsolutePosition.x*this.openSheetMusicDisplay.zoom+"px",n.height=10*o*this.openSheetMusicDisplay.zoom,h=10*(r-c.AbsolutePosition.x)*this.openSheetMusicDisplay.zoom;break;default:n.style.top=10*i*this.openSheetMusicDisplay.zoom+"px",n.style.left=10*(r-1.5)*this.openSheetMusicDisplay.zoom+"px",n.height=10*o*this.openSheetMusicDisplay.zoom,h=30*this.openSheetMusicDisplay.zoom}n.width=h,this.cursorOptionsRendered!==this.cursorOptions&&this.updateStyle(h,this.cursorOptions)}hide(){this.cursorElement.style.display="none",this.hidden=!0}
vendor: 20,616 bytes, line 1
1previous(){this.iterator.moveToPreviousVisibleVoiceEntry(!1),this.update()}next(){this.iterator.moveToNextVisibleVoiceEntry(!1),this.update()}reset(){this.resetIterator(),this.update()}updateStyle(c,r=void 0){void 0!==r&&(this.cursorOptions=r);const i=document.createElement("canvas");i.width=this.cursorElement.width,i.height=1;const o=i.getContext("2d");o.globalAlpha=this.cursorOptions.alpha;const n=o.createLinearGradient(0,0,this.cursorElement.width,0);switch(this.cursorOptions.type){case s.CursorType.ThinLeft:case s.CursorType.ShortThinTopLeft:case s.CursorType.CurrentArea:case s.CursorType.CurrentAreaLeft:n.addColorStop(1,this.cursorOptions.color);break;default:n.addColorStop(0,"white"),n.addColorStop(.2,this.cursorOptions.color),n.addColorStop(.8,this.cursorOptions.color),n.addColorStop(1,"white")}o.fillStyle=n,o.fillRect(0,0,c,1),this.cursorOptionsRendered={...this.cursorOptions},this.cursorElement.src=i.toDataURL("image/png")}get Iterator(){return this.iterator}get Hidden(){return this.hidden}VoicesUnderCursor(c){return this.iterator.CurrentVisibleVoiceEntries(c)}NotesUnderCursor(c){const r=this.VoicesUnderCursor(c),i=[];return r.forEach(o=>{i.push(...o.Notes)}),i}GNotesUnderCursor(c){const r=this.VoicesUnderCursor(c),i=[];return r.forEach(o=>{i.push(...o.Notes.map(n=>this.rules.GNote(n)))}),i}updateCurrentPage(){let c=this.iterator.currentTimeStamp;c.RealValue<0&&(c=new l.Fraction(0,0));for(const r of this.graphic.MusicPages)if(r.MusicSystems.last().GetSystemsLastTimeStamp().gt(c)){const i=r.PageNumber;return i!==this.currentPageNumber&&(this.container.removeChild(this.cursorElement),this.container=document.getElementById("osmdCanvasPage"+i),this.container.appendChild(this.cursorElement)),this.currentPageNumber=i}return 1}get SkipInvisibleNotes(){return this.skipInvisibleNotes}set SkipInvisibleNotes(c){this.skipInvisibleNotes=c,this.iterator.SkipInvisibleNotes=c}get CursorOptions(){return this.cursorOptions}set CursorOptions(c){this.cursorOptions=c}Dispose(){this.hide(),this.container.removeChild(this.cursorElement),this.rules=void 0,this.openSheetMusicDisplay=void 0,this.cursorOptions=void 0}nextMeasure(){const c=this.Iterator.CurrentMeasure;let r=this.Iterator.currentTimeStamp.RealValue;this.next();let i=0;for(;this.Iterator.CurrentMeasure===c&&this.Iterator.currentTimeStamp.RealValue!==r&&i<999;)r=this.Iterator.currentTimeStamp.RealValue,this.next(),i++}previousMeasure(){const c=this.Iterator.CurrentMeasure;let r=this.Iterator.currentTimeStamp.RealValue;this.previous();let i=0;for(;this.Iterator.CurrentMeasure===c&&this.Iterator.currentTimeStamp.RealValue!==r&&i<999;)r=this.Iterator.currentTimeStamp.RealValue,this.previous(),i++;for(i=0;0!==this.Iterator.CurrentRelativeInMeasureTimestamp.RealValue&&i<999;)this.previous(),i++}}},624(dt,g,u){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.OSMDOptions=g.SkyBottomLineBatchCalculatorBackendType=g.BackendType=g.FillEmptyMeasuresWithWholeRests=g.AlignRestOption=g.CursorType=void 0;const l=u(4146);var s,c,r,i,o,n;(n=s||(g.CursorType=s={}))[n.Standard=0]="Standard",n[n.ThinLeft=1]="ThinLeft",n[n.ShortThinTopLeft=2]="ShortThinTopLeft",n[n.CurrentArea=3]="CurrentArea",n[n.CurrentAreaLeft=4]="CurrentAreaLeft",function(n){n[n.Never=0]="Never",n[n.Always=1]="Always",n[n.Auto=2]="Auto"}(c||(g.AlignRestOption=c={})),function(n){n[n.No=0]="No",n[n.YesVisible=1]="YesVisible",n[n.YesInvisible=2]="YesInvisible"}(r||(g.FillEmptyMeasuresWithWholeRests=r={})),function(n){n[n.SVG=0]="SVG",n[n.Canvas=1]="Canvas"}(i||(g.BackendType=i={})),function(n){n[n.Plain=0]="Plain",n[n.WebGL=1]="WebGL"}(o||(g.SkyBottomLineBatchCalculatorBackendType=o={})),g.OSMDOptions=class{static OSMDOptionsStandard(){return{autoResize:!0,backend:"svg",drawingParameters:l.DrawingParametersEnum.default}}static BackendTypeFromString(n){return n&&"canvas"===n.toLowerCase()?i.Canvas:i.SVG}}},7103(dt,g,u){"use strict";var l=this&&this.__importDefault||function(D){return D&&D.__esModule?D:{default:D}};Object.defineProperty(g,"__esModule",{value:!0}),g.OpenSheetMusicDisplay=void 0;const s=u(3902),c=u(806),r=u(9099),i=u(8724),o=u(7921),n=u(9479),h=u(9436),e=u(9834),f=u(6597),m=u(6888),p=u(3173),E=l(u(3065)),y=u(3661),d=u(4146),S=u(4434),M=u(624),x=u(9713),_=u(6362),I=u(3263),T=u(2683),A=u(8233),v=u(1538);class B{constructor(L,F=M.OSMDOptions.OSMDOptionsStandard()){if(this.version="1.9.9-release",this.cursorsOptions=[],this.cursors=[],this.zoom=1,this.zoomUpdated=!1,this.loadUrlTimeout=5e3,"string"==typeof L?this.container=document.getElementById(L):L&&"appendChild"in L&&(this.container=L),!this.container)throw new Error("Please pass a valid div container to OpenSheetMusicDisplay");void 0===F.autoResize&&(F.autoResize=!0),this.backendType=M.BackendType.SVG,this.setOptions(F)}get cursor(){return this.cursors[0]}get Cursor(){return this.cursor}load(L,F="Untitled Score"){this.reset();const V=this;if(L instanceof Blob){const ot=new m.MXLFile(L);return ot.tryUnzip().then(()=>ot.unzipSuccessful?ot.getXmlString().then($=>V.load($)):L instanceof Blob?L.text().then($=>V.load($)):void 0)}if("string"==typeof L){const ot=L;if(ot.startsWith("PK\x03\x04"))return E.default.debug("[OSMD] This is a zip file, unpack it first: "+ot),m.MXLHelper.MXLtoXMLstring(ot).then(it=>V.load(it),it=>{throw E.default.debug(it),new Error("OpenSheetMusicDisplay: Invalid MXL file")});if(ot.startsWith("\uf7ef\uf7bb\uf7bf"))return E.default.debug("[OSMD] UTF with BOM detected, truncate first 3 bytes and pass along: "+ot),V.load(ot.substring(3));let $=ot;if(/^\s/.test($)&&($=$.trim()),$.startsWith("<?xml")){const it=this.OnXMLRead($);E.default.debug("[OSMD] Finally parsing XML content, length: "+it.length),L=(new DOMParser).parseFromString(it,"application/xml")}else{if($.length<2083)return E.default.debug("[OSMD] Retrieve the file at the given URL: "+$),p.AJAX.ajax($,this.loadUrlTimeout).then(it=>V.load(it),it=>{throw it});console.error("[OSMD] osmd.load(string): Could not process string. Did not find <?xml at beginning.")}}if(!L||!L.nodeName)return Promise.reject(new Error("OpenSheetMusicDisplay: The document which was provided is invalid"));const P=L.childNodes;let U;E.default.debug("[OSMD] load(), Document url: "+L.URL);for(let ot=0,$=P.length;ot<$;ot+=1){const it=P[ot];if(it.nodeType===Node.ELEMENT_NODE&&"score-partwise"===it.nodeName.toLowerCase()){U=it;break}}if(!U)return console.error("Could not parse MusicXML, no valid partwise element found"),Promise.reject(new Error("OpenSheetMusicDisplay: Document is not a valid 'partwise' MusicXML"));const Y=new s.IXmlElement(U),H=new v.TemposCalculator,Q=new r.MusicSheetReader([H],this.rules);return this.sheet=Q.createMusicSheet(Y,F),void 0===this.sheet?Promise.reject(new Error("given music sheet was incomplete or could not be loaded.")):(E.default.info(`[OSMD] Loaded sheet ${this.sheet.TitleString} successfully.`),this.needBackendUpdate=!0,this.updateGraphic(),Promise.resolve({}))}updateGraphic(){const L=new c.VexFlowMusicSheetCalculator(this.rules);this.graphic=new i.GraphicalMusicSheet(this.sheet,L),this.drawingParameters.drawCursors&&this.cursors.forEach(F=>{F.init(this.sheet.MusicPartManager,this.graphic)}),this.drawingParameters.DrawingParametersEnum===d.DrawingParametersEnum.leadsheet&&(this.graphic.LeadSheet=!0)}render(){if(!this.graphic)throw new Error("OSMD: load() needs to be called before render()");this.drawer?.clear(),this.Sheet.SourceMeasures[0].ImplicitMeasure&&(this.rules.MinMeasureToDrawNumber>1&&(this.rules.MinMeasureToDrawIndex=this.rules.MinMeasureToDrawNumber),this.rules.MaxMeasureToDrawNumber>0&&(this.rules.MaxMeasureToDrawIndex=this.rules.MaxMeasureToDrawNumber));let L=this.container.offsetWidth;this.rules.RenderSingleHorizontalStaffline&&(L=this.rules.SheetMaximumWidth),this.sheet.pageWidth=L/this.zoom/10,this.rules.PageFormat&&!this.rules.PageFormat.IsUndefined?(this.rules.PageHeight=this.sheet.pageWidth/this.rules.PageFormat.aspectRatio,E.default.debug("[OSMD] PageHeight: "+this.rules.PageHeight)):(E.default.debug("[OSMD] endless/undefined pageformat, id: "+this.rules.PageFormat.idString),this.rules.PageHeight=100001),this.graphic.reCalculate(),this.drawingParameters.drawCursors&&(this.graphic.Cursors.length=0),this.createOrRefreshRenderBackend(),this.needBackendUpdate=!1,this.drawer.setZoom(this.zoom),this.drawer.drawSheet(this.graphic),this.enableOrDisableCursors(this.drawingParameters.drawCursors),this.drawingParameters.drawCursors&&this.cursors.forEach(F=>{F.update()}),this.zoomUpdated=!1,this.rules.RenderCount++}createOrRefreshRenderBackend(){if(this.drawer&&this.drawer.Backends){this.drawer.Backends[0]&&this.drawer.Backends[0].removeAllChildrenFromContainer(this.container);for(const j of this.drawer.Backends)j.free();this.drawer.Backends.clear()}this.drawingParameters.Rules=this.rules,this.drawer=new n.VexFlowMusicSheetDrawer(this.drawingParameters),this.drawer.drawableBoundingBoxElement=this.DrawBoundingBox,this.drawer.bottomLineVisible=this.drawBottomLine,this.drawer.skyLineVisible=this.drawSkyLine;let L,F=this.container.offsetWidth;this.rules.RenderSingleHorizontalStaffline&&(F=10*(this.EngravingRules.PageLeftMargin+this.graphic.MusicPages[0].PositionAndShape.Size.width+this.EngravingRules.PageRightMargin)*this.zoom);const V=32767;for(const j of this.graphic.MusicPages){if(j.PageNumber>this.rules.MaxPageToDrawNumber)break;const P=this.createBackend(this.backendType,j),U=" exceeds CanvasBackend limit of 32767. Cutting off score.";P.getOSMDBackendType()===M.BackendType.Canvas&&F>V&&(E.default.warn("[OSMD] Warning: width of "+F+U),F=V),this.rules.PageFormat&&!this.rules.PageFormat.IsUndefined?L=F/this.rules.PageFormat.aspectRatio:(L=j.PositionAndShape.Size.height,L+=this.rules.PageBottomMargin,P.getOSMDBackendType()===M.BackendType.Canvas&&(L+=.1),L+=j.PositionAndShape.BorderTop,this.rules.RenderTitle&&(L+=this.rules.TitleTopDistance),L*=10*this.zoom),P.getOSMDBackendType()===M.BackendType.Canvas&&L>V&&(E.default.warn("[OSMD] Warning: height of "+L+U),L=Math.min(L,V)),P.resize(F,L),P.clear(),P.getContext().setFillStyle(this.rules.DefaultColorMusic),P.getContext().setStrokeStyle(this.rules.DefaultColorMusic),this.drawer.Backends.push(P),this.graphic.drawer=this.drawer}}exportSVG(){if(this.drawer)for(const L of this.drawer.Backends)L instanceof h.SvgVexFlowBackend&&L.export()}IsReadyToRender(){return void 0!==this.graphic}clear(){this.drawer?.clear(),this.reset()}setOptions(L){if(this.rules||(this.rules=new x.EngravingRules),this.drawingParameters||L.drawingParameters?L.drawingParameters&&(this.drawingParameters?this.drawingParameters.DrawingParametersEnum=d.DrawingParametersEnum[L.drawingParameters.toLowerCase()]:this.drawingParameters=new y.DrawingParameters(d.DrawingParametersEnum[L.drawingParameters],this.rules)):this.drawingParameters=new y.DrawingParameters(d.DrawingParametersEnum.default,this.rules),null==L)return void E.default.warn("warning: osmd.setOptions() called without an options parameter, has no effect.\nexample usage: osmd.setOptions({drawCredits: false, drawPartNames: false})");this.OnXMLRead=function(j){return j},L.onXMLRead&&(this.OnXMLRead=L.onXMLRead);let F=!this.drawer||!this.drawer.Backends||this.drawer.Backends.length<1;if(void 0!==L.backend){const j=M.OSMDOptions.BackendTypeFromString(L.backend);F=F||this.backendType!==j,this.backendType=j}this.needBackendUpdate=F,void 0!==L.autoBeam&&(this.rules.AutoBeamNotes=L.autoBeam);const V=L.autoBeamOptions;if(V&&(void 0===V.maintain_stem_directions&&(V.maintain_stem_directions=!1),this.rules.AutoBeamOptions=V,V.groups&&V.groups.length))for(const j of V.groups)if(2!==j.length)throw new Error("Each fraction in autoBeamOptions.groups must be of length 2, e.g. [3,4] for beaming three fourths");void 0!==L.percussionOneLineCutoff&&(this.rules.PercussionOneLineCutoff=L.percussionOneLineCutoff),0!==this.rules.PercussionOneLineCutoff&&void 0!==L.percussionForceVoicesOneLineCutoff&&(this.rules.PercussionForceVoicesOneLineCutoff=L.percussionForceVoicesOneLineCutoff),void 0!==L.alignRests&&(this.rules.AlignRests=L.alignRests),void 0!==L.coloringMode&&this.setColoringMode(L),void 0!==L.coloringEnabled&&(this.rules.ColoringEnabled=L.coloringEnabled),void 0!==L.colorStemsLikeNoteheads&&(this.rules.ColorStemsLikeNoteheads=L.colorStemsLikeNoteheads),L.disableCursor&&(this.drawingParameters.drawCursors=!1),L.drawHiddenNotes&&(this.drawingParameters.drawHiddenNotes=!0),void 0!==L.drawCredits&&(this.drawingParameters.DrawCredits=L.drawCredits),void 0!==L.drawComposer&&(this.drawingParameters.DrawComposer=L.drawComposer),void 0!==L.drawTitle&&(this.drawingParameters.DrawTitle=L.drawTitle),void 0!==L.drawSubtitle&&(this.drawingParameters.DrawSubtitle=L.drawSubtitle),void 0!==L.drawLyricist&&(this.drawingParameters.DrawLyricist=L.drawLyricist),void 0!==L.drawMetronomeMarks&&(this.rules.MetronomeMarksDrawn=L.drawMetronomeMarks),void 0!==L.drawPartNames&&(this.drawingParameters.DrawPartNames=L.drawPartNames,L.drawPartAbbreviations||(this.rules.RenderPartAbbreviations=L.drawPartNames)),void 0!==L.drawPartAbbreviations&&(this.rules.RenderPartAbbreviations=L.drawPartAbbreviations),!1===L.drawFingerings&&(this.rules.RenderFingerings=!1),void 0!==L.drawMeasureNumbers&&(this.rules.RenderMeasureNumbers=L.drawMeasureNumbers),L.drawMeasureNumbersOnlyAtSystemStart&&(this.rules.RenderMeasureNumbersOnlyAtSystemStart=L.drawMeasureNumbersOnlyAtSystemStart),void 0!==L.drawLyrics&&(this.rules.RenderLyrics=L.drawLyrics),void 0!==L.drawTimeSignatures&&(this.rules.RenderTimeSignatures=L.drawTimeSignatures),void 0!==L.drawSlurs&&(this.rules.RenderSlurs=L.drawSlurs),void 0!==L.measureNumberInterval&&(this.rules.MeasureNumberLabelOffset=L.measureNumberInterval),void 0!==L.useXMLMeasureNumbers&&(this.rules.UseXMLMeasureNumbers=L.useXMLMeasureNumbers),void 0!==L.fingeringPosition&&(this.rules.FingeringPosition=_.AbstractExpression.PlacementEnumFromString(L.fingeringPosition)),void 0!==L.fingeringInsideStafflines&&(this.rules.FingeringInsideStafflines=L.fingeringInsideStafflines),void 0!==L.newSystemFromXML&&(this.rules.NewSystemAtXMLNewSystemAttribute=L.newSystemFromXML),void 0!==L.newSystemFromNewPageInXML&&(this.rules.NewSystemAtXMLNewPageAttribute=L.newSystemFromNewPageInXML),void 0!==L.newPageFromXML&&(this.rules.NewPageAtXMLNewPageAttribute=L.newPageFromXML),void 0!==L.fillEmptyMeasuresWithWholeRest&&(this.rules.FillEmptyMeasuresWithWholeRest=L.fillEmptyMeasuresWithWholeRest),void 0!==L.followCursor&&(this.FollowCursor=L.followCursor),void 0!==L.setWantedStemDirectionByXml&&(this.rules.SetWantedStemDirectionByXml=L.setWantedStemDirectionByXml),L.darkMode?(this.rules.applyDefaultColorMusic("#FFFFFF"),this.rules.PageBackgroundColor="#000000",this.rules.DarkModeEnabled=!0):!1===L.darkMode&&(this.rules.applyDefaultColorMusic("#000000"),this.rules.PageBackgroundColor=void 0,this.rules.DarkModeEnabled=!1),L.defaultColorMusic&&this.rules.applyDefaultColorMusic(L.defaultColorMusic),L.defaultColorNotehead&&(this.rules.DefaultColorNotehead=L.defaultColorNotehead),L.defaultColorRest&&(this.rules.DefaultColorRest=L.defaultColorRest),L.defaultColorStem&&(this.rules.DefaultColorStem=L.defaultColorStem),L.defaultColorLabel&&(this.rules.DefaultColorLabel=L.defaultColorLabel),L.defaultColorTitle&&(this.rules.DefaultColorTitle=L.defaultColorTitle),L.defaultFontFamily&&(this.rules.DefaultFontFamily=L.defaultFontFamily),L.defaultFontStyle&&(this.rules.DefaultFontStyle=L.defaultFontStyle),L.drawUpToMeasureNumber>=0&&(this.rules.MaxMeasureToDrawIndex=Math.max(L.drawUpToMeasureNumber-1,0),this.rules.MaxMeasureToDrawNumber=L.drawUpToMeasureNumber),L.drawFromMeasureNumber>=0&&(this.rules.MinMeasureToDrawIndex=Math.max(L.drawFromMeasureNumber-1,0),this.rules.MinMeasureToDrawNumber=L.drawFromMeasureNumber),L.drawUpToPageNumber&&(this.rules.MaxPageToDrawNumber=L.drawUpToPageNumber),L.drawUpToSystemNumber&&(this.rules.MaxSystemToDrawNumber=L.drawUpToSystemNumber),L.tupletsRatioed&&(this.rules.TupletsRatioed=!0),L.tupletsBracketed&&(this.rules.TupletsBracketed=!0),L.tripletsBracketed&&(this.rules.TripletsBracketed=!0),L.autoResize?(this.resizeHandlerAttached||this.autoResize(),this.autoResizeEnabled=!0):!1===L.autoResize&&(this.autoResizeEnabled=!1),void 0!==L.pageFormat&&this.setPageFormat(L.pageFormat),void 0!==L.pageBackgroundColor&&(this.rules.PageBackgroundColor=L.pageBackgroundColor),void 0!==L.renderSingleHorizontalStaffline&&(this.rules.RenderSingleHorizontalStaffline=L.renderSingleHorizontalStaffline),void 0!==L.spacingFactorSoftmax&&(this.rules.SoftmaxFactorVexFlow=L.spacingFactorSoftmax),void 0!==L.spacingBetweenTextLines&&(this.rules.SpacingBetweenTextLines=L.spacingBetweenTextLines),void 0!==L.stretchLastSystemLine&&(this.rules.StretchLastSystemLine=L.stretchLastSystemLine),void 0!==L.autoGenerateMultipleRestMeasuresFromRestMeasures&&(this.rules.AutoGenerateMultipleRestMeasuresFromRestMeasures=L.autoGenerateMultipleRestMeasuresFromRestMeasures),this.cursorsOptions=void 0!==L.cursorsOptions?L.cursorsOptions:[{type:M.CursorType.Standard,color:this.EngravingRules.DefaultColorCursor,alpha:.5,follow:!0}],void 0!==L.preferredSkyBottomLineBatchCalculatorBackend&&(this.rules.PreferredSkyBottomLineBatchCalculatorBackend=L.preferredSkyBottomLineBatchCalculatorBackend),void 0!==L.skyBottomLineBatchMinMeasures&&(this.rules.SkyBottomLineBatchMinMeasures=L.skyBottomLineBatchMinMeasures)}setColoringMode(L){if(L.coloringMode===S.ColoringModes.XML)return void(this.rules.ColoringMode=S.ColoringModes.XML);const F=[A.NoteEnum.C,A.NoteEnum.D,A.NoteEnum.E,A.NoteEnum.F,A.NoteEnum.G,A.NoteEnum.A,A.NoteEnum.B];let V;if(L.coloringMode===S.ColoringModes.CustomColorSet){if(!L.coloringSetCustom||8!==L.coloringSetCustom.length)throw new Error("Invalid amount of colors: With coloringModes.customColorSet, you have to provide a coloringSetCustom parameter (array) with 8 strings (C to B, rest note).");for(const P of L.coloringSetCustom)if(!/^#[0-9a-fA-F]{6}$/.test(P))throw new Error("One of the color strings in options.coloringSetCustom was not a valid HTML Hex color:\n"+P);V=L.coloringSetCustom}else if(L.coloringMode===S.ColoringModes.AutoColoring){V=[];const P=Object.keys(T.AutoColorSet);for(let U=0;U<P.length;U++)V.push(T.AutoColorSet[P[U]])}const j=new I.Dictionary;for(let P=0;P<F.length;P++)j.setValue(F[P],V[P]);j.setValue(-1,V.last()),this.rules.ColoringSetCurrent=j,this.rules.ColoringMode=L.coloringMode}setLogLevel(L){switch(L){case"trace":E.default.setLevel(E.default.levels.TRACE);break;case"debug":E.default.setLevel(E.default.levels.DEBUG);break;case"info":E.default.setLevel(E.default.levels.INFO);break;case"warn":E.default.setLevel(E.default.levels.WARN);break;case"error":E.default.setLevel(E.default.levels.ERROR);break;case"silent":E.default.setLevel(E.default.levels.SILENT);break;default:E.default.warn(`Could not set log level to ${L}. Using warn instead.`),E.default.setLevel(E.default.levels.WARN)}}getLogLevel(){return E.default.getLevel()}reset(){this.drawingParameters.drawCursors&&this.cursors.forEach(L=>{L.hide()}),this.sheet=void 0,this.graphic=void 0,this.zoom=1,this.rules.RenderCount=0}autoResize(){const L=this;this.handleResize(()=>{},()=>{this.graphic?.GetCalculator instanceof c.VexFlowMusicSheetCalculator&&(this.graphic.GetCalculator.beamsNeedUpdate=!0),L.IsReadyToRender()&&L.renderAndScrollBack()})}renderAndScrollBack(){const L=window.scrollY/document.body.scrollHeight;this.render();const F=document.body.scrollHeight*L;window.scrollTo({top:F,behavior:"instant"})}handleResize(L,F){let V,j;const P=this;function U(){P.AutoResizeEnabled&&(V=(new Date).getTime(),j||(L(),V=(new Date).getTime(),j=window.setTimeout(Y,200)))}function Y(){j=void 0,window.clearTimeout(j),(new Date).getTime()-V<200?j=window.setTimeout(Y,200):F()}window.attachEvent?window.attachEvent("onresize",U):window.addEventListener("resize",U),this.resizeHandlerAttached=!0,window.setTimeout(L,0),window.setTimeout(F,1)}enableOrDisableCursors(L){if(this.drawingParameters.drawCursors=L,L)for(let F=0;F<this.cursorsOptions.length;F++){const V=this.cursors[F]?.Hidden??!0,j=this.cursors[F]?.Iterator;this.cursors[F]?.hide();let P=this.drawer?.Backends[0];if(P&&this.rules.RestoreCursorAfterRerender&&this.cursors[F]){const U=this.cursors[F].updateCurrentPage();P=this.drawer.Backends[U-1]}P&&P.getRenderElement()&&(this.cursors[F]=new f.Cursor(P.getRenderElement(),this,this.cursorsOptions[F])),this.sheet&&this.graphic&&this.cursors[F]&&this.cursors[F].init(this.sheet.MusicPartManager,this.graphic),this.rules.RestoreCursorAfterRerender&&(this.cursors[F].hidden=V,j&&(this.cursors[F].iterator=j,this.cursors[F].update()))}
1else this.cursors.forEach(F=>{F.hide()})}createBackend(L,F){let V;return V=void 0===L||L===M.BackendType.SVG?new h.SvgVexFlowBackend(this.rules):new e.CanvasVexFlowBackend(this.rules),V.graphicalMusicPage=F,V.initialize(this.container,this.zoom),V}static StringToPageFormat(L){let F=x.PageFormat.UndefinedPageFormat;if(L.match("^[0-9]+x[0-9]+$")){const V=L.split("x"),j=Number.parseInt(V[0],10),P=Number.parseInt(V[1],10);j>0&&j<32768&&P>0&&P<32768&&(F=new x.PageFormat(j,P,`customPageFormat${L}`))}return L=(L=(L=L.replace(" ","_")).replace("Landscape","L")).replace("Portrait","P"),B.PageFormatStandards.hasOwnProperty(L)&&(F=B.PageFormatStandards[L]),F}setPageFormat(L){const F=B.StringToPageFormat(L);this.needBackendUpdate=!F.Equals(this.rules.PageFormat),this.rules.PageFormat=F}setCustomPageFormat(L,F){if(L>0&&F>0){const V=new x.PageFormat(L,F);this.rules.PageFormat=V}}set DrawSkyLine(L){this.drawSkyLine=L,this.drawer&&(this.drawer.skyLineVisible=L)}get DrawSkyLine(){return this.drawer.skyLineVisible}set DrawBottomLine(L){this.drawBottomLine=L,this.drawer&&(this.drawer.bottomLineVisible=L)}get DrawBottomLine(){return this.drawer.bottomLineVisible}set DrawBoundingBox(L){this.setDrawBoundingBox(L,!0)}get DrawBoundingBox(){return this.drawBoundingBox}setDrawBoundingBox(L,F=!1){this.drawBoundingBox=L,this.drawer&&(this.drawer.drawableBoundingBoxElement=L),F&&this.renderAndScrollBack()}get AutoResizeEnabled(){return this.autoResizeEnabled}set AutoResizeEnabled(L){this.autoResizeEnabled=L}get Zoom(){return this.zoom}set Zoom(L){this.zoom=L,this.zoomUpdated=!0,this.graphic?.GetCalculator instanceof c.VexFlowMusicSheetCalculator&&(this.graphic.GetCalculator.beamsNeedUpdate=this.zoomUpdated)}set FollowCursor(L){this.followCursor=L}get FollowCursor(){return this.followCursor}set TransposeCalculator(L){o.MusicSheetCalculator.transposeCalculator=L}get TransposeCalculator(){return o.MusicSheetCalculator.transposeCalculator}get Sheet(){return this.sheet}get Drawer(){return this.drawer}get GraphicSheet(){return this.graphic}get DrawingParameters(){return this.drawingParameters}get EngravingRules(){return this.rules}get Version(){return this.version}}g.OpenSheetMusicDisplay=B,B.PageFormatStandards={A3_L:new x.PageFormat(420,297,"A3_L"),A3_P:new x.PageFormat(297,420,"A3_P"),A4_L:new x.PageFormat(297,210,"A4_L"),A4_P:new x.PageFormat(210,297,"A4_P"),A5_L:new x.PageFormat(210,148,"A5_L"),A5_P:new x.PageFormat(148,210,"A5_P"),A6_L:new x.PageFormat(148,105,"A6_L"),A6_P:new x.PageFormat(105,148,"A6_P"),Endless:x.PageFormat.UndefinedPageFormat,Letter_L:new x.PageFormat(279.4,215.9,"Letter_L"),Letter_P:new x.PageFormat(215.9,279.4,"Letter_P")}},5955(dt,g,u){"use strict";var l=this&&this.__createBinding||(Object.create?function(c,r,i,o){void 0===o&&(o=i);var n=Object.getOwnPropertyDescriptor(r,i);n&&!("get"in n?!r.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return r[i]}}),Object.defineProperty(c,o,n)}:function(c,r,i,o){void 0===o&&(o=i),c[o]=r[i]}),s=this&&this.__exportStar||function(c,r){for(var i in c)"default"===i||Object.prototype.hasOwnProperty.call(r,i)||l(r,c,i)};Object.defineProperty(g,"__esModule",{value:!0}),s(u(3173),g),s(u(6597),g),s(u(624),g),s(u(7103),g)},8628(dt,g,u){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.TransposeCalculator=void 0;const l=u(9735);class s{transposePitch(r,i,o){if(0===o)return r;let n=l.NoteEnum.C,h=0,e=l.AccidentalEnum.NONE;const f=l.Pitch.CalculateTransposedHalfTone(r,o);let m=f.halftone,p=f.overflow;for(let E=0;E<s.noteEnums.length;E++){const y=s.noteEnums[E];if(y===m)return n=s.noteEnums[E],h=r.Octave+p,e=l.AccidentalEnum.NONE,new l.Pitch(n,h,e);if(y>m)break}for(let E=0;E<s.noteEnums.length;E++)if(s.noteEnums[E]>m){let y=E;const d=l.Pitch.HalfTonesFromAccidental(r.Accidental),S=d>0;let I=!0;for(i.Key>0?I=!0:i.Key<0?I=!1:(S||d<0)&&(I=S),I&&y--;y<0;)y+=7,m+=12,p--;for(;y>=7;)y-=7,m-=12,p++;n=s.noteEnums[y],e=l.Pitch.AccidentalFromHalfTones(m-n),h=r.Octave+p;break}return new l.Pitch(n,h,e)}transposeKey(r,i){let o=0,n=0,h=r.keyTypeOriginal;if(i%12==0)return r.Key=r.keyTypeOriginal,void(r.isTransposedBy=i);for(h>6?h-=12:h<-6&&(h+=12);o<s.keyMapping.length&&(n=s.keyMapping[o],n!==h);o++);let e=o+i;for(;e>=12;)e-=12;for(;e<0;)e+=12;r.Key=s.keyMapping[e],r.isTransposedBy=i}}g.TransposeCalculator=s,s.keyMapping=[0,-5,2,-3,4,-1,6,1,-4,3,-2,5],s.noteEnums=[l.NoteEnum.C,l.NoteEnum.D,l.NoteEnum.E,l.NoteEnum.F,l.NoteEnum.G,l.NoteEnum.A,l.NoteEnum.B]},8659(dt,g,u){"use strict";var l=this&&this.__createBinding||(Object.create?function(c,r,i,o){void 0===o&&(o=i);var n=Object.getOwnPropertyDescriptor(r,i);
vendor: 6,061 bytes, line 1
1n&&!("get"in n?!r.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return r[i]}}),Object.defineProperty(c,o,n)}:function(c,r,i,o){void 0===o&&(o=i),c[o]=r[i]}),s=this&&this.__exportStar||function(c,r){for(var i in c)"default"===i||Object.prototype.hasOwnProperty.call(r,i)||l(r,c,i)};Object.defineProperty(g,"__esModule",{value:!0}),s(u(8628),g)},363(dt,g,u){"use strict";var l=this&&this.__createBinding||(Object.create?function(c,r,i,o){void 0===o&&(o=i);var n=Object.getOwnPropertyDescriptor(r,i);n&&!("get"in n?!r.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return r[i]}}),Object.defineProperty(c,o,n)}:function(c,r,i,o){void 0===o&&(o=i),c[o]=r[i]}),s=this&&this.__exportStar||function(c,r){for(var i in c)"default"===i||Object.prototype.hasOwnProperty.call(r,i)||l(r,c,i)};Object.defineProperty(g,"__esModule",{value:!0}),s(u(8659),g)},813(dt,g){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.CollectionUtil=void 0,Array.prototype.last||Object.defineProperty(Array.prototype,"last",{enumerable:!1,writable:!0,value:function(){return this[this.length-1]}}),Array.prototype.clear||Object.defineProperty(Array.prototype,"clear",{enumerable:!1,writable:!0,value:function(){this.length=0}}),Array.prototype.contains||Object.defineProperty(Array.prototype,"contains",{enumerable:!1,writable:!0,value:function(u){return-1!==this.indexOf(u)}}),g.CollectionUtil=class{static contains2(u,l){for(let s=0;s<u.length;s++)if(u[s]===l)return!0;return!1}static last(u){return u[u.length-1]}static flat(u){return[].concat(...u)}static removeDictElementIfTrue(u,l,s){const c=[];l.forEach(function(r,i){s(u,r,i)&&c.push(r)});for(let r=0;r<c.length;r++)l.remove(c[r])}static getLastElement(u){return u[u.length-1]}static binarySearch(u,l,s,c=0,r=u.length-1){let i=1,o=-1;for(;c<=r&&(i=Math.floor((c+r)/2),i!==o);){const n=s(u[i],l);if(0===n)return i;n<0&&(c=i+1),0<n&&(r=i),o=i}return-i}}},2774(dt,g){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.PSMath=void 0;class u{static log(s,c){return Math.log(c)/Math.log(s)}static log10(s){return u.log(10,s)}static meanSimple(s){let c=0;for(let r=0;r<s.length;r++)c+=s[r];return c/s.length}static meanWeighted(s,c){if(s.length!==c.length||0===s.length)return 0;let r=0,i=0;for(let o=0;o<s.length;o++){const n=c[o];r+=s[o]*n,i+=n}return r/i}}g.PSMath=u},6873(dt,g,u){"use strict";var l=this&&this.__createBinding||(Object.create?function(c,r,i,o){void 0===o&&(o=i);var n=Object.getOwnPropertyDescriptor(r,i);n&&!("get"in n?!r.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return r[i]}}),Object.defineProperty(c,o,n)}:function(c,r,i,o){void 0===o&&(o=i),c[o]=r[i]}),s=this&&this.__exportStar||function(c,r){for(var i in c)"default"===i||Object.prototype.hasOwnProperty.call(r,i)||l(r,c,i)};Object.defineProperty(g,"__esModule",{value:!0}),s(u(813),g),s(u(2774),g)},8156(dt,g,u){"use strict";var l=this&&this.__createBinding||(Object.create?function(c,r,i,o){void 0===o&&(o=i);var n=Object.getOwnPropertyDescriptor(r,i);n&&!("get"in n?!r.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return r[i]}}),Object.defineProperty(c,o,n)}:function(c,r,i,o){void 0===o&&(o=i),c[o]=r[i]}),s=this&&this.__exportStar||function(c,r){for(var i in c)"default"===i||Object.prototype.hasOwnProperty.call(r,i)||l(r,c,i)};Object.defineProperty(g,"__esModule",{value:!0}),s(u(5955),g),s(u(1745),g),s(u(6873),g),s(u(2552),g),s(u(363),g)},9924(dt,g,u){"use strict";var l,s=this&&this.__extends||(l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},function(r,i){function o(){this.constructor=r}l(r,i),r.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)});Object.defineProperty(g,"__esModule",{value:!0});var c=function(r){function i(){return null!==r&&r.apply(this,arguments)||this}return s(i,r),i}(u(4041).default);g.default=c},4041(dt,g,u){"use strict";Object.defineProperty(g,"__esModule",{value:!0});var l=u(4831),s=u(3288),c=function(){function r(i){this.root=null,this.compare=i||l.defaultCompare,this.nElements=0}return r.prototype.add=function(i){return!l.isUndefined(i)&&null!==this.insertNode(this.createNode(i))&&(this.nElements++,!0)},r.prototype.clear=function(){this.root=null,this.nElements=0},r.prototype.isEmpty=function(){return 0===this.nElements},r.prototype.size=function(){return this.nElements},r.prototype.contains=function(i){return!l.isUndefined(i)&&null!==this.searchNode(this.root,i)},r.prototype.search=function(i){var o=this.searchNode(this.root,i);if(null!==o)return o.element},r.prototype.remove=function(i){var o=this.searchNode(this.root,i);return null!==o&&(this.removeNode(o),this.nElements--,!0)},r.prototype.inorderTraversal=function(i){this.inorderTraversalAux(this.root,i,{stop:!1})},r.prototype.preorderTraversal=function(i){this.preorderTraversalAux(this.root,i,{stop:!1})},r.prototype.postorderTraversal=function(i){this.postorderTraversalAux(this.root,i,{stop:!1})},r.prototype.levelTraversal=function(i){this.levelTraversalAux(this.root,i)},r.prototype.minimum=function(){if(!this.isEmpty()&&null!==this.root)return this.minimumAux(this.root).element},r.prototype.maximum=function(){if(!this.isEmpty()&&null!==this.root)return this.maximumAux(this.root).element},r.prototype.forEach=function(i){this.inorderTraversal(i)},r.prototype.toArray=function(){var i=[];return this.inorderTraversal(function(o){return i.push(o),!0}),i},r.prototype.height=function(){return this.heightAux(this.root)},r.prototype.searchNode=function(i,o){for(var n=1;null!==i&&0!==n;)(n=this.compare(o,i.element))<0?i=i.leftCh:n>0&&(i=i.rightCh);return i},r.prototype.transplant=function(i,o){null===i.parent?this.root=o:i===i.parent.leftCh?i.parent.leftCh=o:i.parent.rightCh=o,null!==o&&(o.parent=i.parent)},r.prototype.removeNode=function(i){if(null===i.leftCh)this.transplant(i,i.rightCh);else if(null===i.rightCh)this.transplant(i,i.leftCh);else{var o=this.minimumAux(i.rightCh);
1o.parent!==i&&(this.transplant(o,o.rightCh),o.rightCh=i.rightCh,o.rightCh.parent=o),this.transplant(i,o),o.leftCh=i.leftCh,o.leftCh.parent=o}},r.prototype.inorderTraversalAux=function(i,o,n){null===i||n.stop||(this.inorderTraversalAux(i.leftCh,o,n),n.stop||(n.stop=!1===o(i.element),n.stop||this.inorderTraversalAux(i.rightCh,o,n)))},r.prototype.levelTraversalAux=function(i,o){var n=new s.default;for(null!==i&&n.enqueue(i),i=n.dequeue()||null;null!=i;){if(!1===o(i.element))return;null!==i.leftCh&&n.enqueue(i.leftCh),null!==i.rightCh&&n.enqueue(i.rightCh),i=n.dequeue()||null}},r.prototype.preorderTraversalAux=function(i,o,n){null===i||n.stop||(n.stop=!1===o(i.element),n.stop||(this.preorderTraversalAux(i.leftCh,o,n),n.stop||this.preorderTraversalAux(i.rightCh,o,n)))},r.prototype.postorderTraversalAux=function(i,o,n){null===i||n.stop||(this.postorderTraversalAux(i.leftCh,o,n),n.stop||(this.postorderTraversalAux(i.rightCh,o,n),n.stop||(n.stop=!1===o(i.element))))},r.prototype.minimumAux=function(i){for(;null!=i&&null!==i.leftCh;)i=i.leftCh;return i},r.prototype.maximumAux=function(i){for(;null!=i&&null!==i.rightCh;)i=i.rightCh;return i},r.prototype.heightAux=function(i){return null===i?-1:Math.max(this.heightAux(i.leftCh),this.heightAux(i.rightCh))+1},r.prototype.insertNode=function(i){for(var o=null,n=this.root;null!==n;){var h=this.compare(i.element,n.element);if(0===h)return null;h<0?(o=n,n=n.leftCh):(o=n,n=n.rightCh)}return i.parent=o,null===o?this.root=i:this.compare(i.element,o.element)<0?o.leftCh=i:o.rightCh=i,i},r.prototype.createNode=function(i){return{element:i,leftCh:null,rightCh:null,parent:null}},r}();g.default=c},2909(dt,g,u){"use strict";Object.defineProperty(g,"__esModule",{value:!0});var l=u(4831),s=u(6119),c=u(2091),r=function(){function i(o){this.toStrF=o||l.defaultToString,this.dictionary=new s.default(this.toStrF),this.nElements=0}return i.prototype.add=function(o,n){return void 0===n&&(n=1),!(l.isUndefined(o)||n<=0||(this.contains(o)?this.dictionary.getValue(o).copies+=n:this.dictionary.setValue(o,{value:o,copies:n}),this.nElements+=n,0))},i.prototype.count=function(o){return this.contains(o)?this.dictionary.getValue(o).copies:0},i.prototype.contains=function(o){return this.dictionary.containsKey(o)},i.prototype.remove=function(o,n){if(void 0===n&&(n=1),l.isUndefined(o)||n<=0)return!1;if(this.contains(o)){var h=this.dictionary.getValue(o);return this.nElements-=n>h.copies?h.copies:n,h.copies-=n,h.copies<=0&&this.dictionary.remove(o),!0}return!1},i.prototype.toArray=function(){for(var o=[],n=0,h=this.dictionary.values();n<h.length;n++)for(var e=h[n],f=e.value,m=e.copies,p=0;p<m;p++)o.push(f);return o},i.prototype.toSet=function(){for(var o=new c.default(this.toStrF),n=0,h=this.dictionary.values();n<h.length;n++)o.add(h[n].value);return o},i.prototype.forEach=function(o){this.dictionary.forEach(function(n,h){for(var e=h.value,f=h.copies,m=0;m<f;m++)if(!1===o(e))return!1;return!0})},i.prototype.size=function(){return this.nElements},i.prototype.isEmpty=function(){return 0===this.nElements},i.prototype.clear=function(){this.nElements=0,this.dictionary.clear()},i}();g.default=r},6119(dt,g,u){"use strict";Object.defineProperty(g,"__esModule",{value:!0});var l=u(4831),s=function(){function c(r){this.table={},this.nElements=0,this.toStr=r||l.defaultToString}return c.prototype.getValue=function(r){var i=this.table["$"+this.toStr(r)];if(!l.isUndefined(i))return i.value},c.prototype.setValue=function(r,i){if(!l.isUndefined(r)&&!l.isUndefined(i)){var o,n="$"+this.toStr(r),h=this.table[n];return l.isUndefined(h)?(this.nElements++,o=void 0):o=h.value,this.table[n]={key:r,value:i},o}},c.prototype.remove=function(r){var i="$"+this.toStr(r),o=this.table[i];if(!l.isUndefined(o))return delete this.table[i],this.nElements--,o.value},c.prototype.keys=function(){var r=[];for(var i in this.table)l.has(this.table,i)&&r.push(this.table[i].key);return r},c.prototype.values=function(){var r=[];for(var i in this.table)l.has(this.table,i)&&r.push(this.table[i].value);return r},c.prototype.forEach=function(r){for(var i in this.table)if(l.has(this.table,i)){var o=this.table[i];if(!1===r(o.key,o.value))return}},c.prototype.containsKey=function(r){return!l.isUndefined(this.getValue(r))},c.prototype.clear=function(){this.table={},this.nElements=0},c.prototype.size=function(){return this.nElements},c.prototype.isEmpty=function(){return this.nElements<=0},c.prototype.toString=function(){var r="{";return this.forEach(function(i,o){r+="\n\t"+i+" : "+o}),r+"\n}"},c}();g.default=s},9281(dt,g,u){"use strict";var l,s=this&&this.__extends||(l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,n){o.__proto__=n}||function(o,n){for(var h in n)n.hasOwnProperty(h)&&(o[h]=n[h])},function(o,n){function h(){this.constructor=o}l(o,n),o.prototype=null===n?Object.create(n):(h.prototype=n.prototype,new h)});
vendor: 8,694 bytes, line 1
1Object.defineProperty(g,"__esModule",{value:!0});var c=u(6119),r=u(4831),i=function(o){function n(h,e){var f=o.call(this,e)||this;return f.defaultFactoryFunction=h,f}return s(n,o),n.prototype.setDefault=function(h,e){var f=o.prototype.getValue.call(this,h);return r.isUndefined(f)?(this.setValue(h,e),e):f},n.prototype.getValue=function(h){return this.setDefault(h,this.defaultFactoryFunction())},n}(c.default);g.default=i},4589(dt,g,u){"use strict";Object.defineProperty(g,"__esModule",{value:!0});var l=u(4831),s=u(4713),c=function(){function r(i){this.data=[],this.compare=i||l.defaultCompare}return r.prototype.leftChildIndex=function(i){return 2*i+1},r.prototype.rightChildIndex=function(i){return 2*i+2},r.prototype.parentIndex=function(i){return Math.floor((i-1)/2)},r.prototype.minIndex=function(i,o){return o>=this.data.length?i>=this.data.length?-1:i:this.compare(this.data[i],this.data[o])<=0?i:o},r.prototype.siftUp=function(i){for(var o=this.parentIndex(i);i>0&&this.compare(this.data[o],this.data[i])>0;)s.swap(this.data,o,i),o=this.parentIndex(i=o)},r.prototype.siftDown=function(i){for(var o=this.minIndex(this.leftChildIndex(i),this.rightChildIndex(i));o>=0&&this.compare(this.data[i],this.data[o])>0;)s.swap(this.data,o,i),o=this.minIndex(this.leftChildIndex(i=o),this.rightChildIndex(i))},r.prototype.peek=function(){return this.data.length>0?this.data[0]:void 0},r.prototype.add=function(i){return!l.isUndefined(i)&&(this.data.push(i),this.siftUp(this.data.length-1),!0)},r.prototype.removeRoot=function(){if(this.data.length>0){var i=this.data[0];return this.data[0]=this.data[this.data.length-1],this.data.splice(this.data.length-1,1),this.data.length>0&&this.siftDown(0),i}},r.prototype.contains=function(i){var o=l.compareToEquals(this.compare);return s.contains(this.data,i,o)},r.prototype.size=function(){return this.data.length},r.prototype.isEmpty=function(){return this.data.length<=0},r.prototype.clear=function(){this.data.length=0},r.prototype.forEach=function(i){s.forEach(this.data,i)},r}();g.default=c},1846(dt,g,u){"use strict";var l,s=this&&this.__extends||(l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,f){e.__proto__=f}||function(e,f){for(var m in f)f.hasOwnProperty(m)&&(e[m]=f[m])},function(e,f){function m(){this.constructor=e}l(e,f),e.prototype=null===f?Object.create(f):(m.prototype=f.prototype,new m)});Object.defineProperty(g,"__esModule",{value:!0});var c=u(6119),r=u(4831),i=function(){function e(f,m){this.key=f,this.value=m}return e.prototype.unlink=function(){this.prev.next=this.next,this.next.prev=this.prev},e}(),o=function(){function e(){this.key=null,this.value=null}return e.prototype.unlink=function(){this.prev.next=this.next,this.next.prev=this.prev},e}();function n(e){return!e.next}var h=function(e){function f(m){var p=e.call(this,m)||this;return p.head=new o,p.tail=new o,p.head.next=p.tail,p.tail.prev=p.head,p}return s(f,e),f.prototype.appendToTail=function(m){var p=this.tail.prev;p.next=m,m.prev=p,m.next=this.tail,this.tail.prev=m},f.prototype.getLinkedDictionaryPair=function(m){if(!r.isUndefined(m)){var p="$"+this.toStr(m);return this.table[p]}},f.prototype.getValue=function(m){var p=this.getLinkedDictionaryPair(m);if(!r.isUndefined(p))return p.value},f.prototype.remove=function(m){var p=this.getLinkedDictionaryPair(m);if(!r.isUndefined(p))return e.prototype.remove.call(this,m),p.unlink(),p.value},f.prototype.clear=function(){e.prototype.clear.call(this),this.head.next=this.tail,this.tail.prev=this.head},f.prototype.replace=function(m,p){var E="$"+this.toStr(p.key);p.next=m.next,p.prev=m.prev,this.remove(m.key),p.prev.next=p,p.next.prev=p,this.table[E]=p,++this.nElements},f.prototype.setValue=function(m,p){if(!r.isUndefined(m)&&!r.isUndefined(p)){var E=this.getLinkedDictionaryPair(m),y=new i(m,p),d="$"+this.toStr(m);return r.isUndefined(E)?(this.appendToTail(y),this.table[d]=y,void++this.nElements):(this.replace(E,y),E.value)}},f.prototype.keys=function(){var m=[];return this.forEach(function(p,E){m.push(p)}),m},f.prototype.values=function(){var m=[];return this.forEach(function(p,E){m.push(E)}),m},f.prototype.forEach=function(m){for(var p=this.head.next;!n(p);){if(!1===m(p.key,p.value))return;p=p.next}},f}(c.default);g.default=h},4538(dt,g,u){"use strict";Object.defineProperty(g,"__esModule",{value:!0});var l=u(4831),s=u(4713),c=function(){function r(){this.firstNode=null,this.lastNode=null,this.nElements=0}return r.prototype.add=function(i,o){if(l.isUndefined(o)&&(o=this.nElements),o<0||o>this.nElements||l.isUndefined(i))return!1;var n=this.createNode(i);if(0===this.nElements||null===this.lastNode)this.firstNode=n,this.lastNode=n;else if(o===this.nElements)this.lastNode.next=n,this.lastNode=n;else if(0===o)n.next=this.firstNode,this.firstNode=n;else{var h=this.nodeAtIndex(o-1);if(null===h)return!1;n.next=h.next,h.next=n}return this.nElements++,!0},r.prototype.first=function(){if(null!==this.firstNode)return this.firstNode.element},r.prototype.last=function(){if(null!==this.lastNode)return this.lastNode.element},r.prototype.elementAtIndex=function(i){var o=this.nodeAtIndex(i);if(null!==o)return o.element},r.prototype.indexOf=function(i,o){var n=o||l.defaultEquals;if(l.isUndefined(i))return-1;for(var h=this.firstNode,e=0;null!==h;){if(n(h.element,i))return e;e++,h=h.next}return-1},r.prototype.contains=function(i,o){return this.indexOf(i,o)>=0},r.prototype.remove=function(i,o){var n=o||l.defaultEquals;if(this.nElements<1||l.isUndefined(i))return!1;for(var h=null,e=this.firstNode;null!==e;){if(n(e.element,i))return null===h?(this.firstNode=e.next,e===this.lastNode&&(this.lastNode=null)):e===this.lastNode?(this.lastNode=h,h.next=e.next,e.next=null):(h.next=e.next,e.next=null),this.nElements--,!0;h=e,e=e.next}return!1},r.prototype.clear=function(){this.firstNode=null,this.lastNode=null,this.nElements=0},r.prototype.equals=function(i,o){var n=o||l.defaultEquals;return i instanceof r&&this.size()===i.size()&&this.equalsAux(this.firstNode,i.firstNode,n)},r.prototype.equalsAux=function(i,o,n){for(;null!==i&&null!==o;){if(!n(i.element,o.element))return!1;i=i.next,o=o.next}return!0},r.prototype.removeElementAtIndex=function(i){if(!(i<0||i>=this.nElements||null===this.firstNode||null===this.lastNode)){var o;if(1===this.nElements)o=this.firstNode.element,this.firstNode=null,this.lastNode=null;else{var n=this.nodeAtIndex(i-1);null===n?(o=this.firstNode.element,this.firstNode=this.firstNode.next):n.next===this.lastNode&&(o=this.lastNode.element,this.lastNode=n),null!==n&&null!==n.next&&(o=n.next.element,n.next=n.next.next)}return this.nElements--,o}},r.prototype.forEach=function(i){for(var o=this.firstNode;null!==o&&!1!==i(o.element);)o=o.next},r.prototype.reverse=function(){for(var i=null,o=this.firstNode,n=null;null!==o;)n=o.next,o.next=i,i=o,o=n;n=this.firstNode,this.firstNode=this.lastNode,this.lastNode=n},r.prototype.toArray=function(){for(var i=[],o=this.firstNode;null!==o;)i.push(o.element),o=o.next;return i},r.prototype.size=function(){return this.nElements},r.prototype.isEmpty=function(){return this.nElements<=0},r.prototype.toString=function(){return s.toString(this.toArray())},r.prototype.nodeAtIndex=function(i){if(i<0||i>=this.nElements)return null;if(i===this.nElements-1)return this.lastNode;for(var o=this.firstNode,n=0;n<i&&null!==o;n++)o=o.next;return o},r.prototype.createNode=function(i){return{element:i,next:null}},r}();g.default=c},2338(dt,g,u){"use strict";Object.defineProperty(g,"__esModule",{value:!0});var l=u(4831),s=u(6119),c=u(4713),r=function(){function i(o,n,h){void 0===h&&(h=!1),this.dict=new s.default(o),this.equalsF=n||l.defaultEquals,this.allowDuplicate=h}return i.prototype.getValue=function(o){var n=this.dict.getValue(o);return l.isUndefined(n)?[]:c.copy(n)},i.prototype.setValue=function(o,n){if(l.isUndefined(o)||l.isUndefined(n))return!1;var h=this.dict.getValue(o);return l.isUndefined(h)?(this.dict.setValue(o,[n]),!0):!(!this.allowDuplicate&&c.contains(h,n,this.equalsF)||(h.push(n),0))},i.prototype.remove=function(o,n){if(l.isUndefined(n)){var h=this.dict.remove(o);return!l.isUndefined(h)}var e=this.dict.getValue(o);return!(l.isUndefined(e)||!c.remove(e,n,this.equalsF)||(0===e.length&&this.dict.remove(o),0))},i.prototype.keys=function(){return this.dict.keys()},i.prototype.values=function(){for(var o=[],n=0,h=this.dict.values();n<h.length;n++)for(var e=0,f=h[n];e<f.length;e++)o.push(f[e]);return o},i.prototype.containsKey=function(o){return this.dict.containsKey(o)},i.prototype.clear=function(){this.dict.clear()},i.prototype.size=function(){return this.dict.size()},i.prototype.isEmpty=function(){return this.dict.isEmpty()},i}();g.default=r},2002(dt,g){"use strict";var u,s;
1Object.defineProperty(g,"__esModule",{value:!0}),(s=u||(u={}))[s.BEFORE=0]="BEFORE",s[s.AFTER=1]="AFTER",s[s.INSIDE_AT_END=2]="INSIDE_AT_END",s[s.INSIDE_AT_START=3]="INSIDE_AT_START";var l=function(){function s(c,r){void 0===c&&(c=[]),void 0===r&&(r={}),this.rootIds=c,this.nodes=r,this.initRootIds(),this.initNodes()}return s.prototype.initRootIds=function(){for(var c=0,r=this.rootIds;c<r.length;c++)this.createEmptyNodeIfNotExist(r[c])},s.prototype.initNodes=function(){for(var c in this.nodes)if(this.nodes.hasOwnProperty(c))for(var r=0,i=this.nodes[c];r<i.length;r++)this.createEmptyNodeIfNotExist(i[r])},s.prototype.createEmptyNodeIfNotExist=function(c){this.nodes[c]||(this.nodes[c]=[])},s.prototype.getRootIds=function(){return this.rootIds.slice()},s.prototype.getNodes=function(){var c={};for(var r in this.nodes)this.nodes.hasOwnProperty(r)&&(c[r]=this.nodes[r].slice());return c},s.prototype.getObject=function(){return{rootIds:this.getRootIds(),nodes:this.getNodes()}},s.prototype.toObject=function(){return this.getObject()},s.prototype.flatten=function(){for(var r=[],i=0;i<this.rootIds.length;i++){var o=this.rootIds[i];r.push({id:o,level:0,hasParent:!1,childrenCount:0}),m(o,this.nodes,r,0)}for(var n=0,h=r;n<h.length;n++){var e=h[n];e.childrenCount=this.nodes[p=e.id]?this.nodes[p].length:0}var p;return r;function m(p,E,y,d){if(void 0===d&&(d=0),p&&E&&y&&E[p]){d++;for(var S=E[p],M=0;M<S.length;M++){var x=S[M];y.push({id:x,level:d,hasParent:!0}),m(x,E,y,d)}d--}}},s.prototype.moveIdBeforeId=function(c,r){return this.moveId(c,r,u.BEFORE)},s.prototype.moveIdAfterId=function(c,r){return this.moveId(c,r,u.AFTER)},s.prototype.moveIdIntoId=function(c,r,i){return void 0===i&&(i=!0),this.moveId(c,r,i?u.INSIDE_AT_START:u.INSIDE_AT_END)},s.prototype.swapRootIdWithRootId=function(c,r){var i=this.findRootId(c),o=this.findRootId(r);this.swapRootPositionWithRootPosition(i,o)},s.prototype.swapRootPositionWithRootPosition=function(c,r){var i=this.rootIds[r];this.rootIds[r]=this.rootIds[c],this.rootIds[c]=i},s.prototype.deleteId=function(c){this.rootDeleteId(c),this.nodeAndSubNodesDelete(c),this.nodeRefrencesDelete(c)},s.prototype.insertIdBeforeId=function(c,r){var i=this.findRootId(c);for(var o in i>-1&&this.insertIdIntoRoot(r,i),this.nodes)if(this.nodes.hasOwnProperty(o)){var n=this.findNodeId(o,c);n>-1&&this.insertIdIntoNode(o,r,n)}},s.prototype.insertIdAfterId=function(c,r){var i=this.findRootId(c);for(var o in i>-1&&this.insertIdIntoRoot(r,i+1),this.nodes)if(this.nodes.hasOwnProperty(o)){var n=this.findNodeId(o,c);n>-1&&this.insertIdIntoNode(o,r,n+1)}},s.prototype.insertIdIntoId=function(c,r){this.nodeInsertAtEnd(c,r),this.nodes[r]=[]},s.prototype.insertIdIntoRoot=function(c,r){void 0===r?this.rootInsertAtEnd(c):this.rootIds.splice(r<0?r+this.rootIds.length+1:r,0,c),this.nodes[c]=this.nodes[c]||[]},s.prototype.insertIdIntoNode=function(c,r,i){this.nodes[c]=this.nodes[c]||[],this.nodes[r]=this.nodes[r]||[],void 0===i?this.nodeInsertAtEnd(c,r):this.nodes[c].splice(i<0?i+this.nodes[c].length+1:i,0,r)},s.prototype.moveId=function(c,r,i){var o=c,n=this.findRootId(o);for(var h in this.nodes)if(this.nodes.hasOwnProperty(h)){this.findNodeId(h,r);break}var e=r,f=this.findRootId(e);for(var h in this.nodes)if(this.nodes.hasOwnProperty(h)){this.findNodeId(h,r);break}if(n>-1){if(f>-1)switch(this.rootDelete(n),f>n&&f--,i){case u.BEFORE:this.insertIdIntoRoot(o,f);break;case u.AFTER:this.insertIdIntoRoot(o,f+1);break;case u.INSIDE_AT_START:this.nodeInsertAtStart(e,o);break;case u.INSIDE_AT_END:this.nodeInsertAtEnd(e,o)}else for(var h in this.rootDelete(n),this.nodes)if(this.nodes.hasOwnProperty(h)&&(m=this.findNodeId(h,e))>-1){switch(i){case u.BEFORE:this.insertIdIntoNode(h,o,m);break;case u.AFTER:this.insertIdIntoNode(h,o,m+1);break;case u.INSIDE_AT_START:this.nodeInsertAtStart(e,o);break;case u.INSIDE_AT_END:this.nodeInsertAtEnd(e,o)}break}}else if(f>-1){for(var h in this.nodes)if(this.nodes.hasOwnProperty(h)&&(m=this.findNodeId(h,o))>-1){this.nodeDeleteAtIndex(h,m);break}switch(i){case u.BEFORE:this.insertIdIntoRoot(o,f);break;case u.AFTER:this.insertIdIntoRoot(o,f+1);break;case u.INSIDE_AT_START:this.nodeInsertAtStart(e,o);break;case u.INSIDE_AT_END:this.nodeInsertAtEnd(e,o)}}else{for(var h in this.nodes)if(this.nodes.hasOwnProperty(h)&&(m=this.findNodeId(h,o))>-1){this.nodeDeleteAtIndex(h,m);break}for(var h in this.nodes){var m;if(this.nodes.hasOwnProperty(h)&&(m=this.findNodeId(h,e))>-1){switch(i){case u.BEFORE:this.insertIdIntoNode(h,o,m);break;case u.AFTER:this.insertIdIntoNode(h,o,m+1);break;case u.INSIDE_AT_START:this.nodeInsertAtStart(e,o);break;case u.INSIDE_AT_END:this.nodeInsertAtEnd(e,o)}break}}}},s.prototype.swapArrayElements=function(c,r,i){var o=c[r];return c[r]=c[i],c[i]=o,c},s.prototype.rootDeleteId=function(c){var r=this.findRootId(c);r>-1&&this.rootDelete(r)},s.prototype.nodeAndSubNodesDelete=function(c){for(var r=[],i=0;i<this.nodes[c].length;i++)this.nodeAndSubNodesDelete(this.nodes[c][i]),r.push(c);for(this.nodeDelete(c),i=0;i<r.length;i++)this.nodeDelete(r[i])},s.prototype.nodeRefrencesDelete=function(c){for(var r in this.nodes)if(this.nodes.hasOwnProperty(r))for(var i=0;i<this.nodes[r].length;i++)this.nodes[r][i]===c&&this.nodeDeleteAtIndex(r,i)},s.prototype.nodeDelete=function(c){delete this.nodes[c]},s.prototype.findRootId=function(c){return this.rootIds.indexOf(c)},s.prototype.findNodeId=function(c,r){return this.nodes[c].indexOf(r)},s.prototype.findNode=function(c){return this.nodes[c]},s.prototype.nodeInsertAtStart=function(c,r){this.nodes[c].unshift(r)},s.prototype.nodeInsertAtEnd=function(c,r){this.nodes[c].push(r)},s.prototype.rootDelete=function(c){this.rootIds.splice(c,1)},s.prototype.nodeDeleteAtIndex=function(c,r){this.nodes[c].splice(r,1)},s.prototype.rootInsertAtStart=function(c){this.rootIds.unshift(c)},s.prototype.rootInsertAtEnd=function(c){this.rootIds.push(c)},s}();g.default=l},8464(dt,g,u){"use strict";
vendor: 15,591 bytes, line 1
1Object.defineProperty(g,"__esModule",{value:!0});var l=u(4831),s=u(4589),c=function(){function r(i){this.heap=new s.default(l.reverseCompareFunction(i))}return r.prototype.enqueue=function(i){return this.heap.add(i)},r.prototype.add=function(i){return this.heap.add(i)},r.prototype.dequeue=function(){if(0!==this.heap.size()){var i=this.heap.peek();return this.heap.removeRoot(),i}},r.prototype.peek=function(){return this.heap.peek()},r.prototype.contains=function(i){return this.heap.contains(i)},r.prototype.isEmpty=function(){return this.heap.isEmpty()},r.prototype.size=function(){return this.heap.size()},r.prototype.clear=function(){this.heap.clear()},r.prototype.forEach=function(i){this.heap.forEach(i)},r}();g.default=c},3288(dt,g,u){"use strict";Object.defineProperty(g,"__esModule",{value:!0});var l=u(4538),s=function(){function c(){this.list=new l.default}return c.prototype.enqueue=function(r){return this.list.add(r)},c.prototype.add=function(r){return this.list.add(r)},c.prototype.dequeue=function(){if(0!==this.list.size()){var r=this.list.first();return this.list.removeElementAtIndex(0),r}},c.prototype.peek=function(){if(0!==this.list.size())return this.list.first()},c.prototype.size=function(){return this.list.size()},c.prototype.contains=function(r,i){return this.list.contains(r,i)},c.prototype.isEmpty=function(){return this.list.size()<=0},c.prototype.clear=function(){this.list.clear()},c.prototype.forEach=function(r){this.list.forEach(r)},c}();g.default=s},2091(dt,g,u){"use strict";Object.defineProperty(g,"__esModule",{value:!0});var l=u(4831),s=u(4713),c=u(6119),r=function(){function i(o){this.dictionary=new c.default(o)}return i.prototype.contains=function(o){return this.dictionary.containsKey(o)},i.prototype.add=function(o){return!this.contains(o)&&!l.isUndefined(o)&&(this.dictionary.setValue(o,o),!0)},i.prototype.intersection=function(o){var n=this;this.forEach(function(h){return o.contains(h)||n.remove(h),!0})},i.prototype.union=function(o){var n=this;o.forEach(function(h){return n.add(h),!0})},i.prototype.difference=function(o){var n=this;o.forEach(function(h){return n.remove(h),!0})},i.prototype.isSubsetOf=function(o){if(this.size()>o.size())return!1;var n=!0;return this.forEach(function(h){return!!o.contains(h)||(n=!1,!1)}),n},i.prototype.remove=function(o){return!!this.contains(o)&&(this.dictionary.remove(o),!0)},i.prototype.forEach=function(o){this.dictionary.forEach(function(n,h){return o(h)})},i.prototype.toArray=function(){return this.dictionary.values()},i.prototype.isEmpty=function(){return this.dictionary.isEmpty()},i.prototype.size=function(){return this.dictionary.size()},i.prototype.clear=function(){this.dictionary.clear()},i.prototype.toString=function(){return s.toString(this.toArray())},i}();g.default=r},2083(dt,g,u){"use strict";Object.defineProperty(g,"__esModule",{value:!0});var l=u(4538),s=function(){function c(){this.list=new l.default}return c.prototype.push=function(r){return this.list.add(r,0)},c.prototype.add=function(r){return this.list.add(r,0)},c.prototype.pop=function(){return this.list.removeElementAtIndex(0)},c.prototype.peek=function(){return this.list.first()},c.prototype.size=function(){return this.list.size()},c.prototype.contains=function(r,i){return this.list.contains(r,i)},c.prototype.isEmpty=function(){return this.list.isEmpty()},c.prototype.clear=function(){this.list.clear()},c.prototype.forEach=function(r){this.list.forEach(r)},c}();g.default=s},4713(dt,g,u){"use strict";Object.defineProperty(g,"__esModule",{value:!0});var l=u(4831);function s(c,r,i){for(var o=i||l.defaultEquals,n=c.length,h=0;h<n;h++)if(o(c[h],r))return h;return-1}g.indexOf=s,g.lastIndexOf=function(c,r,i){for(var o=i||l.defaultEquals,n=c.length-1;n>=0;n--)if(o(c[n],r))return n;return-1},g.contains=function(c,r,i){return s(c,r,i)>=0},g.remove=function(c,r,i){var o=s(c,r,i);return!(o<0||(c.splice(o,1),0))},g.frequency=function(c,r,i){for(var o=i||l.defaultEquals,n=c.length,h=0,e=0;e<n;e++)o(c[e],r)&&h++;return h},g.equals=function(c,r,i){var o=i||l.defaultEquals;if(c.length!==r.length)return!1;for(var n=c.length,h=0;h<n;h++)if(!o(c[h],r[h]))return!1;return!0},g.copy=function(c){return c.concat()},g.swap=function(c,r,i){if(r<0||r>=c.length||i<0||i>=c.length)return!1;var o=c[r];return c[r]=c[i],c[i]=o,!0},g.toString=function(c){return"["+c.toString()+"]"},g.forEach=function(c,r){for(var i=0,o=c;i<o.length;i++)if(!1===r(o[i]))return}},3263(dt,g,u){"use strict";Object.defineProperty(g,"__esModule",{value:!0});var l=u(4713);g.arrays=l;var s=u(2909);g.Bag=s.default;var c=u(9924);g.BSTree=c.default;var r=u(4041);g.BSTreeKV=r.default;var i=u(6119);g.Dictionary=i.default;var o=u(4589);g.Heap=o.default;var n=u(1846);g.LinkedDictionary=n.default;var h=u(4538);g.LinkedList=h.default;var e=u(2338);g.MultiDictionary=e.default;var f=u(9281);g.FactoryDictionary=f.default;var m=u(9281);g.DefaultDictionary=m.default;var p=u(3288);g.Queue=p.default;var E=u(8464);g.PriorityQueue=E.default;var y=u(2091);g.Set=y.default;var d=u(2083);g.Stack=d.default;var S=u(2002);g.MultiRootTree=S.default;var M=u(4831);g.util=M},4831(dt,g){"use strict";Object.defineProperty(g,"__esModule",{value:!0});var u=Object.prototype.hasOwnProperty;function l(r){return"function"==typeof r}function s(r){return void 0===r}function c(r){return"[object String]"===Object.prototype.toString.call(r)}g.has=function(r,i){return u.call(r,i)},g.defaultCompare=function(r,i){return r<i?-1:r===i?0:1},g.defaultEquals=function(r,i){return r===i},g.defaultToString=function(r){return null===r?"COLLECTION_NULL":s(r)?"COLLECTION_UNDEFINED":c(r)?"$s"+r:"$o"+r.toString()},g.makeString=function(r,i){if(void 0===i&&(i=","),null===r)return"COLLECTION_NULL";if(s(r))return"COLLECTION_UNDEFINED";if(c(r))return r.toString();var o="{",n=!0;for(var h in r)g.has(r,h)&&(n?n=!1:o+=i,o=o+h+":"+r[h]);return o+"}"},g.isFunction=l,g.isUndefined=s,g.isString=c,g.reverseCompareFunction=function(r){return s(r)||!l(r)?function(i,o){return i<o?1:i===o?0:-1}:function(i,o){return-1*r(i,o)}},g.compareToEquals=function(r){return function(i,o){return 0===r(i,o)}}},3206(dt,g,u){"use strict";u.r(g),u.d(g,{default:()=>ni});const l=()=>{};l.L=(ut,t)=>{if(!t)return;const a=Array.prototype.slice.call(t).join(" ");window.console.log(ut+": "+a)},l.MakeException=ut=>class extends Error{constructor(t,a){super(t),this.name=ut,this.message=t,this.data=a}},l.RERR=l.RuntimeError=class{constructor(ut,t){this.code=ut,this.message=t}toString(){return"[RuntimeError] "+this.code+":"+this.message}},l.Merge=(ut,t)=>{for(const a in t)ut[a]=t[a];return ut},l.Min=Math.min,l.Max=Math.max,l.forEach=(ut,t)=>{for(let a=0;a<ut.length;a++)t(ut[a],a)},l.RoundN=(ut,t)=>ut%t>=t/2?parseInt(ut/t,10)*t+t:parseInt(ut/t,10)*t,l.MidLine=(ut,t)=>{let a=t+(ut-t)/2;return a%2>0&&(a=l.RoundN(10*a,5)/10),a},l.SortAndUnique=(ut,t,a)=>{if(ut.length>1){const b=[];let w;ut.sort(t);for(let R=0;R<ut.length;++R)0!==R&&a(ut[R],w)||b.push(ut[R]),w=ut[R];return b}return ut},l.Contains=(ut,t)=>{let a=ut.length;for(;a--;)if(ut[a]===t)return!0;return!1},l.getCanvasContext=ut=>{if(!ut)throw new l.RERR("BadArgument","Invalid canvas selector: "+ut);const t=document.getElementById(ut);if(!t||!t.getContext)throw new l.RERR("UnsupportedBrowserError","This browser does not support HTML5 Canvas");return t.getContext("2d")},l.drawDot=(ut,t,a,b="#55")=>{ut.save(),ut.setFillStyle(b),ut.beginPath(),ut.arc(t,a,3,0,2*Math.PI,!0),ut.closePath(),ut.fill(),ut.restore()},l.BM=(ut,t)=>{const a=(new Date).getTime();t();const b=(new Date).getTime()-a;l.L(ut+b+"ms")},l.StackTrace=()=>(new Error).stack,l.W=(...ut)=>{const t=ut.join(" ");window.console.log("Warning: ",t,l.StackTrace())},(l.Prefix=ut=>l.Prefix.prefix+ut).prefix="vf-";class s{static GCD(t,a){if("number"!=typeof t||"number"!=typeof a)throw new l.RERR("BadArgument",`Invalid numbers: ${t}, ${a}`);let b;for(;0!==a;)b=a,a=t%a,t=b;return t}static LCM(t,a){return t*a/s.GCD(t,a)}static LCMM(t){if(0===t.length)return 0;if(1===t.length)return t[0];if(2===t.length)return s.LCM(t[0],t[1]);{const a=t[0];return t.shift(),s.LCM(a,s.LCMM(t))}}constructor(t,a){this.set(t,a)}set(t,a){return this.numerator=void 0===t?1:t,this.denominator=void 0===a?1:a,this}value(){return this.numerator/this.denominator}simplify(){let t=this.numerator,a=this.denominator;const b=s.GCD(t,a);return t/=b,a/=b,a<0&&(a=-a,t=-t),this.set(t,a)}add(t,a){let b,w;t instanceof s?(b=t.numerator,w=t.denominator):(b=void 0!==t?t:0,w=void 0!==a?a:1);const R=s.LCM(this.denominator,w);return this.set(this.numerator*(R/this.denominator)+b*(R/w),R)}subtract(t,a){let b,w;t instanceof s?(b=t.numerator,w=t.denominator):(b=void 0!==t?t:0,w=void 0!==a?a:1);const R=s.LCM(this.denominator,w);return this.set(this.numerator*(R/this.denominator)-b*(R/w),R)}multiply(t,a){let b,w;return t instanceof s?(b=t.numerator,w=t.denominator):(b=void 0!==t?t:1,w=void 0!==a?a:1),this.set(this.numerator*b,this.denominator*w)}divide(t,a){let b,w;return t instanceof s?(b=t.numerator,w=t.denominator):(b=void 0!==t?t:1,w=void 0!==a?a:1),this.set(this.numerator*w,this.denominator*b)}equals(t){const a=s.__compareA.copy(t).simplify(),b=s.__compareB.copy(this).simplify();return a.numerator===b.numerator&&a.denominator===b.denominator}greaterThan(t){const a=s.__compareB.copy(this);return a.subtract(t),a.numerator>0}greaterThanEquals(t){const a=s.__compareB.copy(this);return a.subtract(t),a.numerator>=0}lessThan(t){return!this.greaterThanEquals(t)}lessThanEquals(t){return!this.greaterThan(t)}clone(){return new s(this.numerator,this.denominator)}copy(t){return"number"==typeof t?this.set(t||0,1):this.set(t.numerator,t.denominator)}quotient(){return Math.floor(this.numerator/this.denominator)}fraction(){return this.numerator%this.denominator}abs(){return this.denominator=Math.abs(this.denominator),this.numerator=Math.abs(this.numerator),this}toString(){return this.numerator+"/"+this.denominator}toSimplifiedString(){return s.__tmp.copy(this).simplify().toString()}toMixedString(){let t="";const a=this.quotient(),b=s.__tmp.copy(this);return a<0?b.abs().fraction():b.fraction(),0!==a?(t+=a,0!==b.numerator&&(t+=" "+b.toSimplifiedString())):t=0===b.numerator?"0":b.toSimplifiedString(),t}parse(t){const a=t.split("/"),b=parseInt(a[0],10),w=a[1]?parseInt(a[1],10):1;return this.set(b,w)}}s.__compareA=new s,s.__compareB=new s,s.__tmp=new s;const c=l.MakeException("RegistryError");function r(ut,t,a,b,w){ut[t][a]||(ut[t][a]={}),ut[t][a][b]=w}let i=(()=>{class ut{static get INDEXES(){return["type"]}constructor(){this.clear()}static enableDefaultRegistry(a){ut.defaultRegistry=a}static getDefaultRegistry(){return ut.defaultRegistry}static disableDefaultRegistry(){ut.defaultRegistry=null}clear(){return this.index={id:{},type:{},class:{}},this}updateIndex({id:a,name:b,value:w,oldValue:R}){const k=this.getElementById(a);null!==R&&this.index[b][R]&&delete this.index[b][R][a],null!==w&&r(this.index,b,w,k.getAttribute("id"),k)}register(a,b){if(!(b=b||a.getAttribute("id")))throw new c("Can't add element without `id` attribute to registry",a);return a.setAttribute("id",b),r(this.index,"id",b,b,a),ut.INDEXES.forEach(w=>{this.updateIndex({id:b,name:w,value:a.getAttribute(w),oldValue:null})}),a.onRegister(this),this}getElementById(a){return this.index.id[a]?this.index.id[a][a]:null}getElementsByAttribute(a,b){const w=this.index[a];return w&&w[b]?Object.keys(w[b]).map(R=>w[b][R]):[]}getElementsByType(a){return this.getElementsByAttribute("type",a)}getElementsByClass(a){return this.getElementsByAttribute("class",a)}onUpdate({id:a,name:b,value:w,oldValue:R}){return k=ut.INDEXES.concat(["id","class"]),z=b,k.filter(J=>J===z).length>0?(this.updateIndex({id:a,name:b,value:w,oldValue:R}),this):this;var k,z}}return ut.defaultRegistry=null,ut})(),o=(()=>{class ut{static newID(){return"auto"+ut.ID++}constructor({type:a}={}){this.attrs={id:ut.newID(),el:null,type:a||"Base",classes:{}},this.boundingBox=null,this.context=null,this.rendered=!1,i.getDefaultRegistry()&&i.getDefaultRegistry().register(this)}setStyle(a){return this.style=a,this}getStyle(){return this.style}applyStyle(a=this.context,b=this.getStyle()){return b?(a.save(),b.shadowColor&&a.setShadowColor(b.shadowColor),b.shadowBlur&&a.setShadowBlur(b.shadowBlur),b.fillStyle&&a.setFillStyle(b.fillStyle),b.strokeStyle&&a.setStrokeStyle(b.strokeStyle),b.lineWidth&&a.setLineWidth(b.lineWidth),this):this}restoreStyle(a=this.context,b=this.getStyle()){return b?(a.restore(),this):this}drawWithStyle(){this.checkContext(),this.applyStyle(),this.draw(),this.restoreStyle()}hasClass(a){return!0===this.attrs.classes[a]}addClass(a){return this.attrs.classes[a]=!0,this.registry&&this.registry.onUpdate({id:this.getAttribute("id"),name:"class",value:a,oldValue:null}),this}removeClass(a){return delete this.attrs.classes[a],this.registry&&this.registry.onUpdate({id:this.getAttribute("id"),name:"class",value:null,oldValue:a}),this}onRegister(a){return this.registry=a,this}isRendered(){return this.rendered}setRendered(a=!0){return this.rendered=a,this}getAttributes(){return this.attrs}getAttribute(a){return this.attrs[a]}setAttribute(a,b){const w=this.attrs.id,R=this.attrs[a];return this.attrs[a]=b,this.registry&&this.registry.onUpdate({id:w,name:a,value:b,oldValue:R}),this}getContext(){return this.context}setContext(a){return this.context=a,this}getBoundingBox(){return this.boundingBox}checkContext(){if(!this.context)throw new l.RERR("NoContext","No rendering context attached to instance");return this.context}}return ut.ID=1e3,ut})();class n{constructor(t,a,b,w){this.x1=Number.NaN,this.y1=Number.NaN,this.x2=Number.NaN,this.y2=Number.NaN,this.addPoint(t,a),this.addPoint(b,w)}width(){return this.x2-this.x1}height(){return this.y2-this.y1}addPoint(t,a){null!=t&&((isNaN(this.x1)||isNaN(this.x2))&&(this.x1=t,this.x2=t),t<this.x1&&(this.x1=t),t>this.x2&&(this.x2=t)),null!=a&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=a,this.y2=a),a<this.y1&&(this.y1=a),a>this.y2&&(this.y2=a))}addX(t){this.addPoint(t,null)}addY(t){this.addPoint(null,t)}addQuadraticCurve(t,a,b,w,R,k){const z=t+.6666666666666666*(b-t),J=a+2/3*(w-a);this.addBezierCurve(t,a,z,J,z+1/3*(R-t),J+1/3*(k-a),R,k)}addBezierCurve(t,a,b,w,R,k,z,J){const tt=[t,a],rt=[b,w],at=[R,k],ht=[z,J];let lt;this.addPoint(tt[0],tt[1]),this.addPoint(ht[0],ht[1]);const ft=(bt,mt)=>Math.pow(1-bt,3)*tt[mt]+3*Math.pow(1-bt,2)*bt*rt[mt]+3*(1-bt)*Math.pow(bt,2)*at[mt]+Math.pow(bt,3)*ht[mt];for(lt=0;lt<=1;lt++){const bt=6*tt[lt]-12*rt[lt]+6*at[lt],mt=-3*tt[lt]+9*rt[lt]-9*at[lt]+3*ht[lt],xt=3*rt[lt]-3*tt[lt];if(0===mt){if(0===bt)continue;const Lt=-xt/bt;0<Lt&&Lt<1&&(0===lt&&this.addX(ft(Lt,lt)),1===lt&&this.addY(ft(Lt,lt)));continue}const wt=Math.pow(bt,2)-4*xt*mt;if(wt<0)continue;const Tt=(-bt+Math.sqrt(wt))/(2*mt);0<Tt&&Tt<1&&(0===lt&&this.addX(ft(Tt,lt)),1===lt&&this.addY(ft(Tt,lt)));const Pt=(-bt-Math.sqrt(wt))/(2*mt);0<Pt&&Pt<1&&(0===lt&&this.addX(ft(Pt,lt)),1===lt&&this.addY(ft(Pt,lt)))}}}class h{static copy(t){return new h(t.x,t.y,t.w,t.h)}constructor(t,a,b,w){this.x=t,this.y=a,this.w=b,this.h=w}getX(){return this.x}getY(){return this.y}getW(){return this.w}getH(){return this.h}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setW(t){return this.w=t,this}setH(t){return this.h=t,this}move(t,a){this.x+=t,this.y+=a}clone(){return h.copy(this)}mergeWith(t,a){const b=t,w=this.x<b.x?this.x:b.x,R=this.y<b.y?this.y:b.y,k=Math.max(this.x+this.w,b.x+b.w)-w,z=Math.max(this.y+this.h,b.y+b.h)-R;return this.x=w,this.y=R,this.w=k,this.h=z,a&&this.draw(a),this}draw(t,a,b){a||(a=0),b||(b=0),t.rect(this.x+a,this.y+b,this.w,this.h),t.stroke()}}const e
vendor: 129,491 bytes, line 1
1={glyphs:{v0:{x_min:0,x_max:514.5,ha:525,o:"m 236 648 b 246 648 238 648 242 648 b 288 646 261 648 283 648 b 472 513 364 634 428 587 b 514 347 502 464 514 413 b 462 163 514 272 499 217 b 257 44 409 83 333 44 b 50 163 181 44 103 83 b 0 347 14 217 0 272 b 40 513 0 413 12 464 b 236 648 87 591 155 638 m 277 614 b 253 616 273 616 261 616 b 242 616 247 616 243 616 b 170 499 193 609 181 589 b 159 348 163 446 159 398 b 166 222 159 308 161 266 b 201 91 174 138 183 106 b 257 76 215 81 235 76 b 311 91 277 76 299 81 b 347 222 330 106 338 138 b 353 348 352 266 353 308 b 344 499 353 398 351 446 b 277 614 333 587 322 606 m 257 -1 l 258 -1 l 255 -1 l 257 -1 m 257 673 l 258 673 l 255 673 l 257 673 "},v1:{x_min:-1.359375,x_max:344.359375,ha:351,o:"m 126 637 l 129 638 l 198 638 l 266 638 l 269 635 b 274 631 272 634 273 632 l 277 627 l 277 395 b 279 156 277 230 277 161 b 329 88 281 123 295 106 b 344 69 341 81 344 79 b 337 55 344 62 343 59 l 333 54 l 197 54 l 61 54 l 58 55 b 50 69 53 59 50 62 b 65 88 50 79 53 81 b 80 97 72 91 74 93 b 117 156 103 113 112 129 b 117 345 117 161 117 222 l 117 528 l 100 503 l 38 406 b 14 383 24 384 23 383 b -1 398 5 383 -1 390 b 4 415 -1 403 1 409 b 16 437 5 416 10 426 l 72 539 l 100 596 b 121 632 119 631 119 631 b 126 637 122 634 125 635 m 171 -1 l 172 -1 l 170 -1 l 171 -1 m 171 673 l 172 673 l 170 673 l 171 673 "},v2:{x_min:-1.359375,x_max:458.6875,ha:468,o:"m 197 648 b 216 648 201 648 208 648 b 258 646 232 648 253 648 b 419 546 333 637 393 599 b 432 489 428 528 432 509 b 356 342 432 440 405 384 b 235 278 322 313 288 295 b 69 170 166 256 107 217 b 69 169 69 170 69 169 b 69 169 69 169 69 169 b 74 173 69 169 72 170 b 209 222 112 204 163 222 b 310 195 247 222 274 215 b 371 179 332 184 352 179 b 396 181 379 179 387 179 b 428 202 409 184 423 194 b 442 212 431 209 436 212 b 458 197 450 212 458 206 b 441 148 458 190 449 165 b 299 44 409 84 353 44 b 288 45 295 44 292 44 b 250 61 274 45 268 49 b 122 99 212 86 164 99 b 73 91 104 99 88 97 b 28 63 53 84 34 72 b 14 54 25 56 20 54 b 1 62 9 54 4 56 l -1 65 l -1 79 b 0 99 -1 91 0 95 b 2 113 1 102 2 108 b 164 309 20 197 81 272 b 285 470 232 341 277 398 b 287 487 287 476 287 481 b 171 595 287 551 239 595 b 155 595 166 595 160 595 b 142 592 145 594 142 594 b 145 589 142 592 142 591 b 179 527 168 576 179 551 b 132 455 179 496 163 467 b 104 451 122 452 112 451 b 27 530 62 451 27 487 b 29 555 27 538 27 546 b 197 648 44 601 115 639 m 228 -1 l 230 -1 l 227 -1 l 228 -1 m 228 673 l 230 673 l 227 673 l 228 673 "},v3:{x_min:-1.359375,x_max:409.6875,ha:418,o:"m 174 648 b 191 648 176 648 183 648 b 225 648 204 648 220 648 b 402 523 317 638 389 588 b 404 503 404 517 404 510 b 402 484 404 495 404 488 b 264 373 389 437 334 394 b 257 370 259 371 257 371 b 257 370 257 370 257 370 b 264 369 258 370 261 369 b 409 202 359 334 409 267 b 318 72 409 152 381 104 b 200 43 281 52 240 43 b 23 113 134 43 69 68 b 0 169 6 129 0 149 b 77 249 0 210 29 249 l 77 249 b 152 174 125 249 152 212 b 103 102 152 145 137 116 b 103 102 103 102 103 102 b 147 94 103 101 132 95 b 153 94 149 94 151 94 b 265 206 219 94 265 141 b 264 226 265 213 265 219 b 147 355 253 299 204 353 b 126 371 133 356 126 362 b 147 388 126 383 132 388 b 254 474 196 391 238 424 b 259 502 258 484 259 494 b 182 592 259 544 228 582 b 156 595 175 595 166 595 b 115 592 142 595 129 594 l 111 591 l 115 588 b 152 524 141 574 152 549 b 92 449 152 491 130 458 b 76 448 87 448 81 448 b -1 530 32 448 -1 488 b 20 581 -1 548 5 566 b 174 648 55 619 108 641 m 204 -1 l 205 -1 l 202 -1 l 204 -1 m 204 673 l 205 673 l 202 673 l 204 673 "},v4:{x_min:0,x_max:468.21875,ha:478,o:"m 174 637 b 232 638 175 638 189 638 b 277 638 245 638 259 638 l 378 638 l 381 635 b 389 623 386 632 389 627 b 382 609 389 617 386 613 b 366 589 381 606 372 598 l 313 528 l 245 451 l 209 410 l 155 348 l 84 267 b 59 240 72 252 59 240 b 59 240 59 240 59 240 b 151 238 59 238 68 238 l 242 238 l 242 303 b 243 371 242 369 242 370 b 289 426 245 374 254 385 l 303 441 l 317 456 l 338 483 l 360 506 l 371 520 b 386 527 375 526 381 527 b 400 519 392 527 397 524 b 401 440 401 516 401 514 b 401 377 401 423 401 402 l 401 238 l 426 238 b 453 237 449 238 450 238 b 465 217 461 234 465 226 b 460 202 465 212 464 206 b 426 197 454 197 453 197 l 401 197 l 401 180 b 451 88 402 129 412 109 b 468 69 465 81 468 79 b 461 55 468 62 466 59 l 458 54 l 321 54 l 185 54 l 182 55 b 175 69 176 59 175 62 b 191 88 175 79 176 81 b 240 180 230 109 240 129 l 240 197 l 125 197 b 73 195 104 195 87 195 b 8 197 10 195 9 197 b 0 212 2 199 0 205 b 0 212 0 212 0 212 b 20 242 0 219 0 219 b 163 610 104 344 163 492 b 174 637 163 628 166 634 m 234 -1 l 235 -1 l 232 -1 l 234 -1 m 234 673 l 235 673 l 232 673 l 234 673 "},v5:{x_min:0,x_max:409.6875,ha:418,o:"m 47 637 b 53 638 49 638 50 638 b 69 634 55 638 61 637 b 210 610 114 619 161 610 b 363 634 259 610 311 619 b 382 638 372 637 378 638 b 392 634 386 638 389 637 b 397 623 396 630 397 627 b 393 610 397 620 396 616 b 298 505 368 552 338 520 b 212 494 277 498 246 494 b 65 517 163 494 106 502 b 61 517 62 517 61 517 b 61 517 61 517 61 517 b 51 408 61 517 51 412 b 51 408 51 408 51 408 b 51 408 51 408 51 408 b 61 412 53 408 55 409 b 125 434 80 421 103 430 b 185 441 145 440 166 441 b 409 244 310 441 409 353 b 401 191 409 227 406 209 b 197 43 375 105 287 43 b 159 47 183 43 171 44 b 23 123 112 56 61 86 b 0 180 6 140 0 159 b 76 260 0 220 31 260 b 92 259 81 260 87 259 b 152 183 132 251 152 216 b 100 112 152 152 134 122 b 95 111 98 112 95 111 b 95 111 95 111 95 111 b 129 98 95 109 119 101 b 148 97 136 97 141 97 b 264 235 206 97 261 158 b 265 248 265 240 265 244 b 210 398 265 312 243 373 b 179 408 201 406 194 408 b 174 408 178 408 176 408 b 53 369 130 408 88 394 b 34 359 39 359 38 359 b 17 374 24 359 17 365 b 39 628 17 384 38 625 b 47 637 40 631 43 635 m 204 -1 l 205 -1 l 202 -1 l 204 -1 m 204 673 l 205 673 l 202 673 l 204 673 "},v6:{x_min:0,x_max:475.03125,ha:485,o:"m 255 648 b 274 648 259 648 266 648 b 314 646 288 648 307 648 b 450 555 374 637 438 594 b 454 530 453 546 454 538 b 375 451 454 485 416 451 b 328 467 359 451 343 455 b 300 526 310 483 300 503 b 352 598 300 557 319 589 b 356 599 355 598 356 599 b 352 602 356 599 355 601 b 288 616 330 612 308 616 b 210 584 257 616 230 605 b 164 433 189 559 174 508 b 160 374 163 415 160 381 b 160 374 160 374 160 374 b 160 374 160 374 160 374 b 168 377 160 374 164 376 b 258 395 200 390 228 395 b 366 367 294 395 328 387 b 475 223 436 333 475 283 b 472 197 475 215 473 206 b 349 65 462 141 419 95 b 259 43 317 51 288 43 b 167 69 230 43 200 52 b 4 290 80 113 20 195 b 0 349 1 309 0 328 b 20 467 0 391 6 433 b 255 648 58 563 155 637 m 269 363 b 257 363 265 363 261 363 b 210 345 236 363 220 356 b 186 226 196 324 186 272 b 187 198 186 216 186 206 b 213 95 191 151 202 112 b 257 76 221 83 238 76 b 270 77 261 76 266 76 b 321 156 299 81 310 99 b 329 229 326 183 329 206 b 321 301 329 252 326 274 b 269 363 311 342 298 359 m 236 -1 l 238 -1 l 235 -1 l 236 -1 m 236 673 l 238 673 l 235 673 l 236 673 "},v7:{x_min:0,x_max:442.359375,ha:451,o:"m 147 648 b 166 649 153 649 160 649 b 313 598 217 649 273 630 b 340 587 323 588 328 587 l 341 587 b 412 628 367 587 390 601 b 427 638 416 635 421 638 b 439 632 431 638 435 637 b 442 623 441 630 442 628 b 430 569 442 616 439 603 b 352 369 408 492 377 410 b 300 259 325 324 313 298 b 273 84 283 205 273 140 b 265 55 273 65 272 59 l 261 54 l 181 54 l 99 54 l 96 55 b 91 61 95 56 92 59 l 89 63 l 89 77 b 147 263 89 133 111 202 b 261 401 176 313 212 355 b 378 541 315 449 349 489 l 382 548 l 375 544 b 240 495 333 512 285 495 b 129 535 198 495 160 509 b 84 560 108 552 95 560 b 76 559 81 560 78 560 b 31 487 59 555 43 530 b 14 470 27 473 24 470 b 1 477 8 470 4 471 l 0 480 l 0 553 l 0 627 l 1 630 b 16 638 4 635 9 638 b 23 635 17 638 20 637 b 49 626 36 626 39 626 b 96 638 59 626 80 630 b 104 639 99 638 102 639 b 117 644 107 641 112 642 b 147 648 125 645 137 648 m 220 -1 l 221 -1 l 219 -1 l 220 -1 m 220 673 l 221 673 l 219 673 l 220 673 "},v8:{x_min:0,x_max:488.640625,ha:499,o:"m 217 648 b 245 649 225 648 235 649 b 453 516 343 649 430 595 b 458 478 455 503 458 491 b 412 370 458 440 441 398 b 411 369 412 369 411 369 b 415 365 411 367 412 367 b 488 231 462 331 488 281 b 472 165 488 208 483 186 b 243 43 434 86 338 43 b 63 104 178 43 112 62 b 0 233 20 140 0 186 b 73 365 0 283 24 331 l 77 369 l 72 374 b 29 476 42 406 29 441 b 217 648 29 557 103 635 m 258 605 b 242 606 253 605 247 606 b 157 552 198 606 157 580 b 160 541 157 548 159 544 b 319 413 176 503 242 452 l 337 403 l 338 406 b 359 476 352 428 359 452 b 258 605 359 537 318 595 m 138 326 b 130 330 134 328 130 330 b 130 330 130 330 130 330 b 107 305 127 330 112 313 b 84 231 91 281 84 256 b 243 86 84 156 151 86 b 249 87 245 86 246 87 b 347 156 303 88 347 120 b 344 172 347 162 345 167 b 156 319 325 227 257 281 b 138 326 151 322 144 324 m 243 -1 l 245 -1 l 242 -1 l 243 -1 m 243 673 l 245 673 l 242 673 l 243 673 "},v9:{x_min:0,x_max:475.03125,ha:485,o:"m 191 646 b 212 649 198 648 205 649 b 255 644 227 649 243 646 b 458 448 348 616 428 539 b 475 342 469 415 475 378 b 460 244 475 308 469 274 b 193 44 421 124 303 44 b 91 69 157 44 122 51 b 19 161 43 97 19 126 b 21 181 19 167 20 174 b 98 241 32 220 65 241 b 170 186 129 241 160 223 b 172 166 171 179 172 173 b 121 94 172 134 152 102 b 117 93 118 94 117 93 b 121 90 117 93 118 91 b 185 76 142 80 164 76 b 270 119 220 76 251 91 b 308 259 287 145 300 194 b 313 317 310 277 313 310 b 313 317 313 317 313 317 b 313 317 313 317 313 317 b 304 315 313 317 308 316 b 216 295 273 302 245 295 b 145 308 193 295 170 299 b 19 398 88 327 42 360 b 0 469 5 420 0 444 b 24 551 0 496 8 526 b 191 646 54 596 125 637 m 227 614 b 215 616 224 616 220 616 b 202 614 210 616 206 616 b 152 535 174 610 163 592 b 144 463 147 509 144 485 b 152 391 144 440 147 417 b 216 328 163 344 179 328 b 280 391 253 328 269 344 b 288 463 285 417 288 440 b 280 535 288 485 285 509 b 227 614 269 594 258 610 m 236 -1 l 238 -1 l 235 -1 l 236 -1 m 236 673 l 238 673 l 235 673 l 236 673 "},va:{x_min:-149.71875,x_max:148.359375,ha:151,o:"m -8 -1 b -1 0 -5 -1 -4 0 b 16 -11 5 0 13 -4 b 83 -186 17 -12 47 -90 l 148 -358 l 148 -363 b 127 -385 148 -376 138 -385 b 112 -378 122 -385 118 -383 b 54 -226 110 -374 114 -385 b 0 -81 24 -147 0 -81 b -55 -226 -1 -81 -25 -147 b -114 -378 -115 -385 -111 -374 b -129 -385 -119 -383 -123 -385 b -149 -363 -140 -385 -149 -376 l -149 -358 l -84 -186 b -19 -11 -49 -90 -19 -12 b -8 -1 -17 -8 -12 -4 "},vb:{x_min:0,x_max:428.75,ha:438,o:"m 262 186 b 273 186 266 186 272 186 b 274 186 273 186 274 186 b 285 186 274 186 280 186 b 428 48 375 181 428 122 b 386 -68 428 12 416 -29 b 155 -187 329 -145 236 -187 b 12 -111 92 -187 38 -162 b 0 -51 4 -91 0 -72 b 262 186 0 58 122 179 "},vc:{x_min:0,x_max:447.8125,ha:457,o:"m 0 86 l 0 173 l 223 173 l 447 173 l 447 86 l 447 0 l 223 0 l 0 0 l 0 86 "},vf:{x_min:0,x_max:370.21875,ha:378,o:"m 0 0 l 0 277 l 61 277 l 122 277 l 122 0 l 122 -278 l 61 -278 l 0 -278 l 0 0 m 246 -1 l 246 277 l 308 277 l 370 277 l 370 -1 l 370 -278 l 308 -278 l 246 -278 l 246 -1 "},v10:{x_min:0,x_max:559.421875,ha:571,o:"m 5 127 b 14 127 6 127 9 127 b 51 126 25 127 43 127 b 175 98 93 122 138 112 l 186 94 b 279 51 210 86 255 65 b 285 47 280 51 283 48 b 319 27 291 44 311 31 l 326 22 b 359 0 332 19 352 4 l 367 -6 b 371 -9 368 -6 370 -8 l 379 -15 b 387 -22 383 -18 386 -20 l 398 -30 l 411 -40 l 417 -47 l 427 -55 l 434 -61 b 441 -66 436 -62 439 -65 l 446 -72 l 453 -77 l 462 -87 b 558 -188 490 -113 549 -176 b 559 -195 559 -191 559 -194 b 548 -205 559 -201 555 -205 b 541 -204 547 -205 544 -205 b 534 -198 539 -201 536 -199 l 525 -191 b 481 -162 518 -187 490 -167 b 472 -155 477 -159 472 -156 b 468 -152 470 -155 469 -154 b 461 -149 466 -152 464 -151 b 428 -130 454 -145 441 -137 b 371 -99 413 -122 372 -99 b 363 -95 371 -99 367 -98 b 353 -91 357 -94 353 -91 b 348 -90 353 -91 352 -91 b 332 -81 343 -87 341 -86 b 27 -12 230 -37 127 -13 b 0 -5 4 -11 2 -11 b 0 58 0 -2 0 27 b 0 122 0 88 0 120 b 5 127 1 124 4 126 "},v11:{x_min:-155.171875,x_max:153.8125,ha:157,o:"m -137 353 b -130 353 -136 353 -133 353 b -112 349 -125 353 -119 352 b -100 342 -110 347 -104 344 b 0 317 -69 326 -35 317 b 111 349 38 317 76 328 b 129 353 117 352 123 353 b 153 327 142 353 153 344 b 144 302 153 320 153 317 b 27 6 93 226 50 113 b 21 -13 24 -11 24 -11 b 0 -26 17 -22 8 -26 b -24 -12 -9 -26 -19 -22 b -28 5 -24 -9 -27 -2 b -145 302 -53 117 -95 224 b -155 327 -155 317 -155 320 b -137 353 -155 340 -148 349 "},v18:{x_min:0,x_max:323.9375,ha:331,o:"m 217 535 b 225 537 220 537 221 537 b 245 524 235 537 242 533 l 246 521 l 247 390 l 247 258 l 273 265 b 306 270 288 269 299 270 b 322 259 315 270 319 267 b 323 208 323 256 323 233 b 322 158 323 184 323 159 b 288 140 318 148 315 147 b 247 130 254 131 247 130 b 247 65 247 130 247 104 b 247 20 247 51 247 36 l 247 -88 l 273 -81 b 306 -76 289 -77 299 -76 b 318 -81 311 -76 315 -77 b 323 -123 323 -87 323 -86 l 323 -138 l 323 -154 b 318 -195 323 -191 323 -190 b 269 -210 314 -199 315 -199 b 249 -216 259 -213 250 -216 l 247 -216 l 247 -349 l 246 -483 l 245 -487 b 225 -499 242 -495 234 -499 b 206 -487 219 -499 210 -495 l 205 -483 l 205 -355 l 205 -227 l 204 -227 l 181 -233 l 138 -244 b 117 -249 127 -247 117 -249 b 115 -385 115 -249 115 -256 l 115 -523 l 114 -526 b 95 -538 110 -534 102 -538 b 74 -526 87 -538 78 -534 l 73 -523 l 73 -391 b 72 -260 73 -269 73 -260 b 72 -260 72 -260 72 -260 b 19 -273 61 -263 23 -273 b 0 -260 10 -273 4 -267 b 0 -209 0 -256 0 -256 l 0 -162 l 1 -158 b 61 -134 5 -148 5 -148 l 73 -131 l 73 -22 b 72 86 73 79 73 86 b 72 86 72 86 72 86 b 19 74 61 83 23 74 b 0 86 10 74 4 79 b 0 137 0 90 0 90 l 0 184 l 1 188 b 61 212 5 198 5 198 l 73 215 l 73 348 l 73 481 l 74 485 b 95 498 78 492 87 498 b 103 495 98 498 100 496 b 114 485 107 494 111 489 l 115 481 l 115 353 l 115 226 l 121 226 b 159 235 123 227 141 231 l 198 247 l 205 248 l 205 384 l 205 521 l 206 524 b 217 535 209 528 212 533 m 205 9 b 205 119 205 70 205 119 l 205 119 b 182 113 204 119 194 116 l 138 102 b 117 97 127 99 117 97 b 115 -12 115 97 115 91 l 115 -122 l 121 -120 b 159 -111 123 -119 141 -115 l 198 -101 l 205 -98 l 205 9 "},v1b:{x_min:0,x_max:559.421875,ha:571,o:"m 544 204 b 548 204 545 204 547 204 b 559 194 555 204 559 199 b 559 190 559 192 559 191 b 530 156 559 188 556 184 b 462 86 510 134 481 104 b 453 76 458 81 454 77 l 446 70 l 441 65 b 434 59 439 63 436 61 l 427 54 b 409 37 426 51 416 44 b 392 23 398 29 394 26 b 387 19 389 22 387 20 b 379 13 386 19 383 16 l 371 8 l 367 5 l 359 -1 l 337 -16 b 285 -48 319 -29 298 -41 l 279 -52 b 186 -95 255 -66 210 -87 l 175 -99 b 23 -129 127 -117 68 -129 b 17 -129 20 -129 19 -129 b 1 -123 2 -129 2 -129 b 0 -49 0 -122 0 -83 b 0 4 0 -22 0 1 b 27 11 2 9 4 9 b 185 31 78 12 145 20 b 198 34 186 31 193 33 b 314 73 234 44 277 58 b 349 88 328 79 340 84 b 353 90 352 90 353 90 b 363 94 353 90 357 93 b 371 98 367 97 371 98 b 428 129 372 98 413 120 b 461 148 441 136 454 144 b 468 151 464 149 466 151 b 472 154 469 152 470 154 b 481 161 473 155 477 158 b 525 190 490 166 518 186 l 534 197 b 540 201 536 198 539 199 b 544 204 541 202 544 204 "},v1d:{x_min:0,x_max:619.3125,ha:632,o:"m 274 184 b 307 186 285 186 296 186 b 616 22 465 186 597 116 b 619 -1 617 13 619 5 b 308 -187 619 -104 483 -187 b 0 -1 133 -187 0 -102 b 5 36 0 11 1 23 b 274 184 29 115 141 176 m 289 161 b 272 162 284 162 277 162 b 171 41 209 162 171 108 b 205 -73 171 5 182 -34 b 345 -163 243 -133 298 -163 b 436 -98 385 -163 420 -142 b 446 -43 443 -80 446 -62 b 289 161 446 47 377 147 "},v1e:{x_min:-402.890625,x_max:401.53125,ha:410,o:"m -219 173 b -213 174 -217 174 -215 174 b -202 173 -209 174 -205 173 b -114 86 -200 172 -179 151 b -28 0 -66 37 -28 0 b 40 84 -28 0 2 37 b 117 174 111 173 110 172 b 122 174 118 174 119 174 b 132 173 125 174 129 173 b 295 11 134 172 171 134 l 307 -1 l 336 34 b 374 76 366 72 368 74 b 381 77 375 77 378 77 b 401 56 392 77 401 68 b 400 48 401 54 401 51 b 223 -172 397 41 230 -166 b 210 -176 220 -174 215 -176 b 201 -174 206 -176 204 -176 b 112 -87 198 -173 178 -152 b 27 0 65 -38 27 0 b -42 -86 27 0 -4 -38 b -118 -174 -112 -174 -111 -173 b -123 -176 -119 -176 -121 -176 b -133 -174 -126 -176 -130 -174 b -296 -12 -136 -173 -172 -137 l -308 0 l -337 -34 b -375 -77 -367 -73 -370 -76 b -382 -79 -377 -79 -379 -79 b -402 -58 -393 -79 -402 -69 b -401 -49 -402 -55 -402 -52 b -224 172 -398 -43 -228 167 b -219 173 -223 172 -220 173 "},v1f:{x_min:-340.28125,x_max:338.921875,ha:346,o:"m -32 520 b -29 521 -31 520 -31 521 b -23 519 -27 521 -24 520 b -20 513 -21 517 -20 516 b -21 506 -20 512 -20 509 b -31 474 -23 502 -27 488 l -53 402 l -66 352 l -68 349 l -57 349 b -32 351 -51 349 -40 351 b 123 370 19 352 74 359 b 137 371 127 370 133 371 b 170 356 152 371 164 366 b 171 355 170 355 170 355 b 216 366 174 355 183 358 b 280 378 268 377 266 377 b 287 378 283 378 284 378 b 332 349 307 378 322 369 b 338 319 336 341 338 330 b 332 301 338 310 336 302 b 242 280 329 299 246 280 b 242 280 242 280 242 280 b 235 288 236 280 235 283 b 235 292 235 290 235 291 b 236 302 236 297 236 299 b 220 337 236 316 230 330 l 216 340 l 210 335 b 159 276 189 322 172 301 b 118 149 152 265 156 274 b 81 34 84 36 85 36 b -8 13 78 33 -4 13 b -8 13 -8 13 -8 13 b -14 20 -12 15 -14 15 b -8 44 -14 24 -12 31 b -2 66 -5 55 -2 65 b -2 66 -2 66 -2 66 l -2 66 b -43 41 -2 66 -21 55 b -114 4 -98 8 -98 8 b -144 0 -123 0 -134 0 b -242 99 -197 0 -242 43 b -242 109 -242 102 -242 105 b -212 219 -240 122 -242 116 b -185 312 -197 270 -185 312 l -185 312 b -189 312 -185 312 -186 312 b -259 312 -200 312 -227 312 b -321 310 -291 312 -310 310 b -334 312 -330 310 -334 312 b -340 319 -338 313 -340 316 b -336 326 -340 322 -338 324 b -291 337 -334 326 -314 331 l -247 347 l -210 348 b -172 348 -190 348 -172 348 b -168 363 -172 348 -171 355 b -145 442 -151 424 -145 441 b -133 452 -144 444 -140 446 l -77 489 b -32 520 -53 506 -32 520 m 57 334 b 53 335 55 335 54 335 b 44 334 50 335 49 335 b -70 316 8 326 -28 320 b -78 309 -78 316 -78 316 b -108 202 -80 305 -88 274 b -141 81 -136 112 -141 93 b -140 74 -141 79 -141 77 b -117 49 -137 59 -127 49 b -107 52 -114 49 -110 51 b 16 127 -106 54 14 126 b 42 217 16 127 42 215 b 49 241 42 222 44 229 b 73 320 53 251 73 317 b 57 334 73 327 65 333 "},v20:{x_min:-571.671875,x_max:570.3125,ha:582,o:"m -559 351 b -551 352 -556 352 -553 352 b -530 338 -543 352 -533 348 b -529 169 -530 337 -529 291 l -529 1 l -507 27 l -441 112 b -382 174 -394 169 -390 174 b -378 174 -381 174 -379 174 b -281 86 -370 174 -375 179 b -196 0 -234 37 -196 0 b -126 84 -196 0 -164 37 b -50 174 -55 173 -57 172 b -44 174 -49 174 -47 174 b -35 173 -42 174 -38 173 b 53 86 -32 172 -12 151 b 138 0 100 37 138 0 b 208 84 140 0 170 37 b 284 174 279 173 279 172 b 289 174 285 174 288 174 b 300 173 294 174 298 173 b 462 11 303 172 340 134 l 475 -1 l 503 34 b 541 76 534 72 536 74 b 548 77 544 77 545 77 b 570 56 560 77 570 68 b 567 48 570 54 568 51 b 392 -172 564 41 397 -166 b 378 -176 387 -174 382 -176 b 368 -174 375 -176 371 -176 b 280 -87 367 -173 347 -152 b 194 0 234 -38 194 0 b 126 -86 194 0 163 -38 b 49 -174 54 -174 55 -173 b 44 -176 47 -176 46 -176 b 34 -174 40 -176 36 -174 b -54 -87 31 -173 10 -152 b -140 0 -102 -38 -140 0 b -209 -86 -140 0 -171 -38 b -285 -174 -280 -174 -279 -173 b -291 -176 -287 -176 -288 -176 b -300 -174 -294 -176 -298 -174 b -464 -11 -303 -173 -374 -102 l -476 0 l -506 -37 b -539 -76 -528 -65 -537 -74 b -551 -80 -543 -79 -547 -80 b -570 -68 -558 -80 -566 -76 l -571 -65 l -571 136 b -570 340 -571 331 -571 337 b -559 351 -568 344 -564 348 "},v22:{x_min:0,x_max:432.828125,ha:442,o:"m 209 186 b 213 187 210 187 212 187 b 216 187 215 187 216 187 b 224 174 216 186 220 180 b 420 -1 269 105 338 43 b 432 -12 431 -8 432 -9 b 421 -23 432 -15 432 -16 b 228 -180 345 -70 264 -137 b 219 -188 221 -188 221 -188 l 219 -188 b 208 -177 215 -188 215 -188 b 10 1 163 -106 93 -44 b 0 11 0 6 0 8 b 10 22 0 13 0 15 b 202 179 87 69 167 136 b 209 186 206 183 209 186 "},v23:{x_min:0,x_max:133.390625,ha:136,o:"m 54 66 b 65 68 58 68 61 68 b 122 37 88 68 110 56 b 133 -1 130 26 133 12 b 104 -58 133 -23 123 -44 b 66 -69 92 -65 78 -69 b 10 -38 44 -69 23 -58 b 0 -1 2 -27 0 -13 b 54 66 0 30 20 61 "},v25:{x_min:0,x_max:318.5,ha:325,o:"m 20 376 b 167 377 23 377 96 377 b 296 376 231 377 294 377 b 318 347 311 371 318 359 b 296 316 318 333 311 320 b 159 315 294 315 227 315 b 21 316 91 315 24 315 b 0 345 6 320 0 333 b 20 376 0 359 6 371 "},v26:{x_min:-21.78125,x_max:483.1875,ha:493,o:"m -8 631 b -1 632 -6 632 -4 632 b 19 620 8 632 16 628 b 20 383 20 616 20 616 l 20 148 l 21 151 b 140 199 59 183 102 199 b 206 179 164 199 187 192 l 210 176 l 210 396 l 210 617 l 212 621 b 231 632 216 628 223 632 b 250 620 239 632 247 628 b 251 383 251 616 251 616 l 251 148 l 254 151 b 370 199 291 183 332 199 b 415 191 385 199 400 197 b 483 84 458 176 483 134 b 461 0 483 58 476 29 b 332 -142 439 -40 411 -72 l 255 -215 b 231 -229 240 -229 239 -229 b 216 -223 224 -229 220 -227 b 210 -158 210 -217 210 -223 b 210 -120 210 -148 210 -136 l 210 -29 l 205 -34 b 100 -142 182 -65 159 -88 l 23 -215 b -1 -229 9 -229 6 -229 b -20 -216 -9 -229 -17 -224 l -21 -212 l -21 201 l -21 616 l -20 620 b -8 631 -17 624 -13 630 m 110 131 b 96 133 106 133 100 133 b 89 133 93 133 91 133 b 24 87 63 129 40 113 l 20 80 l 20 -37 l 20 -156 l 23 -152 b 144 81 96 -72 144 20 l 144 83 b 110 131 144 113 134 126 m 341 131 b 328 133 337 133 332 133 b 322 133 326 133 323 133 b 257 87 296 129 273 113 l 251 80 l 251 -37 l 251 -156 l 255 -152 b 375 81 328 -72 375 20 l 375 83 b 341 131 375 113 367 126 "},v27:{x_min:0,x_max:432.828125,ha:442,o:"m 208 184 b 213 187 209 186 212 187 b 224 176 217 187 221 183 b 245 147 225 172 235 159 b 419 -1 288 90 347 38 b 431 -8 424 -4 431 -8 b 432 -12 432 -9 432 -11 b 430 -18 432 -13 432 -16 b 364 -61 424 -20 383 -47 b 225 -183 307 -102 250 -152 b 223 -187 224 -184 223 -187 b 220 -188 221 -188 220 -188 b 208 -176 216 -188 210 -184 b 187 -148 205 -173 197 -159 b 12 0 144 -90 84 -38 b 0 11 4 5 0 8 b 16 24 0 13 4 18 b 183 158 83 69 141 115 b 208 184 194 169 198 173 m 183 105 b 176 113 181 109 176 113 b 172 109 176 113 175 112 b 92 45 149 90 117 62 l 88 41 l 102 31 b 247 -105 160 -6 210 -55 l 254 -115 l 257 -112 l 269 -102 b 340 -45 287 -87 319 -61 l 344 -43 l 330 -33 b 183 105 272 6 221 54 "},v28:{x_min:-73.5,x_max:72.140625,ha:74,o:"m -72 252 l -73 254 l 0 254 l 72 254 l 70 252 b 0 -1 70 248 0 -1 b -72 252 -1 -1 -72 248 "},v29:{x_min:-590.71875,x_max:589.359375,ha:601,o:"m 175 273 b 182 274 178 273 181 274 b 202 262 190 274 198 269 b 204 158 204 259 204 259 l 204 56 l 250 112 b 303 174 296 172 298 172 b 308 174 304 174 307 174 b 318 173 313 174 317 173 b 481 11 322 172 357 134 l 494 -1 l 522 34 b 560 76 553 72 555 74 b 567 77 563 77 564 77 b 589 56 579 77 589 68 b 586 48 589 54 588 51 b 411 -172 583 41 416 -166 b 397 -176 406 -174 401 -176 b 387 -174 393 -176 390 -176 b 299 -87 386 -173 366 -152 b 213 0 253 -38 213 0 b 208 -6 213 0 210 -2 l 204 -12 l 204 -147 b 204 -210 204 -173 204 -194 b 198 -292 204 -297 204 -287 b 183 -299 194 -297 189 -299 b 164 -287 175 -299 167 -295 b 163 -174 163 -284 163 -284 l 161 -63 l 119 -117 b 65 -176 76 -170 73 -176 b 61 -176 63 -176 62 -176 b -35 -87 51 -174 57 -180 b -121 0 -83 -38 -121 0 b -190 -86 -122 0 -152 -38 b -266 -174 -261 -174 -259 -173 b -272 -176 -268 -176 -270 -176 b -281 -174 -276 -176 -280 -174 b -371 -86 -284 -173 -304 -152 b -457 0 -417 -38 -457 0 l -457 0 b -477 -26 -457 0 -470 -16 b -548 -227 -524 -88 -548 -161 b -536 -303 -548 -254 -544 -280 b -533 -317 -534 -309 -533 -313 b -553 -338 -533 -330 -541 -338 b -577 -315 -566 -338 -571 -333 b -590 -227 -586 -287 -590 -258 b -518 -9 -590 -154 -564 -77 b -465 56 -509 2 -504 8 l -402 134 b -363 174 -374 170 -371 174 b -359 174 -362 174 -360 174 b -262 86 -351 174 -356 179 b -176 0 -216 37 -176 0 b -107 84 -176 0 -145 37 b -31 174 -36 173 -38 172 b -25 174 -29 174 -28 174 b -16 173 -23 174 -19 173 b 147 11 -13 172 35 123 l 157 -1 l 160 1 l 163 4 l 163 130 b 164 260 163 256 163 258 b 175 273 166 266 170 270 "},v2a:{x_min:-21.78125,x_max:366.140625,ha:374,o:"m 276 1378 b 284 1379 279 1379 281 1379 b 306 1360 292 1379 298 1374 b 352 1247 326 1326 343 1286 b 366 1139 362 1213 366 1175 b 347 1009 366 1093 359 1049 l 344 1002 l 347 992 b 352 971 348 986 351 977 b 366 863 362 936 366 899 b 347 732 366 818 359 773 l 344 725 l 347 716 b 352 695 348 710 351 700 b 366 588 362 659 366 623 b 223 262 366 464 314 345 b 189 233 212 252 212 252 b 35 76 126 183 73 129 b -1 16 20 56 2 27 b -19 4 -4 9 -12 4 l -21 4 l -21 137 l -21 270 l -17 270 b 186 344 59 281 134 308 b 319 606 270 399 319 499 b 317 650 319 620 319 635 l 315 659 l 314 655 b 223 537 288 607 258 570 b 189 509 212 528 212 528 b 35 352 126 459 73 405 b -1 292 20 333 2 303 b -19 280 -4 285 -12 280 l -21 280 l -21 413 l -21 546 l -17 546 b 186 620 59 557 134 584 b 319 882 270 675 319 775 b 317 925 319 896 319 911 l 315 935 l 314 931 b 223 813 288 884 258 846 b 189 785 212 805 212 805 b 35 628 126 735 73 681 b -1 569 20 609 2 580 b -19 556 -4 562 -12 556 l -21 556 l -21 689 l -21 823 l -17 823 b 202 907 68 835 152 867 b 319 1157 280 968 319 1061 b 270 1338 319 1218 303 1281 b 262 1358 264 1349 262 1353 b 262 1364 262 1360 262 1363 b 276 1378 265 1371 269 1376 "},v2c:{x_min:-597.53125,x_max:596.171875,ha:608,o:"m -413 173 b -408 174 -412 174 -409 174 b -397 173 -404 174 -400 173 b -308 86 -394 172 -374 151 b -223 0 -261 37 -223 0 b -153 84 -223 0 -191 37 b -77 174 -83 173 -84 172 b -72 174 -76 174 -74 174 b -62 173 -68 174 -63 173 b 25 86 -59 172 -39 151 b 112 0 73 37 111 0 b 181 84 112 0 144 37 b 257 174 251 173 251 172 b 262 174 258 174 261 174 b 273 173 266 174 270 173 b 436 9 276 172 347 101 l 447 -1 l 477 36 b 522 79 511 79 513 79 l 522 79 b 552 51 533 79 539 73 b 596 -112 582 6 596 -51 b 567 -262 596 -161 586 -213 b 539 -322 558 -287 544 -316 b 524 -327 534 -326 529 -327 b 504 -315 515 -327 507 -323 b 503 -308 503 -312 503 -309 b 511 -285 503 -302 504 -297 b 555 -113 540 -227 555 -169 b 544 -34 555 -86 551 -59 b 522 19 540 -16 530 8 l 521 22 l 481 -26 l 405 -122 b 353 -176 366 -172 362 -176 b 349 -176 352 -176 351 -176 b 253 -87 341 -176 347 -180 b 167 0 206 -38 167 0 b 99 -86 167 0 136 -38 b 21 -174 27 -174 28 -173 b 17 -176 20 -176 19 -176 b 6 -174 13 -176 9 -174 b -81 -87 4 -173 -14 -152 b -167 0 -129 -38 -167 0 b -236 -86 -167 0 -198 -38 b -313 -174 -307 -174 -306 -173 b -318 -176 -314 -176 -315 -176 b -328 -174 -321 -176 -325 -174 b -491 -12 -330 -173 -367 -137 l -503 0 l -530 -34 b -570 -77 -562 -73 -564 -76 b -577 -79 -571 -79 -574 -79 b -597 -58 -588 -79 -597 -69 b -596 -49 -597 -55 -597 -52 b -417 172 -593 -43 -423 167 b -413 173 -417 172 -415 173 "},v2d:{x_min:0,x_max:438.28125,ha:447,o:"m 212 190 b 219 191 213 191 216 191 b 236 176 225 191 228 190 b 419 18 277 105 341 49 b 436 5 431 13 434 11 b 438 -1 438 4 438 1 b 424 -16 438 -8 432 -13 b 356 -49 409 -20 379 -36 b 234 -180 306 -83 258 -133 b 219 -192 230 -188 224 -192 b 200 -176 213 -192 206 -187 b 9 -15 157 -102 89 -45 b 0 0 2 -12 0 -6 b 16 18 0 9 2 12 b 200 176 93 48 159 104 b 212 190 205 186 208 188 m 239 113 b 236 117 238 116 238 117 b 230 108 235 117 234 115 b 92 -15 196 58 140 8 b 88 -18 91 -16 88 -18 b 92 -20 88 -18 91 -19 b 198 -116 130 -43 166 -74 b 200 -117 200 -117 200 -117 b 201 -117 200 -117 201 -117 b 264 -43 212 -98 242 -62 b 345 15 288 -19 321 4 b 348 18 347 16 348 16 b 344 20 348 18 347 19 b 239 113 307 41 266 79 "},v2f:{x_min:-1.359375,x_max:680.5625,ha:694,o:"m 597 1042 b 604 1042 600 1042 602 1042 b 642 1002 627 1042 642 1022 b 619 966 642 988 635 974 b 439 927 574 942 503 927 l 426 927 l 426 921 b 430 838 428 893 430 866 b 345 480 430 696 398 560 b 179 391 307 423 249 391 b 156 392 171 391 164 392 b 138 394 149 394 142 394 b 103 434 115 396 103 416 b 129 471 103 451 111 466 b 141 474 133 473 137 474 b 172 459 153 474 164 469 b 181 455 175 456 176 455 b 187 456 182 455 185 455 b 253 520 212 460 234 483 b 315 836 294 605 315 714 b 311 928 315 867 314 898 b 302 945 310 943 311 942 b 245 953 283 950 262 953 b 130 891 193 953 149 931 b 84 860 119 870 102 860 b 36 905 61 860 39 877 b 36 910 36 907 36 909 b 80 970 36 931 50 949 b 249 1017 125 1000 187 1017 b 322 1009 273 1017 299 1014 l 341 1003 b 436 991 372 995 406 991 b 577 1031 495 991 545 1004 b 597 1042 583 1038 590 1041 m 416 360 b 424 360 419 360 421 360 b 481 309 454 360 479 338 b 503 145 484 280 495 199 b 585 -185 525 16 555 -106 b 630 -245 596 -213 613 -237 l 634 -247 l 638 -245 b 647 -244 641 -245 645 -244 b 680 -278 666 -244 680 -262 b 664 -308 680 -290 675 -301 b 638 -312 658 -310 650 -312 b 613 -309 631 -312 623 -310 b 477 -201 555 -303 502 -260 b 417 -2 460 -159 434 -72 b 416 5 417 1 416 5 b 416 5 416 5 416 5 b 411 -5 415 5 413 0 b 359 -97 397 -33 377 -70 b 353 -106 355 -102 353 -105 b 359 -112 353 -108 355 -109 b 409 -130 375 -123 390 -129 b 426 -134 420 -130 421 -131 b 431 -147 428 -137 431 -141 b 420 -162 431 -152 427 -159 b 382 -169 409 -166 396 -169 b 323 -155 363 -169 341 -165 l 317 -152 l 314 -155 b 62 -303 240 -240 148 -295 b 36 -305 55 -305 44 -305 b 23 -303 29 -305 24 -305 b -1 -273 6 -299 -1 -287 b 31 -240 -1 -256 10 -240 b 36 -240 32 -240 34 -240 b 42 -241 38 -241 39 -241 b 134 -204 63 -241 99 -226 b 367 288 265 -115 357 81 b 375 330 368 313 370 320 b 416 360 383 347 400 358 m 360 -359 b 379 -359 363 -359 371 -359 b 424 -360 396 -359 416 -359 b 646 -502 536 -373 624 -430 b 649 -527 649 -510 649 -519 b 530 -673 649 -578 604 -635 l 521 -677 l 529 -681 b 653 -811 592 -714 637 -762 b 660 -853 658 -827 660 -839 b 645 -911 660 -873 656 -892 b 426 -1021 608 -981 519 -1021 b 283 -989 377 -1021 328 -1011 b 235 -949 249 -972 239 -964 b 234 -936 234 -946 234 -941 b 234 -928 234 -934 234 -931 l 235 -925 l 234 -927 l 225 -934 b 87 -982 186 -966 138 -982 b 80 -982 85 -982 83 -982 b 55 -981 70 -981 58 -981 b 17 -943 32 -981 17 -964 b 54 -904 17 -921 35 -904 b 78 -914 62 -904 72 -909 l 83 -918 l 88 -918 b 190 -831 122 -918 166 -881 b 269 -506 242 -727 269 -612 b 268 -462 269 -492 269 -477 b 266 -449 266 -458 266 -452 b 265 -444 266 -445 266 -444 b 257 -446 264 -444 261 -445 b 132 -545 196 -470 152 -505 b 88 -573 122 -563 104 -573 b 39 -523 63 -573 39 -553 b 63 -476 39 -505 44 -494 b 360 -359 136 -408 235 -369 m 419 -424 b 393 -423 411 -423 406 -423 l 375 -423 l 377 -426 b 379 -439 377 -427 378 -434 b 383 -510 382 -463 383 -487 b 314 -811 383 -609 360 -710 b 266 -893 296 -850 285 -870 b 264 -898 265 -896 264 -898 l 264 -898 b 264 -898 264 -898 264 -898 b 268 -898 264 -898 266 -898 b 273 -898 270 -898 272 -898 b 300 -909 283 -898 291 -900 b 426 -957 340 -941 385 -957 b 476 -949 443 -957 460 -954 b 547 -853 522 -931 547 -893 b 485 -745 547 -816 526 -775 b 397 -707 460 -727 432 -714 b 366 -675 375 -703 366 -692 b 396 -642 366 -657 377 -645 b 530 -557 455 -637 511 -601 b 536 -527 534 -548 536 -537 b 419 -424 536 -480 490 -437 "},v30:{x_min:-21.78125,x_max:367.5,ha:375,o:"m 276 1900 b 284 1901 279 1900 281 1901 b 306 1883 291 1901 298 1896 b 367 1686 347 1825 367 1757 b 343 1558 367 1643 359 1600 l 338 1549 l 343 1537 b 367 1411 359 1497 367 1454 b 343 1282 367 1367 359 1324 l 338 1272 l 343 1261 b 367 1135 359 1221 367 1178 b 343 1007 367 1090 359 1047 l 338 996 l 343 985 b 367 859 359 945 367 902 b 343 731 367 814 359 771 l 338 720 l 343 709 b 367 582 359 667 367 626 b 289 362 367 503 340 426 b 239 312 276 345 259 330 b 29 77 152 237 76 152 b -1 18 14 54 2 30 b -19 4 -4 11 -12 4 l -21 4 l -21 133 l -20 260 l -13 262 b 98 299 17 269 62 284 b 111 305 103 302 110 305 b 167 334 123 310 156 327 b 319 595 264 391 319 491 b 313 659 319 616 318 638 b 310 667 311 664 311 667 b 307 663 310 667 308 666 b 240 588 289 637 269 614 b 16 331 141 505 62 413 b -1 294 8 316 1 302 b -19 280 -4 287 -12 280 l -21 280 l -21 408 l -20 537 l -13 538 b 98 576 17 545 62 560 b 111 581 103 578 110 581 b 167 610 123 587 156 603 b 319 871 264 667 319 767 b 313 935 319 892 318 913 b 310 942 311 941 311 942 b 307 939 310 942 308 941 b 240 864 289 913 269 889 b 16 607 141 781 62 689 b -1 570 8 592 1 578 b -19 556 -4 563 -12 556 l -21 556 l -21 684 l -20 813 l -13 814 b 98 852 17 821 62 836 b 111 857 103 855 110 857 b 167 886 123 863 156 880 b 319 1147 264 943 319 1043 b 313 1211 319 1168 318 1189 b 310 1218 311 1217 311 1218 b 307 1215 310 1218 308 1217 b 240 1140 289 1188 269 1165 b 16 884 141 1057 62 966 b -1 846 8 868 1 855 b -19 832 -4 839 -12 832 l -21 832 l -21 960 l -20 1089 l -13 1090 b 98 1128 17 1097 62 1111 b 111 1134 103 1131 110 1134 b 167 1163 123 1139 156 1156 b 319 1424 264 1220 319 1320 b 313 1486 319 1444 318 1465 b 310 1494 311 1493 311 1494 b 307 1492 310 1494 308 1493 b 240 1417 289 1464 269 1442 b 16 1160 141 1333 62 1242 b -1 1121 8 1145 1 1131 b -19 1109 -4 1115 -12 1109 l -21 1109 l -21 1236 l -20 1365 l -13 1367 b 98 1404 17 1374 62 1388 b 111 1410 103 1407 110 1410 b 250 1508 172 1437 215 1467 b 319 1701 296 1564 319 1633 b 270 1859 319 1757 303 1814 b 262 1882 265 1868 262 1875 b 276 1900 262 1890 266 1896 "},v31:{x_min:0,x_max:386.5625,ha:394,o:"m 0 173 l 0 347 l 193 347 l 386 347 l 386 173 l 386 0 l 193 0 l 0 0 l 0 173 "},v33:{x_min:-423.3125,x_max:421.9375,ha:431,o:"m -10 276 b -2 277 -8 277 -5 277 b 17 265 5 277 13 273 b 19 163 19 260 19 260 l 19 68 l 39 45 b 277 -95 122 -34 200 -81 b 289 -97 281 -97 285 -97 b 378 0 332 -97 371 -54 b 378 11 378 4 378 6 b 302 83 378 55 345 83 b 242 66 283 83 262 77 b 208 56 231 59 219 56 b 148 120 175 56 148 81 b 200 186 148 151 164 172 b 261 198 220 194 240 198 b 420 45 341 198 411 137 b 421 22 421 37 421 29 b 257 -198 421 -86 347 -188 b 242 -198 251 -198 247 -198 b 20 -105 181 -198 95 -163 l 19 -104 l 19 -183 b 19 -216 19 -195 19 -206 b 12 -273 19 -272 17 -267 b -2 -278 8 -277 2 -278 b -21 -266 -10 -278 -19 -274 b -23 -165 -23 -263 -23 -262 l -23 -69 l -44 -47 b -250 86 -117 23 -183 66 b -295 94 -270 93 -284 94 b -315 91 -302 94 -308 94 b -381 5 -356 81 -381 43 b -355 -56 -381 -16 -372 -40 b -299 -81 -338 -73 -319 -81 b -246 -68 -283 -81 -265 -77 b -212 -58 -234 -61 -223 -58 b -168 -77 -196 -58 -179 -65 b -151 -122 -156 -90 -151 -105 b -179 -174 -151 -141 -160 -162 b -239 -195 -194 -184 -217 -192 b -257 -197 -245 -195 -250 -197 b -423 -5 -349 -197 -423 -113 b -423 0 -423 -4 -423 -1 b -277 194 -420 97 -362 173 b -247 197 -268 197 -258 197 b -24 104 -185 197 -100 162 l -23 102 l -23 181 b -21 265 -23 260 -23 260 b -10 276 -20 269 -14 274 "},v34:{x_min:0,x_max:622.03125,ha:635,o:"m 398 417 b 406 419 401 419 404 419 b 427 398 417 419 427 409 b 427 391 427 395 427 392 b 34 -274 424 385 38 -272 b 20 -280 29 -278 25 -280 b 0 -259 9 -280 0 -270 b 0 -252 0 -256 0 -254 b 393 413 2 -247 389 410 b 398 417 394 415 397 416 m 592 417 b 600 419 594 419 597 419 b 622 398 611 419 622 409 b 620 391 622 395 620 392 b 227 -274 617 385 231 -272 b 213 -280 223 -278 219 -280 b 193 -259 202 -280 193 -270 b 194 -252 193 -256 193 -254 b 586 413 196 -247 582 410 b 592 417 588 415 590 416 "},v36:{x_min:-1.359375,x_max:1064.390625,ha:1086,o:"m 296 692 b 314 694 302 694 307 694 b 386 685 337 694 366 689 b 548 498 480 660 548 580 b 548 481 548 492 548 487 b 455 395 541 426 499 395 b 370 462 420 395 383 417 b 362 496 364 477 362 488 b 377 514 362 509 367 514 b 393 501 386 514 390 510 b 432 474 397 484 413 474 b 470 487 445 474 458 478 b 491 530 484 496 491 510 b 490 544 491 534 491 539 b 333 660 479 606 411 657 l 323 662 l 315 646 b 269 524 285 591 269 556 b 321 431 269 492 287 466 b 349 395 338 413 343 408 b 363 342 359 378 363 362 b 359 312 363 333 362 322 b 285 158 348 266 318 206 b 281 152 283 155 281 152 b 281 152 281 152 281 152 b 287 154 283 152 284 152 b 318 155 298 154 308 155 b 461 98 371 155 419 136 l 464 97 l 483 112 b 503 129 494 120 503 127 b 504 130 503 129 504 129 b 503 138 504 131 503 134 b 500 180 500 152 500 166 b 553 326 500 238 518 288 b 604 366 560 331 592 358 b 649 381 617 376 632 381 b 696 362 665 381 681 374 b 724 302 714 347 724 324 b 695 238 724 278 714 255 b 660 210 691 234 662 212 b 579 148 658 209 582 151 b 579 148 579 148 579 148 b 596 106 579 144 589 119 b 622 77 604 88 609 83 b 657 69 632 72 645 69 b 748 112 688 69 721 84 b 755 123 754 117 755 120 b 755 127 755 124 755 126 b 751 165 752 137 751 151 b 758 219 751 183 754 202 b 894 387 774 290 820 347 b 896 390 896 388 896 388 b 891 398 896 391 895 392 b 622 560 827 477 730 535 b 600 580 605 564 600 569 b 617 596 600 591 607 596 b 628 595 622 596 624 596 b 1057 248 846 552 1020 412 b 1064 191 1061 229 1064 209 b 922 0 1064 94 1005 9 b 902 -1 916 -1 909 -1 b 774 76 847 -1 800 26 b 769 83 770 81 770 83 b 769 81 769 83 769 83 b 627 -1 733 29 677 -1 b 548 27 597 -1 570 8 b 515 88 537 37 525 61 l 513 95 l 510 93 l 453 45 b 390 0 396 0 396 0 b 390 0 390 0 390 0 b 374 15 381 0 377 4 b 268 105 359 69 314 105 b 250 104 262 105 257 105 l 243 102 l 234 90 b 155 1 201 49 159 2 b 147 -1 152 0 149 -1 b 130 15 138 -1 130 6 b 132 20 130 18 132 19 b 136 31 133 22 134 27 b 220 131 149 74 178 109 b 231 137 225 134 230 136 b 302 278 280 202 302 244 b 265 335 302 299 295 309 b 209 442 234 363 213 402 b 209 455 209 446 209 451 b 279 648 209 502 232 564 l 285 659 l 283 659 b 176 627 238 653 210 645 b 57 477 111 594 66 538 b 55 459 55 471 55 464 b 72 409 55 437 61 415 b 93 403 78 405 87 403 b 152 467 123 403 151 431 b 168 488 153 483 157 488 b 185 462 181 488 185 483 l 185 460 b 137 344 183 409 168 369 b 78 322 119 328 98 322 b 13 360 50 322 25 335 b -1 426 4 380 -1 402 b 89 610 -1 488 32 559 b 296 692 147 659 210 685 m 926 348 b 921 353 924 351 922 353 b 914 348 920 353 918 351 b 823 167 857 306 823 237 b 828 124 823 154 826 138 b 890 31 837 79 862 40 b 896 31 892 31 894 31 b 956 104 916 31 940 59 b 970 191 965 129 970 159 b 966 241 970 208 969 224 b 926 348 959 277 945 313 m 627 326 b 619 326 624 326 622 326 b 598 316 611 326 604 323 b 568 215 579 288 568 255 b 568 208 568 213 568 210 b 571 183 570 195 570 184 l 571 183 b 594 201 571 183 582 191 l 634 231 b 660 259 653 247 656 248 b 664 278 662 266 664 272 b 627 326 664 299 649 320 "},v38:{x_min:-1.359375,x_max:651.96875,ha:665,o:"m 389 644 b 405 645 394 645 400 645 b 504 566 450 645 492 613 b 507 541 506 557 507 549 b 480 471 507 514 498 489 l 477 467 l 483 470 b 609 591 539 485 586 531 b 613 601 611 595 613 599 b 631 609 619 607 624 609 b 651 588 641 609 651 602 b 200 -946 651 584 204 -941 b 182 -957 197 -953 190 -957 b 163 -945 174 -957 166 -953 b 161 -939 161 -942 161 -942 b 217 -743 161 -931 170 -904 b 272 -555 247 -639 272 -555 b 272 -555 272 -555 272 -555 b 264 -560 272 -555 268 -557 b 140 -603 227 -589 182 -603 b 36 -567 102 -603 65 -592 b -1 -487 12 -548 -1 -517 b 17 -427 -1 -466 5 -445 b 103 -380 38 -395 70 -380 b 191 -433 137 -380 172 -398 b 205 -484 201 -448 205 -466 b 178 -553 205 -509 196 -535 l 175 -557 l 182 -555 b 307 -435 236 -539 284 -494 b 372 -213 308 -430 372 -215 b 372 -213 372 -213 372 -213 b 364 -219 372 -213 368 -216 b 240 -262 328 -247 283 -262 b 137 -226 202 -262 166 -249 b 99 -145 112 -206 99 -176 b 118 -84 99 -124 106 -104 b 204 -38 138 -54 171 -38 b 292 -91 238 -38 273 -56 b 306 -141 302 -106 306 -124 b 279 -212 306 -167 296 -194 l 276 -215 l 281 -213 b 408 -93 336 -198 385 -151 b 473 129 409 -88 473 127 b 473 129 473 129 473 129 b 465 122 473 129 469 126 b 341 80 428 94 383 80 b 236 115 303 80 266 91 b 200 195 213 136 200 165 b 217 256 200 217 206 238 b 304 303 239 287 272 303 b 393 249 338 303 374 285 b 406 199 402 234 406 217 b 379 129 406 173 397 148 l 377 126 l 382 127 b 509 248 436 142 485 190 b 574 470 510 254 574 469 b 574 470 574 470 574 470 b 566 464 574 470 570 467 b 442 421 529 435 484 421 b 337 458 404 421 367 433 b 300 537 313 478 300 508 b 389 644 300 585 334 635 "},v39:{x_min:-171.5,x_max:251.8125,ha:257,o:"m -8 631 b -1 632 -6 632 -4 632 b 19 620 8 632 16 628 b 20 553 20 616 20 614 b 20 491 20 503 20 491 l 20 491 b 153 535 47 501 149 535 b 174 514 167 535 174 524 b 164 496 174 508 171 501 b 92 470 164 495 132 484 l 20 445 l 20 390 b 20 363 20 378 20 370 b 20 333 20 340 20 333 l 20 333 b 153 377 47 344 149 377 b 174 356 167 377 174 367 b 164 338 174 349 171 342 b 92 312 164 338 132 326 l 20 288 l 20 219 l 20 148 l 21 151 b 137 199 59 183 99 199 b 182 191 152 199 167 197 b 251 84 227 176 251 134 b 228 0 251 58 243 29 b 100 -142 206 -40 178 -72 l 23 -215 b -1 -229 9 -229 6 -229 b -20 -216 -9 -229 -17 -224 b -21 30 -21 -212 -21 -212 b -21 273 -21 163 -21 273 b -84 252 -21 273 -50 263 b -152 230 -133 234 -145 230 b -157 231 -155 230 -156 231 b -171 252 -166 234 -171 244 b -160 270 -171 259 -167 266 b -27 316 -159 270 -93 294 l -21 319 l -21 374 b -21 431 -21 406 -21 431 b -84 409 -21 431 -50 421 b -152 388 -133 392 -145 388 b -157 390 -155 388 -156 388 b -171 409 -166 392 -171 401 b -160 428 -171 417 -167 424 b -27 474 -159 428 -93 451 l -21 476 l -21 546 b -20 620 -21 614 -21 616 b -8 631 -17 624 -13 630 m 110 131 b 96 133 106 133 100 133 b 89 133 93 133 91 133 b 24 87 63 129 40 113 l 20 80 l 20 -37 l 20 -156 l 23 -152 b 144 81 96 -72 144 20 l 144 83 b 110 131 144 113 134 126 "},v3b:{x_min:0,x_max:484.5625,ha:494,o:"m 228 245 b 239 247 234 247 239 247 b 243 247 240 247 242 247 b 303 238 257 247 287 242 b 484 -2 417 208 484 104 b 412 -177 484 -65 461 -127 b 243 -248 363 -226 303 -248 b 6 -63 138 -248 36 -180 b 0 -1 1 -41 0 -20 b 228 245 0 127 98 240 m 255 181 b 240 183 247 183 245 183 b 232 181 238 183 235 183 b 142 152 200 180 168 170 l 138 149 l 190 97 l 242 44 l 294 97 l 345 149 l 340 152 b 255 181 315 169 284 180 m 147 -54 l 197 -1 l 147 51 l 95 104 l 91 99 b 62 -1 72 70 62 34 b 66 -43 62 -15 63 -29 b 91 -101 72 -63 80 -84 l 95 -106 l 147 -54 m 393 99 b 389 104 390 102 389 104 b 337 51 389 104 366 80 l 285 -1 l 337 -54 l 389 -106 l 393 -101 b 421 -1 412 -72 421 -36 b 393 99 421 34 412 69 m 294 -98 b 242 -45 265 -69 242 -45 b 190 -98 242 -45 219 -69 l 138 -151 l 142 -154 b 242 -184 172 -174 206 -184 b 340 -154 276 -184 311 -174 l 345 -151 l 294 -98 "},v3c:{x_min:0,x_max:450.53125,ha:460,o:"m 189 302 b 204 303 193 302 198 303 b 303 224 250 303 292 270 b 306 199 304 216 306 208 b 279 129 306 173 296 147 l 276 126 l 281 127 b 408 249 337 142 385 190 b 412 259 409 254 412 258 b 430 267 417 265 423 267 b 450 247 441 267 450 259 b 200 -605 450 242 204 -599 b 182 -616 197 -612 190 -616 b 163 -602 174 -616 166 -610 b 161 -598 161 -601 161 -601 b 217 -402 161 -589 170 -562 b 272 -213 247 -298 272 -213 b 272 -213 272 -213 272 -213 b 264 -219 272 -213 268 -216 b 140 -262 227 -247 182 -262 b 36 -226 102 -262 65 -249 b 0 -145 12 -206 0 -176 b 17 -84 0 -124 5 -104 b 103 -38 38 -54 70 -38 b 191 -91 137 -38 172 -56 b 205 -141 201 -106 205 -124 b 178 -212 205 -167 196 -194 l 175 -215 l 182 -213 b 307 -93 236 -198 284 -151 b 372 129 308 -88 372 127 b 372 129 372 129 372 129 b 364 122 372 129 368 126 b 240 80 328 94 283 80 b 137 115 202 80 166 91 b 99 194 111 136 99 165 b 189 302 99 244 133 292 "},v3e:{x_min:0,x_max:406.96875,ha:415,o:"m 21 183 b 28 183 24 183 25 183 b 42 181 34 183 39 183 b 127 108 47 179 47 179 b 202 41 168 72 202 41 b 279 108 204 41 238 72 b 357 177 321 145 356 176 b 375 183 363 181 370 183 b 406 151 392 183 406 169 b 404 137 406 147 405 141 b 322 62 401 131 398 129 b 251 0 284 27 251 0 b 322 -63 251 -1 284 -29 b 404 -138 398 -130 401 -133 b 406 -152 405 -142 406 -148 b 375 -184 406 -170 392 -184 b 357 -179 370 -184 363 -183 b 279 -109 356 -177 321 -147 b 202 -43 238 -73 204 -43 b 127 -109 202 -43 168 -73 b 49 -179 85 -147 50 -177 b 31 -184 43 -183 36 -184 b 0 -152 13 -184 0 -170 b 2 -138 0 -148 0 -142 b 83 -63 5 -133 8 -130 b 155 0 122 -29 155 -1 b 83 62 155 0 122 27 b 8 129 43 97 10 127 b 0 151 2 136 0 144 b 21 183 0 165 8 177 "},v3f:{x_min:-24.5,x_max:317.140625,ha:324,o:"m -24 -147 l -24 -5 l -20 -5 b -1 -19 -12 -5 -4 -11 b 58 -123 6 -43 31 -86 b 196 -278 93 -173 134 -219 b 317 -570 274 -356 317 -460 b 294 -713 317 -617 308 -666 l 289 -724 l 294 -735 b 317 -873 308 -780 317 -827 b 235 -1132 317 -963 288 -1054 b 209 -1165 228 -1140 224 -1146 b 189 -1177 204 -1172 196 -1177 b 171 -1164 182 -1177 175 -1172 b 168 -1154 170 -1161 168 -1159 b 181 -1132 168 -1149 172 -1142 b 269 -891 238 -1064 269 -975 b 269 -881 269 -886 269 -884 b 262 -814 269 -857 265 -827 b 258 -800 261 -811 259 -806 b 142 -628 240 -731 198 -667 b -8 -589 112 -606 47 -589 b -20 -589 -13 -589 -19 -589 l -24 -589 l -24 -449 l -24 -308 l -20 -308 b -1 -322 -12 -308 -4 -313 b 58 -424 6 -345 31 -388 b 194 -580 93 -476 136 -523 b 259 -660 221 -606 245 -635 b 261 -663 259 -662 261 -663 b 264 -656 262 -663 262 -660 b 269 -587 268 -632 269 -610 b 264 -521 269 -566 268 -544 b 262 -512 264 -517 262 -513 b 258 -498 261 -509 259 -503 b 142 -326 240 -428 198 -365 b -8 -287 112 -303 47 -288 b -20 -287 -13 -287 -19 -287 l -24 -287 l -24 -147 "},v40:{x_min:-1.359375,x_max:436.921875,ha:446,o:"m 213 205 b 217 205 215 205 216 205 b 234 194 224 205 234 199 b 236 187 234 194 235 190 l 245 167 l 261 129 l 270 106 b 355 -61 294 54 329 -13 b 420 -163 381 -105 402 -138 b 436 -188 435 -184 436 -184 b 436 -191 436 -190 436 -190 b 421 -206 436 -201 431 -206 l 421 -206 l 416 -206 l 405 -201 b 217 -158 347 -172 283 -158 b 31 -201 153 -158 88 -172 l 20 -206 l 14 -206 l 14 -206 b 0 -191 5 -206 0 -201 b -1 -188 0 -190 -1 -190 b 14 -163 -1 -186 0 -184 b 95 -34 36 -136 72 -77 b 166 106 119 8 148 68 l 175 129 l 183 148 l 200 188 b 213 205 205 199 208 202 "},v41:{x_min:-1.359375,x_max:556.6875,ha:568,o:"m 294 322 b 318 323 299 322 308 323 b 360 320 334 323 352 322 b 526 217 430 310 490 273 b 543 166 537 202 543 184 b 447 70 543 117 503 70 b 445 70 447 70 446 70 b 359 159 394 72 359 113 b 368 201 359 173 362 187 b 442 245 382 229 412 245 b 455 244 446 245 451 245 b 460 244 458 244 460 244 b 460 244 460 244 460 244 b 454 248 460 244 458 245 b 325 291 417 276 372 291 b 285 287 313 291 299 290 b 144 -2 183 269 144 190 b 281 -290 144 -208 179 -280 b 304 -291 289 -291 298 -291 b 524 -105 412 -291 506 -212 b 541 -84 526 -88 530 -84 b 556 -101 551 -84 556 -90 b 549 -138 556 -111 553 -122 b 334 -322 521 -237 435 -310 b 302 -324 323 -323 313 -324 b 13 -101 172 -324 54 -234 b -1 -1 4 -68 -1 -34 b 294 322 -1 161 121 303 "},v42:{x_min:-348.4375,x_max:24.5,ha:25,o:"m -330 155 b -322 156 -329 156 -326 156 b -315 156 -319 156 -317 156 b -298 147 -311 155 -308 154 b -19 30 -224 98 -122 55 l 2 26 b 24 -1 17 22 24 13 b 2 -27 24 -15 17 -23 l -19 -31 b -298 -148 -122 -56 -224 -99 b -322 -158 -313 -158 -315 -158 b -348 -131 -338 -158 -348 -145 b -344 -117 -348 -127 -347 -122 b -328 -104 -341 -112 -338 -111 b -127 -8 -269 -65 -202 -33 b -106 0 -115 -4 -106 -1 b -127 6 -106 0 -115 2 b -328 102 -202 31 -269 63 b -344 116 -338 109 -341 111 b -348 130 -347 120 -348 124 b -330 155 -348 141 -341 152 "},v43:{x_min:-442.359375,x_max:441,ha:450,o:"m -31 487 b -1 488 -21 488 -10 488 b 434 104 216 488 397 330 b 441 27 438 79 441 47 b 439 12 441 20 439 15 b 419 0 435 4 427 0 b 404 5 413 0 408 1 b 398 30 400 11 398 13 b 0 351 390 213 213 351 b -59 348 -20 351 -39 349 b -400 30 -251 324 -393 191 b -405 5 -400 13 -401 11 b -420 0 -409 1 -415 0 b -441 12 -428 0 -436 4 b -442 27 -441 15 -442 20 b -435 104 -442 47 -439 79 b -31 487 -401 316 -235 474 m -13 131 b -1 133 -9 133 -5 133 b 51 105 19 133 39 123 b 61 70 58 95 61 83 b 51 34 61 58 58 45 b -1 6 39 16 19 6 b -46 27 -17 6 -34 13 b -62 69 -57 38 -62 54 b -13 131 -62 98 -44 124 "},v44:{x_min:-21.78125,x_max:251.8125,ha:257,o:"m -8 631 b -1 632 -6 632 -4 632 b 19 620 8 632 16 628 b 20 383 20 616 20 616 l 20 148 l 21 151 b 137 199 59 183 99 199 b 182 191 152 199 167 197 b 251 84 227 176 251 134 b 228 0 251 58 243 29 b 100 -142 206 -40 178 -72 l 23 -215 b 0 -229 9 -229 6 -229 b -20 -216 -9 -229 -17 -224 l -21 -212 l -21 201 l -21 616 l -20 620 b -8 631 -17 624 -13 630 m 110 131 b 96 133 106 133 100 133 b 89 133 93 133 91 133 b 24 87 63 129 40 113 l 20 80 l 20 -37 l 20 -156 l 23 -152 b 144 81 96 -72 144 20 l 144 83 b 110 131 144 113 134 126 "},v45:{x_min:-402.890625,x_max:401.53125,ha:410,o:"m -10 273 b -4 274 -9 273 -6 274 b 16 262 4 274 12 269 b 17 158 17 259 17 259 l 17 56 l 62 112 b 117 174 110 172 110 172 b 122 174 118 174 119 174 b 132 173 125 174 129 173 b 295 11 134 172 171 134 l 307 -1 l 336 34 b 374 76 366 72 368 74 b 381 77 375 77 378 77 b 401 56 392 77 401 68 b 400 48 401 54 401 51 b 223 -172 397 41 230 -166 b 210 -176 220 -174 215 -176 b 201 -174 206 -176 204 -176 b 112 -87 198 -173 178 -152 b 27 0 65 -38 27 0 b 21 -6 27 0 24 -2 l 17 -12 l 17 -147 b 17 -210 17 -173 17 -194 b 10 -292 17 -297 16 -287 b -2 -299 6 -297 2 -299 b -21 -287 -10 -299 -19 -295 b -24 -174 -23 -284 -23 -284 l -24 -63 l -66 -117 b -121 -176 -110 -170 -114 -176 b -125 -176 -122 -176 -123 -176 b -296 -12 -134 -174 -125 -184 l -308 0 l -337 -34 b -375 -77 -367 -73 -370 -76 b -382 -79 -377 -79 -379 -79 b -402 -58 -393 -79 -402 -69 b -401 -49 -402 -55 -402 -52 b -224 170 -398 -43 -231 165 b -212 174 -221 173 -216 174 b -202 173 -208 174 -205 174 b -39 11 -200 172 -151 122 l -28 -1 l -25 1 l -24 4 l -24 130 b -23 260 -24 256 -24 258 b -10 273 -20 266 -16 270 "},v46:{x_min:0,x_max:627.46875,ha:640,o:"m 306 190 b 314 191 308 191 311 191 b 326 184 318 191 322 190 l 336 173 b 510 52 377 127 442 80 b 515 49 513 51 515 49 b 611 16 537 40 579 24 b 627 0 624 13 627 9 b 607 -18 627 -11 624 -13 b 330 -181 490 -49 389 -109 b 314 -192 323 -190 319 -192 b 306 -191 311 -192 308 -192 b 294 -177 302 -188 302 -188 b 257 -140 287 -170 265 -148 b 19 -18 193 -84 114 -44 b 0 0 2 -13 0 -11 b 16 16 0 9 2 13 b 110 49 47 24 89 40 b 117 52 111 49 114 51 b 145 65 126 56 130 58 b 281 163 200 93 245 124 b 300 186 288 170 291 174 b 306 190 300 187 303 188 m 317 137 b 313 142 315 141 314 142 b 308 137 313 142 311 141 b 161 4 276 84 220 33 b 155 0 159 1 155 0 b 163 -4 155 0 159 -2 b 308 -138 220 -34 276 -84 b 313 -142 311 -141 313 -142 b 317 -138 314 -142 315 -141 b 464 -4 351 -84 406 -34 b 470 0 468 -2 470 0 b 464 4 470 0 468 1 b 317 137 406 33 351 84 "},v47:{x_min:-24.5,x_max:315.78125,ha:322,o:"m -24 -145 l -24 -5 l -20 -5 b 1 -26 -10 -5 -6 -9 b 175 -241 31 -86 96 -166 b 314 -548 259 -323 304 -420 b 315 -589 315 -555 315 -571 b 314 -630 315 -606 315 -623 b 298 -730 311 -664 306 -699 l 295 -742 l 296 -748 b 314 -850 304 -778 311 -813 b 315 -892 315 -857 315 -874 b 314 -932 315 -909 315 -925 b 298 -1032 311 -967 306 -1002 l 295 -1045 l 296 -1050 b 314 -1153 304 -1081 311 -1115 b 315 -1193 315 -1160 315 -1177 b 314 -1235 315 -1211 315 -1228 b 217 -1526 306 -1338 270 -1444 b 201 -1533 213 -1532 208 -1533 b 182 -1522 193 -1533 185 -1529 b 179 -1514 181 -1518 179 -1517 b 189 -1489 179 -1508 182 -1501 b 266 -1217 240 -1403 266 -1308 b 262 -1156 266 -1196 265 -1177 b 110 -907 247 -1043 190 -950 b 0 -889 87 -895 50 -889 l -1 -889 l -24 -889 l -24 -749 l -24 -610 l -20 -610 b 1 -631 -10 -610 -6 -614 b 175 -846 31 -691 96 -771 b 259 -956 213 -884 236 -914 b 265 -966 262 -961 264 -966 b 265 -966 265 -966 265 -966 b 265 -953 265 -964 265 -959 b 266 -920 266 -943 266 -932 b 262 -853 266 -898 265 -873 b 110 -605 247 -741 190 -648 b 0 -587 87 -592 50 -587 l -1 -587 l -24 -587 l -24 -448 l -24 -308 l -20 -308 b 1 -328 -10 -308 -6 -312 b 175 -544 31 -388 96 -469 b 259 -655 213 -581 236 -612 b 265 -663 262 -659 264 -663 b 265 -663 265 -663 265 -663 b 265 -650 265 -663 265 -657 b 266 -617 266 -641 266 -630 b 262 -551 266 -595 265 -570 b 110 -303 247 -438 190 -345 b 0 -284 87 -290 50 -284 l -1 -284 l -24 -284 l -24 -145 "},v49:{x_min:0,x_max:630.203125,ha:643,o:"m 308 204 b 314 205 310 205 313 205 b 326 201 319 205 323 204 b 355 154 328 199 338 180 b 401 83 362 142 392 95 l 409 72 b 431 41 412 66 424 49 b 619 -174 498 -51 570 -134 b 630 -192 626 -180 630 -186 b 626 -202 630 -195 628 -199 b 616 -206 623 -205 620 -206 b 552 -188 608 -206 592 -202 b 310 -155 488 -169 392 -155 b 268 -156 295 -155 281 -155 b 77 -188 197 -161 126 -173 b 13 -206 35 -202 20 -206 b 9 -206 12 -206 10 -206 b 0 -191 2 -202 0 -197 b 8 -176 0 -186 2 -180 b 204 49 58 -136 138 -43 l 220 72 l 227 83 b 295 188 245 108 281 166 b 308 204 299 197 304 202 m 315 147 b 314 147 315 147 314 147 b 314 147 314 147 314 147 b 306 129 314 145 310 138 l 296 105 b 281 72 292 97 284 77 l 274 56 b 181 -123 247 -4 212 -72 l 174 -134 l 176 -133 b 314 -123 215 -127 272 -123 b 451 -133 356 -123 413 -127 l 454 -134 l 449 -123 b 353 56 417 -72 381 -4 l 347 72 b 332 105 344 77 336 97 l 322 129 b 315 147 318 138 315 145 "},v4a:{x_min:70.78125,x_max:378.390625,ha:315,o:"m 246 373 b 254 373 249 373 251 373 b 372 324 303 373 360 351 b 378 302 377 317 378 309 b 338 251 378 278 362 255 b 328 249 334 249 332 249 b 283 294 303 249 283 270 b 288 315 283 301 284 308 b 289 319 289 317 289 319 b 289 319 289 319 289 319 b 283 320 289 320 287 320 b 270 322 279 322 274 322 b 206 288 242 322 215 308 b 206 283 206 287 206 285 b 257 223 206 267 230 238 b 284 206 272 213 277 210 b 351 90 328 173 351 130 b 340 47 351 74 348 59 b 205 -30 314 -2 264 -30 b 182 -29 198 -30 190 -30 b 84 15 147 -24 103 -5 b 70 48 74 24 70 36 b 108 99 70 70 85 94 b 121 102 112 101 117 102 b 167 56 147 102 167 80 b 159 31 167 48 164 40 l 156 26 l 157 26 b 190 20 167 22 178 20 b 220 26 201 20 212 22 b 258 65 243 34 258 51 b 257 70 258 66 258 69 b 204 126 249 94 234 109 b 114 258 148 158 114 209 b 125 302 114 273 118 288 b 246 373 147 342 193 370 "},v4b:{x_min:0,x_max:503.609375,ha:514,o:"m 274 430 b 277 430 276 430 277 430 b 310 394 296 430 310 415 b 308 383 310 391 308 387 b 306 367 307 381 307 374 b 236 120 298 305 272 210 b 40 -273 189 -5 125 -134 b 20 -287 35 -283 27 -287 b 5 -281 14 -287 9 -285 b 0 -267 1 -277 0 -273 b 9 -242 0 -262 2 -255 b 246 395 137 -12 232 242 b 274 430 249 416 257 427 m 468 430 b 472 430 469 430 470 430 b 503 394 490 430 503 415 b 502 383 503 391 503 387 b 499 367 502 381 500 374 b 431 120 491 305 465 210 b 234 -273 382 -5 318 -134 b 213 -287 228 -283 220 -287 b 198 -281 208 -287 202 -285 b 193 -267 194 -277 193 -273 b 202 -242 193 -262 196 -255 b 439 395 330 -12 426 242 b 468 430 442 416 451 427 "},v4d:{x_min:-311.6875,x_max:310.328125,ha:317,o:"m -9 388 b -2 390 -8 390 -5 390 b 5 388 1 390 4 390 b 19 378 10 387 16 383 b 23 333 23 371 23 371 b 24 298 23 299 24 298 b 81 276 34 298 65 285 b 213 91 145 240 190 177 b 224 24 217 76 224 36 b 257 24 224 24 235 24 b 299 19 292 24 292 24 b 310 -1 306 15 310 6 b 299 -23 310 -11 306 -19 b 257 -27 292 -27 292 -27 b 224 -29 235 -27 224 -29 b 213 -95 224 -40 217 -80 b 81 -280 190 -181 145 -244 b 24 -301 65 -290 34 -301 b 23 -335 24 -301 23 -303 l 23 -340 b 17 -381 23 -374 23 -374 b -1 -391 13 -388 5 -391 b -21 -381 -9 -391 -17 -388 b -27 -340 -27 -374 -27 -374 l -27 -335 b -28 -301 -27 -303 -27 -301 b -85 -280 -38 -301 -69 -290 b -217 -95 -149 -244 -194 -181 b -228 -29 -221 -80 -228 -40 b -259 -27 -228 -29 -238 -27 b -300 -23 -294 -27 -294 -27 b -311 -2 -307 -19 -311 -11 b -294 23 -311 8 -304 19 b -259 24 -291 23 -284 24 b -228 24 -239 24 -228 24 b -217 91 -228 36 -221 76 b -85 276 -194 177 -149 240 b -28 298 -69 285 -38 298 b -27 333 -27 298 -27 299 b -27 371 -27 362 -27 369 b -9 388 -24 378 -17 385 m -27 136 b -28 247 -27 197 -28 247 b -61 216 -31 247 -53 226 b -123 33 -95 172 -121 98 l -125 24 l -76 24 l -27 24 l -27 136 m 29 242 b 24 247 27 245 24 247 b 23 136 24 247 23 197 l 23 24 l 72 24 l 121 24 l 119 33 b 29 242 115 116 77 206 m -27 -140 l -27 -27 l -76 -27 l -125 -27 l -123 -36 b -61 -220 -121 -102 -95 -176 b -28 -251 -53 -230 -31 -251 b -27 -140 -28 -251 -27 -201 m 119 -36 l 121 -27 l 72 -27 l 23 -27 l 23 -140 b 24 -251 23 -201 24 -251 b 57 -220 27 -251 49 -230 b 119 -36 91 -176 117 -102 "},v4e:{x_min:0,x_max:239.5625,ha:244,o:"m 10 460 b 20 462 13 462 14 462 b 39 449 28 462 35 458 l 40 446 l 40 326 b 40 205 40 259 40 205 b 127 227 40 205 80 215 b 220 249 196 244 213 249 b 227 247 224 249 225 248 b 238 237 231 245 235 241 l 239 233 l 239 -106 l 239 -448 l 238 -451 b 219 -463 234 -459 225 -463 b 198 -451 210 -463 202 -459 l 197 -448 l 197 -324 b 197 -201 197 -248 197 -201 b 110 -223 196 -201 157 -210 b 17 -245 42 -240 24 -245 b 10 -242 13 -245 13 -244 b 0 -233 6 -241 2 -237 l 0 -230 l 0 108 l 0 446 l 0 449 b 10 460 2 453 6 458 m 197 22 b 197 70 197 41 197 58 b 196 116 197 113 197 116 l 196 116 b 118 97 196 116 160 106 l 40 77 l 40 -18 b 40 -112 40 -69 40 -112 l 119 -93 l 197 -73 l 197 22 "},v51:{x_min:-1.359375,x_max:455.96875,ha:465,o:"m 352 541 b 357 542 353 542 355 542 b 377 530 364 542 372 537 l 378 526 l 378 394 l 379 262 l 404 266 b 436 270 420 269 430 270 b 450 265 443 270 446 269 b 455 220 455 259 455 260 l 455 208 l 455 161 l 454 156 b 411 140 449 147 447 147 b 378 133 393 137 379 134 b 378 68 378 133 378 106 b 378 22 378 54 378 38 l 379 -87 l 404 -83 b 436 -79 420 -80 430 -79 b 450 -84 443 -79 446 -80 b 455 -129 455 -90 455 -88 l 455 -141 l 455 -188 l 454 -192 b 413 -209 449 -202 447 -202 b 382 -215 398 -212 383 -215 l 378 -215 l 378 -345 l 378 -380 b 375 -485 378 -484 378 -480 b 357 -494 371 -491 364 -494 b 340 -485 351 -494 344 -491 b 336 -383 337 -480 336 -484 l 336 -349 l 336 -223 l 334 -223 b 291 -231 334 -223 314 -227 l 247 -240 l 247 -371 l 246 -503 l 245 -506 b 225 -519 242 -514 234 -519 b 206 -506 219 -519 210 -514 l 205 -503 l 205 -376 l 205 -248 l 160 -256 l 115 -265 l 115 -396 l 115 -527 l 114 -531 b 95 -544 110 -539 102 -544 b 76 -531 87 -544 78 -539 l 73 -527 l 73 -399 b 73 -273 73 -330 73 -273 b 49 -277 73 -273 61 -274 b 17 -281 32 -280 24 -281 b 4 -276 10 -281 8 -280 b -1 -234 0 -269 -1 -272 b 0 -219 -1 -229 0 -224 l 0 -170 l 1 -167 b 10 -158 2 -163 6 -159 b 49 -149 13 -156 16 -155 l 73 -145 l 73 -34 b 73 76 73 26 73 76 b 49 72 73 76 61 74 b 17 68 32 69 24 68 b 4 73 10 68 8 69 b -1 115 0 80 -1 77 b 0 130 -1 120 0 124 l 0 179 l 1 181 b 10 191 2 186 6 190 b 49 199 13 192 16 194 l 73 204 l 73 338 b 73 374 73 352 73 365 b 77 483 73 484 73 477 b 95 492 81 489 88 492 b 111 483 100 492 107 489 b 115 378 115 477 115 483 l 115 342 b 117 212 115 223 115 212 b 204 229 117 212 200 227 l 205 229 l 205 365 l 205 502 l 206 505 b 225 517 210 513 219 517 b 245 505 234 517 242 513 l 246 502 l 247 369 l 247 237 l 249 237 b 336 254 253 238 336 254 b 337 390 336 254 337 302 l 337 526 l 338 530 b 352 541 341 535 347 539 m 336 15 b 336 126 336 102 336 126 l 336 126 b 291 117 336 126 315 122 l 247 109 l 247 -1 l 247 -112 l 249 -112 b 336 -95 253 -111 336 -95 b 336 15 336 -95 336 -56 m 205 -120 b 205 -55 205 -120 205 -93 b 205 -9 205 -41 205 -24 l 205 101 l 160 93 l 115 84 l 115 -26 b 115 -83 115 -49 115 -69 b 117 -137 115 -133 115 -137 b 205 -120 118 -137 204 -120 "},v52:{x_min:-10.890625,x_max:298.078125,ha:294,o:"m 138 473 b 142 474 140 473 141 474 b 164 459 148 474 153 470 b 191 402 183 442 191 423 b 181 353 191 388 187 371 b 178 349 179 352 178 349 b 179 348 178 348 179 348 b 185 349 181 348 182 348 b 255 376 210 355 234 363 b 272 381 264 381 266 381 b 298 355 287 381 298 370 b 288 330 298 348 298 345 b 171 34 238 254 194 141 b 166 13 168 16 168 16 b 144 1 161 5 152 1 b 121 15 134 1 125 5 b 115 33 119 18 117 24 b 0 330 91 145 49 252 b -10 355 -9 345 -10 348 b 13 381 -10 371 0 381 b 31 376 19 381 25 380 b 132 345 61 358 103 345 l 136 345 l 137 355 b 145 378 138 359 142 370 b 152 415 149 394 152 405 b 137 452 152 427 148 438 b 133 464 134 458 133 460 b 138 473 133 467 134 470 "},v53:{x_min:0,x_max:902.421875,ha:921,o:"m 17 240 b 24 241 19 241 21 241 b 32 240 28 241 31 241 b 46 229 38 238 43 234 b 50 88 50 223 50 237 b 50 -1 50 63 50 34 b 50 -90 50 -36 50 -65 b 46 -231 50 -238 50 -224 b 25 -242 42 -238 34 -242 b 0 -224 14 -242 4 -235 b 0 2 0 -222 0 -108 b 0 223 0 112 0 220 b 17 240 2 230 9 237 m 110 240 b 118 241 111 241 114 241 b 126 240 121 241 123 241 b 142 223 133 237 140 230 b 144 123 144 220 144 205 b 144 29 144 45 144 29 b 144 29 144 29 144 29 b 393 183 166 106 264 167 b 450 186 412 184 431 186 b 756 29 600 186 732 120 b 756 29 756 29 756 29 b 758 123 758 29 758 45 b 760 227 758 226 758 223 b 784 241 766 237 774 241 b 804 229 792 241 800 237 b 809 88 808 223 809 237 l 809 -1 l 809 -90 b 804 -231 809 -238 808 -224 b 784 -242 800 -238 792 -242 b 762 -231 775 -242 766 -238 b 758 -124 756 -224 758 -231 b 756 -30 758 -47 758 -30 b 756 -30 756 -30 756 -30 b 509 -184 736 -108 637 -169 b 450 -187 488 -187 469 -187 b 144 -30 300 -187 168 -122 b 144 -30 144 -30 144 -30 b 144 -124 144 -30 144 -47 b 140 -231 144 -231 144 -224 b 118 -242 134 -238 126 -242 b 92 -224 107 -242 96 -235 b 92 2 92 -222 92 -108 b 92 223 92 112 92 220 b 110 240 95 230 102 237 m 432 161 b 413 162 426 162 420 162 b 313 41 351 162 313 109 b 347 -73 313 5 323 -34 b 487 -163 385 -133 439 -163 b 578 -97 526 -163 562 -142 b 588 -43 585 -80 588 -62 b 432 161 588 47 518 147 m 868 240 b 876 241 869 241 872 241 b 884 240 879 241 882 241 b 898 229 890 238 894 234 b 902 88 902 223 902 237 l 902 -1 l 902 -90 b 898 -231 902 -238 902 -224 b 876 -242 892 -238 884 -242 b 852 -224 865 -242 854 -235 b 850 2 850 -222 850 -108 b 852 223 850 112 850 220 b 868 240 853 230 860 237 "},v54:{x_min:-24.5,x_max:317.140625,ha:324,o:"m -24 -161 l -24 -5 l -20 -5 b 0 -24 -9 -5 -2 -12 b 171 -315 21 -124 84 -233 b 317 -660 268 -406 317 -531 b 187 -1014 317 -782 274 -909 b 161 -1034 172 -1034 171 -1034 b 141 -1013 149 -1034 141 -1025 b 152 -991 141 -1004 142 -1002 b 266 -682 228 -899 266 -788 b 174 -430 266 -588 236 -498 b -23 -317 136 -388 66 -348 b -24 -161 -23 -316 -24 -285 "},v55:{x_min:0,x_max:551.25,ha:563,o:"m 289 644 b 304 645 294 645 299 645 b 404 566 349 645 392 613 b 406 541 405 557 406 549 b 379 471 406 514 397 489 l 377 467 l 382 470 b 509 591 438 485 485 531 b 513 601 510 595 513 599 b 530 609 518 607 524 609 b 551 588 540 609 551 602 b 200 -605 551 584 204 -599 b 182 -616 197 -612 190 -616 b 163 -602 174 -616 166 -610 b 161 -598 161 -601 161 -601 b 217 -402 161 -589 170 -562 b 272 -213 247 -298 272 -213 b 272 -213 272 -213 272 -213 b 264 -219 272 -213 268 -216 b 140 -262 227 -247 182 -262 b 36 -226 102 -262 65 -249 b 0 -145 12 -206 0 -176 b 17 -84 0 -124 5 -104 b 103 -38 38 -54 70 -38 b 191 -91 137 -38 172 -56 b 205 -141 201 -106 205 -124 b 178 -212 205 -167 196 -194 l 175 -215 l 182 -213 b 307 -93 236 -198 284 -151 b 372 129 308 -88 372 127 b 372 129 372 129 372 129 b 364 122 372 129 368 126 b 240 80 328 94 283 80 b 137 115 202 80 166 91 b 99 195 112 136 99 165 b 118 256 99 217 106 238 b 204 303 138 287 171 303 b 292 249 238 303 273 285 b 306 199 302 234 306 217 b 279 129 306 173 296 148 l 276 126 l 281 127 b 408 248 336 142 385 190 b 473 470 409 254 473 469 b 473 470 473 470 473 470 b 465 464 473 470 469 467 b 341 421 428 435 383 421 b 236 458 303 421 266 433 b 200 537 212 478 200 508 b 289 644 200 585 234 635 "},v58:{x_min:-21.78125,x_max:367.5,ha:375,o:"m 259 1553 b 265 1553 261 1553 264 1553 b 288 1540 272 1553 277 1550 b 367 1351 340 1493 367 1424 b 336 1221 367 1308 357 1263 l 332 1211 l 333 1208 b 367 1077 356 1170 367 1124 b 336 945 367 1032 357 986 l 332 935 l 333 932 b 367 800 356 893 367 848 b 336 669 367 756 357 710 l 332 659 l 333 656 b 367 523 356 617 367 571 b 345 412 367 485 360 446 b 231 273 322 356 284 310 b -1 19 121 195 27 93 b -17 4 -4 11 -10 5 l -21 4 l -21 134 l -21 265 l -17 265 b 133 291 20 265 96 278 b 318 537 245 328 318 433 b 307 603 318 559 315 582 b 303 614 304 612 304 614 b 298 609 302 614 300 613 b 231 549 281 589 258 567 b -1 295 121 471 27 369 b -17 280 -4 287 -10 281 l -21 280 l -21 410 l -21 541 l -17 541 b 133 567 20 541 96 555 b 318 813 245 605 318 709 b 307 880 318 835 315 859 b 303 891 304 888 304 891 b 298 885 302 891 300 888 b 231 825 281 866 258 843 b -1 571 121 748 27 645 b -17 556 -4 563 -10 557 l -21 556 l -21 687 l -21 817 l -17 817 b 133 843 20 817 96 830 b 318 1089 245 881 318 985 b 307 1156 318 1111 315 1134 b 303 1167 304 1164 304 1167 b 298 1161 302 1167 300 1164 b 231 1102 281 1140 258 1120 b -1 848 121 1024 27 921 b -17 832 -4 839 -10 834 l -21 832 l -21 963 l -21 1093 l -17 1093 b 114 1113 12 1093 78 1103 b 313 1314 215 1142 289 1218 b 318 1364 317 1331 318 1347 b 255 1511 318 1422 295 1478 b 243 1532 247 1519 243 1525 b 259 1553 243 1540 250 1550 "},v59:{x_min:0,x_max:464.140625,ha:474,o:"m 0 0 l 0 347 l 76 347 l 153 347 l 153 0 l 153 -348 l 76 -348 l 0 -348 l 0 0 m 308 -1 l 308 347 l 386 347 l 464 347 l 464 -1 l 464 -348 l 386 -348 l 308 -348 l 308 -1 "},v5a:{x_min:-171.5,x_max:170.140625,ha:174,o:"m -6 566 b 0 567 -5 567 -2 567 b 14 556 6 567 12 563 b 92 285 14 555 50 433 b 170 13 166 33 170 19 b 168 13 170 13 170 13 b 161 1 168 8 167 4 l 159 0 l 122 0 l 84 0 l 81 1 b 21 195 76 5 78 -5 b -32 381 -8 297 -32 381 b -87 197 -32 381 -57 298 b -141 8 -115 94 -140 9 b -155 0 -142 2 -149 0 b -171 15 -163 0 -171 5 b -14 556 -171 18 -24 528 b -6 566 -14 560 -10 564 "},v5b:{x_min:-441,x_max:439.640625,ha:449,o:"m -428 -2 b -421 0 -427 -1 -424 0 b -406 -6 -416 0 -409 -2 b -400 -31 -401 -12 -400 -15 b -1 -352 -392 -215 -215 -352 b 58 -349 19 -352 38 -351 b 398 -31 250 -326 392 -192 b 404 -6 398 -15 400 -12 b 419 -1 408 -2 413 -1 b 439 -13 427 -1 435 -5 b 439 -29 439 -16 439 -22 b 434 -105 439 -48 438 -80 b 0 -489 397 -333 213 -489 b -68 -484 -23 -489 -44 -488 b -441 -36 -280 -452 -436 -263 b -441 -30 -441 -34 -441 -31 b -428 -2 -441 -11 -439 -5 m -13 -9 b -1 -8 -9 -8 -5 -8 b 50 -36 19 -8 39 -19 b 61 -72 57 -47 61 -59 b 50 -106 61 -84 57 -97 b -1 -134 39 -124 19 -134 b -46 -115 -17 -134 -34 -129 b -62 -72 -57 -102 -62 -87 b -13 -9 -62 -44 -44 -16 "},v5c:{x_min:0,x_max:447.8125,ha:457,o:"m 0 -87 l 0 0 l 223 0 l 447 0 l 447 -87 l 447 -174 l 223 -174 l 0 -174 l 0 -87 "},v5d:{x_min:-1.359375,x_max:592.078125,ha:604,o:"m 280 692 b 295 694 283 692 289 694 b 310 692 300 694 307 692 b 357 630 340 684 357 657 b 336 580 357 612 351 594 b 311 538 321 566 311 549 b 352 492 311 512 330 492 b 366 495 357 492 362 492 b 397 553 390 503 397 517 b 415 603 397 576 402 591 b 460 623 427 617 443 623 b 509 599 479 623 498 614 b 522 559 518 587 522 573 b 494 506 522 538 513 519 b 451 495 481 498 473 496 b 415 488 432 495 426 494 b 394 449 404 483 394 464 b 394 448 394 448 394 448 l 394 440 l 397 433 b 428 409 404 420 413 413 b 438 408 431 408 435 408 b 479 431 450 408 462 415 b 528 455 495 448 510 455 b 548 452 534 455 541 453 b 592 391 577 442 592 416 b 549 331 592 365 577 340 b 528 327 541 328 534 327 b 479 351 510 327 495 335 b 438 374 464 367 450 374 b 417 369 431 374 424 373 b 394 333 402 360 394 348 b 400 312 394 326 396 319 b 451 287 408 294 420 288 b 513 258 484 285 499 278 b 522 223 519 247 522 234 b 461 159 522 190 496 159 b 449 161 457 159 453 159 b 397 229 416 167 397 191 b 366 288 397 265 390 278 b 352 290 362 290 357 290 b 315 262 336 290 321 280 b 311 245 313 256 311 251 b 334 204 311 233 318 220 b 355 170 348 190 351 184 b 357 152 356 166 357 159 b 355 136 357 147 356 140 b 295 88 345 104 321 88 b 232 152 264 88 232 112 b 255 204 232 174 238 186 b 279 244 273 222 279 231 l 279 245 b 238 290 279 270 259 290 b 224 288 234 290 228 290 b 193 229 200 278 193 265 b 141 161 193 191 174 167 b 129 159 137 159 133 159 b 68 223 93 159 68 190 b 77 258 68 234 70 247 b 138 287 91 278 106 285 b 185 302 166 287 175 291 b 196 333 193 312 196 323 b 174 369 196 347 187 360 b 152 374 166 373 159 374 b 111 351 140 374 126 367 b 62 327 95 335 80 327 b 51 328 58 327 54 327 b -1 391 16 334 -1 363 b 53 455 -1 420 17 449 b 62 455 57 455 59 455 b 111 431 80 455 95 448 b 152 408 127 415 140 408 b 161 409 155 408 159 408 b 193 433 176 413 186 420 l 196 440 l 196 448 b 196 451 196 449 196 449 b 190 471 196 459 194 463 b 137 495 182 489 167 495 l 134 495 l 134 495 b 68 560 95 495 68 521 b 129 623 68 596 95 623 b 144 621 134 623 138 623 b 193 553 175 614 193 589 b 224 495 193 517 200 503 b 238 492 228 492 234 492 b 279 538 259 492 279 512 b 254 580 279 549 269 566 b 232 630 239 594 232 612 b 280 692 232 657 250 684 m 307 456 b 295 458 303 458 299 458 b 230 391 258 458 230 426 b 236 360 230 381 231 371 b 295 324 249 337 272 324 b 353 360 318 324 341 337 b 360 391 357 370 360 381 b 307 456 360 421 340 451 "},v60:{x_min:-590.71875,x_max:589.359375,ha:601,o:"m -367 173 b -362 174 -366 174 -364 174 b -351 173 -357 174 -353 173 b -262 86 -348 172 -328 151 b -176 0 -216 37 -176 0 b -107 84 -176 0 -145 37 b -31 174 -36 173 -38 172 b -25 174 -29 174 -28 174 b -16 173 -23 174 -19 173 b 72 86 -13 172 6 151 b 157 0 119 37 157 0 b 227 84 159 0 189 37 b 303 174 298 173 296 172 b 308 174 304 174 307 174 b 318 173 313 174 317 173 b 481 11 322 172 357 134 l 494 -1 l 522 34 b 560 76 553 72 555 74 b 567 77 563 77 564 77 b 589 56 579 77 589 68 b 586 48 589 54 588 51 b 411 -172 583 41 416 -166 b 397 -176 406 -174 401 -176 b 387 -174 393 -176 390 -176 b 299 -87 386 -173 366 -152 b 213 0 253 -38 213 0 b 144 -86 213 0 182 -38 b 68 -174 73 -174 74 -173 b 62 -176 66 -176 65 -176 b 53 -174 59 -176 55 -174 b -35 -87 50 -173 29 -152 b -121 0 -83 -38 -121 0 b -190 -86 -122 0 -152 -38 b -266 -174 -261 -174 -259 -173 b -272 -176 -268 -176 -270 -176 b -281 -174 -276 -176 -280 -174 b -371 -86 -284 -173 -304 -152 b -457 0 -417 -38 -457 0 l -457 0 b -477 -26 -457 0 -470 -16 b -548 -227 -524 -88 -548 -161 b -536 -303 -548 -254 -544 -280 b -533 -317 -534 -309 -533 -313 b -553 -338 -533 -330 -541 -338 b -577 -315 -566 -338 -571 -333 b -590 -227 -586 -287 -590 -258 b -518 -9 -590 -154 -564 -77 b -465 56 -509 2 -504 8 l -402 134 b -367 173 -375 169 -372 172 "},v62:{x_min:46.28125,x_max:669.671875,ha:563,o:"m 183 376 b 189 376 185 376 187 376 b 212 374 197 376 208 376 b 265 337 234 369 253 355 b 274 317 268 331 273 320 b 274 316 274 317 274 316 b 280 323 276 316 276 319 b 311 358 288 337 299 348 b 319 366 315 360 318 365 b 356 376 326 373 340 376 b 382 371 364 376 374 374 b 428 337 400 366 417 352 b 436 317 431 331 436 320 b 438 316 436 317 436 316 b 442 323 438 316 439 319 b 475 358 451 337 462 348 b 483 366 477 360 481 365 b 518 376 488 373 503 376 b 544 373 528 376 536 376 b 604 285 579 360 604 326 b 597 249 604 273 601 258 b 543 63 596 247 544 70 b 541 54 543 61 541 55 b 540 44 540 51 540 47 b 552 23 540 33 545 23 b 552 23 552 23 552 23 b 647 126 586 29 627 72 b 658 138 651 136 653 138 b 660 138 660 138 660 138 b 669 129 666 137 669 136 b 654 88 669 122 665 109 b 562 -12 631 43 602 9 l 549 -19 b 521 -27 540 -24 530 -27 b 447 30 490 -27 458 -4 b 443 58 445 38 443 48 b 450 93 443 72 446 84 b 504 278 453 97 504 272 b 507 288 506 283 506 287 b 509 298 507 292 509 295 b 491 326 509 310 502 320 b 487 327 490 327 488 327 b 479 324 484 327 483 326 b 441 270 462 316 443 288 b 435 249 441 265 436 254 b 398 127 434 248 419 195 b 362 4 379 61 362 5 b 328 -1 359 -1 362 -1 b 314 -1 323 -1 319 -1 b 302 -1 310 -1 306 -1 b 266 4 266 -1 269 -1 b 265 6 265 5 265 5 b 303 144 265 13 272 34 b 343 278 325 216 343 276 b 344 288 343 281 344 285 b 345 298 345 291 345 295 b 330 326 345 310 340 320 b 323 327 328 327 325 327 b 317 324 322 327 321 326 b 279 270 300 316 281 288 b 273 249 279 265 274 254 b 236 127 272 248 255 195 b 200 4 216 61 200 5 b 164 -1 197 -1 198 -1 b 151 -1 161 -1 156 -1 b 140 -1 147 -1 142 -1 b 103 4 104 -1 106 -1 b 103 6 103 5 103 5 b 141 144 103 13 108 34 b 181 278 161 216 179 276 b 182 288 181 281 181 285 b 183 298 182 291 183 295 b 168 324 183 310 178 320 b 160 327 166 326 163 327 b 141 320 156 327 151 324 b 69 230 112 305 85 272 b 57 215 65 217 62 215 b 55 215 57 215 55 215 b 46 224 49 215 46 217 b 59 260 46 231 50 242 b 151 363 81 306 112 341 b 161 369 155 365 160 367 b 183 376 166 371 174 374 "},v68:{x_min:-597.53125,x_max:596.171875,ha:608,o:"m -533 324 b -525 327 -530 326 -528 327 b -504 305 -514 327 -504 317 b -504 305 -504 305 -504 305 b -513 284 -504 299 -504 299 b -556 112 -541 226 -556 167 b -545 33 -556 84 -552 58 b -524 -20 -541 15 -532 -9 l -522 -23 l -491 15 l -413 111 b -355 174 -367 169 -363 174 b -351 174 -353 174 -352 174 b -254 86 -343 174 -348 179 b -168 -1 -208 37 -168 -1 b -100 84 -168 -1 -137 37 b -23 173 -28 173 -29 172 b -19 174 -21 174 -20 174 b -8 173 -14 174 -10 173 b 155 11 -5 172 43 123 l 166 -1 l 168 1 l 170 4 l 170 130 b 171 260 170 256 170 258 b 191 274 175 269 183 274 b 205 267 196 274 201 272 b 212 158 212 262 210 273 l 212 56 l 257 112 b 311 173 304 172 304 172 b 317 174 313 174 314 174 b 326 173 319 174 323 173 b 490 11 329 172 366 134 l 502 -1 l 530 34 b 568 76 560 72 563 74 b 575 77 570 77 573 77 b 596 56 586 77 596 68 b 594 48 596 54 596 51 b 417 -172 592 41 424 -166 b 405 -176 415 -174 409 -176 b 396 -174 401 -176 398 -176 b 307 -87 393 -173 372 -152 b 221 -1 259 -38 221 -1 b 216 -6 221 -1 219 -2 l 212 -12 l 212 -147 b 212 -210 212 -173 212 -194 b 205 -292 212 -297 210 -287 b 191 -299 201 -297 196 -299 b 172 -287 183 -299 175 -295 b 170 -174 171 -284 171 -284 l 170 -63 l 127 -117 b 73 -176 84 -170 80 -176 b 68 -176 72 -176 70 -176 b -27 -87 59 -174 65 -180 b -114 0 -74 -38 -112 0 b -182 -86 -114 0 -145 -38 b -258 -174 -253 -174 -253 -173 b -264 -176 -259 -176 -262 -176 b -274 -174 -268 -176 -272 -174 b -438 -11 -277 -173 -348 -102 l -449 0 l -479 -37 b -524 -80 -513 -80 -514 -80 l -524 -80 b -553 -52 -534 -80 -540 -74 b -597 109 -583 -8 -597 48 b -560 280 -597 165 -585 224 b -533 324 -548 310 -540 322 "},v6c:{x_min:-1.359375,x_max:193.28125,ha:197,o:"m 78 233 b 87 233 81 233 84 233 b 187 140 132 233 174 195 b 193 102 190 127 193 115 b 43 -113 193 22 136 -62 b 27 -119 36 -116 31 -119 b 19 -108 21 -119 19 -115 b 29 -97 19 -102 20 -101 b 102 13 73 -72 102 -27 b 92 51 102 26 98 40 l 91 54 l 84 54 b 8 104 53 54 21 74 b -1 142 1 116 -1 130 b 78 233 -1 187 31 227 "},v6d:{x_min:-590.71875,x_max:589.359375,ha:601,o:"m 544 335 b 553 337 548 337 551 337 b 575 313 563 337 570 330 b 589 226 583 285 589 256 b 517 8 589 152 563 76 b 464 -58 507 -4 503 -9 l 401 -136 b 362 -176 372 -172 370 -176 b 357 -176 360 -176 359 -176 b 261 -87 349 -174 355 -180 b 175 0 215 -38 175 0 b 106 -86 175 0 144 -38 b 29 -174 35 -174 36 -173 b 24 -176 28 -176 27 -176 b 14 -174 21 -176 17 -174 b -73 -87 12 -173 -8 -152 b -159 0 -121 -38 -159 0 b -228 -86 -160 0 -190 -38 b -304 -174 -299 -174 -298 -173 b -310 -176 -306 -176 -308 -176 b -319 -174 -314 -176 -318 -174 b -483 -12 -323 -173 -359 -137 l -495 0 l -524 -34 b -562 -77 -553 -73 -556 -76 b -568 -79 -564 -79 -566 -79 b -590 -58 -581 -79 -590 -69 b -588 -49 -590 -55 -589 -52 b -412 170 -585 -43 -417 165 b -398 174 -408 173 -402 174 b -389 173 -394 174 -392 174 b -300 86 -387 172 -366 151 b -215 -1 -254 37 -215 -1 b -145 84 -215 -1 -183 37 b -69 173 -74 173 -76 172 b -63 174 -68 174 -66 174 b -54 173 -61 174 -57 173 b 34 86 -51 172 -31 151 b 119 -1 81 37 119 -1 b 189 84 121 -1 151 37 b 265 173 259 173 258 172 b 270 174 266 174 269 174 b 280 173 274 174 279 173 b 370 84 283 172 303 151 b 455 -1 416 37 455 -1 l 455 -1 b 476 24 455 -1 469 15 b 547 226 522 87 547 159 b 534 302 547 252 543 278 b 532 317 533 308 532 313 b 544 335 532 326 536 333 "},v6f:{x_min:-80.3125,x_max:78.9375,ha:81,o:"m 63 191 b 69 192 65 192 66 192 b 77 188 72 192 76 191 b 78 183 78 187 78 186 b 74 158 78 179 77 172 l 66 115 b 9 -161 49 30 10 -158 b -10 -187 6 -172 -1 -181 b -34 -194 -17 -191 -25 -194 b -80 -147 -58 -194 -80 -174 b -80 -141 -80 -144 -80 -142 b 9 70 -80 -134 -73 -117 l 49 163 b 63 191 59 188 61 190 "},v70:{x_min:0,x_max:436.921875,ha:446,o:"m 213 190 b 217 191 215 191 216 191 b 231 184 223 191 228 188 b 249 154 240 167 246 159 b 419 18 292 91 348 45 b 436 -1 435 11 436 8 b 424 -16 436 -9 434 -13 b 308 -87 394 -26 340 -59 b 231 -186 276 -117 257 -142 b 219 -192 228 -191 225 -192 b 198 -174 209 -192 208 -191 b 47 -33 161 -113 110 -63 b 10 -16 34 -26 17 -19 b 0 -1 2 -13 0 -9 b 17 18 0 8 1 11 b 198 173 95 48 156 101 b 213 190 206 187 208 188 "},v72:{x_min:-423.3125,x_max:421.9375,ha:431,o:"m -262 197 b -247 197 -257 197 -253 197 b -118 162 -210 197 -163 184 b 40 45 -61 134 -13 98 b 277 -95 119 -33 200 -81 b 289 -97 281 -97 285 -97 b 378 0 332 -97 371 -55 b 378 11 378 4 378 6 b 302 83 378 55 345 83 b 242 66 283 83 262 77 b 208 56 231 59 219 56 b 148 120 175 56 148 81 b 201 186 148 151 164 172 b 261 198 220 194 240 198 b 420 45 341 198 411 136 b 421 22 421 37 421 29 b 245 -199 421 -93 338 -199 b 238 -198 243 -199 240 -199 b -44 -47 148 -194 50 -141 b -250 86 -114 22 -183 66 b -295 94 -270 91 -283 94 b -315 91 -302 94 -307 94 b -381 4 -356 81 -381 43 b -355 -56 -381 -18 -372 -40 b -298 -81 -338 -73 -319 -81 b -246 -68 -283 -81 -265 -77 b -212 -58 -234 -61 -223 -58 b -178 -69 -200 -58 -189 -62 b -151 -122 -160 -81 -151 -101 b -171 -167 -151 -138 -157 -155 b -239 -195 -185 -181 -213 -192 b -257 -197 -245 -197 -250 -197 b -423 -5 -352 -197 -423 -109 b -412 65 -423 16 -419 40 b -262 197 -389 137 -329 188 "},v74:{x_min:-206.890625,x_max:428.75,ha:438,o:"m 389 -351 b 394 -351 390 -351 393 -351 b 428 -385 413 -351 428 -367 b 428 -394 428 -388 428 -391 b 394 -428 426 -406 421 -410 l 332 -473 l 269 -516 l 205 -560 l 141 -603 l 77 -648 l 13 -692 l -50 -737 l -114 -780 l -145 -802 b -171 -813 -157 -810 -163 -813 b -175 -813 -172 -813 -174 -813 b -206 -777 -194 -811 -206 -795 b -202 -760 -206 -771 -205 -766 b -87 -675 -197 -752 -206 -757 l -34 -639 l 83 -557 l 145 -514 l 209 -470 l 272 -427 b 389 -351 375 -356 381 -352 "},v75:{x_min:-149.71875,x_max:148.359375,ha:151,o:"m -137 381 b -130 383 -134 383 -133 383 b -111 371 -122 383 -114 378 b -55 224 -110 370 -85 305 b 0 80 -25 145 -1 80 b 54 224 0 80 24 145 b 112 377 114 384 110 373 b 127 384 118 381 122 384 b 148 362 138 384 148 374 l 148 356 l 83 183 b 16 9 47 88 17 11 b -1 0 12 2 5 0 b -14 5 -5 0 -10 1 b -84 183 -19 9 -13 -6 l -149 356 l -149 362 b -137 381 -149 371 -145 378 "},v78:{x_min:0,x_max:193.28125,ha:197,o:"m 85 514 b 95 517 88 517 89 517 b 114 505 103 517 110 513 l 115 502 l 115 376 b 115 249 115 306 115 249 b 141 258 117 249 127 252 l 167 266 l 172 266 b 190 254 181 265 187 262 l 193 251 l 193 202 l 193 188 b 187 147 193 149 191 152 b 147 130 183 142 182 141 l 115 119 l 115 9 b 115 -99 115 -51 115 -99 b 141 -91 115 -99 127 -95 b 171 -81 166 -81 167 -81 l 171 -81 b 191 -94 181 -81 189 -87 b 193 -142 191 -97 193 -120 b 191 -195 193 -167 191 -194 b 125 -227 187 -205 187 -204 l 115 -230 l 115 -366 l 115 -503 l 114 -506 b 95 -519 110 -514 102 -519 b 74 -506 87 -519 78 -514 l 73 -503 l 73 -374 b 73 -245 73 -260 73 -245 b 73 -245 73 -245 73 -245 b 55 -252 72 -245 63 -249 l 32 -260 b 19 -263 27 -262 23 -263 b 4 -256 13 -263 8 -260 b 0 -215 0 -251 0 -254 b 0 -199 0 -210 0 -206 l 0 -152 l 1 -149 b 8 -140 2 -145 5 -141 b 42 -127 9 -140 24 -133 l 73 -116 l 73 -5 b 73 23 73 4 73 15 b 73 105 73 70 73 105 b 49 97 73 105 61 101 b 17 88 32 91 23 88 b 4 95 10 88 8 91 b 0 137 0 101 0 98 b 0 151 0 141 0 145 l 0 199 l 1 202 b 43 224 5 212 5 212 l 73 234 l 73 367 l 73 502 l 74 505 b 85 514 77 509 81 513 "},v79:{x_min:-1.359375,x_max:899.703125,ha:918,o:"m 307 349 b 332 351 315 351 323 351 b 443 340 367 351 408 347 b 741 47 607 306 720 195 b 744 0 743 31 744 16 b 660 -303 744 -90 713 -206 b 28 -755 534 -531 304 -695 b 14 -756 23 -755 19 -756 b -1 -741 4 -756 -1 -750 b 21 -720 -1 -731 1 -728 b 567 -56 337 -601 548 -344 b 568 -11 568 -41 568 -24 b 442 285 568 129 525 233 b 325 319 406 308 367 319 b 93 177 232 319 137 266 b 84 154 91 170 84 155 b 84 154 84 154 84 154 b 88 156 84 154 85 155 b 159 177 110 170 134 177 b 257 134 194 177 231 162 b 294 41 281 108 294 73 b 171 -97 294 -24 246 -90 b 156 -98 166 -97 161 -98 b 6 74 73 -98 6 -22 b 6 80 6 76 6 79 b 307 349 10 223 141 340 m 839 215 b 845 216 841 216 842 216 b 862 213 852 216 860 215 b 899 163 887 206 899 184 b 872 117 899 145 890 127 b 847 111 865 112 856 111 b 808 130 833 111 818 117 b 796 162 800 140 796 151 b 839 215 796 187 812 212 m 839 -112 b 845 -112 841 -112 842 -112 b 862 -115 852 -112 860 -113 b 899 -165 887 -122 899 -144 b 872 -210 899 -183 890 -201 b 847 -217 865 -215 856 -217 b 808 -198 833 -217 818 -210 b 796 -165 800 -188 796 -177 b 839 -112 796 -140 812 -116 "},v7a:{x_min:-1.359375,x_max:386.5625,ha:394,o:"m 249 535 b 257 537 251 537 253 537 b 276 524 266 537 273 533 l 277 521 l 279 419 l 279 316 l 304 323 b 337 328 319 326 330 328 b 353 316 347 328 349 324 b 355 266 355 315 355 290 b 353 215 355 241 355 217 b 319 198 349 206 347 205 b 279 187 284 190 279 188 b 279 156 279 187 279 174 b 279 136 279 151 279 144 l 279 84 l 289 87 l 330 98 b 367 105 352 102 362 105 b 378 101 372 105 375 104 b 386 61 385 95 386 94 b 386 40 386 55 386 48 l 386 -5 l 385 -8 b 374 -19 383 -12 378 -18 b 291 -40 372 -19 347 -26 b 279 -43 284 -41 279 -43 b 279 -83 279 -43 279 -59 b 279 -95 279 -87 279 -91 l 279 -145 l 304 -140 b 337 -133 321 -136 330 -133 b 349 -140 343 -133 347 -136 b 355 -181 355 -145 355 -142 l 355 -197 l 355 -210 b 349 -252 355 -249 355 -247 b 300 -269 345 -258 347 -258 b 280 -274 291 -272 281 -273 l 279 -274 l 277 -378 l 277 -483 l 276 -487 b 257 -499 273 -495 265 -499 b 238 -487 249 -499 242 -495 l 236 -483 l 236 -384 l 236 -285 l 235 -285 l 212 -291 l 170 -301 b 148 -308 159 -305 148 -306 b 147 -415 147 -308 147 -313 l 147 -523 l 145 -526 b 126 -538 141 -534 133 -538 b 106 -526 118 -538 110 -534 l 104 -523 l 104 -420 b 103 -317 104 -326 104 -317 b 103 -317 103 -317 103 -317 b 50 -330 92 -322 54 -330 b 31 -317 42 -330 35 -326 b 29 -267 29 -315 29 -315 l 29 -219 l 32 -216 b 92 -192 36 -206 36 -206 l 104 -190 l 104 -138 b 103 -87 104 -91 104 -87 b 103 -87 103 -87 103 -87 b 88 -91 103 -87 96 -88 l 49 -101 b 17 -106 32 -105 23 -106 b 6 -102 13 -106 10 -105 b -1 -62 0 -97 -1 -95 b 0 -41 -1 -56 0 -49 l 0 4 l 1 6 b 10 16 2 11 6 15 b 91 37 12 18 38 24 l 104 41 l 104 93 b 103 144 104 140 104 144 b 103 144 103 144 103 144 b 50 131 92 141 54 131 b 31 144 42 131 35 137 b 29 195 29 147 29 148 l 29 242 l 32 245 b 92 269 36 255 36 255 l 104 273 l 104 377 l 104 481 l 106 485 b 126 498 110 492 118 498 b 134 495 129 498 132 496 b 145 485 138 494 142 489 l 147 481 l 147 383 l 147 283 l 152 284 b 190 294 155 285 171 290 l 230 303 l 236 305 l 236 413 l 236 521 l 238 524 b 249 535 240 528 243 533 m 236 126 b 235 177 236 154 236 177 l 235 177 b 213 172 235 177 225 174 l 170 161 b 147 155 157 158 147 155 b 147 124 147 155 147 142 b 147 102 147 117 147 111 l 147 52 l 153 54 l 228 72 l 236 74 l 236 126 m 236 -105 b 235 -54 236 -65 236 -54 l 235 -54 b 231 -55 235 -54 234 -54 b 172 -69 227 -55 204 -62 l 149 -76 l 147 -76 l 147 -127 l 147 -179 l 152 -177 b 190 -167 155 -177 171 -173 l 230 -158 l 236 -156 l 236 -105 "},v7c:{x_min:0,x_max:300.8125,ha:307,o:"m 49 505 b 53 506 50 505 51 506 b 70 496 58 506 62 503 b 81 485 73 492 78 488 l 96 473 l 111 459 l 122 449 l 134 438 l 182 396 l 255 330 b 292 291 292 298 292 298 l 292 290 l 292 284 l 283 270 b 209 36 234 197 209 113 b 288 -170 209 -44 235 -119 b 299 -184 295 -179 299 -181 b 300 -191 300 -187 300 -188 b 285 -206 300 -199 294 -206 b 280 -206 283 -206 281 -206 b 247 -201 270 -202 259 -201 b 176 -222 223 -201 197 -208 b 114 -340 136 -249 114 -292 b 172 -471 114 -384 134 -433 b 185 -492 182 -481 185 -487 b 181 -502 185 -496 183 -499 b 171 -508 176 -505 174 -508 b 152 -498 166 -508 160 -503 b 0 -284 65 -428 12 -352 b 0 -260 0 -278 0 -270 b 1 -238 0 -252 0 -242 b 148 -140 16 -177 73 -140 b 209 -148 167 -140 189 -142 b 215 -149 212 -148 215 -149 b 215 -149 215 -149 215 -149 l 215 -149 b 201 -136 215 -148 209 -142 l 157 -97 l 96 -41 b 17 34 21 24 17 29 b 17 37 17 36 17 36 b 17 38 17 37 17 38 b 25 56 17 44 17 44 b 110 298 81 131 110 219 b 46 474 110 367 88 431 b 38 491 40 480 38 487 b 49 505 38 498 42 502 "},v7d:{x_min:-1.359375,x_max:436.921875,ha:446,o:"m 213 205 b 217 205 215 205 216 205 b 234 194 224 205 234 199 b 236 187 234 194 235 190 l 245 167 l 261 129 l 270 106 b 355 -61 294 54 329 -13 b 420 -163 381 -105 402 -138 b 436 -188 435 -184 436 -184 b 436 -191 436 -190 436 -190 b 421 -206 436 -201 431 -206 l 421 -206 l 416 -206 l 405 -201 b 217 -158 347 -172 283 -158 b 31 -201 153 -158 88 -172 l 20 -206 l 14 -206 l 14 -206 b 0 -191 5 -206 0 -201 b -1 -188 0 -190 -1 -190 b 14 -163 -1 -186 0 -184 b 95 -34 36 -136 72 -77 b 166 106 119 8 148 68 l 175 129 l 183 148 l 200 188 b 213 205 205 199 208 202 "},v7f:{x_min:0,x_max:367.5,ha:375,o:"m 0 124 l 0 187 l 61 187 l 122 187 l 122 138 l 122 91 l 153 61 l 183 30 l 213 61 l 243 91 l 243 138 l 243 187 l 306 187 l 367 187 l 367 124 l 367 61 l 321 61 l 274 61 l 243 30 l 213 0 l 243 -31 l 274 -62 l 321 -62 l 367 -62 l 367 -124 l 367 -188 l 306 -188 l 243 -188 l 243 -140 l 243 -93 l 213 -62 l 183 -31 l 153 -62 l 122 -93 l 122 -140 l 122 -188 l 61 -188 l 0 -188 l 0 -124 l 0 -62 l 46 -62 l 92 -62 l 123 -31 l 153 0 l 123 30 l 92 61 l 46 61 l 0 61 l 0 124 "},v80:{x_min:29.9375,x_max:420.578125,ha:371,o:"m 115 345 b 221 347 117 345 166 347 b 411 345 306 347 409 345 b 420 330 416 342 420 335 b 415 319 420 326 419 321 b 178 118 397 303 179 118 b 178 117 178 118 178 117 b 181 117 178 117 178 117 b 189 117 182 117 185 117 b 193 117 190 117 191 117 b 247 98 215 117 232 111 b 296 75 266 83 280 76 b 302 75 299 75 300 75 b 322 91 311 75 315 79 b 322 91 322 91 322 91 b 322 91 322 91 322 91 b 319 91 322 91 321 91 b 313 90 318 90 315 90 b 283 107 300 90 288 97 b 277 126 279 114 277 121 b 319 167 277 149 295 167 b 319 167 319 167 319 167 b 362 118 347 167 362 147 b 355 82 362 108 359 96 b 311 33 349 65 340 55 b 224 1 284 12 253 1 b 194 5 213 1 204 2 b 168 18 183 8 178 11 b 110 36 151 30 130 36 b 57 15 88 36 68 29 b 47 11 54 12 51 11 b 31 20 40 11 34 13 b 29 26 31 22 29 25 b 68 66 29 36 39 45 b 285 250 73 71 281 248 b 285 250 285 250 285 250 b 231 252 285 252 261 252 b 137 250 190 252 141 250 b 93 227 122 248 110 241 b 78 220 88 222 83 220 b 66 227 74 220 70 222 b 63 234 65 229 63 231 b 85 291 63 241 69 252 b 115 345 108 342 108 344 "},v81:{x_min:0,x_max:428.75,ha:438,o:"m 262 186 b 273 186 266 186 272 186 b 274 186 273 186 274 186 b 285 186 274 186 280 186 b 428 48 375 181 428 122 b 386 -68 428 12 416 -29 b 155 -187 329 -145 236 -187 b 12 -111 92 -187 38 -162 b 0 -51 4 -91 0 -72 b 262 186 0 58 122 179 m 366 131 b 352 134 362 133 357 134 b 219 81 321 134 269 115 b 47 -111 126 23 50 -62 b 47 -112 47 -111 47 -112 b 77 -136 47 -129 58 -136 b 264 -45 118 -136 194 -101 b 382 109 336 12 382 76 b 366 131 382 120 377 129 "},v83:{x_min:-1.359375,x_max:847.96875,ha:865,o:"m 488 1499 b 495 1500 490 1500 492 1500 b 541 1465 507 1500 521 1490 b 679 1078 622 1372 679 1210 b 677 1050 679 1068 677 1060 b 477 642 668 893 604 764 l 443 609 l 431 596 l 431 592 l 438 562 l 449 508 l 460 458 b 481 355 475 390 481 355 b 481 355 481 355 481 355 b 490 356 481 355 485 355 b 528 358 495 356 511 358 b 558 356 540 358 552 356 b 839 95 699 338 808 237 b 847 22 845 72 847 47 b 631 -303 847 -113 766 -242 b 620 -309 623 -308 620 -309 l 620 -310 b 631 -359 620 -310 626 -333 l 646 -435 l 660 -496 b 672 -588 668 -535 672 -563 b 664 -653 672 -610 669 -630 b 383 -875 630 -792 509 -875 b 201 -810 321 -875 257 -855 b 129 -680 151 -768 129 -730 b 274 -530 129 -592 200 -530 b 351 -553 300 -530 326 -538 b 412 -669 393 -582 412 -626 b 287 -805 412 -735 366 -800 l 279 -805 l 285 -809 b 383 -830 318 -823 351 -830 b 586 -718 464 -830 540 -789 b 626 -584 612 -678 626 -631 b 619 -528 626 -566 623 -548 b 612 -495 619 -526 616 -510 b 577 -324 590 -387 577 -324 b 577 -324 577 -324 577 -324 b 568 -326 575 -324 571 -324 b 528 -334 558 -328 537 -333 b 465 -338 506 -337 485 -338 b 24 -11 269 -338 87 -206 b -1 145 8 41 -1 93 b 96 442 -1 249 32 351 b 322 714 166 541 236 626 l 352 745 l 345 782 l 332 843 l 315 921 b 303 984 310 950 304 978 b 295 1082 298 1017 295 1049 b 413 1426 295 1208 336 1329 b 488 1499 436 1456 477 1496 m 549 1301 b 541 1301 547 1301 544 1301 b 411 1207 500 1301 447 1263 b 355 1004 374 1152 355 1079 b 359 942 355 984 356 963 b 371 881 362 927 363 917 l 385 818 b 392 782 389 799 392 784 l 392 782 b 434 828 393 782 424 816 b 607 1165 534 941 594 1060 b 608 1193 608 1175 608 1183 b 597 1270 608 1224 604 1254 b 549 1301 589 1286 571 1299 m 398 528 b 393 555 396 542 393 553 b 392 555 393 555 393 555 b 317 470 390 555 347 505 b 190 298 266 408 212 334 b 127 70 148 227 127 148 b 155 -77 127 19 137 -30 b 468 -303 209 -216 333 -303 b 519 -299 484 -303 502 -302 b 568 -284 541 -295 568 -287 l 568 -284 b 563 -263 568 -284 566 -274 l 534 -120 l 511 -13 l 496 61 l 480 133 b 469 187 472 176 469 187 b 468 188 469 187 469 188 b 416 162 462 188 430 172 b 337 13 364 126 337 69 b 413 -124 337 -40 363 -93 b 428 -144 424 -131 428 -137 b 428 -149 428 -145 428 -148 b 409 -166 426 -161 419 -166 b 394 -162 405 -166 400 -165 b 240 77 302 -122 240 -27 l 240 77 b 430 342 240 197 315 301 l 436 344 l 426 394 l 398 528 m 548 194 b 526 195 540 195 532 195 b 519 195 524 195 521 195 l 514 195 l 518 177 l 539 79 l 552 15 l 566 -48 l 594 -187 l 605 -240 b 612 -266 609 -254 611 -266 b 612 -266 612 -266 612 -266 b 641 -248 613 -266 630 -256 b 744 -98 692 -212 730 -156 b 751 -40 749 -79 751 -59 b 548 194 751 76 665 181 "},v84:{x_min:25.859375,x_max:164.6875,ha:168,o:"m 34 369 b 40 370 35 370 38 370 b 59 353 49 370 50 367 b 164 40 122 254 155 158 b 164 0 164 33 164 16 b 164 -40 164 -16 164 -34 b 59 -353 155 -158 122 -254 b 40 -371 53 -366 47 -371 b 34 -370 38 -371 36 -370 b 25 -358 28 -367 25 -363 b 31 -337 25 -352 27 -347 b 92 0 72 -234 92 -117 b 31 335 92 116 72 233 b 25 356 27 345 25 352 b 34 369 25 363 28 366 "},v86:{x_min:-571.671875,x_max:570.3125,ha:582,o:"m -386 173 b -381 174 -385 174 -383 174 b -370 173 -377 174 -372 173 b -281 86 -367 172 -347 151 b -196 0 -235 37 -196 0 b -126 84 -196 0 -164 37 b -50 174 -55 173 -57 172 b -44 174 -49 174 -47 174 b -35 173 -42 174 -38 173 b 53 86 -32 172 -12 151 b 138 0 100 37 138 0 b 208 84 140 0 170 37 b 284 174 279 173 277 172 b 289 174 285 174 288 174 b 299 173 294 174 298 173 b 462 11 303 172 338 134 l 475 -1 l 503 34 b 541 76 534 72 536 74 b 548 77 544 77 545 77 b 570 56 560 77 570 68 b 567 48 570 54 568 51 b 392 -172 564 41 397 -166 b 378 -176 387 -174 382 -176 b 368 -174 374 -176 371 -176 b 280 -87 367 -173 345 -152 b 194 0 234 -38 194 0 b 125 -86 194 0 163 -38 b 49 -174 54 -174 55 -173 b 43 -176 47 -176 46 -176 b 34 -174 40 -176 36 -174 b -54 -87 31 -173 10 -152 b -140 0 -102 -38 -140 0 b -209 -86 -141 0 -171 -38 b -285 -174 -280 -174 -279 -173 b -291 -176 -287 -176 -289 -176 b -300 -174 -295 -176 -299 -174 b -464 -12 -304 -173 -340 -137 l -476 0 l -504 -34 b -543 -77 -534 -73 -537 -76 b -549 -79 -545 -79 -547 -79 b -571 -58 -562 -79 -571 -69 b -568 -49 -571 -55 -570 -52 b -392 172 -566 -43 -396 167 b -386 173 -390 172 -387 173 "},v8a:{x_min:-170.140625,x_max:168.78125,ha:172,o:"m -160 567 b -122 567 -159 567 -149 567 l -87 567 l -84 566 b -74 553 -78 563 -77 560 b -20 366 -73 551 -49 466 b 31 186 8 267 31 186 b 85 371 31 186 55 269 b 140 559 114 473 138 557 b 153 567 141 564 148 567 b 168 559 159 567 166 564 b 168 555 168 557 168 557 b 92 281 168 548 159 513 b 14 13 50 134 14 13 b 0 0 14 6 6 0 b -17 15 -8 0 -17 8 b -93 283 -17 15 -51 136 b -170 552 -166 533 -170 548 b -170 553 -170 552 -170 552 b -160 567 -170 560 -167 564 "},v8b:{x_min:0,x_max:319.859375,ha:326,o:"m 149 508 b 159 509 152 509 155 509 b 186 494 170 509 181 503 b 190 440 190 487 190 488 l 190 430 l 190 377 l 242 377 l 251 377 b 303 373 298 377 296 377 b 319 345 314 367 319 356 b 304 319 319 335 314 324 b 250 315 296 315 299 315 l 242 315 l 190 315 l 190 262 l 190 252 b 186 198 190 204 190 205 b 159 183 179 188 170 183 b 132 198 148 183 138 188 b 127 252 127 205 127 204 l 127 262 l 127 315 l 76 315 l 68 315 b 14 319 20 315 21 315 b 0 347 4 324 0 335 b 14 373 0 356 4 367 b 68 377 21 377 20 377 l 76 377 l 127 377 l 127 430 l 127 440 b 132 494 127 488 127 487 b 149 508 136 501 142 505 "},v8c:{x_min:-330.75,x_max:329.390625,ha:336,o:"m -133 483 b -117 484 -127 484 -122 484 b 31 373 -51 484 9 440 b 35 348 34 365 35 356 b -25 285 35 313 10 285 b -87 331 -55 285 -76 302 b -167 402 -100 376 -133 402 b -191 398 -175 402 -183 401 b -227 341 -215 388 -227 369 b -225 320 -227 334 -227 327 b -13 74 -209 230 -125 133 b 6 65 -4 70 5 66 l 9 63 l 10 65 b 117 231 12 68 40 112 l 189 341 l 242 424 b 268 460 262 456 264 458 b 283 464 273 463 277 464 b 308 438 296 464 308 453 l 308 437 b 287 396 308 430 308 428 l 95 98 l 59 43 l 58 41 l 65 37 b 253 -156 151 -8 217 -77 b 281 -285 272 -199 281 -244 b 148 -481 281 -381 231 -463 b 115 -485 137 -484 126 -485 b -32 -376 51 -485 -9 -442 b -36 -349 -35 -366 -36 -358 b 25 -287 -36 -315 -12 -287 b 85 -333 54 -287 74 -302 b 166 -403 99 -377 133 -403 b 190 -399 174 -403 182 -402 b 225 -342 215 -390 225 -370 b 224 -322 225 -335 225 -328 b 12 -76 208 -231 125 -134 b -8 -66 2 -72 -6 -68 l -10 -65 l -12 -66 b -118 -231 -13 -68 -42 -113 l -190 -342 l -243 -426 b -269 -462 -264 -458 -265 -458 b -284 -466 -274 -464 -279 -466 b -310 -440 -298 -466 -310 -455 l -310 -438 b -288 -398 -310 -430 -308 -430 l -96 -99 l -59 -44 l -59 -43 l -66 -38 b -281 284 -198 33 -281 158 l -281 284 b -133 483 -281 392 -220 474 m 254 177 b 266 179 258 177 262 179 b 319 149 287 179 307 167 b 329 115 326 140 329 127 b 319 79 329 102 326 90 b 268 51 307 61 287 51 b 221 72 250 51 234 58 b 205 115 210 84 205 99 b 254 177 205 142 223 170 m -281 -54 b -269 -52 -277 -52 -273 -52 b -223 -73 -253 -52 -235 -59 b -206 -116 -212 -84 -206 -101 b -216 -151 -206 -129 -209 -141 b -269 -179 -228 -170 -249 -179 b -314 -159 -285 -179 -302 -173 b -330 -116 -325 -147 -330 -131 b -281 -54 -330 -88 -313 -61 "},v8d:{x_min:-1.359375,x_max:255.890625,ha:261,o:"m 118 514 b 127 517 121 517 122 517 b 147 505 136 517 142 513 l 148 502 l 148 403 b 148 306 148 351 148 306 b 174 315 149 306 160 310 l 200 324 l 205 323 b 223 312 213 323 220 319 l 225 308 l 225 260 b 225 245 225 255 225 249 b 220 204 225 208 224 209 b 179 188 216 199 215 199 l 148 177 l 148 124 l 148 70 l 189 84 b 236 98 219 94 230 98 b 247 94 240 98 243 97 b 255 52 254 88 255 87 b 255 33 255 47 255 40 l 254 -12 l 253 -15 b 249 -22 253 -18 250 -20 l 245 -24 l 196 -41 l 148 -58 l 148 -108 b 148 -158 148 -136 148 -158 b 174 -148 148 -158 160 -154 b 204 -140 198 -140 200 -140 l 204 -140 b 224 -152 213 -140 221 -145 b 225 -201 224 -155 225 -177 b 224 -254 225 -226 224 -251 b 157 -284 220 -262 220 -262 l 148 -288 l 148 -395 l 148 -503 l 147 -506 b 127 -519 142 -514 134 -519 b 107 -506 119 -519 111 -514 l 106 -503 l 106 -403 b 106 -303 106 -316 106 -303 b 104 -303 104 -303 104 -303 b 88 -310 104 -303 96 -306 l 63 -319 b 51 -322 59 -320 55 -322 b 36 -315 46 -322 40 -319 b 31 -273 32 -309 31 -312 b 31 -258 31 -269 31 -263 l 31 -210 l 34 -206 b 40 -198 35 -204 38 -199 b 74 -186 42 -197 57 -191 l 106 -173 l 106 -123 b 106 -97 106 -112 106 -104 b 106 -72 106 -76 106 -72 b 104 -72 106 -72 106 -72 b 20 -99 89 -79 23 -99 b 0 -84 10 -99 2 -93 b -1 -37 0 -81 -1 -59 b 0 11 -1 -15 0 9 b 58 40 4 22 2 22 l 106 56 l 106 109 b 106 123 106 115 106 119 b 106 162 106 147 106 162 b 81 155 106 162 93 159 b 50 147 65 149 55 147 b 36 152 43 147 40 148 b 31 194 32 158 31 156 b 31 209 31 198 31 204 l 31 256 l 34 260 b 76 281 38 269 38 269 l 106 292 l 106 396 l 106 502 l 107 505 b 118 514 110 509 114 513 "},v8f:{x_min:-21.78125,x_max:362.0625,ha:369,o:"m 302 1031 b 308 1032 304 1032 307 1032 b 330 1016 318 1032 325 1027 b 362 867 351 970 362 920 b 340 738 362 824 353 780 l 336 727 l 340 717 b 362 591 355 677 362 634 b 257 323 362 496 325 401 b 204 272 243 306 227 290 b 20 56 129 206 66 133 b -1 18 12 44 0 22 b -19 4 -4 9 -12 4 l -21 4 l -21 140 l -21 276 l -12 277 b 167 333 61 288 127 309 b 319 598 262 388 319 491 b 311 664 319 620 317 642 l 310 673 l 304 664 b 204 548 279 620 250 587 b 20 333 129 483 66 409 b -1 292 12 320 0 298 b -19 280 -4 285 -12 280 l -21 280 l -21 416 l -21 552 l -12 553 b 167 609 61 564 127 585 b 319 874 264 666 319 770 b 294 992 319 914 311 954 b 288 1011 288 1004 288 1007 b 302 1031 288 1021 294 1028 "},v90:{x_min:-171.5,x_max:483.1875,ha:493,o:"m -8 631 b -1 632 -6 632 -4 632 b 19 620 8 632 16 628 b 20 495 20 616 20 616 b 20 373 20 427 20 373 b 115 410 20 373 63 390 l 210 448 l 210 531 b 212 620 210 614 210 616 b 231 632 215 628 223 632 b 246 627 236 632 242 631 b 251 541 251 620 251 628 l 251 463 l 315 489 b 387 514 368 509 381 514 b 393 513 390 514 392 514 b 406 494 402 510 406 502 b 397 476 406 487 404 480 b 323 446 396 474 363 462 l 251 417 l 251 283 l 251 148 l 254 151 b 370 199 291 183 332 199 b 415 191 385 199 400 197 b 483 84 458 176 483 134 b 461 0 483 58 476 29 b 332 -142 439 -40 411 -72 l 255 -215 b 231 -229 240 -229 239 -229 b 216 -223 224 -229 220 -227 b 210 -158 210 -217 210 -223 b 210 -120 210 -148 210 -136 l 210 -29 l 205 -34 b 100 -142 182 -65 159 -88 l 23 -215 b -1 -229 9 -229 6 -229 b -19 -217 -9 -229 -16 -224 l -20 -215 l -21 48 l -21 310 l -83 287 b -152 262 -133 266 -145 262 b -157 263 -153 262 -155 262 b -171 283 -166 266 -171 274 b -161 301 -171 290 -167 297 b -91 328 -160 302 -129 315 l -21 356 l -21 487 l -20 617 l -19 621 b -8 631 -17 626 -12 630 m 210 288 b 210 401 210 351 210 401 b 114 365 209 401 167 384 l 20 327 l 20 238 l 20 148 l 21 151 b 140 199 59 183 102 199 b 206 180 164 199 187 192 l 209 177 b 209 177 209 177 209 177 b 210 288 210 177 210 199 m 110 131 b 96 133 106 133 100 133 b 89 133 93 133 91 133 b 24 87 63 129 40 113 l 20 80 l 20 -37 l 20 -156 l 23 -152 b 144 81 96 -72 144 20 l 144 83 b 110 131 144 113 134 126 m 341 131 b 328 133 337 133 332 133 b 322 133 326 133 323 133 b 257 87 296 129 273 113 l 251 80 l 251 -37 l 251 -156 l 255 -152 b 375 81 328 -72 375 20 l 375 83 b 341 131 375 113 367 126 "},v92:{x_min:0,x_max:598.890625,ha:611,o:"m 62 181 b 77 183 66 183 72 183 b 91 181 83 183 88 183 b 202 131 100 180 106 177 l 299 87 l 394 131 b 517 183 499 181 502 183 b 519 183 517 183 518 183 b 598 104 567 183 598 144 b 577 49 598 84 592 65 b 518 15 567 38 563 37 b 484 0 499 6 484 0 b 518 -16 484 -1 499 -8 b 577 -51 563 -38 567 -40 b 598 -105 592 -66 598 -86 b 519 -184 598 -145 567 -184 b 517 -184 518 -184 517 -184 b 394 -133 502 -184 499 -183 l 299 -88 l 202 -133 b 81 -184 99 -183 95 -184 b 77 -184 80 -184 78 -184 b 0 -105 29 -184 0 -145 b 20 -51 0 -86 5 -66 b 80 -16 29 -40 34 -38 b 114 -1 98 -8 114 -1 b 80 15 114 0 98 6 b 20 49 34 37 29 38 b 0 104 6 65 0 84 b 62 181 0 140 23 174 m 88 134 b 74 136 85 134 80 136 b 68 134 72 136 69 136 b 46 104 54 130 46 117 b 55 81 46 95 49 88 b 149 34 59 76 53 80 b 224 -1 190 15 224 0 b 144 -38 224 -1 187 -18 b 54 -84 59 -79 58 -79 b 46 -105 49 -90 46 -98 b 76 -137 46 -122 58 -137 b 78 -137 77 -137 77 -137 b 194 -86 87 -137 76 -141 b 298 -36 250 -58 298 -36 b 298 -36 298 -36 298 -36 b 402 -84 299 -36 345 -58 b 518 -137 522 -141 510 -137 b 521 -137 519 -137 519 -137 b 551 -105 539 -137 551 -122 b 541 -83 551 -98 548 -90 b 447 -36 537 -77 544 -81 b 374 -1 406 -16 374 -1 b 447 34 374 0 406 15 b 541 81 544 80 537 76 b 551 104 548 88 551 97 b 521 136 551 120 539 136 b 518 136 519 136 519 136 b 517 136 518 136 517 136 l 517 136 b 402 83 511 136 511 136 b 298 34 345 56 299 34 b 298 34 298 34 298 34 b 194 84 298 34 250 56 b 88 134 137 111 89 133 "},v93:{x_min:0,x_max:438.28125,ha:447,o:"m 212 205 b 219 205 213 205 216 205 b 239 183 228 205 231 204 b 421 -163 298 40 363 -83 b 438 -191 434 -180 438 -186 b 436 -197 438 -192 438 -195 b 424 -206 434 -204 431 -206 b 406 -201 420 -206 415 -205 b 216 -156 347 -172 281 -156 b 23 -205 148 -156 80 -173 b 14 -206 20 -206 17 -206 b 0 -191 6 -206 0 -201 b 6 -176 0 -187 1 -183 b 202 192 63 -104 142 45 b 212 205 205 199 208 202 m 264 48 l 249 81 l 243 94 l 242 91 b 89 -126 208 36 137 -66 b 81 -138 85 -133 81 -138 b 81 -138 81 -138 81 -138 b 81 -138 81 -138 81 -138 b 95 -133 81 -138 87 -136 b 280 -94 156 -108 221 -94 b 334 -98 299 -94 317 -95 b 343 -99 338 -99 343 -99 b 343 -99 343 -99 343 -99 b 338 -94 343 -99 341 -97 b 264 48 318 -58 287 1 "},v94:{x_min:-149.71875,x_max:148.359375,ha:151,o:"m -9 215 b 0 217 -6 217 -4 217 b 19 205 8 217 14 213 b 20 142 20 202 20 201 l 20 84 l 23 84 b 144 -27 81 74 129 30 b 148 -66 147 -40 148 -54 b 36 -213 148 -134 103 -197 b 0 -219 24 -217 12 -219 b -145 -104 -68 -219 -129 -173 b -149 -68 -148 -91 -149 -79 b -24 84 -149 6 -98 74 l -21 84 l -21 142 b -19 205 -20 201 -20 202 b -9 215 -17 209 -13 213 m -21 -15 b -23 41 -21 37 -21 41 b -23 41 -23 41 -23 41 b -76 11 -35 40 -62 26 b -108 -65 -98 -11 -108 -38 b -1 -176 -108 -122 -65 -176 b 107 -65 63 -176 107 -122 b 74 11 107 -38 96 -11 b 20 41 61 26 32 41 b 20 -15 20 41 20 15 b 19 -74 20 -72 20 -72 b 0 -87 14 -83 6 -87 b -19 -74 -8 -87 -16 -83 b -21 -15 -20 -72 -20 -72 "},v95:{x_min:0,x_max:406.96875,ha:415,o:"m 55 181 b 70 183 61 183 66 183 b 111 170 85 183 99 179 b 160 130 115 167 137 149 l 202 95 l 245 130 b 319 181 299 176 302 179 b 334 183 325 183 330 183 b 406 109 375 183 406 148 b 401 81 406 99 405 91 b 348 24 394 65 390 59 b 318 -1 332 11 318 0 b 348 -26 318 -1 332 -12 b 401 -83 390 -61 394 -66 b 406 -111 405 -93 406 -101 b 334 -184 406 -149 375 -184 b 319 -183 330 -184 325 -184 b 245 -131 302 -180 299 -177 l 202 -97 l 160 -131 b 85 -183 107 -177 103 -180 b 70 -184 80 -184 76 -184 b 0 -111 31 -184 0 -149 b 4 -83 0 -101 1 -93 b 58 -26 10 -66 16 -61 b 88 -1 74 -12 88 -1 b 58 24 88 0 74 11 b 10 69 23 54 17 59 b 0 109 2 81 0 95 b 55 181 0 142 21 173 m 83 133 b 72 136 78 136 76 136 b 57 131 66 136 61 134 b 46 109 49 126 46 117 b 50 93 46 104 47 98 b 107 45 51 91 77 70 b 160 0 137 20 160 0 b 107 -47 160 -1 137 -22 b 50 -94 77 -72 51 -93 b 46 -111 47 -99 46 -105 b 59 -134 46 -120 50 -130 b 72 -137 62 -136 68 -137 b 83 -136 76 -137 80 -136 b 144 -84 84 -134 107 -116 b 202 -36 176 -58 202 -36 b 261 -84 202 -36 230 -58 b 323 -136 299 -116 321 -134 b 334 -137 326 -136 330 -137 b 345 -134 338 -137 343 -136 b 360 -111 355 -130 360 -120 b 355 -94 360 -105 359 -99 b 299 -47 353 -93 329 -72 b 245 0 269 -22 245 -1 b 299 45 245 0 269 20 b 355 93 329 70 353 91 b 360 109 359 98 360 104 b 345 133 360 119 355 129 b 334 136 343 134 338 136 b 323 134 330 136 326 134 b 261 83 321 133 299 115 b 202 34 230 56 202 34 b 144 83 202 34 176 56 b 83 133 106 115 84 133 "},v97:{x_min:-228.671875,x_max:227.3125,ha:232,o:"m -217 487 l -213 488 l 0 488 l 212 488 l 216 487 b 225 476 220 484 224 480 l 227 473 l 227 244 l 227 15 l 225 12 b 206 0 223 4 215 0 b 197 1 204 0 200 0 b 187 12 193 4 189 6 l 186 15 l 186 138 l 186 262 l -1 262 l -187 262 l -187 138 l -187 15 l -189 12 b -208 0 -193 4 -200 0 b -227 12 -216 0 -223 4 l -228 15 l -228 244 l -228 473 l -227 476 b -217 487 -225 480 -221 484 "},v9a:{x_min:-21.78125,x_max:367.5,ha:375,o:"m 230 1031 b 238 1032 232 1032 235 1032 b 259 1014 245 1032 251 1027 b 367 662 330 906 367 782 b 364 602 367 641 367 621 b 232 317 352 488 304 384 b 57 120 155 245 103 187 b -1 18 31 84 6 40 b -19 4 -4 11 -12 4 l -21 4 l -21 159 l -21 315 l -16 315 b 96 335 10 315 62 324 b 315 695 227 380 315 527 b 313 738 315 709 314 724 b 224 991 304 825 273 916 b 216 1013 219 999 216 1007 b 230 1031 216 1021 220 1028 "},v9b:{x_min:-24.5,x_max:313.0625,ha:319,o:"m -24 -133 l -24 -5 l -20 -5 b -1 -19 -12 -5 -4 -11 b 142 -213 13 -61 74 -144 b 258 -376 196 -269 230 -315 b 313 -605 295 -449 313 -528 b 292 -742 313 -652 306 -699 b 288 -752 289 -748 288 -752 b 288 -752 288 -752 288 -752 b 292 -764 289 -753 291 -757 b 313 -907 306 -811 313 -860 b 292 -1045 313 -954 306 -1002 b 288 -1054 289 -1050 288 -1054 b 288 -1054 288 -1054 288 -1054 b 292 -1067 289 -1054 291 -1060 b 313 -1210 306 -1113 313 -1161 b 292 -1346 313 -1257 306 -1304 b 288 -1357 289 -1353 288 -1357 b 288 -1357 288 -1357 288 -1357 b 292 -1368 289 -1357 291 -1363 b 313 -1512 306 -1415 313 -1464 b 292 -1648 313 -1560 306 -1605 b 288 -1660 289 -1654 288 -1660 b 288 -1660 288 -1660 288 -1660 b 292 -1671 289 -1660 291 -1665 b 313 -1814 306 -1719 313 -1766 b 250 -2040 313 -1897 291 -1977 b 232 -2062 238 -2057 236 -2059 b 221 -2065 230 -2063 225 -2065 b 200 -2045 210 -2065 201 -2057 b 200 -2043 200 -2044 200 -2044 b 208 -2026 200 -2037 202 -2034 b 269 -1826 249 -1966 269 -1897 b 153 -1544 269 -1726 230 -1625 b -9 -1472 115 -1506 58 -1481 b -21 -1471 -14 -1471 -19 -1471 l -24 -1471 l -24 -1343 l -24 -1215 l -20 -1215 b -1 -1229 -12 -1215 -4 -1221 b 142 -1424 13 -1270 74 -1353 b 257 -1582 196 -1478 228 -1524 b 264 -1594 261 -1589 264 -1594 l 264 -1594 b 265 -1582 264 -1594 264 -1589 b 270 -1525 268 -1562 270 -1544 b 153 -1243 270 -1424 228 -1321 b -9 -1170 115 -1203 58 -1178 b -21 -1168 -14 -1170 -19 -1168 l -24 -1168 l -24 -1041 l -24 -913 l -20 -913 b -1 -927 -12 -913 -4 -918 b 142 -1121 13 -967 74 -1050 b 257 -1281 196 -1175 228 -1221 b 264 -1292 261 -1286 264 -1292 l 264 -1292 b 265 -1279 264 -1292 264 -1286 b 270 -1222 268 -1261 270 -1242 b 153 -941 270 -1121 228 -1018 b -9 -867 115 -900 58 -875 b -21 -866 -14 -867 -19 -866 l -24 -866 l -24 -738 l -24 -610 l -20 -610 b -1 -624 -12 -610 -4 -616 b 142 -818 13 -664 74 -749 b 257 -978 196 -873 228 -918 b 264 -989 261 -984 264 -989 l 264 -989 b 265 -977 264 -989 264 -984 b 270 -920 268 -959 270 -939 b 153 -638 270 -818 228 -716 b -9 -564 115 -598 58 -573 b -21 -563 -14 -564 -19 -563 l -24 -563 l -24 -435 l -24 -308 l -20 -308 b -1 -322 -12 -308 -4 -313 b 142 -516 13 -363 74 -446 b 257 -675 196 -571 228 -616 b 264 -687 261 -681 264 -687 l 264 -687 b 265 -674 264 -687 264 -681 b 270 -617 268 -656 270 -637 b 153 -335 270 -516 228 -413 b -9 -262 115 -295 58 -270 b -21 -260 -14 -262 -19 -260 l -24 -260 l -24 -133 "},v9c:{x_min:-166.0625,x_max:-25.859375,ha:0,o:"m -49 369 b -42 370 -46 369 -44 370 b -27 360 -36 370 -29 366 b -25 355 -27 359 -25 358 b -32 335 -25 351 -28 347 b -92 52 -66 248 -87 159 b -93 -1 -93 43 -93 20 b -92 -54 -93 -23 -93 -45 b -32 -337 -85 -162 -66 -251 b -25 -355 -27 -349 -25 -352 b -42 -371 -25 -365 -32 -371 b -61 -353 -50 -371 -51 -369 b -163 -63 -119 -262 -153 -165 b -166 -1 -166 -37 -166 -31 b -163 62 -166 30 -166 36 b -61 352 -153 163 -119 260 b -49 369 -54 365 -51 366 "},v9e:{x_min:0,x_max:607.0625,ha:619,o:"m 243 631 b 250 632 246 632 249 632 b 270 620 259 632 268 628 l 272 616 l 272 201 l 272 -212 l 270 -216 b 251 -229 268 -224 259 -229 b 227 -215 243 -229 240 -229 l 151 -142 b 32 -16 81 -80 53 -49 b 0 84 9 18 0 52 b 111 199 0 149 42 199 b 137 197 119 199 127 198 b 228 151 168 191 197 177 l 231 148 l 231 383 b 232 620 231 616 231 616 b 243 631 234 624 238 630 m 168 131 b 152 133 163 133 157 133 b 107 102 130 133 111 120 b 106 86 107 97 106 91 b 111 41 106 73 108 56 b 227 -152 125 -13 171 -90 l 231 -156 l 231 -37 l 231 80 l 225 87 b 168 131 210 111 190 126 m 347 631 b 353 632 348 632 351 632 b 374 620 363 632 371 628 b 375 383 375 616 375 616 l 375 148 l 377 151 b 492 199 415 183 454 199 b 537 191 507 199 522 197 b 607 84 582 176 607 134 b 583 0 607 58 598 29 b 455 -142 562 -40 533 -72 l 378 -215 b 355 -229 364 -229 362 -229 b 334 -216 345 -229 337 -224 l 333 -212 l 333 201 l 333 616 l 334 620 b 347 631 337 624 341 630 m 465 131 b 451 133 461 133 455 133 b 445 133 449 133 446 133 b 379 87 419 129 396 113 l 375 80 l 375 -37 l 375 -156 l 378 -152 b 499 81 451 -72 499 20 l 499 83 b 465 131 499 113 490 126 "},va3:{x_min:58.53125,x_max:228.671875,ha:294,o:"m 138 371 b 142 373 140 371 141 373 b 178 342 149 373 156 366 b 228 251 217 297 228 278 b 228 244 228 248 228 247 b 176 147 227 212 212 184 b 123 73 152 122 132 93 b 121 62 122 70 121 66 b 145 13 121 48 129 31 b 153 -2 151 6 153 1 b 149 -9 153 -5 152 -6 b 144 -11 148 -11 145 -11 b 129 -1 140 -11 136 -8 b 61 87 89 37 68 68 b 58 113 59 95 58 105 b 110 215 58 144 74 177 b 163 287 134 240 155 269 b 166 299 166 291 166 295 b 141 348 166 313 157 330 b 133 360 134 356 133 358 b 133 363 133 362 133 362 b 138 371 133 367 136 370 "},va5:{x_min:0,x_max:349.8125,ha:357,o:"m 88 302 b 103 303 93 302 98 303 b 202 224 149 303 191 270 b 205 199 204 216 205 208 b 178 129 205 173 196 147 l 175 126 l 182 127 b 307 249 236 142 284 190 b 313 259 308 254 311 258 b 329 267 317 265 323 267 b 349 247 340 267 349 259 b 201 -263 349 242 204 -258 b 182 -273 197 -270 190 -273 b 163 -260 174 -273 166 -269 b 161 -256 161 -259 161 -258 b 217 -59 161 -248 170 -220 b 272 129 247 43 272 127 b 272 129 272 129 272 129 b 264 122 272 129 268 126 b 140 80 227 94 183 80 b 36 115 102 80 65 91 b 0 194 10 136 0 165 b 88 302 0 244 32 292 "},va9:{x_min:-24.5,x_max:314.421875,ha:321,o:"m -24 -145 l -24 -5 l -20 -5 b 0 -23 -9 -5 -2 -12 b 27 -87 4 -38 14 -66 b 138 -220 53 -136 88 -177 b 235 -328 179 -255 208 -288 b 314 -592 287 -409 314 -501 b 292 -732 314 -639 307 -687 l 289 -742 l 294 -756 b 314 -896 307 -802 314 -849 b 292 -1035 314 -943 307 -991 l 289 -1045 l 294 -1057 b 314 -1197 307 -1104 314 -1152 b 292 -1338 314 -1246 307 -1292 l 289 -1347 l 294 -1360 b 314 -1500 307 -1407 314 -1454 b 273 -1689 314 -1565 300 -1628 b 250 -1712 265 -1710 261 -1712 b 228 -1691 236 -1712 228 -1704 l 228 -1685 l 234 -1675 b 270 -1507 258 -1621 270 -1564 b 98 -1193 270 -1381 209 -1261 b 40 -1174 76 -1179 58 -1174 b -10 -1189 24 -1174 8 -1178 b -20 -1192 -14 -1192 -16 -1192 l -24 -1192 l -24 -1052 l -24 -913 l -20 -913 b 0 -931 -9 -913 -2 -920 b 27 -995 4 -946 14 -974 b 138 -1128 53 -1043 88 -1085 b 257 -1275 190 -1172 228 -1220 b 262 -1283 259 -1279 262 -1283 l 262 -1283 b 269 -1249 264 -1282 268 -1260 b 270 -1206 270 -1233 270 -1220 b 98 -891 270 -1075 206 -957 b 40 -871 76 -877 58 -871 b -10 -886 24 -871 8 -875 b -20 -889 -14 -889 -16 -889 l -24 -889 l -24 -749 l -24 -610 l -20 -610 b 0 -628 -9 -610 -2 -617 b 27 -692 4 -644 14 -671 b 138 -825 53 -741 88 -782 b 257 -973 190 -870 228 -917 b 262 -981 259 -977 262 -981 l 262 -981 b 269 -946 264 -979 268 -957 b 270 -903 270 -931 270 -917 b 98 -588 270 -774 206 -655 b 40 -569 76 -574 58 -569 b -10 -584 24 -569 8 -574 b -20 -587 -14 -587 -16 -587 l -24 -587 l -24 -448 l -24 -308 l -20 -308 b 0 -326 -9 -308 -2 -315 b 27 -390 4 -341 14 -369 b 138 -523 53 -438 88 -480 b 257 -670 190 -567 228 -614 b 262 -678 259 -674 262 -678 b 262 -678 262 -678 262 -678 b 269 -644 264 -677 268 -656 b 270 -601 270 -628 270 -614 b 98 -285 270 -471 206 -352 b 40 -266 76 -273 58 -266 b -10 -281 24 -266 8 -272 b -20 -284 -14 -284 -16 -284 l -24 -284 l -24 -145 "},vaa:{x_min:-1.359375,x_max:752.703125,ha:768,o:"m 490 985 b 504 986 495 986 500 986 b 604 907 551 986 593 954 b 607 884 607 900 607 892 b 581 813 607 857 597 831 l 578 810 l 583 811 b 710 932 638 827 687 873 b 714 943 711 936 713 942 b 730 952 720 949 725 952 b 752 931 741 952 752 943 b 200 -946 752 927 204 -941 b 182 -957 197 -953 190 -957 b 163 -945 174 -957 166 -953 b 161 -939 161 -942 161 -942 b 217 -743 161 -931 170 -904 b 272 -555 247 -639 272 -555 b 272 -555 272 -555 272 -555 b 264 -560 272 -555 268 -557 b 140 -603 227 -589 182 -603 b 36 -567 102 -603 65 -592 b -1 -487 12 -548 -1 -517 b 17 -427 -1 -466 5 -445 b 103 -380 38 -395 70 -380 b 191 -433 137 -380 172 -398 b 205 -484 201 -448 205 -466 b 178 -553 205 -509 196 -535 l 175 -557 l 182 -555 b 307 -435 236 -539 284 -494 b 372 -213 308 -430 372 -215 b 372 -213 372 -213 372 -213 b 364 -219 372 -213 368 -216 b 240 -262 328 -247 283 -262 b 137 -226 202 -262 166 -249 b 99 -145 112 -206 99 -176 b 118 -84 99 -124 106 -104 b 204 -38 138 -54 171 -38 b 292 -91 238 -38 273 -56 b 306 -141 302 -106 306 -124 b 279 -212 306 -167 296 -194 l 276 -215 l 281 -213 b 408 -93 336 -198 385 -151 b 473 129 409 -88 473 127 b 473 129 473 129 473 129 b 465 122 473 129 469 126 b 341 80 428 94 383 80 b 236 115 303 80 266 91 b 200 195 213 136 200 165 b 217 256 200 217 206 238 b 304 303 239 287 272 303 b 393 249 338 303 374 285 b 406 199 402 234 406 217 b 379 129 406 173 397 148 l 377 126 l 382 127 b 509 248 436 142 485 190 b 574 470 510 254 574 469 b 574 470 574 470 574 470 b 566 464 574 470 570 467 b 442 421 529 435 484 421 b 337 458 404 421 367 433 b 300 538 314 477 300 508 b 318 598 300 559 306 580 b 404 645 340 630 372 645 b 494 592 439 645 475 627 b 507 541 502 577 507 559 b 480 471 507 516 498 489 l 477 467 l 483 470 b 608 589 537 485 586 531 b 675 811 611 595 675 810 b 675 811 675 811 675 811 b 666 806 675 811 671 809 b 543 763 628 777 585 763 b 438 799 504 763 468 775 b 401 878 412 820 401 849 b 490 985 401 928 434 977 "},vab:{x_min:0,x_max:272.21875,ha:278,o:"m 243 631 b 250 632 246 632 249 632 b 270 620 259 632 268 628 l 272 616 l 272 201 l 272 -212 l 270 -216 b 251 -229 268 -224 259 -229 b 227 -215 243 -229 240 -229 l 151 -142 b 32 -16 81 -80 53 -49 b 0 84 9 18 0 52 b 111 199 0 149 42 199 b 137 197 119 199 127 198 b 228 151 168 191 197 177 l 231 148 l 231 383 b 232 620 231 616 231 616 b 243 631 234 624 238 630 m 168 131 b 152 133 163 133 157 133 b 107 102 130 133 111 120 b 106 86 107 97 106 91 b 111 41 106 73 108 56 b 227 -152 125 -13 171 -90 l 231 -156 l 231 -37 l 231 80 l 225 87 b 168 131 210 111 190 126 "},vad:{x_min:0,x_max:873.828125,ha:892,o:"m 0 0 l 0 703 l 81 703 l 164 703 l 164 0 l 164 -705 l 81 -705 l 0 -705 l 0 0 m 225 0 l 225 703 l 246 703 l 268 703 l 268 366 l 268 30 l 274 36 b 314 79 284 44 302 63 b 413 302 357 137 392 213 b 432 327 419 324 421 327 b 449 306 443 327 447 322 b 611 115 457 195 529 115 b 651 122 624 115 638 117 b 728 316 705 140 724 188 b 729 388 728 342 729 366 b 671 635 729 533 711 602 b 581 662 649 652 616 662 b 477 637 545 662 510 653 l 475 635 l 477 634 b 503 627 488 632 495 631 b 545 556 532 612 545 584 b 491 480 545 524 526 491 b 465 474 481 476 473 474 b 379 563 417 474 379 516 b 389 602 379 576 382 588 b 541 691 409 641 479 681 b 582 694 555 692 568 694 b 865 462 714 694 834 598 b 873 392 871 440 873 416 b 865 317 873 367 871 341 b 639 84 839 194 748 101 b 612 83 630 83 620 83 b 511 116 577 83 543 94 b 504 120 509 119 506 120 b 504 120 504 120 504 120 b 469 59 504 120 488 93 l 432 -1 l 469 -61 b 504 -122 488 -94 504 -122 b 504 -122 504 -122 504 -122 b 511 -117 506 -122 509 -120 b 612 -84 543 -95 577 -84 b 665 -91 630 -84 647 -87 b 869 -338 771 -122 850 -216 b 873 -392 872 -356 873 -374 b 798 -595 873 -469 847 -539 b 581 -695 741 -662 660 -695 b 406 -626 517 -695 454 -671 b 381 -563 389 -607 381 -585 b 465 -477 381 -519 413 -477 b 545 -559 514 -477 545 -519 b 503 -628 545 -587 532 -613 b 477 -635 495 -632 488 -634 l 475 -637 l 477 -638 b 581 -663 510 -655 545 -663 b 671 -637 616 -663 649 -653 b 729 -391 711 -603 729 -534 b 728 -317 729 -367 728 -344 b 623 -117 722 -173 698 -124 b 611 -116 619 -116 615 -116 b 449 -308 528 -116 457 -198 b 432 -328 447 -323 443 -328 b 413 -303 421 -328 419 -326 b 314 -80 392 -215 357 -138 b 274 -37 302 -65 284 -45 l 268 -31 l 268 -367 l 268 -705 l 246 -705 l 225 -705 l 225 0 "},vb1:{x_min:78.9375,x_max:485.921875,ha:417,o:"m 362 378 b 378 380 367 380 372 380 b 472 348 415 380 453 367 b 485 315 481 338 485 327 b 462 273 485 298 477 281 b 439 267 454 269 446 267 b 398 290 424 267 409 274 b 344 319 385 309 364 319 b 281 269 315 319 289 301 b 279 262 280 266 279 262 b 276 256 279 260 277 258 b 274 249 276 254 274 251 b 238 127 273 248 257 192 b 201 4 217 61 201 5 b 166 -1 198 -1 200 -1 b 153 -1 163 -1 157 -1 b 141 -1 148 -1 144 -1 b 104 4 106 -1 107 -1 b 104 6 104 5 104 5 b 142 144 104 13 110 34 b 182 278 164 219 181 276 b 183 288 182 281 182 285 b 185 302 185 292 185 298 b 164 330 185 317 176 328 b 159 330 163 330 161 330 b 102 302 140 330 119 320 b 91 294 95 295 93 294 b 88 294 91 294 89 294 b 78 303 83 294 78 298 b 81 312 78 306 78 309 b 200 373 106 347 160 373 b 215 371 205 373 209 371 b 266 335 235 367 254 353 b 269 331 268 333 269 331 b 269 331 269 331 269 331 b 273 335 269 331 270 334 b 362 378 298 359 330 376 "},vb3:{x_min:0,x_max:227.3125,ha:232,o:"m 91 213 b 100 215 93 215 96 215 b 227 58 167 215 224 144 b 227 52 227 56 227 54 b 61 -201 227 -43 164 -138 b 29 -216 44 -212 36 -216 b 23 -210 27 -216 24 -213 b 21 -205 21 -208 21 -206 b 34 -192 21 -201 25 -197 b 122 -55 89 -161 122 -106 b 104 6 122 -33 117 -12 l 103 9 l 96 9 b 4 79 57 9 17 38 b 0 112 1 90 0 101 b 91 213 0 163 36 209 "},vb4:{x_min:-597.53125,x_max:596.171875,ha:608,o:"m -533 324 b -525 327 -530 326 -528 327 b -504 305 -514 327 -504 317 b -504 305 -504 305 -504 305 b -513 284 -504 299 -504 299 b -556 112 -541 226 -556 167 b -545 33 -556 84 -552 58 b -524 -20 -541 15 -532 -9 l -522 -23 l -491 15 l -413 111 b -355 174 -367 169 -363 174 b -351 174 -353 174 -352 174 b -254 86 -343 174 -348 179 b -168 -1 -208 37 -168 -1 b -100 84 -168 -1 -137 37 b -23 173 -28 173 -29 172 b -19 174 -21 174 -20 174 b -8 173 -14 174 -10 173 b 80 86 -5 172 13 151 b 166 -1 127 37 166 -1 b 235 84 166 -1 197 37 b 311 173 306 173 304 172 b 317 174 313 174 314 174 b 326 173 319 174 323 173 b 490 11 329 172 366 134 l 502 -1 l 530 34 b 568 76 560 72 563 74 b 575 77 570 77 573 77 b 596 56 586 77 596 68 b 594 48 596 54 596 51 b 417 -172 592 41 424 -166 b 405 -176 415 -174 409 -176 b 396 -174 401 -176 398 -176 b 307 -87 393 -173 372 -152 b 221 -1 259 -38 221 -1 b 152 -86 221 -1 190 -38 b 76 -176 81 -174 83 -173 b 70 -176 74 -176 73 -176 b 61 -174 66 -176 62 -174 b -27 -87 58 -173 38 -152 b -114 -1 -74 -38 -112 -1 b -182 -86 -114 -1 -145 -38 b -258 -176 -253 -174 -253 -173 b -264 -176 -259 -176 -262 -176 b -274 -174 -268 -176 -272 -174 b -438 -11 -277 -173 -348 -102 l -449 0 l -479 -37 b -524 -80 -513 -80 -514 -80 l -524 -80 b -553 -52 -534 -80 -540 -74 b -597 109 -583 -8 -597 48 b -560 280 -597 165 -585 224 b -533 324 -548 310 -540 322 "},vb6:{x_min:0,x_max:556.6875,ha:568,o:"m 289 545 b 298 546 292 545 295 546 b 318 533 306 546 315 541 b 319 428 319 530 319 528 l 319 327 l 334 327 b 526 223 412 326 485 285 b 543 172 537 206 543 190 b 447 76 543 122 503 76 b 445 76 446 76 446 76 b 359 165 394 77 359 119 b 368 205 359 179 362 192 b 441 251 382 233 412 251 b 455 249 446 251 451 251 b 460 248 458 249 460 248 b 460 248 460 248 460 248 b 454 254 460 249 458 251 b 334 295 419 280 378 294 l 319 295 l 319 4 l 319 -287 l 321 -285 b 328 -285 322 -285 325 -285 b 524 -99 424 -277 507 -198 b 541 -79 526 -84 530 -79 b 556 -97 551 -79 556 -84 b 548 -133 556 -105 553 -117 b 334 -317 521 -233 434 -306 b 322 -319 329 -317 323 -317 l 319 -319 l 319 -424 b 319 -471 319 -444 319 -459 b 313 -541 319 -544 318 -535 b 298 -548 308 -545 303 -548 b 279 -534 289 -548 281 -542 b 277 -424 277 -531 277 -530 l 277 -317 l 273 -317 b 13 -95 153 -305 51 -217 b 0 2 4 -62 0 -29 b 182 295 0 126 66 238 b 274 324 210 309 249 320 l 277 324 l 277 427 b 279 533 277 528 277 530 b 289 545 281 538 285 542 m 277 2 b 277 291 277 161 277 291 b 268 288 277 291 273 290 b 144 1 179 265 144 184 b 276 -284 144 -199 175 -267 l 277 -285 l 277 2 "},vb7:{x_min:-176.9375,x_max:251.8125,ha:257,o:"m -8 631 b -1 632 -6 632 -4 632 b 19 620 8 632 16 628 b 20 503 20 616 20 614 b 20 391 20 442 20 391 b 84 424 20 391 49 406 l 147 456 l 152 456 b 153 456 153 456 153 456 b 175 435 166 456 175 446 b 172 427 175 433 174 430 b 92 380 170 420 172 421 l 20 342 l 20 245 l 20 148 l 21 151 b 137 199 59 183 99 199 b 182 191 152 199 167 197 b 251 84 227 176 251 134 b 228 0 251 58 243 29 b 100 -142 206 -40 178 -72 l 23 -215 b 0 -229 9 -229 6 -229 b -20 -216 -9 -229 -17 -224 b -21 54 -21 -212 -21 -212 b -21 322 -21 201 -21 322 b -85 290 -21 322 -50 308 l -148 256 l -153 256 b -155 256 -155 256 -155 256 b -176 277 -167 256 -176 266 b -174 285 -176 280 -175 283 b -93 333 -171 294 -174 292 l -21 370 l -21 494 b -20 620 -21 616 -21 616 b -8 631 -17 624 -13 630 m 110 131 b 96 133 106 133 100 133 b 89 133 93 133 91 133 b 24 87 63 129 40 113 l 20 80 l 20 -37 l 20 -156 l 23 -152 b 144 81 96 -72 144 20 l 144 83 b 110 131 144 113 134 126 "},vb9:{x_min:-122.5,x_max:121.140625,ha:124,o:"m -16 145 b 0 147 -10 147 -5 147 b 121 -1 66 147 121 77 b 114 -49 121 -16 118 -33 b -1 -148 95 -112 47 -148 b -85 -106 -31 -148 -61 -134 b -122 -1 -110 -76 -122 -38 b -16 145 -122 68 -81 134 m 12 111 b 0 113 8 113 4 113 b -68 22 -29 113 -61 73 b -70 0 -69 15 -70 6 b -13 -113 -70 -49 -47 -98 b -1 -115 -9 -115 -5 -115 b 63 -40 24 -115 53 -83 b 68 -1 66 -27 68 -15 b 12 111 68 48 46 97 "},vba:{x_min:-118.421875,x_max:597.53125,ha:381,o:"m 460 574 b 464 574 461 574 462 574 b 488 574 470 574 481 574 b 500 573 491 574 498 574 b 594 503 543 570 588 538 b 597 488 596 498 597 494 b 528 417 597 449 564 417 b 502 423 519 417 510 419 b 465 481 477 434 465 458 b 488 528 465 499 472 516 b 490 530 490 530 490 530 b 490 530 490 530 490 530 b 468 517 488 530 475 523 b 349 340 419 485 377 420 b 347 330 348 334 347 330 b 383 328 347 328 363 328 b 428 326 423 328 424 328 b 442 302 438 320 442 312 b 430 281 442 294 438 285 b 385 276 424 277 426 276 l 377 276 l 332 276 l 330 269 b 178 -117 303 126 250 -9 b 1 -249 129 -194 69 -237 b -20 -251 -6 -251 -13 -251 b -114 -187 -65 -251 -100 -227 b -118 -156 -117 -177 -118 -166 b -51 -84 -118 -116 -91 -84 b -31 -87 -46 -84 -39 -86 b 16 -152 0 -95 16 -124 b -12 -205 16 -173 8 -194 b -16 -208 -14 -206 -16 -208 b -14 -208 -16 -208 -14 -208 b -9 -206 -14 -208 -12 -208 b 74 -124 23 -197 54 -166 b 172 224 98 -79 125 22 b 185 276 178 252 183 274 b 185 276 185 276 185 276 b 141 276 185 276 181 276 b 91 280 96 276 96 276 b 77 302 83 285 77 294 b 91 326 77 312 83 320 b 148 328 95 328 96 328 l 198 330 l 202 341 b 460 574 249 473 351 566 "},vbf:{x_min:-53.078125,x_max:513.140625,ha:485,o:"m 185 383 b 196 384 187 383 191 384 b 277 334 230 384 259 365 b 288 301 281 324 288 306 b 288 297 288 298 288 297 b 294 302 289 297 291 299 b 394 370 323 338 367 367 b 404 371 398 370 401 371 b 510 272 453 371 498 328 b 513 237 513 262 513 251 b 507 172 513 217 511 192 b 326 -34 487 59 412 -26 b 314 -36 322 -36 318 -36 b 274 -24 298 -36 283 -31 l 265 -16 b 224 44 246 -1 232 20 b 223 49 224 47 223 49 b 223 49 223 49 223 49 b 149 -197 221 48 149 -194 b 149 -198 149 -197 149 -198 b 170 -210 149 -202 155 -205 b 187 -215 174 -210 175 -212 b 204 -231 201 -219 204 -222 b 197 -245 204 -240 202 -242 l 194 -248 l 76 -248 l -42 -248 l -46 -245 b -53 -231 -51 -242 -53 -240 b -35 -215 -53 -222 -49 -217 b -13 -210 -21 -212 -20 -212 b -6 -208 -10 -209 -8 -208 b 0 -206 -6 -208 -2 -206 b 25 -188 13 -201 21 -195 b 163 280 28 -183 163 276 b 166 291 163 283 164 287 b 167 302 167 295 167 299 b 155 324 167 315 161 324 b 155 324 155 324 155 324 b 65 230 125 322 85 280 b 53 215 61 217 58 215 b 51 215 53 215 51 215 b 42 224 46 215 42 217 b 57 263 42 231 47 244 b 140 360 77 305 104 337 b 152 370 144 365 149 369 b 185 383 157 376 172 381 m 374 306 b 366 308 371 308 368 308 b 300 273 348 308 321 294 b 284 254 288 262 287 259 b 280 242 283 249 281 245 b 257 169 279 240 270 213 l 236 98 l 236 93 b 251 48 238 77 243 61 b 279 27 258 37 272 27 b 281 27 279 27 280 27 b 291 31 281 27 287 30 b 396 170 334 52 378 109 b 406 247 402 197 406 224 b 401 277 406 259 405 270 b 374 306 397 290 383 303 "},vc3:{x_min:-10.890625,x_max:299.4375,ha:294,o:"m 136 460 b 142 462 137 462 140 462 b 166 449 152 462 161 456 b 171 428 168 446 168 445 b 288 131 194 322 238 209 b 298 115 295 120 296 117 b 299 106 298 112 299 109 b 273 81 299 91 287 81 b 255 86 268 81 261 83 b 155 116 225 104 183 116 l 152 116 l 149 108 b 141 83 148 102 144 91 b 134 48 137 69 134 58 b 149 9 134 34 140 24 b 153 -1 152 5 153 1 b 149 -9 153 -5 152 -6 b 144 -11 148 -11 147 -11 b 122 2 138 -11 133 -6 b 95 61 104 20 95 38 b 107 108 95 74 99 90 b 108 113 107 111 108 112 b 107 113 108 113 108 113 b 102 113 106 113 104 113 b 31 86 76 108 53 98 b 14 80 24 81 20 80 b -10 106 0 80 -10 91 b 0 131 -10 115 -9 116 b 115 430 49 209 91 317 b 136 460 119 451 123 456 "},vd0:{x_min:-10.890625,x_max:299.4375,ha:294,o:"m 44 174 b 51 174 47 174 49 174 b 68 173 55 174 61 174 l 287 112 l 551 40 b 615 20 617 22 609 23 b 626 0 622 16 626 8 b 615 -22 626 -9 622 -18 b 613 -23 613 -23 613 -23 b 613 -23 613 -23 613 -23 b 287 -113 613 -24 597 -29 l 68 -174 b 53 -176 61 -176 57 -176 b 39 -172 47 -176 43 -174 b 27 -151 31 -167 27 -159 b 39 -129 27 -141 31 -133 b 230 -74 43 -124 20 -131 l 370 -36 l 468 -9 b 498 0 484 -4 498 -1 b 468 8 498 0 484 2 l 370 34 l 230 73 b 40 126 28 129 43 124 b 27 149 31 131 27 140 b 44 174 27 161 34 170 m 205 110 l 205 300 b 205 330 245 330 245 300 l 245 300 l 245 -300 b 245 -330 205 -330 205 -300 l 205 -300 l 205 110 l 345 90 m 345 90 l 345 330 b 345 360 385 360 385 330 l 385 330 l 385 -270 b 385 -300 345 -300 345 -270 l 345 -270 l 345 90 "},vd1:{x_min:-20,x_max:320,ha:257,o:"m -8 200 b -8 210 8 200 16 200 l 20 148 -199 l 23 -615 b 0 -629 9 -629 6 -629 l -21 -612 l -21 -201 l -21 216 l -20 200 m 16 200 l 310 0 l 240 0 l 16 140 l 16 -120 l 240 0 l 310 0 l 16 -200 "},vd2:{x_min:0,x_max:430.75,ha:386,o:"m 0 200 l 0 -200 l 430 -200 l 430 200 l 0 200 "},vd3:{x_min:0,x_max:430.75,ha:386,o:"m 0 200 l 0 -200 l 430 -200 l 430 200 l 0 200 l 50 150 l 380 150 l 380 -150 l 50 -150 l 50 150 "},vd4:{x_min:0,x_max:430.75,ha:360,o:"m 0 150 l 0 -150 l 430 -150 l 430 150 l 0 150 "},vd5:{x_min:0,x_max:430.75,ha:360,o:"m 0 150 l 0 -150 l 430 -150 l 430 150 l 0 150 l 50 100 l 380 100 l 380 -100 l 50 -100 l 50 100"},vd6:{x_min:0,x_max:430.75,ha:360,o:"m -146 537 b -138 538 -143 538 -141 538 b -118 525 -129 538 -121 533 b -117 390 -117 522 -117 521 b -115 259 -117 268 -117 259 b -115 259 -115 259 -115 259 b -59 272 -104 263 -62 272 b -39 259 -50 272 -42 267 b -37 209 -38 257 -37 233 b -39 159 -37 185 -38 162 b -85 138 -43 149 -44 149 l -117 131 l -117 21 b -115 -88 -117 -80 -117 -88 b -115 -88 -115 -88 -115 -88 b -59 -75 -104 -84 -62 -75 b -44 -81 -52 -75 -48 -77 b -38 -124 -38 -87 -38 -85 b -38 -138 -38 -124 -38 -138 b -38 -152 -38 -138 -38 -152 b -44 -195 -38 -191 -38 -190 b -85 -209 -48 -200 -48 -200 l -117 -217 l -117 -349 b -118 -486 -117 -481 -117 -482 b -138 -499 -121 -494 -129 -499 b -153 -493 -143 -499 -149 -497 b -159 -415 -158 -487 -159 -496 b -159 -355 -159 -398 -159 -379 b -159 -227 -159 -284 -159 -227 b -205 -238 -159 -227 -180 -232 b -250 -249 -230 -244 -250 -249 b -251 -386 -251 -249 -251 -311 b -252 -525 -251 -521 -251 -522 b -272 -538 -255 -534 -264 -538 b -287 -532 -277 -538 -283 -536 b -293 -452 -292 -527 -293 -536 b -293 -391 -293 -436 -293 -415 b -294 -260 -293 -269 -293 -260 b -294 -260 -294 -260 -294 -260 b -348 -272 -306 -264 -345 -272 b -368 -259 -357 -272 -365 -267 b -369 -209 -369 -257 -369 -233 b -368 -159 -369 -185 -369 -162 b -323 -139 -364 -149 -362 -148 l -293 -131 l -293 -22 b -294 87 -293 80 -293 87 b -294 87 -294 87 -294 87 b -348 75 -306 84 -345 75 b -368 88 -357 75 -365 80 b -369 138 -369 91 -369 114 b -368 188 -369 162 -369 186 b -323 209 -364 198 -362 199 l -293 216 l -293 349 b -292 486 -293 481 -293 482 b -272 499 -288 494 -280 499 b -257 493 -266 499 -261 497 b -251 414 -251 487 -251 496 b -251 354 -251 398 -251 378 b -251 226 -251 284 -251 226 b -205 238 -250 226 -230 231 b -159 249 -180 244 -159 249 b -159 385 -159 249 -159 310 b -157 525 -159 521 -159 522 b -146 537 -156 530 -151 535 z m -159 11 b -159 120 -159 98 -159 120 l -159 120 b -175 116 -160 120 -167 119 b -221 105 -184 114 -204 109 l -251 98 l -251 -12 b -251 -121 -251 -72 -251 -121 b -205 -110 -250 -121 -230 -116 b -159 -99 -180 -104 -159 -99 b -159 11 -159 -99 -159 -49 z m 89 517 b 97 519 92 518 94 519 b 117 505 106 519 114 513 b 119 376 119 502 119 501 l 119 249 l 145 258 b 176 267 169 266 172 267 b 177 267 176 267 177 267 b 196 255 186 267 192 263 l 197 252 l 197 205 b 197 181 197 195 197 187 b 193 149 197 153 197 153 b 152 131 190 144 187 143 l 119 120 l 119 10 b 119 -100 119 -62 119 -100 b 145 -91 120 -100 131 -96 b 173 -82 159 -86 171 -82 b 176 -81 174 -81 175 -81 b 196 -94 185 -81 193 -87 b 198 -151 197 -97 198 -125 b 197 -194 198 -172 197 -192 b 153 -218 193 -203 192 -204 l 119 -230 l 119 -367 l 118 -504 l 117 -507 b 97 -519 113 -514 105 -519 b 82 -512 92 -519 87 -517 b 76 -434 77 -507 76 -516 b 76 -374 76 -418 76 -398 b 76 -245 76 -303 76 -245 b 52 -254 76 -245 65 -249 b 19 -263 34 -260 25 -263 b 6 -257 13 -263 10 -261 b 0 -214 0 -251 0 -253 b 0 -200 0 -210 0 -205 b 0 -188 0 -196 0 -192 b 6 -143 0 -147 0 -149 b 46 -126 10 -139 10 -139 l 76 -115 l 76 -5 b 76 106 76 56 76 106 b 51 98 76 106 64 102 b 18 89 34 92 25 89 b 6 95 13 89 10 91 b 0 139 0 101 0 99 b 0 153 0 143 0 148 b 0 179 0 163 0 172 b 44 225 0 215 3 211 l 76 236 l 76 369 b 78 505 76 501 76 502 b 89 517 80 510 85 515 z "},vd7:{x_min:0,x_max:430.75,ha:360,o:"m 283 633 b 291 634 286 634 289 634 b 311 621 300 634 308 629 b 313 505 313 618 313 617 b 313 393 313 443 313 393 b 378 425 313 393 343 407 l 443 458 l 448 458 b 449 458 449 458 449 458 b 471 437 462 458 471 448 b 469 429 471 434 470 432 b 387 382 466 421 469 423 l 313 344 l 313 247 l 313 150 l 315 152 b 433 201 353 184 394 201 b 479 193 448 201 464 198 b 549 86 524 177 549 135 b 526 1 549 59 541 29 b 395 -143 504 -39 475 -71 b 316 -214 351 -182 341 -191 b 292 -229 302 -228 300 -229 b 272 -216 283 -229 275 -224 b 271 55 271 -212 271 -212 b 270 323 271 203 270 323 b 205 291 270 323 241 308 l 140 258 l 135 258 b 134 258 135 258 134 258 b 112 279 121 258 112 267 b 114 287 112 281 113 284 b 196 334 117 295 114 293 l 271 371 l 271 495 b 272 621 271 617 271 618 b 283 633 274 626 279 631 z m 404 133 b 391 134 400 134 395 134 b 384 134 388 134 386 134 b 318 88 358 130 335 114 l 313 81 l 313 -37 l 313 -156 l 316 -152 b 439 83 391 -71 439 22 l 439 84 b 404 133 439 115 430 128 z m -8 633 l -8 633 b 0 634 -6 634 -3 634 b 20 621 8 634 17 629 b 21 384 21 618 21 617 l 21 150 l 24 152 b 141 201 62 184 102 201 b 187 193 157 201 172 198 b 257 86 232 177 257 135 b 234 1 257 59 250 29 b 103 -143 212 -39 183 -71 b 24 -214 60 -182 49 -191 b 0 -229 10 -228 8 -229 b -20 -216 -9 -229 -17 -224 l -21 -212 l -21 203 l -21 618 l -20 621 b -8 633 -18 626 -13 631 z m 113 133 l 113 133 b 99 134 109 134 103 134 b 93 134 97 134 94 134 b 26 88 66 130 43 114 l 21 81 l 21 -37 l 21 -156 l 25 -152 b 148 83 99 -71 148 22 l 148 84 b 113 133 148 115 138 128 z "},rwl:{x_min:0,x_max:737.71875,ha:753,o:"m 9 13 b 208 15 10 15 51 15 b 368 15 251 15 304 15 l 726 15 l 729 12 b 737 -1 735 9 737 4 b 729 -15 737 -6 735 -11 l 726 -16 l 660 -16 l 592 -16 l 592 -95 l 592 -174 l 368 -174 l 144 -174 l 144 -95 l 144 -16 l 77 -16 l 9 -16 l 6 -15 b 0 -1 1 -11 0 -6 b 9 13 0 5 2 11 "},rhl:{x_min:0,x_max:737.71875,ha:753,o:"m 144 94 l 144 173 l 368 173 l 592 173 l 592 94 l 592 15 l 660 15 l 726 15 l 729 12 b 737 -1 735 9 737 4 b 729 -15 737 -6 735 -11 l 726 -16 l 368 -16 l 9 -16 l 6 -15 b 0 -1 1 -11 0 -6 b 6 12 0 4 1 9 l 9 15 l 77 15 l 144 15 l 144 94 "}},cssFontWeight:"normal",ascender:1903,underlinePosition:-125,cssFontStyle:"normal",boundingBox:{yMin:-2065.375,xMin:-695.53125,yMax:1901.578125,xMax:1159.671875},resolution:1e3,descender:-2066,familyName:"VexFlow-18",lineHeight:4093,underlineThickness:50};function
vendor: 544 bytes, line 1
1f(ut,t,a,b,w,R){let k,z,J,tt=0;function rt(){return t+ut[tt++]*b}function at(){return a+ut[tt++]*w}for(;tt<ut.length;)switch(k=ut[tt++],k){case"m":case"l":R[k](rt(),at());break;case"q":z=rt(),J=at(),R.q(rt(),at(),z,J);break;case"b":z=rt(),J=at(),R.b(rt(),at(),rt(),at(),z,J)}}class m extends o{static loadMetrics(t,a,b){const w=t.glyphs[a];if(!w)throw new l.RERR("BadGlyph",`Glyph ${a} does not exist in font.`);const R=w.x_min,k=w.x_max,z=w.ha;let J;if(w.o)return b?w.cached_outline?J=w.cached_outline:(J=w.o.split(" "),w.cached_outline=J):(w.
1cached_outline&&delete w.cached_outline,J=w.o.split(" ")),{x_min:R,x_max:k,ha:z,outline:J};throw new l.RERR("BadGlyph",`Glyph ${a} has no outline defined.`)}static renderGlyph(t,a,b,w,R,k){const z=72*w/(100*e.resolution),J=m.loadMetrics(e,R,!k);m.renderOutline(t,J.outline,z,a,b)}static renderOutline(t,a,b,w,R){t.beginPath(),t.moveTo(w,R),f(a,w,R,b,-b,{m:t.moveTo.bind(t),l:t.lineTo.bind(t),q:t.quadraticCurveTo.bind(t),b:t.bezierCurveTo.bind(t)}),t.fill()}static getOutlineBoundingBox(t,a,b,w){const R=new n;return f(t,b,w,a,-a,{m:R.addPoint.bind(R),l:R.addPoint.bind(R),q:R.addQuadraticCurve.bind(R),b:R.addBezierCurve.bind(R)}),new h(R.x1,R.y1,R.width(),R.height())}constructor(t,a,b){super(),this.setAttribute("type","Glyph"),this.code=t,this.point=a,this.options={cache:!0,font:e},this.metrics=null,this.x_shift=0,this.y_shift=0,this.originShift={x:0,y:0},b?this.setOptions(b):this.reset()}setOptions(t){l.Merge(this.options,t),this.reset()}setPoint(t){return this.point=t,this}setStave(t){return this.stave=t,this}setXShift(t){return this.x_shift=t,this}setYShift(t){return this.y_shift=t,this}reset(){this.scale=72*this.point/(100*this.options.font.resolution),this.metrics=m.loadMetrics(this.options.font,this.co
vendor: 37,119 bytes, line 1
1de,this.options.cache),this.bbox=m.getOutlineBoundingBox(this.metrics.outline,this.scale,0,0)}getMetrics(){if(!this.metrics)throw new l.RuntimeError("BadGlyph",`Glyph ${this.code} is not initialized.`);return{x_min:this.metrics.x_min*this.scale,x_max:this.metrics.x_max*this.scale,width:this.bbox.getW(),height:this.bbox.getH()}}setOriginX(t){const{bbox:a}=this,b=(t-Math.abs(a.getX()/a.getW()))*a.getW();this.originShift.x=-b}setOriginY(t){const{bbox:a}=this,b=(t-Math.abs(a.getY()/a.getH()))*a.getH();this.originShift.y=-b}setOrigin(t,a){this.setOriginX(t),this.setOriginY(a)}render(t,a,b){if(!this.metrics)throw new l.RuntimeError("BadGlyph",`Glyph ${this.code} is not initialized.`);const w=this.metrics.outline,R=this.scale;this.setRendered(),this.applyStyle(t),m.renderOutline(t,w,R,a+this.originShift.x,b+this.originShift.y),this.restoreStyle(t)}renderToStave(t){if(this.checkContext(),!this.metrics)throw new l.RuntimeError("BadGlyph",`Glyph ${this.code} is not initialized.`);if(!this.stave)throw new l.RuntimeError("GlyphError","No valid stave");const a=this.metrics.outline,b=this.scale;this.setRendered(),this.applyStyle(),m.renderOutline(this.context,a,b,t+this.x_shift,this.stave.getYForGlyphs()+this.y_shift),this.restoreStyle()}}const p={STEM_WIDTH:1.5,STEM_HEIGHT:35,STAVE_LINE_THICKNESS:1,RESOLUTION:16384,DEFAULT_NOTATION_FONT_SCALE:39,DEFAULT_TABLATURE_FONT_SCALE:39,SLASH_NOTEHEAD_WIDTH:15,TEXT_HEIGHT_OFFSET_HACK:1,IsKerned:!0,clefProperties:ut=>{if(!ut)throw new l.RERR("BadArgument","Invalid clef: "+ut);const t=p.clefProperties.values[ut];if(!t)throw new l.RERR("BadArgument","Invalid clef: "+ut);return t}};p.clefProperties.values={treble:{line_shift:0},bass:{line_shift:6},tenor:{line_shift:4},alto:{line_shift:3},soprano:{line_shift:1},percussion:{line_shift:0},"mezzo-soprano":{line_shift:2},"baritone-c":{line_shift:5},"baritone-f":{line_shift:5},subbass:{line_shift:7},french:{line_shift:-1}},p.keyProperties=(ut,t,a)=>{void 0===t&&(t="treble");const b={octave_shift:0};"object"==typeof a&&l.Merge(b,a);const w=ut.split("/");if(w.length<2)throw new l.RERR("BadArguments",`Key must have note + octave and an optional glyph: ${ut}`);const R=w[0].toUpperCase(),k=p.keyProperties.note_values[R];if(!k)throw new l.RERR("BadArguments","Invalid key name: "+R);k.octave&&(w[1]=k.octave);let z=parseInt(w[1],10);z-=b.octave_shift;let J=(7*z-28+k.index)/2;J+=p.clefProperties(t).line_shift;let tt=0;J<=0&&2*J%2==0&&(tt=1),J>=6&&2*J%2==0&&(tt=-1);const rt=void 0!==k.int_val?12*z+k.int_val:null,at=k.code,ht=k.shift_right;let lt={};if(w.length>2&&w[2]){const ft=w[2].toUpperCase();lt=p.keyProperties.customNoteHeads[ft]||{}}return{key:R,octave:z,line:J,int_value:rt,accidental:k.accidental,code:at,stroke:tt,shift_right:ht,displaced:!1,...lt}},p.keyProperties.note_values={C:{index:0,int_val:0,accidental:null},CN:{index:0,int_val:0,accidental:"n"},"C#":{index:0,int_val:1,accidental:"#"},"C##":{index:0,int_val:2,accidental:"##"},CB:{index:0,int_val:-1,accidental:"b"},CBB:{index:0,int_val:-2,accidental:"bb"},D:{index:1,int_val:2,accidental:null},DN:{index:1,int_val:2,accidental:"n"},"D#":{index:1,int_val:3,accidental:"#"},"D##":{index:1,int_val:4,accidental:"##"},DB:{index:1,int_val:1,accidental:"b"},DBB:{index:1,int_val:0,accidental:"bb"},E:{index:2,int_val:4,accidental:null},EN:{index:2,int_val:4,accidental:"n"},"E#":{index:2,int_val:5,accidental:"#"},"E##":{index:2,int_val:6,accidental:"##"},EB:{index:2,int_val:3,accidental:"b"},EBB:{index:2,int_val:2,accidental:"bb"},F:{index:3,int_val:5,accidental:null},FN:{index:3,int_val:5,accidental:"n"},"F#":{index:3,int_val:6,accidental:"#"},"F##":{index:3,int_val:7,accidental:"##"},FB:{index:3,int_val:4,accidental:"b"},FBB:{index:3,int_val:3,accidental:"bb"},G:{index:4,int_val:7,accidental:null},GN:{index:4,int_val:7,accidental:"n"},"G#":{index:4,int_val:8,accidental:"#"},"G##":{index:4,int_val:9,accidental:"##"},GB:{index:4,int_val:6,accidental:"b"},GBB:{index:4,int_val:5,accidental:"bb"},A:{index:5,int_val:9,accidental:null},AN:{index:5,int_val:9,accidental:"n"},"A#":{index:5,int_val:10,accidental:"#"},"A##":{index:5,int_val:11,accidental:"##"},AB:{index:5,int_val:8,accidental:"b"},ABB:{index:5,int_val:7,accidental:"bb"},B:{index:6,int_val:11,accidental:null},BN:{index:6,int_val:11,accidental:"n"},"B#":{index:6,int_val:12,accidental:"#"},"B##":{index:6,int_val:13,accidental:"##"},BB:{index:6,int_val:10,accidental:"b"},BBB:{index:6,int_val:9,accidental:"bb"},R:{index:6,int_val:9,rest:!0},X:{index:6,accidental:"",octave:4,code:"v3e",shift_right:5.5}},p.keyProperties.customNoteHeads={D0:{code:"v27",shift_right:0,stem_up_x_offset:0,stem_down_x_offset:0,stem_up_y_offset:-1,stem_down_y_offset:0},D1:{code:"v2d",shift_right:-.5},D2:{code:"v22",shift_right:-.5},D3:{code:"v70",shift_right:-.5},T0:{code:"v49",shift_right:-2,stem_up_y_offset:-4,stem_down_y_offset:4},T1:{code:"v93",shift_right:.5,stem_up_y_offset:-4,stem_down_y_offset:4},T2:{code:"v40",shift_right:.5,stem_up_y_offset:-4,stem_down_y_offset:4},T3:{code:"v7d",shift_right:.5,stem_up_y_offset:-4,stem_down_y_offset:4},TI:{code:"v11",shift_right:0,stem_up_y_shift:5,stem_down_y_shift:5,stem_up_x_offset:6,stem_down_x_offset:4},X0:{code:"v92",stem_up_x_offset:-2,stem_down_x_offset:0,stem_up_y_offset:4,stem_down_y_offset:4},X1:{code:"v95",shift_right:-.5,stem_up_y_offset:4,stem_down_y_offset:4},X2:{code:"v3e",shift_right:.5,stem_up_y_offset:4,stem_down_y_offset:4},X3:{code:"v3b",shift_right:0,stem_up_x_offset:-1.2,stem_down_x_offset:0,stem_up_y_offset:-1,stem_down_y_offset:2},S1:{code:"vd3",shift_right:0},S2:{code:"vd2",shift_right:0},R1:{code:"vd5",shift_right:0},R2:{code:"vd4",shift_right:0},rwl:{code:"rwl",shift_right:0},rhl:{code:"rhl",shift_right:0}},p.integerToNote=ut=>{if(void 0===ut)throw new l.RERR("BadArguments","Undefined integer for integerToNote");if(ut<-2)throw new l.RERR("BadArguments",`integerToNote requires integer > -2: ${ut}`);const t=p.integerToNote.table[ut];if(!t)throw new l.RERR("BadArguments",`Unknown note value for integer: ${ut}`);return t},p.integerToNote.table={0:"C",1:"C#",2:"D",3:"D#",4:"E",5:"F",6:"F#",7:"G",8:"G#",9:"A",10:"A#",11:"B"},p.tabToGlyph=(ut,t=1,a=!1)=>{let b=null,w=0,R=0;if("X"===ut.toString().toUpperCase()){b="v7f",a&&(b="v3e");const k=new m(b,p.DEFAULT_TABLATURE_FONT_SCALE*t).getMetrics();w=k.width,R=-k.height/2}else w=p.textWidth(ut.toString());return{text:ut,code:b,getWidth:()=>w*t,shift_y:R}},p.textWidth=ut=>7*ut.toString().length,p.articulationCodes=ut=>p.articulationCodes.articulations[ut],p.articulationCodes.articulations={"a.":{code:"v23",between_lines:!0},av:{code:"v28",between_lines:!0},"a>":{code:"v42",between_lines:!0},"a-":{code:"v25",between_lines:!0},"a^":{code:"va",between_lines:!1},"a+":{code:"v8b",between_lines:!1},ao:{code:"v94",between_lines:!1},ah:{code:"vb9",between_lines:!1},"a@a":{code:"v43",between_lines:!1},"a@u":{code:"v5b",between_lines:!1},"a|":{code:"v75",between_lines:!1},am:{code:"v97",between_lines:!1},"a,":{code:"vb3",between_lines:!1}},p.accidentalCodes=ut=>p.accidentalCodes.accidentals[ut],p.accidentalCodes.accidentals={"#":{code:"v18",parenRightPaddingAdjustment:-1},"##":{code:"v7f",parenRightPaddingAdjustment:-1},b:{code:"v44",parenRightPaddingAdjustment:-2},bb:{code:"v26",parenRightPaddingAdjustment:-2},n:{code:"v4e",parenRightPaddingAdjustment:-1},"{":{code:"v9c",parenRightPaddingAdjustment:-1},"}":{code:"v84",parenRightPaddingAdjustment:-1},db:{code:"v9e",parenRightPaddingAdjustment:-1},d:{code:"vab",parenRightPaddingAdjustment:0},bbs:{code:"v90",parenRightPaddingAdjustment:-1},"++":{code:"v51",parenRightPaddingAdjustment:-1},"+":{code:"v78",parenRightPaddingAdjustment:-1},"+-":{code:"v8d",parenRightPaddingAdjustment:-1},"++-":{code:"v7a",parenRightPaddingAdjustment:-1},bs:{code:"vb7",parenRightPaddingAdjustment:-1},bss:{code:"v39",parenRightPaddingAdjustment:-1},o:{code:"vd0",parenRightPaddingAdjustment:-1},k:{code:"vd1",parenRightPaddingAdjustment:-1},ashs:{code:"vd6",parenRightPaddingAdjustment:-1},afhf:{code:"vd7",parenRightPaddingAdjustment:-1}},p.accidentalColumnsTable={1:{a:[1],b:[1]},2:{a:[1,2]},3:{a:[1,3,2],b:[1,2,1],second_on_bottom:[1,2,3]},4:{a:[1,3,4,2],b:[1,2,3,1],spaced_out_tetrachord:[1,2,1,2]},5:{a:[1,3,5,4,2],b:[1,2,4,3,1],spaced_out_pentachord:[1,2,3,2,1],very_spaced_out_pentachord:[1,2,1,2,1]},6:{a:[1,3,5,6,4,2],b:[1,2,4,5,3,1],spaced_out_hexachord:[1,3,2,1,3,2],very_spaced_out_hexachord:[1,2,1,2,1,2]}},p.ornamentCodes=ut=>p.ornamentCodes.ornaments[ut],p.ornamentCodes.ornaments={mordent:{code:"v1e"},mordent_inverted:{code:"v45"},turn:{code:"v72"},turn_inverted:{code:"v33"},tr:{code:"v1f"},upprall:{code:"v60"},downprall:{code:"vb4"},prallup:{code:"v6d"},pralldown:{code:"v2c"},upmordent:{code:"v29"},downmordent:{code:"v68"},lineprall:{code:"v20"},prallprall:{code:"v86"}},p.keySignature=ut=>{const t=p.keySignature.keySpecs[ut];if(!t)throw new l.RERR("BadKeySignature",`Bad key signature spec: '${ut}'`);if(!t.acc)return[];const a=p.keySignature.accidentalList(t.acc),b=[];for(let w=0;w<t.num;++w)b.push({type:t.acc,line:a[w]});return b},p.keySignature.keySpecs={C:{acc:null,num:0},Am:{acc:null,num:0},F:{acc:"b",num:1},Dm:{acc:"b",num:1},Bb:{acc:"b",num:2},Gm:{acc:"b",num:2},Eb:{acc:"b",num:3},Cm:{acc:"b",num:3},Ab:{acc:"b",num:4},Fm:{acc:"b",num:4},Db:{acc:"b",num:5},Bbm:{acc:"b",num:5},Gb:{acc:"b",num:6},Ebm:{acc:"b",num:6},Cb:{acc:"b",num:7},Abm:{acc:"b",num:7},G:{acc:"#",num:1},Em:{acc:"#",num:1},D:{acc:"#",num:2},Bm:{acc:"#",num:2},A:{acc:"#",num:3},"F#m":{acc:"#",num:3},E:{acc:"#",num:4},"C#m":{acc:"#",num:4},B:{acc:"#",num:5},"G#m":{acc:"#",num:5},"F#":{acc:"#",num:6},"D#m":{acc:"#",num:6},"C#":{acc:"#",num:7},"A#m":{acc:"#",num:7}},p.unicode={sharp:String.fromCharCode(parseInt("266F",16)),flat:String.fromCharCode(parseInt("266D",16)),natural:String.fromCharCode(parseInt("266E",16)),triangle:String.fromCharCode(parseInt("25B3",16)),"o-with-slash":String.fromCharCode(parseInt("00F8",16)),degrees:String.fromCharCode(parseInt("00B0",16)),circle:String.fromCharCode(parseInt("25CB",16))},p.keySignature.accidentalList=ut=>({b:[2,.5,2.5,1,3,1.5,3.5],"#":[0,1.5,-.5,1,2.5,.5,2]}[ut]),p.parseNoteDurationString=ut=>{if("string"!=typeof ut)return null;const t=/(\d*\/?\d+|[a-z])(d*)([nrhms]|$)/.exec(ut);if(!t)return null;let w=t[3];return 0===w.length&&(w="n"),{duration:t[1],dots:t[2].length,type:w}},p.parseNoteStruct=ut=>{const a=p.parseNoteDurationString(ut.duration);if(!a)return null;let b=p.durationToTicks(a.duration);if(null==b)return null;let w=ut.type;const R=[];if(w){if(!p.getGlyphProps.validTypes[w])return null}else w=a.type||"n",void 0!==ut.keys&&ut.keys.forEach((J,tt)=>{const rt=J.split("/");rt&&3===rt.length&&(R[tt]=rt[2])});const k=ut.dots?ut.dots:a.dots;if("number"!=typeof k)return null;let z=b;for(let J=0;J<k;J++){if(z<=1)return null;z/=2,b+=z}return{duration:a.duration,type:w,customTypes:R,dots:k,ticks:b}},p.sanitizeDuration=ut=>{const t=p.durationAliases[ut];if(void 0!==t&&(ut=t),void 0===p.durationToTicks.durations[ut])throw new l.RERR("BadArguments",`The provided duration is not valid: ${ut}`);return ut},p.durationToFraction=ut=>(new s).parse(p.sanitizeDuration(ut)),p.durationToNumber=ut=>p.durationToFraction(ut).value(),p.durationToTicks=ut=>{ut=p.sanitizeDuration(ut);const t=p.durationToTicks.durations[ut];return void 0===t?null:t},p.durationToTicks.durations={"1/2":2*p.RESOLUTION,1:p.RESOLUTION/1,2:p.RESOLUTION/2,4:p.RESOLUTION/4,8:p.RESOLUTION/8,16:p.RESOLUTION/16,32:p.RESOLUTION/32,64:p.RESOLUTION/64,128:p.RESOLUTION/128,256:p.RESOLUTION/256},p.durationAliases={w:"1",h:"2",q:"4",b:"256"},p.getGlyphProps=(ut,t)=>{ut=p.sanitizeDuration(ut);const a=p.getGlyphProps.duration_codes[ut];if(void 0===a)return null;t||(t="n");let b=a.type[t];if(void 0===b){const w=p.keyProperties.customNoteHeads[t.toUpperCase()];if(void 0===w)return null;b={code_head:w.code,...w}}return{...a.common,...b}},p.getGlyphProps.validTypes={n:{name:"note"},r:{name:"rest"},h:{name:"harmonic"},m:{name:"muted"},s:{name:"slash"}},p.getGlyphProps.duration_codes={"1/2":{common:{getWidth(ut=p.DEFAULT_NOTATION_FONT_SCALE){return new m(this.code_head||"v53",ut).getMetrics().width},stem:!1,stem_offset:0,flag:!1,stem_up_extension:-p.STEM_HEIGHT,stem_down_extension:-p.STEM_HEIGHT,tabnote_stem_up_extension:-p.STEM_HEIGHT,tabnote_stem_down_extension:-p.STEM_HEIGHT,dot_shiftY:0,line_above:0,line_below:0},type:{n:{code_head:"v53"},h:{code_head:"v59"},m:{code_head:"vf",stem_offset:0},r:{code_head:"v31",rest:!0,position:"B/5",dot_shiftY:.5},s:{getWidth:()=>p.SLASH_NOTEHEAD_WIDTH,position:"B/4"}}},1:{common:{getWidth(ut=p.DEFAULT_NOTATION_FONT_SCALE){return new m(this.code_head||"v1d",ut).getMetrics().width},stem:!1,stem_offset:0,flag:!1,stem_up_extension:-p.STEM_HEIGHT,stem_down_extension:-p.STEM_HEIGHT,tabnote_stem_up_extension:-p.STEM_HEIGHT,tabnote_stem_down_extension:-p.STEM_HEIGHT,dot_shiftY:0,line_above:0,line_below:0},type:{n:{code_head:"v1d"},h:{code_head:"v46"},m:{code_head:"v92",stem_offset:-3},r:{code_head:"v5c",rest:!0,position:"D/5",dot_shiftY:.5},s:{getWidth:()=>p.SLASH_NOTEHEAD_WIDTH,position:"B/4"}}},2:{common:{getWidth(ut=p.DEFAULT_NOTATION_FONT_SCALE){return new m(this.code_head||"v81",ut).getMetrics().width},stem:!0,stem_offset:0,flag:!1,stem_up_extension:0,stem_down_extension:0,tabnote_stem_up_extension:0,tabnote_stem_down_extension:0,dot_shiftY:0,line_above:0,line_below:0},type:{n:{code_head:"v81"},h:{code_head:"v2d"},m:{code_head:"v95",stem_offset:-3},r:{code_head:"vc",stem:!1,rest:!0,position:"B/4",dot_shiftY:-.5},s:{getWidth:()=>p.SLASH_NOTEHEAD_WIDTH,position:"B/4"}}},4:{common:{getWidth(ut=p.DEFAULT_NOTATION_FONT_SCALE){return new m(this.code_head||"vb",ut).getMetrics().width},stem:!0,stem_offset:0,flag:!1,stem_up_extension:0,stem_down_extension:0,tabnote_stem_up_extension:0,tabnote_stem_down_extension:0,dot_shiftY:0,line_above:0,line_below:0},type:{n:{code_head:"vb"},h:{code_head:"v22"},m:{code_head:"v3e",stem_offset:-3},r:{code_head:"v7c",stem:!1,rest:!0,position:"B/4",dot_shiftY:-.5,line_above:1.5,line_below:1.5},s:{getWidth:()=>p.SLASH_NOTEHEAD_WIDTH,position:"B/4"}}},8:{common:{getWidth(ut=p.DEFAULT_NOTATION_FONT_SCALE){return new m(this.code_head||"vb",ut).getMetrics().width},stem:!0,stem_offset:0,flag:!0,beam_count:1,code_flag_upstem:"v54",code_flag_downstem:"v9a",stem_up_extension:0,stem_down_extension:0,tabnote_stem_up_extension:0,tabnote_stem_down_extension:0,dot_shiftY:0,line_above:0,line_below:0},type:{n:{code_head:"vb"},h:{code_head:"v22"},m:{code_head:"v3e"},r:{code_head:"va5",stem:!1,flag:!1,rest:!0,position:"B/4",dot_shiftY:-.5,line_above:1,line_below:1},s:{getWidth:()=>p.SLASH_NOTEHEAD_WIDTH,position:"B/4"}}},16:{common:{beam_count:2,getWidth(ut=p.DEFAULT_NOTATION_FONT_SCALE){return new m(this.code_head||"vb",ut).getMetrics().width},stem:!0,stem_offset:0,flag:!0,code_flag_upstem:"v3f",code_flag_downstem:"v8f",stem_up_extension:0,stem_down_extension:0,tabnote_stem_up_extension:0,tabnote_stem_down_extension:0,dot_shiftY:0,line_above:0,line_below:0},type:{n:{code_head:"vb"},h:{code_head:"v22"},m:{code_head:"v3e"},r:{code_head:"v3c",stem:!1,flag:!1,rest:!0,position:"B/4",dot_shiftY:-.5,line_above:1,line_below:2},s:{getWidth:()=>p.SLASH_NOTEHEAD_WIDTH,position:"B/4"}}},32:{common:{beam_count:3,getWidth(ut=p.DEFAULT_NOTATION_FONT_SCALE){return new m(this.code_head||"vb",ut).getMetrics().width},stem:!0,stem_offset:0,flag:!0,code_flag_upstem:"v47",code_flag_downstem:"v2a",stem_up_extension:9,stem_down_extension:9,tabnote_stem_up_extension:8,tabnote_stem_down_extension:5,dot_shiftY:0,line_above:0,line_below:0},type:{n:{code_head:"vb"},h:{code_head:"v22"},m:{code_head:"v3e"},r:{code_head:"v55",stem:!1,flag:!1,rest:!0,position:"B/4",dot_shiftY:-1.5,line_above:2,line_below:2},s:{getWidth:()=>p.SLASH_NOTEHEAD_WIDTH,position:"B/4"}}},64:{common:{beam_count:4,getWidth(ut=p.DEFAULT_NOTATION_FONT_SCALE){return new m(this.code_head||"vb",ut).getMetrics().width},stem:!0,stem_offset:0,flag:!0,code_flag_upstem:"va9",code_flag_downstem:"v58",stem_up_extension:13,stem_down_extension:13,tabnote_stem_up_extension:12,tabnote_stem_down_extension:9,dot_shiftY:0,line_above:0,line_below:0},type:{n:{code_head:"vb"},h:{code_head:"v22"},m:{code_head:"v3e"},r:{code_head:"v38",stem:!1,flag:!1,rest:!0,position:"B/4",dot_shiftY:-1.5,line_above:2,line_below:3},s:{getWidth:()=>p.SLASH_NOTEHEAD_WIDTH,position:"B/4"}}},128:{common:{beam_count:5,getWidth(ut=p.DEFAULT_NOTATION_FONT_SCALE){return new m(this.code_head||"vb",ut).getMetrics().width},stem:!0,stem_offset:0,flag:!0,code_flag_upstem:"v9b",code_flag_downstem:"v30",stem_up_extension:22,stem_down_extension:22,tabnote_stem_up_extension:21,tabnote_stem_down_extension:18,dot_shiftY:0,line_above:0,line_below:0},type:{n:{code_head:"vb"},h:{code_head:"v22"},m:{code_head:"v3e"},r:{code_head:"vaa",stem:!1,flag:!1,rest:!0,position:"B/4",dot_shiftY:1.5,line_above:3,line_below:3},s:{getWidth:()=>p.SLASH_NOTEHEAD_WIDTH,position:"B/4"}}}},p.smufl={},p.smufl.to_code_points={bracketTop:"v1b",bracketBottom:"v10",barlineTick:"v6f",segno:"v8c",coda:"v4d",gClef:"v83",cClef:"vad",fClef:"v79",unpitchedPercussionClef1:"v59","6stringTabClef":"v2f",timeSig0:"v0",timeSig1:"v1",timeSig2:"v2",timeSig3:"v3",timeSig4:"v4",timeSig5:"v5",timeSig6:"v6",timeSig7:"v7",timeSig8:"v8",timeSig9:"v9",timeSigCommon:"v41",timeSigCutCommon:"vb6",noteheadDoubleWhole:"v53",noteheadWhole:"v1d",noteheadHalf:"v81",noteheadBlack:"vb",noteheadXWhole:"v92",noteheadXHalf:"v95",noteheadXBlack:"v3e",noteheadCircleX:"v3b",noteheadTriangleUpWhole:"v49",noteheadTriangleUpHalf:"v93",noteheadTriangleUpBlack:"v40",noteheadDiamondWhole:"v46",noteheadDiamondHalf:"v2d",noteheadDiamondBlack:"v22",augmentationDot:"v23",tremolo1:"v74",flag8thUp:"v54",flag8thDown:"v9a",flag16thUp:"v3f",flag16thDown:"v8f",flag32ndUp:"v47",flag32ndDown:"v2a",flag64thUp:"va9",flag64thDown:"v58",flag128thUp:"v9b",flag128thDown:"v30",accidentalFlat:"v44",accidentalNatural:"v4e",accidentalSharp:"v18",accidentalDoubleSharp:"v7f",accidentalDoubleFlat:"v26",accidentalParensLeft:"v9c",accidentalParensRight:"v84",accidentalQuarterToneFlatStein:"vab",accidentalThreeQuarterTonesFlatZimmermann:"v9e",accidentalQuarterToneSharpStein:"v78",accidentalThreeQuarterTonesSharpStein:"v51",accidentalBuyukMucennebFlat:"v39",accidentalBakiyeFlat:"vb7",accidentalKomaSharp:"v51",accidentalKucukMucennebSharp:"v8d",accidentalKoron:"vd1",accidentalSori:"vd0",articAccentAbove:"v42",articAccentBelow:"v42",articTenutoAbove:"v25",articTenutoBelow:"v25",articStaccatoAbove:"v23",articStaccatoBelow:"v23",articStaccatissimoAbove:"v28",articMarcatoAbove:"va",fermataAbove:"v43",fermataBelow:"v5b",breathMarkComma:"v6c",breathMarkUpbow:"v8a",caesura:"v34",caesuraCurved:"v4b",restMaxima:"v59",restDoubleWhole:"v31",restWhole:"v5c",restHalf:"vc",restQuarter:"v7c",rest8th:"va5",rest16th:"v3c",rest32nd:"v55",rest64th:"v38",rest128th:"vaa",dynamicPiano:"vbf",dynamicMezzo:"v62",dynamicForte:"vba",dynamicRinforzando:"vba",dynamicSforzando:"v4a",dynamicZ:"v80",ornamentTrill:"v1f",ornamentTurn:"v72",ornamentTurnSlash:"v33",ornamentMordent:"v45",ornamentMordentInverted:"v1e",ornamentTremblement:"v86",ornamentPrecompAppoggTrill:"v20",ornamentPrecompSlideTrillDAnglebert:"v60",ornamentPrecompSlideTrillBach:"v29",ornamentPrecompTrillSuffixDandrieu:"v6d",ornamentPrecompDoubleCadenceUpperPrefix:"vb4",ornamentPrecompDoubleCadenceUpperPrefixTurn:"v68",ornamentPrecompTrillLowerSuffix:"v2c",stringsDownBow:"v94",stringsUpBow:"v75",stringsHarmonic:"vb9",pluckedSnapPizzicatoAbove:"v94",pluckedLeftHandPizzicato:"v8b",keyboardPedalPed:"v36",keyboardPedalUp:"v5d",pictChokeCymbal:"vb3",wiggleArpeggiatoUp:"va3",arrowheadBlackUp:"vc3",arrowheadBlackDown:"v52"},p.TIME4_4={num_beats:4,beat_value:4,resolution:p.RESOLUTION};class E{static get WIDTH(){return 600}static get HEIGHT(){return 400}static get CANVAS_BROWSER_SIZE_LIMIT(){return 32767}static SanitizeCanvasDims(t,a){return Math.max(t,a)>this.CANVAS_BROWSER_SIZE_LIMIT&&(l.W("Canvas dimensions exceed browser limit. Cropping to "+this.CANVAS_BROWSER_SIZE_LIMIT),t>this.CANVAS_BROWSER_SIZE_LIMIT&&(t=this.CANVAS_BROWSER_SIZE_LIMIT),a>this.CANVAS_BROWSER_SIZE_LIMIT&&(a=this.CANVAS_BROWSER_SIZE_LIMIT)),[t,a]}constructor(t){this.vexFlowCanvasContext=t,this.canvas=t.canvas?t.canvas:{width:E.WIDTH,height:E.HEIGHT}}clear(){this.vexFlowCanvasContext.clearRect(0,0,this.canvas.width,this.canvas.height)}openGroup(){}closeGroup(){}add(){}setFont(t,a,b){return this.vexFlowCanvasContext.font=(b||"")+" "+a+"pt "+t,this}setRawFont(t){return this.vexFlowCanvasContext.font=t,this}setFillStyle(t){return this.vexFlowCanvasContext.fillStyle=t,this}setBackgroundFillStyle(t){return this.background_fillStyle=t,this}setStrokeStyle(t){return this.vexFlowCanvasContext.strokeStyle=t,this}setShadowColor(t){return this.vexFlowCanvasContext.shadowColor=t,this}setShadowBlur(t){return this.vexFlowCanvasContext.shadowBlur=t,this}setLineWidth(t){return this.vexFlowCanvasContext.lineWidth=t,this}setLineCap(t){return this.vexFlowCanvasContext.lineCap=t,this}setLineDash(t){return this.vexFlowCanvasContext.lineDash=t,this}scale(t,a){return this.vexFlowCanvasContext.scale(parseFloat(t),parseFloat(a))}resize(t,a){return[t,a]=this.SanitizeCanvasDims(parseInt(t,10),parseInt(a,10)),this.vexFlowCanvasContext.resize(t,a)}rect(t,a,b,w){return this.vexFlowCanvasContext.rect(t,a,b,w)}fillRect(t,a,b,w){return this.vexFlowCanvasContext.fillRect(t,a,b,w)}clearRect(t,a,b,w){return this.vexFlowCanvasContext.clearRect(t,a,b,w)}beginPath(){return this.vexFlowCanvasContext.beginPath()}moveTo(t,a){return this.vexFlowCanvasContext.moveTo(t,a)}lineTo(t,a){return this.vexFlowCanvasContext.lineTo(t,a)}bezierCurveTo(t,a,b,w,R,k){return this.vexFlowCanvasContext.bezierCurveTo(t,a,b,w,R,k)}quadraticCurveTo(t,a,b,w){return this.vexFlowCanvasContext.quadraticCurveTo(t,a,b,w)}arc(t,a,b,w,R,k){return this.vexFlowCanvasContext.arc(t,a,b,w,R,k)}glow(){return this.vexFlowCanvasContext.glow()}fill(){return this.vexFlowCanvasContext.fill()}stroke(){return this.vexFlowCanvasContext.stroke()}closePath(){return this.vexFlowCanvasContext.closePath()}measureText(t){return this.vexFlowCanvasContext.measureText(t)}fillText(t,a,b){return this.vexFlowCanvasContext.fillText(t,a,b)}save(){return this.vexFlowCanvasContext.save()}restore(){return this.vexFlowCanvasContext.restore()}}class y{constructor(t){this.element=t,this.paper=Raphael(t),this.path="",this.pen={x:0,y:0},this.lineWidth=1,this.state={scale:{x:1,y:1},font_family:"Arial",font_size:8,font_weight:800},this.attributes={"stroke-width":.3,fill:"black",stroke:"black",font:"10pt Arial"},this.background_attributes={"stroke-width":0,fill:"white",stroke:"white",font:"10pt Arial"},this.shadow_attributes={width:0,color:"black"},this.state_stack=[]}openGroup(){}closeGroup(){}add(){}setFont(t,a,b){return this.state.font_family=t,this.state.font_size=a,this.state.font_weight=b,this.attributes.font=(this.state.font_weight||"")+" "+this.state.font_size*this.state.scale.x+"pt "+this.state.font_family,this}setRawFont(t){return this.attributes.font=t,this}setFillStyle(t){return this.attributes.fill=t,this}setBackgroundFillStyle(t){return this.background_attributes.fill=t,this.background_attributes.stroke=t,this}setStrokeStyle(t){return this.attributes.stroke=t,this}setShadowColor(t){return this.shadow_attributes.color=t,this}setShadowBlur(t){return this.shadow_attributes.width=t,this}setLineWidth(t){this.attributes["stroke-width"]=t,this.lineWidth=t}setLineDash(){return this}setLineCap(){return this}scale(t,a){return this.state.scale={x:t,y:a},this.attributes.transform="S"+t+","+a+",0,0",this.attributes.scale=t+","+a+",0,0",this.attributes.font=this.state.font_size*this.state.scale.x+"pt "+this.state.font_family,this.background_attributes.transform="S"+t+","+a+",0,0",this.background_attributes.font=this.state.font_size*this.state.scale.x+"pt "+this.state.font_family,this}clear(){this.paper.clear()}resize(t,a){return this.element.style.width=t,this.paper.setSize(t,a),this}setViewBox(t){this.paper.canvas.setAttribute("viewBox",t)}rect(t,a,b,w){return w<0&&(a+=w,w=-w),this.paper.rect(t,a,b-.5,w-.5).attr(this.attributes).attr("fill","none").attr("stroke-width",this.lineWidth),this}fillRect(t,a,b,w){return w<0&&(a+=w,w=-w),this.paper.rect(t,a,b-.5,w-.5).attr(this.attributes),this}clearRect(t,a,b,w){return w<0&&(a+=w,w=-w),this.paper.rect(t,a,b-.5,w-.5).attr(this.background_attributes),this}beginPath(){return this.path="",this.pen.x=0,this.pen.y=0,this}moveTo(t,a){return this.path+="M"+t+","+a,this.pen.x=t,this.pen.y=a,this}lineTo(t,a){return this.path+="L"+t+","+a,this.pen.x=t,this.pen.y=a,this}bezierCurveTo(t,a,b,w,R,k){return this.path+="C"+t+","+a+","+b+","+w+","+R+","+k,this.pen.x=R,this.pen.y=k,this}quadraticCurveTo(t,a,b,w){return this.path+="Q"+t+","+a+","+b+","+w,this.pen.x=b,this.pen.y=w,this}arc(t,a,b,w,R,k){function z(tt){for(;tt<0;)tt+=2*Math.PI;for(;tt>2*Math.PI;)tt-=2*Math.PI;return tt}if((w=z(w))>(R=z(R))){const tt=w;w=R,R=tt,k=!k}const J=R-w;return J>Math.PI?(this.arcHelper(t,a,b,w,w+J/2,k),this.arcHelper(t,a,b,w+J/2,R,k)):this.arcHelper(t,a,b,w,R,k),this}arcHelper(t,a,b,w,R,k){const z=t+b*Math.cos(w),J=a+b*Math.sin(w),tt=t+b*Math.cos(R),rt=a+b*Math.sin(R);let at=0,ht=0;k?(ht=1,R-w<Math.PI&&(at=1)):R-w>Math.PI&&(at=1),this.path+="M"+z+","+J+",A"+b+","+b+",0,"+at+","+ht+","+tt+","+rt+"M"+this.pen.x+","+this.pen.y}glow(){const t=this.paper.set();if(this.shadow_attributes.width>0){const a=this.shadow_attributes,b=a.width/2;for(let w=1;w<=b;w++)t.push(this.paper.path(this.path).attr({stroke:a.color,"stroke-linejoin":"round","stroke-linecap":"round","stroke-width":+(a.width/b*w).toFixed(3),opacity:+((a.opacity||.3)/b).toFixed(3),transform:this.attributes.transform,scale:this.attributes.scale}))}return t}fill(){const t=this.paper.path(this.path).attr(this.attributes).attr("stroke-width",0);return this.glow(t),this}stroke(){const t=this.lineWidth*(this.state.scale.x+this.state.scale.y)/2,a=this.paper.path(this.path).attr(this.attributes).attr("fill","none").attr("stroke-width",t);return this.glow(a),this}closePath(){return this.path+="Z",this}measureText(t){const a=this.paper.text(0,0,t).attr(this.attributes).attr("fill","none").attr("stroke","none"),b=a.getBBox();return a.remove(),{width:b.width,height:b.height}}fillText(t,a,b){return this.paper.text(a+this.measureText(t).width/2,b-this.state.font_size/(2.25*this.state.scale.y),t).attr(this.attributes),this}save(){return this.state_stack.push({state:{font_family:this.state.font_family},attributes:{font:this.attributes.font,fill:this.attributes.fill,stroke:this.attributes.stroke,"stroke-width":this.attributes["stroke-width"]},shadow_attributes:{width:this.shadow_attributes.width,color:this.shadow_attributes.color}}),this}restore(){const t=this.state_stack.pop();return this.state.font_family=t.state.font_family,this.attributes.font=t.attributes.font,this.attributes.fill=t.attributes.fill,this.attributes.stroke=t.attributes.stroke,this.attributes["stroke-width"]=t.attributes["stroke-width"],this.shadow_attributes.width=t.shadow_attributes.width,this.shadow_attributes.color=t.shadow_attributes.color,this}}const d={path:{x:!0,y:!0,width:!0,height:!0},rect:{},text:{width:!0,height:!0}};{const ut={"font-family":!0,"font-weight":!0,"font-style":!0,"font-size":!0};l.Merge(d.rect,ut),l.Merge(d.path,ut)}class S{constructor(t){this.element=t,this.svgNS="http://www.w3.org/2000/svg";const a=this.create("svg");this.element.appendChild(a),this.svg=a,this.groups=[this.svg],this.parent=this.svg,this.path="",this.pen={x:NaN,y:NaN},this.lineWidth=1,this.state={scale:{x:1,y:1},"font-family":"Arial","font-size":"8pt","font-weight":"normal"},this.attributes={"stroke-width":.3,fill:"black",stroke:"black","stroke-dasharray":"none","font-family":"Arial","font-size":"10pt","font-weight":"normal","font-style":"normal"},this.background_attributes={"stroke-width":0,fill:"white",stroke:"white","stroke-dasharray":"none","font-family":"Arial","font-size":"10pt","font-weight":"normal","font-style":"normal"},this.shadow_attributes={width:0,color:"black"},this.state_stack=[],this.iePolyfill()}create(t){return document.createElementNS(this.svgNS,t)}openGroup(t,a,b){const w=this.create("g");return this.groups.push(w),this.parent.appendChild(w),this.parent=w,t&&w.setAttribute("class",l.Prefix(t)),a&&w.setAttribute("id",l.Prefix(a)),b&&b.pointerBBox&&w.setAttribute("pointer-events","bounding-box"),w}closeGroup(){this.groups.pop(),this.parent=this.groups[this.groups.length-1]}add(t){this.parent.appendChild(t)}iePolyfill(){typeof navigator<"u"&&(this.ie=/MSIE 9/i.test(navigator.userAgent)||/MSIE 10/i.test(navigator.userAgent)||/rv:11\.0/i.test(navigator.userAgent)||/Trident/i.test(navigator.userAgent))}setFont(t,a,b){let w=!1,R=!1,k="normal";"string"==typeof b&&(-1!==b.indexOf("italic")&&(b=b.replace(/italic/g,""),R=!0),-1!==b.indexOf("bold")&&(b=b.replace(/bold/g,""),w=!0),b=b.replace(/ /g,"")),k=R?"italic":k;const z={"font-family":t,"font-size":a+"pt","font-weight":b=void 0===(b=w?"bold":b)||""===b?"normal":b,"font-style":k};return this.fontSize=Number(a),l.Merge(this.attributes,z),l.Merge(this.state,z),this}setRawFont(t){const a=(t=t.trim()).split(" ");return this.attributes["font-family"]=a[1],this.state["font-family"]=a[1],this.attributes["font-size"]=a[0],this.state["font-size"]=a[0],this.fontSize=Number(a[0].match(/\d+/)),this}setFillStyle(t){return this.attributes.fill=t,this}setBackgroundFillStyle(t){return this.background_attributes.fill=t,this.background_attributes.stroke=t,this}setStrokeStyle(t){return this.attributes.stroke=t,this}setShadowColor(t){return this.shadow_attributes.color=t,this}setShadowBlur(t){return this.shadow_attributes.width=t,this}setLineWidth(t){this.attributes["stroke-width"]=t,this.lineWidth=t}setLineDash(t){if("[object Array]"===Object.prototype.toString.call(t))return t=t.join(", "),this.attributes["stroke-dasharray"]=t,this;throw new l.RERR("ArgumentError","lineDash must be an array of integers.")}setLineCap(t){return this.attributes["stroke-linecap"]=t,this}resize(t,a){return this.width=t,this.height=a,this.element.style.width=t,this.applyAttributes(this.svg,{width:t,height:a}),this.scale(this.state.scale.x,this.state.scale.y),this}scale(t,a){return this.state.scale={x:t,y:a},this.setViewBox(0,0,this.width/t,this.height/a),this}setViewBox(...t){if(1===t.length){const[a]=t;this.svg.setAttribute("viewBox",a)}else{const[a,b,w,R]=t;this.svg.setAttribute("viewBox",a+" "+b+" "+w+" "+R)}}applyAttributes(t,a){const b=d[t.nodeName];return Object.keys(a).forEach(w=>{b&&b[w]||t.setAttributeNS(null,w,a[w])}),t}clear(){for(;this.svg.lastChild;)this.svg.removeChild(this.svg.lastChild);this.scale(this.state.scale.x,this.state.scale.y)}rect(t,a,b,w,R){w<0&&(a+=w,w*=-1);const k=this.create("rect");return void 0===R&&(R={fill:"none","stroke-width":this.lineWidth,stroke:this.attributes.stroke}),l.Merge(R,{x:t,y:a,width:b,height:w}),this.applyAttributes(k,R),this.add(k),this}fillRect(t,a,b,w){return w<0&&(a+=w,w*=-1),this.rect(t,a,b,w,this.attributes),this}clearRect(t,a,b,w){return this.rect(t,a,b,w,this.background_attributes),this}beginPath(){return this.path="",this.pen.x=NaN,this.pen.y=NaN,this}moveTo(t,a){return this.path+="M"+t+" "+a,this.pen.x=t,this.pen.y=a,this}lineTo(t,a){return this.path+="L"+t+" "+a,this.pen.x=t,this.pen.y=a,this}bezierCurveTo(t,a,b,w,R,k){return this.path+="C"+t+" "+a+","+b+" "+w+","+R+" "+k,this.pen.x=R,this.pen.y=k,this}quadraticCurveTo(t,a,b,w){return this.path+="Q"+t+" "+a+","+b+" "+w,this.pen.x=b,this.pen.y=w,this}arc(t,a,b,w,R,k){function z(tt){for(;tt<0;)tt+=2*Math.PI;for(;tt>2*Math.PI;)tt-=2*Math.PI;return tt}if((w=z(w))>(R=z(R))){const tt=w;w=R,R=tt,k=!k}const J=R-w;return J>Math.PI?(this.arcHelper(t,a,b,w,w+J/2,k),this.arcHelper(t,a,b,w+J/2,R,k)):this.arcHelper(t,a,b,w,R,k),this}arcHelper(t,a,b,w,R,k){const z=t+b*Math.cos(w),J=a+b*Math.sin(w),tt=t+b*Math.cos(R),rt=a+b*Math.sin(R);let at=0,ht=0;k?(ht=1,R-w<Math.PI&&(at=1)):R-w>Math.PI&&(at=1),this.path+="M"+z+" "+J+" A"+b+" "+b+" 0 "+at+" "+ht+" "+tt+" "+rt,isNaN(this.pen.x)||isNaN(this.pen.y)||(this.peth+="M"+this.pen.x+" "+this.pen.y)}closePath(){return this.path+="Z",this}glow(){if(this.shadow_attributes.width>0){const t=this.shadow_attributes,a=t.width/2;for(let b=1;b<=a;b++){const w={stroke:t.color,"stroke-linejoin":"round","stroke-linecap":"round","stroke-width":+(.4*t.width/a*b).toFixed(3),opacity:+((t.opacity||.3)/a).toFixed(3)},R=this.create("path");w.d=this.path,this.applyAttributes(R,w),this.add(R)}}return this}fill(t){this.glow();const a=this.create("path");let b=t;return void 0===t?(l.Merge(t={},this.attributes),t.stroke="none",b=t):(b=t,l.Merge(b,this.attributes),t.class&&(b.class=t.class),t.id&&(b.id=t.id)),t.d=this.path,this.applyAttributes(a,t),this.add(a),this}stroke(t=void 0){this.glow();const a=this.create("path"),b={};return l.Merge(b,this.attributes),t&&l.Merge(b,t),b.fill="none",b["stroke-width"]=this.lineWidth,b.d=this.path,this.applyAttributes(a,b),this.add(a),this}measureText(t){const a=this.create("text");if("function"!=typeof a.getBBox)return{x:0,y:0,width:0,height:0};a.textContent=t,this.applyAttributes(a,this.attributes),this.svg.appendChild(a);let b=a.getBBox();return this.ie&&""!==t&&"italic"===this.attributes["font-style"]&&(b=this.ieMeasureTextFix(b,t)),this.svg.removeChild(a),b}ieMeasureTextFix(t){const a=1.196*Number(this.fontSize)+1.9598;return{x:t.x,y:t.y,width:t.width-a,height:t.height-1.5}}fillText(t,a,b){if(!t||t.length<=0)return;const w={};l.Merge(w,this.attributes),w.stroke="none",w.x=a,w.y=b;const R=this.create("text");R.textContent=t,this.applyAttributes(R,w),this.add(R)}save(){return this.state_stack.push({state:{"font-family":this.state["font-family"],"font-weight":this.state["font-weight"],"font-style":this.state["font-style"],"font-size":this.state["font-size"],scale:this.state.scale},attributes:{"font-family":this.attributes["font-family"],"font-weight":this.attributes["font-weight"],"font-style":this.attributes["font-style"],"font-size":this.attributes["font-size"],fill:this.attributes.fill,stroke:this.attributes.stroke,"stroke-width":this.attributes["stroke-width"],"stroke-dasharray":this.attributes["stroke-dasharray"]},shadow_attributes:{width:this.shadow_attributes.width,color:this.shadow_attributes.color},lineWidth:this.lineWidth}),this}restore(){const t=this.state_stack.pop();return this.state["font-family"]=t.state["font-family"],this.state["font-weight"]=t.state["font-weight"],this.state["font-style"]=t.state["font-style"],this.state["font-size"]=t.state["font-size"],this.state.scale=t.state.scale,this.attributes["font-family"]=t.attributes["font-family"],this.attributes["font-weight"]=t.attributes["font-weight"],this.attributes["font-style"]=t.attributes["font-style"],this.attributes["font-size"]=t.attributes["font-size"],this.attributes.fill=t.attributes.fill,this.attributes.stroke=t.attributes.stroke,this.attributes["stroke-width"]=t.attributes["stroke-width"],this.attributes["stroke-dasharray"]=t.attributes["stroke-dasharray"],this.shadow_attributes.width=t.shadow_attributes.width,this.shadow_attributes.color=t.shadow_attributes.color,this.lineWidth=t.lineWidth,this}}let M=null;class x{static get Backends(){return{CANVAS:1,RAPHAEL:2,SVG:3,VML:4}}static get LineEndType(){return{NONE:1,UP:2,DOWN:3}}static get USE_CANVAS_PROXY(){return!1}static get lastContext(){return M}static set lastContext(t){M=t}static buildContext(t,a,b,w,R){const k=new x(t,a);b&&w&&k.resize(b,w),R||(R="#FFF");const z=k.getContext();return z.setBackgroundFillStyle(R),x.lastContext=z,z}static getCanvasContext(t,a,b,w){return x.buildContext(t,x.Backends.CANVAS,a,b,w)}static getRaphaelContext(t,a,b,w){return x.buildContext(t,x.Backends.RAPHAEL,a,b,w)}static getSVGContext(t,a,b,w){return x.buildContext(t,x.Backends.SVG,a,b,w)}static bolsterCanvasContext(t){return x.USE_CANVAS_PROXY?new E(t):(t.vexFlowCanvasContext=t,["clear","setFont","setRawFont","setFillStyle","setBackgroundFillStyle","setStrokeStyle","setShadowColor","setShadowBlur","setLineWidth","setLineCap","setLineDash","openGroup","closeGroup","getGroup"].forEach(a=>{t[a]=t[a]||E.prototype[a]}),t)}static drawDashedLine(t,a,b,w,R,k){t.beginPath();const z=w-a,J=R-b,tt=Math.atan2(J,z);let rt=a,at=b;t.moveTo(a,b);let ht=0,lt=!0;for(;!(z<0?rt<=w:rt>=w)||!(J<0?at<=R:at>=R);){const ft=k[ht++%k.length],bt=rt+Math.cos(tt)*ft;rt=z<0?Math.max(w,bt):Math.min(w,bt);const mt=at+Math.sin(tt)*ft;at=J<0?Math.max(R,mt):Math.min(R,mt),lt?t.lineTo(rt,at):t.moveTo(rt,at),lt=!lt}t.closePath(),t.stroke()}constructor(t,a){if(this.elementId=t,!this.elementId)throw new l.RERR("BadArgument","Invalid id for renderer.");if(this.element=document.getElementById(t),this.element||(this.element=t),this.ctx=null,this.paper=null,this.backend=a,this.backend===x.Backends.CANVAS){if(!this.element.getContext)throw new l.RERR("BadElement",`Can't get canvas context from element: ${t}`);this.ctx=x.bolsterCanvasContext(this.element.getContext("2d",{willReadFrequently:!0}))}else if(this.backend===x.Backends.RAPHAEL)this.ctx=new y(this.element);else{if(this.backend!==x.Backends.SVG)throw new l.RERR("InvalidB
1ackend",`No support for backend: ${this.backend}`);this.ctx=new S(this.element)}}resize(t,a){if(this.backend===x.Backends.CANVAS){if(!this.element.getContext)throw new l.RERR("BadElement",`Can't get canvas context from element: ${this.elementId}`);[t,a]=E.SanitizeCanvasDims(t,a);const b=window.devicePixelRatio||1;this.element.width=t*b,this.element.height=a*b,this.element.style.width=t+"px",this.element.style.height=a+"px",this.ctx=x.bolsterCanvasContext(this.element.getContext("2d",{willReadFrequently:!0})),this.ctx.scale(b,b)}else this.ctx.resize(t,a);return this}getContext(){return this.ctx}}class _ extends o{static get CATEGORY(){return"stem"}static get UP(){return 1}static get DOWN(){return-1}static get WIDTH(){return p.STEM_WIDTH}static get HEIGHT(){return p.STEM_HEIGHT}constructor(t={}){super(),this.setAttribute("type","Stem"),this.x_begin=t.x_begin||0,this.x_end=t.x_end||0,this.y_top=t.y_top||0,this.y_bottom=t.y_bottom||0,this.stem_extension=t.stem_extension||0,this.stem_direction=t.stem_direction||0,this.hide=t.hide||!1,this.isStemlet=t.isStemlet||!1,this.stemletHeight=t.stemletHeight||0,this.renderHeightAdjustment=0,this.setOptions(t)}setOptions(t){this.stem_up_y_offset=t.stem_up_y_offset||0,this.stem_down_y_offset=t.stem_down_y_offset||0}setNoteHeadXBounds(t,a){return this.x_begin=t,this.x_end=a,this}setDirection(t){this.stem_direction=t}setExtension(t){this.stem_extension=t}getExtension(){return this.stem_extension}setYBounds(t,a){this.y_top=t,this.y_bottom=a}getCategory(){return _.CATEGORY}getHeight(){return(this.y_bottom-this.y_top)*this.stem_direction+(_.HEIGHT-(this.stem_direction===_.UP?this.stem_up_y_offset:this.stem_down_y_offset)+this.stem_extension)*this.stem_direction}getBoundingBox(){throw new l.RERR("NotImplemented","getBoundingBox() not implemented.")}getExtents(){const t=this.stem_direction===_.UP,a=[this.y_top,this.y_bottom],b=_.HEIGHT+this.stem_extension,w=(t?Math.min:Math.max)(...a),R=(t?Math.max:Math.min)(...a);return{topY:w+b*-this.stem_direction,baseY:R}}setVisibility(t){return this.hide=!t,this}setStemlet(t,a){return this.isStemlet=t,this.stemletHeight=a,this}draw(){if(this.setRendered(),this.hide)return;const t=this.checkContext();let a,b;const w=this.stem_direction;w===_.DOWN?(a=this.x_begin,b=this.y_top+this.stem_down_y_offset):(a=this.x_end,b=this.y_bottom-this.stem_up_y_offset);const R=this.getHeight();!function(...z){_.DEBUG&&l.L("Vex.Flow.Stem",z)}("Rendering stem - ","Top Y: ",this.y_top,"Bottom Y: ",this.y_bottom);const k=this.isStemlet?R-this.stemletHeight*this.stem_direction:0;if(t.save(),this.applyStyle(t),t.beginPath(),t.setLineWidth(_.WIDTH),t.moveTo(a,b-k),t.lineTo(a,b-R-this.renderHeightAdjustment*w),t.svg){const z={class:l.Prefix("stem")};this.id&&(z.id=this.id),t.stroke(z)}else t.stroke();this.restoreStyle(t),t.restore()}}class I extends o{static get LOCATION_TOP(){return 1}static get LOCATION_BOTTOM(){return-1}static get NESTING_OFFSET(){return 15}constructor(t,a){if(super(),this.setAttribute("type","Tuplet"),!t||!t.length)throw new l.RuntimeError("BadArguments","No notes provided for tuplet.");this.options=l.Merge({},a),this.notes=t,this.num_notes="num_notes"in this.options?this.options.num_notes:t.length,this.options.beats_occupied&&this.beatsOccupiedDeprecationWarning(),this.notes_occupied=this.options.notes_occupied||this.options.beats_occupied||2,this.bracketed="bracketed"in this.options?this.options.bracketed:t.some(b=>null===b.beam),this.ratioed="ratioed"in this.options?this.options.ratioed:Math.abs(this.notes_occupied-this.num_notes)>1,this.point=28,this.y_pos=16,this.x_pos=100,this.width=200,this.location=this.options.location||I.LOCATION_TOP,Ot.AlignRestsToNotes(t,!0,!0),this.resolveGlyphs(),this.attach()}attach(){for(let t=0;t<this.notes.length;t++)this.notes[t].setTuplet(this)}detach(){for(let t=0;t<this.notes.length;t++)this.notes[t].resetTuplet(this)}setBracketed(t){return this.bracketed=!!t,this}setRatioed(t){return this.ratioed=!!t,this}setTupletLocation(t){if(t){if(t!==I.LOCATION_TOP&&t!==I.LOCATION_BOTTOM)throw new l.RERR("BadArgument","Invalid tuplet location: "+t)}else t=I.LOCATION_TOP;return this.location=t,this}getNotes(){return this.notes}getNoteCount(){return this.num_notes}beatsOccupiedDeprecationWarning(){const t=["beats_occupied has been deprecated as an ","option for tuplets. Please use notes_occupied ","instead. Calls to getBeatsOccupied and ","setBeatsOccupied should now be routed to ","getNotesOccupied and setNotesOccupied instead"].join("");console&&console.warn?console.warn(t):console&&console.log(t)}getBeatsOccupied(){return this.beatsOccupiedDeprecationWarning(),this.getNotesOccupied()}setBeatsOccupied(t){return this.beatsOccupiedDeprecationWarning(),this.setNotesOccupied(t)}getNotesOccupied(){return this.notes_occupied}setNotesOccupied(t){this.detach(),this.notes_occupied=t,this.resolveGlyphs(),this.attach()}resolveGlyphs(){this.numerator_glyphs=[];let t=this.num_notes;for(;t>=1;)this.numerator_glyphs.unshift(new m("v"+t%10,this.point)),t=parseInt(t/10,10);for(this.denom_glyphs=[],t=this.notes_occupied;t>=1;)this.denom_glyphs.unshift(new m("v"+t%10,this.point)),t=parseInt(t/10,10)}getNestedTupletCount(){const t=this.location,a=this.notes[0];let b=R(a,t),w=R(a,t);function R(k,z){return k.tupletStack.filter(J=>J.location===z).length}
vendor: 4,086 bytes, line 1
1return this.notes.forEach(k=>{const z=R(k,t);b=z>b?z:b,w=z<w?z:w}),b-w}getYPosition(){const t=this.getNestedTupletCount()*I.NESTING_OFFSET*-this.location,a=this.options.y_offset||0,b=this.notes[0];let w;if(this.location===I.LOCATION_TOP){w=b.getStave().getYForLine(0)-15;for(let R=0;R<this.notes.length;++R){const k=this.notes[R].getStemDirection()===_.UP?this.notes[R].getStemExtents().topY-10:this.notes[R].getStemExtents().baseY-20;k<w&&(w=k)}}else{w=b.getStave().getYForLine(4)+20;for(let R=0;R<this.notes.length;++R){const k=this.notes[R].getStemDirection()===_.UP?this.notes[R].getStemExtents().baseY+20:this.notes[R].getStemExtents().topY+10;k>w&&(w=k)}}return w+t+a}draw(){this.checkContext(),this.setRendered();const t=this.notes[0],a=this.notes[this.notes.length-1];this.bracketed?(this.x_pos=t.getTieLeftX()-5,this.width=a.getTieRightX()-this.x_pos+5):(this.x_pos=t.getStemX(),this.width=a.getStemX()-this.x_pos),this.y_pos=this.getYPosition();const b=(z,J)=>z+J.getMetrics().width;let w=this.numerator_glyphs.reduce(b,0);this.ratioed&&(w=this.denom_glyphs.reduce(b,w),w+=.32*this.point);const R=this.x_pos+this.width/2-w/2;if(this.bracketed){const z=this.width/2-w/2-5;z>0&&(this.context.fillRect(this.x_pos,this.y_pos,z,1),this.context.fillRect(this.x_pos+this.width/2+w/2+5,this.y_pos,z,1),this.context.fillRect(this.x_pos,this.y_pos+(this.location===I.LOCATION_BOTTOM),1,10*this.location),this.context.fillRect(this.x_pos+this.width,this.y_pos+(this.location===I.LOCATION_BOTTOM),1,10*this.location))}let k=0;if(!1!==this.RenderTupletNumber&&this.numerator_glyphs.forEach(z=>{z.render(this.context,R+k,this.y_pos+this.point/3-2),k+=z.getMetrics().width}),this.ratioed){const z=R+k+.16*this.point,J=.06*this.point;this.context.beginPath(),this.context.arc(z,this.y_pos-.08*this.point,J,0,2*Math.PI,!0),this.context.closePath(),this.context.fill(),this.context.beginPath(),this.context.arc(z,this.y_pos+.12*this.point,J,0,2*Math.PI,!0),this.context.closePath(),this.context.fill(),k+=.32*this.point,this.denom_glyphs.forEach(tt=>{tt.render(this.context,R+k,this.y_pos+this.point/3-2),k+=tt.getMetrics().width})}}}function T(ut){let t=0;return ut.forEach(a=>{a.keyProps&&a.keyProps.forEach(b=>{t+=b.line-3})}),t>=0?_.DOWN:_.UP}const A="L",v="B";class B extends o{static getDefaultBeamGroups(t){t&&"c"!==t||(t="4/4");const a={"1/2":["1/2"],"2/2":["1/2"],"3/2":["1/2"],"4/2":["1/2"],"1/4":["1/4"],"2/4":["1/4"],"3/4":["1/4"],"4/4":["1/4"],"1/8":["1/8"],"2/8":["2/8"],"3/8":["3/8"],"4/8":["2/8"],"1/16":["1/16"],"2/16":["2/16"],"3/16":["3/16"],"4/16":["2/16"]}[t];if(void 0!==a)return a.map(b=>(new s).parse(b));{const b=parseInt(t.split("/")[0],10),w=parseInt(t.split("/")[1],10);if(b%3==0)return[new s(3,w)];if(w>4)return[new s(2,w)];if(w<=4)return[new s(1,w)]}return[new s(1,4)]}static applyAndGetBeams(t,a,b){return B.generateBeams(t.getTickables(),{groups:b,stem_direction:a})}static generateBeams(t,a){a||(a={}),a.groups&&a.groups.length||(a.groups=[new s(2,8)]);const b=a.groups.map(ht=>{if(!ht.multiply)throw new l.RuntimeError("InvalidBeamGroups","The beam groups must be an array of Vex.Flow.Fractions");return ht.clone().multiply(p.RESOLUTION,1)}),w=t;let R=0,k=[],z=[];function J(){b.length-1>R?R+=1:R=0}(function(){let ht=[];w.forEach(lt=>{if(ht=[],lt.shouldIgnoreTicks())return k.push(z),void(z=ht);z.push(lt);const ft=b[R].clone(),bt=z.reduce((xt,wt)=>wt.getTicks().clone().add(xt),new s(0,1)),mt=p.durationToNumber(lt.duration)<8;mt&<.tuplet&&(ft.numerator*=2),bt.greaterThan(ft)?(mt||ht.push(z.pop()),k.push(z),z=ht,J()):bt.equals(ft)&&(k.push(z),z=ht,J())}),z.length>0&&k.push(z)})(),function(){const ht=[];k.forEach(lt=>{let ft=[];lt.forEach((bt,mt,xt)=>{const wt=0===mt||mt===xt.length-1,Tt=xt[mt-1],Pt=!a.beam_rests&&bt.isRest(),Lt=a.beam_rests&&a.beam_middle_only&&bt.isRest()&&wt;let Ct=!1;if(a.maintain_stem_directions&&Tt&&!bt.isRest()&&!Tt.isRest()){const Gt=Tt.getStemDirection();Ct=bt.getStemDirection()!==Gt}const kt=parseInt(bt.duration,10)<8;Pt||Lt||Ct||kt?(ft.length>0&&ht.push(ft),ft=Ct?[bt]:[]):ft.push(bt)}),ft.length>0&&ht.push(ft)}),k=ht}
1(),k.forEach(ht=>{let lt;if(a.maintain_stem_directions){const ft=function(bt){for(let mt=0;mt<bt.length;mt++){const xt=bt[mt];if(!xt.isRest())return xt}return!1}(ht);lt=ft?ft.getStemDirection():_.UP}else lt=a.stem_direction?a.stem_direction:T(ht);var bt;bt=lt,ht.forEach(mt=>{mt.setStemDirection(bt)})});const tt=k.filter(ht=>{if(ht.length>1){let lt=!0;return ht.forEach(ft=>{ft.getIntrinsicTicks()>=p.durationToTicks("4")&&(lt=!1)}),lt}return!1}),rt=function(){const ht=[];return k.forEach(lt=>{let ft=null;lt.forEach(bt=>{bt.tuplet&&ft!==bt.tuplet&&(ft=bt.tuplet,ht.push(ft))})}),ht}(),at=[];return tt.forEach(ht=>{const lt=new B(ht);a.show_stemlets&&(lt.render_options.show_stemlets=!0),a.secondary_breaks&&(lt.render_options.secondary_break_ticks=p.durationToTicks(a.secondary_breaks)),!0===a.flat_beams&&(lt.render_options.flat_beams=!0,lt.render_options.flat_beam_offset=a.flat_beam_offset),at.push(lt)}),rt.forEach(ht=>{ht.setTupletLocation(ht.notes[0].stem_direction===_.DOWN?I.LOCATION_BOTTOM:I.LOCATION_TOP);let ft=!1;for(let bt=0;bt<ht.notes.length;bt++)if(null===ht.notes[bt].beam){ft=!0;break}ht.setBracketed(ft)}),at}constructor(t,a){if(super(),this.setAttribute("type","Beam"),!t||t==[])throw new l.RuntimeError("BadArguments","No notes provided for beam.");if(1===t.length)throw new l.RuntimeError("BadArguments","Too few notes for beam.");if(this.ticks=t[0].getIntrinsicTicks(),this.ticks>=p.durationToTicks("4"))throw new l.RuntimeError("BadArguments","Beams can only be applied to notes shorter than a quarter note.");let b,w;for(this.stem_direction=_.UP,b=0;b<t.length;++b)if(w=t[b],w.hasStem()){this.stem_direction=w.getStemDirection();break}let R=this.stem_direction;for(a&&"stavenotes"===t[0].getCategory()?R=T(t):a&&"tabnotes"===t[0].getCategory()&&(R=t.reduce((z,J)=>z+J.stem_direction,0)>-1?_.UP:_.DOWN),b=0;b<t.length;++b)w=t[b],a&&(w.setStemDirection(R),this.stem_direction=R),w.setBeam(this);this.postFormatted=!1,this.notes=t,this.beam_count=this.getBeamCount(),this.break_on_indices=[],this.render_options={beam_width:5,max_slope:.25,min_slope:-.25,slope_iterations:20,slope_cost:100,show_stemlets:!1,stemlet_extension:7,partial_beam_length:10,flat_beams:!1,min_flat_beam_offset:15}}getNotes(){return this.notes}getBeamCount(){return this.notes.map(t=>t.getGlyph().beam_count).reduce((t,a)=>a>t?a:t)}breakSecondaryAt(t){return this.break_on_indices=t,this}getSlopeY(t,a,b,w){return b+(t-a)*w}calculateSlope(){const{notes:t,stem_direction:a,render_options:{max_slope:b,min_slope:w,slope_iterations:R,slope_cost:k}}=this,z=t[0],J=((lt,ft)=>{const bt=lt.getStemExtents().topY,mt=lt.getStemX();return(ft.getStemExtents().topY-bt)/(ft.getStemX()-mt)})(z,t[t.length-1]),tt=(b-w)/R;let rt=Number.MAX_VALUE,at=0,ht=0;for(let lt=w;lt<=b;lt+=tt){let ft=0,bt=0;for(let wt=1;wt<t.length;++wt){const Tt=t[wt],Pt=this.getSlopeY(Tt.getStemX(),z.getStemX(),z.getStemExtents().topY,lt)+bt,Lt=Tt.getStemExtents().topY;if(Lt*a<Pt*a){const Ct=Math.abs(Lt-Pt);bt+=Ct*-a,ft+=Ct*wt}else ft+=(Lt-Pt)*a}const xt=k*Math.abs(J/2-lt)+Math.abs(ft);xt<rt&&(rt=xt,at=lt,ht=bt)}this.slope=at,this.y_shift=ht}calculateFlatSlope(){const{notes:t,stem_direction:a,render_options:{beam_width:b,min_flat_beam_offset:w,flat_beam_offset:R}}=this;let k=0,z=0,J=0,tt=0;for(let lt=0;lt<t.length;lt++){const ft=t[lt],bt=ft.getStemExtents().topY;k+=bt,a===_.DOWN&&tt<bt?(tt=bt,z=Math.max(...ft.getYs()),J=ft.getBeamCount()):a===_.UP&&(0===tt||tt>bt)&&(tt=bt,z=Math.min(...ft.getYs()),J=ft.getBeamCount())}let rt=k/t.length;const at=w+J*(1.5*b),ht=z+at*-a;a===_.DOWN&&rt<ht?rt=z+at:a===_.UP&&rt>ht&&(rt=z-at),R+this.render_options.flat_beam_offset_per_beam>0?(a===_.DOWN&&rt>R&&!this.render_options.flat_beams||a===_.UP&&rt<R&&!this.render_options.flat_beams)&&(this.render_options.flat_beam_offset=rt):this.render_options.flat_beam_offset=rt,this.slope=0,this.y_shift=0}getBeamYToDraw(){let t=this.notes[0].getStemExtents().topY;if(this.render_options.flat_beams&&this.render_options.flat_beam_offset+this.render_options.flat_beam_offset_per_beam>0){let a=this.render_options.flat_beam_offset;this.render_options.flat_beam_offset_per_beam&&(a+=this.render_options.flat_beam_offset_per_beam*this.getBeamCount());let b=this.notes[0].note_heads[0].y;const w=this.stem_direction>0?Math.min:Math.max;for(const R of this.notes)for(const k of R.note_heads)b=w(b,k.y);t=b+a*-this.stem_direction}return t}applyStemExtensions(){const{notes:t,slope:a,y_shift:b,stem_direction:w,beam_count:R,render_options:{show_stemlets:k,stemlet_extension:z,beam_width:J}}=this,tt=t[0],rt=this.getBeamYToDraw(),at=tt.getStemX();for(let ht=0;ht<t.length;++ht){const lt=t[ht],ft=lt.getStemX(),{topY:bt}=lt.getStemExtents(),mt=this.getSlopeY(ft,at,rt,a)+b,xt=lt.getStem().getExtension();if(lt.stem.setExtension(xt+(w===_.UP?bt-mt:mt-bt)),lt.stem.renderHeightAdjustment=-_.WIDTH/2,lt.isRest()&&k
vendor: 8,415 bytes, line 1
1){const Tt=(R-1)*J*1.5+J;lt.stem.setVisibility(!0).setStemlet(!0,Tt+z)}}}lookupBeamDirection(t,a,b,w){if("4"===t)return A;const R=""+p.durationToNumber(t)/2,k=a<p.durationToTicks(R),z=w<p.durationToTicks(R),J=b<p.durationToTicks(R);return k&&z&&J?v:k&&!z&&J?A:!k&&z&&J?"R":this.lookupBeamDirection(R,a,b,w)}getBeamLines(t){const a=p.durationToTicks(t),b=[];let w=!1,R=null;const k=this.render_options.partial_beam_length;let z=!1,J=0;for(let rt=0;rt<this.notes.length;++rt){const at=this.notes[rt];J+=at.ticks.value();let ht=!1;parseInt(t,10)>=8&&(ht=-1!==this.break_on_indices.indexOf(rt),this.render_options.secondary_break_ticks&&J>=this.render_options.secondary_break_ticks&&(J=0,ht=!0));const lt=at.getIntrinsicTicks()<a,ft=at.getStemX()-_.WIDTH/2,bt=this.notes[rt-1],mt=this.notes[rt+1],xt=mt&&mt.getIntrinsicTicks()<a,wt=bt&&bt.getIntrinsicTicks()<a,Tt=bt&&mt&<&&!wt&&!xt;if(lt)if(w)R=b[b.length-1],R.end=ft,ht&&(w=!1,mt&&!xt&&null===R.end&&(R.end=R.start-k));else{if(R={start:ft,end:null,start_note:at},w=!0,Tt){const Pt=bt.getIntrinsicTicks(),Lt=mt.getIntrinsicTicks(),Ct=at.getIntrinsicTicks(),kt=this.lookupBeamDirection(t,Pt,Ct,Lt);R.end=[A,v].includes(kt)?R.start-k:R.start+k}else xt?ht&&(R.end=R.start-k,w=!1):R.end=(z||0===rt)&&mt?R.start+k:R.start-k;b.push(R)}else w=!1;z=ht}const tt=b[b.length-1];return tt&&null===tt.end&&(tt.end=tt.start-k),b}drawStems(){this.notes.forEach(t=>{t.getStem()&&(this.context.openGroup("stem",t.getAttribute("id")+"-stem"),t.getStem().setContext(this.context).draw(),this.context.closeGroup())},this)}drawBeamLines(){this.checkContext();const t=["4","8","16","32","64"],a=this.notes[0];let b=this.getBeamYToDraw();const w=a.getStemX(),R=this.render_options.beam_width*this.stem_direction,k={};for(const z of this.notes)k[z.getAttribute("id")]=0;for(let z=0;z<t.length;++z){const tt=this.getBeamLines(t[z]);for(let rt=0;rt<tt.length;++rt){const at=tt[rt],ht=at.start,lt=at.start_note.getAttribute("id"),ft=k[lt];k[lt]++;const bt=this.getSlopeY(ht,w,b,this.slope),mt=at.end,xt=this.getSlopeY(mt,w,b,this.slope);this.context.openGroup("beam",`${lt}-beam${ft}`),this.context.beginPath(),this.context.moveTo(ht,bt),this.context.lineTo(ht,bt+R),this.context.lineTo(mt+_.WIDTH,xt+R),this.context.lineTo(mt+_.WIDTH,xt),this.context.closePath(),this.context.fill(),this.context.closeGroup()}b+=1.5*R}}preFormat(){return this}postFormat(){if(!this.postFormatted){for(const t of this.notes)t.stem&&t.getStemExtension&&t.stem.setExtension(t.getStemExtension());"tabnotes"===this.notes[0].getCategory()||this.render_options.flat_beams?this.calculateFlatSlope():this.calculateSlope(),this.applyStemExtensions(),this.postFormatted=!0}}draw(){this.checkContext(),this.setRendered(),this.unbeamable||(this.postFormatted||this.postFormat(),this.drawStems(),this.applyStyle(),this.drawBeamLines(),this.restoreStyle())}}class D extends o{static get Mode(){return{STRICT:1,SOFT:2,FULL:3}}constructor(t){if(super(),this.setAttribute("type","Voice"),"string"==typeof t){const a=t.match(/(\d+)\/(\d+)/);a&&(t={num_beats:a[1],beat_value:a[2],resolution:p.RESOLUTION})}this.time=l.Merge({num_beats:4,beat_value:4,resolution:p.RESOLUTION},t),this.totalTicks=new s(this.time.num_beats*(this.time.resolution/this.time.beat_value),1),this.resolutionMultiplier=1,this.tickables=[],this.ticksUsed=new s(0,1),this.smallestTickCount=this.totalTicks.clone(),this.largestTickWidth=0,this.stave=null,this.mode=D.Mode.STRICT,this.voiceGroup=null}getTotalTicks(){return this.totalTicks}getTicksUsed(){return this.ticksUsed}getLargestTickWidth(){return this.largestTickWidth}getSmallestTickCount(){return this.smallestTickCount}getTickables(){return this.tickables}getMode(){return this.mode}setMode(t){return this.mode=t,this}getResolutionMultiplier(){return this.resolutionMultiplier}getActualResolution(){return this.resolutionMultiplier*this.time.resolution}setStave(t){return this.stave=t,this.boundingBox=null,this}getBoundingBox(){let t,a,b,w;if(!this.boundingBox){if(!this.stave)throw new l.RERR("NoStave","Can't get bounding box without stave.");for(t=this.stave,a=null,w=0;w<this.tickables.length;++w)this.tickables[w].setStave(t),b=this.tickables[w].getBoundingBox(),b&&(a=a?a.mergeWith(b):b);this.boundingBox=a}return this.boundingBox}getVoiceGroup(){if(!this.voiceGroup)throw new l.RERR("NoVoiceGroup","No voice group for voice.");return this.voiceGroup}setVoiceGroup(t){return this.voiceGroup=t,this}setStrict(t){return this.mode=t?D.Mode.STRICT:D.Mode.SOFT,this}isComplete(){return this.mode!==D.Mode.STRICT&&this.mode!==D.Mode.FULL||this.ticksUsed.equals(this.totalTicks)}addTickable(t){if(!t.shouldIgnoreTicks()){const a=t.getTicks();if(this.ticksUsed.add(a),(this.mode===D.Mode.STRICT||this.mode===D.Mode.FULL)&&this.ticksUsed.greaterThan(this.totalTicks))throw this.ticksUsed.subtract(a),new l.RERR("BadArgument","Too many ticks.");a.lessThan(this.smallestTickCount)&&(this.smallestTickCount=a.clone()),this.resolutionMultiplier=this.ticksUsed.denominator,this.totalTicks.add(0,this.ticksUsed.denominator)}return this.tickables.push(t),t.setVoice(this),this}addTickables(t){for(let a=0;a<t.length;++a)this.addTickable(t[a]);return this}preFormat(){return this.preFormatted||(this.tickables.forEach(t=>{t.getStave()||t.setStave(this.stave)}),this.preFormatted=!0),this}draw(t=this.context,a=this.stave){this.setRendered();let b=null;for(let w=0;w<this.tickables.length;++w){const R=this.tickables[w];if(a&&R.setStave(a),!R.getStave())throw new l.RuntimeError("MissingStave","The voice cannot draw tickables without staves.");if(0===w&&(b=R.getBoundingBox()),w>0&&b){const k=R.getBoundingBox();k&&b.mergeWith(k)}R.setContext(t),R.drawWithStyle()}this.boundingBox=b}}function L(ut,t,a,b,w){if(t!==F.type.BOLD_DOUBLE_LEFT&&t!==F.type.BOLD_DOUBLE_RIGHT)throw new l.RERR("InvalidConnector","A REPEAT_BEGIN or REPEAT_END type must be provided.");let R=3,k=3.5;t===F.type.BOLD_DOUBLE_RIGHT&&(R=-5,k=3),ut.fillRect(a+R,b,1,w-b),ut.fillRect(a-2,b,k,w-b)}class F extends o{static get type(){return{SINGLE_RIGHT:0,SINGLE_LEFT:1,SINGLE:1,DOUBLE:2,BRACE:3,BRACKET:4,BOLD_DOUBLE_LEFT:5,BOLD_DOUBLE_RIGHT:6,THIN_DOUBLE:7,NONE:8}}static get typeString(){return{singleRight:F.type.SINGLE_RIGHT,singleLeft:F.type.SINGLE_LEFT,single:F.type.SINGLE,double:F.type.DOUBLE,brace:F.type.BRACE,bracket:F.type.BRACKET,boldDoubleLeft:F.type.BOLD_DOUBLE_LEFT,boldDoubleRight:F.type.BOLD_DOUBLE_RIGHT,thinDouble:F.type.THIN_DOUBLE,none:F.type.NONE}}constructor(t,a){super(),this.setAttribute("type","StaveConnector"),this.thickness=p.STAVE_LINE_THICKNESS,this.width=3,this.top_stave=t,this.bottom_stave=a,this.type=F.type.DOUBLE,this.font={family:"times",size:16,weight:"normal"},this.x_shift=0,this.texts=[]}setType(t){return(t="string"==typeof t?F.typeString[t]:t)>=F.type.SINGLE_RIGHT&&t<=F.type.NONE&&(this.type=t),this}setText(t,a){return this.texts.push({content:t,options:l.Merge({shift_x:0,shift_y:0},a)}),this}setFont(t){l.Merge(this.font,t)}setXShift(t){if("number"!=typeof t)throw l.RERR("InvalidType","x_shift must be a Number");return this.x_shift=t,this}draw(){const t=this.checkContext();this.setRendered();let a=this.top_stave.getYForLine(0),b=this.bottom_stave.getYForLine(this.bottom_stave.getNumLines()-1)+this.thickness,w=this.width,R=this.top_stave.getX();(this.type===F.type.SINGLE_RIGHT||this.type===F.type.BOLD_DOUBLE_RIGHT||this.type===F.type.THIN_DOUBLE)&&(R=this.top_stave.getX()+this.top_stave.width);let k=b-a;switch(this.type){case F.type.SINGLE:case F.type.SINGLE_LEFT:case F.type.SINGLE_RIGHT:w=1;break;case F.type.DOUBLE:R-=this.width+2;break;case F.type.BRACE:{w=12;const z=this.top_stave.getX()-2+this.x_shift,J=a,tt=z,rt=b,at=z-w,ht=J+k/2,lt=at-.9*w,ft=J+.2*k,bt=z+1.1*w,mt=ht-.135*k,xt=bt,wt=ht+.135*k,Tt=lt,Pt=rt-.2*k,Lt=at-w,Ct=Pt,kt=z+.4*w,Gt=ht+.135*k,zt=kt,ne=ht-.135*k,Zt=Lt,$t=ft;t.beginPath(),t.moveTo(z,J),t.bezierCurveTo(lt,ft,bt,mt,at,ht),t.bezierCurveTo(xt,wt,Tt,Pt,tt,rt),t.bezierCurveTo(Lt,Ct,kt,Gt,at,ht),t.bezierCurveTo(zt,ne,Zt,$t,z,J),t.fill(),t.stroke();break}case F.type.BRACKET:a-=4,b+=4,k=b-a,m.renderGlyph(t,R-5,a-3,40,"v1b",!0),m.renderGlyph(t,R-5,b+3,40,"v10",!0),R-=this.width+2;break;case F.type.BOLD_DOUBLE_LEFT:L(t,this.type,R+this.x_shift,a,b);break;case F.type.BOLD_DOUBLE_RIGHT:L(t,this.type,R,a,b);break;case F.type.THIN_DOUBLE:w=1;break;case F.type.NONE:break;default:throw new l.RERR("InvalidType",`The provided StaveConnector.type (${this.type}
1) is invalid`)}this.type!==F.type.BRACE&&this.type!==F.type.BOLD_DOUBLE_LEFT&&this.type!==F.type.BOLD_DOUBLE_RIGHT&&this.type!==F.type.NONE&&t.fillRect(R,a,w,k),this.type===F.type.THIN_DOUBLE&&t.fillRect(R-3,a,w,k),t.save(),t.lineWidth=2,t.setFont(this.font.family,this.font.size,this.font.weight);for(let z=0;z<this.texts.length;z++){const J=this.texts[z],tt=t.measureText(""+J.content).width,rt=this.top_stave.getX()-tt-24+J.options.shift_x,at=(this.top_stave.getYForLine(0)+this.bottom_stave.getBottomLineY())/2+J.options.shift_y;t.fillText(""+J.content,rt,at+4)}t.restore()}}class V extends o{constructor(){super(),this.setAttribute("type","Tickable"),this.ticks=new s(0,1),this.intrinsicTicks=0,this.tickMultiplier=new s(1,1),this.width=0,this.x_shift=0,this.voice=null,this.tickContext=null,this.modifierContext=null,this.modifiers=[],this.preFormatted=!1,this.postFormatted=!1,this.tuplet=null,this.tupletStack=[],this.align_center=!1,this.center_x_shift=0,this.ignore_ticks=!1,this.formatterMetrics={freedom:{left:0,right:0},duration:"",iterations:0,space:{used:0,mean:0,deviation:0}}}reset(){return this}getTicks(){return this.ticks}shouldIgnoreTicks(){return this.ignore_ticks}getWidth(){return this.width}getFormatterMetrics(){return this.formatterMetrics}setXShift(t){this.x_shift=t}getCenterXShift(){return this.isCenterAligned()?this.center_x_shift:0}isCenterAligned(){return this.align_center}setCenterAlignment(t){return this.align_center=t,this}getVoice(){if(!this.voice)throw new l.RERR("NoVoice","Tickable has no voice.");return this.voice}setVoice(t){this.voice=t}getTuplet(){return this.tuplet}resetTuplet(t){let a,b;if(t){const w=this.tupletStack.indexOf(t);return-1!==w&&(this.tupletStack.splice(w,1),a=t.getNoteCount(),b=t.getNotesOccupied(),this.applyTickMultiplier(a,b)),this}for(;this.tupletStack.length;)a=(t=this.tupletStack.pop()).getNoteCount(),b=t.getNotesOccupied(),this.applyTickMultiplier(a,b);return this}setTuplet(t){if(t){this.tupletStack.push(t);const a=t.getNoteCount(),b=t.getNotesOccupied();this.applyTickMultiplier(b,a)}return this.tuplet=t,this}addToModifierContext(t){this.modifierContext=t,this.preFormatted=!1}addModifier(t){return this.modifiers.push(t),this.preFormatted=!1,this}getModifiers(){return this.modifiers}setTickContext(t){this.tickContext=t,this.preFormatted=!1}preFormat(){this.preFormatted||(this.width=0,this.modifierContext&&(this.modifierContext.preFormat(),this.width+=this.modifierContext.getWidth()))}postFormat(){return this.postFormatted||(this.postFormatted=!0),this}getIntrinsicTicks(){return this.intrinsicTicks}setIntrinsicTicks(t){this.intrinsicTicks=t,this.ticks=this.tickMultiplier.clone().multiply(this.intrinsicTicks)}getTickMultiplier(){return this.tickMultiplier}applyTickMultiplier(t,a){this.tickMultiplier.multiply(t,a),this.ticks=this.tickMultiplier.clone().multiply(this.intrinsicTicks)}setDuration(t){const a=t.numerator*(p.RESOLUTION/t.denominator);this.ticks=this.tickMultiplier.clone().multiply(a),this.intrinsicTicks=this.ticks.value()}}class j extends V{static get CATEGORY(){return"note"}static get STAVEPADDING(){return 12}static plotMetrics(t,a,b){const w=a.getMetrics(),R=a.getAbsoluteX()-w.modLeftPx-w.extraLeftPx,k=a.getAbsoluteX()-w.extraLeftPx,z=a.getAbsoluteX(),J=a.getAbsoluteX()+w.noteWidth,tt=a.getAbsoluteX()+w.noteWidth+w.extraRightPx,rt=a.getAbsoluteX()+w.noteWidth+w.extraRightPx+w.modRightPx,at=rt+a.getFormatterMetrics().freedom.right,ht=rt-R;t.save(),t.setFont("Arial",8,""),t.fillText(Math.round(ht)+"px",R+a.getXShift(),b);const lt=b+7;function ft(mt,xt,wt,Tt=lt){t.beginPath(),t.setStrokeStyle(wt),t.setFillStyle(wt),t.setLineWidth(3),t.moveTo(mt+a.getXShift(),Tt),t.lineTo(xt+a.getXShift(),Tt),t.stroke()}ft(R,k,"red"),ft(k,z,"#999"),ft(z,J,"green"),ft(J,tt,"#999"),ft(tt,rt,"red"),ft(rt,at,"#DD0"),ft(R-a.getXShift(),R,"#BBB"),l.drawDot(t,z+a.getXShift(),lt,"blue");const bt=a.getFormatterMetrics();if(bt.iterations>0){const mt=bt.space.deviation,xt=mt>=0?"+":"";t.setFillStyle("red"),t.fillText(xt+Math.round(mt),z+a.getXShift(),b-10)}t.restore()}constructor(t){if(super(),this.setAttribute("type","Note"),!t)throw new l.RuntimeError("BadArguments","Note must have valid initialization data to i
1dentify duration and type.");const a=p.parseNoteStruct(t);if(!a)throw new l.RuntimeError("BadArguments",`Invalid note initialization object: ${JSON.stringify(t)}`);if(this.duration=a.duration,this.dots=a.dots,this.noteType=a.type,this.customTypes=a.customTypes,t.duration_override?this.setDuration(t.duration_override):this.setIntrinsicTicks(a.ticks),this.modifiers=[],this.glyph=p.getGlyphProps(this.duration,this.noteType),this.customGlyphs=this.customTypes.map(b=>p.getGlyphProps(this.duration,b)),this.positions&&("object"!=typeof this.positions||!this.positions.length))throw new l.RuntimeError("BadArguments","Note keys must be array type.");this.playNote=null,this.tickContext=null,this.modifierContext=null,this.ignore_ticks=!1,this.width=0,this.extraLeftPx=0,this.extraRightPx=0,this.x_shift=0,this.left_modPx=0,this.right_modPx=0,this.voice=null,this.preFormatted=!1,this.ys=[],t.align_center&&this.setCenterAlignment(t.align_center),this.stave=null,this.render_options={annotation_spacing:5,stave_padding:j.STAVEPADDING}}getPlayNote(){return this.playNote}setPlayNote(t){return this.playNote=t,this}isRest(){return!1}addStroke(t,a){return a.setNote(this),a.setIndex(t),this.modifiers.push(a),this.setPreFormatted(!1),this}getStave(){return this.stave}setStave(t){return this.stave=t,this.setYs([t.getYForLine(0)]),this.context=this.stave.context,this}getCategory(){return j.CATEGORY}setContext(t){return this.context=t,this}getExtraLeftPx(){return this.extraLeftPx}getExtraRightPx(){return this.extraRightPx}setExtraLeftPx(t){return this.extraLeftPx=t,this}setExtraRightPx(t){return this.extraRightPx=t,this}shouldIgnoreTicks(){return this.ignore_ticks}getLineNumber(){return 0}getLineForRest(){return 0}getGlyph(){return this.glyph}getGlyphWidth(){return this.glyph.getWidth(this.render_options.glyph_font_scale)}setYs(t){return this.ys=t,this}getYs(){if(0===this.ys.length)throw new l.RERR("NoYValues","No Y-values calculated for this note.");return this.ys}getYForTopText(t){if(!this.stave)throw new l.RERR("NoStave","No stave attached to this note.");return this.stave.getYForTopText(t)}getBoundingBox(){return null}getVoice(){if(!this.voice)throw new l.RERR("NoVoice","Note has no voice.");return this.voice}setVoice(t){return this.voice=t,this.preFormatted=!1,this}getTickContext(){return this.tickContext}setTickContext(t){return this.tickContext=t,this.preFormatted=!1,this}getDuration(){return this.duration}isDotted(){return this.dots>0}hasStem(){return!1}getDots(){return this.dots}getNoteType(){return this.noteType}setBeam(){return this}setModifierContext(t){return this.modifierContext=t,this}addModifier(t,a=0){return t.setNote(this),t.setIndex(a),this.modifiers.push(t),this.setPreFormatted(!1),this}getModifierStartXY(){if(!this.preFormatted)throw new l.RERR("UnformattedNote","Can't call GetModifierStartXY on an unformatted note");return{x:this.getAbsoluteX(),y:this.ys[0]}}getMetrics(){if(!this.preFormatted)throw new l.RERR("UnformattedNote","Can't call getMetrics on an unformatted note.");let t=0,a=0;null!=this.modifierContext&&(t=this.modifierContext.state.left_shift,a=this.modifierContext.state.right_shift);const b=this.getWidth();return{width:b,noteWidth:b-t-a-this.extraLeftPx-this.extraRightPx,left_shift:this.x_shift,modLeftPx:t,modRightPx:a,extraLeftPx:this.extraLeftPx,extraRightPx:this.extraRightPx}}setWidth(t){this.width=t}getWidth(){if(!this.preFormatted)throw new l.RERR("UnformattedNote","Can't call GetWidth on an unformatted note.");return this.width+(this.modifierContext?this.modifierContext.getWidth():0)}setXShift(t){return this.x_shift=t,this}getXShift(){return this.x_shift}getX(){if(!this.tickContext)throw new l.RERR("NoTickContext","Note needs a TickContext assigned for an X-Value");return this.tickContext.getX()+this.x_shift}
vendor: 10,566 bytes, line 1
1getAbsoluteX(){if(!this.tickContext)throw new l.RERR("NoTickContext","Note needs a TickContext assigned for an X-Value");let t=this.tickContext.getX();return this.stave&&(t+=this.stave.getNoteStartX()+this.render_options.stave_padding),this.isCenterAligned()&&(t+=this.getCenterXShift()),t}setPreFormatted(t){if(this.preFormatted=t,this.preFormatted){const a=this.tickContext.getExtraPx();this.left_modPx=Math.max(this.left_modPx,a.left),this.right_modPx=Math.max(this.right_modPx,a.right)}}}class P extends j{static get CATEGORY(){return"notehead"}constructor(t){if(super(t),this.setAttribute("type","NoteHead"),this.index=t.index,this.x_shift=t.x_shift||0,this.x=(t.x||0)+this.x_shift,this.y=t.y||0,this.note_type=t.note_type,this.duration=t.duration,this.displaced=t.displaced||!1,this.stem_direction=t.stem_direction||ot.STEM_UP,this.line=t.line,this.glyph=p.getGlyphProps(this.duration,this.note_type),!this.glyph)throw new l.RuntimeError("BadArguments",`No glyph found for duration '${this.duration}' and type '${this.note_type}'`);this.glyph_code=this.glyph.code_head,this.x_shift_ledger_rest=0,this.y_shift_ledger_rest=0,this.x_shift=t.x_shift||0,this.glyph.rest&&(this.line>5||this.line<0)&&(this.isLedgerLinedRest=!0,"h"===this.duration?(t.custom_glyph_code="rhl",this.x_shift_ledger_rest-=4):"w"===this.duration&&(t.custom_glyph_code="rwl",this.x_shift_ledger_rest-=4,this.y_shift_ledger_rest=-5)),t.custom_glyph_code&&(this.custom_glyph=!0,this.glyph_code=t.custom_glyph_code,this.stem_up_x_offset=t.stem_up_x_offset||0,this.stem_down_x_offset=t.stem_down_x_offset||0,this.stem_up_y_shift=t.stem_up_y_shift||0,this.stem_down_y_shift=t.stem_down_y_shift||0),this.style=t.style,this.slashed=t.slashed,l.Merge(this.render_options,{glyph_font_scale:t.glyph_font_scale||p.DEFAULT_NOTATION_FONT_SCALE,stroke_px:3}),this.setWidth(this.glyph.getWidth(this.render_options.glyph_font_scale))}getCategory(){return P.CATEGORY}getWidth(){return this.width}isDisplaced(){return!0===this.displaced}getGlyph(){return this.glyph}setX(t){return this.x=t,this}getY(){return this.y}setY(t){return this.y=t,this}getLine(){return this.line}setLine(t){return this.line=t,this}getAbsoluteX(){return(this.preFormatted?super.getAbsoluteX():this.x)+(this.displaced?(this.width-_.WIDTH/2)*this.stem_direction:0)}getBoundingBox(){if(!this.preFormatted)throw new l.RERR("UnformattedNote","Can't call getBoundingBox on an unformatted note.");const t=this.stave.getSpacingBetweenLines(),b=this.y-t/2;return new p.BoundingBox(this.getAbsoluteX(),b,this.width,t)}setStave(t){const a=this.getLine();return this.stave=t,this.setY(t.getYForNote(a)),this.context=this.stave.context,this}preFormat(){if(this.preFormatted)return this;const t=this.getWidth()+this.extraLeftPx+this.extraRightPx;return this.setWidth(t),this.setPreFormatted(!0),this}draw(){this.checkContext(),this.setRendered();const t=this.context;let a=this.getAbsoluteX(),b=this.y;this.custom_glyph&&(a+=this.x_shift_ledger_rest,this.stem_direction===_.UP?(a+=this.stem_up_x_offset,b+=this.stem_up_y_shift||0):this.stem_direction===_.DOWN&&(a+=this.stem_down_x_offset,b+=this.stem_down_y_shift||0),b+=this.y_shift_ledger_rest),function(...k){P.DEBUG&&l.L("Vex.Flow.NoteHead",k)}("Drawing note head '",this.note_type,this.duration,"' at",a,b);const w=this.stem_direction,R=this.render_options.glyph_font_scale;if(this.style&&this.applyStyle(t),"s"===this.note_type){const k=this.stave.getSpacingBetweenLines();!function(z,J,tt,rt,at,ht){const lt=p.SLASH_NOTEHEAD_WIDTH;z.save(),z.setLineWidth(p.STEM_WIDTH);let ft=!1;if(p.durationToNumber(J)>2&&(ft=!0),ft||(tt-=p.STEM_WIDTH/2*at),z.beginPath(),z.moveTo(tt,rt+ht),z.lineTo(tt,rt+1),z.lineTo(tt+lt,rt-ht),z.lineTo(tt+lt,rt),z.lineTo(tt,rt+ht),z.closePath(),ft?z.fill():z.stroke(),p.durationToFraction(J).equals(.5)){const bt=[-3,-1,lt+1,lt+3];for(let mt=0;mt<bt.length;mt++)z.beginPath(),z.moveTo(tt+bt[mt],rt-10),z.lineTo(tt+bt[mt],rt+11),z.stroke()}z.restore()}(t,this.duration,a,b,w,k)}else m.renderGlyph(t,a,b,R,this.glyph_code,this.id);this.style&&this.restoreStyle(t)}}class U extends j{constructor(t){super(t),this.setAttribute("type","StemmableNote"),this.stem=null,this.stemExtensionOverride=null,this.beam=null,this.renderFlag=!0}getStem(){return this.stem}setStem(t){return this.stem=t,this}buildStem(){const t=new _;return this.setStem(t),this}buildFlag(){const{glyph:t,beam:a}=this;if(t&&t.flag&&null===a&&this.renderFlag){const w=this.getStemDirection()===_.DOWN?t.code_flag_downstem:t.code_flag_upstem;this.flag=new m(w,this.render_options.glyph_font_scale)}}getTopGlyph(){return this.getStemDirection()===_.DOWN?this.customGlyphs[this.customGlyphs.length-1]:this.customGlyphs[0]}getStemLength(){return _.HEIGHT+this.getStemExtension()}getBeamCount(){const t=this.getGlyph();return t?t.beam_count:0}getStemMinumumLength(){let t=p.durationToFraction(this.duration).value()<=1?0:20;switch(this.duration){case"8":null==this.beam&&(t=35);break;case"16":t=null==this.beam?35:25;break;case"32":t=null==this.beam?45:35;break;case"64":t=null==this.beam?50:40;break;case"128":t=null==this.beam?55:45}return t}getStemDirection(){return this.stem_direction}setStemDirection(t){if(t||(t=_.UP),t!==_.UP&&t!==_.DOWN)throw new l.RERR("BadArgument",`Invalid stem direction: ${t}`);if(this.stem_direction=t,this.stem){this.stem.setDirection(t),this.stem.setExtension(this.getStemExtension());const a=this.getTopGlyph()||this.getGlyph();this.stem.setOptions({stem_up_y_offset:a.stem_up_y_offset,stem_down_y_offset:a.stem_down_y_offset})}return this.reset(),this.flag&&this.renderFlag&&this.buildFlag(),this.beam=null,this.preFormatted&&this.preFormat(),this}getStemX(){const t=this.getAbsoluteX()+this.x_shift,a=this.getAbsoluteX()+this.x_shift+this.getGlyphWidth();return this.stem_direction===_.DOWN?t:a}getCenterGlyphX(){return this.getAbsoluteX()+this.x_shift+this.getGlyphWidth()/2}getStemExtension(){const t=this.getGlyph();return null!=this.stemExtensionOverride?this.stemExtensionOverride:t?1===this.getStemDirection()?t.stem_up_extension:t.stem_down_extension:0}setStemLength(t){return this.stemExtensionOverride=t-_.HEIGHT,this}getStemExtents(){return this.stem.getExtents()}setBeam(t){return this.beam=t,this}getYForTopText(t){const a=this.getStemExtents();return this.hasStem()?Math.min(this.stave.getYForTopText(t),a.topY-this.render_options.annotation_spacing*(t+1)):this.stave.getYForTopText(t)}getYForBottomText(t){const a=this.getStemExtents();return this.hasStem()?Math.max(this.stave.getYForTopText(t),a.baseY+this.render_options.annotation_spacing*t):this.stave.getYForBottomText(t)}hasFlag(){return this.renderFlag&&p.getGlyphProps(this.duration).flag&&!this.beam}postFormat(){return this.beam&&this.beam.postFormat(),this.postFormatted=!0,this}drawStem(t){this.checkContext(),this.setRendered(),this.setStem(new _(t)),this.stem.setContext(this.context).draw()}}class Y extends o{static get CATEGORY(){return"none"}static get Position(){return{LEFT:1,RIGHT:2,ABOVE:3,BELOW:4}}static get PositionString(){return{above:Y.Position.ABOVE,below:Y.Position.BELOW,left:Y.Position.LEFT,right:Y.Position.RIGHT}}constructor(){super(),this.setAttribute("type","Modifier"),this.width=0,this.note=null,this.index=null,this.text_line=0,this.position=Y.Position.LEFT,this.modifier_context=null,this.x_shift=0,this.y_shift=0,this.spacingFromNextModifier=0}getCategory(){return Y.CATEGORY}getWidth(){return this.width}setWidth(t){return this.width=t,this}getNote(){return this.note}setNote(t){return this.note=t,this}getIndex(){return this.index}setIndex(t){return this.index=t,this}getModifierContext(){return this.modifier_context}setModifierContext(t){return this.modifier_context=t,this}getPosition(){return this.position}setPosition(t){return this.position="string"==typeof t?Y.PositionString[t]:t,this}setTextLine(t){return this.text_line=t,this}setYShift(t){return this.y_shift=t,this}setSpacingFromNextModifier(t){this.spacingFromNextModifier=t}getSpacingFromNextModifier(){return this.spacingFromNextModifier}setXShift(t){this.x_shift=0,this.position===Y.Position.LEFT?this.x_shift-=t:this.x_shift+=t}getXShift(){return this.x_shift}draw(){throw this.checkContext(),new l.RERR("MethodNotImplemented","draw() not implemented for this modifier.")}alignSubNotesWithNote(t,a){const b=a.getTickContext(),w=b.getExtraPx(),R=b.getX()-w.left-w.extraLeft+this.getSpacingFromNextModifier();t.forEach(k=>{const z=k.getTickContext();k.setStave(a.stave),z.setXOffset(R)})}}class H extends Y{static get CATEGORY(){return"dots"}static format(t,a){const b=a.right_shift;if(!t||0===t.length)return!1;const w=[],R={};for(let ht=0;ht<t.length;++ht){const lt=t[ht],ft=lt.getNote();let bt,mt;"function"==typeof ft.getKeyProps?(bt=ft.getKeyProps()[lt.getIndex()],mt=bt.displaced?ft.getExtraRightPx():0):(bt={line:.5},mt=0);const xt=ft.getAttribute("id");w.push({line:bt.line,note:ft,note_id:xt,dot:lt}),R[xt]=Math.max(R[xt]||mt,mt)}w.sort((ht,lt)=>lt.line-ht.line);let k=b,z=0,J=null,tt=null,rt=null,at=0;for(let ht=0;ht<w.length;++ht){const{dot:lt,note:ft,note_id:bt,line:mt}=w[ht];mt===J&&ft===tt||(k=R[bt]),ft.isRest()||mt===J||(.5===Math.abs(mt%1)?at=0:(at=.5,null==tt||tt.isRest()||J-mt!=.5?mt+at===rt&&(at=-.5):at=-.5)),ft.isRest()?lt.dot_shiftY+=-at:lt.dot_shiftY=-at,rt=mt+at,lt.setXShift(k),k+=lt.getWidth()+1,z=k>z?k:z,J=mt,tt=ft}return a.right_shift+=z,!0}constructor(){super(),this.setAttribute("type","Dot"),this.note=null,this.index=null,this.position=Y.Position.RIGHT,this.radius=2,this.setWidth(5),this.dot_shiftY=0}getCategory(){return H.CATEGORY}setNote(t){this.note=t,"gracenotes"===this.note.getCategory()&&(this.radius*=.5,this.setWidth(3))}setDotShiftY(t){return this.dot_shiftY=t,this}draw(){if(this.checkContext(),this.setRendered(),!this.note||null===this.index)throw new l.RERR("NoAttachedNote","Can't draw dot without a note and index.");const t=this.note.stave.options.spacing_between_lines_px,a=this.note.getModifierStartXY(this.position,this.index,{forceFlagRight:!0});"tabnotes"===this.note.getCategory()&&(a.y=this.note.getStemExtents().baseY);const b=a.x+this.x_shift+this.width-this.radius,w=a.y+this.y_shift+this.dot_shiftY*t,R=this.context;R.beginPath(),R.arc(b,w,this.radius,0,2*Math.PI,!1),R.fill()}}function Q(ut,t,a){if(ut.note.shiftRestVerticalDisabled)return;const b=(t.isrest?0:1)*a;ut.line+=b,ut.maxLine+=b,ut.minLine+=b,ut.note.setKeyLine(0,ut.note.getKeyLine(0)+b)}class ot extends U{static get CATEGORY(){return"stavenotes"}static get STEM_UP(){return _.UP}static get STEM_DOWN(){return _.DOWN}static get DEFAULT_LEDGER_LINE_OFFSET(){return 3}
1static format(t,a){if(!t||t.length<2)return!1;const b=[],w=t[0].stagger_same_whole_notes;for(let ht=0;ht<t.length;ht++){const lt=t[ht].getKeyProps(),ft=lt[0].line;let bt=lt[lt.length-1].line;const mt=t[ht].getStemDirection(),xt=t[ht].getStemLength()/10,wt=t[ht].getStemMinumumLength()/10;let Tt;t[ht].isRest()?(Tt=ft+t[ht].glyph.line_above,bt=ft-t[ht].glyph.line_below):(Tt=1===mt?lt[lt.length-1].line+xt:lt[lt.length-1].line,bt=1===mt?lt[0].line:lt[0].line-xt),b.push({line:lt[0].line,maxLine:Tt,minLine:bt,isrest:t[ht].isRest(),stemDirection:mt,stemMax:xt,stemMin:wt,voice_shift:t[ht].getVoiceShiftWidth(),is_displaced:t[ht].isDisplaced(),note:t[ht]})}const R=b.length;let k=b[0];const z=R>2?b[1]:null;let J=R>2?b[2]:b[1];2!==R||-1!==k.stemDirection||1!==J.stemDirection||k.isrest||J.isRest||(k=b[1],J=b[0]);const tt=Math.max(k.voice_shift,J.voice_shift);let rt,at=0;if(2===R){const ht=k.stemDirection===J.stemDirection?0:.5;if(k.stemDirection===J.stemDirection&&k.minLine<=J.maxLine&&(k.isrest||(rt=Math.abs(k.line-(J.maxLine+.5)),rt=Math.max(rt,k.stemMin),k.minLine=k.line-rt,k.note.setStemLength(10*rt))),k.minLine<=J.maxLine+ht)if(k.isrest)Q(k,J,1),k.note.hasLedgerLinedRest&&(k.note.shiftRestVerticalDisabled=!0);else if(J.isrest)Q(J,k,-1),J.note.hasLedgerLinedRest&&(J.note.shiftRestVerticalDisabled=!0);else{at=tt;const lt=Math.abs(k.line-J.line);let ft=0,bt=0;"h"===k.note.duration?ft++:"w"===k.note.duration&&bt++,"h"===J.note.duration?ft++:"w"===J.note.duration&&bt++;let mt=1===ft||1===bt||k.note.dots!==J.note.dots;if(w&&(mt||=2===bt),0===lt&&mt){if(J.note.setXShift(at),k.note.dots>0){let xt=0;for(const wt of k.note.modifiers)if(wt instanceof H&&(xt++,wt.setYShift(-10*(J.maxLine-k.line+1)),xt===k.note.dots))break}}else lt<1&<>0?J.note.setXShift(at):k.note.voice!==J.note.voice&&k.stemDirection===J.stemDirection&&(k.line>J.line?1===k.stemDirection?J.note.renderFlag=!1:k.note.renderFlag=!1:J.line>k.line?1===J.stemDirection?k.note.renderFlag=!1:J.note.renderFlag=!1:1===J.stemDirection&&(J.stemDirection=-1,J.note.setStemDirection(-1)))}return!0}return null!==z&&z.minLine<J.maxLine+.5&&(z.isrest||(rt=Math.abs(z.line-(J.maxLine+.5)),rt=Math.max(rt,z.stemMin),z.minLine=z.line-rt,z.note.setStemLength(10*rt))),z.isrest&&!k.isrest&&!J.isrest&&(k.minLine<=z.maxLine||z.minLine<=J.maxLine)?(z.maxLine-z.minLine<k.minLine-J.maxLine?function(ht,lt,ft){const bt=ht.line-l.MidLine(lt.minLine,ft.maxLine);ht.note.setKeyLine(0,ht.note.getKeyLine(0)-bt),ht.line-=bt,ht.maxLine-=bt,ht.minLine-=bt}(z,k,J):(at=tt+3,z.note.setXShift(at)),!0):k.isrest&&z.isrest&&J.isrest?(Q(k,z,1),Q(J,z,-1),!0):(z.isrest&&k.isrest&&z.minLine<=J.maxLine&&Q(z,J,1),z.isrest&&J.isrest&&k.minLine<=z.maxLine&&Q(z,k,-1),k.isrest&&k.minLine<=z.maxLine&&Q(k,z,1),J.isrest&&z.minLine<=J.maxLine&&Q(J,z,-1),(!k.isrest&&!z.isrest&&k.minLine<=z.maxLine+.5||!z.isrest&&!J.isrest&&z.minLine<=J.maxLine)&&(at=tt+3,z.note.setXShift(at)),!0)}static formatByY(t,a){let b=!0;for(let R=0;R<t.length;R++)b=b&&null!=t[R].getStave();if(!b)throw new l.RERR("Stave Missing","All notes must have a stave - Vex.Flow.ModifierContext.formatMultiVoice!");let w=0;for(let R=0;R<t.length-1;R++){let k=t[R],z=t[R+1];k.maxLine<z.maxLine&&(k=t[R+1],z=t[R]);const J=k.getKeyProps(),tt=z.getKeyProps(),rt=.5,at=k.getStave().getYForLine(5-J[0].line+rt);z.getStave().getYForLine(5-tt[tt.length-1].line-rt)-at<0&&k.voice===z.voice&&(w=k.getVoiceShiftWidth()+2,z.setXShift(w))}a.right_shift+=w}static postFormat(t){return!!t&&(t.forEach(a=>a.postFormat()),!0)}constructor(t){if(super(t),this.setAttribute("type","StaveNote"),this.keys=t.keys,this.clef=t.clef,this.octave_shift=t.octave_shift,this.beam=null,this.glyph=p.getGlyphProps(this.duration,this.noteType),!this.glyph)throw new l.RuntimeError("BadArguments",`Invalid note initialization data (No glyph found): ${JSON.stringify(t)}`);this.displaced=!1,this.dot_shiftY=0,this.addDotsCount=0,this.keyProps=[],this.use_default_head_x=!1,this.paddingRight=0,this.note_heads=[],this.modifiers=[],l.Merge(this.render_options,{glyph_font_scale:t.glyph_font_scale||p.DEFAULT_NOTATION_FONT_SCALE,stroke_px:t.stroke_px||ot.DEFAULT_LEDGER_LINE_OFFSET}),this.calculateKeyProps(),this.buildStem(),t.auto_stem?this.autoStem():this.setStemDirection(t.stem_direction),this.reset(),this.buildFlag()}reset(){super.reset();const t=this.note_heads.map(b=>b.getStyle()),a=[];this.note_heads.forEach(b=>a.push(b.note_type)),this.buildNoteHeads(),this.note_heads.forEach((b,w)=>{b.setStyle(t[w]),a[w]&&(b.note_type=a[w])}),this.stave&&this.note_heads.forEach(b=>b.setStave(this.stave)),this.calcExtraPx()}setBeam(t){return this.beam=t,this.calcExtraPx(),this}getCategory(){return ot.CATEGORY}buildStem(){this.setStem(new _({hide:!!this.isRest()}
vendor: 36,619 bytes, line 1
1)),this.stem.id=l.Prefix(`${this.getAttribute("id")}-stem`)}buildNoteHeads(){this.note_heads=[];const t=this.getStemDirection(),a=this.getKeys();let b,w,R,k=null,z=null,J=!1;t===_.UP?(b=0,w=a.length,R=1):t===_.DOWN&&(b=a.length-1,w=-1,R=-1);for(let tt=b;tt!==w;tt+=R){const rt=this.keyProps[tt],at=rt.line;null===k?k=at:(z=Math.abs(k-at),0===z||.5===z?J=!J:(J=!1,this.use_default_head_x=!0)),k=at;const ht=new P({duration:this.duration,note_type:this.noteType,displaced:J,stem_direction:t,custom_glyph_code:rt.code,glyph_font_scale:this.render_options.glyph_font_scale,x_shift:rt.shift_right,stem_up_x_offset:rt.stem_up_x_offset,stem_down_x_offset:rt.stem_down_x_offset,stem_up_y_shift:rt.stem_up_y_shift,stem_down_y_shift:rt.stem_down_y_shift,line:rt.line});ht.isLedgerLinedRest&&(this.hasLedgerLinedRest=!0),ht.id=this.stem.id=l.Prefix(`${this.getAttribute("id")}-stem${tt}`),this.note_heads[tt]=ht}}autoStem(){this.minLine=this.keyProps[0].line,this.maxLine=this.keyProps[this.keyProps.length-1].line,this.setStemDirection((this.minLine+this.maxLine)/2<3?_.UP:_.DOWN)}calculateKeyProps(){let t=null;for(let a=0;a<this.keys.length;++a){const b=this.keys[a];this.glyph.rest&&(this.glyph.position=b);const R=p.keyProperties(b,this.clef,{octave_shift:this.octave_shift||0});if(!R)throw new l.RuntimeError("BadArguments",`Invalid key for note properties: ${b}`);"R"===R.key&&(R.line="1"===this.duration||"w"===this.duration?4:3);const k=R.line;null===t?t=k:Math.abs(t-k)<1&&(this.displaced=!0,R.displaced=!0,this.keyProps.length>0&&(this.keyProps[a-1].displaced=!0)),t=k,this.keyProps.push(R)}t=-1/0,this.keyProps.forEach(a=>{a.line<t&&l.W("Unsorted keys in note will be sorted. See https://github.com/0xfe/vexflow/issues/104 for details."),t=a.line}),this.keyProps.sort((a,b)=>a.line-b.line)}getBoundingBox(){if(!this.preFormatted)throw new l.RERR("UnformattedNote","Can't call getBoundingBox on an unformatted note.");const{width:t,modLeftPx:a,extraLeftPx:b}=this.getMetrics(),w=this.getAbsoluteX()-a-b-this.paddingRight;let R=0,k=0;const z=this.getStave().getSpacingBetweenLines()/2,J=2*z;if(this.isRest()){const tt=this.ys[0],rt=p.durationToFraction(this.duration);rt.equals(1)||rt.equals(2)?(R=tt-z,k=tt+z):(R=tt-this.glyph.line_above*J,k=tt+this.glyph.line_below*J)}else if(this.glyph.stem){const tt=this.getStemExtents();tt.baseY+=z*this.stem_direction,R=Math.min(tt.topY,tt.baseY),k=Math.max(tt.topY,tt.baseY)}else{R=null,k=null;for(let tt=0;tt<this.ys.length;++tt){const rt=this.ys[tt];0===tt?(R=rt,k=rt):(R=Math.min(rt,R),k=Math.max(rt,k))}R-=z,k+=z}return new h(w,R,t,k-R)}getLineNumber(t){if(!this.keyProps.length)throw new l.RERR("NoKeyProps","Can't get bottom note line, because note is not initialized properly.");let a=this.keyProps[0].line;for(let b=0;b<this.keyProps.length;b++){const w=this.keyProps[b].line;t?w>a&&(a=w):w<a&&(a=w)}return a}isRest(){return this.glyph.rest}isChord(){return!this.isRest()&&this.keys.length>1}hasStem(){return this.glyph.stem}hasFlag(){return super.hasFlag()&&!this.isRest()&&this.renderFlag}getStemX(){return"r"===this.noteType?this.getCenterGlyphX():super.getStemX()+_.WIDTH/(2*-this.getStemDirection())}getYForTopText(t){const a=this.getStemExtents();return Math.min(this.stave.getYForTopText(t),a.topY-this.render_options.annotation_spacing*(t+1))}getYForBottomText(t){const a=this.getStemExtents();return Math.max(this.stave.getYForTopText(t),a.baseY+this.render_options.annotation_spacing*t)}setStave(t){super.setStave(t);const a=this.note_heads.map(b=>(b.setStave(t),b.getY()));if(this.setYs(a),this.stem){const{y_top:b,y_bottom:w}=this.getNoteHeadBounds();this.stem.setYBounds(b,w)}return this}getKeys(){return this.keys}getKeyProps(){return this.keyProps}isDisplaced(){return this.displaced}setNoteDisplaced(t){return this.displaced=t,this}getTieRightX(){let t=this.getAbsoluteX();return t+=this.getGlyphWidth()+this.x_shift+this.extraRightPx,this.modifierContext&&(t+=this.modifierContext.getExtraRightPx()),t}getTieLeftX(){let t=this.getAbsoluteX();return t+=this.x_shift-this.extraLeftPx,t}getLineForRest(){let t=this.keyProps[0].line;if(this.keyProps.length>1){const a=this.keyProps[this.keyProps.length-1].line,b=Math.max(t,a),w=Math.min(t,a);t=l.MidLine(b,w)}return t}getModifierStartXY(t,a,b){if(b=b||{},!this.preFormatted)throw new l.RERR("UnformattedNote","Can't call GetModifierStartXY on an unformatted note");if(0===this.ys.length)throw new l.RERR("NoYValues","No Y-Values calculated for this note.");const{ABOVE:w,BELOW:R,LEFT:k,RIGHT:z}=Y.Position;let J=0;return t===k?J=-2:t===z?(J=this.getGlyphWidth()+this.x_shift+2,this.stem_direction===_.UP&&this.hasFlag()&&(b.forceFlagRight||a===((tt=this).getStemDirection()===_.UP?tt.keyProps.length-1:0))&&(J+=this.flag.getMetrics().width)):t!==R&&t!==w||(J=this.getGlyphWidth()/2),{x:this.getAbsoluteX()+J,y:this.ys[a]};var tt}setStyle(t){super.setStyle(t),this.note_heads.forEach(a=>a.setStyle(t)),this.stem&&this.stem.setStyle(t)}setStemStyle(t){this.stem&&this.getStem().setStyle(t)}getStemStyle(){return this.stem.getStyle()}setLedgerLineStyle(t){this.ledgerLineStyle=t}getLedgerLineStyle(){return this.ledgerLineStyle}setFlagStyle(t){this.flagStyle=t}getFlagStyle(){return this.flagStyle}setKeyStyle(t,a){return this.note_heads[t].setStyle(a),this}setKeyLine(t,a){return this.keyProps[t].line=a,this.reset(),this}getKeyLine(t){return this.keyProps[t].line}addToModifierContext(t){this.setModifierContext(t);for(let a=0;a<this.modifiers.length;++a)this.modifierContext.addModifier(this.modifiers[a]);return this.modifierContext.addModifier(this),this.setPreFormatted(!1),this}addModifier(t,a){return a.setNote(this),a.setIndex(t),this.modifiers.push(a),this.setPreFormatted(!1),this}addAccidental(t,a){return this.addModifier(t,a)}addArticulation(t,a){return this.addModifier(t,a)}addAnnotation(t,a){return this.addModifier(t,a)}addDot(t){const a=new H;return a.setDotShiftY(this.glyph.dot_shiftY),this.addDotsCount++,this.addModifier(t,a)}addDotToAll(){for(let t=0;t<this.keys.length;++t)this.addDot(t);return this}getAccidentals(){return this.modifierContext.getModifiers("accidentals")}getDots(){return this.modifierContext.getModifiers("dots")}getVoiceShiftWidth(){return this.getGlyphWidth()*(this.displaced?2:1)}calcExtraPx(){this.setExtraLeftPx(this.displaced&&this.stem_direction===_.DOWN?this.getGlyphWidth():0),this.setExtraRightPx(!this.hasFlag()&&this.displaced&&this.stem_direction===_.UP?this.getGlyphWidth():0)}preFormat(){if(this.preFormatted)return;this.modifierContext&&this.modifierContext.preFormat();let t=this.getGlyphWidth()+this.extraLeftPx+this.extraRightPx+this.paddingRight;this.renderFlag&&this.glyph.flag&&null===this.beam&&this.stem_direction===_.UP&&(t+=this.getGlyphWidth()),this.setWidth(t),this.setPreFormatted(!0)}getNoteHeadBounds(){let t=null,a=null,b=null,w=null,R=this.stave.getNumLines(),k=1,z=!1,J=!1,tt=R,rt=k;return this.note_heads.forEach(at=>{const ht=at.getLine(),lt=at.getY();(null===t||lt<t)&&(t=lt),(null===a||lt>a)&&(a=lt),null===w&&at.isDisplaced()&&(w=at.getAbsoluteX()),null!==b||at.isDisplaced()||(b=at.getAbsoluteX()),R=ht>R?ht:R,k=ht<k?ht:k,at.isDisplaced()?(z=!1===z?ht:Math.max(ht,z),J=!1===J?ht:Math.min(ht,J)):(tt=Math.max(ht,tt),rt=Math.min(ht,rt))},this),{y_top:t,y_bottom:a,displaced_x:w,non_displaced_x:b,highest_line:R,lowest_line:k,highest_displaced_line:z,lowest_displaced_line:J,highest_non_displaced_line:tt,lowest_non_displaced_line:rt}}getNoteHeadBeginX(){return this.getAbsoluteX()+this.x_shift}getNoteHeadEndX(){return this.getNoteHeadBeginX()+this.getGlyphWidth()}drawLedgerLines(){const{stave:t,glyph:a,render_options:{stroke_px:b},context:w}=this,R=a.getWidth()+2*b,k=2*(a.getWidth()+b)-_.WIDTH/2;if(this.isRest())return;if(!w)throw new l.RERR("NoCanvasContext","Can't draw without a canvas context.");const{highest_line:z,lowest_line:J,highest_displaced_line:tt,highest_non_displaced_line:rt,lowest_displaced_line:at,lowest_non_displaced_line:ht,displaced_x:lt,non_displaced_x:ft}=this.getNoteHeadBounds(),bt=Math.min(lt,ft),mt=(Tt,Pt,Lt)=>{let Ct;Ct=Lt&&Pt?bt-b:Pt?ft-b:lt-b;const kt=Pt&&Lt?k:R;w.beginPath(),w.moveTo(Ct,Tt),w.lineTo(Ct+kt,Tt),w.stroke()},xt={...t.getStyle()||{},...this.getLedgerLineStyle()||{}};this.applyStyle(w,xt);const wt=z>=6||J<=0;wt&&w.openGroup("ledgers",this.getAttribute("id")+"ledgers");for(let Tt=6;Tt<=z;++Tt){const Pt=null!==ft&&Tt<=rt,Lt=null!==lt&&Tt<=tt;mt(t.getYForNote(Tt),Pt,Lt)}for(let Tt=0;Tt>=J;--Tt){const Pt=null!==ft&&Tt>=ht,Lt=null!==lt&&Tt>=at;mt(t.getYForNote(Tt),Pt,Lt)}wt&&w.closeGroup(),this.restoreStyle(w,xt)}drawModifiers(){if(!this.context)throw new l.RERR("NoCanvasContext","Can't draw without a canvas context.");const t=this.context;t.openGroup("modifiers");for(let a=0;a<this.modifiers.length;a++){const b=this.modifiers[a],w=this.note_heads[b.getIndex()],R=w.getStyle();w.applyStyle(t,R),b.setContext(t),b.drawWithStyle(),w.restoreStyle(t,R)}t.closeGroup()}drawFlag(){const{stem:t,beam:a,context:b}=this;if(!b)throw new l.RERR("NoCanvasContext","Can't draw without a canvas context.");const w=null===a&&this.renderFlag;if(this.getGlyph().flag&&w){const{y_top:R,y_bottom:k}=this.getNoteHeadBounds(),z=t.getHeight(),J=this.getStemX(),tt=this.getStemDirection()===_.DOWN?R-z+2:k-z-2;b.openGroup("flag",null,{pointerBBox:!0}),this.applyStyle(b,this.getFlagStyle()||!1),this.flag.render(b,J,tt),this.restoreStyle(b,this.getFlagStyle()||!1),b.closeGroup()}}drawNoteHeads(){this.note_heads.forEach(t=>{this.context.openGroup("notehead",null,{pointerBBox:!0}),t.setContext(this.context).draw(),this.context.closeGroup()})}drawStem(t){if(!this.context)throw new l.RERR("NoCanvasContext","Can't draw without a canvas context.");t&&this.setStem(new _(t)),this.stem.id=l.Prefix(`${this.getAttribute("id")}-stem`),this.stem&&(this.context.openGroup("stem",null,{pointerBBox:!0}),this.stem.setContext(this.context).draw(),this.context.closeGroup())}draw(){if(!this.context)throw new l.RERR("NoCanvasContext","Can't draw without a canvas context.");if(!this.stave)throw new l.RERR("NoStave","Can't draw without a stave.");if(0===this.ys.length)throw new l.RERR("NoYValues","Can't draw note without Y values.");const t=this.getNoteHeadBeginX(),a=this.hasStem()&&!this.beam;if(this.note_heads.forEach(b=>b.setX(t)),this.stem){const b=this.getStemX();this.stem.setNoteHeadXBounds(b,b)}(function(...b){ot.DEBUG&&l.L("Vex.Flow.StaveNote",b)})("Rendering ",this.isChord()?"chord :":"note :",this.keys),this.drawLedgerLines(),this.applyStyle(),this.setAttribute("el",this.context.openGroup("stavenote",this.getAttribute("id"))),this.context.openGroup("note",null,{pointerBBox:!0}),a&&this.drawStem(),this.drawNoteHeads(),this.drawFlag(),this.context.closeGroup(),this.drawModifiers(),this.context.closeGroup(),this.restoreStyle(),this.setRendered()}}class $ extends Y{static get CATEGORY(){return"frethandfinger"}static format(t,a){const{left_shift:b,right_shift:w}=a;if(!t||0===t.length)return!1;const R=[];let k=null,z=0,J=0;for(let bt=0;bt<t.length;++bt){const mt=t[bt],xt=mt.getNote(),wt=mt.getPosition(),Tt=xt.getKeyProps()[mt.getIndex()];if(xt!==k){for(let Pt=0;Pt<xt.keys.length;++Pt){const Lt=xt.getKeyProps()[Pt];0===b&&(z=Lt.displaced?xt.getExtraLeftPx():z),0===w&&(J=Lt.displaced?xt.getExtraRightPx():J)}k=xt}R.push({note:xt,num:mt,pos:wt,line:Tt.line,shiftL:z,shiftR:J})}R.sort((bt,mt)=>mt.line-bt.line);let tt=0,rt=0,at=0,ht=0,lt=null,ft=null;for(let bt=0;bt<R.length;++bt){let mt=0;const{note:xt,pos:wt,num:Tt,line:Pt,shiftL:Lt,shiftR:Ct}=R[bt];Pt===lt&&xt===ft||(tt=b+Lt,rt=w+Ct);const kt=Tt.getWidth()+1;wt===Y.Position.LEFT?(Tt.setXShift(b+tt),mt=b+kt,at=mt>at?mt:at):wt===Y.Position.RIGHT&&(Tt.setXShift(rt),mt=J+kt,ht=mt>ht?mt:ht),lt=Pt,ft=xt}return a.left_shift+=at,a.right_shift+=ht,!0}constructor(t){super(),this.setAttribute("type","FretHandFinger"),this.note=null,this.index=null,this.finger=t,this.width=7,this.position=Y.Position.LEFT,this.x_shift=0,this.y_shift=0,this.x_offset=0,this.y_offset=0,this.font={family:"sans-serif",size:9,weight:"bold"}}getCategory(){return $.CATEGORY}setFretHandFinger(t){return this.finger=t,this}setOffsetX(t){return this.x_offset=t,this}setOffsetY(t){return this.y_offset=t,this}draw(){if(this.checkContext(),!this.note||null==this.index)throw new l.RERR("NoAttachedNote","Can't draw string number without a note and index.");this.setRendered();const t=this.context,a=this.note.getModifierStartXY(this.position,this.index);let b=a.x+this.x_shift+this.x_offset,w=a.y+this.y_shift+this.y_offset+5;switch(this.position){case Y.Position.ABOVE:b-=4,w-=12;break;case Y.Position.BELOW:b-=2,w+=10;break;case Y.Position.LEFT:b-=this.width;break;case Y.Position.RIGHT:b+=1;break;default:throw new l.RERR("InvalidPostion",`The position ${this.position} does not exist`)}t.save(),t.setFont(this.font.family,this.font.size,this.font.weight),t.fillText(""+this.finger,b,w),t.restore()}}class it{static get NUM_TONES(){return 12}static get roots(){return["c","d","e","f","g","a","b"]}static get root_values(){return[0,2,4,5,7,9,11]}static get root_indices(){return{c:0,d:1,e:2,f:3,g:4,a:5,b:6}}static get canonical_notes(){return["c","c#","d","d#","e","f","f#","g","g#","a","a#","b"]}static get diatonic_intervals(){return["unison","m2","M2","m3","M3","p4","dim5","p5","m6","M6","b7","M7","octave"]}static get diatonic_accidentals(){return{unison:{note:0,accidental:0},m2:{note:1,accidental:-1},M2:{note:1,accidental:0},m3:{note:2,accidental:-1},M3:{note:2,accidental:0},p4:{note:3,accidental:0},dim5:{note:4,accidental:-1},p5:{note:4,accidental:0},m6:{note:5,accidental:-1},M6:{note:5,accidental:0},b7:{note:6,accidental:-1},M7:{note:6,accidental:0},octave:{note:7,accidental:0}}}static get intervals(){return{u:0,unison:0,m2:1,b2:1,min2:1,S:1,H:1,2:2,M2:2,maj2:2,T:2,W:2,m3:3,b3:3,min3:3,M3:4,3:4,maj3:4,4:5,p4:5,"#4":6,b5:6,aug4:6,dim5:6,5:7,p5:7,"#5":8,b6:8,aug5:8,6:9,M6:9,maj6:9,b7:10,m7:10,min7:10,dom7:10,M7:11,maj7:11,8:12,octave:12}}static get scales(){return{major:[2,2,1,2,2,2,1],dorian:[2,1,2,2,2,1,2],mixolydian:[2,2,1,2,2,1,2],minor:[2,1,2,2,1,2,2]}}static get scaleTypes(){return{M:it.scales.major,m:it.scales.minor}}static get accidentals(){return["bb","b","n","#","##"]}static get noteValues(){return{c:{root_index:0,int_val:0},cn:{root_index:0,int_val:0},"c#":{root_index:0,int_val:1},"c##":{root_index:0,int_val:2},cb:{root_index:0,int_val:11},cbb:{root_index:0,int_val:10},d:{root_index:1,int_val:2},dn:{root_index:1,int_val:2},"d#":{root_index:1,int_val:3},"d##":{root_index:1,int_val:4},db:{root_index:1,int_val:1},dbb:{root_index:1,int_val:0},e:{root_index:2,int_val:4},en:{root_index:2,int_val:4},"e#":{root_index:2,int_val:5},"e##":{root_index:2,int_val:6},eb:{root_index:2,int_val:3},ebb:{root_index:2,int_val:2},f:{root_index:3,int_val:5},fn:{root_index:3,int_val:5},"f#":{root_index:3,int_val:6},"f##":{root_index:3,int_val:7},fb:{root_index:3,int_val:4},fbb:{root_index:3,int_val:3},g:{root_index:4,int_val:7},gn:{root_index:4,int_val:7},"g#":{root_index:4,int_val:8},"g##":{root_index:4,int_val:9},gb:{root_index:4,int_val:6},gbb:{root_index:4,int_val:5},a:{root_index:5,int_val:9},an:{root_index:5,int_val:9},"a#":{root_index:5,int_val:10},"a##":{root_index:5,int_val:11},ab:{root_index:5,int_val:8},abb:{root_index:5,int_val:7},b:{root_index:6,int_val:11},bn:{root_index:6,int_val:11},"b#":{root_index:6,int_val:0},"b##":{root_index:6,int_val:1},bb:{root_index:6,int_val:10},bbb:{root_index:6,int_val:9}}}isValidNoteValue(t){return!(null==t||t<0||t>=it.NUM_TONES)}isValidIntervalValue(t){return this.isValidNoteValue(t)}getNoteParts(t){if(!t||t.length<1)throw new l.RERR("BadArguments","Invalid note name: "+t);if(t.length>3)throw new l.RERR("BadArguments","Invalid note name: "+t);const a=t.toLowerCase(),b=/^([cdefgab])(b|bb|n|#|##)?$/.exec(a);if(null!=b)return{root:b[1],accidental:b[2]};throw new l.RERR("BadArguments","Invalid note name: "+t)}getKeyParts(t){if(!t||t.length<1)throw new l.RERR("BadArguments","Invalid key: "+t);const a=t.toLowerCase(),b=/^([cdefgab])(b|#)?(mel|harm|m|M)?$/.exec(a);if(null!=b){let k=b[3];return k||(k="M"),{root:b[1],accidental:b[2],type:k}}throw new l.RERR("BadArguments",`Invalid key: ${t}`)}getNoteValue(t){const a=it.noteValues[t];if(null==a)throw new l.RERR("BadArguments",`Invalid note name: ${t}`);return a.int_val}getIntervalValue(t){const a=it.intervals[t];if(null==a)throw new l.RERR("BadArguments",`Invalid interval name: ${t}`);return a}getCanonicalNoteName(t){if(!this.isValidNoteValue(t))throw new l.RERR("BadArguments",`Invalid note value: ${t}`);return it.canonical_notes[t]}getCanonicalIntervalName(t){if(!this.isValidIntervalValue(t))throw new l.RERR("BadArguments",`Invalid interval value: ${t}`);return it.diatonic_intervals[t]}getRelativeNoteValue(t,a,b){if(null==b&&(b=1),1!==b&&-1!==b)throw new l.RERR("BadArguments",`Invalid direction: ${b}`);let w=(t+b*a)%it.NUM_TONES;return w<0&&(w+=it.NUM_TONES),w}getRelativeNoteName(t,a){const b=this.getNoteParts(t),w=this.getNoteValue(b.root);let R=a-w;if(Math.abs(R)>it.NUM_TONES-3){let z=1;R>0&&(z=-1);const J=(a+1+(w+1))%it.NUM_TONES*z;if(Math.abs(J)>2)throw new l.RERR("BadArguments",`Notes not related: ${t}, ${a})`);R=J}if(Math.abs(R)>2)throw new l.RERR("BadArguments",`Notes not related: ${t}, ${a})`);let k=b.root;if(R>0)for(let z=1;z<=R;++z)k+="#";else if(R<0)for(let z=-1;z>=R;--z)k+="b";return k}getScaleTones(t,a){const b=[t];let w=t;for(let R=0;R<a.length;R+=1)w=this.getRelativeNoteValue(w,a[R]),w!==t&&b.push(w);return b}getIntervalBetween(t,a,b){if(null==b&&(b=1),1!==b&&-1!==b)throw new l.RERR("BadArguments",`Invalid direction: ${b}`);if(!this.isValidNoteValue(t)||!this.isValidNoteValue(a))throw new l.RERR("BadArguments",`Invalid notes: ${t}, ${a}`);let w=1===b?a-t:t-a;return w<0&&(w+=it.NUM_TONES),w}createScaleMap(t){const a=this.getKeyParts(t),b=it.scaleTypes[a.type];let w=a.root;if(a.accidental&&(w+=a.accidental),!b)throw new l.RERR("BadArguments","Unsupported key type: "+t);const R=this.getScaleTones(this.getNoteValue(w),b),k=it.root_indices[a.root],z={};for(let J=0;J<it.roots.length;++J){const rt=it.roots[(k+J)%it.roots.length];let at=this.getRelativeNoteName(rt,R[J]);1===at.length&&(at+="n"),z[rt]=at}return z}}function nt(...ut){N.DEBUG&&l.L("Vex.Flow.Accidental",ut)}const st=ut=>ut.getMetrics().width;class N extends Y{static get CATEGORY(){return"accidentals"}static format(t,a){const b=a.left_shift+1;if(!t||0===t.length)return;const w=[];let R,k=null,z=0;for(let mt=0;mt<t.length;++mt){const xt=t[mt],wt=xt.getNote(),Tt=wt.getStave(),Pt=wt.getKeyProps()[xt.getIndex()];if(wt!==k){for(let Lt=0;Lt<wt.keys.length;++Lt)R=wt.getKeyProps()[Lt],z=R.displaced?wt.getExtraLeftPx():z;k=wt}if(null!==Tt){const Lt=Tt.options.spacing_between_lines_px,Ct=Tt.getYForLine(Pt.line),kt=Math.round(Ct/Lt*2)/2;w.push({y:Ct,line:kt,shift:z,acc:xt,lineSpace:Lt})}else w.push({line:Pt.line,shift:z,acc:xt})}w.sort((mt,xt)=>xt.line-mt.line);const J=[];let tt=0,rt=null;for(let mt=0;mt<w.length;mt++){const xt=w[mt];null!==rt&&rt===xt.line||J.push({line:xt.line,flatLine:!0,dblSharpLine:!0,numAcc:0,width:0}),"b"!==xt.acc.type&&"bb"!==xt.acc.type&&(J[J.length-1].flatLine=!1),"##"!==xt.acc.type&&(J[J.length-1].dblSharpLine=!1),J[J.length-1].numAcc++,J[J.length-1].width+=xt.acc.getWidth()+3,tt=xt.shift>tt?xt.shift:tt,rt=xt.line}let at=0;for(let mt=0;mt<J.length;mt++){let xt=!1;const wt=mt;let Tt=mt;for(;Tt+1<J.length&&!xt;)this.checkCollision(J[Tt],J[Tt+1])?Tt++:xt=!0;const Pt=$t=>J[wt+$t],Lt=$t=>$t.map(Pt),Ct=($t,le)=>{const[fe,Ae]=Lt([$t,le]).map(Te=>Te.line);return fe-Ae},kt=(...$t)=>$t.map(Lt).every(le=>!this.checkCollision(...le)),Gt=Tt-wt+1;let zt,ne,Zt=this.checkCollision(J[wt],J[Tt])?"a":"b";switch(Gt){case 3:"a"===Zt&&.5===Ct(1,2)&&.5!==Ct(0,1)&&(Zt="second_on_bottom");break;case 4:kt([0,2],[1,3])&&(Zt="spaced_out_tetrachord");break;case 5:"b"===Zt&&kt([1,3])&&(Zt="spaced_out_pentachord",kt([0,2],[2,4])&&(Zt="very_spaced_out_pentachord"));break;case 6:kt([0,3],[1,4],[2,5])&&(Zt="spaced_out_hexachord"),kt([0,2],[2,4],[1,3],[3,5])&&(Zt="very_spaced_out_hexachord")}if(Gt>=7){let $t=2,le=!0;for(;!0===le;){le=!1;for(let fe=0;fe+$t<J.length;fe++)if(this.checkCollision(J[fe],J[fe+$t])){le=!0,$t++;break}}for(zt=mt;zt<=Tt;zt++)ne=(zt-mt)%$t+1,J[zt].column=ne,at=at>ne?at:ne}else for(zt=mt;zt<=Tt;zt++)ne=p.accidentalColumnsTable[Gt][Zt][zt-mt],J[zt].column=ne,at=at>ne?at:ne;mt=Tt}const ht=[],lt=[];for(let mt=0;mt<=at;mt++)ht[mt]=0,lt[mt]=0;ht[0]=tt+b,lt[0]=tt+b,J.forEach(mt=>{mt.width>ht[mt.column]&&(ht[mt.column]=mt.width)});for(let mt=1;mt<ht.length;mt++)lt[mt]=ht[mt]+lt[mt-1];const ft=lt[lt.length-1];let bt=0;J.forEach(mt=>{let xt=0;const wt=bt+mt.numAcc;for(;bt<wt;bt++){const Tt=lt[mt.column-1]+xt;w[bt].acc.setXShift(Tt),xt+=w[bt].acc.getWidth()+3,nt("Line, accCount, shift: ",mt.line,bt,Tt)}}),a.left_shift+=ft}static checkCollision(t,a){let b=a.line-t.line,w=3;b>0?(w=a.flatLine||a.dblSharpLine?2.5:3,t.dblSharpLine&&(b-=.5)):(w=t.flatLine||t.dblSharpLine?2.5:3,a.dblSharpLine&&(b-=.5));const R=Math.abs(b)<w;return nt("Line_1, Line_2, Collision: ",t.line,a.line,R),R}static applyAccidentals(t,a){const b=[],w={};t.forEach(z=>{const J=new s(0,1);z.getTickables().forEach(tt=>{if(tt.shouldIgnoreTicks())return;const rt=w[J.value()];rt?rt.push(tt):(b.push(J.value()),w[J.value()]=[tt]),J.add(tt.getTicks())})});const R=new it;a||(a="C");const k=R.createScaleMap(a);b.forEach(z=>{const tt=[],rt=at=>{at.isRest()||at.shouldIgnoreTicks()||(at.keys.forEach((ht,lt)=>{const ft=R.getNoteParts(ht.split("/")[0]),bt=ft.accidental||"n",mt=ft.root+bt,xt=k[ft.root]===mt,wt=tt.indexOf(mt)>-1;if(!xt||xt&&wt){k[ft.root]=mt;const Tt=new N(bt);at.addAccidental(lt,Tt),tt.push(mt)}}),at.getModifiers().forEach(ht=>{"gracenotegroups"===ht.getCategory()&&ht.getGraceNotes().forEach(rt)}))};w[z].forEach(rt)})}constructor(t=null){if(super(),this.setAttribute("type","Accidental"),nt("New accidental: ",t),this.note=null,this.index=null,this.type=t,this.position=Y.Position.LEFT,this.render_options={font_scale:38,stroke_px:3,parenLeftPadding:2,parenRightPadding:2},this.accidental=p.accidentalCodes(this.type),!this.accidental)throw new l.RERR("ArgumentError",`Unknown accidental type: ${t}`);this.cautionary=!1,this.parenLeft=null,this.parenRight=null,this.reset()}reset(){const t=this.render_options.font_scale;this.glyph=new m(this.accidental.code,t),this.glyph.setOriginX(1),this.cautionary&&(this.parenLeft=new m(p.accidentalCodes("{").code,t),this.parenRight=new m(p.accidentalCodes("}").code,t),this.parenLeft.setOriginX(1),this.parenRight.setOriginX(1))}getCategory(){return N.CATEGORY}getWidth(){const t=this.cautionary?st(this.parenLeft)+st(this.parenRight)+this.render_options.parenLeftPadding+this.render_options.parenRightPadding:0;return st(this.glyph)+t}setNote(t){if(!t)throw new l.RERR("ArgumentError",`Bad note value: ${t}`);this.note=t,"gracenotes"===this.note.getCategory()&&(this.render_options.font_scale=25,this.reset())}setAsCautionary(){return this.cautionary=!0,this.render_options.font_scale=28,this.reset(),this}draw(){const{context:t,type:a,position:b,note:w,index:R,cautionary:k,x_shift:z,y_shift:J,glyph:tt,parenLeft:rt,parenRight:at,render_options:{parenLeftPadding:ht,parenRightPadding:lt}}=this;if(this.checkContext(),!w||null==R)throw new l.RERR("NoAttachedNote","Can't draw accidental without a note and index.");const ft=w.getModifierStartXY(b,R);let bt=ft.x+z;const mt=ft.y+J;nt("Rendering: ",a,bt,mt),k?(at.render(t,bt,mt),bt-=st(at),bt-=lt,bt-=this.accidental.parenRightPaddingAdjustment,tt.render(t,bt,mt),bt-=st(tt),bt-=ht,rt.render(t,bt,mt)):tt.render(t,bt,mt),this.setRendered()}}class C extends Y{static get CATEGORY(){return"notesubgroup"}static format(t,a){if(!t||0===t.length)return!1;let b=0;for(let w=0;w<t.length;++w){const R=t[w];R.preFormat(),b+=R.getWidth()}return a.left_shift+=b,!0}constructor(t){return super(),this.setAttribute("type","NoteSubGroup"),this.note=null,this.index=null,this.position=Y.Position.LEFT,this.subNotes=t,this.subNotes.forEach(a=>{a.ignore_ticks=!1}),this.width=0,this.preFormatted=!1,this.formatter=new Ot,this.voice=new D({num_beats:4,beat_value:4,resolution:p.RESOLUTION}).setStrict(!1),this.voice.addTickables(this.subNotes),this}getCategory(){return C.CATEGORY}preFormat(){this.preFormatted||(this.formatter.joinVoices([this.voice]).format([this.voice],0),this.setWidth(this.formatter.getMinTotalWidth()),this.preFormatted=!0)}setNote(t){this.note=t}setWidth(t){this.width=t}getWidth(){return this.width}draw(){this.checkContext();const t=this.getNote();if(!t||null===this.index)throw new l.RuntimeError("NoAttachedNote","Can't draw notes without a parent note and parent note index.");this.setRendered(),this.alignSubNotesWithNote(this.subNotes,t),this.subNotes.forEach(a=>a.setContext(this.context).drawWithStyle())}}class O extends o{constructor(t,a){super(),this.setAttribute("type","StaveTie"),this.notes=t,this.context=null,this.text=a,this.direction=null,this.render_options={cp1:8,cp2:12,text_shift_x:0,first_x_shift:0,last_x_shift:0,y_shift:7,tie_spacing:0,font:{family:"Arial",size:10,style:""}},this.font=this.render_options.font,this.setNotes(t)}setFont(t){return this.font=t,this}setDirection(t){return this.direction=t,this}setNotes(t){if(!t.first_note&&!t.last_note)throw new l.RuntimeError("BadArguments","Tie needs to have either first_note or last_note set.");if(t.first_indices||(t.first_indices=[0]),t.last_indices||(t.last_indices=[0]),t.first_indices.length!==t.last_indices.length)throw new l.RuntimeError("BadArguments","Tied notes must have similar index sizes");return this.first_note=t.first_note,this.first_indices=t.first_indices,this.last_note=t.last_note,this.last_indices=t.last_indices,this}isPartial(){return!this.first_note||!this.last_note}renderTie(t){if(0===t.first_ys.length||0===t.last_ys.length)throw new l.RERR("BadArguments","No Y-values to render");const a=this.context;let b=this.render_options.cp1,w=this.render_options.cp2;Math.abs(t.last_x_px-t.first_x_px)<10&&(b=2,w=8);const R=this.render_options.first_x_shift,k=this.render_options.last_x_shift,z=this.render_options.y_shift*t.direction;for(let J=0;J<this.first_indices.length;++J){const tt=(t.last_x_px+k+(t.first_x_px+R))/2,rt=t.first_ys[this.first_indices[J]]+z,at=t.last_ys[this.last_indices[J]]+z;if(isNaN(rt)||isNaN(at))throw new l.RERR("BadArguments","Bad indices for tie rendering.");const ht=(rt+at)/2+b*t.direction,lt=(rt+at)/2+w*t.direction;let ft;ft=this.first_note?.getAttribute("id")+"-tie",this.setAttribute("el",a.openGroup("stavetie",ft)),a.beginPath(),a.moveTo(t.first_x_px+R,rt),a.quadraticCurveTo(tt,ht,t.last_x_px+k,at),a.quadraticCurveTo(tt,lt,t.first_x_px+R,rt),a.closePath(),a.fill(),a.closeGroup()}}renderText(t,a){if(!this.text)return;let b=(t+a)/2;b-=this.context.measureText(this.text).width/2,this.context.save(),this.context.setFont(this.font.family,this.font.size,this.font.style),this.context.fillText(this.text,b+this.render_options.text_shift_x,(this.first_note||this.last_note).getStave().getYForTopText()-1),this.context.restore()}draw(){this.checkContext(),this.setRendered();const t=this.first_note,a=this.last_note;let b,w,R,k,z;return t?(b=t.getTieRightX()+this.render_options.tie_spacing,z=t.getStemDirection(),R=t.getYs()):(b=a.getStave().getTieStartX(),R=a.getYs(),this.first_indices=this.last_indices),a?(w=a.getTieLeftX()+this.render_options.tie_spacing,z=a.getStemDirection(),k=a.getYs()):(w=t.getStave().getTieEndX(),k=t.getYs(),this.last_indices=this.first_indices),this.direction&&(z=this.direction),this.renderTie({first_x_px:b,last_x_px:w,first_ys:R,last_ys:k,direction:z}),this.renderText(b,w),!0}}class X extends O{static createHammeron(t){return new X(t,"H")}static createPulloff(t){return new X(t,"P")}constructor(t,a){super(t,a),this.setAttribute("type","TabTie"),this.render_options.cp1=9,this.render_options.cp2=11,this.render_options.y_shift=3,this.setNotes(t)}draw(){this.checkContext(),this.setRendered();const t=this.first_note,a=this.last_note;let b,w,R,k;return t?(b=t.getTieRightX()+this.render_options.tie_spacing,R=t.getYs()):(b=a.getStave().getTieStartX(),R=a.getYs(),this.first_indices=this.last_indices),a?(w=a.getTieLeftX()+this.render_options.tie_spacing,k=a.getYs()):(w=t.getStave().getTieEndX(),k=t.getYs(),this.last_indices=this.first_indices),this.renderTie({first_x_px:b,last_x_px:w,first_ys:R,last_ys:k,direction:-1}),this.renderText(b,w),!0}}class W extends Y{static get CATEGORY(){return"gracenotegroups"}static format(t,a){if(!t||0===t.length)return!1;const b=[];let w=null,R=0;for(let J=0;J<t.length;++J){const tt=t[J],rt=tt.getNote(),at=rt.getCategory()===ot.CATEGORY;let ht=0;if(at&&null!=tt.spacing&&(ht=tt.spacing),at&&rt!==w){for(let lt=0;lt<rt.keys.length;++lt)R=rt.getKeyProps()[lt].displaced?rt.getExtraLeftPx():R;w=rt}b.push({shift:R,gracenote_group:tt,spacing:ht})}let k,z=b[0].shift;for(let J=0;J<b.length;++J){const tt=b[J].gracenote_group;tt.preFormat(),k=tt.getWidth()+b[J].spacing,z=Math.max(k,z)}for(let J=0;J<b.length;++J){const tt=b[J].gracenote_group;k=tt.getWidth()+b[J].spacing,tt.setSpacingFromNextModifier(z-Math.min(k,z))}return a.left_shift+=z,!0}constructor(t,a){return super(),this.setAttribute("type","GraceNoteGroup"),this.note=null,this.index=null,this.position=Y.Position.LEFT,this.grace_notes=t,this.width=0,this.preFormatted=!1,this.show_slur=a,this.slur=null,this.formatter=new Ot,this.voice=new D({num_beats:4,beat_value:4,resolution:p.RESOLUTION}).setStrict(!1),this.render_options={slur_y_shift:0},this.beams=[],this.voice.addTickables(this.grace_notes),this}getCategory(){return W.CATEGORY}preFormat(){this.preFormatted||(this.formatter.joinVoices([this.voice]).format([this.voice],0),this.setWidth(this.formatter.getMinTotalWidth()),this.preFormatted=!0)}beamNotes(t){if((t=t||this.grace_notes).length>1){const a=new B(t);a.render_options.beam_width=3,a.render_options.partial_beam_length=4,this.beams.push(a)}return this}setNote(t){this.note=t}setWidth(t){this.width=t}getWidth(){return this.width}getGraceNotes(){return this.grace_notes}draw(){this.checkContext();const t=this.getNote();if(function(...a){W.DEBUG&&l.L("Vex.Flow.GraceNoteGroup",a)}("Drawing grace note group for:",t),!t||null===this.index)throw new l.RuntimeError("NoAttachedNote","Can't draw grace note without a parent note and parent note index.");if(this.setRendered(),this.alignSubNotesWithNote(this.getGraceNotes(),t),this.grace_notes.forEach(a=>{a.setContext(this.context).draw()}),this.beams.forEach(a=>{a.setContext(this.context).draw()}),this.show_slur){const a=this.getNote().getCategory()===ot.CATEGORY;this.slur=new(a?O:X)({last_note:this.grace_notes[0],first_note:t,first_indices:[0],last_indices:[0]}),this.slur.render_options.cp2=12,this.slur.render_options.y_shift=(a?7:5)+this.render_options.slur_y_shift,this.slur.setContext(this.context).draw()}}}class G extends Y{static get CATEGORY(){return"strokes"}static get Type(){return{BRUSH_DOWN:1,BRUSH_UP:2,ROLL_DOWN:3,ROLL_UP:4,RASQUEDO_DOWN:5,RASQUEDO_UP:6,ARPEGGIO_DIRECTIONLESS:7}}static format(t,a){const b=a.left_shift;if(!t||0===t.length)return this;const w=t.map(z=>{const J=z.getNote();if(J instanceof ot){const{line:tt,displaced:rt}=J.getKeyProps()[z.getIndex()];return{line:tt,shift:rt?J.getExtraLeftPx():0,stroke:z}}{const{str:tt}=J.getPositions()[z.getIndex()];return{line:tt,shift:0,stroke:z}}}),R=b,k=w.reduce((z,{stroke:J,shift:tt})=>(J.setXShift(R+tt),Math.max(J.getWidth()+0,z)),0);return a.left_shift+=k,!0}constructor(t,a){super(),this.setAttribute("type","Stroke"),this.note=null,this.options=l.Merge({},a),this.all_voices=!("all_voices"in this.options)||this.options.all_voices,this.note_end=null,this.index=null,this.type=t,this.position=Y.Position.LEFT,this.render_options={font_scale:38,stroke_px:3,stroke_spacing:10},this.font={family:"serif",size:10,weight:"bold italic"},this.setXShift(0),this.setWidth(10)}getCategory(){return G.CATEGORY}getPosition(){return this.position}addEndNote(t){return this.note_end=t,this}draw(){if(this.checkContext(),this.setRendered(),!this.note||null==this.index)throw new l.RERR("NoAttachedNote","Can't draw stroke without a note and index.");const t=this.note.getModifierStartXY(this.position,this.index);let a=this.note.getYs(),b=t.y,w=t.y;const R=t.x-5,k=this.note.stave.options.spacing_between_lines_px,z=this.getModifierContext().getModifiers(this.note.getCategory());for(let lt=0;lt<z.length;lt++){a=z[lt].getYs();for(let ft=0;ft<a.length;ft++)(this.note===z[lt]||this.all_voices)&&(b=l.Min(b,a[ft]),w=l.Max(w,a[ft]))}let J,tt,rt,at,ht;switch(this.type){case G.Type.BRUSH_DOWN:J="vc3",tt=-3,rt=b-k/2+10,w+=k/2;break;case G.Type.BRUSH_UP:J="v11",tt=.5,rt=w+k/2,b-=k/2;break;case G.Type.ROLL_DOWN:case G.Type.RASQUEDO_DOWN:J="vc3",tt=-3,at=this.x_shift+tt-2,this.note instanceof ot?(b+=1.5*k,w+=(w-b)%2!=0?.5*k:k,rt=b-k,ht=w+k+2):(b+=1.5*k,w+=k,rt=b-.75*k,ht=w+.25*k);break;case G.Type.ROLL_UP:case G.Type.RASQUEDO_UP:J="v52",tt=-4,at=this.x_shift+tt-1,this.note instanceof ot?(rt=k/2,b+=.5*k,(w-b)%2==0&&(w+=k/2),rt=w+.5*k,ht=b-1.25*k):(b+=.25*k,w+=.5*k,rt=w+.25*k,ht=b-k);break;case G.Type.ARPEGGIO_DIRECTIONLESS:b+=.5*k,w+=k;break;default:throw new l.RERR("InvalidType",`The stroke type ${this.type} does not exist`)}if(this.type===G.Type.BRUSH_DOWN||this.type===G.Type.BRUSH_UP)this.context.fillRect(R+this.x_shift,b,1,w-b);else if(this.note instanceof ot)for(let lt=b;lt<=w;lt+=k)m.renderGlyph(this.context,R+this.x_shift-4,lt,this.render_options.font_scale,"va3");else{let lt;for(lt=b;lt<=w;lt+=10)m.renderGlyph(this.context,R+this.x_shift-4,lt,this.render_options.font_scale,"va3");this.type===G.Type.RASQUEDO_DOWN&&(ht=lt+.25*k)}this.type!==G.Type.ARPEGGIO_DIRECTIONLESS&&(m.renderGlyph(this.context,R+this.x_shift+tt,rt,this.render_options.font_scale,J),this.type!==G.Type.RASQUEDO_DOWN&&this.type!==G.Type.RASQUEDO_UP||(this.context.save(),this.context.setFont(this.font.family,this.font.size,this.font.weight),this.context.fillText("R",R+at,ht),this.context.restore()))}}class K extends Y{static get CATEGORY(){return"stringnumber"}static format(t,a){const b=a.left_shift,w=a.right_shift;if(!t||0===t.length)return this;const R=[];let k,z,J,tt,rt,at=null,ht=0,lt=0;for(k=0;k<t.length;++k)for(z=t[k],J=z.getNote(),k=0;k<t.length;++k){z=t[k],J=z.getNote(),tt=z.getPosition();const Pt=J.getKeyProps()[z.getIndex()];if(J!==at){for(let Lt=0;Lt<J.keys.length;++Lt)rt=J.getKeyProps()[Lt],0===b&&(ht=rt.displaced?J.getExtraLeftPx():ht),0===w&&(lt=rt.displaced?J.getExtraRightPx():lt);at=J}R.push({pos:tt,note:J,num:z,line:Pt.line,shiftL:ht,shiftR:lt})}R.sort((Pt,Lt)=>Lt.line-Pt.line);let ft=0,bt=0,mt=0,xt=0,wt=null,Tt=null;for(k=0;k<R.length;++k){let Pt=0;J=R[k].note,tt=R[k].pos,z=R[k].num;const Lt=R[k].line;Lt===wt&&J===Tt||(ft=b+R[k].shiftL,bt=w+R[k].shiftR);const Gt=z.getWidth()+1;tt===Y.Position.LEFT?(z.setXShift(b),Pt=ht+Gt,mt=Pt>mt?Pt:mt):tt===Y.Position.RIGHT&&(z.setXShift(bt),Pt+=Gt,xt=Pt>xt?Pt:xt),wt=Lt,Tt=J}return a.left_shift+=mt,a.right_shift+=xt,!0}constructor(t){super(),this.setAttribute("type","StringNumber"),this.note=null,this.last_note=null,this.index=null,this.string_number=t,this.setWidth(20),this.position=Y.Position.ABOVE,this.x_shift=0,this.y_shift=0,this.x_offset=0,this.y_offset=0,this.dashed=!0,this.leg=x.LineEndType.NONE,this.radius=8,this.font={family:"sans-serif",size:10,weight:"bold"}}getCategory(){return K.CATEGORY}getNote(){return this.note}setNote(t){return this.note=t,this}getIndex(){return this.index}setIndex(t){return this.index=t,this}setLineEndType(t){return t>=x.LineEndType.NONE&&t<=x.LineEndType.DOWN&&(this.leg=t),this}setStringNumber(t){return this.string_number=t,this}setOffsetX(t){return this.x_offset=t,this}setOffsetY(t){return this.y_offset=t,this}setLastNote(t){return this.last_note=t,this}setDashed(t){return this.dashed=t,this}draw(){const t=this.checkContext();if(!this.note||null==this.index)throw new l.RERR("NoAttachedNote","Can't draw string number without a note and index.");this.setRendered();const a=this.note.stave.options.spacing_between_lines_px,b=this.note.getModifierStartXY(this.position,this.index);let w=b.x+this.x_shift+this.x_offset,R=b.y+this.y_shift+this.y_offset;switch(this.position){case Y.Position.ABOVE:case Y.Position.BELOW:{const z=this.note.getStemExtents();let J=z.topY,tt=z.baseY+2;this.note.stem_direction===ot.STEM_DOWN&&(J=z.baseY,tt=z.topY-2),R=this.position===Y.Position.ABOVE?this.note.hasStem()?J-1.75*a:b.y-1.75*a:this.note.hasStem()?tt+1.5*a:b.y+1.75*a,R+=this.y_shift+this.y_offset;break}case Y.Position.LEFT:w-=this.radius/2+5;break;case Y.Position.RIGHT:w+=this.radius/2+6;break;default:throw new l.RERR("InvalidPosition",`The position ${this.position}
1 is invalid`)}t.save(),t.beginPath(),t.arc(w,R,this.radius,0,2*Math.PI,!1),t.lineWidth=1.5,t.stroke(),t.setFont(this.font.family,this.font.size,this.font.weight);const k=w-t.measureText(this.string_number).width/2;if(t.fillText(""+this.string_number,k,R+4.5),null!=this.last_note){const z=this.last_note.getStemX()-this.note.getX()+5;let J,tt;switch(t.strokeStyle="#000000",t.lineCap="round",t.lineWidth=.6,x.drawDashedLine(t,w+10,R,w+z,R,this.dashed?[3,3]:[3,0]),this.leg){case x.LineEndType.UP:J=-10,tt=this.dashed?[3,3]:[3,0],x.drawDashedLine(t,w+z,R,w+z,R+J,tt);break;case x.LineEndType.DOWN:J=10,tt=this.dashed?[3,3]:[3,0],x.drawDashedLine(t,w+z,R,w+z,R+J,tt)}}t.restore()}}class q extends V{static getNextContext(t){const a=t.tContexts,b=a.indexOf(t);return a[b+1]}constructor(){super(),this.setAttribute("type","TickContext"),this.currentTick=new s(0,1),this.maxTicks=new s(0,1),this.minTicks=null,this.padding=3,this.x=0,this.xBase=0,this.xOffset=0,this.tickables=[],this.notePx=0,this.extraLeftPx=0,this.extraRightPx=0,this.tContexts=[]}getX(){return this.x}setX(t){return this.x=t,this.xBase=t,this.xOffset=0,this}getXBase(){return this.xBase}setXBase(t){this.xBase=t,this.x=t+this.xOffset}getXOffset(){return this.xOffset}setXOffset(t){this.xOffset=t,this.x=this.xBase+t}getWidth(){return this.width+2*this.padding}setPadding(t){return this.padding=t,this}getMaxTicks(){return this.maxTicks}getMinTicks(){return this.minTicks}getTickables(){return this.tickables}getCenterAlignedTickables(){return this.tickables.filter(t=>t.isCenterAligned())}getMetrics(){const{width:t,notePx:a,extraLeftPx:b,extraRightPx:w}=this;return{width:t,notePx:a,extraLeftPx:b,extraRightPx:w}}getCurrentTick(){return this.currentTick}setCurrentTick(t){this.currentTick=t,this.preFormatted=!1}getExtraPx(){let t=0,a=0,b=0,w=0;for(let R=0;R<this.tickables.length;R++){b=Math.max(this.tickables[R].extraLeftPx||0,b),w=Math.max(this.tickables[R].extraRightPx||0,w);const k=this.tickables[R].modifierContext;k&&null!=k&&(t=Math.max(t,k.state.left_shift),a=Math.max(a,k.state.right_shift))}return{left:t,right:a,extraLeft:b,extraRight:w}}addTickable(t){if(!t)throw new l.RERR("BadArgument","Invalid tickable added.");if(!t.shouldIgnoreTicks()){this.ignore_ticks=!1;const a=t.getTicks();a.greaterThan(this.maxTicks)&&(this.maxTicks=a.clone()),(null==this.minTicks||a.lessThan(this.minTicks))&&(this.minTicks=a.clone())}return t.setTickContext(this),this.tickables.push(t),this.preFormatted=!1,this}preFormat(){if(this.preFormatted)return this;for(let t=0;t<this.tickables.length;++t){const a=this.tickables[t];a.preFormat();const b=a.getMetrics();this.extraLeftPx=Math.max(this.extraLeftPx,b.extraLeftPx+b.modLeftPx),this.extraRightPx=Math.max(this.extraRightPx,b.extraRightPx+b.modRightPx),this.notePx=Math.max(this.notePx,b.noteWidth),this.width=this.notePx+this.extraLeftPx+this.extraRightPx}return this}postFormat(){return this.postFormatted||(this.postFormatted=!0),this}}const{ABOVE:Z,BELOW:et}=Y.Position,ct=(ut,t)=>.5*ut(t/.5),pt=(ut,t)=>t===Z?ut<=5:ut>=1,gt=(ut,t)=>pt(ut,t)?t===Z?Math.ceil:Math.floor:Math.round,Et=ut=>{const t=ut.getCategory();return"stavenotes"===t||"gracenotes"===t};class St extends Y{static get CATEGORY(){return"articulations"}static get INITIAL_OFFSET(){return-.5}static format(t,a){if(!t||0===t.length)return!1;const b=(R,k,z)=>ct(gt(k,z),R.glyph.getMetrics().height/10+.5);t.filter(R=>R.getPosition()===Z).forEach(R=>{R.setTextLine(a.top_text_line),a.top_text_line+=b(R,a.top_text_line,Z)}),t.filter(R=>R.getPosition()===et).forEach(R=>{R.setTextLine(a.text_line),a.text_line+=b(R,a.text_line,et)});const w=t.map(R=>R.getWidth()).reduce((R,k)=>Math.max(k,R));return a.left_shift+=w/2,a.right_shift+=w/2,!0}static easyScoreHook({articulations:t},a,b){if(!t)return;const w={staccato:"a.",tenuto:"a-"};t.split(",").map(R=>R.trim().split(".")).map(([R,k])=>{const z={type:w[R]};return k&&(z.position=Y.PositionString[k]),b.getFactory().Articulation(z)}).map(R=>a.addModifier(0,R))}constructor(t){if(super(),this.setAttribute("type","Articulation"),this.note=null,this.index=null,this.type=t,this.position=et,this.render_options={font_scale:38},this.breathMarkDistance=.8,this.articulation=p.articulationCodes(this.type),"abr"===this.type&&(this.articulation={code:"v6c",between_lines:!1}),!this.articulation)throw new l.RERR("ArgumentError",`Articulation not found: ${this.type}`);this.glyph=new m(this.articulation.code,this.render_options.font_scale),this.setWidth(this.glyph.getMetrics().width)}getCategory(){return St.CATEGORY}draw(){const{note:t,index:a,position:b,glyph:w,articulation:{between_lines:R},text_line:k,context:z}=this;if(this.checkContext(),!t||null==a)throw new l.RERR("NoAttachedNote","Can't draw Articulation without a note and index.");this.setRendered();const J=t.getStave(),tt=J.getSpacingBetweenLines(),rt="tabnotes"===t.getCategory();let{x:at}=t.getModifierStartXY(b,a);if("abr"===this.type){let mt=0;const xt=t.getTickContext(),wt=q.getNextContext(xt),Tt=xt.getX();if(wt&&wt.x>xt.x)mt=(wt.getX()-Tt)*this.breathMarkDistance;else{const Pt=t.getStave();mt=(Pt.getX()+Pt.getWidth()-Tt+Pt.start_x)*this.breathMarkDistance}if(at+=mt,at>J.end_x){const Pt=J.start_x+Tt;at=Pt+(J.end_x-Pt)*this.breathMarkDistance}}const ht=this.getXShift();ht&&(at+=ht);const lt=!R||rt,ft=((mt,xt)=>{const wt=xt===Z&&mt.getStemDirection()===_.UP||xt===et&&mt.getStemDirection()===_.DOWN;return Et(mt)?mt.hasStem()&&wt?.5:1:mt.hasStem()&&wt?1:0})(t,b);let bt={[Z]:()=>{w.setOrigin(.5,1);const mt=((xt,wt)=>{const Tt=xt.getStave(),Pt=xt.getStemDirection(),{topY:Lt,baseY:Ct}=xt.getStemExtents();if(Et(xt))return xt.hasStem()?Pt===_.UP?Lt:Ct:Math.min(...xt.getYs());if("tabnotes"===xt.getCategory())return xt.hasStem()&&Pt===_.UP?Lt:Tt.getYForTopText(wt);throw new l.RERR("UnknownCategory","Only can get the top and bottom ys of stavenotes and tabnotes")})(t,k)-(k+ft)*tt;return lt?Math.min(J.getYForTopText(St.INITIAL_OFFSET),mt):mt},[et]:()=>{w.setOrigin(.5,0);const mt=((xt,wt)=>{const Tt=xt.getStave(),Pt=xt.getStemDirection(),{topY:Lt,baseY:Ct}=xt.getStemExtents();if(Et(xt))return xt.hasStem()?Pt===_.UP?Ct:Lt:Math.max(...xt.getYs());if("tabnotes"===xt.getCategory())return xt.hasStem()?Pt===_.UP?Tt.getYForBottomText(wt):Lt:Tt.getYForBottomText(wt);throw new l.RERR("UnknownCategory","Only can get the top and bottom ys of stavenotes and tabnotes")})(t,k)+(k+ft)*tt;return lt?Math.max(J.getYForBottomText(St.INITIAL_OFFSET),mt):mt}}[b]();if(this.y_shift&&(bt+=this.y_shift),!rt){const mt=b===Z?-1:1,xt=rt?t.positions[a].str:t.getKeyProps()[a].line,wt=(t.getYs()[a]-bt)/tt+xt,Tt=((Pt,Lt,Ct,kt)=>{const Gt=ct(gt(Lt,Ct),Lt);return Pt&&pt(Gt,Ct)&&Gt%1==0?Gt+.5*-kt:Gt})(R,wt,b,mt);pt(Tt,b)&&w.setOrigin(.5,.5),bt+=Math.abs(Tt-wt)*tt*mt}(function(...mt){St.DEBUG&&l.L("Vex.Flow.Articulation",mt)})(`Rendering articulation at (x: ${at}, y: ${bt})`),w.render(z,at,bt)}}class Mt extends Y{static get CATEGORY(){return"ornaments"}
vendor: 5,432 bytes, line 1
1static format(t,a){if(!t||0===t.length)return!1;let b=0;for(let w=0;w<t.length;++w){const R=t[w],k=2;b=Math.max(R.getWidth(),b),R.getPosition()===Y.Position.ABOVE?(R.setTextLine(a.top_text_line),a.top_text_line+=k):(R.setTextLine(a.text_line),a.text_line+=k)}return a.left_shift+=b/2,a.right_shift+=b/2,!0}constructor(t){if(super(),this.setAttribute("type","Ornament"),this.note=null,this.index=null,this.type=t,this.position=Y.Position.ABOVE,this.delayed=!1,this.accidentalUpper=null,this.accidentalLower=null,this.render_options={font_scale:38,accidentalLowerPadding:3,accidentalUpperPadding:3},this.ornament=p.ornamentCodes(this.type),!this.ornament)throw new l.RERR("ArgumentError",`Ornament not found: '${this.type}'`);this.glyph=new m(this.ornament.code,this.render_options.font_scale),this.glyph.setOrigin(.5,1)}getCategory(){return Mt.CATEGORY}setDelayed(t){return this.delayed=t,this}setUpperAccidental(t){const a=this.render_options.font_scale/1.3;return this.accidentalUpper=new m(p.accidentalCodes(t).code,a),this.accidentalUpper.setOrigin(.5,1),this}setLowerAccidental(t){const a=this.render_options.font_scale/1.3;return this.accidentalLower=new m(p.accidentalCodes(t).code,a),this.accidentalLower.setOrigin(.5,1),this}draw(){if(this.checkContext(),!this.note||null==this.index)throw new l.RERR("NoAttachedNote","Can't draw Ornament without a note and index.");this.setRendered();const t=this.context,a=this.note.getStemDirection(),b=this.note.getStave(),w=this.note.getStem().getExtents();let R=a===ot.STEM_DOWN?w.baseY:w.topY;"tabnotes"===this.note.getCategory()&&(this.note.hasStem()?a===ot.STEM_DOWN&&(R=b.getYForTopText(this.text_line)):R=b.getYForTopText(this.text_line));const k=a===ot.STEM_DOWN,z=b.getSpacingBetweenLines();let J=1;!k&&this.note.beam&&(J+=.5);const tt=R-z*(this.text_line+J);let rt=this.note.getModifierStartXY(this.position,this.index).x,at=Math.min(b.getYForTopText(this.text_line),tt);if(at+=this.y_shift,this.delayed){let ht=0;if(void 0!==this.delayXShift)ht=this.delayXShift;else{ht+=this.glyph.getMetrics().width/2;const lt=q.getNextContext(this.note.getTickContext());ht+=lt?.5*(lt.getX()-rt):.5*(b.x+b.width-rt),this.delayXShift=ht}rt+=ht}(function(...ht){Mt.DEBUG&&l.L("Vex.Flow.Ornament",ht)})("Rendering ornament: ",this.ornament,rt,at),this.accidentalLower&&(this.accidentalLower.render(t,rt,at),at-=this.accidentalLower.getMetrics().height,at-=this.render_options.accidentalLowerPadding),this.glyph.render(t,rt,at),at-=this.glyph.getMetrics().height,this.accidentalUpper&&(at-=this.render_options.accidentalUpperPadding,this.accidentalUpper.render(t,rt,at))}}class yt extends Y{static get CATEGORY(){return"annotations"}static get Justify(){return{LEFT:1,CENTER:2,RIGHT:3,CENTER_STEM:4}}static get JustifyString(){return{left:yt.Justify.LEFT,right:yt.Justify.RIGHT,center:yt.Justify.CENTER,centerStem:yt.Justify.CENTER_STEM}}static get VerticalJustify(){return{TOP:1,CENTER:2,BOTTOM:3,CENTER_STEM:4}}static get VerticalJustifyString(){return{above:yt.VerticalJustify.TOP,top:yt.VerticalJustify.TOP,below:yt.VerticalJustify.BOTTOM,bottom:yt.VerticalJustify.BOTTOM,center:yt.VerticalJustify.CENTER,centerStem:yt.VerticalJustify.CENTER_STEM}}static format(t,a){if(!t||0===t.length)return!1;let b=0;for(let w=0;w<t.length;++w){const R=t[w];b=Math.max(R.getWidth(),b),R.getPosition()===Y.Position.ABOVE?(R.setTextLine(a.top_text_line),a.top_text_line++):(R.setTextLine(a.text_line),a.text_line++)}return a.left_shift+=b/2,a.right_shift+=b/2,!0}constructor(t){super(),this.setAttribute("type","Annotation"),this.note=null,this.index=null,this.text=t,this.justification=yt.Justify.CENTER,this.vert_justification=yt.VerticalJustify.TOP,this.font={family:"Arial",size:10,weight:""},this.setWidth(p.textWidth(t))}getCategory(){return yt.CATEGORY}setFont(t,a,b){return this.font={family:t,size:a,weight:b},this}setVerticalJustification(t){return this.vert_justification="string"==typeof t?yt.VerticalJustifyString[t]:t,this}getJustification(){return this.justification}setJustification(t){return this.justification="string"==typeof t?yt.JustifyString[t]:t,this}draw(){if(this.checkContext(),!this.note)throw new l.RERR("NoNoteForAnnotation","Can't draw text annotation without an attached note.");this.setRendered();const t=this.note.getModifierStartXY(Y.Position.ABOVE,this.index);this.context.save(),this.context.setFont(this.font.family,this.font.size,this.font.weight);const a=this.context.measureText(this.text).width,b=this.context.measureText("m").width;let w,R,k,z;w=this.justification===yt.Justify.LEFT?t.x:this.justification===yt.Justify.RIGHT?t.x-a:this.justification===yt.Justify.CENTER?t.x-a/2:this.note.getStemX()-a/2;const J=this.note.hasStem(),tt=this.note.getStave();if(J&&(k=this.note.getStem().getExtents(),z=tt.getSpacingBetweenLines()),this.vert_justification===yt.VerticalJustify.BOTTOM){if(R=tt.getYForBottomText(this.text_line+p.TEXT_HEIGHT_OFFSET_HACK),J){const rt=1===this.note.getStemDirection()?k.baseY:k.topY;R=Math.max(R,rt+z*(this.text_line+2))}}else if(this.vert_justification===yt.VerticalJustify.CENTER){const rt=this.note.getYForTopText(this.text_line)-1;R=rt+(tt.getYForBottomText(this.text_line)-rt)/2+b/2}else if(this.vert_justification===yt.VerticalJustify.TOP)R=Math.min(tt.getYForTopText(this.text_line),this.note.getYs()[0]-10),J&&(R=Math.min(R,k.topY-5-z*this.text_line));else{const rt=this.note.getStemExtents();R=rt.topY+(rt.baseY-rt.topY)/2+b/2}
1(function(...rt){yt.DEBUG&&l.L("Vex.Flow.Annotation",rt)})("Rendering annotation: ",this.text,w,R),this.context.fillText(this.text,w,R),this.context.restore()}}class vt extends Y{static get CATEGORY(){return"bends"}static get UP(){return 0}static get DOWN(){return 1}static format(t,a){if(!t||0===t.length)return!1;let b=0;const w=a.top_text_line;for(let R=0;R<t.length;++R){const k=t[R];k.setXShift(b),b=k.getWidth(),k.setTextLine(w)}return a.right_shift+=b,a.top_text_line+=1,!0}constructor(t,a,b){super(),this.setAttribute("type","Bend"),this.text=t,this.x_shift=0,this.release=a||!1,this.font="10pt Arial",this.render_options={line_width:1.5,line_style:"#777777",bend_width:8,release_width:8},b?this.phrase=b:(this.phrase=[{type:vt.UP,text:this.text}],this.release&&this.phrase.push({type:vt.DOWN,text:""})),this.updateWidth()}getCategory(){return vt.CATEGORY}setXShift(t){this.x_shift=t,this.updateWidth()}setFont(t){return this.font=t,this}getText(){return this.text}updateWidth(){const t=this;function a(w){let R;return R=t.context?t.context.measureText(w).width:p.textWidth(w),R}let b=0;for(let w=0;w<this.phrase.length;++w){const R=this.phrase[w];"width"in R||(R.width=l.Max(R.type===vt.UP?this.render_options.bend_width:this.render_options.release_width,a(R.text))+3,R.draw_width=R.width/2),b+=R.width}return this.setWidth(b+this.x_shift),this}draw(){if(this.checkContext(),!this.note||null==this.index)throw new l.RERR("NoNoteForBend","Can't draw bend without a note or index.");this.setRendered();const t=this.note.getModifierStartXY(Y.Position.RIGHT,this.index);t.x+=3,t.y+=.5;const a=this.x_shift,b=this.context,w=this.note.getStave().getYForTopText(this.text_line)+3,R=this.note.getStave().getYForTopText(this.text_line)-1,k=this;function z(lt,ft,bt,mt){const xt=lt+bt,wt=ft;b.save(),b.beginPath(),b.setLineWidth(k.render_options.line_width),b.setStrokeStyle(k.render_options.line_style),b.setFillStyle(k.render_options.line_style),b.moveTo(lt,ft),b.quadraticCurveTo(xt,wt,lt+bt,mt),b.stroke(),b.restore()}function J(lt,ft,bt,mt){b.save(),b.beginPath(),b.setLineWidth(k.render_options.line_width),b.setStrokeStyle(k.render_options.line_style),b.setFillStyle(k.render_options.line_style),b.moveTo(lt,mt),b.quadraticCurveTo(lt+bt,mt,lt+bt,ft),b.stroke(),b.restore()}function tt(lt,ft,bt){const mt=bt||1;b.beginPath(),b.moveTo(lt,ft),b.lineTo(lt-4,ft+4*mt),b.lineTo(lt+4,ft+4*mt),b.closePath(),b.fill()}function rt(lt,ft){b.save(),b.setRawFont(k.font);const bt=lt-b.measureText(ft).width/2;b.fillText(ft,bt,R),b.restore()}let at=null,ht=0;for(let lt=0;lt<this.phrase.length;
vendor: 8,320 bytes, line 1
1++lt){const ft=this.phrase[lt];0===lt&&(ft.draw_width_unmodified=ft.draw_width,ft.draw_width+=a),ht=ft.draw_width+(at?at.draw_width:0)-(1===lt?a:0),ft.type===vt.UP&&(at&&at.type===vt.UP&&tt(t.x,w),z(t.x,t.y,ht,w)),ft.type===vt.DOWN&&(at&&at.type===vt.UP&&J(t.x,t.y,ht,w),at&&at.type===vt.DOWN&&(tt(t.x,t.y,-1),J(t.x,t.y,ht,w)),null===at&&(ht=ft.draw_width,J(t.x,t.y,ht,w))),rt(t.x+ht,ft.text),at=ft,at.x=t.x,t.x+=ht}at.type===vt.UP?tt(at.x+ht,w):at.type===vt.DOWN&&tt(at.x+ht,t.y,-1);for(let lt=0;lt<this.phrase.length;++lt){const ft=this.phrase[lt];ft.draw_width_unmodified&&(ft.draw_width=ft.draw_width_unmodified)}}}class _t extends Y{static get CATEGORY(){return"vibratos"}static format(t,a,b){if(!t||0===t.length)return!1;let w=a.top_text_line,R=0,k=a.right_shift-7;const z=b.getModifiers(vt.CATEGORY);z&&z.length>0&&w--;for(let J=0;J<t.length;++J){const tt=t[J];tt.setXShift(k),tt.setTextLine(w),R+=tt.getWidth(),k+=R}return a.right_shift+=R,a.top_text_line+=1,!0}constructor(){super(),this.setAttribute("type","Vibrato"),this.position=Y.Position.RIGHT,this.render_options={harsh:!1,vibrato_width:20,wave_height:6,wave_width:4,wave_girth:2},this.setVibratoWidth(this.render_options.vibrato_width)}getCategory(){return _t.CATEGORY}setHarsh(t){return this.render_options.harsh=t,this}setVibratoWidth(t){return this.render_options.vibrato_width=t,this.setWidth(t),this}draw(){const t=this.checkContext();if(!this.note)throw new l.RERR("NoNoteForVibrato","Can't draw vibrato without an attached note.");this.setRendered();const a=this.note.getModifierStartXY(Y.Position.RIGHT,this.index).x+this.x_shift,b=this.note.getYForTopText(this.text_line)+2;_t.renderVibrato(t,a,b,this.render_options)}static renderVibrato(t,a,b,w){const{harsh:R,vibrato_width:k,wave_width:z,wave_girth:J,wave_height:tt}=w,rt=k/z;let at;if(t.beginPath(),R){for(t.moveTo(a,b+J+1),at=0;at<rt/2;++at)t.lineTo(a+z,b-tt/2),t.lineTo((a+=z)+z,b+tt/2),a+=z;for(at=0;at<rt/2;++at)t.lineTo(a-z,b-tt/2+J+1),t.lineTo((a-=z)-z,b+tt/2+J+1),a-=z;t.fill()}else{for(t.moveTo(a,b+J),at=0;at<rt/2;++at)t.quadraticCurveTo(a+z/2,b-tt/2,a+z,b),t.quadraticCurveTo((a+=z)+z/2,b+tt/2,a+z,b),a+=z;for(at=0;at<rt/2;++at)t.quadraticCurveTo(a-z/2,b+tt/2+J,a-z,b+J),t.quadraticCurveTo((a-=z)-z/2,b-tt/2+J,a-z,b+J),a-=z;t.fill()}}}function At(...ut){Nt.DEBUG&&l.L("Vex.Flow.ModifierContext",ut)}class Nt{constructor(){this.modifiers={},this.preFormatted=!1,this.postFormatted=!1,this.width=0,this.spacing=0,this.state={left_shift:0,right_shift:0,text_line:0,top_text_line:0},this.PREFORMAT=[ot,H,$,N,G,W,C,K,St,Mt,yt,vt,_t],this.POSTFORMAT=[ot]}addModifier(t){const a=t.getCategory();return this.modifiers[a]||(this.modifiers[a]=[]),this.modifiers[a].push(t),t.setModifierContext(this),this.preFormatted=!1,this}getModifiers(t){return this.modifiers[t]}getWidth(){return this.width}getExtraLeftPx(){return this.state.left_shift}getExtraRightPx(){return this.state.right_shift}getState(){return this.state}getMetrics(){if(!this.formatted)throw new l.RERR("UnformattedModifier","Unformatted modifier has no metrics.");return{width:this.state.left_shift+this.state.right_shift+this.spacing,spacing:this.spacing,extra_left_px:this.state.left_shift,extra_right_px:this.state.right_shift}}preFormat(){this.preFormatted||(this.PREFORMAT.forEach(t=>{At("Preformatting ModifierContext: ",t.CATEGORY),t.format(this.getModifiers(t.CATEGORY),this.state,this)}),this.width=this.state.left_shift+this.state.right_shift,this.preFormatted=!0)}postFormat(){this.postFormatted||this.POSTFORMAT.forEach(t=>{At("Postformatting ModifierContext: ",t.CATEGORY),t.postFormat(this.getModifiers(t.CATEGORY),this)})}}function Bt(ut,t,a,b){let w=t;for(a+=1;a<ut.length;a+=1){const R=ut[a];if(!R.isRest()&&!R.shouldIgnoreTicks()){w=R.getLineForRest();break}}if(b&&t!==w){const R=Math.max(t,w),k=Math.min(t,w);w=l.MidLine(R,k)}return w}function Ft(ut,t,a){if(!ut||!ut.length)throw new l.RERR("BadArgument","No voices to format");ut[0].getTotalTicks();const b=ut.reduce((z,J)=>{if(J.getMode()===D.Mode.STRICT&&!J.isComplete())throw new l.RERR("IncompleteVoice","Voice does not have enough notes.");return Math.max(z,s.LCM(z,J.getResolutionMultiplier()))},1),w={},R=[],k=[];return ut.forEach(z=>{const J=new s(0,b);z.getTickables().forEach(tt=>{const rt=J.numerator;if(!w[rt]){const at=new t;k.push(at),w[rt]=at}a(tt,w[rt]),R.push(rt),J.add(tt.getTicks())})}),{map:w,array:k,list:l.SortAndUnique(R,(z,J)=>z-J,(z,J)=>z===J),resolutionMultiplier:b}}class Ot{static SimpleFormat(t,a=0,{paddingBetween:b=10}={}){t.reduce((w,R)=>{R.addToModifierContext(new Nt);const k=(new q).addTickable(R).preFormat(),z=k.getExtraPx();return k.setX(w+z.left),w+k.getWidth()+z.right+b},a)}static plotDebugging(t,a,b,w,R){const k=b+j.STAVEPADDING,z=a.contextGaps;t.save(),t.setFont("Arial",8,""),z.gaps.forEach(J=>{var tt,rt;tt=k+J.x1,rt=k+J.x2,t.beginPath(),t.setStrokeStyle("#aaa"),t.setFillStyle("#aaa"),t.setLineWidth(1),t.fillRect(tt,w,rt-tt,R-w),t.fillText(Math.round(J.x2-J.x1),k+J.x1,R+12)}),t.fillText(Math.round(z.total)+"px",k-20,R+12),t.setFillStyle("red"),t.fillText("Loss: "+a.lossHistory.map(J=>Math.round(J)),k-20,R+22),t.restore()}static FormatAndDraw(t,a,b,w){const R={auto_beam:!1,align_rests:!1};"object"==typeof w?l.Merge(R,w):"boolean"==typeof w&&(R.auto_beam=w);const k=new D(p.TIME4_4).setMode(D.Mode.SOFT).addTickables(b),z=R.auto_beam?B.applyAndGetBeams(k):[];return(new Ot).joinVoices([k],{align_rests:R.align_rests}).formatToStave([k],a,{align_rests:R.align_rests,stave:a}),k.setStave(a).draw(t,a),z.forEach(J=>J.setContext(t).draw()),k.getBoundingBox()}static FormatAndDrawTab(t,a,b,w,R,k,z){const J={auto_beam:k,align_rests:!1};"object"==typeof z?l.Merge(J,z):"boolean"==typeof z&&(J.auto_beam=z);const tt=new D(p.TIME4_4).setMode(D.Mode.SOFT).addTickables(R),rt=new D(p.TIME4_4).setMode(D.Mode.SOFT).addTickables(w),at=J.auto_beam?B.applyAndGetBeams(tt):[];(new Ot).joinVoices([tt],{align_rests:J.align_rests}).joinVoices([rt]).formatToStave([tt,rt],b,{align_rests:J.align_rests}),tt.draw(t,b),rt.draw(t,a),at.forEach(ht=>ht.setContext(t).draw()),new F(b,a).setContext(t).draw()}static AlignRestsToNotes(t,a,b){return t.forEach((w,R)=>{if(w instanceof ot&&w.isRest()){if(w.tuplet&&!b)return;const k=w.getGlyph().position.toUpperCase();if("R/4"!==k&&"B/4"!==k)return;if(a||null!=w.beam){const z=w.getKeyProps()[0];if(0===R)z.line=Bt(t,z.line,R,!1),w.setKeyLine(0,z.line);else if(R>0&&R<t.length){let J;const tt=t[R-1];tt.isRest()&&tt.getKeyProps?(J=tt.getKeyProps()[0].line,z.line=J):(J=tt.getLineForRest(),z.line=Bt(t,J,R,!0)),w.setKeyLine(0,z.line)}}}}),this}constructor(){this.minTotalWidth=0,this.hasMinTotalWidth=!1,this.totalTicks=new s(0,1),this.tickContexts=null,this.modiferContexts=null,this.contextGaps={total:0,gaps:[]},this.voices=[]}alignRests(t,a){if(!t||!t.length)throw new l.RERR("BadArgument","No voices to format rests");t.forEach(b=>Ot.AlignRestsToNotes(b.getTickables(),a))}preCalculateMinTotalWidth(t){if(this.hasMinTotalWidth)return this.minTotalWidth;if(!this.tickContexts){if(!t)throw new l.RERR("BadArgument","'voices' required to run preCalculateMinTotalWidth");this.createTickContexts(t)}const{list:a,map:b}=this.tickContexts;return this.minTotalWidth=a.map(w=>{const R=b[w];return R.preFormat(),R.getWidth()}).reduce((w,R)=>w+R,0),this.hasMinTotalWidth=!0,this.minTotalWidth}getMinTotalWidth(){if(!this.hasMinTotalWidth)throw new l.RERR("NoMinTotalWidth","Call 'preCalculateMinTotalWidth' or 'preFormat' before calling 'getMinTotalWidth'");return this.minTotalWidth}createModifierContexts(t){const a=Ft(t,Nt,(b,w)=>b.addToModifierContext(w));return this.modiferContexts=a,a}createTickContexts(t){const a=Ft(t,q,(b,w)=>w.addTickable(b));return a.array.forEach(b=>{b.tContexts=a.array}),this.totalTicks=t[0].getTicksUsed().clone(),this.tickContexts=a,a}preFormat(t=0,a,b,w){const R=this.tickContexts,{list:k,map:z,resolutionMultiplier:J}=R;b&&w&&b.forEach(mt=>mt.setStave(w).preFormat());let tt=0,rt=0;const at=t/2;if(this.minTotalWidth=0,k.forEach(mt=>{const xt=z[mt];a&&xt.setContext(a),xt.preFormat();const wt=xt.getWidth();this.minTotalWidth+=wt;const Tt=xt.getMetrics();tt=tt+rt+Tt.extraLeftPx,xt.setX(tt),rt=wt-Tt.extraLeftPx}),this.minTotalWidth=tt+rt,this.hasMinTotalWidth=!0,t<=0)return;const ht=t-this.minTotalWidth;let lt=this.totalTicks.value();0===lt&&(lt=1);
1const ft=ht/(lt*J);let bt=0;k.forEach((mt,xt)=>{const Tt=z[mt];bt+=(mt-(k[xt-1]||0))*ft,Tt.setX(Tt.getX()+bt),Tt.getCenterAlignedTickables().forEach(Pt=>{Pt.center_x_shift=at-Tt.getX()})}),1!==k.length&&(this.justifyWidth=t,this.lossHistory=[],this.evaluate())}evaluate(){const t=this.justifyWidth;this.contextGaps={total:0,gaps:[]},this.tickContexts.list.forEach((w,R)=>{if(0===R)return;const z=this.tickContexts.map[this.tickContexts.list[R-1]],J=this.tickContexts.map[w],tt=z.getMetrics(),rt=z.getX()+tt.width,at=J.getX(),ht=at-rt;this.contextGaps.total+=ht,this.contextGaps.gaps.push({x1:rt,x2:at}),J.getFormatterMetrics().freedom.left=ht,z.getFormatterMetrics().freedom.right=ht});const a=this.durationStats={};this.voices.forEach(w=>{w.getTickables().forEach((R,k,z)=>{const J=R.getTicks().clone().simplify().toString(),tt=R.getMetrics(),rt=R.getFormatterMetrics(),at=R.getX()+tt.noteWidth+tt.modRightPx+tt.extraRightPx;let ht=0;if(k<z.length-1){const lt=z[k+1],ft=lt.getMetrics();ht=lt.getX()-ft.modLeftPx-ft.extraLeftPx-at,rt.space.used=lt.getX()-R.getX(),lt.getFormatterMetrics().freedom.left=ht}else ht=t-at,rt.space.used=t-R.getX();rt.freedom.right=ht,function(lt,ft){const bt=a[lt];void 0===bt?a[lt]={mean:ft,count:1}:(bt.count+=1,bt.mean=(bt.mean+ft)/2)}(J,rt.space.used)})});let b=0;return this.voices.forEach(w=>
vendor: 10,481 bytes, line 1
1{w.getTickables().forEach(R=>{const k=R.getTicks().clone().simplify().toString(),z=R.getFormatterMetrics();z.iterations+=1,z.space.deviation=z.space.used-a[k].mean,z.duration=k,z.space.mean=a[k].mean,b+=Math.pow(a[k].mean,2)})}),this.totalCost=Math.sqrt(b),this.lossHistory.push(this.totalCost),this}tune(){let t=0;return this.tickContexts.list.forEach((a,b,w)=>{const R=this.tickContexts.map[a],z=b<w.length-1?this.tickContexts.map[w[b+1]]:null;var rt,at,ht,lt;at=b>0?this.tickContexts.map[w[b-1]]:null,ht=z,lt=t,(rt=R).setX(rt.getX()+lt),rt.getFormatterMetrics().freedom.left+=lt,rt.getFormatterMetrics().freedom.right-=lt,at&&(at.getFormatterMetrics().freedom.right+=lt),ht&&(ht.getFormatterMetrics().freedom.left-=lt);const J=-R.getTickables().map(rt=>rt.getFormatterMetrics().space.deviation).reduce((rt,at)=>rt+at);J>0?t=-Math.min(R.getFormatterMetrics().freedom.right,Math.abs(J)):J<0&&(t=z?Math.min(z.getFormatterMetrics().freedom.right,Math.abs(J)):0);const tt=Math.min(5,Math.abs(t));t=t>0?tt:-tt}),this.evaluate()}postFormat(){const t=a=>a.list.forEach(b=>a.map[b].postFormat());return t(this.modiferContexts),t(this.tickContexts),this}joinVoices(t){return this.createModifierContexts(t),this.hasMinTotalWidth=!1,this}format(t,a,b){const w={align_rests:!1,context:null,stave:null};return l.Merge(w,b),this.voices=t,this.alignRests(t,w.align_rests),this.createTickContexts(t),this.preFormat(a,w.context,t,w.stave),w.stave&&this.postFormat(),this}formatToStave(t,a,b){const w=a.getNoteEndX()-a.getNoteStartX()-10;!function(...k){Ot.DEBUG&&l.L("Vex.Flow.Formatter",k)}("Formatting voices to width: ",w);const R={context:a.getContext()};return l.Merge(R,b),this.format(t,w,R)}}class It extends o{static get Position(){return{LEFT:1,RIGHT:2,ABOVE:3,BELOW:4,BEGIN:5,END:6}}constructor(){super(),this.setAttribute("type","StaveModifier"),this.padding=10,this.position=It.Position.ABOVE,this.layoutMetrics=null}getPosition(){return this.position}setPosition(t){return this.position=t,this}getStave(){return this.stave}setStave(t){return this.stave=t,this}getWidth(){return this.width}setWidth(t){return this.width=t,this}getX(){return this.x}setX(t){return this.x=t,this}getCategory(){return""}makeSpacer(t){return{getContext:()=>!0,setStave(){},renderToStave(){},getMetrics:()=>({width:t})}}placeGlyphOnLine(t,a,b){t.setYShift(a.getYForLine(b)-a.getYForGlyphs())}getPadding(t){return void 0!==t&&t<2?0:this.padding}setPadding(t){return this.padding=t,this}setLayoutMetrics(t){return this.layoutMetrics=t,this}getLayoutMetrics(){return this.layoutMetrics}}class Rt extends It{static get CATEGORY(){return"barlines"}static get type(){return{SINGLE:1,DOUBLE:2,END:3,REPEAT_BEGIN:4,REPEAT_END:5,REPEAT_BOTH:6,NONE:7,DOUBLE_HEAVY:8}}static get typeString(){return{single:Rt.type.SINGLE,double:Rt.type.DOUBLE,doubleheavy:Rt.type.DOUBLE_HEAVY,end:Rt.type.END,repeatBegin:Rt.type.REPEAT_BEGIN,repeatEnd:Rt.type.REPEAT_END,repeatBoth:Rt.type.REPEAT_BOTH,none:Rt.type.NONE}}constructor(t){super(),this.setAttribute("type","Barline"),this.thickness=p.STAVE_LINE_THICKNESS;const a=Rt.type;this.widths={},this.widths[a.SINGLE]=5,this.widths[a.DOUBLE]=5,this.widths[a.DOUBLE_HEAVY]=5,this.widths[a.END]=5,this.widths[a.REPEAT_BEGIN]=5,this.widths[a.REPEAT_END]=5,this.widths[a.REPEAT_BOTH]=5,this.widths[a.NONE]=5,this.paddings={},this.paddings[a.SINGLE]=0,this.paddings[a.DOUBLE]=0,this.paddings[a.DOUBLE_HEAVY]=0,this.paddings[a.END]=5,this.paddings[a.REPEAT_BEGIN]=10,this.paddings[a.REPEAT_END]=10,this.paddings[a.REPEAT_BOTH]=15,this.paddings[a.NONE]=0,this.layoutMetricsMap={},this.layoutMetricsMap[a.SINGLE]={xMin:0,xMax:1,paddingLeft:5,paddingRight:5},this.layoutMetricsMap[a.DOUBLE]={xMin:-3,xMax:1,paddingLeft:5,paddingRight:5},this.layoutMetricsMap[a.DOUBLE_HEAVY]={xMin:-5,xMax:4,paddingLeft:5,paddingRight:5},this.layoutMetricsMap[a.END]={xMin:-5,xMax:1,paddingLeft:5,paddingRight:5},this.layoutMetricsMap[a.REPEAT_END]={xMin:-10,xMax:1,paddingLeft:5,paddingRight:5},this.layoutMetricsMap[a.REPEAT_BEGIN]={xMin:-2,xMax:10,paddingLeft:5,paddingRight:5},this.layoutMetricsMap[a.REPEAT_BOTH]={xMin:-10,xMax:10,paddingLeft:5,paddingRight:5},this.layoutMetricsMap[a.NONE]={xMin:0,xMax:0,paddingLeft:5,paddingRight:5},this.setPosition(It.Position.BEGIN),this.setType(t)}getCategory(){return Rt.CATEGORY}getType(){return this.type}setType(t){return this.type="string"==typeof t?Rt.typeString[t]:t,this.setWidth(this.widths[this.type]),this.setPadding(this.paddings[this.type]),this.setLayoutMetrics(this.layoutMetricsMap[this.type]),this}draw(t){switch(t.checkContext(),this.setRendered(),this.type){case Rt.type.SINGLE:this.drawVerticalBar(t,this.x,!1);break;case Rt.type.DOUBLE:this.drawVerticalBar(t,this.x,!0);break;case Rt.type.DOUBLE_HEAVY:this.drawVerticalBar(t,this.x,!0,!0);break;case Rt.type.END:this.drawVerticalEndBar(t,this.x);break;case Rt.type.REPEAT_BEGIN:this.drawRepeatBar(t,this.x,!0),t.getX()!==this.x&&this.drawVerticalBar(t,t.getX());break;case Rt.type.REPEAT_END:this.drawRepeatBar(t,this.x,!1);break;case Rt.type.REPEAT_BOTH:this.drawRepeatBar(t,this.x,!1),this.drawRepeatBar(t,this.x,!0)}}drawVerticalBar(t,a,b,w){t.checkContext();const R=t.getTopLineTopY(),k=t.getBottomLineBottomY();let z=1,J=1,tt=a-3,rt=a;w&&(z=3,J=3,tt=a-5,rt=a),b&&t.context.fillRect(tt,R,z,k-R),t.context.fillRect(rt,R,J,k-R)}drawVerticalEndBar(t,a){t.checkContext();const b=t.getTopLineTopY(),w=t.getBottomLineBottomY();t.context.fillRect(a-5,b,1,w-b),t.context.fillRect(a-2,b,3,w-b)}drawRepeatBar(t,a,b){t.checkContext();const w=t.getTopLineTopY(),R=t.getBottomLineBottomY();let k=3;b||(k=-5),t.context.fillRect(a+k,w,1,R-w),t.context.fillRect(a-2,w,3,R-w),b?k+=4:k-=4;const z=a+k+1;let J=(t.getNumLines()-1)*t.getSpacingBetweenLines();J=J/2-t.getSpacingBetweenLines()/2;let tt=w+J+1;t.context.beginPath(),t.context.arc(z,tt,2,0,2*Math.PI,!1),t.context.fill(),tt+=t.getSpacingBetweenLines(),t.context.beginPath(),t.context.arc(z,tt,2,0,2*Math.PI,!1),t.context.fill()}}class Dt extends It{static get CATEGORY(){return"repetitions"}static get type(){return{NONE:1,CODA_LEFT:2,CODA_RIGHT:3,SEGNO_LEFT:4,SEGNO_RIGHT:5,DC:6,DC_AL_CODA:7,DC_AL_FINE:8,DS:9,DS_AL_CODA:10,DS_AL_FINE:11,FINE:12,TO_CODA:13}}constructor(t,a,b){super(),this.setAttribute("type","Repetition"),this.symbol_type=t,this.x=a,this.x_shift=0,this.y_shift=b,this.font={family:"times",size:12,weight:"bold italic"}}getCategory(){return Dt.CATEGORY}setShiftX(t){return this.x_shift=t,this}setShiftY(t){return this.y_shift=t,this}setX(t){return this.x=t,this}draw(t,a){switch(this.setRendered(),this.symbol_type){case Dt.type.CODA_RIGHT:this.drawCodaFixed(t,a+t.width);break;case Dt.type.CODA_LEFT:this.drawSymbolText(t,a,"Coda",!0);break;case Dt.type.SEGNO_LEFT:this.drawSignoFixed(t,a);break;case Dt.type.SEGNO_RIGHT:this.drawSignoFixed(t,a+t.width);break;case Dt.type.DC:this.drawSymbolText(t,a,"D.C.",!1);break;case Dt.type.DC_AL_CODA:this.drawSymbolText(t,a,"D.C. al",!0);break;case Dt.type.DC_AL_FINE:this.drawSymbolText(t,a,"D.C. al Fine",!1);break;case Dt.type.DS:this.drawSymbolText(t,a,"D.S.",!1);break;case Dt.type.DS_AL_CODA:this.drawSymbolText(t,a,"D.S. al",!0);break;case Dt.type.DS_AL_FINE:this.drawSymbolText(t,a,"D.S. al Fine",!1);break;case Dt.type.FINE:this.drawSymbolText(t,a,"Fine",!1);break;case Dt.type.TO_CODA:this.drawSymbolText(t,a,"To",!0)}return this}drawCodaFixed(t,a){const b=t.getYForTopText(t.options.num_lines)+this.y_shift;return m.renderGlyph(t.context,this.x+a+this.x_shift,b+25,40,"v4d",!0),this}drawSignoFixed(t,a){const b=t.getYForTopText(t.options.num_lines)+this.y_shift;return m.renderGlyph(t.context,this.x+a+this.x_shift,b+25,30,"v8c",!0),this}drawSymbolText(t,a,b,w){const R=t.checkContext();R.save(),R.setFont(this.font.family,this.font.size,this.font.weight);let k=0+this.x_shift,z=a+this.x_shift;this.symbol_type===Dt.type.CODA_LEFT?(k=this.x+this.x_shift,z=k+R.measureText(b).width+12):(this.x_shift=-(k+R.measureText(b).width+12+t.options.vertical_bar_width+12),k=this.x+this.x_shift+t.options.vertical_bar_width,z=k+R.measureText(b).width+12),this.xShiftAsPercentOfStaveWidth&&(this.symbol_type!==Dt.type.DC_AL_FINE&&this.symbol_type!==Dt.type.FINE&&this.symbol_type!==Dt.type.DC&&this.symbol_type!==Dt.type.DS_AL_FINE&&this.symbol_type!==Dt.type.DS&&this.symbol_type!==Dt.type.FINE||(k+=t.width*this.xShiftAsPercentOfStaveWidth));const J=t.getYForTopText(t.options.num_lines)+this.y_shift+25;return w&&m.renderGlyph(R,z,J,40,"v4d",!0),R.fillText(b,k,J+5),R.restore(),this}}class ie extends It{static get CATEGORY(){return"stavesection"}constructor(t,a,b){super(),this.setAttribute("type","StaveSection"),this.setWidth(16),this.section=t,this.x=a,this.shift_x=0,this.shift_y=b,this.font={family:"sans-serif",size:12,weight:"bold"}}getCategory(){return ie.CATEGORY}setStaveSection(t){return this.section=t,this}setShiftX(t){return this.shift_x=t,this}setShiftY(t){return this.shift_y=t,this}draw(t,a){const b=t.checkContext();this.setRendered(),b.save(),b.lineWidth=2,b.setFont(this.font.family,this.font.size,this.font.weight);const w=b.measureText(""+this.section),R=w.width;let k=w.height;!k&&w.emHeightAscent>=0&&(k=w.emHeightAscent+2),k||(k=w.fontBoundingBoxAscent+3);let z=R+6;z<18&&(z=18);const J=k+this.font.size/10,tt=t.getYForTopText(3)+19-1.15*J+this.shift_y;let rt=this.x+a;return b.beginPath(),b.lineWidth=2,b.rect(rt,tt+k/4,z,J),b.stroke(),rt+=(z-R)/2,b.fillText(""+this.section,rt,tt+J),b.restore(),this}}class se extends It{static get CATEGORY(){return"stavetempo"}constructor(t,a,b){super(),this.setAttribute("type","StaveTempo"),this.tempo=t,this.position=Y.Position.ABOVE,this.x=a,this.shift_x=10,this.shift_y=b,this.font={family:"times",size:14,weight:"bold"},this.render_options={glyph_font_scale:30}}getCategory(){return se.CATEGORY}setTempo(t){return this.tempo=t,this}setShiftX(t){return this.shift_x=t,this}setShiftY(t){return this.shift_y=t,this}draw(t,a){const b=t.checkContext();this.setRendered(),b.openGroup("stavetempo");const w=this.render_options,R=w.glyph_font_scale/38,k=this.tempo.name,z=this.tempo.duration,J=this.tempo.dots,tt=this.tempo.bpm,rt=this.tempo.noteEquation,at=this.font;let ht=this.x+this.shift_x+a;const lt=t.getYForTopText(1)+this.shift_y;if(b.save(),k&&(b.setFont(at.family,at.size,at.weight),b.fillText(k,ht,lt),ht+=b.measureText(k).width),rt)ht=this.drawNoteEquation(b,ht,lt,R,rt);else if(z&&tt){b.setFont(at.family,at.size,"normal"),k&&(ht+=b.measureText(" ").width,b.fillText("(",ht,lt),ht+=b.measureText("(").width);
1const ft=p.getGlyphProps(z);if(ht+=3*R,m.renderGlyph(b,ht,lt,w.glyph_font_scale,ft.code_head),ht+=ft.getWidth()*R,ft.stem){let bt=30;ft.beam_count&&(bt+=3*(ft.beam_count-1)),bt*=R;const mt=lt-bt;b.fillRect(ht-R,mt,R,bt),ft.flag&&(m.renderGlyph(b,ht,mt,w.glyph_font_scale,ft.code_flag_upstem),J||(ht+=6*R))}for(let bt=0;bt<J;bt++)ht+=6*R,b.beginPath(),b.arc(ht,lt+2*R,2*R,0,2*Math.PI,!1),b.fill();b.openGroup("bpm"),b.fillText(" = "+tt+(k?")":""),ht+3*R,lt),b.closeGroup()}return b.closeGroup(),b.restore(),this}drawNoteEquation(t,a,b,w,R){const k=this.font,z=4*w;return a=this.drawNoteGroup(t,a,b,w,z,R.left),t.setFont(k.family,k.size,"bold"),t.fillText("=",a+=1.5*z,b),a+=t.measureText("=").width+1.5*z,this.drawNoteGroup(t,a,b,w,z,R.right)}drawNoteGroup(t,a,b,w,R,k){const z=this.render_options,J=k.notes,tt=k.tuplet,rt=[],at=[];let ht=[];for(let ft=0;ft<J.length;ft++){const bt=J[ft],mt=p.getGlyphProps(bt.duration);if(!mt)continue;const xt=a+=3*w;m.renderGlyph(t,a,b,z.glyph_font_scale,mt.code_head);let wt=b;const Tt=a+=mt.getWidth()*w;if(mt.stem){let Lt=30;Lt*=w,wt=b-Lt,t.fillRect(a-w,wt,w,Lt),mt.flag&&!bt.beam&&(m.renderGlyph(t,a,wt,z.glyph_font_scale,mt.code_flag_upstem),bt.dots||(a+=6*w))}for(let Lt=0;Lt<(bt.dots||0);Lt++)a+=6*w,t.beginPath(),t.arc(a,b+2*w,2*w,0,2*Math.PI,!1),t.fill();const Pt={x:xt,y_top:wt,stemX:Tt,code:mt};rt.push(Pt),"begin"===bt.beam?ht=[Pt]:"continue"===bt.beam?ht.push(Pt):"end"===bt.beam&&(ht.push(Pt),at.push(ht),ht=[]),ft<J.length-1&&(a+=tt?2*R:R)}const lt=3*w;for(const ft of at){if(ft.length<2)continue;const bt=ft[0],mt=ft[ft.length-1];let xt=0;for(const wt of ft)wt.code.beam_count&&(xt=Math.max(xt,wt.code.beam_count));for(let wt=0;wt<xt;wt++)t.fillRect(bt.stemX-w,bt.y_top+wt*(lt+1*w),mt.stemX-bt.stemX+w,lt)}if(tt&&rt.length>0){const ft=rt[0],bt=rt[rt.length-1];let mt=ft.y_top;for(const Lt of rt)mt=Math.min(mt,Lt.y_top);const wt=mt-1.5*R,Tt=ft.x-.5*R,Pt=bt.stemX+1.25*R;if(tt.bracket){const Lt=R;t.beginPath(),t.moveTo(Tt,wt+Lt),t.lineTo(Tt,wt);const Ct=(Tt+Pt)/2,kt="both"===tt.showNumber?`${tt.actualNotes}:${tt.normalNotes}`:`${tt.actualNotes}`;t.setFont(this.font.family,this.font.size-3,"bold");const Gt=t.measureText(kt).width,zt=Gt/2+2*w;t.lineTo(Ct-zt,wt),t.stroke(),t.beginPath(),t.moveTo(Ct+zt,wt),t.lineTo(Pt,wt),t.lineTo(Pt,wt+Lt),t.stroke(),t.fillText(kt,Ct-Gt/2,wt-1*w)}else if("none"!==tt.showNumber){const Lt=(Tt+Pt)/2,Ct="both"===tt.showNumber?`${tt.actualNotes}:${tt.normalNotes}`:`${tt.actualNotes}`;t.setFont(this.font.family,this.font.size-3,"bold");const kt=t.measureText(Ct).width;t.fillText(Ct,Lt-kt/2,wt-1*w)}}return a}}
vendor: 82,533 bytes, line 1
1class Xt extends j{static get Justification(){return{LEFT:1,CENTER:2,RIGHT:3}}static get GLYPHS(){return{segno:{code:"v8c",point:40,x_shift:0,y_shift:-10},tr:{code:"v1f",point:40,x_shift:0,y_shift:0},mordent_upper:{code:"v1e",point:40,x_shift:0,y_shift:0},mordent_lower:{code:"v45",point:40,x_shift:0,y_shift:0},f:{code:"vba",point:40,x_shift:0,y_shift:0},p:{code:"vbf",point:40,x_shift:0,y_shift:0},m:{code:"v62",point:40,x_shift:0,y_shift:0},s:{code:"v4a",point:40,x_shift:0,y_shift:0},z:{code:"v80",point:40,x_shift:0,y_shift:0},coda:{code:"v4d",point:40,x_shift:0,y_shift:-8},pedal_open:{code:"v36",point:40,x_shift:0,y_shift:0},pedal_close:{code:"v5d",point:40,x_shift:0,y_shift:3},caesura_straight:{code:"v34",point:40,x_shift:0,y_shift:2},caesura_curved:{code:"v4b",point:40,x_shift:0,y_shift:2},breath:{code:"v6c",point:40,x_shift:0,y_shift:0},tick:{code:"v6f",point:50,x_shift:0,y_shift:0},turn:{code:"v72",point:40,x_shift:0,y_shift:0},turn_inverted:{code:"v33",point:40,x_shift:0,y_shift:0},mordent:{code:"v1e",point:40,x_shift:0,y_shift:0}}}constructor(t){if(super(t),this.setAttribute("type","TextNote"),this.text=t.text,this.superscript=t.superscript,this.subscript=t.subscript,this.glyph_type=t.glyph,this.glyph=null,this.font={family:"Arial",size:12,weight:""},t.font&&(this.font=t.font),this.glyph_type){const a=Xt.GLYPHS[this.glyph_type];if(!a)throw new l.RERR("Invalid glyph type: "+this.glyph_type);this.glyph=new m(a.code,a.point,{cache:!1}),this.setWidth(a.width?a.width:this.glyph.getMetrics().width),this.glyph_struct=a}else this.setWidth(p.textWidth(this.text));this.line=t.line||0,this.smooth=t.smooth||!1,this.ignore_ticks=t.ignore_ticks||!1,this.justification=Xt.Justification.LEFT}setJustification(t){return this.justification=t,this}setLine(t){return this.line=t,this}preFormat(){this.checkContext(),this.preFormatted||(this.smooth?this.setWidth(0):this.glyph||this.setWidth(this.context.measureText(this.text).width),this.justification===Xt.Justification.CENTER?this.extraLeftPx=this.width/2:this.justification===Xt.Justification.RIGHT&&(this.extraLeftPx=this.width),this.setPreFormatted(!0))}draw(){if(this.checkContext(),!this.stave)throw new l.RERR("NoStave","Can't draw without a stave.");this.setRendered();const t=this.context;let a,b=this.getAbsoluteX();if(this.justification===Xt.Justification.CENTER?b-=this.getWidth()/2:this.justification===Xt.Justification.RIGHT&&(b-=this.getWidth()),this.glyph)a=this.stave.getYForLine(this.line+-3),this.glyph.render(this.context,b+this.glyph_struct.x_shift,a+this.glyph_struct.y_shift);else{a=this.stave.getYForLine(this.line+-3),this.applyStyle(t),t.setFont(this.font.family,this.font.size,this.font.weight),t.fillText(this.text,b,a);const w=t.measureText("M").width,R=t.measureText(this.text).width;this.superscript&&(t.setFont(this.font.family,this.font.size/1.3,this.font.weight),t.fillText(this.superscript,b+R+2,a-w/2.2)),this.subscript&&(t.setFont(this.font.family,this.font.size/1.3,this.font.weight),t.fillText(this.subscript,b+R+2,a+w/2.2-1)),this.restoreStyle(t)}}}class oe extends It{static get CATEGORY(){return"stavetext"}constructor(t,a,b){super(),this.setAttribute("type","StaveText"),this.setWidth(16),this.text=t,this.position=a,this.options={shift_x:0,shift_y:0,justification:Xt.Justification.CENTER},l.Merge(this.options,b),this.font={family:"times",size:16,weight:"normal"}}getCategory(){return oe.CATEGORY}setStaveText(t){return this.text=t,this}setShiftX(t){return this.shift_x=t,this}setShiftY(t){return this.shift_y=t,this}setFont(t){l.Merge(this.font,t)}setText(t){this.text=t}draw(t){const a=t.checkContext();this.setRendered(),a.save(),a.lineWidth=2,a.setFont(this.font.family,this.font.size,this.font.weight);const b=a.measureText(""+this.text).width;let w,R;const k=It.Position,z=Xt.Justification;switch(this.position){case k.LEFT:case k.RIGHT:R=(t.getYForLine(0)+t.getBottomLineY())/2+this.options.shift_y,w=this.position===k.LEFT?t.getX()-b-24+this.options.shift_x:t.getX()+t.getWidth()+24+this.options.shift_x;break;case k.ABOVE:case k.BELOW:w=t.getX()+this.options.shift_x,this.options.justification===z.CENTER?w+=t.getWidth()/2-b/2:this.options.justification===z.RIGHT&&(w+=t.getWidth()-b),R=this.position===k.ABOVE?t.getYForTopText(2)+this.options.shift_y:t.getYForBottomText(2)+this.options.shift_y;break;default:throw new l.RERR("InvalidPosition","Value Must be in Modifier.Position.")}return a.fillText(""+this.text,w,R+4),a.restore(),this}}class Qt extends It{static get CATEGORY(){return"clefs"}static get types(){return{treble:{code:"v83",line:3},bass:{code:"v79",line:1},alto:{code:"vad",line:2},tenor:{code:"vad",line:1},percussion:{code:"v59",line:2},soprano:{code:"vad",line:4},"mezzo-soprano":{code:"vad",line:3},"baritone-c":{code:"vad",line:0},"baritone-f":{code:"v79",line:2},subbass:{code:"v79",line:0},french:{code:"v83",line:4},tab:{code:"v2f"}}}static get sizes(){return{default:{point:40,width:26},small:{point:32,width:20}}}static get annotations(){return{"8va":{code:"v8",sizes:{default:{point:20,attachments:{treble:{line:-1.2,x_shift:11}}},small:{point:18,attachments:{treble:{line:-.4,x_shift:8}}}}},"8vb":{code:"v8",sizes:{default:{point:20,attachments:{treble:{line:6.3,x_shift:10},bass:{line:4,x_shift:1}}},small:{point:18,attachments:{treble:{line:5.8,x_shift:6},bass:{line:3.5,x_shift:.5}}}}}}}constructor(t,a,b){super(),this.setAttribute("type","Clef"),this.setPosition(It.Position.BEGIN),this.setType(t,a,b),this.setWidth(Qt.sizes[this.size].width),function(...w){Qt.DEBUG&&l.L("Vex.Flow.Clef",w)}("Creating clef:",t)}getCategory(){return Qt.CATEGORY}setType(t,a,b){if(this.type=t,this.clef=Qt.types[t],this.size=void 0===a?"default":a,this.clef.point=Qt.sizes[this.size].point,this.glyph=new m(this.clef.code,this.clef.point),void 0!==b){const w=Qt.annotations[b];this.annotation={code:w.code,point:w.sizes[this.size].point,line:w.sizes[this.size].attachments[this.type].line,x_shift:w.sizes[this.size].attachments[this.type].x_shift},this.attachment=new m(this.annotation.code,this.annotation.point),this.attachment.metrics.x_max=0,this.attachment.setXShift(this.annotation.x_shift)}else this.annotation=void 0;return this}getWidth(){if("tab"===this.type&&!this.stave)throw new l.RERR("ClefError","Can't get width without stave.");return this.width}setStave(t){if(this.stave=t,"tab"!==this.type)return this;let a,b;const w=this.stave.getOptions().num_lines;switch(w){case 8:a=55,b=14;break;case 7:a=47,b=8;break;case 6:a=40,b=1;break;case 5:a=30,b=-6;break;case 4:a=23,b=-12;break;case 3:a=16,b=-18;break;default:throw new l.RERR("ClefError",`Invalid number of lines: ${w}`)}return this.glyph.setPoint(a),this.glyph.setYShift(b),this}draw(){if(!this.x)throw new l.RERR("ClefError","Can't draw clef without x.");if(!this.stave)throw new l.RERR("ClefError","Can't draw clef without stave.");this.setRendered(),this.glyph.setStave(this.stave),this.glyph.setContext(this.stave.context),void 0!==this.clef.line&&this.placeGlyphOnLine(this.glyph,this.stave,this.clef.line),this.stave.context.openGroup("clef"),this.glyph.renderToStave(this.x),void 0!==this.annotation&&(this.placeGlyphOnLine(this.attachment,this.stave,this.annotation.line),this.attachment.setStave(this.stave),this.attachment.setContext(this.stave.context),this.attachment.renderToStave(this.x)),this.stave.context.closeGroup()}}class Wt extends It{static get CATEGORY(){return"keysignatures"}static get accidentalSpacing(){return{"#":{above:6,below:4},b:{above:4,below:7},n:{above:4,below:1},"##":{above:6,below:4},bb:{above:4,below:7},db:{above:4,below:7},d:{above:4,below:7},bbs:{above:4,below:7},"++":{above:6,below:4},"+":{above:6,below:4},"+-":{above:6,below:4},"++-":{above:6,below:4},bs:{above:4,below:10},bss:{above:4,below:10}}}constructor(t,a,b){super(),this.setAttribute("type","KeySignature"),this.setKeySig(t,a,b),this.setPosition(It.Position.BEGIN),this.glyphFontScale=38,this.glyphs=[],this.xPositions=[],this.paddingForced=!1}getCategory(){return Wt.CATEGORY}convertToGlyph(t,a){const b=p.accidentalCodes(t.type),w=new m(b.code,this.glyphFontScale);let R=1;if("n"===t.type&&a){const J=Wt.accidentalSpacing[a.type];J&&(R=a.line>=t.line?J.above:J.below)}this.placeGlyphOnLine(w,this.stave,t.line),this.glyphs.push(w);const k=this.xPositions[this.xPositions.length-1],z=w.getMetrics().width+R;this.xPositions.push(k+z),this.width+=z}cancelKey(t){return this.formatted=!1,this.cancelKeySpec=t,this}convertToCancelAccList(t){const a=p.keySignature(t),b=this.accList.length>0&&a.length>0&&a[0].type!==this.accList[0].type,w=b?a.length:a.length-this.accList.length;if(w<1)return;const R=[];for(let k=0;k<w;k++){let z=k;b||(z=a.length-w+k),R.push({type:"n",line:a[z].line})}return this.accList=R.concat(this.accList),{accList:R,type:a[0].type}}addToStave(t){return this.paddingForced=!0,t.addModifier(this),this}convertAccLines(t,a,b=this.accList){let w,R,k=0;switch(t){case"soprano":"#"===a?w=[2.5,.5,2,0,1.5,-.5,1]:k=-1;break;case"mezzo-soprano":"b"===a?w=[0,2,.5,2.5,1,3,1.5]:k=1.5;break;case"alto":k=.5;break;case"tenor":"#"===a?w=[3,1,2.5,.5,2,0,1.5]:k=-.5;break;case"baritone-f":case"baritone-c":"b"===a?w=[.5,2.5,1,3,1.5,3.5,2]:k=2;break;case"bass":case"french":k=1}if(void 0!==w)for(R=0;R<b.length;++R)b[R].line=w[R];else if(0!==k)for(R=0;R<b.length;++R)b[R].line+=k}getPadding(t){return this.formatted||this.format(),0===this.glyphs.length||!this.paddingForced&&t<2?0:this.padding}getWidth(){return this.formatted||this.format(),this.width}setKeySig(t,a,b){return this.formatted=!1,this.keySpec=t,this.cancelKeySpec=a,this.alterKeySpec=b,this}alterKey(t){return this.formatted=!1,this.alterKeySpec=t,this}convertToAlterAccList(t){const a=Math.min(t.length,this.accList.length);for(let b=0;b<a;++b)t[b]&&(this.accList[b].type=t[b])}format(){if(!this.stave)throw new l.RERR("KeySignatureError","Can't draw key signature without stave.");this.width=0,this.glyphs=[],this.xPositions=[0],this.accList=p.keySignature(this.keySpec);const t=this.accList,a=t.length>0?t[0].type:null;let b;if(this.cancelKeySpec&&(b=this.convertToCancelAccList(this.cancelKeySpec)),this.alterKeySpec&&this.convertToAlterAccList(this.alterKeySpec),this.accList.length>0){const w=(this.position===It.Position.END?this.stave.endClef:this.stave.clef)||this.stave.clef;b&&this.convertAccLines(w,b.type,b.accList),this.convertAccLines(w,a,t);for(let R=0;R<this.accList.length;++R)this.convertToGlyph(this.accList[R],this.accList[R+1])}this.formatted=!0}draw(){if(!this.x)throw new l.RERR("KeySignatureError","Can't draw key signature without x.");if(!this.stave)throw new l.RERR("KeySignatureError","Can't draw key signature without stave.");if(this.formatted||this.format(),this.setRendered(),this.glyphs.length>0){const t=this.stave.context.openGroup("keysignature");for(let a=0;a<this.glyphs.length;a++){const b=this.glyphs[a],w=this.x+this.xPositions[a];b.setStave(this.stave),b.setContext(this.stave.context),b.renderToStave(w)}this.hidden&&t&&t.setAttribute("visibility","hidden"),this.stave.context.closeGroup()}}}class jt extends It{static get CATEGORY(){return"timesignatures"}static get glyphs(){return{C:{code:"v41",point:40,line:2},"C|":{code:"vb6",point:40,line:2}}}constructor(t=null,a=15,b=!0){if(super(),this.setAttribute("type","TimeSignature"),this.validate_args=b,null===t)return;const w=a;this.point=40,this.topLine=2,this.bottomLine=4,this.setPosition(It.Position.BEGIN),this.setTimeSig(t),this.setWidth(this.timeSig.glyph.getMetrics().width),this.setPadding(w)}getCategory(){return jt.CATEGORY}parseTimeSpec(t){if("C"===t||"C|"===t){const{line:w,code:R,point:k}=jt.glyphs[t];return{line:w,num:!1,glyph:new m(R,k)}}this.validate_args&&(w=>{const R=w.split("/").filter(k=>""!==k);if(2!==R.length)throw new l.RERR("BadTimeSignature",`Invalid time spec: ${w}. Must be in the form "<numerator>/<denominator>"`);R.forEach(k=>{if(isNaN(Number(k)))throw new l.RERR("BadTimeSignature",`Invalid time spec: ${w}. Must contain two valid numbers.`)})})(t);const[a,b]=t.split("/").map(w=>w.split(""));return{num:!0,glyph:this.makeTimeSignatureGlyph(a,b)}}makeTimeSignatureGlyph(t,a){const b=new m("v0",this.point);b.topGlyphs=[],b.botGlyphs=[];let w=0;for(let at=0;at<t.length;++at){const lt=new m("v"+t[at],this.point);b.topGlyphs.push(lt),w+=lt.getMetrics().width}let R=0;for(let at=0;at<a.length;++at){const lt=new m("v"+a[at],this.point);b.botGlyphs.push(lt),R+=lt.getMetrics().width}const k=w>R?w:R,z=b.getMetrics().x_min;b.getMetrics=()=>({x_min:z,x_max:z+k,width:k});const J=(k-w)/2,tt=(k-R)/2,rt=this;return b.renderToStave=function(at){let ht=at+J;for(let lt=0;lt<this.topGlyphs.length;++lt){const ft=this.topGlyphs[lt];m.renderOutline(this.context,ft.metrics.outline,ft.scale,ht+ft.x_shift,this.stave.getYForLine(rt.topLine)),ht+=ft.getMetrics().width}ht=at+tt;for(let lt=0;lt<this.botGlyphs.length;++lt){const ft=this.botGlyphs[lt];rt.placeGlyphOnLine(ft,this.stave,ft.line),m.renderOutline(this.context,ft.metrics.outline,ft.scale,ht+ft.x_shift,this.stave.getYForLine(rt.bottomLine)),ht+=ft.getMetrics().width}},b}getTimeSig(){return this.timeSig}setTimeSig(t){return this.timeSig=this.parseTimeSpec(t),this}draw(){if(!this.x)throw new l.RERR("TimeSignatureError","Can't draw time signature without x.");if(!this.stave)throw new l.RERR("TimeSignatureError","Can't draw time signature without stave.");this.setRendered(),this.timeSig.glyph.setStave(this.stave),this.timeSig.glyph.setContext(this.stave.context),this.placeGlyphOnLine(this.timeSig.glyph,this.stave,this.timeSig.line);const t=this.stave.context.openGroup("timesignature");this.timeSig.glyph.renderToStave(this.x),this.hidden&&t&&t.setAttribute("visibility","hidden"),this.stave.context.closeGroup("timesignature")}}class Ut extends It{static get CATEGORY(){return"voltas"}static get type(){return{NONE:1,BEGIN:2,MID:3,END:4,BEGIN_END:5}}constructor(t,a,b,w){super(),this.setAttribute("type","Volta"),this.volta=t,this.x=b,this.y_shift=w,this.number=a,this.font={family:"sans-serif",size:9,weight:"bold"}}getCategory(){return Ut.CATEGORY}setShiftY(t){return this.y_shift=t,this}draw(t,a){const b=t.checkContext();this.setRendered();let w=t.width-a;const R=t.getYForTopText(t.options.num_lines)+this.y_shift,k=1.5*t.options.spacing_between_lines_px;switch(this.volta){case Ut.type.BEGIN:b.fillRect(this.x+a,R,1,k);break;case Ut.type.END:w-=5,b.fillRect(this.x+a+w,R,1,k);break;case Ut.type.BEGIN_END:w-=3,b.fillRect(this.x+a,R,1,k),b.fillRect(this.x+a+w,R,1,k)}return this.volta!==Ut.type.BEGIN&&this.volta!==Ut.type.BEGIN_END||(b.save(),b.setFont(this.font.family,this.font.size,this.font.weight),b.fillText(this.number,this.x+a+5,R+15),b.restore()),b.fillRect(this.x+a,R,w,1),this}}class Yt extends o{constructor(t,a,b,w){super(),this.setAttribute("type","Stave"),this.x=t,this.y=a,this.width=b,this.formatted=!1,this.setStartX(t+5),this.end_x=t+b,this.modifiers=[],this.measure=0,this.clef="treble",this.endClef=void 0,this.font={family:"sans-serif",size:8,weight:""},this.options={vertical_bar_width:10,glyph_spacing_px:10,num_lines:5,fill_style:"#999999",left_bar:!0,right_bar:!0,spacing_between_lines_px:10,space_above_staff_ln:4,space_below_staff_ln:4,top_text_position:1},this.bounds={x:this.x,y:this.y,w:this.width,h:0},l.Merge(this.options,w),this.resetLines();const R=Rt.type;this.addModifier(new Rt(this.options.left_bar?R.SINGLE:R.NONE)),this.addEndModifier(new Rt(this.options.right_bar?R.SINGLE:R.NONE))}space(t){return this.options.spacing_between_lines_px*t}resetLines(){this.options.line_config=[];for(let t=0;t<this.options.num_lines;t++)this.options.line_config.push({visible:!0});this.height=(this.options.num_lines+this.options.space_above_staff_ln)*this.options.spacing_between_lines_px,this.options.bottom_text_position=this.options.num_lines}formatBegModifiers(t){let a=0;t.forEach(b=>{b.getNoteStartX()>a&&(a=b.getNoteStartX())}),t.forEach(b=>{b.setNoteStartX(a)}),a=0,t.forEach(b=>{b.getModifiers(It.Position.BEGIN,Rt.CATEGORY).forEach(w=>{w.getType()==Rt.type.REPEAT_BEGIN&&w.getX()>a&&(a=w.getX())})}),t.forEach(b=>{b.getModifiers(It.Position.BEGIN,Rt.CATEGORY).forEach(w=>{w.getType()==Rt.type.REPEAT_BEGIN&&w.setX(a)})}),a=0,t.forEach(b=>{b.getModifiers(It.Position.BEGIN,jt.CATEGORY).forEach(w=>{w.getX()>a&&(a=w.getX())})}),t.forEach(b=>{b.getModifiers(It.Position.BEGIN,jt.CATEGORY).forEach(w=>{w.setX(a)})})}getOptions(){return this.options}setNoteStartX(t){return this.formatted||this.format(),this.setStartX(t),this}setStartX(t){this.start_x=t}getNoteStartX(){return this.formatted||this.format(),this.start_x}getNoteEndX(){return this.formatted||this.format(),this.end_x}getTieStartX(){return this.start_x}getTieEndX(){return this.x+this.width}getX(){return this.x}getNumLines(){return this.options.num_lines}setNumLines(t){return this.options.num_lines=parseInt(t,10),this.resetLines(),this}setY(t){return this.y=t,this}getTopLineTopY(){return this.getYForLine(0)-p.STAVE_LINE_THICKNESS/2}getBottomLineBottomY(){return this.getYForLine(this.getNumLines()-1)+p.STAVE_LINE_THICKNESS/2}setX(t){const a=t-this.x;this.formatted=!1,this.x=t,this.start_x+=a,this.end_x+=a;for(let b=0;b<this.modifiers.length;b++){const w=this.modifiers[b];void 0!==w.x&&(w.x+=a)}return this}setWidth(t){return this.formatted=!1,this.width=t,this.end_x=this.x+t,this}getWidth(){return this.width}getStyle(){return{fillStyle:this.options.fill_style,strokeStyle:this.options.fill_style,lineWidth:p.STAVE_LINE_THICKNESS,...this.style||{}}}setMeasure(t){return this.measure=t,this}getModifierXShift(t=0){if("number"!=typeof t)throw new l.RERR("InvalidIndex","Must be of number type");if(this.formatted||this.format(),1===this.getModifiers(It.Position.BEGIN).length)return 0;let a=this.start_x-this.x;const b=this.modifiers[0];return b.getType()===Rt.type.REPEAT_BEGIN&&a>b.getWidth()&&(a-=b.getWidth()),a}setRepetitionTypeLeft(t,a){return this.modifiers.push(new Dt(t,this.x,a)),this}setRepetitionTypeRight(t,a){return this.modifiers.push(new Dt(t,this.x,a)),this}setVoltaType(t,a,b){return this.modifiers.push(new Ut(t,a,this.x,b)),this}setSection(t,a,b=0,w=12){const R=new ie(t,this.x+b,a);return R.font.size=w,this.modifiers.push(R),this}setTempo(t,a){return this.modifiers.push(new se(t,this.x,a)),this}setText(t,a,b){return this.modifiers.push(new oe(t,a,b)),this}getHeight(){return this.height}getSpacingBetweenLines(){return this.options.spacing_between_lines_px}getBoundingBox(){return new h(this.x,this.y,this.width,this.getBottomY()-this.y)}getBottomY(){const t=this.options,a=t.spacing_between_lines_px;return this.getYForLine(t.num_lines)+t.space_below_staff_ln*a}getBottomLineY(){return this.getYForLine(this.options.num_lines)}getYForLine(t){const a=this.options,b=a.spacing_between_lines_px;return this.y+t*b+a.space_above_staff_ln*b}getLineForY(t){const a=this.options;return(t-this.y)/a.spacing_between_lines_px-a.space_above_staff_ln}getYForTopText(t){return this.getYForLine(-(t||0)-this.options.top_text_position)}getYForBottomText(t){return this.getYForLine(this.options.bottom_text_position+(t||0))}getYForNote(t){const a=this.options,b=a.spacing_between_lines_px;return this.y+a.space_above_staff_ln*b+5*b-t*b}getYForGlyphs(){return this.getYForLine(3)}addModifier(t,a){return void 0!==a&&t.setPosition(a),t.setStave(this),this.formatted=!1,this.modifiers.push(t),this}addEndModifier(t){return this.addModifier(t,It.Position.END),this}setBegBarType(t){const{SINGLE:a,REPEAT_BEGIN:b,NONE:w}=Rt.type;return t!==a&&t!==b&&t!==w||(this.modifiers[0].setType(t),this.formatted=!1),this}setEndBarType(t){return t!==Rt.type.REPEAT_BEGIN&&(this.modifiers[1].setType(t),this.formatted=!1),this}setClef(t,a,b,w){void 0===w&&(w=It.Position.BEGIN),w===It.Position.END?this.endClef=t:this.clef=t;const R=this.getModifiers(w,Qt.CATEGORY);return 0===R.length?this.addClef(t,a,b,w):R[0].setType(t,a,b),this}setEndClef(t,a,b){return this.setClef(t,a,b,It.Position.END),this}setKeySignature(t,a,b){void 0===b&&(b=It.Position.BEGIN);const w=this.getModifiers(b,Wt.CATEGORY);return 0===w.length?this.addKeySignature(t,a,b):w[0].setKeySig(t,a),this}setEndKeySignature(t,a){return this.setKeySignature(t,a,It.Position.END),this}setTimeSignature(t,a,b){void 0===b&&(b=It.Position.BEGIN);const w=this.getModifiers(b,jt.CATEGORY);return 0===w.length?this.addTimeSignature(t,a,b):w[0].setTimeSig(t),this}setEndTimeSignature(t,a){return this.setTimeSignature(t,a,It.Position.END),this}addKeySignature(t,a,b){return void 0===b&&(b=It.Position.BEGIN),this.addModifier(new Wt(t,a).setPosition(b),b),this}addClef(t,a,b,w){return void 0===w||w===It.Position.BEGIN?this.clef=t:w===It.Position.END&&(this.endClef=t),this.addModifier(new Qt(t,a,b),w),this}addEndClef(t,a,b){return this.addClef(t,a,b,It.Position.END),this}addTimeSignature(t,a,b){return this.addModifier(new jt(t,a),b),this}addEndTimeSignature(t,a){return this.addTimeSignature(t,a,It.Position.END),this}addTrebleGlyph(){return this.addClef("treble"),this}getModifiers(t,a){return void 0===t&&void 0===a?this.modifiers:this.modifiers.filter(b=>!(void 0!==t&&t!==b.getPosition()||void 0!==a&&a!==b.getCategory()))}sortByCategory(t,a){for(let b=t.length-1;b>=0;b--)for(let w=0;w<b;w++)if(a[t[w].getCategory()]>a[t[w+1].getCategory()]){const R=t[w];t[w]=t[w+1],t[w+1]=R}}format(){const t=this.modifiers[0],a=this.modifiers[1],b=this.getModifiers(It.Position.BEGIN),w=this.getModifiers(It.Position.END);let R,k,z;this.sortByCategory(b,{barlines:0,clefs:1,keysignatures:2,timesignatures:3}),this.sortByCategory(w,{timesignatures:0,keysignatures:1,barlines:2,clefs:3}),b.length>1&&t.getType()===Rt.type.REPEAT_BEGIN&&(b.push(b.splice(0,1)[0]),b.splice(0,0,new Rt(Rt.type.SINGLE))),w.indexOf(a)>0&&w.splice(0,0,new Rt(Rt.type.NONE));let J=0,tt=this.x;for(let ht=0;ht<b.length;ht++){z=b[ht],k=z.getPadding(ht+J),R=z.getWidth(),isNaN(R)&&(z.setWidth(10),R=10),tt+=k;const lt=z.getX();lt>tt?tt=lt:z.setX(tt),tt+=R,k+R===0&&J--}tt>this.start_x&&this.setStartX(tt),tt=this.x+this.width;const rt={left:0,right:0,paddingRight:0,paddingLeft:0};let at=0;for(let ht=0;ht<w.length;ht++){z=w[ht],at="barlines"===z.getCategory()?ht:at,rt.right=0,rt.left=0,rt.paddingRight=0,rt.paddingLeft=0;const lt=z.getLayoutMetrics();lt?(0!==ht&&(rt.right=lt.xMax||0,rt.paddingRight=lt.paddingRight||0),rt.left=-lt.xMin||0,rt.paddingLeft=lt.paddingLeft||0,ht===w.length-1&&(rt.paddingLeft=0)):(rt.paddingRight=z.getPadding(ht-at)||0,0!==ht&&(rt.right=z.getWidth()||0),0===ht&&(rt.left=z.getWidth()||0)),tt-=rt.paddingRight,tt-=rt.right,z.setX(tt),tt-=rt.left,tt-=rt.paddingLeft}this.end_x=1===w.length?this.x+this.width:tt,this.formatted=!0}draw(){this.checkContext(),this.setRendered(),this.formatted||this.format();const t=this.options.num_lines,a=this.width,b=this.x;let w;for(let R=0;R<t;R++)w=this.getYForLine(R),this.applyStyle(),this.options.line_config[R].visible&&(this.context.beginPath(),this.context.moveTo(b,w),this.context.lineTo(b+a,w),this.context.stroke()),this.restoreStyle();for(let R=0;R<this.modifiers.length;R++)"function"==typeof this.modifiers[R].draw&&(this.modifiers[R].applyStyle(this.context),this.modifiers[R].draw(this,this.getModifierXShift(R)),this.modifiers[R].restoreStyle(this.context));if(this.measure>0){this.context.save(),this.context.setFont(this.font.family,this.font.size,this.font.weight);const R=this.context.measureText(""+this.measure).width;w=this.getYForTopText(0)+3,this.context.fillText(""+this.measure,this.x-R/2,w),this.context.restore()}return this}drawVertical(t,a){this.drawVerticalFixed(this.x+t,a)}drawVerticalFixed(t,a){this.checkContext();const b=this.getYForLine(0),w=this.getYForLine(this.options.num_lines-1);a&&this.context.fillRect(t-3,b,1,w-b+1),this.context.fillRect(t,b,1,w-b+1)}drawVerticalBar(t){this.drawVerticalBarFixed(this.x+t,!1)}drawVerticalBarFixed(t){this.checkContext();const a=this.getYForLine(0),b=this.getYForLine(this.options.num_lines-1);this.context.fillRect(t,a,1,b-a+1)}getConfigForLines(){return this.options.line_config}setConfigForLine(t,a){if(t>=this.options.num_lines||t<0)throw new l.RERR("StaveConfigError","The line number must be within the range of the number of lines in the Stave.");if(void 0===a.visible)throw new l.RERR("StaveConfigError","The line configuration object is missing the 'visible' property.");if("boolean"!=typeof a.visible)throw new l.RERR("StaveConfigError","The line configuration objects 'visible' property must be true or false.");return this.options.line_config[t]=a,this}setConfigForLines(t){if(t.length!==this.options.num_lines)throw new l.RERR("StaveConfigError","The length of the lines configuration array must match the number of lines in the Stave");for(const a in t)t[a]||(t[a]=this.options.line_config[a]),l.Merge(this.options.line_config[a],t[a]);return this.options.line_config=t,this}}class qt extends Yt{constructor(t,a,b,w){const R={spacing_between_lines_px:13,num_lines:6,top_text_position:1};l.Merge(R,w),super(t,a,b,R),this.setAttribute("type","TabStave")}getYForGlyphs(){return this.getYForLine(2.5)}addTabGlyph(){return this.addClef("tab"),this}}class Ht extends U{static get CATEGORY(){return"tabnotes"}constructor(t,a){if(super(t),this.setAttribute("type","TabNote"),this.ghost=!1,this.positions=t.positions,l.Merge(this.render_options,{glyph_font_scale:p.DEFAULT_TABLATURE_FONT_SCALE,draw_stem:a,draw_dots:a,draw_stem_through_stave:!1,y_shift:0,scale:1,font:"10pt Arial"}),this.glyph=p.getGlyphProps(this.duration,this.noteType),!this.glyph)throw new l.RuntimeError("BadArguments",`Invalid note initialization data (No glyph found): ${JSON.stringify(t)}`);this.buildStem(),this.setStemDirection(t.stem_direction?t.stem_direction:_.UP),this.ghost=!1,this.updateWidth()}reset(){this.stave&&this.setStave(this.stave)}getCategory(){return Ht.CATEGORY}setGhost(t){return this.ghost=t,this.updateWidth(),this}hasStem(){return this.render_options.draw_stem}getStemExtension(){const t=this.getGlyph();return null!=this.stem_extension_override?this.stem_extension_override:t?1===this.getStemDirection()?t.tabnote_stem_up_extension:t.tabnote_stem_down_extension:0}addDot(){const t=new H;return this.dots+=1,this.addModifier(t,0)}updateWidth(){this.glyphs=[],this.width=0;for(let t=0;t<this.positions.length;++t){let a=this.positions[t].fret;this.ghost&&(a="("+a+")");const w=p.tabToGlyph(a,this.render_options.fretScale??this.render_options.scale,this.render_options.TabUseXNoteheadAlternativeGlyph);"x"===a&&(w.isXGlyph=!0),this.glyphs.push(w),this.width=Math.max(w.getWidth(),this.width)}this.glyph.getWidth=()=>this.width}setStave(t){let a;if(super.setStave(t),this.context=t.context,this.context){const w=this.context;for(this.width=0,a=0;a<this.glyphs.length;++a){const R=this.glyphs[a],k=""+R.text;"X"!==k.toUpperCase()&&(w.save(),w.setRawFont(this.render_options.font),R.width=w.measureText(k).width,w.restore(),R.getWidth=()=>R.width),this.width=Math.max(R.getWidth(),this.width)}this.glyph.getWidth=()=>this.width}const b=this.positions.map(({str:w})=>t.getYForLine(w-1));return this.setYs(b),this.stem&&this.stem.setYBounds(this.getStemY(),this.getStemY()),this}getPositions(){return this.positions}addToModifierContext(t){this.setModifierContext(t);for(let a=0;a<this.modifiers.length;++a)this.modifierContext.addModifier(this.modifiers[a]);return this.modifierContext.addModifier(this),this.preFormatted=!1,this}getTieRightX(){let t=this.getAbsoluteX();return t+=this.glyph.getWidth()/2,t+=-this.width/2+this.width+2,t}getTieLeftX(){let t=this.getAbsoluteX();return t+=this.glyph.getWidth()/2,t-=this.width/2+2,t}getModifierStartXY(t,a){if(!this.preFormatted)throw new l.RERR("UnformattedNote","Can't call GetModifierStartXY on an unformatted note");if(0===this.ys.length)throw new l.RERR("NoYValues","No Y-Values calculated for this note.");let b=0;return t===Y.Position.LEFT?b=-2:t===Y.Position.RIGHT?b=this.width+2:t!==Y.Position.BELOW&&t!==Y.Position.ABOVE||(b=this.glyph.getWidth()/2),{x:this.getAbsoluteX()+b,y:this.ys[a]}}getLineForRest(){return this.positions[0].str}preFormat(){this.preFormatted||(this.modifierContext&&this.modifierContext.preFormat(),this.setPreFormatted(!0))}getStemX(){return this.getCenterGlyphX()}getStemY(){const t=this.stave.getNumLines()-.5;return this.stave.getYForLine(_.UP===this.stem_direction?-.5:t)}getStemExtents(){return this.stem.getExtents()}drawFlag(){const{beam:t,glyph:a,context:b,stem:w,stem_direction:R,render_options:{draw_stem:k,glyph_font_scale:z}}=this;if(a.flag&&null==t&&k){const tt=this.getStemX()+1,rt=this.getStemY()-w.getHeight();m.renderGlyph(b,tt,rt,z,R===_.DOWN?a.code_flag_downstem:a.code_flag_upstem)}}drawModifiers(){this.modifiers.forEach(t=>{("dots"!==t.getCategory()||this.render_options.draw_dots)&&(t.setContext(this.context),t.drawWithStyle())})}drawStemThrough(){const t=this.getStemX(),a=this.getStemY(),b=this.context;if(this.render_options.draw_stem&&this.render_options.draw_stem_through_stave){const k=function(z,J,tt,rt){const at=1!==rt,ht=-1!==rt,lt=tt.getSpacingBetweenLines(),ft=tt.getNumLines(),bt=[];return J.forEach(mt=>{const xt=mt.indexOf(ft)>-1,wt=mt.indexOf(1)>-1;if(at&&wt||ht&&xt)return;1===mt.length&&mt.push(mt[0]);const Tt=[];mt.forEach((Pt,Lt,Ct)=>{const kt=1===Pt,Gt=Pt===ft;let zt=tt.getYForLine(Pt-1);0!==Lt||kt?Lt!==Ct.length-1||Gt||(zt+=lt/2-1):zt-=lt/2-1,Tt.push(zt),1===rt&&kt?Tt.push(z-2):-1===rt&&Gt&&Tt.push(z+2)}),bt.push(Tt.sort((Pt,Lt)=>Pt-Lt))}),bt}(a,function(z,J){const tt=[];let rt=[];for(let at=1;at<=z;at++)J.indexOf(at)>-1?(tt.push(rt),rt=[]):rt.push(at);return rt.length>0&&tt.push(rt),tt}(this.stave.getNumLines(),this.positions.map(z=>z.str)),this.getStave(),this.getStemDirection());b.save(),b.setLineWidth(_.WIDTH),k.forEach(z=>{0!==z.length&&(b.beginPath(),b.moveTo(t,z[0]),b.lineTo(t,z[z.length-1]),b.stroke(),b.closePath())}),b.restore()}}drawPositions(){const t=this.context,a=this.getAbsoluteX(),b=this.ys;for(let w=0;w<this.positions.length;++w){const R=b[w]+this.render_options.y_shift,k=this.glyphs[w];let z=k.getWidth();0===z&&k.text?.toString()?.length&&(z=7*k.text.toString().length);let J=this.glyph.getWidth();0===J&&(J=z);const tt=a+J/2-z/2;if(this.BackgroundColor?(t.save(),t.setFillStyle(this.BackgroundColor),t.setLineWidth(0),t.fillRect(tt-2,R-3,z+4,6),t.restore()):t.clearRect(tt-2,R-3,z+4,6),k.code)m.renderGlyph(t,tt,R,this.render_options.glyph_font_scale*this.render_options.scale,k.code);else{t.save(),t.setRawFont(this.render_options.font);const rt=k.text.toString();t.fillText(rt,tt,R+5*this.render_options.scale),t.restore()}}}draw(){if(this.checkContext(),!this.stave)throw new l.RERR("NoStave","Can't draw without a stave.");if(0===this.ys.length)throw new l.RERR("NoYValues","Can't draw note without Y values.");this.setRendered();const t=null==this.beam&&this.render_options.draw_stem;this.context.openGroup("tabnote",this.getAttribute("id"),{pointerBBox:!0}),this.drawPositions(),this.drawStemThrough();const a=this.getStemX();this.stem.setNoteHeadXBounds(a,a),t&&(this.context.openGroup("stem",null,{pointerBBox:!0}),this.stem.setContext(this.context).draw(),this.context.closeGroup()),this.drawFlag(),this.drawModifiers(),this.context.closeGroup()}}class Jt extends o{constructor(t){super(),this.setAttribute("type","VibratoBracket"),this.start=t.start,this.stop=t.stop,this.toEndOfStopStave=t.toEndOfStopStave,this.line=1,this.render_options={harsh:!1,wave_height:6,wave_width:4,wave_girth:2}}setLine(t){return this.line=t,this}setHarsh(t){return this.render_options.harsh=t,this}draw(){const t=this.context;this.setRendered();const a=this.start?this.start.getStave().getYForTopText(this.line):this.stop.getStave().getYForTopText(this.line);let b=0;if(this.start){let R=0;for(const k of this.start.modifiers)if(k&&"tr"===k.type){R=k.glyph.bbox.w;break}b=this.start.getNoteHeadBeginX?this.start.getNoteHeadBeginX():this.start.getAbsoluteX(),b+=R}else b=this.stop.getStave().getTieStartX();let w=0;w=this.stop?this.toEndOfStopStave?this.stop.getStave().getTieEndX()-10:this.stop.getAbsoluteX()+this.stop.getWidth():this.start.getStave().getTieEndX()-10,this.render_options.vibrato_width=w-b,function(...R){Jt.DEBUG&&l.L("Vex.Flow.VibratoBracket",R)}("Rendering VibratoBracket: start_x:",b,"stop_x:",w,"y:",a),_t.renderVibrato(t,b,a,this.render_options)}}let re;class he extends o{constructor(t,a){super(),this.setAttribute("type","MultiMeasureRest"),this.render_options={show_number:!0,number_line:-.5,number_glyph_point:40,padding_left:void 0,padding_right:void 0,line:2,spacing_between_lines_px:10,line_thickness:void 0,serif_thickness:2,use_symbols:!1,symbol_spacing:void 0,semibrave_rest_glyph_scale:p.DEFAULT_NOTATION_FONT_SCALE},l.Merge(this.render_options,a),this.number_of_measures=t,this.xs={left:NaN,right:NaN}}getXs(){return this.xs}setStave(t){return this.stave=t,this}getStave(){return this.stave}drawLine(t,a,b,w){const R=this.stave.getYForLine(this.render_options.line),k=.1*(b-a);a+=k,b-=k;const z=this.render_options.serif_thickness;let J=.25*w;isNaN(this.render_options.line_thickness)||(J=.5*this.render_options.line_thickness),t.save(),t.beginPath(),t.moveTo(a,R-w),t.lineTo(a+z,R-w),t.lineTo(a+z,R-J),t.lineTo(b-z,R-J),t.lineTo(b-z,R-w),t.lineTo(b,R-w),t.lineTo(b,R+w),t.lineTo(b-z,R+w),t.lineTo(b-z,R+J),t.lineTo(a+z,R+J),t.lineTo(a+z,R+w),t.lineTo(a,R+w),t.closePath(),t.fill()}drawSymbols(t,a,b,w){const R=Math.floor(this.number_of_measures/4),k=this.number_of_measures%4,z=Math.floor(k/2),J=k%2,tt=function me(){if(!re){const ut=new P({duration:"w",note_type:"r"});re={glyph_font_scale:ut.render_options.glyph_font_scale,glyph_code:ut.glyph_code,width:ut.getWidth()}}return re}(),rt=tt.width*(this.render_options.semibrave_rest_glyph_scale/tt.glyph_font_scale),at={2:{width:.5*rt,height:w},1:{width:rt}};let ht=1.35*rt;isNaN(this.render_options.symbol_spacing)||(ht=this.render_options.symbol_spacing);let lt=a+.5*(b-a)-.5*(R*at[2].width+z*at[2].width+J*at[1].width+(R+z+J-1)*ht);const ft=this.stave.getYForLine(this.render_options.line-1),bt=this.stave.getYForLine(this.render_options.line),mt=this.stave.getYForLine(this.render_options.line+1);t.save(),t.setStrokeStyle("none"),t.setLineWidth(0);for(let xt=0;xt<R;++xt)t.fillRect(lt,bt-at[2].height,at[2].width,at[2].height),t.fillRect(lt,mt-at[2].height,at[2].width,at[2].height),lt+=at[2].width+ht;for(let xt=0;xt<z;++xt)t.fillRect(lt,bt-at[2].height,at[2].width,at[2].height),lt+=at[2].width+ht;for(let xt=0;xt<J;++xt)m.renderGlyph(t,lt,ft,this.render_options.semibrave_rest_glyph_scale,tt.glyph_code),lt+=at[1].width+ht;t.restore()}draw(){this.checkContext(),this.setRendered();const t=this.context,a=this.stave,b=this.render_options.spacing_between_lines_px;let w=a.getNoteStartX(),R=a.getNoteEndX();const k=a.getModifiers(It.Position.BEGIN);1===k.length&&"barlines"===k[0].getCategory()&&(w-=k[0].getWidth());const z=a.getModifiers(It.Position.END);if(z.length>=1&&"barlines"===z[0].getCategory()&&(R-=z[0].getPadding()),isNaN(this.render_options.padding_left)||(w=a.getX()+this.render_options.padding_left),isNaN(this.render_options.padding_right)||(R=a.getX()+a.getWidth()-this.render_options.padding_right),this.xs.left=w,this.xs.right=R,this.render_options.use_symbols?this.drawSymbols(t,w,R,b):this.drawLine(t,w,R,b),this.render_options.show_number){const J="/"+this.number_of_measures,tt=new jt(null,void 0,!1);tt.point=this.render_options.number_glyph_point,tt.setTimeSig(J),tt.setStave(a),tt.x=w+.5*(R-w)-.5*tt.timeSig.glyph.getMetrics().width,tt.bottomLine=this.render_options.number_line,tt.setContext(t).draw()}}}class Se extends j{static get CATEGORY(){return"clefnote"}constructor(t,a,b){super({duration:"b"}),this.setAttribute("type","ClefNote"),this.setType(t,a,b),this.ignore_ticks=!0}setType(t,a,b){return this.type=t,this.clef_obj=new Qt(t,a,b),this.clef=this.clef_obj.clef,this.glyph=new m(this.clef.code,this.clef.point),this.setWidth(this.glyph.getMetrics().width),this}getClef(){return this.clef}setContext(t){return this.context=t,this.glyph.setContext(this.context),this}getBoundingBox(){return super.getBoundingBox()}addToModifierContext(){return this}getCategory(){return Se.CATEGORY}preFormat(){return this.setPreFormatted(!0),this}draw(){if(!this.stave)throw new l.RERR("NoStave","Can't draw without a stave.");this.glyph.getContext()||this.glyph.setContext(this.context),this.setRendered();const t=this.getAbsoluteX();if(this.glyph.setStave(this.stave),this.glyph.setYShift(this.stave.getYForLine(this.clef.line)-this.stave.getYForGlyphs()),this.glyph.renderToStave(t),void 0!==this.clef_obj.annotation){const a=new m(this.clef_obj.annotation.code,this.clef_obj.annotation.point);a.getContext()||a.setContext(this.context),a.setStave(this.stave),a.setYShift(this.stave.getYForLine(this.clef_obj.annotation.line)-this.stave.getYForGlyphs()),a.setXShift(this.clef_obj.annotation.x_shift),a.renderToStave(t)}}}class He extends j{constructor(t,a,b){super({duration:"b"}),this.setAttribute("type","KeySigNote"),this.keySignature=new Wt(t,a,b),this.ignore_ticks=!0}getBoundingBox(){return super.getBoundingBox()}addToModifierContext(){return this}preFormat(){return this.setPreFormatted(!0),this.keySignature.setStave(this.stave),this.keySignature.format(),this.setWidth(this.keySignature.width),this}draw(){this.stave.checkContext(),this.setRendered(),this.keySignature.x=this.getAbsoluteX(),this.keySignature.setContext(this.context),this.keySignature.draw()}}class Xe extends j{constructor(t,a){super({duration:"b"}),this.setAttribute("type","TimeSigNote");const b=new jt(t,a);this.timeSig=b.getTimeSig(),this.setWidth(this.timeSig.glyph.getMetrics().width),this.ignore_ticks=!0}getBoundingBox(){return super.getBoundingBox()}addToModifierContext(){return this}preFormat(){return this.setPreFormatted(!0),this}draw(){this.stave.checkContext(),this.setRendered(),this.timeSig.glyph.getContext()||this.timeSig.glyph.setContext(this.context),this.timeSig.glyph.setStave(this.stave),this.timeSig.glyph.setYShift(this.stave.getYForLine(this.timeSig.line)-this.stave.getYForGlyphs()),this.timeSig.glyph.renderToStave(this.getAbsoluteX())}}class ce extends X{static get SLIDE_UP(){return 1}static get SLIDE_DOWN(){return-1}static createSlideUp(t){return new ce(t,ce.SLIDE_UP)}static createSlideDown(t){return new ce(t,ce.SLIDE_DOWN)}constructor(t,a){if(super(t,"sl."),this.setAttribute("type","TabSlide"),!a){const b=t.first_note.getPositions()[0].fret,w=t.last_note.getPositions()[0].fret;a=parseInt(b,10)>parseInt(w,10)?ce.SLIDE_DOWN:ce.SLIDE_UP}this.slide_direction=a,this.render_options.cp1=11,this.render_options.cp2=14,this.render_options.y_shift=.5,this.setFont({font:"Times",size:10,style:"bold italic"}),this.setNotes(t)}renderTie(t){if(0===t.first_ys.length||0===t.last_ys.length)throw new l.RERR("BadArguments","No Y-values to render");const a=this.context,b=t.first_x_px,w=t.first_ys,R=t.last_x_px,k=this.slide_direction;if(k!==ce.SLIDE_UP&&k!==ce.SLIDE_DOWN)throw new l.RERR("BadSlide","Invalid slide direction");for(let z=0;z<this.first_indices.length;++z){const J=w[this.first_indices[z]]+this.render_options.y_shift;if(isNaN(J))throw new l.RERR("BadArguments","Bad indices for slide rendering.");a.beginPath(),a.moveTo(b,J+3*k),a.lineTo(R,J-3*k),a.closePath(),a.stroke()}this.setRendered()}}class ye extends ot{static get CATEGORY(){return"gracenotes"}static get LEDGER_LINE_OFFSET(){return 2}static get SCALE(){return.66}constructor(t){super(Object.assign(t,{glyph_font_scale:p.DEFAULT_NOTATION_FONT_SCALE*ye.SCALE,stroke_px:ye.LEDGER_LINE_OFFSET})),this.setAttribute("type","GraceNote"),this.slash=t.slash,this.slur=!0,this.buildNoteHeads(),this.width=3}getStemExtension(){if(null!=this.stem_extension_override)return this.stem_extension_override;const t=this.getGlyph();if(t){let a=super.getStemExtension();if(t.stem){const b=this.getStaveNoteScale();a=(_.HEIGHT+a)*b-_.HEIGHT}return a}return 0}getCategory(){return ye.CATEGORY}getStaveNoteScale(){return this.render_options.glyph_font_scale/p.DEFAULT_NOTATION_FONT_SCALE}draw(){super.draw(),this.setRendered();const t=this.stem;if(this.slash&&t){const a=this.getStaveNoteScale(),b=a/.66;let w;const R=this.beam;if(R)R.postFormatted||R.postFormat(),w=this.calcBeamedNotesSlashBBox(8*b,8*b,{stem:6*b,beam:5*b});else{const z=this.getStemDirection(),J=this.getNoteHeadBounds(),tt=t.getHeight();let rt=this.getAbsoluteX(),at=z===p.Stem.DOWN?J.y_top-tt:J.y_bottom-tt,lt=p.STEM_HEIGHT;lt-=lt/2.8,lt+=z===p.Stem.DOWN?this.glyph.stem_down_extension:this.glyph.stem_up_extension,at+=lt*a*z;const ft=z===p.Stem.UP?{x1:1,y1:0,x2:13,y2:-9}:{x1:-4,y1:1,x2:13,y2:9};rt+=ft.x1*b,at+=ft.y1*b,w={x1:rt,y1:at,x2:rt+ft.x2*b,y2:at+ft.y2*b}}const k=this.context;k.save(),k.setLineWidth(1*b),k.beginPath(),k.moveTo(w.x1,w.y1),k.lineTo(w.x2,w.y2),k.closePath(),k.stroke(),k.restore()}}calcBeamedNotesSlashBBox(t,a,b){const w=this.beam,R=w.slope,k=w.notes[w.notes.length-1]===this?-1:1,z=Math.atan(R*k),J=Math.cos(z)*a,tt=Math.sin(z)*a;t*=this.getStemDirection();const rt=Math.atan((tt-t)/J),at=Math.cos(rt)*b.stem*k,ht=Math.sin(rt)*b.stem,lt=Math.cos(rt)*b.beam*k,ft=Math.sin(rt)*b.beam,bt=this.getStemX(),mt=w.notes[0].getStemX(),xt=this.beam.getBeamYToDraw()+(bt-mt)*R;return{x1:bt-at,y1:xt+t-ht,x2:bt+J*k+lt,y2:xt+tt+ft}}}class Ge extends Ht{static get CATEGORY(){return"gracetabnotes"}constructor(t){super(t,!1),this.setAttribute("type","GraceTabNote"),l.Merge(this.render_options,{y_shift:.3,scale:.6,font:"7.5pt Arial"}),this.updateWidth()}getCategory(){return Ge.CATEGORY}draw(){super.draw(),this.setRendered()}}class Re{static get names(){return{standard:"E/5,B/4,G/4,D/4,A/3,E/3",dagdad:"D/5,A/4,G/4,D/4,A/3,D/3",dropd:"E/5,B/4,G/4,D/4,A/3,D/3",eb:"Eb/5,Bb/4,Gb/4,Db/4,Ab/3,Db/3",standardBanjo:"D/5,B/4,G/4,D/4,G/5"}}constructor(t="E/5,B/4,G/4,D/4,A/3,E/3,B/2,E/2"){this.setTuning(t)}noteToInteger(t){return p.keyProperties(t).int_value}setTuning(t){Re.names[t]&&(t=Re.names[t]),this.tuningString=t,this.tuningValues=[],this.numStrings=0;const a=t.split(/\s*,\s*/);if(0===a.length)throw new l.RERR("BadArguments","Invalid tuning string: "+t);this.numStrings=a.length;for(let b=0;b<this.numStrings;++b)this.tuningValues[b]=this.noteToInteger(a[b])}getValueForString(t){const a=parseInt(t,10);if(a<1||a>this.numStrings)throw new l.RERR("BadArguments",`String number must be between 1 and ${this.numStrings}:${t}`);return this.tuningValues[a-1]}getValueForFret(t,a){const b=this.getValueForString(a),w=parseInt(t,10);if(w<0)throw new l.RERR("BadArguments","Fret number must be 0 or higher: "+t);return b+w}getNoteForFret(t,a){const b=this.getValueForFret(t,a),w=Math.floor(b/12);return p.integerToNote(b%12)+"/"+w}}class _e extends o{static get type(){return{CRESC:1,DECRESC:2}}static FormatByTicksAndDraw(t,a,b,w,R,k){const z=a.pixelsPerTick;if(null==z)throw new l.RuntimeError("BadArguments","A valid Formatter must be provide to draw offsets by ticks.");const rt={height:k.height,y_shift:k.y_shift,left_shift_px:z*k.left_shift_ticks,right_shift_px:z*k.right_shift_ticks};new _e({first_note:b.first_note,last_note:b.last_note},w).setContext(t).setRenderOptions(rt).setPosition(R).draw()}constructor(t,a){super(),this.setAttribute("type","StaveHairpin"),this.notes=t,this.hairpin=a,this.position=Y.Position.BELOW,this.render_options={height:10,y_shift:0,left_shift_px:0,right_shift_px:0},this.setNotes(t)}setPosition(t){return t!==Y.Position.ABOVE&&t!==Y.Position.BELOW||(this.position=t),this}setRenderOptions(t){return null!=t.height&&null!=t.y_shift&&null!=t.left_shift_px&&null!=t.right_shift_px&&(this.render_options=t),this}setNotes(t){if(!t.first_note&&!t.last_note)throw new l.RuntimeError("BadArguments","Hairpin needs to have either first_note or last_note set.");return this.first_note=t.first_note,this.last_note=t.last_note,this}renderHairpin(t){const a=this.checkContext();let b=this.render_options.y_shift+20,w=t.first_y;this.position===Y.Position.ABOVE&&(b=30-b,w=t.first_y-t.staff_height);const R=this.render_options.left_shift_px,k=this.render_options.right_shift_px;switch(a.beginPath(),this.hairpin){case _e.type.CRESC:a.moveTo(t.last_x+k,w+b),a.lineTo(t.first_x+R,w+this.render_options.height/2+b),a.lineTo(t.last_x+k,w+this.render_options.height+b);break;case _e.type.DECRESC:a.moveTo(t.first_x+R,w+b),a.lineTo(t.last_x+k,w+this.render_options.height/2+b),a.lineTo(t.first_x+R,w+this.render_options.height+b)}a.stroke(),a.closePath()}draw(){this.checkContext(),this.setRendered();const t=this.first_note,a=this.last_note,b=t.getModifierStartXY(this.position,0),w=a.getModifierStartXY(this.position,0);return this.renderHairpin({first_x:b.x,last_x:w.x,first_y:t.getStave().y+t.getStave().height,last_y:a.getStave().y+a.getStave().height,staff_height:t.getStave().height}),!0}}class ae extends o{static get Position(){return{NEAR_HEAD:1,NEAR_TOP:2}}static get PositionString(){return{nearHead:ae.Position.NEAR_HEAD,nearTop:ae.Position.NEAR_TOP}}constructor(t,a,b){super(),this.setAttribute("type","Curve"),this.render_options={spacing:2,thickness:2,x_shift:0,y_shift:10,position:ae.Position.NEAR_HEAD,position_end:ae.Position.NEAR_HEAD,invert:!1,cps:[{x:0,y:10},{x:0,y:10}]},l.Merge(this.render_options,b),this.setNotes(t,a)}setNotes(t,a){if(!t&&!a)throw new l.RuntimeError("BadArguments","Curve needs to have either first_note or last_note set.");return this.from=t,this.to=a,this}isPartial(){return!this.from||!this.to}renderCurve(t){const a=this.context,b=this.render_options.cps,w=this.render_options.x_shift,R=this.render_options.y_shift*t.direction,k=t.first_x+w,z=t.first_y+R,J=t.last_x-w,tt=t.last_y+R,rt=this.render_options.thickness,at=(J-k)/(b.length+2);a.beginPath(),a.moveTo(k,z),a.bezierCurveTo(k+at+b[0].x,z+b[0].y*t.direction,J-at+b[1].x,tt+b[1].y*t.direction,J,tt),a.bezierCurveTo(J-at+b[1].x,tt+(b[1].y+rt)*t.direction,k+at+b[0].x,z+(b[0].y+rt)*t.direction,k,z),a.stroke(),a.closePath(),a.fill()}draw(){this.checkContext(),this.setRendered();const t=this.from,a=this.to;let b,w,R,k,z,J="baseY",tt="baseY";function rt(lt){return"string"==typeof lt?ae.PositionString[lt]:lt}const at=rt(this.render_options.position),ht=rt(this.render_options.position_end);return at===ae.Position.NEAR_TOP&&(J="topY",tt="topY"),ht===ae.Position.NEAR_HEAD?tt="baseY":ht===ae.Position.NEAR_TOP&&(tt="topY"),t?(b=t.getTieRightX(),z=t.getStemDirection(),R=t.getStemExtents()[J]):(b=a.getStave().getTieStartX(),R=a.getStemExtents()[J]),a?(w=a.getTieLeftX(),z=a.getStemDirection(),k=a.getStemExtents()[tt]):(w=t.getStave().getTieEndX(),k=t.getStemExtents()[tt]),this.renderCurve({first_x:b,last_x:w,first_y:R,last_y:k,direction:z*(!0===this.render_options.invert?-1:1)}),!0}}function je(...ut){Me.DEBUG&&l.L("Vex.Flow.TextDynamics",ut)}class Me extends j{static get GLYPHS(){return{f:{code:"vba",width:12},p:{code:"vbf",width:14},m:{code:"v62",width:17},s:{code:"v4a",width:10},z:{code:"v80",width:12},r:{code:"vb1",width:12}}}constructor(t){super(t),this.setAttribute("type","TextDynamics"),this.sequence=t.text.toLowerCase(),this.line=t.line||0,this.glyphs=[],l.Merge(this.render_options,{glyph_font_size:40}),je("New Dynamics Text: ",this.sequence)}setLine(t){return this.line=t,this}preFormat(){let t=0;return this.sequence.split("").forEach(a=>{const b=Me.GLYPHS[a];if(!b)throw new l.RERR("Invalid dynamics character: "+a);const R=new m(b.code,this.render_options.glyph_font_size);this.glyphs.push(R),t+=b.width}),this.setWidth(t),this.preFormatted=!0,this}draw(){this.setRendered();const t=this.getAbsoluteX(),a=this.stave.getYForLine(this.line+-3);je("Rendering Dynamics: ",this.sequence);let b=t;this.glyphs.forEach((w,R)=>{const k=this.sequence[R];w.render(this.context,b,a),b+=Me.GLYPHS[k].width})}}function Ye(ut,t,a,b,w,R,k){ut.beginPath(),ut.moveTo(t,a),ut.lineTo(b,w),ut.lineTo(R,k),ut.lineTo(t,a),ut.closePath(),ut.fill()}class ue extends o{static get TextVerticalPosition(){return{TOP:1,BOTTOM:2}}static get TextJustification(){return{LEFT:1,CENTER:2,RIGHT:3}}constructor(t){super(),this.setAttribute("type","StaveLine"),this.notes=t,this.text="",this.font={family:"Arial",size:10,weight:""},this.render_options={padding_left:4,padding_right:3,line_width:1,line_dash:null,rounded_end:!0,color:null,draw_start_arrow:!1,draw_end_arrow:!1,arrowhead_length:10,arrowhead_angle:Math.PI/8,text_position_vertical:ue.TextVerticalPosition.TOP,text_justification:ue.TextJustification.CENTER},this.setNotes(t)}setFont(t){return this.font=t,this}setText(t){return this.text=t,this}setNotes(t){if(!t.first_note&&!t.last_note)throw new l.RuntimeError("BadArguments","Notes needs to have either first_note or last_note set.");if(t.first_indices||(t.first_indices=[0]),t.last_indices||(t.last_indices=[0]),t.first_indices.length!==t.last_indices.length)throw new l.RuntimeError("BadArguments","Connected notes must have similar index sizes");return this.first_note=t.first_note,this.first_indices=t.first_indices,this.last_note=t.last_note,this.last_indices=t.last_indices,this}applyLineStyle(){const t=this.checkContext(),a=this.render_options;a.line_dash&&t.setLineDash(a.line_dash),a.line_width&&t.setLineWidth(a.line_width),t.setLineCap(a.rounded_end?"round":"square")}applyFontStyle(){const t=this.checkContext();this.font&&t.setFont(this.font.family,this.font.size,this.font.weight),this.render_options.color&&(t.setStrokeStyle(this.render_options.color),t.setFillStyle(this.render_options.color))}draw(){const t=this.checkContext();this.setRendered();const a=this.first_note,b=this.last_note,w=this.render_options;let R,k;t.save(),this.applyLineStyle(),this.first_indices.forEach((ht,lt)=>{const ft=this.last_indices[lt];R=a.getModifierStartXY(2,ht),k=b.getModifierStartXY(1,ft);const bt=R.y>k.y;R.x+=a.getMetrics().modRightPx+w.padding_left,k.x-=b.getMetrics().modLeftPx+w.padding_right;const mt=a.getGlyph().getWidth();a.getKeyProps()[ht].displaced&&1===a.getStemDirection()&&(R.x+=mt+w.padding_left),b.getKeyProps()[ft].displaced&&-1===b.getStemDirection()&&(k.x-=mt+w.padding_right),R.y+=bt?-3:1,k.y+=bt?2:0,function(xt,wt,Tt,Pt){const Lt=Pt.draw_start_arrow&&Pt.draw_end_arrow,Ct=wt.x,kt=wt.y,Gt=Tt.x,zt=Tt.y,ne=Math.sqrt((Gt-Ct)*(Gt-Ct)+(zt-kt)*(zt-kt)),Zt=(ne-Pt.arrowhead_length/3)/ne;let $t,le,fe,Ae;Pt.draw_end_arrow||Lt?($t=Math.round(Ct+(Gt-Ct)*Zt),le=Math.round(kt+(zt-kt)*Zt)):($t=Gt,le=zt),Pt.draw_start_arrow||Lt?(fe=Ct+(Gt-Ct)*(1-Zt),Ae=kt+(zt-kt)*(1-Zt)):(fe=Ct,Ae=kt),Pt.color&&(xt.setStrokeStyle(Pt.color),xt.setFillStyle(Pt.color)),xt.beginPath(),xt.moveTo(fe,Ae),xt.lineTo($t,le),xt.stroke(),xt.closePath();const Te=Math.atan2(zt-kt,Gt-Ct),ge=Math.abs(Pt.arrowhead_length/Math.cos(Pt.arrowhead_angle));let we,Pe,Be,Fe,De,Oe;(Pt.draw_end_arrow||Lt)&&(we=Te+Math.PI+Pt.arrowhead_angle,Be=Gt+Math.cos(we)*ge,Fe=zt+Math.sin(we)*ge,Pe=Te+Math.PI-Pt.arrowhead_angle,De=Gt+Math.cos(Pe)*ge,Oe=zt+Math.sin(Pe)*ge,Ye(xt,Be,Fe,Gt,zt,De,Oe)),(Pt.draw_start_arrow||Lt)&&(we=Te+Pt.arrowhead_angle,Be=Ct+Math.cos(we)*ge,Fe=kt+Math.sin(we)*ge,Pe=Te-Pt.arrowhead_angle,De=Ct+Math.cos(Pe)*ge,Oe=kt+Math.sin(Pe)*ge,Ye(xt,Be,Fe,Ct,kt,De,Oe))}(t,R,k,this.render_options)}),t.restore();const z=t.measureText(this.text).width,J=w.text_justification;let tt,rt=0;J===ue.TextJustification.LEFT?rt=R.x:J===ue.TextJustification.CENTER?rt=(k.x-R.x)/2+R.x-z/2:J===ue.TextJustification.RIGHT&&(rt=k.x-z);const at=w.text_position_vertical;return at===ue.TextVerticalPosition.TOP?tt=a.getStave().getYForTopText():at===ue.TextVerticalPosition.BOTTOM&&(tt=a.getStave().getYForBottomText(p.TEXT_HEIGHT_OFFSET_HACK)),t.save(),this.applyFontStyle(),t.fillText(this.text,rt,tt),t.restore(),this}}function We(ut,t,a,b,w){const R=Vt.GLYPHS[ut];new m(R.code,w).render(t,a+R.x_shift,b+R.y_shift)}class Vt extends o{static get GLYPHS(){return{pedal_depress:{code:"v36",x_shift:-10,y_shift:0},pedal_release:{code:"v5d",x_shift:-2,y_shift:3}}}static get Styles(){return{TEXT:1,BRACKET:2,MIXED:3,MIXED_OPEN_END:4,BRACKET_OPEN_BEGIN:5,BRACKET_OPEN_END:6,BRACKET_OPEN_BOTH:7}}static get StylesString(){return{text:Vt.Styles.TEXT,bracket:Vt.Styles.BRACKET,mixed:Vt.Styles.MIXED,mixed_open_end:Vt.Styles.MIXED_OPEN_END,bracket_open_begin:Vt.Styles.BRACKET_OPEN_BEGIN,bracket_open_end:Vt.Styles.BRACKET_OPEN_END,bracket_open_both:Vt.Styles.BRACKET_OPEN_BOTH}}static createSustain(t){return new Vt(t)}static createSostenuto(t){const a=new Vt(t);return a.setStyle(Vt.Styles.MIXED),a.setCustomText("Sost. Ped."),a}static createUnaCorda(t){const a=new Vt(t);return a.setStyle(Vt.Styles.TEXT),a.setCustomText("una corda","tre corda"),a}constructor(t){super(),this.setAttribute("type","PedalMarking"),this.EndsStave=!1,this.ChangeBegin=!1,this.ChangeEnd=!1,this.notes=t,this.style=Vt.TEXT,this.line=0,this.custom_depress_text="",this.custom_release_text="",this.font={family:"Times New Roman",size:12,weight:"italic bold"},this.render_options={bracket_height:10,text_margin_right:6,bracket_line_width:1,glyph_point_size:40,color:"black"}}setEndStave(t){if(this.endStave=t,this.endStaveAddedWidth=0,this.startMargin=0,this.endMargin=0,Array.isArray(this.endStave.modifiers))for(let a=0;a<this.endStave.modifiers.length;a++){let b=this.endStave.modifiers[a];b&&b.position===It.Position.END&&b.width&&(this.endStaveAddedWidth+=b.width)}}setCustomText(t,a){return this.custom_depress_text=t||"",this.custom_release_text=a||"",this}setStyle(t){if(t<1&&t>3)throw new l.RERR("InvalidParameter","The style must be one found in PedalMarking.Styles");return this.style=t,this}setLine(t){return this.line=t,this}drawBracketed(){const t=this.context;let a,b,w=!1;const R=this;this.notes.forEach((k,z,J)=>{w=!w;let tt=0;if(k?(tt=k.getNoteHeadBeginX(),this.BeginsStave&&(tt=k.getStave().getNoteStartX())):tt=this.endStave.end_x+this.endStaveAddedWidth,this.EndsStave)w?this.ChangeBegin&&(tt=k.getAbsoluteX()):(tt=k?this.ChangeEnd?k.getAbsoluteX():k.getStave().end_x+this.endStaveAddedWidth-R.render_options.text_margin_right:this.endStave.end_x+this.endStaveAddedWidth-R.render_options.text_margin_right,this.endMargin=-R.render_options.text_margin_right);else if(k)if(w)this.ChangeBegin&&(tt=k.getAbsoluteX());else switch(R.style){case Vt.Styles.BRACKET_OPEN_END:case Vt.Styles.BRACKET_OPEN_BOTH:case Vt.Styles.MIXED_OPEN_END:tt=k.getNoteHeadEndX();break;default:this.ChangeEnd?tt=k.getAbsoluteX():(tt=k.getNoteHeadBeginX()-R.render_options.text_margin_right,this.startMargin=-R.render_options.text_margin_right)}let rt=this.endStave;k&&(rt=k.getStave());let at=rt.getYForBottomText(R.line+3);b&&b>at&&(at=b);const ht=J[z+1]===k,lt=J[z-1]===k;let ft=0;if(w)if(ft=lt?5:0,R.style!==Vt.Styles.MIXED&&R.style!==Vt.Styles.MIXED_OPEN_END||lt)t.beginPath(),R.style===Vt.Styles.BRACKET_OPEN_BEGIN||R.style===Vt.Styles.BRACKET_OPEN_BOTH?t.moveTo(tt+ft,at):(this.ChangeBegin&&(tt+=5),t.moveTo(tt,at-R.render_options.bracket_height),this.ChangeBegin&&(tt+=5),t.lineTo(tt+ft,at)),t.stroke(),t.closePath();else if(R.custom_depress_text){const bt=t.measureText(R.custom_depress_text).width;t.fillText(R.custom_depress_text,tt-bt/2,at),ft=bt/2+R.render_options.text_margin_right}else We("pedal_depress",t,tt,at,R.render_options.glyph_point_size),ft=20+R.render_options.text_margin_right;else ft=ht&&!this.EndsStave?-5:0,t.beginPath(),t.moveTo(a,b),t.lineTo(tt+ft,at),R.style!==Vt.Styles.BRACKET_OPEN_END&&R.style!==Vt.Styles.MIXED_OPEN_END&&R.style!==Vt.Styles.BRACKET_OPEN_BOTH&&(this.ChangeEnd&&(tt+=5),t.lineTo(tt,at-R.render_options.bracket_height)),t.stroke(),t.closePath();a=tt+ft,b=at})}drawText(){const t=this.context;let a=!1;const b=this,w=b.render_options.glyph_point_size;this.notes.forEach(R=>{if(!R)return;a=!a;const k=R.getStave(),z=R.getAbsoluteX(),J=k.getYForBottomText(b.line+3);let tt=0;a?b.custom_depress_text?(tt=t.measureText(b.custom_depress_text).width,t.fillText(b.custom_depress_text,z-tt/2,J)):We("pedal_depress",t,z,J,w):b.custom_release_text?(tt=t.measureText(b.custom_release_text).width,t.fillText(b.custom_release_text,z-tt/2,J)):We("pedal_release",t,z,J,w)})}draw(){const t=this.checkContext();this.setRendered(),t.save(),t.setStrokeStyle(this.render_options.color),t.setFillStyle(this.render_options.color),t.setFont(this.font.family,this.font.size,this.font.weight),Vt.DEBUG&&l.L("Vex.Flow.PedalMarking",["Rendering Pedal Marking"]),this.style===Vt.Styles.BRACKET||this.style===Vt.Styles.MIXED||this.style===Vt.Styles.MIXED_OPEN_END||this.style===Vt.Styles.BRACKET_OPEN_BEGIN||this.style===Vt.Styles.BRACKET_OPEN_END||this.style===Vt.Styles.BRACKET_OPEN_BOTH?(t.setLineWidth(this.render_options.bracket_line_width),this.drawBracketed()):this.style===Vt.Styles.TEXT&&this.drawText(),t.restore()}}class te extends o{static get Positions(){return{TOP:1,BOTTOM:-1}}static get PositionString(){return{top:te.Positions.TOP,bottom:te.Positions.BOTTOM}}constructor({start:t,stop:a,text:b="",superscript:w="",position:R=te.Positions.TOP}){super(),this.setAttribute("type","TextBracket"),this.start=t,this.stop=a,this.text=b,this.superscript=w,this.position="string"==typeof R?te.PositionString[R]:R,this.line=1,this.font={family:"Serif",size:15,weight:"italic"},this.render_options={dashed:!0,dash:[5],color:"black",line_width:1,show_bracket:!0,bracket_height:8,underline_superscript:!0}}applyStyle(t){return t.setFont(this.font.family,this.font.size,this.font.weight),t.setStrokeStyle(this.render_options.color),t.setFillStyle(this.render_options.color),t.setLineWidth(this.render_options.line_width),this}setDashed(t,a){return this.render_options.dashed=t,a&&(this.render_options.dash=a),this}setFont(t){return this.font={...this.font,...t},this}setLine(t){return this.line=t,this}draw(){const t=this.context;this.setRendered();let a=0;switch(this.position){case te.Positions.TOP:a=this.start.getStave().getYForTopText(this.line);break;case te.Positions.BOTTOM:a=this.start.getStave().getYForBottomText(this.line+p.TEXT_HEIGHT_OFFSET_HACK);break;default:throw new l.RERR("InvalidPosition",`The position ${this.position} is invalid`)}const b={x:this.start.getAbsoluteX(),y:a},w={x:this.stop.getAbsoluteX(),y:a};!function(...ft){te.DEBUG&&l.L("Vex.Flow.TextBracket",ft)}("Rendering TextBracket: start:",b,"stop:",w,"y:",a);const R=this.render_options.bracket_height*this.position;t.save(),this.applyStyle(t),t.fillText(this.text,b.x,b.y);let k=t.measureText(this.text).width;k>0||(k=10*this.text.length);let z=t.measureText("M").width;z>0||(z=20);const J=b.y-z/2.5;t.setFont(this.font.family,this.font.size/1.4,this.font.weight),t.fillText(this.superscript,b.x+k+1,J);let tt=t.measureText(this.superscript).width;tt>0||(tt=12,this.superscript.includes("m")&&(tt+=5));let rt=t.measureText("M").width;rt>0||(rt=10);let at=b.x,ht=J,lt=w.x+this.stop.getGlyph().getWidth();this.position===te.Positions.TOP?(at+=k+tt+5,ht-=rt/2.7):this.position===te.Positions.BOTTOM&&(ht+=rt/2.7,at+=k+2,this.render_options.underline_superscript||(at+=tt)),this.render_options.dashed?(lt<at+5&&this.position===te.Positions.TOP?lt=at+5:lt<at+tt&&this.position===te.Positions.BOTTOM&&(lt=at+tt),x.drawDashedLine(t,at,ht,lt,ht,this.render_options.dash),this.render_options.show_bracket&&x.drawDashedLine(t,lt,ht+1*this.position,lt,ht+R,this.render_options.dash)):(t.beginPath(),t.moveTo(at,ht),t.lineTo(lt,ht),this.render_options.show_bracket&&t.lineTo(lt,ht+R),t.stroke(),t.closePath()),t.restore()}}class Ie extends j{constructor(t=Rt.type.SINGLE){super({duration:"b"}),this.setAttribute("type","BarNote"),this.metrics={widths:{}};const a=Rt.type;this.metrics.widths={[a.SINGLE]:8,[a.DOUBLE]:12,[a.END]:15,[a.REPEAT_BEGIN]:14,[a.REPEAT_END]:14,[a.REPEAT_BOTH]:18,[a.NONE]:0},this.ignore_ticks=!0,this.setType(t)}getType(){return this.type}setType(t){return this.type="string"==typeof t?Rt.typeString[t]:t,this.setWidth(this.metrics.widths[this.type]),this}getBoundingBox(){return super.getBoundingBox()}addToModifierContext(){return this}preFormat(){return this.setPreFormatted(!0),this}draw(){if(this.checkContext(),!this.stave)throw new l.RERR("NoStave","Can't draw without a stave.");!function(...a){Ie.DEBUG&&l.L("Vex.Flow.BarNote",a)}("Rendering bar line at: ",this.getAbsoluteX());const t=new Rt(this.type);t.setX(this.getAbsoluteX()),t.draw(this.stave),this.setRendered()}}class Ke extends U{constructor(t){if(!t)throw new l.RuntimeError("BadArguments","Ghost note must have valid initialization data to identify duration.");let a;if("string"==typeof t)a={duration:t};else{if("object"!=typeof t)throw new l.RuntimeError("BadArguments","Ghost note must have valid initialization data to identify duration.");a=t}super(a),this.setAttribute("type","GhostNote"),this.setWidth(0)}isRest(){return!0}setStave(t){super.setStave(t)}addToModifierContext(){return this}preFormat(){return this.setPreFormatted(!0),this}draw(){if(!this.stave)throw new l.RERR("NoStave","Can't draw without a stave.");this.setRendered();for(let t=0;t<this.modifiers.length;++t){const a=this.modifiers[t];a.setContext(this.context),a.drawWithStyle()}}}class Ee extends Y{static get CATEGORY(){return"tremolo"}static get YOFFSETSTEMUP(){return-9}static get YOFFSETSTEMDOWN(){return-21}static get XOFFSETSTEMUP(){return 6}static get XOFFSETSTEMDOWN(){return-2}constructor(t){super(),this.setAttribute("type","Tremolo"),this.num=t,this.note=null,this.index=null,this.position=Y.Position.CENTER,this.code="v74",this.y_spacing_scale=1,this.extra_stroke_scale=1,this.y_offset_for_beam=5}getCategory(){return Ee.CATEGORY}draw(){if(this.checkContext(),!this.note||null==this.index)throw new l.RERR("NoAttachedNote","Can't draw Tremolo without a note and index.");this.setRendered();const t=this.note.getStemDirection();this.y_spacing=4*t*this.y_spacing_scale;let a=this.note.getModifierStartXY(this.position,this.index).x,b=this.note.stem.getExtents().topY,w="gracenotes"===this.note.getCategory()?ye.SCALE:1;w*=this.extra_stroke_scale,b+=t<0?Ee.YOFFSETSTEMDOWN*w:Ee.YOFFSETSTEMUP*w,this.note.beam&&(b+=this.y_offset_for_beam*t),this.font={family:"Arial",size:16*w,weight:""},this.render_options={font_scale:35*w,stroke_px:3,stroke_spacing:10*w},a+=t<0?Ee.XOFFSETSTEMDOWN:Ee.XOFFSETSTEMUP;for(let R=0;R<this.num;++R)m.renderGlyph(this.context,a,b,this.render_options.font_scale,this.code),b+=this.y_spacing}}class Ue extends j{constructor(t){super(t),this.setAttribute("type","Crescendo"),this.decrescendo=!1,this.line=t.line||0,this.height=15,l.Merge(this.render_options,{extend_left:0,extend_right:0,y_shift:0})}setLine(t){return this.line=t,this}setHeight(t){return this.height=t,this}setDecrescendo(t){return this.decrescendo=t,this}preFormat(){return this.preFormatted=!0,this}draw(){this.checkContext(),this.setRendered();const t=this.getTickContext(),a=q.getNextContext(t),b=this.getAbsoluteX(),w=a?a.getX():this.stave.x+this.stave.width,R=this.stave.getYForLine(this.line+-3)+1;(function(...k){Ue.DEBUG&&l.L("Vex.Flow.Crescendo",k)})("Drawing ",this.decrescendo?"decrescendo ":"crescendo ",this.height,"x",b-w),function(k,z){const J=z.begin_x,tt=z.end_x,rt=z.y,at=z.height/2;k.beginPath(),z.reverse?(k.moveTo(J,rt-at),k.lineTo(tt,rt),k.lineTo(J,rt+at)):(k.moveTo(tt,rt-at),k.lineTo(J,rt),k.lineTo(tt,rt+at)),k.stroke(),k.closePath()}(this.context,{begin_x:b-this.render_options.extend_left,end_x:w+this.render_options.extend_right,y:R+this.render_options.y_shift,height:this.height,reverse:this.decrescendo})}}const qe=l.MakeException("ParserError");function Ce(ut){return void 0!==ut.matchedString?ut.matchedString:ut.results?Ce(ut.results):1===ut.length?Ce(ut[0]):0===ut.length?null:ut.map(Ce)}class Ne{constructor(t){this.grammar=t}parse(t){this.line=t,this.pos=0,this.errorPos=-1;const a=this.expect(this.grammar.begin());return a.errorPos=this.errorPos,a}matchFail(t){-1===this.errorPos&&(this.errorPos=this.pos),this.pos=t}matchSuccess(){this.errorPos=-1}matchToken(t,a=!1){const b=a?new RegExp("^(("+t+"))"):new RegExp("^(("+t+")\\s*)"),w=this.line.slice(this.pos).match(b);return null!==w?{success:!0,matchedString:w[2],incrementPos:w[1].length,pos:this.pos}:{success:!1,pos:this.pos}}expectOne(t,a=!1){const b=[],w=this.pos;let R=!0,k=!1;a=!0===a||!0===t.maybe;for(let tt=0;tt<t.expect.length;tt++){const at=this.pos,ht=this.expect(t.expect[tt]);if(ht.success){if(b.push(ht),k=!0,t.or)break}else if(R=!1,!t.or){this.pos=at;break}}const z=t.or&&k||R,J=z||!0===a;return a&&!z&&(this.pos=w),J?this.matchSuccess():this.matchFail(w),{success:J,results:b,numMatches:z?1:0}}expectOneOrMore(t,a=!1){const b=[],w=this.pos;let R=0,k=!0;do{const J=this.expectOne(t);J.success?(R++,b.push(J.results)):k=!1}while(k);const z=R>0||!0===a;return!a||R>0||(this.pos=w),z?this.matchSuccess():this.matchFail(w),{success:z,results:b,numMatches:R}}expectZeroOrMore(t){return this.expectOneOrMore(t,!0)}expect(t){let a;if(function(...w){Ne.DEBUG&&l.L("Vex.Flow.Parser",w)}("Evaluating rules:",t),!t)throw new qe("Invalid Rule: "+t,t);const b=t.bind(this.grammar)();if(b.token)a=this.matchToken(b.token,!0===b.noSpace),a.success&&(this.pos+=a.incrementPos);else{if(!b.expect)throw new qe("Bad grammar! No `token` or `expect` property",b);a=b.oneOrMore?this.expectOneOrMore(b):b.zeroOrMore?this.expectZeroOrMore(b):this.expectOne(b)}return a.matches=[],a.results&&a.results.forEach(w=>a.matches.push(Ce(w))),b.run&&a.success&&b.run(a),a}}function de(...ut){ze.DEBUG&&l.L("Vex.Flow.EasyScore",ut)}const Ze=l.MakeException("EasyScoreError");class Qe{constructor(t){this.builder=t}begin(){return this.LINE}LINE(){return{expect:[this.PIECE,this.PIECES,this.EOL]}}PIECE(){return{expect:[this.CHORDORNOTE,this.PARAMS],run:()=>this.builder.commitPiece()}}PIECES(){return{expect:[this.COMMA,this.PIECE],zeroOrMore:!0}}PARAMS(){return{expect:[this.DURATION,this.TYPE,this.DOTS,this.OPTS]}}CHORDORNOTE(){return{expect:[this.CHORD,this.SINGLENOTE],or:!0}}CHORD(){return{expect:[this.LPAREN,this.NOTES,this.RPAREN],run:t=>this.builder.addChord(t.matches[1])}}NOTES(){return{expect:[this.NOTE],oneOrMore:!0}}NOTE(){return{expect:[this.NOTENAME,this.ACCIDENTAL,this.OCTAVE]}}SINGLENOTE(){return{expect:[this.NOTENAME,this.ACCIDENTAL,this.OCTAVE],run:t=>this.builder.addSingleNote(t.matches[0],t.matches[1],t.matches[2])}}ACCIDENTAL(){return{expect:[this.ACCIDENTALS],maybe:!0}}DOTS(){return{expect:[this.DOT],zeroOrMore:!0,run:t=>this.builder.setNoteDots(t.matches[0])}}TYPE(){return{expect:[this.SLASH,this.MAYBESLASH,this.TYPES],maybe:!0,run:t=>this.builder.setNoteType(t.matches[2])}}DURATION(){return{expect:[this.SLASH,this.DURATIONS],maybe:!0,run:t=>this.builder.setNoteDuration(t.matches[1])}}OPTS(){return{expect:[this.LBRACKET,this.KEYVAL,this.KEYVALS,this.RBRACKET],maybe:!0}}KEYVALS(){return{expect:[this.COMMA,this.KEYVAL],zeroOrMore:!0}}KEYVAL(){return{expect:[this.KEY,this.EQUALS,this.VAL],run:t=>this.builder.addNoteOption(t.matches[0],t.matches[2].slice(1,-1))}}VAL(){return{expect:[this.SVAL,this.DVAL],or:!0}}KEY(){return{token:"[a-zA-Z][a-zA-Z0-9]*"}}DVAL(){return{token:'["][^"]*["]'}}SVAL(){return{token:"['][^']*[']"}}NOTENAME(){return{token:"[a-gA-G]"}}OCTAVE(){return{token:"[0-9]+"}}ACCIDENTALS(){return{token:"bbs|bb|bss|bs|b|db|d|##|#|n|\\+\\+-|\\+-|\\+\\+|\\+|k|o"}}DURATIONS(){return{token:"[0-9whq]+"}}TYPES(){return{token:"[rRsSxX]"}}LPAREN(){return{token:"[(]"}}RPAREN(){return{token:"[)]"}}COMMA(){return{token:"[,]"}}DOT(){return{token:"[.]"}}SLASH(){return{token:"[/]"}}MAYBESLASH(){return{token:"[/]?"}}EQUALS(){return{token:"[=]"}}LBRACKET(){return{token:"\\["}}RBRACKET(){return{token:"\\]"}}EOL(){return{token:"$"}}}class ti{constructor(t){this.factory=t,this.commitHooks=[],this.reset()}reset(t={}){this.options={stem:"auto",clef:"treble"},this.elements={notes:[],accidentals:[]},this.rollingDuration="8",this.resetPiece(),Object.assign(this.options,t)}getFactory(){return this.factory}getElements(){return this.elements}addCommitHook(t){this.commitHooks.push(t)}resetPiece(){de("resetPiece"),this.piece={chord:[],duration:this.rollingDuration,dots:0,type:void 0,options:{}}}setNoteDots(t){de("setNoteDots:",t),t&&(this.piece.dots=t.length)}setNoteDuration(t){de("setNoteDuration:",t),this.rollingDuration=this.piece.duration=t||this.rollingDuration}setNoteType(t){de("setNoteType:",t),t&&(this.piece.type=t)}addNoteOption(t,a){de("addNoteOption: key:",t,"value:",a),this.piece.options[t]=a}addNote(t,a,b){de("addNote:",t,a,b),this.piece.chord.push({key:t,accid:a,octave:b})}addSingleNote(t,a,b){de("addSingleNote:",t,a,b),this.addNote(t,a,b)}addChord(t){de("startChord"),"object"!=typeof t[0]?this.addSingleNote(t[0]):t.forEach(a=>{a&&this.addNote(...a)}),de("endChord")}commitPiece(){de("commitPiece");const{factory:t}=this;if(!t)return;const a={...this.options,...this.piece.options},{stem:b,clef:w}=a,R="auto"===b.toLowerCase(),k=R||"up"!==b.toLowerCase()?ot.STEM_DOWN:ot.STEM_UP,{chord:z,duration:J,dots:tt,type:rt}=this.piece,at=z.map(ft=>ft.key+"/"+ft.octave),ht=t.StaveNote({keys:at,duration:J,dots:tt,type:rt,clef:w,auto_stem:R});R||ht.setStemDirection(k);const lt=z.map(ft=>ft.accid||null);lt.forEach((ft,bt)=>{ft&&ht.addAccidental(bt,t.Accidental({type:ft}))});for(let ft=0;ft<tt;ft++)ht.addDotToAll();this.commitHooks.forEach(ft=>ft(a,ht,this)),this.elements.notes.push(ht),this.elements.accidentals.concat(lt),this.resetPiece()}}function ei({id:ut},t){void 0!==ut&&t.setAttribute("id",ut)}function ii(ut,t){ut.class&&ut.class.split(/\s*,\s*/).forEach(a=>t.addClass(a))}class ze{constructor(t={}){this.setOptions(t),this.defaults={clef:"treble",time:"4/4",stem:"auto"}}set(t){return Object.assign(this.defaults,t),this}setOptions(t){return this.options={factory:null,builder:null,commitHooks:[ei,ii,St.easyScoreHook],throwOnError:!1,...t},this.factory=this.options.factory,this.builder=this.options.builder||new ti(this.factory),this.grammar=new Qe(this.builder),this.parser=new Ne(this.grammar),this.options.commitHooks.forEach(a=>this.addCommitHook(a)),this}setContext(t){return this.factory&&this.factory.setContext(t),this}parse(t,a={}){this.builder.reset(a);const b=this.parser.parse(t);if(!b.success&&this.options.throwOnError)throw new Ze("Error parsing line: "+t,b);return b}beam(t,a={}){return this.factory.Beam({notes:t,options:a}),t}tuplet(t,a={}){return this.factory.Tuplet({notes:t,options:a}),t}notes(t,a={}){return a={clef:this.defaults.clef,stem:this.defaults.stem,...a},this.parse(t,a),this.builder.getElements().notes}voice(t,a){return a={time:this.defaults.time,...a},this.factory.Voice(a).addTickables(t)}addCommitHook(t){return this.builder.addCommitHook(t)}}const si=l.MakeException("FactoryError");function Kt(ut={},t){const a=t.options;return(ut=Object.assign(t,ut)).options=Object.assign(a,ut.options),ut}class Le{constructor(t){!function(...b){Le.DEBUG&&l.L("Vex.Flow.Factory",b)}("New factory: ",t),this.options={stave:{space:10},renderer:{context:null,elementId:"",backend:x.Backends.SVG,width:500,height:200,background:"#FFF"},font:{face:"Arial",point:10,style:""}},this.setOptions(t)}static newFromElementId(t,a=500,b=200){return new Le({renderer:{elementId:t,width:a,height:b}})}reset(){this.renderQ=[],this.systems=[],this.staves=[],this.voices=[],this.stave=null}getOptions(){return this.options}setOptions(t){for(const a of["stave","renderer","font"])Object.assign(this.options[a],t[a]);(null!==this.options.renderer.elementId||this.options.renderer.context)&&this.initRenderer(),this.reset()}initRenderer(){const{elementId:t,backend:a,width:b,height:w,background:R}=this.options.renderer;if(""===t)throw new si("HTML DOM element not set in Factory");this.context=x.buildContext(t,a,b,w,R)}getContext(){return this.context}setContext(t){return this.context=t,this}getStave(){return this.stave}getVoices(){return this.voices}space(t){return this.options.stave.space*t}Stave(t){t=Kt(t,{x:0,y:0,width:this.options.renderer.width-this.space(1),options:{spacing_between_lines_px:this.options.stave.space}});const a=new Yt(t.x,t.y,t.width,t.options);return this.staves.push(a),a.setContext(this.context),this.stave=a,a}TabStave(t){t=Kt(t,{x:0,y:0,width:this.options.renderer.width-this.space(1),options:{spacing_between_lines_px:1.3*this.options.stave.space}});const a=new qt(t.x,t.y,t.width,t.options);return this.staves.push(a),a.setContext(this.context),this.stave=a,a}StaveNote(t){const a=new ot(t);return this.stave&&a.setStave(this.stave),a.setContext(this.context),this.renderQ.push(a),a}GhostNote(t){const a=new Ke(t);return this.stave&&a.setStave(this.stave),a.setContext(this.context),this.renderQ.push(a),a}TextNote(t){const a=new Xt(t);return this.stave&&a.setStave(this.stave),a.setContext(this.context),this.renderQ.push(a),a}BarNote(t){t=Kt(t,{type:"single",options:{}});const a=new Ie(t.type);return this.stave&&a.setStave(this.stave),a.setContext(this.context),this.renderQ.push(a),a}ClefNote(t){t=Kt(t,{type:"treble",options:{size:"default"}});const a=new Se(t.type,t.options.size,t.options.annotation);return this.stave&&a.setStave(this.stave),a.setContext(this.context),this.renderQ.push(a),a}TimeSigNote(t){t=Kt(t,{time:"4/4",options:{}});const a=new Xe(t.time);return this.stave&&a.setStave(this.stave),a.setContext(this.context),this.renderQ.push(a),a}KeySigNote(t){const a=new He(t.key,t.cancelKey,t.alterKey);return this.stave&&a.setStave(this.stave),a.setContext(this.context),this.renderQ.push(a),a}TabNote(t){const a=new Ht(t);return this.stave&&a.setStave(this.stave),a.setContext(this.context),this.renderQ.push(a),a}GraceNote(t){const a=new ye(t);return this.stave&&a.setStave(this.stave),a.setContext(this.context),a}GraceNoteGroup(t){const a=new W(t.notes,t.slur);return a.setContext(this.context),a}Accidental(t){t=Kt(t,{type:null,options:{}});const a=new N(t.type);return a.setContext(this.context),a}Annotation(t){t=Kt(t,{text:"p",vJustify:"below",hJustify:"center",fontFamily:"Times",fontSize:14,fontWeight:"bold italic",options:{}});const a=new yt(t.text);return a.setJustification(t.hJustify),a.setVerticalJustification(t.vJustify),a.setFont(t.fontFamily,t.fontSize,t.fontWeight),a.setContext(this.context),a}Articulation(t){t=Kt(t,{type:"a.",position:"above",options:{}});const a=new St(t.type);return a.setPosition(t.position),a.setContext(this.context),a}TextDynamics(t){t=Kt(t,{text:"p",duration:"q",dots:0,line:0,options:{}});const a=new Me({text:t.text,line:t.line,duration:t.duration,dots:t.dots});return this.stave&&a.setStave(this.stave),a.setContext(this.context),this.renderQ.push(a),a}Fingering(t){t=Kt(t,{number:"0",position:"left",options:{}});const a=new $(t.number);return a.setPosition(t.position),a.setContext(this.context),a}StringNumber(t){t=Kt(t,{number:"0",position:"left",options:{}});const a=new K(t.number);return a.setPosition(t.position),a.setContext(this.context),a}TickContext(){return(new q).setContext(this.context)}ModifierContext(){return new Nt}MultiMeasureRest(t){const a=new he(t.number_of_measures,t);return a.setContext(this.context),this.renderQ.push(a),a}Voice(t){t=Kt(t,{time:"4/4",options:{}});const a=new D(t.time);return this.voices.push(a),a}StaveConnector(t){t=Kt(t,{top_stave:null,bottom_stave:null,type:"double",options:{}});const a=new F(t.top_stave,t.bottom_stave);return a.setType(t.type).setContext(this.context),this.renderQ.push(a),a}Formatter(){return new Ot}Tuplet(t){t=Kt(t,{notes:[],options:{}});const a=new I(t.notes,t.options).setContext(this.context);return this.renderQ.push(a),a}Beam(t){t=Kt(t,{notes:[],options:{autoStem:!1,secondaryBeamBreaks:[]}});const a=new B(t.notes,t.options.autoStem).setContext(this.context);return a.breakSecondaryAt(t.options.secondaryBeamBreaks),this.renderQ.push(a),a}Curve(t){t=Kt(t,{from:null,to:null,options:{}});const a=new ae(t.from,t.to,t.options).setContext(this.context);return this.renderQ.push(a),a}StaveTie(t){t=Kt(t,{from:null,to:null,first_indices:[0],last_indices:[0],text:null,options:{direction:void 0}});const a=new O({first_note:t.from,last_note:t.to,first_indices:t.first_indices,last_indices:t.last_indices},t.text);return t.options.direction&&a.setDirection(t.options.direction),a.setContext(this.context),this.renderQ.push(a),a}StaveLine(t){t=Kt(t,{from:null,to:null,first_indices:[0],last_indices:[0],options:{}});const a=new ue({first_note:t.from,last_note:t.to,first_indices:t.first_indices,last_indices:t.last_indices});return t.options.text&&a.setText(t.options.text),t.options.font&&a.setFont(t.options.font),a.setContext(this.context),this.renderQ.push(a),a}VibratoBracket(t){t=Kt(t,{from:null,to:null,options:{harsh:!1}});const a=new Jt({start:t.from,stop:t.to});return t.options.line&&a.setLine(t.options.line),t.options.harsh&&a.setHarsh(t.options.harsh),a.setContext(this.context),this.renderQ.push(a),a}TextBracket(t){t=Kt(t,{from:null,to:null,text:"",options:{superscript:"",position:1}});const a=new te({start:t.from,stop:t.to,text:t.text,superscript:t.options.superscript,position:t.options.position});return t.options.line&&a.setLine(t.options.line),t.options.font&&a.setFont(t.options.font),a.setContext(this.context),this.renderQ.push(a),a}System(t={}){t.factory=this;const a=new $e(t).setContext(this.context);return this.systems.push(a),a}EasyScore(t={}){return t.factory=this,new ze(t)}PedalMarking(t={}){t=Kt(t,{notes:[],options:{style:"mixed"}});const a=new Vt(t.notes);return a.setStyle(Vt.StylesString[t.options.style]),a.setContext(this.context),this.renderQ.push(a),a}NoteSubGroup(t={}){t=Kt(t,{notes:[],options:{}});const a=new C(t.notes);return a.setContext(this.context),a}draw(){this.systems.forEach(t=>t.setContext(this.context).format()),this.staves.forEach(t=>t.setContext(this.context).draw()),this.voices.forEach(t=>t.setContext(this.context).draw()),this.renderQ.forEach(t=>{t.isRendered()||t.setContext(this.context).draw()}),this.systems.forEach(t=>t.setContext(this.context).draw()),this.reset()}}function Je(ut,t){const a=t.options;return(ut=Object.assign(t,ut)).options=Object.assign(a,ut.options),ut}class $e extends o{constructor(t={}){super(),this.setAttribute("type","System"),this.setOptions(t),this.parts=[]}setOptions(t={}){this.options=Je(t,{x:10,y:10,width:500,connector:null,spaceBetweenStaves:12,factory:null,debugFormatter:!1,formatIterations:0,options:{}}),this.factory=this.options.factory||new Le({renderer:{el:null}})}setContext(t){return super.setContext(t),this.factory.setContext(t),this}addConnector(t="double"){return this.connector=this.factory.StaveConnector({top_stave:this.parts[0].stave,bottom_stave:this.parts[this.parts.length-1].stave,type:t}),this.connector}addStave(t){return(t=Je(t,{stave:null,voices:[],spaceAbove:0,spaceBelow:0,debugNoteMetrics:!1,options:{left_bar:!1}})).stave||(t.stave=this.factory.Stave({x:this.options.x,y:this.options.y,width:this.options.width,options:t.options})),t.voices.forEach(a=>a.setContext(this.context).setStave(t.stave).getTickables().forEach(b=>b.setStave(t.stave))),this.parts.push(t),t.stave}format(){const t=new Ot;this.formatter=t;let a=this.options.y,b=0,w=[];const R=[];this.parts.forEach(z=>{a+=z.stave.space(z.spaceAbove),z.stave.setY(a),t.joinVoices(z.voices),a+=z.stave.space(z.spaceBelow),a+=z.stave.space(this.options.spaceBetweenStaves),z.debugNoteMetrics&&(R.push({y:a,voice:z.voices[0]}),a+=15),w=w.concat(z.voices),b=Math.max(b,z.stave.getNoteStartX())}),this.parts.forEach(z=>z.stave.setNoteStartX(b)),t.format(w,this.options.width-(b-this.options.x)-j.STAVEPADDING);for(let z=0;z<this.options.formatIterations;z++)t.tune();this.startX=b,this.debugNoteMetricsYs=R,this.lastY=a}draw(){const t=this.checkContext();this.setRendered(),this.options.debugFormatter&&Ot.plotDebugging(t,this.formatter,this.startX,this.options.y,this.lastY),this.debugNoteMetricsYs.forEach(a=>{a.voice.getTickables().forEach(b=>j.plotMetrics(t,b,a.y))})}}(l.Flow=p).Element=o,l.Flow.Fraction=s,l.Flow.Renderer=x,l.Flow.Formatter=Ot,l.Flow.Music=it,l.Flow.Glyph=m,l.Flow.Stave=Yt,l.Flow.StaveNote=ot,l.Flow.StaveModifier=It,l.Flow.StaveTempo=se,l.Flow.Voice=D,l.Flow.Accidental=N,l.Flow.Beam=B,l.Flow.StaveTie=O,l.Flow.TabStave=qt,l.Flow.TabNote=Ht,l.Flow.Bend=vt,l.Flow.Vibrato=_t,l.Flow.VibratoBracket=Jt,l.Flow.Note=j,l.Flow.ModifierContext=Nt,l.Flow.MultiMeasureRest=he,l.Flow.TickContext=q,l.Flow.Articulation=St,l.Flow.Annotation=yt,l.Flow.Barline=Rt,l.Flow.NoteHead=P,l.Flow.StaveConnector=F,l.Flow.ClefNote=Se,l.Flow.KeySignature=Wt,l.Flow.KeySigNote=He,l.Flow.TimeSignature=jt,l.Flow.TimeSigNote=Xe,l.Flow.Stem=_,l.Flow.TabTie=X,l.Flow.Clef=Qt,l.Flow.Dot=H,l.Flow.Modifier=Y,l.Flow.TabSlide=ce,l.Flow.Tuplet=I,l.Flow.GraceNote=ye,l.Flow.GraceTabNote=Ge,l.Flow.Tuning=Re,l.Flow.KeyManager=class{constructor(ut){this.music=new it,this.setKey(ut)}setKey(ut){return this.key=ut,this.reset(),this}getKey(){return this.key}reset(){if(this.keyParts=this.music.getKeyParts(this.key),this.keyString=this.keyParts.root,this.keyParts.accidental&&(this.keyString+=this.keyParts.accidental),!it.scaleTypes[this.keyParts.type])throw new l.RERR("BadArguments",`Unsupported key type: ${this.key}`);this.scale=this.music.getScaleTones(this.music.getNoteValue(this.keyString),it.scaleTypes[this.keyParts.type]),this.scaleMap={},this.scaleMapByValue={},this.originalScaleMapByValue={};const ut=it.root_indices[this.keyParts.root];for(let t=0;t<it.roots.length;++t){const b=it.roots[(ut+t)%it.roots.length],w=this.music.getRelativeNoteName(b,this.scale[t]);this.scaleMap[b]=w,this.scaleMapByValue[this.scale[t]]=w,this.originalScaleMapByValue[this.scale[t]]=w}return this}getAccidental(ut){const t=this.music.getKeyParts(ut).root,a=this.music.getNoteParts(this.scaleMap[t]);return{note:this.scaleMap[t],accidental:a.accidental}}selectNote(ut){ut=ut.toLowerCase();const t=this.music.getNoteParts(ut),a=this.scaleMap[t.root],b=this.music.getNoteParts(a);if(a===ut)return{note:a,accidental:t.accidental,change:!1};const w=this.scaleMapByValue[this.music.getNoteValue(ut)];if(null!=w)return{note:w,accidental:this.music.getNoteParts(w).accidental,change:!1};const R=this.originalScaleMapByValue[this.music.getNoteValue(ut)];return null!=R?(this.scaleMap[b.root]=R,delete this.scaleMapByValue[this.music.getNoteValue(a)],this.scaleMapByValue[this.music.getNoteValue(ut)]=R,{note:R,accidental:this.music.getNoteParts(R).accidental,change:!0}):b.root===ut?(delete this.scaleMapByValue[this.music.getNoteValue(this.scaleMap[t.root])],this.scaleMapByValue[this.music.getNoteValue(b.root)]=b.root,this.scaleMap[b.root]=b.root,{note:b.root,accidental:null,change:!0}):(delete this.scaleMapByValue[this.music.getNoteValue(this.scaleMap[t.root])],this.scaleMapByValue[this.music.getNoteValue(ut)]=ut,delete this.scaleMap[b.root],this.scaleMap[b.root]=ut,{note:ut,accidental:t.accidental,change:!0})}},l.Flow.StaveHairpin=_e,l.Flow.BoundingBox=h,l.Flow.Stroke=G,l.Flow.TextNote=Xt,l.Flow.Curve=ae,l.Flow.TextDynamics=Me,l.Flow.StaveLine=ue,l.Flow.Ornament=Mt,l.Flow.PedalMarking=Vt,l.Flow.TextBracket=te,l.Flow.FretHandFinger=$,l.Flow.Repetition=Dt,l.Flow.BarNote=Ie,l.Flow.GhostNote=Ke,l.Flow.NoteSubGroup=C,l.Flow.GraceNoteGroup=W,l.Flow.Tremolo=Ee,l.Flow.Str
1ingNumber=K,l.Flow.Crescendo=Ue,l.Flow.Volta=Ut,l.Flow.Font=e,l.Flow.System=$e,l.Flow.Factory=Le,l.Flow.Parser=Ne,l.Flow.EasyScore=ze,l.Flow.Registry=i;const ni=l},5166(dt){"use strict";dt.exports="precision mediump float;\nuniform sampler2D u_image;\nvarying vec4 v_position;\n\n#define NUM_ROWS 5\n#define ELEMENT_HEIGHT 300\n\nvoid main() {\n const float halfPixel = 1.0 / float(ELEMENT_HEIGHT * 2);\n\n vec2 absolutePosition = (v_position.xy + vec2(1.0)) / vec2(2.0);\n float absX = absolutePosition.x;\n float absY = absolutePosition.y;\n\n int skyLine = 0;\n for (int i = 0; i < ELEMENT_HEIGHT; ++i) {\n float ratioY = float(i) / float(ELEMENT_HEIGHT);\n float relY = (ratioY - 0.5 + halfPixel) / float(NUM_ROWS);\n float x = absX;\n float y = absY + relY;\n\n float currentAlpha = texture2D(u_image, vec2(x, y)).a;\n if (currentAlpha > 0.0) {\n skyLine = i;\n break;\n }\n }\n\n int bottomLine = ELEMENT_HEIGHT;\n for (int i = ELEMENT_HEIGHT - 1; i >= 0; --i) {\n float ratioY = float(i) / float(ELEMENT_HEIGHT);\n float relY = (ratioY - 0.5 + halfPixel) / float(NUM_ROWS);\n float x = absX;\n float y = absY + relY;\n\n float currentAlpha = texture2D(u_image, vec2(x, y)).a;\n if (currentAlpha > 0.0) {\n bottomLine = i;\n break;\n }\n }\n\n int r = skyLine;\n if (r > 256) {\n r -= 256;\n }\n int g = bottomLine;\n if (g > 256) {\n g -= 256;\n }\n int b = (skyLine / 256 * 16) + (bottomLine / 256);\n\n gl_FragColor = vec4(float(r) / 255.0, float(g) / 255.0, float(b) / 255.0, 1.0);\n}\n"},5340(dt){"use strict";dt.exports="attribute vec4 a_position;\nvarying vec4 v_position;\n\nvoid main() {\n gl_Position = a_position;\n v_position = a_position;\n}\n"}},pe={};function ee(dt){var g=pe[dt];if(void 0!==g)return g.exports;var u=pe[dt]={exports:{}};return ve[dt].call(u.exports,u,u.exports,ee),u.exports}return ee.d=(dt,g)=>{for(var u in g)ee.o(g,u)&&!ee.o(dt,u)&&Object.defineProperty(dt,u,{enumerable:!0,get:g[u]})},ee.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch{if("object"==typeof window)return window}}(),ee.o=(dt,g)=>Object.prototype.hasOwnProperty.call(dt,g),ee.r=dt=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(dt,Symbol.toStringTag,{value:"Module"}
1),Object.defineProperty(dt,"__esModule",{value:!0})},ee(8156)})(),xe.exports=pe()},4323:xe=>{function ke(be,ve,pe,ee,dt,g,u){try{var l=be[g](u),s=l.value}catch(c){return void pe(c)}l.done?ve(s):Promise.resolve(s).then(ee,dt)}xe.exports=function Ve(be){return function(){var ve=this,pe=arguments;return new Promise(function(ee,dt){var g=be.apply(ve,pe);function u(s){ke(g,ee,dt,u,l,"next",s)}function l(s){ke(g,ee,dt,u,l,"throw",s)}u(void 0)})}},xe.exports.__esModule=!0,xe.exports.default=xe.exports}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.