var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.createTemplateTagFirstArg=function(a){return a.raw=a};$jscomp.createTemplateTagFirstArgWithRaw=function(a,b){a.raw=b;return a};$jscomp.arrayIteratorImpl=function(a){var b=0;return function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}}};$jscomp.arrayIterator=function(a){return{next:$jscomp.arrayIteratorImpl(a)}};$jscomp.makeIterator=function(a){var b="undefined"!=typeof Symbol&&Symbol.iterator&&a[Symbol.iterator];return b?b.call(a):$jscomp.arrayIterator(a)};
$jscomp.arrayFromIterator=function(a){for(var b,c=[];!(b=a.next()).done;)c.push(b.value);return c};$jscomp.arrayFromIterable=function(a){return a instanceof Array?a:$jscomp.arrayFromIterator($jscomp.makeIterator(a))};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;$jscomp.ISOLATE_POLYFILLS=!1;$jscomp.FORCE_POLYFILL_PROMISE=!1;$jscomp.FORCE_POLYFILL_PROMISE_WHEN_NO_UNHANDLED_REJECTION=!1;
$jscomp.objectCreate=$jscomp.ASSUME_ES5||"function"==typeof Object.create?Object.create:function(a){var b=function(){};b.prototype=a;return new b};$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(a==Array.prototype||a==Object.prototype)return a;a[b]=c.value;return a};
$jscomp.getGlobal=function(a){a=["object"==typeof globalThis&&globalThis,a,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var b=0;b<a.length;++b){var c=a[b];if(c&&c.Math==Math)return c}throw Error("Cannot find global object");};$jscomp.global=$jscomp.getGlobal(this);$jscomp.IS_SYMBOL_NATIVE="function"===typeof Symbol&&"symbol"===typeof Symbol("x");$jscomp.TRUST_ES6_POLYFILLS=!$jscomp.ISOLATE_POLYFILLS||$jscomp.IS_SYMBOL_NATIVE;$jscomp.polyfills={};
$jscomp.propertyToPolyfillSymbol={};$jscomp.POLYFILL_PREFIX="$jscp$";var $jscomp$lookupPolyfilledValue=function(a,b){var c=$jscomp.propertyToPolyfillSymbol[b];if(null==c)return a[b];c=a[c];return void 0!==c?c:a[b]};$jscomp.polyfill=function(a,b,c,d){b&&($jscomp.ISOLATE_POLYFILLS?$jscomp.polyfillIsolated(a,b,c,d):$jscomp.polyfillUnisolated(a,b,c,d))};
$jscomp.polyfillUnisolated=function(a,b,c,d){c=$jscomp.global;a=a.split(".");for(d=0;d<a.length-1;d++){var e=a[d];if(!(e in c))return;c=c[e]}a=a[a.length-1];d=c[a];b=b(d);b!=d&&null!=b&&$jscomp.defineProperty(c,a,{configurable:!0,writable:!0,value:b})};
$jscomp.polyfillIsolated=function(a,b,c,d){var e=a.split(".");a=1===e.length;d=e[0];d=!a&&d in $jscomp.polyfills?$jscomp.polyfills:$jscomp.global;for(var f=0;f<e.length-1;f++){var g=e[f];if(!(g in d))return;d=d[g]}e=e[e.length-1];c=$jscomp.IS_SYMBOL_NATIVE&&"es6"===c?d[e]:null;b=b(c);null!=b&&(a?$jscomp.defineProperty($jscomp.polyfills,e,{configurable:!0,writable:!0,value:b}):b!==c&&(void 0===$jscomp.propertyToPolyfillSymbol[e]&&(c=1E9*Math.random()>>>0,$jscomp.propertyToPolyfillSymbol[e]=$jscomp.IS_SYMBOL_NATIVE?
$jscomp.global.Symbol(e):$jscomp.POLYFILL_PREFIX+c+"$"+e),$jscomp.defineProperty(d,$jscomp.propertyToPolyfillSymbol[e],{configurable:!0,writable:!0,value:b})))};
$jscomp.getConstructImplementation=function(){function a(){function c(){}new c;Reflect.construct(c,[],function(){});return new c instanceof c}if($jscomp.TRUST_ES6_POLYFILLS&&"undefined"!=typeof Reflect&&Reflect.construct){if(a())return Reflect.construct;var b=Reflect.construct;return function(c,d,e){c=b(c,d);e&&Reflect.setPrototypeOf(c,e.prototype);return c}}return function(c,d,e){void 0===e&&(e=c);e=$jscomp.objectCreate(e.prototype||Object.prototype);return Function.prototype.apply.call(c,e,d)||
e}};$jscomp.construct={valueOf:$jscomp.getConstructImplementation}.valueOf();$jscomp.underscoreProtoCanBeSet=function(){var a={a:!0},b={};try{return b.__proto__=a,b.a}catch(c){}return!1};$jscomp.setPrototypeOf=$jscomp.TRUST_ES6_POLYFILLS&&"function"==typeof Object.setPrototypeOf?Object.setPrototypeOf:$jscomp.underscoreProtoCanBeSet()?function(a,b){a.__proto__=b;if(a.__proto__!==b)throw new TypeError(a+" is not extensible");return a}:null;
$jscomp.inherits=function(a,b){a.prototype=$jscomp.objectCreate(b.prototype);a.prototype.constructor=a;if($jscomp.setPrototypeOf){var c=$jscomp.setPrototypeOf;c(a,b)}else for(c in b)if("prototype"!=c)if(Object.defineProperties){var d=Object.getOwnPropertyDescriptor(b,c);d&&Object.defineProperty(a,c,d)}else a[c]=b[c];a.superClass_=b.prototype};$jscomp.polyfill("Reflect",function(a){return a?a:{}},"es6","es3");$jscomp.polyfill("Reflect.construct",function(a){return $jscomp.construct},"es6","es3");
$jscomp.polyfill("Reflect.setPrototypeOf",function(a){if(a)return a;if($jscomp.setPrototypeOf){var b=$jscomp.setPrototypeOf;return function(c,d){try{return b(c,d),!0}catch(e){return!1}}}return null},"es6","es5");$jscomp.owns=function(a,b){return Object.prototype.hasOwnProperty.call(a,b)};$jscomp.polyfill("Object.entries",function(a){return a?a:function(b){var c=[],d;for(d in b)$jscomp.owns(b,d)&&c.push([d,b[d]]);return c}},"es8","es3");$jscomp.initSymbol=function(){};
$jscomp.polyfill("Symbol",function(a){if(a)return a;var b=function(f,g){this.$jscomp$symbol$id_=f;$jscomp.defineProperty(this,"description",{configurable:!0,writable:!0,value:g})};b.prototype.toString=function(){return this.$jscomp$symbol$id_};var c="jscomp_symbol_"+(1E9*Math.random()>>>0)+"_",d=0,e=function(f){if(this instanceof e)throw new TypeError("Symbol is not a constructor");return new b(c+(f||"")+"_"+d++,f)};return e},"es6","es3");
$jscomp.polyfill("Symbol.iterator",function(a){if(a)return a;a=Symbol("Symbol.iterator");for(var b="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),c=0;c<b.length;c++){var d=$jscomp.global[b[c]];"function"===typeof d&&"function"!=typeof d.prototype[a]&&$jscomp.defineProperty(d.prototype,a,{configurable:!0,writable:!0,value:function(){return $jscomp.iteratorPrototype($jscomp.arrayIteratorImpl(this))}})}return a},"es6",
"es3");$jscomp.iteratorPrototype=function(a){a={next:a};a[Symbol.iterator]=function(){return this};return a};$jscomp.iteratorFromArray=function(a,b){a instanceof String&&(a+="");var c=0,d=!1,e={next:function(){if(!d&&c<a.length){var f=c++;return{value:b(f,a[f]),done:!1}}d=!0;return{done:!0,value:void 0}}};e[Symbol.iterator]=function(){return e};return e};$jscomp.polyfill("Array.prototype.keys",function(a){return a?a:function(){return $jscomp.iteratorFromArray(this,function(b){return b})}},"es6","es3");
$jscomp.checkStringArgs=function(a,b,c){if(null==a)throw new TypeError("The 'this' value for String.prototype."+c+" must not be null or undefined");if(b instanceof RegExp)throw new TypeError("First argument to String.prototype."+c+" must not be a regular expression");return a+""};
$jscomp.polyfill("String.prototype.repeat",function(a){return a?a:function(b){var c=$jscomp.checkStringArgs(this,null,"repeat");if(0>b||1342177279<b)throw new RangeError("Invalid count value");b|=0;for(var d="";b;)if(b&1&&(d+=c),b>>>=1)c+=c;return d}},"es6","es3");
var xtrs=null,translationTables={fr:{"++8ve":"++8ve","+8ve":"+8ve","--8ve":"--8ve","-8ve":"-8ve",Alternatives:"Alternatives",Bold:"Gras",BoldItalic:"GrasItalique",CABD:"CABD",Chord:"Accord","Chord Style":"Style d'Accords",Combined:"Combin\u00e9e",Concert:"Concert",Default:"D\u00e9faut",Font:"Police","French/Irish Folk":"Folk fran\u00e7ais/irlandais",Grey:"Gris",Harmonica:"Harmonica",Instrument:"Instrument",Italic:"Italique",Label:"Description",LanguageSym:"[FR]","Not Shown":"Non montr\u00e9","Oops. Something went wrong.":"Oups. Quelque chose a mal tourn\u00e9.",
Pad:"Remplissez",Preset:"Pr\u00e9r\u00e9glage",Pull:"Tir\u00e9",Push:"Pouss\u00e9",Regular:"R\u00e9gulier",Row:"Rang\u00e9e","Size/Style":"Taille/Style",Variant:"Variante","Blues Harp":"Harmonica Blues","Chromatic Harmonica":"Harmonica Chromatique","Handry 12 Bass 3 Row Accordion":"Accord\u00e9on Handry 12 Basse 3 Rang\u00e9e","Lyric Font":"Police des Paroles","N/A":"N/D","Please report error to":"Veuillez signaler les erreurs \u00e0",Simple:"Simple","The AccordionButtons plugin requires MuseScore 4 or later":"Le plugin AccordionButtons n\u00e9cessite MuseScore 4 ou une version sup\u00e9rieure",
"chord includes both push and pull notes":"l'accord comprend \u00e0 la fois des notes en pouss\u00e9e et tir\u00e9e","instrument can not play this note":"l'instrument ne peut pas jouer cette note","no playable options":"aucune option jouable","Diatonic Accordion, 1 Row (10 Button)":"Accord\u00e9on Diatonique 1 Rang\u00e9e (10 Boutons)","Diatonic Accordion, 2 Row (21 Button)":"Accord\u00e9on Diatonique 2 Rang\u00e9es (21 Boutons)","Diatonic Accordion, 2 Row (23 Button)":"Accord\u00e9on Diatonique 2 Rang\u00e9es (23 Boutons)",
"Piano Accordion (chords/bass)":"Accord\u00e9on Piano (accords/basses)","note out of range":"note hors de port\u00e9e","A new version of the AccordionButtons plugin has been installed. Saved setting have been reset to the default values.":"Une nouvelle version du plugin AccordionButtons a \u00e9t\u00e9 install\u00e9e. Les param\u00e8tres enregistr\u00e9s ont \u00e9t\u00e9 r\u00e9initialis\u00e9s aux valeurs par d\u00e9faut.","Contributed by":"Contribu\u00e9 par","A(3)/D(3)":"La(3)/R\u00e9(3)","B\u266d(3)/E\u266d(3)":"Si\u266d(3)/Mi\u266d(3)",
"C(3)":"Do(3)","C(4)/B(3)":"Do(4)/Si(3)","C(5)/B(4)":"Do(5)/Si(4)","D(3)":"R\u00e9(3)","D(4)/C\u266f(3)":"R\u00e9(4)/Do\u266f(3)","D(5)/C\u266f(4)":"R\u00e9(5)/Do\u266f(4)","G(3)/C(3)":"Sol(3)/Do(3)","A(2)/D(3)/G(3)":"La(2)/R\u00e9((3)/Sol(3)","B(3)/C(3)":"Si(3)/Do(3)","C\u266f(3)/D(3)":"Do\u266f(3)/R\u00e9((3)","Diatonic Accordion, 3 Row (34 Button)":"Accord\u00e9on Diatonique 3 Rang\u00e9es (34 Boutons)","G(2)/C(3)/F(3)":"Sol(2)/Do(3)/Fa(3)"}};
function xsTr(a){null==xtrs&&(xtrs=findTranslations());for(var b=0;b<xtrs.length;++b){var c=xtrs[b];if(null!=c[a])return c[a]}return qsTr(a)}function findTranslations(){var a=[],b=Qt.locale().name,c=b?b.split("_")[0]:"en";null!=CT.translations[b]&&a.push(CT.translations[b]);null!=CT.translations[c]&&a.push(CT.translations[c]);null!=translationTables[b]&&a.push(translationTables[b]);null!=translationTables[c]&&a.push(translationTables[c]);return a}
function titleString(){var a=xsTr("LanguageSym");return'<a href="https://www.nine3.org/downloads/home/accordion.html" style="text-decoration: none;">\ud83c\udf10</a> '+("LanguageSym"==a?"":a+" ")+"Accordion Buttons 2.3"}
var instrumentTables=[{name:xsTr("Diatonic Accordion, 1 Row (10 Button)"),author:"Marc Duval",id:"10button",keys:[{name:xsTr("C(3)"),id:"C"},{name:xsTr("D(3)"),transpose:2,id:"D"}],staves:{treble:{min:52,max:88,notes:"+1 ? ? +2|-1 ? ? ? -2 +3 ? -3 ? +4 -4 ? +5 ? -5 ? -6 +6 ? -7 ? +7 -8 ? +8 ? -9 ? -10 +9 ? ? ? +10".split(" ")},bass:{auto:!0}}},{name:xsTr("Diatonic Accordion, 2 Row (21 Button)"),author:"Marc Duval & Paul Anderson",id:"21button",keys:[{name:xsTr("B(3)/C(3)"),staves:"paul",id:"BC"},
{name:xsTr("C\u266f(3)/D(3)"),staves:"paul",transpose:2,id:"C#D"},{name:xsTr("G(3)/C(3)"),staves:"marc1",id:"GC"},{name:xsTr("A(3)/D(3)"),staves:"marc1",transpose:2,id:"AD"},{name:xsTr("B\u266d(3)/E\u266d(3)"),staves:"marc1",transpose:3,id:"BbEb"},{name:xsTr("D(4)/C\u266f(3)"),staves:"marc2",id:"DC#"},{name:xsTr("C(4)/B(3)"),staves:"marc2",transpose:-2,id:"CB"}],staves_marc1:{treble:{min:50,max:88,notes:"+2 ? ? ? -2 +3|+2^ ? -3 ? +4|-2^ -4|+3^ +1 +5|-3^ -1 -5|+4^ -4^ -6 +6|+5^ -1^ -7|-5^ +1^ +7|-6^ -8|+6^ ? +8|-7^ ? -9|+7^ -8^ -10 +9|+8^ ? -11|-9^ ? +10|-10^ +9^ ? +11 ? +10^".split(" ")},
bass:{auto:!0}},staves_marc2:{treble:{min:50,max:90,notes:"+1 ? ? +1^ +2 -1 +2^ +3 -1^ -2 -2^ -3|+3^ +4 -3^ -4 +4^ +5|-4^ -5 +5^ +6 -5^ -6 -6^ -7|+6^ +7 -7^ -8 +7^ +8|-8^ -9 +8^ +9 -9^ -10 -10^ -11|+9^ +10 ? ? +10^ +11".split(" ")},bass:{auto:!0}},staves_paul:{treble:{min:51,max:90,notes:"+1^ +1 ? +2^ +2 -1^ -1 -2 +3^|-2 +3 -3^ -3 +4^ +4|-4^ -4 +5^ +5 -5^ -5 -6^ +6^|-6 +6 -7^ -7 +7^ +7|-8^ -8 +8^ +8 -9^ -9 -10^ +9^|-10 +9 -11^ ? +10^ +10 ? +11".split(" ")},bass:{auto:!0}}},{name:xsTr("Diatonic Accordion, 2 Row (23 Button)"),
author:"Marc Duval",id:"23button",keys:[{name:xsTr("D(5)/C\u266f(4)")},{name:xsTr("C(5)/B(4)"),transpose:-2},{name:xsTr("D(4)/C\u266f(3)"),staves:"A"},{name:xsTr("C(4)/B(3)"),transpose:-2,staves:"A"}],staves:{treble:{min:45,max:90,notes:"+1 ? ? ? +1^ +2 ? -1 +2^ +3|-1^ -2 +3^ +4 -2^ -3 -3^ -4|+4^ +5 -4^ -5 +5^ +6|-5^ -6 +6^ +7 -6^ -7 -7^ -8|+7^ +8 -8^ -9 +8^ +9|-9^ -10 +9^ +10 -10^ -11 -11^ -12|+10^ +11 ? ? +11^ +12".split(" ")},bass:{auto:!0}},staves_A:{treble:{min:50,max:93,notes:"+1 ? ? +1^ +2 -1 +2^ +3 -1^ -2 -2^ -3|+3^ +4 -3^ -4 +4^ +5|-4^ -5 +5^ +6 -5^ -6 -6^ -7|+6^ +7 -7^ -8 +7^ +8|-8^ -9 +8^ +9 -9^ -10 -10^ -11|+9^ +10 -11^ -12 +10^ +11 ? +11^ +12".split(" ")},
bass:{auto:!0}}},{name:xsTr("Diatonic Accordion, 3 Row (34 Button)"),author:"Marc Duval",id:"34button",keys:[{name:xsTr("G(2)/C(3)/F(3)"),id:"GCF"},{name:xsTr("A(2)/D(3)/G(3)"),transpose:2,id:"ADG"}],staves:{treble:{min:55,max:96,notes:"+2|+2^ ? -2 ? +3|-2^ -3|+3^|+2^^ +1 +4|-3^ -1 -4|+4^|-2^^ -4^|+3^^ -5|+1^ +5|+5^|-3^^ -1^ -6|-5^|+4^^ -4^^ +6|-6^ -7|+6^|+5^^ -1^^ +7|-7^|-5^^ +1^^ -8|+7^|-6^^ -8^|+6^^ -9 +8|+8^|-7^^ ? -10|-9^|+7^^ -8^^ +9|-10^ -11|+9^|+8^^ ? +10|-11^|-9^^ ? +10^|-10^^ -12^|+9^^ ? +11|+11^|-11^^ ? +10^^ ? ? +12^|+11^^".split(" ")},
bass:{auto:!0}}},{name:xsTr("Handry 12 Bass 3 Row Accordion"),id:"handry3",author:"Daniel Meyer",staves:{treble:{min:47,max:92,notes:"-1 ? ? -2 ? +1|-1^ ? +2 -3|+1^|-2^ -1^^ +3|-2^^ +1^^ -4|+2^ +4|-3^ +2^^ -5|+3^ -3^^ +5|-4^ +4^ +6 -6|-5^|+3^^ -4^^ +7|+5^|-5^^ +5^^ -7|+6^ +8|-6^ +6^^ -8|+7^ -6^^ +9|-7^ +8^ +10 -9|-8^|+7^^ -7^^|+8^^ +11|+9^|-8^^ +9^^ -10|+10^ +12|-9^ +10^^ -11|+11^ -9^^ -10^ ? ? -12|-11^ -10^^".split(" ")},bass:{auto:!0}}},{name:xsTr("Piano Accordion (chords/bass)"),id:"piano",staves:{bass:{auto:!0}}},
{name:xsTr("Blues Harp"),id:"bluesharp",info:'\nThis is a <i>Blues Harp</i> or <i>Richter-Tuned Harmonica</i>.<br/>\nSee the <a href="https://en.wikipedia.org/wiki/Richter-tuned_harmonica">Wikipedia Page</a>.\n',keys:[{name:xsTr("B\u266d"),transpose:-2,id:"Bb"},{name:xsTr("F"),transpose:5,id:"F"},{name:xsTr("C"),id:"C"},{name:xsTr("G"),transpose:-5,id:"G"},{name:xsTr("D"),transpose:2,id:"D"},{name:xsTr("A"),transpose:-3,id:"A"},{name:xsTr("E"),transpose:4,id:"E"}],staves:{default:{min:60,max:96,notes:"+1 ? -1 ? +2 ? ? -2 ? ? ? -3 +4 ? -4 ? +5 -5 ? +6 ? -6 ? -7 +7 ? -8 ? +8 -9 ? +9 ? -10 ? ? +10".split(" ")}}},
{name:xsTr("Chromatic Harmonica"),id:"chromatic_harmonica",info:'\nThis is a <i>Chromatic Harmonica</i>.<br/>\nSee the <a href="https://en.wikipedia.org/wiki/Chromatic_harmonica">Wikipedia Page</a>.\n',keys:[{name:xsTr("B\u266d"),transpose:-2,id:"Bb"},{name:xsTr("F"),transpose:5,id:"F"},{name:xsTr("C"),id:"C"},{name:xsTr("G"),transpose:-5,id:"G"},{name:xsTr("D"),transpose:2,id:"D"},{name:xsTr("A"),transpose:-3,id:"A"},{name:xsTr("E"),transpose:4,id:"E"}],staves:{default:{min:60,max:90,notes:"+1 +1^ -1 -1^ +2 -2|+2^ -2^ +3 +3^ -3 -3^ -4 +4|-4^|+5 +4^|+5^ -5 -5^ +6 -6|+6^ -6^ +7 +7^ -7 -7^ -7 +7|-8^|+9 +8^|+9^ -9 -9^ +10 -10|+10^ -10^".split(" ")}}}],
ABNode=function(){};ABNode.prototype.add=function(){throw"no "+this.constructor.name+".add()";};ABNode.prototype.asString=function(){throw"no "+this.constructor.name+".asString()";};ABNode.prototype.asDisplayString=function(){throw"no "+this.constructor.name+".asDisplayString()";};ABNode.prototype.compareIndex=function(){throw"no "+this.constructor.name+".compareIndex()";};ABNode.prototype.asList=function(){return[this]};ABNode.prototype.pickOne=function(){return this};ABNode.prototype.isPush=function(){return!1};
ABNode.prototype.isPull=function(){return!1};ABNode.prototype.isPlayable=function(){return!0};ABNode.prototype.isOption=function(){return!1};ABNode.prototype.isChord=function(){return!1};ABNode.prototype.isNote=function(){return!1};ABNode.prototype.isChordSym=function(){return!1};
var presets={default:{name:xsTr("Default"),prePull:"",postPull:"",pullUnderscore:!1,pullShift:!1,prePush:"",postPush:"",pushUnderscore:!0,pushShift:!1,preRow:"",postRow:"'",preChord:"(",postChord:")",chordSeparator:"+",font:bestFont([]),rowInside:!0,showLabel:!0,pad:!1,info:"",includeInstrument:!0,instrumentIndex:menuIndexForInstrumentID("21button"),variantIndex:menuIndexForVariantID("GC","21button"),chordStyleIndex:menuIndexForChordStyle("Default"),fontSizeIndex:menuIndexForFontSize("12"),fontStyleIndex:menuIndexForFontStyle("Bold"),
altStyleIndex:menuIndexForAltStyle("Regular"),octaveIndex:menuIndexForOctave("Concert"),altColour:"silver"},magnus:{name:"Magnus",prePull:"",postPull:"O",pullUnderscore:!1,pullShift:!1,prePush:"",postPush:"I",pushUnderscore:!1,pushShift:!1,preRow:"[",postRow:"]",rowInside:!1,font:bestFont(["Gill Sans MT Ext Condensed Bold"]),fontSizeIndex:menuIndexForFontSize("20"),fontStyleIndex:menuIndexForFontStyle("Regular"),altStyleIndex:menuIndexForAltStyle("Grey"),octaveIndex:menuIndexForOctave("Concert"),
chordStyleIndex:menuIndexForChordStyle("Simple"),showLabel:!1,includeInstrument:!0,instrumentIndex:menuIndexForInstrumentID("21button"),variantIndex:menuIndexForVariantID("BC","21button"),info:'\nThis is a style with a large font size. It is intended to use the\n<code>Gill Sans extended</code> font which is not normally installed by default,\nbut is freely available available from the\n<a href="https://www.freefontdownload.org/en/gill-sans-mt-extended-condensed-bold.font">FreeFontDownload</a> site.\n'},
cabd:{name:xsTr("CABD"),prePull:"",postPull:"",pullUnderscore:!1,pullShift:!1,prePush:"",postPush:"",pushUnderscore:!1,pushShift:!0,preRow:"",postRow:"'",rowInside:!1,font:bestFont([]),fontSizeIndex:menuIndexForFontSize("12"),fontStyleIndex:menuIndexForFontStyle("Bold"),altStyleIndex:menuIndexForAltStyle("Not Shown"),chordStyleIndex:menuIndexForChordStyle("Simple"),includeInstrument:!1,info:"\nThis is a style which shows the <i>push</i> and <i>pull</i> notes on separate lines,\nwith the <i>push</i> notes higher than the <i>pull</i> notes.\n"},
folk:{name:xsTr("French/Irish Folk"),prePull:"",postPull:"",pullUnderscore:!1,pullShift:!1,prePush:"",postPush:"",pushUnderscore:!0,pushShift:!1,preRow:"",postRow:"'",rowInside:!1,font:bestFont([]),fontSizeIndex:menuIndexForFontSize("12"),fontStyleIndex:menuIndexForFontStyle("Bold"),altStyleIndex:menuIndexForAltStyle("Not Shown"),chordStyleIndex:menuIndexForChordStyle("Simple"),includeInstrument:!1,info:"\nThis is a style which shows the <i>push</i> notes underlined\n(and the <i>pull</i> notes not underlined).\n"},
harmonica:{name:xsTr("Harmonica"),prePull:"",postPull:"\u2193",pullUnderscore:!1,pullShift:!1,prePush:"",postPush:"\u2191",pushUnderscore:!1,pushShift:!1,preRow:"",postRow:"'",rowInside:!0,font:bestFont([]),fontSizeIndex:menuIndexForFontSize("12"),fontStyleIndex:menuIndexForFontStyle("Bold"),altStyleIndex:menuIndexForAltStyle("Not Shown"),chordStyleIndex:menuIndexForChordStyle("Default"),includeInstrument:!1,info:"\nThis style is intended for the harmonica.\nIt shows the blow/suck notes as up/down arrows.\n"},
louis:{name:"Louis",prePull:"(",postPull:")",pullUnderscore:!1,pullShift:!1,prePush:"",postPush:"",pushUnderscore:!1,pushShift:!1,preRow:"",postRow:"'",rowInside:!0,font:bestFont([]),fontSizeIndex:menuIndexForFontSize("10"),fontStyleIndex:menuIndexForFontStyle("Regular"),altStyleIndex:menuIndexForAltStyle("Combined"),chordStyleIndex:menuIndexForChordStyle("Default"),showLabel:!1,includeInstrument:!1,info:""},test:{name:"Test",prePull:"",postPull:"\u2193",pullUnderscore:!1,pullShift:!1,prePush:"",
postPush:"\u2191",pushUnderscore:!1,pushShift:!1,preRow:"[",postRow:"]",rowInside:!1,chordStyleIndex:0,includeInstrument:!1,info:""}},presetMenuOrder="default cabd folk harmonica magnus louis".split(" ");function presetMenuNames(){var a=[];presetMenuOrder.forEach(function(b){a.push(presets[b].name)});return a}var defaultStyle=presets.default,currentStyle=defaultStyle;function setStyleByIndex(a){setCurrentStyleByKey(presetMenuOrder[a]);putStyleToDialog()}
function setCurrentStyleByKey(a){a=presets[a];for(var b=presets.default,c={},d=$jscomp.makeIterator(Object.entries(b)),e=d.next();!e.done;e=d.next()){e=$jscomp.makeIterator(e.value);var f=e.next().value;e.next();c[f]=null!=a[f]?a[f]:null!=currentStyle[f]?currentStyle[f]:b[f]}currentStyle=c;configureStyleInfo()}
function configureStyleInfo(){var a=currentStyle.info;null==a||""==a?(presetInfoButton.visible=!1,presetSelector.implicitWidth=180):(presetInfoButton.visible=!0,presetSelector.implicitWidth=160)}
function getStyleFromDialog(){setCurrentStyleByKey(presetMenuOrder[presetSelector.currentIndex]);currentStyle.prePull=prePullSymInput.text;currentStyle.postPull=postPullSymInput.text;currentStyle.prePush=prePushSymInput.text;currentStyle.postPush=postPushSymInput.text;currentStyle.preRow=preRowSymInput.text;currentStyle.postRow=postRowSymInput.text;currentStyle.preChord=preChordSymInput.text;currentStyle.postChord=postChordSymInput.text;currentStyle.chordSeparator=chordSeparatorSymInput.text;currentStyle.font=
fontButton.text;currentStyle.fontSizeIndex=fontSizeSelector.currentIndex;currentStyle.fontStyleIndex=fontStyleSelector.currentIndex;currentStyle.variantIndex=variantSelector.currentIndex;currentStyle.octaveIndex=octaveSelector.currentIndex;currentStyle.chordStyleIndex=chordStyleSelector.currentIndex;currentStyle.altStyleIndex=altStyleSelector.currentIndex;currentStyle.instrumentIndex=instrumentSelector.currentIndex;currentStyle.rowInside=dialogGrid.rowInside;currentStyle.pullUnderscore=pullUnderscore.checked;
currentStyle.pushUnderscore=pushUnderscore.checked;currentStyle.pullShift=pullShift.checked;currentStyle.pushShift=pushShift.checked;currentStyle.showLabel=labelBox.checked;currentStyle.pad=padBox.checked;setAnnotationOrder()}
function putStyleToDialog(){prePushSymInput.text=currentStyle.prePush;postPushSymInput.text=currentStyle.postPush;prePullSymInput.text=currentStyle.prePull;postPullSymInput.text=currentStyle.postPull;preRowSymInput.text=currentStyle.preRow;postRowSymInput.text=currentStyle.postRow;preChordSymInput.text=currentStyle.preChord;postChordSymInput.text=currentStyle.postChord;chordSeparatorSymInput.text=currentStyle.chordSeparator;fontButton.text=currentStyle.font;fontSizeSelector.currentIndex=currentStyle.fontSizeIndex;
fontStyleSelector.currentIndex=currentStyle.fontStyleIndex;altStyleSelector.currentIndex=currentStyle.altStyleIndex;chordStyleSelector.currentIndex=currentStyle.chordStyleIndex;dialogGrid.rowInside=currentStyle.rowInside;pullUnderscore.checked=currentStyle.pullUnderscore;pushUnderscore.checked=currentStyle.pushUnderscore;pullShift.checked=currentStyle.pullShift;pushShift.checked=currentStyle.pushShift;labelBox.checked=currentStyle.showLabel;padBox.checked=currentStyle.pad;currentStyle.includeInstrument&&
(instrumentSelector.currentIndex=currentStyle.instrumentIndex,setInstrument(),variantSelector.currentIndex=currentStyle.variantIndex,octaveSelector.currentIndex=currentStyle.octaveIndex);setAnnotationOrder()}function menuIndexForOctave(a){var b={"++8ve":0,"+8ve":1,Concert:2,"-8ve":3,"--8ve":4}[a];if(null!=b)return b;console.log("\u26a0\ufe0f no octave menu item: "+a);return 0}
function menuIndexForFontSize(a){var b={6:0,8:1,9:2,10:3,11:4,12:5,14:6,16:7,18:8,20:9}[a];if(null!=b)return b;console.log("\u26a0\ufe0f no font size menu item: "+a);return 0}function menuIndexForFontStyle(a){var b={Regular:0,Bold:1,Italic:2,BoldItalic:3}[a];if(null!=b)return b;console.log("\u26a0\ufe0f no font style menu item: "+a);return 0}
function menuIndexForAltStyle(a){var b={"Not Shown":0,Regular:1,Italic:2,Grey:3,Combined:4}[a];if(null!=b)return b;console.log("\u26a0\ufe0f no alternative style menu item: "+a);return 0}function menuIndexForChordStyle(a){var b={Default:0,Simple:1}[a];if(null!=b)return b;console.log("\u26a0\ufe0f no chord style menu item: "+a);return 0}
function menuIndexForInstrumentID(a){for(var b=0;b<instrumentTables.length;++b)if(instrumentTables[b].id==a)return b;console.log("\u26a0\ufe0f no instrument for id: "+a);return 0}function menuIndexForVariantID(a,b){var c=instrumentTables[menuIndexForInstrumentID(b)],d=c.keys;if(null==d)return console.log("\u26a0\ufe0f no variants for instrument: "+c.name+" ("+b+")"),0;for(b=0;b<d.length;++b)if(d[b].id==a)return b;console.log("\u26a0\ufe0f no variant: "+c.name+" ("+a+")");return 0}var _noteNames=null;
function nameForNote(a){null==_noteNames&&(_noteNames=[xsTr("C"),xsTr("C\u266f"),xsTr("D"),xsTr("E\u266d"),xsTr("E"),xsTr("F"),xsTr("F\u266f"),xsTr("G"),xsTr("A\u266d"),xsTr("A"),xsTr("B\u266d"),xsTr("B")]);return _noteNames[a]}
var chordStyles={default:{name:xsTr("Default"),maj:"\u25b3",min:"m",dim:"\u2205",aug:"+",dom7:"7",maj7:"\u25b37",min7:"m7",m7b5:"\u22057",dim7:"\u25cb",aug7:"7+",slash:!0,lcbass:!1,lcchord:!1},simple:{name:xsTr("Simple"),maj:"",min:"m",dim:"dim",aug:"aug",dom7:"7",maj7:"",min7:"m",m7b5:"dim",dim7:"dim",aug7:"aug",slash:!1,lcbass:!1,lcchord:!0}};function defaultChordStyle(){return chordStyles.default}
function chordStyleForIndex(a){var b=["Default","Simple"];a=b[a];null==a&&(a=b[0]);b=chordStyles[a.toLowerCase()];null==b&&(b=defaultChordStyle());return b}function makeFontList(a){for(var b=[],c=0,d=Qt.fontFamilies(),e=!1,f=0;f<d.length;++f){var g=d[f];null!=a&&g==a?e=!0:null==/^\./.exec(g)&&b.push(g)}e&&(b.unshift(a),c=1);b.unshift(xsTr("Lyric Font"));e||(c=0);return[b,c]}function bestFont(a){for(var b=0;b<a.length;++b)if(hasFont(a[b]))return a[b];return"Arial Narrow"}var fontExists=null;
function hasFont(a){if(null==fontExists){fontExists={};for(var b=Qt.fontFamilies(),c=0;c<b.length;++c)fontExists[b[c]]=!0}return fontExists[a]?!0:!1}function overrideKey(a){a.accepted=a.key===Qt.Key_Return||a.key===Qt.Key_Up||a.key===Qt.Key_Tab||a.key===Qt.Key_Backtab||a.key===Qt.Key_Down}
function mapKey(a,b){a.key===Qt.Key_Return?b="\u23ce":a.key===Qt.Key_Up?b="\u2191":a.key===Qt.Key_Down?b="\u2193":a.key!==Qt.Key_Tab&&a.key!==Qt.Key_Backtab&&(" "==a.text?b="\u2423":""!=a.text&&(b=a.text));return b}function setAnnotationOrder(){dialogGrid.rowInside?(pushOrder.text="\u2190\u2192",pullOrder.text="\u2190\u2192",rowOrder.text="\u2192\u2190"):(pushOrder.text="\u2192\u2190",pullOrder.text="\u2192\u2190",rowOrder.text="\u2190\u2192")}
var currentIndex=0,Instrument=function(a,b,c){this.table=instrumentTables[a];this.name=this.table.name;this.keyOffset=b;this.staves=this.table.staves;""!=c&&(a=this.table["staves_"+c],null!=a&&(this.staves=a));null==this.staves&&(this.staves={});currentIndex=0;a=$jscomp.makeIterator(Object.entries(this.staves));for(b=a.next();!b.done;b=a.next()){c=$jscomp.makeIterator(b.value);b=c.next().value;c=c.next().value;null==c.min&&(c.min=0);null==c.max&&(c.max=c.min-1);null==c.notes&&(c.notes=[]);null==c.auto&&
(c.auto=!1);if(c.max-c.min!=c.notes.length-1)throw"invalid table size: "+b+" => "+c.max+"-"+c.min+"!="+(c.notes.length-1);c.nodes=[];for(b=0;b<c.notes.length;++b)c.nodes[b]=parseTableElement(c.notes[b],c.min+b)}};Instrument.prototype.nodeForNote=function(a,b){b=this.staves[b];null==b&&(b=this.staves["default"]);if(null==b)return null;var c=a.pitch-this.keyOffset;return c>=b.min&&c<=b.max?b.nodes[c-b.min]:b.auto?new GenericNote(a.pitch):new Unplayable(xsTr("note out of range"))};
Instrument.prototype.nodeForNotes=function(a,b){var c=1<a.length?buildChord(a,this.table,b):null;if(null!=c)return c;for(var d=1;d<a.length+1;++d){var e=this.nodeForNote(a[a.length-d],b);if(null==e)return null;c=1==d?e:c.add(e)}return c};
Instrument.prototype.asString=function(){for(var a="",b="C ;C\u266f;D ;E\u266d;E ;F ;F\u266f;G ;A\u266d;A ;B\u266d;B ".split(";"),c=$jscomp.makeIterator(Object.entries(this.staves)),d=c.next();!d.done;d=c.next()){var e=$jscomp.makeIterator(d.value);d=e.next().value;e=e.next().value;a=a+this.name+" ["+d+"]:\n";for(d=0;d<e.nodes.length;++d)a=a+b[(d+e.min)%12]+" "+e.nodes[d].asString()+" => "+e.nodes[d].asDisplayString()+"\n"}return a};var prevIndex=-1;
function setInstrument(){var a=instrumentSelector.currentIndex,b=instrumentTables[a].keys;0>prevIndex?prevIndex=a:a!=prevIndex&&(octaveSelector.currentIndex=menuIndexForOctave("Concert"),prevIndex=a);null==instrumentTables[a].info?(infoButton.visible=!1,instrumentSelector.implicitWidth=300):(infoButton.visible=!0,instrumentSelector.implicitWidth=278);if(null==b)variantSelector.enabled=!1,variantSelector.model=[xsTr("N/A")];else{a=variantSelector.model;for(var c=[],d=0,e=0,f=0;f<b.length;++f){var g=
b[f].transpose;null==g&&(g=0);0==g&&(e=f);c[f]=b[f].name;c[f]!=a[f]&&++d}if(c.length!=a.length||0<d)variantSelector.model=c,variantSelector.currentIndex=e;variantSelector.enabled=!0}}function keyOffset(){var a=instrumentTables[instrumentSelector.currentIndex].keys;a=null==a?0:a[currentStyle.variantIndex].transpose;null==a&&(a=0);return a-=12*(currentStyle.octaveIndex-menuIndexForOctave("Concert"))}
function variant(){var a=instrumentTables[instrumentSelector.currentIndex].keys;a=null==a?null:a[currentStyle.variantIndex].staves;null==a&&(a="");return a}var ABOption=function(a){ABNode.call(this);this.ps=a.sort(function(b,c){return b.compareIndex(c)})};$jscomp.inherits(ABOption,ABNode);ABOption.prototype.isOption=function(){return!0};
ABOption.prototype.add=function(a){if(!a.isPlayable())return a;if(a.isNote()||a.isChord()){for(var b=[],c=$jscomp.makeIterator(this.ps),d=c.next();!d.done;d=c.next())d=d.value.add(a),d.isPlayable()&&b.push(d);return 0<b.length?new ABOption(b):new Unplayable("no playable options")}if(a.isOption()){b=[];c=$jscomp.makeIterator(this.ps);for(d=c.next();!d.done;d=c.next()){d=d.value;for(var e=$jscomp.makeIterator(a.ps),f=e.next();!f.done;f=e.next())f=d.add(f.value),f.isPlayable()&&b.push(f)}return 0<b.length?
new ABOption(b):new Unplayable(xsTr("no playable options"))}throw"can't add "+this.constructor.name+" to option";};ABOption.prototype.asString=function(){return this.ps.map(function(a){return a.isChord()?"("+a.asString()+")":a.asString()}).join("|")};ABOption.prototype.asDisplayString=function(){var a=this.asList().map(function(b){return b.asDisplayString()}).join("|");a=a.replace(/\u2423/g," ");return a=a.replace(/\u23ce/g,"\n")};ABOption.prototype.asList=function(){return this.ps};
ABOption.prototype.compareIndex=function(a){throw"can't compareIndex of "+this.constructor.name;};ABOption.prototype.pickOne=function(){return this.ps[0]};var Chord=function(a){ABNode.call(this);this.notes=a.sort(function(b,c){return b.compareIndex(c)})};$jscomp.inherits(Chord,ABNode);Chord.prototype.isChord=function(){return!0};
Chord.prototype.add=function(a){if(!a.isPlayable())return a;if(a.isOption())return a.add(this);if(a.isNote())return a=this.notes.concat([a]),newChordIfPlayable(a);if(a.isChord())return a=this.notes.concat(a.notes),newChordIfPlayable(a);throw"can't add "+this.constructor.name+" to chord";};Chord.prototype.asString=function(){return this.notes.map(function(a){return a.asString()}).join(",")};
Chord.prototype.asDisplayString=function(){var a=currentStyle.chordSeparator;if(1==this.notes.length)return this.notes[0].asDisplayString();a=this.notes.map(function(b){return b.asDisplayString()}).join(a);a=currentStyle.preChord+a+currentStyle.postChord;a=a.replace(/\u2423/g," ");return a=a.replace(/\u23ce/g,"\n")};
Chord.prototype.compareIndex=function(a){if(!a.isPlayable())return 1;if(a.isChordSym())return-1;if(a.isNote())return-a.compareIndex(this);if(a.isChord()){for(var b=0;b<this.notes.length&&b<a.notes.length;){var c=this.notes[b].compareIndex(a.notes[b]);if(0!=c)return c;++b}return b<this.notes.length?1:b<a.notes.length?-1:0}throw"can't compareIndex of "+a.constructor.name;};Chord.prototype.isPush=function(){return 1>this.notes.length?!1:this.notes[0].isPush()};
Chord.prototype.isPull=function(){return 1>this.notes.length?!1:this.notes[0].isPull()};function newChordIfPlayable(a){for(var b,c,d=$jscomp.makeIterator(a),e=d.next();!e.done;e=d.next())if(e=e.value,e.isPush()&&(c=e),e.isPull()&&(b=e),null!=b&&null!=c)return new Unplayable(xsTr("chord includes both push and pull notes")+" ("+c.asString()+" & "+b.asString()+")");return new Chord(a)}
var ExplicitChord=function(a,b){ABNode.call(this);this.pitches=b;this.pull=this.push=!1;this.inversion=0;b=/^(\+|\-)(.+)$/.exec(a);null!=b?("+"==b[1]&&(this.push=!0),"-"==b[1]&&(this.pull=!0),this.annotation=b[2]):this.annotation=a};$jscomp.inherits(ExplicitChord,ABNode);ExplicitChord.prototype.isChordSym=function(){return!0};ExplicitChord.prototype.asString=function(){var a=this.push?"+":"";a+=this.pull?"-":"";return a+this.annotation};
ExplicitChord.prototype.asDisplayString=function(){var a=this.annotation;this.push&&(a=currentStyle.prePush+a+currentStyle.postPush);this.pull&&(a=currentStyle.prePull+a+currentStyle.postPull);return a};ExplicitChord.prototype.compareIndex=function(a){return!a.isChordSym()||this.inversion>a.inversion?1:this.inversion<a.inversion?-1:this.asString().localeCompare(a.asString())};ExplicitChord.prototype.isPush=function(){return this.push};ExplicitChord.prototype.isPull=function(){return this.pull};
var SymbolicChord=function(a,b,c,d,e,f){ABNode.call(this);this.root=b;this.type=c;this.inversion=d;this.pitches=e;this.pull=this.push=!1;a=/^(\+|\-)(.*)$/.exec(a);null!=a&&("+"==a[1]&&(this.push=!0),"-"==a[1]&&(this.pull=!0));c=this.chordInfo(c);this.annotation=(c[2]?b.toLowerCase():b)+c[0];0<d&&c[1]&&(this.annotation+=f)};$jscomp.inherits(SymbolicChord,ABNode);SymbolicChord.prototype.isChordSym=function(){return!0};
SymbolicChord.prototype.asString=function(){var a=this.push?"+":"";a+=this.pull?"-":"";return a+this.root+this.type};SymbolicChord.prototype.asDisplayString=function(){var a=this.annotation;this.push&&(a=currentStyle.prePush+a+currentStyle.postPush);this.pull&&(a=currentStyle.prePull+a+currentStyle.postPull);return a};SymbolicChord.prototype.compareIndex=function(a){return!a.isChordSym()||this.inversion>a.inversion?1:this.inversion<a.inversion?-1:this.asString().localeCompare(a.asString())};
SymbolicChord.prototype.chordInfo=function(a){var b=chordStyleForIndex(chordStyleSelector.currentIndex),c=b[a];null==c&&(c=defaultChordStyle()[a]);null==c&&(c="?");a=b.slash;null==a&&(c=defaultChordStyle().slash);null==a&&(a=!1);b=b.lcchord;null==b&&(b=defaultChordStyle().lcchord);null==b&&(b=!1);return[c,a,b]};SymbolicChord.prototype.isPush=function(){return this.push};SymbolicChord.prototype.isPull=function(){return this.pull};
var chordTypes={"0,4,7":"maj","0,3,7":"min","0,3,6":"dim","0,4,8":"aug","0,4,7,10":"dom7","0,4,7,11":"maj7","0,3,7,10":"min7","0,3,6,10":"m7b5","0,3,6,9":"dim7","0,4,8,10":"aug7"},inversions=null;
function buildChord(a,b,c){null==inversions&&createInversions();if(null==b.staves)return null;c=b.staves[c];null==c&&(c=b.staves["default"]);if(null==c)return null;if(null==c.chords)if(c.auto)c.chords={};else return null;b=[];for(var d=0;d<a.length;++d)null!=a[d]&&b.push(a[d].pitch);b=b.sort(function(g,h){return g>h?1:g<h?-1:0});d=b.join(",");a=[];d=c.chords[d];var e=null==d?[]:d.split("|");for(d=0;d<e.length;++d){var f=new ExplicitChord(e[d],b);a.push(f)}if(0==a.length)for(c=analyseChord(c,b),d=
0;d<c.length;++d)a.push(c[d]);return 0==a.length?null:1==a.length?a[0]:new ABOption(a)}
function analyseChord(a,b){for(var c=[0],d=[0],e=[],f=1;f<b.length;++f){var g=(b[f]-b[0])%12;null==d[g]&&c.push(g);d[g]=1}c=c.sort(function(q,r){return q>r?1:q<r?-1:0});d=c.length;f=c.join(",");f=inversions[f];if(null==f)return[];g=f.split("|");for(f=0;f<g.length;++f){var h=g[f],k=/^(.+)\/(\d)$/.exec(h),m=0;null!=k&&(h=k[1],m=(d-k[2])%d);k=nameForNote((b[0]+c[m]+120)%12);var n=k+h,p="/"+nameForNote(b[0]%12),l=null;a.auto&&(l=0==m?n:n+p);n=null==l?[]:l.split("|");for(l=0;l<n.length;++l){var t=new SymbolicChord(n[l],
k,h,m,b,p);e.push(t)}}return e}function createInversions(){inversions={};for(var a=$jscomp.makeIterator(Object.entries(chordTypes)),b=a.next();!b.done;b=a.next()){b=$jscomp.makeIterator(b.value);var c=b.next().value;b=b.next().value;c=c.split(",");for(var d=c.length,e=0;e<d;++e){0<e&&(c=nextInversion(c));var f=c.join(","),g=b+"/"+e;inversions[f]=null==inversions[f]?g:inversions[f]+"|"+g}}}
function nextInversion(a){a=a.slice();var b=a.shift();a.push(b+12);b=a[0];for(var c=0;c<a.length;++c)a[c]-=b;return a}var Note=function(a,b,c,d){ABNode.call(this);this.pitch=a;this.push=b;this.hole=c;this.row=d;this.index=++currentIndex};$jscomp.inherits(Note,ABNode);Note.prototype.isNote=function(){return!0};
Note.prototype.add=function(a){if(!a.isPlayable())return a;if(a.isChord()||a.isOption())return a.add(this);if(a.isNote())return newChordIfPlayable([this,a]);throw"can't add "+this.constructor.name+" to note";};Note.prototype.asString=function(){return(this.push?"+":"-")+this.hole+"^".repeat(this.row)};
Note.prototype.asDisplayString=function(){var a=currentStyle.rowInside?currentStyle.preRow.repeat(this.row)+this.hole+currentStyle.postRow.repeat(this.row):this.hole;a=this.push?currentStyle.prePush+a+currentStyle.postPush:currentStyle.prePull+a+currentStyle.postPull;a=currentStyle.rowInside?a:currentStyle.preRow.repeat(this.row)+a+currentStyle.postRow.repeat(this.row);a=a.replace(/\u2423/g," ");return a=a.replace(/\u23ce/g,"\n")};
Note.prototype.compareIndex=function(a){if(!a.isPlayable())return 1;if(a.isChordSym())return-1;if(a.isNote())return this.index>a.index?1:this.index<a.index?-1:0;if(a.isChord()){var b=this.compare(a.notes[0]);return 0!=b?b:1<a.notes.length?-1:0}throw"can't compareIndex of "+a.constructor.name;};Note.prototype.isPush=function(){return this.push};Note.prototype.isPull=function(){return!this.push};var GenericNote=function(a){ABNode.call(this);this.pitch=a;this.index=this.pitch-9999};
$jscomp.inherits(GenericNote,ABNode);GenericNote.prototype.isNote=function(){return!0};GenericNote.prototype.add=function(a){if(!a.isPlayable())return a;if(a.isChord()||a.isOption())return a.add(this);if(a.isNote())return newChordIfPlayable([this,a]);throw"can't add "+this.constructor.name+" to generic note";};
GenericNote.prototype.asString=function(){var a=chordStyleForIndex(chordStyleSelector.currentIndex).lcbass;null==a&&(a=defaultChordStyle().lcbass);null==a&&(a=!1);var b=nameForNote(this.pitch%12);2>b.length&&(b+=" ");return a?b.toLowerCase():b};GenericNote.prototype.asDisplayString=function(){return this.asString()};
GenericNote.prototype.compareIndex=function(a){if(!a.isPlayable())return 1;if(a.isChordSym())return-1;if(a.isNote())return this.index>a.index?1:this.index<a.index?-1:0;if(a.isChord()){var b=this.compare(a.notes[0]);return 0!=b?b:1<a.notes.length?-1:0}throw"can't compareIndex of "+a.constructor.name;};var Unplayable=function(a){ABNode.call(this);this.reason=a;this.index=0};$jscomp.inherits(Unplayable,ABNode);Unplayable.prototype.isPlayable=function(){return!1};Unplayable.prototype.add=function(a){return this};
Unplayable.prototype.asString=function(){return"? "+this.reason};Unplayable.prototype.asDisplayString=function(){return"?"};Unplayable.prototype.compareIndex=function(a){return a.isPlayable()?-1:0};var includesCustom=!1;function instrumentList(){if(!includesCustom){for(var a=0;a<CI.instruments.length;++a)instrumentTables.push(CI.instruments[a]);includesCustom=!0}var b=[];for(a=0;a<instrumentTables.length;++a)b.push(instrumentTables[a].name);return b}
function parseTableElement(a,b){if("?"==a)return new Unplayable(xsTr("instrument can not play this note")+" ("+b+")");a=a.split("|");for(var c=[],d=0;d<a.length;++d){var e=a[d],f=/^(\+|\-)(\d+)(\^*)$/.exec(e);if(null==f)throw"syntax error in chord table: "+e+" ("+b+")";c[d]=new Note(b,"+"==f[1],f[2],f[3].length)}if(0==c.length)throw"empty note string in chord table ("+b+")";return 1==c.length?c[0]:new ABOption(c)}
function buildMeasureMap(a){var b={},c=1;a=a.newCursor();for(a.rewind(Cursor.SCORE_START);a.measure;){var d=a.measure,e=d.firstSegment.tick,f=d.timesigActual.denominator,g=d.timesigActual.numerator,h=4*division/f,k=h*g;c+=d.noOffset;e={tick:e,tsD:f,tsN:g,ticksB:h,ticksM:k,past:e+k,no:c};b[e.tick]=e;d.irregular||++c;a.nextMeasure()}return b}
function showPos(a,b){var c=a.segment.tick;b=b[a.measure.firstSegment.tick];var d="?";b&&c>=b.tick&&c<b.past&&(d=1+(c-b.tick)/b.ticksB);return"St"+(a.staffIdx+1)+" Vc"+(a.voice+1)+" Ms"+b.no+" Bt"+d}
function applyToSelectionOrScore(a){var b=Array.prototype.slice.call(arguments,1),c=curScore.newCursor();c.rewind(Cursor.SELECTION_START);if(c.segment){var d=c.staffIdx;c.rewind(Cursor.SELECTION_END);var e=c.staffIdx;if(c.tick){var f=!1;var g=c.tick}else f=!0;var h=Cursor.SELECTION_START}else d=0,e=curScore.nstaves-1,f=!0,h=Cursor.SCORE_START;for(;d<=e;++d)for(var k=0;4>k;++k)for(c.staffIdx=d,c.voice=k,c.rewind(h),c.staffIdx=d,c.voice=k;c.segment&&(f||c.tick<g);)c.element&&a.apply(null,[c].concat(b)),
c.next()}var maxLyricLine=-1;function dropLyrics(a,b){b=a.element;if((b.type==Element.CHORD||b.type==Element.REST)&&null!=b.parent&&null!=b.parent.annotations)for(var c=b.parent.annotations.length-1;0<=c;--c){var d=b.parent.annotations[c];null!=d&&9312==d.z&&removeElement(d)}c=b.notes;if(null!=c)for(d=0;d<c.length;++d)c[d].color="black";if(b.lyrics)for(c=b.lyrics.length-1;0<=c;--c)b=a.element.lyrics[c],9312==b.z?removeElement(b):c>maxLyricLine&&(maxLyricLine=c)}
function nameNotes(a,b,c){if(a.element.type===Element.CHORD){b=a.element.notes;for(var d=0,e=0;e<b.length;++e)null!=b[e].tieBack&&++d;if(d!=b.length&&(e=c.nodeForNotes(b,0==a.staffIdx?"treble":1==a.staffIdx?"bass":"other"),null!=e)){c=.4;altStyleSelector.currentIndex==menuIndexForAltStyle("Not Shown")&&(e=e.pickOne());d=maxLyricLine+1;e=e.asList();for(var f=[],g=0;g<e.length;++g){var h=newElement(Element.LYRICS);h.verse=d;var k=e[g],m=k.asDisplayString();currentStyle.pad&&(m=" "+m+" ");h.text=m;m=
k.isPull()&&pullUnderscore.checked||k.isPush()&&pushUnderscore.checked?4:0;for(var n=k.isPlayable()?"black":"orange",p=k.isPlayable()?0==g?"black":altStyleSelector.currentIndex==menuIndexForAltStyle("Grey")?currentStyle.altColour:"black":"orange",l=0;l<b.length;++l)b[l].color=n;n=0<g&&altStyleSelector.currentIndex==menuIndexForAltStyle("Italic")?2:0;l=fontButton.text;l!=xsTr("Lyric Font")&&(h.fontFace=l);h.fontSize=fontSizeSelector.currentValue;h.fontStyle=fontStyleSelector.currentIndex|m|n;h.color=
p;h.z=9312;m=h.bbox.bottom-h.bbox.top;0==g&&(p=.4*m,pullShift.checked||pushShift.checked)&&(c=k.isPull()?c+(pullShift.checked?2*p:0):k.isPush()?c+(pushShift.checked?2*p:0):c+p);0!=c&&(h.offsetY+=c);f.push(h);c+=1.4*m}altStyleSelector.currentIndex==menuIndexForAltStyle("Combined")&&(f=combineElements(f));for(g=0;g<f.length;++g)a.element.add(f[g])}}}
function combineElements(a){for(var b=a[0],c=b.text,d=1;d<a.length;++d){var e=a[d];if(e.fontSize!=b.fontSize||e.fontStyle!=b.fontStyle||e.color!=b.color)return a;c=c+"\n"+e.text}b.text=c;return[b]}
function annotate(){getStyleFromDialog();var a=new Instrument(instrumentSelector.currentIndex,keyOffset(),variant()),b=buildMeasureMap(curScore);maxLyricLine=-1;applyToSelectionOrScore(dropLyrics,b);applyToSelectionOrScore(nameNotes,b,a);if(labelBox.checked){a=a.name;b=instrumentTables[instrumentSelector.currentIndex].keys;null!=b&&(a=b[currentStyle.variantIndex].name+" "+a);b=curScore.newCursor();b.rewind(Cursor.SCORE_START);b.voice=0;b.staffIdx=0;var c=newElement(Element.SYSTEM_TEXT);c.text=a;c.color=
"black";c.z=9312;b.add(c)}}function resetAnnotations(){var a=buildMeasureMap(curScore);maxLyricLine=-1;applyToSelectionOrScore(dropLyrics,a)};
