(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-vendors"],{"0019":function(t,e){},"003f":function(t,e){},"00d7":function(t,e){},"00e5":function(t,e){},"013e":function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var i=n("5b43"),s=n("8af4");const r=(t,e,n,r,o,a)=>(c,{curve:l,oversample:u,...h})=>{const d=n(c,t=>t.createWaveShaper()),f=n(c,t=>t.createWaveShaper());Object(i["a"])(d,h),Object(i["a"])(f,h);const p=r(c,{...h,gain:1}),m=r(c,{...h,gain:-1}),g=r(c,{...h,gain:1}),b=r(c,{...h,gain:-1});let v=null,y=!1,S=null;const x={get bufferSize(){},get channelCount(){return d.channelCount},set channelCount(t){p.channelCount=t,m.channelCount=t,d.channelCount=t,g.channelCount=t,f.channelCount=t,b.channelCount=t},get channelCountMode(){return d.channelCountMode},set channelCountMode(t){p.channelCountMode=t,m.channelCountMode=t,d.channelCountMode=t,g.channelCountMode=t,f.channelCountMode=t,b.channelCountMode=t},get channelInterpretation(){return d.channelInterpretation},set channelInterpretation(t){p.channelInterpretation=t,m.channelInterpretation=t,d.channelInterpretation=t,g.channelInterpretation=t,f.channelInterpretation=t,b.channelInterpretation=t},get context(){return d.context},get curve(){return S},set curve(n){if(null!==l&&l.length<2)throw e();if(null===n)d.curve=n,f.curve=n;else{const t=n.length,e=new Float32Array(t+2-t%2),i=new Float32Array(t+2-t%2);e[0]=n[0],i[0]=-n[t-1];const s=Math.ceil((t+1)/2),r=(t+1)/2-1;for(let o=1;o{p.connect(d).connect(g),p.connect(m).connect(f).connect(b).connect(g),y=!0,o(S)&&(v=t(c,p))},w=()=>{p.disconnect(d),d.disconnect(g),p.disconnect(m),m.disconnect(f),f.disconnect(b),b.disconnect(g),y=!1,null!==v&&(v(),v=null)};return a(Object(s["a"])(x,g),_,w)}},"0148":function(t,e){},"0164":function(t,e){},"0183":function(t,e){},"01e7":function(t,e){},"01ef":function(t,e){},"01f0":function(t,e,n){var i;(function(e){t.exports=e()})((function(){return function t(e,n,s){function r(a,c){if(!n[a]){if(!e[a]){var l="function"==typeof i&&i;if(!c&&l)return i(a,!0);if(o)return o(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var h=n[a]={exports:{}};e[a][0].call(h.exports,(function(t){var n=e[a][1][t];return r(n||t)}),h,h.exports,t,e,n,s)}return n[a].exports}for(var o="function"==typeof i&&i,a=0;a=l?t?"":void 0:(r=a.charCodeAt(c),r<55296||r>56319||c+1===l||(o=a.charCodeAt(c+1))<56320||o>57343?t?a.charAt(c):r:t?a.slice(c,c+2):o-56320+(r-55296<<10)+65536)}}},"0390":function(t,e,n){"use strict";var i=n("02f4")(!0);t.exports=function(t,e,n){return e+(n?i(t,e).length:1)}},"03ab":function(t,e){},"03fb":function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var i=n("383e"),s=n("1e82"),r=n("c895");const o={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",offset:1},a=(t,e,n,a,c,l,u)=>class extends t{constructor(t,s=o){const r=c(t),u={...o,...s},h=a(r,u),d=l(r),f=d?n():null;super(t,!1,h,f),this._constantSourceNodeRenderer=f,this._nativeConstantSourceNode=h,this._offset=e(this,d,h.offset,i["b"],i["a"]),this._onended=null}get offset(){return this._offset}get onended(){return this._onended}set onended(t){const e="function"===typeof t?u(this,t):null;this._nativeConstantSourceNode.onended=e;const n=this._nativeConstantSourceNode.onended;this._onended=null!==n&&n===e?t:n}start(t=0){if(this._nativeConstantSourceNode.start(t),null!==this._constantSourceNodeRenderer)this._constantSourceNodeRenderer.start=t;else{Object(s["a"])(this);const t=()=>{this._nativeConstantSourceNode.removeEventListener("ended",t),setTimeout(()=>Object(r["a"])(this),1e3)};this._nativeConstantSourceNode.addEventListener("ended",t)}}stop(t=0){this._nativeConstantSourceNode.stop(t),null!==this._constantSourceNodeRenderer&&(this._constantSourceNodeRenderer.stop=t)}}},"042e":function(t,e,n){var i=n("5ca1");i(i.S,"Math",{fround:n("91ca")})},"0454":function(t,e){},"049b":function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));const i=t=>{const e=new Uint32Array([1179011410,40,1163280727,544501094,16,131073,44100,176400,1048580,1635017060,4,0]);try{const n=t.decodeAudioData(e.buffer,()=>{});return void 0!==n&&(n.catch(()=>{}),!0)}catch{}return!1}},"049f":function(t,e,n){var i=n("5ca1");i(i.S,"Math",{log1p:n("d6c6")})},"04ff":function(t,e,n){var i=n("5ca1"),s=n("3ca5");i(i.S+i.F*(Number.parseInt!=s),"Number",{parseInt:s})},"050c":function(t,e){},"050d":function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));const i=t=>"inputs"in t},"0589":function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var i=n("a8ce");const s=(t,e,n,s,r)=>class extends s{constructor(t={}){if(null===r)throw new Error("Missing the native AudioContext constructor.");const s=new r(t);if(null===s)throw n();if(!Object(i["a"])(t.latencyHint))throw new TypeError(`The provided value '${t.latencyHint}' is not a valid enum value of type AudioContextLatencyCategory.`);if(void 0!==t.sampleRate&&s.sampleRate!==t.sampleRate)throw e();super(s,2);const{latencyHint:o}=t,{sampleRate:a}=s;if(this._baseLatency="number"===typeof s.baseLatency?s.baseLatency:"balanced"===o?512/a:"interactive"===o||void 0===o?256/a:"playback"===o?1024/a:128*Math.max(2,Math.min(128,Math.round(o*a/128)))/a,this._nativeAudioContext=s,this._state=null,"running"===s.state){this._state="suspended";const t=()=>{"suspended"===this._state&&(this._state=null),s.removeEventListener("statechange",t)};s.addEventListener("statechange",t)}}get baseLatency(){return this._baseLatency}get state(){return null!==this._state?this._state:this._nativeAudioContext.state}close(){return"closed"===this.state?this._nativeAudioContext.close().then(()=>{throw t()}):("suspended"===this._state&&(this._state=null),this._nativeAudioContext.close())}resume(){return"suspended"===this._state?new Promise((t,e)=>{const n=()=>{this._nativeAudioContext.removeEventListener("statechange",n),"running"===this._nativeAudioContext.state?t():this.resume().then(t,e)};this._nativeAudioContext.addEventListener("statechange",n)}):this._nativeAudioContext.resume().catch(e=>{if(void 0===e||15===e.code)throw t();throw e})}suspend(){return this._nativeAudioContext.suspend().catch(e=>{if(void 0===e)throw t();throw e})}}},"0596":function(t,e){},"05ac":function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));const i=t=>()=>{if(null===t)return!1;const e=new t(1,1,44100),n=e.createConvolver();n.buffer=e.createBuffer(1,1,e.sampleRate);try{n.buffer=e.createBuffer(1,1,e.sampleRate)}catch{return!1}return!0}},"0606":function(t,e){},"064c":function(t,e){},"06df":function(t,e){},"06ef":function(t,e){},"0799":function(t,e){},"07d2":function(t,e){},"0872":function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var i=n("050d"),s=n("e190");const r=(t,e,n,r,o,a,c,l,u,h)=>()=>{const d=new WeakMap;let f=null;const p=async(p,m,g)=>{let b=null,v=a(p);const y={channelCount:v.channelCount,channelCountMode:v.channelCountMode,channelInterpretation:v.channelInterpretation},S={...y,coneInnerAngle:v.coneInnerAngle,coneOuterAngle:v.coneOuterAngle,coneOuterGain:v.coneOuterGain,distanceModel:v.distanceModel,maxDistance:v.maxDistance,panningModel:v.panningModel,refDistance:v.refDistance,rolloffFactor:v.rolloffFactor},x=Object(s["a"])(v,m);if("bufferSize"in v)b=r(m,{...y,gain:1});else if(!x){const t={...S,orientationX:v.orientationX.value,orientationY:v.orientationY.value,orientationZ:v.orientationZ.value,positionX:v.positionX.value,positionY:v.positionY.value,positionZ:v.positionZ.value};v=o(m,t)}if(d.set(m,null===b?v:b),null!==b){if(null===f){if(null===c)throw new Error("Missing the native OfflineAudioContext constructor.");const t=new c(6,p.context.length,m.sampleRate),i=e(t,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:6});i.connect(t.destination),f=(async()=>{const e=await Promise.all([p.orientationX,p.orientationY,p.orientationZ,p.positionX,p.positionY,p.positionZ].map(async(e,i)=>{const s=n(t,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:0===i?1:0});return await l(t,e,s.offset,g),s}));for(let t=0;t<6;t+=1)e[t].connect(i,0,t),e[t].start(0);return h(t)})()}const t=await f,i=r(m,{...y,gain:1});await u(p,m,i,g);const s=[];for(let e=0;et!==a[e])||n.some((t,e)=>t!==d[e])){a=t,d=n;const s=e/m.sampleRate;v.gain.setValueAtTime(0,s),v=r(m,{...y,gain:0}),x=o(m,{...S,orientationX:a[0],orientationY:a[1],orientationZ:a[2],positionX:d[0],positionY:d[1],positionZ:d[2]}),v.gain.setValueAtTime(1,s),i.connect(v).connect(x.inputs[0]),x.connect(b)}}return b}return x?(await t(m,p.orientationX,v.orientationX,g),await t(m,p.orientationY,v.orientationY,g),await t(m,p.orientationZ,v.orientationZ,g),await t(m,p.positionX,v.positionX,g),await t(m,p.positionY,v.positionY,g),await t(m,p.positionZ,v.positionZ,g)):(await l(m,p.orientationX,v.orientationX,g),await l(m,p.orientationY,v.orientationY,g),await l(m,p.orientationZ,v.orientationZ,g),await l(m,p.positionX,v.positionX,g),await l(m,p.positionY,v.positionY,g),await l(m,p.positionZ,v.positionZ,g)),Object(i["a"])(v)?await u(p,m,v.inputs[0],g):await u(p,m,v,g),v};return{render(t,e,n){const i=d.get(e);return void 0!==i?Promise.resolve(i):p(t,e,n)}}}},"08cd":function(t,e){},"091a":function(t,e){},"097d":function(t,e,n){"use strict";var i=n("5ca1"),s=n("8378"),r=n("7726"),o=n("ebd6"),a=n("bcaa");i(i.P+i.R,"Promise",{finally:function(t){var e=o(this,s.Promise||r.Promise),n="function"==typeof t;return this.then(n?function(n){return a(e,t()).then((function(){return n}))}:t,n?function(n){return a(e,t()).then((function(){throw n}))}:t)}})},"09a8":function(t,e){},"09fa":function(t,e,n){var i=n("4588"),s=n("9def");t.exports=function(t){if(void 0===t)return 0;var e=i(t),n=s(e);if(e!==n)throw RangeError("Wrong length!");return n}},"0a06":function(t,e,n){"use strict";var i=n("c532"),s=n("30b5"),r=n("f6b4"),o=n("5270"),a=n("4a7b");function c(t){this.defaults=t,this.interceptors={request:new r,response:new r}}c.prototype.request=function(t){"string"===typeof t?(t=arguments[1]||{},t.url=arguments[0]):t=t||{},t=a(this.defaults,t),t.method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var e=[o,void 0],n=Promise.resolve(t);this.interceptors.request.forEach((function(t){e.unshift(t.fulfilled,t.rejected)})),this.interceptors.response.forEach((function(t){e.push(t.fulfilled,t.rejected)}));while(e.length)n=n.then(e.shift(),e.shift());return n},c.prototype.getUri=function(t){return t=a(this.defaults,t),s(t.url,t.params,t.paramsSerializer).replace(/^\?/,"")},i.forEach(["delete","get","head","options"],(function(t){c.prototype[t]=function(e,n){return this.request(a(n||{},{method:t,url:e,data:(n||{}).data}))}})),i.forEach(["post","put","patch"],(function(t){c.prototype[t]=function(e,n,i){return this.request(a(i||{},{method:t,url:e,data:n}))}})),t.exports=c},"0a1f":function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var i=n("0bf9"),s=n("180a"),r=n("5b43"),o=n("7fa0"),a=n("545f");const c=(t,e,n,c,l,u,h)=>(d,f)=>{const p=n(d,t=>t.createOscillator());return Object(r["a"])(p,f),Object(i["a"])(p,f,"detune"),Object(i["a"])(p,f,"frequency"),void 0!==f.periodicWave?p.setPeriodicWave(f.periodicWave):Object(s["a"])(p,f,"type"),e(c,()=>c(d))||Object(o["a"])(p),e(l,()=>l(d))||h(p,d),e(u,()=>u(d))||Object(a["a"])(p),t(d,p),p}},"0a20":function(t,e,n){"use strict";n.d(e,"a",(function(){return X}));var i=n("752e"),s=n("59e9"),r=n("264b");const o=t=>"port"in t;var a=n("7b45"),c=n("e427");const l=(t,e)=>{const n=Object(c["a"])(t);if(!n.delete(e))throw new Error("Missing the expected event listener.")};var u=n("7af2"),h=n("7d82"),d=n("fe69"),f=n("8543"),p=n("38e4"),m=n("d057"),g=n("5d98"),b=n("aeeb"),v=n("2286");const y=t=>!i["a"].has(t),S=(t,e)=>{const n=Array.from(t).filter(e);if(n.length>1)throw Error("More than one element was found.");if(0===n.length)throw Error("No element was found.");const[i]=n;return t.delete(i),i};var x=n("1e82"),_=n("c895");const w=(t,e)=>{!o(t)&&e.every(t=>0===t.size)&&Object(_["a"])(t)},E=t=>new Promise(e=>{const n=t.createScriptProcessor(256,1,1),i=t.createGain(),s=t.createBuffer(1,2,44100),r=s.getChannelData(0);r[0]=1,r[1]=1;const o=t.createBufferSource();o.buffer=s,o.loop=!0,o.connect(n).connect(t.destination),o.connect(i),o.disconnect(i),n.onaudioprocess=i=>{const s=i.inputBuffer.getChannelData(0);Array.prototype.some.call(s,t=>1===t)?e(!0):e(!1),o.stop(),n.onaudioprocess=null,o.disconnect(n),n.disconnect(t.destination)},o.start()}),T=(t,e)=>{const n=new Map;for(const i of t)for(const t of i){const e=n.get(t);n.set(t,void 0===e?1:e+1)}n.forEach((t,n)=>e(n,t))};var C=n("c965");const M=t=>{const e=new Map;t.connect=(t=>(n,i=0,s=0)=>{const r=Object(C["a"])(n)?t(n,i,s):t(n,i),o=e.get(n);return void 0===o?e.set(n,[{input:s,output:i}]):o.every(t=>t.input!==s||t.output!==i)&&o.push({input:s,output:i}),r})(t.connect.bind(t)),t.disconnect=(n=>(i,s,r)=>{if(n.apply(t),void 0===i)e.clear();else if("number"===typeof i)for(const[t,n]of e){const s=n.filter(t=>t.output!==i);0===s.length?e.delete(t):e.set(t,s)}else if(e.has(i))if(void 0===s)e.delete(i);else{const t=e.get(i);if(void 0!==t){const n=t.filter(t=>t.output!==s&&(t.input!==r||void 0===r));0===n.length?e.delete(i):e.set(i,n)}}for(const[n,o]of e)o.forEach(e=>{Object(C["a"])(n)?t.connect(n,e.output,e.input):t.connect(n,e.output)})})(t.disconnect)},P=(t,e,[n,i,s],r)=>{Object(g["a"])(t[i],[e,n,s],t=>t[0]===e&&t[1]===n,r)},A=(t,e,[n,i],s)=>{Object(g["a"])(t,[e,n,i],t=>t[0]===e&&t[1]===n,s)},I=(t,e,n,i)=>S(t[i],t=>t[0]===e&&t[1]===n),L=(t,e,n)=>S(t,t=>t[0]===e&&t[1]===n),O=(t,e,[n,i,s],r)=>{const o=t.get(n);void 0===o?t.set(n,new Set([[i,e,s]])):Object(g["a"])(o,[i,e,s],t=>t[0]===i&&t[1]===e,r)},k=(t,[e,n,i],s)=>{const r=t.get(e);void 0===r?t.set(e,new Set([[n,i]])):Object(g["a"])(r,[n,i],t=>t[0]===n,s)},R=(t,e,n,i)=>{const s=Object(m["a"])(t,e),r=S(s,t=>t[0]===n&&t[1]===i);return 0===s.size&&t.delete(e),r},N=(t,e,n)=>{const i=Object(m["a"])(t,e),s=S(i,t=>t[0]===n);return 0===i.size&&t.delete(e),s},D=(t,e,n,i)=>{const{activeInputs:s,passiveInputs:r}=Object(h["a"])(e),{outputs:o}=Object(h["a"])(t),l=Object(c["a"])(t),d=o=>{const c=Object(f["a"])(e),l=Object(f["a"])(t);if(o){const o=R(r,t,n,i);P(s,t,o,!1),Object(v["a"])(t)||Object(a["a"])(l,c,n,i),y(e)&&Object(x["a"])(e)}else{const o=I(s,t,n,i);O(r,i,o,!1),Object(v["a"])(t)||Object(u["a"])(l,c,n,i),Object(b["a"])(e)&&w(e,s)}};return!!Object(g["a"])(o,[e,n,i],t=>t[0]===e&&t[1]===n&&t[2]===i,!0)&&(l.add(d),Object(b["a"])(t)?P(s,t,[n,i,d],!0):O(r,i,[t,n,d],!0),!0)},V=(t,e,n,i)=>{const{outputs:s}=Object(h["a"])(t);if(Object(g["a"])(s,[e,n,i],t=>t[0]===e&&t[1]===n&&t[2]===i,!0)){const{activeInputs:s}=Object(h["a"])(e);return P(s,t,[n,i,null],!0),!0}return!1},B=(t,e,n)=>{const{activeInputs:i,passiveInputs:s}=Object(d["a"])(e),{outputs:r}=Object(h["a"])(t),o=Object(c["a"])(t),a=r=>{const o=Object(f["a"])(t),a=Object(p["a"])(e);if(r){const e=N(s,t,n);A(i,t,e,!1),Object(v["a"])(t)||o.connect(a,n)}else{const e=L(i,t,n);k(s,e,!1),Object(v["a"])(t)||o.disconnect(a,n)}};return!!Object(g["a"])(r,[e,n],t=>t[0]===e&&t[1]===n,!0)&&(o.add(a),Object(b["a"])(t)?A(i,t,[n,a],!0):k(s,[t,n,a],!0),!0)},F=(t,e,n)=>{const{outputs:i}=Object(h["a"])(t);if(Object(g["a"])(i,[e,n],t=>t[0]===e&&t[1]===n,!0)){const{activeInputs:i}=Object(d["a"])(e);return A(i,t,[n,null],!0),!0}return!1},j=(t,e,n)=>{for(const i of t)if(i[0]===e&&i[1]===n)return t.delete(i),i;return null},G=(t,e,n,i)=>{const{activeInputs:s,passiveInputs:r}=Object(h["a"])(e),o=j(s[i],t,n);if(null===o){const e=R(r,t,n,i);return[e[2],!1]}return[o[2],!0]},W=(t,e,n)=>{const{activeInputs:i,passiveInputs:s}=Object(d["a"])(e),r=j(i,t,n);if(null===r){const e=N(s,t,n);return[e[1],!1]}return[r[2],!0]},$=(t,e,n,i)=>{const[s,r]=G(t,e,n,i);if(null!==s&&(l(t,s),r&&!Object(v["a"])(t)&&Object(u["a"])(Object(f["a"])(t),Object(f["a"])(e),n,i)),Object(b["a"])(e)){const{activeInputs:t}=Object(h["a"])(e);w(e,t)}},z=(t,e,n)=>{const[i,s]=W(t,e,n);null!==i&&(l(t,i),s&&!Object(v["a"])(t)&&Object(f["a"])(t).disconnect(Object(p["a"])(e),n))},H=t=>{const e=Object(h["a"])(t),n=[];for(const i of e.outputs)Object(r["a"])(i)?$(t,...i):z(t,...i),n.push(i[0]);return e.outputs.clear(),n},U=(t,e)=>{const n=Object(h["a"])(t),i=[];for(const s of n.outputs)s[1]===e&&(Object(r["a"])(s)?$(t,...s):z(t,...s),i.push(s[0]),n.outputs.delete(s));return i},Y=(t,e,n,i)=>{const s=Object(h["a"])(t);return Array.from(s.outputs).filter(t=>t[0]===e&&(void 0===n||t[1]===n)&&(void 0===i||t[2]===i)).map(e=>(Object(r["a"])(e)?$(t,...e):z(t,...e),s.outputs.delete(e),e[0]))},X=(t,e,n,r,c,l,u,h,d,m,g,b,v,S,_)=>class extends m{constructor(e,s,r,o){super(r),this._context=e,this._nativeAudioNode=r;const a=g(e);b(a)&&!0!==n(E,()=>E(a))&&M(r),i["c"].set(this,r),i["i"].set(this,new Set),s&&Object(x["a"])(this),t(this,o,r)}get channelCount(){return this._nativeAudioNode.channelCount}set channelCount(t){this._nativeAudioNode.channelCount=t}get channelCountMode(){return this._nativeAudioNode.channelCountMode}set channelCountMode(t){this._nativeAudioNode.channelCountMode=t}get channelInterpretation(){return this._nativeAudioNode.channelInterpretation}set channelInterpretation(t){this._nativeAudioNode.channelInterpretation=t}get context(){return this._context}get numberOfInputs(){return this._nativeAudioNode.numberOfInputs}get numberOfOutputs(){return this._nativeAudioNode.numberOfOutputs}connect(t,n=0,i=0){if(n<0||n>=this._nativeAudioNode.numberOfOutputs)throw c();const h=g(this._context),m=_(h);if(v(t)||S(t))throw l();if(Object(s["a"])(t)){const s=Object(f["a"])(t);try{const r=Object(a["a"])(this._nativeAudioNode,s,n,i);if(m||y(this)?this._nativeAudioNode.disconnect(...r):y(t)&&Object(x["a"])(t),o(t)){const t=e.get(s);if(void 0===t){const t=h.createGain();t.connect(r[0],0,r[2]),e.set(s,new Map([[i,t]]))}else if(void 0===t.get(i)){const e=h.createGain();e.connect(r[0],0,r[2]),t.set(i,e)}}}catch(E){if(12===E.code)throw l();throw E}const c=m?V(this,t,n,i):D(this,t,n,i);if(c){const e=d([this],t);T(e,r(m))}return t}const b=Object(p["a"])(t);if("playbackRate"===b.name)throw u();try{this._nativeAudioNode.connect(b,n),(m||y(this))&&this._nativeAudioNode.disconnect(b,n)}catch(E){if(12===E.code)throw l();throw E}const w=m?F(this,t,n):B(this,t,n);if(w){const e=d([this],t);T(e,r(m))}}disconnect(t,e,n){let i;if(void 0===t)i=H(this);else if("number"===typeof t){if(t<0||t>=this.numberOfOutputs)throw c();i=U(this,t)}else{if(void 0!==e&&(e<0||e>=this.numberOfOutputs))throw c();if(Object(s["a"])(t)&&void 0!==n&&(n<0||n>=t.numberOfInputs))throw c();if(i=Y(this,t,e,n),0===i.length)throw l()}for(const s of i){const t=d([this],s);T(t,h)}}}},"0a49":function(t,e,n){var i=n("9b43"),s=n("626a"),r=n("4bf8"),o=n("9def"),a=n("cd1c");t.exports=function(t,e){var n=1==t,c=2==t,l=3==t,u=4==t,h=6==t,d=5==t||h,f=e||a;return function(e,a,p){for(var m,g,b=r(e),v=s(b),y=i(a,p,3),S=o(v.length),x=0,_=n?f(e,S):c?f(e,0):void 0;S>x;x++)if((d||x in v)&&(m=v[x],g=y(m,x,b),t))if(n)_[x]=g;else if(g)switch(t){case 3:return!0;case 5:return m;case 6:return x;case 2:_.push(m)}else if(u)return!1;return h?-1:l||u?u:_}}},"0a90":function(t,e){},"0b21":function(t,e,n){var i=n("5ca1");i(i.S,"Math",{sign:n("96fb")})},"0b3f":function(t,e){},"0b89":function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));const i=(t,e,n)=>(i,{mediaStreamTrack:s})=>"function"===typeof i.createMediaStreamTrackSource?e(i,t=>t.createMediaStreamTrackSource(s)):e(i,e=>{const i=new MediaStream([s]),r=e.createMediaStreamSource(i);if("audio"!==s.kind)throw t();if(n(e))throw new TypeError;return r})},"0bba":function(t,e){},"0bd1":function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));const i=(t,e)=>n=>t.has(n)||e(n)},"0be3":function(t,e){},"0bf6":function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var i=n("dd25");const s=(t,e,n,s,r,o,a,c,l,u,h,d)=>(f,p,m,g=null,b=null)=>{const v=new i["AutomationEventList"](m.defaultValue),y=p?s(v):null,S={get defaultValue(){return m.defaultValue},get maxValue(){return null===g?m.maxValue:g},get minValue(){return null===b?m.minValue:b},get value(){return m.value},set value(t){m.value=t,S.setValueAtTime(t,f.context.currentTime)},cancelAndHoldAtTime(t){if("function"===typeof m.cancelAndHoldAtTime)null===y&&v.flush(f.context.currentTime),v.add(r(t)),m.cancelAndHoldAtTime(t);else{const e=Array.from(v).pop();null===y&&v.flush(f.context.currentTime),v.add(r(t));const n=Array.from(v).pop();m.cancelScheduledValues(t),e!==n&&void 0!==n&&("exponentialRampToValue"===n.type?m.exponentialRampToValueAtTime(n.value,n.endTime):"linearRampToValue"===n.type?m.linearRampToValueAtTime(n.value,n.endTime):"setValue"===n.type?m.setValueAtTime(n.value,n.startTime):"setValueCurve"===n.type&&m.setValueCurveAtTime(n.values,n.startTime,n.duration))}return S},cancelScheduledValues(t){return null===y&&v.flush(f.context.currentTime),v.add(o(t)),m.cancelScheduledValues(t),S},exponentialRampToValueAtTime(t,e){return null===y&&v.flush(f.context.currentTime),v.add(a(t,e)),m.exponentialRampToValueAtTime(t,e),S},linearRampToValueAtTime(t,e){return null===y&&v.flush(f.context.currentTime),v.add(c(t,e)),m.linearRampToValueAtTime(t,e),S},setTargetAtTime(t,e,n){return null===y&&v.flush(f.context.currentTime),v.add(l(t,e,n)),m.setTargetAtTime(t,e,n),S},setValueAtTime(t,e){return null===y&&v.flush(f.context.currentTime),v.add(u(t,e)),m.setValueAtTime(t,e),S},setValueCurveAtTime(t,e,n){if(null!==d&&"webkitAudioContext"===d.name){const i=e+n,s=f.context.sampleRate,r=Math.ceil(e*s),o=Math.floor(i*s),a=o-r,c=new Float32Array(a);for(let u=0;u{const i=e[n];void 0!==i&&i!==t[n].value&&(t[n].value=i)}},"0bfb":function(t,e,n){"use strict";var i=n("cb7c");t.exports=function(){var t=i(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e}},"0c95":function(t,e){},"0d58":function(t,e,n){var i=n("ce10"),s=n("e11e");t.exports=Object.keys||function(t){return i(t,s)}},"0d6d":function(t,e,n){var i=n("d3f4"),s=n("67ab").onFreeze;n("5eda")("freeze",(function(t){return function(e){return t&&i(e)?t(s(e)):e}}))},"0d96":function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var i=n("e190");const s=(t,e,n,s,r)=>o=>{const a=new WeakMap,c=async(c,l,u)=>{let h=n(c);const d=Object(i["a"])(h,l);if(!d){const t={channelCount:h.channelCount,channelCountMode:h.channelCountMode,channelInterpretation:h.channelInterpretation,delayTime:h.delayTime.value,maxDelayTime:o};h=e(l,t)}return a.set(l,h),d?await t(l,c.delayTime,h.delayTime,u):await s(l,c.delayTime,h.delayTime,u),await r(c,l,h,u),h};return{render(t,e,n){const i=a.get(e);return void 0!==i?Promise.resolve(i):c(t,e,n)}}}},"0df6":function(t,e,n){"use strict";t.exports=function(t){return function(e){return t.apply(null,e)}}},"0f1e":function(t,e){},"0f88":function(t,e,n){var i,s=n("7726"),r=n("32e9"),o=n("ca5a"),a=o("typed_array"),c=o("view"),l=!(!s.ArrayBuffer||!s.DataView),u=l,h=0,d=9,f="Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array".split(",");while(h0?arguments[0]:void 0)}},y={get:function(t){if(u(t)){var e=m(t);return!0===e?b(h(this,p)).get(t):e?e[this._i]:void 0}},set:function(t,e){return l.def(h(this,p),t,e)}},S=t.exports=n("e0b8")(p,v,y,l,!0,!0);d&&f&&(i=l.getConstructor(v,p),c(i.prototype,y),a.NEED=!0,r(["delete","has","get","set"],(function(t){var e=S.prototype,n=e[t];o(e,t,(function(e,s){if(u(e)&&!g(e)){this._f||(this._f=new i);var r=this._f[t](e,s);return"set"==t?this:r}return n.call(this,e,s)}))})))},"10c6":function(t,e){},1104:function(t,e){},1130:function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));const i=t=>e=>null!==t&&"function"===typeof t.AudioNode&&e instanceof t.AudioNode},1144:function(t,e){},1169:function(t,e,n){var i=n("2d95");t.exports=Array.isArray||function(t){return"Array"==i(t)}},1170:function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var i=n("752e");const s=(t,e,n)=>s=>{if("closed"===s.state&&null!==e&&"webkitAudioContext"!==e.name){if(!t(s)){const t=i["f"].get(s);if(void 0!==t)return t;const n=new e;return i["f"].set(s,n),n}{const t=i["f"].get(s);if(void 0!==t)return t;if(null!==n){const t=new n(1,1,44100);return i["f"].set(s,t),t}}}return null}},1193:function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));const i=t=>null!==t&&t.isSecureContext},"11a8":function(t,e){},"11e9":function(t,e,n){var i=n("52a7"),s=n("4630"),r=n("6821"),o=n("6a99"),a=n("69a8"),c=n("c69a"),l=Object.getOwnPropertyDescriptor;e.f=n("9e1e")?l:function(t,e){if(t=r(t),e=o(e,!0),c)try{return l(t,e)}catch(n){}if(a(t,e))return s(!i.f.call(t,e),t[e])}},1289:function(t,e){},"12f1":function(t,e){},"130f":function(t,e,n){var i=n("5ca1"),s=n("1991");i(i.G+i.B,{setImmediate:s.set,clearImmediate:s.clear})},1364:function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));const i=t=>e=>{const n=t.get(e);if(void 0===n)throw new Error("The context has no set of AudioWorkletNodes.");return n}},"136a":function(t,e){},1376:function(t,e){},"137b":function(t,e){},"13b5":function(t,e){},"140e":function(t,e,n){"use strict";n.d(e,"AudioContext",(function(){return us}));var i=n("dd25"),s=n("7288"),r=n("87a6"),o=n("893e"),a=n("f003"),c=n("16fe"),l=n("22e6"),u=n("2d17"),h=n("8058"),d=n("b9b0"),f=n("5289"),p=n("97c9"),m=n("3af1"),g=n("c8a9"),b=n("c0b0"),v=n("fbd3"),y=n("0a20"),S=n("0bf6"),x=n("84dc"),_=n("2592"),w=n("d734"),E=n("2c2d"),T=n("19c0"),C=n("b5e3"),M=n("af70"),P=n("c3f1"),A=n("a2b4"),I=n("fc6f"),L=n("8a54"),O=n("c121"),k=n("d3d3"),R=n("49aa"),N=n("03fb"),D=n("3d86"),V=n("c1aa"),B=n("bcc4"),F=n("970e"),j=n("3797"),G=n("8d5d"),W=n("1ccf"),$=n("a57a"),z=n("7ab6"),H=n("0d96"),U=n("38e6"),Y=n("f06f"),X=n("2e93"),K=n("9d14"),q=n("4a2b"),Z=n("9557"),J=n("e9a4"),Q=n("2cae"),tt=n("d475"),et=n("2bb7"),nt=n("a8ba"),it=n("d89a"),st=n("654e"),rt=n("4919"),ot=n("1170"),at=n("98b0"),ct=n("1364"),lt=n("a7f0"),ut=n("894f"),ht=n("c3be"),dt=n("7b2d"),ft=n("a24e"),pt=n("cd00"),mt=n("8810"),gt=n("0bd1"),bt=n("6f7b"),vt=n("4163"),yt=n("91a2"),St=n("1130"),xt=n("bd82"),_t=n("b096"),wt=n("d562"),Et=n("1193"),Tt=(n("bdd3"),n("b510")),Ct=n("e12f"),Mt=n("dd4d"),Pt=n("4034"),At=n("0589"),It=n("c05b"),Lt=n("3673"),Ot=n("f6f8"),kt=n("c53d"),Rt=n("3331"),Nt=n("f988"),Dt=n("aad8"),Vt=n("5ad3"),Bt=n("c896"),Ft=n("6cc2"),jt=n("76a3"),Gt=n("8d85"),Wt=n("e945"),$t=n("3ee3"),zt=n("387e"),Ht=n("823e"),Ut=n("f02c"),Yt=n("afca"),Xt=n("1b8b"),Kt=n("4df9"),qt=n("ba7d"),Zt=n("cec8"),Jt=n("89a4"),Qt=n("df14"),te=n("6915"),ee=n("1b32"),ne=n("dd6b"),ie=n("0b89"),se=n("d017"),re=n("0a1f"),oe=n("cc54"),ae=n("d6db"),ce=n("7487"),le=n("9823"),ue=n("d11d"),he=n("4771"),de=n("a038"),fe=n("013e"),pe=n("f600"),me=n("1dc0"),ge=n("c569"),be=n("d9e7"),ve=n("763e"),ye=n("0872"),Se=n("28bd"),xe=n("e842"),_e=n("5aef"),we=n("fb05"),Ee=n("e70b"),Te=n("565e"),Ce=n("93ab"),Me=n("8338"),Pe=n("a971"),Ae=(n("f638"),n("efe6")),Ie=n("43f1"),Le=n("ed12"),Oe=n("16da"),ke=(n("ce7a"),n("181a"),n("db11"),n("7f19"),n("cafb")),Re=n("f9b9"),Ne=n("23e6"),De=(n("ce90"),n("ae5f"),n("ab1c"),n("05ac"),n("bd33"),n("d2cd"),n("bb21")),Ve=(n("e067"),n("918c")),Be=n("8cd4"),Fe=n("9031"),je=n("37c1"),Ge=n("4661"),We=n("82df"),$e=n("d9c5"),ze=n("b5c1"),He=n("2818"),Ue=n("752e"),Ye=n("7b45"),Xe=n("7af2"),Ke=n("7d82"),qe=n("fe69"),Ze=n("8543"),Je=n("38e4"),Qe=n("d057"),tn=n("5d98"),en=n("aeeb"),nn=n("3dcf"),sn=n("2286"),rn=n("9928"),on=n("fd82"),an=n("049b"),cn=(n("e26b"),n("7f7b")),ln=n("a15f");n("77e9"),n("961a");const un=Object(M["a"])(new Map,new WeakMap),hn=Object(je["a"])(),dn=Object(se["a"])(hn),fn=Object(wt["a"])(dn),pn=Object(Dt["a"])(hn),mn=Object(ot["a"])(fn,pn,dn),gn=Object(Bt["a"])(mn),bn=Object(kt["a"])(un,dt["a"],gn),vn=Object(st["a"])(Ke["a"]),yn=Object(_e["a"])(Ke["a"],vn,sn["a"]),Sn=Object(h["a"])(bn,Ze["a"],yn),xn=new WeakMap,_n=Object(at["a"])(Ue["g"]),wn=new WeakMap,En=Object(Q["a"])(ln["a"]),Tn=Object(yt["a"])(pn),Cn=Object(St["a"])(hn),Mn=Object(xt["a"])(hn),Pn=Object(y["a"])(Object(r["a"])(Ue["b"]),xn,un,Object(ht["a"])(Ue["h"],Xe["a"],Ke["a"],Ze["a"],Je["a"],en["a"]),dt["a"],ft["a"],pe["a"],Object($["a"])(Ye["a"],Ue["h"],Ke["a"],Ze["a"],Je["a"],_n,en["a"],fn),Object(Y["a"])(wn,Ke["a"],Qe["a"]),En,_n,Tn,Cn,Mn,fn),An=Object(u["a"])(Pn,Sn,dt["a"],bn,_n,fn),In=new WeakSet,Ln=Object(Rt["a"])(hn),On=Object(V["a"])(new Uint32Array(1)),kn=Object(Ge["a"])(On,dt["a"]),Rn=Object(We["a"])(On),Nn=Object(d["a"])(In,un,pe["a"],Ln,dn,Object(Pe["a"])(Ln),kn,Rn),Dn=Object(Zt["a"])(gn),Vn=Object(c["a"])(Dn),Bn=Object(ke["a"])(gn),Fn=Object(Re["a"])(gn),jn=Object(Ne["a"])(gn),Gn=Object(ze["a"])(gn),Wn=Object(we["a"])(vn,qe["a"],sn["a"]),$n=Object(O["a"])(Wn),zn=Object(Nt["a"])(Vn,un,gn,Object(Ae["a"])(gn),Object(Ie["a"])(dn),Object(Le["a"])(gn),Object(Oe["a"])(gn),Bn,Fn,jn,cn["a"],Object($e["a"])(rn["a"]),Gn),Hn=Object(xe["a"])(Object(rt["a"])(qe["a"]),Wn),Un=Object(p["a"])($n,zn,Ze["a"],Hn,yn),Yn=Object(S["a"])(Object(o["a"])(Ue["d"]),wn,Ue["e"],x["a"],i["createCancelAndHoldAutomationEvent"],i["createCancelScheduledValuesAutomationEvent"],i["createExponentialRampToValueAutomationEvent"],i["createLinearRampToValueAutomationEvent"],i["createSetTargetAutomationEvent"],i["createSetValueAutomationEvent"],i["createSetValueCurveAutomationEvent"],pn),Xn=Object(f["a"])(Pn,Un,Yn,pt["a"],zn,_n,fn,ln["a"]),Kn=Object(g["a"])(Pn,b["a"],dt["a"],pt["a"],Object(Vt["a"])(Dn,rn["a"]),_n,fn,yn),qn=Object(Wt["a"])(gn),Zn=Object(C["a"])($n,qn,Ze["a"],Hn,yn),Jn=Object(T["a"])(Pn,Yn,Zn,ft["a"],qn,_n,fn),Qn=Object(Ot["a"])(tn["a"],Cn),ti=Object(He["a"])(pt["a"],gn,Qn),ei=Object($t["a"])(gn,ti),ni=Object(A["a"])(ei,Ze["a"],yn),ii=Object(P["a"])(Pn,ni,ei,_n,fn),si=Object(zt["a"])(gn),ri=Object(L["a"])(si,Ze["a"],yn),oi=Object(I["a"])(Pn,ri,si,_n,fn),ai=Object(Ut["a"])(Vn,zn,Dn,Qn),ci=Object(Ht["a"])(Vn,un,gn,ai,Bn,jn),li=Object(D["a"])($n,ci,Ze["a"],Hn,yn),ui=Object(N["a"])(Pn,Yn,li,ci,_n,fn,ln["a"]),hi=Object(Xt["a"])(gn,Dn,Qn),di=Object(Yt["a"])(gn,hi,pe["a"],rn["a"]),fi=Object(F["a"])(di,Ze["a"],yn),pi=Object(B["a"])(Pn,fi,di,_n,fn),mi=Object(Kt["a"])(gn),gi=Object(H["a"])($n,mi,Ze["a"],Hn,yn),bi=Object(z["a"])(Pn,Yn,gi,mi,_n,fn),vi=Object(qt["a"])(gn,pe["a"]),yi=Object(q["a"])($n,vi,Ze["a"],Hn,yn),Si=Object(K["a"])(Pn,Yn,yi,vi,pe["a"],_n,fn),xi=Object(it["a"])($n,Dn,Ze["a"],Hn,yn),_i=Object(nt["a"])(Pn,Yn,xi,Dn,_n,fn),wi=Object(le["a"])(gn),Ei=Object(Qt["a"])(ft["a"],pt["a"],wi,pe["a"]),Ti=Object(Ee["a"])(un,Dn,wi,Object(De["a"])(Dn,dn)),Ci=Object(ut["a"])(zn,gn,Ze["a"],dn,yn,Ti),Mi=Object(Jt["a"])(gn,Ei),Pi=Object(lt["a"])(Pn,Mi,Ci,_n,fn),Ai=Object(v["a"])(Yn,ei,ci,wi,fn),Ii=new WeakMap,Li=Object(It["a"])(Kn,Ai,En,fn,Ii,ln["a"]),Oi=Object(re["a"])(Vn,un,gn,Bn,Fn,jn,Gn),ki=Object(be["a"])($n,Oi,Ze["a"],Hn,yn),Ri=Object(ge["a"])(Pn,Yn,pt["a"],Oi,ki,_n,fn,ln["a"]),Ni=Object(R["a"])(zn),Di=Object(fe["a"])(Ni,pt["a"],gn,Dn,nn["a"],Qn),Vi=Object(de["a"])(Ni,pt["a"],gn,Di,nn["a"],Qn,rn["a"]),Bi=Object(ae["a"])(Ye["a"],pt["a"],gn,ei,Dn,wi,Vi,pe["a"],Xe["a"],Qn),Fi=Object(oe["a"])(gn,Bi),ji=Object(ye["a"])($n,ei,ci,Dn,Fi,Ze["a"],dn,Hn,yn,Ti),Gi=Object(ve["a"])(Pn,Yn,Fi,ji,_n,fn),Wi=Object(ce["a"])(mn),$i=Object(Se["a"])(Wi,_n,new WeakSet),zi=Object(he["a"])(ei,si,Dn,Vi,pe["a"],Qn),Hi=Object(ue["a"])(gn,zi,pe["a"]),Ui=Object(Me["a"])($n,Hi,Ze["a"],Hn,yn),Yi=Object(Ce["a"])(Pn,Yn,Hi,Ui,_n,fn),Xi=Object(Fe["a"])(Vi,Ze["a"],yn),Ki=Object(Be["a"])(Pn,pt["a"],Vi,Xi,_n,fn),qi=Object(Et["a"])(hn),Zi=Object(tt["a"])(hn),Ji=qi?Object(a["a"])(pe["a"],Object(J["a"])(hn),Zi,Object(et["a"])(s["a"]),mn,_n,new WeakMap,new WeakMap,hn):void 0,Qi=Object(_t["a"])(Tn,fn),ts=Object(W["a"])(In,un,G["a"],Z["a"],new WeakSet,_n,Qi,fn,dn,on["a"],an["a"],kn,Rn),es=Object(E["a"])(Ji,An,Nn,Xn,Jn,ii,oi,ui,pi,ts,bi,Si,_i,Pi,Li,Ri,Gi,$i,Yi,Ki),ns=Object(te["a"])(gn),is=Object(Tt["a"])(Pn,ns,_n,fn),ss=Object(ee["a"])(gn,pe["a"]),rs=Object(Ct["a"])(Pn,ss,_n,fn),os=Object(ne["a"])(gn),as=Object(Mt["a"])(Pn,os,_n,fn),cs=Object(ie["a"])(pt["a"],gn,fn),ls=Object(Pt["a"])(Pn,cs,_n),us=Object(m["a"])(es,pt["a"],pe["a"],Ve["a"],is,rs,as,ls,pn),hs=Object(ct["a"])(Ii),ds=Object(l["a"])(hs),fs=Object(k["a"])(dt["a"]),ps=Object(U["a"])(hs),ms=Object(X["a"])(dt["a"]),gs=Object(Gt["a"])(xn,fs,dt["a"],pt["a"],ei,si,ci,Dn,wi,pe["a"],ms,Zi,Qn),bs=Object(jt["a"])(pt["a"],gn,gs,Dn,pe["a"],Qn),vs=Object(Ft["a"])(hn),ys=Object(w["a"])($n,fs,zn,ei,si,ci,Dn,ps,ms,Zi,Ze["a"],vs,dn,Hn,yn,Ti),Ss=(qi&&Object(_["a"])(ds,Pn,Yn,ys,bs,_n,fn,vs,ln["a"]),Object(At["a"])(pt["a"],pe["a"],Ve["a"],Li,pn),Object(j["a"])(pe["a"],dn)),xs=Object(Te["a"])(In,un,vn,hs,Ti,on["a"],kn,Rn);Object(Lt["a"])(un,pt["a"],Ss,Li,xs),Object(me["a"])(es,un,pt["a"],Ss,xs),Object(mt["a"])(Ue["g"],Tn),Object(gt["a"])(Ue["c"],Cn),Object(bt["a"])(Ue["e"],Mn),Object(vt["a"])(Ue["g"],fn)},1448:function(t,e,n){"use strict";n("386b")("strike",(function(t){return function(){return t(this,"strike","","")}}))},"148c":function(t,e,n){var i=n("a256"),s=n("6c69"),r=n("cefa"),o=n("9dc3");function a(t,e){return i(t)||s(t,e)||r(t,e)||o()}t.exports=a},1495:function(t,e,n){var i=n("86cc"),s=n("cb7c"),r=n("0d58");t.exports=n("9e1e")?Object.defineProperties:function(t,e){s(t);var n,o=r(e),a=o.length,c=0;while(a>c)i.f(t,n=o[c++],e[n]);return t}},"14b9":function(t,e,n){var i=n("5ca1");i(i.P,"String",{repeat:n("9744")})},"14bf":function(t,e){},"152a":function(t,e){},"154b":function(t,e){},"15ac":function(t,e,n){n("ec30")("Int16",2,(function(t){return function(e,n,i){return t(this,e,n,i)}}))},"15dc":function(t,e){},"163c":function(t,e){},"165b":function(t,e,n){var i=n("d3f4");n("5eda")("isExtensible",(function(t){return function(e){return!!i(e)&&(!t||t(e))}}))},"16da":function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));const i=t=>e=>{const n=t(e,t=>t.createBufferSource());n.start();try{n.stop()}catch{return!1}return!0}},"16f7":function(t,e){},"16fe":function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));const i=t=>(e,n)=>{const i=t(e,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});n.connect(i).connect(i.context.destination);const s=()=>{n.removeEventListener("ended",s),n.disconnect(i),i.disconnect()};n.addEventListener("ended",s)}},"17d6":function(t,e){},"17e7":function(t,e){},"180a":function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));const i=(t,e,n)=>{const i=e[n];void 0!==i&&i!==t[n]&&(t[n]=i)}},"181a":function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));const i=t=>()=>{if(null===t)return Promise.resolve(!1);const e=new t(1,1,44100);return new Promise(t=>{let n=!0;const i=i=>{n&&(n=!1,e.startRendering(),t(i instanceof TypeError))};let s;try{s=e.decodeAudioData(null,()=>{},i)}catch(r){i(r)}void 0!==s&&s.catch(i)})}},1827:function(t,e){},"18b3":function(t,e){},"18bf":function(t,e){},1991:function(t,e,n){var i,s,r,o=n("9b43"),a=n("31f4"),c=n("fab2"),l=n("230e"),u=n("7726"),h=u.process,d=u.setImmediate,f=u.clearImmediate,p=u.MessageChannel,m=u.Dispatch,g=0,b={},v="onreadystatechange",y=function(){var t=+this;if(b.hasOwnProperty(t)){var e=b[t];delete b[t],e()}},S=function(t){y.call(t.data)};d&&f||(d=function(t){var e=[],n=1;while(arguments.length>n)e.push(arguments[n++]);return b[++g]=function(){a("function"==typeof t?t:Function(t),e)},i(g),g},f=function(t){delete b[t]},"process"==n("2d95")(h)?i=function(t){h.nextTick(o(y,t,1))}:m&&m.now?i=function(t){m.now(o(y,t,1))}:p?(s=new p,r=s.port2,s.port1.onmessage=S,i=o(r.postMessage,r,1)):u.addEventListener&&"function"==typeof postMessage&&!u.importScripts?(i=function(t){u.postMessage(t+"","*")},u.addEventListener("message",S,!1)):i=v in l("script")?function(t){c.appendChild(l("script"))[v]=function(){c.removeChild(this),y.call(t)}}:function(t){setTimeout(o(y,t,1),0)}),t.exports={set:d,clear:f}},"19c0":function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var i=n("383e");const s={Q:1,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",detune:0,frequency:350,gain:0,type:"lowpass"},r=(t,e,n,r,o,a,c)=>class extends t{constructor(t,r=s){const l=a(t),u={...s,...r},h=o(l,u),d=c(l),f=d?n():null;super(t,!1,h,f),this._Q=e(this,d,h.Q,i["b"],i["a"]),this._detune=e(this,d,h.detune,1200*Math.log2(i["b"]),-1200*Math.log2(i["b"])),this._frequency=e(this,d,h.frequency,t.sampleRate/2,0),this._gain=e(this,d,h.gain,40*Math.log10(i["b"]),i["a"]),this._nativeBiquadFilterNode=h}get detune(){return this._detune}get frequency(){return this._frequency}get gain(){return this._gain}get Q(){return this._Q}get type(){return this._nativeBiquadFilterNode.type}set type(t){this._nativeBiquadFilterNode.type=t}getFrequencyResponse(t,e,n){if(this._nativeBiquadFilterNode.getFrequencyResponse(t,e,n),t.length!==e.length||e.length!==n.length)throw r()}}},"1ace":function(t,e){},"1b0e":function(t,e){},"1b1e":function(t,e){},"1b30":function(t,e){},"1b32":function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var i=n("5b43");const s=(t,e)=>(n,s)=>{if(void 0===n.createMediaStreamDestination)throw e();const r=t(n,t=>t.createMediaStreamDestination());return Object(i["a"])(r,s),1===r.numberOfOutputs&&Object.defineProperty(r,"numberOfOutputs",{get:()=>0}),r}},"1b8b":function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var i=n("5b43"),s=n("8af4");const r=(t,e,n)=>(r,{buffer:o,channelCount:a,channelCountMode:c,channelInterpretation:l,disableNormalization:u})=>{const h=t(r,t=>t.createConvolver());Object(i["a"])(h,{channelCount:Math.max(a,2),channelCountMode:"max"===c?c:"clamped-max",channelInterpretation:l});const d=e(r,{channelCount:a,channelCountMode:c,channelInterpretation:l,gain:1}),f={get buffer(){return h.buffer},set buffer(t){h.buffer=t},get bufferSize(){},get channelCount(){return d.channelCount},set channelCount(t){t>2&&(h.channelCount=t),d.channelCount=t},get channelCountMode(){return d.channelCountMode},set channelCountMode(t){"max"===t&&(h.channelCountMode=t),d.channelCountMode=t},get channelInterpretation(){return h.channelInterpretation},set channelInterpretation(t){h.channelInterpretation=t,d.channelInterpretation=t},get context(){return h.context},get inputs(){return[h]},get numberOfInputs(){return h.numberOfInputs},get numberOfOutputs(){return h.numberOfOutputs},get normalize(){return h.normalize},set normalize(t){h.normalize=t},addEventListener(...t){return h.addEventListener(t[0],t[1],t[2])},dispatchEvent(...t){return h.dispatchEvent(t[0])},removeEventListener(...t){return h.removeEventListener(t[0],t[1],t[2])}};u===f.normalize&&(f.normalize=!u),o!==f.buffer&&(f.buffer=o);const p=()=>h.connect(d),m=()=>h.disconnect(d);return n(Object(s["a"])(f,d),p,m)}},"1c15":function(t,e,n){"use strict";function i(t,e){return Array(e+1).join(t)}function s(t){return"number"===typeof t}function r(t){return"string"===typeof t}function o(t){return"undefined"!==typeof t}function a(t,e){return Math.pow(2,(t-69)/12)*(e||440)}n.r(e),n.d(e,"regex",(function(){return l})),n.d(e,"parse",(function(){return h})),n.d(e,"build",(function(){return m})),n.d(e,"midi",(function(){return g})),n.d(e,"freq",(function(){return b})),n.d(e,"letter",(function(){return v})),n.d(e,"acc",(function(){return y})),n.d(e,"pc",(function(){return S})),n.d(e,"step",(function(){return x})),n.d(e,"alt",(function(){return _})),n.d(e,"chroma",(function(){return w})),n.d(e,"oct",(function(){return E}));var c=/^([a-gA-G])(#{1,}|b{1,}|x{1,}|)(-?\d*)\s*(.*)\s*$/;function l(){return c}var u=[0,2,4,5,7,9,11];function h(t,e,n){if("string"!==typeof t)return null;var i=c.exec(t);if(!i||!e&&i[4])return null;var s={letter:i[1].toUpperCase(),acc:i[2].replace(/x/g,"##")};s.pc=s.letter+s.acc,s.step=(s.letter.charCodeAt(0)+3)%7,s.alt="b"===s.acc[0]?-s.acc.length:s.acc.length;var r=u[s.step]+s.alt;return s.chroma=r<0?12+r:r%12,i[3]&&(s.oct=+i[3],s.midi=r+12*(s.oct+1),s.freq=a(s.midi,n)),e&&(s.tonicOf=i[4]),s}var d="CDEFGAB";function f(t){return s(t)?t<0?i("b",-t):i("#",t):""}function p(t){return s(t)?""+t:""}function m(t,e,n){return null===t||"undefined"===typeof t?null:t.step?m(t.step,t.alt,t.oct):t<0||t>6?null:d.charAt(t)+f(e)+p(n)}function g(t){if((s(t)||r(t))&&t>=0&&t<128)return+t;var e=h(t);return e&&o(e.midi)?e.midi:null}function b(t,e){var n=g(t);return null===n?null:a(n,e)}function v(t){return(h(t)||{}).letter}function y(t){return(h(t)||{}).acc}function S(t){return(h(t)||{}).pc}function x(t){return(h(t)||{}).step}function _(t){return(h(t)||{}).alt}function w(t){return(h(t)||{}).chroma}function E(t){return(h(t)||{}).oct}},"1c4c":function(t,e,n){"use strict";var i=n("9b43"),s=n("5ca1"),r=n("4bf8"),o=n("1fa8"),a=n("33a4"),c=n("9def"),l=n("f1ae"),u=n("27ee");s(s.S+s.F*!n("5cc5")((function(t){Array.from(t)})),"Array",{from:function(t){var e,n,s,h,d=r(t),f="function"==typeof this?this:Array,p=arguments.length,m=p>1?arguments[1]:void 0,g=void 0!==m,b=0,v=u(d);if(g&&(m=i(m,p>2?arguments[2]:void 0,2)),void 0==v||f==Array&&a(v))for(e=c(d.length),n=new f(e);e>b;b++)l(n,b,g?m(d[b],b):d[b]);else for(h=v.call(d),n=new f;!(s=h.next()).done;b++)l(n,b,g?o(h,m,[s.value,b],!0):s.value);return n.length=b,n}})},"1c8b":function(t,e){},"1ccf":function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));const i=t=>{const{port1:e}=new MessageChannel;e.postMessage(t,[t])};var s=n("aa59");const r=(t,e,n,r,o,a,c,l,u,h,d,f,p)=>(m,g)=>{const b=c(m)?m:a(m);if(o.has(g)){const t=n();return Promise.reject(t)}try{o.add(g)}catch{}if(e(d,()=>d(b))){const n="closed"===b.state&&null!==u&&l(b)?new u(1,1,b.sampleRate):b,i=n.decodeAudioData(g).catch(t=>{if(t instanceof DOMException&&"NotSupportedError"===t.name)throw new TypeError;throw t});return i.then(n=>(e(h,()=>h(n))||p(n),t.add(n),n))}return new Promise((e,n)=>{const o=()=>{try{i(g)}catch{}},a=t=>{n(t),o()};try{b.decodeAudioData(g,n=>{"function"!==typeof n.copyFromChannel&&(f(n),Object(s["a"])(n)),t.add(n),o(),e(n)},t=>{a(null===t?r():t)})}catch(c){a(c)}})}},"1d2b":function(t,e,n){"use strict";t.exports=function(t,e){return function(){for(var n=new Array(arguments.length),i=0;iclass extends t{constructor(t,n,o){let a;if("number"===typeof t&&void 0!==n&&void 0!==o)a={length:n,numberOfChannels:t,sampleRate:o};else{if("object"!==typeof t)throw new Error("The given parameters are not valid.");a=t}const{length:c,numberOfChannels:l,sampleRate:u}={...s,...a},h=r(l,c,u);e(i["a"],()=>Object(i["a"])(h))||h.addEventListener("statechange",(()=>{let t=0;const e=n=>{"running"===this._state&&(t>0?(h.removeEventListener("statechange",e),n.stopImmediatePropagation(),this._waitForThePromiseToSettle(n)):t+=1)};return e})()),super(h,l),this._length=c,this._nativeOfflineAudioContext=h,this._state=null}get length(){return void 0===this._nativeOfflineAudioContext.length?this._length:this._nativeOfflineAudioContext.length}get state(){return null===this._state?this._nativeOfflineAudioContext.state:this._state}startRendering(){return"running"===this._state?Promise.reject(n()):(this._state="running",o(this.destination,this._nativeOfflineAudioContext).then(t=>(this._state=null,t)).catch(t=>{throw this._state=null,t}))}_waitForThePromiseToSettle(t){null===this._state?this._nativeOfflineAudioContext.dispatchEvent(t):setTimeout(()=>this._waitForThePromiseToSettle(t))}}},"1dc8":function(t,e){},"1e82":function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var i=n("752e"),s=n("e427");const r=t=>{if(i["a"].has(t))throw new Error("The AudioNode is already stored.");i["a"].add(t),Object(s["a"])(t).forEach(t=>t(!0))}},"1e94":function(t,e){},"1f43":function(t,e){},"1fa8":function(t,e,n){var i=n("cb7c");t.exports=function(t,e,n,s){try{return s?e(i(n)[0],n[1]):e(n)}catch(o){var r=t["return"];throw void 0!==r&&i(r.call(t)),o}}},2018:function(t,e){},2026:function(t,e){},"204f":function(t,e){},"20d6":function(t,e,n){"use strict";var i=n("5ca1"),s=n("0a49")(6),r="findIndex",o=!0;r in[]&&Array(1)[r]((function(){o=!1})),i(i.P+i.F*o,"Array",{findIndex:function(t){return s(this,t,arguments.length>1?arguments[1]:void 0)}}),n("9c6c")(r)},"214f":function(t,e,n){"use strict";n("b0c5");var i=n("2aba"),s=n("32e9"),r=n("79e5"),o=n("be13"),a=n("2b4c"),c=n("520a"),l=a("species"),u=!r((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$")})),h=function(){var t=/(?:)/,e=t.exec;t.exec=function(){return e.apply(this,arguments)};var n="ab".split(t);return 2===n.length&&"a"===n[0]&&"b"===n[1]}();t.exports=function(t,e,n){var d=a(t),f=!r((function(){var e={};return e[d]=function(){return 7},7!=""[t](e)})),p=f?!r((function(){var e=!1,n=/a/;return n.exec=function(){return e=!0,null},"split"===t&&(n.constructor={},n.constructor[l]=function(){return n}),n[d](""),!e})):void 0;if(!f||!p||"replace"===t&&!u||"split"===t&&!h){var m=/./[d],g=n(o,d,""[t],(function(t,e,n,i,s){return e.exec===c?f&&!s?{done:!0,value:m.call(e,n,i)}:{done:!0,value:t.call(n,e,i)}:{done:!1}})),b=g[0],v=g[1];i(String.prototype,t,b),s(RegExp.prototype,d,2==e?function(t,e){return v.call(t,this,e)}:function(t){return v.call(t,this)})}}},"217b":function(t,e,n){"use strict";var i=n("d3f4"),s=n("38fd"),r=n("2b4c")("hasInstance"),o=Function.prototype;r in o||n("86cc").f(o,r,{value:function(t){if("function"!=typeof this||!i(t))return!1;if(!i(this.prototype))return t instanceof this;while(t=s(t))if(this.prototype===t)return!0;return!1}})},"224e":function(t,e){},2251:function(t,e,n){var i=n("5ca1"),s=n("cb7c"),r=Object.isExtensible;i(i.S,"Reflect",{isExtensible:function(t){return s(t),!r||r(t)}})},2286:function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var i=n("752e");const s=t=>i["h"].has(t)},"229f":function(t,e){},"22e6":function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));const i=t=>(e,n)=>{t(e).add(n)}},"230e":function(t,e,n){var i=n("d3f4"),s=n("7726").document,r=i(s)&&i(s.createElement);t.exports=function(t){return r?s.createElement(t):{}}},"234f":function(t,e){},2397:function(t,e,n){var i=n("5ca1"),s=n("2aeb"),r=n("d8e8"),o=n("cb7c"),a=n("d3f4"),c=n("79e5"),l=n("f0c1"),u=(n("7726").Reflect||{}).construct,h=c((function(){function t(){}return!(u((function(){}),[],t)instanceof t)})),d=!c((function(){u((function(){}))}));i(i.S+i.F*(h||d),"Reflect",{construct:function(t,e){r(t),o(e);var n=arguments.length<3?t:r(arguments[2]);if(d&&!h)return u(t,e,n);if(t==n){switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3])}var i=[null];return i.push.apply(i,e),new(l.apply(t,i))}var c=n.prototype,f=s(a(c)?c:Object.prototype),p=Function.apply.call(t,f,e);return a(p)?p:f}})},"23a9":function(t,e){},"23c6":function(t,e,n){var i=n("2d95"),s=n("2b4c")("toStringTag"),r="Arguments"==i(function(){return arguments}()),o=function(t,e){try{return t[e]}catch(n){}};t.exports=function(t){var e,n,a;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=o(e=Object(t),s))?n:r?i(e):"Object"==(a=i(e))&&"function"==typeof e.callee?"Arguments":a}},"23ca":function(t,e){},"23e6":function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));const i=t=>e=>{const n=t(e,t=>t.createOscillator());try{n.stop(-1)}catch(i){return i instanceof RangeError}return!1}},"242a":function(t,e,n){"use strict";n("386b")("sup",(function(t){return function(){return t(this,"sup","","")}}))},2440:function(t,e){},2444:function(t,e,n){"use strict";(function(e){var i=n("c532"),s=n("c8af"),r={"Content-Type":"application/x-www-form-urlencoded"};function o(t,e){!i.isUndefined(t)&&i.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}function a(){var t;return("undefined"!==typeof XMLHttpRequest||"undefined"!==typeof e&&"[object process]"===Object.prototype.toString.call(e))&&(t=n("b50d")),t}var c={adapter:a(),transformRequest:[function(t,e){return s(e,"Accept"),s(e,"Content-Type"),i.isFormData(t)||i.isArrayBuffer(t)||i.isBuffer(t)||i.isStream(t)||i.isFile(t)||i.isBlob(t)?t:i.isArrayBufferView(t)?t.buffer:i.isURLSearchParams(t)?(o(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString()):i.isObject(t)?(o(e,"application/json;charset=utf-8"),JSON.stringify(t)):t}],transformResponse:[function(t){if("string"===typeof t)try{t=JSON.parse(t)}catch(e){}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};i.forEach(["delete","get","head"],(function(t){c.headers[t]={}})),i.forEach(["post","put","patch"],(function(t){c.headers[t]=i.merge(r)})),t.exports=c}).call(this,n("f28c"))},2592:function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var i=n("752e"),s=n("5046");const r={channelCount:2,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:1,numberOfOutputs:1,outputChannelCount:void 0,parameterData:{},processorOptions:{}},o=t=>{const e=[];for(let n=0;n({...t,outputChannelCount:void 0!==t.outputChannelCount?t.outputChannelCount:1===t.numberOfInputs&&1===t.numberOfOutputs?[t.channelCount]:o(t.numberOfOutputs)}),c=(t,e,n,o,c,l,u,h,d)=>class extends e{constructor(e,d,f=r){const p=l(e),m=u(p),g=a({...r,...f}),b=i["j"].get(p),v=void 0===b?void 0:b.get(d),y=c(p,m?null:e.baseLatency,h,d,v,g),S=m?o(d,g,v):null;super(e,!0,y,S);const x=[];y.parameters.forEach((t,e)=>{const i=n(this,m,t);x.push([e,i])}),this._nativeAudioWorkletNode=y,this._onprocessorerror=null,this._parameters=new s["a"](x),m&&t(p,this)}get onprocessorerror(){return this._onprocessorerror}set onprocessorerror(t){const e="function"===typeof t?d(this,t):null;this._nativeAudioWorkletNode.onprocessorerror=e;const n=this._nativeAudioWorkletNode.onprocessorerror;this._onprocessorerror=null!==n&&n===e?t:n}get parameters(){return null===this._parameters?this._nativeAudioWorkletNode.parameters:this._parameters}get port(){return this._nativeAudioWorkletNode.port}}},"25c9":function(t,e,n){var i=n("5ca1"),s=Math.exp;i(i.S,"Math",{cosh:function(t){return(s(t=+t)+s(-t))/2}})},"25db":function(t,e,n){n("5eda")("getOwnPropertyNames",(function(){return n("7bbc").f}))},2621:function(t,e){e.f=Object.getOwnPropertySymbols},"264b":function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var i=n("59e9");const s=t=>Object(i["a"])(t[0])},"27ee":function(t,e,n){var i=n("23c6"),s=n("2b4c")("iterator"),r=n("84f2");t.exports=n("8378").getIteratorMethod=function(t){if(void 0!=t)return t[s]||t["@@iterator"]||r[i(t)]}},2818:function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));const i=(t,e,n)=>(i,s)=>{s.channelCount=1,s.channelCountMode="explicit",Object.defineProperty(s,"channelCount",{get:()=>1,set:()=>{throw t()}}),Object.defineProperty(s,"channelCountMode",{get:()=>"explicit",set:()=>{throw t()}});const r=e(i,t=>t.createBufferSource()),o=()=>{const t=s.numberOfInputs;for(let e=0;er.disconnect(s);n(s,o,a)}},2877:function(t,e,n){"use strict";function i(t,e,n,i,s,r,o,a){var c,l="function"===typeof t?t.options:t;if(e&&(l.render=e,l.staticRenderFns=n,l._compiled=!0),i&&(l.functional=!0),r&&(l._scopeId="data-v-"+r),o?(c=function(t){t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,t||"undefined"===typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),s&&s.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(o)},l._ssrRegister=c):s&&(c=a?function(){s.call(this,(l.functional?this.parent:this).$root.$options.shadowRoot)}:s),c)if(l.functional){l._injectStyles=c;var u=l.render;l.render=function(t,e){return c.call(e),u(t,e)}}else{var h=l.beforeCreate;l.beforeCreate=h?[].concat(h,c):[c]}return{exports:t,options:l}}n.d(e,"a",(function(){return i}))},"28a5":function(t,e,n){"use strict";var i=n("aae3"),s=n("cb7c"),r=n("ebd6"),o=n("0390"),a=n("9def"),c=n("5f1b"),l=n("520a"),u=n("79e5"),h=Math.min,d=[].push,f="split",p="length",m="lastIndex",g=4294967295,b=!u((function(){RegExp(g,"y")}));n("214f")("split",2,(function(t,e,n,u){var v;return v="c"=="abbc"[f](/(b)*/)[1]||4!="test"[f](/(?:)/,-1)[p]||2!="ab"[f](/(?:ab)*/)[p]||4!="."[f](/(.?)(.?)/)[p]||"."[f](/()()/)[p]>1||""[f](/.?/)[p]?function(t,e){var s=String(this);if(void 0===t&&0===e)return[];if(!i(t))return n.call(s,t,e);var r,o,a,c=[],u=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),h=0,f=void 0===e?g:e>>>0,b=new RegExp(t.source,u+"g");while(r=l.call(b,s)){if(o=b[m],o>h&&(c.push(s.slice(h,r.index)),r[p]>1&&r.index=f))break;b[m]===r.index&&b[m]++}return h===s[p]?!a&&b.test("")||c.push(""):c.push(s.slice(h)),c[p]>f?c.slice(0,f):c}:"0"[f](void 0,0)[p]?function(t,e){return void 0===t&&0===e?[]:n.call(this,t,e)}:n,[function(n,i){var s=t(this),r=void 0==n?void 0:n[e];return void 0!==r?r.call(n,s,i):v.call(String(s),n,i)},function(t,e){var i=u(v,t,this,e,v!==n);if(i.done)return i.value;var l=s(t),d=String(this),f=r(l,RegExp),p=l.unicode,m=(l.ignoreCase?"i":"")+(l.multiline?"m":"")+(l.unicode?"u":"")+(b?"y":"g"),y=new f(b?l:"^(?:"+l.source+")",m),S=void 0===e?g:e>>>0;if(0===S)return[];if(0===d.length)return null===c(y,d)?[d]:[];var x=0,_=0,w=[];while(_class s{constructor(s,r){const o=e(s),a={...i,...r},c=t(o,a);return n.add(c),c}static[Symbol.hasInstance](t){return null!==t&&"object"===typeof t&&Object.getPrototypeOf(t)===s.prototype||n.has(t)}}},2938:function(t,e,n){!function(e,n){t.exports=n()}(window,(function(){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var s=e[i]={i:i,l:!1,exports:{}};return t[i].call(s.exports,s,s.exports,n),s.l=!0,s.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var s in t)n.d(i,s,function(e){return t[e]}.bind(null,s));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=178)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Fraction=void 0;class i{constructor(t=0,e=1,n=0,i=!0){this.numerator=0,this.denominator=1,this.wholeValue=0,this.numerator=t,this.denominator=e,this.wholeValue=n,i&&this.simplify(),this.setRealValue()}static max(t,e){return t.RealValue>e.RealValue?t:e}static Equal(t,e){return t.wholeValue===e.wholeValue&&t.Denominator===e.Denominator&&t.Numerator===e.Numerator}static createFromFraction(t){return new i(t.numerator,t.denominator,t.wholeValue,!1)}static plus(t,e){const n=t.clone();return n.Add(e),n}static minus(t,e){const n=t.clone();return n.Sub(e),n}static multiply(t,e){return new i((t.wholeValue*t.denominator+t.numerator)*(e.wholeValue*e.denominator+e.numerator),t.denominator*e.denominator)}static greatestCommonDenominator(t,e){if(0===t)return e;if(1===e)return 1;for(;0!==e;)t>e?t-=e:e-=t;return t}toString(){let t=this.numerator+"/"+this.denominator;return 0!==this.wholeValue&&(t=this.wholeValue+" "+t),t}clone(){return new i(this.numerator,this.denominator,this.wholeValue,!1)}get Numerator(){return this.numerator}set Numerator(t){this.numerator!==t&&(this.numerator=t,this.simplify(),this.setRealValue())}get Denominator(){return this.denominator}set Denominator(t){this.denominator!==t&&(this.denominator=t,0!==this.numerator&&this.simplify(),this.setRealValue())}get WholeValue(){return this.wholeValue}set WholeValue(t){this.wholeValue!==t&&(this.wholeValue=t,this.setRealValue())}GetExpandedNumerator(){return this.wholeValue*this.denominator+this.numerator}IsNegative(){return this.realValue<0}get RealValue(){return this.realValue}expand(t){this.numerator*=t,this.denominator*=t,0!==this.wholeValue&&(this.numerator+=this.wholeValue*this.denominator,this.wholeValue=0)}Add(t){this.numerator=(this.wholeValue*this.denominator+this.numerator)*t.denominator+(t.wholeValue*t.denominator+t.numerator)*this.denominator,this.denominator=this.denominator*t.denominator,this.wholeValue=0,this.simplify(),this.setRealValue()}Sub(t){this.numerator=(this.wholeValue*this.denominator+this.numerator)*t.denominator-(t.wholeValue*t.denominator+t.numerator)*this.denominator,this.denominator=this.denominator*t.denominator,this.wholeValue=0,this.simplify(),this.setRealValue()}Quantize(t){if(this.denominator<=t)return this;const e=new i(this.numerator+1,this.denominator,this.wholeValue);for(;e.Denominator>t;)e.Numerator++;if(this.numerator>this.denominator){const n=new i(this.numerator-1,this.denominator,this.wholeValue);for(;n.Denominator>t;)n.Numerator--;if(n.Denominatori.maximumAllowedNumber){const t=this.denominator/i.maximumAllowedNumber;this.numerator=Math.round(this.numerator/t),this.denominator=Math.round(this.denominator/t)}if(this.numerator>i.maximumAllowedNumber){const t=this.numerator/i.maximumAllowedNumber;this.numerator=Math.round(this.numerator/t),this.denominator=Math.round(this.denominator/t)}}isOnBeat(t){const e=this.distanceFromBeat(t);return Math.abs(e)=0&&e<=r.levels.SILENT))throw"log.setLevel() called with invalid level: "+e;if(s=e,!1!==i&&function(t){var e=(n[t]||"silent").toUpperCase();if("undefined"!=typeof window){try{return void(window.localStorage[a]=e)}catch(t){}try{window.document.cookie=encodeURIComponent(a)+"="+e+";"}catch(t){}}}(e),o.call(r,e,t),"undefined"==typeof console&&e=e;)t-=e,n++;return{overflow:n,halftone:t}}static calcFrequency(t){let e,n=0;if(t instanceof r){const s=t;n=s.octave-1,e=s.fundamentalNote-i.A+s.AccidentalHalfTones}else"number"==typeof t&&(e=t-57);return 440*Math.pow(2,n)*Math.pow(2,e/12)}static calcFractionalKey(t){return Math.log(t/440)/Math.LN10*r.halftoneFactor+57}static fromFrequency(t){const e=r.calcFractionalKey(t)+.5,n=Math.floor(e/12)-r.octXmlDiff,i=Math.floor(e)%12;let o=i,a=s.NONE;return-1===this.pitchEnumValues.indexOf(o)&&(o=i-1,a=s.SHARP),new r(o,n,a)}static fromHalftone(t){const e=Math.floor(t/12)-r.octXmlDiff,n=t%12;let i=n,o=s.NONE;return-1===this.pitchEnumValues.indexOf(i)&&(i=n-1,o=s.SHARP),new r(i,e,o)}static ceiling(t){let e=t%=12;return-1===this.pitchEnumValues.indexOf(e)&&(e=t+1),e}static floor(t){let e=t%=12;return-1===this.pitchEnumValues.indexOf(e)&&(e=t-1),e}static HalfTonesFromAccidental(t){switch(t){case s.NONE:return 0;case s.SHARP:return 1;case s.FLAT:return-1;case s.NATURAL:return 0;case s.DOUBLESHARP:return 2;case s.DOUBLEFLAT:return-2;case s.QUARTERTONESHARP:return.5;case s.QUARTERTONEFLAT:return-.5;case s.TRIPLESHARP:return 3;case s.TRIPLEFLAT:return-3;default:throw new Error("Unhandled AccidentalEnum value")}}static AccidentalFromHalfTones(t){switch(t){case 0:return s.NONE;case 1:return s.SHARP;case-1:return s.FLAT;case 2:return s.DOUBLESHARP;case-2:return s.DOUBLEFLAT;case.5:return s.QUARTERTONESHARP;case-.5:return s.QUARTERTONEFLAT;case 3:return s.TRIPLESHARP;case-3:return s.TRIPLEFLAT;default:return t>0&&t<1?s.QUARTERTONESHARP:t<0&&t>-1?s.QUARTERTONEFLAT:s.QUARTERTONESHARP}}static accidentalVexflow(t){let e;switch(t){case s.NATURAL:e="n";break;case s.FLAT:e="b";break;case s.SHARP:e="#";break;case s.DOUBLESHARP:e="##";break;case s.TRIPLESHARP:e="++";break;case s.DOUBLEFLAT:e="bb";break;case s.TRIPLEFLAT:e="bbs";break;case s.QUARTERTONESHARP:e="+";break;case s.QUARTERTONEFLAT:e="d"}return e}get AccidentalHalfTones(){return r.HalfTonesFromAccidental(this.accidental)}get Octave(){return this.octave}get FundamentalNote(){return this.fundamentalNote}get Accidental(){return this.accidental}get Frequency(){return this.frequency}static get OctaveXmlDifference(){return r.octXmlDiff}getHalfTone(){return this.halfTone}getTransposedPitch(t){if(t>12)throw new Error("rewrite this method to handle bigger octave changes or don't use is with bigger octave changes!");return t>0?this.getHigherPitchByTransposeFactor(t):t<0?this.getLowerPitchByTransposeFactor(-t):this}DoEnharmonicChange(){switch(this.accidental){case s.FLAT:case s.DOUBLEFLAT:this.fundamentalNote=this.getPreviousFundamentalNote(this.fundamentalNote),this.accidental=r.AccidentalFromHalfTones(this.halfTone-(this.fundamentalNote+12*(this.octave+r.octXmlDiff)));break;case s.SHARP:case s.DOUBLESHARP:this.fundamentalNote=this.getNextFundamentalNote(this.fundamentalNote),this.accidental=r.AccidentalFromHalfTones(this.halfTone-(this.fundamentalNote+12*(this.octave+r.octXmlDiff)));break;default:return}}ToString(){let t=r.accidentalVexflow(this.accidental);return t||(t=""),"Key: "+r.getNoteEnumString(this.fundamentalNote)+t+", Note: "+this.fundamentalNote+", octave: "+this.octave.toString()}OperatorEquals(t){return!(!this||!t)&&this.FundamentalNote===t.FundamentalNote&&this.Octave===t.Octave&&this.Accidental===t.Accidental}OperatorNotEqual(t){return!(this===t)}OperatorFundamentalGreaterThan(t){const e=this;return e.Octave===t.Octave?e.FundamentalNote>t.FundamentalNote:e.Octave>t.Octave}OperatorFundamentalLessThan(t){const e=this;return e.Octave===t.Octave?e.FundamentalNoter.pitchEnumValues.length-1?(n=r.pitchEnumValues[e+t-r.pitchEnumValues.length],i++):n=r.pitchEnumValues[e+t],new r(n,i,s.NONE)}getLowerPitchByTransposeFactor(t){const e=r.pitchEnumValues.indexOf(this.fundamentalNote);let n,i=this.octave;return e-t<0?(n=r.pitchEnumValues[r.pitchEnumValues.length+e-t],i--):n=r.pitchEnumValues[e-t],new r(n,i,s.NONE)}getNextFundamentalNote(t){let e=r.pitchEnumValues.indexOf(t);return e=(e+1)%r.pitchEnumValues.length,r.pitchEnumValues[e]}getPreviousFundamentalNote(t){const e=r.pitchEnumValues.indexOf(t);return e>0?r.pitchEnumValues[e-1]:r.pitchEnumValues[r.pitchEnumValues.length-1]}}e.Pitch=r,r.pitchEnumValues=[i.C,i.D,i.E,i.F,i.G,i.A,i.B],r.halftoneFactor=12/(Math.LN2/Math.LN10),r.octXmlDiff=3},function(t,e,n){"use strict";var i;Object.defineProperty(e,"__esModule",{value:!0}),e.PlacementEnum=e.AbstractExpression=void 0,e.AbstractExpression=class{constructor(t){this.placement=t}static isStringInStringList(t,e){for(let n=0,i=t.length;nthis.borderLeft?this.borderLeft:this.borderMarginLeft}set BorderMarginLeft(t){this.borderMarginLeft=t,this.calculateMarginRectangle()}get BorderMarginRight(){return this.borderMarginRightthis.borderTop?this.borderTop:this.borderMarginTop}set BorderMarginTop(t){this.borderMarginTop=t,this.calculateMarginRectangle()}get BorderMarginBottom(){return this.borderMarginBottom-1&&this.parent.ChildElements.splice(t,1)}this.parent=t,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 o.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 t=this.parent;for(;t;)this.absolutePosition.x+=t.relativePosition.x,this.absolutePosition.y+=t.relativePosition.y,t=t.parent}calculateAbsolutePositionsRecursiveWithoutTopelement(){this.absolutePosition.x=0,this.absolutePosition.y=0;for(let t=0,e=this.ChildElements.length;t.001;break;case h.Up:case h.Down:i=this.relativePosition.y,t.calculateMarginPositionAlongDirection(this,e),s=Math.abs(i-this.relativePosition.y)>.001;break;default:throw new r.ArgumentOutOfRangeException("direction")}}while(s)}collisionDetection(t){const e=Math.min(this.AbsolutePosition.x+this.borderRight,t.absolutePosition.x+t.borderRight)-Math.max(this.AbsolutePosition.x+this.borderLeft,t.absolutePosition.x+t.borderLeft),n=Math.min(this.AbsolutePosition.y+this.borderBottom,t.absolutePosition.y+t.borderBottom)-Math.max(this.AbsolutePosition.y+this.borderTop,t.absolutePosition.y+t.borderTop);return e>0&&n>0}liesInsideBorders(t){const e=this.AbsolutePosition.x+this.borderLeft<=t.absolutePosition.x+t.borderLeft&&t.absolutePosition.x+t.borderLeft<=this.AbsolutePosition.x+this.borderRight,n=this.AbsolutePosition.x+this.borderLeft<=t.absolutePosition.x+t.borderRight&&t.absolutePosition.x+t.borderRight<=this.AbsolutePosition.x+this.borderRight;if(e&&n){const e=this.AbsolutePosition.y+this.borderTop<=t.absolutePosition.y+t.borderTop&&t.absolutePosition.y+t.borderTop<=this.AbsolutePosition.y+this.borderBottom,n=this.AbsolutePosition.y+this.borderTop<=t.absolutePosition.y+t.borderBottom&&t.absolutePosition.y+t.borderBottom<=this.AbsolutePosition.y+this.borderBottom;if(e&&n)return!0}return!1}pointLiesInsideBorders(t){return this.AbsolutePosition.x+this.borderLeft<=t.x&&t.x<=this.AbsolutePosition.x+this.borderRight&&this.AbsolutePosition.y+this.borderTop<=t.y&&t.y<=this.AbsolutePosition.y+this.borderBottom}marginCollisionDetection(t){const e=Math.min(this.AbsolutePosition.x+this.borderMarginRight,t.absolutePosition.x+t.borderMarginRight)-Math.max(this.AbsolutePosition.x+this.borderMarginLeft,t.absolutePosition.x+t.borderMarginLeft),n=Math.min(this.AbsolutePosition.y+this.borderMarginBottom,t.absolutePosition.y+t.borderMarginBottom)-Math.max(this.AbsolutePosition.y+this.borderMarginTop,t.absolutePosition.y+t.borderMarginTop);return e>0&&n>0}liesInsideMargins(t){const e=this.AbsolutePosition.x+this.borderMarginLeft<=t.absolutePosition.x+t.borderMarginLeft&&t.absolutePosition.x+t.borderMarginLeft<=this.AbsolutePosition.x+this.borderMarginRight,n=this.AbsolutePosition.x+this.borderMarginLeft<=t.absolutePosition.x+t.borderMarginRight&&t.absolutePosition.x+t.borderMarginRight<=this.AbsolutePosition.x+this.borderMarginRight;if(e&&n){const e=this.AbsolutePosition.y+this.borderMarginTop<=t.absolutePosition.y+t.borderMarginTop&&t.absolutePosition.y+t.borderMarginTop<=this.AbsolutePosition.y+this.borderMarginBottom,n=this.AbsolutePosition.y+this.borderMarginTop<=t.absolutePosition.y+t.borderMarginBottom&&t.absolutePosition.y+t.borderMarginBottom<=this.AbsolutePosition.y+this.borderMarginBottom;if(e&&n)return!0}return!1}pointLiesInsideMargins(t){return this.AbsolutePosition.x+this.borderMarginLeft<=t.x&&t.x<=this.AbsolutePosition.x+this.borderMarginRight&&this.AbsolutePosition.y+this.borderMarginTop<=t.y&&t.y<=this.AbsolutePosition.y+this.borderMarginBottom}computeNonOverlappingPosition(t,e,n){this.RelativePosition=new o.PointF2D(n.x,n.y),this.setAbsolutePositionFromParent();let i=0,s=!1;do{switch(e){case h.Left:case h.Right:i=this.relativePosition.x,t.calculatePositionAlongDirection(this,e),s=Math.abs(i-this.relativePosition.x)>1e-4;break;case h.Up:case h.Down:i=this.relativePosition.y,t.calculatePositionAlongDirection(this,e),s=Math.abs(i-this.relativePosition.y)>1e-4;break;default:throw new r.ArgumentOutOfRangeException("direction")}}while(s)}getClickedObjectOfType(t){const e=this.dataObject;if(this.pointLiesInsideBorders(t)&&e)return e;for(let n=0,i=this.childElements.length;n{};i.L=(t,e)=>{if(!e)return;const n=Array.prototype.slice.call(e).join(" ");window.console.log(t+": "+n)},i.MakeException=t=>class extends Error{constructor(e,n){super(e),this.name=t,this.message=e,this.data=n}},i.RERR=i.RuntimeError=class{constructor(t,e){this.code=t,this.message=e}toString(){return"[RuntimeError] "+this.code+":"+this.message}},i.Merge=(t,e)=>{for(const n in e)t[n]=e[n];return t},i.Min=Math.min,i.Max=Math.max,i.forEach=(t,e)=>{for(let n=0;nt%e>=e/2?parseInt(t/e,10)*e+e:parseInt(t/e,10)*e,i.MidLine=(t,e)=>{let n=e+(t-e)/2;return n%2>0&&(n=i.RoundN(10*n,5)/10),n},i.SortAndUnique=(t,e,n)=>{if(t.length>1){const i=[];let s;t.sort(e);for(let e=0;e{let n=t.length;for(;n--;)if(t[n]===e)return!0;return!1},i.getCanvasContext=t=>{if(!t)throw new i.RERR("BadArgument","Invalid canvas selector: "+t);const e=document.getElementById(t);if(!e||!e.getContext)throw new i.RERR("UnsupportedBrowserError","This browser does not support HTML5 Canvas");return e.getContext("2d")},i.drawDot=(t,e,n,i="#55")=>{t.save(),t.setFillStyle(i),t.beginPath(),t.arc(e,n,3,0,2*Math.PI,!0),t.closePath(),t.fill(),t.restore()},i.BM=(t,e)=>{const n=(new Date).getTime();e();const s=(new Date).getTime()-n;i.L(t+s+"ms")},i.StackTrace=()=>(new Error).stack,i.W=(...t)=>{const e=t.join(" ");window.console.log("Warning: ",e,i.StackTrace())},(i.Prefix=t=>i.Prefix.prefix+t).prefix="vf-";class s{static GCD(t,e){if("number"!=typeof t||"number"!=typeof e)throw new i.RERR("BadArgument",`Invalid numbers: ${t}, ${e}`);let n;for(;0!==e;)n=e,e=t%e,t=n;return t}static LCM(t,e){return t*e/s.GCD(t,e)}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 e=t[0];return t.shift(),s.LCM(e,s.LCMM(t))}}constructor(t,e){this.set(t,e)}set(t,e){return this.numerator=void 0===t?1:t,this.denominator=void 0===e?1:e,this}value(){return this.numerator/this.denominator}simplify(){let t=this.numerator,e=this.denominator;const n=s.GCD(t,e);return t/=n,e/=n,e<0&&(e=-e,t=-t),this.set(t,e)}add(t,e){let n,i;t instanceof s?(n=t.numerator,i=t.denominator):(n=void 0!==t?t:0,i=void 0!==e?e:1);const r=s.LCM(this.denominator,i),o=r/this.denominator,a=r/i,c=this.numerator*o+n*a;return this.set(c,r)}subtract(t,e){let n,i;t instanceof s?(n=t.numerator,i=t.denominator):(n=void 0!==t?t:0,i=void 0!==e?e:1);const r=s.LCM(this.denominator,i),o=r/this.denominator,a=r/i,c=this.numerator*o-n*a;return this.set(c,r)}multiply(t,e){let n,i;return t instanceof s?(n=t.numerator,i=t.denominator):(n=void 0!==t?t:1,i=void 0!==e?e:1),this.set(this.numerator*n,this.denominator*i)}divide(t,e){let n,i;return t instanceof s?(n=t.numerator,i=t.denominator):(n=void 0!==t?t:1,i=void 0!==e?e:1),this.set(this.numerator*i,this.denominator*n)}equals(t){const e=s.__compareA.copy(t).simplify(),n=s.__compareB.copy(this).simplify();return e.numerator===n.numerator&&e.denominator===n.denominator}greaterThan(t){const e=s.__compareB.copy(this);return e.subtract(t),e.numerator>0}greaterThanEquals(t){const e=s.__compareB.copy(this);return e.subtract(t),e.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 e=this.quotient(),n=s.__tmp.copy(this);return e<0?n.abs().fraction():n.fraction(),0!==e?(t+=e,0!==n.numerator&&(t+=" "+n.toSimplifiedString())):t=0===n.numerator?"0":n.toSimplifiedString(),t}parse(t){const e=t.split("/"),n=parseInt(e[0],10),i=e[1]?parseInt(e[1],10):1;return this.set(n,i)}}s.__compareA=new s,s.__compareB=new s,s.__tmp=new s;const r=i.MakeException("RegistryError");function o(t,e,n,i,s){t[e][n]||(t[e][n]={}),t[e][n][i]=s}class a{static get INDEXES(){return["type"]}constructor(){this.clear()}static enableDefaultRegistry(t){a.defaultRegistry=t}static getDefaultRegistry(){return a.defaultRegistry}static disableDefaultRegistry(){a.defaultRegistry=null}clear(){return this.index={id:{},type:{},class:{}},this}updateIndex({id:t,name:e,value:n,oldValue:i}){const s=this.getElementById(t);null!==i&&this.index[e][i]&&delete this.index[e][i][t],null!==n&&o(this.index,e,n,s.getAttribute("id"),s)}register(t,e){if(!(e=e||t.getAttribute("id")))throw new r("Can't add element without `id` attribute to registry",t);return t.setAttribute("id",e),o(this.index,"id",e,e,t),a.INDEXES.forEach(n=>{this.updateIndex({id:e,name:n,value:t.getAttribute(n),oldValue:null})}),t.onRegister(this),this}getElementById(t){return this.index.id[t]?this.index.id[t][t]:null}getElementsByAttribute(t,e){const n=this.index[t];return n&&n[e]?Object.keys(n[e]).map(t=>n[e][t]):[]}getElementsByType(t){return this.getElementsByAttribute("type",t)}getElementsByClass(t){return this.getElementsByAttribute("class",t)}onUpdate({id:t,name:e,value:n,oldValue:i}){return function(t,e){return t.filter(t=>t===e).length>0}(a.INDEXES.concat(["id","class"]),e)?(this.updateIndex({id:t,name:e,value:n,oldValue:i}),this):this}}a.defaultRegistry=null;class c{static newID(){return"auto"+c.ID++}constructor({type:t}={}){this.attrs={id:c.newID(),el:null,type:t||"Base",classes:{}},this.boundingBox=null,this.context=null,this.rendered=!1,a.getDefaultRegistry()&&a.getDefaultRegistry().register(this)}setStyle(t){return this.style=t,this}getStyle(){return this.style}applyStyle(t=this.context,e=this.getStyle()){return e?(t.save(),e.shadowColor&&t.setShadowColor(e.shadowColor),e.shadowBlur&&t.setShadowBlur(e.shadowBlur),e.fillStyle&&t.setFillStyle(e.fillStyle),e.strokeStyle&&t.setStrokeStyle(e.strokeStyle),e.lineWidth&&t.setLineWidth(e.lineWidth),this):this}restoreStyle(t=this.context,e=this.getStyle()){return e?(t.restore(),this):this}drawWithStyle(){this.checkContext(),this.applyStyle(),this.draw(),this.restoreStyle()}hasClass(t){return!0===this.attrs.classes[t]}addClass(t){return this.attrs.classes[t]=!0,this.registry&&this.registry.onUpdate({id:this.getAttribute("id"),name:"class",value:t,oldValue:null}),this}removeClass(t){return delete this.attrs.classes[t],this.registry&&this.registry.onUpdate({id:this.getAttribute("id"),name:"class",value:null,oldValue:t}),this}onRegister(t){return this.registry=t,this}isRendered(){return this.rendered}setRendered(t=!0){return this.rendered=t,this}getAttributes(){return this.attrs}getAttribute(t){return this.attrs[t]}setAttribute(t,e){const n=this.attrs.id,i=this.attrs[t];return this.attrs[t]=e,this.registry&&this.registry.onUpdate({id:n,name:t,value:e,oldValue:i}),this}getContext(){return this.context}setContext(t){return this.context=t,this}getBoundingBox(){return this.boundingBox}checkContext(){if(!this.context)throw new i.RERR("NoContext","No rendering context attached to instance");return this.context}}c.ID=1e3;class l{constructor(t,e,n,i){this.x1=Number.NaN,this.y1=Number.NaN,this.x2=Number.NaN,this.y2=Number.NaN,this.addPoint(t,e),this.addPoint(n,i)}width(){return this.x2-this.x1}height(){return this.y2-this.y1}addPoint(t,e){null!=t&&((isNaN(this.x1)||isNaN(this.x2))&&(this.x1=t,this.x2=t),tthis.x2&&(this.x2=t)),null!=e&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=e,this.y2=e),ethis.y2&&(this.y2=e))}addX(t){this.addPoint(t,null)}addY(t){this.addPoint(null,t)}addQuadraticCurve(t,e,n,i,s,r){const o=t+2/3*(n-t),a=e+2/3*(i-e),c=o+1/3*(s-t),l=a+1/3*(r-e);this.addBezierCurve(t,e,o,a,c,l,s,r)}addBezierCurve(t,e,n,i,s,r,o,a){const c=[t,e],l=[n,i],u=[s,r],h=[o,a];let d;this.addPoint(c[0],c[1]),this.addPoint(h[0],h[1]);const f=(t,e)=>Math.pow(1-t,3)*c[e]+3*Math.pow(1-t,2)*t*l[e]+3*(1-t)*Math.pow(t,2)*u[e]+Math.pow(t,3)*h[e];for(d=0;d<=1;d++){const t=6*c[d]-12*l[d]+6*u[d],e=-3*c[d]+9*l[d]-9*u[d]+3*h[d],n=3*l[d]-3*c[d];if(0===e){if(0===t)continue;const e=-n/t;0{if(!t)throw new i.RERR("BadArgument","Invalid clef: "+t);const e=p.clefProperties.values[t];if(!e)throw new i.RERR("BadArgument","Invalid clef: "+t);return e}};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=(t,e,n)=>{void 0===e&&(e="treble");const s={octave_shift:0};"object"==typeof n&&i.Merge(s,n);const r=t.split("/");if(r.length<2)throw new i.RERR("BadArguments","Key must have note + octave and an optional glyph: "+t);const o=r[0].toUpperCase(),a=p.keyProperties.note_values[o];if(!a)throw new i.RERR("BadArguments","Invalid key name: "+o);a.octave&&(r[1]=a.octave);let c=parseInt(r[1],10);c+=-1*s.octave_shift;let l=(7*c-28+a.index)/2;l+=p.clefProperties(e).line_shift;let u=0;l<=0&&2*l%2==0&&(u=1),l>=6&&2*l%2==0&&(u=-1);const h=void 0!==a.int_val?12*c+a.int_val:null,d=a.code,f=a.shift_right;let m={};if(r.length>2&&r[2]){const t=r[2].toUpperCase();m=p.keyProperties.customNoteHeads[t]||{}}return{key:o,octave:c,line:l,int_value:h,accidental:a.accidental,code:d,stroke:u,shift_right:f,displaced:!1,...m}},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},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}},p.integerToNote=t=>{if(void 0===t)throw new i.RERR("BadArguments","Undefined integer for integerToNote");if(t<-2)throw new i.RERR("BadArguments","integerToNote requires integer > -2: "+t);const e=p.integerToNote.table[t];if(!e)throw new i.RERR("BadArguments","Unknown note value for integer: "+t);return e},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=(t,e=1)=>{let n=null,i=0,s=0;if("X"===t.toString().toUpperCase()){const t=new f("v7f",p.DEFAULT_TABLATURE_FONT_SCALE).getMetrics();n="v7f",i=t.width,s=-t.height/2}else i=p.textWidth(t.toString());return{text:t,code:n,getWidth:()=>i*e,shift_y:s}},p.textWidth=t=>7*t.toString().length,p.articulationCodes=t=>p.articulationCodes.articulations[t],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=t=>p.accidentalCodes.accidentals[t],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=t=>p.ornamentCodes.ornaments[t],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=t=>{const e=p.keySignature.keySpecs[t];if(!e)throw new i.RERR("BadKeySignature",`Bad key signature spec: '${t}'`);if(!e.acc)return[];const n=p.keySignature.accidentalList(e.acc),s=[];for(let i=0;i({b:[2,.5,2.5,1,3,1.5,3.5],"#":[0,1.5,-.5,1,2.5,.5,2]}[t]),p.parseNoteDurationString=t=>{if("string"!=typeof t)return null;const e=/(\d*\/?\d+|[a-z])(d*)([nrhms]|$)/.exec(t);if(!e)return null;const n=e[1],i=e[2].length;let s=e[3];return 0===s.length&&(s="n"),{duration:n,dots:i,type:s}},p.parseNoteStruct=t=>{const e=t.duration,n=p.parseNoteDurationString(e);if(!n)return null;let i=p.durationToTicks(n.duration);if(null==i)return null;let s=t.type;const r=[];if(s){if(!p.getGlyphProps.validTypes[s])return null}else s=n.type||"n",void 0!==t.keys&&t.keys.forEach((t,e)=>{const n=t.split("/");n&&3===n.length&&(r[e]=n[2])});const o=t.dots?t.dots:n.dots;if("number"!=typeof o)return null;let a=i;for(let c=0;c{const e=p.durationAliases[t];if(void 0!==e&&(t=e),void 0===p.durationToTicks.durations[t])throw new i.RERR("BadArguments","The provided duration is not valid: "+t);return t},p.durationToFraction=t=>(new s).parse(p.sanitizeDuration(t)),p.durationToNumber=t=>p.durationToFraction(t).value(),p.durationToTicks=t=>{t=p.sanitizeDuration(t);const e=p.durationToTicks.durations[t];return void 0===e?null:e},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=(t,e)=>{t=p.sanitizeDuration(t);const n=p.getGlyphProps.duration_codes[t];if(void 0===n)return null;e||(e="n");let i=n.type[e];if(void 0===i){const t=p.keyProperties.customNoteHeads[e.toUpperCase()];if(void 0===t)return null;i={code_head:t.code,...t}}return{...n.common,...i}},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(t=p.DEFAULT_NOTATION_FONT_SCALE){return new f(this.code_head||"v53",t).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(t=p.DEFAULT_NOTATION_FONT_SCALE){return new f(this.code_head||"v1d",t).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(t=p.DEFAULT_NOTATION_FONT_SCALE){return new f(this.code_head||"v81",t).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(t=p.DEFAULT_NOTATION_FONT_SCALE){return new f(this.code_head||"vb",t).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(t=p.DEFAULT_NOTATION_FONT_SCALE){return new f(this.code_head||"vb",t).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(t=p.DEFAULT_NOTATION_FONT_SCALE){return new f(this.code_head||"vb",t).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(t=p.DEFAULT_NOTATION_FONT_SCALE){return new f(this.code_head||"vb",t).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(t=p.DEFAULT_NOTATION_FONT_SCALE){return new f(this.code_head||"vb",t).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(t=p.DEFAULT_NOTATION_FONT_SCALE){return new f(this.code_head||"vb",t).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 m{static get WIDTH(){return 600}static get HEIGHT(){return 400}static get CANVAS_BROWSER_SIZE_LIMIT(){return 32767}static SanitizeCanvasDims(t,e){return Math.max(t,e)>this.CANVAS_BROWSER_SIZE_LIMIT&&(i.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),e>this.CANVAS_BROWSER_SIZE_LIMIT&&(e=this.CANVAS_BROWSER_SIZE_LIMIT)),[t,e]}constructor(t){this.vexFlowCanvasContext=t,t.canvas?this.canvas=t.canvas:this.canvas={width:m.WIDTH,height:m.HEIGHT}}clear(){this.vexFlowCanvasContext.clearRect(0,0,this.canvas.width,this.canvas.height)}openGroup(){}closeGroup(){}add(){}setFont(t,e,n){return this.vexFlowCanvasContext.font=(n||"")+" "+e+"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,e){return this.vexFlowCanvasContext.scale(parseFloat(t),parseFloat(e))}resize(t,e){return[t,e]=this.SanitizeCanvasDims(parseInt(t,10),parseInt(e,10)),this.vexFlowCanvasContext.resize(t,e)}rect(t,e,n,i){return this.vexFlowCanvasContext.rect(t,e,n,i)}fillRect(t,e,n,i){return this.vexFlowCanvasContext.fillRect(t,e,n,i)}clearRect(t,e,n,i){return this.vexFlowCanvasContext.clearRect(t,e,n,i)}beginPath(){return this.vexFlowCanvasContext.beginPath()}moveTo(t,e){return this.vexFlowCanvasContext.moveTo(t,e)}lineTo(t,e){return this.vexFlowCanvasContext.lineTo(t,e)}bezierCurveTo(t,e,n,i,s,r){return this.vexFlowCanvasContext.bezierCurveTo(t,e,n,i,s,r)}quadraticCurveTo(t,e,n,i){return this.vexFlowCanvasContext.quadraticCurveTo(t,e,n,i)}arc(t,e,n,i,s,r){return this.vexFlowCanvasContext.arc(t,e,n,i,s,r)}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,e,n){return this.vexFlowCanvasContext.fillText(t,e,n)}save(){return this.vexFlowCanvasContext.save()}restore(){return this.vexFlowCanvasContext.restore()}}class g{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,e,n){return this.state.font_family=t,this.state.font_size=e,this.state.font_weight=n,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,e){return this.state.scale={x:t,y:e},this.attributes.transform="S"+t+","+e+",0,0",this.attributes.scale=t+","+e+",0,0",this.attributes.font=this.state.font_size*this.state.scale.x+"pt "+this.state.font_family,this.background_attributes.transform="S"+t+","+e+",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,e){return this.element.style.width=t,this.paper.setSize(t,e),this}setViewBox(t){this.paper.canvas.setAttribute("viewBox",t)}rect(t,e,n,i){return i<0&&(e+=i,i=-i),this.paper.rect(t,e,n-.5,i-.5).attr(this.attributes).attr("fill","none").attr("stroke-width",this.lineWidth),this}fillRect(t,e,n,i){return i<0&&(e+=i,i=-i),this.paper.rect(t,e,n-.5,i-.5).attr(this.attributes),this}clearRect(t,e,n,i){return i<0&&(e+=i,i=-i),this.paper.rect(t,e,n-.5,i-.5).attr(this.background_attributes),this}beginPath(){return this.path="",this.pen.x=0,this.pen.y=0,this}moveTo(t,e){return this.path+="M"+t+","+e,this.pen.x=t,this.pen.y=e,this}lineTo(t,e){return this.path+="L"+t+","+e,this.pen.x=t,this.pen.y=e,this}bezierCurveTo(t,e,n,i,s,r){return this.path+="C"+t+","+e+","+n+","+i+","+s+","+r,this.pen.x=s,this.pen.y=r,this}quadraticCurveTo(t,e,n,i){return this.path+="Q"+t+","+e+","+n+","+i,this.pen.x=n,this.pen.y=i,this}arc(t,e,n,i,s,r){function o(t){for(;t<0;)t+=2*Math.PI;for(;t>2*Math.PI;)t-=2*Math.PI;return t}if((i=o(i))>(s=o(s))){const t=i;i=s,s=t,r=!r}const a=s-i;return a>Math.PI?(this.arcHelper(t,e,n,i,i+a/2,r),this.arcHelper(t,e,n,i+a/2,s,r)):this.arcHelper(t,e,n,i,s,r),this}arcHelper(t,e,n,i,s,r){const o=t+n*Math.cos(i),a=e+n*Math.sin(i),c=t+n*Math.cos(s),l=e+n*Math.sin(s);let u=0,h=0;r?(h=1,s-iMath.PI&&(u=1),this.path+="M"+o+","+a+",A"+n+","+n+",0,"+u+","+h+","+c+","+l+"M"+this.pen.x+","+this.pen.y}glow(){const t=this.paper.set();if(this.shadow_attributes.width>0){const e=this.shadow_attributes,n=e.width/2;for(let i=1;i<=n;i++)t.push(this.paper.path(this.path).attr({stroke:e.color,"stroke-linejoin":"round","stroke-linecap":"round","stroke-width":+(e.width/n*i).toFixed(3),opacity:+((e.opacity||.3)/n).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,e=this.paper.path(this.path).attr(this.attributes).attr("fill","none").attr("stroke-width",t);return this.glow(e),this}closePath(){return this.path+="Z",this}measureText(t){const e=this.paper.text(0,0,t).attr(this.attributes).attr("fill","none").attr("stroke","none"),n=e.getBBox();return e.remove(),{width:n.width,height:n.height}}fillText(t,e,n){return this.paper.text(e+this.measureText(t).width/2,n-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 b={path:{x:!0,y:!0,width:!0,height:!0},rect:{},text:{width:!0,height:!0}};{const t={"font-family":!0,"font-weight":!0,"font-style":!0,"font-size":!0};i.Merge(b.rect,t),i.Merge(b.path,t)}class v{constructor(t){this.element=t,this.svgNS="http://www.w3.org/2000/svg";const e=this.create("svg");this.element.appendChild(e),this.svg=e,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,e,n){const s=this.create("g");return this.groups.push(s),this.parent.appendChild(s),this.parent=s,t&&s.setAttribute("class",i.Prefix(t)),e&&s.setAttribute("id",i.Prefix(e)),n&&n.pointerBBox&&s.setAttribute("pointer-events","bounding-box"),s}closeGroup(){this.groups.pop(),this.parent=this.groups[this.groups.length-1]}add(t){this.parent.appendChild(t)}iePolyfill(){"undefined"!=typeof navigator&&(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,e,n){let s=!1,r=!1,o="normal";"string"==typeof n&&(-1!==n.indexOf("italic")&&(n=n.replace(/italic/g,""),r=!0),-1!==n.indexOf("bold")&&(n=n.replace(/bold/g,""),s=!0),n=n.replace(/ /g,"")),o=r?"italic":o;const a={"font-family":t,"font-size":e+"pt","font-weight":n=void 0===(n=s?"bold":n)||""===n?"normal":n,"font-style":o};return this.fontSize=Number(e),i.Merge(this.attributes,a),i.Merge(this.state,a),this}setRawFont(t){const e=(t=t.trim()).split(" ");return this.attributes["font-family"]=e[1],this.state["font-family"]=e[1],this.attributes["font-size"]=e[0],this.state["font-size"]=e[0],this.fontSize=Number(e[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 i.RERR("ArgumentError","lineDash must be an array of integers.")}setLineCap(t){return this.attributes["stroke-linecap"]=t,this}resize(t,e){this.width=t,this.height=e,this.element.style.width=t;const n={width:t,height:e};return this.applyAttributes(this.svg,n),this.scale(this.state.scale.x,this.state.scale.y),this}scale(t,e){this.state.scale={x:t,y:e};const n=this.width/t,i=this.height/e;return this.setViewBox(0,0,n,i),this}setViewBox(...t){if(1===t.length){const[e]=t;this.svg.setAttribute("viewBox",e)}else{const[e,n,i,s]=t,r=e+" "+n+" "+i+" "+s;this.svg.setAttribute("viewBox",r)}}applyAttributes(t,e){const n=b[t.nodeName];return Object.keys(e).forEach(i=>{n&&n[i]||t.setAttributeNS(null,i,e[i])}),t}clear(){for(;this.svg.lastChild;)this.svg.removeChild(this.svg.lastChild);this.scale(this.state.scale.x,this.state.scale.y)}rect(t,e,n,s,r){s<0&&(e+=s,s*=-1);const o=this.create("rect");return void 0===r&&(r={fill:"none","stroke-width":this.lineWidth,stroke:"black"}),i.Merge(r,{x:t,y:e,width:n,height:s}),this.applyAttributes(o,r),this.add(o),this}fillRect(t,e,n,i){return i<0&&(e+=i,i*=-1),this.rect(t,e,n,i,this.attributes),this}clearRect(t,e,n,i){return this.rect(t,e,n,i,this.background_attributes),this}beginPath(){return this.path="",this.pen.x=NaN,this.pen.y=NaN,this}moveTo(t,e){return this.path+="M"+t+" "+e,this.pen.x=t,this.pen.y=e,this}lineTo(t,e){return this.path+="L"+t+" "+e,this.pen.x=t,this.pen.y=e,this}bezierCurveTo(t,e,n,i,s,r){return this.path+="C"+t+" "+e+","+n+" "+i+","+s+" "+r,this.pen.x=s,this.pen.y=r,this}quadraticCurveTo(t,e,n,i){return this.path+="Q"+t+" "+e+","+n+" "+i,this.pen.x=n,this.pen.y=i,this}arc(t,e,n,i,s,r){function o(t){for(;t<0;)t+=2*Math.PI;for(;t>2*Math.PI;)t-=2*Math.PI;return t}if((i=o(i))>(s=o(s))){const t=i;i=s,s=t,r=!r}const a=s-i;return a>Math.PI?(this.arcHelper(t,e,n,i,i+a/2,r),this.arcHelper(t,e,n,i+a/2,s,r)):this.arcHelper(t,e,n,i,s,r),this}arcHelper(t,e,n,i,s,r){const o=t+n*Math.cos(i),a=e+n*Math.sin(i),c=t+n*Math.cos(s),l=e+n*Math.sin(s);let u=0,h=0;r?(h=1,s-iMath.PI&&(u=1),this.path+="M"+o+" "+a+" A"+n+" "+n+" 0 "+u+" "+h+" "+c+" "+l,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,e=t.width/2;for(let n=1;n<=e;n++){const i={stroke:t.color,"stroke-linejoin":"round","stroke-linecap":"round","stroke-width":+(.4*t.width/e*n).toFixed(3),opacity:+((t.opacity||.3)/e).toFixed(3)},s=this.create("path");i.d=this.path,this.applyAttributes(s,i),this.add(s)}}return this}fill(t){this.glow();const e=this.create("path");return void 0===t&&(i.Merge(t={},this.attributes),t.stroke="none"),t.d=this.path,this.applyAttributes(e,t),this.add(e),this}stroke(){this.glow();const t=this.create("path"),e={};return i.Merge(e,this.attributes),e.fill="none",e["stroke-width"]=this.lineWidth,e.d=this.path,this.applyAttributes(t,e),this.add(t),this}measureText(t){const e=this.create("text");if("function"!=typeof e.getBBox)return{x:0,y:0,width:0,height:0};e.textContent=t,this.applyAttributes(e,this.attributes),this.svg.appendChild(e);let n=e.getBBox();return this.ie&&""!==t&&"italic"===this.attributes["font-style"]&&(n=this.ieMeasureTextFix(n,t)),this.svg.removeChild(e),n}ieMeasureTextFix(t){const e=1.196*Number(this.fontSize)+1.9598,n=t.width-e,i=t.height-1.5;return{x:t.x,y:t.y,width:n,height:i}}fillText(t,e,n){if(!t||t.length<=0)return;const s={};i.Merge(s,this.attributes),s.stroke="none",s.x=e,s.y=n;const r=this.create("text");r.textContent=t,this.applyAttributes(r,s),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 y=null;class S{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 y}static set lastContext(t){y=t}static buildContext(t,e,n,i,s){const r=new S(t,e);n&&i&&r.resize(n,i),s||(s="#FFF");const o=r.getContext();return o.setBackgroundFillStyle(s),S.lastContext=o,o}static getCanvasContext(t,e,n,i){return S.buildContext(t,S.Backends.CANVAS,e,n,i)}static getRaphaelContext(t,e,n,i){return S.buildContext(t,S.Backends.RAPHAEL,e,n,i)}static getSVGContext(t,e,n,i){return S.buildContext(t,S.Backends.SVG,e,n,i)}static bolsterCanvasContext(t){return S.USE_CANVAS_PROXY?new m(t):(t.vexFlowCanvasContext=t,["clear","setFont","setRawFont","setFillStyle","setBackgroundFillStyle","setStrokeStyle","setShadowColor","setShadowBlur","setLineWidth","setLineCap","setLineDash","openGroup","closeGroup","getGroup"].forEach(e=>{t[e]=t[e]||m.prototype[e]}),t)}static drawDashedLine(t,e,n,i,s,r){t.beginPath();const o=i-e,a=s-n,c=Math.atan2(a,o);let l=e,u=n;t.moveTo(e,n);let h=0,d=!0;for(;!(o<0?l<=i:l>=i)||!(a<0?u<=s:u>=s);){const e=r[h++%r.length],n=l+Math.cos(c)*e;l=o<0?Math.max(i,n):Math.min(i,n);const f=u+Math.sin(c)*e;u=a<0?Math.max(s,f):Math.min(s,f),d?t.lineTo(l,u):t.moveTo(l,u),d=!d}t.closePath(),t.stroke()}constructor(t,e){if(this.elementId=t,!this.elementId)throw new i.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=e,this.backend===S.Backends.CANVAS){if(!this.element.getContext)throw new i.RERR("BadElement","Can't get canvas context from element: "+t);this.ctx=S.bolsterCanvasContext(this.element.getContext("2d"))}else if(this.backend===S.Backends.RAPHAEL)this.ctx=new g(this.element);else{if(this.backend!==S.Backends.SVG)throw new i.RERR("InvalidBackend","No support for backend: "+this.backend);this.ctx=new v(this.element)}}resize(t,e){if(this.backend===S.Backends.CANVAS){if(!this.element.getContext)throw new i.RERR("BadElement","Can't get canvas context from element: "+this.elementId);[t,e]=m.SanitizeCanvasDims(t,e);const n=window.devicePixelRatio||1;this.element.width=t*n,this.element.height=e*n,this.element.style.width=t+"px",this.element.style.height=e+"px",this.ctx=S.bolsterCanvasContext(this.element.getContext("2d")),this.ctx.scale(n,n)}else this.ctx.resize(t,e);return this}getContext(){return this.ctx}}class x extends c{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,e){return this.x_begin=t,this.x_end=e,this}setDirection(t){this.stem_direction=t}setExtension(t){this.stem_extension=t}getExtension(){return this.stem_extension}setYBounds(t,e){this.y_top=t,this.y_bottom=e}getCategory(){return x.CATEGORY}getHeight(){const t=this.stem_direction===x.UP?this.stem_up_y_offset:this.stem_down_y_offset;return(this.y_bottom-this.y_top)*this.stem_direction+(x.HEIGHT-t+this.stem_extension)*this.stem_direction}getBoundingBox(){throw new i.RERR("NotImplemented","getBoundingBox() not implemented.")}getExtents(){const t=this.stem_direction===x.UP,e=[this.y_top,this.y_bottom],n=x.HEIGHT+this.stem_extension,i=(t?Math.min:Math.max)(...e),s=(t?Math.max:Math.min)(...e);return{topY:i+n*-this.stem_direction,baseY:s}}setVisibility(t){return this.hide=!t,this}setStemlet(t,e){return this.isStemlet=t,this.stemletHeight=e,this}draw(){if(this.setRendered(),this.hide)return;const t=this.checkContext();let e,n;const s=this.stem_direction;s===x.DOWN?(e=this.x_begin,n=this.y_top+this.stem_down_y_offset):(e=this.x_end,n=this.y_bottom-this.stem_up_y_offset);const r=this.getHeight();!function(...t){x.DEBUG&&i.L("Vex.Flow.Stem",t)}("Rendering stem - ","Top Y: ",this.y_top,"Bottom Y: ",this.y_bottom);const o=this.isStemlet?r-this.stemletHeight*this.stem_direction:0;t.save(),this.applyStyle(t),t.beginPath(),t.setLineWidth(x.WIDTH),t.moveTo(e,n-o),t.lineTo(e,n-r-this.renderHeightAdjustment*s),t.stroke(),this.restoreStyle(t),t.restore()}}class _ extends c{static get LOCATION_TOP(){return 1}static get LOCATION_BOTTOM(){return-1}static get NESTING_OFFSET(){return 15}constructor(t,e){if(super(),this.setAttribute("type","Tuplet"),!t||!t.length)throw new i.RuntimeError("BadArguments","No notes provided for tuplet.");this.options=i.Merge({},e),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,"bracketed"in this.options?this.bracketed=this.options.bracketed:this.bracketed=t.some(t=>null===t.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||_.LOCATION_TOP,ht.AlignRestsToNotes(t,!0,!0),this.resolveGlyphs(),this.attach()}attach(){for(let t=0;t=1;)this.numerator_glyphs.unshift(new f("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 f("v"+t%10,this.point)),t=parseInt(t/10,10)}getNestedTupletCount(){const t=this.location,e=this.notes[0];let n=s(e,t),i=s(e,t);function s(t,e){return t.tupletStack.filter(t=>t.location===e).length}return this.notes.forEach(e=>{const r=s(e,t);n=r>n?r:n,i=ri&&(i=e)}}return i+t+e}draw(){this.checkContext(),this.setRendered();const t=this.notes[0],e=this.notes[this.notes.length-1];this.bracketed?(this.x_pos=t.getTieLeftX()-5,this.width=e.getTieRightX()-this.x_pos+5):(this.x_pos=t.getStemX(),this.width=e.getStemX()-this.x_pos),this.y_pos=this.getYPosition();const n=(t,e)=>t+e.getMetrics().width;let i=this.numerator_glyphs.reduce(n,0);this.ratioed&&(i=this.denom_glyphs.reduce(n,i),i+=.32*this.point);const s=this.x_pos+this.width/2-i/2;if(this.bracketed){const t=this.width/2-i/2-5;t>0&&(this.context.fillRect(this.x_pos,this.y_pos,t,1),this.context.fillRect(this.x_pos+this.width/2+i/2+5,this.y_pos,t,1),this.context.fillRect(this.x_pos,this.y_pos+(this.location===_.LOCATION_BOTTOM),1,10*this.location),this.context.fillRect(this.x_pos+this.width,this.y_pos+(this.location===_.LOCATION_BOTTOM),1,10*this.location))}let r=0;if(this.numerator_glyphs.forEach(t=>{t.render(this.context,s+r,this.y_pos+this.point/3-2),r+=t.getMetrics().width}),this.ratioed){const t=s+r+.16*this.point,e=.06*this.point;this.context.beginPath(),this.context.arc(t,this.y_pos-.08*this.point,e,0,2*Math.PI,!0),this.context.closePath(),this.context.fill(),this.context.beginPath(),this.context.arc(t,this.y_pos+.12*this.point,e,0,2*Math.PI,!0),this.context.closePath(),this.context.fill(),r+=.32*this.point,this.denom_glyphs.forEach(t=>{t.render(this.context,s+r,this.y_pos+this.point/3-2),r+=t.getMetrics().width})}}}function w(t){let e=0;return t.forEach(t=>{t.keyProps&&t.keyProps.forEach(t=>{e+=t.line-3})}),e>=0?x.DOWN:x.UP}const E="L",T="B";class C extends c{static getDefaultBeamGroups(t){t&&"c"!==t||(t="4/4");const e={"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!==e)return e.map(t=>(new s).parse(t));{const e=parseInt(t.split("/")[0],10),n=parseInt(t.split("/")[1],10);if(e%3==0)return[new s(3,n)];if(n>4)return[new s(2,n)];if(n<=4)return[new s(1,n)]}return[new s(1,4)]}static applyAndGetBeams(t,e,n){return C.generateBeams(t.getTickables(),{groups:n,stem_direction:e})}static generateBeams(t,e){e||(e={}),e.groups&&e.groups.length||(e.groups=[new s(2,8)]);const n=e.groups.map(t=>{if(!t.multiply)throw new i.RuntimeError("InvalidBeamGroups","The beam groups must be an array of Vex.Flow.Fractions");return t.clone().multiply(p.RESOLUTION,1)}),r=t;let o=0,a=[],c=[];function l(){n.length-1>o?o+=1:o=0}!function(){let t=[];r.forEach(e=>{if(t=[],e.shouldIgnoreTicks())return a.push(c),void(c=t);c.push(e);const i=n[o].clone(),r=c.reduce((t,e)=>e.getTicks().clone().add(t),new s(0,1)),u=p.durationToNumber(e.duration)<8;u&&e.tuplet&&(i.numerator*=2),r.greaterThan(i)?(u||t.push(c.pop()),a.push(c),c=t,l()):r.equals(i)&&(a.push(c),c=t,l())}),c.length>0&&a.push(c)}(),function(){const t=[];a.forEach(n=>{let i=[];n.forEach((n,s,r)=>{const o=0===s||s===r.length-1,a=r[s-1],c=!e.beam_rests&&n.isRest(),l=e.beam_rests&&e.beam_middle_only&&n.isRest()&&o;let u=!1;if(e.maintain_stem_directions&&a&&!n.isRest()&&!a.isRest()){const t=a.getStemDirection();u=n.getStemDirection()!==t}const h=parseInt(n.duration,10)<8;c||l||u||h?(i.length>0&&t.push(i),i=u?[n]:[]):i.push(n)}),i.length>0&&t.push(i)}),a=t}(),a.forEach(t=>{let n;if(e.maintain_stem_directions){const e=function(t){for(let e=0;e{t.setStemDirection(e)})}(t,n)});const u=a.filter(t=>{if(t.length>1){let e=!0;return t.forEach(t=>{t.getIntrinsicTicks()>=p.durationToTicks("4")&&(e=!1)}),e}return!1}),h=function(){const t=[];return a.forEach(e=>{let n=null;e.forEach(e=>{e.tuplet&&n!==e.tuplet&&(n=e.tuplet,t.push(n))})}),t}(),d=[];return u.forEach(t=>{const n=new C(t);e.show_stemlets&&(n.render_options.show_stemlets=!0),e.secondary_breaks&&(n.render_options.secondary_break_ticks=p.durationToTicks(e.secondary_breaks)),!0===e.flat_beams&&(n.render_options.flat_beams=!0,n.render_options.flat_beam_offset=e.flat_beam_offset),d.push(n)}),h.forEach(t=>{const e=t.notes[0].stem_direction===x.DOWN?_.LOCATION_BOTTOM:_.LOCATION_TOP;t.setTupletLocation(e);let n=!1;for(let i=0;i=p.durationToTicks("4"))throw new i.RuntimeError("BadArguments","Beams can only be applied to notes shorter than a quarter note.");let n,s;for(this.stem_direction=x.UP,n=0;nt+e.stem_direction,0)>-1?x.UP:x.DOWN),n=0;nt.getGlyph().beam_count).reduce((t,e)=>e>t?e:t)}breakSecondaryAt(t){return this.break_on_indices=t,this}getSlopeY(t,e,n,i){return n+(t-e)*i}calculateSlope(){const{notes:t,stem_direction:e,render_options:{max_slope:n,min_slope:i,slope_iterations:s,slope_cost:r}}=this,o=t[0],a=((t,e)=>{const n=t.getStemExtents().topY,i=t.getStemX();return(e.getStemExtents().topY-n)/(e.getStemX()-i)})(o,t[t.length-1]),c=(n-i)/s;let l=Number.MAX_VALUE,u=0,h=0;for(let d=i;d<=n;d+=c){let n=0,i=0;for(let r=1;ri)&&(c=i,o=Math.min(...n.getYs()),a=n.getBeamCount())}let l=r/t.length;const u=i+a*(1.5*n),h=o+u*-e;e===x.DOWN&&lh&&(l=o-u),s?(e===x.DOWN&&l>s||e===x.UP&&l=8&&(u=-1!==this.break_on_indices.indexOf(l),this.render_options.secondary_break_ticks&&a>=this.render_options.secondary_break_ticks&&(a=0,u=!0));const h=c.getIntrinsicTicks(){t.getStem()&&t.getStem().setContext(this.context).draw()},this)}drawBeamLines(){this.checkContext();const t=["4","8","16","32","64"],e=this.notes[0];let n=this.getBeamYToDraw();const i=e.getStemX(),s=this.render_options.beam_width*this.stem_direction;for(let r=0;r{t.getStave()||t.setStave(this.stave)}),this.preFormatted=!0),this}draw(t=this.context,e=this.stave){this.setRendered();let n=null;for(let s=0;s0&&n){const t=r.getBoundingBox();t&&n.mergeWith(t)}r.setContext(t),r.drawWithStyle()}this.boundingBox=n}}function P(t,e,n,s,r){if(e!==A.type.BOLD_DOUBLE_LEFT&&e!==A.type.BOLD_DOUBLE_RIGHT)throw new i.RERR("InvalidConnector","A REPEAT_BEGIN or REPEAT_END type must be provided.");let o=3,a=3.5;e===A.type.BOLD_DOUBLE_RIGHT&&(o=-5,a=3),t.fillRect(n+o,s,1,r-s),t.fillRect(n-2,s,a,r-s)}class A extends c{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:A.type.SINGLE_RIGHT,singleLeft:A.type.SINGLE_LEFT,single:A.type.SINGLE,double:A.type.DOUBLE,brace:A.type.BRACE,bracket:A.type.BRACKET,boldDoubleLeft:A.type.BOLD_DOUBLE_LEFT,boldDoubleRight:A.type.BOLD_DOUBLE_RIGHT,thinDouble:A.type.THIN_DOUBLE,none:A.type.NONE}}constructor(t,e){super(),this.setAttribute("type","StaveConnector"),this.thickness=p.STAVE_LINE_THICKNESS,this.width=3,this.top_stave=t,this.bottom_stave=e,this.type=A.type.DOUBLE,this.font={family:"times",size:16,weight:"normal"},this.x_shift=0,this.texts=[]}setType(t){return(t="string"==typeof t?A.typeString[t]:t)>=A.type.SINGLE_RIGHT&&t<=A.type.NONE&&(this.type=t),this}setText(t,e){return this.texts.push({content:t,options:i.Merge({shift_x:0,shift_y:0},e)}),this}setFont(t){i.Merge(this.font,t)}setXShift(t){if("number"!=typeof t)throw i.RERR("InvalidType","x_shift must be a Number");return this.x_shift=t,this}draw(){const t=this.checkContext();this.setRendered();let e=this.top_stave.getYForLine(0),n=this.bottom_stave.getYForLine(this.bottom_stave.getNumLines()-1)+this.thickness,s=this.width,r=this.top_stave.getX();(this.type===A.type.SINGLE_RIGHT||this.type===A.type.BOLD_DOUBLE_RIGHT||this.type===A.type.THIN_DOUBLE)&&(r=this.top_stave.getX()+this.top_stave.width);let o=n-e;switch(this.type){case A.type.SINGLE:case A.type.SINGLE_LEFT:case A.type.SINGLE_RIGHT:s=1;break;case A.type.DOUBLE:r-=this.width+2;break;case A.type.BRACE:{s=12;const i=this.top_stave.getX()-2+this.x_shift,r=e,a=i,c=n,l=i-s,u=r+o/2,h=l-.9*s,d=r+.2*o,f=i+1.1*s,p=u-.135*o,m=f,g=u+.135*o,b=h,v=c-.2*o,y=l-s,S=v,x=i+.4*s,_=u+.135*o,w=x,E=u-.135*o,T=y,C=d;t.beginPath(),t.moveTo(i,r),t.bezierCurveTo(h,d,f,p,l,u),t.bezierCurveTo(m,g,b,v,a,c),t.bezierCurveTo(y,S,x,_,l,u),t.bezierCurveTo(w,E,T,C,i,r),t.fill(),t.stroke();break}case A.type.BRACKET:e-=4,n+=4,o=n-e,f.renderGlyph(t,r-5,e-3,40,"v1b",!0),f.renderGlyph(t,r-5,n+3,40,"v10",!0),r-=this.width+2;break;case A.type.BOLD_DOUBLE_LEFT:P(t,this.type,r+this.x_shift,e,n);break;case A.type.BOLD_DOUBLE_RIGHT:P(t,this.type,r,e,n);break;case A.type.THIN_DOUBLE:s=1;break;case A.type.NONE:break;default:throw new i.RERR("InvalidType",`The provided StaveConnector.type (${this.type}) is invalid`)}this.type!==A.type.BRACE&&this.type!==A.type.BOLD_DOUBLE_LEFT&&this.type!==A.type.BOLD_DOUBLE_RIGHT&&this.type!==A.type.NONE&&t.fillRect(r,e,s,o),this.type===A.type.THIN_DOUBLE&&t.fillRect(r-3,e,s,o),t.save(),t.lineWidth=2,t.setFont(this.font.family,this.font.size,this.font.weight);for(let i=0;i0){const i=m.space.deviation,s=i>=0?"+":"";t.setFillStyle("red"),t.fillText(s+Math.round(i),a+e.getXShift(),n-10)}t.restore()}constructor(t){if(super(),this.setAttribute("type","Note"),!t)throw new i.RuntimeError("BadArguments","Note must have valid initialization data to identify duration and type.");const e=p.parseNoteStruct(t);if(!e)throw new i.RuntimeError("BadArguments","Invalid note initialization object: "+JSON.stringify(t));if(this.duration=e.duration,this.dots=e.dots,this.noteType=e.type,this.customTypes=e.customTypes,t.duration_override?this.setDuration(t.duration_override):this.setIntrinsicTicks(e.ticks),this.modifiers=[],this.glyph=p.getGlyphProps(this.duration,this.noteType),this.customGlyphs=this.customTypes.map(t=>p.getGlyphProps(this.duration,t)),this.positions&&("object"!=typeof this.positions||!this.positions.length))throw new i.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:L.STAVEPADDING}}getPlayNote(){return this.playNote}setPlayNote(t){return this.playNote=t,this}isRest(){return!1}addStroke(t,e){return e.setNote(this),e.setIndex(t),this.modifiers.push(e),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 L.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 i.RERR("NoYValues","No Y-values calculated for this note.");return this.ys}getYForTopText(t){if(!this.stave)throw new i.RERR("NoStave","No stave attached to this note.");return this.stave.getYForTopText(t)}getBoundingBox(){return null}getVoice(){if(!this.voice)throw new i.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,e=0){return t.setNote(this),t.setIndex(e),this.modifiers.push(t),this.setPreFormatted(!1),this}getModifierStartXY(){if(!this.preFormatted)throw new i.RERR("UnformattedNote","Can't call GetModifierStartXY on an unformatted note");return{x:this.getAbsoluteX(),y:this.ys[0]}}getMetrics(){if(!this.preFormatted)throw new i.RERR("UnformattedNote","Can't call getMetrics on an unformatted note.");let t=0,e=0;null!=this.modifierContext&&(t=this.modifierContext.state.left_shift,e=this.modifierContext.state.right_shift);const n=this.getWidth();return{width:n,noteWidth:n-t-e-this.extraLeftPx-this.extraRightPx,left_shift:this.x_shift,modLeftPx:t,modRightPx:e,extraLeftPx:this.extraLeftPx,extraRightPx:this.extraRightPx}}setWidth(t){this.width=t}getWidth(){if(!this.preFormatted)throw new i.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 i.RERR("NoTickContext","Note needs a TickContext assigned for an X-Value");return this.tickContext.getX()+this.x_shift}getAbsoluteX(){if(!this.tickContext)throw new i.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 t=this.tickContext.getExtraPx();this.left_modPx=Math.max(this.left_modPx,t.left),this.right_modPx=Math.max(this.right_modPx,t.right)}}}class O extends L{static get CATEGORY(){return"notehead"}constructor(t){if(super(t),this.setAttribute("type","NoteHead"),this.index=t.index,this.x=t.x||0,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||V.STEM_UP,this.line=t.line,this.glyph=p.getGlyphProps(this.duration,this.note_type),!this.glyph)throw new i.RuntimeError("BadArguments",`No glyph found for duration '${this.duration}' and type '${this.note_type}'`);this.glyph_code=this.glyph.code_head,this.x_shift=t.x_shift||0,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.style=t.style,this.slashed=t.slashed,i.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 O.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(){const t=this.preFormatted?super.getAbsoluteX():this.x,e=x.WIDTH/2;return t+(this.displaced?(this.width-e)*this.stem_direction:0)}getBoundingBox(){if(!this.preFormatted)throw new i.RERR("UnformattedNote","Can't call getBoundingBox on an unformatted note.");const t=this.stave.getSpacingBetweenLines(),e=t/2,n=this.y-e;return new p.BoundingBox(this.getAbsoluteX(),n,this.width,t)}setStave(t){const e=this.getLine();return this.stave=t,this.setY(t.getYForNote(e)),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 e=this.getAbsoluteX();this.custom_glyph&&(e+=this.stem_direction===x.UP?this.stem_up_x_offset:this.stem_down_x_offset);const n=this.y;!function(...t){O.DEBUG&&i.L("Vex.Flow.NoteHead",t)}("Drawing note head '",this.note_type,this.duration,"' at",e,n);const s=this.stem_direction,r=this.render_options.glyph_font_scale;if(this.style&&this.applyStyle(t),"s"===this.note_type){const i=this.stave.getSpacingBetweenLines();!function(t,e,n,i,s,r){const o=p.SLASH_NOTEHEAD_WIDTH;t.save(),t.setLineWidth(p.STEM_WIDTH);let a=!1;if(p.durationToNumber(e)>2&&(a=!0),a||(n-=p.STEM_WIDTH/2*s),t.beginPath(),t.moveTo(n,i+r),t.lineTo(n,i+1),t.lineTo(n+o,i-r),t.lineTo(n+o,i),t.lineTo(n,i+r),t.closePath(),a?t.fill():t.stroke(),p.durationToFraction(e).equals(.5)){const e=[-3,-1,o+1,o+3];for(let s=0;s{const n=t.getTickContext();t.setStave(e.stave),n.setXOffset(s)})}}class N extends R{static get CATEGORY(){return"dots"}static format(t,e){const n=e.right_shift;if(!t||0===t.length)return!1;const i=[],s={};for(let h=0;he.line-t.line);let r=n,o=0,a=null,c=null,l=null,u=0;for(let h=0;ho?r:o,a=d,c=e}return e.right_shift+=o,!0}constructor(){super(),this.setAttribute("type","Dot"),this.note=null,this.index=null,this.position=R.Position.RIGHT,this.radius=2,this.setWidth(5),this.dot_shiftY=0}getCategory(){return N.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 i.RERR("NoAttachedNote","Can't draw dot without a note and index.");const t=this.note.stave.options.spacing_between_lines_px,e=this.note.getModifierStartXY(this.position,this.index,{forceFlagRight:!0});"tabnotes"===this.note.getCategory()&&(e.y=this.note.getStemExtents().baseY);const n=e.x+this.x_shift+this.width-this.radius,s=e.y+this.y_shift+this.dot_shiftY*t,r=this.context;r.beginPath(),r.arc(n,s,this.radius,0,2*Math.PI,!1),r.fill()}}function D(t,e,n){const i=(e.isrest?0:1)*n;t.line+=i,t.maxLine+=i,t.minLine+=i,t.note.setKeyLine(0,t.note.getKeyLine(0)+i)}class V extends k{static get CATEGORY(){return"stavenotes"}static get STEM_UP(){return x.UP}static get STEM_DOWN(){return x.DOWN}static get DEFAULT_LEDGER_LINE_OFFSET(){return 3}static format(t,e){if(!t||t.length<2)return!1;if(t[0].getStave())return V.formatByY(t,e);const n=[];for(let i=0;i2?n[1]:null;let a=s>2?n[2]:n[1];2===s&&-1===r.stemDirection&&1===a.stemDirection&&(r=n[1],a=n[0]);const c=Math.max(r.voice_shift,a.voice_shift);let l,u=0;if(2===s){const t=r.stemDirection===a.stemDirection?0:.5;return r.stemDirection===a.stemDirection&&r.minLine<=a.maxLine&&(r.isrest||(l=Math.abs(r.line-(a.maxLine+.5)),l=Math.max(l,r.stemMin),r.minLine=r.line-l,r.note.setStemLength(10*l))),r.minLine<=a.maxLine+t&&(r.isrest?D(r,a,1):a.isrest?D(a,r,-1):(u=c,r.stemDirection===a.stemDirection?r.note.setXShift(u+3):a.note.setXShift(u))),!0}return null!==o&&o.minLinet.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 i.RuntimeError("BadArguments","Invalid note initialization data (No glyph found): "+JSON.stringify(t));this.displaced=!1,this.dot_shiftY=0,this.keyProps=[],this.use_default_head_x=!1,this.note_heads=[],this.modifiers=[],i.Merge(this.render_options,{glyph_font_scale:t.glyph_font_scale||p.DEFAULT_NOTATION_FONT_SCALE,stroke_px:t.stroke_px||V.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(t=>t.getStyle());this.buildNoteHeads(),this.note_heads.forEach((e,n)=>e.setStyle(t[n])),this.stave&&this.note_heads.forEach(t=>t.setStave(this.stave)),this.calcExtraPx()}setBeam(t){return this.beam=t,this.calcExtraPx(),this}getCategory(){return V.CATEGORY}buildStem(){this.setStem(new x({hide:!!this.isRest()}))}buildNoteHeads(){this.note_heads=[];const t=this.getStemDirection(),e=this.getKeys();let n,i,s,r=null,o=null,a=!1;t===x.UP?(n=0,i=e.length,s=1):t===x.DOWN&&(n=e.length-1,i=-1,s=-1);for(let c=n;c!==i;c+=s){const e=this.keyProps[c],n=e.line;null===r?r=n:(o=Math.abs(r-n),0===o||.5===o?a=!a:(a=!1,this.use_default_head_x=!0)),r=n;const i=new O({duration:this.duration,note_type:this.noteType,displaced:a,stem_direction:t,custom_glyph_code:e.code,glyph_font_scale:this.render_options.glyph_font_scale,x_shift:e.shift_right,stem_up_x_offset:e.stem_up_x_offset,stem_down_x_offset:e.stem_down_x_offset,line:e.line});this.note_heads[c]=i}}autoStem(){this.minLine=this.keyProps[0].line,this.maxLine=this.keyProps[this.keyProps.length-1].line;const t=(this.minLine+this.maxLine)/2<3?x.UP:x.DOWN;this.setStemDirection(t)}calculateKeyProps(){let t=null;for(let e=0;e0&&(this.keyProps[e-1].displaced=!0)),t=o,this.keyProps.push(r)}t=-1/0,this.keyProps.forEach(e=>{e.linet.line-e.line)}getBoundingBox(){if(!this.preFormatted)throw new i.RERR("UnformattedNote","Can't call getBoundingBox on an unformatted note.");const{width:t,modLeftPx:e,extraLeftPx:n}=this.getMetrics(),s=this.getAbsoluteX()-e-n;let r=0,o=0;const a=this.getStave().getSpacingBetweenLines()/2,c=2*a;if(this.isRest()){const t=this.ys[0],e=p.durationToFraction(this.duration);e.equals(1)||e.equals(2)?(r=t-a,o=t+a):(r=t-this.glyph.line_above*c,o=t+this.glyph.line_below*c)}else if(this.glyph.stem){const t=this.getStemExtents();t.baseY+=a*this.stem_direction,r=Math.min(t.topY,t.baseY),o=Math.max(t.topY,t.baseY)}else{r=null,o=null;for(let t=0;te&&(e=i):i1}hasStem(){return this.glyph.stem}hasFlag(){return super.hasFlag()&&!this.isRest()}getStemX(){return"r"===this.noteType?this.getCenterGlyphX():super.getStemX()+(t=this,x.WIDTH/(2*-t.getStemDirection()));var t}getYForTopText(t){const e=this.getStemExtents();return Math.min(this.stave.getYForTopText(t),e.topY-this.render_options.annotation_spacing*(t+1))}getYForBottomText(t){const e=this.getStemExtents();return Math.max(this.stave.getYForTopText(t),e.baseY+this.render_options.annotation_spacing*t)}setStave(t){super.setStave(t);const e=this.note_heads.map(e=>(e.setStave(t),e.getY()));if(this.setYs(e),this.stem){const{y_top:t,y_bottom:e}=this.getNoteHeadBounds();this.stem.setYBounds(t,e)}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 e=this.keyProps[this.keyProps.length-1].line,n=Math.max(t,e),s=Math.min(t,e);t=i.MidLine(n,s)}return t}getModifierStartXY(t,e,n){if(n=n||{},!this.preFormatted)throw new i.RERR("UnformattedNote","Can't call GetModifierStartXY on an unformatted note");if(0===this.ys.length)throw new i.RERR("NoYValues","No Y-Values calculated for this note.");const{ABOVE:s,BELOW:r,LEFT:o,RIGHT:a}=R.Position;let c=0;return t===o?c=-2:t===a?(c=this.getGlyphWidth()+this.x_shift+2,this.stem_direction===x.UP&&this.hasFlag()&&(n.forceFlagRight||((t,e)=>e===(t.getStemDirection()===x.UP?t.keyProps.length-1:0))(this,e))&&(c+=this.flag.getMetrics().width)):t!==r&&t!==s||(c=this.getGlyphWidth()/2),{x:this.getAbsoluteX()+c,y:this.ys[e]}}setStyle(t){super.setStyle(t),this.note_heads.forEach(e=>e.setStyle(t)),this.stem.setStyle(t)}setStemStyle(t){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,e){return this.note_heads[t].setStyle(e),this}setKeyLine(t,e){return this.keyProps[t].line=e,this.reset(),this}getKeyLine(t){return this.keyProps[t].line}addToModifierContext(t){this.setModifierContext(t);for(let e=0;e{const h=u.getLine(),d=u.getY();(null===t||de)&&(e=d),null===i&&u.isDisplaced()&&(i=u.getAbsoluteX()),null!==n||u.isDisplaced()||(n=u.getAbsoluteX()),s=h>s?h:s,r=h{let a;a=i&&e?m-n:e?p-n:f-n;const c=e&&i?o:r;s.beginPath(),s.moveTo(a,t),s.lineTo(a+c,t),s.stroke()},b={...t.getStyle()||{},...this.getLedgerLineStyle()||{}};this.applyStyle(s,b);for(let i=6;i<=a;++i){const e=null!==p&&i<=u,n=null!==f&&i<=l;g(t.getYForNote(i),e,n)}for(let i=0;i>=c;--i){const e=null!==p&&i>=d,n=null!==f&&i>=h;g(t.getYForNote(i),e,n)}this.restoreStyle(s,b)}drawModifiers(){if(!this.context)throw new i.RERR("NoCanvasContext","Can't draw without a canvas context.");const t=this.context;t.openGroup("modifiers");for(let e=0;e{this.context.openGroup("notehead",null,{pointerBBox:!0}),t.setContext(this.context).draw(),this.context.closeGroup()})}drawStem(t){if(!this.context)throw new i.RERR("NoCanvasContext","Can't draw without a canvas context.");t&&this.setStem(new x(t)),this.context.openGroup("stem",null,{pointerBBox:!0}),this.stem.setContext(this.context).draw(),this.context.closeGroup()}draw(){if(!this.context)throw new i.RERR("NoCanvasContext","Can't draw without a canvas context.");if(!this.stave)throw new i.RERR("NoStave","Can't draw without a stave.");if(0===this.ys.length)throw new i.RERR("NoYValues","Can't draw note without Y values.");const t=this.getNoteHeadBeginX(),e=this.hasStem()&&!this.beam;this.note_heads.forEach(e=>e.setX(t));const n=this.getStemX();this.stem.setNoteHeadXBounds(n,n),function(...t){V.DEBUG&&i.L("Vex.Flow.StaveNote",t)}("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}),e&&this.drawStem(),this.drawNoteHeads(),this.drawFlag(),this.context.closeGroup(),this.drawModifiers(),this.context.closeGroup(),this.restoreStyle(),this.setRendered()}}class B extends R{static get CATEGORY(){return"frethandfinger"}static format(t,e){const{left_shift:n,right_shift:i}=e;if(!t||0===t.length)return!1;const s=[];let r=null,o=0,a=0;for(let p=0;pe.line-t.line);let c=0,l=0,u=0,h=0,d=null,f=null;for(let p=0;pu?t:u):r===R.Position.RIGHT&&(o.setXShift(l),t=a+v,h=t>h?t:h),d=m,f=e}return e.left_shift+=u,e.right_shift+=h,!0}constructor(t){super(),this.setAttribute("type","FretHandFinger"),this.note=null,this.index=null,this.finger=t,this.width=7,this.position=R.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 B.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 i.RERR("NoAttachedNote","Can't draw string number without a note and index.");this.setRendered();const t=this.context,e=this.note.getModifierStartXY(this.position,this.index);let n=e.x+this.x_shift+this.x_offset,s=e.y+this.y_shift+this.y_offset+5;switch(this.position){case R.Position.ABOVE:n-=4,s-=12;break;case R.Position.BELOW:n-=2,s+=10;break;case R.Position.LEFT:n-=this.width;break;case R.Position.RIGHT:n+=1;break;default:throw new i.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,n,s),t.restore()}}class F{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:F.scales.major,m:F.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>=F.NUM_TONES)}isValidIntervalValue(t){return this.isValidNoteValue(t)}getNoteParts(t){if(!t||t.length<1)throw new i.RERR("BadArguments","Invalid note name: "+t);if(t.length>3)throw new i.RERR("BadArguments","Invalid note name: "+t);const e=t.toLowerCase(),n=/^([cdefgab])(b|bb|n|#|##)?$/.exec(e);if(null!=n)return{root:n[1],accidental:n[2]};throw new i.RERR("BadArguments","Invalid note name: "+t)}getKeyParts(t){if(!t||t.length<1)throw new i.RERR("BadArguments","Invalid key: "+t);const e=t.toLowerCase(),n=/^([cdefgab])(b|#)?(mel|harm|m|M)?$/.exec(e);if(null!=n){const t=n[1],e=n[2];let i=n[3];return i||(i="M"),{root:t,accidental:e,type:i}}throw new i.RERR("BadArguments","Invalid key: "+t)}getNoteValue(t){const e=F.noteValues[t];if(null==e)throw new i.RERR("BadArguments","Invalid note name: "+t);return e.int_val}getIntervalValue(t){const e=F.intervals[t];if(null==e)throw new i.RERR("BadArguments","Invalid interval name: "+t);return e}getCanonicalNoteName(t){if(!this.isValidNoteValue(t))throw new i.RERR("BadArguments","Invalid note value: "+t);return F.canonical_notes[t]}getCanonicalIntervalName(t){if(!this.isValidIntervalValue(t))throw new i.RERR("BadArguments","Invalid interval value: "+t);return F.diatonic_intervals[t]}getRelativeNoteValue(t,e,n){if(null==n&&(n=1),1!==n&&-1!==n)throw new i.RERR("BadArguments","Invalid direction: "+n);let s=(t+n*e)%F.NUM_TONES;return s<0&&(s+=F.NUM_TONES),s}getRelativeNoteName(t,e){const n=this.getNoteParts(t),s=this.getNoteValue(n.root);let r=e-s;if(Math.abs(r)>F.NUM_TONES-3){let n=1;r>0&&(n=-1);const o=(e+1+(s+1))%F.NUM_TONES*n;if(Math.abs(o)>2)throw new i.RERR("BadArguments",`Notes not related: ${t}, ${e})`);r=o}if(Math.abs(r)>2)throw new i.RERR("BadArguments",`Notes not related: ${t}, ${e})`);let o=n.root;if(r>0)for(let i=1;i<=r;++i)o+="#";else if(r<0)for(let i=-1;i>=r;--i)o+="b";return o}getScaleTones(t,e){const n=[t];let i=t;for(let s=0;st.getMetrics().width;class W extends R{static get CATEGORY(){return"accidentals"}static format(t,e){const n=e.left_shift+1;if(!t||0===t.length)return;const i=[];let s,r=null,o=0;for(let p=0;pe.line-t.line);const a=[];let c=0,l=null;for(let p=0;pc?t.shift:c,l=t.line}let u=0;for(let g=0;ga[e+t],s=t=>t.map(i),r=(t,e)=>{const[n,i]=s([t,e]).map(t=>t.line);return n-i},o=(...t)=>t.map(s).every(t=>!this.checkCollision(...t)),c=n-e+1;let l,h,d=this.checkCollision(a[e],a[n])?"a":"b";switch(c){case 3:"a"===d&&.5===r(1,2)&&.5!==r(0,1)&&(d="second_on_bottom");break;case 4:o([0,2],[1,3])&&(d="spaced_out_tetrachord");break;case 5:"b"===d&&o([1,3])&&(d="spaced_out_pentachord",o([0,2],[2,4])&&(d="very_spaced_out_pentachord"));break;case 6:o([0,3],[1,4],[2,5])&&(d="spaced_out_hexachord"),o([0,2],[2,4],[1,3],[3,5])&&(d="very_spaced_out_hexachord")}if(c>=7){let t=2,e=!0;for(;!0===e;){e=!1;for(let n=0;n+th?u:h}else for(l=g;l<=n;l++)h=p.accidentalColumnsTable[c][d][l-g],a[l].column=h,u=u>h?u:h;g=n}const h=[],d=[];for(let p=0;p<=u;p++)h[p]=0,d[p]=0;h[0]=c+n,d[0]=c+n,a.forEach(t=>{t.width>h[t.column]&&(h[t.column]=t.width)});for(let p=1;p{let e=0;const n=m+t.numAcc;for(;m0?(i=e.flatLine||e.dblSharpLine?2.5:3,t.dblSharpLine&&(n-=.5)):(i=t.flatLine||t.dblSharpLine?2.5:3,e.dblSharpLine&&(n-=.5));const s=Math.abs(n){const e=new s(0,1);t.getTickables().forEach(t=>{if(t.shouldIgnoreTicks())return;const s=i[e.value()];s?s.push(t):(n.push(e.value()),i[e.value()]=[t]),e.add(t.getTicks())})});const r=new F;e||(e="C");const o=r.createScaleMap(e);n.forEach(t=>{const e=i[t],n=[],s=t=>{t.isRest()||t.shouldIgnoreTicks()||(t.keys.forEach((e,i)=>{const s=r.getNoteParts(e.split("/")[0]),a=s.accidental||"n",c=s.root+a,l=o[s.root]===c,u=n.indexOf(c)>-1;if(!l||l&&u){o[s.root]=c;const e=new W(a);t.addAccidental(i,e),n.push(c)}}),t.getModifiers().forEach(t=>{"gracenotegroups"===t.getCategory()&&t.getGraceNotes().forEach(s)}))};e.forEach(s)})}constructor(t=null){if(super(),this.setAttribute("type","Accidental"),j("New accidental: ",t),this.note=null,this.index=null,this.type=t,this.position=R.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 i.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 f(this.accidental.code,t),this.glyph.setOriginX(1),this.cautionary&&(this.parenLeft=new f(p.accidentalCodes("{").code,t),this.parenRight=new f(p.accidentalCodes("}").code,t),this.parenLeft.setOriginX(1),this.parenRight.setOriginX(1))}getCategory(){return W.CATEGORY}getWidth(){const t=this.cautionary?G(this.parenLeft)+G(this.parenRight)+this.render_options.parenLeftPadding+this.render_options.parenRightPadding:0;return G(this.glyph)+t}setNote(t){if(!t)throw new i.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:e,position:n,note:s,index:r,cautionary:o,x_shift:a,y_shift:c,glyph:l,parenLeft:u,parenRight:h,render_options:{parenLeftPadding:d,parenRightPadding:f}}=this;if(this.checkContext(),!s||null==r)throw new i.RERR("NoAttachedNote","Can't draw accidental without a note and index.");const p=s.getModifierStartXY(n,r);let m=p.x+a;const g=p.y+c;j("Rendering: ",e,m,g),o?(h.render(t,m,g),m-=G(h),m-=f,m-=this.accidental.parenRightPaddingAdjustment,l.render(t,m,g),m-=G(l),m-=d,u.render(t,m,g)):l.render(t,m,g),this.setRendered()}}class $ extends R{static get CATEGORY(){return"notesubgroup"}static format(t,e){if(!t||0===t.length)return!1;let n=0;for(let i=0;i{t.ignore_ticks=!1}),this.width=0,this.preFormatted=!1,this.formatter=new ht,this.voice=new M({num_beats:4,beat_value:4,resolution:p.RESOLUTION}).setStrict(!1),this.voice.addTickables(this.subNotes),this}getCategory(){return $.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 i.RuntimeError("NoAttachedNote","Can't draw notes without a parent note and parent note index.");this.setRendered(),this.alignSubNotesWithNote(this.subNotes,t),this.subNotes.forEach(t=>t.setContext(this.context).drawWithStyle())}}class z extends c{constructor(t,e){super(),this.setAttribute("type","StaveTie"),this.notes=t,this.context=null,this.text=e,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 i.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 i.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 i.RERR("BadArguments","No Y-values to render");const e=this.context;let n=this.render_options.cp1,s=this.render_options.cp2;Math.abs(t.last_x_px-t.first_x_px)<10&&(n=2,s=8);const r=this.render_options.first_x_shift,o=this.render_options.last_x_shift,a=this.render_options.y_shift*t.direction;for(let c=0;c1){const e=new C(t);e.render_options.beam_width=3,e.render_options.partial_beam_length=4,this.beams.push(e)}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(...t){U.DEBUG&&i.L("Vex.Flow.GraceNoteGroup",t)}("Drawing grace note group for:",t),!t||null===this.index)throw new i.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(t=>{t.setContext(this.context).draw()}),this.beams.forEach(t=>{t.setContext(this.context).draw()}),this.show_slur){const e=this.getNote().getCategory()===V.CATEGORY,n=e?z:H;this.slur=new n({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=(e?7:5)+this.render_options.slur_y_shift,this.slur.setContext(this.context).draw()}}}class Y extends R{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,e){const n=e.left_shift;if(!t||0===t.length)return this;const i=t.map(t=>{const e=t.getNote();if(e instanceof V){const{line:n,displaced:i}=e.getKeyProps()[t.getIndex()];return{line:n,shift:i?e.getExtraLeftPx():0,stroke:t}}{const{str:n}=e.getPositions()[t.getIndex()];return{line:n,shift:0,stroke:t}}}),s=n,r=i.reduce((t,{stroke:e,shift:n})=>(e.setXShift(s+n),Math.max(e.getWidth()+0,t)),0);return e.left_shift+=r,!0}constructor(t,e){super(),this.setAttribute("type","Stroke"),this.note=null,this.options=i.Merge({},e),this.all_voices=!("all_voices"in this.options)||this.options.all_voices,this.note_end=null,this.index=null,this.type=t,this.position=R.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 Y.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 i.RERR("NoAttachedNote","Can't draw stroke without a note and index.");const t=this.note.getModifierStartXY(this.position,this.index);let e=this.note.getYs(),n=t.y,s=t.y;const r=t.x-5,o=this.note.stave.options.spacing_between_lines_px,a=this.getModifierContext().getModifiers(this.note.getCategory());for(let f=0;fe.line-t.line);let f=0,p=0,m=0,g=0,b=null,v=null;for(r=0;rm?t:m):c===R.Position.RIGHT&&(o.setXShift(p),t+=d,g=t>g?t:g),b=e,v=a}return e.left_shift+=m,e.right_shift+=g,!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=R.Position.ABOVE,this.x_shift=0,this.y_shift=0,this.x_offset=0,this.y_offset=0,this.dashed=!0,this.leg=S.LineEndType.NONE,this.radius=8,this.font={family:"sans-serif",size:10,weight:"bold"}}getCategory(){return X.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>=S.LineEndType.NONE&&t<=S.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 i.RERR("NoAttachedNote","Can't draw string number without a note and index.");this.setRendered();const e=this.note.stave.options.spacing_between_lines_px,n=this.note.getModifierStartXY(this.position,this.index);let s=n.x+this.x_shift+this.x_offset,r=n.y+this.y_shift+this.y_offset;switch(this.position){case R.Position.ABOVE:case R.Position.BELOW:{const t=this.note.getStemExtents();let i=t.topY,s=t.baseY+2;this.note.stem_direction===V.STEM_DOWN&&(i=t.baseY,s=t.topY-2),r=this.position===R.Position.ABOVE?this.note.hasStem()?i-1.75*e:n.y-1.75*e:this.note.hasStem()?s+1.5*e:n.y+1.75*e,r+=this.y_shift+this.y_offset;break}case R.Position.LEFT:s-=this.radius/2+5;break;case R.Position.RIGHT:s+=this.radius/2+6;break;default:throw new i.RERR("InvalidPosition",`The position ${this.position} is invalid`)}t.save(),t.beginPath(),t.arc(s,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 o=s-t.measureText(this.string_number).width/2;if(t.fillText(""+this.string_number,o,r+4.5),null!=this.last_note){const e=this.last_note.getStemX()-this.note.getX()+5;let n,i;switch(t.strokeStyle="#000000",t.lineCap="round",t.lineWidth=.6,this.dashed?S.drawDashedLine(t,s+10,r,s+e,r,[3,3]):S.drawDashedLine(t,s+10,r,s+e,r,[3,0]),this.leg){case S.LineEndType.UP:n=-10,i=this.dashed?[3,3]:[3,0],S.drawDashedLine(t,s+e,r,s+e,r+n,i);break;case S.LineEndType.DOWN:n=10,i=this.dashed?[3,3]:[3,0],S.drawDashedLine(t,s+e,r,s+e,r+n,i)}}t.restore()}}const{ABOVE:K,BELOW:q}=R.Position,Z=(t,e)=>.5*t(e/.5),J=(t,e)=>e===K?t<=5:t>=1,Q=(t,e)=>J(t,e)?e===K?Math.ceil:Math.floor:Math.round,tt=t=>{const e=t.getCategory();return"stavenotes"===e||"gracenotes"===e};class et extends R{static get CATEGORY(){return"articulations"}static get INITIAL_OFFSET(){return-.5}static format(t,e){if(!t||0===t.length)return!1;const n=(t,e,n)=>Z(Q(e,n),t.glyph.getMetrics().height/10+.5);t.filter(t=>t.getPosition()===K).forEach(t=>{t.setTextLine(e.top_text_line),e.top_text_line+=n(t,e.top_text_line,K)}),t.filter(t=>t.getPosition()===q).forEach(t=>{t.setTextLine(e.text_line),e.text_line+=n(t,e.text_line,q)});const i=t.map(t=>t.getWidth()).reduce((t,e)=>Math.max(e,t));return e.left_shift+=i/2,e.right_shift+=i/2,!0}static easyScoreHook({articulations:t},e,n){if(!t)return;const i={staccato:"a.",tenuto:"a-"};t.split(",").map(t=>t.trim().split(".")).map(([t,e])=>{const s={type:i[t]};return e&&(s.position=R.PositionString[e]),n.getFactory().Articulation(s)}).map(t=>e.addModifier(0,t))}constructor(t){if(super(),this.setAttribute("type","Articulation"),this.note=null,this.index=null,this.type=t,this.position=q,this.render_options={font_scale:38},this.articulation=p.articulationCodes(this.type),!this.articulation)throw new i.RERR("ArgumentError","Articulation not found: "+this.type);this.glyph=new f(this.articulation.code,this.render_options.font_scale),this.setWidth(this.glyph.getMetrics().width)}getCategory(){return et.CATEGORY}draw(){const{note:t,index:e,position:n,glyph:s,articulation:{between_lines:r},text_line:o,context:a}=this;if(this.checkContext(),!t||null==e)throw new i.RERR("NoAttachedNote","Can't draw Articulation without a note and index.");this.setRendered();const c=t.getStave(),l=c.getSpacingBetweenLines(),u="tabnotes"===t.getCategory(),{x:h}=t.getModifierStartXY(n,e),d=!r||u,f=((t,e)=>{const n=e===K&&t.getStemDirection()===x.UP||e===q&&t.getStemDirection()===x.DOWN;return tt(t)?t.hasStem()&&n?.5:1:t.hasStem()&&n?1:0})(t,n);let p={[K]:()=>{s.setOrigin(.5,1);const e=((t,e)=>{const n=t.getStave(),s=t.getStemDirection(),{topY:r,baseY:o}=t.getStemExtents();if(tt(t))return t.hasStem()?s===x.UP?r:o:Math.min(...t.getYs());if("tabnotes"===t.getCategory())return t.hasStem()&&s===x.UP?r:n.getYForTopText(e);throw new i.RERR("UnknownCategory","Only can get the top and bottom ys of stavenotes and tabnotes")})(t,o)-(o+f)*l;return d?Math.min(c.getYForTopText(et.INITIAL_OFFSET),e):e},[q]:()=>{s.setOrigin(.5,0);const e=((t,e)=>{const n=t.getStave(),s=t.getStemDirection(),{topY:r,baseY:o}=t.getStemExtents();if(tt(t))return t.hasStem()?s===x.UP?o:r:Math.max(...t.getYs());if("tabnotes"===t.getCategory())return t.hasStem()?s===x.UP?n.getYForBottomText(e):r:n.getYForBottomText(e);throw new i.RERR("UnknownCategory","Only can get the top and bottom ys of stavenotes and tabnotes")})(t,o)+(o+f)*l;return d?Math.max(c.getYForBottomText(et.INITIAL_OFFSET),e):e}}[n]();if(!u){const i=n===K?-1:1,o=u?t.positions[e].str:t.getKeyProps()[e].line,a=(t.getYs()[e]-p)/l+o,c=((t,e,n,i)=>{const s=Z(Q(e,n),e);return t&&J(s,n)&&s%1==0?s+.5*-i:s})(r,a,n,i);J(c,n)&&s.setOrigin(.5,.5),p+=Math.abs(c-a)*l*i}!function(...t){et.DEBUG&&i.L("Vex.Flow.Articulation",t)}(`Rendering articulation at (x: ${h}, y: ${p})`),s.render(a,h,p)}}class nt extends I{static getNextContext(t){const e=t.tContexts,n=e.indexOf(t);return e[n+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:e,extraLeftPx:n,extraRightPx:i}=this;return{width:t,notePx:e,extraLeftPx:n,extraRightPx:i}}getCurrentTick(){return this.currentTick}setCurrentTick(t){this.currentTick=t,this.preFormatted=!1}getExtraPx(){let t=0,e=0,n=0,i=0;for(let s=0;s0&&i--;for(let a=0;a{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 lt(t,e,n,s){let r=e;for(n+=1;n{if(!e.getTotalTicks().equals(r))throw new i.RERR("TickMismatch","Voices should have same total note duration in ticks.");if(e.getMode()===M.Mode.STRICT&&!e.isComplete())throw new i.RERR("IncompleteVoice","Voice does not have enough notes.");return Math.max(t,s.LCM(t,e.getResolutionMultiplier()))},1),a={},c=[],l=[];return t.forEach(t=>{const i=new s(0,o);t.getTickables().forEach(t=>{const s=i.numerator;if(!a[s]){const t=new e;l.push(t),a[s]=t}n(t,a[s]),c.push(s),i.add(t.getTicks())})}),{map:a,array:l,list:i.SortAndUnique(c,(t,e)=>t-e,(t,e)=>t===e),resolutionMultiplier:o}}class ht{static SimpleFormat(t,e=0,{paddingBetween:n=10}={}){t.reduce((t,e)=>{e.addToModifierContext(new ct);const i=(new nt).addTickable(e).preFormat(),s=i.getExtraPx();return i.setX(t+s.left),t+i.getWidth()+s.right+n},e)}static plotDebugging(t,e,n,i,s){const r=n+L.STAVEPADDING,o=e.contextGaps;t.save(),t.setFont("Arial",8,""),o.gaps.forEach(e=>{var n,o,a;n=r+e.x1,o=r+e.x2,a="#aaa",t.beginPath(),t.setStrokeStyle(a),t.setFillStyle(a),t.setLineWidth(1),t.fillRect(n,i,o-n,s-i),t.fillText(Math.round(e.x2-e.x1),r+e.x1,s+12)}),t.fillText(Math.round(o.total)+"px",r-20,s+12),t.setFillStyle("red"),t.fillText("Loss: "+e.lossHistory.map(t=>Math.round(t)),r-20,s+22),t.restore()}static FormatAndDraw(t,e,n,s){const r={auto_beam:!1,align_rests:!1};"object"==typeof s?i.Merge(r,s):"boolean"==typeof s&&(r.auto_beam=s);const o=new M(p.TIME4_4).setMode(M.Mode.SOFT).addTickables(n),a=r.auto_beam?C.applyAndGetBeams(o):[];return(new ht).joinVoices([o],{align_rests:r.align_rests}).formatToStave([o],e,{align_rests:r.align_rests,stave:e}),o.setStave(e).draw(t,e),a.forEach(e=>e.setContext(t).draw()),o.getBoundingBox()}static FormatAndDrawTab(t,e,n,s,r,o,a){const c={auto_beam:o,align_rests:!1};"object"==typeof a?i.Merge(c,a):"boolean"==typeof a&&(c.auto_beam=a);const l=new M(p.TIME4_4).setMode(M.Mode.SOFT).addTickables(r),u=new M(p.TIME4_4).setMode(M.Mode.SOFT).addTickables(s),h=c.auto_beam?C.applyAndGetBeams(l):[];(new ht).joinVoices([l],{align_rests:c.align_rests}).joinVoices([u]).formatToStave([l,u],n,{align_rests:c.align_rests}),l.draw(t,n),u.draw(t,e),h.forEach(e=>e.setContext(t).draw()),new A(n,e).setContext(t).draw()}static AlignRestsToNotes(t,e,n){return t.forEach((i,s)=>{if(i instanceof V&&i.isRest()){if(i.tuplet&&!n)return;const r=i.getGlyph().position.toUpperCase();if("R/4"!==r&&"B/4"!==r)return;if(e||null!=i.beam){const e=i.getKeyProps()[0];if(0===s)e.line=lt(t,e.line,s,!1),i.setKeyLine(0,e.line);else if(s>0&&sht.AlignRestsToNotes(t.getTickables(),e))}preCalculateMinTotalWidth(t){if(this.hasMinTotalWidth)return this.minTotalWidth;if(!this.tickContexts){if(!t)throw new i.RERR("BadArgument","'voices' required to run preCalculateMinTotalWidth");this.createTickContexts(t)}const{list:e,map:n}=this.tickContexts;return this.minTotalWidth=e.map(t=>{const e=n[t];return e.preFormat(),e.getWidth()}).reduce((t,e)=>t+e,0),this.hasMinTotalWidth=!0,this.minTotalWidth}getMinTotalWidth(){if(!this.hasMinTotalWidth)throw new i.RERR("NoMinTotalWidth","Call 'preCalculateMinTotalWidth' or 'preFormat' before calling 'getMinTotalWidth'");return this.minTotalWidth}createModifierContexts(t){const e=ut(t,ct,(t,e)=>t.addToModifierContext(e));return this.modiferContexts=e,e}createTickContexts(t){const e=ut(t,nt,(t,e)=>e.addTickable(t));return e.array.forEach(t=>{t.tContexts=e.array}),this.totalTicks=t[0].getTicksUsed().clone(),this.tickContexts=e,e}preFormat(t=0,e,n,i){const s=this.tickContexts,{list:r,map:o,resolutionMultiplier:a}=s;n&&i&&n.forEach(t=>t.setStave(i).preFormat());let c=0,l=0;const u=t/2;if(this.minTotalWidth=0,r.forEach(t=>{const n=o[t];e&&n.setContext(e),n.preFormat();const i=n.getWidth();this.minTotalWidth+=i;const s=n.getMetrics();c=c+l+s.extraLeftPx,n.setX(c),l=i-s.extraLeftPx}),this.minTotalWidth=c+l,this.hasMinTotalWidth=!0,t<=0)return;const h=(t-this.minTotalWidth)/(this.totalTicks.value()*a);let d=0;r.forEach((t,e)=>{const n=r[e-1]||0,i=o[t];d+=(t-n)*h,i.setX(i.getX()+d),i.getCenterAlignedTickables().forEach(t=>{t.center_x_shift=u-i.getX()})}),1!==r.length&&(this.justifyWidth=t,this.lossHistory=[],this.evaluate())}evaluate(){const t=this.justifyWidth;this.contextGaps={total:0,gaps:[]},this.tickContexts.list.forEach((t,e)=>{if(0===e)return;const n=this.tickContexts.list[e-1],i=this.tickContexts.map[n],s=this.tickContexts.map[t],r=i.getMetrics(),o=i.getX()+r.width,a=s.getX(),c=a-o;this.contextGaps.total+=c,this.contextGaps.gaps.push({x1:o,x2:a}),s.getFormatterMetrics().freedom.left=c,i.getFormatterMetrics().freedom.right=c});const e=this.durationStats={};this.voices.forEach(n=>{n.getTickables().forEach((n,i,s)=>{const r=n.getTicks().clone().simplify().toString(),o=n.getMetrics(),a=n.getFormatterMetrics(),c=n.getX()+o.noteWidth+o.modRightPx+o.extraRightPx;let l=0;if(i{t.getTickables().forEach(t=>{const i=t.getTicks().clone().simplify().toString(),s=t.getFormatterMetrics();s.iterations+=1,s.space.deviation=s.space.used-e[i].mean,s.duration=i,s.space.mean=e[i].mean,n+=Math.pow(e[i].mean,2)})}),this.totalCost=Math.sqrt(n),this.lossHistory.push(this.totalCost),this}tune(){let t=0;return this.tickContexts.list.forEach((e,n,i)=>{const s=this.tickContexts.map[e],r=n>0?this.tickContexts.map[i[n-1]]:null,o=nt.getFormatterMetrics().space.deviation).reduce((t,e)=>t+e);a>0?t=-Math.min(s.getFormatterMetrics().freedom.right,Math.abs(a)):a<0&&(t=o?Math.min(o.getFormatterMetrics().freedom.right,Math.abs(a)):0);const c=Math.min(5,Math.abs(t));t=t>0?c:-c}),this.evaluate()}postFormat(){const t=t=>t.list.forEach(e=>t.map[e].postFormat());return t(this.modiferContexts),t(this.tickContexts),this}joinVoices(t){return this.createModifierContexts(t),this.hasMinTotalWidth=!1,this}format(t,e,n){const s={align_rests:!1,context:null,stave:null};return i.Merge(s,n),this.voices=t,this.alignRests(t,s.align_rests),this.createTickContexts(t),this.preFormat(e,s.context,t,s.stave),s.stave&&this.postFormat(),this}formatToStave(t,e,n){const s=e.getNoteEndX()-e.getNoteStartX()-10;!function(...t){ht.DEBUG&&i.L("Vex.Flow.Formatter",t)}("Formatting voices to width: ",s);const r={context:e.getContext()};return i.Merge(r,n),this.format(t,s,r)}}class dt extends c{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=dt.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,e,n){t.setYShift(e.getYForLine(n)-e.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 ft extends dt{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}}static get typeString(){return{single:ft.type.SINGLE,double:ft.type.DOUBLE,end:ft.type.END,repeatBegin:ft.type.REPEAT_BEGIN,repeatEnd:ft.type.REPEAT_END,repeatBoth:ft.type.REPEAT_BOTH,none:ft.type.NONE}}constructor(t){super(),this.setAttribute("type","Barline"),this.thickness=p.STAVE_LINE_THICKNESS;const e=ft.type;this.widths={},this.widths[e.SINGLE]=5,this.widths[e.DOUBLE]=5,this.widths[e.END]=5,this.widths[e.REPEAT_BEGIN]=5,this.widths[e.REPEAT_END]=5,this.widths[e.REPEAT_BOTH]=5,this.widths[e.NONE]=5,this.paddings={},this.paddings[e.SINGLE]=0,this.paddings[e.DOUBLE]=0,this.paddings[e.END]=0,this.paddings[e.REPEAT_BEGIN]=15,this.paddings[e.REPEAT_END]=15,this.paddings[e.REPEAT_BOTH]=15,this.paddings[e.NONE]=0,this.layoutMetricsMap={},this.layoutMetricsMap[e.SINGLE]={xMin:0,xMax:1,paddingLeft:5,paddingRight:5},this.layoutMetricsMap[e.DOUBLE]={xMin:-3,xMax:1,paddingLeft:5,paddingRight:5},this.layoutMetricsMap[e.END]={xMin:-5,xMax:1,paddingLeft:5,paddingRight:5},this.layoutMetricsMap[e.REPEAT_END]={xMin:-10,xMax:1,paddingLeft:5,paddingRight:5},this.layoutMetricsMap[e.REPEAT_BEGIN]={xMin:-2,xMax:10,paddingLeft:5,paddingRight:5},this.layoutMetricsMap[e.REPEAT_BOTH]={xMin:-10,xMax:10,paddingLeft:5,paddingRight:5},this.layoutMetricsMap[e.NONE]={xMin:0,xMax:0,paddingLeft:5,paddingRight:5},this.setPosition(dt.Position.BEGIN),this.setType(t)}getCategory(){return ft.CATEGORY}getType(){return this.type}setType(t){return this.type="string"==typeof t?ft.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 ft.type.SINGLE:this.drawVerticalBar(t,this.x,!1);break;case ft.type.DOUBLE:this.drawVerticalBar(t,this.x,!0);break;case ft.type.END:this.drawVerticalEndBar(t,this.x);break;case ft.type.REPEAT_BEGIN:this.drawRepeatBar(t,this.x,!0),t.getX()!==this.x&&this.drawVerticalBar(t,t.getX());break;case ft.type.REPEAT_END:this.drawRepeatBar(t,this.x,!1);break;case ft.type.REPEAT_BOTH:this.drawRepeatBar(t,this.x,!1),this.drawRepeatBar(t,this.x,!0)}}drawVerticalBar(t,e,n){t.checkContext();const i=t.getTopLineTopY(),s=t.getBottomLineBottomY();n&&t.context.fillRect(e-3,i,1,s-i),t.context.fillRect(e,i,1,s-i)}drawVerticalEndBar(t,e){t.checkContext();const n=t.getTopLineTopY(),i=t.getBottomLineBottomY();t.context.fillRect(e-5,n,1,i-n),t.context.fillRect(e-2,n,3,i-n)}drawRepeatBar(t,e,n){t.checkContext();const i=t.getTopLineTopY(),s=t.getBottomLineBottomY();let r=3;n||(r=-5),t.context.fillRect(e+r,i,1,s-i),t.context.fillRect(e-2,i,3,s-i),n?r+=4:r-=4;const o=e+r+1;let a=(t.getNumLines()-1)*t.getSpacingBetweenLines();a=a/2-t.getSpacingBetweenLines()/2;let c=i+a+1;t.context.beginPath(),t.context.arc(o,c,2,0,2*Math.PI,!1),t.context.fill(),c+=t.getSpacingBetweenLines(),t.context.beginPath(),t.context.arc(o,c,2,0,2*Math.PI,!1),t.context.fill()}}class pt extends dt{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}}constructor(t,e,n){super(),this.setAttribute("type","Repetition"),this.symbol_type=t,this.x=e,this.x_shift=0,this.y_shift=n,this.font={family:"times",size:12,weight:"bold italic"}}getCategory(){return pt.CATEGORY}setShiftX(t){return this.x_shift=t,this}setShiftY(t){return this.y_shift=t,this}draw(t,e){switch(this.setRendered(),this.symbol_type){case pt.type.CODA_RIGHT:this.drawCodaFixed(t,e+t.width);break;case pt.type.CODA_LEFT:this.drawSymbolText(t,e,"Coda",!0);break;case pt.type.SEGNO_LEFT:this.drawSignoFixed(t,e);break;case pt.type.SEGNO_RIGHT:this.drawSignoFixed(t,e+t.width);break;case pt.type.DC:this.drawSymbolText(t,e,"D.C.",!1);break;case pt.type.DC_AL_CODA:this.drawSymbolText(t,e,"D.C. al",!0);break;case pt.type.DC_AL_FINE:this.drawSymbolText(t,e,"D.C. al Fine",!1);break;case pt.type.DS:this.drawSymbolText(t,e,"D.S.",!1);break;case pt.type.DS_AL_CODA:this.drawSymbolText(t,e,"D.S. al",!0);break;case pt.type.DS_AL_FINE:this.drawSymbolText(t,e,"D.S. al Fine",!1);break;case pt.type.FINE:this.drawSymbolText(t,e,"Fine",!1)}return this}drawCodaFixed(t,e){const n=t.getYForTopText(t.options.num_lines)+this.y_shift;return f.renderGlyph(t.context,this.x+e+this.x_shift,n+25,40,"v4d",!0),this}drawSignoFixed(t,e){const n=t.getYForTopText(t.options.num_lines)+this.y_shift;return f.renderGlyph(t.context,this.x+e+this.x_shift,n+25,30,"v8c",!0),this}drawSymbolText(t,e,n,i){const s=t.checkContext();s.save(),s.setFont(this.font.family,this.font.size,this.font.weight);let r=0+this.x_shift,o=e+this.x_shift;this.symbol_type===pt.type.CODA_LEFT?(r=this.x+t.options.vertical_bar_width,o=r+s.measureText(n).width+12):(o=this.x+e+t.width-5+this.x_shift,r=o-+s.measureText(n).width-12);const a=t.getYForTopText(t.options.num_lines)+this.y_shift;return i&&f.renderGlyph(s,o,a,40,"v4d",!0),s.fillText(n,r,a+5),s.restore(),this}}class mt extends dt{static get CATEGORY(){return"stavesection"}constructor(t,e,n){super(),this.setAttribute("type","StaveSection"),this.setWidth(16),this.section=t,this.x=e,this.shift_x=0,this.shift_y=n,this.font={family:"sans-serif",size:12,weight:"bold"}}getCategory(){return mt.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,e){const n=t.checkContext();this.setRendered(),n.save(),n.lineWidth=2,n.setFont(this.font.family,this.font.size,this.font.weight);const i=n.measureText(""+this.section).width;let s=i+6;s<18&&(s=18);const r=t.getYForTopText(3)+this.shift_y;let o=this.x+e;return n.beginPath(),n.lineWidth=2,n.rect(o,r,s,20),n.stroke(),o+=(s-i)/2,n.fillText(""+this.section,o,r+16),n.restore(),this}}class gt extends dt{static get CATEGORY(){return"stavetempo"}constructor(t,e,n){super(),this.setAttribute("type","StaveTempo"),this.tempo=t,this.position=R.Position.ABOVE,this.x=e,this.shift_x=10,this.shift_y=n,this.font={family:"times",size:14,weight:"bold"},this.render_options={glyph_font_scale:30}}getCategory(){return gt.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,e){const n=t.checkContext();this.setRendered();const i=this.render_options,s=i.glyph_font_scale/38,r=this.tempo.name,o=this.tempo.duration,a=this.tempo.dots,c=this.tempo.bpm,l=this.font;let u=this.x+this.shift_x+e;const h=t.getYForTopText(1)+this.shift_y;if(n.save(),r&&(n.setFont(l.family,l.size,l.weight),n.fillText(r,u,h),u+=n.measureText(r).width),o&&c){n.setFont(l.family,l.size,"normal"),r&&(u+=n.measureText(" ").width,n.fillText("(",u,h),u+=n.measureText("(").width);const t=p.getGlyphProps(o);if(u+=3*s,f.renderGlyph(n,u,h,i.glyph_font_scale,t.code_head),u+=t.getWidth()*s,t.stem){let e=30;t.beam_count&&(e+=3*(t.beam_count-1)),e*=s;const r=h-e;n.fillRect(u-s,r,s,e),t.flag&&(f.renderGlyph(n,u,r,i.glyph_font_scale,t.code_flag_upstem),a||(u+=6*s))}for(let e=0;e=t.line?n.above:n.below)}this.placeGlyphOnLine(i,this.stave,t.line),this.glyphs.push(i);const r=this.xPositions[this.xPositions.length-1],o=i.getMetrics().width+s;this.xPositions.push(r+o),this.width+=o}cancelKey(t){return this.formatted=!1,this.cancelKeySpec=t,this}convertToCancelAccList(t){const e=p.keySignature(t),n=this.accList.length>0&&e.length>0&&e[0].type!==this.accList[0].type,i=n?e.length:e.length-this.accList.length;if(i<1)return;const s=[];for(let r=0;r0?t[0].type:null;let n;if(this.cancelKeySpec&&(n=this.convertToCancelAccList(this.cancelKeySpec)),this.alterKeySpec&&this.convertToAlterAccList(this.alterKeySpec),this.accList.length>0){const i=(this.position===dt.Position.END?this.stave.endClef:this.stave.clef)||this.stave.clef;n&&this.convertAccLines(i,n.type,n.accList),this.convertAccLines(i,e,t);for(let t=0;t{const e=t.split("/").filter(t=>""!==t);if(2!==e.length)throw new i.RERR("BadTimeSignature",`Invalid time spec: ${t}. Must be in the form "/"`);e.forEach(e=>{if(isNaN(Number(e)))throw new i.RERR("BadTimeSignature",`Invalid time spec: ${t}. Must contain two valid numbers.`)})})(t);const[e,n]=t.split("/").map(t=>t.split(""));return{num:!0,glyph:this.makeTimeSignatureGlyph(e,n)}}makeTimeSignatureGlyph(t,e){const n=new f("v0",this.point);n.topGlyphs=[],n.botGlyphs=[];let i=0;for(let u=0;us?i:s,o=n.getMetrics().x_min;n.getMetrics=()=>({x_min:o,x_max:o+r,width:r});const a=(r-i)/2,c=(r-s)/2,l=this;return n.renderToStave=function(t){let e=t+a;for(let n=0;nn.getWidth()&&(e-=n.getWidth()),e}setRepetitionTypeLeft(t,e){return this.modifiers.push(new pt(t,this.x,e)),this}setRepetitionTypeRight(t,e){return this.modifiers.push(new pt(t,this.x,e)),this}setVoltaType(t,e,n){return this.modifiers.push(new _t(t,e,this.x,n)),this}setSection(t,e){return this.modifiers.push(new mt(t,this.x,e)),this}setTempo(t,e){return this.modifiers.push(new gt(t,this.x,e)),this}setText(t,e,n){return this.modifiers.push(new vt(t,e,n)),this}getHeight(){return this.height}getSpacingBetweenLines(){return this.options.spacing_between_lines_px}getBoundingBox(){return new u(this.x,this.y,this.width,this.getBottomY()-this.y)}getBottomY(){const t=this.options,e=t.spacing_between_lines_px;return this.getYForLine(t.num_lines)+t.space_below_staff_ln*e}getBottomLineY(){return this.getYForLine(this.options.num_lines)}getYForLine(t){const e=this.options,n=e.spacing_between_lines_px,i=e.space_above_staff_ln;return this.y+t*n+i*n}getLineForY(t){const e=this.options,n=e.spacing_between_lines_px,i=e.space_above_staff_ln;return(t-this.y)/n-i}getYForTopText(t){const e=t||0;return this.getYForLine(-e-this.options.top_text_position)}getYForBottomText(t){const e=t||0;return this.getYForLine(this.options.bottom_text_position+e)}getYForNote(t){const e=this.options,n=e.spacing_between_lines_px,i=e.space_above_staff_ln;return this.y+i*n+5*n-t*n}getYForGlyphs(){return this.getYForLine(3)}addModifier(t,e){return void 0!==e&&t.setPosition(e),t.setStave(this),this.formatted=!1,this.modifiers.push(t),this}addEndModifier(t){return this.addModifier(t,dt.Position.END),this}setBegBarType(t){const{SINGLE:e,REPEAT_BEGIN:n,NONE:i}=ft.type;return t!==e&&t!==n&&t!==i||(this.modifiers[0].setType(t),this.formatted=!1),this}setEndBarType(t){return t!==ft.type.REPEAT_BEGIN&&(this.modifiers[1].setType(t),this.formatted=!1),this}setClef(t,e,n,i){void 0===i&&(i=dt.Position.BEGIN),i===dt.Position.END?this.endClef=t:this.clef=t;const s=this.getModifiers(i,yt.CATEGORY);return 0===s.length?this.addClef(t,e,n,i):s[0].setType(t,e,n),this}setEndClef(t,e,n){return this.setClef(t,e,n,dt.Position.END),this}setKeySignature(t,e,n){void 0===n&&(n=dt.Position.BEGIN);const i=this.getModifiers(n,St.CATEGORY);return 0===i.length?this.addKeySignature(t,e,n):i[0].setKeySig(t,e),this}setEndKeySignature(t,e){return this.setKeySignature(t,e,dt.Position.END),this}setTimeSignature(t,e,n){void 0===n&&(n=dt.Position.BEGIN);const i=this.getModifiers(n,xt.CATEGORY);return 0===i.length?this.addTimeSignature(t,e,n):i[0].setTimeSig(t),this}setEndTimeSignature(t,e){return this.setTimeSignature(t,e,dt.Position.END),this}addKeySignature(t,e,n){return void 0===n&&(n=dt.Position.BEGIN),this.addModifier(new St(t,e).setPosition(n),n),this}addClef(t,e,n,i){return void 0===i||i===dt.Position.BEGIN?this.clef=t:i===dt.Position.END&&(this.endClef=t),this.addModifier(new yt(t,e,n),i),this}addEndClef(t,e,n){return this.addClef(t,e,n,dt.Position.END),this}addTimeSignature(t,e,n){return this.addModifier(new xt(t,e),n),this}addEndTimeSignature(t,e){return this.addTimeSignature(t,e,dt.Position.END),this}addTrebleGlyph(){return this.addClef("treble"),this}getModifiers(t,e){return void 0===t&&void 0===e?this.modifiers:this.modifiers.filter(n=>!(void 0!==t&&t!==n.getPosition()||void 0!==e&&e!==n.getCategory()))}sortByCategory(t,e){for(let n=t.length-1;n>=0;n--)for(let i=0;ie[t[i+1].getCategory()]){const e=t[i];t[i]=t[i+1],t[i+1]=e}}format(){const t=this.modifiers[0],e=this.modifiers[1],n=this.getModifiers(dt.Position.BEGIN),i=this.getModifiers(dt.Position.END);let s,r,o;this.sortByCategory(n,{barlines:0,clefs:1,keysignatures:2,timesignatures:3}),this.sortByCategory(i,{timesignatures:0,keysignatures:1,barlines:2,clefs:3}),n.length>1&&t.getType()===ft.type.REPEAT_BEGIN&&(n.push(n.splice(0,1)[0]),n.splice(0,0,new ft(ft.type.SINGLE))),i.indexOf(e)>0&&i.splice(0,0,new ft(ft.type.NONE));let a=0,c=this.x;for(let h=0;h0){this.context.save(),this.context.setFont(this.font.family,this.font.size,this.font.weight);const t=this.context.measureText(""+this.measure).width;i=this.getYForTopText(0)+3,this.context.fillText(""+this.measure,this.x-t/2,i),this.context.restore()}return this}drawVertical(t,e){this.drawVerticalFixed(this.x+t,e)}drawVerticalFixed(t,e){this.checkContext();const n=this.getYForLine(0),i=this.getYForLine(this.options.num_lines-1);e&&this.context.fillRect(t-3,n,1,i-n+1),this.context.fillRect(t,n,1,i-n+1)}drawVerticalBar(t){this.drawVerticalBarFixed(this.x+t,!1)}drawVerticalBarFixed(t){this.checkContext();const e=this.getYForLine(0),n=this.getYForLine(this.options.num_lines-1);this.context.fillRect(t,e,1,n-e+1)}getConfigForLines(){return this.options.line_config}setConfigForLine(t,e){if(t>=this.options.num_lines||t<0)throw new i.RERR("StaveConfigError","The line number must be within the range of the number of lines in the Stave.");if(void 0===e.visible)throw new i.RERR("StaveConfigError","The line configuration object is missing the 'visible' property.");if("boolean"!=typeof e.visible)throw new i.RERR("StaveConfigError","The line configuration objects 'visible' property must be true or false.");return this.options.line_config[t]=e,this}setConfigForLines(t){if(t.length!==this.options.num_lines)throw new i.RERR("StaveConfigError","The length of the lines configuration array must match the number of lines in the Stave");for(const e in t)t[e]||(t[e]=this.options.line_config[e]),i.Merge(this.options.line_config[e],t[e]);return this.options.line_config=t,this}}class Et extends wt{constructor(t,e,n,s){const r={spacing_between_lines_px:13,num_lines:6,top_text_position:1};i.Merge(r,s),super(t,e,n,r),this.setAttribute("type","TabStave")}getYForGlyphs(){return this.getYForLine(2.5)}addTabGlyph(){return this.addClef("tab"),this}}class Tt extends k{static get CATEGORY(){return"tabnotes"}constructor(t,e){if(super(t),this.setAttribute("type","TabNote"),this.ghost=!1,this.positions=t.positions,i.Merge(this.render_options,{glyph_font_scale:p.DEFAULT_TABLATURE_FONT_SCALE,draw_stem:e,draw_dots:e,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 i.RuntimeError("BadArguments","Invalid note initialization data (No glyph found): "+JSON.stringify(t));this.buildStem(),t.stem_direction?this.setStemDirection(t.stem_direction):this.setStemDirection(x.UP),this.ghost=!1,this.updateWidth()}reset(){this.stave&&this.setStave(this.stave)}getCategory(){return Tt.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 N;return this.dots+=1,this.addModifier(t,0)}updateWidth(){this.glyphs=[],this.width=0;for(let t=0;tthis.width}setStave(t){let e;if(super.setStave(t),this.context=t.context,this.context){const t=this.context;for(this.width=0,e=0;en.width),this.width=Math.max(n.getWidth(),this.width)}this.glyph.getWidth=()=>this.width}const n=this.positions.map(({str:e})=>t.getYForLine(e-1));return this.setYs(n),this.stem&&this.stem.setYBounds(this.getStemY(),this.getStemY()),this}getPositions(){return this.positions}addToModifierContext(t){this.setModifierContext(t);for(let e=0;e{("dots"!==t.getCategory()||this.render_options.draw_dots)&&(t.setContext(this.context),t.drawWithStyle())})}drawStemThrough(){const t=this.getStemX(),e=this.getStemY(),n=this.context,i=this.render_options.draw_stem_through_stave;if(this.render_options.draw_stem&&i){const i=function(t,e,n,i){const s=1!==i,r=-1!==i,o=n.getSpacingBetweenLines(),a=n.getNumLines(),c=[];return e.forEach(e=>{const l=e.indexOf(a)>-1,u=e.indexOf(1)>-1;if(s&&u||r&&l)return;1===e.length&&e.push(e[0]);const h=[];e.forEach((e,s,r)=>{const c=1===e,l=e===a;let u=n.getYForLine(e-1);0!==s||c?s!==r.length-1||l||(u+=o/2-1):u-=o/2-1,h.push(u),1===i&&c?h.push(t-2):-1===i&&l&&h.push(t+2)}),c.push(h.sort((t,e)=>t-e))}),c}(e,function(t,e){const n=[];let i=[];for(let s=1;s<=t;s++)e.indexOf(s)>-1?(n.push(i),i=[]):i.push(s);return i.length>0&&n.push(i),n}(this.stave.getNumLines(),this.positions.map(t=>t.str)),this.getStave(),this.getStemDirection());n.save(),n.setLineWidth(x.WIDTH),i.forEach(e=>{0!==e.length&&(n.beginPath(),n.moveTo(t,e[0]),n.lineTo(t,e[e.length-1]),n.stroke(),n.closePath())}),n.restore()}}drawPositions(){const t=this.context,e=this.getAbsoluteX(),n=this.ys;for(let i=0;iparseInt(i,10)?Ot.SLIDE_DOWN:Ot.SLIDE_UP}this.slide_direction=e,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 i.RERR("BadArguments","No Y-values to render");const e=this.context,n=t.first_x_px,s=t.first_ys,r=t.last_x_px,o=this.slide_direction;if(o!==Ot.SLIDE_UP&&o!==Ot.SLIDE_DOWN)throw new i.RERR("BadSlide","Invalid slide direction");for(let a=0;athis.numStrings)throw new i.RERR("BadArguments",`String number must be between 1 and ${this.numStrings}:${t}`);return this.tuningValues[e-1]}getValueForFret(t,e){const n=this.getValueForString(e),s=parseInt(t,10);if(s<0)throw new i.RERR("BadArguments","Fret number must be 0 or higher: "+t);return n+s}getNoteForFret(t,e){const n=this.getValueForFret(t,e),i=Math.floor(n/12),s=n%12;return p.integerToNote(s)+"/"+i}}class Dt extends c{static get type(){return{CRESC:1,DECRESC:2}}static FormatByTicksAndDraw(t,e,n,s,r,o){const a=e.pixelsPerTick;if(null==a)throw new i.RuntimeError("BadArguments","A valid Formatter must be provide to draw offsets by ticks.");const c=a*o.left_shift_ticks,l=a*o.right_shift_ticks,u={height:o.height,y_shift:o.y_shift,left_shift_px:c,right_shift_px:l};new Dt({first_note:n.first_note,last_note:n.last_note},s).setContext(t).setRenderOptions(u).setPosition(r).draw()}constructor(t,e){super(),this.setAttribute("type","StaveHairpin"),this.notes=t,this.hairpin=e,this.position=R.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!==R.Position.ABOVE&&t!==R.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 i.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 e=this.checkContext();let n=this.render_options.y_shift+20,i=t.first_y;this.position===R.Position.ABOVE&&(n=30-n,i=t.first_y-t.staff_height);const s=this.render_options.left_shift_px,r=this.render_options.right_shift_px;switch(e.beginPath(),this.hairpin){case Dt.type.CRESC:e.moveTo(t.last_x+r,i+n),e.lineTo(t.first_x+s,i+this.render_options.height/2+n),e.lineTo(t.last_x+r,i+this.render_options.height+n);break;case Dt.type.DECRESC:e.moveTo(t.first_x+s,i+n),e.lineTo(t.last_x+r,i+this.render_options.height/2+n),e.lineTo(t.first_x+s,i+this.render_options.height+n)}e.stroke(),e.closePath()}draw(){this.checkContext(),this.setRendered();const t=this.first_note,e=this.last_note,n=t.getModifierStartXY(this.position,0),i=e.getModifierStartXY(this.position,0);return this.renderHairpin({first_x:n.x,last_x:i.x,first_y:t.getStave().y+t.getStave().height,last_y:e.getStave().y+e.getStave().height,staff_height:t.getStave().height}),!0}}class Vt extends c{static get Position(){return{NEAR_HEAD:1,NEAR_TOP:2}}static get PositionString(){return{nearHead:Vt.Position.NEAR_HEAD,nearTop:Vt.Position.NEAR_TOP}}constructor(t,e,n){super(),this.setAttribute("type","Curve"),this.render_options={spacing:2,thickness:2,x_shift:0,y_shift:10,position:Vt.Position.NEAR_HEAD,position_end:Vt.Position.NEAR_HEAD,invert:!1,cps:[{x:0,y:10},{x:0,y:10}]},i.Merge(this.render_options,n),this.setNotes(t,e)}setNotes(t,e){if(!t&&!e)throw new i.RuntimeError("BadArguments","Curve needs to have either first_note or last_note set.");return this.from=t,this.to=e,this}isPartial(){return!this.from||!this.to}renderCurve(t){const e=this.context,n=this.render_options.cps,i=this.render_options.x_shift,s=this.render_options.y_shift*t.direction,r=t.first_x+i,o=t.first_y+s,a=t.last_x-i,c=t.last_y+s,l=this.render_options.thickness,u=(a-r)/(n.length+2);e.beginPath(),e.moveTo(r,o),e.bezierCurveTo(r+u+n[0].x,o+n[0].y*t.direction,a-u+n[1].x,c+n[1].y*t.direction,a,c),e.bezierCurveTo(a-u+n[1].x,c+(n[1].y+l)*t.direction,r+u+n[0].x,o+(n[0].y+l)*t.direction,r,o),e.stroke(),e.closePath(),e.fill()}draw(){this.checkContext(),this.setRendered();const t=this.from,e=this.to;let n,i,s,r,o,a="baseY",c="baseY";function l(t){return"string"==typeof t?Vt.PositionString[t]:t}const u=l(this.render_options.position),h=l(this.render_options.position_end);return u===Vt.Position.NEAR_TOP&&(a="topY",c="topY"),h===Vt.Position.NEAR_HEAD?c="baseY":h===Vt.Position.NEAR_TOP&&(c="topY"),t?(n=t.getTieRightX(),o=t.getStemDirection(),s=t.getStemExtents()[a]):(n=e.getStave().getTieStartX(),s=e.getStemExtents()[a]),e?(i=e.getTieLeftX(),o=e.getStemDirection(),r=e.getStemExtents()[c]):(i=t.getStave().getTieEndX(),r=t.getStemExtents()[c]),this.renderCurve({first_x:n,last_x:i,first_y:s,last_y:r,direction:o*(!0===this.render_options.invert?-1:1)}),!0}}function Bt(...t){Ft.DEBUG&&i.L("Vex.Flow.TextDynamics",t)}class Ft extends L{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=[],i.Merge(this.render_options,{glyph_font_size:40}),Bt("New Dynamics Text: ",this.sequence)}setLine(t){return this.line=t,this}preFormat(){let t=0;return this.sequence.split("").forEach(e=>{const n=Ft.GLYPHS[e];if(!n)throw new i.RERR("Invalid dynamics character: "+e);const s=this.render_options.glyph_font_size,r=new f(n.code,s);this.glyphs.push(r),t+=n.width}),this.setWidth(t),this.preFormatted=!0,this}draw(){this.setRendered();const t=this.getAbsoluteX(),e=this.stave.getYForLine(this.line+-3);Bt("Rendering Dynamics: ",this.sequence);let n=t;this.glyphs.forEach((t,i)=>{const s=this.sequence[i];t.render(this.context,n,e),n+=Ft.GLYPHS[s].width})}}function jt(t,e,n,i,s,r,o){t.beginPath(),t.moveTo(e,n),t.lineTo(i,s),t.lineTo(r,o),t.lineTo(e,n),t.closePath(),t.fill()}class Gt extends c{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:Gt.TextVerticalPosition.TOP,text_justification:Gt.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 i.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 i.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(),e=this.render_options;e.line_dash&&t.setLineDash(e.line_dash),e.line_width&&t.setLineWidth(e.line_width),e.rounded_end?t.setLineCap("round"):t.setLineCap("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 e=this.first_note,n=this.last_note,i=this.render_options;let s,r;t.save(),this.applyLineStyle(),this.first_indices.forEach((o,a)=>{const c=this.last_indices[a];s=e.getModifierStartXY(2,o),r=n.getModifierStartXY(1,c);const l=s.y>r.y;s.x+=e.getMetrics().modRightPx+i.padding_left,r.x-=n.getMetrics().modLeftPx+i.padding_right;const u=e.getGlyph().getWidth();e.getKeyProps()[o].displaced&&1===e.getStemDirection()&&(s.x+=u+i.padding_left),n.getKeyProps()[c].displaced&&-1===n.getStemDirection()&&(r.x-=u+i.padding_right),s.y+=l?-3:1,r.y+=l?2:0,function(t,e,n,i){const s=i.draw_start_arrow&&i.draw_end_arrow,r=e.x,o=e.y,a=n.x,c=n.y,l=Math.sqrt((a-r)*(a-r)+(c-o)*(c-o)),u=(l-i.arrowhead_length/3)/l;let h,d,f,p;i.draw_end_arrow||s?(h=Math.round(r+(a-r)*u),d=Math.round(o+(c-o)*u)):(h=a,d=c),i.draw_start_arrow||s?(f=r+(a-r)*(1-u),p=o+(c-o)*(1-u)):(f=r,p=o),i.color&&(t.setStrokeStyle(i.color),t.setFillStyle(i.color)),t.beginPath(),t.moveTo(f,p),t.lineTo(h,d),t.stroke(),t.closePath();const m=Math.atan2(c-o,a-r),g=Math.abs(i.arrowhead_length/Math.cos(i.arrowhead_angle));let b,v,y,S,x,_;(i.draw_end_arrow||s)&&(b=m+Math.PI+i.arrowhead_angle,y=a+Math.cos(b)*g,S=c+Math.sin(b)*g,v=m+Math.PI-i.arrowhead_angle,x=a+Math.cos(v)*g,_=c+Math.sin(v)*g,jt(t,y,S,a,c,x,_)),(i.draw_start_arrow||s)&&(b=m+i.arrowhead_angle,y=r+Math.cos(b)*g,S=o+Math.sin(b)*g,v=m-i.arrowhead_angle,x=r+Math.cos(v)*g,_=o+Math.sin(v)*g,jt(t,y,S,r,o,x,_))}(t,s,r,this.render_options)}),t.restore();const o=t.measureText(this.text).width,a=i.text_justification;let c,l=0;a===Gt.TextJustification.LEFT?l=s.x:a===Gt.TextJustification.CENTER?l=(r.x-s.x)/2+s.x-o/2:a===Gt.TextJustification.RIGHT&&(l=r.x-o);const u=i.text_position_vertical;return u===Gt.TextVerticalPosition.TOP?c=e.getStave().getYForTopText():u===Gt.TextVerticalPosition.BOTTOM&&(c=e.getStave().getYForBottomText(p.TEXT_HEIGHT_OFFSET_HACK)),t.save(),this.applyFontStyle(),t.fillText(this.text,l,c),t.restore(),this}}function Wt(t,e,n,i,s){const r=$t.GLYPHS[t];new f(r.code,s).render(e,n+r.x_shift,i+r.y_shift)}class $t extends c{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}}static get StylesString(){return{text:$t.Styles.TEXT,bracket:$t.Styles.BRACKET,mixed:$t.Styles.MIXED}}static createSustain(t){return new $t(t)}static createSostenuto(t){const e=new $t(t);return e.setStyle($t.Styles.MIXED),e.setCustomText("Sost. Ped."),e}static createUnaCorda(t){const e=new $t(t);return e.setStyle($t.Styles.TEXT),e.setCustomText("una corda","tre corda"),e}constructor(t){super(),this.setAttribute("type","PedalMarking"),this.notes=t,this.style=$t.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"}}setCustomText(t,e){return this.custom_depress_text=t||"",this.custom_release_text=e||"",this}setStyle(t){if(t<1&&t>3)throw new i.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 e,n,s=!1;const r=this;this.notes.forEach((o,a,c)=>{s=!s;const l=o.getAbsoluteX(),u=o.getStave().getYForBottomText(r.line+3);if(l{e=!e;const r=s.getStave(),o=s.getAbsoluteX(),a=r.getYForBottomText(n.line+3);let c=0;e?n.custom_depress_text?(c=t.measureText(n.custom_depress_text).width,t.fillText(n.custom_depress_text,o-c/2,a)):Wt("pedal_depress",t,o,a,i):n.custom_release_text?(c=t.measureText(n.custom_release_text).width,t.fillText(n.custom_release_text,o-c/2,a)):Wt("pedal_release",t,o,a,i)})}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),function(...t){$t.DEBUG&&i.L("Vex.Flow.PedalMarking",t)}("Rendering Pedal Marking"),this.style===$t.Styles.BRACKET||this.style===$t.Styles.MIXED?(t.setLineWidth(this.render_options.bracket_line_width),this.drawBracketed()):this.style===$t.Styles.TEXT&&this.drawText(),t.restore()}}class zt extends c{static get Positions(){return{TOP:1,BOTTOM:-1}}static get PositionString(){return{top:zt.Positions.TOP,bottom:zt.Positions.BOTTOM}}constructor({start:t,stop:e,text:n="",superscript:i="",position:s=zt.Positions.TOP}){super(),this.setAttribute("type","TextBracket"),this.start=t,this.stop=e,this.text=n,this.superscript=i,this.position="string"==typeof s?zt.PositionString[s]:s,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,e){return this.render_options.dashed=t,e&&(this.render_options.dash=e),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 e=0;switch(this.position){case zt.Positions.TOP:e=this.start.getStave().getYForTopText(this.line);break;case zt.Positions.BOTTOM:e=this.start.getStave().getYForBottomText(this.line+p.TEXT_HEIGHT_OFFSET_HACK);break;default:throw new i.RERR("InvalidPosition",`The position ${this.position} is invalid`)}const n={x:this.start.getAbsoluteX(),y:e},s={x:this.stop.getAbsoluteX(),y:e};!function(...t){zt.DEBUG&&i.L("Vex.Flow.TextBracket",t)}("Rendering TextBracket: start:",n,"stop:",s,"y:",e);const r=this.render_options.bracket_height*this.position;t.save(),this.applyStyle(t),t.fillText(this.text,n.x,n.y);const o=t.measureText(this.text).width,a=t.measureText("M").width,c=n.y-a/2.5;t.setFont(this.font.family,this.font.size/1.4,this.font.weight),t.fillText(this.superscript,n.x+o+1,c);const l=t.measureText(this.superscript).width,u=t.measureText("M").width;let h=n.x,d=c;const f=s.x+this.stop.getGlyph().getWidth();this.position===zt.Positions.TOP?(h+=o+l+5,d-=u/2.7):this.position===zt.Positions.BOTTOM&&(d+=u/2.7,h+=o+2,this.render_options.underline_superscript||(h+=l)),this.render_options.dashed?(S.drawDashedLine(t,h,d,f,d,this.render_options.dash),this.render_options.show_bracket&&S.drawDashedLine(t,f,d+1*this.position,f,d+r,this.render_options.dash)):(t.beginPath(),t.moveTo(h,d),t.lineTo(f,d),this.render_options.show_bracket&&t.lineTo(f,d+r),t.stroke(),t.closePath()),t.restore()}}class Ht extends L{constructor(t=ft.type.SINGLE){super({duration:"b"}),this.setAttribute("type","BarNote"),this.metrics={widths:{}};const e=ft.type;this.metrics.widths={[e.SINGLE]:8,[e.DOUBLE]:12,[e.END]:15,[e.REPEAT_BEGIN]:14,[e.REPEAT_END]:14,[e.REPEAT_BOTH]:18,[e.NONE]:0},this.ignore_ticks=!0,this.setType(t)}getType(){return this.type}setType(t){return this.type="string"==typeof t?ft.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 i.RERR("NoStave","Can't draw without a stave.");!function(...t){Ht.DEBUG&&i.L("Vex.Flow.BarNote",t)}("Rendering bar line at: ",this.getAbsoluteX());const t=new ft(this.type);t.setX(this.getAbsoluteX()),t.draw(this.stave),this.setRendered()}}class Ut extends k{constructor(t){if(!t)throw new i.RuntimeError("BadArguments","Ghost note must have valid initialization data to identify duration.");let e;if("string"==typeof t)e={duration:t};else{if("object"!=typeof t)throw new i.RuntimeError("BadArguments","Ghost note must have valid initialization data to identify duration.");e=t}super(e),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 i.RERR("NoStave","Can't draw without a stave.");this.setRendered();for(let t=0;t0||!0===e;return!e||s>0||(this.pos=i),o?this.matchSuccess():this.matchFail(i),{success:o,results:n,numMatches:s}}expectZeroOrMore(t){return this.expectOneOrMore(t,!0)}expect(t){let e;if(function(...t){Zt.DEBUG&&i.L("Vex.Flow.Parser",t)}("Evaluating rules:",t),!t)throw new Kt("Invalid Rule: "+t,t);const n=t.bind(this.grammar)();if(n.token)e=this.matchToken(n.token,!0===n.noSpace),e.success&&(this.pos+=e.incrementPos);else{if(!n.expect)throw new Kt("Bad grammar! No `token` or `expect` property",n);e=n.oneOrMore?this.expectOneOrMore(n):n.zeroOrMore?this.expectZeroOrMore(n):this.expectOne(n)}return e.matches=[],e.results&&e.results.forEach(t=>e.matches.push(qt(t))),n.run&&e.success&&n.run(e),e}}function Jt(...t){se.DEBUG&&i.L("Vex.Flow.EasyScore",t)}const Qt=i.MakeException("EasyScoreError");class te{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 ee{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(){Jt("resetPiece"),this.piece={chord:[],duration:this.rollingDuration,dots:0,type:void 0,options:{}}}setNoteDots(t){Jt("setNoteDots:",t),t&&(this.piece.dots=t.length)}setNoteDuration(t){Jt("setNoteDuration:",t),this.rollingDuration=this.piece.duration=t||this.rollingDuration}setNoteType(t){Jt("setNoteType:",t),t&&(this.piece.type=t)}addNoteOption(t,e){Jt("addNoteOption: key:",t,"value:",e),this.piece.options[t]=e}addNote(t,e,n){Jt("addNote:",t,e,n),this.piece.chord.push({key:t,accid:e,octave:n})}addSingleNote(t,e,n){Jt("addSingleNote:",t,e,n),this.addNote(t,e,n)}addChord(t){Jt("startChord"),"object"!=typeof t[0]?this.addSingleNote(t[0]):t.forEach(t=>{t&&this.addNote(...t)}),Jt("endChord")}commitPiece(){Jt("commitPiece");const{factory:t}=this;if(!t)return;const e={...this.options,...this.piece.options},{stem:n,clef:i}=e,s="auto"===n.toLowerCase(),r=s||"up"!==n.toLowerCase()?V.STEM_DOWN:V.STEM_UP,{chord:o,duration:a,dots:c,type:l}=this.piece,u=o.map(t=>t.key+"/"+t.octave),h=t.StaveNote({keys:u,duration:a,dots:c,type:l,clef:i,auto_stem:s});s||h.setStemDirection(r);const d=o.map(t=>t.accid||null);d.forEach((e,n)=>{e&&h.addAccidental(n,t.Accidental({type:e}))});for(let f=0;ft(e,h,this)),this.elements.notes.push(h),this.elements.accidentals.concat(d),this.resetPiece()}}function ne({id:t},e){void 0!==t&&e.setAttribute("id",t)}function ie(t,e){t.class&&t.class.split(/\s*,\s*/).forEach(t=>e.addClass(t))}class se{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:[ne,ie,et.easyScoreHook],throwOnError:!1,...t},this.factory=this.options.factory,this.builder=this.options.builder||new ee(this.factory),this.grammar=new te(this.builder),this.parser=new Zt(this.grammar),this.options.commitHooks.forEach(t=>this.addCommitHook(t)),this}setContext(t){return this.factory&&this.factory.setContext(t),this}parse(t,e={}){this.builder.reset(e);const n=this.parser.parse(t);if(!n.success&&this.options.throwOnError)throw new Qt("Error parsing line: "+t,n);return n}beam(t,e={}){return this.factory.Beam({notes:t,options:e}),t}tuplet(t,e={}){return this.factory.Tuplet({notes:t,options:e}),t}notes(t,e={}){return e={clef:this.defaults.clef,stem:this.defaults.stem,...e},this.parse(t,e),this.builder.getElements().notes}voice(t,e){return e={time:this.defaults.time,...e},this.factory.Voice(e).addTickables(t)}addCommitHook(t){return this.builder.addCommitHook(t)}}const re=i.MakeException("FactoryError");function oe(t={},e){const n=e.options;return(t=Object.assign(e,t)).options=Object.assign(n,t.options),t}class ae{constructor(t){!function(...t){ae.DEBUG&&i.L("Vex.Flow.Factory",t)}("New factory: ",t);const e={stave:{space:10},renderer:{context:null,elementId:"",backend:S.Backends.SVG,width:500,height:200,background:"#FFF"},font:{face:"Arial",point:10,style:""}};this.options=e,this.setOptions(t)}static newFromElementId(t,e=500,n=200){return new ae({renderer:{elementId:t,width:e,height:n}})}reset(){this.renderQ=[],this.systems=[],this.staves=[],this.voices=[],this.stave=null}getOptions(){return this.options}setOptions(t){for(const e of["stave","renderer","font"])Object.assign(this.options[e],t[e]);(null!==this.options.renderer.elementId||this.options.renderer.context)&&this.initRenderer(),this.reset()}initRenderer(){const{elementId:t,backend:e,width:n,height:i,background:s}=this.options.renderer;if(""===t)throw new re("HTML DOM element not set in Factory");this.context=S.buildContext(t,e,n,i,s)}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=oe(t,{x:0,y:0,width:this.options.renderer.width-this.space(1),options:{spacing_between_lines_px:this.options.stave.space}});const e=new wt(t.x,t.y,t.width,t.options);return this.staves.push(e),e.setContext(this.context),this.stave=e,e}TabStave(t){t=oe(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 e=new Et(t.x,t.y,t.width,t.options);return this.staves.push(e),e.setContext(this.context),this.stave=e,e}StaveNote(t){const e=new V(t);return this.stave&&e.setStave(this.stave),e.setContext(this.context),this.renderQ.push(e),e}GhostNote(t){const e=new Ut(t);return this.stave&&e.setStave(this.stave),e.setContext(this.context),this.renderQ.push(e),e}TextNote(t){const e=new bt(t);return this.stave&&e.setStave(this.stave),e.setContext(this.context),this.renderQ.push(e),e}BarNote(t){t=oe(t,{type:"single",options:{}});const e=new Ht(t.type);return this.stave&&e.setStave(this.stave),e.setContext(this.context),this.renderQ.push(e),e}ClefNote(t){t=oe(t,{type:"treble",options:{size:"default"}});const e=new At(t.type,t.options.size,t.options.annotation);return this.stave&&e.setStave(this.stave),e.setContext(this.context),this.renderQ.push(e),e}TimeSigNote(t){t=oe(t,{time:"4/4",options:{}});const e=new Lt(t.time);return this.stave&&e.setStave(this.stave),e.setContext(this.context),this.renderQ.push(e),e}KeySigNote(t){const e=new It(t.key,t.cancelKey,t.alterKey);return this.stave&&e.setStave(this.stave),e.setContext(this.context),this.renderQ.push(e),e}TabNote(t){const e=new Tt(t);return this.stave&&e.setStave(this.stave),e.setContext(this.context),this.renderQ.push(e),e}GraceNote(t){const e=new kt(t);return this.stave&&e.setStave(this.stave),e.setContext(this.context),e}GraceNoteGroup(t){const e=new U(t.notes,t.slur);return e.setContext(this.context),e}Accidental(t){t=oe(t,{type:null,options:{}});const e=new W(t.type);return e.setContext(this.context),e}Annotation(t){t=oe(t,{text:"p",vJustify:"below",hJustify:"center",fontFamily:"Times",fontSize:14,fontWeight:"bold italic",options:{}});const e=new st(t.text);return e.setJustification(t.hJustify),e.setVerticalJustification(t.vJustify),e.setFont(t.fontFamily,t.fontSize,t.fontWeight),e.setContext(this.context),e}Articulation(t){t=oe(t,{type:"a.",position:"above",options:{}});const e=new et(t.type);return e.setPosition(t.position),e.setContext(this.context),e}TextDynamics(t){t=oe(t,{text:"p",duration:"q",dots:0,line:0,options:{}});const e=new Ft({text:t.text,line:t.line,duration:t.duration,dots:t.dots});return this.stave&&e.setStave(this.stave),e.setContext(this.context),this.renderQ.push(e),e}Fingering(t){t=oe(t,{number:"0",position:"left",options:{}});const e=new B(t.number);return e.setPosition(t.position),e.setContext(this.context),e}StringNumber(t){t=oe(t,{number:"0",position:"left",options:{}});const e=new X(t.number);return e.setPosition(t.position),e.setContext(this.context),e}TickContext(){return(new nt).setContext(this.context)}ModifierContext(){return new ct}MultiMeasureRest(t){const e=new Pt(t.number_of_measures,t);return e.setContext(this.context),this.renderQ.push(e),e}Voice(t){t=oe(t,{time:"4/4",options:{}});const e=new M(t.time);return this.voices.push(e),e}StaveConnector(t){t=oe(t,{top_stave:null,bottom_stave:null,type:"double",options:{}});const e=new A(t.top_stave,t.bottom_stave);return e.setType(t.type).setContext(this.context),this.renderQ.push(e),e}Formatter(){return new ht}Tuplet(t){t=oe(t,{notes:[],options:{}});const e=new _(t.notes,t.options).setContext(this.context);return this.renderQ.push(e),e}Beam(t){t=oe(t,{notes:[],options:{autoStem:!1,secondaryBeamBreaks:[]}});const e=new C(t.notes,t.options.autoStem).setContext(this.context);return e.breakSecondaryAt(t.options.secondaryBeamBreaks),this.renderQ.push(e),e}Curve(t){t=oe(t,{from:null,to:null,options:{}});const e=new Vt(t.from,t.to,t.options).setContext(this.context);return this.renderQ.push(e),e}StaveTie(t){t=oe(t,{from:null,to:null,first_indices:[0],last_indices:[0],text:null,options:{direction:void 0}});const e=new z({first_note:t.from,last_note:t.to,first_indices:t.first_indices,last_indices:t.last_indices},t.text);return t.options.direction&&e.setDirection(t.options.direction),e.setContext(this.context),this.renderQ.push(e),e}StaveLine(t){t=oe(t,{from:null,to:null,first_indices:[0],last_indices:[0],options:{}});const e=new Gt({first_note:t.from,last_note:t.to,first_indices:t.first_indices,last_indices:t.last_indices});return t.options.text&&e.setText(t.options.text),t.options.font&&e.setFont(t.options.font),e.setContext(this.context),this.renderQ.push(e),e}VibratoBracket(t){t=oe(t,{from:null,to:null,options:{harsh:!1}});const e=new Ct({start:t.from,stop:t.to});return t.options.line&&e.setLine(t.options.line),t.options.harsh&&e.setHarsh(t.options.harsh),e.setContext(this.context),this.renderQ.push(e),e}TextBracket(t){t=oe(t,{from:null,to:null,text:"",options:{superscript:"",position:1}});const e=new zt({start:t.from,stop:t.to,text:t.text,superscript:t.options.superscript,position:t.options.position});return t.options.line&&e.setLine(t.options.line),t.options.font&&e.setFont(t.options.font),e.setContext(this.context),this.renderQ.push(e),e}System(t={}){t.factory=this;const e=new le(t).setContext(this.context);return this.systems.push(e),e}EasyScore(t={}){return t.factory=this,new se(t)}PedalMarking(t={}){t=oe(t,{notes:[],options:{style:"mixed"}});const e=new $t(t.notes);return e.setStyle($t.StylesString[t.options.style]),e.setContext(this.context),this.renderQ.push(e),e}NoteSubGroup(t={}){t=oe(t,{notes:[],options:{}});const e=new $(t.notes);return e.setContext(this.context),e}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 ce(t,e){const n=e.options;return(t=Object.assign(e,t)).options=Object.assign(n,t.options),t}class le extends c{constructor(t={}){super(),this.setAttribute("type","System"),this.setOptions(t),this.parts=[]}setOptions(t={}){this.options=ce(t,{x:10,y:10,width:500,connector:null,spaceBetweenStaves:12,factory:null,debugFormatter:!1,formatIterations:0,options:{}}),this.factory=this.options.factory||new ae({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=ce(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(e=>e.setContext(this.context).setStave(t.stave).getTickables().forEach(e=>e.setStave(t.stave))),this.parts.push(t),t.stave}format(){const t=new ht;this.formatter=t;let e=this.options.y,n=0,i=[];const s=[];this.parts.forEach(r=>{e+=r.stave.space(r.spaceAbove),r.stave.setY(e),t.joinVoices(r.voices),e+=r.stave.space(r.spaceBelow),e+=r.stave.space(this.options.spaceBetweenStaves),r.debugNoteMetrics&&(s.push({y:e,voice:r.voices[0]}),e+=15),i=i.concat(r.voices),n=Math.max(n,r.stave.getNoteStartX())}),this.parts.forEach(t=>t.stave.setNoteStartX(n));const r=this.options.width-(n-this.options.x)-L.STAVEPADDING;t.format(i,r);for(let o=0;o{e.voice.getTickables().forEach(n=>L.plotMetrics(t,n,e.y))})}}(i.Flow=p).Element=c,i.Flow.Fraction=s,i.Flow.Renderer=S,i.Flow.Formatter=ht,i.Flow.Music=F,i.Flow.Glyph=f,i.Flow.Stave=wt,i.Flow.StaveNote=V,i.Flow.StaveModifier=dt,i.Flow.StaveTempo=gt,i.Flow.Voice=M,i.Flow.Accidental=W,i.Flow.Beam=C,i.Flow.StaveTie=z,i.Flow.TabStave=Et,i.Flow.TabNote=Tt,i.Flow.Bend=rt,i.Flow.Vibrato=ot,i.Flow.VibratoBracket=Ct,i.Flow.Note=L,i.Flow.ModifierContext=ct,i.Flow.MultiMeasureRest=Pt,i.Flow.TickContext=nt,i.Flow.Articulation=et,i.Flow.Annotation=st,i.Flow.Barline=ft,i.Flow.NoteHead=O,i.Flow.StaveConnector=A,i.Flow.ClefNote=At,i.Flow.KeySignature=St,i.Flow.KeySigNote=It,i.Flow.TimeSignature=xt,i.Flow.TimeSigNote=Lt,i.Flow.Stem=x,i.Flow.TabTie=H,i.Flow.Clef=yt,i.Flow.Dot=N,i.Flow.Modifier=R,i.Flow.TabSlide=Ot,i.Flow.Tuplet=_,i.Flow.GraceNote=kt,i.Flow.GraceTabNote=Rt,i.Flow.Tuning=Nt,i.Flow.KeyManager=class{constructor(t){this.music=new F,this.setKey(t)}setKey(t){return this.key=t,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),!F.scaleTypes[this.keyParts.type])throw new i.RERR("BadArguments","Unsupported key type: "+this.key);this.scale=this.music.getScaleTones(this.music.getNoteValue(this.keyString),F.scaleTypes[this.keyParts.type]),this.scaleMap={},this.scaleMapByValue={},this.originalScaleMapByValue={};const t=F.root_indices[this.keyParts.root];for(let e=0;e0)return!0;return!1}isStaccato(){for(let t=0,e=this.Articulations.length;t{t===i&&(e=n)}),e}createVoiceEntriesForOrnament(t,e){t||(t=this);const n=[];if(!t.ornamentContainer)return;const s=this.notes[0],r=s.Length,c=t.ParentVoice,l=t.Timestamp;let u=i.Fraction.createFromFraction(l);switch(t.ornamentContainer.GetOrnament){case o.OrnamentEnum.Trill:{const o=new i.Fraction(r.Numerator,8*r.Denominator),h=s.Pitch.getTransposedPitch(1);let d=e.getAlterationForPitch(h);t.OrnamentContainer.AccidentalAbove!==a.AccidentalEnum.NONE&&(d=t.ornamentContainer.AccidentalAbove);for(let t=0;t<8;t++)u=i.Fraction.plus(l,new i.Fraction(t*o.Numerator,o.Denominator)),t%2==0?this.createBaseVoiceEntry(u,o,c,s,n):this.createAlteratedVoiceEntry(u,o,c,s.SourceMeasure,h,d,n);break}case o.OrnamentEnum.Turn:{const t=new i.Fraction(r.Numerator,4*r.Denominator),o=s.Pitch.getTransposedPitch(-1),a=e.getAlterationForPitch(o),l=s.Pitch.getTransposedPitch(1),h=e.getAlterationForPitch(l);this.createAlteratedVoiceEntry(u,t,c,s.SourceMeasure,l,h,n),u.Add(t),this.createBaseVoiceEntry(u,t,c,s,n),u.Add(t),this.createAlteratedVoiceEntry(u,t,c,s.SourceMeasure,o,a,n),u.Add(t),this.createBaseVoiceEntry(u,t,c,s,n);break}case o.OrnamentEnum.InvertedTurn:{const t=new i.Fraction(r.Numerator,4*r.Denominator),o=s.Pitch.getTransposedPitch(-1),a=e.getAlterationForPitch(o),l=s.Pitch.getTransposedPitch(1),h=e.getAlterationForPitch(l);this.createAlteratedVoiceEntry(u,t,c,s.SourceMeasure,o,a,n),u.Add(t),this.createBaseVoiceEntry(u,t,c,s,n),u.Add(t),this.createAlteratedVoiceEntry(u,t,c,s.SourceMeasure,l,h,n),u.Add(t),this.createBaseVoiceEntry(u,t,c,s,n);break}case o.OrnamentEnum.DelayedTurn:{const t=new i.Fraction(r.Numerator,2*r.Denominator),o=s.Pitch.getTransposedPitch(-1),a=e.getAlterationForPitch(o),h=s.Pitch.getTransposedPitch(1),d=e.getAlterationForPitch(h);this.createBaseVoiceEntry(u,t,c,s,n),u=i.Fraction.plus(l,t),t.Denominator=8*r.Denominator,this.createAlteratedVoiceEntry(u,t,c,s.SourceMeasure,h,d,n),u.Add(t),this.createBaseVoiceEntry(u,t,c,s,n),u.Add(t),this.createAlteratedVoiceEntry(u,t,c,s.SourceMeasure,o,a,n),u.Add(t),this.createBaseVoiceEntry(u,t,c,s,n);break}case o.OrnamentEnum.DelayedInvertedTurn:{const t=new i.Fraction(r.Numerator,2*r.Denominator),o=s.Pitch.getTransposedPitch(-1),a=e.getAlterationForPitch(o),h=s.Pitch.getTransposedPitch(1),d=e.getAlterationForPitch(h);this.createBaseVoiceEntry(u,t,c,s,n),u=i.Fraction.plus(l,t),t.Denominator=8*r.Denominator,this.createAlteratedVoiceEntry(u,t,c,s.SourceMeasure,o,a,n),u.Add(t),this.createBaseVoiceEntry(u,t,c,s,n),u.Add(t),this.createAlteratedVoiceEntry(u,t,c,s.SourceMeasure,h,d,n),u.Add(t),this.createBaseVoiceEntry(u,t,c,s,n);break}case o.OrnamentEnum.Mordent:{const t=new i.Fraction(r.Numerator,4*r.Denominator),o=s.Pitch.getTransposedPitch(1),a=e.getAlterationForPitch(o);this.createBaseVoiceEntry(u,t,c,s,n),u.Add(t),this.createAlteratedVoiceEntry(u,t,c,s.SourceMeasure,o,a,n),t.Denominator=2*r.Denominator,u=i.Fraction.plus(l,t),this.createBaseVoiceEntry(u,t,c,s,n);break}case o.OrnamentEnum.InvertedMordent:{const t=new i.Fraction(r.Numerator,4*r.Denominator),o=s.Pitch.getTransposedPitch(-1),a=e.getAlterationForPitch(o);this.createBaseVoiceEntry(u,t,c,s,n),u.Add(t),this.createAlteratedVoiceEntry(u,t,c,s.SourceMeasure,o,a,n),t.Denominator=2*r.Denominator,u=i.Fraction.plus(l,t),this.createBaseVoiceEntry(u,t,c,s,n);break}default:throw new RangeError}return n}createBaseVoiceEntry(t,e,n,i,o){const a=new l(t,n,i.ParentStaffEntry),c=new r.Pitch(i.Pitch.FundamentalNote,i.Pitch.Octave,i.Pitch.Accidental),u=new s.Note(a,void 0,e,c,i.SourceMeasure);a.Notes.push(u),o.push(a)}createAlteratedVoiceEntry(t,e,n,i,o,a,c){const u=new l(t,n,void 0),h=new r.Pitch(o.FundamentalNote,o.Octave,a),d=new s.Note(u,void 0,e,h,i);u.Notes.push(d),c.push(u)}}var u,h;e.VoiceEntry=l,function(t){t[t.accent=0]="accent",t[t.strongaccent=1]="strongaccent",t[t.marcatoup=2]="marcatoup",t[t.marcatodown=3]="marcatodown",t[t.invertedstrongaccent=4]="invertedstrongaccent",t[t.staccato=5]="staccato",t[t.staccatissimo=6]="staccatissimo",t[t.spiccato=7]="spiccato",t[t.tenuto=8]="tenuto",t[t.fermata=9]="fermata",t[t.invertedfermata=10]="invertedfermata",t[t.breathmark=11]="breathmark",t[t.caesura=12]="caesura",t[t.lefthandpizzicato=13]="lefthandpizzicato",t[t.naturalharmonic=14]="naturalharmonic",t[t.snappizzicato=15]="snappizzicato",t[t.upbow=16]="upbow",t[t.downbow=17]="downbow",t[t.scoop=18]="scoop",t[t.plop=19]="plop",t[t.doit=20]="doit",t[t.falloff=21]="falloff",t[t.stress=22]="stress",t[t.unstress=23]="unstress",t[t.detachedlegato=24]="detachedlegato",t[t.otherarticulation=25]="otherarticulation",t[t.bend=26]="bend"}(u=e.ArticulationEnum||(e.ArticulationEnum={})),function(t){t[t.Undefined=-1]="Undefined",t[t.Up=0]="Up",t[t.Down=1]="Down",t[t.None=2]="None",t[t.Double=3]="Double"}(h=e.StemDirectionType||(e.StemDirectionType={}))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Label=void 0;const i=n(8);e.Label=class{constructor(t="",e=i.TextAlignmentEnum.CenterBottom,n,s=!0){this.text=t,this.print=s,this.textAlignment=e,this.font=n,this.fontFamily=void 0}ToString(){return this.text}}},function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.VexFlowConverter=void 0;const s=i(n(9)),r=n(7),o=n(2),a=n(17),c=n(16),l=n(2),u=n(2),h=n(23),d=n(20),f=n(84),p=n(22),m=i(n(1)),g=n(12),b=n(38),v=n(46),y=n(62),S=n(18),x=n(66),_=n(3);class w{static duration(t,e){const n=t.RealValue;return 2===n?"1/2":n>=1?"w":n<1&&n>=.5?e&&n>.5?"w":"h":n<.5&&n>=.25?e&&n>.25?"h":"q":n<.25&&n>=.125?e&&n>.125?"q":"8":n<.125&&n>=.0625?e&&n>.0625?"8":"16":n<.0625&&n>=.03125?e&&n>.03125?"16":"32":n<.03125&&n>=.015625?e&&n>.015625?"32":"64":e?"64":"128"}static pitch(t,e,n,i){let s=3;e&&(s=0,n.ClefType===r.ClefEnum.F&&(s=2),n.ClefType===r.ClefEnum.C&&(s=2));const a=u.NoteEnum[t.FundamentalNote].toLowerCase(),c=o.Pitch.accidentalVexflow(t.Accidental),l=t.Octave-n.OctaveOffset+s;let h="";return i&&(h=this.NoteHeadCode(i)),[a+"n/"+l+h,c,n]}static restToNotePitch(t,e){let n=t.Octave;switch(e){case r.ClefEnum.C:case r.ClefEnum.F:n+=2;break;case r.ClefEnum.G:}return new o.Pitch(t.FundamentalNote,n,l.AccidentalEnum.NONE)}static NoteHeadCode(t){const e=t.Filled?"2":"1";switch(t.Shape){case y.NoteHeadShape.NORMAL:return"";case y.NoteHeadShape.DIAMOND:return"/D"+e;case y.NoteHeadShape.TRIANGLE:return"/T"+e;case y.NoteHeadShape.X:return"/X"+e;case y.NoteHeadShape.CIRCLEX:return"/X3";case y.NoteHeadShape.RECTANGLE:return"/R"+e;case y.NoteHeadShape.SQUARE:return"/S"+e;case y.NoteHeadShape.SLASH:default:return""}}static GhostNote(t){return new s.default.Flow.GhostNote({duration:w.duration(t,!1)})}static StaveNote(t){var e,n,i,r,o,a,c,l,u,h;const d=t.notes.reverse(),f=t.parentStaffEntry.parentMeasure.parentSourceMeasure.Rules,p=d[0];let m=[];const b=[],v=p.graphicalNoteLength,x=void 0!==p.sourceNote.NoteTuplet;let _=w.duration(v,x);void 0!==p.sourceNote.TypeLength&&p.sourceNote.TypeLength!==v&&(_=w.duration(p.sourceNote.TypeLength,x));let E,T=void 0,C=p.numberOfDots,M=!1,P=0,A=!1,I=!1;for(const s of d){if(C=1&&e.length-1>=d+1&&(u=null===(o=null===(r=e[d-1])||void 0===r?void 0:r.graphicalVoiceEntries[0])||void 0===o?void 0:o.parentVoiceEntry,h=null===(c=null===(a=e[d+1])||void 0===a?void 0:a.graphicalVoiceEntries[0])||void 0===c?void 0:c.parentVoiceEntry,u&&h)){const t=u.Notes[0],e=h.Notes[0];if(null===(l=t.NoteBeam)||void 0===l?void 0:l.Notes.includes(e)){const t=u.Notes.last().Pitch,e=s.Clef();m=[w.pitch(w.restToNotePitch(t.getTransposedPitch(-2),e.ClefType),!1,e,void 0)[0]]}}}}if(s.parentVoiceEntry.parentStaffEntry.parentMeasure.parentSourceMeasure.Duration.RealValue<=v.RealValue&&(m=["d/5"],_="w",C=0,M=!0,P=f.WholeRestXShiftVexflow*S.unitInPixels),s.sourceNote.ParentStaff.Voices.length>1){let t=0;for(let e=0;e1)switch(null===(h=null===(u=s.sourceNote.ParentVoiceEntry)||void 0===u?void 0:u.ParentVoice)||void 0===h?void 0:h.VoiceId){case 1:m=["e/5"];break;case 2:m=["f/4"]}}break}s.sourceNote.Notehead&&s.sourceNote.Notehead.Shape===y.NoteHeadShape.SLASH&&(A=!0);const t=s.vfpitch;m.push(t[0]),b.push(t[1]),T||(T=w.Clef(t[2]).type)}for(let s=0,g=C;s0&&E.addModifier(g,new s.default.Flow.Tremolo(t))}if(.25===O.Length.RealValue&&O.Notehead&&!1===O.Notehead.Filled){const t=E.getKeyProps();for(let e=0;e");break;case g.ArticulationEnum.downbow:e=new s.default.Flow.Articulation("am");break;case g.ArticulationEnum.fermata:e=new s.default.Flow.Articulation("a@a"),n=s.default.Flow.Modifier.Position.ABOVE;break;case g.ArticulationEnum.marcatodown:e=new s.default.Flow.Articulation("a|"),n=s.default.Flow.Modifier.Position.ABOVE;break;case g.ArticulationEnum.marcatoup:e=new s.default.Flow.Articulation("a^"),n=s.default.Flow.Modifier.Position.ABOVE;break;case g.ArticulationEnum.invertedfermata:e=new s.default.Flow.Articulation("a@u"),n=s.default.Flow.Modifier.Position.BELOW;break;case g.ArticulationEnum.lefthandpizzicato:e=new s.default.Flow.Articulation("a+");break;case g.ArticulationEnum.snappizzicato:e=new s.default.Flow.Articulation("ao");break;case g.ArticulationEnum.staccatissimo:e=new s.default.Flow.Articulation("av");break;case g.ArticulationEnum.staccato:e=new s.default.Flow.Articulation("a.");break;case g.ArticulationEnum.tenuto:e=new s.default.Flow.Articulation("a-");break;case g.ArticulationEnum.upbow:e=new s.default.Flow.Articulation("a|");break;case g.ArticulationEnum.strongaccent:e=new s.default.Flow.Articulation("a^")}e&&(e.setPosition(n),t.addModifier(0,e))}}static generateOrnaments(t,e){let n=s.default.Flow.Modifier.Position.ABOVE;e.placement===_.PlacementEnum.Below&&(n=s.default.Flow.Modifier.Position.BELOW);let i=void 0;switch(e.GetOrnament){case v.OrnamentEnum.DelayedInvertedTurn:i=new s.default.Flow.Ornament("turn_inverted"),i.setDelayed(!0);break;case v.OrnamentEnum.DelayedTurn:i=new s.default.Flow.Ornament("turn"),i.setDelayed(!0);break;case v.OrnamentEnum.InvertedMordent:i=new s.default.Flow.Ornament("mordent"),i.setDelayed(!1);break;case v.OrnamentEnum.InvertedTurn:i=new s.default.Flow.Ornament("turn_inverted"),i.setDelayed(!1);break;case v.OrnamentEnum.Mordent:i=new s.default.Flow.Ornament("mordent_inverted"),i.setDelayed(!1);break;case v.OrnamentEnum.Trill:i=new s.default.Flow.Ornament("tr"),i.setDelayed(!1);break;case v.OrnamentEnum.Turn:i=new s.default.Flow.Ornament("turn"),i.setDelayed(!1);break;default:return void m.default.warn("unhandled OrnamentEnum type: "+e.GetOrnament)}i&&(e.AccidentalBelow!==l.AccidentalEnum.NONE&&i.setLowerAccidental(o.Pitch.accidentalVexflow(e.AccidentalBelow)),e.AccidentalAbove!==l.AccidentalEnum.NONE&&i.setUpperAccidental(o.Pitch.accidentalVexflow(e.AccidentalAbove)),i.setPosition(n),t.addModifier(0,i))}static StrokeTypeFromArpeggioType(t){switch(t){case x.ArpeggioType.ARPEGGIO_DIRECTIONLESS:return s.default.Flow.Stroke.Type.ARPEGGIO_DIRECTIONLESS;case x.ArpeggioType.BRUSH_DOWN:return s.default.Flow.Stroke.Type.BRUSH_UP;case x.ArpeggioType.BRUSH_UP:return s.default.Flow.Stroke.Type.BRUSH_DOWN;case x.ArpeggioType.RASQUEDO_DOWN:return s.default.Flow.Stroke.Type.RASQUEDO_UP;case x.ArpeggioType.RASQUEDO_UP:return s.default.Flow.Stroke.Type.RASQUEDO_DOWN;case x.ArpeggioType.ROLL_DOWN:return s.default.Flow.Stroke.Type.ROLL_UP;case x.ArpeggioType.ROLL_UP:return s.default.Flow.Stroke.Type.ROLL_DOWN;default:return s.default.Flow.Stroke.Type.ARPEGGIO_DIRECTIONLESS}}static CreateTabNote(t){const e=[],n=t.notes.reverse(),i=[],r=t.notes[0].graphicalNoteLength,o=void 0!==t.notes[0].sourceNote.NoteTuplet;let a=w.duration(r,o),c=0,l=!1;for(const h of t.notes){const t=h.sourceNote,n={str:t.StringNumber,fret:t.FretNumber};e.push(n),t.BendArray&&t.BendArray.forEach((function(t){let e;const r=t.bendalter-n.fret;e=r>1?"Full":1===r?"1/2":"1/4","up"===t.direction?i.push({type:s.default.Flow.Bend.UP,text:e,width:10}):i.push({type:s.default.Flow.Bend.DOWN,text:e,width:10})})),t.VibratoStroke&&(l=!0),c0&&this.rules.RenderMultipleRestMeasures){r.isReducedToMultiRest=!0,r.multipleRestMeasureNumber=1;const n=r.multipleRestMeasures-1;a+=n;for(let i=1;i<=n;i++){const n=t.SourceMeasures[r.MeasureNumber-1+i];n.multipleRestMeasureNumber=i+1,n.isReducedToMultiRest=!0,e.push([void 0])}}}if(this.rules.AutoGenerateMutipleRestMeasuresFromRestMeasures&&this.rules.RenderMultipleRestMeasures){let r=void 0,a=0;for(let c=0,l=t.SourceMeasures.length;c0){r.isReducedToMultiRest=!0,r.multipleRestMeasureNumber=1,a++,l.multipleRestMeasureNumber=a,l.isReducedToMultiRest=!0;for(let t=0;t1){r.multipleRestMeasures=a;const t=this.createGraphicalMeasuresForSourceMeasure(r,n,s,o,i);e[r.measureListIndex]=t,a=0,r=void 0}else a=0,r=void 0}if(a>1){r.multipleRestMeasures=a,r.isReducedToMultiRest=!0;const t=this.createGraphicalMeasuresForSourceMeasure(r,n,s,o,i);e[r.measureListIndex]=t,a=0,r=void 0}}const c=i.map(t=>t.ClefType===a.ClefEnum.percussion);this.handleStaffEntries(c),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(t,e){if(this.graphicalMusicSheet.MeasureList.length>0){let t=this.graphicalMusicSheet.MeasureList[0],e=this.calculateMeasureXLayout(t);e=this.calculateMeasureWidthFromLyrics(t,e),R.setMeasuresMinStaffEntriesWidth(t,e);for(let n=1;n0)return;const r=e.Measures[s];0!==r.MeasureNumber&&1!==r.MeasureNumber||(n=r.MeasureNumber),i=r!==e.Measures[0]&&this.rules.MeasureNumberLabelXOffset?this.rules.MeasureNumberLabelXOffset:0,(r.MeasureNumber===n||r.MeasureNumber>=n+this.rules.MeasureNumberLabelOffset)&&!r.parentSourceMeasure.ImplicitMeasure&&((1!==r.MeasureNumber||1===r.MeasureNumber&&r!==e.Measures[0])&&this.calculateSingleMeasureNumberPlacement(r,e,t,i),n=r.MeasureNumber)}}calculateSingleMeasureNumberPlacement(t,e,n,i=0){const s=t.MeasureNumber.toString(),r=new E.Label(s),o=new f.GraphicalLabel(r,this.rules.MeasureNumberLabelHeight,p.TextAlignmentEnum.LeftBottom,this.rules),a=e.SkyBottomLineCalculator;o.setLabelPositionAndShapeBorders(),o.PositionAndShape.Parent=n.PositionAndShape;const c=e.PositionAndShape.RelativePosition.x+t.PositionAndShape.RelativePosition.x-o.PositionAndShape.BorderMarginLeft+i;let l,u=c,d=c-o.PositionAndShape.BorderLeft+o.PositionAndShape.BorderRight;u-=e.PositionAndShape.RelativePosition.x,d-=e.PositionAndShape.RelativePosition.x;const m=u+.5,g=d-.5,b=a.getSkyLineMinInRange(m,g);if(t===e.Measures[0]){let t=0;if(n.GroupBrackets.length>0)for(const e of n.GroupBrackets)t=Math.min(t,e.PositionAndShape.BorderTop);l=Math.min(b,t)}else l=b;l=Math.min(0,l),o.PositionAndShape.RelativePosition=new h.PointF2D(c,l),a.updateSkyLineInRange(u,d,l+o.PositionAndShape.BorderMarginTop),n.MeasureNumberLabels.push(o)}layoutGraphicalTie(t,e,n){throw new Error("abstract, not implemented")}calculateSingleStaffLineLyricsPosition(t,e){let n=0,i=this.rules.StaffHeight;const s=[],r=t.SkyBottomLineCalculator;let o=t.Measures.length;for(let c=0;c0){s.push(a),n=Math.max(n,a.LyricsEntries.length);const t=a.PositionAndShape.RelativePosition.x+o.x;let e=Number.MAX_VALUE,c=Number.MIN_VALUE;for(let n=0;n0){const e=t.PositionAndShape.Size.width;let n=s[0].PositionAndShape.RelativePosition.x+s[0].PositionAndShape.BorderMarginLeft+s[0].parentMeasure.PositionAndShape.RelativePosition.x;n=n>e?e:n,r.updateBottomLineInRange(n,e,a)}return s}calculateLyricsExtendsAndDashes(t){for(let e=0,n=t.length;e0||t.UnknownList.length>0){let e="";for(let n=0,i=t.EntriesList.length;nt.length-1&&(x.default.debug("minimum measure to draw index out of range. resetting min measure index to limit."),this.rules.MinMeasureToDrawIndex=t.length-1);const e=[];for(let s=this.rules.MinMeasureToDrawIndex,r=t.length;sd){const t=h.StaffLines[e].PositionAndShape.RelativePosition.y-s.PositionAndShape.RelativePosition.y-this.rules.StaffHeight;S=this.rules.StaffHeight+t/2}else S=this.rules.WedgePlacementBelowY;S-=this.rules.WedgeOpeningLength/2,a||(_=S);let n=f.getBottomLineMaxInRange(g,v);n>S&&(S=n);const i=!1;if(dthis.rules.StaffHeight?r-this.rules.WedgeVerticalMargin:this.rules.StaffHeight+this.rules.WedgeOpeningLength,t.NotToBeRemoved=!0}}a||(n=o.SkyBottomLineCalculator.getBottomLineMaxInRange(b,y),n>_&&(_=n),_+=this.rules.WedgeOpeningLength/2,_+=this.rules.WedgeVerticalMargin),i||(S+=this.rules.WedgeOpeningLength/2,S+=this.rules.WedgeVerticalMargin)}else if(p===C.PlacementEnum.Above){if(1===s.ParentStaff.ParentInstrument.Staves.length)S=this.rules.WedgePlacementAboveY;else{let t=0;d>0&&(t=d-1);const e=h.StaffLines[t];S=-(s.PositionAndShape.RelativePosition.y-e.PositionAndShape.RelativePosition.y-this.rules.StaffHeight)/2}S+=this.rules.WedgeOpeningLength/2,a||(_=S);let t=f.getSkyLineMinInRange(g,v);t1&&d>0){const t=s.findClosestStaffEntry(g),n=s.findClosestStaffEntry(v);if(t&&n){t.parentVerticalContainer;const n=d-1;if(e){const t=h.StaffLines[n],e=t.SkyBottomLineCalculator.getBottomLineMaxInRange(g,v);S=(s.PositionAndShape.RelativePosition.y-t.PositionAndShape.RelativePosition.y-e-this.rules.StaffHeight)/2+this.rules.StaffHeight}}}a||(t=o.SkyBottomLineCalculator.getSkyLineMinInRange(b,y),t<_&&(_=t),_-=this.rules.WedgeOpeningLength/2),e||(S-=this.rules.WedgeOpeningLength/2,S-=this.rules.WedgeVerticalMargin),a||(_-=this.rules.WedgeVerticalMargin)}t.Lines.clear(),t.ContinuousDynamic.DynamicType===I.ContDynamicEnum.crescendo?a?(t.createCrescendoLines(g,v,S),t.calcPsi()):(t.createFirstHalfCrescendoLines(g,v,S),t.calcPsi(),m.createSecondHalfCrescendoLines(b,y,_),m.calcPsi()):t.ContinuousDynamic.DynamicType===I.ContDynamicEnum.diminuendo&&(a?(t.createDiminuendoLines(g,v,S),t.calcPsi()):(t.createFirstHalfDiminuendoLines(g,v,S),t.calcPsi(),m.createSecondHalfDiminuendoLines(b,y,_),m.calcPsi()))}calculateGraphicalInstantaneousDynamicExpression(t,e){const n=t.ParentStaffLine;if(!n)return;const i=e.x+t.PositionAndShape.BorderMarginLeft,s=e.x+t.PositionAndShape.BorderMarginRight,r=n.SkyBottomLineCalculator;let o=0;if(t.Placement===C.PlacementEnum.Above){const a=r.getSkyLineMinInRange(i,s);if(n.isPartOfMultiStaffInstrument()&&n.ParentStaff!==n.ParentStaff.ParentInstrument.Staves[0]){const e=n.ParentMusicSystem.StaffLines[n.ParentMusicSystem.StaffLines.indexOf(n)-1],i=n.PositionAndShape.RelativePosition.y-e.PositionAndShape.RelativePosition.y-this.rules.StaffHeight;o=a>-i/2?-i/2:a-t.PositionAndShape.BorderMarginBottom}else o=a-t.PositionAndShape.BorderMarginBottom;t.PositionAndShape.RelativePosition=new h.PointF2D(e.x,o)}else if(t.Placement===C.PlacementEnum.Below){const a=r.getBottomLineMaxInRange(i,s),c=n.ParentStaff.ParentInstrument.Staves[n.ParentStaff.ParentInstrument.Staves.length-1];if(n.isPartOfMultiStaffInstrument()&&n.ParentStaff!==c){const e=n.ParentMusicSystem.StaffLines[n.ParentMusicSystem.StaffLines.indexOf(n)+1].PositionAndShape.RelativePosition.y-n.PositionAndShape.RelativePosition.y-this.rules.StaffHeight;o=a+t.PositionAndShape.BorderMarginBottomt.PositionAndShape.Size.width&&(d=t.PositionAndShape.Size.width-this.rules.MeasureRightMargin,u=d-c.PositionAndShape.MarginSize.width,e.x=u-c.PositionAndShape.BorderMarginLeft);const m=t.SkyBottomLineCalculator;return l=s===C.PlacementEnum.Below?m.getBottomLineMaxInRange(u,d):m.getSkyLineMinInRange(u,d),c.PositionAndShape.RelativePosition=new h.PointF2D(e.x,l),s===C.PlacementEnum.Below?m.updateBottomLineInRange(u,d,c.PositionAndShape.BorderMarginBottom+l):m.updateSkyLineInRange(u,d,c.PositionAndShape.BorderMarginTop+l),c}calculateTempoExpressionsForMultiTempoExpression(t,e,n){const i=r.Fraction.plus(t.AbsoluteTimestamp,e.Timestamp),s=this.graphicalMusicSheet.MeasureList[n];let o=new h.PointF2D;if(e.ContinuousTempo||e.InstantaneousTempo){if(this.rules.MinMeasureToDrawIndex>0)return;if(!s[0])return;let t=s[0].ParentStaffLine,n=s[0].PositionAndShape.RelativePosition.x,r=0;for(let e=0;e0){t=s[e].ParentStaffLine,n=s[e].PositionAndShape.RelativePosition.x,r=e;break}if(o=this.getRelativePositionInStaffLineFromTimestamp(i,r,t,t.isPartOfMultiStaffInstrument(),n),e.EntriesList.length>0&&e.EntriesList[0].Expression instanceof P.InstantaneousTempoExpression&&(e.EntriesList[0].Expression.Placement=C.PlacementEnum.Above,t.Measures[0].staffEntries.length>0&&0===Math.abs(o.x-t.Measures[0].staffEntries[0].PositionAndShape.RelativePosition.x)&&t.ParentMusicSystem===this.musicSystems[0])){const e=t.Measures[0].FirstInstructionStaffEntry;if(e){const t=e.GraphicalInstructions.last();o.x=t.PositionAndShape.RelativePosition.x}this.rules.CompactMode&&(o.x=t.PositionAndShape.RelativePosition.x+t.Measures[0].PositionAndShape.RelativePosition.x)}for(const i of e.EntriesList){let n=p.TextAlignmentEnum.CenterBottom;this.rules.CompactMode&&(n=p.TextAlignmentEnum.LeftBottom);const s=this.calculateLabel(t,o,i.label,e.getFontstyleOfFirstEntry(),i.Expression.Placement,this.rules.UnknownTextHeight,n);if(i.Expression instanceof P.InstantaneousTempoExpression){for(const e of t.AbstractExpressions)e instanceof M.GraphicalInstantaneousTempoExpression&&(e.SourceExpression.Label,i.Expression.Label);if(new M.GraphicalInstantaneousTempoExpression(i.Expression,s).ParentStaffLine||x.default.warn("Adding staffline didn't work"),this.rules.MetronomeMarksDrawn&&i.Expression.Enum===P.TempoEnum.metronomeMark){this.createMetronomeMark(i.Expression);continue}}else i.Expression,A.ContinuousTempoExpression}}}createMetronomeMark(t){throw new Error("abstract, not implemented")}graphicalMeasureCreatedCalculations(t){}clearSystemsAndMeasures(){for(let t=0,e=this.graphicalMusicSheet.MusicPages.length;t-1&&n.PositionAndShape.ChildElements.splice(t,1),n.FirstInstructionStaffEntry=void 0,n.beginInstructionsWidth=0}if(n.LastInstructionStaffEntry){const t=n.PositionAndShape.ChildElements.indexOf(n.LastInstructionStaffEntry.PositionAndShape);t>-1&&n.PositionAndShape.ChildElements.splice(t,1),n.LastInstructionStaffEntry=void 0,n.endInstructionsWidth=0}}e.Measures=[],e.PositionAndShape.ChildElements=[]}n.StaffLines.length=0,n.PositionAndShape.ChildElements=[]}e.MusicSystems=[],e.PositionAndShape.ChildElements=[]}this.graphicalMusicSheet.MusicPages=[]}handleVoiceEntry(t,e,n,i,s,r,o,a,c,u,h){t.StemDirectionXml!==l.StemDirectionType.Undefined&&this.rules.SetWantedStemDirectionByXml&&void 0!==t.StemDirectionXml?t.WantedStemDirection=t.StemDirectionXml:this.calculateStemDirectionFromVoices(t);const d=e.findOrCreateGraphicalVoiceEntry(t);d.octaveShiftValue=a;const f=e.tabStaffEntry;let p;f&&(p=f.findOrCreateGraphicalVoiceEntry(t));for(let l=0,m=t.Notes.length;l-1)continue;let c;if(t.IsGrace?c=R.symbolFactory.createGraceNote(i,d,s,a):(c=R.symbolFactory.createNote(i,d,s,a,void 0),R.stafflineNoteCalculator.trackNote(c)),i.Pitch&&this.checkNoteForAccidental(c,n,s,a),this.resetYPositionForLeadSheet(c.PositionAndShape),e.addGraphicalNoteToListAtCorrectYPosition(d,c),c.PositionAndShape.calculateBoundingBox(),this.leadSheet||(void 0!==i.NoteBeam&&i.PrintObject&&this.handleBeam(c,i.NoteBeam,o),void 0!==i.NoteTuplet&&i.PrintObject&&this.handleTuplet(c,i.NoteTuplet,r)),p){const t=R.symbolFactory.createNote(i,p,s,a,void 0);f.addGraphicalNoteToListAtCorrectYPosition(p,t),t.PositionAndShape.calculateBoundingBox(),this.leadSheet||i.NoteTuplet&&this.handleTuplet(t,i.NoteTuplet,r)}}return t.Articulations.length>0&&this.handleVoiceEntryArticulations(t.Articulations,t,e),t.TechnicalInstructions.length>0&&this.handleVoiceEntryTechnicalInstructions(t.TechnicalInstructions,t,e),t.LyricsEntries.size()>0&&this.handleVoiceEntryLyrics(t,e,i),t.OrnamentContainer&&this.handleVoiceEntryOrnaments(t.OrnamentContainer,t,e),a}resetYPositionForLeadSheet(t){this.leadSheet&&(t.RelativePosition=new h.PointF2D(t.RelativePosition.x,0))}layoutVoiceEntries(t,e){if(t.PositionAndShape.RelativePosition=new h.PointF2D(0,0),!this.leadSheet)for(const n of t.graphicalVoiceEntries){const e=n.notes;if(0===e.length)continue;const i=e[0].sourceNote.ParentVoiceEntry,s=void 0!==e[0].sourceNote.Pitch;this.layoutVoiceEntry(i,e,t,s)}}maxInstrNameLabelLength(){var t;let e=0;for(const n of this.graphicalMusicSheet.ParentMusicSheet.Instruments)if((null===(t=n.NameLabel)||void 0===t?void 0:t.print)&&n.Voices.length>0&&n.Voices[0].Visible){let t=n.NameLabel;this.rules.RenderPartNames||(t=new E.Label("",t.textAlignment,t.font));const i=new f.GraphicalLabel(t,this.rules.InstrumentLabelTextHeight,p.TextAlignmentEnum.LeftCenter,this.rules);i.setLabelPositionAndShapeBorders(),e=Math.max(e,i.PositionAndShape.MarginSize.width)}return this.rules.RenderPartNames?e:0}calculateSheetLabelBoundingBoxes(){const t=this.graphicalMusicSheet.ParentMusicSheet,e=this.rules.DefaultColorTitle;if(void 0!==t.Title&&this.rules.RenderTitle){const n=new f.GraphicalLabel(t.Title,this.rules.SheetTitleHeight,p.TextAlignmentEnum.CenterBottom,this.rules);n.Label.colorDefault=e,this.graphicalMusicSheet.Title=n,n.setLabelPositionAndShapeBorders()}else this.rules.RenderTitle||(this.graphicalMusicSheet.Title=void 0);if(void 0!==t.Subtitle&&this.rules.RenderSubtitle){const n=new f.GraphicalLabel(t.Subtitle,this.rules.SheetSubtitleHeight,p.TextAlignmentEnum.CenterCenter,this.rules);n.Label.colorDefault=e,this.graphicalMusicSheet.Subtitle=n,n.setLabelPositionAndShapeBorders()}else this.rules.RenderSubtitle||(this.graphicalMusicSheet.Subtitle=void 0);if(void 0!==t.Composer&&this.rules.RenderComposer){const n=new f.GraphicalLabel(t.Composer,this.rules.SheetComposerHeight,p.TextAlignmentEnum.RightCenter,this.rules);n.Label.colorDefault=e,this.graphicalMusicSheet.Composer=n,n.setLabelPositionAndShapeBorders()}else this.rules.RenderComposer||(this.graphicalMusicSheet.Composer=void 0);if(void 0!==t.Lyricist&&this.rules.RenderLyricist){const n=new f.GraphicalLabel(t.Lyricist,this.rules.SheetAuthorHeight,p.TextAlignmentEnum.LeftCenter,this.rules);n.Label.colorDefault=e,this.graphicalMusicSheet.Lyricist=n,n.setLabelPositionAndShapeBorders()}else this.rules.RenderLyricist||(this.graphicalMusicSheet.Lyricist=void 0)}checkMeasuresForWholeRestNotes(){for(let t=0,e=this.musicSystems.length;t0&&1===t.graphicalVoiceEntries[0].notes.length){const n=t.graphicalVoiceEntries[0].notes[0];!n.sourceNote.Pitch&&new r.Fraction(1,2).lt(n.sourceNote.Length)&&this.layoutMeasureWithWholeRest(n,t,e)}}}}}}optimizeRestNotePlacement(t,e){if(0===t.graphicalVoiceEntries.length)return;const n=t.graphicalVoiceEntries[0].notes;if(0===n.length)return;const i=n[0],s=i.sourceNote.isRest();if(2===t.graphicalVoiceEntries.length){let e=!1;const n=t.graphicalVoiceEntries[1].notes;n.length>0&&(e=n[0].sourceNote.isRest()),s&&e?this.calculateTwoRestNotesPlacementWithCollisionDetection(t):(s||e)&&this.calculateRestNotePlacementWithCollisionDetectionFromGraphicalNote(t)}else if(s&&t!==e.staffEntries[0]&&t!==e.staffEntries[e.staffEntries.length-1]){const n=e.staffEntries.indexOf(t),s=e.staffEntries[n-1],r=e.staffEntries[n+1];if(1===s.graphicalVoiceEntries.length){const e=s.graphicalVoiceEntries[0].notes[0];if(void 0!==e.sourceNote.NoteBeam&&1===r.graphicalVoiceEntries.length){const n=r.graphicalVoiceEntries[0].notes[0];void 0!==n.sourceNote.NoteBeam&&e.sourceNote.NoteBeam===n.sourceNote.NoteBeam&&(this.calculateRestNotePlacementWithinGraphicalBeam(t,i,e,r,n),t.PositionAndShape.calculateBoundingBox())}}}}getRelativePositionInStaffLineFromTimestamp(t,e,n,i,s=0){let o=new h.PointF2D,a=void 0,c=void 0;const l=this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers.length,u=this.graphicalMusicSheet.GetInterpolatedIndexInVerticalContainers(t),d=Math.min(Math.floor(u),l-1),f=Math.min(Math.ceil(u),l-1);if(d<0||e<0)return o;if(a=this.getFirstLeftNotNullStaffEntryFromContainer(d,e,i),c=this.getFirstRightNotNullStaffEntryFromContainer(f,e,i),a&&c){let e=a.parentMeasure.PositionAndShape.RelativePosition.x;s>0&&(e=s);let i=a.PositionAndShape.RelativePosition.x+e,l=c.PositionAndShape.RelativePosition.x+c.parentMeasure.PositionAndShape.RelativePosition.x;s>0&&(l=c.PositionAndShape.RelativePosition.x+e);let u=0;if(a!==c){const e=a.getAbsoluteTimestamp(),n=c.getAbsoluteTimestamp();u=r.Fraction.minus(t,e).RealValue/r.Fraction.minus(n,e).RealValue}a.parentMeasure.ParentStaffLine!==c.parentMeasure.ParentStaffLine&&(a.parentMeasure.ParentStaffLine===n?l=n.PositionAndShape.Size.width:i=n.PositionAndShape.RelativePosition.x),o=new h.PointF2D(i+(l-i)*u,0)}return o}getRelativeXPositionFromTimestamp(t){const e=this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers.length,n=this.graphicalMusicSheet.GetInterpolatedIndexInVerticalContainers(t),i=Math.max(0,Math.min(Math.round(n),e-1)),s=this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers[i].getFirstNonNullStaffEntry();return s.PositionAndShape.RelativePosition.x+s.parentMeasure.PositionAndShape.RelativePosition.x}calculatePageLabels(t){var e,n;this.rules.RenderSingleHorizontalStaffline&&(t.PositionAndShape.BorderRight=t.PositionAndShape.Size.width,t.PositionAndShape.calculateBoundingBox(),this.graphicalMusicSheet.ParentMusicSheet.pageWidth=t.PositionAndShape.Size.width);let i=10;if(t.MusicSystems.length>0){const e=t.MusicSystems[0];i=e.PositionAndShape.RelativePosition.y+e.PositionAndShape.BorderTop}if(this.graphicalMusicSheet.Title){const e=this.graphicalMusicSheet.Title;e.PositionAndShape.Parent=t.PositionAndShape;const n=new h.PointF2D;n.x=this.graphicalMusicSheet.ParentMusicSheet.pageWidth/2,n.y=this.rules.TitleTopDistance+this.rules.SheetTitleHeight,e.PositionAndShape.RelativePosition=n,t.Labels.push(e)}if(this.graphicalMusicSheet.Subtitle){const e=this.graphicalMusicSheet.Subtitle;e.PositionAndShape.Parent=t.PositionAndShape;const n=new h.PointF2D;n.x=this.graphicalMusicSheet.ParentMusicSheet.pageWidth/2,n.y=this.rules.TitleTopDistance+this.rules.SheetTitleHeight+this.rules.SheetMinimumDistanceBetweenTitleAndSubtitle,e.PositionAndShape.RelativePosition=n,t.Labels.push(e)}const s=t.MusicSystems[0].StaffLines[0],r=s.SkyBottomLineCalculator,o=this.graphicalMusicSheet.Composer;if(o){o.PositionAndShape.Parent=t.PositionAndShape,o.setLabelPositionAndShapeBorders();const n=new h.PointF2D;if(n.x=this.graphicalMusicSheet.ParentMusicSheet.pageWidth-this.rules.PageRightMargin,n.y=i,o.TextLines&&1!==(null===(e=o.TextLines)||void 0===e?void 0:e.length)){const t=s.PositionAndShape.BorderMarginRight,e=t-o.PositionAndShape.Size.width,i=r.getSkyLineMinInRange(e,t);n.y+=i-o.PositionAndShape.BorderBottom,r.updateSkyLineInRange(e,t,i-o.PositionAndShape.MarginSize.height)}else n.y-=this.rules.SystemComposerDistance;o.PositionAndShape.RelativePosition=n,t.Labels.push(o)}const a=this.graphicalMusicSheet.Lyricist;if(a){a.PositionAndShape.Parent=t.PositionAndShape,a.setLabelPositionAndShapeBorders();const e=new h.PointF2D;if(e.x=this.rules.PageLeftMargin,e.y=i,a.TextLines&&1!==(null===(n=a.TextLines)||void 0===n?void 0:n.length)){const t=s.PositionAndShape.BorderMarginLeft-e.x,n=t+a.PositionAndShape.Size.width,i=r.getSkyLineMinInRange(t,n);e.y+=i-a.PositionAndShape.BorderBottom,r.updateSkyLineInRange(t,n,i-a.PositionAndShape.MarginSize.height)}else e.y-=this.rules.SystemComposerDistance;a.PositionAndShape.RelativePosition=e,t.Labels.push(a)}}createGraphicalTies(){for(let t=0;t=0&&this.staffEntriesWithGraphicalTies.push(s)}s=o}}createAccidentalCalculators(){const t=[],e=this.graphicalMusicSheet.ParentMusicSheet.getFirstSourceMeasure();if(e)for(let n=0;n0){const e=o.Instructions[0];R.symbolFactory.createInStaffClef(t,e)}o.ChordContainers&&o.ChordContainers.length>0&&(o.ParentStaff.ParentInstrument.HasChordSymbols=!0,R.symbolFactory.createChordSymbols(o,t,i.ActiveKeyInstruction,this.graphicalMusicSheet.ParentMusicSheet.Transpose))}}if(i.doCalculationsAtEndOfMeasure(),t.LastInstructionsStaffEntries[f]){const e=t.LastInstructionsStaffEntries[f];for(let t=0,n=e.Instructions.length;t=1&&0===y.staffEntries.length){const e=new d.SourceStaffEntry(new T.VerticalSourceStaffEntryContainer(y.parentSourceMeasure,y.parentSourceMeasure.AbsoluteTimestamp,y.parentSourceMeasure.CompleteNumberOfStaves),b),n=new l.VoiceEntry(new r.Fraction(0,1),b.Voices[0],e),i=new o.Note(n,e,r.Fraction.createFromFraction(t.Duration),void 0,t);i.PrintObject=this.rules.FillEmptyMeasuresWithWholeRest===O.FillEmptyMeasuresWithWholeRests.YesVisible,n.Notes.push(i);const s=R.symbolFactory.createStaffEntry(e,y);y.addGraphicalStaffEntry(s),s.relInMeasureTimestamp=n.Timestamp;const u=R.symbolFactory.createVoiceEntry(n,s);s.graphicalVoiceEntries.push(u);const h=R.symbolFactory.createNote(i,u,new a.ClefInstruction,c.OctaveEnum.NONE,void 0);R.stafflineNoteCalculator.trackNote(h),u.notes.push(h)}y.hasOnlyRests=!0;for(const r of y.staffEntries)if(y.hasOnlyRests=r.hasOnlyRests(),!y.hasOnlyRests)break;return y}checkNoteForAccidental(t,e,n,i){let s=t.sourceNote.Pitch;const r=this.graphicalMusicSheet.ParentMusicSheet.Transpose;0!==r&&t.sourceNote.ParentStaffEntry.ParentStaff.ParentInstrument.MidiInstrumentId!==S.MidiInstrument.Percussion&&(s=t.Transpose(e.ActiveKeyInstruction,n,r,i)),t.sourceNote.halfTone=s.getHalfTone(),e.checkAccidental(t,s)}handleStaffEntries(t){for(let e=0,n=this.graphicalMusicSheet.MeasureList.length;e0&&t.graphicalVoiceEntries[0].notes.length>0&&(this.layoutVoiceEntries(t,e),this.layoutStaffEntry(t));this.graphicalMeasureCreatedCalculations(i)}}}}calculateSkyBottomLines(){for(const t of this.musicSystems)for(const e of t.StaffLines)e.SkyBottomLineCalculator.calculateLines()}calculateExpressionAlignements(){}calculateStaffEntryArticulationMarks(){for(let t=0,e=this.musicSystems.length;t0&&this.layoutArticulationMarks(e.Articulations,e,n)}}}}}}calculateOrnaments(){for(let t=0,e=this.musicSystems.length;t0&&t.LyricVersesNumbers.sort()}for(let e=0,n=this.musicSystems.length;e=0&&(i=e.GraphicalLyricsEntries[n+1]),!i)return;const s=t.StaffEntryParent.parentMeasure.ParentStaffLine,r=i.StaffEntryParent.parentMeasure.ParentStaffLine,o=t.StaffEntryParent,a=i.StaffEntryParent;if(t.StaffEntryParent.parentMeasure.ParentStaffLine===i.StaffEntryParent.parentMeasure.ParentStaffLine){const e=o.parentMeasure.PositionAndShape.RelativePosition.x+o.PositionAndShape.RelativePosition.x+t.GraphicalLabel.PositionAndShape.RelativePosition.x+t.GraphicalLabel.PositionAndShape.BorderMarginRight,n=a.parentMeasure.PositionAndShape.RelativePosition.x+a.PositionAndShape.RelativePosition.x+t.GraphicalLabel.PositionAndShape.RelativePosition.x+i.GraphicalLabel.PositionAndShape.BorderMarginLeft,r=t.GraphicalLabel.PositionAndShape.RelativePosition.y;let c=1;n-e>3*this.rules.MinimumDistanceBetweenDashes&&(c=Math.floor((n-e)/this.rules.MinimumDistanceBetweenDashes)-1),1===c?this.calculateSingleDashForLyricWord(s,e,n,r):this.calculateDashes(s,e,n,r)}else{const e=o.parentMeasure.PositionAndShape.RelativePosition.x+o.PositionAndShape.RelativePosition.x+t.GraphicalLabel.PositionAndShape.BorderMarginRight,n=s.Measures[s.Measures.length-1],c=n.PositionAndShape.RelativePosition.x+n.PositionAndShape.Size.width;let l=t.GraphicalLabel.PositionAndShape.RelativePosition.y;if(this.calculateDashes(s,e,c,l),r&&r.Measures[0]&&a.parentMeasure.ParentStaffLine&&(a!==a.parentMeasure.staffEntries[0]||a.parentMeasure!==a.parentMeasure.ParentStaffLine.Measures[0])){const t=r.Measures[0].staffEntries[0].PositionAndShape.RelativePosition.x,e=a.parentMeasure.PositionAndShape.RelativePosition.x+a.PositionAndShape.RelativePosition.x+i.GraphicalLabel.PositionAndShape.BorderMarginLeft;l=i.GraphicalLabel.PositionAndShape.RelativePosition.y,this.calculateDashes(r,t,e,l)}}}calculateDashes(t,e,n,i){let s=n-e;if(s<3*this.rules.MinimumDistanceBetweenDashes)this.calculateSingleDashForLyricWord(t,e,n,i);else{const r=Math.floor(s/this.rules.MinimumDistanceBetweenDashes)-1,o=s/(r+1);let a=0;for(e+=o,n-=o;a<=Math.floor(r/2)&&n>e;)s=this.calculateRightAndLeftDashesForLyricWord(t,e,n,i),e+=o,n-=o,a++;s>2*o&&this.calculateSingleDashForLyricWord(t,e,n,i)}}calculateSingleDashForLyricWord(t,e,n,i){const s=new E.Label("-"),r=new f.GraphicalLabel(s,this.rules.LyricsHeight,p.TextAlignmentEnum.CenterBottom,this.rules);r.setLabelPositionAndShapeBorders(),t.LyricsDashes.push(r),-1===this.staffLinesWithLyricWords.indexOf(t)&&this.staffLinesWithLyricWords.push(t),r.PositionAndShape.Parent=t.PositionAndShape;const o=new h.PointF2D(e+(n-e)/2,i);r.PositionAndShape.RelativePosition=o}calculateLyricExtend(t){let e=t.GraphicalLabel.PositionAndShape.RelativePosition.y;const n=t.StaffEntryParent,i=n.parentMeasure.ParentStaffLine;let s=void 0,r=void 0;const o=n.parentMeasure.ParentStaff.idInMusicSheet;for(let a=n.parentVerticalContainer.Index+1;a0)break;s=t,r=s.parentMeasure.ParentStaffLine,r||(r=n.parentMeasure.ParentStaffLine)}}if(s&&r)if(i===r&&s.parentMeasure.ParentStaffLine){const r=n.parentMeasure.PositionAndShape.RelativePosition.x+n.PositionAndShape.RelativePosition.x+t.GraphicalLabel.PositionAndShape.BorderMarginRight,o=s.parentMeasure.PositionAndShape.RelativePosition.x+s.PositionAndShape.RelativePosition.x+s.PositionAndShape.BorderMarginRight;e-=t.GraphicalLabel.PositionAndShape.Size.height/4,this.calculateSingleLyricWordWithUnderscore(i,r,o,e)}else{const o=i.Measures[i.Measures.length-1].PositionAndShape,a=n.parentMeasure.PositionAndShape.RelativePosition.x+n.PositionAndShape.RelativePosition.x+t.GraphicalLabel.PositionAndShape.BorderMarginRight,c=o.RelativePosition.x+o.Size.width;if(e-=t.GraphicalLabel.PositionAndShape.Size.height/4,this.calculateSingleLyricWordWithUnderscore(i,a,c,e),!s)return;if(s.parentMeasure.ParentStaffLine&&s.parentMeasure.staffEntries&&(s!==s.parentMeasure.staffEntries[0]||s.parentMeasure!==s.parentMeasure.ParentStaffLine.Measures[0])){const t=r.Measures[0].staffEntries[0].PositionAndShape.RelativePosition.x,n=s.parentMeasure.PositionAndShape.RelativePosition.x+s.PositionAndShape.RelativePosition.x+s.PositionAndShape.BorderMarginRight;this.calculateSingleLyricWordWithUnderscore(r,t,n,e)}}}calculateSingleLyricWordWithUnderscore(t,e,n,i){const s=new h.PointF2D(e,i),r=new h.PointF2D(n,i),o=new w.GraphicalLine(s,r,this.rules.LyricUnderscoreLineWidth);t.LyricLines.push(o),-1===this.staffLinesWithLyricWords.indexOf(t)&&this.staffLinesWithLyricWords.push(t)}calculateRightAndLeftDashesForLyricWord(t,e,n,i){const s=new E.Label("-"),r=new f.GraphicalLabel(s,this.rules.LyricsHeight,p.TextAlignmentEnum.CenterBottom,this.rules);r.setLabelPositionAndShapeBorders(),t.LyricsDashes.push(r),-1===this.staffLinesWithLyricWords.indexOf(t)&&this.staffLinesWithLyricWords.push(t),r.PositionAndShape.Parent=t.PositionAndShape;const o=new h.PointF2D(e,i);r.PositionAndShape.RelativePosition=o;const a=new E.Label("-"),c=new f.GraphicalLabel(a,this.rules.LyricsHeight,p.TextAlignmentEnum.CenterBottom,this.rules);c.setLabelPositionAndShapeBorders(),t.LyricsDashes.push(c),c.PositionAndShape.Parent=t.PositionAndShape;const l=new h.PointF2D(n,i);return c.PositionAndShape.RelativePosition=l,c.PositionAndShape.RelativePosition.x-r.PositionAndShape.RelativePosition.x}calculateDynamicExpressions(){const t=Math.min(this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures.length-1,this.rules.MaxMeasureToDrawIndex);for(let e=Math.min(this.rules.MinMeasureToDrawIndex,this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures.length);e<=t;e++){const t=this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures[e];for(let n=0;n=0;i--)if(this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers[i].StaffEntries[e])return this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers[i].StaffEntries[e]}getFirstRightNotNullStaffEntryFromContainer(t,e,n){if(this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers[t].StaffEntries[e])return this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers[t].StaffEntries[e];for(let i=t+1;i0||e.StaffLinkedExpressions[n][i].UnknownList.length>0)&&this.calculateMoodAndUnknownExpression(e.StaffLinkedExpressions[n][i],t,n)}}calculateStemDirectionFromVoices(t){if(void 0!==t.ParentSourceStaffEntry.Link)return t===t.ParentSourceStaffEntry.VoiceEntries[0]?void(t.WantedStemDirection=l.StemDirectionType.Up):void(t.WantedStemDirection=l.StemDirectionType.Down);t.ParentVoice instanceof g.LinkedVoice?t.WantedStemDirection=l.StemDirectionType.Down:t.ParentSourceStaffEntry.VoiceEntries.length>1&&(t.WantedStemDirection=l.StemDirectionType.Up)}setBeamNotesWantedStemDirections(t){if(t.WantedStemDirection===l.StemDirectionType.Undefined&&t.Notes.length>0){const e=t.Notes[0].NoteBeam;if(e)for(const n of e.Notes)if(n.ParentVoiceEntry!==t&&n.ParentVoiceEntry.WantedStemDirection!==l.StemDirectionType.Undefined){t.WantedStemDirection=n.ParentVoiceEntry.WantedStemDirection;break}}}}e.MusicSheetCalculator=R},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.KeyEnum=e.NoteEnumToHalfToneLink=e.KeyInstruction=void 0;const i=n(45),s=n(2),r=n(2);class o extends i.AbstractNotationInstruction{constructor(t,e=0,n=a.major){super(t),this.Key=e,this.mode=n,this.alteratedNotes=this.calcAlteratedNotes()}static copy(t){return new o(t.parent,t.Key,t.Mode)}static getAllPossibleMajorKeyInstructions(){const t=[];for(let e=-7;e<7;e++){const n=new o(void 0,e,a.major);t.push(n)}return t}get Key(){return this.keyType}set Key(t){this.keyType=t,this.alteratedNotes=this.calcAlteratedNotes()}get Mode(){return this.mode}set Mode(t){this.mode=t}get AlteratedNotes(){return this.alteratedNotes}calcAlteratedNotes(){const t=[];if(this.keyType>0)for(let e=0;e=0}getAlterationForPitch(t){return this.keyType>0&&this.alteratedNotes.indexOf(t.FundamentalNote)<=this.keyType?r.AccidentalEnum.SHARP:this.keyType<0&&this.alteratedNotes.indexOf(t.FundamentalNote)<=Math.abs(this.keyType)?r.AccidentalEnum.FLAT:r.AccidentalEnum.NONE}ToString(){return"Key: "+this.keyType+this.mode}OperatorEquals(t){return this===t||!(!this||!t)&&this.Key===t.Key&&this.Mode===t.Mode}OperatorNotEqual(t){return!this.OperatorEquals(t)}}var a;e.KeyInstruction=o,o.sharpPositionList=[s.NoteEnum.F,s.NoteEnum.C,s.NoteEnum.G,s.NoteEnum.D,s.NoteEnum.A,s.NoteEnum.E,s.NoteEnum.B],o.flatPositionList=[s.NoteEnum.B,s.NoteEnum.E,s.NoteEnum.A,s.NoteEnum.D,s.NoteEnum.G,s.NoteEnum.C,s.NoteEnum.F],e.NoteEnumToHalfToneLink=class{constructor(t,e){this.note=t,this.halfTone=e}},function(t){t[t.major=0]="major",t[t.minor=1]="minor",t[t.none=2]="none",t[t.dorian=3]="dorian",t[t.phrygian=4]="phrygian",t[t.lydian=5]="lydian",t[t.mixolydian=6]="mixolydian",t[t.aeolian=7]="aeolian",t[t.ionian=8]="ionian",t[t.locrian=9]="locrian"}(a=e.KeyEnum||(e.KeyEnum={}))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.RhythmSymbolEnum=e.RhythmInstruction=void 0;const i=n(45);class s extends i.AbstractNotationInstruction{constructor(t,e){super(void 0),this.rhythm=t,this.numerator=t.Numerator,this.denominator=t.Denominator,this.symbolEnum=e}get Rhythm(){return this.rhythm}set Rhythm(t){this.rhythm=t}get SymbolEnum(){return this.symbolEnum}set SymbolEnum(t){this.symbolEnum=t}clone(){return new s(this.rhythm.clone(),this.symbolEnum)}OperatorEquals(t){return this===t||!(!this||!t)&&this.numerator===t.numerator&&this.denominator===t.denominator}OperatorNotEqual(t){return!(this===t)}ToString(){return"Rhythm: "+this.rhythm.toString()}}e.RhythmInstruction=s,function(t){t[t.NONE=0]="NONE",t[t.COMMON=1]="COMMON",t[t.CUT=2]="CUT"}(e.RhythmSymbolEnum||(e.RhythmSymbolEnum={}))},function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.VexFlowMusicSheetDrawer=e.unitInPixels=void 0;const s=i(n(9)),r=n(102),o=n(50),a=n(5),c=n(64),l=n(22),u=n(3),h=n(58),d=n(65),f=i(n(1)),p=n(48),m=n(33),g=n(86);e.unitInPixels=10;class b extends r.MusicSheetDrawer{constructor(t=new m.DrawingParameters){super(new c.VexFlowTextMeasurer(t.Rules),t),this.backends=[],this.zoom=1,this.pageIdx=0}get Backends(){return this.backends}drawSheet(t){var n,i,r;"gonville"===this.rules.DefaultVexFlowNoteFont&&(s.default.Flow.DEFAULT_FONT_STACK=[null===(n=s.default.Flow.Fonts)||void 0===n?void 0:n.Gonville,null===(i=s.default.Flow.Fonts)||void 0===i?void 0:i.Bravura,null===(r=s.default.Flow.Fonts)||void 0===r?void 0:r.Custom]),s.default.Flow.STAVE_LINE_THICKNESS=this.rules.StaffLineWidth*e.unitInPixels,s.default.Flow.STEM_WIDTH=this.rules.StemWidth*e.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 e of t.MusicPages){const t=this.backends[this.pageIdx];t.graphicalMusicPage=e,t.scale(this.zoom),this.pageIdx+=1}this.pageIdx=0,this.backend=this.backends[0],super.drawSheet(t)}drawPage(t){this.backend=this.backends[t.PageNumber-1],super.drawPage(t),this.pageIdx+=1,this.backend=this.backends[this.pageIdx]}clear(){for(const t of this.backends)t.clear()}setZoom(t){this.zoom=t}calculatePixelDistance(t){return t*e.unitInPixels}drawStaffLine(t){super.drawStaffLine(t);const e=t.PositionAndShape.AbsolutePosition;this.rules.RenderSlurs&&this.drawSlurs(t,e)}drawSlurs(t,e){for(const n of t.GraphicalSlurs)n.slur.isCrossed()||this.drawSlur(n,e)}drawSlur(t,e){const n=[],i=new a.PointF2D(t.bezierStartPt.x+e.x,t.bezierStartPt.y+e.y),s=new a.PointF2D(t.bezierStartControlPt.x+e.x,t.bezierStartControlPt.y+e.y),r=new a.PointF2D(t.bezierEndControlPt.x+e.x,t.bezierEndControlPt.y+e.y),o=new a.PointF2D(t.bezierEndPt.x+e.x,t.bezierEndPt.y+e.y);n.push(this.applyScreenTransformation(i)),n.push(this.applyScreenTransformation(s)),n.push(this.applyScreenTransformation(r)),n.push(this.applyScreenTransformation(o)),t.placement===u.PlacementEnum.Above?(i.y-=.05,s.y-=.3,r.y-=.3,o.y-=.05):(i.y+=.05,s.y+=.3,r.y+=.3,o.y+=.05),n.push(this.applyScreenTransformation(i)),n.push(this.applyScreenTransformation(s)),n.push(this.applyScreenTransformation(r)),n.push(this.applyScreenTransformation(o)),this.backend.renderCurve(n)}drawMeasure(t){t.setAbsoluteCoordinates(t.PositionAndShape.AbsolutePosition.x*e.unitInPixels,t.PositionAndShape.AbsolutePosition.y*e.unitInPixels);try{t.draw(this.backend.getContext())}catch(t){f.default.warn("VexFlowMusicSheetDrawer.drawMeasure",t)}for(const e of t.staffEntries)this.drawStaffEntry(e)}drawLine(t,n,i="#FF0000FF",s=.2){t=this.applyScreenTransformation(t),n=this.applyScreenTransformation(n),this.backend.renderLine(t,n,i,s*e.unitInPixels)}DrawOverlayLine(t,n,i,s="#FF0000FF",r=.2){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 o=i.PageNumber-1,a=this.backends[o];t=this.applyScreenTransformation(t),n=this.applyScreenTransformation(n),a.renderLine(t,n,s,r*e.unitInPixels)}drawSkyLine(t){const e=t.PositionAndShape.AbsolutePosition,n=t.PositionAndShape.Size.width;this.drawSampledLine(t.SkyLine,e,n)}drawBottomLine(t){const e=new a.PointF2D(t.PositionAndShape.AbsolutePosition.x,t.PositionAndShape.AbsolutePosition.y),n=t.PositionAndShape.Size.width;this.drawSampledLine(t.BottomLine,e,n,"#0000FFFF")}drawSampledLine(t,e,n,i="#FF0000FF"){const s=[];let r=0;for(let a=0;a0){const e=this.rules.SamplingUnit;let r,c,l=new a.PointF2D(o.x,o.y),u=new a.PointF2D(s[0]/e+o.x,o.y);this.drawLine(l,u,i),t[0]>=0&&(r=new a.PointF2D(s[0]/e+o.x,o.y),c=new a.PointF2D(s[0]/e+o.x,o.y+t[s[0]]),this.drawLine(r,c,i));for(let n=1;n0)for(const e of t.graphicalChordContainers)this.drawLabel(e.GetGraphicalLabel,l.GraphicalLayers.Notes);this.rules.RenderLyrics&&t.LyricsEntries.length>0&&this.drawLyrics(t.LyricsEntries,l.GraphicalLayers.Notes)}drawLyrics(t,e){t.forEach(t=>this.drawLabel(t.GraphicalLabel,e))}drawInstrumentBrace(t,e){t.draw(this.backend.getContext())}drawGroupBracket(t,e){t.draw(this.backend.getContext())}drawOctaveShifts(t){for(const e of t.OctaveShifts)if(e){const t=e,n=this.backend.getContext(),i=t.getTextBracket();i.setContext(n),i.draw()}}drawExpressions(t){for(const e of t.AbstractExpressions)e instanceof d.GraphicalInstantaneousDynamicExpression?this.drawInstantaneousDynamic(e):e instanceof h.GraphicalInstantaneousTempoExpression?this.drawLabel(e.GraphicalLabel,l.GraphicalLayers.Notes):e instanceof p.GraphicalContinuousDynamicExpression?this.drawContinuousDynamic(e):e instanceof g.GraphicalUnknownExpression?this.drawLabel(e.Label,l.GraphicalLayers.Notes):f.default.warn("Unkown type of expression!")}drawInstantaneousDynamic(t){this.drawLabel(t.Label,l.GraphicalLayers.Notes)}drawContinuousDynamic(t){if(t.IsVerbal)this.drawLabel(t.Label,l.GraphicalLayers.Notes);else for(const e of t.Lines){const n=new a.PointF2D(t.ParentStaffLine.PositionAndShape.AbsolutePosition.x+e.Start.x,t.ParentStaffLine.PositionAndShape.AbsolutePosition.y+e.Start.y),i=new a.PointF2D(t.ParentStaffLine.PositionAndShape.AbsolutePosition.x+e.End.x,t.ParentStaffLine.PositionAndShape.AbsolutePosition.y+e.End.y);this.drawLine(n,i,"black",e.Width)}}renderLabel(t,n,i,s,r,o){var c;if(!t.Label.print)return;const l=t.Label.fontHeight*e.unitInPixels,{font:u}=t.Label;let h;this.rules.ColoringEnabled&&(h=t.Label.colorDefault,h||(h=this.rules.DefaultColorLabel));let{fontStyle:d,fontFamily:f}=t.Label;d||(d=this.rules.DefaultFontStyle),f||(f=this.rules.DefaultFontFamily);for(let e=0;e<(null===(c=t.TextLines)||void 0===c?void 0:c.length);e++){const n=t.TextLines[e],i=this.calculatePixelDistance(n.xOffset),s=new a.PointF2D(o.x+i,o.y);this.backend.renderText(l,d,u,n.text,r,s,h,t.Label.fontFamily),o.y=o.y+r,t.TextLines.length>1&&(o.y+=this.rules.SpacingBetweenTextLines)}}renderRectangle(t,e,n,i){this.backend.renderRectangle(t,n,i)}applyScreenTransformation(t){return new a.PointF2D(t.x*e.unitInPixels,t.y*e.unitInPixels)}applyScreenTransformationForRect(t){return new o.RectangleF2D(t.x*e.unitInPixels,t.y*e.unitInPixels,t.width*e.unitInPixels,t.height*e.unitInPixels)}}e.VexFlowMusicSheetDrawer=b},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(35);e.arrays=i;var s=n(144);e.Bag=s.default;var r=n(145);e.BSTree=r.default;var o=n(80);e.BSTreeKV=o.default;var a=n(29);e.Dictionary=a.default;var c=n(82);e.Heap=c.default;var l=n(146);e.LinkedDictionary=l.default;var u=n(51);e.LinkedList=u.default;var h=n(147);e.MultiDictionary=h.default;var d=n(83);e.FactoryDictionary=d.default;var f=n(83);e.DefaultDictionary=f.default;var p=n(81);e.Queue=p.default;var m=n(148);e.PriorityQueue=m.default;var g=n(79);e.Set=g.default;var b=n(149);e.Stack=b.default;var v=n(150);e.MultiRootTree=v.default;var y=n(10);e.util=y},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FontStyles=void 0,function(t){t[t.Regular=0]="Regular",t[t.Bold=1]="Bold",t[t.Italic=2]="Italic",t[t.BoldItalic=3]="BoldItalic",t[t.Underlined=4]="Underlined"}(e.FontStyles||(e.FontStyles={}))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ITextTranslation=void 0,e.ITextTranslation=class{static translateText(t,e){if(!this.defaultTextTranslation)return e}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AutoColorSet=e.NoteState=e.GraphicalLayers=e.StyleSets=e.OUTLINE_AND_FILL_STYLE_DICT=e.OutlineAndFillStyleEnum=void 0;const i=n(19);var s;!function(t){t[t.BaseWritingColor=0]="BaseWritingColor",t[t.FollowingCursor=1]="FollowingCursor",t[t.AlternativeFollowingCursor=2]="AlternativeFollowingCursor",t[t.PlaybackCursor=3]="PlaybackCursor",t[t.Highlighted=4]="Highlighted",t[t.ErrorUnderlay=5]="ErrorUnderlay",t[t.Selected=6]="Selected",t[t.SelectionSymbol=7]="SelectionSymbol",t[t.DebugColor1=8]="DebugColor1",t[t.DebugColor2=9]="DebugColor2",t[t.DebugColor3=10]="DebugColor3",t[t.SplitScreenDivision=11]="SplitScreenDivision",t[t.GreyTransparentOverlay=12]="GreyTransparentOverlay",t[t.MarkedArea1=13]="MarkedArea1",t[t.MarkedArea2=14]="MarkedArea2",t[t.MarkedArea3=15]="MarkedArea3",t[t.MarkedArea4=16]="MarkedArea4",t[t.MarkedArea5=17]="MarkedArea5",t[t.MarkedArea6=18]="MarkedArea6",t[t.MarkedArea7=19]="MarkedArea7",t[t.MarkedArea8=20]="MarkedArea8",t[t.MarkedArea9=21]="MarkedArea9",t[t.MarkedArea10=22]="MarkedArea10",t[t.Comment1=23]="Comment1",t[t.Comment2=24]="Comment2",t[t.Comment3=25]="Comment3",t[t.Comment4=26]="Comment4",t[t.Comment5=27]="Comment5",t[t.Comment6=28]="Comment6",t[t.Comment7=29]="Comment7",t[t.Comment8=30]="Comment8",t[t.Comment9=31]="Comment9",t[t.Comment10=32]="Comment10"}(s=e.OutlineAndFillStyleEnum||(e.OutlineAndFillStyleEnum={})),e.OUTLINE_AND_FILL_STYLE_DICT=new i.Dictionary,e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.BaseWritingColor,"Thistle"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.FollowingCursor,"Aqua"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.AlternativeFollowingCursor,"Azure"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.PlaybackCursor,"Bisque"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.Highlighted,"CadetBlue"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.ErrorUnderlay,"DarkBlue"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.Selected,"DarkGoldenRod"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.SelectionSymbol,"BlanchedAlmond"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.DebugColor1,"Chartreuse"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.DebugColor2,"DarkGreen"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.DebugColor3,"DarkOrange"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.SplitScreenDivision,"FireBrick"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.GreyTransparentOverlay,"DarkSalmon"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.MarkedArea1,"DarkSeaGreen"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.MarkedArea2,"DarkOrchid"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.MarkedArea3,"Aquamarine"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.MarkedArea4,"DarkKhaki"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.MarkedArea5,"ForestGreen"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.MarkedArea6,"AliceBlue"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.MarkedArea7,"DeepPink"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.MarkedArea8,"Coral"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.MarkedArea9,"DarkOliveGreen"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.MarkedArea10,"Chocolate"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.Comment1,"DodgerBlue"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.Comment2,"Blue"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.Comment3,"Beige"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.Comment4,"Crimson"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.Comment5,"Fuchsia"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.Comment6,"Brown"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.Comment7,"BlanchedAlmond"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.Comment8,"CornflowerBlue"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.Comment9,"Cornsilk"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.Comment10,"DarkGrey"),function(t){t[t.MarkedArea=0]="MarkedArea",t[t.Comment=1]="Comment"}(e.StyleSets||(e.StyleSets={})),function(t){t[t.Background=0]="Background",t[t.Highlight=1]="Highlight",t[t.MeasureError=2]="MeasureError",t[t.SelectionSymbol=3]="SelectionSymbol",t[t.Cursor=4]="Cursor",t[t.PSI_Debug=5]="PSI_Debug",t[t.Notes=6]="Notes",t[t.Comment=7]="Comment",t[t.Debug_above=8]="Debug_above"}(e.GraphicalLayers||(e.GraphicalLayers={})),function(t){t[t.Normal=0]="Normal",t[t.Selected=1]="Selected",t[t.Follow_Confirmed=2]="Follow_Confirmed",t[t.QFeedback_NotFound=3]="QFeedback_NotFound",t[t.QFeedback_OK=4]="QFeedback_OK",t[t.QFeedback_Perfect=5]="QFeedback_Perfect",t[t.Debug1=6]="Debug1",t[t.Debug2=7]="Debug2",t[t.Debug3=8]="Debug3"}(e.NoteState||(e.NoteState={})),function(t){t.C="#d82c6b",t.D="#F89D15",t.E="#FFE21A",t.F="#4dbd5c",t.G="#009D96",t.A="#43469d",t.B="#76429c",t.Rest="#000000"}(e.AutoColorSet||(e.AutoColorSet={}))},function(t,e,n){"use strict";var i;Object.defineProperty(e,"__esModule",{value:!0}),e.SystemLinesEnumHelper=e.SystemLinesEnum=void 0,function(t){t[t.SingleThin=0]="SingleThin",t[t.DoubleThin=1]="DoubleThin",t[t.ThinBold=2]="ThinBold",t[t.BoldThinDots=3]="BoldThinDots",t[t.DotsThinBold=4]="DotsThinBold",t[t.DotsBoldBoldDots=5]="DotsBoldBoldDots",t[t.None=6]="None",t[t.Dotted=7]="Dotted",t[t.Dashed=8]="Dashed",t[t.Bold=9]="Bold",t[t.BoldThin=10]="BoldThin",t[t.DoubleBold=11]="DoubleBold",t[t.Tick=12]="Tick",t[t.Short=13]="Short"}(i=e.SystemLinesEnum||(e.SystemLinesEnum={})),e.SystemLinesEnumHelper=class{static xmlBarlineStyleToSystemLinesEnum(t){return"regular"===t?i.SingleThin:"dotted"===t?i.Dotted:"dashed"===t?i.Dashed:"heavy"===t?i.Bold:"light-light"===t?i.DoubleThin:"light-heavy"===t?i.ThinBold:"heavy-light"===t?i.BoldThin:"heavy-heavy"===t?i.DoubleBold:"tick"===t?i.Tick:"short"===t?i.Short:"none"===t?i.None:i.SingleThin}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GraphicalLabel=void 0;const i=n(8),s=n(4),r=n(93),o=n(15);class a extends r.Clickable{constructor(t,e,n,i,r){super(),this.label=t,this.boundingBox=new s.BoundingBox(this,r),this.label.fontHeight=e,this.label.textAlignment=n,this.rules=i}get Label(){return this.label}toString(){return`${this.label.text} (${this.boundingBox.RelativePosition.x},${this.boundingBox.RelativePosition.y})`}setLabelPositionAndShapeBorders(){var t,e;if(""===this.Label.text.trim())return;this.TextLines=[];const n=null!==(e=null===(t=this.rules)||void 0===t?void 0:t.LabelMarginBorderFactor)&&void 0!==e?e:.1,s=this.Label.text.split(/[\n\r]+/g),r=s.length;let a=0;for(let i=0;i0&&this.TextLines.length>1&&(c+=this.rules.SpacingBetweenTextLines*r/10);const l=this.PositionAndShape;switch(this.Label.textAlignment){case i.TextAlignmentEnum.CenterBottom:l.BorderTop=-c,l.BorderLeft=-a/2,l.BorderBottom=0,l.BorderRight=a/2;break;case i.TextAlignmentEnum.CenterCenter:l.BorderTop=-c/2,l.BorderLeft=-a/2,l.BorderBottom=c/2,l.BorderRight=a/2;break;case i.TextAlignmentEnum.CenterTop:l.BorderTop=0,l.BorderLeft=-a/2,l.BorderBottom=c,l.BorderRight=a/2;break;case i.TextAlignmentEnum.LeftBottom:l.BorderTop=-c,l.BorderLeft=0,l.BorderBottom=0,l.BorderRight=a;break;case i.TextAlignmentEnum.LeftCenter:l.BorderTop=-c/2,l.BorderLeft=0,l.BorderBottom=c/2,l.BorderRight=a;break;case i.TextAlignmentEnum.LeftTop:l.BorderTop=0,l.BorderLeft=0,l.BorderBottom=c,l.BorderRight=a;break;case i.TextAlignmentEnum.RightBottom:l.BorderTop=-c,l.BorderLeft=-a,l.BorderBottom=0,l.BorderRight=0;break;case i.TextAlignmentEnum.RightCenter:l.BorderTop=-c/2,l.BorderLeft=-a,l.BorderBottom=c/2,l.BorderRight=0;break;case i.TextAlignmentEnum.RightTop:l.BorderTop=0,l.BorderLeft=-a,l.BorderBottom=c,l.BorderRight=0}l.BorderMarginTop=l.BorderTop-c*n,l.BorderMarginLeft=l.BorderLeft-c*n,l.BorderMarginBottom=l.BorderBottom+c*n,l.BorderMarginRight=l.BorderRight+c*n}}e.GraphicalLabel=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.OSMDOptions=e.BackendType=e.FillEmptyMeasuresWithWholeRests=e.AlignRestOption=void 0;const i=n(33);var s;!function(t){t[t.Never=0]="Never",t[t.Always=1]="Always",t[t.Auto=2]="Auto"}(e.AlignRestOption||(e.AlignRestOption={})),function(t){t[t.No=0]="No",t[t.YesVisible=1]="YesVisible",t[t.YesInvisible=2]="YesInvisible"}(e.FillEmptyMeasuresWithWholeRests||(e.FillEmptyMeasuresWithWholeRests={})),function(t){t[t.SVG=0]="SVG",t[t.Canvas=1]="Canvas"}(s=e.BackendType||(e.BackendType={})),e.OSMDOptions=class{static OSMDOptionsStandard(){return{autoResize:!0,backend:"svg",drawingParameters:i.DrawingParametersEnum.default}}static BackendTypeFromString(t){return t&&"canvas"===t.toLowerCase()?s.Canvas:s.SVG}}},function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.PageFormat=e.EngravingRules=void 0;const s=n(43),r=i(n(1)),o=n(8),a=n(3),c=n(25),l=n(33),u=n(19),h=n(56),d=n(44);class f{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.SamplingUnit=3*f.unit,this.SheetTitleHeight=4,this.SheetSubtitleHeight=2,this.SheetMinimumDistanceBetweenTitleAndSubtitle=1,this.SheetComposerHeight=2,this.SheetAuthorHeight=2,this.CompactMode=!1,this.PagePlacementEnum=s.PagePlacementEnum.Down,this.PageHeight=100001,this.PageTopMargin=5,this.PageTopMarginNarrow=0,this.PageBottomMargin=5,this.PageBottomExtraWhiteSpace=0,this.PageLeftMargin=5,this.PageRightMargin=5,this.TitleTopDistance=9,this.TitleBottomDistance=1,this.StaffDistance=7,this.BetweenStaffDistance=5,this.MinimumStaffLineDistance=4,this.MinSkyBottomDistBetweenStaves=1,this.StaffHeight=4,this.TabStaffInterlineHeight=1.1111,this.BetweenStaffLinesDistance=f.unit,this.SystemLeftMargin=0,this.SystemRightMargin=0,this.SystemLabelsRightMargin=2,this.SystemComposerDistance=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.BeamWidth=f.unit/2,this.BeamSpaceWidth=f.unit/3,this.BeamForwardLength=1.25*f.unit,this.ClefLeftMargin=.5,this.ClefRightMargin=.75,this.PercussionOneLineCutoff=3,this.PercussionForceVoicesOneLineCutoff=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.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.DistanceBetweenAdjacentDynamics=.75,this.TempoChangeMeasureValidity=4,this.TempoContinousFactor=.7,this.StaccatoScalingFactor=.8,this.BetweenDotsDistance=.8,this.OrnamentAccidentalScalingFactor=.65,this.ChordSymbolTextHeight=2,this.ChordSymbolXSpacing=1,this.ChordSymbolYOffset=2,this.ChordSymbolLabelTexts=new u.Dictionary,this.resetChordSymbolLabelTexts(this.ChordSymbolLabelTexts),this.MeasureNumberLabelHeight=1.5*f.unit,this.MeasureNumberLabelOffset=2,this.MeasureNumberLabelXOffset=-.5,this.TupletsRatioed=!1,this.TupletsBracketed=!1,this.TripletsBracketed=!1,this.TupletNumberLabelHeight=1.5*f.unit,this.TupletNumberYOffset=.5,this.LabelMarginBorderFactor=.1,this.TupletVerticalLineLength=.5,this.TupletNumbersInTabs=!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.SlurStemXOffset=.3,this.SlurSlopeMaxAngle=15,this.SlurTangentMinAngle=30,this.SlurTangentMaxAngle=80,this.SlursStartingAtSameStaffEntryYOffset=.8,this.RepetitionEndingLabelHeight=2,this.RepetitionEndingLabelXOffset=.5,this.RepetitionEndingLabelYOffset=.3,this.RepetitionEndingLineYLowerOffset=.5,this.RepetitionEndingLineYUpperOffset=.3,this.VoltaOffset=2.5,this.LyricsAlignmentStandard=o.TextAlignmentEnum.LeftBottom,this.LyricsHeight=2,this.LyricsYOffsetToStaffHeight=0,this.VerticalBetweenLyricsDistance=.5,this.HorizontalBetweenLyricsDistance=.2,this.BetweenSyllableMaximumDistance=10,this.BetweenSyllableMinimumDistance=.5,this.LyricOverlapAllowedIntoNextMeasure=3.4,this.MinimumDistanceBetweenDashes=10,this.MaximumLyricsElongationFactor=2.5,this.InstantaneousTempoTextHeight=2.3,this.ContinuousDynamicTextHeight=2.3,this.MoodTextHeight=2.3,this.UnknownTextHeight=2,this.ContinuousTempoTextHeight=2.3,this.DynamicExpressionMaxDistance=2,this.DynamicExpressionSpacer=.5,this.VexFlowDefaultNotationFontScale=39,this.VexFlowDefaultTabFontScale=39,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=f.unit/2,this.SystemRepetitionEndingLineWidth=.12,this.SystemDotWidth=f.unit/5,this.DistanceBetweenVerticalSystemLines=.35,this.DistanceBetweenDotAndLine=.7,this.OctaveShiftLineWidth=.12,this.OctaveShiftVerticalLineLength=f.unit,this.GraceLineWidth=this.StaffLineWidth*this.GraceNoteScalingFactor,this.MultipleRestMeasureDefaultWidth=4,this.MinimumCrossedBeamDifferenceMargin=1e-4,this.VoiceSpacingMultiplierVexflow=.85,this.VoiceSpacingAddendVexflow=3,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=-.5,this.SoftmaxFactorVexFlow=15,this.AlignRests=c.AlignRestOption.Never,this.FillEmptyMeasuresWithWholeRest=c.FillEmptyMeasuresWithWholeRests.No,this.ArpeggiosGoAcrossVoices=!1,this.RenderArpeggios=!0,this.RenderSlurs=!0,this.ColoringMode=l.ColoringModes.XML,this.ColoringEnabled=!0,this.ColorStemsLikeNoteheads=!1,this.ColorBeams=!0,this.ColorFlags=!0,this.DefaultColorNotehead="#000000",this.DefaultColorRest=this.DefaultColorNotehead,this.DefaultColorStem=this.DefaultColorNotehead,this.DefaultColorLabel=this.DefaultColorNotehead,this.DefaultColorTitle=this.DefaultColorNotehead,this.DefaultFontFamily="Times New Roman",this.DefaultFontStyle=h.FontStyles.Regular,this.DefaultVexFlowNoteFont="gonville",this.MaxMeasureToDrawIndex=Number.MAX_VALUE,this.MinMeasureToDrawIndex=0,this.RenderComposer=!0,this.RenderTitle=!0,this.RenderSubtitle=!0,this.RenderLyricist=!0,this.RenderPartNames=!0,this.RenderPartAbbreviations=!0,this.RenderFingerings=!0,this.RenderMeasureNumbers=!0,this.RenderMeasureNumbersOnlyAtSystemStart=!1,this.RenderLyrics=!0,this.RenderMultipleRestMeasures=!0,this.AutoGenerateMutipleRestMeasuresFromRestMeasures=!0,this.RenderTimeSignatures=!0,this.FingeringPosition=a.PlacementEnum.Left,this.FingeringInsideStafflines=!1,this.FingeringLabelFontHeight=1.7,this.FingeringOffsetX=0,this.NewSystemAtXMLNewSystemAttribute=!1,this.NewPageAtXMLNewPageAttribute=!1,this.RestoreCursorAfterRerender=!0,this.StretchLastSystemLine=!1,f.FixStafflineBoundingBox=!1,this.PageFormat=p.UndefinedPageFormat,this.PageBackgroundColor=void 0,this.RenderSingleHorizontalStaffline=!1,this.SpacingBetweenTextLines=0,this.populateDictionaries();try{this.MaxInstructionsConstValue=this.ClefLeftMargin+this.ClefRightMargin+this.KeyRightMargin+this.RhythmRightMargin+11}catch(t){r.default.info("EngravingRules()",t)}}setChordSymbolLabelText(t,e){this.ChordSymbolLabelTexts.setValue(t,e)}resetChordSymbolLabelTexts(t){return t.setValue(d.ChordSymbolEnum.minor,"m"),t.setValue(d.ChordSymbolEnum.augmented,"aug"),t.setValue(d.ChordSymbolEnum.diminished,"dim"),t.setValue(d.ChordSymbolEnum.dominant,"7"),t.setValue(d.ChordSymbolEnum.majorseventh,"maj7"),t.setValue(d.ChordSymbolEnum.minorseventh,"m7"),t.setValue(d.ChordSymbolEnum.diminishedseventh,"dim7"),t.setValue(d.ChordSymbolEnum.augmentedseventh,"aug7"),t.setValue(d.ChordSymbolEnum.halfdiminished,"m7b5"),t.setValue(d.ChordSymbolEnum.majorminor,"m(maj7)"),t.setValue(d.ChordSymbolEnum.majorsixth,"maj6"),t.setValue(d.ChordSymbolEnum.minorsixth,"m6"),t.setValue(d.ChordSymbolEnum.dominantninth,"9"),t.setValue(d.ChordSymbolEnum.majorninth,"maj9"),t.setValue(d.ChordSymbolEnum.minorninth,"m9"),t.setValue(d.ChordSymbolEnum.dominant11th,"11"),t.setValue(d.ChordSymbolEnum.major11th,"maj11"),t.setValue(d.ChordSymbolEnum.minor11th,"m11"),t.setValue(d.ChordSymbolEnum.dominant13th,"13"),t.setValue(d.ChordSymbolEnum.major13th,"maj13"),t.setValue(d.ChordSymbolEnum.minor13th,"m13"),t.setValue(d.ChordSymbolEnum.suspendedsecond,"sus2"),t.setValue(d.ChordSymbolEnum.suspendedfourth,"sus4"),t.setValue(d.ChordSymbolEnum.power,"5"),t}populateDictionaries(){for(let t=0;te.parentRepetition.StartIndex)return-1}if(t.alignment===s.Begin&&e.alignment===s.Begin){if(t.parentRepetition.EndIndexe.parentRepetition.EndIndex)return-1}}return 0}},e.RepetitionInstruction=class{constructor(t,e,n=s.End,i,r){this.endingIndices=void 0,this.measureIndex=t,r&&(this.endingIndices=r.slice()),this.type=e,this.alignment=n,this.parentRepetition=i}CompareTo(t){const e=t;if(this.measureIndex>e.measureIndex)return 1;if(this.measureIndex0)return!0;return!1}hasTie(){for(let t=0,e=this.VoiceEntries.length;t=0;r--)if(s(t[r],e))return r;return-1},e.contains=function(t,e,n){return s(t,e,n)>=0},e.remove=function(t,e,n){var i=s(t,e,n);return!(i<0)&&(t.splice(i,1),!0)},e.frequency=function(t,e,n){for(var s=n||i.defaultEquals,r=t.length,o=0,a=0;a=t.length||n<0||n>=t.length)return!1;var i=t[e];return t[e]=t[n],t[n]=i,!0},e.toString=function(t){return"["+t.toString()+"]"},e.forEach=function(t,e){for(var n=0,i=t;n0}get NotToBeRemoved(){return this.notToBeRemoved}set NotToBeRemoved(t){this.notToBeRemoved=t}get Lines(){return this.lines}get ContinuousDynamic(){return this.SourceExpression}updateSkyBottomLine(){var t;const e=this.parentStaffLine.SkyBottomLineCalculator,n=this.IsVerbal?this.label.PositionAndShape.RelativePosition.x+this.label.PositionAndShape.BorderMarginLeft:0,i=this.IsVerbal?this.label.PositionAndShape.RelativePosition.x+this.label.PositionAndShape.BorderMarginRight:0;switch(!this.IsVerbal&&this.lines.length<2&&l.default.warn("Not enough lines for SkyBottomLine calculation"),this.IsVerbal||this.ContinuousDynamic.DynamicType!==r.ContDynamicEnum.crescendo&&this.ContinuousDynamic.DynamicType!==r.ContDynamicEnum.diminuendo&&l.default.warn("GraphicalContinuousDynamicExpression.updateSkyBottomLine(): unhandled continuous dynamic type. start measure: "+(null===(t=this.startMeasure)||void 0===t?void 0:t.MeasureNumber)),this.Placement){case c.PlacementEnum.Above:if(this.IsVerbal){const t=this.label.PositionAndShape.BorderMarginTop+this.label.PositionAndShape.RelativePosition.y;e.updateSkyLineInRange(n,i,t)}else this.ContinuousDynamic.DynamicType===r.ContDynamicEnum.crescendo?e.updateSkyLineWithWedge(this.lines[0].Start,this.lines[0].End):this.ContinuousDynamic.DynamicType===r.ContDynamicEnum.diminuendo&&e.updateSkyLineWithWedge(this.lines[0].End,this.lines[0].Start);break;case c.PlacementEnum.Below:if(this.IsVerbal){const t=this.label.PositionAndShape.BorderMarginBottom+this.label.PositionAndShape.RelativePosition.y;e.updateBottomLineInRange(n,i,t)}else this.ContinuousDynamic.DynamicType===r.ContDynamicEnum.crescendo?e.updateBottomLineWithWedge(this.lines[1].Start,this.lines[1].End):this.ContinuousDynamic.DynamicType===r.ContDynamicEnum.diminuendo&&e.updateBottomLineWithWedge(this.lines[1].End,this.lines[1].Start);break;default:l.default.error("Placement for GraphicalContinuousDynamicExpression is unknown")}}createCrescendoLines(t,e,n,i=this.rules.WedgeOpeningLength,s=this.rules.WedgeLineWidth){const r=new o.PointF2D(t,n),a=new o.PointF2D(e,n-i/2),c=new o.PointF2D(e,n+i/2);this.addWedgeLines(r,a,c,s)}createFirstHalfCrescendoLines(t,e,n,i=this.rules.WedgeMeasureEndOpeningLength,s=this.rules.WedgeLineWidth){const r=new o.PointF2D(t,n),a=new o.PointF2D(e,n-i/2),c=new o.PointF2D(e,n+i/2);this.addWedgeLines(r,a,c,s)}createSecondHalfCrescendoLines(t,e,n,i=this.rules.WedgeMeasureBeginOpeningLength,s=this.rules.WedgeOpeningLength,r=this.rules.WedgeLineWidth){const a=new o.PointF2D(t,n-i/2),c=new o.PointF2D(t,n+i/2),l=new o.PointF2D(e,n-s/2),u=new o.PointF2D(e,n+s/2);this.addDoubleLines(a,l,c,u,r)}recalculateCrescendoLines(t,e,n){const i=Math.abs(this.lines[0].Start.y-this.lines[1].Start.y)>1e-4;this.lines.clear(),i?this.createSecondHalfCrescendoLines(t,e,n):this.isSplittedPart?this.createFirstHalfCrescendoLines(t,e,n):this.createCrescendoLines(t,e,n)}createDiminuendoLines(t,e,n,i=this.rules.WedgeOpeningLength,s=this.rules.WedgeLineWidth){const r=new o.PointF2D(t,n-i/2),a=new o.PointF2D(t,n+i/2),c=new o.PointF2D(e,n);this.addWedgeLines(c,r,a,s)}createFirstHalfDiminuendoLines(t,e,n,i=this.rules.WedgeOpeningLength,s=this.rules.WedgeMeasureEndOpeningLength,r=this.rules.WedgeLineWidth){const a=new o.PointF2D(t,n-i/2),c=new o.PointF2D(t,n+i/2),l=new o.PointF2D(e,n-s/2),u=new o.PointF2D(e,n+s/2);this.addDoubleLines(a,l,c,u,r)}createSecondHalfDiminuendoLines(t,e,n,i=this.rules.WedgeMeasureBeginOpeningLength,s=this.rules.WedgeLineWidth){const r=new o.PointF2D(t,n-i/2),a=new o.PointF2D(t,n+i/2),c=new o.PointF2D(e,n);this.addWedgeLines(c,r,a,s)}recalculateDiminuendoLines(t,e,n){const i=Math.abs(this.lines[0].End.y-this.lines[1].End.y)>1e-4;this.lines.clear(),i?this.createFirstHalfDiminuendoLines(t,e,n):this.isSplittedPart?this.createSecondHalfDiminuendoLines(t,e,n):this.createDiminuendoLines(t,e,n)}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.ContinuousDynamic.DynamicType===r.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(t){this.IsVerbal?(this.PositionAndShape.RelativePosition.y+=t,this.PositionAndShape.calculateBoundingBox()):(this.lines[0].Start.y+=t,this.lines[0].End.y+=t,this.lines[1].End.y+=t)}squeeze(t){this.IsVerbal||Math.abs(this.lines[0].End.x-this.lines[0].Start.x)0?this.lines[0].Start.x+=t:(this.lines[0].End.x+=t,this.lines[1].End.x+=t):t<0?this.lines[0].Start.x+=t:(this.lines[0].End.x+=t,this.lines[1].End.x+=t),this.calcPsi())}addWedgeLines(t,e,n,i){const r=new s.GraphicalLine(t,e,i),o=new s.GraphicalLine(t,n,i);this.lines.push(r),this.lines.push(o)}addDoubleLines(t,e,n,i,r){const o=new s.GraphicalLine(t,e,r),a=new s.GraphicalLine(n,i,r);this.lines.push(o),this.lines.push(a)}}e.GraphicalContinuousDynamicExpression=u},function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.StavePositionEnum=e.VexFlowMeasure=void 0;const s=i(n(9)),r=n(105),o=n(23),a=n(7),c=n(14);var l=s.default.Flow.NoteSubGroup;const u=i(n(1)),h=n(18),d=n(28),f=n(38),p=n(12),m=n(68),g=n(0),b=n(39),v=n(69),y=n(3),S=n(37);class x extends r.GraphicalMeasure{constructor(t,e,n){super(t,e,n),this.isTabMeasure=!1,this.octaveOffset=3,this.vfVoices={},this.vfTies=[],this.vfRepetitionWords=[],this.connectors=[],this.beams={},this.tuplets={},this.vftuplets={},this.minimumStaffEntriesWidth=-1,n?this.rules=n.ParentMusicSystem.rules:e&&(this.rules=e.Rules),this.resetLayout()}setAbsoluteCoordinates(t,e){this.stave.setX(t).setY(e)}resetLayout(){this.stave=new s.default.Flow.Stave(0,0,0,{fill_style:this.rules.StaffLineColor,space_above_staff_ln:0,space_below_staff_ln:0}),this.ParentStaff&&this.setLineNumber(this.ParentStaff.StafflineCount),this.stave.setBegBarType(s.default.Flow.Barline.type.NONE),this.parentSourceMeasure&&this.parentSourceMeasure.endingBarStyleEnum===o.SystemLinesEnum.None&&this.stave.setEndBarType(s.default.Flow.Barline.type.NONE),this.updateInstructionWidth()}clean(){this.vfTies.length=0,this.connectors=[],this.resetLayout()}getLineWidth(t){switch(t){case o.SystemLinesEnum.BoldThinDots:case o.SystemLinesEnum.DotsThinBold:case o.SystemLinesEnum.DotsBoldBoldDots:return 10/h.unitInPixels;default:return 0}}addClefAtBegin(t){if(this.octaveOffset=t.OctaveOffset,t.ClefType===a.ClefEnum.TAB)this.stave.addClef("tab",void 0,void 0,void 0);else{const e=c.VexFlowConverter.Clef(t,"default");this.stave.addClef(e.type,e.size,e.annotation,s.default.Flow.StaveModifier.Position.BEGIN)}this.updateInstructionWidth()}setLineNumber(t){5!==t&&(0===t?(this.stave.setNumLines(0),this.stave.getBottomLineY=function(){return this.getYForLine(this.options.num_lines)}):1===t?(this.stave.options.line_config=[{visible:!1},{visible:!1},{visible:!0},{visible:!1},{visible:!1}],this.stave.getBottomLineY=function(){return this.getYForLine(2)}):2===t?(this.stave.options.line_config=[{visible:!1},{visible:!1},{visible:!0},{visible:!0},{visible:!1}],this.stave.getBottomLineY=function(){return this.getYForLine(3)}):3===t?(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(t),this.stave.getBottomLineY=function(){return this.getYForLine(this.options.num_lines)}))}addKeyAtBegin(t,e,n){this.stave.setKeySignature(c.VexFlowConverter.keySignature(t),c.VexFlowConverter.keySignature(e),void 0),this.updateInstructionWidth()}addRhythmAtBegin(t){const e=c.VexFlowConverter.TimeSignature(t);this.stave.addModifier(e,s.default.Flow.StaveModifier.Position.BEGIN),this.updateInstructionWidth()}addClefAtEnd(t){const e=c.VexFlowConverter.Clef(t,"small");this.stave.setEndClef(e.type,e.size,e.annotation),this.updateInstructionWidth()}addMeasureLine(t,e,n=!0){switch(e){case f.SystemLinePosition.MeasureBegin:switch(t){case o.SystemLinesEnum.BoldThinDots:n||(this.stave.modifiers[0].draw=function(t){switch(t.checkContext(),this.setRendered(),this.type){case s.default.Flow.Barline.type.SINGLE:this.drawVerticalBar(t,this.x,!1);break;case s.default.Flow.Barline.type.DOUBLE:this.drawVerticalBar(t,this.x,!0);break;case s.default.Flow.Barline.type.END:this.drawVerticalEndBar(t,this.x);break;case s.default.Flow.Barline.type.REPEAT_BEGIN:this.drawRepeatBar(t,this.x,!0);break;case s.default.Flow.Barline.type.REPEAT_END:this.drawRepeatBar(t,this.x,!1);break;case s.default.Flow.Barline.type.REPEAT_BOTH:this.drawRepeatBar(t,this.x,!1),this.drawRepeatBar(t,this.x,!0)}}),this.stave.setBegBarType(s.default.Flow.Barline.type.REPEAT_BEGIN)}break;case f.SystemLinePosition.MeasureEnd:switch(t){case o.SystemLinesEnum.DotsBoldBoldDots:this.stave.setEndBarType(s.default.Flow.Barline.type.REPEAT_BOTH);break;case o.SystemLinesEnum.DotsThinBold:this.stave.setEndBarType(s.default.Flow.Barline.type.REPEAT_END);break;case o.SystemLinesEnum.DoubleThin:this.stave.setEndBarType(s.default.Flow.Barline.type.DOUBLE);break;case o.SystemLinesEnum.ThinBold:this.stave.setEndBarType(s.default.Flow.Barline.type.END);break;case o.SystemLinesEnum.None:this.stave.setEndBarType(s.default.Flow.Barline.type.NONE)}}}addMeasureNumber(){const t=this.MeasureNumber.toString(),e=_.ABOVE;this.stave.setText(t,e,{justification:1,shift_x:0,shift_y:0})}addWordRepetition(t){let e=void 0,n=s.default.Flow.StaveModifier.Position.END;switch(t.type){case d.RepetitionInstructionEnum.Segno:e=s.default.Flow.Repetition.type.SEGNO_LEFT,n=s.default.Flow.StaveModifier.Position.BEGIN;break;case d.RepetitionInstructionEnum.Coda:e=s.default.Flow.Repetition.type.CODA_LEFT,n=s.default.Flow.StaveModifier.Position.BEGIN;break;case d.RepetitionInstructionEnum.DaCapo:e=s.default.Flow.Repetition.type.DC;break;case d.RepetitionInstructionEnum.DalSegno:e=s.default.Flow.Repetition.type.DS;break;case d.RepetitionInstructionEnum.Fine:e=s.default.Flow.Repetition.type.FINE;break;case d.RepetitionInstructionEnum.ToCoda:break;case d.RepetitionInstructionEnum.DaCapoAlFine:e=s.default.Flow.Repetition.type.DC_AL_FINE;break;case d.RepetitionInstructionEnum.DaCapoAlCoda:e=s.default.Flow.Repetition.type.DC_AL_CODA;break;case d.RepetitionInstructionEnum.DalSegnoAlFine:e=s.default.Flow.Repetition.type.DS_AL_FINE;break;case d.RepetitionInstructionEnum.DalSegnoAlCoda:e=s.default.Flow.Repetition.type.DS_AL_CODA}e?this.stave.addModifier(new s.default.Flow.Repetition(e,0,0),n):this.addVolta(t)}addVolta(t){var e;let n=s.default.Flow.Volta.type.BEGIN;if(t.type===d.RepetitionInstructionEnum.Ending){switch(t.alignment){case d.AlignmentType.Begin:n=this.parentSourceMeasure.endsRepetitionEnding()?s.default.Flow.Volta.type.BEGIN_END:s.default.Flow.Volta.type.BEGIN;break;case d.AlignmentType.End:if(this.parentSourceMeasure.beginsRepetitionEnding())return;n=s.default.Flow.Volta.type.END}const i=this.ParentStaffLine.SkyBottomLineCalculator,r=this.PositionAndShape.AbsolutePosition.x+this.PositionAndShape.BorderMarginLeft+.4,o=this.PositionAndShape.AbsolutePosition.x+this.PositionAndShape.BorderMarginRight,a=i.getSkyLineMinInRange(r,o)-2;let c=-6.1+this.rules.VoltaOffset,l=this.rules.VoltaOffset;a0){u.default.trace(`Ghost Found in between (measure ${this.MeasureNumber})`);const e=c.VexFlowConverter.GhostNote(t),i=new m.VexFlowVoiceEntry(void 0,void 0);i.vfStaveNote=e,n.splice(r,0,i),r++}}else{const t=g.Fraction.minus(i,this.parentSourceMeasure.AbsoluteTimestamp);if(t.RealValue>0){u.default.trace(`Ghost Found at start (measure ${this.MeasureNumber})`);const e=c.VexFlowConverter.GhostNote(t),i=new m.VexFlowVoiceEntry(void 0,void 0);i.vfStaveNote=e,n.splice(0,0,i),r++}}e=s}const i=g.Fraction.plus(this.parentSourceMeasure.AbsoluteTimestamp,this.parentSourceMeasure.Duration),s=g.Fraction.minus(i,e);if(s.RealValue>0){u.default.trace(`Ghost Found at end (measure ${this.MeasureNumber})`);const t=c.VexFlowConverter.GhostNote(s),e=new m.VexFlowVoiceEntry(void 0,void 0);e.vfStaveNote=t,n.push(e)}return n}handleBeam(t,e){const n=t.sourceNote.ParentVoiceEntry.ParentVoice.VoiceId;let i,s=this.beams[n];s||(s=this.beams[n]=[]);for(const o of s)o[0]===e&&(i=o);i||(i=[e,[]],s.push(i));const r=t.parentVoiceEntry;i[1].indexOf(r)<0&&i[1].push(r)}handleTuplet(t,e){const n=t.sourceNote.ParentVoiceEntry.ParentVoice.VoiceId;e=t.sourceNote.NoteTuplet;let i,s=this.tuplets[n];s||(s=this.tuplets[n]=[]);for(const o of s)o[0]===e&&(i=o);i||(i=[e,[]],s.push(i));const r=t.parentVoiceEntry;i[1].indexOf(r)<0&&i[1].push(r)}finalizeBeams(){this.vfbeams={};const t=[];for(const e in this.beams)if(this.beams.hasOwnProperty(e)){let n=this.vfbeams[e];n||(n=this.vfbeams[e]=[]);for(const i of this.beams[e]){let e=!1;for(const t of i[0].Notes)if(t.Length.RealValue>=new g.Fraction(1,4).RealValue&&(!t.TypeLength||t.TypeLength.RealValue>.125)){e=!0;break}if(e){u.default.debug("Beam between note >= quarter, likely tremolo, currently unsupported. continuing.");continue}const r=[],o=i[0],a=i[1];let c=!0;for(const t of a)t.parentVoiceEntry.ParentVoice===o.Notes[0].ParentVoiceEntry.ParentVoice&&(c=t.parentVoiceEntry.WantedStemDirection===p.StemDirectionType.Undefined);let l,h=!1;const d=[];for(const n of a){const e=n.vfStaveNote;e&&(r.push(e),t.push(e)),n.parentVoiceEntry.IsGrace&&(h=!0),n.parentVoiceEntry.StemColor&&this.rules.ColoringEnabled&&d.push(n.parentVoiceEntry.StemColor)}if(r.length>1){const t=new s.default.Flow.Beam(r,c);if(h&&(t.render_options.beam_width=3,t.render_options.partial_beam_length=4),d.length>=2&&this.rules.ColorBeams){l=d[0];for(const t of d)if(t!==l){l=void 0;break}t.setStyle({fillStyle:l,strokeStyle:l})}n.push(t)}else u.default.debug("Warning! Beam with no notes!")}}this.rules.AutoBeamNotes&&this.autoBeamNotes(t)}autoBeamNotes(t){let e,n=[],i=[],r=[];this.autoTupletVfBeams=[];const o=[];this.autoVfBeams=[];let a=this.parentSourceMeasure.ActiveTimeSignature;a||(a=this.parentSourceMeasure.Duration);for(const u of this.staffEntries)for(const c of u.graphicalVoiceEntries){const l=c.vfStaveNote,h=c.notes[0],d=u.relInMeasureTimestamp.isOnBeat(a),f=i.length>=2,p=h.sourceNote.Length.RealValue-new g.Fraction(1,4).RealValue>-g.Fraction.FloatInaccuracyTolerance,m=c.parentVoiceEntry.IsGrace||p||t.contains(l);if(m||d){if(f){for(const t of i)n.push(t);o.push(n.slice()),n=[]}if(i=[],m)continue}const b=c.notes[0].sourceNote.NoteTuplet;if(b){let t=!1;for(const e of b.Notes){for(const n of e)if(n.NoteTypeXml>=S.NoteType.QUARTER||n.ParentVoiceEntry.IsGrace||n.isRest()&&!this.rules.AutoBeamOptions.beam_rests){t=!0;break}if(t)break}e?e!==b&&(r.length>1&&this.autoTupletVfBeams.push(new s.default.Flow.Beam(r,!0)),r=[],e=b):e=b,t||r.push(l)}else e=void 0,i.push(l)}if(r.length>=2&&this.autoTupletVfBeams.push(new s.default.Flow.Beam(r,!0)),i.length>=2){for(const t of i)n.push(t);o.push(n)}const c=this.rules.AutoBeamOptions,l={beam_middle_only:c.beam_middle_rests_only,beam_rests:c.beam_rests,maintain_stem_directions:c.maintain_stem_directions};if(c.groups&&c.groups.length){const t=[];for(const e of c.groups)t.push(new s.default.Flow.Fraction(e[0],e[1]));l.groups=t}for(const u of o){const t=s.default.Flow.Beam.generateBeams(u,l);for(const e of t)this.autoVfBeams.push(e)}}finalizeTuplets(){this.vftuplets={};for(const t in this.tuplets)if(this.tuplets.hasOwnProperty(t)){let e=this.vftuplets[t];e||(e=this.vftuplets[t]=[]);for(const n of this.tuplets[t]){const t=[],i=n[1];for(const e of i)t.push(e.vfStaveNote);if(t.length>1){const i=n[0],r=i.Notes[0][0].NormalNotes,o=i.Bracket||3===i.TupletLabelNumber&&this.rules.TripletsBracketed||3!==i.TupletLabelNumber&&this.rules.TupletsBracketed;let a=s.default.Flow.Tuplet.LOCATION_TOP;i.tupletLabelNumberPlacement===y.PlacementEnum.Below&&(a=s.default.Flow.Tuplet.LOCATION_BOTTOM),e.push(new s.default.Flow.Tuplet(t,{bracketed:o,location:a,notes_occupied:r,num_notes:i.TupletLabelNumber,ratioed:this.rules.TupletsRatioed}))}else u.default.debug("Warning! Tuplet with no notes! Trying to ignore, but this is a serious problem.")}}}layoutStaffEntry(t){}graphicalMeasureCreatedCalculations(){let t,e=[];for(const i of this.staffEntries){t=!1,e=[];for(const n of i.graphicalVoiceEntries)if(n.parentVoiceEntry.IsGrace)e.push(n),t||(t=n.parentVoiceEntry.GraceSlur);else if(n.notes[0].sourceNote.PrintObject,n.vfStaveNote=c.VexFlowConverter.StaveNote(n),e.length>0){const i=[];for(let t=0;t0)for(const i of e)i.vfStaveNote=c.VexFlowConverter.StaveNote(i),i.parentVoiceEntry.GraceAfterMainNote=!0;this.finalizeBeams(),this.finalizeTuplets();const n=this.getVoicesWithinMeasure();for(const i of n){if(!i)continue;const t=!(i instanceof b.LinkedVoice);this.vfVoices[i.VoiceId]=new s.default.Flow.Voice({beat_value:this.parentSourceMeasure.Duration.Denominator,num_beats:this.parentSourceMeasure.Duration.Numerator,resolution:s.default.Flow.RESOLUTION}).setMode(s.default.Flow.Voice.Mode.SOFT);const e=this.getRestFilledVexFlowStaveNotesPerVoice(i);for(const n of e){if(n.parentVoiceEntry&&n.parentVoiceEntry.IsGrace&&!n.parentVoiceEntry.GraceAfterMainNote)continue;const e=n;if(0!==n.notes.length&&n.notes[0]&&n.notes[0].sourceNote.PrintObject){if(t){const t=e.parentStaffEntry;if(t&&t.vfClefBefore){const n=new l([t.vfClefBefore]);e.vfStaveNote.getCategory&&"stavenotes"===e.vfStaveNote.getCategory()&&e.vfStaveNote.addModifier(0,n)}}if(n.parentVoiceEntry&&this.rules.RenderFingerings&&this.createFingerings(n),n.parentVoiceEntry&&n.parentVoiceEntry.Arpeggio){const t=n.parentVoiceEntry.Arpeggio;if(n.notes&&n.notes.length>1){const n=c.VexFlowConverter.StrokeTypeFromArpeggioType(t.type),i=new s.default.Flow.Stroke(n,{all_voices:this.rules.ArpeggiosGoAcrossVoices});this.rules.RenderArpeggios&&e.vfStaveNote.addStroke(0,i)}else u.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.`)}this.vfVoices[i.VoiceId].addTickable(e.vfStaveNote)}else this.vfVoices[i.VoiceId].addTickable(e.vfStaveNote)}}this.createArticulations(),this.createOrnaments(),this.setStemDirectionFromVexFlow()}setStemDirectionFromVexFlow(){for(const t of this.staffEntries)for(const e of t.graphicalVoiceEntries)for(const t of e.notes){const n=t.vfnote;if(n&&n[0])switch(n[0].getStemDirection()){case s.default.Flow.Stem.UP:e.parentVoiceEntry.StemDirection=p.StemDirectionType.Up;break;case s.default.Flow.Stem.DOWN:e.parentVoiceEntry.StemDirection=p.StemDirectionType.Down}}}createArticulations(){for(let t=0,e=this.staffEntries.length;t1||t.parentStaffEntry.graphicalVoiceEntries.length>1?n=s.default.Flow.StaveModifier.Position.LEFT:0===e.idInMusicSheet?(n=s.default.Flow.StaveModifier.Position.ABOVE,a=y.PlacementEnum.Above):(n=s.default.Flow.StaveModifier.Position.BELOW,a=y.PlacementEnum.Below)}const c=new s.default.Flow.FretHandFinger(o.value);if(c.setPosition(n),c.setOffsetX(this.rules.FingeringOffsetX),a===y.PlacementEnum.Above||a===y.PlacementEnum.Below){const t=a===y.PlacementEnum.Above?-1:1,l=a===y.PlacementEnum.Above?r:i-1-r;if(this.rules.FingeringInsideStafflines&&i>1){const e=c.getWidth()/2,n=2.5*i;c.setOffsetY(t*(l+n)*e)}else if(!this.rules.FingeringInsideStafflines){const i=new s.default.Flow.StringNumber(o.value);i.radius=0,i.setPosition(n),i.setOffsetY(t*l*i.getWidth()*2/3),e.vfStaveNote.addModifier(r,i);continue}}"tabnotes"===e.vfStaveNote.getCategory()||e.vfStaveNote.addModifier(r,c)}}lineTo(t,e){const n=new s.default.Flow.StaveConnector(t.getVFStave(),this.stave);n.setType(e),this.connectors.push(n)}getVFStave(){return this.stave}updateInstructionWidth(){let t=0,e=0;const n=this.stave.getModifiers();for(const i of n)i.getPosition()===_.BEGIN?t+=i.getWidth()+i.getPadding(void 0):i.getPosition()===_.END&&(e+=i.getWidth()+i.getPadding(void 0));this.beginInstructionsWidth=t/h.unitInPixels,this.endInstructionsWidth=e/h.unitInPixels}}var _;e.VexFlowMeasure=x,function(t){t[t.LEFT=1]="LEFT",t[t.RIGHT=2]="RIGHT",t[t.ABOVE=3]="ABOVE",t[t.BELOW=4]="BELOW",t[t.BEGIN=5]="BEGIN",t[t.END=6]="END"}(_=e.StavePositionEnum||(e.StavePositionEnum={}))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.RectangleF2D=void 0;const i=n(78),s=n(5);class r{constructor(t,e,n,i){this.x=0,this.y=0,this.width=0,this.height=0,this.x=t,this.y=e,this.width=n,this.height=i}static createFromLocationAndSize(t,e){return new r(t.x,t.y,e.width,e.height)}get Location(){return new s.PointF2D(this.x,this.y)}get Size(){return new i.SizeF2D(this.width,this.height)}}e.RectangleF2D=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(10),s=n(35),r=function(){function t(){this.firstNode=null,this.lastNode=null,this.nElements=0}return t.prototype.add=function(t,e){if(i.isUndefined(e)&&(e=this.nElements),e<0||e>this.nElements||i.isUndefined(t))return!1;var n=this.createNode(t);if(0===this.nElements||null===this.lastNode)this.firstNode=n,this.lastNode=n;else if(e===this.nElements)this.lastNode.next=n,this.lastNode=n;else if(0===e)n.next=this.firstNode,this.firstNode=n;else{var s=this.nodeAtIndex(e-1);if(null===s)return!1;n.next=s.next,s.next=n}return this.nElements++,!0},t.prototype.first=function(){if(null!==this.firstNode)return this.firstNode.element},t.prototype.last=function(){if(null!==this.lastNode)return this.lastNode.element},t.prototype.elementAtIndex=function(t){var e=this.nodeAtIndex(t);if(null!==e)return e.element},t.prototype.indexOf=function(t,e){var n=e||i.defaultEquals;if(i.isUndefined(t))return-1;for(var s=this.firstNode,r=0;null!==s;){if(n(s.element,t))return r;r++,s=s.next}return-1},t.prototype.contains=function(t,e){return this.indexOf(t,e)>=0},t.prototype.remove=function(t,e){var n=e||i.defaultEquals;if(this.nElements<1||i.isUndefined(t))return!1;for(var s=null,r=this.firstNode;null!==r;){if(n(r.element,t))return null===s?(this.firstNode=r.next,r===this.lastNode&&(this.lastNode=null)):r===this.lastNode?(this.lastNode=s,s.next=r.next,r.next=null):(s.next=r.next,r.next=null),this.nElements--,!0;s=r,r=r.next}return!1},t.prototype.clear=function(){this.firstNode=null,this.lastNode=null,this.nElements=0},t.prototype.equals=function(e,n){var s=n||i.defaultEquals;return e instanceof t&&this.size()===e.size()&&this.equalsAux(this.firstNode,e.firstNode,s)},t.prototype.equalsAux=function(t,e,n){for(;null!==t&&null!==e;){if(!n(t.element,e.element))return!1;t=t.next,e=e.next}return!0},t.prototype.removeElementAtIndex=function(t){if(!(t<0||t>=this.nElements||null===this.firstNode||null===this.lastNode)){var e;if(1===this.nElements)e=this.firstNode.element,this.firstNode=null,this.lastNode=null;else{var n=this.nodeAtIndex(t-1);null===n?(e=this.firstNode.element,this.firstNode=this.firstNode.next):n.next===this.lastNode&&(e=this.lastNode.element,this.lastNode=n),null!==n&&null!==n.next&&(e=n.next.element,n.next=n.next.next)}return this.nElements--,e}},t.prototype.forEach=function(t){for(var e=this.firstNode;null!==e&&!1!==t(e.element);)e=e.next},t.prototype.reverse=function(){for(var t=null,e=this.firstNode,n=null;null!==e;)n=e.next,e.next=t,t=e,e=n;n=this.firstNode,this.firstNode=this.lastNode,this.lastNode=n},t.prototype.toArray=function(){for(var t=[],e=this.firstNode;null!==e;)t.push(e.element),e=e.next;return t},t.prototype.size=function(){return this.nElements},t.prototype.isEmpty=function(){return this.nElements<=0},t.prototype.toString=function(){return s.toString(this.toArray())},t.prototype.nodeAtIndex=function(t){if(t<0||t>=this.nElements)return null;if(t===this.nElements-1)return this.lastNode;for(var e=this.firstNode,n=0;n=o.allargando&&t<=o.ritenuto}get TempoType(){return this.tempoType}set TempoType(t){this.tempoType=t}get StartTempo(){return this.startTempo}set StartTempo(t){this.startTempo=t}get EndTempo(){return this.endTempo}set EndTempo(t){this.endTempo=t}get AbsoluteEndTimestamp(){return this.absoluteEndTimestamp}set AbsoluteEndTimestamp(t){this.absoluteEndTimestamp=t}get AbsoluteTimestamp(){return this.ParentMultiTempoExpression.AbsoluteTimestamp}getAbsoluteFloatTimestamp(){return this.ParentMultiTempoExpression.AbsoluteTimestamp.RealValue}getInterpolatedTempo(t){const e=i.Fraction.plus(this.parentMultiTempoExpression.SourceMeasureParent.AbsoluteTimestamp,this.parentMultiTempoExpression.Timestamp);if(t.lt(e))return-1;if(this.absoluteEndTimestamp.lt(t))return-2;const n=i.Fraction.minus(t,e).RealValue/i.Fraction.minus(this.absoluteEndTimestamp,e).RealValue;return Math.max(0,Math.min(250,this.startTempo+(this.endTempo-this.startTempo)*n))}setTempoType(){r.isStringInStringList(r.listContinuousTempoFaster,this.label)?this.tempoType=o.accelerando:r.isStringInStringList(r.listContinuousTempoSlower,this.label)&&(this.tempoType=o.ritardando)}}var o;e.ContinuousTempoExpression=r,r.listContinuousTempoFaster=["accelerando","piu mosso","poco piu","stretto"],r.listContinuousTempoSlower=["poco meno","meno mosso","piu lento","calando","allargando","rallentando","ritardando","ritenuto","ritard.","ritard","rit.","rit","riten.","riten"],function(t){t[t.accelerando=0]="accelerando",t[t.stretto=1]="stretto",t[t.stringendo=2]="stringendo",t[t.mosso=3]="mosso",t[t.piuMosso=4]="piuMosso",t[t.allargando=5]="allargando",t[t.calando=6]="calando",t[t.menoMosso=7]="menoMosso",t[t.rallentando=8]="rallentando",t[t.ritardando=9]="ritardando",t[t.ritard=10]="ritard",t[t.rit=11]="rit",t[t.ritenuto=12]="ritenuto",t[t.rubato=13]="rubato",t[t.precipitando=14]="precipitando"}(o=e.ContinuousTempoType||(e.ContinuousTempoType={}))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.StaffLineActivitySymbol=void 0;const i=n(6),s=n(4);class r extends i.GraphicalObject{constructor(t){super(),this.parentStaffLine=t;const e=t.PositionAndShape;this.boundingBox=new s.BoundingBox(this,e),this.boundingBox.BorderRight=6,this.boundingBox.BorderBottom=4.5,this.boundingBox.BorderLeft=-1.5,this.boundingBox.BorderTop=-1.5}}e.StaffLineActivitySymbol=r},function(t,e,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),s=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||e.hasOwnProperty(n)||i(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),s(n(20),e),s(n(84),e),s(n(8),e),s(n(151),e)},function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.SystemImageProperties=e.GraphicalMusicSheet=void 0;const s=n(91),r=n(27),o=n(5),a=n(7),c=n(16),l=n(0),u=n(4),h=i(n(1)),d=n(34);e.GraphicalMusicSheet=class{constructor(t,e){this.musicPages=[],this.measureList=[],this.verticalGraphicalStaffEntryContainers=[],this.cursors=[],this.leadSheet=!1,this.musicSheet=t,this.numberOfStaves=this.musicSheet.Staves.length,this.calculator=e,this.calculator.initialize(this)}get ParentMusicSheet(){return this.musicSheet}get GetCalculator(){return this.calculator}get MusicPages(){return this.musicPages}set MusicPages(t){this.musicPages=t}get MeasureList(){return this.measureList}set MeasureList(t){this.measureList=t}get VerticalGraphicalStaffEntryContainers(){return this.verticalGraphicalStaffEntryContainers}set VerticalGraphicalStaffEntryContainers(t){this.verticalGraphicalStaffEntryContainers=t}get Title(){return this.title}set Title(t){this.title=t}get Subtitle(){return this.subtitle}set Subtitle(t){this.subtitle=t}get Composer(){return this.composer}set Composer(t){this.composer=t}get Lyricist(){return this.lyricist}set Lyricist(t){this.lyricist=t}get Cursors(){return this.cursors}get SelectionStartSymbol(){return this.selectionStartSymbol}get SelectionEndSymbol(){return this.selectionEndSymbol}get MinAllowedSystemWidth(){return this.minAllowedSystemWidth}set MinAllowedSystemWidth(t){this.minAllowedSystemWidth=t}get NumberOfStaves(){return this.numberOfStaves}get LeadSheet(){return this.leadSheet}set LeadSheet(t){this.leadSheet=t}static transformRelativeToAbsolutePosition(t){for(let e=0;e=0;n--){const t=this.measureList[n][e];if(t)return t}}findGraphicalStaffEntryFromMeasureList(t,e,n){for(let i=e;i0)return n.staffEntries[0]}}getFirstVisibleMeasuresListFromIndices(t,e){const n=[],i=this.measureList[0].length;for(let s=t;s<=e;s++)for(let t=0;t=0;e--){if(this.verticalGraphicalStaffEntryContainers[e].AbsoluteTimestamp.lt(t)){const n=new s.VerticalGraphicalStaffEntryContainer(this.numberOfStaves,t);return this.verticalGraphicalStaffEntryContainers.splice(e+1,0,n),n}if(this.verticalGraphicalStaffEntryContainers[e].AbsoluteTimestamp.Equals(t))return this.verticalGraphicalStaffEntryContainers[e]}}GetVerticalContainerFromTimestamp(t,e=0){const n=d.CollectionUtil.binarySearch(this.verticalGraphicalStaffEntryContainers,new s.VerticalGraphicalStaffEntryContainer(0,t),s.VerticalGraphicalStaffEntryContainer.compareByTimestamp,e);if(n>=0)return this.verticalGraphicalStaffEntryContainers[n]}GetInterpolatedIndexInVerticalContainers(t){const e=this.verticalGraphicalStaffEntryContainers;let n,i=0,s=e.length-1,r=void 0,o=void 0;if(t.lte(e[e.length-1].AbsoluteTimestamp)){for(;s-i>1;){const n=Math.floor((s+i)/2);if(e[i].AbsoluteTimestamp.Equals(t)){s=i;break}if(e[s].AbsoluteTimestamp.Equals(t)){i=s;break}if(e[n].AbsoluteTimestamp.Equals(t))return this.verticalGraphicalStaffEntryContainers.indexOf(e[n]);t.lt(e[n].AbsoluteTimestamp)?s=n:i=n}if(i===s)return this.verticalGraphicalStaffEntryContainers.indexOf(e[i]);r=e[i].AbsoluteTimestamp,o=e[s].AbsoluteTimestamp}else r=e[e.length-1].AbsoluteTimestamp,o=l.Fraction.plus(this.getLongestStaffEntryDuration(e.length-1),r),s=e.length;const a=o.RealValue-r.RealValue;return n=s-(o.RealValue-t.RealValue)/a,Math.min(n,this.verticalGraphicalStaffEntryContainers.length)}getVisibleStavesIndicesFromSourceMeasure(t){const e=[],n=[];for(let i=0,s=t.length;ii.PositionAndShape.RelativePosition.x&&(n=i):n=i)}}catch(t){h.default.info("GraphicalMusicSheet.getStaffEntry",t)}return n}GetPreviousVisibleContainerIndex(t){for(let e=t-1;e>=0;e--){const t=this.verticalGraphicalStaffEntryContainers[e].StaffEntries;for(let n=0,i=t.length;n=0;s--)if(n=this.getStaffEntry(s),n){if(!e)return n;if(n.sourceStaffEntry.ParentStaff.ParentInstrument.Visible)return n}}findClosestRightStaffEntry(t,e){let n=void 0;for(let i=Math.max(0,Math.ceil(t));i0&&this.Voices[0].Visible}set Visible(t){for(let e=0,n=this.Voices.length;e2:(s.default.warn("notehead: sourceNote and filledXmlAttribute undefined."),n=!0)),this.filled=n}get SourceNote(){return this.sourceNote}get Shape(){return this.shape}get Filled(){return this.filled}static ShapeTypeXmlToShape(t){switch(t.toLowerCase()){case"normal":return o.NORMAL;case"x":return o.X;case"slash":return o.SLASH;case"diamond":return o.DIAMOND;case"square":case"la":return o.SQUARE;case"do":case"triangle":return o.TRIANGLE;case"rectangle":return o.RECTANGLE;case"circle-x":return o.CIRCLEX;default:return s.default.info("unsupported/unhandled xml notehead '"+t+"'. Using normal notehead."),o.NORMAL}}}var o;e.Notehead=r,function(t){t[t.CIRCLEX=0]="CIRCLEX",t[t.DIAMOND=1]="DIAMOND",t[t.NORMAL=2]="NORMAL",t[t.RECTANGLE=3]="RECTANGLE",t[t.SLASH=4]="SLASH",t[t.SQUARE=5]="SQUARE",t[t.TRIANGLE=6]="TRIANGLE",t[t.X=7]="X"}(o=e.NoteHeadShape||(e.NoteHeadShape={}))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MusicSymbol=void 0,function(t){t[t.Unused_first_Symbol=0]="Unused_first_Symbol",t[t.BLACK_HEAD=1]="BLACK_HEAD",t[t.UPWARDS_TAIL=2]="UPWARDS_TAIL",t[t.DOWNWARDS_TAIL=3]="DOWNWARDS_TAIL",t[t.UPWARDS_DOUBLE_TAIL=4]="UPWARDS_DOUBLE_TAIL",t[t.DOWNWARDS_DOUBLE_TAIL=5]="DOWNWARDS_DOUBLE_TAIL",t[t.UPWARDS_TRIPLE_TAIL=6]="UPWARDS_TRIPLE_TAIL",t[t.DOWNWARDS_TRIPLE_TAIL=7]="DOWNWARDS_TRIPLE_TAIL",t[t.UPWARDS_QUAD_TAIL=8]="UPWARDS_QUAD_TAIL",t[t.DOWNWARDS_QUAD_TAIL=9]="DOWNWARDS_QUAD_TAIL",t[t.ROUND_HEAD=10]="ROUND_HEAD",t[t.WHITE_HEAD=11]="WHITE_HEAD",t[t.G_CLEF=12]="G_CLEF",t[t.F_CLEF=13]="F_CLEF",t[t.C_CLEF=14]="C_CLEF",t[t.BREVE=15]="BREVE",t[t.BREVE_REST=16]="BREVE_REST",t[t.COMMON_TIME=17]="COMMON_TIME",t[t.CUT_TIME=18]="CUT_TIME",t[t.WHOLE_REST=19]="WHOLE_REST",t[t.HALF_REST=20]="HALF_REST",t[t.QUARTER_REST=21]="QUARTER_REST",t[t.EIGHTH_REST=22]="EIGHTH_REST",t[t.SIXTEENTH_REST=23]="SIXTEENTH_REST",t[t.THIRTYSECOND_REST=24]="THIRTYSECOND_REST",t[t.SIXTYFOURTH_REST=25]="SIXTYFOURTH_REST",t[t.FLAT=26]="FLAT",t[t.SHARP=27]="SHARP",t[t.NATURAL=28]="NATURAL",t[t.DOUBLE_FLAT=29]="DOUBLE_FLAT",t[t.DOUBLE_SHARP=30]="DOUBLE_SHARP",t[t.ZERO=31]="ZERO",t[t.ONE=32]="ONE",t[t.TWO=33]="TWO",t[t.THREE=34]="THREE",t[t.FOUR=35]="FOUR",t[t.FIVE=36]="FIVE",t[t.SIX=37]="SIX",t[t.SEVEN=38]="SEVEN",t[t.EIGHT=39]="EIGHT",t[t.NINE=40]="NINE",t[t.DOT=41]="DOT",t[t.FERMATA=42]="FERMATA",t[t.INVERTED_FERMATA=43]="INVERTED_FERMATA",t[t.SPICCATO=44]="SPICCATO",t[t.TENUTO=45]="TENUTO",t[t.MARCATO=46]="MARCATO",t[t.MARCATISSIMO=47]="MARCATISSIMO",t[t.INVERTED_MARCATISSIMO=48]="INVERTED_MARCATISSIMO",t[t.P=49]="P",t[t.F=50]="F",t[t.S=51]="S",t[t.Z=52]="Z",t[t.M=53]="M",t[t.R=54]="R",t[t.SEGNO=55]="SEGNO",t[t.CODA=56]="CODA",t[t.DRUM_CLEF=57]="DRUM_CLEF",t[t.G_CLEF_SUB8=58]="G_CLEF_SUB8",t[t.G_CLEF_SUPER8=59]="G_CLEF_SUPER8",t[t.G_CLEF_SUB15=60]="G_CLEF_SUB15",t[t.G_CLEF_SUPER15=61]="G_CLEF_SUPER15",t[t.F_CLEF_SUB8=62]="F_CLEF_SUB8",t[t.F_CLEF_SUPER8=63]="F_CLEF_SUPER8",t[t.F_CLEF_SUB15=64]="F_CLEF_SUB15",t[t.F_CLEF_SUPER15=65]="F_CLEF_SUPER15",t[t.DOWN_BOW=66]="DOWN_BOW",t[t.MORDENT=67]="MORDENT",t[t.INVERTED_MORDENT=68]="INVERTED_MORDENT",t[t.TURN=69]="TURN",t[t.INVERTED_TURN=70]="INVERTED_TURN",t[t.LEFTHAND_PIZZICATO=71]="LEFTHAND_PIZZICATO",t[t.RELEASE_PED=72]="RELEASE_PED",t[t.ENGAGE_PED=73]="ENGAGE_PED",t[t.VA8=74]="VA8",t[t.VB8=75]="VB8",t[t.TRILL=76]="TRILL",t[t.MA15=77]="MA15",t[t.MB15=78]="MB15",t[t.HIGH=79]="HIGH",t[t.PLAY=80]="PLAY",t[t.MIC=81]="MIC",t[t.SNAP_PIZZICATO=82]="SNAP_PIZZICATO",t[t.NATURAL_HARMONIC=83]="NATURAL_HARMONIC",t[t.EditPen=84]="EditPen"}(e.MusicSymbol||(e.MusicSymbol={}))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.VexFlowTextMeasurer=void 0;const i=n(14);e.VexFlowTextMeasurer=class{constructor(t){this.fontSize=20,this.fontSizeStandard=this.fontSize;const e=document.createElement("canvas");this.context=e.getContext("2d"),this.rules=t}computeTextWidthToHeightRatio(t,e,n,s,r=this.fontSize){return this.context.font=i.VexFlowConverter.font(r,n,e,this.rules,s),this.context.measureText(t).width/r}setFontSize(t=this.fontSizeStandard){return this.fontSize=t,t}}},function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.GraphicalInstantaneousDynamicExpression=void 0;const s=n(40),r=n(3),o=i(n(1));class a extends s.AbstractGraphicalExpression{constructor(t,e,n){super(e,t,n.parentSourceMeasure),this.mInstantaneousDynamicExpression=t,this.mMeasure=n}updateSkyBottomLine(){const t=this.parentStaffLine.SkyBottomLineCalculator,e=this.PositionAndShape.RelativePosition.x+this.PositionAndShape.BorderMarginLeft,n=this.PositionAndShape.RelativePosition.x+this.PositionAndShape.BorderMarginRight;let i=0;switch(this.Placement){case r.PlacementEnum.Above:i=this.PositionAndShape.RelativePosition.y+this.PositionAndShape.BorderMarginTop,t.updateSkyLineInRange(e,n,i);break;case r.PlacementEnum.Below:i=this.PositionAndShape.RelativePosition.y+this.PositionAndShape.BorderMarginBottom,t.updateBottomLineInRange(e,n,i);break;default:o.default.error("Placement for GraphicalInstantaneousDynamicExpression is unknown")}}}e.GraphicalInstantaneousDynamicExpression=a},function(t,e,n){"use strict";var i;Object.defineProperty(e,"__esModule",{value:!0}),e.ArpeggioType=e.Arpeggio=void 0,e.Arpeggio=class{constructor(t,e=i.ARPEGGIO_DIRECTIONLESS){this.parentVoiceEntry=t,this.type=e,this.notes=[]}addNote(t){this.notes.push(t),t.Arpeggio=this}},function(t){t[t.BRUSH_DOWN=1]="BRUSH_DOWN",t[t.BRUSH_UP=2]="BRUSH_UP",t[t.ROLL_DOWN=3]="ROLL_DOWN",t[t.ROLL_UP=4]="ROLL_UP",t[t.RASQUEDO_DOWN=5]="RASQUEDO_DOWN",t[t.RASQUEDO_UP=6]="RASQUEDO_UP",t[t.ARPEGGIO_DIRECTIONLESS=7]="ARPEGGIO_DIRECTIONLESS"}(i=e.ArpeggioType||(e.ArpeggioType={}))},function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.VexFlowInstrumentBracket=void 0;const s=i(n(9)),r=n(6),o=n(4),a=n(18);class c extends r.GraphicalObject{constructor(t,e,n=0){super(),this.PositionAndShape=new o.BoundingBox(this,t.ParentMusicSystem.PositionAndShape);const i=t.Measures[0],r=e.Measures[0];this.addConnector(i.getVFStave(),r.getVFStave(),s.default.Flow.StaveConnector.type.BRACKET,n)}draw(t){this.vexflowConnector.setContext(t).draw();const e=this.vexflowConnector,n=e.top_stave.getYForLine(0),i=e.bottom_stave.getYForLine(e.bottom_stave.getNumLines()-1)+e.thickness;this.PositionAndShape.AbsolutePosition.x=(e.top_stave.getX()-2+e.x_shift)/a.unitInPixels,this.PositionAndShape.AbsolutePosition.y=n/a.unitInPixels,this.PositionAndShape.Size.height=(i-n)/a.unitInPixels,this.PositionAndShape.Size.width=12/a.unitInPixels}addConnector(t,e,n,i){this.vexflowConnector=new s.default.Flow.StaveConnector(t,e).setType(n).setXShift(-5*i)}}e.VexFlowInstrumentBracket=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.VexFlowVoiceEntry=void 0;const i=n(106),s=n(18),r=n(33);class o extends i.GraphicalVoiceEntry{constructor(t,e){super(t,e)}applyBordersFromVexflow(){const t=this.vfStaveNote;if(!t.getNoteHeadBeginX)return;const e=t.getBoundingBox(),n=t.getNoteHeadBeginX()-e.x;this.PositionAndShape.RelativePosition.y=e.y/s.unitInPixels,this.PositionAndShape.BorderTop=0,this.PositionAndShape.BorderBottom=e.h/s.unitInPixels,this.PositionAndShape.BorderLeft=-(n+t.width/2)/s.unitInPixels,this.PositionAndShape.BorderRight=(e.w-n)/s.unitInPixels}set vfStaveNote(t){this.mVexFlowStaveNote=t}get vfStaveNote(){return this.mVexFlowStaveNote}color(){const t=this.rules.DefaultColorNotehead,e=this.rules.DefaultColorRest,n=this.rules.DefaultColorStem;let i,s;const o=this.vfStaveNote;for(let u=0;u-1?"text/plain; charset=x-user-defined":"application/xml";if(XMLHttpRequest)e=new XMLHttpRequest;else{if(!ActiveXObject)return Promise.reject(new Error("XMLHttp not supported."));e=new ActiveXObject("Microsoft.XMLHTTP")}return new Promise((i,s)=>{e.onreadystatechange=()=>{e.readyState===XMLHttpRequest.DONE&&(200===e.status||0===e.status&&e.responseText?i(e.responseText):s(new Error("Could not retrieve requested URL "+e.status)))},e.ontimeout=t=>{s(new Error("Server request Timeout"))},e.overrideMimeType(n),e.open("GET",t,!0),e.send()})}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Cursor=void 0;const i=n(0);e.Cursor=class{constructor(t,e){this.hidden=!0,this.currentPageNumber=1,this.container=t,this.openSheetMusicDisplay=e,this.rules=this.openSheetMusicDisplay.EngravingRules;let n=0;for(this.cursorElementId="cursorImg-0";document.getElementById(this.cursorElementId);)n++,this.cursorElementId="cursorImg-"+n;const i=document.createElement("img");i.id=this.cursorElementId,i.style.position="absolute",i.style.zIndex="-1",this.cursorElement=i,this.container.appendChild(i)}init(t,e){this.manager=t,this.graphic=e,this.reset(),this.hidden=!0,this.hide()}show(){this.hidden=!1,this.resetIterator(),this.update()}resetIterator(){if(!this.openSheetMusicDisplay.Sheet||!this.openSheetMusicDisplay.Sheet.SourceMeasures)return void console.log("OSMD.Cursor.resetIterator(): sheet or measures were null/undefined.");const t=this.openSheetMusicDisplay.Sheet.SourceMeasures.length-1;let e=this.rules.MinMeasureToDrawIndex;e=Math.min(e,t);let n=this.rules.MaxMeasureToDrawIndex;if(n=Math.min(n,t),this.openSheetMusicDisplay.Sheet&&this.openSheetMusicDisplay.Sheet.SourceMeasures.length>e&&(this.openSheetMusicDisplay.Sheet.SelectionStart=this.openSheetMusicDisplay.Sheet.SourceMeasures[e].AbsoluteTimestamp),this.openSheetMusicDisplay.Sheet&&this.openSheetMusicDisplay.Sheet.SourceMeasures.length>n){const t=this.openSheetMusicDisplay.Sheet.SourceMeasures[n];this.openSheetMusicDisplay.Sheet.SelectionEnd=i.Fraction.plus(t.AbsoluteTimestamp,t.Duration)}this.iterator=this.manager.getIterator()}getStaffEntryFromVoiceEntry(t){const e=t.ParentSourceStaffEntry.VerticalContainerParent.ParentMeasure.measureListIndex,n=t.ParentSourceStaffEntry.ParentStaff.idInMusicSheet;return this.graphic.findGraphicalStaffEntryFromMeasureList(n,e,t.ParentSourceStaffEntry)}update(){if(this.hidden||void 0===this.hidden||null===this.hidden)return;this.updateCurrentPage();const t=this.iterator,e=t.CurrentVisibleVoiceEntries();if(t.EndReached||!t.CurrentVoiceEntries||0===e.length)return;let n,i=0,s=0,r=0;if(t.CurrentMeasure.isReducedToMultiRest){const e=this.graphic.findGraphicalMeasure(t.CurrentMeasureIndex,0),s=e.parentSourceMeasure.multipleRestMeasures,r=t.CurrentMeasure.multipleRestMeasureNumber/(s+1),o=e.PositionAndShape.Size.width-e.beginInstructionsWidth;i=e.PositionAndShape.AbsolutePosition.x+e.beginInstructionsWidth+r*o,n=e.ParentMusicSystem}else{const t=e.map(t=>this.getStaffEntryFromVoiceEntry(t)).sort((t,e)=>{var n,i,s,r;return(null===(i=null===(n=null==t?void 0:t.PositionAndShape)||void 0===n?void 0:n.AbsolutePosition)||void 0===i?void 0:i.x)<=(null===(r=null===(s=null==e?void 0:e.PositionAndShape)||void 0===s?void 0:s.AbsolutePosition)||void 0===r?void 0:r.x)?-1:1})[0];i=t.PositionAndShape.AbsolutePosition.x,n=t.parentMeasure.ParentMusicSystem}if(!n)return;s=n.PositionAndShape.AbsolutePosition.y+n.StaffLines[0].PositionAndShape.RelativePosition.y;const o=n.StaffLines[n.StaffLines.length-1];r=n.PositionAndShape.AbsolutePosition.y+o.PositionAndShape.RelativePosition.y+o.StaffHeight-s;const a=this.cursorElement;a.style.top=10*s*this.openSheetMusicDisplay.zoom+"px",a.style.left=10*(i-1.5)*this.openSheetMusicDisplay.zoom+"px",a.height=10*r*this.openSheetMusicDisplay.zoom;const c=30*this.openSheetMusicDisplay.zoom;if(c!==a.width&&(a.width=c,this.updateStyle(c)),this.openSheetMusicDisplay.FollowCursor){const t=this.cursorElement.getBoundingClientRect().top;this.cursorElement.scrollIntoView({behavior:t<1e3?"smooth":"auto",block:"center"})}this.cursorElement.style.display=""}hide(){this.cursorElement.style.display="none",this.hidden=!0}next(){this.iterator.moveToNext(),this.update()}reset(){this.resetIterator(),this.update()}updateStyle(t,e="#33e02f"){const n=document.createElement("canvas");n.width=this.cursorElement.width,n.height=1;const i=n.getContext("2d");i.globalAlpha=.5;const s=i.createLinearGradient(0,0,this.cursorElement.width,0);s.addColorStop(0,"white"),s.addColorStop(.2,e),s.addColorStop(.8,e),s.addColorStop(1,"white"),i.fillStyle=s,i.fillRect(0,0,t,1),this.cursorElement.src=n.toDataURL("image/png")}get Iterator(){return this.iterator}get Hidden(){return this.hidden}VoicesUnderCursor(t){return this.iterator.CurrentVisibleVoiceEntries(t)}NotesUnderCursor(t){const e=this.VoicesUnderCursor(t),n=[];return e.forEach(t=>{n.push.apply(n,t.Notes)}),n}updateCurrentPage(){const t=this.iterator.currentTimeStamp;for(const e of this.graphic.MusicPages)if(e.MusicSystems.last().GetSystemsLastTimeStamp().gt(t)){const t=e.PageNumber;return t!==this.currentPageNumber&&(this.container.removeChild(this.cursorElement),this.container=document.getElementById("osmdCanvasPage"+t),this.container.appendChild(this.cursorElement)),this.currentPageNumber=t}return 1}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SizeF2D=void 0,e.SizeF2D=class{constructor(t=0,e=0){this.width=t,this.height=e}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(10),s=n(35),r=n(29),o=function(){function t(t){this.dictionary=new r.default(t)}return t.prototype.contains=function(t){return this.dictionary.containsKey(t)},t.prototype.add=function(t){return!this.contains(t)&&!i.isUndefined(t)&&(this.dictionary.setValue(t,t),!0)},t.prototype.intersection=function(t){var e=this;this.forEach((function(n){return t.contains(n)||e.remove(n),!0}))},t.prototype.union=function(t){var e=this;t.forEach((function(t){return e.add(t),!0}))},t.prototype.difference=function(t){var e=this;t.forEach((function(t){return e.remove(t),!0}))},t.prototype.isSubsetOf=function(t){if(this.size()>t.size())return!1;var e=!0;return this.forEach((function(n){return!!t.contains(n)||(e=!1,!1)})),e},t.prototype.remove=function(t){return!!this.contains(t)&&(this.dictionary.remove(t),!0)},t.prototype.forEach=function(t){this.dictionary.forEach((function(e,n){return t(n)}))},t.prototype.toArray=function(){return this.dictionary.values()},t.prototype.isEmpty=function(){return this.dictionary.isEmpty()},t.prototype.size=function(){return this.dictionary.size()},t.prototype.clear=function(){this.dictionary.clear()},t.prototype.toString=function(){return s.toString(this.toArray())},t}();e.default=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(10),s=n(81),r=function(){function t(t){this.root=null,this.compare=t||i.defaultCompare,this.nElements=0}return t.prototype.add=function(t){return!i.isUndefined(t)&&null!==this.insertNode(this.createNode(t))&&(this.nElements++,!0)},t.prototype.clear=function(){this.root=null,this.nElements=0},t.prototype.isEmpty=function(){return 0===this.nElements},t.prototype.size=function(){return this.nElements},t.prototype.contains=function(t){return!i.isUndefined(t)&&null!==this.searchNode(this.root,t)},t.prototype.search=function(t){var e=this.searchNode(this.root,t);if(null!==e)return e.element},t.prototype.remove=function(t){var e=this.searchNode(this.root,t);return null!==e&&(this.removeNode(e),this.nElements--,!0)},t.prototype.inorderTraversal=function(t){this.inorderTraversalAux(this.root,t,{stop:!1})},t.prototype.preorderTraversal=function(t){this.preorderTraversalAux(this.root,t,{stop:!1})},t.prototype.postorderTraversal=function(t){this.postorderTraversalAux(this.root,t,{stop:!1})},t.prototype.levelTraversal=function(t){this.levelTraversalAux(this.root,t)},t.prototype.minimum=function(){if(!this.isEmpty()&&null!==this.root)return this.minimumAux(this.root).element},t.prototype.maximum=function(){if(!this.isEmpty()&&null!==this.root)return this.maximumAux(this.root).element},t.prototype.forEach=function(t){this.inorderTraversal(t)},t.prototype.toArray=function(){var t=[];return this.inorderTraversal((function(e){return t.push(e),!0})),t},t.prototype.height=function(){return this.heightAux(this.root)},t.prototype.searchNode=function(t,e){for(var n=1;null!==t&&0!==n;)(n=this.compare(e,t.element))<0?t=t.leftCh:n>0&&(t=t.rightCh);return t},t.prototype.transplant=function(t,e){null===t.parent?this.root=e:t===t.parent.leftCh?t.parent.leftCh=e:t.parent.rightCh=e,null!==e&&(e.parent=t.parent)},t.prototype.removeNode=function(t){if(null===t.leftCh)this.transplant(t,t.rightCh);else if(null===t.rightCh)this.transplant(t,t.leftCh);else{var e=this.minimumAux(t.rightCh);e.parent!==t&&(this.transplant(e,e.rightCh),e.rightCh=t.rightCh,e.rightCh.parent=e),this.transplant(t,e),e.leftCh=t.leftCh,e.leftCh.parent=e}},t.prototype.inorderTraversalAux=function(t,e,n){null===t||n.stop||(this.inorderTraversalAux(t.leftCh,e,n),n.stop||(n.stop=!1===e(t.element),n.stop||this.inorderTraversalAux(t.rightCh,e,n)))},t.prototype.levelTraversalAux=function(t,e){var n=new s.default;for(null!==t&&n.enqueue(t),t=n.dequeue()||null;null!=t;){if(!1===e(t.element))return;null!==t.leftCh&&n.enqueue(t.leftCh),null!==t.rightCh&&n.enqueue(t.rightCh),t=n.dequeue()||null}},t.prototype.preorderTraversalAux=function(t,e,n){null===t||n.stop||(n.stop=!1===e(t.element),n.stop||(this.preorderTraversalAux(t.leftCh,e,n),n.stop||this.preorderTraversalAux(t.rightCh,e,n)))},t.prototype.postorderTraversalAux=function(t,e,n){null===t||n.stop||(this.postorderTraversalAux(t.leftCh,e,n),n.stop||(this.postorderTraversalAux(t.rightCh,e,n),n.stop||(n.stop=!1===e(t.element))))},t.prototype.minimumAux=function(t){for(;null!=t&&null!==t.leftCh;)t=t.leftCh;return t},t.prototype.maximumAux=function(t){for(;null!=t&&null!==t.rightCh;)t=t.rightCh;return t},t.prototype.heightAux=function(t){return null===t?-1:Math.max(this.heightAux(t.leftCh),this.heightAux(t.rightCh))+1},t.prototype.insertNode=function(t){for(var e=null,n=this.root;null!==n;){var i=this.compare(t.element,n.element);if(0===i)return null;i<0?(e=n,n=n.leftCh):(e=n,n=n.rightCh)}return t.parent=e,null===e?this.root=t:this.compare(t.element,e.element)<0?e.leftCh=t:e.rightCh=t,t},t.prototype.createNode=function(t){return{element:t,leftCh:null,rightCh:null,parent:null}},t}();e.default=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(51),s=function(){function t(){this.list=new i.default}return t.prototype.enqueue=function(t){return this.list.add(t)},t.prototype.add=function(t){return this.list.add(t)},t.prototype.dequeue=function(){if(0!==this.list.size()){var t=this.list.first();return this.list.removeElementAtIndex(0),t}},t.prototype.peek=function(){if(0!==this.list.size())return this.list.first()},t.prototype.size=function(){return this.list.size()},t.prototype.contains=function(t,e){return this.list.contains(t,e)},t.prototype.isEmpty=function(){return this.list.size()<=0},t.prototype.clear=function(){this.list.clear()},t.prototype.forEach=function(t){this.list.forEach(t)},t}();e.default=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(10),s=n(35),r=function(){function t(t){this.data=[],this.compare=t||i.defaultCompare}return t.prototype.leftChildIndex=function(t){return 2*t+1},t.prototype.rightChildIndex=function(t){return 2*t+2},t.prototype.parentIndex=function(t){return Math.floor((t-1)/2)},t.prototype.minIndex=function(t,e){return e>=this.data.length?t>=this.data.length?-1:t:this.compare(this.data[t],this.data[e])<=0?t:e},t.prototype.siftUp=function(t){for(var e=this.parentIndex(t);t>0&&this.compare(this.data[e],this.data[t])>0;)s.swap(this.data,e,t),t=e,e=this.parentIndex(t)},t.prototype.siftDown=function(t){for(var e=this.minIndex(this.leftChildIndex(t),this.rightChildIndex(t));e>=0&&this.compare(this.data[t],this.data[e])>0;)s.swap(this.data,e,t),t=e,e=this.minIndex(this.leftChildIndex(t),this.rightChildIndex(t))},t.prototype.peek=function(){return this.data.length>0?this.data[0]:void 0},t.prototype.add=function(t){return!i.isUndefined(t)&&(this.data.push(t),this.siftUp(this.data.length-1),!0)},t.prototype.removeRoot=function(){if(this.data.length>0){var t=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),t}},t.prototype.contains=function(t){var e=i.compareToEquals(this.compare);return s.contains(this.data,t,e)},t.prototype.size=function(){return this.data.length},t.prototype.isEmpty=function(){return this.data.length<=0},t.prototype.clear=function(){this.data.length=0},t.prototype.forEach=function(t){s.forEach(this.data,t)},t}();e.default=r},function(t,e,n){"use strict";var i,s=this&&this.__extends||(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(29),o=n(10),a=function(t){function e(e,n){var i=t.call(this,n)||this;return i.defaultFactoryFunction=e,i}return s(e,t),e.prototype.setDefault=function(e,n){var i=t.prototype.getValue.call(this,e);return o.isUndefined(i)?(this.setValue(e,n),n):i},e.prototype.getValue=function(t){return this.setDefault(t,this.defaultFactoryFunction())},e}(r.default);e.default=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Fonts=void 0,function(t){t[t.TimesNewRoman=0]="TimesNewRoman",t[t.Kokila=1]="Kokila"}(e.Fonts||(e.Fonts={}))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractTempoExpression=void 0;const i=n(3);class s extends i.AbstractExpression{constructor(t,e,n,i){super(e),this.label=t,this.staffNumber=n,this.parentMultiTempoExpression=i}get Label(){return this.label}set Label(t){this.label=t}get Placement(){return this.placement}set Placement(t){this.placement=t}get StaffNumber(){return this.staffNumber}set StaffNumber(t){this.staffNumber=t}get ParentMultiTempoExpression(){return this.parentMultiTempoExpression}static isStringInStringList(t,e){for(const n of t)if(s.stringContainsSeparatedWord(e.toLowerCase().trim(),n.toLowerCase().trim()))return!0;return!1}static stringContainsSeparatedWord(t,e){return t===e||-1!==t.indexOf(" "+e)||-1!==t.indexOf(e+" ")}}e.AbstractTempoExpression=s},function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.GraphicalUnknownExpression=void 0;const s=n(40),r=n(3),o=i(n(1));class a extends s.AbstractGraphicalExpression{constructor(t,e,n,i,s){super(t,new r.AbstractExpression(n),i),this.label=e,this.sourceMultiExpression=s}updateSkyBottomLine(){const t=this.parentStaffLine.SkyBottomLineCalculator,e=this.label.PositionAndShape.RelativePosition.x+this.label.PositionAndShape.BorderMarginLeft,n=this.label.PositionAndShape.RelativePosition.x+this.label.PositionAndShape.BorderMarginRight;switch(this.Placement){case r.PlacementEnum.Above:const i=this.label.PositionAndShape.BorderMarginTop+this.label.PositionAndShape.RelativePosition.y;t.updateSkyLineInRange(e,n,i);break;case r.PlacementEnum.Below:const s=this.label.PositionAndShape.BorderMarginBottom+this.label.PositionAndShape.RelativePosition.y;t.updateBottomLineInRange(e,n,s);break;default:o.default.error("Placement for GraphicalUnknownExpression is unknown")}}}e.GraphicalUnknownExpression=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SourceMeasure=void 0;const i=n(0),s=n(52),r=n(31),o=n(28),a=n(12),c=n(7),l=n(16),u=n(23);e.SourceMeasure=class{constructor(t,e){this.printNewSystemXml=!1,this.printNewPageXml=!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=t,this.implicitMeasure=!1,this.hasEndLine=!1,this.endingBarStyleXml="",this.endingBarStyleEnum=u.SystemLinesEnum.SingleThin,this.firstInstructionsStaffEntries=new Array(t),this.lastInstructionsStaffEntries=new Array(t),this.rules=e,this.TempoInBPM=0;for(let n=0;n1)return t[this.measureListIndex-1]}get Rules(){return this.rules}get VerticalMeasureList(){return this.verticalMeasureList}set VerticalMeasureList(t){this.verticalMeasureList=t}get TempoInBPM(){return this.tempoInBPM}set TempoInBPM(t){this.tempoInBPM=t}findOrCreateStaffEntry(t,e,n){let i,o=void 0;for(const s of this.verticalSourceStaffEntryContainers)if(s.Timestamp.Equals(t)){i=s;break}if(i)return i.StaffEntries[e]?o=i.StaffEntries[e]:(o=new r.SourceStaffEntry(i,n),i.StaffEntries[e]=o),{createdNewContainer:!1,staffEntry:o};const a=this.verticalSourceStaffEntryContainers[this.verticalSourceStaffEntryContainers.length-1];if(0===this.verticalSourceStaffEntryContainers.length||a.Timestamp.lt(t)){const i=new s.VerticalSourceStaffEntryContainer(this,t.clone(),this.completeNumberOfStaves);this.verticalSourceStaffEntryContainers.push(i),o=new r.SourceStaffEntry(i,n),i.StaffEntries[e]=o}else for(let c=this.verticalSourceStaffEntryContainers.length-1;c>=0;c--){if(this.verticalSourceStaffEntryContainers[c].Timestamp.lt(t)){const i=new s.VerticalSourceStaffEntryContainer(this,t.clone(),this.completeNumberOfStaves);this.verticalSourceStaffEntryContainers.splice(c+1,0,i),o=new r.SourceStaffEntry(i,n),i.StaffEntries[e]=o;break}if(0===c){const i=new s.VerticalSourceStaffEntryContainer(this,t.clone(),this.completeNumberOfStaves);this.verticalSourceStaffEntryContainers.splice(c,0,i),o=new r.SourceStaffEntry(i,n),i.StaffEntries[e]=o;break}}return{createdNewContainer:!0,staffEntry:o}}findOrCreateVoiceEntry(t,e){let n=void 0,i=!1;for(const s of t.VoiceEntries)if(s.ParentVoice===e){n=s;break}return n||(n=new a.VoiceEntry(t.Timestamp,e,t),t.VoiceEntries.push(n),i=!0),{createdVoiceEntry:i,voiceEntry:n}}getPreviousSourceStaffEntryFromIndex(t,e){for(let n=e-1;n>=0;n--)if(this.verticalSourceStaffEntryContainers[n][t])return this.verticalSourceStaffEntryContainers[n][t]}getVerticalContainerIndexByTimestamp(t){for(let e=0,n=this.VerticalSourceStaffEntryContainers.length;e=0;r--){const t=this.verticalSourceStaffEntryContainers[r][n+s];if(void 0!==t&&t.hasTie()&&e.lt(i.Fraction.plus(t.Timestamp,t.calculateMaxNoteLength()))){e=i.Fraction.plus(t.Timestamp,t.calculateMaxNoteLength());break}}}s.push(e)}for(let i=0,r=s.length;i0)return!0}return!1}beginsWithLineRepetition(){for(let t=0,e=this.FirstRepetitionInstructions.length;t=0&&(e=this.verticalSourceStaffEntryContainers[n].StaffEntries[t],!e);n--);return e}canBeReducedToMultiRest(){if(!this.allRests||this.hasLyrics||this.hasMoodExpressions||this.tempoExpressions.length>0)return!1;for(const t of this.staffLinkedExpressions)if(t.length>0)return!1;for(const t of this.lastInstructionsStaffEntries)for(let e=0,n=null==t?void 0:t.Instructions.length;ei?1:0}getFirstNonNullStaffEntry(){for(let t=0,e=this.staffEntries.length;t0&&this.finalizeCurrentAndCreateNewSystem(this.measureList[this.measureList.length-1],!this.rules.StretchLastSystemLine,!1),this.musicSystems}calculateSystemYLayout(){for(const t of this.musicSystems)this.optimizeDistanceBetweenStaffLines(t);this.calculateMusicSystemsRelativePositions()}setMeasureWidth(t,e,n,i){for(let s=0,r=t.length;s0&&(r.beginInstructionsWidth=n),i>0&&(r.endInstructionsWidth=i)}}finalizeCurrentAndCreateNewSystem(t,e=!1,n=!0,i=!1){this.currentSystemParams.currentSystem.breaksPage=i,this.adaptRepetitionLineWithIfNeeded(),void 0!==t&&n&&this.checkAndCreateExtraInstructionMeasure(t),this.stretchMusicSystem(e),this.currentSystemParams=new m,void 0!==t&&this.measureListIndex=1){const e=this.currentSystemParams.currentSystem.GraphicalMeasures[this.currentSystemParams.currentSystem.GraphicalMeasures.length-1],n=t[t.length-1];let i=0;n.endLine===u.SystemLinesEnum.DotsBoldBoldDots&&(n.endLine=u.SystemLinesEnum.DotsThinBold,i=e[0].getLineWidth(u.SystemLinesEnum.DotsBoldBoldDots)/2-e[0].getLineWidth(u.SystemLinesEnum.DotsThinBold)),this.currentSystemParams.currentSystemFixWidth-=i;for(let t=0,s=e.length;t1){r=!0;break}let o=0;for(let a=0;a0&&(this.currentSystemParams.systemMeasures.push({beginLine:u.SystemLinesEnum.None,endLine:u.SystemLinesEnum.None}),this.currentSystemParams.currentWidth+=i,this.currentSystemParams.currentSystemFixWidth+=i)}addExtraInstructionMeasure(t,e,n){const i=this.currentSystemParams.currentSystem,s=h.MusicSheetCalculator.symbolFactory.createExtraGraphicalMeasure(i.StaffLines[t]);[].push(s),e&&s.addKeyAtBegin(e,this.activeKeys[t],this.activeClefs[t]),void 0!==n&&n.PrintObject&&s.addRhythmAtBegin(n),s.PositionAndShape.BorderLeft=0,s.PositionAndShape.BorderTop=0,s.PositionAndShape.BorderBottom=this.rules.StaffHeight;const r=this.rules.MeasureLeftMargin+s.beginInstructionsWidth+this.rules.MeasureRightMargin;return s.PositionAndShape.BorderRight=r,i.StaffLines[t].Measures.push(s),r}addStaveMeasuresToSystem(t){if(t[0]){const e=[];for(let i=0;i1){const e=Math.min(this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures.length-1,t.measureListIndex+t.multipleRestMeasures-1);t=this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures[e]}}finally{}return this.nextMeasureBeginsLineRepetition()&&this.thisMeasureEndsLineRepetition()?u.SystemLinesEnum.DotsBoldBoldDots:this.thisMeasureEndsLineRepetition()?u.SystemLinesEnum.DotsThinBold:this.nextMeasureHasKeyInstructionChange()||this.thisMeasureEndsWordRepetition()||this.nextMeasureBeginsWordRepetition()?u.SystemLinesEnum.DoubleThin:t&&void 0!==t.endingBarStyleEnum?t.endingBarStyleEnum:u.SystemLinesEnum.SingleThin}getLineWidth(t,e,n){let i=t.getLineWidth(e);return e===u.SystemLinesEnum.DotsBoldBoldDots&&(i/=2),n&&e===u.SystemLinesEnum.BoldThinDots&&(i+=this.rules.DistanceBetweenLastInstructionAndRepetitionBarline),i}previousMeasureEndsLineRepetition(){if(0===this.measureListIndex)return!1;for(let t=0,e=this.measureList[this.measureListIndex-1].length;t=this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures.length||!this.measureList[t])return!1;for(let e=0,n=this.measureList[t].length;e=this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures.length||t>this.measureList.length-1)return!1;for(let e=0,n=this.measureList[t].length;ethis.rules.PageHeight-this.rules.PageBottomMargin&&(i++,i<=4&&console.log("warning: could not fit a single system on page "+t.PageNumber+` and measure number ${n.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 i=this.musicSystems[s-1],r=i.StaffLines[i.StaffLines.length-1],o=r.PositionAndShape;let a=this.findRequiredDistanceWithSkyBottomLine(i,n);a+=this.rules.MinSkyBottomDistBetweenSystems,a=Math.max(a,this.rules.MinimumDistanceBetweenSystems+r.StaffHeight);const l=e+o.RelativePosition.y+a,u=l+n.PositionAndShape.BorderMarginBottom;if(this.rules.NewPageAtXMLNewPageAttribute&&i.breaksPage||!(u0&&console.log(`total amount of pages that couldn't fit a single music system: ${i} of ${t.PageNumber}`),this.rules.PageBottomExtraWhiteSpace>0&&1===this.graphicalMusicSheet.MusicPages.length){t.PositionAndShape.calculateBoundingBox();const e=new a.BoundingBox(t,t.PositionAndShape,!1);e.RelativePosition.y=t.PositionAndShape.BorderMarginBottom,e.BorderBottom=this.rules.PageBottomExtraWhiteSpace,e.calculateBoundingBox(),t.PositionAndShape.calculateBoundingBox()}}findRequiredDistanceWithSkyBottomLine(t,e){const n=t.StaffLines[t.StaffLines.length-1],i=e.StaffLines[0],s=n.BottomLine,r=i.SkyLine,o=n.PositionAndShape,a=i.PositionAndShape,c=1/this.rules.SamplingUnit;let l=0;for(let u=0;u=r.length)break;const n=Math.max(0,e-6),i=Math.min(r.length-1,e+6);let h=0;for(let s=n;s<=i;s++)h=Math.min(h,r[s]);const d=t-h;l=Math.max(d,l)}return 0===l&&(l=o.BorderBottom-a.BorderTop),l}};class m{constructor(){this.systemMeasures=[],this.systemMeasureIndex=0,this.currentWidth=0,this.currentSystemFixWidth=0,this.currentSystemVarWidth=0,this.maxLabelLength=0}IsSystemStartMeasure(){return 0===this.systemMeasureIndex}}e.SystemBuildParameters=m,e.MeasureBuildParameters=class{}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Clickable=void 0;const i=n(6);class s extends i.GraphicalObject{}e.Clickable=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.OctaveShiftParams=void 0,e.OctaveShiftParams=class{constructor(t,e,n){this.getOpenOctaveShift=t,this.getAbsoluteStartTimestamp=e,this.getAbsoluteEndTimestamp=n}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AccidentalCalculator=void 0;const i=n(2),s=n(2),r=n(19),o=n(15);e.AccidentalCalculator=class{constructor(){this.keySignatureNoteAlterationsDict=new r.Dictionary,this.currentAlterationsComparedToKeyInstructionList=[],this.currentInMeasureNoteAlterationsDict=new r.Dictionary}get ActiveKeyInstruction(){return this.activeKeyInstruction}set ActiveKeyInstruction(t){this.activeKeyInstruction=t,this.reactOnKeyInstructionChange()}doCalculationsAtEndOfMeasure(){this.currentInMeasureNoteAlterationsDict.clear();for(const t of this.keySignatureNoteAlterationsDict.keys())this.currentInMeasureNoteAlterationsDict.setValue(t,this.keySignatureNoteAlterationsDict.getValue(t))}checkAccidental(t,e){if(!e)return;const n=e.FundamentalNote+12*e.Octave,r=this.currentAlterationsComparedToKeyInstructionList.indexOf(n)>=0;this.currentInMeasureNoteAlterationsDict.containsKey(n)?(r&&this.currentAlterationsComparedToKeyInstructionList.splice(this.currentAlterationsComparedToKeyInstructionList.indexOf(n),1),this.currentInMeasureNoteAlterationsDict.getValue(n)!==e.AccidentalHalfTones&&(this.keySignatureNoteAlterationsDict.containsKey(n)&&this.keySignatureNoteAlterationsDict.getValue(n)!==e.AccidentalHalfTones?(this.currentAlterationsComparedToKeyInstructionList.push(n),this.currentInMeasureNoteAlterationsDict.setValue(n,e.AccidentalHalfTones)):this.currentInMeasureNoteAlterationsDict.remove(n),e.Accidental===i.AccidentalEnum.NONE&&(e=new s.Pitch(e.FundamentalNote,e.Octave,i.AccidentalEnum.NATURAL)),o.MusicSheetCalculator.symbolFactory.addGraphicalAccidental(t,e))):e.Accidental!==i.AccidentalEnum.NONE?(r||this.currentAlterationsComparedToKeyInstructionList.push(n),this.currentInMeasureNoteAlterationsDict.setValue(n,e.AccidentalHalfTones),o.MusicSheetCalculator.symbolFactory.addGraphicalAccidental(t,e)):r&&(e=new s.Pitch(e.FundamentalNote,e.Octave,i.AccidentalEnum.NATURAL),this.currentAlterationsComparedToKeyInstructionList.splice(this.currentAlterationsComparedToKeyInstructionList.indexOf(n),1),o.MusicSheetCalculator.symbolFactory.addGraphicalAccidental(t,e))}reactOnKeyInstructionChange(){const t=this.activeKeyInstruction.AlteratedNotes;let e;e=this.activeKeyInstruction.Key>0?i.AccidentalEnum.SHARP:i.AccidentalEnum.FLAT,this.keySignatureNoteAlterationsDict.clear(),this.currentAlterationsComparedToKeyInstructionList.length=0;for(let n=-9;n<9;n++)for(let i=0;i0){const e=.3;r=i.preCalculateMinTotalWidth(n)/u.unitInPixels*this.rules.VoiceSpacingMultiplierVexflow+this.rules.VoiceSpacingAddendVexflow+t[0].staffEntries.length*e,s.MusicSheetCalculator.setMeasuresMinStaffEntriesWidth(t,r);const o=(t,e)=>{i.formatToStave(n,e.getVFStave())},a=(t,e)=>{i.formatToStave(n,e.getVFStave(),{align_rests:!0,context:void 0})};for(const n of t){if(this.rules.AlignRests===v.AlignRestOption.Never)n.formatVoices=o;else if(this.rules.AlignRests===v.AlignRestOption.Always)n.formatVoices=a;else if(this.rules.AlignRests===v.AlignRestOption.Auto){let t=!1;for(const e of n.staffEntries){let n=0,i=0;for(const s of e.graphicalVoiceEntries)if(s.parentVoiceEntry.IsGrace||s&&s.notes&&s.notes[0]&&s.notes[0].sourceNote&&s.notes[0].sourceNote.PrintObject&&n++,s&&s.notes&&s.notes[0]&&s.notes[0].sourceNote&&s.notes[0].sourceNote.isRest()&&s.notes[0].sourceNote.PrintObject&&i++,n>1&&i>=1){t=!0;break}if(t)break}n.formatVoices=t?a:o}if(n===t[0]){const t=n;t.formatVoices(r*u.unitInPixels,t)}}}for(const s of t)if(s)for(const t of s.staffEntries)t.calculateXPosition();return r}calculateMeasureWidthFromLyrics(t,e){let n=1;for(const i of t){if(!i)continue;const t={};for(let s=0;s0&&(c=this.rules.BetweenSyllableMinimumDistance,m.TextAlignment.IsCenterAligned(o.GraphicalLabel.Label.textAlignment)&&(c+=1));const t=o.ParentLyricWord.GetLyricWord.Syllables;t.length>1&&o.LyricsEntry.SyllableIndex4&&(x*=1.1)}y=Math.max(S,x),n=Math.max(n,y),t[s]={extend:o.LyricsEntry.extend,labelWidth:h,lyricsXPosition:d,measureNumber:i.MeasureNumber,sourceNoteDuration:o.LyricsEntry.Parent.Notes[0].Length,text:o.LyricsEntry.Text}}}}return n=Math.min(n,this.rules.MaximumLyricsElongationFactor),e*n}createGraphicalTie(t,e,n,i,s){return new o.GraphicalTie(t,i,s)}updateStaffLineBorders(t){t.SkyBottomLineCalculator.updateStaffLineBorders()}graphicalMeasureCreatedCalculations(t){t.rules=this.rules,t.graphicalMeasureCreatedCalculations()}layoutVoiceEntry(t,e,n,i){for(let r=0;r=2&&(r=i.vfnote[0],o=i.vfnote[1]);let a=void 0,l=0;if(s&&s.vfnote&&s.vfnote.length>=2&&(a=s.vfnote[0],l=s.vfnote[1]),e){if(r){const t=new c.default.Flow.StaveTie({first_indices:[o],first_note:r});i.parentVoiceEntry.parentStaffEntry.parentMeasure.vfTies.push(t)}if(a){const t=new c.default.Flow.StaveTie({last_indices:[l],last_note:a});s.parentVoiceEntry.parentStaffEntry.parentMeasure.vfTies.push(t)}}else if(r||a){let e;if(n)if("S"===t.Tie.Type){const n=t.StartNote.sourceNote,i=t.EndNote.sourceNote;let s=1;n.FretNumber>i.FretNumber&&(s=-1),e=new c.default.Flow.TabSlide({first_indices:[o],first_note:r,last_indices:[l],last_note:a},s)}else e=new c.default.Flow.TabTie({first_indices:[o],first_note:r,last_indices:[l],last_note:a},t.Tie.Type);else e=new c.default.Flow.StaveTie({first_indices:[o],first_note:r,last_indices:[l],last_note:a});s.parentVoiceEntry.parentStaffEntry.parentMeasure.vfTies.push(e)}}calculateDynamicExpressionsForMultiExpression(t,e,n){if(ethis.rules.MaxMeasureToDrawIndex)return;const i=t.AbsoluteTimestamp,s=this.graphicalMusicSheet.MeasureList[e],r=s[n].ParentStaffLine,o=s[n],a=this.getRelativePositionInStaffLineFromTimestamp(i,n,r,null==r?void 0:r.isPartOfMultiStaffInstrument()),c=a;if(a.x<=0&&(c.x=o.beginInstructionsWidth+this.rules.RhythmRightMargin),t.InstantaneousDynamic){const e=new p.VexFlowInstantaneousDynamicExpression(t.InstantaneousDynamic,r,o);this.calculateGraphicalInstantaneousDynamicExpression(e,c)}if(t.StartingContinuousDynamic){const e=t.StartingContinuousDynamic,n=new b.VexFlowContinuousDynamicExpression(t.StartingContinuousDynamic,r,o.parentSourceMeasure);if(n.StartMeasure=o,!n.IsVerbal&&e.EndMultiExpression)try{this.calculateGraphicalContinuousDynamic(n,c)}catch(t){}else n.IsVerbal?this.calculateGraphicalVerbalContinuousDynamic(n,c):l.default.warn("This continuous dynamic is not covered")}}createMetronomeMark(t){const e=Math.max(t.ParentMultiTempoExpression.SourceMeasureParent.MeasureNumber-1,0),n=Math.max(t.StaffNumber-1,0),i=0===e&&0===n,s=this.graphicalMusicSheet.MeasureList[e][n].getVFStave();let r="q";if(t.beatUnit){const e=S.NoteTypeHandler.getNoteDurationFromType(t.beatUnit);r=x.VexFlowConverter.duration(e,!1)}s.setTempo({bpm:t.TempoInBpm,dots:t.dotted,duration:r},this.rules.MetronomeMarkYShift*u.unitInPixels);const o=i?this.rules.MetronomeMarkXShift*u.unitInPixels:0;s.getModifiers()[s.getModifiers().length-1].setShiftX(o);const a=this.graphicalMusicSheet.MeasureList[0][0].ParentStaffLine.SkyLine;a[0]=Math.min(a[0],-4.5+this.rules.MetronomeMarkYShift)}calculateSingleOctaveShift(t,e,n,i){var s;const r=e.OctaveShiftStart,o=r.ParentStartMultiExpression.Timestamp,a=null===(s=r.ParentEndMultiExpression)||void 0===s?void 0:s.Timestamp,c=this.rules.MinMeasureToDrawIndex,u=this.rules.MaxMeasureToDrawIndex;let h=this.graphicalMusicSheet.MeasureList[n][i].ParentStaffLine;h||(h=this.graphicalMusicSheet.MeasureList[c][i].ParentStaffLine);let d=void 0;d=r.ParentEndMultiExpression?this.graphicalMusicSheet.getGraphicalMeasureFromSourceMeasureAndIndex(r.ParentEndMultiExpression.SourceMeasureParent,i):this.graphicalMusicSheet.getLastGraphicalMeasureFromIndex(i,!0),d.MeasureNumber>u+1&&(d=this.graphicalMusicSheet.getLastGraphicalMeasureFromIndex(i,!0));let p=void 0;if(p=r.ParentEndMultiExpression?this.graphicalMusicSheet.getGraphicalMeasureFromSourceMeasureAndIndex(r.ParentStartMultiExpression.SourceMeasureParent,i):this.graphicalMusicSheet.MeasureList[c][i],p.MeasureNumberu+1||d.MeasureNumberu+1)return;let m=d.ParentStaffLine;if(m||(m=h),d&&h&&m){const t=new f.VexFlowOctaveShift(r,h.PositionAndShape);if(!t.startNote){let e;for(const t of p.staffEntries)if(t){e=t;break}if(!e)return;if(t.setStartNote(e),!t.startNote)return}if(!t.endNote){let e;for(let t=d.staffEntries.length-1;t>=0;t++)if(d.staffEntries[t]){e=d.staffEntries[t];break}if(t.setEndNote(e),!t.endNote)return}h.OctaveShifts.push(t);let e=p.findGraphicalStaffEntryFromTimestamp(o);e||(e=p.staffEntries[0]);let n=d.findGraphicalStaffEntryFromTimestamp(a);if(n||(n=d.staffEntries[d.staffEntries.length-1]),t.setStartNote(e),m!==h){t.endsOnDifferentStaffLine=!0;let i=h.Measures[h.Measures.length-1];i||(i=d);const s=i.staffEntries[i.staffEntries.length-1];t.setEndNote(s);const o=new f.VexFlowOctaveShift(r,d.PositionAndShape);m.OctaveShifts.push(o);let a=m.Measures[0];a||(a=p);const c=a.staffEntries[0];o.setStartNote(c),o.setEndNote(n),this.calculateOctaveShiftSkyBottomLine(e,s,t,h),this.calculateOctaveShiftSkyBottomLine(c,n,o,m)}else t.setEndNote(n),this.calculateOctaveShiftSkyBottomLine(e,n,t,h)}else l.default.warn("End measure or staffLines for octave shift are undefined! This should not happen!")}calculateOctaveShiftSkyBottomLine(t,e,n,i){const s=t.PositionAndShape.AbsolutePosition.x-t.PositionAndShape.Size.width/2,r=e.PositionAndShape.AbsolutePosition.x+e.PositionAndShape.Size.width/2;n.PositionAndShape.Size.width=s-r;const o=n.getTextBracket(),a=o.font.size/10;if(o.position===c.default.Flow.TextBracket.Positions.TOP){const t=Math.ceil(i.SkyBottomLineCalculator.getSkyLineMinInRange(s,r));if(t===1/0)return;o.start.getStave().options.top_text_position=Math.abs(t),i.SkyBottomLineCalculator.updateSkyLineInRange(s,r,t-2*a)}else{const t=i.SkyBottomLineCalculator.getBottomLineMaxInRange(s,r);if(t===1/0)return;o.start.getStave().options.bottom_text_position=t,i.SkyBottomLineCalculator.updateBottomLineInRange(s,r,t+1.5*a)}}calculateWordRepetitionInstruction(t,e){let n=void 0;const i=this.graphicalMusicSheet.MeasureList[e];for(let s=0,r=i.length;s{t.updateSkyBottomLine()})}catch(t){}}handleTiedGraphicalNote(t,e,n,i,s,r,o,a){}handleBeam(t,e,n){t.parentVoiceEntry.parentStaffEntry.parentMeasure.handleBeam(t,e)}handleVoiceEntryLyrics(t,e,n){t.LyricsEntries.forEach((t,i)=>{const s=new h.GraphicalLyricEntry(i,e,this.rules.LyricsHeight,this.rules.StaffHeight);if(e.LyricsEntries.push(s),s.GraphicalLabel.setLabelPositionAndShapeBorders(),i.Word){const t=i.Word.Syllables.indexOf(i);let e=n.indexOf(i.Word);if(-1===e&&(n.push(i.Word),e=n.indexOf(i.Word)),0===this.graphicalLyricWords.length||e>this.graphicalLyricWords.length-1){const e=new d.GraphicalLyricWord(i.Word);s.ParentLyricWord=e,e.GraphicalLyricsEntries[t]=s,this.graphicalLyricWords.push(e)}else{const i=this.graphicalLyricWords[e];s.ParentLyricWord=i,i.GraphicalLyricsEntries[t]=s,i.isFilled()&&(n.splice(e,1),this.graphicalLyricWords.splice(this.graphicalLyricWords.indexOf(i),1))}}})}handleVoiceEntryOrnaments(t,e,n){}handleVoiceEntryArticulations(t,e,n){}handleVoiceEntryTechnicalInstructions(t,e,n){}handleTuplet(t,e,n){t.parentVoiceEntry.parentStaffEntry.parentMeasure.handleTuplet(t,e)}findIndexGraphicalSlurFromSlur(t,e){for(let n=0;n=0){const t=e[n];-1===t.staffEntries.indexOf(i)&&t.staffEntries.push(i),e.splice(n,1)}}}for(const t of e)-1===t.staffEntries.indexOf(i)&&t.staffEntries.push(i)}}for(const e of this.musicSystems)for(const t of e.StaffLines){const e=t.GraphicalSlurs.sort(g.GraphicalSlur.Compare);for(const t of e)t.slur.isCrossed()||t.calculateCurve(this.rules)}}}e.VexFlowMusicSheetCalculator=_},function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.VexFlowGraphicalSymbolFactory=void 0;const s=i(n(9)),r=n(98),o=n(49),a=n(107),c=n(30),l=n(70),u=n(110),h=n(68),d=n(14),f=n(153),p=n(111),m=n(154);e.VexFlowGraphicalSymbolFactory=class{createMusicSystem(t,e){return new r.VexFlowMusicSystem(t,e)}createStaffLine(t,e){return new p.VexFlowStaffLine(t,e)}createGraphicalMeasure(t,e,n=!1){return new o.VexFlowMeasure(e,t,void 0)}createMultiRestMeasure(t,e,n){return new m.VexFlowMultiRestMeasure(e,t,n)}createTabStaffMeasure(t,e){return new f.VexFlowTabMeasure(e,t)}createExtraGraphicalMeasure(t){return new o.VexFlowMeasure(t.ParentStaff,void 0,t)}createStaffEntry(t,e){return new a.VexFlowStaffEntry(e,t,void 0)}createVoiceEntry(t,e){return new h.VexFlowVoiceEntry(t,e)}createNote(t,e,n,i=c.OctaveEnum.NONE,s){return new l.VexFlowGraphicalNote(t,e,n,i,s)}createGraceNote(t,e,n,i=c.OctaveEnum.NONE){return new l.VexFlowGraphicalNote(t,e,n,i)}addGraphicalAccidental(t,e){t.setAccidental(e)}addFermataAtTiedEndNote(t,e){}createInStaffClef(t,e){const n=t,i=d.VexFlowConverter.Clef(e,"small");n.vfClefBefore=new s.default.Flow.ClefNote(i.type,i.size,i.annotation)}createChordSymbols(t,e,n,i){const s=e.parentMeasure.parentSourceMeasure.Rules;let r=0;const o=s.ChordSymbolXSpacing;for(const a of t.ChordContainers){const t=new u.GraphicalChordSymbolContainer(a,e.PositionAndShape,s.ChordSymbolTextHeight,n,i,e.parentMeasure.parentSourceMeasure.Rules),c=t.GetGraphicalLabel;c.PositionAndShape.RelativePosition.y-=s.ChordSymbolYOffset,c.PositionAndShape.RelativePosition.x+=r,c.setLabelPositionAndShapeBorders(),t.PositionAndShape.calculateBoundingBox(),e.graphicalChordContainers.push(t),r+=c.PositionAndShape.Size.width+o}}createGraphicalTechnicalInstruction(t,e){}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.VexFlowMusicSystem=void 0;const i=n(99),s=n(101),r=n(14),o=n(67),a=n(104);class c extends i.MusicSystem{constructor(t,e){super(t),this.rules=e}calculateBorders(t){if(0===this.staffLines.length)return;const e=this.calcBracketsWidth();this.boundingBox.BorderLeft=-e,this.boundingBox.BorderMarginLeft=-e,this.boundingBox.XBordersHaveBeenSet=!0;const n=this.staffLines[0].SkyBottomLineCalculator.getSkyLineMin();this.boundingBox.BorderTop=n,this.boundingBox.BorderMarginTop=n;const i=this.staffLines[this.staffLines.length-1],s=i.SkyBottomLineCalculator.getBottomLineMax()+i.PositionAndShape.RelativePosition.y;this.boundingBox.BorderBottom=s,this.boundingBox.BorderMarginBottom=s,this.boundingBox.XBordersHaveBeenSet=!0,this.boundingBox.YBordersHaveBeenSet=!0}createSystemLine(t,e,n,i,o,a,c){const l=a;let u=!1;return c&&(u=!0,c.lineTo(a,r.VexFlowConverter.line(n,i)),c.addMeasureLine(n,i)),l.addMeasureLine(n,i,u),new s.SystemLine(n,i,this,a,c)}createInstrumentBracket(t,e){const n=t,i=e,s=new a.VexFlowInstrumentBrace(n,i);this.InstrumentBrackets.push(s)}createGroupBracket(t,e,n){const i=t,s=e;if(0===n){const t=new o.VexFlowInstrumentBracket(i,s,n);this.GroupBrackets.push(t)}else{const t=new a.VexFlowInstrumentBrace(i,s,n);this.GroupBrackets.push(t)}}}e.VexFlowMusicSystem=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MusicSystem=void 0;const i=n(60),s=n(4),r=n(0),o=n(8),a=n(24),c=n(6),l=n(5),u=n(23),h=n(19),d=n(38),f=n(13);class p extends c.GraphicalObject{constructor(t){super(),this.needsToBeRedrawn=!0,this.staffLines=[],this.graphicalMeasures=[],this.labels=new h.Dictionary,this.measureNumberLabels=[],this.objectsToRedraw=[],this.instrumentBrackets=[],this.groupBrackets=[],this.graphicalMarkedAreas=[],this.graphicalComments=[],this.systemLines=[],this.breaksPage=!1,this.id=t,this.boundingBox=new s.BoundingBox(this),this.maxLabelLength=0}get Parent(){return this.parent}set Parent(t){if(this.parent){const t=this.parent.MusicSystems.indexOf(this,0);t>-1&&this.parent.MusicSystems.splice(t,1)}this.parent=t,this.boundingBox.Parent=t.PositionAndShape}get NextSystem(){const t=this.Parent.MusicSystems.indexOf(this);return t!==this.Parent.MusicSystems.length?this.Parent.MusicSystems[t+1]:void 0}get StaffLines(){return this.staffLines}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}createSystemLeftLine(t,e,n){let i=-t/2;n&&(i=this.maxLabelLength+e-t/2);const s=this.staffLines[0].Measures[0];let r=void 0;this.staffLines.length>1&&(r=this.staffLines[this.staffLines.length-1].Measures[0]);const o=this.createSystemLine(i,t,u.SystemLinesEnum.SingleThin,d.SystemLinePosition.MeasureBegin,this,s,r);this.SystemLines.push(o),o.PositionAndShape.RelativePosition=new l.PointF2D(i,0),o.PositionAndShape.BorderLeft=0,o.PositionAndShape.BorderRight=t,o.PositionAndShape.BorderTop=0,o.PositionAndShape.BorderBottom=this.boundingBox.Size.height,this.createLinesForSystemLine(o)}createVerticalLineForMeasure(t,e,n,i,s,r){const o=r.ParentStaffLine,a=new l.PointF2D(o.PositionAndShape.RelativePosition.x,o.PositionAndShape.RelativePosition.y),c=o.ParentStaff.ParentInstrument.Staves;if(o.ParentStaff===c[0]){let u=void 0;c.length>1&&(u=this.getBottomStaffLine(o).Measures[s]);const h=this.createSystemLine(t,e,n,i,this,r,u),d=a.x+t;h.PositionAndShape.RelativePosition=new l.PointF2D(d,0),h.PositionAndShape.BorderLeft=0,h.PositionAndShape.BorderRight=e,this.SystemLines.push(h)}}setYPositionsToVerticalLineObjectsAndCreateLines(t){}calculateBorders(t){}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(t){for(let e=0,n=t.length;e1){let t=void 0,n=void 0;for(let i=0,s=this.staffLines.length;ithis.maxLabelLength&&(this.maxLabelLength=t.PositionAndShape.Size.width,e=r)}this.updateMusicSystemStaffLineXPosition(e)}setMusicSystemLabelsYPosition(){this.labels.forEach((t,e)=>{let n=0,i=0;for(let s=0;s0&&(e.PositionAndShape.RelativePosition=new l.PointF2D(0,n/i+2))})}checkStaffEntriesForStaffEntryLink(){let t=!1,e=!1;for(let n=0;n=0;n--){if(e=t.InstrumentalGroups[n],!(e instanceof i.Instrument))return this.findLastVisibleInstrumentInInstrumentalGroup(e);if(!0===e.Visible)return e}}updateMusicSystemStaffLineXPosition(t){for(let e=0,n=this.StaffLines.length;e0&&this.drawDashes(s.LyricsDashes),s.LyricLines.length>0&&this.drawLyricLines(s.LyricLines,s));for(const s of t.SystemLines)this.drawSystemLineObject(s);if(t.Parent===t.Parent.Parent.MusicPages[0])for(const o of t.Labels)this.drawLabel(o,s.GraphicalLayers.Notes);for(const s of t.InstrumentBrackets)this.drawInstrumentBrace(s,t);for(const s of t.GroupBrackets)this.drawGroupBracket(s,t);if(!this.leadSheet)for(const o of t.MeasureNumberLabels)this.drawLabel(o,s.GraphicalLayers.Notes);for(const s of t.StaffLines)this.drawStaffLineSymbols(s);this.drawingParameters.drawMarkedAreas&&this.drawMarkedAreas(t),this.drawingParameters.drawComments&&this.drawComment(t)}activateSystemRendering(t,e,n,i){return!0}drawSystemLineObject(t){}drawStaffLine(t){for(const e of t.Measures)this.drawMeasure(e);this.rules.RenderLyrics&&t.LyricsDashes.length>0&&this.drawDashes(t.LyricsDashes),this.drawOctaveShifts(t),this.drawExpressions(t),this.skyLineVisible&&this.drawSkyLine(t),this.bottomLineVisible&&this.drawBottomLine(t)}drawLyricLines(t,e){e.LyricLines.forEach(t=>{t.Start.y+=e.PositionAndShape.AbsolutePosition.y,t.End.y+=e.PositionAndShape.AbsolutePosition.y,t.Start.x+=e.PositionAndShape.AbsolutePosition.x,t.End.x+=e.PositionAndShape.AbsolutePosition.x,this.drawGraphicalLine(t,this.rules.LyricUnderscoreLineWidth)})}drawExpressions(t){}drawGraphicalLine(t,e,n="black"){this.drawLine(t.Start,t.End,n,e)}drawLine(t,e,n="#FF0000FF",i){}drawDashes(t){t.forEach(t=>this.drawLabel(t,s.GraphicalLayers.Notes))}drawOctaveShifts(t){}drawStaffLines(t){if(t.StaffLines){const e=t.PositionAndShape.AbsolutePosition;for(let n=0;n<5;n++)this.drawLineAsHorizontalRectangleWithOffset(t.StaffLines[n],e,s.GraphicalLayers.Notes)}}drawInstantaneousDynamic(t){throw new Error("not implemented")}drawContinuousDynamic(t){throw new Error("not implemented")}drawSymbol(t,e,n,i=1,r=s.GraphicalLayers.Notes){}get leadSheet(){return this.graphicalMusicSheet.LeadSheet}set leadSheet(t){this.graphicalMusicSheet.LeadSheet=t}drawPage(t){if(this.isVisible(t.PositionAndShape)){for(const e of t.MusicSystems)this.isVisible(e.PositionAndShape)&&this.drawMusicSystem(e);if(t===t.Parent.MusicPages[0])for(const e of t.Labels)this.drawLabel(e,s.GraphicalLayers.Notes);this.drawableBoundingBoxElement&&this.drawBoundingBoxes(t.PositionAndShape,0,this.drawableBoundingBoxElement)}}drawBoundingBoxes(t,e=0,n="all"){const i=t.DataObject.constructor.name;if(i===n||"all"===n){let n=new o.RectangleF2D(t.AbsolutePosition.x+t.BorderMarginLeft,t.AbsolutePosition.y+t.BorderMarginTop,t.BorderMarginRight-t.BorderMarginLeft,t.BorderMarginBottom-t.BorderMarginTop);this.drawLineAsHorizontalRectangle(new r.GraphicalLine(new a.PointF2D(t.AbsolutePosition.x-1,t.AbsolutePosition.y),new a.PointF2D(t.AbsolutePosition.x+1,t.AbsolutePosition.y),.1,s.OutlineAndFillStyleEnum.BaseWritingColor),e-1),this.drawLineAsVerticalRectangle(new r.GraphicalLine(new a.PointF2D(t.AbsolutePosition.x,t.AbsolutePosition.y-1),new a.PointF2D(t.AbsolutePosition.x,t.AbsolutePosition.y+1),.1,s.OutlineAndFillStyleEnum.BaseWritingColor),e-1),n=this.applyScreenTransformationForRect(n),this.renderRectangle(n,s.GraphicalLayers.Background,e,.5);const h=new l.Label(i);this.renderLabel(new c.GraphicalLabel(h,.8,u.TextAlignmentEnum.CenterCenter,this.rules),e,n.width,n.height,n.height,new a.PointF2D(n.x,n.y+12))}e++,t.ChildElements.forEach(t=>this.drawBoundingBoxes(t,e,n))}drawMarkedAreas(t){for(const e of t.GraphicalMarkedAreas)e&&(e.systemRectangle&&this.drawRectangle(e.systemRectangle,s.GraphicalLayers.Background),e.settings&&this.drawLabel(e.settings,s.GraphicalLayers.Comment),e.labelRectangle&&this.drawRectangle(e.labelRectangle,s.GraphicalLayers.Background),e.label&&this.drawLabel(e.label,s.GraphicalLayers.Comment))}drawComment(t){for(const e of t.GraphicalComments)e&&(e.settings&&this.drawLabel(e.settings,s.GraphicalLayers.Comment),e.label&&this.drawLabel(e.label,s.GraphicalLayers.Comment))}drawStaffLineSymbols(t){const e=t.ParentStaff.ParentInstrument,n=t.PositionAndShape.AbsolutePosition.x,i=t.PositionAndShape.AbsolutePosition.y+2,o=t.PositionAndShape.BorderRight;e.highlight&&this.drawingParameters.drawHighlights&&this.drawLineAsHorizontalRectangle(new r.GraphicalLine(new a.PointF2D(n,i),new a.PointF2D(n+o,i),4,s.OutlineAndFillStyleEnum.Highlighted),s.GraphicalLayers.Highlight);let c=f.MusicSymbolDrawingStyle.Disabled,l=d.MusicSymbol.PLAY,u=this.drawingParameters.drawActivitySymbols;switch(this.phonicScoreMode){case f.PhonicScoreModes.Midi:l=d.MusicSymbol.PLAY,this.midiPlaybackAvailable&&t.ParentStaff.audible&&(c=f.MusicSymbolDrawingStyle.PlaybackSymbols);break;case f.PhonicScoreModes.Following:l=d.MusicSymbol.MIC,t.ParentStaff.following&&(c=f.MusicSymbolDrawingStyle.FollowSymbols);break;default:u=!1}if(u){const t=new a.PointF2D(n+o+2,i);this.drawSymbol(l,c,t)}if(this.drawingParameters.drawErrors)for(const h of t.Measures){const t=h.PositionAndShape,e=t.AbsolutePosition.x,n=t.AbsolutePosition.y+2;h.hasError&&this.graphicalMusicSheet.ParentMusicSheet.DrawErroneousMeasures&&this.drawLineAsHorizontalRectangle(new r.GraphicalLine(new a.PointF2D(e,n),new a.PointF2D(e+t.BorderRight,n),4,s.OutlineAndFillStyleEnum.ErrorUnderlay),s.GraphicalLayers.MeasureError)}}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PhonicScoreModes=e.MusicSymbolDrawingStyle=e.DrawingMode=void 0,function(t){t[t.All=0]="All",t[t.NoOverlays=1]="NoOverlays",t[t.Leadsheet=2]="Leadsheet"}(e.DrawingMode||(e.DrawingMode={})),function(t){t[t.Normal=0]="Normal",t[t.Disabled=1]="Disabled",t[t.Selected=2]="Selected",t[t.Clickable=3]="Clickable",t[t.PlaybackSymbols=4]="PlaybackSymbols",t[t.FollowSymbols=5]="FollowSymbols",t[t.QFeedbackNotFound=6]="QFeedbackNotFound",t[t.QFeedbackOk=7]="QFeedbackOk",t[t.QFeedbackPerfect=8]="QFeedbackPerfect",t[t.Debug1=9]="Debug1",t[t.Debug2=10]="Debug2",t[t.Debug3=11]="Debug3"}(e.MusicSymbolDrawingStyle||(e.MusicSymbolDrawingStyle={})),function(t){t[t.Following=0]="Following",t[t.Midi=1]="Midi",t[t.Manual=2]="Manual"}(e.PhonicScoreModes||(e.PhonicScoreModes={}))},function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.VexFlowInstrumentBrace=void 0;const s=i(n(9)),r=n(67);class o extends r.VexFlowInstrumentBracket{constructor(t,e,n=0){super(t,e,n),this.vexflowConnector.setType(s.default.Flow.StaveConnector.type.BRACE)}}e.VexFlowInstrumentBrace=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GraphicalMeasure=void 0;const i=n(6),s=n(0),r=n(4),o=n(5);class a extends i.GraphicalObject{constructor(t,e,n){super(),this.hasOnlyRests=!1,this.measureNumber=-1,this.parentStaff=t,this.parentSourceMeasure=e,this.parentStaffLine=n,n?(this.parentStaff=n.ParentStaff,this.PositionAndShape=new r.BoundingBox(this,n.PositionAndShape)):this.PositionAndShape=new r.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(t){this.parentMusicSystem=t}get MeasureNumber(){return this.measureNumber}get FirstInstructionStaffEntry(){return this.firstInstructionStaffEntry}set FirstInstructionStaffEntry(t){this.firstInstructionStaffEntry=t}get LastInstructionStaffEntry(){return this.lastInstructionStaffEntry}set LastInstructionStaffEntry(t){this.lastInstructionStaffEntry=t}get ParentStaffLine(){return this.parentStaffLine}set ParentStaffLine(t){this.parentStaffLine=t,this.parentStaffLine&&(this.PositionAndShape.Parent=this.parentStaffLine.PositionAndShape)}resetLayout(){throw new Error("not implemented")}getLineWidth(t){throw new Error("not implemented")}addClefAtBegin(t){throw new Error("not implemented")}addKeyAtBegin(t,e,n){throw new Error("not implemented")}addRhythmAtBegin(t){throw new Error("not implemented")}addClefAtEnd(t){throw new Error("not implemented")}setPositionInStaffline(t){this.PositionAndShape.RelativePosition=new o.PointF2D(t,0)}setWidth(t){this.PositionAndShape.BorderRight=t}layoutSymbols(){throw new Error("not implemented")}findGraphicalStaffEntryFromTimestamp(t){var e;for(let n=0,i=this.staffEntries.length;n1}isVisible(){return this.ParentStaff.ParentInstrument.Visible}getGraphicalMeasureDurationFromStaffEntries(){let t=new s.Fraction(0,1);const e=[];for(let n=0,i=this.staffEntries.length;n0&&r.Add(e.notes[0].graphicalNoteLength);t.lt(r)&&(t=s.Fraction.createFromFraction(r))}return t}addGraphicalStaffEntry(t){this.staffEntries.push(t)}addGraphicalStaffEntryAtTimestamp(t){if(t)if(0===this.staffEntries.length||this.staffEntries[this.staffEntries.length-1].relInMeasureTimestamp.lt(t.relInMeasureTimestamp))this.staffEntries.push(t);else for(let e=this.staffEntries.length-1;e>=0;e--){if(this.staffEntries[e].relInMeasureTimestamp.lt(t.relInMeasureTimestamp)){this.staffEntries.splice(e+1,0,t);break}0===e&&this.staffEntries.splice(e,0,t)}}beginsWithLineRepetition(){const t=this.parentSourceMeasure;return!!t&&t.beginsWithLineRepetition()}endsWithLineRepetition(){const t=this.parentSourceMeasure;return!!t&&t.endsWithLineRepetition()}beginsWithWordRepetition(){const t=this.parentSourceMeasure;return!!t&&t.beginsWithWordRepetition()}endsWithWordRepetition(){const t=this.parentSourceMeasure;return!!t&&t.endsWithWordRepetition()}}e.GraphicalMeasure=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GraphicalVoiceEntry=void 0;const i=n(6),s=n(4),r=n(26);class o extends i.GraphicalObject{constructor(t,e){super(),this.parentVoiceEntry=t,this.parentStaffEntry=e,this.PositionAndShape=new s.BoundingBox(this,e?e.PositionAndShape:void 0,!0),this.notes=[],this.rules=e?e.parentMeasure.parentSourceMeasure.Rules:new r.EngravingRules}sort(){this.notes.sort((t,e)=>e.sourceNote.Pitch.getHalfTone()-t.sourceNote.Pitch.getHalfTone())}color(){}}e.GraphicalVoiceEntry=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.VexFlowStaffEntry=void 0;const i=n(108),s=n(18);class r extends i.GraphicalStaffEntry{constructor(t,e,n){super(t,e,n)}calculateXPosition(){const t=this.parentMeasure.getVFStave();let e=0;for(const n of this.graphicalVoiceEntries)if(n.vfStaveNote){if(n.vfStaveNote.setStave(t),!n.vfStaveNote.preFormatted)continue;n.applyBordersFromVexflow(),this.parentMeasure.ParentStaff.isTab?this.PositionAndShape.RelativePosition.x=(n.vfStaveNote.getAbsoluteX()+n.vfStaveNote.glyph.getWidth())/s.unitInPixels:this.PositionAndShape.RelativePosition.x=n.vfStaveNote.getBoundingBox().getX()/s.unitInPixels;const i=n.notes[0].sourceNote;i.isRest()&&i.Length.RealValue===this.parentMeasure.parentSourceMeasure.ActiveTimeSignature.RealValue&&(this.PositionAndShape.RelativePosition.x+=this.parentMeasure.parentSourceMeasure.Rules.WholeRestXShiftVexflow-.1,n.PositionAndShape.BorderLeft=-.7,n.PositionAndShape.BorderRight=.7),n.PositionAndShape.BorderLeft0&&(t=e)}return t}findStaffEntryMaxNoteLength(){let t=new s.Fraction(0,1);for(const e of this.graphicalVoiceEntries)for(const n of e.notes){const e=n.graphicalNoteLength;t.lt(e)&&e.GetExpandedNumerator()>0&&(t=e)}return t}findOrCreateGraphicalVoiceEntry(t){for(const n of this.graphicalVoiceEntries)if(n.parentVoiceEntry===t)return n;const e=a.MusicSheetCalculator.symbolFactory.createVoiceEntry(t,this);return this.graphicalVoiceEntries.push(e),e}findOrCreateGraphicalVoiceEntryFromGraphicalNote(t){for(const n of this.graphicalVoiceEntries)if(n===t.parentVoiceEntry)return n;const e=a.MusicSheetCalculator.symbolFactory.createVoiceEntry(t.sourceNote.ParentVoiceEntry,this);return this.graphicalVoiceEntries.push(e),e}addGraphicalNoteToListAtCorrectYPosition(t,e){const n=t.notes;if(0===n.length||e.PositionAndShape.RelativePosition.y=0;i--){if(n[i].PositionAndShape.RelativePosition.y>e.PositionAndShape.RelativePosition.y){n.splice(i+1,0,e);break}if(0===i){n.splice(0,0,e);break}}}hasOnlyRests(){for(const t of this.graphicalVoiceEntries)for(const e of t.notes)if(!e.sourceNote.isRest())return!1;return!0}}e.GraphicalStaffEntry=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GraphicalNote=void 0;const i=n(6),s=n(15),r=n(4);class o extends i.GraphicalObject{constructor(t,e,n){super(),this.sourceNote=t,this.parentVoiceEntry=e,this.PositionAndShape=new r.BoundingBox(this,e.PositionAndShape),this.graphicalNoteLength=n||t.Length,this.numberOfDots=this.calculateNumberOfNeededDots(this.graphicalNoteLength)}Transpose(t,e,n,i){let r=this.sourceNote.Pitch;return s.MusicSheetCalculator.transposeCalculator&&(r=s.MusicSheetCalculator.transposeCalculator.transposePitch(this.sourceNote.Pitch,t,n)),r}calculateNumberOfNeededDots(t){let e=1,n=2;const i=t.GetExpandedNumerator();if(!this.sourceNote||!this.sourceNote.NoteTuplet)for(;n1}findClosestStaffEntry(t){let e=void 0;for(let n=0,i=this.Measures.length;n0){f[t]=e;break}}for(let e=c;e>0;e--){const n=e*a*h+t*h;if(u.data[n+3]>0){p[t]=e;break}}}this.mSkyLine.push(...f),this.mBottomLine.push(...p),0,e.clear()}const n=this.mSkyLine.length/t,i=[],a=[];for(let s=0;s(t-Math.max(...this.mSkyLine))/r.unitInPixels+this.StaffLineParent.TopLineOffset),this.mBottomLine=this.mBottomLine.map(t=>(t-Math.min(...this.mBottomLine))/r.unitInPixels+this.StaffLineParent.BottomLineOffset)}drawPixel(t,e,n="#FF0000FF"){const i=e.getContext(),s=i.fillStyle;i.fillStyle=n,i.fillRect(t.x,t.y,2,2),i.fillStyle=s}updateSkyLineWithWedge(t,e){let n=Math.floor(t.x*this.SamplingUnit),i=Math.ceil(e.x*this.SamplingUnit),s=(e.y-t.y)/(e.x-t.x);i-n<=1&&(i++,s=0),n<0&&(n=0),n>=this.BottomLine.length&&(n=this.BottomLine.length-1),i<0&&(i=0),i>=this.BottomLine.length&&(i=this.BottomLine.length),this.SkyLine[n]=t.y;for(let r=n+1;r=this.BottomLine.length&&(n=this.BottomLine.length-1),i<0&&(i=0),i>=this.BottomLine.length&&(i=this.BottomLine.length),this.BottomLine[n]=t.y;for(let r=n+1;rt)}setBottomLineWithValue(t){this.BottomLine.forEach(e=>t)}getLeftIndexForPointX(t,e){const n=Math.floor(t*this.SamplingUnit);return n<0?0:n>=e?e-1:n}getRightIndexForPointX(t,e){const n=Math.ceil(t*this.SamplingUnit);return n<0?0:n>=e?e-1:n}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(t=>!isNaN(t)))}getSkyLineMinAtPoint(t){const e=Math.round(t*this.SamplingUnit);return this.mSkyLine[e]}getSkyLineMinInRange(t,e){return this.getMinInRange(this.SkyLine,t,e)}getBottomLineMax(){return Math.max(...this.BottomLine.filter(t=>!isNaN(t)))}getBottomLineMaxAtPoint(t){const e=Math.round(t*this.SamplingUnit);return this.mBottomLine[e]}getBottomLineMaxInRange(t,e){return this.getMaxInRange(this.BottomLine,t,e)}getBottomLineMaxInBoundingBox(t){const e=Math.floor(t.AbsolutePosition.x+t.BorderLeft),n=Math.ceil(t.AbsolutePosition.x+t.BorderRight);return this.getMaxInRange(this.mBottomLine,e,n)}updateWithBoundingBoxRecursivly(t){if(t.ChildElements&&t.ChildElements.length>0)this.updateWithBoundingBoxRecursivly(t);else{const e=t.BorderTop+t.AbsolutePosition.y,n=t.BorderBottom+t.AbsolutePosition.y;if(e<0){const n=Math.floor(t.AbsolutePosition.x+t.BorderLeft),i=Math.ceil(t.AbsolutePosition.x+t.BorderRight);this.updateInRange(this.mSkyLine,n,i,e)}else if(n>this.StaffLineParent.StaffHeight){const e=Math.floor(t.AbsolutePosition.x+t.BorderLeft),i=Math.ceil(t.AbsolutePosition.x+t.BorderRight);this.updateInRange(this.mBottomLine,e,i,n)}}}updateInRange(t,e=0,n=t.length,i=0){if(e=Math.floor(e*this.SamplingUnit),(n=Math.ceil(n*this.SamplingUnit))t.length&&(n=t.length);for(let s=e;sMath.abs(t[s])?i:t[s]}setInRange(t,e=0,n=t.length,i=0){if(e=Math.floor(e*this.SamplingUnit),(n=Math.ceil(n*this.SamplingUnit))t.length&&(n=t.length);for(let s=e;s=t.length&&(e=t.length-1),n<0&&(n=0),n>=t.length&&(n=t.length),e>=0&&n<=t.length?Math.min(...t.slice(e,n+1)):void 0):Number.MAX_VALUE}getMaxInRange(t,e,n){return e=Math.floor(e*this.SamplingUnit),n=Math.ceil(n*this.SamplingUnit),t?(e<0&&(e=0),e>=t.length&&(e=t.length-1),n<0&&(n=0),n>=t.length&&(n=t.length),e>=0&&n<=t.length?Math.max(...t.slice(e,n+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}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AlignmentManager=void 0;const i=n(73),s=n(5);e.AlignmentManager=class{constructor(t){this.parentStaffline=t,this.rules=this.parentStaffline.ParentMusicSystem.rules}alignDynamicExpressions(){var t,e;const n=[];let s=new Array;for(let i=0;i0){const t=r.map(t=>t.PositionAndShape.Center.y),e=Math.max(...t);for(let n=0;n0?r[n-1]:void 0;if(t){const e=this.getOverlap(s.PositionAndShape,t.PositionAndShape);s.squeeze(-(e.x+this.rules.DynamicExpressionSpacer))}if(e){const t=this.getOverlap(e.PositionAndShape,s.PositionAndShape);s.squeeze(t.x+this.rules.DynamicExpressionSpacer)}}}}}getDistance(t,e){const n=t.RelativePosition.x+t.BorderMarginRight,i=e.RelativePosition.x+e.BorderMarginLeft,r=t.RelativePosition.y+t.BorderMarginBottom,o=e.RelativePosition.y+e.BorderMarginTop;return new s.PointF2D(i-n,o-r)}getOverlap(t,e){return new s.PointF2D(t.RelativePosition.x+t.BorderMarginRight-(e.RelativePosition.x+e.BorderMarginLeft),t.RelativePosition.y+t.BorderMarginBottom-(e.RelativePosition.y+e.BorderMarginTop))}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GraphicalTie=void 0,e.GraphicalTie=class{constructor(t,e,n){this.tie=t,this.startNote=e,this.endNote=n}get GetTie(){return this.tie}get StartNote(){return this.startNote}get Tie(){return this.tie}set StartNote(t){this.startNote=t}get EndNote(){return this.endNote}set EndNote(t){this.endNote=t}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GraphicalLyricEntry=void 0;const i=n(24),s=n(13),r=n(5),o=n(8);e.GraphicalLyricEntry=class{constructor(t,e,n,a){this.lyricsEntry=t,this.graphicalStaffEntry=e;const c=e.parentMeasure.parentSourceMeasure.Rules.LyricsAlignmentStandard;t.Text.length>=4&&t.Parent.Notes[0].Length.Denominator>4&&o.TextAlignmentEnum.LeftBottom;const l=new s.Label(t.Text);this.graphicalLabel=new i.GraphicalLabel(l,n,c,this.graphicalStaffEntry.parentMeasure.parentSourceMeasure.Rules,e.PositionAndShape),this.graphicalLabel.PositionAndShape.RelativePosition=new r.PointF2D(0,a),c===o.TextAlignmentEnum.LeftBottom&&(this.graphicalLabel.PositionAndShape.RelativePosition.x-=1)}get LyricsEntry(){return this.lyricsEntry}get ParentLyricWord(){return this.graphicalLyricWord}set ParentLyricWord(t){this.graphicalLyricWord=t}get GraphicalLabel(){return this.graphicalLabel}set GraphicalLabel(t){this.graphicalLabel=t}get StaffEntryParent(){return this.graphicalStaffEntry}set StaffEntryParent(t){this.graphicalStaffEntry=t}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GraphicalLyricWord=void 0,e.GraphicalLyricWord=class{constructor(t){this.graphicalLyricsEntries=[],this.lyricWord=t,this.initialize()}get GetLyricWord(){return this.lyricWord}get GraphicalLyricsEntries(){return this.graphicalLyricsEntries}set GraphicalLyricsEntries(t){this.graphicalLyricsEntries=t}isFilled(){for(let t=0;ti.RealValue?1:i.RealValue>n.RealValue?-1:0}calculateCurve(t){const e=this.staffEntries[0],n=this.staffEntries[this.staffEntries.length-1];let s=e.findGraphicalNoteFromNote(this.slur.StartNote);!s&&this.graceStart&&(s=e.findGraphicalNoteFromGraceNote(this.slur.StartNote)),s||(s=e.findEndTieGraphicalNoteFromNoteWithStartingSlur(this.slur.StartNote,this.slur));let a=n.findGraphicalNoteFromNote(this.slur.EndNote);!a&&this.graceEnd&&(a=n.findGraphicalNoteFromGraceNote(this.slur.EndNote));const c=e.parentMeasure.ParentStaffLine,l=c.SkyBottomLineCalculator;this.calculatePlacement(l,c);const u=this.calculateStartAndEnd(s,a,c,t,l),h=u.startX,d=u.endX;let f=u.startY,p=u.endY;const m=t.SlurTangentMinAngle,g=t.SlurTangentMaxAngle;let b;if(this.placement===r.PlacementEnum.Above){f-=t.SlurNoteHeadYOffset,p-=t.SlurNoteHeadYOffset;const e=new i.PointF2D(this.staffEntries[0].parentMeasure.PositionAndShape.RelativePosition.x+this.staffEntries[0].PositionAndShape.RelativePosition.x,f);s?e.x+=this.staffEntries[0].PositionAndShape.BorderRight:e.x=this.staffEntries[0].parentMeasure.beginInstructionsWidth,this.graceStart&&(e.x+=n.PositionAndShape.RelativePosition.x);const r=new i.PointF2D(this.staffEntries[this.staffEntries.length-1].parentMeasure.PositionAndShape.RelativePosition.x+this.staffEntries[this.staffEntries.length-1].PositionAndShape.RelativePosition.x,p);if(a?r.x+=this.staffEntries[this.staffEntries.length-1].PositionAndShape.BorderLeft:r.x=this.staffEntries[this.staffEntries.length-1].parentMeasure.PositionAndShape.RelativePosition.x+this.staffEntries[this.staffEntries.length-1].parentMeasure.PositionAndShape.Size.width,this.graceEnd&&(r.x+=n.staffEntryParent.PositionAndShape.RelativePosition.x),b=this.calculateTopPoints(e,r,c,l),0===b.length){const t=new i.PointF2D((r.x-e.x)/2+e.x,(r.y-e.y)/2+e.y);b.push(t)}const u=Math.atan((p-f)/(d-h)),v=new i.PointF2D(0,0);let y,S,x=new i.PointF2D(d-h,-(p-f));y=o.Matrix2D.getRotationMatrix(u),S=y.getTransposeMatrix(),x=y.vectorMultiplication(x);const _=this.calculateTranslatedAndRotatedPointListAbove(b,h,f,y),w=this.calculateMaxLeftSlope(_,v,x),E=this.calculateMaxRightSlope(_,v,x),T=v.y-v.x*w,C=x.y-x.x*E,M=new i.PointF2D;let P=!1;Math.abs(Math.abs(w)-Math.abs(E))<1e-4?(M.x=x.x/2,M.y=0,P=!0):(M.x=(C-T)/(w-E),M.y=w*M.x+T);const A=this.calculateHeightWidthRatio(x.x,_),I=0,L=0;let O=m,k=-m;if(!P){const t=this.calculateAngles(m,w,E,g);O=t.startAngle,k=t.endAngle}const R=this.calculateControlPoints(x.x,O,k,_,A);let N=R.startControlPoint,D=R.endControlPoint;N=S.vectorMultiplication(N),N.x+=h,N.y=-N.y+f,D=S.vectorMultiplication(D),D.x+=h,D.y=-D.y+f,this.bezierStartPt=new i.PointF2D(h,f-I),this.bezierStartControlPt=new i.PointF2D(N.x,N.y-I),this.bezierEndControlPt=new i.PointF2D(D.x,D.y-L),this.bezierEndPt=new i.PointF2D(d,p-L);const V=c.SkyLine.length,B=l.getLeftIndexForPointX(this.bezierStartPt.x,V),F=l.getLeftIndexForPointX(this.bezierEndPt.x,V),j=this.bezierEndPt.x-this.bezierStartPt.x,G=l.SamplingUnit;for(let t=B;t=B&&(c.SkyLine[i]=Math.min(c.SkyLine[i],n.y)),i++,i=B&&(c.BottomLine[i]=Math.max(c.BottomLine[i],n.y)),i++,i0)return void(this.placement=r.PlacementEnum.Above);const n=this.staffEntries[0],i=this.staffEntries[this.staffEntries.length-1],s=n.graphicalVoiceEntries[0].parentVoiceEntry.StemDirection;if(s===i.graphicalVoiceEntries[0].parentVoiceEntry.StemDirection)this.placement=s===l.StemDirectionType.Up?r.PlacementEnum.Below:r.PlacementEnum.Above;else{let s=n.PositionAndShape.BorderLeft+n.PositionAndShape.RelativePosition.x+n.parentMeasure.PositionAndShape.RelativePosition.x,o=i.PositionAndShape.BorderRight+i.PositionAndShape.RelativePosition.x+i.parentMeasure.PositionAndShape.RelativePosition.x;this.graceStart&&(s+=i.PositionAndShape.RelativePosition.x),this.graceEnd&&(o+=i.staffEntryParent.PositionAndShape.RelativePosition.x);const a=-1*t.getSkyLineMinInRange(s,o),c=t.getBottomLineMaxInRange(s,o)-e.StaffHeight;this.placement=c>a?r.PlacementEnum.Above:r.PlacementEnum.Below}}calculateTopPoints(t,e,n,s){const r=[];let o=s.getRightIndexForPointX(t.x,n.SkyLine.length),a=s.getLeftIndexForPointX(e.x,n.SkyLine.length);o<0&&(o=0),a>=n.SkyLine.length&&(a=n.SkyLine.length-1);for(let c=o;c=n.BottomLine.length&&(a=n.BottomLine.length-1);for(let c=o;c0?s+=20:s-=20;let r=Math.atan(n)/u.degreesToRadiansFactor;return n<0?r-=20:r+=20,{startAngle:Math.min(Math.max(t,s),i),endAngle:Math.max(Math.min(-t,r),-i)}}}e.GraphicalSlur=u,u.degreesToRadiansFactor=Math.PI/180},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GraphicalCurve=void 0;const i=n(5);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 t=0;t=s.bezierCurveStepSize?new i.PointF2D:new i.PointF2D(s.oneMinusTPow3[e]*this.bezierStartPt.x+s.bezierFactorOne[e]*this.bezierStartControlPt.x+s.bezierFactorTwo[e]*this.bezierEndControlPt.x+s.tPow3[e]*this.bezierEndPt.x,s.oneMinusTPow3[e]*this.bezierStartPt.y+s.bezierFactorOne[e]*this.bezierStartControlPt.y+s.bezierFactorTwo[e]*this.bezierEndControlPt.y+s.tPow3[e]*this.bezierEndPt.y)}}e.GraphicalCurve=s,s.bezierCurveStepSize=1e3},function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.MusicSheetReader=void 0;const s=n(124),r=n(87),o=n(0),a=n(127),c=n(60),l=n(21),u=n(11),h=i(n(1)),d=n(17),f=n(17),p=n(31),m=n(61),g=n(137),b=n(7),v=n(13),y=n(138),S=n(26);class x{constructor(t,e=new S.EngravingRules){this.completeNumberOfStaves=0,this.afterSheetReadingModules=t||[],this.repetitionInstructionReader=y.MusicSymbolModuleFactory.createRepetitionInstructionReader(),this.repetitionCalculator=y.MusicSymbolModuleFactory.createRepetitionCalculator(),this.rules=e}get CompleteNumberOfStaves(){return this.completeNumberOfStaves}static doCalculationsAfterDurationHasBeenSet(t){for(const e of t)e.doCalculationsAfterDurationHasBeenSet()}createMusicSheet(t,e){try{return this._createMusicSheet(t,e)}catch(t){return void h.default.error("MusicSheetReader.CreateMusicSheet",t)}}_removeFromArray(t,e){const n=t.indexOf(e);-1!==n&&t.splice(n,1)}trimString(t){return t.replace(/^\s+|\s+$/g,"")}_lastElement(t){return t[t.length-1]}_createMusicSheet(t,e){const n=[];let i=0;if(this.musicSheet=new s.MusicSheet,this.musicSheet.Path=e,this.musicSheet.Rules=this.rules,!t)throw new u.MusicSheetReadingException("Undefined root element");this.pushSheetLabels(t,e);const a=t.element("part-list");if(!a)throw new u.MusicSheetReadingException("Undefined partListNode");const c=t.elements("part"),h=a.elements();this.initializeReading(h,c,n);let d=!0;this.currentFraction=new o.Fraction(0,1);let f=!1,p=t.element("identification");for(p&&(p=p.element("encoding")),p&&(p=p.element("software")),void 0!==p&&"Guitar Pro 5"===p.value&&(f=!0);d;){void 0!==this.currentMeasure&&this.currentMeasure.HasEndLine&&this.rules.NewPartAndSystemAfterFinalBarline&&(i=0),this.currentMeasure=new r.SourceMeasure(this.completeNumberOfStaves,this.musicSheet.Rules);for(const e of n)try{d=d&&e.readNextXmlMeasure(this.currentMeasure,this.currentFraction,f)}catch(t){const e=l.ITextTranslation.translateText("ReaderErrorMessages/InstrumentError","Error while reading instruments.");throw new u.MusicSheetReadingException(e,t)}d&&(this.musicSheet.addMeasure(this.currentMeasure),this.checkIfRhythmInstructionsAreSetAndEqual(n),this.checkSourceMeasureForNullEntries(),i=this.setSourceMeasureDuration(n,i),x.doCalculationsAfterDurationHasBeenSet(n),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 s=0,r=this.afterSheetReadingModules.length;sn){if(this.areRhythmInstructionsMixed(e)&&t.SymbolEnum!==f.RhythmSymbolEnum.NONE)continue;n=t.Rhythm.RealValue,i=e.indexOf(t)}}if(e.length>0&&e.lengtht.Denominator){const n=e.Denominator/t.Denominator;t.expand(n)}}checkIfMeasureIsImplicit(t,e){return!(this.previousMeasure||!t.lt(e))||!!this.previousMeasure&&o.Fraction.plus(this.previousMeasure.Duration,t).Equals(e)}allInstrumentsHaveSameDuration(t,e){let n=0;for(let i=0,s=t.length;i=0;t--)for(let e=this.currentMeasure.VerticalSourceStaffEntryContainers[t].StaffEntries.length-1;e>=0;e--){const n=this.currentMeasure.VerticalSourceStaffEntryContainers[t].StaffEntries[e];if(n)for(let t=n.VoiceEntries.length-1;t>=0;t--){const e=n.VoiceEntries[t];0===e.Notes.length&&(this._removeFromArray(e.ParentVoice.VoiceEntries,e),this._removeFromArray(n.VoiceEntries,e))}void 0!==n&&0===n.VoiceEntries.length&&(this.currentMeasure.VerticalSourceStaffEntryContainers[t].StaffEntries[e]=void 0)}for(let t=this.currentMeasure.VerticalSourceStaffEntryContainers.length-1;t>=0;t--){let e=0;for(let n=0,i=this.currentMeasure.VerticalSourceStaffEntryContainers[t].StaffEntries.length;ni){if(!this.musicSheet.Title){const t=l.attribute("font-size").value,e=parseFloat(t);s0&&r.MidiInstrumentId!==b.MidiInstrument.Percussion&&(e.midiInstrumentID=Math.max(0,parseInt(s.value,10)-1));else if("midi-unpitched"===s.name)e.fixedKey=Math.max(0,parseInt(s.value,10));else if("volume"===s.name)try{const t=parseFloat(s.value);e.volume=t/127}catch(t){h.default.debug("ExpressionReader.readExpressionParameters","read volume",t)}else if("pan"===s.name)try{const t=parseFloat(s.value);e.pan=t/64}catch(t){h.default.debug("ExpressionReader.readExpressionParameters","read pan",t)}}catch(t){h.default.info("MusicSheetReader.createInstrumentGroups midi settings: ",t)}}}}catch(t){h.default.info("MusicSheetReader.createInstrumentGroups: ",t)}}if(0===r.SubInstruments.length){const t=new g.SubInstrument(r);r.SubInstruments.push(t)}n[s]=r,i?(i.InstrumentalGroups.push(r),this.musicSheet.Instruments.push(r)):(this.musicSheet.InstrumentalGroups.push(r),this.musicSheet.Instruments.push(r))}else if("part-group"===o.name&&"start"===o.attribute("type").value){const t=new m.InstrumentalGroup("group",this.musicSheet,i);i?i.InstrumentalGroups.push(t):this.musicSheet.InstrumentalGroups.push(t),i=t}else if("part-group"===o.name&&"stop"===o.attribute("type").value&&i){if(1===i.InstrumentalGroups.length){const t=i.InstrumentalGroups[0];i.Parent?(i.Parent.InstrumentalGroups.push(t),this._removeFromArray(i.Parent.InstrumentalGroups,i)):(this.musicSheet.InstrumentalGroups.push(t),this._removeFromArray(this.musicSheet.InstrumentalGroups,i))}i=i.Parent}}}catch(t){const e=l.ITextTranslation.translateText("ReaderErrorMessages/InstrumentError","Error while reading Instruments");throw new u.MusicSheetReadingException(e,t)}for(let s=0,r=this.musicSheet.Instruments.length;s0){const n=t[0];if(n){let t=n.element("attributes");t&&(t=t.element("staves")),t?e+=parseInt(t.value,10):e++}}}if(isNaN(e)||e<=0){const t=l.ITextTranslation.translateText("ReaderErrorMessages/StaffError","Invalid number of staves.");throw new u.MusicSheetReadingException(t)}return e}getInstrumentNumberOfStavesFromXml(t){let e=0;const n=t.element("measure");if(n){const t=n.element("attributes");let i=void 0;t&&(i=t.element("staves")),e=t&&i?parseInt(i.value,10):1}if(isNaN(e)||e<=0){const t=l.ITextTranslation.translateText("ReaderErrorMessages/StaffError","Invalid number of Staves.");throw new u.MusicSheetReadingException(t)}return e}}e.MusicSheetReader=x},function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.MusicSheet=e.PlaybackSettings=void 0;const s=n(0),r=n(158),o=n(125),a=n(47),c=n(161),l=n(26),u=n(22),h=i(n(1));class d{}e.PlaybackSettings=d;class f{constructor(){this.idString="random idString, not initialized",this.sourceMeasures=[],this.repetitions=[],this.dynListStaves=[],this.timestampSortedDynamicExpressionsList=[],this.timestampSortedTempoExpressionsList=[],this.instrumentalGroups=[],this.instruments=[],this.musicPartManager=void 0,this.musicSheetErrors=new c.MusicSheetErrors,this.staves=[],this.transpose=0,this.defaultStartTempoInBpm=0,this.drawErroneousMeasures=!1,this.hasBeenOpenedForTheFirstTime=!1,this.currentEnrolledPosition=new s.Fraction(0,1),this.playbackSettings=new d,this.playbackSettings.rhythm=new s.Fraction(4,4,0,!1),this.userStartTempoInBPM=100,this.pageWidth=120,this.MusicPartManager=new r.MusicPartManager(this),this.hasBPMInfo=!1}static getIndexFromStaff(t){return t.idInMusicSheet}get SourceMeasures(){return this.sourceMeasures}set SourceMeasures(t){this.sourceMeasures=t}get Repetitions(){return this.repetitions}set Repetitions(t){this.repetitions=t}get DynListStaves(){return this.dynListStaves}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(t){this.playbackSettings=t}get DrawErroneousMeasures(){return this.drawErroneousMeasures}set DrawErroneousMeasures(t){this.drawErroneousMeasures=t}get HasBeenOpenedForTheFirstTime(){return this.hasBeenOpenedForTheFirstTime}set HasBeenOpenedForTheFirstTime(t){this.hasBeenOpenedForTheFirstTime=t}InitializeStartTempoInBPM(t){this.userStartTempoInBPM=t}get DefaultStartTempoInBpm(){return this.defaultStartTempoInBpm}set DefaultStartTempoInBpm(t){this.defaultStartTempoInBpm=t,this.InitializeStartTempoInBPM(t)}get Path(){return this.path}set Path(t){this.path=t}get Staves(){return this.staves}get TitleString(){return this.title?this.title.text:""}get SubtitleString(){return this.subtitle?this.subtitle.text:""}get ComposerString(){return this.composer?this.composer.text:""}get LyricistString(){return this.lyricist?this.lyricist.text:""}get Title(){return this.title}set Title(t){this.title=t}get Subtitle(){return this.subtitle}set Subtitle(t){this.subtitle=t}get Composer(){return this.composer}set Composer(t){this.composer=t}get Lyricist(){return this.lyricist}set Lyricist(t){this.lyricist=t}get Rules(){return this.rules||(h.default.debug("warning: sheet.Rules was undefined. Creating new EngravingRules."),this.rules=new l.EngravingRules),this.rules}set Rules(t){this.rules=t}get SheetErrors(){return this.musicSheetErrors}get SelectionStart(){return this.selectionStart}set SelectionStart(t){this.selectionStart=t.clone(),this.currentEnrolledPosition=t.clone()}get SelectionEnd(){return this.selectionEnd}set SelectionEnd(t){this.selectionEnd=t}set HasBPMInfo(t){this.hasBPMInfo=t}get HasBPMInfo(){return this.hasBPMInfo}addMeasure(t){this.sourceMeasures.push(t),t.measureListIndex=this.sourceMeasures.length-1}checkForInstrumentWithNoVoice(){for(let t=0,e=this.instruments.length;t0&&n.Voices[0].Visible&&t.push(n)}return t}}e.MusicSheet=f,f.defaultTitle="[no title given]"},function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.RepetitionEndingPart=e.Repetition=void 0;const s=n(126),r=n(0),o=n(74),a=i(n(1));class c extends o.PartListEntry{constructor(t,e){super(t),this.backwardJumpInstructions=[],this.endingParts=[],this.endingIndexDict={},this.userNumberOfRepetitions=0,this.visibles=[],this.fromWords=!1,this.repetitonIterationOrder=[],this.numberOfEndings=1,this.musicSheet2=t,this.virtualOverallRepetition=e}get BackwardJumpInstructions(){return this.backwardJumpInstructions}get EndingIndexDict(){return this.endingIndexDict}get EndingParts(){return this.endingParts}get Visibles(){return this.visibles}set Visibles(t){this.visibles=t}get DefaultNumberOfRepetitions(){let t=2;return this.virtualOverallRepetition&&(t=1),Math.max(t,Object.keys(this.endingIndexDict).length,this.checkRepetitionForMultipleLyricVerses())}get UserNumberOfRepetitions(){return this.userNumberOfRepetitions}set UserNumberOfRepetitions(t){this.userNumberOfRepetitions=t,this.repetitonIterationOrder=[];const e=this.userNumberOfRepetitions-this.NumberOfEndings;for(let n=1;n<=this.userNumberOfRepetitions;n++)n<=e?this.repetitonIterationOrder.push(1):this.repetitonIterationOrder.push(n-e)}getForwardJumpTargetForIteration(t){const e=this.repetitonIterationOrder[t-1];return this.endingIndexDict[e]?this.endingIndexDict[e].part.StartIndex:-1}getBackwardJumpTarget(){return this.startMarker.measureIndex}SetEndingStartIndex(t,e){const n=new l(new s.SourceMusicPart(this.musicSheet2,e,e));this.endingParts.push(n);for(const i of t)try{this.endingIndexDict[i]=n,n.endingIndices.push(i),this.numberOfEndings=this.xmlMeasureList.length)return!1;this.currentMeasure=t,this.inSourceMeasureInstrumentIndex=this.musicSheet.getGlobalStaffIndexOfFirstStaff(this.instrument),this.repetitionInstructionReader&&this.repetitionInstructionReader.prepareReadingMeasure(t,this.currentXmlMeasureIndex);let s=new l.Fraction(0,1),r=new l.Fraction(0,1),o=!1;this.maxTieNoteFraction=new l.Fraction(0,1);let a=!1;try{const c=this.xmlMeasureList[this.currentXmlMeasureIndex].elements();for(let d=0;d1&&f.element("staff")&&(i=parseInt(f.element("staff").value,10),isNaN(i)&&(m.default.debug("InstrumentReader.readNextXmlMeasure.get staff number"),i=1)),this.currentStaff=this.instrument.Staves[i-1];const o=void 0!==f.element("chord");if(f.element("voice")){const t=parseInt(f.element("voice").value,10);this.currentVoiceGenerator=this.getOrCreateVoiceGenerator(t,i-1)}else o&&this.currentVoiceGenerator||(this.currentVoiceGenerator=this.getOrCreateVoiceGenerator(1,i-1));let c=0,h=new l.Fraction(0,1),d=2,p=void 0,g=!1;if(f.element("duration")){if(c=parseInt(f.element("duration").value,10),isNaN(c)){const t=u.ITextTranslation.translateText("ReaderErrorMessages/NoteDurationError","Invalid Note Duration.");this.musicSheet.SheetErrors.pushMeasureError(t),m.default.debug("InstrumentReader.readNextXmlMeasure",t);continue}if(h=new l.Fraction(c,4*this.divisions),0===c?h=this.getNoteDurationFromTypeNode(f):p=this.getNoteDurationFromTypeNode(f),f.element("time-modification")){h=this.getNoteDurationForTuplet(f);const t=f.element("time-modification");t&&t.element("normal-notes")&&(d=parseInt(t.element("normal-notes").value,10)),g=!0}}const b=void 0!==f.element("rest"),v=f.element("notations"),y=void 0!==f.element("grace")||0===c||o&&a;let _=!1,w=!1;if(y){const t=f.element("grace");t&&t.attributes()&&t.attribute("slash")&&"yes"===t.attribute("slash").value&&(_=!0),h=this.getNoteDurationFromTypeNode(f);const e=f.element("notations");e&&e.element("slur")&&(w=!0)}let E=!1;f.element("cue")&&(E=!0);const T=f.element("type");let C=x.NoteType.UNDEFINED;if(T){const t=T.attribute("size");null!=t&&"cue"===t.value&&(E=!0),C=x.NoteTypeHandler.StringToNoteType(T.value)}let M,P=S.StemDirectionType.Undefined;const A=f.element("stem");if(A){switch(A.value){case"down":P=S.StemDirectionType.Down;break;case"up":P=S.StemDirectionType.Up;break;case"double":P=S.StemDirectionType.Double;break;case"none":P=S.StemDirectionType.None;break;default:P=S.StemDirectionType.Undefined}const t=A.attribute("color");t&&(M=this.parseXmlColor(t.value))}let I,L=0,O=!1;if(v){const t=v.element("ornaments");if(t){const e=t.element("tremolo");if(e){const t=e.attribute("type");if(t&&"single"===t.value){const t=parseInt(e.value,10);t>0&&(L=t)}}const n=t.element("wavy-line");if(void 0!==n){const t=n.attribute("type");t&&"start"===t.value&&(O=!0)}}}const k=f.element("notehead");if(k){const t=k.attribute("color");t&&(I=this.parseXmlColor(t.value))}let R;const N=f.attribute("color");N&&(R=this.parseXmlColor(N.value),I||(I=R),M||(M=R));let D=s.clone();o&&(D=r.clone()),this.currentStaffEntry=this.currentMeasure.findOrCreateStaffEntry(D,this.inSourceMeasureInstrumentIndex+i-1,this.currentStaff).staffEntry,(!this.currentVoiceGenerator.hasVoiceEntry()||!o&&!y&&!a||y&&!a||y&&!o||!y&&a)&&this.currentVoiceGenerator.createVoiceEntry(D,this.currentStaffEntry,!b&&!y,y,_,w),y||o||(r=s.clone(),s.Add(h)),o&&void 0!==this.currentStaffEntry&&this.currentStaffEntry.ParentStaff!==this.currentStaff&&(this.currentStaffEntry=this.currentVoiceGenerator.checkForStaffEntryLink(this.inSourceMeasureInstrumentIndex+i-1,this.currentStaff,this.currentStaffEntry,this.currentMeasure));const V=void 0!==this.currentStaffEntry&&void 0!==this.currentStaffEntry.Timestamp&&this.currentStaffEntry.Timestamp.Equals(new l.Fraction(0,1))&&!this.currentStaffEntry.hasNotes();if(this.saveAbstractInstructionList(this.instrument.Staves.length,V),0!==this.openChordSymbolContainers.length&&(this.currentStaffEntry.ChordContainers=this.openChordSymbolContainers,this.openChordSymbolContainers=[]),this.activeRhythm,g||y||(h=new l.Fraction(c,4*this.divisions)),this.currentVoiceGenerator.read(f,h,p,C,d,b,this.currentStaffEntry,this.currentMeasure,e,this.maxTieNoteFraction,o,n,t,E,P,L,M,I,O),void 0!==v&&v.element("dynamics")){const t=this.expressionReaders[this.readExpressionStaffNumber(f)-1];t&&(t.readExpressionParameters(f,this.instrument,this.divisions,s,r,this.currentMeasure.MeasureNumber,!1),t.read(f,this.currentMeasure,r))}a=y}else if("attributes"===f.name){const e=f.element("divisions");if(e&&(this.divisions=parseInt(e.value,10),isNaN(this.divisions))){const t=u.ITextTranslation.translateText("ReaderErrorMessages/DivisionError","Invalid divisions value at Instrument: ");if(m.default.debug("InstrumentReader.readNextXmlMeasure",t),this.divisions=this.readDivisionsFromNotes(),!(this.divisions>0))throw o=!0,new h.MusicSheetReadingException(t+this.instrument.Name);this.musicSheet.SheetErrors.push(t+this.instrument.Name)}if(!f.element("divisions")&&0===this.divisions&&0===this.currentXmlMeasureIndex){const t=u.ITextTranslation.translateText("ReaderErrorMessages/DivisionError","Invalid divisions value at Instrument: ");if(this.divisions=this.readDivisionsFromNotes(),!(this.divisions>0))throw o=!0,new h.MusicSheetReadingException(t+this.instrument.Name);this.musicSheet.SheetErrors.push(t+this.instrument.Name)}this.addAbstractInstruction(f,n),s.Equals(new l.Fraction(0,1))&&this.isAttributesNodeAtBeginOfMeasure(this.xmlMeasureList[this.currentXmlMeasureIndex],f)&&this.saveAbstractInstructionList(this.instrument.Staves.length,!0),this.isAttributesNodeAtEndOfMeasure(this.xmlMeasureList[this.currentXmlMeasureIndex],f)&&this.saveClefInstructionAtEndOfMeasure();const i=f.element("staff-details");if(i){const t=i.element("staff-lines");if(t){let e=1;const n=i.attribute("number");n&&(e=parseInt(n.value,10)),this.instrument.Staves[e-1].StafflineCount=parseInt(t.value,10)}}const r=f.element("measure-style");if(r){const e=r.element("multiple-rest");if(e){const n=e.value;let i=0;try{i=Number.parseInt(n,10),void 0!==t.multipleRestMeasures&&i!==t.multipleRestMeasures?t.multipleRestMeasures=0:t.multipleRestMeasures=i}catch(t){console.log("multirest parse error: "+t)}}}}else if("forward"===f.name){const t=parseInt(f.element("duration").value,10);s.Add(new l.Fraction(t,4*this.divisions))}else if("backup"===f.name){const t=parseInt(f.element("duration").value,10);s.Sub(new l.Fraction(t,4*this.divisions)),s.IsNegative()&&(s=new l.Fraction(0,1)),r.Sub(new l.Fraction(t,4*this.divisions)),r.IsNegative()&&(r=new l.Fraction(0,1))}else if("direction"===f.name){const t=f.element("direction-type");let e=Math.min(1,s.RealValue);void 0!==this.activeRhythm&&this.activeRhythm.Rhythm&&(e/=this.activeRhythm.Rhythm.RealValue);let n=!1;if(this.repetitionInstructionReader&&(n=this.repetitionInstructionReader.handleRepetitionInstructionsFromWordsOrSymbols(t,e)),!n){let e=this.expressionReaders[0];const n=this.readExpressionStaffNumber(f)-1;n0?this.musicSheet.SourceMeasures[0]:this.currentMeasure;const n=new o.ClefInstruction(d.ClefEnum.G,0,2);let i;e.FirstInstructionsStaffEntries[t]?(i=e.FirstInstructionsStaffEntries[t],i.removeFirstInstructionOfTypeClefInstruction()):(i=new r.SourceStaffEntry(void 0,void 0),e.FirstInstructionsStaffEntries[t]=i),n.Parent=i,i.Instructions.splice(0,0,n)}createDefaultKeyInstruction(){let t;t=this.musicSheet.SourceMeasures.length>0?this.musicSheet.SourceMeasures[0]:this.currentMeasure;const e=new a.KeyInstruction(void 0,0,p.KeyEnum.major);for(let n=this.inSourceMeasureInstrumentIndex;n0&&"backup"===n[i-1].name)return!0;let s=-1;for(let r=0;r0||s<0}isAttributesNodeAtEndOfMeasure(t,e){const n=t.elements().slice();let i=0;for(let r=0;rs}getNoteDurationFromTypeNode(t){const e=t.element("type");if(e){const t=e.value;return x.NoteTypeHandler.getNoteDurationFromType(t)}return new l.Fraction(0,4*this.divisions)}addAbstractInstruction(t,e){if(t.element("divisions")&&1===t.elements().length)return;const n=t.element("transpose");if(n){const t=n.element("chromatic");t&&(this.instrument.PlaybackTranspose=parseInt(t.value,10))}const i=t.elements("clef");let s;if(i.length>0)for(let r=0,a=i.length;r using default clef line."),this.musicSheet.SheetErrors.pushMeasureError(s),a=2,m.default.debug("InstrumentReader.addAbstractInstruction",s,t)}const f=e.element("sign");if(f)try{n=d.ClefEnum[f.value],o.ClefInstruction.isSupportedClef(n)||(s=u.ITextTranslation.translateText("ReaderErrorMessages/ClefError","Unsupported clef found -> using default clef."),this.musicSheet.SheetErrors.pushMeasureError(s),n=d.ClefEnum.G,a=2),n===d.ClefEnum.TAB&&(l=-1)}catch(t){s=u.ITextTranslation.translateText("ReaderErrorMessages/ClefError","Invalid clef found -> using default clef."),this.musicSheet.SheetErrors.pushMeasureError(s),n=d.ClefEnum.G,a=2,m.default.debug("InstrumentReader.addAbstractInstruction",s,t)}const p=e.element("clef-octave-change");if(p)try{l=parseInt(p.value,10)}catch(t){s=u.ITextTranslation.translateText("ReaderErrorMessages/ClefOctaveError","Invalid clef octave found -> using default clef octave."),this.musicSheet.SheetErrors.pushMeasureError(s),l=0}if(e.hasAttributes&&"number"===e.attributes()[0].name)try{c=parseInt(e.attributes()[0].value,10),c>this.currentClefNumber&&(c=this.currentClefNumber),this.currentClefNumber=c+1}catch(t){s=u.ITextTranslation.translateText("ReaderErrorMessages/ClefError","Invalid clef found -> using default clef."),this.musicSheet.SheetErrors.pushMeasureError(s),c=1,this.currentClefNumber=c+1}const g=new o.ClefInstruction(n,l,a);this.abstractInstructions.push([c,g])}if(void 0!==t.element("key")&&this.instrument.MidiInstrumentId!==g.MidiInstrument.Percussion){let e=0;const n=t.element("key").element("fifths");if(n)try{e=parseInt(n.value,10)}catch(t){s=u.ITextTranslation.translateText("ReaderErrorMessages/KeyError","Invalid key found -> set to default."),this.musicSheet.SheetErrors.pushMeasureError(s),e=0,m.default.debug("InstrumentReader.addAbstractInstruction",s,t)}let i=p.KeyEnum.none,r=t.element("key");if(r&&(r=r.element("mode")),r)try{i=p.KeyEnum[r.value]}catch(t){s=u.ITextTranslation.translateText("ReaderErrorMessages/KeyError","Invalid key found -> set to default."),this.musicSheet.SheetErrors.pushMeasureError(s),i=p.KeyEnum.major,m.default.debug("InstrumentReader.addAbstractInstruction",s,t)}const o=new a.KeyInstruction(void 0,e,i);this.abstractInstructions.push([1,o])}if(t.element("time")){const e=t.element("time");let n=f.RhythmSymbolEnum.NONE,i=!0;if(void 0!==e&&e.hasAttributes){const t=e.attribute("symbol");t&&("common"===t.value?n=f.RhythmSymbolEnum.COMMON:"cut"===t.value&&(n=f.RhythmSymbolEnum.CUT));const s=e.attribute("print-object");s&&"no"===s.value&&(i=!1)}let r=0,o=0;const a=e&&void 0!==e.element("senza-misura"),h=t.elements("time"),d=[],p=[];for(let t=0,s=h.length;t0&&void 0!==p&&d.length===p.length){const t=d.length,e=new Array(t);let n=0;for(let i=0;i set to default."),this.musicSheet.SheetErrors.pushMeasureError(s),r=4,o=4,m.default.debug("InstrumentReader.addAbstractInstruction",s,t)}const e=new c.RhythmInstruction(new l.Fraction(r,o,0,!1),n);e.PrintObject=i,this.abstractInstructions.push([1,e])}}}saveAbstractInstructionList(t,e){for(let n=this.abstractInstructions.length-1;n>=0;n--){const i=this.abstractInstructions[n],s=i[0],l=i[1];if(l instanceof o.ClefInstruction){const t=l;if(0===this.currentXmlMeasureIndex||s<=this.activeClefs.length&&t!==this.activeClefs[s-1])if(e||void 0===this.currentStaffEntry||this.currentStaffEntry.hasNotes()||s-1!==this.instrument.Staves.indexOf(this.currentStaffEntry.ParentStaff)){if(e){let e;if(this.currentMeasure){const i=t,a=this.inSourceMeasureInstrumentIndex+s-1,c=this.currentMeasure.FirstInstructionsStaffEntries[a];if(0===this.currentXmlMeasureIndex)if(c)if(void 0===this.currentMeasure.FirstInstructionsStaffEntries[a]||c.Instructions[0]instanceof o.ClefInstruction){const t=new r.SourceStaffEntry(void 0,void 0);this.currentMeasure.LastInstructionsStaffEntries[a]=t,i.Parent=t,t.Instructions.push(i)}else e=c,i.Parent=e,e.removeFirstInstructionOfTypeClefInstruction(),e.Instructions.splice(0,0,i),this.activeClefsHaveBeenInitialized[s-1]=!0;else e=new r.SourceStaffEntry(void 0,void 0),this.currentMeasure.FirstInstructionsStaffEntries[a]=e,i.Parent=e,e.Instructions.push(i),this.activeClefsHaveBeenInitialized[s-1]=!0;else if(this.activeClefsHaveBeenInitialized[s-1]){const t=new r.SourceStaffEntry(void 0,void 0);this.previousMeasure.LastInstructionsStaffEntries[a]=t,i.Parent=t,t.Instructions.push(i)}else{const t=this.musicSheet.SourceMeasures[0];t.FirstInstructionsStaffEntries[a]?(e=t.FirstInstructionsStaffEntries[a],e.removeFirstInstructionOfTypeClefInstruction()):e=new r.SourceStaffEntry(void 0,void 0),i.Parent=e,e.Instructions.splice(0,0,i),this.activeClefsHaveBeenInitialized[s-1]=!0}this.activeClefs[s-1]=t,this.abstractInstructions.splice(n,1)}}}else{const e=t;e.Parent=this.currentStaffEntry,this.currentStaffEntry.removeFirstInstructionOfTypeClefInstruction(),this.currentStaffEntry.Instructions.push(e),this.activeClefs[s-1]=t,this.abstractInstructions.splice(n,1)}else s<=this.activeClefs.length&&t===this.activeClefs[s-1]&&this.abstractInstructions.splice(n,1)}if(l instanceof a.KeyInstruction){const e=l;if(this.activeKey&&this.activeKey.Key===e.Key)this.abstractInstructions.splice(n,1);else{let i;if(this.activeKey=e,this.abstractInstructions.splice(n,1),this.activeKeyHasBeenInitialized?i=this.currentMeasure:(this.activeKeyHasBeenInitialized=!0,i=this.currentXmlMeasureIndex>0?this.musicSheet.SourceMeasures[0]:this.currentMeasure),i)for(let n=this.inSourceMeasureInstrumentIndex;n=0;t--){const e=this.abstractInstructions[t][0],n=this.abstractInstructions[t][1];if(n instanceof o.ClefInstruction){const i=n;if(!this.activeClefs[e-1]||i.ClefType!==this.activeClefs[e-1].ClefType||i.ClefType===this.activeClefs[e-1].ClefType&&i.Line!==this.activeClefs[e-1].Line){const n=new r.SourceStaffEntry(void 0,void 0);this.currentMeasure.LastInstructionsStaffEntries[this.inSourceMeasureInstrumentIndex+e-1]=n;const s=i;s.Parent=n,n.Instructions.push(s),this.activeClefs[e-1]=i,this.abstractInstructions.splice(t,1)}}}}getNoteDurationForTuplet(t){let e=new l.Fraction(0,1);const n=this.getNoteDurationFromTypeNode(t);if(t.element("time-modification")){const i=t.element("time-modification");if(i&&void 0!==i.element("actual-notes")&&i.element("normal-notes")){const t=i.element("actual-notes"),s=i.element("normal-notes");if(void 0!==t&&s){const i=parseInt(t.value,10),r=parseInt(s.value,10);e=new l.Fraction(r*n.Numerator,i*n.Denominator)}}}return e}readExpressionStaffNumber(t){let e=1;if(t.element("staff")){const n=t.element("staff");if(n)try{e=parseInt(n.value,10)}catch(t){const n=u.ITextTranslation.translateText("ReaderErrorMessages/ExpressionStaffError","Invalid Expression staff number -> set to default.");this.musicSheet.SheetErrors.pushMeasureError(n),e=1,m.default.debug("InstrumentReader.readExpressionStaffNumber",n,t)}}return e}readDivisionsFromNotes(){let t=0,e=this.currentXmlMeasureIndex,n=!1;for(;!n;){const i=this.xmlMeasureList[e].elements();for(let e=0,s=i.length;e0){n=!0;break}}if(0===t&&(e++,e===this.xmlMeasureList.length)){const t=u.ITextTranslation.translateText("ReaderErrorMEssages/DivisionsError","Invalid divisions value at Instrument: ");throw new h.MusicSheetReadingException(t+this.instrument.Name)}}return t}}},function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.VoiceGenerator=void 0;const s=n(39),r=n(47),o=n(12),a=n(36),c=n(31),l=n(129),u=n(88),h=n(56),d=n(130),f=n(0),p=n(21),m=n(131),g=n(11),b=n(2),v=n(2),y=n(132),S=i(n(1)),x=n(2),_=n(34),w=n(133),E=n(62),T=n(66),C=n(37),M=n(164),P=n(3);e.VoiceGenerator=class{constructor(t,e,n,i){this.lastBeamTag="",this.openTieDict={},this.currentOctaveShift=0,this.tupletDict={},this.openTupletNumber=0,this.musicSheet=t.GetMusicSheet,this.slurReader=n,this.voice=i?new s.LinkedVoice(t,e,i):new r.Voice(t,e),t.Voices.push(this.voice),this.lyricsReader=new m.LyricsReader(this.musicSheet),this.articulationReader=new w.ArticulationReader}get GetVoice(){return this.voice}get OctaveShift(){return this.currentOctaveShift}set OctaveShift(t){this.currentOctaveShift=t}createVoiceEntry(t,e,n,i=!1,s=!1,r=!1){this.currentVoiceEntry=new o.VoiceEntry(t.clone(),this.voice,e,i,s,r),n&&this.voice.VoiceEntries.push(this.currentVoiceEntry),-1===e.VoiceEntries.indexOf(this.currentVoiceEntry)&&e.VoiceEntries.push(this.currentVoiceEntry)}read(t,e,n,i,s,r,o,a,c,l,u,d,m,g,b,v,y,S,x){this.currentStaffEntry=o,this.currentMeasure=a;try{this.currentNote=r?this.addRestNote(t.element("rest"),e,i,m,g,S):this.addSingleNote(t,e,i,n,s,u,d,m,g,b,v,y,S,x);const o=t.elements("lyric");void 0!==this.lyricsReader&&o&&(this.lyricsReader.addLyricEntry(o,this.currentVoiceEntry),this.voice.Parent.HasLyrics=!0);let a=!1;const p=t.element("notations");if(p){this.articulationReader&&this.readArticulations(p,this.currentVoiceEntry);const e=p.elements("slur");void 0!==this.slurReader&&e.length>0&&!this.currentNote.ParentVoiceEntry.IsGrace&&this.slurReader.addSlur(e,this.currentNote);const n=p.elements("tuplet");n.length>0&&(this.openTupletNumber=this.addTuplet(t,n),a=!0);const i=p.element("arpeggiate");if(void 0!==i&&!this.currentVoiceEntry.IsGrace){let t;if(this.currentVoiceEntry.Arpeggio)t=this.currentVoiceEntry.Arpeggio;else{let e=!1;for(const n of this.currentStaffEntry.VoiceEntries)if(n.Arpeggio){e=!0,t=n.Arpeggio;break}if(!e){let e=T.ArpeggioType.ARPEGGIO_DIRECTIONLESS;const n=i.attribute("direction");if(null!==n)switch(n.value){case"up":e=T.ArpeggioType.ROLL_UP;break;case"down":e=T.ArpeggioType.ROLL_DOWN;break;default:e=T.ArpeggioType.ARPEGGIO_DIRECTIONLESS}t=new T.Arpeggio(this.currentVoiceEntry,e),this.currentVoiceEntry.Arpeggio=t}}t.addNote(this.currentNote)}const s=p.elements("tied");s.length>0&&this.addTie(s,c,l,h.TieTypes.SIMPLE);const r=p.elements("slide");r.length>0&&this.addTie(r,c,l,h.TieTypes.SLIDE);const o=p.element("technical"),u=o.elements("hammer-on");u.length>0&&this.addTie(u,c,l,h.TieTypes.HAMMERON);const d=o.elements("pull-off");d.length>0&&this.addTie(d,c,l,h.TieTypes.PULLOFF);const m=this.openTieDict;for(const t in m)if(m.hasOwnProperty(t)){const e=m[t];f.Fraction.plus(e.StartNote.ParentStaffEntry.Timestamp,e.Duration).lt(this.currentStaffEntry.Timestamp)&&delete m[t]}}void 0===t.element("time-modification")||a||this.handleTimeModificationNode(t)}catch(t){const e=p.ITextTranslation.translateText("ReaderErrorMessages/NoteError","Ignored erroneous Note.");this.musicSheet.SheetErrors.pushMeasureError(e)}return this.currentNote}checkForStaffEntryLink(t,e,n,i){const s=new y.StaffEntryLink(this.currentVoiceEntry);s.LinkStaffEntries.push(n),n.Link=s;const r=this.currentVoiceEntry.Timestamp.clone(),o=i.getVerticalContainerByTimestamp(r);return(n=o.StaffEntries[t])||(n=new c.SourceStaffEntry(o,e),o.StaffEntries[t]=n),n.VoiceEntries.push(this.currentVoiceEntry),s.LinkStaffEntries.push(n),n.Link=s,n}checkForOpenBeam(){void 0!==this.openBeam&&this.currentNote&&this.handleOpenBeam()}checkOpenTies(){const t=this.openTieDict;for(const e in t)if(t.hasOwnProperty(e)){const n=t[e];f.Fraction.plus(n.StartNote.ParentStaffEntry.Timestamp,n.Duration).lt(n.StartNote.SourceMeasure.Duration)&&delete t[e]}}hasVoiceEntry(){return void 0!==this.currentVoiceEntry}readArticulations(t,e){const n=t.element("articulations");n&&this.articulationReader.addArticulationExpression(n,e);const i=t.element("fermata");i&&this.articulationReader.addFermata(i,e);const s=t.element("technical");s&&this.articulationReader.addTechnicalArticulations(s,e);const r=t.element("ornaments");r&&this.articulationReader.addOrnament(r,e)}addSingleNote(t,e,n,i,s,r,o,c,l,u,h,d,m,y){let _=0,w=b.AccidentalEnum.NONE,T=v.NoteEnum.C,C=0,P=void 0,A=void 0,I=void 0;const L=t.elements();for(let a=0,f=L.length;a1){let i=t.element("time-modification");i&&(i=i.element("actual-notes"));const s=e;for(let e=0,r=s.length;e1&&this.openTupletNumber--),this.tupletDict[e]=a;const c=[];c.push(this.currentNote),a.Notes.push(c),a.Fractions.push(this.getTupletNoteDurationFromType(t)),this.currentNote.NoteTuplet=a,this.openTupletNumber=e}else if("stop"===a.value){let e=1;r.attribute("number")&&(e=parseInt(r.attribute("number").value,10));const n=this.tupletDict[e];if(n){const i=[];i.push(this.currentNote),n.Notes.push(i),n.Fractions.push(this.getTupletNoteDurationFromType(t)),this.currentNote.NoteTuplet=n,delete this.tupletDict[e],0===Object.keys(this.tupletDict).length?this.openTupletNumber=0:Object.keys(this.tupletDict).length>1&&this.openTupletNumber--}}}}}else if(e[0]){const i=e[0];if(i.hasAttributes){const e=i.attribute("type").value;let s=1;i.attribute("number")&&(s=parseInt(i.attribute("number").value,10));const r=isNaN(s),o=i.attribute("bracket");o&&"yes"===o.value&&(n=!0);const a=i.attribute("placement"),c=a&&"below"===a.value;if("start"===e){let e=0,i=t.element("time-modification");if(i&&(i=i.element("actual-notes")),i&&(e=parseInt(i.value,10),isNaN(e))){const t=p.ITextTranslation.translateText("ReaderErrorMessages/TupletNoteDurationError","Invalid tuplet note duration.");throw this.musicSheet.SheetErrors.pushMeasureError(t),new g.MusicSheetReadingException(t)}r&&(this.openTupletNumber++,s=this.openTupletNumber);let o=this.tupletDict[s];o||(o=this.tupletDict[s]=new d.Tuplet(e,n),o.tupletLabelNumberPlacement=c?P.PlacementEnum.Below:P.PlacementEnum.Above);const a=[];a.push(this.currentNote),o.Notes.push(a),o.Fractions.push(this.getTupletNoteDurationFromType(t)),this.currentNote.NoteTuplet=o,this.openTupletNumber=s}else if("stop"===e){r&&(s=this.openTupletNumber);const e=this.tupletDict[this.openTupletNumber];if(e){const n=[];n.push(this.currentNote),e.Notes.push(n),e.Fractions.push(this.getTupletNoteDurationFromType(t)),this.currentNote.NoteTuplet=e,0===Object.keys(this.tupletDict).length?this.openTupletNumber=0:Object.keys(this.tupletDict).length>1&&this.openTupletNumber--,delete this.tupletDict[s]}}}}return this.openTupletNumber}handleTimeModificationNode(t){if(this.tupletDict[this.openTupletNumber])try{const e=this.tupletDict[this.openTupletNumber],n=_.CollectionUtil.last(e.Notes);let i;n[0].ParentVoiceEntry.Timestamp.Equals(this.currentVoiceEntry.Timestamp)?i=n:(i=[],e.Notes.push(i),e.Fractions.push(this.getTupletNoteDurationFromType(t))),i.push(this.currentNote),this.currentNote.NoteTuplet=e}catch(t){const e=p.ITextTranslation.translateText("ReaderErrorMessages/TupletNumberError","Invalid tuplet number.");throw this.musicSheet.SheetErrors.pushMeasureError(e),t}else if(this.currentVoiceEntry.Notes.length>0){const t=this.currentVoiceEntry.Notes[0];if(t.NoteTuplet){const e=t.NoteTuplet;_.CollectionUtil.last(e.Notes).push(this.currentNote),this.currentNote.NoteTuplet=e}}}addTie(t,e,n,i){if(t)if(1===t.length){const e=t[0];if(void 0!==e&&e.attributes()){const n=e.attribute("type").value;try{if("start"===n){const t=this.findCurrentNoteInTieDict(this.currentNote);t<0&&delete this.openTieDict[t];const e=this.getNextAvailableNumberForTie(),n=new u.Tie(this.currentNote,i);this.openTieDict[e]=n}else if("stop"===n){const t=this.findCurrentNoteInTieDict(this.currentNote),e=this.openTieDict[t];e&&(e.AddNote(this.currentNote),delete this.openTieDict[t])}}catch(t){const e=p.ITextTranslation.translateText("ReaderErrorMessages/TieError","Error while reading tie.");this.musicSheet.SheetErrors.pushMeasureError(e)}}}else if(2===t.length){const t=this.findCurrentNoteInTieDict(this.currentNote);t>=0&&this.openTieDict[t].AddNote(this.currentNote)}}getNextAvailableNumberForTie(){const t=Object.keys(this.openTieDict);if(0===t.length)return 1;t.sort((t,e)=>+t-+e);for(let e=0;e=0;e--)for(let n=0;n0)for(let s=e;s1&&(h=parseInt(t[1],10))}catch(t){const e=r.ITextTranslation.translateText("ReaderErrorMessages/LyricVerseNumberError","Invalid lyric verse number");this.musicSheet.SheetErrors.pushMeasureError(e);continue}}let f=void 0;if("single"===a||"end"===a){if(this.openLyricWords[h]){this.currentLyricWord=this.openLyricWords[h];const t=this.currentLyricWord.Syllables.length;f=new s.LyricsEntry(u,h,this.currentLyricWord,e,t),this.currentLyricWord.Syllables.push(f),delete this.openLyricWords[h],this.currentLyricWord=void 0}else f=new s.LyricsEntry(u,h,void 0,e);f.extend=void 0!==l.element("extend")}else if("begin"===a)this.openLyricWords[h]&&(delete this.openLyricWords[h],this.currentLyricWord=void 0),this.currentLyricWord=new i.LyricWord,this.openLyricWords[h]=this.currentLyricWord,f=new s.LyricsEntry(u,h,this.currentLyricWord,e,0),this.currentLyricWord.Syllables.push(f);else if("middle"===a)if(this.openLyricWords[h]){this.currentLyricWord=this.openLyricWords[h];const t=this.currentLyricWord.Syllables.length;f=new s.LyricsEntry(u,h,this.currentLyricWord,e,t),this.currentLyricWord.Syllables.push(f)}else f=new s.LyricsEntry(u,h,void 0,e);f&&(e.LyricsEntries[h]||(e.LyricsEntries.setValue(h,f),(null===(o=null===(n=e.ParentSourceStaffEntry)||void 0===n?void 0:n.VerticalContainerParent)||void 0===o?void 0:o.ParentMeasure)&&(e.ParentSourceStaffEntry.VerticalContainerParent.ParentMeasure.hasLyrics=!0)),e.ParentVoice.Parent.LyricVersesNumbers[h]||e.ParentVoice.Parent.LyricVersesNumbers.push(h))}}}catch(t){const e=r.ITextTranslation.translateText("ReaderErrorMessages/LyricError","Error while reading lyric entry.");this.musicSheet.SheetErrors.pushMeasureError(e);continue}}e.ParentVoice.Parent.LyricVersesNumbers=e.ParentVoice.Parent.LyricVersesNumbers.filter((t,e,n)=>n.indexOf(t)===e)}}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.StaffEntryLink=void 0,e.StaffEntryLink=class{constructor(t){this.linkStaffEntries=[],this.voiceEntry=t}get GetVoiceEntry(){return this.voiceEntry}get LinkStaffEntries(){return this.linkStaffEntries}set LinkStaffEntries(t){this.linkStaffEntries=t}}},function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.ArticulationReader=void 0;const s=n(12),r=i(n(1)),o=n(69),a=n(46),c=n(3),l=n(2);e.ArticulationReader=class{getAccEnumFromString(t){switch(t){case"sharp":return l.AccidentalEnum.SHARP;case"flat":return l.AccidentalEnum.FLAT;case"natural":return l.AccidentalEnum.NATURAL;case"double-sharp":case"sharp-sharp":return l.AccidentalEnum.DOUBLESHARP;case"double-flat":case"flat-flat":return l.AccidentalEnum.DOUBLEFLAT;case"quarter-sharp":return l.AccidentalEnum.QUARTERTONESHARP;case"quarter-flat":return l.AccidentalEnum.QUARTERTONEFLAT;case"triple-sharp":return l.AccidentalEnum.TRIPLESHARP;case"triple-flat":return l.AccidentalEnum.TRIPLEFLAT;default:return l.AccidentalEnum.NONE}}addArticulationExpression(t,e){var n;if(void 0!==t&&t.elements().length>0){const i=t.elements();for(let o=0,a=i.length;o0&&e.Articulations[0]!==s.ArticulationEnum.staccato&&e.Articulations.splice(0,0,t),"strongaccent"===c){const e=null===(n=null==a?void 0:a.attribute("type"))||void 0===n?void 0:n.value;"up"===e?t=s.ArticulationEnum.marcatoup:"down"===e&&(t=s.ArticulationEnum.marcatodown)}-1===e.Articulations.indexOf(t)&&e.Articulations.push(t)}}catch(t){const e="Invalid note articulation.";return void r.default.debug("addArticulationExpression",e,t)}}}}addFermata(t,e){let n=s.ArticulationEnum.fermata;t.attributes().length>0&&t.attribute("type")&&"inverted"===t.attribute("type").value&&(n=s.ArticulationEnum.invertedfermata),e.Articulations.push(n)}addTechnicalArticulations(t,e){const n={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};for(const s in n){if(!n.hasOwnProperty(s))continue;const i=n[s];t.element(s)&&-1===e.Articulations.indexOf(i)&&e.Articulations.push(i)}const i=t.element("fingering");if(i){const t=new o.TechnicalInstruction;t.type=o.TechnicalInstructionType.Fingering,t.value=i.value,t.placement=c.PlacementEnum.NotYetDefined;const n=i.attribute("placement");if(null!=n)switch(n.value){case"above":t.placement=c.PlacementEnum.Above;break;case"below":t.placement=c.PlacementEnum.Below;break;case"left":t.placement=c.PlacementEnum.Left;break;case"right":t.placement=c.PlacementEnum.Right;break;default:t.placement=c.PlacementEnum.NotYetDefined}e.TechnicalInstructions.push(t)}}addOrnament(t,e){if(t){let n=void 0;const i={"delayed-inverted-turn":a.OrnamentEnum.DelayedInvertedTurn,"delayed-turn":a.OrnamentEnum.DelayedTurn,"inverted-mordent":a.OrnamentEnum.InvertedMordent,"inverted-turn":a.OrnamentEnum.InvertedTurn,mordent:a.OrnamentEnum.Mordent,"trill-mark":a.OrnamentEnum.Trill,turn:a.OrnamentEnum.Turn};for(const e in i){if(!i.hasOwnProperty(e))continue;const s=t.element(e);if(s){n=new a.OrnamentContainer(i[e]);const t=s.attribute("placement");t&&"below"===t.value&&(n.placement=c.PlacementEnum.Below)}}if(n){const i=t.elements("accidental-mark");if(i){let t=c.PlacementEnum.Below,e=l.AccidentalEnum.NONE;const s=i;for(let i=0,r=s.length;i0?i.RealValue>0?(l=s.Fraction.multiply(s.Fraction.minus(i,r),l),this.directionTimestamp=s.Fraction.plus(l,i)):this.directionTimestamp=s.Fraction.createFromFraction(l):this.offsetDivisions<0&&(i.RealValue>0?(l=s.Fraction.multiply(s.Fraction.minus(i,r),l),this.directionTimestamp=s.Fraction.minus(i,l)):this.directionTimestamp=s.Fraction.createFromFraction(l));const u=t.attribute("placement");if(null!=u)try{const t=u.value;"below"===t?this.placement=p.PlacementEnum.Below:"above"===t&&(this.placement=p.PlacementEnum.Above)}catch(t){const e=g.ITextTranslation.translateText("ReaderErrorMessages/ExpressionPlacementError","Invalid expression placement -> set to default.");b.default.debug("ExpressionReader.readExpressionParameters",e,t),this.musicSheet.SheetErrors.pushMeasureError(e),this.placement=p.PlacementEnum.Below}if(this.placement===p.PlacementEnum.NotYetDefined)try{const e=t.element("direction-type");if(e){const t=e.element("dynamics");if(t){const e=t.attribute("default-y");null!=e&&this.readExpressionPlacement(e,"read dynamics y pos")}const n=e.element("wedge");if(n){const t=n.attribute("default-y");null!=t&&this.readExpressionPlacement(t,"read wedge y pos")}const i=e.element("words");if(i){const t=i.attribute("default-y");null!=t&&this.readExpressionPlacement(t,"read words y pos")}}}catch(t){const e=g.ITextTranslation.translateText("ReaderErrorMessages/ExpressionPlacementError","Invalid expression placement -> set to default.");b.default.debug("ExpressionReader.readExpressionParameters",e,t),this.musicSheet.SheetErrors.pushMeasureError(e),this.placement=p.PlacementEnum.Below}this.placement===p.PlacementEnum.NotYetDefined&&(e.Staves.length>1?this.placement=p.PlacementEnum.Below:e.HasLyrics?this.placement=p.PlacementEnum.Above:this.placement=p.PlacementEnum.Below)}read(t,e,n){let i=!1,r=!1;const o=t.element("sound");if(o){const t=o.attribute("tempo"),n=o.attribute("dynamics");if(t){const n=t.value.match(/\d+/);this.soundTempo=void 0!==n?parseInt(n[0],10):100,e.TempoInBPM=this.soundTempo,this.musicSheet.HasBPMInfo=!0,i=!0}if(n){const t=n.value.match(/\d+/);this.soundDynamic=void 0!==t?parseInt(t[0],10):100,r=!0}}const a=t.element("direction-type");if(!a)return;let c=a.element("metronome");if(c){const t=c.element("beat-unit"),i=void 0!==c.element("beat-unit-dot"),r=c.element("per-minute");if(void 0!==t&&r){c.hasAttributes&&void 0!==c.attribute("default-x")&&(this.directionTimestamp=s.Fraction.createFromFraction(n));const o=parseInt(r.value,10);this.createNewTempoExpressionIfNeeded(e);const a=new h.InstantaneousTempoExpression(void 0,this.placement,this.staffNumber,o,this.currentMultiTempoExpression,!0);this.soundTempo=o,e.TempoInBPM=this.soundTempo,this.musicSheet.HasBPMInfo=!0,a.dotted=i,a.beatUnit=t.value,this.currentMultiTempoExpression.addExpression(a,""),this.currentMultiTempoExpression.CombinedExpressionsText="test"}}else if(c=a.element("dynamics"),c){const i=void 0!==t.element("notations");this.interpretInstantaneousDynamics(c,e,n,i)}else if(c=a.element("words"),c)if(i){this.createNewTempoExpressionIfNeeded(e),this.currentMultiTempoExpression.CombinedExpressionsText=c.value;const t=new h.InstantaneousTempoExpression(c.value,this.placement,this.staffNumber,this.soundTempo,this.currentMultiTempoExpression);this.currentMultiTempoExpression.addExpression(t,"")}else r||this.interpretWords(c,e,n);else c=a.element("wedge"),c&&this.interpretWedge(c,e,n,e.MeasureNumber)}checkForOpenExpressions(t,e){this.openContinuousDynamicExpression&&(this.createNewMultiExpressionIfNeeded(t,e),this.closeOpenContinuousDynamic()),this.openContinuousTempoExpression&&this.closeOpenContinuousTempo(s.Fraction.plus(t.AbsoluteTimestamp,e))}addOctaveShift(t,e,n){let i=1;const s=t.element("staff");if(s)try{i=parseInt(s.value,10)}catch(t){const e=g.ITextTranslation.translateText("ReaderErrorMessages/OctaveShiftStaffError","Invalid octave shift staff number -> set to default");this.musicSheet.SheetErrors.pushMeasureError(e),i=1,b.default.debug("ExpressionReader.addOctaveShift",e,t)}const r=t.element("direction-type");if(r){const s=r.element("octave-shift");if(void 0!==s&&s.hasAttributes)try{if(s.attribute("size")){const t=parseInt(s.attribute("size").value,10);let r=0;if(8===t?r=1:15===t&&(r=2),s.attribute("type")){const t=s.attribute("type").value;if("up"===t||"down"===t){const n=new l.OctaveShift(t,r);n.StaffNumber=i,this.createNewMultiExpressionIfNeeded(e),this.getMultiExpression.OctaveShiftStart=n,n.ParentStartMultiExpression=this.getMultiExpression,this.openOctaveShift=n}else"stop"===t&&this.openOctaveShift&&(this.createNewMultiExpressionIfNeeded(e,n),this.getMultiExpression.OctaveShiftEnd=this.openOctaveShift,this.openOctaveShift.ParentEndMultiExpression=this.getMultiExpression,this.openOctaveShift=void 0)}}}catch(t){const e=g.ITextTranslation.translateText("ReaderErrorMessages/OctaveShiftError","Error while reading octave shift.");this.musicSheet.SheetErrors.pushMeasureError(e),b.default.debug("ExpressionReader.addOctaveShift",e,t)}}}initialize(){this.placement=p.PlacementEnum.NotYetDefined,this.soundTempo=0,this.soundDynamic=0,this.offsetDivisions=0}readExpressionPlacement(t,e){try{const e=parseInt(t.value,10);e<0?this.placement=p.PlacementEnum.Below:e>0&&(this.placement=p.PlacementEnum.Above)}catch(t){b.default.debug("ExpressionReader.readExpressionParameters",e,t)}}interpretInstantaneousDynamics(t,e,n,i){if(t.hasElements){t.hasAttributes&&t.attribute("default-x")&&(this.directionTimestamp=s.Fraction.createFromFraction(n));let r=t.elements()[0].name;if("other-dynamics"===r&&(r=t.elements()[0].value),r){i?this.createNewMultiExpressionIfNeeded(e,s.Fraction.createFromFraction(n)):this.createNewMultiExpressionIfNeeded(e),void 0!==this.openContinuousDynamicExpression&&this.openContinuousDynamicExpression.StartMultiExpression!==this.getMultiExpression&&this.closeOpenContinuousDynamic();const t=new c.InstantaneousDynamicExpression(r,this.soundDynamic,this.placement,this.staffNumber,e);this.getMultiExpression.addExpression(t,""),this.initialize(),this.activeInstantaneousDynamic?this.activeInstantaneousDynamic.DynEnum=t.DynEnum:this.activeInstantaneousDynamic=new c.InstantaneousDynamicExpression(r,0,p.PlacementEnum.NotYetDefined,1,e)}}}interpretWords(t,e,n){const i=t.value;let r;const o=t.attribute("font-style");if(o&&"italic"===o.value&&(r=v.FontStyles.Italic),i.length>0){if(t.hasAttributes&&t.attribute("default-x")&&(this.directionTimestamp=s.Fraction.createFromFraction(n)),this.checkIfWordsNodeIsRepetitionInstruction(i))return;this.fillMultiOrTempoExpression(i,e,r),this.initialize()}}interpretWedge(t,e,n,i){void 0!==t&&t.hasAttributes&&t.attribute("default-x")&&(this.directionTimestamp=s.Fraction.createFromFraction(n)),this.createNewMultiExpressionIfNeeded(e),this.addWedge(t,e),this.initialize()}createNewMultiExpressionIfNeeded(t,e){e||(e=this.directionTimestamp),(!this.getMultiExpression||this.getMultiExpression&&(this.getMultiExpression.SourceMeasureParent!==t||this.getMultiExpression.SourceMeasureParent===t&&this.getMultiExpression.Timestamp!==e))&&(this.getMultiExpression=new u.MultiExpression(t,s.Fraction.createFromFraction(e)),t.StaffLinkedExpressions[this.globalStaffIndex].push(this.getMultiExpression))}createNewTempoExpressionIfNeeded(t){this.currentMultiTempoExpression&&this.currentMultiTempoExpression.SourceMeasureParent===t&&this.currentMultiTempoExpression.Timestamp===this.directionTimestamp||(this.currentMultiTempoExpression=new r.MultiTempoExpression(t,s.Fraction.createFromFraction(this.directionTimestamp)),t.TempoExpressions.push(this.currentMultiTempoExpression))}addWedge(t,e){if(void 0!==t&&t.hasAttributes){const n=t.attribute("type").value.toLowerCase();try{if("crescendo"===n||"diminuendo"===n){const t=new o.ContinuousDynamicExpression(o.ContDynamicEnum[n],this.placement,this.staffNumber,e);this.openContinuousDynamicExpression&&this.closeOpenContinuousDynamic(),this.openContinuousDynamicExpression=t,this.getMultiExpression.StartingContinuousDynamic=t,t.StartMultiExpression=this.getMultiExpression,void 0!==this.activeInstantaneousDynamic&&this.activeInstantaneousDynamic.StaffNumber===t.StaffNumber&&(this.activeInstantaneousDynamic=void 0)}else"stop"===n&&this.openContinuousDynamicExpression&&this.closeOpenContinuousDynamic()}catch(t){const e="ReaderErrorMessages/WedgeError, Error while reading Crescendo / Diminuendo.";this.musicSheet.SheetErrors.pushMeasureError(e),b.default.debug("ExpressionReader.addWedge",e,t)}}}fillMultiOrTempoExpression(t,e,n){if(!t)return;const i=t.trim();this.createExpressionFromString("",i,e,t,n)}createExpressionFromString(t,e,n,i,s){if(h.InstantaneousTempoExpression.isInputStringInstantaneousTempo(e)||a.ContinuousTempoExpression.isInputStringContinuousTempo(e)){if(n.TempoExpressions.length>0)for(let t=0,i=n.TempoExpressions.length;t0)for(let o=0,a=n.TempoExpressions.length;o0&&!this.hasDigit(e)&&this.globalStaffIndex>0){if(t.EntriesList[0].label.indexOf(e)>=0)return!1;break}}let r=m.TextAlignmentEnum.CenterBottom;this.musicSheet.Rules.CompactMode&&(r=m.TextAlignmentEnum.LeftBottom);const l=new f.UnknownExpression(e,this.placement,r,this.staffNumber);return l.fontStyle=s,this.getMultiExpression.addExpression(l,t),!1}closeOpenContinuousDynamic(){this.openContinuousDynamicExpression.EndMultiExpression=this.getMultiExpression,this.getMultiExpression.EndingContinuousDynamic=this.openContinuousDynamicExpression,this.openContinuousDynamicExpression=void 0}closeOpenContinuousTempo(t){this.openContinuousTempoExpression.AbsoluteEndTimestamp=t,this.openContinuousTempoExpression=void 0}checkIfWordsNodeIsRepetitionInstruction(t){return"coda"===(t=t.trim().toLowerCase())||"tocoda"===t||"to coda"===t||"fine"===t||"d.c."===t||"dacapo"===t||"da capo"===t||"d.s."===t||"dalsegno"===t||"dal segno"===t||"d.c. al fine"===t||"d.s. al fine"===t||"d.c. al coda"===t||"d.s. al coda"===t}hasDigit(t){return/\d/.test(t)}}},function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.SlurReader=void 0;const s=n(167),r=i(n(1)),o=n(21);e.SlurReader=class{constructor(t){this.openSlurDict={},this.musicSheet=t}addSlur(t,e){try{if(t)for(const n of t)if(n.attributes().length>0){const i=n.attribute("type").value;let o=1;try{n.attribute("number")&&(o=parseInt(n.attribute("number").value,10))}catch(t){r.default.debug("VoiceGenerator.addSlur number: ",t)}if("start"===i){let t=this.openSlurDict[o];t||(t=new s.Slur,this.openSlurDict[o]=t),t.StartNote=e}else if("stop"===i){const t=this.openSlurDict[o];t&&(t.EndNote=e,e.checkForDoubleSlur(t)||(e.NoteSlurs.push(t),t.StartNote.NoteSlurs.push(t)),delete this.openSlurDict[o])}}}catch(t){const e=o.ITextTranslation.translateText("ReaderErrorMessages/SlurError","Error while reading slur.");this.musicSheet.SheetErrors.pushMeasureError(e)}}}},function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.SubInstrument=void 0;const s=n(7),r=i(n(1));class o{constructor(t){this.parentInstrument=t,this.fixedKey=-1,this.name=this.parseMidiInstrument(this.parentInstrument.Name),this.midiInstrumentID=o.midiInstrument[this.name],this.volume=1}get ParentInstrument(){return this.parentInstrument}static isPianoInstrument(t){return t===s.MidiInstrument.Acoustic_Grand_Piano||t===s.MidiInstrument.Bright_Acoustic_Piano||t===s.MidiInstrument.Electric_Grand_Piano||t===s.MidiInstrument.Electric_Piano_1||t===s.MidiInstrument.Electric_Piano_2}setMidiInstrument(t){this.midiInstrumentID=o.midiInstrument[this.parseMidiInstrument(t)]}parseMidiInstrument(t){try{if(t){const e=t.toLowerCase().trim();for(const t in o.midiInstrument)if(-1!==e.indexOf(t))return t}if(this.parentInstrument.Name){const t=this.parentInstrument.Name.toLowerCase().trim();for(const e in o.midiInstrument)if(-1!==t.indexOf(e))return e}}catch(t){r.default.error("Error parsing MIDI Instrument. Default to Grand Piano.")}return"unnamed"}}e.SubInstrument=o,o.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,"blockflöte":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,"flöte":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}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MusicSymbolModuleFactory=void 0;const i=n(139),s=n(140);e.MusicSymbolModuleFactory=class{static createRepetitionInstructionReader(){return new i.RepetitionInstructionReader}static createRepetitionCalculator(){return new s.RepetitionCalculator}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.RepetitionInstructionReader=void 0;const i=n(28),s=n(28),r=n(168);e.RepetitionInstructionReader=class{set MusicSheet(t){this.musicSheet=t,this.xmlMeasureList=new Array(this.musicSheet.Instruments.length),this.repetitionInstructions=[]}prepareReadingMeasure(t,e){this.currentMeasureIndex=e}handleLineRepetitionInstructions(t){let e=!1;if(t.elements().length>0){let n="",s=!1,r="",o="",a="";const c=[],l=t.element("bar-style");l&&(a=l.value),n=t.attributes().length>0&&t.attribute("location")?t.attribute("location").value:"right";const u=t.elements();for(let t=0,e=u.length;t0)if("left"===n){if("start"===o){const t=new i.RepetitionInstruction(this.currentMeasureIndex,i.RepetitionInstructionEnum.Ending,i.AlignmentType.Begin,void 0,c);this.addInstruction(this.repetitionInstructions,t)}if("forward"===r){const t=new i.RepetitionInstruction(this.currentMeasureIndex,i.RepetitionInstructionEnum.StartLine);this.addInstruction(this.repetitionInstructions,t)}}else{if("stop"===o){const t=new i.RepetitionInstruction(this.currentMeasureIndex,i.RepetitionInstructionEnum.Ending,i.AlignmentType.End,void 0,c);this.addInstruction(this.repetitionInstructions,t)}if("backward"===r){const t=new i.RepetitionInstruction(this.currentMeasureIndex,i.RepetitionInstructionEnum.BackJumpLine);this.addInstruction(this.repetitionInstructions,t)}}}return e}handleRepetitionInstructionsFromWordsOrSymbols(t,e){const n=t.element("words");if(n){const t="d\\s?\\.s\\.",s=n.value.trim().toLowerCase();if(r.StringUtil.StringContainsSeparatedWord(s,t+" al fine")){let t=this.currentMeasureIndex;e<.5&&this.currentMeasureIndex.5&&t++;const n=new i.RepetitionInstruction(t,i.RepetitionInstructionEnum.Coda);return this.addInstruction(this.repetitionInstructions,n),!0}if(r.StringUtil.StringContainsSeparatedWord(s,"segno")){let t=this.currentMeasureIndex;e>.5&&t++;const n=new i.RepetitionInstruction(t,i.RepetitionInstructionEnum.Segno);return this.addInstruction(this.repetitionInstructions,n),!0}}else{if(t.element("segno")){let t=this.currentMeasureIndex;e>.5&&t++;const n=new i.RepetitionInstruction(t,i.RepetitionInstructionEnum.Segno);return this.addInstruction(this.repetitionInstructions,n),!0}if(t.element("coda")){let t=this.currentMeasureIndex;e>.5&&t++;const n=new i.RepetitionInstruction(t,i.RepetitionInstructionEnum.Coda);return this.addInstruction(this.repetitionInstructions,n),!0}}return!1}removeRedundantInstructions(){let t=0,e=0,n=0,r=0;for(let s=0;s0&&this.findInstructionInPreviousMeasure(s,o.measureIndex,i.RepetitionInstructionEnum.ToCoda)&&(o.type=i.RepetitionInstructionEnum.None),0===e&&0===n&&(o.type=i.RepetitionInstructionEnum.ToCoda,o.alignment=i.AlignmentType.End,o.measureIndex--);break;case i.RepetitionInstructionEnum.Segno:if(t-r>0){let t=!1;for(let s=0,r=this.repetitionInstructions.length;s0?i.RepetitionInstructionEnum.DalSegnoAlCoda:i.RepetitionInstructionEnum.DalSegno,o.type=i.RepetitionInstructionEnum.None,t=!0;break;case i.RepetitionInstructionEnum.DalSegno:case i.RepetitionInstructionEnum.DalSegnoAlFine:case i.RepetitionInstructionEnum.DalSegnoAlCoda:o.type=i.RepetitionInstructionEnum.None,t=!0}if(t)break}if(t)break;o.type=n-e>0?i.RepetitionInstructionEnum.DalSegnoAlCoda:i.RepetitionInstructionEnum.DalSegno,o.alignment=i.AlignmentType.End,o.measureIndex--}}if(this.backwardSearchForPreviousIdenticalInstruction(s,o)||o.type===i.RepetitionInstructionEnum.None)this.repetitionInstructions.splice(s,1),s--;else switch(o.type){case i.RepetitionInstructionEnum.Fine:break;case i.RepetitionInstructionEnum.ToCoda:n++;break;case i.RepetitionInstructionEnum.Coda:e++;break;case i.RepetitionInstructionEnum.Segno:t++;break;case i.RepetitionInstructionEnum.DalSegnoAlFine:case i.RepetitionInstructionEnum.DalSegnoAlCoda:r++}}this.repetitionInstructions.sort(s.RepetitionInstructionComparer.Compare)}findInstructionInPreviousMeasure(t,e,n){for(let i=t-1;i>=0;i--){const t=this.repetitionInstructions[i];if(e-t.measureIndex==1&&t.type===n)return!0}return!1}backwardSearchForPreviousIdenticalInstruction(t,e){for(let n=t-1;n>=0;n--)if(this.repetitionInstructions[n].equals(e))return!0;return!1}addInstruction(t,e){let n=!0;for(let i=0,s=t.length;i1&&t.FirstRepetitionInstructions.sort(s.RepetitionInstructionComparer.Compare),t.LastRepetitionInstructions.length>1&&t.LastRepetitionInstructions.sort(s.RepetitionInstructionComparer.Compare)}}handleRepetitionInstructions(t){if(!this.currentMeasure)return!1;switch(t.type){case i.RepetitionInstructionEnum.StartLine:this.currentMeasure.FirstRepetitionInstructions.push(t);break;case i.RepetitionInstructionEnum.BackJumpLine:this.currentMeasure.LastRepetitionInstructions.push(t);break;case i.RepetitionInstructionEnum.Ending:if(t.alignment===i.AlignmentType.Begin)this.currentMeasure.FirstRepetitionInstructions.push(t);else for(let e=0,n=t.endingIndices.length;ee.file("META-INF/container.xml").async("text"),t=>{throw t}).then(t=>{const n=(new DOMParser).parseFromString(t,"text/xml").getElementsByTagName("rootfile")[0].getAttribute("full-path");return e.file(n).async("text")},t=>{throw t}).then(t=>{const e=(new DOMParser).parseFromString(t,"text/xml"),n=new s.IXmlElement(e.documentElement);return Promise.resolve(n)},t=>{throw t}).then(t=>t,t=>{throw new Error("extractSheetFromMxl: "+t.message)})}static MXLtoXMLstring(t){const e=new r.default;return e.loadAsync(t).then(t=>e.file("META-INF/container.xml").async("text"),t=>{throw t}).then(t=>{const n=(new DOMParser).parseFromString(t,"text/xml").getElementsByTagName("rootfile")[0].getAttribute("full-path");return e.file(n).async("text")},t=>{throw t})}}},function(t,e){var n,i,s=t.exports={};function r(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function a(t){if(n===setTimeout)return setTimeout(t,0);if((n===r||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:r}catch(t){n=r}try{i="function"==typeof clearTimeout?clearTimeout:o}catch(t){i=o}}();var c,l=[],u=!1,h=-1;function d(){u&&c&&(u=!1,c.length?l=c.concat(l):h=-1,l.length&&f())}function f(){if(!u){var t=a(d);u=!0;for(var e=l.length;e;){for(c=l,l=[];++h1)for(var n=1;nn.copies?this.nElements-=n.copies:this.nElements-=e,n.copies-=e,n.copies<=0&&this.dictionary.remove(t),!0}return!1},t.prototype.toArray=function(){for(var t=[],e=0,n=this.dictionary.values();e-1&&this.insertIdIntoRoot(e,n),this.nodes)if(this.nodes.hasOwnProperty(i)){var s=this.findNodeId(i,t);s>-1&&this.insertIdIntoNode(i,e,s)}},t.prototype.insertIdAfterId=function(t,e){var n=this.findRootId(t);for(var i in n>-1&&this.insertIdIntoRoot(e,n+1),this.nodes)if(this.nodes.hasOwnProperty(i)){var s=this.findNodeId(i,t);s>-1&&this.insertIdIntoNode(i,e,s+1)}},t.prototype.insertIdIntoId=function(t,e){this.nodeInsertAtEnd(t,e),this.nodes[e]=[]},t.prototype.insertIdIntoRoot=function(t,e){if(void 0===e)this.rootInsertAtEnd(t);else if(e<0){var n=this.rootIds.length;this.rootIds.splice(e+n+1,0,t)}else this.rootIds.splice(e,0,t);this.nodes[t]=this.nodes[t]||[]},t.prototype.insertIdIntoNode=function(t,e,n){if(this.nodes[t]=this.nodes[t]||[],this.nodes[e]=this.nodes[e]||[],void 0===n)this.nodeInsertAtEnd(t,e);else if(n<0){var i=this.nodes[t].length;this.nodes[t].splice(n+i+1,0,e)}else this.nodes[t].splice(n,0,e)},t.prototype.moveId=function(t,e,n){var s=t,r=this.findRootId(s);for(var o in this.nodes[e],this.nodes)if(this.nodes.hasOwnProperty(o)){this.findNodeId(o,e);break}var a=e,c=this.findRootId(a);for(var o in this.nodes[e],this.nodes)if(this.nodes.hasOwnProperty(o)){this.findNodeId(o,e);break}if(r>-1){if(c>-1)switch(this.rootDelete(r),c>r&&c--,n){case i.BEFORE:this.insertIdIntoRoot(s,c);break;case i.AFTER:this.insertIdIntoRoot(s,c+1);break;case i.INSIDE_AT_START:this.nodeInsertAtStart(a,s);break;case i.INSIDE_AT_END:this.nodeInsertAtEnd(a,s)}else for(var o in this.rootDelete(r),this.nodes)if(this.nodes.hasOwnProperty(o)&&(l=this.findNodeId(o,a))>-1){switch(n){case i.BEFORE:this.insertIdIntoNode(o,s,l);break;case i.AFTER:this.insertIdIntoNode(o,s,l+1);break;case i.INSIDE_AT_START:this.nodeInsertAtStart(a,s);break;case i.INSIDE_AT_END:this.nodeInsertAtEnd(a,s)}break}}else if(c>-1){for(var o in this.nodes)if(this.nodes.hasOwnProperty(o)&&(l=this.findNodeId(o,s))>-1){this.nodeDeleteAtIndex(o,l);break}switch(n){case i.BEFORE:this.insertIdIntoRoot(s,c);break;case i.AFTER:this.insertIdIntoRoot(s,c+1);break;case i.INSIDE_AT_START:this.nodeInsertAtStart(a,s);break;case i.INSIDE_AT_END:this.nodeInsertAtEnd(a,s)}}else{for(var o in this.nodes)if(this.nodes.hasOwnProperty(o)&&(l=this.findNodeId(o,s))>-1){this.nodeDeleteAtIndex(o,l);break}for(var o in this.nodes){var l;if(this.nodes.hasOwnProperty(o)&&(l=this.findNodeId(o,a))>-1){switch(n){case i.BEFORE:this.insertIdIntoNode(o,s,l);break;case i.AFTER:this.insertIdIntoNode(o,s,l+1);break;case i.INSIDE_AT_START:this.nodeInsertAtStart(a,s);break;case i.INSIDE_AT_END:this.nodeInsertAtEnd(a,s)}break}}}},t.prototype.swapArrayElements=function(t,e,n){var i=t[e];return t[e]=t[n],t[n]=i,t},t.prototype.rootDeleteId=function(t){var e=this.findRootId(t);e>-1&&this.rootDelete(e)},t.prototype.nodeAndSubNodesDelete=function(t){for(var e=[],n=0;nn.load(t),t=>{throw m.default.debug(t),new Error("OpenSheetMusicDisplay: Invalid MXL file")});if(""===e.substr(0,3))return m.default.debug("[OSMD] UTF with BOM detected, truncate first three bytes and pass along: "+e),n.load(e.substr(3));let i=e;if(/^\s/.test(i)&&(i=i.trim()),i.substr(0,6).includes("n.load(t),t=>{throw t});console.error("[OSMD] osmd.load(string): Could not process string. Did not find 32767&&(console.log("[OSMD] Warning: width of "+e+s),e=32767),t=this.rules.PageFormat&&!this.rules.PageFormat.IsUndefined?e/this.rules.PageFormat.aspectRatio:(n.PositionAndShape.Size.height+15)*this.zoom*10,i.getOSMDBackendType()===b.BackendType.Canvas&&t>32767&&(console.log("[OSMD] Warning: height of "+t+s),t=Math.min(t,32767)),i.resize(e,t),i.clear(),this.drawer.Backends.push(i)}}IsReadyToRender(){return void 0!==this.graphic}clear(){this.drawer.clear(),this.reset()}setOptions(t){if(this.rules||(this.rules=new v.EngravingRules),this.drawingParameters||(this.drawingParameters=new g.DrawingParameters,this.drawingParameters.Rules=this.rules),null==t)return void m.default.warn("warning: osmd.setOptions() called without an options parameter, has no effect.\nexample usage: osmd.setOptions({drawCredits: false, drawPartNames: false})");t.drawingParameters&&(this.drawingParameters.DrawingParametersEnum=g.DrawingParametersEnum[t.drawingParameters.toLowerCase()]);let e=!this.drawer||!this.drawer.Backends||this.drawer.Backends.length<1;if(void 0!==t.backend){const n=b.OSMDOptions.BackendTypeFromString(t.backend);e=e||this.backendType!==n,this.backendType=n}this.needBackendUpdate=e,void 0!==t.autoBeam&&(this.rules.AutoBeamNotes=t.autoBeam);const n=t.autoBeamOptions;if(n&&(void 0===n.maintain_stem_directions&&(n.maintain_stem_directions=!1),this.rules.AutoBeamOptions=n,n.groups&&n.groups.length))for(const i of n.groups)if(2!==i.length)throw new Error("Each fraction in autoBeamOptions.groups must be of length 2, e.g. [3,4] for beaming three fourths");void 0!==t.percussionOneLineCutoff&&(this.rules.PercussionOneLineCutoff=t.percussionOneLineCutoff),0!==this.rules.PercussionOneLineCutoff&&void 0!==t.percussionForceVoicesOneLineCutoff&&(this.rules.PercussionForceVoicesOneLineCutoff=t.percussionForceVoicesOneLineCutoff),void 0!==t.alignRests&&(this.rules.AlignRests=t.alignRests),void 0!==t.coloringMode&&this.setColoringMode(t),void 0!==t.coloringEnabled&&(this.rules.ColoringEnabled=t.coloringEnabled),void 0!==t.colorStemsLikeNoteheads&&(this.rules.ColorStemsLikeNoteheads=t.colorStemsLikeNoteheads),t.disableCursor&&(this.drawingParameters.drawCursors=!1),t.drawHiddenNotes&&(this.drawingParameters.drawHiddenNotes=!0),void 0!==t.drawCredits&&(this.drawingParameters.DrawCredits=t.drawCredits),void 0!==t.drawComposer&&(this.drawingParameters.DrawComposer=t.drawComposer),void 0!==t.drawTitle&&(this.drawingParameters.DrawTitle=t.drawTitle),void 0!==t.drawSubtitle&&(this.drawingParameters.DrawSubtitle=t.drawSubtitle),void 0!==t.drawLyricist&&(this.drawingParameters.DrawLyricist=t.drawLyricist),void 0!==t.drawMetronomeMarks&&(this.rules.MetronomeMarksDrawn=t.drawMetronomeMarks),void 0!==t.drawPartNames&&(this.drawingParameters.DrawPartNames=t.drawPartNames,t.drawPartAbbreviations||(this.rules.RenderPartAbbreviations=t.drawPartNames)),void 0!==t.drawPartAbbreviations&&(this.rules.RenderPartAbbreviations=t.drawPartAbbreviations),!1===t.drawFingerings&&(this.rules.RenderFingerings=!1),void 0!==t.drawMeasureNumbers&&(this.rules.RenderMeasureNumbers=t.drawMeasureNumbers),t.drawMeasureNumbersOnlyAtSystemStart&&(this.rules.RenderMeasureNumbersOnlyAtSystemStart=t.drawMeasureNumbersOnlyAtSystemStart),void 0!==t.drawLyrics&&(this.rules.RenderLyrics=t.drawLyrics),void 0!==t.drawTimeSignatures&&(this.rules.RenderTimeSignatures=t.drawTimeSignatures),void 0!==t.drawSlurs&&(this.rules.RenderSlurs=t.drawSlurs),void 0!==t.measureNumberInterval&&(this.rules.MeasureNumberLabelOffset=t.measureNumberInterval),void 0!==t.fingeringPosition&&(this.rules.FingeringPosition=y.AbstractExpression.PlacementEnumFromString(t.fingeringPosition)),void 0!==t.fingeringInsideStafflines&&(this.rules.FingeringInsideStafflines=t.fingeringInsideStafflines),void 0!==t.newSystemFromXML&&(this.rules.NewSystemAtXMLNewSystemAttribute=t.newSystemFromXML),void 0!==t.newPageFromXML&&(this.rules.NewPageAtXMLNewPageAttribute=t.newPageFromXML),void 0!==t.fillEmptyMeasuresWithWholeRest&&(this.rules.FillEmptyMeasuresWithWholeRest=t.fillEmptyMeasuresWithWholeRest),void 0!==t.followCursor&&(this.FollowCursor=t.followCursor),void 0!==t.setWantedStemDirectionByXml&&(this.rules.SetWantedStemDirectionByXml=t.setWantedStemDirectionByXml),t.defaultColorNotehead&&(this.rules.DefaultColorNotehead=t.defaultColorNotehead),t.defaultColorRest&&(this.rules.DefaultColorRest=t.defaultColorRest),t.defaultColorStem&&(this.rules.DefaultColorStem=t.defaultColorStem),t.defaultColorLabel&&(this.rules.DefaultColorLabel=t.defaultColorLabel),t.defaultColorTitle&&(this.rules.DefaultColorTitle=t.defaultColorTitle),t.defaultFontFamily&&(this.rules.DefaultFontFamily=t.defaultFontFamily),t.defaultFontStyle&&(this.rules.DefaultFontStyle=t.defaultFontStyle),t.drawUpToMeasureNumber&&(this.rules.MaxMeasureToDrawIndex=t.drawUpToMeasureNumber-1),t.drawFromMeasureNumber&&(this.rules.MinMeasureToDrawIndex=t.drawFromMeasureNumber-1),t.tupletsRatioed&&(this.rules.TupletsRatioed=!0),t.tupletsBracketed&&(this.rules.TupletsBracketed=!0),t.tripletsBracketed&&(this.rules.TripletsBracketed=!0),t.autoResize?(this.resizeHandlerAttached||this.autoResize(),this.autoResizeEnabled=!0):!1===t.autoResize&&(this.autoResizeEnabled=!1),void 0!==t.pageFormat&&this.setPageFormat(t.pageFormat),void 0!==t.pageBackgroundColor&&(this.rules.PageBackgroundColor=t.pageBackgroundColor),void 0!==t.renderSingleHorizontalStaffline&&(this.rules.RenderSingleHorizontalStaffline=t.renderSingleHorizontalStaffline),void 0!==t.spacingFactorSoftmax&&(this.rules.SoftmaxFactorVexFlow=t.spacingFactorSoftmax),void 0!==t.spacingBetweenTextLines&&(this.rules.SpacingBetweenTextLines=t.spacingBetweenTextLines),void 0!==t.stretchLastSystemLine&&(this.rules.StretchLastSystemLine=t.stretchLastSystemLine),void 0!==t.autoGenerateMutipleRestMeasuresFromRestMeasures&&(this.rules.AutoGenerateMutipleRestMeasuresFromRestMeasures=t.autoGenerateMutipleRestMeasuresFromRestMeasures)}setColoringMode(t){if(t.coloringMode===g.ColoringModes.XML)return void(this.rules.ColoringMode=g.ColoringModes.XML);const e=[_.NoteEnum.C,_.NoteEnum.D,_.NoteEnum.E,_.NoteEnum.F,_.NoteEnum.G,_.NoteEnum.A,_.NoteEnum.B,-1];let n;if(t.coloringMode===g.ColoringModes.CustomColorSet){if(!t.coloringSetCustom||8!==t.coloringSetCustom.length)throw new Error("Invalid amount of colors: With coloringModes.customColorSet, you have to provide a coloringSetCustom parameter with 8 strings (C to B, rest note).");for(const e of t.coloringSetCustom)if(!/^\#[0-9a-fA-F]{6}$/.test(e))throw new Error("One of the color strings in options.coloringSetCustom was not a valid HTML Hex color:\n"+e);n=t.coloringSetCustom}else if(t.coloringMode===g.ColoringModes.AutoColoring){n=[];const t=Object.keys(x.AutoColorSet);for(let e=0;e{},()=>{var e;(null===(e=this.graphic)||void 0===e?void 0:e.GetCalculator)instanceof r.VexFlowMusicSheetCalculator&&(this.graphic.GetCalculator.beamsNeedUpdate=!0),t.IsReadyToRender()&&t.render()})}handleResize(t,e){let n,i=void 0;const s=this;function r(){s.AutoResizeEnabled&&(n=(new Date).getTime(),i||(t(),n=(new Date).getTime(),i=window.setTimeout(o,200)))}function o(){i=void 0,window.clearTimeout(i),(new Date).getTime()-n<200?i=window.setTimeout(o,200):e()}window.attachEvent?window.attachEvent("onresize",r):window.addEventListener("resize",r),this.resizeHandlerAttached=!0,window.setTimeout(t,0),window.setTimeout(e,1)}enableOrDisableCursor(t){var e,n,i,s;if(this.drawingParameters.drawCursors=t,t){const t=null===(e=this.cursor)||void 0===e?void 0:e.Hidden,r=null===(n=this.cursor)||void 0===n?void 0:n.Iterator;null===(i=this.cursor)||void 0===i||i.hide();let o=null===(s=this.drawer)||void 0===s?void 0:s.Backends[0];if(o&&this.rules.RestoreCursorAfterRerender&&this.cursor){const t=this.cursor.updateCurrentPage();o=this.drawer.Backends[t-1]}o&&o.getRenderElement()&&(this.cursor=new d.Cursor(o.getRenderElement(),this)),this.sheet&&this.graphic&&this.cursor&&this.cursor.init(this.sheet.MusicPartManager,this.graphic),this.rules.RestoreCursorAfterRerender&&(this.cursor.hidden=t,r&&(this.cursor.iterator=r,this.cursor.update()))}else{if(!this.cursor)return;this.cursor.hide()}}createBackend(t,e){let n;return n=void 0===t||t===b.BackendType.SVG?new u.SvgVexFlowBackend(this.rules):new h.CanvasVexFlowBackend(this.rules),n.graphicalMusicPage=e,n.initialize(this.container),n}static StringToPageFormat(t){let e=v.PageFormat.UndefinedPageFormat;if(t.match("^[0-9]+x[0-9]+$")){const n=t.split("x"),i=Number.parseInt(n[0],10),s=Number.parseInt(n[1],10);i>0&&i<32768&&s>0&&s<32768&&(e=new v.PageFormat(i,s,"customPageFormat"+t))}return t=(t=(t=t.replace(" ","_")).replace("Landscape","L")).replace("Portrait","P"),w.PageFormatStandards.hasOwnProperty(t)?(e=w.PageFormatStandards[t],e):e}setPageFormat(t){const e=w.StringToPageFormat(t);this.needBackendUpdate=!e.Equals(this.rules.PageFormat),this.rules.PageFormat=e}setCustomPageFormat(t,e){if(t>0&&e>0){const n=new v.PageFormat(t,e);this.rules.PageFormat=n}}set DrawSkyLine(t){this.drawSkyLine=t,this.drawer&&(this.drawer.skyLineVisible=t)}get DrawSkyLine(){return this.drawer.skyLineVisible}set DrawBottomLine(t){this.drawBottomLine=t,this.drawer&&(this.drawer.bottomLineVisible=t)}get DrawBottomLine(){return this.drawer.bottomLineVisible}set DrawBoundingBox(t){this.drawBoundingBox=t,this.drawer.drawableBoundingBoxElement=t,this.render()}get DrawBoundingBox(){return this.drawBoundingBox}get AutoResizeEnabled(){return this.autoResizeEnabled}set AutoResizeEnabled(t){this.autoResizeEnabled=t}set Zoom(t){var e;this.zoom=t,this.zoomUpdated=!0,(null===(e=this.graphic)||void 0===e?void 0:e.GetCalculator)instanceof r.VexFlowMusicSheetCalculator&&(this.graphic.GetCalculator.beamsNeedUpdate=this.zoomUpdated)}set FollowCursor(t){this.followCursor=t}get FollowCursor(){return this.followCursor}set TransposeCalculator(t){c.MusicSheetCalculator.transposeCalculator=t}get TransposeCalculator(){return c.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}}e.OpenSheetMusicDisplay=w,w.PageFormatStandards={A3_L:new v.PageFormat(420,297,"A3_L"),A3_P:new v.PageFormat(297,420,"A3_P"),A4_L:new v.PageFormat(297,210,"A4_L"),A4_P:new v.PageFormat(210,297,"A4_P"),A5_L:new v.PageFormat(210,148,"A5_L"),A5_P:new v.PageFormat(148,210,"A5_P"),A6_L:new v.PageFormat(148,105,"A6_L"),A6_P:new v.PageFormat(105,148,"A6_P"),Endless:v.PageFormat.UndefinedPageFormat,Letter_L:new v.PageFormat(279.4,215.9,"Letter_L"),Letter_P:new v.PageFormat(215.9,279.4,"Letter_P")}},function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.VexFlowTabMeasure=void 0;const s=i(n(9)),r=n(49),o=n(14),a=i(n(1));class c extends r.VexFlowMeasure{constructor(t,e,n){super(t,e,n),this.isTabMeasure=!0}resetLayout(){this.stave=new s.default.Flow.TabStave(0,0,0,{space_above_staff_ln:0,space_below_staff_ln:0}),this.updateInstructionWidth()}graphicalMeasureCreatedCalculations(){for(let e=0,n=this.staffEntries.length;e1){const n=o.VexFlowConverter.StrokeTypeFromArpeggioType(e.type),i=new s.default.Flow.Stroke(n,{all_voices:this.rules.ArpeggiosGoAcrossVoices});this.rules.RenderArpeggios&&t.vfStaveNote.addStroke(0,i)}else a.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.`)}this.vfVoices[e.VoiceId].addTickable(t.vfStaveNote)}else this.vfVoices[e.VoiceId].addTickable(t.vfStaveNote)}}}}e.VexFlowTabMeasure=c},function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.VexFlowMultiRestMeasure=void 0;const s=i(n(9)),r=n(49);class o extends r.VexFlowMeasure{constructor(t,e,n){super(t,e,n),this.minimumStaffEntriesWidth=-1,n?this.rules=n.ParentMusicSystem.rules:e&&(this.rules=e.Rules),this.resetLayout(),this.multiRestElement=new s.default.Flow.MultiMeasureRest(e.multipleRestMeasures,{})}draw(t){this.stave.setContext(t).draw(),this.multiRestElement.setStave(this.stave),this.multiRestElement.setContext(t),this.multiRestElement.draw();for(const e of this.connectors)e.setContext(t).draw()}format(){}getVoicesWithinMeasure(){return[]}getGraphicalVoiceEntriesPerVoice(t){return[]}getRestFilledVexFlowStaveNotesPerVoice(t){return[]}handleBeam(t,e){}handleTuplet(t,e){}finalizeBeams(){}finalizeTuplets(){}layoutStaffEntry(t){}graphicalMeasureCreatedCalculations(){}createArticulations(){}createOrnaments(){}createFingerings(t){}getVFStave(){return this.stave}}e.VexFlowMultiRestMeasure=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DynamicExpressionSymbolEnum=void 0,function(t){t[t.p=0]="p",t[t.f=1]="f",t[t.s=2]="s",t[t.z=3]="z",t[t.m=4]="m",t[t.r=5]="r"}(e.DynamicExpressionSymbolEnum||(e.DynamicExpressionSymbolEnum={}))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Matrix2D=void 0;const i=n(5);class s{constructor(){this.matrix=[];for(let t=0;t<2;t++){this.matrix[t]=[];for(let e=0;e<2;e++)this.matrix[t][e]=0}}static getRotationMatrix(t){const e=new s,n=Math.cos(t),i=Math.sin(t);return e.matrix[0][0]=n,e.matrix[0][1]=-i,e.matrix[1][0]=i,e.matrix[1][1]=n,e}scalarMultiplication(t){for(let e=0;e<2;e++)for(let n=0;n<2;n++)this.matrix[e][n]*=t}getTransposeMatrix(){const t=new s;for(let e=0;e<2;e++)for(let n=0;n<2;n++)t.matrix[e][n]=this.matrix[n][e];return t}vectorMultiplication(t){const e=new i.PointF2D;return e.x=t.x*this.matrix[0][0]+t.y*this.matrix[0][1],e.y=t.x*this.matrix[1][0]+t.y*this.matrix[1][1],e}}e.Matrix2D=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.VexflowStafflineNoteCalculator=void 0;const i=n(2),s=n(70),r=n(19),o=n(7),a=n(12);class c{constructor(t){this.staffPitchListMapping=new r.Dictionary,this.baseLineNote=i.NoteEnum.B,this.baseLineOctave=1,this.rules=t}trackNote(t){if(!(t instanceof s.VexFlowGraphicalNote)||t.Clef().ClefType!==o.ClefEnum.percussion||t.sourceNote.isRest()||0===this.rules.PercussionOneLineCutoff||-1===this.rules.PercussionForceVoicesOneLineCutoff)return;const e=t.parentVoiceEntry.parentStaffEntry.sourceStaffEntry.ParentStaff.idInMusicSheet;let n=void 0;this.staffPitchListMapping.containsKey(e)||this.staffPitchListMapping.setValue(e,new Array),n=this.staffPitchListMapping.getValue(e);const i=t.sourceNote.Pitch;c.findOrInsert(n,i)}static PitchIndexOf(t,e,n=0){if(n>t.length-1)return-1;for(let i=n;ithis.rules.PercussionOneLineCutoff)return t;const r=t,o=t.sourceNote.Pitch;if(n.length<=this.rules.PercussionForceVoicesOneLineCutoff)r.setAccidental(new i.Pitch(this.baseLineNote,this.baseLineOctave,o.Accidental));else{const t=c.PitchIndexOf(n,o);if(t>-1){let e=this.baseLineNote,s=this.baseLineOctave;const c=Math.ceil(n.length/2);if(t>=c)switch(s=2,(t-c)%5){case 1:e=i.NoteEnum.E;break;case 2:e=i.NoteEnum.G;break;case 3:e=i.NoteEnum.B;break;case 4:e=i.NoteEnum.D,s=3;break;default:e=i.NoteEnum.C}else switch(t%5){case 1:e=i.NoteEnum.F;break;case 2:e=i.NoteEnum.D;break;case 3:e=i.NoteEnum.B,s=0;break;case 4:e=i.NoteEnum.G,s=0;break;default:e=i.NoteEnum.A}const l=new i.Pitch(e,s,o.Accidental);r.setAccidental(l),r.parentVoiceEntry.parentVoiceEntry.Notes.length<2&&(l.Octave>this.baseLineOctave||l.FundamentalNote===this.baseLineNote&&l.Octave===this.baseLineOctave?r.parentVoiceEntry.parentVoiceEntry.WantedStemDirection=a.StemDirectionType.Up:r.parentVoiceEntry.parentVoiceEntry.WantedStemDirection=a.StemDirectionType.Down)}}return r}getStafflineUniquePositionCount(t){return this.staffPitchListMapping.containsKey(t)?this.staffPitchListMapping.getValue(t).length:0}}e.VexflowStafflineNoteCalculator=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TimestampTransform=e.MusicPartManager=void 0;const i=n(0),s=n(159);e.MusicPartManager=class{constructor(t){this.musicSheet=t}reInit(){this.init()}init(){this.parts=this.musicSheet.Repetitions.slice(),this.sheetStart=this.musicSheet.SelectionStart=new i.Fraction(0,1),this.sheetEnd=this.musicSheet.SelectionEnd=this.musicSheet.SheetEndTimestamp,this.calcMapping()}getCurrentRepetitionTimestampTransform(t){let e=void 0;for(let n=this.timestamps.length-1;n>=0;n--)if(e=this.timestamps[n],t.gte(e.$from))return e;return this.timestamps[0]}absoluteEnrolledToSheetTimestamp(t){if(0===this.timestamps.length)return t;const e=this.getCurrentRepetitionTimestampTransform(t);return i.Fraction.plus(t,i.Fraction.minus(e.to,e.$from))}get Parts(){return this.parts}get MusicSheet(){return this.musicSheet}getIterator(t){return t?new s.MusicPartManagerIterator(this,t,void 0):new s.MusicPartManagerIterator(this,this.musicSheet.SelectionStart,this.musicSheet.SelectionEnd)}setSelectionStart(t){this.musicSheet.SelectionStart=t,this.musicSheet.SelectionEnd=void 0}setSelectionRange(t,e){this.musicSheet.SelectionStart=null!=t?t:this.sheetStart,this.musicSheet.SelectionEnd=null!=e?e:this.sheetEnd}calcMapping(){const t=[],e=this.getIterator();let n=e.CurrentRepetition,i=new r(e.CurrentEnrolledTimestamp.clone(),e.CurrentSourceTimestamp.clone(),void 0,0);for(t.push(i);!e.EndReached;){if(e.JumpOccurred||n!==e.CurrentRepetition){if(n=e.CurrentRepetition,e.backJumpOccurred){const n=e.JumpResponsibleRepetition;i.nextBackJump=e.CurrentEnrolledTimestamp,i.curRepetition=n,i.curRepetitionIteration=e.CurrentJumpResponsibleRepetitionIterationBeforeJump;for(let e=this.timestamps.length-2;e>=0&&!t[e].to.lt(n.AbsoluteTimestamp)&&!t[e].curRepetition;e--)t[e].nextBackJump=i.nextBackJump,t[e].curRepetition=n,t[e].curRepetitionIteration=i.curRepetitionIteration}i=new r(e.CurrentEnrolledTimestamp.clone(),e.CurrentSourceTimestamp.clone(),void 0,0),t.push(i)}e.moveToNext()}this.timestamps=t}};class r{constructor(t,e,n,i){this.$from=t,this.to=e,this.curRepetition=n,this.curRepetitionIteration=i,this.nextBackJump=void 0,this.nextForwardJump=void 0}}e.TimestampTransform=r},function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.MusicPartManagerIterator=void 0;const s=n(0),r=n(160),o=n(17),a=n(32),c=i(n(1));class l{constructor(t,e,n){this.currentMeasureIndex=0,this.currentPartIndex=0,this.currentVoiceEntryIndex=-1,this.currentDynamicEntryIndex=0,this.currentTempoEntryIndex=0,this.currentDynamicChangingExpressions=[],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.currentVerticalContainerInMeasureTimestamp=new s.Fraction(0,1),this.jumpResponsibleRepetition=void 0,this.activeDynamicExpressions=[];try{this.frontReached=!0,this.manager=t,this.currentVoiceEntries=void 0,this.frontReached=!1;for(const e of t.MusicSheet.Repetitions)this.setRepetitionIterationCount(e,1);if(this.activeDynamicExpressions=new Array(t.MusicSheet.getCompleteNumberOfStaves()),this.currentMeasure=this.manager.MusicSheet.SourceMeasures[0],!e)return;do{this.moveToNext()}while((!this.currentVoiceEntries||this.currentTimeStamp.lt(e))&&!this.endReached);for(let t=0;t=this.JumpResponsibleRepetition.StartIndex&&n.EndIndex<=this.JumpResponsibleRepetition.EndIndex&&this.resetRepetitionIterationCount(n)}}handleRepetitionsAtMeasureEnd(){for(let t=0,e=this.currentMeasure.LastRepetitionInstructions.length;t-1&&this.getRepetitionIterationCount(n)=this.JumpResponsibleRepetition.StartIndex&&n.EndIndex<=this.JumpResponsibleRepetition.EndIndex&&this.resetRepetitionIterationCount(n);const t=n.getForwardJumpTargetForIteration(this.getRepetitionIterationCount(n));if(t>=0)return this.currentMeasureIndex=t,this.currentMeasure=this.manager.MusicSheet.SourceMeasures[this.currentMeasureIndex],this.currentVoiceEntryIndex=-1,this.jumpResponsibleRepetition=n,void(this.forwardJumpOccurred=!0);-2===t&&(this.endReached=!0)}}}this.currentMeasureIndex++,void 0!==this.JumpResponsibleRepetition&&this.currentMeasureIndex>this.JumpResponsibleRepetition.EndIndex&&(this.jumpResponsibleRepetition=void 0)}doBackJump(t){this.currentMeasureIndex=t.getBackwardJumpTarget(),this.currentMeasure=this.manager.MusicSheet.SourceMeasures[this.currentMeasureIndex],this.currentVoiceEntryIndex=-1,this.incrementRepetitionIterationCount(t),this.jumpResponsibleRepetition=t}activateCurrentRhythmInstructions(){if(void 0!==this.currentMeasure&&this.currentMeasure.FirstInstructionsStaffEntries.length>0&&void 0!==this.currentMeasure.FirstInstructionsStaffEntries[0]){const t=this.currentMeasure.FirstInstructionsStaffEntries[0].Instructions;for(let e=0,n=t.length;e0&&(this.currentDynamicEntryIndex>=t.length||this.CurrentSourceTimestamp.lte(t[this.currentDynamicEntryIndex].parMultiExpression().AbsoluteTimestamp));)this.currentDynamicEntryIndex--;for(;this.currentDynamicEntryIndex0&&(this.currentTempoEntryIndex>=e.length||this.CurrentSourceTimestamp.lte(e[this.currentTempoEntryIndex].AbsoluteTimestamp));)this.currentTempoEntryIndex--;for(;this.currentTempoEntryIndex=0&&this.currentVoiceEntryIndex=0&&this.currentMeasureIndex0){if(!t)return!0;for(let t=0,n=e.length;t=0&&(this.syllableIndex=s)}get Text(){return this.text}set Text(t){this.text=t}get Word(){return this.word}get Parent(){return this.parent}set Parent(t){this.parent=t}get VerseNumber(){return this.verseNumber}get SyllableIndex(){return this.syllableIndex}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TabNote=void 0;const i=n(36);class s extends i.Note{constructor(t,e,n,i,s,r,o,a,c){super(t,e,n,i,s),this.stringNumber=r,this.fretNumber=o,this.bendArray=a,this.vibratoStroke=c}get StringNumber(){return this.stringNumber}get FretNumber(){return this.fretNumber}get BendArray(){return this.bendArray}get VibratoStroke(){return this.vibratoStroke}}e.TabNote=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TempoExpressionEntry=e.MultiTempoExpression=void 0;const i=n(0),s=n(53),r=n(3),o=n(20),a=n(54);e.MultiTempoExpression=class{constructor(t,e){this.expressions=[],this.sourceMeasure=t,this.timestamp=e}get Timestamp(){return this.timestamp}get AbsoluteTimestamp(){return i.Fraction.plus(this.sourceMeasure.AbsoluteTimestamp,this.timestamp)}get SourceMeasureParent(){return this.sourceMeasure}set SourceMeasureParent(t){this.sourceMeasure=t}get InstantaneousTempo(){return this.instantaneousTempo}get ContinuousTempo(){return this.continuousTempo}get EntriesList(){return this.expressions}get CombinedExpressionsText(){return this.combinedExpressionsText}set CombinedExpressionsText(t){this.combinedExpressionsText=t}getPlacementOfFirstEntry(){let t=r.PlacementEnum.Above;return this.expressions.length>0&&(this.expressions[0].Expression instanceof s.InstantaneousTempoExpression||this.expressions[0].Expression instanceof a.ContinuousTempoExpression)&&(t=this.expressions[0].Expression.Placement),t}getFontstyleOfFirstEntry(){let t=o.FontStyles.Regular;return this.expressions[0].Expression instanceof s.InstantaneousTempoExpression?t=o.FontStyles.Bold:this.expressions[0].Expression instanceof a.ContinuousTempoExpression&&(t=o.FontStyles.Italic),t}addExpression(t,e){if(this.checkIfAlreadyExists(t))return;t instanceof s.InstantaneousTempoExpression?this.instantaneousTempo=t:t instanceof a.ContinuousTempoExpression&&(this.continuousTempo=t);const n=new c;n.prefix=e,n.Expression=t,n.label=t.Label,this.expressions.push(n)}CompareTo(t){return this.Timestamp.RealValue>t.Timestamp.RealValue?1:this.Timestamp.RealValue0&&(this.expressions[0].expression instanceof s.InstantaneousDynamicExpression||this.expressions[0].expression instanceof r.ContinuousDynamicExpression||this.expressions[0].expression instanceof o.MoodExpression||this.expressions[0].expression instanceof a.UnknownExpression)&&(t=this.expressions[0].expression.Placement),t}getFontstyleOfFirstEntry(){var t;let e=l.FontStyles.Regular;return this.expressions.length>0&&(this.expressions[0].expression instanceof r.ContinuousDynamicExpression||this.expressions[0].expression instanceof o.MoodExpression?e=l.FontStyles.Italic:this.expressions[0].expression instanceof a.UnknownExpression&&(e=null!==(t=this.expressions[0].expression.fontStyle)&&void 0!==t?t:l.FontStyles.Regular)),e}addExpression(t,e){t instanceof s.InstantaneousDynamicExpression?(this.instantaneousDynamic&&this.removeExpressionFromEntryList(this.InstantaneousDynamic),this.instantaneousDynamic=t,this.instantaneousDynamic.ParentMultiExpression=this):t instanceof r.ContinuousDynamicExpression?this.startingContinuousDynamic=t:t instanceof o.MoodExpression?this.moodList.push(t):t instanceof a.UnknownExpression&&this.unknownList.push(t),this.addExpressionToEntryList(t,e)}CompareTo(t){return this.Timestamp.RealValue>t.Timestamp.RealValue?1:this.Timestamp.RealValue>2,a=(3&e)<<4|n>>4,c=1>6:64,l=2>4,n=(15&o)<<4|(a=r.indexOf(t.charAt(l++)))>>2,i=(3&a)<<6|(c=r.indexOf(t.charAt(l++))),d[u++]=e,64!==a&&(d[u++]=n),64!==c&&(d[u++]=i);return d}},{"./support":30,"./utils":32}],2:[function(t,e,n){"use strict";var i=t("./external"),s=t("./stream/DataWorker"),r=t("./stream/DataLengthProbe"),o=t("./stream/Crc32Probe");function a(t,e,n,i,s){this.compressedSize=t,this.uncompressedSize=e,this.crc32=n,this.compression=i,this.compressedContent=s}r=t("./stream/DataLengthProbe"),a.prototype={getContentWorker:function(){var t=new s(i.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new r("data_length")),e=this;return t.on("end",(function(){if(this.streamInfo.data_length!==e.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")})),t},getCompressedWorker:function(){return new s(i.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},a.createWorkerFrom=function(t,e,n){return t.pipe(new o).pipe(new r("uncompressedSize")).pipe(e.compressWorker(n)).pipe(new r("compressedSize")).withStreamInfo("compression",e)},e.exports=a},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(t,e,n){"use strict";var i=t("./stream/GenericWorker");n.STORE={magic:"\0\0",compressWorker:function(t){return new i("STORE compression")},uncompressWorker:function(){return new i("STORE decompression")}},n.DEFLATE=t("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(t,e,n){"use strict";var i=t("./utils"),s=function(){for(var t,e=[],n=0;n<256;n++){t=n;for(var i=0;i<8;i++)t=1&t?3988292384^t>>>1:t>>>1;e[n]=t}return e}();e.exports=function(t,e){return void 0!==t&&t.length?"string"!==i.getTypeOf(t)?function(t,e,n,i){var r=s,o=0+n;t^=-1;for(var a=0;a>>8^r[255&(t^e[a])];return-1^t}(0|e,t,t.length):function(t,e,n,i){var r=s,o=0+n;t^=-1;for(var a=0;a>>8^r[255&(t^e.charCodeAt(a))];return-1^t}(0|e,t,t.length):0}},{"./utils":32}],5:[function(t,e,n){"use strict";n.base64=!1,n.binary=!1,n.dir=!1,n.createFolders=!0,n.date=null,n.compression=null,n.compressionOptions=null,n.comment=null,n.unixPermissions=null,n.dosPermissions=null},{}],6:[function(t,e,n){"use strict";var i;i="undefined"!=typeof Promise?Promise:t("lie"),e.exports={Promise:i}},{lie:37}],7:[function(t,e,n){"use strict";var i="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,s=t("pako"),r=t("./utils"),o=t("./stream/GenericWorker"),a=i?"uint8array":"array";function c(t,e){o.call(this,"FlateWorker/"+t),this._pako=null,this._pakoAction=t,this._pakoOptions=e,this.meta={}}n.magic="\b\0",r.inherits(c,o),c.prototype.processChunk=function(t){this.meta=t.meta,null===this._pako&&this._createPako(),this._pako.push(r.transformTo(a,t.data),!1)},c.prototype.flush=function(){o.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},c.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this._pako=null},c.prototype._createPako=function(){this._pako=new s[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var t=this;this._pako.onData=function(e){t.push({data:e,meta:t.meta})}},n.compressWorker=function(t){return new c("Deflate",t)},n.uncompressWorker=function(){return new c("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(t,e,n){"use strict";function i(t,e){var n,i="";for(n=0;n>>=8;return i}function s(t,e,n,s,o,u){var h,d,f=t.file,p=t.compression,m=u!==a.utf8encode,g=r.transformTo("string",u(f.name)),b=r.transformTo("string",a.utf8encode(f.name)),v=f.comment,y=r.transformTo("string",u(v)),S=r.transformTo("string",a.utf8encode(v)),x=b.length!==f.name.length,_=S.length!==v.length,w="",E="",T="",C=f.dir,M=f.date,P={crc32:0,compressedSize:0,uncompressedSize:0};e&&!n||(P.crc32=t.crc32,P.compressedSize=t.compressedSize,P.uncompressedSize=t.uncompressedSize);var A=0;e&&(A|=8),m||!x&&!_||(A|=2048);var I=0,L=0;C&&(I|=16),"UNIX"===o?(L=798,I|=function(t,e){var n=t;return t||(n=e?16893:33204),(65535&n)<<16}(f.unixPermissions,C)):(L=20,I|=function(t){return 63&(t||0)}(f.dosPermissions)),h=M.getUTCHours(),h<<=6,h|=M.getUTCMinutes(),h<<=5,h|=M.getUTCSeconds()/2,d=M.getUTCFullYear()-1980,d<<=4,d|=M.getUTCMonth()+1,d<<=5,d|=M.getUTCDate(),x&&(E=i(1,1)+i(c(g),4)+b,w+="up"+i(E.length,2)+E),_&&(T=i(1,1)+i(c(y),4)+S,w+="uc"+i(T.length,2)+T);var O="";return O+="\n\0",O+=i(A,2),O+=p.magic,O+=i(h,2),O+=i(d,2),O+=i(P.crc32,4),O+=i(P.compressedSize,4),O+=i(P.uncompressedSize,4),O+=i(g.length,2),O+=i(w.length,2),{fileRecord:l.LOCAL_FILE_HEADER+O+g+w,dirRecord:l.CENTRAL_FILE_HEADER+i(L,2)+O+i(y.length,2)+"\0\0\0\0"+i(I,4)+i(s,4)+g+w+y}}var r=t("../utils"),o=t("../stream/GenericWorker"),a=t("../utf8"),c=t("../crc32"),l=t("../signature");function u(t,e,n,i){o.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=e,this.zipPlatform=n,this.encodeFileName=i,this.streamFiles=t,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}r.inherits(u,o),u.prototype.push=function(t){var e=t.meta.percent||0,n=this.entriesCount,i=this._sources.length;this.accumulate?this.contentBuffer.push(t):(this.bytesWritten+=t.data.length,o.prototype.push.call(this,{data:t.data,meta:{currentFile:this.currentFile,percent:n?(e+100*(n-i-1))/n:100}}))},u.prototype.openedSource=function(t){this.currentSourceOffset=this.bytesWritten,this.currentFile=t.file.name;var e=this.streamFiles&&!t.file.dir;if(e){var n=s(t,e,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:n.fileRecord,meta:{percent:0}})}else this.accumulate=!0},u.prototype.closedSource=function(t){this.accumulate=!1;var e=this.streamFiles&&!t.file.dir,n=s(t,e,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(n.dirRecord),e)this.push({data:function(t){return l.DATA_DESCRIPTOR+i(t.crc32,4)+i(t.compressedSize,4)+i(t.uncompressedSize,4)}(t),meta:{percent:100}});else for(this.push({data:n.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},u.prototype.flush=function(){for(var t=this.bytesWritten,e=0;e=this.index;e--)n=(n<<8)+this.byteAt(e);return this.index+=t,n},readString:function(t){return i.transformTo("string",this.readData(t))},readData:function(t){},lastIndexOfSignature:function(t){},readAndCheckSignature:function(t){},readDate:function(){var t=this.readInt(4);return new Date(Date.UTC(1980+(t>>25&127),(t>>21&15)-1,t>>16&31,t>>11&31,t>>5&63,(31&t)<<1))}},e.exports=s},{"../utils":32}],19:[function(t,e,n){"use strict";var i=t("./Uint8ArrayReader");function s(t){i.call(this,t)}t("../utils").inherits(s,i),s.prototype.readData=function(t){this.checkOffset(t);var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=s},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(t,e,n){"use strict";var i=t("./DataReader");function s(t){i.call(this,t)}t("../utils").inherits(s,i),s.prototype.byteAt=function(t){return this.data.charCodeAt(this.zero+t)},s.prototype.lastIndexOfSignature=function(t){return this.data.lastIndexOf(t)-this.zero},s.prototype.readAndCheckSignature=function(t){return t===this.readData(4)},s.prototype.readData=function(t){this.checkOffset(t);var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=s},{"../utils":32,"./DataReader":18}],21:[function(t,e,n){"use strict";var i=t("./ArrayReader");function s(t){i.call(this,t)}t("../utils").inherits(s,i),s.prototype.readData=function(t){if(this.checkOffset(t),0===t)return new Uint8Array(0);var e=this.data.subarray(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=s},{"../utils":32,"./ArrayReader":17}],22:[function(t,e,n){"use strict";var i=t("../utils"),s=t("../support"),r=t("./ArrayReader"),o=t("./StringReader"),a=t("./NodeBufferReader"),c=t("./Uint8ArrayReader");e.exports=function(t){var e=i.getTypeOf(t);return i.checkSupport(e),"string"!==e||s.uint8array?"nodebuffer"===e?new a(t):s.uint8array?new c(i.transformTo("uint8array",t)):new r(i.transformTo("array",t)):new o(t)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(t,e,n){"use strict";n.LOCAL_FILE_HEADER="PK",n.CENTRAL_FILE_HEADER="PK",n.CENTRAL_DIRECTORY_END="PK",n.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK",n.ZIP64_CENTRAL_DIRECTORY_END="PK",n.DATA_DESCRIPTOR="PK\b"},{}],24:[function(t,e,n){"use strict";var i=t("./GenericWorker"),s=t("../utils");function r(t){i.call(this,"ConvertWorker to "+t),this.destType=t}s.inherits(r,i),r.prototype.processChunk=function(t){this.push({data:s.transformTo(this.destType,t.data),meta:t.meta})},e.exports=r},{"../utils":32,"./GenericWorker":28}],25:[function(t,e,n){"use strict";var i=t("./GenericWorker"),s=t("../crc32");function r(){i.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}t("../utils").inherits(r,i),r.prototype.processChunk=function(t){this.streamInfo.crc32=s(t.data,this.streamInfo.crc32||0),this.push(t)},e.exports=r},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(t,e,n){"use strict";var i=t("../utils"),s=t("./GenericWorker");function r(t){s.call(this,"DataLengthProbe for "+t),this.propName=t,this.withStreamInfo(t,0)}i.inherits(r,s),r.prototype.processChunk=function(t){if(t){var e=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=e+t.data.length}s.prototype.processChunk.call(this,t)},e.exports=r},{"../utils":32,"./GenericWorker":28}],27:[function(t,e,n){"use strict";var i=t("../utils"),s=t("./GenericWorker");function r(t){s.call(this,"DataWorker");var e=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,t.then((function(t){e.dataIsReady=!0,e.data=t,e.max=t&&t.length||0,e.type=i.getTypeOf(t),e.isPaused||e._tickAndRepeat()}),(function(t){e.error(t)}))}i.inherits(r,s),r.prototype.cleanUp=function(){s.prototype.cleanUp.call(this),this.data=null},r.prototype.resume=function(){return!!s.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,i.delay(this._tickAndRepeat,[],this)),!0)},r.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(i.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},r.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var t=null,e=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":t=this.data.substring(this.index,e);break;case"uint8array":t=this.data.subarray(this.index,e);break;case"array":case"nodebuffer":t=this.data.slice(this.index,e)}return this.index=e,this.push({data:t,meta:{percent:this.max?this.index/this.max*100:0}})},e.exports=r},{"../utils":32,"./GenericWorker":28}],28:[function(t,e,n){"use strict";function i(t){this.name=t||"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}i.prototype={push:function(t){this.emit("data",t)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(t){this.emit("error",t)}return!0},error:function(t){return!this.isFinished&&(this.isPaused?this.generatedError=t:(this.isFinished=!0,this.emit("error",t),this.previous&&this.previous.error(t),this.cleanUp()),!0)},on:function(t,e){return this._listeners[t].push(e),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(t,e){if(this._listeners[t])for(var n=0;n "+t:t}},e.exports=i},{}],29:[function(t,n,i){"use strict";var s=t("../utils"),r=t("./ConvertWorker"),o=t("./GenericWorker"),a=t("../base64"),c=t("../support"),l=t("../external"),u=null;if(c.nodestream)try{u=t("../nodejs/NodejsStreamOutputAdapter")}catch(t){}function h(t,e,n){var i=e;switch(e){case"blob":case"arraybuffer":i="uint8array";break;case"base64":i="string"}try{this._internalType=i,this._outputType=e,this._mimeType=n,s.checkSupport(i),this._worker=t.pipe(new r(i)),t.lock()}catch(t){this._worker=new o("error"),this._worker.error(t)}}h.prototype={accumulate:function(t){return function(t,n){return new l.Promise((function(i,r){var o=[],c=t._internalType,l=t._outputType,u=t._mimeType;t.on("data",(function(t,e){o.push(t),n&&n(e)})).on("error",(function(t){o=[],r(t)})).on("end",(function(){try{var t=function(t,e,n){switch(t){case"blob":return s.newBlob(s.transformTo("arraybuffer",e),n);case"base64":return a.encode(e);default:return s.transformTo(t,e)}}(l,function(t,n){var i,s=0,r=null,o=0;for(i=0;i>>6:(n<65536?e[o++]=224|n>>>12:(e[o++]=240|n>>>18,e[o++]=128|n>>>12&63),e[o++]=128|n>>>6&63),e[o++]=128|63&n);return e}(t)},n.utf8decode=function(t){return s.nodebuffer?i.transformTo("nodebuffer",t).toString("utf-8"):function(t){var e,n,s,r,o=t.length,c=new Array(2*o);for(e=n=0;e>10&1023,c[n++]=56320|1023&s)}return c.length!==n&&(c.subarray?c=c.subarray(0,n):c.length=n),i.applyFromCharCode(c)}(t=i.transformTo(s.uint8array?"uint8array":"array",t))},i.inherits(l,o),l.prototype.processChunk=function(t){var e=i.transformTo(s.uint8array?"uint8array":"array",t.data);if(this.leftOver&&this.leftOver.length){if(s.uint8array){var r=e;(e=new Uint8Array(r.length+this.leftOver.length)).set(this.leftOver,0),e.set(r,this.leftOver.length)}else e=this.leftOver.concat(e);this.leftOver=null}var o=function(t,e){var n;for((e=e||t.length)>t.length&&(e=t.length),n=e-1;0<=n&&128==(192&t[n]);)n--;return n<0||0===n?e:n+a[t[n]]>e?n:e}(e),c=e;o!==e.length&&(s.uint8array?(c=e.subarray(0,o),this.leftOver=e.subarray(o,e.length)):(c=e.slice(0,o),this.leftOver=e.slice(o,e.length))),this.push({data:n.utf8decode(c),meta:t.meta})},l.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:n.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},n.Utf8DecodeWorker=l,i.inherits(u,o),u.prototype.processChunk=function(t){this.push({data:n.utf8encode(t.data),meta:t.meta})},n.Utf8EncodeWorker=u},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(t,e,n){"use strict";var i=t("./support"),s=t("./base64"),r=t("./nodejsUtils"),o=t("set-immediate-shim"),a=t("./external");function c(t){return t}function l(t,e){for(var n=0;n>8;this.dir=!!(16&this.externalFileAttributes),0==t&&(this.dosPermissions=63&this.externalFileAttributes),3==t&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(t){if(this.extraFields[1]){var e=i(this.extraFields[1].value);this.uncompressedSize===s.MAX_VALUE_32BITS&&(this.uncompressedSize=e.readInt(8)),this.compressedSize===s.MAX_VALUE_32BITS&&(this.compressedSize=e.readInt(8)),this.localHeaderOffset===s.MAX_VALUE_32BITS&&(this.localHeaderOffset=e.readInt(8)),this.diskNumberStart===s.MAX_VALUE_32BITS&&(this.diskNumberStart=e.readInt(4))}},readExtraFields:function(t){var e,n,i,s=t.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});t.index>>6:(n<65536?e[o++]=224|n>>>12:(e[o++]=240|n>>>18,e[o++]=128|n>>>12&63),e[o++]=128|n>>>6&63),e[o++]=128|63&n);return e},n.buf2binstring=function(t){return c(t,t.length)},n.binstring2buf=function(t){for(var e=new i.Buf8(t.length),n=0,s=e.length;n>10&1023,l[i++]=56320|1023&s)}return c(l,i)},n.utf8border=function(t,e){var n;for((e=e||t.length)>t.length&&(e=t.length),n=e-1;0<=n&&128==(192&t[n]);)n--;return n<0||0===n?e:n+o[t[n]]>e?n:e}},{"./common":41}],43:[function(t,e,n){"use strict";e.exports=function(t,e,n,i){for(var s=65535&t|0,r=t>>>16&65535|0,o=0;0!==n;){for(n-=o=2e3>>1:t>>>1;e[n]=t}return e}();e.exports=function(t,e,n,s){var r=i,o=s+n;t^=-1;for(var a=s;a>>8^r[255&(t^e[a])];return-1^t}},{}],46:[function(t,e,n){"use strict";var i,s=t("../utils/common"),r=t("./trees"),o=t("./adler32"),a=t("./crc32"),c=t("./messages"),l=-2,u=258,h=262,d=113;function f(t,e){return t.msg=c[e],e}function p(t){return(t<<1)-(4t.avail_out&&(n=t.avail_out),0!==n&&(s.arraySet(t.output,e.pending_buf,e.pending_out,n,t.next_out),t.next_out+=n,e.pending_out+=n,t.total_out+=n,t.avail_out-=n,e.pending-=n,0===e.pending&&(e.pending_out=0))}function b(t,e){r._tr_flush_block(t,0<=t.block_start?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,g(t.strm)}function v(t,e){t.pending_buf[t.pending++]=e}function y(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function S(t,e){var n,i,s=t.max_chain_length,r=t.strstart,o=t.prev_length,a=t.nice_match,c=t.strstart>t.w_size-h?t.strstart-(t.w_size-h):0,l=t.window,d=t.w_mask,f=t.prev,p=t.strstart+u,m=l[r+o-1],g=l[r+o];t.prev_length>=t.good_match&&(s>>=2),a>t.lookahead&&(a=t.lookahead);do{if(l[(n=e)+o]===g&&l[n+o-1]===m&&l[n]===l[r]&&l[++n]===l[r+1]){r+=2,n++;do{}while(l[++r]===l[++n]&&l[++r]===l[++n]&&l[++r]===l[++n]&&l[++r]===l[++n]&&l[++r]===l[++n]&&l[++r]===l[++n]&&l[++r]===l[++n]&&l[++r]===l[++n]&&rc&&0!=--s);return o<=t.lookahead?o:t.lookahead}function x(t){var e,n,i,r,c,l,u,d,f,p,m=t.w_size;do{if(r=t.window_size-t.lookahead-t.strstart,t.strstart>=m+(m-h)){for(s.arraySet(t.window,t.window,m,m,0),t.match_start-=m,t.strstart-=m,t.block_start-=m,e=n=t.hash_size;i=t.head[--e],t.head[e]=m<=i?i-m:0,--n;);for(e=n=m;i=t.prev[--e],t.prev[e]=m<=i?i-m:0,--n;);r+=m}if(0===t.strm.avail_in)break;if(l=t.strm,u=t.window,d=t.strstart+t.lookahead,p=void 0,(f=r)<(p=l.avail_in)&&(p=f),n=0===p?0:(l.avail_in-=p,s.arraySet(u,l.input,l.next_in,p,d),1===l.state.wrap?l.adler=o(l.adler,u,p,d):2===l.state.wrap&&(l.adler=a(l.adler,u,p,d)),l.next_in+=p,l.total_in+=p,p),t.lookahead+=n,t.lookahead+t.insert>=3)for(c=t.strstart-t.insert,t.ins_h=t.window[c],t.ins_h=(t.ins_h<=3&&(t.ins_h=(t.ins_h<=3)if(i=r._tr_tally(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){for(t.match_length--;t.strstart++,t.ins_h=(t.ins_h<=3&&(t.ins_h=(t.ins_h<=3&&t.match_length<=t.prev_length){for(s=t.strstart+t.lookahead-3,i=r._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;++t.strstart<=s&&(t.ins_h=(t.ins_h<t.pending_buf_size-5&&(n=t.pending_buf_size-5);;){if(t.lookahead<=1){if(x(t),0===t.lookahead&&0===e)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var i=t.block_start+n;if((0===t.strstart||t.strstart>=i)&&(t.lookahead=t.strstart-i,t.strstart=i,b(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-h&&(b(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(b(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(b(t,!1),t.strm.avail_out),1)})),new E(4,4,8,4,_),new E(4,5,16,8,_),new E(4,6,32,32,_),new E(4,4,16,16,w),new E(8,16,32,32,w),new E(8,16,128,128,w),new E(8,32,128,256,w),new E(32,128,258,1024,w),new E(32,258,258,4096,w)],n.deflateInit=function(t,e){return P(t,e,8,15,8,0)},n.deflateInit2=P,n.deflateReset=M,n.deflateResetKeep=C,n.deflateSetHeader=function(t,e){return t&&t.state?2!==t.state.wrap?l:(t.state.gzhead=e,0):l},n.deflate=function(t,e){var n,s,o,c;if(!t||!t.state||5>8&255),v(s,s.gzhead.time>>16&255),v(s,s.gzhead.time>>24&255),v(s,9===s.level?2:2<=s.strategy||s.level<2?4:0),v(s,255&s.gzhead.os),s.gzhead.extra&&s.gzhead.extra.length&&(v(s,255&s.gzhead.extra.length),v(s,s.gzhead.extra.length>>8&255)),s.gzhead.hcrc&&(t.adler=a(t.adler,s.pending_buf,s.pending,0)),s.gzindex=0,s.status=69):(v(s,0),v(s,0),v(s,0),v(s,0),v(s,0),v(s,9===s.level?2:2<=s.strategy||s.level<2?4:0),v(s,3),s.status=d);else{var h=8+(s.w_bits-8<<4)<<8;h|=(2<=s.strategy||s.level<2?0:s.level<6?1:6===s.level?2:3)<<6,0!==s.strstart&&(h|=32),h+=31-h%31,s.status=d,y(s,h),0!==s.strstart&&(y(s,t.adler>>>16),y(s,65535&t.adler)),t.adler=1}if(69===s.status)if(s.gzhead.extra){for(o=s.pending;s.gzindex<(65535&s.gzhead.extra.length)&&(s.pending!==s.pending_buf_size||(s.gzhead.hcrc&&s.pending>o&&(t.adler=a(t.adler,s.pending_buf,s.pending-o,o)),g(t),o=s.pending,s.pending!==s.pending_buf_size));)v(s,255&s.gzhead.extra[s.gzindex]),s.gzindex++;s.gzhead.hcrc&&s.pending>o&&(t.adler=a(t.adler,s.pending_buf,s.pending-o,o)),s.gzindex===s.gzhead.extra.length&&(s.gzindex=0,s.status=73)}else s.status=73;if(73===s.status)if(s.gzhead.name){o=s.pending;do{if(s.pending===s.pending_buf_size&&(s.gzhead.hcrc&&s.pending>o&&(t.adler=a(t.adler,s.pending_buf,s.pending-o,o)),g(t),o=s.pending,s.pending===s.pending_buf_size)){c=1;break}c=s.gzindexo&&(t.adler=a(t.adler,s.pending_buf,s.pending-o,o)),0===c&&(s.gzindex=0,s.status=91)}else s.status=91;if(91===s.status)if(s.gzhead.comment){o=s.pending;do{if(s.pending===s.pending_buf_size&&(s.gzhead.hcrc&&s.pending>o&&(t.adler=a(t.adler,s.pending_buf,s.pending-o,o)),g(t),o=s.pending,s.pending===s.pending_buf_size)){c=1;break}c=s.gzindexo&&(t.adler=a(t.adler,s.pending_buf,s.pending-o,o)),0===c&&(s.status=103)}else s.status=103;if(103===s.status&&(s.gzhead.hcrc?(s.pending+2>s.pending_buf_size&&g(t),s.pending+2<=s.pending_buf_size&&(v(s,255&t.adler),v(s,t.adler>>8&255),t.adler=0,s.status=d)):s.status=d),0!==s.pending){if(g(t),0===t.avail_out)return s.last_flush=-1,0}else if(0===t.avail_in&&p(e)<=p(n)&&4!==e)return f(t,-5);if(666===s.status&&0!==t.avail_in)return f(t,-5);if(0!==t.avail_in||0!==s.lookahead||0!==e&&666!==s.status){var S=2===s.strategy?function(t,e){for(var n;;){if(0===t.lookahead&&(x(t),0===t.lookahead)){if(0===e)return 1;break}if(t.match_length=0,n=r._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,n&&(b(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(b(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(b(t,!1),0===t.strm.avail_out)?1:2}(s,e):3===s.strategy?function(t,e){for(var n,i,s,o,a=t.window;;){if(t.lookahead<=u){if(x(t),t.lookahead<=u&&0===e)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&0t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(n=r._tr_tally(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(n=r._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),n&&(b(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(b(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(b(t,!1),0===t.strm.avail_out)?1:2}(s,e):i[s.level].func(s,e);if(3!==S&&4!==S||(s.status=666),1===S||3===S)return 0===t.avail_out&&(s.last_flush=-1),0;if(2===S&&(1===e?r._tr_align(s):5!==e&&(r._tr_stored_block(s,0,0,!1),3===e&&(m(s.head),0===s.lookahead&&(s.strstart=0,s.block_start=0,s.insert=0))),g(t),0===t.avail_out))return s.last_flush=-1,0}return 4!==e?0:s.wrap<=0?1:(2===s.wrap?(v(s,255&t.adler),v(s,t.adler>>8&255),v(s,t.adler>>16&255),v(s,t.adler>>24&255),v(s,255&t.total_in),v(s,t.total_in>>8&255),v(s,t.total_in>>16&255),v(s,t.total_in>>24&255)):(y(s,t.adler>>>16),y(s,65535&t.adler)),g(t),0=n.w_size&&(0===a&&(m(n.head),n.strstart=0,n.block_start=0,n.insert=0),d=new s.Buf8(n.w_size),s.arraySet(d,e,f-n.w_size,n.w_size,0),e=d,f=n.w_size),c=t.avail_in,u=t.next_in,h=t.input,t.avail_in=f,t.next_in=0,t.input=e,x(n);n.lookahead>=3;){for(i=n.strstart,r=n.lookahead-2;n.ins_h=(n.ins_h<>>=S=y>>>24,p-=S,0==(S=y>>>16&255))C[r++]=65535&y;else{if(!(16&S)){if(0==(64&S)){y=m[(65535&y)+(f&(1<>>=S,p-=S),p<15&&(f+=T[i++]<>>=S=y>>>24,p-=S,!(16&(S=y>>>16&255))){if(0==(64&S)){y=g[(65535&y)+(f&(1<>>=S,p-=S,(S=r-o)<_){if(u<(S=_-S)&&n.sane){t.msg="invalid distance too far back",n.mode=30;break t}if(E=d,(w=0)===h){if(w+=l-S,S>3,f&=(1<<(p-=x<<3))-1,t.next_in=i,t.next_out=r,t.avail_in=i>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function u(){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 i.Buf16(320),this.work=new i.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function h(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=1,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new i.Buf32(852),e.distcode=e.distdyn=new i.Buf32(592),e.sane=1,e.back=-1,0):c}function d(t){var e;return t&&t.state?((e=t.state).wsize=0,e.whave=0,e.wnext=0,h(t)):c}function f(t,e){var n,i;return t&&t.state?(i=t.state,e<0?(n=0,e=-e):(n=1+(e>>4),e<48&&(e&=15)),e&&(e<8||15=o.wsize?(i.arraySet(o.window,e,n-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):(s<(r=o.wsize-o.wnext)&&(r=s),i.arraySet(o.window,e,n-s,r,o.wnext),(s-=r)?(i.arraySet(o.window,e,n-s,s,0),o.wnext=s,o.whave=o.wsize):(o.wnext+=r,o.wnext===o.wsize&&(o.wnext=0),o.whave>>8&255,n.check=r(n.check,D,2,0),b=g=0,n.mode=2;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&g)<<8)+(g>>8))%31){t.msg="incorrect header check",n.mode=30;break}if(8!=(15&g)){t.msg="unknown compression method",n.mode=30;break}if(b-=4,L=8+(15&(g>>>=4)),0===n.wbits)n.wbits=L;else if(L>n.wbits){t.msg="invalid window size",n.mode=30;break}n.dmax=1<>8&1),512&n.flags&&(D[0]=255&g,D[1]=g>>>8&255,n.check=r(n.check,D,2,0)),b=g=0,n.mode=3;case 3:for(;b<32;){if(0===p)break t;p--,g+=u[d++]<>>8&255,D[2]=g>>>16&255,D[3]=g>>>24&255,n.check=r(n.check,D,4,0)),b=g=0,n.mode=4;case 4:for(;b<16;){if(0===p)break t;p--,g+=u[d++]<>8),512&n.flags&&(D[0]=255&g,D[1]=g>>>8&255,n.check=r(n.check,D,2,0)),b=g=0,n.mode=5;case 5:if(1024&n.flags){for(;b<16;){if(0===p)break t;p--,g+=u[d++]<>>8&255,n.check=r(n.check,D,2,0)),b=g=0}else n.head&&(n.head.extra=null);n.mode=6;case 6:if(1024&n.flags&&(p<(_=n.length)&&(_=p),_&&(n.head&&(L=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),i.arraySet(n.head.extra,u,d,_,L)),512&n.flags&&(n.check=r(n.check,u,_,d)),p-=_,d+=_,n.length-=_),n.length))break t;n.length=0,n.mode=7;case 7:if(2048&n.flags){if(0===p)break t;for(_=0;L=u[d+_++],n.head&&L&&n.length<65536&&(n.head.name+=String.fromCharCode(L)),L&&_>9&1,n.head.done=!0),t.adler=n.check=0,n.mode=12;break;case 10:for(;b<32;){if(0===p)break t;p--,g+=u[d++]<>>=7&b,b-=7&b,n.mode=27;break}for(;b<3;){if(0===p)break t;p--,g+=u[d++]<>>=1)){case 0:n.mode=14;break;case 1:if(v(n),n.mode=20,6!==e)break;g>>>=2,b-=2;break t;case 2:n.mode=17;break;case 3:t.msg="invalid block type",n.mode=30}g>>>=2,b-=2;break;case 14:for(g>>>=7&b,b-=7&b;b<32;){if(0===p)break t;p--,g+=u[d++]<>>16^65535)){t.msg="invalid stored block lengths",n.mode=30;break}if(n.length=65535&g,b=g=0,n.mode=15,6===e)break t;case 15:n.mode=16;case 16:if(_=n.length){if(p<_&&(_=p),m<_&&(_=m),0===_)break t;i.arraySet(h,u,d,_,f),p-=_,d+=_,m-=_,f+=_,n.length-=_;break}n.mode=12;break;case 17:for(;b<14;){if(0===p)break t;p--,g+=u[d++]<>>=5,b-=5,n.ndist=1+(31&g),g>>>=5,b-=5,n.ncode=4+(15&g),g>>>=4,b-=4,286>>=3,b-=3}for(;n.have<19;)n.lens[V[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,k={bits:n.lenbits},O=a(0,n.lens,0,19,n.lencode,0,n.work,k),n.lenbits=k.bits,O){t.msg="invalid code lengths set",n.mode=30;break}n.have=0,n.mode=19;case 19:for(;n.have>>16&255,M=65535&N,!((T=N>>>24)<=b);){if(0===p)break t;p--,g+=u[d++]<>>=T,b-=T,n.lens[n.have++]=M;else{if(16===M){for(R=T+2;b>>=T,b-=T,0===n.have){t.msg="invalid bit length repeat",n.mode=30;break}L=n.lens[n.have-1],_=3+(3&g),g>>>=2,b-=2}else if(17===M){for(R=T+3;b>>=T)),g>>>=3,b-=3}else{for(R=T+7;b>>=T)),g>>>=7,b-=7}if(n.have+_>n.nlen+n.ndist){t.msg="invalid bit length repeat",n.mode=30;break}for(;_--;)n.lens[n.have++]=L}}if(30===n.mode)break;if(0===n.lens[256]){t.msg="invalid code -- missing end-of-block",n.mode=30;break}if(n.lenbits=9,k={bits:n.lenbits},O=a(1,n.lens,0,n.nlen,n.lencode,0,n.work,k),n.lenbits=k.bits,O){t.msg="invalid literal/lengths set",n.mode=30;break}if(n.distbits=6,n.distcode=n.distdyn,k={bits:n.distbits},O=a(2,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,k),n.distbits=k.bits,O){t.msg="invalid distances set",n.mode=30;break}if(n.mode=20,6===e)break t;case 20:n.mode=21;case 21:if(6<=p&&258<=m){t.next_out=f,t.avail_out=m,t.next_in=d,t.avail_in=p,n.hold=g,n.bits=b,o(t,x),f=t.next_out,h=t.output,m=t.avail_out,d=t.next_in,u=t.input,p=t.avail_in,g=n.hold,b=n.bits,12===n.mode&&(n.back=-1);break}for(n.back=0;C=(N=n.lencode[g&(1<>>16&255,M=65535&N,!((T=N>>>24)<=b);){if(0===p)break t;p--,g+=u[d++]<>P)])>>>16&255,M=65535&N,!(P+(T=N>>>24)<=b);){if(0===p)break t;p--,g+=u[d++]<>>=P,b-=P,n.back+=P}if(g>>>=T,b-=T,n.back+=T,n.length=M,0===C){n.mode=26;break}if(32&C){n.back=-1,n.mode=12;break}if(64&C){t.msg="invalid literal/length code",n.mode=30;break}n.extra=15&C,n.mode=22;case 22:if(n.extra){for(R=n.extra;b>>=n.extra,b-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=23;case 23:for(;C=(N=n.distcode[g&(1<>>16&255,M=65535&N,!((T=N>>>24)<=b);){if(0===p)break t;p--,g+=u[d++]<>P)])>>>16&255,M=65535&N,!(P+(T=N>>>24)<=b);){if(0===p)break t;p--,g+=u[d++]<>>=P,b-=P,n.back+=P}if(g>>>=T,b-=T,n.back+=T,64&C){t.msg="invalid distance code",n.mode=30;break}n.offset=M,n.extra=15&C,n.mode=24;case 24:if(n.extra){for(R=n.extra;b>>=n.extra,b-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){t.msg="invalid distance too far back",n.mode=30;break}n.mode=25;case 25:if(0===m)break t;if(_=x-m,n.offset>_){if((_=n.offset-_)>n.whave&&n.sane){t.msg="invalid distance too far back",n.mode=30;break}w=_>n.wnext?(_-=n.wnext,n.wsize-_):n.wnext-_,_>n.length&&(_=n.length),E=n.window}else E=h,w=f-n.offset,_=n.length;for(m<_&&(_=m),m-=_,n.length-=_;h[f++]=E[w++],--_;);0===n.length&&(n.mode=21);break;case 26:if(0===m)break t;h[f++]=n.length,m--,n.mode=21;break;case 27:if(n.wrap){for(;b<32;){if(0===p)break t;p--,g|=u[d++]<v?(S=V[B+h[E]],k[R+h[E]]):(S=96,0),f=1<>A)+(p-=f)]=y<<24|S<<16|x|0,0!==p;);for(f=1<>=1;if(0!==f?(O&=f-1,O+=f):O=0,E++,0==--N[w]){if(w===C)break;w=e[n+h[E]]}if(M>>7)]}function T(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function C(t,e,n){t.bi_valid>16-n?(t.bi_buf|=e<>16-t.bi_valid,t.bi_valid+=n-16):(t.bi_buf|=e<>>=1,n<<=1,0<--e;);return n>>>1}function A(t,e,n){var i,s,r=new Array(16),o=0;for(i=1;i<=c;i++)r[i]=o=o+n[i-1]<<1;for(s=0;s<=e;s++){var a=t[2*s+1];0!==a&&(t[2*s]=P(r[a]++,a))}}function I(t){var e;for(e=0;e>1;1<=n;n--)k(t,r,n);for(s=l;n=t.heap[1],t.heap[1]=t.heap[t.heap_len--],k(t,r,1),i=t.heap[1],t.heap[--t.heap_max]=n,t.heap[--t.heap_max]=i,r[2*s]=r[2*n]+r[2*i],t.depth[s]=(t.depth[n]>=t.depth[i]?t.depth[n]:t.depth[i])+1,r[2*n+1]=r[2*i+1]=s,t.heap[1]=s++,k(t,r,1),2<=t.heap_len;);t.heap[--t.heap_max]=t.heap[1],function(t,e){var n,i,s,r,o,a,l=e.dyn_tree,u=e.max_code,h=e.stat_desc.static_tree,d=e.stat_desc.has_stree,f=e.stat_desc.extra_bits,p=e.stat_desc.extra_base,m=e.stat_desc.max_length,g=0;for(r=0;r<=c;r++)t.bl_count[r]=0;for(l[2*t.heap[t.heap_max]+1]=0,n=t.heap_max+1;n<573;n++)m<(r=l[2*l[2*(i=t.heap[n])+1]+1]+1)&&(r=m,g++),l[2*i+1]=r,u>=7;i>>=1)if(1&n&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e>>3,(o=t.static_len+3+7>>>3)<=s&&(s=o)):s=o=n+5,n+4<=s&&-1!==e?F(t,e,n,i):4===t.strategy||o===s?(C(t,2+(i?1:0),3),R(t,f,p)):(C(t,4+(i?1:0),3),function(t,e,n,i){var s;for(C(t,e-257,5),C(t,n-1,5),C(t,i-4,4),s=0;s>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&n,t.last_lit++,0===e?t.dyn_ltree[2*n]++:(t.matches++,e--,t.dyn_ltree[2*(g[n]+r+1)]++,t.dyn_dtree[2*E(e)]++),t.last_lit===t.lit_bufsize-1},n._tr_align=function(t){C(t,2,3),M(t,256,f),function(t){16===t.bi_valid?(T(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):8<=t.bi_valid&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}},{"../utils/common":41}],53:[function(t,e,n){"use strict";e.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(t,e,n){"use strict";e.exports="function"==typeof i?i:function(){var t=[].slice.apply(arguments);t.splice(1,0,0),setTimeout.apply(null,t)}},{}]},{},[10])(10)}).call(this,n(170).Buffer,n(41),n(174).setImmediate)},function(t,e,n){"use strict";(function(t){ /*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT */ var i=n(171),s=n(172),r=n(173);function o(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(t,e){if(o()=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|t}function p(t,e){if(c.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return j(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return G(t).length;default:if(i)return j(t).length;e=(""+e).toLowerCase(),i=!0}}function m(t,e,n){var i=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return A(this,e,n);case"utf8":case"utf-8":return C(this,e,n);case"ascii":return M(this,e,n);case"latin1":case"binary":return P(this,e,n);case"base64":return T(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,e,n);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}function g(t,e,n){var i=t[e];t[e]=t[n],t[n]=i}function b(t,e,n,i,s){if(0===t.length)return-1;if("string"==typeof n?(i=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=s?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(s)return-1;n=t.length-1}else if(n<0){if(!s)return-1;n=0}if("string"==typeof e&&(e=c.from(e,i)),c.isBuffer(e))return 0===e.length?-1:v(t,e,n,i,s);if("number"==typeof e)return e&=255,c.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?s?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):v(t,[e],n,i,s);throw new TypeError("val must be string, number or Buffer")}function v(t,e,n,i,s){var r,o=1,a=t.length,c=e.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(t.length<2||e.length<2)return-1;o=2,a/=2,c/=2,n/=2}function l(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(s){var u=-1;for(r=n;ra&&(n=a-c),r=n;r>=0;r--){for(var h=!0,d=0;ds&&(i=s):i=s;var r=e.length;if(r%2!=0)throw new TypeError("Invalid hex string");i>r/2&&(i=r/2);for(var o=0;o>8,s=n%256,r.push(s),r.push(i);return r}(e,t.length-n),t,n,i)}function T(t,e,n){return 0===e&&n===t.length?i.fromByteArray(t):i.fromByteArray(t.slice(e,n))}function C(t,e,n){n=Math.min(t.length,n);for(var i=[],s=e;s239?4:l>223?3:l>191?2:1;if(s+h<=n)switch(h){case 1:l<128&&(u=l);break;case 2:128==(192&(r=t[s+1]))&&(c=(31&l)<<6|63&r)>127&&(u=c);break;case 3:r=t[s+1],o=t[s+2],128==(192&r)&&128==(192&o)&&(c=(15&l)<<12|(63&r)<<6|63&o)>2047&&(c<55296||c>57343)&&(u=c);break;case 4:r=t[s+1],o=t[s+2],a=t[s+3],128==(192&r)&&128==(192&o)&&128==(192&a)&&(c=(15&l)<<18|(63&r)<<12|(63&o)<<6|63&a)>65535&&c<1114112&&(u=c)}null===u?(u=65533,h=1):u>65535&&(u-=65536,i.push(u>>>10&1023|55296),u=56320|1023&u),i.push(u),s+=h}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);for(var n="",i=0;ii)&&(n=i);for(var s="",r=e;rn)throw new RangeError("Trying to access beyond buffer length")}function O(t,e,n,i,s,r){if(!c.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>s||et.length)throw new RangeError("Index out of range")}function k(t,e,n,i){e<0&&(e=65535+e+1);for(var s=0,r=Math.min(t.length-n,2);s>>8*(i?s:1-s)}function R(t,e,n,i){e<0&&(e=4294967295+e+1);for(var s=0,r=Math.min(t.length-n,4);s>>8*(i?s:3-s)&255}function N(t,e,n,i,s,r){if(n+i>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function D(t,e,n,i,r){return r||N(t,0,n,4),s.write(t,e,n,i,23,4),n+4}function V(t,e,n,i,r){return r||N(t,0,n,8),s.write(t,e,n,i,52,8),n+8}e.Buffer=c,e.SlowBuffer=function(t){return+t!=t&&(t=0),c.alloc(+t)},e.INSPECT_MAX_BYTES=50,c.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=o(),c.poolSize=8192,c._augment=function(t){return t.__proto__=c.prototype,t},c.from=function(t,e,n){return l(null,t,e,n)},c.TYPED_ARRAY_SUPPORT&&(c.prototype.__proto__=Uint8Array.prototype,c.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&c[Symbol.species]===c&&Object.defineProperty(c,Symbol.species,{value:null,configurable:!0})),c.alloc=function(t,e,n){return function(t,e,n,i){return u(e),e<=0?a(t,e):void 0!==n?"string"==typeof i?a(t,e).fill(n,i):a(t,e).fill(n):a(t,e)}(null,t,e,n)},c.allocUnsafe=function(t){return h(null,t)},c.allocUnsafeSlow=function(t){return h(null,t)},c.isBuffer=function(t){return!(null==t||!t._isBuffer)},c.compare=function(t,e){if(!c.isBuffer(t)||!c.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var n=t.length,i=e.length,s=0,r=Math.min(n,i);s0&&(t=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(t+=" ... ")),""},c.prototype.compare=function(t,e,n,i,s){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===i&&(i=0),void 0===s&&(s=this.length),e<0||n>t.length||i<0||s>this.length)throw new RangeError("out of range index");if(i>=s&&e>=n)return 0;if(i>=s)return-1;if(e>=n)return 1;if(this===t)return 0;for(var r=(s>>>=0)-(i>>>=0),o=(n>>>=0)-(e>>>=0),a=Math.min(r,o),l=this.slice(i,s),u=t.slice(e,n),h=0;hs)&&(n=s),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var r=!1;;)switch(i){case"hex":return y(this,t,e,n);case"utf8":case"utf-8":return S(this,t,e,n);case"ascii":return x(this,t,e,n);case"latin1":case"binary":return _(this,t,e,n);case"base64":return w(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,e,n);default:if(r)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),r=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},c.prototype.slice=function(t,e){var n,i=this.length;if((t=~~t)<0?(t+=i)<0&&(t=0):t>i&&(t=i),(e=void 0===e?i:~~e)<0?(e+=i)<0&&(e=0):e>i&&(e=i),e0&&(s*=256);)i+=this[t+--e]*s;return i},c.prototype.readUInt8=function(t,e){return e||L(t,1,this.length),this[t]},c.prototype.readUInt16LE=function(t,e){return e||L(t,2,this.length),this[t]|this[t+1]<<8},c.prototype.readUInt16BE=function(t,e){return e||L(t,2,this.length),this[t]<<8|this[t+1]},c.prototype.readUInt32LE=function(t,e){return e||L(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},c.prototype.readUInt32BE=function(t,e){return e||L(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},c.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||L(t,e,this.length);for(var i=this[t],s=1,r=0;++r=(s*=128)&&(i-=Math.pow(2,8*e)),i},c.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||L(t,e,this.length);for(var i=e,s=1,r=this[t+--i];i>0&&(s*=256);)r+=this[t+--i]*s;return r>=(s*=128)&&(r-=Math.pow(2,8*e)),r},c.prototype.readInt8=function(t,e){return e||L(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},c.prototype.readInt16LE=function(t,e){e||L(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt16BE=function(t,e){e||L(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt32LE=function(t,e){return e||L(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},c.prototype.readInt32BE=function(t,e){return e||L(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},c.prototype.readFloatLE=function(t,e){return e||L(t,4,this.length),s.read(this,t,!0,23,4)},c.prototype.readFloatBE=function(t,e){return e||L(t,4,this.length),s.read(this,t,!1,23,4)},c.prototype.readDoubleLE=function(t,e){return e||L(t,8,this.length),s.read(this,t,!0,52,8)},c.prototype.readDoubleBE=function(t,e){return e||L(t,8,this.length),s.read(this,t,!1,52,8)},c.prototype.writeUIntLE=function(t,e,n,i){t=+t,e|=0,n|=0,i||O(this,t,e,n,Math.pow(2,8*n)-1,0);var s=1,r=0;for(this[e]=255&t;++r=0&&(r*=256);)this[e+s]=t/r&255;return e+n},c.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||O(this,t,e,1,255,0),c.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},c.prototype.writeUInt16LE=function(t,e,n){return t=+t,e|=0,n||O(this,t,e,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):k(this,t,e,!0),e+2},c.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||O(this,t,e,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):k(this,t,e,!1),e+2},c.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||O(this,t,e,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):R(this,t,e,!0),e+4},c.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||O(this,t,e,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):R(this,t,e,!1),e+4},c.prototype.writeIntLE=function(t,e,n,i){if(t=+t,e|=0,!i){var s=Math.pow(2,8*n-1);O(this,t,e,n,s-1,-s)}var r=0,o=1,a=0;for(this[e]=255&t;++r>0)-a&255;return e+n},c.prototype.writeIntBE=function(t,e,n,i){if(t=+t,e|=0,!i){var s=Math.pow(2,8*n-1);O(this,t,e,n,s-1,-s)}var r=n-1,o=1,a=0;for(this[e+r]=255&t;--r>=0&&(o*=256);)t<0&&0===a&&0!==this[e+r+1]&&(a=1),this[e+r]=(t/o>>0)-a&255;return e+n},c.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||O(this,t,e,1,127,-128),c.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},c.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||O(this,t,e,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):k(this,t,e,!0),e+2},c.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||O(this,t,e,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):k(this,t,e,!1),e+2},c.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||O(this,t,e,4,2147483647,-2147483648),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):R(this,t,e,!0),e+4},c.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||O(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):R(this,t,e,!1),e+4},c.prototype.writeFloatLE=function(t,e,n){return D(this,t,e,!0,n)},c.prototype.writeFloatBE=function(t,e,n){return D(this,t,e,!1,n)},c.prototype.writeDoubleLE=function(t,e,n){return V(this,t,e,!0,n)},c.prototype.writeDoubleBE=function(t,e,n){return V(this,t,e,!1,n)},c.prototype.copy=function(t,e,n,i){if(n||(n=0),i||0===i||(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e=0;--s)t[s+e]=this[s+n];else if(r<1e3||!c.TYPED_ARRAY_SUPPORT)for(s=0;s>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(r=e;r55295&&n<57344){if(!s){if(n>56319){(e-=3)>-1&&r.push(239,191,189);continue}if(o+1===i){(e-=3)>-1&&r.push(239,191,189);continue}s=n;continue}if(n<56320){(e-=3)>-1&&r.push(239,191,189),s=n;continue}n=65536+(s-55296<<10|n-56320)}else s&&(e-=3)>-1&&r.push(239,191,189);if(s=null,n<128){if((e-=1)<0)break;r.push(n)}else if(n<2048){if((e-=2)<0)break;r.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;r.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;r.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return r}function G(t){return i.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(B,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function W(t,e,n,i){for(var s=0;s=e.length||s>=t.length);++s)e[s+n]=t[s];return s}}).call(this,n(41))},function(t,e,n){"use strict";e.byteLength=function(t){var e=l(t),n=e[0],i=e[1];return 3*(n+i)/4-i},e.toByteArray=function(t){var e,n,i=l(t),o=i[0],a=i[1],c=new r(function(t,e,n){return 3*(e+n)/4-n}(0,o,a)),u=0,h=a>0?o-4:o;for(n=0;n>16&255,c[u++]=e>>8&255,c[u++]=255&e;return 2===a&&(e=s[t.charCodeAt(n)]<<2|s[t.charCodeAt(n+1)]>>4,c[u++]=255&e),1===a&&(e=s[t.charCodeAt(n)]<<10|s[t.charCodeAt(n+1)]<<4|s[t.charCodeAt(n+2)]>>2,c[u++]=e>>8&255,c[u++]=255&e),c},e.fromByteArray=function(t){for(var e,n=t.length,s=n%3,r=[],o=0,a=n-s;oa?a:o+16383));return 1===s?(e=t[n-1],r.push(i[e>>2]+i[e<<4&63]+"==")):2===s&&(e=(t[n-2]<<8)+t[n-1],r.push(i[e>>10]+i[e>>4&63]+i[e<<2&63]+"=")),r.join("")};for(var i=[],s=[],r="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,c=o.length;a0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");return-1===n&&(n=e),[n,n===e?0:4-n%4]}function u(t,e,n){for(var s,r,o=[],a=e;a>18&63]+i[r>>12&63]+i[r>>6&63]+i[63&r]);return o.join("")}s["-".charCodeAt(0)]=62,s["_".charCodeAt(0)]=63},function(t,e){e.read=function(t,e,n,i,s){var r,o,a=8*s-i-1,c=(1<>1,u=-7,h=n?s-1:0,d=n?-1:1,f=t[e+h];for(h+=d,r=f&(1<<-u)-1,f>>=-u,u+=a;u>0;r=256*r+t[e+h],h+=d,u-=8);for(o=r&(1<<-u)-1,r>>=-u,u+=i;u>0;o=256*o+t[e+h],h+=d,u-=8);if(0===r)r=1-l;else{if(r===c)return o?NaN:1/0*(f?-1:1);o+=Math.pow(2,i),r-=l}return(f?-1:1)*o*Math.pow(2,r-i)},e.write=function(t,e,n,i,s,r){var o,a,c,l=8*r-s-1,u=(1<>1,d=23===s?Math.pow(2,-24)-Math.pow(2,-77):0,f=i?0:r-1,p=i?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=u):(o=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-o))<1&&(o--,c*=2),(e+=o+h>=1?d/c:d*Math.pow(2,1-h))*c>=2&&(o++,c/=2),o+h>=u?(a=0,o=u):o+h>=1?(a=(e*c-1)*Math.pow(2,s),o+=h):(a=e*Math.pow(2,h-1)*Math.pow(2,s),o=0));s>=8;t[n+f]=255&a,f+=p,a/=256,s-=8);for(o=o<0;t[n+f]=255&o,f+=p,o/=256,l-=8);t[n+f-p]|=128*m}},function(t,e){var n={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},function(t,e,n){(function(t){var i=void 0!==t&&t||"undefined"!=typeof self&&self||window,s=Function.prototype.apply;function r(t,e){this._id=t,this._clearFn=e}e.setTimeout=function(){return new r(s.call(setTimeout,i,arguments),clearTimeout)},e.setInterval=function(){return new r(s.call(setInterval,i,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},r.prototype.unref=r.prototype.ref=function(){},r.prototype.close=function(){this._clearFn.call(i,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},n(175),e.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(this,n(41))},function(t,e,n){(function(t,e){!function(t,n){"use strict";if(!t.setImmediate){var i,s,r,o,a,c=1,l={},u=!1,h=t.document,d=Object.getPrototypeOf&&Object.getPrototypeOf(t);d=d&&d.setTimeout?d:t,"[object process]"==={}.toString.call(t.process)?i=function(t){e.nextTick((function(){p(t)}))}:function(){if(t.postMessage&&!t.importScripts){var e=!0,n=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=n,e}}()?(o="setImmediate$"+Math.random()+"$",a=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(o)&&p(+e.data.slice(o.length))},t.addEventListener?t.addEventListener("message",a,!1):t.attachEvent("onmessage",a),i=function(e){t.postMessage(o+e,"*")}):t.MessageChannel?((r=new MessageChannel).port1.onmessage=function(t){p(t.data)},i=function(t){r.port2.postMessage(t)}):h&&"onreadystatechange"in h.createElement("script")?(s=h.documentElement,i=function(t){var e=h.createElement("script");e.onreadystatechange=function(){p(t),e.onreadystatechange=null,s.removeChild(e),e=null},s.appendChild(e)}):i=function(t){setTimeout(p,0,t)},d.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),n=0;n";e.style.display="none",n("fab2").appendChild(e),e.src="javascript:",t=e.contentWindow.document,t.open(),t.write(s+"script"+o+"document.F=Object"+s+"/script"+o),t.close(),l=t.F;while(i--)delete l[c][r[i]];return l()};t.exports=Object.create||function(t,e){var n;return null!==t?(a[c]=i(t),n=new a,a[c]=null,n[o]=t):n=l(),void 0===e?n:s(n,e)}},"2af5":function(t,e){},"2b0e":function(t,e,n){"use strict";n.r(e),function(t){ /*! * Vue.js v2.6.11 * (c) 2014-2019 Evan You * Released under the MIT License. */ var n=Object.freeze({});function i(t){return void 0===t||null===t}function s(t){return void 0!==t&&null!==t}function r(t){return!0===t}function o(t){return!1===t}function a(t){return"string"===typeof t||"number"===typeof t||"symbol"===typeof t||"boolean"===typeof t}function c(t){return null!==t&&"object"===typeof t}var l=Object.prototype.toString;function u(t){return"[object Object]"===l.call(t)}function h(t){return"[object RegExp]"===l.call(t)}function d(t){var e=parseFloat(String(t));return e>=0&&Math.floor(e)===e&&isFinite(t)}function f(t){return s(t)&&"function"===typeof t.then&&"function"===typeof t.catch}function p(t){return null==t?"":Array.isArray(t)||u(t)&&t.toString===l?JSON.stringify(t,null,2):String(t)}function m(t){var e=parseFloat(t);return isNaN(e)?t:e}function g(t,e){for(var n=Object.create(null),i=t.split(","),s=0;s-1)return t.splice(n,1)}}var y=Object.prototype.hasOwnProperty;function S(t,e){return y.call(t,e)}function x(t){var e=Object.create(null);return function(n){var i=e[n];return i||(e[n]=t(n))}}var _=/-(\w)/g,w=x((function(t){return t.replace(_,(function(t,e){return e?e.toUpperCase():""}))})),E=x((function(t){return t.charAt(0).toUpperCase()+t.slice(1)})),T=/\B([A-Z])/g,C=x((function(t){return t.replace(T,"-$1").toLowerCase()}));function M(t,e){function n(n){var i=arguments.length;return i?i>1?t.apply(e,arguments):t.call(e,n):t.call(e)}return n._length=t.length,n}function P(t,e){return t.bind(e)}var A=Function.prototype.bind?P:M;function I(t,e){e=e||0;var n=t.length-e,i=new Array(n);while(n--)i[n]=t[n+e];return i}function L(t,e){for(var n in e)t[n]=e[n];return t}function O(t){for(var e={},n=0;n0,nt=Q&&Q.indexOf("edge/")>0,it=(Q&&Q.indexOf("android"),Q&&/iphone|ipad|ipod|ios/.test(Q)||"ios"===J),st=(Q&&/chrome\/\d+/.test(Q),Q&&/phantomjs/.test(Q),Q&&Q.match(/firefox\/(\d+)/)),rt={}.watch,ot=!1;if(q)try{var at={};Object.defineProperty(at,"passive",{get:function(){ot=!0}}),window.addEventListener("test-passive",null,at)}catch(wo){}var ct=function(){return void 0===X&&(X=!q&&!Z&&"undefined"!==typeof t&&(t["process"]&&"server"===t["process"].env.VUE_ENV)),X},lt=q&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function ut(t){return"function"===typeof t&&/native code/.test(t.toString())}var ht,dt="undefined"!==typeof Symbol&&ut(Symbol)&&"undefined"!==typeof Reflect&&ut(Reflect.ownKeys);ht="undefined"!==typeof Set&&ut(Set)?Set:function(){function t(){this.set=Object.create(null)}return t.prototype.has=function(t){return!0===this.set[t]},t.prototype.add=function(t){this.set[t]=!0},t.prototype.clear=function(){this.set=Object.create(null)},t}();var ft=k,pt=0,mt=function(){this.id=pt++,this.subs=[]};mt.prototype.addSub=function(t){this.subs.push(t)},mt.prototype.removeSub=function(t){v(this.subs,t)},mt.prototype.depend=function(){mt.target&&mt.target.addDep(this)},mt.prototype.notify=function(){var t=this.subs.slice();for(var e=0,n=t.length;e-1)if(r&&!S(s,"default"))o=!1;else if(""===o||o===C(t)){var c=te(String,s.type);(c<0||a0&&(o=Me(o,(e||"")+"_"+n),Ce(o[0])&&Ce(l)&&(u[c]=_t(l.text+o[0].text),o.shift()),u.push.apply(u,o)):a(o)?Ce(l)?u[c]=_t(l.text+o):""!==o&&u.push(_t(o)):Ce(o)&&Ce(l)?u[c]=_t(l.text+o.text):(r(t._isVList)&&s(o.tag)&&i(o.key)&&s(e)&&(o.key="__vlist"+e+"_"+n+"__"),u.push(o)));return u}function Pe(t){var e=t.$options.provide;e&&(t._provided="function"===typeof e?e.call(t):e)}function Ae(t){var e=Ie(t.$options.inject,t);e&&(At(!1),Object.keys(e).forEach((function(n){Rt(t,n,e[n])})),At(!0))}function Ie(t,e){if(t){for(var n=Object.create(null),i=dt?Reflect.ownKeys(t):Object.keys(t),s=0;s0,o=t?!!t.$stable:!r,a=t&&t.$key;if(t){if(t._normalized)return t._normalized;if(o&&i&&i!==n&&a===i.$key&&!r&&!i.$hasNormal)return i;for(var c in s={},t)t[c]&&"$"!==c[0]&&(s[c]=Re(e,c,t[c]))}else s={};for(var l in e)l in s||(s[l]=Ne(e,l));return t&&Object.isExtensible(t)&&(t._normalized=s),H(s,"$stable",o),H(s,"$key",a),H(s,"$hasNormal",r),s}function Re(t,e,n){var i=function(){var t=arguments.length?n.apply(null,arguments):n({});return t=t&&"object"===typeof t&&!Array.isArray(t)?[t]:Te(t),t&&(0===t.length||1===t.length&&t[0].isComment)?void 0:t};return n.proxy&&Object.defineProperty(t,e,{get:i,enumerable:!0,configurable:!0}),i}function Ne(t,e){return function(){return t[e]}}function De(t,e){var n,i,r,o,a;if(Array.isArray(t)||"string"===typeof t)for(n=new Array(t.length),i=0,r=t.length;i1?I(n):n;for(var i=I(arguments,1),s='event handler for "'+t+'"',r=0,o=n.length;rdocument.createEvent("Event").timeStamp&&(Xn=function(){return Kn.now()})}function qn(){var t,e;for(Yn=Xn(),zn=!0,jn.sort((function(t,e){return t.id-e.id})),Hn=0;HnHn&&jn[n].id>t.id)n--;jn.splice(n+1,0,t)}else jn.push(t);$n||($n=!0,pe(qn))}}var ei=0,ni=function(t,e,n,i,s){this.vm=t,s&&(t._watcher=this),t._watchers.push(this),i?(this.deep=!!i.deep,this.user=!!i.user,this.lazy=!!i.lazy,this.sync=!!i.sync,this.before=i.before):this.deep=this.user=this.lazy=this.sync=!1,this.cb=n,this.id=++ei,this.active=!0,this.dirty=this.lazy,this.deps=[],this.newDeps=[],this.depIds=new ht,this.newDepIds=new ht,this.expression="","function"===typeof e?this.getter=e:(this.getter=Y(e),this.getter||(this.getter=k)),this.value=this.lazy?void 0:this.get()};ni.prototype.get=function(){var t;bt(this);var e=this.vm;try{t=this.getter.call(e,e)}catch(wo){if(!this.user)throw wo;ee(wo,e,'getter for watcher "'+this.expression+'"')}finally{this.deep&&ge(t),vt(),this.cleanupDeps()}return t},ni.prototype.addDep=function(t){var e=t.id;this.newDepIds.has(e)||(this.newDepIds.add(e),this.newDeps.push(t),this.depIds.has(e)||t.addSub(this))},ni.prototype.cleanupDeps=function(){var t=this.deps.length;while(t--){var e=this.deps[t];this.newDepIds.has(e.id)||e.removeSub(this)}var n=this.depIds;this.depIds=this.newDepIds,this.newDepIds=n,this.newDepIds.clear(),n=this.deps,this.deps=this.newDeps,this.newDeps=n,this.newDeps.length=0},ni.prototype.update=function(){this.lazy?this.dirty=!0:this.sync?this.run():ti(this)},ni.prototype.run=function(){if(this.active){var t=this.get();if(t!==this.value||c(t)||this.deep){var e=this.value;if(this.value=t,this.user)try{this.cb.call(this.vm,t,e)}catch(wo){ee(wo,this.vm,'callback for watcher "'+this.expression+'"')}else this.cb.call(this.vm,t,e)}}},ni.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},ni.prototype.depend=function(){var t=this.deps.length;while(t--)this.deps[t].depend()},ni.prototype.teardown=function(){if(this.active){this.vm._isBeingDestroyed||v(this.vm._watchers,this);var t=this.deps.length;while(t--)this.deps[t].removeSub(this);this.active=!1}};var ii={enumerable:!0,configurable:!0,get:k,set:k};function si(t,e,n){ii.get=function(){return this[e][n]},ii.set=function(t){this[e][n]=t},Object.defineProperty(t,n,ii)}function ri(t){t._watchers=[];var e=t.$options;e.props&&oi(t,e.props),e.methods&&pi(t,e.methods),e.data?ai(t):kt(t._data={},!0),e.computed&&ui(t,e.computed),e.watch&&e.watch!==rt&&mi(t,e.watch)}function oi(t,e){var n=t.$options.propsData||{},i=t._props={},s=t.$options._propKeys=[],r=!t.$parent;r||At(!1);var o=function(r){s.push(r);var o=qt(r,e,n,t);Rt(i,r,o),r in t||si(t,"_props",r)};for(var a in e)o(a);At(!0)}function ai(t){var e=t.$options.data;e=t._data="function"===typeof e?ci(e,t):e||{},u(e)||(e={});var n=Object.keys(e),i=t.$options.props,s=(t.$options.methods,n.length);while(s--){var r=n[s];0,i&&S(i,r)||z(r)||si(t,"_data",r)}kt(e,!0)}function ci(t,e){bt();try{return t.call(e,e)}catch(wo){return ee(wo,e,"data()"),{}}finally{vt()}}var li={lazy:!0};function ui(t,e){var n=t._computedWatchers=Object.create(null),i=ct();for(var s in e){var r=e[s],o="function"===typeof r?r:r.get;0,i||(n[s]=new ni(t,o||k,k,li)),s in t||hi(t,s,r)}}function hi(t,e,n){var i=!ct();"function"===typeof n?(ii.get=i?di(e):fi(n),ii.set=k):(ii.get=n.get?i&&!1!==n.cache?di(e):fi(n.get):k,ii.set=n.set||k),Object.defineProperty(t,e,ii)}function di(t){return function(){var e=this._computedWatchers&&this._computedWatchers[t];if(e)return e.dirty&&e.evaluate(),mt.target&&e.depend(),e.value}}function fi(t){return function(){return t.call(this,this)}}function pi(t,e){t.$options.props;for(var n in e)t[n]="function"!==typeof e[n]?k:A(e[n],t)}function mi(t,e){for(var n in e){var i=e[n];if(Array.isArray(i))for(var s=0;s-1)return this;var n=I(arguments,1);return n.unshift(this),"function"===typeof t.install?t.install.apply(t,n):"function"===typeof t&&t.apply(null,n),e.push(t),this}}function Ti(t){t.mixin=function(t){return this.options=Xt(this.options,t),this}}function Ci(t){t.cid=0;var e=1;t.extend=function(t){t=t||{};var n=this,i=n.cid,s=t._Ctor||(t._Ctor={});if(s[i])return s[i];var r=t.name||n.options.name;var o=function(t){this._init(t)};return o.prototype=Object.create(n.prototype),o.prototype.constructor=o,o.cid=e++,o.options=Xt(n.options,t),o["super"]=n,o.options.props&&Mi(o),o.options.computed&&Pi(o),o.extend=n.extend,o.mixin=n.mixin,o.use=n.use,j.forEach((function(t){o[t]=n[t]})),r&&(o.options.components[r]=o),o.superOptions=n.options,o.extendOptions=t,o.sealedOptions=L({},o.options),s[i]=o,o}}function Mi(t){var e=t.options.props;for(var n in e)si(t.prototype,"_props",n)}function Pi(t){var e=t.options.computed;for(var n in e)hi(t.prototype,n,e[n])}function Ai(t){j.forEach((function(e){t[e]=function(t,n){return n?("component"===e&&u(n)&&(n.name=n.name||t,n=this.options._base.extend(n)),"directive"===e&&"function"===typeof n&&(n={bind:n,update:n}),this.options[e+"s"][t]=n,n):this.options[e+"s"][t]}}))}function Ii(t){return t&&(t.Ctor.options.name||t.tag)}function Li(t,e){return Array.isArray(t)?t.indexOf(e)>-1:"string"===typeof t?t.split(",").indexOf(e)>-1:!!h(t)&&t.test(e)}function Oi(t,e){var n=t.cache,i=t.keys,s=t._vnode;for(var r in n){var o=n[r];if(o){var a=Ii(o.componentOptions);a&&!e(a)&&ki(n,r,i,s)}}}function ki(t,e,n,i){var s=t[e];!s||i&&s.tag===i.tag||s.componentInstance.$destroy(),t[e]=null,v(n,e)}yi(wi),bi(wi),An(wi),kn(wi),vn(wi);var Ri=[String,RegExp,Array],Ni={name:"keep-alive",abstract:!0,props:{include:Ri,exclude:Ri,max:[String,Number]},created:function(){this.cache=Object.create(null),this.keys=[]},destroyed:function(){for(var t in this.cache)ki(this.cache,t,this.keys)},mounted:function(){var t=this;this.$watch("include",(function(e){Oi(t,(function(t){return Li(e,t)}))})),this.$watch("exclude",(function(e){Oi(t,(function(t){return!Li(e,t)}))}))},render:function(){var t=this.$slots.default,e=wn(t),n=e&&e.componentOptions;if(n){var i=Ii(n),s=this,r=s.include,o=s.exclude;if(r&&(!i||!Li(r,i))||o&&i&&Li(o,i))return e;var a=this,c=a.cache,l=a.keys,u=null==e.key?n.Ctor.cid+(n.tag?"::"+n.tag:""):e.key;c[u]?(e.componentInstance=c[u].componentInstance,v(l,u),l.push(u)):(c[u]=e,l.push(u),this.max&&l.length>parseInt(this.max)&&ki(c,l[0],l,this._vnode)),e.data.keepAlive=!0}return e||t&&t[0]}},Di={KeepAlive:Ni};function Vi(t){var e={get:function(){return W}};Object.defineProperty(t,"config",e),t.util={warn:ft,extend:L,mergeOptions:Xt,defineReactive:Rt},t.set=Nt,t.delete=Dt,t.nextTick=pe,t.observable=function(t){return kt(t),t},t.options=Object.create(null),j.forEach((function(e){t.options[e+"s"]=Object.create(null)})),t.options._base=t,L(t.options.components,Di),Ei(t),Ti(t),Ci(t),Ai(t)}Vi(wi),Object.defineProperty(wi.prototype,"$isServer",{get:ct}),Object.defineProperty(wi.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(wi,"FunctionalRenderContext",{value:Ze}),wi.version="2.6.11";var Bi=g("style,class"),Fi=g("input,textarea,option,select,progress"),ji=function(t,e,n){return"value"===n&&Fi(t)&&"button"!==e||"selected"===n&&"option"===t||"checked"===n&&"input"===t||"muted"===n&&"video"===t},Gi=g("contenteditable,draggable,spellcheck"),Wi=g("events,caret,typing,plaintext-only"),$i=function(t,e){return Xi(e)||"false"===e?"false":"contenteditable"===t&&Wi(e)?e:"true"},zi=g("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,translate,truespeed,typemustmatch,visible"),Hi="http://www.w3.org/1999/xlink",Ui=function(t){return":"===t.charAt(5)&&"xlink"===t.slice(0,5)},Yi=function(t){return Ui(t)?t.slice(6,t.length):""},Xi=function(t){return null==t||!1===t};function Ki(t){var e=t.data,n=t,i=t;while(s(i.componentInstance))i=i.componentInstance._vnode,i&&i.data&&(e=qi(i.data,e));while(s(n=n.parent))n&&n.data&&(e=qi(e,n.data));return Zi(e.staticClass,e.class)}function qi(t,e){return{staticClass:Ji(t.staticClass,e.staticClass),class:s(t.class)?[t.class,e.class]:e.class}}function Zi(t,e){return s(t)||s(e)?Ji(t,Qi(e)):""}function Ji(t,e){return t?e?t+" "+e:t:e||""}function Qi(t){return Array.isArray(t)?ts(t):c(t)?es(t):"string"===typeof t?t:""}function ts(t){for(var e,n="",i=0,r=t.length;i-1?as[t]=e.constructor===window.HTMLUnknownElement||e.constructor===window.HTMLElement:as[t]=/HTMLUnknownElement/.test(e.toString())}var ls=g("text,number,password,search,email,tel,url");function us(t){if("string"===typeof t){var e=document.querySelector(t);return e||document.createElement("div")}return t}function hs(t,e){var n=document.createElement(t);return"select"!==t||e.data&&e.data.attrs&&void 0!==e.data.attrs.multiple&&n.setAttribute("multiple","multiple"),n}function ds(t,e){return document.createElementNS(ns[t],e)}function fs(t){return document.createTextNode(t)}function ps(t){return document.createComment(t)}function ms(t,e,n){t.insertBefore(e,n)}function gs(t,e){t.removeChild(e)}function bs(t,e){t.appendChild(e)}function vs(t){return t.parentNode}function ys(t){return t.nextSibling}function Ss(t){return t.tagName}function xs(t,e){t.textContent=e}function _s(t,e){t.setAttribute(e,"")}var ws=Object.freeze({createElement:hs,createElementNS:ds,createTextNode:fs,createComment:ps,insertBefore:ms,removeChild:gs,appendChild:bs,parentNode:vs,nextSibling:ys,tagName:Ss,setTextContent:xs,setStyleScope:_s}),Es={create:function(t,e){Ts(e)},update:function(t,e){t.data.ref!==e.data.ref&&(Ts(t,!0),Ts(e))},destroy:function(t){Ts(t,!0)}};function Ts(t,e){var n=t.data.ref;if(s(n)){var i=t.context,r=t.componentInstance||t.elm,o=i.$refs;e?Array.isArray(o[n])?v(o[n],r):o[n]===r&&(o[n]=void 0):t.data.refInFor?Array.isArray(o[n])?o[n].indexOf(r)<0&&o[n].push(r):o[n]=[r]:o[n]=r}}var Cs=new yt("",{},[]),Ms=["create","activate","update","remove","destroy"];function Ps(t,e){return t.key===e.key&&(t.tag===e.tag&&t.isComment===e.isComment&&s(t.data)===s(e.data)&&As(t,e)||r(t.isAsyncPlaceholder)&&t.asyncFactory===e.asyncFactory&&i(e.asyncFactory.error))}function As(t,e){if("input"!==t.tag)return!0;var n,i=s(n=t.data)&&s(n=n.attrs)&&n.type,r=s(n=e.data)&&s(n=n.attrs)&&n.type;return i===r||ls(i)&&ls(r)}function Is(t,e,n){var i,r,o={};for(i=e;i<=n;++i)r=t[i].key,s(r)&&(o[r]=i);return o}function Ls(t){var e,n,o={},c=t.modules,l=t.nodeOps;for(e=0;em?(h=i(n[v+1])?null:n[v+1].elm,w(t,h,n,p,v,r)):p>v&&T(e,d,m)}function P(t,e,n,i){for(var r=n;r-1?Ws(t,e,n):zi(e)?Xi(n)?t.removeAttribute(e):(n="allowfullscreen"===e&&"EMBED"===t.tagName?"true":e,t.setAttribute(e,n)):Gi(e)?t.setAttribute(e,$i(e,n)):Ui(e)?Xi(n)?t.removeAttributeNS(Hi,Yi(e)):t.setAttributeNS(Hi,e,n):Ws(t,e,n)}function Ws(t,e,n){if(Xi(n))t.removeAttribute(e);else{if(tt&&!et&&"TEXTAREA"===t.tagName&&"placeholder"===e&&""!==n&&!t.__ieph){var i=function(e){e.stopImmediatePropagation(),t.removeEventListener("input",i)};t.addEventListener("input",i),t.__ieph=!0}t.setAttribute(e,n)}}var $s={create:js,update:js};function zs(t,e){var n=e.elm,r=e.data,o=t.data;if(!(i(r.staticClass)&&i(r.class)&&(i(o)||i(o.staticClass)&&i(o.class)))){var a=Ki(e),c=n._transitionClasses;s(c)&&(a=Ji(a,Qi(c))),a!==n._prevClass&&(n.setAttribute("class",a),n._prevClass=a)}}var Hs,Us={create:zs,update:zs},Ys="__r",Xs="__c";function Ks(t){if(s(t[Ys])){var e=tt?"change":"input";t[e]=[].concat(t[Ys],t[e]||[]),delete t[Ys]}s(t[Xs])&&(t.change=[].concat(t[Xs],t.change||[]),delete t[Xs])}function qs(t,e,n){var i=Hs;return function s(){var r=e.apply(null,arguments);null!==r&&Qs(t,s,n,i)}}var Zs=oe&&!(st&&Number(st[1])<=53);function Js(t,e,n,i){if(Zs){var s=Yn,r=e;e=r._wrapper=function(t){if(t.target===t.currentTarget||t.timeStamp>=s||t.timeStamp<=0||t.target.ownerDocument!==document)return r.apply(this,arguments)}}Hs.addEventListener(t,e,ot?{capture:n,passive:i}:n)}function Qs(t,e,n,i){(i||Hs).removeEventListener(t,e._wrapper||e,n)}function tr(t,e){if(!i(t.data.on)||!i(e.data.on)){var n=e.data.on||{},s=t.data.on||{};Hs=e.elm,Ks(n),Se(n,s,Js,Qs,qs,e.context),Hs=void 0}}var er,nr={create:tr,update:tr};function ir(t,e){if(!i(t.data.domProps)||!i(e.data.domProps)){var n,r,o=e.elm,a=t.data.domProps||{},c=e.data.domProps||{};for(n in s(c.__ob__)&&(c=e.data.domProps=L({},c)),a)n in c||(o[n]="");for(n in c){if(r=c[n],"textContent"===n||"innerHTML"===n){if(e.children&&(e.children.length=0),r===a[n])continue;1===o.childNodes.length&&o.removeChild(o.childNodes[0])}if("value"===n&&"PROGRESS"!==o.tagName){o._value=r;var l=i(r)?"":String(r);sr(o,l)&&(o.value=l)}else if("innerHTML"===n&&ss(o.tagName)&&i(o.innerHTML)){er=er||document.createElement("div"),er.innerHTML=""+r+"";var u=er.firstChild;while(o.firstChild)o.removeChild(o.firstChild);while(u.firstChild)o.appendChild(u.firstChild)}else if(r!==a[n])try{o[n]=r}catch(wo){}}}}function sr(t,e){return!t.composing&&("OPTION"===t.tagName||rr(t,e)||or(t,e))}function rr(t,e){var n=!0;try{n=document.activeElement!==t}catch(wo){}return n&&t.value!==e}function or(t,e){var n=t.value,i=t._vModifiers;if(s(i)){if(i.number)return m(n)!==m(e);if(i.trim)return n.trim()!==e.trim()}return n!==e}var ar={create:ir,update:ir},cr=x((function(t){var e={},n=/;(?![^(]*\))/g,i=/:(.+)/;return t.split(n).forEach((function(t){if(t){var n=t.split(i);n.length>1&&(e[n[0].trim()]=n[1].trim())}})),e}));function lr(t){var e=ur(t.style);return t.staticStyle?L(t.staticStyle,e):e}function ur(t){return Array.isArray(t)?O(t):"string"===typeof t?cr(t):t}function hr(t,e){var n,i={};if(e){var s=t;while(s.componentInstance)s=s.componentInstance._vnode,s&&s.data&&(n=lr(s.data))&&L(i,n)}(n=lr(t.data))&&L(i,n);var r=t;while(r=r.parent)r.data&&(n=lr(r.data))&&L(i,n);return i}var dr,fr=/^--/,pr=/\s*!important$/,mr=function(t,e,n){if(fr.test(e))t.style.setProperty(e,n);else if(pr.test(n))t.style.setProperty(C(e),n.replace(pr,""),"important");else{var i=br(e);if(Array.isArray(n))for(var s=0,r=n.length;s-1?e.split(Sr).forEach((function(e){return t.classList.add(e)})):t.classList.add(e);else{var n=" "+(t.getAttribute("class")||"")+" ";n.indexOf(" "+e+" ")<0&&t.setAttribute("class",(n+e).trim())}}function _r(t,e){if(e&&(e=e.trim()))if(t.classList)e.indexOf(" ")>-1?e.split(Sr).forEach((function(e){return t.classList.remove(e)})):t.classList.remove(e),t.classList.length||t.removeAttribute("class");else{var n=" "+(t.getAttribute("class")||"")+" ",i=" "+e+" ";while(n.indexOf(i)>=0)n=n.replace(i," ");n=n.trim(),n?t.setAttribute("class",n):t.removeAttribute("class")}}function wr(t){if(t){if("object"===typeof t){var e={};return!1!==t.css&&L(e,Er(t.name||"v")),L(e,t),e}return"string"===typeof t?Er(t):void 0}}var Er=x((function(t){return{enterClass:t+"-enter",enterToClass:t+"-enter-to",enterActiveClass:t+"-enter-active",leaveClass:t+"-leave",leaveToClass:t+"-leave-to",leaveActiveClass:t+"-leave-active"}})),Tr=q&&!et,Cr="transition",Mr="animation",Pr="transition",Ar="transitionend",Ir="animation",Lr="animationend";Tr&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(Pr="WebkitTransition",Ar="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(Ir="WebkitAnimation",Lr="webkitAnimationEnd"));var Or=q?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(t){return t()};function kr(t){Or((function(){Or(t)}))}function Rr(t,e){var n=t._transitionClasses||(t._transitionClasses=[]);n.indexOf(e)<0&&(n.push(e),xr(t,e))}function Nr(t,e){t._transitionClasses&&v(t._transitionClasses,e),_r(t,e)}function Dr(t,e,n){var i=Br(t,e),s=i.type,r=i.timeout,o=i.propCount;if(!s)return n();var a=s===Cr?Ar:Lr,c=0,l=function(){t.removeEventListener(a,u),n()},u=function(e){e.target===t&&++c>=o&&l()};setTimeout((function(){c0&&(n=Cr,u=o,h=r.length):e===Mr?l>0&&(n=Mr,u=l,h=c.length):(u=Math.max(o,l),n=u>0?o>l?Cr:Mr:null,h=n?n===Cr?r.length:c.length:0);var d=n===Cr&&Vr.test(i[Pr+"Property"]);return{type:n,timeout:u,propCount:h,hasTransform:d}}function Fr(t,e){while(t.length1}function Hr(t,e){!0!==e.data.show&&Gr(e)}var Ur=q?{create:Hr,activate:Hr,remove:function(t,e){!0!==t.data.show?Wr(t,e):e()}}:{},Yr=[$s,Us,nr,ar,yr,Ur],Xr=Yr.concat(Fs),Kr=Ls({nodeOps:ws,modules:Xr});et&&document.addEventListener("selectionchange",(function(){var t=document.activeElement;t&&t.vmodel&&io(t,"input")}));var qr={inserted:function(t,e,n,i){"select"===n.tag?(i.elm&&!i.elm._vOptions?xe(n,"postpatch",(function(){qr.componentUpdated(t,e,n)})):Zr(t,e,n.context),t._vOptions=[].map.call(t.options,to)):("textarea"===n.tag||ls(t.type))&&(t._vModifiers=e.modifiers,e.modifiers.lazy||(t.addEventListener("compositionstart",eo),t.addEventListener("compositionend",no),t.addEventListener("change",no),et&&(t.vmodel=!0)))},componentUpdated:function(t,e,n){if("select"===n.tag){Zr(t,e,n.context);var i=t._vOptions,s=t._vOptions=[].map.call(t.options,to);if(s.some((function(t,e){return!D(t,i[e])}))){var r=t.multiple?e.value.some((function(t){return Qr(t,s)})):e.value!==e.oldValue&&Qr(e.value,s);r&&io(t,"change")}}}};function Zr(t,e,n){Jr(t,e,n),(tt||nt)&&setTimeout((function(){Jr(t,e,n)}),0)}function Jr(t,e,n){var i=e.value,s=t.multiple;if(!s||Array.isArray(i)){for(var r,o,a=0,c=t.options.length;a-1,o.selected!==r&&(o.selected=r);else if(D(to(o),i))return void(t.selectedIndex!==a&&(t.selectedIndex=a));s||(t.selectedIndex=-1)}}function Qr(t,e){return e.every((function(e){return!D(e,t)}))}function to(t){return"_value"in t?t._value:t.value}function eo(t){t.target.composing=!0}function no(t){t.target.composing&&(t.target.composing=!1,io(t.target,"input"))}function io(t,e){var n=document.createEvent("HTMLEvents");n.initEvent(e,!0,!0),t.dispatchEvent(n)}function so(t){return!t.componentInstance||t.data&&t.data.transition?t:so(t.componentInstance._vnode)}var ro={bind:function(t,e,n){var i=e.value;n=so(n);var s=n.data&&n.data.transition,r=t.__vOriginalDisplay="none"===t.style.display?"":t.style.display;i&&s?(n.data.show=!0,Gr(n,(function(){t.style.display=r}))):t.style.display=i?r:"none"},update:function(t,e,n){var i=e.value,s=e.oldValue;if(!i!==!s){n=so(n);var r=n.data&&n.data.transition;r?(n.data.show=!0,i?Gr(n,(function(){t.style.display=t.__vOriginalDisplay})):Wr(n,(function(){t.style.display="none"}))):t.style.display=i?t.__vOriginalDisplay:"none"}},unbind:function(t,e,n,i,s){s||(t.style.display=t.__vOriginalDisplay)}},oo={model:qr,show:ro},ao={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function co(t){var e=t&&t.componentOptions;return e&&e.Ctor.options.abstract?co(wn(e.children)):t}function lo(t){var e={},n=t.$options;for(var i in n.propsData)e[i]=t[i];var s=n._parentListeners;for(var r in s)e[w(r)]=s[r];return e}function uo(t,e){if(/\d-keep-alive$/.test(e.tag))return t("keep-alive",{props:e.componentOptions.propsData})}function ho(t){while(t=t.parent)if(t.data.transition)return!0}function fo(t,e){return e.key===t.key&&e.tag===t.tag}var po=function(t){return t.tag||_n(t)},mo=function(t){return"show"===t.name},go={name:"transition",props:ao,abstract:!0,render:function(t){var e=this,n=this.$slots.default;if(n&&(n=n.filter(po),n.length)){0;var i=this.mode;0;var s=n[0];if(ho(this.$vnode))return s;var r=co(s);if(!r)return s;if(this._leaving)return uo(t,s);var o="__transition-"+this._uid+"-";r.key=null==r.key?r.isComment?o+"comment":o+r.tag:a(r.key)?0===String(r.key).indexOf(o)?r.key:o+r.key:r.key;var c=(r.data||(r.data={})).transition=lo(this),l=this._vnode,u=co(l);if(r.data.directives&&r.data.directives.some(mo)&&(r.data.show=!0),u&&u.data&&!fo(r,u)&&!_n(u)&&(!u.componentInstance||!u.componentInstance._vnode.isComment)){var h=u.data.transition=L({},c);if("out-in"===i)return this._leaving=!0,xe(h,"afterLeave",(function(){e._leaving=!1,e.$forceUpdate()})),uo(t,s);if("in-out"===i){if(_n(r))return l;var d,f=function(){d()};xe(c,"afterEnter",f),xe(c,"enterCancelled",f),xe(h,"delayLeave",(function(t){d=t}))}}return s}}},bo=L({tag:String,moveClass:String},ao);delete bo.mode;var vo={props:bo,beforeMount:function(){var t=this,e=this._update;this._update=function(n,i){var s=Ln(t);t.__patch__(t._vnode,t.kept,!1,!0),t._vnode=t.kept,s(),e.call(t,n,i)}},render:function(t){for(var e=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),i=this.prevChildren=this.children,s=this.$slots.default||[],r=this.children=[],o=lo(this),a=0;aasync e=>{try{const t=await fetch(e);if(t.ok)return t.text()}catch{}throw t()}},"2c2d":function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));const i=(t,e,n,i,s,r,o,a,c,l,u,h,d,f,p,m,g,b,v,y)=>class extends p{constructor(e,n){super(e,n),this._nativeContext=e,this._audioWorklet=void 0===t?void 0:{addModule:(e,n)=>t(this,e,n)}}get audioWorklet(){return this._audioWorklet}createAnalyser(){return new e(this)}createBiquadFilter(){return new s(this)}createBuffer(t,e,i){return new n({length:e,numberOfChannels:t,sampleRate:i})}createBufferSource(){return new i(this)}createChannelMerger(t=6){return new r(this,{numberOfInputs:t})}createChannelSplitter(t=6){return new o(this,{numberOfOutputs:t})}createConstantSource(){return new a(this)}createConvolver(){return new c(this)}createDelay(t=1){return new u(this,{maxDelayTime:t})}createDynamicsCompressor(){return new h(this)}createGain(){return new d(this)}createIIRFilter(t,e){return new f(this,{feedback:e,feedforward:t})}createOscillator(){return new m(this)}createPanner(){return new g(this)}createPeriodicWave(t,e,n={disableNormalization:!1}){return new b(this,{...n,imag:e,real:t})}createStereoPanner(){return new v(this)}createWaveShaper(){return new y(this)}decodeAudioData(t,e,n){return l(this._nativeContext,t).then(t=>("function"===typeof e&&e(t),t)).catch(t=>{throw"function"===typeof n&&n(t),t})}}},"2c92":function(t,e,n){"use strict";var i=n("ccf9"),s=function(t){return null!==t&&t!==[]&&t>=0&&t<129},r=function(t){return s(t)?+t:i.midi(t)};function o(t,e){return Object.keys(t).reduce((function(n,i){return n[e(i)]=t[i],n}),{})}t.exports=function(t){if(t.buffers){var e=t.opts.map,n="function"===typeof e?e:r,i=function(t){return t?n(t)||t:null};t.buffers=o(t.buffers,i);var s=t.start;t.start=function(t,e,n){var r=i(t),o=r%1;return o&&(r=Math.floor(r),n=Object.assign(n||{},{cents:Math.floor(100*o)})),s(r,e,n)}}return t}},"2cae":function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));const i=t=>class{constructor(t){this._nativeEventTarget=t,this._listeners=new WeakMap}addEventListener(e,n,i){if(null!==n){let s=this._listeners.get(n);void 0===s&&(s=t(this,n),"function"===typeof n&&this._listeners.set(n,s)),this._nativeEventTarget.addEventListener(e,s,i)}}dispatchEvent(t){return this._nativeEventTarget.dispatchEvent(t)}removeEventListener(t,e,n){const i=null===e?void 0:this._listeners.get(e);this._nativeEventTarget.removeEventListener(t,void 0===i?null:i,n)}}},"2d00":function(t,e){t.exports=!1},"2d17":function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));const i={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",fftSize:2048,maxDecibels:-30,minDecibels:-100,smoothingTimeConstant:.8},s=(t,e,n,s,r,o)=>class extends t{constructor(t,n=i){const a=r(t),c={...i,...n},l=s(a,c),u=o(a)?e():null;super(t,!1,l,u),this._nativeAnalyserNode=l}get fftSize(){return this._nativeAnalyserNode.fftSize}set fftSize(t){this._nativeAnalyserNode.fftSize=t}get frequencyBinCount(){return this._nativeAnalyserNode.frequencyBinCount}get maxDecibels(){return this._nativeAnalyserNode.maxDecibels}set maxDecibels(t){const e=this._nativeAnalyserNode.maxDecibels;if(this._nativeAnalyserNode.maxDecibels=t,!(t>this._nativeAnalyserNode.minDecibels))throw this._nativeAnalyserNode.maxDecibels=e,n()}get minDecibels(){return this._nativeAnalyserNode.minDecibels}set minDecibels(t){const e=this._nativeAnalyserNode.minDecibels;if(this._nativeAnalyserNode.minDecibels=t,!(this._nativeAnalyserNode.maxDecibels>t))throw this._nativeAnalyserNode.minDecibels=e,n()}get smoothingTimeConstant(){return this._nativeAnalyserNode.smoothingTimeConstant}set smoothingTimeConstant(t){this._nativeAnalyserNode.smoothingTimeConstant=t}getByteFrequencyData(t){this._nativeAnalyserNode.getByteFrequencyData(t)}getByteTimeDomainData(t){this._nativeAnalyserNode.getByteTimeDomainData(t)}getFloatFrequencyData(t){this._nativeAnalyserNode.getFloatFrequencyData(t)}getFloatTimeDomainData(t){this._nativeAnalyserNode.getFloatTimeDomainData(t)}}},"2d34":function(t,e,n){var i=n("5ca1"),s=n("38fd"),r=n("cb7c");i(i.S,"Reflect",{getPrototypeOf:function(t){return s(r(t))}})},"2d5c":function(t,e){var n=Math.expm1;t.exports=!n||n(10)>22025.465794806718||n(10)<22025.465794806718||-2e-17!=n(-2e-17)?function(t){return 0==(t=+t)?t:t>-1e-6&&t<1e-6?t+t*t/2:Math.exp(t)-1}:n},"2d83":function(t,e,n){"use strict";var i=n("387f");t.exports=function(t,e,n,s,r){var o=new Error(t);return i(o,e,n,s,r)}},"2d95":function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},"2dad":function(t,e){},"2de4":function(t,e){},"2e07":function(t,e){},"2e08":function(t,e,n){var i=n("9def"),s=n("9744"),r=n("be13");t.exports=function(t,e,n,o){var a=String(r(t)),c=a.length,l=void 0===n?" ":String(n),u=i(e);if(u<=c||""==l)return a;var h=u-c,d=s.call(l,Math.ceil(h/l.length));return d.length>h&&(d=d.slice(0,h)),o?d+a:a+d}},"2e20":function(t,e){},"2e37":function(t,e,n){var i=n("5ca1");i(i.S,"Number",{EPSILON:Math.pow(2,-52)})},"2e67":function(t,e,n){"use strict";t.exports=function(t){return!(!t||!t.__CANCEL__)}},"2e93":function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var i=n("c965");const s=(t,e,n)=>{const i=e[n];if(void 0===i)throw t();return i},r=t=>(e,n,r,o=0)=>void 0===n?e.forEach(t=>t.disconnect()):"number"===typeof n?s(t,e,n).disconnect():Object(i["a"])(n)?void 0===r?e.forEach(t=>t.disconnect(n)):void 0===o?s(t,e,r).disconnect(n,0):s(t,e,r).disconnect(n,0,o):void 0===r?e.forEach(t=>t.disconnect(n)):s(t,e,r).disconnect(n,0)},"2ea4":function(t,e){},"2ed8":function(t,e){},"2f21":function(t,e,n){"use strict";var i=n("79e5");t.exports=function(t,e){return!!t&&i((function(){e?t.call(null,(function(){}),1):t.call(null)}))}},"2f22":function(t,e){},"2f70":function(t,e){},"2fb7":function(t,e){},"2fd1":function(t,e){},"2fdb":function(t,e,n){"use strict";var i=n("5ca1"),s=n("d2c8"),r="includes";i(i.P+i.F*n("5147")(r),"String",{includes:function(t){return!!~s(this,t,r).indexOf(t,arguments.length>1?arguments[1]:void 0)}})},"30b5":function(t,e,n){"use strict";var i=n("c532");function s(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}t.exports=function(t,e,n){if(!e)return t;var r;if(n)r=n(e);else if(i.isURLSearchParams(e))r=e.toString();else{var o=[];i.forEach(e,(function(t,e){null!==t&&"undefined"!==typeof t&&(i.isArray(t)?e+="[]":t=[t],i.forEach(t,(function(t){i.isDate(t)?t=t.toISOString():i.isObject(t)&&(t=JSON.stringify(t)),o.push(s(e)+"="+s(t))})))})),r=o.join("&")}if(r){var a=t.indexOf("#");-1!==a&&(t=t.slice(0,a)),t+=(-1===t.indexOf("?")?"?":"&")+r}return t}},"30bf":function(t,e){},"31f4":function(t,e){t.exports=function(t,e,n){var i=void 0===n;switch(e.length){case 0:return i?t():t.call(n);case 1:return i?t(e[0]):t.call(n,e[0]);case 2:return i?t(e[0],e[1]):t.call(n,e[0],e[1]);case 3:return i?t(e[0],e[1],e[2]):t.call(n,e[0],e[1],e[2]);case 4:return i?t(e[0],e[1],e[2],e[3]):t.call(n,e[0],e[1],e[2],e[3])}return t.apply(n,e)}},3257:function(t,e){},"32d7":function(t,e,n){var i=n("5ca1");i(i.S,"Math",{clz32:function(t){return(t>>>=0)?31-Math.floor(Math.log(t+.5)*Math.LOG2E):32}})},"32e9":function(t,e,n){var i=n("86cc"),s=n("4630");t.exports=n("9e1e")?function(t,e,n){return i.f(t,e,s(1,n))}:function(t,e,n){return t[e]=n,t}},3331:function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));const i=t=>null===t?null:t.hasOwnProperty("AudioBuffer")?t.AudioBuffer:null},"33a4":function(t,e,n){var i=n("84f2"),s=n("2b4c")("iterator"),r=Array.prototype;t.exports=function(t){return void 0!==t&&(i.Array===t||r[s]===t)}},"34ef":function(t,e,n){n("ec30")("Uint8",1,(function(t){return function(e,n,i){return t(this,e,n,i)}}))},3555:function(t,e){},"359c":function(t,e){},3673:function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var i=n("049b");const s={numberOfChannels:1},r=(t,e,n,r,o)=>class extends r{constructor(e){const{length:r,numberOfChannels:o,sampleRate:a}={...s,...e},c=n(o,r,a);t(i["a"],()=>Object(i["a"])(c))||c.addEventListener("statechange",(()=>{let t=0;const e=n=>{"running"===this._state&&(t>0?(c.removeEventListener("statechange",e),n.stopImmediatePropagation(),this._waitForThePromiseToSettle(n)):t+=1)};return e})()),super(c,o),this._length=r,this._nativeOfflineAudioContext=c,this._state=null}get length(){return void 0===this._nativeOfflineAudioContext.length?this._length:this._nativeOfflineAudioContext.length}get state(){return null===this._state?this._nativeOfflineAudioContext.state:this._state}startRendering(){return"running"===this._state?Promise.reject(e()):(this._state="running",o(this.destination,this._nativeOfflineAudioContext).then(t=>(this._state=null,t)).catch(t=>{throw this._state=null,t}))}_waitForThePromiseToSettle(t){null===this._state?this._nativeOfflineAudioContext.dispatchEvent(t):setTimeout(()=>this._waitForThePromiseToSettle(t))}}},"36bd":function(t,e,n){"use strict";var i=n("4bf8"),s=n("77f1"),r=n("9def");t.exports=function(t){var e=i(this),n=r(e.length),o=arguments.length,a=s(o>1?arguments[1]:void 0,n),c=o>2?arguments[2]:void 0,l=void 0===c?n:s(c,n);while(l>a)e[a++]=t;return e}},3707:function(t,e){},3738:function(t,e){},3797:function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));const i=(t,e)=>(n,i,s)=>{if(null===e)throw new Error("Missing the native OfflineAudioContext constructor.");try{return new e(n,i,s)}catch(r){if("IndexSizeError"===r.name||"SyntaxError"===r.name)throw t();throw r}}},"37b4":function(t,e){},"37c1":function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));const i=()=>"undefined"===typeof window?null:window},"37c8":function(t,e,n){e.f=n("2b4c")},"37e2":function(t,e){},"37e5":function(t,e){},"382c":function(t,e){},"383e":function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return s}));const i=-34028234663852886e22,s=-i},3846:function(t,e,n){n("9e1e")&&"g"!=/./g.flags&&n("86cc").f(RegExp.prototype,"flags",{configurable:!0,get:n("0bfb")})},"386b":function(t,e,n){var i=n("5ca1"),s=n("79e5"),r=n("be13"),o=/"/g,a=function(t,e,n,i){var s=String(r(t)),a="<"+e;return""!==n&&(a+=" "+n+'="'+String(i).replace(o,""")+'"'),a+">"+s+""};t.exports=function(t,e){var n={};n[t]=e(a),i(i.P+i.F*s((function(){var e=""[t]('"');return e!==e.toLowerCase()||e.split('"').length>3})),"String",n)}},"386d":function(t,e,n){"use strict";var i=n("cb7c"),s=n("83a1"),r=n("5f1b");n("214f")("search",1,(function(t,e,n,o){return[function(n){var i=t(this),s=void 0==n?void 0:n[e];return void 0!==s?s.call(n,i):new RegExp(n)[e](String(i))},function(t){var e=o(n,t,this);if(e.done)return e.value;var a=i(t),c=String(this),l=a.lastIndex;s(l,0)||(a.lastIndex=0);var u=r(a,c);return s(a.lastIndex,l)||(a.lastIndex=l),null===u?-1:u.index}]}))},"387e":function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var i=n("5b43"),s=n("cd00");const r=t=>{const e=t.numberOfOutputs;Object.defineProperty(t,"channelCount",{get:()=>e,set:t=>{if(t!==e)throw Object(s["a"])()}}),Object.defineProperty(t,"channelCountMode",{get:()=>"explicit",set:t=>{if("explicit"!==t)throw Object(s["a"])()}}),Object.defineProperty(t,"channelInterpretation",{get:()=>"discrete",set:t=>{if("discrete"!==t)throw Object(s["a"])()}})},o=t=>(e,n)=>{const s=t(e,t=>t.createChannelSplitter(n.numberOfOutputs));return Object(i["a"])(s,n),r(s),s}},"387f":function(t,e,n){"use strict";t.exports=function(t,e,n,i,s){return t.config=e,n&&(t.code=n),t.request=i,t.response=s,t.isAxiosError=!0,t.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},t}},3895:function(t,e){},"38e4":function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var i=n("752e"),s=n("d057");const r=t=>Object(s["a"])(i["e"],t)},"38e6":function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));const i=t=>(e,n)=>{t(e).delete(n)}},"38fd":function(t,e,n){var i=n("69a8"),s=n("4bf8"),r=n("613b")("IE_PROTO"),o=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=s(t),i(t,r)?t[r]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?o:null}},"391d":function(t,e){},3934:function(t,e,n){"use strict";var i=n("c532");t.exports=i.isStandardBrowserEnv()?function(){var t,e=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function s(t){var i=t;return e&&(n.setAttribute("href",i),i=n.href),n.setAttribute("href",i),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return t=s(window.location.href),function(e){var n=i.isString(e)?s(e):e;return n.protocol===t.protocol&&n.host===t.host}}():function(){return function(){return!0}}()},3983:function(t,e){},"39b7":function(t,e){},"3a72":function(t,e,n){var i=n("7726"),s=n("8378"),r=n("2d00"),o=n("37c8"),a=n("86cc").f;t.exports=function(t){var e=s.Symbol||(s.Symbol=r?{}:i.Symbol||{});"_"==t.charAt(0)||t in e||a(e,t,{value:o.f(t)})}},"3adc":function(t,e){},"3af1":function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var i=n("a8ce");const s=(t,e,n,s,r,o,a,c,l)=>class extends t{constructor(t={}){if(null===l)throw new Error("Missing the native AudioContext constructor.");const e=new l(t);if(null===e)throw s();if(!Object(i["a"])(t.latencyHint))throw new TypeError(`The provided value '${t.latencyHint}' is not a valid enum value of type AudioContextLatencyCategory.`);if(void 0!==t.sampleRate&&e.sampleRate!==t.sampleRate)throw n();super(e,2);const{latencyHint:r}=t,{sampleRate:o}=e;if(this._baseLatency="number"===typeof e.baseLatency?e.baseLatency:"balanced"===r?512/o:"interactive"===r||void 0===r?256/o:"playback"===r?1024/o:128*Math.max(2,Math.min(128,Math.round(r*o/128)))/o,this._nativeAudioContext=e,this._state=null,"running"===e.state){this._state="suspended";const t=()=>{"suspended"===this._state&&(this._state=null),e.removeEventListener("statechange",t)};e.addEventListener("statechange",t)}}get baseLatency(){return this._baseLatency}get state(){return null!==this._state?this._state:this._nativeAudioContext.state}close(){return"closed"===this.state?this._nativeAudioContext.close().then(()=>{throw e()}):("suspended"===this._state&&(this._state=null),this._nativeAudioContext.close())}createMediaElementSource(t){return new r(this,{mediaElement:t})}createMediaStreamDestination(){return new o(this)}createMediaStreamSource(t){return new a(this,{mediaStream:t})}createMediaStreamTrackSource(t){return new c(this,{mediaStreamTrack:t})}resume(){return"suspended"===this._state?new Promise((t,e)=>{const n=()=>{this._nativeAudioContext.removeEventListener("statechange",n),"running"===this._nativeAudioContext.state?t():this.resume().then(t,e)};this._nativeAudioContext.addEventListener("statechange",n)}):this._nativeAudioContext.resume().catch(t=>{if(void 0===t||15===t.code)throw e();throw t})}suspend(){return this._nativeAudioContext.suspend().catch(t=>{if(void 0===t)throw e();throw t})}}},"3b2b":function(t,e,n){var i=n("7726"),s=n("5dbc"),r=n("86cc").f,o=n("9093").f,a=n("aae3"),c=n("0bfb"),l=i.RegExp,u=l,h=l.prototype,d=/a/g,f=/a/g,p=new l(d)!==d;if(n("9e1e")&&(!p||n("79e5")((function(){return f[n("2b4c")("match")]=!1,l(d)!=d||l(f)==f||"/a/i"!=l(d,"i")})))){l=function(t,e){var n=this instanceof l,i=a(t),r=void 0===e;return!n&&i&&t.constructor===l&&r?t:s(p?new u(i&&!r?t.source:t,e):u((i=t instanceof l)?t.source:t,i&&r?c.call(t):e),n?this:h,l)};for(var m=function(t){t in l||r(l,t,{configurable:!0,get:function(){return u[t]},set:function(e){u[t]=e}})},g=o(u),b=0;g.length>b;)m(g[b++]);h.constructor=l,l.prototype=h,n("2aba")(i,"RegExp",l)}n("7a56")("RegExp")},"3b7d":function(t,e){},"3b96":function(t,e,n){"use strict";var i=n("f16d"),s=n("b0a5"),r=n("2c92"),o=n("7f8d"),a=n("9e1f");function c(t,e,n){return a(o(r(s(i(t,e,n)))))}t.exports&&(t.exports=c),"undefined"!==typeof window&&(window.SamplePlayer=c)},"3bbf":function(t,e){},"3c0a":function(t,e){},"3c28":function(t,e){},"3c35":function(t,e){},"3c84":function(t,e){},"3ca5":function(t,e,n){var i=n("7726").parseInt,s=n("aa77").trim,r=n("fdef"),o=/^[-+]?0[xX]/;t.exports=8!==i(r+"08")||22!==i(r+"0x16")?function(t,e){var n=s(String(t),3);return i(n,e>>>0||(o.test(n)?16:10))}:i},"3cf6":function(t,e){},"3d55":function(t,e){},"3d86":function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var i=n("e190");const s=(t,e,n,s,r)=>()=>{const o=new WeakMap;let a=null,c=null;const l=async(l,u,h)=>{let d=n(l);const f=Object(i["a"])(d,u);if(!f){const t={channelCount:d.channelCount,channelCountMode:d.channelCountMode,channelInterpretation:d.channelInterpretation,offset:d.offset.value};d=e(u,t),null!==a&&d.start(a),null!==c&&d.stop(c)}return o.set(u,d),f?await t(u,l.offset,d.offset,h):await s(u,l.offset,d.offset,h),await r(l,u,d,h),d};return{set start(t){a=t},set stop(t){c=t},render(t,e,n){const i=o.get(e);return void 0!==i?Promise.resolve(i):l(t,e,n)}}}},"3dcf":function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));const i=t=>{if(null===t)return!1;const e=t.length;return e%2!==0?0!==t[Math.floor(e/2)]:t[e/2-1]+t[e/2]!==0}},"3ee3":function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var i=n("5b43");const s=(t,e)=>(n,s)=>{const r=t(n,t=>t.createChannelMerger(s.numberOfInputs));return 1!==r.channelCount&&"explicit"!==r.channelCountMode&&e(n,r),Object(i["a"])(r,s),r}},"3f50":function(t,e){},4034:function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));const i=(t,e,n)=>class extends t{constructor(t,i){const s=n(t),r=e(s,i);super(t,!0,r,null)}}},4107:function(t,e){},4114:function(t,e,n){"use strict";function i(t,e,n,i,s){if("function"===typeof t.copyFromChannel)0===e[n].byteLength&&(e[n]=new Float32Array(128)),t.copyFromChannel(e[n],i,s);else{const r=t.getChannelData(i);if(0===e[n].byteLength)e[n]=r.slice(s,s+128);else{const t=new Float32Array(r.buffer,s*Float32Array.BYTES_PER_ELEMENT,128);e[n].set(t)}}}n.d(e,"a",(function(){return i}))},4149:function(t,e){},4156:function(t,e){},4163:function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));const i=(t,e)=>n=>{const i=t.get(n);return e(i)||e(n)}},"418b":function(t,e){},"418bb":function(t,e){},"41a0":function(t,e,n){"use strict";var i=n("2aeb"),s=n("4630"),r=n("7f20"),o={};n("32e9")(o,n("2b4c")("iterator"),(function(){return this})),t.exports=function(t,e,n){t.prototype=i(o,{next:s(1,n)}),r(t,e+" Iterator")}},4238:function(t,e){},"424a":function(t,e){},"42a4":function(t,e){},"42ee":function(t,e){},"43f1":function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));const i=t=>()=>{if(null===t)return Promise.resolve(!1);const e=new t(1,1,44100),n=e.createBuffer(1,1,e.sampleRate),i=e.createBufferSource();return n.getChannelData(0)[0]=1,i.buffer=n,i.start(0,0,0),i.connect(e.destination),new Promise(t=>{e.oncomplete=({renderedBuffer:e})=>{t(0===e.getChannelData(0)[0])},e.startRendering()})}},"43f2":function(t,e){},4457:function(t,e){},4504:function(t,e,n){"use strict";var i=n("5ca1"),s=n("4bf8"),r=n("d8e8"),o=n("86cc");n("9e1e")&&i(i.P+n("c5b4"),"Object",{__defineGetter__:function(t,e){o.f(s(this),t,{get:r(e),enumerable:!0,configurable:!0})}})},4508:function(t,e){},4561:function(t,e){},"456d":function(t,e,n){var i=n("4bf8"),s=n("0d58");n("5eda")("keys",(function(){return function(t){return s(i(t))}}))},4588:function(t,e){var n=Math.ceil,i=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?i:n)(t)}},4630:function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},"465e":function(t,e){},4661:function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));const i=(t,e)=>n=>{n.copyFromChannel=(i,s,r=0)=>{const o=t(r),a=t(s);if(a>=n.numberOfChannels)throw e();const c=n.length,l=n.getChannelData(a),u=i.length;for(let t=o<0?-o:0;t+o{const o=t(r),a=t(s);if(a>=n.numberOfChannels)throw e();const c=n.length,l=n.getChannelData(a),u=i.length;for(let t=o<0?-o:0;t+o{const a=16385,c=new Float32Array([1,1]),l=Math.PI/2,u={channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete"},h={...u,oversample:"none"},d=(t,e,i,r)=>{const o=new Float32Array(a),d=new Float32Array(a);for(let n=0;n{const d=new Float32Array(a),f=new Float32Array(a),p=new Float32Array(a),m=new Float32Array(a),g=Math.floor(a/2);for(let e=0;eg){const t=(e-g)/(a-1-g)*l;d[e]=Math.cos(t),f[e]=Math.sin(t),p[e]=0,m[e]=1}else{const t=e/(a-1-g)*l;d[e]=1,f[e]=0,p[e]=Math.cos(t),m[e]=Math.sin(t)}const b=e(t,{channelCount:2,channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:2}),v=n(t,{...u,gain:0}),y=s(t,{...h,curve:d}),S=n(t,{...u,gain:0}),x=s(t,{...h,curve:f}),_=s(t,{...h,curve:c}),w=n(t,{...u,gain:0}),E=s(t,{...h,curve:p}),T=n(t,{...u,gain:0}),C=s(t,{...h,curve:m});return{connectGraph(){i.connect(b),i.connect(_.inputs[0]),b.connect(v,1),b.connect(S,1),b.connect(w,1),b.connect(T,1),_.connect(r),r.connect(y.inputs[0]),r.connect(x.inputs[0]),r.connect(E.inputs[0]),r.connect(C.inputs[0]),y.connect(v.gain),x.connect(S.gain),E.connect(w.gain),C.connect(T.gain),v.connect(o,0,0),w.connect(o,0,0),S.connect(o,0,1),T.connect(o,0,1)},disconnectGraph(){i.disconnect(b),i.disconnect(_.inputs[0]),b.disconnect(v,1),b.disconnect(S,1),b.disconnect(w,1),b.disconnect(T,1),_.disconnect(r),r.disconnect(y.inputs[0]),r.disconnect(x.inputs[0]),r.disconnect(E.inputs[0]),r.disconnect(C.inputs[0]),y.disconnect(v.gain),x.disconnect(S.gain),E.disconnect(w.gain),C.disconnect(T.gain),v.disconnect(o,0,0),w.disconnect(o,0,0),S.disconnect(o,0,1),T.disconnect(o,0,1)}}},p=(t,e,n,i,s)=>{if(1===e)return d(t,n,i,s);if(2===e)return f(t,n,i,s);throw r()};return(e,{channelCount:s,channelCountMode:a,pan:c,...l})=>{if("max"===a)throw r();const u=t(e,{...l,channelCount:1,channelCountMode:a,numberOfInputs:2}),h=n(e,{...l,channelCount:s,channelCountMode:a,gain:1}),d=n(e,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:c});let{connectGraph:f,disconnectGraph:m}=p(e,s,h,d,u);Object.defineProperty(d.gain,"defaultValue",{get:()=>0});const g={get bufferSize(){},get channelCount(){return h.channelCount},set channelCount(t){h.channelCount!==t&&(b&&m(),({connectGraph:f,disconnectGraph:m}=p(e,t,h,d,u)),b&&f()),h.channelCount=t},get channelCountMode(){return h.channelCountMode},set channelCountMode(t){if("clamped-max"===t||"max"===t)throw r();h.channelCountMode=t},get channelInterpretation(){return h.channelInterpretation},set channelInterpretation(t){h.channelInterpretation=t},get context(){return h.context},get inputs(){return[h]},get numberOfInputs(){return h.numberOfInputs},get numberOfOutputs(){return h.numberOfOutputs},get pan(){return d.gain},addEventListener(...t){return h.addEventListener(t[0],t[1],t[2])},dispatchEvent(...t){return h.dispatchEvent(t[0])},removeEventListener(...t){return h.removeEventListener(t[0],t[1],t[2])}};let b=!1;const v=()=>{f(),b=!0},y=()=>{m(),b=!1};return o(Object(i["a"])(g,u),v,y)}}},4779:function(t,e){},4795:function(t,e,n){var i=n("7726"),s=n("5ca1"),r=n("a25f"),o=[].slice,a=/MSIE .\./.test(r),c=function(t){return function(e,n){var i=arguments.length>2,s=!!i&&o.call(arguments,2);return t(i?function(){("function"==typeof e?e:Function(e)).apply(this,s)}:e,n)}};s(s.G+s.B+s.F*a,{setTimeout:c(i.setTimeout),setInterval:c(i.setInterval)})},"47ce":function(t,e){},"47e4":function(t,e){},"483e":function(t,e){},"48a7":function(t,e){},"48c0":function(t,e,n){"use strict";n("386b")("bold",(function(t){return function(){return t(this,"b","","")}}))},"48fc":function(t,e){},4917:function(t,e,n){"use strict";var i=n("cb7c"),s=n("9def"),r=n("0390"),o=n("5f1b");n("214f")("match",1,(function(t,e,n,a){return[function(n){var i=t(this),s=void 0==n?void 0:n[e];return void 0!==s?s.call(n,i):new RegExp(n)[e](String(i))},function(t){var e=a(n,t,this);if(e.done)return e.value;var c=i(t),l=String(this);if(!c.global)return o(c,l);var u=c.unicode;c.lastIndex=0;var h,d=[],f=0;while(null!==(h=o(c,l))){var p=String(h[0]);d[f]=p,""===p&&(c.lastIndex=r(l,s(c.lastIndex),u)),f++}return 0===f?null:d}]}))},4919:function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));const i=t=>e=>{const n=t(e);if(null===n.renderer)throw new Error("Missing the renderer of the given AudioParam in the audio graph.");return n.renderer}},4928:function(t,e){},4951:function(t,e){},"49aa":function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));const i=t=>(e,n)=>{const i=t(e,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}),s=e.createBuffer(1,2,e.sampleRate);return i.buffer=s,i.loop=!0,i.connect(n),i.start(),()=>{i.stop(),i.disconnect(n)}}},"4a2b":function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var i=n("e190");const s=(t,e,n,s,r)=>()=>{const o=new WeakMap,a=async(a,c,l)=>{let u=n(a);const h=Object(i["a"])(u,c);if(!h){const t={attack:u.attack.value,channelCount:u.channelCount,channelCountMode:u.channelCountMode,channelInterpretation:u.channelInterpretation,knee:u.knee.value,ratio:u.ratio.value,release:u.release.value,threshold:u.threshold.value};u=e(c,t)}return o.set(c,u),h?(await t(c,a.attack,u.attack,l),await t(c,a.knee,u.knee,l),await t(c,a.ratio,u.ratio,l),await t(c,a.release,u.release,l),await t(c,a.threshold,u.threshold,l)):(await s(c,a.attack,u.attack,l),await s(c,a.knee,u.knee,l),await s(c,a.ratio,u.ratio,l),await s(c,a.release,u.release,l),await s(c,a.threshold,u.threshold,l)),await r(a,c,u,l),u};return{render(t,e,n){const i=o.get(e);return void 0!==i?Promise.resolve(i):a(t,e,n)}}}},"4a59":function(t,e,n){var i=n("9b43"),s=n("1fa8"),r=n("33a4"),o=n("cb7c"),a=n("9def"),c=n("27ee"),l={},u={};e=t.exports=function(t,e,n,h,d){var f,p,m,g,b=d?function(){return t}:c(t),v=i(n,h,e?2:1),y=0;if("function"!=typeof b)throw TypeError(t+" is not iterable!");if(r(b)){for(f=a(t.length);f>y;y++)if(g=e?v(o(p=t[y])[0],p[1]):v(t[y]),g===l||g===u)return g}else for(m=b.call(t);!(p=m.next()).done;)if(g=s(m,v,p.value,e),g===l||g===u)return g};e.BREAK=l,e.RETURN=u},"4a7b":function(t,e,n){"use strict";var i=n("c532");t.exports=function(t,e){e=e||{};var n={},s=["url","method","data"],r=["headers","auth","proxy","params"],o=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],a=["validateStatus"];function c(t,e){return i.isPlainObject(t)&&i.isPlainObject(e)?i.merge(t,e):i.isPlainObject(e)?i.merge({},e):i.isArray(e)?e.slice():e}function l(s){i.isUndefined(e[s])?i.isUndefined(t[s])||(n[s]=c(void 0,t[s])):n[s]=c(t[s],e[s])}i.forEach(s,(function(t){i.isUndefined(e[t])||(n[t]=c(void 0,e[t]))})),i.forEach(r,l),i.forEach(o,(function(s){i.isUndefined(e[s])?i.isUndefined(t[s])||(n[s]=c(void 0,t[s])):n[s]=c(void 0,e[s])})),i.forEach(a,(function(i){i in e?n[i]=c(t[i],e[i]):i in t&&(n[i]=c(void 0,t[i]))}));var u=s.concat(r).concat(o).concat(a),h=Object.keys(t).concat(Object.keys(e)).filter((function(t){return-1===u.indexOf(t)}));return i.forEach(h,l),n}},"4bf8":function(t,e,n){var i=n("be13");t.exports=function(t){return Object(i(t))}},"4ca8":function(t,e){},"4cb5":function(t,e){},"4dc3":function(t,e){},"4dda":function(t,e,n){n("ec30")("Float64",8,(function(t){return function(e,n,i){return t(this,e,n,i)}}))},"4de4":function(t,e){},"4df9":function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var i=n("0bf9"),s=n("5b43");const r=t=>(e,n)=>{const r=t(e,t=>t.createDelay(n.maxDelayTime));return Object(s["a"])(r,n),Object(i["a"])(r,n,"delayTime"),r}},"4e79":function(t,e){},"4e8d":function(t,e){},"4ecb":function(t,e){},"4ee4":function(t,e){},"4f24":function(t,e){},"4f7f":function(t,e,n){"use strict";var i=n("c26b"),s=n("b39a"),r="Set";t.exports=n("e0b8")(r,(function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}}),{add:function(t){return i.def(s(this,r),t=0===t?0:t,t)}},i)},5046:function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));class i{constructor(t){this._map=new Map(t)}get size(){return this._map.size}entries(){return this._map.entries()}forEach(t,e=null){return this._map.forEach((n,i)=>t.call(e,n,i,this))}get(t){return this._map.get(t)}has(t){return this._map.has(t)}keys(){return this._map.keys()}values(){return this._map.values()}}},"504c":function(t,e,n){var i=n("9e1e"),s=n("0d58"),r=n("6821"),o=n("52a7").f;t.exports=function(t){return function(e){var n,a=r(e),c=s(a),l=c.length,u=0,h=[];while(l>u)n=c[u++],i&&!o.call(a,n)||h.push(t?[n,a[n]]:a[n]);return h}}},5055:function(t,e){},"50a7":function(t,e){},5147:function(t,e,n){var i=n("2b4c")("match");t.exports=function(t){var e=/./;try{"/./"[t](e)}catch(n){try{return e[i]=!1,!"/./"[t](e)}catch(s){}}return!0}},5181:function(t,e){},5191:function(t,e){},"51df":function(t,e){},"51fe":function(t,e){},"520a":function(t,e,n){"use strict";var i=n("0bfb"),s=RegExp.prototype.exec,r=String.prototype.replace,o=s,a="lastIndex",c=function(){var t=/a/,e=/b*/g;return s.call(t,"a"),s.call(e,"a"),0!==t[a]||0!==e[a]}(),l=void 0!==/()??/.exec("")[1],u=c||l;u&&(o=function(t){var e,n,o,u,h=this;return l&&(n=new RegExp("^"+h.source+"$(?!\\s)",i.call(h))),c&&(e=h[a]),o=s.call(h,t),c&&o&&(h[a]=h.global?o.index+o[0].length:e),l&&o&&o.length>1&&r.call(o[0],n,(function(){for(u=1;uclass extends t{constructor(t,s=o){const r=l(t),a={...o,...s},h=c(r,a),d=u(r),f=d?e():null;super(t,!1,h,f),this._audioBufferSourceNodeRenderer=f,this._isBufferNullified=!1,this._isBufferSet=null!==s.buffer&&void 0!==s.buffer,this._nativeAudioBufferSourceNode=h,this._onended=null,this._playbackRate=n(this,d,h.playbackRate,i["b"],i["a"])}get buffer(){return this._isBufferNullified?null:this._nativeAudioBufferSourceNode.buffer}set buffer(t){try{this._nativeAudioBufferSourceNode.buffer=t}catch(e){if(null!==t||17!==e.code)throw e;if(null!==this._nativeAudioBufferSourceNode.buffer){const t=this._nativeAudioBufferSourceNode.buffer,e=t.numberOfChannels;for(let n=0;n{this._nativeAudioBufferSourceNode.removeEventListener("ended",t),setTimeout(()=>Object(r["a"])(this),1e3)};this._nativeAudioBufferSourceNode.addEventListener("ended",t)}}stop(t=0){this._nativeAudioBufferSourceNode.stop(t),null!==this._audioBufferSourceNodeRenderer&&(this._audioBufferSourceNodeRenderer.stop=t)}}},"52a7":function(t,e){e.f={}.propertyIsEnumerable},"52ab":function(t,e){},"52f4":function(t,e){},"536b":function(t,e,n){var i=n("5ca1"),s=Math.asinh;function r(t){return isFinite(t=+t)&&0!=t?t<0?-r(-t):Math.log(t+Math.sqrt(t*t+1)):t}i(i.S+i.F*!(s&&1/s(0)>0),"Math",{asinh:r})},"53b3":function(t,e){},"545f":function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));const i=t=>{t.stop=(e=>(n=0)=>{if(n<0)throw new RangeError("The parameter can't be negative.");e.call(t,n)})(t.stop)}},5477:function(t,e){},"54a9":function(t,e){function n(t){var e=t.createGain(),n=e._voltage=r(t),s=o(n),a=o(n),c=o(n);return e._startAmount=o(a),e._endAmount=o(c),e._multiplier=o(s),e._multiplier.connect(e),e._startAmount.connect(e),e._endAmount.connect(e),e.value=s.gain,e.startValue=a.gain,e.endValue=c.gain,e.startValue.value=0,e.endValue.value=0,Object.defineProperties(e,i),e}t.exports=n;var i={attack:{value:0,writable:!0},decay:{value:0,writable:!0},sustain:{value:1,writable:!0},release:{value:0,writable:!0},getReleaseDuration:{value:function(){return this.release}},start:{value:function(t){var e=this._multiplier.gain,n=this._startAmount.gain,i=this._endAmount.gain;this._voltage.start(t),this._decayFrom=this._decayFrom=t+this.attack,this._startedAt=t;var s=this.sustain;e.cancelScheduledValues(t),n.cancelScheduledValues(t),i.cancelScheduledValues(t),i.setValueAtTime(0,t),this.attack?(e.setValueAtTime(0,t),e.linearRampToValueAtTime(1,t+this.attack),n.setValueAtTime(1,t),n.linearRampToValueAtTime(0,t+this.attack)):(e.setValueAtTime(1,t),n.setValueAtTime(0,t)),this.decay&&e.setTargetAtTime(s,this._decayFrom,a(this.decay))}},stop:{value:function(t,e){e&&(t-=this.release);var n=t+this.release;if(this.release){var i=this._multiplier.gain,s=this._startAmount.gain,r=this._endAmount.gain;i.cancelScheduledValues(t),s.cancelScheduledValues(t),r.cancelScheduledValues(t);var o=a(this.release);if(this.attack&&t=e&&(l=e),l}},"551c":function(t,e,n){"use strict";var i,s,r,o,a=n("2d00"),c=n("7726"),l=n("9b43"),u=n("23c6"),h=n("5ca1"),d=n("d3f4"),f=n("d8e8"),p=n("f605"),m=n("4a59"),g=n("ebd6"),b=n("1991").set,v=n("8079")(),y=n("a5b8"),S=n("9c80"),x=n("a25f"),_=n("bcaa"),w="Promise",E=c.TypeError,T=c.process,C=T&&T.versions,M=C&&C.v8||"",P=c[w],A="process"==u(T),I=function(){},L=s=y.f,O=!!function(){try{var t=P.resolve(1),e=(t.constructor={})[n("2b4c")("species")]=function(t){t(I,I)};return(A||"function"==typeof PromiseRejectionEvent)&&t.then(I)instanceof e&&0!==M.indexOf("6.6")&&-1===x.indexOf("Chrome/66")}catch(i){}}(),k=function(t){var e;return!(!d(t)||"function"!=typeof(e=t.then))&&e},R=function(t,e){if(!t._n){t._n=!0;var n=t._c;v((function(){var i=t._v,s=1==t._s,r=0,o=function(e){var n,r,o,a=s?e.ok:e.fail,c=e.resolve,l=e.reject,u=e.domain;try{a?(s||(2==t._h&&V(t),t._h=1),!0===a?n=i:(u&&u.enter(),n=a(i),u&&(u.exit(),o=!0)),n===e.promise?l(E("Promise-chain cycle")):(r=k(n))?r.call(n,c,l):c(n)):l(i)}catch(h){u&&!o&&u.exit(),l(h)}};while(n.length>r)o(n[r++]);t._c=[],t._n=!1,e&&!t._h&&N(t)}))}},N=function(t){b.call(c,(function(){var e,n,i,s=t._v,r=D(t);if(r&&(e=S((function(){A?T.emit("unhandledRejection",s,t):(n=c.onunhandledrejection)?n({promise:t,reason:s}):(i=c.console)&&i.error&&i.error("Unhandled promise rejection",s)})),t._h=A||D(t)?2:1),t._a=void 0,r&&e.e)throw e.v}))},D=function(t){return 1!==t._h&&0===(t._a||t._c).length},V=function(t){b.call(c,(function(){var e;A?T.emit("rejectionHandled",t):(e=c.onrejectionhandled)&&e({promise:t,reason:t._v})}))},B=function(t){var e=this;e._d||(e._d=!0,e=e._w||e,e._v=t,e._s=2,e._a||(e._a=e._c.slice()),R(e,!0))},F=function(t){var e,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===t)throw E("Promise can't be resolved itself");(e=k(t))?v((function(){var i={_w:n,_d:!1};try{e.call(t,l(F,i,1),l(B,i,1))}catch(s){B.call(i,s)}})):(n._v=t,n._s=1,R(n,!1))}catch(i){B.call({_w:n,_d:!1},i)}}};O||(P=function(t){p(this,P,w,"_h"),f(t),i.call(this);try{t(l(F,this,1),l(B,this,1))}catch(e){B.call(this,e)}},i=function(t){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},i.prototype=n("dcbc")(P.prototype,{then:function(t,e){var n=L(g(this,P));return n.ok="function"!=typeof t||t,n.fail="function"==typeof e&&e,n.domain=A?T.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&R(this,!1),n.promise},catch:function(t){return this.then(void 0,t)}}),r=function(){var t=new i;this.promise=t,this.resolve=l(F,t,1),this.reject=l(B,t,1)},y.f=L=function(t){return t===P||t===o?new r(t):s(t)}),h(h.G+h.W+h.F*!O,{Promise:P}),n("7f20")(P,w),n("7a56")(w),o=n("8378")[w],h(h.S+h.F*!O,w,{reject:function(t){var e=L(this),n=e.reject;return n(t),e.promise}}),h(h.S+h.F*(a||!O),w,{resolve:function(t){return _(a&&this===o?P:this,t)}}),h(h.S+h.F*!(O&&n("5cc5")((function(t){P.all(t)["catch"](I)}))),w,{all:function(t){var e=this,n=L(e),i=n.resolve,s=n.reject,r=S((function(){var n=[],r=0,o=1;m(t,!1,(function(t){var a=r++,c=!1;n.push(void 0),o++,e.resolve(t).then((function(t){c||(c=!0,n[a]=t,--o||i(n))}),s)})),--o||i(n)}));return r.e&&s(r.v),n.promise},race:function(t){var e=this,n=L(e),i=n.reject,s=S((function(){m(t,!1,(function(t){e.resolve(t).then(n.resolve,i)}))}));return s.e&&i(s.v),n.promise}})},5537:function(t,e,n){var i=n("8378"),s=n("7726"),r="__core-js_shared__",o=s[r]||(s[r]={});(t.exports=function(t,e){return o[t]||(o[t]=void 0!==e?e:{})})("versions",[]).push({version:i.version,mode:n("2d00")?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},"554c":function(t,e){},"55aa":function(t,e){},"55dd":function(t,e,n){"use strict";var i=n("5ca1"),s=n("d8e8"),r=n("4bf8"),o=n("79e5"),a=[].sort,c=[1,2,3];i(i.P+i.F*(o((function(){c.sort(void 0)}))||!o((function(){c.sort(null)}))||!n("2f21")(a)),"Array",{sort:function(t){return void 0===t?a.call(r(this)):a.call(r(this),s(t))}})},"565e":function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var i=n("aa59");const s=(t,e,n,s,r,o,a,c)=>{const l=[];return(u,h)=>n(u).render(u,h,l).then(()=>Promise.all(Array.from(s(h)).map(t=>n(t).render(t,h,l)))).then(()=>r(h)).then(n=>("function"!==typeof n.copyFromChannel?(a(n),Object(i["a"])(n)):e(o,()=>o(n))||c(n),t.add(n),n))}},5695:function(t,e,n){var i=n("5ca1"),s=n("77f1"),r=String.fromCharCode,o=String.fromCodePoint;i(i.S+i.F*(!!o&&1!=o.length),"String",{fromCodePoint:function(t){var e,n=[],i=arguments.length,o=0;while(i>o){if(e=+arguments[o++],s(e,1114111)!==e)throw RangeError(e+" is not a valid code point");n.push(e<65536?r(e):r(55296+((e-=65536)>>10),e%1024+56320))}return n.join("")}})},"56c5":function(t,e){},5739:function(t,e){},5758:function(t,e){},"57f0":function(t,e,n){var i=n("d3f4");n("5eda")("isSealed",(function(t){return function(e){return!i(e)||!!t&&t(e)}}))},5800:function(t,e){},"58a0":function(t,e){},"58a1":function(t,e){},"59e9":function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));const i=t=>"context"in t},"5a62":function(t,e){},"5a7f":function(t,e){},"5a99":function(t,e){},"5ad3":function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));const i=(t,e)=>(n,i,s)=>{const r=n.destination;if(r.channelCount!==i)try{r.channelCount=i}catch{}s&&"explicit"!==r.channelCountMode&&(r.channelCountMode="explicit"),0===r.maxChannelCount&&Object.defineProperty(r,"maxChannelCount",{value:i});const o=t(n,{channelCount:i,channelCountMode:r.channelCountMode,channelInterpretation:r.channelInterpretation,gain:1});return e(o,"channelCount",t=>()=>t.call(o),t=>e=>{t.call(o,e);try{r.channelCount=e}catch(n){if(e>r.maxChannelCount)throw n}}),e(o,"channelCountMode",t=>()=>t.call(o),t=>e=>{t.call(o,e),r.channelCountMode=e}),e(o,"channelInterpretation",t=>()=>t.call(o),t=>e=>{t.call(o,e),r.channelInterpretation=e}),Object.defineProperty(o,"maxChannelCount",{get:()=>r.maxChannelCount}),o.connect(r),o}},"5aef":function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));const i=(t,e,n)=>async(i,s,r,o)=>{const a=t(i),c=[...o,i];await Promise.all(a.activeInputs.map((t,o)=>Array.from(t).filter(([t])=>!c.includes(t)).map(async([t,a])=>{const l=e(t),u=await l.render(t,s,c),h=i.context.destination;n(t)||i===h&&n(i)||u.connect(r,a,o)})).reduce((t,e)=>[...t,...e],[]))}},"5b43":function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var i=n("180a");const s=(t,e)=>{Object(i["a"])(t,e,"channelCount"),Object(i["a"])(t,e,"channelCountMode"),Object(i["a"])(t,e,"channelInterpretation")}},"5b94":function(t,e){},"5bb6":function(t,e){},"5c3a":function(t,e){},"5c79":function(t,e){},"5ca1":function(t,e,n){var i=n("7726"),s=n("8378"),r=n("32e9"),o=n("2aba"),a=n("9b43"),c="prototype",l=function(t,e,n){var u,h,d,f,p=t&l.F,m=t&l.G,g=t&l.S,b=t&l.P,v=t&l.B,y=m?i:g?i[e]||(i[e]={}):(i[e]||{})[c],S=m?s:s[e]||(s[e]={}),x=S[c]||(S[c]={});for(u in m&&(n=e),n)h=!p&&y&&void 0!==y[u],d=(h?y:n)[u],f=v&&h?a(d,i):b&&"function"==typeof d?a(Function.call,d):d,y&&o(y,u,d,t&l.U),S[u]!=d&&r(S,u,f),b&&x[u]!=d&&(x[u]=d)};i.core=s,l.F=1,l.G=2,l.S=4,l.P=8,l.B=16,l.W=32,l.U=64,l.R=128,t.exports=l},"5cbe":function(t,e){},"5cc5":function(t,e,n){var i=n("2b4c")("iterator"),s=!1;try{var r=[7][i]();r["return"]=function(){s=!0},Array.from(r,(function(){throw 2}))}catch(o){}t.exports=function(t,e){if(!e&&!s)return!1;var n=!1;try{var r=[7],a=r[i]();a.next=function(){return{done:n=!0}},r[i]=function(){return a},t(r)}catch(o){}return n}},"5d24":function(t,e){},"5d45":function(t,e){},"5d55":function(t,e){},"5d98":function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));const i=(t,e,n,i)=>{for(const s of t)if(n(s)){if(i)return!1;throw Error("The set contains at least one similar element.")}return t.add(e),!0}},"5dbc":function(t,e,n){var i=n("d3f4"),s=n("8b97").set;t.exports=function(t,e,n){var r,o=e.constructor;return o!==n&&"function"==typeof o&&(r=o.prototype)!==n.prototype&&i(r)&&s&&s(t,r),t}},"5dd3":function(t,e){},"5df2":function(t,e,n){var i=n("5ca1"),s=n("d752");i(i.S+i.F*(Number.parseFloat!=s),"Number",{parseFloat:s})},"5df3":function(t,e,n){"use strict";var i=n("02f4")(!0);n("01f9")(String,"String",(function(t){this._t=String(t),this._i=0}),(function(){var t,e=this._t,n=this._i;return n>=e.length?{value:void 0,done:!0}:(t=i(e,n),this._i+=t.length,{value:t,done:!1})}))},"5ebd":function(t,e){},"5eda":function(t,e,n){var i=n("5ca1"),s=n("8378"),r=n("79e5");t.exports=function(t,e){var n=(s.Object||{})[t]||Object[t],o={};o[t]=e(n),i(i.S+i.F*r((function(){n(1)})),"Object",o)}},"5f02":function(t,e,n){"use strict";t.exports=function(t){return"object"===typeof t&&!0===t.isAxiosError}},"5f1b":function(t,e,n){"use strict";var i=n("23c6"),s=RegExp.prototype.exec;t.exports=function(t,e){var n=t.exec;if("function"===typeof n){var r=n.call(t,e);if("object"!==typeof r)throw new TypeError("RegExp exec method returned something other than an Object or null");return r}if("RegExp"!==i(t))throw new TypeError("RegExp#exec called on incompatible receiver");return s.call(t,e)}},"5f63":function(t,e){},"5faf":function(t,e){},6011:function(t,e){},6136:function(t,e){},"613b":function(t,e,n){var i=n("5537")("keys"),s=n("ca5a");t.exports=function(t){return i[t]||(i[t]=s(t))}},6154:function(t,e){},"618a":function(t,e){},6218:function(t,e){},6269:function(t,e){},"626a":function(t,e,n){var i=n("2d95");t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==i(t)?t.split(""):Object(t)}},"63d9":function(t,e,n){n("ec30")("Float32",4,(function(t){return function(e,n,i){return t(this,e,n,i)}}))},"63fe":function(t,e){},"643e":function(t,e,n){"use strict";var i=n("dcbc"),s=n("67ab").getWeak,r=n("cb7c"),o=n("d3f4"),a=n("f605"),c=n("4a59"),l=n("0a49"),u=n("69a8"),h=n("b39a"),d=l(5),f=l(6),p=0,m=function(t){return t._l||(t._l=new g)},g=function(){this.a=[]},b=function(t,e){return d(t.a,(function(t){return t[0]===e}))};g.prototype={get:function(t){var e=b(this,t);if(e)return e[1]},has:function(t){return!!b(this,t)},set:function(t,e){var n=b(this,t);n?n[1]=e:this.a.push([t,e])},delete:function(t){var e=f(this.a,(function(e){return e[0]===t}));return~e&&this.a.splice(e,1),!!~e}},t.exports={getConstructor:function(t,e,n,r){var l=t((function(t,i){a(t,l,e,"_i"),t._t=e,t._i=p++,t._l=void 0,void 0!=i&&c(i,n,t[r],t)}));return i(l.prototype,{delete:function(t){if(!o(t))return!1;var n=s(t);return!0===n?m(h(this,e))["delete"](t):n&&u(n,this._i)&&delete n[this._i]},has:function(t){if(!o(t))return!1;var n=s(t);return!0===n?m(h(this,e)).has(t):n&&u(n,this._i)}}),l},def:function(t,e,n){var i=s(r(e),!0);return!0===i?m(t).set(e,n):i[t._i]=n,t},ufstore:m}},"64ac":function(t,e){},"64be":function(t,e){},"64d5":function(t,e,n){"use strict";var i=n("5ca1"),s=n("4bf8"),r=n("6a99"),o=n("38fd"),a=n("11e9").f;n("9e1e")&&i(i.P+n("c5b4"),"Object",{__lookupSetter__:function(t){var e,n=s(this),i=r(t,!0);do{if(e=a(n,i))return e.set}while(n=o(n))}})},"650f":function(t,e){},6515:function(t,e){},"654e":function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));const i=t=>e=>{const n=t(e);if(null===n.renderer)throw new Error("Missing the renderer of the given AudioNode in the audio graph.");return n.renderer}},6567:function(t,e){},6598:function(t,e){},"65c6":function(t,e){},"65f3":function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));const i=(t,e)=>{const n=[];for(let i=0;i1?arguments[1]:void 0)}}),n("9c6c")("includes")},"67ab":function(t,e,n){var i=n("ca5a")("meta"),s=n("d3f4"),r=n("69a8"),o=n("86cc").f,a=0,c=Object.isExtensible||function(){return!0},l=!n("79e5")((function(){return c(Object.preventExtensions({}))})),u=function(t){o(t,i,{value:{i:"O"+ ++a,w:{}}})},h=function(t,e){if(!s(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!r(t,i)){if(!c(t))return"F";if(!e)return"E";u(t)}return t[i].i},d=function(t,e){if(!r(t,i)){if(!c(t))return!0;if(!e)return!1;u(t)}return t[i].w},f=function(t){return l&&p.NEED&&c(t)&&!r(t,i)&&u(t),t},p=t.exports={KEY:i,NEED:!1,fastKey:h,getWeak:d,onFreeze:f}},"67df":function(t,e){},6821:function(t,e,n){var i=n("626a"),s=n("be13");t.exports=function(t){return i(s(t))}},6915:function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));const i=t=>(e,n)=>t(e,t=>t.createMediaElementSource(n.mediaElement))},"69a8":function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},"69e5":function(t,e){},"6a5a":function(t,e){},"6a6f":function(t,e){},"6a99":function(t,e,n){var i=n("d3f4");t.exports=function(t,e){if(!i(t))return t;var n,s;if(e&&"function"==typeof(n=t.toString)&&!i(s=n.call(t)))return s;if("function"==typeof(n=t.valueOf)&&!i(s=n.call(t)))return s;if(!e&&"function"==typeof(n=t.toString)&&!i(s=n.call(t)))return s;throw TypeError("Can't convert object to primitive value")}},"6aa2":function(t,e,n){n("ec30")("Uint8",1,(function(t){return function(e,n,i){return t(this,e,n,i)}}),!0)},"6ab5":function(t,e){},"6b2f":function(t,e){},"6b54":function(t,e,n){"use strict";n("3846");var i=n("cb7c"),s=n("0bfb"),r=n("9e1e"),o="toString",a=/./[o],c=function(t){n("2aba")(RegExp.prototype,o,t,!0)};n("79e5")((function(){return"/a/b"!=a.call({source:"a",flags:"b"})}))?c((function(){var t=i(this);return"/".concat(t.source,"/","flags"in t?t.flags:!r&&t instanceof RegExp?s.call(t):void 0)})):a.name!=o&&c((function(){return a.call(this)}))},"6c1a":function(t,e,n){var i=n("5ca1"),s=n("2d5c"),r=Math.exp;i(i.S+i.F*n("79e5")((function(){return-2e-17!=!Math.sinh(-2e-17)})),"Math",{sinh:function(t){return Math.abs(t=+t)<1?(s(t)-s(-t))/2:(r(t-1)-r(-t-1))*(Math.E/2)}})},"6c37":function(t,e,n){"use strict";n("386b")("fontcolor",(function(t){return function(e){return t(this,"font","color",e)}}))},"6c69":function(t,e){function n(t,e){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(t)){var n=[],i=!0,s=!1,r=void 0;try{for(var o,a=t[Symbol.iterator]();!(i=(o=a.next()).done);i=!0)if(n.push(o.value),e&&n.length===e)break}catch(c){s=!0,r=c}finally{try{i||null==a["return"]||a["return"]()}finally{if(s)throw r}}return n}}t.exports=n},"6c7b":function(t,e,n){var i=n("5ca1");i(i.P,"Array",{fill:n("36bd")}),n("9c6c")("fill")},"6c7c":function(t,e){},"6c8d":function(t,e){},"6cc2":function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));const i=t=>null===t?null:t.hasOwnProperty("AudioWorkletNode")?t.AudioWorkletNode:null},"6ced":function(t,e){},"6d3d":function(t,e){},"6f2e":function(t,e){},"6f36":function(t,e){},"6f55":function(t,e){},"6f7b":function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));const i=(t,e)=>n=>t.has(n)||e(n)},"6fc3":function(t,e){},"70d4":function(t,e){function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}t.exports=n},7160:function(t,e){},"716e":function(t,e){},"719c":function(t,e){},7288:function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));const i=()=>{try{return new DOMException("","AbortError")}catch(t){return t.code=20,t.name="AbortError",t}}},7333:function(t,e,n){"use strict";var i=n("9e1e"),s=n("0d58"),r=n("2621"),o=n("52a7"),a=n("4bf8"),c=n("626a"),l=Object.assign;t.exports=!l||n("79e5")((function(){var t={},e={},n=Symbol(),i="abcdefghijklmnopqrst";return t[n]=7,i.split("").forEach((function(t){e[t]=t})),7!=l({},t)[n]||Object.keys(l({},e)).join("")!=i}))?function(t,e){var n=a(t),l=arguments.length,u=1,h=r.f,d=o.f;while(l>u){var f,p=c(arguments[u++]),m=h?s(p).concat(h(p)):s(p),g=m.length,b=0;while(g>b)f=m[b++],i&&!d.call(p,f)||(n[f]=p[f])}return n}:l},"73b1":function(t,e){},"73c8":function(t,e){},"73ef":function(t,e){},"744f":function(t,e,n){var i=n("5ca1");i(i.P,"Array",{copyWithin:n("ba92")}),n("9c6c")("copyWithin")},7487:function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));const i=t=>(e,{disableNormalization:n,imag:i,real:s})=>{const r=t(e),o=new Float32Array(i),a=new Float32Array(s);return null!==r?r.createPeriodicWave(a,o,{disableNormalization:n}):e.createPeriodicWave(a,o,{disableNormalization:n})}},"74eb":function(t,e){},7502:function(t,e){},7514:function(t,e,n){"use strict";var i=n("5ca1"),s=n("0a49")(5),r="find",o=!0;r in[]&&Array(1)[r]((function(){o=!1})),i(i.P+i.F*o,"Array",{find:function(t){return s(this,t,arguments.length>1?arguments[1]:void 0)}}),n("9c6c")(r)},"752e":function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return s})),n.d(e,"c",(function(){return r})),n.d(e,"d",(function(){return o})),n.d(e,"e",(function(){return a})),n.d(e,"f",(function(){return c})),n.d(e,"g",(function(){return l})),n.d(e,"i",(function(){return u})),n.d(e,"h",(function(){return h})),n.d(e,"j",(function(){return d})),n.d(e,"k",(function(){return f}));const i=new WeakSet,s=new WeakMap,r=new WeakMap,o=new WeakMap,a=new WeakMap,c=new WeakMap,l=new WeakMap,u=new WeakMap,h=new WeakMap,d=new WeakMap,f=new WeakMap},7553:function(t,e){},7610:function(t,e){},"763e":function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var i=n("383e");const s={channelCount:2,channelCountMode:"clamped-max",channelInterpretation:"speakers",coneInnerAngle:360,coneOuterAngle:360,coneOuterGain:0,distanceModel:"inverse",maxDistance:1e4,orientationX:1,orientationY:0,orientationZ:0,panningModel:"equalpower",positionX:0,positionY:0,positionZ:0,refDistance:1,rolloffFactor:1},r=(t,e,n,r,o,a)=>class extends t{constructor(t,c=s){const l=o(t),u={...s,...c},h=n(l,u),d=a(l),f=d?r():null;super(t,!1,h,f),this._nativePannerNode=h,this._orientationX=e(this,d,h.orientationX,i["b"],i["a"]),this._orientationY=e(this,d,h.orientationY,i["b"],i["a"]),this._orientationZ=e(this,d,h.orientationZ,i["b"],i["a"]),this._positionX=e(this,d,h.positionX,i["b"],i["a"]),this._positionY=e(this,d,h.positionY,i["b"],i["a"]),this._positionZ=e(this,d,h.positionZ,i["b"],i["a"])}get coneInnerAngle(){return this._nativePannerNode.coneInnerAngle}set coneInnerAngle(t){this._nativePannerNode.coneInnerAngle=t}get coneOuterAngle(){return this._nativePannerNode.coneOuterAngle}set coneOuterAngle(t){this._nativePannerNode.coneOuterAngle=t}get coneOuterGain(){return this._nativePannerNode.coneOuterGain}set coneOuterGain(t){this._nativePannerNode.coneOuterGain=t}get distanceModel(){return this._nativePannerNode.distanceModel}set distanceModel(t){this._nativePannerNode.distanceModel=t}get maxDistance(){return this._nativePannerNode.maxDistance}set maxDistance(t){this._nativePannerNode.maxDistance=t}get orientationX(){return this._orientationX}get orientationY(){return this._orientationY}get orientationZ(){return this._orientationZ}get panningModel(){return this._nativePannerNode.panningModel}set panningModel(t){this._nativePannerNode.panningModel=t}get positionX(){return this._positionX}get positionY(){return this._positionY}get positionZ(){return this._positionZ}get refDistance(){return this._nativePannerNode.refDistance}set refDistance(t){this._nativePannerNode.refDistance=t}get rolloffFactor(){return this._nativePannerNode.rolloffFactor}set rolloffFactor(t){this._nativePannerNode.rolloffFactor=t}}},"767d":function(t,e){},"76a3":function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));const i=t=>{const{port1:e}=new MessageChannel;try{e.postMessage(t)}finally{e.close()}},s=(t,e,n,s,r,o)=>(a,c,l,u,h,d)=>{if(null!==l)try{const n=e(a,t=>new l(t,u,d)),i=new Map;let r=null;if(Object.defineProperties(n,{channelCount:{get:()=>d.channelCount,set:()=>{throw t()}},channelCountMode:{get:()=>"explicit",set:()=>{throw t()}},onprocessorerror:{get:()=>r,set:t=>{"function"===typeof r&&n.removeEventListener("processorerror",r),r="function"===typeof t?t:null,"function"===typeof r&&n.addEventListener("processorerror",r)}}}),n.addEventListener=(t=>(...e)=>{if("processorerror"===e[0]){const t="function"===typeof e[1]?e[1]:"object"===typeof e[1]&&null!==e[1]&&"function"===typeof e[1].handleEvent?e[1].handleEvent:null;if(null!==t){const n=i.get(e[1]);void 0!==n?e[1]=n:(e[1]=n=>{t(new ErrorEvent(e[0],{...n,error:new Error}))},i.set(t,e[1]))}}return t.call(n,e[0],e[1],e[2])})(n.addEventListener),n.removeEventListener=(t=>(...e)=>{if("processorerror"===e[0]){const t=i.get(e[1]);void 0!==t&&(i.delete(e[1]),e[1]=t)}return t.call(n,e[0],e[1],e[2])})(n.removeEventListener),0!==d.numberOfOutputs){const t=s(a,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});n.connect(t).connect(t.context.destination);const e=()=>t.disconnect(),i=()=>t.connect(t.context.destination);return o(n,e,i)}return n}catch(f){if(11===f.code)throw r();throw f}if(void 0===h)throw r();return i(d),n(a,c,h,d)}},7726:function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},"777a":function(t,e){},"77e9":function(t,e,n){"use strict";n("5d55"),n("2b78"),n("2dad"),n("5d24"),n("fae9"),n("ae66"),n("6f55"),n("5dd3"),n("efdd"),n("3b7d"),n("cc7a"),n("c15b"),n("d8a7"),n("1f43"),n("974a"),n("5c79"),n("17d6"),n("1dc8"),n("e9a6"),n("4f24"),n("1289"),n("fff6"),n("b08a"),n("d961"),n("c6b2"),n("5a99"),n("9696"),n("23a9"),n("6598"),n("f9a2"),n("d2f5"),n("9cad"),n("a199"),n("a6fa"),n("39b7"),n("0c95"),n("29f8"),n("137b"),n("4149"),n("18b3"),n("f275"),n("37e5"),n("ec19"),n("871f"),n("3cf6"),n("4779"),n("ae2c"),n("1b30"),n("8897"),n("8634"),n("0be3"),n("1b1e"),n("86c7"),n("c7bd"),n("b8ae"),n("d179"),n("b81c"),n("e508"),n("1104"),n("b0f4"),n("204f"),n("359c"),n("d25a"),n("c7d6"),n("8c3b"),n("8681"),n("5a7f"),n("7961"),n("01e7"),n("b5f9"),n("6c8d"),n("b3b4"),n("f5be"),n("d890"),n("930b"),n("0a90"),n("382c"),n("844a"),n("7d27"),n("9aa6"),n("8a64"),n("48fc"),n("4e8d")},"77f1":function(t,e,n){var i=n("4588"),s=Math.max,r=Math.min;t.exports=function(t,e){return t=i(t),t<0?s(t+e,0):r(t,e)}},"782c":function(t,e){},"782d":function(t,e){},7872:function(t,e,n){var i=n("5ca1");i(i.S,"Math",{log10:function(t){return Math.log(t)*Math.LOG10E}})},"788d":function(t,e,n){var i=n("5ca1"),s=n("6821"),r=n("9def");i(i.S,"String",{raw:function(t){var e=s(t.raw),n=r(e.length),i=arguments.length,o=[],a=0;while(n>a)o.push(String(e[a++])),aclass extends t{constructor(t,a=i){const c=r(t),l={...i,...a},u=s(c,l),h=o(c),d=h?n(l.maxDelayTime):null;super(t,!1,u,d),this._delayTime=e(this,h,u.delayTime,l.maxDelayTime,0)}get delayTime(){return this._delayTime}}},"7af0":function(t,e){},"7af2":function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var i=n("050d");const s=(t,e,n,s)=>{Object(i["a"])(e)?t.disconnect(e.inputs[s],n,0):t.disconnect(e,n,s)}},"7b2d":function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));const i=()=>{try{return new DOMException("","IndexSizeError")}catch(t){return t.code=1,t.name="IndexSizeError",t}}},"7b45":function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var i=n("050d");const s=(t,e,n,s)=>{if(Object(i["a"])(e)){const i=e.inputs[s];return t.connect(i,n,0),[i,n,0]}return t.connect(e,n,s),[e,n,s]}},"7b7b":function(t,e){},"7bbc":function(t,e,n){var i=n("6821"),s=n("9093").f,r={}.toString,o="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],a=function(t){try{return s(t)}catch(e){return o.slice()}};t.exports.f=function(t){return o&&"[object Window]"==r.call(t)?a(t):s(i(t))}},"7c27":function(t,e,n){"use strict";var i=n("ab19"),s=n("3b96");function r(t,e,n){if(1===arguments.length)return function(e,n){return r(t,e,n)};var c=n||{},l=c.isSoundfontURL||o,u=c.nameToUrl||a,h=l(e)?e:u(e,c.soundfont,c.format);return i(t,h,{only:c.only||c.notes}).then((function(n){var i=s(t,n,c).connect(c.destination?c.destination:t.destination);return i.url=h,i.name=e,i}))}function o(t){return/\.js(\?.*)?$/i.test(t)}function a(t,e,n){return n="ogg"===n?n:"mp3",e="FluidR3_GM"===e?e:"MusyngKite","https://gleitz.github.io/midi-js-soundfonts/"+e+"/"+t+"-"+n+".js"}var c=n("7eb6");c.instrument=r,c.nameToUrl=a,t.exports&&(t.exports=c),"undefined"!==typeof window&&(window.Soundfont=c)},"7cdf":function(t,e,n){var i=n("5ca1");i(i.S,"Number",{isInteger:n("9c12")})},"7d27":function(t,e){},"7d82":function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var i=n("752e"),s=n("d057");const r=t=>Object(s["a"])(i["b"],t)},"7dbe":function(t,e){},"7e19":function(t,e){},"7e92":function(t,e){},"7eb5":function(t,e){},"7eb6":function(t,e,n){"use strict";var i=n("1c15");function s(t,e){if(console.warn("new Soundfont() is deprected"),console.log("Please use Soundfont.instrument() instead of new Soundfont().instrument()"),!(this instanceof s))return new s(t);this.nameToUrl=e||s.nameToUrl,this.ctx=t,this.instruments={},this.promises=[]}function r(t,e,n){return console.warn("Soundfont.loadBuffers is deprecate."),console.log("Use Soundfont.instrument(..) and get buffers properties from the result."),s.instrument(t,e,n).then((function(t){return t.buffers}))}function o(t,e){return e=e||{},function(n,s,r,o){console.warn("The oscillator player is deprecated."),console.log("Starting with version 0.9.0 you will have to wait until the soundfont is loaded to play sounds.");var a=n>0&&n<129?+n:i.midi(n),c=a?i.midiToFreq(a,440):null;if(c){r=r||.2,o=o||{};var l=o.destination||e.destination||t.destination,u=o.vcoType||e.vcoType||"sine",h=o.gain||e.gain||.4,d=t.createOscillator();d.type=u,d.frequency.value=c;var f=t.createGain();return f.gain.value=h,d.connect(f),f.connect(l),d.start(s),r>0&&d.stop(s+r),d}}}s.prototype.onready=function(t){console.warn("deprecated API"),console.log("Please use Promise.all(Soundfont.instrument(), Soundfont.instrument()).then() instead of new Soundfont().onready()"),Promise.all(this.promises).then(t)},s.prototype.instrument=function(t,e){console.warn("new Soundfont().instrument() is deprecated."),console.log("Please use Soundfont.instrument() instead.");var n=this.ctx;if(t=t||"default",t in this.instruments)return this.instruments[t];var i={name:t,play:o(n,e)};if(this.instruments[t]=i,"default"!==t){var r=s.instrument(n,t,e).then((function(t){return i.play=t.play,i}));this.promises.push(r),i.onready=function(t){console.warn("onready is deprecated. Use Soundfont.instrument().then()"),r.then(t)}}else i.onready=function(t){console.warn("onready is deprecated. Use Soundfont.instrument().then()"),t()};return i},s.loadBuffers=r,s.noteToMidi=i.midi,t.exports=s},"7f19":function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));const i=t=>()=>{if(null===t)return!1;const e=new t(1,1,44100),n=e.createGain(),i=n.connect(n)===n;return n.disconnect(n),i}},"7f20":function(t,e,n){var i=n("86cc").f,s=n("69a8"),r=n("2b4c")("toStringTag");t.exports=function(t,e,n){t&&!s(t=n?t:t.prototype,r)&&i(t,r,{configurable:!0,value:e})}},"7f25":function(t,e,n){var i=n("5ca1"),s=n("d6c6"),r=Math.sqrt,o=Math.acosh;i(i.S+i.F*!(o&&710==Math.floor(o(Number.MAX_VALUE))&&o(1/0)==1/0),"Math",{acosh:function(t){return(t=+t)<1?NaN:t>94906265.62425156?Math.log(t)+Math.LN2:s(t-1+r(t-1)*r(t+1))}})},"7f5d":function(t,e){},"7f7b":function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));const i=t=>{t.start=(e=>(n=0,i=0,s)=>{const r=t.buffer,o=null===r?i:Math.min(r.duration,i);null!==r&&o>r.duration-.5/t.context.sampleRate?e.call(t,n,0,0):e.call(t,n,o,s)})(t.start)}},"7f7f":function(t,e,n){var i=n("86cc").f,s=Function.prototype,r=/^\s*function ([^ (]*)/,o="name";o in s||n("9e1e")&&i(s,o,{configurable:!0,get:function(){try{return(""+this).match(r)[1]}catch(t){return""}}})},"7f8d":function(t,e,n){"use strict";var i=Array.isArray,s=function(t){return t&&"object"===typeof t},r={};t.exports=function(t){return t.schedule=function(e,n){var o,a,c,l,u=t.context.currentTime,h=e{t.start=(e=>(n=0,i=0,s)=>{if("number"===typeof s&&s<0||i<0||n<0)throw new RangeError("The parameters can't be negative.");e.call(t,n,i,s)})(t.start)}},"7faf":function(t,e){},"7fd1":function(t,e){},8058:function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var i=n("e190");const s=(t,e,n)=>()=>{const s=new WeakMap,r=async(r,o,a)=>{let c=e(r);const l=Object(i["a"])(c,o);if(!l){const e={channelCount:c.channelCount,channelCountMode:c.channelCountMode,channelInterpretation:c.channelInterpretation,fftSize:c.fftSize,maxDecibels:c.maxDecibels,minDecibels:c.minDecibels,smoothingTimeConstant:c.smoothingTimeConstant};c=t(o,e)}return s.set(o,c),await n(r,o,c,a),c};return{render(t,e,n){const i=s.get(e);return void 0!==i?Promise.resolve(i):r(t,e,n)}}}},8073:function(t,e){},8079:function(t,e,n){var i=n("7726"),s=n("1991").set,r=i.MutationObserver||i.WebKitMutationObserver,o=i.process,a=i.Promise,c="process"==n("2d95")(o);t.exports=function(){var t,e,n,l=function(){var i,s;c&&(i=o.domain)&&i.exit();while(t){s=t.fn,t=t.next;try{s()}catch(r){throw t?n():e=void 0,r}}e=void 0,i&&i.enter()};if(c)n=function(){o.nextTick(l)};else if(!r||i.navigator&&i.navigator.standalone)if(a&&a.resolve){var u=a.resolve(void 0);n=function(){u.then(l)}}else n=function(){s.call(i,l)};else{var h=!0,d=document.createTextNode("");new r(l).observe(d,{characterData:!0}),n=function(){d.data=h=!h}}return function(i){var s={fn:i,next:void 0};e&&(e.next=s),t||(t=s,n()),e=s}}},"80ae":function(t,e){},"80f7":function(t,e){},8177:function(t,e){},"81cf":function(t,e){},"823e":function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var i=n("0bf9"),s=n("5b43"),r=n("7fa0"),o=n("545f");const a=(t,e,n,a,c,l)=>(u,h)=>{if(void 0===u.createConstantSource)return a(u,h);const d=n(u,t=>t.createConstantSource());return Object(s["a"])(d,h),Object(i["a"])(d,h,"offset"),e(c,()=>c(u))||Object(r["a"])(d),e(l,()=>l(u))||Object(o["a"])(d),t(u,d),d}},"82df":function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));const i=t=>e=>{e.copyFromChannel=(n=>(i,s,r=0)=>{const o=t(r),a=t(s);if(o(i,s,r=0)=>{const o=t(r),a=t(s);if(o()=>{const a=new WeakMap,c=async(c,l,u)=>{let h=n(c);const d=Object(s["a"])(h,l);if(!d){const t={channelCount:h.channelCount,channelCountMode:h.channelCountMode,channelInterpretation:h.channelInterpretation,pan:h.pan.value};h=e(l,t)}return a.set(l,h),d?await t(l,c.pan,h.pan,u):await r(l,c.pan,h.pan,u),Object(i["a"])(h)?await o(c,l,h.inputs[0],u):await o(c,l,h,u),h};return{render(t,e,n){const i=a.get(e);return void 0!==i?Promise.resolve(i):c(t,e,n)}}}},8378:function(t,e){var n=t.exports={version:"2.6.11"};"number"==typeof __e&&(__e=n)},8381:function(t,e,n){"use strict";var i=n("cb7c"),s=n("6a99"),r="number";t.exports=function(t){if("string"!==t&&t!==r&&"default"!==t)throw TypeError("Incorrect hint");return s(i(this),t!=r)}},"83a1":function(t,e){t.exports=Object.is||function(t,e){return t===e?0!==t||1/t===1/e:t!=t&&e!=e}},"83b9":function(t,e,n){"use strict";var i=n("d925"),s=n("e683");t.exports=function(t,e){return t&&!i(e)?s(t,e):e}},8449:function(t,e,n){"use strict";n("386b")("anchor",(function(t){return function(e){return t(this,"a","name",e)}}))},"844a":function(t,e){},"84b4":function(t,e,n){var i=n("5ca1");i(i.S,"Math",{trunc:function(t){return(t>0?Math.floor:Math.ceil)(t)}})},"84dc":function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));const i=t=>({replay(e){for(const n of t)if("exponentialRampToValue"===n.type){const{endTime:t,value:i}=n;e.exponentialRampToValueAtTime(i,t)}else if("linearRampToValue"===n.type){const{endTime:t,value:i}=n;e.linearRampToValueAtTime(i,t)}else if("setTarget"===n.type){const{startTime:t,target:i,timeConstant:s}=n;e.setTargetAtTime(i,t,s)}else if("setValue"===n.type){const{startTime:t,value:i}=n;e.setValueAtTime(i,t)}else{if("setValueCurve"!==n.type)throw new Error("Can't apply an unknown automation.");{const{duration:t,startTime:i,values:s}=n;e.setValueCurveAtTime(s,i,t)}}}})},"84f2":function(t,e){t.exports={}},8517:function(t,e){},8543:function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var i=n("752e"),s=n("d057");const r=t=>Object(s["a"])(i["c"],t)},8615:function(t,e,n){var i=n("5ca1"),s=n("504c")(!1);i(i.S,"Object",{values:function(t){return s(t)}})},8634:function(t,e){},"867f":function(t,e){},8681:function(t,e){},"869e":function(t,e){},"86c7":function(t,e){},"86cc":function(t,e,n){var i=n("cb7c"),s=n("c69a"),r=n("6a99"),o=Object.defineProperty;e.f=n("9e1e")?Object.defineProperty:function(t,e,n){if(i(t),e=r(e,!0),i(n),s)try{return o(t,e,n)}catch(a){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},"871f":function(t,e){},"873b":function(t,e){},"87a6":function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));const i=t=>(e,n,i)=>{const s=[];for(let t=0;tn=>{const i=t.get(n);return e(i)||e(n)}},8862:function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));const i=(t,e,n,i,s)=>{"function"===typeof t.copyToChannel?0!==e[n].byteLength&&t.copyToChannel(e[n],i,s):0!==e[n].byteLength&&t.getChannelData(i).set(e[n],s)}},8897:function(t,e){},"88ca":function(t,e,n){var i=n("86cc"),s=n("5ca1"),r=n("cb7c"),o=n("6a99");s(s.S+s.F*n("79e5")((function(){Reflect.defineProperty(i.f({},1,{value:1}),1,{value:2})})),"Reflect",{defineProperty:function(t,e,n){r(t),e=o(e,!0),r(n);try{return i.f(t,e,n),!0}catch(s){return!1}}})},"88ef":function(t,e){},8930:function(t,e){},"893e":function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));const i=t=>(e,n)=>{t.set(e,{activeInputs:new Set,passiveInputs:new WeakMap,renderer:n})}},"894f":function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var i=n("9bd2"),s=n("e190");const r=(t,e,n,s)=>{const r=n.length,o=s.length,a=Math.min(r,o);if(1!==n[0]){for(let t=0;t(c,l)=>{const u=new WeakMap;let h=null;const d=async(d,f,p)=>{let m=null,g=n(d);const b=Object(s["a"])(g,f);if(void 0===f.createIIRFilter?m=t(f,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}):b||(g=e(f,t=>t.createIIRFilter(l,c))),u.set(f,null===m?g:m),null!==m){if(null===h){if(null===i)throw new Error("Missing the native OfflineAudioContext constructor.");const t=new i(d.context.destination.channelCount,d.context.length,f.sampleRate);h=(async()=>{await o(d,t,t.destination,p);const e=await a(t);return r(e,f,c,l)})()}const t=await h;return m.buffer=t,m.start(0),m}return await o(d,f,g,p),g};return{render(t,e,n){const i=u.get(e);return void 0!==i?Promise.resolve(i):d(t,e,n)}}}},"89a4":function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var i=n("5b43");const s=(t,e)=>(n,s,r)=>{if(void 0===n.createIIRFilter)return e(n,s,r);const o=t(n,t=>t.createIIRFilter(r.feedforward,r.feedback));return Object(i["a"])(o,r),o}},"8a54":function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var i=n("e190");const s=(t,e,n)=>()=>{const s=new WeakMap,r=async(r,o,a)=>{let c=e(r);const l=Object(i["a"])(c,o);if(!l){const e={channelCount:c.channelCount,channelCountMode:c.channelCountMode,channelInterpretation:c.channelInterpretation,numberOfOutputs:c.numberOfOutputs};c=t(o,e)}return s.set(o,c),await n(r,o,c,a),c};return{render(t,e,n){const i=s.get(e);return void 0!==i?Promise.resolve(i):r(t,e,n)}}}},"8a64":function(t,e){},"8a81":function(t,e,n){"use strict";var i=n("7726"),s=n("69a8"),r=n("9e1e"),o=n("5ca1"),a=n("2aba"),c=n("67ab").KEY,l=n("79e5"),u=n("5537"),h=n("7f20"),d=n("ca5a"),f=n("2b4c"),p=n("37c8"),m=n("3a72"),g=n("d4c0"),b=n("1169"),v=n("cb7c"),y=n("d3f4"),S=n("4bf8"),x=n("6821"),_=n("6a99"),w=n("4630"),E=n("2aeb"),T=n("7bbc"),C=n("11e9"),M=n("2621"),P=n("86cc"),A=n("0d58"),I=C.f,L=P.f,O=T.f,k=i.Symbol,R=i.JSON,N=R&&R.stringify,D="prototype",V=f("_hidden"),B=f("toPrimitive"),F={}.propertyIsEnumerable,j=u("symbol-registry"),G=u("symbols"),W=u("op-symbols"),$=Object[D],z="function"==typeof k&&!!M.f,H=i.QObject,U=!H||!H[D]||!H[D].findChild,Y=r&&l((function(){return 7!=E(L({},"a",{get:function(){return L(this,"a",{value:7}).a}})).a}))?function(t,e,n){var i=I($,e);i&&delete $[e],L(t,e,n),i&&t!==$&&L($,e,i)}:L,X=function(t){var e=G[t]=E(k[D]);return e._k=t,e},K=z&&"symbol"==typeof k.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof k},q=function(t,e,n){return t===$&&q(W,e,n),v(t),e=_(e,!0),v(n),s(G,e)?(n.enumerable?(s(t,V)&&t[V][e]&&(t[V][e]=!1),n=E(n,{enumerable:w(0,!1)})):(s(t,V)||L(t,V,w(1,{})),t[V][e]=!0),Y(t,e,n)):L(t,e,n)},Z=function(t,e){v(t);var n,i=g(e=x(e)),s=0,r=i.length;while(r>s)q(t,n=i[s++],e[n]);return t},J=function(t,e){return void 0===e?E(t):Z(E(t),e)},Q=function(t){var e=F.call(this,t=_(t,!0));return!(this===$&&s(G,t)&&!s(W,t))&&(!(e||!s(this,t)||!s(G,t)||s(this,V)&&this[V][t])||e)},tt=function(t,e){if(t=x(t),e=_(e,!0),t!==$||!s(G,e)||s(W,e)){var n=I(t,e);return!n||!s(G,e)||s(t,V)&&t[V][e]||(n.enumerable=!0),n}},et=function(t){var e,n=O(x(t)),i=[],r=0;while(n.length>r)s(G,e=n[r++])||e==V||e==c||i.push(e);return i},nt=function(t){var e,n=t===$,i=O(n?W:x(t)),r=[],o=0;while(i.length>o)!s(G,e=i[o++])||n&&!s($,e)||r.push(G[e]);return r};z||(k=function(){if(this instanceof k)throw TypeError("Symbol is not a constructor!");var t=d(arguments.length>0?arguments[0]:void 0),e=function(n){this===$&&e.call(W,n),s(this,V)&&s(this[V],t)&&(this[V][t]=!1),Y(this,t,w(1,n))};return r&&U&&Y($,t,{configurable:!0,set:e}),X(t)},a(k[D],"toString",(function(){return this._k})),C.f=tt,P.f=q,n("9093").f=T.f=et,n("52a7").f=Q,M.f=nt,r&&!n("2d00")&&a($,"propertyIsEnumerable",Q,!0),p.f=function(t){return X(f(t))}),o(o.G+o.W+o.F*!z,{Symbol:k});for(var it="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),st=0;it.length>st;)f(it[st++]);for(var rt=A(f.store),ot=0;rt.length>ot;)m(rt[ot++]);o(o.S+o.F*!z,"Symbol",{for:function(t){return s(j,t+="")?j[t]:j[t]=k(t)},keyFor:function(t){if(!K(t))throw TypeError(t+" is not a symbol!");for(var e in j)if(j[e]===t)return e},useSetter:function(){U=!0},useSimple:function(){U=!1}}),o(o.S+o.F*!z,"Object",{create:J,defineProperty:q,defineProperties:Z,getOwnPropertyDescriptor:tt,getOwnPropertyNames:et,getOwnPropertySymbols:nt});var at=l((function(){M.f(1)}));o(o.S+o.F*at,"Object",{getOwnPropertySymbols:function(t){return M.f(S(t))}}),R&&o(o.S+o.F*(!z||l((function(){var t=k();return"[null]"!=N([t])||"{}"!=N({a:t})||"{}"!=N(Object(t))}))),"JSON",{stringify:function(t){var e,n,i=[t],s=1;while(arguments.length>s)i.push(arguments[s++]);if(n=e=i[1],(y(e)||void 0!==t)&&!K(t))return b(e)||(e=function(t,e){if("function"==typeof n&&(e=n.call(this,t,e)),!K(e))return e}),i[1]=e,N.apply(R,i)}}),k[D][B]||n("32e9")(k[D],B,k[D].valueOf),h(k,"Symbol"),h(Math,"Math",!0),h(i.JSON,"JSON",!0)},"8af4":function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));const i=(t,e)=>(t.connect=e.connect.bind(e),t.disconnect=e.disconnect.bind(e),t)},"8b97":function(t,e,n){var i=n("d3f4"),s=n("cb7c"),r=function(t,e){if(s(t),!i(e)&&null!==e)throw TypeError(e+": can't set as prototype!")};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(t,e,i){try{i=n("9b43")(Function.call,n("11e9").f(Object.prototype,"__proto__").set,2),i(t,[]),e=!(t instanceof Array)}catch(s){e=!0}return function(t,n){return r(t,n),e?t.__proto__=n:i(t,n),t}}({},!1):void 0),check:r}},"8bb0":function(t,e){},"8c12":function(t,e){},"8c3b":function(t,e){},"8c75":function(t,e){},"8c8b":function(t,e){},"8cd4":function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));const i={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",curve:null,oversample:"none"},s=(t,e,n,s,r,o)=>class extends t{constructor(t,e=i){const a=r(t),c={...i,...e},l=n(a,c),u=o(a),h=u?s():null;super(t,!0,l,h),this._isCurveNullified=!1,this._nativeWaveShaperNode=l}get curve(){return this._isCurveNullified?null:this._nativeWaveShaperNode.curve}set curve(t){if(null===t)this._isCurveNullified=!0,this._nativeWaveShaperNode.curve=new Float32Array([0,0]);else{if(t.length<2)throw e();this._isCurveNullified=!1,this._nativeWaveShaperNode.curve=t}}get oversample(){return this._nativeWaveShaperNode.oversample}set oversample(t){this._nativeWaveShaperNode.oversample=t}}},"8cf4":function(t,e){},"8d50":function(t,e){},"8d5d":function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));const i=()=>{try{return new DOMException("","DataCloneError")}catch(t){return t.code=25,t.name="DataCloneError",t}}},"8d85":function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var i=n("383e"),s=n("99e8"),r=n("4114"),o=n("8862"),a=n("752e");const c=t=>new Promise((e,n)=>{const{port1:i,port2:s}=new MessageChannel;i.onmessage=({data:t})=>{i.close(),s.close(),e(t)},i.onmessageerror=({data:t})=>{i.close(),s.close(),n(t)},s.postMessage(t)}),l=async(t,e)=>{const n=await c(e);return new t(n)},u=(t,e,n,i)=>{let s=a["k"].get(t);void 0===s&&(s=new WeakMap,a["k"].set(t,s));const r=l(n,i);return s.set(e,r),r};var h=n("65f3"),d=n("5046");const f=(t,e,n,a,c,l,f,p,m,g,b,v,y)=>(S,x,_,w)=>{if(0===w.numberOfInputs&&0===w.numberOfOutputs)throw g();if(void 0!==w.outputChannelCount){if(w.outputChannelCount.some(t=>t<1))throw g();if(w.outputChannelCount.length!==w.numberOfOutputs)throw n()}if("explicit"!==w.channelCountMode)throw g();const E=w.channelCount*w.numberOfInputs,T=w.outputChannelCount.reduce((t,e)=>t+e,0),C=void 0===_.parameterDescriptors?0:_.parameterDescriptors.length;if(E+C>6||T>6)throw g();const M=new MessageChannel,P=[],A=[];for(let t=0;tvoid 0===t?0:t},maxValue:{get:()=>void 0===e?i["b"]:e},minValue:{get:()=>void 0===n?i["a"]:n}}),I.push(r)}const L=c(S,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:Math.max(1,E+C)}),O=Object(s["a"])(x,S.sampleRate),k=m(S,O,E+C,Math.max(1,T)),R=l(S,{channelCount:Math.max(1,T),channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:Math.max(1,T)}),N=[];for(let t=0;t{const n=I[e];return n.connect(L,0,E+e),n.start(0),[t,n.offset]}));L.connect(k);let V=w.channelInterpretation,B=null;const F=0===w.numberOfOutputs?[k]:N,j={get bufferSize(){return O},get channelCount(){return w.channelCount},set channelCount(t){throw a()},get channelCountMode(){return w.channelCountMode},set channelCountMode(t){throw a()},get channelInterpretation(){return V},set channelInterpretation(t){for(const e of P)e.channelInterpretation=t;V=t},get context(){return k.context},get inputs(){return P},get numberOfInputs(){return w.numberOfInputs},get numberOfOutputs(){return w.numberOfOutputs},get onprocessorerror(){return B},set onprocessorerror(t){"function"===typeof B&&j.removeEventListener("processorerror",B),B="function"===typeof t?t:null,"function"===typeof B&&j.addEventListener("processorerror",B)},get parameters(){return D},get port(){return M.port2},addEventListener(...t){return k.addEventListener(t[0],t[1],t[2])},connect:e.bind(null,F),disconnect:b.bind(null,F),dispatchEvent(...t){return k.dispatchEvent(t[0])},removeEventListener(...t){return k.removeEventListener(t[0],t[1],t[2])}},G=new Map;M.port1.addEventListener=(t=>(...e)=>{if("message"===e[0]){const t="function"===typeof e[1]?e[1]:"object"===typeof e[1]&&null!==e[1]&&"function"===typeof e[1].handleEvent?e[1].handleEvent:null;if(null!==t){const n=G.get(e[1]);void 0!==n?e[1]=n:(e[1]=e=>{v(S.currentTime,S.sampleRate,()=>t(e))},G.set(t,e[1]))}}return t.call(M.port1,e[0],e[1],e[2])})(M.port1.addEventListener),M.port1.removeEventListener=(t=>(...e)=>{if("message"===e[0]){const t=G.get(e[1]);void 0!==t&&(G.delete(e[1]),e[1]=t)}return t.call(M.port1,e[0],e[1],e[2])})(M.port1.removeEventListener);let W=null;Object.defineProperty(M.port1,"onmessage",{get:()=>W,set:t=>{"function"===typeof W&&M.port1.removeEventListener("message",W),W="function"===typeof t?t:null,"function"===typeof W&&(M.port1.addEventListener("message",W),M.port1.start())}}),_.prototype.port=M.port1;let $=null;const z=u(S,j,_,w);z.then(t=>$=t);const H=Object(h["a"])(w.numberOfInputs,w.channelCount),U=Object(h["a"])(w.numberOfOutputs,w.outputChannelCount),Y=void 0===_.parameterDescriptors?[]:_.parameterDescriptors.reduce((t,{name:e})=>({...t,[e]:new Float32Array(128)}),{});let X=!0;const K=()=>{w.numberOfOutputs>0&&k.disconnect(R);for(let t=0,e=0;t{if(null!==$)for(let s=0;s{Object(r["a"])(e,Y,t,E+n,s)});for(let t=0;t{const i=t.get(j);return void 0===i||void 0===i.get(n)?[]:e}),i=v(S.currentTime+s/S.sampleRate,S.sampleRate,()=>$.process(e,U,Y));X=i;for(let t=0,r=0;tk.connect(Z).connect(Z.context.destination),Q=()=>{k.disconnect(Z),Z.disconnect()},tt=()=>{if(X){Q(),w.numberOfOutputs>0&&k.connect(R);for(let t=0,e=0;t{X&&(J(),K()),q=!1};return J(),y(j,tt,et)}},"8df4":function(t,e,n){"use strict";var i=n("7a77");function s(t){if("function"!==typeof t)throw new TypeError("executor must be a function.");var e;this.promise=new Promise((function(t){e=t}));var n=this;t((function(t){n.reason||(n.reason=new i(t),e(n.reason))}))}s.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},s.source=function(){var t,e=new s((function(e){t=e}));return{token:e,cancel:t}},t.exports=s},"8e0b":function(t,e){},"8e6e":function(t,e,n){var i=n("5ca1"),s=n("990b"),r=n("6821"),o=n("11e9"),a=n("f1ae");i(i.S,"Object",{getOwnPropertyDescriptors:function(t){var e,n,i=r(t),c=o.f,l=s(i),u={},h=0;while(l.length>h)n=c(i,e=l[h++]),void 0!==n&&a(u,e,n);return u}})},"8e8b":function(t,e){},9031:function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var i=n("050d"),s=n("e190");const r=(t,e,n)=>()=>{const r=new WeakMap,o=async(o,a,c)=>{let l=e(o);const u=Object(s["a"])(l,a);if(!u){const e={channelCount:l.channelCount,channelCountMode:l.channelCountMode,channelInterpretation:l.channelInterpretation,curve:l.curve,oversample:l.oversample};l=t(a,e)}return r.set(a,l),Object(i["a"])(l)?await n(o,a,l.inputs[0],c):await n(o,a,l,c),l};return{render(t,e,n){const i=r.get(e);return void 0!==i?Promise.resolve(i):o(t,e,n)}}}},9093:function(t,e,n){var i=n("ce10"),s=n("e11e").concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return i(t,s)}},"90d8":function(t,e){},9149:function(t,e){},"918c":function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));const i=()=>{try{return new DOMException("","UnknownError")}catch(t){return t.name="UnknownError",t}}},"91a2":function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));const i=t=>e=>null!==t&&e instanceof t},"91c8":function(t,e){},"91ca":function(t,e,n){var i=n("96fb"),s=Math.pow,r=s(2,-52),o=s(2,-23),a=s(2,127)*(2-o),c=s(2,-126),l=function(t){return t+1/r-1/r};t.exports=Math.fround||function(t){var e,n,s=Math.abs(t),u=i(t);return sa||n!=n?u*(1/0):u*n)}},9253:function(t,e,n){var i=n("86cc"),s=n("11e9"),r=n("38fd"),o=n("69a8"),a=n("5ca1"),c=n("4630"),l=n("cb7c"),u=n("d3f4");function h(t,e,n){var a,d,f=arguments.length<4?t:arguments[3],p=s.f(l(t),e);if(!p){if(u(d=r(t)))return h(d,e,n,f);p=c(0)}if(o(p,"value")){if(!1===p.writable||!u(f))return!1;if(a=s.f(f,e)){if(a.get||a.set||!1===a.writable)return!1;a.value=n,i.f(f,e,a)}else i.f(f,e,c(0,n));return!0}return void 0!==p.set&&(p.set.call(f,n),!0)}a(a.S,"Reflect",{set:h})},9275:function(t,e,n){var i=n("5ca1"),s=n("8b97");s&&i(i.S,"Reflect",{setPrototypeOf:function(t,e){s.check(t,e);try{return s.set(t,e),!0}catch(n){return!1}}})},9278:function(t,e,n){var i=n("5ca1");i(i.S,"Number",{MIN_SAFE_INTEGER:-9007199254740991})},"930b":function(t,e){},9349:function(t,e){},"93ab":function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));const i={channelCount:2,channelCountMode:"explicit",channelInterpretation:"speakers",pan:0},s=(t,e,n,s,r,o)=>class extends t{constructor(t,a=i){const c=r(t),l={...i,...a},u=n(c,l),h=o(c),d=h?s():null;super(t,!1,u,d),this._pan=e(this,h,u.pan,1,-1)}get pan(){return this._pan}}},"942a":function(t,e){},"946c":function(t,e){},"947a":function(t,e){},9557:function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));const i=()=>{try{return new DOMException("","EncodingError")}catch(t){return t.code=0,t.name="EncodingError",t}}},"95b4":function(t,e){},"95c6":function(t,e){},"961a":function(t,e,n){"use strict";n("f4a5"),n("65c6"),n("23ca"),n("bf74"),n("a4b6"),n("5cbe"),n("4cb5"),n("def8"),n("9149"),n("6218"),n("a7f8"),n("5bb6"),n("adc3"),n("476a"),n("a604"),n("2de4"),n("dd02"),n("2e07"),n("f26c"),n("cb86"),n("efbd"),n("be78"),n("51fe"),n("4928"),n("8d50"),n("6f2e"),n("ad17"),n("8517"),n("64ac"),n("234f"),n("c153"),n("abdd"),n("cd1b"),n("f209"),n("2ed8"),n("716e"),n("f4cc"),n("3257"),n("0454"),n("091a"),n("4238"),n("baba"),n("7e19"),n("d784"),n("efe3"),n("6a5a"),n("a689"),n("e574"),n("cb12"),n("4dc3"),n("2ab2"),n("53b3"),n("5800"),n("6136"),n("5c3a"),n("e0ce"),n("ae01"),n("6567"),n("b480"),n("5181"),n("73c8"),n("5faf"),n("4951"),n("e167"),n("06df"),n("bc86"),n("c541"),n("d0de"),n("c781"),n("db12"),n("67df"),n("01ef"),n("9f52"),n("ec9c"),n("979d"),n("136a"),n("18bf"),n("782c"),n("eee3"),n("ae00"),n("91c8"),n("6b2f"),n("52f4"),n("51df"),n("2a42"),n("0bba"),n("e466"),n("90d8"),n("2a31"),n("2026"),n("4457"),n("8c75"),n("9e26"),n("946c"),n("154b"),n("ecad"),n("a163"),n("8177"),n("d34b"),n("4107"),n("152a"),n("2af5"),n("0286"),n("ca6e"),n("ef33"),n("8c12"),n("b0f2"),n("81cf"),n("8e0b"),n("abb6"),n("a1be"),n("9a01"),n("17e7"),n("719c"),n("a280"),n("ea30"),n("d19a"),n("867f"),n("942a"),n("4508"),n("526f"),n("7faf"),n("a9c1"),n("b9fb"),n("c033"),n("f612"),n("aee0"),n("cacd"),n("db40"),n("1376"),n("2e20"),n("c02f"),n("c779"),n("7610"),n("a1c9"),n("55aa"),n("ee83"),n("64be"),n("3555"),n("7b7b"),n("d04a"),n("ae71"),n("2ea4"),n("03ab"),n("50a7"),n("dd5c"),n("229f"),n("0019"),n("14bf"),n("bc93"),n("0799"),n("29dd"),n("ec99"),n("967a"),n("947a"),n("2f70"),n("4720"),n("13b5"),n("9707"),n("74eb"),n("16f7"),n("f823"),n("adc1"),n("ecf5"),n("424a"),n("b957"),n("fed4"),n("a6d1"),n("5739"),n("d0f9"),n("7dbe"),n("8e8b"),n("42a4"),n("465e"),n("00e5"),n("ca04"),n("cd1ba"),n("1e94"),n("e028"),n("97da"),n("43f2"),n("6269"),n("e755"),n("d383"),n("8930"),n("6154"),n("3adc"),n("873b"),n("d4a9"),n("73ef"),n("554c"),n("6760"),n("3d55"),n("c57a"),n("b9ea"),n("0f1e"),n("d4d4"),n("8bb0"),n("b1e4"),n("80f7"),n("4ca8"),n("650f"),n("7f5d"),n("777a"),n("98c9"),n("5055"),n("9f0a"),n("b464"),n("6ab5"),n("f3c6"),n("050c"),n("dd9b"),n("163c"),n("064c"),n("d01f"),n("d4ec"),n("d8b9"),n("5a62"),n("7502"),n("c720"),n("a2a8"),n("9bbc"),n("ffec"),n("0596"),n("0606"),n("3738"),n("29b0"),n("4561"),n("5477"),n("7553"),n("06ef"),n("474e"),n("c1ca"),n("0b3f"),n("58a0"),n("cf4b"),n("dd20"),n("fc27"),n("37e2"),n("7fd1"),n("5758"),n("4de4"),n("eb9d"),n("c399"),n("618a"),n("a9b8"),n("4156"),n("00d7"),n("6515"),n("c0ca"),n("2fd1"),n("9349"),n("46bd"),n("391d"),n("9ced"),n("52ab"),n("58a1"),n("2b7d"),n("3f50"),n("782d"),n("6f36"),n("3c28"),n("ef86"),n("1ace"),n("9e24"),n("db12b"),n("a65a"),n("3c0a"),n("5191"),n("0164"),n("ff7d"),n("b646"),n("7e92"),n("ddbb"),n("d4cb"),n("0211"),n("8cf4"),n("fdd5"),n("db6f"),n("e9e8"),n("a827"),n("c388"),n("1b0e"),n("8c8b"),n("8073"),n("b61d"),n("b158"),n("dbec"),n("f9d0"),n("b9f1"),n("37b4"),n("0f9f"),n("224e"),n("12f1"),n("fcfd"),n("4e79"),n("56c5"),n("f406"),n("3bbf"),n("767d"),n("dfe6"),n("11a8"),n("fd85"),n("1827"),n("a989"),n("483e"),n("73b1"),n("3895"),n("a34b"),n("3c84"),n("f410"),n("0183"),n("aabd"),n("15dc"),n("47ce"),n("7eb5"),n("bfb6"),n("42ee"),n("a2af"),n("5f63"),n("08cd"),n("c348"),n("d28a"),n("003f"),n("e262"),n("1144"),n("cbf2"),n("418b"),n("6a6f"),n("de43"),n("3c35"),n("80ae"),n("98a0"),n("6ced"),n("2f22"),n("2018"),n("82e9"),n("7af0"),n("4ee4"),n("95c6"),n("3707"),n("79c1"),n("95b4"),n("9d0e"),n("c80b"),n("63fe"),n("d089"),n("e564"),n("09a8"),n("e0c0"),n("5d45"),n("d6df"),n("c2f0"),n("9a63"),n("4ecb"),n("48a7"),n("69e5"),n("0148"),n("47e4"),n("88ef"),n("9d50"),n("6d3d"),n("5ebd"),n("ca24"),n("30bf"),n("2fb7"),n("9f9a"),n("5b94"),n("418bb"),n("6011"),n("10c6"),n("d335"),n("7160"),n("1c8b"),n("d859"),n("07d2"),n("6fc3"),n("6c7c"),n("2440"),n("3983"),n("cba6"),n("c953"),n("6718"),n("869e")},"967a":function(t,e){},9696:function(t,e){},"96cf":function(t,e,n){var i=function(t){"use strict";var e,n=Object.prototype,i=n.hasOwnProperty,s="function"===typeof Symbol?Symbol:{},r=s.iterator||"@@iterator",o=s.asyncIterator||"@@asyncIterator",a=s.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(O){c=function(t,e,n){return t[e]=n}}function l(t,e,n,i){var s=e&&e.prototype instanceof g?e:g,r=Object.create(s.prototype),o=new A(i||[]);return r._invoke=T(t,n,o),r}function u(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(O){return{type:"throw",arg:O}}}t.wrap=l;var h="suspendedStart",d="suspendedYield",f="executing",p="completed",m={};function g(){}function b(){}function v(){}var y={};y[r]=function(){return this};var S=Object.getPrototypeOf,x=S&&S(S(I([])));x&&x!==n&&i.call(x,r)&&(y=x);var _=v.prototype=g.prototype=Object.create(y);function w(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){function n(s,r,o,a){var c=u(t[s],t,r);if("throw"!==c.type){var l=c.arg,h=l.value;return h&&"object"===typeof h&&i.call(h,"__await")?e.resolve(h.__await).then((function(t){n("next",t,o,a)}),(function(t){n("throw",t,o,a)})):e.resolve(h).then((function(t){l.value=t,o(l)}),(function(t){return n("throw",t,o,a)}))}a(c.arg)}var s;function r(t,i){function r(){return new e((function(e,s){n(t,i,e,s)}))}return s=s?s.then(r,r):r()}this._invoke=r}function T(t,e,n){var i=h;return function(s,r){if(i===f)throw new Error("Generator is already running");if(i===p){if("throw"===s)throw r;return L()}n.method=s,n.arg=r;while(1){var o=n.delegate;if(o){var a=C(o,n);if(a){if(a===m)continue;return a}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=p,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=f;var c=u(t,e,n);if("normal"===c.type){if(i=n.done?p:d,c.arg===m)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=p,n.method="throw",n.arg=c.arg)}}}function C(t,n){var i=t.iterator[n.method];if(i===e){if(n.delegate=null,"throw"===n.method){if(t.iterator["return"]&&(n.method="return",n.arg=e,C(t,n),"throw"===n.method))return m;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return m}var s=u(i,t.iterator,n.arg);if("throw"===s.type)return n.method="throw",n.arg=s.arg,n.delegate=null,m;var r=s.arg;return r?r.done?(n[t.resultName]=r.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,m):r:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function M(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function A(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(M,this),this.reset(!0)}function I(t){if(t){var n=t[r];if(n)return n.call(t);if("function"===typeof t.next)return t;if(!isNaN(t.length)){var s=-1,o=function n(){while(++s=0;--r){var o=this.tryEntries[r],a=o.completion;if("root"===o.tryLoc)return s("end");if(o.tryLoc<=this.prev){var c=i.call(o,"catchLoc"),l=i.call(o,"finallyLoc");if(c&&l){if(this.prev=0;--n){var s=this.tryEntries[n];if(s.tryLoc<=this.prev&&i.call(s,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),P(n),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var i=n.completion;if("throw"===i.type){var s=i.arg;P(n)}return s}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,i){return this.delegate={iterator:I(t),resultName:n,nextLoc:i},"next"===this.method&&(this.arg=e),m}},t}(t.exports);try{regeneratorRuntime=i}catch(s){Function("r","regeneratorRuntime = r")(i)}},"96fb":function(t,e){t.exports=Math.sign||function(t){return 0==(t=+t)||t!=t?t:t<0?-1:1}},9707:function(t,e){},"970e":function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var i=n("050d"),s=n("e190");const r=(t,e,n)=>()=>{const r=new WeakMap,o=async(o,a,c)=>{let l=e(o);const u=Object(s["a"])(l,a);if(!u){const e={buffer:l.buffer,channelCount:l.channelCount,channelCountMode:l.channelCountMode,channelInterpretation:l.channelInterpretation,disableNormalization:!l.normalize};l=t(a,e)}return r.set(a,l),Object(i["a"])(l)?await n(o,a,l.inputs[0],c):await n(o,a,l,c),l};return{render(t,e,n){const i=r.get(e);return void 0!==i?Promise.resolve(i):o(t,e,n)}}}},9744:function(t,e,n){"use strict";var i=n("4588"),s=n("be13");t.exports=function(t){var e=String(s(this)),n="",r=i(t);if(r<0||r==1/0)throw RangeError("Count can't be negative");for(;r>0;(r>>>=1)&&(e+=e))1&r&&(n+=e);return n}},"974a":function(t,e){},"979d":function(t,e){},"97c9":function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var i=n("e190");const s=(t,e,n,s,r)=>()=>{const o=new WeakMap;let a=null,c=null;const l=async(l,u,h)=>{let d=n(l);const f=Object(i["a"])(d,u);if(!f){const t={buffer:d.buffer,channelCount:d.channelCount,channelCountMode:d.channelCountMode,channelInterpretation:d.channelInterpretation,loop:d.loop,loopEnd:d.loopEnd,loopStart:d.loopStart,playbackRate:d.playbackRate.value};d=e(u,t),null!==a&&d.start(...a),null!==c&&d.stop(c)}return o.set(u,d),f?await t(u,l.playbackRate,d.playbackRate,h):await s(u,l.playbackRate,d.playbackRate,h),await r(l,u,d,h),d};return{set start(t){a=t},set stop(t){c=t},render(t,e,n){const i=o.get(e);return void 0!==i?Promise.resolve(i):l(t,e,n)}}}},"97da":function(t,e){},9823:function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));const i=t=>(e,n,i,s)=>t(e,t=>t.createScriptProcessor(n,i,s))},"98a0":function(t,e){},"98b0":function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var i=n("cd00");const s=t=>e=>{const n=t.get(e);if(void 0===n)throw Object(i["a"])();return n}},"98c9":function(t,e){},"990b":function(t,e,n){var i=n("9093"),s=n("2621"),r=n("cb7c"),o=n("7726").Reflect;t.exports=o&&o.ownKeys||function(t){var e=i.f(r(t)),n=s.f;return n?e.concat(n(t)):e}},9928:function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));const i=(t,e,n,i)=>{let s=Object.getPrototypeOf(t);while(!s.hasOwnProperty(e))s=Object.getPrototypeOf(s);const{get:r,set:o}=Object.getOwnPropertyDescriptor(s,e);Object.defineProperty(t,e,{get:n(r),set:i(o)})}},9986:function(t,e,n){var i=n("6821"),s=n("11e9").f;n("5eda")("getOwnPropertyDescriptor",(function(){return function(t,e){return s(i(t),e)}}))},"99e8":function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));const i=(t,e)=>null===t?512:Math.max(512,Math.min(16384,Math.pow(2,Math.round(Math.log2(t*e)))))},"9a01":function(t,e){},"9a63":function(t,e){},"9aa6":function(t,e){},"9aea":function(t,e,n){var i=n("d3f4"),s=n("67ab").onFreeze;n("5eda")("preventExtensions",(function(t){return function(e){return t&&i(e)?t(s(e)):e}}))},"9b43":function(t,e,n){var i=n("d8e8");t.exports=function(t,e,n){if(i(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,i){return t.call(e,n,i)};case 3:return function(n,i,s){return t.call(e,n,i,s)}}return function(){return t.apply(e,arguments)}}},"9bbc":function(t,e){},"9bd2":function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));const i=(t,e,n,i,s,r,o,a,c,l,u)=>{const h=l.length;let d=a;for(let f=0;fclass extends t{constructor(t,r=i){const c=o(t),l={...i,...r},u=s(c,l),h=a(c),d=h?n():null;super(t,!1,u,d),this._attack=e(this,h,u.attack,1,0),this._knee=e(this,h,u.knee,40,0),this._nativeDynamicsCompressorNode=u,this._ratio=e(this,h,u.ratio,20,1),this._release=e(this,h,u.release,1,0),this._threshold=e(this,h,u.threshold,0,-100)}get attack(){return this._attack}get channelCount(){return this._nativeDynamicsCompressorNode.channelCount}set channelCount(t){const e=this._nativeDynamicsCompressorNode.channelCount;if(this._nativeDynamicsCompressorNode.channelCount=t,t>2)throw this._nativeDynamicsCompressorNode.channelCount=e,r()}get channelCountMode(){return this._nativeDynamicsCompressorNode.channelCountMode}set channelCountMode(t){const e=this._nativeDynamicsCompressorNode.channelCountMode;if(this._nativeDynamicsCompressorNode.channelCountMode=t,"max"===t)throw this._nativeDynamicsCompressorNode.channelCountMode=e,r()}get knee(){return this._knee}get ratio(){return this._ratio}get reduction(){return"number"===typeof this._nativeDynamicsCompressorNode.reduction.value?this._nativeDynamicsCompressorNode.reduction.value:this._nativeDynamicsCompressorNode.reduction}get release(){return this._release}get threshold(){return this._threshold}}},"9d50":function(t,e){},"9dc3":function(t,e){function n(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}t.exports=n},"9def":function(t,e,n){var i=n("4588"),s=Math.min;t.exports=function(t){return t>0?s(i(t),9007199254740991):0}},"9e1e":function(t,e,n){t.exports=!n("79e5")((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},"9e1f":function(t,e,n){var i=n("01f0");t.exports=function(t){return t.listenToMidi=function(e,n){var s={},r=n||{},o=r.gain||function(t){return t/127};return e.onmidimessage=function(e){var n=e.messageType?e:i(e);if("noteon"===n.messageType&&0===n.velocity&&(n.messageType="noteoff"),!r.channel||n.channel===r.channel)switch(n.messageType){case"noteon":s[n.key]=t.play(n.key,0,{gain:o(n.velocity)});break;case"noteoff":s[n.key]&&(s[n.key].stop(),delete s[n.key]);break}},t},t}},"9e24":function(t,e){},"9e26":function(t,e){},"9ec8":function(t,e,n){"use strict";n("386b")("fontsize",(function(t){return function(e){return t(this,"font","size",e)}}))},"9f0a":function(t,e){},"9f3c":function(t,e,n){var i=n("5ca1"),s=n("2d5c");i(i.S+i.F*(s!=Math.expm1),"Math",{expm1:s})},"9f52":function(t,e){},"9f9a":function(t,e){},a032:function(t,e,n){"use strict";var i=n("5ca1"),s=n("02f4")(!1);i(i.P,"String",{codePointAt:function(t){return s(this,t)}})},a038:function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var i=n("180a"),s=n("5b43");const r=(t,e,n,r,o,a,c)=>(l,u)=>{const h=n(l,t=>t.createWaveShaper());try{return h.curve=new Float32Array([1]),r(l,u)}catch{}Object(s["a"])(h,u);const d=u.curve;if(null!==d&&d.length<2)throw e();Object(i["a"])(h,u,"curve"),Object(i["a"])(h,u,"oversample");let f=null,p=!1;c(h,"curve",t=>()=>t.call(h),e=>n=>(e.call(h,n),p&&(o(n)&&null===f?f=t(l,h):o(n)||null===f||(f(),f=null)),n));const m=()=>{p=!0,o(h.curve)&&(f=t(l,h))},g=()=>{p=!1,null!==f&&(f(),f=null)};return a(h,m,g)}},a15f:function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));const i=(t,e)=>n=>{const i={value:t};return Object.defineProperties(n,{currentTarget:i,target:i}),"function"===typeof e?e.call(t,n):e.handleEvent.call(t,n)}},a163:function(t,e){},a199:function(t,e){},a19f:function(t,e,n){var i=n("5ca1"),s=n("cb7c"),r=Object.preventExtensions;i(i.S,"Reflect",{preventExtensions:function(t){s(t);try{return r&&r(t),!0}catch(e){return!1}}})},a1be:function(t,e){},a1c9:function(t,e){},a24e:function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));const i=()=>{try{return new DOMException("","InvalidAccessError")}catch(t){return t.code=15,t.name="InvalidAccessError",t}}},a256:function(t,e){function n(t){if(Array.isArray(t))return t}t.exports=n},a25f:function(t,e,n){var i=n("7726"),s=i.navigator;t.exports=s&&s.userAgent||""},a280:function(t,e){},a2a8:function(t,e){},a2af:function(t,e){},a2b4:function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var i=n("e190");const s=(t,e,n)=>()=>{const s=new WeakMap,r=async(r,o,a)=>{let c=e(r);const l=Object(i["a"])(c,o);if(!l){const e={channelCount:c.channelCount,channelCountMode:c.channelCountMode,channelInterpretation:c.channelInterpretation,numberOfInputs:c.numberOfInputs};c=t(o,e)}return s.set(o,c),await n(r,o,c,a),c};return{render(t,e,n){const i=s.get(e);return void 0!==i?Promise.resolve(i):r(t,e,n)}}}},a34a:function(t,e,n){t.exports=n("96cf")},a34b:function(t,e){},a481:function(t,e,n){"use strict";var i=n("cb7c"),s=n("4bf8"),r=n("9def"),o=n("4588"),a=n("0390"),c=n("5f1b"),l=Math.max,u=Math.min,h=Math.floor,d=/\$([$&`']|\d\d?|<[^>]*>)/g,f=/\$([$&`']|\d\d?)/g,p=function(t){return void 0===t?t:String(t)};n("214f")("replace",2,(function(t,e,n,m){return[function(i,s){var r=t(this),o=void 0==i?void 0:i[e];return void 0!==o?o.call(i,r,s):n.call(String(r),i,s)},function(t,e){var s=m(n,t,this,e);if(s.done)return s.value;var h=i(t),d=String(this),f="function"===typeof e;f||(e=String(e));var b=h.global;if(b){var v=h.unicode;h.lastIndex=0}var y=[];while(1){var S=c(h,d);if(null===S)break;if(y.push(S),!b)break;var x=String(S[0]);""===x&&(h.lastIndex=a(d,r(h.lastIndex),v))}for(var _="",w=0,E=0;E=w&&(_+=d.slice(w,C)+L,w=C+T.length)}return _+d.slice(w)}];function g(t,e,i,r,o,a){var c=i+t.length,l=r.length,u=f;return void 0!==o&&(o=s(o),u=d),n.call(a,u,(function(n,s){var a;switch(s.charAt(0)){case"$":return"$";case"&":return t;case"`":return e.slice(0,i);case"'":return e.slice(c);case"<":a=o[s.slice(1,-1)];break;default:var u=+s;if(0===u)return n;if(u>l){var d=h(u/10);return 0===d?n:d<=l?void 0===r[d-1]?s.charAt(1):r[d-1]+s.charAt(1):n}a=r[u-1]}return void 0===a?"":a}))}}))},a4b6:function(t,e){},a57a:function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var i=n("264b");const s=(t,e,n,s,r,o,a,c)=>(l,u)=>{const h=e.get(l);if(void 0===h)throw new Error("Missing the expected cycle count.");const d=o(l.context),f=c(d);if(h===u){if(e.delete(l),!f&&a(l)){const e=s(l),{outputs:o}=n(l);for(const n of o)if(Object(i["a"])(n)){const i=s(n[0]);t(e,i,n[1],n[2])}else{const t=r(n[0]);e.connect(t,n[1])}}}else e.set(l,h-u)}},a5b8:function(t,e,n){"use strict";var i=n("d8e8");function s(t){var e,n;this.promise=new t((function(t,i){if(void 0!==e||void 0!==n)throw TypeError("Bad Promise constructor");e=t,n=i})),this.resolve=i(e),this.reject=i(n)}t.exports.f=function(t){return new s(t)}},a604:function(t,e){},a65a:function(t,e){},a689:function(t,e){},a69f:function(t,e,n){var i=n("5ca1");i(i.S,"Math",{log2:function(t){return Math.log(t)/Math.LN2}})},a6d1:function(t,e){},a6fa:function(t,e){},a7f0:function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var i=n("a24e");const s=t=>{t.getFrequencyResponse=(e=>(n,s,r)=>{if(n.length!==s.length||s.length!==r.length)throw Object(i["a"])();return e.call(t,n,s,r)})(t.getFrequencyResponse)},r={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers"},o=(t,e,n,i,o)=>class extends t{constructor(t,a){const c=i(t),l=o(c),u={...r,...a},h=e(c,l?null:t.baseLatency,u),d=l?n(u.feedback,u.feedforward):null;super(t,!1,h,d),s(h),this._nativeIIRFilterNode=h}getFrequencyResponse(t,e,n){return this._nativeIIRFilterNode.getFrequencyResponse(t,e,n)}}},a7f8:function(t,e){},a827:function(t,e){},a8ba:function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var i=n("383e");const s={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",gain:1},r=(t,e,n,r,o,a)=>class extends t{constructor(t,c=s){const l=o(t),u={...s,...c},h=r(l,u),d=a(l),f=d?n():null;super(t,!1,h,f),this._gain=e(this,d,h.gain,i["b"],i["a"])}get gain(){return this._gain}}},a8ce:function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));const i=t=>void 0===t||"number"===typeof t||"string"===typeof t&&("balanced"===t||"interactive"===t||"playback"===t)},a971:function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));const i=t=>()=>{if(null===t)return!1;try{new t({length:1,sampleRate:44100})}catch{return!1}return!0}},a989:function(t,e){},a9b8:function(t,e){},a9c1:function(t,e){},aa59:function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var i=n("7b2d");const s=t=>{t.getChannelData=(e=>n=>{try{return e.call(t,n)}catch(s){if(12===s.code)throw Object(i["a"])();throw s}})(t.getChannelData)}},aa77:function(t,e,n){var i=n("5ca1"),s=n("be13"),r=n("79e5"),o=n("fdef"),a="["+o+"]",c="​…",l=RegExp("^"+a+a+"*"),u=RegExp(a+a+"*$"),h=function(t,e,n){var s={},a=r((function(){return!!o[t]()||c[t]()!=c})),l=s[t]=a?e(d):o[t];n&&(s[n]=l),i(i.P+i.F*a,"String",s)},d=h.trim=function(t,e){return t=String(s(t)),1&e&&(t=t.replace(l,"")),2&e&&(t=t.replace(u,"")),t};t.exports=h},aabd:function(t,e){},aad8:function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));const i=t=>null===t?null:t.hasOwnProperty("AudioContext")?t.AudioContext:t.hasOwnProperty("webkitAudioContext")?t.webkitAudioContext:null},aae3:function(t,e,n){var i=n("d3f4"),s=n("2d95"),r=n("2b4c")("match");t.exports=function(t){var e;return i(t)&&(void 0!==(e=t[r])?!!e:"RegExp"==s(t))}},ab19:function(t,e,n){"use strict";var i=n("b79a"),s=n("fcc1");function r(t){return function(e){return"string"===typeof e&&t.test(e)}}function o(t,e){return"string"===typeof t?t+e:"function"===typeof t?t(e):e}function a(t,e,n,i){var s=c(e)?l:u(e)?h:d(e)?f:p(e)?m:g(e)?b:v(e)?y:S(e)?x:_(e)?w:null,r=n||{};return s?s(t,e,r):i?Promise.resolve(i):Promise.reject("Source not valid ("+e+")")}function c(t){return t instanceof ArrayBuffer}function l(t,e,n){return new Promise((function(n,i){t.decodeAudioData(e,(function(t){n(t)}),(function(){i("Can't decode audio data ("+e.slice(0,30)+"...)")}))}))}a.fetch=s;var u=r(/\.(mp3|wav|ogg)(\?.*)?$/i);function h(t,e,n){var i=o(n.from,e);return a(t,a.fetch(i,"arraybuffer"),n)}function d(t){return t&&"function"===typeof t.then}function f(t,e,n){return e.then((function(e){return a(t,e,n)}))}var p=Array.isArray;function m(t,e,n){return Promise.all(e.map((function(e){return a(t,e,n,e)})))}function g(t){return t&&"object"===typeof t}function b(t,e,n){var i={},s=Object.keys(e).map((function(s){if(n.only&&-1===n.only.indexOf(s))return null;var r=e[s];return a(t,r,n,r).then((function(t){i[s]=t}))}));return Promise.all(s).then((function(){return i}))}var v=r(/\.json(\?.*)?$/i);function y(t,e,n){var i=o(n.from,e);return a(t,a.fetch(i,"text").then(JSON.parse),n)}var S=r(/^data:audio/);function x(t,e,n){var s=e.indexOf(",");return a(t,i.decode(e.slice(s+1)).buffer,n)}var _=r(/\.js(\?.*)?$/i);function w(t,e,n){var i=o(n.from,e);return a(t,a.fetch(i,"text").then(E),n)}function E(t){var e=t.indexOf("MIDI.Soundfont.");if(e<0)throw Error("Invalid MIDI.js Soundfont format");e=t.indexOf("=",e)+2;var n=t.lastIndexOf(",");return JSON.parse(t.slice(e,n)+"}")}t.exports&&(t.exports=a),"undefined"!==typeof window&&(window.loadAudio=a)},ab1c:function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));const i=(t,e)=>()=>{if(null===e)return!1;const n=new e(1,1,44100);if(void 0===n.createConstantSource)return!0;const i=t(n,t=>t.createConstantSource());return i.offset.maxValue!==Number.POSITIVE_INFINITY}},abb6:function(t,e){},abdd:function(t,e){},ac4d:function(t,e,n){n("3a72")("asyncIterator")},ac6a:function(t,e,n){for(var i=n("cadf"),s=n("0d58"),r=n("2aba"),o=n("7726"),a=n("32e9"),c=n("84f2"),l=n("2b4c"),u=l("iterator"),h=l("toStringTag"),d=c.Array,f={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},p=s(f),m=0;m()=>{if(null===e)return!1;const n=new e(1,1,44100),i=t(n,t=>t.createChannelMerger());if("max"===i.channelCountMode)return!0;try{i.channelCount=2}catch{return!0}return!1}},ae66:function(t,e){},ae71:function(t,e){},aee0:function(t,e){},aeeb:function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var i=n("752e");const s=t=>i["a"].has(t)},aef6:function(t,e,n){"use strict";var i=n("5ca1"),s=n("9def"),r=n("d2c8"),o="endsWith",a=""[o];i(i.P+i.F*n("5147")(o),"String",{endsWith:function(t){var e=r(this,t,o),n=arguments.length>1?arguments[1]:void 0,i=s(e.length),c=void 0===n?i:Math.min(s(n),i),l=String(t);return a?a.call(e,l,c):e.slice(c-l.length,c)===l}})},af56:function(t,e,n){n("ec30")("Uint16",2,(function(t){return function(e,n,i){return t(this,e,n,i)}}))},af70:function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));const i=(t,e)=>(n,i)=>{const s=e.get(n);if(void 0!==s)return s;const r=t.get(n);if(void 0!==r)return r;try{const s=i();return s instanceof Promise?(t.set(n,s),s.catch(()=>!1).then(i=>(t.delete(n),e.set(n,i),i))):(e.set(n,s),s)}catch{return e.set(n,!1),!1}}},afca:function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var i=n("180a"),s=n("5b43");const r=(t,e,n,r)=>(o,a)=>{const c=t(o,t=>t.createConvolver());try{c.channelCount=1}catch(l){return e(o,a)}if(Object(s["a"])(c,a),a.disableNormalization===c.normalize&&(c.normalize=!a.disableNormalization),Object(i["a"])(c,a,"buffer"),a.channelCount>2)throw n();if(r(c,"channelCount",t=>()=>t.call(c),t=>e=>{if(e>2)throw n();return t.call(c,e)}),"max"===a.channelCountMode)throw n();return r(c,"channelCountMode",t=>()=>t.call(c),t=>e=>{if("max"===e)throw n();return t.call(c,e)}),c}},b05c:function(t,e,n){n("ec30")("Int8",1,(function(t){return function(e,n,i){return t(this,e,n,i)}}))},b08a:function(t,e){},b096:function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));const i=(t,e)=>n=>t(n)||e(n)},b0a5:function(t,e){function n(t,e){return function(n,i,s,r){t(n,i,s,r),e(n,i,s,r)}}t.exports=function(t){return t.on=function(e,i){if(1===arguments.length&&"function"===typeof e)return t.on("event",e);var s="on"+e,r=t[s];return t[s]=r?n(r,i):i,t},t}},b0c5:function(t,e,n){"use strict";var i=n("520a");n("5ca1")({target:"RegExp",proto:!0,forced:i!==/./.exec},{exec:i})},b0f2:function(t,e){},b0f4:function(t,e){},b158:function(t,e){},b1b1:function(t,e,n){var i=n("5ca1"),s=n("9c12"),r=Math.abs;i(i.S,"Number",{isSafeInteger:function(t){return s(t)&&r(t)<=9007199254740991}})},b1e4:function(t,e){},b39a:function(t,e,n){var i=n("d3f4");t.exports=function(t,e){if(!i(t)||t._t!==e)throw TypeError("Incompatible receiver, "+e+" required!");return t}},b3b4:function(t,e){},b464:function(t,e){},b480:function(t,e){},b50d:function(t,e,n){"use strict";var i=n("c532"),s=n("467f"),r=n("7aac"),o=n("30b5"),a=n("83b9"),c=n("c345"),l=n("3934"),u=n("2d83");t.exports=function(t){return new Promise((function(e,n){var h=t.data,d=t.headers;i.isFormData(h)&&delete d["Content-Type"];var f=new XMLHttpRequest;if(t.auth){var p=t.auth.username||"",m=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";d.Authorization="Basic "+btoa(p+":"+m)}var g=a(t.baseURL,t.url);if(f.open(t.method.toUpperCase(),o(g,t.params,t.paramsSerializer),!0),f.timeout=t.timeout,f.onreadystatechange=function(){if(f&&4===f.readyState&&(0!==f.status||f.responseURL&&0===f.responseURL.indexOf("file:"))){var i="getAllResponseHeaders"in f?c(f.getAllResponseHeaders()):null,r=t.responseType&&"text"!==t.responseType?f.response:f.responseText,o={data:r,status:f.status,statusText:f.statusText,headers:i,config:t,request:f};s(e,n,o),f=null}},f.onabort=function(){f&&(n(u("Request aborted",t,"ECONNABORTED",f)),f=null)},f.onerror=function(){n(u("Network Error",t,null,f)),f=null},f.ontimeout=function(){var e="timeout of "+t.timeout+"ms exceeded";t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),n(u(e,t,"ECONNABORTED",f)),f=null},i.isStandardBrowserEnv()){var b=(t.withCredentials||l(g))&&t.xsrfCookieName?r.read(t.xsrfCookieName):void 0;b&&(d[t.xsrfHeaderName]=b)}if("setRequestHeader"in f&&i.forEach(d,(function(t,e){"undefined"===typeof h&&"content-type"===e.toLowerCase()?delete d[e]:f.setRequestHeader(e,t)})),i.isUndefined(t.withCredentials)||(f.withCredentials=!!t.withCredentials),t.responseType)try{f.responseType=t.responseType}catch(v){if("json"!==t.responseType)throw v}"function"===typeof t.onDownloadProgress&&f.addEventListener("progress",t.onDownloadProgress),"function"===typeof t.onUploadProgress&&f.upload&&f.upload.addEventListener("progress",t.onUploadProgress),t.cancelToken&&t.cancelToken.promise.then((function(t){f&&(f.abort(),n(t),f=null)})),h||(h=null),f.send(h)}))}},b510:function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));const i=(t,e,n,i)=>class extends t{constructor(t,s){const r=n(t),o=e(r,s);if(i(r))throw TypeError();super(t,!0,o,null),this._mediaElement=s.mediaElement,this._nativeMediaElementAudioSourceNode=o}get mediaElement(){return void 0===this._nativeMediaElementAudioSourceNode.mediaElement?this._mediaElement:this._nativeMediaElementAudioSourceNode.mediaElement}}},b54a:function(t,e,n){"use strict";n("386b")("link",(function(t){return function(e){return t(this,"a","href",e)}}))},b5c1:function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var i=n("8af4");const s=t=>(e,n)=>{const s=t(n,t=>t.createGain());e.connect(s);const r=(t=>()=>{t.call(e,s),e.removeEventListener("ended",r)})(e.disconnect);e.addEventListener("ended",r),Object(i["a"])(e,s),e.stop=(t=>{let n=!1;return(i=0)=>{if(n)try{t.call(e,i)}catch{s.gain.setValueAtTime(0,i)}else t.call(e,i),n=!0}})(e.stop)}},b5e3:function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var i=n("e190");const s=(t,e,n,s,r)=>()=>{const o=new WeakMap,a=async(a,c,l)=>{let u=n(a);const h=Object(i["a"])(u,c);if(!h){const t={Q:u.Q.value,channelCount:u.channelCount,channelCountMode:u.channelCountMode,channelInterpretation:u.channelInterpretation,detune:u.detune.value,frequency:u.frequency.value,gain:u.gain.value,type:u.type};u=e(c,t)}return o.set(c,u),h?(await t(c,a.Q,u.Q,l),await t(c,a.detune,u.detune,l),await t(c,a.frequency,u.frequency,l),await t(c,a.gain,u.gain,l)):(await s(c,a.Q,u.Q,l),await s(c,a.detune,u.detune,l),await s(c,a.frequency,u.frequency,l),await s(c,a.gain,u.gain,l)),await r(a,c,u,l),u};return{render(t,e,n){const i=o.get(e);return void 0!==i?Promise.resolve(i):a(t,e,n)}}}},b5f9:function(t,e){},b61d:function(t,e){},b646:function(t,e){},b6e4:function(t,e,n){n("ec30")("Int32",4,(function(t){return function(e,n,i){return t(this,e,n,i)}}))},b79a:function(t,e,n){"use strict";function i(t){return t>64&&t<91?t-65:t>96&&t<123?t-71:t>47&&t<58?t+4:43===t?62:47===t?63:0}function s(t,e){for(var n,s,r=t.replace(/[^A-Za-z0-9\+\/]/g,""),o=r.length,a=e?Math.ceil((3*o+1>>2)/e)*e:3*o+1>>2,c=new Uint8Array(a),l=0,u=0,h=0;h>>(16>>>n&24)&255;l=0}return c}t.exports={decode:s}},b81c:function(t,e){},b8ae:function(t,e){},b957:function(t,e){},b9a1:function(t,e,n){"use strict";var i=n("5ca1"),s=n("4bf8"),r=n("6a99"),o=n("38fd"),a=n("11e9").f;n("9e1e")&&i(i.P+n("c5b4"),"Object",{__lookupGetter__:function(t){var e,n=s(this),i=r(t,!0);do{if(e=a(n,i))return e.get}while(n=o(n))}})},b9b0:function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var i=n("fd82"),s=n("aa59");const r={numberOfChannels:1},o=(t,e,n,o,a,c,l,u)=>{let h=null;return class d{constructor(d){if(null===a)throw new Error("Missing the native OfflineAudioContext constructor.");const{length:f,numberOfChannels:p,sampleRate:m}={...r,...d};null===h&&(h=new a(1,1,44100));const g=null!==o&&e(c,c)?new o({length:f,numberOfChannels:p,sampleRate:m}):h.createBuffer(p,f,m);if(0===g.numberOfChannels)throw n();return"function"!==typeof g.copyFromChannel?(l(g),Object(s["a"])(g)):e(i["a"],()=>Object(i["a"])(g))||u(g),t.add(g),g}static[Symbol.hasInstance](e){return null!==e&&"object"===typeof e&&Object.getPrototypeOf(e)===d.prototype||t.has(e)}}}},b9ea:function(t,e){},b9f1:function(t,e){},b9fb:function(t,e){},ba16:function(t,e,n){var i=n("5ca1"),s=n("11e9").f,r=n("cb7c");i(i.S,"Reflect",{deleteProperty:function(t,e){var n=s(r(t),e);return!(n&&!n.configurable)&&delete t[e]}})},ba7d:function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var i=n("0bf9"),s=n("5b43");const r=(t,e)=>(n,r)=>{const o=t(n,t=>t.createDynamicsCompressor());if(Object(s["a"])(o,r),r.channelCount>2)throw e();if("max"===r.channelCountMode)throw e();return Object(i["a"])(o,r,"attack"),Object(i["a"])(o,r,"knee"),Object(i["a"])(o,r,"ratio"),Object(i["a"])(o,r,"release"),Object(i["a"])(o,r,"threshold"),o}},ba92:function(t,e,n){"use strict";var i=n("4bf8"),s=n("77f1"),r=n("9def");t.exports=[].copyWithin||function(t,e){var n=i(this),o=r(n.length),a=s(t,o),c=s(e,o),l=arguments.length>2?arguments[2]:void 0,u=Math.min((void 0===l?o:s(l,o))-c,o-a),h=1;c0)c in n?n[a]=n[c]:delete n[a],a+=h,c+=h;return n}},baba:function(t,e){},bb21:function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));const i=(t,e)=>()=>{if(null===e)return Promise.resolve(!1);const n=new e(1,1,44100),i=t(n,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});return new Promise(t=>{n.oncomplete=()=>{i.disconnect(),t(0!==n.currentTime)},n.startRendering()})}},bc3a:function(t,e,n){t.exports=n("cee4")},bc86:function(t,e){},bc93:function(t,e){},bcaa:function(t,e,n){var i=n("cb7c"),s=n("d3f4"),r=n("a5b8");t.exports=function(t,e){if(i(t),s(e)&&e.constructor===t)return e;var n=r.f(t),o=n.resolve;return o(e),n.promise}},bcc4:function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));const i={buffer:null,channelCount:2,channelCountMode:"clamped-max",channelInterpretation:"speakers",disableNormalization:!1},s=(t,e,n,s,r)=>class extends t{constructor(t,o=i){const a=s(t),c={...i,...o},l=n(a,c),u=r(a),h=u?e():null;super(t,!1,l,h),this._isBufferNullified=!1,this._nativeConvolverNode=l}get buffer(){return this._isBufferNullified?null:this._nativeConvolverNode.buffer}set buffer(t){if(this._nativeConvolverNode.buffer=t,null===t&&null!==this._nativeConvolverNode.buffer){const t=this._nativeConvolverNode.context;this._nativeConvolverNode.buffer=t.createBuffer(1,1,t.sampleRate),this._isBufferNullified=!0}else this._isBufferNullified=!1}get normalize(){return this._nativeConvolverNode.normalize}set normalize(t){this._nativeConvolverNode.normalize=t}}},bd33:function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));const i=t=>()=>null!==t&&t.hasOwnProperty("isSecureContext")},bd82:function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));const i=t=>e=>null!==t&&"function"===typeof t.AudioParam&&e instanceof t.AudioParam},bdd3:function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));const i=async(t,e,n,i,s,r,o,a,c,l,u,h,d,f)=>{if(t(e,e)&&t(n,n)&&t(s,s)&&t(r,r)&&t(a,a)&&t(c,c)&&t(l,l)&&t(u,u)&&t(h,h)){const e=await Promise.all([t(i,i),t(o,o),t(d,d),t(f,f)]);return e.every(t=>t)}return!1}},be13:function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},be78:function(t,e){},bf40:function(t,e,n){},bf74:function(t,e){},bfb6:function(t,e){},c02b:function(t,e,n){"use strict";var i=n("643e"),s=n("b39a"),r="WeakSet";n("e0b8")(r,(function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}}),{add:function(t){return i.def(s(this,r),t,!0)}},i,!1,!0)},c02f:function(t,e){},c033:function(t,e){},c05b:function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var i=n("752e");const s=(t,e,n,s,r,o)=>class extends n{constructor(n,o){super(n),this._nativeContext=n,i["g"].set(this,n);const a=n.sampleRate;Object.defineProperty(n,"sampleRate",{get:()=>a}),s(n)&&r.set(n,new Set),this._destination=new t(this,o),this._listener=e(this,n),this._onstatechange=null}get currentTime(){return this._nativeContext.currentTime}get destination(){return this._destination}get listener(){return this._listener}get onstatechange(){return this._onstatechange}set onstatechange(t){const e="function"===typeof t?o(this,t):null;this._nativeContext.onstatechange=e;const n=this._nativeContext.onstatechange;this._onstatechange=null!==n&&n===e?t:n}get sampleRate(){return this._nativeContext.sampleRate}get state(){return this._nativeContext.state}}},c0b0:function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));const i=t=>{let e=null;const n=async(e,n,i)=>{const s=n.destination;return await t(e,n,s,i),s};return{render(t,i,s){return null===e&&(e=n(t,i,s)),e}}}},c0ca:function(t,e){},c121:function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));const i=t=>(e,n,i,s)=>t(n,e,i,s)},c153:function(t,e){},c15b:function(t,e){},c1aa:function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));const i=t=>e=>(t[0]=e,t[0])},c1ca:function(t,e){},c26b:function(t,e,n){"use strict";var i=n("86cc").f,s=n("2aeb"),r=n("dcbc"),o=n("9b43"),a=n("f605"),c=n("4a59"),l=n("01f9"),u=n("d53b"),h=n("7a56"),d=n("9e1e"),f=n("67ab").fastKey,p=n("b39a"),m=d?"_s":"size",g=function(t,e){var n,i=f(e);if("F"!==i)return t._i[i];for(n=t._f;n;n=n.n)if(n.k==e)return n};t.exports={getConstructor:function(t,e,n,l){var u=t((function(t,i){a(t,u,e,"_i"),t._t=e,t._i=s(null),t._f=void 0,t._l=void 0,t[m]=0,void 0!=i&&c(i,n,t[l],t)}));return r(u.prototype,{clear:function(){for(var t=p(this,e),n=t._i,i=t._f;i;i=i.n)i.r=!0,i.p&&(i.p=i.p.n=void 0),delete n[i.i];t._f=t._l=void 0,t[m]=0},delete:function(t){var n=p(this,e),i=g(n,t);if(i){var s=i.n,r=i.p;delete n._i[i.i],i.r=!0,r&&(r.n=s),s&&(s.p=r),n._f==i&&(n._f=s),n._l==i&&(n._l=r),n[m]--}return!!i},forEach:function(t){p(this,e);var n,i=o(t,arguments.length>1?arguments[1]:void 0,3);while(n=n?n.n:this._f){i(n.v,n.k,this);while(n&&n.r)n=n.p}},has:function(t){return!!g(p(this,e),t)}}),d&&i(u.prototype,"size",{get:function(){return p(this,e)[m]}}),u},def:function(t,e,n){var i,s,r=g(t,e);return r?r.v=n:(t._l=r={i:s=f(e,!0),k:e,v:n,p:i=t._l,n:void 0,r:!1},t._f||(t._f=r),i&&(i.n=r),t[m]++,"F"!==s&&(t._i[s]=r)),t},getEntry:g,setStrong:function(t,e,n){l(t,e,(function(t,n){this._t=p(t,e),this._k=n,this._l=void 0}),(function(){var t=this,e=t._k,n=t._l;while(n&&n.r)n=n.p;return t._t&&(t._l=n=n?n.n:t._t._f)?u(0,"keys"==e?n.k:"values"==e?n.v:[n.k,n.v]):(t._t=void 0,u(1))}),n?"entries":"values",!n,!0),h(e)}}},c2f0:function(t,e){},c345:function(t,e,n){"use strict";var i=n("c532"),s=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];t.exports=function(t){var e,n,r,o={};return t?(i.forEach(t.split("\n"),(function(t){if(r=t.indexOf(":"),e=i.trim(t.substr(0,r)).toLowerCase(),n=i.trim(t.substr(r+1)),e){if(o[e]&&s.indexOf(e)>=0)return;o[e]="set-cookie"===e?(o[e]?o[e]:[]).concat([n]):o[e]?o[e]+", "+n:n}})),o):o}},c348:function(t,e){},c366:function(t,e,n){var i=n("6821"),s=n("9def"),r=n("77f1");t.exports=function(t){return function(e,n,o){var a,c=i(e),l=s(c.length),u=r(o,l);if(t&&n!=n){while(l>u)if(a=c[u++],a!=a)return!0}else for(;l>u;u++)if((t||u in c)&&c[u]===n)return t||u||0;return!t&&-1}}},c388:function(t,e){},c399:function(t,e){},c3be:function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var i=n("264b");const s=(t,e,n,s,r,o)=>a=>(c,l)=>{const u=t.get(c);if(void 0===u){if(!a&&o(c)){const t=s(c),{outputs:o}=n(c);for(const n of o)if(Object(i["a"])(n)){const i=s(n[0]);e(t,i,n[1],n[2])}else{const e=r(n[0]);t.disconnect(e,n[1])}}t.set(c,l)}else t.set(c,u+l)}},c3f1:function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));const i={channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:6},s=(t,e,n,s,r)=>class extends t{constructor(t,o=i){const a=s(t),c={...i,...o},l=n(a,c),u=r(a)?e():null;super(t,!1,l,u)}}},c401:function(t,e,n){"use strict";var i=n("c532");t.exports=function(t,e,n){return i.forEach(n,(function(n){t=n(t,e)})),t}},c532:function(t,e,n){"use strict";var i=n("1d2b"),s=Object.prototype.toString;function r(t){return"[object Array]"===s.call(t)}function o(t){return"undefined"===typeof t}function a(t){return null!==t&&!o(t)&&null!==t.constructor&&!o(t.constructor)&&"function"===typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}function c(t){return"[object ArrayBuffer]"===s.call(t)}function l(t){return"undefined"!==typeof FormData&&t instanceof FormData}function u(t){var e;return e="undefined"!==typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&t.buffer instanceof ArrayBuffer,e}function h(t){return"string"===typeof t}function d(t){return"number"===typeof t}function f(t){return null!==t&&"object"===typeof t}function p(t){if("[object Object]"!==s.call(t))return!1;var e=Object.getPrototypeOf(t);return null===e||e===Object.prototype}function m(t){return"[object Date]"===s.call(t)}function g(t){return"[object File]"===s.call(t)}function b(t){return"[object Blob]"===s.call(t)}function v(t){return"[object Function]"===s.call(t)}function y(t){return f(t)&&v(t.pipe)}function S(t){return"undefined"!==typeof URLSearchParams&&t instanceof URLSearchParams}function x(t){return t.replace(/^\s*/,"").replace(/\s*$/,"")}function _(){return("undefined"===typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!==typeof window&&"undefined"!==typeof document)}function w(t,e){if(null!==t&&"undefined"!==typeof t)if("object"!==typeof t&&(t=[t]),r(t))for(var n=0,i=t.length;n"function"===typeof t.getFloatTimeDomainData,o=t=>{t.getFloatTimeDomainData=e=>{const n=new Uint8Array(e.length);t.getByteTimeDomainData(n);const i=Math.max(n.length,t.fftSize);for(let t=0;t(a,c)=>{const l=n(a,t=>t.createAnalyser());if(Object(s["a"])(l,c),!(c.maxDecibels>c.minDecibels))throw e();return Object(i["a"])(l,c,"fftSize"),Object(i["a"])(l,c,"maxDecibels"),Object(i["a"])(l,c,"minDecibels"),Object(i["a"])(l,c,"smoothingTimeConstant"),t(r,()=>r(l))||o(l),l}},c541:function(t,e){},c569:function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var i=n("1e82"),s=n("c895");const r={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",detune:0,frequency:440,type:"sine"},o=(t,e,n,o,a,c,l,u)=>class extends t{constructor(t,n=r){const i=c(t),s={...r,...n},u=o(i,s),h=l(i),d=h?a():null,f=t.sampleRate/2;super(t,!1,u,d),this._detune=e(this,h,u.detune,153600,-153600),this._frequency=e(this,h,u.frequency,f,-f),this._nativeOscillatorNode=u,this._onended=null,this._oscillatorNodeRenderer=d,null!==this._oscillatorNodeRenderer&&void 0!==s.periodicWave&&(this._oscillatorNodeRenderer.periodicWave=s.periodicWave)}get detune(){return this._detune}get frequency(){return this._frequency}get onended(){return this._onended}set onended(t){const e="function"===typeof t?u(this,t):null;this._nativeOscillatorNode.onended=e;const n=this._nativeOscillatorNode.onended;this._onended=null!==n&&n===e?t:n}get type(){return this._nativeOscillatorNode.type}set type(t){if(this._nativeOscillatorNode.type=t,"custom"===t)throw n();null!==this._oscillatorNodeRenderer&&(this._oscillatorNodeRenderer.periodicWave=null)}setPeriodicWave(t){this._nativeOscillatorNode.setPeriodicWave(t),null!==this._oscillatorNodeRenderer&&(this._oscillatorNodeRenderer.periodicWave=t)}start(t=0){if(this._nativeOscillatorNode.start(t),null!==this._oscillatorNodeRenderer)this._oscillatorNodeRenderer.start=t;else{Object(i["a"])(this);const t=()=>{this._nativeOscillatorNode.removeEventListener("ended",t),setTimeout(()=>Object(s["a"])(this),1e3)};this._nativeOscillatorNode.addEventListener("ended",t)}}stop(t=0){this._nativeOscillatorNode.stop(t),null!==this._oscillatorNodeRenderer&&(this._oscillatorNodeRenderer.stop=t)}}},c57a:function(t,e){},c5b4:function(t,e,n){"use strict";t.exports=n("2d00")||!n("79e5")((function(){var t=Math.random();__defineSetter__.call(null,t,(function(){})),delete n("7726")[t]}))},c5f6:function(t,e,n){"use strict";var i=n("7726"),s=n("69a8"),r=n("2d95"),o=n("5dbc"),a=n("6a99"),c=n("79e5"),l=n("9093").f,u=n("11e9").f,h=n("86cc").f,d=n("aa77").trim,f="Number",p=i[f],m=p,g=p.prototype,b=r(n("2aeb")(g))==f,v="trim"in String.prototype,y=function(t){var e=a(t,!1);if("string"==typeof e&&e.length>2){e=v?e.trim():d(e,3);var n,i,s,r=e.charCodeAt(0);if(43===r||45===r){if(n=e.charCodeAt(2),88===n||120===n)return NaN}else if(48===r){switch(e.charCodeAt(1)){case 66:case 98:i=2,s=49;break;case 79:case 111:i=8,s=55;break;default:return+e}for(var o,c=e.slice(2),l=0,u=c.length;ls)return NaN;return parseInt(c,i)}}return+e};if(!p(" 0o1")||!p("0b1")||p("+0x1")){p=function(t){var e=arguments.length<1?0:t,n=this;return n instanceof p&&(b?c((function(){g.valueOf.call(n)})):r(n)!=f)?o(new m(y(e)),n,p):y(e)};for(var S,x=n("9e1e")?l(m):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),_=0;x.length>_;_++)s(m,S=x[_])&&!s(p,S)&&h(p,S,u(m,S));p.prototype=g,g.constructor=p,n("2aba")(i,f,p)}},c66f:function(t,e,n){"use strict";var i=n("5ca1"),s=n("0f88"),r=n("ed0b"),o=n("cb7c"),a=n("77f1"),c=n("9def"),l=n("d3f4"),u=n("7726").ArrayBuffer,h=n("ebd6"),d=r.ArrayBuffer,f=r.DataView,p=s.ABV&&u.isView,m=d.prototype.slice,g=s.VIEW,b="ArrayBuffer";i(i.G+i.W+i.F*(u!==d),{ArrayBuffer:d}),i(i.S+i.F*!s.CONSTR,b,{isView:function(t){return p&&p(t)||l(t)&&g in t}}),i(i.P+i.U+i.F*n("79e5")((function(){return!new d(2).slice(1,void 0).byteLength})),b,{slice:function(t,e){if(void 0!==m&&void 0===e)return m.call(o(this),t);var n=o(this).byteLength,i=a(t,n),s=a(void 0===e?n:e,n),r=new(h(this,d))(c(s-i)),l=new f(this),u=new f(r),p=0;while(i0?(i=n/c,r+=i*i):r+=n;return c===1/0?1/0:c*Math.sqrt(r)}})},c7c62:function(t,e,n){var i=n("5ca1"),s=n("2d5c"),r=Math.exp;i(i.S,"Math",{tanh:function(t){var e=s(t=+t),n=s(-t);return e==1/0?1:n==1/0?-1:(e-n)/(r(t)+r(-t))}})},c7d6:function(t,e){},c80b:function(t,e){},c895:function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var i=n("752e"),s=n("e427");const r=t=>{if(!i["a"].has(t))throw new Error("The AudioNode is not stored.");i["a"].delete(t),Object(s["a"])(t).forEach(t=>t(!1))}},c896:function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));const i=t=>(e,n)=>{const i=t(e);return n(null!==i?i:e)}},c8a9:function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));const i=(t,e,n,i,s,r,o,a)=>class extends t{constructor(t,n){const i=r(t),c=o(i),l=s(i,n,c),u=c?e(a):null;super(t,!1,l,u),this._isNodeOfNativeOfflineAudioContext=c,this._nativeAudioDestinationNode=l}get channelCount(){return this._nativeAudioDestinationNode.channelCount}set channelCount(t){if(this._isNodeOfNativeOfflineAudioContext)throw i();if(t>this._nativeAudioDestinationNode.maxChannelCount)throw n();this._nativeAudioDestinationNode.channelCount=t}get channelCountMode(){return this._nativeAudioDestinationNode.channelCountMode}set channelCountMode(t){if(this._isNodeOfNativeOfflineAudioContext)throw i();this._nativeAudioDestinationNode.channelCountMode=t}get maxChannelCount(){return this._nativeAudioDestinationNode.maxChannelCount}}},c8af:function(t,e,n){"use strict";var i=n("c532");t.exports=function(t,e){i.forEach(t,(function(n,i){i!==e&&i.toUpperCase()===e.toUpperCase()&&(t[e]=n,delete t[i])}))}},c8ba:function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(i){"object"===typeof window&&(n=window)}t.exports=n},c8ce:function(t,e,n){var i=n("2b4c")("toPrimitive"),s=Date.prototype;i in s||n("32e9")(s,i,n("8381"))},c953:function(t,e){},c965:function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));const i=t=>"context"in t},ca04:function(t,e){},ca24:function(t,e){},ca5a:function(t,e){var n=0,i=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+i).toString(36))}},ca6e:function(t,e){},cacd:function(t,e){},cadf:function(t,e,n){"use strict";var i=n("9c6c"),s=n("d53b"),r=n("84f2"),o=n("6821");t.exports=n("01f9")(Array,"Array",(function(t,e){this._t=o(t),this._i=0,this._k=e}),(function(){var t=this._t,e=this._k,n=this._i++;return!t||n>=t.length?(this._t=void 0,s(1)):s(0,"keys"==e?n:"values"==e?t[n]:[n,t[n]])}),"values"),r.Arguments=r.Array,i("keys"),i("values"),i("entries")},cafb:function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));const i=t=>e=>{const n=t(e,t=>t.createOscillator());try{n.start(-1)}catch(i){return i instanceof RangeError}return!1}},cb12:function(t,e){},cb7c:function(t,e,n){var i=n("d3f4");t.exports=function(t){if(!i(t))throw TypeError(t+" is not an object!");return t}},cb86:function(t,e){},cba6:function(t,e){},cbf2:function(t,e){},cc54:function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var i=n("0bf9"),s=n("180a"),r=n("5b43");const o=(t,e)=>(n,o)=>{const a=t(n,t=>t.createPanner());return void 0===a.orientationX?e(n,o):(Object(r["a"])(a,o),Object(i["a"])(a,o,"orientationX"),Object(i["a"])(a,o,"orientationY"),Object(i["a"])(a,o,"orientationZ"),Object(i["a"])(a,o,"positionX"),Object(i["a"])(a,o,"positionY"),Object(i["a"])(a,o,"positionZ"),Object(s["a"])(a,o,"coneInnerAngle"),Object(s["a"])(a,o,"coneOuterAngle"),Object(s["a"])(a,o,"coneOuterGain"),Object(s["a"])(a,o,"distanceModel"),Object(s["a"])(a,o,"maxDistance"),Object(s["a"])(a,o,"panningModel"),Object(s["a"])(a,o,"refDistance"),Object(s["a"])(a,o,"rolloffFactor"),a)}},cc7a:function(t,e){},ccf9:function(t,e,n){"use strict";var i=/^([a-gA-G])(#{1,}|b{1,}|x{1,}|)(-?\d*)\s*(.*)\s*$/;function s(){return i}var r=[0,2,4,5,7,9,11];function o(t,e,n){if("string"!==typeof t)return null;var s=i.exec(t);if(!s||!e&&s[4])return null;var o={letter:s[1].toUpperCase(),acc:s[2].replace(/x/g,"##")};return o.pc=o.letter+o.acc,o.step=(o.letter.charCodeAt(0)+3)%7,o.alt="b"===o.acc[0]?-o.acc.length:o.acc.length,o.chroma=r[o.step]+o.alt,s[3]&&(o.oct=+s[3],o.midi=o.chroma+12*(o.oct+1),o.freq=a(o.midi,n)),e&&(o.tonicOf=s[4]),o}function a(t,e){return Math.pow(2,(t-69)/12)*(e||440)}var c={parse:o,regex:s,midiToFreq:a},l=["letter","acc","pc","step","alt","chroma","oct","midi","freq"];l.forEach((function(t){c[t]=function(e){var n=o(e);return n&&"undefined"!==typeof n[t]?n[t]:null}})),t.exports=c},cd00:function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));const i=()=>{try{return new DOMException("","InvalidStateError")}catch(t){return t.code=11,t.name="InvalidStateError",t}}},cd1b:function(t,e){},cd1ba:function(t,e){},cd1c:function(t,e,n){var i=n("e853");t.exports=function(t,e){return new(i(t))(e)}},ce10:function(t,e,n){var i=n("69a8"),s=n("6821"),r=n("c366")(!1),o=n("613b")("IE_PROTO");t.exports=function(t,e){var n,a=s(t),c=0,l=[];for(n in a)n!=o&&i(a,n)&&l.push(n);while(e.length>c)i(a,n=e[c++])&&(~r(l,n)||l.push(n));return l}},ce5b:function(t,e,n){(function(e,i){t.exports=i(n("2b0e"))})("undefined"!==typeof self&&self,(function(t){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var s=e[i]={i:i,l:!1,exports:{}};return t[i].call(s.exports,s,s.exports,n),s.l=!0,s.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var s in t)n.d(i,s,function(e){return t[e]}.bind(null,s));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/dist/",n(n.s="./src/index.ts")}({"./src/components/VAlert/VAlert.ts": /*!*****************************************!*\ !*** ./src/components/VAlert/VAlert.ts ***! \*****************************************/ /*! exports provided: default */function(t,e,n){"use strict";n.r(e);n(/*! ../../stylus/components/_alerts.styl */"./src/stylus/components/_alerts.styl");var i=n(/*! ../VIcon */"./src/components/VIcon/index.ts"),s=n(/*! ../../mixins/colorable */"./src/mixins/colorable.ts"),r=n(/*! ../../mixins/toggleable */"./src/mixins/toggleable.ts"),o=n(/*! ../../mixins/transitionable */"./src/mixins/transitionable.ts"),a=n(/*! ../../util/mixins */"./src/util/mixins.ts");e["default"]=Object(a["default"])(s["default"],r["default"],o["default"]).extend({name:"v-alert",props:{dismissible:Boolean,icon:String,outline:Boolean,type:{type:String,validator:function(t){return["info","error","success","warning"].includes(t)}}},computed:{computedColor:function(){return this.type&&!this.color?this.type:this.color||"error"},computedIcon:function(){if(this.icon||!this.type)return this.icon;switch(this.type){case"info":return"$vuetify.icons.info";case"error":return"$vuetify.icons.error";case"success":return"$vuetify.icons.success";case"warning":return"$vuetify.icons.warning"}}},methods:{genIcon:function(){return this.computedIcon?this.$createElement(i["default"],{class:"v-alert__icon"},this.computedIcon):null},genDismissible:function(){var t=this;return this.dismissible?this.$createElement("a",{class:"v-alert__dismissible",on:{click:function(){t.isActive=!1}}},[this.$createElement(i["default"],{props:{right:!0}},"$vuetify.icons.cancel")]):null}},render:function(t){var e=[this.genIcon(),t("div",this.$slots.default),this.genDismissible()],n=this.outline?this.setTextColor:this.setBackgroundColor,i=t("div",n(this.computedColor,{staticClass:"v-alert",class:{"v-alert--outline":this.outline},directives:[{name:"show",value:this.isActive}],on:this.$listeners}),e);return this.transition?t("transition",{props:{name:this.transition,origin:this.origin,mode:this.mode}},[i]):i}})},"./src/components/VAlert/index.ts": /*!****************************************!*\ !*** ./src/components/VAlert/index.ts ***! \****************************************/ /*! exports provided: VAlert, default */function(t,e,n){"use strict";n.r(e);var i=n(/*! ./VAlert */"./src/components/VAlert/VAlert.ts");n.d(e,"VAlert",(function(){return i["default"]})),e["default"]=i["default"]},"./src/components/VApp/VApp.js": /*!*************************************!*\ !*** ./src/components/VApp/VApp.js ***! \*************************************/ /*! exports provided: default */function(t,e,n){"use strict";n.r(e);n(/*! ../../stylus/components/_app.styl */"./src/stylus/components/_app.styl");var i=n(/*! ./mixins/app-theme */"./src/components/VApp/mixins/app-theme.js"),s=n(/*! ../../mixins/themeable */"./src/mixins/themeable.ts"),r=n(/*! ../../directives/resize */"./src/directives/resize.ts"),o=function(){return o=Object.assign||function(t){for(var e,n=1,i=arguments.length;n"+this.generatedStyles+""}else"undefined"!==typeof document&&(this.genStyle(),this.applyTheme())},methods:{applyTheme:function(){this.style&&(this.style.innerHTML=this.generatedStyles)},genStyle:function(){var t=document.getElementById("vuetify-theme-stylesheet");t||(t=document.createElement("style"),t.type="text/css",t.id="vuetify-theme-stylesheet",this.$vuetify.options.cspNonce&&t.setAttribute("nonce",this.$vuetify.options.cspNonce),document.head.appendChild(t)),this.style=t}}}},"./src/components/VAutocomplete/VAutocomplete.js": /*!*******************************************************!*\ !*** ./src/components/VAutocomplete/VAutocomplete.js ***! \*******************************************************/ /*! exports provided: default */function(t,e,n){"use strict";n.r(e);n(/*! ../../stylus/components/_autocompletes.styl */"./src/stylus/components/_autocompletes.styl");var i=n(/*! ../VSelect/VSelect */"./src/components/VSelect/VSelect.js"),s=n(/*! ../VTextField/VTextField */"./src/components/VTextField/VTextField.js"),r=n(/*! ../../util/helpers */"./src/util/helpers.ts"),o=function(){return o=Object.assign||function(t){for(var e,n=1,i=arguments.length;n-1}},hideNoData:Boolean,noFilter:Boolean,searchInput:{default:void 0},menuProps:{type:i["default"].options.props.menuProps.type,default:function(){return a}},autoSelectFirst:{type:Boolean,default:!1}},data:function(t){return{attrsInput:null,lazySearch:t.searchInput}},computed:{classes:function(){return Object.assign({},i["default"].options.computed.classes.call(this),{"v-autocomplete":!0,"v-autocomplete--is-selecting-index":this.selectedIndex>-1})},computedItems:function(){return this.filteredItems},selectedValues:function(){var t=this;return this.selectedItems.map((function(e){return t.getValue(e)}))},hasDisplayedItems:function(){var t=this;return this.hideSelected?this.filteredItems.some((function(e){return!t.hasItem(e)})):this.filteredItems.length>0},currentRange:function(){return null==this.selectedItem?0:this.getText(this.selectedItem).toString().length},filteredItems:function(){var t=this;return!this.isSearching||this.noFilter||null==this.internalSearch?this.allItems:this.allItems.filter((function(e){return t.filter(e,t.internalSearch.toString(),t.getText(e).toString())}))},internalSearch:{get:function(){return this.lazySearch},set:function(t){this.lazySearch=t,this.$emit("update:searchInput",t)}},isAnyValueAllowed:function(){return!1},isDirty:function(){return this.searchIsDirty||this.selectedItems.length>0},isSearching:function(){return this.multiple?this.searchIsDirty:this.searchIsDirty&&this.internalSearch!==this.getText(this.selectedItem)},menuCanShow:function(){return!!this.isFocused&&(this.hasDisplayedItems||!this.hideNoData)},$_menuProps:function(){var t=i["default"].options.computed.$_menuProps.call(this);return t.contentClass=("v-autocomplete__content "+(t.contentClass||"")).trim(),o({},a,t)},searchIsDirty:function(){return null!=this.internalSearch&&""!==this.internalSearch},selectedItem:function(){var t=this;return this.multiple?null:this.selectedItems.find((function(e){return t.valueComparator(t.getValue(e),t.getValue(t.internalValue))}))},listData:function(){var t=i["default"].options.computed.listData.call(this);return Object.assign(t.props,{items:this.virtualizedItems,noFilter:this.noFilter||!this.isSearching||!this.filteredItems.length,searchInput:this.internalSearch}),t}},watch:{filteredItems:function(t){this.onFilteredItemsChanged(t)},internalValue:function(){this.setSearch()},isFocused:function(t){t?this.$refs.input&&this.$refs.input.select():this.updateSelf()},isMenuActive:function(t){!t&&this.hasSlot&&(this.lazySearch=null)},items:function(t,e){e&&e.length||!this.hideNoData||!this.isFocused||this.isMenuActive||!t.length||this.activateMenu()},searchInput:function(t){this.lazySearch=t},internalSearch:function(t){this.onInternalSearchChanged(t)},itemText:function(){this.updateSelf()}},created:function(){this.setSearch()},methods:{onFilteredItemsChanged:function(t){var e=this;this.setMenuIndex(-1),this.$nextTick((function(){e.setMenuIndex(t.length>0&&(1===t.length||e.autoSelectFirst)?0:-1)}))},onInternalSearchChanged:function(t){this.updateMenuDimensions()},updateMenuDimensions:function(){this.isMenuActive&&this.$refs.menu&&this.$refs.menu.updateDimensions()},changeSelectedIndex:function(t){if(!this.searchIsDirty&&[r["keyCodes"].backspace,r["keyCodes"].left,r["keyCodes"].right,r["keyCodes"].delete].includes(t)){var e=this.selectedItems.length-1;if(t===r["keyCodes"].left)this.selectedIndex=-1===this.selectedIndex?e:this.selectedIndex-1;else if(t===r["keyCodes"].right)this.selectedIndex=this.selectedIndex>=e?-1:this.selectedIndex+1;else if(-1===this.selectedIndex)return void(this.selectedIndex=e);var n=this.selectedItems[this.selectedIndex];if([r["keyCodes"].backspace,r["keyCodes"].delete].includes(t)&&!this.getDisabled(n)){var i=this.selectedIndex===e?this.selectedIndex-1:this.selectedItems[this.selectedIndex+1]?this.selectedIndex:-1;-1===i?this.setValue(this.multiple?[]:void 0):this.selectItem(n),this.selectedIndex=i}}},clearableCallback:function(){this.internalSearch=void 0,i["default"].options.methods.clearableCallback.call(this)},genInput:function(){var t=s["default"].options.methods.genInput.call(this);return t.data.attrs.role="combobox",t.data.domProps.value=this.internalSearch,t},genSelections:function(){return this.hasSlot||this.multiple?i["default"].options.methods.genSelections.call(this):[]},onClick:function(){this.isDisabled||(this.selectedIndex>-1?this.selectedIndex=-1:this.onFocus(),this.activateMenu())},onEnterDown:function(){},onInput:function(t){this.selectedIndex>-1||(t.target.value&&(this.activateMenu(),this.isAnyValueAllowed||this.setMenuIndex(0)),this.mask&&this.resetSelections(t.target),this.internalSearch=t.target.value,this.badInput=t.target.validity&&t.target.validity.badInput)},onKeyDown:function(t){var e=t.keyCode;i["default"].options.methods.onKeyDown.call(this,t),this.changeSelectedIndex(e)},onTabDown:function(t){i["default"].options.methods.onTabDown.call(this,t),this.updateSelf()},selectItem:function(t){i["default"].options.methods.selectItem.call(this,t),this.setSearch()},setSelectedItems:function(){i["default"].options.methods.setSelectedItems.call(this),this.isFocused||this.setSearch()},setSearch:function(){var t=this;this.$nextTick((function(){t.internalSearch=t.multiple&&t.internalSearch&&t.isMenuActive?t.internalSearch:!t.selectedItems.length||t.multiple||t.hasSlot?null:t.getText(t.selectedItem)}))},updateSelf:function(){this.updateAutocomplete()},updateAutocomplete:function(){(this.searchIsDirty||this.internalValue)&&(this.valueComparator(this.internalSearch,this.getValue(this.internalValue))||this.setSearch())},hasItem:function(t){return this.selectedValues.indexOf(this.getValue(t))>-1}}})},"./src/components/VAutocomplete/index.js": /*!***********************************************!*\ !*** ./src/components/VAutocomplete/index.js ***! \***********************************************/ /*! exports provided: VAutocomplete, default */function(t,e,n){"use strict";n.r(e);var i=n(/*! ./VAutocomplete */"./src/components/VAutocomplete/VAutocomplete.js");n.d(e,"VAutocomplete",(function(){return i["default"]})),e["default"]=i["default"]},"./src/components/VAvatar/VAvatar.ts": /*!*******************************************!*\ !*** ./src/components/VAvatar/VAvatar.ts ***! \*******************************************/ /*! exports provided: default */function(t,e,n){"use strict";n.r(e);n(/*! ../../stylus/components/_avatars.styl */"./src/stylus/components/_avatars.styl");var i=n(/*! ../../mixins/colorable */"./src/mixins/colorable.ts"),s=n(/*! ../../util/helpers */"./src/util/helpers.ts"),r=n(/*! ../../util/mixins */"./src/util/mixins.ts"),o=function(){return o=Object.assign||function(t){for(var e,n=1,i=arguments.length;n0})}}})},"./src/components/VBtnToggle/index.ts": /*!********************************************!*\ !*** ./src/components/VBtnToggle/index.ts ***! \********************************************/ /*! exports provided: VBtnToggle, default */function(t,e,n){"use strict";n.r(e);var i=n(/*! ./VBtnToggle */"./src/components/VBtnToggle/VBtnToggle.ts");n.d(e,"VBtnToggle",(function(){return i["default"]})),e["default"]=i["default"]},"./src/components/VCalendar/VCalendar.ts": /*!***********************************************!*\ !*** ./src/components/VCalendar/VCalendar.ts ***! \***********************************************/ /*! exports provided: default */function(t,e,n){"use strict";n.r(e);var i=n(/*! ./mixins/calendar-base */"./src/components/VCalendar/mixins/calendar-base.ts"),s=n(/*! ./util/props */"./src/components/VCalendar/util/props.ts"),r=n(/*! ./util/timestamp */"./src/components/VCalendar/util/timestamp.ts"),o=n(/*! ./VCalendarMonthly */"./src/components/VCalendar/VCalendarMonthly.ts"),a=n(/*! ./VCalendarDaily */"./src/components/VCalendar/VCalendarDaily.ts"),c=n(/*! ./VCalendarWeekly */"./src/components/VCalendar/VCalendarWeekly.ts"),l=function(){return l=Object.assign||function(t){for(var e,n=1,i=arguments.length;n0,i=n?r["nextDay"]:r["prevDay"],s=n?r["DAYS_IN_MONTH_MAX"]:r["DAY_MIN"],o=n?t:-t;while(--o>=0)switch(this.type){case"month":e.day=s,i(e);break;case"week":Object(r["relativeDays"])(e,i,r["DAYS_IN_WEEK"]);break;case"day":i(e);break;case"4day":Object(r["relativeDays"])(e,i,4);break}Object(r["updateWeekday"])(e),Object(r["updateFormatted"])(e),Object(r["updateRelative"])(e,this.times.now),this.$emit("input",e.date),this.$emit("moved",e)},next:function(t){void 0===t&&(t=1),this.move(t)},prev:function(t){void 0===t&&(t=1),this.move(-t)},timeToY:function(t,e){void 0===e&&(e=!0);var n=this.$children[0];return!(!n||!n.timeToY)&&n.timeToY(t,e)},minutesToPixels:function(t){var e=this.$children[0];return e&&e.minutesToPixels?e.minutesToPixels(t):-1},scrollToTime:function(t){var e=this.$children[0];return!(!e||!e.scrollToTime)&&e.scrollToTime(t)}},render:function(t){var e=this,n=this.renderProps,i=n.start,s=n.end,r=n.maxDays,o=n.component;return t(o,{staticClass:"v-calendar",props:l({},this.$props,{start:i.date,end:s.date,maxDays:r}),on:l({},this.$listeners,{"click:date":function(t){e.$listeners["input"]&&e.$emit("input",t.date),e.$listeners["click:date"]&&e.$emit("click:date",t)}}),scopedSlots:this.$scopedSlots})}})},"./src/components/VCalendar/VCalendarDaily.ts": /*!****************************************************!*\ !*** ./src/components/VCalendar/VCalendarDaily.ts ***! \****************************************************/ /*! exports provided: default */function(t,e,n){"use strict";n.r(e);n(/*! ../../stylus/components/_calendar-daily.styl */"./src/stylus/components/_calendar-daily.styl");var i=n(/*! ../../directives/resize */"./src/directives/resize.ts"),s=n(/*! ./mixins/calendar-with-intervals */"./src/components/VCalendar/mixins/calendar-with-intervals.ts"),r=n(/*! ../../util/helpers */"./src/util/helpers.ts"),o=function(){return o=Object.assign||function(t){for(var e,n=1,i=arguments.length;n0)&&!(i=r.next()).done)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(n=r["return"])&&n.call(r)}finally{if(s)throw s.error}}return o},c=function(){for(var t=[],e=0;e0)&&!(i=r.next()).done)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(n=r["return"])&&n.call(r)}finally{if(s)throw s.error}}return o},c=function(){for(var t=[],e=0;eObject(r["getDayIdentifier"])(this.parsedEnd)},genHead:function(){return this.$createElement("div",{staticClass:"v-calendar-weekly__head"},this.genHeadDays())},genHeadDays:function(){return this.todayWeek.map(this.genHeadDay)},genHeadDay:function(t,e){var n=this.isOutside(this.days[e]),i=t.present?this.color:void 0;return this.$createElement("div",this.setTextColor(i,{key:t.date,staticClass:"v-calendar-weekly__head-weekday",class:this.getRelativeClasses(t,n)}),this.weekdayFormatter(t,this.shortWeekdays))},genWeeks:function(){for(var t=this.days,e=this.weekdays.length,n=[],i=0;ithis.bodyHeight&&(a=this.bodyHeight)),a}}})},"./src/components/VCalendar/mixins/mouse.ts": /*!**************************************************!*\ !*** ./src/components/VCalendar/mixins/mouse.ts ***! \**************************************************/ /*! exports provided: default */function(t,e,n){"use strict";n.r(e);var i=n(/*! vue */"vue"),s=n.n(i);e["default"]=s.a.extend({name:"mouse",methods:{getDefaultMouseEventHandlers:function(t,e){var n;return this.getMouseEventHandlers((n={},n["click"+t]={event:"click"},n["contextmenu"+t]={event:"contextmenu",prevent:!0,result:!1},n["mousedown"+t]={event:"mousedown"},n["mousemove"+t]={event:"mousemove"},n["mouseup"+t]={event:"mouseup"},n["mouseenter"+t]={event:"mouseenter"},n["mouseleave"+t]={event:"mouseleave"},n["touchstart"+t]={event:"touchstart"},n["touchmove"+t]={event:"touchmove"},n["touchend"+t]={event:"touchend"},n),e)},getMouseEventHandlers:function(t,e){var n=this,i={},s=function(s){var o=t[s];if(!r.$listeners[s])return"continue";var a=o.passive?"&":(o.once?"~":"")+(o.capture?"!":""),c=a+o.event,l=function(t){var i=t;return(void 0===o.button||i.buttons>0&&i.button===o.button)&&(o.prevent&&t.preventDefault(),o.stop&&t.stopPropagation(),n.$emit(s,e(t))),o.result};c in i?Array.isArray(i[c])?i[c].push(l):i[c]=[i[c],l]:i[c]=l},r=this;for(var o in t)s(o);return i}}})},"./src/components/VCalendar/mixins/times.ts": /*!**************************************************!*\ !*** ./src/components/VCalendar/mixins/times.ts ***! \**************************************************/ /*! exports provided: default */function(t,e,n){"use strict";n.r(e);var i=n(/*! vue */"vue"),s=n.n(i),r=n(/*! ../util/timestamp */"./src/components/VCalendar/util/timestamp.ts");e["default"]=s.a.extend({name:"times",props:{now:{type:String,validator:r["validateTimestamp"]}},data:function(){return{times:{now:Object(r["parseTimestamp"])("0000-00-00 00:00"),today:Object(r["parseTimestamp"])("0000-00-00")}}},computed:{parsedNow:function(){return this.now?Object(r["parseTimestamp"])(this.now):null}},watch:{parsedNow:"updateTimes"},created:function(){this.updateTimes(),this.setPresent()},methods:{setPresent:function(){this.times.now.present=this.times.today.present=!0,this.times.now.past=this.times.today.past=!1,this.times.now.future=this.times.today.future=!1},updateTimes:function(){var t=this.parsedNow||this.getNow();this.updateDay(t,this.times.now),this.updateTime(t,this.times.now),this.updateDay(t,this.times.today)},getNow:function(){return Object(r["parseDate"])(new Date)},updateDay:function(t,e){t.date!==e.date&&(e.year=t.year,e.month=t.month,e.day=t.day,e.weekday=t.weekday,e.date=t.date)},updateTime:function(t,e){t.time!==e.time&&(e.hour=t.hour,e.minute=t.minute,e.time=t.time)}}})},"./src/components/VCalendar/util/props.ts": /*!************************************************!*\ !*** ./src/components/VCalendar/util/props.ts ***! \************************************************/ /*! exports provided: default */function(t,e,n){"use strict";n.r(e);var i=n(/*! ./timestamp */"./src/components/VCalendar/util/timestamp.ts");function s(t){return isFinite(parseInt(t))}e["default"]={base:{start:{type:String,validate:i["validateTimestamp"],default:function(){return Object(i["parseDate"])(new Date).date}},end:{type:String,validate:i["validateTimestamp"],default:"0000-00-00"},weekdays:{type:Array,default:function(){return[0,1,2,3,4,5,6]}},hideHeader:{type:Boolean,default:!1},shortWeekdays:{type:Boolean,default:!0},weekdayFormat:{type:Function,default:null},dayFormat:{type:Function,default:null},locale:{type:String,default:"en-us"}},intervals:{maxDays:{type:Number,default:7},shortIntervals:{type:Boolean,default:!0},intervalHeight:{type:[Number,String],default:40,validate:s},intervalMinutes:{type:[Number,String],default:60,validate:s},firstInterval:{type:[Number,String],default:0,validate:s},intervalCount:{type:[Number,String],default:24,validate:s},intervalFormat:{type:Function,default:null},intervalStyle:{type:Function,default:null},showIntervalLabel:{type:Function,default:null}},weeks:{minWeeks:{validate:s,default:1},shortMonths:{type:Boolean,default:!0},showMonthOnFirst:{type:Boolean,default:!0},monthFormat:{type:Function,default:null}},calendar:{type:{type:String,default:"month"},value:{type:String,validate:i["validateTimestamp"]}}}},"./src/components/VCalendar/util/timestamp.ts": /*!****************************************************!*\ !*** ./src/components/VCalendar/util/timestamp.ts ***! \****************************************************/ /*! exports provided: PARSE_REGEX, PARSE_TIME, DAYS_IN_MONTH, DAYS_IN_MONTH_LEAP, DAYS_IN_MONTH_MIN, DAYS_IN_MONTH_MAX, MONTH_MAX, MONTH_MIN, DAY_MIN, DAYS_IN_WEEK, MINUTES_IN_HOUR, HOURS_IN_DAY, FIRST_HOUR, getStartOfWeek, getEndOfWeek, getStartOfMonth, getEndOfMonth, parseTime, validateTimestamp, parseTimestamp, parseDate, getDayIdentifier, getTimeIdentifier, updateRelative, updateMinutes, updateWeekday, updateFormatted, getWeekday, isLeapYear, daysInMonth, copyTimestamp, padNumber, getDate, getTime, nextMinutes, nextDay, prevDay, relativeDays, findWeekday, getWeekdaySkips, createDayList, createIntervalList, createNativeLocaleFormatter */function(t,e,n){"use strict";n.r(e),n.d(e,"PARSE_REGEX",(function(){return s})),n.d(e,"PARSE_TIME",(function(){return r})),n.d(e,"DAYS_IN_MONTH",(function(){return o})),n.d(e,"DAYS_IN_MONTH_LEAP",(function(){return a})),n.d(e,"DAYS_IN_MONTH_MIN",(function(){return c})),n.d(e,"DAYS_IN_MONTH_MAX",(function(){return l})),n.d(e,"MONTH_MAX",(function(){return u})),n.d(e,"MONTH_MIN",(function(){return h})),n.d(e,"DAY_MIN",(function(){return d})),n.d(e,"DAYS_IN_WEEK",(function(){return f})),n.d(e,"MINUTES_IN_HOUR",(function(){return p})),n.d(e,"HOURS_IN_DAY",(function(){return m})),n.d(e,"FIRST_HOUR",(function(){return g})),n.d(e,"getStartOfWeek",(function(){return b})),n.d(e,"getEndOfWeek",(function(){return v})),n.d(e,"getStartOfMonth",(function(){return y})),n.d(e,"getEndOfMonth",(function(){return S})),n.d(e,"parseTime",(function(){return x})),n.d(e,"validateTimestamp",(function(){return _})),n.d(e,"parseTimestamp",(function(){return w})),n.d(e,"parseDate",(function(){return E})),n.d(e,"getDayIdentifier",(function(){return T})),n.d(e,"getTimeIdentifier",(function(){return C})),n.d(e,"updateRelative",(function(){return M})),n.d(e,"updateMinutes",(function(){return P})),n.d(e,"updateWeekday",(function(){return A})),n.d(e,"updateFormatted",(function(){return I})),n.d(e,"getWeekday",(function(){return L})),n.d(e,"isLeapYear",(function(){return O})),n.d(e,"daysInMonth",(function(){return k})),n.d(e,"copyTimestamp",(function(){return R})),n.d(e,"padNumber",(function(){return N})),n.d(e,"getDate",(function(){return D})),n.d(e,"getTime",(function(){return V})),n.d(e,"nextMinutes",(function(){return B})),n.d(e,"nextDay",(function(){return F})),n.d(e,"prevDay",(function(){return j})),n.d(e,"relativeDays",(function(){return G})),n.d(e,"findWeekday",(function(){return W})),n.d(e,"getWeekdaySkips",(function(){return $})),n.d(e,"createDayList",(function(){return z})),n.d(e,"createIntervalList",(function(){return H})),n.d(e,"createNativeLocaleFormatter",(function(){return U}));var i="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s=/^(\d{4})-(\d{1,2})(-(\d{1,2}))?([^\d]+(\d{1,2}))?(:(\d{1,2}))?(:(\d{1,2}))?$/,r=/(\d\d?)(:(\d\d?)|)(:(\d\d?)|)/,o=[0,31,28,31,30,31,30,31,31,30,31,30,31],a=[0,31,29,31,30,31,30,31,31,30,31,30,31],c=28,l=31,u=12,h=1,d=1,f=7,p=60,m=24,g=0;function b(t,e,n){var i=R(t);return W(i,e[0],j),I(i),n&&M(i,n,i.hasTime),i}function v(t,e,n){var i=R(t);return W(i,e[e.length-1]),I(i),n&&M(i,n,i.hasTime),i}function y(t){var e=R(t);return e.day=d,A(e),I(e),e}function S(t){var e=R(t);return e.day=k(e.year,e.month),A(e),I(e),e}function x(t){if("number"===typeof t)return t;if("string"===typeof t){var e=r.exec(t);return!!e&&60*parseInt(e[1])+parseInt(e[3]||0)}return"object"===("undefined"===typeof t?"undefined":i(t))&&("number"===typeof t.hour&&"number"===typeof t.minute&&60*t.hour+t.minute)}function _(t){return!!s.exec(t)}function w(t,e){var n=s.exec(t);if(!n)return null;var i={date:t,time:"",year:parseInt(n[1]),month:parseInt(n[2]),day:parseInt(n[4])||1,hour:parseInt(n[6])||0,minute:parseInt(n[8])||0,weekday:0,hasDay:!!n[4],hasTime:!(!n[6]||!n[8]),past:!1,present:!1,future:!1};return A(i),I(i),e&&M(i,e,i.hasTime),i}function E(t){return I({date:"",time:"",year:t.getFullYear(),month:t.getMonth()+1,day:t.getDate(),weekday:t.getDay(),hour:t.getHours(),minute:t.getMinutes(),hasDay:!0,hasTime:!0,past:!1,present:!0,future:!1})}function T(t){return 1e4*t.year+100*t.month+t.day}function C(t){return 100*t.hour+t.minute}function M(t,e,n){void 0===n&&(n=!1);var i=T(e),s=T(t),r=i===s;return t.hasTime&&n&&r&&(i=C(e),s=C(t),r=i===s),t.past=si,t}function P(t,e,n){return t.hasTime=!0,t.hour=Math.floor(e/p),t.minute=e%p,t.time=V(t),n&&M(t,n,!0),t}function A(t){return t.weekday=L(t),t}function I(t){return t.time=V(t),t.date=D(t),t}function L(t){if(t.hasDay){var e=Math.floor,n=t.day,i=(t.month+9)%u+1,s=e(t.year/100),r=t.year%100-(t.month<=2?1:0);return((n+e(2.6*i-.2)-2*s+r+e(r/4)+e(s/4))%7+7)%7}return t.weekday}function O(t){return t%4===0&&t%100!==0||t%400===0}function k(t,e){return O(t)?a[e]:o[e]}function R(t){var e=t.date,n=t.time,i=t.year,s=t.month,r=t.day,o=t.weekday,a=t.hour,c=t.minute,l=t.hasDay,u=t.hasTime,h=t.past,d=t.present,f=t.future;return{date:e,time:n,year:i,month:s,day:r,weekday:o,hour:a,minute:c,hasDay:l,hasTime:u,past:h,present:d,future:f}}function N(t,e){var n=String(t);while(n.lengthp)t.minute-=p,t.hour++,t.hour>=m&&(F(t),t.hour=g);return t}function F(t){return t.day++,t.weekday=(t.weekday+1)%f,t.day>c&&t.day>k(t.year,t.month)&&(t.day=d,t.month++,t.month>u&&(t.month=h,t.year++)),t}function j(t){return t.day--,t.weekday=(t.weekday+6)%f,t.day=0)e(t);return t}function W(t,e,n,i){void 0===n&&(n=F),void 0===i&&(i=6);while(t.weekday!==e&&--i>=0)n(t);return t}function $(t){for(var e=[1,1,1,1,1,1,1],n=[0,0,0,0,0,0,0],i=0;i0}},mandatory:{type:Boolean,default:!0},nextIcon:{type:[Boolean,String],default:"$vuetify.icons.next"},prevIcon:{type:[Boolean,String],default:"$vuetify.icons.prev"}},data:function(){return{changedByDelimiters:!1,internalHeight:this.height,slideTimeout:void 0}},computed:{isDark:function(){return this.dark||!this.light}},watch:{internalValue:function(t){this.restartTimeout(),this.$listeners["input"]&&this.$emit("input",t)},interval:"restartTimeout",height:function(t,e){t!==e&&t&&(this.internalHeight=t)},cycle:function(t){t?this.restartTimeout():(clearTimeout(this.slideTimeout),this.slideTimeout=void 0)}},mounted:function(){this.$listeners["input"]&&Object(c["deprecate"])("@input","@change",this),this.startTimeout()},methods:{genDelimiters:function(){return this.$createElement("div",{staticClass:"v-carousel__controls"},[this.genItems()])},genIcon:function(t,e,n){var i=this;return this.$createElement("div",{staticClass:"v-carousel__"+t},[this.$createElement(s["default"],{props:{icon:!0},attrs:{"aria-label":this.$vuetify.t("$vuetify.carousel."+t)},on:{click:function(){i.changedByDelimiters=!0,n()}}},[this.$createElement(r["default"],{props:{size:"46px"}},e)])])},genIcons:function(){var t=[],e=this.$vuetify.rtl?this.nextIcon:this.prevIcon;e&&"string"===typeof e&&t.push(this.genIcon("prev",e,this.prev));var n=this.$vuetify.rtl?this.prevIcon:this.nextIcon;return n&&"string"===typeof n&&t.push(this.genIcon("next",n,this.next)),t},genItems:function(){for(var t=this,e=this.items.length,n=[],i=0;i0?+this.interval:6e3))},updateReverse:function(t,e){this.changedByDelimiters?this.changedByDelimiters=!1:i["default"].options.methods.updateReverse.call(this,t,e)}},render:function(t){var e=[],n={staticClass:"v-window v-carousel",style:{height:Object(a["convertToUnit"])(this.height)},directives:[]};return this.touchless||n.directives.push({name:"touch",value:{left:this.next,right:this.prev}}),this.hideControls||e.push(this.genIcons()),this.hideDelimiters||e.push(this.genDelimiters()),t("div",n,[this.genContainer(),e])}})},"./src/components/VCarousel/VCarouselItem.ts": /*!***************************************************!*\ !*** ./src/components/VCarousel/VCarouselItem.ts ***! \***************************************************/ /*! exports provided: default */function(t,e,n){"use strict";n.r(e);var i=n(/*! ../VWindow/VWindowItem */"./src/components/VWindow/VWindowItem.ts"),s=n(/*! ../VImg */"./src/components/VImg/index.ts"),r=function(){return r=Object.assign||function(t){for(var e,n=1,i=arguments.length;n-1||this.updateSelf()},onKeyDown:function(t){var e=t.keyCode;i["default"].options.methods.onKeyDown.call(this,t),this.multiple&&e===r["keyCodes"].left&&0===this.$refs.input.selectionStart&&this.updateSelf(),this.changeSelectedIndex(e)},onTabDown:function(t){if(this.multiple&&this.internalSearch&&-1===this.getMenuIndex())return t.preventDefault(),t.stopPropagation(),this.updateTags();s["default"].options.methods.onTabDown.call(this,t)},selectItem:function(t){this.editingIndex>-1?this.updateEditing():s["default"].options.methods.selectItem.call(this,t)},setSelectedItems:function(){null==this.internalValue||""===this.internalValue?this.selectedItems=[]:this.selectedItems=this.multiple?this.internalValue:[this.internalValue]},setValue:function(t){void 0===t&&(t=this.internalSearch),i["default"].options.methods.setValue.call(this,t)},updateEditing:function(){var t=this.internalValue.slice();t[this.editingIndex]=this.internalSearch,this.setValue(t),this.editingIndex=-1},updateCombobox:function(){var t=Boolean(this.$scopedSlots.selection)||this.hasChips;t&&!this.searchIsDirty||(this.internalSearch!==this.getText(this.internalValue)&&this.setValue(),t&&(this.internalSearch=void 0))},updateSelf:function(){this.multiple?this.updateTags():this.updateCombobox()},updateTags:function(){var t=this.getMenuIndex();if(!(t<0)||this.searchIsDirty){if(this.editingIndex>-1)return this.updateEditing();var e=this.selectedItems.indexOf(this.internalSearch);if(e>-1){var n=this.internalValue.slice();n.splice(e,1),this.setValue(n)}if(t>-1)return this.internalSearch=null;this.selectItem(this.internalSearch),this.internalSearch=null}}}}},"./src/components/VCombobox/index.js": /*!*******************************************!*\ !*** ./src/components/VCombobox/index.js ***! \*******************************************/ /*! exports provided: VCombobox, default */function(t,e,n){"use strict";n.r(e);var i=n(/*! ./VCombobox */"./src/components/VCombobox/VCombobox.js");n.d(e,"VCombobox",(function(){return i["default"]})),e["default"]=i["default"]},"./src/components/VCounter/VCounter.ts": /*!*********************************************!*\ !*** ./src/components/VCounter/VCounter.ts ***! \*********************************************/ /*! exports provided: default */function(t,e,n){"use strict";n.r(e);n(/*! ../../stylus/components/_counters.styl */"./src/stylus/components/_counters.styl");var i=n(/*! ../../mixins/themeable */"./src/mixins/themeable.ts"),s=n(/*! ../../util/mixins */"./src/util/mixins.ts"),r=function(){return r=Object.assign||function(t){for(var e,n=1,i=arguments.length;ns;return t("div",{staticClass:"v-counter",class:r({"error--text":c},Object(i["functionalThemeClasses"])(e))},a)}})},"./src/components/VCounter/index.ts": /*!******************************************!*\ !*** ./src/components/VCounter/index.ts ***! \******************************************/ /*! exports provided: VCounter, default */function(t,e,n){"use strict";n.r(e);var i=n(/*! ./VCounter */"./src/components/VCounter/VCounter.ts");n.d(e,"VCounter",(function(){return i["default"]})),e["default"]=i["default"]},"./src/components/VDataIterator/VDataIterator.js": /*!*******************************************************!*\ !*** ./src/components/VDataIterator/VDataIterator.js ***! \*******************************************************/ /*! exports provided: default */function(t,e,n){"use strict";n.r(e);n(/*! ../../stylus/components/_data-iterator.styl */"./src/stylus/components/_data-iterator.styl");var i=n(/*! ../../mixins/data-iterable */"./src/mixins/data-iterable.js"),s=function(){return s=Object.assign||function(t){for(var e,n=1,i=arguments.length;n0)&&!(i=r.next()).done)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(n=r["return"])&&n.call(r)}finally{if(s)throw s.error}}return o},a=function(){for(var t=[],e=0;e0)&&!(i=r.next()).done)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(n=r["return"])&&n.call(r)}finally{if(s)throw s.error}}return o};function m(t,e){var n=p(t.split("-"),3),i=n[0],s=n[1],r=void 0===s?1:s,o=n[2],a=void 0===o?1:o;return(i+"-"+Object(l["pad"])(r)+"-"+Object(l["pad"])(a)).substr(0,{date:10,month:7,year:4}[e])}e["default"]=Object(f["default"])(c["default"]).extend({name:"v-date-picker",props:{allowedDates:Function,dayFormat:Function,disabled:Boolean,events:{type:[Array,Function,Object],default:function(){return null}},eventColor:{type:[Array,Function,Object,String],default:function(){return"warning"}},firstDayOfWeek:{type:[String,Number],default:0},headerDateFormat:Function,locale:{type:String,default:"en-us"},max:String,min:String,monthFormat:Function,multiple:Boolean,nextIcon:{type:String,default:"$vuetify.icons.next"},pickerDate:String,prevIcon:{type:String,default:"$vuetify.icons.prev"},reactive:Boolean,readonly:Boolean,scrollable:Boolean,showCurrent:{type:[Boolean,String],default:!0},showWeek:Boolean,titleDateFormat:Function,type:{type:String,default:"date",validator:function(t){return["date","month"].includes(t)}},value:[Array,String],weekdayFormat:Function,yearFormat:Function,yearIcon:String},data:function(){var t=this,e=new Date;return{activePicker:this.type.toUpperCase(),inputDay:null,inputMonth:null,inputYear:null,isReversing:!1,now:e,tableDate:function(){if(t.pickerDate)return t.pickerDate;var n=(t.multiple?t.value[t.value.length-1]:t.value)||e.getFullYear()+"-"+(e.getMonth()+1);return m(n,"date"===t.type?"month":"year")}()}},computed:{lastValue:function(){return this.multiple?this.value[this.value.length-1]:this.value},selectedMonths:function(){return this.value&&this.value.length&&"month"!==this.type?this.multiple?this.value.map((function(t){return t.substr(0,7)})):this.value.substr(0,7):this.value},current:function(){return!0===this.showCurrent?m(this.now.getFullYear()+"-"+(this.now.getMonth()+1)+"-"+this.now.getDate(),this.type):this.showCurrent||null},inputDate:function(){return"date"===this.type?this.inputYear+"-"+Object(l["pad"])(this.inputMonth+1)+"-"+Object(l["pad"])(this.inputDay):this.inputYear+"-"+Object(l["pad"])(this.inputMonth+1)},tableMonth:function(){return Number((this.pickerDate||this.tableDate).split("-")[1])-1},tableYear:function(){return Number((this.pickerDate||this.tableDate).split("-")[0])},minMonth:function(){return this.min?m(this.min,"month"):null},maxMonth:function(){return this.max?m(this.max,"month"):null},minYear:function(){return this.min?m(this.min,"year"):null},maxYear:function(){return this.max?m(this.max,"year"):null},formatters:function(){return{year:this.yearFormat||Object(l["createNativeLocaleFormatter"])(this.locale,{year:"numeric",timeZone:"UTC"},{length:4}),titleDate:this.titleDateFormat||(this.multiple?this.defaultTitleMultipleDateFormatter:this.defaultTitleDateFormatter)}},defaultTitleMultipleDateFormatter:function(){var t=this;return this.value.length<2?function(e){return e.length?t.defaultTitleDateFormatter(e[0]):"0 selected"}:function(t){return t.length+" selected"}},defaultTitleDateFormatter:function(){var t={year:{year:"numeric",timeZone:"UTC"},month:{month:"long",timeZone:"UTC"},date:{weekday:"short",month:"short",day:"numeric",timeZone:"UTC"}},e=Object(l["createNativeLocaleFormatter"])(this.locale,t[this.type],{start:0,length:{date:10,month:7,year:4}[this.type]}),n=function(t){return e(t).replace(/([^\d\s])([\d])/g,(function(t,e,n){return e+" "+n})).replace(", ",",
")};return this.landscape?n:e}},watch:{tableDate:function(t,e){var n="month"===this.type?"year":"month";this.isReversing=m(t,n)1&&(this.displayedYear%4===0&&this.displayedYear%100!==0||this.displayedYear%400===0)&&t++;var e=(this.displayedYear+(this.displayedYear-1>>2)-Math.floor((this.displayedYear-1)/100)+Math.floor((this.displayedYear-1)/400)-Number(this.firstDayOfWeek))%7;return Math.floor((t+e)/7)+1},genWeekNumber:function(t){return this.$createElement("td",[this.$createElement("small",{staticClass:"v-date-picker-table--date__week"},String(t).padStart(2,"0"))])},genTBody:function(){var t=[],e=new Date(this.displayedYear,this.displayedMonth+1,0).getDate(),n=[],i=this.weekDaysBeforeFirstDayOfTheMonth(),r=this.getWeekNumber();this.showWeek&&n.push(this.genWeekNumber(r++));while(i--)n.push(this.$createElement("td"));for(i=1;i<=e;i++){var o=this.displayedYear+"-"+Object(s["pad"])(this.displayedMonth+1)+"-"+Object(s["pad"])(i);n.push(this.$createElement("td",[this.genButton(o,!0,"date",this.formatter)])),n.length%(this.showWeek?8:7)===0&&(t.push(this.genTR(n)),n=[],i0)&&!(i=r.next()).done)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(n=r["return"])&&n.call(r)}finally{if(s)throw s.error}}return o};e["default"]=Object(c["default"])(r["default"],o["default"]).extend({name:"v-date-picker-header",props:{disabled:Boolean,format:Function,locale:{type:String,default:"en-us"},min:String,max:String,nextIcon:{type:String,default:"$vuetify.icons.next"},prevIcon:{type:String,default:"$vuetify.icons.prev"},readonly:Boolean,value:{type:[Number,String],required:!0}},data:function(){return{isReversing:!1}},computed:{formatter:function(){return this.format?this.format:String(this.value).split("-")[1]?Object(a["createNativeLocaleFormatter"])(this.locale,{month:"long",year:"numeric",timeZone:"UTC"},{length:7}):Object(a["createNativeLocaleFormatter"])(this.locale,{year:"numeric",timeZone:"UTC"},{length:4})}},watch:{value:function(t,e){this.isReversing=t0&&this.max&&this.calculateChange(t)>this.max;return this.$createElement(i["default"],{props:{dark:this.dark,disabled:n,icon:!0,light:this.light},nativeOn:{click:function(n){n.stopPropagation(),e.$emit("input",e.calculateChange(t))}}},[this.$createElement(s["default"],t<0===!this.$vuetify.rtl?this.prevIcon:this.nextIcon)])},calculateChange:function(t){var e=u(String(this.value).split("-").map(Number),2),n=e[0],i=e[1];return null==i?""+(n+t):Object(a["monthChange"])(String(this.value),t)},genHeader:function(){var t=this,e=!this.disabled&&(this.color||"accent"),n=this.$createElement("div",this.setTextColor(e,{key:String(this.value)}),[this.$createElement("button",{attrs:{type:"button"},on:{click:function(){return t.$emit("toggle")}}},[this.$slots.default||this.formatter(String(this.value))])]),i=this.$createElement("transition",{props:{name:this.isReversing===!this.$vuetify.rtl?"tab-reverse-transition":"tab-transition"}},[n]);return this.$createElement("div",{staticClass:"v-date-picker-header__value",class:{"v-date-picker-header__value--disabled":this.disabled}},[i])}},render:function(){return this.$createElement("div",{staticClass:"v-date-picker-header",class:l({"v-date-picker-header--disabled":this.disabled},this.themeClasses)},[this.genBtn(-1),this.genHeader(),this.genBtn(1)])}})},"./src/components/VDatePicker/VDatePickerMonthTable.ts": /*!*************************************************************!*\ !*** ./src/components/VDatePicker/VDatePickerMonthTable.ts ***! \*************************************************************/ /*! exports provided: default */function(t,e,n){"use strict";n.r(e);var i=n(/*! ./mixins/date-picker-table */"./src/components/VDatePicker/mixins/date-picker-table.ts"),s=n(/*! ./util */"./src/components/VDatePicker/util/index.ts"),r=n(/*! ../../util/mixins */"./src/util/mixins.ts");e["default"]=Object(r["default"])(i["default"]).extend({name:"v-date-picker-month-table",computed:{formatter:function(){return this.format||Object(s["createNativeLocaleFormatter"])(this.locale,{month:"short",timeZone:"UTC"},{start:5,length:2})}},methods:{calculateTableDate:function(t){return""+(parseInt(this.tableDate,10)+Math.sign(t||1))},genTBody:function(){for(var t=this,e=[],n=Array(3).fill(null),i=12/n.length,r=function(i){var r=n.map((function(e,r){var o=i*n.length+r,a=t.displayedYear+"-"+Object(s["pad"])(o+1);return t.$createElement("td",{key:o},[t.genButton(a,!1,"month",t.formatter)])}));e.push(o.$createElement("tr",{key:i},r))},o=this,a=0;a=i;s--)t.push(this.genYearItem(s));return t}},render:function(){return this.$createElement("ul",{staticClass:"v-date-picker-years",ref:"years"},this.genYearItems())}})},"./src/components/VDatePicker/index.js": /*!*********************************************!*\ !*** ./src/components/VDatePicker/index.js ***! \*********************************************/ /*! exports provided: VDatePicker, VDatePickerTitle, VDatePickerHeader, VDatePickerDateTable, VDatePickerMonthTable, VDatePickerYears, default */function(t,e,n){"use strict";n.r(e);var i=n(/*! ./VDatePicker */"./src/components/VDatePicker/VDatePicker.ts");n.d(e,"VDatePicker",(function(){return i["default"]}));var s=n(/*! ./VDatePickerTitle */"./src/components/VDatePicker/VDatePickerTitle.ts");n.d(e,"VDatePickerTitle",(function(){return s["default"]}));var r=n(/*! ./VDatePickerHeader */"./src/components/VDatePicker/VDatePickerHeader.ts");n.d(e,"VDatePickerHeader",(function(){return r["default"]}));var o=n(/*! ./VDatePickerDateTable */"./src/components/VDatePicker/VDatePickerDateTable.ts");n.d(e,"VDatePickerDateTable",(function(){return o["default"]}));var a=n(/*! ./VDatePickerMonthTable */"./src/components/VDatePicker/VDatePickerMonthTable.ts");n.d(e,"VDatePickerMonthTable",(function(){return a["default"]}));var c=n(/*! ./VDatePickerYears */"./src/components/VDatePicker/VDatePickerYears.ts");n.d(e,"VDatePickerYears",(function(){return c["default"]})),e["default"]={$_vuetify_subcomponents:{VDatePicker:i["default"],VDatePickerTitle:s["default"],VDatePickerHeader:r["default"],VDatePickerDateTable:o["default"],VDatePickerMonthTable:a["default"],VDatePickerYears:c["default"]}}},"./src/components/VDatePicker/mixins/date-picker-table.ts": /*!****************************************************************!*\ !*** ./src/components/VDatePicker/mixins/date-picker-table.ts ***! \****************************************************************/ /*! exports provided: default */function(t,e,n){"use strict";n.r(e);n(/*! ../../../stylus/components/_date-picker-table.styl */"./src/stylus/components/_date-picker-table.styl");var i=n(/*! ../../../directives/touch */"./src/directives/touch.ts"),s=n(/*! ../../../mixins/colorable */"./src/mixins/colorable.ts"),r=n(/*! ../../../mixins/themeable */"./src/mixins/themeable.ts"),o=n(/*! ../util/isDateAllowed */"./src/components/VDatePicker/util/isDateAllowed.ts"),a=n(/*! ../../../util/mixins */"./src/util/mixins.ts"),c=function(){return c=Object.assign||function(t){for(var e,n=1,i=arguments.length;n15&&i.touch(-1,n)}}};return this.$createElement("div",{staticClass:t,class:c({"v-date-picker-table--disabled":this.disabled},this.themeClasses),on:!this.disabled&&this.scrollable?{wheel:function(t){return i.wheel(t,n)}}:void 0,directives:[r]},[s])}}})},"./src/components/VDatePicker/util/createNativeLocaleFormatter.ts": /*!************************************************************************!*\ !*** ./src/components/VDatePicker/util/createNativeLocaleFormatter.ts ***! \************************************************************************/ /*! exports provided: default */function(t,e,n){"use strict";n.r(e);var i=n(/*! ./pad */"./src/components/VDatePicker/util/pad.ts"),s=function(t,e){var n="function"===typeof Symbol&&t[Symbol.iterator];if(!n)return t;var i,s,r=n.call(t),o=[];try{while((void 0===e||e-- >0)&&!(i=r.next()).done)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(n=r["return"])&&n.call(r)}finally{if(s)throw s.error}}return o};function r(t,e,n){void 0===n&&(n={start:0,length:0});var r=function(t){var e=s(t.trim().split(" ")[0].split("-"),3),n=e[0],r=e[1],o=e[2];return[Object(i["default"])(n,4),Object(i["default"])(r||1),Object(i["default"])(o||1)].join("-")};try{var o=new Intl.DateTimeFormat(t||void 0,e);return function(t){return o.format(new Date(r(t)+"T00:00:00+00:00"))}}catch(a){return n.start||n.length?function(t){return r(t).substr(n.start||0,n.length)}:void 0}}e["default"]=r},"./src/components/VDatePicker/util/index.ts": /*!**************************************************!*\ !*** ./src/components/VDatePicker/util/index.ts ***! \**************************************************/ /*! exports provided: createNativeLocaleFormatter, monthChange, pad */function(t,e,n){"use strict";n.r(e);var i=n(/*! ./createNativeLocaleFormatter */"./src/components/VDatePicker/util/createNativeLocaleFormatter.ts");n.d(e,"createNativeLocaleFormatter",(function(){return i["default"]}));var s=n(/*! ./monthChange */"./src/components/VDatePicker/util/monthChange.ts");n.d(e,"monthChange",(function(){return s["default"]}));var r=n(/*! ./pad */"./src/components/VDatePicker/util/pad.ts");n.d(e,"pad",(function(){return r["default"]}))},"./src/components/VDatePicker/util/isDateAllowed.ts": /*!**********************************************************!*\ !*** ./src/components/VDatePicker/util/isDateAllowed.ts ***! \**********************************************************/ /*! exports provided: default */function(t,e,n){"use strict";function i(t,e,n,i){return(!i||i(t))&&(!e||t>=e)&&(!n||t<=n)}n.r(e),n.d(e,"default",(function(){return i}))},"./src/components/VDatePicker/util/monthChange.ts": /*!********************************************************!*\ !*** ./src/components/VDatePicker/util/monthChange.ts ***! \********************************************************/ /*! exports provided: default */function(t,e,n){"use strict";n.r(e);var i=n(/*! ./pad */"./src/components/VDatePicker/util/pad.ts"),s=function(t,e){var n="function"===typeof Symbol&&t[Symbol.iterator];if(!n)return t;var i,s,r=n.call(t),o=[];try{while((void 0===e||e-- >0)&&!(i=r.next()).done)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(n=r["return"])&&n.call(r)}finally{if(s)throw s.error}}return o};e["default"]=function(t,e){var n=s(t.split("-").map(Number),2),r=n[0],o=n[1];return o+e===0?r-1+"-12":o+e===13?r+1+"-01":r+"-"+Object(i["default"])(o+e)}},"./src/components/VDatePicker/util/pad.ts": /*!************************************************!*\ !*** ./src/components/VDatePicker/util/pad.ts ***! \************************************************/ /*! exports provided: default */function(t,e,n){"use strict";n.r(e);var i=function(t,e,n){return e>>=0,t=String(t),n=String(n),t.length>e?String(t):(e-=t.length,e>n.length&&(n+=n.repeat(e/n.length)),n.slice(0,e)+String(t))};e["default"]=function(t,e){return void 0===e&&(e=2),i(t,e,"0")}},"./src/components/VDialog/VDialog.js": /*!*******************************************!*\ !*** ./src/components/VDialog/VDialog.js ***! \*******************************************/ /*! exports provided: default */function(t,e,n){"use strict";n.r(e);n(/*! ../../stylus/components/_dialogs.styl */"./src/stylus/components/_dialogs.styl");var i=n(/*! ../../mixins/dependent */"./src/mixins/dependent.ts"),s=n(/*! ../../mixins/detachable */"./src/mixins/detachable.js"),r=n(/*! ../../mixins/overlayable */"./src/mixins/overlayable.ts"),o=n(/*! ../../mixins/returnable */"./src/mixins/returnable.ts"),a=n(/*! ../../mixins/stackable */"./src/mixins/stackable.ts"),c=n(/*! ../../mixins/toggleable */"./src/mixins/toggleable.ts"),l=n(/*! ../../directives/click-outside */"./src/directives/click-outside.ts"),u=n(/*! ../../util/helpers */"./src/util/helpers.ts"),h=n(/*! ../../util/ThemeProvider */"./src/util/ThemeProvider.ts"),d=n(/*! ../../util/console */"./src/util/console.ts"),f=function(){return f=Object.assign||function(t){for(var e,n=1,i=arguments.length;n'",this)},methods:{animateClick:function(){var t=this;this.animate=!1,this.$nextTick((function(){t.animate=!0,clearTimeout(t.animateTimeout),t.animateTimeout=setTimeout((function(){return t.animate=!1}),150)}))},closeConditional:function(t){return!(this._isDestroyed||!this.isActive||this.$refs.content.contains(t.target))&&(this.persistent?(this.noClickAnimation||this.overlay!==t.target||this.animateClick(),!1):this.activeZIndex>=this.getMaxZIndex())},hideScroll:function(){this.fullscreen?document.documentElement.classList.add("overflow-y-hidden"):r["default"].options.methods.hideScroll.call(this)},show:function(){!this.fullscreen&&!this.hideOverlay&&this.genOverlay(),this.$refs.content.focus()},onKeydown:function(t){if(t.keyCode===u["keyCodes"].esc&&!this.getOpenDependents().length)if(this.persistent)this.noClickAnimation||this.animateClick();else{this.isActive=!1;var e=this.getActivator();this.$nextTick((function(){return e&&e.focus()}))}this.$emit("keydown",t)},getActivator:function(t){if(this.$refs.activator)return this.$refs.activator.children.length>0?this.$refs.activator.children[0]:this.$refs.activator;if(t&&(this.activatedBy=t.currentTarget||t.target),this.activatedBy)return this.activatedBy;if(this.activatorNode){var e=Array.isArray(this.activatorNode)?this.activatorNode[0]:this.activatorNode,n=e&&e.elm;if(n)return n}return null},genActivator:function(){var t=this;if(!this.hasActivator)return null;var e=this.disabled?{}:{click:function(e){e.stopPropagation(),t.getActivator(e),t.disabled||(t.isActive=!t.isActive)}};if("scoped"===Object(u["getSlotType"])(this,"activator")){var n=this.$scopedSlots.activator({on:e});return this.activatorNode=n,n}return this.$createElement("div",{staticClass:"v-dialog__activator",class:{"v-dialog__activator--disabled":this.disabled},ref:"activator",on:e},this.$slots.activator)}},render:function(t){var e=this,n=[],i={class:this.classes,ref:"dialog",directives:[{name:"click-outside",value:function(){e.isActive=!1},args:{closeConditional:this.closeConditional,include:this.getOpenDependentElements}},{name:"show",value:this.isActive}],on:{click:function(t){t.stopPropagation()}}};this.fullscreen||(i.style={maxWidth:"none"===this.maxWidth?void 0:Object(u["convertToUnit"])(this.maxWidth),width:"auto"===this.width?void 0:Object(u["convertToUnit"])(this.width)}),n.push(this.genActivator());var s=t("div",i,this.showLazyContent(this.$slots.default));return this.transition&&(s=t("transition",{props:{name:this.transition,origin:this.origin}},[s])),n.push(t("div",{class:this.contentClasses,attrs:f({tabIndex:"-1"},this.getScopeIdAttrs()),on:{keydown:this.onKeydown},style:{zIndex:this.activeZIndex},ref:"content"},[this.$createElement(h["default"],{props:{root:!0,light:this.light,dark:this.dark}},[s])])),t("div",{staticClass:"v-dialog__container",style:{display:!this.hasActivator||this.fullWidth?"block":"inline-block"}},n)}}},"./src/components/VDialog/index.js": /*!*****************************************!*\ !*** ./src/components/VDialog/index.js ***! \*****************************************/ /*! exports provided: VDialog, default */function(t,e,n){"use strict";n.r(e);var i=n(/*! ./VDialog */"./src/components/VDialog/VDialog.js");n.d(e,"VDialog",(function(){return i["default"]})),e["default"]=i["default"]},"./src/components/VDivider/VDivider.ts": /*!*********************************************!*\ !*** ./src/components/VDivider/VDivider.ts ***! \*********************************************/ /*! exports provided: default */function(t,e,n){"use strict";n.r(e);n(/*! ../../stylus/components/_dividers.styl */"./src/stylus/components/_dividers.styl");var i=n(/*! ../../mixins/themeable */"./src/mixins/themeable.ts"),s=function(){return s=Object.assign||function(t){for(var e,n=1,i=arguments.length;n-1&&(i[e]=!0),this.open=i}this.$emit("input",t?this.open:e>-1?e:null)},value:function(t){this.updateFromValue(t)}},mounted:function(){null!==this.value&&this.updateFromValue(this.value)},methods:{updateFromValue:function(t){if(!Array.isArray(t)||this.expand){var e=Array(this.items.length).fill(!1);"number"===typeof t?e[t]=!0:null!==t&&(e=t),this.updatePanels(e)}},updatePanels:function(t){this.open=t;for(var e=0;e0)&&!(i=r.next()).done)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(n=r["return"])&&n.call(r)}finally{if(s)throw s.error}}return o},d=function(){for(var t=[],e=0;e-1&&n.length-1<1||null!=this.max&&i<0&&n.length+1>this.max||(i>-1?n.splice(i,1):n.push(t),this.internalValue=n)},updateSingle:function(t){var e=t===this.internalValue;this.mandatory&&e||(this.internalValue=e?void 0:t)}},render:function(t){return t("div",{staticClass:"v-item-group",class:this.classes},this.$slots.default)}});e["default"]=c.extend({name:"v-item-group",provide:function(){return{itemGroup:this}}})},"./src/components/VItemGroup/index.ts": /*!********************************************!*\ !*** ./src/components/VItemGroup/index.ts ***! \********************************************/ /*! exports provided: VItem, VItemGroup, default */function(t,e,n){"use strict";n.r(e);var i=n(/*! ./VItem */"./src/components/VItemGroup/VItem.ts");n.d(e,"VItem",(function(){return i["default"]}));var s=n(/*! ./VItemGroup */"./src/components/VItemGroup/VItemGroup.ts");n.d(e,"VItemGroup",(function(){return s["default"]})),e["default"]={$_vuetify_subcomponents:{VItem:i["default"],VItemGroup:s["default"]}}},"./src/components/VJumbotron/VJumbotron.js": /*!*************************************************!*\ !*** ./src/components/VJumbotron/VJumbotron.js ***! \*************************************************/ /*! exports provided: default */function(t,e,n){"use strict";n.r(e);n(/*! ../../stylus/components/_jumbotrons.styl */"./src/stylus/components/_jumbotrons.styl");var i=n(/*! ../../mixins/colorable */"./src/mixins/colorable.ts"),s=n(/*! ../../mixins/routable */"./src/mixins/routable.ts"),r=n(/*! ../../mixins/themeable */"./src/mixins/themeable.ts"),o=n(/*! ../../util/console */"./src/util/console.ts");e["default"]={name:"v-jumbotron",mixins:[i["default"],s["default"],r["default"]],props:{gradient:String,height:{type:[Number,String],default:"400px"},src:String,tag:{type:String,default:"div"}},computed:{backgroundStyles:function(){var t={};return this.gradient&&(t.background="linear-gradient("+this.gradient+")"),t},classes:function(){return this.themeClasses},styles:function(){return{height:this.height}}},mounted:function(){Object(o["deprecate"])("v-jumbotron",this.src?"v-img":"v-responsive",this)},methods:{genBackground:function(){return this.$createElement("div",this.setBackgroundColor(this.color,{staticClass:"v-jumbotron__background",style:this.backgroundStyles}))},genContent:function(){return this.$createElement("div",{staticClass:"v-jumbotron__content"},this.$slots.default)},genImage:function(){return this.src?this.$slots.img?this.$slots.img({src:this.src}):this.$createElement("img",{staticClass:"v-jumbotron__image",attrs:{src:this.src}}):null},genWrapper:function(){return this.$createElement("div",{staticClass:"v-jumbotron__wrapper"},[this.genImage(),this.genBackground(),this.genContent()])}},render:function(t){var e=this.generateRouteLink(this.classes),n=e.tag,i=e.data;return i.staticClass="v-jumbotron",i.style=this.styles,t(n,i,[this.genWrapper()])}}},"./src/components/VJumbotron/index.js": /*!********************************************!*\ !*** ./src/components/VJumbotron/index.js ***! \********************************************/ /*! exports provided: VJumbotron, default */function(t,e,n){"use strict";n.r(e);var i=n(/*! ./VJumbotron */"./src/components/VJumbotron/VJumbotron.js");n.d(e,"VJumbotron",(function(){return i["default"]})),e["default"]=i["default"]},"./src/components/VLabel/VLabel.ts": /*!*****************************************!*\ !*** ./src/components/VLabel/VLabel.ts ***! \*****************************************/ /*! exports provided: default */function(t,e,n){"use strict";n.r(e);n(/*! ../../stylus/components/_labels.styl */"./src/stylus/components/_labels.styl");var i=n(/*! ../../mixins/colorable */"./src/mixins/colorable.ts"),s=n(/*! ../../mixins/themeable */"./src/mixins/themeable.ts"),r=n(/*! ../../util/mixins */"./src/util/mixins.ts"),o=n(/*! ../../util/helpers */"./src/util/helpers.ts"),a=function(){return a=Object.assign||function(t){for(var e,n=1,i=arguments.length;n=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}};e["default"]=Object(r["default"])(Object(s["provide"])("list"),i["default"]).extend({name:"v-list",provide:function(){return{listClick:this.listClick}},props:{dense:Boolean,expand:Boolean,subheader:Boolean,threeLine:Boolean,twoLine:Boolean},data:function(){return{groups:[]}},computed:{classes:function(){return o({"v-list--dense":this.dense,"v-list--subheader":this.subheader,"v-list--two-line":this.twoLine,"v-list--three-line":this.threeLine},this.themeClasses)}},methods:{register:function(t){this.groups.push(t)},unregister:function(t){var e=this.groups.findIndex((function(e){return e._uid===t._uid}));e>-1&&this.groups.splice(e,1)},listClick:function(t){var e,n;if(!this.expand)try{for(var i=a(this.groups),s=i.next();!s.done;s=i.next()){var r=s.value;r.toggle(t)}}catch(o){e={error:o}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}}},render:function(t){var e={staticClass:"v-list",class:this.classes,attrs:{role:"list"}};return t("div",e,[this.$slots.default])}})},"./src/components/VList/VListGroup.ts": /*!********************************************!*\ !*** ./src/components/VList/VListGroup.ts ***! \********************************************/ /*! exports provided: default */function(t,e,n){"use strict";n.r(e);var i=n(/*! ../VIcon */"./src/components/VIcon/index.ts"),s=n(/*! ../../mixins/bootable */"./src/mixins/bootable.ts"),r=n(/*! ../../mixins/toggleable */"./src/mixins/toggleable.ts"),o=n(/*! ../../mixins/registrable */"./src/mixins/registrable.ts"),a=n(/*! ../transitions */"./src/components/transitions/index.js"),c=n(/*! ../../util/mixins */"./src/util/mixins.ts"),l=function(){return l=Object.assign||function(t){for(var e,n=1,i=arguments.length;n1&&(n.staticClass+=" v-list__tile__action--stack"),t("div",n,s)}})},"./src/components/VList/VListTileAvatar.ts": /*!*************************************************!*\ !*** ./src/components/VList/VListTileAvatar.ts ***! \*************************************************/ /*! exports provided: default */function(t,e,n){"use strict";n.r(e);var i=n(/*! ../VAvatar */"./src/components/VAvatar/index.ts"),s=n(/*! vue */"vue"),r=n.n(s);e["default"]=r.a.extend({name:"v-list-tile-avatar",functional:!0,props:{color:String,size:{type:[Number,String],default:40},tile:Boolean},render:function(t,e){var n=e.data,s=e.children,r=e.props;n.staticClass=("v-list__tile__avatar "+(n.staticClass||"")).trim();var o=t(i["default"],{props:{color:r.color,size:r.size,tile:r.tile}},[s]);return t("div",n,[o])}})},"./src/components/VList/index.ts": /*!***************************************!*\ !*** ./src/components/VList/index.ts ***! \***************************************/ /*! exports provided: VList, VListGroup, VListTile, VListTileAction, VListTileAvatar, VListTileActionText, VListTileContent, VListTileTitle, VListTileSubTitle, default */function(t,e,n){"use strict";n.r(e),n.d(e,"VListTileActionText",(function(){return l})),n.d(e,"VListTileContent",(function(){return u})),n.d(e,"VListTileTitle",(function(){return h})),n.d(e,"VListTileSubTitle",(function(){return d}));var i=n(/*! ../../util/helpers */"./src/util/helpers.ts"),s=n(/*! ./VList */"./src/components/VList/VList.ts");n.d(e,"VList",(function(){return s["default"]}));var r=n(/*! ./VListGroup */"./src/components/VList/VListGroup.ts");n.d(e,"VListGroup",(function(){return r["default"]}));var o=n(/*! ./VListTile */"./src/components/VList/VListTile.ts");n.d(e,"VListTile",(function(){return o["default"]}));var a=n(/*! ./VListTileAction */"./src/components/VList/VListTileAction.ts");n.d(e,"VListTileAction",(function(){return a["default"]}));var c=n(/*! ./VListTileAvatar */"./src/components/VList/VListTileAvatar.ts");n.d(e,"VListTileAvatar",(function(){return c["default"]}));var l=Object(i["createSimpleFunctional"])("v-list__tile__action-text","span"),u=Object(i["createSimpleFunctional"])("v-list__tile__content","div"),h=Object(i["createSimpleFunctional"])("v-list__tile__title","div"),d=Object(i["createSimpleFunctional"])("v-list__tile__sub-title","div");e["default"]={$_vuetify_subcomponents:{VList:s["default"],VListGroup:r["default"],VListTile:o["default"],VListTileAction:a["default"],VListTileActionText:l,VListTileAvatar:c["default"],VListTileContent:u,VListTileSubTitle:d,VListTileTitle:h}}},"./src/components/VMenu/VMenu.js": /*!***************************************!*\ !*** ./src/components/VMenu/VMenu.js ***! \***************************************/ /*! exports provided: default */function(t,e,n){"use strict";n.r(e);n(/*! ../../stylus/components/_menus.styl */"./src/stylus/components/_menus.styl");var i=n(/*! vue */"vue"),s=n.n(i),r=n(/*! ../../mixins/delayable */"./src/mixins/delayable.ts"),o=n(/*! ../../mixins/dependent */"./src/mixins/dependent.ts"),a=n(/*! ../../mixins/detachable */"./src/mixins/detachable.js"),c=n(/*! ../../mixins/menuable.js */"./src/mixins/menuable.js"),l=n(/*! ../../mixins/returnable */"./src/mixins/returnable.ts"),u=n(/*! ../../mixins/toggleable */"./src/mixins/toggleable.ts"),h=n(/*! ../../mixins/themeable */"./src/mixins/themeable.ts"),d=n(/*! ./mixins/menu-activator */"./src/components/VMenu/mixins/menu-activator.js"),f=n(/*! ./mixins/menu-generators */"./src/components/VMenu/mixins/menu-generators.js"),p=n(/*! ./mixins/menu-keyable */"./src/components/VMenu/mixins/menu-keyable.js"),m=n(/*! ./mixins/menu-position */"./src/components/VMenu/mixins/menu-position.js"),g=n(/*! ../../directives/click-outside */"./src/directives/click-outside.ts"),b=n(/*! ../../directives/resize */"./src/directives/resize.ts"),v=n(/*! ../../util/helpers */"./src/util/helpers.ts"),y=n(/*! ../../util/ThemeProvider */"./src/util/ThemeProvider.ts"),S=n(/*! ../../util/console */"./src/util/console.ts");e["default"]=s.a.extend({name:"v-menu",provide:function(){return{theme:this.theme}},directives:{ClickOutside:g["default"],Resize:b["default"]},mixins:[d["default"],o["default"],r["default"],a["default"],f["default"],p["default"],c["default"],m["default"],l["default"],u["default"],h["default"]],props:{auto:Boolean,closeOnClick:{type:Boolean,default:!0},closeOnContentClick:{type:Boolean,default:!0},disabled:Boolean,fullWidth:Boolean,maxHeight:{default:"auto"},openOnClick:{type:Boolean,default:!0},offsetX:Boolean,offsetY:Boolean,openOnHover:Boolean,origin:{type:String,default:"top left"},transition:{type:[Boolean,String],default:"v-menu-transition"}},data:function(){return{defaultOffset:8,hasJustFocused:!1,resizeTimeout:null}},computed:{calculatedLeft:function(){var t=Math.max(this.dimensions.content.width,parseFloat(this.calculatedMinWidth));return this.auto?this.calcXOverflow(this.calcLeftAuto(),t)+"px":this.calcLeft(t)},calculatedMaxHeight:function(){return this.auto?"200px":Object(v["convertToUnit"])(this.maxHeight)},calculatedMaxWidth:function(){return isNaN(this.maxWidth)?this.maxWidth:this.maxWidth+"px"},calculatedMinWidth:function(){if(this.minWidth)return isNaN(this.minWidth)?this.minWidth:this.minWidth+"px";var t=Math.min(this.dimensions.activator.width+this.nudgeWidth+(this.auto?16:0),Math.max(this.pageWidth-24,0)),e=isNaN(parseInt(this.calculatedMaxWidth))?t:parseInt(this.calculatedMaxWidth);return Math.min(e,t)+"px"},calculatedTop:function(){return!this.auto||this.isAttached?this.calcTop():this.calcYOverflow(this.calculatedTopAuto)+"px"},styles:function(){return{maxHeight:this.calculatedMaxHeight,minWidth:this.calculatedMinWidth,maxWidth:this.calculatedMaxWidth,top:this.calculatedTop,left:this.calculatedLeft,transformOrigin:this.origin,zIndex:this.zIndex||this.activeZIndex}}},watch:{activator:function(t,e){this.removeActivatorEvents(e),this.addActivatorEvents(t)},disabled:function(t){this.activator&&(t?this.removeActivatorEvents(this.activator):this.addActivatorEvents(this.activator))},isContentActive:function(t){this.hasJustFocused=t}},mounted:function(){this.isActive&&this.activate(),"v-slot"===Object(v["getSlotType"])(this,"activator",!0)&&Object(S["consoleError"])("v-tooltip's activator slot must be bound, try '